@dmsi/wedgekit-react 0.0.461 → 0.0.462

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 (74) hide show
  1. package/dist/{chunk-WX62IDZ5.js → chunk-BFFNSUNS.js} +3 -3
  2. package/dist/{chunk-NVOZAVEX.js → chunk-DVU5XV7L.js} +23 -1
  3. package/dist/{chunk-I363QX6Y.js → chunk-DYBJUTGK.js} +1 -1
  4. package/dist/{chunk-BYRLHNBP.js → chunk-GTPSPGSJ.js} +6 -6
  5. package/dist/{chunk-DNUBM26R.js → chunk-IG2YUDHI.js} +1 -1
  6. package/dist/{chunk-SOZRGIQW.js → chunk-IPAKWF2V.js} +1 -1
  7. package/dist/{chunk-KCUB3UWA.js → chunk-NIWXVOBW.js} +1 -1
  8. package/dist/{chunk-UKSV4UHI.js → chunk-OEMLNGE2.js} +1 -1
  9. package/dist/{chunk-W53FKPJD.js → chunk-OZBB6RFM.js} +1 -1
  10. package/dist/{chunk-TYTD4FLW.js → chunk-R3EQIDBX.js} +5 -1
  11. package/dist/{chunk-22VBZWJG.js → chunk-TCMOGTPB.js} +2 -2
  12. package/dist/{chunk-MYKYZHEO.js → chunk-URYQ24NF.js} +3 -2
  13. package/dist/{chunk-LZH6DJEZ.js → chunk-X35NLL3N.js} +2 -2
  14. package/dist/components/CalendarRange.cjs +26 -1
  15. package/dist/components/CalendarRange.js +13 -13
  16. package/dist/components/CompactImagesPreview.cjs +4 -0
  17. package/dist/components/CompactImagesPreview.js +3 -3
  18. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +26 -1
  19. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +12 -12
  20. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +26 -1
  21. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +12 -12
  22. package/dist/components/DataGrid/PinnedColumns.cjs +26 -1
  23. package/dist/components/DataGrid/PinnedColumns.js +12 -12
  24. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +26 -1
  25. package/dist/components/DataGrid/TableBody/LoadingCell.js +12 -12
  26. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +26 -1
  27. package/dist/components/DataGrid/TableBody/TableBodyRow.js +12 -12
  28. package/dist/components/DataGrid/TableBody/index.cjs +26 -1
  29. package/dist/components/DataGrid/TableBody/index.js +12 -12
  30. package/dist/components/DataGrid/index.cjs +26 -1
  31. package/dist/components/DataGrid/index.js +12 -12
  32. package/dist/components/DataGrid/utils.cjs +26 -1
  33. package/dist/components/DataGrid/utils.js +12 -12
  34. package/dist/components/DataGridCell.cjs +26 -0
  35. package/dist/components/DataGridCell.js +6 -6
  36. package/dist/components/DateInput.cjs +26 -1
  37. package/dist/components/DateInput.js +13 -13
  38. package/dist/components/DateRangeInput.cjs +26 -1
  39. package/dist/components/DateRangeInput.js +13 -13
  40. package/dist/components/Menu.cjs +26 -0
  41. package/dist/components/Menu.js +4 -4
  42. package/dist/components/MenuOption.cjs +4 -0
  43. package/dist/components/MenuOption.js +3 -3
  44. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +26 -1
  45. package/dist/components/MobileDataGrid/ColumnSelector/index.js +12 -12
  46. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +26 -1
  47. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +12 -12
  48. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +4 -0
  49. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +4 -4
  50. package/dist/components/MobileDataGrid/index.cjs +26 -1
  51. package/dist/components/MobileDataGrid/index.js +12 -12
  52. package/dist/components/Modal.cjs +4 -0
  53. package/dist/components/Modal.js +3 -3
  54. package/dist/components/NestedMenu.cjs +4 -0
  55. package/dist/components/NestedMenu.js +3 -3
  56. package/dist/components/PDFViewer/index.cjs +4 -0
  57. package/dist/components/PDFViewer/index.js +4 -4
  58. package/dist/components/ProductImagePreview/index.cjs +4 -0
  59. package/dist/components/ProductImagePreview/index.js +3 -3
  60. package/dist/components/ProjectBar.cjs +4 -0
  61. package/dist/components/ProjectBar.js +2 -2
  62. package/dist/components/Time.js +1 -1
  63. package/dist/components/index.cjs +26 -1
  64. package/dist/components/index.js +12 -12
  65. package/dist/components/useMenuSystem.cjs +26 -0
  66. package/dist/components/useMenuSystem.js +3 -3
  67. package/dist/hooks/index.cjs +4 -1
  68. package/dist/hooks/index.js +2 -2
  69. package/dist/utils/index.cjs +5 -0
  70. package/dist/utils/index.js +3 -1
  71. package/package.json +1 -1
  72. package/src/components/useMenuSystem.tsx +27 -0
  73. package/src/hooks/useTableLayout.ts +2 -2
  74. package/src/utils/index.ts +1 -0
