@dmsi/wedgekit-react 0.0.415 → 0.0.417
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-3HBYDOYE.js +114 -0
- package/dist/{chunk-JIMJIJOF.js → chunk-5TGP5EFM.js} +2 -2
- package/dist/{chunk-2HMCS25C.js → chunk-6LHBY2IH.js} +1 -1
- package/dist/{chunk-6I5LZ2ZC.js → chunk-7AXHAWJX.js} +3 -3
- package/dist/{chunk-MQX7GFLX.js → chunk-CAQWLY5V.js} +24 -6
- package/dist/{chunk-QQ5G773N.js → chunk-DCLNAUC4.js} +1 -1
- package/dist/{chunk-GB4ZTUQV.js → chunk-DTW7JCBR.js} +36 -0
- package/dist/{chunk-BK7SPR6Y.js → chunk-HYJIDHAK.js} +6 -6
- package/dist/{chunk-ZHZIIVJN.js → chunk-IMOIZFJZ.js} +5 -5
- package/dist/chunk-KBJZUVLM.js +65 -0
- package/dist/{chunk-AA6GE3TH.js → chunk-LUPHOXAQ.js} +1 -1
- package/dist/chunk-NRNWEQD7.js +66 -0
- package/dist/{chunk-44TDIHUP.js → chunk-P3MIP2FD.js} +1 -1
- package/dist/{chunk-7ULLUUVJ.js → chunk-PQWWVBSR.js} +1 -1
- package/dist/{chunk-ERW5DEIO.js → chunk-RQLWSLVE.js} +1 -1
- package/dist/chunk-TYAQWVIM.js +159 -0
- package/dist/{chunk-KZZKQLKF.js → chunk-W55J2KJZ.js} +1 -1
- package/dist/chunk-Y2GK27RX.js +79 -0
- package/dist/components/Accordion.cjs +74 -2
- package/dist/components/Accordion.js +3 -3
- package/dist/components/CalendarRange.cjs +228 -53
- package/dist/components/CalendarRange.css +169 -65
- package/dist/components/CalendarRange.js +23 -16
- package/dist/components/Card.cjs +38 -2
- package/dist/components/Card.js +1 -1
- package/dist/components/CompactImagesPreview.cjs +59 -5
- package/dist/components/CompactImagesPreview.js +2 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +186 -11
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +169 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +23 -16
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +195 -20
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +169 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +23 -16
- package/dist/components/DataGrid/PinnedColumns.cjs +211 -36
- package/dist/components/DataGrid/PinnedColumns.css +169 -65
- package/dist/components/DataGrid/PinnedColumns.js +23 -16
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +187 -12
- package/dist/components/DataGrid/TableBody/LoadingCell.css +169 -65
- package/dist/components/DataGrid/TableBody/LoadingCell.js +23 -16
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +193 -18
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +169 -65
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +23 -16
- package/dist/components/DataGrid/TableBody/index.cjs +208 -33
- package/dist/components/DataGrid/TableBody/index.css +169 -65
- package/dist/components/DataGrid/TableBody/index.js +23 -16
- package/dist/components/DataGrid/index.cjs +297 -122
- package/dist/components/DataGrid/index.css +169 -65
- package/dist/components/DataGrid/index.js +23 -16
- package/dist/components/DataGrid/utils.cjs +187 -12
- package/dist/components/DataGrid/utils.css +169 -65
- package/dist/components/DataGrid/utils.js +23 -16
- package/dist/components/DateInput.cjs +247 -72
- package/dist/components/DateInput.css +169 -65
- package/dist/components/DateInput.js +23 -16
- package/dist/components/DateRangeInput.cjs +247 -72
- package/dist/components/DateRangeInput.css +169 -65
- package/dist/components/DateRangeInput.js +23 -16
- package/dist/components/Grid.cjs +81 -76
- package/dist/components/Grid.js +1 -1
- package/dist/components/ListGroup.cjs +553 -0
- package/dist/components/ListGroup.js +11 -0
- package/dist/components/MobileDataGrid/ColumnList.cjs +36 -0
- package/dist/components/MobileDataGrid/ColumnList.js +3 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +194 -19
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +169 -65
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +23 -16
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +36 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +238 -27
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +169 -65
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +23 -16
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +36 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +36 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +5 -5
- package/dist/components/MobileDataGrid/index.cjs +740 -529
- package/dist/components/MobileDataGrid/index.css +169 -65
- package/dist/components/MobileDataGrid/index.js +23 -16
- package/dist/components/Modal.js +2 -2
- package/dist/components/Notification.cjs +36 -0
- package/dist/components/Notification.js +1 -1
- package/dist/components/PDFViewer/PDFElement.cjs +36 -0
- package/dist/components/PDFViewer/PDFElement.js +2 -2
- package/dist/components/PDFViewer/PDFNavigation.cjs +36 -0
- package/dist/components/PDFViewer/PDFNavigation.js +2 -2
- package/dist/components/PDFViewer/index.cjs +36 -0
- package/dist/components/PDFViewer/index.js +8 -111
- package/dist/components/Pagination.cjs +427 -0
- package/dist/components/Pagination.js +10 -0
- package/dist/components/ProductImagePreview/index.cjs +139 -127
- package/dist/components/ProductImagePreview/index.js +4 -4
- package/dist/components/SideMenuGroup.cjs +36 -0
- package/dist/components/SideMenuGroup.js +1 -1
- package/dist/components/SideMenuItem.cjs +36 -0
- package/dist/components/SideMenuItem.js +1 -1
- package/dist/components/SimpleTable.cjs +36 -0
- package/dist/components/SimpleTable.js +2 -2
- package/dist/components/Stack.cjs +36 -0
- package/dist/components/Stack.js +1 -1
- package/dist/components/Swatch.cjs +36 -0
- package/dist/components/Swatch.js +1 -1
- package/dist/components/Time.cjs +36 -0
- package/dist/components/Time.js +1 -1
- package/dist/components/Tooltip.cjs +1 -1
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Upload.cjs +36 -0
- package/dist/components/Upload.js +1 -1
- package/dist/components/index.cjs +686 -131
- package/dist/components/index.css +169 -65
- package/dist/components/index.js +33 -17
- package/dist/index.css +169 -65
- package/package.json +1 -1
- package/src/components/Card.tsx +60 -2
- package/src/components/CompactImagesPreview.tsx +54 -30
- package/src/components/Grid.tsx +59 -91
- package/src/components/ListGroup.tsx +82 -0
- package/src/components/Pagination.tsx +182 -0
- package/src/components/Stack.tsx +76 -0
- package/src/components/Tooltip.tsx +4 -3
- package/src/components/index.ts +3 -0
- package/dist/chunk-ER6RCOH3.js +0 -97
- package/dist/chunk-EZCH4PQS.js +0 -29
- package/dist/{chunk-D6YCMQPO.js → chunk-SBCFBHNG.js} +3 -3
|
@@ -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,17 +4424,17 @@ 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
|
|
|
@@ -4407,409 +4442,98 @@ var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
|
4407
4442
|
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
4408
4443
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4409
4444
|
|
|
4410
|
-
// src/components/
|
|
4411
|
-
var
|
|
4445
|
+
// src/components/PDFViewer/index.tsx
|
|
4446
|
+
var import_react30 = require("react");
|
|
4412
4447
|
|
|
4413
|
-
// src/components/
|
|
4448
|
+
// src/components/Modal.tsx
|
|
4449
|
+
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
4414
4450
|
var import_react27 = require("react");
|
|
4415
|
-
var GridContext = (0, import_react27.createContext)(null);
|
|
4416
|
-
|
|
4417
|
-
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
4418
|
-
function useGridContext() {
|
|
4419
|
-
const ctx = (0, import_react28.useContext)(GridContext);
|
|
4420
|
-
if (!ctx) {
|
|
4421
|
-
throw new Error("useGridContext must be used within GridContextProvider");
|
|
4422
|
-
}
|
|
4423
|
-
return ctx;
|
|
4424
|
-
}
|
|
4425
4451
|
|
|
4426
|
-
// src/components/
|
|
4452
|
+
// src/components/ModalHeader.tsx
|
|
4453
|
+
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
4427
4454
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
primaryKey,
|
|
4439
|
-
resetColumnVisibility,
|
|
4440
|
-
dispatch
|
|
4441
|
-
} = context;
|
|
4442
|
-
const toggleColumnVisibility = (0, import_react29.useCallback)(
|
|
4443
|
-
(index, visible) => {
|
|
4444
|
-
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
4445
|
-
},
|
|
4446
|
-
[dispatch]
|
|
4447
|
-
);
|
|
4455
|
+
var ModalHeader = ({
|
|
4456
|
+
title,
|
|
4457
|
+
hideCloseIcon,
|
|
4458
|
+
headerIcon,
|
|
4459
|
+
headerIconAlign,
|
|
4460
|
+
onClose,
|
|
4461
|
+
id,
|
|
4462
|
+
testid,
|
|
4463
|
+
headerClassname
|
|
4464
|
+
}) => {
|
|
4448
4465
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
4449
4466
|
"div",
|
|
4450
4467
|
{
|
|
4451
|
-
id
|
|
4468
|
+
id,
|
|
4452
4469
|
"data-testid": testid,
|
|
4453
|
-
className:
|
|
4454
|
-
|
|
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
|
+
),
|
|
4455
4479
|
children: [
|
|
4456
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.
|
|
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)(
|
|
4457
4493
|
Button,
|
|
4458
4494
|
{
|
|
4459
|
-
id: id ? `${id}-button` : void 0,
|
|
4460
|
-
testid: testid ? `${testid}-button` : void 0,
|
|
4461
|
-
onClick: () => setShow((prev) => !prev),
|
|
4462
|
-
variant: "navigation",
|
|
4495
|
+
id: id ? `${id}-close-button` : void 0,
|
|
4496
|
+
testid: testid ? `${testid}-close-button` : void 0,
|
|
4463
4497
|
iconOnly: true,
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
),
|
|
4468
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
4469
|
-
Menu,
|
|
4470
|
-
{
|
|
4471
|
-
id: id ? `${id}-menu` : void 0,
|
|
4472
|
-
testid: testid ? `${testid}-menu` : void 0,
|
|
4473
|
-
positionTo: ref,
|
|
4474
|
-
position: "bottom-right",
|
|
4475
|
-
show,
|
|
4476
|
-
setShow,
|
|
4477
|
-
calculateMinMaxHeight: true,
|
|
4478
|
-
children: [
|
|
4479
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4480
|
-
Button,
|
|
4481
|
-
{
|
|
4482
|
-
id: id ? `${id}-reset-button` : void 0,
|
|
4483
|
-
testid: testid ? `${testid}-reset-button` : void 0,
|
|
4484
|
-
variant: "tertiary",
|
|
4485
|
-
onClick: () => {
|
|
4486
|
-
resetColumnVisibility();
|
|
4487
|
-
setShow(false);
|
|
4488
|
-
},
|
|
4489
|
-
children: "Reset to default"
|
|
4490
|
-
}
|
|
4491
|
-
),
|
|
4492
|
-
columns.filter((x) => {
|
|
4493
|
-
var _a;
|
|
4494
|
-
return (_a = x.meta) == null ? void 0 : _a.inVisibilityMenu;
|
|
4495
|
-
}).map((column) => {
|
|
4496
|
-
var _a, _b, _c;
|
|
4497
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4498
|
-
MenuOption,
|
|
4499
|
-
{
|
|
4500
|
-
testid: testid ? `${testid}-option-${column.id}` : void 0,
|
|
4501
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4502
|
-
Checkbox,
|
|
4503
|
-
{
|
|
4504
|
-
id: id ? `${id}-checkbox-${column.id}` : void 0,
|
|
4505
|
-
testid: testid ? `${testid}-checkbox-${column.id}` : void 0,
|
|
4506
|
-
label: (_a = column.header) == null ? void 0 : _a.toString(),
|
|
4507
|
-
checked: !!((_b = column.meta) == null ? void 0 : _b.visible) || column.id === String(primaryKey),
|
|
4508
|
-
disabled: typeof numberOfColumnsToShow !== "undefined" && // account for header+link occupying one slot
|
|
4509
|
-
visibleColumns.length >= numberOfColumnsToShow - 1 && ((_c = column.meta) == null ? void 0 : _c.visible) !== true || column.id === String(primaryKey),
|
|
4510
|
-
onChange: (e) => {
|
|
4511
|
-
toggleColumnVisibility(
|
|
4512
|
-
columns.findIndex(({ id: id2 }) => id2 === column.id),
|
|
4513
|
-
e.target.checked
|
|
4514
|
-
);
|
|
4515
|
-
}
|
|
4516
|
-
}
|
|
4517
|
-
)
|
|
4518
|
-
},
|
|
4519
|
-
id ? `${id}-option-${column.id}` : void 0
|
|
4520
|
-
);
|
|
4521
|
-
})
|
|
4522
|
-
]
|
|
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 }) })
|
|
4523
4501
|
}
|
|
4524
4502
|
)
|
|
4525
4503
|
]
|
|
4526
4504
|
}
|
|
4527
4505
|
);
|
|
4528
|
-
}
|
|
4506
|
+
};
|
|
4507
|
+
ModalHeader.displayName = "ModalHeader";
|
|
4529
4508
|
|
|
4530
|
-
// src/components/
|
|
4509
|
+
// src/components/ModalContent.tsx
|
|
4510
|
+
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
4531
4511
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4532
|
-
function
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4512
|
+
function ModalContent({
|
|
4513
|
+
fixedHeightScrolling,
|
|
4514
|
+
children,
|
|
4515
|
+
id,
|
|
4516
|
+
testid
|
|
4536
4517
|
}) {
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
if (typeof Header === "string" || primaryKey)
|
|
4551
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4552
|
-
"div",
|
|
4553
|
-
{
|
|
4554
|
-
id: id ? `${id}-header` : void 0,
|
|
4555
|
-
"data-testid": testid ? `${testid}-header` : void 0,
|
|
4556
|
-
className: "sticky top-0",
|
|
4557
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Theme, { theme: "brand", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
4558
|
-
Stack,
|
|
4559
|
-
{
|
|
4560
|
-
horizontal: true,
|
|
4561
|
-
horizontalMobile: true,
|
|
4562
|
-
items: "center",
|
|
4563
|
-
justify: "between",
|
|
4564
|
-
backgroundColor: "background-primary-normal",
|
|
4565
|
-
children: [
|
|
4566
|
-
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit h-full", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4567
|
-
Checkbox,
|
|
4568
|
-
{
|
|
4569
|
-
id: id ? `${id}-select-all-checkbox` : void 0,
|
|
4570
|
-
testid: testid ? `${testid}-select-all-checkbox` : void 0,
|
|
4571
|
-
checked: selectedRowIds.length === data.length,
|
|
4572
|
-
indeterminate: !!selectedRowIds.length && selectedRowIds.length !== data.length,
|
|
4573
|
-
onChange: handleRowSelectAll
|
|
4574
|
-
}
|
|
4575
|
-
) }),
|
|
4576
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4577
|
-
Stack,
|
|
4578
|
-
{
|
|
4579
|
-
horizontal: true,
|
|
4580
|
-
horizontalMobile: true,
|
|
4581
|
-
items: "center",
|
|
4582
|
-
sizing: "component",
|
|
4583
|
-
padding: true,
|
|
4584
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.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() })
|
|
4585
|
-
}
|
|
4586
|
-
),
|
|
4587
|
-
enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ColumnSelector, {})
|
|
4588
|
-
]
|
|
4589
|
-
}
|
|
4590
|
-
) })
|
|
4591
|
-
}
|
|
4592
|
-
);
|
|
4593
|
-
}
|
|
4594
|
-
|
|
4595
|
-
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4596
|
-
var import_react30 = require("react");
|
|
4597
|
-
|
|
4598
|
-
// src/components/MobileDataGrid/dataGridReducer.ts
|
|
4599
|
-
function dataGridReducer(state, action) {
|
|
4600
|
-
var _a, _b, _c;
|
|
4601
|
-
const { type, payload } = action;
|
|
4602
|
-
let itemIndex = null;
|
|
4603
|
-
if (action.type === "INSERT" && action.pos === "INDEX")
|
|
4604
|
-
itemIndex = action.index;
|
|
4605
|
-
if (action.type === "UPDATE")
|
|
4606
|
-
itemIndex = (_a = action.index) != null ? _a : state.filter(({ id }) => !!id).findIndex(({ id }) => id === action.id);
|
|
4607
|
-
switch (type) {
|
|
4608
|
-
case "SET":
|
|
4609
|
-
return [...payload];
|
|
4610
|
-
case "UPDATE":
|
|
4611
|
-
if (typeof itemIndex !== "number" || itemIndex < 0)
|
|
4612
|
-
throw new Error("action.(id | index) must be provided.");
|
|
4613
|
-
return [
|
|
4614
|
-
...state.slice(0, itemIndex),
|
|
4615
|
-
__spreadProps(__spreadValues(__spreadValues({}, state[itemIndex]), payload), {
|
|
4616
|
-
meta: __spreadValues(__spreadValues({}, (_b = state[itemIndex].meta) != null ? _b : {}), (_c = payload.meta) != null ? _c : {})
|
|
4617
|
-
}),
|
|
4618
|
-
...state.slice(itemIndex + 1)
|
|
4619
|
-
];
|
|
4620
|
-
default:
|
|
4621
|
-
throw new Error("Action type not implemented.");
|
|
4622
|
-
}
|
|
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
|
+
);
|
|
4623
4531
|
}
|
|
4532
|
+
ModalContent.displayName = "ModalContent";
|
|
4624
4533
|
|
|
4625
|
-
// src/components/
|
|
4534
|
+
// src/components/ModalButtons.tsx
|
|
4535
|
+
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
4626
4536
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4627
|
-
function GridContextProvider(props) {
|
|
4628
|
-
const {
|
|
4629
|
-
initialColumns,
|
|
4630
|
-
id,
|
|
4631
|
-
testid,
|
|
4632
|
-
children,
|
|
4633
|
-
data,
|
|
4634
|
-
numberOfColumnsToShow,
|
|
4635
|
-
primaryKey,
|
|
4636
|
-
getId,
|
|
4637
|
-
onRowSelect
|
|
4638
|
-
} = props;
|
|
4639
|
-
const [columns, dispatch] = (0, import_react30.useReducer)(dataGridReducer, initialColumns);
|
|
4640
|
-
const [selectedRowIds, setSelectedRowIds] = (0, import_react30.useState)([]);
|
|
4641
|
-
const [currentRow, setCurrentRow] = (0, import_react30.useState)(null);
|
|
4642
|
-
const resetColumnVisibility = (0, import_react30.useCallback)(() => {
|
|
4643
|
-
const newColumns = columns.map((column) => {
|
|
4644
|
-
var _a;
|
|
4645
|
-
const initialColumn = initialColumns.find((c) => c.id === column.id);
|
|
4646
|
-
return __spreadProps(__spreadValues({}, column), {
|
|
4647
|
-
meta: __spreadProps(__spreadValues({}, column.meta), {
|
|
4648
|
-
visible: (_a = initialColumn == null ? void 0 : initialColumn.meta) == null ? void 0 : _a.visible
|
|
4649
|
-
})
|
|
4650
|
-
});
|
|
4651
|
-
});
|
|
4652
|
-
dispatch({ type: "SET", payload: newColumns });
|
|
4653
|
-
}, [columns, initialColumns]);
|
|
4654
|
-
const handleRowSelect = (0, import_react30.useCallback)(
|
|
4655
|
-
(item) => {
|
|
4656
|
-
var _a;
|
|
4657
|
-
const rowId = (_a = getId(item)) != null ? _a : "";
|
|
4658
|
-
if (!rowId) return;
|
|
4659
|
-
const nextSelected = selectedRowIds.includes(rowId) ? selectedRowIds.filter((id2) => id2 !== rowId) : [...selectedRowIds, rowId];
|
|
4660
|
-
setSelectedRowIds(nextSelected);
|
|
4661
|
-
if (onRowSelect) onRowSelect(item, nextSelected);
|
|
4662
|
-
},
|
|
4663
|
-
[getId, onRowSelect, selectedRowIds]
|
|
4664
|
-
);
|
|
4665
|
-
const handleRowSelectAll = (0, import_react30.useCallback)(() => {
|
|
4666
|
-
setSelectedRowIds((prev) => {
|
|
4667
|
-
if (prev.length === data.length) {
|
|
4668
|
-
return [];
|
|
4669
|
-
}
|
|
4670
|
-
return data.map(getId).filter((id2) => id2 !== void 0);
|
|
4671
|
-
});
|
|
4672
|
-
}, [data, getId]);
|
|
4673
|
-
const openRowDetail = (0, import_react30.useCallback)((row) => {
|
|
4674
|
-
setCurrentRow(row);
|
|
4675
|
-
}, []);
|
|
4676
|
-
const closeRowDetail = (0, import_react30.useCallback)(() => {
|
|
4677
|
-
setCurrentRow(null);
|
|
4678
|
-
}, []);
|
|
4679
|
-
const visibleColumns = (0, import_react30.useMemo)(() => {
|
|
4680
|
-
const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
|
|
4681
|
-
if (primaryKey) {
|
|
4682
|
-
const pkColumn = columns.find((col) => col.id === String(primaryKey));
|
|
4683
|
-
const otherColumns = columns.filter(
|
|
4684
|
-
(col) => col.id !== String(primaryKey)
|
|
4685
|
-
);
|
|
4686
|
-
const orderedColumns = pkColumn ? [pkColumn, ...otherColumns] : [...otherColumns];
|
|
4687
|
-
return orderedColumns.filter((x) => {
|
|
4688
|
-
var _a;
|
|
4689
|
-
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
4690
|
-
}).slice(0, effectiveLimit);
|
|
4691
|
-
}
|
|
4692
|
-
return columns.filter((x) => {
|
|
4693
|
-
var _a;
|
|
4694
|
-
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
4695
|
-
}).slice(0, effectiveLimit);
|
|
4696
|
-
}, [columns, numberOfColumnsToShow, primaryKey]);
|
|
4697
|
-
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4698
|
-
GridContext.Provider,
|
|
4699
|
-
{
|
|
4700
|
-
value: {
|
|
4701
|
-
columns,
|
|
4702
|
-
testid,
|
|
4703
|
-
id,
|
|
4704
|
-
data,
|
|
4705
|
-
selectedRowIds,
|
|
4706
|
-
visibleColumns,
|
|
4707
|
-
numberOfColumnsToShow,
|
|
4708
|
-
primaryKey,
|
|
4709
|
-
dispatch,
|
|
4710
|
-
getId,
|
|
4711
|
-
resetColumnVisibility,
|
|
4712
|
-
handleRowSelect,
|
|
4713
|
-
handleRowSelectAll,
|
|
4714
|
-
isRowDetailOpen: !!currentRow,
|
|
4715
|
-
currentRow,
|
|
4716
|
-
openRowDetail,
|
|
4717
|
-
closeRowDetail
|
|
4718
|
-
},
|
|
4719
|
-
children
|
|
4720
|
-
}
|
|
4721
|
-
);
|
|
4722
|
-
}
|
|
4723
|
-
|
|
4724
|
-
// src/components/Modal.tsx
|
|
4725
|
-
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
4726
|
-
var import_react32 = require("react");
|
|
4727
|
-
|
|
4728
|
-
// src/components/ModalHeader.tsx
|
|
4729
|
-
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
4730
|
-
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4731
|
-
var ModalHeader = ({
|
|
4732
|
-
title,
|
|
4733
|
-
hideCloseIcon,
|
|
4734
|
-
headerIcon,
|
|
4735
|
-
headerIconAlign,
|
|
4736
|
-
onClose,
|
|
4737
|
-
id,
|
|
4738
|
-
testid,
|
|
4739
|
-
headerClassname
|
|
4740
|
-
}) => {
|
|
4741
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4742
|
-
"div",
|
|
4743
|
-
{
|
|
4744
|
-
id,
|
|
4745
|
-
"data-testid": testid,
|
|
4746
|
-
className: (0, import_clsx28.default)(
|
|
4747
|
-
"flex justify-between items-center",
|
|
4748
|
-
headerIconAlign === "center" && "justify-center",
|
|
4749
|
-
headerIconAlign === "right" && "justify-end",
|
|
4750
|
-
headerIconAlign === "left" && "justify-start",
|
|
4751
|
-
layoutPaddding,
|
|
4752
|
-
layoutGroupGap,
|
|
4753
|
-
headerClassname
|
|
4754
|
-
),
|
|
4755
|
-
children: [
|
|
4756
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: (0, import_clsx28.default)("flex items-center flex-1", layoutGroupGap), children: [
|
|
4757
|
-
headerIcon,
|
|
4758
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4759
|
-
Heading2,
|
|
4760
|
-
{
|
|
4761
|
-
id: id ? `${id}-title` : void 0,
|
|
4762
|
-
testid: testid ? `${testid}-title` : void 0,
|
|
4763
|
-
as: "p",
|
|
4764
|
-
children: title
|
|
4765
|
-
}
|
|
4766
|
-
)
|
|
4767
|
-
] }),
|
|
4768
|
-
!hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4769
|
-
Button,
|
|
4770
|
-
{
|
|
4771
|
-
id: id ? `${id}-close-button` : void 0,
|
|
4772
|
-
testid: testid ? `${testid}-close-button` : void 0,
|
|
4773
|
-
iconOnly: true,
|
|
4774
|
-
variant: "tertiary",
|
|
4775
|
-
onClick: onClose,
|
|
4776
|
-
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { name: "close", size: 24 }) })
|
|
4777
|
-
}
|
|
4778
|
-
)
|
|
4779
|
-
]
|
|
4780
|
-
}
|
|
4781
|
-
);
|
|
4782
|
-
};
|
|
4783
|
-
ModalHeader.displayName = "ModalHeader";
|
|
4784
|
-
|
|
4785
|
-
// src/components/ModalContent.tsx
|
|
4786
|
-
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
4787
|
-
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4788
|
-
function ModalContent({
|
|
4789
|
-
fixedHeightScrolling,
|
|
4790
|
-
children,
|
|
4791
|
-
id,
|
|
4792
|
-
testid
|
|
4793
|
-
}) {
|
|
4794
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4795
|
-
"div",
|
|
4796
|
-
{
|
|
4797
|
-
id,
|
|
4798
|
-
"data-testid": testid,
|
|
4799
|
-
className: (0, import_clsx29.default)(
|
|
4800
|
-
"flex-grow desktop:flex-grow-0",
|
|
4801
|
-
layoutPaddding,
|
|
4802
|
-
fixedHeightScrolling && "overflow-auto"
|
|
4803
|
-
),
|
|
4804
|
-
children
|
|
4805
|
-
}
|
|
4806
|
-
);
|
|
4807
|
-
}
|
|
4808
|
-
ModalContent.displayName = "ModalContent";
|
|
4809
|
-
|
|
4810
|
-
// src/components/ModalButtons.tsx
|
|
4811
|
-
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
4812
|
-
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4813
4537
|
var ModalButtons = ({
|
|
4814
4538
|
onClose,
|
|
4815
4539
|
onContinue,
|
|
@@ -4817,7 +4541,7 @@ var ModalButtons = ({
|
|
|
4817
4541
|
id,
|
|
4818
4542
|
testid
|
|
4819
4543
|
}) => {
|
|
4820
|
-
return /* @__PURE__ */ (0,
|
|
4544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4821
4545
|
"div",
|
|
4822
4546
|
{
|
|
4823
4547
|
id,
|
|
@@ -4827,26 +4551,26 @@ var ModalButtons = ({
|
|
|
4827
4551
|
layoutPaddding,
|
|
4828
4552
|
layoutGroupGap
|
|
4829
4553
|
),
|
|
4830
|
-
children: customActions != null ? customActions : /* @__PURE__ */ (0,
|
|
4831
|
-
/* @__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)(
|
|
4832
4556
|
Button,
|
|
4833
4557
|
{
|
|
4834
4558
|
id: id ? `${id}-close-button` : void 0,
|
|
4835
4559
|
testid: testid ? `${testid}-close-button` : void 0,
|
|
4836
4560
|
variant: "secondary",
|
|
4837
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
4561
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { name: "close", size: 24 }),
|
|
4838
4562
|
onClick: onClose,
|
|
4839
4563
|
className: "max-sm:w-full",
|
|
4840
4564
|
children: "Close"
|
|
4841
4565
|
}
|
|
4842
4566
|
),
|
|
4843
|
-
/* @__PURE__ */ (0,
|
|
4567
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4844
4568
|
Button,
|
|
4845
4569
|
{
|
|
4846
4570
|
id: id ? `${id}-continue-button` : void 0,
|
|
4847
4571
|
testid: testid ? `${testid}-continue-button` : void 0,
|
|
4848
4572
|
variant: "primary",
|
|
4849
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
4573
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { name: "check", size: 24 }),
|
|
4850
4574
|
className: "max-sm:w-full",
|
|
4851
4575
|
onClick: onContinue,
|
|
4852
4576
|
children: "Continue"
|
|
@@ -4860,7 +4584,7 @@ ModalButtons.displayName = "ModalButtons";
|
|
|
4860
4584
|
|
|
4861
4585
|
// src/components/ModalScrim.tsx
|
|
4862
4586
|
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
4863
|
-
var
|
|
4587
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4864
4588
|
var ModalScrim = ({
|
|
4865
4589
|
show = false,
|
|
4866
4590
|
size = "small",
|
|
@@ -4870,7 +4594,7 @@ var ModalScrim = ({
|
|
|
4870
4594
|
id,
|
|
4871
4595
|
testid
|
|
4872
4596
|
}) => {
|
|
4873
|
-
return /* @__PURE__ */ (0,
|
|
4597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4874
4598
|
"div",
|
|
4875
4599
|
{
|
|
4876
4600
|
id,
|
|
@@ -4895,10 +4619,10 @@ var import_react_dom3 = require("react-dom");
|
|
|
4895
4619
|
var import_react_use = require("react-use");
|
|
4896
4620
|
|
|
4897
4621
|
// src/components/useMounted.tsx
|
|
4898
|
-
var
|
|
4622
|
+
var import_react26 = require("react");
|
|
4899
4623
|
var useMounted = () => {
|
|
4900
|
-
const [isMounted, setIsMounted] = (0,
|
|
4901
|
-
(0,
|
|
4624
|
+
const [isMounted, setIsMounted] = (0, import_react26.useState)(false);
|
|
4625
|
+
(0, import_react26.useEffect)(() => {
|
|
4902
4626
|
setIsMounted(true);
|
|
4903
4627
|
return () => setIsMounted(false);
|
|
4904
4628
|
}, []);
|
|
@@ -4906,7 +4630,7 @@ var useMounted = () => {
|
|
|
4906
4630
|
};
|
|
4907
4631
|
|
|
4908
4632
|
// src/components/Modal.tsx
|
|
4909
|
-
var
|
|
4633
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4910
4634
|
var fadeInScale = (element, duration = 300) => element.animate(
|
|
4911
4635
|
[
|
|
4912
4636
|
{ opacity: 0, transform: "scale(0.95)" },
|
|
@@ -4990,12 +4714,12 @@ var Modal = ({
|
|
|
4990
4714
|
}) => {
|
|
4991
4715
|
var _a;
|
|
4992
4716
|
const mounted = useMounted();
|
|
4993
|
-
const modalRef = (0,
|
|
4994
|
-
const bgRef = (0,
|
|
4717
|
+
const modalRef = (0, import_react27.useRef)(null);
|
|
4718
|
+
const bgRef = (0, import_react27.useRef)(null);
|
|
4995
4719
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
4996
4720
|
const isMobile = useMatchesMobile();
|
|
4997
4721
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
4998
|
-
(0,
|
|
4722
|
+
(0, import_react27.useEffect)(() => {
|
|
4999
4723
|
if (!mounted) return;
|
|
5000
4724
|
if (!modalRef.current || !bgRef.current) {
|
|
5001
4725
|
console.error("Modal or background reference is not set.");
|
|
@@ -5015,7 +4739,7 @@ var Modal = ({
|
|
|
5015
4739
|
bgFadeIn(bgRef.current);
|
|
5016
4740
|
}
|
|
5017
4741
|
}, [mounted, onClose, open, wasOpen]);
|
|
5018
|
-
const handleKeyDown = (0,
|
|
4742
|
+
const handleKeyDown = (0, import_react27.useCallback)(
|
|
5019
4743
|
(e) => {
|
|
5020
4744
|
if (e.key === "Escape") {
|
|
5021
4745
|
if (onClose) {
|
|
@@ -5026,12 +4750,12 @@ var Modal = ({
|
|
|
5026
4750
|
},
|
|
5027
4751
|
[onClose]
|
|
5028
4752
|
);
|
|
5029
|
-
const handleClose = (0,
|
|
4753
|
+
const handleClose = (0, import_react27.useCallback)(() => {
|
|
5030
4754
|
if (onClose) {
|
|
5031
4755
|
onClose();
|
|
5032
4756
|
}
|
|
5033
4757
|
}, [onClose]);
|
|
5034
|
-
(0,
|
|
4758
|
+
(0, import_react27.useEffect)(() => {
|
|
5035
4759
|
if (open) {
|
|
5036
4760
|
document.addEventListener("keyup", handleKeyDown);
|
|
5037
4761
|
}
|
|
@@ -5039,7 +4763,7 @@ var Modal = ({
|
|
|
5039
4763
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5040
4764
|
};
|
|
5041
4765
|
}, [open, handleKeyDown]);
|
|
5042
|
-
(0,
|
|
4766
|
+
(0, import_react27.useEffect)(() => {
|
|
5043
4767
|
if (!open) return;
|
|
5044
4768
|
const scrollY = window.scrollY;
|
|
5045
4769
|
const body = document.body;
|
|
@@ -5060,7 +4784,7 @@ var Modal = ({
|
|
|
5060
4784
|
};
|
|
5061
4785
|
}, [open]);
|
|
5062
4786
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5063
|
-
const backgroundClickHandler = (0,
|
|
4787
|
+
const backgroundClickHandler = (0, import_react27.useCallback)(
|
|
5064
4788
|
(e) => {
|
|
5065
4789
|
const target = e.target;
|
|
5066
4790
|
const currentTarget = e.currentTarget;
|
|
@@ -5078,7 +4802,7 @@ var Modal = ({
|
|
|
5078
4802
|
return null;
|
|
5079
4803
|
}
|
|
5080
4804
|
return (0, import_react_dom3.createPortal)(
|
|
5081
|
-
/* @__PURE__ */ (0,
|
|
4805
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5082
4806
|
ModalScrim,
|
|
5083
4807
|
{
|
|
5084
4808
|
id: id ? `${id}-scrim` : void 0,
|
|
@@ -5087,7 +4811,7 @@ var Modal = ({
|
|
|
5087
4811
|
ref: bgRef,
|
|
5088
4812
|
show: open,
|
|
5089
4813
|
onClick: backgroundClickHandler,
|
|
5090
|
-
children: /* @__PURE__ */ (0,
|
|
4814
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5091
4815
|
"div",
|
|
5092
4816
|
{
|
|
5093
4817
|
id,
|
|
@@ -5102,7 +4826,7 @@ var Modal = ({
|
|
|
5102
4826
|
),
|
|
5103
4827
|
onClick: (e) => e.stopPropagation(),
|
|
5104
4828
|
children: [
|
|
5105
|
-
/* @__PURE__ */ (0,
|
|
4829
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5106
4830
|
ModalHeader,
|
|
5107
4831
|
{
|
|
5108
4832
|
id: id ? `${id}-header` : void 0,
|
|
@@ -5115,7 +4839,7 @@ var Modal = ({
|
|
|
5115
4839
|
headerClassname
|
|
5116
4840
|
}
|
|
5117
4841
|
),
|
|
5118
|
-
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0,
|
|
4842
|
+
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5119
4843
|
ModalContent,
|
|
5120
4844
|
{
|
|
5121
4845
|
id: id ? `${id}-content` : void 0,
|
|
@@ -5124,7 +4848,7 @@ var Modal = ({
|
|
|
5124
4848
|
children
|
|
5125
4849
|
}
|
|
5126
4850
|
) : children,
|
|
5127
|
-
showButtons ? customFooter ? customActions : /* @__PURE__ */ (0,
|
|
4851
|
+
showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5128
4852
|
ModalButtons,
|
|
5129
4853
|
{
|
|
5130
4854
|
id: id ? `${id}-buttons` : void 0,
|
|
@@ -5144,99 +4868,586 @@ var Modal = ({
|
|
|
5144
4868
|
};
|
|
5145
4869
|
Modal.displayName = "Modal";
|
|
5146
4870
|
|
|
5147
|
-
// 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
|
|
4885
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4886
|
+
|
|
4887
|
+
// src/components/PDFViewer/PDFNavigation.tsx
|
|
5148
4888
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5149
|
-
function MobileDataGridColumn(props) {
|
|
5150
|
-
var _a;
|
|
5151
|
-
const { column, data } = props;
|
|
5152
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "mb-2 grid grid-cols-2 gap-2 px-3 flex-1", children: [
|
|
5153
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
5154
|
-
(_a = column.header) == null ? void 0 : _a.toString(),
|
|
5155
|
-
":"
|
|
5156
|
-
] }),
|
|
5157
|
-
" ",
|
|
5158
|
-
column.id && data[column.id] ? data[column.id] : null
|
|
5159
|
-
] });
|
|
5160
|
-
}
|
|
5161
4889
|
|
|
5162
|
-
// src/components/
|
|
4890
|
+
// src/components/PDFViewer/index.tsx
|
|
5163
4891
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5164
|
-
function ModalContent2() {
|
|
5165
|
-
const context = useGridContext();
|
|
5166
|
-
const { columns, currentRow } = context;
|
|
5167
|
-
if (!currentRow) return null;
|
|
5168
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Stack, { sizing: "layout-group", children: columns.filter((x) => {
|
|
5169
|
-
var _a;
|
|
5170
|
-
return !((_a = x.id) == null ? void 0 : _a.startsWith("__"));
|
|
5171
|
-
}).map(
|
|
5172
|
-
(column, index) => {
|
|
5173
|
-
var _a, _b;
|
|
5174
|
-
return ((_a = column.meta) == null ? void 0 : _a.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5175
|
-
"div",
|
|
5176
|
-
{
|
|
5177
|
-
className: "mb-2 grid grid-cols-2 gap-2 px-3 items-center flex-1",
|
|
5178
|
-
children: [
|
|
5179
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
5180
|
-
(_b = column.header) == null ? void 0 : _b.toString(),
|
|
5181
|
-
":"
|
|
5182
|
-
] }),
|
|
5183
|
-
" ",
|
|
5184
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5185
|
-
column.meta.mobileCell,
|
|
5186
|
-
{
|
|
5187
|
-
column,
|
|
5188
|
-
row: currentRow,
|
|
5189
|
-
cellValue: currentRow == null ? void 0 : currentRow[column.id]
|
|
5190
|
-
}
|
|
5191
|
-
)
|
|
5192
|
-
]
|
|
5193
|
-
},
|
|
5194
|
-
`${column.id}-${index}`
|
|
5195
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5196
|
-
MobileDataGridColumn,
|
|
5197
|
-
{
|
|
5198
|
-
column,
|
|
5199
|
-
data: currentRow
|
|
5200
|
-
},
|
|
5201
|
-
`${column.id}-${index}`
|
|
5202
|
-
);
|
|
5203
|
-
}
|
|
5204
|
-
) });
|
|
5205
|
-
}
|
|
5206
4892
|
|
|
5207
|
-
// src/components/
|
|
4893
|
+
// src/components/ListGroup.tsx
|
|
4894
|
+
var import_react31 = require("react");
|
|
4895
|
+
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
5208
4896
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
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,
|
|
5433
|
+
{
|
|
5434
|
+
fixedHeightScrolling: true,
|
|
5435
|
+
open: isRowDetailOpen,
|
|
5436
|
+
onClose: closeRowDetail,
|
|
5437
|
+
hideCloseIcon: true,
|
|
5438
|
+
size: "medium",
|
|
5439
|
+
className: "!p-0",
|
|
5440
|
+
headerIcon: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
5441
|
+
Stack,
|
|
5442
|
+
{
|
|
5232
5443
|
horizontal: true,
|
|
5233
5444
|
horizontalMobile: true,
|
|
5234
5445
|
items: "center",
|
|
5235
5446
|
justify: "between",
|
|
5236
5447
|
width: "full",
|
|
5237
5448
|
children: [
|
|
5238
|
-
/* @__PURE__ */ (0,
|
|
5239
|
-
/* @__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)(
|
|
5240
5451
|
Button,
|
|
5241
5452
|
{
|
|
5242
5453
|
id: id ? `${id}-open-in-new-button` : void 0,
|
|
@@ -5244,25 +5455,25 @@ function RowDetailModalProvider() {
|
|
|
5244
5455
|
iconOnly: true,
|
|
5245
5456
|
variant: "tertiary",
|
|
5246
5457
|
onClick: closeRowDetail,
|
|
5247
|
-
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 }) })
|
|
5248
5459
|
}
|
|
5249
5460
|
)
|
|
5250
5461
|
]
|
|
5251
5462
|
}
|
|
5252
5463
|
),
|
|
5253
|
-
customActions: /* @__PURE__ */ (0,
|
|
5464
|
+
customActions: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { onClick: closeRowDetail, className: "w-full", children: "Close" }),
|
|
5254
5465
|
showButtons: true,
|
|
5255
|
-
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, {}) })
|
|
5256
5467
|
}
|
|
5257
5468
|
);
|
|
5258
5469
|
}
|
|
5259
5470
|
|
|
5260
5471
|
// src/components/MobileDataGrid/ColumnList.tsx
|
|
5261
|
-
var
|
|
5472
|
+
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5262
5473
|
|
|
5263
5474
|
// src/components/MobileDataGrid/MobileDataGridCard/index.tsx
|
|
5264
|
-
var
|
|
5265
|
-
var
|
|
5475
|
+
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
5476
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5266
5477
|
function MobileDataGridCard({
|
|
5267
5478
|
renderLink,
|
|
5268
5479
|
renderChevron = true,
|
|
@@ -5274,27 +5485,27 @@ function MobileDataGridCard({
|
|
|
5274
5485
|
var _a;
|
|
5275
5486
|
const context = useGridContext();
|
|
5276
5487
|
const { id, testid, visibleColumns, getId, handleRowSelect, openRowDetail } = context;
|
|
5277
|
-
return /* @__PURE__ */ (0,
|
|
5488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
5278
5489
|
"li",
|
|
5279
5490
|
{
|
|
5280
5491
|
id: id ? `${id}-card-${getId(data)}` : void 0,
|
|
5281
5492
|
"data-testid": testid ? `${testid}-card-${getId(data)}` : void 0,
|
|
5282
|
-
className: (0,
|
|
5493
|
+
className: (0, import_clsx36.default)(
|
|
5283
5494
|
"hover:bg-action-100 cursor-pointer list-none",
|
|
5284
5495
|
selected ? "bg-action-100" : "bg-background-grouped-primary-normal"
|
|
5285
5496
|
),
|
|
5286
5497
|
onClick: () => openRowDetail(data),
|
|
5287
5498
|
children: [
|
|
5288
|
-
/* @__PURE__ */ (0,
|
|
5289
|
-
/* @__PURE__ */ (0,
|
|
5290
|
-
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)(
|
|
5291
5502
|
Stack,
|
|
5292
5503
|
{
|
|
5293
5504
|
sizing: "component",
|
|
5294
5505
|
padding: true,
|
|
5295
5506
|
width: "fit",
|
|
5296
5507
|
onClick: (e) => e.stopPropagation(),
|
|
5297
|
-
children: /* @__PURE__ */ (0,
|
|
5508
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5298
5509
|
Checkbox,
|
|
5299
5510
|
{
|
|
5300
5511
|
id: id ? `${id}-${getId(data)}-select-checkbox` : void 0,
|
|
@@ -5305,16 +5516,16 @@ function MobileDataGridCard({
|
|
|
5305
5516
|
)
|
|
5306
5517
|
}
|
|
5307
5518
|
),
|
|
5308
|
-
/* @__PURE__ */ (0,
|
|
5519
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5309
5520
|
Stack,
|
|
5310
5521
|
{
|
|
5311
5522
|
sizing: "component",
|
|
5312
5523
|
padding: true,
|
|
5313
5524
|
onClick: (e) => e.stopPropagation(),
|
|
5314
|
-
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 : "") })
|
|
5315
5526
|
}
|
|
5316
5527
|
),
|
|
5317
|
-
/* @__PURE__ */ (0,
|
|
5528
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5318
5529
|
Stack,
|
|
5319
5530
|
{
|
|
5320
5531
|
horizontal: true,
|
|
@@ -5327,18 +5538,18 @@ function MobileDataGridCard({
|
|
|
5327
5538
|
}
|
|
5328
5539
|
)
|
|
5329
5540
|
] }),
|
|
5330
|
-
/* @__PURE__ */ (0,
|
|
5541
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Stack, { sizing: "layout-group", children: visibleColumns.filter((x) => {
|
|
5331
5542
|
var _a2, _b;
|
|
5332
5543
|
return ((_a2 = x.meta) == null ? void 0 : _a2.visible) !== false && !((_b = x.id) == null ? void 0 : _b.startsWith("__"));
|
|
5333
5544
|
}).map(
|
|
5334
5545
|
(column, index) => {
|
|
5335
5546
|
var _a2, _b;
|
|
5336
|
-
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)(
|
|
5337
5548
|
"div",
|
|
5338
5549
|
{
|
|
5339
5550
|
className: "mb-2 grid grid-cols-2 gap-2 px-3 items-center flex-1",
|
|
5340
5551
|
children: [
|
|
5341
|
-
/* @__PURE__ */ (0,
|
|
5552
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
5342
5553
|
Paragraph,
|
|
5343
5554
|
{
|
|
5344
5555
|
color: "text-secondary-normal",
|
|
@@ -5350,7 +5561,7 @@ function MobileDataGridCard({
|
|
|
5350
5561
|
}
|
|
5351
5562
|
),
|
|
5352
5563
|
" ",
|
|
5353
|
-
/* @__PURE__ */ (0,
|
|
5564
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5354
5565
|
column.meta.mobileCell,
|
|
5355
5566
|
{
|
|
5356
5567
|
column,
|
|
@@ -5361,7 +5572,7 @@ function MobileDataGridCard({
|
|
|
5361
5572
|
]
|
|
5362
5573
|
},
|
|
5363
5574
|
`${column.id}-${index}`
|
|
5364
|
-
) : /* @__PURE__ */ (0,
|
|
5575
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5365
5576
|
MobileDataGridColumn,
|
|
5366
5577
|
{
|
|
5367
5578
|
column,
|
|
@@ -5372,14 +5583,14 @@ function MobileDataGridCard({
|
|
|
5372
5583
|
}
|
|
5373
5584
|
) })
|
|
5374
5585
|
] }),
|
|
5375
|
-
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" }) })
|
|
5376
5587
|
]
|
|
5377
5588
|
}
|
|
5378
5589
|
);
|
|
5379
5590
|
}
|
|
5380
5591
|
|
|
5381
5592
|
// src/components/MobileDataGrid/ColumnList.tsx
|
|
5382
|
-
var
|
|
5593
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5383
5594
|
function ColumnList(props) {
|
|
5384
5595
|
const {
|
|
5385
5596
|
withBorder,
|
|
@@ -5391,19 +5602,19 @@ function ColumnList(props) {
|
|
|
5391
5602
|
} = props;
|
|
5392
5603
|
const ctx = useGridContext();
|
|
5393
5604
|
const { id, testid, data, getId, selectedRowIds } = ctx;
|
|
5394
|
-
return /* @__PURE__ */ (0,
|
|
5605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5395
5606
|
"div",
|
|
5396
5607
|
{
|
|
5397
|
-
className: (0,
|
|
5608
|
+
className: (0, import_clsx37.default)(
|
|
5398
5609
|
"flex flex-col flex-1 relative overflow-y-auto overflow-x-hidden",
|
|
5399
5610
|
!!Footer && "mb-20"
|
|
5400
5611
|
),
|
|
5401
|
-
children: /* @__PURE__ */ (0,
|
|
5612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
5402
5613
|
"ul",
|
|
5403
5614
|
{
|
|
5404
5615
|
id,
|
|
5405
5616
|
"data-testid": testid,
|
|
5406
|
-
className: (0,
|
|
5617
|
+
className: (0, import_clsx37.default)(
|
|
5407
5618
|
"rounded absolute top-0 left-0 w-full flex-1",
|
|
5408
5619
|
"divide-y divide-border-primary-normal",
|
|
5409
5620
|
withBorder && "border border-border-primary-normal"
|
|
@@ -5411,7 +5622,7 @@ function ColumnList(props) {
|
|
|
5411
5622
|
children: [
|
|
5412
5623
|
data.map((item) => {
|
|
5413
5624
|
const id2 = getId(item);
|
|
5414
|
-
return /* @__PURE__ */ (0,
|
|
5625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5415
5626
|
MobileDataGridCard,
|
|
5416
5627
|
{
|
|
5417
5628
|
data: item,
|
|
@@ -5424,7 +5635,7 @@ function ColumnList(props) {
|
|
|
5424
5635
|
id2
|
|
5425
5636
|
);
|
|
5426
5637
|
}),
|
|
5427
|
-
!!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)) })
|
|
5428
5639
|
]
|
|
5429
5640
|
}
|
|
5430
5641
|
)
|
|
@@ -5433,7 +5644,7 @@ function ColumnList(props) {
|
|
|
5433
5644
|
}
|
|
5434
5645
|
|
|
5435
5646
|
// src/components/MobileDataGrid/index.tsx
|
|
5436
|
-
var
|
|
5647
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5437
5648
|
function MobileDataGrid(props) {
|
|
5438
5649
|
const {
|
|
5439
5650
|
columns,
|
|
@@ -5455,7 +5666,7 @@ function MobileDataGrid(props) {
|
|
|
5455
5666
|
rowActions,
|
|
5456
5667
|
rounded
|
|
5457
5668
|
} = props;
|
|
5458
|
-
return /* @__PURE__ */ (0,
|
|
5669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
5459
5670
|
GridContextProvider,
|
|
5460
5671
|
{
|
|
5461
5672
|
initialColumns: columns,
|
|
@@ -5467,7 +5678,7 @@ function MobileDataGrid(props) {
|
|
|
5467
5678
|
numberOfColumnsToShow,
|
|
5468
5679
|
primaryKey,
|
|
5469
5680
|
children: [
|
|
5470
|
-
/* @__PURE__ */ (0,
|
|
5681
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
5471
5682
|
Stack,
|
|
5472
5683
|
{
|
|
5473
5684
|
height: "full",
|
|
@@ -5475,7 +5686,7 @@ function MobileDataGrid(props) {
|
|
|
5475
5686
|
overflowX: "hidden",
|
|
5476
5687
|
overflowY: "hidden",
|
|
5477
5688
|
children: [
|
|
5478
|
-
!hideHeader && /* @__PURE__ */ (0,
|
|
5689
|
+
!hideHeader && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5479
5690
|
MobileDataGridHeader,
|
|
5480
5691
|
{
|
|
5481
5692
|
header,
|
|
@@ -5483,7 +5694,7 @@ function MobileDataGrid(props) {
|
|
|
5483
5694
|
enableRowSelection
|
|
5484
5695
|
}
|
|
5485
5696
|
),
|
|
5486
|
-
/* @__PURE__ */ (0,
|
|
5697
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5487
5698
|
ColumnList,
|
|
5488
5699
|
{
|
|
5489
5700
|
withBorder,
|
|
@@ -5497,7 +5708,7 @@ function MobileDataGrid(props) {
|
|
|
5497
5708
|
]
|
|
5498
5709
|
}
|
|
5499
5710
|
),
|
|
5500
|
-
/* @__PURE__ */ (0,
|
|
5711
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(RowDetailModalProvider, {})
|
|
5501
5712
|
]
|
|
5502
5713
|
}
|
|
5503
5714
|
);
|