@dmsi/wedgekit-react 0.0.643 → 0.0.645
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XX5GVIPZ.js → chunk-3MV3KMQH.js} +2 -2
- package/dist/{chunk-V7GPM6Z3.js → chunk-3PBA2EZ5.js} +1 -1
- package/dist/{chunk-3R3AY5MT.js → chunk-B3T7KBDA.js} +1 -1
- package/dist/{chunk-FIOXWZWU.js → chunk-ECYXZZWC.js} +1 -1
- package/dist/{chunk-RQMOWYB7.js → chunk-EXCAOI2L.js} +3 -3
- package/dist/{chunk-MQB6BSRX.js → chunk-FCGPQNS2.js} +1 -1
- package/dist/{chunk-SJ3SULQB.js → chunk-FJXWYGB7.js} +7 -7
- package/dist/{chunk-QJZ3XHNH.js → chunk-HCHKYUNQ.js} +19 -5
- package/dist/{chunk-5JHKFK73.js → chunk-HIGNJAQA.js} +2 -2
- package/dist/{chunk-IATOG76G.js → chunk-ISRG77J6.js} +1 -1
- package/dist/{chunk-UB3GEENN.js → chunk-OZEKRO4L.js} +1 -1
- package/dist/{chunk-LGX34HML.js → chunk-Q4AANHJY.js} +1 -1
- package/dist/{chunk-PS7MBNUT.js → chunk-REC2XOPI.js} +1 -1
- package/dist/{chunk-ARWHCWG7.js → chunk-XT4BQXSX.js} +1 -1
- package/dist/{chunk-YR4ZO2XL.js → chunk-ZSRTAMSW.js} +56 -23
- package/dist/components/CalendarRange.cjs +202 -180
- package/dist/components/CalendarRange.js +15 -15
- package/dist/components/CompactImagesPreview.cjs +6 -3
- package/dist/components/CompactImagesPreview.js +3 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +202 -180
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +15 -15
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +202 -180
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +15 -15
- package/dist/components/DataGrid/PinnedColumns.cjs +202 -180
- package/dist/components/DataGrid/PinnedColumns.js +15 -15
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +202 -180
- package/dist/components/DataGrid/TableBody/LoadingCell.js +15 -15
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +202 -180
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +15 -15
- package/dist/components/DataGrid/TableBody/index.cjs +202 -180
- package/dist/components/DataGrid/TableBody/index.js +15 -15
- package/dist/components/DataGrid/index.cjs +203 -181
- package/dist/components/DataGrid/index.js +15 -15
- package/dist/components/DataGrid/utils.cjs +202 -180
- package/dist/components/DataGrid/utils.js +15 -15
- package/dist/components/DataGridCell.cjs +61 -58
- package/dist/components/DataGridCell.js +6 -6
- package/dist/components/DateInput.cjs +195 -173
- package/dist/components/DateInput.js +15 -15
- package/dist/components/DateRangeInput.cjs +208 -186
- package/dist/components/DateRangeInput.js +15 -15
- package/dist/components/Menu.cjs +15 -12
- package/dist/components/Menu.js +4 -4
- package/dist/components/MenuOption.cjs +8 -5
- package/dist/components/MenuOption.js +3 -3
- package/dist/components/MobileDataGrid/ColumnList.js +4 -4
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +206 -184
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +15 -15
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +3 -3
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +206 -184
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +15 -15
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +3 -3
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +19 -16
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +6 -6
- package/dist/components/MobileDataGrid/index.cjs +215 -193
- package/dist/components/MobileDataGrid/index.js +15 -15
- package/dist/components/Modal.cjs +15 -12
- package/dist/components/Modal.js +3 -3
- package/dist/components/NestedMenu.cjs +11 -8
- package/dist/components/NestedMenu.js +3 -3
- package/dist/components/PDFViewer/index.cjs +31 -28
- package/dist/components/PDFViewer/index.js +3 -3
- package/dist/components/ProductImagePreview/index.cjs +18 -15
- package/dist/components/ProductImagePreview/index.js +3 -3
- package/dist/components/ProjectBar.cjs +3 -0
- package/dist/components/ProjectBar.js +2 -2
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +263 -241
- package/dist/components/index.js +15 -15
- package/dist/components/useMenuSystem.cjs +22 -19
- package/dist/components/useMenuSystem.js +3 -3
- package/dist/hooks/index.cjs +76 -26
- package/dist/hooks/index.js +4 -2
- package/dist/utils/index.cjs +21 -5
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
|
@@ -62,7 +62,7 @@ __export(DateInput_exports, {
|
|
|
62
62
|
DateInput: () => DateInput
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(DateInput_exports);
|
|
65
|
-
var
|
|
65
|
+
var import_react40 = require("react");
|
|
66
66
|
var import_react_dom4 = require("react-dom");
|
|
67
67
|
|
|
68
68
|
// src/components/Input.tsx
|
|
@@ -834,7 +834,7 @@ Percentage.displayName = "Percentage";
|
|
|
834
834
|
|
|
835
835
|
// src/components/CalendarRange.tsx
|
|
836
836
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
837
|
-
var
|
|
837
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
838
838
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
839
839
|
|
|
840
840
|
// src/components/DataGridCell.tsx
|
|
@@ -890,11 +890,11 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
890
890
|
|
|
891
891
|
// src/components/DataGridCell.tsx
|
|
892
892
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
893
|
-
var
|
|
893
|
+
var import_react12 = require("react");
|
|
894
894
|
|
|
895
895
|
// src/components/MenuOption.tsx
|
|
896
896
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
897
|
-
var
|
|
897
|
+
var import_react8 = require("react");
|
|
898
898
|
|
|
899
899
|
// src/hooks/useKeydown.ts
|
|
900
900
|
var import_react3 = require("react");
|
|
@@ -1063,11 +1063,24 @@ function formatDate(date) {
|
|
|
1063
1063
|
|
|
1064
1064
|
// src/utils/mergeObjectArrays.ts
|
|
1065
1065
|
function mergeObjectArrays(arr1, arr2) {
|
|
1066
|
-
const
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1066
|
+
const arr2Map = /* @__PURE__ */ new Map();
|
|
1067
|
+
for (const item of arr2) {
|
|
1068
|
+
const id = item.id;
|
|
1069
|
+
if (id !== void 0) {
|
|
1070
|
+
arr2Map.set(id, item);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
return arr1.map((item1) => {
|
|
1074
|
+
const id = item1.id;
|
|
1075
|
+
if (id !== void 0 && arr2Map.has(id)) {
|
|
1076
|
+
const item2 = arr2Map.get(id);
|
|
1077
|
+
const meta1 = item1.meta;
|
|
1078
|
+
const meta2 = item2.meta;
|
|
1079
|
+
const mergedMeta = meta1 && meta2 && typeof meta1 === "object" && typeof meta2 === "object" ? __spreadValues(__spreadValues({}, meta1), meta2) : meta2 != null ? meta2 : meta1;
|
|
1080
|
+
return __spreadProps(__spreadValues(__spreadValues({}, item1), item2), { meta: mergedMeta });
|
|
1081
|
+
}
|
|
1082
|
+
return item1;
|
|
1083
|
+
});
|
|
1071
1084
|
}
|
|
1072
1085
|
|
|
1073
1086
|
// src/utils/index.ts
|
|
@@ -1103,52 +1116,58 @@ var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
|
|
|
1103
1116
|
function useTableLayout(initialColumns, key, autosync = true) {
|
|
1104
1117
|
const [columns, setColumns] = (0, import_react6.useState)(initialColumns);
|
|
1105
1118
|
const [isReady, setIsReady] = (0, import_react6.useState)(false);
|
|
1106
|
-
const
|
|
1119
|
+
const isReadyRef = (0, import_react6.useRef)(false);
|
|
1120
|
+
const keyRef = (0, import_react6.useRef)(key);
|
|
1121
|
+
(0, import_react6.useEffect)(() => {
|
|
1122
|
+
isReadyRef.current = isReady;
|
|
1123
|
+
keyRef.current = key;
|
|
1124
|
+
}, [isReady, key]);
|
|
1107
1125
|
const handleSaveLayout = (0, import_react6.useCallback)(
|
|
1108
1126
|
(setter, _internal) => {
|
|
1109
|
-
if (!
|
|
1127
|
+
if (!isReadyRef.current && !_internal || !keyRef.current) return;
|
|
1110
1128
|
setColumns((prevColumns) => {
|
|
1111
1129
|
const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
|
|
1112
|
-
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
|
|
1130
|
+
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal) {
|
|
1113
1131
|
return prevColumns;
|
|
1132
|
+
}
|
|
1114
1133
|
localStorage.setItem(
|
|
1115
|
-
getLocalStorageKeyWithPrefix(`${
|
|
1134
|
+
getLocalStorageKeyWithPrefix(`${keyRef.current}-tableLayout`),
|
|
1116
1135
|
JSON.stringify(newColumns)
|
|
1117
1136
|
);
|
|
1118
1137
|
return newColumns;
|
|
1119
1138
|
});
|
|
1120
1139
|
},
|
|
1121
|
-
[
|
|
1140
|
+
[]
|
|
1122
1141
|
);
|
|
1123
1142
|
(0, import_react6.useEffect)(() => {
|
|
1124
1143
|
if (!autosync) return;
|
|
1125
|
-
if (!key)
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
`useTableLayout should only be called once per component render cycle.
|
|
1129
|
-
${renderCountRef.current} Renders detected.
|
|
1130
|
-
Check dependency stability`
|
|
1131
|
-
);
|
|
1144
|
+
if (!key) {
|
|
1145
|
+
setIsReady(true);
|
|
1146
|
+
return;
|
|
1132
1147
|
}
|
|
1133
|
-
renderCountRef.current += 1;
|
|
1134
1148
|
const savedLayout = localStorage.getItem(
|
|
1135
1149
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
1136
1150
|
);
|
|
1137
1151
|
if (savedLayout) {
|
|
1138
|
-
|
|
1152
|
+
setColumns(
|
|
1139
1153
|
mergeObjectArrays(
|
|
1140
1154
|
initialColumns,
|
|
1141
1155
|
JSON.parse(savedLayout)
|
|
1142
|
-
)
|
|
1143
|
-
true
|
|
1156
|
+
)
|
|
1144
1157
|
);
|
|
1158
|
+
} else {
|
|
1159
|
+
localStorage.setItem(
|
|
1160
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
1161
|
+
JSON.stringify(initialColumns)
|
|
1162
|
+
);
|
|
1163
|
+
setColumns((prev) => {
|
|
1164
|
+
if (JSON.stringify(initialColumns) === JSON.stringify(prev))
|
|
1165
|
+
return prev;
|
|
1166
|
+
return initialColumns;
|
|
1167
|
+
});
|
|
1145
1168
|
}
|
|
1146
|
-
if (!savedLayout) handleSaveLayout(initialColumns, true);
|
|
1147
1169
|
setIsReady(true);
|
|
1148
|
-
|
|
1149
|
-
renderCountRef.current = 0;
|
|
1150
|
-
};
|
|
1151
|
-
}, [handleSaveLayout, initialColumns, key, autosync]);
|
|
1170
|
+
}, [initialColumns, key, autosync]);
|
|
1152
1171
|
const getSavedLayout = (0, import_react6.useCallback)(() => {
|
|
1153
1172
|
const savedLayout = localStorage.getItem(
|
|
1154
1173
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
@@ -1160,6 +1179,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
1160
1179
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
1161
1180
|
}
|
|
1162
1181
|
|
|
1182
|
+
// src/hooks/useEditCell.tsx
|
|
1183
|
+
var import_react7 = require("react");
|
|
1184
|
+
|
|
1163
1185
|
// src/components/Caption.tsx
|
|
1164
1186
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
1165
1187
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
@@ -1311,12 +1333,12 @@ var MenuOption = ({
|
|
|
1311
1333
|
onMouseMove,
|
|
1312
1334
|
small = false
|
|
1313
1335
|
}) => {
|
|
1314
|
-
const uniqueId = (0,
|
|
1315
|
-
const internalRef = (0,
|
|
1336
|
+
const uniqueId = (0, import_react8.useId)();
|
|
1337
|
+
const internalRef = (0, import_react8.useRef)(null);
|
|
1316
1338
|
const actualRef = ref || internalRef;
|
|
1317
|
-
const menuId = (0,
|
|
1339
|
+
const menuId = (0, import_react8.useRef)(`menu-${uniqueId}`);
|
|
1318
1340
|
const isMobile = useMatchesMobile();
|
|
1319
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
1341
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react8.useState)(false);
|
|
1320
1342
|
const handleMouseEnter = () => {
|
|
1321
1343
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
1322
1344
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1476,27 +1498,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1476
1498
|
|
|
1477
1499
|
// src/components/Menu.tsx
|
|
1478
1500
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1479
|
-
var
|
|
1501
|
+
var import_react10 = require("react");
|
|
1480
1502
|
var import_react_dom = require("react-dom");
|
|
1481
1503
|
|
|
1482
1504
|
// src/components/useMenuSystem.tsx
|
|
1483
|
-
var
|
|
1505
|
+
var import_react9 = require("react");
|
|
1484
1506
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1485
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1507
|
+
const [activeMenus, setActiveMenus] = (0, import_react9.useState)(
|
|
1486
1508
|
{}
|
|
1487
1509
|
);
|
|
1488
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1489
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1510
|
+
const [activeMenu, setActiveMenu] = (0, import_react9.useState)("");
|
|
1511
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react9.useState)(
|
|
1490
1512
|
null
|
|
1491
1513
|
);
|
|
1492
|
-
const menuRootRef = (0,
|
|
1493
|
-
const subMenuRefs = (0,
|
|
1494
|
-
const hoverTimeoutRef = (0,
|
|
1495
|
-
const closeTimeoutRef = (0,
|
|
1496
|
-
const mouseStopTimeoutRef = (0,
|
|
1497
|
-
const isMouseMovingRef = (0,
|
|
1498
|
-
const pendingOpenActionRef = (0,
|
|
1499
|
-
const pendingCloseActionRef = (0,
|
|
1514
|
+
const menuRootRef = (0, import_react9.useRef)(null);
|
|
1515
|
+
const subMenuRefs = (0, import_react9.useRef)({});
|
|
1516
|
+
const hoverTimeoutRef = (0, import_react9.useRef)(null);
|
|
1517
|
+
const closeTimeoutRef = (0, import_react9.useRef)(null);
|
|
1518
|
+
const mouseStopTimeoutRef = (0, import_react9.useRef)(null);
|
|
1519
|
+
const isMouseMovingRef = (0, import_react9.useRef)(false);
|
|
1520
|
+
const pendingOpenActionRef = (0, import_react9.useRef)(null);
|
|
1521
|
+
const pendingCloseActionRef = (0, import_react9.useRef)(null);
|
|
1500
1522
|
const isMobile = useMatchesMobile();
|
|
1501
1523
|
const toggleMenu = (menuId, level) => {
|
|
1502
1524
|
if (closeTimeoutRef.current) {
|
|
@@ -1536,7 +1558,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1536
1558
|
return newActiveMenus;
|
|
1537
1559
|
});
|
|
1538
1560
|
};
|
|
1539
|
-
const executePendingActions = (0,
|
|
1561
|
+
const executePendingActions = (0, import_react9.useCallback)(() => {
|
|
1540
1562
|
if (pendingCloseActionRef.current) {
|
|
1541
1563
|
pendingCloseActionRef.current();
|
|
1542
1564
|
pendingCloseActionRef.current = null;
|
|
@@ -1625,7 +1647,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1625
1647
|
const isMenuActive = (menuId, level) => {
|
|
1626
1648
|
return activeMenus[level] === menuId;
|
|
1627
1649
|
};
|
|
1628
|
-
(0,
|
|
1650
|
+
(0, import_react9.useEffect)(() => {
|
|
1629
1651
|
const handleClickOutside = (event) => {
|
|
1630
1652
|
var _a;
|
|
1631
1653
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1644,7 +1666,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1644
1666
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1645
1667
|
};
|
|
1646
1668
|
}, [activeMenus]);
|
|
1647
|
-
(0,
|
|
1669
|
+
(0, import_react9.useEffect)(() => {
|
|
1648
1670
|
return () => {
|
|
1649
1671
|
if (hoverTimeoutRef.current) {
|
|
1650
1672
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1722,13 +1744,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1722
1744
|
};
|
|
1723
1745
|
}
|
|
1724
1746
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1725
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1747
|
+
const [menuPosition, setMenuPosition] = (0, import_react9.useState)({
|
|
1726
1748
|
top: 0,
|
|
1727
1749
|
left: 0,
|
|
1728
1750
|
minWidth: 0
|
|
1729
1751
|
});
|
|
1730
1752
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1731
|
-
const updatePosition = (0,
|
|
1753
|
+
const updatePosition = (0, import_react9.useCallback)(() => {
|
|
1732
1754
|
var _a, _b, _c;
|
|
1733
1755
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1734
1756
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1776,7 +1798,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1776
1798
|
minWidth: triggerRect.width
|
|
1777
1799
|
});
|
|
1778
1800
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1779
|
-
(0,
|
|
1801
|
+
(0, import_react9.useEffect)(() => {
|
|
1780
1802
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1781
1803
|
const handleClickOutside = (event) => {
|
|
1782
1804
|
var _a, _b, _c, _d, _e;
|
|
@@ -1802,7 +1824,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1802
1824
|
options == null ? void 0 : options.menuRef,
|
|
1803
1825
|
options == null ? void 0 : options.additionalRefs
|
|
1804
1826
|
]);
|
|
1805
|
-
(0,
|
|
1827
|
+
(0, import_react9.useEffect)(() => {
|
|
1806
1828
|
updatePosition();
|
|
1807
1829
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1808
1830
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1883,9 +1905,9 @@ var Menu = (_a) => {
|
|
|
1883
1905
|
"menuName",
|
|
1884
1906
|
"calculateMinMaxHeight"
|
|
1885
1907
|
]);
|
|
1886
|
-
const internalRef = (0,
|
|
1908
|
+
const internalRef = (0, import_react10.useRef)(null);
|
|
1887
1909
|
const actualRef = ref || internalRef;
|
|
1888
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1910
|
+
const [maxHeight, setMaxHeight] = (0, import_react10.useState)("180px");
|
|
1889
1911
|
const isMobile = useMatchesMobile();
|
|
1890
1912
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1891
1913
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1898,7 +1920,7 @@ var Menu = (_a) => {
|
|
|
1898
1920
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1899
1921
|
}
|
|
1900
1922
|
);
|
|
1901
|
-
(0,
|
|
1923
|
+
(0, import_react10.useEffect)(() => {
|
|
1902
1924
|
if (calculateMinMaxHeight) {
|
|
1903
1925
|
return;
|
|
1904
1926
|
}
|
|
@@ -1922,7 +1944,7 @@ var Menu = (_a) => {
|
|
|
1922
1944
|
cancelAnimationFrame(raf);
|
|
1923
1945
|
};
|
|
1924
1946
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1925
|
-
(0,
|
|
1947
|
+
(0, import_react10.useEffect)(() => {
|
|
1926
1948
|
if (!calculateMinMaxHeight) {
|
|
1927
1949
|
return;
|
|
1928
1950
|
}
|
|
@@ -1933,14 +1955,14 @@ var Menu = (_a) => {
|
|
|
1933
1955
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1934
1956
|
}
|
|
1935
1957
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1936
|
-
(0,
|
|
1958
|
+
(0, import_react10.useEffect)(() => {
|
|
1937
1959
|
if (!show) {
|
|
1938
1960
|
return;
|
|
1939
1961
|
}
|
|
1940
1962
|
initializeMenuFocus();
|
|
1941
1963
|
updatePosition();
|
|
1942
1964
|
}, [show, updatePosition]);
|
|
1943
|
-
(0,
|
|
1965
|
+
(0, import_react10.useEffect)(() => {
|
|
1944
1966
|
if (!show || !setShow) {
|
|
1945
1967
|
return;
|
|
1946
1968
|
}
|
|
@@ -2094,7 +2116,7 @@ var Menu = (_a) => {
|
|
|
2094
2116
|
Menu.displayName = "Menu";
|
|
2095
2117
|
|
|
2096
2118
|
// src/components/Search.tsx
|
|
2097
|
-
var
|
|
2119
|
+
var import_react11 = require("react");
|
|
2098
2120
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2099
2121
|
var Search = (_a) => {
|
|
2100
2122
|
var _b = _a, {
|
|
@@ -2122,14 +2144,14 @@ var Search = (_a) => {
|
|
|
2122
2144
|
"removeRoundness",
|
|
2123
2145
|
"autocompletePadding"
|
|
2124
2146
|
]);
|
|
2125
|
-
const inputRef = (0,
|
|
2126
|
-
const inputContainerRef = (0,
|
|
2127
|
-
const preventFocusOnInitialRender = (0,
|
|
2128
|
-
const [show, setShow] = (0,
|
|
2129
|
-
const [clearing, setClearing] = (0,
|
|
2130
|
-
const uniqueId = (0,
|
|
2147
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2148
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2149
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2150
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2151
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2152
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2131
2153
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2132
|
-
(0,
|
|
2154
|
+
(0, import_react11.useEffect)(() => {
|
|
2133
2155
|
var _a2;
|
|
2134
2156
|
if (preventFocusOnInitialRender.current) {
|
|
2135
2157
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2213,7 +2235,7 @@ Search.displayName = "Search";
|
|
|
2213
2235
|
|
|
2214
2236
|
// src/components/DataGridCell.tsx
|
|
2215
2237
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2216
|
-
var DataGridCell = (0,
|
|
2238
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2217
2239
|
(_a) => {
|
|
2218
2240
|
var _b = _a, {
|
|
2219
2241
|
id,
|
|
@@ -2255,10 +2277,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2255
2277
|
"testid"
|
|
2256
2278
|
]);
|
|
2257
2279
|
const Element = type === "header" ? "th" : "td";
|
|
2258
|
-
const timerRef = (0,
|
|
2259
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2260
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2261
|
-
(0,
|
|
2280
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2281
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2282
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2283
|
+
(0, import_react12.useEffect)(() => {
|
|
2262
2284
|
return () => {
|
|
2263
2285
|
if (timerRef.current) {
|
|
2264
2286
|
clearTimeout(timerRef.current);
|
|
@@ -2368,12 +2390,12 @@ function DataCellHeader(_a) {
|
|
|
2368
2390
|
"useMenuDefaultMinWidth"
|
|
2369
2391
|
]);
|
|
2370
2392
|
var _a2;
|
|
2371
|
-
const [showMenu, setShowMenu] = (0,
|
|
2372
|
-
const [filter, setFilter] = (0,
|
|
2393
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2394
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2373
2395
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2374
2396
|
);
|
|
2375
|
-
const ref = (0,
|
|
2376
|
-
const predeterminedPinned = (0,
|
|
2397
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2398
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2377
2399
|
const { column, getContext } = header;
|
|
2378
2400
|
const { id: columnId, setFilterValue } = column;
|
|
2379
2401
|
const {
|
|
@@ -2383,14 +2405,14 @@ function DataCellHeader(_a) {
|
|
|
2383
2405
|
listeners: subMenuListeners,
|
|
2384
2406
|
mobileHide
|
|
2385
2407
|
} = useSubMenuSystem(node ? node : ref);
|
|
2386
|
-
(0,
|
|
2408
|
+
(0, import_react12.useEffect)(() => {
|
|
2387
2409
|
var _a3, _b2, _c;
|
|
2388
2410
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2389
2411
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2390
2412
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2391
2413
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2392
2414
|
}, [columnId, getContext]);
|
|
2393
|
-
(0,
|
|
2415
|
+
(0, import_react12.useEffect)(() => {
|
|
2394
2416
|
const handler = setTimeout(() => {
|
|
2395
2417
|
setFilterValue(filter);
|
|
2396
2418
|
}, 500);
|
|
@@ -2653,7 +2675,7 @@ function DragAlongCell(_a) {
|
|
|
2653
2675
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2654
2676
|
|
|
2655
2677
|
// src/components/DataGrid/index.tsx
|
|
2656
|
-
var
|
|
2678
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
2657
2679
|
var import_react_table3 = require("@tanstack/react-table");
|
|
2658
2680
|
var import_core = require("@dnd-kit/core");
|
|
2659
2681
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -2681,7 +2703,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
2681
2703
|
}
|
|
2682
2704
|
|
|
2683
2705
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
2684
|
-
var
|
|
2706
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2685
2707
|
|
|
2686
2708
|
// src/components/DataGrid/TableBody/index.tsx
|
|
2687
2709
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -2690,7 +2712,7 @@ var import_clsx12 = __toESM(require("clsx"), 1);
|
|
|
2690
2712
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
2691
2713
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2692
2714
|
var import_react_table = require("@tanstack/react-table");
|
|
2693
|
-
var
|
|
2715
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2694
2716
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2695
2717
|
var valueFormatters = {
|
|
2696
2718
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -2758,7 +2780,7 @@ function TableBodyRow({
|
|
|
2758
2780
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
2759
2781
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
2760
2782
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
2761
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2783
|
+
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react13.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2762
2784
|
CellElement,
|
|
2763
2785
|
{
|
|
2764
2786
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -2972,10 +2994,10 @@ function TableBody({
|
|
|
2972
2994
|
}
|
|
2973
2995
|
|
|
2974
2996
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
2975
|
-
var
|
|
2997
|
+
var import_react15 = require("react");
|
|
2976
2998
|
|
|
2977
2999
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
2978
|
-
var
|
|
3000
|
+
var import_react14 = require("react");
|
|
2979
3001
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2980
3002
|
function ColumnSelectorMenuOption({
|
|
2981
3003
|
id,
|
|
@@ -2983,7 +3005,7 @@ function ColumnSelectorMenuOption({
|
|
|
2983
3005
|
column,
|
|
2984
3006
|
toggleColumnVisibility
|
|
2985
3007
|
}) {
|
|
2986
|
-
const [isVisible, setIsVisible] = (0,
|
|
3008
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(column.getIsVisible());
|
|
2987
3009
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
2988
3010
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2989
3011
|
Checkbox,
|
|
@@ -3009,8 +3031,8 @@ function ColumnSelectorHeaderCell({
|
|
|
3009
3031
|
toggleColumnVisibility,
|
|
3010
3032
|
resetColumnVisibility
|
|
3011
3033
|
}) {
|
|
3012
|
-
const ref = (0,
|
|
3013
|
-
const [show, setShow] = (0,
|
|
3034
|
+
const ref = (0, import_react15.useRef)(null);
|
|
3035
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
|
3014
3036
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3015
3037
|
DataGridCell,
|
|
3016
3038
|
{
|
|
@@ -3179,7 +3201,7 @@ function PinnedColumns(_a) {
|
|
|
3179
3201
|
header.id
|
|
3180
3202
|
);
|
|
3181
3203
|
}
|
|
3182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react16.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3183
3205
|
Checkbox,
|
|
3184
3206
|
{
|
|
3185
3207
|
checked: allSelectedAcrossPages,
|
|
@@ -3261,23 +3283,23 @@ function DataGrid({
|
|
|
3261
3283
|
ref
|
|
3262
3284
|
}) {
|
|
3263
3285
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3264
|
-
(0,
|
|
3286
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
3265
3287
|
getSavedLayout: () => {
|
|
3266
3288
|
return getSavedLayout();
|
|
3267
3289
|
}
|
|
3268
3290
|
}));
|
|
3269
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3270
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3271
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3291
|
+
const [localSorting, setLocalSorting] = (0, import_react17.useState)([]);
|
|
3292
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react17.useState)([]);
|
|
3293
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react17.useState)({});
|
|
3272
3294
|
const {
|
|
3273
3295
|
columns: tableColumns,
|
|
3274
3296
|
setColumns: setTableColumns,
|
|
3275
3297
|
getSavedLayout
|
|
3276
3298
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3277
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3299
|
+
const [columnOrder, setColumnOrder] = (0, import_react17.useState)(
|
|
3278
3300
|
tableColumns.map((c) => c.id)
|
|
3279
3301
|
);
|
|
3280
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3302
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react17.useState)(
|
|
3281
3303
|
Object.fromEntries(
|
|
3282
3304
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3283
3305
|
var _a2, _b2;
|
|
@@ -3285,7 +3307,7 @@ function DataGrid({
|
|
|
3285
3307
|
})
|
|
3286
3308
|
)
|
|
3287
3309
|
);
|
|
3288
|
-
const updateColumnVisibility = (0,
|
|
3310
|
+
const updateColumnVisibility = (0, import_react17.useCallback)(
|
|
3289
3311
|
(updateOrder) => {
|
|
3290
3312
|
setColumnVisibility(
|
|
3291
3313
|
Object.fromEntries(
|
|
@@ -3299,7 +3321,7 @@ function DataGrid({
|
|
|
3299
3321
|
},
|
|
3300
3322
|
[tableColumns]
|
|
3301
3323
|
);
|
|
3302
|
-
const resetDefaultColumnVisibility = (0,
|
|
3324
|
+
const resetDefaultColumnVisibility = (0, import_react17.useCallback)(() => {
|
|
3303
3325
|
setTableColumns((prev) => {
|
|
3304
3326
|
columns.forEach((column) => {
|
|
3305
3327
|
var _a2, _b2;
|
|
@@ -3315,7 +3337,7 @@ function DataGrid({
|
|
|
3315
3337
|
return [...prev];
|
|
3316
3338
|
}, true);
|
|
3317
3339
|
}, [columns, setTableColumns]);
|
|
3318
|
-
(0,
|
|
3340
|
+
(0, import_react17.useEffect)(() => {
|
|
3319
3341
|
updateColumnVisibility(true);
|
|
3320
3342
|
}, [updateColumnVisibility]);
|
|
3321
3343
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3331,7 +3353,7 @@ function DataGrid({
|
|
|
3331
3353
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3332
3354
|
} : setLocalColumnFilters;
|
|
3333
3355
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3334
|
-
const setRowSelection = (0,
|
|
3356
|
+
const setRowSelection = (0, import_react17.useCallback)(
|
|
3335
3357
|
(updaterOrValue) => {
|
|
3336
3358
|
if (pagination) {
|
|
3337
3359
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3345,9 +3367,9 @@ function DataGrid({
|
|
|
3345
3367
|
},
|
|
3346
3368
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3347
3369
|
);
|
|
3348
|
-
const dndId = (0,
|
|
3349
|
-
const containerRef =
|
|
3350
|
-
const toggleColumnVisibility = (0,
|
|
3370
|
+
const dndId = (0, import_react17.useId)();
|
|
3371
|
+
const containerRef = import_react17.default.useRef(null);
|
|
3372
|
+
const toggleColumnVisibility = (0, import_react17.useCallback)(
|
|
3351
3373
|
(columnId, isVisible) => {
|
|
3352
3374
|
setTableColumns((prev) => {
|
|
3353
3375
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3595,7 +3617,7 @@ function DataGrid({
|
|
|
3595
3617
|
header.id
|
|
3596
3618
|
);
|
|
3597
3619
|
}
|
|
3598
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react17.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3599
3621
|
DataGridCell,
|
|
3600
3622
|
{
|
|
3601
3623
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3801,7 +3823,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3801
3823
|
}
|
|
3802
3824
|
|
|
3803
3825
|
// src/components/Select.tsx
|
|
3804
|
-
var
|
|
3826
|
+
var import_react18 = require("react");
|
|
3805
3827
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
3806
3828
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3807
3829
|
var Select = (_a) => {
|
|
@@ -3835,11 +3857,11 @@ var Select = (_a) => {
|
|
|
3835
3857
|
"value"
|
|
3836
3858
|
]);
|
|
3837
3859
|
var _a2;
|
|
3838
|
-
const inputRef = (0,
|
|
3839
|
-
const inputContainerRef = (0,
|
|
3840
|
-
const preventFocusOnInitialRender = (0,
|
|
3841
|
-
const [show, setShow] = (0,
|
|
3842
|
-
(0,
|
|
3860
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
3861
|
+
const inputContainerRef = (0, import_react18.useRef)(null);
|
|
3862
|
+
const preventFocusOnInitialRender = (0, import_react18.useRef)(true);
|
|
3863
|
+
const [show, setShow] = (0, import_react18.useState)(false);
|
|
3864
|
+
(0, import_react18.useEffect)(() => {
|
|
3843
3865
|
var _a3;
|
|
3844
3866
|
if (preventFocusOnInitialRender.current) {
|
|
3845
3867
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4261,7 +4283,7 @@ Button.displayName = "Button";
|
|
|
4261
4283
|
|
|
4262
4284
|
// src/components/Tooltip.tsx
|
|
4263
4285
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4264
|
-
var
|
|
4286
|
+
var import_react19 = require("react");
|
|
4265
4287
|
var import_react_dom2 = require("react-dom");
|
|
4266
4288
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4267
4289
|
var Tooltip = ({
|
|
@@ -4274,11 +4296,11 @@ var Tooltip = ({
|
|
|
4274
4296
|
offset = 8,
|
|
4275
4297
|
keepHidden = false
|
|
4276
4298
|
}) => {
|
|
4277
|
-
const ref = (0,
|
|
4278
|
-
const tooltipRef = (0,
|
|
4279
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4280
|
-
const [isVisible, setIsVisible] = (0,
|
|
4281
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4299
|
+
const ref = (0, import_react19.useRef)(null);
|
|
4300
|
+
const tooltipRef = (0, import_react19.useRef)(null);
|
|
4301
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react19.useState)({ top: 0, left: 0 });
|
|
4302
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
4303
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react19.useState)(false);
|
|
4282
4304
|
const updatePosition = () => {
|
|
4283
4305
|
if (!ref.current || !tooltipRef.current) return;
|
|
4284
4306
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4317,14 +4339,14 @@ var Tooltip = ({
|
|
|
4317
4339
|
setIsVisible(false);
|
|
4318
4340
|
setRemoveOpacity(false);
|
|
4319
4341
|
};
|
|
4320
|
-
(0,
|
|
4342
|
+
(0, import_react19.useEffect)(() => {
|
|
4321
4343
|
if (isVisible && tooltipRef.current) {
|
|
4322
4344
|
requestAnimationFrame(() => {
|
|
4323
4345
|
updatePosition();
|
|
4324
4346
|
});
|
|
4325
4347
|
}
|
|
4326
4348
|
}, [isVisible]);
|
|
4327
|
-
(0,
|
|
4349
|
+
(0, import_react19.useEffect)(() => {
|
|
4328
4350
|
if (isVisible) {
|
|
4329
4351
|
window.addEventListener("resize", updatePosition);
|
|
4330
4352
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4452,14 +4474,14 @@ Heading3.displayName = "Heading3";
|
|
|
4452
4474
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4453
4475
|
|
|
4454
4476
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4455
|
-
var
|
|
4477
|
+
var import_react22 = require("react");
|
|
4456
4478
|
|
|
4457
4479
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
4458
|
-
var
|
|
4480
|
+
var import_react21 = require("react");
|
|
4459
4481
|
|
|
4460
4482
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
4461
|
-
var
|
|
4462
|
-
var GridContext = (0,
|
|
4483
|
+
var import_react20 = require("react");
|
|
4484
|
+
var GridContext = (0, import_react20.createContext)(null);
|
|
4463
4485
|
|
|
4464
4486
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4465
4487
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
@@ -4468,12 +4490,12 @@ var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
|
4468
4490
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4469
4491
|
|
|
4470
4492
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4471
|
-
var
|
|
4493
|
+
var import_react23 = require("react");
|
|
4472
4494
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4473
4495
|
|
|
4474
4496
|
// src/components/Modal.tsx
|
|
4475
4497
|
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
4476
|
-
var
|
|
4498
|
+
var import_react25 = require("react");
|
|
4477
4499
|
|
|
4478
4500
|
// src/components/ModalHeader.tsx
|
|
4479
4501
|
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
@@ -4649,10 +4671,10 @@ var import_react_dom3 = require("react-dom");
|
|
|
4649
4671
|
var import_react_use = require("react-use");
|
|
4650
4672
|
|
|
4651
4673
|
// src/components/useMounted.tsx
|
|
4652
|
-
var
|
|
4674
|
+
var import_react24 = require("react");
|
|
4653
4675
|
var useMounted = () => {
|
|
4654
|
-
const [isMounted, setIsMounted] = (0,
|
|
4655
|
-
(0,
|
|
4676
|
+
const [isMounted, setIsMounted] = (0, import_react24.useState)(false);
|
|
4677
|
+
(0, import_react24.useEffect)(() => {
|
|
4656
4678
|
setIsMounted(true);
|
|
4657
4679
|
return () => setIsMounted(false);
|
|
4658
4680
|
}, []);
|
|
@@ -4746,12 +4768,12 @@ var Modal = ({
|
|
|
4746
4768
|
}) => {
|
|
4747
4769
|
var _a;
|
|
4748
4770
|
const mounted = useMounted();
|
|
4749
|
-
const modalRef = (0,
|
|
4750
|
-
const bgRef = (0,
|
|
4771
|
+
const modalRef = (0, import_react25.useRef)(null);
|
|
4772
|
+
const bgRef = (0, import_react25.useRef)(null);
|
|
4751
4773
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
4752
4774
|
const isMobile = useMatchesMobile();
|
|
4753
4775
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
4754
|
-
(0,
|
|
4776
|
+
(0, import_react25.useEffect)(() => {
|
|
4755
4777
|
if (!mounted) return;
|
|
4756
4778
|
if (!modalRef.current || !bgRef.current) {
|
|
4757
4779
|
console.error("Modal or background reference is not set.");
|
|
@@ -4771,7 +4793,7 @@ var Modal = ({
|
|
|
4771
4793
|
bgFadeIn(bgRef.current);
|
|
4772
4794
|
}
|
|
4773
4795
|
}, [mounted, onClose, open, wasOpen]);
|
|
4774
|
-
const handleKeyDown = (0,
|
|
4796
|
+
const handleKeyDown = (0, import_react25.useCallback)(
|
|
4775
4797
|
(e) => {
|
|
4776
4798
|
if (e.key === "Escape") {
|
|
4777
4799
|
if (onClose) {
|
|
@@ -4782,12 +4804,12 @@ var Modal = ({
|
|
|
4782
4804
|
},
|
|
4783
4805
|
[onClose]
|
|
4784
4806
|
);
|
|
4785
|
-
const handleClose = (0,
|
|
4807
|
+
const handleClose = (0, import_react25.useCallback)(() => {
|
|
4786
4808
|
if (onClose) {
|
|
4787
4809
|
onClose();
|
|
4788
4810
|
}
|
|
4789
4811
|
}, [onClose]);
|
|
4790
|
-
(0,
|
|
4812
|
+
(0, import_react25.useEffect)(() => {
|
|
4791
4813
|
if (open) {
|
|
4792
4814
|
document.addEventListener("keyup", handleKeyDown);
|
|
4793
4815
|
}
|
|
@@ -4795,7 +4817,7 @@ var Modal = ({
|
|
|
4795
4817
|
document.removeEventListener("keyup", handleKeyDown);
|
|
4796
4818
|
};
|
|
4797
4819
|
}, [open, handleKeyDown]);
|
|
4798
|
-
(0,
|
|
4820
|
+
(0, import_react25.useEffect)(() => {
|
|
4799
4821
|
if (!open) return;
|
|
4800
4822
|
const scrollY = window.scrollY;
|
|
4801
4823
|
const body = document.body;
|
|
@@ -4816,7 +4838,7 @@ var Modal = ({
|
|
|
4816
4838
|
};
|
|
4817
4839
|
}, [open]);
|
|
4818
4840
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
4819
|
-
const backgroundClickHandler = (0,
|
|
4841
|
+
const backgroundClickHandler = (0, import_react25.useCallback)(
|
|
4820
4842
|
(e) => {
|
|
4821
4843
|
const target = e.target;
|
|
4822
4844
|
const currentTarget = e.currentTarget;
|
|
@@ -4925,10 +4947,10 @@ var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
|
4925
4947
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4926
4948
|
|
|
4927
4949
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
4928
|
-
var
|
|
4950
|
+
var import_react27 = require("react");
|
|
4929
4951
|
|
|
4930
4952
|
// src/components/ImagePlaceholder.tsx
|
|
4931
|
-
var
|
|
4953
|
+
var import_react26 = require("react");
|
|
4932
4954
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4933
4955
|
|
|
4934
4956
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -4939,11 +4961,11 @@ var import_clsx31 = __toESM(require("clsx"), 1);
|
|
|
4939
4961
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4940
4962
|
|
|
4941
4963
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
4942
|
-
var
|
|
4964
|
+
var import_react28 = require("react");
|
|
4943
4965
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4944
4966
|
|
|
4945
4967
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
4946
|
-
var
|
|
4968
|
+
var import_react29 = require("react");
|
|
4947
4969
|
|
|
4948
4970
|
// src/components/Surface.tsx
|
|
4949
4971
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
@@ -4988,17 +5010,17 @@ var import_clsx33 = require("clsx");
|
|
|
4988
5010
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4989
5011
|
|
|
4990
5012
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
4991
|
-
var
|
|
5013
|
+
var import_react30 = require("react");
|
|
4992
5014
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4993
5015
|
|
|
4994
5016
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
4995
|
-
var
|
|
5017
|
+
var import_react31 = require("react");
|
|
4996
5018
|
|
|
4997
5019
|
// src/components/ProductImagePreview/index.tsx
|
|
4998
5020
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4999
5021
|
|
|
5000
5022
|
// src/components/CompactImagesPreview.tsx
|
|
5001
|
-
var
|
|
5023
|
+
var import_react32 = require("react");
|
|
5002
5024
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
5003
5025
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5004
5026
|
|
|
@@ -5007,12 +5029,12 @@ var import_clsx35 = __toESM(require("clsx"), 1);
|
|
|
5007
5029
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5008
5030
|
|
|
5009
5031
|
// src/components/ListGroup.tsx
|
|
5010
|
-
var
|
|
5032
|
+
var import_react33 = require("react");
|
|
5011
5033
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
5012
5034
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5013
5035
|
|
|
5014
5036
|
// src/components/Pagination.tsx
|
|
5015
|
-
var
|
|
5037
|
+
var import_react34 = require("react");
|
|
5016
5038
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5017
5039
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5018
5040
|
var Pagination = ({
|
|
@@ -5024,7 +5046,7 @@ var Pagination = ({
|
|
|
5024
5046
|
className,
|
|
5025
5047
|
disabled
|
|
5026
5048
|
}) => {
|
|
5027
|
-
const goTo = (0,
|
|
5049
|
+
const goTo = (0, import_react34.useCallback)(
|
|
5028
5050
|
(page) => {
|
|
5029
5051
|
if (disabled) return;
|
|
5030
5052
|
onPageChange(page);
|
|
@@ -5041,7 +5063,7 @@ var Pagination = ({
|
|
|
5041
5063
|
goTo(currentPage + 1);
|
|
5042
5064
|
}
|
|
5043
5065
|
};
|
|
5044
|
-
const pageTokens = (0,
|
|
5066
|
+
const pageTokens = (0, import_react34.useMemo)(() => {
|
|
5045
5067
|
if (totalPages <= 5) {
|
|
5046
5068
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5047
5069
|
}
|
|
@@ -5164,21 +5186,21 @@ var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
|
5164
5186
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5165
5187
|
|
|
5166
5188
|
// src/components/SearchResultImage/index.tsx
|
|
5167
|
-
var
|
|
5189
|
+
var import_react35 = require("react");
|
|
5168
5190
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5169
5191
|
|
|
5170
5192
|
// src/components/Alert.tsx
|
|
5171
5193
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5172
|
-
var
|
|
5194
|
+
var import_react36 = require("react");
|
|
5173
5195
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5174
5196
|
|
|
5175
5197
|
// src/components/OrderCheckIcon.tsx
|
|
5176
5198
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5177
5199
|
|
|
5178
5200
|
// src/components/EditingContext.tsx
|
|
5179
|
-
var
|
|
5201
|
+
var import_react37 = require("react");
|
|
5180
5202
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5181
|
-
var EditingContext = (0,
|
|
5203
|
+
var EditingContext = (0, import_react37.createContext)(null);
|
|
5182
5204
|
|
|
5183
5205
|
// src/components/AccessCard.tsx
|
|
5184
5206
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
@@ -5312,7 +5334,7 @@ var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
|
5312
5334
|
|
|
5313
5335
|
// src/components/AccessCardGroup.tsx
|
|
5314
5336
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
5315
|
-
var
|
|
5337
|
+
var import_react38 = require("react");
|
|
5316
5338
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5317
5339
|
|
|
5318
5340
|
// src/components/CalendarRange.tsx
|
|
@@ -5427,20 +5449,20 @@ function CalendarRange({
|
|
|
5427
5449
|
const fromDate = parseDate(from);
|
|
5428
5450
|
const toDate = parseDate(to);
|
|
5429
5451
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
5430
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
5452
|
+
const [baseMonth, setBaseMonth] = (0, import_react39.useState)(
|
|
5431
5453
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
5432
5454
|
);
|
|
5433
|
-
const [selecting, setSelecting] = (0,
|
|
5434
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
5435
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
5436
|
-
(0,
|
|
5455
|
+
const [selecting, setSelecting] = (0, import_react39.useState)("from");
|
|
5456
|
+
const [pendingFrom, setPendingFrom] = (0, import_react39.useState)(void 0);
|
|
5457
|
+
const [hoveredDate, setHoveredDate] = (0, import_react39.useState)(void 0);
|
|
5458
|
+
(0, import_react39.useEffect)(() => {
|
|
5437
5459
|
if (fromDate) {
|
|
5438
5460
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
5439
5461
|
} else if (toDate) {
|
|
5440
5462
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
5441
5463
|
}
|
|
5442
5464
|
}, [from, to]);
|
|
5443
|
-
(0,
|
|
5465
|
+
(0, import_react39.useEffect)(() => {
|
|
5444
5466
|
if (fromDate && toDate) {
|
|
5445
5467
|
setSelecting("from");
|
|
5446
5468
|
setPendingFrom(void 0);
|
|
@@ -5586,14 +5608,14 @@ function CalendarPane({
|
|
|
5586
5608
|
const years = Array.from({ length: 100 }).map(
|
|
5587
5609
|
(_, i) => baseMonth.year - 50 + i
|
|
5588
5610
|
);
|
|
5589
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
5590
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
5591
|
-
const monthMenuRef = (0,
|
|
5592
|
-
const yearMenuRef = (0,
|
|
5611
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react39.useState)(false);
|
|
5612
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react39.useState)(false);
|
|
5613
|
+
const monthMenuRef = (0, import_react39.useRef)(null);
|
|
5614
|
+
const yearMenuRef = (0, import_react39.useRef)(null);
|
|
5593
5615
|
const month = getMonthData(offset);
|
|
5594
5616
|
const totalCells = 42;
|
|
5595
5617
|
const emptyCells = month.firstDayOffset;
|
|
5596
|
-
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_react39.default.Fragment, { children: [
|
|
5597
5619
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5598
5620
|
"div",
|
|
5599
5621
|
{
|
|
@@ -5801,24 +5823,24 @@ var DateInput = (_a) => {
|
|
|
5801
5823
|
"label",
|
|
5802
5824
|
"isDateAvailable"
|
|
5803
5825
|
]);
|
|
5804
|
-
const [visible, setVisible] = (0,
|
|
5805
|
-
const [inputValue, setInputValue] = (0,
|
|
5806
|
-
const [isTyping, setIsTyping] = (0,
|
|
5807
|
-
const popoverRef = (0,
|
|
5808
|
-
const triggerRef = (0,
|
|
5809
|
-
const rootRef = (0,
|
|
5810
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
5826
|
+
const [visible, setVisible] = (0, import_react40.useState)(false);
|
|
5827
|
+
const [inputValue, setInputValue] = (0, import_react40.useState)("");
|
|
5828
|
+
const [isTyping, setIsTyping] = (0, import_react40.useState)(false);
|
|
5829
|
+
const popoverRef = (0, import_react40.useRef)(null);
|
|
5830
|
+
const triggerRef = (0, import_react40.useRef)(null);
|
|
5831
|
+
const rootRef = (0, import_react40.useRef)(null);
|
|
5832
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react40.useState)({
|
|
5811
5833
|
top: 0,
|
|
5812
5834
|
left: 0,
|
|
5813
5835
|
width: 0
|
|
5814
5836
|
});
|
|
5815
5837
|
const [from, to] = [value, ""];
|
|
5816
|
-
(0,
|
|
5838
|
+
(0, import_react40.useEffect)(() => {
|
|
5817
5839
|
if (!isTyping) {
|
|
5818
5840
|
setInputValue(formatDisplayValue(from));
|
|
5819
5841
|
}
|
|
5820
5842
|
}, [from, isTyping]);
|
|
5821
|
-
(0,
|
|
5843
|
+
(0, import_react40.useLayoutEffect)(() => {
|
|
5822
5844
|
if (visible) {
|
|
5823
5845
|
updatePosition();
|
|
5824
5846
|
}
|
|
@@ -5833,7 +5855,7 @@ var DateInput = (_a) => {
|
|
|
5833
5855
|
});
|
|
5834
5856
|
}
|
|
5835
5857
|
};
|
|
5836
|
-
(0,
|
|
5858
|
+
(0, import_react40.useEffect)(() => {
|
|
5837
5859
|
updatePosition();
|
|
5838
5860
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
5839
5861
|
if (triggerRef.current) {
|
|
@@ -5845,7 +5867,7 @@ var DateInput = (_a) => {
|
|
|
5845
5867
|
window.removeEventListener("scroll", updatePosition);
|
|
5846
5868
|
};
|
|
5847
5869
|
}, []);
|
|
5848
|
-
(0,
|
|
5870
|
+
(0, import_react40.useEffect)(() => {
|
|
5849
5871
|
const handleKeyDown2 = (event) => {
|
|
5850
5872
|
var _a2;
|
|
5851
5873
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -5858,7 +5880,7 @@ var DateInput = (_a) => {
|
|
|
5858
5880
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
5859
5881
|
};
|
|
5860
5882
|
});
|
|
5861
|
-
(0,
|
|
5883
|
+
(0, import_react40.useEffect)(() => {
|
|
5862
5884
|
const handleClickOutside = (event) => {
|
|
5863
5885
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
5864
5886
|
setVisible(false);
|