feat(xy-resizer): add resize direction #2986

This commit is contained in:
moklick
2025-04-17 12:54:47 +02:00
parent af1c85281e
commit bee2f4aa05
6 changed files with 59 additions and 3 deletions
@@ -32,6 +32,7 @@ function ResizeControl({
maxWidth = Number.MAX_VALUE,
maxHeight = Number.MAX_VALUE,
keepAspectRatio = false,
resizeDirection,
shouldResize,
onResizeStart,
onResize,
@@ -166,6 +167,7 @@ function ResizeControl({
maxHeight,
},
keepAspectRatio,
resizeDirection,
onResizeStart,
onResize,
onResizeEnd,
@@ -3,6 +3,7 @@ import type {
ControlPosition,
ControlLinePosition,
ResizeControlVariant,
ResizeControlDirection,
ShouldResize,
OnResizeStart,
OnResize,
@@ -97,6 +98,11 @@ export type ResizeControlProps = Pick<
* @example ResizeControlVariant.Handle, ResizeControlVariant.Line
*/
variant?: ResizeControlVariant;
/**
* The direction the user can resize the node.
* If not provided, the user can resize in any direction.
*/
resizeDirection?: ResizeControlDirection;
className?: string;
style?: CSSProperties;
children?: ReactNode;