@dmsi/wedgekit-react 0.0.50 → 0.0.51
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-VC3R5EUH.js → chunk-6R2HCLEL.js} +2 -2
- package/dist/{chunk-VKMJ63WV.js → chunk-ATOEGP3V.js} +3 -3
- package/dist/{chunk-Z4UCFUF7.js → chunk-B6PDZCU7.js} +7 -3
- package/dist/{chunk-T22EH3MG.js → chunk-FOC6LTSX.js} +1 -1
- package/dist/chunk-SWA5WVQO.js +49 -0
- package/dist/components/DataGrid.cjs +83 -85
- package/dist/components/DataGrid.js +5 -5
- package/dist/components/DataGridCell.cjs +51 -53
- package/dist/components/DataGridCell.js +5 -5
- package/dist/components/Menu.cjs +21 -27
- package/dist/components/Menu.js +3 -3
- package/dist/components/MenuOption.cjs +14 -20
- package/dist/components/MenuOption.js +2 -2
- package/dist/components/Modal.cjs +22 -28
- package/dist/components/Modal.js +1 -1
- package/dist/components/NestedMenu.cjs +40 -49
- package/dist/components/NestedMenu.js +4 -33
- package/dist/components/ProjectBar.cjs +10 -16
- package/dist/components/ProjectBar.js +1 -1
- package/dist/components/useMenuSystem.cjs +29 -31
- package/dist/components/useMenuSystem.js +2 -2
- package/dist/hooks/index.cjs +77 -0
- package/dist/{components/useMatchesMedia.js → hooks/index.js} +3 -1
- package/package.json +6 -1
- package/src/components/Menu.tsx +1 -1
- package/src/components/MenuOption.tsx +11 -10
- package/src/components/Modal.tsx +1 -1
- package/src/components/ProjectBar.tsx +1 -1
- package/src/components/useMenuSystem.tsx +23 -12
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useMatchesMedia.ts +18 -0
- package/dist/chunk-SEKKGFM6.js +0 -28
- package/dist/components/useMatchesMedia.cjs +0 -53
- package/src/components/useMatchesMedia.tsx +0 -28
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Menu
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6R2HCLEL.js";
|
|
4
4
|
import {
|
|
5
5
|
useSubMenuSystem
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-B6PDZCU7.js";
|
|
7
7
|
import {
|
|
8
8
|
MenuOption
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FOC6LTSX.js";
|
|
10
10
|
import {
|
|
11
11
|
Search
|
|
12
12
|
} from "./chunk-LP6AZST2.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useMatchesMobile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SWA5WVQO.js";
|
|
4
4
|
import {
|
|
5
5
|
__spreadValues
|
|
6
6
|
} from "./chunk-ORMEWXMH.js";
|
|
@@ -12,7 +12,9 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
12
12
|
{}
|
|
13
13
|
);
|
|
14
14
|
const [activeMenu, setActiveMenu] = useState("");
|
|
15
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = useState(
|
|
15
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = useState(
|
|
16
|
+
null
|
|
17
|
+
);
|
|
16
18
|
const menuRootRef = useRef(null);
|
|
17
19
|
const subMenuRefs = useRef({});
|
|
18
20
|
const hoverTimeoutRef = useRef(null);
|
|
@@ -146,7 +148,9 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
146
148
|
const getAllFocusableMenuElements = () => {
|
|
147
149
|
const elements = [];
|
|
148
150
|
if (menuRootRef.current) {
|
|
149
|
-
elements.push(
|
|
151
|
+
elements.push(
|
|
152
|
+
...Array.from(menuRootRef.current.children)
|
|
153
|
+
);
|
|
150
154
|
}
|
|
151
155
|
Object.values(activeMenus).forEach((menuId) => {
|
|
152
156
|
const submenuEl = subMenuRefs.current[menuId];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// src/hooks/useKeydown.ts
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
function useKeydown(keys, isActive) {
|
|
4
|
+
function handleKeyDown(event) {
|
|
5
|
+
if (!Object.keys(keys).includes(event.key) && !Object.keys(keys).join("").includes("/"))
|
|
6
|
+
return;
|
|
7
|
+
Object.entries(keys).forEach(([key, handler]) => {
|
|
8
|
+
if (event.key !== key && !key.includes("/")) return;
|
|
9
|
+
if (key.includes("/") && key.replace("Space", " ").split("/").includes(event.key)) {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
handler(event);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (event.key === key) {
|
|
15
|
+
event.preventDefault();
|
|
16
|
+
handler(event);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!isActive)
|
|
22
|
+
return document.removeEventListener("keydown", handleKeyDown);
|
|
23
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
24
|
+
return () => {
|
|
25
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
26
|
+
};
|
|
27
|
+
}, [keys, isActive]);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/hooks/useMatchesMedia.ts
|
|
31
|
+
import { useLayoutEffect, useState } from "react";
|
|
32
|
+
var useMatchesMedia = (query) => {
|
|
33
|
+
const [matches, setMatches] = useState();
|
|
34
|
+
useLayoutEffect(() => {
|
|
35
|
+
const mediaQueryList = window.matchMedia(query);
|
|
36
|
+
const listener = () => setMatches(mediaQueryList.matches);
|
|
37
|
+
listener();
|
|
38
|
+
mediaQueryList.addEventListener("change", listener);
|
|
39
|
+
return () => mediaQueryList.removeEventListener("change", listener);
|
|
40
|
+
}, [query]);
|
|
41
|
+
return matches;
|
|
42
|
+
};
|
|
43
|
+
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
useKeydown,
|
|
47
|
+
useMatchesMedia,
|
|
48
|
+
useMatchesMobile
|
|
49
|
+
};
|
|
@@ -63,7 +63,7 @@ __export(DataGrid_exports, {
|
|
|
63
63
|
DataGrid: () => DataGrid
|
|
64
64
|
});
|
|
65
65
|
module.exports = __toCommonJS(DataGrid_exports);
|
|
66
|
-
var
|
|
66
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
67
67
|
var import_react_table = require("@tanstack/react-table");
|
|
68
68
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
69
69
|
var import_core = require("@dnd-kit/core");
|
|
@@ -591,7 +591,7 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
591
591
|
|
|
592
592
|
// src/components/DataGridCell.tsx
|
|
593
593
|
var import_clsx10 = __toESM(require("clsx"), 1);
|
|
594
|
-
var
|
|
594
|
+
var import_react9 = require("react");
|
|
595
595
|
|
|
596
596
|
// src/components/Search.tsx
|
|
597
597
|
var import_react3 = require("react");
|
|
@@ -1170,47 +1170,43 @@ Search.displayName = "Search";
|
|
|
1170
1170
|
|
|
1171
1171
|
// src/components/Menu.tsx
|
|
1172
1172
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1173
|
-
var
|
|
1173
|
+
var import_react7 = require("react");
|
|
1174
1174
|
var import_react_dom = require("react-dom");
|
|
1175
1175
|
|
|
1176
1176
|
// src/components/useMenuSystem.tsx
|
|
1177
|
-
var
|
|
1177
|
+
var import_react6 = require("react");
|
|
1178
1178
|
|
|
1179
|
-
// src/
|
|
1179
|
+
// src/hooks/useKeydown.ts
|
|
1180
1180
|
var import_react4 = require("react");
|
|
1181
|
+
|
|
1182
|
+
// src/hooks/useMatchesMedia.ts
|
|
1183
|
+
var import_react5 = require("react");
|
|
1181
1184
|
var useMatchesMedia = (query) => {
|
|
1182
|
-
const [matches, setMatches] = (0,
|
|
1183
|
-
|
|
1184
|
-
);
|
|
1185
|
-
(0, import_react4.useLayoutEffect)(() => {
|
|
1185
|
+
const [matches, setMatches] = (0, import_react5.useState)();
|
|
1186
|
+
(0, import_react5.useLayoutEffect)(() => {
|
|
1186
1187
|
const mediaQueryList = window.matchMedia(query);
|
|
1187
|
-
const listener = (
|
|
1188
|
-
|
|
1189
|
-
};
|
|
1188
|
+
const listener = () => setMatches(mediaQueryList.matches);
|
|
1189
|
+
listener();
|
|
1190
1190
|
mediaQueryList.addEventListener("change", listener);
|
|
1191
|
-
|
|
1192
|
-
return () => {
|
|
1193
|
-
mediaQueryList.removeEventListener("change", listener);
|
|
1194
|
-
};
|
|
1191
|
+
return () => mediaQueryList.removeEventListener("change", listener);
|
|
1195
1192
|
}, [query]);
|
|
1196
1193
|
return matches;
|
|
1197
1194
|
};
|
|
1198
|
-
var useMatchesMobile = () =>
|
|
1199
|
-
const isMobile = useMatchesMedia("(width < 48rem)");
|
|
1200
|
-
return isMobile;
|
|
1201
|
-
};
|
|
1195
|
+
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
1202
1196
|
|
|
1203
1197
|
// src/components/useMenuSystem.tsx
|
|
1204
1198
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1205
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1199
|
+
const [activeMenus, setActiveMenus] = (0, import_react6.useState)(
|
|
1206
1200
|
{}
|
|
1207
1201
|
);
|
|
1208
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1209
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
const
|
|
1213
|
-
const
|
|
1202
|
+
const [activeMenu, setActiveMenu] = (0, import_react6.useState)("");
|
|
1203
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react6.useState)(
|
|
1204
|
+
null
|
|
1205
|
+
);
|
|
1206
|
+
const menuRootRef = (0, import_react6.useRef)(null);
|
|
1207
|
+
const subMenuRefs = (0, import_react6.useRef)({});
|
|
1208
|
+
const hoverTimeoutRef = (0, import_react6.useRef)(null);
|
|
1209
|
+
const closeTimeoutRef = (0, import_react6.useRef)(null);
|
|
1214
1210
|
const isMobile = useMatchesMobile();
|
|
1215
1211
|
const toggleMenu = (menuId, level) => {
|
|
1216
1212
|
if (closeTimeoutRef.current) {
|
|
@@ -1308,7 +1304,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1308
1304
|
const isMenuActive = (menuId, level) => {
|
|
1309
1305
|
return activeMenus[level] === menuId;
|
|
1310
1306
|
};
|
|
1311
|
-
(0,
|
|
1307
|
+
(0, import_react6.useEffect)(() => {
|
|
1312
1308
|
const handleClickOutside = (event) => {
|
|
1313
1309
|
var _a;
|
|
1314
1310
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1327,7 +1323,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1327
1323
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1328
1324
|
};
|
|
1329
1325
|
}, [activeMenus]);
|
|
1330
|
-
(0,
|
|
1326
|
+
(0, import_react6.useEffect)(() => {
|
|
1331
1327
|
return () => {
|
|
1332
1328
|
if (hoverTimeoutRef.current) {
|
|
1333
1329
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1340,7 +1336,9 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1340
1336
|
const getAllFocusableMenuElements = () => {
|
|
1341
1337
|
const elements = [];
|
|
1342
1338
|
if (menuRootRef.current) {
|
|
1343
|
-
elements.push(
|
|
1339
|
+
elements.push(
|
|
1340
|
+
...Array.from(menuRootRef.current.children)
|
|
1341
|
+
);
|
|
1344
1342
|
}
|
|
1345
1343
|
Object.values(activeMenus).forEach((menuId) => {
|
|
1346
1344
|
const submenuEl = subMenuRefs.current[menuId];
|
|
@@ -1402,13 +1400,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1402
1400
|
};
|
|
1403
1401
|
}
|
|
1404
1402
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1405
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1403
|
+
const [menuPosition, setMenuPosition] = (0, import_react6.useState)({
|
|
1406
1404
|
top: 0,
|
|
1407
1405
|
left: 0,
|
|
1408
1406
|
minWidth: 0
|
|
1409
1407
|
});
|
|
1410
1408
|
const isMobile = useMatchesMobile();
|
|
1411
|
-
const updatePosition = (0,
|
|
1409
|
+
const updatePosition = (0, import_react6.useCallback)(() => {
|
|
1412
1410
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1413
1411
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1414
1412
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1444,7 +1442,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1444
1442
|
minWidth: triggerRect.width
|
|
1445
1443
|
});
|
|
1446
1444
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1447
|
-
(0,
|
|
1445
|
+
(0, import_react6.useEffect)(() => {
|
|
1448
1446
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1449
1447
|
const handleClickOutside = (event) => {
|
|
1450
1448
|
var _a, _b, _c, _d, _e;
|
|
@@ -1470,7 +1468,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1470
1468
|
options == null ? void 0 : options.menuRef,
|
|
1471
1469
|
options == null ? void 0 : options.additionalRefs
|
|
1472
1470
|
]);
|
|
1473
|
-
(0,
|
|
1471
|
+
(0, import_react6.useEffect)(() => {
|
|
1474
1472
|
updatePosition();
|
|
1475
1473
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1476
1474
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1548,9 +1546,9 @@ var Menu = (_a) => {
|
|
|
1548
1546
|
"autoFocusOff",
|
|
1549
1547
|
"menuName"
|
|
1550
1548
|
]);
|
|
1551
|
-
const internalRef = (0,
|
|
1549
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
1552
1550
|
const actualRef = ref || internalRef;
|
|
1553
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1551
|
+
const [maxHeight, setMaxHeight] = (0, import_react7.useState)("180px");
|
|
1554
1552
|
const isMobile = useMatchesMobile();
|
|
1555
1553
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1556
1554
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1562,7 +1560,7 @@ var Menu = (_a) => {
|
|
|
1562
1560
|
topOffset
|
|
1563
1561
|
}
|
|
1564
1562
|
);
|
|
1565
|
-
(0,
|
|
1563
|
+
(0, import_react7.useEffect)(() => {
|
|
1566
1564
|
const raf = requestAnimationFrame(() => {
|
|
1567
1565
|
if (!actualRef || !actualRef.current || customMaxHeight) {
|
|
1568
1566
|
return;
|
|
@@ -1583,14 +1581,14 @@ var Menu = (_a) => {
|
|
|
1583
1581
|
cancelAnimationFrame(raf);
|
|
1584
1582
|
};
|
|
1585
1583
|
}, [actualRef, customMaxHeight]);
|
|
1586
|
-
(0,
|
|
1584
|
+
(0, import_react7.useEffect)(() => {
|
|
1587
1585
|
if (!show) {
|
|
1588
1586
|
return;
|
|
1589
1587
|
}
|
|
1590
1588
|
initializeMenuFocus();
|
|
1591
1589
|
updatePosition();
|
|
1592
1590
|
}, [show, updatePosition]);
|
|
1593
|
-
(0,
|
|
1591
|
+
(0, import_react7.useEffect)(() => {
|
|
1594
1592
|
if (!show || !setShow) {
|
|
1595
1593
|
return;
|
|
1596
1594
|
}
|
|
@@ -1743,7 +1741,7 @@ Menu.displayName = "Menu";
|
|
|
1743
1741
|
|
|
1744
1742
|
// src/components/MenuOption.tsx
|
|
1745
1743
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
1746
|
-
var
|
|
1744
|
+
var import_react8 = require("react");
|
|
1747
1745
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1748
1746
|
var MenuOption = ({
|
|
1749
1747
|
id,
|
|
@@ -1769,10 +1767,10 @@ var MenuOption = ({
|
|
|
1769
1767
|
highlightMatchingText = false,
|
|
1770
1768
|
menuValue
|
|
1771
1769
|
}) => {
|
|
1772
|
-
const uniqueId = (0,
|
|
1773
|
-
const internalRef = (0,
|
|
1770
|
+
const uniqueId = (0, import_react8.useId)();
|
|
1771
|
+
const internalRef = (0, import_react8.useRef)(null);
|
|
1774
1772
|
const actualRef = ref || internalRef;
|
|
1775
|
-
const menuId = (0,
|
|
1773
|
+
const menuId = (0, import_react8.useRef)(`menu-${uniqueId}`);
|
|
1776
1774
|
const isMobile = useMatchesMobile();
|
|
1777
1775
|
const handleMouseEnter = () => {
|
|
1778
1776
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
@@ -1915,7 +1913,7 @@ function highlightMatch(text, searchValue) {
|
|
|
1915
1913
|
|
|
1916
1914
|
// src/components/DataGridCell.tsx
|
|
1917
1915
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1918
|
-
var DataGridCell = (0,
|
|
1916
|
+
var DataGridCell = (0, import_react9.memo)(
|
|
1919
1917
|
(_a) => {
|
|
1920
1918
|
var _b = _a, {
|
|
1921
1919
|
id,
|
|
@@ -1951,10 +1949,10 @@ var DataGridCell = (0, import_react8.memo)(
|
|
|
1951
1949
|
"width"
|
|
1952
1950
|
]);
|
|
1953
1951
|
const Element = type === "header" ? "th" : "td";
|
|
1954
|
-
const timerRef = (0,
|
|
1955
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
1956
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
1957
|
-
(0,
|
|
1952
|
+
const timerRef = (0, import_react9.useRef)(null);
|
|
1953
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react9.useState)(false);
|
|
1954
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react9.useState)(false);
|
|
1955
|
+
(0, import_react9.useEffect)(() => {
|
|
1958
1956
|
return () => {
|
|
1959
1957
|
if (timerRef.current) {
|
|
1960
1958
|
clearTimeout(timerRef.current);
|
|
@@ -2055,12 +2053,12 @@ function DataCellHeader(_a) {
|
|
|
2055
2053
|
"id"
|
|
2056
2054
|
]);
|
|
2057
2055
|
var _a2;
|
|
2058
|
-
const [showMenu, setShowMenu] = (0,
|
|
2059
|
-
const [filter, setFilter] = (0,
|
|
2056
|
+
const [showMenu, setShowMenu] = (0, import_react9.useState)(false);
|
|
2057
|
+
const [filter, setFilter] = (0, import_react9.useState)(
|
|
2060
2058
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2061
2059
|
);
|
|
2062
|
-
const ref = (0,
|
|
2063
|
-
const predeterminedPinned = (0,
|
|
2060
|
+
const ref = (0, import_react9.useRef)(null);
|
|
2061
|
+
const predeterminedPinned = (0, import_react9.useRef)(false);
|
|
2064
2062
|
const {
|
|
2065
2063
|
menuRootRef,
|
|
2066
2064
|
isMenuActive,
|
|
@@ -2068,14 +2066,14 @@ function DataCellHeader(_a) {
|
|
|
2068
2066
|
listeners: subMenuListeners,
|
|
2069
2067
|
mobileHide
|
|
2070
2068
|
} = useSubMenuSystem(node ? node : ref);
|
|
2071
|
-
(0,
|
|
2069
|
+
(0, import_react9.useEffect)(() => {
|
|
2072
2070
|
var _a3;
|
|
2073
2071
|
const columnPinning = (_a3 = header.getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2074
2072
|
const left = (columnPinning == null ? void 0 : columnPinning.left) ? columnPinning.left : [];
|
|
2075
2073
|
const right = (columnPinning == null ? void 0 : columnPinning.right) ? columnPinning.right : [];
|
|
2076
2074
|
predeterminedPinned.current = [...left, ...right].includes(header.column.id);
|
|
2077
2075
|
}, []);
|
|
2078
|
-
(0,
|
|
2076
|
+
(0, import_react9.useEffect)(() => {
|
|
2079
2077
|
const handler = setTimeout(() => {
|
|
2080
2078
|
header.column.setFilterValue(filter);
|
|
2081
2079
|
}, 500);
|
|
@@ -2328,7 +2326,7 @@ function DragAlongCell(_a) {
|
|
|
2328
2326
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2329
2327
|
|
|
2330
2328
|
// src/components/Select.tsx
|
|
2331
|
-
var
|
|
2329
|
+
var import_react10 = require("react");
|
|
2332
2330
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2333
2331
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2334
2332
|
var Select = (_a) => {
|
|
@@ -2359,11 +2357,11 @@ var Select = (_a) => {
|
|
|
2359
2357
|
"displayValue",
|
|
2360
2358
|
"value"
|
|
2361
2359
|
]);
|
|
2362
|
-
const inputRef = (0,
|
|
2363
|
-
const inputContainerRef = (0,
|
|
2364
|
-
const preventFocusOnInitialRender = (0,
|
|
2365
|
-
const [show, setShow] = (0,
|
|
2366
|
-
(0,
|
|
2360
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
2361
|
+
const inputContainerRef = (0, import_react10.useRef)(null);
|
|
2362
|
+
const preventFocusOnInitialRender = (0, import_react10.useRef)(true);
|
|
2363
|
+
const [show, setShow] = (0, import_react10.useState)(false);
|
|
2364
|
+
(0, import_react10.useEffect)(() => {
|
|
2367
2365
|
var _a2;
|
|
2368
2366
|
if (preventFocusOnInitialRender.current) {
|
|
2369
2367
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2471,7 +2469,7 @@ Subheader.displayName = "Subheader";
|
|
|
2471
2469
|
|
|
2472
2470
|
// src/components/Tooltip.tsx
|
|
2473
2471
|
var import_clsx13 = __toESM(require("clsx"), 1);
|
|
2474
|
-
var
|
|
2472
|
+
var import_react11 = require("react");
|
|
2475
2473
|
var import_react_dom2 = require("react-dom");
|
|
2476
2474
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2477
2475
|
var Tooltip = ({
|
|
@@ -2482,11 +2480,11 @@ var Tooltip = ({
|
|
|
2482
2480
|
showOnTruncation = false,
|
|
2483
2481
|
offset = 8
|
|
2484
2482
|
}) => {
|
|
2485
|
-
const ref = (0,
|
|
2486
|
-
const tooltipRef = (0,
|
|
2487
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
2488
|
-
const [isVisible, setIsVisible] = (0,
|
|
2489
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
2483
|
+
const ref = (0, import_react11.useRef)(null);
|
|
2484
|
+
const tooltipRef = (0, import_react11.useRef)(null);
|
|
2485
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react11.useState)({ top: 0, left: 0 });
|
|
2486
|
+
const [isVisible, setIsVisible] = (0, import_react11.useState)(false);
|
|
2487
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react11.useState)(false);
|
|
2490
2488
|
const updatePosition = () => {
|
|
2491
2489
|
if (!ref.current || !tooltipRef.current) return;
|
|
2492
2490
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -2525,14 +2523,14 @@ var Tooltip = ({
|
|
|
2525
2523
|
setIsVisible(false);
|
|
2526
2524
|
setRemoveOpacity(false);
|
|
2527
2525
|
};
|
|
2528
|
-
(0,
|
|
2526
|
+
(0, import_react11.useEffect)(() => {
|
|
2529
2527
|
if (isVisible && tooltipRef.current) {
|
|
2530
2528
|
requestAnimationFrame(() => {
|
|
2531
2529
|
updatePosition();
|
|
2532
2530
|
});
|
|
2533
2531
|
}
|
|
2534
2532
|
}, [isVisible]);
|
|
2535
|
-
(0,
|
|
2533
|
+
(0, import_react11.useEffect)(() => {
|
|
2536
2534
|
if (isVisible) {
|
|
2537
2535
|
window.addEventListener("resize", updatePosition);
|
|
2538
2536
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -2588,7 +2586,7 @@ var Tooltip = ({
|
|
|
2588
2586
|
Tooltip.displayName = "Tooltip";
|
|
2589
2587
|
|
|
2590
2588
|
// src/components/useInfiniteScroll.tsx
|
|
2591
|
-
var
|
|
2589
|
+
var import_react12 = require("react");
|
|
2592
2590
|
function useInfiniteScroll({
|
|
2593
2591
|
containerRef,
|
|
2594
2592
|
onLoadMore,
|
|
@@ -2597,7 +2595,7 @@ function useInfiniteScroll({
|
|
|
2597
2595
|
enabled = true
|
|
2598
2596
|
// ✅ Add this
|
|
2599
2597
|
}) {
|
|
2600
|
-
(0,
|
|
2598
|
+
(0, import_react12.useEffect)(() => {
|
|
2601
2599
|
if (!enabled) return;
|
|
2602
2600
|
const handleScroll = () => {
|
|
2603
2601
|
const el2 = containerRef.current;
|
|
@@ -2653,12 +2651,12 @@ function DataGrid({
|
|
|
2653
2651
|
predeterminedRightPins = []
|
|
2654
2652
|
}) {
|
|
2655
2653
|
var _a, _b, _c, _d, _e;
|
|
2656
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
2654
|
+
const [columnOrder, setColumnOrder] = (0, import_react13.useState)(
|
|
2657
2655
|
() => columns.map((c) => c.id)
|
|
2658
2656
|
);
|
|
2659
|
-
const [localSorting, setLocalSorting] = (0,
|
|
2660
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
2661
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
2657
|
+
const [localSorting, setLocalSorting] = (0, import_react13.useState)([]);
|
|
2658
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react13.useState)([]);
|
|
2659
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react13.useState)({});
|
|
2662
2660
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
2663
2661
|
const setSortingState = pagination ? (updaterOrValue) => {
|
|
2664
2662
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(
|
|
@@ -2676,9 +2674,9 @@ function DataGrid({
|
|
|
2676
2674
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
2677
2675
|
(onRowSelectionChange != null ? onRowSelectionChange : setLocalRowSelection)(value);
|
|
2678
2676
|
} : setLocalRowSelection;
|
|
2679
|
-
const dndId = (0,
|
|
2680
|
-
const containerRef =
|
|
2681
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
2677
|
+
const dndId = (0, import_react13.useId)();
|
|
2678
|
+
const containerRef = import_react13.default.useRef(null);
|
|
2679
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react13.useState)(() => {
|
|
2682
2680
|
const initialVisibility = {};
|
|
2683
2681
|
columns.forEach((column) => {
|
|
2684
2682
|
var _a2, _b2;
|
|
@@ -2688,13 +2686,13 @@ function DataGrid({
|
|
|
2688
2686
|
});
|
|
2689
2687
|
return initialVisibility;
|
|
2690
2688
|
});
|
|
2691
|
-
const toggleColumnVisibility = (0,
|
|
2689
|
+
const toggleColumnVisibility = (0, import_react13.useCallback)(
|
|
2692
2690
|
(columnId, isVisible) => {
|
|
2693
2691
|
setColumnVisibility((prev) => __spreadProps(__spreadValues({}, prev), { [columnId]: isVisible }));
|
|
2694
2692
|
},
|
|
2695
2693
|
[setColumnVisibility]
|
|
2696
2694
|
);
|
|
2697
|
-
const resetColumnVisibility = (0,
|
|
2695
|
+
const resetColumnVisibility = (0, import_react13.useCallback)(() => {
|
|
2698
2696
|
setColumnVisibility(() => {
|
|
2699
2697
|
const initialVisibility = {};
|
|
2700
2698
|
columns.forEach((column) => {
|
|
@@ -2920,7 +2918,7 @@ function DataGrid({
|
|
|
2920
2918
|
header.id
|
|
2921
2919
|
);
|
|
2922
2920
|
}
|
|
2923
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react13.default.Fragment, { children: ((_c2 = header.column.columnDef.meta) == null ? void 0 : _c2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2924
2922
|
DataGridCell,
|
|
2925
2923
|
{
|
|
2926
2924
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3267,7 +3265,7 @@ function TableBodyRow({
|
|
|
3267
3265
|
if (!cell) {
|
|
3268
3266
|
return;
|
|
3269
3267
|
}
|
|
3270
|
-
return ((_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3268
|
+
return ((_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react13.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3271
3269
|
CellElement,
|
|
3272
3270
|
{
|
|
3273
3271
|
id: id ? `${id}-cell-${cell.id}` : void 0,
|
|
@@ -3368,7 +3366,7 @@ function PinnedColumns(_a) {
|
|
|
3368
3366
|
header.id
|
|
3369
3367
|
);
|
|
3370
3368
|
}
|
|
3371
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react13.default.Fragment, { children: ((_c = header.column.columnDef.meta) == null ? void 0 : _c.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3372
3370
|
DataGridCell,
|
|
3373
3371
|
{
|
|
3374
3372
|
type: "header",
|
|
@@ -3434,8 +3432,8 @@ function ColumnSelectorHeaderCell({
|
|
|
3434
3432
|
toggleColumnVisibility,
|
|
3435
3433
|
resetColumnVisibility
|
|
3436
3434
|
}) {
|
|
3437
|
-
const ref = (0,
|
|
3438
|
-
const [show, setShow] = (0,
|
|
3435
|
+
const ref = (0, import_react13.useRef)(null);
|
|
3436
|
+
const [show, setShow] = (0, import_react13.useState)(false);
|
|
3439
3437
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3440
3438
|
DataGridCell,
|
|
3441
3439
|
{
|
|
@@ -3500,7 +3498,7 @@ function ColumnSelectorMenuOption({
|
|
|
3500
3498
|
column,
|
|
3501
3499
|
toggleColumnVisibility
|
|
3502
3500
|
}) {
|
|
3503
|
-
const [isVisible, setIsVisible] = (0,
|
|
3501
|
+
const [isVisible, setIsVisible] = (0, import_react13.useState)(column.getIsVisible());
|
|
3504
3502
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
3505
3503
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuOption, { id, selected: isVisible, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3506
3504
|
Checkbox,
|
|
@@ -16,15 +16,15 @@ import {
|
|
|
16
16
|
DataGridCell,
|
|
17
17
|
DragAlongCell,
|
|
18
18
|
DraggableCellHeader
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-ATOEGP3V.js";
|
|
20
20
|
import {
|
|
21
21
|
Menu
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import "../chunk-
|
|
22
|
+
} from "../chunk-6R2HCLEL.js";
|
|
23
|
+
import "../chunk-B6PDZCU7.js";
|
|
24
24
|
import {
|
|
25
25
|
MenuOption
|
|
26
|
-
} from "../chunk-
|
|
27
|
-
import "../chunk-
|
|
26
|
+
} from "../chunk-FOC6LTSX.js";
|
|
27
|
+
import "../chunk-SWA5WVQO.js";
|
|
28
28
|
import {
|
|
29
29
|
Search
|
|
30
30
|
} from "../chunk-LP6AZST2.js";
|