@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
|
@@ -117,7 +117,7 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
117
117
|
|
|
118
118
|
// src/components/DataGridCell.tsx
|
|
119
119
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
120
|
-
var
|
|
120
|
+
var import_react12 = require("react");
|
|
121
121
|
|
|
122
122
|
// src/classNames.ts
|
|
123
123
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -261,7 +261,7 @@ var gapUsingContainerPadding = (0, import_clsx.default)(
|
|
|
261
261
|
|
|
262
262
|
// src/components/MenuOption.tsx
|
|
263
263
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
264
|
-
var
|
|
264
|
+
var import_react7 = require("react");
|
|
265
265
|
|
|
266
266
|
// src/components/Label.tsx
|
|
267
267
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
@@ -595,11 +595,24 @@ function formatDate(date) {
|
|
|
595
595
|
|
|
596
596
|
// src/utils/mergeObjectArrays.ts
|
|
597
597
|
function mergeObjectArrays(arr1, arr2) {
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
598
|
+
const arr2Map = /* @__PURE__ */ new Map();
|
|
599
|
+
for (const item of arr2) {
|
|
600
|
+
const id = item.id;
|
|
601
|
+
if (id !== void 0) {
|
|
602
|
+
arr2Map.set(id, item);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return arr1.map((item1) => {
|
|
606
|
+
const id = item1.id;
|
|
607
|
+
if (id !== void 0 && arr2Map.has(id)) {
|
|
608
|
+
const item2 = arr2Map.get(id);
|
|
609
|
+
const meta1 = item1.meta;
|
|
610
|
+
const meta2 = item2.meta;
|
|
611
|
+
const mergedMeta = meta1 && meta2 && typeof meta1 === "object" && typeof meta2 === "object" ? __spreadValues(__spreadValues({}, meta1), meta2) : meta2 != null ? meta2 : meta1;
|
|
612
|
+
return __spreadProps(__spreadValues(__spreadValues({}, item1), item2), { meta: mergedMeta });
|
|
613
|
+
}
|
|
614
|
+
return item1;
|
|
615
|
+
});
|
|
603
616
|
}
|
|
604
617
|
|
|
605
618
|
// src/utils/index.ts
|
|
@@ -635,52 +648,58 @@ var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
|
|
|
635
648
|
function useTableLayout(initialColumns, key, autosync = true) {
|
|
636
649
|
const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
|
|
637
650
|
const [isReady, setIsReady] = (0, import_react5.useState)(false);
|
|
638
|
-
const
|
|
651
|
+
const isReadyRef = (0, import_react5.useRef)(false);
|
|
652
|
+
const keyRef = (0, import_react5.useRef)(key);
|
|
653
|
+
(0, import_react5.useEffect)(() => {
|
|
654
|
+
isReadyRef.current = isReady;
|
|
655
|
+
keyRef.current = key;
|
|
656
|
+
}, [isReady, key]);
|
|
639
657
|
const handleSaveLayout = (0, import_react5.useCallback)(
|
|
640
658
|
(setter, _internal) => {
|
|
641
|
-
if (!
|
|
659
|
+
if (!isReadyRef.current && !_internal || !keyRef.current) return;
|
|
642
660
|
setColumns((prevColumns) => {
|
|
643
661
|
const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
|
|
644
|
-
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
|
|
662
|
+
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal) {
|
|
645
663
|
return prevColumns;
|
|
664
|
+
}
|
|
646
665
|
localStorage.setItem(
|
|
647
|
-
getLocalStorageKeyWithPrefix(`${
|
|
666
|
+
getLocalStorageKeyWithPrefix(`${keyRef.current}-tableLayout`),
|
|
648
667
|
JSON.stringify(newColumns)
|
|
649
668
|
);
|
|
650
669
|
return newColumns;
|
|
651
670
|
});
|
|
652
671
|
},
|
|
653
|
-
[
|
|
672
|
+
[]
|
|
654
673
|
);
|
|
655
674
|
(0, import_react5.useEffect)(() => {
|
|
656
675
|
if (!autosync) return;
|
|
657
|
-
if (!key)
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
`useTableLayout should only be called once per component render cycle.
|
|
661
|
-
${renderCountRef.current} Renders detected.
|
|
662
|
-
Check dependency stability`
|
|
663
|
-
);
|
|
676
|
+
if (!key) {
|
|
677
|
+
setIsReady(true);
|
|
678
|
+
return;
|
|
664
679
|
}
|
|
665
|
-
renderCountRef.current += 1;
|
|
666
680
|
const savedLayout = localStorage.getItem(
|
|
667
681
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
668
682
|
);
|
|
669
683
|
if (savedLayout) {
|
|
670
|
-
|
|
684
|
+
setColumns(
|
|
671
685
|
mergeObjectArrays(
|
|
672
686
|
initialColumns,
|
|
673
687
|
JSON.parse(savedLayout)
|
|
674
|
-
)
|
|
675
|
-
|
|
688
|
+
)
|
|
689
|
+
);
|
|
690
|
+
} else {
|
|
691
|
+
localStorage.setItem(
|
|
692
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
693
|
+
JSON.stringify(initialColumns)
|
|
676
694
|
);
|
|
695
|
+
setColumns((prev) => {
|
|
696
|
+
if (JSON.stringify(initialColumns) === JSON.stringify(prev))
|
|
697
|
+
return prev;
|
|
698
|
+
return initialColumns;
|
|
699
|
+
});
|
|
677
700
|
}
|
|
678
|
-
if (!savedLayout) handleSaveLayout(initialColumns, true);
|
|
679
701
|
setIsReady(true);
|
|
680
|
-
|
|
681
|
-
renderCountRef.current = 0;
|
|
682
|
-
};
|
|
683
|
-
}, [handleSaveLayout, initialColumns, key, autosync]);
|
|
702
|
+
}, [initialColumns, key, autosync]);
|
|
684
703
|
const getSavedLayout = (0, import_react5.useCallback)(() => {
|
|
685
704
|
const savedLayout = localStorage.getItem(
|
|
686
705
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
@@ -692,6 +711,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
692
711
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
693
712
|
}
|
|
694
713
|
|
|
714
|
+
// src/hooks/useEditCell.tsx
|
|
715
|
+
var import_react6 = require("react");
|
|
716
|
+
|
|
695
717
|
// src/components/Caption.tsx
|
|
696
718
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
697
719
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -843,12 +865,12 @@ var MenuOption = ({
|
|
|
843
865
|
onMouseMove,
|
|
844
866
|
small = false
|
|
845
867
|
}) => {
|
|
846
|
-
const uniqueId = (0,
|
|
847
|
-
const internalRef = (0,
|
|
868
|
+
const uniqueId = (0, import_react7.useId)();
|
|
869
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
848
870
|
const actualRef = ref || internalRef;
|
|
849
|
-
const menuId = (0,
|
|
871
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
850
872
|
const isMobile = useMatchesMobile();
|
|
851
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
873
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
852
874
|
const handleMouseEnter = () => {
|
|
853
875
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
854
876
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1008,27 +1030,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1008
1030
|
|
|
1009
1031
|
// src/components/Menu.tsx
|
|
1010
1032
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
1011
|
-
var
|
|
1033
|
+
var import_react9 = require("react");
|
|
1012
1034
|
var import_react_dom = require("react-dom");
|
|
1013
1035
|
|
|
1014
1036
|
// src/components/useMenuSystem.tsx
|
|
1015
|
-
var
|
|
1037
|
+
var import_react8 = require("react");
|
|
1016
1038
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1017
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1039
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1018
1040
|
{}
|
|
1019
1041
|
);
|
|
1020
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1021
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1042
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1043
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1022
1044
|
null
|
|
1023
1045
|
);
|
|
1024
|
-
const menuRootRef = (0,
|
|
1025
|
-
const subMenuRefs = (0,
|
|
1026
|
-
const hoverTimeoutRef = (0,
|
|
1027
|
-
const closeTimeoutRef = (0,
|
|
1028
|
-
const mouseStopTimeoutRef = (0,
|
|
1029
|
-
const isMouseMovingRef = (0,
|
|
1030
|
-
const pendingOpenActionRef = (0,
|
|
1031
|
-
const pendingCloseActionRef = (0,
|
|
1046
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1047
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1048
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1049
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1050
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1051
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1052
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1053
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1032
1054
|
const isMobile = useMatchesMobile();
|
|
1033
1055
|
const toggleMenu = (menuId, level) => {
|
|
1034
1056
|
if (closeTimeoutRef.current) {
|
|
@@ -1068,7 +1090,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1068
1090
|
return newActiveMenus;
|
|
1069
1091
|
});
|
|
1070
1092
|
};
|
|
1071
|
-
const executePendingActions = (0,
|
|
1093
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1072
1094
|
if (pendingCloseActionRef.current) {
|
|
1073
1095
|
pendingCloseActionRef.current();
|
|
1074
1096
|
pendingCloseActionRef.current = null;
|
|
@@ -1157,7 +1179,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1157
1179
|
const isMenuActive = (menuId, level) => {
|
|
1158
1180
|
return activeMenus[level] === menuId;
|
|
1159
1181
|
};
|
|
1160
|
-
(0,
|
|
1182
|
+
(0, import_react8.useEffect)(() => {
|
|
1161
1183
|
const handleClickOutside = (event) => {
|
|
1162
1184
|
var _a;
|
|
1163
1185
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1176,7 +1198,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1176
1198
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1177
1199
|
};
|
|
1178
1200
|
}, [activeMenus]);
|
|
1179
|
-
(0,
|
|
1201
|
+
(0, import_react8.useEffect)(() => {
|
|
1180
1202
|
return () => {
|
|
1181
1203
|
if (hoverTimeoutRef.current) {
|
|
1182
1204
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1254,13 +1276,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1254
1276
|
};
|
|
1255
1277
|
}
|
|
1256
1278
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1257
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1279
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1258
1280
|
top: 0,
|
|
1259
1281
|
left: 0,
|
|
1260
1282
|
minWidth: 0
|
|
1261
1283
|
});
|
|
1262
1284
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1263
|
-
const updatePosition = (0,
|
|
1285
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1264
1286
|
var _a, _b, _c;
|
|
1265
1287
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1266
1288
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1308,7 +1330,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1308
1330
|
minWidth: triggerRect.width
|
|
1309
1331
|
});
|
|
1310
1332
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1311
|
-
(0,
|
|
1333
|
+
(0, import_react8.useEffect)(() => {
|
|
1312
1334
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1313
1335
|
const handleClickOutside = (event) => {
|
|
1314
1336
|
var _a, _b, _c, _d, _e;
|
|
@@ -1334,7 +1356,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1334
1356
|
options == null ? void 0 : options.menuRef,
|
|
1335
1357
|
options == null ? void 0 : options.additionalRefs
|
|
1336
1358
|
]);
|
|
1337
|
-
(0,
|
|
1359
|
+
(0, import_react8.useEffect)(() => {
|
|
1338
1360
|
updatePosition();
|
|
1339
1361
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1340
1362
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1415,9 +1437,9 @@ var Menu = (_a) => {
|
|
|
1415
1437
|
"menuName",
|
|
1416
1438
|
"calculateMinMaxHeight"
|
|
1417
1439
|
]);
|
|
1418
|
-
const internalRef = (0,
|
|
1440
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1419
1441
|
const actualRef = ref || internalRef;
|
|
1420
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1442
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1421
1443
|
const isMobile = useMatchesMobile();
|
|
1422
1444
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1423
1445
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1430,7 +1452,7 @@ var Menu = (_a) => {
|
|
|
1430
1452
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1431
1453
|
}
|
|
1432
1454
|
);
|
|
1433
|
-
(0,
|
|
1455
|
+
(0, import_react9.useEffect)(() => {
|
|
1434
1456
|
if (calculateMinMaxHeight) {
|
|
1435
1457
|
return;
|
|
1436
1458
|
}
|
|
@@ -1454,7 +1476,7 @@ var Menu = (_a) => {
|
|
|
1454
1476
|
cancelAnimationFrame(raf);
|
|
1455
1477
|
};
|
|
1456
1478
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1457
|
-
(0,
|
|
1479
|
+
(0, import_react9.useEffect)(() => {
|
|
1458
1480
|
if (!calculateMinMaxHeight) {
|
|
1459
1481
|
return;
|
|
1460
1482
|
}
|
|
@@ -1465,14 +1487,14 @@ var Menu = (_a) => {
|
|
|
1465
1487
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1466
1488
|
}
|
|
1467
1489
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1468
|
-
(0,
|
|
1490
|
+
(0, import_react9.useEffect)(() => {
|
|
1469
1491
|
if (!show) {
|
|
1470
1492
|
return;
|
|
1471
1493
|
}
|
|
1472
1494
|
initializeMenuFocus();
|
|
1473
1495
|
updatePosition();
|
|
1474
1496
|
}, [show, updatePosition]);
|
|
1475
|
-
(0,
|
|
1497
|
+
(0, import_react9.useEffect)(() => {
|
|
1476
1498
|
if (!show || !setShow) {
|
|
1477
1499
|
return;
|
|
1478
1500
|
}
|
|
@@ -1626,10 +1648,10 @@ var Menu = (_a) => {
|
|
|
1626
1648
|
Menu.displayName = "Menu";
|
|
1627
1649
|
|
|
1628
1650
|
// src/components/Search.tsx
|
|
1629
|
-
var
|
|
1651
|
+
var import_react11 = require("react");
|
|
1630
1652
|
|
|
1631
1653
|
// src/components/Input.tsx
|
|
1632
|
-
var
|
|
1654
|
+
var import_react10 = require("react");
|
|
1633
1655
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1634
1656
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1635
1657
|
var InputBase = (_a) => {
|
|
@@ -1686,9 +1708,9 @@ var InputBase = (_a) => {
|
|
|
1686
1708
|
"data-error": error && !focus || null,
|
|
1687
1709
|
"data-focus": focus || null
|
|
1688
1710
|
};
|
|
1689
|
-
const inputRef = (0,
|
|
1711
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
1690
1712
|
const inputId = id ? `${id}-input` : void 0;
|
|
1691
|
-
(0,
|
|
1713
|
+
(0, import_react10.useEffect)(() => {
|
|
1692
1714
|
var _a2;
|
|
1693
1715
|
const input = inputRef.current;
|
|
1694
1716
|
const focusHandler = () => {
|
|
@@ -1847,15 +1869,15 @@ var Input = (_a) => {
|
|
|
1847
1869
|
"testid",
|
|
1848
1870
|
"rightAdornment"
|
|
1849
1871
|
]);
|
|
1850
|
-
const [internalValue, setInternalValue] = (0,
|
|
1851
|
-
const [displayValue, setDisplayValue] = (0,
|
|
1852
|
-
(0,
|
|
1872
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1873
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1874
|
+
(0, import_react10.useEffect)(() => {
|
|
1853
1875
|
var _a2;
|
|
1854
1876
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
1855
1877
|
setInternalValue(stringValue);
|
|
1856
1878
|
setDisplayValue(stringValue);
|
|
1857
1879
|
}, [propValue]);
|
|
1858
|
-
(0,
|
|
1880
|
+
(0, import_react10.useEffect)(() => {
|
|
1859
1881
|
var _a2;
|
|
1860
1882
|
if (variant !== "currency") {
|
|
1861
1883
|
return;
|
|
@@ -2116,14 +2138,14 @@ var Search = (_a) => {
|
|
|
2116
2138
|
"removeRoundness",
|
|
2117
2139
|
"autocompletePadding"
|
|
2118
2140
|
]);
|
|
2119
|
-
const inputRef = (0,
|
|
2120
|
-
const inputContainerRef = (0,
|
|
2121
|
-
const preventFocusOnInitialRender = (0,
|
|
2122
|
-
const [show, setShow] = (0,
|
|
2123
|
-
const [clearing, setClearing] = (0,
|
|
2124
|
-
const uniqueId = (0,
|
|
2141
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2142
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2143
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2144
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2145
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2146
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2125
2147
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2126
|
-
(0,
|
|
2148
|
+
(0, import_react11.useEffect)(() => {
|
|
2127
2149
|
var _a2;
|
|
2128
2150
|
if (preventFocusOnInitialRender.current) {
|
|
2129
2151
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2207,7 +2229,7 @@ Search.displayName = "Search";
|
|
|
2207
2229
|
|
|
2208
2230
|
// src/components/DataGridCell.tsx
|
|
2209
2231
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2210
|
-
var DataGridCell = (0,
|
|
2232
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2211
2233
|
(_a) => {
|
|
2212
2234
|
var _b = _a, {
|
|
2213
2235
|
id,
|
|
@@ -2249,10 +2271,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2249
2271
|
"testid"
|
|
2250
2272
|
]);
|
|
2251
2273
|
const Element = type === "header" ? "th" : "td";
|
|
2252
|
-
const timerRef = (0,
|
|
2253
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2254
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2255
|
-
(0,
|
|
2274
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2275
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2276
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2277
|
+
(0, import_react12.useEffect)(() => {
|
|
2256
2278
|
return () => {
|
|
2257
2279
|
if (timerRef.current) {
|
|
2258
2280
|
clearTimeout(timerRef.current);
|
|
@@ -2362,12 +2384,12 @@ function DataCellHeader(_a) {
|
|
|
2362
2384
|
"useMenuDefaultMinWidth"
|
|
2363
2385
|
]);
|
|
2364
2386
|
var _a2;
|
|
2365
|
-
const [showMenu, setShowMenu] = (0,
|
|
2366
|
-
const [filter, setFilter] = (0,
|
|
2387
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2388
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2367
2389
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2368
2390
|
);
|
|
2369
|
-
const ref = (0,
|
|
2370
|
-
const predeterminedPinned = (0,
|
|
2391
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2392
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2371
2393
|
const { column, getContext } = header;
|
|
2372
2394
|
const { id: columnId, setFilterValue } = column;
|
|
2373
2395
|
const {
|
|
@@ -2377,14 +2399,14 @@ function DataCellHeader(_a) {
|
|
|
2377
2399
|
listeners: subMenuListeners,
|
|
2378
2400
|
mobileHide
|
|
2379
2401
|
} = useSubMenuSystem(node ? node : ref);
|
|
2380
|
-
(0,
|
|
2402
|
+
(0, import_react12.useEffect)(() => {
|
|
2381
2403
|
var _a3, _b2, _c;
|
|
2382
2404
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2383
2405
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2384
2406
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2385
2407
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2386
2408
|
}, [columnId, getContext]);
|
|
2387
|
-
(0,
|
|
2409
|
+
(0, import_react12.useEffect)(() => {
|
|
2388
2410
|
const handler = setTimeout(() => {
|
|
2389
2411
|
setFilterValue(filter);
|
|
2390
2412
|
}, 500);
|
|
@@ -2647,7 +2669,7 @@ function DragAlongCell(_a) {
|
|
|
2647
2669
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2648
2670
|
|
|
2649
2671
|
// src/components/DataGrid/index.tsx
|
|
2650
|
-
var
|
|
2672
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
2651
2673
|
var import_react_table2 = require("@tanstack/react-table");
|
|
2652
2674
|
var import_core = require("@dnd-kit/core");
|
|
2653
2675
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -2677,7 +2699,7 @@ var import_clsx12 = __toESM(require("clsx"), 1);
|
|
|
2677
2699
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
2678
2700
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2679
2701
|
var import_react_table = require("@tanstack/react-table");
|
|
2680
|
-
var
|
|
2702
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2681
2703
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2682
2704
|
var valueFormatters = {
|
|
2683
2705
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -2745,7 +2767,7 @@ function TableBodyRow({
|
|
|
2745
2767
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
2746
2768
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
2747
2769
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
2748
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2770
|
+
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)(
|
|
2749
2771
|
CellElement,
|
|
2750
2772
|
{
|
|
2751
2773
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -2996,23 +3018,23 @@ function DataGrid({
|
|
|
2996
3018
|
ref
|
|
2997
3019
|
}) {
|
|
2998
3020
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
2999
|
-
(0,
|
|
3021
|
+
(0, import_react14.useImperativeHandle)(ref, () => ({
|
|
3000
3022
|
getSavedLayout: () => {
|
|
3001
3023
|
return getSavedLayout();
|
|
3002
3024
|
}
|
|
3003
3025
|
}));
|
|
3004
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3005
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3006
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3026
|
+
const [localSorting, setLocalSorting] = (0, import_react14.useState)([]);
|
|
3027
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react14.useState)([]);
|
|
3028
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react14.useState)({});
|
|
3007
3029
|
const {
|
|
3008
3030
|
columns: tableColumns,
|
|
3009
3031
|
setColumns: setTableColumns,
|
|
3010
3032
|
getSavedLayout
|
|
3011
3033
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3012
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3034
|
+
const [columnOrder, setColumnOrder] = (0, import_react14.useState)(
|
|
3013
3035
|
tableColumns.map((c) => c.id)
|
|
3014
3036
|
);
|
|
3015
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3037
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react14.useState)(
|
|
3016
3038
|
Object.fromEntries(
|
|
3017
3039
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3018
3040
|
var _a2, _b2;
|
|
@@ -3020,7 +3042,7 @@ function DataGrid({
|
|
|
3020
3042
|
})
|
|
3021
3043
|
)
|
|
3022
3044
|
);
|
|
3023
|
-
const updateColumnVisibility = (0,
|
|
3045
|
+
const updateColumnVisibility = (0, import_react14.useCallback)(
|
|
3024
3046
|
(updateOrder) => {
|
|
3025
3047
|
setColumnVisibility(
|
|
3026
3048
|
Object.fromEntries(
|
|
@@ -3034,7 +3056,7 @@ function DataGrid({
|
|
|
3034
3056
|
},
|
|
3035
3057
|
[tableColumns]
|
|
3036
3058
|
);
|
|
3037
|
-
const resetDefaultColumnVisibility = (0,
|
|
3059
|
+
const resetDefaultColumnVisibility = (0, import_react14.useCallback)(() => {
|
|
3038
3060
|
setTableColumns((prev) => {
|
|
3039
3061
|
columns.forEach((column) => {
|
|
3040
3062
|
var _a2, _b2;
|
|
@@ -3050,7 +3072,7 @@ function DataGrid({
|
|
|
3050
3072
|
return [...prev];
|
|
3051
3073
|
}, true);
|
|
3052
3074
|
}, [columns, setTableColumns]);
|
|
3053
|
-
(0,
|
|
3075
|
+
(0, import_react14.useEffect)(() => {
|
|
3054
3076
|
updateColumnVisibility(true);
|
|
3055
3077
|
}, [updateColumnVisibility]);
|
|
3056
3078
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3066,7 +3088,7 @@ function DataGrid({
|
|
|
3066
3088
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3067
3089
|
} : setLocalColumnFilters;
|
|
3068
3090
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3069
|
-
const setRowSelection = (0,
|
|
3091
|
+
const setRowSelection = (0, import_react14.useCallback)(
|
|
3070
3092
|
(updaterOrValue) => {
|
|
3071
3093
|
if (pagination) {
|
|
3072
3094
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3080,9 +3102,9 @@ function DataGrid({
|
|
|
3080
3102
|
},
|
|
3081
3103
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3082
3104
|
);
|
|
3083
|
-
const dndId = (0,
|
|
3084
|
-
const containerRef =
|
|
3085
|
-
const toggleColumnVisibility = (0,
|
|
3105
|
+
const dndId = (0, import_react14.useId)();
|
|
3106
|
+
const containerRef = import_react14.default.useRef(null);
|
|
3107
|
+
const toggleColumnVisibility = (0, import_react14.useCallback)(
|
|
3086
3108
|
(columnId, isVisible) => {
|
|
3087
3109
|
setTableColumns((prev) => {
|
|
3088
3110
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3330,7 +3352,7 @@ function DataGrid({
|
|
|
3330
3352
|
header.id
|
|
3331
3353
|
);
|
|
3332
3354
|
}
|
|
3333
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react14.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3334
3356
|
DataGridCell,
|
|
3335
3357
|
{
|
|
3336
3358
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3536,7 +3558,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3536
3558
|
}
|
|
3537
3559
|
|
|
3538
3560
|
// src/components/Select.tsx
|
|
3539
|
-
var
|
|
3561
|
+
var import_react15 = require("react");
|
|
3540
3562
|
var import_clsx14 = __toESM(require("clsx"), 1);
|
|
3541
3563
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3542
3564
|
var Select = (_a) => {
|
|
@@ -3570,11 +3592,11 @@ var Select = (_a) => {
|
|
|
3570
3592
|
"value"
|
|
3571
3593
|
]);
|
|
3572
3594
|
var _a2;
|
|
3573
|
-
const inputRef = (0,
|
|
3574
|
-
const inputContainerRef = (0,
|
|
3575
|
-
const preventFocusOnInitialRender = (0,
|
|
3576
|
-
const [show, setShow] = (0,
|
|
3577
|
-
(0,
|
|
3595
|
+
const inputRef = (0, import_react15.useRef)(null);
|
|
3596
|
+
const inputContainerRef = (0, import_react15.useRef)(null);
|
|
3597
|
+
const preventFocusOnInitialRender = (0, import_react15.useRef)(true);
|
|
3598
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
|
3599
|
+
(0, import_react15.useEffect)(() => {
|
|
3578
3600
|
var _a3;
|
|
3579
3601
|
if (preventFocusOnInitialRender.current) {
|
|
3580
3602
|
preventFocusOnInitialRender.current = false;
|
|
@@ -3996,7 +4018,7 @@ Button.displayName = "Button";
|
|
|
3996
4018
|
|
|
3997
4019
|
// src/components/Tooltip.tsx
|
|
3998
4020
|
var import_clsx18 = __toESM(require("clsx"), 1);
|
|
3999
|
-
var
|
|
4021
|
+
var import_react16 = require("react");
|
|
4000
4022
|
var import_react_dom2 = require("react-dom");
|
|
4001
4023
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4002
4024
|
var Tooltip = ({
|
|
@@ -4009,11 +4031,11 @@ var Tooltip = ({
|
|
|
4009
4031
|
offset = 8,
|
|
4010
4032
|
keepHidden = false
|
|
4011
4033
|
}) => {
|
|
4012
|
-
const ref = (0,
|
|
4013
|
-
const tooltipRef = (0,
|
|
4014
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4015
|
-
const [isVisible, setIsVisible] = (0,
|
|
4016
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4034
|
+
const ref = (0, import_react16.useRef)(null);
|
|
4035
|
+
const tooltipRef = (0, import_react16.useRef)(null);
|
|
4036
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react16.useState)({ top: 0, left: 0 });
|
|
4037
|
+
const [isVisible, setIsVisible] = (0, import_react16.useState)(false);
|
|
4038
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react16.useState)(false);
|
|
4017
4039
|
const updatePosition = () => {
|
|
4018
4040
|
if (!ref.current || !tooltipRef.current) return;
|
|
4019
4041
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4052,14 +4074,14 @@ var Tooltip = ({
|
|
|
4052
4074
|
setIsVisible(false);
|
|
4053
4075
|
setRemoveOpacity(false);
|
|
4054
4076
|
};
|
|
4055
|
-
(0,
|
|
4077
|
+
(0, import_react16.useEffect)(() => {
|
|
4056
4078
|
if (isVisible && tooltipRef.current) {
|
|
4057
4079
|
requestAnimationFrame(() => {
|
|
4058
4080
|
updatePosition();
|
|
4059
4081
|
});
|
|
4060
4082
|
}
|
|
4061
4083
|
}, [isVisible]);
|
|
4062
|
-
(0,
|
|
4084
|
+
(0, import_react16.useEffect)(() => {
|
|
4063
4085
|
if (isVisible) {
|
|
4064
4086
|
window.addEventListener("resize", updatePosition);
|
|
4065
4087
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4117,12 +4139,12 @@ var Tooltip = ({
|
|
|
4117
4139
|
Tooltip.displayName = "Tooltip";
|
|
4118
4140
|
|
|
4119
4141
|
// src/components/DateInput.tsx
|
|
4120
|
-
var
|
|
4142
|
+
var import_react18 = require("react");
|
|
4121
4143
|
var import_react_dom3 = require("react-dom");
|
|
4122
4144
|
|
|
4123
4145
|
// src/components/CalendarRange.tsx
|
|
4124
4146
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4125
|
-
var
|
|
4147
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
4126
4148
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4127
4149
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4128
4150
|
function DateCell(_a) {
|
|
@@ -4235,20 +4257,20 @@ function CalendarRange({
|
|
|
4235
4257
|
const fromDate = parseDate(from);
|
|
4236
4258
|
const toDate = parseDate(to);
|
|
4237
4259
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4238
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4260
|
+
const [baseMonth, setBaseMonth] = (0, import_react17.useState)(
|
|
4239
4261
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4240
4262
|
);
|
|
4241
|
-
const [selecting, setSelecting] = (0,
|
|
4242
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4243
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4244
|
-
(0,
|
|
4263
|
+
const [selecting, setSelecting] = (0, import_react17.useState)("from");
|
|
4264
|
+
const [pendingFrom, setPendingFrom] = (0, import_react17.useState)(void 0);
|
|
4265
|
+
const [hoveredDate, setHoveredDate] = (0, import_react17.useState)(void 0);
|
|
4266
|
+
(0, import_react17.useEffect)(() => {
|
|
4245
4267
|
if (fromDate) {
|
|
4246
4268
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4247
4269
|
} else if (toDate) {
|
|
4248
4270
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4249
4271
|
}
|
|
4250
4272
|
}, [from, to]);
|
|
4251
|
-
(0,
|
|
4273
|
+
(0, import_react17.useEffect)(() => {
|
|
4252
4274
|
if (fromDate && toDate) {
|
|
4253
4275
|
setSelecting("from");
|
|
4254
4276
|
setPendingFrom(void 0);
|
|
@@ -4394,14 +4416,14 @@ function CalendarPane({
|
|
|
4394
4416
|
const years = Array.from({ length: 100 }).map(
|
|
4395
4417
|
(_, i) => baseMonth.year - 50 + i
|
|
4396
4418
|
);
|
|
4397
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4398
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4399
|
-
const monthMenuRef = (0,
|
|
4400
|
-
const yearMenuRef = (0,
|
|
4419
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react17.useState)(false);
|
|
4420
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react17.useState)(false);
|
|
4421
|
+
const monthMenuRef = (0, import_react17.useRef)(null);
|
|
4422
|
+
const yearMenuRef = (0, import_react17.useRef)(null);
|
|
4401
4423
|
const month = getMonthData(offset);
|
|
4402
4424
|
const totalCells = 42;
|
|
4403
4425
|
const emptyCells = month.firstDayOffset;
|
|
4404
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react17.default.Fragment, { children: [
|
|
4405
4427
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4406
4428
|
"div",
|
|
4407
4429
|
{
|
|
@@ -4609,24 +4631,24 @@ var DateInput = (_a) => {
|
|
|
4609
4631
|
"label",
|
|
4610
4632
|
"isDateAvailable"
|
|
4611
4633
|
]);
|
|
4612
|
-
const [visible, setVisible] = (0,
|
|
4613
|
-
const [inputValue, setInputValue] = (0,
|
|
4614
|
-
const [isTyping, setIsTyping] = (0,
|
|
4615
|
-
const popoverRef = (0,
|
|
4616
|
-
const triggerRef = (0,
|
|
4617
|
-
const rootRef = (0,
|
|
4618
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4634
|
+
const [visible, setVisible] = (0, import_react18.useState)(false);
|
|
4635
|
+
const [inputValue, setInputValue] = (0, import_react18.useState)("");
|
|
4636
|
+
const [isTyping, setIsTyping] = (0, import_react18.useState)(false);
|
|
4637
|
+
const popoverRef = (0, import_react18.useRef)(null);
|
|
4638
|
+
const triggerRef = (0, import_react18.useRef)(null);
|
|
4639
|
+
const rootRef = (0, import_react18.useRef)(null);
|
|
4640
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react18.useState)({
|
|
4619
4641
|
top: 0,
|
|
4620
4642
|
left: 0,
|
|
4621
4643
|
width: 0
|
|
4622
4644
|
});
|
|
4623
4645
|
const [from, to] = [value, ""];
|
|
4624
|
-
(0,
|
|
4646
|
+
(0, import_react18.useEffect)(() => {
|
|
4625
4647
|
if (!isTyping) {
|
|
4626
4648
|
setInputValue(formatDisplayValue(from));
|
|
4627
4649
|
}
|
|
4628
4650
|
}, [from, isTyping]);
|
|
4629
|
-
(0,
|
|
4651
|
+
(0, import_react18.useLayoutEffect)(() => {
|
|
4630
4652
|
if (visible) {
|
|
4631
4653
|
updatePosition();
|
|
4632
4654
|
}
|
|
@@ -4641,7 +4663,7 @@ var DateInput = (_a) => {
|
|
|
4641
4663
|
});
|
|
4642
4664
|
}
|
|
4643
4665
|
};
|
|
4644
|
-
(0,
|
|
4666
|
+
(0, import_react18.useEffect)(() => {
|
|
4645
4667
|
updatePosition();
|
|
4646
4668
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4647
4669
|
if (triggerRef.current) {
|
|
@@ -4653,7 +4675,7 @@ var DateInput = (_a) => {
|
|
|
4653
4675
|
window.removeEventListener("scroll", updatePosition);
|
|
4654
4676
|
};
|
|
4655
4677
|
}, []);
|
|
4656
|
-
(0,
|
|
4678
|
+
(0, import_react18.useEffect)(() => {
|
|
4657
4679
|
const handleKeyDown2 = (event) => {
|
|
4658
4680
|
var _a2;
|
|
4659
4681
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4666,7 +4688,7 @@ var DateInput = (_a) => {
|
|
|
4666
4688
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4667
4689
|
};
|
|
4668
4690
|
});
|
|
4669
|
-
(0,
|
|
4691
|
+
(0, import_react18.useEffect)(() => {
|
|
4670
4692
|
const handleClickOutside = (event) => {
|
|
4671
4693
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4672
4694
|
setVisible(false);
|
|
@@ -4887,14 +4909,14 @@ Heading3.displayName = "Heading3";
|
|
|
4887
4909
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4888
4910
|
|
|
4889
4911
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4890
|
-
var
|
|
4912
|
+
var import_react21 = require("react");
|
|
4891
4913
|
|
|
4892
4914
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
4893
|
-
var
|
|
4915
|
+
var import_react20 = require("react");
|
|
4894
4916
|
|
|
4895
4917
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
4896
|
-
var
|
|
4897
|
-
var GridContext = (0,
|
|
4918
|
+
var import_react19 = require("react");
|
|
4919
|
+
var GridContext = (0, import_react19.createContext)(null);
|
|
4898
4920
|
|
|
4899
4921
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4900
4922
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
@@ -4903,12 +4925,12 @@ var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
|
4903
4925
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4904
4926
|
|
|
4905
4927
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4906
|
-
var
|
|
4928
|
+
var import_react22 = require("react");
|
|
4907
4929
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4908
4930
|
|
|
4909
4931
|
// src/components/Modal.tsx
|
|
4910
4932
|
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
4911
|
-
var
|
|
4933
|
+
var import_react24 = require("react");
|
|
4912
4934
|
|
|
4913
4935
|
// src/components/ModalHeader.tsx
|
|
4914
4936
|
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
@@ -5084,10 +5106,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
5084
5106
|
var import_react_use = require("react-use");
|
|
5085
5107
|
|
|
5086
5108
|
// src/components/useMounted.tsx
|
|
5087
|
-
var
|
|
5109
|
+
var import_react23 = require("react");
|
|
5088
5110
|
var useMounted = () => {
|
|
5089
|
-
const [isMounted, setIsMounted] = (0,
|
|
5090
|
-
(0,
|
|
5111
|
+
const [isMounted, setIsMounted] = (0, import_react23.useState)(false);
|
|
5112
|
+
(0, import_react23.useEffect)(() => {
|
|
5091
5113
|
setIsMounted(true);
|
|
5092
5114
|
return () => setIsMounted(false);
|
|
5093
5115
|
}, []);
|
|
@@ -5181,12 +5203,12 @@ var Modal = ({
|
|
|
5181
5203
|
}) => {
|
|
5182
5204
|
var _a;
|
|
5183
5205
|
const mounted = useMounted();
|
|
5184
|
-
const modalRef = (0,
|
|
5185
|
-
const bgRef = (0,
|
|
5206
|
+
const modalRef = (0, import_react24.useRef)(null);
|
|
5207
|
+
const bgRef = (0, import_react24.useRef)(null);
|
|
5186
5208
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5187
5209
|
const isMobile = useMatchesMobile();
|
|
5188
5210
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5189
|
-
(0,
|
|
5211
|
+
(0, import_react24.useEffect)(() => {
|
|
5190
5212
|
if (!mounted) return;
|
|
5191
5213
|
if (!modalRef.current || !bgRef.current) {
|
|
5192
5214
|
console.error("Modal or background reference is not set.");
|
|
@@ -5206,7 +5228,7 @@ var Modal = ({
|
|
|
5206
5228
|
bgFadeIn(bgRef.current);
|
|
5207
5229
|
}
|
|
5208
5230
|
}, [mounted, onClose, open, wasOpen]);
|
|
5209
|
-
const handleKeyDown = (0,
|
|
5231
|
+
const handleKeyDown = (0, import_react24.useCallback)(
|
|
5210
5232
|
(e) => {
|
|
5211
5233
|
if (e.key === "Escape") {
|
|
5212
5234
|
if (onClose) {
|
|
@@ -5217,12 +5239,12 @@ var Modal = ({
|
|
|
5217
5239
|
},
|
|
5218
5240
|
[onClose]
|
|
5219
5241
|
);
|
|
5220
|
-
const handleClose = (0,
|
|
5242
|
+
const handleClose = (0, import_react24.useCallback)(() => {
|
|
5221
5243
|
if (onClose) {
|
|
5222
5244
|
onClose();
|
|
5223
5245
|
}
|
|
5224
5246
|
}, [onClose]);
|
|
5225
|
-
(0,
|
|
5247
|
+
(0, import_react24.useEffect)(() => {
|
|
5226
5248
|
if (open) {
|
|
5227
5249
|
document.addEventListener("keyup", handleKeyDown);
|
|
5228
5250
|
}
|
|
@@ -5230,7 +5252,7 @@ var Modal = ({
|
|
|
5230
5252
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5231
5253
|
};
|
|
5232
5254
|
}, [open, handleKeyDown]);
|
|
5233
|
-
(0,
|
|
5255
|
+
(0, import_react24.useEffect)(() => {
|
|
5234
5256
|
if (!open) return;
|
|
5235
5257
|
const scrollY = window.scrollY;
|
|
5236
5258
|
const body = document.body;
|
|
@@ -5251,7 +5273,7 @@ var Modal = ({
|
|
|
5251
5273
|
};
|
|
5252
5274
|
}, [open]);
|
|
5253
5275
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5254
|
-
const backgroundClickHandler = (0,
|
|
5276
|
+
const backgroundClickHandler = (0, import_react24.useCallback)(
|
|
5255
5277
|
(e) => {
|
|
5256
5278
|
const target = e.target;
|
|
5257
5279
|
const currentTarget = e.currentTarget;
|
|
@@ -5360,10 +5382,10 @@ var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
|
5360
5382
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
5361
5383
|
|
|
5362
5384
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5363
|
-
var
|
|
5385
|
+
var import_react26 = require("react");
|
|
5364
5386
|
|
|
5365
5387
|
// src/components/ImagePlaceholder.tsx
|
|
5366
|
-
var
|
|
5388
|
+
var import_react25 = require("react");
|
|
5367
5389
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5368
5390
|
|
|
5369
5391
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5374,11 +5396,11 @@ var import_clsx31 = __toESM(require("clsx"), 1);
|
|
|
5374
5396
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5375
5397
|
|
|
5376
5398
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5377
|
-
var
|
|
5399
|
+
var import_react27 = require("react");
|
|
5378
5400
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5379
5401
|
|
|
5380
5402
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5381
|
-
var
|
|
5403
|
+
var import_react28 = require("react");
|
|
5382
5404
|
|
|
5383
5405
|
// src/components/Surface.tsx
|
|
5384
5406
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
@@ -5423,17 +5445,17 @@ var import_clsx33 = require("clsx");
|
|
|
5423
5445
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5424
5446
|
|
|
5425
5447
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5426
|
-
var
|
|
5448
|
+
var import_react29 = require("react");
|
|
5427
5449
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5428
5450
|
|
|
5429
5451
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5430
|
-
var
|
|
5452
|
+
var import_react30 = require("react");
|
|
5431
5453
|
|
|
5432
5454
|
// src/components/ProductImagePreview/index.tsx
|
|
5433
5455
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5434
5456
|
|
|
5435
5457
|
// src/components/CompactImagesPreview.tsx
|
|
5436
|
-
var
|
|
5458
|
+
var import_react31 = require("react");
|
|
5437
5459
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
5438
5460
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5439
5461
|
|
|
@@ -5442,12 +5464,12 @@ var import_clsx35 = __toESM(require("clsx"), 1);
|
|
|
5442
5464
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5443
5465
|
|
|
5444
5466
|
// src/components/ListGroup.tsx
|
|
5445
|
-
var
|
|
5467
|
+
var import_react32 = require("react");
|
|
5446
5468
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
5447
5469
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5448
5470
|
|
|
5449
5471
|
// src/components/Pagination.tsx
|
|
5450
|
-
var
|
|
5472
|
+
var import_react33 = require("react");
|
|
5451
5473
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5452
5474
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5453
5475
|
var Pagination = ({
|
|
@@ -5459,7 +5481,7 @@ var Pagination = ({
|
|
|
5459
5481
|
className,
|
|
5460
5482
|
disabled
|
|
5461
5483
|
}) => {
|
|
5462
|
-
const goTo = (0,
|
|
5484
|
+
const goTo = (0, import_react33.useCallback)(
|
|
5463
5485
|
(page) => {
|
|
5464
5486
|
if (disabled) return;
|
|
5465
5487
|
onPageChange(page);
|
|
@@ -5476,7 +5498,7 @@ var Pagination = ({
|
|
|
5476
5498
|
goTo(currentPage + 1);
|
|
5477
5499
|
}
|
|
5478
5500
|
};
|
|
5479
|
-
const pageTokens = (0,
|
|
5501
|
+
const pageTokens = (0, import_react33.useMemo)(() => {
|
|
5480
5502
|
if (totalPages <= 5) {
|
|
5481
5503
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5482
5504
|
}
|
|
@@ -5599,21 +5621,21 @@ var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
|
5599
5621
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5600
5622
|
|
|
5601
5623
|
// src/components/SearchResultImage/index.tsx
|
|
5602
|
-
var
|
|
5624
|
+
var import_react34 = require("react");
|
|
5603
5625
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5604
5626
|
|
|
5605
5627
|
// src/components/Alert.tsx
|
|
5606
5628
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5607
|
-
var
|
|
5629
|
+
var import_react35 = require("react");
|
|
5608
5630
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5609
5631
|
|
|
5610
5632
|
// src/components/OrderCheckIcon.tsx
|
|
5611
5633
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5612
5634
|
|
|
5613
5635
|
// src/components/EditingContext.tsx
|
|
5614
|
-
var
|
|
5636
|
+
var import_react36 = require("react");
|
|
5615
5637
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5616
|
-
var EditingContext = (0,
|
|
5638
|
+
var EditingContext = (0, import_react36.createContext)(null);
|
|
5617
5639
|
|
|
5618
5640
|
// src/components/AccessCard.tsx
|
|
5619
5641
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
@@ -5747,18 +5769,18 @@ var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
|
5747
5769
|
|
|
5748
5770
|
// src/components/AccessCardGroup.tsx
|
|
5749
5771
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
5750
|
-
var
|
|
5772
|
+
var import_react37 = require("react");
|
|
5751
5773
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5752
5774
|
|
|
5753
5775
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
5754
5776
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
5755
|
-
var
|
|
5777
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
5756
5778
|
|
|
5757
5779
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
5758
|
-
var
|
|
5780
|
+
var import_react39 = require("react");
|
|
5759
5781
|
|
|
5760
5782
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
5761
|
-
var
|
|
5783
|
+
var import_react38 = require("react");
|
|
5762
5784
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5763
5785
|
function ColumnSelectorMenuOption({
|
|
5764
5786
|
id,
|
|
@@ -5766,7 +5788,7 @@ function ColumnSelectorMenuOption({
|
|
|
5766
5788
|
column,
|
|
5767
5789
|
toggleColumnVisibility
|
|
5768
5790
|
}) {
|
|
5769
|
-
const [isVisible, setIsVisible] = (0,
|
|
5791
|
+
const [isVisible, setIsVisible] = (0, import_react38.useState)(column.getIsVisible());
|
|
5770
5792
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
5771
5793
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5772
5794
|
Checkbox,
|
|
@@ -5792,8 +5814,8 @@ function ColumnSelectorHeaderCell({
|
|
|
5792
5814
|
toggleColumnVisibility,
|
|
5793
5815
|
resetColumnVisibility
|
|
5794
5816
|
}) {
|
|
5795
|
-
const ref = (0,
|
|
5796
|
-
const [show, setShow] = (0,
|
|
5817
|
+
const ref = (0, import_react39.useRef)(null);
|
|
5818
|
+
const [show, setShow] = (0, import_react39.useState)(false);
|
|
5797
5819
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5798
5820
|
DataGridCell,
|
|
5799
5821
|
{
|
|
@@ -5962,7 +5984,7 @@ function PinnedColumns(_a) {
|
|
|
5962
5984
|
header.id
|
|
5963
5985
|
);
|
|
5964
5986
|
}
|
|
5965
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react40.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5966
5988
|
Checkbox,
|
|
5967
5989
|
{
|
|
5968
5990
|
checked: allSelectedAcrossPages,
|