@dmsi/wedgekit-react 0.0.643 → 0.0.645

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/{chunk-XX5GVIPZ.js → chunk-3MV3KMQH.js} +2 -2
  2. package/dist/{chunk-V7GPM6Z3.js → chunk-3PBA2EZ5.js} +1 -1
  3. package/dist/{chunk-3R3AY5MT.js → chunk-B3T7KBDA.js} +1 -1
  4. package/dist/{chunk-FIOXWZWU.js → chunk-ECYXZZWC.js} +1 -1
  5. package/dist/{chunk-RQMOWYB7.js → chunk-EXCAOI2L.js} +3 -3
  6. package/dist/{chunk-MQB6BSRX.js → chunk-FCGPQNS2.js} +1 -1
  7. package/dist/{chunk-SJ3SULQB.js → chunk-FJXWYGB7.js} +7 -7
  8. package/dist/{chunk-QJZ3XHNH.js → chunk-HCHKYUNQ.js} +19 -5
  9. package/dist/{chunk-5JHKFK73.js → chunk-HIGNJAQA.js} +2 -2
  10. package/dist/{chunk-IATOG76G.js → chunk-ISRG77J6.js} +1 -1
  11. package/dist/{chunk-UB3GEENN.js → chunk-OZEKRO4L.js} +1 -1
  12. package/dist/{chunk-LGX34HML.js → chunk-Q4AANHJY.js} +1 -1
  13. package/dist/{chunk-PS7MBNUT.js → chunk-REC2XOPI.js} +1 -1
  14. package/dist/{chunk-ARWHCWG7.js → chunk-XT4BQXSX.js} +1 -1
  15. package/dist/{chunk-YR4ZO2XL.js → chunk-ZSRTAMSW.js} +56 -23
  16. package/dist/components/CalendarRange.cjs +202 -180
  17. package/dist/components/CalendarRange.js +15 -15
  18. package/dist/components/CompactImagesPreview.cjs +6 -3
  19. package/dist/components/CompactImagesPreview.js +3 -3
  20. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +202 -180
  21. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +15 -15
  22. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +202 -180
  23. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +15 -15
  24. package/dist/components/DataGrid/PinnedColumns.cjs +202 -180
  25. package/dist/components/DataGrid/PinnedColumns.js +15 -15
  26. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +202 -180
  27. package/dist/components/DataGrid/TableBody/LoadingCell.js +15 -15
  28. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +202 -180
  29. package/dist/components/DataGrid/TableBody/TableBodyRow.js +15 -15
  30. package/dist/components/DataGrid/TableBody/index.cjs +202 -180
  31. package/dist/components/DataGrid/TableBody/index.js +15 -15
  32. package/dist/components/DataGrid/index.cjs +203 -181
  33. package/dist/components/DataGrid/index.js +15 -15
  34. package/dist/components/DataGrid/utils.cjs +202 -180
  35. package/dist/components/DataGrid/utils.js +15 -15
  36. package/dist/components/DataGridCell.cjs +61 -58
  37. package/dist/components/DataGridCell.js +6 -6
  38. package/dist/components/DateInput.cjs +195 -173
  39. package/dist/components/DateInput.js +15 -15
  40. package/dist/components/DateRangeInput.cjs +208 -186
  41. package/dist/components/DateRangeInput.js +15 -15
  42. package/dist/components/Menu.cjs +15 -12
  43. package/dist/components/Menu.js +4 -4
  44. package/dist/components/MenuOption.cjs +8 -5
  45. package/dist/components/MenuOption.js +3 -3
  46. package/dist/components/MobileDataGrid/ColumnList.js +4 -4
  47. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +206 -184
  48. package/dist/components/MobileDataGrid/ColumnSelector/index.js +15 -15
  49. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +2 -2
  50. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +3 -3
  51. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +206 -184
  52. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +15 -15
  53. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +3 -3
  54. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +19 -16
  55. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +6 -6
  56. package/dist/components/MobileDataGrid/index.cjs +215 -193
  57. package/dist/components/MobileDataGrid/index.js +15 -15
  58. package/dist/components/Modal.cjs +15 -12
  59. package/dist/components/Modal.js +3 -3
  60. package/dist/components/NestedMenu.cjs +11 -8
  61. package/dist/components/NestedMenu.js +3 -3
  62. package/dist/components/PDFViewer/index.cjs +31 -28
  63. package/dist/components/PDFViewer/index.js +3 -3
  64. package/dist/components/ProductImagePreview/index.cjs +18 -15
  65. package/dist/components/ProductImagePreview/index.js +3 -3
  66. package/dist/components/ProjectBar.cjs +3 -0
  67. package/dist/components/ProjectBar.js +2 -2
  68. package/dist/components/Time.js +1 -1
  69. package/dist/components/index.cjs +263 -241
  70. package/dist/components/index.js +15 -15
  71. package/dist/components/useMenuSystem.cjs +22 -19
  72. package/dist/components/useMenuSystem.js +3 -3
  73. package/dist/hooks/index.cjs +76 -26
  74. package/dist/hooks/index.js +4 -2
  75. package/dist/utils/index.cjs +21 -5
  76. package/dist/utils/index.js +1 -1
  77. package/package.json +1 -1
@@ -62,7 +62,7 @@ __export(DateRangeInput_exports, {
62
62
  DateRangeInput: () => DateRangeInput
63
63
  });
64
64
  module.exports = __toCommonJS(DateRangeInput_exports);
65
- var import_react40 = require("react");
65
+ var import_react41 = require("react");
66
66
  var import_react_dom5 = require("react-dom");
67
67
 
68
68
  // src/components/Input.tsx
@@ -834,7 +834,7 @@ Percentage.displayName = "Percentage";
834
834
 
835
835
  // src/components/CalendarRange.tsx
836
836
  var import_clsx42 = __toESM(require("clsx"), 1);
837
- var import_react39 = __toESM(require("react"), 1);
837
+ var import_react40 = __toESM(require("react"), 1);
838
838
  var import_polyfill = require("@js-temporal/polyfill");
839
839
 
840
840
  // src/components/DataGridCell.tsx
