@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
|
@@ -721,7 +721,7 @@ function Theme({
|
|
|
721
721
|
}
|
|
722
722
|
|
|
723
723
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
724
|
-
var
|
|
724
|
+
var import_react40 = require("react");
|
|
725
725
|
|
|
726
726
|
// src/components/DataGridCell.tsx
|
|
727
727
|
var import_sortable = require("@dnd-kit/sortable");
|
|
@@ -776,11 +776,11 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
776
776
|
|
|
777
777
|
// src/components/DataGridCell.tsx
|
|
778
778
|
var import_clsx12 = __toESM(require("clsx"), 1);
|
|
779
|
-
var
|
|
779
|
+
var import_react12 = require("react");
|
|
780
780
|
|
|
781
781
|
// src/components/MenuOption.tsx
|
|
782
782
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
783
|
-
var
|
|
783
|
+
var import_react7 = require("react");
|
|
784
784
|
|
|
785
785
|
// src/components/Label.tsx
|
|
786
786
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
@@ -1026,11 +1026,24 @@ function formatDate(date) {
|
|
|
1026
1026
|
|
|
1027
1027
|
// src/utils/mergeObjectArrays.ts
|
|
1028
1028
|
function mergeObjectArrays(arr1, arr2) {
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1029
|
+
const arr2Map = /* @__PURE__ */ new Map();
|
|
1030
|
+
for (const item of arr2) {
|
|
1031
|
+
const id = item.id;
|
|
1032
|
+
if (id !== void 0) {
|
|
1033
|
+
arr2Map.set(id, item);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
return arr1.map((item1) => {
|
|
1037
|
+
const id = item1.id;
|
|
1038
|
+
if (id !== void 0 && arr2Map.has(id)) {
|
|
1039
|
+
const item2 = arr2Map.get(id);
|
|
1040
|
+
const meta1 = item1.meta;
|
|
1041
|
+
const meta2 = item2.meta;
|
|
1042
|
+
const mergedMeta = meta1 && meta2 && typeof meta1 === "object" && typeof meta2 === "object" ? __spreadValues(__spreadValues({}, meta1), meta2) : meta2 != null ? meta2 : meta1;
|
|
1043
|
+
return __spreadProps(__spreadValues(__spreadValues({}, item1), item2), { meta: mergedMeta });
|
|
1044
|
+
}
|
|
1045
|
+
return item1;
|
|
1046
|
+
});
|
|
1034
1047
|
}
|
|
1035
1048
|
|
|
1036
1049
|
// src/utils/index.ts
|
|
@@ -1066,52 +1079,58 @@ var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
|
|
|
1066
1079
|
function useTableLayout(initialColumns, key, autosync = true) {
|
|
1067
1080
|
const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
|
|
1068
1081
|
const [isReady, setIsReady] = (0, import_react5.useState)(false);
|
|
1069
|
-
const
|
|
1082
|
+
const isReadyRef = (0, import_react5.useRef)(false);
|
|
1083
|
+
const keyRef = (0, import_react5.useRef)(key);
|
|
1084
|
+
(0, import_react5.useEffect)(() => {
|
|
1085
|
+
isReadyRef.current = isReady;
|
|
1086
|
+
keyRef.current = key;
|
|
1087
|
+
}, [isReady, key]);
|
|
1070
1088
|
const handleSaveLayout = (0, import_react5.useCallback)(
|
|
1071
1089
|
(setter, _internal) => {
|
|
1072
|
-
if (!
|
|
1090
|
+
if (!isReadyRef.current && !_internal || !keyRef.current) return;
|
|
1073
1091
|
setColumns((prevColumns) => {
|
|
1074
1092
|
const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
|
|
1075
|
-
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
|
|
1093
|
+
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal) {
|
|
1076
1094
|
return prevColumns;
|
|
1095
|
+
}
|
|
1077
1096
|
localStorage.setItem(
|
|
1078
|
-
getLocalStorageKeyWithPrefix(`${
|
|
1097
|
+
getLocalStorageKeyWithPrefix(`${keyRef.current}-tableLayout`),
|
|
1079
1098
|
JSON.stringify(newColumns)
|
|
1080
1099
|
);
|
|
1081
1100
|
return newColumns;
|
|
1082
1101
|
});
|
|
1083
1102
|
},
|
|
1084
|
-
[
|
|
1103
|
+
[]
|
|
1085
1104
|
);
|
|
1086
1105
|
(0, import_react5.useEffect)(() => {
|
|
1087
1106
|
if (!autosync) return;
|
|
1088
|
-
if (!key)
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
`useTableLayout should only be called once per component render cycle.
|
|
1092
|
-
${renderCountRef.current} Renders detected.
|
|
1093
|
-
Check dependency stability`
|
|
1094
|
-
);
|
|
1107
|
+
if (!key) {
|
|
1108
|
+
setIsReady(true);
|
|
1109
|
+
return;
|
|
1095
1110
|
}
|
|
1096
|
-
renderCountRef.current += 1;
|
|
1097
1111
|
const savedLayout = localStorage.getItem(
|
|
1098
1112
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
1099
1113
|
);
|
|
1100
1114
|
if (savedLayout) {
|
|
1101
|
-
|
|
1115
|
+
setColumns(
|
|
1102
1116
|
mergeObjectArrays(
|
|
1103
1117
|
initialColumns,
|
|
1104
1118
|
JSON.parse(savedLayout)
|
|
1105
|
-
)
|
|
1106
|
-
true
|
|
1119
|
+
)
|
|
1107
1120
|
);
|
|
1121
|
+
} else {
|
|
1122
|
+
localStorage.setItem(
|
|
1123
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
1124
|
+
JSON.stringify(initialColumns)
|
|
1125
|
+
);
|
|
1126
|
+
setColumns((prev) => {
|
|
1127
|
+
if (JSON.stringify(initialColumns) === JSON.stringify(prev))
|
|
1128
|
+
return prev;
|
|
1129
|
+
return initialColumns;
|
|
1130
|
+
});
|
|
1108
1131
|
}
|
|
1109
|
-
if (!savedLayout) handleSaveLayout(initialColumns, true);
|
|
1110
1132
|
setIsReady(true);
|
|
1111
|
-
|
|
1112
|
-
renderCountRef.current = 0;
|
|
1113
|
-
};
|
|
1114
|
-
}, [handleSaveLayout, initialColumns, key, autosync]);
|
|
1133
|
+
}, [initialColumns, key, autosync]);
|
|
1115
1134
|
const getSavedLayout = (0, import_react5.useCallback)(() => {
|
|
1116
1135
|
const savedLayout = localStorage.getItem(
|
|
1117
1136
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
@@ -1123,6 +1142,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
1123
1142
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
1124
1143
|
}
|
|
1125
1144
|
|
|
1145
|
+
// src/hooks/useEditCell.tsx
|
|
1146
|
+
var import_react6 = require("react");
|
|
1147
|
+
|
|
1126
1148
|
// src/components/Caption.tsx
|
|
1127
1149
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1128
1150
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
@@ -1274,12 +1296,12 @@ var MenuOption = ({
|
|
|
1274
1296
|
onMouseMove,
|
|
1275
1297
|
small = false
|
|
1276
1298
|
}) => {
|
|
1277
|
-
const uniqueId = (0,
|
|
1278
|
-
const internalRef = (0,
|
|
1299
|
+
const uniqueId = (0, import_react7.useId)();
|
|
1300
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
1279
1301
|
const actualRef = ref || internalRef;
|
|
1280
|
-
const menuId = (0,
|
|
1302
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
1281
1303
|
const isMobile = useMatchesMobile();
|
|
1282
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
1304
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
1283
1305
|
const handleMouseEnter = () => {
|
|
1284
1306
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
1285
1307
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1439,27 +1461,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1439
1461
|
|
|
1440
1462
|
// src/components/Menu.tsx
|
|
1441
1463
|
var import_clsx10 = __toESM(require("clsx"), 1);
|
|
1442
|
-
var
|
|
1464
|
+
var import_react9 = require("react");
|
|
1443
1465
|
var import_react_dom = require("react-dom");
|
|
1444
1466
|
|
|
1445
1467
|
// src/components/useMenuSystem.tsx
|
|
1446
|
-
var
|
|
1468
|
+
var import_react8 = require("react");
|
|
1447
1469
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1448
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1470
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1449
1471
|
{}
|
|
1450
1472
|
);
|
|
1451
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1452
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1473
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1474
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1453
1475
|
null
|
|
1454
1476
|
);
|
|
1455
|
-
const menuRootRef = (0,
|
|
1456
|
-
const subMenuRefs = (0,
|
|
1457
|
-
const hoverTimeoutRef = (0,
|
|
1458
|
-
const closeTimeoutRef = (0,
|
|
1459
|
-
const mouseStopTimeoutRef = (0,
|
|
1460
|
-
const isMouseMovingRef = (0,
|
|
1461
|
-
const pendingOpenActionRef = (0,
|
|
1462
|
-
const pendingCloseActionRef = (0,
|
|
1477
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1478
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1479
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1480
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1481
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1482
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1483
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1484
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1463
1485
|
const isMobile = useMatchesMobile();
|
|
1464
1486
|
const toggleMenu = (menuId, level) => {
|
|
1465
1487
|
if (closeTimeoutRef.current) {
|
|
@@ -1499,7 +1521,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1499
1521
|
return newActiveMenus;
|
|
1500
1522
|
});
|
|
1501
1523
|
};
|
|
1502
|
-
const executePendingActions = (0,
|
|
1524
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1503
1525
|
if (pendingCloseActionRef.current) {
|
|
1504
1526
|
pendingCloseActionRef.current();
|
|
1505
1527
|
pendingCloseActionRef.current = null;
|
|
@@ -1588,7 +1610,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1588
1610
|
const isMenuActive = (menuId, level) => {
|
|
1589
1611
|
return activeMenus[level] === menuId;
|
|
1590
1612
|
};
|
|
1591
|
-
(0,
|
|
1613
|
+
(0, import_react8.useEffect)(() => {
|
|
1592
1614
|
const handleClickOutside = (event) => {
|
|
1593
1615
|
var _a;
|
|
1594
1616
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1607,7 +1629,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1607
1629
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1608
1630
|
};
|
|
1609
1631
|
}, [activeMenus]);
|
|
1610
|
-
(0,
|
|
1632
|
+
(0, import_react8.useEffect)(() => {
|
|
1611
1633
|
return () => {
|
|
1612
1634
|
if (hoverTimeoutRef.current) {
|
|
1613
1635
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1685,13 +1707,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1685
1707
|
};
|
|
1686
1708
|
}
|
|
1687
1709
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1688
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1710
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1689
1711
|
top: 0,
|
|
1690
1712
|
left: 0,
|
|
1691
1713
|
minWidth: 0
|
|
1692
1714
|
});
|
|
1693
1715
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1694
|
-
const updatePosition = (0,
|
|
1716
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1695
1717
|
var _a, _b, _c;
|
|
1696
1718
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1697
1719
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1739,7 +1761,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1739
1761
|
minWidth: triggerRect.width
|
|
1740
1762
|
});
|
|
1741
1763
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1742
|
-
(0,
|
|
1764
|
+
(0, import_react8.useEffect)(() => {
|
|
1743
1765
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1744
1766
|
const handleClickOutside = (event) => {
|
|
1745
1767
|
var _a, _b, _c, _d, _e;
|
|
@@ -1765,7 +1787,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1765
1787
|
options == null ? void 0 : options.menuRef,
|
|
1766
1788
|
options == null ? void 0 : options.additionalRefs
|
|
1767
1789
|
]);
|
|
1768
|
-
(0,
|
|
1790
|
+
(0, import_react8.useEffect)(() => {
|
|
1769
1791
|
updatePosition();
|
|
1770
1792
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1771
1793
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1846,9 +1868,9 @@ var Menu = (_a) => {
|
|
|
1846
1868
|
"menuName",
|
|
1847
1869
|
"calculateMinMaxHeight"
|
|
1848
1870
|
]);
|
|
1849
|
-
const internalRef = (0,
|
|
1871
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1850
1872
|
const actualRef = ref || internalRef;
|
|
1851
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1873
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1852
1874
|
const isMobile = useMatchesMobile();
|
|
1853
1875
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1854
1876
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1861,7 +1883,7 @@ var Menu = (_a) => {
|
|
|
1861
1883
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1862
1884
|
}
|
|
1863
1885
|
);
|
|
1864
|
-
(0,
|
|
1886
|
+
(0, import_react9.useEffect)(() => {
|
|
1865
1887
|
if (calculateMinMaxHeight) {
|
|
1866
1888
|
return;
|
|
1867
1889
|
}
|
|
@@ -1885,7 +1907,7 @@ var Menu = (_a) => {
|
|
|
1885
1907
|
cancelAnimationFrame(raf);
|
|
1886
1908
|
};
|
|
1887
1909
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1888
|
-
(0,
|
|
1910
|
+
(0, import_react9.useEffect)(() => {
|
|
1889
1911
|
if (!calculateMinMaxHeight) {
|
|
1890
1912
|
return;
|
|
1891
1913
|
}
|
|
@@ -1896,14 +1918,14 @@ var Menu = (_a) => {
|
|
|
1896
1918
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1897
1919
|
}
|
|
1898
1920
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1899
|
-
(0,
|
|
1921
|
+
(0, import_react9.useEffect)(() => {
|
|
1900
1922
|
if (!show) {
|
|
1901
1923
|
return;
|
|
1902
1924
|
}
|
|
1903
1925
|
initializeMenuFocus();
|
|
1904
1926
|
updatePosition();
|
|
1905
1927
|
}, [show, updatePosition]);
|
|
1906
|
-
(0,
|
|
1928
|
+
(0, import_react9.useEffect)(() => {
|
|
1907
1929
|
if (!show || !setShow) {
|
|
1908
1930
|
return;
|
|
1909
1931
|
}
|
|
@@ -2057,10 +2079,10 @@ var Menu = (_a) => {
|
|
|
2057
2079
|
Menu.displayName = "Menu";
|
|
2058
2080
|
|
|
2059
2081
|
// src/components/Search.tsx
|
|
2060
|
-
var
|
|
2082
|
+
var import_react11 = require("react");
|
|
2061
2083
|
|
|
2062
2084
|
// src/components/Input.tsx
|
|
2063
|
-
var
|
|
2085
|
+
var import_react10 = require("react");
|
|
2064
2086
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2065
2087
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2066
2088
|
var InputBase = (_a) => {
|
|
@@ -2117,9 +2139,9 @@ var InputBase = (_a) => {
|
|
|
2117
2139
|
"data-error": error && !focus || null,
|
|
2118
2140
|
"data-focus": focus || null
|
|
2119
2141
|
};
|
|
2120
|
-
const inputRef = (0,
|
|
2142
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
2121
2143
|
const inputId = id ? `${id}-input` : void 0;
|
|
2122
|
-
(0,
|
|
2144
|
+
(0, import_react10.useEffect)(() => {
|
|
2123
2145
|
var _a2;
|
|
2124
2146
|
const input = inputRef.current;
|
|
2125
2147
|
const focusHandler = () => {
|
|
@@ -2278,15 +2300,15 @@ var Input = (_a) => {
|
|
|
2278
2300
|
"testid",
|
|
2279
2301
|
"rightAdornment"
|
|
2280
2302
|
]);
|
|
2281
|
-
const [internalValue, setInternalValue] = (0,
|
|
2282
|
-
const [displayValue, setDisplayValue] = (0,
|
|
2283
|
-
(0,
|
|
2303
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
2304
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
2305
|
+
(0, import_react10.useEffect)(() => {
|
|
2284
2306
|
var _a2;
|
|
2285
2307
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
2286
2308
|
setInternalValue(stringValue);
|
|
2287
2309
|
setDisplayValue(stringValue);
|
|
2288
2310
|
}, [propValue]);
|
|
2289
|
-
(0,
|
|
2311
|
+
(0, import_react10.useEffect)(() => {
|
|
2290
2312
|
var _a2;
|
|
2291
2313
|
if (variant !== "currency") {
|
|
2292
2314
|
return;
|
|
@@ -2547,14 +2569,14 @@ var Search = (_a) => {
|
|
|
2547
2569
|
"removeRoundness",
|
|
2548
2570
|
"autocompletePadding"
|
|
2549
2571
|
]);
|
|
2550
|
-
const inputRef = (0,
|
|
2551
|
-
const inputContainerRef = (0,
|
|
2552
|
-
const preventFocusOnInitialRender = (0,
|
|
2553
|
-
const [show, setShow] = (0,
|
|
2554
|
-
const [clearing, setClearing] = (0,
|
|
2555
|
-
const uniqueId = (0,
|
|
2572
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2573
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2574
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2575
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2576
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2577
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2556
2578
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2557
|
-
(0,
|
|
2579
|
+
(0, import_react11.useEffect)(() => {
|
|
2558
2580
|
var _a2;
|
|
2559
2581
|
if (preventFocusOnInitialRender.current) {
|
|
2560
2582
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2638,7 +2660,7 @@ Search.displayName = "Search";
|
|
|
2638
2660
|
|
|
2639
2661
|
// src/components/DataGridCell.tsx
|
|
2640
2662
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2641
|
-
var DataGridCell = (0,
|
|
2663
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2642
2664
|
(_a) => {
|
|
2643
2665
|
var _b = _a, {
|
|
2644
2666
|
id,
|
|
@@ -2680,10 +2702,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2680
2702
|
"testid"
|
|
2681
2703
|
]);
|
|
2682
2704
|
const Element = type === "header" ? "th" : "td";
|
|
2683
|
-
const timerRef = (0,
|
|
2684
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2685
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2686
|
-
(0,
|
|
2705
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2706
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2707
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2708
|
+
(0, import_react12.useEffect)(() => {
|
|
2687
2709
|
return () => {
|
|
2688
2710
|
if (timerRef.current) {
|
|
2689
2711
|
clearTimeout(timerRef.current);
|
|
@@ -2793,12 +2815,12 @@ function DataCellHeader(_a) {
|
|
|
2793
2815
|
"useMenuDefaultMinWidth"
|
|
2794
2816
|
]);
|
|
2795
2817
|
var _a2;
|
|
2796
|
-
const [showMenu, setShowMenu] = (0,
|
|
2797
|
-
const [filter, setFilter] = (0,
|
|
2818
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2819
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2798
2820
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2799
2821
|
);
|
|
2800
|
-
const ref = (0,
|
|
2801
|
-
const predeterminedPinned = (0,
|
|
2822
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2823
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2802
2824
|
const { column, getContext } = header;
|
|
2803
2825
|
const { id: columnId, setFilterValue } = column;
|
|
2804
2826
|
const {
|
|
@@ -2808,14 +2830,14 @@ function DataCellHeader(_a) {
|
|
|
2808
2830
|
listeners: subMenuListeners,
|
|
2809
2831
|
mobileHide
|
|
2810
2832
|
} = useSubMenuSystem(node ? node : ref);
|
|
2811
|
-
(0,
|
|
2833
|
+
(0, import_react12.useEffect)(() => {
|
|
2812
2834
|
var _a3, _b2, _c;
|
|
2813
2835
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2814
2836
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2815
2837
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2816
2838
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2817
2839
|
}, [columnId, getContext]);
|
|
2818
|
-
(0,
|
|
2840
|
+
(0, import_react12.useEffect)(() => {
|
|
2819
2841
|
const handler = setTimeout(() => {
|
|
2820
2842
|
setFilterValue(filter);
|
|
2821
2843
|
}, 500);
|
|
@@ -3078,7 +3100,7 @@ function DragAlongCell(_a) {
|
|
|
3078
3100
|
DragAlongCell.displayName = "DragAlongCell";
|
|
3079
3101
|
|
|
3080
3102
|
// src/components/DataGrid/index.tsx
|
|
3081
|
-
var
|
|
3103
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
3082
3104
|
var import_react_table3 = require("@tanstack/react-table");
|
|
3083
3105
|
var import_core = require("@dnd-kit/core");
|
|
3084
3106
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -3106,7 +3128,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
3106
3128
|
}
|
|
3107
3129
|
|
|
3108
3130
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
3109
|
-
var
|
|
3131
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
3110
3132
|
|
|
3111
3133
|
// src/components/DataGrid/TableBody/index.tsx
|
|
3112
3134
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -3115,7 +3137,7 @@ var import_clsx15 = __toESM(require("clsx"), 1);
|
|
|
3115
3137
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
3116
3138
|
var import_clsx14 = __toESM(require("clsx"), 1);
|
|
3117
3139
|
var import_react_table = require("@tanstack/react-table");
|
|
3118
|
-
var
|
|
3140
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
3119
3141
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3120
3142
|
var valueFormatters = {
|
|
3121
3143
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -3183,7 +3205,7 @@ function TableBodyRow({
|
|
|
3183
3205
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
3184
3206
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
3185
3207
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
3186
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3208
|
+
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react13.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3187
3209
|
CellElement,
|
|
3188
3210
|
{
|
|
3189
3211
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -3397,10 +3419,10 @@ function TableBody({
|
|
|
3397
3419
|
}
|
|
3398
3420
|
|
|
3399
3421
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
3400
|
-
var
|
|
3422
|
+
var import_react15 = require("react");
|
|
3401
3423
|
|
|
3402
3424
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
3403
|
-
var
|
|
3425
|
+
var import_react14 = require("react");
|
|
3404
3426
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3405
3427
|
function ColumnSelectorMenuOption({
|
|
3406
3428
|
id,
|
|
@@ -3408,7 +3430,7 @@ function ColumnSelectorMenuOption({
|
|
|
3408
3430
|
column,
|
|
3409
3431
|
toggleColumnVisibility
|
|
3410
3432
|
}) {
|
|
3411
|
-
const [isVisible, setIsVisible] = (0,
|
|
3433
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(column.getIsVisible());
|
|
3412
3434
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
3413
3435
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3414
3436
|
Checkbox,
|
|
@@ -3434,8 +3456,8 @@ function ColumnSelectorHeaderCell({
|
|
|
3434
3456
|
toggleColumnVisibility,
|
|
3435
3457
|
resetColumnVisibility
|
|
3436
3458
|
}) {
|
|
3437
|
-
const ref = (0,
|
|
3438
|
-
const [show, setShow] = (0,
|
|
3459
|
+
const ref = (0, import_react15.useRef)(null);
|
|
3460
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
|
3439
3461
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3440
3462
|
DataGridCell,
|
|
3441
3463
|
{
|
|
@@ -3604,7 +3626,7 @@ function PinnedColumns(_a) {
|
|
|
3604
3626
|
header.id
|
|
3605
3627
|
);
|
|
3606
3628
|
}
|
|
3607
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react16.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3608
3630
|
Checkbox,
|
|
3609
3631
|
{
|
|
3610
3632
|
checked: allSelectedAcrossPages,
|
|
@@ -3686,23 +3708,23 @@ function DataGrid({
|
|
|
3686
3708
|
ref
|
|
3687
3709
|
}) {
|
|
3688
3710
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3689
|
-
(0,
|
|
3711
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
3690
3712
|
getSavedLayout: () => {
|
|
3691
3713
|
return getSavedLayout();
|
|
3692
3714
|
}
|
|
3693
3715
|
}));
|
|
3694
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3695
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3696
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3716
|
+
const [localSorting, setLocalSorting] = (0, import_react17.useState)([]);
|
|
3717
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react17.useState)([]);
|
|
3718
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react17.useState)({});
|
|
3697
3719
|
const {
|
|
3698
3720
|
columns: tableColumns,
|
|
3699
3721
|
setColumns: setTableColumns,
|
|
3700
3722
|
getSavedLayout
|
|
3701
3723
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3702
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3724
|
+
const [columnOrder, setColumnOrder] = (0, import_react17.useState)(
|
|
3703
3725
|
tableColumns.map((c) => c.id)
|
|
3704
3726
|
);
|
|
3705
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3727
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react17.useState)(
|
|
3706
3728
|
Object.fromEntries(
|
|
3707
3729
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3708
3730
|
var _a2, _b2;
|
|
@@ -3710,7 +3732,7 @@ function DataGrid({
|
|
|
3710
3732
|
})
|
|
3711
3733
|
)
|
|
3712
3734
|
);
|
|
3713
|
-
const updateColumnVisibility = (0,
|
|
3735
|
+
const updateColumnVisibility = (0, import_react17.useCallback)(
|
|
3714
3736
|
(updateOrder) => {
|
|
3715
3737
|
setColumnVisibility(
|
|
3716
3738
|
Object.fromEntries(
|
|
@@ -3724,7 +3746,7 @@ function DataGrid({
|
|
|
3724
3746
|
},
|
|
3725
3747
|
[tableColumns]
|
|
3726
3748
|
);
|
|
3727
|
-
const resetDefaultColumnVisibility = (0,
|
|
3749
|
+
const resetDefaultColumnVisibility = (0, import_react17.useCallback)(() => {
|
|
3728
3750
|
setTableColumns((prev) => {
|
|
3729
3751
|
columns.forEach((column) => {
|
|
3730
3752
|
var _a2, _b2;
|
|
@@ -3740,7 +3762,7 @@ function DataGrid({
|
|
|
3740
3762
|
return [...prev];
|
|
3741
3763
|
}, true);
|
|
3742
3764
|
}, [columns, setTableColumns]);
|
|
3743
|
-
(0,
|
|
3765
|
+
(0, import_react17.useEffect)(() => {
|
|
3744
3766
|
updateColumnVisibility(true);
|
|
3745
3767
|
}, [updateColumnVisibility]);
|
|
3746
3768
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3756,7 +3778,7 @@ function DataGrid({
|
|
|
3756
3778
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3757
3779
|
} : setLocalColumnFilters;
|
|
3758
3780
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3759
|
-
const setRowSelection = (0,
|
|
3781
|
+
const setRowSelection = (0, import_react17.useCallback)(
|
|
3760
3782
|
(updaterOrValue) => {
|
|
3761
3783
|
if (pagination) {
|
|
3762
3784
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3770,9 +3792,9 @@ function DataGrid({
|
|
|
3770
3792
|
},
|
|
3771
3793
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3772
3794
|
);
|
|
3773
|
-
const dndId = (0,
|
|
3774
|
-
const containerRef =
|
|
3775
|
-
const toggleColumnVisibility = (0,
|
|
3795
|
+
const dndId = (0, import_react17.useId)();
|
|
3796
|
+
const containerRef = import_react17.default.useRef(null);
|
|
3797
|
+
const toggleColumnVisibility = (0, import_react17.useCallback)(
|
|
3776
3798
|
(columnId, isVisible) => {
|
|
3777
3799
|
setTableColumns((prev) => {
|
|
3778
3800
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -4020,7 +4042,7 @@ function DataGrid({
|
|
|
4020
4042
|
header.id
|
|
4021
4043
|
);
|
|
4022
4044
|
}
|
|
4023
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react17.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4024
4046
|
DataGridCell,
|
|
4025
4047
|
{
|
|
4026
4048
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -4226,7 +4248,7 @@ function adaptTableStateSetter(setter) {
|
|
|
4226
4248
|
}
|
|
4227
4249
|
|
|
4228
4250
|
// src/components/Select.tsx
|
|
4229
|
-
var
|
|
4251
|
+
var import_react18 = require("react");
|
|
4230
4252
|
var import_clsx18 = __toESM(require("clsx"), 1);
|
|
4231
4253
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4232
4254
|
var Select = (_a) => {
|
|
@@ -4260,11 +4282,11 @@ var Select = (_a) => {
|
|
|
4260
4282
|
"value"
|
|
4261
4283
|
]);
|
|
4262
4284
|
var _a2;
|
|
4263
|
-
const inputRef = (0,
|
|
4264
|
-
const inputContainerRef = (0,
|
|
4265
|
-
const preventFocusOnInitialRender = (0,
|
|
4266
|
-
const [show, setShow] = (0,
|
|
4267
|
-
(0,
|
|
4285
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
4286
|
+
const inputContainerRef = (0, import_react18.useRef)(null);
|
|
4287
|
+
const preventFocusOnInitialRender = (0, import_react18.useRef)(true);
|
|
4288
|
+
const [show, setShow] = (0, import_react18.useState)(false);
|
|
4289
|
+
(0, import_react18.useEffect)(() => {
|
|
4268
4290
|
var _a3;
|
|
4269
4291
|
if (preventFocusOnInitialRender.current) {
|
|
4270
4292
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4562,7 +4584,7 @@ Button.displayName = "Button";
|
|
|
4562
4584
|
|
|
4563
4585
|
// src/components/Tooltip.tsx
|
|
4564
4586
|
var import_clsx21 = __toESM(require("clsx"), 1);
|
|
4565
|
-
var
|
|
4587
|
+
var import_react19 = require("react");
|
|
4566
4588
|
var import_react_dom2 = require("react-dom");
|
|
4567
4589
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4568
4590
|
var Tooltip = ({
|
|
@@ -4575,11 +4597,11 @@ var Tooltip = ({
|
|
|
4575
4597
|
offset = 8,
|
|
4576
4598
|
keepHidden = false
|
|
4577
4599
|
}) => {
|
|
4578
|
-
const ref = (0,
|
|
4579
|
-
const tooltipRef = (0,
|
|
4580
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4581
|
-
const [isVisible, setIsVisible] = (0,
|
|
4582
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4600
|
+
const ref = (0, import_react19.useRef)(null);
|
|
4601
|
+
const tooltipRef = (0, import_react19.useRef)(null);
|
|
4602
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react19.useState)({ top: 0, left: 0 });
|
|
4603
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
4604
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react19.useState)(false);
|
|
4583
4605
|
const updatePosition = () => {
|
|
4584
4606
|
if (!ref.current || !tooltipRef.current) return;
|
|
4585
4607
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4618,14 +4640,14 @@ var Tooltip = ({
|
|
|
4618
4640
|
setIsVisible(false);
|
|
4619
4641
|
setRemoveOpacity(false);
|
|
4620
4642
|
};
|
|
4621
|
-
(0,
|
|
4643
|
+
(0, import_react19.useEffect)(() => {
|
|
4622
4644
|
if (isVisible && tooltipRef.current) {
|
|
4623
4645
|
requestAnimationFrame(() => {
|
|
4624
4646
|
updatePosition();
|
|
4625
4647
|
});
|
|
4626
4648
|
}
|
|
4627
4649
|
}, [isVisible]);
|
|
4628
|
-
(0,
|
|
4650
|
+
(0, import_react19.useEffect)(() => {
|
|
4629
4651
|
if (isVisible) {
|
|
4630
4652
|
window.addEventListener("resize", updatePosition);
|
|
4631
4653
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4683,12 +4705,12 @@ var Tooltip = ({
|
|
|
4683
4705
|
Tooltip.displayName = "Tooltip";
|
|
4684
4706
|
|
|
4685
4707
|
// src/components/DateInput.tsx
|
|
4686
|
-
var
|
|
4708
|
+
var import_react21 = require("react");
|
|
4687
4709
|
var import_react_dom3 = require("react-dom");
|
|
4688
4710
|
|
|
4689
4711
|
// src/components/CalendarRange.tsx
|
|
4690
4712
|
var import_clsx22 = __toESM(require("clsx"), 1);
|
|
4691
|
-
var
|
|
4713
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
4692
4714
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4693
4715
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4694
4716
|
function DateCell(_a) {
|
|
@@ -4801,20 +4823,20 @@ function CalendarRange({
|
|
|
4801
4823
|
const fromDate = parseDate(from);
|
|
4802
4824
|
const toDate = parseDate(to);
|
|
4803
4825
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4804
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4826
|
+
const [baseMonth, setBaseMonth] = (0, import_react20.useState)(
|
|
4805
4827
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4806
4828
|
);
|
|
4807
|
-
const [selecting, setSelecting] = (0,
|
|
4808
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4809
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4810
|
-
(0,
|
|
4829
|
+
const [selecting, setSelecting] = (0, import_react20.useState)("from");
|
|
4830
|
+
const [pendingFrom, setPendingFrom] = (0, import_react20.useState)(void 0);
|
|
4831
|
+
const [hoveredDate, setHoveredDate] = (0, import_react20.useState)(void 0);
|
|
4832
|
+
(0, import_react20.useEffect)(() => {
|
|
4811
4833
|
if (fromDate) {
|
|
4812
4834
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4813
4835
|
} else if (toDate) {
|
|
4814
4836
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4815
4837
|
}
|
|
4816
4838
|
}, [from, to]);
|
|
4817
|
-
(0,
|
|
4839
|
+
(0, import_react20.useEffect)(() => {
|
|
4818
4840
|
if (fromDate && toDate) {
|
|
4819
4841
|
setSelecting("from");
|
|
4820
4842
|
setPendingFrom(void 0);
|
|
@@ -4960,14 +4982,14 @@ function CalendarPane({
|
|
|
4960
4982
|
const years = Array.from({ length: 100 }).map(
|
|
4961
4983
|
(_, i) => baseMonth.year - 50 + i
|
|
4962
4984
|
);
|
|
4963
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4964
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4965
|
-
const monthMenuRef = (0,
|
|
4966
|
-
const yearMenuRef = (0,
|
|
4985
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react20.useState)(false);
|
|
4986
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react20.useState)(false);
|
|
4987
|
+
const monthMenuRef = (0, import_react20.useRef)(null);
|
|
4988
|
+
const yearMenuRef = (0, import_react20.useRef)(null);
|
|
4967
4989
|
const month = getMonthData(offset);
|
|
4968
4990
|
const totalCells = 42;
|
|
4969
4991
|
const emptyCells = month.firstDayOffset;
|
|
4970
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react20.default.Fragment, { children: [
|
|
4971
4993
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4972
4994
|
"div",
|
|
4973
4995
|
{
|
|
@@ -5175,24 +5197,24 @@ var DateInput = (_a) => {
|
|
|
5175
5197
|
"label",
|
|
5176
5198
|
"isDateAvailable"
|
|
5177
5199
|
]);
|
|
5178
|
-
const [visible, setVisible] = (0,
|
|
5179
|
-
const [inputValue, setInputValue] = (0,
|
|
5180
|
-
const [isTyping, setIsTyping] = (0,
|
|
5181
|
-
const popoverRef = (0,
|
|
5182
|
-
const triggerRef = (0,
|
|
5183
|
-
const rootRef = (0,
|
|
5184
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
5200
|
+
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
5201
|
+
const [inputValue, setInputValue] = (0, import_react21.useState)("");
|
|
5202
|
+
const [isTyping, setIsTyping] = (0, import_react21.useState)(false);
|
|
5203
|
+
const popoverRef = (0, import_react21.useRef)(null);
|
|
5204
|
+
const triggerRef = (0, import_react21.useRef)(null);
|
|
5205
|
+
const rootRef = (0, import_react21.useRef)(null);
|
|
5206
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react21.useState)({
|
|
5185
5207
|
top: 0,
|
|
5186
5208
|
left: 0,
|
|
5187
5209
|
width: 0
|
|
5188
5210
|
});
|
|
5189
5211
|
const [from, to] = [value, ""];
|
|
5190
|
-
(0,
|
|
5212
|
+
(0, import_react21.useEffect)(() => {
|
|
5191
5213
|
if (!isTyping) {
|
|
5192
5214
|
setInputValue(formatDisplayValue(from));
|
|
5193
5215
|
}
|
|
5194
5216
|
}, [from, isTyping]);
|
|
5195
|
-
(0,
|
|
5217
|
+
(0, import_react21.useLayoutEffect)(() => {
|
|
5196
5218
|
if (visible) {
|
|
5197
5219
|
updatePosition();
|
|
5198
5220
|
}
|
|
@@ -5207,7 +5229,7 @@ var DateInput = (_a) => {
|
|
|
5207
5229
|
});
|
|
5208
5230
|
}
|
|
5209
5231
|
};
|
|
5210
|
-
(0,
|
|
5232
|
+
(0, import_react21.useEffect)(() => {
|
|
5211
5233
|
updatePosition();
|
|
5212
5234
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
5213
5235
|
if (triggerRef.current) {
|
|
@@ -5219,7 +5241,7 @@ var DateInput = (_a) => {
|
|
|
5219
5241
|
window.removeEventListener("scroll", updatePosition);
|
|
5220
5242
|
};
|
|
5221
5243
|
}, []);
|
|
5222
|
-
(0,
|
|
5244
|
+
(0, import_react21.useEffect)(() => {
|
|
5223
5245
|
const handleKeyDown2 = (event) => {
|
|
5224
5246
|
var _a2;
|
|
5225
5247
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -5232,7 +5254,7 @@ var DateInput = (_a) => {
|
|
|
5232
5254
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
5233
5255
|
};
|
|
5234
5256
|
});
|
|
5235
|
-
(0,
|
|
5257
|
+
(0, import_react21.useEffect)(() => {
|
|
5236
5258
|
const handleClickOutside = (event) => {
|
|
5237
5259
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
5238
5260
|
setVisible(false);
|
|
@@ -5393,18 +5415,18 @@ var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
|
5393
5415
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5394
5416
|
|
|
5395
5417
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5396
|
-
var
|
|
5418
|
+
var import_react23 = require("react");
|
|
5397
5419
|
|
|
5398
5420
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5399
|
-
var
|
|
5400
|
-
var GridContext = (0,
|
|
5421
|
+
var import_react22 = require("react");
|
|
5422
|
+
var GridContext = (0, import_react22.createContext)(null);
|
|
5401
5423
|
|
|
5402
5424
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5403
5425
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5404
5426
|
|
|
5405
5427
|
// src/components/Modal.tsx
|
|
5406
5428
|
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
5407
|
-
var
|
|
5429
|
+
var import_react25 = require("react");
|
|
5408
5430
|
|
|
5409
5431
|
// src/components/ModalHeader.tsx
|
|
5410
5432
|
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
@@ -5580,10 +5602,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
5580
5602
|
var import_react_use = require("react-use");
|
|
5581
5603
|
|
|
5582
5604
|
// src/components/useMounted.tsx
|
|
5583
|
-
var
|
|
5605
|
+
var import_react24 = require("react");
|
|
5584
5606
|
var useMounted = () => {
|
|
5585
|
-
const [isMounted, setIsMounted] = (0,
|
|
5586
|
-
(0,
|
|
5607
|
+
const [isMounted, setIsMounted] = (0, import_react24.useState)(false);
|
|
5608
|
+
(0, import_react24.useEffect)(() => {
|
|
5587
5609
|
setIsMounted(true);
|
|
5588
5610
|
return () => setIsMounted(false);
|
|
5589
5611
|
}, []);
|
|
@@ -5677,12 +5699,12 @@ var Modal = ({
|
|
|
5677
5699
|
}) => {
|
|
5678
5700
|
var _a;
|
|
5679
5701
|
const mounted = useMounted();
|
|
5680
|
-
const modalRef = (0,
|
|
5681
|
-
const bgRef = (0,
|
|
5702
|
+
const modalRef = (0, import_react25.useRef)(null);
|
|
5703
|
+
const bgRef = (0, import_react25.useRef)(null);
|
|
5682
5704
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5683
5705
|
const isMobile = useMatchesMobile();
|
|
5684
5706
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5685
|
-
(0,
|
|
5707
|
+
(0, import_react25.useEffect)(() => {
|
|
5686
5708
|
if (!mounted) return;
|
|
5687
5709
|
if (!modalRef.current || !bgRef.current) {
|
|
5688
5710
|
console.error("Modal or background reference is not set.");
|
|
@@ -5702,7 +5724,7 @@ var Modal = ({
|
|
|
5702
5724
|
bgFadeIn(bgRef.current);
|
|
5703
5725
|
}
|
|
5704
5726
|
}, [mounted, onClose, open, wasOpen]);
|
|
5705
|
-
const handleKeyDown = (0,
|
|
5727
|
+
const handleKeyDown = (0, import_react25.useCallback)(
|
|
5706
5728
|
(e) => {
|
|
5707
5729
|
if (e.key === "Escape") {
|
|
5708
5730
|
if (onClose) {
|
|
@@ -5713,12 +5735,12 @@ var Modal = ({
|
|
|
5713
5735
|
},
|
|
5714
5736
|
[onClose]
|
|
5715
5737
|
);
|
|
5716
|
-
const handleClose = (0,
|
|
5738
|
+
const handleClose = (0, import_react25.useCallback)(() => {
|
|
5717
5739
|
if (onClose) {
|
|
5718
5740
|
onClose();
|
|
5719
5741
|
}
|
|
5720
5742
|
}, [onClose]);
|
|
5721
|
-
(0,
|
|
5743
|
+
(0, import_react25.useEffect)(() => {
|
|
5722
5744
|
if (open) {
|
|
5723
5745
|
document.addEventListener("keyup", handleKeyDown);
|
|
5724
5746
|
}
|
|
@@ -5726,7 +5748,7 @@ var Modal = ({
|
|
|
5726
5748
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5727
5749
|
};
|
|
5728
5750
|
}, [open, handleKeyDown]);
|
|
5729
|
-
(0,
|
|
5751
|
+
(0, import_react25.useEffect)(() => {
|
|
5730
5752
|
if (!open) return;
|
|
5731
5753
|
const scrollY = window.scrollY;
|
|
5732
5754
|
const body = document.body;
|
|
@@ -5747,7 +5769,7 @@ var Modal = ({
|
|
|
5747
5769
|
};
|
|
5748
5770
|
}, [open]);
|
|
5749
5771
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5750
|
-
const backgroundClickHandler = (0,
|
|
5772
|
+
const backgroundClickHandler = (0, import_react25.useCallback)(
|
|
5751
5773
|
(e) => {
|
|
5752
5774
|
const target = e.target;
|
|
5753
5775
|
const currentTarget = e.currentTarget;
|
|
@@ -5834,9 +5856,9 @@ var Modal = ({
|
|
|
5834
5856
|
Modal.displayName = "Modal";
|
|
5835
5857
|
|
|
5836
5858
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5837
|
-
var
|
|
5859
|
+
var import_react26 = require("react");
|
|
5838
5860
|
function useGridContext() {
|
|
5839
|
-
const ctx = (0,
|
|
5861
|
+
const ctx = (0, import_react26.useContext)(GridContext);
|
|
5840
5862
|
if (!ctx) {
|
|
5841
5863
|
throw new Error("useGridContext must be used within GridContextProvider");
|
|
5842
5864
|
}
|
|
@@ -5866,10 +5888,10 @@ var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
|
5866
5888
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5867
5889
|
|
|
5868
5890
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5869
|
-
var
|
|
5891
|
+
var import_react28 = require("react");
|
|
5870
5892
|
|
|
5871
5893
|
// src/components/ImagePlaceholder.tsx
|
|
5872
|
-
var
|
|
5894
|
+
var import_react27 = require("react");
|
|
5873
5895
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5874
5896
|
|
|
5875
5897
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5880,11 +5902,11 @@ var import_clsx32 = __toESM(require("clsx"), 1);
|
|
|
5880
5902
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5881
5903
|
|
|
5882
5904
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5883
|
-
var
|
|
5905
|
+
var import_react29 = require("react");
|
|
5884
5906
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5885
5907
|
|
|
5886
5908
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5887
|
-
var
|
|
5909
|
+
var import_react30 = require("react");
|
|
5888
5910
|
|
|
5889
5911
|
// src/components/Surface.tsx
|
|
5890
5912
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
@@ -5929,17 +5951,17 @@ var import_clsx34 = require("clsx");
|
|
|
5929
5951
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5930
5952
|
|
|
5931
5953
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5932
|
-
var
|
|
5954
|
+
var import_react31 = require("react");
|
|
5933
5955
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5934
5956
|
|
|
5935
5957
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5936
|
-
var
|
|
5958
|
+
var import_react32 = require("react");
|
|
5937
5959
|
|
|
5938
5960
|
// src/components/ProductImagePreview/index.tsx
|
|
5939
5961
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5940
5962
|
|
|
5941
5963
|
// src/components/CompactImagesPreview.tsx
|
|
5942
|
-
var
|
|
5964
|
+
var import_react33 = require("react");
|
|
5943
5965
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
5944
5966
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5945
5967
|
|
|
@@ -5948,12 +5970,12 @@ var import_clsx36 = __toESM(require("clsx"), 1);
|
|
|
5948
5970
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5949
5971
|
|
|
5950
5972
|
// src/components/ListGroup.tsx
|
|
5951
|
-
var
|
|
5973
|
+
var import_react34 = require("react");
|
|
5952
5974
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5953
5975
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5954
5976
|
|
|
5955
5977
|
// src/components/Pagination.tsx
|
|
5956
|
-
var
|
|
5978
|
+
var import_react35 = require("react");
|
|
5957
5979
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5958
5980
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5959
5981
|
var Pagination = ({
|
|
@@ -5965,7 +5987,7 @@ var Pagination = ({
|
|
|
5965
5987
|
className,
|
|
5966
5988
|
disabled
|
|
5967
5989
|
}) => {
|
|
5968
|
-
const goTo = (0,
|
|
5990
|
+
const goTo = (0, import_react35.useCallback)(
|
|
5969
5991
|
(page) => {
|
|
5970
5992
|
if (disabled) return;
|
|
5971
5993
|
onPageChange(page);
|
|
@@ -5982,7 +6004,7 @@ var Pagination = ({
|
|
|
5982
6004
|
goTo(currentPage + 1);
|
|
5983
6005
|
}
|
|
5984
6006
|
};
|
|
5985
|
-
const pageTokens = (0,
|
|
6007
|
+
const pageTokens = (0, import_react35.useMemo)(() => {
|
|
5986
6008
|
if (totalPages <= 5) {
|
|
5987
6009
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5988
6010
|
}
|
|
@@ -6105,21 +6127,21 @@ var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
|
6105
6127
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6106
6128
|
|
|
6107
6129
|
// src/components/SearchResultImage/index.tsx
|
|
6108
|
-
var
|
|
6130
|
+
var import_react36 = require("react");
|
|
6109
6131
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6110
6132
|
|
|
6111
6133
|
// src/components/Alert.tsx
|
|
6112
6134
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
6113
|
-
var
|
|
6135
|
+
var import_react37 = require("react");
|
|
6114
6136
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
6115
6137
|
|
|
6116
6138
|
// src/components/OrderCheckIcon.tsx
|
|
6117
6139
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6118
6140
|
|
|
6119
6141
|
// src/components/EditingContext.tsx
|
|
6120
|
-
var
|
|
6142
|
+
var import_react38 = require("react");
|
|
6121
6143
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
6122
|
-
var EditingContext = (0,
|
|
6144
|
+
var EditingContext = (0, import_react38.createContext)(null);
|
|
6123
6145
|
|
|
6124
6146
|
// src/components/AccessCard.tsx
|
|
6125
6147
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
@@ -6253,15 +6275,15 @@ var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
|
6253
6275
|
|
|
6254
6276
|
// src/components/AccessCardGroup.tsx
|
|
6255
6277
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
6256
|
-
var
|
|
6278
|
+
var import_react39 = require("react");
|
|
6257
6279
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6258
6280
|
|
|
6259
6281
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
6260
6282
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6261
6283
|
function ColumnSelector() {
|
|
6262
6284
|
const context = useGridContext();
|
|
6263
|
-
const ref = (0,
|
|
6264
|
-
const [show, setShow] = (0,
|
|
6285
|
+
const ref = (0, import_react40.useRef)(null);
|
|
6286
|
+
const [show, setShow] = (0, import_react40.useState)(false);
|
|
6265
6287
|
const {
|
|
6266
6288
|
columns,
|
|
6267
6289
|
id,
|
|
@@ -6272,7 +6294,7 @@ function ColumnSelector() {
|
|
|
6272
6294
|
resetColumnVisibility,
|
|
6273
6295
|
dispatch
|
|
6274
6296
|
} = context;
|
|
6275
|
-
const toggleColumnVisibility = (0,
|
|
6297
|
+
const toggleColumnVisibility = (0, import_react40.useCallback)(
|
|
6276
6298
|
(index, visible) => {
|
|
6277
6299
|
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
6278
6300
|
},
|