@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.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React59 = require('react');
|
|
4
4
|
var lucideReact = require('lucide-react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var clsx = require('clsx');
|
|
@@ -44,7 +44,7 @@ function _interopNamespace(e) {
|
|
|
44
44
|
return Object.freeze(n);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var React59__namespace = /*#__PURE__*/_interopNamespace(React59);
|
|
48
48
|
var useEmblaCarousel__default = /*#__PURE__*/_interopDefault(useEmblaCarousel);
|
|
49
49
|
var RechartsPrimitive__namespace = /*#__PURE__*/_interopNamespace(RechartsPrimitive);
|
|
50
50
|
var ResizablePrimitive__namespace = /*#__PURE__*/_interopNamespace(ResizablePrimitive);
|
|
@@ -143,7 +143,7 @@ var jsx = (type, props, key) => jsxRuntime.jsx(type, sanitizeProps(type, props),
|
|
|
143
143
|
var jsxs = (type, props, key) => jsxRuntime.jsxs(type, sanitizeProps(type, props), key);
|
|
144
144
|
|
|
145
145
|
// src/lib/router.tsx
|
|
146
|
-
var RouterContext =
|
|
146
|
+
var RouterContext = React59.createContext(null);
|
|
147
147
|
var globalNavigate = null;
|
|
148
148
|
function getPathname() {
|
|
149
149
|
if (typeof window === "undefined") {
|
|
@@ -152,8 +152,8 @@ function getPathname() {
|
|
|
152
152
|
return window.location.pathname || "/";
|
|
153
153
|
}
|
|
154
154
|
function RouterProvider({ children }) {
|
|
155
|
-
const [pathname, setPathname] =
|
|
156
|
-
const navigate =
|
|
155
|
+
const [pathname, setPathname] = React59.useState(() => getPathname());
|
|
156
|
+
const navigate = React59.useCallback((path, options = {}) => {
|
|
157
157
|
if (typeof window === "undefined") {
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
@@ -164,7 +164,7 @@ function RouterProvider({ children }) {
|
|
|
164
164
|
}
|
|
165
165
|
setPathname(getPathname());
|
|
166
166
|
}, []);
|
|
167
|
-
|
|
167
|
+
React59.useEffect(() => {
|
|
168
168
|
globalNavigate = navigate;
|
|
169
169
|
const handlePopState = () => {
|
|
170
170
|
setPathname(getPathname());
|
|
@@ -177,21 +177,21 @@ function RouterProvider({ children }) {
|
|
|
177
177
|
}
|
|
178
178
|
};
|
|
179
179
|
}, [navigate]);
|
|
180
|
-
const value =
|
|
180
|
+
const value = React59.useMemo(
|
|
181
181
|
() => ({ pathname, navigate }),
|
|
182
182
|
[pathname, navigate]
|
|
183
183
|
);
|
|
184
184
|
return /* @__PURE__ */ jsx(RouterContext.Provider, { value, children });
|
|
185
185
|
}
|
|
186
186
|
function usePathname() {
|
|
187
|
-
const context =
|
|
187
|
+
const context = React59.useContext(RouterContext);
|
|
188
188
|
if (!context) {
|
|
189
189
|
throw new Error("usePathname must be used within a RouterProvider");
|
|
190
190
|
}
|
|
191
191
|
return context.pathname;
|
|
192
192
|
}
|
|
193
193
|
function useNavigate() {
|
|
194
|
-
const context =
|
|
194
|
+
const context = React59.useContext(RouterContext);
|
|
195
195
|
if (!context) {
|
|
196
196
|
throw new Error("useNavigate must be used within a RouterProvider");
|
|
197
197
|
}
|
|
@@ -370,7 +370,7 @@ function createStore(initializer) {
|
|
|
370
370
|
return { getState, setState, subscribe };
|
|
371
371
|
}
|
|
372
372
|
function useStore(store, selector) {
|
|
373
|
-
return
|
|
373
|
+
return React59.useSyncExternalStore(
|
|
374
374
|
(notify) => store.subscribe(() => notify()),
|
|
375
375
|
() => selector(store.getState()),
|
|
376
376
|
() => selector(store.getState())
|
|
@@ -379,6 +379,143 @@ function useStore(store, selector) {
|
|
|
379
379
|
|
|
380
380
|
// src/lib/constants.ts
|
|
381
381
|
var FIELD_HEIGHT_MOBILE_CLASS = "h-10 md:h-9";
|
|
382
|
+
|
|
383
|
+
// src/lib/virtual-keyboard.ts
|
|
384
|
+
var KEYBOARD_HEIGHT_THRESHOLD = 80;
|
|
385
|
+
var KEYBOARD_DETECTION_TIMEOUT = 600;
|
|
386
|
+
var isVirtualKeyboardLikelyDevice = false;
|
|
387
|
+
var hasAttemptedVirtualKeyboardDetection = false;
|
|
388
|
+
var pendingKeyboardDetection = null;
|
|
389
|
+
var isReducedMotionPreferred = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
390
|
+
var scrollElementIntoView = (element) => {
|
|
391
|
+
if (!element || typeof element.scrollIntoView !== "function") {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
const prefersReducedMotion = isReducedMotionPreferred();
|
|
395
|
+
const scroll = () => element.scrollIntoView({
|
|
396
|
+
behavior: prefersReducedMotion ? "auto" : "smooth",
|
|
397
|
+
block: "center",
|
|
398
|
+
inline: "nearest"
|
|
399
|
+
});
|
|
400
|
+
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
401
|
+
window.requestAnimationFrame(scroll);
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
scroll();
|
|
405
|
+
};
|
|
406
|
+
var getKeyboardOverlap = (viewport) => {
|
|
407
|
+
const windowHeight = typeof window !== "undefined" ? window.innerHeight : 0;
|
|
408
|
+
const overlap = windowHeight - viewport.height - viewport.offsetTop;
|
|
409
|
+
return Math.max(0, overlap);
|
|
410
|
+
};
|
|
411
|
+
var detectVirtualKeyboardDevice = () => {
|
|
412
|
+
if (isVirtualKeyboardLikelyDevice) {
|
|
413
|
+
return Promise.resolve(true);
|
|
414
|
+
}
|
|
415
|
+
if (hasAttemptedVirtualKeyboardDetection) {
|
|
416
|
+
return Promise.resolve(false);
|
|
417
|
+
}
|
|
418
|
+
if (typeof window === "undefined") {
|
|
419
|
+
hasAttemptedVirtualKeyboardDetection = true;
|
|
420
|
+
return Promise.resolve(false);
|
|
421
|
+
}
|
|
422
|
+
const viewport = window.visualViewport;
|
|
423
|
+
if (!viewport) {
|
|
424
|
+
hasAttemptedVirtualKeyboardDetection = true;
|
|
425
|
+
return Promise.resolve(false);
|
|
426
|
+
}
|
|
427
|
+
if (pendingKeyboardDetection) {
|
|
428
|
+
return pendingKeyboardDetection;
|
|
429
|
+
}
|
|
430
|
+
pendingKeyboardDetection = new Promise((resolve) => {
|
|
431
|
+
let resolved = false;
|
|
432
|
+
let timeoutId;
|
|
433
|
+
const finalize = (value) => {
|
|
434
|
+
if (resolved) {
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
resolved = true;
|
|
438
|
+
viewport.removeEventListener("resize", handleViewportChange);
|
|
439
|
+
viewport.removeEventListener("scroll", handleViewportChange);
|
|
440
|
+
if (typeof timeoutId === "number") {
|
|
441
|
+
window.clearTimeout(timeoutId);
|
|
442
|
+
}
|
|
443
|
+
if (value) {
|
|
444
|
+
isVirtualKeyboardLikelyDevice = true;
|
|
445
|
+
} else {
|
|
446
|
+
hasAttemptedVirtualKeyboardDetection = true;
|
|
447
|
+
}
|
|
448
|
+
resolve(value);
|
|
449
|
+
};
|
|
450
|
+
const handleViewportChange = () => {
|
|
451
|
+
const overlap = getKeyboardOverlap(viewport);
|
|
452
|
+
if (overlap > KEYBOARD_HEIGHT_THRESHOLD) {
|
|
453
|
+
finalize(true);
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
timeoutId = window.setTimeout(() => finalize(false), KEYBOARD_DETECTION_TIMEOUT);
|
|
457
|
+
handleViewportChange();
|
|
458
|
+
if (!resolved) {
|
|
459
|
+
viewport.addEventListener("resize", handleViewportChange, { passive: true });
|
|
460
|
+
viewport.addEventListener("scroll", handleViewportChange, { passive: true });
|
|
461
|
+
}
|
|
462
|
+
}).finally(() => {
|
|
463
|
+
pendingKeyboardDetection = null;
|
|
464
|
+
});
|
|
465
|
+
return pendingKeyboardDetection;
|
|
466
|
+
};
|
|
467
|
+
var isElementFullyVisibleWithinViewport = (element) => {
|
|
468
|
+
if (typeof window === "undefined") {
|
|
469
|
+
return true;
|
|
470
|
+
}
|
|
471
|
+
const rect = element.getBoundingClientRect();
|
|
472
|
+
const viewport = window.visualViewport;
|
|
473
|
+
if (!viewport) {
|
|
474
|
+
const viewportHeight = window.innerHeight || 0;
|
|
475
|
+
return rect.top >= 0 && rect.bottom <= viewportHeight;
|
|
476
|
+
}
|
|
477
|
+
const viewportTop = viewport.offsetTop;
|
|
478
|
+
const viewportBottom = viewportTop + viewport.height;
|
|
479
|
+
return rect.top >= viewportTop && rect.bottom <= viewportBottom;
|
|
480
|
+
};
|
|
481
|
+
var maybeScrollElementIntoView = (element) => {
|
|
482
|
+
if (!element) {
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
detectVirtualKeyboardDevice().then((keyboardDevice) => {
|
|
486
|
+
if (!keyboardDevice) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
if (typeof document !== "undefined" && document.activeElement !== element) {
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
if (!element.isConnected) {
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
if (isElementFullyVisibleWithinViewport(element)) {
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
const triggerScroll = () => scrollElementIntoView(element);
|
|
499
|
+
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
500
|
+
window.requestAnimationFrame(triggerScroll);
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
triggerScroll();
|
|
504
|
+
});
|
|
505
|
+
};
|
|
506
|
+
var __virtualKeyboardTesting = {
|
|
507
|
+
get isVirtualKeyboardLikelyDevice() {
|
|
508
|
+
return isVirtualKeyboardLikelyDevice;
|
|
509
|
+
},
|
|
510
|
+
get hasAttemptedVirtualKeyboardDetection() {
|
|
511
|
+
return hasAttemptedVirtualKeyboardDetection;
|
|
512
|
+
},
|
|
513
|
+
reset() {
|
|
514
|
+
isVirtualKeyboardLikelyDevice = false;
|
|
515
|
+
hasAttemptedVirtualKeyboardDetection = false;
|
|
516
|
+
pendingKeyboardDetection = null;
|
|
517
|
+
}
|
|
518
|
+
};
|
|
382
519
|
function useDataTableInstance({
|
|
383
520
|
data,
|
|
384
521
|
columns,
|
|
@@ -387,11 +524,11 @@ function useDataTableInstance({
|
|
|
387
524
|
defaultPageSize,
|
|
388
525
|
getRowId
|
|
389
526
|
}) {
|
|
390
|
-
const [rowSelection, setRowSelection] =
|
|
391
|
-
const [columnVisibility, setColumnVisibility] =
|
|
392
|
-
const [columnFilters, setColumnFilters] =
|
|
393
|
-
const [sorting, setSorting] =
|
|
394
|
-
const [pagination, setPagination] =
|
|
527
|
+
const [rowSelection, setRowSelection] = React59__namespace.useState({});
|
|
528
|
+
const [columnVisibility, setColumnVisibility] = React59__namespace.useState({});
|
|
529
|
+
const [columnFilters, setColumnFilters] = React59__namespace.useState([]);
|
|
530
|
+
const [sorting, setSorting] = React59__namespace.useState([]);
|
|
531
|
+
const [pagination, setPagination] = React59__namespace.useState({
|
|
395
532
|
pageIndex: defaultPageIndex != null ? defaultPageIndex : 0,
|
|
396
533
|
pageSize: defaultPageSize != null ? defaultPageSize : 10
|
|
397
534
|
});
|
|
@@ -558,7 +695,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
558
695
|
}
|
|
559
696
|
}
|
|
560
697
|
);
|
|
561
|
-
var Button =
|
|
698
|
+
var Button = React59__namespace.forwardRef(
|
|
562
699
|
({
|
|
563
700
|
className,
|
|
564
701
|
variant,
|
|
@@ -1059,8 +1196,8 @@ function CalendarDayButton({
|
|
|
1059
1196
|
...props
|
|
1060
1197
|
}) {
|
|
1061
1198
|
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
1062
|
-
const ref =
|
|
1063
|
-
|
|
1199
|
+
const ref = React59__namespace.useRef(null);
|
|
1200
|
+
React59__namespace.useEffect(() => {
|
|
1064
1201
|
var _a2;
|
|
1065
1202
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
1066
1203
|
}, [modifiers.focused]);
|
|
@@ -1165,9 +1302,9 @@ function CardFooter({ className, ...props }) {
|
|
|
1165
1302
|
}
|
|
1166
1303
|
);
|
|
1167
1304
|
}
|
|
1168
|
-
var CarouselContext =
|
|
1305
|
+
var CarouselContext = React59__namespace.createContext(null);
|
|
1169
1306
|
function useCarousel() {
|
|
1170
|
-
const context =
|
|
1307
|
+
const context = React59__namespace.useContext(CarouselContext);
|
|
1171
1308
|
if (!context) {
|
|
1172
1309
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
1173
1310
|
}
|
|
@@ -1189,20 +1326,20 @@ function Carousel({
|
|
|
1189
1326
|
},
|
|
1190
1327
|
plugins
|
|
1191
1328
|
);
|
|
1192
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
1193
|
-
const [canScrollNext, setCanScrollNext] =
|
|
1194
|
-
const onSelect =
|
|
1329
|
+
const [canScrollPrev, setCanScrollPrev] = React59__namespace.useState(false);
|
|
1330
|
+
const [canScrollNext, setCanScrollNext] = React59__namespace.useState(false);
|
|
1331
|
+
const onSelect = React59__namespace.useCallback((api2) => {
|
|
1195
1332
|
if (!api2) return;
|
|
1196
1333
|
setCanScrollPrev(api2.canScrollPrev());
|
|
1197
1334
|
setCanScrollNext(api2.canScrollNext());
|
|
1198
1335
|
}, []);
|
|
1199
|
-
const scrollPrev =
|
|
1336
|
+
const scrollPrev = React59__namespace.useCallback(() => {
|
|
1200
1337
|
api == null ? void 0 : api.scrollPrev();
|
|
1201
1338
|
}, [api]);
|
|
1202
|
-
const scrollNext =
|
|
1339
|
+
const scrollNext = React59__namespace.useCallback(() => {
|
|
1203
1340
|
api == null ? void 0 : api.scrollNext();
|
|
1204
1341
|
}, [api]);
|
|
1205
|
-
const handleKeyDown =
|
|
1342
|
+
const handleKeyDown = React59__namespace.useCallback(
|
|
1206
1343
|
(event) => {
|
|
1207
1344
|
if (event.key === "ArrowLeft") {
|
|
1208
1345
|
event.preventDefault();
|
|
@@ -1214,11 +1351,11 @@ function Carousel({
|
|
|
1214
1351
|
},
|
|
1215
1352
|
[scrollPrev, scrollNext]
|
|
1216
1353
|
);
|
|
1217
|
-
|
|
1354
|
+
React59__namespace.useEffect(() => {
|
|
1218
1355
|
if (!api || !setApi) return;
|
|
1219
1356
|
setApi(api);
|
|
1220
1357
|
}, [api, setApi]);
|
|
1221
|
-
|
|
1358
|
+
React59__namespace.useEffect(() => {
|
|
1222
1359
|
if (!api) return;
|
|
1223
1360
|
onSelect(api);
|
|
1224
1361
|
api.on("reInit", onSelect);
|
|
@@ -1351,9 +1488,9 @@ function CarouselNext({
|
|
|
1351
1488
|
);
|
|
1352
1489
|
}
|
|
1353
1490
|
var THEMES = { light: "", dark: ".dark" };
|
|
1354
|
-
var ChartContext =
|
|
1491
|
+
var ChartContext = React59__namespace.createContext(null);
|
|
1355
1492
|
function useChart() {
|
|
1356
|
-
const context =
|
|
1493
|
+
const context = React59__namespace.useContext(ChartContext);
|
|
1357
1494
|
if (!context) {
|
|
1358
1495
|
throw new Error("useChart must be used within a <ChartContainer />");
|
|
1359
1496
|
}
|
|
@@ -1366,7 +1503,7 @@ function ChartContainer({
|
|
|
1366
1503
|
config,
|
|
1367
1504
|
...props
|
|
1368
1505
|
}) {
|
|
1369
|
-
const uniqueId =
|
|
1506
|
+
const uniqueId = React59__namespace.useId();
|
|
1370
1507
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
1371
1508
|
return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
|
|
1372
1509
|
"div",
|
|
@@ -1428,7 +1565,7 @@ function ChartTooltipContent({
|
|
|
1428
1565
|
labelKey
|
|
1429
1566
|
}) {
|
|
1430
1567
|
const { config } = useChart();
|
|
1431
|
-
const tooltipLabel =
|
|
1568
|
+
const tooltipLabel = React59__namespace.useMemo(() => {
|
|
1432
1569
|
var _a2;
|
|
1433
1570
|
if (hideLabel || !(payload == null ? void 0 : payload.length)) {
|
|
1434
1571
|
return null;
|
|
@@ -1582,7 +1719,7 @@ function getPayloadConfigFromPayload(config, payload, key) {
|
|
|
1582
1719
|
}
|
|
1583
1720
|
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
1584
1721
|
}
|
|
1585
|
-
var Checkbox =
|
|
1722
|
+
var Checkbox = React59__namespace.forwardRef(function Checkbox2({ className, ...props }, ref) {
|
|
1586
1723
|
return /* @__PURE__ */ jsx(
|
|
1587
1724
|
radixUi.Checkbox.Root,
|
|
1588
1725
|
{
|
|
@@ -2287,7 +2424,7 @@ function sanitizeErrors(errors) {
|
|
|
2287
2424
|
}, {});
|
|
2288
2425
|
}
|
|
2289
2426
|
function useForm(config) {
|
|
2290
|
-
const [state, setState] =
|
|
2427
|
+
const [state, setState] = React59.useState({
|
|
2291
2428
|
values: config.initialValues,
|
|
2292
2429
|
errors: {},
|
|
2293
2430
|
fieldErrors: {},
|
|
@@ -2295,7 +2432,7 @@ function useForm(config) {
|
|
|
2295
2432
|
isSubmitting: false,
|
|
2296
2433
|
isValid: false
|
|
2297
2434
|
});
|
|
2298
|
-
const validateForm =
|
|
2435
|
+
const validateForm = React59.useCallback((values = state.values) => {
|
|
2299
2436
|
const validationErrors = config.validate ? config.validate(values) : {};
|
|
2300
2437
|
const mergedErrors = sanitizeErrors({
|
|
2301
2438
|
...validationErrors,
|
|
@@ -2309,7 +2446,7 @@ function useForm(config) {
|
|
|
2309
2446
|
}));
|
|
2310
2447
|
return isValid;
|
|
2311
2448
|
}, [config.validate, state.fieldErrors, state.values]);
|
|
2312
|
-
const setFieldValue =
|
|
2449
|
+
const setFieldValue = React59.useCallback((field, value) => {
|
|
2313
2450
|
setState((prev) => {
|
|
2314
2451
|
const newValues = { ...prev.values, [field]: value };
|
|
2315
2452
|
const newFieldErrors = { ...prev.fieldErrors };
|
|
@@ -2329,13 +2466,13 @@ function useForm(config) {
|
|
|
2329
2466
|
};
|
|
2330
2467
|
});
|
|
2331
2468
|
}, [config.validate]);
|
|
2332
|
-
const setFieldTouched =
|
|
2469
|
+
const setFieldTouched = React59.useCallback((field, touched = true) => {
|
|
2333
2470
|
setState((prev) => ({
|
|
2334
2471
|
...prev,
|
|
2335
2472
|
touched: { ...prev.touched, [field]: touched }
|
|
2336
2473
|
}));
|
|
2337
2474
|
}, []);
|
|
2338
|
-
const setFieldError =
|
|
2475
|
+
const setFieldError = React59.useCallback((field, error) => {
|
|
2339
2476
|
setState((prev) => {
|
|
2340
2477
|
const newFieldErrors = { ...prev.fieldErrors };
|
|
2341
2478
|
if (error) {
|
|
@@ -2357,16 +2494,16 @@ function useForm(config) {
|
|
|
2357
2494
|
};
|
|
2358
2495
|
});
|
|
2359
2496
|
}, [config.validate]);
|
|
2360
|
-
const handleChange =
|
|
2497
|
+
const handleChange = React59.useCallback((e) => {
|
|
2361
2498
|
const { name, value } = e.target;
|
|
2362
2499
|
setFieldValue(name, value);
|
|
2363
2500
|
}, [setFieldValue]);
|
|
2364
|
-
const handleBlur =
|
|
2501
|
+
const handleBlur = React59.useCallback((e) => {
|
|
2365
2502
|
const { name } = e.target;
|
|
2366
2503
|
setFieldTouched(name, true);
|
|
2367
2504
|
validateForm();
|
|
2368
2505
|
}, [setFieldTouched, validateForm]);
|
|
2369
|
-
const handleSubmit =
|
|
2506
|
+
const handleSubmit = React59.useCallback(async (e) => {
|
|
2370
2507
|
if (e) {
|
|
2371
2508
|
e.preventDefault();
|
|
2372
2509
|
e.stopPropagation();
|
|
@@ -2395,7 +2532,7 @@ function useForm(config) {
|
|
|
2395
2532
|
setState((prev) => ({ ...prev, isSubmitting: false }));
|
|
2396
2533
|
}
|
|
2397
2534
|
}, [config.onSubmit, validateForm, state.values]);
|
|
2398
|
-
const resetForm =
|
|
2535
|
+
const resetForm = React59.useCallback(() => {
|
|
2399
2536
|
setState({
|
|
2400
2537
|
values: config.initialValues,
|
|
2401
2538
|
errors: {},
|
|
@@ -2456,8 +2593,8 @@ function getIsMobile() {
|
|
|
2456
2593
|
return widthMatch || uaMatch || userAgentDataMobile;
|
|
2457
2594
|
}
|
|
2458
2595
|
function useIsMobile() {
|
|
2459
|
-
const [isMobile, setIsMobile] =
|
|
2460
|
-
|
|
2596
|
+
const [isMobile, setIsMobile] = React59__namespace.useState(() => getIsMobile());
|
|
2597
|
+
React59__namespace.useEffect(() => {
|
|
2461
2598
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
2462
2599
|
const onChange = () => {
|
|
2463
2600
|
setIsMobile(getIsMobile());
|
|
@@ -2490,11 +2627,11 @@ var createDefaultState = (initialState) => ({
|
|
|
2490
2627
|
...initialState
|
|
2491
2628
|
});
|
|
2492
2629
|
var useMobileHeaderState = (initialState) => {
|
|
2493
|
-
const defaultState =
|
|
2494
|
-
const [navigationStack, setNavigationStack] =
|
|
2630
|
+
const defaultState = React59.useMemo(() => createDefaultState(initialState), [initialState]);
|
|
2631
|
+
const [navigationStack, setNavigationStack] = React59.useState([defaultState]);
|
|
2495
2632
|
const currentState = navigationStack[navigationStack.length - 1];
|
|
2496
2633
|
const canGoBack = navigationStack.length > 1;
|
|
2497
|
-
const setHeader =
|
|
2634
|
+
const setHeader = React59.useCallback(
|
|
2498
2635
|
(state) => {
|
|
2499
2636
|
setNavigationStack((prev) => {
|
|
2500
2637
|
const newStack = [...prev];
|
|
@@ -2505,15 +2642,15 @@ var useMobileHeaderState = (initialState) => {
|
|
|
2505
2642
|
},
|
|
2506
2643
|
[defaultState]
|
|
2507
2644
|
);
|
|
2508
|
-
const navigateTo =
|
|
2645
|
+
const navigateTo = React59.useCallback((state) => {
|
|
2509
2646
|
setNavigationStack((prev) => [...prev, { ...defaultState, ...state }]);
|
|
2510
2647
|
}, [defaultState]);
|
|
2511
|
-
const navigateBack =
|
|
2648
|
+
const navigateBack = React59.useCallback(() => {
|
|
2512
2649
|
if (canGoBack) {
|
|
2513
2650
|
setNavigationStack((prev) => prev.slice(0, -1));
|
|
2514
2651
|
}
|
|
2515
2652
|
}, [canGoBack]);
|
|
2516
|
-
const resetNavigation =
|
|
2653
|
+
const resetNavigation = React59.useCallback(
|
|
2517
2654
|
(initialState2) => {
|
|
2518
2655
|
setNavigationStack([createDefaultState(initialState2 != null ? initialState2 : defaultState)]);
|
|
2519
2656
|
},
|
|
@@ -2533,7 +2670,7 @@ var useMobileHeaderState = (initialState) => {
|
|
|
2533
2670
|
var getMobileHeaderContext = () => {
|
|
2534
2671
|
const globalObject = globalThis;
|
|
2535
2672
|
if (!globalObject.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__) {
|
|
2536
|
-
globalObject.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__ =
|
|
2673
|
+
globalObject.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__ = React59.createContext(null);
|
|
2537
2674
|
}
|
|
2538
2675
|
return globalObject.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__;
|
|
2539
2676
|
};
|
|
@@ -2543,7 +2680,7 @@ var MobileHeaderProvider = ({ initialState, children }) => {
|
|
|
2543
2680
|
return /* @__PURE__ */ jsx(MobileHeaderContext.Provider, { value, children });
|
|
2544
2681
|
};
|
|
2545
2682
|
var useMobileHeader = (initialState) => {
|
|
2546
|
-
const context =
|
|
2683
|
+
const context = React59.useContext(MobileHeaderContext);
|
|
2547
2684
|
if (context) {
|
|
2548
2685
|
return context;
|
|
2549
2686
|
}
|
|
@@ -2633,11 +2770,11 @@ var registerNavigationListeners = (onStart, onComplete) => {
|
|
|
2633
2770
|
};
|
|
2634
2771
|
};
|
|
2635
2772
|
var RouteProgressBar = ({ color, framework }) => {
|
|
2636
|
-
const [isActive, setIsActive] =
|
|
2637
|
-
const [progress, setProgress] =
|
|
2638
|
-
const animationTimeoutRef =
|
|
2639
|
-
const hideTimeoutRef =
|
|
2640
|
-
const start =
|
|
2773
|
+
const [isActive, setIsActive] = React59.useState(false);
|
|
2774
|
+
const [progress, setProgress] = React59.useState(0);
|
|
2775
|
+
const animationTimeoutRef = React59.useRef(null);
|
|
2776
|
+
const hideTimeoutRef = React59.useRef(null);
|
|
2777
|
+
const start = React59.useCallback(() => {
|
|
2641
2778
|
if (hideTimeoutRef.current) {
|
|
2642
2779
|
window.clearTimeout(hideTimeoutRef.current);
|
|
2643
2780
|
hideTimeoutRef.current = null;
|
|
@@ -2645,7 +2782,7 @@ var RouteProgressBar = ({ color, framework }) => {
|
|
|
2645
2782
|
setIsActive(true);
|
|
2646
2783
|
setProgress((current) => current > 0 && current < 0.2 ? current : 0.2);
|
|
2647
2784
|
}, []);
|
|
2648
|
-
const complete =
|
|
2785
|
+
const complete = React59.useCallback(() => {
|
|
2649
2786
|
if (!isActive) {
|
|
2650
2787
|
return;
|
|
2651
2788
|
}
|
|
@@ -2659,14 +2796,14 @@ var RouteProgressBar = ({ color, framework }) => {
|
|
|
2659
2796
|
setProgress(0);
|
|
2660
2797
|
}, 200);
|
|
2661
2798
|
}, [isActive]);
|
|
2662
|
-
|
|
2799
|
+
React59.useEffect(() => {
|
|
2663
2800
|
if (typeof window === "undefined") {
|
|
2664
2801
|
return () => {
|
|
2665
2802
|
};
|
|
2666
2803
|
}
|
|
2667
2804
|
return registerNavigationListeners(start, complete);
|
|
2668
2805
|
}, [start, complete, framework]);
|
|
2669
|
-
|
|
2806
|
+
React59.useEffect(() => {
|
|
2670
2807
|
if (!isActive) {
|
|
2671
2808
|
if (animationTimeoutRef.current) {
|
|
2672
2809
|
window.clearTimeout(animationTimeoutRef.current);
|
|
@@ -2692,7 +2829,7 @@ var RouteProgressBar = ({ color, framework }) => {
|
|
|
2692
2829
|
}
|
|
2693
2830
|
};
|
|
2694
2831
|
}, [isActive]);
|
|
2695
|
-
|
|
2832
|
+
React59.useEffect(() => {
|
|
2696
2833
|
return () => {
|
|
2697
2834
|
if (animationTimeoutRef.current) {
|
|
2698
2835
|
window.clearTimeout(animationTimeoutRef.current);
|
|
@@ -2702,7 +2839,7 @@ var RouteProgressBar = ({ color, framework }) => {
|
|
|
2702
2839
|
}
|
|
2703
2840
|
};
|
|
2704
2841
|
}, []);
|
|
2705
|
-
const styles =
|
|
2842
|
+
const styles = React59.useMemo(() => ({
|
|
2706
2843
|
position: "fixed",
|
|
2707
2844
|
top: 0,
|
|
2708
2845
|
left: 0,
|
|
@@ -3303,8 +3440,8 @@ var initializeMonitoring = (options) => {
|
|
|
3303
3440
|
};
|
|
3304
3441
|
var getMonitor = () => getMonitoringInstance().api;
|
|
3305
3442
|
var useMonitor = (options) => {
|
|
3306
|
-
const optionsRef =
|
|
3307
|
-
|
|
3443
|
+
const optionsRef = React59__namespace.useRef();
|
|
3444
|
+
React59__namespace.useEffect(() => {
|
|
3308
3445
|
if (!options) {
|
|
3309
3446
|
return;
|
|
3310
3447
|
}
|
|
@@ -3316,7 +3453,7 @@ var useMonitor = (options) => {
|
|
|
3316
3453
|
initializeMonitoring(options);
|
|
3317
3454
|
}
|
|
3318
3455
|
}, [options]);
|
|
3319
|
-
return
|
|
3456
|
+
return React59__namespace.useMemo(() => getMonitor(), []);
|
|
3320
3457
|
};
|
|
3321
3458
|
function showSonner(message, type = "info", options) {
|
|
3322
3459
|
const { title, description, duration = 4e3, action } = options || {};
|
|
@@ -3363,7 +3500,7 @@ var showWarning = (message, options) => showSonner(message, "warning", options);
|
|
|
3363
3500
|
var showInfo = (message, options) => showSonner(message, "info", options);
|
|
3364
3501
|
|
|
3365
3502
|
// src/providers/theme-provider.tsx
|
|
3366
|
-
var ThemeContext =
|
|
3503
|
+
var ThemeContext = React59.createContext(void 0);
|
|
3367
3504
|
var DEFAULT_EXTRAS = {
|
|
3368
3505
|
enabled: false,
|
|
3369
3506
|
framework: "auto",
|
|
@@ -3450,29 +3587,29 @@ var ThemeProvider = ({
|
|
|
3450
3587
|
siderbar
|
|
3451
3588
|
}) => {
|
|
3452
3589
|
var _a2, _b, _c, _d, _e;
|
|
3453
|
-
const [isNativeApp, setIsNativeApp] =
|
|
3590
|
+
const [isNativeApp, setIsNativeApp] = React59.useState(Boolean(nativeApp));
|
|
3454
3591
|
const isMobile = useIsMobile();
|
|
3455
|
-
const extrasToken =
|
|
3456
|
-
const resolvedExtras =
|
|
3592
|
+
const extrasToken = React59.useMemo(() => createThemeExtrasToken(), []);
|
|
3593
|
+
const resolvedExtras = React59.useMemo(() => {
|
|
3457
3594
|
const runtimeExtras = resolveExtras(extras);
|
|
3458
3595
|
setThemeExtrasRuntime(extrasToken, runtimeExtras);
|
|
3459
3596
|
return runtimeExtras;
|
|
3460
3597
|
}, [extras, extrasToken]);
|
|
3461
|
-
const monitoringConfig =
|
|
3598
|
+
const monitoringConfig = React59.useMemo(() => {
|
|
3462
3599
|
if (!monitoring) {
|
|
3463
3600
|
return { enable: false };
|
|
3464
3601
|
}
|
|
3465
3602
|
return monitoring;
|
|
3466
3603
|
}, [monitoring]);
|
|
3467
|
-
|
|
3604
|
+
React59.useEffect(() => {
|
|
3468
3605
|
initializeMonitoring(monitoringConfig);
|
|
3469
3606
|
}, [monitoringConfig]);
|
|
3470
|
-
|
|
3607
|
+
React59.useEffect(() => {
|
|
3471
3608
|
return () => {
|
|
3472
3609
|
resetThemeExtrasRuntime(extrasToken);
|
|
3473
3610
|
};
|
|
3474
3611
|
}, [extrasToken]);
|
|
3475
|
-
|
|
3612
|
+
React59.useEffect(() => {
|
|
3476
3613
|
setIsNativeApp(Boolean(nativeApp));
|
|
3477
3614
|
}, [nativeApp]);
|
|
3478
3615
|
const getInitialThemeMode = () => {
|
|
@@ -3486,16 +3623,16 @@ var ThemeProvider = ({
|
|
|
3486
3623
|
}
|
|
3487
3624
|
return defaultTheme === "system" ? "auto" : defaultTheme;
|
|
3488
3625
|
};
|
|
3489
|
-
const [themeMode, setThemeModeState] =
|
|
3490
|
-
const [resolvedThemeMode, setResolvedThemeMode] =
|
|
3626
|
+
const [themeMode, setThemeModeState] = React59.useState(() => getInitialThemeMode());
|
|
3627
|
+
const [resolvedThemeMode, setResolvedThemeMode] = React59.useState(
|
|
3491
3628
|
() => resolveThemeMode(getInitialThemeMode())
|
|
3492
3629
|
);
|
|
3493
|
-
const [nativeOverlayContainer, setNativeOverlayContainerState] =
|
|
3494
|
-
|
|
3630
|
+
const [nativeOverlayContainer, setNativeOverlayContainerState] = React59.useState(null);
|
|
3631
|
+
React59.useEffect(() => {
|
|
3495
3632
|
setResolvedThemeMode(resolveThemeMode(themeMode));
|
|
3496
3633
|
setThemeMode(themeMode);
|
|
3497
3634
|
}, [themeMode]);
|
|
3498
|
-
|
|
3635
|
+
React59.useEffect(() => {
|
|
3499
3636
|
var _a3;
|
|
3500
3637
|
if (typeof window === "undefined") {
|
|
3501
3638
|
return;
|
|
@@ -3507,7 +3644,7 @@ var ThemeProvider = ({
|
|
|
3507
3644
|
const nextTheme = defaultTheme === "system" ? "auto" : defaultTheme;
|
|
3508
3645
|
setThemeModeState((prev) => prev === nextTheme ? prev : nextTheme);
|
|
3509
3646
|
}, [defaultTheme]);
|
|
3510
|
-
|
|
3647
|
+
React59.useEffect(() => {
|
|
3511
3648
|
if (typeof window === "undefined" || themeMode !== "auto") {
|
|
3512
3649
|
return;
|
|
3513
3650
|
}
|
|
@@ -3523,7 +3660,7 @@ var ThemeProvider = ({
|
|
|
3523
3660
|
mediaQuery.addEventListener("change", handleChange);
|
|
3524
3661
|
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
3525
3662
|
}, [themeMode]);
|
|
3526
|
-
|
|
3663
|
+
React59.useEffect(() => {
|
|
3527
3664
|
if (typeof window === "undefined") {
|
|
3528
3665
|
return;
|
|
3529
3666
|
}
|
|
@@ -3537,7 +3674,7 @@ var ThemeProvider = ({
|
|
|
3537
3674
|
window.addEventListener(THEME_MODE_CHANGE_EVENT, handleThemeModeChange);
|
|
3538
3675
|
return () => window.removeEventListener(THEME_MODE_CHANGE_EVENT, handleThemeModeChange);
|
|
3539
3676
|
}, []);
|
|
3540
|
-
|
|
3677
|
+
React59.useEffect(() => {
|
|
3541
3678
|
if (typeof window === "undefined") {
|
|
3542
3679
|
return;
|
|
3543
3680
|
}
|
|
@@ -3555,7 +3692,7 @@ var ThemeProvider = ({
|
|
|
3555
3692
|
return () => window.removeEventListener("storage", handleStorage);
|
|
3556
3693
|
}, []);
|
|
3557
3694
|
const isDarkMode = resolvedThemeMode === "dark";
|
|
3558
|
-
|
|
3695
|
+
React59.useEffect(() => {
|
|
3559
3696
|
if (typeof document === "undefined") {
|
|
3560
3697
|
return;
|
|
3561
3698
|
}
|
|
@@ -3565,7 +3702,7 @@ var ThemeProvider = ({
|
|
|
3565
3702
|
}, [resolvedExtras]);
|
|
3566
3703
|
const isNativeLike = isNativeApp;
|
|
3567
3704
|
const shouldAutoScroll = isNativeLike || isMobile;
|
|
3568
|
-
|
|
3705
|
+
React59.useEffect(() => {
|
|
3569
3706
|
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
3570
3707
|
return;
|
|
3571
3708
|
}
|
|
@@ -3596,7 +3733,7 @@ var ThemeProvider = ({
|
|
|
3596
3733
|
const horizontallyVisible = rect.left >= 0 && rect.right <= viewWidth;
|
|
3597
3734
|
return verticallyVisible && horizontallyVisible;
|
|
3598
3735
|
};
|
|
3599
|
-
const
|
|
3736
|
+
const scrollElementIntoView2 = (element) => {
|
|
3600
3737
|
window.setTimeout(() => {
|
|
3601
3738
|
if (!isElementInViewport(element)) {
|
|
3602
3739
|
element.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" });
|
|
@@ -3621,7 +3758,7 @@ var ThemeProvider = ({
|
|
|
3621
3758
|
if (!element) {
|
|
3622
3759
|
return;
|
|
3623
3760
|
}
|
|
3624
|
-
|
|
3761
|
+
scrollElementIntoView2(element);
|
|
3625
3762
|
};
|
|
3626
3763
|
const handlePointerDown = (event) => {
|
|
3627
3764
|
if (event.pointerType && event.pointerType !== "touch" && event.pointerType !== "pen") {
|
|
@@ -3631,7 +3768,7 @@ var ThemeProvider = ({
|
|
|
3631
3768
|
if (!element) {
|
|
3632
3769
|
return;
|
|
3633
3770
|
}
|
|
3634
|
-
|
|
3771
|
+
scrollElementIntoView2(element);
|
|
3635
3772
|
};
|
|
3636
3773
|
document.addEventListener("focusin", handleFocus, true);
|
|
3637
3774
|
document.addEventListener("pointerdown", handlePointerDown, true);
|
|
@@ -3640,19 +3777,19 @@ var ThemeProvider = ({
|
|
|
3640
3777
|
document.removeEventListener("pointerdown", handlePointerDown, true);
|
|
3641
3778
|
};
|
|
3642
3779
|
}, [shouldAutoScroll]);
|
|
3643
|
-
const setThemeModePreference =
|
|
3780
|
+
const setThemeModePreference = React59.useCallback(
|
|
3644
3781
|
(mode) => {
|
|
3645
3782
|
setThemeModeState((prev) => prev === mode ? prev : mode);
|
|
3646
3783
|
},
|
|
3647
3784
|
[setThemeModeState]
|
|
3648
3785
|
);
|
|
3649
|
-
const handleSetIsDarkMode =
|
|
3786
|
+
const handleSetIsDarkMode = React59.useCallback(
|
|
3650
3787
|
(darkMode) => {
|
|
3651
3788
|
setThemeModePreference(darkMode ? "dark" : "light");
|
|
3652
3789
|
},
|
|
3653
3790
|
[setThemeModePreference]
|
|
3654
3791
|
);
|
|
3655
|
-
const progressColor =
|
|
3792
|
+
const progressColor = React59.useMemo(() => {
|
|
3656
3793
|
return isDarkMode ? "#fff" : "#000";
|
|
3657
3794
|
}, [isDarkMode]);
|
|
3658
3795
|
const value = {
|
|
@@ -3701,7 +3838,7 @@ var ThemeProvider = ({
|
|
|
3701
3838
|
] }) });
|
|
3702
3839
|
};
|
|
3703
3840
|
var useTheme = () => {
|
|
3704
|
-
const context =
|
|
3841
|
+
const context = React59.useContext(ThemeContext);
|
|
3705
3842
|
if (!context) {
|
|
3706
3843
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
3707
3844
|
}
|
|
@@ -3711,26 +3848,9 @@ var useThemeExtras = () => {
|
|
|
3711
3848
|
const { extras } = useTheme();
|
|
3712
3849
|
return extras;
|
|
3713
3850
|
};
|
|
3714
|
-
var
|
|
3715
|
-
var scrollInputIntoView = (element) => {
|
|
3716
|
-
if (!element || typeof element.scrollIntoView !== "function") {
|
|
3717
|
-
return;
|
|
3718
|
-
}
|
|
3719
|
-
const prefersReducedMotion = isReducedMotionPreferred();
|
|
3720
|
-
const scroll = () => element.scrollIntoView({
|
|
3721
|
-
behavior: prefersReducedMotion ? "auto" : "smooth",
|
|
3722
|
-
block: "center",
|
|
3723
|
-
inline: "nearest"
|
|
3724
|
-
});
|
|
3725
|
-
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
3726
|
-
window.requestAnimationFrame(scroll);
|
|
3727
|
-
return;
|
|
3728
|
-
}
|
|
3729
|
-
scroll();
|
|
3730
|
-
};
|
|
3731
|
-
var Input = React58__namespace.forwardRef(
|
|
3851
|
+
var Input = React59__namespace.forwardRef(
|
|
3732
3852
|
({ className, type, onFocus, ...props }, forwardedRef) => {
|
|
3733
|
-
const setRefs =
|
|
3853
|
+
const setRefs = React59__namespace.useCallback(
|
|
3734
3854
|
(node) => {
|
|
3735
3855
|
if (typeof forwardedRef === "function") {
|
|
3736
3856
|
forwardedRef(node);
|
|
@@ -3740,13 +3860,13 @@ var Input = React58__namespace.forwardRef(
|
|
|
3740
3860
|
},
|
|
3741
3861
|
[forwardedRef]
|
|
3742
3862
|
);
|
|
3743
|
-
const handleFocus =
|
|
3863
|
+
const handleFocus = React59__namespace.useCallback(
|
|
3744
3864
|
(event) => {
|
|
3745
3865
|
onFocus == null ? void 0 : onFocus(event);
|
|
3746
3866
|
if (event.defaultPrevented) {
|
|
3747
3867
|
return;
|
|
3748
3868
|
}
|
|
3749
|
-
|
|
3869
|
+
maybeScrollElementIntoView(event.currentTarget);
|
|
3750
3870
|
},
|
|
3751
3871
|
[onFocus]
|
|
3752
3872
|
);
|
|
@@ -3811,7 +3931,7 @@ var toNumericValue = (value, decimals) => {
|
|
|
3811
3931
|
}
|
|
3812
3932
|
return parsed;
|
|
3813
3933
|
};
|
|
3814
|
-
var InputNumeric =
|
|
3934
|
+
var InputNumeric = React59__namespace.forwardRef(
|
|
3815
3935
|
({
|
|
3816
3936
|
value,
|
|
3817
3937
|
defaultValue,
|
|
@@ -3827,8 +3947,8 @@ var InputNumeric = React58__namespace.forwardRef(
|
|
|
3827
3947
|
pattern,
|
|
3828
3948
|
...rest
|
|
3829
3949
|
}, ref) => {
|
|
3830
|
-
const patternMatcher =
|
|
3831
|
-
const initialValue =
|
|
3950
|
+
const patternMatcher = React59__namespace.useMemo(() => createPattern(decimals), [decimals]);
|
|
3951
|
+
const initialValue = React59__namespace.useMemo(() => {
|
|
3832
3952
|
var _a2;
|
|
3833
3953
|
const source = (_a2 = value != null ? value : defaultValue) != null ? _a2 : null;
|
|
3834
3954
|
if (source === null) {
|
|
@@ -3836,16 +3956,16 @@ var InputNumeric = React58__namespace.forwardRef(
|
|
|
3836
3956
|
}
|
|
3837
3957
|
return toNumberString(source, decimals);
|
|
3838
3958
|
}, [value, defaultValue, decimals]);
|
|
3839
|
-
const [rawValue, setRawValue] =
|
|
3840
|
-
const [isFocused, setIsFocused] =
|
|
3841
|
-
|
|
3959
|
+
const [rawValue, setRawValue] = React59__namespace.useState(initialValue);
|
|
3960
|
+
const [isFocused, setIsFocused] = React59__namespace.useState(false);
|
|
3961
|
+
React59__namespace.useEffect(() => {
|
|
3842
3962
|
if (value === void 0) {
|
|
3843
3963
|
return;
|
|
3844
3964
|
}
|
|
3845
3965
|
const nextRawValue = value === null ? "" : toNumberString(value, decimals);
|
|
3846
3966
|
setRawValue((previous) => previous === nextRawValue ? previous : nextRawValue);
|
|
3847
3967
|
}, [value, decimals]);
|
|
3848
|
-
const clampValue =
|
|
3968
|
+
const clampValue = React59__namespace.useCallback(
|
|
3849
3969
|
(numericValue) => {
|
|
3850
3970
|
if (numericValue === null) {
|
|
3851
3971
|
return null;
|
|
@@ -3890,7 +4010,7 @@ var InputNumeric = React58__namespace.forwardRef(
|
|
|
3890
4010
|
}
|
|
3891
4011
|
onBlur == null ? void 0 : onBlur(event);
|
|
3892
4012
|
};
|
|
3893
|
-
const displayValue =
|
|
4013
|
+
const displayValue = React59__namespace.useMemo(() => {
|
|
3894
4014
|
if (isFocused) {
|
|
3895
4015
|
return rawValue;
|
|
3896
4016
|
}
|
|
@@ -3940,7 +4060,7 @@ var formatWithMask = (rawValue, mask, placeholderChar) => {
|
|
|
3940
4060
|
}
|
|
3941
4061
|
return result;
|
|
3942
4062
|
};
|
|
3943
|
-
var InputMask =
|
|
4063
|
+
var InputMask = React59__namespace.forwardRef(
|
|
3944
4064
|
({
|
|
3945
4065
|
mask,
|
|
3946
4066
|
placeholderChar = DEFAULT_PLACEHOLDER_CHAR,
|
|
@@ -3952,11 +4072,11 @@ var InputMask = React58__namespace.forwardRef(
|
|
|
3952
4072
|
}, ref) => {
|
|
3953
4073
|
var _a2;
|
|
3954
4074
|
const normalizedPlaceholder = (_a2 = placeholderChar[0]) != null ? _a2 : DEFAULT_PLACEHOLDER_CHAR;
|
|
3955
|
-
const placeholderCount =
|
|
4075
|
+
const placeholderCount = React59__namespace.useMemo(
|
|
3956
4076
|
() => countPlaceholders(mask, normalizedPlaceholder),
|
|
3957
4077
|
[mask, normalizedPlaceholder]
|
|
3958
4078
|
);
|
|
3959
|
-
const normalizeRawValue =
|
|
4079
|
+
const normalizeRawValue = React59__namespace.useCallback(
|
|
3960
4080
|
(source) => {
|
|
3961
4081
|
if (!source) {
|
|
3962
4082
|
return "";
|
|
@@ -3969,20 +4089,20 @@ var InputMask = React58__namespace.forwardRef(
|
|
|
3969
4089
|
},
|
|
3970
4090
|
[placeholderCount]
|
|
3971
4091
|
);
|
|
3972
|
-
const [rawValue, setRawValue] =
|
|
4092
|
+
const [rawValue, setRawValue] = React59__namespace.useState(
|
|
3973
4093
|
() => {
|
|
3974
4094
|
var _a3;
|
|
3975
4095
|
return normalizeRawValue((_a3 = value != null ? value : defaultValue) != null ? _a3 : "");
|
|
3976
4096
|
}
|
|
3977
4097
|
);
|
|
3978
|
-
|
|
4098
|
+
React59__namespace.useEffect(() => {
|
|
3979
4099
|
if (value === void 0) {
|
|
3980
4100
|
return;
|
|
3981
4101
|
}
|
|
3982
4102
|
const next = normalizeRawValue(value);
|
|
3983
4103
|
setRawValue((previous) => previous === next ? previous : next);
|
|
3984
4104
|
}, [value, normalizeRawValue]);
|
|
3985
|
-
|
|
4105
|
+
React59__namespace.useEffect(() => {
|
|
3986
4106
|
if (value !== void 0) {
|
|
3987
4107
|
return;
|
|
3988
4108
|
}
|
|
@@ -3995,7 +4115,7 @@ var InputMask = React58__namespace.forwardRef(
|
|
|
3995
4115
|
}
|
|
3996
4116
|
onChange == null ? void 0 : onChange(incoming);
|
|
3997
4117
|
};
|
|
3998
|
-
const formattedValue =
|
|
4118
|
+
const formattedValue = React59__namespace.useMemo(
|
|
3999
4119
|
() => formatWithMask(rawValue, mask, normalizedPlaceholder),
|
|
4000
4120
|
[mask, normalizedPlaceholder, rawValue]
|
|
4001
4121
|
);
|
|
@@ -4270,9 +4390,9 @@ var MobileWheelColumn = ({
|
|
|
4270
4390
|
onValueChange,
|
|
4271
4391
|
open
|
|
4272
4392
|
}) => {
|
|
4273
|
-
const listRef =
|
|
4274
|
-
const scrollTimeoutRef =
|
|
4275
|
-
const extendedOptions =
|
|
4393
|
+
const listRef = React59__namespace.useRef(null);
|
|
4394
|
+
const scrollTimeoutRef = React59__namespace.useRef(null);
|
|
4395
|
+
const extendedOptions = React59__namespace.useMemo(() => {
|
|
4276
4396
|
if (options.length === 0) {
|
|
4277
4397
|
return [];
|
|
4278
4398
|
}
|
|
@@ -4284,7 +4404,7 @@ var MobileWheelColumn = ({
|
|
|
4284
4404
|
}
|
|
4285
4405
|
return repeated;
|
|
4286
4406
|
}, [options]);
|
|
4287
|
-
const alignToValue =
|
|
4407
|
+
const alignToValue = React59__namespace.useCallback(
|
|
4288
4408
|
(value, behavior = "auto") => {
|
|
4289
4409
|
if (!listRef.current || options.length === 0 || extendedOptions.length === 0) {
|
|
4290
4410
|
return;
|
|
@@ -4298,13 +4418,13 @@ var MobileWheelColumn = ({
|
|
|
4298
4418
|
},
|
|
4299
4419
|
[extendedOptions.length, options]
|
|
4300
4420
|
);
|
|
4301
|
-
|
|
4421
|
+
React59__namespace.useLayoutEffect(() => {
|
|
4302
4422
|
if (!open) {
|
|
4303
4423
|
return;
|
|
4304
4424
|
}
|
|
4305
4425
|
alignToValue(selectedValue);
|
|
4306
4426
|
}, [alignToValue, open, options, selectedValue]);
|
|
4307
|
-
|
|
4427
|
+
React59__namespace.useEffect(
|
|
4308
4428
|
() => () => {
|
|
4309
4429
|
if (scrollTimeoutRef.current !== null) {
|
|
4310
4430
|
clearTimeout(scrollTimeoutRef.current);
|
|
@@ -4312,7 +4432,7 @@ var MobileWheelColumn = ({
|
|
|
4312
4432
|
},
|
|
4313
4433
|
[]
|
|
4314
4434
|
);
|
|
4315
|
-
const handleScroll2 =
|
|
4435
|
+
const handleScroll2 = React59__namespace.useCallback(
|
|
4316
4436
|
(event) => {
|
|
4317
4437
|
if (extendedOptions.length === 0 || options.length === 0) {
|
|
4318
4438
|
return;
|
|
@@ -4426,14 +4546,14 @@ var getDefaultLocale = (locale) => {
|
|
|
4426
4546
|
};
|
|
4427
4547
|
};
|
|
4428
4548
|
var useLatest = (value) => {
|
|
4429
|
-
const ref =
|
|
4430
|
-
|
|
4549
|
+
const ref = React59__namespace.useRef(value);
|
|
4550
|
+
React59__namespace.useEffect(() => {
|
|
4431
4551
|
ref.current = value;
|
|
4432
4552
|
}, [value]);
|
|
4433
4553
|
return ref;
|
|
4434
4554
|
};
|
|
4435
4555
|
var DEFAULT_PRIMARY_COLOR = "hsl(var(--primary))";
|
|
4436
|
-
var DatePicker =
|
|
4556
|
+
var DatePicker = React59__namespace.forwardRef((props, ref) => {
|
|
4437
4557
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
4438
4558
|
const {
|
|
4439
4559
|
value: valueProp,
|
|
@@ -4476,17 +4596,17 @@ var DatePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
4476
4596
|
const { isNative } = useTheme();
|
|
4477
4597
|
const isMobile = useIsMobile();
|
|
4478
4598
|
const shouldUseDrawer = isNative || isMobile;
|
|
4479
|
-
const [associatedLabel, setAssociatedLabel] =
|
|
4480
|
-
const locale =
|
|
4599
|
+
const [associatedLabel, setAssociatedLabel] = React59__namespace.useState(null);
|
|
4600
|
+
const locale = React59__namespace.useMemo(() => getDefaultLocale(localeProp), [localeProp]);
|
|
4481
4601
|
const onChangeRef = useLatest(onChange);
|
|
4482
4602
|
const onOpenChangeRef = useLatest(onOpenChange);
|
|
4483
4603
|
const formatRef = useLatest(format);
|
|
4484
4604
|
const isValueControlled = valueProp !== void 0;
|
|
4485
|
-
const [internalValue, setInternalValue] =
|
|
4605
|
+
const [internalValue, setInternalValue] = React59__namespace.useState(defaultValue);
|
|
4486
4606
|
const selectedValue = (_a2 = isValueControlled ? valueProp : internalValue) != null ? _a2 : null;
|
|
4487
|
-
const initialPanelMode =
|
|
4488
|
-
const [panelMode, setPanelMode] =
|
|
4489
|
-
const commitValue =
|
|
4607
|
+
const initialPanelMode = React59__namespace.useMemo(() => getPanelModeFromProps(mode, picker), [mode, picker]);
|
|
4608
|
+
const [panelMode, setPanelMode] = React59__namespace.useState(initialPanelMode);
|
|
4609
|
+
const commitValue = React59__namespace.useCallback(
|
|
4490
4610
|
(next) => {
|
|
4491
4611
|
var _a3;
|
|
4492
4612
|
if (!isValueControlled) {
|
|
@@ -4496,18 +4616,18 @@ var DatePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
4496
4616
|
},
|
|
4497
4617
|
[formatRef, isValueControlled, onChangeRef]
|
|
4498
4618
|
);
|
|
4499
|
-
const [draftValue, setDraftValue] =
|
|
4500
|
-
|
|
4619
|
+
const [draftValue, setDraftValue] = React59__namespace.useState(selectedValue);
|
|
4620
|
+
React59__namespace.useEffect(() => {
|
|
4501
4621
|
setDraftValue(selectedValue);
|
|
4502
4622
|
}, [selectedValue]);
|
|
4503
|
-
const [viewDate, setViewDate] =
|
|
4623
|
+
const [viewDate, setViewDate] = React59__namespace.useState(() => {
|
|
4504
4624
|
const base = selectedValue != null ? selectedValue : dayjs();
|
|
4505
4625
|
return clampToRange(base, minDate, maxDate);
|
|
4506
4626
|
});
|
|
4507
4627
|
const isOpenControlled = openProp !== void 0;
|
|
4508
|
-
const [internalOpen, setInternalOpen] =
|
|
4628
|
+
const [internalOpen, setInternalOpen] = React59__namespace.useState(Boolean(defaultOpen));
|
|
4509
4629
|
const open = isOpenControlled ? Boolean(openProp) : internalOpen;
|
|
4510
|
-
const setOpenState =
|
|
4630
|
+
const setOpenState = React59__namespace.useCallback(
|
|
4511
4631
|
(next) => {
|
|
4512
4632
|
var _a3;
|
|
4513
4633
|
if (!isOpenControlled) {
|
|
@@ -4518,25 +4638,25 @@ var DatePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
4518
4638
|
[isOpenControlled, onOpenChangeRef]
|
|
4519
4639
|
);
|
|
4520
4640
|
const activeValue = needConfirm ? draftValue : selectedValue;
|
|
4521
|
-
|
|
4641
|
+
React59__namespace.useEffect(() => {
|
|
4522
4642
|
if (open) {
|
|
4523
4643
|
setPanelMode(initialPanelMode);
|
|
4524
4644
|
setViewDate((prev) => clampToRange(activeValue != null ? activeValue : prev, minDate, maxDate));
|
|
4525
4645
|
}
|
|
4526
4646
|
}, [activeValue, initialPanelMode, maxDate, minDate, open]);
|
|
4527
|
-
const [inputValue, setInputValue] =
|
|
4528
|
-
const isTypingRef =
|
|
4529
|
-
|
|
4647
|
+
const [inputValue, setInputValue] = React59__namespace.useState(() => formatDateValue(activeValue, formatRef.current));
|
|
4648
|
+
const isTypingRef = React59__namespace.useRef(false);
|
|
4649
|
+
React59__namespace.useEffect(() => {
|
|
4530
4650
|
if (!isTypingRef.current) {
|
|
4531
4651
|
setInputValue(formatDateValue(activeValue, formatRef.current));
|
|
4532
4652
|
}
|
|
4533
4653
|
}, [activeValue, formatRef]);
|
|
4534
|
-
const primaryColorStyle =
|
|
4654
|
+
const primaryColorStyle = React59__namespace.useMemo(
|
|
4535
4655
|
() => ({ "--date-primary-color": DEFAULT_PRIMARY_COLOR }),
|
|
4536
4656
|
[]
|
|
4537
4657
|
);
|
|
4538
|
-
const inputRef =
|
|
4539
|
-
const handleOpenChange =
|
|
4658
|
+
const inputRef = React59__namespace.useRef(null);
|
|
4659
|
+
const handleOpenChange = React59__namespace.useCallback(
|
|
4540
4660
|
(nextOpen) => {
|
|
4541
4661
|
if (disabled) {
|
|
4542
4662
|
return;
|
|
@@ -4549,11 +4669,11 @@ var DatePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
4549
4669
|
},
|
|
4550
4670
|
[activeValue, disabled, initialPanelMode, maxDate, minDate, setOpenState]
|
|
4551
4671
|
);
|
|
4552
|
-
const parseInputValue =
|
|
4672
|
+
const parseInputValue = React59__namespace.useCallback(
|
|
4553
4673
|
(text) => parseDateValue(text, formatRef.current),
|
|
4554
4674
|
[formatRef]
|
|
4555
4675
|
);
|
|
4556
|
-
const isDateDisabled =
|
|
4676
|
+
const isDateDisabled = React59__namespace.useCallback(
|
|
4557
4677
|
(date, currentMode) => {
|
|
4558
4678
|
if (!isWithinRange(date, minDate, maxDate, currentMode)) {
|
|
4559
4679
|
return true;
|
|
@@ -4565,11 +4685,11 @@ var DatePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
4565
4685
|
},
|
|
4566
4686
|
[disabledDate, maxDate, minDate]
|
|
4567
4687
|
);
|
|
4568
|
-
const formatForDisplay =
|
|
4688
|
+
const formatForDisplay = React59__namespace.useCallback(
|
|
4569
4689
|
(value) => formatDateValue(value, formatRef.current),
|
|
4570
4690
|
[formatRef]
|
|
4571
4691
|
);
|
|
4572
|
-
const handleDateSelect =
|
|
4692
|
+
const handleDateSelect = React59__namespace.useCallback(
|
|
4573
4693
|
(date) => {
|
|
4574
4694
|
if (isDateDisabled(date, "date")) {
|
|
4575
4695
|
return;
|
|
@@ -5043,7 +5163,7 @@ var DatePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
5043
5163
|
] })
|
|
5044
5164
|
] });
|
|
5045
5165
|
const panelNode = panelRender ? panelRender(renderedPanel) : renderedPanel;
|
|
5046
|
-
|
|
5166
|
+
React59__namespace.useEffect(() => {
|
|
5047
5167
|
if (!autoFocus) {
|
|
5048
5168
|
return;
|
|
5049
5169
|
}
|
|
@@ -5057,7 +5177,7 @@ var DatePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
5057
5177
|
focusInput();
|
|
5058
5178
|
}
|
|
5059
5179
|
}, [autoFocus]);
|
|
5060
|
-
|
|
5180
|
+
React59__namespace.useImperativeHandle(ref, () => inputRef.current);
|
|
5061
5181
|
const shouldShowPointer = !disabled && (inputReadOnly || shouldUseDrawer);
|
|
5062
5182
|
const triggerNode = /* @__PURE__ */ jsxs(
|
|
5063
5183
|
"div",
|
|
@@ -5124,17 +5244,17 @@ var DatePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
5124
5244
|
]
|
|
5125
5245
|
}
|
|
5126
5246
|
);
|
|
5127
|
-
const mobileBaseValue =
|
|
5247
|
+
const mobileBaseValue = React59__namespace.useMemo(() => {
|
|
5128
5248
|
var _a3, _b2;
|
|
5129
5249
|
const base = (_b2 = needConfirm ? (_a3 = draftValue != null ? draftValue : selectedValue) != null ? _a3 : viewDate : activeValue != null ? activeValue : viewDate) != null ? _b2 : dayjs();
|
|
5130
5250
|
return base.clone();
|
|
5131
5251
|
}, [activeValue, draftValue, needConfirm, selectedValue, viewDate]);
|
|
5132
|
-
const monthOptions =
|
|
5252
|
+
const monthOptions = React59__namespace.useMemo(
|
|
5133
5253
|
() => locale.months.map((month, index2) => ({ label: month, value: index2 })),
|
|
5134
5254
|
[locale.months]
|
|
5135
5255
|
);
|
|
5136
5256
|
const daysInMonth = mobileBaseValue.daysInMonth();
|
|
5137
|
-
const dayOptions =
|
|
5257
|
+
const dayOptions = React59__namespace.useMemo(
|
|
5138
5258
|
() => Array.from({ length: daysInMonth }, (_, index2) => ({
|
|
5139
5259
|
label: String(index2 + 1).padStart(2, "0"),
|
|
5140
5260
|
value: index2 + 1
|
|
@@ -5146,14 +5266,14 @@ var DatePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
5146
5266
|
const maxYear = (_e = maxDate == null ? void 0 : maxDate.year()) != null ? _e : currentYear + 100;
|
|
5147
5267
|
const startYear = Math.min(minYear, maxYear);
|
|
5148
5268
|
const endYear = Math.max(minYear, maxYear);
|
|
5149
|
-
const yearOptions =
|
|
5269
|
+
const yearOptions = React59__namespace.useMemo(
|
|
5150
5270
|
() => Array.from({ length: endYear - startYear + 1 }, (_, index2) => {
|
|
5151
5271
|
const year = startYear + index2;
|
|
5152
5272
|
return { label: String(year), value: year };
|
|
5153
5273
|
}),
|
|
5154
5274
|
[endYear, startYear]
|
|
5155
5275
|
);
|
|
5156
|
-
const handlePartChange =
|
|
5276
|
+
const handlePartChange = React59__namespace.useCallback(
|
|
5157
5277
|
(part, value) => {
|
|
5158
5278
|
var _a3, _b2;
|
|
5159
5279
|
const base = (_b2 = needConfirm ? (_a3 = draftValue != null ? draftValue : selectedValue) != null ? _a3 : viewDate : selectedValue != null ? selectedValue : viewDate) != null ? _b2 : dayjs();
|
|
@@ -5187,13 +5307,13 @@ var DatePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
5187
5307
|
[commitValue, draftValue, formatForDisplay, isDateDisabled, maxDate, minDate, needConfirm, selectedValue, setViewDate, viewDate]
|
|
5188
5308
|
);
|
|
5189
5309
|
const mobileLabelFallback = (_g = (_f = typeof inputRest["aria-label"] === "string" ? inputRest["aria-label"] : void 0) != null ? _f : placeholder) != null ? _g : locale.placeholder;
|
|
5190
|
-
const handleDrawerOpenChange =
|
|
5310
|
+
const handleDrawerOpenChange = React59__namespace.useCallback(
|
|
5191
5311
|
(nextOpen) => {
|
|
5192
5312
|
handleOpenChange(nextOpen);
|
|
5193
5313
|
},
|
|
5194
5314
|
[handleOpenChange]
|
|
5195
5315
|
);
|
|
5196
|
-
|
|
5316
|
+
React59__namespace.useEffect(() => {
|
|
5197
5317
|
var _a3, _b2;
|
|
5198
5318
|
if (!shouldUseDrawer || !open || !id) {
|
|
5199
5319
|
return;
|
|
@@ -5702,7 +5822,7 @@ var gapClasses = {
|
|
|
5702
5822
|
middle: gapScale.md,
|
|
5703
5823
|
large: gapScale.lg
|
|
5704
5824
|
};
|
|
5705
|
-
var Flex =
|
|
5825
|
+
var Flex = React59__namespace.forwardRef(
|
|
5706
5826
|
({
|
|
5707
5827
|
direction,
|
|
5708
5828
|
vertical,
|
|
@@ -5807,7 +5927,7 @@ function InputOTPSlot({
|
|
|
5807
5927
|
...props
|
|
5808
5928
|
}) {
|
|
5809
5929
|
var _a2;
|
|
5810
|
-
const inputOTPContext =
|
|
5930
|
+
const inputOTPContext = React59__namespace.useContext(inputOtp.OTPInputContext);
|
|
5811
5931
|
const { char, hasFakeCaret, isActive } = (_a2 = inputOTPContext == null ? void 0 : inputOTPContext.slots[index2]) != null ? _a2 : {};
|
|
5812
5932
|
return /* @__PURE__ */ jsxs(
|
|
5813
5933
|
"div",
|
|
@@ -6163,7 +6283,7 @@ var mobileFooterVariants = Object.keys(
|
|
|
6163
6283
|
);
|
|
6164
6284
|
var noop = () => {
|
|
6165
6285
|
};
|
|
6166
|
-
var MobileFooter =
|
|
6286
|
+
var MobileFooter = React59__namespace.forwardRef(
|
|
6167
6287
|
({
|
|
6168
6288
|
items,
|
|
6169
6289
|
value,
|
|
@@ -6174,7 +6294,7 @@ var MobileFooter = React58__namespace.forwardRef(
|
|
|
6174
6294
|
forceLabels = false,
|
|
6175
6295
|
...props
|
|
6176
6296
|
}, ref) => {
|
|
6177
|
-
const [internalValue, setInternalValue] =
|
|
6297
|
+
const [internalValue, setInternalValue] = React59__namespace.useState(() => {
|
|
6178
6298
|
var _a2, _b;
|
|
6179
6299
|
if (value !== void 0) {
|
|
6180
6300
|
return value;
|
|
@@ -6186,7 +6306,7 @@ var MobileFooter = React58__namespace.forwardRef(
|
|
|
6186
6306
|
});
|
|
6187
6307
|
const isControlled = value !== void 0;
|
|
6188
6308
|
const selectedValue = isControlled ? value : internalValue;
|
|
6189
|
-
|
|
6309
|
+
React59__namespace.useEffect(() => {
|
|
6190
6310
|
var _a2;
|
|
6191
6311
|
if (!items.length) {
|
|
6192
6312
|
return;
|
|
@@ -6203,7 +6323,7 @@ var MobileFooter = React58__namespace.forwardRef(
|
|
|
6203
6323
|
onChange(fallback);
|
|
6204
6324
|
}
|
|
6205
6325
|
}, [items, selectedValue, isControlled, onChange]);
|
|
6206
|
-
const handleSelect =
|
|
6326
|
+
const handleSelect = React59__namespace.useCallback(
|
|
6207
6327
|
(nextValue) => {
|
|
6208
6328
|
if (nextValue === selectedValue) {
|
|
6209
6329
|
return;
|
|
@@ -6223,7 +6343,7 @@ var MobileFooter = React58__namespace.forwardRef(
|
|
|
6223
6343
|
0
|
|
6224
6344
|
);
|
|
6225
6345
|
const cellPercentage = 100 / items.length;
|
|
6226
|
-
const floatingIndicatorStyle =
|
|
6346
|
+
const floatingIndicatorStyle = React59__namespace.useMemo(() => {
|
|
6227
6347
|
const size4 = 72;
|
|
6228
6348
|
const offset4 = cellPercentage / 2;
|
|
6229
6349
|
return {
|
|
@@ -6232,18 +6352,18 @@ var MobileFooter = React58__namespace.forwardRef(
|
|
|
6232
6352
|
left: `calc(${cellPercentage}% * ${activeIndex} + ${offset4}% - ${size4 / 2}px)`
|
|
6233
6353
|
};
|
|
6234
6354
|
}, [activeIndex, cellPercentage]);
|
|
6235
|
-
const pillIndicatorStyle =
|
|
6355
|
+
const pillIndicatorStyle = React59__namespace.useMemo(() => ({
|
|
6236
6356
|
width: `calc((100% / ${items.length}) - 0.75rem)`,
|
|
6237
6357
|
left: `calc((100% / ${items.length}) * ${activeIndex} + 0.375rem)`
|
|
6238
6358
|
}), [activeIndex, items.length]);
|
|
6239
|
-
const minimalIndicatorStyle =
|
|
6359
|
+
const minimalIndicatorStyle = React59__namespace.useMemo(
|
|
6240
6360
|
() => ({
|
|
6241
6361
|
width: `calc((100% / ${items.length}) * 0.6)`,
|
|
6242
6362
|
left: `calc((100% / ${items.length}) * ${activeIndex} + (100% / ${items.length}) * 0.2)`
|
|
6243
6363
|
}),
|
|
6244
6364
|
[activeIndex, items.length]
|
|
6245
6365
|
);
|
|
6246
|
-
const curvedIndicatorStyle =
|
|
6366
|
+
const curvedIndicatorStyle = React59__namespace.useMemo(() => {
|
|
6247
6367
|
const size4 = 64;
|
|
6248
6368
|
const offset4 = cellPercentage / 2;
|
|
6249
6369
|
return {
|
|
@@ -6572,7 +6692,7 @@ var renderBadge = (badge, active = false) => {
|
|
|
6572
6692
|
}
|
|
6573
6693
|
);
|
|
6574
6694
|
};
|
|
6575
|
-
var MobileHeader =
|
|
6695
|
+
var MobileHeader = React59__namespace.forwardRef(
|
|
6576
6696
|
({
|
|
6577
6697
|
title,
|
|
6578
6698
|
subtitle,
|
|
@@ -6595,12 +6715,12 @@ var MobileHeader = React58__namespace.forwardRef(
|
|
|
6595
6715
|
children,
|
|
6596
6716
|
...props
|
|
6597
6717
|
}, ref) => {
|
|
6598
|
-
const [internalSearchValue, setInternalSearchValue] =
|
|
6718
|
+
const [internalSearchValue, setInternalSearchValue] = React59__namespace.useState(
|
|
6599
6719
|
() => defaultSearchValue != null ? defaultSearchValue : ""
|
|
6600
6720
|
);
|
|
6601
6721
|
const isSearchControlled = searchValue !== void 0;
|
|
6602
6722
|
const resolvedSearchValue = isSearchControlled ? searchValue : internalSearchValue;
|
|
6603
|
-
const handleSearchChange =
|
|
6723
|
+
const handleSearchChange = React59__namespace.useCallback(
|
|
6604
6724
|
(event) => {
|
|
6605
6725
|
const nextValue = event.target.value;
|
|
6606
6726
|
if (!isSearchControlled) {
|
|
@@ -6833,26 +6953,26 @@ function composeRefs(...refs) {
|
|
|
6833
6953
|
};
|
|
6834
6954
|
}
|
|
6835
6955
|
function useComposedRefs(...refs) {
|
|
6836
|
-
return
|
|
6956
|
+
return React59__namespace.useCallback(composeRefs(...refs), refs);
|
|
6837
6957
|
}
|
|
6838
6958
|
// @__NO_SIDE_EFFECTS__
|
|
6839
6959
|
function createSlot(ownerName) {
|
|
6840
6960
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
6841
|
-
const Slot22 =
|
|
6961
|
+
const Slot22 = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
6842
6962
|
const { children, ...slotProps } = props;
|
|
6843
|
-
const childrenArray =
|
|
6963
|
+
const childrenArray = React59__namespace.Children.toArray(children);
|
|
6844
6964
|
const slottable = childrenArray.find(isSlottable);
|
|
6845
6965
|
if (slottable) {
|
|
6846
6966
|
const newElement = slottable.props.children;
|
|
6847
6967
|
const newChildren = childrenArray.map((child) => {
|
|
6848
6968
|
if (child === slottable) {
|
|
6849
|
-
if (
|
|
6850
|
-
return
|
|
6969
|
+
if (React59__namespace.Children.count(newElement) > 1) return React59__namespace.Children.only(null);
|
|
6970
|
+
return React59__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
|
6851
6971
|
} else {
|
|
6852
6972
|
return child;
|
|
6853
6973
|
}
|
|
6854
6974
|
});
|
|
6855
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
6975
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React59__namespace.isValidElement(newElement) ? React59__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
6856
6976
|
}
|
|
6857
6977
|
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
6858
6978
|
});
|
|
@@ -6862,24 +6982,24 @@ function createSlot(ownerName) {
|
|
|
6862
6982
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
6863
6983
|
// @__NO_SIDE_EFFECTS__
|
|
6864
6984
|
function createSlotClone(ownerName) {
|
|
6865
|
-
const SlotClone =
|
|
6985
|
+
const SlotClone = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
6866
6986
|
const { children, ...slotProps } = props;
|
|
6867
|
-
if (
|
|
6987
|
+
if (React59__namespace.isValidElement(children)) {
|
|
6868
6988
|
const childrenRef = getElementRef(children);
|
|
6869
6989
|
const props2 = mergeProps(slotProps, children.props);
|
|
6870
|
-
if (children.type !==
|
|
6990
|
+
if (children.type !== React59__namespace.Fragment) {
|
|
6871
6991
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
6872
6992
|
}
|
|
6873
|
-
return
|
|
6993
|
+
return React59__namespace.cloneElement(children, props2);
|
|
6874
6994
|
}
|
|
6875
|
-
return
|
|
6995
|
+
return React59__namespace.Children.count(children) > 1 ? React59__namespace.Children.only(null) : null;
|
|
6876
6996
|
});
|
|
6877
6997
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
6878
6998
|
return SlotClone;
|
|
6879
6999
|
}
|
|
6880
7000
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
6881
7001
|
function isSlottable(child) {
|
|
6882
|
-
return
|
|
7002
|
+
return React59__namespace.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
6883
7003
|
}
|
|
6884
7004
|
function mergeProps(slotProps, childProps) {
|
|
6885
7005
|
const overrideProps = { ...childProps };
|
|
@@ -6923,7 +7043,7 @@ function getElementRef(element) {
|
|
|
6923
7043
|
// src/components/provider/safe-area.tsx
|
|
6924
7044
|
var defaultEdges = ["top", "right", "bottom", "left"];
|
|
6925
7045
|
var resolveInset = (edges, edge) => edges.includes(edge) ? `env(safe-area-inset-${edge})` : void 0;
|
|
6926
|
-
var SafeArea =
|
|
7046
|
+
var SafeArea = React59__namespace.forwardRef(
|
|
6927
7047
|
({
|
|
6928
7048
|
edges = defaultEdges,
|
|
6929
7049
|
asChild,
|
|
@@ -6962,21 +7082,21 @@ var MobileLayoutInner = ({
|
|
|
6962
7082
|
}) => {
|
|
6963
7083
|
var _a2, _b, _c, _d, _e;
|
|
6964
7084
|
const { header: headerState, navigateBack, canGoBack } = useMobileHeader();
|
|
6965
|
-
const headerEdges =
|
|
7085
|
+
const headerEdges = React59__namespace.useMemo(() => {
|
|
6966
7086
|
const edges = [];
|
|
6967
7087
|
if (safeArea.top) edges.push("top");
|
|
6968
7088
|
if (safeArea.left) edges.push("left");
|
|
6969
7089
|
if (safeArea.right) edges.push("right");
|
|
6970
7090
|
return edges;
|
|
6971
7091
|
}, [safeArea.top, safeArea.left, safeArea.right]);
|
|
6972
|
-
const footerEdges =
|
|
7092
|
+
const footerEdges = React59__namespace.useMemo(() => {
|
|
6973
7093
|
const edges = [];
|
|
6974
7094
|
if (safeArea.bottom) edges.push("bottom");
|
|
6975
7095
|
if (safeArea.left) edges.push("left");
|
|
6976
7096
|
if (safeArea.right) edges.push("right");
|
|
6977
7097
|
return edges;
|
|
6978
7098
|
}, [safeArea.bottom, safeArea.left, safeArea.right]);
|
|
6979
|
-
const handleBack =
|
|
7099
|
+
const handleBack = React59__namespace.useCallback(() => {
|
|
6980
7100
|
if (canGoBack) {
|
|
6981
7101
|
navigateBack();
|
|
6982
7102
|
return;
|
|
@@ -6986,7 +7106,7 @@ var MobileLayoutInner = ({
|
|
|
6986
7106
|
}
|
|
6987
7107
|
}, [canGoBack, navigateBack]);
|
|
6988
7108
|
const showBackButton = (_a2 = headerState.back) != null ? _a2 : canGoBack;
|
|
6989
|
-
const resolvedLeadingAction =
|
|
7109
|
+
const resolvedLeadingAction = React59__namespace.useMemo(() => {
|
|
6990
7110
|
if (showBackButton) {
|
|
6991
7111
|
return {
|
|
6992
7112
|
value: "mobile-header-back",
|
|
@@ -7007,7 +7127,7 @@ var MobileLayoutInner = ({
|
|
|
7007
7127
|
const headerVariant = (_d = (_c = (_b = headerState.variant) != null ? _b : variant) != null ? _c : type) != null ? _d : "hero";
|
|
7008
7128
|
const { show: showFooter = true, activeKey, onChange: footerOnChange, ...footerProps } = footer;
|
|
7009
7129
|
const footerValue = (_e = footerProps.value) != null ? _e : activeKey;
|
|
7010
|
-
const handleFooterSelect =
|
|
7130
|
+
const handleFooterSelect = React59__namespace.useCallback(
|
|
7011
7131
|
(value) => {
|
|
7012
7132
|
footerOnChange == null ? void 0 : footerOnChange(value);
|
|
7013
7133
|
},
|
|
@@ -7469,11 +7589,11 @@ function ScrollBar({
|
|
|
7469
7589
|
}
|
|
7470
7590
|
);
|
|
7471
7591
|
}
|
|
7472
|
-
var NativeSelectContext =
|
|
7592
|
+
var NativeSelectContext = React59__namespace.createContext(
|
|
7473
7593
|
void 0
|
|
7474
7594
|
);
|
|
7475
7595
|
function useNativeSelectContext() {
|
|
7476
|
-
const context =
|
|
7596
|
+
const context = React59__namespace.useContext(NativeSelectContext);
|
|
7477
7597
|
if (!context) {
|
|
7478
7598
|
throw new Error("useNativeSelectContext must be used within a Select component");
|
|
7479
7599
|
}
|
|
@@ -7489,16 +7609,16 @@ function SelectRoot({
|
|
|
7489
7609
|
const { isNative } = useTheme();
|
|
7490
7610
|
const isMobile = useIsMobile();
|
|
7491
7611
|
const shouldUseDrawer = isNative || isMobile;
|
|
7492
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
7612
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React59__namespace.useState(defaultOpen != null ? defaultOpen : false);
|
|
7493
7613
|
const open = openProp != null ? openProp : uncontrolledOpen;
|
|
7494
|
-
const setOpen =
|
|
7614
|
+
const setOpen = React59__namespace.useCallback(
|
|
7495
7615
|
(nextOpen) => {
|
|
7496
7616
|
if (openProp === void 0) setUncontrolledOpen(nextOpen);
|
|
7497
7617
|
onOpenChange == null ? void 0 : onOpenChange(nextOpen);
|
|
7498
7618
|
},
|
|
7499
7619
|
[openProp, onOpenChange]
|
|
7500
7620
|
);
|
|
7501
|
-
const contextValue =
|
|
7621
|
+
const contextValue = React59__namespace.useMemo(
|
|
7502
7622
|
() => ({
|
|
7503
7623
|
isNative: shouldUseDrawer,
|
|
7504
7624
|
open,
|
|
@@ -7592,7 +7712,7 @@ function SelectItem({
|
|
|
7592
7712
|
...props
|
|
7593
7713
|
}) {
|
|
7594
7714
|
const nativeContext = useNativeSelectContext();
|
|
7595
|
-
const handleSelect =
|
|
7715
|
+
const handleSelect = React59__namespace.useCallback(
|
|
7596
7716
|
(event) => {
|
|
7597
7717
|
onSelect == null ? void 0 : onSelect(event);
|
|
7598
7718
|
if (nativeContext.isNative && nativeContext.closeOnSelect && !event.defaultPrevented) {
|
|
@@ -7690,7 +7810,7 @@ function Select({
|
|
|
7690
7810
|
}
|
|
7691
7811
|
var noop3 = () => {
|
|
7692
7812
|
};
|
|
7693
|
-
var MultiSelectContext =
|
|
7813
|
+
var MultiSelectContext = React59__namespace.createContext({
|
|
7694
7814
|
isNative: false,
|
|
7695
7815
|
selectedValues: [],
|
|
7696
7816
|
setSelectedValues: noop3,
|
|
@@ -7700,7 +7820,7 @@ var MultiSelectContext = React58__namespace.createContext({
|
|
|
7700
7820
|
setOpen: noop3
|
|
7701
7821
|
});
|
|
7702
7822
|
function useMultiSelectContext() {
|
|
7703
|
-
return
|
|
7823
|
+
return React59__namespace.useContext(MultiSelectContext);
|
|
7704
7824
|
}
|
|
7705
7825
|
function MultiSelect({
|
|
7706
7826
|
value,
|
|
@@ -7714,23 +7834,23 @@ function MultiSelect({
|
|
|
7714
7834
|
const { isNative } = useTheme();
|
|
7715
7835
|
const isMobile = useIsMobile();
|
|
7716
7836
|
const shouldUseDrawer = isNative || isMobile;
|
|
7717
|
-
const [internalValue, setInternalValue] =
|
|
7718
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
7837
|
+
const [internalValue, setInternalValue] = React59__namespace.useState(defaultValue);
|
|
7838
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React59__namespace.useState(
|
|
7719
7839
|
defaultOpen != null ? defaultOpen : false
|
|
7720
7840
|
);
|
|
7721
|
-
|
|
7841
|
+
React59__namespace.useEffect(() => {
|
|
7722
7842
|
if (value !== void 0) {
|
|
7723
7843
|
setInternalValue(value);
|
|
7724
7844
|
}
|
|
7725
7845
|
}, [value]);
|
|
7726
|
-
|
|
7846
|
+
React59__namespace.useEffect(() => {
|
|
7727
7847
|
if (openProp !== void 0) {
|
|
7728
7848
|
setUncontrolledOpen(openProp);
|
|
7729
7849
|
}
|
|
7730
7850
|
}, [openProp]);
|
|
7731
7851
|
const selectedValues = value != null ? value : internalValue;
|
|
7732
7852
|
const open = openProp != null ? openProp : uncontrolledOpen;
|
|
7733
|
-
const setSelectedValues =
|
|
7853
|
+
const setSelectedValues = React59__namespace.useCallback(
|
|
7734
7854
|
(next) => {
|
|
7735
7855
|
const resolved = typeof next === "function" ? next(selectedValues) : next;
|
|
7736
7856
|
if (value === void 0) {
|
|
@@ -7740,7 +7860,7 @@ function MultiSelect({
|
|
|
7740
7860
|
},
|
|
7741
7861
|
[onValueChange, selectedValues, value]
|
|
7742
7862
|
);
|
|
7743
|
-
const toggleValue =
|
|
7863
|
+
const toggleValue = React59__namespace.useCallback(
|
|
7744
7864
|
(item) => {
|
|
7745
7865
|
setSelectedValues((prev) => {
|
|
7746
7866
|
if (prev.includes(item)) {
|
|
@@ -7751,11 +7871,11 @@ function MultiSelect({
|
|
|
7751
7871
|
},
|
|
7752
7872
|
[setSelectedValues]
|
|
7753
7873
|
);
|
|
7754
|
-
const isSelected =
|
|
7874
|
+
const isSelected = React59__namespace.useCallback(
|
|
7755
7875
|
(item) => selectedValues.includes(item),
|
|
7756
7876
|
[selectedValues]
|
|
7757
7877
|
);
|
|
7758
|
-
const setOpen =
|
|
7878
|
+
const setOpen = React59__namespace.useCallback(
|
|
7759
7879
|
(nextOpen) => {
|
|
7760
7880
|
if (openProp === void 0) {
|
|
7761
7881
|
setUncontrolledOpen(nextOpen);
|
|
@@ -7764,7 +7884,7 @@ function MultiSelect({
|
|
|
7764
7884
|
},
|
|
7765
7885
|
[onOpenChange, openProp]
|
|
7766
7886
|
);
|
|
7767
|
-
const contextValue =
|
|
7887
|
+
const contextValue = React59__namespace.useMemo(
|
|
7768
7888
|
() => ({
|
|
7769
7889
|
isNative: shouldUseDrawer,
|
|
7770
7890
|
selectedValues,
|
|
@@ -7795,7 +7915,7 @@ function MultiSelectTrigger({
|
|
|
7795
7915
|
...props
|
|
7796
7916
|
}) {
|
|
7797
7917
|
const context = useMultiSelectContext();
|
|
7798
|
-
const handleClick =
|
|
7918
|
+
const handleClick = React59__namespace.useCallback(
|
|
7799
7919
|
(event) => {
|
|
7800
7920
|
onClick == null ? void 0 : onClick(event);
|
|
7801
7921
|
if (context.isNative && !disabled) {
|
|
@@ -7838,7 +7958,7 @@ function MultiSelectValue({
|
|
|
7838
7958
|
formatValue
|
|
7839
7959
|
}) {
|
|
7840
7960
|
const { selectedValues, isNative } = useMultiSelectContext();
|
|
7841
|
-
const content =
|
|
7961
|
+
const content = React59__namespace.useMemo(() => {
|
|
7842
7962
|
if (formatValue) {
|
|
7843
7963
|
return formatValue(selectedValues);
|
|
7844
7964
|
}
|
|
@@ -8085,7 +8205,7 @@ function SheetDescription({
|
|
|
8085
8205
|
}
|
|
8086
8206
|
var skeletonBaseClass = "relative isolate overflow-hidden rounded-md bg-muted text-transparent";
|
|
8087
8207
|
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-['']";
|
|
8088
|
-
var SkeletonRoot =
|
|
8208
|
+
var SkeletonRoot = React59__namespace.forwardRef(
|
|
8089
8209
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8090
8210
|
"div",
|
|
8091
8211
|
{
|
|
@@ -8097,7 +8217,7 @@ var SkeletonRoot = React58__namespace.forwardRef(
|
|
|
8097
8217
|
)
|
|
8098
8218
|
);
|
|
8099
8219
|
SkeletonRoot.displayName = "Skeleton";
|
|
8100
|
-
var SkeletonButton =
|
|
8220
|
+
var SkeletonButton = React59__namespace.forwardRef(
|
|
8101
8221
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8102
8222
|
SkeletonRoot,
|
|
8103
8223
|
{
|
|
@@ -8108,7 +8228,7 @@ var SkeletonButton = React58__namespace.forwardRef(
|
|
|
8108
8228
|
)
|
|
8109
8229
|
);
|
|
8110
8230
|
SkeletonButton.displayName = "Skeleton.Button";
|
|
8111
|
-
var SkeletonInput =
|
|
8231
|
+
var SkeletonInput = React59__namespace.forwardRef(
|
|
8112
8232
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8113
8233
|
SkeletonRoot,
|
|
8114
8234
|
{
|
|
@@ -8177,9 +8297,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
8177
8297
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
8178
8298
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
8179
8299
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
8180
|
-
var SidebarContext =
|
|
8300
|
+
var SidebarContext = React59__namespace.createContext(null);
|
|
8181
8301
|
function useSidebar() {
|
|
8182
|
-
const context =
|
|
8302
|
+
const context = React59__namespace.useContext(SidebarContext);
|
|
8183
8303
|
if (!context) {
|
|
8184
8304
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
8185
8305
|
}
|
|
@@ -8195,10 +8315,10 @@ function SidebarProvider({
|
|
|
8195
8315
|
...props
|
|
8196
8316
|
}) {
|
|
8197
8317
|
const isMobile = useIsMobile();
|
|
8198
|
-
const [openMobile, setOpenMobile] =
|
|
8199
|
-
const [_open, _setOpen] =
|
|
8318
|
+
const [openMobile, setOpenMobile] = React59__namespace.useState(false);
|
|
8319
|
+
const [_open, _setOpen] = React59__namespace.useState(defaultOpen);
|
|
8200
8320
|
const open = openProp != null ? openProp : _open;
|
|
8201
|
-
const setOpen =
|
|
8321
|
+
const setOpen = React59__namespace.useCallback(
|
|
8202
8322
|
(value) => {
|
|
8203
8323
|
const openState = typeof value === "function" ? value(open) : value;
|
|
8204
8324
|
if (setOpenProp) {
|
|
@@ -8210,10 +8330,10 @@ function SidebarProvider({
|
|
|
8210
8330
|
},
|
|
8211
8331
|
[setOpenProp, open]
|
|
8212
8332
|
);
|
|
8213
|
-
const toggleSidebar =
|
|
8333
|
+
const toggleSidebar = React59__namespace.useCallback(() => {
|
|
8214
8334
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
8215
8335
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
8216
|
-
|
|
8336
|
+
React59__namespace.useEffect(() => {
|
|
8217
8337
|
const handleKeyDown = (event) => {
|
|
8218
8338
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
8219
8339
|
event.preventDefault();
|
|
@@ -8224,7 +8344,7 @@ function SidebarProvider({
|
|
|
8224
8344
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
8225
8345
|
}, [toggleSidebar]);
|
|
8226
8346
|
const state = open ? "expanded" : "collapsed";
|
|
8227
|
-
const contextValue =
|
|
8347
|
+
const contextValue = React59__namespace.useMemo(
|
|
8228
8348
|
() => ({
|
|
8229
8349
|
state,
|
|
8230
8350
|
open,
|
|
@@ -8606,7 +8726,7 @@ function SidebarMenuButton({
|
|
|
8606
8726
|
}) {
|
|
8607
8727
|
const Comp = asChild ? radixUi.Slot.Slot : "button";
|
|
8608
8728
|
const { isMobile, setOpenMobile, state } = useSidebar();
|
|
8609
|
-
const handleClick =
|
|
8729
|
+
const handleClick = React59__namespace.useCallback(
|
|
8610
8730
|
(event) => {
|
|
8611
8731
|
if (onClick) {
|
|
8612
8732
|
onClick(event);
|
|
@@ -8704,7 +8824,7 @@ function SidebarMenuSkeleton({
|
|
|
8704
8824
|
showIcon = false,
|
|
8705
8825
|
...props
|
|
8706
8826
|
}) {
|
|
8707
|
-
const width =
|
|
8827
|
+
const width = React59__namespace.useMemo(() => {
|
|
8708
8828
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
8709
8829
|
}, []);
|
|
8710
8830
|
return /* @__PURE__ */ jsxs(
|
|
@@ -8775,7 +8895,7 @@ function SidebarMenuSubButton({
|
|
|
8775
8895
|
}) {
|
|
8776
8896
|
const Comp = asChild ? radixUi.Slot.Slot : "a";
|
|
8777
8897
|
const { isMobile, setOpenMobile } = useSidebar();
|
|
8778
|
-
const handleClick =
|
|
8898
|
+
const handleClick = React59__namespace.useCallback(
|
|
8779
8899
|
(event) => {
|
|
8780
8900
|
if (onClick) {
|
|
8781
8901
|
onClick(event);
|
|
@@ -8814,7 +8934,7 @@ function Slider({
|
|
|
8814
8934
|
max: max2 = 100,
|
|
8815
8935
|
...props
|
|
8816
8936
|
}) {
|
|
8817
|
-
const _values =
|
|
8937
|
+
const _values = React59__namespace.useMemo(
|
|
8818
8938
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min2, max2],
|
|
8819
8939
|
[value, defaultValue, min2, max2]
|
|
8820
8940
|
);
|
|
@@ -8886,7 +9006,7 @@ function Switch({
|
|
|
8886
9006
|
{
|
|
8887
9007
|
"data-slot": "switch",
|
|
8888
9008
|
className: cn(
|
|
8889
|
-
"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",
|
|
9009
|
+
"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",
|
|
8890
9010
|
className
|
|
8891
9011
|
),
|
|
8892
9012
|
...props,
|
|
@@ -9006,17 +9126,17 @@ function TableCaption({
|
|
|
9006
9126
|
}
|
|
9007
9127
|
);
|
|
9008
9128
|
}
|
|
9009
|
-
var TabsContext =
|
|
9129
|
+
var TabsContext = React59__namespace.createContext(null);
|
|
9010
9130
|
var useTabsContext = (component) => {
|
|
9011
|
-
const context =
|
|
9131
|
+
const context = React59__namespace.useContext(TabsContext);
|
|
9012
9132
|
if (!context) {
|
|
9013
9133
|
throw new Error(`${component} must be used within <Tabs>`);
|
|
9014
9134
|
}
|
|
9015
9135
|
return context;
|
|
9016
9136
|
};
|
|
9017
|
-
var TabsVariantContext =
|
|
9137
|
+
var TabsVariantContext = React59__namespace.createContext("default");
|
|
9018
9138
|
var useTabsVariant = (variant) => {
|
|
9019
|
-
const contextVariant =
|
|
9139
|
+
const contextVariant = React59__namespace.useContext(TabsVariantContext);
|
|
9020
9140
|
return variant != null ? variant : contextVariant;
|
|
9021
9141
|
};
|
|
9022
9142
|
var tabsListVariants = {
|
|
@@ -9059,7 +9179,7 @@ var mergeRefs = (...refs) => (node) => {
|
|
|
9059
9179
|
}
|
|
9060
9180
|
});
|
|
9061
9181
|
};
|
|
9062
|
-
var Tabs =
|
|
9182
|
+
var Tabs = React59__namespace.forwardRef(
|
|
9063
9183
|
({
|
|
9064
9184
|
className,
|
|
9065
9185
|
children,
|
|
@@ -9071,14 +9191,14 @@ var Tabs = React58__namespace.forwardRef(
|
|
|
9071
9191
|
...props
|
|
9072
9192
|
}, ref) => {
|
|
9073
9193
|
var _a2;
|
|
9074
|
-
const id =
|
|
9194
|
+
const id = React59__namespace.useId();
|
|
9075
9195
|
const isControlled = valueProp !== void 0;
|
|
9076
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
9196
|
+
const [uncontrolledValue, setUncontrolledValue] = React59__namespace.useState(
|
|
9077
9197
|
() => defaultValue != null ? defaultValue : null
|
|
9078
9198
|
);
|
|
9079
9199
|
const value = (_a2 = isControlled ? valueProp : uncontrolledValue) != null ? _a2 : null;
|
|
9080
|
-
const triggersRef =
|
|
9081
|
-
const setValue =
|
|
9200
|
+
const triggersRef = React59__namespace.useRef(/* @__PURE__ */ new Map());
|
|
9201
|
+
const setValue = React59__namespace.useCallback(
|
|
9082
9202
|
(nextValue) => {
|
|
9083
9203
|
if (!isControlled) {
|
|
9084
9204
|
setUncontrolledValue(nextValue);
|
|
@@ -9087,7 +9207,7 @@ var Tabs = React58__namespace.forwardRef(
|
|
|
9087
9207
|
},
|
|
9088
9208
|
[isControlled, onValueChange]
|
|
9089
9209
|
);
|
|
9090
|
-
const registerTrigger =
|
|
9210
|
+
const registerTrigger = React59__namespace.useCallback(
|
|
9091
9211
|
(triggerValue, node) => {
|
|
9092
9212
|
if (node) {
|
|
9093
9213
|
const wasEmpty = triggersRef.current.size === 0;
|
|
@@ -9101,7 +9221,7 @@ var Tabs = React58__namespace.forwardRef(
|
|
|
9101
9221
|
},
|
|
9102
9222
|
[defaultValue, isControlled, setUncontrolledValue, value]
|
|
9103
9223
|
);
|
|
9104
|
-
const getTriggerNode =
|
|
9224
|
+
const getTriggerNode = React59__namespace.useCallback(
|
|
9105
9225
|
(triggerValue) => {
|
|
9106
9226
|
var _a3;
|
|
9107
9227
|
if (!triggerValue) {
|
|
@@ -9111,7 +9231,7 @@ var Tabs = React58__namespace.forwardRef(
|
|
|
9111
9231
|
},
|
|
9112
9232
|
[]
|
|
9113
9233
|
);
|
|
9114
|
-
const focusTriggerByIndex =
|
|
9234
|
+
const focusTriggerByIndex = React59__namespace.useCallback(
|
|
9115
9235
|
(index2) => {
|
|
9116
9236
|
const values = Array.from(triggersRef.current.keys());
|
|
9117
9237
|
if (!values.length) {
|
|
@@ -9127,7 +9247,7 @@ var Tabs = React58__namespace.forwardRef(
|
|
|
9127
9247
|
},
|
|
9128
9248
|
[activationMode, setValue]
|
|
9129
9249
|
);
|
|
9130
|
-
const focusNextTrigger =
|
|
9250
|
+
const focusNextTrigger = React59__namespace.useCallback(
|
|
9131
9251
|
(currentValue, direction) => {
|
|
9132
9252
|
const values = Array.from(triggersRef.current.keys());
|
|
9133
9253
|
const currentIndex = values.indexOf(currentValue);
|
|
@@ -9138,7 +9258,7 @@ var Tabs = React58__namespace.forwardRef(
|
|
|
9138
9258
|
},
|
|
9139
9259
|
[focusTriggerByIndex]
|
|
9140
9260
|
);
|
|
9141
|
-
const focusEdgeTrigger =
|
|
9261
|
+
const focusEdgeTrigger = React59__namespace.useCallback(
|
|
9142
9262
|
(edge) => {
|
|
9143
9263
|
const values = Array.from(triggersRef.current.keys());
|
|
9144
9264
|
if (!values.length) {
|
|
@@ -9148,16 +9268,16 @@ var Tabs = React58__namespace.forwardRef(
|
|
|
9148
9268
|
},
|
|
9149
9269
|
[focusTriggerByIndex]
|
|
9150
9270
|
);
|
|
9151
|
-
const [orientation, setOrientationState] =
|
|
9152
|
-
const setOrientation =
|
|
9271
|
+
const [orientation, setOrientationState] = React59__namespace.useState("horizontal");
|
|
9272
|
+
const setOrientation = React59__namespace.useCallback((nextOrientation) => {
|
|
9153
9273
|
setOrientationState(nextOrientation);
|
|
9154
9274
|
}, []);
|
|
9155
|
-
|
|
9275
|
+
React59__namespace.useEffect(() => {
|
|
9156
9276
|
if (!isControlled && value == null && defaultValue) {
|
|
9157
9277
|
setUncontrolledValue(defaultValue);
|
|
9158
9278
|
}
|
|
9159
9279
|
}, [defaultValue, isControlled, setUncontrolledValue, value]);
|
|
9160
|
-
const contextValue =
|
|
9280
|
+
const contextValue = React59__namespace.useMemo(
|
|
9161
9281
|
() => ({
|
|
9162
9282
|
id,
|
|
9163
9283
|
value,
|
|
@@ -9186,15 +9306,15 @@ var Tabs = React58__namespace.forwardRef(
|
|
|
9186
9306
|
}
|
|
9187
9307
|
);
|
|
9188
9308
|
Tabs.displayName = "Tabs";
|
|
9189
|
-
var TabsList =
|
|
9309
|
+
var TabsList = React59__namespace.forwardRef(
|
|
9190
9310
|
({ className, variant, orientation = "horizontal", ...props }, ref) => {
|
|
9191
9311
|
const { value: activeValue, setOrientation, getTriggerNode } = useTabsContext("TabsList");
|
|
9192
9312
|
const activeVariant = useTabsVariant(variant);
|
|
9193
9313
|
const highlightClass = tabsListHighlightVariants[activeVariant];
|
|
9194
|
-
const localRef =
|
|
9195
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
9314
|
+
const localRef = React59__namespace.useRef(null);
|
|
9315
|
+
const [indicatorStyle, setIndicatorStyle] = React59__namespace.useState(null);
|
|
9196
9316
|
const highlightEnabled = highlightableVariants.has(activeVariant);
|
|
9197
|
-
const updateIndicator =
|
|
9317
|
+
const updateIndicator = React59__namespace.useCallback(() => {
|
|
9198
9318
|
if (!highlightEnabled) {
|
|
9199
9319
|
setIndicatorStyle(null);
|
|
9200
9320
|
return;
|
|
@@ -9230,13 +9350,13 @@ var TabsList = React58__namespace.forwardRef(
|
|
|
9230
9350
|
transform: `translate3d(${offsetLeft}px, ${offsetTop}px, 0)`
|
|
9231
9351
|
});
|
|
9232
9352
|
}, [activeValue, getTriggerNode, highlightEnabled]);
|
|
9233
|
-
|
|
9353
|
+
React59__namespace.useEffect(() => {
|
|
9234
9354
|
setOrientation(orientation);
|
|
9235
9355
|
}, [orientation, setOrientation]);
|
|
9236
|
-
|
|
9356
|
+
React59__namespace.useLayoutEffect(() => {
|
|
9237
9357
|
updateIndicator();
|
|
9238
9358
|
}, [updateIndicator]);
|
|
9239
|
-
|
|
9359
|
+
React59__namespace.useEffect(() => {
|
|
9240
9360
|
if (!highlightEnabled || typeof ResizeObserver === "undefined") {
|
|
9241
9361
|
return;
|
|
9242
9362
|
}
|
|
@@ -9256,7 +9376,7 @@ var TabsList = React58__namespace.forwardRef(
|
|
|
9256
9376
|
observer.disconnect();
|
|
9257
9377
|
};
|
|
9258
9378
|
}, [activeValue, getTriggerNode, highlightEnabled, updateIndicator]);
|
|
9259
|
-
|
|
9379
|
+
React59__namespace.useEffect(() => {
|
|
9260
9380
|
if (!highlightEnabled || typeof MutationObserver === "undefined") {
|
|
9261
9381
|
return;
|
|
9262
9382
|
}
|
|
@@ -9272,7 +9392,7 @@ var TabsList = React58__namespace.forwardRef(
|
|
|
9272
9392
|
observer.disconnect();
|
|
9273
9393
|
};
|
|
9274
9394
|
}, [highlightEnabled, updateIndicator]);
|
|
9275
|
-
|
|
9395
|
+
React59__namespace.useEffect(() => {
|
|
9276
9396
|
if (!highlightEnabled) {
|
|
9277
9397
|
return;
|
|
9278
9398
|
}
|
|
@@ -9312,7 +9432,7 @@ var TabsList = React58__namespace.forwardRef(
|
|
|
9312
9432
|
}
|
|
9313
9433
|
);
|
|
9314
9434
|
TabsList.displayName = "TabsList";
|
|
9315
|
-
var TabsTrigger =
|
|
9435
|
+
var TabsTrigger = React59__namespace.forwardRef(
|
|
9316
9436
|
({ className, variant, value, disabled, onClick, onKeyDown, ...props }, forwardedRef) => {
|
|
9317
9437
|
const {
|
|
9318
9438
|
id,
|
|
@@ -9324,11 +9444,11 @@ var TabsTrigger = React58__namespace.forwardRef(
|
|
|
9324
9444
|
orientation
|
|
9325
9445
|
} = useTabsContext("TabsTrigger");
|
|
9326
9446
|
const activeVariant = useTabsVariant(variant);
|
|
9327
|
-
const localRef =
|
|
9447
|
+
const localRef = React59__namespace.useRef(null);
|
|
9328
9448
|
const isActive = activeValue === value;
|
|
9329
9449
|
const triggerId = `${id}-trigger-${value}`;
|
|
9330
9450
|
const contentId = `${id}-content-${value}`;
|
|
9331
|
-
|
|
9451
|
+
React59__namespace.useEffect(() => {
|
|
9332
9452
|
registerTrigger(value, localRef.current);
|
|
9333
9453
|
return () => registerTrigger(value, null);
|
|
9334
9454
|
}, [registerTrigger, value]);
|
|
@@ -9403,7 +9523,7 @@ var TabsTrigger = React58__namespace.forwardRef(
|
|
|
9403
9523
|
}
|
|
9404
9524
|
);
|
|
9405
9525
|
TabsTrigger.displayName = "TabsTrigger";
|
|
9406
|
-
var TabsContent =
|
|
9526
|
+
var TabsContent = React59__namespace.forwardRef(
|
|
9407
9527
|
({ className, variant, value, ...props }, ref) => {
|
|
9408
9528
|
const { id, value: activeValue } = useTabsContext("TabsContent");
|
|
9409
9529
|
const activeVariant = useTabsVariant(variant);
|
|
@@ -9430,21 +9550,44 @@ var TabsContent = React58__namespace.forwardRef(
|
|
|
9430
9550
|
}
|
|
9431
9551
|
);
|
|
9432
9552
|
TabsContent.displayName = "TabsContent";
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9553
|
+
var Textarea = React59__namespace.forwardRef(
|
|
9554
|
+
({ className, onFocus, ...props }, forwardedRef) => {
|
|
9555
|
+
const setRefs = React59__namespace.useCallback(
|
|
9556
|
+
(node) => {
|
|
9557
|
+
if (typeof forwardedRef === "function") {
|
|
9558
|
+
forwardedRef(node);
|
|
9559
|
+
} else if (forwardedRef) {
|
|
9560
|
+
forwardedRef.current = node;
|
|
9561
|
+
}
|
|
9562
|
+
},
|
|
9563
|
+
[forwardedRef]
|
|
9564
|
+
);
|
|
9565
|
+
const handleFocus = React59__namespace.useCallback(
|
|
9566
|
+
(event) => {
|
|
9567
|
+
onFocus == null ? void 0 : onFocus(event);
|
|
9568
|
+
if (event.defaultPrevented) {
|
|
9569
|
+
return;
|
|
9570
|
+
}
|
|
9571
|
+
maybeScrollElementIntoView(event.currentTarget);
|
|
9572
|
+
},
|
|
9573
|
+
[onFocus]
|
|
9574
|
+
);
|
|
9575
|
+
return /* @__PURE__ */ jsx(
|
|
9576
|
+
"textarea",
|
|
9577
|
+
{
|
|
9578
|
+
ref: setRefs,
|
|
9579
|
+
"data-slot": "textarea",
|
|
9580
|
+
onFocus: handleFocus,
|
|
9581
|
+
className: cn(
|
|
9582
|
+
"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",
|
|
9583
|
+
className
|
|
9584
|
+
),
|
|
9585
|
+
...props
|
|
9586
|
+
}
|
|
9587
|
+
);
|
|
9588
|
+
}
|
|
9589
|
+
);
|
|
9590
|
+
Textarea.displayName = "Textarea";
|
|
9448
9591
|
var toggleVariants = classVarianceAuthority.cva(
|
|
9449
9592
|
"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",
|
|
9450
9593
|
{
|
|
@@ -9480,7 +9623,7 @@ function Toggle({
|
|
|
9480
9623
|
}
|
|
9481
9624
|
);
|
|
9482
9625
|
}
|
|
9483
|
-
var ToggleGroupContext =
|
|
9626
|
+
var ToggleGroupContext = React59__namespace.createContext({
|
|
9484
9627
|
size: "default",
|
|
9485
9628
|
variant: "default"
|
|
9486
9629
|
});
|
|
@@ -9513,7 +9656,7 @@ function ToggleGroupItem({
|
|
|
9513
9656
|
size: size4,
|
|
9514
9657
|
...props
|
|
9515
9658
|
}) {
|
|
9516
|
-
const context =
|
|
9659
|
+
const context = React59__namespace.useContext(ToggleGroupContext);
|
|
9517
9660
|
return /* @__PURE__ */ jsx(
|
|
9518
9661
|
radixUi.ToggleGroup.Item,
|
|
9519
9662
|
{
|
|
@@ -9657,9 +9800,9 @@ function MobileWheelColumn2({
|
|
|
9657
9800
|
onValueChange,
|
|
9658
9801
|
open
|
|
9659
9802
|
}) {
|
|
9660
|
-
const listRef =
|
|
9661
|
-
const scrollTimeoutRef =
|
|
9662
|
-
const extendedOptions =
|
|
9803
|
+
const listRef = React59__namespace.useRef(null);
|
|
9804
|
+
const scrollTimeoutRef = React59__namespace.useRef(null);
|
|
9805
|
+
const extendedOptions = React59__namespace.useMemo(() => {
|
|
9663
9806
|
if (options.length === 0) {
|
|
9664
9807
|
return [];
|
|
9665
9808
|
}
|
|
@@ -9671,7 +9814,7 @@ function MobileWheelColumn2({
|
|
|
9671
9814
|
}
|
|
9672
9815
|
return repeated;
|
|
9673
9816
|
}, [options]);
|
|
9674
|
-
const alignToValue =
|
|
9817
|
+
const alignToValue = React59__namespace.useCallback(
|
|
9675
9818
|
(value, behavior = "auto") => {
|
|
9676
9819
|
if (!listRef.current || options.length === 0 || extendedOptions.length === 0) {
|
|
9677
9820
|
return;
|
|
@@ -9685,18 +9828,18 @@ function MobileWheelColumn2({
|
|
|
9685
9828
|
},
|
|
9686
9829
|
[extendedOptions.length, options]
|
|
9687
9830
|
);
|
|
9688
|
-
|
|
9831
|
+
React59__namespace.useLayoutEffect(() => {
|
|
9689
9832
|
if (!open) {
|
|
9690
9833
|
return;
|
|
9691
9834
|
}
|
|
9692
9835
|
alignToValue(selectedValue);
|
|
9693
9836
|
}, [alignToValue, open, options, selectedValue]);
|
|
9694
|
-
|
|
9837
|
+
React59__namespace.useEffect(() => () => {
|
|
9695
9838
|
if (scrollTimeoutRef.current !== null) {
|
|
9696
9839
|
clearTimeout(scrollTimeoutRef.current);
|
|
9697
9840
|
}
|
|
9698
9841
|
}, []);
|
|
9699
|
-
const handleScroll2 =
|
|
9842
|
+
const handleScroll2 = React59__namespace.useCallback(
|
|
9700
9843
|
(event) => {
|
|
9701
9844
|
if (extendedOptions.length === 0 || options.length === 0) {
|
|
9702
9845
|
return;
|
|
@@ -9785,7 +9928,7 @@ var MeridiemColumn = ({ value, onChange }) => /* @__PURE__ */ jsxs("div", { clas
|
|
|
9785
9928
|
);
|
|
9786
9929
|
}) })
|
|
9787
9930
|
] });
|
|
9788
|
-
var TimePicker =
|
|
9931
|
+
var TimePicker = React59__namespace.forwardRef((props, ref) => {
|
|
9789
9932
|
var _a2, _b, _c, _d;
|
|
9790
9933
|
const {
|
|
9791
9934
|
value: valueProp,
|
|
@@ -9827,21 +9970,21 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
9827
9970
|
const isMobile = useIsMobile();
|
|
9828
9971
|
const shouldUseDrawer = isNative || isMobile;
|
|
9829
9972
|
const isControlled = valueProp !== void 0;
|
|
9830
|
-
const [internalValue, setInternalValue] =
|
|
9973
|
+
const [internalValue, setInternalValue] = React59__namespace.useState(defaultValue);
|
|
9831
9974
|
const currentValue = (_a2 = isControlled ? valueProp : internalValue) != null ? _a2 : null;
|
|
9832
|
-
const parsedValue =
|
|
9833
|
-
const resolvedMeridiem =
|
|
9975
|
+
const parsedValue = React59__namespace.useMemo(() => parseTimeString(currentValue), [currentValue]);
|
|
9976
|
+
const resolvedMeridiem = React59__namespace.useMemo(
|
|
9834
9977
|
() => {
|
|
9835
9978
|
var _a3;
|
|
9836
9979
|
return ((_a3 = parsedValue == null ? void 0 : parsedValue.hour) != null ? _a3 : 0) >= 12 ? "PM" : "AM";
|
|
9837
9980
|
},
|
|
9838
9981
|
[parsedValue == null ? void 0 : parsedValue.hour]
|
|
9839
9982
|
);
|
|
9840
|
-
const [meridiem, setMeridiem] =
|
|
9841
|
-
|
|
9983
|
+
const [meridiem, setMeridiem] = React59__namespace.useState(resolvedMeridiem);
|
|
9984
|
+
React59__namespace.useEffect(() => {
|
|
9842
9985
|
setMeridiem(resolvedMeridiem);
|
|
9843
9986
|
}, [resolvedMeridiem]);
|
|
9844
|
-
const inferredShowSeconds =
|
|
9987
|
+
const inferredShowSeconds = React59__namespace.useMemo(() => {
|
|
9845
9988
|
if (typeof showSecondsProp === "boolean") {
|
|
9846
9989
|
return showSecondsProp;
|
|
9847
9990
|
}
|
|
@@ -9850,12 +9993,12 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
9850
9993
|
}
|
|
9851
9994
|
return Boolean(currentValue && currentValue.split(":").length === 3);
|
|
9852
9995
|
}, [currentValue, format, showSecondsProp]);
|
|
9853
|
-
const defaultFormat =
|
|
9996
|
+
const defaultFormat = React59__namespace.useMemo(
|
|
9854
9997
|
() => use12Hours ? inferredShowSeconds ? "hh:mm:ss A" : "hh:mm A" : inferredShowSeconds ? "HH:mm:ss" : "HH:mm",
|
|
9855
9998
|
[inferredShowSeconds, use12Hours]
|
|
9856
9999
|
);
|
|
9857
10000
|
const resolvedFormat = typeof format === "string" ? format : defaultFormat;
|
|
9858
|
-
const formatValue =
|
|
10001
|
+
const formatValue = React59__namespace.useCallback(
|
|
9859
10002
|
(value) => {
|
|
9860
10003
|
if (!value) {
|
|
9861
10004
|
return "";
|
|
@@ -9867,21 +10010,21 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
9867
10010
|
},
|
|
9868
10011
|
[format, resolvedFormat]
|
|
9869
10012
|
);
|
|
9870
|
-
const [inputValue, setInputValue] =
|
|
9871
|
-
|
|
10013
|
+
const [inputValue, setInputValue] = React59__namespace.useState(() => formatValue(parsedValue));
|
|
10014
|
+
React59__namespace.useEffect(() => {
|
|
9872
10015
|
setInputValue(formatValue(parsedValue));
|
|
9873
10016
|
}, [formatValue, parsedValue]);
|
|
9874
10017
|
const allowClearConfig = typeof allowClear === "object" && allowClear !== null && !Array.isArray(allowClear) ? allowClear : void 0;
|
|
9875
10018
|
const clearIcon = (_b = allowClearConfig == null ? void 0 : allowClearConfig.clearIcon) != null ? _b : /* @__PURE__ */ jsx(lucideReact.X, { className: "h-4 w-4", strokeWidth: 2 });
|
|
9876
10019
|
const showClear = Boolean(allowClear) && !disabled && Boolean(currentValue);
|
|
9877
|
-
const primaryColorStyle =
|
|
10020
|
+
const primaryColorStyle = React59__namespace.useMemo(
|
|
9878
10021
|
() => ({ "--date-primary-color": DEFAULT_PRIMARY_COLOR2 }),
|
|
9879
10022
|
[]
|
|
9880
10023
|
);
|
|
9881
10024
|
const isOpenControlled = openProp !== void 0;
|
|
9882
|
-
const [internalOpen, setInternalOpen] =
|
|
10025
|
+
const [internalOpen, setInternalOpen] = React59__namespace.useState(Boolean(defaultOpen));
|
|
9883
10026
|
const open = isOpenControlled ? Boolean(openProp) : internalOpen;
|
|
9884
|
-
const handleOpenChange =
|
|
10027
|
+
const handleOpenChange = React59__namespace.useCallback(
|
|
9885
10028
|
(nextOpen) => {
|
|
9886
10029
|
if (disabled) {
|
|
9887
10030
|
return;
|
|
@@ -9893,7 +10036,7 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
9893
10036
|
},
|
|
9894
10037
|
[disabled, isOpenControlled, onOpenChange]
|
|
9895
10038
|
);
|
|
9896
|
-
const commitValue =
|
|
10039
|
+
const commitValue = React59__namespace.useCallback(
|
|
9897
10040
|
(next) => {
|
|
9898
10041
|
if (!next) {
|
|
9899
10042
|
if (!isControlled) {
|
|
@@ -9917,7 +10060,7 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
9917
10060
|
const safeHourStep = Math.max(1, Math.floor(hourStep));
|
|
9918
10061
|
const safeMinuteStep = Math.max(1, Math.floor(minuteStep));
|
|
9919
10062
|
const safeSecondStep = Math.max(1, Math.floor(secondStep));
|
|
9920
|
-
const hourOptions =
|
|
10063
|
+
const hourOptions = React59__namespace.useMemo(() => {
|
|
9921
10064
|
if (use12Hours) {
|
|
9922
10065
|
const values = [];
|
|
9923
10066
|
for (let hour = 1; hour <= 12; hour += safeHourStep) {
|
|
@@ -9935,14 +10078,14 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
9935
10078
|
}
|
|
9936
10079
|
return result;
|
|
9937
10080
|
}, [safeHourStep, use12Hours]);
|
|
9938
|
-
const minuteOptions =
|
|
10081
|
+
const minuteOptions = React59__namespace.useMemo(() => {
|
|
9939
10082
|
const result = [];
|
|
9940
10083
|
for (let minute = 0; minute < 60; minute += safeMinuteStep) {
|
|
9941
10084
|
result.push({ label: pad(minute), value: minute });
|
|
9942
10085
|
}
|
|
9943
10086
|
return result;
|
|
9944
10087
|
}, [safeMinuteStep]);
|
|
9945
|
-
const secondOptions =
|
|
10088
|
+
const secondOptions = React59__namespace.useMemo(() => {
|
|
9946
10089
|
if (!inferredShowSeconds) {
|
|
9947
10090
|
return [];
|
|
9948
10091
|
}
|
|
@@ -9952,7 +10095,7 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
9952
10095
|
}
|
|
9953
10096
|
return result;
|
|
9954
10097
|
}, [inferredShowSeconds, safeSecondStep]);
|
|
9955
|
-
const resolvedHourValue =
|
|
10098
|
+
const resolvedHourValue = React59__namespace.useMemo(() => {
|
|
9956
10099
|
if (!parsedValue) {
|
|
9957
10100
|
return use12Hours ? 12 : 0;
|
|
9958
10101
|
}
|
|
@@ -9960,7 +10103,7 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
9960
10103
|
}, [parsedValue, use12Hours]);
|
|
9961
10104
|
const resolvedMinuteValue = (_c = parsedValue == null ? void 0 : parsedValue.minute) != null ? _c : 0;
|
|
9962
10105
|
const resolvedSecondValue = (_d = parsedValue == null ? void 0 : parsedValue.second) != null ? _d : 0;
|
|
9963
|
-
const handleHourSelect =
|
|
10106
|
+
const handleHourSelect = React59__namespace.useCallback(
|
|
9964
10107
|
(value) => {
|
|
9965
10108
|
if (use12Hours) {
|
|
9966
10109
|
const hour24 = convert12To24(value, meridiem);
|
|
@@ -9971,19 +10114,19 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
9971
10114
|
},
|
|
9972
10115
|
[baseValue, commitValue, meridiem, use12Hours]
|
|
9973
10116
|
);
|
|
9974
|
-
const handleMinuteSelect =
|
|
10117
|
+
const handleMinuteSelect = React59__namespace.useCallback(
|
|
9975
10118
|
(value) => {
|
|
9976
10119
|
commitValue({ ...baseValue, minute: value });
|
|
9977
10120
|
},
|
|
9978
10121
|
[baseValue, commitValue]
|
|
9979
10122
|
);
|
|
9980
|
-
const handleSecondSelect =
|
|
10123
|
+
const handleSecondSelect = React59__namespace.useCallback(
|
|
9981
10124
|
(value) => {
|
|
9982
10125
|
commitValue({ ...baseValue, second: value });
|
|
9983
10126
|
},
|
|
9984
10127
|
[baseValue, commitValue]
|
|
9985
10128
|
);
|
|
9986
|
-
const handleMeridiemChange =
|
|
10129
|
+
const handleMeridiemChange = React59__namespace.useCallback(
|
|
9987
10130
|
(nextMeridiem) => {
|
|
9988
10131
|
setMeridiem(nextMeridiem);
|
|
9989
10132
|
const current = parsedValue != null ? parsedValue : baseValue;
|
|
@@ -9998,7 +10141,7 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
9998
10141
|
},
|
|
9999
10142
|
[baseValue, commitValue, parsedValue]
|
|
10000
10143
|
);
|
|
10001
|
-
const handleInputChange =
|
|
10144
|
+
const handleInputChange = React59__namespace.useCallback(
|
|
10002
10145
|
(event) => {
|
|
10003
10146
|
const nextValue = event.target.value;
|
|
10004
10147
|
setInputValue(nextValue);
|
|
@@ -10106,7 +10249,7 @@ var TimePicker = React58__namespace.forwardRef((props, ref) => {
|
|
|
10106
10249
|
]
|
|
10107
10250
|
}
|
|
10108
10251
|
);
|
|
10109
|
-
const periodWheelOptions =
|
|
10252
|
+
const periodWheelOptions = React59__namespace.useMemo(
|
|
10110
10253
|
() => [
|
|
10111
10254
|
{ label: "AM", value: "AM" },
|
|
10112
10255
|
{ label: "PM", value: "PM" }
|
|
@@ -10277,7 +10420,7 @@ function DataTable({
|
|
|
10277
10420
|
var _a2;
|
|
10278
10421
|
const rowModel = (_a2 = virtualizedRows == null ? void 0 : virtualizedRows.rows) != null ? _a2 : table.getRowModel().rows;
|
|
10279
10422
|
const dataIds = dndEnabled ? rowModel.map((row) => Number(row.id)) : [];
|
|
10280
|
-
const sortableId =
|
|
10423
|
+
const sortableId = React59__namespace.useId();
|
|
10281
10424
|
const sensors = core.useSensors(core.useSensor(core.MouseSensor, {}), core.useSensor(core.TouchSensor, {}), core.useSensor(core.KeyboardSensor, {}));
|
|
10282
10425
|
function handleDragEnd(event) {
|
|
10283
10426
|
const { active, over } = event;
|
|
@@ -10479,21 +10622,21 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
10479
10622
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
10480
10623
|
let defaultContexts = [];
|
|
10481
10624
|
function createContext32(rootComponentName, defaultContext) {
|
|
10482
|
-
const BaseContext =
|
|
10625
|
+
const BaseContext = React59__namespace.createContext(defaultContext);
|
|
10483
10626
|
const index2 = defaultContexts.length;
|
|
10484
10627
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
10485
10628
|
const Provider = (props) => {
|
|
10486
10629
|
var _a2;
|
|
10487
10630
|
const { scope, children, ...context } = props;
|
|
10488
10631
|
const Context = ((_a2 = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a2[index2]) || BaseContext;
|
|
10489
|
-
const value =
|
|
10632
|
+
const value = React59__namespace.useMemo(() => context, Object.values(context));
|
|
10490
10633
|
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
10491
10634
|
};
|
|
10492
10635
|
Provider.displayName = rootComponentName + "Provider";
|
|
10493
10636
|
function useContext22(consumerName, scope) {
|
|
10494
10637
|
var _a2;
|
|
10495
10638
|
const Context = ((_a2 = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a2[index2]) || BaseContext;
|
|
10496
|
-
const context =
|
|
10639
|
+
const context = React59__namespace.useContext(Context);
|
|
10497
10640
|
if (context) return context;
|
|
10498
10641
|
if (defaultContext !== void 0) return defaultContext;
|
|
10499
10642
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -10502,11 +10645,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
10502
10645
|
}
|
|
10503
10646
|
const createScope = () => {
|
|
10504
10647
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
10505
|
-
return
|
|
10648
|
+
return React59__namespace.createContext(defaultContext);
|
|
10506
10649
|
});
|
|
10507
10650
|
return function useScope(scope) {
|
|
10508
10651
|
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
|
10509
|
-
return
|
|
10652
|
+
return React59__namespace.useMemo(
|
|
10510
10653
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
10511
10654
|
[scope, contexts]
|
|
10512
10655
|
);
|
|
@@ -10529,15 +10672,15 @@ function composeContextScopes(...scopes) {
|
|
|
10529
10672
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
10530
10673
|
return { ...nextScopes2, ...currentScope };
|
|
10531
10674
|
}, {});
|
|
10532
|
-
return
|
|
10675
|
+
return React59__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
10533
10676
|
};
|
|
10534
10677
|
};
|
|
10535
10678
|
createScope.scopeName = baseScope.scopeName;
|
|
10536
10679
|
return createScope;
|
|
10537
10680
|
}
|
|
10538
|
-
var useLayoutEffect22 = (globalThis == null ? void 0 : globalThis.document) ?
|
|
10681
|
+
var useLayoutEffect22 = (globalThis == null ? void 0 : globalThis.document) ? React59__namespace.useLayoutEffect : () => {
|
|
10539
10682
|
};
|
|
10540
|
-
var useInsertionEffect =
|
|
10683
|
+
var useInsertionEffect = React59__namespace[" useInsertionEffect ".trim().toString()] || useLayoutEffect22;
|
|
10541
10684
|
function useControllableState({
|
|
10542
10685
|
prop,
|
|
10543
10686
|
defaultProp,
|
|
@@ -10552,8 +10695,8 @@ function useControllableState({
|
|
|
10552
10695
|
const isControlled = prop !== void 0;
|
|
10553
10696
|
const value = isControlled ? prop : uncontrolledProp;
|
|
10554
10697
|
{
|
|
10555
|
-
const isControlledRef =
|
|
10556
|
-
|
|
10698
|
+
const isControlledRef = React59__namespace.useRef(prop !== void 0);
|
|
10699
|
+
React59__namespace.useEffect(() => {
|
|
10557
10700
|
const wasControlled = isControlledRef.current;
|
|
10558
10701
|
if (wasControlled !== isControlled) {
|
|
10559
10702
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -10565,7 +10708,7 @@ function useControllableState({
|
|
|
10565
10708
|
isControlledRef.current = isControlled;
|
|
10566
10709
|
}, [isControlled, caller]);
|
|
10567
10710
|
}
|
|
10568
|
-
const setValue =
|
|
10711
|
+
const setValue = React59__namespace.useCallback(
|
|
10569
10712
|
(nextValue) => {
|
|
10570
10713
|
var _a2;
|
|
10571
10714
|
if (isControlled) {
|
|
@@ -10585,13 +10728,13 @@ function useUncontrolledState({
|
|
|
10585
10728
|
defaultProp,
|
|
10586
10729
|
onChange
|
|
10587
10730
|
}) {
|
|
10588
|
-
const [value, setValue] =
|
|
10589
|
-
const prevValueRef =
|
|
10590
|
-
const onChangeRef =
|
|
10731
|
+
const [value, setValue] = React59__namespace.useState(defaultProp);
|
|
10732
|
+
const prevValueRef = React59__namespace.useRef(value);
|
|
10733
|
+
const onChangeRef = React59__namespace.useRef(onChange);
|
|
10591
10734
|
useInsertionEffect(() => {
|
|
10592
10735
|
onChangeRef.current = onChange;
|
|
10593
10736
|
}, [onChange]);
|
|
10594
|
-
|
|
10737
|
+
React59__namespace.useEffect(() => {
|
|
10595
10738
|
var _a2;
|
|
10596
10739
|
if (prevValueRef.current !== value) {
|
|
10597
10740
|
(_a2 = onChangeRef.current) == null ? void 0 : _a2.call(onChangeRef, value);
|
|
@@ -10624,7 +10767,7 @@ var NODES = [
|
|
|
10624
10767
|
];
|
|
10625
10768
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
10626
10769
|
const Slot3 = createSlot(`Primitive.${node}`);
|
|
10627
|
-
const Node2 =
|
|
10770
|
+
const Node2 = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
10628
10771
|
const { asChild, ...primitiveProps } = props;
|
|
10629
10772
|
const Comp = asChild ? Slot3 : node;
|
|
10630
10773
|
if (typeof window !== "undefined") {
|
|
@@ -10647,14 +10790,14 @@ function createCollection(name) {
|
|
|
10647
10790
|
);
|
|
10648
10791
|
const CollectionProvider = (props) => {
|
|
10649
10792
|
const { scope, children } = props;
|
|
10650
|
-
const ref =
|
|
10651
|
-
const itemMap =
|
|
10793
|
+
const ref = React59__namespace.default.useRef(null);
|
|
10794
|
+
const itemMap = React59__namespace.default.useRef(/* @__PURE__ */ new Map()).current;
|
|
10652
10795
|
return /* @__PURE__ */ jsxRuntime.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
10653
10796
|
};
|
|
10654
10797
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
10655
10798
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
10656
10799
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
10657
|
-
const CollectionSlot =
|
|
10800
|
+
const CollectionSlot = React59__namespace.default.forwardRef(
|
|
10658
10801
|
(props, forwardedRef) => {
|
|
10659
10802
|
const { scope, children } = props;
|
|
10660
10803
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -10666,13 +10809,13 @@ function createCollection(name) {
|
|
|
10666
10809
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
10667
10810
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
10668
10811
|
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
10669
|
-
const CollectionItemSlot =
|
|
10812
|
+
const CollectionItemSlot = React59__namespace.default.forwardRef(
|
|
10670
10813
|
(props, forwardedRef) => {
|
|
10671
10814
|
const { scope, children, ...itemData } = props;
|
|
10672
|
-
const ref =
|
|
10815
|
+
const ref = React59__namespace.default.useRef(null);
|
|
10673
10816
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10674
10817
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
10675
|
-
|
|
10818
|
+
React59__namespace.default.useEffect(() => {
|
|
10676
10819
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
10677
10820
|
return () => void context.itemMap.delete(ref);
|
|
10678
10821
|
});
|
|
@@ -10682,7 +10825,7 @@ function createCollection(name) {
|
|
|
10682
10825
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
10683
10826
|
function useCollection3(scope) {
|
|
10684
10827
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
10685
|
-
const getItems =
|
|
10828
|
+
const getItems = React59__namespace.default.useCallback(() => {
|
|
10686
10829
|
const collectionNode = context.collectionRef.current;
|
|
10687
10830
|
if (!collectionNode) return [];
|
|
10688
10831
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -10700,24 +10843,24 @@ function createCollection(name) {
|
|
|
10700
10843
|
createCollectionScope3
|
|
10701
10844
|
];
|
|
10702
10845
|
}
|
|
10703
|
-
var DirectionContext =
|
|
10846
|
+
var DirectionContext = React59__namespace.createContext(void 0);
|
|
10704
10847
|
function useDirection(localDir) {
|
|
10705
|
-
const globalDir =
|
|
10848
|
+
const globalDir = React59__namespace.useContext(DirectionContext);
|
|
10706
10849
|
return localDir || globalDir || "ltr";
|
|
10707
10850
|
}
|
|
10708
10851
|
function useCallbackRef(callback) {
|
|
10709
|
-
const callbackRef =
|
|
10710
|
-
|
|
10852
|
+
const callbackRef = React59__namespace.useRef(callback);
|
|
10853
|
+
React59__namespace.useEffect(() => {
|
|
10711
10854
|
callbackRef.current = callback;
|
|
10712
10855
|
});
|
|
10713
|
-
return
|
|
10856
|
+
return React59__namespace.useMemo(() => (...args) => {
|
|
10714
10857
|
var _a2;
|
|
10715
10858
|
return (_a2 = callbackRef.current) == null ? void 0 : _a2.call(callbackRef, ...args);
|
|
10716
10859
|
}, []);
|
|
10717
10860
|
}
|
|
10718
10861
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
10719
10862
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
10720
|
-
|
|
10863
|
+
React59__namespace.useEffect(() => {
|
|
10721
10864
|
const handleKeyDown = (event) => {
|
|
10722
10865
|
if (event.key === "Escape") {
|
|
10723
10866
|
onEscapeKeyDown(event);
|
|
@@ -10732,12 +10875,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
10732
10875
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
10733
10876
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
10734
10877
|
var originalBodyPointerEvents;
|
|
10735
|
-
var DismissableLayerContext =
|
|
10878
|
+
var DismissableLayerContext = React59__namespace.createContext({
|
|
10736
10879
|
layers: /* @__PURE__ */ new Set(),
|
|
10737
10880
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
10738
10881
|
branches: /* @__PURE__ */ new Set()
|
|
10739
10882
|
});
|
|
10740
|
-
var DismissableLayer =
|
|
10883
|
+
var DismissableLayer = React59__namespace.forwardRef(
|
|
10741
10884
|
(props, forwardedRef) => {
|
|
10742
10885
|
var _a2;
|
|
10743
10886
|
const {
|
|
@@ -10749,10 +10892,10 @@ var DismissableLayer = React58__namespace.forwardRef(
|
|
|
10749
10892
|
onDismiss,
|
|
10750
10893
|
...layerProps
|
|
10751
10894
|
} = props;
|
|
10752
|
-
const context =
|
|
10753
|
-
const [node, setNode] =
|
|
10895
|
+
const context = React59__namespace.useContext(DismissableLayerContext);
|
|
10896
|
+
const [node, setNode] = React59__namespace.useState(null);
|
|
10754
10897
|
const ownerDocument = (_a2 = node == null ? void 0 : node.ownerDocument) != null ? _a2 : globalThis == null ? void 0 : globalThis.document;
|
|
10755
|
-
const [, force] =
|
|
10898
|
+
const [, force] = React59__namespace.useState({});
|
|
10756
10899
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
10757
10900
|
const layers = Array.from(context.layers);
|
|
10758
10901
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -10785,7 +10928,7 @@ var DismissableLayer = React58__namespace.forwardRef(
|
|
|
10785
10928
|
onDismiss();
|
|
10786
10929
|
}
|
|
10787
10930
|
}, ownerDocument);
|
|
10788
|
-
|
|
10931
|
+
React59__namespace.useEffect(() => {
|
|
10789
10932
|
if (!node) return;
|
|
10790
10933
|
if (disableOutsidePointerEvents) {
|
|
10791
10934
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -10802,7 +10945,7 @@ var DismissableLayer = React58__namespace.forwardRef(
|
|
|
10802
10945
|
}
|
|
10803
10946
|
};
|
|
10804
10947
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
10805
|
-
|
|
10948
|
+
React59__namespace.useEffect(() => {
|
|
10806
10949
|
return () => {
|
|
10807
10950
|
if (!node) return;
|
|
10808
10951
|
context.layers.delete(node);
|
|
@@ -10810,7 +10953,7 @@ var DismissableLayer = React58__namespace.forwardRef(
|
|
|
10810
10953
|
dispatchUpdate();
|
|
10811
10954
|
};
|
|
10812
10955
|
}, [node, context]);
|
|
10813
|
-
|
|
10956
|
+
React59__namespace.useEffect(() => {
|
|
10814
10957
|
const handleUpdate = () => force({});
|
|
10815
10958
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
10816
10959
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -10836,11 +10979,11 @@ var DismissableLayer = React58__namespace.forwardRef(
|
|
|
10836
10979
|
);
|
|
10837
10980
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
10838
10981
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
10839
|
-
var DismissableLayerBranch =
|
|
10840
|
-
const context =
|
|
10841
|
-
const ref =
|
|
10982
|
+
var DismissableLayerBranch = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
10983
|
+
const context = React59__namespace.useContext(DismissableLayerContext);
|
|
10984
|
+
const ref = React59__namespace.useRef(null);
|
|
10842
10985
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10843
|
-
|
|
10986
|
+
React59__namespace.useEffect(() => {
|
|
10844
10987
|
const node = ref.current;
|
|
10845
10988
|
if (node) {
|
|
10846
10989
|
context.branches.add(node);
|
|
@@ -10854,10 +10997,10 @@ var DismissableLayerBranch = React58__namespace.forwardRef((props, forwardedRef)
|
|
|
10854
10997
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
10855
10998
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
10856
10999
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
10857
|
-
const isPointerInsideReactTreeRef =
|
|
10858
|
-
const handleClickRef =
|
|
11000
|
+
const isPointerInsideReactTreeRef = React59__namespace.useRef(false);
|
|
11001
|
+
const handleClickRef = React59__namespace.useRef(() => {
|
|
10859
11002
|
});
|
|
10860
|
-
|
|
11003
|
+
React59__namespace.useEffect(() => {
|
|
10861
11004
|
const handlePointerDown = (event) => {
|
|
10862
11005
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
10863
11006
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -10897,8 +11040,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis
|
|
|
10897
11040
|
}
|
|
10898
11041
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
10899
11042
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
10900
|
-
const isFocusInsideReactTreeRef =
|
|
10901
|
-
|
|
11043
|
+
const isFocusInsideReactTreeRef = React59__namespace.useRef(false);
|
|
11044
|
+
React59__namespace.useEffect(() => {
|
|
10902
11045
|
const handleFocus = (event) => {
|
|
10903
11046
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
10904
11047
|
const eventDetail = { originalEvent: event };
|
|
@@ -10931,7 +11074,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
10931
11074
|
}
|
|
10932
11075
|
var count = 0;
|
|
10933
11076
|
function useFocusGuards() {
|
|
10934
|
-
|
|
11077
|
+
React59__namespace.useEffect(() => {
|
|
10935
11078
|
var _a2, _b;
|
|
10936
11079
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
10937
11080
|
document.body.insertAdjacentElement("afterbegin", (_a2 = edgeGuards[0]) != null ? _a2 : createFocusGuard());
|
|
@@ -10959,7 +11102,7 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
|
10959
11102
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
10960
11103
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
10961
11104
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
10962
|
-
var FocusScope =
|
|
11105
|
+
var FocusScope = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
10963
11106
|
const {
|
|
10964
11107
|
loop = false,
|
|
10965
11108
|
trapped = false,
|
|
@@ -10967,12 +11110,12 @@ var FocusScope = React58__namespace.forwardRef((props, forwardedRef) => {
|
|
|
10967
11110
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
10968
11111
|
...scopeProps
|
|
10969
11112
|
} = props;
|
|
10970
|
-
const [container, setContainer] =
|
|
11113
|
+
const [container, setContainer] = React59__namespace.useState(null);
|
|
10971
11114
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
10972
11115
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
10973
|
-
const lastFocusedElementRef =
|
|
11116
|
+
const lastFocusedElementRef = React59__namespace.useRef(null);
|
|
10974
11117
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
10975
|
-
const focusScope =
|
|
11118
|
+
const focusScope = React59__namespace.useRef({
|
|
10976
11119
|
paused: false,
|
|
10977
11120
|
pause() {
|
|
10978
11121
|
this.paused = true;
|
|
@@ -10981,7 +11124,7 @@ var FocusScope = React58__namespace.forwardRef((props, forwardedRef) => {
|
|
|
10981
11124
|
this.paused = false;
|
|
10982
11125
|
}
|
|
10983
11126
|
}).current;
|
|
10984
|
-
|
|
11127
|
+
React59__namespace.useEffect(() => {
|
|
10985
11128
|
if (trapped) {
|
|
10986
11129
|
let handleFocusIn2 = function(event) {
|
|
10987
11130
|
if (focusScope.paused || !container) return;
|
|
@@ -11016,7 +11159,7 @@ var FocusScope = React58__namespace.forwardRef((props, forwardedRef) => {
|
|
|
11016
11159
|
};
|
|
11017
11160
|
}
|
|
11018
11161
|
}, [trapped, container, focusScope.paused]);
|
|
11019
|
-
|
|
11162
|
+
React59__namespace.useEffect(() => {
|
|
11020
11163
|
if (container) {
|
|
11021
11164
|
focusScopesStack.add(focusScope);
|
|
11022
11165
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -11047,7 +11190,7 @@ var FocusScope = React58__namespace.forwardRef((props, forwardedRef) => {
|
|
|
11047
11190
|
};
|
|
11048
11191
|
}
|
|
11049
11192
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
11050
|
-
const handleKeyDown =
|
|
11193
|
+
const handleKeyDown = React59__namespace.useCallback(
|
|
11051
11194
|
(event) => {
|
|
11052
11195
|
if (!loop && !trapped) return;
|
|
11053
11196
|
if (focusScope.paused) return;
|
|
@@ -11155,10 +11298,10 @@ function arrayRemove(array, item) {
|
|
|
11155
11298
|
function removeLinks(items) {
|
|
11156
11299
|
return items.filter((item) => item.tagName !== "A");
|
|
11157
11300
|
}
|
|
11158
|
-
var useReactId =
|
|
11301
|
+
var useReactId = React59__namespace[" useId ".trim().toString()] || (() => void 0);
|
|
11159
11302
|
var count2 = 0;
|
|
11160
11303
|
function useId4(deterministicId) {
|
|
11161
|
-
const [id, setId] =
|
|
11304
|
+
const [id, setId] = React59__namespace.useState(useReactId());
|
|
11162
11305
|
useLayoutEffect22(() => {
|
|
11163
11306
|
setId((reactId) => reactId != null ? reactId : String(count2++));
|
|
11164
11307
|
}, [deterministicId]);
|
|
@@ -12773,7 +12916,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
12773
12916
|
var isClient = typeof document !== "undefined";
|
|
12774
12917
|
var noop4 = function noop5() {
|
|
12775
12918
|
};
|
|
12776
|
-
var index = isClient ?
|
|
12919
|
+
var index = isClient ? React59.useLayoutEffect : noop4;
|
|
12777
12920
|
function deepEqual(a, b) {
|
|
12778
12921
|
if (a === b) {
|
|
12779
12922
|
return true;
|
|
@@ -12833,7 +12976,7 @@ function roundByDPR(element, value) {
|
|
|
12833
12976
|
return Math.round(value * dpr) / dpr;
|
|
12834
12977
|
}
|
|
12835
12978
|
function useLatestRef(value) {
|
|
12836
|
-
const ref =
|
|
12979
|
+
const ref = React59__namespace.useRef(value);
|
|
12837
12980
|
index(() => {
|
|
12838
12981
|
ref.current = value;
|
|
12839
12982
|
});
|
|
@@ -12856,7 +12999,7 @@ function useFloating(options) {
|
|
|
12856
12999
|
whileElementsMounted,
|
|
12857
13000
|
open
|
|
12858
13001
|
} = options;
|
|
12859
|
-
const [data, setData] =
|
|
13002
|
+
const [data, setData] = React59__namespace.useState({
|
|
12860
13003
|
x: 0,
|
|
12861
13004
|
y: 0,
|
|
12862
13005
|
strategy,
|
|
@@ -12864,19 +13007,19 @@ function useFloating(options) {
|
|
|
12864
13007
|
middlewareData: {},
|
|
12865
13008
|
isPositioned: false
|
|
12866
13009
|
});
|
|
12867
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
13010
|
+
const [latestMiddleware, setLatestMiddleware] = React59__namespace.useState(middleware);
|
|
12868
13011
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
12869
13012
|
setLatestMiddleware(middleware);
|
|
12870
13013
|
}
|
|
12871
|
-
const [_reference, _setReference] =
|
|
12872
|
-
const [_floating, _setFloating] =
|
|
12873
|
-
const setReference =
|
|
13014
|
+
const [_reference, _setReference] = React59__namespace.useState(null);
|
|
13015
|
+
const [_floating, _setFloating] = React59__namespace.useState(null);
|
|
13016
|
+
const setReference = React59__namespace.useCallback((node) => {
|
|
12874
13017
|
if (node !== referenceRef.current) {
|
|
12875
13018
|
referenceRef.current = node;
|
|
12876
13019
|
_setReference(node);
|
|
12877
13020
|
}
|
|
12878
13021
|
}, []);
|
|
12879
|
-
const setFloating =
|
|
13022
|
+
const setFloating = React59__namespace.useCallback((node) => {
|
|
12880
13023
|
if (node !== floatingRef.current) {
|
|
12881
13024
|
floatingRef.current = node;
|
|
12882
13025
|
_setFloating(node);
|
|
@@ -12884,14 +13027,14 @@ function useFloating(options) {
|
|
|
12884
13027
|
}, []);
|
|
12885
13028
|
const referenceEl = externalReference || _reference;
|
|
12886
13029
|
const floatingEl = externalFloating || _floating;
|
|
12887
|
-
const referenceRef =
|
|
12888
|
-
const floatingRef =
|
|
12889
|
-
const dataRef =
|
|
13030
|
+
const referenceRef = React59__namespace.useRef(null);
|
|
13031
|
+
const floatingRef = React59__namespace.useRef(null);
|
|
13032
|
+
const dataRef = React59__namespace.useRef(data);
|
|
12890
13033
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
12891
13034
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
12892
13035
|
const platformRef = useLatestRef(platform2);
|
|
12893
13036
|
const openRef = useLatestRef(open);
|
|
12894
|
-
const update =
|
|
13037
|
+
const update = React59__namespace.useCallback(() => {
|
|
12895
13038
|
if (!referenceRef.current || !floatingRef.current) {
|
|
12896
13039
|
return;
|
|
12897
13040
|
}
|
|
@@ -12929,7 +13072,7 @@ function useFloating(options) {
|
|
|
12929
13072
|
}));
|
|
12930
13073
|
}
|
|
12931
13074
|
}, [open]);
|
|
12932
|
-
const isMountedRef =
|
|
13075
|
+
const isMountedRef = React59__namespace.useRef(false);
|
|
12933
13076
|
index(() => {
|
|
12934
13077
|
isMountedRef.current = true;
|
|
12935
13078
|
return () => {
|
|
@@ -12946,17 +13089,17 @@ function useFloating(options) {
|
|
|
12946
13089
|
update();
|
|
12947
13090
|
}
|
|
12948
13091
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
12949
|
-
const refs =
|
|
13092
|
+
const refs = React59__namespace.useMemo(() => ({
|
|
12950
13093
|
reference: referenceRef,
|
|
12951
13094
|
floating: floatingRef,
|
|
12952
13095
|
setReference,
|
|
12953
13096
|
setFloating
|
|
12954
13097
|
}), [setReference, setFloating]);
|
|
12955
|
-
const elements =
|
|
13098
|
+
const elements = React59__namespace.useMemo(() => ({
|
|
12956
13099
|
reference: referenceEl,
|
|
12957
13100
|
floating: floatingEl
|
|
12958
13101
|
}), [referenceEl, floatingEl]);
|
|
12959
|
-
const floatingStyles =
|
|
13102
|
+
const floatingStyles = React59__namespace.useMemo(() => {
|
|
12960
13103
|
const initialStyles = {
|
|
12961
13104
|
position: strategy,
|
|
12962
13105
|
left: 0,
|
|
@@ -12982,7 +13125,7 @@ function useFloating(options) {
|
|
|
12982
13125
|
top: y
|
|
12983
13126
|
};
|
|
12984
13127
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
12985
|
-
return
|
|
13128
|
+
return React59__namespace.useMemo(() => ({
|
|
12986
13129
|
...data,
|
|
12987
13130
|
update,
|
|
12988
13131
|
refs,
|
|
@@ -13050,7 +13193,7 @@ var arrow3 = (options, deps) => ({
|
|
|
13050
13193
|
options: [options, deps]
|
|
13051
13194
|
});
|
|
13052
13195
|
var NAME = "Arrow";
|
|
13053
|
-
var Arrow =
|
|
13196
|
+
var Arrow = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
13054
13197
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
13055
13198
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13056
13199
|
Primitive.svg,
|
|
@@ -13068,7 +13211,7 @@ var Arrow = React58__namespace.forwardRef((props, forwardedRef) => {
|
|
|
13068
13211
|
Arrow.displayName = NAME;
|
|
13069
13212
|
var Root = Arrow;
|
|
13070
13213
|
function useSize(element) {
|
|
13071
|
-
const [size4, setSize] =
|
|
13214
|
+
const [size4, setSize] = React59__namespace.useState(void 0);
|
|
13072
13215
|
useLayoutEffect22(() => {
|
|
13073
13216
|
if (element) {
|
|
13074
13217
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -13105,14 +13248,14 @@ var POPPER_NAME = "Popper";
|
|
|
13105
13248
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
13106
13249
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
13107
13250
|
var ANCHOR_NAME = "PopperAnchor";
|
|
13108
|
-
var PopperAnchor =
|
|
13251
|
+
var PopperAnchor = React59__namespace.forwardRef(
|
|
13109
13252
|
(props, forwardedRef) => {
|
|
13110
13253
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
13111
13254
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
13112
|
-
const ref =
|
|
13255
|
+
const ref = React59__namespace.useRef(null);
|
|
13113
13256
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
13114
|
-
const anchorRef =
|
|
13115
|
-
|
|
13257
|
+
const anchorRef = React59__namespace.useRef(null);
|
|
13258
|
+
React59__namespace.useEffect(() => {
|
|
13116
13259
|
const previousAnchor = anchorRef.current;
|
|
13117
13260
|
anchorRef.current = (virtualRef == null ? void 0 : virtualRef.current) || ref.current;
|
|
13118
13261
|
if (previousAnchor !== anchorRef.current) {
|
|
@@ -13125,7 +13268,7 @@ var PopperAnchor = React58__namespace.forwardRef(
|
|
|
13125
13268
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
13126
13269
|
var CONTENT_NAME = "PopperContent";
|
|
13127
13270
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
13128
|
-
var PopperContent =
|
|
13271
|
+
var PopperContent = React59__namespace.forwardRef(
|
|
13129
13272
|
(props, forwardedRef) => {
|
|
13130
13273
|
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
13131
13274
|
const {
|
|
@@ -13145,9 +13288,9 @@ var PopperContent = React58__namespace.forwardRef(
|
|
|
13145
13288
|
...contentProps
|
|
13146
13289
|
} = props;
|
|
13147
13290
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
13148
|
-
const [content, setContent] =
|
|
13291
|
+
const [content, setContent] = React59__namespace.useState(null);
|
|
13149
13292
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
13150
|
-
const [arrow4, setArrow] =
|
|
13293
|
+
const [arrow4, setArrow] = React59__namespace.useState(null);
|
|
13151
13294
|
const arrowSize = useSize(arrow4);
|
|
13152
13295
|
const arrowWidth = (_a2 = arrowSize == null ? void 0 : arrowSize.width) != null ? _a2 : 0;
|
|
13153
13296
|
const arrowHeight = (_b = arrowSize == null ? void 0 : arrowSize.height) != null ? _b : 0;
|
|
@@ -13209,7 +13352,7 @@ var PopperContent = React58__namespace.forwardRef(
|
|
|
13209
13352
|
const arrowX = (_c = middlewareData.arrow) == null ? void 0 : _c.x;
|
|
13210
13353
|
const arrowY = (_d = middlewareData.arrow) == null ? void 0 : _d.y;
|
|
13211
13354
|
const cannotCenterArrow = ((_e = middlewareData.arrow) == null ? void 0 : _e.centerOffset) !== 0;
|
|
13212
|
-
const [contentZIndex, setContentZIndex] =
|
|
13355
|
+
const [contentZIndex, setContentZIndex] = React59__namespace.useState();
|
|
13213
13356
|
useLayoutEffect22(() => {
|
|
13214
13357
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
13215
13358
|
}, [content]);
|
|
@@ -13275,7 +13418,7 @@ var OPPOSITE_SIDE = {
|
|
|
13275
13418
|
bottom: "top",
|
|
13276
13419
|
left: "right"
|
|
13277
13420
|
};
|
|
13278
|
-
var PopperArrow =
|
|
13421
|
+
var PopperArrow = React59__namespace.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
13279
13422
|
const { __scopePopper, ...arrowProps } = props;
|
|
13280
13423
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
13281
13424
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -13366,17 +13509,17 @@ var Anchor = PopperAnchor;
|
|
|
13366
13509
|
var Content = PopperContent;
|
|
13367
13510
|
var Arrow2 = PopperArrow;
|
|
13368
13511
|
var PORTAL_NAME = "Portal";
|
|
13369
|
-
var Portal =
|
|
13512
|
+
var Portal = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
13370
13513
|
var _a2;
|
|
13371
13514
|
const { container: containerProp, ...portalProps } = props;
|
|
13372
|
-
const [mounted, setMounted] =
|
|
13515
|
+
const [mounted, setMounted] = React59__namespace.useState(false);
|
|
13373
13516
|
useLayoutEffect22(() => setMounted(true), []);
|
|
13374
13517
|
const container = containerProp || mounted && ((_a2 = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a2.body);
|
|
13375
13518
|
return container ? ReactDOM__namespace.default.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
13376
13519
|
});
|
|
13377
13520
|
Portal.displayName = PORTAL_NAME;
|
|
13378
13521
|
function useStateMachine(initialState, machine) {
|
|
13379
|
-
return
|
|
13522
|
+
return React59__namespace.useReducer((state, event) => {
|
|
13380
13523
|
const nextState = machine[state][event];
|
|
13381
13524
|
return nextState != null ? nextState : state;
|
|
13382
13525
|
}, initialState);
|
|
@@ -13384,17 +13527,17 @@ function useStateMachine(initialState, machine) {
|
|
|
13384
13527
|
var Presence = (props) => {
|
|
13385
13528
|
const { present, children } = props;
|
|
13386
13529
|
const presence = usePresence(present);
|
|
13387
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) :
|
|
13530
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React59__namespace.Children.only(children);
|
|
13388
13531
|
const ref = useComposedRefs(presence.ref, getElementRef2(child));
|
|
13389
13532
|
const forceMount = typeof children === "function";
|
|
13390
|
-
return forceMount || presence.isPresent ?
|
|
13533
|
+
return forceMount || presence.isPresent ? React59__namespace.cloneElement(child, { ref }) : null;
|
|
13391
13534
|
};
|
|
13392
13535
|
Presence.displayName = "Presence";
|
|
13393
13536
|
function usePresence(present) {
|
|
13394
|
-
const [node, setNode] =
|
|
13395
|
-
const stylesRef =
|
|
13396
|
-
const prevPresentRef =
|
|
13397
|
-
const prevAnimationNameRef =
|
|
13537
|
+
const [node, setNode] = React59__namespace.useState();
|
|
13538
|
+
const stylesRef = React59__namespace.useRef(null);
|
|
13539
|
+
const prevPresentRef = React59__namespace.useRef(present);
|
|
13540
|
+
const prevAnimationNameRef = React59__namespace.useRef("none");
|
|
13398
13541
|
const initialState = present ? "mounted" : "unmounted";
|
|
13399
13542
|
const [state, send] = useStateMachine(initialState, {
|
|
13400
13543
|
mounted: {
|
|
@@ -13409,7 +13552,7 @@ function usePresence(present) {
|
|
|
13409
13552
|
MOUNT: "mounted"
|
|
13410
13553
|
}
|
|
13411
13554
|
});
|
|
13412
|
-
|
|
13555
|
+
React59__namespace.useEffect(() => {
|
|
13413
13556
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
13414
13557
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
13415
13558
|
}, [state]);
|
|
@@ -13476,7 +13619,7 @@ function usePresence(present) {
|
|
|
13476
13619
|
}, [node, send]);
|
|
13477
13620
|
return {
|
|
13478
13621
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
13479
|
-
ref:
|
|
13622
|
+
ref: React59__namespace.useCallback((node2) => {
|
|
13480
13623
|
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
13481
13624
|
setNode(node2);
|
|
13482
13625
|
}, [])
|
|
@@ -13508,13 +13651,13 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
13508
13651
|
[createCollectionScope]
|
|
13509
13652
|
);
|
|
13510
13653
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
13511
|
-
var RovingFocusGroup =
|
|
13654
|
+
var RovingFocusGroup = React59__namespace.forwardRef(
|
|
13512
13655
|
(props, forwardedRef) => {
|
|
13513
13656
|
return /* @__PURE__ */ jsxRuntime.jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
13514
13657
|
}
|
|
13515
13658
|
);
|
|
13516
13659
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
13517
|
-
var RovingFocusGroupImpl =
|
|
13660
|
+
var RovingFocusGroupImpl = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
13518
13661
|
const {
|
|
13519
13662
|
__scopeRovingFocusGroup,
|
|
13520
13663
|
orientation,
|
|
@@ -13527,7 +13670,7 @@ var RovingFocusGroupImpl = React58__namespace.forwardRef((props, forwardedRef) =
|
|
|
13527
13670
|
preventScrollOnEntryFocus = false,
|
|
13528
13671
|
...groupProps
|
|
13529
13672
|
} = props;
|
|
13530
|
-
const ref =
|
|
13673
|
+
const ref = React59__namespace.useRef(null);
|
|
13531
13674
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
13532
13675
|
const direction = useDirection(dir);
|
|
13533
13676
|
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
@@ -13536,12 +13679,12 @@ var RovingFocusGroupImpl = React58__namespace.forwardRef((props, forwardedRef) =
|
|
|
13536
13679
|
onChange: onCurrentTabStopIdChange,
|
|
13537
13680
|
caller: GROUP_NAME
|
|
13538
13681
|
});
|
|
13539
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
13682
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React59__namespace.useState(false);
|
|
13540
13683
|
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
13541
13684
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
13542
|
-
const isClickFocusRef =
|
|
13543
|
-
const [focusableItemsCount, setFocusableItemsCount] =
|
|
13544
|
-
|
|
13685
|
+
const isClickFocusRef = React59__namespace.useRef(false);
|
|
13686
|
+
const [focusableItemsCount, setFocusableItemsCount] = React59__namespace.useState(0);
|
|
13687
|
+
React59__namespace.useEffect(() => {
|
|
13545
13688
|
const node = ref.current;
|
|
13546
13689
|
if (node) {
|
|
13547
13690
|
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
@@ -13556,16 +13699,16 @@ var RovingFocusGroupImpl = React58__namespace.forwardRef((props, forwardedRef) =
|
|
|
13556
13699
|
dir: direction,
|
|
13557
13700
|
loop,
|
|
13558
13701
|
currentTabStopId,
|
|
13559
|
-
onItemFocus:
|
|
13702
|
+
onItemFocus: React59__namespace.useCallback(
|
|
13560
13703
|
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
13561
13704
|
[setCurrentTabStopId]
|
|
13562
13705
|
),
|
|
13563
|
-
onItemShiftTab:
|
|
13564
|
-
onFocusableItemAdd:
|
|
13706
|
+
onItemShiftTab: React59__namespace.useCallback(() => setIsTabbingBackOut(true), []),
|
|
13707
|
+
onFocusableItemAdd: React59__namespace.useCallback(
|
|
13565
13708
|
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
13566
13709
|
[]
|
|
13567
13710
|
),
|
|
13568
|
-
onFocusableItemRemove:
|
|
13711
|
+
onFocusableItemRemove: React59__namespace.useCallback(
|
|
13569
13712
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
13570
13713
|
[]
|
|
13571
13714
|
),
|
|
@@ -13605,7 +13748,7 @@ var RovingFocusGroupImpl = React58__namespace.forwardRef((props, forwardedRef) =
|
|
|
13605
13748
|
);
|
|
13606
13749
|
});
|
|
13607
13750
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
13608
|
-
var RovingFocusGroupItem =
|
|
13751
|
+
var RovingFocusGroupItem = React59__namespace.forwardRef(
|
|
13609
13752
|
(props, forwardedRef) => {
|
|
13610
13753
|
const {
|
|
13611
13754
|
__scopeRovingFocusGroup,
|
|
@@ -13621,7 +13764,7 @@ var RovingFocusGroupItem = React58__namespace.forwardRef(
|
|
|
13621
13764
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
13622
13765
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
13623
13766
|
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
13624
|
-
|
|
13767
|
+
React59__namespace.useEffect(() => {
|
|
13625
13768
|
if (focusable) {
|
|
13626
13769
|
onFocusableItemAdd();
|
|
13627
13770
|
return () => onFocusableItemRemove();
|
|
@@ -13878,7 +14021,7 @@ function assignRef(ref, value) {
|
|
|
13878
14021
|
return ref;
|
|
13879
14022
|
}
|
|
13880
14023
|
function useCallbackRef2(initialValue, callback) {
|
|
13881
|
-
var ref =
|
|
14024
|
+
var ref = React59.useState(function() {
|
|
13882
14025
|
return {
|
|
13883
14026
|
// value
|
|
13884
14027
|
value: initialValue,
|
|
@@ -13902,7 +14045,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
13902
14045
|
ref.callback = callback;
|
|
13903
14046
|
return ref.facade;
|
|
13904
14047
|
}
|
|
13905
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
14048
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React59__namespace.useLayoutEffect : React59__namespace.useEffect;
|
|
13906
14049
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
13907
14050
|
function useMergeRefs(refs, defaultValue) {
|
|
13908
14051
|
var callbackRef = useCallbackRef2(null, function(newValue) {
|
|
@@ -14026,7 +14169,7 @@ var SideCar = function(_a2) {
|
|
|
14026
14169
|
if (!Target) {
|
|
14027
14170
|
throw new Error("Sidecar medium not found");
|
|
14028
14171
|
}
|
|
14029
|
-
return
|
|
14172
|
+
return React59__namespace.createElement(Target, __assign({}, rest));
|
|
14030
14173
|
};
|
|
14031
14174
|
SideCar.isSideCarExport = true;
|
|
14032
14175
|
function exportSidecar(medium, exported) {
|
|
@@ -14041,9 +14184,9 @@ var effectCar = createSidecarMedium();
|
|
|
14041
14184
|
var nothing = function() {
|
|
14042
14185
|
return;
|
|
14043
14186
|
};
|
|
14044
|
-
var RemoveScroll =
|
|
14045
|
-
var ref =
|
|
14046
|
-
var _a2 =
|
|
14187
|
+
var RemoveScroll = React59__namespace.forwardRef(function(props, parentRef) {
|
|
14188
|
+
var ref = React59__namespace.useRef(null);
|
|
14189
|
+
var _a2 = React59__namespace.useState({
|
|
14047
14190
|
onScrollCapture: nothing,
|
|
14048
14191
|
onWheelCapture: nothing,
|
|
14049
14192
|
onTouchMoveCapture: nothing
|
|
@@ -14052,11 +14195,11 @@ var RemoveScroll = React58__namespace.forwardRef(function(props, parentRef) {
|
|
|
14052
14195
|
var SideCar2 = sideCar;
|
|
14053
14196
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
14054
14197
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
14055
|
-
return
|
|
14056
|
-
|
|
14198
|
+
return React59__namespace.createElement(
|
|
14199
|
+
React59__namespace.Fragment,
|
|
14057
14200
|
null,
|
|
14058
|
-
enabled &&
|
|
14059
|
-
forwardProps ?
|
|
14201
|
+
enabled && React59__namespace.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
14202
|
+
forwardProps ? React59__namespace.cloneElement(React59__namespace.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React59__namespace.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
14060
14203
|
);
|
|
14061
14204
|
});
|
|
14062
14205
|
RemoveScroll.defaultProps = {
|
|
@@ -14125,7 +14268,7 @@ var stylesheetSingleton = function() {
|
|
|
14125
14268
|
var styleHookSingleton = function() {
|
|
14126
14269
|
var sheet = stylesheetSingleton();
|
|
14127
14270
|
return function(styles, isDynamic) {
|
|
14128
|
-
|
|
14271
|
+
React59__namespace.useEffect(function() {
|
|
14129
14272
|
sheet.add(styles);
|
|
14130
14273
|
return function() {
|
|
14131
14274
|
sheet.remove();
|
|
@@ -14199,7 +14342,7 @@ var getCurrentUseCounter = function() {
|
|
|
14199
14342
|
return isFinite(counter) ? counter : 0;
|
|
14200
14343
|
};
|
|
14201
14344
|
var useLockAttribute = function() {
|
|
14202
|
-
|
|
14345
|
+
React59__namespace.useEffect(function() {
|
|
14203
14346
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
14204
14347
|
return function() {
|
|
14205
14348
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -14214,10 +14357,10 @@ var useLockAttribute = function() {
|
|
|
14214
14357
|
var RemoveScrollBar = function(_a2) {
|
|
14215
14358
|
var noRelative = _a2.noRelative, noImportant = _a2.noImportant, _b = _a2.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
14216
14359
|
useLockAttribute();
|
|
14217
|
-
var gap =
|
|
14360
|
+
var gap = React59__namespace.useMemo(function() {
|
|
14218
14361
|
return getGapWidth(gapMode);
|
|
14219
14362
|
}, [gapMode]);
|
|
14220
|
-
return
|
|
14363
|
+
return React59__namespace.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
14221
14364
|
};
|
|
14222
14365
|
|
|
14223
14366
|
// node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
@@ -14358,16 +14501,16 @@ var generateStyle = function(id) {
|
|
|
14358
14501
|
var idCounter = 0;
|
|
14359
14502
|
var lockStack = [];
|
|
14360
14503
|
function RemoveScrollSideCar(props) {
|
|
14361
|
-
var shouldPreventQueue =
|
|
14362
|
-
var touchStartRef =
|
|
14363
|
-
var activeAxis =
|
|
14364
|
-
var id =
|
|
14365
|
-
var Style2 =
|
|
14366
|
-
var lastProps =
|
|
14367
|
-
|
|
14504
|
+
var shouldPreventQueue = React59__namespace.useRef([]);
|
|
14505
|
+
var touchStartRef = React59__namespace.useRef([0, 0]);
|
|
14506
|
+
var activeAxis = React59__namespace.useRef();
|
|
14507
|
+
var id = React59__namespace.useState(idCounter++)[0];
|
|
14508
|
+
var Style2 = React59__namespace.useState(styleSingleton)[0];
|
|
14509
|
+
var lastProps = React59__namespace.useRef(props);
|
|
14510
|
+
React59__namespace.useEffect(function() {
|
|
14368
14511
|
lastProps.current = props;
|
|
14369
14512
|
}, [props]);
|
|
14370
|
-
|
|
14513
|
+
React59__namespace.useEffect(function() {
|
|
14371
14514
|
if (props.inert) {
|
|
14372
14515
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
14373
14516
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef)).filter(Boolean);
|
|
@@ -14383,7 +14526,7 @@ function RemoveScrollSideCar(props) {
|
|
|
14383
14526
|
}
|
|
14384
14527
|
return;
|
|
14385
14528
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
14386
|
-
var shouldCancelEvent =
|
|
14529
|
+
var shouldCancelEvent = React59__namespace.useCallback(function(event, parent) {
|
|
14387
14530
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
14388
14531
|
return !lastProps.current.allowPinchZoom;
|
|
14389
14532
|
}
|
|
@@ -14419,7 +14562,7 @@ function RemoveScrollSideCar(props) {
|
|
|
14419
14562
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
14420
14563
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
14421
14564
|
}, []);
|
|
14422
|
-
var shouldPrevent =
|
|
14565
|
+
var shouldPrevent = React59__namespace.useCallback(function(_event) {
|
|
14423
14566
|
var event = _event;
|
|
14424
14567
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
14425
14568
|
return;
|
|
@@ -14446,7 +14589,7 @@ function RemoveScrollSideCar(props) {
|
|
|
14446
14589
|
}
|
|
14447
14590
|
}
|
|
14448
14591
|
}, []);
|
|
14449
|
-
var shouldCancel =
|
|
14592
|
+
var shouldCancel = React59__namespace.useCallback(function(name, delta, target, should) {
|
|
14450
14593
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
14451
14594
|
shouldPreventQueue.current.push(event);
|
|
14452
14595
|
setTimeout(function() {
|
|
@@ -14455,17 +14598,17 @@ function RemoveScrollSideCar(props) {
|
|
|
14455
14598
|
});
|
|
14456
14599
|
}, 1);
|
|
14457
14600
|
}, []);
|
|
14458
|
-
var scrollTouchStart =
|
|
14601
|
+
var scrollTouchStart = React59__namespace.useCallback(function(event) {
|
|
14459
14602
|
touchStartRef.current = getTouchXY(event);
|
|
14460
14603
|
activeAxis.current = void 0;
|
|
14461
14604
|
}, []);
|
|
14462
|
-
var scrollWheel =
|
|
14605
|
+
var scrollWheel = React59__namespace.useCallback(function(event) {
|
|
14463
14606
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
14464
14607
|
}, []);
|
|
14465
|
-
var scrollTouchMove =
|
|
14608
|
+
var scrollTouchMove = React59__namespace.useCallback(function(event) {
|
|
14466
14609
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
14467
14610
|
}, []);
|
|
14468
|
-
|
|
14611
|
+
React59__namespace.useEffect(function() {
|
|
14469
14612
|
lockStack.push(Style2);
|
|
14470
14613
|
props.setCallbacks({
|
|
14471
14614
|
onScrollCapture: scrollWheel,
|
|
@@ -14485,11 +14628,11 @@ function RemoveScrollSideCar(props) {
|
|
|
14485
14628
|
};
|
|
14486
14629
|
}, []);
|
|
14487
14630
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
14488
|
-
return
|
|
14489
|
-
|
|
14631
|
+
return React59__namespace.createElement(
|
|
14632
|
+
React59__namespace.Fragment,
|
|
14490
14633
|
null,
|
|
14491
|
-
inert ?
|
|
14492
|
-
removeScrollBar ?
|
|
14634
|
+
inert ? React59__namespace.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
14635
|
+
removeScrollBar ? React59__namespace.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
14493
14636
|
);
|
|
14494
14637
|
}
|
|
14495
14638
|
function getOutermostShadowParent(node) {
|
|
@@ -14508,8 +14651,8 @@ function getOutermostShadowParent(node) {
|
|
|
14508
14651
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
14509
14652
|
|
|
14510
14653
|
// node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
14511
|
-
var ReactRemoveScroll =
|
|
14512
|
-
return
|
|
14654
|
+
var ReactRemoveScroll = React59__namespace.forwardRef(function(props, ref) {
|
|
14655
|
+
return React59__namespace.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
14513
14656
|
});
|
|
14514
14657
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
14515
14658
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -14537,7 +14680,7 @@ var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
|
14537
14680
|
var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
|
|
14538
14681
|
var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
14539
14682
|
var ANCHOR_NAME2 = "MenuAnchor";
|
|
14540
|
-
var MenuAnchor =
|
|
14683
|
+
var MenuAnchor = React59__namespace.forwardRef(
|
|
14541
14684
|
(props, forwardedRef) => {
|
|
14542
14685
|
const { __scopeMenu, ...anchorProps } = props;
|
|
14543
14686
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -14551,7 +14694,7 @@ var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME2, {
|
|
|
14551
14694
|
});
|
|
14552
14695
|
var CONTENT_NAME2 = "MenuContent";
|
|
14553
14696
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME2);
|
|
14554
|
-
var MenuContent =
|
|
14697
|
+
var MenuContent = React59__namespace.forwardRef(
|
|
14555
14698
|
(props, forwardedRef) => {
|
|
14556
14699
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
14557
14700
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -14560,12 +14703,12 @@ var MenuContent = React58__namespace.forwardRef(
|
|
|
14560
14703
|
return /* @__PURE__ */ jsxRuntime.jsx(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
14561
14704
|
}
|
|
14562
14705
|
);
|
|
14563
|
-
var MenuRootContentModal =
|
|
14706
|
+
var MenuRootContentModal = React59__namespace.forwardRef(
|
|
14564
14707
|
(props, forwardedRef) => {
|
|
14565
14708
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
14566
|
-
const ref =
|
|
14709
|
+
const ref = React59__namespace.useRef(null);
|
|
14567
14710
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14568
|
-
|
|
14711
|
+
React59__namespace.useEffect(() => {
|
|
14569
14712
|
const content = ref.current;
|
|
14570
14713
|
if (content) return hideOthers(content);
|
|
14571
14714
|
}, []);
|
|
@@ -14587,7 +14730,7 @@ var MenuRootContentModal = React58__namespace.forwardRef(
|
|
|
14587
14730
|
);
|
|
14588
14731
|
}
|
|
14589
14732
|
);
|
|
14590
|
-
var MenuRootContentNonModal =
|
|
14733
|
+
var MenuRootContentNonModal = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
14591
14734
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
14592
14735
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14593
14736
|
MenuContentImpl,
|
|
@@ -14602,7 +14745,7 @@ var MenuRootContentNonModal = React58__namespace.forwardRef((props, forwardedRef
|
|
|
14602
14745
|
);
|
|
14603
14746
|
});
|
|
14604
14747
|
var Slot2 = createSlot("MenuContent.ScrollLock");
|
|
14605
|
-
var MenuContentImpl =
|
|
14748
|
+
var MenuContentImpl = React59__namespace.forwardRef(
|
|
14606
14749
|
(props, forwardedRef) => {
|
|
14607
14750
|
const {
|
|
14608
14751
|
__scopeMenu,
|
|
@@ -14625,16 +14768,16 @@ var MenuContentImpl = React58__namespace.forwardRef(
|
|
|
14625
14768
|
const popperScope = usePopperScope(__scopeMenu);
|
|
14626
14769
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
14627
14770
|
const getItems = useCollection2(__scopeMenu);
|
|
14628
|
-
const [currentItemId, setCurrentItemId] =
|
|
14629
|
-
const contentRef =
|
|
14771
|
+
const [currentItemId, setCurrentItemId] = React59__namespace.useState(null);
|
|
14772
|
+
const contentRef = React59__namespace.useRef(null);
|
|
14630
14773
|
const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
14631
|
-
const timerRef =
|
|
14632
|
-
const searchRef =
|
|
14633
|
-
const pointerGraceTimerRef =
|
|
14634
|
-
const pointerGraceIntentRef =
|
|
14635
|
-
const pointerDirRef =
|
|
14636
|
-
const lastPointerXRef =
|
|
14637
|
-
const ScrollLockWrapper = disableOutsideScroll ? Combination_default :
|
|
14774
|
+
const timerRef = React59__namespace.useRef(0);
|
|
14775
|
+
const searchRef = React59__namespace.useRef("");
|
|
14776
|
+
const pointerGraceTimerRef = React59__namespace.useRef(0);
|
|
14777
|
+
const pointerGraceIntentRef = React59__namespace.useRef(null);
|
|
14778
|
+
const pointerDirRef = React59__namespace.useRef("right");
|
|
14779
|
+
const lastPointerXRef = React59__namespace.useRef(0);
|
|
14780
|
+
const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React59__namespace.Fragment;
|
|
14638
14781
|
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot2, allowPinchZoom: true } : void 0;
|
|
14639
14782
|
const handleTypeaheadSearch = (key) => {
|
|
14640
14783
|
var _a2, _b;
|
|
@@ -14654,11 +14797,11 @@ var MenuContentImpl = React58__namespace.forwardRef(
|
|
|
14654
14797
|
setTimeout(() => newItem.focus());
|
|
14655
14798
|
}
|
|
14656
14799
|
};
|
|
14657
|
-
|
|
14800
|
+
React59__namespace.useEffect(() => {
|
|
14658
14801
|
return () => window.clearTimeout(timerRef.current);
|
|
14659
14802
|
}, []);
|
|
14660
14803
|
useFocusGuards();
|
|
14661
|
-
const isPointerMovingToSubmenu =
|
|
14804
|
+
const isPointerMovingToSubmenu = React59__namespace.useCallback((event) => {
|
|
14662
14805
|
var _a2, _b;
|
|
14663
14806
|
const isMovingTowards = pointerDirRef.current === ((_a2 = pointerGraceIntentRef.current) == null ? void 0 : _a2.side);
|
|
14664
14807
|
return isMovingTowards && isPointerInGraceArea(event, (_b = pointerGraceIntentRef.current) == null ? void 0 : _b.area);
|
|
@@ -14668,13 +14811,13 @@ var MenuContentImpl = React58__namespace.forwardRef(
|
|
|
14668
14811
|
{
|
|
14669
14812
|
scope: __scopeMenu,
|
|
14670
14813
|
searchRef,
|
|
14671
|
-
onItemEnter:
|
|
14814
|
+
onItemEnter: React59__namespace.useCallback(
|
|
14672
14815
|
(event) => {
|
|
14673
14816
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
14674
14817
|
},
|
|
14675
14818
|
[isPointerMovingToSubmenu]
|
|
14676
14819
|
),
|
|
14677
|
-
onItemLeave:
|
|
14820
|
+
onItemLeave: React59__namespace.useCallback(
|
|
14678
14821
|
(event) => {
|
|
14679
14822
|
var _a2;
|
|
14680
14823
|
if (isPointerMovingToSubmenu(event)) return;
|
|
@@ -14683,14 +14826,14 @@ var MenuContentImpl = React58__namespace.forwardRef(
|
|
|
14683
14826
|
},
|
|
14684
14827
|
[isPointerMovingToSubmenu]
|
|
14685
14828
|
),
|
|
14686
|
-
onTriggerLeave:
|
|
14829
|
+
onTriggerLeave: React59__namespace.useCallback(
|
|
14687
14830
|
(event) => {
|
|
14688
14831
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
14689
14832
|
},
|
|
14690
14833
|
[isPointerMovingToSubmenu]
|
|
14691
14834
|
),
|
|
14692
14835
|
pointerGraceTimerRef,
|
|
14693
|
-
onPointerGraceIntentChange:
|
|
14836
|
+
onPointerGraceIntentChange: React59__namespace.useCallback((intent) => {
|
|
14694
14837
|
pointerGraceIntentRef.current = intent;
|
|
14695
14838
|
}, []),
|
|
14696
14839
|
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14790,7 +14933,7 @@ var MenuContentImpl = React58__namespace.forwardRef(
|
|
|
14790
14933
|
);
|
|
14791
14934
|
MenuContent.displayName = CONTENT_NAME2;
|
|
14792
14935
|
var GROUP_NAME2 = "MenuGroup";
|
|
14793
|
-
var MenuGroup =
|
|
14936
|
+
var MenuGroup = React59__namespace.forwardRef(
|
|
14794
14937
|
(props, forwardedRef) => {
|
|
14795
14938
|
const { __scopeMenu, ...groupProps } = props;
|
|
14796
14939
|
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
@@ -14798,7 +14941,7 @@ var MenuGroup = React58__namespace.forwardRef(
|
|
|
14798
14941
|
);
|
|
14799
14942
|
MenuGroup.displayName = GROUP_NAME2;
|
|
14800
14943
|
var LABEL_NAME = "MenuLabel";
|
|
14801
|
-
var MenuLabel =
|
|
14944
|
+
var MenuLabel = React59__namespace.forwardRef(
|
|
14802
14945
|
(props, forwardedRef) => {
|
|
14803
14946
|
const { __scopeMenu, ...labelProps } = props;
|
|
14804
14947
|
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
@@ -14807,14 +14950,14 @@ var MenuLabel = React58__namespace.forwardRef(
|
|
|
14807
14950
|
MenuLabel.displayName = LABEL_NAME;
|
|
14808
14951
|
var ITEM_NAME2 = "MenuItem";
|
|
14809
14952
|
var ITEM_SELECT = "menu.itemSelect";
|
|
14810
|
-
var MenuItem =
|
|
14953
|
+
var MenuItem = React59__namespace.forwardRef(
|
|
14811
14954
|
(props, forwardedRef) => {
|
|
14812
14955
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
14813
|
-
const ref =
|
|
14956
|
+
const ref = React59__namespace.useRef(null);
|
|
14814
14957
|
const rootContext = useMenuRootContext(ITEM_NAME2, props.__scopeMenu);
|
|
14815
14958
|
const contentContext = useMenuContentContext(ITEM_NAME2, props.__scopeMenu);
|
|
14816
14959
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14817
|
-
const isPointerDownRef =
|
|
14960
|
+
const isPointerDownRef = React59__namespace.useRef(false);
|
|
14818
14961
|
const handleSelect = () => {
|
|
14819
14962
|
const menuItem = ref.current;
|
|
14820
14963
|
if (!disabled && menuItem) {
|
|
@@ -14857,16 +15000,16 @@ var MenuItem = React58__namespace.forwardRef(
|
|
|
14857
15000
|
}
|
|
14858
15001
|
);
|
|
14859
15002
|
MenuItem.displayName = ITEM_NAME2;
|
|
14860
|
-
var MenuItemImpl =
|
|
15003
|
+
var MenuItemImpl = React59__namespace.forwardRef(
|
|
14861
15004
|
(props, forwardedRef) => {
|
|
14862
15005
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
14863
15006
|
const contentContext = useMenuContentContext(ITEM_NAME2, __scopeMenu);
|
|
14864
15007
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
14865
|
-
const ref =
|
|
15008
|
+
const ref = React59__namespace.useRef(null);
|
|
14866
15009
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14867
|
-
const [isFocused, setIsFocused] =
|
|
14868
|
-
const [textContent, setTextContent] =
|
|
14869
|
-
|
|
15010
|
+
const [isFocused, setIsFocused] = React59__namespace.useState(false);
|
|
15011
|
+
const [textContent, setTextContent] = React59__namespace.useState("");
|
|
15012
|
+
React59__namespace.useEffect(() => {
|
|
14870
15013
|
var _a2;
|
|
14871
15014
|
const menuItem = ref.current;
|
|
14872
15015
|
if (menuItem) {
|
|
@@ -14915,7 +15058,7 @@ var MenuItemImpl = React58__namespace.forwardRef(
|
|
|
14915
15058
|
}
|
|
14916
15059
|
);
|
|
14917
15060
|
var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
14918
|
-
var MenuCheckboxItem =
|
|
15061
|
+
var MenuCheckboxItem = React59__namespace.forwardRef(
|
|
14919
15062
|
(props, forwardedRef) => {
|
|
14920
15063
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
14921
15064
|
return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14942,7 +15085,7 @@ var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
|
|
|
14942
15085
|
{ value: void 0, onValueChange: () => {
|
|
14943
15086
|
} }
|
|
14944
15087
|
);
|
|
14945
|
-
var MenuRadioGroup =
|
|
15088
|
+
var MenuRadioGroup = React59__namespace.forwardRef(
|
|
14946
15089
|
(props, forwardedRef) => {
|
|
14947
15090
|
const { value, onValueChange, ...groupProps } = props;
|
|
14948
15091
|
const handleValueChange = useCallbackRef(onValueChange);
|
|
@@ -14951,7 +15094,7 @@ var MenuRadioGroup = React58__namespace.forwardRef(
|
|
|
14951
15094
|
);
|
|
14952
15095
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
14953
15096
|
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
14954
|
-
var MenuRadioItem =
|
|
15097
|
+
var MenuRadioItem = React59__namespace.forwardRef(
|
|
14955
15098
|
(props, forwardedRef) => {
|
|
14956
15099
|
const { value, ...radioItemProps } = props;
|
|
14957
15100
|
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
@@ -14982,7 +15125,7 @@ var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
|
|
|
14982
15125
|
ITEM_INDICATOR_NAME,
|
|
14983
15126
|
{ checked: false }
|
|
14984
15127
|
);
|
|
14985
|
-
var MenuItemIndicator =
|
|
15128
|
+
var MenuItemIndicator = React59__namespace.forwardRef(
|
|
14986
15129
|
(props, forwardedRef) => {
|
|
14987
15130
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
14988
15131
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
@@ -15004,7 +15147,7 @@ var MenuItemIndicator = React58__namespace.forwardRef(
|
|
|
15004
15147
|
);
|
|
15005
15148
|
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
15006
15149
|
var SEPARATOR_NAME = "MenuSeparator";
|
|
15007
|
-
var MenuSeparator =
|
|
15150
|
+
var MenuSeparator = React59__namespace.forwardRef(
|
|
15008
15151
|
(props, forwardedRef) => {
|
|
15009
15152
|
const { __scopeMenu, ...separatorProps } = props;
|
|
15010
15153
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15020,7 +15163,7 @@ var MenuSeparator = React58__namespace.forwardRef(
|
|
|
15020
15163
|
);
|
|
15021
15164
|
MenuSeparator.displayName = SEPARATOR_NAME;
|
|
15022
15165
|
var ARROW_NAME2 = "MenuArrow";
|
|
15023
|
-
var MenuArrow =
|
|
15166
|
+
var MenuArrow = React59__namespace.forwardRef(
|
|
15024
15167
|
(props, forwardedRef) => {
|
|
15025
15168
|
const { __scopeMenu, ...arrowProps } = props;
|
|
15026
15169
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -15031,21 +15174,21 @@ MenuArrow.displayName = ARROW_NAME2;
|
|
|
15031
15174
|
var SUB_NAME = "MenuSub";
|
|
15032
15175
|
var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
|
|
15033
15176
|
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
15034
|
-
var MenuSubTrigger =
|
|
15177
|
+
var MenuSubTrigger = React59__namespace.forwardRef(
|
|
15035
15178
|
(props, forwardedRef) => {
|
|
15036
15179
|
const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15037
15180
|
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15038
15181
|
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15039
15182
|
const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15040
|
-
const openTimerRef =
|
|
15183
|
+
const openTimerRef = React59__namespace.useRef(null);
|
|
15041
15184
|
const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
|
|
15042
15185
|
const scope = { __scopeMenu: props.__scopeMenu };
|
|
15043
|
-
const clearOpenTimer =
|
|
15186
|
+
const clearOpenTimer = React59__namespace.useCallback(() => {
|
|
15044
15187
|
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
15045
15188
|
openTimerRef.current = null;
|
|
15046
15189
|
}, []);
|
|
15047
|
-
|
|
15048
|
-
|
|
15190
|
+
React59__namespace.useEffect(() => clearOpenTimer, [clearOpenTimer]);
|
|
15191
|
+
React59__namespace.useEffect(() => {
|
|
15049
15192
|
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
15050
15193
|
return () => {
|
|
15051
15194
|
window.clearTimeout(pointerGraceTimer);
|
|
@@ -15135,14 +15278,14 @@ var MenuSubTrigger = React58__namespace.forwardRef(
|
|
|
15135
15278
|
);
|
|
15136
15279
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
15137
15280
|
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
15138
|
-
var MenuSubContent =
|
|
15281
|
+
var MenuSubContent = React59__namespace.forwardRef(
|
|
15139
15282
|
(props, forwardedRef) => {
|
|
15140
15283
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
15141
15284
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
15142
15285
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
15143
15286
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
15144
15287
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
15145
|
-
const ref =
|
|
15288
|
+
const ref = React59__namespace.useRef(null);
|
|
15146
15289
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
15147
15290
|
return /* @__PURE__ */ jsxRuntime.jsx(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection2.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15148
15291
|
MenuContentImpl,
|
|
@@ -15260,7 +15403,7 @@ var [createDropdownMenuContext] = createContextScope(
|
|
|
15260
15403
|
var useMenuScope = createMenuScope();
|
|
15261
15404
|
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
15262
15405
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
15263
|
-
var DropdownMenuTrigger2 =
|
|
15406
|
+
var DropdownMenuTrigger2 = React59__namespace.forwardRef(
|
|
15264
15407
|
(props, forwardedRef) => {
|
|
15265
15408
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
15266
15409
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
@@ -15296,12 +15439,12 @@ var DropdownMenuTrigger2 = React58__namespace.forwardRef(
|
|
|
15296
15439
|
);
|
|
15297
15440
|
DropdownMenuTrigger2.displayName = TRIGGER_NAME;
|
|
15298
15441
|
var CONTENT_NAME3 = "DropdownMenuContent";
|
|
15299
|
-
var DropdownMenuContent2 =
|
|
15442
|
+
var DropdownMenuContent2 = React59__namespace.forwardRef(
|
|
15300
15443
|
(props, forwardedRef) => {
|
|
15301
15444
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
15302
15445
|
const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
|
|
15303
15446
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15304
|
-
const hasInteractedOutsideRef =
|
|
15447
|
+
const hasInteractedOutsideRef = React59__namespace.useRef(false);
|
|
15305
15448
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15306
15449
|
Content2,
|
|
15307
15450
|
{
|
|
@@ -15339,7 +15482,7 @@ var DropdownMenuContent2 = React58__namespace.forwardRef(
|
|
|
15339
15482
|
);
|
|
15340
15483
|
DropdownMenuContent2.displayName = CONTENT_NAME3;
|
|
15341
15484
|
var GROUP_NAME3 = "DropdownMenuGroup";
|
|
15342
|
-
var DropdownMenuGroup2 =
|
|
15485
|
+
var DropdownMenuGroup2 = React59__namespace.forwardRef(
|
|
15343
15486
|
(props, forwardedRef) => {
|
|
15344
15487
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
15345
15488
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15348,7 +15491,7 @@ var DropdownMenuGroup2 = React58__namespace.forwardRef(
|
|
|
15348
15491
|
);
|
|
15349
15492
|
DropdownMenuGroup2.displayName = GROUP_NAME3;
|
|
15350
15493
|
var LABEL_NAME2 = "DropdownMenuLabel";
|
|
15351
|
-
var DropdownMenuLabel2 =
|
|
15494
|
+
var DropdownMenuLabel2 = React59__namespace.forwardRef(
|
|
15352
15495
|
(props, forwardedRef) => {
|
|
15353
15496
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
15354
15497
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15357,7 +15500,7 @@ var DropdownMenuLabel2 = React58__namespace.forwardRef(
|
|
|
15357
15500
|
);
|
|
15358
15501
|
DropdownMenuLabel2.displayName = LABEL_NAME2;
|
|
15359
15502
|
var ITEM_NAME3 = "DropdownMenuItem";
|
|
15360
|
-
var DropdownMenuItem2 =
|
|
15503
|
+
var DropdownMenuItem2 = React59__namespace.forwardRef(
|
|
15361
15504
|
(props, forwardedRef) => {
|
|
15362
15505
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
15363
15506
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15366,42 +15509,42 @@ var DropdownMenuItem2 = React58__namespace.forwardRef(
|
|
|
15366
15509
|
);
|
|
15367
15510
|
DropdownMenuItem2.displayName = ITEM_NAME3;
|
|
15368
15511
|
var CHECKBOX_ITEM_NAME2 = "DropdownMenuCheckboxItem";
|
|
15369
|
-
var DropdownMenuCheckboxItem2 =
|
|
15512
|
+
var DropdownMenuCheckboxItem2 = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
15370
15513
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
15371
15514
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15372
15515
|
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
15373
15516
|
});
|
|
15374
15517
|
DropdownMenuCheckboxItem2.displayName = CHECKBOX_ITEM_NAME2;
|
|
15375
15518
|
var RADIO_GROUP_NAME2 = "DropdownMenuRadioGroup";
|
|
15376
|
-
var DropdownMenuRadioGroup2 =
|
|
15519
|
+
var DropdownMenuRadioGroup2 = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
15377
15520
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
15378
15521
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15379
15522
|
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroup2, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
15380
15523
|
});
|
|
15381
15524
|
DropdownMenuRadioGroup2.displayName = RADIO_GROUP_NAME2;
|
|
15382
15525
|
var RADIO_ITEM_NAME2 = "DropdownMenuRadioItem";
|
|
15383
|
-
var DropdownMenuRadioItem2 =
|
|
15526
|
+
var DropdownMenuRadioItem2 = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
15384
15527
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
15385
15528
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15386
15529
|
return /* @__PURE__ */ jsxRuntime.jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
15387
15530
|
});
|
|
15388
15531
|
DropdownMenuRadioItem2.displayName = RADIO_ITEM_NAME2;
|
|
15389
15532
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
15390
|
-
var DropdownMenuItemIndicator =
|
|
15533
|
+
var DropdownMenuItemIndicator = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
15391
15534
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
15392
15535
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15393
15536
|
return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
15394
15537
|
});
|
|
15395
15538
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
15396
15539
|
var SEPARATOR_NAME2 = "DropdownMenuSeparator";
|
|
15397
|
-
var DropdownMenuSeparator2 =
|
|
15540
|
+
var DropdownMenuSeparator2 = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
15398
15541
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
15399
15542
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15400
15543
|
return /* @__PURE__ */ jsxRuntime.jsx(Separator2, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
15401
15544
|
});
|
|
15402
15545
|
DropdownMenuSeparator2.displayName = SEPARATOR_NAME2;
|
|
15403
15546
|
var ARROW_NAME3 = "DropdownMenuArrow";
|
|
15404
|
-
var DropdownMenuArrow =
|
|
15547
|
+
var DropdownMenuArrow = React59__namespace.forwardRef(
|
|
15405
15548
|
(props, forwardedRef) => {
|
|
15406
15549
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
15407
15550
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15410,14 +15553,14 @@ var DropdownMenuArrow = React58__namespace.forwardRef(
|
|
|
15410
15553
|
);
|
|
15411
15554
|
DropdownMenuArrow.displayName = ARROW_NAME3;
|
|
15412
15555
|
var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
|
|
15413
|
-
var DropdownMenuSubTrigger2 =
|
|
15556
|
+
var DropdownMenuSubTrigger2 = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
15414
15557
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
15415
15558
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15416
15559
|
return /* @__PURE__ */ jsxRuntime.jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
15417
15560
|
});
|
|
15418
15561
|
DropdownMenuSubTrigger2.displayName = SUB_TRIGGER_NAME2;
|
|
15419
15562
|
var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
|
|
15420
|
-
var DropdownMenuSubContent2 =
|
|
15563
|
+
var DropdownMenuSubContent2 = React59__namespace.forwardRef((props, forwardedRef) => {
|
|
15421
15564
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
15422
15565
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15423
15566
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15643,27 +15786,27 @@ function DataGrid({
|
|
|
15643
15786
|
loading: loadingProp
|
|
15644
15787
|
}) {
|
|
15645
15788
|
var _a2, _b, _c;
|
|
15646
|
-
const normalizedRead =
|
|
15647
|
-
const initialBind =
|
|
15789
|
+
const normalizedRead = React59__namespace.useMemo(() => normalizeReadConfig(data.read), [data.read]);
|
|
15790
|
+
const initialBind = React59__namespace.useMemo(() => {
|
|
15648
15791
|
var _a3;
|
|
15649
15792
|
return (_a3 = data.bind) != null ? _a3 : [];
|
|
15650
15793
|
}, [data.bind]);
|
|
15651
15794
|
const resolvedPageSize = (_a2 = pageSize == null ? void 0 : pageSize.count) != null ? _a2 : defaultPageSize;
|
|
15652
15795
|
const pageSizeOptions = (_b = pageSize == null ? void 0 : pageSize.options) != null ? _b : [10, 20, 30, 40, 50];
|
|
15653
15796
|
const showPageSizeControl = (_c = pageSize == null ? void 0 : pageSize.visible) != null ? _c : true;
|
|
15654
|
-
const [rows, setRows] =
|
|
15655
|
-
const [isFetching, setIsFetching] =
|
|
15656
|
-
const [error, setError] =
|
|
15657
|
-
const scrollRef =
|
|
15658
|
-
const [scrollOffset, setScrollOffset] =
|
|
15659
|
-
const [viewportHeight, setViewportHeight] =
|
|
15660
|
-
const abortControllerRef =
|
|
15661
|
-
const [filterValue, setFilterValue] =
|
|
15662
|
-
const baseColumnDefs =
|
|
15797
|
+
const [rows, setRows] = React59__namespace.useState(() => initialBind);
|
|
15798
|
+
const [isFetching, setIsFetching] = React59__namespace.useState(false);
|
|
15799
|
+
const [error, setError] = React59__namespace.useState(null);
|
|
15800
|
+
const scrollRef = React59__namespace.useRef(null);
|
|
15801
|
+
const [scrollOffset, setScrollOffset] = React59__namespace.useState(0);
|
|
15802
|
+
const [viewportHeight, setViewportHeight] = React59__namespace.useState(height);
|
|
15803
|
+
const abortControllerRef = React59__namespace.useRef(null);
|
|
15804
|
+
const [filterValue, setFilterValue] = React59__namespace.useState("");
|
|
15805
|
+
const baseColumnDefs = React59__namespace.useMemo(
|
|
15663
15806
|
() => createColumnDefs(columns, sortable),
|
|
15664
15807
|
[columns, sortable]
|
|
15665
15808
|
);
|
|
15666
|
-
const columnDefs =
|
|
15809
|
+
const columnDefs = React59__namespace.useMemo(() => {
|
|
15667
15810
|
if (!selectable) {
|
|
15668
15811
|
return baseColumnDefs;
|
|
15669
15812
|
}
|
|
@@ -15697,8 +15840,8 @@ function DataGrid({
|
|
|
15697
15840
|
};
|
|
15698
15841
|
return [selectionColumn, ...baseColumnDefs];
|
|
15699
15842
|
}, [baseColumnDefs, selectable]);
|
|
15700
|
-
const filterableColumns =
|
|
15701
|
-
const filteredRows =
|
|
15843
|
+
const filterableColumns = React59__namespace.useMemo(() => columns.filter((column) => Boolean(column.item)), [columns]);
|
|
15844
|
+
const filteredRows = React59__namespace.useMemo(() => {
|
|
15702
15845
|
if (!filterable || !filterValue.trim()) {
|
|
15703
15846
|
return rows;
|
|
15704
15847
|
}
|
|
@@ -15720,26 +15863,26 @@ function DataGrid({
|
|
|
15720
15863
|
defaultPageSize: pagination ? resolvedPageSize : filteredRows.length || 10,
|
|
15721
15864
|
getRowId: (_row, index2) => index2.toString()
|
|
15722
15865
|
});
|
|
15723
|
-
|
|
15866
|
+
React59__namespace.useEffect(() => {
|
|
15724
15867
|
if (!pagination) {
|
|
15725
15868
|
table.setPageIndex(0);
|
|
15726
15869
|
table.setPageSize(filteredRows.length || 1);
|
|
15727
15870
|
}
|
|
15728
15871
|
}, [pagination, filteredRows.length, table]);
|
|
15729
|
-
|
|
15872
|
+
React59__namespace.useEffect(() => {
|
|
15730
15873
|
if (pagination) {
|
|
15731
15874
|
table.setPageSize(resolvedPageSize);
|
|
15732
15875
|
}
|
|
15733
15876
|
}, [pagination, resolvedPageSize, table]);
|
|
15734
|
-
|
|
15877
|
+
React59__namespace.useEffect(() => {
|
|
15735
15878
|
setRows(initialBind);
|
|
15736
15879
|
}, [initialBind]);
|
|
15737
|
-
|
|
15880
|
+
React59__namespace.useEffect(() => {
|
|
15738
15881
|
if (!filterable) {
|
|
15739
15882
|
setFilterValue("");
|
|
15740
15883
|
}
|
|
15741
15884
|
}, [filterable]);
|
|
15742
|
-
const fetchData =
|
|
15885
|
+
const fetchData = React59__namespace.useCallback(async () => {
|
|
15743
15886
|
var _a3, _b2;
|
|
15744
15887
|
if (!normalizedRead) {
|
|
15745
15888
|
return;
|
|
@@ -15785,7 +15928,7 @@ function DataGrid({
|
|
|
15785
15928
|
setIsFetching(false);
|
|
15786
15929
|
}
|
|
15787
15930
|
}, [normalizedRead, onDataChange]);
|
|
15788
|
-
|
|
15931
|
+
React59__namespace.useEffect(() => {
|
|
15789
15932
|
if (normalizedRead) {
|
|
15790
15933
|
fetchData().catch(() => {
|
|
15791
15934
|
});
|
|
@@ -15795,7 +15938,7 @@ function DataGrid({
|
|
|
15795
15938
|
(_a3 = abortControllerRef.current) == null ? void 0 : _a3.abort();
|
|
15796
15939
|
};
|
|
15797
15940
|
}, [normalizedRead, fetchData]);
|
|
15798
|
-
|
|
15941
|
+
React59__namespace.useEffect(() => {
|
|
15799
15942
|
if (!scrollRef.current) {
|
|
15800
15943
|
return;
|
|
15801
15944
|
}
|
|
@@ -15817,7 +15960,7 @@ function DataGrid({
|
|
|
15817
15960
|
const rowCount = tableRows.length;
|
|
15818
15961
|
const selectedCount = table.getFilteredSelectedRowModel().rows.length;
|
|
15819
15962
|
const totalFilteredCount = table.getFilteredRowModel().rows.length;
|
|
15820
|
-
|
|
15963
|
+
React59__namespace.useEffect(() => {
|
|
15821
15964
|
if (scrollRef.current) {
|
|
15822
15965
|
scrollRef.current.scrollTop = 0;
|
|
15823
15966
|
}
|
|
@@ -15829,7 +15972,7 @@ function DataGrid({
|
|
|
15829
15972
|
tableRows.length,
|
|
15830
15973
|
Math.ceil((scrollOffset + viewportHeight) / rowHeight) + overscan
|
|
15831
15974
|
);
|
|
15832
|
-
const virtualRows =
|
|
15975
|
+
const virtualRows = React59__namespace.useMemo(() => {
|
|
15833
15976
|
if (!tableRows.length) {
|
|
15834
15977
|
return null;
|
|
15835
15978
|
}
|
|
@@ -15912,7 +16055,7 @@ function DataGrid({
|
|
|
15912
16055
|
] });
|
|
15913
16056
|
}
|
|
15914
16057
|
DataGrid.displayName = "DataGrid";
|
|
15915
|
-
var FormBlock =
|
|
16058
|
+
var FormBlock = React59__namespace.forwardRef(
|
|
15916
16059
|
({ className, ...props }, ref) => {
|
|
15917
16060
|
return /* @__PURE__ */ jsx(
|
|
15918
16061
|
"div",
|
|
@@ -15925,7 +16068,7 @@ var FormBlock = React58__namespace.forwardRef(
|
|
|
15925
16068
|
}
|
|
15926
16069
|
);
|
|
15927
16070
|
FormBlock.displayName = "FormBlock";
|
|
15928
|
-
var FormError =
|
|
16071
|
+
var FormError = React59__namespace.forwardRef(
|
|
15929
16072
|
({ message, children, className, ...props }, ref) => {
|
|
15930
16073
|
if (!message && !children) {
|
|
15931
16074
|
return null;
|
|
@@ -15953,7 +16096,7 @@ var resolveFormLike2 = (form) => {
|
|
|
15953
16096
|
}
|
|
15954
16097
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
15955
16098
|
};
|
|
15956
|
-
var FormInput =
|
|
16099
|
+
var FormInput = React59__namespace.forwardRef(
|
|
15957
16100
|
({
|
|
15958
16101
|
label,
|
|
15959
16102
|
name,
|
|
@@ -16071,7 +16214,7 @@ var resolveFormLike3 = (form) => {
|
|
|
16071
16214
|
}
|
|
16072
16215
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16073
16216
|
};
|
|
16074
|
-
var FormInputMask =
|
|
16217
|
+
var FormInputMask = React59__namespace.forwardRef(
|
|
16075
16218
|
({
|
|
16076
16219
|
label,
|
|
16077
16220
|
name,
|
|
@@ -16186,7 +16329,7 @@ var resolveFormLike4 = (form) => {
|
|
|
16186
16329
|
}
|
|
16187
16330
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16188
16331
|
};
|
|
16189
|
-
var FormInputNumeric =
|
|
16332
|
+
var FormInputNumeric = React59__namespace.forwardRef(
|
|
16190
16333
|
({
|
|
16191
16334
|
label,
|
|
16192
16335
|
name,
|
|
@@ -16373,18 +16516,18 @@ function FormSelect({
|
|
|
16373
16516
|
title: multiContentPropTitle,
|
|
16374
16517
|
...restMultiContentProps
|
|
16375
16518
|
} = multiSelectContentProps;
|
|
16376
|
-
const [internalSingleValue, setInternalSingleValue] =
|
|
16519
|
+
const [internalSingleValue, setInternalSingleValue] = React59__namespace.useState(
|
|
16377
16520
|
typeof defaultValue === "string" ? defaultValue : ""
|
|
16378
16521
|
);
|
|
16379
|
-
const [internalMultiValue, setInternalMultiValue] =
|
|
16522
|
+
const [internalMultiValue, setInternalMultiValue] = React59__namespace.useState(
|
|
16380
16523
|
Array.isArray(defaultValue) ? defaultValue : []
|
|
16381
16524
|
);
|
|
16382
|
-
|
|
16525
|
+
React59__namespace.useEffect(() => {
|
|
16383
16526
|
if (typeof defaultValue === "string" && selectPropValue === void 0 && formValue === void 0 && value === void 0) {
|
|
16384
16527
|
setInternalSingleValue(defaultValue);
|
|
16385
16528
|
}
|
|
16386
16529
|
}, [defaultValue, formValue, selectPropValue, value]);
|
|
16387
|
-
|
|
16530
|
+
React59__namespace.useEffect(() => {
|
|
16388
16531
|
if (Array.isArray(defaultValue) && multiSelectPropValue === void 0 && !Array.isArray(formValue) && !Array.isArray(value)) {
|
|
16389
16532
|
setInternalMultiValue(defaultValue);
|
|
16390
16533
|
}
|
|
@@ -16392,7 +16535,7 @@ function FormSelect({
|
|
|
16392
16535
|
const finalSingleValue = typeof selectPropValue === "string" ? selectPropValue : typeof formValue === "string" ? formValue : typeof value === "string" ? value : internalSingleValue;
|
|
16393
16536
|
const finalMultiValue = Array.isArray(multiSelectPropValue) ? multiSelectPropValue : Array.isArray(formValue) ? formValue : Array.isArray(value) ? value : internalMultiValue;
|
|
16394
16537
|
const resolvedError = (_a2 = formTouched ? formError : void 0) != null ? _a2 : error;
|
|
16395
|
-
const handleFormChange =
|
|
16538
|
+
const handleFormChange = React59__namespace.useCallback(
|
|
16396
16539
|
(nextValue) => {
|
|
16397
16540
|
if (Array.isArray(nextValue)) {
|
|
16398
16541
|
formSetFieldValue == null ? void 0 : formSetFieldValue(name, nextValue);
|
|
@@ -16414,7 +16557,7 @@ function FormSelect({
|
|
|
16414
16557
|
},
|
|
16415
16558
|
[formHandleChange, formSetFieldValue, name]
|
|
16416
16559
|
);
|
|
16417
|
-
const handleSingleChange =
|
|
16560
|
+
const handleSingleChange = React59__namespace.useCallback(
|
|
16418
16561
|
(nextValue) => {
|
|
16419
16562
|
if (selectPropValue === void 0 && formValue === void 0 && value === void 0) {
|
|
16420
16563
|
setInternalSingleValue(nextValue);
|
|
@@ -16438,7 +16581,7 @@ function FormSelect({
|
|
|
16438
16581
|
name
|
|
16439
16582
|
]
|
|
16440
16583
|
);
|
|
16441
|
-
const handleMultiChange =
|
|
16584
|
+
const handleMultiChange = React59__namespace.useCallback(
|
|
16442
16585
|
(nextValue) => {
|
|
16443
16586
|
if (multiSelectPropValue === void 0 && !Array.isArray(formValue) && !Array.isArray(value)) {
|
|
16444
16587
|
setInternalMultiValue(nextValue);
|
|
@@ -16462,7 +16605,7 @@ function FormSelect({
|
|
|
16462
16605
|
name
|
|
16463
16606
|
]
|
|
16464
16607
|
);
|
|
16465
|
-
const handleBlur =
|
|
16608
|
+
const handleBlur = React59__namespace.useCallback(
|
|
16466
16609
|
(event) => {
|
|
16467
16610
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
16468
16611
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -16473,7 +16616,7 @@ function FormSelect({
|
|
|
16473
16616
|
},
|
|
16474
16617
|
[formHandleBlur, formSetFieldTouched, name, onBlur, triggerPropOnBlur]
|
|
16475
16618
|
);
|
|
16476
|
-
const handleMultiBlur =
|
|
16619
|
+
const handleMultiBlur = React59__namespace.useCallback(
|
|
16477
16620
|
(event) => {
|
|
16478
16621
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
16479
16622
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -16486,7 +16629,7 @@ function FormSelect({
|
|
|
16486
16629
|
);
|
|
16487
16630
|
const finalSingleDefaultValue = selectPropDefaultValue != null ? selectPropDefaultValue : typeof defaultValue === "string" ? defaultValue : void 0;
|
|
16488
16631
|
const finalMultiDefaultValue = multiSelectPropDefaultValue != null ? multiSelectPropDefaultValue : Array.isArray(defaultValue) ? defaultValue : void 0;
|
|
16489
|
-
const [mobileDrawerOpen, setMobileDrawerOpen] =
|
|
16632
|
+
const [mobileDrawerOpen, setMobileDrawerOpen] = React59__namespace.useState(false);
|
|
16490
16633
|
const MobileSelectTrigger = ({ isMulti: isMulti2 = false }) => {
|
|
16491
16634
|
var _a3;
|
|
16492
16635
|
const displayValue = isMulti2 ? finalMultiValue.length > 0 ? `${finalMultiValue.length} selected` : placeholder : ((_a3 = options.find((opt) => opt.value === finalSingleValue)) == null ? void 0 : _a3.label) || placeholder;
|
|
@@ -16650,7 +16793,7 @@ var resolveFormLike6 = (form) => {
|
|
|
16650
16793
|
}
|
|
16651
16794
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16652
16795
|
};
|
|
16653
|
-
var FormTextarea =
|
|
16796
|
+
var FormTextarea = React59__namespace.forwardRef(
|
|
16654
16797
|
({
|
|
16655
16798
|
label,
|
|
16656
16799
|
name,
|
|
@@ -16764,7 +16907,7 @@ var resolveFormLike7 = (form) => {
|
|
|
16764
16907
|
}
|
|
16765
16908
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16766
16909
|
};
|
|
16767
|
-
var FormRadioGroup =
|
|
16910
|
+
var FormRadioGroup = React59__namespace.forwardRef(
|
|
16768
16911
|
({
|
|
16769
16912
|
label,
|
|
16770
16913
|
description,
|
|
@@ -16803,7 +16946,7 @@ var FormRadioGroup = React58__namespace.forwardRef(
|
|
|
16803
16946
|
} = radioGroupProps;
|
|
16804
16947
|
const computedValue = (_b = value != null ? value : radioGroupValue !== void 0 ? radioGroupValue : void 0) != null ? _b : formValue !== void 0 && formValue !== null ? String(formValue) : void 0;
|
|
16805
16948
|
const resolvedDefaultValue = computedValue === void 0 ? defaultValue != null ? defaultValue : radioGroupDefaultValue : void 0;
|
|
16806
|
-
const handleChange =
|
|
16949
|
+
const handleChange = React59__namespace.useCallback(
|
|
16807
16950
|
(nextValue) => {
|
|
16808
16951
|
var _a3;
|
|
16809
16952
|
(_a3 = resolvedForm == null ? void 0 : resolvedForm.setFieldValue) == null ? void 0 : _a3.call(resolvedForm, name, nextValue);
|
|
@@ -16812,7 +16955,7 @@ var FormRadioGroup = React58__namespace.forwardRef(
|
|
|
16812
16955
|
},
|
|
16813
16956
|
[resolvedForm, name, onChange, radioGroupOnValueChange]
|
|
16814
16957
|
);
|
|
16815
|
-
const handleBlur =
|
|
16958
|
+
const handleBlur = React59__namespace.useCallback(
|
|
16816
16959
|
(event) => {
|
|
16817
16960
|
var _a3, _b2;
|
|
16818
16961
|
(_a3 = resolvedForm == null ? void 0 : resolvedForm.setFieldTouched) == null ? void 0 : _a3.call(resolvedForm, name, true);
|
|
@@ -16936,10 +17079,10 @@ function FormDatePicker({
|
|
|
16936
17079
|
status: datePickerPropStatus,
|
|
16937
17080
|
...restDatePickerProps
|
|
16938
17081
|
} = datePickerProps;
|
|
16939
|
-
const [internalValue, setInternalValue] =
|
|
17082
|
+
const [internalValue, setInternalValue] = React59__namespace.useState(
|
|
16940
17083
|
(_a2 = datePickerPropDefaultValue != null ? datePickerPropDefaultValue : defaultValue) != null ? _a2 : null
|
|
16941
17084
|
);
|
|
16942
|
-
|
|
17085
|
+
React59__namespace.useEffect(() => {
|
|
16943
17086
|
var _a3;
|
|
16944
17087
|
if (datePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
16945
17088
|
setInternalValue((_a3 = datePickerPropDefaultValue != null ? datePickerPropDefaultValue : defaultValue) != null ? _a3 : null);
|
|
@@ -16950,7 +17093,7 @@ function FormDatePicker({
|
|
|
16950
17093
|
const finalStatus = datePickerPropStatus != null ? datePickerPropStatus : resolvedError ? "error" : void 0;
|
|
16951
17094
|
const finalPlaceholder = datePickerPropPlaceholder != null ? datePickerPropPlaceholder : placeholder;
|
|
16952
17095
|
const { children: labelChildren, ...restLabelProps } = labelProps;
|
|
16953
|
-
const handleValueChange =
|
|
17096
|
+
const handleValueChange = React59__namespace.useCallback(
|
|
16954
17097
|
(nextValue, dateString) => {
|
|
16955
17098
|
if (datePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
16956
17099
|
setInternalValue(nextValue != null ? nextValue : null);
|
|
@@ -16982,7 +17125,7 @@ function FormDatePicker({
|
|
|
16982
17125
|
value
|
|
16983
17126
|
]
|
|
16984
17127
|
);
|
|
16985
|
-
const handleBlur =
|
|
17128
|
+
const handleBlur = React59__namespace.useCallback(
|
|
16986
17129
|
(event) => {
|
|
16987
17130
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
16988
17131
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -17091,10 +17234,10 @@ function FormTimePicker({
|
|
|
17091
17234
|
status: timePickerPropStatus,
|
|
17092
17235
|
...restTimePickerProps
|
|
17093
17236
|
} = timePickerProps;
|
|
17094
|
-
const [internalValue, setInternalValue] =
|
|
17237
|
+
const [internalValue, setInternalValue] = React59__namespace.useState(
|
|
17095
17238
|
(_a2 = timePickerPropDefaultValue != null ? timePickerPropDefaultValue : defaultValue) != null ? _a2 : null
|
|
17096
17239
|
);
|
|
17097
|
-
|
|
17240
|
+
React59__namespace.useEffect(() => {
|
|
17098
17241
|
var _a3;
|
|
17099
17242
|
if (timePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
17100
17243
|
setInternalValue((_a3 = timePickerPropDefaultValue != null ? timePickerPropDefaultValue : defaultValue) != null ? _a3 : null);
|
|
@@ -17105,7 +17248,7 @@ function FormTimePicker({
|
|
|
17105
17248
|
const finalStatus = timePickerPropStatus != null ? timePickerPropStatus : resolvedError ? "error" : void 0;
|
|
17106
17249
|
const finalPlaceholder = timePickerPropPlaceholder != null ? timePickerPropPlaceholder : placeholder;
|
|
17107
17250
|
const { children: labelChildren, ...restLabelProps } = labelProps;
|
|
17108
|
-
const handleValueChange =
|
|
17251
|
+
const handleValueChange = React59__namespace.useCallback(
|
|
17109
17252
|
(nextValue, formatted) => {
|
|
17110
17253
|
if (timePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
17111
17254
|
setInternalValue(nextValue != null ? nextValue : null);
|
|
@@ -17137,7 +17280,7 @@ function FormTimePicker({
|
|
|
17137
17280
|
value
|
|
17138
17281
|
]
|
|
17139
17282
|
);
|
|
17140
|
-
const handleBlur =
|
|
17283
|
+
const handleBlur = React59__namespace.useCallback(
|
|
17141
17284
|
(event) => {
|
|
17142
17285
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
17143
17286
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -17213,10 +17356,12 @@ var FormSwitch = ({
|
|
|
17213
17356
|
rules
|
|
17214
17357
|
}) => {
|
|
17215
17358
|
var _a2;
|
|
17216
|
-
const fallbackId =
|
|
17359
|
+
const fallbackId = React59__namespace.useId();
|
|
17217
17360
|
const {
|
|
17218
17361
|
id: providedId,
|
|
17219
17362
|
onCheckedChange: switchOnCheckedChange,
|
|
17363
|
+
className: switchClassName,
|
|
17364
|
+
disabled: switchDisabled,
|
|
17220
17365
|
"aria-describedby": ariaDescribedBy,
|
|
17221
17366
|
"aria-labelledby": ariaLabelledBy,
|
|
17222
17367
|
...restSwitchProps
|
|
@@ -17235,6 +17380,27 @@ var FormSwitch = ({
|
|
|
17235
17380
|
const messageId = resolvedError ? `${switchId}-error` : void 0;
|
|
17236
17381
|
const combinedAriaDescribedBy = [ariaDescribedBy, descriptionId, messageId].filter(Boolean).join(" ").trim() || void 0;
|
|
17237
17382
|
const computedAriaLabelledBy = label ? [ariaLabelledBy, `${switchId}-label`].filter(Boolean).join(" ").trim() || void 0 : ariaLabelledBy;
|
|
17383
|
+
const handleLabelClick = React59__namespace.useCallback(
|
|
17384
|
+
(event) => {
|
|
17385
|
+
if (switchDisabled) {
|
|
17386
|
+
return;
|
|
17387
|
+
}
|
|
17388
|
+
const switchElement = document.getElementById(switchId);
|
|
17389
|
+
if (!switchElement) {
|
|
17390
|
+
return;
|
|
17391
|
+
}
|
|
17392
|
+
event.preventDefault();
|
|
17393
|
+
if (typeof switchElement.focus === "function") {
|
|
17394
|
+
try {
|
|
17395
|
+
switchElement.focus({ preventScroll: true });
|
|
17396
|
+
} catch {
|
|
17397
|
+
switchElement.focus();
|
|
17398
|
+
}
|
|
17399
|
+
}
|
|
17400
|
+
switchElement.click();
|
|
17401
|
+
},
|
|
17402
|
+
[switchDisabled, switchId]
|
|
17403
|
+
);
|
|
17238
17404
|
const handleCheckedChange = (nextState) => {
|
|
17239
17405
|
var _a3, _b, _c;
|
|
17240
17406
|
const validationError = rules ? validateSwitch(nextState, rules) : void 0;
|
|
@@ -17252,7 +17418,19 @@ var FormSwitch = ({
|
|
|
17252
17418
|
};
|
|
17253
17419
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-start justify-between gap-4", className), children: [
|
|
17254
17420
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
17255
|
-
label ? /* @__PURE__ */ jsx(
|
|
17421
|
+
label ? /* @__PURE__ */ jsx(
|
|
17422
|
+
FormLabel,
|
|
17423
|
+
{
|
|
17424
|
+
id: `${switchId}-label`,
|
|
17425
|
+
htmlFor: switchId,
|
|
17426
|
+
onClick: handleLabelClick,
|
|
17427
|
+
className: cn(
|
|
17428
|
+
"text-sm leading-none font-medium",
|
|
17429
|
+
switchDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
17430
|
+
),
|
|
17431
|
+
children: label
|
|
17432
|
+
}
|
|
17433
|
+
) : null,
|
|
17256
17434
|
description ? /* @__PURE__ */ jsx(FormDescription, { id: descriptionId, children: description }) : null,
|
|
17257
17435
|
/* @__PURE__ */ jsx(FormMessage, { id: messageId, children: resolvedError })
|
|
17258
17436
|
] }),
|
|
@@ -17264,6 +17442,8 @@ var FormSwitch = ({
|
|
|
17264
17442
|
"aria-invalid": Boolean(resolvedError),
|
|
17265
17443
|
"aria-describedby": combinedAriaDescribedBy,
|
|
17266
17444
|
"aria-labelledby": computedAriaLabelledBy,
|
|
17445
|
+
className: cn("cursor-pointer", switchClassName),
|
|
17446
|
+
disabled: switchDisabled,
|
|
17267
17447
|
...restSwitchProps,
|
|
17268
17448
|
...fieldChecked !== void 0 ? { checked: fieldChecked } : { defaultChecked },
|
|
17269
17449
|
onCheckedChange: handleCheckedChange
|
|
@@ -17578,10 +17758,12 @@ exports.Tooltip = Tooltip2;
|
|
|
17578
17758
|
exports.TooltipContent = TooltipContent;
|
|
17579
17759
|
exports.TooltipProvider = TooltipProvider;
|
|
17580
17760
|
exports.TooltipTrigger = TooltipTrigger;
|
|
17761
|
+
exports.__virtualKeyboardTesting = __virtualKeyboardTesting;
|
|
17581
17762
|
exports.badgeVariants = badgeVariants;
|
|
17582
17763
|
exports.buttonVariants = buttonVariants;
|
|
17583
17764
|
exports.cn = cn;
|
|
17584
17765
|
exports.createStore = createStore;
|
|
17766
|
+
exports.detectVirtualKeyboardDevice = detectVirtualKeyboardDevice;
|
|
17585
17767
|
exports.dragColumn = dragColumn;
|
|
17586
17768
|
exports.formatCurrency = formatCurrency;
|
|
17587
17769
|
exports.getInitials = getInitials;
|
|
@@ -17590,6 +17772,7 @@ exports.getThemeMode = getThemeMode;
|
|
|
17590
17772
|
exports.initializeMonitoring = initializeMonitoring;
|
|
17591
17773
|
exports.isNullOrEmpty = isNullOrEmpty;
|
|
17592
17774
|
exports.isThemeMode = isThemeMode;
|
|
17775
|
+
exports.maybeScrollElementIntoView = maybeScrollElementIntoView;
|
|
17593
17776
|
exports.mobileFooterVariantMeta = mobileFooterVariantMeta;
|
|
17594
17777
|
exports.mobileFooterVariants = mobileFooterVariants;
|
|
17595
17778
|
exports.mobileHeaderVariantMeta = mobileHeaderVariantMeta;
|