@dmsi/wedgekit-react 0.0.643 → 0.0.645
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XX5GVIPZ.js → chunk-3MV3KMQH.js} +2 -2
- package/dist/{chunk-V7GPM6Z3.js → chunk-3PBA2EZ5.js} +1 -1
- package/dist/{chunk-3R3AY5MT.js → chunk-B3T7KBDA.js} +1 -1
- package/dist/{chunk-FIOXWZWU.js → chunk-ECYXZZWC.js} +1 -1
- package/dist/{chunk-RQMOWYB7.js → chunk-EXCAOI2L.js} +3 -3
- package/dist/{chunk-MQB6BSRX.js → chunk-FCGPQNS2.js} +1 -1
- package/dist/{chunk-SJ3SULQB.js → chunk-FJXWYGB7.js} +7 -7
- package/dist/{chunk-QJZ3XHNH.js → chunk-HCHKYUNQ.js} +19 -5
- package/dist/{chunk-5JHKFK73.js → chunk-HIGNJAQA.js} +2 -2
- package/dist/{chunk-IATOG76G.js → chunk-ISRG77J6.js} +1 -1
- package/dist/{chunk-UB3GEENN.js → chunk-OZEKRO4L.js} +1 -1
- package/dist/{chunk-LGX34HML.js → chunk-Q4AANHJY.js} +1 -1
- package/dist/{chunk-PS7MBNUT.js → chunk-REC2XOPI.js} +1 -1
- package/dist/{chunk-ARWHCWG7.js → chunk-XT4BQXSX.js} +1 -1
- package/dist/{chunk-YR4ZO2XL.js → chunk-ZSRTAMSW.js} +56 -23
- package/dist/components/CalendarRange.cjs +202 -180
- package/dist/components/CalendarRange.js +15 -15
- package/dist/components/CompactImagesPreview.cjs +6 -3
- package/dist/components/CompactImagesPreview.js +3 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +202 -180
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +15 -15
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +202 -180
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +15 -15
- package/dist/components/DataGrid/PinnedColumns.cjs +202 -180
- package/dist/components/DataGrid/PinnedColumns.js +15 -15
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +202 -180
- package/dist/components/DataGrid/TableBody/LoadingCell.js +15 -15
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +202 -180
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +15 -15
- package/dist/components/DataGrid/TableBody/index.cjs +202 -180
- package/dist/components/DataGrid/TableBody/index.js +15 -15
- package/dist/components/DataGrid/index.cjs +203 -181
- package/dist/components/DataGrid/index.js +15 -15
- package/dist/components/DataGrid/utils.cjs +202 -180
- package/dist/components/DataGrid/utils.js +15 -15
- package/dist/components/DataGridCell.cjs +61 -58
- package/dist/components/DataGridCell.js +6 -6
- package/dist/components/DateInput.cjs +195 -173
- package/dist/components/DateInput.js +15 -15
- package/dist/components/DateRangeInput.cjs +208 -186
- package/dist/components/DateRangeInput.js +15 -15
- package/dist/components/Menu.cjs +15 -12
- package/dist/components/Menu.js +4 -4
- package/dist/components/MenuOption.cjs +8 -5
- package/dist/components/MenuOption.js +3 -3
- package/dist/components/MobileDataGrid/ColumnList.js +4 -4
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +206 -184
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +15 -15
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +3 -3
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +206 -184
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +15 -15
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +3 -3
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +19 -16
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +6 -6
- package/dist/components/MobileDataGrid/index.cjs +215 -193
- package/dist/components/MobileDataGrid/index.js +15 -15
- package/dist/components/Modal.cjs +15 -12
- package/dist/components/Modal.js +3 -3
- package/dist/components/NestedMenu.cjs +11 -8
- package/dist/components/NestedMenu.js +3 -3
- package/dist/components/PDFViewer/index.cjs +31 -28
- package/dist/components/PDFViewer/index.js +3 -3
- package/dist/components/ProductImagePreview/index.cjs +18 -15
- package/dist/components/ProductImagePreview/index.js +3 -3
- package/dist/components/ProjectBar.cjs +3 -0
- package/dist/components/ProjectBar.js +2 -2
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +263 -241
- package/dist/components/index.js +15 -15
- package/dist/components/useMenuSystem.cjs +22 -19
- package/dist/components/useMenuSystem.js +3 -3
- package/dist/hooks/index.cjs +76 -26
- package/dist/hooks/index.js +4 -2
- package/dist/utils/index.cjs +21 -5
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
|
@@ -117,7 +117,7 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
117
117
|
|
|
118
118
|
// src/components/DataGridCell.tsx
|
|
119
119
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
120
|
-
var
|
|
120
|
+
var import_react12 = require("react");
|
|
121
121
|
|
|
122
122
|
// src/classNames.ts
|
|
123
123
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -261,7 +261,7 @@ var gapUsingContainerPadding = (0, import_clsx.default)(
|
|
|
261
261
|
|
|
262
262
|
// src/components/MenuOption.tsx
|
|
263
263
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
264
|
-
var
|
|
264
|
+
var import_react7 = require("react");
|
|
265
265
|
|
|
266
266
|
// src/components/Label.tsx
|
|
267
267
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
@@ -595,11 +595,24 @@ function formatDate(date) {
|
|
|
595
595
|
|
|
596
596
|
// src/utils/mergeObjectArrays.ts
|
|
597
597
|
function mergeObjectArrays(arr1, arr2) {
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
598
|
+
const arr2Map = /* @__PURE__ */ new Map();
|
|
599
|
+
for (const item of arr2) {
|
|
600
|
+
const id = item.id;
|
|
601
|
+
if (id !== void 0) {
|
|
602
|
+
arr2Map.set(id, item);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return arr1.map((item1) => {
|
|
606
|
+
const id = item1.id;
|
|
607
|
+
if (id !== void 0 && arr2Map.has(id)) {
|
|
608
|
+
const item2 = arr2Map.get(id);
|
|
609
|
+
const meta1 = item1.meta;
|
|
610
|
+
const meta2 = item2.meta;
|
|
611
|
+
const mergedMeta = meta1 && meta2 && typeof meta1 === "object" && typeof meta2 === "object" ? __spreadValues(__spreadValues({}, meta1), meta2) : meta2 != null ? meta2 : meta1;
|
|
612
|
+
return __spreadProps(__spreadValues(__spreadValues({}, item1), item2), { meta: mergedMeta });
|
|
613
|
+
}
|
|
614
|
+
return item1;
|
|
615
|
+
});
|
|
603
616
|
}
|
|
604
617
|
|
|
605
618
|
// src/utils/index.ts
|
|
@@ -635,52 +648,58 @@ var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
|
|
|
635
648
|
function useTableLayout(initialColumns, key, autosync = true) {
|
|
636
649
|
const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
|
|
637
650
|
const [isReady, setIsReady] = (0, import_react5.useState)(false);
|
|
638
|
-
const
|
|
651
|
+
const isReadyRef = (0, import_react5.useRef)(false);
|
|
652
|
+
const keyRef = (0, import_react5.useRef)(key);
|
|
653
|
+
(0, import_react5.useEffect)(() => {
|
|
654
|
+
isReadyRef.current = isReady;
|
|
655
|
+
keyRef.current = key;
|
|
656
|
+
}, [isReady, key]);
|
|
639
657
|
const handleSaveLayout = (0, import_react5.useCallback)(
|
|
640
658
|
(setter, _internal) => {
|
|
641
|
-
if (!
|
|
659
|
+
if (!isReadyRef.current && !_internal || !keyRef.current) return;
|
|
642
660
|
setColumns((prevColumns) => {
|
|
643
661
|
const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
|
|
644
|
-
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
|
|
662
|
+
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal) {
|
|
645
663
|
return prevColumns;
|
|
664
|
+
}
|
|
646
665
|
localStorage.setItem(
|
|
647
|
-
getLocalStorageKeyWithPrefix(`${
|
|
666
|
+
getLocalStorageKeyWithPrefix(`${keyRef.current}-tableLayout`),
|
|
648
667
|
JSON.stringify(newColumns)
|
|
649
668
|
);
|
|
650
669
|
return newColumns;
|
|
651
670
|
});
|
|
652
671
|
},
|
|
653
|
-
[
|
|
672
|
+
[]
|
|
654
673
|
);
|
|
655
674
|
(0, import_react5.useEffect)(() => {
|
|
656
675
|
if (!autosync) return;
|
|
657
|
-
if (!key)
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
`useTableLayout should only be called once per component render cycle.
|
|
661
|
-
${renderCountRef.current} Renders detected.
|
|
662
|
-
Check dependency stability`
|
|
663
|
-
);
|
|
676
|
+
if (!key) {
|
|
677
|
+
setIsReady(true);
|
|
678
|
+
return;
|
|
664
679
|
}
|
|
665
|
-
renderCountRef.current += 1;
|
|
666
680
|
const savedLayout = localStorage.getItem(
|
|
667
681
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
668
682
|
);
|
|
669
683
|
if (savedLayout) {
|
|
670
|
-
|
|
684
|
+
setColumns(
|
|
671
685
|
mergeObjectArrays(
|
|
672
686
|
initialColumns,
|
|
673
687
|
JSON.parse(savedLayout)
|
|
674
|
-
)
|
|
675
|
-
|
|
688
|
+
)
|
|
689
|
+
);
|
|
690
|
+
} else {
|
|
691
|
+
localStorage.setItem(
|
|
692
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
693
|
+
JSON.stringify(initialColumns)
|
|
676
694
|
);
|
|
695
|
+
setColumns((prev) => {
|
|
696
|
+
if (JSON.stringify(initialColumns) === JSON.stringify(prev))
|
|
697
|
+
return prev;
|
|
698
|
+
return initialColumns;
|
|
699
|
+
});
|
|
677
700
|
}
|
|
678
|
-
if (!savedLayout) handleSaveLayout(initialColumns, true);
|
|
679
701
|
setIsReady(true);
|
|
680
|
-
|
|
681
|
-
renderCountRef.current = 0;
|
|
682
|
-
};
|
|
683
|
-
}, [handleSaveLayout, initialColumns, key, autosync]);
|
|
702
|
+
}, [initialColumns, key, autosync]);
|
|
684
703
|
const getSavedLayout = (0, import_react5.useCallback)(() => {
|
|
685
704
|
const savedLayout = localStorage.getItem(
|
|
686
705
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
@@ -692,6 +711,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
692
711
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
693
712
|
}
|
|
694
713
|
|
|
714
|
+
// src/hooks/useEditCell.tsx
|
|
715
|
+
var import_react6 = require("react");
|
|
716
|
+
|
|
695
717
|
// src/components/Caption.tsx
|
|
696
718
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
697
719
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -843,12 +865,12 @@ var MenuOption = ({
|
|
|
843
865
|
onMouseMove,
|
|
844
866
|
small = false
|
|
845
867
|
}) => {
|
|
846
|
-
const uniqueId = (0,
|
|
847
|
-
const internalRef = (0,
|
|
868
|
+
const uniqueId = (0, import_react7.useId)();
|
|
869
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
848
870
|
const actualRef = ref || internalRef;
|
|
849
|
-
const menuId = (0,
|
|
871
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
850
872
|
const isMobile = useMatchesMobile();
|
|
851
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
873
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
852
874
|
const handleMouseEnter = () => {
|
|
853
875
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
854
876
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1008,27 +1030,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1008
1030
|
|
|
1009
1031
|
// src/components/Menu.tsx
|
|
1010
1032
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
1011
|
-
var
|
|
1033
|
+
var import_react9 = require("react");
|
|
1012
1034
|
var import_react_dom = require("react-dom");
|
|
1013
1035
|
|
|
1014
1036
|
// src/components/useMenuSystem.tsx
|
|
1015
|
-
var
|
|
1037
|
+
var import_react8 = require("react");
|
|
1016
1038
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1017
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1039
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1018
1040
|
{}
|
|
1019
1041
|
);
|
|
1020
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1021
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1042
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1043
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1022
1044
|
null
|
|
1023
1045
|
);
|
|
1024
|
-
const menuRootRef = (0,
|
|
1025
|
-
const subMenuRefs = (0,
|
|
1026
|
-
const hoverTimeoutRef = (0,
|
|
1027
|
-
const closeTimeoutRef = (0,
|
|
1028
|
-
const mouseStopTimeoutRef = (0,
|
|
1029
|
-
const isMouseMovingRef = (0,
|
|
1030
|
-
const pendingOpenActionRef = (0,
|
|
1031
|
-
const pendingCloseActionRef = (0,
|
|
1046
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1047
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1048
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1049
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1050
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1051
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1052
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1053
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1032
1054
|
const isMobile = useMatchesMobile();
|
|
1033
1055
|
const toggleMenu = (menuId, level) => {
|
|
1034
1056
|
if (closeTimeoutRef.current) {
|
|
@@ -1068,7 +1090,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1068
1090
|
return newActiveMenus;
|
|
1069
1091
|
});
|
|
1070
1092
|
};
|
|
1071
|
-
const executePendingActions = (0,
|
|
1093
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1072
1094
|
if (pendingCloseActionRef.current) {
|
|
1073
1095
|
pendingCloseActionRef.current();
|
|
1074
1096
|
pendingCloseActionRef.current = null;
|
|
@@ -1157,7 +1179,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1157
1179
|
const isMenuActive = (menuId, level) => {
|
|
1158
1180
|
return activeMenus[level] === menuId;
|
|
1159
1181
|
};
|
|
1160
|
-
(0,
|
|
1182
|
+
(0, import_react8.useEffect)(() => {
|
|
1161
1183
|
const handleClickOutside = (event) => {
|
|
1162
1184
|
var _a;
|
|
1163
1185
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1176,7 +1198,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1176
1198
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1177
1199
|
};
|
|
1178
1200
|
}, [activeMenus]);
|
|
1179
|
-
(0,
|
|
1201
|
+
(0, import_react8.useEffect)(() => {
|
|
1180
1202
|
return () => {
|
|
1181
1203
|
if (hoverTimeoutRef.current) {
|
|
1182
1204
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1254,13 +1276,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1254
1276
|
};
|
|
1255
1277
|
}
|
|
1256
1278
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1257
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1279
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1258
1280
|
top: 0,
|
|
1259
1281
|
left: 0,
|
|
1260
1282
|
minWidth: 0
|
|
1261
1283
|
});
|
|
1262
1284
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1263
|
-
const updatePosition = (0,
|
|
1285
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1264
1286
|
var _a, _b, _c;
|
|
1265
1287
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1266
1288
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1308,7 +1330,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1308
1330
|
minWidth: triggerRect.width
|
|
1309
1331
|
});
|
|
1310
1332
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1311
|
-
(0,
|
|
1333
|
+
(0, import_react8.useEffect)(() => {
|
|
1312
1334
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1313
1335
|
const handleClickOutside = (event) => {
|
|
1314
1336
|
var _a, _b, _c, _d, _e;
|
|
@@ -1334,7 +1356,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1334
1356
|
options == null ? void 0 : options.menuRef,
|
|
1335
1357
|
options == null ? void 0 : options.additionalRefs
|
|
1336
1358
|
]);
|
|
1337
|
-
(0,
|
|
1359
|
+
(0, import_react8.useEffect)(() => {
|
|
1338
1360
|
updatePosition();
|
|
1339
1361
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1340
1362
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1415,9 +1437,9 @@ var Menu = (_a) => {
|
|
|
1415
1437
|
"menuName",
|
|
1416
1438
|
"calculateMinMaxHeight"
|
|
1417
1439
|
]);
|
|
1418
|
-
const internalRef = (0,
|
|
1440
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1419
1441
|
const actualRef = ref || internalRef;
|
|
1420
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1442
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1421
1443
|
const isMobile = useMatchesMobile();
|
|
1422
1444
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1423
1445
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1430,7 +1452,7 @@ var Menu = (_a) => {
|
|
|
1430
1452
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1431
1453
|
}
|
|
1432
1454
|
);
|
|
1433
|
-
(0,
|
|
1455
|
+
(0, import_react9.useEffect)(() => {
|
|
1434
1456
|
if (calculateMinMaxHeight) {
|
|
1435
1457
|
return;
|
|
1436
1458
|
}
|
|
@@ -1454,7 +1476,7 @@ var Menu = (_a) => {
|
|
|
1454
1476
|
cancelAnimationFrame(raf);
|
|
1455
1477
|
};
|
|
1456
1478
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1457
|
-
(0,
|
|
1479
|
+
(0, import_react9.useEffect)(() => {
|
|
1458
1480
|
if (!calculateMinMaxHeight) {
|
|
1459
1481
|
return;
|
|
1460
1482
|
}
|
|
@@ -1465,14 +1487,14 @@ var Menu = (_a) => {
|
|
|
1465
1487
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1466
1488
|
}
|
|
1467
1489
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1468
|
-
(0,
|
|
1490
|
+
(0, import_react9.useEffect)(() => {
|
|
1469
1491
|
if (!show) {
|
|
1470
1492
|
return;
|
|
1471
1493
|
}
|
|
1472
1494
|
initializeMenuFocus();
|
|
1473
1495
|
updatePosition();
|
|
1474
1496
|
}, [show, updatePosition]);
|
|
1475
|
-
(0,
|
|
1497
|
+
(0, import_react9.useEffect)(() => {
|
|
1476
1498
|
if (!show || !setShow) {
|
|
1477
1499
|
return;
|
|
1478
1500
|
}
|
|
@@ -1626,10 +1648,10 @@ var Menu = (_a) => {
|
|
|
1626
1648
|
Menu.displayName = "Menu";
|
|
1627
1649
|
|
|
1628
1650
|
// src/components/Search.tsx
|
|
1629
|
-
var
|
|
1651
|
+
var import_react11 = require("react");
|
|
1630
1652
|
|
|
1631
1653
|
// src/components/Input.tsx
|
|
1632
|
-
var
|
|
1654
|
+
var import_react10 = require("react");
|
|
1633
1655
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1634
1656
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1635
1657
|
var InputBase = (_a) => {
|
|
@@ -1686,9 +1708,9 @@ var InputBase = (_a) => {
|
|
|
1686
1708
|
"data-error": error && !focus || null,
|
|
1687
1709
|
"data-focus": focus || null
|
|
1688
1710
|
};
|
|
1689
|
-
const inputRef = (0,
|
|
1711
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
1690
1712
|
const inputId = id ? `${id}-input` : void 0;
|
|
1691
|
-
(0,
|
|
1713
|
+
(0, import_react10.useEffect)(() => {
|
|
1692
1714
|
var _a2;
|
|
1693
1715
|
const input = inputRef.current;
|
|
1694
1716
|
const focusHandler = () => {
|
|
@@ -1847,15 +1869,15 @@ var Input = (_a) => {
|
|
|
1847
1869
|
"testid",
|
|
1848
1870
|
"rightAdornment"
|
|
1849
1871
|
]);
|
|
1850
|
-
const [internalValue, setInternalValue] = (0,
|
|
1851
|
-
const [displayValue, setDisplayValue] = (0,
|
|
1852
|
-
(0,
|
|
1872
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1873
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1874
|
+
(0, import_react10.useEffect)(() => {
|
|
1853
1875
|
var _a2;
|
|
1854
1876
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
1855
1877
|
setInternalValue(stringValue);
|
|
1856
1878
|
setDisplayValue(stringValue);
|
|
1857
1879
|
}, [propValue]);
|
|
1858
|
-
(0,
|
|
1880
|
+
(0, import_react10.useEffect)(() => {
|
|
1859
1881
|
var _a2;
|
|
1860
1882
|
if (variant !== "currency") {
|
|
1861
1883
|
return;
|
|
@@ -2116,14 +2138,14 @@ var Search = (_a) => {
|
|
|
2116
2138
|
"removeRoundness",
|
|
2117
2139
|
"autocompletePadding"
|
|
2118
2140
|
]);
|
|
2119
|
-
const inputRef = (0,
|
|
2120
|
-
const inputContainerRef = (0,
|
|
2121
|
-
const preventFocusOnInitialRender = (0,
|
|
2122
|
-
const [show, setShow] = (0,
|
|
2123
|
-
const [clearing, setClearing] = (0,
|
|
2124
|
-
const uniqueId = (0,
|
|
2141
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2142
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2143
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2144
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2145
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2146
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2125
2147
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2126
|
-
(0,
|
|
2148
|
+
(0, import_react11.useEffect)(() => {
|
|
2127
2149
|
var _a2;
|
|
2128
2150
|
if (preventFocusOnInitialRender.current) {
|
|
2129
2151
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2207,7 +2229,7 @@ Search.displayName = "Search";
|
|
|
2207
2229
|
|
|
2208
2230
|
// src/components/DataGridCell.tsx
|
|
2209
2231
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2210
|
-
var DataGridCell = (0,
|
|
2232
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2211
2233
|
(_a) => {
|
|
2212
2234
|
var _b = _a, {
|
|
2213
2235
|
id,
|
|
@@ -2249,10 +2271,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2249
2271
|
"testid"
|
|
2250
2272
|
]);
|
|
2251
2273
|
const Element = type === "header" ? "th" : "td";
|
|
2252
|
-
const timerRef = (0,
|
|
2253
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2254
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2255
|
-
(0,
|
|
2274
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2275
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2276
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2277
|
+
(0, import_react12.useEffect)(() => {
|
|
2256
2278
|
return () => {
|
|
2257
2279
|
if (timerRef.current) {
|
|
2258
2280
|
clearTimeout(timerRef.current);
|
|
@@ -2362,12 +2384,12 @@ function DataCellHeader(_a) {
|
|
|
2362
2384
|
"useMenuDefaultMinWidth"
|
|
2363
2385
|
]);
|
|
2364
2386
|
var _a2;
|
|
2365
|
-
const [showMenu, setShowMenu] = (0,
|
|
2366
|
-
const [filter, setFilter] = (0,
|
|
2387
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2388
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2367
2389
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2368
2390
|
);
|
|
2369
|
-
const ref = (0,
|
|
2370
|
-
const predeterminedPinned = (0,
|
|
2391
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2392
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2371
2393
|
const { column, getContext } = header;
|
|
2372
2394
|
const { id: columnId, setFilterValue } = column;
|
|
2373
2395
|
const {
|
|
@@ -2377,14 +2399,14 @@ function DataCellHeader(_a) {
|
|
|
2377
2399
|
listeners: subMenuListeners,
|
|
2378
2400
|
mobileHide
|
|
2379
2401
|
} = useSubMenuSystem(node ? node : ref);
|
|
2380
|
-
(0,
|
|
2402
|
+
(0, import_react12.useEffect)(() => {
|
|
2381
2403
|
var _a3, _b2, _c;
|
|
2382
2404
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2383
2405
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2384
2406
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2385
2407
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2386
2408
|
}, [columnId, getContext]);
|
|
2387
|
-
(0,
|
|
2409
|
+
(0, import_react12.useEffect)(() => {
|
|
2388
2410
|
const handler = setTimeout(() => {
|
|
2389
2411
|
setFilterValue(filter);
|
|
2390
2412
|
}, 500);
|
|
@@ -2647,7 +2669,7 @@ function DragAlongCell(_a) {
|
|
|
2647
2669
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2648
2670
|
|
|
2649
2671
|
// src/components/DataGrid/index.tsx
|
|
2650
|
-
var
|
|
2672
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2651
2673
|
var import_react_table2 = require("@tanstack/react-table");
|
|
2652
2674
|
var import_core = require("@dnd-kit/core");
|
|
2653
2675
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -2675,13 +2697,13 @@ 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/ColumnSelectorHeaderCell/index.tsx
|
|
2681
|
-
var
|
|
2703
|
+
var import_react14 = require("react");
|
|
2682
2704
|
|
|
2683
2705
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
2684
|
-
var
|
|
2706
|
+
var import_react13 = require("react");
|
|
2685
2707
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2686
2708
|
function ColumnSelectorMenuOption({
|
|
2687
2709
|
id,
|
|
@@ -2689,7 +2711,7 @@ function ColumnSelectorMenuOption({
|
|
|
2689
2711
|
column,
|
|
2690
2712
|
toggleColumnVisibility
|
|
2691
2713
|
}) {
|
|
2692
|
-
const [isVisible, setIsVisible] = (0,
|
|
2714
|
+
const [isVisible, setIsVisible] = (0, import_react13.useState)(column.getIsVisible());
|
|
2693
2715
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
2694
2716
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2695
2717
|
Checkbox,
|
|
@@ -2715,8 +2737,8 @@ function ColumnSelectorHeaderCell({
|
|
|
2715
2737
|
toggleColumnVisibility,
|
|
2716
2738
|
resetColumnVisibility
|
|
2717
2739
|
}) {
|
|
2718
|
-
const ref = (0,
|
|
2719
|
-
const [show, setShow] = (0,
|
|
2740
|
+
const ref = (0, import_react14.useRef)(null);
|
|
2741
|
+
const [show, setShow] = (0, import_react14.useState)(false);
|
|
2720
2742
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2721
2743
|
DataGridCell,
|
|
2722
2744
|
{
|
|
@@ -2885,7 +2907,7 @@ function PinnedColumns(_a) {
|
|
|
2885
2907
|
header.id
|
|
2886
2908
|
);
|
|
2887
2909
|
}
|
|
2888
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react15.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2889
2911
|
Checkbox,
|
|
2890
2912
|
{
|
|
2891
2913
|
checked: allSelectedAcrossPages,
|
|
@@ -2967,23 +2989,23 @@ function DataGrid({
|
|
|
2967
2989
|
ref
|
|
2968
2990
|
}) {
|
|
2969
2991
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
2970
|
-
(0,
|
|
2992
|
+
(0, import_react16.useImperativeHandle)(ref, () => ({
|
|
2971
2993
|
getSavedLayout: () => {
|
|
2972
2994
|
return getSavedLayout();
|
|
2973
2995
|
}
|
|
2974
2996
|
}));
|
|
2975
|
-
const [localSorting, setLocalSorting] = (0,
|
|
2976
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
2977
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
2997
|
+
const [localSorting, setLocalSorting] = (0, import_react16.useState)([]);
|
|
2998
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react16.useState)([]);
|
|
2999
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react16.useState)({});
|
|
2978
3000
|
const {
|
|
2979
3001
|
columns: tableColumns,
|
|
2980
3002
|
setColumns: setTableColumns,
|
|
2981
3003
|
getSavedLayout
|
|
2982
3004
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
2983
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3005
|
+
const [columnOrder, setColumnOrder] = (0, import_react16.useState)(
|
|
2984
3006
|
tableColumns.map((c) => c.id)
|
|
2985
3007
|
);
|
|
2986
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3008
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react16.useState)(
|
|
2987
3009
|
Object.fromEntries(
|
|
2988
3010
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
2989
3011
|
var _a2, _b2;
|
|
@@ -2991,7 +3013,7 @@ function DataGrid({
|
|
|
2991
3013
|
})
|
|
2992
3014
|
)
|
|
2993
3015
|
);
|
|
2994
|
-
const updateColumnVisibility = (0,
|
|
3016
|
+
const updateColumnVisibility = (0, import_react16.useCallback)(
|
|
2995
3017
|
(updateOrder) => {
|
|
2996
3018
|
setColumnVisibility(
|
|
2997
3019
|
Object.fromEntries(
|
|
@@ -3005,7 +3027,7 @@ function DataGrid({
|
|
|
3005
3027
|
},
|
|
3006
3028
|
[tableColumns]
|
|
3007
3029
|
);
|
|
3008
|
-
const resetDefaultColumnVisibility = (0,
|
|
3030
|
+
const resetDefaultColumnVisibility = (0, import_react16.useCallback)(() => {
|
|
3009
3031
|
setTableColumns((prev) => {
|
|
3010
3032
|
columns.forEach((column) => {
|
|
3011
3033
|
var _a2, _b2;
|
|
@@ -3021,7 +3043,7 @@ function DataGrid({
|
|
|
3021
3043
|
return [...prev];
|
|
3022
3044
|
}, true);
|
|
3023
3045
|
}, [columns, setTableColumns]);
|
|
3024
|
-
(0,
|
|
3046
|
+
(0, import_react16.useEffect)(() => {
|
|
3025
3047
|
updateColumnVisibility(true);
|
|
3026
3048
|
}, [updateColumnVisibility]);
|
|
3027
3049
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3037,7 +3059,7 @@ function DataGrid({
|
|
|
3037
3059
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3038
3060
|
} : setLocalColumnFilters;
|
|
3039
3061
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3040
|
-
const setRowSelection = (0,
|
|
3062
|
+
const setRowSelection = (0, import_react16.useCallback)(
|
|
3041
3063
|
(updaterOrValue) => {
|
|
3042
3064
|
if (pagination) {
|
|
3043
3065
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3051,9 +3073,9 @@ function DataGrid({
|
|
|
3051
3073
|
},
|
|
3052
3074
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3053
3075
|
);
|
|
3054
|
-
const dndId = (0,
|
|
3055
|
-
const containerRef =
|
|
3056
|
-
const toggleColumnVisibility = (0,
|
|
3076
|
+
const dndId = (0, import_react16.useId)();
|
|
3077
|
+
const containerRef = import_react16.default.useRef(null);
|
|
3078
|
+
const toggleColumnVisibility = (0, import_react16.useCallback)(
|
|
3057
3079
|
(columnId, isVisible) => {
|
|
3058
3080
|
setTableColumns((prev) => {
|
|
3059
3081
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3301,7 +3323,7 @@ function DataGrid({
|
|
|
3301
3323
|
header.id
|
|
3302
3324
|
);
|
|
3303
3325
|
}
|
|
3304
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react16.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3305
3327
|
DataGridCell,
|
|
3306
3328
|
{
|
|
3307
3329
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3507,7 +3529,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3507
3529
|
}
|
|
3508
3530
|
|
|
3509
3531
|
// src/components/Select.tsx
|
|
3510
|
-
var
|
|
3532
|
+
var import_react17 = require("react");
|
|
3511
3533
|
var import_clsx13 = __toESM(require("clsx"), 1);
|
|
3512
3534
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3513
3535
|
var Select = (_a) => {
|
|
@@ -3541,11 +3563,11 @@ var Select = (_a) => {
|
|
|
3541
3563
|
"value"
|
|
3542
3564
|
]);
|
|
3543
3565
|
var _a2;
|
|
3544
|
-
const inputRef = (0,
|
|
3545
|
-
const inputContainerRef = (0,
|
|
3546
|
-
const preventFocusOnInitialRender = (0,
|
|
3547
|
-
const [show, setShow] = (0,
|
|
3548
|
-
(0,
|
|
3566
|
+
const inputRef = (0, import_react17.useRef)(null);
|
|
3567
|
+
const inputContainerRef = (0, import_react17.useRef)(null);
|
|
3568
|
+
const preventFocusOnInitialRender = (0, import_react17.useRef)(true);
|
|
3569
|
+
const [show, setShow] = (0, import_react17.useState)(false);
|
|
3570
|
+
(0, import_react17.useEffect)(() => {
|
|
3549
3571
|
var _a3;
|
|
3550
3572
|
if (preventFocusOnInitialRender.current) {
|
|
3551
3573
|
preventFocusOnInitialRender.current = false;
|
|
@@ -3967,7 +3989,7 @@ Button.displayName = "Button";
|
|
|
3967
3989
|
|
|
3968
3990
|
// src/components/Tooltip.tsx
|
|
3969
3991
|
var import_clsx17 = __toESM(require("clsx"), 1);
|
|
3970
|
-
var
|
|
3992
|
+
var import_react18 = require("react");
|
|
3971
3993
|
var import_react_dom2 = require("react-dom");
|
|
3972
3994
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3973
3995
|
var Tooltip = ({
|
|
@@ -3980,11 +4002,11 @@ var Tooltip = ({
|
|
|
3980
4002
|
offset = 8,
|
|
3981
4003
|
keepHidden = false
|
|
3982
4004
|
}) => {
|
|
3983
|
-
const ref = (0,
|
|
3984
|
-
const tooltipRef = (0,
|
|
3985
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
3986
|
-
const [isVisible, setIsVisible] = (0,
|
|
3987
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4005
|
+
const ref = (0, import_react18.useRef)(null);
|
|
4006
|
+
const tooltipRef = (0, import_react18.useRef)(null);
|
|
4007
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react18.useState)({ top: 0, left: 0 });
|
|
4008
|
+
const [isVisible, setIsVisible] = (0, import_react18.useState)(false);
|
|
4009
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react18.useState)(false);
|
|
3988
4010
|
const updatePosition = () => {
|
|
3989
4011
|
if (!ref.current || !tooltipRef.current) return;
|
|
3990
4012
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4023,14 +4045,14 @@ var Tooltip = ({
|
|
|
4023
4045
|
setIsVisible(false);
|
|
4024
4046
|
setRemoveOpacity(false);
|
|
4025
4047
|
};
|
|
4026
|
-
(0,
|
|
4048
|
+
(0, import_react18.useEffect)(() => {
|
|
4027
4049
|
if (isVisible && tooltipRef.current) {
|
|
4028
4050
|
requestAnimationFrame(() => {
|
|
4029
4051
|
updatePosition();
|
|
4030
4052
|
});
|
|
4031
4053
|
}
|
|
4032
4054
|
}, [isVisible]);
|
|
4033
|
-
(0,
|
|
4055
|
+
(0, import_react18.useEffect)(() => {
|
|
4034
4056
|
if (isVisible) {
|
|
4035
4057
|
window.addEventListener("resize", updatePosition);
|
|
4036
4058
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4088,12 +4110,12 @@ var Tooltip = ({
|
|
|
4088
4110
|
Tooltip.displayName = "Tooltip";
|
|
4089
4111
|
|
|
4090
4112
|
// src/components/DateInput.tsx
|
|
4091
|
-
var
|
|
4113
|
+
var import_react20 = require("react");
|
|
4092
4114
|
var import_react_dom3 = require("react-dom");
|
|
4093
4115
|
|
|
4094
4116
|
// src/components/CalendarRange.tsx
|
|
4095
4117
|
var import_clsx18 = __toESM(require("clsx"), 1);
|
|
4096
|
-
var
|
|
4118
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
4097
4119
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4098
4120
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4099
4121
|
function DateCell(_a) {
|
|
@@ -4206,20 +4228,20 @@ function CalendarRange({
|
|
|
4206
4228
|
const fromDate = parseDate(from);
|
|
4207
4229
|
const toDate = parseDate(to);
|
|
4208
4230
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4209
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4231
|
+
const [baseMonth, setBaseMonth] = (0, import_react19.useState)(
|
|
4210
4232
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4211
4233
|
);
|
|
4212
|
-
const [selecting, setSelecting] = (0,
|
|
4213
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4214
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4215
|
-
(0,
|
|
4234
|
+
const [selecting, setSelecting] = (0, import_react19.useState)("from");
|
|
4235
|
+
const [pendingFrom, setPendingFrom] = (0, import_react19.useState)(void 0);
|
|
4236
|
+
const [hoveredDate, setHoveredDate] = (0, import_react19.useState)(void 0);
|
|
4237
|
+
(0, import_react19.useEffect)(() => {
|
|
4216
4238
|
if (fromDate) {
|
|
4217
4239
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4218
4240
|
} else if (toDate) {
|
|
4219
4241
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4220
4242
|
}
|
|
4221
4243
|
}, [from, to]);
|
|
4222
|
-
(0,
|
|
4244
|
+
(0, import_react19.useEffect)(() => {
|
|
4223
4245
|
if (fromDate && toDate) {
|
|
4224
4246
|
setSelecting("from");
|
|
4225
4247
|
setPendingFrom(void 0);
|
|
@@ -4365,14 +4387,14 @@ function CalendarPane({
|
|
|
4365
4387
|
const years = Array.from({ length: 100 }).map(
|
|
4366
4388
|
(_, i) => baseMonth.year - 50 + i
|
|
4367
4389
|
);
|
|
4368
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4369
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4370
|
-
const monthMenuRef = (0,
|
|
4371
|
-
const yearMenuRef = (0,
|
|
4390
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react19.useState)(false);
|
|
4391
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react19.useState)(false);
|
|
4392
|
+
const monthMenuRef = (0, import_react19.useRef)(null);
|
|
4393
|
+
const yearMenuRef = (0, import_react19.useRef)(null);
|
|
4372
4394
|
const month = getMonthData(offset);
|
|
4373
4395
|
const totalCells = 42;
|
|
4374
4396
|
const emptyCells = month.firstDayOffset;
|
|
4375
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react19.default.Fragment, { children: [
|
|
4376
4398
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4377
4399
|
"div",
|
|
4378
4400
|
{
|
|
@@ -4580,24 +4602,24 @@ var DateInput = (_a) => {
|
|
|
4580
4602
|
"label",
|
|
4581
4603
|
"isDateAvailable"
|
|
4582
4604
|
]);
|
|
4583
|
-
const [visible, setVisible] = (0,
|
|
4584
|
-
const [inputValue, setInputValue] = (0,
|
|
4585
|
-
const [isTyping, setIsTyping] = (0,
|
|
4586
|
-
const popoverRef = (0,
|
|
4587
|
-
const triggerRef = (0,
|
|
4588
|
-
const rootRef = (0,
|
|
4589
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4605
|
+
const [visible, setVisible] = (0, import_react20.useState)(false);
|
|
4606
|
+
const [inputValue, setInputValue] = (0, import_react20.useState)("");
|
|
4607
|
+
const [isTyping, setIsTyping] = (0, import_react20.useState)(false);
|
|
4608
|
+
const popoverRef = (0, import_react20.useRef)(null);
|
|
4609
|
+
const triggerRef = (0, import_react20.useRef)(null);
|
|
4610
|
+
const rootRef = (0, import_react20.useRef)(null);
|
|
4611
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react20.useState)({
|
|
4590
4612
|
top: 0,
|
|
4591
4613
|
left: 0,
|
|
4592
4614
|
width: 0
|
|
4593
4615
|
});
|
|
4594
4616
|
const [from, to] = [value, ""];
|
|
4595
|
-
(0,
|
|
4617
|
+
(0, import_react20.useEffect)(() => {
|
|
4596
4618
|
if (!isTyping) {
|
|
4597
4619
|
setInputValue(formatDisplayValue(from));
|
|
4598
4620
|
}
|
|
4599
4621
|
}, [from, isTyping]);
|
|
4600
|
-
(0,
|
|
4622
|
+
(0, import_react20.useLayoutEffect)(() => {
|
|
4601
4623
|
if (visible) {
|
|
4602
4624
|
updatePosition();
|
|
4603
4625
|
}
|
|
@@ -4612,7 +4634,7 @@ var DateInput = (_a) => {
|
|
|
4612
4634
|
});
|
|
4613
4635
|
}
|
|
4614
4636
|
};
|
|
4615
|
-
(0,
|
|
4637
|
+
(0, import_react20.useEffect)(() => {
|
|
4616
4638
|
updatePosition();
|
|
4617
4639
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4618
4640
|
if (triggerRef.current) {
|
|
@@ -4624,7 +4646,7 @@ var DateInput = (_a) => {
|
|
|
4624
4646
|
window.removeEventListener("scroll", updatePosition);
|
|
4625
4647
|
};
|
|
4626
4648
|
}, []);
|
|
4627
|
-
(0,
|
|
4649
|
+
(0, import_react20.useEffect)(() => {
|
|
4628
4650
|
const handleKeyDown2 = (event) => {
|
|
4629
4651
|
var _a2;
|
|
4630
4652
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4637,7 +4659,7 @@ var DateInput = (_a) => {
|
|
|
4637
4659
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4638
4660
|
};
|
|
4639
4661
|
});
|
|
4640
|
-
(0,
|
|
4662
|
+
(0, import_react20.useEffect)(() => {
|
|
4641
4663
|
const handleClickOutside = (event) => {
|
|
4642
4664
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4643
4665
|
setVisible(false);
|
|
@@ -4858,14 +4880,14 @@ Heading3.displayName = "Heading3";
|
|
|
4858
4880
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4859
4881
|
|
|
4860
4882
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4861
|
-
var
|
|
4883
|
+
var import_react23 = require("react");
|
|
4862
4884
|
|
|
4863
4885
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
4864
|
-
var
|
|
4886
|
+
var import_react22 = require("react");
|
|
4865
4887
|
|
|
4866
4888
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
4867
|
-
var
|
|
4868
|
-
var GridContext = (0,
|
|
4889
|
+
var import_react21 = require("react");
|
|
4890
|
+
var GridContext = (0, import_react21.createContext)(null);
|
|
4869
4891
|
|
|
4870
4892
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4871
4893
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
@@ -4874,12 +4896,12 @@ var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
|
4874
4896
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4875
4897
|
|
|
4876
4898
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4877
|
-
var
|
|
4899
|
+
var import_react24 = require("react");
|
|
4878
4900
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4879
4901
|
|
|
4880
4902
|
// src/components/Modal.tsx
|
|
4881
4903
|
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
4882
|
-
var
|
|
4904
|
+
var import_react26 = require("react");
|
|
4883
4905
|
|
|
4884
4906
|
// src/components/ModalHeader.tsx
|
|
4885
4907
|
var import_clsx23 = __toESM(require("clsx"), 1);
|
|
@@ -5055,10 +5077,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
5055
5077
|
var import_react_use = require("react-use");
|
|
5056
5078
|
|
|
5057
5079
|
// src/components/useMounted.tsx
|
|
5058
|
-
var
|
|
5080
|
+
var import_react25 = require("react");
|
|
5059
5081
|
var useMounted = () => {
|
|
5060
|
-
const [isMounted, setIsMounted] = (0,
|
|
5061
|
-
(0,
|
|
5082
|
+
const [isMounted, setIsMounted] = (0, import_react25.useState)(false);
|
|
5083
|
+
(0, import_react25.useEffect)(() => {
|
|
5062
5084
|
setIsMounted(true);
|
|
5063
5085
|
return () => setIsMounted(false);
|
|
5064
5086
|
}, []);
|
|
@@ -5152,12 +5174,12 @@ var Modal = ({
|
|
|
5152
5174
|
}) => {
|
|
5153
5175
|
var _a;
|
|
5154
5176
|
const mounted = useMounted();
|
|
5155
|
-
const modalRef = (0,
|
|
5156
|
-
const bgRef = (0,
|
|
5177
|
+
const modalRef = (0, import_react26.useRef)(null);
|
|
5178
|
+
const bgRef = (0, import_react26.useRef)(null);
|
|
5157
5179
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5158
5180
|
const isMobile = useMatchesMobile();
|
|
5159
5181
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5160
|
-
(0,
|
|
5182
|
+
(0, import_react26.useEffect)(() => {
|
|
5161
5183
|
if (!mounted) return;
|
|
5162
5184
|
if (!modalRef.current || !bgRef.current) {
|
|
5163
5185
|
console.error("Modal or background reference is not set.");
|
|
@@ -5177,7 +5199,7 @@ var Modal = ({
|
|
|
5177
5199
|
bgFadeIn(bgRef.current);
|
|
5178
5200
|
}
|
|
5179
5201
|
}, [mounted, onClose, open, wasOpen]);
|
|
5180
|
-
const handleKeyDown = (0,
|
|
5202
|
+
const handleKeyDown = (0, import_react26.useCallback)(
|
|
5181
5203
|
(e) => {
|
|
5182
5204
|
if (e.key === "Escape") {
|
|
5183
5205
|
if (onClose) {
|
|
@@ -5188,12 +5210,12 @@ var Modal = ({
|
|
|
5188
5210
|
},
|
|
5189
5211
|
[onClose]
|
|
5190
5212
|
);
|
|
5191
|
-
const handleClose = (0,
|
|
5213
|
+
const handleClose = (0, import_react26.useCallback)(() => {
|
|
5192
5214
|
if (onClose) {
|
|
5193
5215
|
onClose();
|
|
5194
5216
|
}
|
|
5195
5217
|
}, [onClose]);
|
|
5196
|
-
(0,
|
|
5218
|
+
(0, import_react26.useEffect)(() => {
|
|
5197
5219
|
if (open) {
|
|
5198
5220
|
document.addEventListener("keyup", handleKeyDown);
|
|
5199
5221
|
}
|
|
@@ -5201,7 +5223,7 @@ var Modal = ({
|
|
|
5201
5223
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5202
5224
|
};
|
|
5203
5225
|
}, [open, handleKeyDown]);
|
|
5204
|
-
(0,
|
|
5226
|
+
(0, import_react26.useEffect)(() => {
|
|
5205
5227
|
if (!open) return;
|
|
5206
5228
|
const scrollY = window.scrollY;
|
|
5207
5229
|
const body = document.body;
|
|
@@ -5222,7 +5244,7 @@ var Modal = ({
|
|
|
5222
5244
|
};
|
|
5223
5245
|
}, [open]);
|
|
5224
5246
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5225
|
-
const backgroundClickHandler = (0,
|
|
5247
|
+
const backgroundClickHandler = (0, import_react26.useCallback)(
|
|
5226
5248
|
(e) => {
|
|
5227
5249
|
const target = e.target;
|
|
5228
5250
|
const currentTarget = e.currentTarget;
|
|
@@ -5331,10 +5353,10 @@ var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
|
5331
5353
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
5332
5354
|
|
|
5333
5355
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5334
|
-
var
|
|
5356
|
+
var import_react28 = require("react");
|
|
5335
5357
|
|
|
5336
5358
|
// src/components/ImagePlaceholder.tsx
|
|
5337
|
-
var
|
|
5359
|
+
var import_react27 = require("react");
|
|
5338
5360
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5339
5361
|
|
|
5340
5362
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5345,11 +5367,11 @@ var import_clsx30 = __toESM(require("clsx"), 1);
|
|
|
5345
5367
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5346
5368
|
|
|
5347
5369
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5348
|
-
var
|
|
5370
|
+
var import_react29 = require("react");
|
|
5349
5371
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5350
5372
|
|
|
5351
5373
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5352
|
-
var
|
|
5374
|
+
var import_react30 = require("react");
|
|
5353
5375
|
|
|
5354
5376
|
// src/components/Surface.tsx
|
|
5355
5377
|
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
@@ -5394,17 +5416,17 @@ var import_clsx32 = require("clsx");
|
|
|
5394
5416
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5395
5417
|
|
|
5396
5418
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5397
|
-
var
|
|
5419
|
+
var import_react31 = require("react");
|
|
5398
5420
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5399
5421
|
|
|
5400
5422
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5401
|
-
var
|
|
5423
|
+
var import_react32 = require("react");
|
|
5402
5424
|
|
|
5403
5425
|
// src/components/ProductImagePreview/index.tsx
|
|
5404
5426
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5405
5427
|
|
|
5406
5428
|
// src/components/CompactImagesPreview.tsx
|
|
5407
|
-
var
|
|
5429
|
+
var import_react33 = require("react");
|
|
5408
5430
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
5409
5431
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5410
5432
|
|
|
@@ -5413,12 +5435,12 @@ var import_clsx34 = __toESM(require("clsx"), 1);
|
|
|
5413
5435
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5414
5436
|
|
|
5415
5437
|
// src/components/ListGroup.tsx
|
|
5416
|
-
var
|
|
5438
|
+
var import_react34 = require("react");
|
|
5417
5439
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
5418
5440
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5419
5441
|
|
|
5420
5442
|
// src/components/Pagination.tsx
|
|
5421
|
-
var
|
|
5443
|
+
var import_react35 = require("react");
|
|
5422
5444
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
5423
5445
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5424
5446
|
var Pagination = ({
|
|
@@ -5430,7 +5452,7 @@ var Pagination = ({
|
|
|
5430
5452
|
className,
|
|
5431
5453
|
disabled
|
|
5432
5454
|
}) => {
|
|
5433
|
-
const goTo = (0,
|
|
5455
|
+
const goTo = (0, import_react35.useCallback)(
|
|
5434
5456
|
(page) => {
|
|
5435
5457
|
if (disabled) return;
|
|
5436
5458
|
onPageChange(page);
|
|
@@ -5447,7 +5469,7 @@ var Pagination = ({
|
|
|
5447
5469
|
goTo(currentPage + 1);
|
|
5448
5470
|
}
|
|
5449
5471
|
};
|
|
5450
|
-
const pageTokens = (0,
|
|
5472
|
+
const pageTokens = (0, import_react35.useMemo)(() => {
|
|
5451
5473
|
if (totalPages <= 5) {
|
|
5452
5474
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5453
5475
|
}
|
|
@@ -5570,21 +5592,21 @@ var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
|
5570
5592
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5571
5593
|
|
|
5572
5594
|
// src/components/SearchResultImage/index.tsx
|
|
5573
|
-
var
|
|
5595
|
+
var import_react36 = require("react");
|
|
5574
5596
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5575
5597
|
|
|
5576
5598
|
// src/components/Alert.tsx
|
|
5577
5599
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5578
|
-
var
|
|
5600
|
+
var import_react37 = require("react");
|
|
5579
5601
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5580
5602
|
|
|
5581
5603
|
// src/components/OrderCheckIcon.tsx
|
|
5582
5604
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5583
5605
|
|
|
5584
5606
|
// src/components/EditingContext.tsx
|
|
5585
|
-
var
|
|
5607
|
+
var import_react38 = require("react");
|
|
5586
5608
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5587
|
-
var EditingContext = (0,
|
|
5609
|
+
var EditingContext = (0, import_react38.createContext)(null);
|
|
5588
5610
|
|
|
5589
5611
|
// src/components/AccessCard.tsx
|
|
5590
5612
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
@@ -5718,7 +5740,7 @@ var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
|
5718
5740
|
|
|
5719
5741
|
// src/components/AccessCardGroup.tsx
|
|
5720
5742
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
5721
|
-
var
|
|
5743
|
+
var import_react39 = require("react");
|
|
5722
5744
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5723
5745
|
|
|
5724
5746
|
// src/components/DataGrid/TableBody/index.tsx
|
|
@@ -5727,7 +5749,7 @@ var import_clsx42 = __toESM(require("clsx"), 1);
|
|
|
5727
5749
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
5728
5750
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
5729
5751
|
var import_react_table3 = require("@tanstack/react-table");
|
|
5730
|
-
var
|
|
5752
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
5731
5753
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5732
5754
|
var valueFormatters = {
|
|
5733
5755
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -5795,7 +5817,7 @@ function TableBodyRow({
|
|
|
5795
5817
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
5796
5818
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
5797
5819
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
5798
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5820
|
+
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react40.default.Fragment, { children: (0, import_react_table3.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5799
5821
|
CellElement,
|
|
5800
5822
|
{
|
|
5801
5823
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|