@@ -890,11 +890,11 @@ var CSS = /* @__PURE__ */ Object.freeze({
890
890
 
891
891
  // src/components/DataGridCell.tsx
892
892
  var import_clsx9 = __toESM(require("clsx"), 1);
893
- var import_react11 = require("react");
893
+ var import_react12 = require("react");
894
894
 
895
895
  // src/components/MenuOption.tsx
896
896
  var import_clsx7 = __toESM(require("clsx"), 1);
897
- var import_react7 = require("react");
897
+ var import_react8 = require("react");
898
898
 
899
899
  // src/hooks/useKeydown.ts
900
900
  var import_react3 = require("react");
@@ -1071,11 +1071,24 @@ function isValidDateRangeOrder(fromDate, toDate) {
1071
1071
 
1072
1072
  // src/utils/mergeObjectArrays.ts
1073
1073
  function mergeObjectArrays(arr1, arr2) {
1074
- const maxLength = Math.max(arr1.length, arr2.length);
1075
- return Array.from(
1076
- { length: maxLength },
1077
- (_, i) => __spreadValues(__spreadValues({}, arr1[i] || {}), arr2[i] || {})
1078
- );
1074
+ const arr2Map = /* @__PURE__ */ new Map();
1075
+ for (const item of arr2) {
1076
+ const id = item.id;
1077
+ if (id !== void 0) {
1078
+ arr2Map.set(id, item);
1079
+ }
1080
+ }
1081
+ return arr1.map((item1) => {
1082
+ const id = item1.id;
1083
+ if (id !== void 0 && arr2Map.has(id)) {
1084
+ const item2 = arr2Map.get(id);
1085
+ const meta1 = item1.meta;
1086
+ const meta2 = item2.meta;
1087
+ const mergedMeta = meta1 && meta2 && typeof meta1 === "object" && typeof meta2 === "object" ? __spreadValues(__spreadValues({}, meta1), meta2) : meta2 != null ? meta2 : meta1;
1088
+ return __spreadProps(__spreadValues(__spreadValues({}, item1), item2), { meta: mergedMeta });
1089
+ }
1090
+ return item1;
1091
+ });
1079
1092
  }
1080
1093
 
1081
1094
  // src/utils/index.ts
@@ -1111,52 +1124,58 @@ var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
1111
1124
  function useTableLayout(initialColumns, key, autosync = true) {
1112
1125
  const [columns, setColumns] = (0, import_react6.useState)(initialColumns);
1113
1126
  const [isReady, setIsReady] = (0, import_react6.useState)(false);
1114
- const renderCountRef = (0, import_react6.useRef)(0);
1127
+ const isReadyRef = (0, import_react6.useRef)(false);
1128
+ const keyRef = (0, import_react6.useRef)(key);
1129
+ (0, import_react6.useEffect)(() => {
1130
+ isReadyRef.current = isReady;
1131
+ keyRef.current = key;
1132
+ }, [isReady, key]);
1115
1133
  const handleSaveLayout = (0, import_react6.useCallback)(
1116
1134
  (setter, _internal) => {
1117
- if (!isReady && !_internal || !key) return;
1135
+ if (!isReadyRef.current && !_internal || !keyRef.current) return;
1118
1136
  setColumns((prevColumns) => {
1119
1137
  const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
1120
- if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
1138
+ if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal) {
1121
1139
  return prevColumns;
1140
+ }
1122
1141
  localStorage.setItem(
1123
- getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
1142
+ getLocalStorageKeyWithPrefix(`${keyRef.current}-tableLayout`),
1124
1143
  JSON.stringify(newColumns)
1125
1144
  );
1126
1145
  return newColumns;
1127
1146
  });
1128
1147
  },
1129
- [isReady, key]
1148
+ []
1130
1149
  );
1131
1150
  (0, import_react6.useEffect)(() => {
1132
1151
  if (!autosync) return;
1133
- if (!key) return setIsReady(true);
1134
- if (renderCountRef.current > 1) {
1135
- throw new Error(
1136
- `useTableLayout should only be called once per component render cycle.
1137
- ${renderCountRef.current} Renders detected.
1138
- Check dependency stability`
1139
- );
1152
+ if (!key) {
1153
+ setIsReady(true);
1154
+ return;
1140
1155
  }
1141
- renderCountRef.current += 1;
1142
1156
  const savedLayout = localStorage.getItem(
1143
1157
  getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
1144
1158
  );
1145
1159
  if (savedLayout) {
1146
- handleSaveLayout(
1160
+ setColumns(
1147
1161
  mergeObjectArrays(
1148
1162
  initialColumns,
1149
1163
  JSON.parse(savedLayout)
1150
- ),
1151
- true
1164
+ )
1165
+ );
1166
+ } else {
1167
+ localStorage.setItem(
1168
+ getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
1169
+ JSON.stringify(initialColumns)
1152
1170
  );
1171
+ setColumns((prev) => {
1172
+ if (JSON.stringify(initialColumns) === JSON.stringify(prev))
1173
+ return prev;
1174
+ return initialColumns;
1175
+ });
1153
1176
  }
1154
- if (!savedLayout) handleSaveLayout(initialColumns, true);
1155
1177
  setIsReady(true);
1156
- return () => {
1157
- renderCountRef.current = 0;
1158
- };
1159
- }, [handleSaveLayout, initialColumns, key, autosync]);
1178
+ }, [initialColumns, key, autosync]);
1160
1179
  const getSavedLayout = (0, import_react6.useCallback)(() => {
1161
1180
  const savedLayout = localStorage.getItem(
1162
1181
  getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
@@ -1168,6 +1187,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
1168
1187
  return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
1169
1188
  }
1170
1189
 
1190
+ // src/hooks/useEditCell.tsx
1191
+ var import_react7 = require("react");
1192
+
1171
1193
  // src/components/Caption.tsx
1172
1194
  var import_clsx6 = __toESM(require("clsx"), 1);
1173
1195
  var import_jsx_runtime5 = require("react/jsx-runtime");
@@ -1319,12 +1341,12 @@ var MenuOption = ({
1319
1341
  onMouseMove,
1320
1342
  small = false
1321
1343
  }) => {
1322
- const uniqueId = (0, import_react7.useId)();
1323
- const internalRef = (0, import_react7.useRef)(null);
1344
+ const uniqueId = (0, import_react8.useId)();
1345
+ const internalRef = (0, import_react8.useRef)(null);
1324
1346
  const actualRef = ref || internalRef;
1325
- const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
1347
+ const menuId = (0, import_react8.useRef)(`menu-${uniqueId}`);
1326
1348
  const isMobile = useMatchesMobile();
1327
- const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
1349
+ const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react8.useState)(false);
1328
1350
  const handleMouseEnter = () => {
1329
1351
  if (subMenu && onSubMenuHover && !disabled) {
1330
1352
  onSubMenuHover(menuId.current, subMenuLevel);
@@ -1484,27 +1506,27 @@ function highlightMatch(text, searchValue) {
1484
1506
 
1485
1507
  // src/components/Menu.tsx
1486
1508
  var import_clsx8 = __toESM(require("clsx"), 1);
1487
- var import_react9 = require("react");
1509
+ var import_react10 = require("react");
1488
1510
  var import_react_dom = require("react-dom");
1489
1511
 
1490
1512
  // src/components/useMenuSystem.tsx
1491
- var import_react8 = require("react");
1513
+ var import_react9 = require("react");
1492
1514
  function useSubMenuSystem(mobilePositionTo) {
1493
- const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
1515
+ const [activeMenus, setActiveMenus] = (0, import_react9.useState)(
1494
1516
  {}
1495
1517
  );
1496
- const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
1497
- const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
1518
+ const [activeMenu, setActiveMenu] = (0, import_react9.useState)("");
1519
+ const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react9.useState)(
1498
1520
  null
1499
1521
  );
1500
- const menuRootRef = (0, import_react8.useRef)(null);
1501
- const subMenuRefs = (0, import_react8.useRef)({});
1502
- const hoverTimeoutRef = (0, import_react8.useRef)(null);
1503
- const closeTimeoutRef = (0, import_react8.useRef)(null);
1504
- const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
1505
- const isMouseMovingRef = (0, import_react8.useRef)(false);
1506
- const pendingOpenActionRef = (0, import_react8.useRef)(null);
1507
- const pendingCloseActionRef = (0, import_react8.useRef)(null);
1522
+ const menuRootRef = (0, import_react9.useRef)(null);
1523
+ const subMenuRefs = (0, import_react9.useRef)({});
1524
+ const hoverTimeoutRef = (0, import_react9.useRef)(null);
1525
+ const closeTimeoutRef = (0, import_react9.useRef)(null);
1526
+ const mouseStopTimeoutRef = (0, import_react9.useRef)(null);
1527
+ const isMouseMovingRef = (0, import_react9.useRef)(false);
1528
+ const pendingOpenActionRef = (0, import_react9.useRef)(null);
1529
+ const pendingCloseActionRef = (0, import_react9.useRef)(null);
1508
1530
  const isMobile = useMatchesMobile();
1509
1531
  const toggleMenu = (menuId, level) => {
1510
1532
  if (closeTimeoutRef.current) {
@@ -1544,7 +1566,7 @@ function useSubMenuSystem(mobilePositionTo) {
1544
1566
  return newActiveMenus;
1545
1567
  });
1546
1568
  };
1547
- const executePendingActions = (0, import_react8.useCallback)(() => {
1569
+ const executePendingActions = (0, import_react9.useCallback)(() => {
1548
1570
  if (pendingCloseActionRef.current) {
1549
1571
  pendingCloseActionRef.current();
1550
1572
  pendingCloseActionRef.current = null;
@@ -1633,7 +1655,7 @@ function useSubMenuSystem(mobilePositionTo) {
1633
1655
  const isMenuActive = (menuId, level) => {
1634
1656
  return activeMenus[level] === menuId;
1635
1657
  };
1636
- (0, import_react8.useEffect)(() => {
1658
+ (0, import_react9.useEffect)(() => {
1637
1659
  const handleClickOutside = (event) => {
1638
1660
  var _a;
1639
1661
  if (Object.keys(activeMenus).length === 0) return;
@@ -1652,7 +1674,7 @@ function useSubMenuSystem(mobilePositionTo) {
1652
1674
  document.removeEventListener("mousedown", handleClickOutside);
1653
1675
  };
1654
1676
  }, [activeMenus]);
1655
- (0, import_react8.useEffect)(() => {
1677
+ (0, import_react9.useEffect)(() => {
1656
1678
  return () => {
1657
1679
  if (hoverTimeoutRef.current) {
1658
1680
  clearTimeout(hoverTimeoutRef.current);
@@ -1730,13 +1752,13 @@ function useSubMenuSystem(mobilePositionTo) {
1730
1752
  };
1731
1753
  }
1732
1754
  function useMenuPosition(elementRef, position = "bottom", options) {
1733
- const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
1755
+ const [menuPosition, setMenuPosition] = (0, import_react9.useState)({
1734
1756
  top: 0,
1735
1757
  left: 0,
1736
1758
  minWidth: 0
1737
1759
  });
1738
1760
  const isMobile = options == null ? void 0 : options.isMobile;
1739
- const updatePosition = (0, import_react8.useCallback)(() => {
1761
+ const updatePosition = (0, import_react9.useCallback)(() => {
1740
1762
  var _a, _b, _c;
1741
1763
  if (!(elementRef == null ? void 0 : elementRef.current)) return;
1742
1764
  const triggerRect = elementRef.current.getBoundingClientRect();
@@ -1784,7 +1806,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
1784
1806
  minWidth: triggerRect.width
1785
1807
  });
1786
1808
  }, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
1787
- (0, import_react8.useEffect)(() => {
1809
+ (0, import_react9.useEffect)(() => {
1788
1810
  if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
1789
1811
  const handleClickOutside = (event) => {
1790
1812
  var _a, _b, _c, _d, _e;
@@ -1810,7 +1832,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
1810
1832
  options == null ? void 0 : options.menuRef,
1811
1833
  options == null ? void 0 : options.additionalRefs
1812
1834
  ]);
1813
- (0, import_react8.useEffect)(() => {
1835
+ (0, import_react9.useEffect)(() => {
1814
1836
  updatePosition();
1815
1837
  const resizeObserver = new ResizeObserver(updatePosition);
1816
1838
  if (elementRef == null ? void 0 : elementRef.current) {
@@ -1891,9 +1913,9 @@ var Menu = (_a) => {
1891
1913
  "menuName",
1892
1914
  "calculateMinMaxHeight"
1893
1915
  ]);
1894
- const internalRef = (0, import_react9.useRef)(null);
1916
+ const internalRef = (0, import_react10.useRef)(null);
1895
1917
  const actualRef = ref || internalRef;
1896
- const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
1918
+ const [maxHeight, setMaxHeight] = (0, import_react10.useState)("180px");
1897
1919
  const isMobile = useMatchesMobile();
1898
1920
  const { menuPosition, updatePosition } = useMenuPosition(
1899
1921
  isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
@@ -1906,7 +1928,7 @@ var Menu = (_a) => {
1906
1928
  isMobile: !!(isMobile && mobilePositionTo)
1907
1929
  }
1908
1930
  );
1909
- (0, import_react9.useEffect)(() => {
1931
+ (0, import_react10.useEffect)(() => {
1910
1932
  if (calculateMinMaxHeight) {
1911
1933
  return;
1912
1934
  }
@@ -1930,7 +1952,7 @@ var Menu = (_a) => {
1930
1952
  cancelAnimationFrame(raf);
1931
1953
  };
1932
1954
  }, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
1933
- (0, import_react9.useEffect)(() => {
1955
+ (0, import_react10.useEffect)(() => {
1934
1956
  if (!calculateMinMaxHeight) {
1935
1957
  return;
1936
1958
  }
@@ -1941,14 +1963,14 @@ var Menu = (_a) => {
1941
1963
  setMaxHeight(`${calculatedMaxHeight}px`);
1942
1964
  }
1943
1965
  }, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
1944
- (0, import_react9.useEffect)(() => {
1966
+ (0, import_react10.useEffect)(() => {
1945
1967
  if (!show) {
1946
1968
  return;
1947
1969
  }
1948
1970
  initializeMenuFocus();
1949
1971
  updatePosition();
1950
1972
  }, [show, updatePosition]);
1951
- (0, import_react9.useEffect)(() => {
1973
+ (0, import_react10.useEffect)(() => {
1952
1974
  if (!show || !setShow) {
1953
1975
  return;
1954
1976
  }
@@ -2102,7 +2124,7 @@ var Menu = (_a) => {
2102
2124
  Menu.displayName = "Menu";
2103
2125
 
2104
2126
  // src/components/Search.tsx
2105
- var import_react10 = require("react");
2127
+ var import_react11 = require("react");
2106
2128
  var import_jsx_runtime8 = require("react/jsx-runtime");
2107
2129
  var Search = (_a) => {
2108
2130
  var _b = _a, {
@@ -2130,14 +2152,14 @@ var Search = (_a) => {
2130
2152
  "removeRoundness",
2131
2153
  "autocompletePadding"
2132
2154
  ]);
2133
- const inputRef = (0, import_react10.useRef)(null);
2134
- const inputContainerRef = (0, import_react10.useRef)(null);
2135
- const preventFocusOnInitialRender = (0, import_react10.useRef)(true);
2136
- const [show, setShow] = (0, import_react10.useState)(false);
2137
- const [clearing, setClearing] = (0, import_react10.useState)(false);
2138
- const uniqueId = (0, import_react10.useId)();
2155
+ const inputRef = (0, import_react11.useRef)(null);
2156
+ const inputContainerRef = (0, import_react11.useRef)(null);
2157
+ const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
2158
+ const [show, setShow] = (0, import_react11.useState)(false);
2159
+ const [clearing, setClearing] = (0, import_react11.useState)(false);
2160
+ const uniqueId = (0, import_react11.useId)();
2139
2161
  const searchMenuName = `search-menu-${uniqueId}`;
2140
- (0, import_react10.useEffect)(() => {
2162
+ (0, import_react11.useEffect)(() => {
2141
2163
  var _a2;
2142
2164
  if (preventFocusOnInitialRender.current) {
2143
2165
  preventFocusOnInitialRender.current = false;
@@ -2221,7 +2243,7 @@ Search.displayName = "Search";
2221
2243
 
2222
2244
  // src/components/DataGridCell.tsx
2223
2245
  var import_jsx_runtime9 = require("react/jsx-runtime");
2224
- var DataGridCell = (0, import_react11.memo)(
2246
+ var DataGridCell = (0, import_react12.memo)(
2225
2247
  (_a) => {
2226
2248
  var _b = _a, {
2227
2249
  id,
@@ -2263,10 +2285,10 @@ var DataGridCell = (0, import_react11.memo)(
2263
2285
  "testid"
2264
2286
  ]);
2265
2287
  const Element = type === "header" ? "th" : "td";
2266
- const timerRef = (0, import_react11.useRef)(null);
2267
- const [isGrabbing, setIsGrabbing] = (0, import_react11.useState)(false);
2268
- const [isPointerPressed, setIsPointerPressed] = (0, import_react11.useState)(false);
2269
- (0, import_react11.useEffect)(() => {
2288
+ const timerRef = (0, import_react12.useRef)(null);
2289
+ const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
2290
+ const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
2291
+ (0, import_react12.useEffect)(() => {
2270
2292
  return () => {
2271
2293
  if (timerRef.current) {
2272
2294
  clearTimeout(timerRef.current);
@@ -2376,12 +2398,12 @@ function DataCellHeader(_a) {
2376
2398
  "useMenuDefaultMinWidth"
2377
2399
  ]);
2378
2400
  var _a2;
2379
- const [showMenu, setShowMenu] = (0, import_react11.useState)(false);
2380
- const [filter, setFilter] = (0, import_react11.useState)(
2401
+ const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
2402
+ const [filter, setFilter] = (0, import_react12.useState)(
2381
2403
  (_a2 = header.column.getFilterValue()) != null ? _a2 : ""
2382
2404
  );
2383
- const ref = (0, import_react11.useRef)(null);
2384
- const predeterminedPinned = (0, import_react11.useRef)(false);
2405
+ const ref = (0, import_react12.useRef)(null);
2406
+ const predeterminedPinned = (0, import_react12.useRef)(false);
2385
2407
  const { column, getContext } = header;
2386
2408
  const { id: columnId, setFilterValue } = column;
2387
2409
  const {
@@ -2391,14 +2413,14 @@ function DataCellHeader(_a) {
2391
2413
  listeners: subMenuListeners,
2392
2414
  mobileHide
2393
2415
  } = useSubMenuSystem(node ? node : ref);
2394
- (0, import_react11.useEffect)(() => {
2416
+ (0, import_react12.useEffect)(() => {
2395
2417
  var _a3, _b2, _c;
2396
2418
  const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
2397
2419
  const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
2398
2420
  const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
2399
2421
  predeterminedPinned.current = [...left, ...right].includes(columnId);
2400
2422
  }, [columnId, getContext]);
2401
- (0, import_react11.useEffect)(() => {
2423
+ (0, import_react12.useEffect)(() => {
2402
2424
  const handler = setTimeout(() => {
2403
2425
  setFilterValue(filter);
2404
2426
  }, 500);
@@ -2661,7 +2683,7 @@ function DragAlongCell(_a) {
2661
2683
  DragAlongCell.displayName = "DragAlongCell";
2662
2684
 
2663
2685
  // src/components/DataGrid/index.tsx
2664
- var import_react16 = __toESM(require("react"), 1);
2686
+ var import_react17 = __toESM(require("react"), 1);
2665
2687
  var import_react_table3 = require("@tanstack/react-table");
2666
2688
  var import_core = require("@dnd-kit/core");
2667
2689
  var import_sortable2 = require("@dnd-kit/sortable");
@@ -2689,7 +2711,7 @@ function getSortIcon(sort, nextSort = false) {
2689
2711
  }
2690
2712
 
2691
2713
  // src/components/DataGrid/PinnedColumns.tsx
2692
- var import_react15 = __toESM(require("react"), 1);
2714
+ var import_react16 = __toESM(require("react"), 1);
2693
2715
 
2694
2716
  // src/components/DataGrid/TableBody/index.tsx
2695
2717
  var import_react_virtual = require("@tanstack/react-virtual");
@@ -2698,7 +2720,7 @@ var import_clsx12 = __toESM(require("clsx"), 1);
2698
2720
  // src/components/DataGrid/TableBody/TableBodyRow.tsx
2699
2721
  var import_clsx11 = __toESM(require("clsx"), 1);
2700
2722
  var import_react_table = require("@tanstack/react-table");
2701
- var import_react12 = __toESM(require("react"), 1);
2723
+ var import_react13 = __toESM(require("react"), 1);
2702
2724
  var import_jsx_runtime11 = require("react/jsx-runtime");
2703
2725
  var valueFormatters = {
2704
2726
  date: (value) => typeof value === "string" ? formatDate(value) : "",
@@ -2766,7 +2788,7 @@ function TableBodyRow({
2766
2788
  const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
2767
2789
  const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
2768
2790
  const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
2769
- return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react12.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2791
+ 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)(
2770
2792
  CellElement,
2771
2793
  {
2772
2794
  id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
@@ -2980,10 +3002,10 @@ function TableBody({
2980
3002
  }
2981
3003
 
2982
3004
  // src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
2983
- var import_react14 = require("react");
3005
+ var import_react15 = require("react");
2984
3006
 
2985
3007
  // src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
2986
- var import_react13 = require("react");
3008
+ var import_react14 = require("react");
2987
3009
  var import_jsx_runtime14 = require("react/jsx-runtime");
2988
3010
  function ColumnSelectorMenuOption({
2989
3011
  id,
@@ -2991,7 +3013,7 @@ function ColumnSelectorMenuOption({
2991
3013
  column,
2992
3014
  toggleColumnVisibility
2993
3015
  }) {
2994
- const [isVisible, setIsVisible] = (0, import_react13.useState)(column.getIsVisible());
3016
+ const [isVisible, setIsVisible] = (0, import_react14.useState)(column.getIsVisible());
2995
3017
  const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
2996
3018
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2997
3019
  Checkbox,
@@ -3017,8 +3039,8 @@ function ColumnSelectorHeaderCell({
3017
3039
  toggleColumnVisibility,
3018
3040
  resetColumnVisibility
3019
3041
  }) {
3020
- const ref = (0, import_react14.useRef)(null);
3021
- const [show, setShow] = (0, import_react14.useState)(false);
3042
+ const ref = (0, import_react15.useRef)(null);
3043
+ const [show, setShow] = (0, import_react15.useState)(false);
3022
3044
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
3023
3045
  DataGridCell,
3024
3046
  {
@@ -3187,7 +3209,7 @@ function PinnedColumns(_a) {
3187
3209
  header.id
3188
3210
  );
3189
3211
  }
3190
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react15.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)(
3212
+ 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)(
3191
3213
  Checkbox,
3192
3214
  {
3193
3215
  checked: allSelectedAcrossPages,
@@ -3269,23 +3291,23 @@ function DataGrid({
3269
3291
  ref
3270
3292
  }) {
3271
3293
  var _a, _b, _c, _d, _e, _f, _g;
3272
- (0, import_react16.useImperativeHandle)(ref, () => ({
3294
+ (0, import_react17.useImperativeHandle)(ref, () => ({
3273
3295
  getSavedLayout: () => {
3274
3296
  return getSavedLayout();
3275
3297
  }
3276
3298
  }));
3277
- const [localSorting, setLocalSorting] = (0, import_react16.useState)([]);
3278
- const [localColumnFilters, setLocalColumnFilters] = (0, import_react16.useState)([]);
3279
- const [localRowSelection, setLocalRowSelection] = (0, import_react16.useState)({});
3299
+ const [localSorting, setLocalSorting] = (0, import_react17.useState)([]);
3300
+ const [localColumnFilters, setLocalColumnFilters] = (0, import_react17.useState)([]);
3301
+ const [localRowSelection, setLocalRowSelection] = (0, import_react17.useState)({});
3280
3302
  const {
3281
3303
  columns: tableColumns,
3282
3304
  setColumns: setTableColumns,
3283
3305
  getSavedLayout
3284
3306
  } = useTableLayout(columns, id != null ? id : testid);
3285
- const [columnOrder, setColumnOrder] = (0, import_react16.useState)(
3307
+ const [columnOrder, setColumnOrder] = (0, import_react17.useState)(
3286
3308
  tableColumns.map((c) => c.id)
3287
3309
  );
3288
- const [columnVisibility, setColumnVisibility] = (0, import_react16.useState)(
3310
+ const [columnVisibility, setColumnVisibility] = (0, import_react17.useState)(
3289
3311
  Object.fromEntries(
3290
3312
  tableColumns.filter((column) => !!column.id).map((column) => {
3291
3313
  var _a2, _b2;
@@ -3293,7 +3315,7 @@ function DataGrid({
3293
3315
  })
3294
3316
  )
3295
3317
  );
3296
- const updateColumnVisibility = (0, import_react16.useCallback)(
3318
+ const updateColumnVisibility = (0, import_react17.useCallback)(
3297
3319
  (updateOrder) => {
3298
3320
  setColumnVisibility(
3299
3321
  Object.fromEntries(
@@ -3307,7 +3329,7 @@ function DataGrid({
3307
3329
  },
3308
3330
  [tableColumns]
3309
3331
  );
3310
- const resetDefaultColumnVisibility = (0, import_react16.useCallback)(() => {
3332
+ const resetDefaultColumnVisibility = (0, import_react17.useCallback)(() => {
3311
3333
  setTableColumns((prev) => {
3312
3334
  columns.forEach((column) => {
3313
3335
  var _a2, _b2;
@@ -3323,7 +3345,7 @@ function DataGrid({
3323
3345
  return [...prev];
3324
3346
  }, true);
3325
3347
  }, [columns, setTableColumns]);
3326
- (0, import_react16.useEffect)(() => {
3348
+ (0, import_react17.useEffect)(() => {
3327
3349
  updateColumnVisibility(true);
3328
3350
  }, [updateColumnVisibility]);
3329
3351
  const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
@@ -3339,7 +3361,7 @@ function DataGrid({
3339
3361
  (onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
3340
3362
  } : setLocalColumnFilters;
3341
3363
  const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
3342
- const setRowSelection = (0, import_react16.useCallback)(
3364
+ const setRowSelection = (0, import_react17.useCallback)(
3343
3365
  (updaterOrValue) => {
3344
3366
  if (pagination) {
3345
3367
  const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
@@ -3353,9 +3375,9 @@ function DataGrid({
3353
3375
  },
3354
3376
  [externalRowSelection, onRowSelectionChange, pagination]
3355
3377
  );
3356
- const dndId = (0, import_react16.useId)();
3357
- const containerRef = import_react16.default.useRef(null);
3358
- const toggleColumnVisibility = (0, import_react16.useCallback)(
3378
+ const dndId = (0, import_react17.useId)();
3379
+ const containerRef = import_react17.default.useRef(null);
3380
+ const toggleColumnVisibility = (0, import_react17.useCallback)(
3359
3381
  (columnId, isVisible) => {
3360
3382
  setTableColumns((prev) => {
3361
3383
  const persistedIndex = prev.findIndex((col) => col.id === columnId);
@@ -3603,7 +3625,7 @@ function DataGrid({
3603
3625
  header.id
3604
3626
  );
3605
3627
  }
3606
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react16.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3628
+ 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)(
3607
3629
  DataGridCell,
3608
3630
  {
3609
3631
  id: id ? `${id}-header-${header.id}` : void 0,
@@ -3809,7 +3831,7 @@ function adaptTableStateSetter(setter) {
3809
3831
  }
3810
3832
 
3811
3833
  // src/components/Select.tsx
3812
- var import_react17 = require("react");
3834
+ var import_react18 = require("react");
3813
3835
  var import_clsx15 = __toESM(require("clsx"), 1);
3814
3836
  var import_jsx_runtime18 = require("react/jsx-runtime");
3815
3837
  var Select = (_a) => {
@@ -3843,11 +3865,11 @@ var Select = (_a) => {
3843
3865
  "value"
3844
3866
  ]);
3845
3867
  var _a2;
3846
- const inputRef = (0, import_react17.useRef)(null);
3847
- const inputContainerRef = (0, import_react17.useRef)(null);
3848
- const preventFocusOnInitialRender = (0, import_react17.useRef)(true);
3849
- const [show, setShow] = (0, import_react17.useState)(false);
3850
- (0, import_react17.useEffect)(() => {
3868
+ const inputRef = (0, import_react18.useRef)(null);
3869
+ const inputContainerRef = (0, import_react18.useRef)(null);
3870
+ const preventFocusOnInitialRender = (0, import_react18.useRef)(true);
3871
+ const [show, setShow] = (0, import_react18.useState)(false);
3872
+ (0, import_react18.useEffect)(() => {
3851
3873
  var _a3;
3852
3874
  if (preventFocusOnInitialRender.current) {
3853
3875
  preventFocusOnInitialRender.current = false;
@@ -4269,7 +4291,7 @@ Button.displayName = "Button";
4269
4291
 
4270
4292
  // src/components/Tooltip.tsx
4271
4293
  var import_clsx19 = __toESM(require("clsx"), 1);
4272
- var import_react18 = require("react");
4294
+ var import_react19 = require("react");
4273
4295
  var import_react_dom2 = require("react-dom");
4274
4296
  var import_jsx_runtime23 = require("react/jsx-runtime");
4275
4297
  var Tooltip = ({
@@ -4282,11 +4304,11 @@ var Tooltip = ({
4282
4304
  offset = 8,
4283
4305
  keepHidden = false
4284
4306
  }) => {
4285
- const ref = (0, import_react18.useRef)(null);
4286
- const tooltipRef = (0, import_react18.useRef)(null);
4287
- const [tooltipPosition, setTooltipPosition] = (0, import_react18.useState)({ top: 0, left: 0 });
4288
- const [isVisible, setIsVisible] = (0, import_react18.useState)(false);
4289
- const [removeOpacity, setRemoveOpacity] = (0, import_react18.useState)(false);
4307
+ const ref = (0, import_react19.useRef)(null);
4308
+ const tooltipRef = (0, import_react19.useRef)(null);
4309
+ const [tooltipPosition, setTooltipPosition] = (0, import_react19.useState)({ top: 0, left: 0 });
4310
+ const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
4311
+ const [removeOpacity, setRemoveOpacity] = (0, import_react19.useState)(false);
4290
4312
  const updatePosition = () => {
4291
4313
  if (!ref.current || !tooltipRef.current) return;
4292
4314
  const rect = ref.current.getBoundingClientRect();
@@ -4325,14 +4347,14 @@ var Tooltip = ({
4325
4347
  setIsVisible(false);
4326
4348
  setRemoveOpacity(false);
4327
4349
  };
4328
- (0, import_react18.useEffect)(() => {
4350
+ (0, import_react19.useEffect)(() => {
4329
4351
  if (isVisible && tooltipRef.current) {
4330
4352
  requestAnimationFrame(() => {
4331
4353
  updatePosition();
4332
4354
  });
4333
4355
  }
4334
4356
  }, [isVisible]);
4335
- (0, import_react18.useEffect)(() => {
4357
+ (0, import_react19.useEffect)(() => {
4336
4358
  if (isVisible) {
4337
4359
  window.addEventListener("resize", updatePosition);
4338
4360
  return () => window.removeEventListener("resize", updatePosition);
@@ -4390,7 +4412,7 @@ var Tooltip = ({
4390
4412
  Tooltip.displayName = "Tooltip";
4391
4413
 
4392
4414
  // src/components/DateInput.tsx
4393
- var import_react19 = require("react");
4415
+ var import_react20 = require("react");
4394
4416
  var import_react_dom3 = require("react-dom");
4395
4417
  var import_jsx_runtime24 = require("react/jsx-runtime");
4396
4418
  var DateInput = (_a) => {
@@ -4415,24 +4437,24 @@ var DateInput = (_a) => {
4415
4437
  "label",
4416
4438
  "isDateAvailable"
4417
4439
  ]);
4418
- const [visible, setVisible] = (0, import_react19.useState)(false);
4419
- const [inputValue, setInputValue] = (0, import_react19.useState)("");
4420
- const [isTyping, setIsTyping] = (0, import_react19.useState)(false);
4421
- const popoverRef = (0, import_react19.useRef)(null);
4422
- const triggerRef = (0, import_react19.useRef)(null);
4423
- const rootRef = (0, import_react19.useRef)(null);
4424
- const [calendarPosition, setCalendarPosition] = (0, import_react19.useState)({
4440
+ const [visible, setVisible] = (0, import_react20.useState)(false);
4441
+ const [inputValue, setInputValue] = (0, import_react20.useState)("");
4442
+ const [isTyping, setIsTyping] = (0, import_react20.useState)(false);
4443
+ const popoverRef = (0, import_react20.useRef)(null);
4444
+ const triggerRef = (0, import_react20.useRef)(null);
4445
+ const rootRef = (0, import_react20.useRef)(null);
4446
+ const [calendarPosition, setCalendarPosition] = (0, import_react20.useState)({
4425
4447
  top: 0,
4426
4448
  left: 0,
4427
4449
  width: 0
4428
4450
  });
4429
4451
  const [from, to] = [value, ""];
4430
- (0, import_react19.useEffect)(() => {
4452
+ (0, import_react20.useEffect)(() => {
4431
4453
  if (!isTyping) {
4432
4454
  setInputValue(formatDisplayValue(from));
4433
4455
  }
4434
4456
  }, [from, isTyping]);
4435
- (0, import_react19.useLayoutEffect)(() => {
4457
+ (0, import_react20.useLayoutEffect)(() => {
4436
4458
  if (visible) {
4437
4459
  updatePosition();
4438
4460
  }
@@ -4447,7 +4469,7 @@ var DateInput = (_a) => {
4447
4469
  });
4448
4470
  }
4449
4471
  };
4450
- (0, import_react19.useEffect)(() => {
4472
+ (0, import_react20.useEffect)(() => {
4451
4473
  updatePosition();
4452
4474
  const resizeObserver = new ResizeObserver(updatePosition);
4453
4475
  if (triggerRef.current) {
@@ -4459,7 +4481,7 @@ var DateInput = (_a) => {
4459
4481
  window.removeEventListener("scroll", updatePosition);
4460
4482
  };
4461
4483
  }, []);
4462
- (0, import_react19.useEffect)(() => {
4484
+ (0, import_react20.useEffect)(() => {
4463
4485
  const handleKeyDown2 = (event) => {
4464
4486
  var _a2;
4465
4487
  if (event.key === "Escape" && popoverRef.current) {
@@ -4472,7 +4494,7 @@ var DateInput = (_a) => {
4472
4494
  document.removeEventListener("keydown", handleKeyDown2);
4473
4495
  };
4474
4496
  });
4475
- (0, import_react19.useEffect)(() => {
4497
+ (0, import_react20.useEffect)(() => {
4476
4498
  const handleClickOutside = (event) => {
4477
4499
  if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
4478
4500
  setVisible(false);
@@ -4693,14 +4715,14 @@ Heading3.displayName = "Heading3";
4693
4715
  var import_jsx_runtime29 = require("react/jsx-runtime");
4694
4716
 
4695
4717
  // src/components/MobileDataGrid/ColumnSelector/index.tsx
4696
- var import_react22 = require("react");
4718
+ var import_react23 = require("react");
4697
4719
 
4698
4720
  // src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
4699
- var import_react21 = require("react");
4721
+ var import_react22 = require("react");
4700
4722
 
4701
4723
  // src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
4702
- var import_react20 = require("react");
4703
- var GridContext = (0, import_react20.createContext)(null);
4724
+ var import_react21 = require("react");
4725
+ var GridContext = (0, import_react21.createContext)(null);
4704
4726
 
4705
4727
  // src/components/MobileDataGrid/ColumnSelector/index.tsx
4706
4728
  var import_jsx_runtime30 = require("react/jsx-runtime");
@@ -4709,12 +4731,12 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
4709
4731
  var import_jsx_runtime31 = require("react/jsx-runtime");
4710
4732
 
4711
4733
  // src/components/MobileDataGrid/GridContextProvider/index.tsx
4712
- var import_react23 = require("react");
4734
+ var import_react24 = require("react");
4713
4735
  var import_jsx_runtime32 = require("react/jsx-runtime");
4714
4736
 
4715
4737
  // src/components/Modal.tsx
4716
4738
  var import_clsx28 = __toESM(require("clsx"), 1);
4717
- var import_react25 = require("react");
4739
+ var import_react26 = require("react");
4718
4740
 
4719
4741
  // src/components/ModalHeader.tsx
4720
4742
  var import_clsx24 = __toESM(require("clsx"), 1);
@@ -4890,10 +4912,10 @@ var import_react_dom4 = require("react-dom");
4890
4912
  var import_react_use = require("react-use");
4891
4913
 
4892
4914
  // src/components/useMounted.tsx
4893
- var import_react24 = require("react");
4915
+ var import_react25 = require("react");
4894
4916
  var useMounted = () => {
4895
- const [isMounted, setIsMounted] = (0, import_react24.useState)(false);
4896
- (0, import_react24.useEffect)(() => {
4917
+ const [isMounted, setIsMounted] = (0, import_react25.useState)(false);
4918
+ (0, import_react25.useEffect)(() => {
4897
4919
  setIsMounted(true);
4898
4920
  return () => setIsMounted(false);
4899
4921
  }, []);
@@ -4987,12 +5009,12 @@ var Modal = ({
4987
5009
  }) => {
4988
5010
  var _a;
4989
5011
  const mounted = useMounted();
4990
- const modalRef = (0, import_react25.useRef)(null);
4991
- const bgRef = (0, import_react25.useRef)(null);
5012
+ const modalRef = (0, import_react26.useRef)(null);
5013
+ const bgRef = (0, import_react26.useRef)(null);
4992
5014
  const wasOpen = (0, import_react_use.usePrevious)(open);
4993
5015
  const isMobile = useMatchesMobile();
4994
5016
  const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
4995
- (0, import_react25.useEffect)(() => {
5017
+ (0, import_react26.useEffect)(() => {
4996
5018
  if (!mounted) return;
4997
5019
  if (!modalRef.current || !bgRef.current) {
4998
5020
  console.error("Modal or background reference is not set.");
@@ -5012,7 +5034,7 @@ var Modal = ({
5012
5034
  bgFadeIn(bgRef.current);
5013
5035
  }
5014
5036
  }, [mounted, onClose, open, wasOpen]);
5015
- const handleKeyDown = (0, import_react25.useCallback)(
5037
+ const handleKeyDown = (0, import_react26.useCallback)(
5016
5038
  (e) => {
5017
5039
  if (e.key === "Escape") {
5018
5040
  if (onClose) {
@@ -5023,12 +5045,12 @@ var Modal = ({
5023
5045
  },
5024
5046
  [onClose]
5025
5047
  );
5026
- const handleClose = (0, import_react25.useCallback)(() => {
5048
+ const handleClose = (0, import_react26.useCallback)(() => {
5027
5049
  if (onClose) {
5028
5050
  onClose();
5029
5051
  }
5030
5052
  }, [onClose]);
5031
- (0, import_react25.useEffect)(() => {
5053
+ (0, import_react26.useEffect)(() => {
5032
5054
  if (open) {
5033
5055
  document.addEventListener("keyup", handleKeyDown);
5034
5056
  }
@@ -5036,7 +5058,7 @@ var Modal = ({
5036
5058
  document.removeEventListener("keyup", handleKeyDown);
5037
5059
  };
5038
5060
  }, [open, handleKeyDown]);
5039
- (0, import_react25.useEffect)(() => {
5061
+ (0, import_react26.useEffect)(() => {
5040
5062
  if (!open) return;
5041
5063
  const scrollY = window.scrollY;
5042
5064
  const body = document.body;
@@ -5057,7 +5079,7 @@ var Modal = ({
5057
5079
  };
5058
5080
  }, [open]);
5059
5081
  const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
5060
- const backgroundClickHandler = (0, import_react25.useCallback)(
5082
+ const backgroundClickHandler = (0, import_react26.useCallback)(
5061
5083
  (e) => {
5062
5084
  const target = e.target;
5063
5085
  const currentTarget = e.currentTarget;
@@ -5166,10 +5188,10 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
5166
5188
  var import_jsx_runtime43 = require("react/jsx-runtime");
5167
5189
 
5168
5190
  // src/components/ProductImagePreview/Thumbnail.tsx
5169
- var import_react27 = require("react");
5191
+ var import_react28 = require("react");
5170
5192
 
5171
5193
  // src/components/ImagePlaceholder.tsx
5172
- var import_react26 = require("react");
5194
+ var import_react27 = require("react");
5173
5195
  var import_jsx_runtime44 = require("react/jsx-runtime");
5174
5196
 
5175
5197
  // src/components/ProductImagePreview/Thumbnail.tsx
@@ -5180,11 +5202,11 @@ var import_clsx31 = __toESM(require("clsx"), 1);
5180
5202
  var import_jsx_runtime46 = require("react/jsx-runtime");
5181
5203
 
5182
5204
  // src/components/ProductImagePreview/ProductPrimaryImage.tsx
5183
- var import_react28 = require("react");
5205
+ var import_react29 = require("react");
5184
5206
  var import_jsx_runtime47 = require("react/jsx-runtime");
5185
5207
 
5186
5208
  // src/components/ProductImagePreview/ZoomWindow.tsx
5187
- var import_react29 = require("react");
5209
+ var import_react30 = require("react");
5188
5210
 
5189
5211
  // src/components/Surface.tsx
5190
5212
  var import_clsx32 = __toESM(require("clsx"), 1);
@@ -5229,17 +5251,17 @@ var import_clsx33 = require("clsx");
5229
5251
  var import_jsx_runtime50 = require("react/jsx-runtime");
5230
5252
 
5231
5253
  // src/components/ProductImagePreview/MobileImageCarousel.tsx
5232
- var import_react30 = require("react");
5254
+ var import_react31 = require("react");
5233
5255
  var import_jsx_runtime51 = require("react/jsx-runtime");
5234
5256
 
5235
5257
  // src/components/ProductImagePreview/useProductImagePreview.ts
5236
- var import_react31 = require("react");
5258
+ var import_react32 = require("react");
5237
5259
 
5238
5260
  // src/components/ProductImagePreview/index.tsx
5239
5261
  var import_jsx_runtime52 = require("react/jsx-runtime");
5240
5262
 
5241
5263
  // src/components/CompactImagesPreview.tsx
5242
- var import_react32 = require("react");
5264
+ var import_react33 = require("react");
5243
5265
  var import_clsx34 = __toESM(require("clsx"), 1);
5244
5266
  var import_jsx_runtime53 = require("react/jsx-runtime");
5245
5267
 
@@ -5248,12 +5270,12 @@ var import_clsx35 = __toESM(require("clsx"), 1);
5248
5270
  var import_jsx_runtime54 = require("react/jsx-runtime");
5249
5271
 
5250
5272
  // src/components/ListGroup.tsx
5251
- var import_react33 = require("react");
5273
+ var import_react34 = require("react");
5252
5274
  var import_clsx36 = __toESM(require("clsx"), 1);
5253
5275
  var import_jsx_runtime55 = require("react/jsx-runtime");
5254
5276
 
5255
5277
  // src/components/Pagination.tsx
5256
- var import_react34 = require("react");
5278
+ var import_react35 = require("react");
5257
5279
  var import_clsx37 = __toESM(require("clsx"), 1);
5258
5280
  var import_jsx_runtime56 = require("react/jsx-runtime");
5259
5281
  var Pagination = ({
@@ -5265,7 +5287,7 @@ var Pagination = ({
5265
5287
  className,
5266
5288
  disabled
5267
5289
  }) => {
5268
- const goTo = (0, import_react34.useCallback)(
5290
+ const goTo = (0, import_react35.useCallback)(
5269
5291
  (page) => {
5270
5292
  if (disabled) return;
5271
5293
  onPageChange(page);
@@ -5282,7 +5304,7 @@ var Pagination = ({
5282
5304
  goTo(currentPage + 1);
5283
5305
  }
5284
5306
  };
5285
- const pageTokens = (0, import_react34.useMemo)(() => {
5307
+ const pageTokens = (0, import_react35.useMemo)(() => {
5286
5308
  if (totalPages <= 5) {
5287
5309
  return Array.from({ length: totalPages }, (_, i) => i + 1);
5288
5310
  }
@@ -5405,21 +5427,21 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
5405
5427
  var import_jsx_runtime58 = require("react/jsx-runtime");
5406
5428
 
5407
5429
  // src/components/SearchResultImage/index.tsx
5408
- var import_react35 = require("react");
5430
+ var import_react36 = require("react");
5409
5431
  var import_jsx_runtime59 = require("react/jsx-runtime");
5410
5432
 
5411
5433
  // src/components/Alert.tsx
5412
5434
  var import_clsx38 = __toESM(require("clsx"), 1);
5413
- var import_react36 = require("react");
5435
+ var import_react37 = require("react");
5414
5436
  var import_jsx_runtime60 = require("react/jsx-runtime");
5415
5437
 
5416
5438
  // src/components/OrderCheckIcon.tsx
5417
5439
  var import_jsx_runtime61 = require("react/jsx-runtime");
5418
5440
 
5419
5441
  // src/components/EditingContext.tsx
5420
- var import_react37 = require("react");
5442
+ var import_react38 = require("react");
5421
5443
  var import_jsx_runtime62 = require("react/jsx-runtime");
5422
- var EditingContext = (0, import_react37.createContext)(null);
5444
+ var EditingContext = (0, import_react38.createContext)(null);
5423
5445
 
5424
5446
  // src/components/AccessCard.tsx
5425
5447
  var import_clsx40 = __toESM(require("clsx"), 1);
@@ -5553,7 +5575,7 @@ var import_jsx_runtime64 = require("react/jsx-runtime");
5553
5575
 
5554
5576
  // src/components/AccessCardGroup.tsx
5555
5577
  var import_clsx41 = __toESM(require("clsx"), 1);
5556
- var import_react38 = require("react");
5578
+ var import_react39 = require("react");
5557
5579
  var import_jsx_runtime65 = require("react/jsx-runtime");
5558
5580
 
5559
5581
  // src/components/CalendarRange.tsx
@@ -5668,20 +5690,20 @@ function CalendarRange({
5668
5690
  const fromDate = parseDate(from);
5669
5691
  const toDate = parseDate(to);
5670
5692
  const today = import_polyfill.Temporal.Now.plainDateISO();
5671
- const [baseMonth, setBaseMonth] = (0, import_react39.useState)(
5693
+ const [baseMonth, setBaseMonth] = (0, import_react40.useState)(
5672
5694
  fromDate != null ? fromDate : today.with({ day: 1 })
5673
5695
  );
5674
- const [selecting, setSelecting] = (0, import_react39.useState)("from");
5675
- const [pendingFrom, setPendingFrom] = (0, import_react39.useState)(void 0);
5676
- const [hoveredDate, setHoveredDate] = (0, import_react39.useState)(void 0);
5677
- (0, import_react39.useEffect)(() => {
5696
+ const [selecting, setSelecting] = (0, import_react40.useState)("from");
5697
+ const [pendingFrom, setPendingFrom] = (0, import_react40.useState)(void 0);
5698
+ const [hoveredDate, setHoveredDate] = (0, import_react40.useState)(void 0);
5699
+ (0, import_react40.useEffect)(() => {
5678
5700
  if (fromDate) {
5679
5701
  setBaseMonth(fromDate.with({ day: 1 }));
5680
5702
  } else if (toDate) {
5681
5703
  setBaseMonth(toDate.with({ day: 1 }));
5682
5704
  }
5683
5705
  }, [from, to]);
5684
- (0, import_react39.useEffect)(() => {
5706
+ (0, import_react40.useEffect)(() => {
5685
5707
  if (fromDate && toDate) {
5686
5708
  setSelecting("from");
5687
5709
  setPendingFrom(void 0);
@@ -5827,14 +5849,14 @@ function CalendarPane({
5827
5849
  const years = Array.from({ length: 100 }).map(
5828
5850
  (_, i) => baseMonth.year - 50 + i
5829
5851
  );
5830
- const [monthMenuOpen, setMonthMenuOpen] = (0, import_react39.useState)(false);
5831
- const [yearMenuOpen, setYearMenuOpen] = (0, import_react39.useState)(false);
5832
- const monthMenuRef = (0, import_react39.useRef)(null);
5833
- const yearMenuRef = (0, import_react39.useRef)(null);
5852
+ const [monthMenuOpen, setMonthMenuOpen] = (0, import_react40.useState)(false);
5853
+ const [yearMenuOpen, setYearMenuOpen] = (0, import_react40.useState)(false);
5854
+ const monthMenuRef = (0, import_react40.useRef)(null);
5855
+ const yearMenuRef = (0, import_react40.useRef)(null);
5834
5856
  const month = getMonthData(offset);
5835
5857
  const totalCells = 42;
5836
5858
  const emptyCells = month.firstDayOffset;
5837
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react39.default.Fragment, { children: [
5859
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react40.default.Fragment, { children: [
5838
5860
  /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
5839
5861
  "div",
5840
5862
  {
@@ -6048,19 +6070,19 @@ var DateRangeInput = (_a) => {
6048
6070
  "isDateAvailable",
6049
6071
  "onPendingFromChange"
6050
6072
  ]);
6051
- const [visible, setVisible] = (0, import_react40.useState)(false);
6052
- const [inputValue, setInputValue] = (0, import_react40.useState)("");
6053
- const [isTyping, setIsTyping] = (0, import_react40.useState)(false);
6054
- const popoverRef = (0, import_react40.useRef)(null);
6055
- const rootRef = (0, import_react40.useRef)(null);
6056
- const triggerRef = (0, import_react40.useRef)(null);
6057
- const [calendarPosition, setCalendarPosition] = (0, import_react40.useState)({
6073
+ const [visible, setVisible] = (0, import_react41.useState)(false);
6074
+ const [inputValue, setInputValue] = (0, import_react41.useState)("");
6075
+ const [isTyping, setIsTyping] = (0, import_react41.useState)(false);
6076
+ const popoverRef = (0, import_react41.useRef)(null);
6077
+ const rootRef = (0, import_react41.useRef)(null);
6078
+ const triggerRef = (0, import_react41.useRef)(null);
6079
+ const [calendarPosition, setCalendarPosition] = (0, import_react41.useState)({
6058
6080
  top: 0,
6059
6081
  left: 0,
6060
6082
  width: 0
6061
6083
  });
6062
6084
  const [from, to] = value.split("|");
6063
- (0, import_react40.useEffect)(() => {
6085
+ (0, import_react41.useEffect)(() => {
6064
6086
  if (!isTyping) {
6065
6087
  const displayValue = formatDisplayValue2(from, to);
6066
6088
  if (displayValue) {
@@ -6068,7 +6090,7 @@ var DateRangeInput = (_a) => {
6068
6090
  }
6069
6091
  }
6070
6092
  }, [from, to, isTyping, disableRange]);
6071
- (0, import_react40.useLayoutEffect)(() => {
6093
+ (0, import_react41.useLayoutEffect)(() => {
6072
6094
  if (visible) {
6073
6095
  updatePosition();
6074
6096
  }
@@ -6083,7 +6105,7 @@ var DateRangeInput = (_a) => {
6083
6105
  });
6084
6106
  }
6085
6107
  };
6086
- (0, import_react40.useEffect)(() => {
6108
+ (0, import_react41.useEffect)(() => {
6087
6109
  updatePosition();
6088
6110
  const resizeObserver = new ResizeObserver(updatePosition);
6089
6111
  if (triggerRef.current) {
@@ -6095,7 +6117,7 @@ var DateRangeInput = (_a) => {
6095
6117
  window.removeEventListener("scroll", updatePosition);
6096
6118
  };
6097
6119
  }, []);
6098
- (0, import_react40.useEffect)(() => {
6120
+ (0, import_react41.useEffect)(() => {
6099
6121
  const handleKeyDown2 = (event) => {
6100
6122
  var _a2;
6101
6123
  if (event.key === "Escape" && popoverRef.current) {
@@ -6108,7 +6130,7 @@ var DateRangeInput = (_a) => {
6108
6130
  document.removeEventListener("keydown", handleKeyDown2);
6109
6131
  };
6110
6132
  }, []);
6111
- (0, import_react40.useEffect)(() => {
6133
+ (0, import_react41.useEffect)(() => {
6112
6134
  const handleClickOutside = (event) => {
6113
6135
  if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
6114
6136
  setVisible(false);