@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
package/dist/components/Menu.cjs
CHANGED
|
@@ -64,11 +64,11 @@ __export(Menu_exports, {
|
|
|
64
64
|
});
|
|
65
65
|
module.exports = __toCommonJS(Menu_exports);
|
|
66
66
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
67
|
-
var
|
|
67
|
+
var import_react6 = require("react");
|
|
68
68
|
var import_react_dom = require("react-dom");
|
|
69
69
|
|
|
70
70
|
// src/components/useMenuSystem.tsx
|
|
71
|
-
var
|
|
71
|
+
var import_react5 = require("react");
|
|
72
72
|
|
|
73
73
|
// src/hooks/useKeydown.ts
|
|
74
74
|
var import_react = require("react");
|
|
@@ -91,15 +91,41 @@ var useMatchesMedia = (query) => {
|
|
|
91
91
|
};
|
|
92
92
|
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
93
93
|
|
|
94
|
+
// src/utils.ts
|
|
95
|
+
function findDocumentRoot(element) {
|
|
96
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
97
|
+
throw new Error(
|
|
98
|
+
"findDocumentRoot can only be used in a browser environment."
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
if (!element || !(element instanceof Node)) {
|
|
102
|
+
return window.document.body;
|
|
103
|
+
}
|
|
104
|
+
let currentElement = element;
|
|
105
|
+
while (currentElement && currentElement.parentNode) {
|
|
106
|
+
if (currentElement.parentNode === document) {
|
|
107
|
+
return document.body;
|
|
108
|
+
} else if (currentElement.parentNode instanceof DocumentFragment) {
|
|
109
|
+
return currentElement.parentNode;
|
|
110
|
+
} else {
|
|
111
|
+
currentElement = currentElement.parentNode;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return window.document.body;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// src/hooks/useTableLayout.ts
|
|
118
|
+
var import_react4 = require("react");
|
|
119
|
+
|
|
94
120
|
// src/components/useMenuSystem.tsx
|
|
95
121
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
96
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
122
|
+
const [menuPosition, setMenuPosition] = (0, import_react5.useState)({
|
|
97
123
|
top: 0,
|
|
98
124
|
left: 0,
|
|
99
125
|
minWidth: 0
|
|
100
126
|
});
|
|
101
127
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
102
|
-
const updatePosition = (0,
|
|
128
|
+
const updatePosition = (0, import_react5.useCallback)(() => {
|
|
103
129
|
var _a, _b, _c;
|
|
104
130
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
105
131
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -147,7 +173,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
147
173
|
minWidth: triggerRect.width
|
|
148
174
|
});
|
|
149
175
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
150
|
-
(0,
|
|
176
|
+
(0, import_react5.useEffect)(() => {
|
|
151
177
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
152
178
|
const handleClickOutside = (event) => {
|
|
153
179
|
var _a, _b, _c, _d, _e;
|
|
@@ -173,7 +199,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
173
199
|
options == null ? void 0 : options.menuRef,
|
|
174
200
|
options == null ? void 0 : options.additionalRefs
|
|
175
201
|
]);
|
|
176
|
-
(0,
|
|
202
|
+
(0, import_react5.useEffect)(() => {
|
|
177
203
|
updatePosition();
|
|
178
204
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
179
205
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -190,29 +216,6 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
190
216
|
return { menuPosition, updatePosition };
|
|
191
217
|
}
|
|
192
218
|
|
|
193
|
-
// src/utils.ts
|
|
194
|
-
function findDocumentRoot(element) {
|
|
195
|
-
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
196
|
-
throw new Error(
|
|
197
|
-
"findDocumentRoot can only be used in a browser environment."
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
if (!element || !(element instanceof Node)) {
|
|
201
|
-
return window.document.body;
|
|
202
|
-
}
|
|
203
|
-
let currentElement = element;
|
|
204
|
-
while (currentElement && currentElement.parentNode) {
|
|
205
|
-
if (currentElement.parentNode === document) {
|
|
206
|
-
return document.body;
|
|
207
|
-
} else if (currentElement.parentNode instanceof DocumentFragment) {
|
|
208
|
-
return currentElement.parentNode;
|
|
209
|
-
} else {
|
|
210
|
-
currentElement = currentElement.parentNode;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return window.document.body;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
219
|
// src/components/Menu.tsx
|
|
217
220
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
218
221
|
var Menu = (_a) => {
|
|
@@ -255,9 +258,9 @@ var Menu = (_a) => {
|
|
|
255
258
|
"menuName",
|
|
256
259
|
"calculateMinMaxHeight"
|
|
257
260
|
]);
|
|
258
|
-
const internalRef = (0,
|
|
261
|
+
const internalRef = (0, import_react6.useRef)(null);
|
|
259
262
|
const actualRef = ref || internalRef;
|
|
260
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
263
|
+
const [maxHeight, setMaxHeight] = (0, import_react6.useState)("180px");
|
|
261
264
|
const isMobile = useMatchesMobile();
|
|
262
265
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
263
266
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -270,7 +273,7 @@ var Menu = (_a) => {
|
|
|
270
273
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
271
274
|
}
|
|
272
275
|
);
|
|
273
|
-
(0,
|
|
276
|
+
(0, import_react6.useEffect)(() => {
|
|
274
277
|
if (calculateMinMaxHeight) {
|
|
275
278
|
return;
|
|
276
279
|
}
|
|
@@ -294,7 +297,7 @@ var Menu = (_a) => {
|
|
|
294
297
|
cancelAnimationFrame(raf);
|
|
295
298
|
};
|
|
296
299
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
297
|
-
(0,
|
|
300
|
+
(0, import_react6.useEffect)(() => {
|
|
298
301
|
if (!calculateMinMaxHeight) {
|
|
299
302
|
return;
|
|
300
303
|
}
|
|
@@ -305,14 +308,14 @@ var Menu = (_a) => {
|
|
|
305
308
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
306
309
|
}
|
|
307
310
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
308
|
-
(0,
|
|
311
|
+
(0, import_react6.useEffect)(() => {
|
|
309
312
|
if (!show) {
|
|
310
313
|
return;
|
|
311
314
|
}
|
|
312
315
|
initializeMenuFocus();
|
|
313
316
|
updatePosition();
|
|
314
317
|
}, [show, updatePosition]);
|
|
315
|
-
(0,
|
|
318
|
+
(0, import_react6.useEffect)(() => {
|
|
316
319
|
if (!show || !setShow) {
|
|
317
320
|
return;
|
|
318
321
|
}
|
package/dist/components/Menu.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Menu
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-JITZWSPR.js";
|
|
5
|
+
import "../chunk-NIHZMIOL.js";
|
|
6
|
+
import "../chunk-E6Y7ZHQX.js";
|
|
7
|
+
import "../chunk-VXWSAIB5.js";
|
|
8
|
+
import "../chunk-T3F37S6Z.js";
|
|
9
|
+
import "../chunk-5UH6QUFB.js";
|
|
8
10
|
import "../chunk-BBZEL7EG.js";
|
|
9
11
|
export {
|
|
10
12
|
Menu
|
|
@@ -64,7 +64,7 @@ __export(MenuOption_exports, {
|
|
|
64
64
|
});
|
|
65
65
|
module.exports = __toCommonJS(MenuOption_exports);
|
|
66
66
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
67
|
-
var
|
|
67
|
+
var import_react5 = require("react");
|
|
68
68
|
|
|
69
69
|
// src/classNames.ts
|
|
70
70
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -345,6 +345,9 @@ var useMatchesMedia = (query) => {
|
|
|
345
345
|
};
|
|
346
346
|
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
347
347
|
|
|
348
|
+
// src/hooks/useTableLayout.ts
|
|
349
|
+
var import_react4 = require("react");
|
|
350
|
+
|
|
348
351
|
// src/components/MenuOption.tsx
|
|
349
352
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
350
353
|
var MenuOption = ({
|
|
@@ -373,10 +376,10 @@ var MenuOption = ({
|
|
|
373
376
|
menuValue,
|
|
374
377
|
onMouseMove
|
|
375
378
|
}) => {
|
|
376
|
-
const uniqueId = (0,
|
|
377
|
-
const internalRef = (0,
|
|
379
|
+
const uniqueId = (0, import_react5.useId)();
|
|
380
|
+
const internalRef = (0, import_react5.useRef)(null);
|
|
378
381
|
const actualRef = ref || internalRef;
|
|
379
|
-
const menuId = (0,
|
|
382
|
+
const menuId = (0, import_react5.useRef)(`menu-${uniqueId}`);
|
|
380
383
|
const isMobile = useMatchesMobile();
|
|
381
384
|
const handleMouseEnter = () => {
|
|
382
385
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
MenuOption
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-ERW3AMED.js";
|
|
5
|
+
import "../chunk-E6Y7ZHQX.js";
|
|
6
|
+
import "../chunk-VXWSAIB5.js";
|
|
7
|
+
import "../chunk-T3F37S6Z.js";
|
|
8
|
+
import "../chunk-5UH6QUFB.js";
|
|
6
9
|
import "../chunk-CJVTFYI4.js";
|
|
7
10
|
import "../chunk-CJELWEO2.js";
|
|
8
11
|
import "../chunk-UAPWR2KE.js";
|
|
@@ -64,7 +64,7 @@ __export(Modal_exports, {
|
|
|
64
64
|
});
|
|
65
65
|
module.exports = __toCommonJS(Modal_exports);
|
|
66
66
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
67
|
-
var
|
|
67
|
+
var import_react6 = require("react");
|
|
68
68
|
|
|
69
69
|
// src/components/Heading.tsx
|
|
70
70
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
@@ -633,11 +633,14 @@ var useMatchesMedia = (query) => {
|
|
|
633
633
|
};
|
|
634
634
|
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
635
635
|
|
|
636
|
-
// src/
|
|
636
|
+
// src/hooks/useTableLayout.ts
|
|
637
637
|
var import_react4 = require("react");
|
|
638
|
+
|
|
639
|
+
// src/components/useMounted.tsx
|
|
640
|
+
var import_react5 = require("react");
|
|
638
641
|
var useMounted = () => {
|
|
639
|
-
const [isMounted, setIsMounted] = (0,
|
|
640
|
-
(0,
|
|
642
|
+
const [isMounted, setIsMounted] = (0, import_react5.useState)(false);
|
|
643
|
+
(0, import_react5.useEffect)(() => {
|
|
641
644
|
setIsMounted(true);
|
|
642
645
|
return () => setIsMounted(false);
|
|
643
646
|
}, []);
|
|
@@ -723,12 +726,12 @@ var Modal = ({
|
|
|
723
726
|
}) => {
|
|
724
727
|
var _a;
|
|
725
728
|
const mounted = useMounted();
|
|
726
|
-
const modalRef = (0,
|
|
727
|
-
const bgRef = (0,
|
|
729
|
+
const modalRef = (0, import_react6.useRef)(null);
|
|
730
|
+
const bgRef = (0, import_react6.useRef)(null);
|
|
728
731
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
729
732
|
const isMobile = useMatchesMobile();
|
|
730
733
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
731
|
-
(0,
|
|
734
|
+
(0, import_react6.useEffect)(() => {
|
|
732
735
|
if (!mounted) return;
|
|
733
736
|
if (!modalRef.current || !bgRef.current) {
|
|
734
737
|
console.error("Modal or background reference is not set.");
|
|
@@ -748,7 +751,7 @@ var Modal = ({
|
|
|
748
751
|
bgFadeIn(bgRef.current);
|
|
749
752
|
}
|
|
750
753
|
}, [mounted, onClose, open, wasOpen]);
|
|
751
|
-
const handleKeyDown = (0,
|
|
754
|
+
const handleKeyDown = (0, import_react6.useCallback)(
|
|
752
755
|
(e) => {
|
|
753
756
|
if (e.key === "Escape") {
|
|
754
757
|
if (onClose) {
|
|
@@ -759,12 +762,12 @@ var Modal = ({
|
|
|
759
762
|
},
|
|
760
763
|
[onClose]
|
|
761
764
|
);
|
|
762
|
-
const handleClose = (0,
|
|
765
|
+
const handleClose = (0, import_react6.useCallback)(() => {
|
|
763
766
|
if (onClose) {
|
|
764
767
|
onClose();
|
|
765
768
|
}
|
|
766
769
|
}, [onClose]);
|
|
767
|
-
(0,
|
|
770
|
+
(0, import_react6.useEffect)(() => {
|
|
768
771
|
if (open) {
|
|
769
772
|
document.addEventListener("keyup", handleKeyDown);
|
|
770
773
|
}
|
|
@@ -772,7 +775,7 @@ var Modal = ({
|
|
|
772
775
|
document.removeEventListener("keyup", handleKeyDown);
|
|
773
776
|
};
|
|
774
777
|
}, [open, handleKeyDown]);
|
|
775
|
-
(0,
|
|
778
|
+
(0, import_react6.useEffect)(() => {
|
|
776
779
|
if (!open) return;
|
|
777
780
|
const scrollY = window.scrollY;
|
|
778
781
|
const body = document.body;
|
|
@@ -793,7 +796,7 @@ var Modal = ({
|
|
|
793
796
|
};
|
|
794
797
|
}, [open]);
|
|
795
798
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
796
|
-
const backgroundClickHandler = (0,
|
|
799
|
+
const backgroundClickHandler = (0, import_react6.useCallback)(
|
|
797
800
|
(e) => {
|
|
798
801
|
const target = e.target;
|
|
799
802
|
const currentTarget = e.currentTarget;
|
package/dist/components/Modal.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Modal
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UKSJPFN2.js";
|
|
5
5
|
import "../chunk-4RJKB7LC.js";
|
|
6
6
|
import "../chunk-47KTDBGA.js";
|
|
7
7
|
import "../chunk-SYEJVSE4.js";
|
|
8
8
|
import "../chunk-A5ROZWIH.js";
|
|
9
9
|
import "../chunk-ZFOANBWG.js";
|
|
10
10
|
import "../chunk-REOLWEZG.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-E6Y7ZHQX.js";
|
|
12
|
+
import "../chunk-VXWSAIB5.js";
|
|
13
|
+
import "../chunk-T3F37S6Z.js";
|
|
14
|
+
import "../chunk-5UH6QUFB.js";
|
|
13
15
|
import "../chunk-SK742QNF.js";
|
|
14
16
|
import "../chunk-UAPWR2KE.js";
|
|
15
17
|
import "../chunk-RDLEIAQU.js";
|
|
@@ -63,7 +63,7 @@ __export(NestedMenu_exports, {
|
|
|
63
63
|
NestedMenu: () => NestedMenu
|
|
64
64
|
});
|
|
65
65
|
module.exports = __toCommonJS(NestedMenu_exports);
|
|
66
|
-
var
|
|
66
|
+
var import_react6 = require("react");
|
|
67
67
|
|
|
68
68
|
// src/components/Icon.tsx
|
|
69
69
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -102,7 +102,7 @@ function Icon(_a) {
|
|
|
102
102
|
|
|
103
103
|
// src/components/MenuOption.tsx
|
|
104
104
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
105
|
-
var
|
|
105
|
+
var import_react5 = require("react");
|
|
106
106
|
|
|
107
107
|
// src/classNames.ts
|
|
108
108
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
@@ -374,6 +374,9 @@ var useMatchesMedia = (query) => {
|
|
|
374
374
|
};
|
|
375
375
|
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
376
376
|
|
|
377
|
+
// src/hooks/useTableLayout.ts
|
|
378
|
+
var import_react4 = require("react");
|
|
379
|
+
|
|
377
380
|
// src/components/MenuOption.tsx
|
|
378
381
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
379
382
|
var MenuOption = ({
|
|
@@ -402,10 +405,10 @@ var MenuOption = ({
|
|
|
402
405
|
menuValue,
|
|
403
406
|
onMouseMove
|
|
404
407
|
}) => {
|
|
405
|
-
const uniqueId = (0,
|
|
406
|
-
const internalRef = (0,
|
|
408
|
+
const uniqueId = (0, import_react5.useId)();
|
|
409
|
+
const internalRef = (0, import_react5.useRef)(null);
|
|
407
410
|
const actualRef = ref || internalRef;
|
|
408
|
-
const menuId = (0,
|
|
411
|
+
const menuId = (0, import_react5.useRef)(`menu-${uniqueId}`);
|
|
409
412
|
const isMobile = useMatchesMobile();
|
|
410
413
|
const handleMouseEnter = () => {
|
|
411
414
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
@@ -559,7 +562,7 @@ var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
|
559
562
|
function NestedMenu(props) {
|
|
560
563
|
var _a;
|
|
561
564
|
const { onMenuClick, currentMenu, testid } = props;
|
|
562
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
565
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react6.useState)(0);
|
|
563
566
|
useKeydown(
|
|
564
567
|
{
|
|
565
568
|
Escape: () => {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
MenuOption
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ERW3AMED.js";
|
|
5
5
|
import {
|
|
6
6
|
useKeydown
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-E6Y7ZHQX.js";
|
|
8
|
+
import "../chunk-VXWSAIB5.js";
|
|
9
|
+
import "../chunk-T3F37S6Z.js";
|
|
10
|
+
import "../chunk-5UH6QUFB.js";
|
|
8
11
|
import "../chunk-CJVTFYI4.js";
|
|
9
12
|
import "../chunk-CJELWEO2.js";
|
|
10
13
|
import {
|
|
@@ -84,11 +84,11 @@ __export(PDFViewer_exports, {
|
|
|
84
84
|
});
|
|
85
85
|
module.exports = __toCommonJS(PDFViewer_exports);
|
|
86
86
|
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
87
|
-
var
|
|
87
|
+
var import_react7 = require("react");
|
|
88
88
|
|
|
89
89
|
// src/components/Modal.tsx
|
|
90
90
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
91
|
-
var
|
|
91
|
+
var import_react6 = require("react");
|
|
92
92
|
|
|
93
93
|
// src/components/Heading.tsx
|
|
94
94
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
@@ -657,11 +657,14 @@ var useMatchesMedia = (query) => {
|
|
|
657
657
|
};
|
|
658
658
|
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
659
659
|
|
|
660
|
-
// src/
|
|
660
|
+
// src/hooks/useTableLayout.ts
|
|
661
661
|
var import_react4 = require("react");
|
|
662
|
+
|
|
663
|
+
// src/components/useMounted.tsx
|
|
664
|
+
var import_react5 = require("react");
|
|
662
665
|
var useMounted = () => {
|
|
663
|
-
const [isMounted, setIsMounted] = (0,
|
|
664
|
-
(0,
|
|
666
|
+
const [isMounted, setIsMounted] = (0, import_react5.useState)(false);
|
|
667
|
+
(0, import_react5.useEffect)(() => {
|
|
665
668
|
setIsMounted(true);
|
|
666
669
|
return () => setIsMounted(false);
|
|
667
670
|
}, []);
|
|
@@ -747,12 +750,12 @@ var Modal = ({
|
|
|
747
750
|
}) => {
|
|
748
751
|
var _a;
|
|
749
752
|
const mounted = useMounted();
|
|
750
|
-
const modalRef = (0,
|
|
751
|
-
const bgRef = (0,
|
|
753
|
+
const modalRef = (0, import_react6.useRef)(null);
|
|
754
|
+
const bgRef = (0, import_react6.useRef)(null);
|
|
752
755
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
753
756
|
const isMobile = useMatchesMobile();
|
|
754
757
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
755
|
-
(0,
|
|
758
|
+
(0, import_react6.useEffect)(() => {
|
|
756
759
|
if (!mounted) return;
|
|
757
760
|
if (!modalRef.current || !bgRef.current) {
|
|
758
761
|
console.error("Modal or background reference is not set.");
|
|
@@ -772,7 +775,7 @@ var Modal = ({
|
|
|
772
775
|
bgFadeIn(bgRef.current);
|
|
773
776
|
}
|
|
774
777
|
}, [mounted, onClose, open, wasOpen]);
|
|
775
|
-
const handleKeyDown = (0,
|
|
778
|
+
const handleKeyDown = (0, import_react6.useCallback)(
|
|
776
779
|
(e) => {
|
|
777
780
|
if (e.key === "Escape") {
|
|
778
781
|
if (onClose) {
|
|
@@ -783,12 +786,12 @@ var Modal = ({
|
|
|
783
786
|
},
|
|
784
787
|
[onClose]
|
|
785
788
|
);
|
|
786
|
-
const handleClose = (0,
|
|
789
|
+
const handleClose = (0, import_react6.useCallback)(() => {
|
|
787
790
|
if (onClose) {
|
|
788
791
|
onClose();
|
|
789
792
|
}
|
|
790
793
|
}, [onClose]);
|
|
791
|
-
(0,
|
|
794
|
+
(0, import_react6.useEffect)(() => {
|
|
792
795
|
if (open) {
|
|
793
796
|
document.addEventListener("keyup", handleKeyDown);
|
|
794
797
|
}
|
|
@@ -796,7 +799,7 @@ var Modal = ({
|
|
|
796
799
|
document.removeEventListener("keyup", handleKeyDown);
|
|
797
800
|
};
|
|
798
801
|
}, [open, handleKeyDown]);
|
|
799
|
-
(0,
|
|
802
|
+
(0, import_react6.useEffect)(() => {
|
|
800
803
|
if (!open) return;
|
|
801
804
|
const scrollY = window.scrollY;
|
|
802
805
|
const body = document.body;
|
|
@@ -817,7 +820,7 @@ var Modal = ({
|
|
|
817
820
|
};
|
|
818
821
|
}, [open]);
|
|
819
822
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
820
|
-
const backgroundClickHandler = (0,
|
|
823
|
+
const backgroundClickHandler = (0, import_react6.useCallback)(
|
|
821
824
|
(e) => {
|
|
822
825
|
const target = e.target;
|
|
823
826
|
const currentTarget = e.currentTarget;
|
|
@@ -1236,9 +1239,9 @@ Paragraph.displayName = "Paragraph";
|
|
|
1236
1239
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1237
1240
|
function PDFViewer(props) {
|
|
1238
1241
|
const { isOpen, onClose, encodedPdfs, customActions, testid } = props;
|
|
1239
|
-
const [currentIndex, setCurrentIndex] = (0,
|
|
1240
|
-
const [isDownloading, setIsDownloading] = (0,
|
|
1241
|
-
const handleDownload = (0,
|
|
1242
|
+
const [currentIndex, setCurrentIndex] = (0, import_react7.useState)(0);
|
|
1243
|
+
const [isDownloading, setIsDownloading] = (0, import_react7.useState)(false);
|
|
1244
|
+
const handleDownload = (0, import_react7.useCallback)(() => {
|
|
1242
1245
|
setIsDownloading(true);
|
|
1243
1246
|
const link = document.createElement("a");
|
|
1244
1247
|
const currentPdf = encodedPdfs[currentIndex];
|
|
@@ -1323,9 +1326,9 @@ function DownloadIcon({
|
|
|
1323
1326
|
);
|
|
1324
1327
|
}
|
|
1325
1328
|
function PDFElement({ b64, testid }) {
|
|
1326
|
-
const canvasRef = (0,
|
|
1327
|
-
const [pages, setPages] = (0,
|
|
1328
|
-
(0,
|
|
1329
|
+
const canvasRef = (0, import_react7.useRef)(null);
|
|
1330
|
+
const [pages, setPages] = (0, import_react7.useState)([]);
|
|
1331
|
+
(0, import_react7.useEffect)(() => {
|
|
1329
1332
|
setPages([]);
|
|
1330
1333
|
}, [b64]);
|
|
1331
1334
|
const { pdfDocument } = (0, import_react_pdf.usePdf)({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Modal
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UKSJPFN2.js";
|
|
5
5
|
import "../chunk-4RJKB7LC.js";
|
|
6
6
|
import "../chunk-47KTDBGA.js";
|
|
7
7
|
import "../chunk-SYEJVSE4.js";
|
|
@@ -13,8 +13,10 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
Heading3
|
|
15
15
|
} from "../chunk-REOLWEZG.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-E6Y7ZHQX.js";
|
|
17
|
+
import "../chunk-VXWSAIB5.js";
|
|
18
|
+
import "../chunk-T3F37S6Z.js";
|
|
19
|
+
import "../chunk-5UH6QUFB.js";
|
|
18
20
|
import {
|
|
19
21
|
Stack
|
|
20
22
|
} from "../chunk-BOWQUDUU.js";
|
|
@@ -196,6 +196,9 @@ var useMatchesMedia = (query) => {
|
|
|
196
196
|
};
|
|
197
197
|
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
198
198
|
|
|
199
|
+
// src/hooks/useTableLayout.ts
|
|
200
|
+
var import_react4 = require("react");
|
|
201
|
+
|
|
199
202
|
// src/components/ProjectBar.tsx
|
|
200
203
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
201
204
|
var ProjectBar = ({
|