@dmsi/wedgekit-react 0.0.490 → 0.0.492

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.
Files changed (46) hide show
  1. package/dist/{chunk-WIDUWFLX.js → chunk-BYY2NTJH.js} +2 -0
  2. package/dist/{chunk-VJVY6NPF.js → chunk-S5ZJ3Q7P.js} +3 -3
  3. package/dist/{chunk-24K4HHV5.js → chunk-TPBEID5X.js} +7 -2
  4. package/dist/{chunk-YNKN6RKF.js → chunk-YEZBNQZI.js} +29 -4
  5. package/dist/components/CalendarRange.cjs +2 -2
  6. package/dist/components/CalendarRange.js +4 -4
  7. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +2 -2
  8. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +4 -4
  9. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +2 -2
  10. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +4 -4
  11. package/dist/components/DataGrid/PinnedColumns.cjs +2 -2
  12. package/dist/components/DataGrid/PinnedColumns.js +4 -4
  13. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +2 -2
  14. package/dist/components/DataGrid/TableBody/LoadingCell.js +4 -4
  15. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +2 -2
  16. package/dist/components/DataGrid/TableBody/TableBodyRow.js +4 -4
  17. package/dist/components/DataGrid/TableBody/index.cjs +2 -2
  18. package/dist/components/DataGrid/TableBody/index.js +4 -4
  19. package/dist/components/DataGrid/index.cjs +2 -2
  20. package/dist/components/DataGrid/index.js +4 -4
  21. package/dist/components/DataGrid/utils.cjs +2 -2
  22. package/dist/components/DataGrid/utils.js +4 -4
  23. package/dist/components/DateInput.cjs +2 -2
  24. package/dist/components/DateInput.js +4 -4
  25. package/dist/components/DateRangeInput.cjs +11 -5
  26. package/dist/components/DateRangeInput.js +13 -7
  27. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +2 -2
  28. package/dist/components/MobileDataGrid/ColumnSelector/index.js +4 -4
  29. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +2 -2
  30. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +4 -4
  31. package/dist/components/MobileDataGrid/index.cjs +2 -2
  32. package/dist/components/MobileDataGrid/index.js +4 -4
  33. package/dist/components/PDFViewer/PDFElement.cjs +31 -5
  34. package/dist/components/PDFViewer/PDFElement.js +3 -2
  35. package/dist/components/PDFViewer/PDFPage.cjs +3 -3
  36. package/dist/components/PDFViewer/PDFPage.js +1 -1
  37. package/dist/components/PDFViewer/index.cjs +35 -5
  38. package/dist/components/PDFViewer/index.js +3 -3
  39. package/dist/components/index.cjs +37 -5
  40. package/dist/components/index.js +4 -4
  41. package/package.json +1 -1
  42. package/src/components/CalendarRange.tsx +3 -0
  43. package/src/components/DateRangeInput.tsx +6 -2
  44. package/src/components/PDFViewer/PDFElement.tsx +38 -3
  45. package/src/components/PDFViewer/PDFPage.tsx +4 -2
  46. package/src/components/PDFViewer/index.tsx +9 -1
@@ -4754,7 +4754,6 @@ var import_jsx_runtime51 = require("react/jsx-runtime");
4754
4754
  var import_react34 = require("react");
4755
4755
 
4756
4756
  // src/components/PDFViewer/PDFElement.tsx
4757
- var import_react_pdf2 = require("@mikecousins/react-pdf");
4758
4757
  var import_react33 = require("react");
4759
4758
 
4760
4759
  // src/components/Spinner.tsx
