@dmsi/wedgekit-react 0.0.461 → 0.0.463

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
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Menu
3
- } from "./chunk-22VBZWJG.js";
3
+ } from "./chunk-TCMOGTPB.js";
4
4
  import {
5
5
  useSubMenuSystem
6
- } from "./chunk-NVOZAVEX.js";
6
+ } from "./chunk-DVU5XV7L.js";
7
7
  import {
8
8
  MenuOption
9
- } from "./chunk-SOZRGIQW.js";
9
+ } from "./chunk-IPAKWF2V.js";
10
10
  import {
11
11
  CSS
12
12
  } from "./chunk-WVUIIBRR.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useMatchesMobile
3
- } from "./chunk-MYKYZHEO.js";
3
+ } from "./chunk-URYQ24NF.js";
4
4
  import {
5
5
  __spreadValues
6
6
  } from "./chunk-ORMEWXMH.js";
@@ -335,15 +335,37 @@ function useMenuPosition(elementRef, position = "bottom", options) {
335
335
  resizeObserver.observe(elementRef.current);
336
336
  }
337
337
  window.addEventListener("scroll", updatePosition);
338
+ const hideMenuWhenParentIsScrolled = () => {
339
+ var _a;
340
+ (_a = options == null ? void 0 : options.setIsOpen) == null ? void 0 : _a.call(options, false);
341
+ };
342
+ const scrollableAncestors = getScrollableAncestors(elementRef.current);
343
+ scrollableAncestors.forEach((ancestor) => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
338
344
  window.addEventListener("resize", updatePosition);
339
345
  return () => {
340
346
  resizeObserver.disconnect();
341
347
  window.removeEventListener("scroll", updatePosition);
348
+ scrollableAncestors.forEach((ancestor) => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled));
342
349
  window.removeEventListener("resize", updatePosition);
343
350
  };
344
351
  }, [elementRef, updatePosition]);
345
352
  return { menuPosition, updatePosition };
346
353
  }
354
+ function getScrollableAncestors(element) {
355
+ if (!element) {
356
+ return [];
357
+ }
358
+ const scrollables = [];
359
+ let parent = element.parentElement;
360
+ while (parent) {
361
+ const overflowY = window.getComputedStyle(parent).overflowY;
362
+ if (overflowY === "auto" || overflowY === "scroll") {
363
+ scrollables.push(parent);
364
+ }
365
+ parent = parent.parentElement;
366
+ }
367
+ return scrollables;
368
+ }
347
369
 
348
370
  export {
349
371
  useSubMenuSystem,
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-Y2GK27RX.js";
19
19
  import {
20
20
  useMatchesMobile
21
- } from "./chunk-MYKYZHEO.js";
21
+ } from "./chunk-URYQ24NF.js";
22
22
  import {
23
23
  Stack
24
24
  } from "./chunk-DORD2EBO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RowDetailModalProvider
3
- } from "./chunk-UKSV4UHI.js";
3
+ } from "./chunk-OEMLNGE2.js";
4
4
  import {
5
5
  GridContextProvider
6
6
  } from "./chunk-M7INAUAJ.js";
@@ -30,13 +30,13 @@ import {
30
30
  DataGridCell,
31
31
  DragAlongCell,
32
32
  DraggableCellHeader
33
- } from "./chunk-WX62IDZ5.js";
33
+ } from "./chunk-BFFNSUNS.js";
34
34
  import {
35
35
  Menu
36
- } from "./chunk-22VBZWJG.js";
36
+ } from "./chunk-TCMOGTPB.js";
37
37
  import {
38
38
  MenuOption
39
- } from "./chunk-SOZRGIQW.js";
39
+ } from "./chunk-IPAKWF2V.js";
40
40
  import {
41
41
  Search
42
42
  } from "./chunk-RQRR4FEF.js";
@@ -49,10 +49,10 @@ import {
49
49
  import {
50
50
  useInfiniteScroll,
51
51
  useTableLayout
52
- } from "./chunk-MYKYZHEO.js";
52
+ } from "./chunk-URYQ24NF.js";
53
53
  import {
54
54
  formatDate
55
- } from "./chunk-TYTD4FLW.js";
55
+ } from "./chunk-R3EQIDBX.js";
56
56
  import {
57
57
  formatCurrencyDisplay
58
58
  } from "./chunk-5UH6QUFB.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-GTBGPBH6.js";
10
10
  import {
11
11
  Modal
12
- } from "./chunk-KCUB3UWA.js";
12
+ } from "./chunk-NIWXVOBW.js";
13
13
 
