@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
|
@@ -721,7 +721,7 @@ function Theme({
|
|
|
721
721
|
}
|
|
722
722
|
|
|
723
723
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
724
|
-
var
|
|
724
|
+
var import_react37 = require("react");
|
|
725
725
|
|
|
726
726
|
// src/components/DataGridCell.tsx
|
|
727
727
|
var import_sortable = require("@dnd-kit/sortable");
|
|
@@ -776,11 +776,11 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
776
776
|
|
|
777
777
|
// src/components/DataGridCell.tsx
|
|
778
778
|
var import_clsx12 = __toESM(require("clsx"), 1);
|
|
779
|
-
var
|
|
779
|
+
var import_react12 = require("react");
|
|
780
780
|
|
|
781
781
|
// src/components/MenuOption.tsx
|
|
782
782
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
783
|
-
var
|
|
783
|
+
var import_react7 = require("react");
|
|
784
784
|
|
|
785
785
|
// src/components/Label.tsx
|
|
786
786
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
@@ -1142,6 +1142,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
1142
1142
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
1143
1143
|
}
|
|
1144
1144
|
|
|
1145
|
+
// src/hooks/useEditCell.tsx
|
|
1146
|
+
var import_react6 = require("react");
|
|
1147
|
+
|
|
1145
1148
|
// src/components/Caption.tsx
|
|
1146
1149
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1147
1150
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
@@ -1293,12 +1296,12 @@ var MenuOption = ({
|
|
|
1293
1296
|
onMouseMove,
|
|
1294
1297
|
small = false
|
|
1295
1298
|
}) => {
|
|
1296
|
-
const uniqueId = (0,
|
|
1297
|
-
const internalRef = (0,
|
|
1299
|
+
const uniqueId = (0, import_react7.useId)();
|
|
1300
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
1298
1301
|
const actualRef = ref || internalRef;
|
|
1299
|
-
const menuId = (0,
|
|
1302
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
1300
1303
|
const isMobile = useMatchesMobile();
|
|
1301
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
1304
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
1302
1305
|
const handleMouseEnter = () => {
|
|
1303
1306
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
1304
1307
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1458,27 +1461,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1458
1461
|
|
|
1459
1462
|
// src/components/Menu.tsx
|
|
1460
1463
|
var import_clsx10 = __toESM(require("clsx"), 1);
|
|
1461
|
-
var
|
|
1464
|
+
var import_react9 = require("react");
|
|
1462
1465
|
var import_react_dom = require("react-dom");
|
|
1463
1466
|
|
|
1464
1467
|
// src/components/useMenuSystem.tsx
|
|
1465
|
-
var
|
|
1468
|
+
var import_react8 = require("react");
|
|
1466
1469
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1467
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1470
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1468
1471
|
{}
|
|
1469
1472
|
);
|
|
1470
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1471
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1473
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1474
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1472
1475
|
null
|
|
1473
1476
|
);
|
|
1474
|
-
const menuRootRef = (0,
|
|
1475
|
-
const subMenuRefs = (0,
|
|
1476
|
-
const hoverTimeoutRef = (0,
|
|
1477
|
-
const closeTimeoutRef = (0,
|
|
1478
|
-
const mouseStopTimeoutRef = (0,
|
|
1479
|
-
const isMouseMovingRef = (0,
|
|
1480
|
-
const pendingOpenActionRef = (0,
|
|
1481
|
-
const pendingCloseActionRef = (0,
|
|
1477
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1478
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1479
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1480
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1481
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1482
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1483
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1484
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1482
1485
|
const isMobile = useMatchesMobile();
|
|
1483
1486
|
const toggleMenu = (menuId, level) => {
|
|
1484
1487
|
if (closeTimeoutRef.current) {
|
|
@@ -1518,7 +1521,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1518
1521
|
return newActiveMenus;
|
|
1519
1522
|
});
|
|
1520
1523
|
};
|
|
1521
|
-
const executePendingActions = (0,
|
|
1524
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1522
1525
|
if (pendingCloseActionRef.current) {
|
|
1523
1526
|
pendingCloseActionRef.current();
|
|
1524
1527
|
pendingCloseActionRef.current = null;
|
|
@@ -1607,7 +1610,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1607
1610
|
const isMenuActive = (menuId, level) => {
|
|
1608
1611
|
return activeMenus[level] === menuId;
|
|
1609
1612
|
};
|
|
1610
|
-
(0,
|
|
1613
|
+
(0, import_react8.useEffect)(() => {
|
|
1611
1614
|
const handleClickOutside = (event) => {
|
|
1612
1615
|
var _a;
|
|
1613
1616
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1626,7 +1629,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1626
1629
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1627
1630
|
};
|
|
1628
1631
|
}, [activeMenus]);
|
|
1629
|
-
(0,
|
|
1632
|
+
(0, import_react8.useEffect)(() => {
|
|
1630
1633
|
return () => {
|
|
1631
1634
|
if (hoverTimeoutRef.current) {
|
|
1632
1635
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1704,13 +1707,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1704
1707
|
};
|
|
1705
1708
|
}
|
|
1706
1709
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1707
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1710
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1708
1711
|
top: 0,
|
|
1709
1712
|
left: 0,
|
|
1710
1713
|
minWidth: 0
|
|
1711
1714
|
});
|
|
1712
1715
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1713
|
-
const updatePosition = (0,
|
|
1716
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1714
1717
|
var _a, _b, _c;
|
|
1715
1718
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1716
1719
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1758,7 +1761,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1758
1761
|
minWidth: triggerRect.width
|
|
1759
1762
|
});
|
|
1760
1763
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1761
|
-
(0,
|
|
1764
|
+
(0, import_react8.useEffect)(() => {
|
|
1762
1765
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1763
1766
|
const handleClickOutside = (event) => {
|
|
1764
1767
|
var _a, _b, _c, _d, _e;
|
|
@@ -1784,7 +1787,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1784
1787
|
options == null ? void 0 : options.menuRef,
|
|
1785
1788
|
options == null ? void 0 : options.additionalRefs
|
|
1786
1789
|
]);
|
|
1787
|
-
(0,
|
|
1790
|
+
(0, import_react8.useEffect)(() => {
|
|
1788
1791
|
updatePosition();
|
|
1789
1792
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1790
1793
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1865,9 +1868,9 @@ var Menu = (_a) => {
|
|
|
1865
1868
|
"menuName",
|
|
1866
1869
|
"calculateMinMaxHeight"
|
|
1867
1870
|
]);
|
|
1868
|
-
const internalRef = (0,
|
|
1871
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1869
1872
|
const actualRef = ref || internalRef;
|
|
1870
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1873
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1871
1874
|
const isMobile = useMatchesMobile();
|
|
1872
1875
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1873
1876
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1880,7 +1883,7 @@ var Menu = (_a) => {
|
|
|
1880
1883
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1881
1884
|
}
|
|
1882
1885
|
);
|
|
1883
|
-
(0,
|
|
1886
|
+
(0, import_react9.useEffect)(() => {
|
|
1884
1887
|
if (calculateMinMaxHeight) {
|
|
1885
1888
|
return;
|
|
1886
1889
|
}
|
|
@@ -1904,7 +1907,7 @@ var Menu = (_a) => {
|
|
|
1904
1907
|
cancelAnimationFrame(raf);
|
|
1905
1908
|
};
|
|
1906
1909
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1907
|
-
(0,
|
|
1910
|
+
(0, import_react9.useEffect)(() => {
|
|
1908
1911
|
if (!calculateMinMaxHeight) {
|
|
1909
1912
|
return;
|
|
1910
1913
|
}
|
|
@@ -1915,14 +1918,14 @@ var Menu = (_a) => {
|
|
|
1915
1918
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1916
1919
|
}
|
|
1917
1920
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1918
|
-
(0,
|
|
1921
|
+
(0, import_react9.useEffect)(() => {
|
|
1919
1922
|
if (!show) {
|
|
1920
1923
|
return;
|
|
1921
1924
|
}
|
|
1922
1925
|
initializeMenuFocus();
|
|
1923
1926
|
updatePosition();
|
|
1924
1927
|
}, [show, updatePosition]);
|
|
1925
|
-
(0,
|
|
1928
|
+
(0, import_react9.useEffect)(() => {
|
|
1926
1929
|
if (!show || !setShow) {
|
|
1927
1930
|
return;
|
|
1928
1931
|
}
|
|
@@ -2076,10 +2079,10 @@ var Menu = (_a) => {
|
|
|
2076
2079
|
Menu.displayName = "Menu";
|
|
2077
2080
|
|
|
2078
2081
|
// src/components/Search.tsx
|
|
2079
|
-
var
|
|
2082
|
+
var import_react11 = require("react");
|
|
2080
2083
|
|
|
2081
2084
|
// src/components/Input.tsx
|
|
2082
|
-
var
|
|
2085
|
+
var import_react10 = require("react");
|
|
2083
2086
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2084
2087
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2085
2088
|
var InputBase = (_a) => {
|
|
@@ -2136,9 +2139,9 @@ var InputBase = (_a) => {
|
|
|
2136
2139
|
"data-error": error && !focus || null,
|
|
2137
2140
|
"data-focus": focus || null
|
|
2138
2141
|
};
|
|
2139
|
-
const inputRef = (0,
|
|
2142
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
2140
2143
|
const inputId = id ? `${id}-input` : void 0;
|
|
2141
|
-
(0,
|
|
2144
|
+
(0, import_react10.useEffect)(() => {
|
|
2142
2145
|
var _a2;
|
|
2143
2146
|
const input = inputRef.current;
|
|
2144
2147
|
const focusHandler = () => {
|
|
@@ -2297,15 +2300,15 @@ var Input = (_a) => {
|
|
|
2297
2300
|
"testid",
|
|
2298
2301
|
"rightAdornment"
|
|
2299
2302
|
]);
|
|
2300
|
-
const [internalValue, setInternalValue] = (0,
|
|
2301
|
-
const [displayValue, setDisplayValue] = (0,
|
|
2302
|
-
(0,
|
|
2303
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
2304
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
2305
|
+
(0, import_react10.useEffect)(() => {
|
|
2303
2306
|
var _a2;
|
|
2304
2307
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
2305
2308
|
setInternalValue(stringValue);
|
|
2306
2309
|
setDisplayValue(stringValue);
|
|
2307
2310
|
}, [propValue]);
|
|
2308
|
-
(0,
|
|
2311
|
+
(0, import_react10.useEffect)(() => {
|
|
2309
2312
|
var _a2;
|
|
2310
2313
|
if (variant !== "currency") {
|
|
2311
2314
|
return;
|
|
@@ -2566,14 +2569,14 @@ var Search = (_a) => {
|
|
|
2566
2569
|
"removeRoundness",
|
|
2567
2570
|
"autocompletePadding"
|
|
2568
2571
|
]);
|
|
2569
|
-
const inputRef = (0,
|
|
2570
|
-
const inputContainerRef = (0,
|
|
2571
|
-
const preventFocusOnInitialRender = (0,
|
|
2572
|
-
const [show, setShow] = (0,
|
|
2573
|
-
const [clearing, setClearing] = (0,
|
|
2574
|
-
const uniqueId = (0,
|
|
2572
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2573
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2574
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2575
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2576
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2577
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2575
2578
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2576
|
-
(0,
|
|
2579
|
+
(0, import_react11.useEffect)(() => {
|
|
2577
2580
|
var _a2;
|
|
2578
2581
|
if (preventFocusOnInitialRender.current) {
|
|
2579
2582
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2657,7 +2660,7 @@ Search.displayName = "Search";
|
|
|
2657
2660
|
|
|
2658
2661
|
// src/components/DataGridCell.tsx
|
|
2659
2662
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2660
|
-
var DataGridCell = (0,
|
|
2663
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2661
2664
|
(_a) => {
|
|
2662
2665
|
var _b = _a, {
|
|
2663
2666
|
id,
|
|
@@ -2699,10 +2702,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2699
2702
|
"testid"
|
|
2700
2703
|
]);
|
|
2701
2704
|
const Element = type === "header" ? "th" : "td";
|
|
2702
|
-
const timerRef = (0,
|
|
2703
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2704
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2705
|
-
(0,
|
|
2705
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2706
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2707
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2708
|
+
(0, import_react12.useEffect)(() => {
|
|
2706
2709
|
return () => {
|
|
2707
2710
|
if (timerRef.current) {
|
|
2708
2711
|
clearTimeout(timerRef.current);
|
|
@@ -2812,12 +2815,12 @@ function DataCellHeader(_a) {
|
|
|
2812
2815
|
"useMenuDefaultMinWidth"
|
|
2813
2816
|
]);
|
|
2814
2817
|
var _a2;
|
|
2815
|
-
const [showMenu, setShowMenu] = (0,
|
|
2816
|
-
const [filter, setFilter] = (0,
|
|
2818
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2819
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2817
2820
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2818
2821
|
);
|
|
2819
|
-
const ref = (0,
|
|
2820
|
-
const predeterminedPinned = (0,
|
|
2822
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2823
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2821
2824
|
const { column, getContext } = header;
|
|
2822
2825
|
const { id: columnId, setFilterValue } = column;
|
|
2823
2826
|
const {
|
|
@@ -2827,14 +2830,14 @@ function DataCellHeader(_a) {
|
|
|
2827
2830
|
listeners: subMenuListeners,
|
|
2828
2831
|
mobileHide
|
|
2829
2832
|
} = useSubMenuSystem(node ? node : ref);
|
|
2830
|
-
(0,
|
|
2833
|
+
(0, import_react12.useEffect)(() => {
|
|
2831
2834
|
var _a3, _b2, _c;
|
|
2832
2835
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2833
2836
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2834
2837
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2835
2838
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2836
2839
|
}, [columnId, getContext]);
|
|
2837
|
-
(0,
|
|
2840
|
+
(0, import_react12.useEffect)(() => {
|
|
2838
2841
|
const handler = setTimeout(() => {
|
|
2839
2842
|
setFilterValue(filter);
|
|
2840
2843
|
}, 500);
|
|
@@ -3097,7 +3100,7 @@ function DragAlongCell(_a) {
|
|
|
3097
3100
|
DragAlongCell.displayName = "DragAlongCell";
|
|
3098
3101
|
|
|
3099
3102
|
// src/components/DataGrid/index.tsx
|
|
3100
|
-
var
|
|
3103
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
3101
3104
|
var import_react_table3 = require("@tanstack/react-table");
|
|
3102
3105
|
var import_core = require("@dnd-kit/core");
|
|
3103
3106
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -3125,7 +3128,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
3125
3128
|
}
|
|
3126
3129
|
|
|
3127
3130
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
3128
|
-
var
|
|
3131
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
3129
3132
|
|
|
3130
3133
|
// src/components/DataGrid/TableBody/index.tsx
|
|
3131
3134
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -3134,7 +3137,7 @@ var import_clsx15 = __toESM(require("clsx"), 1);
|
|
|
3134
3137
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
3135
3138
|
var import_clsx14 = __toESM(require("clsx"), 1);
|
|
3136
3139
|
var import_react_table = require("@tanstack/react-table");
|
|
3137
|
-
var
|
|
3140
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
3138
3141
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3139
3142
|
var valueFormatters = {
|
|
3140
3143
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -3202,7 +3205,7 @@ function TableBodyRow({
|
|
|
3202
3205
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
3203
3206
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
3204
3207
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
3205
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3208
|
+
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react13.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3206
3209
|
CellElement,
|
|
3207
3210
|
{
|
|
3208
3211
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -3416,10 +3419,10 @@ function TableBody({
|
|
|
3416
3419
|
}
|
|
3417
3420
|
|
|
3418
3421
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
3419
|
-
var
|
|
3422
|
+
var import_react15 = require("react");
|
|
3420
3423
|
|
|
3421
3424
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
3422
|
-
var
|
|
3425
|
+
var import_react14 = require("react");
|
|
3423
3426
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3424
3427
|
function ColumnSelectorMenuOption({
|
|
3425
3428
|
id,
|
|
@@ -3427,7 +3430,7 @@ function ColumnSelectorMenuOption({
|
|
|
3427
3430
|
column,
|
|
3428
3431
|
toggleColumnVisibility
|
|
3429
3432
|
}) {
|
|
3430
|
-
const [isVisible, setIsVisible] = (0,
|
|
3433
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(column.getIsVisible());
|
|
3431
3434
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
3432
3435
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3433
3436
|
Checkbox,
|
|
@@ -3453,8 +3456,8 @@ function ColumnSelectorHeaderCell({
|
|
|
3453
3456
|
toggleColumnVisibility,
|
|
3454
3457
|
resetColumnVisibility
|
|
3455
3458
|
}) {
|
|
3456
|
-
const ref = (0,
|
|
3457
|
-
const [show, setShow] = (0,
|
|
3459
|
+
const ref = (0, import_react15.useRef)(null);
|
|
3460
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
|
3458
3461
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3459
3462
|
DataGridCell,
|
|
3460
3463
|
{
|
|
@@ -3623,7 +3626,7 @@ function PinnedColumns(_a) {
|
|
|
3623
3626
|
header.id
|
|
3624
3627
|
);
|
|
3625
3628
|
}
|
|
3626
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react16.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3627
3630
|
Checkbox,
|
|
3628
3631
|
{
|
|
3629
3632
|
checked: allSelectedAcrossPages,
|
|
@@ -3705,23 +3708,23 @@ function DataGrid({
|
|
|
3705
3708
|
ref
|
|
3706
3709
|
}) {
|
|
3707
3710
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3708
|
-
(0,
|
|
3711
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
3709
3712
|
getSavedLayout: () => {
|
|
3710
3713
|
return getSavedLayout();
|
|
3711
3714
|
}
|
|
3712
3715
|
}));
|
|
3713
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3714
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3715
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3716
|
+
const [localSorting, setLocalSorting] = (0, import_react17.useState)([]);
|
|
3717
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react17.useState)([]);
|
|
3718
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react17.useState)({});
|
|
3716
3719
|
const {
|
|
3717
3720
|
columns: tableColumns,
|
|
3718
3721
|
setColumns: setTableColumns,
|
|
3719
3722
|
getSavedLayout
|
|
3720
3723
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3721
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3724
|
+
const [columnOrder, setColumnOrder] = (0, import_react17.useState)(
|
|
3722
3725
|
tableColumns.map((c) => c.id)
|
|
3723
3726
|
);
|
|
3724
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3727
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react17.useState)(
|
|
3725
3728
|
Object.fromEntries(
|
|
3726
3729
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3727
3730
|
var _a2, _b2;
|
|
@@ -3729,7 +3732,7 @@ function DataGrid({
|
|
|
3729
3732
|
})
|
|
3730
3733
|
)
|
|
3731
3734
|
);
|
|
3732
|
-
const updateColumnVisibility = (0,
|
|
3735
|
+
const updateColumnVisibility = (0, import_react17.useCallback)(
|
|
3733
3736
|
(updateOrder) => {
|
|
3734
3737
|
setColumnVisibility(
|
|
3735
3738
|
Object.fromEntries(
|
|
@@ -3743,7 +3746,7 @@ function DataGrid({
|
|
|
3743
3746
|
},
|
|
3744
3747
|
[tableColumns]
|
|
3745
3748
|
);
|
|
3746
|
-
const resetDefaultColumnVisibility = (0,
|
|
3749
|
+
const resetDefaultColumnVisibility = (0, import_react17.useCallback)(() => {
|
|
3747
3750
|
setTableColumns((prev) => {
|
|
3748
3751
|
columns.forEach((column) => {
|
|
3749
3752
|
var _a2, _b2;
|
|
@@ -3759,7 +3762,7 @@ function DataGrid({
|
|
|
3759
3762
|
return [...prev];
|
|
3760
3763
|
}, true);
|
|
3761
3764
|
}, [columns, setTableColumns]);
|
|
3762
|
-
(0,
|
|
3765
|
+
(0, import_react17.useEffect)(() => {
|
|
3763
3766
|
updateColumnVisibility(true);
|
|
3764
3767
|
}, [updateColumnVisibility]);
|
|
3765
3768
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3775,7 +3778,7 @@ function DataGrid({
|
|
|
3775
3778
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3776
3779
|
} : setLocalColumnFilters;
|
|
3777
3780
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3778
|
-
const setRowSelection = (0,
|
|
3781
|
+
const setRowSelection = (0, import_react17.useCallback)(
|
|
3779
3782
|
(updaterOrValue) => {
|
|
3780
3783
|
if (pagination) {
|
|
3781
3784
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3789,9 +3792,9 @@ function DataGrid({
|
|
|
3789
3792
|
},
|
|
3790
3793
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3791
3794
|
);
|
|
3792
|
-
const dndId = (0,
|
|
3793
|
-
const containerRef =
|
|
3794
|
-
const toggleColumnVisibility = (0,
|
|
3795
|
+
const dndId = (0, import_react17.useId)();
|
|
3796
|
+
const containerRef = import_react17.default.useRef(null);
|
|
3797
|
+
const toggleColumnVisibility = (0, import_react17.useCallback)(
|
|
3795
3798
|
(columnId, isVisible) => {
|
|
3796
3799
|
setTableColumns((prev) => {
|
|
3797
3800
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -4039,7 +4042,7 @@ function DataGrid({
|
|
|
4039
4042
|
header.id
|
|
4040
4043
|
);
|
|
4041
4044
|
}
|
|
4042
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react17.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4043
4046
|
DataGridCell,
|
|
4044
4047
|
{
|
|
4045
4048
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -4245,7 +4248,7 @@ function adaptTableStateSetter(setter) {
|
|
|
4245
4248
|
}
|
|
4246
4249
|
|
|
4247
4250
|
// src/components/Select.tsx
|
|
4248
|
-
var
|
|
4251
|
+
var import_react18 = require("react");
|
|
4249
4252
|
var import_clsx18 = __toESM(require("clsx"), 1);
|
|
4250
4253
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4251
4254
|
var Select = (_a) => {
|
|
@@ -4279,11 +4282,11 @@ var Select = (_a) => {
|
|
|
4279
4282
|
"value"
|
|
4280
4283
|
]);
|
|
4281
4284
|
var _a2;
|
|
4282
|
-
const inputRef = (0,
|
|
4283
|
-
const inputContainerRef = (0,
|
|
4284
|
-
const preventFocusOnInitialRender = (0,
|
|
4285
|
-
const [show, setShow] = (0,
|
|
4286
|
-
(0,
|
|
4285
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
4286
|
+
const inputContainerRef = (0, import_react18.useRef)(null);
|
|
4287
|
+
const preventFocusOnInitialRender = (0, import_react18.useRef)(true);
|
|
4288
|
+
const [show, setShow] = (0, import_react18.useState)(false);
|
|
4289
|
+
(0, import_react18.useEffect)(() => {
|
|
4287
4290
|
var _a3;
|
|
4288
4291
|
if (preventFocusOnInitialRender.current) {
|
|
4289
4292
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4581,7 +4584,7 @@ Button.displayName = "Button";
|
|
|
4581
4584
|
|
|
4582
4585
|
// src/components/Tooltip.tsx
|
|
4583
4586
|
var import_clsx21 = __toESM(require("clsx"), 1);
|
|
4584
|
-
var
|
|
4587
|
+
var import_react19 = require("react");
|
|
4585
4588
|
var import_react_dom2 = require("react-dom");
|
|
4586
4589
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4587
4590
|
var Tooltip = ({
|
|
@@ -4594,11 +4597,11 @@ var Tooltip = ({
|
|
|
4594
4597
|
offset = 8,
|
|
4595
4598
|
keepHidden = false
|
|
4596
4599
|
}) => {
|
|
4597
|
-
const ref = (0,
|
|
4598
|
-
const tooltipRef = (0,
|
|
4599
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4600
|
-
const [isVisible, setIsVisible] = (0,
|
|
4601
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4600
|
+
const ref = (0, import_react19.useRef)(null);
|
|
4601
|
+
const tooltipRef = (0, import_react19.useRef)(null);
|
|
4602
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react19.useState)({ top: 0, left: 0 });
|
|
4603
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
4604
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react19.useState)(false);
|
|
4602
4605
|
const updatePosition = () => {
|
|
4603
4606
|
if (!ref.current || !tooltipRef.current) return;
|
|
4604
4607
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4637,14 +4640,14 @@ var Tooltip = ({
|
|
|
4637
4640
|
setIsVisible(false);
|
|
4638
4641
|
setRemoveOpacity(false);
|
|
4639
4642
|
};
|
|
4640
|
-
(0,
|
|
4643
|
+
(0, import_react19.useEffect)(() => {
|
|
4641
4644
|
if (isVisible && tooltipRef.current) {
|
|
4642
4645
|
requestAnimationFrame(() => {
|
|
4643
4646
|
updatePosition();
|
|
4644
4647
|
});
|
|
4645
4648
|
}
|
|
4646
4649
|
}, [isVisible]);
|
|
4647
|
-
(0,
|
|
4650
|
+
(0, import_react19.useEffect)(() => {
|
|
4648
4651
|
if (isVisible) {
|
|
4649
4652
|
window.addEventListener("resize", updatePosition);
|
|
4650
4653
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4702,12 +4705,12 @@ var Tooltip = ({
|
|
|
4702
4705
|
Tooltip.displayName = "Tooltip";
|
|
4703
4706
|
|
|
4704
4707
|
// src/components/DateInput.tsx
|
|
4705
|
-
var
|
|
4708
|
+
var import_react21 = require("react");
|
|
4706
4709
|
var import_react_dom3 = require("react-dom");
|
|
4707
4710
|
|
|
4708
4711
|
// src/components/CalendarRange.tsx
|
|
4709
4712
|
var import_clsx22 = __toESM(require("clsx"), 1);
|
|
4710
|
-
var
|
|
4713
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
4711
4714
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4712
4715
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4713
4716
|
function DateCell(_a) {
|
|
@@ -4820,20 +4823,20 @@ function CalendarRange({
|
|
|
4820
4823
|
const fromDate = parseDate(from);
|
|
4821
4824
|
const toDate = parseDate(to);
|
|
4822
4825
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4823
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4826
|
+
const [baseMonth, setBaseMonth] = (0, import_react20.useState)(
|
|
4824
4827
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4825
4828
|
);
|
|
4826
|
-
const [selecting, setSelecting] = (0,
|
|
4827
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4828
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4829
|
-
(0,
|
|
4829
|
+
const [selecting, setSelecting] = (0, import_react20.useState)("from");
|
|
4830
|
+
const [pendingFrom, setPendingFrom] = (0, import_react20.useState)(void 0);
|
|
4831
|
+
const [hoveredDate, setHoveredDate] = (0, import_react20.useState)(void 0);
|
|
4832
|
+
(0, import_react20.useEffect)(() => {
|
|
4830
4833
|
if (fromDate) {
|
|
4831
4834
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4832
4835
|
} else if (toDate) {
|
|
4833
4836
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4834
4837
|
}
|
|
4835
4838
|
}, [from, to]);
|
|
4836
|
-
(0,
|
|
4839
|
+
(0, import_react20.useEffect)(() => {
|
|
4837
4840
|
if (fromDate && toDate) {
|
|
4838
4841
|
setSelecting("from");
|
|
4839
4842
|
setPendingFrom(void 0);
|
|
@@ -4979,14 +4982,14 @@ function CalendarPane({
|
|
|
4979
4982
|
const years = Array.from({ length: 100 }).map(
|
|
4980
4983
|
(_, i) => baseMonth.year - 50 + i
|
|
4981
4984
|
);
|
|
4982
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4983
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4984
|
-
const monthMenuRef = (0,
|
|
4985
|
-
const yearMenuRef = (0,
|
|
4985
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react20.useState)(false);
|
|
4986
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react20.useState)(false);
|
|
4987
|
+
const monthMenuRef = (0, import_react20.useRef)(null);
|
|
4988
|
+
const yearMenuRef = (0, import_react20.useRef)(null);
|
|
4986
4989
|
const month = getMonthData(offset);
|
|
4987
4990
|
const totalCells = 42;
|
|
4988
4991
|
const emptyCells = month.firstDayOffset;
|
|
4989
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react20.default.Fragment, { children: [
|
|
4990
4993
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4991
4994
|
"div",
|
|
4992
4995
|
{
|
|
@@ -5194,24 +5197,24 @@ var DateInput = (_a) => {
|
|
|
5194
5197
|
"label",
|
|
5195
5198
|
"isDateAvailable"
|
|
5196
5199
|
]);
|
|
5197
|
-
const [visible, setVisible] = (0,
|
|
5198
|
-
const [inputValue, setInputValue] = (0,
|
|
5199
|
-
const [isTyping, setIsTyping] = (0,
|
|
5200
|
-
const popoverRef = (0,
|
|
5201
|
-
const triggerRef = (0,
|
|
5202
|
-
const rootRef = (0,
|
|
5203
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
5200
|
+
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
5201
|
+
const [inputValue, setInputValue] = (0, import_react21.useState)("");
|
|
5202
|
+
const [isTyping, setIsTyping] = (0, import_react21.useState)(false);
|
|
5203
|
+
const popoverRef = (0, import_react21.useRef)(null);
|
|
5204
|
+
const triggerRef = (0, import_react21.useRef)(null);
|
|
5205
|
+
const rootRef = (0, import_react21.useRef)(null);
|
|
5206
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react21.useState)({
|
|
5204
5207
|
top: 0,
|
|
5205
5208
|
left: 0,
|
|
5206
5209
|
width: 0
|
|
5207
5210
|
});
|
|
5208
5211
|
const [from, to] = [value, ""];
|
|
5209
|
-
(0,
|
|
5212
|
+
(0, import_react21.useEffect)(() => {
|
|
5210
5213
|
if (!isTyping) {
|
|
5211
5214
|
setInputValue(formatDisplayValue(from));
|
|
5212
5215
|
}
|
|
5213
5216
|
}, [from, isTyping]);
|
|
5214
|
-
(0,
|
|
5217
|
+
(0, import_react21.useLayoutEffect)(() => {
|
|
5215
5218
|
if (visible) {
|
|
5216
5219
|
updatePosition();
|
|
5217
5220
|
}
|
|
@@ -5226,7 +5229,7 @@ var DateInput = (_a) => {
|
|
|
5226
5229
|
});
|
|
5227
5230
|
}
|
|
5228
5231
|
};
|
|
5229
|
-
(0,
|
|
5232
|
+
(0, import_react21.useEffect)(() => {
|
|
5230
5233
|
updatePosition();
|
|
5231
5234
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
5232
5235
|
if (triggerRef.current) {
|
|
@@ -5238,7 +5241,7 @@ var DateInput = (_a) => {
|
|
|
5238
5241
|
window.removeEventListener("scroll", updatePosition);
|
|
5239
5242
|
};
|
|
5240
5243
|
}, []);
|
|
5241
|
-
(0,
|
|
5244
|
+
(0, import_react21.useEffect)(() => {
|
|
5242
5245
|
const handleKeyDown2 = (event) => {
|
|
5243
5246
|
var _a2;
|
|
5244
5247
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -5251,7 +5254,7 @@ var DateInput = (_a) => {
|
|
|
5251
5254
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
5252
5255
|
};
|
|
5253
5256
|
});
|
|
5254
|
-
(0,
|
|
5257
|
+
(0, import_react21.useEffect)(() => {
|
|
5255
5258
|
const handleClickOutside = (event) => {
|
|
5256
5259
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
5257
5260
|
setVisible(false);
|
|
@@ -5412,10 +5415,10 @@ var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
|
5412
5415
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5413
5416
|
|
|
5414
5417
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5415
|
-
var
|
|
5418
|
+
var import_react23 = require("react");
|
|
5416
5419
|
|
|
5417
5420
|
// src/components/ImagePlaceholder.tsx
|
|
5418
|
-
var
|
|
5421
|
+
var import_react22 = require("react");
|
|
5419
5422
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5420
5423
|
|
|
5421
5424
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5426,11 +5429,11 @@ var import_clsx25 = __toESM(require("clsx"), 1);
|
|
|
5426
5429
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5427
5430
|
|
|
5428
5431
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5429
|
-
var
|
|
5432
|
+
var import_react24 = require("react");
|
|
5430
5433
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5431
5434
|
|
|
5432
5435
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5433
|
-
var
|
|
5436
|
+
var import_react25 = require("react");
|
|
5434
5437
|
|
|
5435
5438
|
// src/components/Surface.tsx
|
|
5436
5439
|
var import_clsx26 = __toESM(require("clsx"), 1);
|
|
@@ -5475,17 +5478,17 @@ var import_clsx27 = require("clsx");
|
|
|
5475
5478
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
5476
5479
|
|
|
5477
5480
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5478
|
-
var
|
|
5481
|
+
var import_react26 = require("react");
|
|
5479
5482
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5480
5483
|
|
|
5481
5484
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5482
|
-
var
|
|
5485
|
+
var import_react27 = require("react");
|
|
5483
5486
|
|
|
5484
5487
|
// src/components/ProductImagePreview/index.tsx
|
|
5485
5488
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5486
5489
|
|
|
5487
5490
|
// src/components/CompactImagesPreview.tsx
|
|
5488
|
-
var
|
|
5491
|
+
var import_react28 = require("react");
|
|
5489
5492
|
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
5490
5493
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
5491
5494
|
|
|
@@ -5494,12 +5497,12 @@ var import_clsx29 = __toESM(require("clsx"), 1);
|
|
|
5494
5497
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
5495
5498
|
|
|
5496
5499
|
// src/components/ListGroup.tsx
|
|
5497
|
-
var
|
|
5500
|
+
var import_react29 = require("react");
|
|
5498
5501
|
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
5499
5502
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5500
5503
|
|
|
5501
5504
|
// src/components/Pagination.tsx
|
|
5502
|
-
var
|
|
5505
|
+
var import_react30 = require("react");
|
|
5503
5506
|
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
5504
5507
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5505
5508
|
var Pagination = ({
|
|
@@ -5511,7 +5514,7 @@ var Pagination = ({
|
|
|
5511
5514
|
className,
|
|
5512
5515
|
disabled
|
|
5513
5516
|
}) => {
|
|
5514
|
-
const goTo = (0,
|
|
5517
|
+
const goTo = (0, import_react30.useCallback)(
|
|
5515
5518
|
(page) => {
|
|
5516
5519
|
if (disabled) return;
|
|
5517
5520
|
onPageChange(page);
|
|
@@ -5528,7 +5531,7 @@ var Pagination = ({
|
|
|
5528
5531
|
goTo(currentPage + 1);
|
|
5529
5532
|
}
|
|
5530
5533
|
};
|
|
5531
|
-
const pageTokens = (0,
|
|
5534
|
+
const pageTokens = (0, import_react30.useMemo)(() => {
|
|
5532
5535
|
if (totalPages <= 5) {
|
|
5533
5536
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5534
5537
|
}
|
|
@@ -5651,21 +5654,21 @@ var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
|
5651
5654
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5652
5655
|
|
|
5653
5656
|
// src/components/SearchResultImage/index.tsx
|
|
5654
|
-
var
|
|
5657
|
+
var import_react31 = require("react");
|
|
5655
5658
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5656
5659
|
|
|
5657
5660
|
// src/components/Alert.tsx
|
|
5658
5661
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
5659
|
-
var
|
|
5662
|
+
var import_react32 = require("react");
|
|
5660
5663
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5661
5664
|
|
|
5662
5665
|
// src/components/OrderCheckIcon.tsx
|
|
5663
5666
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5664
5667
|
|
|
5665
5668
|
// src/components/EditingContext.tsx
|
|
5666
|
-
var
|
|
5669
|
+
var import_react33 = require("react");
|
|
5667
5670
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5668
|
-
var EditingContext = (0,
|
|
5671
|
+
var EditingContext = (0, import_react33.createContext)(null);
|
|
5669
5672
|
|
|
5670
5673
|
// src/components/AccessCard.tsx
|
|
5671
5674
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
@@ -5799,19 +5802,19 @@ var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
|
5799
5802
|
|
|
5800
5803
|
// src/components/AccessCardGroup.tsx
|
|
5801
5804
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
5802
|
-
var
|
|
5805
|
+
var import_react34 = require("react");
|
|
5803
5806
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5804
5807
|
|
|
5805
5808
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5806
|
-
var
|
|
5809
|
+
var import_react36 = require("react");
|
|
5807
5810
|
|
|
5808
5811
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5809
|
-
var
|
|
5810
|
-
var GridContext = (0,
|
|
5812
|
+
var import_react35 = require("react");
|
|
5813
|
+
var GridContext = (0, import_react35.createContext)(null);
|
|
5811
5814
|
|
|
5812
5815
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5813
5816
|
function useGridContext() {
|
|
5814
|
-
const ctx = (0,
|
|
5817
|
+
const ctx = (0, import_react36.useContext)(GridContext);
|
|
5815
5818
|
if (!ctx) {
|
|
5816
5819
|
throw new Error("useGridContext must be used within GridContextProvider");
|
|
5817
5820
|
}
|
|
@@ -5822,8 +5825,8 @@ function useGridContext() {
|
|
|
5822
5825
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5823
5826
|
function ColumnSelector() {
|
|
5824
5827
|
const context = useGridContext();
|
|
5825
|
-
const ref = (0,
|
|
5826
|
-
const [show, setShow] = (0,
|
|
5828
|
+
const ref = (0, import_react37.useRef)(null);
|
|
5829
|
+
const [show, setShow] = (0, import_react37.useState)(false);
|
|
5827
5830
|
const {
|
|
5828
5831
|
columns,
|
|
5829
5832
|
id,
|
|
@@ -5834,7 +5837,7 @@ function ColumnSelector() {
|
|
|
5834
5837
|
resetColumnVisibility,
|
|
5835
5838
|
dispatch
|
|
5836
5839
|
} = context;
|
|
5837
|
-
const toggleColumnVisibility = (0,
|
|
5840
|
+
const toggleColumnVisibility = (0, import_react37.useCallback)(
|
|
5838
5841
|
(index, visible) => {
|
|
5839
5842
|
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
5840
5843
|
},
|
|
@@ -5989,7 +5992,7 @@ function MobileDataGridHeader({
|
|
|
5989
5992
|
}
|
|
5990
5993
|
|
|
5991
5994
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5992
|
-
var
|
|
5995
|
+
var import_react38 = require("react");
|
|
5993
5996
|
|
|
5994
5997
|
// src/components/MobileDataGrid/dataGridReducer.ts
|
|
5995
5998
|
function dataGridReducer(state, action) {
|
|
@@ -6032,10 +6035,10 @@ function GridContextProvider(props) {
|
|
|
6032
6035
|
getId,
|
|
6033
6036
|
onRowSelect
|
|
6034
6037
|
} = props;
|
|
6035
|
-
const [columns, dispatch] = (0,
|
|
6036
|
-
const [selectedRowIds, setSelectedRowIds] = (0,
|
|
6037
|
-
const [currentRow, setCurrentRow] = (0,
|
|
6038
|
-
const resetColumnVisibility = (0,
|
|
6038
|
+
const [columns, dispatch] = (0, import_react38.useReducer)(dataGridReducer, initialColumns);
|
|
6039
|
+
const [selectedRowIds, setSelectedRowIds] = (0, import_react38.useState)([]);
|
|
6040
|
+
const [currentRow, setCurrentRow] = (0, import_react38.useState)(null);
|
|
6041
|
+
const resetColumnVisibility = (0, import_react38.useCallback)(() => {
|
|
6039
6042
|
const newColumns = columns.map((column) => {
|
|
6040
6043
|
var _a;
|
|
6041
6044
|
const initialColumn = initialColumns.find((c) => c.id === column.id);
|
|
@@ -6047,7 +6050,7 @@ function GridContextProvider(props) {
|
|
|
6047
6050
|
});
|
|
6048
6051
|
dispatch({ type: "SET", payload: newColumns });
|
|
6049
6052
|
}, [columns, initialColumns]);
|
|
6050
|
-
const handleRowSelect = (0,
|
|
6053
|
+
const handleRowSelect = (0, import_react38.useCallback)(
|
|
6051
6054
|
(item) => {
|
|
6052
6055
|
var _a;
|
|
6053
6056
|
const rowId = (_a = getId(item)) != null ? _a : "";
|
|
@@ -6058,7 +6061,7 @@ function GridContextProvider(props) {
|
|
|
6058
6061
|
},
|
|
6059
6062
|
[getId, onRowSelect, selectedRowIds]
|
|
6060
6063
|
);
|
|
6061
|
-
const handleRowSelectAll = (0,
|
|
6064
|
+
const handleRowSelectAll = (0, import_react38.useCallback)(() => {
|
|
6062
6065
|
setSelectedRowIds((prev) => {
|
|
6063
6066
|
if (prev.length === data.length) {
|
|
6064
6067
|
return [];
|
|
@@ -6066,13 +6069,13 @@ function GridContextProvider(props) {
|
|
|
6066
6069
|
return data.map(getId).filter((id2) => id2 !== void 0);
|
|
6067
6070
|
});
|
|
6068
6071
|
}, [data, getId]);
|
|
6069
|
-
const openRowDetail = (0,
|
|
6072
|
+
const openRowDetail = (0, import_react38.useCallback)((row) => {
|
|
6070
6073
|
setCurrentRow(row);
|
|
6071
6074
|
}, []);
|
|
6072
|
-
const closeRowDetail = (0,
|
|
6075
|
+
const closeRowDetail = (0, import_react38.useCallback)(() => {
|
|
6073
6076
|
setCurrentRow(null);
|
|
6074
6077
|
}, []);
|
|
6075
|
-
const visibleColumns = (0,
|
|
6078
|
+
const visibleColumns = (0, import_react38.useMemo)(() => {
|
|
6076
6079
|
const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
|
|
6077
6080
|
if (primaryKey) {
|
|
6078
6081
|
const pkColumn = columns.find((col) => col.id === String(primaryKey));
|
|
@@ -6119,7 +6122,7 @@ function GridContextProvider(props) {
|
|
|
6119
6122
|
|
|
6120
6123
|
// src/components/Modal.tsx
|
|
6121
6124
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
6122
|
-
var
|
|
6125
|
+
var import_react40 = require("react");
|
|
6123
6126
|
|
|
6124
6127
|
// src/components/ModalHeader.tsx
|
|
6125
6128
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
@@ -6295,10 +6298,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
6295
6298
|
var import_react_use = require("react-use");
|
|
6296
6299
|
|
|
6297
6300
|
// src/components/useMounted.tsx
|
|
6298
|
-
var
|
|
6301
|
+
var import_react39 = require("react");
|
|
6299
6302
|
var useMounted = () => {
|
|
6300
|
-
const [isMounted, setIsMounted] = (0,
|
|
6301
|
-
(0,
|
|
6303
|
+
const [isMounted, setIsMounted] = (0, import_react39.useState)(false);
|
|
6304
|
+
(0, import_react39.useEffect)(() => {
|
|
6302
6305
|
setIsMounted(true);
|
|
6303
6306
|
return () => setIsMounted(false);
|
|
6304
6307
|
}, []);
|
|
@@ -6392,12 +6395,12 @@ var Modal = ({
|
|
|
6392
6395
|
}) => {
|
|
6393
6396
|
var _a;
|
|
6394
6397
|
const mounted = useMounted();
|
|
6395
|
-
const modalRef = (0,
|
|
6396
|
-
const bgRef = (0,
|
|
6398
|
+
const modalRef = (0, import_react40.useRef)(null);
|
|
6399
|
+
const bgRef = (0, import_react40.useRef)(null);
|
|
6397
6400
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
6398
6401
|
const isMobile = useMatchesMobile();
|
|
6399
6402
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
6400
|
-
(0,
|
|
6403
|
+
(0, import_react40.useEffect)(() => {
|
|
6401
6404
|
if (!mounted) return;
|
|
6402
6405
|
if (!modalRef.current || !bgRef.current) {
|
|
6403
6406
|
console.error("Modal or background reference is not set.");
|
|
@@ -6417,7 +6420,7 @@ var Modal = ({
|
|
|
6417
6420
|
bgFadeIn(bgRef.current);
|
|
6418
6421
|
}
|
|
6419
6422
|
}, [mounted, onClose, open, wasOpen]);
|
|
6420
|
-
const handleKeyDown = (0,
|
|
6423
|
+
const handleKeyDown = (0, import_react40.useCallback)(
|
|
6421
6424
|
(e) => {
|
|
6422
6425
|
if (e.key === "Escape") {
|
|
6423
6426
|
if (onClose) {
|
|
@@ -6428,12 +6431,12 @@ var Modal = ({
|
|
|
6428
6431
|
},
|
|
6429
6432
|
[onClose]
|
|
6430
6433
|
);
|
|
6431
|
-
const handleClose = (0,
|
|
6434
|
+
const handleClose = (0, import_react40.useCallback)(() => {
|
|
6432
6435
|
if (onClose) {
|
|
6433
6436
|
onClose();
|
|
6434
6437
|
}
|
|
6435
6438
|
}, [onClose]);
|
|
6436
|
-
(0,
|
|
6439
|
+
(0, import_react40.useEffect)(() => {
|
|
6437
6440
|
if (open) {
|
|
6438
6441
|
document.addEventListener("keyup", handleKeyDown);
|
|
6439
6442
|
}
|
|
@@ -6441,7 +6444,7 @@ var Modal = ({
|
|
|
6441
6444
|
document.removeEventListener("keyup", handleKeyDown);
|
|
6442
6445
|
};
|
|
6443
6446
|
}, [open, handleKeyDown]);
|
|
6444
|
-
(0,
|
|
6447
|
+
(0, import_react40.useEffect)(() => {
|
|
6445
6448
|
if (!open) return;
|
|
6446
6449
|
const scrollY = window.scrollY;
|
|
6447
6450
|
const body = document.body;
|
|
@@ -6462,7 +6465,7 @@ var Modal = ({
|
|
|
6462
6465
|
};
|
|
6463
6466
|
}, [open]);
|
|
6464
6467
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
6465
|
-
const backgroundClickHandler = (0,
|
|
6468
|
+
const backgroundClickHandler = (0, import_react40.useCallback)(
|
|
6466
6469
|
(e) => {
|
|
6467
6470
|
const target = e.target;
|
|
6468
6471
|
const currentTarget = e.currentTarget;
|