fix(node-resizer): pass minWidth and minHeight to child components

This commit is contained in:
Christopher Möller
2022-12-06 19:25:45 +01:00
parent c8adc98fd2
commit 527cf13352
5 changed files with 17 additions and 3 deletions
+6
View File
@@ -1,5 +1,11 @@
# @reactflow/node-resizer
## 1.0.1
### Patch Changes
- pass `minWidth` and `minHeight` from `NodeResizer` component to `NodeResizeControl`
## 1.0.0
This is a new package that exports components to build a UI for resizing a node 🎉 It exports a [`<NodeResizer />`](https://reactflow.dev/docs/api/nodes/node-resizer/) component and a [`<NodeResizeControl />`](https://reactflow.dev/docs/api/nodes/node-resizer/#noderesizecontrol--component) component.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@reactflow/node-resizer",
"version": "1.0.0",
"version": "1.0.1",
"description": "A helper component for resizing nodes.",
"keywords": [
"react",
@@ -12,6 +12,8 @@ export default function NodeResizer({
lineClassName,
lineStyle,
color,
minWidth = 10,
minHeight = 10,
}: NodeResizerProps) {
if (!isVisible) {
return null;
@@ -28,6 +30,8 @@ export default function NodeResizer({
position={c}
variant={ResizeControlVariant.Line}
color={color}
minWidth={minWidth}
minHeight={minHeight}
/>
))}
{handleControls.map((c) => (
@@ -38,6 +42,8 @@ export default function NodeResizer({
nodeId={nodeId}
position={c}
color={color}
minWidth={minWidth}
minHeight={minHeight}
/>
))}
</>
+2
View File
@@ -9,6 +9,8 @@ export type NodeResizerProps = {
lineClassName?: string;
lineStyle?: CSSProperties;
isVisible?: boolean;
minWidth?: number;
minHeight?: number;
};
export type ControlLinePosition = 'top' | 'bottom' | 'left' | 'right';