14
14
  // src/components/PDFViewer/index.tsx
15
15
  import { useCallback, useState } from "react";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AL5QIRY3.js";
4
4
  import {
5
5
  useMatchesMobile
6
- } from "./chunk-MYKYZHEO.js";
6
+ } from "./chunk-URYQ24NF.js";
7
7
  import {
8
8
  Paragraph
9
9
  } from "./chunk-ZSETMD4A.js";
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-FG7GNGE3.js";
16
16
  import {
17
17
  useMatchesMobile
18
- } from "./chunk-MYKYZHEO.js";
18
+ } from "./chunk-URYQ24NF.js";
19
19
  import {
20
20
  findDocumentRoot
21
21
  } from "./chunk-VXWSAIB5.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-5IFPG6TS.js";
7
7
  import {
8
8
  Modal
9
- } from "./chunk-KCUB3UWA.js";
9
+ } from "./chunk-NIWXVOBW.js";
10
10
  import {
11
11
  Heading2
12
12
  } from "./chunk-H2KC5XUY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useMatchesMobile
3
- } from "./chunk-MYKYZHEO.js";
3
+ } from "./chunk-URYQ24NF.js";
4
4
  import {
5
5
  Stack
6
6
  } from "./chunk-DORD2EBO.js";
@@ -137,6 +137,9 @@ function mergeObjectArrays(arr1, arr2) {
137
137
  );
138
138
  }
139
139
 
140
+ // src/utils/index.ts
141
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
142
+
140
143
  export {
141
144
  parseInputDate,
142
145
  isValidDate,
@@ -151,5 +154,6 @@ export {
151
154
  formatDatePartsToDisplay,
152
155
  formatDate,
153
156
  isValidDateRangeOrder,
154
- mergeObjectArrays
157
+ mergeObjectArrays,
158
+ LocalStoragePrefixVersion
155
159
  };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useMenuPosition
3
- } from "./chunk-NVOZAVEX.js";
3
+ } from "./chunk-DVU5XV7L.js";
4
4
  import {
5
5
  useMatchesMobile
6
- } from "./chunk-MYKYZHEO.js";
6
+ } from "./chunk-URYQ24NF.js";
7
7
  import {
8
8
  findDocumentRoot
9
9
  } from "./chunk-VXWSAIB5.js";
@@ -1,6 +1,7 @@
1
1
  import {
2
+ LocalStoragePrefixVersion,
2
3
  mergeObjectArrays
3
- } from "./chunk-TYTD4FLW.js";
4
+ } from "./chunk-R3EQIDBX.js";
4
5
 
5
6
  // src/hooks/useKeydown.ts
6
7
  import { useEffect } from "react";
@@ -82,7 +83,7 @@ import {
82
83
  useCallback,
83
84
  useRef
84
85
  } from "react";
85
- var LocalStoragePrefix = `dmsi-acc-v1-tableLayout`;
86
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
86
87
  var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
87
88
  function useTableLayout(initialColumns, key) {
88
89
  const [columns, setColumns] = useState2(initialColumns);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Menu
3
- } from "./chunk-22VBZWJG.js";
3
+ } from "./chunk-TCMOGTPB.js";
4
4
  import {
5
5
  MenuOption
6
- } from "./chunk-SOZRGIQW.js";
6
+ } from "./chunk-IPAKWF2V.js";
7
7
  import {
8
8
  Icon
9
9
  } from "./chunk-NKUETCDA.js";
@@ -535,6 +535,9 @@ function mergeObjectArrays(arr1, arr2) {
535
535
  );
536
536
  }
537
537
 
538
+ // src/utils/index.ts
539
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
540
+
538
541
  // src/utils.ts
