@wix/site-ui 1.347.0 → 1.349.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/{6706.js → 1093.js} +3 -3
- package/dist/{8724.js → 1219.js} +2 -2
- package/dist/{7373.js → 1288.js} +8 -2
- package/dist/{5299.js → 1381.js} +98 -127
- package/dist/{3056.js → 1607.js} +32 -34
- package/dist/1629.js +2 -0
- package/dist/1669.js +75 -0
- package/dist/1718.js +26 -0
- package/dist/{1477.js → 201.js} +17 -26
- package/dist/2221.js +9 -0
- package/dist/{2445.js → 226.js} +12 -48
- package/dist/2387.js +7 -0
- package/dist/2580.js +6 -0
- package/dist/{1500.js → 2859.js} +10 -34
- package/dist/3014.js +178 -0
- package/dist/{6247.js → 3054.js} +3 -3
- package/dist/{7642.js → 3093.js} +1 -1
- package/dist/3189.js +5 -0
- package/dist/{7564.js → 331.js} +2 -2
- package/dist/3357.js +7 -0
- package/dist/{487.js → 3398.js} +38 -39
- package/dist/3502.js +224 -0
- package/dist/3695.js +50 -0
- package/dist/3829.js +1 -1
- package/dist/{6588.js → 3859.js} +115 -92
- package/dist/{3670.js → 3910.js} +28 -21
- package/dist/392.js +7 -0
- package/dist/{4549.js → 4155.js} +11 -3
- package/dist/4226.js +7 -0
- package/dist/{6329.js → 4229.js} +1 -1
- package/dist/4293.js +3 -0
- package/dist/4346.js +853 -2
- package/dist/{285.js → 4472.js} +3 -3
- package/dist/4605.js +207 -0
- package/dist/{7366.js → 488.js} +60 -7
- package/dist/{8750.js → 497.js} +190 -375
- package/dist/4989.js +35 -0
- package/dist/{6270.js → 510.js} +157 -196
- package/dist/5258.js +26 -0
- package/dist/{5036.js → 5275.js} +0 -3
- package/dist/{8171.js → 5298.js} +90 -102
- package/dist/5473.js +11 -0
- package/dist/{4745.js → 5490.js} +3 -1
- package/dist/{6089.js → 5561.js} +869 -786
- package/dist/{8996.js → 5595.js} +4 -3
- package/dist/5890.js +25 -0
- package/dist/{6046.js → 5969.js} +1 -1
- package/dist/5984.js +38 -0
- package/dist/{8527.js → 6006.js} +3 -3
- package/dist/6040.js +97 -0
- package/dist/{8758.js → 6137.js} +10 -8
- package/dist/{4281.js → 6140.js} +18 -10
- package/dist/{8960.js → 6191.js} +2 -2
- package/dist/6240.js +121 -0
- package/dist/{4490.js → 6373.js} +7 -5
- package/dist/{904.js → 6487.js} +19 -17
- package/dist/{9635.js → 6498.js} +1 -1
- package/dist/6499.js +4 -7
- package/dist/6508.js +7 -0
- package/dist/{8225.js → 6540.js} +1 -0
- package/dist/6551.js +46 -0
- package/dist/{9369.js → 6620.js} +35 -34
- package/dist/{4143.js → 6838.js} +19 -10
- package/dist/6902.js +48 -0
- package/dist/6904.js +51 -0
- package/dist/70.js +24 -0
- package/dist/7024.js +39 -0
- package/dist/{6882.js → 721.js} +737 -362
- package/dist/{951.js → 7270.js} +4 -4
- package/dist/{3485.js → 7323.js} +143 -111
- package/dist/{7541.js → 7488.js} +2 -2
- package/dist/{4863.js → 7542.js} +7 -6
- package/dist/7551.js +28 -0
- package/dist/{7021.js → 7640.js} +1 -1
- package/dist/{353.js → 7692.js} +3 -7
- package/dist/{4707.js → 7930.js} +2 -2
- package/dist/{8052.js → 8.js} +80 -64
- package/dist/{6914.js → 8129.js} +3 -15
- package/dist/{3319.js → 8358.js} +62 -63
- package/dist/{5864.js → 8407.js} +13 -13
- package/dist/8488.js +15 -0
- package/dist/{4768.js → 8495.js} +1 -1
- package/dist/8734.js +171 -0
- package/dist/{1763.js → 9018.js} +205 -331
- package/dist/9053.js +29 -0
- package/dist/9067.js +41 -0
- package/dist/{2861.js → 9120.js} +2 -2
- package/dist/{42.js → 9197.js} +2 -2
- package/dist/{9189.js → 9248.js} +36 -17
- package/dist/{2801.js → 9252.js} +4 -9
- package/dist/9295.js +7 -0
- package/dist/9303.js +8 -0
- package/dist/{167.js → 9374.js} +1 -1
- package/dist/{9352.js → 9540.js} +17 -47
- package/dist/9576.js +51 -0
- package/dist/{8272.js → 9591.js} +36 -46
- package/dist/{6107.js → 9770.js} +2 -2
- package/dist/{5085.js → 9880.js} +6 -3
- package/dist/Accordion/index.d.ts +207 -41
- package/dist/Accordion/index.js +75 -177
- package/dist/AlertDialog/index.d.ts +440 -140
- package/dist/AlertDialog/index.js +3 -13
- package/dist/Autocomplete/index.d.ts +722 -150
- package/dist/Autocomplete/index.js +16 -29
- package/dist/Avatar/index.d.ts +38 -3
- package/dist/Avatar/index.js +82 -28
- package/dist/Breadcrumbs/index.d.ts +63 -91
- package/dist/Breadcrumbs/index.js +1 -1
- package/dist/Button/index.d.ts +11 -0
- package/dist/Button/index.js +2 -2
- package/dist/Checkbox/index.d.ts +206 -36
- package/dist/Checkbox/index.js +293 -8
- package/dist/CheckboxField/index.css +1 -1
- package/dist/CheckboxField/index.d.ts +40 -36
- package/dist/CheckboxGroup/index.d.ts +50 -36
- package/dist/CheckboxGroup/index.js +87 -58
- package/dist/CheckboxGroupField/index.css +1 -1
- package/dist/Collapsible/index.d.ts +128 -36
- package/dist/Collapsible/index.js +21 -25
- package/dist/Combobox/index.d.ts +801 -158
- package/dist/Combobox/index.js +70 -114
- package/dist/ContextMenu/index.d.ts +1162 -195
- package/dist/ContextMenu/index.js +46 -36
- package/dist/Dialog/index.d.ts +425 -133
- package/dist/Dialog/index.js +8 -4
- package/dist/Drawer/index.d.ts +589 -144
- package/dist/Drawer/index.js +482 -562
- package/dist/Field/index.css +1 -1
- package/dist/Field/index.d.ts +341 -42
- package/dist/Field/index.js +123 -273
- package/dist/Fieldset/index.d.ts +11 -0
- package/dist/Fieldset/index.js +10 -17
- package/dist/Form/index.d.ts +43 -39
- package/dist/Form/index.js +58 -50
- package/dist/Input/index.css +1 -1
- package/dist/Input/index.d.ts +94 -42
- package/dist/Input/index.js +1 -1
- package/dist/Menu/index.d.ts +1140 -175
- package/dist/Menu/index.js +51 -67
- package/dist/Menubar/index.d.ts +651 -173
- package/dist/Menubar/index.js +12 -16
- package/dist/Meter/index.js +21 -18
- package/dist/NavigationMenu/index.d.ts +370 -86
- package/dist/NavigationMenu/index.js +144 -178
- package/dist/NumberField/index.css +1 -1
- package/dist/NumberField/index.d.ts +507 -47
- package/dist/NumberField/index.js +434 -718
- package/dist/Popover/index.d.ts +561 -142
- package/dist/Popover/index.js +181 -252
- package/dist/PreviewCard/index.d.ts +507 -143
- package/dist/PreviewCard/index.js +97 -151
- package/dist/Progress/index.d.ts +117 -3
- package/dist/Progress/index.js +37 -36
- package/dist/Radio/index.d.ts +177 -7
- package/dist/Radio/index.js +54 -70
- package/dist/RadioField/index.css +1 -1
- package/dist/RadioField/index.d.ts +23 -7
- package/dist/RadioGroup/index.d.ts +51 -37
- package/dist/RadioGroup/index.js +60 -51
- package/dist/RadioGroupField/index.css +1 -1
- package/dist/RadioGroupField/index.d.ts +40 -37
- package/dist/ScrollArea/index.d.ts +295 -1
- package/dist/ScrollArea/index.js +256 -324
- package/dist/Select/index.d.ts +516 -123
- package/dist/Select/index.js +513 -635
- package/dist/SelectField/index.css +1 -1
- package/dist/SelectField/index.d.ts +109 -134
- package/dist/SelectField/index.js +5 -1
- package/dist/Separator/index.d.ts +12 -0
- package/dist/Separator/index.js +1 -1
- package/dist/Slider/index.d.ts +383 -64
- package/dist/Slider/index.js +298 -374
- package/dist/Switch/index.d.ts +184 -37
- package/dist/Switch/index.js +44 -58
- package/dist/Tabs/index.d.ts +220 -35
- package/dist/Tabs/index.js +199 -193
- package/dist/Toast/index.d.ts +280 -64
- package/dist/Toast/index.js +299 -374
- package/dist/Toggle/index.d.ts +55 -35
- package/dist/Toggle/index.js +19 -13
- package/dist/ToggleGroup/index.d.ts +62 -35
- package/dist/ToggleGroup/index.js +13 -31
- package/dist/Toolbar/index.d.ts +117 -2
- package/dist/Toolbar/index.js +31 -43
- package/dist/Tooltip/index.d.ts +507 -150
- package/dist/Tooltip/index.js +163 -213
- package/dist/index.d.ts +12912 -5382
- package/package.json +3 -3
- package/dist/2205.js +0 -26
- package/dist/2274.js +0 -34
- package/dist/2287.js +0 -17
- package/dist/3020.js +0 -7
- package/dist/3021.js +0 -72
- package/dist/3140.js +0 -4
- package/dist/3248.js +0 -307
- package/dist/4026.js +0 -12
- package/dist/4922.js +0 -15
- package/dist/5659.js +0 -4
- package/dist/5992.js +0 -447
- package/dist/6330.js +0 -30
- package/dist/6535.js +0 -72
- package/dist/6917.js +0 -55
- package/dist/7725.js +0 -10
- package/dist/7871.js +0 -38
- package/dist/8106.js +0 -239
- package/dist/8685.js +0 -102
- package/dist/8935.js +0 -8
- package/dist/8971.js +0 -40
- package/dist/8979.js +0 -10
- package/dist/9048.js +0 -52
- package/dist/9087.js +0 -256
- package/dist/9255.js +0 -136
- /package/dist/{1457.js → 1068.js} +0 -0
- /package/dist/{6003.js → 1234.js} +0 -0
- /package/dist/{4723.js → 1282.js} +0 -0
- /package/dist/{6825.js → 1876.js} +0 -0
- /package/dist/{5778.js → 1885.js} +0 -0
- /package/dist/{2445.js.LICENSE.txt → 226.js.LICENSE.txt} +0 -0
- /package/dist/{1279.js → 3278.js} +0 -0
- /package/dist/{3296.js → 5568.js} +0 -0
- /package/dist/{8685.css → 6240.css} +0 -0
- /package/dist/{9829.js → 6488.js} +0 -0
- /package/dist/{9863.js → 6534.js} +0 -0
- /package/dist/{4495.js → 7718.js} +0 -0
- /package/dist/{3395.js → 8866.js} +0 -0
- /package/dist/{2418.js → 9837.js} +0 -0
package/dist/{8052.js → 8.js}
RENAMED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { useControlled } from "./
|
|
2
|
-
import { useTransitionStatus } from "./
|
|
3
|
-
import { useBaseUiId } from "./
|
|
4
|
-
import { useStableCallback } from "./
|
|
5
|
-
import { createChangeEventDetails } from "./
|
|
6
|
-
import { triggerPress } from "./
|
|
7
|
-
import {
|
|
8
|
-
import { useAnimationsFinished,
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { useControlled } from "./6006.js";
|
|
2
|
+
import { useTransitionStatus } from "./7542.js";
|
|
3
|
+
import { useBaseUiId } from "./5969.js";
|
|
4
|
+
import { useStableCallback } from "./7488.js";
|
|
5
|
+
import { createChangeEventDetails } from "./8495.js";
|
|
6
|
+
import { triggerPress } from "./9837.js";
|
|
7
|
+
import { utils_formatErrorMessage } from "./5473.js";
|
|
8
|
+
import { useAnimationsFinished, startingStyle as TransitionStatusDataAttributes_startingStyle, useOpenChangeComplete } from "./6620.js";
|
|
9
|
+
import { useMergedRefs, warn } from "./9591.js";
|
|
10
|
+
import { useValueAsRef } from "./7930.js";
|
|
11
|
+
import { useIsoLayoutEffect } from "./3357.js";
|
|
12
|
+
import { AnimationFrame } from "./5595.js";
|
|
13
|
+
import { Timeout } from "./9197.js";
|
|
14
|
+
import { addEventListener } from "./1282.js";
|
|
13
15
|
import { getWindow } from "./3829.js";
|
|
14
16
|
import * as __rspack_external_react from "react";
|
|
15
17
|
function useCollapsibleRoot(parameters) {
|
|
16
|
-
const { open: openParam, defaultOpen, onOpenChange, disabled } = parameters;
|
|
18
|
+
const { open: openParam, defaultOpen = false, onOpenChange, disabled } = parameters;
|
|
17
19
|
const [open, setOpen] = useControlled({
|
|
18
20
|
controlled: openParam,
|
|
19
21
|
default: defaultOpen,
|
|
@@ -22,8 +24,8 @@ function useCollapsibleRoot(parameters) {
|
|
|
22
24
|
});
|
|
23
25
|
const { mounted, setMounted, transitionStatus } = useTransitionStatus(open, true, true);
|
|
24
26
|
const defaultPanelId = useBaseUiId();
|
|
25
|
-
const [
|
|
26
|
-
const panelId =
|
|
27
|
+
const [registeredPanelId, setPanelIdState] = __rspack_external_react.useState();
|
|
28
|
+
const panelId = null === registeredPanelId ? void 0 : registeredPanelId ?? defaultPanelId;
|
|
27
29
|
const handleTrigger = useStableCallback((event)=>{
|
|
28
30
|
const nextOpen = !open;
|
|
29
31
|
const eventDetails = createChangeEventDetails(triggerPress, event.nativeEvent);
|
|
@@ -32,6 +34,7 @@ function useCollapsibleRoot(parameters) {
|
|
|
32
34
|
setOpen(nextOpen);
|
|
33
35
|
});
|
|
34
36
|
return __rspack_external_react.useMemo(()=>({
|
|
37
|
+
defaultPanelId,
|
|
35
38
|
disabled,
|
|
36
39
|
handleTrigger,
|
|
37
40
|
mounted,
|
|
@@ -42,6 +45,7 @@ function useCollapsibleRoot(parameters) {
|
|
|
42
45
|
setPanelIdState,
|
|
43
46
|
transitionStatus
|
|
44
47
|
}), [
|
|
48
|
+
defaultPanelId,
|
|
45
49
|
disabled,
|
|
46
50
|
handleTrigger,
|
|
47
51
|
mounted,
|
|
@@ -57,30 +61,23 @@ const CollapsibleRootContext = /*#__PURE__*/ __rspack_external_react.createConte
|
|
|
57
61
|
if ("production" !== process.env.NODE_ENV) CollapsibleRootContext.displayName = "CollapsibleRootContext";
|
|
58
62
|
function useCollapsibleRootContext() {
|
|
59
63
|
const context = __rspack_external_react.useContext(CollapsibleRootContext);
|
|
60
|
-
if (void 0 === context) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.' :
|
|
64
|
+
if (void 0 === context) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.' : utils_formatErrorMessage(15));
|
|
61
65
|
return context;
|
|
62
66
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
CollapsiblePanelDataAttributes[CollapsiblePanelDataAttributes["endingStyle"] = stateAttributesMapping_TransitionStatusDataAttributes.endingStyle] = "endingStyle";
|
|
68
|
-
return CollapsiblePanelDataAttributes;
|
|
69
|
-
}({});
|
|
70
|
-
let CollapsibleTriggerDataAttributes_CollapsibleTriggerDataAttributes = /*#__PURE__*/ function(CollapsibleTriggerDataAttributes) {
|
|
71
|
-
CollapsibleTriggerDataAttributes["panelOpen"] = "data-panel-open";
|
|
72
|
-
return CollapsibleTriggerDataAttributes;
|
|
73
|
-
}({});
|
|
67
|
+
const CollapsiblePanelDataAttributes_open = 'data-open';
|
|
68
|
+
const CollapsiblePanelDataAttributes_closed = 'data-closed';
|
|
69
|
+
const startingStyle = TransitionStatusDataAttributes_startingStyle;
|
|
70
|
+
const panelOpen = 'data-panel-open';
|
|
74
71
|
const PANEL_OPEN_HOOK = {
|
|
75
|
-
[
|
|
72
|
+
[CollapsiblePanelDataAttributes_open]: ''
|
|
76
73
|
};
|
|
77
74
|
const PANEL_CLOSED_HOOK = {
|
|
78
|
-
[
|
|
75
|
+
[CollapsiblePanelDataAttributes_closed]: ''
|
|
79
76
|
};
|
|
80
77
|
const triggerOpenStateMapping = {
|
|
81
78
|
open (value) {
|
|
82
79
|
if (value) return {
|
|
83
|
-
[
|
|
80
|
+
[panelOpen]: ''
|
|
84
81
|
};
|
|
85
82
|
return null;
|
|
86
83
|
}
|
|
@@ -107,11 +104,8 @@ function useCollapsiblePanel(parameters) {
|
|
|
107
104
|
const [forcePanelIdle, setForcePanelIdle] = __rspack_external_react.useState(false);
|
|
108
105
|
const pendingTemporaryStyleRestoreRef = __rspack_external_react.useRef(null);
|
|
109
106
|
const mergedPanelRef = useMergedRefs(externalRef, panelRef);
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
open
|
|
113
|
-
});
|
|
114
|
-
const runOnceCloseAnimationsFinish = useAnimationsFinished(panelRef, false, false);
|
|
107
|
+
const latestOpenRef = useValueAsRef(open);
|
|
108
|
+
const runOnceCloseAnimationsFinish = useAnimationsFinished(panelRef);
|
|
115
109
|
const hidden = !open && !mounted;
|
|
116
110
|
const panelTransitionStatus = forcePanelIdle ? 'idle' : transitionStatus;
|
|
117
111
|
const shouldPreventOpenAnimation = open && (shouldPreventMountAnimationRef.current || shouldPreventActivityResumeAnimationRef.current);
|
|
@@ -150,6 +144,10 @@ function useCollapsiblePanel(parameters) {
|
|
|
150
144
|
restorePendingTemporaryStyle
|
|
151
145
|
]);
|
|
152
146
|
useIsoLayoutEffect(()=>{
|
|
147
|
+
if (!open) {
|
|
148
|
+
shouldPreventMountAnimationRef.current = false;
|
|
149
|
+
shouldPreventActivityResumeAnimationRef.current = false;
|
|
150
|
+
}
|
|
153
151
|
const panel = panelRef.current;
|
|
154
152
|
if (!panel) return;
|
|
155
153
|
if (!open && pendingTemporaryStyleRestoreRef.current) restorePendingTemporaryStyle();
|
|
@@ -176,20 +174,14 @@ function useCollapsiblePanel(parameters) {
|
|
|
176
174
|
setForcePanelIdle(true);
|
|
177
175
|
return restoreLayoutStyles;
|
|
178
176
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const restoreAnimationDuration = setTemporaryStyle(panel, 'animation-duration', '0s');
|
|
188
|
-
restoreAnimationName();
|
|
189
|
-
setPendingTemporaryStyleRestore(restoreAnimationDuration);
|
|
190
|
-
setForcePanelIdle(true);
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
177
|
+
setDimensions(getDimensions(panel));
|
|
178
|
+
const restoreAnimationName = setTemporaryStyle(panel, 'animation-name', 'none');
|
|
179
|
+
if (!skipNextOpen) return void restoreAnimationName();
|
|
180
|
+
const restoreAnimationDuration = setTemporaryStyle(panel, 'animation-duration', '0s');
|
|
181
|
+
restoreAnimationName();
|
|
182
|
+
setPendingTemporaryStyleRestore(restoreAnimationDuration);
|
|
183
|
+
setForcePanelIdle(true);
|
|
184
|
+
return;
|
|
193
185
|
}
|
|
194
186
|
if (!open && mounted && ('idle' === transitionStatus || 'starting' === transitionStatus)) {
|
|
195
187
|
if ('none' === animationType) {
|
|
@@ -197,17 +189,13 @@ function useCollapsiblePanel(parameters) {
|
|
|
197
189
|
setMounted(false);
|
|
198
190
|
return;
|
|
199
191
|
}
|
|
200
|
-
if ('css-animation' === animationType) {
|
|
201
|
-
shouldPreventMountAnimationRef.current = false;
|
|
202
|
-
shouldPreventActivityResumeAnimationRef.current = false;
|
|
203
|
-
}
|
|
204
192
|
setDimensions(getDimensions(panel));
|
|
205
193
|
return;
|
|
206
194
|
}
|
|
207
195
|
if ('ending' !== transitionStatus) return;
|
|
208
196
|
if ('none' === animationType) return void setMounted(false);
|
|
209
197
|
const nextDimensions = getDimensions(panel);
|
|
210
|
-
const hasMeasuredSize =
|
|
198
|
+
const hasMeasuredSize = nextDimensions.height > 0 || nextDimensions.width > 0;
|
|
211
199
|
if (!hasMeasuredSize) return void setMounted(false);
|
|
212
200
|
setDimensions(nextDimensions);
|
|
213
201
|
if ('css-animation' === animationType) {
|
|
@@ -236,23 +224,27 @@ function useCollapsiblePanel(parameters) {
|
|
|
236
224
|
__rspack_external_react.useEffect(()=>{
|
|
237
225
|
if (open || !mounted || 'ending' !== panelTransitionStatus) return;
|
|
238
226
|
const panel = panelRef.current;
|
|
239
|
-
if (!panel)
|
|
227
|
+
if (!panel) {
|
|
228
|
+
setMounted(false);
|
|
229
|
+
setDimensions(EMPTY_DIMENSIONS, false);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
240
232
|
const abortController = new AbortController();
|
|
241
233
|
let endingStyleFrame = -1;
|
|
242
234
|
function handleComplete() {
|
|
243
|
-
if (
|
|
235
|
+
if (latestOpenRef.current) return;
|
|
244
236
|
setMounted(false);
|
|
245
237
|
setDimensions(EMPTY_DIMENSIONS, false);
|
|
246
238
|
}
|
|
247
239
|
endingStyleFrame = AnimationFrame.request(()=>{
|
|
248
|
-
|
|
240
|
+
runOnceCloseAnimationsFinish(handleComplete, abortController.signal);
|
|
249
241
|
});
|
|
250
242
|
return ()=>{
|
|
251
243
|
AnimationFrame.cancel(endingStyleFrame);
|
|
252
244
|
abortController.abort();
|
|
253
245
|
};
|
|
254
246
|
}, [
|
|
255
|
-
|
|
247
|
+
latestOpenRef,
|
|
256
248
|
mounted,
|
|
257
249
|
open,
|
|
258
250
|
panelTransitionStatus,
|
|
@@ -271,13 +263,37 @@ function useCollapsiblePanel(parameters) {
|
|
|
271
263
|
__rspack_external_react.useEffect(function() {
|
|
272
264
|
const panel = panelRef.current;
|
|
273
265
|
if (!panel) return;
|
|
274
|
-
|
|
266
|
+
const revealDecisionTimeout = Timeout.create();
|
|
267
|
+
let revertRevealFrame = -1;
|
|
268
|
+
const scheduleRevealRevert = (revertSkippedMotion, restoreStartingStyle)=>{
|
|
269
|
+
revealDecisionTimeout.start(0, ()=>{
|
|
270
|
+
if (latestOpenRef.current) return;
|
|
271
|
+
revertRevealFrame = AnimationFrame.request(()=>{
|
|
272
|
+
if (latestOpenRef.current) return;
|
|
273
|
+
if (revertSkippedMotion) shouldSkipNextOpenRef.current = false;
|
|
274
|
+
if (restoreStartingStyle) panel.setAttribute(startingStyle, '');
|
|
275
|
+
panel.setAttribute('hidden', 'until-found');
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
const handleBeforeMatch = (event)=>{
|
|
280
|
+
const eventDetails = createChangeEventDetails("none", event);
|
|
281
|
+
onOpenChange(true, eventDetails);
|
|
282
|
+
if (eventDetails.isCanceled) return void scheduleRevealRevert(false, false);
|
|
275
283
|
shouldSkipNextOpenRef.current = true;
|
|
284
|
+
const hadStartingStyle = panel.hasAttribute(startingStyle);
|
|
285
|
+
panel.removeAttribute(startingStyle);
|
|
276
286
|
setOpen(true);
|
|
277
|
-
|
|
278
|
-
}
|
|
279
|
-
|
|
287
|
+
scheduleRevealRevert(true, hadStartingStyle);
|
|
288
|
+
};
|
|
289
|
+
const cleanupBeforeMatchListener = addEventListener(panel, 'beforematch', handleBeforeMatch);
|
|
290
|
+
return ()=>{
|
|
291
|
+
revealDecisionTimeout.clear();
|
|
292
|
+
AnimationFrame.cancel(revertRevealFrame);
|
|
293
|
+
cleanupBeforeMatchListener();
|
|
294
|
+
};
|
|
280
295
|
}, [
|
|
296
|
+
latestOpenRef,
|
|
281
297
|
onOpenChange,
|
|
282
298
|
setOpen
|
|
283
299
|
]);
|
|
@@ -286,7 +302,7 @@ function useCollapsiblePanel(parameters) {
|
|
|
286
302
|
height: renderedDimensions.height,
|
|
287
303
|
props: {
|
|
288
304
|
...shouldPersistHiddenTransitionStyles ? {
|
|
289
|
-
[
|
|
305
|
+
[startingStyle]: ''
|
|
290
306
|
} : void 0,
|
|
291
307
|
hidden,
|
|
292
308
|
id: idParam
|
|
@@ -304,7 +320,7 @@ function getDimensions(element) {
|
|
|
304
320
|
width: element.scrollWidth
|
|
305
321
|
};
|
|
306
322
|
}
|
|
307
|
-
function getAnimationType(element, hasSuppressedMountAnimation
|
|
323
|
+
function getAnimationType(element, hasSuppressedMountAnimation) {
|
|
308
324
|
const panelStyles = getWindow(element).getComputedStyle(element);
|
|
309
325
|
const hasAnimation = (panelStyles.animationName.split(',').map((name)=>name.trim()).some((name)=>'' !== name && 'none' !== name) || hasSuppressedMountAnimation) && hasNonZeroDuration(panelStyles.animationDuration);
|
|
310
326
|
const hasTransition = hasNonZeroDuration(panelStyles.transitionDuration);
|
package/dist/{6914.js → 8129.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { stringifyLocale } from "./2580.js";
|
|
1
2
|
const cache = new Map();
|
|
2
3
|
function getFormatter(locale, options) {
|
|
3
4
|
const optionsString = JSON.stringify({
|
|
4
|
-
locale,
|
|
5
|
+
locale: stringifyLocale(locale),
|
|
5
6
|
options
|
|
6
7
|
});
|
|
7
8
|
const cachedFormatter = cache.get(optionsString);
|
|
@@ -14,17 +15,4 @@ function formatNumber(value, locale, options) {
|
|
|
14
15
|
if (null == value) return '';
|
|
15
16
|
return getFormatter(locale, options).format(value);
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
return formatNumber(value, locale, {
|
|
19
|
-
...options,
|
|
20
|
-
maximumFractionDigits: 20
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
function formatNumberValue(value, locale, format) {
|
|
24
|
-
if (null == value) return '';
|
|
25
|
-
if (!format) return formatNumber(value / 100, locale, {
|
|
26
|
-
style: 'percent'
|
|
27
|
-
});
|
|
28
|
-
return formatNumber(value, locale, format);
|
|
29
|
-
}
|
|
30
|
-
export { formatNumber, formatNumberMaxPrecision, formatNumberValue, getFormatter };
|
|
18
|
+
export { formatNumber, getFormatter };
|
package/dist/{3319.js → 8358.js}
RENAMED
|
@@ -1,12 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { android } from "./2221.js";
|
|
2
|
+
import { ARROW_LEFT, ARROW_UP, ARROW_DOWN, jsdom, ARROW_RIGHT } from "./5490.js";
|
|
3
|
+
import { closest } from "./4155.js";
|
|
3
4
|
import { getComputedStyle } from "./3829.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
function stopEvent(event) {
|
|
6
|
+
event.preventDefault();
|
|
7
|
+
event.stopPropagation();
|
|
8
|
+
}
|
|
9
|
+
function isReactEvent(event) {
|
|
10
|
+
return 'nativeEvent' in event;
|
|
11
|
+
}
|
|
12
|
+
function isVirtualClick(event) {
|
|
13
|
+
if ('' === event.pointerType && event.isTrusted) return true;
|
|
14
|
+
if (android && event.pointerType) return 'click' === event.type && 1 === event.buttons;
|
|
15
|
+
return 0 === event.detail && !event.pointerType;
|
|
16
|
+
}
|
|
17
|
+
function isVirtualPointerEvent(event) {
|
|
18
|
+
if (jsdom) return false;
|
|
19
|
+
return !android && 0 === event.width && 0 === event.height || 'pointerdown' === event.type && 1 === event.width && 1 === event.height && 0 === event.pressure && 0 === event.detail && 'mouse' === event.pointerType && (android || 0 === event.buttons) || event.width < 1 && event.height < 1 && 0 === event.pressure && 0 === event.detail && 'touch' === event.pointerType;
|
|
20
|
+
}
|
|
21
|
+
function isMouseLikePointerType(pointerType, strict) {
|
|
22
|
+
const values = [
|
|
23
|
+
'mouse',
|
|
24
|
+
'pen'
|
|
25
|
+
];
|
|
26
|
+
if (!strict) values.push('', void 0);
|
|
27
|
+
return values.includes(pointerType);
|
|
28
|
+
}
|
|
29
|
+
function isClickLikeEvent(event) {
|
|
30
|
+
const type = event.type;
|
|
31
|
+
return 'click' === type || 'mousedown' === type || 'keydown' === type || 'keyup' === type;
|
|
32
|
+
}
|
|
10
33
|
const min = Math.min;
|
|
11
34
|
const max = Math.max;
|
|
12
35
|
const round = Math.round;
|
|
@@ -112,12 +135,12 @@ function getOppositePlacement(placement) {
|
|
|
112
135
|
return oppositeSideMap[side] + placement.slice(side.length);
|
|
113
136
|
}
|
|
114
137
|
function expandPaddingObject(padding) {
|
|
138
|
+
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
|
115
139
|
return {
|
|
116
|
-
top: 0,
|
|
117
|
-
right: 0,
|
|
118
|
-
bottom: 0,
|
|
119
|
-
left: 0
|
|
120
|
-
...padding
|
|
140
|
+
top: null != (_padding$top = padding.top) ? _padding$top : 0,
|
|
141
|
+
right: null != (_padding$right = padding.right) ? _padding$right : 0,
|
|
142
|
+
bottom: null != (_padding$bottom = padding.bottom) ? _padding$bottom : 0,
|
|
143
|
+
left: null != (_padding$left = padding.left) ? _padding$left : 0
|
|
121
144
|
};
|
|
122
145
|
}
|
|
123
146
|
function getPaddingObject(padding) {
|
|
@@ -159,6 +182,29 @@ function getMaxListIndex(listRef, disabledIndices) {
|
|
|
159
182
|
disabledIndices
|
|
160
183
|
});
|
|
161
184
|
}
|
|
185
|
+
function getNextListIndex(list, currentIndex, options) {
|
|
186
|
+
const { decrement, loopFocus, allowEscape, disabledIndices, minIndex, maxIndex } = options;
|
|
187
|
+
const step = ()=>findNonDisabledListIndex(list, {
|
|
188
|
+
startingIndex: currentIndex,
|
|
189
|
+
decrement,
|
|
190
|
+
disabledIndices
|
|
191
|
+
});
|
|
192
|
+
let index;
|
|
193
|
+
let wrapped = false;
|
|
194
|
+
if (loopFocus) if (decrement ? currentIndex <= minIndex : currentIndex >= maxIndex) {
|
|
195
|
+
const outside = decrement ? -1 : list.length;
|
|
196
|
+
if (allowEscape && currentIndex !== outside) index = -1;
|
|
197
|
+
else {
|
|
198
|
+
index = decrement ? maxIndex : minIndex;
|
|
199
|
+
wrapped = true;
|
|
200
|
+
}
|
|
201
|
+
} else index = step();
|
|
202
|
+
else index = decrement ? Math.max(minIndex, step()) : Math.min(maxIndex, step());
|
|
203
|
+
return {
|
|
204
|
+
index: isIndexOutOfListBounds(list, index) ? -1 : index,
|
|
205
|
+
wrapped
|
|
206
|
+
};
|
|
207
|
+
}
|
|
162
208
|
function findNonDisabledListIndex(list, { startingIndex = -1, decrement = false, disabledIndices, amount = 1 } = {}) {
|
|
163
209
|
let index = startingIndex;
|
|
164
210
|
do index += decrement ? -amount : amount;
|
|
@@ -181,7 +227,7 @@ function getGridNavigatedIndex(list, { event, orientation, loopFocus, onLoop, rt
|
|
|
181
227
|
list.forEach((el, idx)=>{
|
|
182
228
|
if (null == el) return;
|
|
183
229
|
visibleItemCount += 1;
|
|
184
|
-
const rowEl =
|
|
230
|
+
const rowEl = closest(el, '[role="row"]');
|
|
185
231
|
if (rowEl) hasRoleRow = true;
|
|
186
232
|
if (rowEl !== currentRowEl || -1 === currentRowIndex) {
|
|
187
233
|
currentRowEl = rowEl;
|
|
@@ -333,60 +379,13 @@ function getGridNavigatedIndex(list, { event, orientation, loopFocus, onLoop, rt
|
|
|
333
379
|
}
|
|
334
380
|
return nextIndex;
|
|
335
381
|
}
|
|
336
|
-
function createGridCellMap(sizes, cols, dense) {
|
|
337
|
-
const cellMap = [];
|
|
338
|
-
let startIndex = 0;
|
|
339
|
-
sizes.forEach(({ width, height }, index)=>{
|
|
340
|
-
if (width > cols) {
|
|
341
|
-
if ('production' !== process.env.NODE_ENV) throw new Error(`[Floating UI]: Invalid grid - item width at index ${index} is greater than grid columns`);
|
|
342
|
-
}
|
|
343
|
-
let itemPlaced = false;
|
|
344
|
-
if (dense) startIndex = 0;
|
|
345
|
-
while(!itemPlaced){
|
|
346
|
-
const targetCells = [];
|
|
347
|
-
for(let i = 0; i < width; i += 1)for(let j = 0; j < height; j += 1)targetCells.push(startIndex + i + j * cols);
|
|
348
|
-
if (startIndex % cols + width <= cols && targetCells.every((cell)=>null == cellMap[cell])) {
|
|
349
|
-
targetCells.forEach((cell)=>{
|
|
350
|
-
cellMap[cell] = index;
|
|
351
|
-
});
|
|
352
|
-
itemPlaced = true;
|
|
353
|
-
} else startIndex += 1;
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
return [
|
|
357
|
-
...cellMap
|
|
358
|
-
];
|
|
359
|
-
}
|
|
360
|
-
function getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {
|
|
361
|
-
if (-1 === index) return -1;
|
|
362
|
-
const firstCellIndex = cellMap.indexOf(index);
|
|
363
|
-
const sizeItem = sizes[index];
|
|
364
|
-
switch(corner){
|
|
365
|
-
case 'tl':
|
|
366
|
-
return firstCellIndex;
|
|
367
|
-
case 'tr':
|
|
368
|
-
if (!sizeItem) return firstCellIndex;
|
|
369
|
-
return firstCellIndex + sizeItem.width - 1;
|
|
370
|
-
case 'bl':
|
|
371
|
-
if (!sizeItem) return firstCellIndex;
|
|
372
|
-
return firstCellIndex + (sizeItem.height - 1) * cols;
|
|
373
|
-
case 'br':
|
|
374
|
-
return cellMap.lastIndexOf(index);
|
|
375
|
-
default:
|
|
376
|
-
return -1;
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
function getGridCellIndices(indices, cellMap) {
|
|
380
|
-
return cellMap.flatMap((index, cellIndex)=>indices.includes(index) ? [
|
|
381
|
-
cellIndex
|
|
382
|
-
] : []);
|
|
383
|
-
}
|
|
384
382
|
function isListIndexDisabled(list, index, disabledIndices) {
|
|
385
383
|
const isExplicitlyDisabled = 'function' == typeof disabledIndices ? disabledIndices(index) : disabledIndices?.includes(index) ?? false;
|
|
386
384
|
if (isExplicitlyDisabled) return true;
|
|
387
385
|
const element = list[index];
|
|
388
386
|
if (!element) return false;
|
|
389
387
|
if (!isElementVisible(element)) return true;
|
|
388
|
+
if (element.matches(':disabled')) return true;
|
|
390
389
|
return !disabledIndices && (element.hasAttribute('disabled') || 'true' === element.getAttribute('aria-disabled'));
|
|
391
390
|
}
|
|
392
391
|
function isHiddenByStyles(styles) {
|
|
@@ -397,4 +396,4 @@ function isElementVisible(element, styles = element ? getComputedStyle(element)
|
|
|
397
396
|
if ('function' == typeof element.checkVisibility) return element.checkVisibility();
|
|
398
397
|
return 'none' !== styles.display && 'contents' !== styles.display;
|
|
399
398
|
}
|
|
400
|
-
export { clamp, createCoords,
|
|
399
|
+
export { clamp, createCoords, evaluate, findNonDisabledListIndex, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getGridNavigatedIndex, getMaxListIndex, getMinListIndex, getNextListIndex, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, isClickLikeEvent, isElementVisible, isIndexOutOfListBounds, isListIndexDisabled, isMouseLikePointerType, isReactEvent, isVirtualClick, isVirtualPointerEvent, max, min, rectToClientRect, round, stopEvent };
|
package/dist/{5864.js → 8407.js}
RENAMED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { triggerPress } from "./
|
|
2
|
-
import { useAnimationFrame } from "./
|
|
3
|
-
import { useTimeout } from "./
|
|
4
|
-
import { createChangeEventDetails } from "./
|
|
5
|
-
import { isMouseLikePointerType } from "./
|
|
6
|
-
import { getTarget } from "./
|
|
7
|
-
import { isTypeableElement } from "./
|
|
8
|
-
import { EMPTY_OBJECT } from "./
|
|
1
|
+
import { triggerPress } from "./9837.js";
|
|
2
|
+
import { useAnimationFrame } from "./5595.js";
|
|
3
|
+
import { useTimeout } from "./9197.js";
|
|
4
|
+
import { createChangeEventDetails } from "./8495.js";
|
|
5
|
+
import { isMouseLikePointerType, isVirtualPointerEvent } from "./8358.js";
|
|
6
|
+
import { getTarget } from "./4155.js";
|
|
7
|
+
import { isTypeableElement } from "./6137.js";
|
|
8
|
+
import { EMPTY_OBJECT } from "./9591.js";
|
|
9
9
|
import * as __rspack_external_react from "react";
|
|
10
|
-
function useClick(
|
|
10
|
+
function useClick(store, props = {}) {
|
|
11
11
|
const { enabled = true, event: eventOption = 'click', toggle = true, ignoreMouse = false, stickIfOpen = true, touchOpenDelay = 0, reason = triggerPress } = props;
|
|
12
|
-
const store = 'rootStore' in context ? context.rootStore : context;
|
|
13
12
|
const dataRef = store.context.dataRef;
|
|
14
13
|
const pointerTypeRef = __rspack_external_react.useRef(void 0);
|
|
15
14
|
const frame = useAnimationFrame();
|
|
@@ -28,12 +27,12 @@ function useClick(context, props = {}) {
|
|
|
28
27
|
if (open && hasClickedOnInactiveTrigger) return true;
|
|
29
28
|
if (!open) return true;
|
|
30
29
|
if (!toggle) return true;
|
|
31
|
-
if (openEvent && stickIfOpen) return !isClickLikeOpenEvent(openEvent.type);
|
|
30
|
+
if (openEvent && ('function' == typeof stickIfOpen ? stickIfOpen() : stickIfOpen)) return !isClickLikeOpenEvent(openEvent.type);
|
|
32
31
|
return false;
|
|
33
32
|
}
|
|
34
33
|
return {
|
|
35
34
|
onPointerDown (event) {
|
|
36
|
-
pointerTypeRef.current = event.pointerType;
|
|
35
|
+
pointerTypeRef.current = isMouseLikePointerType(event.pointerType, true) && isVirtualPointerEvent(event.nativeEvent) ? 'virtual' : event.pointerType;
|
|
37
36
|
},
|
|
38
37
|
onMouseDown (event) {
|
|
39
38
|
const pointerType = pointerTypeRef.current;
|
|
@@ -42,7 +41,8 @@ function useClick(context, props = {}) {
|
|
|
42
41
|
if (0 !== event.button || 'click' === eventOption || isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
|
|
43
42
|
const nextOpen = getNextOpen(open, event.currentTarget, (openEventType)=>'click' === openEventType || 'mousedown' === openEventType);
|
|
44
43
|
const target = getTarget(nativeEvent);
|
|
45
|
-
|
|
44
|
+
const isTypeable = isTypeableElement(target);
|
|
45
|
+
if (isTypeable || 'virtual' === pointerType) return void setOpenWithTouchDelay(nextOpen, nativeEvent, isTypeable ? target : event.currentTarget, pointerType);
|
|
46
46
|
const eventCurrentTarget = event.currentTarget;
|
|
47
47
|
frame.request(()=>{
|
|
48
48
|
setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);
|
package/dist/8488.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { endingStyle, startingStyle } from "./6620.js";
|
|
2
|
+
const STARTING_HOOK = {
|
|
3
|
+
[startingStyle]: ''
|
|
4
|
+
};
|
|
5
|
+
const ENDING_HOOK = {
|
|
6
|
+
[endingStyle]: ''
|
|
7
|
+
};
|
|
8
|
+
const transitionStatusMapping = {
|
|
9
|
+
transitionStatus (value) {
|
|
10
|
+
if ('starting' === value) return STARTING_HOOK;
|
|
11
|
+
if ('ending' === value) return ENDING_HOOK;
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export { transitionStatusMapping };
|
package/dist/{4768.js → 8495.js}
RENAMED