@@ -954,6 +954,9 @@ function mergeObjectArrays(arr1, arr2) {
954
954
  );
955
955
  }
956
956
 
957
+ // src/utils/index.ts
958
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
959
+
957
960
  // src/utils.ts
958
961
  function findDocumentRoot(element) {
959
962
  if (typeof window === "undefined" || typeof document === "undefined") {
@@ -979,7 +982,7 @@ function findDocumentRoot(element) {
979
982
 
980
983
  // src/hooks/useTableLayout.ts
981
984
  var import_react5 = require("react");
982
- var LocalStoragePrefix = `dmsi-acc-v1-tableLayout`;
985
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
983
986
  var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
984
987
  function useTableLayout(initialColumns, key) {
985
988
  const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
@@ -1555,15 +1558,37 @@ function useMenuPosition(elementRef, position = "bottom", options) {
1555
1558
  resizeObserver.observe(elementRef.current);
1556
1559
  }
1557
1560
  window.addEventListener("scroll", updatePosition);
1561
+ const hideMenuWhenParentIsScrolled = () => {
1562
+ var _a;
1563
+ (_a = options == null ? void 0 : options.setIsOpen) == null ? void 0 : _a.call(options, false);
1564
+ };
1565
+ const scrollableAncestors = getScrollableAncestors(elementRef.current);
1566
+ scrollableAncestors.forEach((ancestor) => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
1558
1567
  window.addEventListener("resize", updatePosition);
1559
1568
  return () => {
1560
1569
  resizeObserver.disconnect();
1561
1570
  window.removeEventListener("scroll", updatePosition);
1571
+ scrollableAncestors.forEach((ancestor) => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled));
1562
1572
  window.removeEventListener("resize", updatePosition);
1563
1573
  };
1564
1574
  }, [elementRef, updatePosition]);
1565
1575
  return { menuPosition, updatePosition };
1566
1576
  }
1577
+ function getScrollableAncestors(element) {
1578
+ if (!element) {
1579
+ return [];
1580
+ }
1581
+ const scrollables = [];
1582
+ let parent = element.parentElement;
1583
+ while (parent) {
1584
+ const overflowY = window.getComputedStyle(parent).overflowY;
1585
+ if (overflowY === "auto" || overflowY === "scroll") {
1586
+ scrollables.push(parent);
1587
+ }
1588
+ parent = parent.parentElement;
1589
+ }
1590
+ return scrollables;
1591
+ }
1567
1592
 
1568
1593
  // src/components/Menu.tsx
1569
1594
  var import_jsx_runtime9 = require("react/jsx-runtime");
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  MobileDataGrid
3
- } from "../../chunk-BYRLHNBP.js";
4
- import "../../chunk-UKSV4UHI.js";
3
+ } from "../../chunk-GTPSPGSJ.js";
4
+ import "../../chunk-OEMLNGE2.js";
5
5
  import "../../chunk-IT4VFU6T.js";
6
6
  import "../../chunk-M7INAUAJ.js";
