@sustaina/shared-ui 1.40.3 → 1.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +365 -340
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -176
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React26 = require('react');
|
|
4
4
|
var reactRouter = require('@tanstack/react-router');
|
|
5
5
|
var zustand = require('zustand');
|
|
6
6
|
var clsx2 = require('clsx');
|
|
@@ -83,7 +83,7 @@ function _interopNamespace(e) {
|
|
|
83
83
|
return Object.freeze(n);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
var
|
|
86
|
+
var React26__namespace = /*#__PURE__*/_interopNamespace(React26);
|
|
87
87
|
var clsx2__default = /*#__PURE__*/_interopDefault(clsx2);
|
|
88
88
|
var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
|
|
89
89
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
@@ -273,12 +273,12 @@ function useSafeBlocker({
|
|
|
273
273
|
withResolver = false
|
|
274
274
|
}) {
|
|
275
275
|
const router = reactRouter.useRouter({ warn: false });
|
|
276
|
-
const [resolver, setResolver] =
|
|
276
|
+
const [resolver, setResolver] = React26.useState({
|
|
277
277
|
status: "idle",
|
|
278
278
|
proceed: void 0,
|
|
279
279
|
reset: void 0
|
|
280
280
|
});
|
|
281
|
-
|
|
281
|
+
React26.useEffect(() => {
|
|
282
282
|
if (disabled || !router?.history?.block) {
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
@@ -308,7 +308,7 @@ function useSafeBlocker({
|
|
|
308
308
|
}
|
|
309
309
|
});
|
|
310
310
|
}, [disabled, enableBeforeUnload, router, shouldBlockFn, withResolver]);
|
|
311
|
-
|
|
311
|
+
React26.useEffect(() => {
|
|
312
312
|
if (disabled || router?.history || typeof window === "undefined") {
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
@@ -2159,7 +2159,7 @@ function AccordionContent({
|
|
|
2159
2159
|
);
|
|
2160
2160
|
}
|
|
2161
2161
|
var ExpandCollapse = ({ title, children, portalId }) => {
|
|
2162
|
-
const [isOpen, setIsOpen] =
|
|
2162
|
+
const [isOpen, setIsOpen] = React26.useState(false);
|
|
2163
2163
|
const Panel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2164
2164
|
"div",
|
|
2165
2165
|
{
|
|
@@ -2269,31 +2269,31 @@ function makeNewRow(field) {
|
|
|
2269
2269
|
};
|
|
2270
2270
|
}
|
|
2271
2271
|
function useAdvanceSearch({ fields, limitRows }) {
|
|
2272
|
-
const [rows, setRows] =
|
|
2273
|
-
const updateRows =
|
|
2272
|
+
const [rows, setRows] = React26.useState([makeNewRow(fields[0])]);
|
|
2273
|
+
const updateRows = React26.useCallback((next) => {
|
|
2274
2274
|
setRows(next);
|
|
2275
2275
|
}, []);
|
|
2276
|
-
const operatorsForField =
|
|
2276
|
+
const operatorsForField = React26.useCallback(
|
|
2277
2277
|
(fieldName) => {
|
|
2278
2278
|
const t = getFieldType(fields, fieldName);
|
|
2279
2279
|
return OPERATOR_MAP[t];
|
|
2280
2280
|
},
|
|
2281
2281
|
[fields]
|
|
2282
2282
|
);
|
|
2283
|
-
const addRow =
|
|
2283
|
+
const addRow = React26.useCallback(() => {
|
|
2284
2284
|
if (limitRows && rows.length >= limitRows) return;
|
|
2285
2285
|
const lastRow = rows[rows.length - 1];
|
|
2286
2286
|
const lastField = fields.find((f) => f.name === lastRow?.fieldName) ?? fields[0];
|
|
2287
2287
|
updateRows([...rows, makeNewRow(lastField)]);
|
|
2288
2288
|
}, [rows, fields, updateRows, limitRows]);
|
|
2289
|
-
const removeRow =
|
|
2289
|
+
const removeRow = React26.useCallback(
|
|
2290
2290
|
(id) => {
|
|
2291
2291
|
if (rows.length === 1) return;
|
|
2292
2292
|
updateRows(rows.filter((r) => r.id !== id));
|
|
2293
2293
|
},
|
|
2294
2294
|
[rows, updateRows]
|
|
2295
2295
|
);
|
|
2296
|
-
const clearRow =
|
|
2296
|
+
const clearRow = React26.useCallback(
|
|
2297
2297
|
(id) => {
|
|
2298
2298
|
updateRows(
|
|
2299
2299
|
rows.map((r) => {
|
|
@@ -2326,10 +2326,10 @@ function useAdvanceSearch({ fields, limitRows }) {
|
|
|
2326
2326
|
},
|
|
2327
2327
|
[rows, fields, updateRows]
|
|
2328
2328
|
);
|
|
2329
|
-
const clearAllRow =
|
|
2329
|
+
const clearAllRow = React26.useCallback(() => {
|
|
2330
2330
|
updateRows([makeNewRow(fields[0])]);
|
|
2331
2331
|
}, [fields, updateRows]);
|
|
2332
|
-
const changeField =
|
|
2332
|
+
const changeField = React26.useCallback(
|
|
2333
2333
|
(id, fieldName) => {
|
|
2334
2334
|
updateRows(
|
|
2335
2335
|
rows.map((r) => {
|
|
@@ -2341,7 +2341,7 @@ function useAdvanceSearch({ fields, limitRows }) {
|
|
|
2341
2341
|
},
|
|
2342
2342
|
[rows, fields, updateRows]
|
|
2343
2343
|
);
|
|
2344
|
-
const changeOperator =
|
|
2344
|
+
const changeOperator = React26.useCallback(
|
|
2345
2345
|
(id, operator) => {
|
|
2346
2346
|
updateRows(
|
|
2347
2347
|
rows.map((r) => {
|
|
@@ -2375,7 +2375,7 @@ function useAdvanceSearch({ fields, limitRows }) {
|
|
|
2375
2375
|
},
|
|
2376
2376
|
[rows, updateRows]
|
|
2377
2377
|
);
|
|
2378
|
-
const changeValue =
|
|
2378
|
+
const changeValue = React26.useCallback(
|
|
2379
2379
|
(id, which, val) => {
|
|
2380
2380
|
updateRows(
|
|
2381
2381
|
rows.map((r) => {
|
|
@@ -2387,7 +2387,7 @@ function useAdvanceSearch({ fields, limitRows }) {
|
|
|
2387
2387
|
},
|
|
2388
2388
|
[rows, updateRows]
|
|
2389
2389
|
);
|
|
2390
|
-
const fieldOptions =
|
|
2390
|
+
const fieldOptions = React26.useMemo(
|
|
2391
2391
|
() => fields.map((f) => ({
|
|
2392
2392
|
value: f.name,
|
|
2393
2393
|
label: f.label ?? f.name
|
|
@@ -2582,7 +2582,7 @@ var OPERATOR_LABEL = {
|
|
|
2582
2582
|
containsAll: "Contains all of"
|
|
2583
2583
|
};
|
|
2584
2584
|
var OperatorSelect = ({ row, operators, onChangeOperator, error }) => {
|
|
2585
|
-
|
|
2585
|
+
React26__namespace.default.useEffect(() => {
|
|
2586
2586
|
if (!operators.length) return;
|
|
2587
2587
|
if (!operators.includes(row.operator)) {
|
|
2588
2588
|
onChangeOperator(operators[0]);
|
|
@@ -2618,15 +2618,15 @@ function Label2({ className, ...props }) {
|
|
|
2618
2618
|
);
|
|
2619
2619
|
}
|
|
2620
2620
|
var Form = reactHookForm.FormProvider;
|
|
2621
|
-
var FormFieldContext =
|
|
2621
|
+
var FormFieldContext = React26__namespace.createContext({});
|
|
2622
2622
|
var FormField = ({
|
|
2623
2623
|
...props
|
|
2624
2624
|
}) => {
|
|
2625
2625
|
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
|
|
2626
2626
|
};
|
|
2627
2627
|
var useFormField = () => {
|
|
2628
|
-
const fieldContext =
|
|
2629
|
-
const itemContext =
|
|
2628
|
+
const fieldContext = React26__namespace.useContext(FormFieldContext);
|
|
2629
|
+
const itemContext = React26__namespace.useContext(FormItemContext);
|
|
2630
2630
|
const { getFieldState } = reactHookForm.useFormContext();
|
|
2631
2631
|
const formState = reactHookForm.useFormState({ name: fieldContext.name });
|
|
2632
2632
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
@@ -2643,9 +2643,9 @@ var useFormField = () => {
|
|
|
2643
2643
|
...fieldState
|
|
2644
2644
|
};
|
|
2645
2645
|
};
|
|
2646
|
-
var FormItemContext =
|
|
2646
|
+
var FormItemContext = React26__namespace.createContext({});
|
|
2647
2647
|
function FormItem({ className, ...props }) {
|
|
2648
|
-
const id =
|
|
2648
|
+
const id = React26__namespace.useId();
|
|
2649
2649
|
return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "form-item", className: cn("grid gap-2", className), ...props }) });
|
|
2650
2650
|
}
|
|
2651
2651
|
function FormLabel({ className, ...props }) {
|
|
@@ -2749,7 +2749,7 @@ var Spinner = ({ className, variant, size = "default", ...props }) => /* @__PURE
|
|
|
2749
2749
|
]
|
|
2750
2750
|
}
|
|
2751
2751
|
);
|
|
2752
|
-
var InputPrimitive =
|
|
2752
|
+
var InputPrimitive = React26__namespace.forwardRef(
|
|
2753
2753
|
({ className, type = "text", ...props }, ref) => {
|
|
2754
2754
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2755
2755
|
"input",
|
|
@@ -2788,7 +2788,7 @@ var inputVariants = classVarianceAuthority.cva("", {
|
|
|
2788
2788
|
appearance: "filled"
|
|
2789
2789
|
}
|
|
2790
2790
|
});
|
|
2791
|
-
var Input =
|
|
2791
|
+
var Input = React26__namespace.forwardRef(
|
|
2792
2792
|
({
|
|
2793
2793
|
className,
|
|
2794
2794
|
wrapperClassName,
|
|
@@ -2821,8 +2821,8 @@ var Input = React25__namespace.forwardRef(
|
|
|
2821
2821
|
onChange: onChangeProp
|
|
2822
2822
|
} = rest;
|
|
2823
2823
|
const ariaInvalid = invalid ?? ariaInvalidProp;
|
|
2824
|
-
const messageId =
|
|
2825
|
-
const handleChange =
|
|
2824
|
+
const messageId = React26__namespace.useId();
|
|
2825
|
+
const handleChange = React26__namespace.useCallback(
|
|
2826
2826
|
(event) => {
|
|
2827
2827
|
onChangeProp?.(event);
|
|
2828
2828
|
onValueChange?.(event.target.value);
|
|
@@ -3210,20 +3210,20 @@ function DatePicker({
|
|
|
3210
3210
|
className,
|
|
3211
3211
|
...props
|
|
3212
3212
|
}) {
|
|
3213
|
-
const today =
|
|
3214
|
-
const [displayed, setDisplayed] =
|
|
3213
|
+
const today = React26__namespace.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
3214
|
+
const [displayed, setDisplayed] = React26__namespace.useState(
|
|
3215
3215
|
selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date()
|
|
3216
3216
|
);
|
|
3217
3217
|
minDate = clampToDay(minDate);
|
|
3218
3218
|
maxDate = clampToDay(maxDate);
|
|
3219
|
-
const disabledSet =
|
|
3219
|
+
const disabledSet = React26__namespace.useMemo(() => {
|
|
3220
3220
|
const s = /* @__PURE__ */ new Set();
|
|
3221
3221
|
disabledDates?.forEach((d) => s.add(startOfDay(d).toISOString()));
|
|
3222
3222
|
return s;
|
|
3223
3223
|
}, [disabledDates]);
|
|
3224
3224
|
const displayYear = displayed.getFullYear();
|
|
3225
3225
|
const displayMonth = displayed.getMonth();
|
|
3226
|
-
const weekdays =
|
|
3226
|
+
const weekdays = React26__namespace.useMemo(() => {
|
|
3227
3227
|
const labels = [];
|
|
3228
3228
|
for (let i = 0; i < 7; i++) {
|
|
3229
3229
|
const idx = i;
|
|
@@ -3232,7 +3232,7 @@ function DatePicker({
|
|
|
3232
3232
|
}
|
|
3233
3233
|
return labels;
|
|
3234
3234
|
}, [callbacks]);
|
|
3235
|
-
const grid =
|
|
3235
|
+
const grid = React26__namespace.useMemo(() => buildCalendarGrid(displayed, true), [displayed]);
|
|
3236
3236
|
const isDateDisabled = (date) => {
|
|
3237
3237
|
const d = startOfDay(date);
|
|
3238
3238
|
if (minDate && d < minDate) return true;
|
|
@@ -3242,7 +3242,7 @@ function DatePicker({
|
|
|
3242
3242
|
};
|
|
3243
3243
|
const minYear = minDate?.getFullYear();
|
|
3244
3244
|
const maxYear = maxDate?.getFullYear();
|
|
3245
|
-
const getMonthLabel =
|
|
3245
|
+
const getMonthLabel = React26__namespace.useCallback(
|
|
3246
3246
|
(year, monthIndex) => {
|
|
3247
3247
|
const label = callbacks?.monthLabel?.(year, monthIndex);
|
|
3248
3248
|
if (label === null || label === void 0) {
|
|
@@ -3252,7 +3252,7 @@ function DatePicker({
|
|
|
3252
3252
|
},
|
|
3253
3253
|
[callbacks]
|
|
3254
3254
|
);
|
|
3255
|
-
const getYearLabel =
|
|
3255
|
+
const getYearLabel = React26__namespace.useCallback(
|
|
3256
3256
|
(year) => {
|
|
3257
3257
|
const label = callbacks?.yearLabel?.(year);
|
|
3258
3258
|
if (label === null || label === void 0) return String(year);
|
|
@@ -3260,7 +3260,7 @@ function DatePicker({
|
|
|
3260
3260
|
},
|
|
3261
3261
|
[callbacks]
|
|
3262
3262
|
);
|
|
3263
|
-
const clampMonthToBounds =
|
|
3263
|
+
const clampMonthToBounds = React26__namespace.useCallback(
|
|
3264
3264
|
(year, monthIndex) => {
|
|
3265
3265
|
let output = monthIndex;
|
|
3266
3266
|
if (typeof minYear === "number" && year === minYear && minDate) {
|
|
@@ -3275,7 +3275,7 @@ function DatePicker({
|
|
|
3275
3275
|
},
|
|
3276
3276
|
[maxDate, minDate, maxYear, minYear]
|
|
3277
3277
|
);
|
|
3278
|
-
const yearOptions =
|
|
3278
|
+
const yearOptions = React26__namespace.useMemo(() => {
|
|
3279
3279
|
const fallbackWindow = 50;
|
|
3280
3280
|
const start = typeof minYear === "number" ? minYear : displayYear - fallbackWindow;
|
|
3281
3281
|
const end = typeof maxYear === "number" ? maxYear : displayYear + fallbackWindow;
|
|
@@ -3296,7 +3296,7 @@ function DatePicker({
|
|
|
3296
3296
|
}
|
|
3297
3297
|
return years;
|
|
3298
3298
|
}, [displayYear, maxYear, minYear, selectedDate]);
|
|
3299
|
-
const monthOptions =
|
|
3299
|
+
const monthOptions = React26__namespace.useMemo(() => {
|
|
3300
3300
|
const months = Array.from({ length: 12 }, (_, monthIndex) => {
|
|
3301
3301
|
const disabled = typeof minYear === "number" && displayYear === minYear && minDate && monthIndex < minDate.getMonth() || typeof maxYear === "number" && displayYear === maxYear && maxDate && monthIndex > maxDate.getMonth();
|
|
3302
3302
|
return {
|
|
@@ -3315,7 +3315,7 @@ function DatePicker({
|
|
|
3315
3315
|
}
|
|
3316
3316
|
return months.sort((a, b) => a.value - b.value).filter((option, index, arr) => index === 0 || option.value !== arr[index - 1].value);
|
|
3317
3317
|
}, [displayMonth, displayYear, getMonthLabel, maxDate, maxYear, minDate, minYear]);
|
|
3318
|
-
const handleMonthSelect =
|
|
3318
|
+
const handleMonthSelect = React26__namespace.useCallback((nextValue) => {
|
|
3319
3319
|
const nextMonth = Number.parseInt(nextValue, 10);
|
|
3320
3320
|
if (Number.isNaN(nextMonth)) return;
|
|
3321
3321
|
setDisplayed((prev) => {
|
|
@@ -3325,7 +3325,7 @@ function DatePicker({
|
|
|
3325
3325
|
return next;
|
|
3326
3326
|
});
|
|
3327
3327
|
}, []);
|
|
3328
|
-
const handleYearSelect =
|
|
3328
|
+
const handleYearSelect = React26__namespace.useCallback(
|
|
3329
3329
|
(nextValue) => {
|
|
3330
3330
|
const nextYear = Number.parseInt(nextValue, 10);
|
|
3331
3331
|
if (Number.isNaN(nextYear)) return;
|
|
@@ -3473,14 +3473,14 @@ var DatePicker2 = ({
|
|
|
3473
3473
|
ariaLabel,
|
|
3474
3474
|
...calendarProps
|
|
3475
3475
|
}) => {
|
|
3476
|
-
const [open, setOpen] =
|
|
3477
|
-
const parser =
|
|
3478
|
-
const outputFormatter =
|
|
3479
|
-
const labelFormatter =
|
|
3476
|
+
const [open, setOpen] = React26__namespace.default.useState(false);
|
|
3477
|
+
const parser = React26__namespace.default.useMemo(() => valueParser ?? defaultValueParser, [valueParser]);
|
|
3478
|
+
const outputFormatter = React26__namespace.default.useMemo(() => valueFormatter ?? defaultValueFormatter, [valueFormatter]);
|
|
3479
|
+
const labelFormatter = React26__namespace.default.useMemo(
|
|
3480
3480
|
() => displayFormatter ?? defaultDisplayFormatter,
|
|
3481
3481
|
[displayFormatter]
|
|
3482
3482
|
);
|
|
3483
|
-
const parsedValue =
|
|
3483
|
+
const parsedValue = React26__namespace.default.useMemo(() => {
|
|
3484
3484
|
if (value === null || value === void 0) return void 0;
|
|
3485
3485
|
if (value instanceof Date) return value;
|
|
3486
3486
|
const parsed = parser(value);
|
|
@@ -3489,26 +3489,26 @@ var DatePicker2 = ({
|
|
|
3489
3489
|
const buttonLabel = parsedValue ? labelFormatter(parsedValue) : placeholder2;
|
|
3490
3490
|
const buttonAriaLabel = ariaLabel ?? (parsedValue ? `Change date, current selection ${labelFormatter(parsedValue)}` : "Open date picker");
|
|
3491
3491
|
const shouldShowClear = allowClear && !disabled && !!parsedValue;
|
|
3492
|
-
const handleClose =
|
|
3493
|
-
const emitChange =
|
|
3492
|
+
const handleClose = React26__namespace.default.useCallback(() => setOpen(false), []);
|
|
3493
|
+
const emitChange = React26__namespace.default.useCallback(
|
|
3494
3494
|
(next) => {
|
|
3495
3495
|
onChange?.(next);
|
|
3496
3496
|
onValueChange?.(next ? outputFormatter(next) : void 0);
|
|
3497
3497
|
},
|
|
3498
3498
|
[onChange, onValueChange, outputFormatter]
|
|
3499
3499
|
);
|
|
3500
|
-
const handleSelect =
|
|
3500
|
+
const handleSelect = React26__namespace.default.useCallback(
|
|
3501
3501
|
(next) => {
|
|
3502
3502
|
emitChange(next);
|
|
3503
3503
|
if (closeOnSelect && next) handleClose();
|
|
3504
3504
|
},
|
|
3505
3505
|
[closeOnSelect, emitChange, handleClose]
|
|
3506
3506
|
);
|
|
3507
|
-
const handleClear =
|
|
3507
|
+
const handleClear = React26__namespace.default.useCallback(() => {
|
|
3508
3508
|
emitChange(void 0);
|
|
3509
3509
|
handleClose();
|
|
3510
3510
|
}, [emitChange, handleClose]);
|
|
3511
|
-
const handleOpenChange =
|
|
3511
|
+
const handleOpenChange = React26__namespace.default.useCallback(
|
|
3512
3512
|
(nextOpen) => {
|
|
3513
3513
|
if (disabled && nextOpen) return;
|
|
3514
3514
|
setOpen(nextOpen);
|
|
@@ -3698,15 +3698,15 @@ function MonthCal({
|
|
|
3698
3698
|
onYearBackward,
|
|
3699
3699
|
onYearForward
|
|
3700
3700
|
}) {
|
|
3701
|
-
const today =
|
|
3701
|
+
const today = React26__namespace.useMemo(() => {
|
|
3702
3702
|
const now = /* @__PURE__ */ new Date();
|
|
3703
3703
|
now.setDate(1);
|
|
3704
3704
|
now.setHours(0, 0, 0, 0);
|
|
3705
3705
|
return now;
|
|
3706
3706
|
}, []);
|
|
3707
|
-
const selectedMonthDate =
|
|
3708
|
-
const min =
|
|
3709
|
-
const max =
|
|
3707
|
+
const selectedMonthDate = React26__namespace.useMemo(() => normalizeMonth(selectedDate), [selectedDate]);
|
|
3708
|
+
const min = React26__namespace.useMemo(() => normalizeMonth(minDate), [minDate]);
|
|
3709
|
+
const max = React26__namespace.useMemo(() => normalizeMonth(maxDate), [maxDate]);
|
|
3710
3710
|
let effectiveMin = min;
|
|
3711
3711
|
if (min && max && min > max) {
|
|
3712
3712
|
effectiveMin = max;
|
|
@@ -3715,10 +3715,10 @@ function MonthCal({
|
|
|
3715
3715
|
const minMonth = effectiveMin?.getMonth();
|
|
3716
3716
|
const maxYear = max?.getFullYear();
|
|
3717
3717
|
const maxMonth = max?.getMonth();
|
|
3718
|
-
const [menuYear, setMenuYear] =
|
|
3718
|
+
const [menuYear, setMenuYear] = React26__namespace.useState(
|
|
3719
3719
|
() => selectedMonthDate?.getFullYear() ?? today.getFullYear()
|
|
3720
3720
|
);
|
|
3721
|
-
|
|
3721
|
+
React26__namespace.useEffect(() => {
|
|
3722
3722
|
if (selectedMonthDate) {
|
|
3723
3723
|
const year = selectedMonthDate.getFullYear();
|
|
3724
3724
|
if (year !== menuYear) {
|
|
@@ -3726,7 +3726,7 @@ function MonthCal({
|
|
|
3726
3726
|
}
|
|
3727
3727
|
}
|
|
3728
3728
|
}, [selectedMonthDate, menuYear]);
|
|
3729
|
-
|
|
3729
|
+
React26__namespace.useEffect(() => {
|
|
3730
3730
|
if (typeof minYear === "number" && menuYear < minYear) {
|
|
3731
3731
|
setMenuYear(minYear);
|
|
3732
3732
|
return;
|
|
@@ -3737,7 +3737,7 @@ function MonthCal({
|
|
|
3737
3737
|
}, [minYear, maxYear, menuYear]);
|
|
3738
3738
|
const disablePrevYear = typeof minYear === "number" ? menuYear <= minYear : false;
|
|
3739
3739
|
const disableNextYear = typeof maxYear === "number" ? menuYear >= maxYear : false;
|
|
3740
|
-
const yearOptions =
|
|
3740
|
+
const yearOptions = React26__namespace.useMemo(() => {
|
|
3741
3741
|
const fallbackWindow = 50;
|
|
3742
3742
|
const start = typeof minYear === "number" ? minYear : menuYear - fallbackWindow;
|
|
3743
3743
|
const end = typeof maxYear === "number" ? maxYear : menuYear + fallbackWindow;
|
|
@@ -3751,7 +3751,7 @@ function MonthCal({
|
|
|
3751
3751
|
}
|
|
3752
3752
|
return years;
|
|
3753
3753
|
}, [maxYear, menuYear, minYear]);
|
|
3754
|
-
const formatYearLabel =
|
|
3754
|
+
const formatYearLabel = React26__namespace.useCallback(
|
|
3755
3755
|
(year) => {
|
|
3756
3756
|
const raw = callbacks?.yearLabel?.(year);
|
|
3757
3757
|
if (raw === null || raw === void 0) return String(year);
|
|
@@ -3759,7 +3759,7 @@ function MonthCal({
|
|
|
3759
3759
|
},
|
|
3760
3760
|
[callbacks]
|
|
3761
3761
|
);
|
|
3762
|
-
const handleYearSelect =
|
|
3762
|
+
const handleYearSelect = React26__namespace.useCallback(
|
|
3763
3763
|
(nextValue) => {
|
|
3764
3764
|
const nextYear = Number.parseInt(nextValue, 10);
|
|
3765
3765
|
if (Number.isNaN(nextYear)) return;
|
|
@@ -3769,7 +3769,7 @@ function MonthCal({
|
|
|
3769
3769
|
},
|
|
3770
3770
|
[maxYear, minYear]
|
|
3771
3771
|
);
|
|
3772
|
-
const disabledPairs =
|
|
3772
|
+
const disabledPairs = React26__namespace.useMemo(() => {
|
|
3773
3773
|
if (!disabledDates?.length) return [];
|
|
3774
3774
|
const pairs = [];
|
|
3775
3775
|
disabledDates.forEach((date) => {
|
|
@@ -3914,14 +3914,14 @@ var MonthPicker2 = ({
|
|
|
3914
3914
|
ariaLabel,
|
|
3915
3915
|
...calendarProps
|
|
3916
3916
|
}) => {
|
|
3917
|
-
const [open, setOpen] =
|
|
3918
|
-
const parser =
|
|
3919
|
-
const outputFormatter =
|
|
3920
|
-
const labelFormatter =
|
|
3917
|
+
const [open, setOpen] = React26__namespace.default.useState(false);
|
|
3918
|
+
const parser = React26__namespace.default.useMemo(() => valueParser ?? defaultValueParser2, [valueParser]);
|
|
3919
|
+
const outputFormatter = React26__namespace.default.useMemo(() => valueFormatter ?? defaultValueFormatter2, [valueFormatter]);
|
|
3920
|
+
const labelFormatter = React26__namespace.default.useMemo(
|
|
3921
3921
|
() => displayFormatter ?? defaultDisplayFormatter2,
|
|
3922
3922
|
[displayFormatter]
|
|
3923
3923
|
);
|
|
3924
|
-
const parsedValue =
|
|
3924
|
+
const parsedValue = React26__namespace.default.useMemo(() => {
|
|
3925
3925
|
if (value === null || value === void 0) return void 0;
|
|
3926
3926
|
if (value instanceof Date) return normalizeMonth2(value);
|
|
3927
3927
|
if (typeof value === "string") {
|
|
@@ -3933,8 +3933,8 @@ var MonthPicker2 = ({
|
|
|
3933
3933
|
const buttonLabel = parsedValue ? labelFormatter(parsedValue) : placeholder2;
|
|
3934
3934
|
const buttonAriaLabel = ariaLabel ?? (parsedValue ? `Change month, current selection ${labelFormatter(parsedValue)}` : "Open month picker");
|
|
3935
3935
|
const shouldShowClear = allowClear && !disabled && !!parsedValue;
|
|
3936
|
-
const handleClose =
|
|
3937
|
-
const emitChange =
|
|
3936
|
+
const handleClose = React26__namespace.default.useCallback(() => setOpen(false), []);
|
|
3937
|
+
const emitChange = React26__namespace.default.useCallback(
|
|
3938
3938
|
(next) => {
|
|
3939
3939
|
const normalized = next ? normalizeMonth2(next) : void 0;
|
|
3940
3940
|
onChange?.(normalized);
|
|
@@ -3942,18 +3942,18 @@ var MonthPicker2 = ({
|
|
|
3942
3942
|
},
|
|
3943
3943
|
[onChange, onValueChange, outputFormatter]
|
|
3944
3944
|
);
|
|
3945
|
-
const handleSelect =
|
|
3945
|
+
const handleSelect = React26__namespace.default.useCallback(
|
|
3946
3946
|
(next) => {
|
|
3947
3947
|
emitChange(next);
|
|
3948
3948
|
if (closeOnSelect && next) handleClose();
|
|
3949
3949
|
},
|
|
3950
3950
|
[closeOnSelect, emitChange, handleClose]
|
|
3951
3951
|
);
|
|
3952
|
-
const handleClear =
|
|
3952
|
+
const handleClear = React26__namespace.default.useCallback(() => {
|
|
3953
3953
|
emitChange(void 0);
|
|
3954
3954
|
handleClose();
|
|
3955
3955
|
}, [emitChange, handleClose]);
|
|
3956
|
-
const handleOpenChange =
|
|
3956
|
+
const handleOpenChange = React26__namespace.default.useCallback(
|
|
3957
3957
|
(nextOpen) => {
|
|
3958
3958
|
if (disabled && nextOpen) return;
|
|
3959
3959
|
setOpen(nextOpen);
|
|
@@ -4164,24 +4164,24 @@ var LookupSelect = ({
|
|
|
4164
4164
|
dropdownPortalId,
|
|
4165
4165
|
multiple = false
|
|
4166
4166
|
}) => {
|
|
4167
|
-
const [inputValue, setInputValue] =
|
|
4168
|
-
const inputRef =
|
|
4169
|
-
const [inputFocused, setInputFocused] =
|
|
4170
|
-
const [suggestions, setSuggestions] =
|
|
4171
|
-
const [optionLabels, setOptionLabels] =
|
|
4172
|
-
const [loading, setLoading] =
|
|
4173
|
-
const [fetchError, setFetchError] =
|
|
4174
|
-
const [isDropdownOpen, setIsDropdownOpen] =
|
|
4175
|
-
const containerRef =
|
|
4176
|
-
const fetchDelayRef =
|
|
4177
|
-
const requestIdRef =
|
|
4178
|
-
const [dropdownStyles, setDropdownStyles] =
|
|
4179
|
-
const dropdownContentRef =
|
|
4180
|
-
const assignDropdownContentRef =
|
|
4167
|
+
const [inputValue, setInputValue] = React26.useState("");
|
|
4168
|
+
const inputRef = React26.useRef(null);
|
|
4169
|
+
const [inputFocused, setInputFocused] = React26.useState(false);
|
|
4170
|
+
const [suggestions, setSuggestions] = React26.useState([]);
|
|
4171
|
+
const [optionLabels, setOptionLabels] = React26.useState({});
|
|
4172
|
+
const [loading, setLoading] = React26.useState(false);
|
|
4173
|
+
const [fetchError, setFetchError] = React26.useState(null);
|
|
4174
|
+
const [isDropdownOpen, setIsDropdownOpen] = React26.useState(false);
|
|
4175
|
+
const containerRef = React26.useRef(null);
|
|
4176
|
+
const fetchDelayRef = React26.useRef(null);
|
|
4177
|
+
const requestIdRef = React26.useRef(0);
|
|
4178
|
+
const [dropdownStyles, setDropdownStyles] = React26.useState();
|
|
4179
|
+
const dropdownContentRef = React26.useRef(null);
|
|
4180
|
+
const assignDropdownContentRef = React26.useCallback((node) => {
|
|
4181
4181
|
dropdownContentRef.current = node;
|
|
4182
4182
|
}, []);
|
|
4183
|
-
const [activeSuggestionIndex, setActiveSuggestionIndex] =
|
|
4184
|
-
const dropdownPortalElement =
|
|
4183
|
+
const [activeSuggestionIndex, setActiveSuggestionIndex] = React26.useState(-1);
|
|
4184
|
+
const dropdownPortalElement = React26.useMemo(() => {
|
|
4185
4185
|
if (typeof document === "undefined") return null;
|
|
4186
4186
|
if (dropdownPortalId) {
|
|
4187
4187
|
const element = document.getElementById(dropdownPortalId);
|
|
@@ -4192,7 +4192,7 @@ var LookupSelect = ({
|
|
|
4192
4192
|
const limitReached = multiple && value.length >= maxTags;
|
|
4193
4193
|
const selectedValue = !multiple && value.length > 0 ? value[0] : void 0;
|
|
4194
4194
|
const selectedLabel = selectedValue ? optionLabels[selectedValue] ?? selectedValue : void 0;
|
|
4195
|
-
const upsertOptionLabels =
|
|
4195
|
+
const upsertOptionLabels = React26.useCallback((options) => {
|
|
4196
4196
|
setOptionLabels((prev) => {
|
|
4197
4197
|
let next = null;
|
|
4198
4198
|
options.forEach((opt) => {
|
|
@@ -4205,7 +4205,7 @@ var LookupSelect = ({
|
|
|
4205
4205
|
return next ?? prev;
|
|
4206
4206
|
});
|
|
4207
4207
|
}, []);
|
|
4208
|
-
const addTag =
|
|
4208
|
+
const addTag = React26.useCallback(
|
|
4209
4209
|
(val) => {
|
|
4210
4210
|
const trimmed = val.trim();
|
|
4211
4211
|
if (!trimmed) return;
|
|
@@ -4220,7 +4220,7 @@ var LookupSelect = ({
|
|
|
4220
4220
|
},
|
|
4221
4221
|
[value, onChange, maxTags, multiple]
|
|
4222
4222
|
);
|
|
4223
|
-
const removeTag =
|
|
4223
|
+
const removeTag = React26.useCallback(
|
|
4224
4224
|
(index) => {
|
|
4225
4225
|
if (index < 0) return;
|
|
4226
4226
|
const newTags = value.filter((_, i) => i !== index);
|
|
@@ -4230,7 +4230,7 @@ var LookupSelect = ({
|
|
|
4230
4230
|
},
|
|
4231
4231
|
[value, onChange]
|
|
4232
4232
|
);
|
|
4233
|
-
const handleClear =
|
|
4233
|
+
const handleClear = React26.useCallback(() => {
|
|
4234
4234
|
setInputValue("");
|
|
4235
4235
|
setSuggestions([]);
|
|
4236
4236
|
setInputFocused(false);
|
|
@@ -4238,7 +4238,7 @@ var LookupSelect = ({
|
|
|
4238
4238
|
setFetchError(null);
|
|
4239
4239
|
if (onClear) onClear();
|
|
4240
4240
|
}, [onClear]);
|
|
4241
|
-
const handleSuggestionSelect =
|
|
4241
|
+
const handleSuggestionSelect = React26.useCallback(
|
|
4242
4242
|
(option) => {
|
|
4243
4243
|
upsertOptionLabels([option]);
|
|
4244
4244
|
addTag(option.value);
|
|
@@ -4256,7 +4256,7 @@ var LookupSelect = ({
|
|
|
4256
4256
|
},
|
|
4257
4257
|
[addTag, multiple, upsertOptionLabels]
|
|
4258
4258
|
);
|
|
4259
|
-
const handleKeyDown =
|
|
4259
|
+
const handleKeyDown = React26.useCallback(
|
|
4260
4260
|
(e) => {
|
|
4261
4261
|
if (e.key === "ArrowDown" && suggestions.length > 0) {
|
|
4262
4262
|
e.preventDefault();
|
|
@@ -4283,7 +4283,7 @@ var LookupSelect = ({
|
|
|
4283
4283
|
},
|
|
4284
4284
|
[suggestions, activeSuggestionIndex, handleSuggestionSelect, inputValue, removeTag, value.length]
|
|
4285
4285
|
);
|
|
4286
|
-
const updateDropdownPosition =
|
|
4286
|
+
const updateDropdownPosition = React26.useCallback(() => {
|
|
4287
4287
|
if (!dropdownPortalElement || !containerRef.current) return;
|
|
4288
4288
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4289
4289
|
setDropdownStyles({
|
|
@@ -4294,7 +4294,7 @@ var LookupSelect = ({
|
|
|
4294
4294
|
zIndex: 50
|
|
4295
4295
|
});
|
|
4296
4296
|
}, [dropdownPortalElement]);
|
|
4297
|
-
|
|
4297
|
+
React26.useEffect(() => {
|
|
4298
4298
|
if (!fetchSuggestions || !inputFocused) return;
|
|
4299
4299
|
if (fetchDelayRef.current) {
|
|
4300
4300
|
clearTimeout(fetchDelayRef.current);
|
|
@@ -4328,7 +4328,7 @@ var LookupSelect = ({
|
|
|
4328
4328
|
}
|
|
4329
4329
|
};
|
|
4330
4330
|
}, [inputValue, fetchSuggestions, suggestionDebounce, upsertOptionLabels, inputFocused]);
|
|
4331
|
-
|
|
4331
|
+
React26.useEffect(() => {
|
|
4332
4332
|
if (!fetchSuggestions) return;
|
|
4333
4333
|
if (value.length === 0) return;
|
|
4334
4334
|
const unresolvedValues = value.filter((v) => !optionLabels[v]);
|
|
@@ -4338,7 +4338,7 @@ var LookupSelect = ({
|
|
|
4338
4338
|
}).catch(() => {
|
|
4339
4339
|
});
|
|
4340
4340
|
}, [value, fetchSuggestions, optionLabels, upsertOptionLabels]);
|
|
4341
|
-
|
|
4341
|
+
React26.useEffect(() => {
|
|
4342
4342
|
const handleDocumentClick = (event) => {
|
|
4343
4343
|
const target = event.target;
|
|
4344
4344
|
if (containerRef.current?.contains(target)) return;
|
|
@@ -4351,11 +4351,11 @@ var LookupSelect = ({
|
|
|
4351
4351
|
document.removeEventListener("mousedown", handleDocumentClick);
|
|
4352
4352
|
};
|
|
4353
4353
|
}, []);
|
|
4354
|
-
|
|
4354
|
+
React26.useEffect(() => {
|
|
4355
4355
|
if (!limitReached) return;
|
|
4356
4356
|
setIsDropdownOpen(false);
|
|
4357
4357
|
}, [limitReached]);
|
|
4358
|
-
|
|
4358
|
+
React26.useEffect(() => {
|
|
4359
4359
|
if (!dropdownPortalElement) return;
|
|
4360
4360
|
if (!isDropdownOpen) return;
|
|
4361
4361
|
updateDropdownPosition();
|
|
@@ -4367,7 +4367,7 @@ var LookupSelect = ({
|
|
|
4367
4367
|
window.removeEventListener("scroll", handleReposition, true);
|
|
4368
4368
|
};
|
|
4369
4369
|
}, [dropdownPortalElement, isDropdownOpen, updateDropdownPosition, value]);
|
|
4370
|
-
|
|
4370
|
+
React26.useEffect(() => {
|
|
4371
4371
|
if (suggestions.length === 0) {
|
|
4372
4372
|
setActiveSuggestionIndex(-1);
|
|
4373
4373
|
return;
|
|
@@ -5209,7 +5209,7 @@ var AdvanceSearch = ({
|
|
|
5209
5209
|
shortDateFormat,
|
|
5210
5210
|
filterFieldMap = FILTER_FIELD_MAP
|
|
5211
5211
|
}) => {
|
|
5212
|
-
const fieldsData =
|
|
5212
|
+
const fieldsData = React26.useMemo(() => {
|
|
5213
5213
|
if (fields.length === 0) throw new Error("fields cannot be an empty array");
|
|
5214
5214
|
return fields || [];
|
|
5215
5215
|
}, [fields]);
|
|
@@ -5229,8 +5229,8 @@ var AdvanceSearch = ({
|
|
|
5229
5229
|
defaultValues: {}
|
|
5230
5230
|
});
|
|
5231
5231
|
const { handleSubmit, unregister, resetField, getValues, clearErrors, setError } = form;
|
|
5232
|
-
const [operatorErrors, setOperatorErrors] =
|
|
5233
|
-
const clearOperatorError =
|
|
5232
|
+
const [operatorErrors, setOperatorErrors] = React26__namespace.default.useState({});
|
|
5233
|
+
const clearOperatorError = React26.useCallback(
|
|
5234
5234
|
(rowId) => {
|
|
5235
5235
|
setOperatorErrors((prev) => {
|
|
5236
5236
|
if (!(rowId in prev)) return prev;
|
|
@@ -5240,7 +5240,7 @@ var AdvanceSearch = ({
|
|
|
5240
5240
|
},
|
|
5241
5241
|
[setOperatorErrors]
|
|
5242
5242
|
);
|
|
5243
|
-
const clearValue =
|
|
5243
|
+
const clearValue = React26.useCallback(
|
|
5244
5244
|
(rowId, which) => {
|
|
5245
5245
|
const fieldName = `${which}_${rowId}`;
|
|
5246
5246
|
resetField(fieldName, { defaultValue: void 0 });
|
|
@@ -5250,14 +5250,14 @@ var AdvanceSearch = ({
|
|
|
5250
5250
|
},
|
|
5251
5251
|
[resetField, clearErrors]
|
|
5252
5252
|
);
|
|
5253
|
-
const parseRangeValue =
|
|
5253
|
+
const parseRangeValue = React26.useCallback((raw, fieldType) => {
|
|
5254
5254
|
if (!raw) return void 0;
|
|
5255
5255
|
if (Array.isArray(raw)) return void 0;
|
|
5256
5256
|
const normalized = fieldType === "datemonth" ? `${raw}-01` : raw;
|
|
5257
5257
|
const parsed = dateFns.parseISO(normalized);
|
|
5258
5258
|
return dateFns.isValid(parsed) ? parsed : void 0;
|
|
5259
5259
|
}, []);
|
|
5260
|
-
const onSubmit =
|
|
5260
|
+
const onSubmit = React26.useCallback(() => {
|
|
5261
5261
|
const operatorValidation = {};
|
|
5262
5262
|
rows.forEach((r) => {
|
|
5263
5263
|
const ops = operatorsForField(r.fieldName);
|
|
@@ -5495,11 +5495,11 @@ function resetVisibleTableState(payload) {
|
|
|
5495
5495
|
table.setSorting(prevState.sorting.filter((s) => isVisible(s.id)));
|
|
5496
5496
|
}
|
|
5497
5497
|
var useHover = () => {
|
|
5498
|
-
const [hovering, setHovering] =
|
|
5499
|
-
const prevRef =
|
|
5500
|
-
const onMouseEnter =
|
|
5501
|
-
const onMouseLeave =
|
|
5502
|
-
const nodeRefCallback =
|
|
5498
|
+
const [hovering, setHovering] = React26.useState(false);
|
|
5499
|
+
const prevRef = React26.useRef(null);
|
|
5500
|
+
const onMouseEnter = React26.useCallback(() => setHovering(true), []);
|
|
5501
|
+
const onMouseLeave = React26.useCallback(() => setHovering(false), []);
|
|
5502
|
+
const nodeRefCallback = React26.useCallback(
|
|
5503
5503
|
(node) => {
|
|
5504
5504
|
if (prevRef.current) {
|
|
5505
5505
|
prevRef.current.removeEventListener("mouseenter", onMouseEnter);
|
|
@@ -5527,15 +5527,15 @@ var useIntersectionObserver = ({
|
|
|
5527
5527
|
initialIsIntersecting = false,
|
|
5528
5528
|
onChange
|
|
5529
5529
|
} = {}) => {
|
|
5530
|
-
const [ref, setRef] =
|
|
5531
|
-
const [state, setState] =
|
|
5530
|
+
const [ref, setRef] = React26.useState(null);
|
|
5531
|
+
const [state, setState] = React26.useState(() => ({
|
|
5532
5532
|
isIntersecting: initialIsIntersecting,
|
|
5533
5533
|
entry: void 0
|
|
5534
5534
|
}));
|
|
5535
|
-
const callbackRef =
|
|
5535
|
+
const callbackRef = React26.useRef(null);
|
|
5536
5536
|
callbackRef.current = onChange;
|
|
5537
5537
|
const frozen = state.entry?.isIntersecting && freezeOnceVisible;
|
|
5538
|
-
|
|
5538
|
+
React26.useEffect(() => {
|
|
5539
5539
|
if (!ref) return;
|
|
5540
5540
|
if (!("IntersectionObserver" in window)) return;
|
|
5541
5541
|
if (frozen) return;
|
|
@@ -5565,8 +5565,8 @@ var useIntersectionObserver = ({
|
|
|
5565
5565
|
frozen,
|
|
5566
5566
|
freezeOnceVisible
|
|
5567
5567
|
]);
|
|
5568
|
-
const prevRef =
|
|
5569
|
-
|
|
5568
|
+
const prevRef = React26.useRef(null);
|
|
5569
|
+
React26.useEffect(() => {
|
|
5570
5570
|
if (!ref && state.entry?.target && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {
|
|
5571
5571
|
prevRef.current = state.entry.target;
|
|
5572
5572
|
setState({ isIntersecting: initialIsIntersecting, entry: void 0 });
|
|
@@ -5583,8 +5583,8 @@ var isValidMediaQueryString = (query) => {
|
|
|
5583
5583
|
return query !== "not all";
|
|
5584
5584
|
};
|
|
5585
5585
|
var useMediaQuery = ({ query }) => {
|
|
5586
|
-
const [matches, setMatches] =
|
|
5587
|
-
|
|
5586
|
+
const [matches, setMatches] = React26.useState(false);
|
|
5587
|
+
React26.useEffect(() => {
|
|
5588
5588
|
if (typeof window === "undefined") {
|
|
5589
5589
|
return;
|
|
5590
5590
|
}
|
|
@@ -5620,8 +5620,8 @@ var useTruncated = ({
|
|
|
5620
5620
|
onChange,
|
|
5621
5621
|
resizeDetectDelay = 150
|
|
5622
5622
|
}) => {
|
|
5623
|
-
const [isTruncated, setIsTruncated] =
|
|
5624
|
-
|
|
5623
|
+
const [isTruncated, setIsTruncated] = React26.useState(false);
|
|
5624
|
+
React26.useEffect(() => {
|
|
5625
5625
|
const element = elementRef.current;
|
|
5626
5626
|
if (!element) return;
|
|
5627
5627
|
const checkTruncate = debounce(() => {
|
|
@@ -5650,14 +5650,14 @@ var useControllableState = ({
|
|
|
5650
5650
|
value
|
|
5651
5651
|
}) => {
|
|
5652
5652
|
const isControlled = typeof value !== "undefined";
|
|
5653
|
-
const [internalValue, setInternalValue] =
|
|
5653
|
+
const [internalValue, setInternalValue] = React26__namespace.useState(() => {
|
|
5654
5654
|
return isControlled ? value : defaultValue;
|
|
5655
5655
|
});
|
|
5656
|
-
|
|
5656
|
+
React26__namespace.useEffect(() => {
|
|
5657
5657
|
if (!isControlled) return;
|
|
5658
5658
|
setInternalValue(value);
|
|
5659
5659
|
}, [isControlled, value]);
|
|
5660
|
-
const setValue =
|
|
5660
|
+
const setValue = React26__namespace.useCallback(
|
|
5661
5661
|
(nextValue) => {
|
|
5662
5662
|
if (isControlled) return;
|
|
5663
5663
|
setInternalValue(nextValue);
|
|
@@ -5671,7 +5671,7 @@ var useControllableState = ({
|
|
|
5671
5671
|
};
|
|
5672
5672
|
};
|
|
5673
5673
|
var useControllableState_default = useControllableState;
|
|
5674
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
5674
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React26.useLayoutEffect : React26.useEffect;
|
|
5675
5675
|
var HeaderCell = ({
|
|
5676
5676
|
rootClassName,
|
|
5677
5677
|
labelClassName,
|
|
@@ -5869,7 +5869,7 @@ var ColumnSeparator = ({ show, className, ...props }) => {
|
|
|
5869
5869
|
}
|
|
5870
5870
|
);
|
|
5871
5871
|
};
|
|
5872
|
-
var ColumnSeparator_default =
|
|
5872
|
+
var ColumnSeparator_default = React26__namespace.default.memo(ColumnSeparator);
|
|
5873
5873
|
var StatusContentSlot = ({
|
|
5874
5874
|
content,
|
|
5875
5875
|
icon,
|
|
@@ -5888,7 +5888,7 @@ var StatusContentSlot = ({
|
|
|
5888
5888
|
content
|
|
5889
5889
|
] });
|
|
5890
5890
|
};
|
|
5891
|
-
var StatusContentSlot_default =
|
|
5891
|
+
var StatusContentSlot_default = React26__namespace.default.memo(StatusContentSlot);
|
|
5892
5892
|
var stateOptions = [
|
|
5893
5893
|
"columnFilters",
|
|
5894
5894
|
"globalFilter",
|
|
@@ -5941,9 +5941,9 @@ var modelOptions = [
|
|
|
5941
5941
|
"getCenterVisibleLeafColumns"
|
|
5942
5942
|
];
|
|
5943
5943
|
var DataTableDevTool = ({ table }) => {
|
|
5944
|
-
const [open, setOpen] =
|
|
5945
|
-
const [visibleStates, setVisibleStates] =
|
|
5946
|
-
const [visibleModels, setVisibleModels] =
|
|
5944
|
+
const [open, setOpen] = React26.useState(false);
|
|
5945
|
+
const [visibleStates, setVisibleStates] = React26.useState([]);
|
|
5946
|
+
const [visibleModels, setVisibleModels] = React26.useState([]);
|
|
5947
5947
|
const tableState = table.getState();
|
|
5948
5948
|
const toggleValue = (arr, value) => arr.includes(value) ? arr.filter((v) => v !== value) : [...arr, value];
|
|
5949
5949
|
const getCircularReplacer = () => {
|
|
@@ -6200,14 +6200,14 @@ var DataTable = ({
|
|
|
6200
6200
|
columnResizeMode: columnResizing?.enabled ? columnResizing?.resizeMode ?? "onChange" : "onChange"
|
|
6201
6201
|
})
|
|
6202
6202
|
});
|
|
6203
|
-
const tableContainerRef =
|
|
6203
|
+
const tableContainerRef = React26.useRef(null);
|
|
6204
6204
|
const isTableEmpty = table.getCoreRowModel().rows.length === 0;
|
|
6205
6205
|
const isTableEmptyAfterFiltering = table.getRowModel().rows.length === 0;
|
|
6206
6206
|
const isFiltering = table.getState().columnFilters.length > 0 || !!table.getState().globalFilter;
|
|
6207
6207
|
const leftVisibleLeftColumns = table.getLeftVisibleLeafColumns();
|
|
6208
6208
|
const centerVisibleLeafColumns = table.getCenterVisibleLeafColumns();
|
|
6209
6209
|
const rightVisibleLeafColumns = table.getRightVisibleLeafColumns();
|
|
6210
|
-
const { isSomeColumnsFilterable, filterableColumns } =
|
|
6210
|
+
const { isSomeColumnsFilterable, filterableColumns } = React26.useMemo(() => {
|
|
6211
6211
|
const mergedColumns = [
|
|
6212
6212
|
...leftVisibleLeftColumns,
|
|
6213
6213
|
...centerVisibleLeafColumns,
|
|
@@ -6218,7 +6218,7 @@ var DataTable = ({
|
|
|
6218
6218
|
);
|
|
6219
6219
|
return { isSomeColumnsFilterable: isSomeColumnsFilterable2, filterableColumns: mergedColumns };
|
|
6220
6220
|
}, [centerVisibleLeafColumns, leftVisibleLeftColumns, rightVisibleLeafColumns]);
|
|
6221
|
-
const autoStatusKey =
|
|
6221
|
+
const autoStatusKey = React26.useMemo(() => {
|
|
6222
6222
|
if (isInitialLoading) return "initialLoading";
|
|
6223
6223
|
if (isTableEmpty) return "emptyData";
|
|
6224
6224
|
if (isTableEmptyAfterFiltering) return "emptyFilteredData";
|
|
@@ -6236,14 +6236,14 @@ var DataTable = ({
|
|
|
6236
6236
|
scrollFetch?.hasMore,
|
|
6237
6237
|
scrollFetch?.isFetchingMore
|
|
6238
6238
|
]);
|
|
6239
|
-
const activeStatusContentComputed =
|
|
6239
|
+
const activeStatusContentComputed = React26.useMemo(() => {
|
|
6240
6240
|
if (!activeStatusContent) return autoStatusKey;
|
|
6241
6241
|
if (typeof activeStatusContent === "function") {
|
|
6242
6242
|
return activeStatusContent({ defaultComputedValue: autoStatusKey });
|
|
6243
6243
|
}
|
|
6244
6244
|
return activeStatusContent;
|
|
6245
6245
|
}, [activeStatusContent, autoStatusKey]);
|
|
6246
|
-
const fetchMoreOnScrollReached =
|
|
6246
|
+
const fetchMoreOnScrollReached = React26.useCallback(
|
|
6247
6247
|
(containerRefElement) => {
|
|
6248
6248
|
if (!scrollFetch?.enabled || !containerRefElement || scrollFetch?.isFetchingMore || !scrollFetch?.hasMore || !scrollFetch?.fetchMore) {
|
|
6249
6249
|
return;
|
|
@@ -6277,14 +6277,14 @@ var DataTable = ({
|
|
|
6277
6277
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6278
6278
|
[scrollFetch?.enabled, scrollFetch?.isFetchingMore, scrollFetch?.hasMore, scrollFetch?.fetchMore]
|
|
6279
6279
|
);
|
|
6280
|
-
|
|
6280
|
+
React26.useEffect(() => {
|
|
6281
6281
|
if (!tableRef) return;
|
|
6282
6282
|
tableRef.current = table;
|
|
6283
6283
|
return () => {
|
|
6284
6284
|
tableRef.current = null;
|
|
6285
6285
|
};
|
|
6286
6286
|
}, [tableRef, table]);
|
|
6287
|
-
|
|
6287
|
+
React26.useEffect(() => {
|
|
6288
6288
|
fetchMoreOnScrollReached(tableContainerRef.current);
|
|
6289
6289
|
}, [fetchMoreOnScrollReached]);
|
|
6290
6290
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -6414,7 +6414,7 @@ var DataTable = ({
|
|
|
6414
6414
|
),
|
|
6415
6415
|
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { ...components?.tableBodyProps, children: table.getRowModel().rows.map((row) => {
|
|
6416
6416
|
const tableDataRowProps = typeof components?.tableDataRowProps === "function" ? components.tableDataRowProps({ row, table }) || {} : components?.tableDataRowProps || {};
|
|
6417
|
-
return /* @__PURE__ */
|
|
6417
|
+
return /* @__PURE__ */ React26.createElement(
|
|
6418
6418
|
TableRow,
|
|
6419
6419
|
{
|
|
6420
6420
|
"data-testid": `table-data-row-${row.id}`,
|
|
@@ -6747,11 +6747,11 @@ function DialogAlert({
|
|
|
6747
6747
|
}) {
|
|
6748
6748
|
const alignClass = align === "start" ? "justify-start" : align === "end" ? "justify-end" : "justify-center";
|
|
6749
6749
|
const { t } = reactI18next.useTranslation();
|
|
6750
|
-
const handleCancel =
|
|
6750
|
+
const handleCancel = React26.useCallback(() => {
|
|
6751
6751
|
onCancel?.();
|
|
6752
6752
|
onOpenChange(false);
|
|
6753
6753
|
}, [onCancel, onOpenChange]);
|
|
6754
|
-
const handleConfirm =
|
|
6754
|
+
const handleConfirm = React26.useCallback(() => {
|
|
6755
6755
|
let func = onConfirm;
|
|
6756
6756
|
if (variant === "success" && showCancel === false) {
|
|
6757
6757
|
func = onConfirm ?? onCancel;
|
|
@@ -7126,7 +7126,7 @@ var DialogAlertProvider = ({ children, i18nResource, i18nLang }) => {
|
|
|
7126
7126
|
const open = useDialogAlertStore((state) => state.open);
|
|
7127
7127
|
const setOpen = useDialogAlertStore((state) => state.setOpen);
|
|
7128
7128
|
const dialogProps = useDialogAlertStore((state) => state.dialogProps);
|
|
7129
|
-
|
|
7129
|
+
React26.useEffect(() => {
|
|
7130
7130
|
if (!i18nResource) {
|
|
7131
7131
|
i18n_default.changeLanguage("sharedui");
|
|
7132
7132
|
return;
|
|
@@ -7236,8 +7236,8 @@ var defaultOperatorShortcuts = {
|
|
|
7236
7236
|
};
|
|
7237
7237
|
var DEFAULT_DEBOUNCE = 200;
|
|
7238
7238
|
function useKeyboardNavigation(itemsLength, onSelect, isLocked) {
|
|
7239
|
-
const [selectedIndex, setSelectedIndex] =
|
|
7240
|
-
|
|
7239
|
+
const [selectedIndex, setSelectedIndex] = React26.useState(0);
|
|
7240
|
+
React26.useEffect(() => {
|
|
7241
7241
|
const handler = (event) => {
|
|
7242
7242
|
if (event.key === "ArrowDown") {
|
|
7243
7243
|
event.preventDefault();
|
|
@@ -7260,10 +7260,10 @@ function useKeyboardNavigation(itemsLength, onSelect, isLocked) {
|
|
|
7260
7260
|
return [selectedIndex, setSelectedIndex];
|
|
7261
7261
|
}
|
|
7262
7262
|
function useDropdownPosition(clientRect, itemsCount) {
|
|
7263
|
-
const [rect, setRect] =
|
|
7264
|
-
const [style, setStyle] =
|
|
7265
|
-
const ref =
|
|
7266
|
-
|
|
7263
|
+
const [rect, setRect] = React26.useState(null);
|
|
7264
|
+
const [style, setStyle] = React26.useState({});
|
|
7265
|
+
const ref = React26.useRef(null);
|
|
7266
|
+
React26.useEffect(() => {
|
|
7267
7267
|
if (!clientRect) return;
|
|
7268
7268
|
const update = () => {
|
|
7269
7269
|
const nextRect = clientRect();
|
|
@@ -7280,7 +7280,7 @@ function useDropdownPosition(clientRect, itemsCount) {
|
|
|
7280
7280
|
resizeObserver.disconnect();
|
|
7281
7281
|
};
|
|
7282
7282
|
}, [clientRect]);
|
|
7283
|
-
|
|
7283
|
+
React26.useLayoutEffect(() => {
|
|
7284
7284
|
if (!rect || !ref.current) return;
|
|
7285
7285
|
const dropdown = ref.current;
|
|
7286
7286
|
const dropdownRect = dropdown.getBoundingClientRect();
|
|
@@ -7307,15 +7307,15 @@ var SuggestionList = ({
|
|
|
7307
7307
|
debounceMs = DEFAULT_DEBOUNCE,
|
|
7308
7308
|
query
|
|
7309
7309
|
}) => {
|
|
7310
|
-
const [items, setItems] =
|
|
7311
|
-
const [isLoading, setIsLoading] =
|
|
7312
|
-
const fetchId =
|
|
7313
|
-
const debounceHandle =
|
|
7314
|
-
const itemRefs =
|
|
7310
|
+
const [items, setItems] = React26.useState([]);
|
|
7311
|
+
const [isLoading, setIsLoading] = React26.useState(false);
|
|
7312
|
+
const fetchId = React26.useRef(0);
|
|
7313
|
+
const debounceHandle = React26.useRef(null);
|
|
7314
|
+
const itemRefs = React26.useRef([]);
|
|
7315
7315
|
const { ref, style, rect } = useDropdownPosition(clientRect, items.length);
|
|
7316
|
-
const normalizedMap =
|
|
7317
|
-
const normalizeItem =
|
|
7318
|
-
|
|
7316
|
+
const normalizedMap = React26.useMemo(() => mapItem, [mapItem]);
|
|
7317
|
+
const normalizeItem = React26.useMemo(() => normalizeToken, [normalizeToken]);
|
|
7318
|
+
React26.useEffect(() => {
|
|
7319
7319
|
const runFetch = (input) => {
|
|
7320
7320
|
fetchId.current += 1;
|
|
7321
7321
|
const currentId = fetchId.current;
|
|
@@ -7346,7 +7346,7 @@ var SuggestionList = ({
|
|
|
7346
7346
|
fetchId.current += 1;
|
|
7347
7347
|
};
|
|
7348
7348
|
}, [query, fetchItems, normalizedMap, normalizeItem, debounceMs]);
|
|
7349
|
-
const handleSelect =
|
|
7349
|
+
const handleSelect = React26.useMemo(
|
|
7350
7350
|
() => (item) => {
|
|
7351
7351
|
if (isLoading) return;
|
|
7352
7352
|
command(item);
|
|
@@ -7361,10 +7361,10 @@ var SuggestionList = ({
|
|
|
7361
7361
|
},
|
|
7362
7362
|
isLoading
|
|
7363
7363
|
);
|
|
7364
|
-
|
|
7364
|
+
React26.useEffect(() => {
|
|
7365
7365
|
setSelectedIndex(0);
|
|
7366
7366
|
}, [items, setSelectedIndex]);
|
|
7367
|
-
|
|
7367
|
+
React26.useEffect(() => {
|
|
7368
7368
|
const element = itemRefs.current[selectedIndex];
|
|
7369
7369
|
if (element) element.scrollIntoView({ block: "nearest" });
|
|
7370
7370
|
}, [selectedIndex]);
|
|
@@ -7412,8 +7412,8 @@ var DISALLOWED_MARKS = ["bold", "italic", "link"];
|
|
|
7412
7412
|
var SUGGESTION_DEBOUNCE = 200;
|
|
7413
7413
|
var DEFAULT_CHIP_CLASS = "outline-1 outline-muted bg-muted/40 text-foreground";
|
|
7414
7414
|
var TokenView = ({ node, editor, getPos }) => {
|
|
7415
|
-
const [isFocused, setIsFocused] =
|
|
7416
|
-
|
|
7415
|
+
const [isFocused, setIsFocused] = React26__namespace.default.useState(false);
|
|
7416
|
+
React26__namespace.default.useEffect(() => {
|
|
7417
7417
|
const handler = () => {
|
|
7418
7418
|
const { from, to } = editor.state.selection;
|
|
7419
7419
|
const position = getPos();
|
|
@@ -8400,21 +8400,21 @@ function ToolbarPlugin({
|
|
|
8400
8400
|
acceptImageMimeTypes
|
|
8401
8401
|
}) {
|
|
8402
8402
|
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
8403
|
-
const [state, setState] =
|
|
8404
|
-
const fileInputRef =
|
|
8405
|
-
const [isLinkDialogOpen, setLinkDialogOpen] =
|
|
8406
|
-
const [editingExistingLink, setEditingExistingLink] =
|
|
8407
|
-
const [linkNodeKey, setLinkNodeKey] =
|
|
8408
|
-
const [isImageDialogOpen, setImageDialogOpen] =
|
|
8409
|
-
const [editingExistingImage, setEditingExistingImage] =
|
|
8410
|
-
const [imageNodeKey, setImageNodeKey] =
|
|
8403
|
+
const [state, setState] = React26.useState(initialToolbarState);
|
|
8404
|
+
const fileInputRef = React26.useRef(null);
|
|
8405
|
+
const [isLinkDialogOpen, setLinkDialogOpen] = React26.useState(false);
|
|
8406
|
+
const [editingExistingLink, setEditingExistingLink] = React26.useState(false);
|
|
8407
|
+
const [linkNodeKey, setLinkNodeKey] = React26.useState(null);
|
|
8408
|
+
const [isImageDialogOpen, setImageDialogOpen] = React26.useState(false);
|
|
8409
|
+
const [editingExistingImage, setEditingExistingImage] = React26.useState(false);
|
|
8410
|
+
const [imageNodeKey, setImageNodeKey] = React26.useState(null);
|
|
8411
8411
|
const linkForm = reactHookForm.useForm({
|
|
8412
8412
|
defaultValues: { url: "", label: "" }
|
|
8413
8413
|
});
|
|
8414
8414
|
const imageForm = reactHookForm.useForm({
|
|
8415
8415
|
defaultValues: { url: "", alt: "", width: "", height: "" }
|
|
8416
8416
|
});
|
|
8417
|
-
const openImageDialog =
|
|
8417
|
+
const openImageDialog = React26.useCallback(() => {
|
|
8418
8418
|
if (disabled || !allowImageUrlInsert) {
|
|
8419
8419
|
return;
|
|
8420
8420
|
}
|
|
@@ -8448,7 +8448,7 @@ function ToolbarPlugin({
|
|
|
8448
8448
|
setImageNodeKey(targetImage?.getKey() ?? null);
|
|
8449
8449
|
setImageDialogOpen(true);
|
|
8450
8450
|
}, [allowImageUrlInsert, disabled, editor, imageForm]);
|
|
8451
|
-
const closeImageDialog =
|
|
8451
|
+
const closeImageDialog = React26.useCallback(() => {
|
|
8452
8452
|
setImageDialogOpen(false);
|
|
8453
8453
|
setEditingExistingImage(false);
|
|
8454
8454
|
setImageNodeKey(null);
|
|
@@ -8457,7 +8457,7 @@ function ToolbarPlugin({
|
|
|
8457
8457
|
editor.focus();
|
|
8458
8458
|
}, 0);
|
|
8459
8459
|
}, [editor, imageForm]);
|
|
8460
|
-
const openLinkDialog =
|
|
8460
|
+
const openLinkDialog = React26.useCallback(() => {
|
|
8461
8461
|
if (disabled) {
|
|
8462
8462
|
return;
|
|
8463
8463
|
}
|
|
@@ -8497,7 +8497,7 @@ function ToolbarPlugin({
|
|
|
8497
8497
|
setLinkNodeKey(detectedLink?.getKey() ?? null);
|
|
8498
8498
|
setLinkDialogOpen(true);
|
|
8499
8499
|
}, [disabled, editor, linkForm]);
|
|
8500
|
-
const closeLinkDialog =
|
|
8500
|
+
const closeLinkDialog = React26.useCallback(() => {
|
|
8501
8501
|
setLinkDialogOpen(false);
|
|
8502
8502
|
setEditingExistingLink(false);
|
|
8503
8503
|
setLinkNodeKey(null);
|
|
@@ -8538,7 +8538,7 @@ function ToolbarPlugin({
|
|
|
8538
8538
|
});
|
|
8539
8539
|
closeLinkDialog();
|
|
8540
8540
|
});
|
|
8541
|
-
const handleRemoveLink =
|
|
8541
|
+
const handleRemoveLink = React26.useCallback(() => {
|
|
8542
8542
|
editor.focus();
|
|
8543
8543
|
editor.update(() => {
|
|
8544
8544
|
if (linkNodeKey) {
|
|
@@ -8555,7 +8555,7 @@ function ToolbarPlugin({
|
|
|
8555
8555
|
});
|
|
8556
8556
|
closeLinkDialog();
|
|
8557
8557
|
}, [closeLinkDialog, editor, linkNodeKey]);
|
|
8558
|
-
const handleLinkDialogOpenChange =
|
|
8558
|
+
const handleLinkDialogOpenChange = React26.useCallback(
|
|
8559
8559
|
(open) => {
|
|
8560
8560
|
if (open) {
|
|
8561
8561
|
setLinkDialogOpen(true);
|
|
@@ -8565,7 +8565,7 @@ function ToolbarPlugin({
|
|
|
8565
8565
|
},
|
|
8566
8566
|
[closeLinkDialog]
|
|
8567
8567
|
);
|
|
8568
|
-
const updateToolbar =
|
|
8568
|
+
const updateToolbar = React26.useCallback(() => {
|
|
8569
8569
|
const selection = lexical.$getSelection();
|
|
8570
8570
|
if (!lexical.$isRangeSelection(selection)) {
|
|
8571
8571
|
return;
|
|
@@ -8605,7 +8605,7 @@ function ToolbarPlugin({
|
|
|
8605
8605
|
isLink: hasLink
|
|
8606
8606
|
}));
|
|
8607
8607
|
}, []);
|
|
8608
|
-
|
|
8608
|
+
React26__namespace.useEffect(() => {
|
|
8609
8609
|
return utils.mergeRegister(
|
|
8610
8610
|
editor.registerCommand(
|
|
8611
8611
|
lexical.CAN_UNDO_COMMAND,
|
|
@@ -8636,7 +8636,7 @@ function ToolbarPlugin({
|
|
|
8636
8636
|
})
|
|
8637
8637
|
);
|
|
8638
8638
|
}, [editor, updateToolbar]);
|
|
8639
|
-
const applyBlock =
|
|
8639
|
+
const applyBlock = React26.useCallback(
|
|
8640
8640
|
(nextBlock) => {
|
|
8641
8641
|
if (disabled) {
|
|
8642
8642
|
return;
|
|
@@ -8698,7 +8698,7 @@ function ToolbarPlugin({
|
|
|
8698
8698
|
},
|
|
8699
8699
|
[disabled, editor, state.blockType]
|
|
8700
8700
|
);
|
|
8701
|
-
const toggleFormat =
|
|
8701
|
+
const toggleFormat = React26.useCallback(
|
|
8702
8702
|
(format5) => {
|
|
8703
8703
|
if (disabled) {
|
|
8704
8704
|
return;
|
|
@@ -8707,10 +8707,10 @@ function ToolbarPlugin({
|
|
|
8707
8707
|
},
|
|
8708
8708
|
[disabled, editor]
|
|
8709
8709
|
);
|
|
8710
|
-
const toggleLink =
|
|
8710
|
+
const toggleLink = React26.useCallback(() => {
|
|
8711
8711
|
openLinkDialog();
|
|
8712
8712
|
}, [openLinkDialog]);
|
|
8713
|
-
const applyElementFormat =
|
|
8713
|
+
const applyElementFormat = React26.useCallback(
|
|
8714
8714
|
(format5) => {
|
|
8715
8715
|
if (disabled) {
|
|
8716
8716
|
return;
|
|
@@ -8721,7 +8721,7 @@ function ToolbarPlugin({
|
|
|
8721
8721
|
);
|
|
8722
8722
|
const canInsertImage = allowImageUrlInsert || Boolean(onImageUpload);
|
|
8723
8723
|
const imageAccept = acceptImageMimeTypes ?? DEFAULT_IMAGE_ACCEPT;
|
|
8724
|
-
const handleInsertImage =
|
|
8724
|
+
const handleInsertImage = React26.useCallback(() => {
|
|
8725
8725
|
if (disabled || !canInsertImage) {
|
|
8726
8726
|
return;
|
|
8727
8727
|
}
|
|
@@ -8732,7 +8732,7 @@ function ToolbarPlugin({
|
|
|
8732
8732
|
}
|
|
8733
8733
|
openImageDialog();
|
|
8734
8734
|
}, [canInsertImage, disabled, editor, onImageUpload, openImageDialog]);
|
|
8735
|
-
const handleFileChange =
|
|
8735
|
+
const handleFileChange = React26.useCallback(
|
|
8736
8736
|
async (event) => {
|
|
8737
8737
|
if (!onImageUpload) {
|
|
8738
8738
|
return;
|
|
@@ -8822,7 +8822,7 @@ function ToolbarPlugin({
|
|
|
8822
8822
|
});
|
|
8823
8823
|
closeImageDialog();
|
|
8824
8824
|
});
|
|
8825
|
-
const handleImageDialogOpenChange =
|
|
8825
|
+
const handleImageDialogOpenChange = React26.useCallback(
|
|
8826
8826
|
(open) => {
|
|
8827
8827
|
if (open) {
|
|
8828
8828
|
setImageDialogOpen(true);
|
|
@@ -8832,7 +8832,7 @@ function ToolbarPlugin({
|
|
|
8832
8832
|
},
|
|
8833
8833
|
[closeImageDialog]
|
|
8834
8834
|
);
|
|
8835
|
-
const handleRemoveImage =
|
|
8835
|
+
const handleRemoveImage = React26.useCallback(() => {
|
|
8836
8836
|
if (!imageNodeKey) {
|
|
8837
8837
|
closeImageDialog();
|
|
8838
8838
|
return;
|
|
@@ -9191,7 +9191,7 @@ function ControlledValuePlugin({
|
|
|
9191
9191
|
trackAppliedValue
|
|
9192
9192
|
}) {
|
|
9193
9193
|
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
9194
|
-
|
|
9194
|
+
React26__namespace.useEffect(() => {
|
|
9195
9195
|
if (value == null || trackAppliedValue.current === value) {
|
|
9196
9196
|
return;
|
|
9197
9197
|
}
|
|
@@ -9215,14 +9215,14 @@ function ControlledValuePlugin({
|
|
|
9215
9215
|
}
|
|
9216
9216
|
function EditableStatePlugin({ editable }) {
|
|
9217
9217
|
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
9218
|
-
|
|
9218
|
+
React26__namespace.useEffect(() => {
|
|
9219
9219
|
editor.setEditable(editable);
|
|
9220
9220
|
}, [editor, editable]);
|
|
9221
9221
|
return null;
|
|
9222
9222
|
}
|
|
9223
9223
|
function ImagesPlugin() {
|
|
9224
9224
|
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
9225
|
-
|
|
9225
|
+
React26__namespace.useEffect(() => {
|
|
9226
9226
|
return editor.registerCommand(
|
|
9227
9227
|
INSERT_IMAGE_COMMAND,
|
|
9228
9228
|
(payload) => {
|
|
@@ -9241,7 +9241,7 @@ function ImagesPlugin() {
|
|
|
9241
9241
|
}, [editor]);
|
|
9242
9242
|
return null;
|
|
9243
9243
|
}
|
|
9244
|
-
var RichText =
|
|
9244
|
+
var RichText = React26.forwardRef(function RichText2({
|
|
9245
9245
|
value,
|
|
9246
9246
|
defaultValue,
|
|
9247
9247
|
onChange,
|
|
@@ -9260,11 +9260,11 @@ var RichText = React25.forwardRef(function RichText2({
|
|
|
9260
9260
|
id,
|
|
9261
9261
|
...rest
|
|
9262
9262
|
}, ref) {
|
|
9263
|
-
const initialSerializedStateRef =
|
|
9263
|
+
const initialSerializedStateRef = React26.useRef(void 0);
|
|
9264
9264
|
if (initialSerializedStateRef.current === void 0) {
|
|
9265
9265
|
initialSerializedStateRef.current = parseSerializedEditorState(value ?? defaultValue);
|
|
9266
9266
|
}
|
|
9267
|
-
const initialConfig =
|
|
9267
|
+
const initialConfig = React26.useMemo(
|
|
9268
9268
|
() => ({
|
|
9269
9269
|
namespace: "RichTextEditor",
|
|
9270
9270
|
editable: !(readOnly || disabled),
|
|
@@ -9277,8 +9277,8 @@ var RichText = React25.forwardRef(function RichText2({
|
|
|
9277
9277
|
}),
|
|
9278
9278
|
[disabled, readOnly]
|
|
9279
9279
|
);
|
|
9280
|
-
const appliedValueRef =
|
|
9281
|
-
const handleChange =
|
|
9280
|
+
const appliedValueRef = React26.useRef(value ?? defaultValue);
|
|
9281
|
+
const handleChange = React26.useCallback(
|
|
9282
9282
|
(editorState, editor) => {
|
|
9283
9283
|
const serialized = JSON.stringify(editorState.toJSON());
|
|
9284
9284
|
appliedValueRef.current = serialized;
|
|
@@ -9467,13 +9467,13 @@ function SheetDescription({
|
|
|
9467
9467
|
);
|
|
9468
9468
|
}
|
|
9469
9469
|
function useIsMobile(breakpoint = 768) {
|
|
9470
|
-
const [isMobile, setIsMobile] =
|
|
9470
|
+
const [isMobile, setIsMobile] = React26.useState(() => {
|
|
9471
9471
|
if (typeof window === "undefined") {
|
|
9472
9472
|
return false;
|
|
9473
9473
|
}
|
|
9474
9474
|
return window.innerWidth < breakpoint;
|
|
9475
9475
|
});
|
|
9476
|
-
|
|
9476
|
+
React26.useEffect(() => {
|
|
9477
9477
|
function onResize() {
|
|
9478
9478
|
setIsMobile(window.innerWidth < breakpoint);
|
|
9479
9479
|
}
|
|
@@ -9503,9 +9503,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
9503
9503
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
9504
9504
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
9505
9505
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
9506
|
-
var SidebarContext =
|
|
9506
|
+
var SidebarContext = React26__namespace.createContext(null);
|
|
9507
9507
|
function useSidebar() {
|
|
9508
|
-
const context =
|
|
9508
|
+
const context = React26__namespace.useContext(SidebarContext);
|
|
9509
9509
|
if (!context) {
|
|
9510
9510
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
9511
9511
|
}
|
|
@@ -9521,10 +9521,10 @@ function SidebarProvider({
|
|
|
9521
9521
|
...props
|
|
9522
9522
|
}) {
|
|
9523
9523
|
const isMobile = useIsMobile();
|
|
9524
|
-
const [openMobile, setOpenMobile] =
|
|
9525
|
-
const [_open, _setOpen] =
|
|
9524
|
+
const [openMobile, setOpenMobile] = React26__namespace.useState(false);
|
|
9525
|
+
const [_open, _setOpen] = React26__namespace.useState(defaultOpen);
|
|
9526
9526
|
const open = openProp ?? _open;
|
|
9527
|
-
const setOpen =
|
|
9527
|
+
const setOpen = React26__namespace.useCallback(
|
|
9528
9528
|
(value) => {
|
|
9529
9529
|
const openState = typeof value === "function" ? value(open) : value;
|
|
9530
9530
|
if (setOpenProp) {
|
|
@@ -9536,10 +9536,10 @@ function SidebarProvider({
|
|
|
9536
9536
|
},
|
|
9537
9537
|
[setOpenProp, open]
|
|
9538
9538
|
);
|
|
9539
|
-
const toggleSidebar =
|
|
9539
|
+
const toggleSidebar = React26__namespace.useCallback(() => {
|
|
9540
9540
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
9541
9541
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
9542
|
-
|
|
9542
|
+
React26__namespace.useEffect(() => {
|
|
9543
9543
|
const handleKeyDown = (event) => {
|
|
9544
9544
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
9545
9545
|
event.preventDefault();
|
|
@@ -9550,7 +9550,7 @@ function SidebarProvider({
|
|
|
9550
9550
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
9551
9551
|
}, [toggleSidebar]);
|
|
9552
9552
|
const state = open ? "expanded" : "collapsed";
|
|
9553
|
-
const contextValue =
|
|
9553
|
+
const contextValue = React26__namespace.useMemo(
|
|
9554
9554
|
() => ({
|
|
9555
9555
|
state,
|
|
9556
9556
|
open,
|
|
@@ -9992,7 +9992,7 @@ function SidebarMenuSkeleton({
|
|
|
9992
9992
|
showIcon = false,
|
|
9993
9993
|
...props
|
|
9994
9994
|
}) {
|
|
9995
|
-
const width =
|
|
9995
|
+
const width = React26__namespace.useMemo(() => {
|
|
9996
9996
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
9997
9997
|
}, []);
|
|
9998
9998
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -10135,8 +10135,8 @@ function TooltipProvider({
|
|
|
10135
10135
|
}) {
|
|
10136
10136
|
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Provider, { "data-slot": "tooltip-provider", delayDuration, ...props });
|
|
10137
10137
|
}
|
|
10138
|
-
function Tooltip({ ...props }) {
|
|
10139
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { "data-slot": "tooltip", ...props }) });
|
|
10138
|
+
function Tooltip({ children, ...props }) {
|
|
10139
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { "data-slot": "tooltip", ...props, children }) });
|
|
10140
10140
|
}
|
|
10141
10141
|
function TooltipTrigger({ ...props }) {
|
|
10142
10142
|
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
@@ -10257,10 +10257,10 @@ var FormulaEditor = ({
|
|
|
10257
10257
|
fieldState,
|
|
10258
10258
|
mode = "edit"
|
|
10259
10259
|
}) => {
|
|
10260
|
-
const [isExpanded, setIsExpanded] =
|
|
10261
|
-
const lastEmittedValueRef =
|
|
10262
|
-
const ignorePropValueRef =
|
|
10263
|
-
const normalizedConfigs =
|
|
10260
|
+
const [isExpanded, setIsExpanded] = React26.useState(false);
|
|
10261
|
+
const lastEmittedValueRef = React26.useRef(null);
|
|
10262
|
+
const ignorePropValueRef = React26.useRef(false);
|
|
10263
|
+
const normalizedConfigs = React26.useMemo(() => {
|
|
10264
10264
|
const configsToUse = tokenConfigs?.length ? tokenConfigs : DEFAULT_TOKEN_CONFIGS;
|
|
10265
10265
|
return configsToUse.map((config) => ({
|
|
10266
10266
|
...config,
|
|
@@ -10269,18 +10269,18 @@ var FormulaEditor = ({
|
|
|
10269
10269
|
outputType: config.outputType ?? config.type
|
|
10270
10270
|
}));
|
|
10271
10271
|
}, [tokenConfigs]);
|
|
10272
|
-
const prefixMap =
|
|
10273
|
-
const configLookup =
|
|
10272
|
+
const prefixMap = React26.useMemo(() => buildPrefixMap(normalizedConfigs), [normalizedConfigs]);
|
|
10273
|
+
const configLookup = React26.useMemo(() => {
|
|
10274
10274
|
const lookup = /* @__PURE__ */ new Map();
|
|
10275
10275
|
normalizedConfigs.forEach((config) => lookup.set(config.prefix, config));
|
|
10276
10276
|
return lookup;
|
|
10277
10277
|
}, [normalizedConfigs]);
|
|
10278
|
-
const allowedOperators =
|
|
10278
|
+
const allowedOperators = React26.useMemo(() => operators.map((operator) => operator.value), [operators]);
|
|
10279
10279
|
const displayError = errorMessage ?? fieldState?.error?.message;
|
|
10280
10280
|
const hasError = Boolean(displayError);
|
|
10281
10281
|
const isEditorReadOnly = mode === "display";
|
|
10282
10282
|
const isEditorDisabled = disabled || loading || isEditorReadOnly;
|
|
10283
|
-
const convertValueToContent =
|
|
10283
|
+
const convertValueToContent = React26.useCallback(
|
|
10284
10284
|
(input) => {
|
|
10285
10285
|
if (!input) return "";
|
|
10286
10286
|
const trimmed = input.trim();
|
|
@@ -10292,8 +10292,8 @@ var FormulaEditor = ({
|
|
|
10292
10292
|
},
|
|
10293
10293
|
[configLookup, prefixMap]
|
|
10294
10294
|
);
|
|
10295
|
-
const resolvedContent =
|
|
10296
|
-
const extensions =
|
|
10295
|
+
const resolvedContent = React26.useMemo(() => convertValueToContent(value), [convertValueToContent, value]);
|
|
10296
|
+
const extensions = React26.useMemo(
|
|
10297
10297
|
() => [
|
|
10298
10298
|
StarterKit__default.default.configure({ bold: false, italic: false }),
|
|
10299
10299
|
Token.configure({ configs: normalizedConfigs, onSelect: onSelectSuggestion }),
|
|
@@ -10325,11 +10325,11 @@ var FormulaEditor = ({
|
|
|
10325
10325
|
}
|
|
10326
10326
|
}
|
|
10327
10327
|
});
|
|
10328
|
-
|
|
10328
|
+
React26.useEffect(() => {
|
|
10329
10329
|
if (!editor) return;
|
|
10330
10330
|
editor.setEditable(!isEditorDisabled);
|
|
10331
10331
|
}, [editor, isEditorDisabled]);
|
|
10332
|
-
|
|
10332
|
+
React26.useEffect(() => {
|
|
10333
10333
|
if (!editor || resolvedContent === void 0) return;
|
|
10334
10334
|
if (ignorePropValueRef.current && typeof value === "string" && value === lastEmittedValueRef.current) {
|
|
10335
10335
|
ignorePropValueRef.current = false;
|
|
@@ -10462,7 +10462,7 @@ function SortableRow({
|
|
|
10462
10462
|
id: value,
|
|
10463
10463
|
disabled: name === "columns.0.id"
|
|
10464
10464
|
});
|
|
10465
|
-
const style =
|
|
10465
|
+
const style = React26__namespace.useMemo(
|
|
10466
10466
|
() => ({
|
|
10467
10467
|
transform: utilities.CSS.Transform.toString(transform),
|
|
10468
10468
|
transition
|
|
@@ -10574,8 +10574,8 @@ var GridSettingsModal = ({
|
|
|
10574
10574
|
onClose,
|
|
10575
10575
|
onSaveColumns
|
|
10576
10576
|
}) => {
|
|
10577
|
-
const [isDragging, setIsDragging] =
|
|
10578
|
-
const scrollRef =
|
|
10577
|
+
const [isDragging, setIsDragging] = React26.useState(false);
|
|
10578
|
+
const scrollRef = React26.useRef(null);
|
|
10579
10579
|
const form = reactHookForm.useForm({
|
|
10580
10580
|
resolver: zod$1.zodResolver(GridSettingsSchema),
|
|
10581
10581
|
defaultValues: { columns: currentColumns },
|
|
@@ -10587,7 +10587,7 @@ var GridSettingsModal = ({
|
|
|
10587
10587
|
name: "columns",
|
|
10588
10588
|
keyName: "fieldId"
|
|
10589
10589
|
});
|
|
10590
|
-
|
|
10590
|
+
React26.useEffect(() => {
|
|
10591
10591
|
if (isOpen) {
|
|
10592
10592
|
form.reset({ columns: currentColumns });
|
|
10593
10593
|
}
|
|
@@ -10864,7 +10864,7 @@ function getCandidateWidths({
|
|
|
10864
10864
|
}
|
|
10865
10865
|
return DEVICE_SIZES;
|
|
10866
10866
|
}
|
|
10867
|
-
var Image2 =
|
|
10867
|
+
var Image2 = React26__namespace.forwardRef(function Image3({
|
|
10868
10868
|
src,
|
|
10869
10869
|
alt,
|
|
10870
10870
|
width,
|
|
@@ -10894,34 +10894,34 @@ var Image2 = React25__namespace.forwardRef(function Image3({
|
|
|
10894
10894
|
} = imgProps;
|
|
10895
10895
|
const widthNumber = toNumber(width);
|
|
10896
10896
|
const heightNumber = toNumber(height);
|
|
10897
|
-
|
|
10897
|
+
React26__namespace.useEffect(() => {
|
|
10898
10898
|
if (!fill && (!widthNumber || !heightNumber)) {
|
|
10899
10899
|
console.warn(
|
|
10900
10900
|
"[Image] When `fill` is false you should provide both `width` and `height` to prevent layout shifts."
|
|
10901
10901
|
);
|
|
10902
10902
|
}
|
|
10903
10903
|
}, [fill, heightNumber, widthNumber]);
|
|
10904
|
-
const candidateWidths =
|
|
10904
|
+
const candidateWidths = React26__namespace.useMemo(
|
|
10905
10905
|
() => getCandidateWidths({ width: widthNumber, sizes, fill }),
|
|
10906
10906
|
[fill, sizes, widthNumber]
|
|
10907
10907
|
);
|
|
10908
10908
|
const largestWidth = candidateWidths[candidateWidths.length - 1] ?? widthNumber ?? DEVICE_SIZES[DEVICE_SIZES.length - 1];
|
|
10909
|
-
const computedSrc =
|
|
10909
|
+
const computedSrc = React26__namespace.useMemo(() => {
|
|
10910
10910
|
if (unoptimized) {
|
|
10911
10911
|
return src;
|
|
10912
10912
|
}
|
|
10913
10913
|
return loader({ src, width: largestWidth, quality });
|
|
10914
10914
|
}, [largestWidth, loader, quality, src, unoptimized]);
|
|
10915
|
-
const computedSrcSet =
|
|
10915
|
+
const computedSrcSet = React26__namespace.useMemo(() => {
|
|
10916
10916
|
if (unoptimized) {
|
|
10917
10917
|
return void 0;
|
|
10918
10918
|
}
|
|
10919
10919
|
return candidateWidths.map((currentWidth) => `${loader({ src, width: currentWidth, quality })} ${currentWidth}w`).join(", ");
|
|
10920
10920
|
}, [candidateWidths, loader, quality, src, unoptimized]);
|
|
10921
10921
|
const sizesValue = sizes ?? (fill ? "100vw" : widthNumber ? `${widthNumber}px` : void 0);
|
|
10922
|
-
const [isLoaded, setIsLoaded] =
|
|
10923
|
-
const internalRef =
|
|
10924
|
-
const setRefs =
|
|
10922
|
+
const [isLoaded, setIsLoaded] = React26__namespace.useState(false);
|
|
10923
|
+
const internalRef = React26__namespace.useRef(null);
|
|
10924
|
+
const setRefs = React26__namespace.useCallback(
|
|
10925
10925
|
(node) => {
|
|
10926
10926
|
internalRef.current = node;
|
|
10927
10927
|
if (!ref) {
|
|
@@ -10935,7 +10935,7 @@ var Image2 = React25__namespace.forwardRef(function Image3({
|
|
|
10935
10935
|
},
|
|
10936
10936
|
[ref]
|
|
10937
10937
|
);
|
|
10938
|
-
|
|
10938
|
+
React26__namespace.useEffect(() => {
|
|
10939
10939
|
const image = internalRef.current;
|
|
10940
10940
|
if (!image) {
|
|
10941
10941
|
return;
|
|
@@ -10947,7 +10947,7 @@ var Image2 = React25__namespace.forwardRef(function Image3({
|
|
|
10947
10947
|
setIsLoaded(false);
|
|
10948
10948
|
}
|
|
10949
10949
|
}, [onLoadingComplete, src]);
|
|
10950
|
-
const handleLoad =
|
|
10950
|
+
const handleLoad = React26__namespace.useCallback(
|
|
10951
10951
|
(event) => {
|
|
10952
10952
|
setIsLoaded(true);
|
|
10953
10953
|
onLoadProp?.(event);
|
|
@@ -10959,7 +10959,7 @@ var Image2 = React25__namespace.forwardRef(function Image3({
|
|
|
10959
10959
|
const fetchPriority = priority ? "high" : fetchPriorityProp;
|
|
10960
10960
|
const decoding = decodingProp ?? "async";
|
|
10961
10961
|
const resolvedObjectFit = objectFit ?? (fill ? "cover" : void 0);
|
|
10962
|
-
const wrapperStyle =
|
|
10962
|
+
const wrapperStyle = React26__namespace.useMemo(
|
|
10963
10963
|
() => ({
|
|
10964
10964
|
position: "relative",
|
|
10965
10965
|
display: fill ? "block" : "inline-block",
|
|
@@ -10969,7 +10969,7 @@ var Image2 = React25__namespace.forwardRef(function Image3({
|
|
|
10969
10969
|
}),
|
|
10970
10970
|
[fill, height, width]
|
|
10971
10971
|
);
|
|
10972
|
-
const imageStyle =
|
|
10972
|
+
const imageStyle = React26__namespace.useMemo(
|
|
10973
10973
|
() => ({
|
|
10974
10974
|
width: fill ? "100%" : formatDimension(width) ?? void 0,
|
|
10975
10975
|
height: fill ? "100%" : formatDimension(height) ?? void 0,
|
|
@@ -11118,7 +11118,7 @@ var InfoIcon = ({ size = "1em", className, ...props }) => {
|
|
|
11118
11118
|
}
|
|
11119
11119
|
);
|
|
11120
11120
|
};
|
|
11121
|
-
var InfoIcon_default =
|
|
11121
|
+
var InfoIcon_default = React26__namespace.default.memo(InfoIcon);
|
|
11122
11122
|
var Navbar = ({
|
|
11123
11123
|
className,
|
|
11124
11124
|
title,
|
|
@@ -11143,7 +11143,7 @@ var Navbar = ({
|
|
|
11143
11143
|
}) => {
|
|
11144
11144
|
const { isMobile, isTablet, isDesktop } = useScreenSize_default();
|
|
11145
11145
|
const Icon2 = lucideReact.CircleHelp;
|
|
11146
|
-
const shouldShowSeparator = !separatorDisable &&
|
|
11146
|
+
const shouldShowSeparator = !separatorDisable && React26.isValidElement(searchButton);
|
|
11147
11147
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11148
11148
|
"nav",
|
|
11149
11149
|
{
|
|
@@ -11154,8 +11154,8 @@ var Navbar = ({
|
|
|
11154
11154
|
children: [
|
|
11155
11155
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
11156
11156
|
headImageURL !== "" ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: headImageURL, alt: "", className: cn("w-full h-full", headImageURLClassName) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
11157
|
-
|
|
11158
|
-
|
|
11157
|
+
React26.isValidElement(title) ? title : /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-white text-xl font-bold", children: title }),
|
|
11158
|
+
React26.isValidElement(subTitle) ? subTitle : /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-white text-sm font-semibold", children: subTitle })
|
|
11159
11159
|
] }),
|
|
11160
11160
|
tooltipTitle && /* @__PURE__ */ jsxRuntime.jsxs(Tooltip2, { children: [
|
|
11161
11161
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: "text-white hover:opacity-80 ", children: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon_default, { className: "w-4" }) }) }),
|
|
@@ -11186,10 +11186,10 @@ var Navbar = ({
|
|
|
11186
11186
|
),
|
|
11187
11187
|
children: [
|
|
11188
11188
|
tooltipTitle && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
11189
|
-
|
|
11189
|
+
React26.isValidElement(tooltipIcon) ? tooltipIcon : /* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: 32, "aria-hidden": "true" }),
|
|
11190
11190
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-bold", children: tooltipTitle })
|
|
11191
11191
|
] }),
|
|
11192
|
-
|
|
11192
|
+
React26.isValidElement(tooltipdescription) && tooltipdescription
|
|
11193
11193
|
]
|
|
11194
11194
|
}
|
|
11195
11195
|
),
|
|
@@ -11244,13 +11244,13 @@ var Navbar = ({
|
|
|
11244
11244
|
}
|
|
11245
11245
|
),
|
|
11246
11246
|
shouldShowSeparator && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "separator", className: "ml-1 w-[1px] h-10 bg-white" }),
|
|
11247
|
-
|
|
11247
|
+
React26.isValidElement(searchButton) ? searchButton : ""
|
|
11248
11248
|
] })
|
|
11249
11249
|
]
|
|
11250
11250
|
}
|
|
11251
11251
|
);
|
|
11252
11252
|
};
|
|
11253
|
-
var navbar_default =
|
|
11253
|
+
var navbar_default = React26__namespace.default.memo(Navbar);
|
|
11254
11254
|
var usePreventPageLeaveStore = zustand.create((set) => ({
|
|
11255
11255
|
isPreventing: false,
|
|
11256
11256
|
setPreventing: (value) => set({ isPreventing: value })
|
|
@@ -11260,7 +11260,7 @@ var usePreventPageLeaveStore_default = usePreventPageLeaveStore;
|
|
|
11260
11260
|
// src/components/prevent-page-leave/PreventPageLeave.tsx
|
|
11261
11261
|
var PreventPageLeave = ({ children }) => {
|
|
11262
11262
|
const { isPreventing } = usePreventPageLeaveStore();
|
|
11263
|
-
|
|
11263
|
+
React26.useEffect(() => {
|
|
11264
11264
|
if (!isPreventing || typeof window === "undefined") {
|
|
11265
11265
|
return;
|
|
11266
11266
|
}
|
|
@@ -11278,7 +11278,7 @@ var PreventPageLeave = ({ children }) => {
|
|
|
11278
11278
|
var PreventPageLeave_default = PreventPageLeave;
|
|
11279
11279
|
var usePreventPageLeave = ({ isPrevening }) => {
|
|
11280
11280
|
const setPreventing = usePreventPageLeaveStore_default((state) => state.setPreventing);
|
|
11281
|
-
|
|
11281
|
+
React26.useEffect(() => {
|
|
11282
11282
|
setPreventing(isPrevening);
|
|
11283
11283
|
}, [isPrevening, setPreventing]);
|
|
11284
11284
|
};
|
|
@@ -11289,25 +11289,40 @@ var DefaultHeader = ({
|
|
|
11289
11289
|
icon,
|
|
11290
11290
|
classNames,
|
|
11291
11291
|
rightActions
|
|
11292
|
-
}) =>
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
11310
|
-
|
|
11292
|
+
}) => {
|
|
11293
|
+
const titleRef = React26__namespace.useRef(null);
|
|
11294
|
+
const isTruncated = useTruncated_default({ elementRef: titleRef });
|
|
11295
|
+
const textElement = title ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11296
|
+
"span",
|
|
11297
|
+
{
|
|
11298
|
+
ref: titleRef,
|
|
11299
|
+
className: cn("text-lg font-semibold text-sus-green-1 truncate", classNames?.title),
|
|
11300
|
+
children: title
|
|
11301
|
+
}
|
|
11302
|
+
) : null;
|
|
11303
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-start justify-between gap-3", classNames?.header), children: [
|
|
11304
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
11305
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11306
|
+
"div",
|
|
11307
|
+
{
|
|
11308
|
+
className: cn(
|
|
11309
|
+
"w-10 h-10 rounded-full bg-sus-green-50 flex items-center justify-center",
|
|
11310
|
+
classNames?.iconWrapper
|
|
11311
|
+
),
|
|
11312
|
+
children: icon
|
|
11313
|
+
}
|
|
11314
|
+
) : null,
|
|
11315
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
11316
|
+
subtitle ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs text-gray-500", classNames?.subtitle), children: subtitle }) : null,
|
|
11317
|
+
textElement ? isTruncated ? /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
11318
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: textElement }),
|
|
11319
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: title })
|
|
11320
|
+
] }) : textElement : null
|
|
11321
|
+
] })
|
|
11322
|
+
] }),
|
|
11323
|
+
rightActions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: rightActions }) : null
|
|
11324
|
+
] });
|
|
11325
|
+
};
|
|
11311
11326
|
var RightPanelContainer = ({
|
|
11312
11327
|
title,
|
|
11313
11328
|
subtitle,
|
|
@@ -11331,19 +11346,28 @@ var RightPanelContainer = ({
|
|
|
11331
11346
|
className,
|
|
11332
11347
|
classNames?.root
|
|
11333
11348
|
),
|
|
11334
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 flex min-h-0 px-4 py-6 justify-center", classNames?.body), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11340
|
-
|
|
11341
|
-
|
|
11342
|
-
classNames
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
|
|
11346
|
-
|
|
11349
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 flex min-h-0 min-w-0 px-4 py-6 justify-center", classNames?.body), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11350
|
+
"div",
|
|
11351
|
+
{
|
|
11352
|
+
className: cn(
|
|
11353
|
+
"w-full max-w-3xl min-w-0 overflow-x-hidden overflow-y-auto",
|
|
11354
|
+
classNames?.content
|
|
11355
|
+
),
|
|
11356
|
+
children: [
|
|
11357
|
+
renderHeader ? renderHeader({ title, subtitle, icon, rightActions, classNames }) : Header2 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11358
|
+
Header2,
|
|
11359
|
+
{
|
|
11360
|
+
title,
|
|
11361
|
+
subtitle,
|
|
11362
|
+
icon,
|
|
11363
|
+
rightActions,
|
|
11364
|
+
classNames
|
|
11365
|
+
}
|
|
11366
|
+
) : null,
|
|
11367
|
+
children
|
|
11368
|
+
]
|
|
11369
|
+
}
|
|
11370
|
+
) })
|
|
11347
11371
|
}
|
|
11348
11372
|
);
|
|
11349
11373
|
};
|
|
@@ -11484,20 +11508,20 @@ var CropperModal = ({
|
|
|
11484
11508
|
title,
|
|
11485
11509
|
props
|
|
11486
11510
|
}) => {
|
|
11487
|
-
const [isLoading, setIsLoading] =
|
|
11488
|
-
const [crop, setCrop] =
|
|
11489
|
-
const [zoom, setZoom] =
|
|
11490
|
-
const [croppedAreaPixels, setCroppedAreaPixels] =
|
|
11491
|
-
const handleClose =
|
|
11511
|
+
const [isLoading, setIsLoading] = React26.useState(false);
|
|
11512
|
+
const [crop, setCrop] = React26.useState({ x: 0, y: 0 });
|
|
11513
|
+
const [zoom, setZoom] = React26.useState();
|
|
11514
|
+
const [croppedAreaPixels, setCroppedAreaPixels] = React26.useState(null);
|
|
11515
|
+
const handleClose = React26.useCallback(() => {
|
|
11492
11516
|
onOpenChange(false);
|
|
11493
11517
|
}, [onOpenChange]);
|
|
11494
|
-
const handleCancel =
|
|
11518
|
+
const handleCancel = React26.useCallback(() => {
|
|
11495
11519
|
if (onCancel) {
|
|
11496
11520
|
onCancel();
|
|
11497
11521
|
}
|
|
11498
11522
|
handleClose();
|
|
11499
11523
|
}, [handleClose, onCancel]);
|
|
11500
|
-
const handleCropComplete =
|
|
11524
|
+
const handleCropComplete = React26.useCallback((_, croppedAreaPixels2) => {
|
|
11501
11525
|
setCroppedAreaPixels(croppedAreaPixels2);
|
|
11502
11526
|
}, []);
|
|
11503
11527
|
const handleConfirm = async () => {
|
|
@@ -11605,7 +11629,7 @@ function isFragment(object) {
|
|
|
11605
11629
|
var isValidText = (val) => ["string", "number"].includes(typeof val);
|
|
11606
11630
|
function toArray(children, option = {}) {
|
|
11607
11631
|
let ret = [];
|
|
11608
|
-
|
|
11632
|
+
React26__namespace.Children.forEach(children, (child) => {
|
|
11609
11633
|
if ((child === void 0 || child === null) && !option.keepEmpty) {
|
|
11610
11634
|
return;
|
|
11611
11635
|
}
|
|
@@ -11619,9 +11643,9 @@ function toArray(children, option = {}) {
|
|
|
11619
11643
|
});
|
|
11620
11644
|
return ret;
|
|
11621
11645
|
}
|
|
11622
|
-
var MeasureText =
|
|
11623
|
-
const spanRef =
|
|
11624
|
-
|
|
11646
|
+
var MeasureText = React26__namespace.forwardRef(({ style, children }, ref) => {
|
|
11647
|
+
const spanRef = React26__namespace.useRef(null);
|
|
11648
|
+
React26__namespace.useImperativeHandle(ref, () => ({
|
|
11625
11649
|
isExceed: () => {
|
|
11626
11650
|
const span = spanRef.current;
|
|
11627
11651
|
return span.scrollHeight > span.clientHeight;
|
|
@@ -11679,19 +11703,19 @@ var lineClipStyle = {
|
|
|
11679
11703
|
};
|
|
11680
11704
|
function EllipsisMeasure(props) {
|
|
11681
11705
|
const { enableMeasure, width, text, children, rows, expanded, miscDeps, onEllipsis } = props;
|
|
11682
|
-
const nodeList =
|
|
11683
|
-
const nodeLen =
|
|
11684
|
-
const fullContent =
|
|
11685
|
-
const [ellipsisCutIndex, setEllipsisCutIndex] =
|
|
11686
|
-
const cutMidRef =
|
|
11687
|
-
const measureWhiteSpaceRef =
|
|
11688
|
-
const needEllipsisRef =
|
|
11689
|
-
const descRowsEllipsisRef =
|
|
11690
|
-
const symbolRowEllipsisRef =
|
|
11691
|
-
const [canEllipsis, setCanEllipsis] =
|
|
11692
|
-
const [needEllipsis, setNeedEllipsis] =
|
|
11693
|
-
const [ellipsisHeight, setEllipsisHeight] =
|
|
11694
|
-
const [parentWhiteSpace, setParentWhiteSpace] =
|
|
11706
|
+
const nodeList = React26__namespace.useMemo(() => toArray(text), [text]);
|
|
11707
|
+
const nodeLen = React26__namespace.useMemo(() => getNodesLen(nodeList), [text]);
|
|
11708
|
+
const fullContent = React26__namespace.useMemo(() => children(nodeList, false), [text]);
|
|
11709
|
+
const [ellipsisCutIndex, setEllipsisCutIndex] = React26__namespace.useState(null);
|
|
11710
|
+
const cutMidRef = React26__namespace.useRef(null);
|
|
11711
|
+
const measureWhiteSpaceRef = React26__namespace.useRef(null);
|
|
11712
|
+
const needEllipsisRef = React26__namespace.useRef(null);
|
|
11713
|
+
const descRowsEllipsisRef = React26__namespace.useRef(null);
|
|
11714
|
+
const symbolRowEllipsisRef = React26__namespace.useRef(null);
|
|
11715
|
+
const [canEllipsis, setCanEllipsis] = React26__namespace.useState(false);
|
|
11716
|
+
const [needEllipsis, setNeedEllipsis] = React26__namespace.useState(STATUS_MEASURE_NONE);
|
|
11717
|
+
const [ellipsisHeight, setEllipsisHeight] = React26__namespace.useState(0);
|
|
11718
|
+
const [parentWhiteSpace, setParentWhiteSpace] = React26__namespace.useState(null);
|
|
11695
11719
|
useIsomorphicLayoutEffect(() => {
|
|
11696
11720
|
if (enableMeasure && width && nodeLen) {
|
|
11697
11721
|
setNeedEllipsis(STATUS_MEASURE_PREPARE);
|
|
@@ -11734,7 +11758,7 @@ function EllipsisMeasure(props) {
|
|
|
11734
11758
|
setEllipsisCutIndex(isOverflow ? [minIndex, targetMidIndex] : [targetMidIndex, maxIndex]);
|
|
11735
11759
|
}
|
|
11736
11760
|
}, [ellipsisCutIndex, cutMidIndex]);
|
|
11737
|
-
const finalContent =
|
|
11761
|
+
const finalContent = React26__namespace.useMemo(() => {
|
|
11738
11762
|
if (!enableMeasure) {
|
|
11739
11763
|
return children(nodeList, false);
|
|
11740
11764
|
}
|
|
@@ -11825,10 +11849,10 @@ var Truncated = ({
|
|
|
11825
11849
|
tooltipProps,
|
|
11826
11850
|
tooltipContentProps
|
|
11827
11851
|
}) => {
|
|
11828
|
-
const elementRef =
|
|
11829
|
-
const [open, setOpen] =
|
|
11830
|
-
const [isTruncated, setIsTruncated] =
|
|
11831
|
-
const [measureWidth, setMeasureWidth] =
|
|
11852
|
+
const elementRef = React26__namespace.useRef(null);
|
|
11853
|
+
const [open, setOpen] = React26__namespace.useState(false);
|
|
11854
|
+
const [isTruncated, setIsTruncated] = React26__namespace.useState(false);
|
|
11855
|
+
const [measureWidth, setMeasureWidth] = React26__namespace.useState(0);
|
|
11832
11856
|
const Comp = as;
|
|
11833
11857
|
const normalizedChildren = typeof children === "string" ? children.replace(/>/g, ">\u200B") : children;
|
|
11834
11858
|
const lineClampLines = typeof ellipsis === "number" ? ellipsis : typeof ellipsis === "object" ? ellipsis?.lineClamp ?? 3 : null;
|
|
@@ -11853,13 +11877,13 @@ var Truncated = ({
|
|
|
11853
11877
|
setIsTruncated(false);
|
|
11854
11878
|
}
|
|
11855
11879
|
}, [enableMeasure]);
|
|
11856
|
-
const truncationClass =
|
|
11880
|
+
const truncationClass = React26__namespace.useMemo(() => {
|
|
11857
11881
|
if (!ellipsis) return "";
|
|
11858
11882
|
if (typeof ellipsis === "number") return `line-clamp-${ellipsis}`;
|
|
11859
11883
|
if (typeof ellipsis === "object") return `line-clamp-${lineClampLines ?? 3}`;
|
|
11860
11884
|
return "truncate";
|
|
11861
11885
|
}, [ellipsis, lineClampLines]);
|
|
11862
|
-
const clampedStyle =
|
|
11886
|
+
const clampedStyle = React26__namespace.useMemo(() => {
|
|
11863
11887
|
if (!lineClampLines) return style;
|
|
11864
11888
|
return {
|
|
11865
11889
|
...style,
|
|
@@ -11921,7 +11945,7 @@ var Truncated = ({
|
|
|
11921
11945
|
);
|
|
11922
11946
|
};
|
|
11923
11947
|
var truncated_default = Truncated;
|
|
11924
|
-
var InputPrimitive2 =
|
|
11948
|
+
var InputPrimitive2 = React26__namespace.forwardRef(
|
|
11925
11949
|
({ className, type = "text", ...props }, ref) => {
|
|
11926
11950
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11927
11951
|
"input",
|
|
@@ -11960,7 +11984,7 @@ var inputVariants2 = classVarianceAuthority.cva("", {
|
|
|
11960
11984
|
appearance: "filled"
|
|
11961
11985
|
}
|
|
11962
11986
|
});
|
|
11963
|
-
var Input2 =
|
|
11987
|
+
var Input2 = React26__namespace.forwardRef(
|
|
11964
11988
|
({
|
|
11965
11989
|
className,
|
|
11966
11990
|
wrapperClassName,
|
|
@@ -11993,8 +12017,8 @@ var Input2 = React25__namespace.forwardRef(
|
|
|
11993
12017
|
onChange: onChangeProp
|
|
11994
12018
|
} = rest;
|
|
11995
12019
|
const ariaInvalid = invalid ?? ariaInvalidProp;
|
|
11996
|
-
const messageId =
|
|
11997
|
-
const handleChange =
|
|
12020
|
+
const messageId = React26__namespace.useId();
|
|
12021
|
+
const handleChange = React26__namespace.useCallback(
|
|
11998
12022
|
(event) => {
|
|
11999
12023
|
onChangeProp?.(event);
|
|
12000
12024
|
onValueChange?.(event.target.value);
|
|
@@ -12088,16 +12112,16 @@ var InputNumber = ({ customInputProps, ...props }) => {
|
|
|
12088
12112
|
return /* @__PURE__ */ jsxRuntime.jsx(reactNumberFormat.NumericFormat, { customInput: Input2, ...props, ...customInputProps });
|
|
12089
12113
|
};
|
|
12090
12114
|
var InputNumber_default = InputNumber;
|
|
12091
|
-
var ActionButton = ({ label, onPress, className }) => {
|
|
12092
|
-
const
|
|
12115
|
+
var ActionButton = ({ label, onPress, disabled, className }) => {
|
|
12116
|
+
const isDisabled = disabled || onPress === void 0;
|
|
12093
12117
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12094
12118
|
"button",
|
|
12095
12119
|
{
|
|
12096
12120
|
type: "button",
|
|
12097
|
-
disabled,
|
|
12121
|
+
disabled: isDisabled,
|
|
12098
12122
|
onClick: (e) => {
|
|
12099
12123
|
e.stopPropagation();
|
|
12100
|
-
if (
|
|
12124
|
+
if (isDisabled || !onPress) {
|
|
12101
12125
|
return;
|
|
12102
12126
|
}
|
|
12103
12127
|
onPress();
|
|
@@ -12105,7 +12129,7 @@ var ActionButton = ({ label, onPress, className }) => {
|
|
|
12105
12129
|
className: cn(
|
|
12106
12130
|
"action-menu-btn flex w-full items-center justify-start px-4 py-3 text-left",
|
|
12107
12131
|
"hover:bg-sus-secondary-green-3 hover:not-disabled:text-sus-primary-green-9 text-gray-800",
|
|
12108
|
-
|
|
12132
|
+
isDisabled && "cursor-not-allowed opacity-50 hover:bg-transparent text-gray-400",
|
|
12109
12133
|
className
|
|
12110
12134
|
),
|
|
12111
12135
|
children: label
|
|
@@ -12122,8 +12146,8 @@ var ActionMenu = ({
|
|
|
12122
12146
|
actionButtonClassName,
|
|
12123
12147
|
separatorClassName
|
|
12124
12148
|
}) => {
|
|
12125
|
-
const [open, setOpen] =
|
|
12126
|
-
const isAllowed =
|
|
12149
|
+
const [open, setOpen] = React26.useState(false);
|
|
12150
|
+
const isAllowed = React26.useCallback(
|
|
12127
12151
|
(requiredPermission) => {
|
|
12128
12152
|
if (!checkPermissionFunc || requiredPermission === void 0) {
|
|
12129
12153
|
return true;
|
|
@@ -12132,7 +12156,7 @@ var ActionMenu = ({
|
|
|
12132
12156
|
},
|
|
12133
12157
|
[checkPermissionFunc]
|
|
12134
12158
|
);
|
|
12135
|
-
const filteredButtons =
|
|
12159
|
+
const filteredButtons = React26.useMemo(() => {
|
|
12136
12160
|
return buttons.filter((btn) => isAllowed(btn.requiredPermission));
|
|
12137
12161
|
}, [buttons, isAllowed]);
|
|
12138
12162
|
if (buttons.length === 0) {
|
|
@@ -12168,6 +12192,7 @@ var ActionMenu = ({
|
|
|
12168
12192
|
{
|
|
12169
12193
|
className: actionButtonClassName,
|
|
12170
12194
|
label: btn.label,
|
|
12195
|
+
disabled: btn.disabled,
|
|
12171
12196
|
onPress: btn.onPress ? () => {
|
|
12172
12197
|
btn.onPress?.(id);
|
|
12173
12198
|
setOpen(false);
|
|
@@ -12387,13 +12412,13 @@ var useFieldNames = ({
|
|
|
12387
12412
|
fieldNames
|
|
12388
12413
|
}) => {
|
|
12389
12414
|
const { label: labelFieldKey = "label", value: valueFieldKey = "value" } = fieldNames || {};
|
|
12390
|
-
const getLabelField =
|
|
12415
|
+
const getLabelField = React26__namespace.default.useCallback(
|
|
12391
12416
|
(option) => {
|
|
12392
12417
|
return option?.[labelFieldKey];
|
|
12393
12418
|
},
|
|
12394
12419
|
[labelFieldKey]
|
|
12395
12420
|
);
|
|
12396
|
-
const getValueField =
|
|
12421
|
+
const getValueField = React26__namespace.default.useCallback(
|
|
12397
12422
|
(option) => {
|
|
12398
12423
|
return option?.[valueFieldKey];
|
|
12399
12424
|
},
|
|
@@ -12425,11 +12450,11 @@ var VirtualizedCommand = ({
|
|
|
12425
12450
|
onFocus
|
|
12426
12451
|
}) => {
|
|
12427
12452
|
const { getLabelField, getValueField } = useFieldNames_default({ fieldNames });
|
|
12428
|
-
const internalOptions =
|
|
12429
|
-
const [filteredOptions, setFilteredOptions] =
|
|
12430
|
-
const [focusedIndex, setFocusedIndex] =
|
|
12431
|
-
const [isKeyboardNavActive, setIsKeyboardNavActive] =
|
|
12432
|
-
const parentRef =
|
|
12453
|
+
const internalOptions = React26__namespace.useMemo(() => options ?? [], [options]);
|
|
12454
|
+
const [filteredOptions, setFilteredOptions] = React26__namespace.useState(internalOptions);
|
|
12455
|
+
const [focusedIndex, setFocusedIndex] = React26__namespace.useState(0);
|
|
12456
|
+
const [isKeyboardNavActive, setIsKeyboardNavActive] = React26__namespace.useState(false);
|
|
12457
|
+
const parentRef = React26__namespace.useRef(null);
|
|
12433
12458
|
const virtualizer = reactVirtual.useVirtualizer({
|
|
12434
12459
|
count: filteredOptions.length,
|
|
12435
12460
|
getScrollElement: () => parentRef.current,
|
|
@@ -12437,14 +12462,14 @@ var VirtualizedCommand = ({
|
|
|
12437
12462
|
overscan: 2
|
|
12438
12463
|
});
|
|
12439
12464
|
const virtualOptions = virtualizer.getVirtualItems();
|
|
12440
|
-
const dynamicHeight =
|
|
12465
|
+
const dynamicHeight = React26__namespace.useMemo(() => {
|
|
12441
12466
|
const contentHeight = filteredOptions.length * ROW_HEIGHT;
|
|
12442
12467
|
if (contentHeight <= 0) {
|
|
12443
12468
|
return MIN_HEIGHT_EMPTY;
|
|
12444
12469
|
}
|
|
12445
12470
|
return Math.max(ROW_HEIGHT, Math.min(height, contentHeight));
|
|
12446
12471
|
}, [filteredOptions.length, height]);
|
|
12447
|
-
const scrollToIndex =
|
|
12472
|
+
const scrollToIndex = React26__namespace.useCallback(
|
|
12448
12473
|
(index) => {
|
|
12449
12474
|
virtualizer.scrollToIndex(index, {
|
|
12450
12475
|
align: "center"
|
|
@@ -12452,7 +12477,7 @@ var VirtualizedCommand = ({
|
|
|
12452
12477
|
},
|
|
12453
12478
|
[virtualizer]
|
|
12454
12479
|
);
|
|
12455
|
-
const handleSearch =
|
|
12480
|
+
const handleSearch = React26__namespace.useCallback(
|
|
12456
12481
|
(search) => {
|
|
12457
12482
|
setIsKeyboardNavActive(false);
|
|
12458
12483
|
setFilteredOptions(
|
|
@@ -12467,7 +12492,7 @@ var VirtualizedCommand = ({
|
|
|
12467
12492
|
},
|
|
12468
12493
|
[filterOption, getLabelField, internalOptions]
|
|
12469
12494
|
);
|
|
12470
|
-
const handleKeyDown =
|
|
12495
|
+
const handleKeyDown = React26__namespace.useCallback(
|
|
12471
12496
|
(event) => {
|
|
12472
12497
|
switch (event.key) {
|
|
12473
12498
|
case "ArrowDown": {
|
|
@@ -12502,7 +12527,7 @@ var VirtualizedCommand = ({
|
|
|
12502
12527
|
},
|
|
12503
12528
|
[filteredOptions, focusedIndex, getValueField, onSelect, scrollToIndex]
|
|
12504
12529
|
);
|
|
12505
|
-
|
|
12530
|
+
React26__namespace.useEffect(() => {
|
|
12506
12531
|
if (value) {
|
|
12507
12532
|
const option = filteredOptions.find((option2) => {
|
|
12508
12533
|
const optionValue = getValueField(option2);
|
|
@@ -12629,13 +12654,13 @@ var ComboboxInner = ({
|
|
|
12629
12654
|
defaultValue,
|
|
12630
12655
|
value
|
|
12631
12656
|
});
|
|
12632
|
-
const currentSelectedOption =
|
|
12657
|
+
const currentSelectedOption = React26__namespace.useMemo(() => {
|
|
12633
12658
|
return options?.find((option) => {
|
|
12634
12659
|
const optionValue = getValueField(option);
|
|
12635
12660
|
return optionValue === selectedValue;
|
|
12636
12661
|
});
|
|
12637
12662
|
}, [getValueField, options, selectedValue]);
|
|
12638
|
-
const renderValue =
|
|
12663
|
+
const renderValue = React26__namespace.useMemo(() => {
|
|
12639
12664
|
if (!selectedValue) return placeholder2;
|
|
12640
12665
|
if (currentSelectedOption) {
|
|
12641
12666
|
return getLabelField(currentSelectedOption);
|
|
@@ -12645,7 +12670,7 @@ var ComboboxInner = ({
|
|
|
12645
12670
|
}
|
|
12646
12671
|
return null;
|
|
12647
12672
|
}, [currentSelectedOption, getLabelField, placeholder2, selectedValue, showValueWhenNoMatch]);
|
|
12648
|
-
const handleSelect =
|
|
12673
|
+
const handleSelect = React26__namespace.useCallback(
|
|
12649
12674
|
(selected, option) => {
|
|
12650
12675
|
setSelectedValue(selected);
|
|
12651
12676
|
setOpenPopover(false);
|
|
@@ -12658,7 +12683,7 @@ var ComboboxInner = ({
|
|
|
12658
12683
|
},
|
|
12659
12684
|
[onOpenChange, onSelect, setOpenPopover, setSelectedValue]
|
|
12660
12685
|
);
|
|
12661
|
-
const handleOpenPopover =
|
|
12686
|
+
const handleOpenPopover = React26__namespace.useCallback(
|
|
12662
12687
|
(isOpen) => {
|
|
12663
12688
|
if (disabled) return;
|
|
12664
12689
|
setOpenPopover(isOpen);
|
|
@@ -12668,7 +12693,7 @@ var ComboboxInner = ({
|
|
|
12668
12693
|
},
|
|
12669
12694
|
[disabled, onOpenChange, setOpenPopover]
|
|
12670
12695
|
);
|
|
12671
|
-
const handleClear =
|
|
12696
|
+
const handleClear = React26__namespace.useCallback(
|
|
12672
12697
|
(event) => {
|
|
12673
12698
|
event.stopPropagation();
|
|
12674
12699
|
setSelectedValue(void 0);
|
|
@@ -12757,7 +12782,7 @@ var ComboboxInner = ({
|
|
|
12757
12782
|
)
|
|
12758
12783
|
] });
|
|
12759
12784
|
};
|
|
12760
|
-
var Combobox =
|
|
12785
|
+
var Combobox = React26__namespace.forwardRef(ComboboxInner);
|
|
12761
12786
|
var Combobox_default = Combobox;
|
|
12762
12787
|
var TruncatedMouseEnterDiv = ({
|
|
12763
12788
|
value,
|
|
@@ -12766,8 +12791,8 @@ var TruncatedMouseEnterDiv = ({
|
|
|
12766
12791
|
tooltipContentProps,
|
|
12767
12792
|
arrowClassName
|
|
12768
12793
|
}) => {
|
|
12769
|
-
const textRef =
|
|
12770
|
-
const [isTruncated, setIsTruncated] =
|
|
12794
|
+
const textRef = React26.useRef(null);
|
|
12795
|
+
const [isTruncated, setIsTruncated] = React26.useState(false);
|
|
12771
12796
|
const checkTruncation = () => {
|
|
12772
12797
|
if (textRef.current) {
|
|
12773
12798
|
const { scrollWidth, clientWidth } = textRef.current;
|
|
@@ -12827,8 +12852,8 @@ var TabSelect = ({
|
|
|
12827
12852
|
separatorClassName,
|
|
12828
12853
|
...rest
|
|
12829
12854
|
}) => {
|
|
12830
|
-
const [selected, setSelected] =
|
|
12831
|
-
|
|
12855
|
+
const [selected, setSelected] = React26.useState(items[0]);
|
|
12856
|
+
React26.useEffect(() => {
|
|
12832
12857
|
onSelectTab(selected.id);
|
|
12833
12858
|
}, [onSelectTab, selected]);
|
|
12834
12859
|
if (items.length === 0) {
|