539
542
  function findDocumentRoot(element) {
540
543
  if (typeof window === "undefined" || typeof document === "undefined") {
@@ -560,7 +563,7 @@ function findDocumentRoot(element) {
560
563
 
561
564
  // src/hooks/useTableLayout.ts
562
565
  var import_react5 = require("react");
563
- var LocalStoragePrefix = `dmsi-acc-v1-tableLayout`;
566
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
564
567
  var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
565
568
  function useTableLayout(initialColumns, key) {
566
569
  const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
@@ -1136,15 +1139,37 @@ function useMenuPosition(elementRef, position = "bottom", options) {
1136
1139
  resizeObserver.observe(elementRef.current);
1137
1140
  }
1138
1141
  window.addEventListener("scroll", updatePosition);
1142
+ const hideMenuWhenParentIsScrolled = () => {
1143
+ var _a;
1144
+ (_a = options == null ? void 0 : options.setIsOpen) == null ? void 0 : _a.call(options, false);
1145
+ };
1146
+ const scrollableAncestors = getScrollableAncestors(elementRef.current);
1147
+ scrollableAncestors.forEach((ancestor) => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
1139
1148
  window.addEventListener("resize", updatePosition);
1140
1149
  return () => {
1141
1150
  resizeObserver.disconnect();
1142
1151
  window.removeEventListener("scroll", updatePosition);
1152
+ scrollableAncestors.forEach((ancestor) => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled));
1143
1153
  window.removeEventListener("resize", updatePosition);
1144
1154
  };
1145
1155
  }, [elementRef, updatePosition]);
1146
1156
  return { menuPosition, updatePosition };
1147
1157
  }
1158
+ function getScrollableAncestors(element) {
1159
+ if (!element) {
1160
+ return [];
1161
+ }
1162
+ const scrollables = [];
1163
+ let parent = element.parentElement;
1164
+ while (parent) {
1165
+ const overflowY = window.getComputedStyle(parent).overflowY;
1166
+ if (overflowY === "auto" || overflowY === "scroll") {
1167
+ scrollables.push(parent);
1168
+ }
1169
+ parent = parent.parentElement;
1170
+ }
1171
+ return scrollables;
1172
+ }
1148
1173
 
1149
1174
  // src/components/Menu.tsx
1150
1175
  var import_jsx_runtime5 = require("react/jsx-runtime");
@@ -2,13 +2,13 @@ import {
2
2
  CalendarRange,
3
3
  CalendarRange_default,
4
4
  isWeekend
5
- } from "../chunk-LZH6DJEZ.js";
6
- import "../chunk-BYRLHNBP.js";
7
- import "../chunk-UKSV4UHI.js";
5
+ } from "../chunk-X35NLL3N.js";
6
+ import "../chunk-GTPSPGSJ.js";
7
+ import "../chunk-OEMLNGE2.js";
8
8
  import "../chunk-IT4VFU6T.js";
9
9
  import "../chunk-M7INAUAJ.js";
10
- import "../chunk-DNUBM26R.js";
11
- import "../chunk-I363QX6Y.js";
10
+ import "../chunk-IG2YUDHI.js";
11
+ import "../chunk-DYBJUTGK.js";
12
12
  import "../chunk-MBZ55T2D.js";
13
13
  import "../chunk-2IKT6IHB.js";
14
14
  import "../chunk-YCDDBSVU.js";
@@ -30,7 +30,7 @@ import "../chunk-7BVUTFZ5.js";
30
30
  import "../chunk-ETAEB3TA.js";
31
31
  import "../chunk-HVNHTM3P.js";
32
32
  import "../chunk-GRGDX7JC.js";
33
- import "../chunk-KCUB3UWA.js";
33
+ import "../chunk-NIWXVOBW.js";
34
34
  import "../chunk-4RJKB7LC.js";
35
35
  import "../chunk-G7KIKHER.js";
36
36
  import "../chunk-AG43RS4Q.js";
@@ -43,18 +43,18 @@ import "../chunk-H2KC5XUY.js";
43
43
  import "../chunk-QVWYTQKL.js";
44
44
  import "../chunk-75USUR3I.js";
45
45
  import "../chunk-WEAVZEE4.js";
46
- import "../chunk-W53FKPJD.js";
47
- import "../chunk-WX62IDZ5.js";
48
- import "../chunk-22VBZWJG.js";
49
- import "../chunk-NVOZAVEX.js";
50
- import "../chunk-SOZRGIQW.js";
46
+ import "../chunk-OZBB6RFM.js";
47
+ import "../chunk-BFFNSUNS.js";
48
+ import "../chunk-TCMOGTPB.js";
49
+ import "../chunk-DVU5XV7L.js";
50
+ import "../chunk-IPAKWF2V.js";
51
51
  import "../chunk-WVUIIBRR.js";
52
52
  import "../chunk-RQRR4FEF.js";
53
53
  import "../chunk-44TH3VC7.js";
54
54
  import "../chunk-AL5QIRY3.js";
55
- import "../chunk-MYKYZHEO.js";
55
+ import "../chunk-URYQ24NF.js";
56
56
  import "../chunk-VXWSAIB5.js";
57
- import "../chunk-TYTD4FLW.js";
57
+ import "../chunk-R3EQIDBX.js";
58
58
  import "../chunk-5UH6QUFB.js";
59
59
  import "../chunk-UCJUC5AZ.js";
60
60
  import "../chunk-ZQSD74IJ.js";