7
- import "../../chunk-DNUBM26R.js";
8
- import "../../chunk-I363QX6Y.js";
7
+ import "../../chunk-IG2YUDHI.js";
8
+ import "../../chunk-DYBJUTGK.js";
9
9
  import "../../chunk-MBZ55T2D.js";
10
10
  import "../../chunk-2IKT6IHB.js";
11
11
  import "../../chunk-YCDDBSVU.js";
@@ -27,7 +27,7 @@ import "../../chunk-7BVUTFZ5.js";
27
27
  import "../../chunk-ETAEB3TA.js";
28
28
  import "../../chunk-HVNHTM3P.js";
29
29
  import "../../chunk-GRGDX7JC.js";
30
- import "../../chunk-KCUB3UWA.js";
30
+ import "../../chunk-NIWXVOBW.js";
31
31
  import "../../chunk-4RJKB7LC.js";
32
32
  import "../../chunk-G7KIKHER.js";
33
33
  import "../../chunk-AG43RS4Q.js";
@@ -40,18 +40,18 @@ import "../../chunk-H2KC5XUY.js";
40
40
  import "../../chunk-QVWYTQKL.js";
41
41
  import "../../chunk-75USUR3I.js";
42
42
  import "../../chunk-WEAVZEE4.js";
43
- import "../../chunk-W53FKPJD.js";
44
- import "../../chunk-WX62IDZ5.js";
45
- import "../../chunk-22VBZWJG.js";
46
- import "../../chunk-NVOZAVEX.js";
47
- import "../../chunk-SOZRGIQW.js";
43
+ import "../../chunk-OZBB6RFM.js";
44
+ import "../../chunk-BFFNSUNS.js";
45
+ import "../../chunk-TCMOGTPB.js";
46
+ import "../../chunk-DVU5XV7L.js";
47
+ import "../../chunk-IPAKWF2V.js";
48
48
  import "../../chunk-WVUIIBRR.js";
49
49
  import "../../chunk-RQRR4FEF.js";
50
50
  import "../../chunk-44TH3VC7.js";
51
51
  import "../../chunk-AL5QIRY3.js";
52
- import "../../chunk-MYKYZHEO.js";
52
+ import "../../chunk-URYQ24NF.js";
53
53
  import "../../chunk-VXWSAIB5.js";
54
- import "../../chunk-TYTD4FLW.js";
54
+ import "../../chunk-R3EQIDBX.js";
55
55
  import "../../chunk-5UH6QUFB.js";
56
56
  import "../../chunk-UCJUC5AZ.js";
57
57
  import "../../chunk-ZQSD74IJ.js";
@@ -600,6 +600,9 @@ ModalScrim.displayName = "ModalScrim";
600
600
  // src/components/Modal.tsx
601
601
  var import_react_dom = require("react-dom");
602
602
 
603
+ // src/utils/index.ts
604
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
605
+
603
606
  // src/utils.ts
604
607
  function findDocumentRoot(element) {
605
608
  if (typeof window === "undefined" || typeof document === "undefined") {
@@ -649,6 +652,7 @@ var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
649
652
 
650
653
  // src/hooks/useTableLayout.ts
651
654
  var import_react4 = require("react");
655
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
652
656
 
653
657
  // src/components/useMounted.tsx
654
658
  var import_react5 = require("react");
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import {
3
3
  Modal
4
- } from "../chunk-KCUB3UWA.js";
4
+ } from "../chunk-NIWXVOBW.js";
5
5
  import "../chunk-4RJKB7LC.js";
6
6
  import "../chunk-G7KIKHER.js";
7
7
  import "../chunk-AG43RS4Q.js";
8
8
  import "../chunk-ZQJMNPCF.js";
9
9
  import "../chunk-FG7GNGE3.js";
10
10
  import "../chunk-H2KC5XUY.js";
11
- import "../chunk-MYKYZHEO.js";
11
+ import "../chunk-URYQ24NF.js";
12
12
  import "../chunk-VXWSAIB5.js";
13
- import "../chunk-TYTD4FLW.js";
13
+ import "../chunk-R3EQIDBX.js";
14
14
  import "../chunk-5UH6QUFB.js";
15
15
  import "../chunk-NKUETCDA.js";
16
16
  import "../chunk-LPY6PMAY.js";
@@ -385,8 +385,12 @@ var useMatchesMedia = (query) => {
385
385
  };
386
386
  var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
387
387
 
388
+ // src/utils/index.ts
389
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
390
+
388
391
  // src/hooks/useTableLayout.ts
389
392
  var import_react4 = require("react");
393
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
390
394
 
391
395
  // src/components/MenuOption.tsx
392
396
  var import_jsx_runtime4 = require("react/jsx-runtime");
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import {
3
3
  MenuOption
4
- } from "../chunk-SOZRGIQW.js";
4
+ } from "../chunk-IPAKWF2V.js";
5
5
  import {
6
6
  Label
7
7
  } from "../chunk-AL5QIRY3.js";
