@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_react37 = 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,10 +5415,10 @@ var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
|
5393
5415
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5394
5416
|
|
|
5395
5417
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5396
|
-
var
|
|
5418
|
+
var import_react23 = require("react");
|
|
5397
5419
|
|
|
5398
5420
|
// src/components/ImagePlaceholder.tsx
|
|
5399
|
-
var
|
|
5421
|
+
var import_react22 = require("react");
|
|
5400
5422
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5401
5423
|
|
|
5402
5424
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5407,11 +5429,11 @@ var import_clsx25 = __toESM(require("clsx"), 1);
|
|
|
5407
5429
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5408
5430
|
|
|
5409
5431
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5410
|
-
var
|
|
5432
|
+
var import_react24 = require("react");
|
|
5411
5433
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5412
5434
|
|
|
5413
5435
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5414
|
-
var
|
|
5436
|
+
var import_react25 = require("react");
|
|
5415
5437
|
|
|
5416
5438
|
// src/components/Surface.tsx
|
|
5417
5439
|
var import_clsx26 = __toESM(require("clsx"), 1);
|
|
@@ -5456,17 +5478,17 @@ var import_clsx27 = require("clsx");
|
|
|
5456
5478
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
5457
5479
|
|
|
5458
5480
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5459
|
-
var
|
|
5481
|
+
var import_react26 = require("react");
|
|
5460
5482
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5461
5483
|
|
|
5462
5484
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5463
|
-
var
|
|
5485
|
+
var import_react27 = require("react");
|
|
5464
5486
|
|
|
5465
5487
|
// src/components/ProductImagePreview/index.tsx
|
|
5466
5488
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5467
5489
|
|
|
5468
5490
|
// src/components/CompactImagesPreview.tsx
|
|
5469
|
-
var
|
|
5491
|
+
var import_react28 = require("react");
|
|
5470
5492
|
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
5471
5493
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
5472
5494
|
|
|
@@ -5475,12 +5497,12 @@ var import_clsx29 = __toESM(require("clsx"), 1);
|
|
|
5475
5497
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
5476
5498
|
|
|
5477
5499
|
// src/components/ListGroup.tsx
|
|
5478
|
-
var
|
|
5500
|
+
var import_react29 = require("react");
|
|
5479
5501
|
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
5480
5502
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5481
5503
|
|
|
5482
5504
|
// src/components/Pagination.tsx
|
|
5483
|
-
var
|
|
5505
|
+
var import_react30 = require("react");
|
|
5484
5506
|
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
5485
5507
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5486
5508
|
var Pagination = ({
|
|
@@ -5492,7 +5514,7 @@ var Pagination = ({
|
|
|
5492
5514
|
className,
|
|
5493
5515
|
disabled
|
|
5494
5516
|
}) => {
|
|
5495
|
-
const goTo = (0,
|
|
5517
|
+
const goTo = (0, import_react30.useCallback)(
|
|
5496
5518
|
(page) => {
|
|
5497
5519
|
if (disabled) return;
|
|
5498
5520
|
onPageChange(page);
|
|
@@ -5509,7 +5531,7 @@ var Pagination = ({
|
|
|
5509
5531
|
goTo(currentPage + 1);
|
|
5510
5532
|
}
|
|
5511
5533
|
};
|
|
5512
|
-
const pageTokens = (0,
|
|
5534
|
+
const pageTokens = (0, import_react30.useMemo)(() => {
|
|
5513
5535
|
if (totalPages <= 5) {
|
|
5514
5536
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5515
5537
|
}
|
|
@@ -5632,21 +5654,21 @@ var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
|
5632
5654
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5633
5655
|
|
|
5634
5656
|
// src/components/SearchResultImage/index.tsx
|
|
5635
|
-
var
|
|
5657
|
+
var import_react31 = require("react");
|
|
5636
5658
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5637
5659
|
|
|
5638
5660
|
// src/components/Alert.tsx
|
|
5639
5661
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
5640
|
-
var
|
|
5662
|
+
var import_react32 = require("react");
|
|
5641
5663
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5642
5664
|
|
|
5643
5665
|
// src/components/OrderCheckIcon.tsx
|
|
5644
5666
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5645
5667
|
|
|
5646
5668
|
// src/components/EditingContext.tsx
|
|
5647
|
-
var
|
|
5669
|
+
var import_react33 = require("react");
|
|
5648
5670
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5649
|
-
var EditingContext = (0,
|
|
5671
|
+
var EditingContext = (0, import_react33.createContext)(null);
|
|
5650
5672
|
|
|
5651
5673
|
// src/components/AccessCard.tsx
|
|
5652
5674
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
@@ -5780,19 +5802,19 @@ var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
|
5780
5802
|
|
|
5781
5803
|
// src/components/AccessCardGroup.tsx
|
|
5782
5804
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
5783
|
-
var
|
|
5805
|
+
var import_react34 = require("react");
|
|
5784
5806
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5785
5807
|
|
|
5786
5808
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5787
|
-
var
|
|
5809
|
+
var import_react36 = require("react");
|
|
5788
5810
|
|
|
5789
5811
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5790
|
-
var
|
|
5791
|
-
var GridContext = (0,
|
|
5812
|
+
var import_react35 = require("react");
|
|
5813
|
+
var GridContext = (0, import_react35.createContext)(null);
|
|
5792
5814
|
|
|
5793
5815
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5794
5816
|
function useGridContext() {
|
|
5795
|
-
const ctx = (0,
|
|
5817
|
+
const ctx = (0, import_react36.useContext)(GridContext);
|
|
5796
5818
|
if (!ctx) {
|
|
5797
5819
|
throw new Error("useGridContext must be used within GridContextProvider");
|
|
5798
5820
|
}
|
|
@@ -5803,8 +5825,8 @@ function useGridContext() {
|
|
|
5803
5825
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5804
5826
|
function ColumnSelector() {
|
|
5805
5827
|
const context = useGridContext();
|
|
5806
|
-
const ref = (0,
|
|
5807
|
-
const [show, setShow] = (0,
|
|
5828
|
+
const ref = (0, import_react37.useRef)(null);
|
|
5829
|
+
const [show, setShow] = (0, import_react37.useState)(false);
|
|
5808
5830
|
const {
|
|
5809
5831
|
columns,
|
|
5810
5832
|
id,
|
|
@@ -5815,7 +5837,7 @@ function ColumnSelector() {
|
|
|
5815
5837
|
resetColumnVisibility,
|
|
5816
5838
|
dispatch
|
|
5817
5839
|
} = context;
|
|
5818
|
-
const toggleColumnVisibility = (0,
|
|
5840
|
+
const toggleColumnVisibility = (0, import_react37.useCallback)(
|
|
5819
5841
|
(index, visible) => {
|
|
5820
5842
|
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
5821
5843
|
},
|
|
@@ -5970,7 +5992,7 @@ function MobileDataGridHeader({
|
|
|
5970
5992
|
}
|
|
5971
5993
|
|
|
5972
5994
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5973
|
-
var
|
|
5995
|
+
var import_react38 = require("react");
|
|
5974
5996
|
|
|
5975
5997
|
// src/components/MobileDataGrid/dataGridReducer.ts
|
|
5976
5998
|
function dataGridReducer(state, action) {
|
|
@@ -6013,10 +6035,10 @@ function GridContextProvider(props) {
|
|
|
6013
6035
|
getId,
|
|
6014
6036
|
onRowSelect
|
|
6015
6037
|
} = props;
|
|
6016
|
-
const [columns, dispatch] = (0,
|
|
6017
|
-
const [selectedRowIds, setSelectedRowIds] = (0,
|
|
6018
|
-
const [currentRow, setCurrentRow] = (0,
|
|
6019
|
-
const resetColumnVisibility = (0,
|
|
6038
|
+
const [columns, dispatch] = (0, import_react38.useReducer)(dataGridReducer, initialColumns);
|
|
6039
|
+
const [selectedRowIds, setSelectedRowIds] = (0, import_react38.useState)([]);
|
|
6040
|
+
const [currentRow, setCurrentRow] = (0, import_react38.useState)(null);
|
|
6041
|
+
const resetColumnVisibility = (0, import_react38.useCallback)(() => {
|
|
6020
6042
|
const newColumns = columns.map((column) => {
|
|
6021
6043
|
var _a;
|
|
6022
6044
|
const initialColumn = initialColumns.find((c) => c.id === column.id);
|
|
@@ -6028,7 +6050,7 @@ function GridContextProvider(props) {
|
|
|
6028
6050
|
});
|
|
6029
6051
|
dispatch({ type: "SET", payload: newColumns });
|
|
6030
6052
|
}, [columns, initialColumns]);
|
|
6031
|
-
const handleRowSelect = (0,
|
|
6053
|
+
const handleRowSelect = (0, import_react38.useCallback)(
|
|
6032
6054
|
(item) => {
|
|
6033
6055
|
var _a;
|
|
6034
6056
|
const rowId = (_a = getId(item)) != null ? _a : "";
|
|
@@ -6039,7 +6061,7 @@ function GridContextProvider(props) {
|
|
|
6039
6061
|
},
|
|
6040
6062
|
[getId, onRowSelect, selectedRowIds]
|
|
6041
6063
|
);
|
|
6042
|
-
const handleRowSelectAll = (0,
|
|
6064
|
+
const handleRowSelectAll = (0, import_react38.useCallback)(() => {
|
|
6043
6065
|
setSelectedRowIds((prev) => {
|
|
6044
6066
|
if (prev.length === data.length) {
|
|
6045
6067
|
return [];
|
|
@@ -6047,13 +6069,13 @@ function GridContextProvider(props) {
|
|
|
6047
6069
|
return data.map(getId).filter((id2) => id2 !== void 0);
|
|
6048
6070
|
});
|
|
6049
6071
|
}, [data, getId]);
|
|
6050
|
-
const openRowDetail = (0,
|
|
6072
|
+
const openRowDetail = (0, import_react38.useCallback)((row) => {
|
|
6051
6073
|
setCurrentRow(row);
|
|
6052
6074
|
}, []);
|
|
6053
|
-
const closeRowDetail = (0,
|
|
6075
|
+
const closeRowDetail = (0, import_react38.useCallback)(() => {
|
|
6054
6076
|
setCurrentRow(null);
|
|
6055
6077
|
}, []);
|
|
6056
|
-
const visibleColumns = (0,
|
|
6078
|
+
const visibleColumns = (0, import_react38.useMemo)(() => {
|
|
6057
6079
|
const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
|
|
6058
6080
|
if (primaryKey) {
|
|
6059
6081
|
const pkColumn = columns.find((col) => col.id === String(primaryKey));
|
|
@@ -6100,7 +6122,7 @@ function GridContextProvider(props) {
|
|
|
6100
6122
|
|
|
6101
6123
|
// src/components/Modal.tsx
|
|
6102
6124
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
6103
|
-
var
|
|
6125
|
+
var import_react40 = require("react");
|
|
6104
6126
|
|
|
6105
6127
|
// src/components/ModalHeader.tsx
|
|
6106
6128
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
@@ -6276,10 +6298,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
6276
6298
|
var import_react_use = require("react-use");
|
|
6277
6299
|
|
|
6278
6300
|
// src/components/useMounted.tsx
|
|
6279
|
-
var
|
|
6301
|
+
var import_react39 = require("react");
|
|
6280
6302
|
var useMounted = () => {
|
|
6281
|
-
const [isMounted, setIsMounted] = (0,
|
|
6282
|
-
(0,
|
|
6303
|
+
const [isMounted, setIsMounted] = (0, import_react39.useState)(false);
|
|
6304
|
+
(0, import_react39.useEffect)(() => {
|
|
6283
6305
|
setIsMounted(true);
|
|
6284
6306
|
return () => setIsMounted(false);
|
|
6285
6307
|
}, []);
|
|
@@ -6373,12 +6395,12 @@ var Modal = ({
|
|
|
6373
6395
|
}) => {
|
|
6374
6396
|
var _a;
|
|
6375
6397
|
const mounted = useMounted();
|
|
6376
|
-
const modalRef = (0,
|
|
6377
|
-
const bgRef = (0,
|
|
6398
|
+
const modalRef = (0, import_react40.useRef)(null);
|
|
6399
|
+
const bgRef = (0, import_react40.useRef)(null);
|
|
6378
6400
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
6379
6401
|
const isMobile = useMatchesMobile();
|
|
6380
6402
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
6381
|
-
(0,
|
|
6403
|
+
(0, import_react40.useEffect)(() => {
|
|
6382
6404
|
if (!mounted) return;
|
|
6383
6405
|
if (!modalRef.current || !bgRef.current) {
|
|
6384
6406
|
console.error("Modal or background reference is not set.");
|
|
@@ -6398,7 +6420,7 @@ var Modal = ({
|
|
|
6398
6420
|
bgFadeIn(bgRef.current);
|
|
6399
6421
|
}
|
|
6400
6422
|
}, [mounted, onClose, open, wasOpen]);
|
|
6401
|
-
const handleKeyDown = (0,
|
|
6423
|
+
const handleKeyDown = (0, import_react40.useCallback)(
|
|
6402
6424
|
(e) => {
|
|
6403
6425
|
if (e.key === "Escape") {
|
|
6404
6426
|
if (onClose) {
|
|
@@ -6409,12 +6431,12 @@ var Modal = ({
|
|
|
6409
6431
|
},
|
|
6410
6432
|
[onClose]
|
|
6411
6433
|
);
|
|
6412
|
-
const handleClose = (0,
|
|
6434
|
+
const handleClose = (0, import_react40.useCallback)(() => {
|
|
6413
6435
|
if (onClose) {
|
|
6414
6436
|
onClose();
|
|
6415
6437
|
}
|
|
6416
6438
|
}, [onClose]);
|
|
6417
|
-
(0,
|
|
6439
|
+
(0, import_react40.useEffect)(() => {
|
|
6418
6440
|
if (open) {
|
|
6419
6441
|
document.addEventListener("keyup", handleKeyDown);
|
|
6420
6442
|
}
|
|
@@ -6422,7 +6444,7 @@ var Modal = ({
|
|
|
6422
6444
|
document.removeEventListener("keyup", handleKeyDown);
|
|
6423
6445
|
};
|
|
6424
6446
|
}, [open, handleKeyDown]);
|
|
6425
|
-
(0,
|
|
6447
|
+
(0, import_react40.useEffect)(() => {
|
|
6426
6448
|
if (!open) return;
|
|
6427
6449
|
const scrollY = window.scrollY;
|
|
6428
6450
|
const body = document.body;
|
|
@@ -6443,7 +6465,7 @@ var Modal = ({
|
|
|
6443
6465
|
};
|
|
6444
6466
|
}, [open]);
|
|
6445
6467
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
6446
|
-
const backgroundClickHandler = (0,
|
|
6468
|
+
const backgroundClickHandler = (0, import_react40.useCallback)(
|
|
6447
6469
|
(e) => {
|
|
6448
6470
|
const target = e.target;
|
|
6449
6471
|
const currentTarget = e.currentTarget;
|