@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
|
@@ -62,7 +62,7 @@ __export(ColumnSelectorHeaderCell_exports, {
|
|
|
62
62
|
ColumnSelectorHeaderCell: () => ColumnSelectorHeaderCell
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(ColumnSelectorHeaderCell_exports);
|
|
65
|
-
var
|
|
65
|
+
var import_react40 = require("react");
|
|
66
66
|
|
|
67
67
|
// src/components/DataGridCell.tsx
|
|
68
68
|
var import_sortable = require("@dnd-kit/sortable");
|
|
@@ -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_react15 = __toESM(require("react"), 1);
|
|
2651
2673
|
var import_react_table3 = require("@tanstack/react-table");
|
|
2652
2674
|
var import_core = require("@dnd-kit/core");
|
|
2653
2675
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -2675,7 +2697,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
2675
2697
|
}
|
|
2676
2698
|
|
|
2677
2699
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
2678
|
-
var
|
|
2700
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
2679
2701
|
|
|
2680
2702
|
// src/components/DataGrid/TableBody/index.tsx
|
|
2681
2703
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -2684,7 +2706,7 @@ var import_clsx12 = __toESM(require("clsx"), 1);
|
|
|
2684
2706
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
2685
2707
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2686
2708
|
var import_react_table = require("@tanstack/react-table");
|
|
2687
|
-
var
|
|
2709
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2688
2710
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2689
2711
|
var valueFormatters = {
|
|
2690
2712
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -2752,7 +2774,7 @@ function TableBodyRow({
|
|
|
2752
2774
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
2753
2775
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
2754
2776
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
2755
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2777
|
+
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)(
|
|
2756
2778
|
CellElement,
|
|
2757
2779
|
{
|
|
2758
2780
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -3067,7 +3089,7 @@ function PinnedColumns(_a) {
|
|
|
3067
3089
|
header.id
|
|
3068
3090
|
);
|
|
3069
3091
|
}
|
|
3070
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react14.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3071
3093
|
Checkbox,
|
|
3072
3094
|
{
|
|
3073
3095
|
checked: allSelectedAcrossPages,
|
|
@@ -3149,23 +3171,23 @@ function DataGrid({
|
|
|
3149
3171
|
ref
|
|
3150
3172
|
}) {
|
|
3151
3173
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3152
|
-
(0,
|
|
3174
|
+
(0, import_react15.useImperativeHandle)(ref, () => ({
|
|
3153
3175
|
getSavedLayout: () => {
|
|
3154
3176
|
return getSavedLayout();
|
|
3155
3177
|
}
|
|
3156
3178
|
}));
|
|
3157
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3158
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3159
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3179
|
+
const [localSorting, setLocalSorting] = (0, import_react15.useState)([]);
|
|
3180
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react15.useState)([]);
|
|
3181
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react15.useState)({});
|
|
3160
3182
|
const {
|
|
3161
3183
|
columns: tableColumns,
|
|
3162
3184
|
setColumns: setTableColumns,
|
|
3163
3185
|
getSavedLayout
|
|
3164
3186
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3165
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3187
|
+
const [columnOrder, setColumnOrder] = (0, import_react15.useState)(
|
|
3166
3188
|
tableColumns.map((c) => c.id)
|
|
3167
3189
|
);
|
|
3168
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3190
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react15.useState)(
|
|
3169
3191
|
Object.fromEntries(
|
|
3170
3192
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3171
3193
|
var _a2, _b2;
|
|
@@ -3173,7 +3195,7 @@ function DataGrid({
|
|
|
3173
3195
|
})
|
|
3174
3196
|
)
|
|
3175
3197
|
);
|
|
3176
|
-
const updateColumnVisibility = (0,
|
|
3198
|
+
const updateColumnVisibility = (0, import_react15.useCallback)(
|
|
3177
3199
|
(updateOrder) => {
|
|
3178
3200
|
setColumnVisibility(
|
|
3179
3201
|
Object.fromEntries(
|
|
@@ -3187,7 +3209,7 @@ function DataGrid({
|
|
|
3187
3209
|
},
|
|
3188
3210
|
[tableColumns]
|
|
3189
3211
|
);
|
|
3190
|
-
const resetDefaultColumnVisibility = (0,
|
|
3212
|
+
const resetDefaultColumnVisibility = (0, import_react15.useCallback)(() => {
|
|
3191
3213
|
setTableColumns((prev) => {
|
|
3192
3214
|
columns.forEach((column) => {
|
|
3193
3215
|
var _a2, _b2;
|
|
@@ -3203,7 +3225,7 @@ function DataGrid({
|
|
|
3203
3225
|
return [...prev];
|
|
3204
3226
|
}, true);
|
|
3205
3227
|
}, [columns, setTableColumns]);
|
|
3206
|
-
(0,
|
|
3228
|
+
(0, import_react15.useEffect)(() => {
|
|
3207
3229
|
updateColumnVisibility(true);
|
|
3208
3230
|
}, [updateColumnVisibility]);
|
|
3209
3231
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3219,7 +3241,7 @@ function DataGrid({
|
|
|
3219
3241
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3220
3242
|
} : setLocalColumnFilters;
|
|
3221
3243
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3222
|
-
const setRowSelection = (0,
|
|
3244
|
+
const setRowSelection = (0, import_react15.useCallback)(
|
|
3223
3245
|
(updaterOrValue) => {
|
|
3224
3246
|
if (pagination) {
|
|
3225
3247
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3233,9 +3255,9 @@ function DataGrid({
|
|
|
3233
3255
|
},
|
|
3234
3256
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3235
3257
|
);
|
|
3236
|
-
const dndId = (0,
|
|
3237
|
-
const containerRef =
|
|
3238
|
-
const toggleColumnVisibility = (0,
|
|
3258
|
+
const dndId = (0, import_react15.useId)();
|
|
3259
|
+
const containerRef = import_react15.default.useRef(null);
|
|
3260
|
+
const toggleColumnVisibility = (0, import_react15.useCallback)(
|
|
3239
3261
|
(columnId, isVisible) => {
|
|
3240
3262
|
setTableColumns((prev) => {
|
|
3241
3263
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3483,7 +3505,7 @@ function DataGrid({
|
|
|
3483
3505
|
header.id
|
|
3484
3506
|
);
|
|
3485
3507
|
}
|
|
3486
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3487
3509
|
DataGridCell,
|
|
3488
3510
|
{
|
|
3489
3511
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3689,7 +3711,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3689
3711
|
}
|
|
3690
3712
|
|
|
3691
3713
|
// src/components/Select.tsx
|
|
3692
|
-
var
|
|
3714
|
+
var import_react16 = require("react");
|
|
3693
3715
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
3694
3716
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3695
3717
|
var Select = (_a) => {
|
|
@@ -3723,11 +3745,11 @@ var Select = (_a) => {
|
|
|
3723
3745
|
"value"
|
|
3724
3746
|
]);
|
|
3725
3747
|
var _a2;
|
|
3726
|
-
const inputRef = (0,
|
|
3727
|
-
const inputContainerRef = (0,
|
|
3728
|
-
const preventFocusOnInitialRender = (0,
|
|
3729
|
-
const [show, setShow] = (0,
|
|
3730
|
-
(0,
|
|
3748
|
+
const inputRef = (0, import_react16.useRef)(null);
|
|
3749
|
+
const inputContainerRef = (0, import_react16.useRef)(null);
|
|
3750
|
+
const preventFocusOnInitialRender = (0, import_react16.useRef)(true);
|
|
3751
|
+
const [show, setShow] = (0, import_react16.useState)(false);
|
|
3752
|
+
(0, import_react16.useEffect)(() => {
|
|
3731
3753
|
var _a3;
|
|
3732
3754
|
if (preventFocusOnInitialRender.current) {
|
|
3733
3755
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4149,7 +4171,7 @@ Button.displayName = "Button";
|
|
|
4149
4171
|
|
|
4150
4172
|
// src/components/Tooltip.tsx
|
|
4151
4173
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4152
|
-
var
|
|
4174
|
+
var import_react17 = require("react");
|
|
4153
4175
|
var import_react_dom2 = require("react-dom");
|
|
4154
4176
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4155
4177
|
var Tooltip = ({
|
|
@@ -4162,11 +4184,11 @@ var Tooltip = ({
|
|
|
4162
4184
|
offset = 8,
|
|
4163
4185
|
keepHidden = false
|
|
4164
4186
|
}) => {
|
|
4165
|
-
const ref = (0,
|
|
4166
|
-
const tooltipRef = (0,
|
|
4167
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4168
|
-
const [isVisible, setIsVisible] = (0,
|
|
4169
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4187
|
+
const ref = (0, import_react17.useRef)(null);
|
|
4188
|
+
const tooltipRef = (0, import_react17.useRef)(null);
|
|
4189
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react17.useState)({ top: 0, left: 0 });
|
|
4190
|
+
const [isVisible, setIsVisible] = (0, import_react17.useState)(false);
|
|
4191
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react17.useState)(false);
|
|
4170
4192
|
const updatePosition = () => {
|
|
4171
4193
|
if (!ref.current || !tooltipRef.current) return;
|
|
4172
4194
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4205,14 +4227,14 @@ var Tooltip = ({
|
|
|
4205
4227
|
setIsVisible(false);
|
|
4206
4228
|
setRemoveOpacity(false);
|
|
4207
4229
|
};
|
|
4208
|
-
(0,
|
|
4230
|
+
(0, import_react17.useEffect)(() => {
|
|
4209
4231
|
if (isVisible && tooltipRef.current) {
|
|
4210
4232
|
requestAnimationFrame(() => {
|
|
4211
4233
|
updatePosition();
|
|
4212
4234
|
});
|
|
4213
4235
|
}
|
|
4214
4236
|
}, [isVisible]);
|
|
4215
|
-
(0,
|
|
4237
|
+
(0, import_react17.useEffect)(() => {
|
|
4216
4238
|
if (isVisible) {
|
|
4217
4239
|
window.addEventListener("resize", updatePosition);
|
|
4218
4240
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4270,12 +4292,12 @@ var Tooltip = ({
|
|
|
4270
4292
|
Tooltip.displayName = "Tooltip";
|
|
4271
4293
|
|
|
4272
4294
|
// src/components/DateInput.tsx
|
|
4273
|
-
var
|
|
4295
|
+
var import_react19 = require("react");
|
|
4274
4296
|
var import_react_dom3 = require("react-dom");
|
|
4275
4297
|
|
|
4276
4298
|
// src/components/CalendarRange.tsx
|
|
4277
4299
|
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
4278
|
-
var
|
|
4300
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
4279
4301
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4280
4302
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4281
4303
|
function DateCell(_a) {
|
|
@@ -4388,20 +4410,20 @@ function CalendarRange({
|
|
|
4388
4410
|
const fromDate = parseDate(from);
|
|
4389
4411
|
const toDate = parseDate(to);
|
|
4390
4412
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4391
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4413
|
+
const [baseMonth, setBaseMonth] = (0, import_react18.useState)(
|
|
4392
4414
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4393
4415
|
);
|
|
4394
|
-
const [selecting, setSelecting] = (0,
|
|
4395
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4396
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4397
|
-
(0,
|
|
4416
|
+
const [selecting, setSelecting] = (0, import_react18.useState)("from");
|
|
4417
|
+
const [pendingFrom, setPendingFrom] = (0, import_react18.useState)(void 0);
|
|
4418
|
+
const [hoveredDate, setHoveredDate] = (0, import_react18.useState)(void 0);
|
|
4419
|
+
(0, import_react18.useEffect)(() => {
|
|
4398
4420
|
if (fromDate) {
|
|
4399
4421
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4400
4422
|
} else if (toDate) {
|
|
4401
4423
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4402
4424
|
}
|
|
4403
4425
|
}, [from, to]);
|
|
4404
|
-
(0,
|
|
4426
|
+
(0, import_react18.useEffect)(() => {
|
|
4405
4427
|
if (fromDate && toDate) {
|
|
4406
4428
|
setSelecting("from");
|
|
4407
4429
|
setPendingFrom(void 0);
|
|
@@ -4547,14 +4569,14 @@ function CalendarPane({
|
|
|
4547
4569
|
const years = Array.from({ length: 100 }).map(
|
|
4548
4570
|
(_, i) => baseMonth.year - 50 + i
|
|
4549
4571
|
);
|
|
4550
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4551
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4552
|
-
const monthMenuRef = (0,
|
|
4553
|
-
const yearMenuRef = (0,
|
|
4572
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react18.useState)(false);
|
|
4573
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react18.useState)(false);
|
|
4574
|
+
const monthMenuRef = (0, import_react18.useRef)(null);
|
|
4575
|
+
const yearMenuRef = (0, import_react18.useRef)(null);
|
|
4554
4576
|
const month = getMonthData(offset);
|
|
4555
4577
|
const totalCells = 42;
|
|
4556
4578
|
const emptyCells = month.firstDayOffset;
|
|
4557
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react18.default.Fragment, { children: [
|
|
4558
4580
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4559
4581
|
"div",
|
|
4560
4582
|
{
|
|
@@ -4762,24 +4784,24 @@ var DateInput = (_a) => {
|
|
|
4762
4784
|
"label",
|
|
4763
4785
|
"isDateAvailable"
|
|
4764
4786
|
]);
|
|
4765
|
-
const [visible, setVisible] = (0,
|
|
4766
|
-
const [inputValue, setInputValue] = (0,
|
|
4767
|
-
const [isTyping, setIsTyping] = (0,
|
|
4768
|
-
const popoverRef = (0,
|
|
4769
|
-
const triggerRef = (0,
|
|
4770
|
-
const rootRef = (0,
|
|
4771
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4787
|
+
const [visible, setVisible] = (0, import_react19.useState)(false);
|
|
4788
|
+
const [inputValue, setInputValue] = (0, import_react19.useState)("");
|
|
4789
|
+
const [isTyping, setIsTyping] = (0, import_react19.useState)(false);
|
|
4790
|
+
const popoverRef = (0, import_react19.useRef)(null);
|
|
4791
|
+
const triggerRef = (0, import_react19.useRef)(null);
|
|
4792
|
+
const rootRef = (0, import_react19.useRef)(null);
|
|
4793
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react19.useState)({
|
|
4772
4794
|
top: 0,
|
|
4773
4795
|
left: 0,
|
|
4774
4796
|
width: 0
|
|
4775
4797
|
});
|
|
4776
4798
|
const [from, to] = [value, ""];
|
|
4777
|
-
(0,
|
|
4799
|
+
(0, import_react19.useEffect)(() => {
|
|
4778
4800
|
if (!isTyping) {
|
|
4779
4801
|
setInputValue(formatDisplayValue(from));
|
|
4780
4802
|
}
|
|
4781
4803
|
}, [from, isTyping]);
|
|
4782
|
-
(0,
|
|
4804
|
+
(0, import_react19.useLayoutEffect)(() => {
|
|
4783
4805
|
if (visible) {
|
|
4784
4806
|
updatePosition();
|
|
4785
4807
|
}
|
|
@@ -4794,7 +4816,7 @@ var DateInput = (_a) => {
|
|
|
4794
4816
|
});
|
|
4795
4817
|
}
|
|
4796
4818
|
};
|
|
4797
|
-
(0,
|
|
4819
|
+
(0, import_react19.useEffect)(() => {
|
|
4798
4820
|
updatePosition();
|
|
4799
4821
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4800
4822
|
if (triggerRef.current) {
|
|
@@ -4806,7 +4828,7 @@ var DateInput = (_a) => {
|
|
|
4806
4828
|
window.removeEventListener("scroll", updatePosition);
|
|
4807
4829
|
};
|
|
4808
4830
|
}, []);
|
|
4809
|
-
(0,
|
|
4831
|
+
(0, import_react19.useEffect)(() => {
|
|
4810
4832
|
const handleKeyDown2 = (event) => {
|
|
4811
4833
|
var _a2;
|
|
4812
4834
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4819,7 +4841,7 @@ var DateInput = (_a) => {
|
|
|
4819
4841
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4820
4842
|
};
|
|
4821
4843
|
});
|
|
4822
|
-
(0,
|
|
4844
|
+
(0, import_react19.useEffect)(() => {
|
|
4823
4845
|
const handleClickOutside = (event) => {
|
|
4824
4846
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4825
4847
|
setVisible(false);
|
|
@@ -5040,14 +5062,14 @@ Heading3.displayName = "Heading3";
|
|
|
5040
5062
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5041
5063
|
|
|
5042
5064
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5043
|
-
var
|
|
5065
|
+
var import_react22 = require("react");
|
|
5044
5066
|
|
|
5045
5067
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5046
|
-
var
|
|
5068
|
+
var import_react21 = require("react");
|
|
5047
5069
|
|
|
5048
5070
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5049
|
-
var
|
|
5050
|
-
var GridContext = (0,
|
|
5071
|
+
var import_react20 = require("react");
|
|
5072
|
+
var GridContext = (0, import_react20.createContext)(null);
|
|
5051
5073
|
|
|
5052
5074
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5053
5075
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
@@ -5056,12 +5078,12 @@ var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
|
5056
5078
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5057
5079
|
|
|
5058
5080
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5059
|
-
var
|
|
5081
|
+
var import_react23 = require("react");
|
|
5060
5082
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5061
5083
|
|
|
5062
5084
|
// src/components/Modal.tsx
|
|
5063
5085
|
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
5064
|
-
var
|
|
5086
|
+
var import_react25 = require("react");
|
|
5065
5087
|
|
|
5066
5088
|
// src/components/ModalHeader.tsx
|
|
5067
5089
|
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
@@ -5237,10 +5259,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
5237
5259
|
var import_react_use = require("react-use");
|
|
5238
5260
|
|
|
5239
5261
|
// src/components/useMounted.tsx
|
|
5240
|
-
var
|
|
5262
|
+
var import_react24 = require("react");
|
|
5241
5263
|
var useMounted = () => {
|
|
5242
|
-
const [isMounted, setIsMounted] = (0,
|
|
5243
|
-
(0,
|
|
5264
|
+
const [isMounted, setIsMounted] = (0, import_react24.useState)(false);
|
|
5265
|
+
(0, import_react24.useEffect)(() => {
|
|
5244
5266
|
setIsMounted(true);
|
|
5245
5267
|
return () => setIsMounted(false);
|
|
5246
5268
|
}, []);
|
|
@@ -5334,12 +5356,12 @@ var Modal = ({
|
|
|
5334
5356
|
}) => {
|
|
5335
5357
|
var _a;
|
|
5336
5358
|
const mounted = useMounted();
|
|
5337
|
-
const modalRef = (0,
|
|
5338
|
-
const bgRef = (0,
|
|
5359
|
+
const modalRef = (0, import_react25.useRef)(null);
|
|
5360
|
+
const bgRef = (0, import_react25.useRef)(null);
|
|
5339
5361
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5340
5362
|
const isMobile = useMatchesMobile();
|
|
5341
5363
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5342
|
-
(0,
|
|
5364
|
+
(0, import_react25.useEffect)(() => {
|
|
5343
5365
|
if (!mounted) return;
|
|
5344
5366
|
if (!modalRef.current || !bgRef.current) {
|
|
5345
5367
|
console.error("Modal or background reference is not set.");
|
|
@@ -5359,7 +5381,7 @@ var Modal = ({
|
|
|
5359
5381
|
bgFadeIn(bgRef.current);
|
|
5360
5382
|
}
|
|
5361
5383
|
}, [mounted, onClose, open, wasOpen]);
|
|
5362
|
-
const handleKeyDown = (0,
|
|
5384
|
+
const handleKeyDown = (0, import_react25.useCallback)(
|
|
5363
5385
|
(e) => {
|
|
5364
5386
|
if (e.key === "Escape") {
|
|
5365
5387
|
if (onClose) {
|
|
@@ -5370,12 +5392,12 @@ var Modal = ({
|
|
|
5370
5392
|
},
|
|
5371
5393
|
[onClose]
|
|
5372
5394
|
);
|
|
5373
|
-
const handleClose = (0,
|
|
5395
|
+
const handleClose = (0, import_react25.useCallback)(() => {
|
|
5374
5396
|
if (onClose) {
|
|
5375
5397
|
onClose();
|
|
5376
5398
|
}
|
|
5377
5399
|
}, [onClose]);
|
|
5378
|
-
(0,
|
|
5400
|
+
(0, import_react25.useEffect)(() => {
|
|
5379
5401
|
if (open) {
|
|
5380
5402
|
document.addEventListener("keyup", handleKeyDown);
|
|
5381
5403
|
}
|
|
@@ -5383,7 +5405,7 @@ var Modal = ({
|
|
|
5383
5405
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5384
5406
|
};
|
|
5385
5407
|
}, [open, handleKeyDown]);
|
|
5386
|
-
(0,
|
|
5408
|
+
(0, import_react25.useEffect)(() => {
|
|
5387
5409
|
if (!open) return;
|
|
5388
5410
|
const scrollY = window.scrollY;
|
|
5389
5411
|
const body = document.body;
|
|
@@ -5404,7 +5426,7 @@ var Modal = ({
|
|
|
5404
5426
|
};
|
|
5405
5427
|
}, [open]);
|
|
5406
5428
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5407
|
-
const backgroundClickHandler = (0,
|
|
5429
|
+
const backgroundClickHandler = (0, import_react25.useCallback)(
|
|
5408
5430
|
(e) => {
|
|
5409
5431
|
const target = e.target;
|
|
5410
5432
|
const currentTarget = e.currentTarget;
|
|
@@ -5513,10 +5535,10 @@ var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
|
5513
5535
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5514
5536
|
|
|
5515
5537
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5516
|
-
var
|
|
5538
|
+
var import_react27 = require("react");
|
|
5517
5539
|
|
|
5518
5540
|
// src/components/ImagePlaceholder.tsx
|
|
5519
|
-
var
|
|
5541
|
+
var import_react26 = require("react");
|
|
5520
5542
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5521
5543
|
|
|
5522
5544
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5527,11 +5549,11 @@ var import_clsx32 = __toESM(require("clsx"), 1);
|
|
|
5527
5549
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5528
5550
|
|
|
5529
5551
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5530
|
-
var
|
|
5552
|
+
var import_react28 = require("react");
|
|
5531
5553
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5532
5554
|
|
|
5533
5555
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5534
|
-
var
|
|
5556
|
+
var import_react29 = require("react");
|
|
5535
5557
|
|
|
5536
5558
|
// src/components/Surface.tsx
|
|
5537
5559
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
@@ -5576,17 +5598,17 @@ var import_clsx34 = require("clsx");
|
|
|
5576
5598
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5577
5599
|
|
|
5578
5600
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5579
|
-
var
|
|
5601
|
+
var import_react30 = require("react");
|
|
5580
5602
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5581
5603
|
|
|
5582
5604
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5583
|
-
var
|
|
5605
|
+
var import_react31 = require("react");
|
|
5584
5606
|
|
|
5585
5607
|
// src/components/ProductImagePreview/index.tsx
|
|
5586
5608
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5587
5609
|
|
|
5588
5610
|
// src/components/CompactImagesPreview.tsx
|
|
5589
|
-
var
|
|
5611
|
+
var import_react32 = require("react");
|
|
5590
5612
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
5591
5613
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5592
5614
|
|
|
@@ -5595,12 +5617,12 @@ var import_clsx36 = __toESM(require("clsx"), 1);
|
|
|
5595
5617
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5596
5618
|
|
|
5597
5619
|
// src/components/ListGroup.tsx
|
|
5598
|
-
var
|
|
5620
|
+
var import_react33 = require("react");
|
|
5599
5621
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5600
5622
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5601
5623
|
|
|
5602
5624
|
// src/components/Pagination.tsx
|
|
5603
|
-
var
|
|
5625
|
+
var import_react34 = require("react");
|
|
5604
5626
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5605
5627
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5606
5628
|
var Pagination = ({
|
|
@@ -5612,7 +5634,7 @@ var Pagination = ({
|
|
|
5612
5634
|
className,
|
|
5613
5635
|
disabled
|
|
5614
5636
|
}) => {
|
|
5615
|
-
const goTo = (0,
|
|
5637
|
+
const goTo = (0, import_react34.useCallback)(
|
|
5616
5638
|
(page) => {
|
|
5617
5639
|
if (disabled) return;
|
|
5618
5640
|
onPageChange(page);
|
|
@@ -5629,7 +5651,7 @@ var Pagination = ({
|
|
|
5629
5651
|
goTo(currentPage + 1);
|
|
5630
5652
|
}
|
|
5631
5653
|
};
|
|
5632
|
-
const pageTokens = (0,
|
|
5654
|
+
const pageTokens = (0, import_react34.useMemo)(() => {
|
|
5633
5655
|
if (totalPages <= 5) {
|
|
5634
5656
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5635
5657
|
}
|
|
@@ -5752,21 +5774,21 @@ var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
|
5752
5774
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5753
5775
|
|
|
5754
5776
|
// src/components/SearchResultImage/index.tsx
|
|
5755
|
-
var
|
|
5777
|
+
var import_react35 = require("react");
|
|
5756
5778
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5757
5779
|
|
|
5758
5780
|
// src/components/Alert.tsx
|
|
5759
5781
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
5760
|
-
var
|
|
5782
|
+
var import_react36 = require("react");
|
|
5761
5783
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5762
5784
|
|
|
5763
5785
|
// src/components/OrderCheckIcon.tsx
|
|
5764
5786
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5765
5787
|
|
|
5766
5788
|
// src/components/EditingContext.tsx
|
|
5767
|
-
var
|
|
5789
|
+
var import_react37 = require("react");
|
|
5768
5790
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5769
|
-
var EditingContext = (0,
|
|
5791
|
+
var EditingContext = (0, import_react37.createContext)(null);
|
|
5770
5792
|
|
|
5771
5793
|
// src/components/AccessCard.tsx
|
|
5772
5794
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
@@ -5900,11 +5922,11 @@ var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
|
5900
5922
|
|
|
5901
5923
|
// src/components/AccessCardGroup.tsx
|
|
5902
5924
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
5903
|
-
var
|
|
5925
|
+
var import_react38 = require("react");
|
|
5904
5926
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5905
5927
|
|
|
5906
5928
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
5907
|
-
var
|
|
5929
|
+
var import_react39 = require("react");
|
|
5908
5930
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5909
5931
|
function ColumnSelectorMenuOption({
|
|
5910
5932
|
id,
|
|
@@ -5912,7 +5934,7 @@ function ColumnSelectorMenuOption({
|
|
|
5912
5934
|
column,
|
|
5913
5935
|
toggleColumnVisibility
|
|
5914
5936
|
}) {
|
|
5915
|
-
const [isVisible, setIsVisible] = (0,
|
|
5937
|
+
const [isVisible, setIsVisible] = (0, import_react39.useState)(column.getIsVisible());
|
|
5916
5938
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
5917
5939
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5918
5940
|
Checkbox,
|
|
@@ -5938,8 +5960,8 @@ function ColumnSelectorHeaderCell({
|
|
|
5938
5960
|
toggleColumnVisibility,
|
|
5939
5961
|
resetColumnVisibility
|
|
5940
5962
|
}) {
|
|
5941
|
-
const ref = (0,
|
|
5942
|
-
const [show, setShow] = (0,
|
|
5963
|
+
const ref = (0, import_react40.useRef)(null);
|
|
5964
|
+
const [show, setShow] = (0, import_react40.useState)(false);
|
|
5943
5965
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
5944
5966
|
DataGridCell,
|
|
5945
5967
|
{
|