@dmsi/wedgekit-react 0.0.415 → 0.0.417
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-3HBYDOYE.js +114 -0
- package/dist/{chunk-JIMJIJOF.js → chunk-5TGP5EFM.js} +2 -2
- package/dist/{chunk-2HMCS25C.js → chunk-6LHBY2IH.js} +1 -1
- package/dist/{chunk-6I5LZ2ZC.js → chunk-7AXHAWJX.js} +3 -3
- package/dist/{chunk-MQX7GFLX.js → chunk-CAQWLY5V.js} +24 -6
- package/dist/{chunk-QQ5G773N.js → chunk-DCLNAUC4.js} +1 -1
- package/dist/{chunk-GB4ZTUQV.js → chunk-DTW7JCBR.js} +36 -0
- package/dist/{chunk-BK7SPR6Y.js → chunk-HYJIDHAK.js} +6 -6
- package/dist/{chunk-ZHZIIVJN.js → chunk-IMOIZFJZ.js} +5 -5
- package/dist/chunk-KBJZUVLM.js +65 -0
- package/dist/{chunk-AA6GE3TH.js → chunk-LUPHOXAQ.js} +1 -1
- package/dist/chunk-NRNWEQD7.js +66 -0
- package/dist/{chunk-44TDIHUP.js → chunk-P3MIP2FD.js} +1 -1
- package/dist/{chunk-7ULLUUVJ.js → chunk-PQWWVBSR.js} +1 -1
- package/dist/{chunk-ERW5DEIO.js → chunk-RQLWSLVE.js} +1 -1
- package/dist/chunk-TYAQWVIM.js +159 -0
- package/dist/{chunk-KZZKQLKF.js → chunk-W55J2KJZ.js} +1 -1
- package/dist/chunk-Y2GK27RX.js +79 -0
- package/dist/components/Accordion.cjs +74 -2
- package/dist/components/Accordion.js +3 -3
- package/dist/components/CalendarRange.cjs +228 -53
- package/dist/components/CalendarRange.css +169 -65
- package/dist/components/CalendarRange.js +23 -16
- package/dist/components/Card.cjs +38 -2
- package/dist/components/Card.js +1 -1
- package/dist/components/CompactImagesPreview.cjs +59 -5
- package/dist/components/CompactImagesPreview.js +2 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +186 -11
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +169 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +23 -16
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +195 -20
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +169 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +23 -16
- package/dist/components/DataGrid/PinnedColumns.cjs +211 -36
- package/dist/components/DataGrid/PinnedColumns.css +169 -65
- package/dist/components/DataGrid/PinnedColumns.js +23 -16
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +187 -12
- package/dist/components/DataGrid/TableBody/LoadingCell.css +169 -65
- package/dist/components/DataGrid/TableBody/LoadingCell.js +23 -16
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +193 -18
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +169 -65
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +23 -16
- package/dist/components/DataGrid/TableBody/index.cjs +208 -33
- package/dist/components/DataGrid/TableBody/index.css +169 -65
- package/dist/components/DataGrid/TableBody/index.js +23 -16
- package/dist/components/DataGrid/index.cjs +297 -122
- package/dist/components/DataGrid/index.css +169 -65
- package/dist/components/DataGrid/index.js +23 -16
- package/dist/components/DataGrid/utils.cjs +187 -12
- package/dist/components/DataGrid/utils.css +169 -65
- package/dist/components/DataGrid/utils.js +23 -16
- package/dist/components/DateInput.cjs +247 -72
- package/dist/components/DateInput.css +169 -65
- package/dist/components/DateInput.js +23 -16
- package/dist/components/DateRangeInput.cjs +247 -72
- package/dist/components/DateRangeInput.css +169 -65
- package/dist/components/DateRangeInput.js +23 -16
- package/dist/components/Grid.cjs +81 -76
- package/dist/components/Grid.js +1 -1
- package/dist/components/ListGroup.cjs +553 -0
- package/dist/components/ListGroup.js +11 -0
- package/dist/components/MobileDataGrid/ColumnList.cjs +36 -0
- package/dist/components/MobileDataGrid/ColumnList.js +3 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +194 -19
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +169 -65
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +23 -16
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +36 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +238 -27
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +169 -65
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +23 -16
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +36 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +36 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +5 -5
- package/dist/components/MobileDataGrid/index.cjs +740 -529
- package/dist/components/MobileDataGrid/index.css +169 -65
- package/dist/components/MobileDataGrid/index.js +23 -16
- package/dist/components/Modal.js +2 -2
- package/dist/components/Notification.cjs +36 -0
- package/dist/components/Notification.js +1 -1
- package/dist/components/PDFViewer/PDFElement.cjs +36 -0
- package/dist/components/PDFViewer/PDFElement.js +2 -2
- package/dist/components/PDFViewer/PDFNavigation.cjs +36 -0
- package/dist/components/PDFViewer/PDFNavigation.js +2 -2
- package/dist/components/PDFViewer/index.cjs +36 -0
- package/dist/components/PDFViewer/index.js +8 -111
- package/dist/components/Pagination.cjs +427 -0
- package/dist/components/Pagination.js +10 -0
- package/dist/components/ProductImagePreview/index.cjs +139 -127
- package/dist/components/ProductImagePreview/index.js +4 -4
- package/dist/components/SideMenuGroup.cjs +36 -0
- package/dist/components/SideMenuGroup.js +1 -1
- package/dist/components/SideMenuItem.cjs +36 -0
- package/dist/components/SideMenuItem.js +1 -1
- package/dist/components/SimpleTable.cjs +36 -0
- package/dist/components/SimpleTable.js +2 -2
- package/dist/components/Stack.cjs +36 -0
- package/dist/components/Stack.js +1 -1
- package/dist/components/Swatch.cjs +36 -0
- package/dist/components/Swatch.js +1 -1
- package/dist/components/Time.cjs +36 -0
- package/dist/components/Time.js +1 -1
- package/dist/components/Tooltip.cjs +1 -1
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Upload.cjs +36 -0
- package/dist/components/Upload.js +1 -1
- package/dist/components/index.cjs +686 -131
- package/dist/components/index.css +169 -65
- package/dist/components/index.js +33 -17
- package/dist/index.css +169 -65
- package/package.json +1 -1
- package/src/components/Card.tsx +60 -2
- package/src/components/CompactImagesPreview.tsx +54 -30
- package/src/components/Grid.tsx +59 -91
- package/src/components/ListGroup.tsx +82 -0
- package/src/components/Pagination.tsx +182 -0
- package/src/components/Stack.tsx +76 -0
- package/src/components/Tooltip.tsx +4 -3
- package/src/components/index.ts +3 -0
- package/dist/chunk-ER6RCOH3.js +0 -97
- package/dist/chunk-EZCH4PQS.js +0 -29
- package/dist/{chunk-D6YCMQPO.js → chunk-SBCFBHNG.js} +3 -3
|
@@ -511,6 +511,10 @@ var Stack = (_a) => {
|
|
|
511
511
|
padding,
|
|
512
512
|
paddingX,
|
|
513
513
|
paddingY,
|
|
514
|
+
paddingBottom,
|
|
515
|
+
paddingTop,
|
|
516
|
+
paddingLeft,
|
|
517
|
+
paddingRight,
|
|
514
518
|
margin,
|
|
515
519
|
marginX,
|
|
516
520
|
marginY,
|
|
@@ -526,6 +530,10 @@ var Stack = (_a) => {
|
|
|
526
530
|
height,
|
|
527
531
|
maxHeight,
|
|
528
532
|
borderColor,
|
|
533
|
+
borderTopColor,
|
|
534
|
+
borderRightColor,
|
|
535
|
+
borderBottomColor,
|
|
536
|
+
borderLeftColor,
|
|
529
537
|
backgroundColor,
|
|
530
538
|
sizing = "none",
|
|
531
539
|
overflowY = "inherit",
|
|
@@ -551,6 +559,10 @@ var Stack = (_a) => {
|
|
|
551
559
|
"padding",
|
|
552
560
|
"paddingX",
|
|
553
561
|
"paddingY",
|
|
562
|
+
"paddingBottom",
|
|
563
|
+
"paddingTop",
|
|
564
|
+
"paddingLeft",
|
|
565
|
+
"paddingRight",
|
|
554
566
|
"margin",
|
|
555
567
|
"marginX",
|
|
556
568
|
"marginY",
|
|
@@ -566,6 +578,10 @@ var Stack = (_a) => {
|
|
|
566
578
|
"height",
|
|
567
579
|
"maxHeight",
|
|
568
580
|
"borderColor",
|
|
581
|
+
"borderTopColor",
|
|
582
|
+
"borderRightColor",
|
|
583
|
+
"borderBottomColor",
|
|
584
|
+
"borderLeftColor",
|
|
569
585
|
"backgroundColor",
|
|
570
586
|
"sizing",
|
|
571
587
|
"overflowY",
|
|
@@ -601,6 +617,10 @@ var Stack = (_a) => {
|
|
|
601
617
|
width: width !== void 0 && typeof width === "number" ? `${width}px` : void 0,
|
|
602
618
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
|
603
619
|
border: borderColor ? `1px solid var(--color-${borderColor})` : void 0,
|
|
620
|
+
borderTop: borderTopColor ? `1px solid var(--color-${borderTopColor})` : void 0,
|
|
621
|
+
borderRight: borderRightColor ? `1px solid var(--color-${borderRightColor})` : void 0,
|
|
622
|
+
borderBottom: borderBottomColor ? `1px solid var(--color-${borderBottomColor})` : void 0,
|
|
623
|
+
borderLeft: borderLeftColor ? `1px solid var(--color-${borderLeftColor})` : void 0,
|
|
604
624
|
backgroundColor: backgroundColor ? `var(--color-${backgroundColor})` : void 0,
|
|
605
625
|
flexGrow: flexGrow !== void 0 ? flexGrow : void 0,
|
|
606
626
|
flexShrink: flexShrink !== void 0 ? flexShrink : void 0,
|
|
@@ -640,6 +660,22 @@ var Stack = (_a) => {
|
|
|
640
660
|
paddingY && sizing === "layout" && "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding",
|
|
641
661
|
paddingY && sizing === "layout-group" && paddingYUsingLayoutGroupGap,
|
|
642
662
|
paddingY && sizing === "component" && "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding",
|
|
663
|
+
paddingBottom && sizing === "container" && "pb-mobile-container-padding desktop:pb-desktop-container-padding compact:pb-desktop-compact-container-padding",
|
|
664
|
+
paddingBottom && sizing === "layout" && "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding",
|
|
665
|
+
paddingBottom && sizing === "layout-group" && "pb-mobile-layout-group-padding desktop:pb-desktop-layout-group-padding compact:pb-desktop-compact-layout-group-padding",
|
|
666
|
+
paddingBottom && sizing === "component" && "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding",
|
|
667
|
+
paddingTop && sizing === "container" && "pt-mobile-container-padding desktop:pt-desktop-container-padding compact:pt-desktop-compact-container-padding",
|
|
668
|
+
paddingTop && sizing === "layout" && "pt-mobile-layout-padding desktop:pt-desktop-layout-padding compact:pt-desktop-compact-layout-padding",
|
|
669
|
+
paddingTop && sizing === "layout-group" && "pt-mobile-layout-group-padding desktop:pt-desktop-layout-group-padding compact:pt-desktop-compact-layout-group-padding",
|
|
670
|
+
paddingTop && sizing === "component" && "pt-mobile-component-padding desktop:pt-desktop-component-padding compact:pt-desktop-compact-component-padding",
|
|
671
|
+
paddingLeft && sizing === "container" && "pl-mobile-container-padding desktop:pl-desktop-container-padding compact:pl-desktop-compact-container-padding",
|
|
672
|
+
paddingLeft && sizing === "layout" && "pl-mobile-layout-padding desktop:pl-desktop-layout-padding compact:pl-desktop-compact-layout-padding",
|
|
673
|
+
paddingLeft && sizing === "layout-group" && "pl-mobile-layout-group-padding desktop:pl-desktop-layout-group-padding compact:pl-desktop-compact-layout-group-padding",
|
|
674
|
+
paddingLeft && sizing === "component" && "pl-mobile-component-padding desktop:pl-desktop-component-padding compact:pl-desktop-compact-component-padding",
|
|
675
|
+
paddingRight && sizing === "container" && "pr-mobile-container-padding desktop:pr-desktop-container-padding compact:pr-desktop-compact-container-padding",
|
|
676
|
+
paddingRight && sizing === "layout" && "pr-mobile-layout-padding desktop:pr-desktop-layout-padding compact:pr-desktop-compact-layout-padding",
|
|
677
|
+
paddingRight && sizing === "layout-group" && "pr-mobile-layout-group-padding desktop:pr-desktop-layout-group-padding compact:pr-desktop-compact-layout-group-padding",
|
|
678
|
+
paddingRight && sizing === "component" && "pr-mobile-component-padding desktop:pr-desktop-component-padding compact:pr-desktop-compact-component-padding",
|
|
643
679
|
margin && sizing === "container" && "m-mobile-container-padding desktop:m-desktop-container-padding compact:m-compact-container-padding",
|
|
644
680
|
marginX && sizing === "container" && "mx-mobile-container-padding desktop:mx-desktop-container-padding compact:mx-compact-container-padding",
|
|
645
681
|
marginTop && sizing === "container" && "mt-mobile-container-padding desktop:mt-desktop-container-padding compact:mt-compact-container-padding",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PdfNavigation
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-6LHBY2IH.js";
|
|
4
4
|
import "../../chunk-EU73QPW7.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-DTW7JCBR.js";
|
|
6
6
|
import "../../chunk-OGIFIPKH.js";
|
|
7
7
|
import "../../chunk-NKUETCDA.js";
|
|
8
8
|
import "../../chunk-WWAPK5PH.js";
|
|
@@ -966,6 +966,10 @@ var Stack = (_a) => {
|
|
|
966
966
|
padding,
|
|
967
967
|
paddingX,
|
|
968
968
|
paddingY,
|
|
969
|
+
paddingBottom,
|
|
970
|
+
paddingTop,
|
|
971
|
+
paddingLeft,
|
|
972
|
+
paddingRight,
|
|
969
973
|
margin,
|
|
970
974
|
marginX,
|
|
971
975
|
marginY,
|
|
@@ -981,6 +985,10 @@ var Stack = (_a) => {
|
|
|
981
985
|
height,
|
|
982
986
|
maxHeight,
|
|
983
987
|
borderColor,
|
|
988
|
+
borderTopColor,
|
|
989
|
+
borderRightColor,
|
|
990
|
+
borderBottomColor,
|
|
991
|
+
borderLeftColor,
|
|
984
992
|
backgroundColor,
|
|
985
993
|
sizing = "none",
|
|
986
994
|
overflowY = "inherit",
|
|
@@ -1006,6 +1014,10 @@ var Stack = (_a) => {
|
|
|
1006
1014
|
"padding",
|
|
1007
1015
|
"paddingX",
|
|
1008
1016
|
"paddingY",
|
|
1017
|
+
"paddingBottom",
|
|
1018
|
+
"paddingTop",
|
|
1019
|
+
"paddingLeft",
|
|
1020
|
+
"paddingRight",
|
|
1009
1021
|
"margin",
|
|
1010
1022
|
"marginX",
|
|
1011
1023
|
"marginY",
|
|
@@ -1021,6 +1033,10 @@ var Stack = (_a) => {
|
|
|
1021
1033
|
"height",
|
|
1022
1034
|
"maxHeight",
|
|
1023
1035
|
"borderColor",
|
|
1036
|
+
"borderTopColor",
|
|
1037
|
+
"borderRightColor",
|
|
1038
|
+
"borderBottomColor",
|
|
1039
|
+
"borderLeftColor",
|
|
1024
1040
|
"backgroundColor",
|
|
1025
1041
|
"sizing",
|
|
1026
1042
|
"overflowY",
|
|
@@ -1056,6 +1072,10 @@ var Stack = (_a) => {
|
|
|
1056
1072
|
width: width !== void 0 && typeof width === "number" ? `${width}px` : void 0,
|
|
1057
1073
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
|
1058
1074
|
border: borderColor ? `1px solid var(--color-${borderColor})` : void 0,
|
|
1075
|
+
borderTop: borderTopColor ? `1px solid var(--color-${borderTopColor})` : void 0,
|
|
1076
|
+
borderRight: borderRightColor ? `1px solid var(--color-${borderRightColor})` : void 0,
|
|
1077
|
+
borderBottom: borderBottomColor ? `1px solid var(--color-${borderBottomColor})` : void 0,
|
|
1078
|
+
borderLeft: borderLeftColor ? `1px solid var(--color-${borderLeftColor})` : void 0,
|
|
1059
1079
|
backgroundColor: backgroundColor ? `var(--color-${backgroundColor})` : void 0,
|
|
1060
1080
|
flexGrow: flexGrow !== void 0 ? flexGrow : void 0,
|
|
1061
1081
|
flexShrink: flexShrink !== void 0 ? flexShrink : void 0,
|
|
@@ -1095,6 +1115,22 @@ var Stack = (_a) => {
|
|
|
1095
1115
|
paddingY && sizing === "layout" && "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding",
|
|
1096
1116
|
paddingY && sizing === "layout-group" && paddingYUsingLayoutGroupGap,
|
|
1097
1117
|
paddingY && sizing === "component" && "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding",
|
|
1118
|
+
paddingBottom && sizing === "container" && "pb-mobile-container-padding desktop:pb-desktop-container-padding compact:pb-desktop-compact-container-padding",
|
|
1119
|
+
paddingBottom && sizing === "layout" && "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding",
|
|
1120
|
+
paddingBottom && sizing === "layout-group" && "pb-mobile-layout-group-padding desktop:pb-desktop-layout-group-padding compact:pb-desktop-compact-layout-group-padding",
|
|
1121
|
+
paddingBottom && sizing === "component" && "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding",
|
|
1122
|
+
paddingTop && sizing === "container" && "pt-mobile-container-padding desktop:pt-desktop-container-padding compact:pt-desktop-compact-container-padding",
|
|
1123
|
+
paddingTop && sizing === "layout" && "pt-mobile-layout-padding desktop:pt-desktop-layout-padding compact:pt-desktop-compact-layout-padding",
|
|
1124
|
+
paddingTop && sizing === "layout-group" && "pt-mobile-layout-group-padding desktop:pt-desktop-layout-group-padding compact:pt-desktop-compact-layout-group-padding",
|
|
1125
|
+
paddingTop && sizing === "component" && "pt-mobile-component-padding desktop:pt-desktop-component-padding compact:pt-desktop-compact-component-padding",
|
|
1126
|
+
paddingLeft && sizing === "container" && "pl-mobile-container-padding desktop:pl-desktop-container-padding compact:pl-desktop-compact-container-padding",
|
|
1127
|
+
paddingLeft && sizing === "layout" && "pl-mobile-layout-padding desktop:pl-desktop-layout-padding compact:pl-desktop-compact-layout-padding",
|
|
1128
|
+
paddingLeft && sizing === "layout-group" && "pl-mobile-layout-group-padding desktop:pl-desktop-layout-group-padding compact:pl-desktop-compact-layout-group-padding",
|
|
1129
|
+
paddingLeft && sizing === "component" && "pl-mobile-component-padding desktop:pl-desktop-component-padding compact:pl-desktop-compact-component-padding",
|
|
1130
|
+
paddingRight && sizing === "container" && "pr-mobile-container-padding desktop:pr-desktop-container-padding compact:pr-desktop-compact-container-padding",
|
|
1131
|
+
paddingRight && sizing === "layout" && "pr-mobile-layout-padding desktop:pr-desktop-layout-padding compact:pr-desktop-compact-layout-padding",
|
|
1132
|
+
paddingRight && sizing === "layout-group" && "pr-mobile-layout-group-padding desktop:pr-desktop-layout-group-padding compact:pr-desktop-compact-layout-group-padding",
|
|
1133
|
+
paddingRight && sizing === "component" && "pr-mobile-component-padding desktop:pr-desktop-component-padding compact:pr-desktop-compact-component-padding",
|
|
1098
1134
|
margin && sizing === "container" && "m-mobile-container-padding desktop:m-desktop-container-padding compact:m-compact-container-padding",
|
|
1099
1135
|
marginX && sizing === "container" && "mx-mobile-container-padding desktop:mx-desktop-container-padding compact:mx-compact-container-padding",
|
|
1100
1136
|
marginTop && sizing === "container" && "mt-mobile-container-padding desktop:mt-desktop-container-padding compact:mt-compact-container-padding",
|
|
@@ -1,132 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
PdfNavigation
|
|
10
|
-
} from "../../chunk-2HMCS25C.js";
|
|
3
|
+
PDFViewer
|
|
4
|
+
} from "../../chunk-3HBYDOYE.js";
|
|
5
|
+
import "../../chunk-EJSPFQCY.js";
|
|
6
|
+
import "../../chunk-RQLWSLVE.js";
|
|
7
|
+
import "../../chunk-6LHBY2IH.js";
|
|
11
8
|
import "../../chunk-VJVY6NPF.js";
|
|
12
|
-
import
|
|
13
|
-
Modal
|
|
14
|
-
} from "../../chunk-D6YCMQPO.js";
|
|
9
|
+
import "../../chunk-SBCFBHNG.js";
|
|
15
10
|
import "../../chunk-4RJKB7LC.js";
|
|
11
|
+
import "../../chunk-AG43RS4Q.js";
|
|
16
12
|
import "../../chunk-XM7IQHBU.js";
|
|
17
13
|
import "../../chunk-FRHPFACM.js";
|
|
18
14
|
import "../../chunk-T36HX6QY.js";
|
|
19
|
-
import "../../chunk-AG43RS4Q.js";
|
|
20
15
|
import "../../chunk-SBRRNFOP.js";
|
|
21
16
|
import "../../chunk-EU73QPW7.js";
|
|
22
17
|
import "../../chunk-MYKYZHEO.js";
|
|
23
18
|
import "../../chunk-VXWSAIB5.js";
|
|
24
19
|
import "../../chunk-TYTD4FLW.js";
|
|
25
20
|
import "../../chunk-5UH6QUFB.js";
|
|
26
|
-
import "../../chunk-
|
|
21
|
+
import "../../chunk-DTW7JCBR.js";
|
|
27
22
|
import "../../chunk-OGIFIPKH.js";
|
|
28
23
|
import "../../chunk-NKUETCDA.js";
|
|
29
24
|
import "../../chunk-WWAPK5PH.js";
|
|
30
25
|
import "../../chunk-6CTCHYIS.js";
|
|
31
26
|
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
|
-
}
|
|
130
27
|
export {
|
|
131
28
|
PDFViewer
|
|
132
29
|
};
|