8
8
  import {
9
9
  useKeydown
10
- } from "../chunk-MYKYZHEO.js";
10
+ } from "../chunk-URYQ24NF.js";
11
11
  import "../chunk-VXWSAIB5.js";
12
- import "../chunk-TYTD4FLW.js";
12
+ import "../chunk-R3EQIDBX.js";
13
13
  import "../chunk-5UH6QUFB.js";
14
14
  import "../chunk-ZSETMD4A.js";
15
15
  import {
@@ -603,6 +603,9 @@ ModalScrim.displayName = "ModalScrim";
603
603
  // src/components/Modal.tsx
604
604
  var import_react_dom = require("react-dom");
605
605
 
606
+ // src/utils/index.ts
607
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
608
+
606
609
  // src/utils.ts
607
610
  function findDocumentRoot(element) {
608
611
  if (typeof window === "undefined" || typeof document === "undefined") {
@@ -652,6 +655,7 @@ var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
652
655
 
653
656
  // src/hooks/useTableLayout.ts
654
657
  var import_react4 = require("react");
658
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
655
659
 
656
660
  // src/components/useMounted.tsx
657
661
  var import_react5 = require("react");
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  PDFViewer
4
- } from "../../chunk-DNUBM26R.js";
4
+ } from "../../chunk-IG2YUDHI.js";
5
5
  import "../../chunk-JUFBGNWW.js";
6
6
  import "../../chunk-YNKN6RKF.js";
7
7
  import "../../chunk-VJVY6NPF.js";
8
8
  import "../../chunk-GTBGPBH6.js";
9
- import "../../chunk-KCUB3UWA.js";
9
+ import "../../chunk-NIWXVOBW.js";
10
10
  import "../../chunk-4RJKB7LC.js";
11
11
  import "../../chunk-G7KIKHER.js";
12
12
  import "../../chunk-AG43RS4Q.js";
@@ -14,9 +14,9 @@ import "../../chunk-ZQJMNPCF.js";
14
14
  import "../../chunk-FG7GNGE3.js";
15
15
  import "../../chunk-SBRRNFOP.js";
16
16
  import "../../chunk-H2KC5XUY.js";
17
- import "../../chunk-MYKYZHEO.js";
17
+ import "../../chunk-URYQ24NF.js";
18
18
  import "../../chunk-VXWSAIB5.js";
19
- import "../../chunk-TYTD4FLW.js";
19
+ import "../../chunk-R3EQIDBX.js";
20
20
  import "../../chunk-5UH6QUFB.js";
21
21
  import "../../chunk-DORD2EBO.js";
22
22
  import "../../chunk-ZSETMD4A.js";
@@ -1113,8 +1113,12 @@ var useMatchesMedia = (query) => {
1113
1113
  };
1114
1114
  var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
1115
1115
 
1116
+ // src/utils/index.ts
1117
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
1118
+
1116
1119
  // src/hooks/useTableLayout.ts
1117
1120
  var import_react9 = require("react");
1121
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
1118
1122
 
1119
1123
  // src/components/ProductImagePreview/useProductImagePreview.ts
1120
1124
  var import_react10 = require("react");
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ProductImagePreview
3
- } from "../../chunk-I363QX6Y.js";
3
+ } from "../../chunk-DYBJUTGK.js";
4
4
  import "../../chunk-MBZ55T2D.js";
