@bioturing/components 0.42.0-beta.1 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/component.d.ts.map +1 -1
- package/dist/components/button/component.js +41 -34
- package/dist/components/button/component.js.map +1 -1
- package/dist/components/button/style.css +1 -1
- package/dist/components/combobox/component.d.ts.map +1 -1
- package/dist/components/combobox/component.js +136 -126
- package/dist/components/combobox/component.js.map +1 -1
- package/dist/components/command-palette/component.d.ts +7 -0
- package/dist/components/command-palette/component.d.ts.map +1 -1
- package/dist/components/command-palette/component.js +35 -33
- package/dist/components/command-palette/component.js.map +1 -1
- package/dist/components/dropdown-menu/component.d.ts +8 -1
- package/dist/components/dropdown-menu/component.d.ts.map +1 -1
- package/dist/components/dropdown-menu/component.js +165 -141
- package/dist/components/dropdown-menu/component.js.map +1 -1
- package/dist/components/dropdown-menu/style.css +1 -1
- package/dist/components/ds-root/component.d.ts +6 -1
- package/dist/components/ds-root/component.d.ts.map +1 -1
- package/dist/components/ds-root/component.js +15 -14
- package/dist/components/ds-root/component.js.map +1 -1
- package/dist/components/form/style.css +1 -1
- package/dist/components/hooks/index.d.ts +0 -1
- package/dist/components/hooks/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/label-with-help/component.d.ts +20 -0
- package/dist/components/label-with-help/component.d.ts.map +1 -0
- package/dist/components/label-with-help/component.js +39 -0
- package/dist/components/label-with-help/component.js.map +1 -0
- package/dist/components/label-with-help/index.d.ts +2 -0
- package/dist/components/label-with-help/index.d.ts.map +1 -0
- package/dist/components/label-with-help/style.css +1 -0
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +157 -133
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/popup-panel/component.d.ts +2 -111
- package/dist/components/popup-panel/component.d.ts.map +1 -1
- package/dist/components/popup-panel/component.js +253 -139
- package/dist/components/popup-panel/component.js.map +1 -1
- package/dist/components/popup-panel/constants.d.ts +1 -0
- package/dist/components/popup-panel/constants.d.ts.map +1 -1
- package/dist/components/popup-panel/constants.js +2 -0
- package/dist/components/popup-panel/constants.js.map +1 -1
- package/dist/components/popup-panel/index.d.ts +1 -0
- package/dist/components/popup-panel/index.d.ts.map +1 -1
- package/dist/components/popup-panel/types.d.ts +124 -0
- package/dist/components/popup-panel/types.d.ts.map +1 -0
- package/dist/components/popup-panel/utils.d.ts +1 -1
- package/dist/components/popup-panel/utils.d.ts.map +1 -1
- package/dist/components/popup-panel/utils.js +5 -5
- package/dist/components/popup-panel/utils.js.map +1 -1
- package/dist/components/resizable/component.d.ts.map +1 -1
- package/dist/components/resizable/component.js +28 -28
- package/dist/components/resizable/component.js.map +1 -1
- package/dist/components/select/component.d.ts.map +1 -1
- package/dist/components/select/component.js +130 -120
- package/dist/components/select/component.js.map +1 -1
- package/dist/components/toast/component.d.ts +2 -2
- package/dist/components/toast/component.d.ts.map +1 -1
- package/dist/components/toast/component.js +14 -20
- package/dist/components/toast/component.js.map +1 -1
- package/dist/components/toast/function.d.ts +7 -8
- package/dist/components/toast/function.d.ts.map +1 -1
- package/dist/components/toast/function.js.map +1 -1
- package/dist/components/toast/style.css +1 -1
- package/dist/components/toast/types.d.ts +4 -0
- package/dist/components/toast/types.d.ts.map +1 -1
- package/dist/components/utils/placement.d.ts +9 -2
- package/dist/components/utils/placement.d.ts.map +1 -1
- package/dist/components/utils/placement.js +29 -18
- package/dist/components/utils/placement.js.map +1 -1
- package/dist/components/utils/reactElement.d.ts +2 -0
- package/dist/components/utils/reactElement.d.ts.map +1 -1
- package/dist/components/utils/reactElement.js +10 -2
- package/dist/components/utils/reactElement.js.map +1 -1
- package/dist/components/utils/renderProp.d.ts.map +1 -1
- package/dist/components/utils/renderProp.js +9 -8
- package/dist/components/utils/renderProp.js.map +1 -1
- package/dist/index.js +191 -189
- package/dist/metadata.d.ts +8 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +15 -0
- package/dist/metadata.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +2 -2
- package/dist/components/hooks/useBaseUIPlacement.d.ts +0 -64
- package/dist/components/hooks/useBaseUIPlacement.d.ts.map +0 -1
- package/dist/components/hooks/useBaseUIPlacement.js +0 -61
- package/dist/components/hooks/useBaseUIPlacement.js.map +0 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Popover } from '@base-ui/react/popover';
|
|
2
|
+
import { PopupPanelSize } from './constants';
|
|
3
|
+
import { RefObject } from 'react';
|
|
4
|
+
export type PopupPanelPlacement = "top" | "left" | "right" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
|
|
5
|
+
export interface PopupPanelProps extends Omit<React.ComponentPropsWithRef<"div">, "title" | "content" | "children">, Omit<Popover.Root.Props, "children"> {
|
|
6
|
+
/** The trigger element that opens the popup panel */
|
|
7
|
+
children?: React.ComponentProps<typeof Popover.Trigger>["render"];
|
|
8
|
+
/** Placement of the popup panel relative to its trigger */
|
|
9
|
+
placement?: PopupPanelPlacement;
|
|
10
|
+
/** Whether to open the popup panel on hover */
|
|
11
|
+
openOnHover?: boolean;
|
|
12
|
+
/** Controls the open state of the popup panel */
|
|
13
|
+
open?: boolean;
|
|
14
|
+
/** Callback fired when the open state changes */
|
|
15
|
+
onOpenChange?: Popover.Root.Props["onOpenChange"];
|
|
16
|
+
/** Content to display inside the popup panel */
|
|
17
|
+
content?: React.ReactNode;
|
|
18
|
+
/** Title text or element to display in the panel header */
|
|
19
|
+
title?: React.ReactNode;
|
|
20
|
+
/** The event that triggers the popup panel */
|
|
21
|
+
/**
|
|
22
|
+
* @default "click"
|
|
23
|
+
*/
|
|
24
|
+
trigger?: "click" | "hover";
|
|
25
|
+
/** Custom anchor element for positioning the panel */
|
|
26
|
+
anchor?: Popover.Positioner.Props["anchor"];
|
|
27
|
+
/** Content to display before the close button */
|
|
28
|
+
beforeCloseButton?: React.ReactNode;
|
|
29
|
+
/** Content to display after the close button */
|
|
30
|
+
afterCloseButton?: React.ReactNode;
|
|
31
|
+
/** Content to display after the title */
|
|
32
|
+
afterTitle?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Predefined sizes for the popup panel
|
|
35
|
+
* - xsmall: 320px
|
|
36
|
+
* - small: 400px
|
|
37
|
+
* - medium: 480px (default)
|
|
38
|
+
* - large: 640px
|
|
39
|
+
* - xlarge: 840px
|
|
40
|
+
* @default "medium" for default type, "xsmall" for other types
|
|
41
|
+
*/
|
|
42
|
+
size?: keyof typeof PopupPanelSize;
|
|
43
|
+
/**
|
|
44
|
+
* Footer content for the popup panel
|
|
45
|
+
* Can be a React node or a function that returns a React node
|
|
46
|
+
*/
|
|
47
|
+
footer?: React.ReactNode | ((props: {
|
|
48
|
+
close: () => void;
|
|
49
|
+
}) => React.ReactNode);
|
|
50
|
+
/**
|
|
51
|
+
* Whether the panel should be open by default when uncontrolled
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
defaultOpen?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the panel should be resizable
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
resizable?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the panel should be draggable
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
draggable?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Whether to maintain aspect ratio when resizing
|
|
67
|
+
* Only applies when resizable is true
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
maintainAspectRatio?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Custom class names for different parts of the popup panel
|
|
73
|
+
* @default {}
|
|
74
|
+
*/
|
|
75
|
+
classNames?: {
|
|
76
|
+
root?: string;
|
|
77
|
+
trigger?: string;
|
|
78
|
+
popup?: string;
|
|
79
|
+
header?: string;
|
|
80
|
+
title?: string;
|
|
81
|
+
content?: string;
|
|
82
|
+
footer?: string;
|
|
83
|
+
resizeHandle?: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Whether to close the panel when clicking outside
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
closeOnClickOutside?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Whether to use modal mode
|
|
92
|
+
* @default false
|
|
93
|
+
*/
|
|
94
|
+
modal?: Popover.Root.Props["modal"];
|
|
95
|
+
/**
|
|
96
|
+
* Callback function when the placement changes
|
|
97
|
+
*/
|
|
98
|
+
onPlacementChange?: (placement: PopupPanelPlacement) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Props to pass to the positioner
|
|
101
|
+
*/
|
|
102
|
+
positionerProps?: Popover.Positioner.Props;
|
|
103
|
+
/**
|
|
104
|
+
* Props to pass to the trigger
|
|
105
|
+
*/
|
|
106
|
+
triggerProps?: Popover.Trigger.Props;
|
|
107
|
+
/**
|
|
108
|
+
* Props to pass to the portal
|
|
109
|
+
*/
|
|
110
|
+
portalProps?: Popover.Portal.Props;
|
|
111
|
+
/**
|
|
112
|
+
* Reference element to offset the popup panel from
|
|
113
|
+
* If not provided, the panel will be positioned relative to the trigger element
|
|
114
|
+
*/
|
|
115
|
+
offsetFrom?: RefObject<HTMLElement>;
|
|
116
|
+
/**
|
|
117
|
+
* Whether the trigger should act as a native button element.
|
|
118
|
+
* Set to false when using non-button elements as trigger
|
|
119
|
+
* to suppress Base UI warnings and remove native button semantics.
|
|
120
|
+
* @default true
|
|
121
|
+
*/
|
|
122
|
+
nativeButton?: boolean;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/popup-panel/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,E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C;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IACnC;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACpC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -6,5 +6,5 @@ import { ResizableProps } from '../resizable';
|
|
|
6
6
|
* @param align - The alignment on that side (start, end, center)
|
|
7
7
|
* @returns Object with boolean flags for each resize handle
|
|
8
8
|
*/
|
|
9
|
-
export declare function anchorToResizeHandles(side: BaseUISide,
|
|
9
|
+
export declare function anchorToResizeHandles(side: BaseUISide, _align: BaseUIAlign): ResizableProps["handles"];
|
|
10
10
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/popup-panel/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,UAAU,EAChB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/popup-panel/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,WAAW,GAClB,cAAc,CAAC,SAAS,CAAC,CAkC3B"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function r
|
|
2
|
-
const
|
|
1
|
+
function l(r, o) {
|
|
2
|
+
const t = {
|
|
3
3
|
top: !1,
|
|
4
4
|
bottom: !1,
|
|
5
5
|
left: !1,
|
|
6
6
|
right: !1
|
|
7
|
-
};
|
|
8
|
-
return
|
|
7
|
+
}, e = r === "inline-start" ? "left" : r === "inline-end" ? "right" : r;
|
|
8
|
+
return e === "top" ? (t.left = !0, t.right = !0, t.top = !0) : e === "bottom" ? (t.left = !0, t.right = !0, t.bottom = !0) : e === "left" ? (t.top = !0, t.bottom = !0, t.left = !0) : e === "right" && (t.top = !0, t.bottom = !0, t.right = !0), t;
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
l as anchorToResizeHandles
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/popup-panel/utils.ts"],"sourcesContent":["import { BaseUISide, BaseUIAlign } from \"../utils/placement\";\nimport { ResizableProps } from \"../resizable\";\n\n/**\n * Convert anchor position (side + align) to resize handles\n * @param side - The side of the anchor (top, bottom, left, right)\n * @param align - The alignment on that side (start, end, center)\n * @returns Object with boolean flags for each resize handle\n */\nexport function anchorToResizeHandles(\n side: BaseUISide,\n
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/components/popup-panel/utils.ts"],"sourcesContent":["import { BaseUISide, BaseUIAlign } from \"../utils/placement\";\nimport { ResizableProps } from \"../resizable\";\n\n/**\n * Convert anchor position (side + align) to resize handles\n * @param side - The side of the anchor (top, bottom, left, right)\n * @param align - The alignment on that side (start, end, center)\n * @returns Object with boolean flags for each resize handle\n */\nexport function anchorToResizeHandles(\n side: BaseUISide,\n _align: BaseUIAlign,\n): ResizableProps[\"handles\"] {\n const handles: ResizableProps[\"handles\"] = {\n top: false,\n bottom: false,\n left: false,\n right: false,\n };\n\n const physicalSide =\n side === \"inline-start\" ? \"left\" : side === \"inline-end\" ? \"right\" : side;\n\n if (physicalSide === \"top\") {\n // For top/bottom, start maps to right, end maps to left\n handles[\"left\"] = true;\n handles[\"right\"] = true;\n handles[\"top\"] = true;\n } else if (physicalSide === \"bottom\") {\n // For left/right, start maps to bottom, end maps to top\n handles[\"left\"] = true;\n handles[\"right\"] = true;\n handles[\"bottom\"] = true;\n } else if (physicalSide === \"left\") {\n // For left/right, start maps to bottom, end maps to top\n handles[\"top\"] = true;\n handles[\"bottom\"] = true;\n handles[\"left\"] = true;\n } else if (physicalSide === \"right\") {\n // For left/right, start maps to bottom, end maps to top\n handles[\"top\"] = true;\n handles[\"bottom\"] = true;\n handles[\"right\"] = true;\n }\n\n return handles;\n}\n"],"names":["anchorToResizeHandles","side","_align","handles","physicalSide"],"mappings":"AASO,SAASA,EACdC,GACAC,GAC2B;AAC3B,QAAMC,IAAqC;AAAA,IACzC,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,GAGHC,IACJH,MAAS,iBAAiB,SAASA,MAAS,eAAe,UAAUA;AAEvE,SAAIG,MAAiB,SAEnBD,EAAQ,OAAU,IAClBA,EAAQ,QAAW,IACnBA,EAAQ,MAAS,MACRC,MAAiB,YAE1BD,EAAQ,OAAU,IAClBA,EAAQ,QAAW,IACnBA,EAAQ,SAAY,MACXC,MAAiB,UAE1BD,EAAQ,MAAS,IACjBA,EAAQ,SAAY,IACpBA,EAAQ,OAAU,MACTC,MAAiB,YAE1BD,EAAQ,MAAS,IACjBA,EAAQ,SAAY,IACpBA,EAAQ,QAAW,KAGdA;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/resizable/component.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,UAAU,EACf,cAAc,IAAI,iBAAiB,EACpC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAIL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/resizable/component.tsx"],"names":[],"mappings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
|
|
4
|
-
import { useResizable as
|
|
5
|
-
import
|
|
6
|
-
import { mergeProps as
|
|
3
|
+
import Z, { forwardRef as $, useState as b, useCallback as K, useEffect as C, isValidElement as A } from "react";
|
|
4
|
+
import { useResizable as ee } from "../hooks/useResizable.js";
|
|
5
|
+
import te from "merge-refs";
|
|
6
|
+
import { mergeProps as re } from "@base-ui/react";
|
|
7
7
|
import './style.css';/* empty css */
|
|
8
|
-
import { getReactElementProp as v } from "../utils/reactElement.js";
|
|
9
|
-
import { useCls as
|
|
10
|
-
import { clsx as c, cn as
|
|
11
|
-
import { WithRenderProp as
|
|
12
|
-
const
|
|
8
|
+
import { getReactElementRef as oe, getReactElementProp as v } from "../utils/reactElement.js";
|
|
9
|
+
import { useCls as ie } from "../utils/antdUtils.js";
|
|
10
|
+
import { clsx as c, cn as le } from "../utils/cn.js";
|
|
11
|
+
import { WithRenderProp as se } from "../utils/WithRenderProp.js";
|
|
12
|
+
const ze = $(
|
|
13
13
|
({
|
|
14
14
|
children: m,
|
|
15
15
|
resizable: a = !1,
|
|
@@ -27,7 +27,7 @@ const pe = Z(
|
|
|
27
27
|
lockVertical: _,
|
|
28
28
|
onResize: j,
|
|
29
29
|
onDragEnd: P,
|
|
30
|
-
onDragStart:
|
|
30
|
+
onDragStart: R,
|
|
31
31
|
disabled: q,
|
|
32
32
|
maintainAspectRatio: o = !1,
|
|
33
33
|
interval: F,
|
|
@@ -36,7 +36,7 @@ const pe = Z(
|
|
|
36
36
|
// other With Render Props
|
|
37
37
|
...J
|
|
38
38
|
}, L) => {
|
|
39
|
-
const s =
|
|
39
|
+
const s = ie(), [d, M] = b(null), [g, p] = b(), [u, z] = b(), [H, w] = b(!1), O = K(
|
|
40
40
|
(e) => {
|
|
41
41
|
if (M(e), e && !g && !u) {
|
|
42
42
|
const r = e.getBoundingClientRect();
|
|
@@ -52,7 +52,7 @@ const pe = Z(
|
|
|
52
52
|
e.width > 0 && e.height > 0 && (o ? (p(e.width), z(e.height)) : (p(void 0), z(void 0)));
|
|
53
53
|
}
|
|
54
54
|
}, [y, d, o]);
|
|
55
|
-
const
|
|
55
|
+
const E = ee({
|
|
56
56
|
initialWidth: o ? g : I,
|
|
57
57
|
initialHeight: o ? u : G,
|
|
58
58
|
maxHeight: B,
|
|
@@ -66,20 +66,20 @@ const pe = Z(
|
|
|
66
66
|
maintainAspectRatio: o,
|
|
67
67
|
interval: F,
|
|
68
68
|
onDragStart: (e) => {
|
|
69
|
-
if (
|
|
69
|
+
if (w(!0), d) {
|
|
70
70
|
const r = d.getBoundingClientRect();
|
|
71
71
|
r.width > 0 && !g && p(r.width), r.height > 0 && !u && z(r.height);
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
R && R(e);
|
|
74
74
|
},
|
|
75
75
|
onDragEnd: (e) => {
|
|
76
|
-
|
|
76
|
+
w(!1), P && P(e);
|
|
77
77
|
}
|
|
78
|
-
}),
|
|
78
|
+
}), k = A(m);
|
|
79
79
|
C(() => {
|
|
80
80
|
H ? document.body.style.userSelect = "none" : document.body.style.userSelect = "";
|
|
81
81
|
}, [H]);
|
|
82
|
-
const { ref: Q, ...T } =
|
|
82
|
+
const { ref: Q, ...T } = E.getRootProps(), n = E.getHandleProps, U = a ? [
|
|
83
83
|
t.top && !o && /* @__PURE__ */ i(
|
|
84
84
|
"div",
|
|
85
85
|
{
|
|
@@ -210,42 +210,42 @@ const pe = Z(
|
|
|
210
210
|
},
|
|
211
211
|
"bottom-left-corner"
|
|
212
212
|
)
|
|
213
|
-
] : [], f = m, h = {
|
|
213
|
+
] : [], f = m, X = oe(f), h = {
|
|
214
214
|
className: v(f, "className"),
|
|
215
215
|
style: v(f, "style"),
|
|
216
216
|
children: v(f, "children")
|
|
217
|
-
},
|
|
218
|
-
className:
|
|
217
|
+
}, Y = {
|
|
218
|
+
className: le(
|
|
219
219
|
a && s("resizable"),
|
|
220
220
|
l?.root,
|
|
221
221
|
h.className,
|
|
222
222
|
N
|
|
223
223
|
),
|
|
224
|
-
ref:
|
|
224
|
+
ref: te(
|
|
225
225
|
a ? Q : void 0,
|
|
226
226
|
O,
|
|
227
227
|
// Always need this for dimension measurement
|
|
228
|
-
|
|
228
|
+
X,
|
|
229
229
|
L
|
|
230
230
|
),
|
|
231
231
|
style: { ...h.style, ...W },
|
|
232
232
|
...H ? { "data-resizing": !0 } : {},
|
|
233
233
|
...a ? { "data-resizable": !0 } : {},
|
|
234
|
-
children:
|
|
234
|
+
children: k ? [
|
|
235
235
|
...Array.isArray(h.children) ? h.children : [h.children],
|
|
236
236
|
...U.filter(Boolean)
|
|
237
237
|
] : m
|
|
238
238
|
};
|
|
239
239
|
return /* @__PURE__ */ i(
|
|
240
|
-
|
|
240
|
+
se,
|
|
241
241
|
{
|
|
242
242
|
render: (e) => {
|
|
243
|
-
const r =
|
|
243
|
+
const r = re(
|
|
244
244
|
e,
|
|
245
|
-
|
|
245
|
+
Y,
|
|
246
246
|
a ? T : {}
|
|
247
247
|
);
|
|
248
|
-
return
|
|
248
|
+
return k ? Z.cloneElement(f, r) : /* @__PURE__ */ i("div", { ...r, children: m });
|
|
249
249
|
},
|
|
250
250
|
...J
|
|
251
251
|
}
|
|
@@ -253,6 +253,6 @@ const pe = Z(
|
|
|
253
253
|
}
|
|
254
254
|
);
|
|
255
255
|
export {
|
|
256
|
-
|
|
256
|
+
ze as Resizable
|
|
257
257
|
};
|
|
258
258
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/resizable/component.tsx"],"sourcesContent":["\"use client\";\nimport React, {\n useCallback,\n useEffect,\n useState,\n isValidElement,\n forwardRef,\n} from \"react\";\nimport {\n useResizable,\n type MoveValues,\n ResizableProps as UseResizableProps,\n} from \"../hooks/useResizable\";\nimport mergeRefs from \"merge-refs\";\nimport {\n useCls,\n clsx,\n WithRenderProp,\n WithRenderPropProps,\n cn,\n getReactElementProp,\n} from \"../utils\";\nimport { mergeProps } from \"@base-ui/react\";\n\nimport \"./style.css\";\n// import { on } from \"node:stream\";\n\nexport interface ResizableProps\n extends Omit<WithRenderPropProps, keyof UseResizableProps>,\n UseResizableProps {\n /**\n * Single React element child that will be enhanced with resize handles\n */\n children: React.ReactNode;\n /**\n * Whether the component should be resizable\n * @default false\n */\n resizable?: boolean;\n /**\n * Configure which resize handles to show\n * @default { bottom: true, right: true, left: true, top: true }\n */\n handles?: {\n bottom?: boolean;\n right?: boolean;\n left?: boolean;\n top?: boolean;\n };\n // /**\n // * Whether to use absolute positioning for left handle resizing\n // * Set to true when used in absolutely positioned containers like PopupPanel\n // * @default false\n // */\n // absolutePositioning?: boolean;\n /**\n * Custom class names for different parts of the resizable component\n */\n classNames?: {\n root?: string;\n resizeHandle?: string;\n };\n /**\n * Key to reset dimensions to current element size\n * When this value changes, the component will recalculate its dimensions\n * Similar to React's key prop pattern for forcing component resets\n */\n resetKey?: React.Key;\n /**\n * Maximum width the component can be resized to\n */\n maxWidth?: number;\n /**\n * Maximum height the component can be resized to\n */\n maxHeight?: number;\n /**\n * Minimum width the component can be resized to\n */\n minWidth?: number;\n /**\n * Minimum height the component can be resized to\n */\n minHeight?: number;\n /**\n * Callback fired during resize operations\n */\n onResize?: (values: MoveValues) => void;\n /**\n * Whether to maintain aspect ratio during resize\n * @default false\n */\n maintainAspectRatio?: boolean;\n}\n\nexport const Resizable = forwardRef<HTMLDivElement, ResizableProps>(\n (\n {\n children,\n resizable = false,\n handles = { bottom: true, right: true, left: true, top: true },\n classNames,\n className: containerClassName,\n style: containerStyle,\n resetKey,\n\n // Use Resizable Props\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n lockHorizontal,\n lockVertical,\n onResize,\n onDragEnd: onDragEndProp,\n onDragStart: onDragStartProp,\n disabled,\n maintainAspectRatio = false,\n interval,\n initialHeight: initialHeightProp,\n initialWidth: initialWidthProp,\n // other With Render Props\n ...rest\n },\n ref\n ) => {\n // Validate that children is a single React element\n // if (!isValidElement(children)) {\n // throw new Error(\n // \"Resizable component expects a single React element as children\"\n // );\n // }\n\n const cls = useCls();\n const [panelRef, setPanelRef] = useState<HTMLDivElement | null>(null);\n const [width, setWidth] = useState<number>();\n const [height, setHeight] = useState<number>();\n const [resizing, setResizing] = useState(false);\n\n const callbackRef = useCallback(\n (node: HTMLDivElement) => {\n setPanelRef(node);\n\n // Get initial dimensions only once when ref is set\n // For aspect ratio maintenance, we need initial dimensions immediately\n // Otherwise, preserve natural width/height behavior\n if (node && !width && !height) {\n const rect = node.getBoundingClientRect();\n if (rect.width > 0 && rect.height > 0) {\n if (maintainAspectRatio) {\n // Need dimensions for aspect ratio calculation\n setWidth(rect.width);\n setHeight(rect.height);\n }\n // For non-aspect-ratio cases, don't set dimensions to preserve natural behavior\n }\n }\n },\n [width, height, maintainAspectRatio]\n );\n\n // Reset dimensions when resetKey changes\n useEffect(() => {\n if (resetKey !== undefined && panelRef) {\n // Clear the hook's inline styles to reset to natural size\n panelRef.style.width = \"\";\n panelRef.style.height = \"\";\n\n // Force a reflow to get natural dimensions\n const rect = panelRef.getBoundingClientRect();\n\n if (rect.width > 0 && rect.height > 0) {\n if (maintainAspectRatio) {\n // For aspect ratio maintenance, re-measure and set dimensions\n setWidth(rect.width);\n setHeight(rect.height);\n } else {\n // Reset state to allow natural dimensions again\n setWidth(undefined);\n setHeight(undefined);\n }\n\n // Don't apply any explicit dimensions - let them remain natural\n // panelRef.style.width = `${rect.width}px`;\n // panelRef.style.height = `${rect.height}px`;\n }\n }\n }, [resetKey, panelRef, maintainAspectRatio]);\n\n // Initialize useResizable with current dimensions (or undefined if not ready)\n // For aspect ratio maintenance, we need initial dimensions\n // Otherwise, preserve natural width/height behavior until user starts resizing\n const resizableHook = useResizable({\n initialWidth: maintainAspectRatio ? width : initialWidthProp,\n initialHeight: maintainAspectRatio ? height : initialHeightProp,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n lockHorizontal,\n lockVertical,\n onResize,\n disabled,\n maintainAspectRatio,\n interval,\n onDragStart: (values) => {\n setResizing(true);\n // Capture natural dimensions when user starts resizing\n if (panelRef) {\n const rect = panelRef.getBoundingClientRect();\n if (rect.width > 0 && !width) {\n setWidth(rect.width);\n }\n if (rect.height > 0 && !height) {\n setHeight(rect.height);\n }\n }\n if (onDragStartProp) onDragStartProp(values);\n },\n onDragEnd: (values) => {\n setResizing(false);\n if (onDragEndProp) onDragEndProp(values);\n },\n });\n\n const isChildrenValidElement = isValidElement(children);\n\n useEffect(() => {\n if (resizing) {\n document.body.style.userSelect = \"none\";\n } else {\n document.body.style.userSelect = \"\";\n }\n }, [resizing]);\n\n // Get resizable props - useResizable hook handles cases where dimensions aren't ready\n const { ref: rootRefProp, ...rootPropsWithoutRef } =\n resizableHook.getRootProps();\n const getHandleProps = resizableHook.getHandleProps;\n\n // // Handle reverse handle change for horizontal resizing (only for absolute positioning)\n // const onReverseHandleChangeHorizontal = (\n // parent: React.RefObject<HTMLDivElement>,\n // values: MoveValues\n // ) => {\n // if (!parent.current || !absolutePositioning) return;\n // const { widthDiff } = values;\n // parent.current.style.left = `${\n // parseInt(parent.current.style.left || \"0\") - widthDiff\n // }px`;\n // };\n\n // // Handle reverse handle change for vertical resizing (only for absolute positioning)\n // const onReverseHandleChangeVertical = (\n // parent: React.RefObject<HTMLDivElement>,\n // values: MoveValues\n // ) => {\n // if (!parent.current || !absolutePositioning) return;\n // const { heightDiff } = values;\n // console.log({\n // parentStyleTop: parent.current.style.top,\n // computedStyleTop: window.getComputedStyle(parent.current).top,\n // });\n // parent.current.style.top = `${\n // parseInt(parent.current.style.top || \"0\") - heightDiff\n // }px`;\n // };\n\n const resizeHandles = resizable\n ? [\n handles.top && !maintainAspectRatio && (\n <div\n key=\"top\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle\n )}\n data-placement=\"top-center\"\n {...getHandleProps({\n reverse: true,\n lockHorizontal: true,\n // onResize: (values) =>\n // onReverseHandleChangeVertical(rootRef, values),\n })}\n />\n ),\n handles.bottom && !maintainAspectRatio && (\n <div\n key=\"bottom\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle\n )}\n data-placement=\"bottom-left\"\n {...getHandleProps({\n lockHorizontal: true,\n })}\n />\n ),\n handles.left && !maintainAspectRatio && (\n <div\n key=\"left\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle\n )}\n data-placement=\"top-left\"\n {...getHandleProps({\n reverse: true,\n lockVertical: true,\n // onResize: (values) =>\n // onReverseHandleChangeHorizontal(rootRef, values),\n })}\n />\n ),\n handles.right && !maintainAspectRatio && (\n <div\n key=\"right\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle\n )}\n data-placement=\"top-right\"\n {...getHandleProps({\n lockVertical: true,\n })}\n />\n ),\n handles.right && handles.bottom && (\n <div\n key=\"bottom-right-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle\n )}\n data-placement=\"bottom-right-corner\"\n {...getHandleProps({\n // No locks - allow both horizontal and vertical resizing\n corner: \"bottom-right\",\n })}\n />\n ),\n handles.left && handles.top && (\n <div\n key=\"top-left-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle\n )}\n data-placement=\"top-left-corner\"\n {...getHandleProps({\n corner: \"top-left\",\n // onResize: (values) => {\n // onReverseHandleChangeHorizontal(rootRef, values);\n // onReverseHandleChangeVertical(rootRef, values);\n // },\n })}\n />\n ),\n handles.right && handles.top && (\n <div\n key=\"top-right-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle\n )}\n data-placement=\"top-right-corner\"\n {...getHandleProps({\n corner: \"top-right\",\n // onResize: (values) => {\n // onReverseHandleChangeVertical(rootRef, values);\n // },\n })}\n />\n ),\n handles.left && handles.bottom && (\n <div\n key=\"bottom-left-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle\n )}\n data-placement=\"bottom-left-corner\"\n {...getHandleProps({\n corner: \"bottom-left\",\n // onResize: (values) => {\n // onReverseHandleChangeHorizontal(rootRef, values);\n // onReverseHandleChangeVertical(rootRef, values);\n // },\n })}\n />\n ),\n ]\n : [];\n\n const childElement = children as React.ReactElement & {\n ref?: React.Ref<HTMLDivElement>;\n };\n\n const childElementProps = {\n className: getReactElementProp<string>(childElement, \"className\"),\n style: getReactElementProp<React.CSSProperties>(childElement, \"style\"),\n children: getReactElementProp<React.ReactNode>(childElement, \"children\"),\n ref: childElement.ref,\n };\n\n const childProps = {\n className: cn(\n resizable && cls(\"resizable\"),\n classNames?.root,\n childElementProps.className,\n containerClassName\n ),\n ref: mergeRefs(\n resizable ? rootRefProp : undefined,\n callbackRef, // Always need this for dimension measurement\n childElement?.ref,\n ref\n ),\n style: { ...childElementProps.style, ...containerStyle },\n ...(resizing ? { \"data-resizing\": true } : {}),\n ...(resizable ? { \"data-resizable\": true } : {}),\n children: isChildrenValidElement\n ? [\n ...(Array.isArray(childElementProps.children)\n ? childElementProps.children\n : [childElementProps.children]),\n ...resizeHandles.filter(Boolean),\n ]\n : children,\n };\n\n return (\n <WithRenderProp\n render={(props) => {\n // Merge the props from WithRenderProp with our childProps\n const mergedProps = mergeProps(\n props,\n childProps,\n resizable ? rootPropsWithoutRef : {}\n );\n if (isChildrenValidElement) {\n return React.cloneElement(childElement, mergedProps);\n } else {\n return <div {...mergedProps}>{children}</div>;\n }\n }}\n {...rest}\n />\n );\n }\n);\n"],"names":["Resizable","forwardRef","children","resizable","handles","classNames","containerClassName","containerStyle","resetKey","maxHeight","maxWidth","minHeight","minWidth","lockHorizontal","lockVertical","onResize","onDragEndProp","onDragStartProp","disabled","maintainAspectRatio","interval","initialHeightProp","initialWidthProp","rest","ref","cls","useCls","panelRef","setPanelRef","useState","width","setWidth","height","setHeight","resizing","setResizing","callbackRef","useCallback","node","rect","useEffect","resizableHook","useResizable","values","isChildrenValidElement","isValidElement","rootRefProp","rootPropsWithoutRef","getHandleProps","resizeHandles","jsx","clsx","childElement","childElementProps","getReactElementProp","childProps","cn","mergeRefs","WithRenderProp","props","mergedProps","mergeProps","React"],"mappings":";;;;;;;;;;;AA+FO,MAAMA,KAAYC;AAAA,EACvB,CACE;AAAA,IACE,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU,EAAE,QAAQ,IAAM,OAAO,IAAM,MAAM,IAAM,KAAK,GAAA;AAAA,IACxD,YAAAC;AAAA,IACA,WAAWC;AAAA,IACX,OAAOC;AAAA,IACP,UAAAC;AAAA;AAAA,IAGA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAWC;AAAA,IACX,aAAaC;AAAA,IACb,UAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,UAAAC;AAAA,IACA,eAAeC;AAAA,IACf,cAAcC;AAAA;AAAA,IAEd,GAAGC;AAAA,EAAA,GAELC,MACG;AAQH,UAAMC,IAAMC,GAAA,GACN,CAACC,GAAUC,CAAW,IAAIC,EAAgC,IAAI,GAC9D,CAACC,GAAOC,CAAQ,IAAIF,EAAA,GACpB,CAACG,GAAQC,CAAS,IAAIJ,EAAA,GACtB,CAACK,GAAUC,CAAW,IAAIN,EAAS,EAAK,GAExCO,IAAcC;AAAA,MAClB,CAACC,MAAyB;AAMxB,YALAV,EAAYU,CAAI,GAKZA,KAAQ,CAACR,KAAS,CAACE,GAAQ;AAC7B,gBAAMO,IAAOD,EAAK,sBAAA;AAClB,UAAIC,EAAK,QAAQ,KAAKA,EAAK,SAAS,KAC9BpB,MAEFY,EAASQ,EAAK,KAAK,GACnBN,EAAUM,EAAK,MAAM;AAAA,QAI3B;AAAA,MACF;AAAA,MACA,CAACT,GAAOE,GAAQb,CAAmB;AAAA,IAAA;AAIrC,IAAAqB,EAAU,MAAM;AACd,UAAIhC,MAAa,UAAamB,GAAU;AAEtC,QA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AO;AAAA,MACrE,UAAUE,EAAqCF,GAAc,UAAU;AAAA,IAEzE,GAEMG,IAAa;AAAA,MACjB,WAAWC;AAAA,QACTrD,KAAasB,EAAI,WAAW;AAAA,QAC5BpB,GAAY;AAAA,QACZgD,EAAkB;AAAA,QAClB/C;AAAA,MAAA;AAAA,MAEF,KAAKmD;AAAA,QACHtD,IAAY2C,IAAc;AAAA,QAC1BV;AAAA;AAAA,QACAgB,GAAc;AAAA,QACd5B;AAAA,MAAA;AAAA,MAEF,OAAO,EAAE,GAAG6B,EAAkB,OAAO,GAAG9C,EAAA;AAAA,MACxC,GAAI2B,IAAW,EAAE,iBAAiB,GAAA,IAAS,CAAA;AAAA,MAC3C,GAAI/B,IAAY,EAAE,kBAAkB,GAAA,IAAS,CAAA;AAAA,MAC7C,UAAUyC,IACN;AAAA,QACE,GAAI,MAAM,QAAQS,EAAkB,QAAQ,IACxCA,EAAkB,WAClB,CAACA,EAAkB,QAAQ;AAAA,QAC/B,GAAGJ,EAAc,OAAO,OAAO;AAAA,MAAA,IAEjC/C;AAAA,IAAA;AAGN,WACE,gBAAAgD;AAAA,MAACQ;AAAA,MAAA;AAAA,QACC,QAAQ,CAACC,MAAU;AAEjB,gBAAMC,IAAcC;AAAA,YAClBF;AAAA,YACAJ;AAAA,YACApD,IAAY4C,IAAsB,CAAA;AAAA,UAAC;AAErC,iBAAIH,IACKkB,EAAM,aAAaV,GAAcQ,CAAW,IAE5C,gBAAAV,EAAC,OAAA,EAAK,GAAGU,GAAc,UAAA1D,EAAA,CAAS;AAAA,QAE3C;AAAA,QACC,GAAGqB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/resizable/component.tsx"],"sourcesContent":["\"use client\";\nimport React, {\n useCallback,\n useEffect,\n useState,\n isValidElement,\n forwardRef,\n} from \"react\";\nimport {\n useResizable,\n type MoveValues,\n ResizableProps as UseResizableProps,\n} from \"../hooks/useResizable\";\nimport mergeRefs from \"merge-refs\";\nimport {\n useCls,\n clsx,\n WithRenderProp,\n WithRenderPropProps,\n cn,\n getReactElementProp,\n getReactElementRef,\n} from \"../utils\";\nimport { mergeProps } from \"@base-ui/react\";\n\nimport \"./style.css\";\n// import { on } from \"node:stream\";\n\nexport interface ResizableProps\n extends\n Omit<WithRenderPropProps, keyof UseResizableProps>,\n UseResizableProps {\n /**\n * Single React element child that will be enhanced with resize handles\n */\n children: React.ReactNode;\n /**\n * Whether the component should be resizable\n * @default false\n */\n resizable?: boolean;\n /**\n * Configure which resize handles to show\n * @default { bottom: true, right: true, left: true, top: true }\n */\n handles?: {\n bottom?: boolean;\n right?: boolean;\n left?: boolean;\n top?: boolean;\n };\n // /**\n // * Whether to use absolute positioning for left handle resizing\n // * Set to true when used in absolutely positioned containers like PopupPanel\n // * @default false\n // */\n // absolutePositioning?: boolean;\n /**\n * Custom class names for different parts of the resizable component\n */\n classNames?: {\n root?: string;\n resizeHandle?: string;\n };\n /**\n * Key to reset dimensions to current element size\n * When this value changes, the component will recalculate its dimensions\n * Similar to React's key prop pattern for forcing component resets\n */\n resetKey?: React.Key;\n /**\n * Maximum width the component can be resized to\n */\n maxWidth?: number;\n /**\n * Maximum height the component can be resized to\n */\n maxHeight?: number;\n /**\n * Minimum width the component can be resized to\n */\n minWidth?: number;\n /**\n * Minimum height the component can be resized to\n */\n minHeight?: number;\n /**\n * Callback fired during resize operations\n */\n onResize?: (values: MoveValues) => void;\n /**\n * Whether to maintain aspect ratio during resize\n * @default false\n */\n maintainAspectRatio?: boolean;\n}\n\nexport const Resizable = forwardRef<HTMLDivElement, ResizableProps>(\n (\n {\n children,\n resizable = false,\n handles = { bottom: true, right: true, left: true, top: true },\n classNames,\n className: containerClassName,\n style: containerStyle,\n resetKey,\n\n // Use Resizable Props\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n lockHorizontal,\n lockVertical,\n onResize,\n onDragEnd: onDragEndProp,\n onDragStart: onDragStartProp,\n disabled,\n maintainAspectRatio = false,\n interval,\n initialHeight: initialHeightProp,\n initialWidth: initialWidthProp,\n // other With Render Props\n ...rest\n },\n ref,\n ) => {\n // Validate that children is a single React element\n // if (!isValidElement(children)) {\n // throw new Error(\n // \"Resizable component expects a single React element as children\"\n // );\n // }\n\n const cls = useCls();\n const [panelRef, setPanelRef] = useState<HTMLDivElement | null>(null);\n const [width, setWidth] = useState<number>();\n const [height, setHeight] = useState<number>();\n const [resizing, setResizing] = useState(false);\n\n const callbackRef = useCallback(\n (node: HTMLDivElement) => {\n setPanelRef(node);\n\n // Get initial dimensions only once when ref is set\n // For aspect ratio maintenance, we need initial dimensions immediately\n // Otherwise, preserve natural width/height behavior\n if (node && !width && !height) {\n const rect = node.getBoundingClientRect();\n if (rect.width > 0 && rect.height > 0) {\n if (maintainAspectRatio) {\n // Need dimensions for aspect ratio calculation\n setWidth(rect.width);\n setHeight(rect.height);\n }\n // For non-aspect-ratio cases, don't set dimensions to preserve natural behavior\n }\n }\n },\n [width, height, maintainAspectRatio],\n );\n\n // Reset dimensions when resetKey changes\n useEffect(() => {\n if (resetKey !== undefined && panelRef) {\n // Clear the hook's inline styles to reset to natural size\n panelRef.style.width = \"\";\n panelRef.style.height = \"\";\n\n // Force a reflow to get natural dimensions\n const rect = panelRef.getBoundingClientRect();\n\n if (rect.width > 0 && rect.height > 0) {\n if (maintainAspectRatio) {\n // For aspect ratio maintenance, re-measure and set dimensions\n setWidth(rect.width);\n setHeight(rect.height);\n } else {\n // Reset state to allow natural dimensions again\n setWidth(undefined);\n setHeight(undefined);\n }\n\n // Don't apply any explicit dimensions - let them remain natural\n // panelRef.style.width = `${rect.width}px`;\n // panelRef.style.height = `${rect.height}px`;\n }\n }\n }, [resetKey, panelRef, maintainAspectRatio]);\n\n // Initialize useResizable with current dimensions (or undefined if not ready)\n // For aspect ratio maintenance, we need initial dimensions\n // Otherwise, preserve natural width/height behavior until user starts resizing\n const resizableHook = useResizable({\n initialWidth: maintainAspectRatio ? width : initialWidthProp,\n initialHeight: maintainAspectRatio ? height : initialHeightProp,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n lockHorizontal,\n lockVertical,\n onResize,\n disabled,\n maintainAspectRatio,\n interval,\n onDragStart: (values) => {\n setResizing(true);\n // Capture natural dimensions when user starts resizing\n if (panelRef) {\n const rect = panelRef.getBoundingClientRect();\n if (rect.width > 0 && !width) {\n setWidth(rect.width);\n }\n if (rect.height > 0 && !height) {\n setHeight(rect.height);\n }\n }\n if (onDragStartProp) onDragStartProp(values);\n },\n onDragEnd: (values) => {\n setResizing(false);\n if (onDragEndProp) onDragEndProp(values);\n },\n });\n\n const isChildrenValidElement = isValidElement(children);\n\n useEffect(() => {\n if (resizing) {\n document.body.style.userSelect = \"none\";\n } else {\n document.body.style.userSelect = \"\";\n }\n }, [resizing]);\n\n // Get resizable props - useResizable hook handles cases where dimensions aren't ready\n const { ref: rootRefProp, ...rootPropsWithoutRef } =\n resizableHook.getRootProps();\n const getHandleProps = resizableHook.getHandleProps;\n\n // // Handle reverse handle change for horizontal resizing (only for absolute positioning)\n // const onReverseHandleChangeHorizontal = (\n // parent: React.RefObject<HTMLDivElement>,\n // values: MoveValues\n // ) => {\n // if (!parent.current || !absolutePositioning) return;\n // const { widthDiff } = values;\n // parent.current.style.left = `${\n // parseInt(parent.current.style.left || \"0\") - widthDiff\n // }px`;\n // };\n\n // // Handle reverse handle change for vertical resizing (only for absolute positioning)\n // const onReverseHandleChangeVertical = (\n // parent: React.RefObject<HTMLDivElement>,\n // values: MoveValues\n // ) => {\n // if (!parent.current || !absolutePositioning) return;\n // const { heightDiff } = values;\n // console.log({\n // parentStyleTop: parent.current.style.top,\n // computedStyleTop: window.getComputedStyle(parent.current).top,\n // });\n // parent.current.style.top = `${\n // parseInt(parent.current.style.top || \"0\") - heightDiff\n // }px`;\n // };\n\n const resizeHandles = resizable\n ? [\n handles.top && !maintainAspectRatio && (\n <div\n key=\"top\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-center\"\n {...getHandleProps({\n reverse: true,\n lockHorizontal: true,\n // onResize: (values) =>\n // onReverseHandleChangeVertical(rootRef, values),\n })}\n />\n ),\n handles.bottom && !maintainAspectRatio && (\n <div\n key=\"bottom\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"bottom-left\"\n {...getHandleProps({\n lockHorizontal: true,\n })}\n />\n ),\n handles.left && !maintainAspectRatio && (\n <div\n key=\"left\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-left\"\n {...getHandleProps({\n reverse: true,\n lockVertical: true,\n // onResize: (values) =>\n // onReverseHandleChangeHorizontal(rootRef, values),\n })}\n />\n ),\n handles.right && !maintainAspectRatio && (\n <div\n key=\"right\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-right\"\n {...getHandleProps({\n lockVertical: true,\n })}\n />\n ),\n handles.right && handles.bottom && (\n <div\n key=\"bottom-right-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"bottom-right-corner\"\n {...getHandleProps({\n // No locks - allow both horizontal and vertical resizing\n corner: \"bottom-right\",\n })}\n />\n ),\n handles.left && handles.top && (\n <div\n key=\"top-left-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-left-corner\"\n {...getHandleProps({\n corner: \"top-left\",\n // onResize: (values) => {\n // onReverseHandleChangeHorizontal(rootRef, values);\n // onReverseHandleChangeVertical(rootRef, values);\n // },\n })}\n />\n ),\n handles.right && handles.top && (\n <div\n key=\"top-right-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"top-right-corner\"\n {...getHandleProps({\n corner: \"top-right\",\n // onResize: (values) => {\n // onReverseHandleChangeVertical(rootRef, values);\n // },\n })}\n />\n ),\n handles.left && handles.bottom && (\n <div\n key=\"bottom-left-corner\"\n className={clsx(\n cls(\"resizable-resize-handle\"),\n classNames?.resizeHandle,\n )}\n data-placement=\"bottom-left-corner\"\n {...getHandleProps({\n corner: \"bottom-left\",\n // onResize: (values) => {\n // onReverseHandleChangeHorizontal(rootRef, values);\n // onReverseHandleChangeVertical(rootRef, values);\n // },\n })}\n />\n ),\n ]\n : [];\n\n const childElement = children as React.ReactElement;\n const childRef = getReactElementRef<HTMLDivElement>(childElement);\n\n const childElementProps = {\n className: getReactElementProp<string>(childElement, \"className\"),\n style: getReactElementProp<React.CSSProperties>(childElement, \"style\"),\n children: getReactElementProp<React.ReactNode>(childElement, \"children\"),\n };\n\n const childProps = {\n className: cn(\n resizable && cls(\"resizable\"),\n classNames?.root,\n childElementProps.className,\n containerClassName,\n ),\n ref: mergeRefs(\n resizable ? rootRefProp : undefined,\n callbackRef, // Always need this for dimension measurement\n childRef,\n ref,\n ),\n style: { ...childElementProps.style, ...containerStyle },\n ...(resizing ? { \"data-resizing\": true } : {}),\n ...(resizable ? { \"data-resizable\": true } : {}),\n children: isChildrenValidElement\n ? [\n ...(Array.isArray(childElementProps.children)\n ? childElementProps.children\n : [childElementProps.children]),\n ...resizeHandles.filter(Boolean),\n ]\n : children,\n };\n\n return (\n <WithRenderProp\n render={(props) => {\n // Merge the props from WithRenderProp with our childProps\n const mergedProps = mergeProps(\n props,\n childProps,\n resizable ? rootPropsWithoutRef : {},\n );\n if (isChildrenValidElement) {\n return React.cloneElement(childElement, mergedProps);\n } else {\n return <div {...mergedProps}>{children}</div>;\n }\n }}\n {...rest}\n />\n );\n },\n);\n"],"names":["Resizable","forwardRef","children","resizable","handles","classNames","containerClassName","containerStyle","resetKey","maxHeight","maxWidth","minHeight","minWidth","lockHorizontal","lockVertical","onResize","onDragEndProp","onDragStartProp","disabled","maintainAspectRatio","interval","initialHeightProp","initialWidthProp","rest","ref","cls","useCls","panelRef","setPanelRef","useState","width","setWidth","height","setHeight","resizing","setResizing","callbackRef","useCallback","node","rect","useEffect","resizableHook","useResizable","values","isChildrenValidElement","isValidElement","rootRefProp","rootPropsWithoutRef","getHandleProps","resizeHandles","jsx","clsx","childElement","childRef","getReactElementRef","childElementProps","getReactElementProp","childProps","cn","mergeRefs","WithRenderProp","props","mergedProps","mergeProps","React"],"mappings":";;;;;;;;;;;AAiGO,MAAMA,KAAYC;AAAA,EACvB,CACE;AAAA,IACE,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU,EAAE,QAAQ,IAAM,OAAO,IAAM,MAAM,IAAM,KAAK,GAAA;AAAA,IACxD,YAAAC;AAAA,IACA,WAAWC;AAAA,IACX,OAAOC;AAAA,IACP,UAAAC;AAAA;AAAA,IAGA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAWC;AAAA,IACX,aAAaC;AAAA,IACb,UAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,UAAAC;AAAA,IACA,eAAeC;AAAA,IACf,cAAcC;AAAA;AAAA,IAEd,GAAGC;AAAA,EAAA,GAELC,MACG;AAQH,UAAMC,IAAMC,GAAA,GACN,CAACC,GAAUC,CAAW,IAAIC,EAAgC,IAAI,GAC9D,CAACC,GAAOC,CAAQ,IAAIF,EAAA,GACpB,CAACG,GAAQC,CAAS,IAAIJ,EAAA,GACtB,CAACK,GAAUC,CAAW,IAAIN,EAAS,EAAK,GAExCO,IAAcC;AAAA,MAClB,CAACC,MAAyB;AAMxB,YALAV,EAAYU,CAAI,GAKZA,KAAQ,CAACR,KAAS,CAACE,GAAQ;AAC7B,gBAAMO,IAAOD,EAAK,sBAAA;AAClB,UAAIC,EAAK,QAAQ,KAAKA,EAAK,SAAS,KAC9BpB,MAEFY,EAASQ,EAAK,KAAK,GACnBN,EA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+1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/select/component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/select/component.tsx"],"names":[],"mappings":"AAcA,OAAO,EACL,OAAO,IAAI,SAAS,EACpB,KAAK,WAAW,IAAI,cAAc,EAClC,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAA0D,MAAM,OAAO,CAAC;AAG/E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK1D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,WAAW,CAC1B,SAAS,GAAG,OAAO,EACnB,UAAU,SAAS,cAAc,GAAG,iBAAiB,GAAG,iBAAiB,CACzE,SAAQ,cAAc,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7C;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,cAAc,CAAC;IAC7C;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QACxB,OAAO,EAAE,MAAM,IAAI,CAAC;QACpB,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;QAClC,aAAa,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;KAC/C,KAAK,KAAK,CAAC,SAAS,CAAC;CACvB;AAED,YAAY,EACV,cAAc,IAAI,oBAAoB,EACtC,iBAAiB,IAAI,u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