@dmsi/wedgekit-react 0.0.643 → 0.0.645
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/{chunk-XX5GVIPZ.js → chunk-3MV3KMQH.js} +2 -2
- package/dist/{chunk-V7GPM6Z3.js → chunk-3PBA2EZ5.js} +1 -1
- package/dist/{chunk-3R3AY5MT.js → chunk-B3T7KBDA.js} +1 -1
- package/dist/{chunk-FIOXWZWU.js → chunk-ECYXZZWC.js} +1 -1
- package/dist/{chunk-RQMOWYB7.js → chunk-EXCAOI2L.js} +3 -3
- package/dist/{chunk-MQB6BSRX.js → chunk-FCGPQNS2.js} +1 -1
- package/dist/{chunk-SJ3SULQB.js → chunk-FJXWYGB7.js} +7 -7
- package/dist/{chunk-QJZ3XHNH.js → chunk-HCHKYUNQ.js} +19 -5
- package/dist/{chunk-5JHKFK73.js → chunk-HIGNJAQA.js} +2 -2
- package/dist/{chunk-IATOG76G.js → chunk-ISRG77J6.js} +1 -1
- package/dist/{chunk-UB3GEENN.js → chunk-OZEKRO4L.js} +1 -1
- package/dist/{chunk-LGX34HML.js → chunk-Q4AANHJY.js} +1 -1
- package/dist/{chunk-PS7MBNUT.js → chunk-REC2XOPI.js} +1 -1
- package/dist/{chunk-ARWHCWG7.js → chunk-XT4BQXSX.js} +1 -1
- package/dist/{chunk-YR4ZO2XL.js → chunk-ZSRTAMSW.js} +56 -23
- package/dist/components/CalendarRange.cjs +202 -180
- package/dist/components/CalendarRange.js +15 -15
- package/dist/components/CompactImagesPreview.cjs +6 -3
- package/dist/components/CompactImagesPreview.js +3 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +202 -180
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +15 -15
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +202 -180
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +15 -15
- package/dist/components/DataGrid/PinnedColumns.cjs +202 -180
- package/dist/components/DataGrid/PinnedColumns.js +15 -15
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +202 -180
- package/dist/components/DataGrid/TableBody/LoadingCell.js +15 -15
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +202 -180
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +15 -15
- package/dist/components/DataGrid/TableBody/index.cjs +202 -180
- package/dist/components/DataGrid/TableBody/index.js +15 -15
- package/dist/components/DataGrid/index.cjs +203 -181
- package/dist/components/DataGrid/index.js +15 -15
- package/dist/components/DataGrid/utils.cjs +202 -180
- package/dist/components/DataGrid/utils.js +15 -15
- package/dist/components/DataGridCell.cjs +61 -58
- package/dist/components/DataGridCell.js +6 -6
- package/dist/components/DateInput.cjs +195 -173
- package/dist/components/DateInput.js +15 -15
- package/dist/components/DateRangeInput.cjs +208 -186
- package/dist/components/DateRangeInput.js +15 -15
- package/dist/components/Menu.cjs +15 -12
- package/dist/components/Menu.js +4 -4
- package/dist/components/MenuOption.cjs +8 -5
- package/dist/components/MenuOption.js +3 -3
- package/dist/components/MobileDataGrid/ColumnList.js +4 -4
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +206 -184
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +15 -15
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +3 -3
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +206 -184
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +15 -15
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +3 -3
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +19 -16
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +6 -6
- package/dist/components/MobileDataGrid/index.cjs +215 -193
- package/dist/components/MobileDataGrid/index.js +15 -15
- package/dist/components/Modal.cjs +15 -12
- package/dist/components/Modal.js +3 -3
- package/dist/components/NestedMenu.cjs +11 -8
- package/dist/components/NestedMenu.js +3 -3
- package/dist/components/PDFViewer/index.cjs +31 -28
- package/dist/components/PDFViewer/index.js +3 -3
- package/dist/components/ProductImagePreview/index.cjs +18 -15
- package/dist/components/ProductImagePreview/index.js +3 -3
- package/dist/components/ProjectBar.cjs +3 -0
- package/dist/components/ProjectBar.js +2 -2
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +263 -241
- package/dist/components/index.js +15 -15
- package/dist/components/useMenuSystem.cjs +22 -19
- package/dist/components/useMenuSystem.js +3 -3
- package/dist/hooks/index.cjs +76 -26
- package/dist/hooks/index.js +4 -2
- package/dist/utils/index.cjs +21 -5
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
|
@@ -265,11 +265,24 @@ function formatDate(date) {
|
|
|
265
265
|
|
|
266
266
|
// src/utils/mergeObjectArrays.ts
|
|
267
267
|
function mergeObjectArrays(arr1, arr2) {
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
268
|
+
const arr2Map = /* @__PURE__ */ new Map();
|
|
269
|
+
for (const item of arr2) {
|
|
270
|
+
const id = item.id;
|
|
271
|
+
if (id !== void 0) {
|
|
272
|
+
arr2Map.set(id, item);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return arr1.map((item1) => {
|
|
276
|
+
const id = item1.id;
|
|
277
|
+
if (id !== void 0 && arr2Map.has(id)) {
|
|
278
|
+
const item2 = arr2Map.get(id);
|
|
279
|
+
const meta1 = item1.meta;
|
|
280
|
+
const meta2 = item2.meta;
|
|
281
|
+
const mergedMeta = meta1 && meta2 && typeof meta1 === "object" && typeof meta2 === "object" ? __spreadValues(__spreadValues({}, meta1), meta2) : meta2 != null ? meta2 : meta1;
|
|
282
|
+
return __spreadProps(__spreadValues(__spreadValues({}, item1), item2), { meta: mergedMeta });
|
|
283
|
+
}
|
|
284
|
+
return item1;
|
|
285
|
+
});
|
|
273
286
|
}
|
|
274
287
|
|
|
275
288
|
// src/utils/index.ts
|
|
@@ -305,52 +318,58 @@ var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
|
|
|
305
318
|
function useTableLayout(initialColumns, key, autosync = true) {
|
|
306
319
|
const [columns, setColumns] = (0, import_react4.useState)(initialColumns);
|
|
307
320
|
const [isReady, setIsReady] = (0, import_react4.useState)(false);
|
|
308
|
-
const
|
|
321
|
+
const isReadyRef = (0, import_react4.useRef)(false);
|
|
322
|
+
const keyRef = (0, import_react4.useRef)(key);
|
|
323
|
+
(0, import_react4.useEffect)(() => {
|
|
324
|
+
isReadyRef.current = isReady;
|
|
325
|
+
keyRef.current = key;
|
|
326
|
+
}, [isReady, key]);
|
|
309
327
|
const handleSaveLayout = (0, import_react4.useCallback)(
|
|
310
328
|
(setter, _internal) => {
|
|
311
|
-
if (!
|
|
329
|
+
if (!isReadyRef.current && !_internal || !keyRef.current) return;
|
|
312
330
|
setColumns((prevColumns) => {
|
|
313
331
|
const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
|
|
314
|
-
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
|
|
332
|
+
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal) {
|
|
315
333
|
return prevColumns;
|
|
334
|
+
}
|
|
316
335
|
localStorage.setItem(
|
|
317
|
-
getLocalStorageKeyWithPrefix(`${
|
|
336
|
+
getLocalStorageKeyWithPrefix(`${keyRef.current}-tableLayout`),
|
|
318
337
|
JSON.stringify(newColumns)
|
|
319
338
|
);
|
|
320
339
|
return newColumns;
|
|
321
340
|
});
|
|
322
341
|
},
|
|
323
|
-
[
|
|
342
|
+
[]
|
|
324
343
|
);
|
|
325
344
|
(0, import_react4.useEffect)(() => {
|
|
326
345
|
if (!autosync) return;
|
|
327
|
-
if (!key)
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
`useTableLayout should only be called once per component render cycle.
|
|
331
|
-
${renderCountRef.current} Renders detected.
|
|
332
|
-
Check dependency stability`
|
|
333
|
-
);
|
|
346
|
+
if (!key) {
|
|
347
|
+
setIsReady(true);
|
|
348
|
+
return;
|
|
334
349
|
}
|
|
335
|
-
renderCountRef.current += 1;
|
|
336
350
|
const savedLayout = localStorage.getItem(
|
|
337
351
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
338
352
|
);
|
|
339
353
|
if (savedLayout) {
|
|
340
|
-
|
|
354
|
+
setColumns(
|
|
341
355
|
mergeObjectArrays(
|
|
342
356
|
initialColumns,
|
|
343
357
|
JSON.parse(savedLayout)
|
|
344
|
-
)
|
|
345
|
-
|
|
358
|
+
)
|
|
359
|
+
);
|
|
360
|
+
} else {
|
|
361
|
+
localStorage.setItem(
|
|
362
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
363
|
+
JSON.stringify(initialColumns)
|
|
346
364
|
);
|
|
365
|
+
setColumns((prev) => {
|
|
366
|
+
if (JSON.stringify(initialColumns) === JSON.stringify(prev))
|
|
367
|
+
return prev;
|
|
368
|
+
return initialColumns;
|
|
369
|
+
});
|
|
347
370
|
}
|
|
348
|
-
if (!savedLayout) handleSaveLayout(initialColumns, true);
|
|
349
371
|
setIsReady(true);
|
|
350
|
-
|
|
351
|
-
renderCountRef.current = 0;
|
|
352
|
-
};
|
|
353
|
-
}, [handleSaveLayout, initialColumns, key, autosync]);
|
|
372
|
+
}, [initialColumns, key, autosync]);
|
|
354
373
|
const getSavedLayout = (0, import_react4.useCallback)(() => {
|
|
355
374
|
const savedLayout = localStorage.getItem(
|
|
356
375
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
@@ -362,6 +381,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
362
381
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
363
382
|
}
|
|
364
383
|
|
|
384
|
+
// src/hooks/useEditCell.tsx
|
|
385
|
+
var import_react5 = require("react");
|
|
386
|
+
|
|
365
387
|
// src/classNames.ts
|
|
366
388
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
367
389
|
var typography = {
|
|
@@ -506,7 +528,7 @@ var gapUsingContainerPadding = (0, import_clsx.default)(
|
|
|
506
528
|
var import_sortable = require("@dnd-kit/sortable");
|
|
507
529
|
|
|
508
530
|
// ../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js
|
|
509
|
-
var
|
|
531
|
+
var import_react6 = require("react");
|
|
510
532
|
var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
511
533
|
var CSS = /* @__PURE__ */ Object.freeze({
|
|
512
534
|
Translate: {
|
|
@@ -555,11 +577,11 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
555
577
|
|
|
556
578
|
// src/components/DataGridCell.tsx
|
|
557
579
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
558
|
-
var
|
|
580
|
+
var import_react12 = require("react");
|
|
559
581
|
|
|
560
582
|
// src/components/MenuOption.tsx
|
|
561
583
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
562
|
-
var
|
|
584
|
+
var import_react7 = require("react");
|
|
563
585
|
|
|
564
586
|
// src/components/Label.tsx
|
|
565
587
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
@@ -844,12 +866,12 @@ var MenuOption = ({
|
|
|
844
866
|
onMouseMove,
|
|
845
867
|
small = false
|
|
846
868
|
}) => {
|
|
847
|
-
const uniqueId = (0,
|
|
848
|
-
const internalRef = (0,
|
|
869
|
+
const uniqueId = (0, import_react7.useId)();
|
|
870
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
849
871
|
const actualRef = ref || internalRef;
|
|
850
|
-
const menuId = (0,
|
|
872
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
851
873
|
const isMobile = useMatchesMobile();
|
|
852
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
874
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
853
875
|
const handleMouseEnter = () => {
|
|
854
876
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
855
877
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1009,27 +1031,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1009
1031
|
|
|
1010
1032
|
// src/components/Menu.tsx
|
|
1011
1033
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
1012
|
-
var
|
|
1034
|
+
var import_react9 = require("react");
|
|
1013
1035
|
var import_react_dom = require("react-dom");
|
|
1014
1036
|
|
|
1015
1037
|
// src/components/useMenuSystem.tsx
|
|
1016
|
-
var
|
|
1038
|
+
var import_react8 = require("react");
|
|
1017
1039
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1018
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1040
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1019
1041
|
{}
|
|
1020
1042
|
);
|
|
1021
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1022
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1043
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1044
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1023
1045
|
null
|
|
1024
1046
|
);
|
|
1025
|
-
const menuRootRef = (0,
|
|
1026
|
-
const subMenuRefs = (0,
|
|
1027
|
-
const hoverTimeoutRef = (0,
|
|
1028
|
-
const closeTimeoutRef = (0,
|
|
1029
|
-
const mouseStopTimeoutRef = (0,
|
|
1030
|
-
const isMouseMovingRef = (0,
|
|
1031
|
-
const pendingOpenActionRef = (0,
|
|
1032
|
-
const pendingCloseActionRef = (0,
|
|
1047
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1048
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1049
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1050
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1051
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1052
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1053
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1054
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1033
1055
|
const isMobile = useMatchesMobile();
|
|
1034
1056
|
const toggleMenu = (menuId, level) => {
|
|
1035
1057
|
if (closeTimeoutRef.current) {
|
|
@@ -1069,7 +1091,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1069
1091
|
return newActiveMenus;
|
|
1070
1092
|
});
|
|
1071
1093
|
};
|
|
1072
|
-
const executePendingActions = (0,
|
|
1094
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1073
1095
|
if (pendingCloseActionRef.current) {
|
|
1074
1096
|
pendingCloseActionRef.current();
|
|
1075
1097
|
pendingCloseActionRef.current = null;
|
|
@@ -1158,7 +1180,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1158
1180
|
const isMenuActive = (menuId, level) => {
|
|
1159
1181
|
return activeMenus[level] === menuId;
|
|
1160
1182
|
};
|
|
1161
|
-
(0,
|
|
1183
|
+
(0, import_react8.useEffect)(() => {
|
|
1162
1184
|
const handleClickOutside = (event) => {
|
|
1163
1185
|
var _a;
|
|
1164
1186
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1177,7 +1199,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1177
1199
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1178
1200
|
};
|
|
1179
1201
|
}, [activeMenus]);
|
|
1180
|
-
(0,
|
|
1202
|
+
(0, import_react8.useEffect)(() => {
|
|
1181
1203
|
return () => {
|
|
1182
1204
|
if (hoverTimeoutRef.current) {
|
|
1183
1205
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1255,13 +1277,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1255
1277
|
};
|
|
1256
1278
|
}
|
|
1257
1279
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1258
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1280
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1259
1281
|
top: 0,
|
|
1260
1282
|
left: 0,
|
|
1261
1283
|
minWidth: 0
|
|
1262
1284
|
});
|
|
1263
1285
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1264
|
-
const updatePosition = (0,
|
|
1286
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1265
1287
|
var _a, _b, _c;
|
|
1266
1288
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1267
1289
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1309,7 +1331,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1309
1331
|
minWidth: triggerRect.width
|
|
1310
1332
|
});
|
|
1311
1333
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1312
|
-
(0,
|
|
1334
|
+
(0, import_react8.useEffect)(() => {
|
|
1313
1335
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1314
1336
|
const handleClickOutside = (event) => {
|
|
1315
1337
|
var _a, _b, _c, _d, _e;
|
|
@@ -1335,7 +1357,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1335
1357
|
options == null ? void 0 : options.menuRef,
|
|
1336
1358
|
options == null ? void 0 : options.additionalRefs
|
|
1337
1359
|
]);
|
|
1338
|
-
(0,
|
|
1360
|
+
(0, import_react8.useEffect)(() => {
|
|
1339
1361
|
updatePosition();
|
|
1340
1362
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1341
1363
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1416,9 +1438,9 @@ var Menu = (_a) => {
|
|
|
1416
1438
|
"menuName",
|
|
1417
1439
|
"calculateMinMaxHeight"
|
|
1418
1440
|
]);
|
|
1419
|
-
const internalRef = (0,
|
|
1441
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1420
1442
|
const actualRef = ref || internalRef;
|
|
1421
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1443
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1422
1444
|
const isMobile = useMatchesMobile();
|
|
1423
1445
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1424
1446
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1431,7 +1453,7 @@ var Menu = (_a) => {
|
|
|
1431
1453
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1432
1454
|
}
|
|
1433
1455
|
);
|
|
1434
|
-
(0,
|
|
1456
|
+
(0, import_react9.useEffect)(() => {
|
|
1435
1457
|
if (calculateMinMaxHeight) {
|
|
1436
1458
|
return;
|
|
1437
1459
|
}
|
|
@@ -1455,7 +1477,7 @@ var Menu = (_a) => {
|
|
|
1455
1477
|
cancelAnimationFrame(raf);
|
|
1456
1478
|
};
|
|
1457
1479
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1458
|
-
(0,
|
|
1480
|
+
(0, import_react9.useEffect)(() => {
|
|
1459
1481
|
if (!calculateMinMaxHeight) {
|
|
1460
1482
|
return;
|
|
1461
1483
|
}
|
|
@@ -1466,14 +1488,14 @@ var Menu = (_a) => {
|
|
|
1466
1488
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1467
1489
|
}
|
|
1468
1490
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1469
|
-
(0,
|
|
1491
|
+
(0, import_react9.useEffect)(() => {
|
|
1470
1492
|
if (!show) {
|
|
1471
1493
|
return;
|
|
1472
1494
|
}
|
|
1473
1495
|
initializeMenuFocus();
|
|
1474
1496
|
updatePosition();
|
|
1475
1497
|
}, [show, updatePosition]);
|
|
1476
|
-
(0,
|
|
1498
|
+
(0, import_react9.useEffect)(() => {
|
|
1477
1499
|
if (!show || !setShow) {
|
|
1478
1500
|
return;
|
|
1479
1501
|
}
|
|
@@ -1627,10 +1649,10 @@ var Menu = (_a) => {
|
|
|
1627
1649
|
Menu.displayName = "Menu";
|
|
1628
1650
|
|
|
1629
1651
|
// src/components/Search.tsx
|
|
1630
|
-
var
|
|
1652
|
+
var import_react11 = require("react");
|
|
1631
1653
|
|
|
1632
1654
|
// src/components/Input.tsx
|
|
1633
|
-
var
|
|
1655
|
+
var import_react10 = require("react");
|
|
1634
1656
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1635
1657
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1636
1658
|
var InputBase = (_a) => {
|
|
@@ -1687,9 +1709,9 @@ var InputBase = (_a) => {
|
|
|
1687
1709
|
"data-error": error && !focus || null,
|
|
1688
1710
|
"data-focus": focus || null
|
|
1689
1711
|
};
|
|
1690
|
-
const inputRef = (0,
|
|
1712
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
1691
1713
|
const inputId = id ? `${id}-input` : void 0;
|
|
1692
|
-
(0,
|
|
1714
|
+
(0, import_react10.useEffect)(() => {
|
|
1693
1715
|
var _a2;
|
|
1694
1716
|
const input = inputRef.current;
|
|
1695
1717
|
const focusHandler = () => {
|
|
@@ -1848,15 +1870,15 @@ var Input = (_a) => {
|
|
|
1848
1870
|
"testid",
|
|
1849
1871
|
"rightAdornment"
|
|
1850
1872
|
]);
|
|
1851
|
-
const [internalValue, setInternalValue] = (0,
|
|
1852
|
-
const [displayValue, setDisplayValue] = (0,
|
|
1853
|
-
(0,
|
|
1873
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1874
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1875
|
+
(0, import_react10.useEffect)(() => {
|
|
1854
1876
|
var _a2;
|
|
1855
1877
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
1856
1878
|
setInternalValue(stringValue);
|
|
1857
1879
|
setDisplayValue(stringValue);
|
|
1858
1880
|
}, [propValue]);
|
|
1859
|
-
(0,
|
|
1881
|
+
(0, import_react10.useEffect)(() => {
|
|
1860
1882
|
var _a2;
|
|
1861
1883
|
if (variant !== "currency") {
|
|
1862
1884
|
return;
|
|
@@ -2117,14 +2139,14 @@ var Search = (_a) => {
|
|
|
2117
2139
|
"removeRoundness",
|
|
2118
2140
|
"autocompletePadding"
|
|
2119
2141
|
]);
|
|
2120
|
-
const inputRef = (0,
|
|
2121
|
-
const inputContainerRef = (0,
|
|
2122
|
-
const preventFocusOnInitialRender = (0,
|
|
2123
|
-
const [show, setShow] = (0,
|
|
2124
|
-
const [clearing, setClearing] = (0,
|
|
2125
|
-
const uniqueId = (0,
|
|
2142
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2143
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2144
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2145
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2146
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2147
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2126
2148
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2127
|
-
(0,
|
|
2149
|
+
(0, import_react11.useEffect)(() => {
|
|
2128
2150
|
var _a2;
|
|
2129
2151
|
if (preventFocusOnInitialRender.current) {
|
|
2130
2152
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2208,7 +2230,7 @@ Search.displayName = "Search";
|
|
|
2208
2230
|
|
|
2209
2231
|
// src/components/DataGridCell.tsx
|
|
2210
2232
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2211
|
-
var DataGridCell = (0,
|
|
2233
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2212
2234
|
(_a) => {
|
|
2213
2235
|
var _b = _a, {
|
|
2214
2236
|
id,
|
|
@@ -2250,10 +2272,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2250
2272
|
"testid"
|
|
2251
2273
|
]);
|
|
2252
2274
|
const Element = type === "header" ? "th" : "td";
|
|
2253
|
-
const timerRef = (0,
|
|
2254
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2255
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2256
|
-
(0,
|
|
2275
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2276
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2277
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2278
|
+
(0, import_react12.useEffect)(() => {
|
|
2257
2279
|
return () => {
|
|
2258
2280
|
if (timerRef.current) {
|
|
2259
2281
|
clearTimeout(timerRef.current);
|
|
@@ -2363,12 +2385,12 @@ function DataCellHeader(_a) {
|
|
|
2363
2385
|
"useMenuDefaultMinWidth"
|
|
2364
2386
|
]);
|
|
2365
2387
|
var _a2;
|
|
2366
|
-
const [showMenu, setShowMenu] = (0,
|
|
2367
|
-
const [filter, setFilter] = (0,
|
|
2388
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2389
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2368
2390
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2369
2391
|
);
|
|
2370
|
-
const ref = (0,
|
|
2371
|
-
const predeterminedPinned = (0,
|
|
2392
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2393
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2372
2394
|
const { column, getContext } = header;
|
|
2373
2395
|
const { id: columnId, setFilterValue } = column;
|
|
2374
2396
|
const {
|
|
@@ -2378,14 +2400,14 @@ function DataCellHeader(_a) {
|
|
|
2378
2400
|
listeners: subMenuListeners,
|
|
2379
2401
|
mobileHide
|
|
2380
2402
|
} = useSubMenuSystem(node ? node : ref);
|
|
2381
|
-
(0,
|
|
2403
|
+
(0, import_react12.useEffect)(() => {
|
|
2382
2404
|
var _a3, _b2, _c;
|
|
2383
2405
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2384
2406
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2385
2407
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2386
2408
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2387
2409
|
}, [columnId, getContext]);
|
|
2388
|
-
(0,
|
|
2410
|
+
(0, import_react12.useEffect)(() => {
|
|
2389
2411
|
const handler = setTimeout(() => {
|
|
2390
2412
|
setFilterValue(filter);
|
|
2391
2413
|
}, 500);
|
|
@@ -2648,7 +2670,7 @@ function DragAlongCell(_a) {
|
|
|
2648
2670
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2649
2671
|
|
|
2650
2672
|
// src/components/Select.tsx
|
|
2651
|
-
var
|
|
2673
|
+
var import_react13 = require("react");
|
|
2652
2674
|
var import_clsx10 = __toESM(require("clsx"), 1);
|
|
2653
2675
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2654
2676
|
var Select = (_a) => {
|
|
@@ -2682,11 +2704,11 @@ var Select = (_a) => {
|
|
|
2682
2704
|
"value"
|
|
2683
2705
|
]);
|
|
2684
2706
|
var _a2;
|
|
2685
|
-
const inputRef = (0,
|
|
2686
|
-
const inputContainerRef = (0,
|
|
2687
|
-
const preventFocusOnInitialRender = (0,
|
|
2688
|
-
const [show, setShow] = (0,
|
|
2689
|
-
(0,
|
|
2707
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
2708
|
+
const inputContainerRef = (0, import_react13.useRef)(null);
|
|
2709
|
+
const preventFocusOnInitialRender = (0, import_react13.useRef)(true);
|
|
2710
|
+
const [show, setShow] = (0, import_react13.useState)(false);
|
|
2711
|
+
(0, import_react13.useEffect)(() => {
|
|
2690
2712
|
var _a3;
|
|
2691
2713
|
if (preventFocusOnInitialRender.current) {
|
|
2692
2714
|
preventFocusOnInitialRender.current = false;
|
|
@@ -3108,7 +3130,7 @@ Button.displayName = "Button";
|
|
|
3108
3130
|
|
|
3109
3131
|
// src/components/Tooltip.tsx
|
|
3110
3132
|
var import_clsx14 = __toESM(require("clsx"), 1);
|
|
3111
|
-
var
|
|
3133
|
+
var import_react14 = require("react");
|
|
3112
3134
|
var import_react_dom2 = require("react-dom");
|
|
3113
3135
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3114
3136
|
var Tooltip = ({
|
|
@@ -3121,11 +3143,11 @@ var Tooltip = ({
|
|
|
3121
3143
|
offset = 8,
|
|
3122
3144
|
keepHidden = false
|
|
3123
3145
|
}) => {
|
|
3124
|
-
const ref = (0,
|
|
3125
|
-
const tooltipRef = (0,
|
|
3126
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
3127
|
-
const [isVisible, setIsVisible] = (0,
|
|
3128
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
3146
|
+
const ref = (0, import_react14.useRef)(null);
|
|
3147
|
+
const tooltipRef = (0, import_react14.useRef)(null);
|
|
3148
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react14.useState)({ top: 0, left: 0 });
|
|
3149
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(false);
|
|
3150
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react14.useState)(false);
|
|
3129
3151
|
const updatePosition = () => {
|
|
3130
3152
|
if (!ref.current || !tooltipRef.current) return;
|
|
3131
3153
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -3164,14 +3186,14 @@ var Tooltip = ({
|
|
|
3164
3186
|
setIsVisible(false);
|
|
3165
3187
|
setRemoveOpacity(false);
|
|
3166
3188
|
};
|
|
3167
|
-
(0,
|
|
3189
|
+
(0, import_react14.useEffect)(() => {
|
|
3168
3190
|
if (isVisible && tooltipRef.current) {
|
|
3169
3191
|
requestAnimationFrame(() => {
|
|
3170
3192
|
updatePosition();
|
|
3171
3193
|
});
|
|
3172
3194
|
}
|
|
3173
3195
|
}, [isVisible]);
|
|
3174
|
-
(0,
|
|
3196
|
+
(0, import_react14.useEffect)(() => {
|
|
3175
3197
|
if (isVisible) {
|
|
3176
3198
|
window.addEventListener("resize", updatePosition);
|
|
3177
3199
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -3229,12 +3251,12 @@ var Tooltip = ({
|
|
|
3229
3251
|
Tooltip.displayName = "Tooltip";
|
|
3230
3252
|
|
|
3231
3253
|
// src/components/DateInput.tsx
|
|
3232
|
-
var
|
|
3254
|
+
var import_react16 = require("react");
|
|
3233
3255
|
var import_react_dom3 = require("react-dom");
|
|
3234
3256
|
|
|
3235
3257
|
// src/components/CalendarRange.tsx
|
|
3236
3258
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
3237
|
-
var
|
|
3259
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
3238
3260
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
3239
3261
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3240
3262
|
function DateCell(_a) {
|
|
@@ -3347,20 +3369,20 @@ function CalendarRange({
|
|
|
3347
3369
|
const fromDate = parseDate(from);
|
|
3348
3370
|
const toDate = parseDate(to);
|
|
3349
3371
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
3350
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
3372
|
+
const [baseMonth, setBaseMonth] = (0, import_react15.useState)(
|
|
3351
3373
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
3352
3374
|
);
|
|
3353
|
-
const [selecting, setSelecting] = (0,
|
|
3354
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
3355
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
3356
|
-
(0,
|
|
3375
|
+
const [selecting, setSelecting] = (0, import_react15.useState)("from");
|
|
3376
|
+
const [pendingFrom, setPendingFrom] = (0, import_react15.useState)(void 0);
|
|
3377
|
+
const [hoveredDate, setHoveredDate] = (0, import_react15.useState)(void 0);
|
|
3378
|
+
(0, import_react15.useEffect)(() => {
|
|
3357
3379
|
if (fromDate) {
|
|
3358
3380
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
3359
3381
|
} else if (toDate) {
|
|
3360
3382
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
3361
3383
|
}
|
|
3362
3384
|
}, [from, to]);
|
|
3363
|
-
(0,
|
|
3385
|
+
(0, import_react15.useEffect)(() => {
|
|
3364
3386
|
if (fromDate && toDate) {
|
|
3365
3387
|
setSelecting("from");
|
|
3366
3388
|
setPendingFrom(void 0);
|
|
@@ -3506,14 +3528,14 @@ function CalendarPane({
|
|
|
3506
3528
|
const years = Array.from({ length: 100 }).map(
|
|
3507
3529
|
(_, i) => baseMonth.year - 50 + i
|
|
3508
3530
|
);
|
|
3509
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
3510
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
3511
|
-
const monthMenuRef = (0,
|
|
3512
|
-
const yearMenuRef = (0,
|
|
3531
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react15.useState)(false);
|
|
3532
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react15.useState)(false);
|
|
3533
|
+
const monthMenuRef = (0, import_react15.useRef)(null);
|
|
3534
|
+
const yearMenuRef = (0, import_react15.useRef)(null);
|
|
3513
3535
|
const month = getMonthData(offset);
|
|
3514
3536
|
const totalCells = 42;
|
|
3515
3537
|
const emptyCells = month.firstDayOffset;
|
|
3516
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react15.default.Fragment, { children: [
|
|
3517
3539
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3518
3540
|
"div",
|
|
3519
3541
|
{
|
|
@@ -3721,24 +3743,24 @@ var DateInput = (_a) => {
|
|
|
3721
3743
|
"label",
|
|
3722
3744
|
"isDateAvailable"
|
|
3723
3745
|
]);
|
|
3724
|
-
const [visible, setVisible] = (0,
|
|
3725
|
-
const [inputValue, setInputValue] = (0,
|
|
3726
|
-
const [isTyping, setIsTyping] = (0,
|
|
3727
|
-
const popoverRef = (0,
|
|
3728
|
-
const triggerRef = (0,
|
|
3729
|
-
const rootRef = (0,
|
|
3730
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
3746
|
+
const [visible, setVisible] = (0, import_react16.useState)(false);
|
|
3747
|
+
const [inputValue, setInputValue] = (0, import_react16.useState)("");
|
|
3748
|
+
const [isTyping, setIsTyping] = (0, import_react16.useState)(false);
|
|
3749
|
+
const popoverRef = (0, import_react16.useRef)(null);
|
|
3750
|
+
const triggerRef = (0, import_react16.useRef)(null);
|
|
3751
|
+
const rootRef = (0, import_react16.useRef)(null);
|
|
3752
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react16.useState)({
|
|
3731
3753
|
top: 0,
|
|
3732
3754
|
left: 0,
|
|
3733
3755
|
width: 0
|
|
3734
3756
|
});
|
|
3735
3757
|
const [from, to] = [value, ""];
|
|
3736
|
-
(0,
|
|
3758
|
+
(0, import_react16.useEffect)(() => {
|
|
3737
3759
|
if (!isTyping) {
|
|
3738
3760
|
setInputValue(formatDisplayValue(from));
|
|
3739
3761
|
}
|
|
3740
3762
|
}, [from, isTyping]);
|
|
3741
|
-
(0,
|
|
3763
|
+
(0, import_react16.useLayoutEffect)(() => {
|
|
3742
3764
|
if (visible) {
|
|
3743
3765
|
updatePosition();
|
|
3744
3766
|
}
|
|
@@ -3753,7 +3775,7 @@ var DateInput = (_a) => {
|
|
|
3753
3775
|
});
|
|
3754
3776
|
}
|
|
3755
3777
|
};
|
|
3756
|
-
(0,
|
|
3778
|
+
(0, import_react16.useEffect)(() => {
|
|
3757
3779
|
updatePosition();
|
|
3758
3780
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
3759
3781
|
if (triggerRef.current) {
|
|
@@ -3765,7 +3787,7 @@ var DateInput = (_a) => {
|
|
|
3765
3787
|
window.removeEventListener("scroll", updatePosition);
|
|
3766
3788
|
};
|
|
3767
3789
|
}, []);
|
|
3768
|
-
(0,
|
|
3790
|
+
(0, import_react16.useEffect)(() => {
|
|
3769
3791
|
const handleKeyDown2 = (event) => {
|
|
3770
3792
|
var _a2;
|
|
3771
3793
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -3778,7 +3800,7 @@ var DateInput = (_a) => {
|
|
|
3778
3800
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
3779
3801
|
};
|
|
3780
3802
|
});
|
|
3781
|
-
(0,
|
|
3803
|
+
(0, import_react16.useEffect)(() => {
|
|
3782
3804
|
const handleClickOutside = (event) => {
|
|
3783
3805
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
3784
3806
|
setVisible(false);
|
|
@@ -3999,14 +4021,14 @@ Heading3.displayName = "Heading3";
|
|
|
3999
4021
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4000
4022
|
|
|
4001
4023
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4002
|
-
var
|
|
4024
|
+
var import_react19 = require("react");
|
|
4003
4025
|
|
|
4004
4026
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
4005
|
-
var
|
|
4027
|
+
var import_react18 = require("react");
|
|
4006
4028
|
|
|
4007
4029
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
4008
|
-
var
|
|
4009
|
-
var GridContext = (0,
|
|
4030
|
+
var import_react17 = require("react");
|
|
4031
|
+
var GridContext = (0, import_react17.createContext)(null);
|
|
4010
4032
|
|
|
4011
4033
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4012
4034
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
@@ -4015,12 +4037,12 @@ var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
|
4015
4037
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4016
4038
|
|
|
4017
4039
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4018
|
-
var
|
|
4040
|
+
var import_react20 = require("react");
|
|
4019
4041
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4020
4042
|
|
|
4021
4043
|
// src/components/Modal.tsx
|
|
4022
4044
|
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
4023
|
-
var
|
|
4045
|
+
var import_react22 = require("react");
|
|
4024
4046
|
|
|
4025
4047
|
// src/components/ModalHeader.tsx
|
|
4026
4048
|
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
@@ -4196,10 +4218,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
4196
4218
|
var import_react_use = require("react-use");
|
|
4197
4219
|
|
|
4198
4220
|
// src/components/useMounted.tsx
|
|
4199
|
-
var
|
|
4221
|
+
var import_react21 = require("react");
|
|
4200
4222
|
var useMounted = () => {
|
|
4201
|
-
const [isMounted, setIsMounted] = (0,
|
|
4202
|
-
(0,
|
|
4223
|
+
const [isMounted, setIsMounted] = (0, import_react21.useState)(false);
|
|
4224
|
+
(0, import_react21.useEffect)(() => {
|
|
4203
4225
|
setIsMounted(true);
|
|
4204
4226
|
return () => setIsMounted(false);
|
|
4205
4227
|
}, []);
|
|
@@ -4293,12 +4315,12 @@ var Modal = ({
|
|
|
4293
4315
|
}) => {
|
|
4294
4316
|
var _a;
|
|
4295
4317
|
const mounted = useMounted();
|
|
4296
|
-
const modalRef = (0,
|
|
4297
|
-
const bgRef = (0,
|
|
4318
|
+
const modalRef = (0, import_react22.useRef)(null);
|
|
4319
|
+
const bgRef = (0, import_react22.useRef)(null);
|
|
4298
4320
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
4299
4321
|
const isMobile = useMatchesMobile();
|
|
4300
4322
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
4301
|
-
(0,
|
|
4323
|
+
(0, import_react22.useEffect)(() => {
|
|
4302
4324
|
if (!mounted) return;
|
|
4303
4325
|
if (!modalRef.current || !bgRef.current) {
|
|
4304
4326
|
console.error("Modal or background reference is not set.");
|
|
@@ -4318,7 +4340,7 @@ var Modal = ({
|
|
|
4318
4340
|
bgFadeIn(bgRef.current);
|
|
4319
4341
|
}
|
|
4320
4342
|
}, [mounted, onClose, open, wasOpen]);
|
|
4321
|
-
const handleKeyDown = (0,
|
|
4343
|
+
const handleKeyDown = (0, import_react22.useCallback)(
|
|
4322
4344
|
(e) => {
|
|
4323
4345
|
if (e.key === "Escape") {
|
|
4324
4346
|
if (onClose) {
|
|
@@ -4329,12 +4351,12 @@ var Modal = ({
|
|
|
4329
4351
|
},
|
|
4330
4352
|
[onClose]
|
|
4331
4353
|
);
|
|
4332
|
-
const handleClose = (0,
|
|
4354
|
+
const handleClose = (0, import_react22.useCallback)(() => {
|
|
4333
4355
|
if (onClose) {
|
|
4334
4356
|
onClose();
|
|
4335
4357
|
}
|
|
4336
4358
|
}, [onClose]);
|
|
4337
|
-
(0,
|
|
4359
|
+
(0, import_react22.useEffect)(() => {
|
|
4338
4360
|
if (open) {
|
|
4339
4361
|
document.addEventListener("keyup", handleKeyDown);
|
|
4340
4362
|
}
|
|
@@ -4342,7 +4364,7 @@ var Modal = ({
|
|
|
4342
4364
|
document.removeEventListener("keyup", handleKeyDown);
|
|
4343
4365
|
};
|
|
4344
4366
|
}, [open, handleKeyDown]);
|
|
4345
|
-
(0,
|
|
4367
|
+
(0, import_react22.useEffect)(() => {
|
|
4346
4368
|
if (!open) return;
|
|
4347
4369
|
const scrollY = window.scrollY;
|
|
4348
4370
|
const body = document.body;
|
|
@@ -4363,7 +4385,7 @@ var Modal = ({
|
|
|
4363
4385
|
};
|
|
4364
4386
|
}, [open]);
|
|
4365
4387
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
4366
|
-
const backgroundClickHandler = (0,
|
|
4388
|
+
const backgroundClickHandler = (0, import_react22.useCallback)(
|
|
4367
4389
|
(e) => {
|
|
4368
4390
|
const target = e.target;
|
|
4369
4391
|
const currentTarget = e.currentTarget;
|
|
@@ -4475,10 +4497,10 @@ var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
|
4475
4497
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4476
4498
|
|
|
4477
4499
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
4478
|
-
var
|
|
4500
|
+
var import_react24 = require("react");
|
|
4479
4501
|
|
|
4480
4502
|
// src/components/ImagePlaceholder.tsx
|
|
4481
|
-
var
|
|
4503
|
+
var import_react23 = require("react");
|
|
4482
4504
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4483
4505
|
|
|
4484
4506
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -4489,11 +4511,11 @@ var import_clsx27 = __toESM(require("clsx"), 1);
|
|
|
4489
4511
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4490
4512
|
|
|
4491
4513
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
4492
|
-
var
|
|
4514
|
+
var import_react25 = require("react");
|
|
4493
4515
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4494
4516
|
|
|
4495
4517
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
4496
|
-
var
|
|
4518
|
+
var import_react26 = require("react");
|
|
4497
4519
|
|
|
4498
4520
|
// src/components/Surface.tsx
|
|
4499
4521
|
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
@@ -4538,17 +4560,17 @@ var import_clsx29 = require("clsx");
|
|
|
4538
4560
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4539
4561
|
|
|
4540
4562
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
4541
|
-
var
|
|
4563
|
+
var import_react27 = require("react");
|
|
4542
4564
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4543
4565
|
|
|
4544
4566
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
4545
|
-
var
|
|
4567
|
+
var import_react28 = require("react");
|
|
4546
4568
|
|
|
4547
4569
|
// src/components/ProductImagePreview/index.tsx
|
|
4548
4570
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4549
4571
|
|
|
4550
4572
|
// src/components/CompactImagesPreview.tsx
|
|
4551
|
-
var
|
|
4573
|
+
var import_react29 = require("react");
|
|
4552
4574
|
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
4553
4575
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4554
4576
|
|
|
@@ -4557,12 +4579,12 @@ var import_clsx31 = __toESM(require("clsx"), 1);
|
|
|
4557
4579
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4558
4580
|
|
|
4559
4581
|
// src/components/ListGroup.tsx
|
|
4560
|
-
var
|
|
4582
|
+
var import_react30 = require("react");
|
|
4561
4583
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
4562
4584
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4563
4585
|
|
|
4564
4586
|
// src/components/Pagination.tsx
|
|
4565
|
-
var
|
|
4587
|
+
var import_react31 = require("react");
|
|
4566
4588
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
4567
4589
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4568
4590
|
var Pagination = ({
|
|
@@ -4574,7 +4596,7 @@ var Pagination = ({
|
|
|
4574
4596
|
className,
|
|
4575
4597
|
disabled
|
|
4576
4598
|
}) => {
|
|
4577
|
-
const goTo = (0,
|
|
4599
|
+
const goTo = (0, import_react31.useCallback)(
|
|
4578
4600
|
(page) => {
|
|
4579
4601
|
if (disabled) return;
|
|
4580
4602
|
onPageChange(page);
|
|
@@ -4591,7 +4613,7 @@ var Pagination = ({
|
|
|
4591
4613
|
goTo(currentPage + 1);
|
|
4592
4614
|
}
|
|
4593
4615
|
};
|
|
4594
|
-
const pageTokens = (0,
|
|
4616
|
+
const pageTokens = (0, import_react31.useMemo)(() => {
|
|
4595
4617
|
if (totalPages <= 5) {
|
|
4596
4618
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
4597
4619
|
}
|
|
@@ -4714,21 +4736,21 @@ var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
|
4714
4736
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4715
4737
|
|
|
4716
4738
|
// src/components/SearchResultImage/index.tsx
|
|
4717
|
-
var
|
|
4739
|
+
var import_react32 = require("react");
|
|
4718
4740
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4719
4741
|
|
|
4720
4742
|
// src/components/Alert.tsx
|
|
4721
4743
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
4722
|
-
var
|
|
4744
|
+
var import_react33 = require("react");
|
|
4723
4745
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4724
4746
|
|
|
4725
4747
|
// src/components/OrderCheckIcon.tsx
|
|
4726
4748
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4727
4749
|
|
|
4728
4750
|
// src/components/EditingContext.tsx
|
|
4729
|
-
var
|
|
4751
|
+
var import_react34 = require("react");
|
|
4730
4752
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4731
|
-
var EditingContext = (0,
|
|
4753
|
+
var EditingContext = (0, import_react34.createContext)(null);
|
|
4732
4754
|
|
|
4733
4755
|
// src/components/AccessCard.tsx
|
|
4734
4756
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
@@ -4862,11 +4884,11 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
4862
4884
|
|
|
4863
4885
|
// src/components/AccessCardGroup.tsx
|
|
4864
4886
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
4865
|
-
var
|
|
4887
|
+
var import_react35 = require("react");
|
|
4866
4888
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4867
4889
|
|
|
4868
4890
|
// src/components/DataGrid/index.tsx
|
|
4869
|
-
var
|
|
4891
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
4870
4892
|
var import_react_table3 = require("@tanstack/react-table");
|
|
4871
4893
|
var import_core = require("@dnd-kit/core");
|
|
4872
4894
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -4894,7 +4916,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
4894
4916
|
}
|
|
4895
4917
|
|
|
4896
4918
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
4897
|
-
var
|
|
4919
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
4898
4920
|
|
|
4899
4921
|
// src/components/DataGrid/TableBody/index.tsx
|
|
4900
4922
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -4903,7 +4925,7 @@ var import_clsx40 = __toESM(require("clsx"), 1);
|
|
|
4903
4925
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
4904
4926
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
4905
4927
|
var import_react_table = require("@tanstack/react-table");
|
|
4906
|
-
var
|
|
4928
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
4907
4929
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4908
4930
|
var valueFormatters = {
|
|
4909
4931
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -4971,7 +4993,7 @@ function TableBodyRow({
|
|
|
4971
4993
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
4972
4994
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
4973
4995
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
4974
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4996
|
+
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react36.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4975
4997
|
CellElement,
|
|
4976
4998
|
{
|
|
4977
4999
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -5185,10 +5207,10 @@ function TableBody({
|
|
|
5185
5207
|
}
|
|
5186
5208
|
|
|
5187
5209
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
5188
|
-
var
|
|
5210
|
+
var import_react38 = require("react");
|
|
5189
5211
|
|
|
5190
5212
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
5191
|
-
var
|
|
5213
|
+
var import_react37 = require("react");
|
|
5192
5214
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5193
5215
|
function ColumnSelectorMenuOption({
|
|
5194
5216
|
id,
|
|
@@ -5196,7 +5218,7 @@ function ColumnSelectorMenuOption({
|
|
|
5196
5218
|
column,
|
|
5197
5219
|
toggleColumnVisibility
|
|
5198
5220
|
}) {
|
|
5199
|
-
const [isVisible, setIsVisible] = (0,
|
|
5221
|
+
const [isVisible, setIsVisible] = (0, import_react37.useState)(column.getIsVisible());
|
|
5200
5222
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
5201
5223
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5202
5224
|
Checkbox,
|
|
@@ -5222,8 +5244,8 @@ function ColumnSelectorHeaderCell({
|
|
|
5222
5244
|
toggleColumnVisibility,
|
|
5223
5245
|
resetColumnVisibility
|
|
5224
5246
|
}) {
|
|
5225
|
-
const ref = (0,
|
|
5226
|
-
const [show, setShow] = (0,
|
|
5247
|
+
const ref = (0, import_react38.useRef)(null);
|
|
5248
|
+
const [show, setShow] = (0, import_react38.useState)(false);
|
|
5227
5249
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
5228
5250
|
DataGridCell,
|
|
5229
5251
|
{
|
|
@@ -5392,7 +5414,7 @@ function PinnedColumns(_a) {
|
|
|
5392
5414
|
header.id
|
|
5393
5415
|
);
|
|
5394
5416
|
}
|
|
5395
|
-
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react39.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5396
5418
|
Checkbox,
|
|
5397
5419
|
{
|
|
5398
5420
|
checked: allSelectedAcrossPages,
|
|
@@ -5471,23 +5493,23 @@ function DataGrid({
|
|
|
5471
5493
|
ref
|
|
5472
5494
|
}) {
|
|
5473
5495
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
5474
|
-
(0,
|
|
5496
|
+
(0, import_react40.useImperativeHandle)(ref, () => ({
|
|
5475
5497
|
getSavedLayout: () => {
|
|
5476
5498
|
return getSavedLayout();
|
|
5477
5499
|
}
|
|
5478
5500
|
}));
|
|
5479
|
-
const [localSorting, setLocalSorting] = (0,
|
|
5480
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
5481
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
5501
|
+
const [localSorting, setLocalSorting] = (0, import_react40.useState)([]);
|
|
5502
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react40.useState)([]);
|
|
5503
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react40.useState)({});
|
|
5482
5504
|
const {
|
|
5483
5505
|
columns: tableColumns,
|
|
5484
5506
|
setColumns: setTableColumns,
|
|
5485
5507
|
getSavedLayout
|
|
5486
5508
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
5487
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
5509
|
+
const [columnOrder, setColumnOrder] = (0, import_react40.useState)(
|
|
5488
5510
|
tableColumns.map((c) => c.id)
|
|
5489
5511
|
);
|
|
5490
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
5512
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react40.useState)(
|
|
5491
5513
|
Object.fromEntries(
|
|
5492
5514
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
5493
5515
|
var _a2, _b2;
|
|
@@ -5495,7 +5517,7 @@ function DataGrid({
|
|
|
5495
5517
|
})
|
|
5496
5518
|
)
|
|
5497
5519
|
);
|
|
5498
|
-
const updateColumnVisibility = (0,
|
|
5520
|
+
const updateColumnVisibility = (0, import_react40.useCallback)(
|
|
5499
5521
|
(updateOrder) => {
|
|
5500
5522
|
setColumnVisibility(
|
|
5501
5523
|
Object.fromEntries(
|
|
@@ -5509,7 +5531,7 @@ function DataGrid({
|
|
|
5509
5531
|
},
|
|
5510
5532
|
[tableColumns]
|
|
5511
5533
|
);
|
|
5512
|
-
const resetDefaultColumnVisibility = (0,
|
|
5534
|
+
const resetDefaultColumnVisibility = (0, import_react40.useCallback)(() => {
|
|
5513
5535
|
setTableColumns((prev) => {
|
|
5514
5536
|
columns.forEach((column) => {
|
|
5515
5537
|
var _a2, _b2;
|
|
@@ -5525,7 +5547,7 @@ function DataGrid({
|
|
|
5525
5547
|
return [...prev];
|
|
5526
5548
|
}, true);
|
|
5527
5549
|
}, [columns, setTableColumns]);
|
|
5528
|
-
(0,
|
|
5550
|
+
(0, import_react40.useEffect)(() => {
|
|
5529
5551
|
updateColumnVisibility(true);
|
|
5530
5552
|
}, [updateColumnVisibility]);
|
|
5531
5553
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -5541,7 +5563,7 @@ function DataGrid({
|
|
|
5541
5563
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
5542
5564
|
} : setLocalColumnFilters;
|
|
5543
5565
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
5544
|
-
const setRowSelection = (0,
|
|
5566
|
+
const setRowSelection = (0, import_react40.useCallback)(
|
|
5545
5567
|
(updaterOrValue) => {
|
|
5546
5568
|
if (pagination) {
|
|
5547
5569
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -5555,9 +5577,9 @@ function DataGrid({
|
|
|
5555
5577
|
},
|
|
5556
5578
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
5557
5579
|
);
|
|
5558
|
-
const dndId = (0,
|
|
5559
|
-
const containerRef =
|
|
5560
|
-
const toggleColumnVisibility = (0,
|
|
5580
|
+
const dndId = (0, import_react40.useId)();
|
|
5581
|
+
const containerRef = import_react40.default.useRef(null);
|
|
5582
|
+
const toggleColumnVisibility = (0, import_react40.useCallback)(
|
|
5561
5583
|
(columnId, isVisible) => {
|
|
5562
5584
|
setTableColumns((prev) => {
|
|
5563
5585
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -5805,7 +5827,7 @@ function DataGrid({
|
|
|
5805
5827
|
header.id
|
|
5806
5828
|
);
|
|
5807
5829
|
}
|
|
5808
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react40.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5809
5831
|
DataGridCell,
|
|
5810
5832
|
{
|
|
5811
5833
|
id: id ? `${id}-header-${header.id}` : void 0,
|