5
5
  import "../../chunk-2IKT6IHB.js";
6
6
  import "../../chunk-YCDDBSVU.js";
@@ -9,9 +9,9 @@ import "../../chunk-BQNPOGD5.js";
9
9
  import "../../chunk-AT4AWD6B.js";
10
10
  import "../../chunk-Y2GK27RX.js";
11
11
  import "../../chunk-QVWYTQKL.js";
12
- import "../../chunk-MYKYZHEO.js";
12
+ import "../../chunk-URYQ24NF.js";
13
13
  import "../../chunk-VXWSAIB5.js";
14
- import "../../chunk-TYTD4FLW.js";
14
+ import "../../chunk-R3EQIDBX.js";
15
15
  import "../../chunk-5UH6QUFB.js";
16
16
  import "../../chunk-DORD2EBO.js";
17
17
  import "../../chunk-IXR65MOU.js";
@@ -207,8 +207,12 @@ var useMatchesMedia = (query) => {
207
207
  };
208
208
  var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
209
209
 
210
+ // src/utils/index.ts
211
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
212
+
210
213
  // src/hooks/useTableLayout.ts
211
214
  var import_react4 = require("react");
215
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
212
216
 
213
217
  // src/components/ProjectBar.tsx
214
218
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  useMatchesMobile
3
- } from "../chunk-MYKYZHEO.js";
3
+ } from "../chunk-URYQ24NF.js";
4
4
  import "../chunk-VXWSAIB5.js";
5
- import "../chunk-TYTD4FLW.js";
5
+ import "../chunk-R3EQIDBX.js";
6
6
  import "../chunk-5UH6QUFB.js";
7
7
  import {
8
8
  containerPaddingX,
@@ -5,7 +5,7 @@ import "../chunk-AL5QIRY3.js";
5
5
  import {
6
6
  findDocumentRoot
7
7
  } from "../chunk-VXWSAIB5.js";
8
- import "../chunk-TYTD4FLW.js";
8
+ import "../chunk-R3EQIDBX.js";
9
9
  import "../chunk-5UH6QUFB.js";
10
10
  import {
11
11
  Stack
@@ -555,6 +555,9 @@ function mergeObjectArrays(arr1, arr2) {
555
555
  );
556
556
  }
557
557
 
558
+ // src/utils/index.ts
559
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
560
+
558
561
  // src/utils.ts
559
562
  function findDocumentRoot(element) {
560
563
  if (typeof window === "undefined" || typeof document === "undefined") {
@@ -580,7 +583,7 @@ function findDocumentRoot(element) {
580
583
 
581
584
  // src/hooks/useTableLayout.ts
582
585
  var import_react5 = require("react");
583
- var LocalStoragePrefix = `dmsi-acc-v1-tableLayout`;
586
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
584
587
  var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
585
588
  function useTableLayout(initialColumns, key) {
586
589
  const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
@@ -1156,15 +1159,37 @@ function useMenuPosition(elementRef, position = "bottom", options) {
1156
1159
  resizeObserver.observe(elementRef.current);
1157
1160
  }
1158
1161
  window.addEventListener("scroll", updatePosition);
1162
+ const hideMenuWhenParentIsScrolled = () => {
1163
+ var _a;
1164
+ (_a = options == null ? void 0 : options.setIsOpen) == null ? void 0 : _a.call(options, false);
1165
+ };
1166
+ const scrollableAncestors = getScrollableAncestors(elementRef.current);
1167
+ scrollableAncestors.forEach((ancestor) => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
1159
1168
  window.addEventListener("resize", updatePosition);
1160
1169
  return () => {
1161
1170
  resizeObserver.disconnect();
1162
1171
  window.removeEventListener("scroll", updatePosition);
1172
+ scrollableAncestors.forEach((ancestor) => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled));
1163
1173
  window.removeEventListener("resize", updatePosition);
1164
1174
  };
1165
1175
  }, [elementRef, updatePosition]);
1166
1176
  return { menuPosition, updatePosition };
1167
1177
  }
1178
+ function getScrollableAncestors(element) {
1179
+ if (!element) {
1180
+ return [];
1181
+ }
1182
+ const scrollables = [];
1183
+ let parent = element.parentElement;
1184
+ while (parent) {
1185
+ const overflowY = window.getComputedStyle(parent).overflowY;
1186
+ if (overflowY === "auto" || overflowY === "scroll") {
1187
+ scrollables.push(parent);
1188
+ }
1189
+ parent = parent.parentElement;
1190
+ }
1191
+ return scrollables;
1192
+ }
1168
1193
 
1169
1194
  // src/components/Menu.tsx
1170
1195
  var import_jsx_runtime5 = require("react/jsx-runtime");
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  DataGrid,
3
3
  MobileDataGrid
4
- } from "../chunk-BYRLHNBP.js";
5
- import "../chunk-UKSV4UHI.js";
4
+ } from "../chunk-GTPSPGSJ.js";
5
+ import "../chunk-OEMLNGE2.js";
6
6
  import "../chunk-IT4VFU6T.js";
