@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(ColumnSelectorMenuOption_exports, {
|
|
|
62
62
|
ColumnSelectorMenuOption: () => ColumnSelectorMenuOption
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(ColumnSelectorMenuOption_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
|
-
true
|
|
688
|
+
)
|
|
676
689
|
);
|
|
690
|
+
} else {
|
|
691
|
+
localStorage.setItem(
|
|
692
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
693
|
+
JSON.stringify(initialColumns)
|
|
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_react16 = __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_react15 = __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,
|
|
@@ -2966,7 +2988,7 @@ function TableBody({
|
|
|
2966
2988
|
}
|
|
2967
2989
|
|
|
2968
2990
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
2969
|
-
var
|
|
2991
|
+
var import_react14 = require("react");
|
|
2970
2992
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2971
2993
|
function ColumnSelectorHeaderCell({
|
|
2972
2994
|
id,
|
|
@@ -2975,8 +2997,8 @@ function ColumnSelectorHeaderCell({
|
|
|
2975
2997
|
toggleColumnVisibility,
|
|
2976
2998
|
resetColumnVisibility
|
|
2977
2999
|
}) {
|
|
2978
|
-
const ref = (0,
|
|
2979
|
-
const [show, setShow] = (0,
|
|
3000
|
+
const ref = (0, import_react14.useRef)(null);
|
|
3001
|
+
const [show, setShow] = (0, import_react14.useState)(false);
|
|
2980
3002
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2981
3003
|
DataGridCell,
|
|
2982
3004
|
{
|
|
@@ -3145,7 +3167,7 @@ function PinnedColumns(_a) {
|
|
|
3145
3167
|
header.id
|
|
3146
3168
|
);
|
|
3147
3169
|
}
|
|
3148
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3149
3171
|
Checkbox,
|
|
3150
3172
|
{
|
|
3151
3173
|
checked: allSelectedAcrossPages,
|
|
@@ -3227,23 +3249,23 @@ function DataGrid({
|
|
|
3227
3249
|
ref
|
|
3228
3250
|
}) {
|
|
3229
3251
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3230
|
-
(0,
|
|
3252
|
+
(0, import_react16.useImperativeHandle)(ref, () => ({
|
|
3231
3253
|
getSavedLayout: () => {
|
|
3232
3254
|
return getSavedLayout();
|
|
3233
3255
|
}
|
|
3234
3256
|
}));
|
|
3235
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3236
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3237
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3257
|
+
const [localSorting, setLocalSorting] = (0, import_react16.useState)([]);
|
|
3258
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react16.useState)([]);
|
|
3259
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react16.useState)({});
|
|
3238
3260
|
const {
|
|
3239
3261
|
columns: tableColumns,
|
|
3240
3262
|
setColumns: setTableColumns,
|
|
3241
3263
|
getSavedLayout
|
|
3242
3264
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3243
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3265
|
+
const [columnOrder, setColumnOrder] = (0, import_react16.useState)(
|
|
3244
3266
|
tableColumns.map((c) => c.id)
|
|
3245
3267
|
);
|
|
3246
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3268
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react16.useState)(
|
|
3247
3269
|
Object.fromEntries(
|
|
3248
3270
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3249
3271
|
var _a2, _b2;
|
|
@@ -3251,7 +3273,7 @@ function DataGrid({
|
|
|
3251
3273
|
})
|
|
3252
3274
|
)
|
|
3253
3275
|
);
|
|
3254
|
-
const updateColumnVisibility = (0,
|
|
3276
|
+
const updateColumnVisibility = (0, import_react16.useCallback)(
|
|
3255
3277
|
(updateOrder) => {
|
|
3256
3278
|
setColumnVisibility(
|
|
3257
3279
|
Object.fromEntries(
|
|
@@ -3265,7 +3287,7 @@ function DataGrid({
|
|
|
3265
3287
|
},
|
|
3266
3288
|
[tableColumns]
|
|
3267
3289
|
);
|
|
3268
|
-
const resetDefaultColumnVisibility = (0,
|
|
3290
|
+
const resetDefaultColumnVisibility = (0, import_react16.useCallback)(() => {
|
|
3269
3291
|
setTableColumns((prev) => {
|
|
3270
3292
|
columns.forEach((column) => {
|
|
3271
3293
|
var _a2, _b2;
|
|
@@ -3281,7 +3303,7 @@ function DataGrid({
|
|
|
3281
3303
|
return [...prev];
|
|
3282
3304
|
}, true);
|
|
3283
3305
|
}, [columns, setTableColumns]);
|
|
3284
|
-
(0,
|
|
3306
|
+
(0, import_react16.useEffect)(() => {
|
|
3285
3307
|
updateColumnVisibility(true);
|
|
3286
3308
|
}, [updateColumnVisibility]);
|
|
3287
3309
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3297,7 +3319,7 @@ function DataGrid({
|
|
|
3297
3319
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3298
3320
|
} : setLocalColumnFilters;
|
|
3299
3321
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3300
|
-
const setRowSelection = (0,
|
|
3322
|
+
const setRowSelection = (0, import_react16.useCallback)(
|
|
3301
3323
|
(updaterOrValue) => {
|
|
3302
3324
|
if (pagination) {
|
|
3303
3325
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3311,9 +3333,9 @@ function DataGrid({
|
|
|
3311
3333
|
},
|
|
3312
3334
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3313
3335
|
);
|
|
3314
|
-
const dndId = (0,
|
|
3315
|
-
const containerRef =
|
|
3316
|
-
const toggleColumnVisibility = (0,
|
|
3336
|
+
const dndId = (0, import_react16.useId)();
|
|
3337
|
+
const containerRef = import_react16.default.useRef(null);
|
|
3338
|
+
const toggleColumnVisibility = (0, import_react16.useCallback)(
|
|
3317
3339
|
(columnId, isVisible) => {
|
|
3318
3340
|
setTableColumns((prev) => {
|
|
3319
3341
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3561,7 +3583,7 @@ function DataGrid({
|
|
|
3561
3583
|
header.id
|
|
3562
3584
|
);
|
|
3563
3585
|
}
|
|
3564
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react16.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3565
3587
|
DataGridCell,
|
|
3566
3588
|
{
|
|
3567
3589
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3767,7 +3789,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3767
3789
|
}
|
|
3768
3790
|
|
|
3769
3791
|
// src/components/Select.tsx
|
|
3770
|
-
var
|
|
3792
|
+
var import_react17 = require("react");
|
|
3771
3793
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
3772
3794
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3773
3795
|
var Select = (_a) => {
|
|
@@ -3801,11 +3823,11 @@ var Select = (_a) => {
|
|
|
3801
3823
|
"value"
|
|
3802
3824
|
]);
|
|
3803
3825
|
var _a2;
|
|
3804
|
-
const inputRef = (0,
|
|
3805
|
-
const inputContainerRef = (0,
|
|
3806
|
-
const preventFocusOnInitialRender = (0,
|
|
3807
|
-
const [show, setShow] = (0,
|
|
3808
|
-
(0,
|
|
3826
|
+
const inputRef = (0, import_react17.useRef)(null);
|
|
3827
|
+
const inputContainerRef = (0, import_react17.useRef)(null);
|
|
3828
|
+
const preventFocusOnInitialRender = (0, import_react17.useRef)(true);
|
|
3829
|
+
const [show, setShow] = (0, import_react17.useState)(false);
|
|
3830
|
+
(0, import_react17.useEffect)(() => {
|
|
3809
3831
|
var _a3;
|
|
3810
3832
|
if (preventFocusOnInitialRender.current) {
|
|
3811
3833
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4227,7 +4249,7 @@ Button.displayName = "Button";
|
|
|
4227
4249
|
|
|
4228
4250
|
// src/components/Tooltip.tsx
|
|
4229
4251
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4230
|
-
var
|
|
4252
|
+
var import_react18 = require("react");
|
|
4231
4253
|
var import_react_dom2 = require("react-dom");
|
|
4232
4254
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4233
4255
|
var Tooltip = ({
|
|
@@ -4240,11 +4262,11 @@ var Tooltip = ({
|
|
|
4240
4262
|
offset = 8,
|
|
4241
4263
|
keepHidden = false
|
|
4242
4264
|
}) => {
|
|
4243
|
-
const ref = (0,
|
|
4244
|
-
const tooltipRef = (0,
|
|
4245
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4246
|
-
const [isVisible, setIsVisible] = (0,
|
|
4247
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4265
|
+
const ref = (0, import_react18.useRef)(null);
|
|
4266
|
+
const tooltipRef = (0, import_react18.useRef)(null);
|
|
4267
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react18.useState)({ top: 0, left: 0 });
|
|
4268
|
+
const [isVisible, setIsVisible] = (0, import_react18.useState)(false);
|
|
4269
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react18.useState)(false);
|
|
4248
4270
|
const updatePosition = () => {
|
|
4249
4271
|
if (!ref.current || !tooltipRef.current) return;
|
|
4250
4272
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4283,14 +4305,14 @@ var Tooltip = ({
|
|
|
4283
4305
|
setIsVisible(false);
|
|
4284
4306
|
setRemoveOpacity(false);
|
|
4285
4307
|
};
|
|
4286
|
-
(0,
|
|
4308
|
+
(0, import_react18.useEffect)(() => {
|
|
4287
4309
|
if (isVisible && tooltipRef.current) {
|
|
4288
4310
|
requestAnimationFrame(() => {
|
|
4289
4311
|
updatePosition();
|
|
4290
4312
|
});
|
|
4291
4313
|
}
|
|
4292
4314
|
}, [isVisible]);
|
|
4293
|
-
(0,
|
|
4315
|
+
(0, import_react18.useEffect)(() => {
|
|
4294
4316
|
if (isVisible) {
|
|
4295
4317
|
window.addEventListener("resize", updatePosition);
|
|
4296
4318
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4348,12 +4370,12 @@ var Tooltip = ({
|
|
|
4348
4370
|
Tooltip.displayName = "Tooltip";
|
|
4349
4371
|
|
|
4350
4372
|
// src/components/DateInput.tsx
|
|
4351
|
-
var
|
|
4373
|
+
var import_react20 = require("react");
|
|
4352
4374
|
var import_react_dom3 = require("react-dom");
|
|
4353
4375
|
|
|
4354
4376
|
// src/components/CalendarRange.tsx
|
|
4355
4377
|
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
4356
|
-
var
|
|
4378
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
4357
4379
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4358
4380
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4359
4381
|
function DateCell(_a) {
|
|
@@ -4466,20 +4488,20 @@ function CalendarRange({
|
|
|
4466
4488
|
const fromDate = parseDate(from);
|
|
4467
4489
|
const toDate = parseDate(to);
|
|
4468
4490
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4469
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4491
|
+
const [baseMonth, setBaseMonth] = (0, import_react19.useState)(
|
|
4470
4492
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4471
4493
|
);
|
|
4472
|
-
const [selecting, setSelecting] = (0,
|
|
4473
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4474
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4475
|
-
(0,
|
|
4494
|
+
const [selecting, setSelecting] = (0, import_react19.useState)("from");
|
|
4495
|
+
const [pendingFrom, setPendingFrom] = (0, import_react19.useState)(void 0);
|
|
4496
|
+
const [hoveredDate, setHoveredDate] = (0, import_react19.useState)(void 0);
|
|
4497
|
+
(0, import_react19.useEffect)(() => {
|
|
4476
4498
|
if (fromDate) {
|
|
4477
4499
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4478
4500
|
} else if (toDate) {
|
|
4479
4501
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4480
4502
|
}
|
|
4481
4503
|
}, [from, to]);
|
|
4482
|
-
(0,
|
|
4504
|
+
(0, import_react19.useEffect)(() => {
|
|
4483
4505
|
if (fromDate && toDate) {
|
|
4484
4506
|
setSelecting("from");
|
|
4485
4507
|
setPendingFrom(void 0);
|
|
@@ -4625,14 +4647,14 @@ function CalendarPane({
|
|
|
4625
4647
|
const years = Array.from({ length: 100 }).map(
|
|
4626
4648
|
(_, i) => baseMonth.year - 50 + i
|
|
4627
4649
|
);
|
|
4628
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4629
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4630
|
-
const monthMenuRef = (0,
|
|
4631
|
-
const yearMenuRef = (0,
|
|
4650
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react19.useState)(false);
|
|
4651
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react19.useState)(false);
|
|
4652
|
+
const monthMenuRef = (0, import_react19.useRef)(null);
|
|
4653
|
+
const yearMenuRef = (0, import_react19.useRef)(null);
|
|
4632
4654
|
const month = getMonthData(offset);
|
|
4633
4655
|
const totalCells = 42;
|
|
4634
4656
|
const emptyCells = month.firstDayOffset;
|
|
4635
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react19.default.Fragment, { children: [
|
|
4636
4658
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4637
4659
|
"div",
|
|
4638
4660
|
{
|
|
@@ -4840,24 +4862,24 @@ var DateInput = (_a) => {
|
|
|
4840
4862
|
"label",
|
|
4841
4863
|
"isDateAvailable"
|
|
4842
4864
|
]);
|
|
4843
|
-
const [visible, setVisible] = (0,
|
|
4844
|
-
const [inputValue, setInputValue] = (0,
|
|
4845
|
-
const [isTyping, setIsTyping] = (0,
|
|
4846
|
-
const popoverRef = (0,
|
|
4847
|
-
const triggerRef = (0,
|
|
4848
|
-
const rootRef = (0,
|
|
4849
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4865
|
+
const [visible, setVisible] = (0, import_react20.useState)(false);
|
|
4866
|
+
const [inputValue, setInputValue] = (0, import_react20.useState)("");
|
|
4867
|
+
const [isTyping, setIsTyping] = (0, import_react20.useState)(false);
|
|
4868
|
+
const popoverRef = (0, import_react20.useRef)(null);
|
|
4869
|
+
const triggerRef = (0, import_react20.useRef)(null);
|
|
4870
|
+
const rootRef = (0, import_react20.useRef)(null);
|
|
4871
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react20.useState)({
|
|
4850
4872
|
top: 0,
|
|
4851
4873
|
left: 0,
|
|
4852
4874
|
width: 0
|
|
4853
4875
|
});
|
|
4854
4876
|
const [from, to] = [value, ""];
|
|
4855
|
-
(0,
|
|
4877
|
+
(0, import_react20.useEffect)(() => {
|
|
4856
4878
|
if (!isTyping) {
|
|
4857
4879
|
setInputValue(formatDisplayValue(from));
|
|
4858
4880
|
}
|
|
4859
4881
|
}, [from, isTyping]);
|
|
4860
|
-
(0,
|
|
4882
|
+
(0, import_react20.useLayoutEffect)(() => {
|
|
4861
4883
|
if (visible) {
|
|
4862
4884
|
updatePosition();
|
|
4863
4885
|
}
|
|
@@ -4872,7 +4894,7 @@ var DateInput = (_a) => {
|
|
|
4872
4894
|
});
|
|
4873
4895
|
}
|
|
4874
4896
|
};
|
|
4875
|
-
(0,
|
|
4897
|
+
(0, import_react20.useEffect)(() => {
|
|
4876
4898
|
updatePosition();
|
|
4877
4899
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4878
4900
|
if (triggerRef.current) {
|
|
@@ -4884,7 +4906,7 @@ var DateInput = (_a) => {
|
|
|
4884
4906
|
window.removeEventListener("scroll", updatePosition);
|
|
4885
4907
|
};
|
|
4886
4908
|
}, []);
|
|
4887
|
-
(0,
|
|
4909
|
+
(0, import_react20.useEffect)(() => {
|
|
4888
4910
|
const handleKeyDown2 = (event) => {
|
|
4889
4911
|
var _a2;
|
|
4890
4912
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4897,7 +4919,7 @@ var DateInput = (_a) => {
|
|
|
4897
4919
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4898
4920
|
};
|
|
4899
4921
|
});
|
|
4900
|
-
(0,
|
|
4922
|
+
(0, import_react20.useEffect)(() => {
|
|
4901
4923
|
const handleClickOutside = (event) => {
|
|
4902
4924
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4903
4925
|
setVisible(false);
|
|
@@ -5118,14 +5140,14 @@ Heading3.displayName = "Heading3";
|
|
|
5118
5140
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5119
5141
|
|
|
5120
5142
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5121
|
-
var
|
|
5143
|
+
var import_react23 = require("react");
|
|
5122
5144
|
|
|
5123
5145
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5124
|
-
var
|
|
5146
|
+
var import_react22 = require("react");
|
|
5125
5147
|
|
|
5126
5148
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5127
|
-
var
|
|
5128
|
-
var GridContext = (0,
|
|
5149
|
+
var import_react21 = require("react");
|
|
5150
|
+
var GridContext = (0, import_react21.createContext)(null);
|
|
5129
5151
|
|
|
5130
5152
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5131
5153
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -5134,12 +5156,12 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
|
5134
5156
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5135
5157
|
|
|
5136
5158
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5137
|
-
var
|
|
5159
|
+
var import_react24 = require("react");
|
|
5138
5160
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5139
5161
|
|
|
5140
5162
|
// src/components/Modal.tsx
|
|
5141
5163
|
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
5142
|
-
var
|
|
5164
|
+
var import_react26 = require("react");
|
|
5143
5165
|
|
|
5144
5166
|
// src/components/ModalHeader.tsx
|
|
5145
5167
|
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
@@ -5315,10 +5337,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
5315
5337
|
var import_react_use = require("react-use");
|
|
5316
5338
|
|
|
5317
5339
|
// src/components/useMounted.tsx
|
|
5318
|
-
var
|
|
5340
|
+
var import_react25 = require("react");
|
|
5319
5341
|
var useMounted = () => {
|
|
5320
|
-
const [isMounted, setIsMounted] = (0,
|
|
5321
|
-
(0,
|
|
5342
|
+
const [isMounted, setIsMounted] = (0, import_react25.useState)(false);
|
|
5343
|
+
(0, import_react25.useEffect)(() => {
|
|
5322
5344
|
setIsMounted(true);
|
|
5323
5345
|
return () => setIsMounted(false);
|
|
5324
5346
|
}, []);
|
|
@@ -5412,12 +5434,12 @@ var Modal = ({
|
|
|
5412
5434
|
}) => {
|
|
5413
5435
|
var _a;
|
|
5414
5436
|
const mounted = useMounted();
|
|
5415
|
-
const modalRef = (0,
|
|
5416
|
-
const bgRef = (0,
|
|
5437
|
+
const modalRef = (0, import_react26.useRef)(null);
|
|
5438
|
+
const bgRef = (0, import_react26.useRef)(null);
|
|
5417
5439
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5418
5440
|
const isMobile = useMatchesMobile();
|
|
5419
5441
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5420
|
-
(0,
|
|
5442
|
+
(0, import_react26.useEffect)(() => {
|
|
5421
5443
|
if (!mounted) return;
|
|
5422
5444
|
if (!modalRef.current || !bgRef.current) {
|
|
5423
5445
|
console.error("Modal or background reference is not set.");
|
|
@@ -5437,7 +5459,7 @@ var Modal = ({
|
|
|
5437
5459
|
bgFadeIn(bgRef.current);
|
|
5438
5460
|
}
|
|
5439
5461
|
}, [mounted, onClose, open, wasOpen]);
|
|
5440
|
-
const handleKeyDown = (0,
|
|
5462
|
+
const handleKeyDown = (0, import_react26.useCallback)(
|
|
5441
5463
|
(e) => {
|
|
5442
5464
|
if (e.key === "Escape") {
|
|
5443
5465
|
if (onClose) {
|
|
@@ -5448,12 +5470,12 @@ var Modal = ({
|
|
|
5448
5470
|
},
|
|
5449
5471
|
[onClose]
|
|
5450
5472
|
);
|
|
5451
|
-
const handleClose = (0,
|
|
5473
|
+
const handleClose = (0, import_react26.useCallback)(() => {
|
|
5452
5474
|
if (onClose) {
|
|
5453
5475
|
onClose();
|
|
5454
5476
|
}
|
|
5455
5477
|
}, [onClose]);
|
|
5456
|
-
(0,
|
|
5478
|
+
(0, import_react26.useEffect)(() => {
|
|
5457
5479
|
if (open) {
|
|
5458
5480
|
document.addEventListener("keyup", handleKeyDown);
|
|
5459
5481
|
}
|
|
@@ -5461,7 +5483,7 @@ var Modal = ({
|
|
|
5461
5483
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5462
5484
|
};
|
|
5463
5485
|
}, [open, handleKeyDown]);
|
|
5464
|
-
(0,
|
|
5486
|
+
(0, import_react26.useEffect)(() => {
|
|
5465
5487
|
if (!open) return;
|
|
5466
5488
|
const scrollY = window.scrollY;
|
|
5467
5489
|
const body = document.body;
|
|
@@ -5482,7 +5504,7 @@ var Modal = ({
|
|
|
5482
5504
|
};
|
|
5483
5505
|
}, [open]);
|
|
5484
5506
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5485
|
-
const backgroundClickHandler = (0,
|
|
5507
|
+
const backgroundClickHandler = (0, import_react26.useCallback)(
|
|
5486
5508
|
(e) => {
|
|
5487
5509
|
const target = e.target;
|
|
5488
5510
|
const currentTarget = e.currentTarget;
|
|
@@ -5591,10 +5613,10 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
|
5591
5613
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5592
5614
|
|
|
5593
5615
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5594
|
-
var
|
|
5616
|
+
var import_react28 = require("react");
|
|
5595
5617
|
|
|
5596
5618
|
// src/components/ImagePlaceholder.tsx
|
|
5597
|
-
var
|
|
5619
|
+
var import_react27 = require("react");
|
|
5598
5620
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5599
5621
|
|
|
5600
5622
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5605,11 +5627,11 @@ var import_clsx32 = __toESM(require("clsx"), 1);
|
|
|
5605
5627
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5606
5628
|
|
|
5607
5629
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5608
|
-
var
|
|
5630
|
+
var import_react29 = require("react");
|
|
5609
5631
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5610
5632
|
|
|
5611
5633
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5612
|
-
var
|
|
5634
|
+
var import_react30 = require("react");
|
|
5613
5635
|
|
|
5614
5636
|
// src/components/Surface.tsx
|
|
5615
5637
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
@@ -5654,17 +5676,17 @@ var import_clsx34 = require("clsx");
|
|
|
5654
5676
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5655
5677
|
|
|
5656
5678
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5657
|
-
var
|
|
5679
|
+
var import_react31 = require("react");
|
|
5658
5680
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5659
5681
|
|
|
5660
5682
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5661
|
-
var
|
|
5683
|
+
var import_react32 = require("react");
|
|
5662
5684
|
|
|
5663
5685
|
// src/components/ProductImagePreview/index.tsx
|
|
5664
5686
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5665
5687
|
|
|
5666
5688
|
// src/components/CompactImagesPreview.tsx
|
|
5667
|
-
var
|
|
5689
|
+
var import_react33 = require("react");
|
|
5668
5690
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
5669
5691
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5670
5692
|
|
|
@@ -5673,12 +5695,12 @@ var import_clsx36 = __toESM(require("clsx"), 1);
|
|
|
5673
5695
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5674
5696
|
|
|
5675
5697
|
// src/components/ListGroup.tsx
|
|
5676
|
-
var
|
|
5698
|
+
var import_react34 = require("react");
|
|
5677
5699
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5678
5700
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5679
5701
|
|
|
5680
5702
|
// src/components/Pagination.tsx
|
|
5681
|
-
var
|
|
5703
|
+
var import_react35 = require("react");
|
|
5682
5704
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5683
5705
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5684
5706
|
var Pagination = ({
|
|
@@ -5690,7 +5712,7 @@ var Pagination = ({
|
|
|
5690
5712
|
className,
|
|
5691
5713
|
disabled
|
|
5692
5714
|
}) => {
|
|
5693
|
-
const goTo = (0,
|
|
5715
|
+
const goTo = (0, import_react35.useCallback)(
|
|
5694
5716
|
(page) => {
|
|
5695
5717
|
if (disabled) return;
|
|
5696
5718
|
onPageChange(page);
|
|
@@ -5707,7 +5729,7 @@ var Pagination = ({
|
|
|
5707
5729
|
goTo(currentPage + 1);
|
|
5708
5730
|
}
|
|
5709
5731
|
};
|
|
5710
|
-
const pageTokens = (0,
|
|
5732
|
+
const pageTokens = (0, import_react35.useMemo)(() => {
|
|
5711
5733
|
if (totalPages <= 5) {
|
|
5712
5734
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5713
5735
|
}
|
|
@@ -5830,21 +5852,21 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
5830
5852
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5831
5853
|
|
|
5832
5854
|
// src/components/SearchResultImage/index.tsx
|
|
5833
|
-
var
|
|
5855
|
+
var import_react36 = require("react");
|
|
5834
5856
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5835
5857
|
|
|
5836
5858
|
// src/components/Alert.tsx
|
|
5837
5859
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
5838
|
-
var
|
|
5860
|
+
var import_react37 = require("react");
|
|
5839
5861
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5840
5862
|
|
|
5841
5863
|
// src/components/OrderCheckIcon.tsx
|
|
5842
5864
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5843
5865
|
|
|
5844
5866
|
// src/components/EditingContext.tsx
|
|
5845
|
-
var
|
|
5867
|
+
var import_react38 = require("react");
|
|
5846
5868
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5847
|
-
var EditingContext = (0,
|
|
5869
|
+
var EditingContext = (0, import_react38.createContext)(null);
|
|
5848
5870
|
|
|
5849
5871
|
// src/components/AccessCard.tsx
|
|
5850
5872
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
@@ -5978,7 +6000,7 @@ var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
|
5978
6000
|
|
|
5979
6001
|
// src/components/AccessCardGroup.tsx
|
|
5980
6002
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
5981
|
-
var
|
|
6003
|
+
var import_react39 = require("react");
|
|
5982
6004
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5983
6005
|
|
|
5984
6006
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
@@ -5989,7 +6011,7 @@ function ColumnSelectorMenuOption({
|
|
|
5989
6011
|
column,
|
|
5990
6012
|
toggleColumnVisibility
|
|
5991
6013
|
}) {
|
|
5992
|
-
const [isVisible, setIsVisible] = (0,
|
|
6014
|
+
const [isVisible, setIsVisible] = (0, import_react40.useState)(column.getIsVisible());
|
|
5993
6015
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
5994
6016
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5995
6017
|
Checkbox,
|