@@ -447,8 +447,12 @@ var useMatchesMedia = (query) => {
447
447
  };
448
448
  var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
449
449
 
450
+ // src/utils/index.ts
451
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
452
+
450
453
  // src/hooks/useTableLayout.ts
451
454
  var import_react4 = require("react");
455
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
452
456
 
453
457
  // src/components/CompactImagesPreview.tsx
454
458
  var import_jsx_runtime2 = require("react/jsx-runtime");
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  CompactImagesPreview
3
- } from "../chunk-W53FKPJD.js";
4
- import "../chunk-MYKYZHEO.js";
3
+ } from "../chunk-OZBB6RFM.js";
4
+ import "../chunk-URYQ24NF.js";
5
5
  import "../chunk-VXWSAIB5.js";
6
- import "../chunk-TYTD4FLW.js";
6
+ import "../chunk-R3EQIDBX.js";
7
7
  import "../chunk-5UH6QUFB.js";
8
8
  import "../chunk-DORD2EBO.js";
9
9
  import "../chunk-IXR65MOU.js";
@@ -529,6 +529,9 @@ function mergeObjectArrays(arr1, arr2) {
529
529
  );
530
530
  }
531
531
 
532
+ // src/utils/index.ts
533
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
534
+
532
535
  // src/utils.ts
533
536
  function findDocumentRoot(element) {
534
537
  if (typeof window === "undefined" || typeof document === "undefined") {
@@ -554,7 +557,7 @@ function findDocumentRoot(element) {
554
557
 
555
558
  // src/hooks/useTableLayout.ts
556
559
  var import_react5 = require("react");
557
- var LocalStoragePrefix = `dmsi-acc-v1-tableLayout`;
560
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
558
561
  var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
559
562
  function useTableLayout(initialColumns, key) {
560
563
  const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
@@ -1130,15 +1133,37 @@ function useMenuPosition(elementRef, position = "bottom", options) {
1130
1133
  resizeObserver.observe(elementRef.current);
1131
1134
  }
1132
1135
  window.addEventListener("scroll", updatePosition);
1136
+ const hideMenuWhenParentIsScrolled = () => {
1137
+ var _a;
1138
+ (_a = options == null ? void 0 : options.setIsOpen) == null ? void 0 : _a.call(options, false);
1139
+ };
1140
+ const scrollableAncestors = getScrollableAncestors(elementRef.current);
1141
+ scrollableAncestors.forEach((ancestor) => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
1133
1142
  window.addEventListener("resize", updatePosition);
1134
1143
  return () => {
1135
1144
  resizeObserver.disconnect();
1136
1145
  window.removeEventListener("scroll", updatePosition);
1146
+ scrollableAncestors.forEach((ancestor) => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled));
1137
1147
  window.removeEventListener("resize", updatePosition);
1138
1148
  };
1139
1149
  }, [elementRef, updatePosition]);
1140
1150
  return { menuPosition, updatePosition };
1141
1151
  }
1152
+ function getScrollableAncestors(element) {
1153
+ if (!element) {
1154
+ return [];
1155
+ }
1156
+ const scrollables = [];
1157
+ let parent = element.parentElement;
1158
+ while (parent) {
1159
+ const overflowY = window.getComputedStyle(parent).overflowY;
1160
+ if (overflowY === "auto" || overflowY === "scroll") {
1161
+ scrollables.push(parent);
1162
+ }
1163
+ parent = parent.parentElement;
1164
+ }
1165
+ return scrollables;
1166
+ }
1142
1167
 
1143
1168
  // src/components/Menu.tsx
1144
1169
  var import_jsx_runtime5 = require("react/jsx-runtime");
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ColumnSelectorMenuOption
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";
@@ -529,6 +529,9 @@ function mergeObjectArrays(arr1, arr2) {
529
529
  );
530
530
  }
531
531
 
532
+ // src/utils/index.ts
533
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
534
+
532
535
  // src/utils.ts
