@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
|
@@ -149,7 +149,7 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
149
149
|
|
|
150
150
|
// src/components/DataGridCell.tsx
|
|
151
151
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
152
|
-
var
|
|
152
|
+
var import_react12 = require("react");
|
|
153
153
|
|
|
154
154
|
// src/classNames.ts
|
|
155
155
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -293,7 +293,7 @@ var gapUsingContainerPadding = (0, import_clsx.default)(
|
|
|
293
293
|
|
|
294
294
|
// src/components/MenuOption.tsx
|
|
295
295
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
296
|
-
var
|
|
296
|
+
var import_react7 = require("react");
|
|
297
297
|
|
|
298
298
|
// src/components/Label.tsx
|
|
299
299
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
@@ -743,6 +743,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
743
743
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
744
744
|
}
|
|
745
745
|
|
|
746
|
+
// src/hooks/useEditCell.tsx
|
|
747
|
+
var import_react6 = require("react");
|
|
748
|
+
|
|
746
749
|
// src/components/Caption.tsx
|
|
747
750
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
748
751
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -894,12 +897,12 @@ var MenuOption = ({
|
|
|
894
897
|
onMouseMove,
|
|
895
898
|
small = false
|
|
896
899
|
}) => {
|
|
897
|
-
const uniqueId = (0,
|
|
898
|
-
const internalRef = (0,
|
|
900
|
+
const uniqueId = (0, import_react7.useId)();
|
|
901
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
899
902
|
const actualRef = ref || internalRef;
|
|
900
|
-
const menuId = (0,
|
|
903
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
901
904
|
const isMobile = useMatchesMobile();
|
|
902
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
905
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
903
906
|
const handleMouseEnter = () => {
|
|
904
907
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
905
908
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1059,27 +1062,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1059
1062
|
|
|
1060
1063
|
// src/components/Menu.tsx
|
|
1061
1064
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
1062
|
-
var
|
|
1065
|
+
var import_react9 = require("react");
|
|
1063
1066
|
var import_react_dom = require("react-dom");
|
|
1064
1067
|
|
|
1065
1068
|
// src/components/useMenuSystem.tsx
|
|
1066
|
-
var
|
|
1069
|
+
var import_react8 = require("react");
|
|
1067
1070
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1068
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1071
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1069
1072
|
{}
|
|
1070
1073
|
);
|
|
1071
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1072
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1074
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1075
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1073
1076
|
null
|
|
1074
1077
|
);
|
|
1075
|
-
const menuRootRef = (0,
|
|
1076
|
-
const subMenuRefs = (0,
|
|
1077
|
-
const hoverTimeoutRef = (0,
|
|
1078
|
-
const closeTimeoutRef = (0,
|
|
1079
|
-
const mouseStopTimeoutRef = (0,
|
|
1080
|
-
const isMouseMovingRef = (0,
|
|
1081
|
-
const pendingOpenActionRef = (0,
|
|
1082
|
-
const pendingCloseActionRef = (0,
|
|
1078
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1079
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1080
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1081
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1082
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1083
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1084
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1085
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1083
1086
|
const isMobile = useMatchesMobile();
|
|
1084
1087
|
const toggleMenu = (menuId, level) => {
|
|
1085
1088
|
if (closeTimeoutRef.current) {
|
|
@@ -1119,7 +1122,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1119
1122
|
return newActiveMenus;
|
|
1120
1123
|
});
|
|
1121
1124
|
};
|
|
1122
|
-
const executePendingActions = (0,
|
|
1125
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1123
1126
|
if (pendingCloseActionRef.current) {
|
|
1124
1127
|
pendingCloseActionRef.current();
|
|
1125
1128
|
pendingCloseActionRef.current = null;
|
|
@@ -1208,7 +1211,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1208
1211
|
const isMenuActive = (menuId, level) => {
|
|
1209
1212
|
return activeMenus[level] === menuId;
|
|
1210
1213
|
};
|
|
1211
|
-
(0,
|
|
1214
|
+
(0, import_react8.useEffect)(() => {
|
|
1212
1215
|
const handleClickOutside = (event) => {
|
|
1213
1216
|
var _a;
|
|
1214
1217
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1227,7 +1230,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1227
1230
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1228
1231
|
};
|
|
1229
1232
|
}, [activeMenus]);
|
|
1230
|
-
(0,
|
|
1233
|
+
(0, import_react8.useEffect)(() => {
|
|
1231
1234
|
return () => {
|
|
1232
1235
|
if (hoverTimeoutRef.current) {
|
|
1233
1236
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1305,13 +1308,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1305
1308
|
};
|
|
1306
1309
|
}
|
|
1307
1310
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1308
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1311
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1309
1312
|
top: 0,
|
|
1310
1313
|
left: 0,
|
|
1311
1314
|
minWidth: 0
|
|
1312
1315
|
});
|
|
1313
1316
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1314
|
-
const updatePosition = (0,
|
|
1317
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1315
1318
|
var _a, _b, _c;
|
|
1316
1319
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1317
1320
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1359,7 +1362,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1359
1362
|
minWidth: triggerRect.width
|
|
1360
1363
|
});
|
|
1361
1364
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1362
|
-
(0,
|
|
1365
|
+
(0, import_react8.useEffect)(() => {
|
|
1363
1366
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1364
1367
|
const handleClickOutside = (event) => {
|
|
1365
1368
|
var _a, _b, _c, _d, _e;
|
|
@@ -1385,7 +1388,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1385
1388
|
options == null ? void 0 : options.menuRef,
|
|
1386
1389
|
options == null ? void 0 : options.additionalRefs
|
|
1387
1390
|
]);
|
|
1388
|
-
(0,
|
|
1391
|
+
(0, import_react8.useEffect)(() => {
|
|
1389
1392
|
updatePosition();
|
|
1390
1393
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1391
1394
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1466,9 +1469,9 @@ var Menu = (_a) => {
|
|
|
1466
1469
|
"menuName",
|
|
1467
1470
|
"calculateMinMaxHeight"
|
|
1468
1471
|
]);
|
|
1469
|
-
const internalRef = (0,
|
|
1472
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1470
1473
|
const actualRef = ref || internalRef;
|
|
1471
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1474
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1472
1475
|
const isMobile = useMatchesMobile();
|
|
1473
1476
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1474
1477
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1481,7 +1484,7 @@ var Menu = (_a) => {
|
|
|
1481
1484
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1482
1485
|
}
|
|
1483
1486
|
);
|
|
1484
|
-
(0,
|
|
1487
|
+
(0, import_react9.useEffect)(() => {
|
|
1485
1488
|
if (calculateMinMaxHeight) {
|
|
1486
1489
|
return;
|
|
1487
1490
|
}
|
|
@@ -1505,7 +1508,7 @@ var Menu = (_a) => {
|
|
|
1505
1508
|
cancelAnimationFrame(raf);
|
|
1506
1509
|
};
|
|
1507
1510
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1508
|
-
(0,
|
|
1511
|
+
(0, import_react9.useEffect)(() => {
|
|
1509
1512
|
if (!calculateMinMaxHeight) {
|
|
1510
1513
|
return;
|
|
1511
1514
|
}
|
|
@@ -1516,14 +1519,14 @@ var Menu = (_a) => {
|
|
|
1516
1519
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1517
1520
|
}
|
|
1518
1521
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1519
|
-
(0,
|
|
1522
|
+
(0, import_react9.useEffect)(() => {
|
|
1520
1523
|
if (!show) {
|
|
1521
1524
|
return;
|
|
1522
1525
|
}
|
|
1523
1526
|
initializeMenuFocus();
|
|
1524
1527
|
updatePosition();
|
|
1525
1528
|
}, [show, updatePosition]);
|
|
1526
|
-
(0,
|
|
1529
|
+
(0, import_react9.useEffect)(() => {
|
|
1527
1530
|
if (!show || !setShow) {
|
|
1528
1531
|
return;
|
|
1529
1532
|
}
|
|
@@ -1677,10 +1680,10 @@ var Menu = (_a) => {
|
|
|
1677
1680
|
Menu.displayName = "Menu";
|
|
1678
1681
|
|
|
1679
1682
|
// src/components/Search.tsx
|
|
1680
|
-
var
|
|
1683
|
+
var import_react11 = require("react");
|
|
1681
1684
|
|
|
1682
1685
|
// src/components/Input.tsx
|
|
1683
|
-
var
|
|
1686
|
+
var import_react10 = require("react");
|
|
1684
1687
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1685
1688
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1686
1689
|
var InputBase = (_a) => {
|
|
@@ -1737,9 +1740,9 @@ var InputBase = (_a) => {
|
|
|
1737
1740
|
"data-error": error && !focus || null,
|
|
1738
1741
|
"data-focus": focus || null
|
|
1739
1742
|
};
|
|
1740
|
-
const inputRef = (0,
|
|
1743
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
1741
1744
|
const inputId = id ? `${id}-input` : void 0;
|
|
1742
|
-
(0,
|
|
1745
|
+
(0, import_react10.useEffect)(() => {
|
|
1743
1746
|
var _a2;
|
|
1744
1747
|
const input = inputRef.current;
|
|
1745
1748
|
const focusHandler = () => {
|
|
@@ -1898,15 +1901,15 @@ var Input = (_a) => {
|
|
|
1898
1901
|
"testid",
|
|
1899
1902
|
"rightAdornment"
|
|
1900
1903
|
]);
|
|
1901
|
-
const [internalValue, setInternalValue] = (0,
|
|
1902
|
-
const [displayValue, setDisplayValue] = (0,
|
|
1903
|
-
(0,
|
|
1904
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1905
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1906
|
+
(0, import_react10.useEffect)(() => {
|
|
1904
1907
|
var _a2;
|
|
1905
1908
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
1906
1909
|
setInternalValue(stringValue);
|
|
1907
1910
|
setDisplayValue(stringValue);
|
|
1908
1911
|
}, [propValue]);
|
|
1909
|
-
(0,
|
|
1912
|
+
(0, import_react10.useEffect)(() => {
|
|
1910
1913
|
var _a2;
|
|
1911
1914
|
if (variant !== "currency") {
|
|
1912
1915
|
return;
|
|
@@ -2167,14 +2170,14 @@ var Search = (_a) => {
|
|
|
2167
2170
|
"removeRoundness",
|
|
2168
2171
|
"autocompletePadding"
|
|
2169
2172
|
]);
|
|
2170
|
-
const inputRef = (0,
|
|
2171
|
-
const inputContainerRef = (0,
|
|
2172
|
-
const preventFocusOnInitialRender = (0,
|
|
2173
|
-
const [show, setShow] = (0,
|
|
2174
|
-
const [clearing, setClearing] = (0,
|
|
2175
|
-
const uniqueId = (0,
|
|
2173
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2174
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2175
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2176
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2177
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2178
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2176
2179
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2177
|
-
(0,
|
|
2180
|
+
(0, import_react11.useEffect)(() => {
|
|
2178
2181
|
var _a2;
|
|
2179
2182
|
if (preventFocusOnInitialRender.current) {
|
|
2180
2183
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2258,7 +2261,7 @@ Search.displayName = "Search";
|
|
|
2258
2261
|
|
|
2259
2262
|
// src/components/DataGridCell.tsx
|
|
2260
2263
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2261
|
-
var DataGridCell = (0,
|
|
2264
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2262
2265
|
(_a) => {
|
|
2263
2266
|
var _b = _a, {
|
|
2264
2267
|
id,
|
|
@@ -2300,10 +2303,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2300
2303
|
"testid"
|
|
2301
2304
|
]);
|
|
2302
2305
|
const Element = type === "header" ? "th" : "td";
|
|
2303
|
-
const timerRef = (0,
|
|
2304
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2305
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2306
|
-
(0,
|
|
2306
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2307
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2308
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2309
|
+
(0, import_react12.useEffect)(() => {
|
|
2307
2310
|
return () => {
|
|
2308
2311
|
if (timerRef.current) {
|
|
2309
2312
|
clearTimeout(timerRef.current);
|
|
@@ -2413,12 +2416,12 @@ function DataCellHeader(_a) {
|
|
|
2413
2416
|
"useMenuDefaultMinWidth"
|
|
2414
2417
|
]);
|
|
2415
2418
|
var _a2;
|
|
2416
|
-
const [showMenu, setShowMenu] = (0,
|
|
2417
|
-
const [filter, setFilter] = (0,
|
|
2419
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2420
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2418
2421
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2419
2422
|
);
|
|
2420
|
-
const ref = (0,
|
|
2421
|
-
const predeterminedPinned = (0,
|
|
2423
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2424
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2422
2425
|
const { column, getContext } = header;
|
|
2423
2426
|
const { id: columnId, setFilterValue } = column;
|
|
2424
2427
|
const {
|
|
@@ -2428,14 +2431,14 @@ function DataCellHeader(_a) {
|
|
|
2428
2431
|
listeners: subMenuListeners,
|
|
2429
2432
|
mobileHide
|
|
2430
2433
|
} = useSubMenuSystem(node ? node : ref);
|
|
2431
|
-
(0,
|
|
2434
|
+
(0, import_react12.useEffect)(() => {
|
|
2432
2435
|
var _a3, _b2, _c;
|
|
2433
2436
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2434
2437
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2435
2438
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2436
2439
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2437
2440
|
}, [columnId, getContext]);
|
|
2438
|
-
(0,
|
|
2441
|
+
(0, import_react12.useEffect)(() => {
|
|
2439
2442
|
const handler = setTimeout(() => {
|
|
2440
2443
|
setFilterValue(filter);
|
|
2441
2444
|
}, 500);
|
|
@@ -2698,7 +2701,7 @@ function DragAlongCell(_a) {
|
|
|
2698
2701
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2699
2702
|
|
|
2700
2703
|
// src/components/DataGrid/index.tsx
|
|
2701
|
-
var
|
|
2704
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
2702
2705
|
var import_react_table3 = require("@tanstack/react-table");
|
|
2703
2706
|
var import_core = require("@dnd-kit/core");
|
|
2704
2707
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -2726,7 +2729,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
2726
2729
|
}
|
|
2727
2730
|
|
|
2728
2731
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
2729
|
-
var
|
|
2732
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2730
2733
|
|
|
2731
2734
|
// src/components/DataGrid/TableBody/index.tsx
|
|
2732
2735
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -2735,7 +2738,7 @@ var import_clsx12 = __toESM(require("clsx"), 1);
|
|
|
2735
2738
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
2736
2739
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2737
2740
|
var import_react_table = require("@tanstack/react-table");
|
|
2738
|
-
var
|
|
2741
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2739
2742
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2740
2743
|
var valueFormatters = {
|
|
2741
2744
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -2803,7 +2806,7 @@ function TableBodyRow({
|
|
|
2803
2806
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
2804
2807
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
2805
2808
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
2806
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2809
|
+
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)(
|
|
2807
2810
|
CellElement,
|
|
2808
2811
|
{
|
|
2809
2812
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -3017,10 +3020,10 @@ function TableBody({
|
|
|
3017
3020
|
}
|
|
3018
3021
|
|
|
3019
3022
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
3020
|
-
var
|
|
3023
|
+
var import_react15 = require("react");
|
|
3021
3024
|
|
|
3022
3025
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
3023
|
-
var
|
|
3026
|
+
var import_react14 = require("react");
|
|
3024
3027
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3025
3028
|
function ColumnSelectorMenuOption({
|
|
3026
3029
|
id,
|
|
@@ -3028,7 +3031,7 @@ function ColumnSelectorMenuOption({
|
|
|
3028
3031
|
column,
|
|
3029
3032
|
toggleColumnVisibility
|
|
3030
3033
|
}) {
|
|
3031
|
-
const [isVisible, setIsVisible] = (0,
|
|
3034
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(column.getIsVisible());
|
|
3032
3035
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
3033
3036
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3034
3037
|
Checkbox,
|
|
@@ -3054,8 +3057,8 @@ function ColumnSelectorHeaderCell({
|
|
|
3054
3057
|
toggleColumnVisibility,
|
|
3055
3058
|
resetColumnVisibility
|
|
3056
3059
|
}) {
|
|
3057
|
-
const ref = (0,
|
|
3058
|
-
const [show, setShow] = (0,
|
|
3060
|
+
const ref = (0, import_react15.useRef)(null);
|
|
3061
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
|
3059
3062
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3060
3063
|
DataGridCell,
|
|
3061
3064
|
{
|
|
@@ -3224,7 +3227,7 @@ function PinnedColumns(_a) {
|
|
|
3224
3227
|
header.id
|
|
3225
3228
|
);
|
|
3226
3229
|
}
|
|
3227
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3230
|
+
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)(
|
|
3228
3231
|
Checkbox,
|
|
3229
3232
|
{
|
|
3230
3233
|
checked: allSelectedAcrossPages,
|
|
@@ -3306,23 +3309,23 @@ function DataGrid({
|
|
|
3306
3309
|
ref
|
|
3307
3310
|
}) {
|
|
3308
3311
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3309
|
-
(0,
|
|
3312
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
3310
3313
|
getSavedLayout: () => {
|
|
3311
3314
|
return getSavedLayout();
|
|
3312
3315
|
}
|
|
3313
3316
|
}));
|
|
3314
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3315
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3316
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3317
|
+
const [localSorting, setLocalSorting] = (0, import_react17.useState)([]);
|
|
3318
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react17.useState)([]);
|
|
3319
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react17.useState)({});
|
|
3317
3320
|
const {
|
|
3318
3321
|
columns: tableColumns,
|
|
3319
3322
|
setColumns: setTableColumns,
|
|
3320
3323
|
getSavedLayout
|
|
3321
3324
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3322
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3325
|
+
const [columnOrder, setColumnOrder] = (0, import_react17.useState)(
|
|
3323
3326
|
tableColumns.map((c) => c.id)
|
|
3324
3327
|
);
|
|
3325
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3328
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react17.useState)(
|
|
3326
3329
|
Object.fromEntries(
|
|
3327
3330
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3328
3331
|
var _a2, _b2;
|
|
@@ -3330,7 +3333,7 @@ function DataGrid({
|
|
|
3330
3333
|
})
|
|
3331
3334
|
)
|
|
3332
3335
|
);
|
|
3333
|
-
const updateColumnVisibility = (0,
|
|
3336
|
+
const updateColumnVisibility = (0, import_react17.useCallback)(
|
|
3334
3337
|
(updateOrder) => {
|
|
3335
3338
|
setColumnVisibility(
|
|
3336
3339
|
Object.fromEntries(
|
|
@@ -3344,7 +3347,7 @@ function DataGrid({
|
|
|
3344
3347
|
},
|
|
3345
3348
|
[tableColumns]
|
|
3346
3349
|
);
|
|
3347
|
-
const resetDefaultColumnVisibility = (0,
|
|
3350
|
+
const resetDefaultColumnVisibility = (0, import_react17.useCallback)(() => {
|
|
3348
3351
|
setTableColumns((prev) => {
|
|
3349
3352
|
columns.forEach((column) => {
|
|
3350
3353
|
var _a2, _b2;
|
|
@@ -3360,7 +3363,7 @@ function DataGrid({
|
|
|
3360
3363
|
return [...prev];
|
|
3361
3364
|
}, true);
|
|
3362
3365
|
}, [columns, setTableColumns]);
|
|
3363
|
-
(0,
|
|
3366
|
+
(0, import_react17.useEffect)(() => {
|
|
3364
3367
|
updateColumnVisibility(true);
|
|
3365
3368
|
}, [updateColumnVisibility]);
|
|
3366
3369
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3376,7 +3379,7 @@ function DataGrid({
|
|
|
3376
3379
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3377
3380
|
} : setLocalColumnFilters;
|
|
3378
3381
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3379
|
-
const setRowSelection = (0,
|
|
3382
|
+
const setRowSelection = (0, import_react17.useCallback)(
|
|
3380
3383
|
(updaterOrValue) => {
|
|
3381
3384
|
if (pagination) {
|
|
3382
3385
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3390,9 +3393,9 @@ function DataGrid({
|
|
|
3390
3393
|
},
|
|
3391
3394
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3392
3395
|
);
|
|
3393
|
-
const dndId = (0,
|
|
3394
|
-
const containerRef =
|
|
3395
|
-
const toggleColumnVisibility = (0,
|
|
3396
|
+
const dndId = (0, import_react17.useId)();
|
|
3397
|
+
const containerRef = import_react17.default.useRef(null);
|
|
3398
|
+
const toggleColumnVisibility = (0, import_react17.useCallback)(
|
|
3396
3399
|
(columnId, isVisible) => {
|
|
3397
3400
|
setTableColumns((prev) => {
|
|
3398
3401
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3640,7 +3643,7 @@ function DataGrid({
|
|
|
3640
3643
|
header.id
|
|
3641
3644
|
);
|
|
3642
3645
|
}
|
|
3643
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3646
|
+
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)(
|
|
3644
3647
|
DataGridCell,
|
|
3645
3648
|
{
|
|
3646
3649
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3846,7 +3849,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3846
3849
|
}
|
|
3847
3850
|
|
|
3848
3851
|
// src/components/Select.tsx
|
|
3849
|
-
var
|
|
3852
|
+
var import_react18 = require("react");
|
|
3850
3853
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
3851
3854
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3852
3855
|
var Select = (_a) => {
|
|
@@ -3880,11 +3883,11 @@ var Select = (_a) => {
|
|
|
3880
3883
|
"value"
|
|
3881
3884
|
]);
|
|
3882
3885
|
var _a2;
|
|
3883
|
-
const inputRef = (0,
|
|
3884
|
-
const inputContainerRef = (0,
|
|
3885
|
-
const preventFocusOnInitialRender = (0,
|
|
3886
|
-
const [show, setShow] = (0,
|
|
3887
|
-
(0,
|
|
3886
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
3887
|
+
const inputContainerRef = (0, import_react18.useRef)(null);
|
|
3888
|
+
const preventFocusOnInitialRender = (0, import_react18.useRef)(true);
|
|
3889
|
+
const [show, setShow] = (0, import_react18.useState)(false);
|
|
3890
|
+
(0, import_react18.useEffect)(() => {
|
|
3888
3891
|
var _a3;
|
|
3889
3892
|
if (preventFocusOnInitialRender.current) {
|
|
3890
3893
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4306,7 +4309,7 @@ Button.displayName = "Button";
|
|
|
4306
4309
|
|
|
4307
4310
|
// src/components/Tooltip.tsx
|
|
4308
4311
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4309
|
-
var
|
|
4312
|
+
var import_react19 = require("react");
|
|
4310
4313
|
var import_react_dom2 = require("react-dom");
|
|
4311
4314
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4312
4315
|
var Tooltip = ({
|
|
@@ -4319,11 +4322,11 @@ var Tooltip = ({
|
|
|
4319
4322
|
offset = 8,
|
|
4320
4323
|
keepHidden = false
|
|
4321
4324
|
}) => {
|
|
4322
|
-
const ref = (0,
|
|
4323
|
-
const tooltipRef = (0,
|
|
4324
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4325
|
-
const [isVisible, setIsVisible] = (0,
|
|
4326
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4325
|
+
const ref = (0, import_react19.useRef)(null);
|
|
4326
|
+
const tooltipRef = (0, import_react19.useRef)(null);
|
|
4327
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react19.useState)({ top: 0, left: 0 });
|
|
4328
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
4329
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react19.useState)(false);
|
|
4327
4330
|
const updatePosition = () => {
|
|
4328
4331
|
if (!ref.current || !tooltipRef.current) return;
|
|
4329
4332
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4362,14 +4365,14 @@ var Tooltip = ({
|
|
|
4362
4365
|
setIsVisible(false);
|
|
4363
4366
|
setRemoveOpacity(false);
|
|
4364
4367
|
};
|
|
4365
|
-
(0,
|
|
4368
|
+
(0, import_react19.useEffect)(() => {
|
|
4366
4369
|
if (isVisible && tooltipRef.current) {
|
|
4367
4370
|
requestAnimationFrame(() => {
|
|
4368
4371
|
updatePosition();
|
|
4369
4372
|
});
|
|
4370
4373
|
}
|
|
4371
4374
|
}, [isVisible]);
|
|
4372
|
-
(0,
|
|
4375
|
+
(0, import_react19.useEffect)(() => {
|
|
4373
4376
|
if (isVisible) {
|
|
4374
4377
|
window.addEventListener("resize", updatePosition);
|
|
4375
4378
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4427,12 +4430,12 @@ var Tooltip = ({
|
|
|
4427
4430
|
Tooltip.displayName = "Tooltip";
|
|
4428
4431
|
|
|
4429
4432
|
// src/components/DateInput.tsx
|
|
4430
|
-
var
|
|
4433
|
+
var import_react21 = require("react");
|
|
4431
4434
|
var import_react_dom3 = require("react-dom");
|
|
4432
4435
|
|
|
4433
4436
|
// src/components/CalendarRange.tsx
|
|
4434
4437
|
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
4435
|
-
var
|
|
4438
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
4436
4439
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4437
4440
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4438
4441
|
function DateCell(_a) {
|
|
@@ -4545,20 +4548,20 @@ function CalendarRange({
|
|
|
4545
4548
|
const fromDate = parseDate(from);
|
|
4546
4549
|
const toDate = parseDate(to);
|
|
4547
4550
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4548
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4551
|
+
const [baseMonth, setBaseMonth] = (0, import_react20.useState)(
|
|
4549
4552
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4550
4553
|
);
|
|
4551
|
-
const [selecting, setSelecting] = (0,
|
|
4552
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4553
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4554
|
-
(0,
|
|
4554
|
+
const [selecting, setSelecting] = (0, import_react20.useState)("from");
|
|
4555
|
+
const [pendingFrom, setPendingFrom] = (0, import_react20.useState)(void 0);
|
|
4556
|
+
const [hoveredDate, setHoveredDate] = (0, import_react20.useState)(void 0);
|
|
4557
|
+
(0, import_react20.useEffect)(() => {
|
|
4555
4558
|
if (fromDate) {
|
|
4556
4559
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4557
4560
|
} else if (toDate) {
|
|
4558
4561
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4559
4562
|
}
|
|
4560
4563
|
}, [from, to]);
|
|
4561
|
-
(0,
|
|
4564
|
+
(0, import_react20.useEffect)(() => {
|
|
4562
4565
|
if (fromDate && toDate) {
|
|
4563
4566
|
setSelecting("from");
|
|
4564
4567
|
setPendingFrom(void 0);
|
|
@@ -4704,14 +4707,14 @@ function CalendarPane({
|
|
|
4704
4707
|
const years = Array.from({ length: 100 }).map(
|
|
4705
4708
|
(_, i) => baseMonth.year - 50 + i
|
|
4706
4709
|
);
|
|
4707
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4708
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4709
|
-
const monthMenuRef = (0,
|
|
4710
|
-
const yearMenuRef = (0,
|
|
4710
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react20.useState)(false);
|
|
4711
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react20.useState)(false);
|
|
4712
|
+
const monthMenuRef = (0, import_react20.useRef)(null);
|
|
4713
|
+
const yearMenuRef = (0, import_react20.useRef)(null);
|
|
4711
4714
|
const month = getMonthData(offset);
|
|
4712
4715
|
const totalCells = 42;
|
|
4713
4716
|
const emptyCells = month.firstDayOffset;
|
|
4714
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react20.default.Fragment, { children: [
|
|
4715
4718
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4716
4719
|
"div",
|
|
4717
4720
|
{
|
|
@@ -4919,24 +4922,24 @@ var DateInput = (_a) => {
|
|
|
4919
4922
|
"label",
|
|
4920
4923
|
"isDateAvailable"
|
|
4921
4924
|
]);
|
|
4922
|
-
const [visible, setVisible] = (0,
|
|
4923
|
-
const [inputValue, setInputValue] = (0,
|
|
4924
|
-
const [isTyping, setIsTyping] = (0,
|
|
4925
|
-
const popoverRef = (0,
|
|
4926
|
-
const triggerRef = (0,
|
|
4927
|
-
const rootRef = (0,
|
|
4928
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4925
|
+
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
4926
|
+
const [inputValue, setInputValue] = (0, import_react21.useState)("");
|
|
4927
|
+
const [isTyping, setIsTyping] = (0, import_react21.useState)(false);
|
|
4928
|
+
const popoverRef = (0, import_react21.useRef)(null);
|
|
4929
|
+
const triggerRef = (0, import_react21.useRef)(null);
|
|
4930
|
+
const rootRef = (0, import_react21.useRef)(null);
|
|
4931
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react21.useState)({
|
|
4929
4932
|
top: 0,
|
|
4930
4933
|
left: 0,
|
|
4931
4934
|
width: 0
|
|
4932
4935
|
});
|
|
4933
4936
|
const [from, to] = [value, ""];
|
|
4934
|
-
(0,
|
|
4937
|
+
(0, import_react21.useEffect)(() => {
|
|
4935
4938
|
if (!isTyping) {
|
|
4936
4939
|
setInputValue(formatDisplayValue(from));
|
|
4937
4940
|
}
|
|
4938
4941
|
}, [from, isTyping]);
|
|
4939
|
-
(0,
|
|
4942
|
+
(0, import_react21.useLayoutEffect)(() => {
|
|
4940
4943
|
if (visible) {
|
|
4941
4944
|
updatePosition();
|
|
4942
4945
|
}
|
|
@@ -4951,7 +4954,7 @@ var DateInput = (_a) => {
|
|
|
4951
4954
|
});
|
|
4952
4955
|
}
|
|
4953
4956
|
};
|
|
4954
|
-
(0,
|
|
4957
|
+
(0, import_react21.useEffect)(() => {
|
|
4955
4958
|
updatePosition();
|
|
4956
4959
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4957
4960
|
if (triggerRef.current) {
|
|
@@ -4963,7 +4966,7 @@ var DateInput = (_a) => {
|
|
|
4963
4966
|
window.removeEventListener("scroll", updatePosition);
|
|
4964
4967
|
};
|
|
4965
4968
|
}, []);
|
|
4966
|
-
(0,
|
|
4969
|
+
(0, import_react21.useEffect)(() => {
|
|
4967
4970
|
const handleKeyDown2 = (event) => {
|
|
4968
4971
|
var _a2;
|
|
4969
4972
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4976,7 +4979,7 @@ var DateInput = (_a) => {
|
|
|
4976
4979
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4977
4980
|
};
|
|
4978
4981
|
});
|
|
4979
|
-
(0,
|
|
4982
|
+
(0, import_react21.useEffect)(() => {
|
|
4980
4983
|
const handleClickOutside = (event) => {
|
|
4981
4984
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4982
4985
|
setVisible(false);
|
|
@@ -5583,18 +5586,18 @@ function Theme({
|
|
|
5583
5586
|
}
|
|
5584
5587
|
|
|
5585
5588
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5586
|
-
var
|
|
5589
|
+
var import_react24 = require("react");
|
|
5587
5590
|
|
|
5588
5591
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5589
|
-
var
|
|
5592
|
+
var import_react23 = require("react");
|
|
5590
5593
|
|
|
5591
5594
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5592
|
-
var
|
|
5593
|
-
var GridContext = (0,
|
|
5595
|
+
var import_react22 = require("react");
|
|
5596
|
+
var GridContext = (0, import_react22.createContext)(null);
|
|
5594
5597
|
|
|
5595
5598
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5596
5599
|
function useGridContext() {
|
|
5597
|
-
const ctx = (0,
|
|
5600
|
+
const ctx = (0, import_react23.useContext)(GridContext);
|
|
5598
5601
|
if (!ctx) {
|
|
5599
5602
|
throw new Error("useGridContext must be used within GridContextProvider");
|
|
5600
5603
|
}
|
|
@@ -5605,8 +5608,8 @@ function useGridContext() {
|
|
|
5605
5608
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5606
5609
|
function ColumnSelector() {
|
|
5607
5610
|
const context = useGridContext();
|
|
5608
|
-
const ref = (0,
|
|
5609
|
-
const [show, setShow] = (0,
|
|
5611
|
+
const ref = (0, import_react24.useRef)(null);
|
|
5612
|
+
const [show, setShow] = (0, import_react24.useState)(false);
|
|
5610
5613
|
const {
|
|
5611
5614
|
columns,
|
|
5612
5615
|
id,
|
|
@@ -5617,7 +5620,7 @@ function ColumnSelector() {
|
|
|
5617
5620
|
resetColumnVisibility,
|
|
5618
5621
|
dispatch
|
|
5619
5622
|
} = context;
|
|
5620
|
-
const toggleColumnVisibility = (0,
|
|
5623
|
+
const toggleColumnVisibility = (0, import_react24.useCallback)(
|
|
5621
5624
|
(index, visible) => {
|
|
5622
5625
|
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
5623
5626
|
},
|
|
@@ -5772,7 +5775,7 @@ function MobileDataGridHeader({
|
|
|
5772
5775
|
}
|
|
5773
5776
|
|
|
5774
5777
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5775
|
-
var
|
|
5778
|
+
var import_react25 = require("react");
|
|
5776
5779
|
|
|
5777
5780
|
// src/components/MobileDataGrid/dataGridReducer.ts
|
|
5778
5781
|
function dataGridReducer(state, action) {
|
|
@@ -5815,10 +5818,10 @@ function GridContextProvider(props) {
|
|
|
5815
5818
|
getId,
|
|
5816
5819
|
onRowSelect
|
|
5817
5820
|
} = props;
|
|
5818
|
-
const [columns, dispatch] = (0,
|
|
5819
|
-
const [selectedRowIds, setSelectedRowIds] = (0,
|
|
5820
|
-
const [currentRow, setCurrentRow] = (0,
|
|
5821
|
-
const resetColumnVisibility = (0,
|
|
5821
|
+
const [columns, dispatch] = (0, import_react25.useReducer)(dataGridReducer, initialColumns);
|
|
5822
|
+
const [selectedRowIds, setSelectedRowIds] = (0, import_react25.useState)([]);
|
|
5823
|
+
const [currentRow, setCurrentRow] = (0, import_react25.useState)(null);
|
|
5824
|
+
const resetColumnVisibility = (0, import_react25.useCallback)(() => {
|
|
5822
5825
|
const newColumns = columns.map((column) => {
|
|
5823
5826
|
var _a;
|
|
5824
5827
|
const initialColumn = initialColumns.find((c) => c.id === column.id);
|
|
@@ -5830,7 +5833,7 @@ function GridContextProvider(props) {
|
|
|
5830
5833
|
});
|
|
5831
5834
|
dispatch({ type: "SET", payload: newColumns });
|
|
5832
5835
|
}, [columns, initialColumns]);
|
|
5833
|
-
const handleRowSelect = (0,
|
|
5836
|
+
const handleRowSelect = (0, import_react25.useCallback)(
|
|
5834
5837
|
(item) => {
|
|
5835
5838
|
var _a;
|
|
5836
5839
|
const rowId = (_a = getId(item)) != null ? _a : "";
|
|
@@ -5841,7 +5844,7 @@ function GridContextProvider(props) {
|
|
|
5841
5844
|
},
|
|
5842
5845
|
[getId, onRowSelect, selectedRowIds]
|
|
5843
5846
|
);
|
|
5844
|
-
const handleRowSelectAll = (0,
|
|
5847
|
+
const handleRowSelectAll = (0, import_react25.useCallback)(() => {
|
|
5845
5848
|
setSelectedRowIds((prev) => {
|
|
5846
5849
|
if (prev.length === data.length) {
|
|
5847
5850
|
return [];
|
|
@@ -5849,13 +5852,13 @@ function GridContextProvider(props) {
|
|
|
5849
5852
|
return data.map(getId).filter((id2) => id2 !== void 0);
|
|
5850
5853
|
});
|
|
5851
5854
|
}, [data, getId]);
|
|
5852
|
-
const openRowDetail = (0,
|
|
5855
|
+
const openRowDetail = (0, import_react25.useCallback)((row) => {
|
|
5853
5856
|
setCurrentRow(row);
|
|
5854
5857
|
}, []);
|
|
5855
|
-
const closeRowDetail = (0,
|
|
5858
|
+
const closeRowDetail = (0, import_react25.useCallback)(() => {
|
|
5856
5859
|
setCurrentRow(null);
|
|
5857
5860
|
}, []);
|
|
5858
|
-
const visibleColumns = (0,
|
|
5861
|
+
const visibleColumns = (0, import_react25.useMemo)(() => {
|
|
5859
5862
|
const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
|
|
5860
5863
|
if (primaryKey) {
|
|
5861
5864
|
const pkColumn = columns.find((col) => col.id === String(primaryKey));
|
|
@@ -5902,7 +5905,7 @@ function GridContextProvider(props) {
|
|
|
5902
5905
|
|
|
5903
5906
|
// src/components/Modal.tsx
|
|
5904
5907
|
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
5905
|
-
var
|
|
5908
|
+
var import_react27 = require("react");
|
|
5906
5909
|
|
|
5907
5910
|
// src/components/ModalHeader.tsx
|
|
5908
5911
|
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
@@ -6078,10 +6081,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
6078
6081
|
var import_react_use = require("react-use");
|
|
6079
6082
|
|
|
6080
6083
|
// src/components/useMounted.tsx
|
|
6081
|
-
var
|
|
6084
|
+
var import_react26 = require("react");
|
|
6082
6085
|
var useMounted = () => {
|
|
6083
|
-
const [isMounted, setIsMounted] = (0,
|
|
6084
|
-
(0,
|
|
6086
|
+
const [isMounted, setIsMounted] = (0, import_react26.useState)(false);
|
|
6087
|
+
(0, import_react26.useEffect)(() => {
|
|
6085
6088
|
setIsMounted(true);
|
|
6086
6089
|
return () => setIsMounted(false);
|
|
6087
6090
|
}, []);
|
|
@@ -6175,12 +6178,12 @@ var Modal = ({
|
|
|
6175
6178
|
}) => {
|
|
6176
6179
|
var _a;
|
|
6177
6180
|
const mounted = useMounted();
|
|
6178
|
-
const modalRef = (0,
|
|
6179
|
-
const bgRef = (0,
|
|
6181
|
+
const modalRef = (0, import_react27.useRef)(null);
|
|
6182
|
+
const bgRef = (0, import_react27.useRef)(null);
|
|
6180
6183
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
6181
6184
|
const isMobile = useMatchesMobile();
|
|
6182
6185
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
6183
|
-
(0,
|
|
6186
|
+
(0, import_react27.useEffect)(() => {
|
|
6184
6187
|
if (!mounted) return;
|
|
6185
6188
|
if (!modalRef.current || !bgRef.current) {
|
|
6186
6189
|
console.error("Modal or background reference is not set.");
|
|
@@ -6200,7 +6203,7 @@ var Modal = ({
|
|
|
6200
6203
|
bgFadeIn(bgRef.current);
|
|
6201
6204
|
}
|
|
6202
6205
|
}, [mounted, onClose, open, wasOpen]);
|
|
6203
|
-
const handleKeyDown = (0,
|
|
6206
|
+
const handleKeyDown = (0, import_react27.useCallback)(
|
|
6204
6207
|
(e) => {
|
|
6205
6208
|
if (e.key === "Escape") {
|
|
6206
6209
|
if (onClose) {
|
|
@@ -6211,12 +6214,12 @@ var Modal = ({
|
|
|
6211
6214
|
},
|
|
6212
6215
|
[onClose]
|
|
6213
6216
|
);
|
|
6214
|
-
const handleClose = (0,
|
|
6217
|
+
const handleClose = (0, import_react27.useCallback)(() => {
|
|
6215
6218
|
if (onClose) {
|
|
6216
6219
|
onClose();
|
|
6217
6220
|
}
|
|
6218
6221
|
}, [onClose]);
|
|
6219
|
-
(0,
|
|
6222
|
+
(0, import_react27.useEffect)(() => {
|
|
6220
6223
|
if (open) {
|
|
6221
6224
|
document.addEventListener("keyup", handleKeyDown);
|
|
6222
6225
|
}
|
|
@@ -6224,7 +6227,7 @@ var Modal = ({
|
|
|
6224
6227
|
document.removeEventListener("keyup", handleKeyDown);
|
|
6225
6228
|
};
|
|
6226
6229
|
}, [open, handleKeyDown]);
|
|
6227
|
-
(0,
|
|
6230
|
+
(0, import_react27.useEffect)(() => {
|
|
6228
6231
|
if (!open) return;
|
|
6229
6232
|
const scrollY = window.scrollY;
|
|
6230
6233
|
const body = document.body;
|
|
@@ -6245,7 +6248,7 @@ var Modal = ({
|
|
|
6245
6248
|
};
|
|
6246
6249
|
}, [open]);
|
|
6247
6250
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
6248
|
-
const backgroundClickHandler = (0,
|
|
6251
|
+
const backgroundClickHandler = (0, import_react27.useCallback)(
|
|
6249
6252
|
(e) => {
|
|
6250
6253
|
const target = e.target;
|
|
6251
6254
|
const currentTarget = e.currentTarget;
|
|
@@ -6731,13 +6734,13 @@ function MobileDataGrid(props) {
|
|
|
6731
6734
|
}
|
|
6732
6735
|
|
|
6733
6736
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
6734
|
-
var
|
|
6737
|
+
var import_react29 = require("react");
|
|
6735
6738
|
|
|
6736
6739
|
// src/components/ImagePlaceholder.tsx
|
|
6737
|
-
var
|
|
6740
|
+
var import_react28 = require("react");
|
|
6738
6741
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
6739
6742
|
function ImagePlaceholder(props) {
|
|
6740
|
-
const clipId = (0,
|
|
6743
|
+
const clipId = (0, import_react28.useId)();
|
|
6741
6744
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
6742
6745
|
"svg",
|
|
6743
6746
|
__spreadProps(__spreadValues({
|
|
@@ -6765,7 +6768,7 @@ function Thumbnail({
|
|
|
6765
6768
|
onClick,
|
|
6766
6769
|
isPlaceholder = false
|
|
6767
6770
|
}) {
|
|
6768
|
-
const [imageError, setImageError] = (0,
|
|
6771
|
+
const [imageError, setImageError] = (0, import_react29.useState)(false);
|
|
6769
6772
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6770
6773
|
"button",
|
|
6771
6774
|
{
|
|
@@ -6866,7 +6869,7 @@ var Grid = (_a) => {
|
|
|
6866
6869
|
};
|
|
6867
6870
|
|
|
6868
6871
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
6869
|
-
var
|
|
6872
|
+
var import_react30 = require("react");
|
|
6870
6873
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
6871
6874
|
var placeholderImageUri = "/placeholder.svg";
|
|
6872
6875
|
function ProductPrimaryImage({
|
|
@@ -6881,12 +6884,12 @@ function ProductPrimaryImage({
|
|
|
6881
6884
|
onZoomPositionChange,
|
|
6882
6885
|
onScrollZoom
|
|
6883
6886
|
}) {
|
|
6884
|
-
const containerRef = (0,
|
|
6885
|
-
const lastPointRef = (0,
|
|
6886
|
-
const rafRef = (0,
|
|
6887
|
-
const [active, setActive] = (0,
|
|
6888
|
-
const [, forceRerender] = (0,
|
|
6889
|
-
const imageSrc = (0,
|
|
6887
|
+
const containerRef = (0, import_react30.useRef)(null);
|
|
6888
|
+
const lastPointRef = (0, import_react30.useRef)(null);
|
|
6889
|
+
const rafRef = (0, import_react30.useRef)(null);
|
|
6890
|
+
const [active, setActive] = (0, import_react30.useState)(false);
|
|
6891
|
+
const [, forceRerender] = (0, import_react30.useState)(0);
|
|
6892
|
+
const imageSrc = (0, import_react30.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
|
|
6890
6893
|
const schedule = () => {
|
|
6891
6894
|
if (rafRef.current != null) return;
|
|
6892
6895
|
rafRef.current = requestAnimationFrame(() => {
|
|
@@ -6894,7 +6897,7 @@ function ProductPrimaryImage({
|
|
|
6894
6897
|
forceRerender((n) => n + 1);
|
|
6895
6898
|
});
|
|
6896
6899
|
};
|
|
6897
|
-
const handlePointerEnter = (0,
|
|
6900
|
+
const handlePointerEnter = (0, import_react30.useCallback)(() => {
|
|
6898
6901
|
if (!zoomEnabled) return;
|
|
6899
6902
|
setActive(true);
|
|
6900
6903
|
const el = containerRef.current;
|
|
@@ -6907,13 +6910,13 @@ function ProductPrimaryImage({
|
|
|
6907
6910
|
);
|
|
6908
6911
|
}
|
|
6909
6912
|
}, [zoomEnabled, onZoomPositionChange, zoomLensSize]);
|
|
6910
|
-
const handlePointerLeave = (0,
|
|
6913
|
+
const handlePointerLeave = (0, import_react30.useCallback)(() => {
|
|
6911
6914
|
if (!zoomEnabled) return;
|
|
6912
6915
|
setActive(false);
|
|
6913
6916
|
lastPointRef.current = null;
|
|
6914
6917
|
onZoomPositionChange == null ? void 0 : onZoomPositionChange(null, false);
|
|
6915
6918
|
}, [zoomEnabled, onZoomPositionChange]);
|
|
6916
|
-
const handlePointerMove = (0,
|
|
6919
|
+
const handlePointerMove = (0, import_react30.useCallback)(
|
|
6917
6920
|
(e) => {
|
|
6918
6921
|
if (isPlaceholder) return;
|
|
6919
6922
|
if (!zoomEnabled || !active) return;
|
|
@@ -6950,7 +6953,7 @@ function ProductPrimaryImage({
|
|
|
6950
6953
|
},
|
|
6951
6954
|
[isPlaceholder, zoomEnabled, active, zoomLensSize, onZoomPositionChange]
|
|
6952
6955
|
);
|
|
6953
|
-
(0,
|
|
6956
|
+
(0, import_react30.useEffect)(() => {
|
|
6954
6957
|
const container = containerRef.current;
|
|
6955
6958
|
if (!container || !scrollToZoomEnabled) return;
|
|
6956
6959
|
const handleNativeWheel = (e) => {
|
|
@@ -6965,7 +6968,7 @@ function ProductPrimaryImage({
|
|
|
6965
6968
|
container.removeEventListener("wheel", handleNativeWheel);
|
|
6966
6969
|
};
|
|
6967
6970
|
}, [scrollToZoomEnabled, zoomEnabled, active, onScrollZoom]);
|
|
6968
|
-
const handleImgError = (0,
|
|
6971
|
+
const handleImgError = (0, import_react30.useCallback)(
|
|
6969
6972
|
(e) => {
|
|
6970
6973
|
if (!placeholderImageUri) return;
|
|
6971
6974
|
const img = e.currentTarget;
|
|
@@ -7033,7 +7036,7 @@ function ProductPrimaryImage({
|
|
|
7033
7036
|
}
|
|
7034
7037
|
|
|
7035
7038
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
7036
|
-
var
|
|
7039
|
+
var import_react31 = require("react");
|
|
7037
7040
|
|
|
7038
7041
|
// src/components/Surface.tsx
|
|
7039
7042
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
@@ -7084,7 +7087,7 @@ function ZoomWindow({
|
|
|
7084
7087
|
offset = 10,
|
|
7085
7088
|
className = ""
|
|
7086
7089
|
}) {
|
|
7087
|
-
const imageSrc = (0,
|
|
7090
|
+
const imageSrc = (0, import_react31.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
|
|
7088
7091
|
if (!image || !active || !pointer) return null;
|
|
7089
7092
|
const zoomWindowSize = pointer.lensSize * scaleFactor;
|
|
7090
7093
|
const baseW = pointer.w || width;
|
|
@@ -7213,7 +7216,7 @@ function CarouselPagination({
|
|
|
7213
7216
|
}
|
|
7214
7217
|
|
|
7215
7218
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
7216
|
-
var
|
|
7219
|
+
var import_react32 = require("react");
|
|
7217
7220
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
7218
7221
|
function MobileImageCarousel({
|
|
7219
7222
|
images,
|
|
@@ -7223,15 +7226,15 @@ function MobileImageCarousel({
|
|
|
7223
7226
|
onChangeIndex,
|
|
7224
7227
|
className = ""
|
|
7225
7228
|
}) {
|
|
7226
|
-
const containerRef = (0,
|
|
7227
|
-
const [isDragging, setIsDragging] = (0,
|
|
7228
|
-
const [startX, setStartX] = (0,
|
|
7229
|
-
const [currentTranslate, setCurrentTranslate] = (0,
|
|
7230
|
-
const [prevTranslate, setPrevTranslate] = (0,
|
|
7231
|
-
const [containerWidth, setContainerWidth] = (0,
|
|
7229
|
+
const containerRef = (0, import_react32.useRef)(null);
|
|
7230
|
+
const [isDragging, setIsDragging] = (0, import_react32.useState)(false);
|
|
7231
|
+
const [startX, setStartX] = (0, import_react32.useState)(0);
|
|
7232
|
+
const [currentTranslate, setCurrentTranslate] = (0, import_react32.useState)(0);
|
|
7233
|
+
const [prevTranslate, setPrevTranslate] = (0, import_react32.useState)(0);
|
|
7234
|
+
const [containerWidth, setContainerWidth] = (0, import_react32.useState)(width);
|
|
7232
7235
|
const imageSize = Math.min(containerWidth * 0.6, height * 0.6);
|
|
7233
7236
|
const gap = 16;
|
|
7234
|
-
const getTranslateX = (0,
|
|
7237
|
+
const getTranslateX = (0, import_react32.useCallback)(
|
|
7235
7238
|
(index) => {
|
|
7236
7239
|
const containerCenter = containerWidth / 2;
|
|
7237
7240
|
const imageCenter = imageSize / 2;
|
|
@@ -7240,12 +7243,12 @@ function MobileImageCarousel({
|
|
|
7240
7243
|
},
|
|
7241
7244
|
[containerWidth, imageSize, gap]
|
|
7242
7245
|
);
|
|
7243
|
-
(0,
|
|
7246
|
+
(0, import_react32.useEffect)(() => {
|
|
7244
7247
|
const translateX = getTranslateX(currentIndex);
|
|
7245
7248
|
setCurrentTranslate(translateX);
|
|
7246
7249
|
setPrevTranslate(translateX);
|
|
7247
7250
|
}, [currentIndex, getTranslateX]);
|
|
7248
|
-
(0,
|
|
7251
|
+
(0, import_react32.useEffect)(() => {
|
|
7249
7252
|
const updateContainerWidth = () => {
|
|
7250
7253
|
if (containerRef.current) {
|
|
7251
7254
|
const rect = containerRef.current.getBoundingClientRect();
|
|
@@ -7259,11 +7262,11 @@ function MobileImageCarousel({
|
|
|
7259
7262
|
}
|
|
7260
7263
|
return () => resizeObserver.disconnect();
|
|
7261
7264
|
}, []);
|
|
7262
|
-
const handleStart = (0,
|
|
7265
|
+
const handleStart = (0, import_react32.useCallback)((clientX) => {
|
|
7263
7266
|
setIsDragging(true);
|
|
7264
7267
|
setStartX(clientX);
|
|
7265
7268
|
}, []);
|
|
7266
|
-
const handleMove = (0,
|
|
7269
|
+
const handleMove = (0, import_react32.useCallback)(
|
|
7267
7270
|
(clientX) => {
|
|
7268
7271
|
if (!isDragging) return;
|
|
7269
7272
|
const currentPosition = clientX;
|
|
@@ -7272,7 +7275,7 @@ function MobileImageCarousel({
|
|
|
7272
7275
|
},
|
|
7273
7276
|
[isDragging, startX, prevTranslate]
|
|
7274
7277
|
);
|
|
7275
|
-
const handleEnd = (0,
|
|
7278
|
+
const handleEnd = (0, import_react32.useCallback)(() => {
|
|
7276
7279
|
if (!isDragging) return;
|
|
7277
7280
|
setIsDragging(false);
|
|
7278
7281
|
const moved = currentTranslate - prevTranslate;
|
|
@@ -7320,7 +7323,7 @@ function MobileImageCarousel({
|
|
|
7320
7323
|
const handleTouchEnd = () => {
|
|
7321
7324
|
handleEnd();
|
|
7322
7325
|
};
|
|
7323
|
-
const handleImageClick = (0,
|
|
7326
|
+
const handleImageClick = (0, import_react32.useCallback)(
|
|
7324
7327
|
(index) => {
|
|
7325
7328
|
if (!isDragging && index !== currentIndex) {
|
|
7326
7329
|
onChangeIndex(index);
|
|
@@ -7400,7 +7403,7 @@ function MobileImageCarousel({
|
|
|
7400
7403
|
}
|
|
7401
7404
|
|
|
7402
7405
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
7403
|
-
var
|
|
7406
|
+
var import_react33 = require("react");
|
|
7404
7407
|
function useProductImagePreview(props) {
|
|
7405
7408
|
const {
|
|
7406
7409
|
images,
|
|
@@ -7413,18 +7416,18 @@ function useProductImagePreview(props) {
|
|
|
7413
7416
|
} = props;
|
|
7414
7417
|
const hasImages = !!(images == null ? void 0 : images.length);
|
|
7415
7418
|
const safeIndex = hasImages && currentIndex >= 0 && currentIndex < images.length ? currentIndex : 0;
|
|
7416
|
-
const active = (0,
|
|
7419
|
+
const active = (0, import_react33.useMemo)(() => {
|
|
7417
7420
|
return hasImages ? images[safeIndex] : void 0;
|
|
7418
7421
|
}, [hasImages, images, safeIndex]);
|
|
7419
|
-
const [zoomPoint, setZoomPoint] = (0,
|
|
7420
|
-
const [zoomActive, setZoomActive] = (0,
|
|
7421
|
-
const [currentZoomFactor, setCurrentZoomFactor] = (0,
|
|
7422
|
-
const [primaryImagePosition, setPrimaryImagePosition] = (0,
|
|
7423
|
-
const primaryImageRef = (0,
|
|
7424
|
-
const cleanupRef = (0,
|
|
7422
|
+
const [zoomPoint, setZoomPoint] = (0, import_react33.useState)(null);
|
|
7423
|
+
const [zoomActive, setZoomActive] = (0, import_react33.useState)(false);
|
|
7424
|
+
const [currentZoomFactor, setCurrentZoomFactor] = (0, import_react33.useState)(zoomFactor);
|
|
7425
|
+
const [primaryImagePosition, setPrimaryImagePosition] = (0, import_react33.useState)(null);
|
|
7426
|
+
const primaryImageRef = (0, import_react33.useRef)(null);
|
|
7427
|
+
const cleanupRef = (0, import_react33.useRef)(null);
|
|
7425
7428
|
const effectiveZoomEnabled = zoomEnabled && !isMobile;
|
|
7426
7429
|
const effectiveScrollToZoomEnabled = scrollToZoomEnabled && !isMobile;
|
|
7427
|
-
(0,
|
|
7430
|
+
(0, import_react33.useEffect)(() => {
|
|
7428
7431
|
if (!effectiveZoomEnabled) return;
|
|
7429
7432
|
const setupTracking = () => {
|
|
7430
7433
|
const element = primaryImageRef.current;
|
|
@@ -7458,24 +7461,24 @@ function useProductImagePreview(props) {
|
|
|
7458
7461
|
}
|
|
7459
7462
|
};
|
|
7460
7463
|
}, [effectiveZoomEnabled]);
|
|
7461
|
-
const handleSelect = (0,
|
|
7464
|
+
const handleSelect = (0, import_react33.useCallback)(
|
|
7462
7465
|
(idx) => {
|
|
7463
7466
|
if (idx === safeIndex) return;
|
|
7464
7467
|
onChangeIndex(idx);
|
|
7465
7468
|
},
|
|
7466
7469
|
[safeIndex, onChangeIndex]
|
|
7467
7470
|
);
|
|
7468
|
-
const handleNext = (0,
|
|
7471
|
+
const handleNext = (0, import_react33.useCallback)(() => {
|
|
7469
7472
|
if (!hasImages) return;
|
|
7470
7473
|
const nextIndex = (safeIndex + 1) % images.length;
|
|
7471
7474
|
onChangeIndex(nextIndex);
|
|
7472
7475
|
}, [hasImages, safeIndex, images.length, onChangeIndex]);
|
|
7473
|
-
const handlePrevious = (0,
|
|
7476
|
+
const handlePrevious = (0, import_react33.useCallback)(() => {
|
|
7474
7477
|
if (!hasImages) return;
|
|
7475
7478
|
const previousIndex = safeIndex === 0 ? images.length - 1 : safeIndex - 1;
|
|
7476
7479
|
onChangeIndex(previousIndex);
|
|
7477
7480
|
}, [hasImages, safeIndex, images.length, onChangeIndex]);
|
|
7478
|
-
const handleZoomPositionChange = (0,
|
|
7481
|
+
const handleZoomPositionChange = (0, import_react33.useCallback)(
|
|
7479
7482
|
(p, active2) => {
|
|
7480
7483
|
if (isMobile) return;
|
|
7481
7484
|
setZoomPoint(p);
|
|
@@ -7483,7 +7486,7 @@ function useProductImagePreview(props) {
|
|
|
7483
7486
|
},
|
|
7484
7487
|
[isMobile]
|
|
7485
7488
|
);
|
|
7486
|
-
const handleScrollZoom = (0,
|
|
7489
|
+
const handleScrollZoom = (0, import_react33.useCallback)(
|
|
7487
7490
|
(delta) => {
|
|
7488
7491
|
if (!effectiveScrollToZoomEnabled) return;
|
|
7489
7492
|
const newZoomFactor = Math.max(1, Math.min(5, currentZoomFactor + delta));
|
|
@@ -7491,7 +7494,7 @@ function useProductImagePreview(props) {
|
|
|
7491
7494
|
},
|
|
7492
7495
|
[effectiveScrollToZoomEnabled, currentZoomFactor]
|
|
7493
7496
|
);
|
|
7494
|
-
(0,
|
|
7497
|
+
(0, import_react33.useEffect)(() => {
|
|
7495
7498
|
setCurrentZoomFactor(zoomFactor);
|
|
7496
7499
|
}, [zoomFactor]);
|
|
7497
7500
|
return {
|
|
@@ -7655,7 +7658,7 @@ function ProductImagePreview(props) {
|
|
|
7655
7658
|
}
|
|
7656
7659
|
|
|
7657
7660
|
// src/components/CompactImagesPreview.tsx
|
|
7658
|
-
var
|
|
7661
|
+
var import_react34 = require("react");
|
|
7659
7662
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
7660
7663
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
7661
7664
|
function CompactImagesPreview(props) {
|
|
@@ -7675,7 +7678,7 @@ function CompactImagesPreview(props) {
|
|
|
7675
7678
|
} = props;
|
|
7676
7679
|
const isMobile = useMatchesMobile();
|
|
7677
7680
|
const imagesCount = sources.length;
|
|
7678
|
-
const handleImgError = (0,
|
|
7681
|
+
const handleImgError = (0, import_react34.useCallback)(
|
|
7679
7682
|
(e) => {
|
|
7680
7683
|
if (!placeholderImageUri2) return;
|
|
7681
7684
|
const img = e.currentTarget;
|
|
@@ -7685,7 +7688,7 @@ function CompactImagesPreview(props) {
|
|
|
7685
7688
|
},
|
|
7686
7689
|
[placeholderImageUri2, placeholderAlt]
|
|
7687
7690
|
);
|
|
7688
|
-
const handleThumbnailClick = (0,
|
|
7691
|
+
const handleThumbnailClick = (0, import_react34.useCallback)(
|
|
7689
7692
|
(newIndex) => {
|
|
7690
7693
|
if (newIndex === currentSourceIndex) return;
|
|
7691
7694
|
if (newIndex < 0 || newIndex >= imagesCount) return;
|
|
@@ -7814,7 +7817,7 @@ function SimpleTable({
|
|
|
7814
7817
|
}
|
|
7815
7818
|
|
|
7816
7819
|
// src/components/ListGroup.tsx
|
|
7817
|
-
var
|
|
7820
|
+
var import_react35 = require("react");
|
|
7818
7821
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
7819
7822
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
7820
7823
|
function ListGroup({
|
|
@@ -7827,7 +7830,7 @@ function ListGroup({
|
|
|
7827
7830
|
className,
|
|
7828
7831
|
children
|
|
7829
7832
|
}) {
|
|
7830
|
-
const [uncontrolledOpen, setUncontrolledOpen] = (0,
|
|
7833
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react35.useState)(defaultOpen);
|
|
7831
7834
|
const isControlled = controlledOpen !== void 0;
|
|
7832
7835
|
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
7833
7836
|
const toggle = () => {
|
|
@@ -7867,7 +7870,7 @@ function ListGroup({
|
|
|
7867
7870
|
}
|
|
7868
7871
|
|
|
7869
7872
|
// src/components/Pagination.tsx
|
|
7870
|
-
var
|
|
7873
|
+
var import_react36 = require("react");
|
|
7871
7874
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
7872
7875
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7873
7876
|
var Pagination = ({
|
|
@@ -7879,7 +7882,7 @@ var Pagination = ({
|
|
|
7879
7882
|
className,
|
|
7880
7883
|
disabled
|
|
7881
7884
|
}) => {
|
|
7882
|
-
const goTo = (0,
|
|
7885
|
+
const goTo = (0, import_react36.useCallback)(
|
|
7883
7886
|
(page) => {
|
|
7884
7887
|
if (disabled) return;
|
|
7885
7888
|
onPageChange(page);
|
|
@@ -7896,7 +7899,7 @@ var Pagination = ({
|
|
|
7896
7899
|
goTo(currentPage + 1);
|
|
7897
7900
|
}
|
|
7898
7901
|
};
|
|
7899
|
-
const pageTokens = (0,
|
|
7902
|
+
const pageTokens = (0, import_react36.useMemo)(() => {
|
|
7900
7903
|
if (totalPages <= 5) {
|
|
7901
7904
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
7902
7905
|
}
|
|
@@ -8059,7 +8062,7 @@ function EmptyCartIcon() {
|
|
|
8059
8062
|
}
|
|
8060
8063
|
|
|
8061
8064
|
// src/components/SearchResultImage/index.tsx
|
|
8062
|
-
var
|
|
8065
|
+
var import_react37 = require("react");
|
|
8063
8066
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
8064
8067
|
function SearchResultImage({
|
|
8065
8068
|
width = 20,
|
|
@@ -8067,7 +8070,7 @@ function SearchResultImage({
|
|
|
8067
8070
|
src,
|
|
8068
8071
|
alt
|
|
8069
8072
|
}) {
|
|
8070
|
-
const [imageError, setImageError] = (0,
|
|
8073
|
+
const [imageError, setImageError] = (0, import_react37.useState)(false);
|
|
8071
8074
|
const showPlaceholder = imageError || !src;
|
|
8072
8075
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_jsx_runtime60.Fragment, { children: showPlaceholder ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ImagePlaceholder, { width, height }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8073
8076
|
"img",
|
|
@@ -8085,7 +8088,7 @@ function SearchResultImage({
|
|
|
8085
8088
|
|
|
8086
8089
|
// src/components/Alert.tsx
|
|
8087
8090
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
8088
|
-
var
|
|
8091
|
+
var import_react38 = require("react");
|
|
8089
8092
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
8090
8093
|
function Alert(_a) {
|
|
8091
8094
|
var _b = _a, {
|
|
@@ -8106,7 +8109,7 @@ function Alert(_a) {
|
|
|
8106
8109
|
"onClose"
|
|
8107
8110
|
]);
|
|
8108
8111
|
const isError = variant === "error";
|
|
8109
|
-
const handleClose = (0,
|
|
8112
|
+
const handleClose = (0, import_react38.useCallback)(() => {
|
|
8110
8113
|
if (onClose) onClose();
|
|
8111
8114
|
}, [onClose]);
|
|
8112
8115
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
@@ -8187,11 +8190,11 @@ function OrderCheckIcon(props) {
|
|
|
8187
8190
|
}
|
|
8188
8191
|
|
|
8189
8192
|
// src/components/EditingContext.tsx
|
|
8190
|
-
var
|
|
8193
|
+
var import_react39 = require("react");
|
|
8191
8194
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
8192
|
-
var EditingContext = (0,
|
|
8195
|
+
var EditingContext = (0, import_react39.createContext)(null);
|
|
8193
8196
|
var useTableEditingContext = () => {
|
|
8194
|
-
const context = (0,
|
|
8197
|
+
const context = (0, import_react39.useContext)(EditingContext);
|
|
8195
8198
|
if (!context) {
|
|
8196
8199
|
throw new Error("useTableEditingContext must be used within EditingProvider");
|
|
8197
8200
|
}
|
|
@@ -8392,7 +8395,7 @@ function AccessCard(props) {
|
|
|
8392
8395
|
|
|
8393
8396
|
// src/components/AccessCardGroup.tsx
|
|
8394
8397
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
8395
|
-
var
|
|
8398
|
+
var import_react40 = require("react");
|
|
8396
8399
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
8397
8400
|
function AccessCardGroup(props) {
|
|
8398
8401
|
const {
|
|
@@ -8406,7 +8409,7 @@ function AccessCardGroup(props) {
|
|
|
8406
8409
|
testid,
|
|
8407
8410
|
unavailable
|
|
8408
8411
|
} = props;
|
|
8409
|
-
const [expand, setExpand] = (0,
|
|
8412
|
+
const [expand, setExpand] = (0, import_react40.useState)(expanded);
|
|
8410
8413
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { "data-testid": testid, className: "mb-mobile-layout-group-gap desktop:mb-desktop-layout-group-gap compact:mb-desktop-compact-layout-group-gap", children: [
|
|
8411
8414
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
8412
8415
|
"div",
|