@dmsi/wedgekit-react 0.0.503 → 0.0.504
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-VOSQMHNF.js → chunk-U5V2IRZX.js} +4 -29
- package/dist/{chunk-S5ZJ3Q7P.js → chunk-VJVY6NPF.js} +3 -3
- package/dist/components/CalendarRange.cjs +75 -128
- package/dist/components/CalendarRange.js +1 -7
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +33 -86
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +1 -7
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +43 -96
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +1 -7
- package/dist/components/DataGrid/PinnedColumns.cjs +58 -111
- package/dist/components/DataGrid/PinnedColumns.js +1 -7
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +34 -87
- package/dist/components/DataGrid/TableBody/LoadingCell.js +1 -7
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +40 -93
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +1 -7
- package/dist/components/DataGrid/TableBody/index.cjs +55 -108
- package/dist/components/DataGrid/TableBody/index.js +1 -7
- package/dist/components/DataGrid/index.cjs +144 -197
- package/dist/components/DataGrid/index.js +1 -7
- package/dist/components/DataGrid/utils.cjs +34 -87
- package/dist/components/DataGrid/utils.js +1 -7
- package/dist/components/DateInput.cjs +94 -147
- package/dist/components/DateInput.js +1 -7
- package/dist/components/DateRangeInput.cjs +94 -147
- package/dist/components/DateRangeInput.js +1 -7
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +41 -94
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +1 -7
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +49 -102
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +1 -7
- package/dist/components/MobileDataGrid/index.cjs +868 -921
- package/dist/components/MobileDataGrid/index.js +1 -7
- package/dist/components/PDFViewer/PDFElement.cjs +5 -31
- package/dist/components/PDFViewer/PDFElement.js +2 -3
- package/dist/components/PDFViewer/PDFPage.cjs +3 -3
- package/dist/components/PDFViewer/PDFPage.js +1 -1
- package/dist/components/PDFViewer/index.cjs +5 -35
- package/dist/components/PDFViewer/index.js +111 -8
- package/dist/components/index.cjs +56 -402
- package/dist/components/index.js +1 -10
- package/package.json +1 -1
- package/src/components/PDFViewer/PDFElement.tsx +3 -38
- package/src/components/PDFViewer/PDFPage.tsx +2 -4
- package/src/components/PDFViewer/index.tsx +1 -9
- package/src/components/index.ts +0 -1
- package/dist/chunk-6XLESQ2U.js +0 -119
- /package/dist/{chunk-C2YTC2CN.js → chunk-JWVZOEF5.js} +0 -0
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MobileDataGrid
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-JWVZOEF5.js";
|
|
4
4
|
import "../../chunk-M7INAUAJ.js";
|
|
5
5
|
import "../../chunk-ELXVDRWS.js";
|
|
6
6
|
import "../../chunk-3UUCDNX3.js";
|
|
7
7
|
import "../../chunk-FJRYHJUV.js";
|
|
8
8
|
import "../../chunk-BQNPOGD5.js";
|
|
9
9
|
import "../../chunk-Y5GD2FJA.js";
|
|
10
|
-
import "../../chunk-6XLESQ2U.js";
|
|
11
|
-
import "../../chunk-VOSQMHNF.js";
|
|
12
|
-
import "../../chunk-YJGDVWTH.js";
|
|
13
|
-
import "../../chunk-S5ZJ3Q7P.js";
|
|
14
10
|
import "../../chunk-MBZ55T2D.js";
|
|
15
11
|
import "../../chunk-2IKT6IHB.js";
|
|
16
12
|
import "../../chunk-YCDDBSVU.js";
|
|
@@ -20,7 +16,6 @@ import "../../chunk-5YNEY3WO.js";
|
|
|
20
16
|
import "../../chunk-5IFPG6TS.js";
|
|
21
17
|
import "../../chunk-AJ5M6MVX.js";
|
|
22
18
|
import "../../chunk-UI7P5J5S.js";
|
|
23
|
-
import "../../chunk-56RPZLV7.js";
|
|
24
19
|
import "../../chunk-MDB26F6T.js";
|
|
25
20
|
import "../../chunk-AT4AWD6B.js";
|
|
26
21
|
import "../../chunk-EWGHVZL5.js";
|
|
@@ -36,7 +31,6 @@ import "../../chunk-CMMQTIVM.js";
|
|
|
36
31
|
import "../../chunk-AG43RS4Q.js";
|
|
37
32
|
import "../../chunk-AKJUBFJK.js";
|
|
38
33
|
import "../../chunk-SUSUNSVZ.js";
|
|
39
|
-
import "../../chunk-SBRRNFOP.js";
|
|
40
34
|
import "../../chunk-Y2GK27RX.js";
|
|
41
35
|
import "../../chunk-QVWYTQKL.js";
|
|
42
36
|
import "../../chunk-F6RZ7MUE.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
"use client";
|
|
3
2
|
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __defProps = Object.defineProperties;
|
|
@@ -63,6 +62,7 @@ __export(PDFElement_exports, {
|
|
|
63
62
|
PDFElement: () => PDFElement
|
|
64
63
|
});
|
|
65
64
|
module.exports = __toCommonJS(PDFElement_exports);
|
|
65
|
+
var import_react_pdf2 = require("@mikecousins/react-pdf");
|
|
66
66
|
var import_react2 = require("react");
|
|
67
67
|
|
|
68
68
|
// src/components/Spinner.tsx
|
|
@@ -458,17 +458,17 @@ var Stack = (_a) => {
|
|
|
458
458
|
};
|
|
459
459
|
|
|
460
460
|
// src/components/PDFViewer/PDFPage.tsx
|
|
461
|
+
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
461
462
|
var import_react = require("react");
|
|
462
463
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
463
464
|
function PdfPage({
|
|
464
465
|
file,
|
|
465
466
|
pageNumber,
|
|
466
467
|
testid,
|
|
467
|
-
isMobile
|
|
468
|
-
usePDF
|
|
468
|
+
isMobile
|
|
469
469
|
}) {
|
|
470
470
|
const canvasRef = (0, import_react.useRef)(null);
|
|
471
|
-
const { pdfDocument } =
|
|
471
|
+
const { pdfDocument } = (0, import_react_pdf.usePdf)({
|
|
472
472
|
file,
|
|
473
473
|
page: pageNumber,
|
|
474
474
|
canvasRef,
|
|
@@ -494,35 +494,10 @@ function PDFElement({
|
|
|
494
494
|
testid,
|
|
495
495
|
isMobile,
|
|
496
496
|
error
|
|
497
|
-
}) {
|
|
498
|
-
const [pdfHook, setPDFHook] = (0, import_react2.useState)(null);
|
|
499
|
-
(0, import_react2.useEffect)(() => {
|
|
500
|
-
import("@mikecousins/react-pdf").then((m) => setPDFHook(m.usePdf));
|
|
501
|
-
}, []);
|
|
502
|
-
if (pdfHook === null) {
|
|
503
|
-
return null;
|
|
504
|
-
}
|
|
505
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
506
|
-
PDFElementInternal,
|
|
507
|
-
{
|
|
508
|
-
b64,
|
|
509
|
-
testid,
|
|
510
|
-
isMobile,
|
|
511
|
-
error,
|
|
512
|
-
usePDF: pdfHook
|
|
513
|
-
}
|
|
514
|
-
);
|
|
515
|
-
}
|
|
516
|
-
function PDFElementInternal({
|
|
517
|
-
b64,
|
|
518
|
-
testid,
|
|
519
|
-
isMobile,
|
|
520
|
-
error,
|
|
521
|
-
usePDF
|
|
522
497
|
}) {
|
|
523
498
|
var _a;
|
|
524
499
|
const canvasRef = (0, import_react2.useRef)(null);
|
|
525
|
-
const { pdfDocument } =
|
|
500
|
+
const { pdfDocument } = (0, import_react_pdf2.usePdf)({
|
|
526
501
|
file: `data:application/pdf;base64,${b64}`,
|
|
527
502
|
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
528
503
|
scale: isMobile ? 1 : 1.3,
|
|
@@ -547,7 +522,6 @@ function PDFElementInternal({
|
|
|
547
522
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
548
523
|
PdfPage,
|
|
549
524
|
{
|
|
550
|
-
usePDF,
|
|
551
525
|
testid: testid ? `${testid}-pdf_page_${i + 1}` : void 0,
|
|
552
526
|
file: `data:application/pdf;base64,${b64}`,
|
|
553
527
|
pageNumber: i + 1
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import {
|
|
3
2
|
PDFElement
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-U5V2IRZX.js";
|
|
4
|
+
import "../../chunk-VJVY6NPF.js";
|
|
6
5
|
import "../../chunk-SBRRNFOP.js";
|
|
7
6
|
import "../../chunk-TPXH53SA.js";
|
|
8
7
|
import "../../chunk-7KWFEH56.js";
|
|
@@ -23,17 +23,17 @@ __export(PDFPage_exports, {
|
|
|
23
23
|
PdfPage: () => PdfPage
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(PDFPage_exports);
|
|
26
|
+
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
26
27
|
var import_react = require("react");
|
|
27
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
29
|
function PdfPage({
|
|
29
30
|
file,
|
|
30
31
|
pageNumber,
|
|
31
32
|
testid,
|
|
32
|
-
isMobile
|
|
33
|
-
usePDF
|
|
33
|
+
isMobile
|
|
34
34
|
}) {
|
|
35
35
|
const canvasRef = (0, import_react.useRef)(null);
|
|
36
|
-
const { pdfDocument } =
|
|
36
|
+
const { pdfDocument } = (0, import_react_pdf.usePdf)({
|
|
37
37
|
file,
|
|
38
38
|
page: pageNumber,
|
|
39
39
|
canvasRef,
|
|
@@ -915,6 +915,7 @@ var Modal = ({
|
|
|
915
915
|
Modal.displayName = "Modal";
|
|
916
916
|
|
|
917
917
|
// src/components/PDFViewer/PDFElement.tsx
|
|
918
|
+
var import_react_pdf2 = require("@mikecousins/react-pdf");
|
|
918
919
|
var import_react8 = require("react");
|
|
919
920
|
|
|
920
921
|
// src/components/Spinner.tsx
|
|
@@ -1168,17 +1169,17 @@ var Stack = (_a) => {
|
|
|
1168
1169
|
};
|
|
1169
1170
|
|
|
1170
1171
|
// src/components/PDFViewer/PDFPage.tsx
|
|
1172
|
+
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
1171
1173
|
var import_react7 = require("react");
|
|
1172
1174
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1173
1175
|
function PdfPage({
|
|
1174
1176
|
file,
|
|
1175
1177
|
pageNumber,
|
|
1176
1178
|
testid,
|
|
1177
|
-
isMobile
|
|
1178
|
-
usePDF
|
|
1179
|
+
isMobile
|
|
1179
1180
|
}) {
|
|
1180
1181
|
const canvasRef = (0, import_react7.useRef)(null);
|
|
1181
|
-
const { pdfDocument } =
|
|
1182
|
+
const { pdfDocument } = (0, import_react_pdf.usePdf)({
|
|
1182
1183
|
file,
|
|
1183
1184
|
page: pageNumber,
|
|
1184
1185
|
canvasRef,
|
|
@@ -1204,35 +1205,10 @@ function PDFElement({
|
|
|
1204
1205
|
testid,
|
|
1205
1206
|
isMobile,
|
|
1206
1207
|
error
|
|
1207
|
-
}) {
|
|
1208
|
-
const [pdfHook, setPDFHook] = (0, import_react8.useState)(null);
|
|
1209
|
-
(0, import_react8.useEffect)(() => {
|
|
1210
|
-
import("@mikecousins/react-pdf").then((m) => setPDFHook(m.usePdf));
|
|
1211
|
-
}, []);
|
|
1212
|
-
if (pdfHook === null) {
|
|
1213
|
-
return null;
|
|
1214
|
-
}
|
|
1215
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1216
|
-
PDFElementInternal,
|
|
1217
|
-
{
|
|
1218
|
-
b64,
|
|
1219
|
-
testid,
|
|
1220
|
-
isMobile,
|
|
1221
|
-
error,
|
|
1222
|
-
usePDF: pdfHook
|
|
1223
|
-
}
|
|
1224
|
-
);
|
|
1225
|
-
}
|
|
1226
|
-
function PDFElementInternal({
|
|
1227
|
-
b64,
|
|
1228
|
-
testid,
|
|
1229
|
-
isMobile,
|
|
1230
|
-
error,
|
|
1231
|
-
usePDF
|
|
1232
1208
|
}) {
|
|
1233
1209
|
var _a;
|
|
1234
1210
|
const canvasRef = (0, import_react8.useRef)(null);
|
|
1235
|
-
const { pdfDocument } =
|
|
1211
|
+
const { pdfDocument } = (0, import_react_pdf2.usePdf)({
|
|
1236
1212
|
file: `data:application/pdf;base64,${b64}`,
|
|
1237
1213
|
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
1238
1214
|
scale: isMobile ? 1 : 1.3,
|
|
@@ -1257,7 +1233,6 @@ function PDFElementInternal({
|
|
|
1257
1233
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1258
1234
|
PdfPage,
|
|
1259
1235
|
{
|
|
1260
|
-
usePDF,
|
|
1261
1236
|
testid: testid ? `${testid}-pdf_page_${i + 1}` : void 0,
|
|
1262
1237
|
file: `data:application/pdf;base64,${b64}`,
|
|
1263
1238
|
pageNumber: i + 1
|
|
@@ -1443,10 +1418,6 @@ function PDFViewer(props) {
|
|
|
1443
1418
|
} = props;
|
|
1444
1419
|
const [currentIndex, setCurrentIndex] = (0, import_react9.useState)(0);
|
|
1445
1420
|
const [isDownloading, setIsDownloading] = (0, import_react9.useState)(false);
|
|
1446
|
-
const [isMounted, setIsMounted] = (0, import_react9.useState)(false);
|
|
1447
|
-
(0, import_react9.useEffect)(() => {
|
|
1448
|
-
setIsMounted(true);
|
|
1449
|
-
}, []);
|
|
1450
1421
|
const handleDownload = (0, import_react9.useCallback)(() => {
|
|
1451
1422
|
setIsDownloading(true);
|
|
1452
1423
|
const link = document.createElement("a");
|
|
@@ -1478,7 +1449,6 @@ function PDFViewer(props) {
|
|
|
1478
1449
|
setIsDownloading(false);
|
|
1479
1450
|
onClose();
|
|
1480
1451
|
}
|
|
1481
|
-
if (!isMounted) return null;
|
|
1482
1452
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1483
1453
|
Modal,
|
|
1484
1454
|
{
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import
|
|
3
|
+
PDFElement
|
|
4
|
+
} from "../../chunk-U5V2IRZX.js";
|
|
5
|
+
import {
|
|
6
|
+
PdfNavigation
|
|
7
|
+
} from "../../chunk-YJGDVWTH.js";
|
|
8
|
+
import "../../chunk-VJVY6NPF.js";
|
|
9
|
+
import {
|
|
10
|
+
DownloadIcon
|
|
11
|
+
} from "../../chunk-56RPZLV7.js";
|
|
12
|
+
import "../../chunk-SBRRNFOP.js";
|
|
13
|
+
import {
|
|
14
|
+
Modal
|
|
15
|
+
} from "../../chunk-BMPL6LCR.js";
|
|
10
16
|
import "../../chunk-4RJKB7LC.js";
|
|
11
17
|
import "../../chunk-WVVEOCEH.js";
|
|
12
18
|
import "../../chunk-CMMQTIVM.js";
|
|
13
19
|
import "../../chunk-AG43RS4Q.js";
|
|
14
20
|
import "../../chunk-AKJUBFJK.js";
|
|
15
|
-
import "../../chunk-SBRRNFOP.js";
|
|
16
21
|
import "../../chunk-URYQ24NF.js";
|
|
17
22
|
import "../../chunk-VXWSAIB5.js";
|
|
18
23
|
import "../../chunk-R3EQIDBX.js";
|
|
@@ -24,6 +29,104 @@ import "../../chunk-NKUETCDA.js";
|
|
|
24
29
|
import "../../chunk-45AHDOAU.js";
|
|
25
30
|
import "../../chunk-7KWFEH56.js";
|
|
26
31
|
import "../../chunk-ORMEWXMH.js";
|
|
32
|
+
|
|
33
|
+
// src/components/PDFViewer/index.tsx
|
|
34
|
+
import { useCallback, useState } from "react";
|
|
35
|
+
import { jsx } from "react/jsx-runtime";
|
|
36
|
+
function PDFViewer(props) {
|
|
37
|
+
const {
|
|
38
|
+
isOpen,
|
|
39
|
+
onClose,
|
|
40
|
+
encodedPdfs,
|
|
41
|
+
customActions,
|
|
42
|
+
testid,
|
|
43
|
+
isMobile,
|
|
44
|
+
title,
|
|
45
|
+
customFooter = false,
|
|
46
|
+
withPagination = true,
|
|
47
|
+
error
|
|
48
|
+
} = props;
|
|
49
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
50
|
+
const [isDownloading, setIsDownloading] = useState(false);
|
|
51
|
+
const handleDownload = useCallback(() => {
|
|
52
|
+
setIsDownloading(true);
|
|
53
|
+
const link = document.createElement("a");
|
|
54
|
+
const currentPdf = encodedPdfs[currentIndex];
|
|
55
|
+
if (!currentPdf) {
|
|
56
|
+
setIsDownloading(false);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
link.href = `data:application/pdf;base64,${currentPdf.base64}`;
|
|
60
|
+
link.download = currentPdf.fileName.endsWith(".pdf") ? currentPdf.fileName : `${currentPdf.fileName}.pdf`;
|
|
61
|
+
document.body.appendChild(link);
|
|
62
|
+
link.click();
|
|
63
|
+
document.body.removeChild(link);
|
|
64
|
+
setIsDownloading(false);
|
|
65
|
+
}, [currentIndex, encodedPdfs]);
|
|
66
|
+
if (!encodedPdfs.length) return null;
|
|
67
|
+
function handleNextFile() {
|
|
68
|
+
if (currentIndex < encodedPdfs.length - 1) {
|
|
69
|
+
setCurrentIndex((prev) => prev + 1);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function handlePreviousFile() {
|
|
73
|
+
if (currentIndex > 0) {
|
|
74
|
+
setCurrentIndex((prev) => prev - 1);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function handleClose() {
|
|
78
|
+
setCurrentIndex(0);
|
|
79
|
+
setIsDownloading(false);
|
|
80
|
+
onClose();
|
|
81
|
+
}
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
Modal,
|
|
84
|
+
{
|
|
85
|
+
testid,
|
|
86
|
+
open: isOpen,
|
|
87
|
+
customFooter,
|
|
88
|
+
onClose: handleClose,
|
|
89
|
+
noWrapper: true,
|
|
90
|
+
showButtons: isMobile && customFooter ? !!customActions : !!encodedPdfs.length,
|
|
91
|
+
customActions: !!encodedPdfs.length && !isMobile && withPagination ? /* @__PURE__ */ jsx(
|
|
92
|
+
PdfNavigation,
|
|
93
|
+
{
|
|
94
|
+
testid,
|
|
95
|
+
currentIndex,
|
|
96
|
+
total: encodedPdfs.length,
|
|
97
|
+
onPrev: handlePreviousFile,
|
|
98
|
+
onNext: handleNextFile,
|
|
99
|
+
disablePrev: currentIndex === 0,
|
|
100
|
+
disableNext: currentIndex === encodedPdfs.length - 1,
|
|
101
|
+
extraActions: customActions,
|
|
102
|
+
fileName: encodedPdfs[currentIndex].fileName
|
|
103
|
+
}
|
|
104
|
+
) : customActions,
|
|
105
|
+
fixedHeightScrolling: true,
|
|
106
|
+
headerIconAlign: "right",
|
|
107
|
+
headerIcon: !isMobile ? /* @__PURE__ */ jsx(
|
|
108
|
+
DownloadIcon,
|
|
109
|
+
{
|
|
110
|
+
testid: testid ? `${testid}-download-icon` : void 0,
|
|
111
|
+
onClick: handleDownload,
|
|
112
|
+
isDownloading
|
|
113
|
+
}
|
|
114
|
+
) : void 0,
|
|
115
|
+
title: isMobile ? title != null ? title : encodedPdfs[currentIndex].fileName : void 0,
|
|
116
|
+
size: isMobile ? "screen" : "large",
|
|
117
|
+
headerClassname: "bg-brand-400 desktop:bg-background-grouped-primary-normal p-mobile-layout-padding text-brand-text-action-primary-normal",
|
|
118
|
+
children: /* @__PURE__ */ jsx(
|
|
119
|
+
PDFElement,
|
|
120
|
+
{
|
|
121
|
+
testid,
|
|
122
|
+
b64: encodedPdfs[currentIndex].base64,
|
|
123
|
+
isMobile,
|
|
124
|
+
error
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
27
130
|
export {
|
|
28
131
|
PDFViewer
|
|
29
132
|
};
|