@dmsi/wedgekit-react 0.0.206 → 0.0.208
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-WNQ53SVY.js → chunk-E6Y7ZHQX.js} +45 -1
- package/dist/{chunk-RXPS5GVE.js → chunk-EFX3RPW4.js} +3 -3
- package/dist/{chunk-WXHRJSDG.js → chunk-ERW3AMED.js} +1 -1
- package/dist/{chunk-2JRZCC2K.js → chunk-JITZWSPR.js} +3 -3
- package/dist/{chunk-WE55TGZZ.js → chunk-NIHZMIOL.js} +1 -1
- package/dist/{chunk-M3433XEJ.js → chunk-T3F37S6Z.js} +15 -1
- package/dist/{chunk-2B5T4NCT.js → chunk-UKSJPFN2.js} +2 -2
- package/dist/components/DataGridCell.cjs +68 -65
- package/dist/components/DataGridCell.js +7 -6
- package/dist/components/DateInput.cjs +23 -23
- package/dist/components/DateInput.js +4 -4
- package/dist/components/DateRangeInput.cjs +23 -23
- package/dist/components/DateRangeInput.js +4 -4
- package/dist/components/Menu.cjs +38 -35
- package/dist/components/Menu.js +6 -4
- package/dist/components/MenuOption.cjs +7 -4
- package/dist/components/MenuOption.js +5 -2
- package/dist/components/Modal.cjs +15 -12
- package/dist/components/Modal.js +5 -3
- package/dist/components/NestedMenu.cjs +9 -6
- package/dist/components/NestedMenu.js +5 -2
- package/dist/components/PDFViewer.cjs +22 -19
- package/dist/components/PDFViewer.js +5 -3
- package/dist/components/ProjectBar.cjs +3 -0
- package/dist/components/ProjectBar.js +4 -1
- package/dist/components/Time.js +2 -1
- package/dist/components/index.cjs +190 -124
- package/dist/components/index.js +56 -36
- package/dist/components/useMenuSystem.cjs +22 -19
- package/dist/components/useMenuSystem.js +5 -2
- package/dist/hooks/index.cjs +66 -2
- package/dist/hooks/index.js +8 -3
- package/dist/utils/index.cjs +25 -0
- package/dist/utils/index.js +3 -1
- package/package.json +1 -1
- package/src/components/DataGrid/index.tsx +57 -31
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useTableLayout.ts +68 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/mergeObjectArrays.ts +18 -0
- package/src/utils.ts +1 -0
- /package/dist/{chunk-6LN6QT6M.js → chunk-VXWSAIB5.js} +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mergeObjectArrays
|
|
3
|
+
} from "./chunk-T3F37S6Z.js";
|
|
4
|
+
|
|
1
5
|
// src/hooks/useKeydown.ts
|
|
2
6
|
import { useEffect } from "react";
|
|
3
7
|
function useKeydown(keys, isActive) {
|
|
@@ -71,9 +75,49 @@ var useMatchesMedia = (query) => {
|
|
|
71
75
|
};
|
|
72
76
|
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
73
77
|
|
|
78
|
+
// src/hooks/useTableLayout.ts
|
|
79
|
+
import { useState as useState2, useEffect as useEffect3, useCallback } from "react";
|
|
80
|
+
function useTableLayout(initialColumns, key) {
|
|
81
|
+
const [columns, setColumns] = useState2(initialColumns);
|
|
82
|
+
const [isReady, setIsReady] = useState2(false);
|
|
83
|
+
const [layoutSignal, setLayoutSignal] = useState2(0);
|
|
84
|
+
useEffect3(() => {
|
|
85
|
+
if (!key) return setIsReady(true);
|
|
86
|
+
const savedLayout = localStorage.getItem(`${key}-tableLayout`);
|
|
87
|
+
if (savedLayout) {
|
|
88
|
+
setColumns(
|
|
89
|
+
mergeObjectArrays(
|
|
90
|
+
initialColumns,
|
|
91
|
+
JSON.parse(savedLayout)
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (!savedLayout) handleSaveLayout(initialColumns, true);
|
|
96
|
+
setLayoutSignal((prev) => prev + 1);
|
|
97
|
+
setIsReady(true);
|
|
98
|
+
}, []);
|
|
99
|
+
const handleSaveLayout = useCallback(
|
|
100
|
+
(setter, _internal) => {
|
|
101
|
+
if (!isReady && !_internal) return null;
|
|
102
|
+
const newColumns = typeof setter === "function" ? setter(columns) : setter;
|
|
103
|
+
if (JSON.stringify(newColumns) === JSON.stringify(columns) && !_internal)
|
|
104
|
+
return null;
|
|
105
|
+
if (key) {
|
|
106
|
+
localStorage.setItem(`${key}-tableLayout`, JSON.stringify(newColumns));
|
|
107
|
+
}
|
|
108
|
+
setColumns(newColumns);
|
|
109
|
+
setLayoutSignal((prev) => prev + 1);
|
|
110
|
+
return newColumns;
|
|
111
|
+
},
|
|
112
|
+
[columns, isReady, key]
|
|
113
|
+
);
|
|
114
|
+
return { columns, setColumns: handleSaveLayout, layoutSignal, isReady };
|
|
115
|
+
}
|
|
116
|
+
|
|
74
117
|
export {
|
|
75
118
|
useKeydown,
|
|
76
119
|
useInfiniteScroll,
|
|
77
120
|
useMatchesMedia,
|
|
78
|
-
useMatchesMobile
|
|
121
|
+
useMatchesMobile,
|
|
122
|
+
useTableLayout
|
|
79
123
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Menu
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JITZWSPR.js";
|
|
4
4
|
import {
|
|
5
5
|
useSubMenuSystem
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NIHZMIOL.js";
|
|
7
7
|
import {
|
|
8
8
|
MenuOption
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ERW3AMED.js";
|
|
10
10
|
import {
|
|
11
11
|
Search
|
|
12
12
|
} from "./chunk-2WRRRPEB.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useMenuPosition
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NIHZMIOL.js";
|
|
4
4
|
import {
|
|
5
5
|
useMatchesMobile
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-E6Y7ZHQX.js";
|
|
7
7
|
import {
|
|
8
8
|
findDocumentRoot
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VXWSAIB5.js";
|
|
10
10
|
import {
|
|
11
11
|
__objRest,
|
|
12
12
|
__spreadProps,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "./chunk-BBZEL7EG.js";
|
|
4
|
+
|
|
1
5
|
// src/utils/date.ts
|
|
2
6
|
function parseInputDate(input) {
|
|
3
7
|
const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
@@ -124,6 +128,15 @@ function isValidDateRangeOrder(fromDate, toDate) {
|
|
|
124
128
|
return to >= from;
|
|
125
129
|
}
|
|
126
130
|
|
|
131
|
+
// src/utils/mergeObjectArrays.ts
|
|
132
|
+
function mergeObjectArrays(arr1, arr2) {
|
|
133
|
+
const maxLength = Math.max(arr1.length, arr2.length);
|
|
134
|
+
return Array.from(
|
|
135
|
+
{ length: maxLength },
|
|
136
|
+
(_, i) => __spreadValues(__spreadValues({}, arr1[i] || {}), arr2[i] || {})
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
127
140
|
export {
|
|
128
141
|
parseInputDate,
|
|
129
142
|
isValidDate,
|
|
@@ -137,5 +150,6 @@ export {
|
|
|
137
150
|
isValidDateRange,
|
|
138
151
|
formatDatePartsToDisplay,
|
|
139
152
|
formatDate,
|
|
140
|
-
isValidDateRangeOrder
|
|
153
|
+
isValidDateRangeOrder,
|
|
154
|
+
mergeObjectArrays
|
|
141
155
|
};
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
} from "./chunk-ZFOANBWG.js";
|
|
16
16
|
import {
|
|
17
17
|
useMatchesMobile
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-E6Y7ZHQX.js";
|
|
19
19
|
import {
|
|
20
20
|
findDocumentRoot
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VXWSAIB5.js";
|
|
22
22
|
|
|
23
23
|
// src/components/Modal.tsx
|
|
24
24
|
import clsx from "clsx";
|
|
@@ -118,7 +118,7 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
118
118
|
|
|
119
119
|
// src/components/DataGridCell.tsx
|
|
120
120
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
121
|
-
var
|
|
121
|
+
var import_react11 = require("react");
|
|
122
122
|
|
|
123
123
|
// src/classNames.ts
|
|
124
124
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -867,11 +867,11 @@ Search.displayName = "Search";
|
|
|
867
867
|
|
|
868
868
|
// src/components/Menu.tsx
|
|
869
869
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
870
|
-
var
|
|
870
|
+
var import_react9 = require("react");
|
|
871
871
|
var import_react_dom = require("react-dom");
|
|
872
872
|
|
|
873
873
|
// src/components/useMenuSystem.tsx
|
|
874
|
-
var
|
|
874
|
+
var import_react8 = require("react");
|
|
875
875
|
|
|
876
876
|
// src/hooks/useKeydown.ts
|
|
877
877
|
var import_react4 = require("react");
|
|
@@ -894,23 +894,49 @@ var useMatchesMedia = (query) => {
|
|
|
894
894
|
};
|
|
895
895
|
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
896
896
|
|
|
897
|
+
// src/utils.ts
|
|
898
|
+
function findDocumentRoot(element) {
|
|
899
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
900
|
+
throw new Error(
|
|
901
|
+
"findDocumentRoot can only be used in a browser environment."
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
if (!element || !(element instanceof Node)) {
|
|
905
|
+
return window.document.body;
|
|
906
|
+
}
|
|
907
|
+
let currentElement = element;
|
|
908
|
+
while (currentElement && currentElement.parentNode) {
|
|
909
|
+
if (currentElement.parentNode === document) {
|
|
910
|
+
return document.body;
|
|
911
|
+
} else if (currentElement.parentNode instanceof DocumentFragment) {
|
|
912
|
+
return currentElement.parentNode;
|
|
913
|
+
} else {
|
|
914
|
+
currentElement = currentElement.parentNode;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
return window.document.body;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
// src/hooks/useTableLayout.ts
|
|
921
|
+
var import_react7 = require("react");
|
|
922
|
+
|
|
897
923
|
// src/components/useMenuSystem.tsx
|
|
898
924
|
function useSubMenuSystem(mobilePositionTo) {
|
|
899
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
925
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
900
926
|
{}
|
|
901
927
|
);
|
|
902
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
903
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
928
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
929
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
904
930
|
null
|
|
905
931
|
);
|
|
906
|
-
const menuRootRef = (0,
|
|
907
|
-
const subMenuRefs = (0,
|
|
908
|
-
const hoverTimeoutRef = (0,
|
|
909
|
-
const closeTimeoutRef = (0,
|
|
910
|
-
const mouseStopTimeoutRef = (0,
|
|
911
|
-
const isMouseMovingRef = (0,
|
|
912
|
-
const pendingOpenActionRef = (0,
|
|
913
|
-
const pendingCloseActionRef = (0,
|
|
932
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
933
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
934
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
935
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
936
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
937
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
938
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
939
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
914
940
|
const isMobile = useMatchesMobile();
|
|
915
941
|
const toggleMenu = (menuId, level) => {
|
|
916
942
|
if (closeTimeoutRef.current) {
|
|
@@ -950,7 +976,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
950
976
|
return newActiveMenus;
|
|
951
977
|
});
|
|
952
978
|
};
|
|
953
|
-
const executePendingActions = (0,
|
|
979
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
954
980
|
if (pendingCloseActionRef.current) {
|
|
955
981
|
pendingCloseActionRef.current();
|
|
956
982
|
pendingCloseActionRef.current = null;
|
|
@@ -1039,7 +1065,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1039
1065
|
const isMenuActive = (menuId, level) => {
|
|
1040
1066
|
return activeMenus[level] === menuId;
|
|
1041
1067
|
};
|
|
1042
|
-
(0,
|
|
1068
|
+
(0, import_react8.useEffect)(() => {
|
|
1043
1069
|
const handleClickOutside = (event) => {
|
|
1044
1070
|
var _a;
|
|
1045
1071
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1058,7 +1084,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1058
1084
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1059
1085
|
};
|
|
1060
1086
|
}, [activeMenus]);
|
|
1061
|
-
(0,
|
|
1087
|
+
(0, import_react8.useEffect)(() => {
|
|
1062
1088
|
return () => {
|
|
1063
1089
|
if (hoverTimeoutRef.current) {
|
|
1064
1090
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1136,13 +1162,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1136
1162
|
};
|
|
1137
1163
|
}
|
|
1138
1164
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1139
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1165
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1140
1166
|
top: 0,
|
|
1141
1167
|
left: 0,
|
|
1142
1168
|
minWidth: 0
|
|
1143
1169
|
});
|
|
1144
1170
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1145
|
-
const updatePosition = (0,
|
|
1171
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1146
1172
|
var _a, _b, _c;
|
|
1147
1173
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1148
1174
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1190,7 +1216,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1190
1216
|
minWidth: triggerRect.width
|
|
1191
1217
|
});
|
|
1192
1218
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1193
|
-
(0,
|
|
1219
|
+
(0, import_react8.useEffect)(() => {
|
|
1194
1220
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1195
1221
|
const handleClickOutside = (event) => {
|
|
1196
1222
|
var _a, _b, _c, _d, _e;
|
|
@@ -1216,7 +1242,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1216
1242
|
options == null ? void 0 : options.menuRef,
|
|
1217
1243
|
options == null ? void 0 : options.additionalRefs
|
|
1218
1244
|
]);
|
|
1219
|
-
(0,
|
|
1245
|
+
(0, import_react8.useEffect)(() => {
|
|
1220
1246
|
updatePosition();
|
|
1221
1247
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1222
1248
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1233,29 +1259,6 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1233
1259
|
return { menuPosition, updatePosition };
|
|
1234
1260
|
}
|
|
1235
1261
|
|
|
1236
|
-
// src/utils.ts
|
|
1237
|
-
function findDocumentRoot(element) {
|
|
1238
|
-
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
1239
|
-
throw new Error(
|
|
1240
|
-
"findDocumentRoot can only be used in a browser environment."
|
|
1241
|
-
);
|
|
1242
|
-
}
|
|
1243
|
-
if (!element || !(element instanceof Node)) {
|
|
1244
|
-
return window.document.body;
|
|
1245
|
-
}
|
|
1246
|
-
let currentElement = element;
|
|
1247
|
-
while (currentElement && currentElement.parentNode) {
|
|
1248
|
-
if (currentElement.parentNode === document) {
|
|
1249
|
-
return document.body;
|
|
1250
|
-
} else if (currentElement.parentNode instanceof DocumentFragment) {
|
|
1251
|
-
return currentElement.parentNode;
|
|
1252
|
-
} else {
|
|
1253
|
-
currentElement = currentElement.parentNode;
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
return window.document.body;
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
1262
|
// src/components/Menu.tsx
|
|
1260
1263
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1261
1264
|
var Menu = (_a) => {
|
|
@@ -1298,9 +1301,9 @@ var Menu = (_a) => {
|
|
|
1298
1301
|
"menuName",
|
|
1299
1302
|
"calculateMinMaxHeight"
|
|
1300
1303
|
]);
|
|
1301
|
-
const internalRef = (0,
|
|
1304
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1302
1305
|
const actualRef = ref || internalRef;
|
|
1303
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1306
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1304
1307
|
const isMobile = useMatchesMobile();
|
|
1305
1308
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1306
1309
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1313,7 +1316,7 @@ var Menu = (_a) => {
|
|
|
1313
1316
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1314
1317
|
}
|
|
1315
1318
|
);
|
|
1316
|
-
(0,
|
|
1319
|
+
(0, import_react9.useEffect)(() => {
|
|
1317
1320
|
if (calculateMinMaxHeight) {
|
|
1318
1321
|
return;
|
|
1319
1322
|
}
|
|
@@ -1337,7 +1340,7 @@ var Menu = (_a) => {
|
|
|
1337
1340
|
cancelAnimationFrame(raf);
|
|
1338
1341
|
};
|
|
1339
1342
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1340
|
-
(0,
|
|
1343
|
+
(0, import_react9.useEffect)(() => {
|
|
1341
1344
|
if (!calculateMinMaxHeight) {
|
|
1342
1345
|
return;
|
|
1343
1346
|
}
|
|
@@ -1348,14 +1351,14 @@ var Menu = (_a) => {
|
|
|
1348
1351
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1349
1352
|
}
|
|
1350
1353
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1351
|
-
(0,
|
|
1354
|
+
(0, import_react9.useEffect)(() => {
|
|
1352
1355
|
if (!show) {
|
|
1353
1356
|
return;
|
|
1354
1357
|
}
|
|
1355
1358
|
initializeMenuFocus();
|
|
1356
1359
|
updatePosition();
|
|
1357
1360
|
}, [show, updatePosition]);
|
|
1358
|
-
(0,
|
|
1361
|
+
(0, import_react9.useEffect)(() => {
|
|
1359
1362
|
if (!show || !setShow) {
|
|
1360
1363
|
return;
|
|
1361
1364
|
}
|
|
@@ -1510,7 +1513,7 @@ Menu.displayName = "Menu";
|
|
|
1510
1513
|
|
|
1511
1514
|
// src/components/MenuOption.tsx
|
|
1512
1515
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
1513
|
-
var
|
|
1516
|
+
var import_react10 = require("react");
|
|
1514
1517
|
|
|
1515
1518
|
// src/components/Paragraph.tsx
|
|
1516
1519
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
@@ -1593,10 +1596,10 @@ var MenuOption = ({
|
|
|
1593
1596
|
menuValue,
|
|
1594
1597
|
onMouseMove
|
|
1595
1598
|
}) => {
|
|
1596
|
-
const uniqueId = (0,
|
|
1597
|
-
const internalRef = (0,
|
|
1599
|
+
const uniqueId = (0, import_react10.useId)();
|
|
1600
|
+
const internalRef = (0, import_react10.useRef)(null);
|
|
1598
1601
|
const actualRef = ref || internalRef;
|
|
1599
|
-
const menuId = (0,
|
|
1602
|
+
const menuId = (0, import_react10.useRef)(`menu-${uniqueId}`);
|
|
1600
1603
|
const isMobile = useMatchesMobile();
|
|
1601
1604
|
const handleMouseEnter = () => {
|
|
1602
1605
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
@@ -1747,7 +1750,7 @@ function highlightMatch(text, searchValue) {
|
|
|
1747
1750
|
|
|
1748
1751
|
// src/components/DataGridCell.tsx
|
|
1749
1752
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1750
|
-
var DataGridCell = (0,
|
|
1753
|
+
var DataGridCell = (0, import_react11.memo)(
|
|
1751
1754
|
(_a) => {
|
|
1752
1755
|
var _b = _a, {
|
|
1753
1756
|
id,
|
|
@@ -1785,10 +1788,10 @@ var DataGridCell = (0, import_react10.memo)(
|
|
|
1785
1788
|
"testid"
|
|
1786
1789
|
]);
|
|
1787
1790
|
const Element = type === "header" ? "th" : "td";
|
|
1788
|
-
const timerRef = (0,
|
|
1789
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
1790
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
1791
|
-
(0,
|
|
1791
|
+
const timerRef = (0, import_react11.useRef)(null);
|
|
1792
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react11.useState)(false);
|
|
1793
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react11.useState)(false);
|
|
1794
|
+
(0, import_react11.useEffect)(() => {
|
|
1792
1795
|
return () => {
|
|
1793
1796
|
if (timerRef.current) {
|
|
1794
1797
|
clearTimeout(timerRef.current);
|
|
@@ -1897,12 +1900,12 @@ function DataCellHeader(_a) {
|
|
|
1897
1900
|
"useMenuDefaultMinWidth"
|
|
1898
1901
|
]);
|
|
1899
1902
|
var _a2, _b2, _c;
|
|
1900
|
-
const [showMenu, setShowMenu] = (0,
|
|
1901
|
-
const [filter, setFilter] = (0,
|
|
1903
|
+
const [showMenu, setShowMenu] = (0, import_react11.useState)(false);
|
|
1904
|
+
const [filter, setFilter] = (0, import_react11.useState)(
|
|
1902
1905
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
1903
1906
|
);
|
|
1904
|
-
const ref = (0,
|
|
1905
|
-
const predeterminedPinned = (0,
|
|
1907
|
+
const ref = (0, import_react11.useRef)(null);
|
|
1908
|
+
const predeterminedPinned = (0, import_react11.useRef)(false);
|
|
1906
1909
|
const {
|
|
1907
1910
|
menuRootRef,
|
|
1908
1911
|
isMenuActive,
|
|
@@ -1910,7 +1913,7 @@ function DataCellHeader(_a) {
|
|
|
1910
1913
|
listeners: subMenuListeners,
|
|
1911
1914
|
mobileHide
|
|
1912
1915
|
} = useSubMenuSystem(node ? node : ref);
|
|
1913
|
-
(0,
|
|
1916
|
+
(0, import_react11.useEffect)(() => {
|
|
1914
1917
|
var _a3;
|
|
1915
1918
|
const columnPinning = (_a3 = header.getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
1916
1919
|
const left = (columnPinning == null ? void 0 : columnPinning.left) ? columnPinning.left : [];
|
|
@@ -1919,7 +1922,7 @@ function DataCellHeader(_a) {
|
|
|
1919
1922
|
header.column.id
|
|
1920
1923
|
);
|
|
1921
1924
|
}, []);
|
|
1922
|
-
(0,
|
|
1925
|
+
(0, import_react11.useEffect)(() => {
|
|
1923
1926
|
const handler = setTimeout(() => {
|
|
1924
1927
|
header.column.setFilterValue(filter);
|
|
1925
1928
|
}, 500);
|
|
@@ -4,12 +4,13 @@ import {
|
|
|
4
4
|
DataGridCell,
|
|
5
5
|
DragAlongCell,
|
|
6
6
|
DraggableCellHeader
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-EFX3RPW4.js";
|
|
8
|
+
import "../chunk-JITZWSPR.js";
|
|
9
|
+
import "../chunk-NIHZMIOL.js";
|
|
10
|
+
import "../chunk-ERW3AMED.js";
|
|
11
|
+
import "../chunk-E6Y7ZHQX.js";
|
|
12
|
+
import "../chunk-VXWSAIB5.js";
|
|
13
|
+
import "../chunk-T3F37S6Z.js";
|
|
13
14
|
import "../chunk-2WRRRPEB.js";
|
|
14
15
|
import "../chunk-7W4I2NK3.js";
|
|
15
16
|
import "../chunk-5UH6QUFB.js";
|
|
@@ -1019,29 +1019,6 @@ function CalendarRange({
|
|
|
1019
1019
|
);
|
|
1020
1020
|
}
|
|
1021
1021
|
|
|
1022
|
-
// src/utils.ts
|
|
1023
|
-
function findDocumentRoot(element) {
|
|
1024
|
-
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
1025
|
-
throw new Error(
|
|
1026
|
-
"findDocumentRoot can only be used in a browser environment."
|
|
1027
|
-
);
|
|
1028
|
-
}
|
|
1029
|
-
if (!element || !(element instanceof Node)) {
|
|
1030
|
-
return window.document.body;
|
|
1031
|
-
}
|
|
1032
|
-
let currentElement = element;
|
|
1033
|
-
while (currentElement && currentElement.parentNode) {
|
|
1034
|
-
if (currentElement.parentNode === document) {
|
|
1035
|
-
return document.body;
|
|
1036
|
-
} else if (currentElement.parentNode instanceof DocumentFragment) {
|
|
1037
|
-
return currentElement.parentNode;
|
|
1038
|
-
} else {
|
|
1039
|
-
currentElement = currentElement.parentNode;
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
return window.document.body;
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
1022
|
// src/utils/date.ts
|
|
1046
1023
|
function parseInputDate(input) {
|
|
1047
1024
|
const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
@@ -1160,6 +1137,29 @@ function formatDate(date) {
|
|
|
1160
1137
|
}
|
|
1161
1138
|
}
|
|
1162
1139
|
|
|
1140
|
+
// src/utils.ts
|
|
1141
|
+
function findDocumentRoot(element) {
|
|
1142
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
1143
|
+
throw new Error(
|
|
1144
|
+
"findDocumentRoot can only be used in a browser environment."
|
|
1145
|
+
);
|
|
1146
|
+
}
|
|
1147
|
+
if (!element || !(element instanceof Node)) {
|
|
1148
|
+
return window.document.body;
|
|
1149
|
+
}
|
|
1150
|
+
let currentElement = element;
|
|
1151
|
+
while (currentElement && currentElement.parentNode) {
|
|
1152
|
+
if (currentElement.parentNode === document) {
|
|
1153
|
+
return document.body;
|
|
1154
|
+
} else if (currentElement.parentNode instanceof DocumentFragment) {
|
|
1155
|
+
return currentElement.parentNode;
|
|
1156
|
+
} else {
|
|
1157
|
+
currentElement = currentElement.parentNode;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
return window.document.body;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
1163
|
// src/components/DateInput.tsx
|
|
1164
1164
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1165
1165
|
var DateInput = (_a) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findDocumentRoot
|
|
3
|
+
} from "../chunk-VXWSAIB5.js";
|
|
1
4
|
import {
|
|
2
5
|
calculateCursorPosition,
|
|
3
6
|
formatDate,
|
|
4
7
|
formatInputValue,
|
|
5
8
|
isValidDate,
|
|
6
9
|
parseInputDate
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import {
|
|
9
|
-
findDocumentRoot
|
|
10
|
-
} from "../chunk-6LN6QT6M.js";
|
|
10
|
+
} from "../chunk-T3F37S6Z.js";
|
|
11
11
|
import {
|
|
12
12
|
InputBase
|
|
13
13
|
} from "../chunk-7W4I2NK3.js";
|
|
@@ -1019,29 +1019,6 @@ function CalendarRange({
|
|
|
1019
1019
|
);
|
|
1020
1020
|
}
|
|
1021
1021
|
|
|
1022
|
-
// src/utils.ts
|
|
1023
|
-
function findDocumentRoot(element) {
|
|
1024
|
-
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
1025
|
-
throw new Error(
|
|
1026
|
-
"findDocumentRoot can only be used in a browser environment."
|
|
1027
|
-
);
|
|
1028
|
-
}
|
|
1029
|
-
if (!element || !(element instanceof Node)) {
|
|
1030
|
-
return window.document.body;
|
|
1031
|
-
}
|
|
1032
|
-
let currentElement = element;
|
|
1033
|
-
while (currentElement && currentElement.parentNode) {
|
|
1034
|
-
if (currentElement.parentNode === document) {
|
|
1035
|
-
return document.body;
|
|
1036
|
-
} else if (currentElement.parentNode instanceof DocumentFragment) {
|
|
1037
|
-
return currentElement.parentNode;
|
|
1038
|
-
} else {
|
|
1039
|
-
currentElement = currentElement.parentNode;
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
return window.document.body;
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
1022
|
// src/utils/date.ts
|
|
1046
1023
|
function parseInputDate(input) {
|
|
1047
1024
|
const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
@@ -1168,6 +1145,29 @@ function isValidDateRangeOrder(fromDate, toDate) {
|
|
|
1168
1145
|
return to >= from;
|
|
1169
1146
|
}
|
|
1170
1147
|
|
|
1148
|
+
// src/utils.ts
|
|
1149
|
+
function findDocumentRoot(element) {
|
|
1150
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
1151
|
+
throw new Error(
|
|
1152
|
+
"findDocumentRoot can only be used in a browser environment."
|
|
1153
|
+
);
|
|
1154
|
+
}
|
|
1155
|
+
if (!element || !(element instanceof Node)) {
|
|
1156
|
+
return window.document.body;
|
|
1157
|
+
}
|
|
1158
|
+
let currentElement = element;
|
|
1159
|
+
while (currentElement && currentElement.parentNode) {
|
|
1160
|
+
if (currentElement.parentNode === document) {
|
|
1161
|
+
return document.body;
|
|
1162
|
+
} else if (currentElement.parentNode instanceof DocumentFragment) {
|
|
1163
|
+
return currentElement.parentNode;
|
|
1164
|
+
} else {
|
|
1165
|
+
currentElement = currentElement.parentNode;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
return window.document.body;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
1171
|
// src/components/DateRangeInput.tsx
|
|
1172
1172
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1173
1173
|
var DateRangeInput = (_a) => {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findDocumentRoot
|
|
3
|
+
} from "../chunk-VXWSAIB5.js";
|
|
1
4
|
import {
|
|
2
5
|
calculateCursorPosition,
|
|
3
6
|
formatDate,
|
|
@@ -5,10 +8,7 @@ import {
|
|
|
5
8
|
isValidDate,
|
|
6
9
|
isValidDateRangeOrder,
|
|
7
10
|
parseInputDate
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import {
|
|
10
|
-
findDocumentRoot
|
|
11
|
-
} from "../chunk-6LN6QT6M.js";
|
|
11
|
+
} from "../chunk-T3F37S6Z.js";
|
|
12
12
|
import {
|
|
13
13
|
InputBase
|
|
14
14
|
} from "../chunk-7W4I2NK3.js";
|