@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
|
@@ -242,7 +242,7 @@ function Icon(_a) {
|
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
// src/components/CalendarRange.tsx
|
|
245
|
-
var
|
|
245
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
246
246
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
247
247
|
|
|
248
248
|
// src/components/DataGridCell.tsx
|
|
@@ -298,11 +298,11 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
298
298
|
|
|
299
299
|
// src/components/DataGridCell.tsx
|
|
300
300
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
301
|
-
var
|
|
301
|
+
var import_react12 = require("react");
|
|
302
302
|
|
|
303
303
|
// src/components/MenuOption.tsx
|
|
304
304
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
305
|
-
var
|
|
305
|
+
var import_react7 = require("react");
|
|
306
306
|
|
|
307
307
|
// src/components/Label.tsx
|
|
308
308
|
var import_clsx3 = __toESM(require("clsx"), 1);
|
|
@@ -601,11 +601,24 @@ function formatDate(date) {
|
|
|
601
601
|
|
|
602
602
|
// src/utils/mergeObjectArrays.ts
|
|
603
603
|
function mergeObjectArrays(arr1, arr2) {
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
604
|
+
const arr2Map = /* @__PURE__ */ new Map();
|
|
605
|
+
for (const item of arr2) {
|
|
606
|
+
const id = item.id;
|
|
607
|
+
if (id !== void 0) {
|
|
608
|
+
arr2Map.set(id, item);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
return arr1.map((item1) => {
|
|
612
|
+
const id = item1.id;
|
|
613
|
+
if (id !== void 0 && arr2Map.has(id)) {
|
|
614
|
+
const item2 = arr2Map.get(id);
|
|
615
|
+
const meta1 = item1.meta;
|
|
616
|
+
const meta2 = item2.meta;
|
|
617
|
+
const mergedMeta = meta1 && meta2 && typeof meta1 === "object" && typeof meta2 === "object" ? __spreadValues(__spreadValues({}, meta1), meta2) : meta2 != null ? meta2 : meta1;
|
|
618
|
+
return __spreadProps(__spreadValues(__spreadValues({}, item1), item2), { meta: mergedMeta });
|
|
619
|
+
}
|
|
620
|
+
return item1;
|
|
621
|
+
});
|
|
609
622
|
}
|
|
610
623
|
|
|
611
624
|
// src/utils/index.ts
|
|
@@ -641,52 +654,58 @@ var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
|
|
|
641
654
|
function useTableLayout(initialColumns, key, autosync = true) {
|
|
642
655
|
const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
|
|
643
656
|
const [isReady, setIsReady] = (0, import_react5.useState)(false);
|
|
644
|
-
const
|
|
657
|
+
const isReadyRef = (0, import_react5.useRef)(false);
|
|
658
|
+
const keyRef = (0, import_react5.useRef)(key);
|
|
659
|
+
(0, import_react5.useEffect)(() => {
|
|
660
|
+
isReadyRef.current = isReady;
|
|
661
|
+
keyRef.current = key;
|
|
662
|
+
}, [isReady, key]);
|
|
645
663
|
const handleSaveLayout = (0, import_react5.useCallback)(
|
|
646
664
|
(setter, _internal) => {
|
|
647
|
-
if (!
|
|
665
|
+
if (!isReadyRef.current && !_internal || !keyRef.current) return;
|
|
648
666
|
setColumns((prevColumns) => {
|
|
649
667
|
const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
|
|
650
|
-
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
|
|
668
|
+
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal) {
|
|
651
669
|
return prevColumns;
|
|
670
|
+
}
|
|
652
671
|
localStorage.setItem(
|
|
653
|
-
getLocalStorageKeyWithPrefix(`${
|
|
672
|
+
getLocalStorageKeyWithPrefix(`${keyRef.current}-tableLayout`),
|
|
654
673
|
JSON.stringify(newColumns)
|
|
655
674
|
);
|
|
656
675
|
return newColumns;
|
|
657
676
|
});
|
|
658
677
|
},
|
|
659
|
-
[
|
|
678
|
+
[]
|
|
660
679
|
);
|
|
661
680
|
(0, import_react5.useEffect)(() => {
|
|
662
681
|
if (!autosync) return;
|
|
663
|
-
if (!key)
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
`useTableLayout should only be called once per component render cycle.
|
|
667
|
-
${renderCountRef.current} Renders detected.
|
|
668
|
-
Check dependency stability`
|
|
669
|
-
);
|
|
682
|
+
if (!key) {
|
|
683
|
+
setIsReady(true);
|
|
684
|
+
return;
|
|
670
685
|
}
|
|
671
|
-
renderCountRef.current += 1;
|
|
672
686
|
const savedLayout = localStorage.getItem(
|
|
673
687
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
674
688
|
);
|
|
675
689
|
if (savedLayout) {
|
|
676
|
-
|
|
690
|
+
setColumns(
|
|
677
691
|
mergeObjectArrays(
|
|
678
692
|
initialColumns,
|
|
679
693
|
JSON.parse(savedLayout)
|
|
680
|
-
)
|
|
681
|
-
|
|
694
|
+
)
|
|
695
|
+
);
|
|
696
|
+
} else {
|
|
697
|
+
localStorage.setItem(
|
|
698
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
699
|
+
JSON.stringify(initialColumns)
|
|
682
700
|
);
|
|
701
|
+
setColumns((prev) => {
|
|
702
|
+
if (JSON.stringify(initialColumns) === JSON.stringify(prev))
|
|
703
|
+
return prev;
|
|
704
|
+
return initialColumns;
|
|
705
|
+
});
|
|
683
706
|
}
|
|
684
|
-
if (!savedLayout) handleSaveLayout(initialColumns, true);
|
|
685
707
|
setIsReady(true);
|
|
686
|
-
|
|
687
|
-
renderCountRef.current = 0;
|
|
688
|
-
};
|
|
689
|
-
}, [handleSaveLayout, initialColumns, key, autosync]);
|
|
708
|
+
}, [initialColumns, key, autosync]);
|
|
690
709
|
const getSavedLayout = (0, import_react5.useCallback)(() => {
|
|
691
710
|
const savedLayout = localStorage.getItem(
|
|
692
711
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
@@ -698,6 +717,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
698
717
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
699
718
|
}
|
|
700
719
|
|
|
720
|
+
// src/hooks/useEditCell.tsx
|
|
721
|
+
var import_react6 = require("react");
|
|
722
|
+
|
|
701
723
|
// src/components/Caption.tsx
|
|
702
724
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
703
725
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -849,12 +871,12 @@ var MenuOption = ({
|
|
|
849
871
|
onMouseMove,
|
|
850
872
|
small = false
|
|
851
873
|
}) => {
|
|
852
|
-
const uniqueId = (0,
|
|
853
|
-
const internalRef = (0,
|
|
874
|
+
const uniqueId = (0, import_react7.useId)();
|
|
875
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
854
876
|
const actualRef = ref || internalRef;
|
|
855
|
-
const menuId = (0,
|
|
877
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
856
878
|
const isMobile = useMatchesMobile();
|
|
857
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
879
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
858
880
|
const handleMouseEnter = () => {
|
|
859
881
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
860
882
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1014,27 +1036,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1014
1036
|
|
|
1015
1037
|
// src/components/Menu.tsx
|
|
1016
1038
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
1017
|
-
var
|
|
1039
|
+
var import_react9 = require("react");
|
|
1018
1040
|
var import_react_dom = require("react-dom");
|
|
1019
1041
|
|
|
1020
1042
|
// src/components/useMenuSystem.tsx
|
|
1021
|
-
var
|
|
1043
|
+
var import_react8 = require("react");
|
|
1022
1044
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1023
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1045
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1024
1046
|
{}
|
|
1025
1047
|
);
|
|
1026
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1027
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1048
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1049
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1028
1050
|
null
|
|
1029
1051
|
);
|
|
1030
|
-
const menuRootRef = (0,
|
|
1031
|
-
const subMenuRefs = (0,
|
|
1032
|
-
const hoverTimeoutRef = (0,
|
|
1033
|
-
const closeTimeoutRef = (0,
|
|
1034
|
-
const mouseStopTimeoutRef = (0,
|
|
1035
|
-
const isMouseMovingRef = (0,
|
|
1036
|
-
const pendingOpenActionRef = (0,
|
|
1037
|
-
const pendingCloseActionRef = (0,
|
|
1052
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1053
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1054
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1055
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1056
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1057
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1058
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1059
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1038
1060
|
const isMobile = useMatchesMobile();
|
|
1039
1061
|
const toggleMenu = (menuId, level) => {
|
|
1040
1062
|
if (closeTimeoutRef.current) {
|
|
@@ -1074,7 +1096,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1074
1096
|
return newActiveMenus;
|
|
1075
1097
|
});
|
|
1076
1098
|
};
|
|
1077
|
-
const executePendingActions = (0,
|
|
1099
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1078
1100
|
if (pendingCloseActionRef.current) {
|
|
1079
1101
|
pendingCloseActionRef.current();
|
|
1080
1102
|
pendingCloseActionRef.current = null;
|
|
@@ -1163,7 +1185,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1163
1185
|
const isMenuActive = (menuId, level) => {
|
|
1164
1186
|
return activeMenus[level] === menuId;
|
|
1165
1187
|
};
|
|
1166
|
-
(0,
|
|
1188
|
+
(0, import_react8.useEffect)(() => {
|
|
1167
1189
|
const handleClickOutside = (event) => {
|
|
1168
1190
|
var _a;
|
|
1169
1191
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1182,7 +1204,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1182
1204
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1183
1205
|
};
|
|
1184
1206
|
}, [activeMenus]);
|
|
1185
|
-
(0,
|
|
1207
|
+
(0, import_react8.useEffect)(() => {
|
|
1186
1208
|
return () => {
|
|
1187
1209
|
if (hoverTimeoutRef.current) {
|
|
1188
1210
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1260,13 +1282,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1260
1282
|
};
|
|
1261
1283
|
}
|
|
1262
1284
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1263
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1285
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1264
1286
|
top: 0,
|
|
1265
1287
|
left: 0,
|
|
1266
1288
|
minWidth: 0
|
|
1267
1289
|
});
|
|
1268
1290
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1269
|
-
const updatePosition = (0,
|
|
1291
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1270
1292
|
var _a, _b, _c;
|
|
1271
1293
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1272
1294
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1314,7 +1336,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1314
1336
|
minWidth: triggerRect.width
|
|
1315
1337
|
});
|
|
1316
1338
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1317
|
-
(0,
|
|
1339
|
+
(0, import_react8.useEffect)(() => {
|
|
1318
1340
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1319
1341
|
const handleClickOutside = (event) => {
|
|
1320
1342
|
var _a, _b, _c, _d, _e;
|
|
@@ -1340,7 +1362,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1340
1362
|
options == null ? void 0 : options.menuRef,
|
|
1341
1363
|
options == null ? void 0 : options.additionalRefs
|
|
1342
1364
|
]);
|
|
1343
|
-
(0,
|
|
1365
|
+
(0, import_react8.useEffect)(() => {
|
|
1344
1366
|
updatePosition();
|
|
1345
1367
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1346
1368
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1421,9 +1443,9 @@ var Menu = (_a) => {
|
|
|
1421
1443
|
"menuName",
|
|
1422
1444
|
"calculateMinMaxHeight"
|
|
1423
1445
|
]);
|
|
1424
|
-
const internalRef = (0,
|
|
1446
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1425
1447
|
const actualRef = ref || internalRef;
|
|
1426
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1448
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1427
1449
|
const isMobile = useMatchesMobile();
|
|
1428
1450
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1429
1451
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1436,7 +1458,7 @@ var Menu = (_a) => {
|
|
|
1436
1458
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1437
1459
|
}
|
|
1438
1460
|
);
|
|
1439
|
-
(0,
|
|
1461
|
+
(0, import_react9.useEffect)(() => {
|
|
1440
1462
|
if (calculateMinMaxHeight) {
|
|
1441
1463
|
return;
|
|
1442
1464
|
}
|
|
@@ -1460,7 +1482,7 @@ var Menu = (_a) => {
|
|
|
1460
1482
|
cancelAnimationFrame(raf);
|
|
1461
1483
|
};
|
|
1462
1484
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1463
|
-
(0,
|
|
1485
|
+
(0, import_react9.useEffect)(() => {
|
|
1464
1486
|
if (!calculateMinMaxHeight) {
|
|
1465
1487
|
return;
|
|
1466
1488
|
}
|
|
@@ -1471,14 +1493,14 @@ var Menu = (_a) => {
|
|
|
1471
1493
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1472
1494
|
}
|
|
1473
1495
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1474
|
-
(0,
|
|
1496
|
+
(0, import_react9.useEffect)(() => {
|
|
1475
1497
|
if (!show) {
|
|
1476
1498
|
return;
|
|
1477
1499
|
}
|
|
1478
1500
|
initializeMenuFocus();
|
|
1479
1501
|
updatePosition();
|
|
1480
1502
|
}, [show, updatePosition]);
|
|
1481
|
-
(0,
|
|
1503
|
+
(0, import_react9.useEffect)(() => {
|
|
1482
1504
|
if (!show || !setShow) {
|
|
1483
1505
|
return;
|
|
1484
1506
|
}
|
|
@@ -1632,10 +1654,10 @@ var Menu = (_a) => {
|
|
|
1632
1654
|
Menu.displayName = "Menu";
|
|
1633
1655
|
|
|
1634
1656
|
// src/components/Search.tsx
|
|
1635
|
-
var
|
|
1657
|
+
var import_react11 = require("react");
|
|
1636
1658
|
|
|
1637
1659
|
// src/components/Input.tsx
|
|
1638
|
-
var
|
|
1660
|
+
var import_react10 = require("react");
|
|
1639
1661
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1640
1662
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1641
1663
|
var InputBase = (_a) => {
|
|
@@ -1692,9 +1714,9 @@ var InputBase = (_a) => {
|
|
|
1692
1714
|
"data-error": error && !focus || null,
|
|
1693
1715
|
"data-focus": focus || null
|
|
1694
1716
|
};
|
|
1695
|
-
const inputRef = (0,
|
|
1717
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
1696
1718
|
const inputId = id ? `${id}-input` : void 0;
|
|
1697
|
-
(0,
|
|
1719
|
+
(0, import_react10.useEffect)(() => {
|
|
1698
1720
|
var _a2;
|
|
1699
1721
|
const input = inputRef.current;
|
|
1700
1722
|
const focusHandler = () => {
|
|
@@ -1853,15 +1875,15 @@ var Input = (_a) => {
|
|
|
1853
1875
|
"testid",
|
|
1854
1876
|
"rightAdornment"
|
|
1855
1877
|
]);
|
|
1856
|
-
const [internalValue, setInternalValue] = (0,
|
|
1857
|
-
const [displayValue, setDisplayValue] = (0,
|
|
1858
|
-
(0,
|
|
1878
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1879
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1880
|
+
(0, import_react10.useEffect)(() => {
|
|
1859
1881
|
var _a2;
|
|
1860
1882
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
1861
1883
|
setInternalValue(stringValue);
|
|
1862
1884
|
setDisplayValue(stringValue);
|
|
1863
1885
|
}, [propValue]);
|
|
1864
|
-
(0,
|
|
1886
|
+
(0, import_react10.useEffect)(() => {
|
|
1865
1887
|
var _a2;
|
|
1866
1888
|
if (variant !== "currency") {
|
|
1867
1889
|
return;
|
|
@@ -2122,14 +2144,14 @@ var Search = (_a) => {
|
|
|
2122
2144
|
"removeRoundness",
|
|
2123
2145
|
"autocompletePadding"
|
|
2124
2146
|
]);
|
|
2125
|
-
const inputRef = (0,
|
|
2126
|
-
const inputContainerRef = (0,
|
|
2127
|
-
const preventFocusOnInitialRender = (0,
|
|
2128
|
-
const [show, setShow] = (0,
|
|
2129
|
-
const [clearing, setClearing] = (0,
|
|
2130
|
-
const uniqueId = (0,
|
|
2147
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2148
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2149
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2150
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2151
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2152
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2131
2153
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2132
|
-
(0,
|
|
2154
|
+
(0, import_react11.useEffect)(() => {
|
|
2133
2155
|
var _a2;
|
|
2134
2156
|
if (preventFocusOnInitialRender.current) {
|
|
2135
2157
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2213,7 +2235,7 @@ Search.displayName = "Search";
|
|
|
2213
2235
|
|
|
2214
2236
|
// src/components/DataGridCell.tsx
|
|
2215
2237
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2216
|
-
var DataGridCell = (0,
|
|
2238
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2217
2239
|
(_a) => {
|
|
2218
2240
|
var _b = _a, {
|
|
2219
2241
|
id,
|
|
@@ -2255,10 +2277,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2255
2277
|
"testid"
|
|
2256
2278
|
]);
|
|
2257
2279
|
const Element = type === "header" ? "th" : "td";
|
|
2258
|
-
const timerRef = (0,
|
|
2259
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2260
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2261
|
-
(0,
|
|
2280
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2281
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2282
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2283
|
+
(0, import_react12.useEffect)(() => {
|
|
2262
2284
|
return () => {
|
|
2263
2285
|
if (timerRef.current) {
|
|
2264
2286
|
clearTimeout(timerRef.current);
|
|
@@ -2368,12 +2390,12 @@ function DataCellHeader(_a) {
|
|
|
2368
2390
|
"useMenuDefaultMinWidth"
|
|
2369
2391
|
]);
|
|
2370
2392
|
var _a2;
|
|
2371
|
-
const [showMenu, setShowMenu] = (0,
|
|
2372
|
-
const [filter, setFilter] = (0,
|
|
2393
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2394
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2373
2395
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2374
2396
|
);
|
|
2375
|
-
const ref = (0,
|
|
2376
|
-
const predeterminedPinned = (0,
|
|
2397
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2398
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2377
2399
|
const { column, getContext } = header;
|
|
2378
2400
|
const { id: columnId, setFilterValue } = column;
|
|
2379
2401
|
const {
|
|
@@ -2383,14 +2405,14 @@ function DataCellHeader(_a) {
|
|
|
2383
2405
|
listeners: subMenuListeners,
|
|
2384
2406
|
mobileHide
|
|
2385
2407
|
} = useSubMenuSystem(node ? node : ref);
|
|
2386
|
-
(0,
|
|
2408
|
+
(0, import_react12.useEffect)(() => {
|
|
2387
2409
|
var _a3, _b2, _c;
|
|
2388
2410
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2389
2411
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2390
2412
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2391
2413
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2392
2414
|
}, [columnId, getContext]);
|
|
2393
|
-
(0,
|
|
2415
|
+
(0, import_react12.useEffect)(() => {
|
|
2394
2416
|
const handler = setTimeout(() => {
|
|
2395
2417
|
setFilterValue(filter);
|
|
2396
2418
|
}, 500);
|
|
@@ -2653,7 +2675,7 @@ function DragAlongCell(_a) {
|
|
|
2653
2675
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2654
2676
|
|
|
2655
2677
|
// src/components/DataGrid/index.tsx
|
|
2656
|
-
var
|
|
2678
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
2657
2679
|
var import_react_table3 = require("@tanstack/react-table");
|
|
2658
2680
|
var import_core = require("@dnd-kit/core");
|
|
2659
2681
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -2681,7 +2703,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
2681
2703
|
}
|
|
2682
2704
|
|
|
2683
2705
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
2684
|
-
var
|
|
2706
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2685
2707
|
|
|
2686
2708
|
// src/components/DataGrid/TableBody/index.tsx
|
|
2687
2709
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -2690,7 +2712,7 @@ var import_clsx12 = __toESM(require("clsx"), 1);
|
|
|
2690
2712
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
2691
2713
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2692
2714
|
var import_react_table = require("@tanstack/react-table");
|
|
2693
|
-
var
|
|
2715
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2694
2716
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2695
2717
|
var valueFormatters = {
|
|
2696
2718
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -2758,7 +2780,7 @@ function TableBodyRow({
|
|
|
2758
2780
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
2759
2781
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
2760
2782
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
2761
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2783
|
+
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react13.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2762
2784
|
CellElement,
|
|
2763
2785
|
{
|
|
2764
2786
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -2972,10 +2994,10 @@ function TableBody({
|
|
|
2972
2994
|
}
|
|
2973
2995
|
|
|
2974
2996
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
2975
|
-
var
|
|
2997
|
+
var import_react15 = require("react");
|
|
2976
2998
|
|
|
2977
2999
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
2978
|
-
var
|
|
3000
|
+
var import_react14 = require("react");
|
|
2979
3001
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2980
3002
|
function ColumnSelectorMenuOption({
|
|
2981
3003
|
id,
|
|
@@ -2983,7 +3005,7 @@ function ColumnSelectorMenuOption({
|
|
|
2983
3005
|
column,
|
|
2984
3006
|
toggleColumnVisibility
|
|
2985
3007
|
}) {
|
|
2986
|
-
const [isVisible, setIsVisible] = (0,
|
|
3008
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(column.getIsVisible());
|
|
2987
3009
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
2988
3010
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2989
3011
|
Checkbox,
|
|
@@ -3009,8 +3031,8 @@ function ColumnSelectorHeaderCell({
|
|
|
3009
3031
|
toggleColumnVisibility,
|
|
3010
3032
|
resetColumnVisibility
|
|
3011
3033
|
}) {
|
|
3012
|
-
const ref = (0,
|
|
3013
|
-
const [show, setShow] = (0,
|
|
3034
|
+
const ref = (0, import_react15.useRef)(null);
|
|
3035
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
|
3014
3036
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3015
3037
|
DataGridCell,
|
|
3016
3038
|
{
|
|
@@ -3179,7 +3201,7 @@ function PinnedColumns(_a) {
|
|
|
3179
3201
|
header.id
|
|
3180
3202
|
);
|
|
3181
3203
|
}
|
|
3182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react16.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3183
3205
|
Checkbox,
|
|
3184
3206
|
{
|
|
3185
3207
|
checked: allSelectedAcrossPages,
|
|
@@ -3261,23 +3283,23 @@ function DataGrid({
|
|
|
3261
3283
|
ref
|
|
3262
3284
|
}) {
|
|
3263
3285
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3264
|
-
(0,
|
|
3286
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
3265
3287
|
getSavedLayout: () => {
|
|
3266
3288
|
return getSavedLayout();
|
|
3267
3289
|
}
|
|
3268
3290
|
}));
|
|
3269
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3270
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3271
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3291
|
+
const [localSorting, setLocalSorting] = (0, import_react17.useState)([]);
|
|
3292
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react17.useState)([]);
|
|
3293
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react17.useState)({});
|
|
3272
3294
|
const {
|
|
3273
3295
|
columns: tableColumns,
|
|
3274
3296
|
setColumns: setTableColumns,
|
|
3275
3297
|
getSavedLayout
|
|
3276
3298
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3277
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3299
|
+
const [columnOrder, setColumnOrder] = (0, import_react17.useState)(
|
|
3278
3300
|
tableColumns.map((c) => c.id)
|
|
3279
3301
|
);
|
|
3280
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3302
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react17.useState)(
|
|
3281
3303
|
Object.fromEntries(
|
|
3282
3304
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3283
3305
|
var _a2, _b2;
|
|
@@ -3285,7 +3307,7 @@ function DataGrid({
|
|
|
3285
3307
|
})
|
|
3286
3308
|
)
|
|
3287
3309
|
);
|
|
3288
|
-
const updateColumnVisibility = (0,
|
|
3310
|
+
const updateColumnVisibility = (0, import_react17.useCallback)(
|
|
3289
3311
|
(updateOrder) => {
|
|
3290
3312
|
setColumnVisibility(
|
|
3291
3313
|
Object.fromEntries(
|
|
@@ -3299,7 +3321,7 @@ function DataGrid({
|
|
|
3299
3321
|
},
|
|
3300
3322
|
[tableColumns]
|
|
3301
3323
|
);
|
|
3302
|
-
const resetDefaultColumnVisibility = (0,
|
|
3324
|
+
const resetDefaultColumnVisibility = (0, import_react17.useCallback)(() => {
|
|
3303
3325
|
setTableColumns((prev) => {
|
|
3304
3326
|
columns.forEach((column) => {
|
|
3305
3327
|
var _a2, _b2;
|
|
@@ -3315,7 +3337,7 @@ function DataGrid({
|
|
|
3315
3337
|
return [...prev];
|
|
3316
3338
|
}, true);
|
|
3317
3339
|
}, [columns, setTableColumns]);
|
|
3318
|
-
(0,
|
|
3340
|
+
(0, import_react17.useEffect)(() => {
|
|
3319
3341
|
updateColumnVisibility(true);
|
|
3320
3342
|
}, [updateColumnVisibility]);
|
|
3321
3343
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3331,7 +3353,7 @@ function DataGrid({
|
|
|
3331
3353
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3332
3354
|
} : setLocalColumnFilters;
|
|
3333
3355
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3334
|
-
const setRowSelection = (0,
|
|
3356
|
+
const setRowSelection = (0, import_react17.useCallback)(
|
|
3335
3357
|
(updaterOrValue) => {
|
|
3336
3358
|
if (pagination) {
|
|
3337
3359
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3345,9 +3367,9 @@ function DataGrid({
|
|
|
3345
3367
|
},
|
|
3346
3368
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3347
3369
|
);
|
|
3348
|
-
const dndId = (0,
|
|
3349
|
-
const containerRef =
|
|
3350
|
-
const toggleColumnVisibility = (0,
|
|
3370
|
+
const dndId = (0, import_react17.useId)();
|
|
3371
|
+
const containerRef = import_react17.default.useRef(null);
|
|
3372
|
+
const toggleColumnVisibility = (0, import_react17.useCallback)(
|
|
3351
3373
|
(columnId, isVisible) => {
|
|
3352
3374
|
setTableColumns((prev) => {
|
|
3353
3375
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3595,7 +3617,7 @@ function DataGrid({
|
|
|
3595
3617
|
header.id
|
|
3596
3618
|
);
|
|
3597
3619
|
}
|
|
3598
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react17.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3599
3621
|
DataGridCell,
|
|
3600
3622
|
{
|
|
3601
3623
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3801,7 +3823,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3801
3823
|
}
|
|
3802
3824
|
|
|
3803
3825
|
// src/components/Select.tsx
|
|
3804
|
-
var
|
|
3826
|
+
var import_react18 = require("react");
|
|
3805
3827
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
3806
3828
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3807
3829
|
var Select = (_a) => {
|
|
@@ -3835,11 +3857,11 @@ var Select = (_a) => {
|
|
|
3835
3857
|
"value"
|
|
3836
3858
|
]);
|
|
3837
3859
|
var _a2;
|
|
3838
|
-
const inputRef = (0,
|
|
3839
|
-
const inputContainerRef = (0,
|
|
3840
|
-
const preventFocusOnInitialRender = (0,
|
|
3841
|
-
const [show, setShow] = (0,
|
|
3842
|
-
(0,
|
|
3860
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
3861
|
+
const inputContainerRef = (0, import_react18.useRef)(null);
|
|
3862
|
+
const preventFocusOnInitialRender = (0, import_react18.useRef)(true);
|
|
3863
|
+
const [show, setShow] = (0, import_react18.useState)(false);
|
|
3864
|
+
(0, import_react18.useEffect)(() => {
|
|
3843
3865
|
var _a3;
|
|
3844
3866
|
if (preventFocusOnInitialRender.current) {
|
|
3845
3867
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4261,7 +4283,7 @@ Button.displayName = "Button";
|
|
|
4261
4283
|
|
|
4262
4284
|
// src/components/Tooltip.tsx
|
|
4263
4285
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4264
|
-
var
|
|
4286
|
+
var import_react19 = require("react");
|
|
4265
4287
|
var import_react_dom2 = require("react-dom");
|
|
4266
4288
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4267
4289
|
var Tooltip = ({
|
|
@@ -4274,11 +4296,11 @@ var Tooltip = ({
|
|
|
4274
4296
|
offset = 8,
|
|
4275
4297
|
keepHidden = false
|
|
4276
4298
|
}) => {
|
|
4277
|
-
const ref = (0,
|
|
4278
|
-
const tooltipRef = (0,
|
|
4279
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4280
|
-
const [isVisible, setIsVisible] = (0,
|
|
4281
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4299
|
+
const ref = (0, import_react19.useRef)(null);
|
|
4300
|
+
const tooltipRef = (0, import_react19.useRef)(null);
|
|
4301
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react19.useState)({ top: 0, left: 0 });
|
|
4302
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
4303
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react19.useState)(false);
|
|
4282
4304
|
const updatePosition = () => {
|
|
4283
4305
|
if (!ref.current || !tooltipRef.current) return;
|
|
4284
4306
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4317,14 +4339,14 @@ var Tooltip = ({
|
|
|
4317
4339
|
setIsVisible(false);
|
|
4318
4340
|
setRemoveOpacity(false);
|
|
4319
4341
|
};
|
|
4320
|
-
(0,
|
|
4342
|
+
(0, import_react19.useEffect)(() => {
|
|
4321
4343
|
if (isVisible && tooltipRef.current) {
|
|
4322
4344
|
requestAnimationFrame(() => {
|
|
4323
4345
|
updatePosition();
|
|
4324
4346
|
});
|
|
4325
4347
|
}
|
|
4326
4348
|
}, [isVisible]);
|
|
4327
|
-
(0,
|
|
4349
|
+
(0, import_react19.useEffect)(() => {
|
|
4328
4350
|
if (isVisible) {
|
|
4329
4351
|
window.addEventListener("resize", updatePosition);
|
|
4330
4352
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4382,7 +4404,7 @@ var Tooltip = ({
|
|
|
4382
4404
|
Tooltip.displayName = "Tooltip";
|
|
4383
4405
|
|
|
4384
4406
|
// src/components/DateInput.tsx
|
|
4385
|
-
var
|
|
4407
|
+
var import_react20 = require("react");
|
|
4386
4408
|
var import_react_dom3 = require("react-dom");
|
|
4387
4409
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4388
4410
|
var DateInput = (_a) => {
|
|
@@ -4407,24 +4429,24 @@ var DateInput = (_a) => {
|
|
|
4407
4429
|
"label",
|
|
4408
4430
|
"isDateAvailable"
|
|
4409
4431
|
]);
|
|
4410
|
-
const [visible, setVisible] = (0,
|
|
4411
|
-
const [inputValue, setInputValue] = (0,
|
|
4412
|
-
const [isTyping, setIsTyping] = (0,
|
|
4413
|
-
const popoverRef = (0,
|
|
4414
|
-
const triggerRef = (0,
|
|
4415
|
-
const rootRef = (0,
|
|
4416
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4432
|
+
const [visible, setVisible] = (0, import_react20.useState)(false);
|
|
4433
|
+
const [inputValue, setInputValue] = (0, import_react20.useState)("");
|
|
4434
|
+
const [isTyping, setIsTyping] = (0, import_react20.useState)(false);
|
|
4435
|
+
const popoverRef = (0, import_react20.useRef)(null);
|
|
4436
|
+
const triggerRef = (0, import_react20.useRef)(null);
|
|
4437
|
+
const rootRef = (0, import_react20.useRef)(null);
|
|
4438
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react20.useState)({
|
|
4417
4439
|
top: 0,
|
|
4418
4440
|
left: 0,
|
|
4419
4441
|
width: 0
|
|
4420
4442
|
});
|
|
4421
4443
|
const [from, to] = [value, ""];
|
|
4422
|
-
(0,
|
|
4444
|
+
(0, import_react20.useEffect)(() => {
|
|
4423
4445
|
if (!isTyping) {
|
|
4424
4446
|
setInputValue(formatDisplayValue(from));
|
|
4425
4447
|
}
|
|
4426
4448
|
}, [from, isTyping]);
|
|
4427
|
-
(0,
|
|
4449
|
+
(0, import_react20.useLayoutEffect)(() => {
|
|
4428
4450
|
if (visible) {
|
|
4429
4451
|
updatePosition();
|
|
4430
4452
|
}
|
|
@@ -4439,7 +4461,7 @@ var DateInput = (_a) => {
|
|
|
4439
4461
|
});
|
|
4440
4462
|
}
|
|
4441
4463
|
};
|
|
4442
|
-
(0,
|
|
4464
|
+
(0, import_react20.useEffect)(() => {
|
|
4443
4465
|
updatePosition();
|
|
4444
4466
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4445
4467
|
if (triggerRef.current) {
|
|
@@ -4451,7 +4473,7 @@ var DateInput = (_a) => {
|
|
|
4451
4473
|
window.removeEventListener("scroll", updatePosition);
|
|
4452
4474
|
};
|
|
4453
4475
|
}, []);
|
|
4454
|
-
(0,
|
|
4476
|
+
(0, import_react20.useEffect)(() => {
|
|
4455
4477
|
const handleKeyDown2 = (event) => {
|
|
4456
4478
|
var _a2;
|
|
4457
4479
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4464,7 +4486,7 @@ var DateInput = (_a) => {
|
|
|
4464
4486
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4465
4487
|
};
|
|
4466
4488
|
});
|
|
4467
|
-
(0,
|
|
4489
|
+
(0, import_react20.useEffect)(() => {
|
|
4468
4490
|
const handleClickOutside = (event) => {
|
|
4469
4491
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4470
4492
|
setVisible(false);
|
|
@@ -4685,14 +4707,14 @@ Heading3.displayName = "Heading3";
|
|
|
4685
4707
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4686
4708
|
|
|
4687
4709
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4688
|
-
var
|
|
4710
|
+
var import_react23 = require("react");
|
|
4689
4711
|
|
|
4690
4712
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
4691
|
-
var
|
|
4713
|
+
var import_react22 = require("react");
|
|
4692
4714
|
|
|
4693
4715
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
4694
|
-
var
|
|
4695
|
-
var GridContext = (0,
|
|
4716
|
+
var import_react21 = require("react");
|
|
4717
|
+
var GridContext = (0, import_react21.createContext)(null);
|
|
4696
4718
|
|
|
4697
4719
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4698
4720
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -4701,12 +4723,12 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
|
4701
4723
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4702
4724
|
|
|
4703
4725
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4704
|
-
var
|
|
4726
|
+
var import_react24 = require("react");
|
|
4705
4727
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4706
4728
|
|
|
4707
4729
|
// src/components/Modal.tsx
|
|
4708
4730
|
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
4709
|
-
var
|
|
4731
|
+
var import_react26 = require("react");
|
|
4710
4732
|
|
|
4711
4733
|
// src/components/ModalHeader.tsx
|
|
4712
4734
|
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
@@ -4882,10 +4904,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
4882
4904
|
var import_react_use = require("react-use");
|
|
4883
4905
|
|
|
4884
4906
|
// src/components/useMounted.tsx
|
|
4885
|
-
var
|
|
4907
|
+
var import_react25 = require("react");
|
|
4886
4908
|
var useMounted = () => {
|
|
4887
|
-
const [isMounted, setIsMounted] = (0,
|
|
4888
|
-
(0,
|
|
4909
|
+
const [isMounted, setIsMounted] = (0, import_react25.useState)(false);
|
|
4910
|
+
(0, import_react25.useEffect)(() => {
|
|
4889
4911
|
setIsMounted(true);
|
|
4890
4912
|
return () => setIsMounted(false);
|
|
4891
4913
|
}, []);
|
|
@@ -4979,12 +5001,12 @@ var Modal = ({
|
|
|
4979
5001
|
}) => {
|
|
4980
5002
|
var _a;
|
|
4981
5003
|
const mounted = useMounted();
|
|
4982
|
-
const modalRef = (0,
|
|
4983
|
-
const bgRef = (0,
|
|
5004
|
+
const modalRef = (0, import_react26.useRef)(null);
|
|
5005
|
+
const bgRef = (0, import_react26.useRef)(null);
|
|
4984
5006
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
4985
5007
|
const isMobile = useMatchesMobile();
|
|
4986
5008
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
4987
|
-
(0,
|
|
5009
|
+
(0, import_react26.useEffect)(() => {
|
|
4988
5010
|
if (!mounted) return;
|
|
4989
5011
|
if (!modalRef.current || !bgRef.current) {
|
|
4990
5012
|
console.error("Modal or background reference is not set.");
|
|
@@ -5004,7 +5026,7 @@ var Modal = ({
|
|
|
5004
5026
|
bgFadeIn(bgRef.current);
|
|
5005
5027
|
}
|
|
5006
5028
|
}, [mounted, onClose, open, wasOpen]);
|
|
5007
|
-
const handleKeyDown = (0,
|
|
5029
|
+
const handleKeyDown = (0, import_react26.useCallback)(
|
|
5008
5030
|
(e) => {
|
|
5009
5031
|
if (e.key === "Escape") {
|
|
5010
5032
|
if (onClose) {
|
|
@@ -5015,12 +5037,12 @@ var Modal = ({
|
|
|
5015
5037
|
},
|
|
5016
5038
|
[onClose]
|
|
5017
5039
|
);
|
|
5018
|
-
const handleClose = (0,
|
|
5040
|
+
const handleClose = (0, import_react26.useCallback)(() => {
|
|
5019
5041
|
if (onClose) {
|
|
5020
5042
|
onClose();
|
|
5021
5043
|
}
|
|
5022
5044
|
}, [onClose]);
|
|
5023
|
-
(0,
|
|
5045
|
+
(0, import_react26.useEffect)(() => {
|
|
5024
5046
|
if (open) {
|
|
5025
5047
|
document.addEventListener("keyup", handleKeyDown);
|
|
5026
5048
|
}
|
|
@@ -5028,7 +5050,7 @@ var Modal = ({
|
|
|
5028
5050
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5029
5051
|
};
|
|
5030
5052
|
}, [open, handleKeyDown]);
|
|
5031
|
-
(0,
|
|
5053
|
+
(0, import_react26.useEffect)(() => {
|
|
5032
5054
|
if (!open) return;
|
|
5033
5055
|
const scrollY = window.scrollY;
|
|
5034
5056
|
const body = document.body;
|
|
@@ -5049,7 +5071,7 @@ var Modal = ({
|
|
|
5049
5071
|
};
|
|
5050
5072
|
}, [open]);
|
|
5051
5073
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5052
|
-
const backgroundClickHandler = (0,
|
|
5074
|
+
const backgroundClickHandler = (0, import_react26.useCallback)(
|
|
5053
5075
|
(e) => {
|
|
5054
5076
|
const target = e.target;
|
|
5055
5077
|
const currentTarget = e.currentTarget;
|
|
@@ -5158,10 +5180,10 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
|
5158
5180
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5159
5181
|
|
|
5160
5182
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5161
|
-
var
|
|
5183
|
+
var import_react28 = require("react");
|
|
5162
5184
|
|
|
5163
5185
|
// src/components/ImagePlaceholder.tsx
|
|
5164
|
-
var
|
|
5186
|
+
var import_react27 = require("react");
|
|
5165
5187
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5166
5188
|
|
|
5167
5189
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5172,11 +5194,11 @@ var import_clsx31 = __toESM(require("clsx"), 1);
|
|
|
5172
5194
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5173
5195
|
|
|
5174
5196
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5175
|
-
var
|
|
5197
|
+
var import_react29 = require("react");
|
|
5176
5198
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5177
5199
|
|
|
5178
5200
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5179
|
-
var
|
|
5201
|
+
var import_react30 = require("react");
|
|
5180
5202
|
|
|
5181
5203
|
// src/components/Surface.tsx
|
|
5182
5204
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
@@ -5221,17 +5243,17 @@ var import_clsx33 = require("clsx");
|
|
|
5221
5243
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5222
5244
|
|
|
5223
5245
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5224
|
-
var
|
|
5246
|
+
var import_react31 = require("react");
|
|
5225
5247
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5226
5248
|
|
|
5227
5249
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5228
|
-
var
|
|
5250
|
+
var import_react32 = require("react");
|
|
5229
5251
|
|
|
5230
5252
|
// src/components/ProductImagePreview/index.tsx
|
|
5231
5253
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5232
5254
|
|
|
5233
5255
|
// src/components/CompactImagesPreview.tsx
|
|
5234
|
-
var
|
|
5256
|
+
var import_react33 = require("react");
|
|
5235
5257
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
5236
5258
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5237
5259
|
|
|
@@ -5240,12 +5262,12 @@ var import_clsx35 = __toESM(require("clsx"), 1);
|
|
|
5240
5262
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5241
5263
|
|
|
5242
5264
|
// src/components/ListGroup.tsx
|
|
5243
|
-
var
|
|
5265
|
+
var import_react34 = require("react");
|
|
5244
5266
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
5245
5267
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5246
5268
|
|
|
5247
5269
|
// src/components/Pagination.tsx
|
|
5248
|
-
var
|
|
5270
|
+
var import_react35 = require("react");
|
|
5249
5271
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5250
5272
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5251
5273
|
var Pagination = ({
|
|
@@ -5257,7 +5279,7 @@ var Pagination = ({
|
|
|
5257
5279
|
className,
|
|
5258
5280
|
disabled
|
|
5259
5281
|
}) => {
|
|
5260
|
-
const goTo = (0,
|
|
5282
|
+
const goTo = (0, import_react35.useCallback)(
|
|
5261
5283
|
(page) => {
|
|
5262
5284
|
if (disabled) return;
|
|
5263
5285
|
onPageChange(page);
|
|
@@ -5274,7 +5296,7 @@ var Pagination = ({
|
|
|
5274
5296
|
goTo(currentPage + 1);
|
|
5275
5297
|
}
|
|
5276
5298
|
};
|
|
5277
|
-
const pageTokens = (0,
|
|
5299
|
+
const pageTokens = (0, import_react35.useMemo)(() => {
|
|
5278
5300
|
if (totalPages <= 5) {
|
|
5279
5301
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5280
5302
|
}
|
|
@@ -5397,21 +5419,21 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
5397
5419
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5398
5420
|
|
|
5399
5421
|
// src/components/SearchResultImage/index.tsx
|
|
5400
|
-
var
|
|
5422
|
+
var import_react36 = require("react");
|
|
5401
5423
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5402
5424
|
|
|
5403
5425
|
// src/components/Alert.tsx
|
|
5404
5426
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5405
|
-
var
|
|
5427
|
+
var import_react37 = require("react");
|
|
5406
5428
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5407
5429
|
|
|
5408
5430
|
// src/components/OrderCheckIcon.tsx
|
|
5409
5431
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5410
5432
|
|
|
5411
5433
|
// src/components/EditingContext.tsx
|
|
5412
|
-
var
|
|
5434
|
+
var import_react38 = require("react");
|
|
5413
5435
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5414
|
-
var EditingContext = (0,
|
|
5436
|
+
var EditingContext = (0, import_react38.createContext)(null);
|
|
5415
5437
|
|
|
5416
5438
|
// src/components/AccessCard.tsx
|
|
5417
5439
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
@@ -5545,7 +5567,7 @@ var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
|
5545
5567
|
|
|
5546
5568
|
// src/components/AccessCardGroup.tsx
|
|
5547
5569
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
5548
|
-
var
|
|
5570
|
+
var import_react39 = require("react");
|
|
5549
5571
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5550
5572
|
|
|
5551
5573
|
// src/components/CalendarRange.tsx
|
|
@@ -5663,20 +5685,20 @@ function CalendarRange({
|
|
|
5663
5685
|
const fromDate = parseDate(from);
|
|
5664
5686
|
const toDate = parseDate(to);
|
|
5665
5687
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
5666
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
5688
|
+
const [baseMonth, setBaseMonth] = (0, import_react40.useState)(
|
|
5667
5689
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
5668
5690
|
);
|
|
5669
|
-
const [selecting, setSelecting] = (0,
|
|
5670
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
5671
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
5672
|
-
(0,
|
|
5691
|
+
const [selecting, setSelecting] = (0, import_react40.useState)("from");
|
|
5692
|
+
const [pendingFrom, setPendingFrom] = (0, import_react40.useState)(void 0);
|
|
5693
|
+
const [hoveredDate, setHoveredDate] = (0, import_react40.useState)(void 0);
|
|
5694
|
+
(0, import_react40.useEffect)(() => {
|
|
5673
5695
|
if (fromDate) {
|
|
5674
5696
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
5675
5697
|
} else if (toDate) {
|
|
5676
5698
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
5677
5699
|
}
|
|
5678
5700
|
}, [from, to]);
|
|
5679
|
-
(0,
|
|
5701
|
+
(0, import_react40.useEffect)(() => {
|
|
5680
5702
|
if (fromDate && toDate) {
|
|
5681
5703
|
setSelecting("from");
|
|
5682
5704
|
setPendingFrom(void 0);
|
|
@@ -5822,14 +5844,14 @@ function CalendarPane({
|
|
|
5822
5844
|
const years = Array.from({ length: 100 }).map(
|
|
5823
5845
|
(_, i) => baseMonth.year - 50 + i
|
|
5824
5846
|
);
|
|
5825
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
5826
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
5827
|
-
const monthMenuRef = (0,
|
|
5828
|
-
const yearMenuRef = (0,
|
|
5847
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react40.useState)(false);
|
|
5848
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react40.useState)(false);
|
|
5849
|
+
const monthMenuRef = (0, import_react40.useRef)(null);
|
|
5850
|
+
const yearMenuRef = (0, import_react40.useRef)(null);
|
|
5829
5851
|
const month = getMonthData(offset);
|
|
5830
5852
|
const totalCells = 42;
|
|
5831
5853
|
const emptyCells = month.firstDayOffset;
|
|
5832
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
5854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react40.default.Fragment, { children: [
|
|
5833
5855
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
5834
5856
|
"div",
|
|
5835
5857
|
{
|