@dmsi/wedgekit-react 0.0.460 → 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.
- package/dist/{chunk-WX62IDZ5.js → chunk-BFFNSUNS.js} +3 -3
- package/dist/{chunk-NVOZAVEX.js → chunk-DVU5XV7L.js} +23 -1
- package/dist/{chunk-I363QX6Y.js → chunk-DYBJUTGK.js} +1 -1
- package/dist/{chunk-BYRLHNBP.js → chunk-GTPSPGSJ.js} +6 -6
- package/dist/{chunk-DNUBM26R.js → chunk-IG2YUDHI.js} +1 -1
- package/dist/{chunk-SOZRGIQW.js → chunk-IPAKWF2V.js} +1 -1
- package/dist/{chunk-KCUB3UWA.js → chunk-NIWXVOBW.js} +1 -1
- package/dist/{chunk-UKSV4UHI.js → chunk-OEMLNGE2.js} +1 -1
- package/dist/{chunk-W53FKPJD.js → chunk-OZBB6RFM.js} +1 -1
- package/dist/{chunk-TYTD4FLW.js → chunk-R3EQIDBX.js} +5 -1
- package/dist/{chunk-22VBZWJG.js → chunk-TCMOGTPB.js} +2 -2
- package/dist/{chunk-MYKYZHEO.js → chunk-URYQ24NF.js} +3 -2
- package/dist/{chunk-LZH6DJEZ.js → chunk-X35NLL3N.js} +2 -2
- package/dist/components/CalendarRange.cjs +26 -1
- package/dist/components/CalendarRange.js +13 -13
- package/dist/components/CompactImagesPreview.cjs +4 -0
- package/dist/components/CompactImagesPreview.js +3 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +26 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +12 -12
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +26 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +12 -12
- package/dist/components/DataGrid/PinnedColumns.cjs +26 -1
- package/dist/components/DataGrid/PinnedColumns.js +12 -12
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +26 -1
- package/dist/components/DataGrid/TableBody/LoadingCell.js +12 -12
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +26 -1
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +12 -12
- package/dist/components/DataGrid/TableBody/index.cjs +26 -1
- package/dist/components/DataGrid/TableBody/index.js +12 -12
- package/dist/components/DataGrid/index.cjs +26 -1
- package/dist/components/DataGrid/index.js +12 -12
- package/dist/components/DataGrid/utils.cjs +26 -1
- package/dist/components/DataGrid/utils.js +12 -12
- package/dist/components/DataGridCell.cjs +26 -0
- package/dist/components/DataGridCell.js +6 -6
- package/dist/components/DateInput.cjs +26 -1
- package/dist/components/DateInput.js +13 -13
- package/dist/components/DateRangeInput.cjs +26 -1
- package/dist/components/DateRangeInput.js +13 -13
- package/dist/components/Menu.cjs +26 -0
- package/dist/components/Menu.js +4 -4
- package/dist/components/MenuOption.cjs +4 -0
- package/dist/components/MenuOption.js +3 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +26 -1
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +12 -12
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +26 -1
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +12 -12
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +4 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +4 -4
- package/dist/components/MobileDataGrid/index.cjs +26 -1
- package/dist/components/MobileDataGrid/index.js +12 -12
- package/dist/components/Modal.cjs +4 -0
- package/dist/components/Modal.js +3 -3
- package/dist/components/NestedMenu.cjs +4 -0
- package/dist/components/NestedMenu.js +3 -3
- package/dist/components/PDFViewer/index.cjs +4 -0
- package/dist/components/PDFViewer/index.js +4 -4
- package/dist/components/ProductImagePreview/index.cjs +4 -0
- package/dist/components/ProductImagePreview/index.js +3 -3
- package/dist/components/ProjectBar.cjs +4 -0
- package/dist/components/ProjectBar.js +2 -2
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +26 -1
- package/dist/components/index.js +12 -12
- package/dist/components/useMenuSystem.cjs +26 -0
- package/dist/components/useMenuSystem.js +3 -3
- package/dist/hooks/index.cjs +4 -1
- package/dist/hooks/index.js +2 -2
- package/dist/utils/index.cjs +5 -0
- package/dist/utils/index.js +3 -1
- package/package.json +1 -1
- package/src/components/useMenuSystem.tsx +27 -0
- package/src/hooks/useTableLayout.ts +2 -2
- package/src/utils/index.ts +1 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Menu
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TCMOGTPB.js";
|
|
4
4
|
import {
|
|
5
5
|
useSubMenuSystem
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DVU5XV7L.js";
|
|
7
7
|
import {
|
|
8
8
|
MenuOption
|
|
9
|
-
} from "./chunk-
|
|
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-
|
|
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,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RowDetailModalProvider
|
|
3
|
-
} from "./chunk-
|
|
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-
|
|
33
|
+
} from "./chunk-BFFNSUNS.js";
|
|
34
34
|
import {
|
|
35
35
|
Menu
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-TCMOGTPB.js";
|
|
37
37
|
import {
|
|
38
38
|
MenuOption
|
|
39
|
-
} from "./chunk-
|
|
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-
|
|
52
|
+
} from "./chunk-URYQ24NF.js";
|
|
53
53
|
import {
|
|
54
54
|
formatDate
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-R3EQIDBX.js";
|
|
56
56
|
import {
|
|
57
57
|
formatCurrencyDisplay
|
|
58
58
|
} from "./chunk-5UH6QUFB.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,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
LocalStoragePrefixVersion,
|
|
2
3
|
mergeObjectArrays
|
|
3
|
-
} from "./chunk-
|
|
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 =
|
|
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);
|
|
@@ -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 =
|
|
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-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
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-
|
|
11
|
-
import "../chunk-
|
|
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-
|
|
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-
|
|
47
|
-
import "../chunk-
|
|
48
|
-
import "../chunk-
|
|
49
|
-
import "../chunk-
|
|
50
|
-
import "../chunk-
|
|
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-
|
|
55
|
+
import "../chunk-URYQ24NF.js";
|
|
56
56
|
import "../chunk-VXWSAIB5.js";
|
|
57
|
-
import "../chunk-
|
|
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-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-OZBB6RFM.js";
|
|
4
|
+
import "../chunk-URYQ24NF.js";
|
|
5
5
|
import "../chunk-VXWSAIB5.js";
|
|
6
|
-
import "../chunk-
|
|
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 =
|
|
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-
|
|
4
|
-
import "../../../chunk-
|
|
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-
|
|
8
|
-
import "../../../chunk-
|
|
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-
|
|
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-
|
|
44
|
-
import "../../../chunk-
|
|
45
|
-
import "../../../chunk-
|
|
46
|
-
import "../../../chunk-
|
|
47
|
-
import "../../../chunk-
|
|
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-
|
|
52
|
+
import "../../../chunk-URYQ24NF.js";
|
|
53
53
|
import "../../../chunk-VXWSAIB5.js";
|
|
54
|
-
import "../../../chunk-
|
|
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 =
|
|
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-
|
|
4
|
-
import "../../../chunk-
|
|
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-
|
|
8
|
-
import "../../../chunk-
|
|
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-
|
|
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-
|
|
44
|
-
import "../../../chunk-
|
|
45
|
-
import "../../../chunk-
|
|
46
|
-
import "../../../chunk-
|
|
47
|
-
import "../../../chunk-
|
|
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-
|
|
52
|
+
import "../../../chunk-URYQ24NF.js";
|
|
53
53
|
import "../../../chunk-VXWSAIB5.js";
|
|
54
|
-
import "../../../chunk-
|
|
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 =
|
|
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");
|