@timeax/form-palette 0.2.1 → 0.2.2
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/{core-DQr56obQ.d.mts → core-ClbfF5iz.d.mts} +4 -0
- package/dist/{core-Cg8uXa6v.d.ts → core-Uq5vFxo3.d.ts} +4 -0
- package/dist/extra.d.mts +2 -2
- package/dist/extra.d.ts +2 -2
- package/dist/extra.js +976 -721
- package/dist/extra.js.map +1 -1
- package/dist/extra.mjs +899 -644
- package/dist/extra.mjs.map +1 -1
- package/dist/index.d.mts +40 -3
- package/dist/index.d.ts +40 -3
- package/dist/index.js +1015 -697
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +936 -621
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/extra.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React76 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var reactDom = require('react-dom');
|
|
6
6
|
var Draggable = require('react-draggable');
|
|
@@ -11,7 +11,7 @@ var reactSlot = require('@radix-ui/react-slot');
|
|
|
11
11
|
var SwitchPrimitive = require('@radix-ui/react-switch');
|
|
12
12
|
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
13
13
|
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
14
|
-
var
|
|
14
|
+
var ScrollAreaPrimitive2 = require('@radix-ui/react-scroll-area');
|
|
15
15
|
var reactVirtuoso = require('react-virtuoso');
|
|
16
16
|
var SliderPrimitive = require('@radix-ui/react-slider');
|
|
17
17
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
@@ -45,7 +45,7 @@ function _interopNamespace(e) {
|
|
|
45
45
|
return Object.freeze(n);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var React76__namespace = /*#__PURE__*/_interopNamespace(React76);
|
|
49
49
|
var Draggable__default = /*#__PURE__*/_interopDefault(Draggable);
|
|
50
50
|
var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
|
|
51
51
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
@@ -53,7 +53,7 @@ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitiv
|
|
|
53
53
|
var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive);
|
|
54
54
|
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
55
55
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
56
|
-
var
|
|
56
|
+
var ScrollAreaPrimitive2__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive2);
|
|
57
57
|
var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
|
|
58
58
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
59
59
|
var ToggleGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(ToggleGroupPrimitive);
|
|
@@ -6666,19 +6666,19 @@ function createListerRuntime(opts) {
|
|
|
6666
6666
|
selectors
|
|
6667
6667
|
};
|
|
6668
6668
|
}
|
|
6669
|
-
var ListerContext =
|
|
6669
|
+
var ListerContext = React76__namespace.createContext(
|
|
6670
6670
|
null
|
|
6671
6671
|
);
|
|
6672
6672
|
function ListerProvider({
|
|
6673
6673
|
children,
|
|
6674
6674
|
...opts
|
|
6675
6675
|
}) {
|
|
6676
|
-
const runtimeRef =
|
|
6677
|
-
const [, forceUpdate] =
|
|
6676
|
+
const runtimeRef = React76__namespace.useRef(null);
|
|
6677
|
+
const [, forceUpdate] = React76__namespace.useReducer((x2) => x2 + 1, 0);
|
|
6678
6678
|
if (!runtimeRef.current) {
|
|
6679
6679
|
runtimeRef.current = createListerRuntime(opts);
|
|
6680
6680
|
}
|
|
6681
|
-
|
|
6681
|
+
React76__namespace.useEffect(() => {
|
|
6682
6682
|
const runtime = runtimeRef.current;
|
|
6683
6683
|
if (!runtime) return;
|
|
6684
6684
|
const unsub = runtime.subscribe(() => {
|
|
@@ -6689,7 +6689,7 @@ function ListerProvider({
|
|
|
6689
6689
|
return /* @__PURE__ */ jsxRuntime.jsx(ListerContext.Provider, { value: runtimeRef.current, children });
|
|
6690
6690
|
}
|
|
6691
6691
|
function useListerRuntime() {
|
|
6692
|
-
const ctx =
|
|
6692
|
+
const ctx = React76__namespace.useContext(ListerContext);
|
|
6693
6693
|
if (!ctx)
|
|
6694
6694
|
throw new Error(
|
|
6695
6695
|
"useListerRuntime must be used within <ListerProvider>"
|
|
@@ -9768,17 +9768,17 @@ var focusEl = (el) => {
|
|
|
9768
9768
|
}
|
|
9769
9769
|
};
|
|
9770
9770
|
function useUpdateEffect(effect, deps) {
|
|
9771
|
-
const mounted =
|
|
9772
|
-
|
|
9771
|
+
const mounted = React76__namespace.useRef(false);
|
|
9772
|
+
React76__namespace.useEffect(() => {
|
|
9773
9773
|
if (mounted.current) {
|
|
9774
9774
|
return effect();
|
|
9775
9775
|
}
|
|
9776
9776
|
mounted.current = true;
|
|
9777
9777
|
}, deps);
|
|
9778
9778
|
}
|
|
9779
|
-
var InputMask =
|
|
9780
|
-
|
|
9781
|
-
const props =
|
|
9779
|
+
var InputMask = React76__namespace.memo(
|
|
9780
|
+
React76__namespace.forwardRef((inProps, ref) => {
|
|
9781
|
+
const props = React76__namespace.useMemo(
|
|
9782
9782
|
() => ({
|
|
9783
9783
|
autoClear: true,
|
|
9784
9784
|
autoFocus: false,
|
|
@@ -9793,20 +9793,20 @@ var InputMask = React74__namespace.memo(
|
|
|
9793
9793
|
}),
|
|
9794
9794
|
[inProps]
|
|
9795
9795
|
);
|
|
9796
|
-
const elementRef =
|
|
9797
|
-
const firstNonMaskPos =
|
|
9798
|
-
const lastRequiredNonMaskPos =
|
|
9799
|
-
const tests =
|
|
9800
|
-
const buffer =
|
|
9801
|
-
const len =
|
|
9802
|
-
const oldVal =
|
|
9803
|
-
const focus =
|
|
9804
|
-
const focusText =
|
|
9805
|
-
const isValueChecked =
|
|
9806
|
-
const partialPosition =
|
|
9807
|
-
const defaultBuffer =
|
|
9808
|
-
const caretTimeoutId =
|
|
9809
|
-
const androidChrome =
|
|
9796
|
+
const elementRef = React76__namespace.useRef(null);
|
|
9797
|
+
const firstNonMaskPos = React76__namespace.useRef(null);
|
|
9798
|
+
const lastRequiredNonMaskPos = React76__namespace.useRef(0);
|
|
9799
|
+
const tests = React76__namespace.useRef([]);
|
|
9800
|
+
const buffer = React76__namespace.useRef([]);
|
|
9801
|
+
const len = React76__namespace.useRef(0);
|
|
9802
|
+
const oldVal = React76__namespace.useRef(null);
|
|
9803
|
+
const focus = React76__namespace.useRef(false);
|
|
9804
|
+
const focusText = React76__namespace.useRef(null);
|
|
9805
|
+
const isValueChecked = React76__namespace.useRef(null);
|
|
9806
|
+
const partialPosition = React76__namespace.useRef(null);
|
|
9807
|
+
const defaultBuffer = React76__namespace.useRef(null);
|
|
9808
|
+
const caretTimeoutId = React76__namespace.useRef(null);
|
|
9809
|
+
const androidChrome = React76__namespace.useRef(false);
|
|
9810
9810
|
const caret = (first, last) => {
|
|
9811
9811
|
var _a, _b;
|
|
9812
9812
|
let range;
|
|
@@ -9841,7 +9841,7 @@ var InputMask = React74__namespace.memo(
|
|
|
9841
9841
|
}
|
|
9842
9842
|
return { begin, end };
|
|
9843
9843
|
};
|
|
9844
|
-
const getPlaceholder =
|
|
9844
|
+
const getPlaceholder = React76__namespace.useCallback(
|
|
9845
9845
|
(i4) => {
|
|
9846
9846
|
var _a;
|
|
9847
9847
|
const slotChar2 = (_a = props.slotChar) != null ? _a : "_";
|
|
@@ -10111,7 +10111,7 @@ var InputMask = React74__namespace.memo(
|
|
|
10111
10111
|
});
|
|
10112
10112
|
}
|
|
10113
10113
|
};
|
|
10114
|
-
const getUnmaskedValue =
|
|
10114
|
+
const getUnmaskedValue = React76__namespace.useCallback(() => {
|
|
10115
10115
|
const unmaskedBuffer = [];
|
|
10116
10116
|
for (let i4 = 0; i4 < buffer.current.length; i4++) {
|
|
10117
10117
|
const c2 = buffer.current[i4];
|
|
@@ -10166,7 +10166,7 @@ var InputMask = React74__namespace.memo(
|
|
|
10166
10166
|
}
|
|
10167
10167
|
return pos;
|
|
10168
10168
|
};
|
|
10169
|
-
const isValueUpdated =
|
|
10169
|
+
const isValueUpdated = React76__namespace.useCallback(() => {
|
|
10170
10170
|
var _a, _b, _c, _d;
|
|
10171
10171
|
const elVal = (_b = (_a = elementRef.current) == null ? void 0 : _a.value) != null ? _b : "";
|
|
10172
10172
|
return props.unmask ? ((_c = props.value) != null ? _c : "") !== getUnmaskedValue() : defaultBuffer.current !== elVal && elVal !== ((_d = props.value) != null ? _d : "");
|
|
@@ -10266,7 +10266,7 @@ var InputMask = React74__namespace.memo(
|
|
|
10266
10266
|
const onInput = (event) => {
|
|
10267
10267
|
androidChrome.current ? handleAndroidInput(event) : handleInputChange(event);
|
|
10268
10268
|
};
|
|
10269
|
-
|
|
10269
|
+
React76__namespace.useImperativeHandle(
|
|
10270
10270
|
ref,
|
|
10271
10271
|
() => ({
|
|
10272
10272
|
focus: () => focusEl(elementRef.current),
|
|
@@ -10274,10 +10274,10 @@ var InputMask = React74__namespace.memo(
|
|
|
10274
10274
|
}),
|
|
10275
10275
|
[]
|
|
10276
10276
|
);
|
|
10277
|
-
|
|
10277
|
+
React76__namespace.useEffect(() => {
|
|
10278
10278
|
if (!elementRef.current) return;
|
|
10279
10279
|
}, []);
|
|
10280
|
-
|
|
10280
|
+
React76__namespace.useEffect(() => {
|
|
10281
10281
|
init();
|
|
10282
10282
|
updateValue();
|
|
10283
10283
|
}, []);
|
|
@@ -10311,6 +10311,7 @@ var InputMask = React74__namespace.memo(
|
|
|
10311
10311
|
onKeyPress: l2,
|
|
10312
10312
|
onInput: m2,
|
|
10313
10313
|
className,
|
|
10314
|
+
invalid,
|
|
10314
10315
|
...restInputProps
|
|
10315
10316
|
} = props;
|
|
10316
10317
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10332,6 +10333,7 @@ var InputMask = React74__namespace.memo(
|
|
|
10332
10333
|
onKeyPress,
|
|
10333
10334
|
onInput,
|
|
10334
10335
|
onPaste: (e4) => handleInputChange(e4, true),
|
|
10336
|
+
"aria-invalid": invalid ? "true" : void 0,
|
|
10335
10337
|
...restInputProps
|
|
10336
10338
|
}
|
|
10337
10339
|
);
|
|
@@ -10425,7 +10427,7 @@ function resolveSizeDensityClasses(size, density) {
|
|
|
10425
10427
|
}
|
|
10426
10428
|
return { heightCls, textCls, densityCls };
|
|
10427
10429
|
}
|
|
10428
|
-
var Input =
|
|
10430
|
+
var Input = React76__namespace.forwardRef(
|
|
10429
10431
|
function Input2(rawProps, forwardedRef) {
|
|
10430
10432
|
const {
|
|
10431
10433
|
// base
|
|
@@ -10435,6 +10437,7 @@ var Input = React74__namespace.forwardRef(
|
|
|
10435
10437
|
disabled,
|
|
10436
10438
|
readOnly,
|
|
10437
10439
|
required,
|
|
10440
|
+
invalid,
|
|
10438
10441
|
// size / density
|
|
10439
10442
|
size = "md",
|
|
10440
10443
|
density = "normal",
|
|
@@ -10488,8 +10491,8 @@ var Input = React74__namespace.forwardRef(
|
|
|
10488
10491
|
const sizeKey = size != null ? size : "md";
|
|
10489
10492
|
const densityKey = density != null ? density : "normal";
|
|
10490
10493
|
const isMasked = Boolean(mask);
|
|
10491
|
-
const innerRef =
|
|
10492
|
-
|
|
10494
|
+
const innerRef = React76__namespace.useRef(null);
|
|
10495
|
+
React76__namespace.useImperativeHandle(
|
|
10493
10496
|
forwardedRef,
|
|
10494
10497
|
() => innerRef.current,
|
|
10495
10498
|
[]
|
|
@@ -10510,11 +10513,11 @@ var Input = React74__namespace.forwardRef(
|
|
|
10510
10513
|
const baseIconGap = iconGap != null ? iconGap : 4;
|
|
10511
10514
|
const leadingGap = leadingIconSpacing != null ? leadingIconSpacing : baseIconGap;
|
|
10512
10515
|
const trailingGap = trailingIconSpacing != null ? trailingIconSpacing : baseIconGap;
|
|
10513
|
-
const leadingIconsRef =
|
|
10514
|
-
const trailingIconsRef =
|
|
10515
|
-
const [leadingIconsWidth, setLeadingIconsWidth] =
|
|
10516
|
-
const [trailingIconsWidth, setTrailingIconsWidth] =
|
|
10517
|
-
|
|
10516
|
+
const leadingIconsRef = React76__namespace.useRef(null);
|
|
10517
|
+
const trailingIconsRef = React76__namespace.useRef(null);
|
|
10518
|
+
const [leadingIconsWidth, setLeadingIconsWidth] = React76__namespace.useState(0);
|
|
10519
|
+
const [trailingIconsWidth, setTrailingIconsWidth] = React76__namespace.useState(0);
|
|
10520
|
+
React76__namespace.useLayoutEffect(() => {
|
|
10518
10521
|
if (typeof window === "undefined") return;
|
|
10519
10522
|
if (typeof ResizeObserver === "undefined") return;
|
|
10520
10523
|
const leadingEl = leadingIconsRef.current;
|
|
@@ -10589,7 +10592,7 @@ var Input = React74__namespace.forwardRef(
|
|
|
10589
10592
|
inputClassName
|
|
10590
10593
|
);
|
|
10591
10594
|
const maskMode = unmask === true || unmask === "raw" ? "raw" : "masked";
|
|
10592
|
-
const handleFocus =
|
|
10595
|
+
const handleFocus = React76__namespace.useCallback(
|
|
10593
10596
|
(event) => {
|
|
10594
10597
|
onFocus == null ? void 0 : onFocus(event);
|
|
10595
10598
|
if (!prefix && !suffix) return;
|
|
@@ -10617,7 +10620,7 @@ var Input = React74__namespace.forwardRef(
|
|
|
10617
10620
|
const placeholder = typeof mask === "string" && mask ? mask : rest.placeholder;
|
|
10618
10621
|
const hasCustomPadding = typeof px === "number" || typeof py === "number" || typeof ps === "number" || typeof pe2 === "number" || typeof pb === "number";
|
|
10619
10622
|
const hasKeyFilter = !!keyFilter;
|
|
10620
|
-
const handleKeyDownWrapped =
|
|
10623
|
+
const handleKeyDownWrapped = React76__namespace.useCallback(
|
|
10621
10624
|
(event) => {
|
|
10622
10625
|
if (hasKeyFilter && keyFilterOn === "keydown" && !event.ctrlKey && !event.metaKey && !event.altKey && event.key && event.key.length === 1) {
|
|
10623
10626
|
const inputEl = event.currentTarget;
|
|
@@ -10634,7 +10637,7 @@ var Input = React74__namespace.forwardRef(
|
|
|
10634
10637
|
},
|
|
10635
10638
|
[hasKeyFilter, keyFilterOn, keyFilter, onKeyDown]
|
|
10636
10639
|
);
|
|
10637
|
-
const handleKeyPressWrapped =
|
|
10640
|
+
const handleKeyPressWrapped = React76__namespace.useCallback(
|
|
10638
10641
|
(event) => {
|
|
10639
10642
|
if (hasKeyFilter && keyFilterOn === "keypress" && !event.ctrlKey && !event.metaKey && !event.altKey && event.key && event.key.length === 1) {
|
|
10640
10643
|
const inputEl = event.currentTarget;
|
|
@@ -10651,7 +10654,7 @@ var Input = React74__namespace.forwardRef(
|
|
|
10651
10654
|
},
|
|
10652
10655
|
[hasKeyFilter, keyFilterOn, keyFilter, onKeyPress]
|
|
10653
10656
|
);
|
|
10654
|
-
const handleBeforeInputWrapped =
|
|
10657
|
+
const handleBeforeInputWrapped = React76__namespace.useCallback(
|
|
10655
10658
|
(event) => {
|
|
10656
10659
|
if (hasKeyFilter && keyFilterOn === "beforeinput" && (event == null ? void 0 : event.nativeEvent)) {
|
|
10657
10660
|
const inputEl = event.currentTarget;
|
|
@@ -10672,7 +10675,7 @@ var Input = React74__namespace.forwardRef(
|
|
|
10672
10675
|
},
|
|
10673
10676
|
[hasKeyFilter, keyFilterOn, keyFilter, onBeforeInput]
|
|
10674
10677
|
);
|
|
10675
|
-
const handlePasteWrapped =
|
|
10678
|
+
const handlePasteWrapped = React76__namespace.useCallback(
|
|
10676
10679
|
(event) => {
|
|
10677
10680
|
var _a, _b;
|
|
10678
10681
|
if (hasKeyFilter && keyFilterOnPaste) {
|
|
@@ -10723,6 +10726,7 @@ var Input = React74__namespace.forwardRef(
|
|
|
10723
10726
|
onBeforeInput: handleBeforeInputWrapped,
|
|
10724
10727
|
onPaste: handlePasteWrapped,
|
|
10725
10728
|
"aria-required": required ? "true" : void 0,
|
|
10729
|
+
"aria-invalid": invalid ? "true" : void 0,
|
|
10726
10730
|
"data-size": sizeKey,
|
|
10727
10731
|
"data-density": densityKey,
|
|
10728
10732
|
placeholder,
|
|
@@ -10776,6 +10780,7 @@ var Input = React74__namespace.forwardRef(
|
|
|
10776
10780
|
disabled,
|
|
10777
10781
|
readOnly,
|
|
10778
10782
|
"aria-required": required ? "true" : void 0,
|
|
10783
|
+
"aria-invalid": invalid ? "true" : void 0,
|
|
10779
10784
|
"data-size": sizeKey,
|
|
10780
10785
|
"data-density": densityKey,
|
|
10781
10786
|
placeholder,
|
|
@@ -11070,7 +11075,7 @@ function stripAffixes(value, prefix, suffix) {
|
|
|
11070
11075
|
if (suffix && out.endsWith(suffix)) out = out.slice(0, -suffix.length);
|
|
11071
11076
|
return out;
|
|
11072
11077
|
}
|
|
11073
|
-
var ShadcnTextVariant =
|
|
11078
|
+
var ShadcnTextVariant = React76__namespace.forwardRef(function ShadcnTextVariant2(props, forwardedRef) {
|
|
11074
11079
|
const {
|
|
11075
11080
|
// form-level props
|
|
11076
11081
|
value,
|
|
@@ -11118,7 +11123,7 @@ var ShadcnTextVariant = React74__namespace.forwardRef(function ShadcnTextVariant
|
|
|
11118
11123
|
...rest
|
|
11119
11124
|
} = props;
|
|
11120
11125
|
const isMasked = Boolean(mask);
|
|
11121
|
-
const handlePlainChange =
|
|
11126
|
+
const handlePlainChange = React76__namespace.useCallback(
|
|
11122
11127
|
(e4) => {
|
|
11123
11128
|
var _a;
|
|
11124
11129
|
const displayed = (_a = e4.target.value) != null ? _a : "";
|
|
@@ -11149,7 +11154,7 @@ var ShadcnTextVariant = React74__namespace.forwardRef(function ShadcnTextVariant
|
|
|
11149
11154
|
},
|
|
11150
11155
|
[onValue, prefix, suffix, stripPrefix, stripSuffix]
|
|
11151
11156
|
);
|
|
11152
|
-
const handleMaskedChange =
|
|
11157
|
+
const handleMaskedChange = React76__namespace.useCallback(
|
|
11153
11158
|
(e4) => {
|
|
11154
11159
|
var _a, _b, _c;
|
|
11155
11160
|
const maskedValue = (_a = e4.value) != null ? _a : "";
|
|
@@ -11367,8 +11372,8 @@ function normalizeEditable(raw, locale, decimalSep, allowMinus) {
|
|
|
11367
11372
|
if (t4 === decimalSep) t4 = "0" + decimalSep;
|
|
11368
11373
|
return t4;
|
|
11369
11374
|
}
|
|
11370
|
-
var InputNumber =
|
|
11371
|
-
|
|
11375
|
+
var InputNumber = React76__namespace.memo(
|
|
11376
|
+
React76__namespace.forwardRef((inProps, ref) => {
|
|
11372
11377
|
var _a;
|
|
11373
11378
|
const props = {
|
|
11374
11379
|
allowEmpty: true,
|
|
@@ -11383,19 +11388,19 @@ var InputNumber = React74__namespace.memo(
|
|
|
11383
11388
|
type: "text",
|
|
11384
11389
|
...inProps
|
|
11385
11390
|
};
|
|
11386
|
-
const locale =
|
|
11391
|
+
const locale = React76__namespace.useMemo(
|
|
11387
11392
|
() => resolveLocale(props.locale),
|
|
11388
11393
|
[props.locale]
|
|
11389
11394
|
);
|
|
11390
|
-
const decimalSep =
|
|
11395
|
+
const decimalSep = React76__namespace.useMemo(
|
|
11391
11396
|
() => getDecimalSeparator(locale),
|
|
11392
11397
|
[locale]
|
|
11393
11398
|
);
|
|
11394
|
-
const allowMinus =
|
|
11399
|
+
const allowMinus = React76__namespace.useMemo(
|
|
11395
11400
|
() => props.min == null || props.min < 0,
|
|
11396
11401
|
[props.min]
|
|
11397
11402
|
);
|
|
11398
|
-
const fmtOptions =
|
|
11403
|
+
const fmtOptions = React76__namespace.useMemo(() => {
|
|
11399
11404
|
return {
|
|
11400
11405
|
localeMatcher: props.localeMatcher,
|
|
11401
11406
|
style: props.mode,
|
|
@@ -11416,22 +11421,22 @@ var InputNumber = React74__namespace.memo(
|
|
|
11416
11421
|
props.maxFractionDigits,
|
|
11417
11422
|
props.roundingMode
|
|
11418
11423
|
]);
|
|
11419
|
-
const inputRef =
|
|
11420
|
-
|
|
11421
|
-
const [display, setDisplay] =
|
|
11422
|
-
const [focused, setFocused] =
|
|
11423
|
-
const toEditableFromNumber =
|
|
11424
|
+
const inputRef = React76__namespace.useRef(null);
|
|
11425
|
+
React76__namespace.useImperativeHandle(ref, () => inputRef.current);
|
|
11426
|
+
const [display, setDisplay] = React76__namespace.useState("");
|
|
11427
|
+
const [focused, setFocused] = React76__namespace.useState(false);
|
|
11428
|
+
const toEditableFromNumber = React76__namespace.useCallback(
|
|
11424
11429
|
(n3) => {
|
|
11425
11430
|
const s3 = String(n3);
|
|
11426
11431
|
return decimalSep === "." ? s3 : s3.replace(".", decimalSep);
|
|
11427
11432
|
},
|
|
11428
11433
|
[decimalSep]
|
|
11429
11434
|
);
|
|
11430
|
-
const clampModel =
|
|
11435
|
+
const clampModel = React76__namespace.useCallback(
|
|
11431
11436
|
(n3) => clampToLimits(n3, props.min, props.max),
|
|
11432
11437
|
[props.min, props.max]
|
|
11433
11438
|
);
|
|
11434
|
-
const emit =
|
|
11439
|
+
const emit = React76__namespace.useCallback(
|
|
11435
11440
|
(event, value2) => {
|
|
11436
11441
|
var _a2, _b, _c;
|
|
11437
11442
|
const safeValue = sanitizeNumberish(value2);
|
|
@@ -11466,7 +11471,7 @@ var InputNumber = React74__namespace.memo(
|
|
|
11466
11471
|
}
|
|
11467
11472
|
});
|
|
11468
11473
|
};
|
|
11469
|
-
const formatFromModel =
|
|
11474
|
+
const formatFromModel = React76__namespace.useCallback(
|
|
11470
11475
|
(n3) => {
|
|
11471
11476
|
const safeNumber = sanitizeNumberish(n3);
|
|
11472
11477
|
if (safeNumber == null) return "";
|
|
@@ -11489,7 +11494,7 @@ var InputNumber = React74__namespace.memo(
|
|
|
11489
11494
|
toEditableFromNumber
|
|
11490
11495
|
]
|
|
11491
11496
|
);
|
|
11492
|
-
const getModelFromDisplay =
|
|
11497
|
+
const getModelFromDisplay = React76__namespace.useCallback(
|
|
11493
11498
|
(text) => {
|
|
11494
11499
|
const stripped = stripAffixes2(text, props.prefix, props.suffix);
|
|
11495
11500
|
const withoutGroup = stripGrouping(stripped, locale);
|
|
@@ -11501,7 +11506,7 @@ var InputNumber = React74__namespace.memo(
|
|
|
11501
11506
|
},
|
|
11502
11507
|
[props.prefix, props.suffix, locale, decimalSep, clampModel]
|
|
11503
11508
|
);
|
|
11504
|
-
const syncFromPropsValue =
|
|
11509
|
+
const syncFromPropsValue = React76__namespace.useCallback(
|
|
11505
11510
|
(v2) => {
|
|
11506
11511
|
const safeValue = sanitizeNumberish(v2);
|
|
11507
11512
|
if (safeValue == null) {
|
|
@@ -11515,11 +11520,11 @@ var InputNumber = React74__namespace.memo(
|
|
|
11515
11520
|
},
|
|
11516
11521
|
[clampModel, focused, toEditableFromNumber, formatFromModel]
|
|
11517
11522
|
);
|
|
11518
|
-
|
|
11523
|
+
React76__namespace.useEffect(() => {
|
|
11519
11524
|
var _a2;
|
|
11520
11525
|
syncFromPropsValue((_a2 = props.value) != null ? _a2 : null);
|
|
11521
11526
|
}, []);
|
|
11522
|
-
|
|
11527
|
+
React76__namespace.useEffect(() => {
|
|
11523
11528
|
var _a2;
|
|
11524
11529
|
if (focused) return;
|
|
11525
11530
|
syncFromPropsValue((_a2 = props.value) != null ? _a2 : null);
|
|
@@ -11612,6 +11617,25 @@ var InputNumber = React74__namespace.memo(
|
|
|
11612
11617
|
value,
|
|
11613
11618
|
icon,
|
|
11614
11619
|
iconGap,
|
|
11620
|
+
// Destructure to prevent leakage:
|
|
11621
|
+
locale: _locale,
|
|
11622
|
+
localeMatcher,
|
|
11623
|
+
mode,
|
|
11624
|
+
currency,
|
|
11625
|
+
currencyDisplay,
|
|
11626
|
+
useGrouping,
|
|
11627
|
+
minFractionDigits,
|
|
11628
|
+
maxFractionDigits,
|
|
11629
|
+
roundingMode,
|
|
11630
|
+
min: min2,
|
|
11631
|
+
max: max2,
|
|
11632
|
+
step,
|
|
11633
|
+
allowEmpty,
|
|
11634
|
+
format: format2,
|
|
11635
|
+
invalid,
|
|
11636
|
+
onValueChange,
|
|
11637
|
+
onChange,
|
|
11638
|
+
onValue,
|
|
11615
11639
|
...passThroughProps
|
|
11616
11640
|
} = props;
|
|
11617
11641
|
return (
|
|
@@ -11686,7 +11710,7 @@ var defaultAttributes = {
|
|
|
11686
11710
|
};
|
|
11687
11711
|
|
|
11688
11712
|
// ../../node_modules/lucide-react/dist/esm/Icon.js
|
|
11689
|
-
var Icon =
|
|
11713
|
+
var Icon = React76.forwardRef(
|
|
11690
11714
|
({
|
|
11691
11715
|
color = "currentColor",
|
|
11692
11716
|
size = 24,
|
|
@@ -11696,7 +11720,7 @@ var Icon = React74.forwardRef(
|
|
|
11696
11720
|
children,
|
|
11697
11721
|
iconNode,
|
|
11698
11722
|
...rest
|
|
11699
|
-
}, ref) =>
|
|
11723
|
+
}, ref) => React76.createElement(
|
|
11700
11724
|
"svg",
|
|
11701
11725
|
{
|
|
11702
11726
|
ref,
|
|
@@ -11710,7 +11734,7 @@ var Icon = React74.forwardRef(
|
|
|
11710
11734
|
...rest
|
|
11711
11735
|
},
|
|
11712
11736
|
[
|
|
11713
|
-
...iconNode.map(([tag, attrs]) =>
|
|
11737
|
+
...iconNode.map(([tag, attrs]) => React76.createElement(tag, attrs)),
|
|
11714
11738
|
...Array.isArray(children) ? children : [children]
|
|
11715
11739
|
]
|
|
11716
11740
|
)
|
|
@@ -11718,8 +11742,8 @@ var Icon = React74.forwardRef(
|
|
|
11718
11742
|
|
|
11719
11743
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
11720
11744
|
var createLucideIcon = (iconName, iconNode) => {
|
|
11721
|
-
const Component =
|
|
11722
|
-
({ className, ...props }, ref) =>
|
|
11745
|
+
const Component = React76.forwardRef(
|
|
11746
|
+
({ className, ...props }, ref) => React76.createElement(Icon, {
|
|
11723
11747
|
ref,
|
|
11724
11748
|
iconNode,
|
|
11725
11749
|
className: mergeClasses(
|
|
@@ -12074,7 +12098,7 @@ var X = createLucideIcon("x", __iconNode37);
|
|
|
12074
12098
|
function sanitizeNumberish2(value) {
|
|
12075
12099
|
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
12076
12100
|
}
|
|
12077
|
-
var ShadcnNumberVariant =
|
|
12101
|
+
var ShadcnNumberVariant = React76__namespace.default.forwardRef(function ShadcnNumberVariant2(props, forwardedRef) {
|
|
12078
12102
|
const {
|
|
12079
12103
|
showButtons,
|
|
12080
12104
|
buttonLayout = "stacked",
|
|
@@ -12092,7 +12116,7 @@ var ShadcnNumberVariant = React74__namespace.default.forwardRef(function ShadcnN
|
|
|
12092
12116
|
id,
|
|
12093
12117
|
inputId
|
|
12094
12118
|
} = rest;
|
|
12095
|
-
const handleChange =
|
|
12119
|
+
const handleChange = React76__namespace.default.useCallback(
|
|
12096
12120
|
(e4) => {
|
|
12097
12121
|
const safeValue = sanitizeNumberish2(e4.value);
|
|
12098
12122
|
if (onValueChange) {
|
|
@@ -12105,7 +12129,7 @@ var ShadcnNumberVariant = React74__namespace.default.forwardRef(function ShadcnN
|
|
|
12105
12129
|
},
|
|
12106
12130
|
[onValueChange]
|
|
12107
12131
|
);
|
|
12108
|
-
const handleStep =
|
|
12132
|
+
const handleStep = React76__namespace.default.useCallback(
|
|
12109
12133
|
(direction, originalEvent) => {
|
|
12110
12134
|
var _a, _b;
|
|
12111
12135
|
if (disabled) return;
|
|
@@ -12635,7 +12659,7 @@ var CountrySelect = ({
|
|
|
12635
12659
|
}) })
|
|
12636
12660
|
] }) });
|
|
12637
12661
|
};
|
|
12638
|
-
var ShadcnPhoneVariant =
|
|
12662
|
+
var ShadcnPhoneVariant = React76__namespace.forwardRef(function ShadcnPhoneVariant2(props, ref) {
|
|
12639
12663
|
const {
|
|
12640
12664
|
countries: countriesProp,
|
|
12641
12665
|
defaultCountry,
|
|
@@ -12660,8 +12684,8 @@ var ShadcnPhoneVariant = React74__namespace.forwardRef(function ShadcnPhoneVaria
|
|
|
12660
12684
|
} = props;
|
|
12661
12685
|
let DEFAULT_COUNTRIES2 = getGlobalCountryList();
|
|
12662
12686
|
const defaultCountries = countriesProp && countriesProp.length > 0 ? countriesProp : DEFAULT_COUNTRIES2;
|
|
12663
|
-
const [countries, setLoadedCountries] =
|
|
12664
|
-
|
|
12687
|
+
const [countries, setLoadedCountries] = React76__namespace.useState(defaultCountries);
|
|
12688
|
+
React76__namespace.useEffect(() => {
|
|
12665
12689
|
if (countriesProp == null ? void 0 : countriesProp.length) return;
|
|
12666
12690
|
const list = getPaletteUtil("countries");
|
|
12667
12691
|
if (list == null ? void 0 : list.length) {
|
|
@@ -12674,7 +12698,7 @@ var ShadcnPhoneVariant = React74__namespace.forwardRef(function ShadcnPhoneVaria
|
|
|
12674
12698
|
});
|
|
12675
12699
|
}
|
|
12676
12700
|
}, []);
|
|
12677
|
-
const [country, setCountry] =
|
|
12701
|
+
const [country, setCountry] = React76__namespace.useState(() => {
|
|
12678
12702
|
var _a;
|
|
12679
12703
|
if (defaultCountry) {
|
|
12680
12704
|
const found = countries.find((c2) => c2.code === defaultCountry);
|
|
@@ -12682,7 +12706,7 @@ var ShadcnPhoneVariant = React74__namespace.forwardRef(function ShadcnPhoneVaria
|
|
|
12682
12706
|
}
|
|
12683
12707
|
return (_a = countries[0]) != null ? _a : DEFAULT_COUNTRIES2[0];
|
|
12684
12708
|
});
|
|
12685
|
-
|
|
12709
|
+
React76__namespace.useEffect(() => {
|
|
12686
12710
|
setCountry((prev) => {
|
|
12687
12711
|
var _a;
|
|
12688
12712
|
if (defaultCountry) {
|
|
@@ -12693,13 +12717,13 @@ var ShadcnPhoneVariant = React74__namespace.forwardRef(function ShadcnPhoneVaria
|
|
|
12693
12717
|
return (_a = stillThere != null ? stillThere : countries[0]) != null ? _a : prev;
|
|
12694
12718
|
});
|
|
12695
12719
|
}, [countries, defaultCountry]);
|
|
12696
|
-
const [local, setLocal] =
|
|
12720
|
+
const [local, setLocal] = React76__namespace.useState(
|
|
12697
12721
|
() => computeDisplayFromValue(value, country, keepCharPositions)
|
|
12698
12722
|
);
|
|
12699
|
-
|
|
12723
|
+
React76__namespace.useEffect(() => {
|
|
12700
12724
|
setLocal(computeDisplayFromValue(value, country, keepCharPositions));
|
|
12701
12725
|
}, [value, country, keepCharPositions]);
|
|
12702
|
-
const handleInputChange =
|
|
12726
|
+
const handleInputChange = React76__namespace.useCallback(
|
|
12703
12727
|
(event) => {
|
|
12704
12728
|
var _a;
|
|
12705
12729
|
const rawInput = (_a = event.target.value) != null ? _a : "";
|
|
@@ -12725,7 +12749,7 @@ var ShadcnPhoneVariant = React74__namespace.forwardRef(function ShadcnPhoneVaria
|
|
|
12725
12749
|
},
|
|
12726
12750
|
[country, valueMode, keepCharPositions, onValue]
|
|
12727
12751
|
);
|
|
12728
|
-
const handleCountryChange =
|
|
12752
|
+
const handleCountryChange = React76__namespace.useCallback(
|
|
12729
12753
|
(nextCode) => {
|
|
12730
12754
|
var _a;
|
|
12731
12755
|
const nextCountry = (_a = countries.find((c2) => c2.code === nextCode)) != null ? _a : countries[0];
|
|
@@ -12812,7 +12836,7 @@ function normalizeColorForPicker(value) {
|
|
|
12812
12836
|
}
|
|
12813
12837
|
return "#000000";
|
|
12814
12838
|
}
|
|
12815
|
-
var ShadcnColorVariant =
|
|
12839
|
+
var ShadcnColorVariant = React76__namespace.forwardRef(function ShadcnColorVariant2(props, ref) {
|
|
12816
12840
|
const {
|
|
12817
12841
|
// variant contract
|
|
12818
12842
|
value,
|
|
@@ -12833,22 +12857,22 @@ var ShadcnColorVariant = React74__namespace.forwardRef(function ShadcnColorVaria
|
|
|
12833
12857
|
// everything else → Input (size, density, className, icons, etc.)
|
|
12834
12858
|
...restTextProps
|
|
12835
12859
|
} = props;
|
|
12836
|
-
const [local, setLocal] =
|
|
12837
|
-
const [pickerOpen, setPickerOpen] =
|
|
12838
|
-
|
|
12860
|
+
const [local, setLocal] = React76__namespace.useState(value != null ? value : "");
|
|
12861
|
+
const [pickerOpen, setPickerOpen] = React76__namespace.useState(false);
|
|
12862
|
+
React76__namespace.useEffect(() => {
|
|
12839
12863
|
setLocal(value != null ? value : "");
|
|
12840
12864
|
}, [value]);
|
|
12841
|
-
const pickerRef =
|
|
12865
|
+
const pickerRef = React76__namespace.useRef(null);
|
|
12842
12866
|
const effectiveColor = normalizeColorForPicker(local || value);
|
|
12843
12867
|
const showError = Boolean(error);
|
|
12844
|
-
const openSystemPicker =
|
|
12868
|
+
const openSystemPicker = React76__namespace.useCallback(() => {
|
|
12845
12869
|
setPickerOpen(true);
|
|
12846
12870
|
window.setTimeout(() => {
|
|
12847
12871
|
var _a;
|
|
12848
12872
|
(_a = pickerRef.current) == null ? void 0 : _a.click();
|
|
12849
12873
|
}, 0);
|
|
12850
12874
|
}, []);
|
|
12851
|
-
const handleTextChange =
|
|
12875
|
+
const handleTextChange = React76__namespace.useCallback(
|
|
12852
12876
|
(event) => {
|
|
12853
12877
|
var _a;
|
|
12854
12878
|
const next = (_a = event.target.value) != null ? _a : "";
|
|
@@ -12865,7 +12889,7 @@ var ShadcnColorVariant = React74__namespace.forwardRef(function ShadcnColorVaria
|
|
|
12865
12889
|
},
|
|
12866
12890
|
[onValue]
|
|
12867
12891
|
);
|
|
12868
|
-
const handlePickerChange =
|
|
12892
|
+
const handlePickerChange = React76__namespace.useCallback(
|
|
12869
12893
|
(event) => {
|
|
12870
12894
|
var _a;
|
|
12871
12895
|
const next = (_a = event.target.value) != null ? _a : "";
|
|
@@ -12883,7 +12907,7 @@ var ShadcnColorVariant = React74__namespace.forwardRef(function ShadcnColorVaria
|
|
|
12883
12907
|
},
|
|
12884
12908
|
[onValue]
|
|
12885
12909
|
);
|
|
12886
|
-
const handlePickerBlur =
|
|
12910
|
+
const handlePickerBlur = React76__namespace.useCallback(() => {
|
|
12887
12911
|
setPickerOpen(false);
|
|
12888
12912
|
}, []);
|
|
12889
12913
|
const leadingControl = showPreview ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13185,7 +13209,7 @@ function meterColor(score) {
|
|
|
13185
13209
|
if (score === 3) return "bg-amber-500";
|
|
13186
13210
|
return "bg-emerald-500";
|
|
13187
13211
|
}
|
|
13188
|
-
var ShadcnPasswordVariant =
|
|
13212
|
+
var ShadcnPasswordVariant = React76__namespace.forwardRef(function ShadcnPasswordVariant2(props, ref) {
|
|
13189
13213
|
var _a, _b;
|
|
13190
13214
|
const {
|
|
13191
13215
|
// base variant bits
|
|
@@ -13221,18 +13245,18 @@ var ShadcnPasswordVariant = React74__namespace.forwardRef(function ShadcnPasswor
|
|
|
13221
13245
|
// everything else from Shadcn text UI
|
|
13222
13246
|
...restTextProps
|
|
13223
13247
|
} = props;
|
|
13224
|
-
const [revealed, setRevealed] =
|
|
13248
|
+
const [revealed, setRevealed] = React76__namespace.useState(
|
|
13225
13249
|
Boolean(defaultRevealed)
|
|
13226
13250
|
);
|
|
13227
|
-
const normalizedStrength =
|
|
13251
|
+
const normalizedStrength = React76__namespace.useMemo(
|
|
13228
13252
|
() => normalizeStrengthOptions(strengthMeter),
|
|
13229
13253
|
[strengthMeter]
|
|
13230
13254
|
);
|
|
13231
|
-
const effectiveRuleDefinitions =
|
|
13255
|
+
const effectiveRuleDefinitions = React76__namespace.useMemo(
|
|
13232
13256
|
() => getMergedRuleDefinitions(ruleDefinitions),
|
|
13233
13257
|
[ruleDefinitions]
|
|
13234
13258
|
);
|
|
13235
|
-
const meterState =
|
|
13259
|
+
const meterState = React76__namespace.useMemo(() => {
|
|
13236
13260
|
if (!normalizedStrength) return null;
|
|
13237
13261
|
const v2 = value != null ? value : "";
|
|
13238
13262
|
return computeMeterState(
|
|
@@ -13242,14 +13266,14 @@ var ShadcnPasswordVariant = React74__namespace.forwardRef(function ShadcnPasswor
|
|
|
13242
13266
|
ruleUses
|
|
13243
13267
|
);
|
|
13244
13268
|
}, [normalizedStrength, value, ruleUses, effectiveRuleDefinitions]);
|
|
13245
|
-
const handleToggleReveal =
|
|
13269
|
+
const handleToggleReveal = React76__namespace.useCallback(() => {
|
|
13246
13270
|
setRevealed((prev) => {
|
|
13247
13271
|
const next = !prev;
|
|
13248
13272
|
onRevealChange == null ? void 0 : onRevealChange(next);
|
|
13249
13273
|
return next;
|
|
13250
13274
|
});
|
|
13251
13275
|
}, [onRevealChange]);
|
|
13252
|
-
const handleChange =
|
|
13276
|
+
const handleChange = React76__namespace.useCallback(
|
|
13253
13277
|
(event) => {
|
|
13254
13278
|
var _a2;
|
|
13255
13279
|
const next = (_a2 = event.target.value) != null ? _a2 : "";
|
|
@@ -15899,38 +15923,38 @@ __export(custom_components_exports, {
|
|
|
15899
15923
|
YearsDropdown: () => YearsDropdown
|
|
15900
15924
|
});
|
|
15901
15925
|
function Button(props) {
|
|
15902
|
-
return
|
|
15926
|
+
return React76__namespace.default.createElement("button", { ...props });
|
|
15903
15927
|
}
|
|
15904
15928
|
function CaptionLabel(props) {
|
|
15905
|
-
return
|
|
15929
|
+
return React76__namespace.default.createElement("span", { ...props });
|
|
15906
15930
|
}
|
|
15907
15931
|
function Chevron(props) {
|
|
15908
15932
|
const { size = 24, orientation = "left", className } = props;
|
|
15909
15933
|
return (
|
|
15910
15934
|
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
15911
|
-
|
|
15935
|
+
React76__namespace.default.createElement(
|
|
15912
15936
|
"svg",
|
|
15913
15937
|
{ className, width: size, height: size, viewBox: "0 0 24 24" },
|
|
15914
|
-
orientation === "up" &&
|
|
15915
|
-
orientation === "down" &&
|
|
15916
|
-
orientation === "left" &&
|
|
15917
|
-
orientation === "right" &&
|
|
15938
|
+
orientation === "up" && React76__namespace.default.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
15939
|
+
orientation === "down" && React76__namespace.default.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
15940
|
+
orientation === "left" && React76__namespace.default.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
15941
|
+
orientation === "right" && React76__namespace.default.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
15918
15942
|
)
|
|
15919
15943
|
);
|
|
15920
15944
|
}
|
|
15921
15945
|
function Day(props) {
|
|
15922
15946
|
const { day, modifiers, ...tdProps } = props;
|
|
15923
|
-
return
|
|
15947
|
+
return React76__namespace.default.createElement("td", { ...tdProps });
|
|
15924
15948
|
}
|
|
15925
15949
|
function DayButton(props) {
|
|
15926
15950
|
const { day, modifiers, ...buttonProps } = props;
|
|
15927
|
-
const ref =
|
|
15928
|
-
|
|
15951
|
+
const ref = React76__namespace.default.useRef(null);
|
|
15952
|
+
React76__namespace.default.useEffect(() => {
|
|
15929
15953
|
var _a;
|
|
15930
15954
|
if (modifiers.focused)
|
|
15931
15955
|
(_a = ref.current) == null ? void 0 : _a.focus();
|
|
15932
15956
|
}, [modifiers.focused]);
|
|
15933
|
-
return
|
|
15957
|
+
return React76__namespace.default.createElement("button", { ref, ...buttonProps });
|
|
15934
15958
|
}
|
|
15935
15959
|
|
|
15936
15960
|
// ../../node_modules/react-day-picker/dist/esm/UI.js
|
|
@@ -15993,41 +16017,41 @@ function Dropdown(props) {
|
|
|
15993
16017
|
const { options, className, components, classNames, ...selectProps } = props;
|
|
15994
16018
|
const cssClassSelect = [classNames[UI.Dropdown], className].join(" ");
|
|
15995
16019
|
const selectedOption = options == null ? void 0 : options.find(({ value }) => value === selectProps.value);
|
|
15996
|
-
return
|
|
16020
|
+
return React76__namespace.default.createElement(
|
|
15997
16021
|
"span",
|
|
15998
16022
|
{ "data-disabled": selectProps.disabled, className: classNames[UI.DropdownRoot] },
|
|
15999
|
-
|
|
16000
|
-
|
|
16023
|
+
React76__namespace.default.createElement(components.Select, { className: cssClassSelect, ...selectProps }, options == null ? void 0 : options.map(({ value, label, disabled }) => React76__namespace.default.createElement(components.Option, { key: value, value, disabled }, label))),
|
|
16024
|
+
React76__namespace.default.createElement(
|
|
16001
16025
|
"span",
|
|
16002
16026
|
{ className: classNames[UI.CaptionLabel], "aria-hidden": true },
|
|
16003
16027
|
selectedOption == null ? void 0 : selectedOption.label,
|
|
16004
|
-
|
|
16028
|
+
React76__namespace.default.createElement(components.Chevron, { orientation: "down", size: 18, className: classNames[UI.Chevron] })
|
|
16005
16029
|
)
|
|
16006
16030
|
);
|
|
16007
16031
|
}
|
|
16008
16032
|
function DropdownNav(props) {
|
|
16009
|
-
return
|
|
16033
|
+
return React76__namespace.default.createElement("div", { ...props });
|
|
16010
16034
|
}
|
|
16011
16035
|
function Footer(props) {
|
|
16012
|
-
return
|
|
16036
|
+
return React76__namespace.default.createElement("div", { ...props });
|
|
16013
16037
|
}
|
|
16014
16038
|
function Month(props) {
|
|
16015
16039
|
const { calendarMonth, displayIndex, ...divProps } = props;
|
|
16016
|
-
return
|
|
16040
|
+
return React76__namespace.default.createElement("div", { ...divProps }, props.children);
|
|
16017
16041
|
}
|
|
16018
16042
|
function MonthCaption(props) {
|
|
16019
16043
|
const { calendarMonth, displayIndex, ...divProps } = props;
|
|
16020
|
-
return
|
|
16044
|
+
return React76__namespace.default.createElement("div", { ...divProps });
|
|
16021
16045
|
}
|
|
16022
16046
|
function MonthGrid(props) {
|
|
16023
|
-
return
|
|
16047
|
+
return React76__namespace.default.createElement("table", { ...props });
|
|
16024
16048
|
}
|
|
16025
16049
|
function Months(props) {
|
|
16026
|
-
return
|
|
16050
|
+
return React76__namespace.default.createElement("div", { ...props });
|
|
16027
16051
|
}
|
|
16028
|
-
var dayPickerContext =
|
|
16052
|
+
var dayPickerContext = React76.createContext(void 0);
|
|
16029
16053
|
function useDayPicker() {
|
|
16030
|
-
const context =
|
|
16054
|
+
const context = React76.useContext(dayPickerContext);
|
|
16031
16055
|
if (context === void 0) {
|
|
16032
16056
|
throw new Error("useDayPicker() must be used within a custom component.");
|
|
16033
16057
|
}
|
|
@@ -16037,81 +16061,81 @@ function useDayPicker() {
|
|
|
16037
16061
|
// ../../node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js
|
|
16038
16062
|
function MonthsDropdown(props) {
|
|
16039
16063
|
const { components } = useDayPicker();
|
|
16040
|
-
return
|
|
16064
|
+
return React76__namespace.default.createElement(components.Dropdown, { ...props });
|
|
16041
16065
|
}
|
|
16042
16066
|
function Nav(props) {
|
|
16043
16067
|
const { onPreviousClick, onNextClick, previousMonth, nextMonth, ...navProps } = props;
|
|
16044
16068
|
const { components, classNames, labels: { labelPrevious: labelPrevious2, labelNext: labelNext2 } } = useDayPicker();
|
|
16045
|
-
const handleNextClick =
|
|
16069
|
+
const handleNextClick = React76.useCallback((e4) => {
|
|
16046
16070
|
if (nextMonth) {
|
|
16047
16071
|
onNextClick == null ? void 0 : onNextClick(e4);
|
|
16048
16072
|
}
|
|
16049
16073
|
}, [nextMonth, onNextClick]);
|
|
16050
|
-
const handlePreviousClick =
|
|
16074
|
+
const handlePreviousClick = React76.useCallback((e4) => {
|
|
16051
16075
|
if (previousMonth) {
|
|
16052
16076
|
onPreviousClick == null ? void 0 : onPreviousClick(e4);
|
|
16053
16077
|
}
|
|
16054
16078
|
}, [previousMonth, onPreviousClick]);
|
|
16055
|
-
return
|
|
16079
|
+
return React76__namespace.default.createElement(
|
|
16056
16080
|
"nav",
|
|
16057
16081
|
{ ...navProps },
|
|
16058
|
-
|
|
16082
|
+
React76__namespace.default.createElement(
|
|
16059
16083
|
components.PreviousMonthButton,
|
|
16060
16084
|
{ type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? void 0 : -1, "aria-disabled": previousMonth ? void 0 : true, "aria-label": labelPrevious2(previousMonth), onClick: handlePreviousClick },
|
|
16061
|
-
|
|
16085
|
+
React76__namespace.default.createElement(components.Chevron, { disabled: previousMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: "left" })
|
|
16062
16086
|
),
|
|
16063
|
-
|
|
16087
|
+
React76__namespace.default.createElement(
|
|
16064
16088
|
components.NextMonthButton,
|
|
16065
16089
|
{ type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick },
|
|
16066
|
-
|
|
16090
|
+
React76__namespace.default.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, orientation: "right", className: classNames[UI.Chevron] })
|
|
16067
16091
|
)
|
|
16068
16092
|
);
|
|
16069
16093
|
}
|
|
16070
16094
|
function NextMonthButton(props) {
|
|
16071
16095
|
const { components } = useDayPicker();
|
|
16072
|
-
return
|
|
16096
|
+
return React76__namespace.default.createElement(components.Button, { ...props });
|
|
16073
16097
|
}
|
|
16074
16098
|
function Option(props) {
|
|
16075
|
-
return
|
|
16099
|
+
return React76__namespace.default.createElement("option", { ...props });
|
|
16076
16100
|
}
|
|
16077
16101
|
function PreviousMonthButton(props) {
|
|
16078
16102
|
const { components } = useDayPicker();
|
|
16079
|
-
return
|
|
16103
|
+
return React76__namespace.default.createElement(components.Button, { ...props });
|
|
16080
16104
|
}
|
|
16081
16105
|
function Root4(props) {
|
|
16082
16106
|
const { rootRef, ...rest } = props;
|
|
16083
|
-
return
|
|
16107
|
+
return React76__namespace.default.createElement("div", { ...rest, ref: rootRef });
|
|
16084
16108
|
}
|
|
16085
16109
|
function Select2(props) {
|
|
16086
|
-
return
|
|
16110
|
+
return React76__namespace.default.createElement("select", { ...props });
|
|
16087
16111
|
}
|
|
16088
16112
|
function Week(props) {
|
|
16089
16113
|
const { week, ...trProps } = props;
|
|
16090
|
-
return
|
|
16114
|
+
return React76__namespace.default.createElement("tr", { ...trProps });
|
|
16091
16115
|
}
|
|
16092
16116
|
function Weekday(props) {
|
|
16093
|
-
return
|
|
16117
|
+
return React76__namespace.default.createElement("th", { ...props });
|
|
16094
16118
|
}
|
|
16095
16119
|
function Weekdays(props) {
|
|
16096
|
-
return
|
|
16120
|
+
return React76__namespace.default.createElement(
|
|
16097
16121
|
"thead",
|
|
16098
16122
|
{ "aria-hidden": true },
|
|
16099
|
-
|
|
16123
|
+
React76__namespace.default.createElement("tr", { ...props })
|
|
16100
16124
|
);
|
|
16101
16125
|
}
|
|
16102
16126
|
function WeekNumber(props) {
|
|
16103
16127
|
const { week, ...thProps } = props;
|
|
16104
|
-
return
|
|
16128
|
+
return React76__namespace.default.createElement("th", { ...thProps });
|
|
16105
16129
|
}
|
|
16106
16130
|
function WeekNumberHeader(props) {
|
|
16107
|
-
return
|
|
16131
|
+
return React76__namespace.default.createElement("th", { ...props });
|
|
16108
16132
|
}
|
|
16109
16133
|
function Weeks(props) {
|
|
16110
|
-
return
|
|
16134
|
+
return React76__namespace.default.createElement("tbody", { ...props });
|
|
16111
16135
|
}
|
|
16112
16136
|
function YearsDropdown(props) {
|
|
16113
16137
|
const { components } = useDayPicker();
|
|
16114
|
-
return
|
|
16138
|
+
return React76__namespace.default.createElement(components.Dropdown, { ...props });
|
|
16115
16139
|
}
|
|
16116
16140
|
|
|
16117
16141
|
// ../../node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js
|
|
@@ -16594,10 +16618,10 @@ var queryWeeksEl = (element) => asHtmlElement(element.querySelector("[data-anima
|
|
|
16594
16618
|
var queryNavEl = (element) => asHtmlElement(element.querySelector("[data-animated-nav]"));
|
|
16595
16619
|
var queryWeekdaysEl = (element) => asHtmlElement(element.querySelector("[data-animated-weekdays]"));
|
|
16596
16620
|
function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib }) {
|
|
16597
|
-
const previousRootElSnapshotRef =
|
|
16598
|
-
const previousMonthsRef =
|
|
16599
|
-
const animatingRef =
|
|
16600
|
-
|
|
16621
|
+
const previousRootElSnapshotRef = React76.useRef(null);
|
|
16622
|
+
const previousMonthsRef = React76.useRef(months);
|
|
16623
|
+
const animatingRef = React76.useRef(false);
|
|
16624
|
+
React76.useLayoutEffect(() => {
|
|
16601
16625
|
const previousMonths = previousMonthsRef.current;
|
|
16602
16626
|
previousMonthsRef.current = months;
|
|
16603
16627
|
if (!enabled || !rootElRef.current || // safety check because the ref can be set to anything by consumers
|
|
@@ -16897,7 +16921,7 @@ function getWeeks(months) {
|
|
|
16897
16921
|
}, initialWeeks.slice());
|
|
16898
16922
|
}
|
|
16899
16923
|
function useControlledValue(defaultValue, controlledValue) {
|
|
16900
|
-
const [uncontrolledValue, setValue] =
|
|
16924
|
+
const [uncontrolledValue, setValue] = React76.useState(defaultValue);
|
|
16901
16925
|
const value = controlledValue === void 0 ? uncontrolledValue : controlledValue;
|
|
16902
16926
|
return [value, setValue];
|
|
16903
16927
|
}
|
|
@@ -16913,11 +16937,11 @@ function useCalendar(props, dateLib) {
|
|
|
16913
16937
|
// initialMonth is always computed from props.month if provided
|
|
16914
16938
|
props.month ? initialMonth : void 0
|
|
16915
16939
|
);
|
|
16916
|
-
|
|
16940
|
+
React76.useEffect(() => {
|
|
16917
16941
|
const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
|
|
16918
16942
|
setFirstMonth(newInitialMonth);
|
|
16919
16943
|
}, [props.timeZone]);
|
|
16920
|
-
const { months, weeks, days, previousMonth, nextMonth } =
|
|
16944
|
+
const { months, weeks, days, previousMonth, nextMonth } = React76.useMemo(() => {
|
|
16921
16945
|
const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
|
|
16922
16946
|
const dates = getDates(displayMonths, props.endMonth ? endOfMonth2(props.endMonth) : void 0, {
|
|
16923
16947
|
ISOWeek: props.ISOWeek,
|
|
@@ -17069,9 +17093,9 @@ function getNextFocus(moveBy, moveDir, refDay, calendarStartMonth, calendarEndMo
|
|
|
17069
17093
|
// ../../node_modules/react-day-picker/dist/esm/useFocus.js
|
|
17070
17094
|
function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
17071
17095
|
const { autoFocus } = props;
|
|
17072
|
-
const [lastFocused, setLastFocused] =
|
|
17096
|
+
const [lastFocused, setLastFocused] = React76.useState();
|
|
17073
17097
|
const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected || (() => false), lastFocused);
|
|
17074
|
-
const [focusedDay, setFocused] =
|
|
17098
|
+
const [focusedDay, setFocused] = React76.useState(autoFocus ? focusTarget : void 0);
|
|
17075
17099
|
const blur = () => {
|
|
17076
17100
|
setLastFocused(focusedDay);
|
|
17077
17101
|
setFocused(void 0);
|
|
@@ -17452,7 +17476,7 @@ function DayPicker(initialProps) {
|
|
|
17452
17476
|
props.modifiers = nextModifiers;
|
|
17453
17477
|
}
|
|
17454
17478
|
}
|
|
17455
|
-
const { components, formatters: formatters2, labels, dateLib, locale, classNames } =
|
|
17479
|
+
const { components, formatters: formatters2, labels, dateLib, locale, classNames } = React76.useMemo(() => {
|
|
17456
17480
|
const locale2 = { ...enUS2, ...props.locale };
|
|
17457
17481
|
const dateLib2 = new DateLib({
|
|
17458
17482
|
locale: locale2,
|
|
@@ -17497,21 +17521,21 @@ function DayPicker(initialProps) {
|
|
|
17497
17521
|
const { isSelected, select, selected: selectedValue } = (_b = useSelection(props, dateLib)) != null ? _b : {};
|
|
17498
17522
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected != null ? isSelected : (() => false), dateLib);
|
|
17499
17523
|
const { labelDayButton: labelDayButton2, labelGridcell: labelGridcell2, labelGrid: labelGrid2, labelMonthDropdown: labelMonthDropdown2, labelNav: labelNav2, labelPrevious: labelPrevious2, labelNext: labelNext2, labelWeekday: labelWeekday2, labelWeekNumber: labelWeekNumber2, labelWeekNumberHeader: labelWeekNumberHeader2, labelYearDropdown: labelYearDropdown2 } = labels;
|
|
17500
|
-
const weekdays =
|
|
17524
|
+
const weekdays = React76.useMemo(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
|
|
17501
17525
|
const isInteractive = mode !== void 0 || onDayClick !== void 0;
|
|
17502
|
-
const handlePreviousClick =
|
|
17526
|
+
const handlePreviousClick = React76.useCallback(() => {
|
|
17503
17527
|
if (!previousMonth)
|
|
17504
17528
|
return;
|
|
17505
17529
|
goToMonth(previousMonth);
|
|
17506
17530
|
onPrevClick == null ? void 0 : onPrevClick(previousMonth);
|
|
17507
17531
|
}, [previousMonth, goToMonth, onPrevClick]);
|
|
17508
|
-
const handleNextClick =
|
|
17532
|
+
const handleNextClick = React76.useCallback(() => {
|
|
17509
17533
|
if (!nextMonth)
|
|
17510
17534
|
return;
|
|
17511
17535
|
goToMonth(nextMonth);
|
|
17512
17536
|
onNextClick == null ? void 0 : onNextClick(nextMonth);
|
|
17513
17537
|
}, [goToMonth, nextMonth, onNextClick]);
|
|
17514
|
-
const handleDayClick =
|
|
17538
|
+
const handleDayClick = React76.useCallback((day, m2) => (e4) => {
|
|
17515
17539
|
e4.preventDefault();
|
|
17516
17540
|
e4.stopPropagation();
|
|
17517
17541
|
setFocused(day);
|
|
@@ -17521,15 +17545,15 @@ function DayPicker(initialProps) {
|
|
|
17521
17545
|
select == null ? void 0 : select(day.date, m2, e4);
|
|
17522
17546
|
onDayClick == null ? void 0 : onDayClick(day.date, m2, e4);
|
|
17523
17547
|
}, [select, onDayClick, setFocused]);
|
|
17524
|
-
const handleDayFocus =
|
|
17548
|
+
const handleDayFocus = React76.useCallback((day, m2) => (e4) => {
|
|
17525
17549
|
setFocused(day);
|
|
17526
17550
|
onDayFocus == null ? void 0 : onDayFocus(day.date, m2, e4);
|
|
17527
17551
|
}, [onDayFocus, setFocused]);
|
|
17528
|
-
const handleDayBlur =
|
|
17552
|
+
const handleDayBlur = React76.useCallback((day, m2) => (e4) => {
|
|
17529
17553
|
blur();
|
|
17530
17554
|
onDayBlur == null ? void 0 : onDayBlur(day.date, m2, e4);
|
|
17531
17555
|
}, [blur, onDayBlur]);
|
|
17532
|
-
const handleDayKeyDown =
|
|
17556
|
+
const handleDayKeyDown = React76.useCallback((day, modifiers) => (e4) => {
|
|
17533
17557
|
const keyMap = {
|
|
17534
17558
|
ArrowLeft: [
|
|
17535
17559
|
e4.shiftKey ? "month" : "day",
|
|
@@ -17554,28 +17578,28 @@ function DayPicker(initialProps) {
|
|
|
17554
17578
|
}
|
|
17555
17579
|
onDayKeyDown == null ? void 0 : onDayKeyDown(day.date, modifiers, e4);
|
|
17556
17580
|
}, [moveFocus, onDayKeyDown, props.dir]);
|
|
17557
|
-
const handleDayMouseEnter =
|
|
17581
|
+
const handleDayMouseEnter = React76.useCallback((day, modifiers) => (e4) => {
|
|
17558
17582
|
onDayMouseEnter == null ? void 0 : onDayMouseEnter(day.date, modifiers, e4);
|
|
17559
17583
|
}, [onDayMouseEnter]);
|
|
17560
|
-
const handleDayMouseLeave =
|
|
17584
|
+
const handleDayMouseLeave = React76.useCallback((day, modifiers) => (e4) => {
|
|
17561
17585
|
onDayMouseLeave == null ? void 0 : onDayMouseLeave(day.date, modifiers, e4);
|
|
17562
17586
|
}, [onDayMouseLeave]);
|
|
17563
|
-
const handleMonthChange =
|
|
17587
|
+
const handleMonthChange = React76.useCallback((date) => (e4) => {
|
|
17564
17588
|
const selectedMonth = Number(e4.target.value);
|
|
17565
17589
|
const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);
|
|
17566
17590
|
goToMonth(month);
|
|
17567
17591
|
}, [dateLib, goToMonth]);
|
|
17568
|
-
const handleYearChange =
|
|
17592
|
+
const handleYearChange = React76.useCallback((date) => (e4) => {
|
|
17569
17593
|
const selectedYear = Number(e4.target.value);
|
|
17570
17594
|
const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);
|
|
17571
17595
|
goToMonth(month);
|
|
17572
17596
|
}, [dateLib, goToMonth]);
|
|
17573
|
-
const { className, style } =
|
|
17597
|
+
const { className, style } = React76.useMemo(() => ({
|
|
17574
17598
|
className: [classNames[UI.Root], props.className].filter(Boolean).join(" "),
|
|
17575
17599
|
style: { ...styles == null ? void 0 : styles[UI.Root], ...props.style }
|
|
17576
17600
|
}), [classNames, props.className, props.style, styles]);
|
|
17577
17601
|
const dataAttributes = getDataAttributes(props);
|
|
17578
|
-
const rootElRef =
|
|
17602
|
+
const rootElRef = React76.useRef(null);
|
|
17579
17603
|
useAnimation(rootElRef, Boolean(props.animate), {
|
|
17580
17604
|
classNames,
|
|
17581
17605
|
months,
|
|
@@ -17598,18 +17622,18 @@ function DayPicker(initialProps) {
|
|
|
17598
17622
|
labels,
|
|
17599
17623
|
formatters: formatters2
|
|
17600
17624
|
};
|
|
17601
|
-
return
|
|
17625
|
+
return React76__namespace.default.createElement(
|
|
17602
17626
|
dayPickerContext.Provider,
|
|
17603
17627
|
{ value: contextValue },
|
|
17604
|
-
|
|
17628
|
+
React76__namespace.default.createElement(
|
|
17605
17629
|
components.Root,
|
|
17606
17630
|
{ rootRef: props.animate ? rootElRef : void 0, className, style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"], ...dataAttributes },
|
|
17607
|
-
|
|
17631
|
+
React76__namespace.default.createElement(
|
|
17608
17632
|
components.Months,
|
|
17609
17633
|
{ className: classNames[UI.Months], style: styles == null ? void 0 : styles[UI.Months] },
|
|
17610
|
-
!props.hideNavigation && !navLayout &&
|
|
17634
|
+
!props.hideNavigation && !navLayout && React76__namespace.default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles == null ? void 0 : styles[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
|
|
17611
17635
|
months.map((calendarMonth, displayIndex) => {
|
|
17612
|
-
return
|
|
17636
|
+
return React76__namespace.default.createElement(
|
|
17613
17637
|
components.Month,
|
|
17614
17638
|
{
|
|
17615
17639
|
"data-animated-month": props.animate ? "true" : void 0,
|
|
@@ -17620,21 +17644,21 @@ function DayPicker(initialProps) {
|
|
|
17620
17644
|
displayIndex,
|
|
17621
17645
|
calendarMonth
|
|
17622
17646
|
},
|
|
17623
|
-
navLayout === "around" && !props.hideNavigation && displayIndex === 0 &&
|
|
17647
|
+
navLayout === "around" && !props.hideNavigation && displayIndex === 0 && React76__namespace.default.createElement(
|
|
17624
17648
|
components.PreviousMonthButton,
|
|
17625
17649
|
{ type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? void 0 : -1, "aria-disabled": previousMonth ? void 0 : true, "aria-label": labelPrevious2(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : void 0 },
|
|
17626
|
-
|
|
17650
|
+
React76__namespace.default.createElement(components.Chevron, { disabled: previousMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" })
|
|
17627
17651
|
),
|
|
17628
|
-
|
|
17652
|
+
React76__namespace.default.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : void 0, className: classNames[UI.MonthCaption], style: styles == null ? void 0 : styles[UI.MonthCaption], calendarMonth, displayIndex }, (captionLayout == null ? void 0 : captionLayout.startsWith("dropdown")) ? React76__namespace.default.createElement(
|
|
17629
17653
|
components.DropdownNav,
|
|
17630
17654
|
{ className: classNames[UI.Dropdowns], style: styles == null ? void 0 : styles[UI.Dropdowns] },
|
|
17631
17655
|
(() => {
|
|
17632
|
-
const monthControl = captionLayout === "dropdown" || captionLayout === "dropdown-months" ?
|
|
17633
|
-
const yearControl = captionLayout === "dropdown" || captionLayout === "dropdown-years" ?
|
|
17656
|
+
const monthControl = captionLayout === "dropdown" || captionLayout === "dropdown-months" ? React76__namespace.default.createElement(components.MonthsDropdown, { key: "month", className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown2(), classNames, components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters2, dateLib), style: styles == null ? void 0 : styles[UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) }) : React76__namespace.default.createElement("span", { key: "month" }, formatMonthDropdown2(calendarMonth.date, dateLib));
|
|
17657
|
+
const yearControl = captionLayout === "dropdown" || captionLayout === "dropdown-years" ? React76__namespace.default.createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown2(dateLib.options), classNames, components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters2, dateLib, Boolean(props.reverseYears)), style: styles == null ? void 0 : styles[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) }) : React76__namespace.default.createElement("span", { key: "year" }, formatYearDropdown2(calendarMonth.date, dateLib));
|
|
17634
17658
|
const controls = dateLib.getMonthYearOrder() === "year-first" ? [yearControl, monthControl] : [monthControl, yearControl];
|
|
17635
17659
|
return controls;
|
|
17636
17660
|
})(),
|
|
17637
|
-
|
|
17661
|
+
React76__namespace.default.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
17638
17662
|
border: 0,
|
|
17639
17663
|
clip: "rect(0 0 0 0)",
|
|
17640
17664
|
height: "1px",
|
|
@@ -17646,27 +17670,27 @@ function DayPicker(initialProps) {
|
|
|
17646
17670
|
whiteSpace: "nowrap",
|
|
17647
17671
|
wordWrap: "normal"
|
|
17648
17672
|
} }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))
|
|
17649
|
-
) :
|
|
17650
|
-
navLayout === "around" && !props.hideNavigation && displayIndex === numberOfMonths - 1 &&
|
|
17673
|
+
) : React76__namespace.default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))),
|
|
17674
|
+
navLayout === "around" && !props.hideNavigation && displayIndex === numberOfMonths - 1 && React76__namespace.default.createElement(
|
|
17651
17675
|
components.NextMonthButton,
|
|
17652
17676
|
{ type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : void 0 },
|
|
17653
|
-
|
|
17677
|
+
React76__namespace.default.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "left" : "right" })
|
|
17654
17678
|
),
|
|
17655
|
-
displayIndex === numberOfMonths - 1 && navLayout === "after" && !props.hideNavigation &&
|
|
17656
|
-
|
|
17679
|
+
displayIndex === numberOfMonths - 1 && navLayout === "after" && !props.hideNavigation && React76__namespace.default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles == null ? void 0 : styles[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
|
|
17680
|
+
React76__namespace.default.createElement(
|
|
17657
17681
|
components.MonthGrid,
|
|
17658
17682
|
{ role: "grid", "aria-multiselectable": mode === "multiple" || mode === "range", "aria-label": labelGrid2(calendarMonth.date, dateLib.options, dateLib) || void 0, className: classNames[UI.MonthGrid], style: styles == null ? void 0 : styles[UI.MonthGrid] },
|
|
17659
|
-
!props.hideWeekdays &&
|
|
17683
|
+
!props.hideWeekdays && React76__namespace.default.createElement(
|
|
17660
17684
|
components.Weekdays,
|
|
17661
17685
|
{ "data-animated-weekdays": props.animate ? "true" : void 0, className: classNames[UI.Weekdays], style: styles == null ? void 0 : styles[UI.Weekdays] },
|
|
17662
|
-
showWeekNumber &&
|
|
17663
|
-
weekdays.map((weekday) =>
|
|
17686
|
+
showWeekNumber && React76__namespace.default.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader2(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles == null ? void 0 : styles[UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader2()),
|
|
17687
|
+
weekdays.map((weekday) => React76__namespace.default.createElement(components.Weekday, { "aria-label": labelWeekday2(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles == null ? void 0 : styles[UI.Weekday], scope: "col" }, formatWeekdayName2(weekday, dateLib.options, dateLib)))
|
|
17664
17688
|
),
|
|
17665
|
-
|
|
17666
|
-
return
|
|
17689
|
+
React76__namespace.default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : void 0, className: classNames[UI.Weeks], style: styles == null ? void 0 : styles[UI.Weeks] }, calendarMonth.weeks.map((week) => {
|
|
17690
|
+
return React76__namespace.default.createElement(
|
|
17667
17691
|
components.Week,
|
|
17668
17692
|
{ className: classNames[UI.Week], key: week.weekNumber, style: styles == null ? void 0 : styles[UI.Week], week },
|
|
17669
|
-
showWeekNumber &&
|
|
17693
|
+
showWeekNumber && React76__namespace.default.createElement(components.WeekNumber, { week, style: styles == null ? void 0 : styles[UI.WeekNumber], "aria-label": labelWeekNumber2(week.weekNumber, {
|
|
17670
17694
|
locale
|
|
17671
17695
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber2(week.weekNumber, dateLib)),
|
|
17672
17696
|
week.days.map((day) => {
|
|
@@ -17683,7 +17707,7 @@ function DayPicker(initialProps) {
|
|
|
17683
17707
|
const style2 = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
|
|
17684
17708
|
const className2 = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
|
|
17685
17709
|
const ariaLabel = !isInteractive && !modifiers.hidden ? labelGridcell2(date, modifiers, dateLib.options, dateLib) : void 0;
|
|
17686
|
-
return
|
|
17710
|
+
return React76__namespace.default.createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day, modifiers, className: className2.join(" "), style: style2, role: "gridcell", "aria-selected": modifiers.selected || void 0, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : void 0, "data-selected": modifiers.selected || void 0, "data-disabled": modifiers.disabled || void 0, "data-hidden": modifiers.hidden || void 0, "data-outside": day.outside || void 0, "data-focused": modifiers.focused || void 0, "data-today": modifiers.today || void 0 }, !modifiers.hidden && isInteractive ? React76__namespace.default.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles == null ? void 0 : styles[UI.DayButton], type: "button", day, modifiers, disabled: !modifiers.focused && modifiers.disabled || void 0, "aria-disabled": modifiers.focused && modifiers.disabled || void 0, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton2(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay2(date, dateLib.options, dateLib)) : !modifiers.hidden && formatDay2(day.date, dateLib.options, dateLib));
|
|
17687
17711
|
})
|
|
17688
17712
|
);
|
|
17689
17713
|
}))
|
|
@@ -17691,7 +17715,7 @@ function DayPicker(initialProps) {
|
|
|
17691
17715
|
);
|
|
17692
17716
|
})
|
|
17693
17717
|
),
|
|
17694
|
-
props.footer &&
|
|
17718
|
+
props.footer && React76__namespace.default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles == null ? void 0 : styles[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)
|
|
17695
17719
|
)
|
|
17696
17720
|
);
|
|
17697
17721
|
}
|
|
@@ -17934,8 +17958,8 @@ function CalendarDayButton({
|
|
|
17934
17958
|
...props
|
|
17935
17959
|
}) {
|
|
17936
17960
|
const defaultClassNames = getDefaultClassNames();
|
|
17937
|
-
const ref =
|
|
17938
|
-
|
|
17961
|
+
const ref = React76__namespace.useRef(null);
|
|
17962
|
+
React76__namespace.useEffect(() => {
|
|
17939
17963
|
var _a;
|
|
17940
17964
|
if (modifiers.focused) (_a = ref.current) == null ? void 0 : _a.focus();
|
|
17941
17965
|
}, [modifiers.focused]);
|
|
@@ -18012,15 +18036,15 @@ var TimeDropdowns = (props) => {
|
|
|
18012
18036
|
triggerClassName,
|
|
18013
18037
|
density = "normal"
|
|
18014
18038
|
} = props;
|
|
18015
|
-
const minuteOptions =
|
|
18039
|
+
const minuteOptions = React76__namespace.useMemo(
|
|
18016
18040
|
() => buildMinuteOptions(minuteStep),
|
|
18017
18041
|
[minuteStep]
|
|
18018
18042
|
);
|
|
18019
|
-
const secondOptions =
|
|
18043
|
+
const secondOptions = React76__namespace.useMemo(
|
|
18020
18044
|
() => buildSecondOptions(secondStep),
|
|
18021
18045
|
[secondStep]
|
|
18022
18046
|
);
|
|
18023
|
-
const hourOptions =
|
|
18047
|
+
const hourOptions = React76__namespace.useMemo(
|
|
18024
18048
|
() => use12Hour ? buildHourOptions12() : buildHourOptions24(),
|
|
18025
18049
|
[use12Hour]
|
|
18026
18050
|
);
|
|
@@ -18359,7 +18383,7 @@ function parseRawToDate(rawDigits, kind) {
|
|
|
18359
18383
|
function meterSafeDigits(masked) {
|
|
18360
18384
|
return masked.replace(/\D+/g, "");
|
|
18361
18385
|
}
|
|
18362
|
-
var ShadcnDateVariant =
|
|
18386
|
+
var ShadcnDateVariant = React76__namespace.forwardRef(function ShadcnDateVariant2(props, ref) {
|
|
18363
18387
|
const {
|
|
18364
18388
|
// variant base bits
|
|
18365
18389
|
value,
|
|
@@ -18392,10 +18416,10 @@ var ShadcnDateVariant = React74__namespace.forwardRef(function ShadcnDateVariant
|
|
|
18392
18416
|
const resolvedMask = inputMask != null ? inputMask : kindConfig.mask;
|
|
18393
18417
|
const defaultShowCalendar = kind === "date" || kind === "datetime";
|
|
18394
18418
|
const showCalendar = typeof showCalendarProp === "boolean" ? showCalendarProp : defaultShowCalendar;
|
|
18395
|
-
const [internalOpen, setInternalOpen] =
|
|
18419
|
+
const [internalOpen, setInternalOpen] = React76__namespace.useState(false);
|
|
18396
18420
|
const isControlledOpen = open !== void 0;
|
|
18397
18421
|
const currentOpen = isControlledOpen ? !!open : internalOpen;
|
|
18398
|
-
const handleOpenChange =
|
|
18422
|
+
const handleOpenChange = React76__namespace.useCallback(
|
|
18399
18423
|
(next) => {
|
|
18400
18424
|
if (!isControlledOpen) {
|
|
18401
18425
|
setInternalOpen(next);
|
|
@@ -18405,7 +18429,7 @@ var ShadcnDateVariant = React74__namespace.forwardRef(function ShadcnDateVariant
|
|
|
18405
18429
|
[isControlledOpen, onOpenChange]
|
|
18406
18430
|
);
|
|
18407
18431
|
const { single, range } = normalizeValueForMode(value, mode);
|
|
18408
|
-
const displayValue =
|
|
18432
|
+
const displayValue = React76__namespace.useMemo(() => {
|
|
18409
18433
|
if (mode === "single") {
|
|
18410
18434
|
return formatDisplaySingle(single, singlePattern);
|
|
18411
18435
|
}
|
|
@@ -18416,12 +18440,12 @@ var ShadcnDateVariant = React74__namespace.forwardRef(function ShadcnDateVariant
|
|
|
18416
18440
|
rangeSeparator
|
|
18417
18441
|
);
|
|
18418
18442
|
}, [mode, single, range, singlePattern, formatRange, rangeSeparator]);
|
|
18419
|
-
const [localText, setLocalText] =
|
|
18420
|
-
|
|
18443
|
+
const [localText, setLocalText] = React76__namespace.useState(displayValue);
|
|
18444
|
+
React76__namespace.useEffect(() => {
|
|
18421
18445
|
setLocalText(displayValue);
|
|
18422
18446
|
}, [displayValue]);
|
|
18423
18447
|
const showTimeDropdowns = mode === "single" && (kind === "datetime" || kind === "time" || kind === "hour");
|
|
18424
|
-
const handleSelect =
|
|
18448
|
+
const handleSelect = React76__namespace.useCallback(
|
|
18425
18449
|
(next) => {
|
|
18426
18450
|
let nextValue;
|
|
18427
18451
|
let nextRange;
|
|
@@ -18471,7 +18495,7 @@ var ShadcnDateVariant = React74__namespace.forwardRef(function ShadcnDateVariant
|
|
|
18471
18495
|
},
|
|
18472
18496
|
[mode, stayOpenOnSelect, onValue, handleOpenChange, kind, single]
|
|
18473
18497
|
);
|
|
18474
|
-
const handleTimeChange =
|
|
18498
|
+
const handleTimeChange = React76__namespace.useCallback(
|
|
18475
18499
|
(next) => {
|
|
18476
18500
|
if (!next) {
|
|
18477
18501
|
const detail2 = {
|
|
@@ -18502,7 +18526,7 @@ var ShadcnDateVariant = React74__namespace.forwardRef(function ShadcnDateVariant
|
|
|
18502
18526
|
},
|
|
18503
18527
|
[mode, kind, onValue]
|
|
18504
18528
|
);
|
|
18505
|
-
const handleClear =
|
|
18529
|
+
const handleClear = React76__namespace.useCallback(
|
|
18506
18530
|
(ev) => {
|
|
18507
18531
|
ev.preventDefault();
|
|
18508
18532
|
ev.stopPropagation();
|
|
@@ -18521,7 +18545,7 @@ var ShadcnDateVariant = React74__namespace.forwardRef(function ShadcnDateVariant
|
|
|
18521
18545
|
);
|
|
18522
18546
|
const hasValue = hasSelection(value);
|
|
18523
18547
|
const placeholderText = typeof placeholder === "string" ? placeholder : mode === "range" ? "Select date range" : "Select date";
|
|
18524
|
-
const handleInputChange =
|
|
18548
|
+
const handleInputChange = React76__namespace.useCallback(
|
|
18525
18549
|
(event) => {
|
|
18526
18550
|
var _a, _b, _c;
|
|
18527
18551
|
if (mode !== "single") return;
|
|
@@ -18708,7 +18732,7 @@ function resolveBasePadding2(size, density) {
|
|
|
18708
18732
|
}
|
|
18709
18733
|
return { px, py };
|
|
18710
18734
|
}
|
|
18711
|
-
var Textarea =
|
|
18735
|
+
var Textarea = React76__namespace.forwardRef(
|
|
18712
18736
|
function Textarea2(rawProps, forwardedRef) {
|
|
18713
18737
|
const {
|
|
18714
18738
|
// layout wrapper
|
|
@@ -18756,8 +18780,8 @@ var Textarea = React74__namespace.forwardRef(
|
|
|
18756
18780
|
} = rawProps;
|
|
18757
18781
|
const sizeKey = size != null ? size : "md";
|
|
18758
18782
|
const densityKey = density != null ? density : "normal";
|
|
18759
|
-
const innerRef =
|
|
18760
|
-
|
|
18783
|
+
const innerRef = React76__namespace.useRef(null);
|
|
18784
|
+
React76__namespace.useImperativeHandle(
|
|
18761
18785
|
forwardedRef,
|
|
18762
18786
|
() => innerRef.current,
|
|
18763
18787
|
[]
|
|
@@ -18778,11 +18802,11 @@ var Textarea = React74__namespace.forwardRef(
|
|
|
18778
18802
|
const baseIconGap = iconGap != null ? iconGap : 1;
|
|
18779
18803
|
const leadingGap = leadingIconSpacing != null ? leadingIconSpacing : baseIconGap;
|
|
18780
18804
|
const trailingGap = trailingIconSpacing != null ? trailingIconSpacing : baseIconGap;
|
|
18781
|
-
const leadingIconsRef =
|
|
18782
|
-
const trailingIconsRef =
|
|
18783
|
-
const [leadingIconsWidth, setLeadingIconsWidth] =
|
|
18784
|
-
const [trailingIconsWidth, setTrailingIconsWidth] =
|
|
18785
|
-
const measureIconWidths =
|
|
18805
|
+
const leadingIconsRef = React76__namespace.useRef(null);
|
|
18806
|
+
const trailingIconsRef = React76__namespace.useRef(null);
|
|
18807
|
+
const [leadingIconsWidth, setLeadingIconsWidth] = React76__namespace.useState(0);
|
|
18808
|
+
const [trailingIconsWidth, setTrailingIconsWidth] = React76__namespace.useState(0);
|
|
18809
|
+
const measureIconWidths = React76__namespace.useCallback(() => {
|
|
18786
18810
|
if (typeof window === "undefined") return;
|
|
18787
18811
|
const lead = leadingIconsRef.current;
|
|
18788
18812
|
const trail = trailingIconsRef.current;
|
|
@@ -18799,7 +18823,7 @@ var Textarea = React74__namespace.forwardRef(
|
|
|
18799
18823
|
setTrailingIconsWidth(0);
|
|
18800
18824
|
}
|
|
18801
18825
|
}, []);
|
|
18802
|
-
|
|
18826
|
+
React76__namespace.useLayoutEffect(() => {
|
|
18803
18827
|
if (typeof window === "undefined" || typeof MutationObserver === "undefined") {
|
|
18804
18828
|
measureIconWidths();
|
|
18805
18829
|
return;
|
|
@@ -18828,10 +18852,10 @@ var Textarea = React74__namespace.forwardRef(
|
|
|
18828
18852
|
measureIconWidths();
|
|
18829
18853
|
return () => observers.forEach((o3) => o3.disconnect());
|
|
18830
18854
|
}, [measureIconWidths, hasLeadingIcons, hasTrailingIcons]);
|
|
18831
|
-
const [rowHeight, setRowHeight] =
|
|
18855
|
+
const [rowHeight, setRowHeight] = React76__namespace.useState(null);
|
|
18832
18856
|
const baseMinRows = Math.max(minRowsProp != null ? minRowsProp : 1, 1);
|
|
18833
|
-
const [rows, setRows] =
|
|
18834
|
-
|
|
18857
|
+
const [rows, setRows] = React76__namespace.useState(baseMinRows);
|
|
18858
|
+
React76__namespace.useLayoutEffect(() => {
|
|
18835
18859
|
if (typeof window === "undefined") return;
|
|
18836
18860
|
const el = innerRef.current;
|
|
18837
18861
|
if (!el) return;
|
|
@@ -18847,7 +18871,7 @@ var Textarea = React74__namespace.forwardRef(
|
|
|
18847
18871
|
setRows(baseMinRows);
|
|
18848
18872
|
}
|
|
18849
18873
|
}, [sizeKey, densityKey, baseMinRows]);
|
|
18850
|
-
const recomputeHeight =
|
|
18874
|
+
const recomputeHeight = React76__namespace.useCallback(() => {
|
|
18851
18875
|
if (!autoResize) return;
|
|
18852
18876
|
if (!innerRef.current) return;
|
|
18853
18877
|
if (!rowHeight) return;
|
|
@@ -18869,7 +18893,7 @@ var Textarea = React74__namespace.forwardRef(
|
|
|
18869
18893
|
el.style.height = `${nextHeight}px`;
|
|
18870
18894
|
setRows(nextRows);
|
|
18871
18895
|
}, [autoResize, rowHeight, baseMinRows, maxRows]);
|
|
18872
|
-
|
|
18896
|
+
React76__namespace.useLayoutEffect(() => {
|
|
18873
18897
|
recomputeHeight();
|
|
18874
18898
|
}, [recomputeHeight, rest.value, rest.defaultValue]);
|
|
18875
18899
|
const { px: pxDefault, py: pyDefault } = resolveBasePadding2(size, density);
|
|
@@ -18939,19 +18963,19 @@ var Textarea = React74__namespace.forwardRef(
|
|
|
18939
18963
|
const focusTextarea = () => {
|
|
18940
18964
|
if (innerRef.current) innerRef.current.focus();
|
|
18941
18965
|
};
|
|
18942
|
-
const handleFocus =
|
|
18966
|
+
const handleFocus = React76__namespace.useCallback(
|
|
18943
18967
|
(event) => {
|
|
18944
18968
|
onFocus == null ? void 0 : onFocus(event);
|
|
18945
18969
|
},
|
|
18946
18970
|
[onFocus]
|
|
18947
18971
|
);
|
|
18948
|
-
const handleBlur =
|
|
18972
|
+
const handleBlur = React76__namespace.useCallback(
|
|
18949
18973
|
(event) => {
|
|
18950
18974
|
onBlur == null ? void 0 : onBlur(event);
|
|
18951
18975
|
},
|
|
18952
18976
|
[onBlur]
|
|
18953
18977
|
);
|
|
18954
|
-
const handleChange =
|
|
18978
|
+
const handleChange = React76__namespace.useCallback(
|
|
18955
18979
|
(event) => {
|
|
18956
18980
|
onChange == null ? void 0 : onChange(event);
|
|
18957
18981
|
recomputeHeight();
|
|
@@ -19128,7 +19152,7 @@ function splitIntoTokens(raw, sep) {
|
|
|
19128
19152
|
}
|
|
19129
19153
|
return acc.map((t4) => t4.trim()).filter((t4) => t4.length > 0);
|
|
19130
19154
|
}
|
|
19131
|
-
var ShadcnChipsVariant =
|
|
19155
|
+
var ShadcnChipsVariant = React76__namespace.forwardRef(function ShadcnChipsVariant2(props, ref) {
|
|
19132
19156
|
var _a;
|
|
19133
19157
|
const {
|
|
19134
19158
|
// variant base bits
|
|
@@ -19165,20 +19189,20 @@ var ShadcnChipsVariant = React74__namespace.forwardRef(function ShadcnChipsVaria
|
|
|
19165
19189
|
...restTextProps
|
|
19166
19190
|
} = props;
|
|
19167
19191
|
const hasInvalidIncomingValue = value !== void 0 && !Array.isArray(value);
|
|
19168
|
-
|
|
19192
|
+
React76__namespace.useEffect(() => {
|
|
19169
19193
|
if (!hasInvalidIncomingValue) return;
|
|
19170
19194
|
console.warn(
|
|
19171
19195
|
"[form-palette] ShadcnChipsVariant expected `value` to be `string[] | undefined`; received:",
|
|
19172
19196
|
value
|
|
19173
19197
|
);
|
|
19174
19198
|
}, [hasInvalidIncomingValue, value]);
|
|
19175
|
-
const chips =
|
|
19199
|
+
const chips = React76__namespace.useMemo(
|
|
19176
19200
|
() => Array.isArray(value) ? value : [],
|
|
19177
19201
|
[value]
|
|
19178
19202
|
);
|
|
19179
19203
|
const hasChips = chips.length > 0;
|
|
19180
|
-
const [inputText, setInputText] =
|
|
19181
|
-
const emitChange =
|
|
19204
|
+
const [inputText, setInputText] = React76__namespace.useState("");
|
|
19205
|
+
const emitChange = React76__namespace.useCallback(
|
|
19182
19206
|
(nextChips, meta) => {
|
|
19183
19207
|
const detail = {
|
|
19184
19208
|
source: "variant",
|
|
@@ -19193,7 +19217,7 @@ var ShadcnChipsVariant = React74__namespace.forwardRef(function ShadcnChipsVaria
|
|
|
19193
19217
|
},
|
|
19194
19218
|
[onValue]
|
|
19195
19219
|
);
|
|
19196
|
-
const commitFromRaw =
|
|
19220
|
+
const commitFromRaw = React76__namespace.useCallback(
|
|
19197
19221
|
(raw) => {
|
|
19198
19222
|
const tokens = splitIntoTokens(raw, separators);
|
|
19199
19223
|
if (!tokens.length) return;
|
|
@@ -19214,7 +19238,7 @@ var ShadcnChipsVariant = React74__namespace.forwardRef(function ShadcnChipsVaria
|
|
|
19214
19238
|
},
|
|
19215
19239
|
[chips, separators, allowDuplicates, maxChips, emitChange, onAddChips]
|
|
19216
19240
|
);
|
|
19217
|
-
const handleRemoveAt =
|
|
19241
|
+
const handleRemoveAt = React76__namespace.useCallback(
|
|
19218
19242
|
(index) => {
|
|
19219
19243
|
if (index < 0 || index >= chips.length) return;
|
|
19220
19244
|
const removed = [chips[index]];
|
|
@@ -19224,7 +19248,7 @@ var ShadcnChipsVariant = React74__namespace.forwardRef(function ShadcnChipsVaria
|
|
|
19224
19248
|
},
|
|
19225
19249
|
[chips, emitChange, onRemoveChips]
|
|
19226
19250
|
);
|
|
19227
|
-
const handleClear =
|
|
19251
|
+
const handleClear = React76__namespace.useCallback(
|
|
19228
19252
|
(ev) => {
|
|
19229
19253
|
ev == null ? void 0 : ev.preventDefault();
|
|
19230
19254
|
ev == null ? void 0 : ev.stopPropagation();
|
|
@@ -19235,7 +19259,7 @@ var ShadcnChipsVariant = React74__namespace.forwardRef(function ShadcnChipsVaria
|
|
|
19235
19259
|
},
|
|
19236
19260
|
[chips, emitChange, onRemoveChips]
|
|
19237
19261
|
);
|
|
19238
|
-
const handleEntryChange =
|
|
19262
|
+
const handleEntryChange = React76__namespace.useCallback(
|
|
19239
19263
|
(event) => {
|
|
19240
19264
|
var _a2;
|
|
19241
19265
|
const next = (_a2 = event.target.value) != null ? _a2 : "";
|
|
@@ -19243,7 +19267,7 @@ var ShadcnChipsVariant = React74__namespace.forwardRef(function ShadcnChipsVaria
|
|
|
19243
19267
|
},
|
|
19244
19268
|
[]
|
|
19245
19269
|
);
|
|
19246
|
-
const handleEntryKeyDown =
|
|
19270
|
+
const handleEntryKeyDown = React76__namespace.useCallback(
|
|
19247
19271
|
(event) => {
|
|
19248
19272
|
const key = event.key;
|
|
19249
19273
|
if (key === "Enter" && addOnEnter) {
|
|
@@ -19274,7 +19298,7 @@ var ShadcnChipsVariant = React74__namespace.forwardRef(function ShadcnChipsVaria
|
|
|
19274
19298
|
handleRemoveAt
|
|
19275
19299
|
]
|
|
19276
19300
|
);
|
|
19277
|
-
const handleEntryBlur =
|
|
19301
|
+
const handleEntryBlur = React76__namespace.useCallback(
|
|
19278
19302
|
(event) => {
|
|
19279
19303
|
if (addOnBlur && inputText.trim().length) {
|
|
19280
19304
|
commitFromRaw(inputText);
|
|
@@ -19286,10 +19310,12 @@ var ShadcnChipsVariant = React74__namespace.forwardRef(function ShadcnChipsVaria
|
|
|
19286
19310
|
[addOnBlur, inputText, commitFromRaw, restTextProps]
|
|
19287
19311
|
);
|
|
19288
19312
|
const effectivePlaceholder = placeholder != null ? placeholder : hasChips ? "" : "Add item\u2026";
|
|
19313
|
+
const defaultMaxVisible = !textareaMode && placement !== "below" ? 3 : void 0;
|
|
19314
|
+
const effectiveMaxVisibleChips = maxVisibleChips !== void 0 ? maxVisibleChips : defaultMaxVisible;
|
|
19289
19315
|
let visibleChips = chips;
|
|
19290
19316
|
let hiddenCount = 0;
|
|
19291
|
-
if (typeof
|
|
19292
|
-
visibleChips = chips.slice(0,
|
|
19317
|
+
if (typeof effectiveMaxVisibleChips === "number" && effectiveMaxVisibleChips > 0 && chips.length > effectiveMaxVisibleChips) {
|
|
19318
|
+
visibleChips = chips.slice(0, effectiveMaxVisibleChips);
|
|
19293
19319
|
hiddenCount = chips.length - visibleChips.length;
|
|
19294
19320
|
}
|
|
19295
19321
|
const maxWidthStyle = maxChipWidth !== void 0 ? {
|
|
@@ -19299,7 +19325,7 @@ var ShadcnChipsVariant = React74__namespace.forwardRef(function ShadcnChipsVaria
|
|
|
19299
19325
|
const baseRemoveClasses = textareaMode ? "cursor-pointer text-[16px] opacity-70 hover:opacity-100 mt-0.5" : "cursor-pointer text-[16px] opacity-70 hover:opacity-100";
|
|
19300
19326
|
const chipNodes = visibleChips.map((chip, index) => {
|
|
19301
19327
|
if (renderChip) {
|
|
19302
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19328
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React76__namespace.Fragment, { children: renderChip(chip, index, {
|
|
19303
19329
|
remove: () => handleRemoveAt(index),
|
|
19304
19330
|
chips
|
|
19305
19331
|
}) }, `${chip}-${index}`);
|
|
@@ -19348,25 +19374,69 @@ var ShadcnChipsVariant = React74__namespace.forwardRef(function ShadcnChipsVaria
|
|
|
19348
19374
|
);
|
|
19349
19375
|
});
|
|
19350
19376
|
if (hiddenCount > 0) {
|
|
19351
|
-
const
|
|
19352
|
-
|
|
19353
|
-
{
|
|
19354
|
-
|
|
19355
|
-
|
|
19356
|
-
"
|
|
19357
|
-
|
|
19358
|
-
|
|
19359
|
-
|
|
19360
|
-
|
|
19361
|
-
|
|
19362
|
-
|
|
19363
|
-
|
|
19364
|
-
|
|
19365
|
-
|
|
19366
|
-
|
|
19377
|
+
const hiddenChips = chips.slice(effectiveMaxVisibleChips != null ? effectiveMaxVisibleChips : 0);
|
|
19378
|
+
const defaultOverflow = /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
19379
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19380
|
+
"button",
|
|
19381
|
+
{
|
|
19382
|
+
type: "button",
|
|
19383
|
+
className: cn(
|
|
19384
|
+
baseChipClasses,
|
|
19385
|
+
"cursor-pointer font-semibold bg-primary/10 text-primary hover:bg-primary/20",
|
|
19386
|
+
chipClassName
|
|
19387
|
+
),
|
|
19388
|
+
"data-slot": "chip-overflow",
|
|
19389
|
+
children: [
|
|
19390
|
+
"+",
|
|
19391
|
+
hiddenCount,
|
|
19392
|
+
" more"
|
|
19393
|
+
]
|
|
19394
|
+
}
|
|
19395
|
+
) }),
|
|
19396
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { className: "p-3 w-64 max-h-60 overflow-y-auto", align: "start", children: [
|
|
19397
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-bold text-muted-foreground uppercase tracking-wider mb-2", children: "Hidden Chips" }),
|
|
19398
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1.5", children: hiddenChips.map((chip, hiddenIdx) => {
|
|
19399
|
+
const actualIndex = (effectiveMaxVisibleChips != null ? effectiveMaxVisibleChips : 0) + hiddenIdx;
|
|
19400
|
+
let label = chip;
|
|
19401
|
+
if (typeof maxChipChars === "number" && maxChipChars > 0 && label.length > maxChipChars) {
|
|
19402
|
+
label = label.slice(0, maxChipChars) + "\u2026";
|
|
19403
|
+
}
|
|
19404
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19405
|
+
"div",
|
|
19406
|
+
{
|
|
19407
|
+
className: cn(baseChipClasses, chipClassName, "max-w-full"),
|
|
19408
|
+
children: [
|
|
19409
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19410
|
+
"span",
|
|
19411
|
+
{
|
|
19412
|
+
className: cn("truncate", chipLabelClassName),
|
|
19413
|
+
style: maxWidthStyle,
|
|
19414
|
+
children: label
|
|
19415
|
+
}
|
|
19416
|
+
),
|
|
19417
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19418
|
+
"span",
|
|
19419
|
+
{
|
|
19420
|
+
className: cn(baseRemoveClasses, chipRemoveClassName),
|
|
19421
|
+
onClick: (e4) => {
|
|
19422
|
+
e4.preventDefault();
|
|
19423
|
+
e4.stopPropagation();
|
|
19424
|
+
handleRemoveAt(actualIndex);
|
|
19425
|
+
},
|
|
19426
|
+
"aria-hidden": "true",
|
|
19427
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 14 })
|
|
19428
|
+
}
|
|
19429
|
+
)
|
|
19430
|
+
]
|
|
19431
|
+
},
|
|
19432
|
+
`${chip}-${actualIndex}`
|
|
19433
|
+
);
|
|
19434
|
+
}) })
|
|
19435
|
+
] })
|
|
19436
|
+
] });
|
|
19367
19437
|
const node = (_a = renderOverflowChip == null ? void 0 : renderOverflowChip(hiddenCount, chips)) != null ? _a : defaultOverflow;
|
|
19368
19438
|
chipNodes.push(
|
|
19369
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19439
|
+
/* @__PURE__ */ jsxRuntime.jsx(React76__namespace.Fragment, { children: node }, "__overflow")
|
|
19370
19440
|
);
|
|
19371
19441
|
}
|
|
19372
19442
|
const effectivePlacement = textareaMode ? placement != null ? placement : "inline" : placement != null ? placement : "inline";
|
|
@@ -19560,7 +19630,7 @@ var chipVariant = {
|
|
|
19560
19630
|
tags: ["chips", "multi-select", "tags"]
|
|
19561
19631
|
}
|
|
19562
19632
|
};
|
|
19563
|
-
var ShadcnTextareaVariant =
|
|
19633
|
+
var ShadcnTextareaVariant = React76__namespace.forwardRef(function ShadcnTextareaVariant2(props, ref) {
|
|
19564
19634
|
const {
|
|
19565
19635
|
value,
|
|
19566
19636
|
onValue,
|
|
@@ -19568,7 +19638,7 @@ var ShadcnTextareaVariant = React74__namespace.forwardRef(function ShadcnTextare
|
|
|
19568
19638
|
// everything else goes straight to the UI Textarea
|
|
19569
19639
|
...rest
|
|
19570
19640
|
} = props;
|
|
19571
|
-
const handleChange =
|
|
19641
|
+
const handleChange = React76__namespace.useCallback(
|
|
19572
19642
|
(event) => {
|
|
19573
19643
|
var _a;
|
|
19574
19644
|
const next = (_a = event.target.value) != null ? _a : "";
|
|
@@ -19663,7 +19733,7 @@ function switchThumbSize(size) {
|
|
|
19663
19733
|
if (size === "lg") return "size-5";
|
|
19664
19734
|
return "size-4";
|
|
19665
19735
|
}
|
|
19666
|
-
var ShadcnToggleVariant =
|
|
19736
|
+
var ShadcnToggleVariant = React76__namespace.forwardRef(function ShadcnToggleVariant2(props, _ref) {
|
|
19667
19737
|
const {
|
|
19668
19738
|
// variant bits
|
|
19669
19739
|
value,
|
|
@@ -19685,7 +19755,7 @@ var ShadcnToggleVariant = React74__namespace.forwardRef(function ShadcnToggleVar
|
|
|
19685
19755
|
...restSwitchProps
|
|
19686
19756
|
} = props;
|
|
19687
19757
|
const checked = !!value;
|
|
19688
|
-
const handleToggle =
|
|
19758
|
+
const handleToggle = React76__namespace.useCallback(
|
|
19689
19759
|
(next) => {
|
|
19690
19760
|
const nextVal = Boolean(next);
|
|
19691
19761
|
const detail = {
|
|
@@ -20211,7 +20281,7 @@ var InnerShadcnRadioVariant = (props, ref) => {
|
|
|
20211
20281
|
...restGroupProps
|
|
20212
20282
|
} = props;
|
|
20213
20283
|
const hasError = !!error;
|
|
20214
|
-
const normalized =
|
|
20284
|
+
const normalized = React76__namespace.useMemo(
|
|
20215
20285
|
() => normalizeItems(
|
|
20216
20286
|
items != null ? items : options,
|
|
20217
20287
|
mappers,
|
|
@@ -20242,14 +20312,14 @@ var InnerShadcnRadioVariant = (props, ref) => {
|
|
|
20242
20312
|
optionTagOnClick
|
|
20243
20313
|
]
|
|
20244
20314
|
);
|
|
20245
|
-
const selectedString =
|
|
20315
|
+
const selectedString = React76__namespace.useMemo(() => {
|
|
20246
20316
|
if (value === void 0) return void 0;
|
|
20247
20317
|
const found = normalized.find(
|
|
20248
20318
|
(item) => isEqualValue(item.value, value)
|
|
20249
20319
|
);
|
|
20250
20320
|
return found ? String(found.value) : void 0;
|
|
20251
20321
|
}, [normalized, value]);
|
|
20252
|
-
const handleSelect =
|
|
20322
|
+
const handleSelect = React76__namespace.useCallback(
|
|
20253
20323
|
(next, selectedRaw) => {
|
|
20254
20324
|
if (!onValue || disabled) return;
|
|
20255
20325
|
const detail = {
|
|
@@ -20263,7 +20333,7 @@ var InnerShadcnRadioVariant = (props, ref) => {
|
|
|
20263
20333
|
},
|
|
20264
20334
|
[onValue, disabled]
|
|
20265
20335
|
);
|
|
20266
|
-
const handleRadioChange =
|
|
20336
|
+
const handleRadioChange = React76__namespace.useCallback(
|
|
20267
20337
|
(raw) => {
|
|
20268
20338
|
var _a;
|
|
20269
20339
|
const found = normalized.find((item) => String(item.value) === raw);
|
|
@@ -20405,7 +20475,7 @@ var InnerShadcnRadioVariant = (props, ref) => {
|
|
|
20405
20475
|
}
|
|
20406
20476
|
);
|
|
20407
20477
|
};
|
|
20408
|
-
var ShadcnRadioVariant =
|
|
20478
|
+
var ShadcnRadioVariant = React76__namespace.forwardRef(
|
|
20409
20479
|
InnerShadcnRadioVariant
|
|
20410
20480
|
);
|
|
20411
20481
|
|
|
@@ -20665,7 +20735,7 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
20665
20735
|
} = props;
|
|
20666
20736
|
const hasError = !!error;
|
|
20667
20737
|
const isSingle = !!single;
|
|
20668
|
-
const normalized =
|
|
20738
|
+
const normalized = React76__namespace.useMemo(
|
|
20669
20739
|
() => normalizeItems2(
|
|
20670
20740
|
items != null ? items : options,
|
|
20671
20741
|
mappers,
|
|
@@ -20768,14 +20838,14 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
20768
20838
|
}
|
|
20769
20839
|
);
|
|
20770
20840
|
}
|
|
20771
|
-
const normalizedByValueKey =
|
|
20841
|
+
const normalizedByValueKey = React76__namespace.useMemo(() => {
|
|
20772
20842
|
const lookup = /* @__PURE__ */ new Map();
|
|
20773
20843
|
normalized.forEach((item) => {
|
|
20774
20844
|
lookup.set(valueLookupKey(item.value), item);
|
|
20775
20845
|
});
|
|
20776
20846
|
return lookup;
|
|
20777
20847
|
}, [normalized]);
|
|
20778
|
-
const groupValue =
|
|
20848
|
+
const groupValue = React76__namespace.useMemo(() => {
|
|
20779
20849
|
const source = asGroupValue(value);
|
|
20780
20850
|
if (!(source == null ? void 0 : source.length)) return source;
|
|
20781
20851
|
return source.map((entry) => {
|
|
@@ -20813,21 +20883,21 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
20813
20883
|
labelTextSizeClass: labelTextSize2(size),
|
|
20814
20884
|
descriptionTextSizeClass: descriptionTextSize2(size)
|
|
20815
20885
|
});
|
|
20816
|
-
const hasAnyTristate =
|
|
20886
|
+
const hasAnyTristate = React76__namespace.useMemo(
|
|
20817
20887
|
() => normalized.some((item) => {
|
|
20818
20888
|
var _a, _b;
|
|
20819
20889
|
return (_b = (_a = item.tristate) != null ? _a : tristateDefault) != null ? _b : false;
|
|
20820
20890
|
}),
|
|
20821
20891
|
[normalized, tristateDefault]
|
|
20822
20892
|
);
|
|
20823
|
-
const findEntryIndex =
|
|
20893
|
+
const findEntryIndex = React76__namespace.useCallback(
|
|
20824
20894
|
(val) => {
|
|
20825
20895
|
if (!groupValue) return -1;
|
|
20826
20896
|
return groupValue.findIndex((e4) => isEqualValue2(e4.value, val));
|
|
20827
20897
|
},
|
|
20828
20898
|
[groupValue]
|
|
20829
20899
|
);
|
|
20830
|
-
const getEntryState =
|
|
20900
|
+
const getEntryState = React76__namespace.useCallback(
|
|
20831
20901
|
(val) => {
|
|
20832
20902
|
const idx = findEntryIndex(val);
|
|
20833
20903
|
if (!groupValue || idx === -1) return "none";
|
|
@@ -20835,7 +20905,7 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
20835
20905
|
},
|
|
20836
20906
|
[groupValue, findEntryIndex]
|
|
20837
20907
|
);
|
|
20838
|
-
const updateGroupValue =
|
|
20908
|
+
const updateGroupValue = React76__namespace.useCallback(
|
|
20839
20909
|
(itemValue, nextInternal, effectiveTristate) => {
|
|
20840
20910
|
if (!onValue || disabled) return;
|
|
20841
20911
|
const currentList = groupValue ? [...groupValue] : [];
|
|
@@ -21065,7 +21135,7 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
21065
21135
|
}
|
|
21066
21136
|
);
|
|
21067
21137
|
};
|
|
21068
|
-
var ShadcnCheckboxVariant =
|
|
21138
|
+
var ShadcnCheckboxVariant = React76__namespace.forwardRef(
|
|
21069
21139
|
InnerShadcnCheckboxVariant
|
|
21070
21140
|
);
|
|
21071
21141
|
|
|
@@ -21094,14 +21164,14 @@ function ScrollArea({
|
|
|
21094
21164
|
...props
|
|
21095
21165
|
}) {
|
|
21096
21166
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21097
|
-
|
|
21167
|
+
ScrollAreaPrimitive2__namespace.Root,
|
|
21098
21168
|
{
|
|
21099
21169
|
"data-slot": "scroll-area",
|
|
21100
21170
|
className: cn("relative", className),
|
|
21101
21171
|
...props,
|
|
21102
21172
|
children: [
|
|
21103
21173
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21104
|
-
|
|
21174
|
+
ScrollAreaPrimitive2__namespace.Viewport,
|
|
21105
21175
|
{
|
|
21106
21176
|
"data-slot": "scroll-area-viewport",
|
|
21107
21177
|
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
@@ -21109,7 +21179,7 @@ function ScrollArea({
|
|
|
21109
21179
|
}
|
|
21110
21180
|
),
|
|
21111
21181
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollBar, {}),
|
|
21112
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21182
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive2__namespace.Corner, {})
|
|
21113
21183
|
]
|
|
21114
21184
|
}
|
|
21115
21185
|
);
|
|
@@ -21120,7 +21190,7 @@ function ScrollBar({
|
|
|
21120
21190
|
...props
|
|
21121
21191
|
}) {
|
|
21122
21192
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21123
|
-
|
|
21193
|
+
ScrollAreaPrimitive2__namespace.ScrollAreaScrollbar,
|
|
21124
21194
|
{
|
|
21125
21195
|
"data-slot": "scroll-area-scrollbar",
|
|
21126
21196
|
orientation,
|
|
@@ -21132,7 +21202,7 @@ function ScrollBar({
|
|
|
21132
21202
|
),
|
|
21133
21203
|
...props,
|
|
21134
21204
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
21135
|
-
|
|
21205
|
+
ScrollAreaPrimitive2__namespace.ScrollAreaThumb,
|
|
21136
21206
|
{
|
|
21137
21207
|
"data-slot": "scroll-area-thumb",
|
|
21138
21208
|
className: "bg-border relative flex-1 rounded-full"
|
|
@@ -21141,6 +21211,102 @@ function ScrollBar({
|
|
|
21141
21211
|
}
|
|
21142
21212
|
);
|
|
21143
21213
|
}
|
|
21214
|
+
function VirtualScroll({
|
|
21215
|
+
className,
|
|
21216
|
+
rootProps,
|
|
21217
|
+
scrollbarProps,
|
|
21218
|
+
style,
|
|
21219
|
+
components,
|
|
21220
|
+
...props
|
|
21221
|
+
}) {
|
|
21222
|
+
const Scroller = React76__namespace.useMemo(() => {
|
|
21223
|
+
return React76__namespace.forwardRef((scrollerProps, ref) => {
|
|
21224
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21225
|
+
ScrollAreaPrimitive2__namespace.Viewport,
|
|
21226
|
+
{
|
|
21227
|
+
...scrollerProps,
|
|
21228
|
+
ref,
|
|
21229
|
+
"data-slot": "scroll-area-viewport",
|
|
21230
|
+
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
|
|
21231
|
+
}
|
|
21232
|
+
);
|
|
21233
|
+
});
|
|
21234
|
+
}, []);
|
|
21235
|
+
const combinedComponents = React76__namespace.useMemo(() => {
|
|
21236
|
+
return {
|
|
21237
|
+
...components,
|
|
21238
|
+
Scroller
|
|
21239
|
+
};
|
|
21240
|
+
}, [components, Scroller]);
|
|
21241
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21242
|
+
ScrollAreaPrimitive2__namespace.Root,
|
|
21243
|
+
{
|
|
21244
|
+
"data-slot": "scroll-area",
|
|
21245
|
+
className,
|
|
21246
|
+
...rootProps,
|
|
21247
|
+
style: { ...style, position: "relative" },
|
|
21248
|
+
children: [
|
|
21249
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21250
|
+
reactVirtuoso.Virtuoso,
|
|
21251
|
+
{
|
|
21252
|
+
...props,
|
|
21253
|
+
components: combinedComponents
|
|
21254
|
+
}
|
|
21255
|
+
),
|
|
21256
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { ...scrollbarProps }),
|
|
21257
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive2__namespace.Corner, {})
|
|
21258
|
+
]
|
|
21259
|
+
}
|
|
21260
|
+
);
|
|
21261
|
+
}
|
|
21262
|
+
function VirtualScrollGrid({
|
|
21263
|
+
className,
|
|
21264
|
+
rootProps,
|
|
21265
|
+
scrollbarProps,
|
|
21266
|
+
style,
|
|
21267
|
+
components,
|
|
21268
|
+
...props
|
|
21269
|
+
}) {
|
|
21270
|
+
const Scroller = React76__namespace.useMemo(() => {
|
|
21271
|
+
return React76__namespace.forwardRef((scrollerProps, ref) => {
|
|
21272
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21273
|
+
ScrollAreaPrimitive2__namespace.Viewport,
|
|
21274
|
+
{
|
|
21275
|
+
...scrollerProps,
|
|
21276
|
+
ref,
|
|
21277
|
+
"data-slot": "scroll-area-viewport",
|
|
21278
|
+
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
|
|
21279
|
+
}
|
|
21280
|
+
);
|
|
21281
|
+
});
|
|
21282
|
+
}, []);
|
|
21283
|
+
const combinedComponents = React76__namespace.useMemo(() => {
|
|
21284
|
+
return {
|
|
21285
|
+
...components,
|
|
21286
|
+
Scroller
|
|
21287
|
+
};
|
|
21288
|
+
}, [components, Scroller]);
|
|
21289
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21290
|
+
ScrollAreaPrimitive2__namespace.Root,
|
|
21291
|
+
{
|
|
21292
|
+
"data-slot": "scroll-area",
|
|
21293
|
+
className,
|
|
21294
|
+
...rootProps,
|
|
21295
|
+
style: { ...style, position: "relative" },
|
|
21296
|
+
children: [
|
|
21297
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21298
|
+
reactVirtuoso.VirtuosoGrid,
|
|
21299
|
+
{
|
|
21300
|
+
...props,
|
|
21301
|
+
components: combinedComponents
|
|
21302
|
+
}
|
|
21303
|
+
),
|
|
21304
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { ...scrollbarProps }),
|
|
21305
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive2__namespace.Corner, {})
|
|
21306
|
+
]
|
|
21307
|
+
}
|
|
21308
|
+
);
|
|
21309
|
+
}
|
|
21144
21310
|
function normalizeOptions(opts, config) {
|
|
21145
21311
|
return globalNormalizeOptions(opts, config);
|
|
21146
21312
|
}
|
|
@@ -21165,7 +21331,7 @@ function triggerPadding(density) {
|
|
|
21165
21331
|
return "py-1.5";
|
|
21166
21332
|
}
|
|
21167
21333
|
}
|
|
21168
|
-
var ShadcnSelectVariant =
|
|
21334
|
+
var ShadcnSelectVariant = React76__namespace.forwardRef(function ShadcnSelectVariant2(props, _ref) {
|
|
21169
21335
|
var _a, _b;
|
|
21170
21336
|
const {
|
|
21171
21337
|
value,
|
|
@@ -21197,6 +21363,7 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21197
21363
|
clearable,
|
|
21198
21364
|
placeholder,
|
|
21199
21365
|
className,
|
|
21366
|
+
style,
|
|
21200
21367
|
triggerClassName,
|
|
21201
21368
|
contentClassName,
|
|
21202
21369
|
renderOption,
|
|
@@ -21223,9 +21390,9 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21223
21390
|
virtualScroll = true
|
|
21224
21391
|
} = props;
|
|
21225
21392
|
const isButtonMode = mode === "button";
|
|
21226
|
-
const [open, setOpen] =
|
|
21227
|
-
const [query, setQuery] =
|
|
21228
|
-
const items =
|
|
21393
|
+
const [open, setOpen] = React76__namespace.useState(false);
|
|
21394
|
+
const [query, setQuery] = React76__namespace.useState("");
|
|
21395
|
+
const items = React76__namespace.useMemo(
|
|
21229
21396
|
() => normalizeOptions(options != null ? options : [], {
|
|
21230
21397
|
autoCap,
|
|
21231
21398
|
optionLabel,
|
|
@@ -21261,7 +21428,7 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21261
21428
|
]
|
|
21262
21429
|
);
|
|
21263
21430
|
const normalizedValue = value === "" || value == null ? void 0 : value;
|
|
21264
|
-
const valueMap =
|
|
21431
|
+
const valueMap = React76__namespace.useMemo(() => {
|
|
21265
21432
|
const map = /* @__PURE__ */ new Map();
|
|
21266
21433
|
for (const item of items) {
|
|
21267
21434
|
map.set(String(item.value), item.value);
|
|
@@ -21271,7 +21438,7 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21271
21438
|
const selectedItem = normalizedValue == null ? null : (_a = items.find(
|
|
21272
21439
|
(it) => String(it.value) === String(normalizedValue)
|
|
21273
21440
|
)) != null ? _a : null;
|
|
21274
|
-
const filteredItems =
|
|
21441
|
+
const filteredItems = React76__namespace.useMemo(() => {
|
|
21275
21442
|
if (!query) return items;
|
|
21276
21443
|
const q2 = query.toLowerCase();
|
|
21277
21444
|
return items.filter((it) => it.labelText.toLowerCase().includes(q2));
|
|
@@ -21283,7 +21450,7 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21283
21450
|
listMaxHeight,
|
|
21284
21451
|
Math.max(estimatedRowHeight, filteredItems.length * estimatedRowHeight)
|
|
21285
21452
|
);
|
|
21286
|
-
const handleChange =
|
|
21453
|
+
const handleChange = React76__namespace.useCallback(
|
|
21287
21454
|
(rawKey) => {
|
|
21288
21455
|
var _a2, _b2, _c, _d;
|
|
21289
21456
|
if (!onValue || rawKey === "") return;
|
|
@@ -21332,7 +21499,7 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21332
21499
|
"focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",
|
|
21333
21500
|
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
|
|
21334
21501
|
);
|
|
21335
|
-
const ButtonModeTrigger =
|
|
21502
|
+
const ButtonModeTrigger = React76__namespace.useMemo(() => {
|
|
21336
21503
|
if (!isButtonMode) return null;
|
|
21337
21504
|
const selectedValue = value;
|
|
21338
21505
|
const renderable = button != null ? button : children;
|
|
@@ -21407,8 +21574,10 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21407
21574
|
heightCls,
|
|
21408
21575
|
padCls,
|
|
21409
21576
|
hasControls && joinControls && extendBoxToControls ? "border-none shadow-none focus:ring-0 focus:outline-none" : "",
|
|
21410
|
-
triggerClassName
|
|
21577
|
+
triggerClassName,
|
|
21578
|
+
!joinControls && className
|
|
21411
21579
|
),
|
|
21580
|
+
style: !joinControls ? style : void 0,
|
|
21412
21581
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
21413
21582
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
21414
21583
|
hasLeadingIcons && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -21491,7 +21660,7 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21491
21660
|
filteredItems.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1.5 text-xs text-muted-foreground", children: emptySearchText != null ? emptySearchText : "No results found" }) : useVirtualization ? (
|
|
21492
21661
|
// CASE 3: normal list, virtualized
|
|
21493
21662
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21494
|
-
|
|
21663
|
+
VirtualScroll,
|
|
21495
21664
|
{
|
|
21496
21665
|
style: { height: listHeight },
|
|
21497
21666
|
data: filteredItems,
|
|
@@ -21622,8 +21791,7 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21622
21791
|
"data-slot": "select-field",
|
|
21623
21792
|
className: cn(
|
|
21624
21793
|
"w-full",
|
|
21625
|
-
disabled && "opacity-50 cursor-not-allowed"
|
|
21626
|
-
className
|
|
21794
|
+
disabled && "opacity-50 cursor-not-allowed"
|
|
21627
21795
|
),
|
|
21628
21796
|
"aria-disabled": disabled || void 0,
|
|
21629
21797
|
"aria-invalid": error ? "true" : void 0,
|
|
@@ -21653,6 +21821,7 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21653
21821
|
"div",
|
|
21654
21822
|
{
|
|
21655
21823
|
className: groupClassName,
|
|
21824
|
+
style,
|
|
21656
21825
|
"data-slot": "select-group",
|
|
21657
21826
|
"data-disabled": disabled ? "true" : "false",
|
|
21658
21827
|
children: [
|
|
@@ -21698,8 +21867,7 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21698
21867
|
"data-slot": "select-field",
|
|
21699
21868
|
className: cn(
|
|
21700
21869
|
"flex items-stretch w-full",
|
|
21701
|
-
disabled && "opacity-50 cursor-not-allowed"
|
|
21702
|
-
className
|
|
21870
|
+
disabled && "opacity-50 cursor-not-allowed"
|
|
21703
21871
|
),
|
|
21704
21872
|
"aria-disabled": disabled || void 0,
|
|
21705
21873
|
"aria-invalid": error ? "true" : void 0,
|
|
@@ -21757,10 +21925,10 @@ var SelectionSummary = ({
|
|
|
21757
21925
|
placeholder,
|
|
21758
21926
|
onRemoveValue
|
|
21759
21927
|
}) => {
|
|
21760
|
-
const containerRef =
|
|
21761
|
-
const [visibleCount, setVisibleCount] =
|
|
21762
|
-
const [moreOpen, setMoreOpen] =
|
|
21763
|
-
|
|
21928
|
+
const containerRef = React76__namespace.useRef(null);
|
|
21929
|
+
const [visibleCount, setVisibleCount] = React76__namespace.useState(0);
|
|
21930
|
+
const [moreOpen, setMoreOpen] = React76__namespace.useState(false);
|
|
21931
|
+
React76__namespace.useLayoutEffect(() => {
|
|
21764
21932
|
const el = containerRef.current;
|
|
21765
21933
|
if (!el) return;
|
|
21766
21934
|
const computeVisibleItems = () => {
|
|
@@ -21808,7 +21976,7 @@ var SelectionSummary = ({
|
|
|
21808
21976
|
ref: containerRef,
|
|
21809
21977
|
className: "flex items-center w-full overflow-hidden whitespace-nowrap",
|
|
21810
21978
|
children: [
|
|
21811
|
-
visibleItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21979
|
+
visibleItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React76__namespace.Fragment, { children: [
|
|
21812
21980
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate flex-shrink-0", children: item.labelNode }),
|
|
21813
21981
|
index < visibleItems.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground mr-1", children: "," })
|
|
21814
21982
|
] }, item.key)),
|
|
@@ -21889,7 +22057,7 @@ function removeSelectValue(current, valueToRemove) {
|
|
|
21889
22057
|
return current.filter((v2) => String(v2) !== target);
|
|
21890
22058
|
}
|
|
21891
22059
|
|
|
21892
|
-
// src/presets/shadcn
|
|
22060
|
+
// src/presets/shadcn/variants/multiselect.tsx
|
|
21893
22061
|
var import_lodash = __toESM(require_lodash());
|
|
21894
22062
|
function normalizeOptions2(opts, config) {
|
|
21895
22063
|
return globalNormalizeOptions(opts, config);
|
|
@@ -21915,7 +22083,7 @@ function triggerPadding2(density) {
|
|
|
21915
22083
|
return "py-1.5";
|
|
21916
22084
|
}
|
|
21917
22085
|
}
|
|
21918
|
-
var ShadcnMultiSelectVariant =
|
|
22086
|
+
var ShadcnMultiSelectVariant = React76__namespace.forwardRef(function ShadcnMultiSelectVariant2(props, _ref) {
|
|
21919
22087
|
var _a;
|
|
21920
22088
|
const {
|
|
21921
22089
|
value,
|
|
@@ -21978,9 +22146,9 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
21978
22146
|
selectedBadgeClassName,
|
|
21979
22147
|
selectedBadgePlacement = "end"
|
|
21980
22148
|
} = props;
|
|
21981
|
-
const [open, setOpen] =
|
|
21982
|
-
const [query, setQuery] =
|
|
21983
|
-
const { items, keyedItems } =
|
|
22149
|
+
const [open, setOpen] = React76__namespace.useState(false);
|
|
22150
|
+
const [query, setQuery] = React76__namespace.useState("");
|
|
22151
|
+
const { items, keyedItems } = React76__namespace.useMemo(() => {
|
|
21984
22152
|
const items2 = normalizeOptions2(options != null ? options : [], {
|
|
21985
22153
|
autoCap,
|
|
21986
22154
|
optionLabel,
|
|
@@ -22015,24 +22183,24 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
22015
22183
|
optionTagBgColor,
|
|
22016
22184
|
optionTagOnClick
|
|
22017
22185
|
]);
|
|
22018
|
-
const selectedValues =
|
|
22186
|
+
const selectedValues = React76__namespace.useMemo(
|
|
22019
22187
|
() => new Set(value != null ? value : []),
|
|
22020
22188
|
[value]
|
|
22021
22189
|
);
|
|
22022
|
-
const selectedItems =
|
|
22190
|
+
const selectedItems = React76__namespace.useMemo(
|
|
22023
22191
|
() => items.filter((it) => selectedValues.has(it.value)),
|
|
22024
22192
|
[items, selectedValues]
|
|
22025
22193
|
);
|
|
22026
|
-
const filteredItems =
|
|
22194
|
+
const filteredItems = React76__namespace.useMemo(() => {
|
|
22027
22195
|
if (!query) return items;
|
|
22028
22196
|
const q2 = query.toLowerCase();
|
|
22029
22197
|
return items.filter((it) => it.labelText.toLowerCase().includes(q2));
|
|
22030
22198
|
}, [items, query]);
|
|
22031
|
-
const selectableItems =
|
|
22199
|
+
const selectableItems = React76__namespace.useMemo(
|
|
22032
22200
|
() => items.filter((it) => !it.disabled),
|
|
22033
22201
|
[items]
|
|
22034
22202
|
);
|
|
22035
|
-
const allSelectableValues =
|
|
22203
|
+
const allSelectableValues = React76__namespace.useMemo(
|
|
22036
22204
|
() => new Set(selectableItems.map((it) => it.value)),
|
|
22037
22205
|
[selectableItems]
|
|
22038
22206
|
);
|
|
@@ -22052,7 +22220,7 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
22052
22220
|
filteredItems.length * estimatedRowHeight + headerHeight + footerHeight
|
|
22053
22221
|
)
|
|
22054
22222
|
);
|
|
22055
|
-
const handleToggleValue =
|
|
22223
|
+
const handleToggleValue = React76__namespace.useCallback(
|
|
22056
22224
|
(primitive) => {
|
|
22057
22225
|
if (!onValue || disabled || readOnly) return;
|
|
22058
22226
|
const current = value != null ? value : [];
|
|
@@ -22086,7 +22254,7 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
22086
22254
|
},
|
|
22087
22255
|
[onValue, value, disabled, readOnly, keyedItems]
|
|
22088
22256
|
);
|
|
22089
|
-
const handleSelectAll =
|
|
22257
|
+
const handleSelectAll = React76__namespace.useCallback(() => {
|
|
22090
22258
|
if (!onValue || disabled || readOnly) return;
|
|
22091
22259
|
const current = value != null ? value : [];
|
|
22092
22260
|
const allSelectableArr = Array.from(allSelectableValues);
|
|
@@ -22127,7 +22295,7 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
22127
22295
|
selectedValues,
|
|
22128
22296
|
keyedItems
|
|
22129
22297
|
]);
|
|
22130
|
-
const handleClearAll =
|
|
22298
|
+
const handleClearAll = React76__namespace.useCallback(() => {
|
|
22131
22299
|
if (!onValue || disabled || readOnly) return;
|
|
22132
22300
|
const detail = {
|
|
22133
22301
|
source: "variant",
|
|
@@ -22179,7 +22347,7 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
22179
22347
|
const hasLeadingControl = !!leadingControl;
|
|
22180
22348
|
const hasTrailingControl = !!trailingControl;
|
|
22181
22349
|
const hasControls = hasLeadingControl || hasTrailingControl;
|
|
22182
|
-
const makeCheckboxNode =
|
|
22350
|
+
const makeCheckboxNode = React76__namespace.useCallback(
|
|
22183
22351
|
(opts) => {
|
|
22184
22352
|
if (renderCheckbox) {
|
|
22185
22353
|
return renderCheckbox(opts);
|
|
@@ -22275,7 +22443,7 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
22275
22443
|
] })
|
|
22276
22444
|
}
|
|
22277
22445
|
);
|
|
22278
|
-
const ButtonModeTrigger =
|
|
22446
|
+
const ButtonModeTrigger = React76__namespace.useMemo(() => {
|
|
22279
22447
|
if (mode !== "button") return null;
|
|
22280
22448
|
const selectedCount = selectedItems.length;
|
|
22281
22449
|
const content = (() => {
|
|
@@ -22380,7 +22548,7 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
22380
22548
|
}
|
|
22381
22549
|
) }),
|
|
22382
22550
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22383
|
-
|
|
22551
|
+
VirtualScroll,
|
|
22384
22552
|
{
|
|
22385
22553
|
style: { height: listHeight },
|
|
22386
22554
|
data: filteredItems,
|
|
@@ -22644,7 +22812,7 @@ function Slider({
|
|
|
22644
22812
|
max: max2 = 100,
|
|
22645
22813
|
...props
|
|
22646
22814
|
}) {
|
|
22647
|
-
const _values =
|
|
22815
|
+
const _values = React76__namespace.useMemo(
|
|
22648
22816
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min2, max2],
|
|
22649
22817
|
[value, defaultValue, min2, max2]
|
|
22650
22818
|
);
|
|
@@ -22723,7 +22891,7 @@ function clampToRange(v2, min2, max2) {
|
|
|
22723
22891
|
if (v2 > max2) return max2;
|
|
22724
22892
|
return v2;
|
|
22725
22893
|
}
|
|
22726
|
-
var ShadcnSliderVariant =
|
|
22894
|
+
var ShadcnSliderVariant = React76__namespace.forwardRef(function ShadcnSliderVariant2(props, _ref) {
|
|
22727
22895
|
const {
|
|
22728
22896
|
value,
|
|
22729
22897
|
onValue,
|
|
@@ -22762,7 +22930,7 @@ var ShadcnSliderVariant = React74__namespace.forwardRef(function ShadcnSliderVar
|
|
|
22762
22930
|
} = props;
|
|
22763
22931
|
const numericValue = typeof value === "number" ? value : min2;
|
|
22764
22932
|
const isDisabled = !!(disabled || readOnly);
|
|
22765
|
-
const handleChange =
|
|
22933
|
+
const handleChange = React76__namespace.useCallback(
|
|
22766
22934
|
(vals) => {
|
|
22767
22935
|
if (!onValue) return;
|
|
22768
22936
|
const next = clampToRange(vals[0], min2, max2);
|
|
@@ -22777,7 +22945,7 @@ var ShadcnSliderVariant = React74__namespace.forwardRef(function ShadcnSliderVar
|
|
|
22777
22945
|
[onValue, min2, max2]
|
|
22778
22946
|
);
|
|
22779
22947
|
const stepAmount = controlStep != null ? controlStep : step;
|
|
22780
|
-
const applyStep =
|
|
22948
|
+
const applyStep = React76__namespace.useCallback(
|
|
22781
22949
|
(direction) => {
|
|
22782
22950
|
if (!onValue || isDisabled) return;
|
|
22783
22951
|
const current = typeof value === "number" ? value : min2;
|
|
@@ -23235,7 +23403,7 @@ function getGapPx(el) {
|
|
|
23235
23403
|
const g2 = cs.columnGap && cs.columnGap !== "normal" ? cs.columnGap : cs.gap;
|
|
23236
23404
|
return parsePx(g2);
|
|
23237
23405
|
}
|
|
23238
|
-
var ShadcnKeyValueVariant =
|
|
23406
|
+
var ShadcnKeyValueVariant = React76__namespace.forwardRef(function ShadcnKeyValueVariant2(props, _ref) {
|
|
23239
23407
|
const {
|
|
23240
23408
|
value,
|
|
23241
23409
|
onValue,
|
|
@@ -23260,14 +23428,14 @@ var ShadcnKeyValueVariant = React74__namespace.forwardRef(function ShadcnKeyValu
|
|
|
23260
23428
|
renderChip
|
|
23261
23429
|
} = props;
|
|
23262
23430
|
const isDisabled = disabled || readOnly;
|
|
23263
|
-
const items =
|
|
23264
|
-
const [dialogOpen, setDialogOpen] =
|
|
23265
|
-
const [editingIndex, setEditingIndex] =
|
|
23266
|
-
const [draft, setDraft] =
|
|
23431
|
+
const items = React76__namespace.useMemo(() => mapToItems(value), [value]);
|
|
23432
|
+
const [dialogOpen, setDialogOpen] = React76__namespace.useState(false);
|
|
23433
|
+
const [editingIndex, setEditingIndex] = React76__namespace.useState(null);
|
|
23434
|
+
const [draft, setDraft] = React76__namespace.useState({ key: "", value: "" });
|
|
23267
23435
|
const canAdd = items.length < max2;
|
|
23268
23436
|
const canDelete = items.length > min2;
|
|
23269
23437
|
const hasItems = items.length > 0;
|
|
23270
|
-
const commitItems =
|
|
23438
|
+
const commitItems = React76__namespace.useCallback(
|
|
23271
23439
|
(next, meta) => {
|
|
23272
23440
|
if (!onValue) return;
|
|
23273
23441
|
const nextMap = itemsToMap(next);
|
|
@@ -23281,13 +23449,13 @@ var ShadcnKeyValueVariant = React74__namespace.forwardRef(function ShadcnKeyValu
|
|
|
23281
23449
|
},
|
|
23282
23450
|
[onValue]
|
|
23283
23451
|
);
|
|
23284
|
-
const openForNew =
|
|
23452
|
+
const openForNew = React76__namespace.useCallback(() => {
|
|
23285
23453
|
if (isDisabled || !canAdd) return;
|
|
23286
23454
|
setEditingIndex(null);
|
|
23287
23455
|
setDraft({ key: "", value: "" });
|
|
23288
23456
|
setDialogOpen(true);
|
|
23289
23457
|
}, [isDisabled, canAdd]);
|
|
23290
|
-
const openForEdit =
|
|
23458
|
+
const openForEdit = React76__namespace.useCallback(
|
|
23291
23459
|
(index) => {
|
|
23292
23460
|
if (isDisabled) return;
|
|
23293
23461
|
const item = items[index];
|
|
@@ -23298,7 +23466,7 @@ var ShadcnKeyValueVariant = React74__namespace.forwardRef(function ShadcnKeyValu
|
|
|
23298
23466
|
},
|
|
23299
23467
|
[isDisabled, items]
|
|
23300
23468
|
);
|
|
23301
|
-
const handleDelete =
|
|
23469
|
+
const handleDelete = React76__namespace.useCallback(() => {
|
|
23302
23470
|
if (editingIndex == null) return;
|
|
23303
23471
|
if (!canDelete) return;
|
|
23304
23472
|
const next = items.slice();
|
|
@@ -23309,7 +23477,7 @@ var ShadcnKeyValueVariant = React74__namespace.forwardRef(function ShadcnKeyValu
|
|
|
23309
23477
|
index: editingIndex
|
|
23310
23478
|
});
|
|
23311
23479
|
}, [editingIndex, items, canDelete, commitItems]);
|
|
23312
|
-
const handleSubmit =
|
|
23480
|
+
const handleSubmit = React76__namespace.useCallback(() => {
|
|
23313
23481
|
const trimmedKey = draft.key.trim();
|
|
23314
23482
|
const trimmedValue = draft.value;
|
|
23315
23483
|
if (!trimmedKey) return;
|
|
@@ -23331,7 +23499,7 @@ var ShadcnKeyValueVariant = React74__namespace.forwardRef(function ShadcnKeyValu
|
|
|
23331
23499
|
index: editingIndex != null ? editingIndex : next.length - 1
|
|
23332
23500
|
});
|
|
23333
23501
|
}, [draft, items, editingIndex, canAdd, commitItems]);
|
|
23334
|
-
const handleQuickRemove =
|
|
23502
|
+
const handleQuickRemove = React76__namespace.useCallback(
|
|
23335
23503
|
(index) => {
|
|
23336
23504
|
if (isDisabled || !canDelete) return;
|
|
23337
23505
|
const next = items.slice();
|
|
@@ -23340,21 +23508,21 @@ var ShadcnKeyValueVariant = React74__namespace.forwardRef(function ShadcnKeyValu
|
|
|
23340
23508
|
},
|
|
23341
23509
|
[isDisabled, canDelete, items, commitItems]
|
|
23342
23510
|
);
|
|
23343
|
-
const [listOpen, setListOpen] =
|
|
23344
|
-
const openList =
|
|
23511
|
+
const [listOpen, setListOpen] = React76__namespace.useState(false);
|
|
23512
|
+
const openList = React76__namespace.useCallback(() => {
|
|
23345
23513
|
if (isDisabled) return;
|
|
23346
23514
|
setListOpen(true);
|
|
23347
23515
|
}, [isDisabled]);
|
|
23348
|
-
const wrapRef =
|
|
23349
|
-
const leftRef =
|
|
23350
|
-
const moreMeasureRef =
|
|
23351
|
-
const chipRefs =
|
|
23516
|
+
const wrapRef = React76__namespace.useRef(null);
|
|
23517
|
+
const leftRef = React76__namespace.useRef(null);
|
|
23518
|
+
const moreMeasureRef = React76__namespace.useRef(null);
|
|
23519
|
+
const chipRefs = React76__namespace.useRef([]);
|
|
23352
23520
|
chipRefs.current = items.map((_2, i3) => {
|
|
23353
23521
|
var _a;
|
|
23354
23522
|
return (_a = chipRefs.current[i3]) != null ? _a : null;
|
|
23355
23523
|
});
|
|
23356
|
-
const [visibleCount, setVisibleCount] =
|
|
23357
|
-
const recomputeVisible =
|
|
23524
|
+
const [visibleCount, setVisibleCount] = React76__namespace.useState(() => items.length);
|
|
23525
|
+
const recomputeVisible = React76__namespace.useCallback(() => {
|
|
23358
23526
|
var _a, _b;
|
|
23359
23527
|
const leftEl = leftRef.current;
|
|
23360
23528
|
if (!leftEl) {
|
|
@@ -23403,10 +23571,10 @@ var ShadcnKeyValueVariant = React74__namespace.forwardRef(function ShadcnKeyValu
|
|
|
23403
23571
|
}
|
|
23404
23572
|
setVisibleCount(best);
|
|
23405
23573
|
}, [items.length]);
|
|
23406
|
-
|
|
23574
|
+
React76__namespace.useLayoutEffect(() => {
|
|
23407
23575
|
recomputeVisible();
|
|
23408
23576
|
}, [recomputeVisible, items, size, density, showValue]);
|
|
23409
|
-
|
|
23577
|
+
React76__namespace.useEffect(() => {
|
|
23410
23578
|
const el = leftRef.current;
|
|
23411
23579
|
if (!el) return;
|
|
23412
23580
|
const ro = new ResizeObserver(() => recomputeVisible());
|
|
@@ -23796,7 +23964,7 @@ var keyValueModule = {
|
|
|
23796
23964
|
label: ""
|
|
23797
23965
|
}
|
|
23798
23966
|
};
|
|
23799
|
-
var ShadcnCustomVariant =
|
|
23967
|
+
var ShadcnCustomVariant = React76__namespace.forwardRef(function ShadcnCustomVariant2(props, ref) {
|
|
23800
23968
|
const {
|
|
23801
23969
|
// Variant base props we care about:
|
|
23802
23970
|
value,
|
|
@@ -23832,7 +24000,7 @@ var ShadcnCustomVariant = React74__namespace.forwardRef(function ShadcnCustomVar
|
|
|
23832
24000
|
}
|
|
23833
24001
|
const isDisabled = !!disabled;
|
|
23834
24002
|
const isReadOnly = !!readOnly;
|
|
23835
|
-
const handleChange =
|
|
24003
|
+
const handleChange = React76__namespace.useCallback(
|
|
23836
24004
|
(...args) => {
|
|
23837
24005
|
var _a;
|
|
23838
24006
|
if (!onValue) return;
|
|
@@ -23937,7 +24105,7 @@ function triggerHeight3(size) {
|
|
|
23937
24105
|
return "min-h-9 text-sm";
|
|
23938
24106
|
}
|
|
23939
24107
|
}
|
|
23940
|
-
var ShadcnTreeSelectVariant =
|
|
24108
|
+
var ShadcnTreeSelectVariant = React76__namespace.forwardRef(function ShadcnTreeSelectVariant2(props, ref) {
|
|
23941
24109
|
const {
|
|
23942
24110
|
value,
|
|
23943
24111
|
onValue,
|
|
@@ -23997,14 +24165,14 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
23997
24165
|
selectedBadgeClassName,
|
|
23998
24166
|
selectedBadgePlacement = "corner"
|
|
23999
24167
|
} = props;
|
|
24000
|
-
const [open, setOpen] =
|
|
24001
|
-
const [query, setQuery] =
|
|
24168
|
+
const [open, setOpen] = React76__namespace.useState(false);
|
|
24169
|
+
const [query, setQuery] = React76__namespace.useState("");
|
|
24002
24170
|
const isDisabled = disabled || readOnly;
|
|
24003
|
-
const d =
|
|
24171
|
+
const d = React76__namespace.useMemo(
|
|
24004
24172
|
() => densityClasses(density),
|
|
24005
24173
|
[density]
|
|
24006
24174
|
);
|
|
24007
|
-
const tree =
|
|
24175
|
+
const tree = React76__namespace.useMemo(
|
|
24008
24176
|
() => normalizeTree(options != null ? options : [], {
|
|
24009
24177
|
autoCap,
|
|
24010
24178
|
optionLabel,
|
|
@@ -24039,8 +24207,8 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24039
24207
|
optionTagOnClick
|
|
24040
24208
|
]
|
|
24041
24209
|
);
|
|
24042
|
-
const allNodesFlat =
|
|
24043
|
-
const computedInitialExpanded =
|
|
24210
|
+
const allNodesFlat = React76__namespace.useMemo(() => flattenTree(tree), [tree]);
|
|
24211
|
+
const computedInitialExpanded = React76__namespace.useMemo(() => {
|
|
24044
24212
|
if (expandAll) {
|
|
24045
24213
|
return new Set(
|
|
24046
24214
|
allNodesFlat.filter((n3) => n3.hasChildren).map((n3) => n3.value)
|
|
@@ -24051,13 +24219,13 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24051
24219
|
}
|
|
24052
24220
|
return /* @__PURE__ */ new Set();
|
|
24053
24221
|
}, [expandAll, defaultExpandedValues, allNodesFlat]);
|
|
24054
|
-
const [expanded, setExpanded] =
|
|
24222
|
+
const [expanded, setExpanded] = React76__namespace.useState(
|
|
24055
24223
|
computedInitialExpanded
|
|
24056
24224
|
);
|
|
24057
|
-
|
|
24225
|
+
React76__namespace.useEffect(() => {
|
|
24058
24226
|
setExpanded(computedInitialExpanded);
|
|
24059
24227
|
}, [computedInitialExpanded]);
|
|
24060
|
-
const toggleExpanded =
|
|
24228
|
+
const toggleExpanded = React76__namespace.useCallback((key) => {
|
|
24061
24229
|
setExpanded((prev) => {
|
|
24062
24230
|
const next = new Set(prev);
|
|
24063
24231
|
if (next.has(key)) next.delete(key);
|
|
@@ -24065,7 +24233,7 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24065
24233
|
return next;
|
|
24066
24234
|
});
|
|
24067
24235
|
}, []);
|
|
24068
|
-
const displayedNodes =
|
|
24236
|
+
const displayedNodes = React76__namespace.useMemo(() => {
|
|
24069
24237
|
if (query) {
|
|
24070
24238
|
const q2 = query.toLowerCase();
|
|
24071
24239
|
const matchSet = /* @__PURE__ */ new Set();
|
|
@@ -24099,19 +24267,19 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24099
24267
|
displayedNodes.length * estimatedRowHeight
|
|
24100
24268
|
)
|
|
24101
24269
|
);
|
|
24102
|
-
const selectedValues =
|
|
24270
|
+
const selectedValues = React76__namespace.useMemo(() => {
|
|
24103
24271
|
if (value === void 0 || value === null) return [];
|
|
24104
24272
|
if (Array.isArray(value)) {
|
|
24105
24273
|
return multiple ? value : value.length ? [value[0]] : [];
|
|
24106
24274
|
}
|
|
24107
24275
|
return [value];
|
|
24108
24276
|
}, [value, multiple]);
|
|
24109
|
-
const selectedItems =
|
|
24277
|
+
const selectedItems = React76__namespace.useMemo(
|
|
24110
24278
|
() => allNodesFlat.filter((node) => selectedValues.includes(node.value)),
|
|
24111
24279
|
[allNodesFlat, selectedValues]
|
|
24112
24280
|
);
|
|
24113
24281
|
const selectedCount = selectedItems.length;
|
|
24114
|
-
const handleToggleValue =
|
|
24282
|
+
const handleToggleValue = React76__namespace.useCallback(
|
|
24115
24283
|
(item) => {
|
|
24116
24284
|
if (isDisabled) return;
|
|
24117
24285
|
if (leafOnly && item.hasChildren) {
|
|
@@ -24154,7 +24322,7 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24154
24322
|
allNodesFlat
|
|
24155
24323
|
]
|
|
24156
24324
|
);
|
|
24157
|
-
const handleClear =
|
|
24325
|
+
const handleClear = React76__namespace.useCallback(() => {
|
|
24158
24326
|
if (!onValue) return;
|
|
24159
24327
|
const detail = {
|
|
24160
24328
|
source: "variant",
|
|
@@ -24205,12 +24373,12 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24205
24373
|
) });
|
|
24206
24374
|
};
|
|
24207
24375
|
const triggerContent = renderValue ? renderValue({ selectedItems, placeholder }) : renderDefaultTriggerContent();
|
|
24376
|
+
const triggerPaddingClasses = cn("px-3", d.triggerPy);
|
|
24208
24377
|
const baseBoxClasses = cn(
|
|
24209
|
-
"flex items-center justify-between
|
|
24210
|
-
"placeholder:text-muted-foreground
|
|
24211
|
-
|
|
24212
|
-
"aria-invalid:border-destructive"
|
|
24213
|
-
d.triggerPy
|
|
24378
|
+
"flex items-center justify-between w-full min-w-0 text-sm ring-offset-background",
|
|
24379
|
+
"placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
24380
|
+
triggerPaddingClasses,
|
|
24381
|
+
hasControls && extendBoxToControls ? "border-none shadow-none focus:outline-none bg-transparent text-left" : "border-input rounded-md border bg-background shadow-xs focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 aria-invalid:border-destructive"
|
|
24214
24382
|
);
|
|
24215
24383
|
const DefaultTriggerButton = /* @__PURE__ */ jsxRuntime.jsx(
|
|
24216
24384
|
"button",
|
|
@@ -24220,7 +24388,7 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24220
24388
|
disabled: isDisabled,
|
|
24221
24389
|
className: cn(
|
|
24222
24390
|
triggerHeight3(size),
|
|
24223
|
-
|
|
24391
|
+
baseBoxClasses,
|
|
24224
24392
|
triggerClassName
|
|
24225
24393
|
),
|
|
24226
24394
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between gap-2 overflow-hidden", children: [
|
|
@@ -24262,7 +24430,7 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24262
24430
|
] })
|
|
24263
24431
|
}
|
|
24264
24432
|
);
|
|
24265
|
-
const ButtonModeTrigger =
|
|
24433
|
+
const ButtonModeTrigger = React76__namespace.useMemo(() => {
|
|
24266
24434
|
if (mode !== "button") return null;
|
|
24267
24435
|
const ctx = { open, selectedItems, selectedCount };
|
|
24268
24436
|
const triggerNode = typeof button === "function" ? button(ctx) : button != null ? button : typeof children === "function" ? children(ctx) : children;
|
|
@@ -24292,7 +24460,7 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24292
24460
|
badgeEl
|
|
24293
24461
|
] });
|
|
24294
24462
|
};
|
|
24295
|
-
if (
|
|
24463
|
+
if (React76__namespace.isValidElement(triggerNode)) {
|
|
24296
24464
|
return wrapWithBadge(triggerNode);
|
|
24297
24465
|
}
|
|
24298
24466
|
return wrapWithBadge(
|
|
@@ -24326,7 +24494,7 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24326
24494
|
emptyLabel && tree.length === 0 && !query && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-3 text-sm text-center text-muted-foreground", children: emptyLabel }),
|
|
24327
24495
|
tree.length > 0 && displayedNodes.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-3 text-sm text-center text-muted-foreground", children: emptySearchText != null ? emptySearchText : "No results found" }),
|
|
24328
24496
|
displayedNodes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
24329
|
-
|
|
24497
|
+
VirtualScroll,
|
|
24330
24498
|
{
|
|
24331
24499
|
style: { height: listHeight },
|
|
24332
24500
|
data: displayedNodes,
|
|
@@ -24421,7 +24589,7 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24421
24589
|
);
|
|
24422
24590
|
const renderer = (_b = item.render) != null ? _b : renderOption;
|
|
24423
24591
|
if (!renderer) {
|
|
24424
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
24592
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React76__namespace.Fragment, { children: optionNode }, item.key);
|
|
24425
24593
|
}
|
|
24426
24594
|
const rendered = renderer({
|
|
24427
24595
|
item,
|
|
@@ -24432,7 +24600,7 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
24432
24600
|
if (!item.disabled) handleToggleValue(item);
|
|
24433
24601
|
}
|
|
24434
24602
|
});
|
|
24435
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
24603
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React76__namespace.Fragment, { children: rendered }, item.key);
|
|
24436
24604
|
}
|
|
24437
24605
|
}
|
|
24438
24606
|
)
|
|
@@ -24549,7 +24717,26 @@ var treeselect_default = ShadcnTreeSelectVariant;
|
|
|
24549
24717
|
// src/variants/core/treeselect.tsx
|
|
24550
24718
|
var treeselectModule = {
|
|
24551
24719
|
variant: "treeselect",
|
|
24552
|
-
Variant: treeselect_default
|
|
24720
|
+
Variant: treeselect_default,
|
|
24721
|
+
// Layout defaults for this variant
|
|
24722
|
+
defaults: {
|
|
24723
|
+
layout: {
|
|
24724
|
+
labelPlacement: "top",
|
|
24725
|
+
sublabelPlacement: "right",
|
|
24726
|
+
descriptionPlacement: "below",
|
|
24727
|
+
helpTextPlacement: "below",
|
|
24728
|
+
errorTextPlacement: "below",
|
|
24729
|
+
inline: false,
|
|
24730
|
+
fullWidth: true,
|
|
24731
|
+
defaultSize: "md",
|
|
24732
|
+
defaultDensity: "comfortable"
|
|
24733
|
+
}
|
|
24734
|
+
},
|
|
24735
|
+
meta: {
|
|
24736
|
+
label: "TreeSelect",
|
|
24737
|
+
description: "Hierarchical tree selection dropdown with collapsible folders and node tags.",
|
|
24738
|
+
tags: ["tree", "select", "hierarchical", "dropdown", "multiselect"]
|
|
24739
|
+
}
|
|
24553
24740
|
};
|
|
24554
24741
|
var treeselect_default2 = treeselectModule;
|
|
24555
24742
|
function fileId() {
|
|
@@ -24704,8 +24891,8 @@ function mergeHandlers(a3, b2) {
|
|
|
24704
24891
|
};
|
|
24705
24892
|
}
|
|
24706
24893
|
var FileThumbnail = ({ item }) => {
|
|
24707
|
-
const [preview, setPreview] =
|
|
24708
|
-
|
|
24894
|
+
const [preview, setPreview] = React76__namespace.useState(null);
|
|
24895
|
+
React76__namespace.useEffect(() => {
|
|
24709
24896
|
var _a;
|
|
24710
24897
|
const isImage2 = ((_a = item.type) == null ? void 0 : _a.startsWith("image/")) || item.name.match(/\.(jpg|jpeg|png|gif|webp)$/i);
|
|
24711
24898
|
if (!isImage2) return;
|
|
@@ -24727,7 +24914,7 @@ var FileThumbnail = ({ item }) => {
|
|
|
24727
24914
|
}
|
|
24728
24915
|
) : /* @__PURE__ */ jsxRuntime.jsx(File2, { className: "h-4 w-4 text-muted-foreground/50" }) });
|
|
24729
24916
|
};
|
|
24730
|
-
var ShadcnFileVariant =
|
|
24917
|
+
var ShadcnFileVariant = React76__namespace.forwardRef(function ShadcnFileVariant2(props, ref) {
|
|
24731
24918
|
const {
|
|
24732
24919
|
value,
|
|
24733
24920
|
onValue,
|
|
@@ -24781,18 +24968,18 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
24781
24968
|
} = props;
|
|
24782
24969
|
const joinControls = mode === "default" ? joinControlsProp != null ? joinControlsProp : true : false;
|
|
24783
24970
|
const extendBoxToControls = mode === "default" ? extendBoxToControlsProp != null ? extendBoxToControlsProp : true : false;
|
|
24784
|
-
const items =
|
|
24971
|
+
const items = React76__namespace.useMemo(() => {
|
|
24785
24972
|
var _a;
|
|
24786
24973
|
const raw = (_a = toArray2(value)) != null ? _a : [];
|
|
24787
24974
|
return raw.map(normaliseFileLike);
|
|
24788
24975
|
}, [value]);
|
|
24789
24976
|
const isDisabled = Boolean(disabled || readOnly);
|
|
24790
|
-
const [dragOver, setDragOver] =
|
|
24791
|
-
const [selectedIds, setSelectedIds] =
|
|
24977
|
+
const [dragOver, setDragOver] = React76__namespace.useState(false);
|
|
24978
|
+
const [selectedIds, setSelectedIds] = React76__namespace.useState(
|
|
24792
24979
|
() => /* @__PURE__ */ new Set()
|
|
24793
24980
|
);
|
|
24794
|
-
const [popoverOpen, setPopoverOpen] =
|
|
24795
|
-
const fileInputRef =
|
|
24981
|
+
const [popoverOpen, setPopoverOpen] = React76__namespace.useState(false);
|
|
24982
|
+
const fileInputRef = React76__namespace.useRef(null);
|
|
24796
24983
|
const den = densityTokens(density);
|
|
24797
24984
|
const heightCls = triggerHeight4(size);
|
|
24798
24985
|
const chipHeightCls = chipHeight(size);
|
|
@@ -24801,7 +24988,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
24801
24988
|
const resolvedTrailingIcons = (trailingIcons == null ? void 0 : trailingIcons.length) ? trailingIcons : [];
|
|
24802
24989
|
const hasExternalControls = !!leadingControl || !!trailingControl;
|
|
24803
24990
|
const COLLAPSE_LIMIT = 2;
|
|
24804
|
-
const emitChange =
|
|
24991
|
+
const emitChange = React76__namespace.useCallback(
|
|
24805
24992
|
(nextItems, meta) => {
|
|
24806
24993
|
var _a;
|
|
24807
24994
|
const nextValues = nextItems.map(fileItemToValue);
|
|
@@ -24815,7 +25002,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
24815
25002
|
},
|
|
24816
25003
|
[multiple, onValue]
|
|
24817
25004
|
);
|
|
24818
|
-
const handleAddItems =
|
|
25005
|
+
const handleAddItems = React76__namespace.useCallback(
|
|
24819
25006
|
(incoming, from) => {
|
|
24820
25007
|
if (isDisabled) return;
|
|
24821
25008
|
let next = multiple ? [...items] : [];
|
|
@@ -24852,7 +25039,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
24852
25039
|
onFilesAdded
|
|
24853
25040
|
]
|
|
24854
25041
|
);
|
|
24855
|
-
const handleRemove =
|
|
25042
|
+
const handleRemove = React76__namespace.useCallback(
|
|
24856
25043
|
(id) => {
|
|
24857
25044
|
const next = items.filter((i3) => i3.id !== id);
|
|
24858
25045
|
emitChange(next, { action: "remove", id });
|
|
@@ -24864,7 +25051,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
24864
25051
|
},
|
|
24865
25052
|
[emitChange, items, selectedIds]
|
|
24866
25053
|
);
|
|
24867
|
-
const handleBulkRemove =
|
|
25054
|
+
const handleBulkRemove = React76__namespace.useCallback(() => {
|
|
24868
25055
|
const next = items.filter((i3) => !selectedIds.has(i3.id));
|
|
24869
25056
|
emitChange(next, {
|
|
24870
25057
|
action: "bulk-remove",
|
|
@@ -24872,7 +25059,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
24872
25059
|
});
|
|
24873
25060
|
setSelectedIds(/* @__PURE__ */ new Set());
|
|
24874
25061
|
}, [emitChange, items, selectedIds]);
|
|
24875
|
-
const openPicker =
|
|
25062
|
+
const openPicker = React76__namespace.useCallback(async () => {
|
|
24876
25063
|
var _a;
|
|
24877
25064
|
if (isDisabled) return;
|
|
24878
25065
|
let resolvedLoader = customLoader != null ? customLoader : custom && getPaletteUtil("customLoader");
|
|
@@ -24911,14 +25098,14 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
24911
25098
|
mergeMode,
|
|
24912
25099
|
multiple
|
|
24913
25100
|
]);
|
|
24914
|
-
const onDragOver =
|
|
25101
|
+
const onDragOver = React76__namespace.useCallback(
|
|
24915
25102
|
(e4) => {
|
|
24916
25103
|
e4.preventDefault();
|
|
24917
25104
|
if (!isDisabled) setDragOver(true);
|
|
24918
25105
|
},
|
|
24919
25106
|
[isDisabled]
|
|
24920
25107
|
);
|
|
24921
|
-
const onDrop =
|
|
25108
|
+
const onDrop = React76__namespace.useCallback(
|
|
24922
25109
|
(e4) => {
|
|
24923
25110
|
var _a;
|
|
24924
25111
|
e4.preventDefault();
|
|
@@ -24936,15 +25123,15 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
24936
25123
|
}
|
|
24937
25124
|
e4.target.value = "";
|
|
24938
25125
|
};
|
|
24939
|
-
const FileChip =
|
|
25126
|
+
const FileChip = React76__namespace.useCallback(
|
|
24940
25127
|
({
|
|
24941
25128
|
item,
|
|
24942
25129
|
condensed = false
|
|
24943
25130
|
}) => {
|
|
24944
25131
|
const name = formatFileName ? formatFileName(item) : item.name;
|
|
24945
|
-
const [preview, setPreview] =
|
|
24946
|
-
const [isOpen, setIsOpen] =
|
|
24947
|
-
|
|
25132
|
+
const [preview, setPreview] = React76__namespace.useState(null);
|
|
25133
|
+
const [isOpen, setIsOpen] = React76__namespace.useState(false);
|
|
25134
|
+
React76__namespace.useEffect(() => {
|
|
24948
25135
|
var _a;
|
|
24949
25136
|
const isImage2 = ((_a = item.type) == null ? void 0 : _a.startsWith("image/")) || item.name.match(/\.(jpg|jpeg|png|gif|webp)$/i);
|
|
24950
25137
|
if (!isImage2) {
|
|
@@ -25051,7 +25238,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
25051
25238
|
]
|
|
25052
25239
|
);
|
|
25053
25240
|
const selectedCount = items.length;
|
|
25054
|
-
const resolveButtonTriggerElement =
|
|
25241
|
+
const resolveButtonTriggerElement = React76__namespace.useCallback(() => {
|
|
25055
25242
|
const ctx = {
|
|
25056
25243
|
open: popoverOpen,
|
|
25057
25244
|
items,
|
|
@@ -25081,7 +25268,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
25081
25268
|
);
|
|
25082
25269
|
const child = el.props.children;
|
|
25083
25270
|
if (selectedBadgePlacement === "end") {
|
|
25084
|
-
return
|
|
25271
|
+
return React76__namespace.cloneElement(el, {
|
|
25085
25272
|
className: nextClass,
|
|
25086
25273
|
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
25087
25274
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0", children: child }),
|
|
@@ -25089,7 +25276,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
25089
25276
|
] })
|
|
25090
25277
|
});
|
|
25091
25278
|
}
|
|
25092
|
-
return
|
|
25279
|
+
return React76__namespace.cloneElement(el, {
|
|
25093
25280
|
className: nextClass,
|
|
25094
25281
|
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
25095
25282
|
child,
|
|
@@ -25097,7 +25284,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
25097
25284
|
] })
|
|
25098
25285
|
});
|
|
25099
25286
|
};
|
|
25100
|
-
const withDnD = (el) =>
|
|
25287
|
+
const withDnD = (el) => React76__namespace.cloneElement(el, {
|
|
25101
25288
|
onDragOver: mergeHandlers(
|
|
25102
25289
|
el.props.onDragOver,
|
|
25103
25290
|
onDragOver
|
|
@@ -25108,7 +25295,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
25108
25295
|
),
|
|
25109
25296
|
onDrop: mergeHandlers(el.props.onDrop, onDrop)
|
|
25110
25297
|
});
|
|
25111
|
-
if (
|
|
25298
|
+
if (React76__namespace.isValidElement(rawNode)) {
|
|
25112
25299
|
return withDnD(injectBadgeIntoElement(rawNode));
|
|
25113
25300
|
}
|
|
25114
25301
|
const fallback = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -25164,7 +25351,7 @@ var ShadcnFileVariant = React74__namespace.forwardRef(function ShadcnFileVariant
|
|
|
25164
25351
|
selectedCount,
|
|
25165
25352
|
triggerClassName
|
|
25166
25353
|
]);
|
|
25167
|
-
const TriggerRegion =
|
|
25354
|
+
const TriggerRegion = React76__namespace.useMemo(() => {
|
|
25168
25355
|
if (showDropArea) {
|
|
25169
25356
|
if (renderDropArea)
|
|
25170
25357
|
return renderDropArea({ openPicker, isDragging: dragOver });
|
|
@@ -25624,7 +25811,7 @@ var toggleVariants = cva(
|
|
|
25624
25811
|
}
|
|
25625
25812
|
}
|
|
25626
25813
|
);
|
|
25627
|
-
var ToggleGroupContext =
|
|
25814
|
+
var ToggleGroupContext = React76__namespace.createContext({
|
|
25628
25815
|
size: "default",
|
|
25629
25816
|
variant: "default",
|
|
25630
25817
|
spacing: 0
|
|
@@ -25661,7 +25848,7 @@ function ToggleGroupItem({
|
|
|
25661
25848
|
size,
|
|
25662
25849
|
...props
|
|
25663
25850
|
}) {
|
|
25664
|
-
const context =
|
|
25851
|
+
const context = React76__namespace.useContext(ToggleGroupContext);
|
|
25665
25852
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
25666
25853
|
ToggleGroupPrimitive__namespace.Item,
|
|
25667
25854
|
{
|
|
@@ -25852,7 +26039,7 @@ function normalizeOption(input, {
|
|
|
25852
26039
|
raw: input
|
|
25853
26040
|
};
|
|
25854
26041
|
}
|
|
25855
|
-
var ShadcnToggleVariant3 =
|
|
26042
|
+
var ShadcnToggleVariant3 = React76__namespace.forwardRef(function ShadcnToggleVariant4(props, ref) {
|
|
25856
26043
|
const {
|
|
25857
26044
|
value,
|
|
25858
26045
|
onValue,
|
|
@@ -25889,7 +26076,7 @@ var ShadcnToggleVariant3 = React74__namespace.forwardRef(function ShadcnToggleVa
|
|
|
25889
26076
|
const isDisabled = Boolean(disabled || readOnly);
|
|
25890
26077
|
const toggleSize = mapSizeToToggleSize(size);
|
|
25891
26078
|
const currentValue = normalizeValue(value, multiple);
|
|
25892
|
-
const normalizedOptions =
|
|
26079
|
+
const normalizedOptions = React76__namespace.useMemo(
|
|
25893
26080
|
() => options.map(
|
|
25894
26081
|
(opt) => normalizeOption(
|
|
25895
26082
|
opt,
|
|
@@ -25929,7 +26116,7 @@ var ShadcnToggleVariant3 = React74__namespace.forwardRef(function ShadcnToggleVa
|
|
|
25929
26116
|
autoCap
|
|
25930
26117
|
]
|
|
25931
26118
|
);
|
|
25932
|
-
const handleChange =
|
|
26119
|
+
const handleChange = React76__namespace.useCallback(
|
|
25933
26120
|
(val) => {
|
|
25934
26121
|
if (readOnly) return;
|
|
25935
26122
|
if (!onValue) return;
|
|
@@ -25966,7 +26153,7 @@ var ShadcnToggleVariant3 = React74__namespace.forwardRef(function ShadcnToggleVa
|
|
|
25966
26153
|
fullWidth && layout === "vertical" && "[&>*]:w-full",
|
|
25967
26154
|
className
|
|
25968
26155
|
);
|
|
25969
|
-
const groupStyle =
|
|
26156
|
+
const groupStyle = React76__namespace.useMemo(() => {
|
|
25970
26157
|
const style = {};
|
|
25971
26158
|
if (layout === "grid") {
|
|
25972
26159
|
style.gridTemplateColumns = `repeat(${gridCols}, minmax(0, 1fr))`;
|
|
@@ -26107,29 +26294,29 @@ function ShadcnEditorVariant(props) {
|
|
|
26107
26294
|
theme = "auto",
|
|
26108
26295
|
themeTarget = "nearest"
|
|
26109
26296
|
} = props;
|
|
26110
|
-
const mountRef =
|
|
26111
|
-
const editorRef =
|
|
26112
|
-
const formatRef =
|
|
26113
|
-
const onValueRef =
|
|
26114
|
-
const syncingRef =
|
|
26115
|
-
const loadedRef =
|
|
26116
|
-
const lastContentRef =
|
|
26117
|
-
const [autoDark, setAutoDark] =
|
|
26297
|
+
const mountRef = React76__namespace.useRef(null);
|
|
26298
|
+
const editorRef = React76__namespace.useRef(null);
|
|
26299
|
+
const formatRef = React76__namespace.useRef(format2);
|
|
26300
|
+
const onValueRef = React76__namespace.useRef(onValue);
|
|
26301
|
+
const syncingRef = React76__namespace.useRef(false);
|
|
26302
|
+
const loadedRef = React76__namespace.useRef(false);
|
|
26303
|
+
const lastContentRef = React76__namespace.useRef(value != null ? value : "");
|
|
26304
|
+
const [autoDark, setAutoDark] = React76__namespace.useState(false);
|
|
26118
26305
|
formatRef.current = format2;
|
|
26119
26306
|
onValueRef.current = onValue;
|
|
26120
26307
|
if (value !== void 0) lastContentRef.current = value;
|
|
26121
26308
|
const effectiveReadOnly = Boolean(disabled || readOnly);
|
|
26122
26309
|
const effectiveTheme = theme === "auto" ? autoDark ? "dark" : "light" : theme;
|
|
26123
|
-
const readContent =
|
|
26310
|
+
const readContent = React76__namespace.useCallback((ed) => {
|
|
26124
26311
|
var _a, _b;
|
|
26125
26312
|
return formatRef.current === "markdown" ? (_a = ed.getMarkdown()) != null ? _a : "" : (_b = ed.getHTML()) != null ? _b : "";
|
|
26126
26313
|
}, []);
|
|
26127
|
-
const emit =
|
|
26314
|
+
const emit = React76__namespace.useCallback((next) => {
|
|
26128
26315
|
var _a;
|
|
26129
26316
|
const detail = { source: "user", raw: next };
|
|
26130
26317
|
(_a = onValueRef.current) == null ? void 0 : _a.call(onValueRef, next, detail);
|
|
26131
26318
|
}, []);
|
|
26132
|
-
const structuralKey =
|
|
26319
|
+
const structuralKey = React76__namespace.useMemo(() => {
|
|
26133
26320
|
const hideModeSwitch = toolbar === "none" || pastePlainText;
|
|
26134
26321
|
return JSON.stringify({
|
|
26135
26322
|
toolbar,
|
|
@@ -26138,7 +26325,7 @@ function ShadcnEditorVariant(props) {
|
|
|
26138
26325
|
effectiveTheme
|
|
26139
26326
|
});
|
|
26140
26327
|
}, [toolbar, useCommandShortcut, pastePlainText, effectiveTheme]);
|
|
26141
|
-
|
|
26328
|
+
React76__namespace.useEffect(() => {
|
|
26142
26329
|
if (theme !== "auto") return;
|
|
26143
26330
|
if (typeof document === "undefined") return;
|
|
26144
26331
|
const host = mountRef.current;
|
|
@@ -26163,7 +26350,7 @@ function ShadcnEditorVariant(props) {
|
|
|
26163
26350
|
}
|
|
26164
26351
|
return () => observer.disconnect();
|
|
26165
26352
|
}, [theme, themeTarget]);
|
|
26166
|
-
|
|
26353
|
+
React76__namespace.useEffect(() => {
|
|
26167
26354
|
var _a;
|
|
26168
26355
|
const el = mountRef.current;
|
|
26169
26356
|
if (!el) return;
|
|
@@ -26234,29 +26421,29 @@ function ShadcnEditorVariant(props) {
|
|
|
26234
26421
|
editorRef.current = null;
|
|
26235
26422
|
};
|
|
26236
26423
|
}, [structuralKey]);
|
|
26237
|
-
|
|
26424
|
+
React76__namespace.useEffect(() => {
|
|
26238
26425
|
const ed = editorRef.current;
|
|
26239
26426
|
if (!ed) return;
|
|
26240
26427
|
if (typeof ed.setHeight === "function") ed.setHeight(height);
|
|
26241
26428
|
}, [height]);
|
|
26242
|
-
|
|
26429
|
+
React76__namespace.useEffect(() => {
|
|
26243
26430
|
const ed = editorRef.current;
|
|
26244
26431
|
if (!ed) return;
|
|
26245
26432
|
if (typeof ed.setPlaceholder === "function")
|
|
26246
26433
|
ed.setPlaceholder(placeholder);
|
|
26247
26434
|
}, [placeholder]);
|
|
26248
|
-
|
|
26435
|
+
React76__namespace.useEffect(() => {
|
|
26249
26436
|
const ed = editorRef.current;
|
|
26250
26437
|
if (!ed) return;
|
|
26251
26438
|
if (typeof ed.changeMode === "function") ed.changeMode(editType);
|
|
26252
26439
|
}, [editType]);
|
|
26253
|
-
|
|
26440
|
+
React76__namespace.useEffect(() => {
|
|
26254
26441
|
const ed = editorRef.current;
|
|
26255
26442
|
if (!ed) return;
|
|
26256
26443
|
if (typeof ed.changePreviewStyle === "function")
|
|
26257
26444
|
ed.changePreviewStyle(previewStyle);
|
|
26258
26445
|
}, [previewStyle]);
|
|
26259
|
-
|
|
26446
|
+
React76__namespace.useEffect(() => {
|
|
26260
26447
|
var _a, _b, _c, _d;
|
|
26261
26448
|
const ed = editorRef.current;
|
|
26262
26449
|
if (!ed) return;
|
|
@@ -26274,7 +26461,7 @@ function ShadcnEditorVariant(props) {
|
|
|
26274
26461
|
syncingRef.current = false;
|
|
26275
26462
|
});
|
|
26276
26463
|
}, [value, format2]);
|
|
26277
|
-
|
|
26464
|
+
React76__namespace.useEffect(() => {
|
|
26278
26465
|
if (!pastePlainText) return;
|
|
26279
26466
|
const host = mountRef.current;
|
|
26280
26467
|
if (!host) return;
|
|
@@ -26758,10 +26945,10 @@ function JsonEditorMain(props) {
|
|
|
26758
26945
|
className,
|
|
26759
26946
|
contentClassName
|
|
26760
26947
|
} = props;
|
|
26761
|
-
const directChildPaths =
|
|
26948
|
+
const directChildPaths = React76__namespace.useMemo(() => {
|
|
26762
26949
|
return getDirectChildPaths(route, allPaths);
|
|
26763
26950
|
}, [route, allPaths]);
|
|
26764
|
-
const rows =
|
|
26951
|
+
const rows = React76__namespace.useMemo(() => {
|
|
26765
26952
|
return resolveLayoutForParent({
|
|
26766
26953
|
parent: route,
|
|
26767
26954
|
childPaths: directChildPaths,
|
|
@@ -26769,7 +26956,7 @@ function JsonEditorMain(props) {
|
|
|
26769
26956
|
filters
|
|
26770
26957
|
});
|
|
26771
26958
|
}, [route, directChildPaths, layout, filters]);
|
|
26772
|
-
const effectiveRows =
|
|
26959
|
+
const effectiveRows = React76__namespace.useMemo(() => {
|
|
26773
26960
|
const hasAny = rows.some((r5) => {
|
|
26774
26961
|
var _a;
|
|
26775
26962
|
return (_a = r5.fields) == null ? void 0 : _a.length;
|
|
@@ -27293,12 +27480,12 @@ var T = (e4) => {
|
|
|
27293
27480
|
};
|
|
27294
27481
|
var x = "__\u200Bundefined__";
|
|
27295
27482
|
var A = { displayName: "Default", fragments: { edit: "rgb(42, 161, 152)" }, styles: { container: { backgroundColor: "#f6f6f6", fontFamily: "monospace" }, collection: {}, collectionInner: {}, collectionElement: {}, dropZone: {}, property: "#292929", bracket: { color: "rgb(0, 43, 54)", fontWeight: "bold" }, itemCount: { color: "rgba(0, 0, 0, 0.3)", fontStyle: "italic" }, string: "rgb(203, 75, 22)", number: "rgb(38, 139, 210)", boolean: "green", null: { color: "rgb(220, 50, 47)", fontVariant: "small-caps", fontWeight: "bold" }, input: ["#292929"], inputHighlight: "#b3d8ff", error: { fontSize: "0.8em", color: "red", fontWeight: "bold" }, iconCollection: "rgb(0, 43, 54)", iconEdit: "edit", iconDelete: "rgb(203, 75, 22)", iconAdd: "edit", iconCopy: "rgb(38, 139, 210)", iconOk: "green", iconCancel: "rgb(203, 75, 22)" } };
|
|
27296
|
-
var P =
|
|
27483
|
+
var P = React76.createContext({ getStyles: () => ({}), icons: {} });
|
|
27297
27484
|
var R = ({ theme: e4 = A, icons: n3 = {}, docRoot: r5, children: o3 }) => {
|
|
27298
27485
|
const i3 = I(e4, r5);
|
|
27299
27486
|
return jsxRuntime.jsx(P.Provider, { value: { getStyles: (e5, t4) => "function" == typeof i3[e5] ? i3[e5](t4) : i3[e5], icons: n3 }, children: o3 });
|
|
27300
27487
|
};
|
|
27301
|
-
var K = () =>
|
|
27488
|
+
var K = () => React76.useContext(P);
|
|
27302
27489
|
var I = (e4, t4) => {
|
|
27303
27490
|
var n3, r5, o3, i3;
|
|
27304
27491
|
const a3 = {}, l2 = (Array.isArray(e4) ? e4 : [e4]).map(((e5) => _(e5) ? V({ fragments: {}, styles: e5 }, a3) : V(e5, a3))), s3 = V(A, {});
|
|
@@ -27334,9 +27521,9 @@ var V = (e4, t4) => {
|
|
|
27334
27521
|
};
|
|
27335
27522
|
var _ = (e4) => !("styles" in e4);
|
|
27336
27523
|
var F = { container: "backgroundColor", collection: "backgroundColor", collectionInner: "backgroundColor", collectionElement: "backgroundColor", dropZone: "borderColor", inputHighlight: "backgroundColor" };
|
|
27337
|
-
var L =
|
|
27524
|
+
var L = React76.createContext(null);
|
|
27338
27525
|
var z = ({ children: e4, onEditEvent: n3, onCollapse: r5 }) => {
|
|
27339
|
-
const [o3, l2] =
|
|
27526
|
+
const [o3, l2] = React76.useState(null), [s3, c2] = React76.useState(null), [d, u] = React76.useState(null), [p2, g2] = React76.useState({ path: null, pathString: null }), m2 = React76.useRef(null), h2 = React76.useRef("next"), y2 = React76.useRef(null);
|
|
27340
27527
|
return jsxRuntime.jsx(L.Provider, { value: { collapseState: o3, setCollapseState: (e5) => {
|
|
27341
27528
|
l2(e5), r5 && null !== e5 && (Array.isArray(e5) ? e5.forEach(((e6) => r5(e6))) : r5(e5)), null !== e5 && setTimeout((() => l2(null)), 2e3);
|
|
27342
27529
|
}, getMatchingCollapseState: (e5) => {
|
|
@@ -27355,7 +27542,7 @@ var z = ({ children: e4, onEditEvent: n3, onCollapse: r5 }) => {
|
|
|
27355
27542
|
}, previousValue: d, setPreviousValue: u, dragSource: p2, setDragSource: g2 }, children: e4 });
|
|
27356
27543
|
};
|
|
27357
27544
|
var M = () => {
|
|
27358
|
-
const e4 =
|
|
27545
|
+
const e4 = React76.useContext(L);
|
|
27359
27546
|
if (!e4) throw new Error("Missing Context Provider");
|
|
27360
27547
|
return e4;
|
|
27361
27548
|
};
|
|
@@ -27367,7 +27554,7 @@ var B = (e4, t4) => {
|
|
|
27367
27554
|
};
|
|
27368
27555
|
var W = "**INVALID_FUNCTION**";
|
|
27369
27556
|
var G = ({ nodeData: r5, showStringQuotes: o3 = true, stringTruncate: a3 = 200, pathString: l2, canEdit: s3, setIsEditing: c2, styles: d, translate: u, value: p2, TextWrapper: g2 = ({ children: e4 }) => e4 }) => {
|
|
27370
|
-
const m2 = null != p2 ? p2 : r5.value, [h2, y2] =
|
|
27557
|
+
const m2 = null != p2 ? p2 : r5.value, [h2, y2] = React76.useState(false), f2 = o3 ? '"' : "", b2 = m2.length > a3, v2 = () => {
|
|
27371
27558
|
s3 ? c2(true) : y2(!h2);
|
|
27372
27559
|
};
|
|
27373
27560
|
return jsxRuntime.jsxs("div", { id: `${l2}_display`, onDoubleClick: v2, onClick: (e4) => {
|
|
@@ -27375,7 +27562,7 @@ var G = ({ nodeData: r5, showStringQuotes: o3 = true, stringTruncate: a3 = 200,
|
|
|
27375
27562
|
}, className: "jer-value-string", style: d, children: [f2, b2 ? jsxRuntime.jsxs(jsxRuntime.Fragment, h2 ? { children: [jsxRuntime.jsx(g2, { children: jsxRuntime.jsxs("span", { children: [m2, f2] }) }), jsxRuntime.jsxs("span", { className: "jer-string-expansion jer-show-less", onClick: () => y2(false), children: [" ", u("SHOW_LESS", r5)] })] } : { children: [jsxRuntime.jsxs(g2, { children: [jsxRuntime.jsx("span", { children: m2.slice(0, a3 - 2).trimEnd() }), " "] }), jsxRuntime.jsx("span", { className: "jer-string-expansion jer-ellipsis", onClick: () => y2(true), children: "..." }), f2] }) : jsxRuntime.jsx(g2, { children: `${m2}${f2}` })] });
|
|
27376
27563
|
};
|
|
27377
27564
|
var Y = ({ styles: e4, pathString: n3, value: r5, setValue: o3, handleEdit: i3, handleKeyboard: l2, keyboardCommon: s3 }) => {
|
|
27378
|
-
const c2 =
|
|
27565
|
+
const c2 = React76.useRef(null);
|
|
27379
27566
|
return jsxRuntime.jsx(m, { className: "jer-input-text", textAreaRef: c2, name: n3, value: r5, setValue: o3, handleKeyPress: (e5) => {
|
|
27380
27567
|
l2(e5, Object.assign({ stringConfirm: i3, stringLineBreak: () => {
|
|
27381
27568
|
const e6 = N(c2, "\n");
|
|
@@ -27401,14 +27588,14 @@ var $ = ({ value: e4, setValue: n3, isEditing: r5, path: o3, setIsEditing: i3, h
|
|
|
27401
27588
|
}, autoFocus: true }) : jsxRuntime.jsx("span", { onDoubleClick: () => i3(true), className: "jer-value-boolean", style: d("boolean", l2), children: String(e4) });
|
|
27402
27589
|
};
|
|
27403
27590
|
var Z = (e4, t4) => {
|
|
27404
|
-
const n3 =
|
|
27405
|
-
|
|
27591
|
+
const n3 = React76.useRef(void 0), r5 = React76.useRef(t4);
|
|
27592
|
+
React76.useEffect((() => {
|
|
27406
27593
|
r5.current = t4;
|
|
27407
27594
|
}), [t4]);
|
|
27408
27595
|
const o3 = (e5) => {
|
|
27409
27596
|
r5.current(e5);
|
|
27410
27597
|
};
|
|
27411
|
-
|
|
27598
|
+
React76.useEffect((() => {
|
|
27412
27599
|
if (window.clearTimeout(n3.current), e4) return n3.current = window.setTimeout((() => {
|
|
27413
27600
|
window.addEventListener("keydown", o3);
|
|
27414
27601
|
}), 100), () => {
|
|
@@ -27464,7 +27651,7 @@ var ie = ({ name: e4, nodeData: r5 }) => {
|
|
|
27464
27651
|
}
|
|
27465
27652
|
};
|
|
27466
27653
|
var ae = ({ startEdit: r5, handleDelete: o3, handleAdd: a3, enableClipboard: l2, type: s3, customButtons: c2, nodeData: d, translate: p2, keyboardControls: g2, handleKeyboard: m2, editConfirmRef: h2, getNewKeyOptions: y2, jsonStringify: f2, onEditEvent: b2, showIconTooltips: v2 }) => {
|
|
27467
|
-
const { getStyles: j2 } = K(), w2 = p2("KEY_NEW", d), [D2, C2] =
|
|
27654
|
+
const { getStyles: j2 } = K(), w2 = p2("KEY_NEW", d), [D2, C2] = React76.useState(w2), [O2, k2] = React76.useState(false), { key: S2, path: N2, value: T2 } = d, x2 = Array.isArray(O2), A2 = (e4) => {
|
|
27468
27655
|
var t4;
|
|
27469
27656
|
if (b2 && b2(e4 ? [...N2, null] : null, e4), !e4) return void k2(false);
|
|
27470
27657
|
const n3 = Object.keys(r3(d.fullData, N2)), r6 = y2 ? null === (t4 = y2(d)) || void 0 === t4 ? void 0 : t4.filter(((e5) => !n3.includes(e5))) : null;
|
|
@@ -27505,9 +27692,9 @@ var le = ({ onOk: n3, onCancel: r5, nodeData: o3, editConfirmRef: i3, hideOk: a3
|
|
|
27505
27692
|
var se = (e4) => e4.reduce(((e5, t4) => "number" == typeof t4 ? `${e5}[${t4}]` : "" === e5 ? t4 : `${e5}.${t4}`), "");
|
|
27506
27693
|
var ce = ["string", "number", "boolean", "null", "object", "array"];
|
|
27507
27694
|
var de = ({ props: e4, collapsed: t4 }) => {
|
|
27508
|
-
const { data: n3, nodeData: r5, parentData: o3, onEdit: a3, onError: l2, showErrorMessages: c2, restrictEditFilter: d, restrictDeleteFilter: u, restrictAddFilter: p2, restrictDragFilter: g2, translate: m2, errorMessageTimeout: h2 } = e4, { currentlyEditingElement: y2, setCurrentlyEditingElement: f2 } = M(), [b2, v2] =
|
|
27695
|
+
const { data: n3, nodeData: r5, parentData: o3, onEdit: a3, onError: l2, showErrorMessages: c2, restrictEditFilter: d, restrictDeleteFilter: u, restrictAddFilter: p2, restrictDragFilter: g2, translate: m2, errorMessageTimeout: h2 } = e4, { currentlyEditingElement: y2, setCurrentlyEditingElement: f2 } = M(), [b2, v2] = React76.useState(null), E2 = Object.assign(Object.assign({}, r5), { collapsed: t4 }), { path: w2, key: D2, size: C2 } = E2, O2 = j(w2), k2 = !d(E2), S2 = !u(E2), N2 = !p2(E2), T2 = !g2(E2) && S2 && null === y2, x2 = (e5) => {
|
|
27509
27696
|
c2 && (v2(e5), setTimeout((() => v2(null)), h2)), console.warn("Error", e5);
|
|
27510
|
-
}, A2 =
|
|
27697
|
+
}, A2 = React76.useCallback(((e5, t5) => {
|
|
27511
27698
|
x2(e5.message), l2 && l2({ currentData: E2.fullData, errorValue: t5, currentValue: n3, name: D2, path: w2, error: e5 });
|
|
27512
27699
|
}), [l2, c2]), P2 = y2 === O2, R2 = y2 === `key_${O2}`, K2 = "number" == typeof w2.slice(-1)[0], I2 = { isEditing: P2, isEditingKey: R2, isArray: K2, canEditKey: null !== o3 && k2 && N2 && S2 && !K2 }, V2 = "" === D2 && w2.length > 0 ? m2("EMPTY_STRING", E2) : null;
|
|
27513
27700
|
return { pathString: O2, nodeData: E2, path: w2, name: D2, size: C2, canEdit: k2, canDelete: S2, canAdd: N2, canDrag: T2, error: b2, showError: x2, onError: A2, setError: v2, handleEditKey: (e5) => {
|
|
@@ -27522,11 +27709,11 @@ var de = ({ props: e4, collapsed: t4 }) => {
|
|
|
27522
27709
|
}, derivedValues: I2, emptyStringKey: V2 };
|
|
27523
27710
|
};
|
|
27524
27711
|
var ue = ({ canDrag: e4, canDragOnto: n3, path: r5, nodeData: o3, onMove: a3, onError: l2, translate: s3 }) => {
|
|
27525
|
-
const { getStyles: d } = K(), { dragSource: u, setDragSource: p2 } = M(), [g2, m2] =
|
|
27712
|
+
const { getStyles: d } = K(), { dragSource: u, setDragSource: p2 } = M(), [g2, m2] = React76.useState(false), h2 = j(r5), y2 = React76.useMemo((() => e4 ? { onDragStart: (e5) => {
|
|
27526
27713
|
e5.stopPropagation(), p2({ path: r5, pathString: h2 });
|
|
27527
27714
|
}, onDragEnd: (e5) => {
|
|
27528
27715
|
e5.stopPropagation(), p2({ path: null, pathString: null });
|
|
27529
|
-
} } : {}), [e4, h2]), f2 =
|
|
27716
|
+
} } : {}), [e4, h2]), f2 = React76.useMemo((() => (e5) => n3 ? { onDragOver: (e6) => {
|
|
27530
27717
|
e6.stopPropagation(), e6.preventDefault();
|
|
27531
27718
|
}, onDrop: (t4) => {
|
|
27532
27719
|
t4.stopPropagation(), v2(e5), p2({ path: null, pathString: null }), m2(false);
|
|
@@ -27535,7 +27722,7 @@ var ue = ({ canDrag: e4, canDragOnto: n3, path: r5, nodeData: o3, onMove: a3, on
|
|
|
27535
27722
|
t4.stopPropagation(), h2.startsWith(null !== (n4 = u.pathString) && void 0 !== n4 ? n4 : "") || m2(e5);
|
|
27536
27723
|
}, onDragExit: (e6) => {
|
|
27537
27724
|
e6.stopPropagation(), m2(false);
|
|
27538
|
-
} } : {}), [u, n3, h2]), b2 =
|
|
27725
|
+
} } : {}), [u, n3, h2]), b2 = React76.useMemo((() => n3 && null !== u.pathString ? jsxRuntime.jsx("div", Object.assign({ className: "jer-drop-target-bottom", style: { height: "50%", position: "absolute", width: "100%", top: "50%", zIndex: r5.length } }, f2("below"))) : null), [u, n3, r5.length]), v2 = (e5) => {
|
|
27539
27726
|
var t4, n4;
|
|
27540
27727
|
const i3 = null === (t4 = u.path) || void 0 === t4 ? void 0 : t4.slice(-1)[0], c2 = null === (n4 = u.path) || void 0 === n4 ? void 0 : n4.slice(0, -1).join("."), d2 = r5.slice(0, -1).join(""), { parentData: p3 } = o3;
|
|
27541
27728
|
"string" == typeof i3 && p3 && !Array.isArray(p3) && Object.keys(p3).includes(i3) && i3 in p3 && c2 !== d2 ? l2({ code: "KEY_EXISTS", message: s3("ERROR_KEY_EXISTS", o3) }, i3) : a3(u.path, r5, e5).then(((e6) => {
|
|
@@ -27562,20 +27749,20 @@ var ge = ({ isEditingKey: n3, canEditKey: r5, pathString: o3, path: i3, name: a3
|
|
|
27562
27749
|
} }), style: { width: f2.length / 1.5 + 0.5 + "em" } }) : jsxRuntime.jsxs("span", { className: "jer-key-text", style: Object.assign(Object.assign({}, g2), { minWidth: `${Math.min(f2.length + 1, 5)}ch`, flexShrink: f2.length > 10 ? 1 : 0 }), onDoubleClick: () => r5 && y2(i3, "key"), onClick: u, children: [h2 ? jsxRuntime.jsx("span", { className: "jer-empty-string", children: h2 }) : f2, "" !== f2 || h2 ? jsxRuntime.jsx("span", { className: "jer-key-colon", children: ":" }) : null] });
|
|
27563
27750
|
};
|
|
27564
27751
|
var me = (n3) => {
|
|
27565
|
-
const { data: r5, parentData: o3, onEdit: a3, onDelete: d, onChange: u, onMove: p2, enableClipboard: g2, canDragOnto: m2, restrictTypeSelection: h2, searchFilter: f2, searchText: b2, showLabel: v2, stringTruncate: j2, showStringQuotes: E2, arrayIndexFromOne: w2, indent: D2, translate: C2, customNodeDefinitions: k2, customNodeData: S2, handleKeyboard: N2, keyboardControls: T2, sort: x2, editConfirmRef: A2, jsonStringify: P2, showIconTooltips: R2 } = n3, { getStyles: I2 } = K(), { setCurrentlyEditingElement: V2, setCollapseState: _2, previouslyEditedElement: F2, setPreviouslyEditedElement: L2, tabDirection: z2, setTabDirection: B2, previousValue: G2, setPreviousValue: Y2 } = M(), [H2, U2] =
|
|
27752
|
+
const { data: r5, parentData: o3, onEdit: a3, onDelete: d, onChange: u, onMove: p2, enableClipboard: g2, canDragOnto: m2, restrictTypeSelection: h2, searchFilter: f2, searchText: b2, showLabel: v2, stringTruncate: j2, showStringQuotes: E2, arrayIndexFromOne: w2, indent: D2, translate: C2, customNodeDefinitions: k2, customNodeData: S2, handleKeyboard: N2, keyboardControls: T2, sort: x2, editConfirmRef: A2, jsonStringify: P2, showIconTooltips: R2 } = n3, { getStyles: I2 } = K(), { setCurrentlyEditingElement: V2, setCollapseState: _2, previouslyEditedElement: F2, setPreviouslyEditedElement: L2, tabDirection: z2, setTabDirection: B2, previousValue: G2, setPreviousValue: Y2 } = M(), [H2, U2] = React76.useState("function" == typeof r5 ? W : r5), { pathString: $2, nodeData: Z2, path: X3, name: J2, canEdit: Q2, canDelete: q2, canDrag: ee2, error: te2, onError: ne2, handleEditKey: re3, emptyStringKey: oe2, derivedValues: ie2 } = de({ props: n3 }), { dragSourceProps: se2, getDropTargetProps: pe2, BottomDropTarget: me2, DropTargetPadding: be2 } = ue({ canDrag: ee2, canDragOnto: m2, path: X3, nodeData: Z2, onMove: p2, onError: ne2, translate: C2 }), [ve2, je2] = React76.useState(he(r5, S2)), Ee2 = React76.useCallback(((e4) => {
|
|
27566
27753
|
if (!u) return void U2(e4);
|
|
27567
27754
|
const t4 = u({ currentData: Z2.fullData, newValue: e4, currentValue: H2, name: J2, path: X3 });
|
|
27568
27755
|
U2(t4);
|
|
27569
27756
|
}), [u]);
|
|
27570
|
-
|
|
27757
|
+
React76.useEffect((() => {
|
|
27571
27758
|
U2("function" == typeof r5 ? W : r5), je2(he(r5, S2));
|
|
27572
27759
|
}), [r5, te2]);
|
|
27573
|
-
const { CustomNode: we2, customNodeProps: De2, hideKey: Ce2, showEditTools: Oe2 = true, showOnEdit: ke2, showOnView: Se2, passOriginalNode: Ne2 } = S2, Te2 = [...ce, ...k2.filter((({ showInTypesSelector: e4 = false, name: t4 }) => e4 && !!t4)).map((({ name: e4 }) => e4))], xe2 =
|
|
27760
|
+
const { CustomNode: we2, customNodeProps: De2, hideKey: Ce2, showEditTools: Oe2 = true, showOnEdit: ke2, showOnView: Se2, passOriginalNode: Ne2 } = S2, Te2 = [...ce, ...k2.filter((({ showInTypesSelector: e4 = false, name: t4 }) => e4 && !!t4)).map((({ name: e4 }) => e4))], xe2 = React76.useMemo((() => {
|
|
27574
27761
|
if ("boolean" == typeof h2) return h2 ? [] : Te2;
|
|
27575
27762
|
if (Array.isArray(h2)) return h2;
|
|
27576
27763
|
const e4 = h2(Z2);
|
|
27577
27764
|
return "boolean" == typeof e4 ? e4 ? [] : Te2 : e4;
|
|
27578
|
-
}), [Z2, h2]), [Ae, Pe] =
|
|
27765
|
+
}), [Z2, h2]), [Ae, Pe] = React76.useState(((e4, t4) => {
|
|
27579
27766
|
var n4;
|
|
27580
27767
|
if ("string" != typeof e4) return null;
|
|
27581
27768
|
const r6 = t4.filter(((t5) => t5 instanceof Object && t5.enum && t5.values.includes(e4) && t5.matchPriority));
|
|
@@ -27684,8 +27871,8 @@ var be = (e4 = [], t4) => {
|
|
|
27684
27871
|
return Object.assign({ CustomNode: o3, CustomWrapper: i3, customNodeProps: a3, wrapperProps: l2, hideKey: s3, showEditTools: c2, showOnEdit: d, showOnView: u, showCollectionWrapper: g2 }, m2);
|
|
27685
27872
|
};
|
|
27686
27873
|
var ve = (r5) => {
|
|
27687
|
-
const { getStyles: o3 } = K(), { collapseState: c2, setCollapseState: d, getMatchingCollapseState: u, currentlyEditingElement: p2, setCurrentlyEditingElement: f2, areChildrenBeingEdited: b2, previousValue: v2, setPreviousValue: j2 } = M(), { mainContainerRef: w2, data: D2, nodeData: C2, parentData: k2, showCollectionCount: S2, onEdit: T2, onAdd: x2, onDelete: A2, canDragOnto: P2, collapseFilter: R2, collapseAnimationTime: I2, onMove: V2, enableClipboard: _2, onEditEvent: F2, showIconTooltips: L2, searchFilter: z2, searchText: B2, indent: W2, sort: G2, showArrayIndices: Y2, arrayIndexFromOne: H2, defaultValue: U2, newKeyOptions: $2, translate: Z2, customNodeDefinitions: X3, customNodeData: J2, jsonParse: Q2, jsonStringify: q2, TextEditor: ee2, keyboardControls: te2, handleKeyboard: ne2, insertAtTop: re3, onCollapse: oe2, editConfirmRef: se2, collapseClickZones: ce2 } = r5, [he2, ye2] =
|
|
27688
|
-
const [l2, c3] =
|
|
27874
|
+
const { getStyles: o3 } = K(), { collapseState: c2, setCollapseState: d, getMatchingCollapseState: u, currentlyEditingElement: p2, setCurrentlyEditingElement: f2, areChildrenBeingEdited: b2, previousValue: v2, setPreviousValue: j2 } = M(), { mainContainerRef: w2, data: D2, nodeData: C2, parentData: k2, showCollectionCount: S2, onEdit: T2, onAdd: x2, onDelete: A2, canDragOnto: P2, collapseFilter: R2, collapseAnimationTime: I2, onMove: V2, enableClipboard: _2, onEditEvent: F2, showIconTooltips: L2, searchFilter: z2, searchText: B2, indent: W2, sort: G2, showArrayIndices: Y2, arrayIndexFromOne: H2, defaultValue: U2, newKeyOptions: $2, translate: Z2, customNodeDefinitions: X3, customNodeData: J2, jsonParse: Q2, jsonStringify: q2, TextEditor: ee2, keyboardControls: te2, handleKeyboard: ne2, insertAtTop: re3, onCollapse: oe2, editConfirmRef: se2, collapseClickZones: ce2 } = r5, [he2, ye2] = React76.useState(q2(D2)), fe2 = R2(C2), { contentRef: je2, isAnimating: Ee2, maxHeight: we2, collapsed: De2, animateCollapse: Ce2, cssTransitionValue: Oe2 } = ((e4, t4, n3, r6, o4) => {
|
|
27875
|
+
const [l2, c3] = React76.useState(n3 ? 0 : void 0), [d2, u2] = React76.useState(n3), p3 = React76.useRef(false), g2 = React76.useRef(null), m2 = React76.useRef(0), h2 = React76.useRef(0), y2 = t4 / 1e3 + "s", f3 = React76.useCallback(((n4) => {
|
|
27689
27876
|
var i3, a3;
|
|
27690
27877
|
if (d2 !== n4) {
|
|
27691
27878
|
switch (window.clearTimeout(h2.current), p3.current = true, n4) {
|
|
@@ -27705,23 +27892,23 @@ var ve = (r5) => {
|
|
|
27705
27892
|
}
|
|
27706
27893
|
}), [t4, d2, e4, r6, o4]);
|
|
27707
27894
|
return { contentRef: g2, isAnimating: p3.current, animateCollapse: f3, maxHeight: l2, collapsed: d2, cssTransitionValue: y2 };
|
|
27708
|
-
})(D2, I2, fe2, w2, q2), { pathString: ke2, nodeData: Se2, path: Ne2, name: Te2, size: xe2, canEdit: Ae, canDelete: Pe, canAdd: Re, canDrag: Ke, error: Ie, setError: Ve, onError: _e, handleEditKey: Fe, emptyStringKey: Le, derivedValues: ze } = de({ props: r5, collapsed: De2 }), { dragSourceProps: Me, getDropTargetProps: Be, BottomDropTarget: We, DropTargetPadding: Ge } = ue({ canDrag: Ke, canDragOnto: P2, path: Ne2, nodeData: Se2, onMove: V2, onError: _e, translate: Z2 }), Ye =
|
|
27709
|
-
|
|
27895
|
+
})(D2, I2, fe2, w2, q2), { pathString: ke2, nodeData: Se2, path: Ne2, name: Te2, size: xe2, canEdit: Ae, canDelete: Pe, canAdd: Re, canDrag: Ke, error: Ie, setError: Ve, onError: _e, handleEditKey: Fe, emptyStringKey: Le, derivedValues: ze } = de({ props: r5, collapsed: De2 }), { dragSourceProps: Me, getDropTargetProps: Be, BottomDropTarget: We, DropTargetPadding: Ge } = ue({ canDrag: Ke, canDragOnto: P2, path: Ne2, nodeData: Se2, onMove: V2, onError: _e, translate: Z2 }), Ye = React76.useRef(!fe2), { isEditing: He, isEditingKey: Ue, isArray: $e, canEditKey: Ze } = ze;
|
|
27896
|
+
React76.useEffect((() => {
|
|
27710
27897
|
ye2(q2(D2));
|
|
27711
|
-
}), [D2, q2]),
|
|
27898
|
+
}), [D2, q2]), React76.useEffect((() => {
|
|
27712
27899
|
const e4 = R2(Se2) && !He;
|
|
27713
27900
|
Ye.current = !e4, Ce2(e4);
|
|
27714
|
-
}), [R2]),
|
|
27901
|
+
}), [R2]), React76.useEffect((() => {
|
|
27715
27902
|
if (null !== c2) {
|
|
27716
27903
|
const e4 = u(Ne2);
|
|
27717
27904
|
e4 && (Ye.current = true, Ce2(e4.collapsed));
|
|
27718
27905
|
}
|
|
27719
27906
|
}), [c2]);
|
|
27720
|
-
const Xe =
|
|
27907
|
+
const Xe = React76.useRef(null), Je = React76.useCallback(((e4, t4) => {
|
|
27721
27908
|
if ("function" != typeof U2) return U2;
|
|
27722
27909
|
const n3 = U2(e4, t4);
|
|
27723
27910
|
return void 0 !== n3 ? n3 : null;
|
|
27724
|
-
}), [U2]), Qe =
|
|
27911
|
+
}), [U2]), Qe = React76.useCallback(((e4) => $2 ? "function" != typeof $2 ? $2 : $2(e4) : null), [$2]), { CustomNode: qe, customNodeProps: et, CustomWrapper: tt, wrapperProps: nt = {}, hideKey: rt, showEditTools: ot = true, showOnEdit: it, showOnView: at, showCollectionWrapper: lt = true } = J2, st = b2(ke2);
|
|
27725
27912
|
st && De2 && Ce2(false);
|
|
27726
27913
|
if (!(y("collection", Se2, z2, B2) || 0 === Se2.level) && !st) return null;
|
|
27727
27914
|
const ct = Array.isArray(D2) ? "array" : "object", dt = "array" === ct ? { open: "[", close: "]" } : { open: "{", close: "}" }, ut = (e4) => {
|
|
@@ -27810,15 +27997,15 @@ var De = [];
|
|
|
27810
27997
|
})(':root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden{opacity:0}.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-select-inner{text-overflow:ellipsis;width:100%}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em;line-height:1.1em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em;width:100%}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap;word-break:break-word}.jer-string-expansion{cursor:pointer;filter:saturate(50%);opacity:.6}.jer-show-less{font-size:80%}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:.3s}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string{font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}', {});
|
|
27811
27998
|
var Ce = ({ data: e4, setData: n3, rootName: r5 = "root", onUpdate: o3 = () => {
|
|
27812
27999
|
}, onEdit: d = o3, onDelete: u = o3, onAdd: p2 = o3, onChange: m2, onError: y2, onEditEvent: f2, showErrorMessages: b2 = true, enableClipboard: v2 = true, indent: E2 = 2, collapse: D2 = false, collapseAnimationTime: O2 = 300, showCollectionCount: k2 = true, restrictEdit: S2 = false, restrictDelete: N2 = false, restrictAdd: x2 = false, restrictTypeSelection: A2 = false, restrictDrag: P2 = true, viewOnly: R2, searchFilter: I2, searchText: V2, searchDebounceTime: _2 = 350, keySort: F2 = false, showArrayIndices: L2 = true, arrayIndexFromOne: z2 = false, showStringQuotes: B2 = true, showIconTooltips: W2 = false, defaultValue: G2 = null, newKeyOptions: Y2, minWidth: H2 = 250, maxWidth: U2 = "min(600px, 90vw)", rootFontSize: $2, stringTruncate: Z2 = 250, translations: X3 = {}, className: J2, id: Q2, customText: q2 = {}, customNodeDefinitions: ee2 = [], customButtons: te2 = [], jsonParse: ne2 = JSON.parse, jsonStringify: re3 = (e5, t4) => JSON.stringify(e5, t4, 2), TextEditor: oe2, errorMessageTimeout: ie2 = 2500, keyboardControls: ae2 = {}, externalTriggers: le2, insertAtTop: se2 = false, onCollapse: ce2, collapseClickZones: de2 = ["header", "left"] }) => {
|
|
27813
|
-
const { getStyles: ue2 } = K(), { setCurrentlyEditingElement: pe2 } = M(), ge2 =
|
|
27814
|
-
const [n4, r6] =
|
|
28000
|
+
const { getStyles: ue2 } = K(), { setCurrentlyEditingElement: pe2 } = M(), ge2 = React76.useMemo((() => Se(D2)), [D2]), he2 = React76.useMemo((() => Ee(X3, q2)), [X3, q2]), [ye2, fe2] = React76.useState(V2), [je2, we2] = (({ setData: e5, data: t4 }) => {
|
|
28001
|
+
const [n4, r6] = React76.useState(e5 ? void 0 : t4), o4 = React76.useCallback(((t5) => {
|
|
27815
28002
|
e5 ? e5(t5) : r6(t5);
|
|
27816
28003
|
}), [e5]);
|
|
27817
|
-
return
|
|
28004
|
+
return React76.useEffect((() => {
|
|
27818
28005
|
e5 || r6(t4);
|
|
27819
28006
|
}), [t4]), [e5 ? t4 : n4, o4];
|
|
27820
|
-
})({ setData: n3, data: e4 }), De2 =
|
|
27821
|
-
|
|
28007
|
+
})({ setData: n3, data: e4 }), De2 = React76.useRef(null);
|
|
28008
|
+
React76.useEffect((() => {
|
|
27822
28009
|
pe2(null);
|
|
27823
28010
|
const e5 = setTimeout((() => fe2(V2)), _2);
|
|
27824
28011
|
return () => clearTimeout(e5);
|
|
@@ -27829,7 +28016,7 @@ var Ce = ({ data: e4, setData: n3, rootName: r5 = "root", onUpdate: o3 = () => {
|
|
|
27829
28016
|
const r6 = Te(n4) ? n4 : ["error", n4], [o4, i3] = r6;
|
|
27830
28017
|
if ("error" === o4) return we2(t4.currentData), false === i3 ? he2("ERROR_UPDATE", Ce2) : String(i3);
|
|
27831
28018
|
we2(i3);
|
|
27832
|
-
})), Ae =
|
|
28019
|
+
})), Ae = React76.useMemo((() => Se(S2, R2)), [S2, R2]), Pe = React76.useMemo((() => Se(N2, R2)), [N2, R2]), Re = React76.useMemo((() => Se(x2, R2)), [x2, R2]), Ke = React76.useMemo((() => Se(P2, R2)), [P2, R2]), Ie = React76.useMemo((() => Ne(I2)), [I2]), Ve = React76.useMemo((() => ((e5) => {
|
|
27833
28020
|
const t4 = Object.assign({}, C);
|
|
27834
28021
|
for (const n4 of Object.keys(C)) {
|
|
27835
28022
|
const r6 = n4;
|
|
@@ -27841,25 +28028,25 @@ var Ce = ({ data: e4, setData: n3, rootName: r5 = "root", onUpdate: o3 = () => {
|
|
|
27841
28028
|
}
|
|
27842
28029
|
}
|
|
27843
28030
|
return t4;
|
|
27844
|
-
})(ae2)), [ae2]), _e =
|
|
28031
|
+
})(ae2)), [ae2]), _e = React76.useCallback(((e5, t4) => ((e6, t5, n4) => {
|
|
27845
28032
|
const r6 = Object.entries(t5);
|
|
27846
28033
|
for (const [t6, o4] of r6) if (w(n4, e6[t6], t6)) {
|
|
27847
28034
|
n4.preventDefault(), o4();
|
|
27848
28035
|
break;
|
|
27849
28036
|
}
|
|
27850
|
-
})(Ve, t4, e5)), [Ve]), Fe =
|
|
28037
|
+
})(Ve, t4, e5)), [Ve]), Fe = React76.useMemo((() => {
|
|
27851
28038
|
const e5 = xe(ee2, "stringifyReplacer");
|
|
27852
28039
|
return (t4) => re3(t4, e5);
|
|
27853
|
-
}), [ee2, re3]), Le =
|
|
28040
|
+
}), [ee2, re3]), Le = React76.useMemo((() => {
|
|
27854
28041
|
const e5 = xe(ee2, "parseReviver");
|
|
27855
28042
|
return (t4) => {
|
|
27856
28043
|
const n4 = ne2(t4, e5);
|
|
27857
28044
|
return T(n4);
|
|
27858
28045
|
};
|
|
27859
|
-
}), [ee2, ne2]), ze =
|
|
28046
|
+
}), [ee2, ne2]), ze = React76.useRef(null);
|
|
27860
28047
|
((e5, t4) => {
|
|
27861
28048
|
const { setCurrentlyEditingElement: n4, currentlyEditingElement: r6, setCollapseState: o4 } = M();
|
|
27862
|
-
|
|
28049
|
+
React76.useEffect((() => {
|
|
27863
28050
|
if (!e5) return;
|
|
27864
28051
|
const { collapse: i3, edit: a3 } = e5;
|
|
27865
28052
|
i3 && o4(i3);
|
|
@@ -27876,7 +28063,7 @@ var Ce = ({ data: e4, setData: n3, rootName: r5 = "root", onUpdate: o3 = () => {
|
|
|
27876
28063
|
}
|
|
27877
28064
|
}), [e5]);
|
|
27878
28065
|
})(le2, ze);
|
|
27879
|
-
const Me =
|
|
28066
|
+
const Me = React76.useCallback(((e5, t4) => {
|
|
27880
28067
|
false !== F2 && ("function" != typeof F2 ? e5.sort(((e6, n4) => {
|
|
27881
28068
|
const r6 = t4(e6)[0], o4 = t4(n4)[0];
|
|
27882
28069
|
return r6 < o4 ? -1 : r6 > o4 ? 1 : 0;
|
|
@@ -27902,8 +28089,8 @@ var Ce = ({ data: e4, setData: n3, rootName: r5 = "root", onUpdate: o3 = () => {
|
|
|
27902
28089
|
};
|
|
27903
28090
|
var Oe = (e4) => {
|
|
27904
28091
|
var n3;
|
|
27905
|
-
const [r5, o3] =
|
|
27906
|
-
return
|
|
28092
|
+
const [r5, o3] = React76.useState();
|
|
28093
|
+
return React76.useEffect((() => {
|
|
27907
28094
|
const e5 = document.documentElement;
|
|
27908
28095
|
o3(e5);
|
|
27909
28096
|
}), []), r5 ? jsxRuntime.jsx(R, { theme: null !== (n3 = e4.theme) && void 0 !== n3 ? n3 : A, icons: e4.icons, docRoot: r5, children: jsxRuntime.jsx(z, { onEditEvent: e4.onEditEvent, onCollapse: e4.onCollapse, children: jsxRuntime.jsx(Ce, Object.assign({}, e4)) }) }) : null;
|
|
@@ -27945,7 +28132,7 @@ function JsonEditorRawPanel(props) {
|
|
|
27945
28132
|
const canEditRaw = (_b = permissions == null ? void 0 : permissions.canEditRaw) != null ? _b : false;
|
|
27946
28133
|
if (!canViewRaw) return null;
|
|
27947
28134
|
const viewOnly = !!disabled || !!readOnly || !canEditRaw;
|
|
27948
|
-
const onCopy =
|
|
28135
|
+
const onCopy = React76__namespace.useCallback(async () => {
|
|
27949
28136
|
try {
|
|
27950
28137
|
await navigator.clipboard.writeText(
|
|
27951
28138
|
JSON.stringify(root != null ? root : {}, null, 2)
|
|
@@ -28039,17 +28226,17 @@ function collectAllPaths(value, prefix = "", out = []) {
|
|
|
28039
28226
|
}
|
|
28040
28227
|
function useControllable(opts) {
|
|
28041
28228
|
const { value, defaultValue, onChange } = opts;
|
|
28042
|
-
const [inner, setInner] =
|
|
28229
|
+
const [inner, setInner] = React76__namespace.useState(defaultValue);
|
|
28043
28230
|
const isControlled = value !== void 0;
|
|
28044
28231
|
const state = isControlled ? value : inner;
|
|
28045
|
-
const setState =
|
|
28232
|
+
const setState = React76__namespace.useCallback(
|
|
28046
28233
|
(next) => {
|
|
28047
28234
|
if (!isControlled) setInner(next);
|
|
28048
28235
|
onChange == null ? void 0 : onChange(next);
|
|
28049
28236
|
},
|
|
28050
28237
|
[isControlled, onChange]
|
|
28051
28238
|
);
|
|
28052
|
-
|
|
28239
|
+
React76__namespace.useEffect(() => {
|
|
28053
28240
|
if (!isControlled) return;
|
|
28054
28241
|
setInner(value);
|
|
28055
28242
|
}, [isControlled]);
|
|
@@ -28064,7 +28251,7 @@ function callCallbacks(callbacks, action, nextRoot, ctx) {
|
|
|
28064
28251
|
const meta = { action, route: ctx.route, path, parent, key };
|
|
28065
28252
|
(_b = callbacks.onEdit) == null ? void 0 : _b.call(callbacks, nextRoot, meta);
|
|
28066
28253
|
}
|
|
28067
|
-
var JsonEditor =
|
|
28254
|
+
var JsonEditor = React76__namespace.forwardRef(function JsonEditorEditor(props, ref) {
|
|
28068
28255
|
var _a, _b;
|
|
28069
28256
|
const {
|
|
28070
28257
|
root,
|
|
@@ -28094,16 +28281,16 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28094
28281
|
} = props;
|
|
28095
28282
|
const canViewRaw = (_a = permissions == null ? void 0 : permissions.canViewRaw) != null ? _a : true;
|
|
28096
28283
|
const canEditRaw = (_b = permissions == null ? void 0 : permissions.canEditRaw) != null ? _b : false;
|
|
28097
|
-
const routes =
|
|
28284
|
+
const routes = React76__namespace.useMemo(
|
|
28098
28285
|
() => buildJsonRoutes(root, void 0, filters),
|
|
28099
28286
|
[root, filters]
|
|
28100
28287
|
);
|
|
28101
|
-
const allPaths =
|
|
28288
|
+
const allPaths = React76__namespace.useMemo(() => {
|
|
28102
28289
|
const list = collectAllPaths(root, "", []);
|
|
28103
28290
|
const seen = /* @__PURE__ */ new Set();
|
|
28104
28291
|
return list.filter((p2) => seen.has(p2) ? false : (seen.add(p2), true));
|
|
28105
28292
|
}, [root]);
|
|
28106
|
-
const computedInitialRoute =
|
|
28293
|
+
const computedInitialRoute = React76__namespace.useMemo(() => {
|
|
28107
28294
|
var _a2, _b2;
|
|
28108
28295
|
const explicit = routeProp != null ? routeProp : defaultRoute;
|
|
28109
28296
|
if (explicit !== void 0) return explicit;
|
|
@@ -28119,25 +28306,25 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28119
28306
|
defaultValue: defaultViewMode,
|
|
28120
28307
|
onChange: onViewModeChange
|
|
28121
28308
|
});
|
|
28122
|
-
|
|
28309
|
+
React76__namespace.useEffect(() => {
|
|
28123
28310
|
if (!canViewRaw && (viewMode === "raw" || viewMode === "split")) {
|
|
28124
28311
|
setViewMode("visual");
|
|
28125
28312
|
}
|
|
28126
28313
|
}, [canViewRaw, setViewMode, viewMode]);
|
|
28127
|
-
const fileInputRef =
|
|
28128
|
-
const contentRef =
|
|
28129
|
-
const [rawWidth, setRawWidth] =
|
|
28130
|
-
const [isResizing, setIsResizing] =
|
|
28131
|
-
const startXRef =
|
|
28132
|
-
const startWRef =
|
|
28133
|
-
const clampRawWidth =
|
|
28314
|
+
const fileInputRef = React76__namespace.useRef(null);
|
|
28315
|
+
const contentRef = React76__namespace.useRef(null);
|
|
28316
|
+
const [rawWidth, setRawWidth] = React76__namespace.useState(420);
|
|
28317
|
+
const [isResizing, setIsResizing] = React76__namespace.useState(false);
|
|
28318
|
+
const startXRef = React76__namespace.useRef(0);
|
|
28319
|
+
const startWRef = React76__namespace.useRef(0);
|
|
28320
|
+
const clampRawWidth = React76__namespace.useCallback((w2) => {
|
|
28134
28321
|
var _a2, _b2;
|
|
28135
28322
|
const containerW = (_b2 = (_a2 = contentRef.current) == null ? void 0 : _a2.getBoundingClientRect().width) != null ? _b2 : 0;
|
|
28136
28323
|
const min2 = 260;
|
|
28137
28324
|
const max2 = containerW ? Math.max(min2, Math.min(900, containerW - 240)) : 900;
|
|
28138
28325
|
return Math.max(min2, Math.min(max2, w2));
|
|
28139
28326
|
}, []);
|
|
28140
|
-
const onResizePointerDown =
|
|
28327
|
+
const onResizePointerDown = React76__namespace.useCallback(
|
|
28141
28328
|
(e4) => {
|
|
28142
28329
|
if (e4.button !== 0 && e4.pointerType === "mouse") return;
|
|
28143
28330
|
setIsResizing(true);
|
|
@@ -28149,7 +28336,7 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28149
28336
|
},
|
|
28150
28337
|
[rawWidth]
|
|
28151
28338
|
);
|
|
28152
|
-
const onResizePointerMove =
|
|
28339
|
+
const onResizePointerMove = React76__namespace.useCallback(
|
|
28153
28340
|
(e4) => {
|
|
28154
28341
|
if (!isResizing) return;
|
|
28155
28342
|
const dx = e4.clientX - startXRef.current;
|
|
@@ -28158,7 +28345,7 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28158
28345
|
},
|
|
28159
28346
|
[clampRawWidth, isResizing]
|
|
28160
28347
|
);
|
|
28161
|
-
const stopResizing =
|
|
28348
|
+
const stopResizing = React76__namespace.useCallback(
|
|
28162
28349
|
(e4) => {
|
|
28163
28350
|
if (!isResizing) return;
|
|
28164
28351
|
setIsResizing(false);
|
|
@@ -28169,14 +28356,14 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28169
28356
|
},
|
|
28170
28357
|
[isResizing]
|
|
28171
28358
|
);
|
|
28172
|
-
const loadFile =
|
|
28359
|
+
const loadFile = React76__namespace.useCallback(() => {
|
|
28173
28360
|
var _a2;
|
|
28174
28361
|
(_a2 = fileInputRef.current) == null ? void 0 : _a2.click();
|
|
28175
28362
|
}, []);
|
|
28176
|
-
const close =
|
|
28363
|
+
const close = React76__namespace.useCallback(() => {
|
|
28177
28364
|
onClose == null ? void 0 : onClose();
|
|
28178
28365
|
}, [onClose]);
|
|
28179
|
-
const onFilePicked =
|
|
28366
|
+
const onFilePicked = React76__namespace.useCallback(
|
|
28180
28367
|
async (e4) => {
|
|
28181
28368
|
var _a2;
|
|
28182
28369
|
const file = (_a2 = e4.target.files) == null ? void 0 : _a2[0];
|
|
@@ -28196,7 +28383,7 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28196
28383
|
},
|
|
28197
28384
|
[callbacks, onRoot, route]
|
|
28198
28385
|
);
|
|
28199
|
-
const breadcrumb =
|
|
28386
|
+
const breadcrumb = React76__namespace.useMemo(() => {
|
|
28200
28387
|
const segs = splitPath(route);
|
|
28201
28388
|
const parts = [];
|
|
28202
28389
|
const rootNode = {
|
|
@@ -28223,7 +28410,7 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28223
28410
|
}) : prettifyLabel2(s3);
|
|
28224
28411
|
parts.push({ path: acc, label });
|
|
28225
28412
|
}
|
|
28226
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: parts.map((p2, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28413
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: parts.map((p2, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React76__namespace.Fragment, { children: [
|
|
28227
28414
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
28228
28415
|
Button2,
|
|
28229
28416
|
{
|
|
@@ -28238,7 +28425,7 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28238
28425
|
idx < parts.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-60", children: "/" }) : null
|
|
28239
28426
|
] }, p2.path || "root")) });
|
|
28240
28427
|
}, [route, routes, renderRouteLabel, setRoute]);
|
|
28241
|
-
const routeTitle =
|
|
28428
|
+
const routeTitle = React76__namespace.useMemo(() => {
|
|
28242
28429
|
if (!route) return "Config.json";
|
|
28243
28430
|
const key = lastSegment(route);
|
|
28244
28431
|
if (renderRouteLabel) {
|
|
@@ -28254,7 +28441,7 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28254
28441
|
}
|
|
28255
28442
|
return prettifyLabel2(key);
|
|
28256
28443
|
}, [route, renderRouteLabel]);
|
|
28257
|
-
const viewControls =
|
|
28444
|
+
const viewControls = React76__namespace.useMemo(() => {
|
|
28258
28445
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 rounded-md border p-1", children: [
|
|
28259
28446
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
28260
28447
|
Button2,
|
|
@@ -28297,7 +28484,7 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28297
28484
|
) : null
|
|
28298
28485
|
] });
|
|
28299
28486
|
}, [canViewRaw, setViewMode, viewMode]);
|
|
28300
|
-
const header =
|
|
28487
|
+
const header = React76__namespace.useMemo(() => {
|
|
28301
28488
|
const ctx = {
|
|
28302
28489
|
title: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate font-medium", children: headerTitle != null ? headerTitle : "JSON Editor" }) }),
|
|
28303
28490
|
viewControls,
|
|
@@ -28349,7 +28536,7 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28349
28536
|
showClose,
|
|
28350
28537
|
viewControls
|
|
28351
28538
|
]);
|
|
28352
|
-
const onVisualRoot =
|
|
28539
|
+
const onVisualRoot = React76__namespace.useCallback(
|
|
28353
28540
|
(nextRoot, detail) => {
|
|
28354
28541
|
onRoot(nextRoot, detail);
|
|
28355
28542
|
const d = detail;
|
|
@@ -28361,14 +28548,14 @@ var JsonEditor = React74__namespace.forwardRef(function JsonEditorEditor(props,
|
|
|
28361
28548
|
},
|
|
28362
28549
|
[callbacks, onRoot, route]
|
|
28363
28550
|
);
|
|
28364
|
-
const onRawRoot =
|
|
28551
|
+
const onRawRoot = React76__namespace.useCallback(
|
|
28365
28552
|
(nextRoot, detail) => {
|
|
28366
28553
|
onRoot(nextRoot, detail);
|
|
28367
28554
|
callCallbacks(callbacks, "edit-raw", nextRoot, { route, path: "" });
|
|
28368
28555
|
},
|
|
28369
28556
|
[callbacks, onRoot, route]
|
|
28370
28557
|
);
|
|
28371
|
-
|
|
28558
|
+
React76__namespace.useImperativeHandle(
|
|
28372
28559
|
ref,
|
|
28373
28560
|
() => ({
|
|
28374
28561
|
loadFile,
|
|
@@ -28490,7 +28677,7 @@ function triggerHeightCls(size) {
|
|
|
28490
28677
|
return "h-9 text-sm";
|
|
28491
28678
|
}
|
|
28492
28679
|
}
|
|
28493
|
-
var ShadcnJsonEditorVariant =
|
|
28680
|
+
var ShadcnJsonEditorVariant = React76__namespace.forwardRef(function ShadcnJsonEditorVariant2(props, ref) {
|
|
28494
28681
|
var _a;
|
|
28495
28682
|
const {
|
|
28496
28683
|
mode = "popover",
|
|
@@ -28537,15 +28724,15 @@ var ShadcnJsonEditorVariant = React74__namespace.forwardRef(function ShadcnJsonE
|
|
|
28537
28724
|
extendBoxToControls = true,
|
|
28538
28725
|
triggerClassName
|
|
28539
28726
|
} = props;
|
|
28540
|
-
const editorRef =
|
|
28541
|
-
const root =
|
|
28727
|
+
const editorRef = React76__namespace.useRef(null);
|
|
28728
|
+
const root = React76__namespace.useMemo(() => {
|
|
28542
28729
|
if ("root" in props) return props.root;
|
|
28543
28730
|
const v2 = props.value;
|
|
28544
28731
|
if (isPlainObject5(v2)) return v2;
|
|
28545
28732
|
if (v2 == null) return {};
|
|
28546
28733
|
return {};
|
|
28547
28734
|
}, [props]);
|
|
28548
|
-
const emitRoot =
|
|
28735
|
+
const emitRoot = React76__namespace.useCallback(
|
|
28549
28736
|
(nextRoot, detail) => {
|
|
28550
28737
|
var _a2, _b;
|
|
28551
28738
|
if ("onRoot" in props) {
|
|
@@ -28556,9 +28743,9 @@ var ShadcnJsonEditorVariant = React74__namespace.forwardRef(function ShadcnJsonE
|
|
|
28556
28743
|
},
|
|
28557
28744
|
[props]
|
|
28558
28745
|
);
|
|
28559
|
-
const [openInner, setOpenInner] =
|
|
28746
|
+
const [openInner, setOpenInner] = React76__namespace.useState(false);
|
|
28560
28747
|
const open = openProp != null ? openProp : openInner;
|
|
28561
|
-
const setOpen =
|
|
28748
|
+
const setOpen = React76__namespace.useCallback(
|
|
28562
28749
|
(next) => {
|
|
28563
28750
|
if (openProp === void 0) setOpenInner(next);
|
|
28564
28751
|
onOpenChange == null ? void 0 : onOpenChange(next);
|
|
@@ -28566,11 +28753,11 @@ var ShadcnJsonEditorVariant = React74__namespace.forwardRef(function ShadcnJsonE
|
|
|
28566
28753
|
},
|
|
28567
28754
|
[openProp, onOpenChange, onClose]
|
|
28568
28755
|
);
|
|
28569
|
-
const close =
|
|
28570
|
-
const doOpen =
|
|
28571
|
-
const toggle =
|
|
28572
|
-
const [expanded, setExpanded] =
|
|
28573
|
-
|
|
28756
|
+
const close = React76__namespace.useCallback(() => setOpen(false), [setOpen]);
|
|
28757
|
+
const doOpen = React76__namespace.useCallback(() => setOpen(true), [setOpen]);
|
|
28758
|
+
const toggle = React76__namespace.useCallback(() => setOpen(!open), [setOpen, open]);
|
|
28759
|
+
const [expanded, setExpanded] = React76__namespace.useState();
|
|
28760
|
+
React76__namespace.useImperativeHandle(
|
|
28574
28761
|
ref,
|
|
28575
28762
|
() => ({
|
|
28576
28763
|
open: doOpen,
|
|
@@ -29016,7 +29203,7 @@ var defaultHost = {
|
|
|
29016
29203
|
}
|
|
29017
29204
|
};
|
|
29018
29205
|
|
|
29019
|
-
// src/presets/shadcn
|
|
29206
|
+
// src/presets/shadcn/variants/lister/patch.ts
|
|
29020
29207
|
function makeInlineDef(args) {
|
|
29021
29208
|
const mapping = {
|
|
29022
29209
|
optionValue: (raw, ctx) => pick(raw, args.optionValue, ctx),
|
|
@@ -29127,7 +29314,7 @@ function normalizeIconifyInput(icon) {
|
|
|
29127
29314
|
}
|
|
29128
29315
|
function OptionIcon(props) {
|
|
29129
29316
|
const { icon, className } = props;
|
|
29130
|
-
if (
|
|
29317
|
+
if (React76__namespace.isValidElement(icon)) {
|
|
29131
29318
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("shrink-0", className), children: icon });
|
|
29132
29319
|
}
|
|
29133
29320
|
if (isSvgSnippetString(icon)) {
|
|
@@ -29180,7 +29367,7 @@ function OptionList(props) {
|
|
|
29180
29367
|
const options = (_a = selectors.visibleOptions(id)) != null ? _a : [];
|
|
29181
29368
|
const draft = s3 == null ? void 0 : s3.draftValue;
|
|
29182
29369
|
const isMulti = (s3 == null ? void 0 : s3.mode) === "multiple";
|
|
29183
|
-
const isSelected =
|
|
29370
|
+
const isSelected = React76__namespace.useCallback(
|
|
29184
29371
|
(value) => {
|
|
29185
29372
|
if (isMulti) return Array.isArray(draft) && draft.includes(value);
|
|
29186
29373
|
return draft === value;
|
|
@@ -29200,7 +29387,7 @@ function OptionList(props) {
|
|
|
29200
29387
|
return /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: cn("h-full min-h-0", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-4 text-sm opacity-70", children: "No results" }) });
|
|
29201
29388
|
}
|
|
29202
29389
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("h-full min-h-0 overflow-hidden", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full min-h-0 p-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
29203
|
-
|
|
29390
|
+
VirtualScroll,
|
|
29204
29391
|
{
|
|
29205
29392
|
style: { height: "100%", minHeight: 0 },
|
|
29206
29393
|
data: options,
|
|
@@ -29399,25 +29586,25 @@ function ListerInner(props) {
|
|
|
29399
29586
|
panelClassName
|
|
29400
29587
|
} = props;
|
|
29401
29588
|
const { api, actions, store } = useLister();
|
|
29402
|
-
const ownerKeyRef =
|
|
29589
|
+
const ownerKeyRef = React76__namespace.useRef(
|
|
29403
29590
|
(_a = openOptions == null ? void 0 : openOptions.ownerKey) != null ? _a : createRuntimeKey("lister_owner")
|
|
29404
29591
|
);
|
|
29405
|
-
|
|
29592
|
+
React76__namespace.useEffect(() => {
|
|
29406
29593
|
const next = openOptions == null ? void 0 : openOptions.ownerKey;
|
|
29407
29594
|
if (next) ownerKeyRef.current = next;
|
|
29408
29595
|
}, [openOptions]);
|
|
29409
29596
|
const session = findSessionByOwner(store, ownerKeyRef.current);
|
|
29410
29597
|
const sessionId = session == null ? void 0 : session.sessionId;
|
|
29411
29598
|
const isOpen = !!(session == null ? void 0 : session.isOpen);
|
|
29412
|
-
const [selectedOptions, setSelectedOptions] =
|
|
29599
|
+
const [selectedOptions, setSelectedOptions] = React76__namespace.useState(
|
|
29413
29600
|
null
|
|
29414
29601
|
);
|
|
29415
|
-
const openingRef =
|
|
29602
|
+
const openingRef = React76__namespace.useRef(false);
|
|
29416
29603
|
const mode = modeProp != null ? modeProp : "single";
|
|
29417
29604
|
const confirm = mode === "multiple" ? true : !!confirmProp;
|
|
29418
29605
|
const disabledTrigger = !!(disabled || readOnly);
|
|
29419
29606
|
const hasValue = mode === "multiple" ? Array.isArray(value) && value.length > 0 : value != null && value !== "";
|
|
29420
|
-
|
|
29607
|
+
React76__namespace.useEffect(() => {
|
|
29421
29608
|
if (!hasValue) {
|
|
29422
29609
|
setSelectedOptions(null);
|
|
29423
29610
|
return;
|
|
@@ -29453,7 +29640,7 @@ function ListerInner(props) {
|
|
|
29453
29640
|
alive = false;
|
|
29454
29641
|
};
|
|
29455
29642
|
}, [api, def, filters, mode, value, hasValue]);
|
|
29456
|
-
const openSession =
|
|
29643
|
+
const openSession = React76__namespace.useCallback(async () => {
|
|
29457
29644
|
var _a2, _b2;
|
|
29458
29645
|
console.log(openingRef.current);
|
|
29459
29646
|
if (disabledTrigger) return;
|
|
@@ -29494,7 +29681,7 @@ function ListerInner(props) {
|
|
|
29494
29681
|
permissions,
|
|
29495
29682
|
value
|
|
29496
29683
|
]);
|
|
29497
|
-
const clear =
|
|
29684
|
+
const clear = React76__namespace.useCallback(() => {
|
|
29498
29685
|
if (disabledTrigger) return;
|
|
29499
29686
|
onValue(void 0, {
|
|
29500
29687
|
action: "clear",
|
|
@@ -29502,7 +29689,7 @@ function ListerInner(props) {
|
|
|
29502
29689
|
});
|
|
29503
29690
|
setSelectedOptions(null);
|
|
29504
29691
|
}, [disabledTrigger, onValue]);
|
|
29505
|
-
const display =
|
|
29692
|
+
const display = React76__namespace.useMemo(() => {
|
|
29506
29693
|
return buildLabelsFromOptions({
|
|
29507
29694
|
mode,
|
|
29508
29695
|
value,
|
|
@@ -29511,7 +29698,7 @@ function ListerInner(props) {
|
|
|
29511
29698
|
maxItems: maxDisplayItems
|
|
29512
29699
|
});
|
|
29513
29700
|
}, [maxDisplayItems, mode, placeholder, selectedOptions, value]);
|
|
29514
|
-
const triggerCtx =
|
|
29701
|
+
const triggerCtx = React76__namespace.useMemo(
|
|
29515
29702
|
() => ({
|
|
29516
29703
|
mode,
|
|
29517
29704
|
value,
|
|
@@ -29637,7 +29824,7 @@ function ListerInner(props) {
|
|
|
29637
29824
|
}
|
|
29638
29825
|
);
|
|
29639
29826
|
const userTriggerEl = renderTrigger ? renderTrigger(triggerCtx) : null;
|
|
29640
|
-
const TriggerNode = renderTrigger &&
|
|
29827
|
+
const TriggerNode = renderTrigger && React76__namespace.isValidElement(userTriggerEl) ? React76__namespace.cloneElement(userTriggerEl, {
|
|
29641
29828
|
className: cn(
|
|
29642
29829
|
(_b = userTriggerEl.props) == null ? void 0 : _b.className,
|
|
29643
29830
|
className
|
|
@@ -29863,11 +30050,11 @@ function ListerResolvedInner(props) {
|
|
|
29863
30050
|
} = props;
|
|
29864
30051
|
const isStandaloneInline = !def && endpoint != null;
|
|
29865
30052
|
const shouldInferOptionValue = isStandaloneInline && optionValue === void 0;
|
|
29866
|
-
const [resolvedOptionValue, setResolvedOptionValue] =
|
|
29867
|
-
|
|
30053
|
+
const [resolvedOptionValue, setResolvedOptionValue] = React76__namespace.useState(() => optionValue != null ? optionValue : "id");
|
|
30054
|
+
React76__namespace.useEffect(() => {
|
|
29868
30055
|
if (optionValue !== void 0) setResolvedOptionValue(optionValue);
|
|
29869
30056
|
}, [optionValue]);
|
|
29870
|
-
|
|
30057
|
+
React76__namespace.useEffect(() => {
|
|
29871
30058
|
if (!shouldInferOptionValue) return;
|
|
29872
30059
|
if (!endpoint) return;
|
|
29873
30060
|
let alive = true;
|
|
@@ -29919,7 +30106,7 @@ function ListerResolvedInner(props) {
|
|
|
29919
30106
|
const inlineExists = endpoint !== void 0 || method !== void 0 || buildRequest !== void 0 || selector !== void 0 || resolvedOptionValue !== void 0 || // ✅ KEEP THIS (your rule)
|
|
29920
30107
|
optionLabel !== void 0 || optionIcon !== void 0 || optionDescription !== void 0 || optionDisabled !== void 0 || optionGroup !== void 0 || optionMeta !== void 0 || // ✅ include search override as "inline patch" signal too
|
|
29921
30108
|
search !== void 0;
|
|
29922
|
-
const finalDef =
|
|
30109
|
+
const finalDef = React76__namespace.useMemo(() => {
|
|
29923
30110
|
const baseDef = def;
|
|
29924
30111
|
if (!inlineExists) return baseDef;
|
|
29925
30112
|
if (!baseDef) {
|
|
@@ -29974,7 +30161,7 @@ function ListerResolvedInner(props) {
|
|
|
29974
30161
|
optionMeta,
|
|
29975
30162
|
search
|
|
29976
30163
|
]);
|
|
29977
|
-
const openOptions =
|
|
30164
|
+
const openOptions = React76__namespace.useMemo(() => {
|
|
29978
30165
|
return {
|
|
29979
30166
|
title,
|
|
29980
30167
|
searchMode,
|
|
@@ -30228,24 +30415,24 @@ function IconPickerPanel(props) {
|
|
|
30228
30415
|
maxRender = 2500
|
|
30229
30416
|
} = props;
|
|
30230
30417
|
const den = densityTokens2(density);
|
|
30231
|
-
const groups =
|
|
30418
|
+
const groups = React76__namespace.useMemo(() => {
|
|
30232
30419
|
const base = groupsProp != null ? groupsProp : [];
|
|
30233
30420
|
if (!(allowedGroupIds == null ? void 0 : allowedGroupIds.length)) return base;
|
|
30234
30421
|
const allowed = base.filter((g2) => allowedGroupIds.includes(g2.id));
|
|
30235
30422
|
return allowed.length ? allowed : base;
|
|
30236
30423
|
}, [allowedGroupIds, groupsProp]);
|
|
30237
|
-
const prefixes =
|
|
30424
|
+
const prefixes = React76__namespace.useMemo(() => {
|
|
30238
30425
|
return uniq2(groups.flatMap((g2) => g2.prefixes).filter(Boolean));
|
|
30239
30426
|
}, [groups]);
|
|
30240
|
-
const [selectedGroupId, setSelectedGroupId] =
|
|
30427
|
+
const [selectedGroupId, setSelectedGroupId] = React76__namespace.useState(() => {
|
|
30241
30428
|
var _a;
|
|
30242
30429
|
return (_a = groups[0]) == null ? void 0 : _a.id;
|
|
30243
30430
|
});
|
|
30244
|
-
const [searchQuery, setSearchQuery] =
|
|
30245
|
-
const [loading, setLoading] =
|
|
30246
|
-
const [error, setError] =
|
|
30247
|
-
const [allIcons, setAllIcons] =
|
|
30248
|
-
|
|
30431
|
+
const [searchQuery, setSearchQuery] = React76__namespace.useState("");
|
|
30432
|
+
const [loading, setLoading] = React76__namespace.useState(false);
|
|
30433
|
+
const [error, setError] = React76__namespace.useState(null);
|
|
30434
|
+
const [allIcons, setAllIcons] = React76__namespace.useState([]);
|
|
30435
|
+
React76__namespace.useEffect(() => {
|
|
30249
30436
|
setSelectedGroupId((prev) => {
|
|
30250
30437
|
var _a, _b;
|
|
30251
30438
|
if (!prev) return (_a = groups[0]) == null ? void 0 : _a.id;
|
|
@@ -30253,7 +30440,7 @@ function IconPickerPanel(props) {
|
|
|
30253
30440
|
return exists ? prev : (_b = groups[0]) == null ? void 0 : _b.id;
|
|
30254
30441
|
});
|
|
30255
30442
|
}, [groups]);
|
|
30256
|
-
|
|
30443
|
+
React76__namespace.useEffect(() => {
|
|
30257
30444
|
const controller = new AbortController();
|
|
30258
30445
|
let mounted = true;
|
|
30259
30446
|
const load = async () => {
|
|
@@ -30295,15 +30482,15 @@ function IconPickerPanel(props) {
|
|
|
30295
30482
|
controller.abort();
|
|
30296
30483
|
};
|
|
30297
30484
|
}, [prefixes, url]);
|
|
30298
|
-
const selectedGroup =
|
|
30485
|
+
const selectedGroup = React76__namespace.useMemo(
|
|
30299
30486
|
() => groups.find((g2) => g2.id === selectedGroupId),
|
|
30300
30487
|
[groups, selectedGroupId]
|
|
30301
30488
|
);
|
|
30302
|
-
const selectedGroupPrefixes =
|
|
30489
|
+
const selectedGroupPrefixes = React76__namespace.useMemo(() => {
|
|
30303
30490
|
if (!selectedGroup) return void 0;
|
|
30304
30491
|
return new Set(selectedGroup.prefixes);
|
|
30305
30492
|
}, [selectedGroup]);
|
|
30306
|
-
const filteredIcons =
|
|
30493
|
+
const filteredIcons = React76__namespace.useMemo(() => {
|
|
30307
30494
|
const q2 = searchQuery.trim().toLowerCase();
|
|
30308
30495
|
let list = allIcons;
|
|
30309
30496
|
if (selectedGroupPrefixes) {
|
|
@@ -30319,7 +30506,7 @@ function IconPickerPanel(props) {
|
|
|
30319
30506
|
}
|
|
30320
30507
|
return list;
|
|
30321
30508
|
}, [allIcons, searchQuery, selectedGroupPrefixes]);
|
|
30322
|
-
const limitedIcons =
|
|
30509
|
+
const limitedIcons = React76__namespace.useMemo(() => {
|
|
30323
30510
|
if (filteredIcons.length <= maxRender) return filteredIcons;
|
|
30324
30511
|
return filteredIcons.slice(0, maxRender);
|
|
30325
30512
|
}, [filteredIcons, maxRender]);
|
|
@@ -30333,7 +30520,7 @@ function IconPickerPanel(props) {
|
|
|
30333
30520
|
value.includes(iconName) ? value.filter((x2) => x2 !== iconName) : [...value, iconName]
|
|
30334
30521
|
);
|
|
30335
30522
|
};
|
|
30336
|
-
const GridComponents =
|
|
30523
|
+
const GridComponents = React76__namespace.useMemo(
|
|
30337
30524
|
() => ({
|
|
30338
30525
|
List: (p2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
30339
30526
|
"div",
|
|
@@ -30346,8 +30533,11 @@ function IconPickerPanel(props) {
|
|
|
30346
30533
|
}),
|
|
30347
30534
|
[]
|
|
30348
30535
|
);
|
|
30349
|
-
const gridHeightStyle =
|
|
30350
|
-
() => ({
|
|
30536
|
+
const gridHeightStyle = React76__namespace.useMemo(
|
|
30537
|
+
() => ({
|
|
30538
|
+
height: "320px",
|
|
30539
|
+
maxHeight: "calc(var(--radix-popper-available-height) - 140px)"
|
|
30540
|
+
}),
|
|
30351
30541
|
[]
|
|
30352
30542
|
);
|
|
30353
30543
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
@@ -30404,7 +30594,7 @@ function IconPickerPanel(props) {
|
|
|
30404
30594
|
" results (refine search to narrow)."
|
|
30405
30595
|
] }),
|
|
30406
30596
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30407
|
-
|
|
30597
|
+
VirtualScrollGrid,
|
|
30408
30598
|
{
|
|
30409
30599
|
style: gridHeightStyle,
|
|
30410
30600
|
data: limitedIcons,
|
|
@@ -30471,7 +30661,7 @@ function IconPickerPanel(props) {
|
|
|
30471
30661
|
)
|
|
30472
30662
|
] });
|
|
30473
30663
|
}
|
|
30474
|
-
var ShadcnIconVariant =
|
|
30664
|
+
var ShadcnIconVariant = React76__namespace.forwardRef(function ShadcnIconVariant2(props, ref) {
|
|
30475
30665
|
var _a, _b;
|
|
30476
30666
|
const {
|
|
30477
30667
|
value,
|
|
@@ -30523,12 +30713,12 @@ var ShadcnIconVariant = React74__namespace.forwardRef(function ShadcnIconVariant
|
|
|
30523
30713
|
const resolvedLeadingIcons = (leadingIcons == null ? void 0 : leadingIcons.length) ? leadingIcons : icon ? [icon] : [];
|
|
30524
30714
|
const resolvedTrailingIcons = (trailingIcons == null ? void 0 : trailingIcons.length) ? trailingIcons : [];
|
|
30525
30715
|
const hasExternalControls = !!leadingControl || !!trailingControl;
|
|
30526
|
-
const [popoverOpen, setPopoverOpen] =
|
|
30527
|
-
const selected =
|
|
30716
|
+
const [popoverOpen, setPopoverOpen] = React76__namespace.useState(false);
|
|
30717
|
+
const selected = React76__namespace.useMemo(() => {
|
|
30528
30718
|
if (multiple) return Array.isArray(value) ? value.filter(Boolean) : [];
|
|
30529
30719
|
return typeof value === "string" && value ? [value] : [];
|
|
30530
30720
|
}, [multiple, value]);
|
|
30531
|
-
const emit =
|
|
30721
|
+
const emit = React76__namespace.useCallback(
|
|
30532
30722
|
(nextArr, meta) => {
|
|
30533
30723
|
var _a2, _b2;
|
|
30534
30724
|
if (!onValue) return;
|
|
@@ -30550,7 +30740,7 @@ var ShadcnIconVariant = React74__namespace.forwardRef(function ShadcnIconVariant
|
|
|
30550
30740
|
},
|
|
30551
30741
|
[multiple, onValue]
|
|
30552
30742
|
);
|
|
30553
|
-
const Chip =
|
|
30743
|
+
const Chip = React76__namespace.useCallback(
|
|
30554
30744
|
({ iconName }) => {
|
|
30555
30745
|
var _a2;
|
|
30556
30746
|
const short = (_a2 = iconName.split(":")[1]) != null ? _a2 : iconName;
|
|
@@ -30613,7 +30803,7 @@ var ShadcnIconVariant = React74__namespace.forwardRef(function ShadcnIconVariant
|
|
|
30613
30803
|
[chipHeightCls, den.chipGap, den.chipPad, emit, selected]
|
|
30614
30804
|
);
|
|
30615
30805
|
const selectedCount = selected.length;
|
|
30616
|
-
const resolveButtonTriggerElement =
|
|
30806
|
+
const resolveButtonTriggerElement = React76__namespace.useCallback(() => {
|
|
30617
30807
|
const ctx = {
|
|
30618
30808
|
open: popoverOpen,
|
|
30619
30809
|
items: selected,
|
|
@@ -30643,7 +30833,7 @@ var ShadcnIconVariant = React74__namespace.forwardRef(function ShadcnIconVariant
|
|
|
30643
30833
|
);
|
|
30644
30834
|
const child = el.props.children;
|
|
30645
30835
|
if (selectedBadgePlacement === "end") {
|
|
30646
|
-
return
|
|
30836
|
+
return React76__namespace.cloneElement(el, {
|
|
30647
30837
|
className: nextClass,
|
|
30648
30838
|
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
30649
30839
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0", children: child }),
|
|
@@ -30651,7 +30841,7 @@ var ShadcnIconVariant = React74__namespace.forwardRef(function ShadcnIconVariant
|
|
|
30651
30841
|
] })
|
|
30652
30842
|
});
|
|
30653
30843
|
}
|
|
30654
|
-
return
|
|
30844
|
+
return React76__namespace.cloneElement(el, {
|
|
30655
30845
|
className: nextClass,
|
|
30656
30846
|
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
30657
30847
|
child,
|
|
@@ -30659,7 +30849,7 @@ var ShadcnIconVariant = React74__namespace.forwardRef(function ShadcnIconVariant
|
|
|
30659
30849
|
] })
|
|
30660
30850
|
});
|
|
30661
30851
|
};
|
|
30662
|
-
const withNoopDnD = (el) =>
|
|
30852
|
+
const withNoopDnD = (el) => React76__namespace.cloneElement(el, {
|
|
30663
30853
|
// keep event-merging parity with file variant (no-op, but safe)
|
|
30664
30854
|
onDragOver: mergeHandlers2(
|
|
30665
30855
|
el.props.onDragOver,
|
|
@@ -30676,7 +30866,7 @@ var ShadcnIconVariant = React74__namespace.forwardRef(function ShadcnIconVariant
|
|
|
30676
30866
|
}
|
|
30677
30867
|
)
|
|
30678
30868
|
});
|
|
30679
|
-
if (
|
|
30869
|
+
if (React76__namespace.isValidElement(rawNode))
|
|
30680
30870
|
return withNoopDnD(injectBadgeIntoElement(rawNode));
|
|
30681
30871
|
const fallback = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30682
30872
|
"button",
|
|
@@ -30724,7 +30914,7 @@ var ShadcnIconVariant = React74__namespace.forwardRef(function ShadcnIconVariant
|
|
|
30724
30914
|
triggerClassName
|
|
30725
30915
|
]);
|
|
30726
30916
|
const COLLAPSE_LIMIT = 2;
|
|
30727
|
-
const TriggerRegion =
|
|
30917
|
+
const TriggerRegion = React76__namespace.useMemo(() => {
|
|
30728
30918
|
const hasItems = selected.length > 0;
|
|
30729
30919
|
const visibleItems = selected.slice(0, COLLAPSE_LIMIT);
|
|
30730
30920
|
const hiddenCount = selected.length - COLLAPSE_LIMIT;
|
|
@@ -30812,11 +31002,11 @@ var ShadcnIconVariant = React74__namespace.forwardRef(function ShadcnIconVariant
|
|
|
30812
31002
|
PopoverContent,
|
|
30813
31003
|
{
|
|
30814
31004
|
className: cn(
|
|
30815
|
-
"w-(--radix-popover-trigger-width) p-0 max-h-(--radix-popper-available-height)",
|
|
31005
|
+
"w-(--radix-popover-trigger-width) p-0 max-h-(--radix-popper-available-height) overflow-hidden flex flex-col",
|
|
30816
31006
|
popoverClassName
|
|
30817
31007
|
),
|
|
30818
31008
|
align: "start",
|
|
30819
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
31009
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col flex-1 min-h-0", children: [
|
|
30820
31010
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
30821
31011
|
"div",
|
|
30822
31012
|
{
|
|
@@ -31096,8 +31286,8 @@ function isFileLikeString(s3) {
|
|
|
31096
31286
|
return FILE_EXT_RE.test(v2);
|
|
31097
31287
|
}
|
|
31098
31288
|
function useImagePreview(value) {
|
|
31099
|
-
const [src, setSrc] =
|
|
31100
|
-
|
|
31289
|
+
const [src, setSrc] = React76__namespace.useState(null);
|
|
31290
|
+
React76__namespace.useEffect(() => {
|
|
31101
31291
|
if (!value) {
|
|
31102
31292
|
setSrc(null);
|
|
31103
31293
|
return;
|
|
@@ -31115,7 +31305,7 @@ var ImageThumb = ({ image }) => {
|
|
|
31115
31305
|
const src = useImagePreview(image);
|
|
31116
31306
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-sm border bg-muted/50", children: src ? /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt: "", className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsxRuntime.jsx(Image, { className: "h-4 w-4 text-muted-foreground/50" }) });
|
|
31117
31307
|
};
|
|
31118
|
-
var ShadcnImageIconVariant =
|
|
31308
|
+
var ShadcnImageIconVariant = React76__namespace.forwardRef(function ShadcnImageIconVariant2(props, ref) {
|
|
31119
31309
|
const {
|
|
31120
31310
|
value,
|
|
31121
31311
|
onValue,
|
|
@@ -31172,7 +31362,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31172
31362
|
const regIcon = getPaletteUtil("iconPicker");
|
|
31173
31363
|
const resolvedIconUrl = iconUrl != null ? iconUrl : regIcon == null ? void 0 : regIcon.url;
|
|
31174
31364
|
const resolvedIconGroups = iconGroups != null ? iconGroups : regIcon == null ? void 0 : regIcon.groups;
|
|
31175
|
-
const effectiveIconGroups =
|
|
31365
|
+
const effectiveIconGroups = React76__namespace.useMemo(() => {
|
|
31176
31366
|
const groups = resolvedIconGroups != null ? resolvedIconGroups : DEFAULT_GROUPS;
|
|
31177
31367
|
const allowed = toArray2(allowedIconGroupIds).filter(
|
|
31178
31368
|
Boolean
|
|
@@ -31181,7 +31371,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31181
31371
|
const filtered = groups.filter((g2) => allowed.includes(g2.id));
|
|
31182
31372
|
return filtered.length ? filtered : groups;
|
|
31183
31373
|
}, [resolvedIconGroups, allowedIconGroupIds]);
|
|
31184
|
-
const allowedIconPrefixes =
|
|
31374
|
+
const allowedIconPrefixes = React76__namespace.useMemo(() => {
|
|
31185
31375
|
var _a;
|
|
31186
31376
|
const set = /* @__PURE__ */ new Set();
|
|
31187
31377
|
for (const g2 of effectiveIconGroups) {
|
|
@@ -31189,7 +31379,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31189
31379
|
}
|
|
31190
31380
|
return set;
|
|
31191
31381
|
}, [effectiveIconGroups]);
|
|
31192
|
-
const isIconString =
|
|
31382
|
+
const isIconString = React76__namespace.useCallback(
|
|
31193
31383
|
(raw) => {
|
|
31194
31384
|
var _a;
|
|
31195
31385
|
const s3 = raw.trim();
|
|
@@ -31201,7 +31391,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31201
31391
|
},
|
|
31202
31392
|
[allowedIconPrefixes]
|
|
31203
31393
|
);
|
|
31204
|
-
const normaliseImageIconInput =
|
|
31394
|
+
const normaliseImageIconInput = React76__namespace.useCallback(
|
|
31205
31395
|
(v2) => {
|
|
31206
31396
|
var _a;
|
|
31207
31397
|
if (v2 == null) return null;
|
|
@@ -31242,25 +31432,25 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31242
31432
|
const resolvedLeadingIcons = (leadingIcons == null ? void 0 : leadingIcons.length) ? leadingIcons : icon ? [icon] : [];
|
|
31243
31433
|
const resolvedTrailingIcons = (trailingIcons == null ? void 0 : trailingIcons.length) ? trailingIcons : [];
|
|
31244
31434
|
const hasExternalControls = !!leadingControl || !!trailingControl;
|
|
31245
|
-
const [popoverOpen, setPopoverOpen] =
|
|
31246
|
-
const [tab, setTab] =
|
|
31247
|
-
const list =
|
|
31435
|
+
const [popoverOpen, setPopoverOpen] = React76__namespace.useState(false);
|
|
31436
|
+
const [tab, setTab] = React76__namespace.useState("icon");
|
|
31437
|
+
const list = React76__namespace.useMemo(() => {
|
|
31248
31438
|
const raw = multiple ? toArray2(value) : value != null ? [value] : [];
|
|
31249
31439
|
return raw.map(normaliseImageIconInput).filter(Boolean);
|
|
31250
31440
|
}, [multiple, normaliseImageIconInput, value]);
|
|
31251
|
-
const iconsSelected =
|
|
31441
|
+
const iconsSelected = React76__namespace.useMemo(() => {
|
|
31252
31442
|
return list.filter((x2) => x2.kind === "icon").map((x2) => x2.icon);
|
|
31253
31443
|
}, [list]);
|
|
31254
|
-
const imagesSelected =
|
|
31444
|
+
const imagesSelected = React76__namespace.useMemo(() => {
|
|
31255
31445
|
return list.filter((x2) => x2.kind === "image");
|
|
31256
31446
|
}, [list]);
|
|
31257
|
-
const toFieldRaw =
|
|
31447
|
+
const toFieldRaw = React76__namespace.useCallback(
|
|
31258
31448
|
(x2) => {
|
|
31259
31449
|
return x2.kind === "icon" ? x2.icon : x2.image;
|
|
31260
31450
|
},
|
|
31261
31451
|
[]
|
|
31262
31452
|
);
|
|
31263
|
-
const emit =
|
|
31453
|
+
const emit = React76__namespace.useCallback(
|
|
31264
31454
|
(nextList, meta) => {
|
|
31265
31455
|
var _a, _b;
|
|
31266
31456
|
if (!onValue) return;
|
|
@@ -31289,7 +31479,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31289
31479
|
emit(next, { action: "remove", index: idx });
|
|
31290
31480
|
};
|
|
31291
31481
|
const clearAll = () => emit([], { action: "clear" });
|
|
31292
|
-
const Chip =
|
|
31482
|
+
const Chip = React76__namespace.useCallback(
|
|
31293
31483
|
({ item, index }) => {
|
|
31294
31484
|
var _a, _b, _c;
|
|
31295
31485
|
const label = item.kind === "icon" ? (_a = item.icon.split(":")[1]) != null ? _a : item.icon : (_c = item.name) != null ? _c : typeof item.image === "string" ? (_b = item.image.split(/[\\/]/).pop()) != null ? _b : item.image : item.image.name;
|
|
@@ -31340,7 +31530,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31340
31530
|
[chipHeightCls, den.chipGap, den.chipPad, removeAt]
|
|
31341
31531
|
);
|
|
31342
31532
|
const selectedCount = list.length;
|
|
31343
|
-
const resolveButtonTriggerElement =
|
|
31533
|
+
const resolveButtonTriggerElement = React76__namespace.useCallback(() => {
|
|
31344
31534
|
const ctx = {
|
|
31345
31535
|
open: popoverOpen,
|
|
31346
31536
|
items: list,
|
|
@@ -31370,7 +31560,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31370
31560
|
);
|
|
31371
31561
|
const child = el.props.children;
|
|
31372
31562
|
if (selectedBadgePlacement === "end") {
|
|
31373
|
-
return
|
|
31563
|
+
return React76__namespace.cloneElement(el, {
|
|
31374
31564
|
className: nextClass,
|
|
31375
31565
|
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
31376
31566
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0", children: child }),
|
|
@@ -31378,7 +31568,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31378
31568
|
] })
|
|
31379
31569
|
});
|
|
31380
31570
|
}
|
|
31381
|
-
return
|
|
31571
|
+
return React76__namespace.cloneElement(el, {
|
|
31382
31572
|
className: nextClass,
|
|
31383
31573
|
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31384
31574
|
child,
|
|
@@ -31386,7 +31576,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31386
31576
|
] })
|
|
31387
31577
|
});
|
|
31388
31578
|
};
|
|
31389
|
-
if (
|
|
31579
|
+
if (React76__namespace.isValidElement(rawNode))
|
|
31390
31580
|
return injectBadgeIntoElement(rawNode);
|
|
31391
31581
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
31392
31582
|
"button",
|
|
@@ -31418,12 +31608,12 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31418
31608
|
selectedCount,
|
|
31419
31609
|
triggerClassName
|
|
31420
31610
|
]);
|
|
31421
|
-
const [dragOver, setDragOver] =
|
|
31422
|
-
const fileInputRef =
|
|
31423
|
-
const [imgSelectedIds, setImgSelectedIds] =
|
|
31611
|
+
const [dragOver, setDragOver] = React76__namespace.useState(false);
|
|
31612
|
+
const fileInputRef = React76__namespace.useRef(null);
|
|
31613
|
+
const [imgSelectedIds, setImgSelectedIds] = React76__namespace.useState(
|
|
31424
31614
|
() => /* @__PURE__ */ new Set()
|
|
31425
31615
|
);
|
|
31426
|
-
const imageItems =
|
|
31616
|
+
const imageItems = React76__namespace.useMemo(() => {
|
|
31427
31617
|
return imagesSelected.map((x2) => normaliseFileLike2(x2.image));
|
|
31428
31618
|
}, [imagesSelected]);
|
|
31429
31619
|
const canAddMore = (nextCount) => {
|
|
@@ -31486,7 +31676,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31486
31676
|
setImagesFromItems(next, { from });
|
|
31487
31677
|
}
|
|
31488
31678
|
};
|
|
31489
|
-
const openImagePicker =
|
|
31679
|
+
const openImagePicker = React76__namespace.useCallback(async () => {
|
|
31490
31680
|
var _a;
|
|
31491
31681
|
if (isDisabled) return;
|
|
31492
31682
|
const resolvedLoader = typeof customLoader == "function" ? customLoader : customLoader ? getPaletteUtil("customLoader") : void 0;
|
|
@@ -31511,14 +31701,14 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31511
31701
|
}
|
|
31512
31702
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
31513
31703
|
}, [accept, customLoader, imageItems, isDisabled, mergeMode, multiple]);
|
|
31514
|
-
const onDragOver =
|
|
31704
|
+
const onDragOver = React76__namespace.useCallback(
|
|
31515
31705
|
(e4) => {
|
|
31516
31706
|
e4.preventDefault();
|
|
31517
31707
|
if (!isDisabled) setDragOver(true);
|
|
31518
31708
|
},
|
|
31519
31709
|
[isDisabled]
|
|
31520
31710
|
);
|
|
31521
|
-
const onDrop =
|
|
31711
|
+
const onDrop = React76__namespace.useCallback(
|
|
31522
31712
|
(e4) => {
|
|
31523
31713
|
var _a;
|
|
31524
31714
|
e4.preventDefault();
|
|
@@ -31567,7 +31757,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31567
31757
|
if (icons[0]) setPopoverOpen(false);
|
|
31568
31758
|
}
|
|
31569
31759
|
};
|
|
31570
|
-
const TriggerRegion =
|
|
31760
|
+
const TriggerRegion = React76__namespace.useMemo(() => {
|
|
31571
31761
|
const COLLAPSE_LIMIT = 2;
|
|
31572
31762
|
const hasItems = list.length > 0;
|
|
31573
31763
|
const visibleItems = list.slice(0, COLLAPSE_LIMIT);
|
|
@@ -31662,11 +31852,11 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31662
31852
|
PopoverContent,
|
|
31663
31853
|
{
|
|
31664
31854
|
className: cn(
|
|
31665
|
-
"w-(--radix-popover-trigger-width) p-0 max-h-(--radix-popper-available-height)",
|
|
31855
|
+
"w-(--radix-popover-trigger-width) p-0 max-h-(--radix-popper-available-height) overflow-hidden flex flex-col",
|
|
31666
31856
|
popoverClassName
|
|
31667
31857
|
),
|
|
31668
31858
|
align: "start",
|
|
31669
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
31859
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col flex-1 min-h-0", children: [
|
|
31670
31860
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
31671
31861
|
"div",
|
|
31672
31862
|
{
|
|
@@ -32197,7 +32387,7 @@ function FieldError({
|
|
|
32197
32387
|
errors,
|
|
32198
32388
|
...props
|
|
32199
32389
|
}) {
|
|
32200
|
-
const content =
|
|
32390
|
+
const content = React76.useMemo(() => {
|
|
32201
32391
|
var _a;
|
|
32202
32392
|
if (children) {
|
|
32203
32393
|
return children;
|
|
@@ -32318,11 +32508,11 @@ function buildLayoutGraph(args) {
|
|
|
32318
32508
|
}
|
|
32319
32509
|
};
|
|
32320
32510
|
}
|
|
32321
|
-
var CoreContextReact =
|
|
32511
|
+
var CoreContextReact = React76__namespace.default.createContext(
|
|
32322
32512
|
null
|
|
32323
32513
|
);
|
|
32324
32514
|
function useCoreContext() {
|
|
32325
|
-
const ctx =
|
|
32515
|
+
const ctx = React76.useContext(CoreContextReact);
|
|
32326
32516
|
if (!ctx) {
|
|
32327
32517
|
throw new Error("useCoreContext must be used within a <CoreProvider>.");
|
|
32328
32518
|
}
|
|
@@ -32350,41 +32540,41 @@ function useField(options) {
|
|
|
32350
32540
|
onValueChange,
|
|
32351
32541
|
onSubmit
|
|
32352
32542
|
} = options;
|
|
32353
|
-
const ref =
|
|
32354
|
-
const stateRef =
|
|
32543
|
+
const ref = React76__namespace.useRef(null);
|
|
32544
|
+
const stateRef = React76__namespace.useRef({
|
|
32355
32545
|
value: defaultValue,
|
|
32356
32546
|
error: "",
|
|
32357
32547
|
loading: false,
|
|
32358
32548
|
original: getOriginalValue ? getOriginalValue(defaultValue) : defaultValue
|
|
32359
32549
|
});
|
|
32360
|
-
const [valueState, setValueState] =
|
|
32550
|
+
const [valueState, setValueState] = React76__namespace.useState(
|
|
32361
32551
|
stateRef.current.value
|
|
32362
32552
|
);
|
|
32363
32553
|
const isControlled = valueProp !== void 0;
|
|
32364
32554
|
const value = isControlled ? valueProp : valueState;
|
|
32365
|
-
|
|
32555
|
+
React76__namespace.useEffect(() => {
|
|
32366
32556
|
if (isControlled && valueProp !== stateRef.current.value) {
|
|
32367
32557
|
stateRef.current.value = valueProp;
|
|
32368
32558
|
setValueState(valueProp);
|
|
32369
32559
|
}
|
|
32370
32560
|
}, [isControlled, valueProp]);
|
|
32371
|
-
const [error, setErrorState] =
|
|
32561
|
+
const [error, setErrorState] = React76__namespace.useState(
|
|
32372
32562
|
stateRef.current.error
|
|
32373
32563
|
);
|
|
32374
|
-
const [loading, setLoadingState] =
|
|
32564
|
+
const [loading, setLoadingState] = React76__namespace.useState(
|
|
32375
32565
|
stateRef.current.loading
|
|
32376
32566
|
);
|
|
32377
|
-
const [required, setRequired] =
|
|
32567
|
+
const [required, setRequired] = React76__namespace.useState(
|
|
32378
32568
|
Boolean(requiredProp)
|
|
32379
32569
|
);
|
|
32380
|
-
const [disabled, setDisabled] =
|
|
32570
|
+
const [disabled, setDisabled] = React76__namespace.useState(
|
|
32381
32571
|
Boolean(disabledProp)
|
|
32382
32572
|
);
|
|
32383
|
-
const [readOnly, setReadOnly] =
|
|
32573
|
+
const [readOnly, setReadOnly] = React76__namespace.useState(
|
|
32384
32574
|
Boolean(readOnlyProp)
|
|
32385
32575
|
);
|
|
32386
|
-
const id =
|
|
32387
|
-
const keyRef =
|
|
32576
|
+
const id = React76__namespace.useId();
|
|
32577
|
+
const keyRef = React76__namespace.useRef(
|
|
32388
32578
|
(() => {
|
|
32389
32579
|
if (rawName && rawName.trim()) return `${rawName.trim()}-${id}`;
|
|
32390
32580
|
if (rawBindId && rawBindId.trim())
|
|
@@ -32392,10 +32582,10 @@ function useField(options) {
|
|
|
32392
32582
|
return `field-${Math.random().toString(36).slice(2)}-${id}`;
|
|
32393
32583
|
})()
|
|
32394
32584
|
);
|
|
32395
|
-
const bindIdRef =
|
|
32585
|
+
const bindIdRef = React76__namespace.useRef(
|
|
32396
32586
|
rawBindId && rawBindId.trim() || keyRef.current
|
|
32397
32587
|
);
|
|
32398
|
-
const fieldRef =
|
|
32588
|
+
const fieldRef = React76__namespace.useRef(null);
|
|
32399
32589
|
if (!fieldRef.current) {
|
|
32400
32590
|
const key = keyRef.current;
|
|
32401
32591
|
const bindId = bindIdRef.current;
|
|
@@ -32498,19 +32688,19 @@ function useField(options) {
|
|
|
32498
32688
|
fieldRef.current = f2;
|
|
32499
32689
|
}
|
|
32500
32690
|
const field = fieldRef.current;
|
|
32501
|
-
|
|
32691
|
+
React76__namespace.useEffect(() => {
|
|
32502
32692
|
setRequired(requiredProp);
|
|
32503
32693
|
if (field) {
|
|
32504
32694
|
field.required = requiredProp;
|
|
32505
32695
|
}
|
|
32506
32696
|
}, [requiredProp, field]);
|
|
32507
|
-
|
|
32697
|
+
React76__namespace.useEffect(() => {
|
|
32508
32698
|
setDisabled(disabledProp);
|
|
32509
32699
|
}, [disabledProp]);
|
|
32510
|
-
|
|
32700
|
+
React76__namespace.useEffect(() => {
|
|
32511
32701
|
setReadOnly(readOnlyProp);
|
|
32512
32702
|
}, [readOnlyProp]);
|
|
32513
|
-
|
|
32703
|
+
React76__namespace.useEffect(() => {
|
|
32514
32704
|
if (!field) return;
|
|
32515
32705
|
form.addField(field);
|
|
32516
32706
|
return () => {
|
|
@@ -32625,25 +32815,25 @@ function useOptionalField(options) {
|
|
|
32625
32815
|
getOriginalValue,
|
|
32626
32816
|
onValueChange
|
|
32627
32817
|
} = options;
|
|
32628
|
-
const ref =
|
|
32629
|
-
const [valueState, setValueState] =
|
|
32818
|
+
const ref = React76__namespace.useRef(null);
|
|
32819
|
+
const [valueState, setValueState] = React76__namespace.useState(defaultValue);
|
|
32630
32820
|
const isControlled = valueProp !== void 0;
|
|
32631
32821
|
const value = isControlled ? valueProp : valueState;
|
|
32632
|
-
|
|
32822
|
+
React76__namespace.useEffect(() => {
|
|
32633
32823
|
if (isControlled) {
|
|
32634
32824
|
setValueState(valueProp);
|
|
32635
32825
|
}
|
|
32636
32826
|
}, [isControlled, valueProp]);
|
|
32637
|
-
const [error, setErrorState] =
|
|
32638
|
-
const [loading, setLoadingState] =
|
|
32639
|
-
const [required, setRequired] =
|
|
32640
|
-
const [disabled, setDisabled] =
|
|
32641
|
-
const [readOnly, setReadOnly] =
|
|
32642
|
-
const originalRef =
|
|
32827
|
+
const [error, setErrorState] = React76__namespace.useState("");
|
|
32828
|
+
const [loading, setLoadingState] = React76__namespace.useState(false);
|
|
32829
|
+
const [required, setRequired] = React76__namespace.useState(requiredProp);
|
|
32830
|
+
const [disabled, setDisabled] = React76__namespace.useState(disabledProp);
|
|
32831
|
+
const [readOnly, setReadOnly] = React76__namespace.useState(readOnlyProp);
|
|
32832
|
+
const originalRef = React76__namespace.useRef(
|
|
32643
32833
|
getOriginalValue ? getOriginalValue(defaultValue) : defaultValue
|
|
32644
32834
|
);
|
|
32645
|
-
const id =
|
|
32646
|
-
const keyRef =
|
|
32835
|
+
const id = React76__namespace.useId();
|
|
32836
|
+
const keyRef = React76__namespace.useRef("");
|
|
32647
32837
|
if (!keyRef.current) {
|
|
32648
32838
|
if (rawName && rawName.trim()) {
|
|
32649
32839
|
keyRef.current = `${rawName.trim()}-${id}`;
|
|
@@ -32653,17 +32843,17 @@ function useOptionalField(options) {
|
|
|
32653
32843
|
keyRef.current = `field-${Math.random().toString(36).slice(2)}-${id}`;
|
|
32654
32844
|
}
|
|
32655
32845
|
}
|
|
32656
|
-
const bindIdRef =
|
|
32846
|
+
const bindIdRef = React76__namespace.useRef("");
|
|
32657
32847
|
if (!bindIdRef.current) {
|
|
32658
32848
|
bindIdRef.current = rawBindId && rawBindId.trim() || keyRef.current;
|
|
32659
32849
|
}
|
|
32660
|
-
|
|
32850
|
+
React76__namespace.useEffect(() => {
|
|
32661
32851
|
setRequired(requiredProp);
|
|
32662
32852
|
}, [requiredProp]);
|
|
32663
|
-
|
|
32853
|
+
React76__namespace.useEffect(() => {
|
|
32664
32854
|
setDisabled(disabledProp);
|
|
32665
32855
|
}, [disabledProp]);
|
|
32666
|
-
|
|
32856
|
+
React76__namespace.useEffect(() => {
|
|
32667
32857
|
setReadOnly(readOnlyProp);
|
|
32668
32858
|
}, [readOnlyProp]);
|
|
32669
32859
|
function setValue(next, variant = "direct") {
|
|
@@ -32739,6 +32929,11 @@ function useOptionalField(options) {
|
|
|
32739
32929
|
}
|
|
32740
32930
|
};
|
|
32741
32931
|
}
|
|
32932
|
+
var ThemeContext = React76__namespace.createContext(null);
|
|
32933
|
+
function usePaletteTheme() {
|
|
32934
|
+
var _a;
|
|
32935
|
+
return (_a = React76__namespace.useContext(ThemeContext)) != null ? _a : {};
|
|
32936
|
+
}
|
|
32742
32937
|
function normalizeValidateResult(result) {
|
|
32743
32938
|
if (result === void 0 || result === null || result === true) return [];
|
|
32744
32939
|
if (result === false) return ["Invalid value."];
|
|
@@ -32760,7 +32955,7 @@ function resolveLayoutForField(defaults, overrides, props, variantResolve) {
|
|
|
32760
32955
|
...overrides
|
|
32761
32956
|
};
|
|
32762
32957
|
}
|
|
32763
|
-
function renderHelperSlot(root, slot, classes) {
|
|
32958
|
+
function renderHelperSlot(root, slot, classes, styles) {
|
|
32764
32959
|
const placement = slot.placement;
|
|
32765
32960
|
switch (slot.id) {
|
|
32766
32961
|
case "sublabel":
|
|
@@ -32771,6 +32966,7 @@ function renderHelperSlot(root, slot, classes) {
|
|
|
32771
32966
|
"text-xs text-muted-foreground",
|
|
32772
32967
|
classes == null ? void 0 : classes.sublabel
|
|
32773
32968
|
),
|
|
32969
|
+
style: styles == null ? void 0 : styles.sublabel,
|
|
32774
32970
|
"data-slot": `sublabel-${placement}`,
|
|
32775
32971
|
children: slot.content
|
|
32776
32972
|
},
|
|
@@ -32784,6 +32980,7 @@ function renderHelperSlot(root, slot, classes) {
|
|
|
32784
32980
|
"text-xs text-muted-foreground",
|
|
32785
32981
|
classes == null ? void 0 : classes.description
|
|
32786
32982
|
),
|
|
32983
|
+
style: styles == null ? void 0 : styles.description,
|
|
32787
32984
|
"data-slot": `description-${placement}`,
|
|
32788
32985
|
children: slot.content
|
|
32789
32986
|
},
|
|
@@ -32797,6 +32994,7 @@ function renderHelperSlot(root, slot, classes) {
|
|
|
32797
32994
|
"text-xs text-muted-foreground",
|
|
32798
32995
|
classes == null ? void 0 : classes.helpText
|
|
32799
32996
|
),
|
|
32997
|
+
style: styles == null ? void 0 : styles.helpText,
|
|
32800
32998
|
"data-slot": `helptext-${placement}`,
|
|
32801
32999
|
children: slot.content
|
|
32802
33000
|
},
|
|
@@ -32807,6 +33005,7 @@ function renderHelperSlot(root, slot, classes) {
|
|
|
32807
33005
|
FieldError,
|
|
32808
33006
|
{
|
|
32809
33007
|
className: cn("text-xs text-destructive", classes == null ? void 0 : classes.error),
|
|
33008
|
+
style: styles == null ? void 0 : styles.error,
|
|
32810
33009
|
"data-slot": `error-${placement}`,
|
|
32811
33010
|
children: slot.content
|
|
32812
33011
|
},
|
|
@@ -32817,6 +33016,7 @@ function renderHelperSlot(root, slot, classes) {
|
|
|
32817
33016
|
"div",
|
|
32818
33017
|
{
|
|
32819
33018
|
className: cn("flex items-center gap-1", classes == null ? void 0 : classes.tags),
|
|
33019
|
+
style: (styles == null ? void 0 : styles.tags) || (styles == null ? void 0 : styles.tag),
|
|
32820
33020
|
"data-slot": `tags-${placement}`,
|
|
32821
33021
|
children: slot.content
|
|
32822
33022
|
},
|
|
@@ -32826,29 +33026,66 @@ function renderHelperSlot(root, slot, classes) {
|
|
|
32826
33026
|
return null;
|
|
32827
33027
|
}
|
|
32828
33028
|
}
|
|
32829
|
-
function getClasses(props) {
|
|
33029
|
+
function getClasses(props, themeClasses, variantThemeClasses) {
|
|
32830
33030
|
var _a;
|
|
32831
33031
|
const legacy = (_a = props.classes) != null ? _a : {};
|
|
32832
33032
|
return {
|
|
32833
|
-
root: cn(legacy.root, props.className) || void 0,
|
|
32834
|
-
labelRow: cn(legacy.labelRow, props.labelRowClassName) || void 0,
|
|
32835
|
-
inlineRow: cn(legacy.inlineRow, props.inlineRowClassName) || void 0,
|
|
32836
|
-
label: cn(legacy.label, props.labelClassName) || void 0,
|
|
32837
|
-
sublabel: cn(legacy.sublabel, props.sublabelClassName) || void 0,
|
|
32838
|
-
description: cn(legacy.description, props.descriptionClassName) || void 0,
|
|
32839
|
-
helpText: cn(legacy.helpText, props.helpTextClassName) || void 0,
|
|
32840
|
-
error: cn(legacy.error, props.errorClassName) || void 0,
|
|
32841
|
-
group: cn(legacy.group, props.groupClassName) || void 0,
|
|
32842
|
-
content: cn(legacy.content, props.contentClassName) || void 0,
|
|
32843
|
-
variant: cn(legacy.variant, props.variantClassName) || void 0,
|
|
32844
|
-
inlineInputColumn: cn(legacy.inlineInputColumn, props.inlineInputColumnClassName) || void 0,
|
|
32845
|
-
inlineLabelColumn: cn(legacy.inlineLabelColumn, props.inlineLabelColumnClassName) || void 0,
|
|
32846
|
-
required: cn(legacy.required, props.requiredClassName) || void 0,
|
|
32847
|
-
tag: cn(legacy.tag, props.tagClassName) || void 0
|
|
33033
|
+
root: cn(themeClasses == null ? void 0 : themeClasses.root, variantThemeClasses == null ? void 0 : variantThemeClasses.root, legacy.root, props.className) || void 0,
|
|
33034
|
+
labelRow: cn(themeClasses == null ? void 0 : themeClasses.labelRow, variantThemeClasses == null ? void 0 : variantThemeClasses.labelRow, legacy.labelRow, props.labelRowClassName) || void 0,
|
|
33035
|
+
inlineRow: cn(themeClasses == null ? void 0 : themeClasses.inlineRow, variantThemeClasses == null ? void 0 : variantThemeClasses.inlineRow, legacy.inlineRow, props.inlineRowClassName) || void 0,
|
|
33036
|
+
label: cn(themeClasses == null ? void 0 : themeClasses.label, variantThemeClasses == null ? void 0 : variantThemeClasses.label, legacy.label, props.labelClassName) || void 0,
|
|
33037
|
+
sublabel: cn(themeClasses == null ? void 0 : themeClasses.sublabel, variantThemeClasses == null ? void 0 : variantThemeClasses.sublabel, legacy.sublabel, props.sublabelClassName) || void 0,
|
|
33038
|
+
description: cn(themeClasses == null ? void 0 : themeClasses.description, variantThemeClasses == null ? void 0 : variantThemeClasses.description, legacy.description, props.descriptionClassName) || void 0,
|
|
33039
|
+
helpText: cn(themeClasses == null ? void 0 : themeClasses.helpText, variantThemeClasses == null ? void 0 : variantThemeClasses.helpText, legacy.helpText, props.helpTextClassName) || void 0,
|
|
33040
|
+
error: cn(themeClasses == null ? void 0 : themeClasses.error, variantThemeClasses == null ? void 0 : variantThemeClasses.error, legacy.error, props.errorClassName) || void 0,
|
|
33041
|
+
group: cn(themeClasses == null ? void 0 : themeClasses.group, variantThemeClasses == null ? void 0 : variantThemeClasses.group, legacy.group, props.groupClassName) || void 0,
|
|
33042
|
+
content: cn(themeClasses == null ? void 0 : themeClasses.content, variantThemeClasses == null ? void 0 : variantThemeClasses.content, legacy.content, props.contentClassName) || void 0,
|
|
33043
|
+
variant: cn(themeClasses == null ? void 0 : themeClasses.variant, variantThemeClasses == null ? void 0 : variantThemeClasses.variant, legacy.variant, props.variantClassName) || void 0,
|
|
33044
|
+
inlineInputColumn: cn(themeClasses == null ? void 0 : themeClasses.inlineInputColumn, variantThemeClasses == null ? void 0 : variantThemeClasses.inlineInputColumn, legacy.inlineInputColumn, props.inlineInputColumnClassName) || void 0,
|
|
33045
|
+
inlineLabelColumn: cn(themeClasses == null ? void 0 : themeClasses.inlineLabelColumn, variantThemeClasses == null ? void 0 : variantThemeClasses.inlineLabelColumn, legacy.inlineLabelColumn, props.inlineLabelColumnClassName) || void 0,
|
|
33046
|
+
required: cn(themeClasses == null ? void 0 : themeClasses.required, variantThemeClasses == null ? void 0 : variantThemeClasses.required, legacy.required, props.requiredClassName) || void 0,
|
|
33047
|
+
tag: cn(themeClasses == null ? void 0 : themeClasses.tag, variantThemeClasses == null ? void 0 : variantThemeClasses.tag, legacy.tag, props.tagClassName) || void 0
|
|
32848
33048
|
};
|
|
32849
33049
|
}
|
|
33050
|
+
function mergeStyles(propsStyles, themeStyles, variantThemeStyles) {
|
|
33051
|
+
const keys = [
|
|
33052
|
+
"root",
|
|
33053
|
+
"labelRow",
|
|
33054
|
+
"inlineRow",
|
|
33055
|
+
"label",
|
|
33056
|
+
"sublabel",
|
|
33057
|
+
"description",
|
|
33058
|
+
"helpText",
|
|
33059
|
+
"error",
|
|
33060
|
+
"group",
|
|
33061
|
+
"content",
|
|
33062
|
+
"variant",
|
|
33063
|
+
"inlineInputColumn",
|
|
33064
|
+
"inlineLabelColumn",
|
|
33065
|
+
"required",
|
|
33066
|
+
"tag"
|
|
33067
|
+
];
|
|
33068
|
+
const result = {};
|
|
33069
|
+
for (const key of keys) {
|
|
33070
|
+
const s3 = {
|
|
33071
|
+
...themeStyles == null ? void 0 : themeStyles[key],
|
|
33072
|
+
...variantThemeStyles == null ? void 0 : variantThemeStyles[key],
|
|
33073
|
+
...propsStyles == null ? void 0 : propsStyles[key]
|
|
33074
|
+
};
|
|
33075
|
+
if (Object.keys(s3).length > 0) {
|
|
33076
|
+
result[key] = s3;
|
|
33077
|
+
}
|
|
33078
|
+
}
|
|
33079
|
+
return result;
|
|
33080
|
+
}
|
|
32850
33081
|
function InputField(props) {
|
|
32851
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
33082
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
33083
|
+
const theme = usePaletteTheme();
|
|
33084
|
+
const mergedProps = {
|
|
33085
|
+
...theme.defaultProps,
|
|
33086
|
+
...props.variant ? (_b = (_a = theme.variants) == null ? void 0 : _a[props.variant]) == null ? void 0 : _b.defaultProps : void 0,
|
|
33087
|
+
...props
|
|
33088
|
+
};
|
|
32852
33089
|
const {
|
|
32853
33090
|
variant,
|
|
32854
33091
|
onSubmit,
|
|
@@ -32893,7 +33130,7 @@ function InputField(props) {
|
|
|
32893
33130
|
classes: _depreciated,
|
|
32894
33131
|
// Everything else → forwarded to variant
|
|
32895
33132
|
...rest
|
|
32896
|
-
} =
|
|
33133
|
+
} = mergedProps;
|
|
32897
33134
|
const module2 = getVariant(variant);
|
|
32898
33135
|
if (!module2) {
|
|
32899
33136
|
{
|
|
@@ -32905,8 +33142,13 @@ function InputField(props) {
|
|
|
32905
33142
|
}
|
|
32906
33143
|
return null;
|
|
32907
33144
|
}
|
|
32908
|
-
const
|
|
32909
|
-
const
|
|
33145
|
+
const themeClasses = theme.classes;
|
|
33146
|
+
const themeVariantClasses = variant ? (_d = (_c = theme.variants) == null ? void 0 : _c[variant]) == null ? void 0 : _d.classes : void 0;
|
|
33147
|
+
const classes = getClasses(mergedProps, themeClasses, themeVariantClasses);
|
|
33148
|
+
const themeStyles = theme.styles;
|
|
33149
|
+
const themeVariantStyles = variant ? (_f = (_e = theme.variants) == null ? void 0 : _e[variant]) == null ? void 0 : _f.styles : void 0;
|
|
33150
|
+
const mergedStyles = mergeStyles(mergedProps.styles, themeStyles, themeVariantStyles);
|
|
33151
|
+
const layout = React76__namespace.useMemo(() => {
|
|
32910
33152
|
var _a2;
|
|
32911
33153
|
const defaultsLayout = (_a2 = module2.defaults) == null ? void 0 : _a2.layout;
|
|
32912
33154
|
const overrides = {};
|
|
@@ -32937,7 +33179,7 @@ function InputField(props) {
|
|
|
32937
33179
|
return resolveLayoutForField(
|
|
32938
33180
|
defaultsLayout,
|
|
32939
33181
|
overrides,
|
|
32940
|
-
|
|
33182
|
+
mergedProps,
|
|
32941
33183
|
module2.resolveLayout
|
|
32942
33184
|
);
|
|
32943
33185
|
}, [
|
|
@@ -32950,11 +33192,11 @@ function InputField(props) {
|
|
|
32950
33192
|
tagPlacement,
|
|
32951
33193
|
inline,
|
|
32952
33194
|
fullWidth,
|
|
32953
|
-
|
|
33195
|
+
mergedProps
|
|
32954
33196
|
]);
|
|
32955
|
-
const effectiveSize = (
|
|
32956
|
-
const effectiveDensity = (
|
|
32957
|
-
const validate =
|
|
33197
|
+
const effectiveSize = (_i = size != null ? size : (_h = (_g = module2.defaults) == null ? void 0 : _g.layout) == null ? void 0 : _h.defaultSize) != null ? _i : void 0;
|
|
33198
|
+
const effectiveDensity = (_l = density != null ? density : (_k = (_j = module2.defaults) == null ? void 0 : _j.layout) == null ? void 0 : _k.defaultDensity) != null ? _l : void 0;
|
|
33199
|
+
const validate = React76__namespace.useCallback(
|
|
32958
33200
|
(value2, field2, form, _report) => {
|
|
32959
33201
|
var _a2;
|
|
32960
33202
|
const messages = [];
|
|
@@ -32994,7 +33236,7 @@ function InputField(props) {
|
|
|
32994
33236
|
const { value: fieldValue, setValue, error, ref, key } = field;
|
|
32995
33237
|
const Variant = module2.Variant;
|
|
32996
33238
|
const visualError = (errorText != null ? errorText : error) || "";
|
|
32997
|
-
const handleValueChange =
|
|
33239
|
+
const handleValueChange = React76__namespace.useCallback(
|
|
32998
33240
|
(next, detail) => {
|
|
32999
33241
|
let finalValue = next;
|
|
33000
33242
|
let defaultPrevented = false;
|
|
@@ -33043,7 +33285,7 @@ function InputField(props) {
|
|
|
33043
33285
|
hostVariantClass,
|
|
33044
33286
|
classes == null ? void 0 : classes.variant
|
|
33045
33287
|
) || void 0;
|
|
33046
|
-
const tagsContent =
|
|
33288
|
+
const tagsContent = React76__namespace.useMemo(() => {
|
|
33047
33289
|
const items = tags != null ? tags : [];
|
|
33048
33290
|
if (!items.length) return null;
|
|
33049
33291
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: items.map((tag, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -33067,7 +33309,7 @@ function InputField(props) {
|
|
|
33067
33309
|
index
|
|
33068
33310
|
)) });
|
|
33069
33311
|
}, [tags, classes == null ? void 0 : classes.tag]);
|
|
33070
|
-
const graph =
|
|
33312
|
+
const graph = React76__namespace.useMemo(
|
|
33071
33313
|
() => buildLayoutGraph({
|
|
33072
33314
|
layout,
|
|
33073
33315
|
sublabel,
|
|
@@ -33111,15 +33353,15 @@ function InputField(props) {
|
|
|
33111
33353
|
"[container-type:normal]",
|
|
33112
33354
|
"[container-name:none]",
|
|
33113
33355
|
classes == null ? void 0 : classes.group
|
|
33114
|
-
) : (
|
|
33356
|
+
) : (_m = classes == null ? void 0 : classes.group) != null ? _m : void 0;
|
|
33115
33357
|
const inlineFieldContentClass = isCompactInline ? cn("flex-none w-auto", classes == null ? void 0 : classes.content) : cn("w-full", classes == null ? void 0 : classes.content);
|
|
33116
|
-
const inlineInputColumn = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: inlineInputColClass, children: [
|
|
33358
|
+
const inlineInputColumn = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: inlineInputColClass, style: mergedStyles.inlineInputColumn, children: [
|
|
33117
33359
|
graph.getSlotsFor("input", "above").render(
|
|
33118
33360
|
(slots) => slots.map(
|
|
33119
|
-
(slot) => renderHelperSlot("input", slot, classes)
|
|
33361
|
+
(slot) => renderHelperSlot("input", slot, classes, mergedStyles)
|
|
33120
33362
|
)
|
|
33121
33363
|
),
|
|
33122
|
-
/* @__PURE__ */ jsxRuntime.jsx(FieldGroup, { className: inlineFieldGroupClass, children: /* @__PURE__ */ jsxRuntime.jsx(FieldContent, { className: inlineFieldContentClass, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33364
|
+
/* @__PURE__ */ jsxRuntime.jsx(FieldGroup, { className: inlineFieldGroupClass, style: mergedStyles.group, children: /* @__PURE__ */ jsxRuntime.jsx(FieldContent, { className: inlineFieldContentClass, style: mergedStyles.content, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33123
33365
|
Variant,
|
|
33124
33366
|
{
|
|
33125
33367
|
...rest,
|
|
@@ -33133,19 +33375,20 @@ function InputField(props) {
|
|
|
33133
33375
|
readOnly: readOnlyProp,
|
|
33134
33376
|
size: effectiveSize,
|
|
33135
33377
|
density: effectiveDensity,
|
|
33136
|
-
className: mergedVariantClass
|
|
33378
|
+
className: mergedVariantClass,
|
|
33379
|
+
style: { ...mergedStyles.variant, ...rest.style }
|
|
33137
33380
|
}
|
|
33138
33381
|
) }) }),
|
|
33139
33382
|
graph.getSlotsFor("input", "below").render(
|
|
33140
33383
|
(slots) => slots.map(
|
|
33141
|
-
(slot) => renderHelperSlot("input", slot, classes)
|
|
33384
|
+
(slot) => renderHelperSlot("input", slot, classes, mergedStyles)
|
|
33142
33385
|
)
|
|
33143
33386
|
)
|
|
33144
33387
|
] });
|
|
33145
|
-
const inlineLabelColumn = inlineLabelSide === "hidden" || !hasAnyLabelBlockContent ? null : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-0", inlineLabelColClass), children: [
|
|
33388
|
+
const inlineLabelColumn = inlineLabelSide === "hidden" || !hasAnyLabelBlockContent ? null : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-0", inlineLabelColClass), style: mergedStyles.inlineLabelColumn, children: [
|
|
33146
33389
|
graph.getSlotsFor("label", "above").render(
|
|
33147
33390
|
(slots) => slots.map(
|
|
33148
|
-
(slot) => renderHelperSlot("label", slot, classes)
|
|
33391
|
+
(slot) => renderHelperSlot("label", slot, classes, mergedStyles)
|
|
33149
33392
|
)
|
|
33150
33393
|
),
|
|
33151
33394
|
hasLabelRowContent && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -33155,10 +33398,11 @@ function InputField(props) {
|
|
|
33155
33398
|
"flex items-baseline justify-between gap-1",
|
|
33156
33399
|
classes == null ? void 0 : classes.labelRow
|
|
33157
33400
|
),
|
|
33401
|
+
style: mergedStyles.labelRow,
|
|
33158
33402
|
"data-slot": "label-row",
|
|
33159
33403
|
children: [
|
|
33160
33404
|
graph.getSlotsFor("label", "left").render((slots) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-1", children: slots.map(
|
|
33161
|
-
(slot) => renderHelperSlot("label", slot, classes)
|
|
33405
|
+
(slot) => renderHelperSlot("label", slot, classes, mergedStyles)
|
|
33162
33406
|
) })),
|
|
33163
33407
|
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
33164
33408
|
FieldLabel,
|
|
@@ -33168,6 +33412,7 @@ function InputField(props) {
|
|
|
33168
33412
|
"text-sm font-medium text-foreground",
|
|
33169
33413
|
classes == null ? void 0 : classes.label
|
|
33170
33414
|
),
|
|
33415
|
+
style: mergedStyles.label,
|
|
33171
33416
|
children: /* @__PURE__ */ jsxRuntime.jsxs(FieldTitle, { children: [
|
|
33172
33417
|
label,
|
|
33173
33418
|
" ",
|
|
@@ -33178,6 +33423,7 @@ function InputField(props) {
|
|
|
33178
33423
|
"text-destructive",
|
|
33179
33424
|
classes == null ? void 0 : classes.required
|
|
33180
33425
|
),
|
|
33426
|
+
style: mergedStyles.required,
|
|
33181
33427
|
children: "*"
|
|
33182
33428
|
}
|
|
33183
33429
|
) : ""
|
|
@@ -33185,14 +33431,14 @@ function InputField(props) {
|
|
|
33185
33431
|
}
|
|
33186
33432
|
),
|
|
33187
33433
|
graph.getSlotsFor("label", "right").render((slots) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-1", children: slots.map(
|
|
33188
|
-
(slot) => renderHelperSlot("label", slot, classes)
|
|
33434
|
+
(slot) => renderHelperSlot("label", slot, classes, mergedStyles)
|
|
33189
33435
|
) }))
|
|
33190
33436
|
]
|
|
33191
33437
|
}
|
|
33192
33438
|
),
|
|
33193
33439
|
graph.getSlotsFor("label", "below").render(
|
|
33194
33440
|
(slots) => slots.map(
|
|
33195
|
-
(slot) => renderHelperSlot("label", slot, classes)
|
|
33441
|
+
(slot) => renderHelperSlot("label", slot, classes, mergedStyles)
|
|
33196
33442
|
)
|
|
33197
33443
|
)
|
|
33198
33444
|
] });
|
|
@@ -33206,14 +33452,14 @@ function InputField(props) {
|
|
|
33206
33452
|
hasStackedLabelBlock && hasLabelRowContent && "mt-0.5",
|
|
33207
33453
|
classes == null ? void 0 : classes.group
|
|
33208
33454
|
);
|
|
33209
|
-
const Element = contain ? "div" :
|
|
33455
|
+
const Element = contain ? "div" : React76__namespace.Fragment;
|
|
33210
33456
|
const attrs = (a3 = "l") => contain ? a3 === "l" ? { className: "p-4 border-b border-input" } : { className: "px-4 pt-2 pb-4" } : {};
|
|
33211
33457
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
33212
33458
|
Field,
|
|
33213
33459
|
{
|
|
33214
33460
|
className: rootClassName,
|
|
33215
33461
|
ref,
|
|
33216
|
-
style,
|
|
33462
|
+
style: { ...mergedStyles.root, ...style },
|
|
33217
33463
|
"data-variant": String(variant),
|
|
33218
33464
|
"data-label-placement": lp != null ? lp : void 0,
|
|
33219
33465
|
"data-sublabel-placement": sp != null ? sp : void 0,
|
|
@@ -33225,7 +33471,7 @@ function InputField(props) {
|
|
|
33225
33471
|
"data-fullwidth": layout.fullWidth ? "true" : "false",
|
|
33226
33472
|
children: isInline ? (
|
|
33227
33473
|
// INLINE MODE: label + control on the same row
|
|
33228
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: inlineRowClassName, "data-slot": "inline-row", children: inlineLabelSide === "right" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
33474
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: inlineRowClassName, style: mergedStyles.inlineRow, "data-slot": "inline-row", children: inlineLabelSide === "right" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
33229
33475
|
inlineInputColumn,
|
|
33230
33476
|
inlineLabelColumn
|
|
33231
33477
|
] }) : inlineLabelSide === "hidden" ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: inlineInputColumn }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -33241,7 +33487,8 @@ function InputField(props) {
|
|
|
33241
33487
|
(slot) => renderHelperSlot(
|
|
33242
33488
|
"label",
|
|
33243
33489
|
slot,
|
|
33244
|
-
classes
|
|
33490
|
+
classes,
|
|
33491
|
+
mergedStyles
|
|
33245
33492
|
)
|
|
33246
33493
|
)
|
|
33247
33494
|
),
|
|
@@ -33252,13 +33499,15 @@ function InputField(props) {
|
|
|
33252
33499
|
"flex items-baseline justify-between gap-1",
|
|
33253
33500
|
classes == null ? void 0 : classes.labelRow
|
|
33254
33501
|
),
|
|
33502
|
+
style: mergedStyles.labelRow,
|
|
33255
33503
|
"data-slot": "label-row",
|
|
33256
33504
|
children: [
|
|
33257
33505
|
graph.getSlotsFor("label", "left").render((slots) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-1", children: slots.map(
|
|
33258
33506
|
(slot) => renderHelperSlot(
|
|
33259
33507
|
"label",
|
|
33260
33508
|
slot,
|
|
33261
|
-
classes
|
|
33509
|
+
classes,
|
|
33510
|
+
mergedStyles
|
|
33262
33511
|
)
|
|
33263
33512
|
) })),
|
|
33264
33513
|
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -33269,6 +33518,7 @@ function InputField(props) {
|
|
|
33269
33518
|
"text-sm font-medium text-foreground",
|
|
33270
33519
|
classes == null ? void 0 : classes.label
|
|
33271
33520
|
),
|
|
33521
|
+
style: mergedStyles.label,
|
|
33272
33522
|
children: /* @__PURE__ */ jsxRuntime.jsxs(FieldTitle, { children: [
|
|
33273
33523
|
label,
|
|
33274
33524
|
" ",
|
|
@@ -33279,6 +33529,7 @@ function InputField(props) {
|
|
|
33279
33529
|
"text-destructive",
|
|
33280
33530
|
classes == null ? void 0 : classes.required
|
|
33281
33531
|
),
|
|
33532
|
+
style: mergedStyles.required,
|
|
33282
33533
|
children: "*"
|
|
33283
33534
|
}
|
|
33284
33535
|
) : ""
|
|
@@ -33289,7 +33540,8 @@ function InputField(props) {
|
|
|
33289
33540
|
(slot) => renderHelperSlot(
|
|
33290
33541
|
"label",
|
|
33291
33542
|
slot,
|
|
33292
|
-
classes
|
|
33543
|
+
classes,
|
|
33544
|
+
mergedStyles
|
|
33293
33545
|
)
|
|
33294
33546
|
) }))
|
|
33295
33547
|
]
|
|
@@ -33300,7 +33552,8 @@ function InputField(props) {
|
|
|
33300
33552
|
(slot) => renderHelperSlot(
|
|
33301
33553
|
"label",
|
|
33302
33554
|
slot,
|
|
33303
|
-
classes
|
|
33555
|
+
classes,
|
|
33556
|
+
mergedStyles
|
|
33304
33557
|
)
|
|
33305
33558
|
)
|
|
33306
33559
|
)
|
|
@@ -33308,13 +33561,14 @@ function InputField(props) {
|
|
|
33308
33561
|
/* @__PURE__ */ jsxRuntime.jsxs(Element, { ...attrs("i"), children: [
|
|
33309
33562
|
graph.getSlotsFor("input", "above").render(
|
|
33310
33563
|
(slots) => slots.map(
|
|
33311
|
-
(slot) => renderHelperSlot("input", slot, classes)
|
|
33564
|
+
(slot) => renderHelperSlot("input", slot, classes, mergedStyles)
|
|
33312
33565
|
)
|
|
33313
33566
|
),
|
|
33314
|
-
/* @__PURE__ */ jsxRuntime.jsx(FieldGroup, { className: stackedGroupClassName, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33567
|
+
/* @__PURE__ */ jsxRuntime.jsx(FieldGroup, { className: stackedGroupClassName, style: mergedStyles.group, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33315
33568
|
FieldContent,
|
|
33316
33569
|
{
|
|
33317
33570
|
className: cn("w-full", classes == null ? void 0 : classes.content),
|
|
33571
|
+
style: mergedStyles.content,
|
|
33318
33572
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33319
33573
|
Variant,
|
|
33320
33574
|
{
|
|
@@ -33329,14 +33583,15 @@ function InputField(props) {
|
|
|
33329
33583
|
readOnly: readOnlyProp,
|
|
33330
33584
|
size: effectiveSize,
|
|
33331
33585
|
density: effectiveDensity,
|
|
33332
|
-
className: mergedVariantClass
|
|
33586
|
+
className: mergedVariantClass,
|
|
33587
|
+
style: { ...mergedStyles.variant, ...rest.style }
|
|
33333
33588
|
}
|
|
33334
33589
|
)
|
|
33335
33590
|
}
|
|
33336
33591
|
) }),
|
|
33337
33592
|
graph.getSlotsFor("input", "below").render(
|
|
33338
33593
|
(slots) => slots.map(
|
|
33339
|
-
(slot) => renderHelperSlot("input", slot, classes)
|
|
33594
|
+
(slot) => renderHelperSlot("input", slot, classes, mergedStyles)
|
|
33340
33595
|
)
|
|
33341
33596
|
)
|
|
33342
33597
|
] })
|
|
@@ -33375,14 +33630,14 @@ function ListerFiltersButton(props) {
|
|
|
33375
33630
|
const hasFilters = options.length > 0;
|
|
33376
33631
|
if (!hasFilters) return null;
|
|
33377
33632
|
const ctx = actions.getFilterCtx(id);
|
|
33378
|
-
const [openGroups, setOpenGroups] =
|
|
33633
|
+
const [openGroups, setOpenGroups] = React76__namespace.useState(
|
|
33379
33634
|
{}
|
|
33380
33635
|
);
|
|
33381
33636
|
const toggleGroup = (key) => {
|
|
33382
33637
|
setOpenGroups((m2) => ({ ...m2, [key]: !m2[key] }));
|
|
33383
33638
|
};
|
|
33384
33639
|
const selectedIds = asArray(session == null ? void 0 : session.selectedFilterValues);
|
|
33385
|
-
const appliedCount =
|
|
33640
|
+
const appliedCount = React76__namespace.useMemo(() => {
|
|
33386
33641
|
var _a2;
|
|
33387
33642
|
const patch = (_a2 = session == null ? void 0 : session.filtersPatch) != null ? _a2 : {};
|
|
33388
33643
|
return Object.keys(patch).length;
|
|
@@ -33898,8 +34153,8 @@ function computeDefaultPos(idx) {
|
|
|
33898
34153
|
return { x: x2, y: y2 };
|
|
33899
34154
|
}
|
|
33900
34155
|
function usePortalRoot(id = "__timeax_lister_ui__") {
|
|
33901
|
-
const [el, setEl] =
|
|
33902
|
-
|
|
34156
|
+
const [el, setEl] = React76__namespace.useState(null);
|
|
34157
|
+
React76__namespace.useEffect(() => {
|
|
33903
34158
|
if (typeof document === "undefined") return;
|
|
33904
34159
|
const existing = document.getElementById(id);
|
|
33905
34160
|
const node = existing != null ? existing : document.createElement("div");
|
|
@@ -33916,7 +34171,7 @@ function usePortalRoot(id = "__timeax_lister_ui__") {
|
|
|
33916
34171
|
}
|
|
33917
34172
|
function ListerUI() {
|
|
33918
34173
|
const { state } = useLister();
|
|
33919
|
-
const positionsRef =
|
|
34174
|
+
const positionsRef = React76__namespace.useRef(
|
|
33920
34175
|
/* @__PURE__ */ new Map()
|
|
33921
34176
|
);
|
|
33922
34177
|
const portalRoot = usePortalRoot();
|
|
@@ -33943,14 +34198,14 @@ function ListerSessionPanel(props) {
|
|
|
33943
34198
|
const idx = Math.max(0, state.order.indexOf(id));
|
|
33944
34199
|
const isActive = state.activeId === id;
|
|
33945
34200
|
const draggable = (session == null ? void 0 : session.draggable) !== false;
|
|
33946
|
-
const nodeRef =
|
|
33947
|
-
const [defaultPos] =
|
|
34201
|
+
const nodeRef = React76__namespace.useRef(null);
|
|
34202
|
+
const [defaultPos] = React76__namespace.useState(() => {
|
|
33948
34203
|
const saved = positionsRef.current.get(id);
|
|
33949
34204
|
if (saved) return saved;
|
|
33950
34205
|
const p2 = session == null ? void 0 : session.position;
|
|
33951
34206
|
return p2 && typeof p2.x === "number" && typeof p2.y === "number" ? { x: p2.x, y: p2.y } : computeDefaultPos(idx);
|
|
33952
34207
|
});
|
|
33953
|
-
|
|
34208
|
+
React76__namespace.useEffect(() => {
|
|
33954
34209
|
if (!positionsRef.current.has(id)) {
|
|
33955
34210
|
positionsRef.current.set(id, defaultPos);
|
|
33956
34211
|
}
|
|
@@ -34041,13 +34296,13 @@ function ListerSessionPanel(props) {
|
|
|
34041
34296
|
}
|
|
34042
34297
|
function useLister() {
|
|
34043
34298
|
const runtime = useListerRuntime();
|
|
34044
|
-
const [state, setState] =
|
|
34045
|
-
|
|
34299
|
+
const [state, setState] = React76__namespace.useState(runtime.getState());
|
|
34300
|
+
React76__namespace.useEffect(() => {
|
|
34046
34301
|
return runtime.subscribe(() => {
|
|
34047
34302
|
setState(runtime.getState());
|
|
34048
34303
|
});
|
|
34049
34304
|
}, [runtime]);
|
|
34050
|
-
return
|
|
34305
|
+
return React76__namespace.useMemo(
|
|
34051
34306
|
() => ({
|
|
34052
34307
|
api: runtime.api,
|
|
34053
34308
|
actions: runtime.actions,
|
|
@@ -34104,43 +34359,43 @@ function useData(opts, deps = []) {
|
|
|
34104
34359
|
const enabled = (_a = opts.enabled) != null ? _a : true;
|
|
34105
34360
|
const debounceMs = (_b = opts.debounceMs) != null ? _b : 300;
|
|
34106
34361
|
const http = (_c = opts.http) != null ? _c : defaultHttpClient;
|
|
34107
|
-
const [data, setData] =
|
|
34362
|
+
const [data, setData] = React76__namespace.useState(() => {
|
|
34108
34363
|
var _a2;
|
|
34109
34364
|
return (_a2 = opts.initial) != null ? _a2 : [];
|
|
34110
34365
|
});
|
|
34111
|
-
const [res, setRes] =
|
|
34112
|
-
const [loading, setLoading] =
|
|
34113
|
-
const [error, setError] =
|
|
34114
|
-
const dataRef =
|
|
34115
|
-
|
|
34366
|
+
const [res, setRes] = React76__namespace.useState();
|
|
34367
|
+
const [loading, setLoading] = React76__namespace.useState(false);
|
|
34368
|
+
const [error, setError] = React76__namespace.useState(void 0);
|
|
34369
|
+
const dataRef = React76__namespace.useRef(data);
|
|
34370
|
+
React76__namespace.useEffect(() => {
|
|
34116
34371
|
dataRef.current = data;
|
|
34117
34372
|
}, [data]);
|
|
34118
|
-
const [query, _setQuery] =
|
|
34119
|
-
const [searchMode, _setSearchMode] =
|
|
34373
|
+
const [query, _setQuery] = React76__namespace.useState("");
|
|
34374
|
+
const [searchMode, _setSearchMode] = React76__namespace.useState(
|
|
34120
34375
|
(_d = opts.searchMode) != null ? _d : "remote"
|
|
34121
34376
|
);
|
|
34122
|
-
const [searchTarget, _setSearchTarget] =
|
|
34123
|
-
const [filters, _setFilters] =
|
|
34377
|
+
const [searchTarget, _setSearchTarget] = React76__namespace.useState(() => defaultSearchTarget(opts.search));
|
|
34378
|
+
const [filters, _setFilters] = React76__namespace.useState(
|
|
34124
34379
|
opts.filters
|
|
34125
34380
|
);
|
|
34126
|
-
const inflight =
|
|
34381
|
+
const inflight = React76__namespace.useMemo(
|
|
34127
34382
|
() => createInFlight(debounceMs),
|
|
34128
34383
|
[debounceMs]
|
|
34129
34384
|
);
|
|
34130
|
-
const inflightKeyRef =
|
|
34385
|
+
const inflightKeyRef = React76__namespace.useRef(
|
|
34131
34386
|
(_e = opts.id) != null ? _e : createRuntimeKey("data")
|
|
34132
34387
|
);
|
|
34133
|
-
|
|
34388
|
+
React76__namespace.useEffect(() => {
|
|
34134
34389
|
if (opts.id) inflightKeyRef.current = opts.id;
|
|
34135
34390
|
}, [opts.id]);
|
|
34136
|
-
|
|
34391
|
+
React76__namespace.useEffect(() => {
|
|
34137
34392
|
return () => {
|
|
34138
34393
|
inflight.clear(inflightKeyRef.current);
|
|
34139
34394
|
};
|
|
34140
34395
|
}, [inflight]);
|
|
34141
34396
|
const selectionMode = (_g = (_f = opts.selection) == null ? void 0 : _f.mode) != null ? _g : "none";
|
|
34142
34397
|
const selectionPrune = (_i = (_h = opts.selection) == null ? void 0 : _h.prune) != null ? _i : "never";
|
|
34143
|
-
const getItemKey =
|
|
34398
|
+
const getItemKey = React76__namespace.useMemo(() => {
|
|
34144
34399
|
var _a2;
|
|
34145
34400
|
const key = (_a2 = opts.selection) == null ? void 0 : _a2.key;
|
|
34146
34401
|
if (!key) {
|
|
@@ -34161,11 +34416,11 @@ function useData(opts, deps = []) {
|
|
|
34161
34416
|
return isKey(v2) ? v2 : null;
|
|
34162
34417
|
};
|
|
34163
34418
|
}, [(_j = opts.selection) == null ? void 0 : _j.key]);
|
|
34164
|
-
const [selectedIdsArr, setSelectedIdsArr] =
|
|
34165
|
-
const selectedCacheRef =
|
|
34166
|
-
const didMountRef =
|
|
34167
|
-
const skipNextModeEffectRef =
|
|
34168
|
-
const dataById =
|
|
34419
|
+
const [selectedIdsArr, setSelectedIdsArr] = React76__namespace.useState([]);
|
|
34420
|
+
const selectedCacheRef = React76__namespace.useRef(/* @__PURE__ */ new Map());
|
|
34421
|
+
const didMountRef = React76__namespace.useRef(false);
|
|
34422
|
+
const skipNextModeEffectRef = React76__namespace.useRef(false);
|
|
34423
|
+
const dataById = React76__namespace.useMemo(() => {
|
|
34169
34424
|
const map = /* @__PURE__ */ new Map();
|
|
34170
34425
|
if (selectionMode === "none") return map;
|
|
34171
34426
|
for (const item of data) {
|
|
@@ -34175,10 +34430,10 @@ function useData(opts, deps = []) {
|
|
|
34175
34430
|
}
|
|
34176
34431
|
return map;
|
|
34177
34432
|
}, [data, getItemKey, selectionMode]);
|
|
34178
|
-
const normalizeIds =
|
|
34433
|
+
const normalizeIds = React76__namespace.useCallback((v2) => {
|
|
34179
34434
|
return Array.isArray(v2) ? v2 : [v2];
|
|
34180
34435
|
}, []);
|
|
34181
|
-
const commitSelectedCache =
|
|
34436
|
+
const commitSelectedCache = React76__namespace.useCallback(
|
|
34182
34437
|
(list) => {
|
|
34183
34438
|
if (selectionMode === "none") return;
|
|
34184
34439
|
for (const item of list) {
|
|
@@ -34189,7 +34444,7 @@ function useData(opts, deps = []) {
|
|
|
34189
34444
|
},
|
|
34190
34445
|
[getItemKey, selectionMode]
|
|
34191
34446
|
);
|
|
34192
|
-
const fetchImpl =
|
|
34447
|
+
const fetchImpl = React76__namespace.useCallback(
|
|
34193
34448
|
async (override2) => {
|
|
34194
34449
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
|
|
34195
34450
|
if (!enabled) return dataRef.current;
|
|
@@ -34272,14 +34527,14 @@ function useData(opts, deps = []) {
|
|
|
34272
34527
|
getItemKey
|
|
34273
34528
|
]
|
|
34274
34529
|
);
|
|
34275
|
-
const refresh =
|
|
34530
|
+
const refresh = React76__namespace.useCallback(async () => {
|
|
34276
34531
|
return fetchImpl();
|
|
34277
34532
|
}, [fetchImpl]);
|
|
34278
|
-
const override =
|
|
34533
|
+
const override = React76__namespace.useCallback((newData) => {
|
|
34279
34534
|
setData(newData);
|
|
34280
34535
|
}, []);
|
|
34281
|
-
const setQuery =
|
|
34282
|
-
const setSearchMode =
|
|
34536
|
+
const setQuery = React76__namespace.useCallback((q2) => _setQuery(q2), []);
|
|
34537
|
+
const setSearchMode = React76__namespace.useCallback(
|
|
34283
34538
|
(m2) => {
|
|
34284
34539
|
inflight.abort(inflightKeyRef.current);
|
|
34285
34540
|
if (m2 === "remote" || m2 === "hybrid") {
|
|
@@ -34298,27 +34553,27 @@ function useData(opts, deps = []) {
|
|
|
34298
34553
|
},
|
|
34299
34554
|
[fetchImpl, inflight]
|
|
34300
34555
|
);
|
|
34301
|
-
const setSearchTarget =
|
|
34556
|
+
const setSearchTarget = React76__namespace.useCallback((t4) => {
|
|
34302
34557
|
_setSearchTarget(t4);
|
|
34303
34558
|
}, []);
|
|
34304
|
-
const setFilters =
|
|
34559
|
+
const setFilters = React76__namespace.useCallback(
|
|
34305
34560
|
(next) => _setFilters(next),
|
|
34306
34561
|
[]
|
|
34307
34562
|
);
|
|
34308
|
-
const patchFilters =
|
|
34563
|
+
const patchFilters = React76__namespace.useCallback((patch) => {
|
|
34309
34564
|
_setFilters((prev) => ({
|
|
34310
34565
|
...prev != null ? prev : {},
|
|
34311
34566
|
...patch
|
|
34312
34567
|
}));
|
|
34313
34568
|
}, []);
|
|
34314
|
-
const clearFilters =
|
|
34569
|
+
const clearFilters = React76__namespace.useCallback(() => _setFilters(void 0), []);
|
|
34315
34570
|
const fetchOnMount = (_k = opts.fetchOnMount) != null ? _k : !opts.initial;
|
|
34316
|
-
|
|
34571
|
+
React76__namespace.useEffect(() => {
|
|
34317
34572
|
if (!enabled) return;
|
|
34318
34573
|
if (!fetchOnMount) return;
|
|
34319
34574
|
void fetchImpl();
|
|
34320
34575
|
}, deps);
|
|
34321
|
-
|
|
34576
|
+
React76__namespace.useEffect(() => {
|
|
34322
34577
|
if (!enabled) return;
|
|
34323
34578
|
if (!didMountRef.current) {
|
|
34324
34579
|
didMountRef.current = true;
|
|
@@ -34337,14 +34592,14 @@ function useData(opts, deps = []) {
|
|
|
34337
34592
|
inflight.abort(key);
|
|
34338
34593
|
};
|
|
34339
34594
|
}, [enabled, fetchImpl, inflight, query, searchMode, searchTarget]);
|
|
34340
|
-
|
|
34595
|
+
React76__namespace.useEffect(() => {
|
|
34341
34596
|
if (!enabled) return;
|
|
34342
34597
|
if (opts.autoFetchOnFilterChange === false) return;
|
|
34343
34598
|
if (!didMountRef.current) return;
|
|
34344
34599
|
if (searchMode !== "remote" && searchMode !== "hybrid") return;
|
|
34345
34600
|
void fetchImpl();
|
|
34346
34601
|
}, [enabled, fetchImpl, filters, opts.autoFetchOnFilterChange, searchMode]);
|
|
34347
|
-
const visible =
|
|
34602
|
+
const visible = React76__namespace.useMemo(() => {
|
|
34348
34603
|
if (searchMode !== "local" && searchMode !== "hybrid") return data;
|
|
34349
34604
|
const payload = buildSearchPayloadFromTarget(searchTarget);
|
|
34350
34605
|
let list = data;
|
|
@@ -34371,24 +34626,24 @@ function useData(opts, deps = []) {
|
|
|
34371
34626
|
(item) => stringifyForSearch(item).toLowerCase().includes(ql)
|
|
34372
34627
|
);
|
|
34373
34628
|
}, [data, getItemKey, query, searchMode, searchTarget]);
|
|
34374
|
-
const selectedIds =
|
|
34629
|
+
const selectedIds = React76__namespace.useMemo(() => {
|
|
34375
34630
|
var _a2;
|
|
34376
34631
|
if (selectionMode === "none") return null;
|
|
34377
34632
|
if (selectionMode === "single") return (_a2 = selectedIdsArr[0]) != null ? _a2 : null;
|
|
34378
34633
|
return selectedIdsArr;
|
|
34379
34634
|
}, [selectionMode, selectedIdsArr]);
|
|
34380
|
-
const isSelected =
|
|
34635
|
+
const isSelected = React76__namespace.useCallback(
|
|
34381
34636
|
(id) => {
|
|
34382
34637
|
if (selectionMode === "none") return false;
|
|
34383
34638
|
return selectedIdsArr.includes(id);
|
|
34384
34639
|
},
|
|
34385
34640
|
[selectedIdsArr, selectionMode]
|
|
34386
34641
|
);
|
|
34387
|
-
const clearSelection =
|
|
34642
|
+
const clearSelection = React76__namespace.useCallback(() => {
|
|
34388
34643
|
if (selectionMode === "none") return;
|
|
34389
34644
|
setSelectedIdsArr([]);
|
|
34390
34645
|
}, [selectionMode]);
|
|
34391
|
-
const select =
|
|
34646
|
+
const select = React76__namespace.useCallback(
|
|
34392
34647
|
(idOrIds) => {
|
|
34393
34648
|
if (selectionMode === "none") return;
|
|
34394
34649
|
const ids = normalizeIds(idOrIds).filter(isKey);
|
|
@@ -34405,7 +34660,7 @@ function useData(opts, deps = []) {
|
|
|
34405
34660
|
},
|
|
34406
34661
|
[dataById, normalizeIds, selectionMode]
|
|
34407
34662
|
);
|
|
34408
|
-
const deselect =
|
|
34663
|
+
const deselect = React76__namespace.useCallback(
|
|
34409
34664
|
(idOrIds) => {
|
|
34410
34665
|
if (selectionMode === "none") return;
|
|
34411
34666
|
const ids = new Set(normalizeIds(idOrIds).filter(isKey));
|
|
@@ -34418,7 +34673,7 @@ function useData(opts, deps = []) {
|
|
|
34418
34673
|
},
|
|
34419
34674
|
[normalizeIds, selectionMode]
|
|
34420
34675
|
);
|
|
34421
|
-
const toggle =
|
|
34676
|
+
const toggle = React76__namespace.useCallback(
|
|
34422
34677
|
(id) => {
|
|
34423
34678
|
if (selectionMode === "none") return;
|
|
34424
34679
|
const hit = dataById.get(id);
|
|
@@ -34436,7 +34691,7 @@ function useData(opts, deps = []) {
|
|
|
34436
34691
|
},
|
|
34437
34692
|
[dataById, selectionMode]
|
|
34438
34693
|
);
|
|
34439
|
-
const selected =
|
|
34694
|
+
const selected = React76__namespace.useMemo(() => {
|
|
34440
34695
|
var _a2, _b2, _c2, _d2;
|
|
34441
34696
|
if (selectionMode === "none") return null;
|
|
34442
34697
|
if (selectionMode === "single") {
|
|
@@ -34451,8 +34706,8 @@ function useData(opts, deps = []) {
|
|
|
34451
34706
|
}
|
|
34452
34707
|
return out;
|
|
34453
34708
|
}, [dataById, selectedIdsArr, selectionMode]);
|
|
34454
|
-
const getSelection =
|
|
34455
|
-
|
|
34709
|
+
const getSelection = React76__namespace.useCallback(() => selected, [selected]);
|
|
34710
|
+
React76__namespace.useEffect(() => {
|
|
34456
34711
|
if (selectionMode === "none") {
|
|
34457
34712
|
setSelectedIdsArr([]);
|
|
34458
34713
|
return;
|