@@ -4788,7 +4787,6 @@ var Spinner = ({ size = "small", testid }) => {
4788
4787
  Spinner.displayName = "Spinner";
4789
4788
 
4790
4789
  // src/components/PDFViewer/PDFPage.tsx
4791
- var import_react_pdf = require("@mikecousins/react-pdf");
4792
4790
  var import_react32 = require("react");
4793
4791
  var import_jsx_runtime53 = require("react/jsx-runtime");
4794
4792
 
@@ -5050,6 +5048,7 @@ function CalendarRange({
5050
5048
  from,
5051
5049
  to,
5052
5050
  onChange,
5051
+ onPendingFromChange,
5053
5052
  isDateAvailable,
5054
5053
  mode = "double",
5055
5054
  cardStyle = false,
@@ -5134,6 +5133,7 @@ function CalendarRange({
5134
5133
  setPendingFrom(date);
5135
5134
  setSelecting("to");
5136
5135
  setHoveredDate(void 0);
5136
+ onPendingFromChange == null ? void 0 : onPendingFromChange(date.toString());
5137
5137
  } else if (pendingFrom) {
5138
5138
  if (onChange) {
5139
5139
  const [start, end] = import_polyfill.Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  DateInput
3
- } from "../chunk-WIDUWFLX.js";
3
+ } from "../chunk-BYY2NTJH.js";
4
4
  import "../chunk-M7INAUAJ.js";
5
5
  import "../chunk-4Q7T4GJ2.js";
6
6
  import "../chunk-3DEYCNUE.js";
7
7
  import "../chunk-DYBJUTGK.js";
8
- import "../chunk-24K4HHV5.js";
8
+ import "../chunk-TPBEID5X.js";
9
9
  import "../chunk-B53XDCLO.js";
10
10
  import "../chunk-MBZ55T2D.js";
11
11
  import "../chunk-2IKT6IHB.js";
@@ -18,8 +18,8 @@ import "../chunk-5IFPG6TS.js";
18
18
  import "../chunk-KW6V7O3H.js";
19
19
  import "../chunk-AJ5M6MVX.js";
20
20
  import "../chunk-JUFBGNWW.js";
21
- import "../chunk-YNKN6RKF.js";
22
- import "../chunk-VJVY6NPF.js";
21
+ import "../chunk-YEZBNQZI.js";
22
+ import "../chunk-S5ZJ3Q7P.js";
23
23
  import "../chunk-AT4AWD6B.js";
24
24
  import "../chunk-EWGHVZL5.js";
25
25
  import "../chunk-7GHD74J3.js";
@@ -4992,7 +4992,6 @@ var import_jsx_runtime52 = require("react/jsx-runtime");
4992
4992
  var import_react35 = require("react");
4993
4993
 
4994
4994
  // src/components/PDFViewer/PDFElement.tsx
4995
- var import_react_pdf2 = require("@mikecousins/react-pdf");
4996
4995
  var import_react34 = require("react");
4997
4996
 
4998
4997
  // src/components/Spinner.tsx
@@ -5026,7 +5025,6 @@ var Spinner = ({ size = "small", testid }) => {
5026
5025
  Spinner.displayName = "Spinner";
5027
5026
 
5028
5027
  // src/components/PDFViewer/PDFPage.tsx
5029
- var import_react_pdf = require("@mikecousins/react-pdf");
5030
5028
  var import_react33 = require("react");
5031
5029
  var import_jsx_runtime54 = require("react/jsx-runtime");
5032
5030
 
@@ -5288,6 +5286,7 @@ function CalendarRange({
5288
5286
  from,
5289
5287
  to,
5290
5288
  onChange,
5289
+ onPendingFromChange,
5291
5290
  isDateAvailable,
5292
5291
  mode = "double",
5293
5292
  cardStyle = false,
@@ -5372,6 +5371,7 @@ function CalendarRange({
5372
5371
  setPendingFrom(date);
5373
5372
  setSelecting("to");
5374
5373
  setHoveredDate(void 0);
5374
+ onPendingFromChange == null ? void 0 : onPendingFromChange(date.toString());
5375
5375
  } else if (pendingFrom) {
5376
5376
  if (onChange) {
5377
5377
  const [start, end] = import_polyfill.Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
@@ -5678,7 +5678,9 @@ var DateRangeInput = (_a) => {
5678
5678
  readOnly = false,
5679
5679
  single = false,
5680
5680
  disableRange = false,
5681
- label
5681
+ label,
5682
+ isDateAvailable,
5683
+ onPendingFromChange
5682
5684
  } = _b, props = __objRest(_b, [
5683
5685
  "id",
5684
5686
  "testid",
@@ -5689,7 +5691,9 @@ var DateRangeInput = (_a) => {
5689
5691
  "readOnly",
5690
5692
  "single",
5691
5693
  "disableRange",
5692
- "label"
5694
+ "label",
5695
+ "isDateAvailable",
5696
+ "onPendingFromChange"
5693
5697
  ]);
5694
5698
  const [visible, setVisible] = (0, import_react40.useState)(false);
5695
5699
  const [inputValue, setInputValue] = (0, import_react40.useState)("");
@@ -6134,7 +6138,9 @@ var DateRangeInput = (_a) => {
6134
6138
  onChange: handleRangeChange,
6135
6139
  cardStyle: true,
6136
6140
  mode: single ? "single" : "double",
6137
- disableRange
6141
+ disableRange,
6142
+ isDateAvailable,
6143
+ onPendingFromChange
6138
6144
  }
6139
6145
  )
6140
6146
  }
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  CalendarRange
3
- } from "../chunk-WIDUWFLX.js";
3
+ } from "../chunk-BYY2NTJH.js";
4
4
  import "../chunk-M7INAUAJ.js";
5
5
  import "../chunk-4Q7T4GJ2.js";
6
6
  import "../chunk-3DEYCNUE.js";
7
7
  import "../chunk-DYBJUTGK.js";
8
- import "../chunk-24K4HHV5.js";
8
+ import "../chunk-TPBEID5X.js";
9
9
  import "../chunk-B53XDCLO.js";
10
10
  import "../chunk-MBZ55T2D.js";
11
11
  import "../chunk-2IKT6IHB.js";
@@ -18,8 +18,8 @@ import "../chunk-5IFPG6TS.js";
18
18
  import "../chunk-KW6V7O3H.js";
19
19
  import "../chunk-AJ5M6MVX.js";
20
20
  import "../chunk-JUFBGNWW.js";
21
- import "../chunk-YNKN6RKF.js";
22
- import "../chunk-VJVY6NPF.js";
21
+ import "../chunk-YEZBNQZI.js";
22
+ import "../chunk-S5ZJ3Q7P.js";
23
23
  import "../chunk-AT4AWD6B.js";
24
24
  import "../chunk-EWGHVZL5.js";
25
25
  import "../chunk-7GHD74J3.js";
@@ -96,7 +96,9 @@ var DateRangeInput = (_a) => {
96
96
  readOnly = false,
97
97
  single = false,
98
98
  disableRange = false,
99
- label
99
+ label,
100
+ isDateAvailable,
101
+ onPendingFromChange
100
102
  } = _b, props = __objRest(_b, [
101
103
  "id",
102
104
  "testid",
@@ -107,7 +109,9 @@ var DateRangeInput = (_a) => {
107
109
  "readOnly",
108
110
  "single",
109
111
  "disableRange",
110
- "label"
112
+ "label",
113
+ "isDateAvailable",
114
+ "onPendingFromChange"
111
115
  ]);
112
116
  const [visible, setVisible] = useState(false);
113
117
  const [inputValue, setInputValue] = useState("");
@@ -552,7 +556,9 @@ var DateRangeInput = (_a) => {
552
556
  onChange: handleRangeChange,
553
557
  cardStyle: true,
554
558
  mode: single ? "single" : "double",
555
- disableRange
559
+ disableRange,
560
+ isDateAvailable,
561
+ onPendingFromChange
556
562
  }
557
563
  )
558
564
  }
@@ -4217,6 +4217,7 @@ function CalendarRange({
4217
4217
  from,
4218
4218
  to,
4219
4219
  onChange,
4220
+ onPendingFromChange,
4220
4221
  isDateAvailable,
4221
4222
  mode = "double",
4222
4223
  cardStyle = false,
@@ -4301,6 +4302,7 @@ function CalendarRange({
4301
4302
  setPendingFrom(date);
4302
4303
  setSelecting("to");
4303
4304
  setHoveredDate(void 0);
4305
+ onPendingFromChange == null ? void 0 : onPendingFromChange(date.toString());
4304
4306
  } else if (pendingFrom) {
4305
4307
  if (onChange) {
4306
4308
  const [start, end] = import_polyfill.Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
@@ -5446,7 +5448,6 @@ var import_jsx_runtime52 = require("react/jsx-runtime");
5446
5448
  var import_react35 = require("react");
5447
5449
 
5448
5450
  // src/components/PDFViewer/PDFElement.tsx
5449
- var import_react_pdf2 = require("@mikecousins/react-pdf");
5450
5451
  var import_react34 = require("react");
5451
5452
 
5452
5453
  // src/components/Spinner.tsx
@@ -5480,7 +5481,6 @@ var Spinner = ({ size = "small", testid }) => {
5480
5481
  Spinner.displayName = "Spinner";
5481
5482
 
5482
5483
  // src/components/PDFViewer/PDFPage.tsx
5483
- var import_react_pdf = require("@mikecousins/react-pdf");
5484
5484
  var import_react33 = require("react");
5485
5485
  var import_jsx_runtime54 = require("react/jsx-runtime");
5486
5486
 
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ColumnSelector
3
- } from "../../../chunk-WIDUWFLX.js";
3
+ } from "../../../chunk-BYY2NTJH.js";
4
4
  import "../../../chunk-M7INAUAJ.js";
5
5
  import "../../../chunk-4Q7T4GJ2.js";
6
6
  import "../../../chunk-3DEYCNUE.js";
7
7
  import "../../../chunk-DYBJUTGK.js";
8
- import "../../../chunk-24K4HHV5.js";
8
+ import "../../../chunk-TPBEID5X.js";
9
9
  import "../../../chunk-B53XDCLO.js";
10
10
  import "../../../chunk-MBZ55T2D.js";
11
11
  import "../../../chunk-2IKT6IHB.js";
@@ -18,8 +18,8 @@ import "../../../chunk-5IFPG6TS.js";
18
18
  import "../../../chunk-KW6V7O3H.js";
19
19
  import "../../../chunk-AJ5M6MVX.js";
20
20
  import "../../../chunk-JUFBGNWW.js";
21
- import "../../../chunk-YNKN6RKF.js";
22
- import "../../../chunk-VJVY6NPF.js";
21
+ import "../../../chunk-YEZBNQZI.js";
22
+ import "../../../chunk-S5ZJ3Q7P.js";
23
23
  import "../../../chunk-AT4AWD6B.js";
24
24
  import "../../../chunk-EWGHVZL5.js";
25
25
  import "../../../chunk-7GHD74J3.js";
@@ -4518,6 +4518,7 @@ function CalendarRange({
4518
4518
  from,
4519
4519
  to,
4520
4520
  onChange,
4521
+ onPendingFromChange,
4521
4522
  isDateAvailable,
4522
4523
  mode = "double",
4523
4524
  cardStyle = false,
@@ -4602,6 +4603,7 @@ function CalendarRange({
4602
4603
  setPendingFrom(date);
4603
4604
  setSelecting("to");
4604
4605
  setHoveredDate(void 0);
4606
+ onPendingFromChange == null ? void 0 : onPendingFromChange(date.toString());
4605
4607
  } else if (pendingFrom) {
4606
4608
  if (onChange) {
4607
4609
  const [start, end] = import_polyfill.Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
@@ -5684,7 +5686,6 @@ var import_jsx_runtime51 = require("react/jsx-runtime");
5684
5686
  var import_react35 = require("react");
5685
5687
 
5686
5688
  // src/components/PDFViewer/PDFElement.tsx
5687
- var import_react_pdf2 = require("@mikecousins/react-pdf");
5688
5689
  var import_react34 = require("react");
5689
5690
 
5690
5691
  // src/components/Spinner.tsx
@@ -5718,7 +5719,6 @@ var Spinner = ({ size = "small", testid }) => {
5718
5719
  Spinner.displayName = "Spinner";
5719
5720
 
5720
5721
  // src/components/PDFViewer/PDFPage.tsx
5721
- var import_react_pdf = require("@mikecousins/react-pdf");
5722
5722
  var import_react33 = require("react");
5723
5723
  var import_jsx_runtime53 = require("react/jsx-runtime");
5724
5724
 
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  MobileDataGridHeader
3
- } from "../../chunk-WIDUWFLX.js";
3
+ } from "../../chunk-BYY2NTJH.js";
4
4
  import "../../chunk-M7INAUAJ.js";
5
5
  import "../../chunk-4Q7T4GJ2.js";
6
6
  import "../../chunk-3DEYCNUE.js";
7
7
  import "../../chunk-DYBJUTGK.js";
8
- import "../../chunk-24K4HHV5.js";
8
+ import "../../chunk-TPBEID5X.js";
9
9
  import "../../chunk-B53XDCLO.js";
10
10
  import "../../chunk-MBZ55T2D.js";
11
11
  import "../../chunk-2IKT6IHB.js";
@@ -18,8 +18,8 @@ import "../../chunk-5IFPG6TS.js";
18
18
  import "../../chunk-KW6V7O3H.js";
19
19
  import "../../chunk-AJ5M6MVX.js";
20
20
  import "../../chunk-JUFBGNWW.js";
21
- import "../../chunk-YNKN6RKF.js";
22
- import "../../chunk-VJVY6NPF.js";
21
+ import "../../chunk-YEZBNQZI.js";
22
+ import "../../chunk-S5ZJ3Q7P.js";
23
23
  import "../../chunk-AT4AWD6B.js";
24
24
  import "../../chunk-EWGHVZL5.js";
25
25
  import "../../chunk-7GHD74J3.js";
@@ -4518,6 +4518,7 @@ function CalendarRange({
4518
4518
  from,
4519
4519
  to,
4520
4520
  onChange,
4521
+ onPendingFromChange,
4521
4522
  isDateAvailable,
4522
4523
  mode = "double",
4523
4524
  cardStyle = false,
@@ -4602,6 +4603,7 @@ function CalendarRange({
4602
4603
  setPendingFrom(date);
4603
4604
  setSelecting("to");
4604
4605
  setHoveredDate(void 0);
4606
+ onPendingFromChange == null ? void 0 : onPendingFromChange(date.toString());
4605
4607
  } else if (pendingFrom) {
4606
4608
  if (onChange) {
4607
4609
  const [start, end] = import_polyfill.Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
@@ -5642,7 +5644,6 @@ var Modal = ({
5642
5644
  Modal.displayName = "Modal";
5643
5645
 
5644
5646
  // src/components/PDFViewer/PDFElement.tsx
5645
- var import_react_pdf2 = require("@mikecousins/react-pdf");
5646
5647
  var import_react31 = require("react");
5647
5648
 
5648
5649
  // src/components/Spinner.tsx
@@ -5676,7 +5677,6 @@ var Spinner = ({ size = "small", testid }) => {
5676
5677
  Spinner.displayName = "Spinner";
5677
5678
 
5678
5679
  // src/components/PDFViewer/PDFPage.tsx
5679
- var import_react_pdf = require("@mikecousins/react-pdf");
5680
5680
  var import_react30 = require("react");
5681
5681
  var import_jsx_runtime46 = require("react/jsx-runtime");
5682
5682
 
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  MobileDataGrid
3
- } from "../../chunk-WIDUWFLX.js";
3
+ } from "../../chunk-BYY2NTJH.js";
4
4
  import "../../chunk-M7INAUAJ.js";
5
5
  import "../../chunk-4Q7T4GJ2.js";
6
6
  import "../../chunk-3DEYCNUE.js";
7
7
  import "../../chunk-DYBJUTGK.js";
8
- import "../../chunk-24K4HHV5.js";
8
+ import "../../chunk-TPBEID5X.js";
9
9
  import "../../chunk-B53XDCLO.js";
10
10
  import "../../chunk-MBZ55T2D.js";
11
11
  import "../../chunk-2IKT6IHB.js";
@@ -18,8 +18,8 @@ import "../../chunk-5IFPG6TS.js";
18
18
  import "../../chunk-KW6V7O3H.js";
19
19
  import "../../chunk-AJ5M6MVX.js";
20
20
  import "../../chunk-JUFBGNWW.js";
21
- import "../../chunk-YNKN6RKF.js";
22
- import "../../chunk-VJVY6NPF.js";
21
+ import "../../chunk-YEZBNQZI.js";
22
+ import "../../chunk-S5ZJ3Q7P.js";
23
23
  import "../../chunk-AT4AWD6B.js";
24
24
  import "../../chunk-EWGHVZL5.js";
25
25
  import "../../chunk-7GHD74J3.js";
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __defProps = Object.defineProperties;
@@ -62,7 +63,6 @@ __export(PDFElement_exports, {
62
63
  PDFElement: () => PDFElement
63
64
  });
64
65
  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
@@ -455,17 +455,17 @@ var Stack = (_a) => {
455
455
  };
456
456
 
457
457
  // src/components/PDFViewer/PDFPage.tsx
458
- var import_react_pdf = require("@mikecousins/react-pdf");
459
458
  var import_react = require("react");
460
459
  var import_jsx_runtime3 = require("react/jsx-runtime");
461
460
  function PdfPage({
462
461
  file,
463
462
  pageNumber,
464
463
  testid,
465
- isMobile
464
+ isMobile,
465
+ usePDF
466
466
  }) {
467
467
  const canvasRef = (0, import_react.useRef)(null);
468
- const { pdfDocument } = (0, import_react_pdf.usePdf)({
468
+ const { pdfDocument } = usePDF({
469
469
  file,
470
470
  page: pageNumber,
471
471
  canvasRef,
@@ -491,10 +491,35 @@ function PDFElement({
491
491
  testid,
492
492
  isMobile,
493
493
  error
494
+ }) {
495
+ const [pdfHook, setPDFHook] = (0, import_react2.useState)(null);
496
+ (0, import_react2.useEffect)(() => {
497
+ import("@mikecousins/react-pdf").then((m) => setPDFHook(m.usePdf));
498
+ }, []);
499
+ if (pdfHook === null) {
500
+ return null;
501
+ }
502
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
503
+ PDFElementInternal,
504
+ {
505
+ b64,
506
+ testid,
507
+ isMobile,
508
+ error,
509
+ usePDF: pdfHook
510
+ }
511
+ );
512
+ }
513
+ function PDFElementInternal({
514
+ b64,
515
+ testid,
516
+ isMobile,
517
+ error,
518
+ usePDF
494
519
  }) {
495
520
  var _a;
496
521
  const canvasRef = (0, import_react2.useRef)(null);
497
- const { pdfDocument } = (0, import_react_pdf2.usePdf)({
522
+ const { pdfDocument } = usePDF({
498
523
  file: `data:application/pdf;base64,${b64}`,
499
524
  workerSrc: "/scripts/pdf.worker.min.mjs",
500
525
  scale: isMobile ? 1 : 1.3,
@@ -519,6 +544,7 @@ function PDFElement({
519
544
  children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
520
545
  PdfPage,
521
546
  {
547
+ usePDF,
522
548
  testid: testid ? `${testid}-pdf_page_${i + 1}` : void 0,
523
549
  file: `data:application/pdf;base64,${b64}`,
524
550
  pageNumber: i + 1
@@ -1,7 +1,8 @@
1
+ "use client";
1
2
  import {
2
3
  PDFElement
3
- } from "../../chunk-YNKN6RKF.js";
4
- import "../../chunk-VJVY6NPF.js";
4
+ } from "../../chunk-YEZBNQZI.js";
5
+ import "../../chunk-S5ZJ3Q7P.js";
5
6
  import "../../chunk-SBRRNFOP.js";
6
7
  import "../../chunk-DORD2EBO.js";
7
8
  import "../../chunk-IXR65MOU.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");
27
26
  var import_react = require("react");
28
27
  var import_jsx_runtime = require("react/jsx-runtime");
29
28
  function PdfPage({
30
29
  file,
31
30
  pageNumber,
32
31
  testid,
33
- isMobile
32
+ isMobile,
33
+ usePDF
34
34
  }) {
35
35
  const canvasRef = (0, import_react.useRef)(null);
36
- const { pdfDocument } = (0, import_react_pdf.usePdf)({
36
+ const { pdfDocument } = usePDF({
37
37
  file,
38
38
  page: pageNumber,
39
39
  canvasRef,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PdfPage
3
- } from "../../chunk-VJVY6NPF.js";
3
+ } from "../../chunk-S5ZJ3Q7P.js";
4
4
  import "../../chunk-ORMEWXMH.js";
5
5
  export {
6
6
  PdfPage
@@ -908,7 +908,6 @@ var Modal = ({
908
908
  Modal.displayName = "Modal";
909
909
 
910
910
  // src/components/PDFViewer/PDFElement.tsx
911
- var import_react_pdf2 = require("@mikecousins/react-pdf");
912
911
  var import_react8 = require("react");
913
912
 
914
913
  // src/components/Spinner.tsx
@@ -1162,17 +1161,17 @@ var Stack = (_a) => {
1162
1161
  };
1163
1162
 
1164
1163
  // src/components/PDFViewer/PDFPage.tsx
1165
- var import_react_pdf = require("@mikecousins/react-pdf");
1166
1164
  var import_react7 = require("react");
1167
1165
  var import_jsx_runtime11 = require("react/jsx-runtime");
1168
1166
  function PdfPage({
1169
1167
  file,
1170
1168
  pageNumber,
1171
1169
  testid,
1172
- isMobile
1170
+ isMobile,
1171
+ usePDF
1173
1172
  }) {
1174
1173
  const canvasRef = (0, import_react7.useRef)(null);
1175
- const { pdfDocument } = (0, import_react_pdf.usePdf)({
1174
+ const { pdfDocument } = usePDF({
1176
1175
  file,
1177
1176
  page: pageNumber,
1178
1177
  canvasRef,
@@ -1198,10 +1197,35 @@ function PDFElement({
1198
1197
  testid,
1199
1198
  isMobile,
1200
1199
  error
1200
+ }) {
1201
+ const [pdfHook, setPDFHook] = (0, import_react8.useState)(null);
1202
+ (0, import_react8.useEffect)(() => {
1203
+ import("@mikecousins/react-pdf").then((m) => setPDFHook(m.usePdf));
1204
+ }, []);
1205
+ if (pdfHook === null) {
1206
+ return null;
1207
+ }
1208
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1209
+ PDFElementInternal,
1210
+ {
1211
+ b64,
1212
+ testid,
1213
+ isMobile,
1214
+ error,
1215
+ usePDF: pdfHook
1216
+ }
1217
+ );
1218
+ }
1219
+ function PDFElementInternal({
1220
+ b64,
1221
+ testid,
1222
+ isMobile,
1223
+ error,
1224
+ usePDF
1201
1225
  }) {
1202
1226
  var _a;
1203
1227
  const canvasRef = (0, import_react8.useRef)(null);
1204
- const { pdfDocument } = (0, import_react_pdf2.usePdf)({
1228
+ const { pdfDocument } = usePDF({
1205
1229
  file: `data:application/pdf;base64,${b64}`,
1206
1230
  workerSrc: "/scripts/pdf.worker.min.mjs",
1207
1231
  scale: isMobile ? 1 : 1.3,
@@ -1226,6 +1250,7 @@ function PDFElement({
1226
1250
  children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1227
1251
  PdfPage,
1228
1252
  {
1253
+ usePDF,
1229
1254
  testid: testid ? `${testid}-pdf_page_${i + 1}` : void 0,
1230
1255
  file: `data:application/pdf;base64,${b64}`,
1231
1256
  pageNumber: i + 1
@@ -1411,6 +1436,10 @@ function PDFViewer(props) {
1411
1436
  } = props;
1412
1437
  const [currentIndex, setCurrentIndex] = (0, import_react9.useState)(0);
1413
1438
  const [isDownloading, setIsDownloading] = (0, import_react9.useState)(false);
1439
+ const [isMounted, setIsMounted] = (0, import_react9.useState)(false);
1440
+ (0, import_react9.useEffect)(() => {
1441
+ setIsMounted(true);
1442
+ }, []);
1414
1443
  const handleDownload = (0, import_react9.useCallback)(() => {
1415
1444
  setIsDownloading(true);
1416
1445
  const link = document.createElement("a");
@@ -1442,6 +1471,7 @@ function PDFViewer(props) {
1442
1471
  setIsDownloading(false);
1443
1472
  onClose();
1444
1473
  }
1474
+ if (!isMounted) return null;
1445
1475
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1446
1476
  Modal,
1447
1477
  {
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  PDFViewer
4
- } from "../../chunk-24K4HHV5.js";
4
+ } from "../../chunk-TPBEID5X.js";
5
5
  import "../../chunk-B53XDCLO.js";
6
6
  import "../../chunk-JUFBGNWW.js";
7
- import "../../chunk-YNKN6RKF.js";
8
- import "../../chunk-VJVY6NPF.js";
7
+ import "../../chunk-YEZBNQZI.js";
8
+ import "../../chunk-S5ZJ3Q7P.js";
9
9
  import "../../chunk-X67L3NZI.js";
10
10
  import "../../chunk-4RJKB7LC.js";
11
11
  import "../../chunk-FG7GNGE3.js";