@dmsi/wedgekit-react 0.0.369 → 0.0.371
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-RLLQRVM7.js → chunk-2H35FETR.js} +18 -10
- package/dist/chunk-2IKT6IHB.js +190 -0
- package/dist/chunk-4UNWXB4A.js +89 -0
- package/dist/chunk-5IFPG6TS.js +17 -0
- package/dist/{chunk-6GAYJCFE.js → chunk-6DPFKSCT.js} +1 -1
- package/dist/{chunk-ZFOANBWG.js → chunk-AG43RS4Q.js} +2 -1
- package/dist/chunk-AJ5M6MVX.js +7 -0
- package/dist/chunk-AT4AWD6B.js +44 -0
- package/dist/chunk-BQNPOGD5.js +105 -0
- package/dist/chunk-CQFPNZTN.js +172 -0
- package/dist/chunk-EJSPFQCY.js +29 -0
- package/dist/chunk-ER6RCOH3.js +97 -0
- package/dist/{chunk-4VER5OEU.js → chunk-FBE2HGEF.js} +35 -11
- package/dist/chunk-HPQWEZJL.js +45 -0
- package/dist/{chunk-URCLLHO5.js → chunk-IBX6DVHU.js} +376 -102
- package/dist/{chunk-I3WFZOFY.js → chunk-J5V2JRIK.js} +1 -1
- package/dist/chunk-JGJUVJKD.js +283 -0
- package/dist/chunk-KEMCFN4U.js +78 -0
- package/dist/chunk-M6TSTDNZ.js +22 -0
- package/dist/chunk-M7INAUAJ.js +140 -0
- package/dist/chunk-MBZ55T2D.js +51 -0
- package/dist/chunk-N6PNLLNS.js +77 -0
- package/dist/{chunk-ZA5E7ZYM.js → chunk-NXGUDYRR.js} +1 -1
- package/dist/chunk-P36QKH26.js +143 -0
- package/dist/chunk-PTRZHGHA.js +89 -0
- package/dist/chunk-QVWYTQKL.js +29 -0
- package/dist/{chunk-6CPGOW6J.js → chunk-T36HX6QY.js} +6 -4
- package/dist/chunk-U6PUOGG4.js +114 -0
- package/dist/{chunk-NQXZBWDZ.js → chunk-V6U7LU6M.js} +15 -6
- package/dist/chunk-VJVY6NPF.js +32 -0
- package/dist/chunk-VVXPGI2P.js +61 -0
- package/dist/{chunk-ARQBSR3I.js → chunk-YCKRVNJ3.js} +4 -4
- package/dist/chunk-YYHQLQDQ.js +68 -0
- package/dist/components/Accordion.cjs +47 -14
- package/dist/components/Accordion.js +2 -2
- package/dist/components/CalendarRange.cjs +700 -46
- package/dist/components/CalendarRange.css +186 -3
- package/dist/components/CalendarRange.js +43 -11
- package/dist/components/CompactImagesPreview.cjs +485 -0
- package/dist/components/CompactImagesPreview.js +13 -0
- package/dist/components/ContentTabs.cjs +3 -2
- package/dist/components/ContentTabs.js +3 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +4687 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +5051 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +62 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +4687 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +5051 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +62 -0
- package/dist/components/DataGrid/PinnedColumns.cjs +4687 -0
- package/dist/components/DataGrid/PinnedColumns.css +5051 -0
- package/dist/components/DataGrid/PinnedColumns.js +62 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +4689 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.css +5051 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.js +62 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +4689 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +5051 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +62 -0
- package/dist/components/DataGrid/TableBody/index.cjs +4689 -0
- package/dist/components/DataGrid/TableBody/index.css +5051 -0
- package/dist/components/DataGrid/TableBody/index.js +62 -0
- package/dist/components/DataGrid/index.cjs +4692 -0
- package/dist/components/DataGrid/index.css +5051 -0
- package/dist/components/DataGrid/index.js +65 -0
- package/dist/components/DataGrid/utils.cjs +4687 -0
- package/dist/components/DataGrid/utils.css +5051 -0
- package/dist/components/DataGrid/utils.js +62 -0
- package/dist/components/DataGridCell.js +6 -6
- package/dist/components/DateInput.cjs +721 -67
- package/dist/components/DateInput.css +186 -3
- package/dist/components/DateInput.js +45 -13
- package/dist/components/DateRangeInput.cjs +721 -67
- package/dist/components/DateRangeInput.css +186 -3
- package/dist/components/DateRangeInput.js +45 -13
- package/dist/components/FilterGroup.js +3 -3
- package/dist/components/Grid.cjs +3 -1
- package/dist/components/Grid.js +3 -92
- package/dist/components/ImagePlaceholder.cjs +65 -0
- package/dist/components/ImagePlaceholder.js +7 -0
- package/dist/components/Input.js +2 -2
- package/dist/components/MenuOption.js +2 -2
- package/dist/components/MobileDataGrid/ColumnList.cjs +845 -0
- package/dist/components/MobileDataGrid/ColumnList.js +17 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +4797 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +5051 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +62 -0
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.cjs +31 -0
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +7 -0
- package/dist/components/MobileDataGrid/GridContextProvider/index.cjs +177 -0
- package/dist/components/MobileDataGrid/GridContextProvider/index.js +8 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.cjs +269 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +9 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +790 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +16 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +5059 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +5051 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +62 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +509 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +13 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +1261 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +27 -0
- package/dist/components/MobileDataGrid/index.cjs +5521 -0
- package/dist/components/MobileDataGrid/index.css +5051 -0
- package/dist/components/MobileDataGrid/index.js +62 -0
- package/dist/components/Modal.cjs +24 -13
- package/dist/components/Modal.js +3 -3
- package/dist/components/ModalHeader.cjs +6 -4
- package/dist/components/ModalHeader.js +1 -1
- package/dist/components/ModalScrim.cjs +2 -1
- package/dist/components/ModalScrim.js +1 -1
- package/dist/components/NestedMenu.js +4 -4
- package/dist/components/Notification.cjs +15 -6
- package/dist/components/Notification.js +1 -1
- package/dist/components/PDFViewer/DownloadIcon.cjs +394 -0
- package/dist/components/PDFViewer/DownloadIcon.js +10 -0
- package/dist/components/PDFViewer/PDFElement.cjs +515 -0
- package/dist/components/PDFViewer/PDFElement.js +11 -0
- package/dist/components/{MobileDataGrid.cjs → PDFViewer/PDFNavigation.cjs} +318 -402
- package/dist/components/PDFViewer/PDFNavigation.js +13 -0
- package/dist/components/PDFViewer/PDFPage.cjs +56 -0
- package/dist/components/PDFViewer/PDFPage.js +7 -0
- package/dist/components/{PDFViewer.cjs → PDFViewer/index.cjs} +290 -202
- package/dist/components/PDFViewer/index.js +29 -0
- package/dist/components/Password.js +2 -2
- package/dist/components/ProductImagePreview/CarouselPagination.cjs +75 -0
- package/dist/components/ProductImagePreview/CarouselPagination.js +7 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.cjs +214 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.js +7 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.cjs +255 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +9 -0
- package/dist/components/ProductImagePreview/Thumbnail.cjs +105 -0
- package/dist/components/ProductImagePreview/Thumbnail.js +8 -0
- package/dist/components/ProductImagePreview/ZoomWindow.cjs +198 -0
- package/dist/components/ProductImagePreview/ZoomWindow.js +8 -0
- package/dist/components/ProductImagePreview/index.cjs +1369 -0
- package/dist/components/ProductImagePreview/index.js +22 -0
- package/dist/components/Search.js +3 -3
- package/dist/components/Select.js +3 -3
- package/dist/components/SideMenuGroup.cjs +15 -6
- package/dist/components/SideMenuGroup.js +1 -1
- package/dist/components/SideMenuItem.cjs +15 -6
- package/dist/components/SideMenuItem.js +1 -1
- package/dist/components/SkeletonParagraph.cjs +33 -0
- package/dist/components/SkeletonParagraph.js +10 -0
- package/dist/components/Stack.cjs +15 -6
- package/dist/components/Stack.js +1 -1
- package/dist/components/Stepper.cjs +61 -53
- package/dist/components/Stepper.js +63 -55
- package/dist/components/Surface.js +3 -39
- package/dist/components/Swatch.cjs +15 -6
- package/dist/components/Swatch.js +4 -4
- package/dist/components/Time.cjs +15 -6
- package/dist/components/Time.js +5 -5
- package/dist/components/Upload.cjs +15 -6
- package/dist/components/Upload.js +1 -1
- package/dist/components/index.cjs +2559 -14
- package/dist/components/index.css +186 -3
- package/dist/components/index.js +57 -14
- package/dist/index.css +186 -3
- package/package.json +1 -1
- package/src/components/Accordion.tsx +23 -4
- package/src/components/CompactImagesPreview.tsx +99 -0
- package/src/components/ContentTabs.tsx +3 -1
- package/src/components/DataGrid/types.ts +5 -0
- package/src/components/Grid.tsx +2 -0
- package/src/components/ImagePlaceholder.tsx +22 -0
- package/src/components/MobileDataGrid/ColumnList.tsx +66 -0
- package/src/components/MobileDataGrid/ColumnSelector/index.tsx +97 -0
- package/src/components/MobileDataGrid/GridContextProvider/GridContext.tsx +25 -0
- package/src/components/MobileDataGrid/GridContextProvider/index.tsx +132 -0
- package/src/components/MobileDataGrid/GridContextProvider/useGridContext.ts +10 -0
- package/src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx +20 -0
- package/src/components/MobileDataGrid/MobileDataGridCard/index.tsx +129 -0
- package/src/components/MobileDataGrid/MobileDataGridHeader.tsx +80 -0
- package/src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx +42 -0
- package/src/components/MobileDataGrid/RowDetailModalProvider/index.tsx +68 -0
- package/src/components/MobileDataGrid/dataGridReducer.ts +55 -0
- package/src/components/MobileDataGrid/index.tsx +92 -0
- package/src/components/MobileDataGrid/types.ts +4 -0
- package/src/components/Modal.tsx +31 -12
- package/src/components/ModalButtons.tsx +1 -1
- package/src/components/ModalHeader.tsx +5 -2
- package/src/components/ModalScrim.tsx +3 -2
- package/src/components/PDFViewer/DownloadIcon.tsx +22 -0
- package/src/components/PDFViewer/PDFElement.tsx +90 -0
- package/src/components/PDFViewer/PDFNavigation.tsx +68 -0
- package/src/components/PDFViewer/PDFPage.tsx +34 -0
- package/src/components/PDFViewer/index.tsx +128 -0
- package/src/components/ProductImagePreview/CarouselPagination.tsx +54 -0
- package/src/components/ProductImagePreview/MobileImageCarousel.tsx +226 -0
- package/src/components/ProductImagePreview/ProductPrimaryImage.tsx +218 -0
- package/src/components/ProductImagePreview/Thumbnail.tsx +49 -0
- package/src/components/ProductImagePreview/ZoomWindow.tsx +136 -0
- package/src/components/ProductImagePreview/index.tsx +182 -0
- package/src/components/ProductImagePreview/useProductImagePreview.ts +211 -0
- package/src/components/SkeletonParagraph.tsx +5 -0
- package/src/components/Stack.tsx +29 -6
- package/src/components/Stepper.tsx +5 -1
- package/src/components/index.ts +4 -0
- package/src/types.ts +2 -1
- package/dist/components/MobileDataGrid.js +0 -150
- package/dist/components/PDFViewer.js +0 -250
- package/src/components/MobileDataGrid.tsx +0 -163
- package/src/components/PDFViewer.tsx +0 -264
- package/dist/{chunk-OXSBIBGT.js → chunk-CKQNJNU3.js} +3 -3
- package/dist/{chunk-RJUN52HJ.js → chunk-ZL5X7KP6.js} +3 -3
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useGridContext
|
|
3
|
+
} from "./chunk-5IFPG6TS.js";
|
|
4
|
+
import {
|
|
5
|
+
MobileDataGridColumn
|
|
6
|
+
} from "./chunk-M6TSTDNZ.js";
|
|
7
|
+
import {
|
|
8
|
+
Checkbox
|
|
9
|
+
} from "./chunk-NO5BIKWS.js";
|
|
10
|
+
import {
|
|
11
|
+
Subheader
|
|
12
|
+
} from "./chunk-FA7IFW66.js";
|
|
13
|
+
import {
|
|
14
|
+
Stack
|
|
15
|
+
} from "./chunk-V6U7LU6M.js";
|
|
16
|
+
import {
|
|
17
|
+
Paragraph
|
|
18
|
+
} from "./chunk-OGIFIPKH.js";
|
|
19
|
+
import {
|
|
20
|
+
Icon
|
|
21
|
+
} from "./chunk-NKUETCDA.js";
|
|
22
|
+
|
|
23
|
+
// src/components/MobileDataGrid/MobileDataGridCard/index.tsx
|
|
24
|
+
import clsx from "clsx";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
function MobileDataGridCard({
|
|
27
|
+
renderLink,
|
|
28
|
+
renderChevron = true,
|
|
29
|
+
data,
|
|
30
|
+
enableRowSelection,
|
|
31
|
+
selected,
|
|
32
|
+
rowActions
|
|
33
|
+
}) {
|
|
34
|
+
var _a;
|
|
35
|
+
const context = useGridContext();
|
|
36
|
+
const { id, testid, visibleColumns, getId, handleRowSelect, openRowDetail } = context;
|
|
37
|
+
return /* @__PURE__ */ jsxs(
|
|
38
|
+
"li",
|
|
39
|
+
{
|
|
40
|
+
id: id ? `${id}-card-${getId(data)}` : void 0,
|
|
41
|
+
"data-testid": testid ? `${testid}-card-${getId(data)}` : void 0,
|
|
42
|
+
className: clsx(
|
|
43
|
+
"hover:bg-action-100 cursor-pointer list-none",
|
|
44
|
+
selected ? "bg-action-100" : "bg-background-grouped-primary-normal"
|
|
45
|
+
),
|
|
46
|
+
onClick: () => openRowDetail(data),
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsxs(Stack, { sizing: "component", children: [
|
|
49
|
+
/* @__PURE__ */ jsxs(Stack, { horizontal: true, horizontalMobile: true, items: "center", justify: "between", children: [
|
|
50
|
+
enableRowSelection && /* @__PURE__ */ jsx(
|
|
51
|
+
Stack,
|
|
52
|
+
{
|
|
53
|
+
sizing: "component",
|
|
54
|
+
padding: true,
|
|
55
|
+
width: "fit",
|
|
56
|
+
onClick: (e) => e.stopPropagation(),
|
|
57
|
+
children: /* @__PURE__ */ jsx(
|
|
58
|
+
Checkbox,
|
|
59
|
+
{
|
|
60
|
+
id: id ? `${id}-${getId(data)}-select-checkbox` : void 0,
|
|
61
|
+
testid: testid ? `${testid}-${getId(data)}-select-checkbox` : void 0,
|
|
62
|
+
checked: selected,
|
|
63
|
+
onChange: () => handleRowSelect(data)
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
Stack,
|
|
70
|
+
{
|
|
71
|
+
sizing: "component",
|
|
72
|
+
padding: true,
|
|
73
|
+
onClick: (e) => e.stopPropagation(),
|
|
74
|
+
children: renderLink ? renderLink(data) : /* @__PURE__ */ jsx(Subheader, { children: String((_a = data[context.primaryKey]) != null ? _a : "") })
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
Stack,
|
|
79
|
+
{
|
|
80
|
+
horizontal: true,
|
|
81
|
+
horizontalMobile: true,
|
|
82
|
+
items: "center",
|
|
83
|
+
justify: "end",
|
|
84
|
+
sizing: "component",
|
|
85
|
+
onClick: (e) => e.stopPropagation(),
|
|
86
|
+
children: rowActions && (typeof rowActions === "function" ? rowActions(data) : rowActions)
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ jsx(Stack, { sizing: "layout-group", children: visibleColumns.filter((x) => {
|
|
91
|
+
var _a2, _b;
|
|
92
|
+
return ((_a2 = x.meta) == null ? void 0 : _a2.visible) !== false && !((_b = x.id) == null ? void 0 : _b.startsWith("__"));
|
|
93
|
+
}).map(
|
|
94
|
+
(column, index) => {
|
|
95
|
+
var _a2, _b;
|
|
96
|
+
return ((_a2 = column.meta) == null ? void 0 : _a2.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ jsxs(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
className: "mb-2 grid grid-cols-2 gap-2 px-3 items-center flex-1",
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ jsxs(
|
|
102
|
+
Paragraph,
|
|
103
|
+
{
|
|
104
|
+
color: "text-secondary-normal",
|
|
105
|
+
className: "text-left",
|
|
106
|
+
children: [
|
|
107
|
+
(_b = column.header) == null ? void 0 : _b.toString(),
|
|
108
|
+
":"
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
" ",
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
column.meta.mobileCell,
|
|
115
|
+
{
|
|
116
|
+
column,
|
|
117
|
+
row: data,
|
|
118
|
+
cellValue: data[column.id]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
`${column.id}-${index}`
|
|
124
|
+
) : /* @__PURE__ */ jsx(
|
|
125
|
+
MobileDataGridColumn,
|
|
126
|
+
{
|
|
127
|
+
column,
|
|
128
|
+
data
|
|
129
|
+
},
|
|
130
|
+
`${column.id}-${index}`
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
) })
|
|
134
|
+
] }),
|
|
135
|
+
renderChevron && /* @__PURE__ */ jsx(Stack, { items: "center", justify: "center", horizontal: true, horizontalMobile: true, children: /* @__PURE__ */ jsx(Icon, { name: "keyboard_arrow_down" }) })
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export {
|
|
142
|
+
MobileDataGridCard
|
|
143
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useMatchesMobile
|
|
3
|
+
} from "./chunk-JUJBS4ZV.js";
|
|
4
|
+
import {
|
|
5
|
+
Stack
|
|
6
|
+
} from "./chunk-V6U7LU6M.js";
|
|
7
|
+
|
|
8
|
+
// src/components/CompactImagesPreview.tsx
|
|
9
|
+
import { useCallback } from "react";
|
|
10
|
+
import clsx from "clsx";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
function CompactImagesPreview(props) {
|
|
13
|
+
const {
|
|
14
|
+
sources,
|
|
15
|
+
currentSourceIndex = 0,
|
|
16
|
+
activeImageHeight = 243,
|
|
17
|
+
activeImageWidth = 242,
|
|
18
|
+
thumbnailWidth = 30.5,
|
|
19
|
+
thumbnailHeight = 30,
|
|
20
|
+
enableThumbnailBorder = false,
|
|
21
|
+
placeholderImageUri,
|
|
22
|
+
onChangeSource
|
|
23
|
+
} = props;
|
|
24
|
+
const isMobile = useMatchesMobile();
|
|
25
|
+
const imagesCount = sources.length;
|
|
26
|
+
const handleThumbnailClick = useCallback(
|
|
27
|
+
(newIndex) => {
|
|
28
|
+
if (newIndex === currentSourceIndex) return;
|
|
29
|
+
if (newIndex < 0 || newIndex >= imagesCount) return;
|
|
30
|
+
onChangeSource(newIndex);
|
|
31
|
+
},
|
|
32
|
+
[currentSourceIndex, onChangeSource, imagesCount]
|
|
33
|
+
);
|
|
34
|
+
if (!sources.length || currentSourceIndex >= sources.length || typeof isMobile === "undefined")
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
"img",
|
|
37
|
+
{
|
|
38
|
+
className: "object-center",
|
|
39
|
+
style: { width: activeImageWidth, height: activeImageHeight },
|
|
40
|
+
src: placeholderImageUri,
|
|
41
|
+
alt: "placeholder image"
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
const currentSource = sources[currentSourceIndex];
|
|
45
|
+
return /* @__PURE__ */ jsxs(Stack, { sizing: "layout", children: [
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
"img",
|
|
48
|
+
{
|
|
49
|
+
style: {
|
|
50
|
+
width: isMobile ? "100%" : activeImageWidth,
|
|
51
|
+
height: activeImageHeight,
|
|
52
|
+
objectPosition: "center"
|
|
53
|
+
},
|
|
54
|
+
src: currentSource.uri,
|
|
55
|
+
alt: currentSource.name
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
sources.length > 1 && /* @__PURE__ */ jsx("div", { className: "flex flex-row flex-wrap items-center gap-3", children: sources.map((source, index) => /* @__PURE__ */ jsx(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
onClick: (e) => {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
handleThumbnailClick(index);
|
|
64
|
+
},
|
|
65
|
+
className: clsx(
|
|
66
|
+
"cursor-pointer",
|
|
67
|
+
currentSourceIndex === index && enableThumbnailBorder ? "ring-2 ring-offset-2 ring-brand-400 transition-discrete duration-300" : "ring-brand-400/0"
|
|
68
|
+
),
|
|
69
|
+
children: /* @__PURE__ */ jsx(
|
|
70
|
+
"img",
|
|
71
|
+
{
|
|
72
|
+
src: source.uri,
|
|
73
|
+
alt: source.name,
|
|
74
|
+
style: {
|
|
75
|
+
width: thumbnailWidth,
|
|
76
|
+
height: thumbnailHeight,
|
|
77
|
+
objectPosition: "center"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
},
|
|
82
|
+
`compact-image-${source.uri}-${index}`
|
|
83
|
+
)) })
|
|
84
|
+
] });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
CompactImagesPreview
|
|
89
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "./chunk-ORMEWXMH.js";
|
|
5
|
+
|
|
6
|
+
// src/components/ImagePlaceholder.tsx
|
|
7
|
+
import { useId } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function ImagePlaceholder(props) {
|
|
10
|
+
const clipId = useId();
|
|
11
|
+
return /* @__PURE__ */ jsxs(
|
|
12
|
+
"svg",
|
|
13
|
+
__spreadProps(__spreadValues({
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
width: 242,
|
|
16
|
+
height: 243,
|
|
17
|
+
fill: "none"
|
|
18
|
+
}, props), {
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsx("g", { clipPath: `url(#${clipId})`, children: /* @__PURE__ */ jsx("rect", { width: props.width, height: props.width, fill: "#F7F7F7", rx: 2 }) }),
|
|
21
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: clipId, children: /* @__PURE__ */ jsx("rect", { width: props.width, height: props.width, fill: "#fff", rx: 2 }) }) })
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
ImagePlaceholder
|
|
29
|
+
};
|
|
@@ -22,7 +22,8 @@ var ModalHeader = ({
|
|
|
22
22
|
headerIconAlign,
|
|
23
23
|
onClose,
|
|
24
24
|
id,
|
|
25
|
-
testid
|
|
25
|
+
testid,
|
|
26
|
+
headerClassname
|
|
26
27
|
}) => {
|
|
27
28
|
return /* @__PURE__ */ jsxs(
|
|
28
29
|
"div",
|
|
@@ -35,10 +36,11 @@ var ModalHeader = ({
|
|
|
35
36
|
headerIconAlign === "right" && "justify-end",
|
|
36
37
|
headerIconAlign === "left" && "justify-start",
|
|
37
38
|
layoutPaddding,
|
|
38
|
-
layoutGroupGap
|
|
39
|
+
layoutGroupGap,
|
|
40
|
+
headerClassname
|
|
39
41
|
),
|
|
40
42
|
children: [
|
|
41
|
-
/* @__PURE__ */ jsxs("div", { className: clsx("flex items-center", layoutGroupGap), children: [
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: clsx("flex items-center flex-1", layoutGroupGap), children: [
|
|
42
44
|
headerIcon,
|
|
43
45
|
title && /* @__PURE__ */ jsx(
|
|
44
46
|
Heading2,
|
|
@@ -58,7 +60,7 @@ var ModalHeader = ({
|
|
|
58
60
|
iconOnly: true,
|
|
59
61
|
variant: "tertiary",
|
|
60
62
|
onClick: onClose,
|
|
61
|
-
leftIcon: /* @__PURE__ */ jsx("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 24 }) })
|
|
63
|
+
leftIcon: /* @__PURE__ */ jsx("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 24 }) })
|
|
62
64
|
}
|
|
63
65
|
)
|
|
64
66
|
]
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DownloadIcon
|
|
3
|
+
} from "./chunk-EJSPFQCY.js";
|
|
4
|
+
import {
|
|
5
|
+
PDFElement
|
|
6
|
+
} from "./chunk-4UNWXB4A.js";
|
|
7
|
+
import {
|
|
8
|
+
PdfNavigation
|
|
9
|
+
} from "./chunk-N6PNLLNS.js";
|
|
10
|
+
import {
|
|
11
|
+
Modal
|
|
12
|
+
} from "./chunk-2H35FETR.js";
|
|
13
|
+
|
|
14
|
+
// src/components/PDFViewer/index.tsx
|
|
15
|
+
import { useCallback, useState } from "react";
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
function PDFViewer(props) {
|
|
18
|
+
const {
|
|
19
|
+
isOpen,
|
|
20
|
+
onClose,
|
|
21
|
+
encodedPdfs,
|
|
22
|
+
customActions,
|
|
23
|
+
testid,
|
|
24
|
+
isMobile,
|
|
25
|
+
title,
|
|
26
|
+
customFooter = false,
|
|
27
|
+
withPagination = true,
|
|
28
|
+
error
|
|
29
|
+
} = props;
|
|
30
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
31
|
+
const [isDownloading, setIsDownloading] = useState(false);
|
|
32
|
+
const handleDownload = useCallback(() => {
|
|
33
|
+
setIsDownloading(true);
|
|
34
|
+
const link = document.createElement("a");
|
|
35
|
+
const currentPdf = encodedPdfs[currentIndex];
|
|
36
|
+
if (!currentPdf) {
|
|
37
|
+
setIsDownloading(false);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
link.href = `data:application/pdf;base64,${currentPdf.base64}`;
|
|
41
|
+
link.download = currentPdf.fileName.endsWith(".pdf") ? currentPdf.fileName : `${currentPdf.fileName}.pdf`;
|
|
42
|
+
document.body.appendChild(link);
|
|
43
|
+
link.click();
|
|
44
|
+
document.body.removeChild(link);
|
|
45
|
+
setIsDownloading(false);
|
|
46
|
+
}, [currentIndex, encodedPdfs]);
|
|
47
|
+
if (!encodedPdfs.length) return null;
|
|
48
|
+
function handleNextFile() {
|
|
49
|
+
if (currentIndex < encodedPdfs.length - 1) {
|
|
50
|
+
setCurrentIndex((prev) => prev + 1);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function handlePreviousFile() {
|
|
54
|
+
if (currentIndex > 0) {
|
|
55
|
+
setCurrentIndex((prev) => prev - 1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function handleClose() {
|
|
59
|
+
setCurrentIndex(0);
|
|
60
|
+
setIsDownloading(false);
|
|
61
|
+
onClose();
|
|
62
|
+
}
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
Modal,
|
|
65
|
+
{
|
|
66
|
+
testid,
|
|
67
|
+
open: isOpen,
|
|
68
|
+
customFooter,
|
|
69
|
+
onClose: handleClose,
|
|
70
|
+
noWrapper: true,
|
|
71
|
+
showButtons: isMobile && customFooter ? !!customActions : !!encodedPdfs.length,
|
|
72
|
+
customActions: !!encodedPdfs.length && !isMobile && withPagination ? /* @__PURE__ */ jsx(
|
|
73
|
+
PdfNavigation,
|
|
74
|
+
{
|
|
75
|
+
testid,
|
|
76
|
+
currentIndex,
|
|
77
|
+
total: encodedPdfs.length,
|
|
78
|
+
onPrev: handlePreviousFile,
|
|
79
|
+
onNext: handleNextFile,
|
|
80
|
+
disablePrev: currentIndex === 0,
|
|
81
|
+
disableNext: currentIndex === encodedPdfs.length - 1,
|
|
82
|
+
extraActions: customActions,
|
|
83
|
+
fileName: encodedPdfs[currentIndex].fileName
|
|
84
|
+
}
|
|
85
|
+
) : customActions,
|
|
86
|
+
fixedHeightScrolling: true,
|
|
87
|
+
headerIconAlign: "right",
|
|
88
|
+
headerIcon: !isMobile ? /* @__PURE__ */ jsx(
|
|
89
|
+
DownloadIcon,
|
|
90
|
+
{
|
|
91
|
+
testid: testid ? `${testid}-download-icon` : void 0,
|
|
92
|
+
onClick: handleDownload,
|
|
93
|
+
isDownloading
|
|
94
|
+
}
|
|
95
|
+
) : void 0,
|
|
96
|
+
title: isMobile ? title != null ? title : encodedPdfs[currentIndex].fileName : void 0,
|
|
97
|
+
size: isMobile ? "screen" : "large",
|
|
98
|
+
headerClassname: "bg-brand-400 desktop:bg-background-grouped-primary-normal p-mobile-layout-padding text-brand-text-action-primary-normal",
|
|
99
|
+
children: /* @__PURE__ */ jsx(
|
|
100
|
+
PDFElement,
|
|
101
|
+
{
|
|
102
|
+
testid,
|
|
103
|
+
b64: encodedPdfs[currentIndex].base64,
|
|
104
|
+
isMobile,
|
|
105
|
+
error
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export {
|
|
113
|
+
PDFViewer
|
|
114
|
+
};
|
|
@@ -70,7 +70,9 @@ var Stack = (_a) => {
|
|
|
70
70
|
noGap,
|
|
71
71
|
marginTop,
|
|
72
72
|
marginBottom,
|
|
73
|
-
testid
|
|
73
|
+
testid,
|
|
74
|
+
bottom,
|
|
75
|
+
zIndex
|
|
74
76
|
} = _b, props = __objRest(_b, [
|
|
75
77
|
"children",
|
|
76
78
|
"items",
|
|
@@ -107,8 +109,11 @@ var Stack = (_a) => {
|
|
|
107
109
|
"noGap",
|
|
108
110
|
"marginTop",
|
|
109
111
|
"marginBottom",
|
|
110
|
-
"testid"
|
|
112
|
+
"testid",
|
|
113
|
+
"bottom",
|
|
114
|
+
"zIndex"
|
|
111
115
|
]);
|
|
116
|
+
var _a2, _b2, _c, _d, _e;
|
|
112
117
|
const flexClassNames = getFlexClassNames({ items, justify, grow });
|
|
113
118
|
const gapClassNames = useGapClassNames(sizing);
|
|
114
119
|
return /* @__PURE__ */ jsx(
|
|
@@ -119,9 +124,9 @@ var Stack = (_a) => {
|
|
|
119
124
|
}, props), {
|
|
120
125
|
style: {
|
|
121
126
|
height: height === "full" ? "100%" : height !== void 0 ? `${height}px` : void 0,
|
|
122
|
-
maxHeight: maxHeight !== void 0 ? `${maxHeight}px` : void 0,
|
|
123
|
-
|
|
124
|
-
|
|
127
|
+
maxHeight: maxHeight !== void 0 ? isNaN(+maxHeight) ? maxHeight : `${maxHeight}px` : (_a2 = props.style) == null ? void 0 : _a2.maxHeight,
|
|
128
|
+
maxWidth: maxWidth !== void 0 ? isNaN(+maxWidth) ? maxWidth : `${maxWidth}px` : (_b2 = props.style) == null ? void 0 : _b2.maxWidth,
|
|
129
|
+
minHeight: minHeight !== void 0 ? isNaN(+minHeight) ? minHeight : `${minHeight}px` : (_c = props.style) == null ? void 0 : _c.minHeight,
|
|
125
130
|
width: width !== void 0 && typeof width === "number" ? `${width}px` : void 0,
|
|
126
131
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
|
127
132
|
border: borderColor ? `1px solid var(--color-${borderColor})` : void 0,
|
|
@@ -130,7 +135,11 @@ var Stack = (_a) => {
|
|
|
130
135
|
flexShrink: flexShrink !== void 0 ? flexShrink : void 0,
|
|
131
136
|
position: position !== void 0 ? position : void 0,
|
|
132
137
|
top: top !== void 0 ? `${top}px` : void 0,
|
|
133
|
-
|
|
138
|
+
bottom: bottom !== void 0 ? `${bottom}px` : void 0,
|
|
139
|
+
left: left !== void 0 ? `${left}px` : void 0,
|
|
140
|
+
borderBlock: (_d = props.style) == null ? void 0 : _d.borderBlock,
|
|
141
|
+
marginInline: (_e = props.style) == null ? void 0 : _e.marginInline,
|
|
142
|
+
zIndex: zIndex !== void 0 ? zIndex : void 0
|
|
134
143
|
},
|
|
135
144
|
className: clsx(
|
|
136
145
|
"scrollbar-thin",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/components/PDFViewer/PDFPage.tsx
|
|
2
|
+
import { usePdf } from "@mikecousins/react-pdf";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function PdfPage({
|
|
6
|
+
file,
|
|
7
|
+
pageNumber,
|
|
8
|
+
testid,
|
|
9
|
+
isMobile
|
|
10
|
+
}) {
|
|
11
|
+
const canvasRef = useRef(null);
|
|
12
|
+
const { pdfDocument } = usePdf({
|
|
13
|
+
file,
|
|
14
|
+
page: pageNumber,
|
|
15
|
+
canvasRef,
|
|
16
|
+
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
17
|
+
scale: isMobile ? 1 : 1.3
|
|
18
|
+
});
|
|
19
|
+
if (!pdfDocument) return null;
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"canvas",
|
|
22
|
+
{
|
|
23
|
+
ref: canvasRef,
|
|
24
|
+
"data-testid": testid,
|
|
25
|
+
style: { width: "100%", height: "auto" }
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
PdfPage
|
|
32
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useGridContext
|
|
3
|
+
} from "./chunk-5IFPG6TS.js";
|
|
4
|
+
import {
|
|
5
|
+
MobileDataGridColumn
|
|
6
|
+
} from "./chunk-M6TSTDNZ.js";
|
|
7
|
+
import {
|
|
8
|
+
Stack
|
|
9
|
+
} from "./chunk-V6U7LU6M.js";
|
|
10
|
+
import {
|
|
11
|
+
Paragraph
|
|
12
|
+
} from "./chunk-OGIFIPKH.js";
|
|
13
|
+
|
|
14
|
+
// src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
function ModalContent() {
|
|
17
|
+
const context = useGridContext();
|
|
18
|
+
const { columns, currentRow } = context;
|
|
19
|
+
if (!currentRow) return null;
|
|
20
|
+
return /* @__PURE__ */ jsx(Stack, { sizing: "layout-group", children: columns.filter((x) => {
|
|
21
|
+
var _a;
|
|
22
|
+
return !((_a = x.id) == null ? void 0 : _a.startsWith("__"));
|
|
23
|
+
}).map(
|
|
24
|
+
(column, index) => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return ((_a = column.meta) == null ? void 0 : _a.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ jsxs(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: "mb-2 grid grid-cols-2 gap-2 px-3 items-center flex-1",
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsxs(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
32
|
+
(_b = column.header) == null ? void 0 : _b.toString(),
|
|
33
|
+
":"
|
|
34
|
+
] }),
|
|
35
|
+
" ",
|
|
36
|
+
/* @__PURE__ */ jsx(
|
|
37
|
+
column.meta.mobileCell,
|
|
38
|
+
{
|
|
39
|
+
column,
|
|
40
|
+
row: currentRow,
|
|
41
|
+
cellValue: currentRow == null ? void 0 : currentRow[column.id]
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
`${column.id}-${index}`
|
|
47
|
+
) : /* @__PURE__ */ jsx(
|
|
48
|
+
MobileDataGridColumn,
|
|
49
|
+
{
|
|
50
|
+
column,
|
|
51
|
+
data: currentRow
|
|
52
|
+
},
|
|
53
|
+
`${column.id}-${index}`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
) });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
ModalContent
|
|
61
|
+
};
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from "./chunk-WPEDVM56.js";
|
|
7
7
|
import {
|
|
8
8
|
MenuOption
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
Search
|
|
12
|
-
} from "./chunk-6GAYJCFE.js";
|
|
9
|
+
} from "./chunk-CKQNJNU3.js";
|
|
13
10
|
import {
|
|
14
11
|
CSS
|
|
15
12
|
} from "./chunk-WVUIIBRR.js";
|
|
13
|
+
import {
|
|
14
|
+
Search
|
|
15
|
+
} from "./chunk-6DPFKSCT.js";
|
|
16
16
|
import {
|
|
17
17
|
Icon
|
|
18
18
|
} from "./chunk-NKUETCDA.js";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MobileDataGridCard
|
|
3
|
+
} from "./chunk-P36QKH26.js";
|
|
4
|
+
import {
|
|
5
|
+
useGridContext
|
|
6
|
+
} from "./chunk-5IFPG6TS.js";
|
|
7
|
+
import {
|
|
8
|
+
__spreadValues
|
|
9
|
+
} from "./chunk-ORMEWXMH.js";
|
|
10
|
+
|
|
11
|
+
// src/components/MobileDataGrid/ColumnList.tsx
|
|
12
|
+
import clsx from "clsx";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
function ColumnList(props) {
|
|
15
|
+
const {
|
|
16
|
+
withBorder,
|
|
17
|
+
renderLink,
|
|
18
|
+
renderChevron,
|
|
19
|
+
footer: Footer,
|
|
20
|
+
enableRowSelection,
|
|
21
|
+
rowActions
|
|
22
|
+
} = props;
|
|
23
|
+
const ctx = useGridContext();
|
|
24
|
+
const { id, testid, data, getId, selectedRowIds } = ctx;
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: clsx(
|
|
29
|
+
"flex flex-col flex-1 relative overflow-y-auto overflow-x-hidden",
|
|
30
|
+
!!Footer && "mb-20"
|
|
31
|
+
),
|
|
32
|
+
children: /* @__PURE__ */ jsxs(
|
|
33
|
+
"ul",
|
|
34
|
+
{
|
|
35
|
+
id,
|
|
36
|
+
"data-testid": testid,
|
|
37
|
+
className: clsx(
|
|
38
|
+
"rounded absolute top-0 left-0 w-full flex-1",
|
|
39
|
+
"divide-y divide-border-primary-normal",
|
|
40
|
+
withBorder && "border border-border-primary-normal"
|
|
41
|
+
),
|
|
42
|
+
children: [
|
|
43
|
+
data.map((item) => {
|
|
44
|
+
const id2 = getId(item);
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
MobileDataGridCard,
|
|
47
|
+
{
|
|
48
|
+
data: item,
|
|
49
|
+
renderLink,
|
|
50
|
+
enableRowSelection,
|
|
51
|
+
selected: !!id2 && selectedRowIds.includes(id2),
|
|
52
|
+
renderChevron,
|
|
53
|
+
rowActions
|
|
54
|
+
},
|
|
55
|
+
id2
|
|
56
|
+
);
|
|
57
|
+
}),
|
|
58
|
+
!!Footer && /* @__PURE__ */ jsx("div", { className: "fixed left-0 right-0 bottom-0 flex flex-col w-full min-h-20", children: /* @__PURE__ */ jsx(Footer, __spreadValues({}, ctx)) })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
ColumnList
|
|
68
|
+
};
|