@gomeniucivan/ui 1.0.10 → 1.0.12
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.cjs +751 -568
- package/dist/index.js +690 -510
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React59 from 'react';
|
|
2
|
+
import React59__default, { createContext, useContext, useLayoutEffect, useState, useCallback, useEffect, useMemo, useSyncExternalStore, useRef } from 'react';
|
|
3
3
|
import { CheckIcon, Loader2, X, CircleIcon, ChevronDownIcon, ChevronRight, MoreHorizontal, ChevronLeftIcon, ChevronRightIcon, ArrowLeft, ArrowRight, XIcon, SearchIcon, ChevronsLeft, ChevronLeft, ChevronsRight, Calendar as Calendar$1, MinusIcon, MoreHorizontalIcon, GripVerticalIcon, ChevronUpIcon, PanelLeftIcon, Clock, Settings2, Search, RotateCcw, ChevronsUpDown, ArrowUp, ArrowDown, GripVertical } from 'lucide-react';
|
|
4
4
|
import { jsxs as jsxs$1, jsx as jsx$1, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -354,6 +354,143 @@ function useStore(store, selector) {
|
|
|
354
354
|
|
|
355
355
|
// src/lib/constants.ts
|
|
356
356
|
var FIELD_HEIGHT_MOBILE_CLASS = "h-10 md:h-9";
|
|
357
|
+
|
|
358
|
+
// src/lib/virtual-keyboard.ts
|
|
359
|
+
var KEYBOARD_HEIGHT_THRESHOLD = 80;
|
|
360
|
+
var KEYBOARD_DETECTION_TIMEOUT = 600;
|
|
361
|
+
var isVirtualKeyboardLikelyDevice = false;
|
|
362
|
+
var hasAttemptedVirtualKeyboardDetection = false;
|
|
363
|
+
var pendingKeyboardDetection = null;
|
|
364
|
+
var isReducedMotionPreferred = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
365
|
+
var scrollElementIntoView = (element) => {
|
|
366
|
+
if (!element || typeof element.scrollIntoView !== "function") {
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
const prefersReducedMotion = isReducedMotionPreferred();
|
|
370
|
+
const scroll = () => element.scrollIntoView({
|
|
371
|
+
behavior: prefersReducedMotion ? "auto" : "smooth",
|
|
372
|
+
block: "center",
|
|
373
|
+
inline: "nearest"
|
|
374
|
+
});
|
|
375
|
+
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
376
|
+
window.requestAnimationFrame(scroll);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
scroll();
|
|
380
|
+
};
|
|
381
|
+
var getKeyboardOverlap = (viewport) => {
|
|
382
|
+
const windowHeight = typeof window !== "undefined" ? window.innerHeight : 0;
|
|
383
|
+
const overlap = windowHeight - viewport.height - viewport.offsetTop;
|
|
384
|
+
return Math.max(0, overlap);
|
|
385
|
+
};
|
|
386
|
+
var detectVirtualKeyboardDevice = () => {
|
|
387
|
+
if (isVirtualKeyboardLikelyDevice) {
|
|
388
|
+
return Promise.resolve(true);
|
|
389
|
+
}
|
|
390
|
+
if (hasAttemptedVirtualKeyboardDetection) {
|
|
391
|
+
return Promise.resolve(false);
|
|
392
|
+
}
|
|
393
|
+
if (typeof window === "undefined") {
|
|
394
|
+
hasAttemptedVirtualKeyboardDetection = true;
|
|
395
|
+
return Promise.resolve(false);
|
|
396
|
+
}
|
|
397
|
+
const viewport = window.visualViewport;
|
|
398
|
+
if (!viewport) {
|
|
399
|
+
hasAttemptedVirtualKeyboardDetection = true;
|
|
400
|
+
return Promise.resolve(false);
|
|
401
|
+
}
|
|
402
|
+
if (pendingKeyboardDetection) {
|
|
403
|
+
return pendingKeyboardDetection;
|
|
404
|
+
}
|
|
405
|
+
pendingKeyboardDetection = new Promise((resolve) => {
|
|
406
|
+
let resolved = false;
|
|
407
|
+
let timeoutId;
|
|
408
|
+
const finalize = (value) => {
|
|
409
|
+
if (resolved) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
resolved = true;
|
|
413
|
+
viewport.removeEventListener("resize", handleViewportChange);
|
|
414
|
+
viewport.removeEventListener("scroll", handleViewportChange);
|
|
415
|
+
if (typeof timeoutId === "number") {
|
|
416
|
+
window.clearTimeout(timeoutId);
|
|
417
|
+
}
|
|
418
|
+
if (value) {
|
|
419
|
+
isVirtualKeyboardLikelyDevice = true;
|
|
420
|
+
} else {
|
|
421
|
+
hasAttemptedVirtualKeyboardDetection = true;
|
|
422
|
+
}
|
|
423
|
+
resolve(value);
|
|
424
|
+
};
|
|
425
|
+
const handleViewportChange = () => {
|
|
426
|
+
const overlap = getKeyboardOverlap(viewport);
|
|
427
|
+
if (overlap > KEYBOARD_HEIGHT_THRESHOLD) {
|
|
428
|
+
finalize(true);
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
timeoutId = window.setTimeout(() => finalize(false), KEYBOARD_DETECTION_TIMEOUT);
|
|
432
|
+
handleViewportChange();
|
|
433
|
+
if (!resolved) {
|
|
434
|
+
viewport.addEventListener("resize", handleViewportChange, { passive: true });
|
|
435
|
+
viewport.addEventListener("scroll", handleViewportChange, { passive: true });
|
|
436
|
+
}
|
|
437
|
+
}).finally(() => {
|
|
438
|
+
pendingKeyboardDetection = null;
|
|
439
|
+
});
|
|
440
|
+
return pendingKeyboardDetection;
|
|
441
|
+
};
|
|
442
|
+
var isElementFullyVisibleWithinViewport = (element) => {
|
|
443
|
+
if (typeof window === "undefined") {
|
|
444
|
+
return true;
|
|
445
|
+
}
|
|
446
|
+
const rect = element.getBoundingClientRect();
|
|
447
|
+
const viewport = window.visualViewport;
|
|
448
|
+
if (!viewport) {
|
|
449
|
+
const viewportHeight = window.innerHeight || 0;
|
|
450
|
+
return rect.top >= 0 && rect.bottom <= viewportHeight;
|
|
451
|
+
}
|
|
452
|
+
const viewportTop = viewport.offsetTop;
|
|
453
|
+
const viewportBottom = viewportTop + viewport.height;
|
|
454
|
+
return rect.top >= viewportTop && rect.bottom <= viewportBottom;
|
|
455
|
+
};
|
|
456
|
+
var maybeScrollElementIntoView = (element) => {
|
|
457
|
+
if (!element) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
detectVirtualKeyboardDevice().then((keyboardDevice) => {
|
|
461
|
+
if (!keyboardDevice) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
if (typeof document !== "undefined" && document.activeElement !== element) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
if (!element.isConnected) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
if (isElementFullyVisibleWithinViewport(element)) {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const triggerScroll = () => scrollElementIntoView(element);
|
|
474
|
+
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
475
|
+
window.requestAnimationFrame(triggerScroll);
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
triggerScroll();
|
|
479
|
+
});
|
|
480
|
+
};
|
|
481
|
+
var __virtualKeyboardTesting = {
|
|
482
|
+
get isVirtualKeyboardLikelyDevice() {
|
|
483
|
+
return isVirtualKeyboardLikelyDevice;
|
|
484
|
+
},
|
|
485
|
+
get hasAttemptedVirtualKeyboardDetection() {
|
|
486
|
+
return hasAttemptedVirtualKeyboardDetection;
|
|
487
|
+
},
|
|
488
|
+
reset() {
|
|
489
|
+
isVirtualKeyboardLikelyDevice = false;
|
|
490
|
+
hasAttemptedVirtualKeyboardDetection = false;
|
|
491
|
+
pendingKeyboardDetection = null;
|
|
492
|
+
}
|
|
493
|
+
};
|
|
357
494
|
function useDataTableInstance({
|
|
358
495
|
data,
|
|
359
496
|
columns,
|
|
@@ -362,11 +499,11 @@ function useDataTableInstance({
|
|
|
362
499
|
defaultPageSize,
|
|
363
500
|
getRowId
|
|
364
501
|
}) {
|
|
365
|
-
const [rowSelection, setRowSelection] =
|
|
366
|
-
const [columnVisibility, setColumnVisibility] =
|
|
367
|
-
const [columnFilters, setColumnFilters] =
|
|
368
|
-
const [sorting, setSorting] =
|
|
369
|
-
const [pagination, setPagination] =
|
|
502
|
+
const [rowSelection, setRowSelection] = React59.useState({});
|
|
503
|
+
const [columnVisibility, setColumnVisibility] = React59.useState({});
|
|
504
|
+
const [columnFilters, setColumnFilters] = React59.useState([]);
|
|
505
|
+
const [sorting, setSorting] = React59.useState([]);
|
|
506
|
+
const [pagination, setPagination] = React59.useState({
|
|
370
507
|
pageIndex: defaultPageIndex != null ? defaultPageIndex : 0,
|
|
371
508
|
pageSize: defaultPageSize != null ? defaultPageSize : 10
|
|
372
509
|
});
|
|
@@ -533,7 +670,7 @@ var buttonVariants = cva(
|
|
|
533
670
|
}
|
|
534
671
|
}
|
|
535
672
|
);
|
|
536
|
-
var Button =
|
|
673
|
+
var Button = React59.forwardRef(
|
|
537
674
|
({
|
|
538
675
|
className,
|
|
539
676
|
variant,
|
|
@@ -1034,8 +1171,8 @@ function CalendarDayButton({
|
|
|
1034
1171
|
...props
|
|
1035
1172
|
}) {
|
|
1036
1173
|
const defaultClassNames = getDefaultClassNames();
|
|
1037
|
-
const ref =
|
|
1038
|
-
|
|
1174
|
+
const ref = React59.useRef(null);
|
|
1175
|
+
React59.useEffect(() => {
|
|
1039
1176
|
var _a2;
|
|
1040
1177
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
1041
1178
|
}, [modifiers.focused]);
|
|
@@ -1140,9 +1277,9 @@ function CardFooter({ className, ...props }) {
|
|
|
1140
1277
|
}
|
|
1141
1278
|
);
|
|
1142
1279
|
}
|
|
1143
|
-
var CarouselContext =
|
|
1280
|
+
var CarouselContext = React59.createContext(null);
|
|
1144
1281
|
function useCarousel() {
|
|
1145
|
-
const context =
|
|
1282
|
+
const context = React59.useContext(CarouselContext);
|
|
1146
1283
|
if (!context) {
|
|
1147
1284
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
1148
1285
|
}
|
|
@@ -1164,20 +1301,20 @@ function Carousel({
|
|
|
1164
1301
|
},
|
|
1165
1302
|
plugins
|
|
1166
1303
|
);
|
|
1167
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
1168
|
-
const [canScrollNext, setCanScrollNext] =
|
|
1169
|
-
const onSelect =
|
|
1304
|
+
const [canScrollPrev, setCanScrollPrev] = React59.useState(false);
|
|
1305
|
+
const [canScrollNext, setCanScrollNext] = React59.useState(false);
|
|
1306
|
+
const onSelect = React59.useCallback((api2) => {
|
|
1170
1307
|
if (!api2) return;
|
|
1171
1308
|
setCanScrollPrev(api2.canScrollPrev());
|
|
1172
1309
|
setCanScrollNext(api2.canScrollNext());
|
|
1173
1310
|
}, []);
|
|
1174
|
-
const scrollPrev =
|
|
1311
|
+
const scrollPrev = React59.useCallback(() => {
|
|
1175
1312
|
api == null ? void 0 : api.scrollPrev();
|
|
1176
1313
|
}, [api]);
|
|
1177
|
-
const scrollNext =
|
|
1314
|
+
const scrollNext = React59.useCallback(() => {
|
|
1178
1315
|
api == null ? void 0 : api.scrollNext();
|
|
1179
1316
|
}, [api]);
|
|
1180
|
-
const handleKeyDown =
|
|
1317
|
+
const handleKeyDown = React59.useCallback(
|
|
1181
1318
|
(event) => {
|
|
1182
1319
|
if (event.key === "ArrowLeft") {
|
|
1183
1320
|
event.preventDefault();
|
|
@@ -1189,11 +1326,11 @@ function Carousel({
|
|
|
1189
1326
|
},
|
|
1190
1327
|
[scrollPrev, scrollNext]
|
|
1191
1328
|
);
|
|
1192
|
-
|
|
1329
|
+
React59.useEffect(() => {
|
|
1193
1330
|
if (!api || !setApi) return;
|
|
1194
1331
|
setApi(api);
|
|
1195
1332
|
}, [api, setApi]);
|
|
1196
|
-
|
|
1333
|
+
React59.useEffect(() => {
|
|
1197
1334
|
if (!api) return;
|
|
1198
1335
|
onSelect(api);
|
|
1199
1336
|
api.on("reInit", onSelect);
|
|
@@ -1326,9 +1463,9 @@ function CarouselNext({
|
|
|
1326
1463
|
);
|
|
1327
1464
|
}
|
|
1328
1465
|
var THEMES = { light: "", dark: ".dark" };
|
|
1329
|
-
var ChartContext =
|
|
1466
|
+
var ChartContext = React59.createContext(null);
|
|
1330
1467
|
function useChart() {
|
|
1331
|
-
const context =
|
|
1468
|
+
const context = React59.useContext(ChartContext);
|
|
1332
1469
|
if (!context) {
|
|
1333
1470
|
throw new Error("useChart must be used within a <ChartContainer />");
|
|
1334
1471
|
}
|
|
@@ -1341,7 +1478,7 @@ function ChartContainer({
|
|
|
1341
1478
|
config,
|
|
1342
1479
|
...props
|
|
1343
1480
|
}) {
|
|
1344
|
-
const uniqueId =
|
|
1481
|
+
const uniqueId = React59.useId();
|
|
1345
1482
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
1346
1483
|
return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
|
|
1347
1484
|
"div",
|
|
@@ -1403,7 +1540,7 @@ function ChartTooltipContent({
|
|
|
1403
1540
|
labelKey
|
|
1404
1541
|
}) {
|
|
1405
1542
|
const { config } = useChart();
|
|
1406
|
-
const tooltipLabel =
|
|
1543
|
+
const tooltipLabel = React59.useMemo(() => {
|
|
1407
1544
|
var _a2;
|
|
1408
1545
|
if (hideLabel || !(payload == null ? void 0 : payload.length)) {
|
|
1409
1546
|
return null;
|
|
@@ -1557,7 +1694,7 @@ function getPayloadConfigFromPayload(config, payload, key) {
|
|
|
1557
1694
|
}
|
|
1558
1695
|
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
1559
1696
|
}
|
|
1560
|
-
var Checkbox =
|
|
1697
|
+
var Checkbox = React59.forwardRef(function Checkbox2({ className, ...props }, ref) {
|
|
1561
1698
|
return /* @__PURE__ */ jsx(
|
|
1562
1699
|
Checkbox$1.Root,
|
|
1563
1700
|
{
|
|
@@ -2431,8 +2568,8 @@ function getIsMobile() {
|
|
|
2431
2568
|
return widthMatch || uaMatch || userAgentDataMobile;
|
|
2432
2569
|
}
|
|
2433
2570
|
function useIsMobile() {
|
|
2434
|
-
const [isMobile, setIsMobile] =
|
|
2435
|
-
|
|
2571
|
+
const [isMobile, setIsMobile] = React59.useState(() => getIsMobile());
|
|
2572
|
+
React59.useEffect(() => {
|
|
2436
2573
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
2437
2574
|
const onChange = () => {
|
|
2438
2575
|
setIsMobile(getIsMobile());
|
|
@@ -3278,8 +3415,8 @@ var initializeMonitoring = (options) => {
|
|
|
3278
3415
|
};
|
|
3279
3416
|
var getMonitor = () => getMonitoringInstance().api;
|
|
3280
3417
|
var useMonitor = (options) => {
|
|
3281
|
-
const optionsRef =
|
|
3282
|
-
|
|
3418
|
+
const optionsRef = React59.useRef();
|
|
3419
|
+
React59.useEffect(() => {
|
|
3283
3420
|
if (!options) {
|
|
3284
3421
|
return;
|
|
3285
3422
|
}
|
|
@@ -3291,7 +3428,7 @@ var useMonitor = (options) => {
|
|
|
3291
3428
|
initializeMonitoring(options);
|
|
3292
3429
|
}
|
|
3293
3430
|
}, [options]);
|
|
3294
|
-
return
|
|
3431
|
+
return React59.useMemo(() => getMonitor(), []);
|
|
3295
3432
|
};
|
|
3296
3433
|
function showSonner(message, type = "info", options) {
|
|
3297
3434
|
const { title, description, duration = 4e3, action } = options || {};
|
|
@@ -3571,7 +3708,7 @@ var ThemeProvider = ({
|
|
|
3571
3708
|
const horizontallyVisible = rect.left >= 0 && rect.right <= viewWidth;
|
|
3572
3709
|
return verticallyVisible && horizontallyVisible;
|
|
3573
3710
|
};
|
|
3574
|
-
const
|
|
3711
|
+
const scrollElementIntoView2 = (element) => {
|
|
3575
3712
|
window.setTimeout(() => {
|
|
3576
3713
|
if (!isElementInViewport(element)) {
|
|
3577
3714
|
element.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" });
|
|
@@ -3596,7 +3733,7 @@ var ThemeProvider = ({
|
|
|
3596
3733
|
if (!element) {
|
|
3597
3734
|
return;
|
|
3598
3735
|
}
|
|
3599
|
-
|
|
3736
|
+
scrollElementIntoView2(element);
|
|
3600
3737
|
};
|
|
3601
3738
|
const handlePointerDown = (event) => {
|
|
3602
3739
|
if (event.pointerType && event.pointerType !== "touch" && event.pointerType !== "pen") {
|
|
@@ -3606,7 +3743,7 @@ var ThemeProvider = ({
|
|
|
3606
3743
|
if (!element) {
|
|
3607
3744
|
return;
|
|
3608
3745
|
}
|
|
3609
|
-
|
|
3746
|
+
scrollElementIntoView2(element);
|
|
3610
3747
|
};
|
|
3611
3748
|
document.addEventListener("focusin", handleFocus, true);
|
|
3612
3749
|
document.addEventListener("pointerdown", handlePointerDown, true);
|
|
@@ -3686,26 +3823,9 @@ var useThemeExtras = () => {
|
|
|
3686
3823
|
const { extras } = useTheme();
|
|
3687
3824
|
return extras;
|
|
3688
3825
|
};
|
|
3689
|
-
var
|
|
3690
|
-
var scrollInputIntoView = (element) => {
|
|
3691
|
-
if (!element || typeof element.scrollIntoView !== "function") {
|
|
3692
|
-
return;
|
|
3693
|
-
}
|
|
3694
|
-
const prefersReducedMotion = isReducedMotionPreferred();
|
|
3695
|
-
const scroll = () => element.scrollIntoView({
|
|
3696
|
-
behavior: prefersReducedMotion ? "auto" : "smooth",
|
|
3697
|
-
block: "center",
|
|
3698
|
-
inline: "nearest"
|
|
3699
|
-
});
|
|
3700
|
-
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
3701
|
-
window.requestAnimationFrame(scroll);
|
|
3702
|
-
return;
|
|
3703
|
-
}
|
|
3704
|
-
scroll();
|
|
3705
|
-
};
|
|
3706
|
-
var Input = React58.forwardRef(
|
|
3826
|
+
var Input = React59.forwardRef(
|
|
3707
3827
|
({ className, type, onFocus, ...props }, forwardedRef) => {
|
|
3708
|
-
const setRefs =
|
|
3828
|
+
const setRefs = React59.useCallback(
|
|
3709
3829
|
(node) => {
|
|
3710
3830
|
if (typeof forwardedRef === "function") {
|
|
3711
3831
|
forwardedRef(node);
|
|
@@ -3715,13 +3835,13 @@ var Input = React58.forwardRef(
|
|
|
3715
3835
|
},
|
|
3716
3836
|
[forwardedRef]
|
|
3717
3837
|
);
|
|
3718
|
-
const handleFocus =
|
|
3838
|
+
const handleFocus = React59.useCallback(
|
|
3719
3839
|
(event) => {
|
|
3720
3840
|
onFocus == null ? void 0 : onFocus(event);
|
|
3721
3841
|
if (event.defaultPrevented) {
|
|
3722
3842
|
return;
|
|
3723
3843
|
}
|
|
3724
|
-
|
|
3844
|
+
maybeScrollElementIntoView(event.currentTarget);
|
|
3725
3845
|
},
|
|
3726
3846
|
[onFocus]
|
|
3727
3847
|
);
|
|
@@ -3786,7 +3906,7 @@ var toNumericValue = (value, decimals) => {
|
|
|
3786
3906
|
}
|
|
3787
3907
|
return parsed;
|
|
3788
3908
|
};
|
|
3789
|
-
var InputNumeric =
|
|
3909
|
+
var InputNumeric = React59.forwardRef(
|
|
3790
3910
|
({
|
|
3791
3911
|
value,
|
|
3792
3912
|
defaultValue,
|
|
@@ -3802,8 +3922,8 @@ var InputNumeric = React58.forwardRef(
|
|
|
3802
3922
|
pattern,
|
|
3803
3923
|
...rest
|
|
3804
3924
|
}, ref) => {
|
|
3805
|
-
const patternMatcher =
|
|
3806
|
-
const initialValue =
|
|
3925
|
+
const patternMatcher = React59.useMemo(() => createPattern(decimals), [decimals]);
|
|
3926
|
+
const initialValue = React59.useMemo(() => {
|
|
3807
3927
|
var _a2;
|
|
3808
3928
|
const source = (_a2 = value != null ? value : defaultValue) != null ? _a2 : null;
|
|
3809
3929
|
if (source === null) {
|
|
@@ -3811,16 +3931,16 @@ var InputNumeric = React58.forwardRef(
|
|
|
3811
3931
|
}
|
|
3812
3932
|
return toNumberString(source, decimals);
|
|
3813
3933
|
}, [value, defaultValue, decimals]);
|
|
3814
|
-
const [rawValue, setRawValue] =
|
|
3815
|
-
const [isFocused, setIsFocused] =
|
|
3816
|
-
|
|
3934
|
+
const [rawValue, setRawValue] = React59.useState(initialValue);
|
|
3935
|
+
const [isFocused, setIsFocused] = React59.useState(false);
|
|
3936
|
+
React59.useEffect(() => {
|
|
3817
3937
|
if (value === void 0) {
|
|
3818
3938
|
return;
|
|
3819
3939
|
}
|
|
3820
3940
|
const nextRawValue = value === null ? "" : toNumberString(value, decimals);
|
|
3821
3941
|
setRawValue((previous) => previous === nextRawValue ? previous : nextRawValue);
|
|
3822
3942
|
}, [value, decimals]);
|
|
3823
|
-
const clampValue =
|
|
3943
|
+
const clampValue = React59.useCallback(
|
|
3824
3944
|
(numericValue) => {
|
|
3825
3945
|
if (numericValue === null) {
|
|
3826
3946
|
return null;
|
|
@@ -3865,7 +3985,7 @@ var InputNumeric = React58.forwardRef(
|
|
|
3865
3985
|
}
|
|
3866
3986
|
onBlur == null ? void 0 : onBlur(event);
|
|
3867
3987
|
};
|
|
3868
|
-
const displayValue =
|
|
3988
|
+
const displayValue = React59.useMemo(() => {
|
|
3869
3989
|
if (isFocused) {
|
|
3870
3990
|
return rawValue;
|
|
3871
3991
|
}
|
|
@@ -3915,7 +4035,7 @@ var formatWithMask = (rawValue, mask, placeholderChar) => {
|
|
|
3915
4035
|
}
|
|
3916
4036
|
return result;
|
|
3917
4037
|
};
|
|
3918
|
-
var InputMask =
|
|
4038
|
+
var InputMask = React59.forwardRef(
|
|
3919
4039
|
({
|
|
3920
4040
|
mask,
|
|
3921
4041
|
placeholderChar = DEFAULT_PLACEHOLDER_CHAR,
|
|
@@ -3927,11 +4047,11 @@ var InputMask = React58.forwardRef(
|
|
|
3927
4047
|
}, ref) => {
|
|
3928
4048
|
var _a2;
|
|
3929
4049
|
const normalizedPlaceholder = (_a2 = placeholderChar[0]) != null ? _a2 : DEFAULT_PLACEHOLDER_CHAR;
|
|
3930
|
-
const placeholderCount =
|
|
4050
|
+
const placeholderCount = React59.useMemo(
|
|
3931
4051
|
() => countPlaceholders(mask, normalizedPlaceholder),
|
|
3932
4052
|
[mask, normalizedPlaceholder]
|
|
3933
4053
|
);
|
|
3934
|
-
const normalizeRawValue =
|
|
4054
|
+
const normalizeRawValue = React59.useCallback(
|
|
3935
4055
|
(source) => {
|
|
3936
4056
|
if (!source) {
|
|
3937
4057
|
return "";
|
|
@@ -3944,20 +4064,20 @@ var InputMask = React58.forwardRef(
|
|
|
3944
4064
|
},
|
|
3945
4065
|
[placeholderCount]
|
|
3946
4066
|
);
|
|
3947
|
-
const [rawValue, setRawValue] =
|
|
4067
|
+
const [rawValue, setRawValue] = React59.useState(
|
|
3948
4068
|
() => {
|
|
3949
4069
|
var _a3;
|
|
3950
4070
|
return normalizeRawValue((_a3 = value != null ? value : defaultValue) != null ? _a3 : "");
|
|
3951
4071
|
}
|
|
3952
4072
|
);
|
|
3953
|
-
|
|
4073
|
+
React59.useEffect(() => {
|
|
3954
4074
|
if (value === void 0) {
|
|
3955
4075
|
return;
|
|
3956
4076
|
}
|
|
3957
4077
|
const next = normalizeRawValue(value);
|
|
3958
4078
|
setRawValue((previous) => previous === next ? previous : next);
|
|
3959
4079
|
}, [value, normalizeRawValue]);
|
|
3960
|
-
|
|
4080
|
+
React59.useEffect(() => {
|
|
3961
4081
|
if (value !== void 0) {
|
|
3962
4082
|
return;
|
|
3963
4083
|
}
|
|
@@ -3970,7 +4090,7 @@ var InputMask = React58.forwardRef(
|
|
|
3970
4090
|
}
|
|
3971
4091
|
onChange == null ? void 0 : onChange(incoming);
|
|
3972
4092
|
};
|
|
3973
|
-
const formattedValue =
|
|
4093
|
+
const formattedValue = React59.useMemo(
|
|
3974
4094
|
() => formatWithMask(rawValue, mask, normalizedPlaceholder),
|
|
3975
4095
|
[mask, normalizedPlaceholder, rawValue]
|
|
3976
4096
|
);
|
|
@@ -4245,9 +4365,9 @@ var MobileWheelColumn = ({
|
|
|
4245
4365
|
onValueChange,
|
|
4246
4366
|
open
|
|
4247
4367
|
}) => {
|
|
4248
|
-
const listRef =
|
|
4249
|
-
const scrollTimeoutRef =
|
|
4250
|
-
const extendedOptions =
|
|
4368
|
+
const listRef = React59.useRef(null);
|
|
4369
|
+
const scrollTimeoutRef = React59.useRef(null);
|
|
4370
|
+
const extendedOptions = React59.useMemo(() => {
|
|
4251
4371
|
if (options.length === 0) {
|
|
4252
4372
|
return [];
|
|
4253
4373
|
}
|
|
@@ -4259,7 +4379,7 @@ var MobileWheelColumn = ({
|
|
|
4259
4379
|
}
|
|
4260
4380
|
return repeated;
|
|
4261
4381
|
}, [options]);
|
|
4262
|
-
const alignToValue =
|
|
4382
|
+
const alignToValue = React59.useCallback(
|
|
4263
4383
|
(value, behavior = "auto") => {
|
|
4264
4384
|
if (!listRef.current || options.length === 0 || extendedOptions.length === 0) {
|
|
4265
4385
|
return;
|
|
@@ -4273,13 +4393,13 @@ var MobileWheelColumn = ({
|
|
|
4273
4393
|
},
|
|
4274
4394
|
[extendedOptions.length, options]
|
|
4275
4395
|
);
|
|
4276
|
-
|
|
4396
|
+
React59.useLayoutEffect(() => {
|
|
4277
4397
|
if (!open) {
|
|
4278
4398
|
return;
|
|
4279
4399
|
}
|
|
4280
4400
|
alignToValue(selectedValue);
|
|
4281
4401
|
}, [alignToValue, open, options, selectedValue]);
|
|
4282
|
-
|
|
4402
|
+
React59.useEffect(
|
|
4283
4403
|
() => () => {
|
|
4284
4404
|
if (scrollTimeoutRef.current !== null) {
|
|
4285
4405
|
clearTimeout(scrollTimeoutRef.current);
|
|
@@ -4287,7 +4407,7 @@ var MobileWheelColumn = ({
|
|
|
4287
4407
|
},
|
|
4288
4408
|
[]
|
|
4289
4409
|
);
|
|
4290
|
-
const handleScroll2 =
|
|
4410
|
+
const handleScroll2 = React59.useCallback(
|
|
4291
4411
|
(event) => {
|
|
4292
4412
|
if (extendedOptions.length === 0 || options.length === 0) {
|
|
4293
4413
|
return;
|
|
@@ -4401,14 +4521,14 @@ var getDefaultLocale = (locale) => {
|
|
|
4401
4521
|
};
|
|
4402
4522
|
};
|
|
4403
4523
|
var useLatest = (value) => {
|
|
4404
|
-
const ref =
|
|
4405
|
-
|
|
4524
|
+
const ref = React59.useRef(value);
|
|
4525
|
+
React59.useEffect(() => {
|
|
4406
4526
|
ref.current = value;
|
|
4407
4527
|
}, [value]);
|
|
4408
4528
|
return ref;
|
|
4409
4529
|
};
|
|
4410
4530
|
var DEFAULT_PRIMARY_COLOR = "hsl(var(--primary))";
|
|
4411
|
-
var DatePicker =
|
|
4531
|
+
var DatePicker = React59.forwardRef((props, ref) => {
|
|
4412
4532
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
4413
4533
|
const {
|
|
4414
4534
|
value: valueProp,
|
|
@@ -4451,17 +4571,17 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
4451
4571
|
const { isNative } = useTheme();
|
|
4452
4572
|
const isMobile = useIsMobile();
|
|
4453
4573
|
const shouldUseDrawer = isNative || isMobile;
|
|
4454
|
-
const [associatedLabel, setAssociatedLabel] =
|
|
4455
|
-
const locale =
|
|
4574
|
+
const [associatedLabel, setAssociatedLabel] = React59.useState(null);
|
|
4575
|
+
const locale = React59.useMemo(() => getDefaultLocale(localeProp), [localeProp]);
|
|
4456
4576
|
const onChangeRef = useLatest(onChange);
|
|
4457
4577
|
const onOpenChangeRef = useLatest(onOpenChange);
|
|
4458
4578
|
const formatRef = useLatest(format);
|
|
4459
4579
|
const isValueControlled = valueProp !== void 0;
|
|
4460
|
-
const [internalValue, setInternalValue] =
|
|
4580
|
+
const [internalValue, setInternalValue] = React59.useState(defaultValue);
|
|
4461
4581
|
const selectedValue = (_a2 = isValueControlled ? valueProp : internalValue) != null ? _a2 : null;
|
|
4462
|
-
const initialPanelMode =
|
|
4463
|
-
const [panelMode, setPanelMode] =
|
|
4464
|
-
const commitValue =
|
|
4582
|
+
const initialPanelMode = React59.useMemo(() => getPanelModeFromProps(mode, picker), [mode, picker]);
|
|
4583
|
+
const [panelMode, setPanelMode] = React59.useState(initialPanelMode);
|
|
4584
|
+
const commitValue = React59.useCallback(
|
|
4465
4585
|
(next) => {
|
|
4466
4586
|
var _a3;
|
|
4467
4587
|
if (!isValueControlled) {
|
|
@@ -4471,18 +4591,18 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
4471
4591
|
},
|
|
4472
4592
|
[formatRef, isValueControlled, onChangeRef]
|
|
4473
4593
|
);
|
|
4474
|
-
const [draftValue, setDraftValue] =
|
|
4475
|
-
|
|
4594
|
+
const [draftValue, setDraftValue] = React59.useState(selectedValue);
|
|
4595
|
+
React59.useEffect(() => {
|
|
4476
4596
|
setDraftValue(selectedValue);
|
|
4477
4597
|
}, [selectedValue]);
|
|
4478
|
-
const [viewDate, setViewDate] =
|
|
4598
|
+
const [viewDate, setViewDate] = React59.useState(() => {
|
|
4479
4599
|
const base = selectedValue != null ? selectedValue : dayjs();
|
|
4480
4600
|
return clampToRange(base, minDate, maxDate);
|
|
4481
4601
|
});
|
|
4482
4602
|
const isOpenControlled = openProp !== void 0;
|
|
4483
|
-
const [internalOpen, setInternalOpen] =
|
|
4603
|
+
const [internalOpen, setInternalOpen] = React59.useState(Boolean(defaultOpen));
|
|
4484
4604
|
const open = isOpenControlled ? Boolean(openProp) : internalOpen;
|
|
4485
|
-
const setOpenState =
|
|
4605
|
+
const setOpenState = React59.useCallback(
|
|
4486
4606
|
(next) => {
|
|
4487
4607
|
var _a3;
|
|
4488
4608
|
if (!isOpenControlled) {
|
|
@@ -4493,25 +4613,25 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
4493
4613
|
[isOpenControlled, onOpenChangeRef]
|
|
4494
4614
|
);
|
|
4495
4615
|
const activeValue = needConfirm ? draftValue : selectedValue;
|
|
4496
|
-
|
|
4616
|
+
React59.useEffect(() => {
|
|
4497
4617
|
if (open) {
|
|
4498
4618
|
setPanelMode(initialPanelMode);
|
|
4499
4619
|
setViewDate((prev) => clampToRange(activeValue != null ? activeValue : prev, minDate, maxDate));
|
|
4500
4620
|
}
|
|
4501
4621
|
}, [activeValue, initialPanelMode, maxDate, minDate, open]);
|
|
4502
|
-
const [inputValue, setInputValue] =
|
|
4503
|
-
const isTypingRef =
|
|
4504
|
-
|
|
4622
|
+
const [inputValue, setInputValue] = React59.useState(() => formatDateValue(activeValue, formatRef.current));
|
|
4623
|
+
const isTypingRef = React59.useRef(false);
|
|
4624
|
+
React59.useEffect(() => {
|
|
4505
4625
|
if (!isTypingRef.current) {
|
|
4506
4626
|
setInputValue(formatDateValue(activeValue, formatRef.current));
|
|
4507
4627
|
}
|
|
4508
4628
|
}, [activeValue, formatRef]);
|
|
4509
|
-
const primaryColorStyle =
|
|
4629
|
+
const primaryColorStyle = React59.useMemo(
|
|
4510
4630
|
() => ({ "--date-primary-color": DEFAULT_PRIMARY_COLOR }),
|
|
4511
4631
|
[]
|
|
4512
4632
|
);
|
|
4513
|
-
const inputRef =
|
|
4514
|
-
const handleOpenChange =
|
|
4633
|
+
const inputRef = React59.useRef(null);
|
|
4634
|
+
const handleOpenChange = React59.useCallback(
|
|
4515
4635
|
(nextOpen) => {
|
|
4516
4636
|
if (disabled) {
|
|
4517
4637
|
return;
|
|
@@ -4524,11 +4644,11 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
4524
4644
|
},
|
|
4525
4645
|
[activeValue, disabled, initialPanelMode, maxDate, minDate, setOpenState]
|
|
4526
4646
|
);
|
|
4527
|
-
const parseInputValue =
|
|
4647
|
+
const parseInputValue = React59.useCallback(
|
|
4528
4648
|
(text) => parseDateValue(text, formatRef.current),
|
|
4529
4649
|
[formatRef]
|
|
4530
4650
|
);
|
|
4531
|
-
const isDateDisabled =
|
|
4651
|
+
const isDateDisabled = React59.useCallback(
|
|
4532
4652
|
(date, currentMode) => {
|
|
4533
4653
|
if (!isWithinRange(date, minDate, maxDate, currentMode)) {
|
|
4534
4654
|
return true;
|
|
@@ -4540,11 +4660,11 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
4540
4660
|
},
|
|
4541
4661
|
[disabledDate, maxDate, minDate]
|
|
4542
4662
|
);
|
|
4543
|
-
const formatForDisplay =
|
|
4663
|
+
const formatForDisplay = React59.useCallback(
|
|
4544
4664
|
(value) => formatDateValue(value, formatRef.current),
|
|
4545
4665
|
[formatRef]
|
|
4546
4666
|
);
|
|
4547
|
-
const handleDateSelect =
|
|
4667
|
+
const handleDateSelect = React59.useCallback(
|
|
4548
4668
|
(date) => {
|
|
4549
4669
|
if (isDateDisabled(date, "date")) {
|
|
4550
4670
|
return;
|
|
@@ -5018,7 +5138,7 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
5018
5138
|
] })
|
|
5019
5139
|
] });
|
|
5020
5140
|
const panelNode = panelRender ? panelRender(renderedPanel) : renderedPanel;
|
|
5021
|
-
|
|
5141
|
+
React59.useEffect(() => {
|
|
5022
5142
|
if (!autoFocus) {
|
|
5023
5143
|
return;
|
|
5024
5144
|
}
|
|
@@ -5032,7 +5152,7 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
5032
5152
|
focusInput();
|
|
5033
5153
|
}
|
|
5034
5154
|
}, [autoFocus]);
|
|
5035
|
-
|
|
5155
|
+
React59.useImperativeHandle(ref, () => inputRef.current);
|
|
5036
5156
|
const shouldShowPointer = !disabled && (inputReadOnly || shouldUseDrawer);
|
|
5037
5157
|
const triggerNode = /* @__PURE__ */ jsxs(
|
|
5038
5158
|
"div",
|
|
@@ -5099,17 +5219,17 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
5099
5219
|
]
|
|
5100
5220
|
}
|
|
5101
5221
|
);
|
|
5102
|
-
const mobileBaseValue =
|
|
5222
|
+
const mobileBaseValue = React59.useMemo(() => {
|
|
5103
5223
|
var _a3, _b2;
|
|
5104
5224
|
const base = (_b2 = needConfirm ? (_a3 = draftValue != null ? draftValue : selectedValue) != null ? _a3 : viewDate : activeValue != null ? activeValue : viewDate) != null ? _b2 : dayjs();
|
|
5105
5225
|
return base.clone();
|
|
5106
5226
|
}, [activeValue, draftValue, needConfirm, selectedValue, viewDate]);
|
|
5107
|
-
const monthOptions =
|
|
5227
|
+
const monthOptions = React59.useMemo(
|
|
5108
5228
|
() => locale.months.map((month, index2) => ({ label: month, value: index2 })),
|
|
5109
5229
|
[locale.months]
|
|
5110
5230
|
);
|
|
5111
5231
|
const daysInMonth = mobileBaseValue.daysInMonth();
|
|
5112
|
-
const dayOptions =
|
|
5232
|
+
const dayOptions = React59.useMemo(
|
|
5113
5233
|
() => Array.from({ length: daysInMonth }, (_, index2) => ({
|
|
5114
5234
|
label: String(index2 + 1).padStart(2, "0"),
|
|
5115
5235
|
value: index2 + 1
|
|
@@ -5121,14 +5241,14 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
5121
5241
|
const maxYear = (_e = maxDate == null ? void 0 : maxDate.year()) != null ? _e : currentYear + 100;
|
|
5122
5242
|
const startYear = Math.min(minYear, maxYear);
|
|
5123
5243
|
const endYear = Math.max(minYear, maxYear);
|
|
5124
|
-
const yearOptions =
|
|
5244
|
+
const yearOptions = React59.useMemo(
|
|
5125
5245
|
() => Array.from({ length: endYear - startYear + 1 }, (_, index2) => {
|
|
5126
5246
|
const year = startYear + index2;
|
|
5127
5247
|
return { label: String(year), value: year };
|
|
5128
5248
|
}),
|
|
5129
5249
|
[endYear, startYear]
|
|
5130
5250
|
);
|
|
5131
|
-
const handlePartChange =
|
|
5251
|
+
const handlePartChange = React59.useCallback(
|
|
5132
5252
|
(part, value) => {
|
|
5133
5253
|
var _a3, _b2;
|
|
5134
5254
|
const base = (_b2 = needConfirm ? (_a3 = draftValue != null ? draftValue : selectedValue) != null ? _a3 : viewDate : selectedValue != null ? selectedValue : viewDate) != null ? _b2 : dayjs();
|
|
@@ -5162,13 +5282,13 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
5162
5282
|
[commitValue, draftValue, formatForDisplay, isDateDisabled, maxDate, minDate, needConfirm, selectedValue, setViewDate, viewDate]
|
|
5163
5283
|
);
|
|
5164
5284
|
const mobileLabelFallback = (_g = (_f = typeof inputRest["aria-label"] === "string" ? inputRest["aria-label"] : void 0) != null ? _f : placeholder) != null ? _g : locale.placeholder;
|
|
5165
|
-
const handleDrawerOpenChange =
|
|
5285
|
+
const handleDrawerOpenChange = React59.useCallback(
|
|
5166
5286
|
(nextOpen) => {
|
|
5167
5287
|
handleOpenChange(nextOpen);
|
|
5168
5288
|
},
|
|
5169
5289
|
[handleOpenChange]
|
|
5170
5290
|
);
|
|
5171
|
-
|
|
5291
|
+
React59.useEffect(() => {
|
|
5172
5292
|
var _a3, _b2;
|
|
5173
5293
|
if (!shouldUseDrawer || !open || !id) {
|
|
5174
5294
|
return;
|
|
@@ -5677,7 +5797,7 @@ var gapClasses = {
|
|
|
5677
5797
|
middle: gapScale.md,
|
|
5678
5798
|
large: gapScale.lg
|
|
5679
5799
|
};
|
|
5680
|
-
var Flex =
|
|
5800
|
+
var Flex = React59.forwardRef(
|
|
5681
5801
|
({
|
|
5682
5802
|
direction,
|
|
5683
5803
|
vertical,
|
|
@@ -5782,7 +5902,7 @@ function InputOTPSlot({
|
|
|
5782
5902
|
...props
|
|
5783
5903
|
}) {
|
|
5784
5904
|
var _a2;
|
|
5785
|
-
const inputOTPContext =
|
|
5905
|
+
const inputOTPContext = React59.useContext(OTPInputContext);
|
|
5786
5906
|
const { char, hasFakeCaret, isActive } = (_a2 = inputOTPContext == null ? void 0 : inputOTPContext.slots[index2]) != null ? _a2 : {};
|
|
5787
5907
|
return /* @__PURE__ */ jsxs(
|
|
5788
5908
|
"div",
|
|
@@ -6138,7 +6258,7 @@ var mobileFooterVariants = Object.keys(
|
|
|
6138
6258
|
);
|
|
6139
6259
|
var noop = () => {
|
|
6140
6260
|
};
|
|
6141
|
-
var MobileFooter =
|
|
6261
|
+
var MobileFooter = React59.forwardRef(
|
|
6142
6262
|
({
|
|
6143
6263
|
items,
|
|
6144
6264
|
value,
|
|
@@ -6149,7 +6269,7 @@ var MobileFooter = React58.forwardRef(
|
|
|
6149
6269
|
forceLabels = false,
|
|
6150
6270
|
...props
|
|
6151
6271
|
}, ref) => {
|
|
6152
|
-
const [internalValue, setInternalValue] =
|
|
6272
|
+
const [internalValue, setInternalValue] = React59.useState(() => {
|
|
6153
6273
|
var _a2, _b;
|
|
6154
6274
|
if (value !== void 0) {
|
|
6155
6275
|
return value;
|
|
@@ -6161,7 +6281,7 @@ var MobileFooter = React58.forwardRef(
|
|
|
6161
6281
|
});
|
|
6162
6282
|
const isControlled = value !== void 0;
|
|
6163
6283
|
const selectedValue = isControlled ? value : internalValue;
|
|
6164
|
-
|
|
6284
|
+
React59.useEffect(() => {
|
|
6165
6285
|
var _a2;
|
|
6166
6286
|
if (!items.length) {
|
|
6167
6287
|
return;
|
|
@@ -6178,7 +6298,7 @@ var MobileFooter = React58.forwardRef(
|
|
|
6178
6298
|
onChange(fallback);
|
|
6179
6299
|
}
|
|
6180
6300
|
}, [items, selectedValue, isControlled, onChange]);
|
|
6181
|
-
const handleSelect =
|
|
6301
|
+
const handleSelect = React59.useCallback(
|
|
6182
6302
|
(nextValue) => {
|
|
6183
6303
|
if (nextValue === selectedValue) {
|
|
6184
6304
|
return;
|
|
@@ -6198,7 +6318,7 @@ var MobileFooter = React58.forwardRef(
|
|
|
6198
6318
|
0
|
|
6199
6319
|
);
|
|
6200
6320
|
const cellPercentage = 100 / items.length;
|
|
6201
|
-
const floatingIndicatorStyle =
|
|
6321
|
+
const floatingIndicatorStyle = React59.useMemo(() => {
|
|
6202
6322
|
const size4 = 72;
|
|
6203
6323
|
const offset4 = cellPercentage / 2;
|
|
6204
6324
|
return {
|
|
@@ -6207,18 +6327,18 @@ var MobileFooter = React58.forwardRef(
|
|
|
6207
6327
|
left: `calc(${cellPercentage}% * ${activeIndex} + ${offset4}% - ${size4 / 2}px)`
|
|
6208
6328
|
};
|
|
6209
6329
|
}, [activeIndex, cellPercentage]);
|
|
6210
|
-
const pillIndicatorStyle =
|
|
6330
|
+
const pillIndicatorStyle = React59.useMemo(() => ({
|
|
6211
6331
|
width: `calc((100% / ${items.length}) - 0.75rem)`,
|
|
6212
6332
|
left: `calc((100% / ${items.length}) * ${activeIndex} + 0.375rem)`
|
|
6213
6333
|
}), [activeIndex, items.length]);
|
|
6214
|
-
const minimalIndicatorStyle =
|
|
6334
|
+
const minimalIndicatorStyle = React59.useMemo(
|
|
6215
6335
|
() => ({
|
|
6216
6336
|
width: `calc((100% / ${items.length}) * 0.6)`,
|
|
6217
6337
|
left: `calc((100% / ${items.length}) * ${activeIndex} + (100% / ${items.length}) * 0.2)`
|
|
6218
6338
|
}),
|
|
6219
6339
|
[activeIndex, items.length]
|
|
6220
6340
|
);
|
|
6221
|
-
const curvedIndicatorStyle =
|
|
6341
|
+
const curvedIndicatorStyle = React59.useMemo(() => {
|
|
6222
6342
|
const size4 = 64;
|
|
6223
6343
|
const offset4 = cellPercentage / 2;
|
|
6224
6344
|
return {
|
|
@@ -6547,7 +6667,7 @@ var renderBadge = (badge, active = false) => {
|
|
|
6547
6667
|
}
|
|
6548
6668
|
);
|
|
6549
6669
|
};
|
|
6550
|
-
var MobileHeader =
|
|
6670
|
+
var MobileHeader = React59.forwardRef(
|
|
6551
6671
|
({
|
|
6552
6672
|
title,
|
|
6553
6673
|
subtitle,
|
|
@@ -6570,12 +6690,12 @@ var MobileHeader = React58.forwardRef(
|
|
|
6570
6690
|
children,
|
|
6571
6691
|
...props
|
|
6572
6692
|
}, ref) => {
|
|
6573
|
-
const [internalSearchValue, setInternalSearchValue] =
|
|
6693
|
+
const [internalSearchValue, setInternalSearchValue] = React59.useState(
|
|
6574
6694
|
() => defaultSearchValue != null ? defaultSearchValue : ""
|
|
6575
6695
|
);
|
|
6576
6696
|
const isSearchControlled = searchValue !== void 0;
|
|
6577
6697
|
const resolvedSearchValue = isSearchControlled ? searchValue : internalSearchValue;
|
|
6578
|
-
const handleSearchChange =
|
|
6698
|
+
const handleSearchChange = React59.useCallback(
|
|
6579
6699
|
(event) => {
|
|
6580
6700
|
const nextValue = event.target.value;
|
|
6581
6701
|
if (!isSearchControlled) {
|
|
@@ -6808,26 +6928,26 @@ function composeRefs(...refs) {
|
|
|
6808
6928
|
};
|
|
6809
6929
|
}
|
|
6810
6930
|
function useComposedRefs(...refs) {
|
|
6811
|
-
return
|
|
6931
|
+
return React59.useCallback(composeRefs(...refs), refs);
|
|
6812
6932
|
}
|
|
6813
6933
|
// @__NO_SIDE_EFFECTS__
|
|
6814
6934
|
function createSlot(ownerName) {
|
|
6815
6935
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
6816
|
-
const Slot22 =
|
|
6936
|
+
const Slot22 = React59.forwardRef((props, forwardedRef) => {
|
|
6817
6937
|
const { children, ...slotProps } = props;
|
|
6818
|
-
const childrenArray =
|
|
6938
|
+
const childrenArray = React59.Children.toArray(children);
|
|
6819
6939
|
const slottable = childrenArray.find(isSlottable);
|
|
6820
6940
|
if (slottable) {
|
|
6821
6941
|
const newElement = slottable.props.children;
|
|
6822
6942
|
const newChildren = childrenArray.map((child) => {
|
|
6823
6943
|
if (child === slottable) {
|
|
6824
|
-
if (
|
|
6825
|
-
return
|
|
6944
|
+
if (React59.Children.count(newElement) > 1) return React59.Children.only(null);
|
|
6945
|
+
return React59.isValidElement(newElement) ? newElement.props.children : null;
|
|
6826
6946
|
} else {
|
|
6827
6947
|
return child;
|
|
6828
6948
|
}
|
|
6829
6949
|
});
|
|
6830
|
-
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
6950
|
+
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children: React59.isValidElement(newElement) ? React59.cloneElement(newElement, void 0, newChildren) : null });
|
|
6831
6951
|
}
|
|
6832
6952
|
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
6833
6953
|
});
|
|
@@ -6837,24 +6957,24 @@ function createSlot(ownerName) {
|
|
|
6837
6957
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
6838
6958
|
// @__NO_SIDE_EFFECTS__
|
|
6839
6959
|
function createSlotClone(ownerName) {
|
|
6840
|
-
const SlotClone =
|
|
6960
|
+
const SlotClone = React59.forwardRef((props, forwardedRef) => {
|
|
6841
6961
|
const { children, ...slotProps } = props;
|
|
6842
|
-
if (
|
|
6962
|
+
if (React59.isValidElement(children)) {
|
|
6843
6963
|
const childrenRef = getElementRef(children);
|
|
6844
6964
|
const props2 = mergeProps(slotProps, children.props);
|
|
6845
|
-
if (children.type !==
|
|
6965
|
+
if (children.type !== React59.Fragment) {
|
|
6846
6966
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
6847
6967
|
}
|
|
6848
|
-
return
|
|
6968
|
+
return React59.cloneElement(children, props2);
|
|
6849
6969
|
}
|
|
6850
|
-
return
|
|
6970
|
+
return React59.Children.count(children) > 1 ? React59.Children.only(null) : null;
|
|
6851
6971
|
});
|
|
6852
6972
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
6853
6973
|
return SlotClone;
|
|
6854
6974
|
}
|
|
6855
6975
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
6856
6976
|
function isSlottable(child) {
|
|
6857
|
-
return
|
|
6977
|
+
return React59.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
6858
6978
|
}
|
|
6859
6979
|
function mergeProps(slotProps, childProps) {
|
|
6860
6980
|
const overrideProps = { ...childProps };
|
|
@@ -6898,7 +7018,7 @@ function getElementRef(element) {
|
|
|
6898
7018
|
// src/components/provider/safe-area.tsx
|
|
6899
7019
|
var defaultEdges = ["top", "right", "bottom", "left"];
|
|
6900
7020
|
var resolveInset = (edges, edge) => edges.includes(edge) ? `env(safe-area-inset-${edge})` : void 0;
|
|
6901
|
-
var SafeArea =
|
|
7021
|
+
var SafeArea = React59.forwardRef(
|
|
6902
7022
|
({
|
|
6903
7023
|
edges = defaultEdges,
|
|
6904
7024
|
asChild,
|
|
@@ -6937,21 +7057,21 @@ var MobileLayoutInner = ({
|
|
|
6937
7057
|
}) => {
|
|
6938
7058
|
var _a2, _b, _c, _d, _e;
|
|
6939
7059
|
const { header: headerState, navigateBack, canGoBack } = useMobileHeader();
|
|
6940
|
-
const headerEdges =
|
|
7060
|
+
const headerEdges = React59.useMemo(() => {
|
|
6941
7061
|
const edges = [];
|
|
6942
7062
|
if (safeArea.top) edges.push("top");
|
|
6943
7063
|
if (safeArea.left) edges.push("left");
|
|
6944
7064
|
if (safeArea.right) edges.push("right");
|
|
6945
7065
|
return edges;
|
|
6946
7066
|
}, [safeArea.top, safeArea.left, safeArea.right]);
|
|
6947
|
-
const footerEdges =
|
|
7067
|
+
const footerEdges = React59.useMemo(() => {
|
|
6948
7068
|
const edges = [];
|
|
6949
7069
|
if (safeArea.bottom) edges.push("bottom");
|
|
6950
7070
|
if (safeArea.left) edges.push("left");
|
|
6951
7071
|
if (safeArea.right) edges.push("right");
|
|
6952
7072
|
return edges;
|
|
6953
7073
|
}, [safeArea.bottom, safeArea.left, safeArea.right]);
|
|
6954
|
-
const handleBack =
|
|
7074
|
+
const handleBack = React59.useCallback(() => {
|
|
6955
7075
|
if (canGoBack) {
|
|
6956
7076
|
navigateBack();
|
|
6957
7077
|
return;
|
|
@@ -6961,7 +7081,7 @@ var MobileLayoutInner = ({
|
|
|
6961
7081
|
}
|
|
6962
7082
|
}, [canGoBack, navigateBack]);
|
|
6963
7083
|
const showBackButton = (_a2 = headerState.back) != null ? _a2 : canGoBack;
|
|
6964
|
-
const resolvedLeadingAction =
|
|
7084
|
+
const resolvedLeadingAction = React59.useMemo(() => {
|
|
6965
7085
|
if (showBackButton) {
|
|
6966
7086
|
return {
|
|
6967
7087
|
value: "mobile-header-back",
|
|
@@ -6982,7 +7102,7 @@ var MobileLayoutInner = ({
|
|
|
6982
7102
|
const headerVariant = (_d = (_c = (_b = headerState.variant) != null ? _b : variant) != null ? _c : type) != null ? _d : "hero";
|
|
6983
7103
|
const { show: showFooter = true, activeKey, onChange: footerOnChange, ...footerProps } = footer;
|
|
6984
7104
|
const footerValue = (_e = footerProps.value) != null ? _e : activeKey;
|
|
6985
|
-
const handleFooterSelect =
|
|
7105
|
+
const handleFooterSelect = React59.useCallback(
|
|
6986
7106
|
(value) => {
|
|
6987
7107
|
footerOnChange == null ? void 0 : footerOnChange(value);
|
|
6988
7108
|
},
|
|
@@ -7444,11 +7564,11 @@ function ScrollBar({
|
|
|
7444
7564
|
}
|
|
7445
7565
|
);
|
|
7446
7566
|
}
|
|
7447
|
-
var NativeSelectContext =
|
|
7567
|
+
var NativeSelectContext = React59.createContext(
|
|
7448
7568
|
void 0
|
|
7449
7569
|
);
|
|
7450
7570
|
function useNativeSelectContext() {
|
|
7451
|
-
const context =
|
|
7571
|
+
const context = React59.useContext(NativeSelectContext);
|
|
7452
7572
|
if (!context) {
|
|
7453
7573
|
throw new Error("useNativeSelectContext must be used within a Select component");
|
|
7454
7574
|
}
|
|
@@ -7464,16 +7584,16 @@ function SelectRoot({
|
|
|
7464
7584
|
const { isNative } = useTheme();
|
|
7465
7585
|
const isMobile = useIsMobile();
|
|
7466
7586
|
const shouldUseDrawer = isNative || isMobile;
|
|
7467
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
7587
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React59.useState(defaultOpen != null ? defaultOpen : false);
|
|
7468
7588
|
const open = openProp != null ? openProp : uncontrolledOpen;
|
|
7469
|
-
const setOpen =
|
|
7589
|
+
const setOpen = React59.useCallback(
|
|
7470
7590
|
(nextOpen) => {
|
|
7471
7591
|
if (openProp === void 0) setUncontrolledOpen(nextOpen);
|
|
7472
7592
|
onOpenChange == null ? void 0 : onOpenChange(nextOpen);
|
|
7473
7593
|
},
|
|
7474
7594
|
[openProp, onOpenChange]
|
|
7475
7595
|
);
|
|
7476
|
-
const contextValue =
|
|
7596
|
+
const contextValue = React59.useMemo(
|
|
7477
7597
|
() => ({
|
|
7478
7598
|
isNative: shouldUseDrawer,
|
|
7479
7599
|
open,
|
|
@@ -7567,7 +7687,7 @@ function SelectItem({
|
|
|
7567
7687
|
...props
|
|
7568
7688
|
}) {
|
|
7569
7689
|
const nativeContext = useNativeSelectContext();
|
|
7570
|
-
const handleSelect =
|
|
7690
|
+
const handleSelect = React59.useCallback(
|
|
7571
7691
|
(event) => {
|
|
7572
7692
|
onSelect == null ? void 0 : onSelect(event);
|
|
7573
7693
|
if (nativeContext.isNative && nativeContext.closeOnSelect && !event.defaultPrevented) {
|
|
@@ -7665,7 +7785,7 @@ function Select({
|
|
|
7665
7785
|
}
|
|
7666
7786
|
var noop3 = () => {
|
|
7667
7787
|
};
|
|
7668
|
-
var MultiSelectContext =
|
|
7788
|
+
var MultiSelectContext = React59.createContext({
|
|
7669
7789
|
isNative: false,
|
|
7670
7790
|
selectedValues: [],
|
|
7671
7791
|
setSelectedValues: noop3,
|
|
@@ -7675,7 +7795,7 @@ var MultiSelectContext = React58.createContext({
|
|
|
7675
7795
|
setOpen: noop3
|
|
7676
7796
|
});
|
|
7677
7797
|
function useMultiSelectContext() {
|
|
7678
|
-
return
|
|
7798
|
+
return React59.useContext(MultiSelectContext);
|
|
7679
7799
|
}
|
|
7680
7800
|
function MultiSelect({
|
|
7681
7801
|
value,
|
|
@@ -7689,23 +7809,23 @@ function MultiSelect({
|
|
|
7689
7809
|
const { isNative } = useTheme();
|
|
7690
7810
|
const isMobile = useIsMobile();
|
|
7691
7811
|
const shouldUseDrawer = isNative || isMobile;
|
|
7692
|
-
const [internalValue, setInternalValue] =
|
|
7693
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
7812
|
+
const [internalValue, setInternalValue] = React59.useState(defaultValue);
|
|
7813
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React59.useState(
|
|
7694
7814
|
defaultOpen != null ? defaultOpen : false
|
|
7695
7815
|
);
|
|
7696
|
-
|
|
7816
|
+
React59.useEffect(() => {
|
|
7697
7817
|
if (value !== void 0) {
|
|
7698
7818
|
setInternalValue(value);
|
|
7699
7819
|
}
|
|
7700
7820
|
}, [value]);
|
|
7701
|
-
|
|
7821
|
+
React59.useEffect(() => {
|
|
7702
7822
|
if (openProp !== void 0) {
|
|
7703
7823
|
setUncontrolledOpen(openProp);
|
|
7704
7824
|
}
|
|
7705
7825
|
}, [openProp]);
|
|
7706
7826
|
const selectedValues = value != null ? value : internalValue;
|
|
7707
7827
|
const open = openProp != null ? openProp : uncontrolledOpen;
|
|
7708
|
-
const setSelectedValues =
|
|
7828
|
+
const setSelectedValues = React59.useCallback(
|
|
7709
7829
|
(next) => {
|
|
7710
7830
|
const resolved = typeof next === "function" ? next(selectedValues) : next;
|
|
7711
7831
|
if (value === void 0) {
|
|
@@ -7715,7 +7835,7 @@ function MultiSelect({
|
|
|
7715
7835
|
},
|
|
7716
7836
|
[onValueChange, selectedValues, value]
|
|
7717
7837
|
);
|
|
7718
|
-
const toggleValue =
|
|
7838
|
+
const toggleValue = React59.useCallback(
|
|
7719
7839
|
(item) => {
|
|
7720
7840
|
setSelectedValues((prev) => {
|
|
7721
7841
|
if (prev.includes(item)) {
|
|
@@ -7726,11 +7846,11 @@ function MultiSelect({
|
|
|
7726
7846
|
},
|
|
7727
7847
|
[setSelectedValues]
|
|
7728
7848
|
);
|
|
7729
|
-
const isSelected =
|
|
7849
|
+
const isSelected = React59.useCallback(
|
|
7730
7850
|
(item) => selectedValues.includes(item),
|
|
7731
7851
|
[selectedValues]
|
|
7732
7852
|
);
|
|
7733
|
-
const setOpen =
|
|
7853
|
+
const setOpen = React59.useCallback(
|
|
7734
7854
|
(nextOpen) => {
|
|
7735
7855
|
if (openProp === void 0) {
|
|
7736
7856
|
setUncontrolledOpen(nextOpen);
|
|
@@ -7739,7 +7859,7 @@ function MultiSelect({
|
|
|
7739
7859
|
},
|
|
7740
7860
|
[onOpenChange, openProp]
|
|
7741
7861
|
);
|
|
7742
|
-
const contextValue =
|
|
7862
|
+
const contextValue = React59.useMemo(
|
|
7743
7863
|
() => ({
|
|
7744
7864
|
isNative: shouldUseDrawer,
|
|
7745
7865
|
selectedValues,
|
|
@@ -7770,7 +7890,7 @@ function MultiSelectTrigger({
|
|
|
7770
7890
|
...props
|
|
7771
7891
|
}) {
|
|
7772
7892
|
const context = useMultiSelectContext();
|
|
7773
|
-
const handleClick =
|
|
7893
|
+
const handleClick = React59.useCallback(
|
|
7774
7894
|
(event) => {
|
|
7775
7895
|
onClick == null ? void 0 : onClick(event);
|
|
7776
7896
|
if (context.isNative && !disabled) {
|
|
@@ -7813,7 +7933,7 @@ function MultiSelectValue({
|
|
|
7813
7933
|
formatValue
|
|
7814
7934
|
}) {
|
|
7815
7935
|
const { selectedValues, isNative } = useMultiSelectContext();
|
|
7816
|
-
const content =
|
|
7936
|
+
const content = React59.useMemo(() => {
|
|
7817
7937
|
if (formatValue) {
|
|
7818
7938
|
return formatValue(selectedValues);
|
|
7819
7939
|
}
|
|
@@ -8060,7 +8180,7 @@ function SheetDescription({
|
|
|
8060
8180
|
}
|
|
8061
8181
|
var skeletonBaseClass = "relative isolate overflow-hidden rounded-md bg-muted text-transparent";
|
|
8062
8182
|
var skeletonShimmerClass = "after:absolute after:inset-0 after:-translate-x-full after:animate-[shimmer_1.6s_linear_infinite] after:bg-gradient-to-r after:from-transparent after:via-foreground/10 after:to-transparent after:content-['']";
|
|
8063
|
-
var SkeletonRoot =
|
|
8183
|
+
var SkeletonRoot = React59.forwardRef(
|
|
8064
8184
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8065
8185
|
"div",
|
|
8066
8186
|
{
|
|
@@ -8072,7 +8192,7 @@ var SkeletonRoot = React58.forwardRef(
|
|
|
8072
8192
|
)
|
|
8073
8193
|
);
|
|
8074
8194
|
SkeletonRoot.displayName = "Skeleton";
|
|
8075
|
-
var SkeletonButton =
|
|
8195
|
+
var SkeletonButton = React59.forwardRef(
|
|
8076
8196
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8077
8197
|
SkeletonRoot,
|
|
8078
8198
|
{
|
|
@@ -8083,7 +8203,7 @@ var SkeletonButton = React58.forwardRef(
|
|
|
8083
8203
|
)
|
|
8084
8204
|
);
|
|
8085
8205
|
SkeletonButton.displayName = "Skeleton.Button";
|
|
8086
|
-
var SkeletonInput =
|
|
8206
|
+
var SkeletonInput = React59.forwardRef(
|
|
8087
8207
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8088
8208
|
SkeletonRoot,
|
|
8089
8209
|
{
|
|
@@ -8152,9 +8272,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
8152
8272
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
8153
8273
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
8154
8274
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
8155
|
-
var SidebarContext =
|
|
8275
|
+
var SidebarContext = React59.createContext(null);
|
|
8156
8276
|
function useSidebar() {
|
|
8157
|
-
const context =
|
|
8277
|
+
const context = React59.useContext(SidebarContext);
|
|
8158
8278
|
if (!context) {
|
|
8159
8279
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
8160
8280
|
}
|
|
@@ -8170,10 +8290,10 @@ function SidebarProvider({
|
|
|
8170
8290
|
...props
|
|
8171
8291
|
}) {
|
|
8172
8292
|
const isMobile = useIsMobile();
|
|
8173
|
-
const [openMobile, setOpenMobile] =
|
|
8174
|
-
const [_open, _setOpen] =
|
|
8293
|
+
const [openMobile, setOpenMobile] = React59.useState(false);
|
|
8294
|
+
const [_open, _setOpen] = React59.useState(defaultOpen);
|
|
8175
8295
|
const open = openProp != null ? openProp : _open;
|
|
8176
|
-
const setOpen =
|
|
8296
|
+
const setOpen = React59.useCallback(
|
|
8177
8297
|
(value) => {
|
|
8178
8298
|
const openState = typeof value === "function" ? value(open) : value;
|
|
8179
8299
|
if (setOpenProp) {
|
|
@@ -8185,10 +8305,10 @@ function SidebarProvider({
|
|
|
8185
8305
|
},
|
|
8186
8306
|
[setOpenProp, open]
|
|
8187
8307
|
);
|
|
8188
|
-
const toggleSidebar =
|
|
8308
|
+
const toggleSidebar = React59.useCallback(() => {
|
|
8189
8309
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
8190
8310
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
8191
|
-
|
|
8311
|
+
React59.useEffect(() => {
|
|
8192
8312
|
const handleKeyDown = (event) => {
|
|
8193
8313
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
8194
8314
|
event.preventDefault();
|
|
@@ -8199,7 +8319,7 @@ function SidebarProvider({
|
|
|
8199
8319
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
8200
8320
|
}, [toggleSidebar]);
|
|
8201
8321
|
const state = open ? "expanded" : "collapsed";
|
|
8202
|
-
const contextValue =
|
|
8322
|
+
const contextValue = React59.useMemo(
|
|
8203
8323
|
() => ({
|
|
8204
8324
|
state,
|
|
8205
8325
|
open,
|
|
@@ -8581,7 +8701,7 @@ function SidebarMenuButton({
|
|
|
8581
8701
|
}) {
|
|
8582
8702
|
const Comp = asChild ? Slot$1.Slot : "button";
|
|
8583
8703
|
const { isMobile, setOpenMobile, state } = useSidebar();
|
|
8584
|
-
const handleClick =
|
|
8704
|
+
const handleClick = React59.useCallback(
|
|
8585
8705
|
(event) => {
|
|
8586
8706
|
if (onClick) {
|
|
8587
8707
|
onClick(event);
|
|
@@ -8679,7 +8799,7 @@ function SidebarMenuSkeleton({
|
|
|
8679
8799
|
showIcon = false,
|
|
8680
8800
|
...props
|
|
8681
8801
|
}) {
|
|
8682
|
-
const width =
|
|
8802
|
+
const width = React59.useMemo(() => {
|
|
8683
8803
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
8684
8804
|
}, []);
|
|
8685
8805
|
return /* @__PURE__ */ jsxs(
|
|
@@ -8750,7 +8870,7 @@ function SidebarMenuSubButton({
|
|
|
8750
8870
|
}) {
|
|
8751
8871
|
const Comp = asChild ? Slot$1.Slot : "a";
|
|
8752
8872
|
const { isMobile, setOpenMobile } = useSidebar();
|
|
8753
|
-
const handleClick =
|
|
8873
|
+
const handleClick = React59.useCallback(
|
|
8754
8874
|
(event) => {
|
|
8755
8875
|
if (onClick) {
|
|
8756
8876
|
onClick(event);
|
|
@@ -8789,7 +8909,7 @@ function Slider({
|
|
|
8789
8909
|
max: max2 = 100,
|
|
8790
8910
|
...props
|
|
8791
8911
|
}) {
|
|
8792
|
-
const _values =
|
|
8912
|
+
const _values = React59.useMemo(
|
|
8793
8913
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min2, max2],
|
|
8794
8914
|
[value, defaultValue, min2, max2]
|
|
8795
8915
|
);
|
|
@@ -8861,7 +8981,7 @@ function Switch({
|
|
|
8861
8981
|
{
|
|
8862
8982
|
"data-slot": "switch",
|
|
8863
8983
|
className: cn(
|
|
8864
|
-
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-primary focus-visible:ring-primary/40 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
8984
|
+
"peer cursor-pointer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-primary focus-visible:ring-primary/40 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
8865
8985
|
className
|
|
8866
8986
|
),
|
|
8867
8987
|
...props,
|
|
@@ -8981,17 +9101,17 @@ function TableCaption({
|
|
|
8981
9101
|
}
|
|
8982
9102
|
);
|
|
8983
9103
|
}
|
|
8984
|
-
var TabsContext =
|
|
9104
|
+
var TabsContext = React59.createContext(null);
|
|
8985
9105
|
var useTabsContext = (component) => {
|
|
8986
|
-
const context =
|
|
9106
|
+
const context = React59.useContext(TabsContext);
|
|
8987
9107
|
if (!context) {
|
|
8988
9108
|
throw new Error(`${component} must be used within <Tabs>`);
|
|
8989
9109
|
}
|
|
8990
9110
|
return context;
|
|
8991
9111
|
};
|
|
8992
|
-
var TabsVariantContext =
|
|
9112
|
+
var TabsVariantContext = React59.createContext("default");
|
|
8993
9113
|
var useTabsVariant = (variant) => {
|
|
8994
|
-
const contextVariant =
|
|
9114
|
+
const contextVariant = React59.useContext(TabsVariantContext);
|
|
8995
9115
|
return variant != null ? variant : contextVariant;
|
|
8996
9116
|
};
|
|
8997
9117
|
var tabsListVariants = {
|
|
@@ -9034,7 +9154,7 @@ var mergeRefs = (...refs) => (node) => {
|
|
|
9034
9154
|
}
|
|
9035
9155
|
});
|
|
9036
9156
|
};
|
|
9037
|
-
var Tabs =
|
|
9157
|
+
var Tabs = React59.forwardRef(
|
|
9038
9158
|
({
|
|
9039
9159
|
className,
|
|
9040
9160
|
children,
|
|
@@ -9046,14 +9166,14 @@ var Tabs = React58.forwardRef(
|
|
|
9046
9166
|
...props
|
|
9047
9167
|
}, ref) => {
|
|
9048
9168
|
var _a2;
|
|
9049
|
-
const id =
|
|
9169
|
+
const id = React59.useId();
|
|
9050
9170
|
const isControlled = valueProp !== void 0;
|
|
9051
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
9171
|
+
const [uncontrolledValue, setUncontrolledValue] = React59.useState(
|
|
9052
9172
|
() => defaultValue != null ? defaultValue : null
|
|
9053
9173
|
);
|
|
9054
9174
|
const value = (_a2 = isControlled ? valueProp : uncontrolledValue) != null ? _a2 : null;
|
|
9055
|
-
const triggersRef =
|
|
9056
|
-
const setValue =
|
|
9175
|
+
const triggersRef = React59.useRef(/* @__PURE__ */ new Map());
|
|
9176
|
+
const setValue = React59.useCallback(
|
|
9057
9177
|
(nextValue) => {
|
|
9058
9178
|
if (!isControlled) {
|
|
9059
9179
|
setUncontrolledValue(nextValue);
|
|
@@ -9062,7 +9182,7 @@ var Tabs = React58.forwardRef(
|
|
|
9062
9182
|
},
|
|
9063
9183
|
[isControlled, onValueChange]
|
|
9064
9184
|
);
|
|
9065
|
-
const registerTrigger =
|
|
9185
|
+
const registerTrigger = React59.useCallback(
|
|
9066
9186
|
(triggerValue, node) => {
|
|
9067
9187
|
if (node) {
|
|
9068
9188
|
const wasEmpty = triggersRef.current.size === 0;
|
|
@@ -9076,7 +9196,7 @@ var Tabs = React58.forwardRef(
|
|
|
9076
9196
|
},
|
|
9077
9197
|
[defaultValue, isControlled, setUncontrolledValue, value]
|
|
9078
9198
|
);
|
|
9079
|
-
const getTriggerNode =
|
|
9199
|
+
const getTriggerNode = React59.useCallback(
|
|
9080
9200
|
(triggerValue) => {
|
|
9081
9201
|
var _a3;
|
|
9082
9202
|
if (!triggerValue) {
|
|
@@ -9086,7 +9206,7 @@ var Tabs = React58.forwardRef(
|
|
|
9086
9206
|
},
|
|
9087
9207
|
[]
|
|
9088
9208
|
);
|
|
9089
|
-
const focusTriggerByIndex =
|
|
9209
|
+
const focusTriggerByIndex = React59.useCallback(
|
|
9090
9210
|
(index2) => {
|
|
9091
9211
|
const values = Array.from(triggersRef.current.keys());
|
|
9092
9212
|
if (!values.length) {
|
|
@@ -9102,7 +9222,7 @@ var Tabs = React58.forwardRef(
|
|
|
9102
9222
|
},
|
|
9103
9223
|
[activationMode, setValue]
|
|
9104
9224
|
);
|
|
9105
|
-
const focusNextTrigger =
|
|
9225
|
+
const focusNextTrigger = React59.useCallback(
|
|
9106
9226
|
(currentValue, direction) => {
|
|
9107
9227
|
const values = Array.from(triggersRef.current.keys());
|
|
9108
9228
|
const currentIndex = values.indexOf(currentValue);
|
|
@@ -9113,7 +9233,7 @@ var Tabs = React58.forwardRef(
|
|
|
9113
9233
|
},
|
|
9114
9234
|
[focusTriggerByIndex]
|
|
9115
9235
|
);
|
|
9116
|
-
const focusEdgeTrigger =
|
|
9236
|
+
const focusEdgeTrigger = React59.useCallback(
|
|
9117
9237
|
(edge) => {
|
|
9118
9238
|
const values = Array.from(triggersRef.current.keys());
|
|
9119
9239
|
if (!values.length) {
|
|
@@ -9123,16 +9243,16 @@ var Tabs = React58.forwardRef(
|
|
|
9123
9243
|
},
|
|
9124
9244
|
[focusTriggerByIndex]
|
|
9125
9245
|
);
|
|
9126
|
-
const [orientation, setOrientationState] =
|
|
9127
|
-
const setOrientation =
|
|
9246
|
+
const [orientation, setOrientationState] = React59.useState("horizontal");
|
|
9247
|
+
const setOrientation = React59.useCallback((nextOrientation) => {
|
|
9128
9248
|
setOrientationState(nextOrientation);
|
|
9129
9249
|
}, []);
|
|
9130
|
-
|
|
9250
|
+
React59.useEffect(() => {
|
|
9131
9251
|
if (!isControlled && value == null && defaultValue) {
|
|
9132
9252
|
setUncontrolledValue(defaultValue);
|
|
9133
9253
|
}
|
|
9134
9254
|
}, [defaultValue, isControlled, setUncontrolledValue, value]);
|
|
9135
|
-
const contextValue =
|
|
9255
|
+
const contextValue = React59.useMemo(
|
|
9136
9256
|
() => ({
|
|
9137
9257
|
id,
|
|
9138
9258
|
value,
|
|
@@ -9161,15 +9281,15 @@ var Tabs = React58.forwardRef(
|
|
|
9161
9281
|
}
|
|
9162
9282
|
);
|
|
9163
9283
|
Tabs.displayName = "Tabs";
|
|
9164
|
-
var TabsList =
|
|
9284
|
+
var TabsList = React59.forwardRef(
|
|
9165
9285
|
({ className, variant, orientation = "horizontal", ...props }, ref) => {
|
|
9166
9286
|
const { value: activeValue, setOrientation, getTriggerNode } = useTabsContext("TabsList");
|
|
9167
9287
|
const activeVariant = useTabsVariant(variant);
|
|
9168
9288
|
const highlightClass = tabsListHighlightVariants[activeVariant];
|
|
9169
|
-
const localRef =
|
|
9170
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
9289
|
+
const localRef = React59.useRef(null);
|
|
9290
|
+
const [indicatorStyle, setIndicatorStyle] = React59.useState(null);
|
|
9171
9291
|
const highlightEnabled = highlightableVariants.has(activeVariant);
|
|
9172
|
-
const updateIndicator =
|
|
9292
|
+
const updateIndicator = React59.useCallback(() => {
|
|
9173
9293
|
if (!highlightEnabled) {
|
|
9174
9294
|
setIndicatorStyle(null);
|
|
9175
9295
|
return;
|
|
@@ -9205,13 +9325,13 @@ var TabsList = React58.forwardRef(
|
|
|
9205
9325
|
transform: `translate3d(${offsetLeft}px, ${offsetTop}px, 0)`
|
|
9206
9326
|
});
|
|
9207
9327
|
}, [activeValue, getTriggerNode, highlightEnabled]);
|
|
9208
|
-
|
|
9328
|
+
React59.useEffect(() => {
|
|
9209
9329
|
setOrientation(orientation);
|
|
9210
9330
|
}, [orientation, setOrientation]);
|
|
9211
|
-
|
|
9331
|
+
React59.useLayoutEffect(() => {
|
|
9212
9332
|
updateIndicator();
|
|
9213
9333
|
}, [updateIndicator]);
|
|
9214
|
-
|
|
9334
|
+
React59.useEffect(() => {
|
|
9215
9335
|
if (!highlightEnabled || typeof ResizeObserver === "undefined") {
|
|
9216
9336
|
return;
|
|
9217
9337
|
}
|
|
@@ -9231,7 +9351,7 @@ var TabsList = React58.forwardRef(
|
|
|
9231
9351
|
observer.disconnect();
|
|
9232
9352
|
};
|
|
9233
9353
|
}, [activeValue, getTriggerNode, highlightEnabled, updateIndicator]);
|
|
9234
|
-
|
|
9354
|
+
React59.useEffect(() => {
|
|
9235
9355
|
if (!highlightEnabled || typeof MutationObserver === "undefined") {
|
|
9236
9356
|
return;
|
|
9237
9357
|
}
|
|
@@ -9247,7 +9367,7 @@ var TabsList = React58.forwardRef(
|
|
|
9247
9367
|
observer.disconnect();
|
|
9248
9368
|
};
|
|
9249
9369
|
}, [highlightEnabled, updateIndicator]);
|
|
9250
|
-
|
|
9370
|
+
React59.useEffect(() => {
|
|
9251
9371
|
if (!highlightEnabled) {
|
|
9252
9372
|
return;
|
|
9253
9373
|
}
|
|
@@ -9287,7 +9407,7 @@ var TabsList = React58.forwardRef(
|
|
|
9287
9407
|
}
|
|
9288
9408
|
);
|
|
9289
9409
|
TabsList.displayName = "TabsList";
|
|
9290
|
-
var TabsTrigger =
|
|
9410
|
+
var TabsTrigger = React59.forwardRef(
|
|
9291
9411
|
({ className, variant, value, disabled, onClick, onKeyDown, ...props }, forwardedRef) => {
|
|
9292
9412
|
const {
|
|
9293
9413
|
id,
|
|
@@ -9299,11 +9419,11 @@ var TabsTrigger = React58.forwardRef(
|
|
|
9299
9419
|
orientation
|
|
9300
9420
|
} = useTabsContext("TabsTrigger");
|
|
9301
9421
|
const activeVariant = useTabsVariant(variant);
|
|
9302
|
-
const localRef =
|
|
9422
|
+
const localRef = React59.useRef(null);
|
|
9303
9423
|
const isActive = activeValue === value;
|
|
9304
9424
|
const triggerId = `${id}-trigger-${value}`;
|
|
9305
9425
|
const contentId = `${id}-content-${value}`;
|
|
9306
|
-
|
|
9426
|
+
React59.useEffect(() => {
|
|
9307
9427
|
registerTrigger(value, localRef.current);
|
|
9308
9428
|
return () => registerTrigger(value, null);
|
|
9309
9429
|
}, [registerTrigger, value]);
|
|
@@ -9378,7 +9498,7 @@ var TabsTrigger = React58.forwardRef(
|
|
|
9378
9498
|
}
|
|
9379
9499
|
);
|
|
9380
9500
|
TabsTrigger.displayName = "TabsTrigger";
|
|
9381
|
-
var TabsContent =
|
|
9501
|
+
var TabsContent = React59.forwardRef(
|
|
9382
9502
|
({ className, variant, value, ...props }, ref) => {
|
|
9383
9503
|
const { id, value: activeValue } = useTabsContext("TabsContent");
|
|
9384
9504
|
const activeVariant = useTabsVariant(variant);
|
|
@@ -9405,21 +9525,44 @@ var TabsContent = React58.forwardRef(
|
|
|
9405
9525
|
}
|
|
9406
9526
|
);
|
|
9407
9527
|
TabsContent.displayName = "TabsContent";
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9528
|
+
var Textarea = React59.forwardRef(
|
|
9529
|
+
({ className, onFocus, ...props }, forwardedRef) => {
|
|
9530
|
+
const setRefs = React59.useCallback(
|
|
9531
|
+
(node) => {
|
|
9532
|
+
if (typeof forwardedRef === "function") {
|
|
9533
|
+
forwardedRef(node);
|
|
9534
|
+
} else if (forwardedRef) {
|
|
9535
|
+
forwardedRef.current = node;
|
|
9536
|
+
}
|
|
9537
|
+
},
|
|
9538
|
+
[forwardedRef]
|
|
9539
|
+
);
|
|
9540
|
+
const handleFocus = React59.useCallback(
|
|
9541
|
+
(event) => {
|
|
9542
|
+
onFocus == null ? void 0 : onFocus(event);
|
|
9543
|
+
if (event.defaultPrevented) {
|
|
9544
|
+
return;
|
|
9545
|
+
}
|
|
9546
|
+
maybeScrollElementIntoView(event.currentTarget);
|
|
9547
|
+
},
|
|
9548
|
+
[onFocus]
|
|
9549
|
+
);
|
|
9550
|
+
return /* @__PURE__ */ jsx(
|
|
9551
|
+
"textarea",
|
|
9552
|
+
{
|
|
9553
|
+
ref: setRefs,
|
|
9554
|
+
"data-slot": "textarea",
|
|
9555
|
+
onFocus: handleFocus,
|
|
9556
|
+
className: cn(
|
|
9557
|
+
"border-input placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-primary/40 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
9558
|
+
className
|
|
9559
|
+
),
|
|
9560
|
+
...props
|
|
9561
|
+
}
|
|
9562
|
+
);
|
|
9563
|
+
}
|
|
9564
|
+
);
|
|
9565
|
+
Textarea.displayName = "Textarea";
|
|
9423
9566
|
var toggleVariants = cva(
|
|
9424
9567
|
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-primary focus-visible:ring-primary/40 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
9425
9568
|
{
|
|
@@ -9455,7 +9598,7 @@ function Toggle({
|
|
|
9455
9598
|
}
|
|
9456
9599
|
);
|
|
9457
9600
|
}
|
|
9458
|
-
var ToggleGroupContext =
|
|
9601
|
+
var ToggleGroupContext = React59.createContext({
|
|
9459
9602
|
size: "default",
|
|
9460
9603
|
variant: "default"
|
|
9461
9604
|
});
|
|
@@ -9488,7 +9631,7 @@ function ToggleGroupItem({
|
|
|
9488
9631
|
size: size4,
|
|
9489
9632
|
...props
|
|
9490
9633
|
}) {
|
|
9491
|
-
const context =
|
|
9634
|
+
const context = React59.useContext(ToggleGroupContext);
|
|
9492
9635
|
return /* @__PURE__ */ jsx(
|
|
9493
9636
|
ToggleGroup$1.Item,
|
|
9494
9637
|
{
|
|
@@ -9632,9 +9775,9 @@ function MobileWheelColumn2({
|
|
|
9632
9775
|
onValueChange,
|
|
9633
9776
|
open
|
|
9634
9777
|
}) {
|
|
9635
|
-
const listRef =
|
|
9636
|
-
const scrollTimeoutRef =
|
|
9637
|
-
const extendedOptions =
|
|
9778
|
+
const listRef = React59.useRef(null);
|
|
9779
|
+
const scrollTimeoutRef = React59.useRef(null);
|
|
9780
|
+
const extendedOptions = React59.useMemo(() => {
|
|
9638
9781
|
if (options.length === 0) {
|
|
9639
9782
|
return [];
|
|
9640
9783
|
}
|
|
@@ -9646,7 +9789,7 @@ function MobileWheelColumn2({
|
|
|
9646
9789
|
}
|
|
9647
9790
|
return repeated;
|
|
9648
9791
|
}, [options]);
|
|
9649
|
-
const alignToValue =
|
|
9792
|
+
const alignToValue = React59.useCallback(
|
|
9650
9793
|
(value, behavior = "auto") => {
|
|
9651
9794
|
if (!listRef.current || options.length === 0 || extendedOptions.length === 0) {
|
|
9652
9795
|
return;
|
|
@@ -9660,18 +9803,18 @@ function MobileWheelColumn2({
|
|
|
9660
9803
|
},
|
|
9661
9804
|
[extendedOptions.length, options]
|
|
9662
9805
|
);
|
|
9663
|
-
|
|
9806
|
+
React59.useLayoutEffect(() => {
|
|
9664
9807
|
if (!open) {
|
|
9665
9808
|
return;
|
|
9666
9809
|
}
|
|
9667
9810
|
alignToValue(selectedValue);
|
|
9668
9811
|
}, [alignToValue, open, options, selectedValue]);
|
|
9669
|
-
|
|
9812
|
+
React59.useEffect(() => () => {
|
|
9670
9813
|
if (scrollTimeoutRef.current !== null) {
|
|
9671
9814
|
clearTimeout(scrollTimeoutRef.current);
|
|
9672
9815
|
}
|
|
9673
9816
|
}, []);
|
|
9674
|
-
const handleScroll2 =
|
|
9817
|
+
const handleScroll2 = React59.useCallback(
|
|
9675
9818
|
(event) => {
|
|
9676
9819
|
if (extendedOptions.length === 0 || options.length === 0) {
|
|
9677
9820
|
return;
|
|
@@ -9760,7 +9903,7 @@ var MeridiemColumn = ({ value, onChange }) => /* @__PURE__ */ jsxs("div", { clas
|
|
|
9760
9903
|
);
|
|
9761
9904
|
}) })
|
|
9762
9905
|
] });
|
|
9763
|
-
var TimePicker =
|
|
9906
|
+
var TimePicker = React59.forwardRef((props, ref) => {
|
|
9764
9907
|
var _a2, _b, _c, _d;
|
|
9765
9908
|
const {
|
|
9766
9909
|
value: valueProp,
|
|
@@ -9802,21 +9945,21 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9802
9945
|
const isMobile = useIsMobile();
|
|
9803
9946
|
const shouldUseDrawer = isNative || isMobile;
|
|
9804
9947
|
const isControlled = valueProp !== void 0;
|
|
9805
|
-
const [internalValue, setInternalValue] =
|
|
9948
|
+
const [internalValue, setInternalValue] = React59.useState(defaultValue);
|
|
9806
9949
|
const currentValue = (_a2 = isControlled ? valueProp : internalValue) != null ? _a2 : null;
|
|
9807
|
-
const parsedValue =
|
|
9808
|
-
const resolvedMeridiem =
|
|
9950
|
+
const parsedValue = React59.useMemo(() => parseTimeString(currentValue), [currentValue]);
|
|
9951
|
+
const resolvedMeridiem = React59.useMemo(
|
|
9809
9952
|
() => {
|
|
9810
9953
|
var _a3;
|
|
9811
9954
|
return ((_a3 = parsedValue == null ? void 0 : parsedValue.hour) != null ? _a3 : 0) >= 12 ? "PM" : "AM";
|
|
9812
9955
|
},
|
|
9813
9956
|
[parsedValue == null ? void 0 : parsedValue.hour]
|
|
9814
9957
|
);
|
|
9815
|
-
const [meridiem, setMeridiem] =
|
|
9816
|
-
|
|
9958
|
+
const [meridiem, setMeridiem] = React59.useState(resolvedMeridiem);
|
|
9959
|
+
React59.useEffect(() => {
|
|
9817
9960
|
setMeridiem(resolvedMeridiem);
|
|
9818
9961
|
}, [resolvedMeridiem]);
|
|
9819
|
-
const inferredShowSeconds =
|
|
9962
|
+
const inferredShowSeconds = React59.useMemo(() => {
|
|
9820
9963
|
if (typeof showSecondsProp === "boolean") {
|
|
9821
9964
|
return showSecondsProp;
|
|
9822
9965
|
}
|
|
@@ -9825,12 +9968,12 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9825
9968
|
}
|
|
9826
9969
|
return Boolean(currentValue && currentValue.split(":").length === 3);
|
|
9827
9970
|
}, [currentValue, format, showSecondsProp]);
|
|
9828
|
-
const defaultFormat =
|
|
9971
|
+
const defaultFormat = React59.useMemo(
|
|
9829
9972
|
() => use12Hours ? inferredShowSeconds ? "hh:mm:ss A" : "hh:mm A" : inferredShowSeconds ? "HH:mm:ss" : "HH:mm",
|
|
9830
9973
|
[inferredShowSeconds, use12Hours]
|
|
9831
9974
|
);
|
|
9832
9975
|
const resolvedFormat = typeof format === "string" ? format : defaultFormat;
|
|
9833
|
-
const formatValue =
|
|
9976
|
+
const formatValue = React59.useCallback(
|
|
9834
9977
|
(value) => {
|
|
9835
9978
|
if (!value) {
|
|
9836
9979
|
return "";
|
|
@@ -9842,21 +9985,21 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9842
9985
|
},
|
|
9843
9986
|
[format, resolvedFormat]
|
|
9844
9987
|
);
|
|
9845
|
-
const [inputValue, setInputValue] =
|
|
9846
|
-
|
|
9988
|
+
const [inputValue, setInputValue] = React59.useState(() => formatValue(parsedValue));
|
|
9989
|
+
React59.useEffect(() => {
|
|
9847
9990
|
setInputValue(formatValue(parsedValue));
|
|
9848
9991
|
}, [formatValue, parsedValue]);
|
|
9849
9992
|
const allowClearConfig = typeof allowClear === "object" && allowClear !== null && !Array.isArray(allowClear) ? allowClear : void 0;
|
|
9850
9993
|
const clearIcon = (_b = allowClearConfig == null ? void 0 : allowClearConfig.clearIcon) != null ? _b : /* @__PURE__ */ jsx(X, { className: "h-4 w-4", strokeWidth: 2 });
|
|
9851
9994
|
const showClear = Boolean(allowClear) && !disabled && Boolean(currentValue);
|
|
9852
|
-
const primaryColorStyle =
|
|
9995
|
+
const primaryColorStyle = React59.useMemo(
|
|
9853
9996
|
() => ({ "--date-primary-color": DEFAULT_PRIMARY_COLOR2 }),
|
|
9854
9997
|
[]
|
|
9855
9998
|
);
|
|
9856
9999
|
const isOpenControlled = openProp !== void 0;
|
|
9857
|
-
const [internalOpen, setInternalOpen] =
|
|
10000
|
+
const [internalOpen, setInternalOpen] = React59.useState(Boolean(defaultOpen));
|
|
9858
10001
|
const open = isOpenControlled ? Boolean(openProp) : internalOpen;
|
|
9859
|
-
const handleOpenChange =
|
|
10002
|
+
const handleOpenChange = React59.useCallback(
|
|
9860
10003
|
(nextOpen) => {
|
|
9861
10004
|
if (disabled) {
|
|
9862
10005
|
return;
|
|
@@ -9868,7 +10011,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9868
10011
|
},
|
|
9869
10012
|
[disabled, isOpenControlled, onOpenChange]
|
|
9870
10013
|
);
|
|
9871
|
-
const commitValue =
|
|
10014
|
+
const commitValue = React59.useCallback(
|
|
9872
10015
|
(next) => {
|
|
9873
10016
|
if (!next) {
|
|
9874
10017
|
if (!isControlled) {
|
|
@@ -9892,7 +10035,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9892
10035
|
const safeHourStep = Math.max(1, Math.floor(hourStep));
|
|
9893
10036
|
const safeMinuteStep = Math.max(1, Math.floor(minuteStep));
|
|
9894
10037
|
const safeSecondStep = Math.max(1, Math.floor(secondStep));
|
|
9895
|
-
const hourOptions =
|
|
10038
|
+
const hourOptions = React59.useMemo(() => {
|
|
9896
10039
|
if (use12Hours) {
|
|
9897
10040
|
const values = [];
|
|
9898
10041
|
for (let hour = 1; hour <= 12; hour += safeHourStep) {
|
|
@@ -9910,14 +10053,14 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9910
10053
|
}
|
|
9911
10054
|
return result;
|
|
9912
10055
|
}, [safeHourStep, use12Hours]);
|
|
9913
|
-
const minuteOptions =
|
|
10056
|
+
const minuteOptions = React59.useMemo(() => {
|
|
9914
10057
|
const result = [];
|
|
9915
10058
|
for (let minute = 0; minute < 60; minute += safeMinuteStep) {
|
|
9916
10059
|
result.push({ label: pad(minute), value: minute });
|
|
9917
10060
|
}
|
|
9918
10061
|
return result;
|
|
9919
10062
|
}, [safeMinuteStep]);
|
|
9920
|
-
const secondOptions =
|
|
10063
|
+
const secondOptions = React59.useMemo(() => {
|
|
9921
10064
|
if (!inferredShowSeconds) {
|
|
9922
10065
|
return [];
|
|
9923
10066
|
}
|
|
@@ -9927,7 +10070,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9927
10070
|
}
|
|
9928
10071
|
return result;
|
|
9929
10072
|
}, [inferredShowSeconds, safeSecondStep]);
|
|
9930
|
-
const resolvedHourValue =
|
|
10073
|
+
const resolvedHourValue = React59.useMemo(() => {
|
|
9931
10074
|
if (!parsedValue) {
|
|
9932
10075
|
return use12Hours ? 12 : 0;
|
|
9933
10076
|
}
|
|
@@ -9935,7 +10078,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9935
10078
|
}, [parsedValue, use12Hours]);
|
|
9936
10079
|
const resolvedMinuteValue = (_c = parsedValue == null ? void 0 : parsedValue.minute) != null ? _c : 0;
|
|
9937
10080
|
const resolvedSecondValue = (_d = parsedValue == null ? void 0 : parsedValue.second) != null ? _d : 0;
|
|
9938
|
-
const handleHourSelect =
|
|
10081
|
+
const handleHourSelect = React59.useCallback(
|
|
9939
10082
|
(value) => {
|
|
9940
10083
|
if (use12Hours) {
|
|
9941
10084
|
const hour24 = convert12To24(value, meridiem);
|
|
@@ -9946,19 +10089,19 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9946
10089
|
},
|
|
9947
10090
|
[baseValue, commitValue, meridiem, use12Hours]
|
|
9948
10091
|
);
|
|
9949
|
-
const handleMinuteSelect =
|
|
10092
|
+
const handleMinuteSelect = React59.useCallback(
|
|
9950
10093
|
(value) => {
|
|
9951
10094
|
commitValue({ ...baseValue, minute: value });
|
|
9952
10095
|
},
|
|
9953
10096
|
[baseValue, commitValue]
|
|
9954
10097
|
);
|
|
9955
|
-
const handleSecondSelect =
|
|
10098
|
+
const handleSecondSelect = React59.useCallback(
|
|
9956
10099
|
(value) => {
|
|
9957
10100
|
commitValue({ ...baseValue, second: value });
|
|
9958
10101
|
},
|
|
9959
10102
|
[baseValue, commitValue]
|
|
9960
10103
|
);
|
|
9961
|
-
const handleMeridiemChange =
|
|
10104
|
+
const handleMeridiemChange = React59.useCallback(
|
|
9962
10105
|
(nextMeridiem) => {
|
|
9963
10106
|
setMeridiem(nextMeridiem);
|
|
9964
10107
|
const current = parsedValue != null ? parsedValue : baseValue;
|
|
@@ -9973,7 +10116,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9973
10116
|
},
|
|
9974
10117
|
[baseValue, commitValue, parsedValue]
|
|
9975
10118
|
);
|
|
9976
|
-
const handleInputChange =
|
|
10119
|
+
const handleInputChange = React59.useCallback(
|
|
9977
10120
|
(event) => {
|
|
9978
10121
|
const nextValue = event.target.value;
|
|
9979
10122
|
setInputValue(nextValue);
|
|
@@ -10081,7 +10224,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
10081
10224
|
]
|
|
10082
10225
|
}
|
|
10083
10226
|
);
|
|
10084
|
-
const periodWheelOptions =
|
|
10227
|
+
const periodWheelOptions = React59.useMemo(
|
|
10085
10228
|
() => [
|
|
10086
10229
|
{ label: "AM", value: "AM" },
|
|
10087
10230
|
{ label: "PM", value: "PM" }
|
|
@@ -10252,7 +10395,7 @@ function DataTable({
|
|
|
10252
10395
|
var _a2;
|
|
10253
10396
|
const rowModel = (_a2 = virtualizedRows == null ? void 0 : virtualizedRows.rows) != null ? _a2 : table.getRowModel().rows;
|
|
10254
10397
|
const dataIds = dndEnabled ? rowModel.map((row) => Number(row.id)) : [];
|
|
10255
|
-
const sortableId =
|
|
10398
|
+
const sortableId = React59.useId();
|
|
10256
10399
|
const sensors = useSensors(useSensor(MouseSensor, {}), useSensor(TouchSensor, {}), useSensor(KeyboardSensor, {}));
|
|
10257
10400
|
function handleDragEnd(event) {
|
|
10258
10401
|
const { active, over } = event;
|
|
@@ -10454,21 +10597,21 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
10454
10597
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
10455
10598
|
let defaultContexts = [];
|
|
10456
10599
|
function createContext32(rootComponentName, defaultContext) {
|
|
10457
|
-
const BaseContext =
|
|
10600
|
+
const BaseContext = React59.createContext(defaultContext);
|
|
10458
10601
|
const index2 = defaultContexts.length;
|
|
10459
10602
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
10460
10603
|
const Provider = (props) => {
|
|
10461
10604
|
var _a2;
|
|
10462
10605
|
const { scope, children, ...context } = props;
|
|
10463
10606
|
const Context = ((_a2 = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a2[index2]) || BaseContext;
|
|
10464
|
-
const value =
|
|
10607
|
+
const value = React59.useMemo(() => context, Object.values(context));
|
|
10465
10608
|
return /* @__PURE__ */ jsx$1(Context.Provider, { value, children });
|
|
10466
10609
|
};
|
|
10467
10610
|
Provider.displayName = rootComponentName + "Provider";
|
|
10468
10611
|
function useContext22(consumerName, scope) {
|
|
10469
10612
|
var _a2;
|
|
10470
10613
|
const Context = ((_a2 = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a2[index2]) || BaseContext;
|
|
10471
|
-
const context =
|
|
10614
|
+
const context = React59.useContext(Context);
|
|
10472
10615
|
if (context) return context;
|
|
10473
10616
|
if (defaultContext !== void 0) return defaultContext;
|
|
10474
10617
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -10477,11 +10620,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
10477
10620
|
}
|
|
10478
10621
|
const createScope = () => {
|
|
10479
10622
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
10480
|
-
return
|
|
10623
|
+
return React59.createContext(defaultContext);
|
|
10481
10624
|
});
|
|
10482
10625
|
return function useScope(scope) {
|
|
10483
10626
|
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
|
10484
|
-
return
|
|
10627
|
+
return React59.useMemo(
|
|
10485
10628
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
10486
10629
|
[scope, contexts]
|
|
10487
10630
|
);
|
|
@@ -10504,15 +10647,15 @@ function composeContextScopes(...scopes) {
|
|
|
10504
10647
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
10505
10648
|
return { ...nextScopes2, ...currentScope };
|
|
10506
10649
|
}, {});
|
|
10507
|
-
return
|
|
10650
|
+
return React59.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
10508
10651
|
};
|
|
10509
10652
|
};
|
|
10510
10653
|
createScope.scopeName = baseScope.scopeName;
|
|
10511
10654
|
return createScope;
|
|
10512
10655
|
}
|
|
10513
|
-
var useLayoutEffect22 = (globalThis == null ? void 0 : globalThis.document) ?
|
|
10656
|
+
var useLayoutEffect22 = (globalThis == null ? void 0 : globalThis.document) ? React59.useLayoutEffect : () => {
|
|
10514
10657
|
};
|
|
10515
|
-
var useInsertionEffect =
|
|
10658
|
+
var useInsertionEffect = React59[" useInsertionEffect ".trim().toString()] || useLayoutEffect22;
|
|
10516
10659
|
function useControllableState({
|
|
10517
10660
|
prop,
|
|
10518
10661
|
defaultProp,
|
|
@@ -10527,8 +10670,8 @@ function useControllableState({
|
|
|
10527
10670
|
const isControlled = prop !== void 0;
|
|
10528
10671
|
const value = isControlled ? prop : uncontrolledProp;
|
|
10529
10672
|
{
|
|
10530
|
-
const isControlledRef =
|
|
10531
|
-
|
|
10673
|
+
const isControlledRef = React59.useRef(prop !== void 0);
|
|
10674
|
+
React59.useEffect(() => {
|
|
10532
10675
|
const wasControlled = isControlledRef.current;
|
|
10533
10676
|
if (wasControlled !== isControlled) {
|
|
10534
10677
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -10540,7 +10683,7 @@ function useControllableState({
|
|
|
10540
10683
|
isControlledRef.current = isControlled;
|
|
10541
10684
|
}, [isControlled, caller]);
|
|
10542
10685
|
}
|
|
10543
|
-
const setValue =
|
|
10686
|
+
const setValue = React59.useCallback(
|
|
10544
10687
|
(nextValue) => {
|
|
10545
10688
|
var _a2;
|
|
10546
10689
|
if (isControlled) {
|
|
@@ -10560,13 +10703,13 @@ function useUncontrolledState({
|
|
|
10560
10703
|
defaultProp,
|
|
10561
10704
|
onChange
|
|
10562
10705
|
}) {
|
|
10563
|
-
const [value, setValue] =
|
|
10564
|
-
const prevValueRef =
|
|
10565
|
-
const onChangeRef =
|
|
10706
|
+
const [value, setValue] = React59.useState(defaultProp);
|
|
10707
|
+
const prevValueRef = React59.useRef(value);
|
|
10708
|
+
const onChangeRef = React59.useRef(onChange);
|
|
10566
10709
|
useInsertionEffect(() => {
|
|
10567
10710
|
onChangeRef.current = onChange;
|
|
10568
10711
|
}, [onChange]);
|
|
10569
|
-
|
|
10712
|
+
React59.useEffect(() => {
|
|
10570
10713
|
var _a2;
|
|
10571
10714
|
if (prevValueRef.current !== value) {
|
|
10572
10715
|
(_a2 = onChangeRef.current) == null ? void 0 : _a2.call(onChangeRef, value);
|
|
@@ -10599,7 +10742,7 @@ var NODES = [
|
|
|
10599
10742
|
];
|
|
10600
10743
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
10601
10744
|
const Slot3 = createSlot(`Primitive.${node}`);
|
|
10602
|
-
const Node2 =
|
|
10745
|
+
const Node2 = React59.forwardRef((props, forwardedRef) => {
|
|
10603
10746
|
const { asChild, ...primitiveProps } = props;
|
|
10604
10747
|
const Comp = asChild ? Slot3 : node;
|
|
10605
10748
|
if (typeof window !== "undefined") {
|
|
@@ -10622,14 +10765,14 @@ function createCollection(name) {
|
|
|
10622
10765
|
);
|
|
10623
10766
|
const CollectionProvider = (props) => {
|
|
10624
10767
|
const { scope, children } = props;
|
|
10625
|
-
const ref =
|
|
10626
|
-
const itemMap =
|
|
10768
|
+
const ref = React59__default.useRef(null);
|
|
10769
|
+
const itemMap = React59__default.useRef(/* @__PURE__ */ new Map()).current;
|
|
10627
10770
|
return /* @__PURE__ */ jsx$1(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
10628
10771
|
};
|
|
10629
10772
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
10630
10773
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
10631
10774
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
10632
|
-
const CollectionSlot =
|
|
10775
|
+
const CollectionSlot = React59__default.forwardRef(
|
|
10633
10776
|
(props, forwardedRef) => {
|
|
10634
10777
|
const { scope, children } = props;
|
|
10635
10778
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -10641,13 +10784,13 @@ function createCollection(name) {
|
|
|
10641
10784
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
10642
10785
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
10643
10786
|
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
10644
|
-
const CollectionItemSlot =
|
|
10787
|
+
const CollectionItemSlot = React59__default.forwardRef(
|
|
10645
10788
|
(props, forwardedRef) => {
|
|
10646
10789
|
const { scope, children, ...itemData } = props;
|
|
10647
|
-
const ref =
|
|
10790
|
+
const ref = React59__default.useRef(null);
|
|
10648
10791
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10649
10792
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
10650
|
-
|
|
10793
|
+
React59__default.useEffect(() => {
|
|
10651
10794
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
10652
10795
|
return () => void context.itemMap.delete(ref);
|
|
10653
10796
|
});
|
|
@@ -10657,7 +10800,7 @@ function createCollection(name) {
|
|
|
10657
10800
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
10658
10801
|
function useCollection3(scope) {
|
|
10659
10802
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
10660
|
-
const getItems =
|
|
10803
|
+
const getItems = React59__default.useCallback(() => {
|
|
10661
10804
|
const collectionNode = context.collectionRef.current;
|
|
10662
10805
|
if (!collectionNode) return [];
|
|
10663
10806
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -10675,24 +10818,24 @@ function createCollection(name) {
|
|
|
10675
10818
|
createCollectionScope3
|
|
10676
10819
|
];
|
|
10677
10820
|
}
|
|
10678
|
-
var DirectionContext =
|
|
10821
|
+
var DirectionContext = React59.createContext(void 0);
|
|
10679
10822
|
function useDirection(localDir) {
|
|
10680
|
-
const globalDir =
|
|
10823
|
+
const globalDir = React59.useContext(DirectionContext);
|
|
10681
10824
|
return localDir || globalDir || "ltr";
|
|
10682
10825
|
}
|
|
10683
10826
|
function useCallbackRef(callback) {
|
|
10684
|
-
const callbackRef =
|
|
10685
|
-
|
|
10827
|
+
const callbackRef = React59.useRef(callback);
|
|
10828
|
+
React59.useEffect(() => {
|
|
10686
10829
|
callbackRef.current = callback;
|
|
10687
10830
|
});
|
|
10688
|
-
return
|
|
10831
|
+
return React59.useMemo(() => (...args) => {
|
|
10689
10832
|
var _a2;
|
|
10690
10833
|
return (_a2 = callbackRef.current) == null ? void 0 : _a2.call(callbackRef, ...args);
|
|
10691
10834
|
}, []);
|
|
10692
10835
|
}
|
|
10693
10836
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
10694
10837
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
10695
|
-
|
|
10838
|
+
React59.useEffect(() => {
|
|
10696
10839
|
const handleKeyDown = (event) => {
|
|
10697
10840
|
if (event.key === "Escape") {
|
|
10698
10841
|
onEscapeKeyDown(event);
|
|
@@ -10707,12 +10850,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
10707
10850
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
10708
10851
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
10709
10852
|
var originalBodyPointerEvents;
|
|
10710
|
-
var DismissableLayerContext =
|
|
10853
|
+
var DismissableLayerContext = React59.createContext({
|
|
10711
10854
|
layers: /* @__PURE__ */ new Set(),
|
|
10712
10855
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
10713
10856
|
branches: /* @__PURE__ */ new Set()
|
|
10714
10857
|
});
|
|
10715
|
-
var DismissableLayer =
|
|
10858
|
+
var DismissableLayer = React59.forwardRef(
|
|
10716
10859
|
(props, forwardedRef) => {
|
|
10717
10860
|
var _a2;
|
|
10718
10861
|
const {
|
|
@@ -10724,10 +10867,10 @@ var DismissableLayer = React58.forwardRef(
|
|
|
10724
10867
|
onDismiss,
|
|
10725
10868
|
...layerProps
|
|
10726
10869
|
} = props;
|
|
10727
|
-
const context =
|
|
10728
|
-
const [node, setNode] =
|
|
10870
|
+
const context = React59.useContext(DismissableLayerContext);
|
|
10871
|
+
const [node, setNode] = React59.useState(null);
|
|
10729
10872
|
const ownerDocument = (_a2 = node == null ? void 0 : node.ownerDocument) != null ? _a2 : globalThis == null ? void 0 : globalThis.document;
|
|
10730
|
-
const [, force] =
|
|
10873
|
+
const [, force] = React59.useState({});
|
|
10731
10874
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
10732
10875
|
const layers = Array.from(context.layers);
|
|
10733
10876
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -10760,7 +10903,7 @@ var DismissableLayer = React58.forwardRef(
|
|
|
10760
10903
|
onDismiss();
|
|
10761
10904
|
}
|
|
10762
10905
|
}, ownerDocument);
|
|
10763
|
-
|
|
10906
|
+
React59.useEffect(() => {
|
|
10764
10907
|
if (!node) return;
|
|
10765
10908
|
if (disableOutsidePointerEvents) {
|
|
10766
10909
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -10777,7 +10920,7 @@ var DismissableLayer = React58.forwardRef(
|
|
|
10777
10920
|
}
|
|
10778
10921
|
};
|
|
10779
10922
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
10780
|
-
|
|
10923
|
+
React59.useEffect(() => {
|
|
10781
10924
|
return () => {
|
|
10782
10925
|
if (!node) return;
|
|
10783
10926
|
context.layers.delete(node);
|
|
@@ -10785,7 +10928,7 @@ var DismissableLayer = React58.forwardRef(
|
|
|
10785
10928
|
dispatchUpdate();
|
|
10786
10929
|
};
|
|
10787
10930
|
}, [node, context]);
|
|
10788
|
-
|
|
10931
|
+
React59.useEffect(() => {
|
|
10789
10932
|
const handleUpdate = () => force({});
|
|
10790
10933
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
10791
10934
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -10811,11 +10954,11 @@ var DismissableLayer = React58.forwardRef(
|
|
|
10811
10954
|
);
|
|
10812
10955
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
10813
10956
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
10814
|
-
var DismissableLayerBranch =
|
|
10815
|
-
const context =
|
|
10816
|
-
const ref =
|
|
10957
|
+
var DismissableLayerBranch = React59.forwardRef((props, forwardedRef) => {
|
|
10958
|
+
const context = React59.useContext(DismissableLayerContext);
|
|
10959
|
+
const ref = React59.useRef(null);
|
|
10817
10960
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10818
|
-
|
|
10961
|
+
React59.useEffect(() => {
|
|
10819
10962
|
const node = ref.current;
|
|
10820
10963
|
if (node) {
|
|
10821
10964
|
context.branches.add(node);
|
|
@@ -10829,10 +10972,10 @@ var DismissableLayerBranch = React58.forwardRef((props, forwardedRef) => {
|
|
|
10829
10972
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
10830
10973
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
10831
10974
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
10832
|
-
const isPointerInsideReactTreeRef =
|
|
10833
|
-
const handleClickRef =
|
|
10975
|
+
const isPointerInsideReactTreeRef = React59.useRef(false);
|
|
10976
|
+
const handleClickRef = React59.useRef(() => {
|
|
10834
10977
|
});
|
|
10835
|
-
|
|
10978
|
+
React59.useEffect(() => {
|
|
10836
10979
|
const handlePointerDown = (event) => {
|
|
10837
10980
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
10838
10981
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -10872,8 +11015,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis
|
|
|
10872
11015
|
}
|
|
10873
11016
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
10874
11017
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
10875
|
-
const isFocusInsideReactTreeRef =
|
|
10876
|
-
|
|
11018
|
+
const isFocusInsideReactTreeRef = React59.useRef(false);
|
|
11019
|
+
React59.useEffect(() => {
|
|
10877
11020
|
const handleFocus = (event) => {
|
|
10878
11021
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
10879
11022
|
const eventDetail = { originalEvent: event };
|
|
@@ -10906,7 +11049,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
10906
11049
|
}
|
|
10907
11050
|
var count = 0;
|
|
10908
11051
|
function useFocusGuards() {
|
|
10909
|
-
|
|
11052
|
+
React59.useEffect(() => {
|
|
10910
11053
|
var _a2, _b;
|
|
10911
11054
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
10912
11055
|
document.body.insertAdjacentElement("afterbegin", (_a2 = edgeGuards[0]) != null ? _a2 : createFocusGuard());
|
|
@@ -10934,7 +11077,7 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
|
10934
11077
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
10935
11078
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
10936
11079
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
10937
|
-
var FocusScope =
|
|
11080
|
+
var FocusScope = React59.forwardRef((props, forwardedRef) => {
|
|
10938
11081
|
const {
|
|
10939
11082
|
loop = false,
|
|
10940
11083
|
trapped = false,
|
|
@@ -10942,12 +11085,12 @@ var FocusScope = React58.forwardRef((props, forwardedRef) => {
|
|
|
10942
11085
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
10943
11086
|
...scopeProps
|
|
10944
11087
|
} = props;
|
|
10945
|
-
const [container, setContainer] =
|
|
11088
|
+
const [container, setContainer] = React59.useState(null);
|
|
10946
11089
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
10947
11090
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
10948
|
-
const lastFocusedElementRef =
|
|
11091
|
+
const lastFocusedElementRef = React59.useRef(null);
|
|
10949
11092
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
10950
|
-
const focusScope =
|
|
11093
|
+
const focusScope = React59.useRef({
|
|
10951
11094
|
paused: false,
|
|
10952
11095
|
pause() {
|
|
10953
11096
|
this.paused = true;
|
|
@@ -10956,7 +11099,7 @@ var FocusScope = React58.forwardRef((props, forwardedRef) => {
|
|
|
10956
11099
|
this.paused = false;
|
|
10957
11100
|
}
|
|
10958
11101
|
}).current;
|
|
10959
|
-
|
|
11102
|
+
React59.useEffect(() => {
|
|
10960
11103
|
if (trapped) {
|
|
10961
11104
|
let handleFocusIn2 = function(event) {
|
|
10962
11105
|
if (focusScope.paused || !container) return;
|
|
@@ -10991,7 +11134,7 @@ var FocusScope = React58.forwardRef((props, forwardedRef) => {
|
|
|
10991
11134
|
};
|
|
10992
11135
|
}
|
|
10993
11136
|
}, [trapped, container, focusScope.paused]);
|
|
10994
|
-
|
|
11137
|
+
React59.useEffect(() => {
|
|
10995
11138
|
if (container) {
|
|
10996
11139
|
focusScopesStack.add(focusScope);
|
|
10997
11140
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -11022,7 +11165,7 @@ var FocusScope = React58.forwardRef((props, forwardedRef) => {
|
|
|
11022
11165
|
};
|
|
11023
11166
|
}
|
|
11024
11167
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
11025
|
-
const handleKeyDown =
|
|
11168
|
+
const handleKeyDown = React59.useCallback(
|
|
11026
11169
|
(event) => {
|
|
11027
11170
|
if (!loop && !trapped) return;
|
|
11028
11171
|
if (focusScope.paused) return;
|
|
@@ -11130,10 +11273,10 @@ function arrayRemove(array, item) {
|
|
|
11130
11273
|
function removeLinks(items) {
|
|
11131
11274
|
return items.filter((item) => item.tagName !== "A");
|
|
11132
11275
|
}
|
|
11133
|
-
var useReactId =
|
|
11276
|
+
var useReactId = React59[" useId ".trim().toString()] || (() => void 0);
|
|
11134
11277
|
var count2 = 0;
|
|
11135
11278
|
function useId4(deterministicId) {
|
|
11136
|
-
const [id, setId] =
|
|
11279
|
+
const [id, setId] = React59.useState(useReactId());
|
|
11137
11280
|
useLayoutEffect22(() => {
|
|
11138
11281
|
setId((reactId) => reactId != null ? reactId : String(count2++));
|
|
11139
11282
|
}, [deterministicId]);
|
|
@@ -12808,7 +12951,7 @@ function roundByDPR(element, value) {
|
|
|
12808
12951
|
return Math.round(value * dpr) / dpr;
|
|
12809
12952
|
}
|
|
12810
12953
|
function useLatestRef(value) {
|
|
12811
|
-
const ref =
|
|
12954
|
+
const ref = React59.useRef(value);
|
|
12812
12955
|
index(() => {
|
|
12813
12956
|
ref.current = value;
|
|
12814
12957
|
});
|
|
@@ -12831,7 +12974,7 @@ function useFloating(options) {
|
|
|
12831
12974
|
whileElementsMounted,
|
|
12832
12975
|
open
|
|
12833
12976
|
} = options;
|
|
12834
|
-
const [data, setData] =
|
|
12977
|
+
const [data, setData] = React59.useState({
|
|
12835
12978
|
x: 0,
|
|
12836
12979
|
y: 0,
|
|
12837
12980
|
strategy,
|
|
@@ -12839,19 +12982,19 @@ function useFloating(options) {
|
|
|
12839
12982
|
middlewareData: {},
|
|
12840
12983
|
isPositioned: false
|
|
12841
12984
|
});
|
|
12842
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
12985
|
+
const [latestMiddleware, setLatestMiddleware] = React59.useState(middleware);
|
|
12843
12986
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
12844
12987
|
setLatestMiddleware(middleware);
|
|
12845
12988
|
}
|
|
12846
|
-
const [_reference, _setReference] =
|
|
12847
|
-
const [_floating, _setFloating] =
|
|
12848
|
-
const setReference =
|
|
12989
|
+
const [_reference, _setReference] = React59.useState(null);
|
|
12990
|
+
const [_floating, _setFloating] = React59.useState(null);
|
|
12991
|
+
const setReference = React59.useCallback((node) => {
|
|
12849
12992
|
if (node !== referenceRef.current) {
|
|
12850
12993
|
referenceRef.current = node;
|
|
12851
12994
|
_setReference(node);
|
|
12852
12995
|
}
|
|
12853
12996
|
}, []);
|
|
12854
|
-
const setFloating =
|
|
12997
|
+
const setFloating = React59.useCallback((node) => {
|
|
12855
12998
|
if (node !== floatingRef.current) {
|
|
12856
12999
|
floatingRef.current = node;
|
|
12857
13000
|
_setFloating(node);
|
|
@@ -12859,14 +13002,14 @@ function useFloating(options) {
|
|
|
12859
13002
|
}, []);
|
|
12860
13003
|
const referenceEl = externalReference || _reference;
|
|
12861
13004
|
const floatingEl = externalFloating || _floating;
|
|
12862
|
-
const referenceRef =
|
|
12863
|
-
const floatingRef =
|
|
12864
|
-
const dataRef =
|
|
13005
|
+
const referenceRef = React59.useRef(null);
|
|
13006
|
+
const floatingRef = React59.useRef(null);
|
|
13007
|
+
const dataRef = React59.useRef(data);
|
|
12865
13008
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
12866
13009
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
12867
13010
|
const platformRef = useLatestRef(platform2);
|
|
12868
13011
|
const openRef = useLatestRef(open);
|
|
12869
|
-
const update =
|
|
13012
|
+
const update = React59.useCallback(() => {
|
|
12870
13013
|
if (!referenceRef.current || !floatingRef.current) {
|
|
12871
13014
|
return;
|
|
12872
13015
|
}
|
|
@@ -12904,7 +13047,7 @@ function useFloating(options) {
|
|
|
12904
13047
|
}));
|
|
12905
13048
|
}
|
|
12906
13049
|
}, [open]);
|
|
12907
|
-
const isMountedRef =
|
|
13050
|
+
const isMountedRef = React59.useRef(false);
|
|
12908
13051
|
index(() => {
|
|
12909
13052
|
isMountedRef.current = true;
|
|
12910
13053
|
return () => {
|
|
@@ -12921,17 +13064,17 @@ function useFloating(options) {
|
|
|
12921
13064
|
update();
|
|
12922
13065
|
}
|
|
12923
13066
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
12924
|
-
const refs =
|
|
13067
|
+
const refs = React59.useMemo(() => ({
|
|
12925
13068
|
reference: referenceRef,
|
|
12926
13069
|
floating: floatingRef,
|
|
12927
13070
|
setReference,
|
|
12928
13071
|
setFloating
|
|
12929
13072
|
}), [setReference, setFloating]);
|
|
12930
|
-
const elements =
|
|
13073
|
+
const elements = React59.useMemo(() => ({
|
|
12931
13074
|
reference: referenceEl,
|
|
12932
13075
|
floating: floatingEl
|
|
12933
13076
|
}), [referenceEl, floatingEl]);
|
|
12934
|
-
const floatingStyles =
|
|
13077
|
+
const floatingStyles = React59.useMemo(() => {
|
|
12935
13078
|
const initialStyles = {
|
|
12936
13079
|
position: strategy,
|
|
12937
13080
|
left: 0,
|
|
@@ -12957,7 +13100,7 @@ function useFloating(options) {
|
|
|
12957
13100
|
top: y
|
|
12958
13101
|
};
|
|
12959
13102
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
12960
|
-
return
|
|
13103
|
+
return React59.useMemo(() => ({
|
|
12961
13104
|
...data,
|
|
12962
13105
|
update,
|
|
12963
13106
|
refs,
|
|
@@ -13025,7 +13168,7 @@ var arrow3 = (options, deps) => ({
|
|
|
13025
13168
|
options: [options, deps]
|
|
13026
13169
|
});
|
|
13027
13170
|
var NAME = "Arrow";
|
|
13028
|
-
var Arrow =
|
|
13171
|
+
var Arrow = React59.forwardRef((props, forwardedRef) => {
|
|
13029
13172
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
13030
13173
|
return /* @__PURE__ */ jsx$1(
|
|
13031
13174
|
Primitive.svg,
|
|
@@ -13043,7 +13186,7 @@ var Arrow = React58.forwardRef((props, forwardedRef) => {
|
|
|
13043
13186
|
Arrow.displayName = NAME;
|
|
13044
13187
|
var Root = Arrow;
|
|
13045
13188
|
function useSize(element) {
|
|
13046
|
-
const [size4, setSize] =
|
|
13189
|
+
const [size4, setSize] = React59.useState(void 0);
|
|
13047
13190
|
useLayoutEffect22(() => {
|
|
13048
13191
|
if (element) {
|
|
13049
13192
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -13080,14 +13223,14 @@ var POPPER_NAME = "Popper";
|
|
|
13080
13223
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
13081
13224
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
13082
13225
|
var ANCHOR_NAME = "PopperAnchor";
|
|
13083
|
-
var PopperAnchor =
|
|
13226
|
+
var PopperAnchor = React59.forwardRef(
|
|
13084
13227
|
(props, forwardedRef) => {
|
|
13085
13228
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
13086
13229
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
13087
|
-
const ref =
|
|
13230
|
+
const ref = React59.useRef(null);
|
|
13088
13231
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
13089
|
-
const anchorRef =
|
|
13090
|
-
|
|
13232
|
+
const anchorRef = React59.useRef(null);
|
|
13233
|
+
React59.useEffect(() => {
|
|
13091
13234
|
const previousAnchor = anchorRef.current;
|
|
13092
13235
|
anchorRef.current = (virtualRef == null ? void 0 : virtualRef.current) || ref.current;
|
|
13093
13236
|
if (previousAnchor !== anchorRef.current) {
|
|
@@ -13100,7 +13243,7 @@ var PopperAnchor = React58.forwardRef(
|
|
|
13100
13243
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
13101
13244
|
var CONTENT_NAME = "PopperContent";
|
|
13102
13245
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
13103
|
-
var PopperContent =
|
|
13246
|
+
var PopperContent = React59.forwardRef(
|
|
13104
13247
|
(props, forwardedRef) => {
|
|
13105
13248
|
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
13106
13249
|
const {
|
|
@@ -13120,9 +13263,9 @@ var PopperContent = React58.forwardRef(
|
|
|
13120
13263
|
...contentProps
|
|
13121
13264
|
} = props;
|
|
13122
13265
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
13123
|
-
const [content, setContent] =
|
|
13266
|
+
const [content, setContent] = React59.useState(null);
|
|
13124
13267
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
13125
|
-
const [arrow4, setArrow] =
|
|
13268
|
+
const [arrow4, setArrow] = React59.useState(null);
|
|
13126
13269
|
const arrowSize = useSize(arrow4);
|
|
13127
13270
|
const arrowWidth = (_a2 = arrowSize == null ? void 0 : arrowSize.width) != null ? _a2 : 0;
|
|
13128
13271
|
const arrowHeight = (_b = arrowSize == null ? void 0 : arrowSize.height) != null ? _b : 0;
|
|
@@ -13184,7 +13327,7 @@ var PopperContent = React58.forwardRef(
|
|
|
13184
13327
|
const arrowX = (_c = middlewareData.arrow) == null ? void 0 : _c.x;
|
|
13185
13328
|
const arrowY = (_d = middlewareData.arrow) == null ? void 0 : _d.y;
|
|
13186
13329
|
const cannotCenterArrow = ((_e = middlewareData.arrow) == null ? void 0 : _e.centerOffset) !== 0;
|
|
13187
|
-
const [contentZIndex, setContentZIndex] =
|
|
13330
|
+
const [contentZIndex, setContentZIndex] = React59.useState();
|
|
13188
13331
|
useLayoutEffect22(() => {
|
|
13189
13332
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
13190
13333
|
}, [content]);
|
|
@@ -13250,7 +13393,7 @@ var OPPOSITE_SIDE = {
|
|
|
13250
13393
|
bottom: "top",
|
|
13251
13394
|
left: "right"
|
|
13252
13395
|
};
|
|
13253
|
-
var PopperArrow =
|
|
13396
|
+
var PopperArrow = React59.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
13254
13397
|
const { __scopePopper, ...arrowProps } = props;
|
|
13255
13398
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
13256
13399
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -13341,17 +13484,17 @@ var Anchor = PopperAnchor;
|
|
|
13341
13484
|
var Content = PopperContent;
|
|
13342
13485
|
var Arrow2 = PopperArrow;
|
|
13343
13486
|
var PORTAL_NAME = "Portal";
|
|
13344
|
-
var Portal =
|
|
13487
|
+
var Portal = React59.forwardRef((props, forwardedRef) => {
|
|
13345
13488
|
var _a2;
|
|
13346
13489
|
const { container: containerProp, ...portalProps } = props;
|
|
13347
|
-
const [mounted, setMounted] =
|
|
13490
|
+
const [mounted, setMounted] = React59.useState(false);
|
|
13348
13491
|
useLayoutEffect22(() => setMounted(true), []);
|
|
13349
13492
|
const container = containerProp || mounted && ((_a2 = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a2.body);
|
|
13350
13493
|
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx$1(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
13351
13494
|
});
|
|
13352
13495
|
Portal.displayName = PORTAL_NAME;
|
|
13353
13496
|
function useStateMachine(initialState, machine) {
|
|
13354
|
-
return
|
|
13497
|
+
return React59.useReducer((state, event) => {
|
|
13355
13498
|
const nextState = machine[state][event];
|
|
13356
13499
|
return nextState != null ? nextState : state;
|
|
13357
13500
|
}, initialState);
|
|
@@ -13359,17 +13502,17 @@ function useStateMachine(initialState, machine) {
|
|
|
13359
13502
|
var Presence = (props) => {
|
|
13360
13503
|
const { present, children } = props;
|
|
13361
13504
|
const presence = usePresence(present);
|
|
13362
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) :
|
|
13505
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React59.Children.only(children);
|
|
13363
13506
|
const ref = useComposedRefs(presence.ref, getElementRef2(child));
|
|
13364
13507
|
const forceMount = typeof children === "function";
|
|
13365
|
-
return forceMount || presence.isPresent ?
|
|
13508
|
+
return forceMount || presence.isPresent ? React59.cloneElement(child, { ref }) : null;
|
|
13366
13509
|
};
|
|
13367
13510
|
Presence.displayName = "Presence";
|
|
13368
13511
|
function usePresence(present) {
|
|
13369
|
-
const [node, setNode] =
|
|
13370
|
-
const stylesRef =
|
|
13371
|
-
const prevPresentRef =
|
|
13372
|
-
const prevAnimationNameRef =
|
|
13512
|
+
const [node, setNode] = React59.useState();
|
|
13513
|
+
const stylesRef = React59.useRef(null);
|
|
13514
|
+
const prevPresentRef = React59.useRef(present);
|
|
13515
|
+
const prevAnimationNameRef = React59.useRef("none");
|
|
13373
13516
|
const initialState = present ? "mounted" : "unmounted";
|
|
13374
13517
|
const [state, send] = useStateMachine(initialState, {
|
|
13375
13518
|
mounted: {
|
|
@@ -13384,7 +13527,7 @@ function usePresence(present) {
|
|
|
13384
13527
|
MOUNT: "mounted"
|
|
13385
13528
|
}
|
|
13386
13529
|
});
|
|
13387
|
-
|
|
13530
|
+
React59.useEffect(() => {
|
|
13388
13531
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
13389
13532
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
13390
13533
|
}, [state]);
|
|
@@ -13451,7 +13594,7 @@ function usePresence(present) {
|
|
|
13451
13594
|
}, [node, send]);
|
|
13452
13595
|
return {
|
|
13453
13596
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
13454
|
-
ref:
|
|
13597
|
+
ref: React59.useCallback((node2) => {
|
|
13455
13598
|
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
13456
13599
|
setNode(node2);
|
|
13457
13600
|
}, [])
|
|
@@ -13483,13 +13626,13 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
13483
13626
|
[createCollectionScope]
|
|
13484
13627
|
);
|
|
13485
13628
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
13486
|
-
var RovingFocusGroup =
|
|
13629
|
+
var RovingFocusGroup = React59.forwardRef(
|
|
13487
13630
|
(props, forwardedRef) => {
|
|
13488
13631
|
return /* @__PURE__ */ jsx$1(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx$1(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx$1(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
13489
13632
|
}
|
|
13490
13633
|
);
|
|
13491
13634
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
13492
|
-
var RovingFocusGroupImpl =
|
|
13635
|
+
var RovingFocusGroupImpl = React59.forwardRef((props, forwardedRef) => {
|
|
13493
13636
|
const {
|
|
13494
13637
|
__scopeRovingFocusGroup,
|
|
13495
13638
|
orientation,
|
|
@@ -13502,7 +13645,7 @@ var RovingFocusGroupImpl = React58.forwardRef((props, forwardedRef) => {
|
|
|
13502
13645
|
preventScrollOnEntryFocus = false,
|
|
13503
13646
|
...groupProps
|
|
13504
13647
|
} = props;
|
|
13505
|
-
const ref =
|
|
13648
|
+
const ref = React59.useRef(null);
|
|
13506
13649
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
13507
13650
|
const direction = useDirection(dir);
|
|
13508
13651
|
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
@@ -13511,12 +13654,12 @@ var RovingFocusGroupImpl = React58.forwardRef((props, forwardedRef) => {
|
|
|
13511
13654
|
onChange: onCurrentTabStopIdChange,
|
|
13512
13655
|
caller: GROUP_NAME
|
|
13513
13656
|
});
|
|
13514
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
13657
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React59.useState(false);
|
|
13515
13658
|
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
13516
13659
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
13517
|
-
const isClickFocusRef =
|
|
13518
|
-
const [focusableItemsCount, setFocusableItemsCount] =
|
|
13519
|
-
|
|
13660
|
+
const isClickFocusRef = React59.useRef(false);
|
|
13661
|
+
const [focusableItemsCount, setFocusableItemsCount] = React59.useState(0);
|
|
13662
|
+
React59.useEffect(() => {
|
|
13520
13663
|
const node = ref.current;
|
|
13521
13664
|
if (node) {
|
|
13522
13665
|
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
@@ -13531,16 +13674,16 @@ var RovingFocusGroupImpl = React58.forwardRef((props, forwardedRef) => {
|
|
|
13531
13674
|
dir: direction,
|
|
13532
13675
|
loop,
|
|
13533
13676
|
currentTabStopId,
|
|
13534
|
-
onItemFocus:
|
|
13677
|
+
onItemFocus: React59.useCallback(
|
|
13535
13678
|
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
13536
13679
|
[setCurrentTabStopId]
|
|
13537
13680
|
),
|
|
13538
|
-
onItemShiftTab:
|
|
13539
|
-
onFocusableItemAdd:
|
|
13681
|
+
onItemShiftTab: React59.useCallback(() => setIsTabbingBackOut(true), []),
|
|
13682
|
+
onFocusableItemAdd: React59.useCallback(
|
|
13540
13683
|
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
13541
13684
|
[]
|
|
13542
13685
|
),
|
|
13543
|
-
onFocusableItemRemove:
|
|
13686
|
+
onFocusableItemRemove: React59.useCallback(
|
|
13544
13687
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
13545
13688
|
[]
|
|
13546
13689
|
),
|
|
@@ -13580,7 +13723,7 @@ var RovingFocusGroupImpl = React58.forwardRef((props, forwardedRef) => {
|
|
|
13580
13723
|
);
|
|
13581
13724
|
});
|
|
13582
13725
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
13583
|
-
var RovingFocusGroupItem =
|
|
13726
|
+
var RovingFocusGroupItem = React59.forwardRef(
|
|
13584
13727
|
(props, forwardedRef) => {
|
|
13585
13728
|
const {
|
|
13586
13729
|
__scopeRovingFocusGroup,
|
|
@@ -13596,7 +13739,7 @@ var RovingFocusGroupItem = React58.forwardRef(
|
|
|
13596
13739
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
13597
13740
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
13598
13741
|
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
13599
|
-
|
|
13742
|
+
React59.useEffect(() => {
|
|
13600
13743
|
if (focusable) {
|
|
13601
13744
|
onFocusableItemAdd();
|
|
13602
13745
|
return () => onFocusableItemRemove();
|
|
@@ -13877,7 +14020,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
13877
14020
|
ref.callback = callback;
|
|
13878
14021
|
return ref.facade;
|
|
13879
14022
|
}
|
|
13880
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
14023
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React59.useLayoutEffect : React59.useEffect;
|
|
13881
14024
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
13882
14025
|
function useMergeRefs(refs, defaultValue) {
|
|
13883
14026
|
var callbackRef = useCallbackRef2(null, function(newValue) {
|
|
@@ -14001,7 +14144,7 @@ var SideCar = function(_a2) {
|
|
|
14001
14144
|
if (!Target) {
|
|
14002
14145
|
throw new Error("Sidecar medium not found");
|
|
14003
14146
|
}
|
|
14004
|
-
return
|
|
14147
|
+
return React59.createElement(Target, __assign({}, rest));
|
|
14005
14148
|
};
|
|
14006
14149
|
SideCar.isSideCarExport = true;
|
|
14007
14150
|
function exportSidecar(medium, exported) {
|
|
@@ -14016,9 +14159,9 @@ var effectCar = createSidecarMedium();
|
|
|
14016
14159
|
var nothing = function() {
|
|
14017
14160
|
return;
|
|
14018
14161
|
};
|
|
14019
|
-
var RemoveScroll =
|
|
14020
|
-
var ref =
|
|
14021
|
-
var _a2 =
|
|
14162
|
+
var RemoveScroll = React59.forwardRef(function(props, parentRef) {
|
|
14163
|
+
var ref = React59.useRef(null);
|
|
14164
|
+
var _a2 = React59.useState({
|
|
14022
14165
|
onScrollCapture: nothing,
|
|
14023
14166
|
onWheelCapture: nothing,
|
|
14024
14167
|
onTouchMoveCapture: nothing
|
|
@@ -14027,11 +14170,11 @@ var RemoveScroll = React58.forwardRef(function(props, parentRef) {
|
|
|
14027
14170
|
var SideCar2 = sideCar;
|
|
14028
14171
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
14029
14172
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
14030
|
-
return
|
|
14031
|
-
|
|
14173
|
+
return React59.createElement(
|
|
14174
|
+
React59.Fragment,
|
|
14032
14175
|
null,
|
|
14033
|
-
enabled &&
|
|
14034
|
-
forwardProps ?
|
|
14176
|
+
enabled && React59.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
14177
|
+
forwardProps ? React59.cloneElement(React59.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React59.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
14035
14178
|
);
|
|
14036
14179
|
});
|
|
14037
14180
|
RemoveScroll.defaultProps = {
|
|
@@ -14100,7 +14243,7 @@ var stylesheetSingleton = function() {
|
|
|
14100
14243
|
var styleHookSingleton = function() {
|
|
14101
14244
|
var sheet = stylesheetSingleton();
|
|
14102
14245
|
return function(styles, isDynamic) {
|
|
14103
|
-
|
|
14246
|
+
React59.useEffect(function() {
|
|
14104
14247
|
sheet.add(styles);
|
|
14105
14248
|
return function() {
|
|
14106
14249
|
sheet.remove();
|
|
@@ -14174,7 +14317,7 @@ var getCurrentUseCounter = function() {
|
|
|
14174
14317
|
return isFinite(counter) ? counter : 0;
|
|
14175
14318
|
};
|
|
14176
14319
|
var useLockAttribute = function() {
|
|
14177
|
-
|
|
14320
|
+
React59.useEffect(function() {
|
|
14178
14321
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
14179
14322
|
return function() {
|
|
14180
14323
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -14189,10 +14332,10 @@ var useLockAttribute = function() {
|
|
|
14189
14332
|
var RemoveScrollBar = function(_a2) {
|
|
14190
14333
|
var noRelative = _a2.noRelative, noImportant = _a2.noImportant, _b = _a2.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
14191
14334
|
useLockAttribute();
|
|
14192
|
-
var gap =
|
|
14335
|
+
var gap = React59.useMemo(function() {
|
|
14193
14336
|
return getGapWidth(gapMode);
|
|
14194
14337
|
}, [gapMode]);
|
|
14195
|
-
return
|
|
14338
|
+
return React59.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
14196
14339
|
};
|
|
14197
14340
|
|
|
14198
14341
|
// node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
@@ -14333,16 +14476,16 @@ var generateStyle = function(id) {
|
|
|
14333
14476
|
var idCounter = 0;
|
|
14334
14477
|
var lockStack = [];
|
|
14335
14478
|
function RemoveScrollSideCar(props) {
|
|
14336
|
-
var shouldPreventQueue =
|
|
14337
|
-
var touchStartRef =
|
|
14338
|
-
var activeAxis =
|
|
14339
|
-
var id =
|
|
14340
|
-
var Style2 =
|
|
14341
|
-
var lastProps =
|
|
14342
|
-
|
|
14479
|
+
var shouldPreventQueue = React59.useRef([]);
|
|
14480
|
+
var touchStartRef = React59.useRef([0, 0]);
|
|
14481
|
+
var activeAxis = React59.useRef();
|
|
14482
|
+
var id = React59.useState(idCounter++)[0];
|
|
14483
|
+
var Style2 = React59.useState(styleSingleton)[0];
|
|
14484
|
+
var lastProps = React59.useRef(props);
|
|
14485
|
+
React59.useEffect(function() {
|
|
14343
14486
|
lastProps.current = props;
|
|
14344
14487
|
}, [props]);
|
|
14345
|
-
|
|
14488
|
+
React59.useEffect(function() {
|
|
14346
14489
|
if (props.inert) {
|
|
14347
14490
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
14348
14491
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef)).filter(Boolean);
|
|
@@ -14358,7 +14501,7 @@ function RemoveScrollSideCar(props) {
|
|
|
14358
14501
|
}
|
|
14359
14502
|
return;
|
|
14360
14503
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
14361
|
-
var shouldCancelEvent =
|
|
14504
|
+
var shouldCancelEvent = React59.useCallback(function(event, parent) {
|
|
14362
14505
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
14363
14506
|
return !lastProps.current.allowPinchZoom;
|
|
14364
14507
|
}
|
|
@@ -14394,7 +14537,7 @@ function RemoveScrollSideCar(props) {
|
|
|
14394
14537
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
14395
14538
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
14396
14539
|
}, []);
|
|
14397
|
-
var shouldPrevent =
|
|
14540
|
+
var shouldPrevent = React59.useCallback(function(_event) {
|
|
14398
14541
|
var event = _event;
|
|
14399
14542
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
14400
14543
|
return;
|
|
@@ -14421,7 +14564,7 @@ function RemoveScrollSideCar(props) {
|
|
|
14421
14564
|
}
|
|
14422
14565
|
}
|
|
14423
14566
|
}, []);
|
|
14424
|
-
var shouldCancel =
|
|
14567
|
+
var shouldCancel = React59.useCallback(function(name, delta, target, should) {
|
|
14425
14568
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
14426
14569
|
shouldPreventQueue.current.push(event);
|
|
14427
14570
|
setTimeout(function() {
|
|
@@ -14430,17 +14573,17 @@ function RemoveScrollSideCar(props) {
|
|
|
14430
14573
|
});
|
|
14431
14574
|
}, 1);
|
|
14432
14575
|
}, []);
|
|
14433
|
-
var scrollTouchStart =
|
|
14576
|
+
var scrollTouchStart = React59.useCallback(function(event) {
|
|
14434
14577
|
touchStartRef.current = getTouchXY(event);
|
|
14435
14578
|
activeAxis.current = void 0;
|
|
14436
14579
|
}, []);
|
|
14437
|
-
var scrollWheel =
|
|
14580
|
+
var scrollWheel = React59.useCallback(function(event) {
|
|
14438
14581
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
14439
14582
|
}, []);
|
|
14440
|
-
var scrollTouchMove =
|
|
14583
|
+
var scrollTouchMove = React59.useCallback(function(event) {
|
|
14441
14584
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
14442
14585
|
}, []);
|
|
14443
|
-
|
|
14586
|
+
React59.useEffect(function() {
|
|
14444
14587
|
lockStack.push(Style2);
|
|
14445
14588
|
props.setCallbacks({
|
|
14446
14589
|
onScrollCapture: scrollWheel,
|
|
@@ -14460,11 +14603,11 @@ function RemoveScrollSideCar(props) {
|
|
|
14460
14603
|
};
|
|
14461
14604
|
}, []);
|
|
14462
14605
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
14463
|
-
return
|
|
14464
|
-
|
|
14606
|
+
return React59.createElement(
|
|
14607
|
+
React59.Fragment,
|
|
14465
14608
|
null,
|
|
14466
|
-
inert ?
|
|
14467
|
-
removeScrollBar ?
|
|
14609
|
+
inert ? React59.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
14610
|
+
removeScrollBar ? React59.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
14468
14611
|
);
|
|
14469
14612
|
}
|
|
14470
14613
|
function getOutermostShadowParent(node) {
|
|
@@ -14483,8 +14626,8 @@ function getOutermostShadowParent(node) {
|
|
|
14483
14626
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
14484
14627
|
|
|
14485
14628
|
// node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
14486
|
-
var ReactRemoveScroll =
|
|
14487
|
-
return
|
|
14629
|
+
var ReactRemoveScroll = React59.forwardRef(function(props, ref) {
|
|
14630
|
+
return React59.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
14488
14631
|
});
|
|
14489
14632
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
14490
14633
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -14512,7 +14655,7 @@ var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
|
14512
14655
|
var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
|
|
14513
14656
|
var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
14514
14657
|
var ANCHOR_NAME2 = "MenuAnchor";
|
|
14515
|
-
var MenuAnchor =
|
|
14658
|
+
var MenuAnchor = React59.forwardRef(
|
|
14516
14659
|
(props, forwardedRef) => {
|
|
14517
14660
|
const { __scopeMenu, ...anchorProps } = props;
|
|
14518
14661
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -14526,7 +14669,7 @@ var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME2, {
|
|
|
14526
14669
|
});
|
|
14527
14670
|
var CONTENT_NAME2 = "MenuContent";
|
|
14528
14671
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME2);
|
|
14529
|
-
var MenuContent =
|
|
14672
|
+
var MenuContent = React59.forwardRef(
|
|
14530
14673
|
(props, forwardedRef) => {
|
|
14531
14674
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
14532
14675
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -14535,12 +14678,12 @@ var MenuContent = React58.forwardRef(
|
|
|
14535
14678
|
return /* @__PURE__ */ jsx$1(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx$1(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx$1(Collection2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx$1(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx$1(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
14536
14679
|
}
|
|
14537
14680
|
);
|
|
14538
|
-
var MenuRootContentModal =
|
|
14681
|
+
var MenuRootContentModal = React59.forwardRef(
|
|
14539
14682
|
(props, forwardedRef) => {
|
|
14540
14683
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
14541
|
-
const ref =
|
|
14684
|
+
const ref = React59.useRef(null);
|
|
14542
14685
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14543
|
-
|
|
14686
|
+
React59.useEffect(() => {
|
|
14544
14687
|
const content = ref.current;
|
|
14545
14688
|
if (content) return hideOthers(content);
|
|
14546
14689
|
}, []);
|
|
@@ -14562,7 +14705,7 @@ var MenuRootContentModal = React58.forwardRef(
|
|
|
14562
14705
|
);
|
|
14563
14706
|
}
|
|
14564
14707
|
);
|
|
14565
|
-
var MenuRootContentNonModal =
|
|
14708
|
+
var MenuRootContentNonModal = React59.forwardRef((props, forwardedRef) => {
|
|
14566
14709
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
14567
14710
|
return /* @__PURE__ */ jsx$1(
|
|
14568
14711
|
MenuContentImpl,
|
|
@@ -14577,7 +14720,7 @@ var MenuRootContentNonModal = React58.forwardRef((props, forwardedRef) => {
|
|
|
14577
14720
|
);
|
|
14578
14721
|
});
|
|
14579
14722
|
var Slot2 = createSlot("MenuContent.ScrollLock");
|
|
14580
|
-
var MenuContentImpl =
|
|
14723
|
+
var MenuContentImpl = React59.forwardRef(
|
|
14581
14724
|
(props, forwardedRef) => {
|
|
14582
14725
|
const {
|
|
14583
14726
|
__scopeMenu,
|
|
@@ -14600,16 +14743,16 @@ var MenuContentImpl = React58.forwardRef(
|
|
|
14600
14743
|
const popperScope = usePopperScope(__scopeMenu);
|
|
14601
14744
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
14602
14745
|
const getItems = useCollection2(__scopeMenu);
|
|
14603
|
-
const [currentItemId, setCurrentItemId] =
|
|
14604
|
-
const contentRef =
|
|
14746
|
+
const [currentItemId, setCurrentItemId] = React59.useState(null);
|
|
14747
|
+
const contentRef = React59.useRef(null);
|
|
14605
14748
|
const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
14606
|
-
const timerRef =
|
|
14607
|
-
const searchRef =
|
|
14608
|
-
const pointerGraceTimerRef =
|
|
14609
|
-
const pointerGraceIntentRef =
|
|
14610
|
-
const pointerDirRef =
|
|
14611
|
-
const lastPointerXRef =
|
|
14612
|
-
const ScrollLockWrapper = disableOutsideScroll ? Combination_default :
|
|
14749
|
+
const timerRef = React59.useRef(0);
|
|
14750
|
+
const searchRef = React59.useRef("");
|
|
14751
|
+
const pointerGraceTimerRef = React59.useRef(0);
|
|
14752
|
+
const pointerGraceIntentRef = React59.useRef(null);
|
|
14753
|
+
const pointerDirRef = React59.useRef("right");
|
|
14754
|
+
const lastPointerXRef = React59.useRef(0);
|
|
14755
|
+
const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React59.Fragment;
|
|
14613
14756
|
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot2, allowPinchZoom: true } : void 0;
|
|
14614
14757
|
const handleTypeaheadSearch = (key) => {
|
|
14615
14758
|
var _a2, _b;
|
|
@@ -14629,11 +14772,11 @@ var MenuContentImpl = React58.forwardRef(
|
|
|
14629
14772
|
setTimeout(() => newItem.focus());
|
|
14630
14773
|
}
|
|
14631
14774
|
};
|
|
14632
|
-
|
|
14775
|
+
React59.useEffect(() => {
|
|
14633
14776
|
return () => window.clearTimeout(timerRef.current);
|
|
14634
14777
|
}, []);
|
|
14635
14778
|
useFocusGuards();
|
|
14636
|
-
const isPointerMovingToSubmenu =
|
|
14779
|
+
const isPointerMovingToSubmenu = React59.useCallback((event) => {
|
|
14637
14780
|
var _a2, _b;
|
|
14638
14781
|
const isMovingTowards = pointerDirRef.current === ((_a2 = pointerGraceIntentRef.current) == null ? void 0 : _a2.side);
|
|
14639
14782
|
return isMovingTowards && isPointerInGraceArea(event, (_b = pointerGraceIntentRef.current) == null ? void 0 : _b.area);
|
|
@@ -14643,13 +14786,13 @@ var MenuContentImpl = React58.forwardRef(
|
|
|
14643
14786
|
{
|
|
14644
14787
|
scope: __scopeMenu,
|
|
14645
14788
|
searchRef,
|
|
14646
|
-
onItemEnter:
|
|
14789
|
+
onItemEnter: React59.useCallback(
|
|
14647
14790
|
(event) => {
|
|
14648
14791
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
14649
14792
|
},
|
|
14650
14793
|
[isPointerMovingToSubmenu]
|
|
14651
14794
|
),
|
|
14652
|
-
onItemLeave:
|
|
14795
|
+
onItemLeave: React59.useCallback(
|
|
14653
14796
|
(event) => {
|
|
14654
14797
|
var _a2;
|
|
14655
14798
|
if (isPointerMovingToSubmenu(event)) return;
|
|
@@ -14658,14 +14801,14 @@ var MenuContentImpl = React58.forwardRef(
|
|
|
14658
14801
|
},
|
|
14659
14802
|
[isPointerMovingToSubmenu]
|
|
14660
14803
|
),
|
|
14661
|
-
onTriggerLeave:
|
|
14804
|
+
onTriggerLeave: React59.useCallback(
|
|
14662
14805
|
(event) => {
|
|
14663
14806
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
14664
14807
|
},
|
|
14665
14808
|
[isPointerMovingToSubmenu]
|
|
14666
14809
|
),
|
|
14667
14810
|
pointerGraceTimerRef,
|
|
14668
|
-
onPointerGraceIntentChange:
|
|
14811
|
+
onPointerGraceIntentChange: React59.useCallback((intent) => {
|
|
14669
14812
|
pointerGraceIntentRef.current = intent;
|
|
14670
14813
|
}, []),
|
|
14671
14814
|
children: /* @__PURE__ */ jsx$1(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx$1(
|
|
@@ -14765,7 +14908,7 @@ var MenuContentImpl = React58.forwardRef(
|
|
|
14765
14908
|
);
|
|
14766
14909
|
MenuContent.displayName = CONTENT_NAME2;
|
|
14767
14910
|
var GROUP_NAME2 = "MenuGroup";
|
|
14768
|
-
var MenuGroup =
|
|
14911
|
+
var MenuGroup = React59.forwardRef(
|
|
14769
14912
|
(props, forwardedRef) => {
|
|
14770
14913
|
const { __scopeMenu, ...groupProps } = props;
|
|
14771
14914
|
return /* @__PURE__ */ jsx$1(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
@@ -14773,7 +14916,7 @@ var MenuGroup = React58.forwardRef(
|
|
|
14773
14916
|
);
|
|
14774
14917
|
MenuGroup.displayName = GROUP_NAME2;
|
|
14775
14918
|
var LABEL_NAME = "MenuLabel";
|
|
14776
|
-
var MenuLabel =
|
|
14919
|
+
var MenuLabel = React59.forwardRef(
|
|
14777
14920
|
(props, forwardedRef) => {
|
|
14778
14921
|
const { __scopeMenu, ...labelProps } = props;
|
|
14779
14922
|
return /* @__PURE__ */ jsx$1(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
@@ -14782,14 +14925,14 @@ var MenuLabel = React58.forwardRef(
|
|
|
14782
14925
|
MenuLabel.displayName = LABEL_NAME;
|
|
14783
14926
|
var ITEM_NAME2 = "MenuItem";
|
|
14784
14927
|
var ITEM_SELECT = "menu.itemSelect";
|
|
14785
|
-
var MenuItem =
|
|
14928
|
+
var MenuItem = React59.forwardRef(
|
|
14786
14929
|
(props, forwardedRef) => {
|
|
14787
14930
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
14788
|
-
const ref =
|
|
14931
|
+
const ref = React59.useRef(null);
|
|
14789
14932
|
const rootContext = useMenuRootContext(ITEM_NAME2, props.__scopeMenu);
|
|
14790
14933
|
const contentContext = useMenuContentContext(ITEM_NAME2, props.__scopeMenu);
|
|
14791
14934
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14792
|
-
const isPointerDownRef =
|
|
14935
|
+
const isPointerDownRef = React59.useRef(false);
|
|
14793
14936
|
const handleSelect = () => {
|
|
14794
14937
|
const menuItem = ref.current;
|
|
14795
14938
|
if (!disabled && menuItem) {
|
|
@@ -14832,16 +14975,16 @@ var MenuItem = React58.forwardRef(
|
|
|
14832
14975
|
}
|
|
14833
14976
|
);
|
|
14834
14977
|
MenuItem.displayName = ITEM_NAME2;
|
|
14835
|
-
var MenuItemImpl =
|
|
14978
|
+
var MenuItemImpl = React59.forwardRef(
|
|
14836
14979
|
(props, forwardedRef) => {
|
|
14837
14980
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
14838
14981
|
const contentContext = useMenuContentContext(ITEM_NAME2, __scopeMenu);
|
|
14839
14982
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
14840
|
-
const ref =
|
|
14983
|
+
const ref = React59.useRef(null);
|
|
14841
14984
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14842
|
-
const [isFocused, setIsFocused] =
|
|
14843
|
-
const [textContent, setTextContent] =
|
|
14844
|
-
|
|
14985
|
+
const [isFocused, setIsFocused] = React59.useState(false);
|
|
14986
|
+
const [textContent, setTextContent] = React59.useState("");
|
|
14987
|
+
React59.useEffect(() => {
|
|
14845
14988
|
var _a2;
|
|
14846
14989
|
const menuItem = ref.current;
|
|
14847
14990
|
if (menuItem) {
|
|
@@ -14890,7 +15033,7 @@ var MenuItemImpl = React58.forwardRef(
|
|
|
14890
15033
|
}
|
|
14891
15034
|
);
|
|
14892
15035
|
var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
14893
|
-
var MenuCheckboxItem =
|
|
15036
|
+
var MenuCheckboxItem = React59.forwardRef(
|
|
14894
15037
|
(props, forwardedRef) => {
|
|
14895
15038
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
14896
15039
|
return /* @__PURE__ */ jsx$1(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx$1(
|
|
@@ -14917,7 +15060,7 @@ var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
|
|
|
14917
15060
|
{ value: void 0, onValueChange: () => {
|
|
14918
15061
|
} }
|
|
14919
15062
|
);
|
|
14920
|
-
var MenuRadioGroup =
|
|
15063
|
+
var MenuRadioGroup = React59.forwardRef(
|
|
14921
15064
|
(props, forwardedRef) => {
|
|
14922
15065
|
const { value, onValueChange, ...groupProps } = props;
|
|
14923
15066
|
const handleValueChange = useCallbackRef(onValueChange);
|
|
@@ -14926,7 +15069,7 @@ var MenuRadioGroup = React58.forwardRef(
|
|
|
14926
15069
|
);
|
|
14927
15070
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
14928
15071
|
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
14929
|
-
var MenuRadioItem =
|
|
15072
|
+
var MenuRadioItem = React59.forwardRef(
|
|
14930
15073
|
(props, forwardedRef) => {
|
|
14931
15074
|
const { value, ...radioItemProps } = props;
|
|
14932
15075
|
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
@@ -14957,7 +15100,7 @@ var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
|
|
|
14957
15100
|
ITEM_INDICATOR_NAME,
|
|
14958
15101
|
{ checked: false }
|
|
14959
15102
|
);
|
|
14960
|
-
var MenuItemIndicator =
|
|
15103
|
+
var MenuItemIndicator = React59.forwardRef(
|
|
14961
15104
|
(props, forwardedRef) => {
|
|
14962
15105
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
14963
15106
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
@@ -14979,7 +15122,7 @@ var MenuItemIndicator = React58.forwardRef(
|
|
|
14979
15122
|
);
|
|
14980
15123
|
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
14981
15124
|
var SEPARATOR_NAME = "MenuSeparator";
|
|
14982
|
-
var MenuSeparator =
|
|
15125
|
+
var MenuSeparator = React59.forwardRef(
|
|
14983
15126
|
(props, forwardedRef) => {
|
|
14984
15127
|
const { __scopeMenu, ...separatorProps } = props;
|
|
14985
15128
|
return /* @__PURE__ */ jsx$1(
|
|
@@ -14995,7 +15138,7 @@ var MenuSeparator = React58.forwardRef(
|
|
|
14995
15138
|
);
|
|
14996
15139
|
MenuSeparator.displayName = SEPARATOR_NAME;
|
|
14997
15140
|
var ARROW_NAME2 = "MenuArrow";
|
|
14998
|
-
var MenuArrow =
|
|
15141
|
+
var MenuArrow = React59.forwardRef(
|
|
14999
15142
|
(props, forwardedRef) => {
|
|
15000
15143
|
const { __scopeMenu, ...arrowProps } = props;
|
|
15001
15144
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -15006,21 +15149,21 @@ MenuArrow.displayName = ARROW_NAME2;
|
|
|
15006
15149
|
var SUB_NAME = "MenuSub";
|
|
15007
15150
|
var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
|
|
15008
15151
|
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
15009
|
-
var MenuSubTrigger =
|
|
15152
|
+
var MenuSubTrigger = React59.forwardRef(
|
|
15010
15153
|
(props, forwardedRef) => {
|
|
15011
15154
|
const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15012
15155
|
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15013
15156
|
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15014
15157
|
const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15015
|
-
const openTimerRef =
|
|
15158
|
+
const openTimerRef = React59.useRef(null);
|
|
15016
15159
|
const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
|
|
15017
15160
|
const scope = { __scopeMenu: props.__scopeMenu };
|
|
15018
|
-
const clearOpenTimer =
|
|
15161
|
+
const clearOpenTimer = React59.useCallback(() => {
|
|
15019
15162
|
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
15020
15163
|
openTimerRef.current = null;
|
|
15021
15164
|
}, []);
|
|
15022
|
-
|
|
15023
|
-
|
|
15165
|
+
React59.useEffect(() => clearOpenTimer, [clearOpenTimer]);
|
|
15166
|
+
React59.useEffect(() => {
|
|
15024
15167
|
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
15025
15168
|
return () => {
|
|
15026
15169
|
window.clearTimeout(pointerGraceTimer);
|
|
@@ -15110,14 +15253,14 @@ var MenuSubTrigger = React58.forwardRef(
|
|
|
15110
15253
|
);
|
|
15111
15254
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
15112
15255
|
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
15113
|
-
var MenuSubContent =
|
|
15256
|
+
var MenuSubContent = React59.forwardRef(
|
|
15114
15257
|
(props, forwardedRef) => {
|
|
15115
15258
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
15116
15259
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
15117
15260
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
15118
15261
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
15119
15262
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
15120
|
-
const ref =
|
|
15263
|
+
const ref = React59.useRef(null);
|
|
15121
15264
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
15122
15265
|
return /* @__PURE__ */ jsx$1(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx$1(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx$1(Collection2.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx$1(
|
|
15123
15266
|
MenuContentImpl,
|
|
@@ -15235,7 +15378,7 @@ var [createDropdownMenuContext] = createContextScope(
|
|
|
15235
15378
|
var useMenuScope = createMenuScope();
|
|
15236
15379
|
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
15237
15380
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
15238
|
-
var DropdownMenuTrigger2 =
|
|
15381
|
+
var DropdownMenuTrigger2 = React59.forwardRef(
|
|
15239
15382
|
(props, forwardedRef) => {
|
|
15240
15383
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
15241
15384
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
@@ -15271,12 +15414,12 @@ var DropdownMenuTrigger2 = React58.forwardRef(
|
|
|
15271
15414
|
);
|
|
15272
15415
|
DropdownMenuTrigger2.displayName = TRIGGER_NAME;
|
|
15273
15416
|
var CONTENT_NAME3 = "DropdownMenuContent";
|
|
15274
|
-
var DropdownMenuContent2 =
|
|
15417
|
+
var DropdownMenuContent2 = React59.forwardRef(
|
|
15275
15418
|
(props, forwardedRef) => {
|
|
15276
15419
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
15277
15420
|
const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
|
|
15278
15421
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15279
|
-
const hasInteractedOutsideRef =
|
|
15422
|
+
const hasInteractedOutsideRef = React59.useRef(false);
|
|
15280
15423
|
return /* @__PURE__ */ jsx$1(
|
|
15281
15424
|
Content2,
|
|
15282
15425
|
{
|
|
@@ -15314,7 +15457,7 @@ var DropdownMenuContent2 = React58.forwardRef(
|
|
|
15314
15457
|
);
|
|
15315
15458
|
DropdownMenuContent2.displayName = CONTENT_NAME3;
|
|
15316
15459
|
var GROUP_NAME3 = "DropdownMenuGroup";
|
|
15317
|
-
var DropdownMenuGroup2 =
|
|
15460
|
+
var DropdownMenuGroup2 = React59.forwardRef(
|
|
15318
15461
|
(props, forwardedRef) => {
|
|
15319
15462
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
15320
15463
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15323,7 +15466,7 @@ var DropdownMenuGroup2 = React58.forwardRef(
|
|
|
15323
15466
|
);
|
|
15324
15467
|
DropdownMenuGroup2.displayName = GROUP_NAME3;
|
|
15325
15468
|
var LABEL_NAME2 = "DropdownMenuLabel";
|
|
15326
|
-
var DropdownMenuLabel2 =
|
|
15469
|
+
var DropdownMenuLabel2 = React59.forwardRef(
|
|
15327
15470
|
(props, forwardedRef) => {
|
|
15328
15471
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
15329
15472
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15332,7 +15475,7 @@ var DropdownMenuLabel2 = React58.forwardRef(
|
|
|
15332
15475
|
);
|
|
15333
15476
|
DropdownMenuLabel2.displayName = LABEL_NAME2;
|
|
15334
15477
|
var ITEM_NAME3 = "DropdownMenuItem";
|
|
15335
|
-
var DropdownMenuItem2 =
|
|
15478
|
+
var DropdownMenuItem2 = React59.forwardRef(
|
|
15336
15479
|
(props, forwardedRef) => {
|
|
15337
15480
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
15338
15481
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15341,42 +15484,42 @@ var DropdownMenuItem2 = React58.forwardRef(
|
|
|
15341
15484
|
);
|
|
15342
15485
|
DropdownMenuItem2.displayName = ITEM_NAME3;
|
|
15343
15486
|
var CHECKBOX_ITEM_NAME2 = "DropdownMenuCheckboxItem";
|
|
15344
|
-
var DropdownMenuCheckboxItem2 =
|
|
15487
|
+
var DropdownMenuCheckboxItem2 = React59.forwardRef((props, forwardedRef) => {
|
|
15345
15488
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
15346
15489
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15347
15490
|
return /* @__PURE__ */ jsx$1(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
15348
15491
|
});
|
|
15349
15492
|
DropdownMenuCheckboxItem2.displayName = CHECKBOX_ITEM_NAME2;
|
|
15350
15493
|
var RADIO_GROUP_NAME2 = "DropdownMenuRadioGroup";
|
|
15351
|
-
var DropdownMenuRadioGroup2 =
|
|
15494
|
+
var DropdownMenuRadioGroup2 = React59.forwardRef((props, forwardedRef) => {
|
|
15352
15495
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
15353
15496
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15354
15497
|
return /* @__PURE__ */ jsx$1(RadioGroup2, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
15355
15498
|
});
|
|
15356
15499
|
DropdownMenuRadioGroup2.displayName = RADIO_GROUP_NAME2;
|
|
15357
15500
|
var RADIO_ITEM_NAME2 = "DropdownMenuRadioItem";
|
|
15358
|
-
var DropdownMenuRadioItem2 =
|
|
15501
|
+
var DropdownMenuRadioItem2 = React59.forwardRef((props, forwardedRef) => {
|
|
15359
15502
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
15360
15503
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15361
15504
|
return /* @__PURE__ */ jsx$1(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
15362
15505
|
});
|
|
15363
15506
|
DropdownMenuRadioItem2.displayName = RADIO_ITEM_NAME2;
|
|
15364
15507
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
15365
|
-
var DropdownMenuItemIndicator =
|
|
15508
|
+
var DropdownMenuItemIndicator = React59.forwardRef((props, forwardedRef) => {
|
|
15366
15509
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
15367
15510
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15368
15511
|
return /* @__PURE__ */ jsx$1(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
15369
15512
|
});
|
|
15370
15513
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
15371
15514
|
var SEPARATOR_NAME2 = "DropdownMenuSeparator";
|
|
15372
|
-
var DropdownMenuSeparator2 =
|
|
15515
|
+
var DropdownMenuSeparator2 = React59.forwardRef((props, forwardedRef) => {
|
|
15373
15516
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
15374
15517
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15375
15518
|
return /* @__PURE__ */ jsx$1(Separator2, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
15376
15519
|
});
|
|
15377
15520
|
DropdownMenuSeparator2.displayName = SEPARATOR_NAME2;
|
|
15378
15521
|
var ARROW_NAME3 = "DropdownMenuArrow";
|
|
15379
|
-
var DropdownMenuArrow =
|
|
15522
|
+
var DropdownMenuArrow = React59.forwardRef(
|
|
15380
15523
|
(props, forwardedRef) => {
|
|
15381
15524
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
15382
15525
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15385,14 +15528,14 @@ var DropdownMenuArrow = React58.forwardRef(
|
|
|
15385
15528
|
);
|
|
15386
15529
|
DropdownMenuArrow.displayName = ARROW_NAME3;
|
|
15387
15530
|
var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
|
|
15388
|
-
var DropdownMenuSubTrigger2 =
|
|
15531
|
+
var DropdownMenuSubTrigger2 = React59.forwardRef((props, forwardedRef) => {
|
|
15389
15532
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
15390
15533
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15391
15534
|
return /* @__PURE__ */ jsx$1(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
15392
15535
|
});
|
|
15393
15536
|
DropdownMenuSubTrigger2.displayName = SUB_TRIGGER_NAME2;
|
|
15394
15537
|
var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
|
|
15395
|
-
var DropdownMenuSubContent2 =
|
|
15538
|
+
var DropdownMenuSubContent2 = React59.forwardRef((props, forwardedRef) => {
|
|
15396
15539
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
15397
15540
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15398
15541
|
return /* @__PURE__ */ jsx$1(
|
|
@@ -15618,27 +15761,27 @@ function DataGrid({
|
|
|
15618
15761
|
loading: loadingProp
|
|
15619
15762
|
}) {
|
|
15620
15763
|
var _a2, _b, _c;
|
|
15621
|
-
const normalizedRead =
|
|
15622
|
-
const initialBind =
|
|
15764
|
+
const normalizedRead = React59.useMemo(() => normalizeReadConfig(data.read), [data.read]);
|
|
15765
|
+
const initialBind = React59.useMemo(() => {
|
|
15623
15766
|
var _a3;
|
|
15624
15767
|
return (_a3 = data.bind) != null ? _a3 : [];
|
|
15625
15768
|
}, [data.bind]);
|
|
15626
15769
|
const resolvedPageSize = (_a2 = pageSize == null ? void 0 : pageSize.count) != null ? _a2 : defaultPageSize;
|
|
15627
15770
|
const pageSizeOptions = (_b = pageSize == null ? void 0 : pageSize.options) != null ? _b : [10, 20, 30, 40, 50];
|
|
15628
15771
|
const showPageSizeControl = (_c = pageSize == null ? void 0 : pageSize.visible) != null ? _c : true;
|
|
15629
|
-
const [rows, setRows] =
|
|
15630
|
-
const [isFetching, setIsFetching] =
|
|
15631
|
-
const [error, setError] =
|
|
15632
|
-
const scrollRef =
|
|
15633
|
-
const [scrollOffset, setScrollOffset] =
|
|
15634
|
-
const [viewportHeight, setViewportHeight] =
|
|
15635
|
-
const abortControllerRef =
|
|
15636
|
-
const [filterValue, setFilterValue] =
|
|
15637
|
-
const baseColumnDefs =
|
|
15772
|
+
const [rows, setRows] = React59.useState(() => initialBind);
|
|
15773
|
+
const [isFetching, setIsFetching] = React59.useState(false);
|
|
15774
|
+
const [error, setError] = React59.useState(null);
|
|
15775
|
+
const scrollRef = React59.useRef(null);
|
|
15776
|
+
const [scrollOffset, setScrollOffset] = React59.useState(0);
|
|
15777
|
+
const [viewportHeight, setViewportHeight] = React59.useState(height);
|
|
15778
|
+
const abortControllerRef = React59.useRef(null);
|
|
15779
|
+
const [filterValue, setFilterValue] = React59.useState("");
|
|
15780
|
+
const baseColumnDefs = React59.useMemo(
|
|
15638
15781
|
() => createColumnDefs(columns, sortable),
|
|
15639
15782
|
[columns, sortable]
|
|
15640
15783
|
);
|
|
15641
|
-
const columnDefs =
|
|
15784
|
+
const columnDefs = React59.useMemo(() => {
|
|
15642
15785
|
if (!selectable) {
|
|
15643
15786
|
return baseColumnDefs;
|
|
15644
15787
|
}
|
|
@@ -15672,8 +15815,8 @@ function DataGrid({
|
|
|
15672
15815
|
};
|
|
15673
15816
|
return [selectionColumn, ...baseColumnDefs];
|
|
15674
15817
|
}, [baseColumnDefs, selectable]);
|
|
15675
|
-
const filterableColumns =
|
|
15676
|
-
const filteredRows =
|
|
15818
|
+
const filterableColumns = React59.useMemo(() => columns.filter((column) => Boolean(column.item)), [columns]);
|
|
15819
|
+
const filteredRows = React59.useMemo(() => {
|
|
15677
15820
|
if (!filterable || !filterValue.trim()) {
|
|
15678
15821
|
return rows;
|
|
15679
15822
|
}
|
|
@@ -15695,26 +15838,26 @@ function DataGrid({
|
|
|
15695
15838
|
defaultPageSize: pagination ? resolvedPageSize : filteredRows.length || 10,
|
|
15696
15839
|
getRowId: (_row, index2) => index2.toString()
|
|
15697
15840
|
});
|
|
15698
|
-
|
|
15841
|
+
React59.useEffect(() => {
|
|
15699
15842
|
if (!pagination) {
|
|
15700
15843
|
table.setPageIndex(0);
|
|
15701
15844
|
table.setPageSize(filteredRows.length || 1);
|
|
15702
15845
|
}
|
|
15703
15846
|
}, [pagination, filteredRows.length, table]);
|
|
15704
|
-
|
|
15847
|
+
React59.useEffect(() => {
|
|
15705
15848
|
if (pagination) {
|
|
15706
15849
|
table.setPageSize(resolvedPageSize);
|
|
15707
15850
|
}
|
|
15708
15851
|
}, [pagination, resolvedPageSize, table]);
|
|
15709
|
-
|
|
15852
|
+
React59.useEffect(() => {
|
|
15710
15853
|
setRows(initialBind);
|
|
15711
15854
|
}, [initialBind]);
|
|
15712
|
-
|
|
15855
|
+
React59.useEffect(() => {
|
|
15713
15856
|
if (!filterable) {
|
|
15714
15857
|
setFilterValue("");
|
|
15715
15858
|
}
|
|
15716
15859
|
}, [filterable]);
|
|
15717
|
-
const fetchData =
|
|
15860
|
+
const fetchData = React59.useCallback(async () => {
|
|
15718
15861
|
var _a3, _b2;
|
|
15719
15862
|
if (!normalizedRead) {
|
|
15720
15863
|
return;
|
|
@@ -15760,7 +15903,7 @@ function DataGrid({
|
|
|
15760
15903
|
setIsFetching(false);
|
|
15761
15904
|
}
|
|
15762
15905
|
}, [normalizedRead, onDataChange]);
|
|
15763
|
-
|
|
15906
|
+
React59.useEffect(() => {
|
|
15764
15907
|
if (normalizedRead) {
|
|
15765
15908
|
fetchData().catch(() => {
|
|
15766
15909
|
});
|
|
@@ -15770,7 +15913,7 @@ function DataGrid({
|
|
|
15770
15913
|
(_a3 = abortControllerRef.current) == null ? void 0 : _a3.abort();
|
|
15771
15914
|
};
|
|
15772
15915
|
}, [normalizedRead, fetchData]);
|
|
15773
|
-
|
|
15916
|
+
React59.useEffect(() => {
|
|
15774
15917
|
if (!scrollRef.current) {
|
|
15775
15918
|
return;
|
|
15776
15919
|
}
|
|
@@ -15792,7 +15935,7 @@ function DataGrid({
|
|
|
15792
15935
|
const rowCount = tableRows.length;
|
|
15793
15936
|
const selectedCount = table.getFilteredSelectedRowModel().rows.length;
|
|
15794
15937
|
const totalFilteredCount = table.getFilteredRowModel().rows.length;
|
|
15795
|
-
|
|
15938
|
+
React59.useEffect(() => {
|
|
15796
15939
|
if (scrollRef.current) {
|
|
15797
15940
|
scrollRef.current.scrollTop = 0;
|
|
15798
15941
|
}
|
|
@@ -15804,7 +15947,7 @@ function DataGrid({
|
|
|
15804
15947
|
tableRows.length,
|
|
15805
15948
|
Math.ceil((scrollOffset + viewportHeight) / rowHeight) + overscan
|
|
15806
15949
|
);
|
|
15807
|
-
const virtualRows =
|
|
15950
|
+
const virtualRows = React59.useMemo(() => {
|
|
15808
15951
|
if (!tableRows.length) {
|
|
15809
15952
|
return null;
|
|
15810
15953
|
}
|
|
@@ -15887,7 +16030,7 @@ function DataGrid({
|
|
|
15887
16030
|
] });
|
|
15888
16031
|
}
|
|
15889
16032
|
DataGrid.displayName = "DataGrid";
|
|
15890
|
-
var FormBlock =
|
|
16033
|
+
var FormBlock = React59.forwardRef(
|
|
15891
16034
|
({ className, ...props }, ref) => {
|
|
15892
16035
|
return /* @__PURE__ */ jsx(
|
|
15893
16036
|
"div",
|
|
@@ -15900,7 +16043,7 @@ var FormBlock = React58.forwardRef(
|
|
|
15900
16043
|
}
|
|
15901
16044
|
);
|
|
15902
16045
|
FormBlock.displayName = "FormBlock";
|
|
15903
|
-
var FormError =
|
|
16046
|
+
var FormError = React59.forwardRef(
|
|
15904
16047
|
({ message, children, className, ...props }, ref) => {
|
|
15905
16048
|
if (!message && !children) {
|
|
15906
16049
|
return null;
|
|
@@ -15928,7 +16071,7 @@ var resolveFormLike2 = (form) => {
|
|
|
15928
16071
|
}
|
|
15929
16072
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
15930
16073
|
};
|
|
15931
|
-
var FormInput =
|
|
16074
|
+
var FormInput = React59.forwardRef(
|
|
15932
16075
|
({
|
|
15933
16076
|
label,
|
|
15934
16077
|
name,
|
|
@@ -16046,7 +16189,7 @@ var resolveFormLike3 = (form) => {
|
|
|
16046
16189
|
}
|
|
16047
16190
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16048
16191
|
};
|
|
16049
|
-
var FormInputMask =
|
|
16192
|
+
var FormInputMask = React59.forwardRef(
|
|
16050
16193
|
({
|
|
16051
16194
|
label,
|
|
16052
16195
|
name,
|
|
@@ -16161,7 +16304,7 @@ var resolveFormLike4 = (form) => {
|
|
|
16161
16304
|
}
|
|
16162
16305
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16163
16306
|
};
|
|
16164
|
-
var FormInputNumeric =
|
|
16307
|
+
var FormInputNumeric = React59.forwardRef(
|
|
16165
16308
|
({
|
|
16166
16309
|
label,
|
|
16167
16310
|
name,
|
|
@@ -16348,18 +16491,18 @@ function FormSelect({
|
|
|
16348
16491
|
title: multiContentPropTitle,
|
|
16349
16492
|
...restMultiContentProps
|
|
16350
16493
|
} = multiSelectContentProps;
|
|
16351
|
-
const [internalSingleValue, setInternalSingleValue] =
|
|
16494
|
+
const [internalSingleValue, setInternalSingleValue] = React59.useState(
|
|
16352
16495
|
typeof defaultValue === "string" ? defaultValue : ""
|
|
16353
16496
|
);
|
|
16354
|
-
const [internalMultiValue, setInternalMultiValue] =
|
|
16497
|
+
const [internalMultiValue, setInternalMultiValue] = React59.useState(
|
|
16355
16498
|
Array.isArray(defaultValue) ? defaultValue : []
|
|
16356
16499
|
);
|
|
16357
|
-
|
|
16500
|
+
React59.useEffect(() => {
|
|
16358
16501
|
if (typeof defaultValue === "string" && selectPropValue === void 0 && formValue === void 0 && value === void 0) {
|
|
16359
16502
|
setInternalSingleValue(defaultValue);
|
|
16360
16503
|
}
|
|
16361
16504
|
}, [defaultValue, formValue, selectPropValue, value]);
|
|
16362
|
-
|
|
16505
|
+
React59.useEffect(() => {
|
|
16363
16506
|
if (Array.isArray(defaultValue) && multiSelectPropValue === void 0 && !Array.isArray(formValue) && !Array.isArray(value)) {
|
|
16364
16507
|
setInternalMultiValue(defaultValue);
|
|
16365
16508
|
}
|
|
@@ -16367,7 +16510,7 @@ function FormSelect({
|
|
|
16367
16510
|
const finalSingleValue = typeof selectPropValue === "string" ? selectPropValue : typeof formValue === "string" ? formValue : typeof value === "string" ? value : internalSingleValue;
|
|
16368
16511
|
const finalMultiValue = Array.isArray(multiSelectPropValue) ? multiSelectPropValue : Array.isArray(formValue) ? formValue : Array.isArray(value) ? value : internalMultiValue;
|
|
16369
16512
|
const resolvedError = (_a2 = formTouched ? formError : void 0) != null ? _a2 : error;
|
|
16370
|
-
const handleFormChange =
|
|
16513
|
+
const handleFormChange = React59.useCallback(
|
|
16371
16514
|
(nextValue) => {
|
|
16372
16515
|
if (Array.isArray(nextValue)) {
|
|
16373
16516
|
formSetFieldValue == null ? void 0 : formSetFieldValue(name, nextValue);
|
|
@@ -16389,7 +16532,7 @@ function FormSelect({
|
|
|
16389
16532
|
},
|
|
16390
16533
|
[formHandleChange, formSetFieldValue, name]
|
|
16391
16534
|
);
|
|
16392
|
-
const handleSingleChange =
|
|
16535
|
+
const handleSingleChange = React59.useCallback(
|
|
16393
16536
|
(nextValue) => {
|
|
16394
16537
|
if (selectPropValue === void 0 && formValue === void 0 && value === void 0) {
|
|
16395
16538
|
setInternalSingleValue(nextValue);
|
|
@@ -16413,7 +16556,7 @@ function FormSelect({
|
|
|
16413
16556
|
name
|
|
16414
16557
|
]
|
|
16415
16558
|
);
|
|
16416
|
-
const handleMultiChange =
|
|
16559
|
+
const handleMultiChange = React59.useCallback(
|
|
16417
16560
|
(nextValue) => {
|
|
16418
16561
|
if (multiSelectPropValue === void 0 && !Array.isArray(formValue) && !Array.isArray(value)) {
|
|
16419
16562
|
setInternalMultiValue(nextValue);
|
|
@@ -16437,7 +16580,7 @@ function FormSelect({
|
|
|
16437
16580
|
name
|
|
16438
16581
|
]
|
|
16439
16582
|
);
|
|
16440
|
-
const handleBlur =
|
|
16583
|
+
const handleBlur = React59.useCallback(
|
|
16441
16584
|
(event) => {
|
|
16442
16585
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
16443
16586
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -16448,7 +16591,7 @@ function FormSelect({
|
|
|
16448
16591
|
},
|
|
16449
16592
|
[formHandleBlur, formSetFieldTouched, name, onBlur, triggerPropOnBlur]
|
|
16450
16593
|
);
|
|
16451
|
-
const handleMultiBlur =
|
|
16594
|
+
const handleMultiBlur = React59.useCallback(
|
|
16452
16595
|
(event) => {
|
|
16453
16596
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
16454
16597
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -16461,7 +16604,7 @@ function FormSelect({
|
|
|
16461
16604
|
);
|
|
16462
16605
|
const finalSingleDefaultValue = selectPropDefaultValue != null ? selectPropDefaultValue : typeof defaultValue === "string" ? defaultValue : void 0;
|
|
16463
16606
|
const finalMultiDefaultValue = multiSelectPropDefaultValue != null ? multiSelectPropDefaultValue : Array.isArray(defaultValue) ? defaultValue : void 0;
|
|
16464
|
-
const [mobileDrawerOpen, setMobileDrawerOpen] =
|
|
16607
|
+
const [mobileDrawerOpen, setMobileDrawerOpen] = React59.useState(false);
|
|
16465
16608
|
const MobileSelectTrigger = ({ isMulti: isMulti2 = false }) => {
|
|
16466
16609
|
var _a3;
|
|
16467
16610
|
const displayValue = isMulti2 ? finalMultiValue.length > 0 ? `${finalMultiValue.length} selected` : placeholder : ((_a3 = options.find((opt) => opt.value === finalSingleValue)) == null ? void 0 : _a3.label) || placeholder;
|
|
@@ -16625,7 +16768,7 @@ var resolveFormLike6 = (form) => {
|
|
|
16625
16768
|
}
|
|
16626
16769
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16627
16770
|
};
|
|
16628
|
-
var FormTextarea =
|
|
16771
|
+
var FormTextarea = React59.forwardRef(
|
|
16629
16772
|
({
|
|
16630
16773
|
label,
|
|
16631
16774
|
name,
|
|
@@ -16739,7 +16882,7 @@ var resolveFormLike7 = (form) => {
|
|
|
16739
16882
|
}
|
|
16740
16883
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16741
16884
|
};
|
|
16742
|
-
var FormRadioGroup =
|
|
16885
|
+
var FormRadioGroup = React59.forwardRef(
|
|
16743
16886
|
({
|
|
16744
16887
|
label,
|
|
16745
16888
|
description,
|
|
@@ -16778,7 +16921,7 @@ var FormRadioGroup = React58.forwardRef(
|
|
|
16778
16921
|
} = radioGroupProps;
|
|
16779
16922
|
const computedValue = (_b = value != null ? value : radioGroupValue !== void 0 ? radioGroupValue : void 0) != null ? _b : formValue !== void 0 && formValue !== null ? String(formValue) : void 0;
|
|
16780
16923
|
const resolvedDefaultValue = computedValue === void 0 ? defaultValue != null ? defaultValue : radioGroupDefaultValue : void 0;
|
|
16781
|
-
const handleChange =
|
|
16924
|
+
const handleChange = React59.useCallback(
|
|
16782
16925
|
(nextValue) => {
|
|
16783
16926
|
var _a3;
|
|
16784
16927
|
(_a3 = resolvedForm == null ? void 0 : resolvedForm.setFieldValue) == null ? void 0 : _a3.call(resolvedForm, name, nextValue);
|
|
@@ -16787,7 +16930,7 @@ var FormRadioGroup = React58.forwardRef(
|
|
|
16787
16930
|
},
|
|
16788
16931
|
[resolvedForm, name, onChange, radioGroupOnValueChange]
|
|
16789
16932
|
);
|
|
16790
|
-
const handleBlur =
|
|
16933
|
+
const handleBlur = React59.useCallback(
|
|
16791
16934
|
(event) => {
|
|
16792
16935
|
var _a3, _b2;
|
|
16793
16936
|
(_a3 = resolvedForm == null ? void 0 : resolvedForm.setFieldTouched) == null ? void 0 : _a3.call(resolvedForm, name, true);
|
|
@@ -16911,10 +17054,10 @@ function FormDatePicker({
|
|
|
16911
17054
|
status: datePickerPropStatus,
|
|
16912
17055
|
...restDatePickerProps
|
|
16913
17056
|
} = datePickerProps;
|
|
16914
|
-
const [internalValue, setInternalValue] =
|
|
17057
|
+
const [internalValue, setInternalValue] = React59.useState(
|
|
16915
17058
|
(_a2 = datePickerPropDefaultValue != null ? datePickerPropDefaultValue : defaultValue) != null ? _a2 : null
|
|
16916
17059
|
);
|
|
16917
|
-
|
|
17060
|
+
React59.useEffect(() => {
|
|
16918
17061
|
var _a3;
|
|
16919
17062
|
if (datePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
16920
17063
|
setInternalValue((_a3 = datePickerPropDefaultValue != null ? datePickerPropDefaultValue : defaultValue) != null ? _a3 : null);
|
|
@@ -16925,7 +17068,7 @@ function FormDatePicker({
|
|
|
16925
17068
|
const finalStatus = datePickerPropStatus != null ? datePickerPropStatus : resolvedError ? "error" : void 0;
|
|
16926
17069
|
const finalPlaceholder = datePickerPropPlaceholder != null ? datePickerPropPlaceholder : placeholder;
|
|
16927
17070
|
const { children: labelChildren, ...restLabelProps } = labelProps;
|
|
16928
|
-
const handleValueChange =
|
|
17071
|
+
const handleValueChange = React59.useCallback(
|
|
16929
17072
|
(nextValue, dateString) => {
|
|
16930
17073
|
if (datePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
16931
17074
|
setInternalValue(nextValue != null ? nextValue : null);
|
|
@@ -16957,7 +17100,7 @@ function FormDatePicker({
|
|
|
16957
17100
|
value
|
|
16958
17101
|
]
|
|
16959
17102
|
);
|
|
16960
|
-
const handleBlur =
|
|
17103
|
+
const handleBlur = React59.useCallback(
|
|
16961
17104
|
(event) => {
|
|
16962
17105
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
16963
17106
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -17066,10 +17209,10 @@ function FormTimePicker({
|
|
|
17066
17209
|
status: timePickerPropStatus,
|
|
17067
17210
|
...restTimePickerProps
|
|
17068
17211
|
} = timePickerProps;
|
|
17069
|
-
const [internalValue, setInternalValue] =
|
|
17212
|
+
const [internalValue, setInternalValue] = React59.useState(
|
|
17070
17213
|
(_a2 = timePickerPropDefaultValue != null ? timePickerPropDefaultValue : defaultValue) != null ? _a2 : null
|
|
17071
17214
|
);
|
|
17072
|
-
|
|
17215
|
+
React59.useEffect(() => {
|
|
17073
17216
|
var _a3;
|
|
17074
17217
|
if (timePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
17075
17218
|
setInternalValue((_a3 = timePickerPropDefaultValue != null ? timePickerPropDefaultValue : defaultValue) != null ? _a3 : null);
|
|
@@ -17080,7 +17223,7 @@ function FormTimePicker({
|
|
|
17080
17223
|
const finalStatus = timePickerPropStatus != null ? timePickerPropStatus : resolvedError ? "error" : void 0;
|
|
17081
17224
|
const finalPlaceholder = timePickerPropPlaceholder != null ? timePickerPropPlaceholder : placeholder;
|
|
17082
17225
|
const { children: labelChildren, ...restLabelProps } = labelProps;
|
|
17083
|
-
const handleValueChange =
|
|
17226
|
+
const handleValueChange = React59.useCallback(
|
|
17084
17227
|
(nextValue, formatted) => {
|
|
17085
17228
|
if (timePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
17086
17229
|
setInternalValue(nextValue != null ? nextValue : null);
|
|
@@ -17112,7 +17255,7 @@ function FormTimePicker({
|
|
|
17112
17255
|
value
|
|
17113
17256
|
]
|
|
17114
17257
|
);
|
|
17115
|
-
const handleBlur =
|
|
17258
|
+
const handleBlur = React59.useCallback(
|
|
17116
17259
|
(event) => {
|
|
17117
17260
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
17118
17261
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -17188,10 +17331,12 @@ var FormSwitch = ({
|
|
|
17188
17331
|
rules
|
|
17189
17332
|
}) => {
|
|
17190
17333
|
var _a2;
|
|
17191
|
-
const fallbackId =
|
|
17334
|
+
const fallbackId = React59.useId();
|
|
17192
17335
|
const {
|
|
17193
17336
|
id: providedId,
|
|
17194
17337
|
onCheckedChange: switchOnCheckedChange,
|
|
17338
|
+
className: switchClassName,
|
|
17339
|
+
disabled: switchDisabled,
|
|
17195
17340
|
"aria-describedby": ariaDescribedBy,
|
|
17196
17341
|
"aria-labelledby": ariaLabelledBy,
|
|
17197
17342
|
...restSwitchProps
|
|
@@ -17210,6 +17355,27 @@ var FormSwitch = ({
|
|
|
17210
17355
|
const messageId = resolvedError ? `${switchId}-error` : void 0;
|
|
17211
17356
|
const combinedAriaDescribedBy = [ariaDescribedBy, descriptionId, messageId].filter(Boolean).join(" ").trim() || void 0;
|
|
17212
17357
|
const computedAriaLabelledBy = label ? [ariaLabelledBy, `${switchId}-label`].filter(Boolean).join(" ").trim() || void 0 : ariaLabelledBy;
|
|
17358
|
+
const handleLabelClick = React59.useCallback(
|
|
17359
|
+
(event) => {
|
|
17360
|
+
if (switchDisabled) {
|
|
17361
|
+
return;
|
|
17362
|
+
}
|
|
17363
|
+
const switchElement = document.getElementById(switchId);
|
|
17364
|
+
if (!switchElement) {
|
|
17365
|
+
return;
|
|
17366
|
+
}
|
|
17367
|
+
event.preventDefault();
|
|
17368
|
+
if (typeof switchElement.focus === "function") {
|
|
17369
|
+
try {
|
|
17370
|
+
switchElement.focus({ preventScroll: true });
|
|
17371
|
+
} catch {
|
|
17372
|
+
switchElement.focus();
|
|
17373
|
+
}
|
|
17374
|
+
}
|
|
17375
|
+
switchElement.click();
|
|
17376
|
+
},
|
|
17377
|
+
[switchDisabled, switchId]
|
|
17378
|
+
);
|
|
17213
17379
|
const handleCheckedChange = (nextState) => {
|
|
17214
17380
|
var _a3, _b, _c;
|
|
17215
17381
|
const validationError = rules ? validateSwitch(nextState, rules) : void 0;
|
|
@@ -17227,7 +17393,19 @@ var FormSwitch = ({
|
|
|
17227
17393
|
};
|
|
17228
17394
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-start justify-between gap-4", className), children: [
|
|
17229
17395
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
17230
|
-
label ? /* @__PURE__ */ jsx(
|
|
17396
|
+
label ? /* @__PURE__ */ jsx(
|
|
17397
|
+
FormLabel,
|
|
17398
|
+
{
|
|
17399
|
+
id: `${switchId}-label`,
|
|
17400
|
+
htmlFor: switchId,
|
|
17401
|
+
onClick: handleLabelClick,
|
|
17402
|
+
className: cn(
|
|
17403
|
+
"text-sm leading-none font-medium",
|
|
17404
|
+
switchDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
17405
|
+
),
|
|
17406
|
+
children: label
|
|
17407
|
+
}
|
|
17408
|
+
) : null,
|
|
17231
17409
|
description ? /* @__PURE__ */ jsx(FormDescription, { id: descriptionId, children: description }) : null,
|
|
17232
17410
|
/* @__PURE__ */ jsx(FormMessage, { id: messageId, children: resolvedError })
|
|
17233
17411
|
] }),
|
|
@@ -17239,6 +17417,8 @@ var FormSwitch = ({
|
|
|
17239
17417
|
"aria-invalid": Boolean(resolvedError),
|
|
17240
17418
|
"aria-describedby": combinedAriaDescribedBy,
|
|
17241
17419
|
"aria-labelledby": computedAriaLabelledBy,
|
|
17420
|
+
className: cn("cursor-pointer", switchClassName),
|
|
17421
|
+
disabled: switchDisabled,
|
|
17242
17422
|
...restSwitchProps,
|
|
17243
17423
|
...fieldChecked !== void 0 ? { checked: fieldChecked } : { defaultChecked },
|
|
17244
17424
|
onCheckedChange: handleCheckedChange
|
|
@@ -17272,6 +17452,6 @@ var SIDEBAR_COLLAPSIBLE_VALUES = ["offcanvas", "icon", "none"];
|
|
|
17272
17452
|
var CONTENT_LAYOUT_VALUES = ["centered", "full-width"];
|
|
17273
17453
|
var NAVBAR_STYLE_VALUES = ["sticky", "scroll"];
|
|
17274
17454
|
|
|
17275
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CONTENT_LAYOUT_VALUES, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataGrid, DataTable, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DraggableRow, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FIELD_HEIGHT_MOBILE_CLASS, Flex, Form, FormBlock, FormCheckbox, FormDatePicker, FormError, FormInput, FormInputMask, FormInputNumeric, FormRadioGroup, FormSelect, FormSwitch, FormTextarea, FormTimePicker, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputMask, InputNumeric, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MobileFooter, MobileHeader, MobileHeaderProvider, MobileLayout, MobileSelectDrawer, MultiSelect, MultiSelectContent, MultiSelectItem, MultiSelectTrigger, MultiSelectValue, NAVBAR_STYLE_VALUES, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RouterProvider, SIDEBAR_COLLAPSIBLE_VALUES, SIDEBAR_VARIANT_VALUES, SafeArea, ScrollArea, ScrollBar, Select, SelectContent, SelectItem, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Switch, THEME_MODE_CHANGE_EVENT, THEME_MODE_STORAGE_KEY, THEME_MODE_VALUES, THEME_PRESET_OPTIONS, THEME_PRESET_VALUES, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, TimePicker, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, createStore, dragColumn, formatCurrency, getInitials, getMonitor, getThemeMode, initializeMonitoring, isNullOrEmpty, isThemeMode, mobileFooterVariantMeta, mobileFooterVariants, mobileHeaderVariantMeta, mobileHeaderVariants, navigationMenuTriggerStyle, redirect, resolveThemeMode, setThemeMode, showError, showInfo, showSonner, showSuccess, showWarning, toBool, toggleVariants, updateContentLayout, updateNavbarStyle, updateThemeMode, updateThemePreset, useDataTableInstance, useForm, useIsMobile, useMobileHeader, useMonitor, useNavigate, usePathname, useSidebar, useStore, useTheme, useThemeExtras, withDndColumn };
|
|
17455
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CONTENT_LAYOUT_VALUES, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataGrid, DataTable, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DraggableRow, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FIELD_HEIGHT_MOBILE_CLASS, Flex, Form, FormBlock, FormCheckbox, FormDatePicker, FormError, FormInput, FormInputMask, FormInputNumeric, FormRadioGroup, FormSelect, FormSwitch, FormTextarea, FormTimePicker, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputMask, InputNumeric, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MobileFooter, MobileHeader, MobileHeaderProvider, MobileLayout, MobileSelectDrawer, MultiSelect, MultiSelectContent, MultiSelectItem, MultiSelectTrigger, MultiSelectValue, NAVBAR_STYLE_VALUES, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RouterProvider, SIDEBAR_COLLAPSIBLE_VALUES, SIDEBAR_VARIANT_VALUES, SafeArea, ScrollArea, ScrollBar, Select, SelectContent, SelectItem, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Switch, THEME_MODE_CHANGE_EVENT, THEME_MODE_STORAGE_KEY, THEME_MODE_VALUES, THEME_PRESET_OPTIONS, THEME_PRESET_VALUES, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, TimePicker, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, __virtualKeyboardTesting, badgeVariants, buttonVariants, cn, createStore, detectVirtualKeyboardDevice, dragColumn, formatCurrency, getInitials, getMonitor, getThemeMode, initializeMonitoring, isNullOrEmpty, isThemeMode, maybeScrollElementIntoView, mobileFooterVariantMeta, mobileFooterVariants, mobileHeaderVariantMeta, mobileHeaderVariants, navigationMenuTriggerStyle, redirect, resolveThemeMode, setThemeMode, showError, showInfo, showSonner, showSuccess, showWarning, toBool, toggleVariants, updateContentLayout, updateNavbarStyle, updateThemeMode, updateThemePreset, useDataTableInstance, useForm, useIsMobile, useMobileHeader, useMonitor, useNavigate, usePathname, useSidebar, useStore, useTheme, useThemeExtras, withDndColumn };
|
|
17276
17456
|
//# sourceMappingURL=index.js.map
|
|
17277
17457
|
//# sourceMappingURL=index.js.map
|