7
7
  import "../chunk-M7INAUAJ.js";
8
8
  import {
9
9
  PDFViewer
10
- } from "../chunk-DNUBM26R.js";
10
+ } from "../chunk-IG2YUDHI.js";
11
11
  import {
12
12
  ProductImagePreview
13
- } from "../chunk-I363QX6Y.js";
13
+ } from "../chunk-DYBJUTGK.js";
14
14
  import "../chunk-MBZ55T2D.js";
15
15
  import "../chunk-2IKT6IHB.js";
16
16
  import "../chunk-YCDDBSVU.js";
@@ -42,7 +42,7 @@ import {
42
42
  import {
43
43
  Pagination
44
44
  } from "../chunk-GRGDX7JC.js";
45
- import "../chunk-KCUB3UWA.js";
45
+ import "../chunk-NIWXVOBW.js";
46
46
  import "../chunk-4RJKB7LC.js";
47
47
  import "../chunk-G7KIKHER.js";
48
48
  import "../chunk-AG43RS4Q.js";
@@ -63,20 +63,20 @@ import {
63
63
  } from "../chunk-WEAVZEE4.js";
64
64
  import {
65
65
  CompactImagesPreview
66
- } from "../chunk-W53FKPJD.js";
66
+ } from "../chunk-OZBB6RFM.js";
67
67
  import {
68
68
  DataCellHeader,
69
69
  DataGridCell,
70
70
  DragAlongCell,
71
71
  DraggableCellHeader
72
- } from "../chunk-WX62IDZ5.js";
72
+ } from "../chunk-BFFNSUNS.js";
73
73
  import {
74
74
  Menu
75
- } from "../chunk-22VBZWJG.js";
76
- import "../chunk-NVOZAVEX.js";
75
+ } from "../chunk-TCMOGTPB.js";
76
+ import "../chunk-DVU5XV7L.js";
77
77
  import {
78
78
  MenuOption
79
- } from "../chunk-SOZRGIQW.js";
79
+ } from "../chunk-IPAKWF2V.js";
80
80
  import "../chunk-WVUIIBRR.js";
