@dmsi/wedgekit-react 0.0.644 → 0.0.646
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-XVWCVBVF.js → chunk-3MV3KMQH.js} +1 -1
- package/dist/{chunk-Z3Q7PLVD.js → chunk-3PBA2EZ5.js} +1 -1
- package/dist/{chunk-LN3HVXH5.js → chunk-B3T7KBDA.js} +1 -1
- package/dist/{chunk-VAARSN7U.js → chunk-EXCAOI2L.js} +3 -3
- package/dist/{chunk-OXOMO76M.js → chunk-FCGPQNS2.js} +1 -1
- package/dist/{chunk-J2QD64F2.js → chunk-FJXWYGB7.js} +5 -5
- package/dist/{chunk-V2GSI3ZX.js → chunk-HIGNJAQA.js} +2 -2
- package/dist/{chunk-NUFBAJ6L.js → chunk-ISRG77J6.js} +1 -1
- package/dist/{chunk-YXZRGZ2I.js → chunk-REC2XOPI.js} +1 -1
- package/dist/{chunk-K22B4L3G.js → chunk-ZSRTAMSW.js} +28 -1
- package/dist/components/CalendarRange.cjs +157 -154
- package/dist/components/CalendarRange.js +11 -11
- package/dist/components/CompactImagesPreview.cjs +6 -3
- package/dist/components/CompactImagesPreview.js +2 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +157 -154
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +11 -11
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +157 -154
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +11 -11
- package/dist/components/DataGrid/PinnedColumns.cjs +157 -154
- package/dist/components/DataGrid/PinnedColumns.js +11 -11
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +157 -154
- package/dist/components/DataGrid/TableBody/LoadingCell.js +11 -11
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +157 -154
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +11 -11
- package/dist/components/DataGrid/TableBody/index.cjs +157 -154
- package/dist/components/DataGrid/TableBody/index.js +11 -11
- package/dist/components/DataGrid/index.cjs +158 -155
- package/dist/components/DataGrid/index.js +11 -11
- package/dist/components/DataGrid/utils.cjs +157 -154
- package/dist/components/DataGrid/utils.js +11 -11
- package/dist/components/DataGridCell.cjs +61 -58
- package/dist/components/DataGridCell.js +5 -5
- package/dist/components/DateInput.cjs +150 -147
- package/dist/components/DateInput.js +11 -11
- package/dist/components/DateRangeInput.cjs +163 -160
- package/dist/components/DateRangeInput.js +11 -11
- package/dist/components/Menu.cjs +15 -12
- package/dist/components/Menu.js +3 -3
- package/dist/components/MenuOption.cjs +8 -5
- package/dist/components/MenuOption.js +2 -2
- package/dist/components/MobileDataGrid/ColumnList.js +1 -1
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +161 -158
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +11 -11
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +1 -1
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +161 -158
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +11 -11
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +1 -1
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +19 -16
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +4 -4
- package/dist/components/MobileDataGrid/index.cjs +170 -167
- package/dist/components/MobileDataGrid/index.js +11 -11
- package/dist/components/Modal.cjs +15 -12
- package/dist/components/Modal.js +2 -2
- package/dist/components/NestedMenu.cjs +11 -8
- package/dist/components/NestedMenu.js +2 -2
- package/dist/components/PDFViewer/index.cjs +31 -28
- package/dist/components/PDFViewer/index.js +2 -2
- package/dist/components/ProductImagePreview/index.cjs +18 -15
- package/dist/components/ProductImagePreview/index.js +2 -2
- package/dist/components/ProjectBar.cjs +3 -0
- package/dist/components/ProjectBar.js +1 -1
- package/dist/components/index.cjs +218 -215
- package/dist/components/index.js +11 -11
- package/dist/components/useMenuSystem.cjs +22 -19
- package/dist/components/useMenuSystem.js +2 -2
- package/dist/hooks/index.cjs +28 -0
- package/dist/hooks/index.js +3 -1
- package/package.json +1 -1
|
@@ -242,7 +242,7 @@ function Icon(_a) {
|
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
// src/components/CalendarRange.tsx
|
|
245
|
-
var
|
|
245
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
246
246
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
247
247
|
|
|
248
248
|
// src/components/DataGridCell.tsx
|
|
@@ -298,11 +298,11 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
298
298
|
|
|
299
299
|
// src/components/DataGridCell.tsx
|
|
300
300
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
301
|
-
var
|
|
301
|
+
var import_react12 = require("react");
|
|
302
302
|
|
|
303
303
|
// src/components/MenuOption.tsx
|
|
304
304
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
305
|
-
var
|
|
305
|
+
var import_react7 = require("react");
|
|
306
306
|
|
|
307
307
|
// src/components/Label.tsx
|
|
308
308
|
var import_clsx3 = __toESM(require("clsx"), 1);
|
|
@@ -717,6 +717,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
717
717
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
718
718
|
}
|
|
719
719
|
|
|
720
|
+
// src/hooks/useEditCell.tsx
|
|
721
|
+
var import_react6 = require("react");
|
|
722
|
+
|
|
720
723
|
// src/components/Caption.tsx
|
|
721
724
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
722
725
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -868,12 +871,12 @@ var MenuOption = ({
|
|
|
868
871
|
onMouseMove,
|
|
869
872
|
small = false
|
|
870
873
|
}) => {
|
|
871
|
-
const uniqueId = (0,
|
|
872
|
-
const internalRef = (0,
|
|
874
|
+
const uniqueId = (0, import_react7.useId)();
|
|
875
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
873
876
|
const actualRef = ref || internalRef;
|
|
874
|
-
const menuId = (0,
|
|
877
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
875
878
|
const isMobile = useMatchesMobile();
|
|
876
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
879
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
877
880
|
const handleMouseEnter = () => {
|
|
878
881
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
879
882
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1033,27 +1036,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1033
1036
|
|
|
1034
1037
|
// src/components/Menu.tsx
|
|
1035
1038
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
1036
|
-
var
|
|
1039
|
+
var import_react9 = require("react");
|
|
1037
1040
|
var import_react_dom = require("react-dom");
|
|
1038
1041
|
|
|
1039
1042
|
// src/components/useMenuSystem.tsx
|
|
1040
|
-
var
|
|
1043
|
+
var import_react8 = require("react");
|
|
1041
1044
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1042
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1045
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1043
1046
|
{}
|
|
1044
1047
|
);
|
|
1045
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1046
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1048
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1049
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1047
1050
|
null
|
|
1048
1051
|
);
|
|
1049
|
-
const menuRootRef = (0,
|
|
1050
|
-
const subMenuRefs = (0,
|
|
1051
|
-
const hoverTimeoutRef = (0,
|
|
1052
|
-
const closeTimeoutRef = (0,
|
|
1053
|
-
const mouseStopTimeoutRef = (0,
|
|
1054
|
-
const isMouseMovingRef = (0,
|
|
1055
|
-
const pendingOpenActionRef = (0,
|
|
1056
|
-
const pendingCloseActionRef = (0,
|
|
1052
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1053
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1054
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1055
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1056
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1057
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1058
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1059
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1057
1060
|
const isMobile = useMatchesMobile();
|
|
1058
1061
|
const toggleMenu = (menuId, level) => {
|
|
1059
1062
|
if (closeTimeoutRef.current) {
|
|
@@ -1093,7 +1096,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1093
1096
|
return newActiveMenus;
|
|
1094
1097
|
});
|
|
1095
1098
|
};
|
|
1096
|
-
const executePendingActions = (0,
|
|
1099
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1097
1100
|
if (pendingCloseActionRef.current) {
|
|
1098
1101
|
pendingCloseActionRef.current();
|
|
1099
1102
|
pendingCloseActionRef.current = null;
|
|
@@ -1182,7 +1185,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1182
1185
|
const isMenuActive = (menuId, level) => {
|
|
1183
1186
|
return activeMenus[level] === menuId;
|
|
1184
1187
|
};
|
|
1185
|
-
(0,
|
|
1188
|
+
(0, import_react8.useEffect)(() => {
|
|
1186
1189
|
const handleClickOutside = (event) => {
|
|
1187
1190
|
var _a;
|
|
1188
1191
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1201,7 +1204,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1201
1204
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1202
1205
|
};
|
|
1203
1206
|
}, [activeMenus]);
|
|
1204
|
-
(0,
|
|
1207
|
+
(0, import_react8.useEffect)(() => {
|
|
1205
1208
|
return () => {
|
|
1206
1209
|
if (hoverTimeoutRef.current) {
|
|
1207
1210
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1279,13 +1282,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1279
1282
|
};
|
|
1280
1283
|
}
|
|
1281
1284
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1282
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1285
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1283
1286
|
top: 0,
|
|
1284
1287
|
left: 0,
|
|
1285
1288
|
minWidth: 0
|
|
1286
1289
|
});
|
|
1287
1290
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1288
|
-
const updatePosition = (0,
|
|
1291
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1289
1292
|
var _a, _b, _c;
|
|
1290
1293
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1291
1294
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1333,7 +1336,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1333
1336
|
minWidth: triggerRect.width
|
|
1334
1337
|
});
|
|
1335
1338
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1336
|
-
(0,
|
|
1339
|
+
(0, import_react8.useEffect)(() => {
|
|
1337
1340
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1338
1341
|
const handleClickOutside = (event) => {
|
|
1339
1342
|
var _a, _b, _c, _d, _e;
|
|
@@ -1359,7 +1362,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1359
1362
|
options == null ? void 0 : options.menuRef,
|
|
1360
1363
|
options == null ? void 0 : options.additionalRefs
|
|
1361
1364
|
]);
|
|
1362
|
-
(0,
|
|
1365
|
+
(0, import_react8.useEffect)(() => {
|
|
1363
1366
|
updatePosition();
|
|
1364
1367
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1365
1368
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1440,9 +1443,9 @@ var Menu = (_a) => {
|
|
|
1440
1443
|
"menuName",
|
|
1441
1444
|
"calculateMinMaxHeight"
|
|
1442
1445
|
]);
|
|
1443
|
-
const internalRef = (0,
|
|
1446
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1444
1447
|
const actualRef = ref || internalRef;
|
|
1445
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1448
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1446
1449
|
const isMobile = useMatchesMobile();
|
|
1447
1450
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1448
1451
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1455,7 +1458,7 @@ var Menu = (_a) => {
|
|
|
1455
1458
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1456
1459
|
}
|
|
1457
1460
|
);
|
|
1458
|
-
(0,
|
|
1461
|
+
(0, import_react9.useEffect)(() => {
|
|
1459
1462
|
if (calculateMinMaxHeight) {
|
|
1460
1463
|
return;
|
|
1461
1464
|
}
|
|
@@ -1479,7 +1482,7 @@ var Menu = (_a) => {
|
|
|
1479
1482
|
cancelAnimationFrame(raf);
|
|
1480
1483
|
};
|
|
1481
1484
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1482
|
-
(0,
|
|
1485
|
+
(0, import_react9.useEffect)(() => {
|
|
1483
1486
|
if (!calculateMinMaxHeight) {
|
|
1484
1487
|
return;
|
|
1485
1488
|
}
|
|
@@ -1490,14 +1493,14 @@ var Menu = (_a) => {
|
|
|
1490
1493
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1491
1494
|
}
|
|
1492
1495
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1493
|
-
(0,
|
|
1496
|
+
(0, import_react9.useEffect)(() => {
|
|
1494
1497
|
if (!show) {
|
|
1495
1498
|
return;
|
|
1496
1499
|
}
|
|
1497
1500
|
initializeMenuFocus();
|
|
1498
1501
|
updatePosition();
|
|
1499
1502
|
}, [show, updatePosition]);
|
|
1500
|
-
(0,
|
|
1503
|
+
(0, import_react9.useEffect)(() => {
|
|
1501
1504
|
if (!show || !setShow) {
|
|
1502
1505
|
return;
|
|
1503
1506
|
}
|
|
@@ -1651,10 +1654,10 @@ var Menu = (_a) => {
|
|
|
1651
1654
|
Menu.displayName = "Menu";
|
|
1652
1655
|
|
|
1653
1656
|
// src/components/Search.tsx
|
|
1654
|
-
var
|
|
1657
|
+
var import_react11 = require("react");
|
|
1655
1658
|
|
|
1656
1659
|
// src/components/Input.tsx
|
|
1657
|
-
var
|
|
1660
|
+
var import_react10 = require("react");
|
|
1658
1661
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1659
1662
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1660
1663
|
var InputBase = (_a) => {
|
|
@@ -1711,9 +1714,9 @@ var InputBase = (_a) => {
|
|
|
1711
1714
|
"data-error": error && !focus || null,
|
|
1712
1715
|
"data-focus": focus || null
|
|
1713
1716
|
};
|
|
1714
|
-
const inputRef = (0,
|
|
1717
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
1715
1718
|
const inputId = id ? `${id}-input` : void 0;
|
|
1716
|
-
(0,
|
|
1719
|
+
(0, import_react10.useEffect)(() => {
|
|
1717
1720
|
var _a2;
|
|
1718
1721
|
const input = inputRef.current;
|
|
1719
1722
|
const focusHandler = () => {
|
|
@@ -1872,15 +1875,15 @@ var Input = (_a) => {
|
|
|
1872
1875
|
"testid",
|
|
1873
1876
|
"rightAdornment"
|
|
1874
1877
|
]);
|
|
1875
|
-
const [internalValue, setInternalValue] = (0,
|
|
1876
|
-
const [displayValue, setDisplayValue] = (0,
|
|
1877
|
-
(0,
|
|
1878
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1879
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1880
|
+
(0, import_react10.useEffect)(() => {
|
|
1878
1881
|
var _a2;
|
|
1879
1882
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
1880
1883
|
setInternalValue(stringValue);
|
|
1881
1884
|
setDisplayValue(stringValue);
|
|
1882
1885
|
}, [propValue]);
|
|
1883
|
-
(0,
|
|
1886
|
+
(0, import_react10.useEffect)(() => {
|
|
1884
1887
|
var _a2;
|
|
1885
1888
|
if (variant !== "currency") {
|
|
1886
1889
|
return;
|
|
@@ -2141,14 +2144,14 @@ var Search = (_a) => {
|
|
|
2141
2144
|
"removeRoundness",
|
|
2142
2145
|
"autocompletePadding"
|
|
2143
2146
|
]);
|
|
2144
|
-
const inputRef = (0,
|
|
2145
|
-
const inputContainerRef = (0,
|
|
2146
|
-
const preventFocusOnInitialRender = (0,
|
|
2147
|
-
const [show, setShow] = (0,
|
|
2148
|
-
const [clearing, setClearing] = (0,
|
|
2149
|
-
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)();
|
|
2150
2153
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2151
|
-
(0,
|
|
2154
|
+
(0, import_react11.useEffect)(() => {
|
|
2152
2155
|
var _a2;
|
|
2153
2156
|
if (preventFocusOnInitialRender.current) {
|
|
2154
2157
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2232,7 +2235,7 @@ Search.displayName = "Search";
|
|
|
2232
2235
|
|
|
2233
2236
|
// src/components/DataGridCell.tsx
|
|
2234
2237
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2235
|
-
var DataGridCell = (0,
|
|
2238
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2236
2239
|
(_a) => {
|
|
2237
2240
|
var _b = _a, {
|
|
2238
2241
|
id,
|
|
@@ -2274,10 +2277,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2274
2277
|
"testid"
|
|
2275
2278
|
]);
|
|
2276
2279
|
const Element = type === "header" ? "th" : "td";
|
|
2277
|
-
const timerRef = (0,
|
|
2278
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2279
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2280
|
-
(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)(() => {
|
|
2281
2284
|
return () => {
|
|
2282
2285
|
if (timerRef.current) {
|
|
2283
2286
|
clearTimeout(timerRef.current);
|
|
@@ -2387,12 +2390,12 @@ function DataCellHeader(_a) {
|
|
|
2387
2390
|
"useMenuDefaultMinWidth"
|
|
2388
2391
|
]);
|
|
2389
2392
|
var _a2;
|
|
2390
|
-
const [showMenu, setShowMenu] = (0,
|
|
2391
|
-
const [filter, setFilter] = (0,
|
|
2393
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2394
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2392
2395
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2393
2396
|
);
|
|
2394
|
-
const ref = (0,
|
|
2395
|
-
const predeterminedPinned = (0,
|
|
2397
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2398
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2396
2399
|
const { column, getContext } = header;
|
|
2397
2400
|
const { id: columnId, setFilterValue } = column;
|
|
2398
2401
|
const {
|
|
@@ -2402,14 +2405,14 @@ function DataCellHeader(_a) {
|
|
|
2402
2405
|
listeners: subMenuListeners,
|
|
2403
2406
|
mobileHide
|
|
2404
2407
|
} = useSubMenuSystem(node ? node : ref);
|
|
2405
|
-
(0,
|
|
2408
|
+
(0, import_react12.useEffect)(() => {
|
|
2406
2409
|
var _a3, _b2, _c;
|
|
2407
2410
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2408
2411
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2409
2412
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2410
2413
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2411
2414
|
}, [columnId, getContext]);
|
|
2412
|
-
(0,
|
|
2415
|
+
(0, import_react12.useEffect)(() => {
|
|
2413
2416
|
const handler = setTimeout(() => {
|
|
2414
2417
|
setFilterValue(filter);
|
|
2415
2418
|
}, 500);
|
|
@@ -2672,7 +2675,7 @@ function DragAlongCell(_a) {
|
|
|
2672
2675
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2673
2676
|
|
|
2674
2677
|
// src/components/DataGrid/index.tsx
|
|
2675
|
-
var
|
|
2678
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
2676
2679
|
var import_react_table3 = require("@tanstack/react-table");
|
|
2677
2680
|
var import_core = require("@dnd-kit/core");
|
|
2678
2681
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -2700,7 +2703,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
2700
2703
|
}
|
|
2701
2704
|
|
|
2702
2705
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
2703
|
-
var
|
|
2706
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2704
2707
|
|
|
2705
2708
|
// src/components/DataGrid/TableBody/index.tsx
|
|
2706
2709
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -2709,7 +2712,7 @@ var import_clsx12 = __toESM(require("clsx"), 1);
|
|
|
2709
2712
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
2710
2713
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2711
2714
|
var import_react_table = require("@tanstack/react-table");
|
|
2712
|
-
var
|
|
2715
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2713
2716
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2714
2717
|
var valueFormatters = {
|
|
2715
2718
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -2777,7 +2780,7 @@ function TableBodyRow({
|
|
|
2777
2780
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
2778
2781
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
2779
2782
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
2780
|
-
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)(
|
|
2781
2784
|
CellElement,
|
|
2782
2785
|
{
|
|
2783
2786
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -2991,10 +2994,10 @@ function TableBody({
|
|
|
2991
2994
|
}
|
|
2992
2995
|
|
|
2993
2996
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
2994
|
-
var
|
|
2997
|
+
var import_react15 = require("react");
|
|
2995
2998
|
|
|
2996
2999
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
2997
|
-
var
|
|
3000
|
+
var import_react14 = require("react");
|
|
2998
3001
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2999
3002
|
function ColumnSelectorMenuOption({
|
|
3000
3003
|
id,
|
|
@@ -3002,7 +3005,7 @@ function ColumnSelectorMenuOption({
|
|
|
3002
3005
|
column,
|
|
3003
3006
|
toggleColumnVisibility
|
|
3004
3007
|
}) {
|
|
3005
|
-
const [isVisible, setIsVisible] = (0,
|
|
3008
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(column.getIsVisible());
|
|
3006
3009
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
3007
3010
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3008
3011
|
Checkbox,
|
|
@@ -3028,8 +3031,8 @@ function ColumnSelectorHeaderCell({
|
|
|
3028
3031
|
toggleColumnVisibility,
|
|
3029
3032
|
resetColumnVisibility
|
|
3030
3033
|
}) {
|
|
3031
|
-
const ref = (0,
|
|
3032
|
-
const [show, setShow] = (0,
|
|
3034
|
+
const ref = (0, import_react15.useRef)(null);
|
|
3035
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
|
3033
3036
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3034
3037
|
DataGridCell,
|
|
3035
3038
|
{
|
|
@@ -3198,7 +3201,7 @@ function PinnedColumns(_a) {
|
|
|
3198
3201
|
header.id
|
|
3199
3202
|
);
|
|
3200
3203
|
}
|
|
3201
|
-
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)(
|
|
3202
3205
|
Checkbox,
|
|
3203
3206
|
{
|
|
3204
3207
|
checked: allSelectedAcrossPages,
|
|
@@ -3280,23 +3283,23 @@ function DataGrid({
|
|
|
3280
3283
|
ref
|
|
3281
3284
|
}) {
|
|
3282
3285
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3283
|
-
(0,
|
|
3286
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
3284
3287
|
getSavedLayout: () => {
|
|
3285
3288
|
return getSavedLayout();
|
|
3286
3289
|
}
|
|
3287
3290
|
}));
|
|
3288
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3289
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3290
|
-
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)({});
|
|
3291
3294
|
const {
|
|
3292
3295
|
columns: tableColumns,
|
|
3293
3296
|
setColumns: setTableColumns,
|
|
3294
3297
|
getSavedLayout
|
|
3295
3298
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3296
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3299
|
+
const [columnOrder, setColumnOrder] = (0, import_react17.useState)(
|
|
3297
3300
|
tableColumns.map((c) => c.id)
|
|
3298
3301
|
);
|
|
3299
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3302
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react17.useState)(
|
|
3300
3303
|
Object.fromEntries(
|
|
3301
3304
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3302
3305
|
var _a2, _b2;
|
|
@@ -3304,7 +3307,7 @@ function DataGrid({
|
|
|
3304
3307
|
})
|
|
3305
3308
|
)
|
|
3306
3309
|
);
|
|
3307
|
-
const updateColumnVisibility = (0,
|
|
3310
|
+
const updateColumnVisibility = (0, import_react17.useCallback)(
|
|
3308
3311
|
(updateOrder) => {
|
|
3309
3312
|
setColumnVisibility(
|
|
3310
3313
|
Object.fromEntries(
|
|
@@ -3318,7 +3321,7 @@ function DataGrid({
|
|
|
3318
3321
|
},
|
|
3319
3322
|
[tableColumns]
|
|
3320
3323
|
);
|
|
3321
|
-
const resetDefaultColumnVisibility = (0,
|
|
3324
|
+
const resetDefaultColumnVisibility = (0, import_react17.useCallback)(() => {
|
|
3322
3325
|
setTableColumns((prev) => {
|
|
3323
3326
|
columns.forEach((column) => {
|
|
3324
3327
|
var _a2, _b2;
|
|
@@ -3334,7 +3337,7 @@ function DataGrid({
|
|
|
3334
3337
|
return [...prev];
|
|
3335
3338
|
}, true);
|
|
3336
3339
|
}, [columns, setTableColumns]);
|
|
3337
|
-
(0,
|
|
3340
|
+
(0, import_react17.useEffect)(() => {
|
|
3338
3341
|
updateColumnVisibility(true);
|
|
3339
3342
|
}, [updateColumnVisibility]);
|
|
3340
3343
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3350,7 +3353,7 @@ function DataGrid({
|
|
|
3350
3353
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3351
3354
|
} : setLocalColumnFilters;
|
|
3352
3355
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3353
|
-
const setRowSelection = (0,
|
|
3356
|
+
const setRowSelection = (0, import_react17.useCallback)(
|
|
3354
3357
|
(updaterOrValue) => {
|
|
3355
3358
|
if (pagination) {
|
|
3356
3359
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3364,9 +3367,9 @@ function DataGrid({
|
|
|
3364
3367
|
},
|
|
3365
3368
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3366
3369
|
);
|
|
3367
|
-
const dndId = (0,
|
|
3368
|
-
const containerRef =
|
|
3369
|
-
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)(
|
|
3370
3373
|
(columnId, isVisible) => {
|
|
3371
3374
|
setTableColumns((prev) => {
|
|
3372
3375
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3614,7 +3617,7 @@ function DataGrid({
|
|
|
3614
3617
|
header.id
|
|
3615
3618
|
);
|
|
3616
3619
|
}
|
|
3617
|
-
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)(
|
|
3618
3621
|
DataGridCell,
|
|
3619
3622
|
{
|
|
3620
3623
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3820,7 +3823,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3820
3823
|
}
|
|
3821
3824
|
|
|
3822
3825
|
// src/components/Select.tsx
|
|
3823
|
-
var
|
|
3826
|
+
var import_react18 = require("react");
|
|
3824
3827
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
3825
3828
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3826
3829
|
var Select = (_a) => {
|
|
@@ -3854,11 +3857,11 @@ var Select = (_a) => {
|
|
|
3854
3857
|
"value"
|
|
3855
3858
|
]);
|
|
3856
3859
|
var _a2;
|
|
3857
|
-
const inputRef = (0,
|
|
3858
|
-
const inputContainerRef = (0,
|
|
3859
|
-
const preventFocusOnInitialRender = (0,
|
|
3860
|
-
const [show, setShow] = (0,
|
|
3861
|
-
(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)(() => {
|
|
3862
3865
|
var _a3;
|
|
3863
3866
|
if (preventFocusOnInitialRender.current) {
|
|
3864
3867
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4280,7 +4283,7 @@ Button.displayName = "Button";
|
|
|
4280
4283
|
|
|
4281
4284
|
// src/components/Tooltip.tsx
|
|
4282
4285
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4283
|
-
var
|
|
4286
|
+
var import_react19 = require("react");
|
|
4284
4287
|
var import_react_dom2 = require("react-dom");
|
|
4285
4288
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4286
4289
|
var Tooltip = ({
|
|
@@ -4293,11 +4296,11 @@ var Tooltip = ({
|
|
|
4293
4296
|
offset = 8,
|
|
4294
4297
|
keepHidden = false
|
|
4295
4298
|
}) => {
|
|
4296
|
-
const ref = (0,
|
|
4297
|
-
const tooltipRef = (0,
|
|
4298
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4299
|
-
const [isVisible, setIsVisible] = (0,
|
|
4300
|
-
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);
|
|
4301
4304
|
const updatePosition = () => {
|
|
4302
4305
|
if (!ref.current || !tooltipRef.current) return;
|
|
4303
4306
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4336,14 +4339,14 @@ var Tooltip = ({
|
|
|
4336
4339
|
setIsVisible(false);
|
|
4337
4340
|
setRemoveOpacity(false);
|
|
4338
4341
|
};
|
|
4339
|
-
(0,
|
|
4342
|
+
(0, import_react19.useEffect)(() => {
|
|
4340
4343
|
if (isVisible && tooltipRef.current) {
|
|
4341
4344
|
requestAnimationFrame(() => {
|
|
4342
4345
|
updatePosition();
|
|
4343
4346
|
});
|
|
4344
4347
|
}
|
|
4345
4348
|
}, [isVisible]);
|
|
4346
|
-
(0,
|
|
4349
|
+
(0, import_react19.useEffect)(() => {
|
|
4347
4350
|
if (isVisible) {
|
|
4348
4351
|
window.addEventListener("resize", updatePosition);
|
|
4349
4352
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4401,7 +4404,7 @@ var Tooltip = ({
|
|
|
4401
4404
|
Tooltip.displayName = "Tooltip";
|
|
4402
4405
|
|
|
4403
4406
|
// src/components/DateInput.tsx
|
|
4404
|
-
var
|
|
4407
|
+
var import_react20 = require("react");
|
|
4405
4408
|
var import_react_dom3 = require("react-dom");
|
|
4406
4409
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4407
4410
|
var DateInput = (_a) => {
|
|
@@ -4426,24 +4429,24 @@ var DateInput = (_a) => {
|
|
|
4426
4429
|
"label",
|
|
4427
4430
|
"isDateAvailable"
|
|
4428
4431
|
]);
|
|
4429
|
-
const [visible, setVisible] = (0,
|
|
4430
|
-
const [inputValue, setInputValue] = (0,
|
|
4431
|
-
const [isTyping, setIsTyping] = (0,
|
|
4432
|
-
const popoverRef = (0,
|
|
4433
|
-
const triggerRef = (0,
|
|
4434
|
-
const rootRef = (0,
|
|
4435
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4432
|
+
const [visible, setVisible] = (0, import_react20.useState)(false);
|
|
4433
|
+
const [inputValue, setInputValue] = (0, import_react20.useState)("");
|
|
4434
|
+
const [isTyping, setIsTyping] = (0, import_react20.useState)(false);
|
|
4435
|
+
const popoverRef = (0, import_react20.useRef)(null);
|
|
4436
|
+
const triggerRef = (0, import_react20.useRef)(null);
|
|
4437
|
+
const rootRef = (0, import_react20.useRef)(null);
|
|
4438
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react20.useState)({
|
|
4436
4439
|
top: 0,
|
|
4437
4440
|
left: 0,
|
|
4438
4441
|
width: 0
|
|
4439
4442
|
});
|
|
4440
4443
|
const [from, to] = [value, ""];
|
|
4441
|
-
(0,
|
|
4444
|
+
(0, import_react20.useEffect)(() => {
|
|
4442
4445
|
if (!isTyping) {
|
|
4443
4446
|
setInputValue(formatDisplayValue(from));
|
|
4444
4447
|
}
|
|
4445
4448
|
}, [from, isTyping]);
|
|
4446
|
-
(0,
|
|
4449
|
+
(0, import_react20.useLayoutEffect)(() => {
|
|
4447
4450
|
if (visible) {
|
|
4448
4451
|
updatePosition();
|
|
4449
4452
|
}
|
|
@@ -4458,7 +4461,7 @@ var DateInput = (_a) => {
|
|
|
4458
4461
|
});
|
|
4459
4462
|
}
|
|
4460
4463
|
};
|
|
4461
|
-
(0,
|
|
4464
|
+
(0, import_react20.useEffect)(() => {
|
|
4462
4465
|
updatePosition();
|
|
4463
4466
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4464
4467
|
if (triggerRef.current) {
|
|
@@ -4470,7 +4473,7 @@ var DateInput = (_a) => {
|
|
|
4470
4473
|
window.removeEventListener("scroll", updatePosition);
|
|
4471
4474
|
};
|
|
4472
4475
|
}, []);
|
|
4473
|
-
(0,
|
|
4476
|
+
(0, import_react20.useEffect)(() => {
|
|
4474
4477
|
const handleKeyDown2 = (event) => {
|
|
4475
4478
|
var _a2;
|
|
4476
4479
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4483,7 +4486,7 @@ var DateInput = (_a) => {
|
|
|
4483
4486
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4484
4487
|
};
|
|
4485
4488
|
});
|
|
4486
|
-
(0,
|
|
4489
|
+
(0, import_react20.useEffect)(() => {
|
|
4487
4490
|
const handleClickOutside = (event) => {
|
|
4488
4491
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4489
4492
|
setVisible(false);
|
|
@@ -4704,14 +4707,14 @@ Heading3.displayName = "Heading3";
|
|
|
4704
4707
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4705
4708
|
|
|
4706
4709
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4707
|
-
var
|
|
4710
|
+
var import_react23 = require("react");
|
|
4708
4711
|
|
|
4709
4712
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
4710
|
-
var
|
|
4713
|
+
var import_react22 = require("react");
|
|
4711
4714
|
|
|
4712
4715
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
4713
|
-
var
|
|
4714
|
-
var GridContext = (0,
|
|
4716
|
+
var import_react21 = require("react");
|
|
4717
|
+
var GridContext = (0, import_react21.createContext)(null);
|
|
4715
4718
|
|
|
4716
4719
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4717
4720
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -4720,12 +4723,12 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
|
4720
4723
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4721
4724
|
|
|
4722
4725
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4723
|
-
var
|
|
4726
|
+
var import_react24 = require("react");
|
|
4724
4727
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4725
4728
|
|
|
4726
4729
|
// src/components/Modal.tsx
|
|
4727
4730
|
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
4728
|
-
var
|
|
4731
|
+
var import_react26 = require("react");
|
|
4729
4732
|
|
|
4730
4733
|
// src/components/ModalHeader.tsx
|
|
4731
4734
|
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
@@ -4901,10 +4904,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
4901
4904
|
var import_react_use = require("react-use");
|
|
4902
4905
|
|
|
4903
4906
|
// src/components/useMounted.tsx
|
|
4904
|
-
var
|
|
4907
|
+
var import_react25 = require("react");
|
|
4905
4908
|
var useMounted = () => {
|
|
4906
|
-
const [isMounted, setIsMounted] = (0,
|
|
4907
|
-
(0,
|
|
4909
|
+
const [isMounted, setIsMounted] = (0, import_react25.useState)(false);
|
|
4910
|
+
(0, import_react25.useEffect)(() => {
|
|
4908
4911
|
setIsMounted(true);
|
|
4909
4912
|
return () => setIsMounted(false);
|
|
4910
4913
|
}, []);
|
|
@@ -4998,12 +5001,12 @@ var Modal = ({
|
|
|
4998
5001
|
}) => {
|
|
4999
5002
|
var _a;
|
|
5000
5003
|
const mounted = useMounted();
|
|
5001
|
-
const modalRef = (0,
|
|
5002
|
-
const bgRef = (0,
|
|
5004
|
+
const modalRef = (0, import_react26.useRef)(null);
|
|
5005
|
+
const bgRef = (0, import_react26.useRef)(null);
|
|
5003
5006
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5004
5007
|
const isMobile = useMatchesMobile();
|
|
5005
5008
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5006
|
-
(0,
|
|
5009
|
+
(0, import_react26.useEffect)(() => {
|
|
5007
5010
|
if (!mounted) return;
|
|
5008
5011
|
if (!modalRef.current || !bgRef.current) {
|
|
5009
5012
|
console.error("Modal or background reference is not set.");
|
|
@@ -5023,7 +5026,7 @@ var Modal = ({
|
|
|
5023
5026
|
bgFadeIn(bgRef.current);
|
|
5024
5027
|
}
|
|
5025
5028
|
}, [mounted, onClose, open, wasOpen]);
|
|
5026
|
-
const handleKeyDown = (0,
|
|
5029
|
+
const handleKeyDown = (0, import_react26.useCallback)(
|
|
5027
5030
|
(e) => {
|
|
5028
5031
|
if (e.key === "Escape") {
|
|
5029
5032
|
if (onClose) {
|
|
@@ -5034,12 +5037,12 @@ var Modal = ({
|
|
|
5034
5037
|
},
|
|
5035
5038
|
[onClose]
|
|
5036
5039
|
);
|
|
5037
|
-
const handleClose = (0,
|
|
5040
|
+
const handleClose = (0, import_react26.useCallback)(() => {
|
|
5038
5041
|
if (onClose) {
|
|
5039
5042
|
onClose();
|
|
5040
5043
|
}
|
|
5041
5044
|
}, [onClose]);
|
|
5042
|
-
(0,
|
|
5045
|
+
(0, import_react26.useEffect)(() => {
|
|
5043
5046
|
if (open) {
|
|
5044
5047
|
document.addEventListener("keyup", handleKeyDown);
|
|
5045
5048
|
}
|
|
@@ -5047,7 +5050,7 @@ var Modal = ({
|
|
|
5047
5050
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5048
5051
|
};
|
|
5049
5052
|
}, [open, handleKeyDown]);
|
|
5050
|
-
(0,
|
|
5053
|
+
(0, import_react26.useEffect)(() => {
|
|
5051
5054
|
if (!open) return;
|
|
5052
5055
|
const scrollY = window.scrollY;
|
|
5053
5056
|
const body = document.body;
|
|
@@ -5068,7 +5071,7 @@ var Modal = ({
|
|
|
5068
5071
|
};
|
|
5069
5072
|
}, [open]);
|
|
5070
5073
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5071
|
-
const backgroundClickHandler = (0,
|
|
5074
|
+
const backgroundClickHandler = (0, import_react26.useCallback)(
|
|
5072
5075
|
(e) => {
|
|
5073
5076
|
const target = e.target;
|
|
5074
5077
|
const currentTarget = e.currentTarget;
|
|
@@ -5177,10 +5180,10 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
|
5177
5180
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5178
5181
|
|
|
5179
5182
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5180
|
-
var
|
|
5183
|
+
var import_react28 = require("react");
|
|
5181
5184
|
|
|
5182
5185
|
// src/components/ImagePlaceholder.tsx
|
|
5183
|
-
var
|
|
5186
|
+
var import_react27 = require("react");
|
|
5184
5187
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5185
5188
|
|
|
5186
5189
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5191,11 +5194,11 @@ var import_clsx31 = __toESM(require("clsx"), 1);
|
|
|
5191
5194
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5192
5195
|
|
|
5193
5196
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5194
|
-
var
|
|
5197
|
+
var import_react29 = require("react");
|
|
5195
5198
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5196
5199
|
|
|
5197
5200
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5198
|
-
var
|
|
5201
|
+
var import_react30 = require("react");
|
|
5199
5202
|
|
|
5200
5203
|
// src/components/Surface.tsx
|
|
5201
5204
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
@@ -5240,17 +5243,17 @@ var import_clsx33 = require("clsx");
|
|
|
5240
5243
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5241
5244
|
|
|
5242
5245
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5243
|
-
var
|
|
5246
|
+
var import_react31 = require("react");
|
|
5244
5247
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5245
5248
|
|
|
5246
5249
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5247
|
-
var
|
|
5250
|
+
var import_react32 = require("react");
|
|
5248
5251
|
|
|
5249
5252
|
// src/components/ProductImagePreview/index.tsx
|
|
5250
5253
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5251
5254
|
|
|
5252
5255
|
// src/components/CompactImagesPreview.tsx
|
|
5253
|
-
var
|
|
5256
|
+
var import_react33 = require("react");
|
|
5254
5257
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
5255
5258
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5256
5259
|
|
|
@@ -5259,12 +5262,12 @@ var import_clsx35 = __toESM(require("clsx"), 1);
|
|
|
5259
5262
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5260
5263
|
|
|
5261
5264
|
// src/components/ListGroup.tsx
|
|
5262
|
-
var
|
|
5265
|
+
var import_react34 = require("react");
|
|
5263
5266
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
5264
5267
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5265
5268
|
|
|
5266
5269
|
// src/components/Pagination.tsx
|
|
5267
|
-
var
|
|
5270
|
+
var import_react35 = require("react");
|
|
5268
5271
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5269
5272
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5270
5273
|
var Pagination = ({
|
|
@@ -5276,7 +5279,7 @@ var Pagination = ({
|
|
|
5276
5279
|
className,
|
|
5277
5280
|
disabled
|
|
5278
5281
|
}) => {
|
|
5279
|
-
const goTo = (0,
|
|
5282
|
+
const goTo = (0, import_react35.useCallback)(
|
|
5280
5283
|
(page) => {
|
|
5281
5284
|
if (disabled) return;
|
|
5282
5285
|
onPageChange(page);
|
|
@@ -5293,7 +5296,7 @@ var Pagination = ({
|
|
|
5293
5296
|
goTo(currentPage + 1);
|
|
5294
5297
|
}
|
|
5295
5298
|
};
|
|
5296
|
-
const pageTokens = (0,
|
|
5299
|
+
const pageTokens = (0, import_react35.useMemo)(() => {
|
|
5297
5300
|
if (totalPages <= 5) {
|
|
5298
5301
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5299
5302
|
}
|
|
@@ -5416,21 +5419,21 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
5416
5419
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5417
5420
|
|
|
5418
5421
|
// src/components/SearchResultImage/index.tsx
|
|
5419
|
-
var
|
|
5422
|
+
var import_react36 = require("react");
|
|
5420
5423
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5421
5424
|
|
|
5422
5425
|
// src/components/Alert.tsx
|
|
5423
5426
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5424
|
-
var
|
|
5427
|
+
var import_react37 = require("react");
|
|
5425
5428
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5426
5429
|
|
|
5427
5430
|
// src/components/OrderCheckIcon.tsx
|
|
5428
5431
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5429
5432
|
|
|
5430
5433
|
// src/components/EditingContext.tsx
|
|
5431
|
-
var
|
|
5434
|
+
var import_react38 = require("react");
|
|
5432
5435
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5433
|
-
var EditingContext = (0,
|
|
5436
|
+
var EditingContext = (0, import_react38.createContext)(null);
|
|
5434
5437
|
|
|
5435
5438
|
// src/components/AccessCard.tsx
|
|
5436
5439
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
@@ -5564,7 +5567,7 @@ var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
|
5564
5567
|
|
|
5565
5568
|
// src/components/AccessCardGroup.tsx
|
|
5566
5569
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
5567
|
-
var
|
|
5570
|
+
var import_react39 = require("react");
|
|
5568
5571
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5569
5572
|
|
|
5570
5573
|
// src/components/CalendarRange.tsx
|
|
@@ -5682,20 +5685,20 @@ function CalendarRange({
|
|
|
5682
5685
|
const fromDate = parseDate(from);
|
|
5683
5686
|
const toDate = parseDate(to);
|
|
5684
5687
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
5685
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
5688
|
+
const [baseMonth, setBaseMonth] = (0, import_react40.useState)(
|
|
5686
5689
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
5687
5690
|
);
|
|
5688
|
-
const [selecting, setSelecting] = (0,
|
|
5689
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
5690
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
5691
|
-
(0,
|
|
5691
|
+
const [selecting, setSelecting] = (0, import_react40.useState)("from");
|
|
5692
|
+
const [pendingFrom, setPendingFrom] = (0, import_react40.useState)(void 0);
|
|
5693
|
+
const [hoveredDate, setHoveredDate] = (0, import_react40.useState)(void 0);
|
|
5694
|
+
(0, import_react40.useEffect)(() => {
|
|
5692
5695
|
if (fromDate) {
|
|
5693
5696
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
5694
5697
|
} else if (toDate) {
|
|
5695
5698
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
5696
5699
|
}
|
|
5697
5700
|
}, [from, to]);
|
|
5698
|
-
(0,
|
|
5701
|
+
(0, import_react40.useEffect)(() => {
|
|
5699
5702
|
if (fromDate && toDate) {
|
|
5700
5703
|
setSelecting("from");
|
|
5701
5704
|
setPendingFrom(void 0);
|
|
@@ -5841,14 +5844,14 @@ function CalendarPane({
|
|
|
5841
5844
|
const years = Array.from({ length: 100 }).map(
|
|
5842
5845
|
(_, i) => baseMonth.year - 50 + i
|
|
5843
5846
|
);
|
|
5844
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
5845
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
5846
|
-
const monthMenuRef = (0,
|
|
5847
|
-
const yearMenuRef = (0,
|
|
5847
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react40.useState)(false);
|
|
5848
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react40.useState)(false);
|
|
5849
|
+
const monthMenuRef = (0, import_react40.useRef)(null);
|
|
5850
|
+
const yearMenuRef = (0, import_react40.useRef)(null);
|
|
5848
5851
|
const month = getMonthData(offset);
|
|
5849
5852
|
const totalCells = 42;
|
|
5850
5853
|
const emptyCells = month.firstDayOffset;
|
|
5851
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
5854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react40.default.Fragment, { children: [
|
|
5852
5855
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
5853
5856
|
"div",
|
|
5854
5857
|
{
|