Files
20260512-skg-tk/web/components/nodes/resize-handle.tsx

28 lines
811 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client"
import { NodeResizeControl } from "@xyflow/react"
/** 节点右边缘 resize 把手高度跟随节点宽度可拖2401200px。平时透明hover 显紫色细条。 */
export function ResizeRight({ minWidth = 240, maxWidth = 1200 }: { minWidth?: number; maxWidth?: number }) {
return (
<NodeResizeControl
position="right"
minWidth={minWidth}
maxWidth={maxWidth}
style={{
background: "transparent",
border: "none",
width: 8,
height: "100%",
right: 0,
top: 0,
transform: "translateX(50%)",
}}
>
<div
className="w-full h-full hover:bg-violet-400/50 active:bg-violet-400/80 transition rounded-r"
style={{ cursor: "ew-resize" }}
/>
</NodeResizeControl>
)
}