81
81
  import {
82
82
  Search
@@ -87,9 +87,9 @@ import {
87
87
  import {
88
88
  Label
89
89
  } from "../chunk-AL5QIRY3.js";
90
- import "../chunk-MYKYZHEO.js";
90
+ import "../chunk-URYQ24NF.js";
91
91
  import "../chunk-VXWSAIB5.js";
92
- import "../chunk-TYTD4FLW.js";
92
+ import "../chunk-R3EQIDBX.js";
93
93
  import "../chunk-5UH6QUFB.js";
94
94
  import {
95
95
  Subheader
@@ -62,8 +62,12 @@ var useMatchesMedia = (query) => {
62
62
  };
63
63
  var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
64
64
 
65
+ // src/utils/index.ts
66
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
67
+
65
68
  // src/hooks/useTableLayout.ts
66
69
  var import_react4 = require("react");
70
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
67
71
 
68
72
  // src/components/useMenuSystem.tsx
69
73
  function useSubMenuSystem(mobilePositionTo) {
@@ -394,15 +398,37 @@ function useMenuPosition(elementRef, position = "bottom", options) {
394
398
  resizeObserver.observe(elementRef.current);
395
399
  }
396
400
  window.addEventListener("scroll", updatePosition);
401
+ const hideMenuWhenParentIsScrolled = () => {
402
+ var _a;
403
+ (_a = options == null ? void 0 : options.setIsOpen) == null ? void 0 : _a.call(options, false);
404
+ };
405
+ const scrollableAncestors = getScrollableAncestors(elementRef.current);
406
+ scrollableAncestors.forEach((ancestor) => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
397
407
  window.addEventListener("resize", updatePosition);
398
408
  return () => {
399
409
  resizeObserver.disconnect();
400
410
  window.removeEventListener("scroll", updatePosition);
411
+ scrollableAncestors.forEach((ancestor) => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled));
401
412
  window.removeEventListener("resize", updatePosition);
402
413
  };
403
414
  }, [elementRef, updatePosition]);
404
415
  return { menuPosition, updatePosition };
405
416
  }
417
+ function getScrollableAncestors(element) {
418
+ if (!element) {
419
+ return [];
420
+ }
421
+ const scrollables = [];
422
+ let parent = element.parentElement;
423
+ while (parent) {
424
+ const overflowY = window.getComputedStyle(parent).overflowY;
425
+ if (overflowY === "auto" || overflowY === "scroll") {
426
+ scrollables.push(parent);
427
+ }
428
+ parent = parent.parentElement;
429
+ }
430
+ return scrollables;
431
+ }
406
432
  // Annotate the CommonJS export names for ESM import in node:
407
433
  0 && (module.exports = {
408
434
  useMenuPosition,
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  useMenuPosition,
4
4
  useSubMenuSystem
5
- } from "../chunk-NVOZAVEX.js";
6
- import "../chunk-MYKYZHEO.js";
5
+ } from "../chunk-DVU5XV7L.js";
6
+ import "../chunk-URYQ24NF.js";
7
7
  import "../chunk-VXWSAIB5.js";
8
- import "../chunk-TYTD4FLW.js";
8
+ import "../chunk-R3EQIDBX.js";
9
9
  import "../chunk-5UH6QUFB.js";
10
10
  import "../chunk-ORMEWXMH.js";
11
11
  export {
@@ -124,9 +124,12 @@ function mergeObjectArrays(arr1, arr2) {
124
124
  );
125
125
  }
126
126
 
127
+ // src/utils/index.ts
128
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
129
+
127
130
  // src/hooks/useTableLayout.ts
128
131
  var import_react4 = require("react");
129
- var LocalStoragePrefix = `dmsi-acc-v1-tableLayout`;
132
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
130
133
  var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
131
134
  function useTableLayout(initialColumns, key) {
132
135
  const [columns, setColumns] = (0, import_react4.useState)(initialColumns);
@@ -4,9 +4,9 @@ import {
4
4
  useMatchesMedia,
5
5
  useMatchesMobile,
6
6
  useTableLayout
7
- } from "../chunk-MYKYZHEO.js";
7
+ } from "../chunk-URYQ24NF.js";
8
8
  import "../chunk-VXWSAIB5.js";
9
- import "../chunk-TYTD4FLW.js";
9
+ import "../chunk-R3EQIDBX.js";
10
10
  import "../chunk-5UH6QUFB.js";
11
11
  import "../chunk-ORMEWXMH.js";
12
12
  export {
@@ -34,6 +34,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
34
34
  // src/utils/index.ts
35
35
  var utils_exports = {};
36
36
  __export(utils_exports, {
37
+ LocalStoragePrefixVersion: () => LocalStoragePrefixVersion,
37
38
  calculateCursorPosition: () => calculateCursorPosition,
38
39
  countDigitsUpToCursor: () => countDigitsUpToCursor,
39
40
  findPositionAfterDigitCount: () => findPositionAfterDigitCount,
@@ -221,8 +222,12 @@ function mergeObjectArrays(arr1, arr2) {
221
222
  (_, i) => __spreadValues(__spreadValues({}, arr1[i] || {}), arr2[i] || {})
222
223
  );
223
224
  }
225
+
226
+ // src/utils/index.ts
227
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
224
228
  // Annotate the CommonJS export names for ESM import in node:
225
229
  0 && (module.exports = {
230
+ LocalStoragePrefixVersion,
226
231
  calculateCursorPosition,
227
232
  countDigitsUpToCursor,
228
233
  findPositionAfterDigitCount,
@@ -1,4 +1,5 @@
1
1
  import {
2
+ LocalStoragePrefixVersion,
2
3
  calculateCursorPosition,
3
4
  countDigitsUpToCursor,
4
5
  findPositionAfterDigitCount,
@@ -13,7 +14,7 @@ import {
13
14
  mergeObjectArrays,
14
15
  parseDateParts,
15
16
  parseInputDate
16
- } from "../chunk-TYTD4FLW.js";
17
+ } from "../chunk-R3EQIDBX.js";
17
18
  import {
18
19
  formatCurrencyDisplay,
19
20
  formatDecimalValue,
@@ -21,6 +22,7 @@ import {
21
22
  } from "../chunk-5UH6QUFB.js";
22
23
  import "../chunk-ORMEWXMH.js";
23
24
  export {
25
+ LocalStoragePrefixVersion,
24
26
  calculateCursorPosition,
25
27
  countDigitsUpToCursor,
26
28
  findPositionAfterDigitCount,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.461",
4
+ "version": "0.0.462",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",
@@ -416,14 +416,41 @@ export function useMenuPosition(
416
416
  }
417
417
 
418
418
  window.addEventListener("scroll", updatePosition);
419
+
420
+ const hideMenuWhenParentIsScrolled = () => {
421
+ options?.setIsOpen?.(false);
422
+ }
423
+ const scrollableAncestors = getScrollableAncestors(elementRef.current);
424
+ scrollableAncestors.forEach(ancestor => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
425
+
419
426
  window.addEventListener("resize", updatePosition);
420
427
 
421
428
  return () => {
422
429
  resizeObserver.disconnect();
423
430
  window.removeEventListener("scroll", updatePosition);
431
+ scrollableAncestors.forEach(ancestor => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled))
424
432
  window.removeEventListener("resize", updatePosition);
425
433
  };
426
434
  }, [elementRef, updatePosition]);
427
435
 
428
436
  return { menuPosition, updatePosition };
429
437
  }
438
+
439
+ function getScrollableAncestors(element: HTMLElement | null): HTMLElement[] {
440
+ if (!element) {
441
+ return []
442
+ }
443
+
444
+ const scrollables: HTMLElement[] = [];
445
+ let parent = element.parentElement;
446
+
447
+ while (parent) {
448
+ const overflowY = window.getComputedStyle(parent).overflowY;
449
+ if (overflowY === 'auto' || overflowY === 'scroll') {
450
+ scrollables.push(parent);
451
+ }
452
+ parent = parent.parentElement;
453
+ }
454
+
455
+ return scrollables;
456
+ }
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { mergeObjectArrays } from "../utils";
3
+ import { LocalStoragePrefixVersion, mergeObjectArrays } from "../utils";
4
4
  import { ColumnDef } from "@dmsi/wedgekit-react/components";
5
5
  import {
6
6
  useState,
@@ -18,7 +18,7 @@ export type PersistedTableLayout<T> = {
18
18
 
19
19
  // Change prefix to refresh client table layout.
20
20
  // It's probably better to discuss about a better key strategy in the future.
21
- const LocalStoragePrefix = `dmsi-acc-v1-tableLayout`;
21
+ const LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
22
22
 
23
23
  const getLocalStorageKeyWithPrefix = (key: string) =>
24
24
  `${LocalStoragePrefix}__${key}`;
@@ -1,3 +1,4 @@
1
1
  export * from "./formatting";
2
2
  export * from "./date";
3
3
  export { mergeObjectArrays } from "./mergeObjectArrays";
4
+ export const LocalStoragePrefixVersion = `dmsi-acc-v1.1`;