@dmsi/wedgekit-react 0.0.414 → 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-OBY5EH47.js → chunk-HYJIDHAK.js} +6 -6
- package/dist/{chunk-LZGYABCX.js → chunk-IMOIZFJZ.js} +8 -8
- 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-PQWWVBSR.js +61 -0
- 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 +232 -53
- package/dist/components/CalendarRange.css +178 -65
- package/dist/components/CalendarRange.js +25 -17
- 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 +190 -11
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +178 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +25 -17
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +200 -21
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +178 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +25 -17
- package/dist/components/DataGrid/PinnedColumns.cjs +215 -36
- package/dist/components/DataGrid/PinnedColumns.css +178 -65
- package/dist/components/DataGrid/PinnedColumns.js +25 -17
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +191 -12
- package/dist/components/DataGrid/TableBody/LoadingCell.css +178 -65
- package/dist/components/DataGrid/TableBody/LoadingCell.js +25 -17
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +197 -18
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +178 -65
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +25 -17
- package/dist/components/DataGrid/TableBody/index.cjs +212 -33
- package/dist/components/DataGrid/TableBody/index.css +178 -65
- package/dist/components/DataGrid/TableBody/index.js +25 -17
- package/dist/components/DataGrid/index.cjs +301 -122
- package/dist/components/DataGrid/index.css +178 -65
- package/dist/components/DataGrid/index.js +25 -17
- package/dist/components/DataGrid/utils.cjs +191 -12
- package/dist/components/DataGrid/utils.css +178 -65
- package/dist/components/DataGrid/utils.js +25 -17
- package/dist/components/DateInput.cjs +251 -72
- package/dist/components/DateInput.css +178 -65
- package/dist/components/DateInput.js +25 -17
- package/dist/components/DateRangeInput.cjs +251 -72
- package/dist/components/DateRangeInput.css +178 -65
- package/dist/components/DateRangeInput.js +25 -17
- 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 +198 -19
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +178 -65
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +25 -17
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +36 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +242 -27
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +178 -65
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +25 -17
- 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 +742 -527
- package/dist/components/MobileDataGrid/index.css +178 -65
- package/dist/components/MobileDataGrid/index.js +25 -17
- 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 +5 -5
- 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 +521 -0
- package/dist/components/SimpleTable.js +10 -0
- 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 +739 -131
- package/dist/components/index.css +178 -65
- package/dist/components/index.js +37 -17
- package/dist/index.css +178 -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/SimpleTable.tsx +77 -0
- package/src/components/Stack.tsx +76 -0
- package/src/components/Tooltip.tsx +4 -3
- package/src/components/index.ts +4 -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
|
@@ -496,6 +496,10 @@ var Stack = (_a) => {
|
|
|
496
496
|
padding,
|
|
497
497
|
paddingX,
|
|
498
498
|
paddingY,
|
|
499
|
+
paddingBottom,
|
|
500
|
+
paddingTop,
|
|
501
|
+
paddingLeft,
|
|
502
|
+
paddingRight,
|
|
499
503
|
margin,
|
|
500
504
|
marginX,
|
|
501
505
|
marginY,
|
|
@@ -511,6 +515,10 @@ var Stack = (_a) => {
|
|
|
511
515
|
height,
|
|
512
516
|
maxHeight,
|
|
513
517
|
borderColor,
|
|
518
|
+
borderTopColor,
|
|
519
|
+
borderRightColor,
|
|
520
|
+
borderBottomColor,
|
|
521
|
+
borderLeftColor,
|
|
514
522
|
backgroundColor,
|
|
515
523
|
sizing = "none",
|
|
516
524
|
overflowY = "inherit",
|
|
@@ -536,6 +544,10 @@ var Stack = (_a) => {
|
|
|
536
544
|
"padding",
|
|
537
545
|
"paddingX",
|
|
538
546
|
"paddingY",
|
|
547
|
+
"paddingBottom",
|
|
548
|
+
"paddingTop",
|
|
549
|
+
"paddingLeft",
|
|
550
|
+
"paddingRight",
|
|
539
551
|
"margin",
|
|
540
552
|
"marginX",
|
|
541
553
|
"marginY",
|
|
@@ -551,6 +563,10 @@ var Stack = (_a) => {
|
|
|
551
563
|
"height",
|
|
552
564
|
"maxHeight",
|
|
553
565
|
"borderColor",
|
|
566
|
+
"borderTopColor",
|
|
567
|
+
"borderRightColor",
|
|
568
|
+
"borderBottomColor",
|
|
569
|
+
"borderLeftColor",
|
|
554
570
|
"backgroundColor",
|
|
555
571
|
"sizing",
|
|
556
572
|
"overflowY",
|
|
@@ -586,6 +602,10 @@ var Stack = (_a) => {
|
|
|
586
602
|
width: width !== void 0 && typeof width === "number" ? `${width}px` : void 0,
|
|
587
603
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
|
588
604
|
border: borderColor ? `1px solid var(--color-${borderColor})` : void 0,
|
|
605
|
+
borderTop: borderTopColor ? `1px solid var(--color-${borderTopColor})` : void 0,
|
|
606
|
+
borderRight: borderRightColor ? `1px solid var(--color-${borderRightColor})` : void 0,
|
|
607
|
+
borderBottom: borderBottomColor ? `1px solid var(--color-${borderBottomColor})` : void 0,
|
|
608
|
+
borderLeft: borderLeftColor ? `1px solid var(--color-${borderLeftColor})` : void 0,
|
|
589
609
|
backgroundColor: backgroundColor ? `var(--color-${backgroundColor})` : void 0,
|
|
590
610
|
flexGrow: flexGrow !== void 0 ? flexGrow : void 0,
|
|
591
611
|
flexShrink: flexShrink !== void 0 ? flexShrink : void 0,
|
|
@@ -625,6 +645,22 @@ var Stack = (_a) => {
|
|
|
625
645
|
paddingY && sizing === "layout" && "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding",
|
|
626
646
|
paddingY && sizing === "layout-group" && paddingYUsingLayoutGroupGap,
|
|
627
647
|
paddingY && sizing === "component" && "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding",
|
|
648
|
+
paddingBottom && sizing === "container" && "pb-mobile-container-padding desktop:pb-desktop-container-padding compact:pb-desktop-compact-container-padding",
|
|
649
|
+
paddingBottom && sizing === "layout" && "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding",
|
|
650
|
+
paddingBottom && sizing === "layout-group" && "pb-mobile-layout-group-padding desktop:pb-desktop-layout-group-padding compact:pb-desktop-compact-layout-group-padding",
|
|
651
|
+
paddingBottom && sizing === "component" && "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding",
|
|
652
|
+
paddingTop && sizing === "container" && "pt-mobile-container-padding desktop:pt-desktop-container-padding compact:pt-desktop-compact-container-padding",
|
|
653
|
+
paddingTop && sizing === "layout" && "pt-mobile-layout-padding desktop:pt-desktop-layout-padding compact:pt-desktop-compact-layout-padding",
|
|
654
|
+
paddingTop && sizing === "layout-group" && "pt-mobile-layout-group-padding desktop:pt-desktop-layout-group-padding compact:pt-desktop-compact-layout-group-padding",
|
|
655
|
+
paddingTop && sizing === "component" && "pt-mobile-component-padding desktop:pt-desktop-component-padding compact:pt-desktop-compact-component-padding",
|
|
656
|
+
paddingLeft && sizing === "container" && "pl-mobile-container-padding desktop:pl-desktop-container-padding compact:pl-desktop-compact-container-padding",
|
|
657
|
+
paddingLeft && sizing === "layout" && "pl-mobile-layout-padding desktop:pl-desktop-layout-padding compact:pl-desktop-compact-layout-padding",
|
|
658
|
+
paddingLeft && sizing === "layout-group" && "pl-mobile-layout-group-padding desktop:pl-desktop-layout-group-padding compact:pl-desktop-compact-layout-group-padding",
|
|
659
|
+
paddingLeft && sizing === "component" && "pl-mobile-component-padding desktop:pl-desktop-component-padding compact:pl-desktop-compact-component-padding",
|
|
660
|
+
paddingRight && sizing === "container" && "pr-mobile-container-padding desktop:pr-desktop-container-padding compact:pr-desktop-compact-container-padding",
|
|
661
|
+
paddingRight && sizing === "layout" && "pr-mobile-layout-padding desktop:pr-desktop-layout-padding compact:pr-desktop-compact-layout-padding",
|
|
662
|
+
paddingRight && sizing === "layout-group" && "pr-mobile-layout-group-padding desktop:pr-desktop-layout-group-padding compact:pr-desktop-compact-layout-group-padding",
|
|
663
|
+
paddingRight && sizing === "component" && "pr-mobile-component-padding desktop:pr-desktop-component-padding compact:pr-desktop-compact-component-padding",
|
|
628
664
|
margin && sizing === "container" && "m-mobile-container-padding desktop:m-desktop-container-padding compact:m-compact-container-padding",
|
|
629
665
|
marginX && sizing === "container" && "mx-mobile-container-padding desktop:mx-desktop-container-padding compact:mx-compact-container-padding",
|
|
630
666
|
marginTop && sizing === "container" && "mt-mobile-container-padding desktop:mt-desktop-container-padding compact:mt-compact-container-padding",
|
|
@@ -670,7 +706,7 @@ function Theme({
|
|
|
670
706
|
}
|
|
671
707
|
|
|
672
708
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
673
|
-
var
|
|
709
|
+
var import_react35 = require("react");
|
|
674
710
|
|
|
675
711
|
// src/components/DataGridCell.tsx
|
|
676
712
|
var import_sortable = require("@dnd-kit/sortable");
|
|
@@ -4237,7 +4273,7 @@ var Tooltip = ({
|
|
|
4237
4273
|
id,
|
|
4238
4274
|
"data-testid": testid,
|
|
4239
4275
|
ref,
|
|
4240
|
-
className: "relative inline-grid grid-cols-[auto_1fr] items-center",
|
|
4276
|
+
className: "relative inline-grid grid-cols-[auto_1fr] items-center cursor-pointer",
|
|
4241
4277
|
onMouseEnter: handleMouseEnter,
|
|
4242
4278
|
onMouseLeave: handleMouseLeave,
|
|
4243
4279
|
children: [
|
|
@@ -4303,12 +4339,11 @@ var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
|
4303
4339
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4304
4340
|
|
|
4305
4341
|
// src/components/Grid.tsx
|
|
4306
|
-
var import_react21 = require("react");
|
|
4307
4342
|
var import_clsx23 = __toESM(require("clsx"), 1);
|
|
4308
4343
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4309
4344
|
|
|
4310
4345
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
4311
|
-
var
|
|
4346
|
+
var import_react21 = require("react");
|
|
4312
4347
|
|
|
4313
4348
|
// src/components/Spinner.tsx
|
|
4314
4349
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -4344,7 +4379,7 @@ Spinner.displayName = "Spinner";
|
|
|
4344
4379
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4345
4380
|
|
|
4346
4381
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
4347
|
-
var
|
|
4382
|
+
var import_react22 = require("react");
|
|
4348
4383
|
|
|
4349
4384
|
// src/components/Surface.tsx
|
|
4350
4385
|
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
@@ -4389,423 +4424,116 @@ var import_clsx25 = require("clsx");
|
|
|
4389
4424
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4390
4425
|
|
|
4391
4426
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
4392
|
-
var
|
|
4427
|
+
var import_react23 = require("react");
|
|
4393
4428
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4394
4429
|
|
|
4395
4430
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
4396
|
-
var
|
|
4431
|
+
var import_react24 = require("react");
|
|
4397
4432
|
|
|
4398
4433
|
// src/components/ProductImagePreview/index.tsx
|
|
4399
4434
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4400
4435
|
|
|
4401
4436
|
// src/components/CompactImagesPreview.tsx
|
|
4402
|
-
var
|
|
4437
|
+
var import_react25 = require("react");
|
|
4403
4438
|
var import_clsx26 = __toESM(require("clsx"), 1);
|
|
4404
4439
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4405
4440
|
|
|
4406
|
-
// src/components/
|
|
4407
|
-
var
|
|
4441
|
+
// src/components/SimpleTable.tsx
|
|
4442
|
+
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
4443
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4408
4444
|
|
|
4409
|
-
// src/components/
|
|
4410
|
-
var
|
|
4411
|
-
var GridContext = (0, import_react27.createContext)(null);
|
|
4445
|
+
// src/components/PDFViewer/index.tsx
|
|
4446
|
+
var import_react30 = require("react");
|
|
4412
4447
|
|
|
4413
|
-
// src/components/
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
if (!ctx) {
|
|
4417
|
-
throw new Error("useGridContext must be used within GridContextProvider");
|
|
4418
|
-
}
|
|
4419
|
-
return ctx;
|
|
4420
|
-
}
|
|
4448
|
+
// src/components/Modal.tsx
|
|
4449
|
+
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
4450
|
+
var import_react27 = require("react");
|
|
4421
4451
|
|
|
4422
|
-
// src/components/
|
|
4423
|
-
var
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
dispatch
|
|
4437
|
-
} = context;
|
|
4438
|
-
const toggleColumnVisibility = (0, import_react29.useCallback)(
|
|
4439
|
-
(index, visible) => {
|
|
4440
|
-
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
4441
|
-
},
|
|
4442
|
-
[dispatch]
|
|
4443
|
-
);
|
|
4444
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
4452
|
+
// src/components/ModalHeader.tsx
|
|
4453
|
+
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
4454
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4455
|
+
var ModalHeader = ({
|
|
4456
|
+
title,
|
|
4457
|
+
hideCloseIcon,
|
|
4458
|
+
headerIcon,
|
|
4459
|
+
headerIconAlign,
|
|
4460
|
+
onClose,
|
|
4461
|
+
id,
|
|
4462
|
+
testid,
|
|
4463
|
+
headerClassname
|
|
4464
|
+
}) => {
|
|
4465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
4445
4466
|
"div",
|
|
4446
4467
|
{
|
|
4447
|
-
id
|
|
4468
|
+
id,
|
|
4448
4469
|
"data-testid": testid,
|
|
4449
|
-
className:
|
|
4450
|
-
|
|
4470
|
+
className: (0, import_clsx28.default)(
|
|
4471
|
+
"flex justify-between items-center",
|
|
4472
|
+
headerIconAlign === "center" && "justify-center",
|
|
4473
|
+
headerIconAlign === "right" && "justify-end",
|
|
4474
|
+
headerIconAlign === "left" && "justify-start",
|
|
4475
|
+
layoutPaddding,
|
|
4476
|
+
layoutGroupGap,
|
|
4477
|
+
headerClassname
|
|
4478
|
+
),
|
|
4451
4479
|
children: [
|
|
4452
|
-
/* @__PURE__ */ (0,
|
|
4480
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: (0, import_clsx28.default)("flex items-center flex-1", layoutGroupGap), children: [
|
|
4481
|
+
headerIcon,
|
|
4482
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4483
|
+
Heading2,
|
|
4484
|
+
{
|
|
4485
|
+
id: id ? `${id}-title` : void 0,
|
|
4486
|
+
testid: testid ? `${testid}-title` : void 0,
|
|
4487
|
+
as: "p",
|
|
4488
|
+
children: title
|
|
4489
|
+
}
|
|
4490
|
+
)
|
|
4491
|
+
] }),
|
|
4492
|
+
!hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4453
4493
|
Button,
|
|
4454
4494
|
{
|
|
4455
|
-
id: id ? `${id}-button` : void 0,
|
|
4456
|
-
testid: testid ? `${testid}-button` : void 0,
|
|
4457
|
-
onClick: () => setShow((prev) => !prev),
|
|
4458
|
-
variant: "navigation",
|
|
4495
|
+
id: id ? `${id}-close-button` : void 0,
|
|
4496
|
+
testid: testid ? `${testid}-close-button` : void 0,
|
|
4459
4497
|
iconOnly: true,
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
),
|
|
4464
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
4465
|
-
Menu,
|
|
4466
|
-
{
|
|
4467
|
-
id: id ? `${id}-menu` : void 0,
|
|
4468
|
-
testid: testid ? `${testid}-menu` : void 0,
|
|
4469
|
-
positionTo: ref,
|
|
4470
|
-
position: "bottom-right",
|
|
4471
|
-
show,
|
|
4472
|
-
setShow,
|
|
4473
|
-
calculateMinMaxHeight: true,
|
|
4474
|
-
children: [
|
|
4475
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4476
|
-
Button,
|
|
4477
|
-
{
|
|
4478
|
-
id: id ? `${id}-reset-button` : void 0,
|
|
4479
|
-
testid: testid ? `${testid}-reset-button` : void 0,
|
|
4480
|
-
variant: "tertiary",
|
|
4481
|
-
onClick: () => {
|
|
4482
|
-
resetColumnVisibility();
|
|
4483
|
-
setShow(false);
|
|
4484
|
-
},
|
|
4485
|
-
children: "Reset to default"
|
|
4486
|
-
}
|
|
4487
|
-
),
|
|
4488
|
-
columns.filter((x) => {
|
|
4489
|
-
var _a;
|
|
4490
|
-
return (_a = x.meta) == null ? void 0 : _a.inVisibilityMenu;
|
|
4491
|
-
}).map((column) => {
|
|
4492
|
-
var _a, _b, _c;
|
|
4493
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4494
|
-
MenuOption,
|
|
4495
|
-
{
|
|
4496
|
-
testid: testid ? `${testid}-option-${column.id}` : void 0,
|
|
4497
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4498
|
-
Checkbox,
|
|
4499
|
-
{
|
|
4500
|
-
id: id ? `${id}-checkbox-${column.id}` : void 0,
|
|
4501
|
-
testid: testid ? `${testid}-checkbox-${column.id}` : void 0,
|
|
4502
|
-
label: (_a = column.header) == null ? void 0 : _a.toString(),
|
|
4503
|
-
checked: !!((_b = column.meta) == null ? void 0 : _b.visible) || column.id === String(primaryKey),
|
|
4504
|
-
disabled: typeof numberOfColumnsToShow !== "undefined" && // account for header+link occupying one slot
|
|
4505
|
-
visibleColumns.length >= numberOfColumnsToShow - 1 && ((_c = column.meta) == null ? void 0 : _c.visible) !== true || column.id === String(primaryKey),
|
|
4506
|
-
onChange: (e) => {
|
|
4507
|
-
toggleColumnVisibility(
|
|
4508
|
-
columns.findIndex(({ id: id2 }) => id2 === column.id),
|
|
4509
|
-
e.target.checked
|
|
4510
|
-
);
|
|
4511
|
-
}
|
|
4512
|
-
}
|
|
4513
|
-
)
|
|
4514
|
-
},
|
|
4515
|
-
id ? `${id}-option-${column.id}` : void 0
|
|
4516
|
-
);
|
|
4517
|
-
})
|
|
4518
|
-
]
|
|
4498
|
+
variant: "tertiary",
|
|
4499
|
+
onClick: onClose,
|
|
4500
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: "close", size: 24 }) })
|
|
4519
4501
|
}
|
|
4520
4502
|
)
|
|
4521
4503
|
]
|
|
4522
4504
|
}
|
|
4523
4505
|
);
|
|
4524
|
-
}
|
|
4506
|
+
};
|
|
4507
|
+
ModalHeader.displayName = "ModalHeader";
|
|
4525
4508
|
|
|
4526
|
-
// src/components/
|
|
4527
|
-
var
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4509
|
+
// src/components/ModalContent.tsx
|
|
4510
|
+
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
4511
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4512
|
+
function ModalContent({
|
|
4513
|
+
fixedHeightScrolling,
|
|
4514
|
+
children,
|
|
4515
|
+
id,
|
|
4516
|
+
testid
|
|
4532
4517
|
}) {
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
if (typeof Header === "string" || primaryKey)
|
|
4547
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4548
|
-
"div",
|
|
4549
|
-
{
|
|
4550
|
-
id: id ? `${id}-header` : void 0,
|
|
4551
|
-
"data-testid": testid ? `${testid}-header` : void 0,
|
|
4552
|
-
className: "sticky top-0",
|
|
4553
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Theme, { theme: "brand", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
4554
|
-
Stack,
|
|
4555
|
-
{
|
|
4556
|
-
horizontal: true,
|
|
4557
|
-
horizontalMobile: true,
|
|
4558
|
-
items: "center",
|
|
4559
|
-
justify: "between",
|
|
4560
|
-
backgroundColor: "background-primary-normal",
|
|
4561
|
-
children: [
|
|
4562
|
-
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit h-full", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4563
|
-
Checkbox,
|
|
4564
|
-
{
|
|
4565
|
-
id: id ? `${id}-select-all-checkbox` : void 0,
|
|
4566
|
-
testid: testid ? `${testid}-select-all-checkbox` : void 0,
|
|
4567
|
-
checked: selectedRowIds.length === data.length,
|
|
4568
|
-
indeterminate: !!selectedRowIds.length && selectedRowIds.length !== data.length,
|
|
4569
|
-
onChange: handleRowSelectAll
|
|
4570
|
-
}
|
|
4571
|
-
) }),
|
|
4572
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4573
|
-
Stack,
|
|
4574
|
-
{
|
|
4575
|
-
horizontal: true,
|
|
4576
|
-
horizontalMobile: true,
|
|
4577
|
-
items: "center",
|
|
4578
|
-
sizing: "component",
|
|
4579
|
-
padding: true,
|
|
4580
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Heading3, { as: "span", color: "text-primary-normal", children: typeof Header === "string" ? Header : (_b = (_a = columns.find((col) => col.id === primaryKey)) == null ? void 0 : _a.header) == null ? void 0 : _b.toString() })
|
|
4581
|
-
}
|
|
4582
|
-
),
|
|
4583
|
-
enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ColumnSelector, {})
|
|
4584
|
-
]
|
|
4585
|
-
}
|
|
4586
|
-
) })
|
|
4587
|
-
}
|
|
4588
|
-
);
|
|
4589
|
-
}
|
|
4590
|
-
|
|
4591
|
-
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4592
|
-
var import_react30 = require("react");
|
|
4593
|
-
|
|
4594
|
-
// src/components/MobileDataGrid/dataGridReducer.ts
|
|
4595
|
-
function dataGridReducer(state, action) {
|
|
4596
|
-
var _a, _b, _c;
|
|
4597
|
-
const { type, payload } = action;
|
|
4598
|
-
let itemIndex = null;
|
|
4599
|
-
if (action.type === "INSERT" && action.pos === "INDEX")
|
|
4600
|
-
itemIndex = action.index;
|
|
4601
|
-
if (action.type === "UPDATE")
|
|
4602
|
-
itemIndex = (_a = action.index) != null ? _a : state.filter(({ id }) => !!id).findIndex(({ id }) => id === action.id);
|
|
4603
|
-
switch (type) {
|
|
4604
|
-
case "SET":
|
|
4605
|
-
return [...payload];
|
|
4606
|
-
case "UPDATE":
|
|
4607
|
-
if (typeof itemIndex !== "number" || itemIndex < 0)
|
|
4608
|
-
throw new Error("action.(id | index) must be provided.");
|
|
4609
|
-
return [
|
|
4610
|
-
...state.slice(0, itemIndex),
|
|
4611
|
-
__spreadProps(__spreadValues(__spreadValues({}, state[itemIndex]), payload), {
|
|
4612
|
-
meta: __spreadValues(__spreadValues({}, (_b = state[itemIndex].meta) != null ? _b : {}), (_c = payload.meta) != null ? _c : {})
|
|
4613
|
-
}),
|
|
4614
|
-
...state.slice(itemIndex + 1)
|
|
4615
|
-
];
|
|
4616
|
-
default:
|
|
4617
|
-
throw new Error("Action type not implemented.");
|
|
4618
|
-
}
|
|
4518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4519
|
+
"div",
|
|
4520
|
+
{
|
|
4521
|
+
id,
|
|
4522
|
+
"data-testid": testid,
|
|
4523
|
+
className: (0, import_clsx29.default)(
|
|
4524
|
+
"flex-grow desktop:flex-grow-0",
|
|
4525
|
+
layoutPaddding,
|
|
4526
|
+
fixedHeightScrolling && "overflow-auto"
|
|
4527
|
+
),
|
|
4528
|
+
children
|
|
4529
|
+
}
|
|
4530
|
+
);
|
|
4619
4531
|
}
|
|
4620
|
-
|
|
4621
|
-
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4622
|
-
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4623
|
-
function GridContextProvider(props) {
|
|
4624
|
-
const {
|
|
4625
|
-
initialColumns,
|
|
4626
|
-
id,
|
|
4627
|
-
testid,
|
|
4628
|
-
children,
|
|
4629
|
-
data,
|
|
4630
|
-
numberOfColumnsToShow,
|
|
4631
|
-
primaryKey,
|
|
4632
|
-
getId,
|
|
4633
|
-
onRowSelect
|
|
4634
|
-
} = props;
|
|
4635
|
-
const [columns, dispatch] = (0, import_react30.useReducer)(dataGridReducer, initialColumns);
|
|
4636
|
-
const [selectedRowIds, setSelectedRowIds] = (0, import_react30.useState)([]);
|
|
4637
|
-
const [currentRow, setCurrentRow] = (0, import_react30.useState)(null);
|
|
4638
|
-
const resetColumnVisibility = (0, import_react30.useCallback)(() => {
|
|
4639
|
-
const newColumns = columns.map((column) => {
|
|
4640
|
-
var _a;
|
|
4641
|
-
const initialColumn = initialColumns.find((c) => c.id === column.id);
|
|
4642
|
-
return __spreadProps(__spreadValues({}, column), {
|
|
4643
|
-
meta: __spreadProps(__spreadValues({}, column.meta), {
|
|
4644
|
-
visible: (_a = initialColumn == null ? void 0 : initialColumn.meta) == null ? void 0 : _a.visible
|
|
4645
|
-
})
|
|
4646
|
-
});
|
|
4647
|
-
});
|
|
4648
|
-
dispatch({ type: "SET", payload: newColumns });
|
|
4649
|
-
}, [columns, initialColumns]);
|
|
4650
|
-
const handleRowSelect = (0, import_react30.useCallback)(
|
|
4651
|
-
(item) => {
|
|
4652
|
-
var _a;
|
|
4653
|
-
const rowId = (_a = getId(item)) != null ? _a : "";
|
|
4654
|
-
if (!rowId) return;
|
|
4655
|
-
const nextSelected = selectedRowIds.includes(rowId) ? selectedRowIds.filter((id2) => id2 !== rowId) : [...selectedRowIds, rowId];
|
|
4656
|
-
setSelectedRowIds(nextSelected);
|
|
4657
|
-
if (onRowSelect) onRowSelect(item, nextSelected);
|
|
4658
|
-
},
|
|
4659
|
-
[getId, onRowSelect, selectedRowIds]
|
|
4660
|
-
);
|
|
4661
|
-
const handleRowSelectAll = (0, import_react30.useCallback)(() => {
|
|
4662
|
-
setSelectedRowIds((prev) => {
|
|
4663
|
-
if (prev.length === data.length) {
|
|
4664
|
-
return [];
|
|
4665
|
-
}
|
|
4666
|
-
return data.map(getId).filter((id2) => id2 !== void 0);
|
|
4667
|
-
});
|
|
4668
|
-
}, [data, getId]);
|
|
4669
|
-
const openRowDetail = (0, import_react30.useCallback)((row) => {
|
|
4670
|
-
setCurrentRow(row);
|
|
4671
|
-
}, []);
|
|
4672
|
-
const closeRowDetail = (0, import_react30.useCallback)(() => {
|
|
4673
|
-
setCurrentRow(null);
|
|
4674
|
-
}, []);
|
|
4675
|
-
const visibleColumns = (0, import_react30.useMemo)(() => {
|
|
4676
|
-
const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
|
|
4677
|
-
if (primaryKey) {
|
|
4678
|
-
const pkColumn = columns.find((col) => col.id === String(primaryKey));
|
|
4679
|
-
const otherColumns = columns.filter(
|
|
4680
|
-
(col) => col.id !== String(primaryKey)
|
|
4681
|
-
);
|
|
4682
|
-
const orderedColumns = pkColumn ? [pkColumn, ...otherColumns] : [...otherColumns];
|
|
4683
|
-
return orderedColumns.filter((x) => {
|
|
4684
|
-
var _a;
|
|
4685
|
-
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
4686
|
-
}).slice(0, effectiveLimit);
|
|
4687
|
-
}
|
|
4688
|
-
return columns.filter((x) => {
|
|
4689
|
-
var _a;
|
|
4690
|
-
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
4691
|
-
}).slice(0, effectiveLimit);
|
|
4692
|
-
}, [columns, numberOfColumnsToShow, primaryKey]);
|
|
4693
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4694
|
-
GridContext.Provider,
|
|
4695
|
-
{
|
|
4696
|
-
value: {
|
|
4697
|
-
columns,
|
|
4698
|
-
testid,
|
|
4699
|
-
id,
|
|
4700
|
-
data,
|
|
4701
|
-
selectedRowIds,
|
|
4702
|
-
visibleColumns,
|
|
4703
|
-
numberOfColumnsToShow,
|
|
4704
|
-
primaryKey,
|
|
4705
|
-
dispatch,
|
|
4706
|
-
getId,
|
|
4707
|
-
resetColumnVisibility,
|
|
4708
|
-
handleRowSelect,
|
|
4709
|
-
handleRowSelectAll,
|
|
4710
|
-
isRowDetailOpen: !!currentRow,
|
|
4711
|
-
currentRow,
|
|
4712
|
-
openRowDetail,
|
|
4713
|
-
closeRowDetail
|
|
4714
|
-
},
|
|
4715
|
-
children
|
|
4716
|
-
}
|
|
4717
|
-
);
|
|
4718
|
-
}
|
|
4719
|
-
|
|
4720
|
-
// src/components/Modal.tsx
|
|
4721
|
-
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
4722
|
-
var import_react32 = require("react");
|
|
4723
|
-
|
|
4724
|
-
// src/components/ModalHeader.tsx
|
|
4725
|
-
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
4726
|
-
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4727
|
-
var ModalHeader = ({
|
|
4728
|
-
title,
|
|
4729
|
-
hideCloseIcon,
|
|
4730
|
-
headerIcon,
|
|
4731
|
-
headerIconAlign,
|
|
4732
|
-
onClose,
|
|
4733
|
-
id,
|
|
4734
|
-
testid,
|
|
4735
|
-
headerClassname
|
|
4736
|
-
}) => {
|
|
4737
|
-
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
4738
|
-
"div",
|
|
4739
|
-
{
|
|
4740
|
-
id,
|
|
4741
|
-
"data-testid": testid,
|
|
4742
|
-
className: (0, import_clsx27.default)(
|
|
4743
|
-
"flex justify-between items-center",
|
|
4744
|
-
headerIconAlign === "center" && "justify-center",
|
|
4745
|
-
headerIconAlign === "right" && "justify-end",
|
|
4746
|
-
headerIconAlign === "left" && "justify-start",
|
|
4747
|
-
layoutPaddding,
|
|
4748
|
-
layoutGroupGap,
|
|
4749
|
-
headerClassname
|
|
4750
|
-
),
|
|
4751
|
-
children: [
|
|
4752
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: (0, import_clsx27.default)("flex items-center flex-1", layoutGroupGap), children: [
|
|
4753
|
-
headerIcon,
|
|
4754
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4755
|
-
Heading2,
|
|
4756
|
-
{
|
|
4757
|
-
id: id ? `${id}-title` : void 0,
|
|
4758
|
-
testid: testid ? `${testid}-title` : void 0,
|
|
4759
|
-
as: "p",
|
|
4760
|
-
children: title
|
|
4761
|
-
}
|
|
4762
|
-
)
|
|
4763
|
-
] }),
|
|
4764
|
-
!hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4765
|
-
Button,
|
|
4766
|
-
{
|
|
4767
|
-
id: id ? `${id}-close-button` : void 0,
|
|
4768
|
-
testid: testid ? `${testid}-close-button` : void 0,
|
|
4769
|
-
iconOnly: true,
|
|
4770
|
-
variant: "tertiary",
|
|
4771
|
-
onClick: onClose,
|
|
4772
|
-
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { name: "close", size: 24 }) })
|
|
4773
|
-
}
|
|
4774
|
-
)
|
|
4775
|
-
]
|
|
4776
|
-
}
|
|
4777
|
-
);
|
|
4778
|
-
};
|
|
4779
|
-
ModalHeader.displayName = "ModalHeader";
|
|
4780
|
-
|
|
4781
|
-
// src/components/ModalContent.tsx
|
|
4782
|
-
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
4783
|
-
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4784
|
-
function ModalContent({
|
|
4785
|
-
fixedHeightScrolling,
|
|
4786
|
-
children,
|
|
4787
|
-
id,
|
|
4788
|
-
testid
|
|
4789
|
-
}) {
|
|
4790
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4791
|
-
"div",
|
|
4792
|
-
{
|
|
4793
|
-
id,
|
|
4794
|
-
"data-testid": testid,
|
|
4795
|
-
className: (0, import_clsx28.default)(
|
|
4796
|
-
"flex-grow desktop:flex-grow-0",
|
|
4797
|
-
layoutPaddding,
|
|
4798
|
-
fixedHeightScrolling && "overflow-auto"
|
|
4799
|
-
),
|
|
4800
|
-
children
|
|
4801
|
-
}
|
|
4802
|
-
);
|
|
4803
|
-
}
|
|
4804
|
-
ModalContent.displayName = "ModalContent";
|
|
4532
|
+
ModalContent.displayName = "ModalContent";
|
|
4805
4533
|
|
|
4806
4534
|
// src/components/ModalButtons.tsx
|
|
4807
|
-
var
|
|
4808
|
-
var
|
|
4535
|
+
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
4536
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4809
4537
|
var ModalButtons = ({
|
|
4810
4538
|
onClose,
|
|
4811
4539
|
onContinue,
|
|
@@ -4813,36 +4541,36 @@ var ModalButtons = ({
|
|
|
4813
4541
|
id,
|
|
4814
4542
|
testid
|
|
4815
4543
|
}) => {
|
|
4816
|
-
return /* @__PURE__ */ (0,
|
|
4544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4817
4545
|
"div",
|
|
4818
4546
|
{
|
|
4819
4547
|
id,
|
|
4820
4548
|
"data-testid": testid,
|
|
4821
|
-
className: (0,
|
|
4549
|
+
className: (0, import_clsx30.default)(
|
|
4822
4550
|
"border-t border-neutral-300 flex justify-end",
|
|
4823
4551
|
layoutPaddding,
|
|
4824
4552
|
layoutGroupGap
|
|
4825
4553
|
),
|
|
4826
|
-
children: customActions != null ? customActions : /* @__PURE__ */ (0,
|
|
4827
|
-
/* @__PURE__ */ (0,
|
|
4554
|
+
children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
4555
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4828
4556
|
Button,
|
|
4829
4557
|
{
|
|
4830
4558
|
id: id ? `${id}-close-button` : void 0,
|
|
4831
4559
|
testid: testid ? `${testid}-close-button` : void 0,
|
|
4832
4560
|
variant: "secondary",
|
|
4833
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
4561
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { name: "close", size: 24 }),
|
|
4834
4562
|
onClick: onClose,
|
|
4835
4563
|
className: "max-sm:w-full",
|
|
4836
4564
|
children: "Close"
|
|
4837
4565
|
}
|
|
4838
4566
|
),
|
|
4839
|
-
/* @__PURE__ */ (0,
|
|
4567
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4840
4568
|
Button,
|
|
4841
4569
|
{
|
|
4842
4570
|
id: id ? `${id}-continue-button` : void 0,
|
|
4843
4571
|
testid: testid ? `${testid}-continue-button` : void 0,
|
|
4844
4572
|
variant: "primary",
|
|
4845
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
4573
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { name: "check", size: 24 }),
|
|
4846
4574
|
className: "max-sm:w-full",
|
|
4847
4575
|
onClick: onContinue,
|
|
4848
4576
|
children: "Continue"
|
|
@@ -4855,8 +4583,8 @@ var ModalButtons = ({
|
|
|
4855
4583
|
ModalButtons.displayName = "ModalButtons";
|
|
4856
4584
|
|
|
4857
4585
|
// src/components/ModalScrim.tsx
|
|
4858
|
-
var
|
|
4859
|
-
var
|
|
4586
|
+
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
4587
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4860
4588
|
var ModalScrim = ({
|
|
4861
4589
|
show = false,
|
|
4862
4590
|
size = "small",
|
|
@@ -4866,12 +4594,12 @@ var ModalScrim = ({
|
|
|
4866
4594
|
id,
|
|
4867
4595
|
testid
|
|
4868
4596
|
}) => {
|
|
4869
|
-
return /* @__PURE__ */ (0,
|
|
4597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4870
4598
|
"div",
|
|
4871
4599
|
{
|
|
4872
4600
|
id,
|
|
4873
4601
|
"data-testid": testid,
|
|
4874
|
-
className: (0,
|
|
4602
|
+
className: (0, import_clsx31.default)(
|
|
4875
4603
|
"overflow-y-auto h-screen transition-[visibility,opacity,background] ease-in-out duration-100 grid place-content-center group bg-neutral-600/50 fixed opacity-0",
|
|
4876
4604
|
!show && " pointer-events-none",
|
|
4877
4605
|
size === "small" && "p-4",
|
|
@@ -4891,10 +4619,10 @@ var import_react_dom3 = require("react-dom");
|
|
|
4891
4619
|
var import_react_use = require("react-use");
|
|
4892
4620
|
|
|
4893
4621
|
// src/components/useMounted.tsx
|
|
4894
|
-
var
|
|
4622
|
+
var import_react26 = require("react");
|
|
4895
4623
|
var useMounted = () => {
|
|
4896
|
-
const [isMounted, setIsMounted] = (0,
|
|
4897
|
-
(0,
|
|
4624
|
+
const [isMounted, setIsMounted] = (0, import_react26.useState)(false);
|
|
4625
|
+
(0, import_react26.useEffect)(() => {
|
|
4898
4626
|
setIsMounted(true);
|
|
4899
4627
|
return () => setIsMounted(false);
|
|
4900
4628
|
}, []);
|
|
@@ -4902,7 +4630,7 @@ var useMounted = () => {
|
|
|
4902
4630
|
};
|
|
4903
4631
|
|
|
4904
4632
|
// src/components/Modal.tsx
|
|
4905
|
-
var
|
|
4633
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4906
4634
|
var fadeInScale = (element, duration = 300) => element.animate(
|
|
4907
4635
|
[
|
|
4908
4636
|
{ opacity: 0, transform: "scale(0.95)" },
|
|
@@ -4986,12 +4714,12 @@ var Modal = ({
|
|
|
4986
4714
|
}) => {
|
|
4987
4715
|
var _a;
|
|
4988
4716
|
const mounted = useMounted();
|
|
4989
|
-
const modalRef = (0,
|
|
4990
|
-
const bgRef = (0,
|
|
4717
|
+
const modalRef = (0, import_react27.useRef)(null);
|
|
4718
|
+
const bgRef = (0, import_react27.useRef)(null);
|
|
4991
4719
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
4992
4720
|
const isMobile = useMatchesMobile();
|
|
4993
4721
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
4994
|
-
(0,
|
|
4722
|
+
(0, import_react27.useEffect)(() => {
|
|
4995
4723
|
if (!mounted) return;
|
|
4996
4724
|
if (!modalRef.current || !bgRef.current) {
|
|
4997
4725
|
console.error("Modal or background reference is not set.");
|
|
@@ -5011,7 +4739,7 @@ var Modal = ({
|
|
|
5011
4739
|
bgFadeIn(bgRef.current);
|
|
5012
4740
|
}
|
|
5013
4741
|
}, [mounted, onClose, open, wasOpen]);
|
|
5014
|
-
const handleKeyDown = (0,
|
|
4742
|
+
const handleKeyDown = (0, import_react27.useCallback)(
|
|
5015
4743
|
(e) => {
|
|
5016
4744
|
if (e.key === "Escape") {
|
|
5017
4745
|
if (onClose) {
|
|
@@ -5022,12 +4750,12 @@ var Modal = ({
|
|
|
5022
4750
|
},
|
|
5023
4751
|
[onClose]
|
|
5024
4752
|
);
|
|
5025
|
-
const handleClose = (0,
|
|
4753
|
+
const handleClose = (0, import_react27.useCallback)(() => {
|
|
5026
4754
|
if (onClose) {
|
|
5027
4755
|
onClose();
|
|
5028
4756
|
}
|
|
5029
4757
|
}, [onClose]);
|
|
5030
|
-
(0,
|
|
4758
|
+
(0, import_react27.useEffect)(() => {
|
|
5031
4759
|
if (open) {
|
|
5032
4760
|
document.addEventListener("keyup", handleKeyDown);
|
|
5033
4761
|
}
|
|
@@ -5035,7 +4763,7 @@ var Modal = ({
|
|
|
5035
4763
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5036
4764
|
};
|
|
5037
4765
|
}, [open, handleKeyDown]);
|
|
5038
|
-
(0,
|
|
4766
|
+
(0, import_react27.useEffect)(() => {
|
|
5039
4767
|
if (!open) return;
|
|
5040
4768
|
const scrollY = window.scrollY;
|
|
5041
4769
|
const body = document.body;
|
|
@@ -5056,7 +4784,7 @@ var Modal = ({
|
|
|
5056
4784
|
};
|
|
5057
4785
|
}, [open]);
|
|
5058
4786
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5059
|
-
const backgroundClickHandler = (0,
|
|
4787
|
+
const backgroundClickHandler = (0, import_react27.useCallback)(
|
|
5060
4788
|
(e) => {
|
|
5061
4789
|
const target = e.target;
|
|
5062
4790
|
const currentTarget = e.currentTarget;
|
|
@@ -5074,7 +4802,7 @@ var Modal = ({
|
|
|
5074
4802
|
return null;
|
|
5075
4803
|
}
|
|
5076
4804
|
return (0, import_react_dom3.createPortal)(
|
|
5077
|
-
/* @__PURE__ */ (0,
|
|
4805
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5078
4806
|
ModalScrim,
|
|
5079
4807
|
{
|
|
5080
4808
|
id: id ? `${id}-scrim` : void 0,
|
|
@@ -5083,13 +4811,13 @@ var Modal = ({
|
|
|
5083
4811
|
ref: bgRef,
|
|
5084
4812
|
show: open,
|
|
5085
4813
|
onClick: backgroundClickHandler,
|
|
5086
|
-
children: /* @__PURE__ */ (0,
|
|
4814
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5087
4815
|
"div",
|
|
5088
4816
|
{
|
|
5089
4817
|
id,
|
|
5090
4818
|
"data-testid": testid,
|
|
5091
4819
|
ref: modalRef,
|
|
5092
|
-
className: (0,
|
|
4820
|
+
className: (0, import_clsx32.default)(
|
|
5093
4821
|
"shadow-md rounded-sm flex flex-col overflow-hidden w-full opacity-0 h-fit",
|
|
5094
4822
|
computedFixedHeightScrolling && size !== "screen" && "desktop:max-h-[calc(100vh-32px)] desktop:h-auto",
|
|
5095
4823
|
className,
|
|
@@ -5098,7 +4826,7 @@ var Modal = ({
|
|
|
5098
4826
|
),
|
|
5099
4827
|
onClick: (e) => e.stopPropagation(),
|
|
5100
4828
|
children: [
|
|
5101
|
-
/* @__PURE__ */ (0,
|
|
4829
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5102
4830
|
ModalHeader,
|
|
5103
4831
|
{
|
|
5104
4832
|
id: id ? `${id}-header` : void 0,
|
|
@@ -5111,7 +4839,7 @@ var Modal = ({
|
|
|
5111
4839
|
headerClassname
|
|
5112
4840
|
}
|
|
5113
4841
|
),
|
|
5114
|
-
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0,
|
|
4842
|
+
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5115
4843
|
ModalContent,
|
|
5116
4844
|
{
|
|
5117
4845
|
id: id ? `${id}-content` : void 0,
|
|
@@ -5120,7 +4848,7 @@ var Modal = ({
|
|
|
5120
4848
|
children
|
|
5121
4849
|
}
|
|
5122
4850
|
) : children,
|
|
5123
|
-
showButtons ? customFooter ? customActions : /* @__PURE__ */ (0,
|
|
4851
|
+
showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5124
4852
|
ModalButtons,
|
|
5125
4853
|
{
|
|
5126
4854
|
id: id ? `${id}-buttons` : void 0,
|
|
@@ -5140,81 +4868,568 @@ var Modal = ({
|
|
|
5140
4868
|
};
|
|
5141
4869
|
Modal.displayName = "Modal";
|
|
5142
4870
|
|
|
5143
|
-
// src/components/
|
|
4871
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
4872
|
+
var import_react_pdf2 = require("@mikecousins/react-pdf");
|
|
4873
|
+
var import_react29 = require("react");
|
|
4874
|
+
|
|
4875
|
+
// src/components/PDFViewer/PDFPage.tsx
|
|
4876
|
+
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
4877
|
+
var import_react28 = require("react");
|
|
4878
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4879
|
+
|
|
4880
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
4881
|
+
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
4882
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4883
|
+
|
|
4884
|
+
// src/components/PDFViewer/DownloadIcon.tsx
|
|
5144
4885
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5145
|
-
function MobileDataGridColumn(props) {
|
|
5146
|
-
var _a;
|
|
5147
|
-
const { column, data } = props;
|
|
5148
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "mb-2 grid grid-cols-2 gap-2 px-3 flex-1", children: [
|
|
5149
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
5150
|
-
(_a = column.header) == null ? void 0 : _a.toString(),
|
|
5151
|
-
":"
|
|
5152
|
-
] }),
|
|
5153
|
-
" ",
|
|
5154
|
-
column.id && data[column.id] ? data[column.id] : null
|
|
5155
|
-
] });
|
|
5156
|
-
}
|
|
5157
4886
|
|
|
5158
|
-
// src/components/
|
|
4887
|
+
// src/components/PDFViewer/PDFNavigation.tsx
|
|
5159
4888
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5160
|
-
function ModalContent2() {
|
|
5161
|
-
const context = useGridContext();
|
|
5162
|
-
const { columns, currentRow } = context;
|
|
5163
|
-
if (!currentRow) return null;
|
|
5164
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Stack, { sizing: "layout-group", children: columns.filter((x) => {
|
|
5165
|
-
var _a;
|
|
5166
|
-
return !((_a = x.id) == null ? void 0 : _a.startsWith("__"));
|
|
5167
|
-
}).map(
|
|
5168
|
-
(column, index) => {
|
|
5169
|
-
var _a, _b;
|
|
5170
|
-
return ((_a = column.meta) == null ? void 0 : _a.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
5171
|
-
"div",
|
|
5172
|
-
{
|
|
5173
|
-
className: "mb-2 grid grid-cols-2 gap-2 px-3 items-center flex-1",
|
|
5174
|
-
children: [
|
|
5175
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
5176
|
-
(_b = column.header) == null ? void 0 : _b.toString(),
|
|
5177
|
-
":"
|
|
5178
|
-
] }),
|
|
5179
|
-
" ",
|
|
5180
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5181
|
-
column.meta.mobileCell,
|
|
5182
|
-
{
|
|
5183
|
-
column,
|
|
5184
|
-
row: currentRow,
|
|
5185
|
-
cellValue: currentRow == null ? void 0 : currentRow[column.id]
|
|
5186
|
-
}
|
|
5187
|
-
)
|
|
5188
|
-
]
|
|
5189
|
-
},
|
|
5190
|
-
`${column.id}-${index}`
|
|
5191
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5192
|
-
MobileDataGridColumn,
|
|
5193
|
-
{
|
|
5194
|
-
column,
|
|
5195
|
-
data: currentRow
|
|
5196
|
-
},
|
|
5197
|
-
`${column.id}-${index}`
|
|
5198
|
-
);
|
|
5199
|
-
}
|
|
5200
|
-
) });
|
|
5201
|
-
}
|
|
5202
4889
|
|
|
5203
|
-
// src/components/
|
|
4890
|
+
// src/components/PDFViewer/index.tsx
|
|
5204
4891
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
4892
|
+
|
|
4893
|
+
// src/components/ListGroup.tsx
|
|
4894
|
+
var import_react31 = require("react");
|
|
4895
|
+
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
4896
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4897
|
+
|
|
4898
|
+
// src/components/Pagination.tsx
|
|
4899
|
+
var import_react32 = require("react");
|
|
4900
|
+
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
4901
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4902
|
+
var Pagination = ({
|
|
4903
|
+
totalPages,
|
|
4904
|
+
currentPage,
|
|
4905
|
+
onPageChange,
|
|
4906
|
+
id,
|
|
4907
|
+
testid,
|
|
4908
|
+
className,
|
|
4909
|
+
disabled
|
|
4910
|
+
}) => {
|
|
4911
|
+
const goTo = (0, import_react32.useCallback)(
|
|
4912
|
+
(page) => {
|
|
4913
|
+
if (disabled) return;
|
|
4914
|
+
onPageChange(page);
|
|
4915
|
+
},
|
|
4916
|
+
[onPageChange, disabled]
|
|
4917
|
+
);
|
|
4918
|
+
const handleKey = (e) => {
|
|
4919
|
+
if (disabled) return;
|
|
4920
|
+
if (e.key === "ArrowLeft") {
|
|
4921
|
+
e.preventDefault();
|
|
4922
|
+
goTo(currentPage - 1);
|
|
4923
|
+
} else if (e.key === "ArrowRight") {
|
|
4924
|
+
e.preventDefault();
|
|
4925
|
+
goTo(currentPage + 1);
|
|
4926
|
+
}
|
|
4927
|
+
};
|
|
4928
|
+
const pageTokens = (0, import_react32.useMemo)(() => {
|
|
4929
|
+
if (totalPages <= 5) {
|
|
4930
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
4931
|
+
}
|
|
4932
|
+
const pages = /* @__PURE__ */ new Set();
|
|
4933
|
+
pages.add(1);
|
|
4934
|
+
pages.add(totalPages);
|
|
4935
|
+
if (currentPage <= 3) {
|
|
4936
|
+
pages.add(2);
|
|
4937
|
+
pages.add(3);
|
|
4938
|
+
pages.add(4);
|
|
4939
|
+
} else if (currentPage >= totalPages - 2) {
|
|
4940
|
+
pages.add(totalPages - 1);
|
|
4941
|
+
pages.add(totalPages - 2);
|
|
4942
|
+
pages.add(totalPages - 3);
|
|
4943
|
+
} else {
|
|
4944
|
+
pages.add(currentPage - 1);
|
|
4945
|
+
pages.add(currentPage);
|
|
4946
|
+
pages.add(currentPage + 1);
|
|
4947
|
+
}
|
|
4948
|
+
const sorted = Array.from(pages).sort((a, b) => a - b);
|
|
4949
|
+
const tokens = [];
|
|
4950
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
4951
|
+
const value = sorted[i];
|
|
4952
|
+
const prev = sorted[i - 1];
|
|
4953
|
+
if (i > 0) {
|
|
4954
|
+
if (value - prev === 2) {
|
|
4955
|
+
tokens.push(prev + 1);
|
|
4956
|
+
} else if (value - prev > 2) {
|
|
4957
|
+
tokens.push("ellipsis");
|
|
4958
|
+
}
|
|
4959
|
+
}
|
|
4960
|
+
tokens.push(value);
|
|
4961
|
+
}
|
|
4962
|
+
return tokens;
|
|
4963
|
+
}, [totalPages, currentPage]);
|
|
4964
|
+
if (totalPages <= 1) return null;
|
|
4965
|
+
const buttonClass = (0, import_clsx35.default)(
|
|
4966
|
+
"cursor-pointer disabled:cursor-default",
|
|
4967
|
+
paddingUsingComponentGap,
|
|
4968
|
+
"w-8 h-8",
|
|
4969
|
+
"flex items-center justify-center",
|
|
4970
|
+
"bg-transparent",
|
|
4971
|
+
"box-content",
|
|
4972
|
+
"hover:bg-background-grouped-secondary-normal",
|
|
4973
|
+
"focus:bg-background-grouped-secondary-normal focus:outline-0",
|
|
4974
|
+
"disabled:bg-transparent disabled:text-text-action-primary-disabled"
|
|
4975
|
+
);
|
|
4976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4977
|
+
"nav",
|
|
4978
|
+
{
|
|
4979
|
+
id,
|
|
4980
|
+
"data-testid": testid,
|
|
4981
|
+
"aria-label": "Pagination",
|
|
4982
|
+
onKeyDown: handleKey,
|
|
4983
|
+
className: (0, import_clsx35.default)(
|
|
4984
|
+
"flex items-center",
|
|
4985
|
+
"border border-border-primary-normal",
|
|
4986
|
+
"bg-background-grouped-primary-normal",
|
|
4987
|
+
"rounded-sm",
|
|
4988
|
+
className
|
|
4989
|
+
),
|
|
4990
|
+
children: [
|
|
4991
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4992
|
+
"button",
|
|
4993
|
+
{
|
|
4994
|
+
disabled: disabled || currentPage <= 1,
|
|
4995
|
+
"aria-label": "Previous page",
|
|
4996
|
+
onClick: () => goTo(currentPage - 1),
|
|
4997
|
+
className: (0, import_clsx35.default)(buttonClass, "border-r-1 border-border-primary-normal"),
|
|
4998
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, { name: "keyboard_arrow_left" })
|
|
4999
|
+
}
|
|
5000
|
+
),
|
|
5001
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("ul", { className: (0, import_clsx35.default)("flex items-center"), children: pageTokens.map((token, index) => {
|
|
5002
|
+
if (token === "ellipsis") {
|
|
5003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5004
|
+
"li",
|
|
5005
|
+
{
|
|
5006
|
+
className: "w-8 h-8 select-none text-text-action-primary-disabled",
|
|
5007
|
+
children: "\u2026"
|
|
5008
|
+
},
|
|
5009
|
+
`ellipsis-${index}`
|
|
5010
|
+
);
|
|
5011
|
+
}
|
|
5012
|
+
const selected = token === currentPage;
|
|
5013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5014
|
+
"button",
|
|
5015
|
+
{
|
|
5016
|
+
"aria-label": `Page ${token}`,
|
|
5017
|
+
"aria-current": selected ? "page" : void 0,
|
|
5018
|
+
disabled,
|
|
5019
|
+
onClick: () => goTo(token),
|
|
5020
|
+
className: (0, import_clsx35.default)(
|
|
5021
|
+
buttonClass,
|
|
5022
|
+
selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
|
|
5023
|
+
),
|
|
5024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Subheader, { align: "center", weight: "bold", children: token })
|
|
5025
|
+
}
|
|
5026
|
+
) }, token);
|
|
5027
|
+
}) }),
|
|
5028
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5029
|
+
"button",
|
|
5030
|
+
{
|
|
5031
|
+
disabled: disabled || currentPage >= totalPages,
|
|
5032
|
+
"aria-label": "Next page",
|
|
5033
|
+
onClick: () => goTo(currentPage + 1),
|
|
5034
|
+
className: (0, import_clsx35.default)(buttonClass, "border-l-1 border-border-primary-normal"),
|
|
5035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, { name: "keyboard_arrow_right" })
|
|
5036
|
+
}
|
|
5037
|
+
)
|
|
5038
|
+
]
|
|
5039
|
+
}
|
|
5040
|
+
);
|
|
5041
|
+
};
|
|
5042
|
+
Pagination.displayName = "Pagination";
|
|
5043
|
+
|
|
5044
|
+
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5045
|
+
var import_react34 = require("react");
|
|
5046
|
+
|
|
5047
|
+
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5048
|
+
var import_react33 = require("react");
|
|
5049
|
+
var GridContext = (0, import_react33.createContext)(null);
|
|
5050
|
+
|
|
5051
|
+
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5052
|
+
function useGridContext() {
|
|
5053
|
+
const ctx = (0, import_react34.useContext)(GridContext);
|
|
5054
|
+
if (!ctx) {
|
|
5055
|
+
throw new Error("useGridContext must be used within GridContextProvider");
|
|
5056
|
+
}
|
|
5057
|
+
return ctx;
|
|
5058
|
+
}
|
|
5059
|
+
|
|
5060
|
+
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5061
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5062
|
+
function ColumnSelector() {
|
|
5063
|
+
const context = useGridContext();
|
|
5064
|
+
const ref = (0, import_react35.useRef)(null);
|
|
5065
|
+
const [show, setShow] = (0, import_react35.useState)(false);
|
|
5066
|
+
const {
|
|
5067
|
+
columns,
|
|
5068
|
+
id,
|
|
5069
|
+
testid,
|
|
5070
|
+
visibleColumns,
|
|
5071
|
+
numberOfColumnsToShow,
|
|
5072
|
+
primaryKey,
|
|
5073
|
+
resetColumnVisibility,
|
|
5074
|
+
dispatch
|
|
5075
|
+
} = context;
|
|
5076
|
+
const toggleColumnVisibility = (0, import_react35.useCallback)(
|
|
5077
|
+
(index, visible) => {
|
|
5078
|
+
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
5079
|
+
},
|
|
5080
|
+
[dispatch]
|
|
5081
|
+
);
|
|
5082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5083
|
+
"div",
|
|
5084
|
+
{
|
|
5085
|
+
id: id ? `${id}-column-selector` : void 0,
|
|
5086
|
+
"data-testid": testid,
|
|
5087
|
+
className: "text-text-secondary-normal border-l border-brand-200 p-mobile-container-padding",
|
|
5088
|
+
ref,
|
|
5089
|
+
children: [
|
|
5090
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5091
|
+
Button,
|
|
5092
|
+
{
|
|
5093
|
+
id: id ? `${id}-button` : void 0,
|
|
5094
|
+
testid: testid ? `${testid}-button` : void 0,
|
|
5095
|
+
onClick: () => setShow((prev) => !prev),
|
|
5096
|
+
variant: "navigation",
|
|
5097
|
+
iconOnly: true,
|
|
5098
|
+
size: 24,
|
|
5099
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Icon, { name: "tune" })
|
|
5100
|
+
}
|
|
5101
|
+
),
|
|
5102
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5103
|
+
Menu,
|
|
5104
|
+
{
|
|
5105
|
+
id: id ? `${id}-menu` : void 0,
|
|
5106
|
+
testid: testid ? `${testid}-menu` : void 0,
|
|
5107
|
+
positionTo: ref,
|
|
5108
|
+
position: "bottom-right",
|
|
5109
|
+
show,
|
|
5110
|
+
setShow,
|
|
5111
|
+
calculateMinMaxHeight: true,
|
|
5112
|
+
children: [
|
|
5113
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5114
|
+
Button,
|
|
5115
|
+
{
|
|
5116
|
+
id: id ? `${id}-reset-button` : void 0,
|
|
5117
|
+
testid: testid ? `${testid}-reset-button` : void 0,
|
|
5118
|
+
variant: "tertiary",
|
|
5119
|
+
onClick: () => {
|
|
5120
|
+
resetColumnVisibility();
|
|
5121
|
+
setShow(false);
|
|
5122
|
+
},
|
|
5123
|
+
children: "Reset to default"
|
|
5124
|
+
}
|
|
5125
|
+
),
|
|
5126
|
+
columns.filter((x) => {
|
|
5127
|
+
var _a;
|
|
5128
|
+
return (_a = x.meta) == null ? void 0 : _a.inVisibilityMenu;
|
|
5129
|
+
}).map((column) => {
|
|
5130
|
+
var _a, _b, _c;
|
|
5131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5132
|
+
MenuOption,
|
|
5133
|
+
{
|
|
5134
|
+
testid: testid ? `${testid}-option-${column.id}` : void 0,
|
|
5135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5136
|
+
Checkbox,
|
|
5137
|
+
{
|
|
5138
|
+
id: id ? `${id}-checkbox-${column.id}` : void 0,
|
|
5139
|
+
testid: testid ? `${testid}-checkbox-${column.id}` : void 0,
|
|
5140
|
+
label: (_a = column.header) == null ? void 0 : _a.toString(),
|
|
5141
|
+
checked: !!((_b = column.meta) == null ? void 0 : _b.visible) || column.id === String(primaryKey),
|
|
5142
|
+
disabled: typeof numberOfColumnsToShow !== "undefined" && // account for header+link occupying one slot
|
|
5143
|
+
visibleColumns.length >= numberOfColumnsToShow - 1 && ((_c = column.meta) == null ? void 0 : _c.visible) !== true || column.id === String(primaryKey),
|
|
5144
|
+
onChange: (e) => {
|
|
5145
|
+
toggleColumnVisibility(
|
|
5146
|
+
columns.findIndex(({ id: id2 }) => id2 === column.id),
|
|
5147
|
+
e.target.checked
|
|
5148
|
+
);
|
|
5149
|
+
}
|
|
5150
|
+
}
|
|
5151
|
+
)
|
|
5152
|
+
},
|
|
5153
|
+
id ? `${id}-option-${column.id}` : void 0
|
|
5154
|
+
);
|
|
5155
|
+
})
|
|
5156
|
+
]
|
|
5157
|
+
}
|
|
5158
|
+
)
|
|
5159
|
+
]
|
|
5160
|
+
}
|
|
5161
|
+
);
|
|
5162
|
+
}
|
|
5163
|
+
|
|
5164
|
+
// src/components/MobileDataGrid/MobileDataGridHeader.tsx
|
|
5165
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5166
|
+
function MobileDataGridHeader({
|
|
5167
|
+
header: Header,
|
|
5168
|
+
enableColumnSelector,
|
|
5169
|
+
enableRowSelection
|
|
5170
|
+
}) {
|
|
5171
|
+
var _a, _b;
|
|
5172
|
+
const ctx = useGridContext();
|
|
5173
|
+
const {
|
|
5174
|
+
id,
|
|
5175
|
+
testid,
|
|
5176
|
+
selectedRowIds,
|
|
5177
|
+
data,
|
|
5178
|
+
primaryKey,
|
|
5179
|
+
columns,
|
|
5180
|
+
handleRowSelectAll
|
|
5181
|
+
} = ctx;
|
|
5182
|
+
if (typeof Header === "undefined" && !primaryKey) return null;
|
|
5183
|
+
if (typeof Header === "function") return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Header, __spreadValues({}, ctx));
|
|
5184
|
+
if (typeof Header === "string" || primaryKey)
|
|
5185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5186
|
+
"div",
|
|
5187
|
+
{
|
|
5188
|
+
id: id ? `${id}-header` : void 0,
|
|
5189
|
+
"data-testid": testid ? `${testid}-header` : void 0,
|
|
5190
|
+
className: "sticky top-0",
|
|
5191
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Theme, { theme: "brand", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
5192
|
+
Stack,
|
|
5193
|
+
{
|
|
5194
|
+
horizontal: true,
|
|
5195
|
+
horizontalMobile: true,
|
|
5196
|
+
items: "center",
|
|
5197
|
+
justify: "between",
|
|
5198
|
+
backgroundColor: "background-primary-normal",
|
|
5199
|
+
children: [
|
|
5200
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit h-full", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5201
|
+
Checkbox,
|
|
5202
|
+
{
|
|
5203
|
+
id: id ? `${id}-select-all-checkbox` : void 0,
|
|
5204
|
+
testid: testid ? `${testid}-select-all-checkbox` : void 0,
|
|
5205
|
+
checked: selectedRowIds.length === data.length,
|
|
5206
|
+
indeterminate: !!selectedRowIds.length && selectedRowIds.length !== data.length,
|
|
5207
|
+
onChange: handleRowSelectAll
|
|
5208
|
+
}
|
|
5209
|
+
) }),
|
|
5210
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5211
|
+
Stack,
|
|
5212
|
+
{
|
|
5213
|
+
horizontal: true,
|
|
5214
|
+
horizontalMobile: true,
|
|
5215
|
+
items: "center",
|
|
5216
|
+
sizing: "component",
|
|
5217
|
+
padding: true,
|
|
5218
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Heading3, { as: "span", color: "text-primary-normal", children: typeof Header === "string" ? Header : (_b = (_a = columns.find((col) => col.id === primaryKey)) == null ? void 0 : _a.header) == null ? void 0 : _b.toString() })
|
|
5219
|
+
}
|
|
5220
|
+
),
|
|
5221
|
+
enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ColumnSelector, {})
|
|
5222
|
+
]
|
|
5223
|
+
}
|
|
5224
|
+
) })
|
|
5225
|
+
}
|
|
5226
|
+
);
|
|
5227
|
+
}
|
|
5228
|
+
|
|
5229
|
+
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5230
|
+
var import_react36 = require("react");
|
|
5231
|
+
|
|
5232
|
+
// src/components/MobileDataGrid/dataGridReducer.ts
|
|
5233
|
+
function dataGridReducer(state, action) {
|
|
5234
|
+
var _a, _b, _c;
|
|
5235
|
+
const { type, payload } = action;
|
|
5236
|
+
let itemIndex = null;
|
|
5237
|
+
if (action.type === "INSERT" && action.pos === "INDEX")
|
|
5238
|
+
itemIndex = action.index;
|
|
5239
|
+
if (action.type === "UPDATE")
|
|
5240
|
+
itemIndex = (_a = action.index) != null ? _a : state.filter(({ id }) => !!id).findIndex(({ id }) => id === action.id);
|
|
5241
|
+
switch (type) {
|
|
5242
|
+
case "SET":
|
|
5243
|
+
return [...payload];
|
|
5244
|
+
case "UPDATE":
|
|
5245
|
+
if (typeof itemIndex !== "number" || itemIndex < 0)
|
|
5246
|
+
throw new Error("action.(id | index) must be provided.");
|
|
5247
|
+
return [
|
|
5248
|
+
...state.slice(0, itemIndex),
|
|
5249
|
+
__spreadProps(__spreadValues(__spreadValues({}, state[itemIndex]), payload), {
|
|
5250
|
+
meta: __spreadValues(__spreadValues({}, (_b = state[itemIndex].meta) != null ? _b : {}), (_c = payload.meta) != null ? _c : {})
|
|
5251
|
+
}),
|
|
5252
|
+
...state.slice(itemIndex + 1)
|
|
5253
|
+
];
|
|
5254
|
+
default:
|
|
5255
|
+
throw new Error("Action type not implemented.");
|
|
5256
|
+
}
|
|
5257
|
+
}
|
|
5258
|
+
|
|
5259
|
+
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5260
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5261
|
+
function GridContextProvider(props) {
|
|
5262
|
+
const {
|
|
5263
|
+
initialColumns,
|
|
5264
|
+
id,
|
|
5265
|
+
testid,
|
|
5266
|
+
children,
|
|
5267
|
+
data,
|
|
5268
|
+
numberOfColumnsToShow,
|
|
5269
|
+
primaryKey,
|
|
5270
|
+
getId,
|
|
5271
|
+
onRowSelect
|
|
5272
|
+
} = props;
|
|
5273
|
+
const [columns, dispatch] = (0, import_react36.useReducer)(dataGridReducer, initialColumns);
|
|
5274
|
+
const [selectedRowIds, setSelectedRowIds] = (0, import_react36.useState)([]);
|
|
5275
|
+
const [currentRow, setCurrentRow] = (0, import_react36.useState)(null);
|
|
5276
|
+
const resetColumnVisibility = (0, import_react36.useCallback)(() => {
|
|
5277
|
+
const newColumns = columns.map((column) => {
|
|
5278
|
+
var _a;
|
|
5279
|
+
const initialColumn = initialColumns.find((c) => c.id === column.id);
|
|
5280
|
+
return __spreadProps(__spreadValues({}, column), {
|
|
5281
|
+
meta: __spreadProps(__spreadValues({}, column.meta), {
|
|
5282
|
+
visible: (_a = initialColumn == null ? void 0 : initialColumn.meta) == null ? void 0 : _a.visible
|
|
5283
|
+
})
|
|
5284
|
+
});
|
|
5285
|
+
});
|
|
5286
|
+
dispatch({ type: "SET", payload: newColumns });
|
|
5287
|
+
}, [columns, initialColumns]);
|
|
5288
|
+
const handleRowSelect = (0, import_react36.useCallback)(
|
|
5289
|
+
(item) => {
|
|
5290
|
+
var _a;
|
|
5291
|
+
const rowId = (_a = getId(item)) != null ? _a : "";
|
|
5292
|
+
if (!rowId) return;
|
|
5293
|
+
const nextSelected = selectedRowIds.includes(rowId) ? selectedRowIds.filter((id2) => id2 !== rowId) : [...selectedRowIds, rowId];
|
|
5294
|
+
setSelectedRowIds(nextSelected);
|
|
5295
|
+
if (onRowSelect) onRowSelect(item, nextSelected);
|
|
5296
|
+
},
|
|
5297
|
+
[getId, onRowSelect, selectedRowIds]
|
|
5298
|
+
);
|
|
5299
|
+
const handleRowSelectAll = (0, import_react36.useCallback)(() => {
|
|
5300
|
+
setSelectedRowIds((prev) => {
|
|
5301
|
+
if (prev.length === data.length) {
|
|
5302
|
+
return [];
|
|
5303
|
+
}
|
|
5304
|
+
return data.map(getId).filter((id2) => id2 !== void 0);
|
|
5305
|
+
});
|
|
5306
|
+
}, [data, getId]);
|
|
5307
|
+
const openRowDetail = (0, import_react36.useCallback)((row) => {
|
|
5308
|
+
setCurrentRow(row);
|
|
5309
|
+
}, []);
|
|
5310
|
+
const closeRowDetail = (0, import_react36.useCallback)(() => {
|
|
5311
|
+
setCurrentRow(null);
|
|
5312
|
+
}, []);
|
|
5313
|
+
const visibleColumns = (0, import_react36.useMemo)(() => {
|
|
5314
|
+
const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
|
|
5315
|
+
if (primaryKey) {
|
|
5316
|
+
const pkColumn = columns.find((col) => col.id === String(primaryKey));
|
|
5317
|
+
const otherColumns = columns.filter(
|
|
5318
|
+
(col) => col.id !== String(primaryKey)
|
|
5319
|
+
);
|
|
5320
|
+
const orderedColumns = pkColumn ? [pkColumn, ...otherColumns] : [...otherColumns];
|
|
5321
|
+
return orderedColumns.filter((x) => {
|
|
5322
|
+
var _a;
|
|
5323
|
+
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
5324
|
+
}).slice(0, effectiveLimit);
|
|
5325
|
+
}
|
|
5326
|
+
return columns.filter((x) => {
|
|
5327
|
+
var _a;
|
|
5328
|
+
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
5329
|
+
}).slice(0, effectiveLimit);
|
|
5330
|
+
}, [columns, numberOfColumnsToShow, primaryKey]);
|
|
5331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5332
|
+
GridContext.Provider,
|
|
5333
|
+
{
|
|
5334
|
+
value: {
|
|
5335
|
+
columns,
|
|
5336
|
+
testid,
|
|
5337
|
+
id,
|
|
5338
|
+
data,
|
|
5339
|
+
selectedRowIds,
|
|
5340
|
+
visibleColumns,
|
|
5341
|
+
numberOfColumnsToShow,
|
|
5342
|
+
primaryKey,
|
|
5343
|
+
dispatch,
|
|
5344
|
+
getId,
|
|
5345
|
+
resetColumnVisibility,
|
|
5346
|
+
handleRowSelect,
|
|
5347
|
+
handleRowSelectAll,
|
|
5348
|
+
isRowDetailOpen: !!currentRow,
|
|
5349
|
+
currentRow,
|
|
5350
|
+
openRowDetail,
|
|
5351
|
+
closeRowDetail
|
|
5352
|
+
},
|
|
5353
|
+
children
|
|
5354
|
+
}
|
|
5355
|
+
);
|
|
5356
|
+
}
|
|
5357
|
+
|
|
5358
|
+
// src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx
|
|
5359
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5360
|
+
function MobileDataGridColumn(props) {
|
|
5361
|
+
var _a;
|
|
5362
|
+
const { column, data } = props;
|
|
5363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "mb-2 grid grid-cols-2 gap-2 px-3 flex-1", children: [
|
|
5364
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
5365
|
+
(_a = column.header) == null ? void 0 : _a.toString(),
|
|
5366
|
+
":"
|
|
5367
|
+
] }),
|
|
5368
|
+
" ",
|
|
5369
|
+
column.id && data[column.id] ? data[column.id] : null
|
|
5370
|
+
] });
|
|
5371
|
+
}
|
|
5372
|
+
|
|
5373
|
+
// src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx
|
|
5374
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5375
|
+
function ModalContent2() {
|
|
5376
|
+
const context = useGridContext();
|
|
5377
|
+
const { columns, currentRow } = context;
|
|
5378
|
+
if (!currentRow) return null;
|
|
5379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Stack, { sizing: "layout-group", children: columns.filter((x) => {
|
|
5380
|
+
var _a;
|
|
5381
|
+
return !((_a = x.id) == null ? void 0 : _a.startsWith("__"));
|
|
5382
|
+
}).map(
|
|
5383
|
+
(column, index) => {
|
|
5384
|
+
var _a, _b;
|
|
5385
|
+
return ((_a = column.meta) == null ? void 0 : _a.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
5386
|
+
"div",
|
|
5387
|
+
{
|
|
5388
|
+
className: "mb-2 grid grid-cols-2 gap-2 px-3 items-center flex-1",
|
|
5389
|
+
children: [
|
|
5390
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
5391
|
+
(_b = column.header) == null ? void 0 : _b.toString(),
|
|
5392
|
+
":"
|
|
5393
|
+
] }),
|
|
5394
|
+
" ",
|
|
5395
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5396
|
+
column.meta.mobileCell,
|
|
5397
|
+
{
|
|
5398
|
+
column,
|
|
5399
|
+
row: currentRow,
|
|
5400
|
+
cellValue: currentRow == null ? void 0 : currentRow[column.id]
|
|
5401
|
+
}
|
|
5402
|
+
)
|
|
5403
|
+
]
|
|
5404
|
+
},
|
|
5405
|
+
`${column.id}-${index}`
|
|
5406
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5407
|
+
MobileDataGridColumn,
|
|
5408
|
+
{
|
|
5409
|
+
column,
|
|
5410
|
+
data: currentRow
|
|
5411
|
+
},
|
|
5412
|
+
`${column.id}-${index}`
|
|
5413
|
+
);
|
|
5414
|
+
}
|
|
5415
|
+
) });
|
|
5416
|
+
}
|
|
5417
|
+
|
|
5418
|
+
// src/components/MobileDataGrid/RowDetailModalProvider/index.tsx
|
|
5419
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5420
|
+
function RowDetailModalProvider() {
|
|
5421
|
+
var _a;
|
|
5422
|
+
const context = useGridContext();
|
|
5423
|
+
const {
|
|
5424
|
+
id,
|
|
5425
|
+
testid,
|
|
5426
|
+
isRowDetailOpen,
|
|
5427
|
+
currentRow,
|
|
5428
|
+
primaryKey,
|
|
5429
|
+
closeRowDetail
|
|
5430
|
+
} = context;
|
|
5431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5432
|
+
Modal,
|
|
5218
5433
|
{
|
|
5219
5434
|
fixedHeightScrolling: true,
|
|
5220
5435
|
open: isRowDetailOpen,
|
|
@@ -5222,7 +5437,7 @@ function RowDetailModalProvider() {
|
|
|
5222
5437
|
hideCloseIcon: true,
|
|
5223
5438
|
size: "medium",
|
|
5224
5439
|
className: "!p-0",
|
|
5225
|
-
headerIcon: /* @__PURE__ */ (0,
|
|
5440
|
+
headerIcon: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
5226
5441
|
Stack,
|
|
5227
5442
|
{
|
|
5228
5443
|
horizontal: true,
|
|
@@ -5231,8 +5446,8 @@ function RowDetailModalProvider() {
|
|
|
5231
5446
|
justify: "between",
|
|
5232
5447
|
width: "full",
|
|
5233
5448
|
children: [
|
|
5234
|
-
/* @__PURE__ */ (0,
|
|
5235
|
-
/* @__PURE__ */ (0,
|
|
5449
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Heading2, { children: (_a = currentRow == null ? void 0 : currentRow[primaryKey != null ? primaryKey : "id"]) != null ? _a : "Grid Detail" }),
|
|
5450
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5236
5451
|
Button,
|
|
5237
5452
|
{
|
|
5238
5453
|
id: id ? `${id}-open-in-new-button` : void 0,
|
|
@@ -5240,25 +5455,25 @@ function RowDetailModalProvider() {
|
|
|
5240
5455
|
iconOnly: true,
|
|
5241
5456
|
variant: "tertiary",
|
|
5242
5457
|
onClick: closeRowDetail,
|
|
5243
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
5458
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: "open_in_new", size: 24 }) })
|
|
5244
5459
|
}
|
|
5245
5460
|
)
|
|
5246
5461
|
]
|
|
5247
5462
|
}
|
|
5248
5463
|
),
|
|
5249
|
-
customActions: /* @__PURE__ */ (0,
|
|
5464
|
+
customActions: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { onClick: closeRowDetail, className: "w-full", children: "Close" }),
|
|
5250
5465
|
showButtons: true,
|
|
5251
|
-
children: /* @__PURE__ */ (0,
|
|
5466
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "bg-white max-h-full flex flex-col flex-grow-1", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ModalContent2, {}) })
|
|
5252
5467
|
}
|
|
5253
5468
|
);
|
|
5254
5469
|
}
|
|
5255
5470
|
|
|
5256
5471
|
// src/components/MobileDataGrid/ColumnList.tsx
|
|
5257
|
-
var
|
|
5472
|
+
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5258
5473
|
|
|
5259
5474
|
// src/components/MobileDataGrid/MobileDataGridCard/index.tsx
|
|
5260
|
-
var
|
|
5261
|
-
var
|
|
5475
|
+
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
5476
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5262
5477
|
function MobileDataGridCard({
|
|
5263
5478
|
renderLink,
|
|
5264
5479
|
renderChevron = true,
|
|
@@ -5270,27 +5485,27 @@ function MobileDataGridCard({
|
|
|
5270
5485
|
var _a;
|
|
5271
5486
|
const context = useGridContext();
|
|
5272
5487
|
const { id, testid, visibleColumns, getId, handleRowSelect, openRowDetail } = context;
|
|
5273
|
-
return /* @__PURE__ */ (0,
|
|
5488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
5274
5489
|
"li",
|
|
5275
5490
|
{
|
|
5276
5491
|
id: id ? `${id}-card-${getId(data)}` : void 0,
|
|
5277
5492
|
"data-testid": testid ? `${testid}-card-${getId(data)}` : void 0,
|
|
5278
|
-
className: (0,
|
|
5493
|
+
className: (0, import_clsx36.default)(
|
|
5279
5494
|
"hover:bg-action-100 cursor-pointer list-none",
|
|
5280
5495
|
selected ? "bg-action-100" : "bg-background-grouped-primary-normal"
|
|
5281
5496
|
),
|
|
5282
5497
|
onClick: () => openRowDetail(data),
|
|
5283
5498
|
children: [
|
|
5284
|
-
/* @__PURE__ */ (0,
|
|
5285
|
-
/* @__PURE__ */ (0,
|
|
5286
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
5499
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Stack, { sizing: "component", children: [
|
|
5500
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Stack, { horizontal: true, horizontalMobile: true, items: "center", justify: "between", children: [
|
|
5501
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5287
5502
|
Stack,
|
|
5288
5503
|
{
|
|
5289
5504
|
sizing: "component",
|
|
5290
5505
|
padding: true,
|
|
5291
5506
|
width: "fit",
|
|
5292
5507
|
onClick: (e) => e.stopPropagation(),
|
|
5293
|
-
children: /* @__PURE__ */ (0,
|
|
5508
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5294
5509
|
Checkbox,
|
|
5295
5510
|
{
|
|
5296
5511
|
id: id ? `${id}-${getId(data)}-select-checkbox` : void 0,
|
|
@@ -5301,16 +5516,16 @@ function MobileDataGridCard({
|
|
|
5301
5516
|
)
|
|
5302
5517
|
}
|
|
5303
5518
|
),
|
|
5304
|
-
/* @__PURE__ */ (0,
|
|
5519
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5305
5520
|
Stack,
|
|
5306
5521
|
{
|
|
5307
5522
|
sizing: "component",
|
|
5308
5523
|
padding: true,
|
|
5309
5524
|
onClick: (e) => e.stopPropagation(),
|
|
5310
|
-
children: renderLink ? renderLink(data) : /* @__PURE__ */ (0,
|
|
5525
|
+
children: renderLink ? renderLink(data) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Subheader, { children: String((_a = data[context.primaryKey]) != null ? _a : "") })
|
|
5311
5526
|
}
|
|
5312
5527
|
),
|
|
5313
|
-
/* @__PURE__ */ (0,
|
|
5528
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5314
5529
|
Stack,
|
|
5315
5530
|
{
|
|
5316
5531
|
horizontal: true,
|
|
@@ -5323,18 +5538,18 @@ function MobileDataGridCard({
|
|
|
5323
5538
|
}
|
|
5324
5539
|
)
|
|
5325
5540
|
] }),
|
|
5326
|
-
/* @__PURE__ */ (0,
|
|
5541
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Stack, { sizing: "layout-group", children: visibleColumns.filter((x) => {
|
|
5327
5542
|
var _a2, _b;
|
|
5328
5543
|
return ((_a2 = x.meta) == null ? void 0 : _a2.visible) !== false && !((_b = x.id) == null ? void 0 : _b.startsWith("__"));
|
|
5329
5544
|
}).map(
|
|
5330
5545
|
(column, index) => {
|
|
5331
5546
|
var _a2, _b;
|
|
5332
|
-
return ((_a2 = column.meta) == null ? void 0 : _a2.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0,
|
|
5547
|
+
return ((_a2 = column.meta) == null ? void 0 : _a2.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
5333
5548
|
"div",
|
|
5334
5549
|
{
|
|
5335
5550
|
className: "mb-2 grid grid-cols-2 gap-2 px-3 items-center flex-1",
|
|
5336
5551
|
children: [
|
|
5337
|
-
/* @__PURE__ */ (0,
|
|
5552
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
5338
5553
|
Paragraph,
|
|
5339
5554
|
{
|
|
5340
5555
|
color: "text-secondary-normal",
|
|
@@ -5346,7 +5561,7 @@ function MobileDataGridCard({
|
|
|
5346
5561
|
}
|
|
5347
5562
|
),
|
|
5348
5563
|
" ",
|
|
5349
|
-
/* @__PURE__ */ (0,
|
|
5564
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5350
5565
|
column.meta.mobileCell,
|
|
5351
5566
|
{
|
|
5352
5567
|
column,
|
|
@@ -5357,7 +5572,7 @@ function MobileDataGridCard({
|
|
|
5357
5572
|
]
|
|
5358
5573
|
},
|
|
5359
5574
|
`${column.id}-${index}`
|
|
5360
|
-
) : /* @__PURE__ */ (0,
|
|
5575
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5361
5576
|
MobileDataGridColumn,
|
|
5362
5577
|
{
|
|
5363
5578
|
column,
|
|
@@ -5368,14 +5583,14 @@ function MobileDataGridCard({
|
|
|
5368
5583
|
}
|
|
5369
5584
|
) })
|
|
5370
5585
|
] }),
|
|
5371
|
-
renderChevron && /* @__PURE__ */ (0,
|
|
5586
|
+
renderChevron && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Stack, { items: "center", justify: "center", horizontal: true, horizontalMobile: true, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { name: "keyboard_arrow_down" }) })
|
|
5372
5587
|
]
|
|
5373
5588
|
}
|
|
5374
5589
|
);
|
|
5375
5590
|
}
|
|
5376
5591
|
|
|
5377
5592
|
// src/components/MobileDataGrid/ColumnList.tsx
|
|
5378
|
-
var
|
|
5593
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5379
5594
|
function ColumnList(props) {
|
|
5380
5595
|
const {
|
|
5381
5596
|
withBorder,
|
|
@@ -5387,19 +5602,19 @@ function ColumnList(props) {
|
|
|
5387
5602
|
} = props;
|
|
5388
5603
|
const ctx = useGridContext();
|
|
5389
5604
|
const { id, testid, data, getId, selectedRowIds } = ctx;
|
|
5390
|
-
return /* @__PURE__ */ (0,
|
|
5605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5391
5606
|
"div",
|
|
5392
5607
|
{
|
|
5393
|
-
className: (0,
|
|
5608
|
+
className: (0, import_clsx37.default)(
|
|
5394
5609
|
"flex flex-col flex-1 relative overflow-y-auto overflow-x-hidden",
|
|
5395
5610
|
!!Footer && "mb-20"
|
|
5396
5611
|
),
|
|
5397
|
-
children: /* @__PURE__ */ (0,
|
|
5612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
5398
5613
|
"ul",
|
|
5399
5614
|
{
|
|
5400
5615
|
id,
|
|
5401
5616
|
"data-testid": testid,
|
|
5402
|
-
className: (0,
|
|
5617
|
+
className: (0, import_clsx37.default)(
|
|
5403
5618
|
"rounded absolute top-0 left-0 w-full flex-1",
|
|
5404
5619
|
"divide-y divide-border-primary-normal",
|
|
5405
5620
|
withBorder && "border border-border-primary-normal"
|
|
@@ -5407,7 +5622,7 @@ function ColumnList(props) {
|
|
|
5407
5622
|
children: [
|
|
5408
5623
|
data.map((item) => {
|
|
5409
5624
|
const id2 = getId(item);
|
|
5410
|
-
return /* @__PURE__ */ (0,
|
|
5625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5411
5626
|
MobileDataGridCard,
|
|
5412
5627
|
{
|
|
5413
5628
|
data: item,
|
|
@@ -5420,7 +5635,7 @@ function ColumnList(props) {
|
|
|
5420
5635
|
id2
|
|
5421
5636
|
);
|
|
5422
5637
|
}),
|
|
5423
|
-
!!Footer && /* @__PURE__ */ (0,
|
|
5638
|
+
!!Footer && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "fixed left-0 right-0 bottom-0 flex flex-col w-full min-h-20", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Footer, __spreadValues({}, ctx)) })
|
|
5424
5639
|
]
|
|
5425
5640
|
}
|
|
5426
5641
|
)
|
|
@@ -5429,7 +5644,7 @@ function ColumnList(props) {
|
|
|
5429
5644
|
}
|
|
5430
5645
|
|
|
5431
5646
|
// src/components/MobileDataGrid/index.tsx
|
|
5432
|
-
var
|
|
5647
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5433
5648
|
function MobileDataGrid(props) {
|
|
5434
5649
|
const {
|
|
5435
5650
|
columns,
|
|
@@ -5451,7 +5666,7 @@ function MobileDataGrid(props) {
|
|
|
5451
5666
|
rowActions,
|
|
5452
5667
|
rounded
|
|
5453
5668
|
} = props;
|
|
5454
|
-
return /* @__PURE__ */ (0,
|
|
5669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
5455
5670
|
GridContextProvider,
|
|
5456
5671
|
{
|
|
5457
5672
|
initialColumns: columns,
|
|
@@ -5463,7 +5678,7 @@ function MobileDataGrid(props) {
|
|
|
5463
5678
|
numberOfColumnsToShow,
|
|
5464
5679
|
primaryKey,
|
|
5465
5680
|
children: [
|
|
5466
|
-
/* @__PURE__ */ (0,
|
|
5681
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
5467
5682
|
Stack,
|
|
5468
5683
|
{
|
|
5469
5684
|
height: "full",
|
|
@@ -5471,7 +5686,7 @@ function MobileDataGrid(props) {
|
|
|
5471
5686
|
overflowX: "hidden",
|
|
5472
5687
|
overflowY: "hidden",
|
|
5473
5688
|
children: [
|
|
5474
|
-
!hideHeader && /* @__PURE__ */ (0,
|
|
5689
|
+
!hideHeader && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5475
5690
|
MobileDataGridHeader,
|
|
5476
5691
|
{
|
|
5477
5692
|
header,
|
|
@@ -5479,7 +5694,7 @@ function MobileDataGrid(props) {
|
|
|
5479
5694
|
enableRowSelection
|
|
5480
5695
|
}
|
|
5481
5696
|
),
|
|
5482
|
-
/* @__PURE__ */ (0,
|
|
5697
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5483
5698
|
ColumnList,
|
|
5484
5699
|
{
|
|
5485
5700
|
withBorder,
|
|
@@ -5493,7 +5708,7 @@ function MobileDataGrid(props) {
|
|
|
5493
5708
|
]
|
|
5494
5709
|
}
|
|
5495
5710
|
),
|
|
5496
|
-
/* @__PURE__ */ (0,
|
|
5711
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(RowDetailModalProvider, {})
|
|
5497
5712
|
]
|
|
5498
5713
|
}
|
|
5499
5714
|
);
|