@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
|
@@ -64,7 +64,7 @@ __export(TableBodyRow_exports, {
|
|
|
64
64
|
module.exports = __toCommonJS(TableBodyRow_exports);
|
|
65
65
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
66
66
|
var import_react_table3 = require("@tanstack/react-table");
|
|
67
|
-
var
|
|
67
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
68
68
|
|
|
69
69
|
// src/components/DataGridCell.tsx
|
|
70
70
|
var import_sortable = require("@dnd-kit/sortable");
|
|
@@ -119,7 +119,7 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
119
119
|
|
|
120
120
|
// src/components/DataGridCell.tsx
|
|
121
121
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
122
|
-
var
|
|
122
|
+
var import_react12 = require("react");
|
|
123
123
|
|
|
124
124
|
// src/classNames.ts
|
|
125
125
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -263,7 +263,7 @@ var gapUsingContainerPadding = (0, import_clsx.default)(
|
|
|
263
263
|
|
|
264
264
|
// src/components/MenuOption.tsx
|
|
265
265
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
266
|
-
var
|
|
266
|
+
var import_react7 = require("react");
|
|
267
267
|
|
|
268
268
|
// src/components/Label.tsx
|
|
269
269
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
@@ -597,11 +597,24 @@ function formatDate(date) {
|
|
|
597
597
|
|
|
598
598
|
// src/utils/mergeObjectArrays.ts
|
|
599
599
|
function mergeObjectArrays(arr1, arr2) {
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
600
|
+
const arr2Map = /* @__PURE__ */ new Map();
|
|
601
|
+
for (const item of arr2) {
|
|
602
|
+
const id = item.id;
|
|
603
|
+
if (id !== void 0) {
|
|
604
|
+
arr2Map.set(id, item);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
return arr1.map((item1) => {
|
|
608
|
+
const id = item1.id;
|
|
609
|
+
if (id !== void 0 && arr2Map.has(id)) {
|
|
610
|
+
const item2 = arr2Map.get(id);
|
|
611
|
+
const meta1 = item1.meta;
|
|
612
|
+
const meta2 = item2.meta;
|
|
613
|
+
const mergedMeta = meta1 && meta2 && typeof meta1 === "object" && typeof meta2 === "object" ? __spreadValues(__spreadValues({}, meta1), meta2) : meta2 != null ? meta2 : meta1;
|
|
614
|
+
return __spreadProps(__spreadValues(__spreadValues({}, item1), item2), { meta: mergedMeta });
|
|
615
|
+
}
|
|
616
|
+
return item1;
|
|
617
|
+
});
|
|
605
618
|
}
|
|
606
619
|
|
|
607
620
|
// src/utils/index.ts
|
|
@@ -637,52 +650,58 @@ var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
|
|
|
637
650
|
function useTableLayout(initialColumns, key, autosync = true) {
|
|
638
651
|
const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
|
|
639
652
|
const [isReady, setIsReady] = (0, import_react5.useState)(false);
|
|
640
|
-
const
|
|
653
|
+
const isReadyRef = (0, import_react5.useRef)(false);
|
|
654
|
+
const keyRef = (0, import_react5.useRef)(key);
|
|
655
|
+
(0, import_react5.useEffect)(() => {
|
|
656
|
+
isReadyRef.current = isReady;
|
|
657
|
+
keyRef.current = key;
|
|
658
|
+
}, [isReady, key]);
|
|
641
659
|
const handleSaveLayout = (0, import_react5.useCallback)(
|
|
642
660
|
(setter, _internal) => {
|
|
643
|
-
if (!
|
|
661
|
+
if (!isReadyRef.current && !_internal || !keyRef.current) return;
|
|
644
662
|
setColumns((prevColumns) => {
|
|
645
663
|
const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
|
|
646
|
-
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
|
|
664
|
+
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal) {
|
|
647
665
|
return prevColumns;
|
|
666
|
+
}
|
|
648
667
|
localStorage.setItem(
|
|
649
|
-
getLocalStorageKeyWithPrefix(`${
|
|
668
|
+
getLocalStorageKeyWithPrefix(`${keyRef.current}-tableLayout`),
|
|
650
669
|
JSON.stringify(newColumns)
|
|
651
670
|
);
|
|
652
671
|
return newColumns;
|
|
653
672
|
});
|
|
654
673
|
},
|
|
655
|
-
[
|
|
674
|
+
[]
|
|
656
675
|
);
|
|
657
676
|
(0, import_react5.useEffect)(() => {
|
|
658
677
|
if (!autosync) return;
|
|
659
|
-
if (!key)
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
`useTableLayout should only be called once per component render cycle.
|
|
663
|
-
${renderCountRef.current} Renders detected.
|
|
664
|
-
Check dependency stability`
|
|
665
|
-
);
|
|
678
|
+
if (!key) {
|
|
679
|
+
setIsReady(true);
|
|
680
|
+
return;
|
|
666
681
|
}
|
|
667
|
-
renderCountRef.current += 1;
|
|
668
682
|
const savedLayout = localStorage.getItem(
|
|
669
683
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
670
684
|
);
|
|
671
685
|
if (savedLayout) {
|
|
672
|
-
|
|
686
|
+
setColumns(
|
|
673
687
|
mergeObjectArrays(
|
|
674
688
|
initialColumns,
|
|
675
689
|
JSON.parse(savedLayout)
|
|
676
|
-
)
|
|
677
|
-
|
|
690
|
+
)
|
|
691
|
+
);
|
|
692
|
+
} else {
|
|
693
|
+
localStorage.setItem(
|
|
694
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
695
|
+
JSON.stringify(initialColumns)
|
|
678
696
|
);
|
|
697
|
+
setColumns((prev) => {
|
|
698
|
+
if (JSON.stringify(initialColumns) === JSON.stringify(prev))
|
|
699
|
+
return prev;
|
|
700
|
+
return initialColumns;
|
|
701
|
+
});
|
|
679
702
|
}
|
|
680
|
-
if (!savedLayout) handleSaveLayout(initialColumns, true);
|
|
681
703
|
setIsReady(true);
|
|
682
|
-
|
|
683
|
-
renderCountRef.current = 0;
|
|
684
|
-
};
|
|
685
|
-
}, [handleSaveLayout, initialColumns, key, autosync]);
|
|
704
|
+
}, [initialColumns, key, autosync]);
|
|
686
705
|
const getSavedLayout = (0, import_react5.useCallback)(() => {
|
|
687
706
|
const savedLayout = localStorage.getItem(
|
|
688
707
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
@@ -694,6 +713,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
694
713
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
695
714
|
}
|
|
696
715
|
|
|
716
|
+
// src/hooks/useEditCell.tsx
|
|
717
|
+
var import_react6 = require("react");
|
|
718
|
+
|
|
697
719
|
// src/components/Caption.tsx
|
|
698
720
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
699
721
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -845,12 +867,12 @@ var MenuOption = ({
|
|
|
845
867
|
onMouseMove,
|
|
846
868
|
small = false
|
|
847
869
|
}) => {
|
|
848
|
-
const uniqueId = (0,
|
|
849
|
-
const internalRef = (0,
|
|
870
|
+
const uniqueId = (0, import_react7.useId)();
|
|
871
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
850
872
|
const actualRef = ref || internalRef;
|
|
851
|
-
const menuId = (0,
|
|
873
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
852
874
|
const isMobile = useMatchesMobile();
|
|
853
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
875
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
854
876
|
const handleMouseEnter = () => {
|
|
855
877
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
856
878
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1010,27 +1032,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1010
1032
|
|
|
1011
1033
|
// src/components/Menu.tsx
|
|
1012
1034
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
1013
|
-
var
|
|
1035
|
+
var import_react9 = require("react");
|
|
1014
1036
|
var import_react_dom = require("react-dom");
|
|
1015
1037
|
|
|
1016
1038
|
// src/components/useMenuSystem.tsx
|
|
1017
|
-
var
|
|
1039
|
+
var import_react8 = require("react");
|
|
1018
1040
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1019
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1041
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1020
1042
|
{}
|
|
1021
1043
|
);
|
|
1022
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1023
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1044
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1045
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1024
1046
|
null
|
|
1025
1047
|
);
|
|
1026
|
-
const menuRootRef = (0,
|
|
1027
|
-
const subMenuRefs = (0,
|
|
1028
|
-
const hoverTimeoutRef = (0,
|
|
1029
|
-
const closeTimeoutRef = (0,
|
|
1030
|
-
const mouseStopTimeoutRef = (0,
|
|
1031
|
-
const isMouseMovingRef = (0,
|
|
1032
|
-
const pendingOpenActionRef = (0,
|
|
1033
|
-
const pendingCloseActionRef = (0,
|
|
1048
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1049
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1050
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1051
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1052
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1053
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1054
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1055
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1034
1056
|
const isMobile = useMatchesMobile();
|
|
1035
1057
|
const toggleMenu = (menuId, level) => {
|
|
1036
1058
|
if (closeTimeoutRef.current) {
|
|
@@ -1070,7 +1092,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1070
1092
|
return newActiveMenus;
|
|
1071
1093
|
});
|
|
1072
1094
|
};
|
|
1073
|
-
const executePendingActions = (0,
|
|
1095
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1074
1096
|
if (pendingCloseActionRef.current) {
|
|
1075
1097
|
pendingCloseActionRef.current();
|
|
1076
1098
|
pendingCloseActionRef.current = null;
|
|
@@ -1159,7 +1181,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1159
1181
|
const isMenuActive = (menuId, level) => {
|
|
1160
1182
|
return activeMenus[level] === menuId;
|
|
1161
1183
|
};
|
|
1162
|
-
(0,
|
|
1184
|
+
(0, import_react8.useEffect)(() => {
|
|
1163
1185
|
const handleClickOutside = (event) => {
|
|
1164
1186
|
var _a;
|
|
1165
1187
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1178,7 +1200,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1178
1200
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1179
1201
|
};
|
|
1180
1202
|
}, [activeMenus]);
|
|
1181
|
-
(0,
|
|
1203
|
+
(0, import_react8.useEffect)(() => {
|
|
1182
1204
|
return () => {
|
|
1183
1205
|
if (hoverTimeoutRef.current) {
|
|
1184
1206
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1256,13 +1278,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1256
1278
|
};
|
|
1257
1279
|
}
|
|
1258
1280
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1259
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1281
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1260
1282
|
top: 0,
|
|
1261
1283
|
left: 0,
|
|
1262
1284
|
minWidth: 0
|
|
1263
1285
|
});
|
|
1264
1286
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1265
|
-
const updatePosition = (0,
|
|
1287
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1266
1288
|
var _a, _b, _c;
|
|
1267
1289
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1268
1290
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1310,7 +1332,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1310
1332
|
minWidth: triggerRect.width
|
|
1311
1333
|
});
|
|
1312
1334
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1313
|
-
(0,
|
|
1335
|
+
(0, import_react8.useEffect)(() => {
|
|
1314
1336
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1315
1337
|
const handleClickOutside = (event) => {
|
|
1316
1338
|
var _a, _b, _c, _d, _e;
|
|
@@ -1336,7 +1358,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1336
1358
|
options == null ? void 0 : options.menuRef,
|
|
1337
1359
|
options == null ? void 0 : options.additionalRefs
|
|
1338
1360
|
]);
|
|
1339
|
-
(0,
|
|
1361
|
+
(0, import_react8.useEffect)(() => {
|
|
1340
1362
|
updatePosition();
|
|
1341
1363
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1342
1364
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1417,9 +1439,9 @@ var Menu = (_a) => {
|
|
|
1417
1439
|
"menuName",
|
|
1418
1440
|
"calculateMinMaxHeight"
|
|
1419
1441
|
]);
|
|
1420
|
-
const internalRef = (0,
|
|
1442
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1421
1443
|
const actualRef = ref || internalRef;
|
|
1422
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1444
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1423
1445
|
const isMobile = useMatchesMobile();
|
|
1424
1446
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1425
1447
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1432,7 +1454,7 @@ var Menu = (_a) => {
|
|
|
1432
1454
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1433
1455
|
}
|
|
1434
1456
|
);
|
|
1435
|
-
(0,
|
|
1457
|
+
(0, import_react9.useEffect)(() => {
|
|
1436
1458
|
if (calculateMinMaxHeight) {
|
|
1437
1459
|
return;
|
|
1438
1460
|
}
|
|
@@ -1456,7 +1478,7 @@ var Menu = (_a) => {
|
|
|
1456
1478
|
cancelAnimationFrame(raf);
|
|
1457
1479
|
};
|
|
1458
1480
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1459
|
-
(0,
|
|
1481
|
+
(0, import_react9.useEffect)(() => {
|
|
1460
1482
|
if (!calculateMinMaxHeight) {
|
|
1461
1483
|
return;
|
|
1462
1484
|
}
|
|
@@ -1467,14 +1489,14 @@ var Menu = (_a) => {
|
|
|
1467
1489
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1468
1490
|
}
|
|
1469
1491
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1470
|
-
(0,
|
|
1492
|
+
(0, import_react9.useEffect)(() => {
|
|
1471
1493
|
if (!show) {
|
|
1472
1494
|
return;
|
|
1473
1495
|
}
|
|
1474
1496
|
initializeMenuFocus();
|
|
1475
1497
|
updatePosition();
|
|
1476
1498
|
}, [show, updatePosition]);
|
|
1477
|
-
(0,
|
|
1499
|
+
(0, import_react9.useEffect)(() => {
|
|
1478
1500
|
if (!show || !setShow) {
|
|
1479
1501
|
return;
|
|
1480
1502
|
}
|
|
@@ -1628,10 +1650,10 @@ var Menu = (_a) => {
|
|
|
1628
1650
|
Menu.displayName = "Menu";
|
|
1629
1651
|
|
|
1630
1652
|
// src/components/Search.tsx
|
|
1631
|
-
var
|
|
1653
|
+
var import_react11 = require("react");
|
|
1632
1654
|
|
|
1633
1655
|
// src/components/Input.tsx
|
|
1634
|
-
var
|
|
1656
|
+
var import_react10 = require("react");
|
|
1635
1657
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1636
1658
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1637
1659
|
var InputBase = (_a) => {
|
|
@@ -1688,9 +1710,9 @@ var InputBase = (_a) => {
|
|
|
1688
1710
|
"data-error": error && !focus || null,
|
|
1689
1711
|
"data-focus": focus || null
|
|
1690
1712
|
};
|
|
1691
|
-
const inputRef = (0,
|
|
1713
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
1692
1714
|
const inputId = id ? `${id}-input` : void 0;
|
|
1693
|
-
(0,
|
|
1715
|
+
(0, import_react10.useEffect)(() => {
|
|
1694
1716
|
var _a2;
|
|
1695
1717
|
const input = inputRef.current;
|
|
1696
1718
|
const focusHandler = () => {
|
|
@@ -1849,15 +1871,15 @@ var Input = (_a) => {
|
|
|
1849
1871
|
"testid",
|
|
1850
1872
|
"rightAdornment"
|
|
1851
1873
|
]);
|
|
1852
|
-
const [internalValue, setInternalValue] = (0,
|
|
1853
|
-
const [displayValue, setDisplayValue] = (0,
|
|
1854
|
-
(0,
|
|
1874
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1875
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1876
|
+
(0, import_react10.useEffect)(() => {
|
|
1855
1877
|
var _a2;
|
|
1856
1878
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
1857
1879
|
setInternalValue(stringValue);
|
|
1858
1880
|
setDisplayValue(stringValue);
|
|
1859
1881
|
}, [propValue]);
|
|
1860
|
-
(0,
|
|
1882
|
+
(0, import_react10.useEffect)(() => {
|
|
1861
1883
|
var _a2;
|
|
1862
1884
|
if (variant !== "currency") {
|
|
1863
1885
|
return;
|
|
@@ -2118,14 +2140,14 @@ var Search = (_a) => {
|
|
|
2118
2140
|
"removeRoundness",
|
|
2119
2141
|
"autocompletePadding"
|
|
2120
2142
|
]);
|
|
2121
|
-
const inputRef = (0,
|
|
2122
|
-
const inputContainerRef = (0,
|
|
2123
|
-
const preventFocusOnInitialRender = (0,
|
|
2124
|
-
const [show, setShow] = (0,
|
|
2125
|
-
const [clearing, setClearing] = (0,
|
|
2126
|
-
const uniqueId = (0,
|
|
2143
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2144
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2145
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2146
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2147
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2148
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2127
2149
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2128
|
-
(0,
|
|
2150
|
+
(0, import_react11.useEffect)(() => {
|
|
2129
2151
|
var _a2;
|
|
2130
2152
|
if (preventFocusOnInitialRender.current) {
|
|
2131
2153
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2209,7 +2231,7 @@ Search.displayName = "Search";
|
|
|
2209
2231
|
|
|
2210
2232
|
// src/components/DataGridCell.tsx
|
|
2211
2233
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2212
|
-
var DataGridCell = (0,
|
|
2234
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2213
2235
|
(_a) => {
|
|
2214
2236
|
var _b = _a, {
|
|
2215
2237
|
id,
|
|
@@ -2251,10 +2273,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2251
2273
|
"testid"
|
|
2252
2274
|
]);
|
|
2253
2275
|
const Element = type === "header" ? "th" : "td";
|
|
2254
|
-
const timerRef = (0,
|
|
2255
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2256
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2257
|
-
(0,
|
|
2276
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2277
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2278
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2279
|
+
(0, import_react12.useEffect)(() => {
|
|
2258
2280
|
return () => {
|
|
2259
2281
|
if (timerRef.current) {
|
|
2260
2282
|
clearTimeout(timerRef.current);
|
|
@@ -2364,12 +2386,12 @@ function DataCellHeader(_a) {
|
|
|
2364
2386
|
"useMenuDefaultMinWidth"
|
|
2365
2387
|
]);
|
|
2366
2388
|
var _a2;
|
|
2367
|
-
const [showMenu, setShowMenu] = (0,
|
|
2368
|
-
const [filter, setFilter] = (0,
|
|
2389
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2390
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2369
2391
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2370
2392
|
);
|
|
2371
|
-
const ref = (0,
|
|
2372
|
-
const predeterminedPinned = (0,
|
|
2393
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2394
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2373
2395
|
const { column, getContext } = header;
|
|
2374
2396
|
const { id: columnId, setFilterValue } = column;
|
|
2375
2397
|
const {
|
|
@@ -2379,14 +2401,14 @@ function DataCellHeader(_a) {
|
|
|
2379
2401
|
listeners: subMenuListeners,
|
|
2380
2402
|
mobileHide
|
|
2381
2403
|
} = useSubMenuSystem(node ? node : ref);
|
|
2382
|
-
(0,
|
|
2404
|
+
(0, import_react12.useEffect)(() => {
|
|
2383
2405
|
var _a3, _b2, _c;
|
|
2384
2406
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2385
2407
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2386
2408
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2387
2409
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2388
2410
|
}, [columnId, getContext]);
|
|
2389
|
-
(0,
|
|
2411
|
+
(0, import_react12.useEffect)(() => {
|
|
2390
2412
|
const handler = setTimeout(() => {
|
|
2391
2413
|
setFilterValue(filter);
|
|
2392
2414
|
}, 500);
|
|
@@ -2649,7 +2671,7 @@ function DragAlongCell(_a) {
|
|
|
2649
2671
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2650
2672
|
|
|
2651
2673
|
// src/components/DataGrid/index.tsx
|
|
2652
|
-
var
|
|
2674
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2653
2675
|
var import_react_table2 = require("@tanstack/react-table");
|
|
2654
2676
|
var import_core = require("@dnd-kit/core");
|
|
2655
2677
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -2677,7 +2699,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
2677
2699
|
}
|
|
2678
2700
|
|
|
2679
2701
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
2680
|
-
var
|
|
2702
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
2681
2703
|
|
|
2682
2704
|
// src/components/DataGrid/TableBody/index.tsx
|
|
2683
2705
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -2862,10 +2884,10 @@ function TableBody({
|
|
|
2862
2884
|
}
|
|
2863
2885
|
|
|
2864
2886
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
2865
|
-
var
|
|
2887
|
+
var import_react14 = require("react");
|
|
2866
2888
|
|
|
2867
2889
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
2868
|
-
var
|
|
2890
|
+
var import_react13 = require("react");
|
|
2869
2891
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2870
2892
|
function ColumnSelectorMenuOption({
|
|
2871
2893
|
id,
|
|
@@ -2873,7 +2895,7 @@ function ColumnSelectorMenuOption({
|
|
|
2873
2895
|
column,
|
|
2874
2896
|
toggleColumnVisibility
|
|
2875
2897
|
}) {
|
|
2876
|
-
const [isVisible, setIsVisible] = (0,
|
|
2898
|
+
const [isVisible, setIsVisible] = (0, import_react13.useState)(column.getIsVisible());
|
|
2877
2899
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
2878
2900
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2879
2901
|
Checkbox,
|
|
@@ -2899,8 +2921,8 @@ function ColumnSelectorHeaderCell({
|
|
|
2899
2921
|
toggleColumnVisibility,
|
|
2900
2922
|
resetColumnVisibility
|
|
2901
2923
|
}) {
|
|
2902
|
-
const ref = (0,
|
|
2903
|
-
const [show, setShow] = (0,
|
|
2924
|
+
const ref = (0, import_react14.useRef)(null);
|
|
2925
|
+
const [show, setShow] = (0, import_react14.useState)(false);
|
|
2904
2926
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2905
2927
|
DataGridCell,
|
|
2906
2928
|
{
|
|
@@ -3069,7 +3091,7 @@ function PinnedColumns(_a) {
|
|
|
3069
3091
|
header.id
|
|
3070
3092
|
);
|
|
3071
3093
|
}
|
|
3072
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3094
|
+
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)(
|
|
3073
3095
|
Checkbox,
|
|
3074
3096
|
{
|
|
3075
3097
|
checked: allSelectedAcrossPages,
|
|
@@ -3151,23 +3173,23 @@ function DataGrid({
|
|
|
3151
3173
|
ref
|
|
3152
3174
|
}) {
|
|
3153
3175
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3154
|
-
(0,
|
|
3176
|
+
(0, import_react16.useImperativeHandle)(ref, () => ({
|
|
3155
3177
|
getSavedLayout: () => {
|
|
3156
3178
|
return getSavedLayout();
|
|
3157
3179
|
}
|
|
3158
3180
|
}));
|
|
3159
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3160
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3161
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3181
|
+
const [localSorting, setLocalSorting] = (0, import_react16.useState)([]);
|
|
3182
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react16.useState)([]);
|
|
3183
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react16.useState)({});
|
|
3162
3184
|
const {
|
|
3163
3185
|
columns: tableColumns,
|
|
3164
3186
|
setColumns: setTableColumns,
|
|
3165
3187
|
getSavedLayout
|
|
3166
3188
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3167
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3189
|
+
const [columnOrder, setColumnOrder] = (0, import_react16.useState)(
|
|
3168
3190
|
tableColumns.map((c) => c.id)
|
|
3169
3191
|
);
|
|
3170
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3192
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react16.useState)(
|
|
3171
3193
|
Object.fromEntries(
|
|
3172
3194
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3173
3195
|
var _a2, _b2;
|
|
@@ -3175,7 +3197,7 @@ function DataGrid({
|
|
|
3175
3197
|
})
|
|
3176
3198
|
)
|
|
3177
3199
|
);
|
|
3178
|
-
const updateColumnVisibility = (0,
|
|
3200
|
+
const updateColumnVisibility = (0, import_react16.useCallback)(
|
|
3179
3201
|
(updateOrder) => {
|
|
3180
3202
|
setColumnVisibility(
|
|
3181
3203
|
Object.fromEntries(
|
|
@@ -3189,7 +3211,7 @@ function DataGrid({
|
|
|
3189
3211
|
},
|
|
3190
3212
|
[tableColumns]
|
|
3191
3213
|
);
|
|
3192
|
-
const resetDefaultColumnVisibility = (0,
|
|
3214
|
+
const resetDefaultColumnVisibility = (0, import_react16.useCallback)(() => {
|
|
3193
3215
|
setTableColumns((prev) => {
|
|
3194
3216
|
columns.forEach((column) => {
|
|
3195
3217
|
var _a2, _b2;
|
|
@@ -3205,7 +3227,7 @@ function DataGrid({
|
|
|
3205
3227
|
return [...prev];
|
|
3206
3228
|
}, true);
|
|
3207
3229
|
}, [columns, setTableColumns]);
|
|
3208
|
-
(0,
|
|
3230
|
+
(0, import_react16.useEffect)(() => {
|
|
3209
3231
|
updateColumnVisibility(true);
|
|
3210
3232
|
}, [updateColumnVisibility]);
|
|
3211
3233
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3221,7 +3243,7 @@ function DataGrid({
|
|
|
3221
3243
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3222
3244
|
} : setLocalColumnFilters;
|
|
3223
3245
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3224
|
-
const setRowSelection = (0,
|
|
3246
|
+
const setRowSelection = (0, import_react16.useCallback)(
|
|
3225
3247
|
(updaterOrValue) => {
|
|
3226
3248
|
if (pagination) {
|
|
3227
3249
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3235,9 +3257,9 @@ function DataGrid({
|
|
|
3235
3257
|
},
|
|
3236
3258
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3237
3259
|
);
|
|
3238
|
-
const dndId = (0,
|
|
3239
|
-
const containerRef =
|
|
3240
|
-
const toggleColumnVisibility = (0,
|
|
3260
|
+
const dndId = (0, import_react16.useId)();
|
|
3261
|
+
const containerRef = import_react16.default.useRef(null);
|
|
3262
|
+
const toggleColumnVisibility = (0, import_react16.useCallback)(
|
|
3241
3263
|
(columnId, isVisible) => {
|
|
3242
3264
|
setTableColumns((prev) => {
|
|
3243
3265
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3485,7 +3507,7 @@ function DataGrid({
|
|
|
3485
3507
|
header.id
|
|
3486
3508
|
);
|
|
3487
3509
|
}
|
|
3488
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3510
|
+
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)(
|
|
3489
3511
|
DataGridCell,
|
|
3490
3512
|
{
|
|
3491
3513
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3691,7 +3713,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3691
3713
|
}
|
|
3692
3714
|
|
|
3693
3715
|
// src/components/Select.tsx
|
|
3694
|
-
var
|
|
3716
|
+
var import_react17 = require("react");
|
|
3695
3717
|
var import_clsx14 = __toESM(require("clsx"), 1);
|
|
3696
3718
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3697
3719
|
var Select = (_a) => {
|
|
@@ -3725,11 +3747,11 @@ var Select = (_a) => {
|
|
|
3725
3747
|
"value"
|
|
3726
3748
|
]);
|
|
3727
3749
|
var _a2;
|
|
3728
|
-
const inputRef = (0,
|
|
3729
|
-
const inputContainerRef = (0,
|
|
3730
|
-
const preventFocusOnInitialRender = (0,
|
|
3731
|
-
const [show, setShow] = (0,
|
|
3732
|
-
(0,
|
|
3750
|
+
const inputRef = (0, import_react17.useRef)(null);
|
|
3751
|
+
const inputContainerRef = (0, import_react17.useRef)(null);
|
|
3752
|
+
const preventFocusOnInitialRender = (0, import_react17.useRef)(true);
|
|
3753
|
+
const [show, setShow] = (0, import_react17.useState)(false);
|
|
3754
|
+
(0, import_react17.useEffect)(() => {
|
|
3733
3755
|
var _a3;
|
|
3734
3756
|
if (preventFocusOnInitialRender.current) {
|
|
3735
3757
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4151,7 +4173,7 @@ Button.displayName = "Button";
|
|
|
4151
4173
|
|
|
4152
4174
|
// src/components/Tooltip.tsx
|
|
4153
4175
|
var import_clsx18 = __toESM(require("clsx"), 1);
|
|
4154
|
-
var
|
|
4176
|
+
var import_react18 = require("react");
|
|
4155
4177
|
var import_react_dom2 = require("react-dom");
|
|
4156
4178
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4157
4179
|
var Tooltip = ({
|
|
@@ -4164,11 +4186,11 @@ var Tooltip = ({
|
|
|
4164
4186
|
offset = 8,
|
|
4165
4187
|
keepHidden = false
|
|
4166
4188
|
}) => {
|
|
4167
|
-
const ref = (0,
|
|
4168
|
-
const tooltipRef = (0,
|
|
4169
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4170
|
-
const [isVisible, setIsVisible] = (0,
|
|
4171
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4189
|
+
const ref = (0, import_react18.useRef)(null);
|
|
4190
|
+
const tooltipRef = (0, import_react18.useRef)(null);
|
|
4191
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react18.useState)({ top: 0, left: 0 });
|
|
4192
|
+
const [isVisible, setIsVisible] = (0, import_react18.useState)(false);
|
|
4193
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react18.useState)(false);
|
|
4172
4194
|
const updatePosition = () => {
|
|
4173
4195
|
if (!ref.current || !tooltipRef.current) return;
|
|
4174
4196
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4207,14 +4229,14 @@ var Tooltip = ({
|
|
|
4207
4229
|
setIsVisible(false);
|
|
4208
4230
|
setRemoveOpacity(false);
|
|
4209
4231
|
};
|
|
4210
|
-
(0,
|
|
4232
|
+
(0, import_react18.useEffect)(() => {
|
|
4211
4233
|
if (isVisible && tooltipRef.current) {
|
|
4212
4234
|
requestAnimationFrame(() => {
|
|
4213
4235
|
updatePosition();
|
|
4214
4236
|
});
|
|
4215
4237
|
}
|
|
4216
4238
|
}, [isVisible]);
|
|
4217
|
-
(0,
|
|
4239
|
+
(0, import_react18.useEffect)(() => {
|
|
4218
4240
|
if (isVisible) {
|
|
4219
4241
|
window.addEventListener("resize", updatePosition);
|
|
4220
4242
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4272,12 +4294,12 @@ var Tooltip = ({
|
|
|
4272
4294
|
Tooltip.displayName = "Tooltip";
|
|
4273
4295
|
|
|
4274
4296
|
// src/components/DateInput.tsx
|
|
4275
|
-
var
|
|
4297
|
+
var import_react20 = require("react");
|
|
4276
4298
|
var import_react_dom3 = require("react-dom");
|
|
4277
4299
|
|
|
4278
4300
|
// src/components/CalendarRange.tsx
|
|
4279
4301
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4280
|
-
var
|
|
4302
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
4281
4303
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4282
4304
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4283
4305
|
function DateCell(_a) {
|
|
@@ -4390,20 +4412,20 @@ function CalendarRange({
|
|
|
4390
4412
|
const fromDate = parseDate(from);
|
|
4391
4413
|
const toDate = parseDate(to);
|
|
4392
4414
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4393
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4415
|
+
const [baseMonth, setBaseMonth] = (0, import_react19.useState)(
|
|
4394
4416
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4395
4417
|
);
|
|
4396
|
-
const [selecting, setSelecting] = (0,
|
|
4397
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4398
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4399
|
-
(0,
|
|
4418
|
+
const [selecting, setSelecting] = (0, import_react19.useState)("from");
|
|
4419
|
+
const [pendingFrom, setPendingFrom] = (0, import_react19.useState)(void 0);
|
|
4420
|
+
const [hoveredDate, setHoveredDate] = (0, import_react19.useState)(void 0);
|
|
4421
|
+
(0, import_react19.useEffect)(() => {
|
|
4400
4422
|
if (fromDate) {
|
|
4401
4423
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4402
4424
|
} else if (toDate) {
|
|
4403
4425
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4404
4426
|
}
|
|
4405
4427
|
}, [from, to]);
|
|
4406
|
-
(0,
|
|
4428
|
+
(0, import_react19.useEffect)(() => {
|
|
4407
4429
|
if (fromDate && toDate) {
|
|
4408
4430
|
setSelecting("from");
|
|
4409
4431
|
setPendingFrom(void 0);
|
|
@@ -4549,14 +4571,14 @@ function CalendarPane({
|
|
|
4549
4571
|
const years = Array.from({ length: 100 }).map(
|
|
4550
4572
|
(_, i) => baseMonth.year - 50 + i
|
|
4551
4573
|
);
|
|
4552
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4553
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4554
|
-
const monthMenuRef = (0,
|
|
4555
|
-
const yearMenuRef = (0,
|
|
4574
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react19.useState)(false);
|
|
4575
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react19.useState)(false);
|
|
4576
|
+
const monthMenuRef = (0, import_react19.useRef)(null);
|
|
4577
|
+
const yearMenuRef = (0, import_react19.useRef)(null);
|
|
4556
4578
|
const month = getMonthData(offset);
|
|
4557
4579
|
const totalCells = 42;
|
|
4558
4580
|
const emptyCells = month.firstDayOffset;
|
|
4559
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react19.default.Fragment, { children: [
|
|
4560
4582
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4561
4583
|
"div",
|
|
4562
4584
|
{
|
|
@@ -4764,24 +4786,24 @@ var DateInput = (_a) => {
|
|
|
4764
4786
|
"label",
|
|
4765
4787
|
"isDateAvailable"
|
|
4766
4788
|
]);
|
|
4767
|
-
const [visible, setVisible] = (0,
|
|
4768
|
-
const [inputValue, setInputValue] = (0,
|
|
4769
|
-
const [isTyping, setIsTyping] = (0,
|
|
4770
|
-
const popoverRef = (0,
|
|
4771
|
-
const triggerRef = (0,
|
|
4772
|
-
const rootRef = (0,
|
|
4773
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4789
|
+
const [visible, setVisible] = (0, import_react20.useState)(false);
|
|
4790
|
+
const [inputValue, setInputValue] = (0, import_react20.useState)("");
|
|
4791
|
+
const [isTyping, setIsTyping] = (0, import_react20.useState)(false);
|
|
4792
|
+
const popoverRef = (0, import_react20.useRef)(null);
|
|
4793
|
+
const triggerRef = (0, import_react20.useRef)(null);
|
|
4794
|
+
const rootRef = (0, import_react20.useRef)(null);
|
|
4795
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react20.useState)({
|
|
4774
4796
|
top: 0,
|
|
4775
4797
|
left: 0,
|
|
4776
4798
|
width: 0
|
|
4777
4799
|
});
|
|
4778
4800
|
const [from, to] = [value, ""];
|
|
4779
|
-
(0,
|
|
4801
|
+
(0, import_react20.useEffect)(() => {
|
|
4780
4802
|
if (!isTyping) {
|
|
4781
4803
|
setInputValue(formatDisplayValue(from));
|
|
4782
4804
|
}
|
|
4783
4805
|
}, [from, isTyping]);
|
|
4784
|
-
(0,
|
|
4806
|
+
(0, import_react20.useLayoutEffect)(() => {
|
|
4785
4807
|
if (visible) {
|
|
4786
4808
|
updatePosition();
|
|
4787
4809
|
}
|
|
@@ -4796,7 +4818,7 @@ var DateInput = (_a) => {
|
|
|
4796
4818
|
});
|
|
4797
4819
|
}
|
|
4798
4820
|
};
|
|
4799
|
-
(0,
|
|
4821
|
+
(0, import_react20.useEffect)(() => {
|
|
4800
4822
|
updatePosition();
|
|
4801
4823
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4802
4824
|
if (triggerRef.current) {
|
|
@@ -4808,7 +4830,7 @@ var DateInput = (_a) => {
|
|
|
4808
4830
|
window.removeEventListener("scroll", updatePosition);
|
|
4809
4831
|
};
|
|
4810
4832
|
}, []);
|
|
4811
|
-
(0,
|
|
4833
|
+
(0, import_react20.useEffect)(() => {
|
|
4812
4834
|
const handleKeyDown2 = (event) => {
|
|
4813
4835
|
var _a2;
|
|
4814
4836
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4821,7 +4843,7 @@ var DateInput = (_a) => {
|
|
|
4821
4843
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4822
4844
|
};
|
|
4823
4845
|
});
|
|
4824
|
-
(0,
|
|
4846
|
+
(0, import_react20.useEffect)(() => {
|
|
4825
4847
|
const handleClickOutside = (event) => {
|
|
4826
4848
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4827
4849
|
setVisible(false);
|
|
@@ -5042,14 +5064,14 @@ Heading3.displayName = "Heading3";
|
|
|
5042
5064
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5043
5065
|
|
|
5044
5066
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5045
|
-
var
|
|
5067
|
+
var import_react23 = require("react");
|
|
5046
5068
|
|
|
5047
5069
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5048
|
-
var
|
|
5070
|
+
var import_react22 = require("react");
|
|
5049
5071
|
|
|
5050
5072
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5051
|
-
var
|
|
5052
|
-
var GridContext = (0,
|
|
5073
|
+
var import_react21 = require("react");
|
|
5074
|
+
var GridContext = (0, import_react21.createContext)(null);
|
|
5053
5075
|
|
|
5054
5076
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5055
5077
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -5058,12 +5080,12 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
|
5058
5080
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5059
5081
|
|
|
5060
5082
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5061
|
-
var
|
|
5083
|
+
var import_react24 = require("react");
|
|
5062
5084
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5063
5085
|
|
|
5064
5086
|
// src/components/Modal.tsx
|
|
5065
5087
|
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
5066
|
-
var
|
|
5088
|
+
var import_react26 = require("react");
|
|
5067
5089
|
|
|
5068
5090
|
// src/components/ModalHeader.tsx
|
|
5069
5091
|
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
@@ -5239,10 +5261,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
5239
5261
|
var import_react_use = require("react-use");
|
|
5240
5262
|
|
|
5241
5263
|
// src/components/useMounted.tsx
|
|
5242
|
-
var
|
|
5264
|
+
var import_react25 = require("react");
|
|
5243
5265
|
var useMounted = () => {
|
|
5244
|
-
const [isMounted, setIsMounted] = (0,
|
|
5245
|
-
(0,
|
|
5266
|
+
const [isMounted, setIsMounted] = (0, import_react25.useState)(false);
|
|
5267
|
+
(0, import_react25.useEffect)(() => {
|
|
5246
5268
|
setIsMounted(true);
|
|
5247
5269
|
return () => setIsMounted(false);
|
|
5248
5270
|
}, []);
|
|
@@ -5336,12 +5358,12 @@ var Modal = ({
|
|
|
5336
5358
|
}) => {
|
|
5337
5359
|
var _a;
|
|
5338
5360
|
const mounted = useMounted();
|
|
5339
|
-
const modalRef = (0,
|
|
5340
|
-
const bgRef = (0,
|
|
5361
|
+
const modalRef = (0, import_react26.useRef)(null);
|
|
5362
|
+
const bgRef = (0, import_react26.useRef)(null);
|
|
5341
5363
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5342
5364
|
const isMobile = useMatchesMobile();
|
|
5343
5365
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5344
|
-
(0,
|
|
5366
|
+
(0, import_react26.useEffect)(() => {
|
|
5345
5367
|
if (!mounted) return;
|
|
5346
5368
|
if (!modalRef.current || !bgRef.current) {
|
|
5347
5369
|
console.error("Modal or background reference is not set.");
|
|
@@ -5361,7 +5383,7 @@ var Modal = ({
|
|
|
5361
5383
|
bgFadeIn(bgRef.current);
|
|
5362
5384
|
}
|
|
5363
5385
|
}, [mounted, onClose, open, wasOpen]);
|
|
5364
|
-
const handleKeyDown = (0,
|
|
5386
|
+
const handleKeyDown = (0, import_react26.useCallback)(
|
|
5365
5387
|
(e) => {
|
|
5366
5388
|
if (e.key === "Escape") {
|
|
5367
5389
|
if (onClose) {
|
|
@@ -5372,12 +5394,12 @@ var Modal = ({
|
|
|
5372
5394
|
},
|
|
5373
5395
|
[onClose]
|
|
5374
5396
|
);
|
|
5375
|
-
const handleClose = (0,
|
|
5397
|
+
const handleClose = (0, import_react26.useCallback)(() => {
|
|
5376
5398
|
if (onClose) {
|
|
5377
5399
|
onClose();
|
|
5378
5400
|
}
|
|
5379
5401
|
}, [onClose]);
|
|
5380
|
-
(0,
|
|
5402
|
+
(0, import_react26.useEffect)(() => {
|
|
5381
5403
|
if (open) {
|
|
5382
5404
|
document.addEventListener("keyup", handleKeyDown);
|
|
5383
5405
|
}
|
|
@@ -5385,7 +5407,7 @@ var Modal = ({
|
|
|
5385
5407
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5386
5408
|
};
|
|
5387
5409
|
}, [open, handleKeyDown]);
|
|
5388
|
-
(0,
|
|
5410
|
+
(0, import_react26.useEffect)(() => {
|
|
5389
5411
|
if (!open) return;
|
|
5390
5412
|
const scrollY = window.scrollY;
|
|
5391
5413
|
const body = document.body;
|
|
@@ -5406,7 +5428,7 @@ var Modal = ({
|
|
|
5406
5428
|
};
|
|
5407
5429
|
}, [open]);
|
|
5408
5430
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5409
|
-
const backgroundClickHandler = (0,
|
|
5431
|
+
const backgroundClickHandler = (0, import_react26.useCallback)(
|
|
5410
5432
|
(e) => {
|
|
5411
5433
|
const target = e.target;
|
|
5412
5434
|
const currentTarget = e.currentTarget;
|
|
@@ -5515,10 +5537,10 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
|
5515
5537
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5516
5538
|
|
|
5517
5539
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5518
|
-
var
|
|
5540
|
+
var import_react28 = require("react");
|
|
5519
5541
|
|
|
5520
5542
|
// src/components/ImagePlaceholder.tsx
|
|
5521
|
-
var
|
|
5543
|
+
var import_react27 = require("react");
|
|
5522
5544
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5523
5545
|
|
|
5524
5546
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5529,11 +5551,11 @@ var import_clsx31 = __toESM(require("clsx"), 1);
|
|
|
5529
5551
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5530
5552
|
|
|
5531
5553
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5532
|
-
var
|
|
5554
|
+
var import_react29 = require("react");
|
|
5533
5555
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5534
5556
|
|
|
5535
5557
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5536
|
-
var
|
|
5558
|
+
var import_react30 = require("react");
|
|
5537
5559
|
|
|
5538
5560
|
// src/components/Surface.tsx
|
|
5539
5561
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
@@ -5578,17 +5600,17 @@ var import_clsx33 = require("clsx");
|
|
|
5578
5600
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5579
5601
|
|
|
5580
5602
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5581
|
-
var
|
|
5603
|
+
var import_react31 = require("react");
|
|
5582
5604
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5583
5605
|
|
|
5584
5606
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5585
|
-
var
|
|
5607
|
+
var import_react32 = require("react");
|
|
5586
5608
|
|
|
5587
5609
|
// src/components/ProductImagePreview/index.tsx
|
|
5588
5610
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5589
5611
|
|
|
5590
5612
|
// src/components/CompactImagesPreview.tsx
|
|
5591
|
-
var
|
|
5613
|
+
var import_react33 = require("react");
|
|
5592
5614
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
5593
5615
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5594
5616
|
|
|
@@ -5597,12 +5619,12 @@ var import_clsx35 = __toESM(require("clsx"), 1);
|
|
|
5597
5619
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5598
5620
|
|
|
5599
5621
|
// src/components/ListGroup.tsx
|
|
5600
|
-
var
|
|
5622
|
+
var import_react34 = require("react");
|
|
5601
5623
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
5602
5624
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5603
5625
|
|
|
5604
5626
|
// src/components/Pagination.tsx
|
|
5605
|
-
var
|
|
5627
|
+
var import_react35 = require("react");
|
|
5606
5628
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5607
5629
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5608
5630
|
var Pagination = ({
|
|
@@ -5614,7 +5636,7 @@ var Pagination = ({
|
|
|
5614
5636
|
className,
|
|
5615
5637
|
disabled
|
|
5616
5638
|
}) => {
|
|
5617
|
-
const goTo = (0,
|
|
5639
|
+
const goTo = (0, import_react35.useCallback)(
|
|
5618
5640
|
(page) => {
|
|
5619
5641
|
if (disabled) return;
|
|
5620
5642
|
onPageChange(page);
|
|
@@ -5631,7 +5653,7 @@ var Pagination = ({
|
|
|
5631
5653
|
goTo(currentPage + 1);
|
|
5632
5654
|
}
|
|
5633
5655
|
};
|
|
5634
|
-
const pageTokens = (0,
|
|
5656
|
+
const pageTokens = (0, import_react35.useMemo)(() => {
|
|
5635
5657
|
if (totalPages <= 5) {
|
|
5636
5658
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5637
5659
|
}
|
|
@@ -5754,21 +5776,21 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
5754
5776
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5755
5777
|
|
|
5756
5778
|
// src/components/SearchResultImage/index.tsx
|
|
5757
|
-
var
|
|
5779
|
+
var import_react36 = require("react");
|
|
5758
5780
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5759
5781
|
|
|
5760
5782
|
// src/components/Alert.tsx
|
|
5761
5783
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5762
|
-
var
|
|
5784
|
+
var import_react37 = require("react");
|
|
5763
5785
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5764
5786
|
|
|
5765
5787
|
// src/components/OrderCheckIcon.tsx
|
|
5766
5788
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5767
5789
|
|
|
5768
5790
|
// src/components/EditingContext.tsx
|
|
5769
|
-
var
|
|
5791
|
+
var import_react38 = require("react");
|
|
5770
5792
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5771
|
-
var EditingContext = (0,
|
|
5793
|
+
var EditingContext = (0, import_react38.createContext)(null);
|
|
5772
5794
|
|
|
5773
5795
|
// src/components/AccessCard.tsx
|
|
5774
5796
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
@@ -5902,7 +5924,7 @@ var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
|
5902
5924
|
|
|
5903
5925
|
// src/components/AccessCardGroup.tsx
|
|
5904
5926
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
5905
|
-
var
|
|
5927
|
+
var import_react39 = require("react");
|
|
5906
5928
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5907
5929
|
|
|
5908
5930
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
@@ -5973,7 +5995,7 @@ function TableBodyRow({
|
|
|
5973
5995
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
5974
5996
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
5975
5997
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
5976
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5998
|
+
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react40.default.Fragment, { children: (0, import_react_table3.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5977
5999
|
CellElement,
|
|
5978
6000
|
{
|
|
5979
6001
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|