533
536
  function findDocumentRoot(element) {
534
537
  if (typeof window === "undefined" || typeof document === "undefined") {
@@ -554,7 +557,7 @@ function findDocumentRoot(element) {
554
557
 
555
558
  // src/hooks/useTableLayout.ts
556
559
  var import_react5 = require("react");
557
- var LocalStoragePrefix = `dmsi-acc-v1-tableLayout`;
560
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
558
561
  var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
559
562
  function useTableLayout(initialColumns, key) {
560
563
  const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
@@ -1130,15 +1133,37 @@ function useMenuPosition(elementRef, position = "bottom", options) {
1130
1133
  resizeObserver.observe(elementRef.current);
1131
1134
  }
1132
1135
  window.addEventListener("scroll", updatePosition);
1136
+ const hideMenuWhenParentIsScrolled = () => {
1137
+ var _a;
1138
+ (_a = options == null ? void 0 : options.setIsOpen) == null ? void 0 : _a.call(options, false);
1139
+ };
1140
+ const scrollableAncestors = getScrollableAncestors(elementRef.current);
1141
+ scrollableAncestors.forEach((ancestor) => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
1133
1142
  window.addEventListener("resize", updatePosition);
1134
1143
  return () => {
1135
1144
  resizeObserver.disconnect();
1136
1145
  window.removeEventListener("scroll", updatePosition);
1146
+ scrollableAncestors.forEach((ancestor) => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled));
1137
1147
  window.removeEventListener("resize", updatePosition);
1138
1148
  };
1139
1149
  }, [elementRef, updatePosition]);
1140
1150
  return { menuPosition, updatePosition };
1141
1151
  }
1152
+ function getScrollableAncestors(element) {
1153
+ if (!element) {
1154
+ return [];
1155
+ }
1156
+ const scrollables = [];
1157
+ let parent = element.parentElement;
1158
+ while (parent) {
1159
+ const overflowY = window.getComputedStyle(parent).overflowY;
1160
+ if (overflowY === "auto" || overflowY === "scroll") {
1161
+ scrollables.push(parent);
1162
+ }
1163
+ parent = parent.parentElement;
1164
+ }
1165
+ return scrollables;
1166
+ }
1142
1167
 
1143
1168
  // src/components/Menu.tsx
1144
1169
  var import_jsx_runtime5 = require("react/jsx-runtime");
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ColumnSelectorHeaderCell
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";
@@ -529,6 +529,9 @@ function mergeObjectArrays(arr1, arr2) {
529
529
  );
530
530
  }
531
531
 
532
+ // src/utils/index.ts
533
+ var LocalStoragePrefixVersion = `dmsi-acc-v1.1`;
534
+
532
535
  // src/utils.ts
533
536
  function findDocumentRoot(element) {
534
537
  if (typeof window === "undefined" || typeof document === "undefined") {
@@ -554,7 +557,7 @@ function findDocumentRoot(element) {
554
557
 
555
558
  // src/hooks/useTableLayout.ts
556
559
  var import_react5 = require("react");
557
- var LocalStoragePrefix = `dmsi-acc-v1-tableLayout`;
560
+ var LocalStoragePrefix = `${LocalStoragePrefixVersion}-tableLayout`;
558
561
  var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
559
562
  function useTableLayout(initialColumns, key) {
560
563
  const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
@@ -1130,15 +1133,37 @@ function useMenuPosition(elementRef, position = "bottom", options) {
1130
1133
  resizeObserver.observe(elementRef.current);
1131
1134
  }
1132
1135
  window.addEventListener("scroll", updatePosition);
1136
+ const hideMenuWhenParentIsScrolled = () => {
1137
+ var _a;
1138
+ (_a = options == null ? void 0 : options.setIsOpen) == null ? void 0 : _a.call(options, false);
1139
+ };
1140
+ const scrollableAncestors = getScrollableAncestors(elementRef.current);
1141
+ scrollableAncestors.forEach((ancestor) => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
1133
1142
  window.addEventListener("resize", updatePosition);
1134
1143
  return () => {
1135
1144
  resizeObserver.disconnect();
1136
1145
  window.removeEventListener("scroll", updatePosition);
1146
+ scrollableAncestors.forEach((ancestor) => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled));
1137
1147
  window.removeEventListener("resize", updatePosition);
1138
1148
  };
1139
1149
  }, [elementRef, updatePosition]);
1140
1150
  return { menuPosition, updatePosition };
1141
1151
  }
1152
+ function getScrollableAncestors(element) {
1153
+ if (!element) {
1154
+ return [];
1155
+ }
1156
+ const scrollables = [];
1157
+ let parent = element.parentElement;
1158
+ while (parent) {
1159
+ const overflowY = window.getComputedStyle(parent).overflowY;
1160
+ if (overflowY === "auto" || overflowY === "scroll") {
1161
+ scrollables.push(parent);
1162
+ }
1163
+ parent = parent.parentElement;
1164
+ }
1165
+ return scrollables;
1166
+ }
1142
1167
 
1143
1168
  // src/components/Menu.tsx
1144
1169
  var import_jsx_runtime5 = require("react/jsx-runtime");