@dmsi/wedgekit-react 0.0.503 → 0.0.504
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-VOSQMHNF.js → chunk-U5V2IRZX.js} +4 -29
- package/dist/{chunk-S5ZJ3Q7P.js → chunk-VJVY6NPF.js} +3 -3
- package/dist/components/CalendarRange.cjs +75 -128
- package/dist/components/CalendarRange.js +1 -7
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +33 -86
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +1 -7
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +43 -96
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +1 -7
- package/dist/components/DataGrid/PinnedColumns.cjs +58 -111
- package/dist/components/DataGrid/PinnedColumns.js +1 -7
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +34 -87
- package/dist/components/DataGrid/TableBody/LoadingCell.js +1 -7
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +40 -93
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +1 -7
- package/dist/components/DataGrid/TableBody/index.cjs +55 -108
- package/dist/components/DataGrid/TableBody/index.js +1 -7
- package/dist/components/DataGrid/index.cjs +144 -197
- package/dist/components/DataGrid/index.js +1 -7
- package/dist/components/DataGrid/utils.cjs +34 -87
- package/dist/components/DataGrid/utils.js +1 -7
- package/dist/components/DateInput.cjs +94 -147
- package/dist/components/DateInput.js +1 -7
- package/dist/components/DateRangeInput.cjs +94 -147
- package/dist/components/DateRangeInput.js +1 -7
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +41 -94
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +1 -7
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +49 -102
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +1 -7
- package/dist/components/MobileDataGrid/index.cjs +868 -921
- package/dist/components/MobileDataGrid/index.js +1 -7
- package/dist/components/PDFViewer/PDFElement.cjs +5 -31
- package/dist/components/PDFViewer/PDFElement.js +2 -3
- package/dist/components/PDFViewer/PDFPage.cjs +3 -3
- package/dist/components/PDFViewer/PDFPage.js +1 -1
- package/dist/components/PDFViewer/index.cjs +5 -35
- package/dist/components/PDFViewer/index.js +111 -8
- package/dist/components/index.cjs +56 -402
- package/dist/components/index.js +1 -10
- package/package.json +1 -1
- package/src/components/PDFViewer/PDFElement.tsx +3 -38
- package/src/components/PDFViewer/PDFPage.tsx +2 -4
- package/src/components/PDFViewer/index.tsx +1 -9
- package/src/components/index.ts +0 -1
- package/dist/chunk-6XLESQ2U.js +0 -119
- /package/dist/{chunk-C2YTC2CN.js → chunk-JWVZOEF5.js} +0 -0
|
@@ -715,7 +715,7 @@ function Theme({
|
|
|
715
715
|
}
|
|
716
716
|
|
|
717
717
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
718
|
-
var
|
|
718
|
+
var import_react34 = require("react");
|
|
719
719
|
|
|
720
720
|
// src/components/DataGridCell.tsx
|
|
721
721
|
var import_sortable = require("@dnd-kit/sortable");
|
|
@@ -5360,972 +5360,919 @@ var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
|
5360
5360
|
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
5361
5361
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
5362
5362
|
|
|
5363
|
-
// src/components/
|
|
5364
|
-
var
|
|
5365
|
-
|
|
5366
|
-
// src/components/Modal.tsx
|
|
5367
|
-
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
5368
|
-
var import_react29 = require("react");
|
|
5369
|
-
|
|
5370
|
-
// src/components/ModalHeader.tsx
|
|
5363
|
+
// src/components/ListGroup.tsx
|
|
5364
|
+
var import_react28 = require("react");
|
|
5371
5365
|
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
5372
5366
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5367
|
+
|
|
5368
|
+
// src/components/Pagination.tsx
|
|
5369
|
+
var import_react29 = require("react");
|
|
5370
|
+
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
5371
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5372
|
+
var Pagination = ({
|
|
5373
|
+
totalPages,
|
|
5374
|
+
currentPage,
|
|
5375
|
+
onPageChange,
|
|
5379
5376
|
id,
|
|
5380
5377
|
testid,
|
|
5381
|
-
|
|
5382
|
-
|
|
5378
|
+
className,
|
|
5379
|
+
disabled
|
|
5383
5380
|
}) => {
|
|
5384
|
-
const
|
|
5385
|
-
|
|
5386
|
-
|
|
5381
|
+
const goTo = (0, import_react29.useCallback)(
|
|
5382
|
+
(page) => {
|
|
5383
|
+
if (disabled) return;
|
|
5384
|
+
onPageChange(page);
|
|
5385
|
+
},
|
|
5386
|
+
[onPageChange, disabled]
|
|
5387
|
+
);
|
|
5388
|
+
const handleKey = (e) => {
|
|
5389
|
+
if (disabled) return;
|
|
5390
|
+
if (e.key === "ArrowLeft") {
|
|
5391
|
+
e.preventDefault();
|
|
5392
|
+
goTo(currentPage - 1);
|
|
5393
|
+
} else if (e.key === "ArrowRight") {
|
|
5394
|
+
e.preventDefault();
|
|
5395
|
+
goTo(currentPage + 1);
|
|
5396
|
+
}
|
|
5397
|
+
};
|
|
5398
|
+
const pageTokens = (0, import_react29.useMemo)(() => {
|
|
5399
|
+
if (totalPages <= 5) {
|
|
5400
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5401
|
+
}
|
|
5402
|
+
const pages = /* @__PURE__ */ new Set();
|
|
5403
|
+
pages.add(1);
|
|
5404
|
+
pages.add(totalPages);
|
|
5405
|
+
if (currentPage <= 3) {
|
|
5406
|
+
pages.add(2);
|
|
5407
|
+
pages.add(3);
|
|
5408
|
+
pages.add(4);
|
|
5409
|
+
} else if (currentPage >= totalPages - 2) {
|
|
5410
|
+
pages.add(totalPages - 1);
|
|
5411
|
+
pages.add(totalPages - 2);
|
|
5412
|
+
pages.add(totalPages - 3);
|
|
5413
|
+
} else {
|
|
5414
|
+
pages.add(currentPage - 1);
|
|
5415
|
+
pages.add(currentPage);
|
|
5416
|
+
pages.add(currentPage + 1);
|
|
5417
|
+
}
|
|
5418
|
+
const sorted = Array.from(pages).sort((a, b) => a - b);
|
|
5419
|
+
const tokens = [];
|
|
5420
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
5421
|
+
const value = sorted[i];
|
|
5422
|
+
const prev = sorted[i - 1];
|
|
5423
|
+
if (i > 0) {
|
|
5424
|
+
if (value - prev === 2) {
|
|
5425
|
+
tokens.push(prev + 1);
|
|
5426
|
+
} else if (value - prev > 2) {
|
|
5427
|
+
tokens.push("ellipsis");
|
|
5428
|
+
}
|
|
5429
|
+
}
|
|
5430
|
+
tokens.push(value);
|
|
5431
|
+
}
|
|
5432
|
+
return tokens;
|
|
5433
|
+
}, [totalPages, currentPage]);
|
|
5434
|
+
if (totalPages <= 1) return null;
|
|
5435
|
+
const buttonClass = (0, import_clsx31.default)(
|
|
5436
|
+
"cursor-pointer disabled:cursor-default",
|
|
5437
|
+
paddingUsingComponentGap,
|
|
5438
|
+
"w-8 h-8",
|
|
5439
|
+
"flex items-center justify-center",
|
|
5440
|
+
"bg-transparent",
|
|
5441
|
+
"box-content",
|
|
5442
|
+
"hover:bg-background-grouped-secondary-normal",
|
|
5443
|
+
"focus:bg-background-grouped-secondary-normal focus:outline-0",
|
|
5444
|
+
"disabled:bg-transparent disabled:text-text-action-primary-disabled"
|
|
5445
|
+
);
|
|
5446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
5447
|
+
"nav",
|
|
5387
5448
|
{
|
|
5388
5449
|
id,
|
|
5389
5450
|
"data-testid": testid,
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5451
|
+
"aria-label": "Pagination",
|
|
5452
|
+
onKeyDown: handleKey,
|
|
5453
|
+
className: (0, import_clsx31.default)(
|
|
5454
|
+
"flex items-center",
|
|
5455
|
+
"border border-border-primary-normal",
|
|
5456
|
+
"bg-background-grouped-primary-normal",
|
|
5457
|
+
"rounded-sm",
|
|
5458
|
+
className
|
|
5398
5459
|
),
|
|
5399
5460
|
children: [
|
|
5400
|
-
/* @__PURE__ */ (0,
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5461
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5462
|
+
"button",
|
|
5463
|
+
{
|
|
5464
|
+
disabled: disabled || currentPage <= 1,
|
|
5465
|
+
"aria-label": "Previous page",
|
|
5466
|
+
onClick: () => goTo(currentPage - 1),
|
|
5467
|
+
className: (0, import_clsx31.default)(buttonClass, "border-r-1 border-border-primary-normal"),
|
|
5468
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { name: "keyboard_arrow_left" })
|
|
5469
|
+
}
|
|
5470
|
+
),
|
|
5471
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("ul", { className: (0, import_clsx31.default)("flex items-center"), children: pageTokens.map((token, index) => {
|
|
5472
|
+
if (token === "ellipsis") {
|
|
5473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5474
|
+
"li",
|
|
5475
|
+
{
|
|
5476
|
+
className: "w-8 h-8 select-none text-text-action-primary-disabled",
|
|
5477
|
+
children: "\u2026"
|
|
5478
|
+
},
|
|
5479
|
+
`ellipsis-${index}`
|
|
5480
|
+
);
|
|
5481
|
+
}
|
|
5482
|
+
const selected = token === currentPage;
|
|
5483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5484
|
+
"button",
|
|
5404
5485
|
{
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5486
|
+
"aria-label": `Page ${token}`,
|
|
5487
|
+
"aria-current": selected ? "page" : void 0,
|
|
5488
|
+
disabled,
|
|
5489
|
+
onClick: () => goTo(token),
|
|
5490
|
+
className: (0, import_clsx31.default)(
|
|
5491
|
+
buttonClass,
|
|
5492
|
+
selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
|
|
5493
|
+
),
|
|
5494
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Subheader, { align: "center", weight: "bold", children: token })
|
|
5409
5495
|
}
|
|
5410
|
-
)
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5496
|
+
) }, token);
|
|
5497
|
+
}) }),
|
|
5498
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5499
|
+
"button",
|
|
5414
5500
|
{
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
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 }) })
|
|
5501
|
+
disabled: disabled || currentPage >= totalPages,
|
|
5502
|
+
"aria-label": "Next page",
|
|
5503
|
+
onClick: () => goTo(currentPage + 1),
|
|
5504
|
+
className: (0, import_clsx31.default)(buttonClass, "border-l-1 border-border-primary-normal"),
|
|
5505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { name: "keyboard_arrow_right" })
|
|
5421
5506
|
}
|
|
5422
5507
|
)
|
|
5423
5508
|
]
|
|
5424
5509
|
}
|
|
5425
5510
|
);
|
|
5426
5511
|
};
|
|
5427
|
-
|
|
5512
|
+
Pagination.displayName = "Pagination";
|
|
5428
5513
|
|
|
5429
|
-
// src/components/
|
|
5430
|
-
var
|
|
5431
|
-
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5432
|
-
function ModalContent({
|
|
5433
|
-
fixedHeightScrolling,
|
|
5434
|
-
children,
|
|
5435
|
-
id,
|
|
5436
|
-
testid
|
|
5437
|
-
}) {
|
|
5438
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5439
|
-
"div",
|
|
5440
|
-
{
|
|
5441
|
-
id,
|
|
5442
|
-
"data-testid": testid,
|
|
5443
|
-
className: (0, import_clsx31.default)(
|
|
5444
|
-
"flex-grow desktop:flex-grow-0",
|
|
5445
|
-
layoutPaddding,
|
|
5446
|
-
fixedHeightScrolling && "overflow-auto"
|
|
5447
|
-
),
|
|
5448
|
-
children
|
|
5449
|
-
}
|
|
5450
|
-
);
|
|
5451
|
-
}
|
|
5452
|
-
ModalContent.displayName = "ModalContent";
|
|
5514
|
+
// src/components/SkeletonParagraph.tsx
|
|
5515
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5453
5516
|
|
|
5454
|
-
// src/components/
|
|
5517
|
+
// src/components/EmptyCartIcon.tsx
|
|
5518
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5519
|
+
|
|
5520
|
+
// src/components/SearchResultImage/index.tsx
|
|
5521
|
+
var import_react30 = require("react");
|
|
5522
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5523
|
+
|
|
5524
|
+
// src/components/Alert.tsx
|
|
5455
5525
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
5456
|
-
var
|
|
5457
|
-
var
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5526
|
+
var import_react31 = require("react");
|
|
5527
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5528
|
+
|
|
5529
|
+
// src/components/OrderCheckIcon.tsx
|
|
5530
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5531
|
+
|
|
5532
|
+
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5533
|
+
var import_react33 = require("react");
|
|
5534
|
+
|
|
5535
|
+
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5536
|
+
var import_react32 = require("react");
|
|
5537
|
+
var GridContext = (0, import_react32.createContext)(null);
|
|
5538
|
+
|
|
5539
|
+
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5540
|
+
function useGridContext() {
|
|
5541
|
+
const ctx = (0, import_react33.useContext)(GridContext);
|
|
5542
|
+
if (!ctx) {
|
|
5543
|
+
throw new Error("useGridContext must be used within GridContextProvider");
|
|
5544
|
+
}
|
|
5545
|
+
return ctx;
|
|
5546
|
+
}
|
|
5547
|
+
|
|
5548
|
+
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5549
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5550
|
+
function ColumnSelector() {
|
|
5551
|
+
const context = useGridContext();
|
|
5552
|
+
const ref = (0, import_react34.useRef)(null);
|
|
5553
|
+
const [show, setShow] = (0, import_react34.useState)(false);
|
|
5554
|
+
const {
|
|
5555
|
+
columns,
|
|
5556
|
+
id,
|
|
5557
|
+
testid,
|
|
5558
|
+
visibleColumns,
|
|
5559
|
+
numberOfColumnsToShow,
|
|
5560
|
+
primaryKey,
|
|
5561
|
+
resetColumnVisibility,
|
|
5562
|
+
dispatch
|
|
5563
|
+
} = context;
|
|
5564
|
+
const toggleColumnVisibility = (0, import_react34.useCallback)(
|
|
5565
|
+
(index, visible) => {
|
|
5566
|
+
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
5567
|
+
},
|
|
5568
|
+
[dispatch]
|
|
5569
|
+
);
|
|
5570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5465
5571
|
"div",
|
|
5466
5572
|
{
|
|
5467
|
-
id,
|
|
5573
|
+
id: id ? `${id}-column-selector` : void 0,
|
|
5468
5574
|
"data-testid": testid,
|
|
5469
|
-
className:
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
),
|
|
5474
|
-
children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
5475
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5476
|
-
Button,
|
|
5477
|
-
{
|
|
5478
|
-
id: id ? `${id}-close-button` : void 0,
|
|
5479
|
-
testid: testid ? `${testid}-close-button` : void 0,
|
|
5480
|
-
variant: "secondary",
|
|
5481
|
-
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { name: "close", size: 24 }),
|
|
5482
|
-
onClick: onClose,
|
|
5483
|
-
className: "max-sm:w-full",
|
|
5484
|
-
children: "Close"
|
|
5485
|
-
}
|
|
5486
|
-
),
|
|
5487
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5575
|
+
className: "text-text-secondary-normal border-l border-brand-200 p-mobile-container-padding",
|
|
5576
|
+
ref,
|
|
5577
|
+
children: [
|
|
5578
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5488
5579
|
Button,
|
|
5489
5580
|
{
|
|
5490
|
-
id: id ? `${id}-
|
|
5491
|
-
testid: testid ? `${testid}-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5581
|
+
id: id ? `${id}-button` : void 0,
|
|
5582
|
+
testid: testid ? `${testid}-button` : void 0,
|
|
5583
|
+
onClick: () => setShow((prev) => !prev),
|
|
5584
|
+
variant: "navigation",
|
|
5585
|
+
iconOnly: true,
|
|
5586
|
+
size: 24,
|
|
5587
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Icon, { name: "tune" })
|
|
5588
|
+
}
|
|
5589
|
+
),
|
|
5590
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5591
|
+
Menu,
|
|
5592
|
+
{
|
|
5593
|
+
id: id ? `${id}-menu` : void 0,
|
|
5594
|
+
testid: testid ? `${testid}-menu` : void 0,
|
|
5595
|
+
positionTo: ref,
|
|
5596
|
+
position: "bottom-right",
|
|
5597
|
+
show,
|
|
5598
|
+
setShow,
|
|
5599
|
+
calculateMinMaxHeight: true,
|
|
5600
|
+
children: [
|
|
5601
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5602
|
+
Button,
|
|
5603
|
+
{
|
|
5604
|
+
id: id ? `${id}-reset-button` : void 0,
|
|
5605
|
+
testid: testid ? `${testid}-reset-button` : void 0,
|
|
5606
|
+
variant: "tertiary",
|
|
5607
|
+
onClick: () => {
|
|
5608
|
+
resetColumnVisibility();
|
|
5609
|
+
setShow(false);
|
|
5610
|
+
},
|
|
5611
|
+
children: "Reset to default"
|
|
5612
|
+
}
|
|
5613
|
+
),
|
|
5614
|
+
columns.filter((x) => {
|
|
5615
|
+
var _a;
|
|
5616
|
+
return (_a = x.meta) == null ? void 0 : _a.inVisibilityMenu;
|
|
5617
|
+
}).map((column) => {
|
|
5618
|
+
var _a, _b, _c;
|
|
5619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5620
|
+
MenuOption,
|
|
5621
|
+
{
|
|
5622
|
+
testid: testid ? `${testid}-option-${column.id}` : void 0,
|
|
5623
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5624
|
+
Checkbox,
|
|
5625
|
+
{
|
|
5626
|
+
id: id ? `${id}-checkbox-${column.id}` : void 0,
|
|
5627
|
+
testid: testid ? `${testid}-checkbox-${column.id}` : void 0,
|
|
5628
|
+
label: (_a = column.header) == null ? void 0 : _a.toString(),
|
|
5629
|
+
checked: !!((_b = column.meta) == null ? void 0 : _b.visible) || column.id === String(primaryKey),
|
|
5630
|
+
disabled: typeof numberOfColumnsToShow !== "undefined" && // account for header+link occupying one slot
|
|
5631
|
+
visibleColumns.length >= numberOfColumnsToShow - 1 && ((_c = column.meta) == null ? void 0 : _c.visible) !== true || column.id === String(primaryKey),
|
|
5632
|
+
onChange: (e) => {
|
|
5633
|
+
toggleColumnVisibility(
|
|
5634
|
+
columns.findIndex(({ id: id2 }) => id2 === column.id),
|
|
5635
|
+
e.target.checked
|
|
5636
|
+
);
|
|
5637
|
+
}
|
|
5638
|
+
}
|
|
5639
|
+
)
|
|
5640
|
+
},
|
|
5641
|
+
id ? `${id}-option-${column.id}` : void 0
|
|
5642
|
+
);
|
|
5643
|
+
})
|
|
5644
|
+
]
|
|
5497
5645
|
}
|
|
5498
5646
|
)
|
|
5499
|
-
]
|
|
5500
|
-
}
|
|
5501
|
-
);
|
|
5502
|
-
};
|
|
5503
|
-
ModalButtons.displayName = "ModalButtons";
|
|
5504
|
-
|
|
5505
|
-
// src/components/ModalScrim.tsx
|
|
5506
|
-
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
5507
|
-
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5508
|
-
var ModalScrim = ({
|
|
5509
|
-
show = false,
|
|
5510
|
-
size = "small",
|
|
5511
|
-
children,
|
|
5512
|
-
onClick,
|
|
5513
|
-
ref,
|
|
5514
|
-
id,
|
|
5515
|
-
testid
|
|
5516
|
-
}) => {
|
|
5517
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5518
|
-
"div",
|
|
5519
|
-
{
|
|
5520
|
-
id,
|
|
5521
|
-
"data-testid": testid,
|
|
5522
|
-
className: (0, import_clsx33.default)(
|
|
5523
|
-
"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",
|
|
5524
|
-
!show && " pointer-events-none",
|
|
5525
|
-
size === "small" && "p-4",
|
|
5526
|
-
size === "screen" ? "desktop:p-0" : "desktop:p-4",
|
|
5527
|
-
"inset-0 z-50"
|
|
5528
|
-
),
|
|
5529
|
-
onMouseDown: onClick,
|
|
5530
|
-
ref,
|
|
5531
|
-
children
|
|
5647
|
+
]
|
|
5532
5648
|
}
|
|
5533
5649
|
);
|
|
5534
|
-
}
|
|
5535
|
-
ModalScrim.displayName = "ModalScrim";
|
|
5536
|
-
|
|
5537
|
-
// src/components/Modal.tsx
|
|
5538
|
-
var import_react_dom4 = require("react-dom");
|
|
5539
|
-
var import_react_use = require("react-use");
|
|
5540
|
-
|
|
5541
|
-
// src/components/useMounted.tsx
|
|
5542
|
-
var import_react28 = require("react");
|
|
5543
|
-
var useMounted = () => {
|
|
5544
|
-
const [isMounted, setIsMounted] = (0, import_react28.useState)(false);
|
|
5545
|
-
(0, import_react28.useEffect)(() => {
|
|
5546
|
-
setIsMounted(true);
|
|
5547
|
-
return () => setIsMounted(false);
|
|
5548
|
-
}, []);
|
|
5549
|
-
return isMounted;
|
|
5550
|
-
};
|
|
5650
|
+
}
|
|
5551
5651
|
|
|
5552
|
-
// src/components/
|
|
5553
|
-
var
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
);
|
|
5576
|
-
var bgFadeIn = (element, duration = 300) => element.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
5577
|
-
duration,
|
|
5578
|
-
easing: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
5579
|
-
fill: "both"
|
|
5580
|
-
});
|
|
5581
|
-
var bgFadeOut = (element, duration = 200) => element.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
5582
|
-
duration,
|
|
5583
|
-
easing: "ease-in-out",
|
|
5584
|
-
fill: "both"
|
|
5585
|
-
});
|
|
5586
|
-
var whenAllAnimationsFinish = (animations, callback) => {
|
|
5587
|
-
let finishedCount = 0;
|
|
5588
|
-
animations.forEach((animation) => {
|
|
5589
|
-
animation.onfinish = () => {
|
|
5590
|
-
finishedCount += 1;
|
|
5591
|
-
if (finishedCount === animations.length) {
|
|
5592
|
-
callback();
|
|
5593
|
-
}
|
|
5594
|
-
};
|
|
5595
|
-
});
|
|
5596
|
-
};
|
|
5597
|
-
var sizes = {
|
|
5598
|
-
small: {
|
|
5599
|
-
sizeClass: "max-h-screen desktop:max-w-120 rounded-sm"
|
|
5600
|
-
},
|
|
5601
|
-
medium: {
|
|
5602
|
-
sizeClass: "desktop:max-w-180 w-screen desktop:h-fit h-screen desktop:w-full max-w-240"
|
|
5603
|
-
},
|
|
5604
|
-
large: {
|
|
5605
|
-
sizeClass: "desktop:max-w-240 w-screen desktop:h-fit h-screen desktop:w-full max-w-240"
|
|
5606
|
-
},
|
|
5607
|
-
"x-large": {
|
|
5608
|
-
sizeClass: "desktop:max-w-300 w-screen desktop:h-fit h-screen desktop:w-full max-w-240"
|
|
5609
|
-
},
|
|
5610
|
-
screen: {
|
|
5611
|
-
sizeClass: "w-screen h-screen max-w-screen !rounded-none"
|
|
5612
|
-
}
|
|
5613
|
-
};
|
|
5614
|
-
var Modal = ({
|
|
5615
|
-
id,
|
|
5616
|
-
testid,
|
|
5617
|
-
title,
|
|
5618
|
-
open = false,
|
|
5619
|
-
size = "small",
|
|
5620
|
-
className,
|
|
5621
|
-
children,
|
|
5622
|
-
onClose,
|
|
5623
|
-
onContinue,
|
|
5624
|
-
closeOnBackdropClick = true,
|
|
5625
|
-
showButtons = false,
|
|
5626
|
-
hideCloseIcon = false,
|
|
5627
|
-
headerIcon,
|
|
5628
|
-
headerIconAlign,
|
|
5629
|
-
fixedHeightScrolling = false,
|
|
5630
|
-
customActions,
|
|
5631
|
-
headerClassname,
|
|
5632
|
-
customFooter,
|
|
5633
|
-
noWrapper,
|
|
5634
|
-
titleAs: TitleComponent
|
|
5635
|
-
}) => {
|
|
5636
|
-
var _a;
|
|
5637
|
-
const mounted = useMounted();
|
|
5638
|
-
const modalRef = (0, import_react29.useRef)(null);
|
|
5639
|
-
const bgRef = (0, import_react29.useRef)(null);
|
|
5640
|
-
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5641
|
-
const isMobile = useMatchesMobile();
|
|
5642
|
-
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5643
|
-
(0, import_react29.useEffect)(() => {
|
|
5644
|
-
if (!mounted) return;
|
|
5645
|
-
if (!modalRef.current || !bgRef.current) {
|
|
5646
|
-
console.error("Modal or background reference is not set.");
|
|
5647
|
-
return;
|
|
5648
|
-
}
|
|
5649
|
-
if (wasOpen === void 0) return;
|
|
5650
|
-
if (wasOpen && !open) {
|
|
5651
|
-
const modalAnimation = fadeOutScale(modalRef.current);
|
|
5652
|
-
const bgAnimation = bgFadeOut(bgRef.current);
|
|
5653
|
-
whenAllAnimationsFinish([modalAnimation, bgAnimation], () => {
|
|
5654
|
-
if (onClose) {
|
|
5655
|
-
onClose();
|
|
5656
|
-
}
|
|
5657
|
-
});
|
|
5658
|
-
} else if (!wasOpen && open) {
|
|
5659
|
-
fadeInScale(modalRef.current);
|
|
5660
|
-
bgFadeIn(bgRef.current);
|
|
5661
|
-
}
|
|
5662
|
-
}, [mounted, onClose, open, wasOpen]);
|
|
5663
|
-
const handleKeyDown = (0, import_react29.useCallback)(
|
|
5664
|
-
(e) => {
|
|
5665
|
-
if (e.key === "Escape") {
|
|
5666
|
-
if (onClose) {
|
|
5667
|
-
e.preventDefault();
|
|
5668
|
-
onClose();
|
|
5669
|
-
}
|
|
5670
|
-
}
|
|
5671
|
-
},
|
|
5672
|
-
[onClose]
|
|
5673
|
-
);
|
|
5674
|
-
const handleClose = (0, import_react29.useCallback)(() => {
|
|
5675
|
-
if (onClose) {
|
|
5676
|
-
onClose();
|
|
5677
|
-
}
|
|
5678
|
-
}, [onClose]);
|
|
5679
|
-
(0, import_react29.useEffect)(() => {
|
|
5680
|
-
if (open) {
|
|
5681
|
-
document.addEventListener("keyup", handleKeyDown);
|
|
5682
|
-
}
|
|
5683
|
-
return () => {
|
|
5684
|
-
document.removeEventListener("keyup", handleKeyDown);
|
|
5685
|
-
};
|
|
5686
|
-
}, [open, handleKeyDown]);
|
|
5687
|
-
(0, import_react29.useEffect)(() => {
|
|
5688
|
-
if (!open) return;
|
|
5689
|
-
const scrollY = window.scrollY;
|
|
5690
|
-
const body = document.body;
|
|
5691
|
-
body.style.position = "fixed";
|
|
5692
|
-
body.style.top = `-${scrollY}px`;
|
|
5693
|
-
body.style.left = "0";
|
|
5694
|
-
body.style.right = "0";
|
|
5695
|
-
body.style.overflow = "hidden";
|
|
5696
|
-
body.style.width = "100%";
|
|
5697
|
-
return () => {
|
|
5698
|
-
body.style.position = "";
|
|
5699
|
-
body.style.top = "";
|
|
5700
|
-
body.style.left = "";
|
|
5701
|
-
body.style.right = "";
|
|
5702
|
-
body.style.overflow = "";
|
|
5703
|
-
body.style.width = "";
|
|
5704
|
-
window.scrollTo(0, scrollY);
|
|
5705
|
-
};
|
|
5706
|
-
}, [open]);
|
|
5707
|
-
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5708
|
-
const backgroundClickHandler = (0, import_react29.useCallback)(
|
|
5709
|
-
(e) => {
|
|
5710
|
-
const target = e.target;
|
|
5711
|
-
const currentTarget = e.currentTarget;
|
|
5712
|
-
if (currentTarget.contains(target) && currentTarget !== target) {
|
|
5713
|
-
e.stopPropagation();
|
|
5714
|
-
return;
|
|
5715
|
-
}
|
|
5716
|
-
if (open && closeOnBackdropClick) {
|
|
5717
|
-
handleClose();
|
|
5718
|
-
}
|
|
5719
|
-
},
|
|
5720
|
-
[open, closeOnBackdropClick, handleClose]
|
|
5721
|
-
);
|
|
5722
|
-
if (!mounted) {
|
|
5723
|
-
return null;
|
|
5724
|
-
}
|
|
5725
|
-
return (0, import_react_dom4.createPortal)(
|
|
5726
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5727
|
-
ModalScrim,
|
|
5652
|
+
// src/components/MobileDataGrid/MobileDataGridHeader.tsx
|
|
5653
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5654
|
+
function MobileDataGridHeader({
|
|
5655
|
+
header: Header,
|
|
5656
|
+
enableColumnSelector,
|
|
5657
|
+
enableRowSelection
|
|
5658
|
+
}) {
|
|
5659
|
+
var _a, _b;
|
|
5660
|
+
const ctx = useGridContext();
|
|
5661
|
+
const {
|
|
5662
|
+
id,
|
|
5663
|
+
testid,
|
|
5664
|
+
selectedRowIds,
|
|
5665
|
+
data,
|
|
5666
|
+
primaryKey,
|
|
5667
|
+
columns,
|
|
5668
|
+
handleRowSelectAll
|
|
5669
|
+
} = ctx;
|
|
5670
|
+
if (typeof Header === "undefined" && !primaryKey) return null;
|
|
5671
|
+
if (typeof Header === "function") return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Header, __spreadValues({}, ctx));
|
|
5672
|
+
if (typeof Header === "string" || primaryKey)
|
|
5673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5674
|
+
"div",
|
|
5728
5675
|
{
|
|
5729
|
-
id: id ? `${id}-
|
|
5730
|
-
testid: testid ? `${testid}-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
onClick: backgroundClickHandler,
|
|
5735
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
5736
|
-
"div",
|
|
5676
|
+
id: id ? `${id}-header` : void 0,
|
|
5677
|
+
"data-testid": testid ? `${testid}-header` : void 0,
|
|
5678
|
+
className: "sticky top-0",
|
|
5679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Theme, { theme: "brand", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5680
|
+
Stack,
|
|
5737
5681
|
{
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
className,
|
|
5745
|
-
!(className == null ? void 0 : className.includes("bg-")) && "bg-white",
|
|
5746
|
-
sizeClass
|
|
5747
|
-
),
|
|
5748
|
-
onClick: (e) => e.stopPropagation(),
|
|
5682
|
+
horizontal: true,
|
|
5683
|
+
horizontalMobile: true,
|
|
5684
|
+
items: "center",
|
|
5685
|
+
justify: "between",
|
|
5686
|
+
backgroundColor: "background-primary-normal",
|
|
5687
|
+
style: { borderTopRightRadius: 4, borderTopLeftRadius: 4 },
|
|
5749
5688
|
children: [
|
|
5750
|
-
/* @__PURE__ */ (0,
|
|
5751
|
-
|
|
5752
|
-
{
|
|
5753
|
-
id: id ? `${id}-header` : void 0,
|
|
5754
|
-
testid: testid ? `${testid}-header` : void 0,
|
|
5755
|
-
title,
|
|
5756
|
-
onClose: handleClose,
|
|
5757
|
-
hideCloseIcon,
|
|
5758
|
-
headerIcon,
|
|
5759
|
-
headerIconAlign,
|
|
5760
|
-
headerClassname,
|
|
5761
|
-
titleAs: TitleComponent
|
|
5762
|
-
}
|
|
5763
|
-
),
|
|
5764
|
-
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5765
|
-
ModalContent,
|
|
5689
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit h-full", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5690
|
+
Checkbox,
|
|
5766
5691
|
{
|
|
5767
|
-
id: id ? `${id}-
|
|
5768
|
-
testid: testid ? `${testid}-
|
|
5769
|
-
|
|
5770
|
-
|
|
5692
|
+
id: id ? `${id}-select-all-checkbox` : void 0,
|
|
5693
|
+
testid: testid ? `${testid}-select-all-checkbox` : void 0,
|
|
5694
|
+
checked: selectedRowIds.length === data.length,
|
|
5695
|
+
indeterminate: !!selectedRowIds.length && selectedRowIds.length !== data.length,
|
|
5696
|
+
onChange: handleRowSelectAll
|
|
5771
5697
|
}
|
|
5772
|
-
)
|
|
5773
|
-
|
|
5774
|
-
|
|
5698
|
+
) }),
|
|
5699
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5700
|
+
Stack,
|
|
5775
5701
|
{
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5702
|
+
horizontal: true,
|
|
5703
|
+
horizontalMobile: true,
|
|
5704
|
+
items: "center",
|
|
5705
|
+
sizing: "component",
|
|
5706
|
+
padding: true,
|
|
5707
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.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() })
|
|
5781
5708
|
}
|
|
5782
|
-
)
|
|
5709
|
+
),
|
|
5710
|
+
enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ColumnSelector, {})
|
|
5783
5711
|
]
|
|
5784
5712
|
}
|
|
5785
|
-
)
|
|
5713
|
+
) })
|
|
5786
5714
|
}
|
|
5787
|
-
)
|
|
5788
|
-
|
|
5789
|
-
);
|
|
5790
|
-
};
|
|
5791
|
-
Modal.displayName = "Modal";
|
|
5792
|
-
|
|
5793
|
-
// src/components/PDFViewer/PDFElement.tsx
|
|
5794
|
-
var import_react31 = require("react");
|
|
5795
|
-
|
|
5796
|
-
// src/components/Spinner.tsx
|
|
5797
|
-
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5798
|
-
var Spinner = ({ size = "small", testid }) => {
|
|
5799
|
-
const dimension = size === "large" ? 48 : 24;
|
|
5800
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
5801
|
-
"svg",
|
|
5802
|
-
{
|
|
5803
|
-
"data-testid": testid,
|
|
5804
|
-
width: dimension,
|
|
5805
|
-
height: dimension,
|
|
5806
|
-
viewBox: "0 0 24 24",
|
|
5807
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
5808
|
-
fill: "#1D1E1E",
|
|
5809
|
-
className: "spinner",
|
|
5810
|
-
"aria-label": "Loading",
|
|
5811
|
-
children: [
|
|
5812
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
|
|
5813
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
|
|
5814
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
|
|
5815
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
|
|
5816
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
|
|
5817
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
|
|
5818
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
|
|
5819
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
|
|
5820
|
-
]
|
|
5821
|
-
}
|
|
5822
|
-
);
|
|
5823
|
-
};
|
|
5824
|
-
Spinner.displayName = "Spinner";
|
|
5715
|
+
);
|
|
5716
|
+
}
|
|
5825
5717
|
|
|
5826
|
-
// src/components/
|
|
5827
|
-
var
|
|
5828
|
-
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5718
|
+
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5719
|
+
var import_react35 = require("react");
|
|
5829
5720
|
|
|
5830
|
-
// src/components/
|
|
5831
|
-
|
|
5832
|
-
var
|
|
5721
|
+
// src/components/MobileDataGrid/dataGridReducer.ts
|
|
5722
|
+
function dataGridReducer(state, action) {
|
|
5723
|
+
var _a, _b, _c;
|
|
5724
|
+
const { type, payload } = action;
|
|
5725
|
+
let itemIndex = null;
|
|
5726
|
+
if (action.type === "INSERT" && action.pos === "INDEX")
|
|
5727
|
+
itemIndex = action.index;
|
|
5728
|
+
if (action.type === "UPDATE")
|
|
5729
|
+
itemIndex = (_a = action.index) != null ? _a : state.filter(({ id }) => !!id).findIndex(({ id }) => id === action.id);
|
|
5730
|
+
switch (type) {
|
|
5731
|
+
case "SET":
|
|
5732
|
+
return [...payload];
|
|
5733
|
+
case "UPDATE":
|
|
5734
|
+
if (typeof itemIndex !== "number" || itemIndex < 0)
|
|
5735
|
+
throw new Error("action.(id | index) must be provided.");
|
|
5736
|
+
return [
|
|
5737
|
+
...state.slice(0, itemIndex),
|
|
5738
|
+
__spreadProps(__spreadValues(__spreadValues({}, state[itemIndex]), payload), {
|
|
5739
|
+
meta: __spreadValues(__spreadValues({}, (_b = state[itemIndex].meta) != null ? _b : {}), (_c = payload.meta) != null ? _c : {})
|
|
5740
|
+
}),
|
|
5741
|
+
...state.slice(itemIndex + 1)
|
|
5742
|
+
];
|
|
5743
|
+
default:
|
|
5744
|
+
throw new Error("Action type not implemented.");
|
|
5745
|
+
}
|
|
5746
|
+
}
|
|
5833
5747
|
|
|
5834
|
-
// src/components/
|
|
5835
|
-
var
|
|
5748
|
+
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5749
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5750
|
+
function GridContextProvider(props) {
|
|
5751
|
+
const {
|
|
5752
|
+
initialColumns,
|
|
5753
|
+
id,
|
|
5754
|
+
testid,
|
|
5755
|
+
children,
|
|
5756
|
+
data,
|
|
5757
|
+
numberOfColumnsToShow,
|
|
5758
|
+
primaryKey,
|
|
5759
|
+
getId,
|
|
5760
|
+
onRowSelect
|
|
5761
|
+
} = props;
|
|
5762
|
+
const [columns, dispatch] = (0, import_react35.useReducer)(dataGridReducer, initialColumns);
|
|
5763
|
+
const [selectedRowIds, setSelectedRowIds] = (0, import_react35.useState)([]);
|
|
5764
|
+
const [currentRow, setCurrentRow] = (0, import_react35.useState)(null);
|
|
5765
|
+
const resetColumnVisibility = (0, import_react35.useCallback)(() => {
|
|
5766
|
+
const newColumns = columns.map((column) => {
|
|
5767
|
+
var _a;
|
|
5768
|
+
const initialColumn = initialColumns.find((c) => c.id === column.id);
|
|
5769
|
+
return __spreadProps(__spreadValues({}, column), {
|
|
5770
|
+
meta: __spreadProps(__spreadValues({}, column.meta), {
|
|
5771
|
+
visible: (_a = initialColumn == null ? void 0 : initialColumn.meta) == null ? void 0 : _a.visible
|
|
5772
|
+
})
|
|
5773
|
+
});
|
|
5774
|
+
});
|
|
5775
|
+
dispatch({ type: "SET", payload: newColumns });
|
|
5776
|
+
}, [columns, initialColumns]);
|
|
5777
|
+
const handleRowSelect = (0, import_react35.useCallback)(
|
|
5778
|
+
(item) => {
|
|
5779
|
+
var _a;
|
|
5780
|
+
const rowId = (_a = getId(item)) != null ? _a : "";
|
|
5781
|
+
if (!rowId) return;
|
|
5782
|
+
const nextSelected = selectedRowIds.includes(rowId) ? selectedRowIds.filter((id2) => id2 !== rowId) : [...selectedRowIds, rowId];
|
|
5783
|
+
setSelectedRowIds(nextSelected);
|
|
5784
|
+
if (onRowSelect) onRowSelect(item, nextSelected);
|
|
5785
|
+
},
|
|
5786
|
+
[getId, onRowSelect, selectedRowIds]
|
|
5787
|
+
);
|
|
5788
|
+
const handleRowSelectAll = (0, import_react35.useCallback)(() => {
|
|
5789
|
+
setSelectedRowIds((prev) => {
|
|
5790
|
+
if (prev.length === data.length) {
|
|
5791
|
+
return [];
|
|
5792
|
+
}
|
|
5793
|
+
return data.map(getId).filter((id2) => id2 !== void 0);
|
|
5794
|
+
});
|
|
5795
|
+
}, [data, getId]);
|
|
5796
|
+
const openRowDetail = (0, import_react35.useCallback)((row) => {
|
|
5797
|
+
setCurrentRow(row);
|
|
5798
|
+
}, []);
|
|
5799
|
+
const closeRowDetail = (0, import_react35.useCallback)(() => {
|
|
5800
|
+
setCurrentRow(null);
|
|
5801
|
+
}, []);
|
|
5802
|
+
const visibleColumns = (0, import_react35.useMemo)(() => {
|
|
5803
|
+
const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
|
|
5804
|
+
if (primaryKey) {
|
|
5805
|
+
const pkColumn = columns.find((col) => col.id === String(primaryKey));
|
|
5806
|
+
const otherColumns = columns.filter(
|
|
5807
|
+
(col) => col.id !== String(primaryKey)
|
|
5808
|
+
);
|
|
5809
|
+
const orderedColumns = pkColumn ? [pkColumn, ...otherColumns] : [...otherColumns];
|
|
5810
|
+
return orderedColumns.filter((x) => {
|
|
5811
|
+
var _a;
|
|
5812
|
+
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
5813
|
+
}).slice(0, effectiveLimit);
|
|
5814
|
+
}
|
|
5815
|
+
return columns.filter((x) => {
|
|
5816
|
+
var _a;
|
|
5817
|
+
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
5818
|
+
}).slice(0, effectiveLimit);
|
|
5819
|
+
}, [columns, numberOfColumnsToShow, primaryKey]);
|
|
5820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5821
|
+
GridContext.Provider,
|
|
5822
|
+
{
|
|
5823
|
+
value: {
|
|
5824
|
+
columns,
|
|
5825
|
+
testid,
|
|
5826
|
+
id,
|
|
5827
|
+
data,
|
|
5828
|
+
selectedRowIds,
|
|
5829
|
+
visibleColumns,
|
|
5830
|
+
numberOfColumnsToShow,
|
|
5831
|
+
primaryKey,
|
|
5832
|
+
dispatch,
|
|
5833
|
+
getId,
|
|
5834
|
+
resetColumnVisibility,
|
|
5835
|
+
handleRowSelect,
|
|
5836
|
+
handleRowSelectAll,
|
|
5837
|
+
isRowDetailOpen: !!currentRow,
|
|
5838
|
+
currentRow,
|
|
5839
|
+
openRowDetail,
|
|
5840
|
+
closeRowDetail
|
|
5841
|
+
},
|
|
5842
|
+
children
|
|
5843
|
+
}
|
|
5844
|
+
);
|
|
5845
|
+
}
|
|
5836
5846
|
|
|
5837
|
-
// src/components/
|
|
5838
|
-
var
|
|
5847
|
+
// src/components/Modal.tsx
|
|
5848
|
+
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5849
|
+
var import_react37 = require("react");
|
|
5839
5850
|
|
|
5840
|
-
// src/components/
|
|
5851
|
+
// src/components/ModalHeader.tsx
|
|
5852
|
+
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
5841
5853
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
// src/components/Pagination.tsx
|
|
5849
|
-
var import_react34 = require("react");
|
|
5850
|
-
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5851
|
-
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5852
|
-
var Pagination = ({
|
|
5853
|
-
totalPages,
|
|
5854
|
-
currentPage,
|
|
5855
|
-
onPageChange,
|
|
5854
|
+
var ModalHeader = ({
|
|
5855
|
+
title,
|
|
5856
|
+
hideCloseIcon,
|
|
5857
|
+
headerIcon,
|
|
5858
|
+
headerIconAlign,
|
|
5859
|
+
onClose,
|
|
5856
5860
|
id,
|
|
5857
5861
|
testid,
|
|
5858
|
-
|
|
5859
|
-
|
|
5862
|
+
headerClassname,
|
|
5863
|
+
titleAs: TitleComponent
|
|
5860
5864
|
}) => {
|
|
5861
|
-
const
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
onPageChange(page);
|
|
5865
|
-
},
|
|
5866
|
-
[onPageChange, disabled]
|
|
5867
|
-
);
|
|
5868
|
-
const handleKey = (e) => {
|
|
5869
|
-
if (disabled) return;
|
|
5870
|
-
if (e.key === "ArrowLeft") {
|
|
5871
|
-
e.preventDefault();
|
|
5872
|
-
goTo(currentPage - 1);
|
|
5873
|
-
} else if (e.key === "ArrowRight") {
|
|
5874
|
-
e.preventDefault();
|
|
5875
|
-
goTo(currentPage + 1);
|
|
5876
|
-
}
|
|
5877
|
-
};
|
|
5878
|
-
const pageTokens = (0, import_react34.useMemo)(() => {
|
|
5879
|
-
if (totalPages <= 5) {
|
|
5880
|
-
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5881
|
-
}
|
|
5882
|
-
const pages = /* @__PURE__ */ new Set();
|
|
5883
|
-
pages.add(1);
|
|
5884
|
-
pages.add(totalPages);
|
|
5885
|
-
if (currentPage <= 3) {
|
|
5886
|
-
pages.add(2);
|
|
5887
|
-
pages.add(3);
|
|
5888
|
-
pages.add(4);
|
|
5889
|
-
} else if (currentPage >= totalPages - 2) {
|
|
5890
|
-
pages.add(totalPages - 1);
|
|
5891
|
-
pages.add(totalPages - 2);
|
|
5892
|
-
pages.add(totalPages - 3);
|
|
5893
|
-
} else {
|
|
5894
|
-
pages.add(currentPage - 1);
|
|
5895
|
-
pages.add(currentPage);
|
|
5896
|
-
pages.add(currentPage + 1);
|
|
5897
|
-
}
|
|
5898
|
-
const sorted = Array.from(pages).sort((a, b) => a - b);
|
|
5899
|
-
const tokens = [];
|
|
5900
|
-
for (let i = 0; i < sorted.length; i++) {
|
|
5901
|
-
const value = sorted[i];
|
|
5902
|
-
const prev = sorted[i - 1];
|
|
5903
|
-
if (i > 0) {
|
|
5904
|
-
if (value - prev === 2) {
|
|
5905
|
-
tokens.push(prev + 1);
|
|
5906
|
-
} else if (value - prev > 2) {
|
|
5907
|
-
tokens.push("ellipsis");
|
|
5908
|
-
}
|
|
5909
|
-
}
|
|
5910
|
-
tokens.push(value);
|
|
5911
|
-
}
|
|
5912
|
-
return tokens;
|
|
5913
|
-
}, [totalPages, currentPage]);
|
|
5914
|
-
if (totalPages <= 1) return null;
|
|
5915
|
-
const buttonClass = (0, import_clsx37.default)(
|
|
5916
|
-
"cursor-pointer disabled:cursor-default",
|
|
5917
|
-
paddingUsingComponentGap,
|
|
5918
|
-
"w-8 h-8",
|
|
5919
|
-
"flex items-center justify-center",
|
|
5920
|
-
"bg-transparent",
|
|
5921
|
-
"box-content",
|
|
5922
|
-
"hover:bg-background-grouped-secondary-normal",
|
|
5923
|
-
"focus:bg-background-grouped-secondary-normal focus:outline-0",
|
|
5924
|
-
"disabled:bg-transparent disabled:text-text-action-primary-disabled"
|
|
5925
|
-
);
|
|
5926
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
5927
|
-
"nav",
|
|
5865
|
+
const Title = TitleComponent || Heading2;
|
|
5866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5867
|
+
"div",
|
|
5928
5868
|
{
|
|
5929
5869
|
id,
|
|
5930
5870
|
"data-testid": testid,
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
"
|
|
5935
|
-
"
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5871
|
+
className: (0, import_clsx33.default)(
|
|
5872
|
+
"flex justify-between items-center",
|
|
5873
|
+
headerIconAlign === "center" && "justify-center",
|
|
5874
|
+
headerIconAlign === "right" && "justify-end",
|
|
5875
|
+
headerIconAlign === "left" && "justify-start",
|
|
5876
|
+
layoutPaddding,
|
|
5877
|
+
layoutGroupGap,
|
|
5878
|
+
headerClassname
|
|
5939
5879
|
),
|
|
5940
5880
|
children: [
|
|
5941
|
-
/* @__PURE__ */ (0,
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
"aria-label": "Previous page",
|
|
5946
|
-
onClick: () => goTo(currentPage - 1),
|
|
5947
|
-
className: (0, import_clsx37.default)(buttonClass, "border-r-1 border-border-primary-normal"),
|
|
5948
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { name: "keyboard_arrow_left" })
|
|
5949
|
-
}
|
|
5950
|
-
),
|
|
5951
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("ul", { className: (0, import_clsx37.default)("flex items-center"), children: pageTokens.map((token, index) => {
|
|
5952
|
-
if (token === "ellipsis") {
|
|
5953
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5954
|
-
"li",
|
|
5955
|
-
{
|
|
5956
|
-
className: "w-8 h-8 select-none text-text-action-primary-disabled",
|
|
5957
|
-
children: "\u2026"
|
|
5958
|
-
},
|
|
5959
|
-
`ellipsis-${index}`
|
|
5960
|
-
);
|
|
5961
|
-
}
|
|
5962
|
-
const selected = token === currentPage;
|
|
5963
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5964
|
-
"button",
|
|
5881
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: (0, import_clsx33.default)("flex items-center flex-1", layoutGroupGap), children: [
|
|
5882
|
+
headerIcon,
|
|
5883
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5884
|
+
Title,
|
|
5965
5885
|
{
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
className: (0, import_clsx37.default)(
|
|
5971
|
-
buttonClass,
|
|
5972
|
-
selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
|
|
5973
|
-
),
|
|
5974
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Subheader, { align: "center", weight: "bold", children: token })
|
|
5886
|
+
id: id ? `${id}-title` : void 0,
|
|
5887
|
+
testid: testid ? `${testid}-title` : void 0,
|
|
5888
|
+
as: "p",
|
|
5889
|
+
children: title
|
|
5975
5890
|
}
|
|
5976
|
-
)
|
|
5977
|
-
|
|
5978
|
-
/* @__PURE__ */ (0,
|
|
5979
|
-
|
|
5891
|
+
)
|
|
5892
|
+
] }),
|
|
5893
|
+
!hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5894
|
+
Button,
|
|
5980
5895
|
{
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5896
|
+
id: id ? `${id}-close-button` : void 0,
|
|
5897
|
+
testid: testid ? `${testid}-close-button` : void 0,
|
|
5898
|
+
iconOnly: true,
|
|
5899
|
+
variant: "tertiary",
|
|
5900
|
+
onClick: onClose,
|
|
5901
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Icon, { name: "close", size: 24 }) })
|
|
5986
5902
|
}
|
|
5987
5903
|
)
|
|
5988
5904
|
]
|
|
5989
5905
|
}
|
|
5990
5906
|
);
|
|
5991
5907
|
};
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
// src/components/SkeletonParagraph.tsx
|
|
5995
|
-
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5996
|
-
|
|
5997
|
-
// src/components/EmptyCartIcon.tsx
|
|
5998
|
-
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5999
|
-
|
|
6000
|
-
// src/components/SearchResultImage/index.tsx
|
|
6001
|
-
var import_react35 = require("react");
|
|
6002
|
-
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
6003
|
-
|
|
6004
|
-
// src/components/Alert.tsx
|
|
6005
|
-
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
6006
|
-
var import_react36 = require("react");
|
|
6007
|
-
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6008
|
-
|
|
6009
|
-
// src/components/OrderCheckIcon.tsx
|
|
6010
|
-
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6011
|
-
|
|
6012
|
-
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
6013
|
-
var import_react38 = require("react");
|
|
6014
|
-
|
|
6015
|
-
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
6016
|
-
var import_react37 = require("react");
|
|
6017
|
-
var GridContext = (0, import_react37.createContext)(null);
|
|
5908
|
+
ModalHeader.displayName = "ModalHeader";
|
|
6018
5909
|
|
|
6019
|
-
// src/components/
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
5910
|
+
// src/components/ModalContent.tsx
|
|
5911
|
+
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
5912
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5913
|
+
function ModalContent({
|
|
5914
|
+
fixedHeightScrolling,
|
|
5915
|
+
children,
|
|
5916
|
+
id,
|
|
5917
|
+
testid
|
|
5918
|
+
}) {
|
|
5919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5920
|
+
"div",
|
|
5921
|
+
{
|
|
5922
|
+
id,
|
|
5923
|
+
"data-testid": testid,
|
|
5924
|
+
className: (0, import_clsx34.default)(
|
|
5925
|
+
"flex-grow desktop:flex-grow-0",
|
|
5926
|
+
layoutPaddding,
|
|
5927
|
+
fixedHeightScrolling && "overflow-auto"
|
|
5928
|
+
),
|
|
5929
|
+
children
|
|
5930
|
+
}
|
|
5931
|
+
);
|
|
6026
5932
|
}
|
|
5933
|
+
ModalContent.displayName = "ModalContent";
|
|
6027
5934
|
|
|
6028
|
-
// src/components/
|
|
6029
|
-
var
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
numberOfColumnsToShow,
|
|
6040
|
-
primaryKey,
|
|
6041
|
-
resetColumnVisibility,
|
|
6042
|
-
dispatch
|
|
6043
|
-
} = context;
|
|
6044
|
-
const toggleColumnVisibility = (0, import_react39.useCallback)(
|
|
6045
|
-
(index, visible) => {
|
|
6046
|
-
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
6047
|
-
},
|
|
6048
|
-
[dispatch]
|
|
6049
|
-
);
|
|
6050
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
5935
|
+
// src/components/ModalButtons.tsx
|
|
5936
|
+
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
5937
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5938
|
+
var ModalButtons = ({
|
|
5939
|
+
onClose,
|
|
5940
|
+
onContinue,
|
|
5941
|
+
customActions,
|
|
5942
|
+
id,
|
|
5943
|
+
testid
|
|
5944
|
+
}) => {
|
|
5945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6051
5946
|
"div",
|
|
6052
5947
|
{
|
|
6053
|
-
id
|
|
5948
|
+
id,
|
|
6054
5949
|
"data-testid": testid,
|
|
6055
|
-
className:
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
5950
|
+
className: (0, import_clsx35.default)(
|
|
5951
|
+
"border-t border-neutral-300 flex justify-end",
|
|
5952
|
+
layoutPaddding,
|
|
5953
|
+
layoutGroupGap
|
|
5954
|
+
),
|
|
5955
|
+
children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
5956
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6059
5957
|
Button,
|
|
6060
5958
|
{
|
|
6061
|
-
id: id ? `${id}-button` : void 0,
|
|
6062
|
-
testid: testid ? `${testid}-button` : void 0,
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
5959
|
+
id: id ? `${id}-close-button` : void 0,
|
|
5960
|
+
testid: testid ? `${testid}-close-button` : void 0,
|
|
5961
|
+
variant: "secondary",
|
|
5962
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { name: "close", size: 24 }),
|
|
5963
|
+
onClick: onClose,
|
|
5964
|
+
className: "max-sm:w-full",
|
|
5965
|
+
children: "Close"
|
|
6068
5966
|
}
|
|
6069
5967
|
),
|
|
6070
|
-
/* @__PURE__ */ (0,
|
|
6071
|
-
|
|
5968
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5969
|
+
Button,
|
|
6072
5970
|
{
|
|
6073
|
-
id: id ? `${id}-
|
|
6074
|
-
testid: testid ? `${testid}-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
children: [
|
|
6081
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6082
|
-
Button,
|
|
6083
|
-
{
|
|
6084
|
-
id: id ? `${id}-reset-button` : void 0,
|
|
6085
|
-
testid: testid ? `${testid}-reset-button` : void 0,
|
|
6086
|
-
variant: "tertiary",
|
|
6087
|
-
onClick: () => {
|
|
6088
|
-
resetColumnVisibility();
|
|
6089
|
-
setShow(false);
|
|
6090
|
-
},
|
|
6091
|
-
children: "Reset to default"
|
|
6092
|
-
}
|
|
6093
|
-
),
|
|
6094
|
-
columns.filter((x) => {
|
|
6095
|
-
var _a;
|
|
6096
|
-
return (_a = x.meta) == null ? void 0 : _a.inVisibilityMenu;
|
|
6097
|
-
}).map((column) => {
|
|
6098
|
-
var _a, _b, _c;
|
|
6099
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6100
|
-
MenuOption,
|
|
6101
|
-
{
|
|
6102
|
-
testid: testid ? `${testid}-option-${column.id}` : void 0,
|
|
6103
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6104
|
-
Checkbox,
|
|
6105
|
-
{
|
|
6106
|
-
id: id ? `${id}-checkbox-${column.id}` : void 0,
|
|
6107
|
-
testid: testid ? `${testid}-checkbox-${column.id}` : void 0,
|
|
6108
|
-
label: (_a = column.header) == null ? void 0 : _a.toString(),
|
|
6109
|
-
checked: !!((_b = column.meta) == null ? void 0 : _b.visible) || column.id === String(primaryKey),
|
|
6110
|
-
disabled: typeof numberOfColumnsToShow !== "undefined" && // account for header+link occupying one slot
|
|
6111
|
-
visibleColumns.length >= numberOfColumnsToShow - 1 && ((_c = column.meta) == null ? void 0 : _c.visible) !== true || column.id === String(primaryKey),
|
|
6112
|
-
onChange: (e) => {
|
|
6113
|
-
toggleColumnVisibility(
|
|
6114
|
-
columns.findIndex(({ id: id2 }) => id2 === column.id),
|
|
6115
|
-
e.target.checked
|
|
6116
|
-
);
|
|
6117
|
-
}
|
|
6118
|
-
}
|
|
6119
|
-
)
|
|
6120
|
-
},
|
|
6121
|
-
id ? `${id}-option-${column.id}` : void 0
|
|
6122
|
-
);
|
|
6123
|
-
})
|
|
6124
|
-
]
|
|
5971
|
+
id: id ? `${id}-continue-button` : void 0,
|
|
5972
|
+
testid: testid ? `${testid}-continue-button` : void 0,
|
|
5973
|
+
variant: "primary",
|
|
5974
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { name: "check", size: 24 }),
|
|
5975
|
+
className: "max-sm:w-full",
|
|
5976
|
+
onClick: onContinue,
|
|
5977
|
+
children: "Continue"
|
|
6125
5978
|
}
|
|
6126
5979
|
)
|
|
6127
|
-
]
|
|
5980
|
+
] })
|
|
5981
|
+
}
|
|
5982
|
+
);
|
|
5983
|
+
};
|
|
5984
|
+
ModalButtons.displayName = "ModalButtons";
|
|
5985
|
+
|
|
5986
|
+
// src/components/ModalScrim.tsx
|
|
5987
|
+
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
5988
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5989
|
+
var ModalScrim = ({
|
|
5990
|
+
show = false,
|
|
5991
|
+
size = "small",
|
|
5992
|
+
children,
|
|
5993
|
+
onClick,
|
|
5994
|
+
ref,
|
|
5995
|
+
id,
|
|
5996
|
+
testid
|
|
5997
|
+
}) => {
|
|
5998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5999
|
+
"div",
|
|
6000
|
+
{
|
|
6001
|
+
id,
|
|
6002
|
+
"data-testid": testid,
|
|
6003
|
+
className: (0, import_clsx36.default)(
|
|
6004
|
+
"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",
|
|
6005
|
+
!show && " pointer-events-none",
|
|
6006
|
+
size === "small" && "p-4",
|
|
6007
|
+
size === "screen" ? "desktop:p-0" : "desktop:p-4",
|
|
6008
|
+
"inset-0 z-50"
|
|
6009
|
+
),
|
|
6010
|
+
onMouseDown: onClick,
|
|
6011
|
+
ref,
|
|
6012
|
+
children
|
|
6013
|
+
}
|
|
6014
|
+
);
|
|
6015
|
+
};
|
|
6016
|
+
ModalScrim.displayName = "ModalScrim";
|
|
6017
|
+
|
|
6018
|
+
// src/components/Modal.tsx
|
|
6019
|
+
var import_react_dom4 = require("react-dom");
|
|
6020
|
+
var import_react_use = require("react-use");
|
|
6021
|
+
|
|
6022
|
+
// src/components/useMounted.tsx
|
|
6023
|
+
var import_react36 = require("react");
|
|
6024
|
+
var useMounted = () => {
|
|
6025
|
+
const [isMounted, setIsMounted] = (0, import_react36.useState)(false);
|
|
6026
|
+
(0, import_react36.useEffect)(() => {
|
|
6027
|
+
setIsMounted(true);
|
|
6028
|
+
return () => setIsMounted(false);
|
|
6029
|
+
}, []);
|
|
6030
|
+
return isMounted;
|
|
6031
|
+
};
|
|
6032
|
+
|
|
6033
|
+
// src/components/Modal.tsx
|
|
6034
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
6035
|
+
var fadeInScale = (element, duration = 300) => element.animate(
|
|
6036
|
+
[
|
|
6037
|
+
{ opacity: 0, transform: "scale(0.95)" },
|
|
6038
|
+
{ opacity: 1, transform: "scale(1)" }
|
|
6039
|
+
],
|
|
6040
|
+
{
|
|
6041
|
+
duration,
|
|
6042
|
+
easing: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
6043
|
+
fill: "both"
|
|
6044
|
+
}
|
|
6045
|
+
);
|
|
6046
|
+
var fadeOutScale = (element, duration = 200) => element.animate(
|
|
6047
|
+
[
|
|
6048
|
+
{ opacity: 1, transform: "scale(1)" },
|
|
6049
|
+
{ opacity: 0, transform: "scale(0.95)" }
|
|
6050
|
+
],
|
|
6051
|
+
{
|
|
6052
|
+
duration,
|
|
6053
|
+
easing: "ease-in-out",
|
|
6054
|
+
fill: "both"
|
|
6055
|
+
}
|
|
6056
|
+
);
|
|
6057
|
+
var bgFadeIn = (element, duration = 300) => element.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
6058
|
+
duration,
|
|
6059
|
+
easing: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
6060
|
+
fill: "both"
|
|
6061
|
+
});
|
|
6062
|
+
var bgFadeOut = (element, duration = 200) => element.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
6063
|
+
duration,
|
|
6064
|
+
easing: "ease-in-out",
|
|
6065
|
+
fill: "both"
|
|
6066
|
+
});
|
|
6067
|
+
var whenAllAnimationsFinish = (animations, callback) => {
|
|
6068
|
+
let finishedCount = 0;
|
|
6069
|
+
animations.forEach((animation) => {
|
|
6070
|
+
animation.onfinish = () => {
|
|
6071
|
+
finishedCount += 1;
|
|
6072
|
+
if (finishedCount === animations.length) {
|
|
6073
|
+
callback();
|
|
6074
|
+
}
|
|
6075
|
+
};
|
|
6076
|
+
});
|
|
6077
|
+
};
|
|
6078
|
+
var sizes = {
|
|
6079
|
+
small: {
|
|
6080
|
+
sizeClass: "max-h-screen desktop:max-w-120 rounded-sm"
|
|
6081
|
+
},
|
|
6082
|
+
medium: {
|
|
6083
|
+
sizeClass: "desktop:max-w-180 w-screen desktop:h-fit h-screen desktop:w-full max-w-240"
|
|
6084
|
+
},
|
|
6085
|
+
large: {
|
|
6086
|
+
sizeClass: "desktop:max-w-240 w-screen desktop:h-fit h-screen desktop:w-full max-w-240"
|
|
6087
|
+
},
|
|
6088
|
+
"x-large": {
|
|
6089
|
+
sizeClass: "desktop:max-w-300 w-screen desktop:h-fit h-screen desktop:w-full max-w-240"
|
|
6090
|
+
},
|
|
6091
|
+
screen: {
|
|
6092
|
+
sizeClass: "w-screen h-screen max-w-screen !rounded-none"
|
|
6093
|
+
}
|
|
6094
|
+
};
|
|
6095
|
+
var Modal = ({
|
|
6096
|
+
id,
|
|
6097
|
+
testid,
|
|
6098
|
+
title,
|
|
6099
|
+
open = false,
|
|
6100
|
+
size = "small",
|
|
6101
|
+
className,
|
|
6102
|
+
children,
|
|
6103
|
+
onClose,
|
|
6104
|
+
onContinue,
|
|
6105
|
+
closeOnBackdropClick = true,
|
|
6106
|
+
showButtons = false,
|
|
6107
|
+
hideCloseIcon = false,
|
|
6108
|
+
headerIcon,
|
|
6109
|
+
headerIconAlign,
|
|
6110
|
+
fixedHeightScrolling = false,
|
|
6111
|
+
customActions,
|
|
6112
|
+
headerClassname,
|
|
6113
|
+
customFooter,
|
|
6114
|
+
noWrapper,
|
|
6115
|
+
titleAs: TitleComponent
|
|
6116
|
+
}) => {
|
|
6117
|
+
var _a;
|
|
6118
|
+
const mounted = useMounted();
|
|
6119
|
+
const modalRef = (0, import_react37.useRef)(null);
|
|
6120
|
+
const bgRef = (0, import_react37.useRef)(null);
|
|
6121
|
+
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
6122
|
+
const isMobile = useMatchesMobile();
|
|
6123
|
+
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
6124
|
+
(0, import_react37.useEffect)(() => {
|
|
6125
|
+
if (!mounted) return;
|
|
6126
|
+
if (!modalRef.current || !bgRef.current) {
|
|
6127
|
+
console.error("Modal or background reference is not set.");
|
|
6128
|
+
return;
|
|
6129
|
+
}
|
|
6130
|
+
if (wasOpen === void 0) return;
|
|
6131
|
+
if (wasOpen && !open) {
|
|
6132
|
+
const modalAnimation = fadeOutScale(modalRef.current);
|
|
6133
|
+
const bgAnimation = bgFadeOut(bgRef.current);
|
|
6134
|
+
whenAllAnimationsFinish([modalAnimation, bgAnimation], () => {
|
|
6135
|
+
if (onClose) {
|
|
6136
|
+
onClose();
|
|
6137
|
+
}
|
|
6138
|
+
});
|
|
6139
|
+
} else if (!wasOpen && open) {
|
|
6140
|
+
fadeInScale(modalRef.current);
|
|
6141
|
+
bgFadeIn(bgRef.current);
|
|
6142
|
+
}
|
|
6143
|
+
}, [mounted, onClose, open, wasOpen]);
|
|
6144
|
+
const handleKeyDown = (0, import_react37.useCallback)(
|
|
6145
|
+
(e) => {
|
|
6146
|
+
if (e.key === "Escape") {
|
|
6147
|
+
if (onClose) {
|
|
6148
|
+
e.preventDefault();
|
|
6149
|
+
onClose();
|
|
6150
|
+
}
|
|
6151
|
+
}
|
|
6152
|
+
},
|
|
6153
|
+
[onClose]
|
|
6154
|
+
);
|
|
6155
|
+
const handleClose = (0, import_react37.useCallback)(() => {
|
|
6156
|
+
if (onClose) {
|
|
6157
|
+
onClose();
|
|
6128
6158
|
}
|
|
6159
|
+
}, [onClose]);
|
|
6160
|
+
(0, import_react37.useEffect)(() => {
|
|
6161
|
+
if (open) {
|
|
6162
|
+
document.addEventListener("keyup", handleKeyDown);
|
|
6163
|
+
}
|
|
6164
|
+
return () => {
|
|
6165
|
+
document.removeEventListener("keyup", handleKeyDown);
|
|
6166
|
+
};
|
|
6167
|
+
}, [open, handleKeyDown]);
|
|
6168
|
+
(0, import_react37.useEffect)(() => {
|
|
6169
|
+
if (!open) return;
|
|
6170
|
+
const scrollY = window.scrollY;
|
|
6171
|
+
const body = document.body;
|
|
6172
|
+
body.style.position = "fixed";
|
|
6173
|
+
body.style.top = `-${scrollY}px`;
|
|
6174
|
+
body.style.left = "0";
|
|
6175
|
+
body.style.right = "0";
|
|
6176
|
+
body.style.overflow = "hidden";
|
|
6177
|
+
body.style.width = "100%";
|
|
6178
|
+
return () => {
|
|
6179
|
+
body.style.position = "";
|
|
6180
|
+
body.style.top = "";
|
|
6181
|
+
body.style.left = "";
|
|
6182
|
+
body.style.right = "";
|
|
6183
|
+
body.style.overflow = "";
|
|
6184
|
+
body.style.width = "";
|
|
6185
|
+
window.scrollTo(0, scrollY);
|
|
6186
|
+
};
|
|
6187
|
+
}, [open]);
|
|
6188
|
+
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
6189
|
+
const backgroundClickHandler = (0, import_react37.useCallback)(
|
|
6190
|
+
(e) => {
|
|
6191
|
+
const target = e.target;
|
|
6192
|
+
const currentTarget = e.currentTarget;
|
|
6193
|
+
if (currentTarget.contains(target) && currentTarget !== target) {
|
|
6194
|
+
e.stopPropagation();
|
|
6195
|
+
return;
|
|
6196
|
+
}
|
|
6197
|
+
if (open && closeOnBackdropClick) {
|
|
6198
|
+
handleClose();
|
|
6199
|
+
}
|
|
6200
|
+
},
|
|
6201
|
+
[open, closeOnBackdropClick, handleClose]
|
|
6129
6202
|
);
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
enableColumnSelector,
|
|
6137
|
-
enableRowSelection
|
|
6138
|
-
}) {
|
|
6139
|
-
var _a, _b;
|
|
6140
|
-
const ctx = useGridContext();
|
|
6141
|
-
const {
|
|
6142
|
-
id,
|
|
6143
|
-
testid,
|
|
6144
|
-
selectedRowIds,
|
|
6145
|
-
data,
|
|
6146
|
-
primaryKey,
|
|
6147
|
-
columns,
|
|
6148
|
-
handleRowSelectAll
|
|
6149
|
-
} = ctx;
|
|
6150
|
-
if (typeof Header === "undefined" && !primaryKey) return null;
|
|
6151
|
-
if (typeof Header === "function") return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Header, __spreadValues({}, ctx));
|
|
6152
|
-
if (typeof Header === "string" || primaryKey)
|
|
6153
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6154
|
-
"div",
|
|
6203
|
+
if (!mounted) {
|
|
6204
|
+
return null;
|
|
6205
|
+
}
|
|
6206
|
+
return (0, import_react_dom4.createPortal)(
|
|
6207
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6208
|
+
ModalScrim,
|
|
6155
6209
|
{
|
|
6156
|
-
id: id ? `${id}-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6210
|
+
id: id ? `${id}-scrim` : void 0,
|
|
6211
|
+
testid: testid ? `${testid}-scrim` : void 0,
|
|
6212
|
+
size,
|
|
6213
|
+
ref: bgRef,
|
|
6214
|
+
show: open,
|
|
6215
|
+
onClick: backgroundClickHandler,
|
|
6216
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
6217
|
+
"div",
|
|
6161
6218
|
{
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6219
|
+
id,
|
|
6220
|
+
"data-testid": testid,
|
|
6221
|
+
ref: modalRef,
|
|
6222
|
+
className: (0, import_clsx37.default)(
|
|
6223
|
+
"shadow-md rounded-sm flex flex-col overflow-hidden w-full opacity-0 h-fit",
|
|
6224
|
+
computedFixedHeightScrolling && size !== "screen" && "desktop:max-h-[calc(100vh-32px)] desktop:h-auto",
|
|
6225
|
+
className,
|
|
6226
|
+
!(className == null ? void 0 : className.includes("bg-")) && "bg-white",
|
|
6227
|
+
sizeClass
|
|
6228
|
+
),
|
|
6229
|
+
onClick: (e) => e.stopPropagation(),
|
|
6168
6230
|
children: [
|
|
6169
|
-
|
|
6170
|
-
|
|
6231
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6232
|
+
ModalHeader,
|
|
6171
6233
|
{
|
|
6172
|
-
id: id ? `${id}-
|
|
6173
|
-
testid: testid ? `${testid}-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6234
|
+
id: id ? `${id}-header` : void 0,
|
|
6235
|
+
testid: testid ? `${testid}-header` : void 0,
|
|
6236
|
+
title,
|
|
6237
|
+
onClose: handleClose,
|
|
6238
|
+
hideCloseIcon,
|
|
6239
|
+
headerIcon,
|
|
6240
|
+
headerIconAlign,
|
|
6241
|
+
headerClassname,
|
|
6242
|
+
titleAs: TitleComponent
|
|
6177
6243
|
}
|
|
6178
|
-
)
|
|
6179
|
-
/* @__PURE__ */ (0,
|
|
6180
|
-
|
|
6244
|
+
),
|
|
6245
|
+
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6246
|
+
ModalContent,
|
|
6181
6247
|
{
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
padding: true,
|
|
6187
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime60.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() })
|
|
6248
|
+
id: id ? `${id}-content` : void 0,
|
|
6249
|
+
testid: testid ? `${testid}-content` : void 0,
|
|
6250
|
+
fixedHeightScrolling: computedFixedHeightScrolling,
|
|
6251
|
+
children
|
|
6188
6252
|
}
|
|
6189
|
-
),
|
|
6190
|
-
|
|
6253
|
+
) : children,
|
|
6254
|
+
showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6255
|
+
ModalButtons,
|
|
6256
|
+
{
|
|
6257
|
+
id: id ? `${id}-buttons` : void 0,
|
|
6258
|
+
testid: testid ? `${testid}-buttons` : void 0,
|
|
6259
|
+
onClose: handleClose,
|
|
6260
|
+
onContinue,
|
|
6261
|
+
customActions
|
|
6262
|
+
}
|
|
6263
|
+
) : null
|
|
6191
6264
|
]
|
|
6192
6265
|
}
|
|
6193
|
-
)
|
|
6194
|
-
}
|
|
6195
|
-
);
|
|
6196
|
-
}
|
|
6197
|
-
|
|
6198
|
-
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
6199
|
-
var import_react40 = require("react");
|
|
6200
|
-
|
|
6201
|
-
// src/components/MobileDataGrid/dataGridReducer.ts
|
|
6202
|
-
function dataGridReducer(state, action) {
|
|
6203
|
-
var _a, _b, _c;
|
|
6204
|
-
const { type, payload } = action;
|
|
6205
|
-
let itemIndex = null;
|
|
6206
|
-
if (action.type === "INSERT" && action.pos === "INDEX")
|
|
6207
|
-
itemIndex = action.index;
|
|
6208
|
-
if (action.type === "UPDATE")
|
|
6209
|
-
itemIndex = (_a = action.index) != null ? _a : state.filter(({ id }) => !!id).findIndex(({ id }) => id === action.id);
|
|
6210
|
-
switch (type) {
|
|
6211
|
-
case "SET":
|
|
6212
|
-
return [...payload];
|
|
6213
|
-
case "UPDATE":
|
|
6214
|
-
if (typeof itemIndex !== "number" || itemIndex < 0)
|
|
6215
|
-
throw new Error("action.(id | index) must be provided.");
|
|
6216
|
-
return [
|
|
6217
|
-
...state.slice(0, itemIndex),
|
|
6218
|
-
__spreadProps(__spreadValues(__spreadValues({}, state[itemIndex]), payload), {
|
|
6219
|
-
meta: __spreadValues(__spreadValues({}, (_b = state[itemIndex].meta) != null ? _b : {}), (_c = payload.meta) != null ? _c : {})
|
|
6220
|
-
}),
|
|
6221
|
-
...state.slice(itemIndex + 1)
|
|
6222
|
-
];
|
|
6223
|
-
default:
|
|
6224
|
-
throw new Error("Action type not implemented.");
|
|
6225
|
-
}
|
|
6226
|
-
}
|
|
6227
|
-
|
|
6228
|
-
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
6229
|
-
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
6230
|
-
function GridContextProvider(props) {
|
|
6231
|
-
const {
|
|
6232
|
-
initialColumns,
|
|
6233
|
-
id,
|
|
6234
|
-
testid,
|
|
6235
|
-
children,
|
|
6236
|
-
data,
|
|
6237
|
-
numberOfColumnsToShow,
|
|
6238
|
-
primaryKey,
|
|
6239
|
-
getId,
|
|
6240
|
-
onRowSelect
|
|
6241
|
-
} = props;
|
|
6242
|
-
const [columns, dispatch] = (0, import_react40.useReducer)(dataGridReducer, initialColumns);
|
|
6243
|
-
const [selectedRowIds, setSelectedRowIds] = (0, import_react40.useState)([]);
|
|
6244
|
-
const [currentRow, setCurrentRow] = (0, import_react40.useState)(null);
|
|
6245
|
-
const resetColumnVisibility = (0, import_react40.useCallback)(() => {
|
|
6246
|
-
const newColumns = columns.map((column) => {
|
|
6247
|
-
var _a;
|
|
6248
|
-
const initialColumn = initialColumns.find((c) => c.id === column.id);
|
|
6249
|
-
return __spreadProps(__spreadValues({}, column), {
|
|
6250
|
-
meta: __spreadProps(__spreadValues({}, column.meta), {
|
|
6251
|
-
visible: (_a = initialColumn == null ? void 0 : initialColumn.meta) == null ? void 0 : _a.visible
|
|
6252
|
-
})
|
|
6253
|
-
});
|
|
6254
|
-
});
|
|
6255
|
-
dispatch({ type: "SET", payload: newColumns });
|
|
6256
|
-
}, [columns, initialColumns]);
|
|
6257
|
-
const handleRowSelect = (0, import_react40.useCallback)(
|
|
6258
|
-
(item) => {
|
|
6259
|
-
var _a;
|
|
6260
|
-
const rowId = (_a = getId(item)) != null ? _a : "";
|
|
6261
|
-
if (!rowId) return;
|
|
6262
|
-
const nextSelected = selectedRowIds.includes(rowId) ? selectedRowIds.filter((id2) => id2 !== rowId) : [...selectedRowIds, rowId];
|
|
6263
|
-
setSelectedRowIds(nextSelected);
|
|
6264
|
-
if (onRowSelect) onRowSelect(item, nextSelected);
|
|
6265
|
-
},
|
|
6266
|
-
[getId, onRowSelect, selectedRowIds]
|
|
6267
|
-
);
|
|
6268
|
-
const handleRowSelectAll = (0, import_react40.useCallback)(() => {
|
|
6269
|
-
setSelectedRowIds((prev) => {
|
|
6270
|
-
if (prev.length === data.length) {
|
|
6271
|
-
return [];
|
|
6266
|
+
)
|
|
6272
6267
|
}
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
}, [data, getId]);
|
|
6276
|
-
const openRowDetail = (0, import_react40.useCallback)((row) => {
|
|
6277
|
-
setCurrentRow(row);
|
|
6278
|
-
}, []);
|
|
6279
|
-
const closeRowDetail = (0, import_react40.useCallback)(() => {
|
|
6280
|
-
setCurrentRow(null);
|
|
6281
|
-
}, []);
|
|
6282
|
-
const visibleColumns = (0, import_react40.useMemo)(() => {
|
|
6283
|
-
const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
|
|
6284
|
-
if (primaryKey) {
|
|
6285
|
-
const pkColumn = columns.find((col) => col.id === String(primaryKey));
|
|
6286
|
-
const otherColumns = columns.filter(
|
|
6287
|
-
(col) => col.id !== String(primaryKey)
|
|
6288
|
-
);
|
|
6289
|
-
const orderedColumns = pkColumn ? [pkColumn, ...otherColumns] : [...otherColumns];
|
|
6290
|
-
return orderedColumns.filter((x) => {
|
|
6291
|
-
var _a;
|
|
6292
|
-
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
6293
|
-
}).slice(0, effectiveLimit);
|
|
6294
|
-
}
|
|
6295
|
-
return columns.filter((x) => {
|
|
6296
|
-
var _a;
|
|
6297
|
-
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
6298
|
-
}).slice(0, effectiveLimit);
|
|
6299
|
-
}, [columns, numberOfColumnsToShow, primaryKey]);
|
|
6300
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6301
|
-
GridContext.Provider,
|
|
6302
|
-
{
|
|
6303
|
-
value: {
|
|
6304
|
-
columns,
|
|
6305
|
-
testid,
|
|
6306
|
-
id,
|
|
6307
|
-
data,
|
|
6308
|
-
selectedRowIds,
|
|
6309
|
-
visibleColumns,
|
|
6310
|
-
numberOfColumnsToShow,
|
|
6311
|
-
primaryKey,
|
|
6312
|
-
dispatch,
|
|
6313
|
-
getId,
|
|
6314
|
-
resetColumnVisibility,
|
|
6315
|
-
handleRowSelect,
|
|
6316
|
-
handleRowSelectAll,
|
|
6317
|
-
isRowDetailOpen: !!currentRow,
|
|
6318
|
-
currentRow,
|
|
6319
|
-
openRowDetail,
|
|
6320
|
-
closeRowDetail
|
|
6321
|
-
},
|
|
6322
|
-
children
|
|
6323
|
-
}
|
|
6268
|
+
),
|
|
6269
|
+
findDocumentRoot(bgRef.current)
|
|
6324
6270
|
);
|
|
6325
|
-
}
|
|
6271
|
+
};
|
|
6272
|
+
Modal.displayName = "Modal";
|
|
6326
6273
|
|
|
6327
6274
|
// src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx
|
|
6328
|
-
var
|
|
6275
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
6329
6276
|
function MobileDataGridColumn(props) {
|
|
6330
6277
|
var _a, _b;
|
|
6331
6278
|
const { column, data } = props;
|
|
@@ -6336,8 +6283,8 @@ function MobileDataGridColumn(props) {
|
|
|
6336
6283
|
value = formatDate(value);
|
|
6337
6284
|
}
|
|
6338
6285
|
}
|
|
6339
|
-
return /* @__PURE__ */ (0,
|
|
6340
|
-
/* @__PURE__ */ (0,
|
|
6286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "grid grid-cols-2 gap-2 flex-1", children: [
|
|
6287
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
6341
6288
|
(_b = column.header) == null ? void 0 : _b.toString(),
|
|
6342
6289
|
":"
|
|
6343
6290
|
] }),
|
|
@@ -6347,28 +6294,28 @@ function MobileDataGridColumn(props) {
|
|
|
6347
6294
|
}
|
|
6348
6295
|
|
|
6349
6296
|
// src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx
|
|
6350
|
-
var
|
|
6297
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6351
6298
|
function ModalContent2() {
|
|
6352
6299
|
const context = useGridContext();
|
|
6353
6300
|
const { columns, currentRow } = context;
|
|
6354
6301
|
if (!currentRow) return null;
|
|
6355
|
-
return /* @__PURE__ */ (0,
|
|
6302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Stack, { sizing: "layout-group", children: columns.filter((x) => {
|
|
6356
6303
|
var _a;
|
|
6357
6304
|
return !((_a = x.id) == null ? void 0 : _a.startsWith("__"));
|
|
6358
6305
|
}).map(
|
|
6359
6306
|
(column, index) => {
|
|
6360
6307
|
var _a, _b;
|
|
6361
|
-
return ((_a = column.meta) == null ? void 0 : _a.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0,
|
|
6308
|
+
return ((_a = column.meta) == null ? void 0 : _a.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
6362
6309
|
"div",
|
|
6363
6310
|
{
|
|
6364
6311
|
className: "grid grid-cols-2 gap-2 items-center flex-1",
|
|
6365
6312
|
children: [
|
|
6366
|
-
/* @__PURE__ */ (0,
|
|
6313
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
6367
6314
|
(_b = column.header) == null ? void 0 : _b.toString(),
|
|
6368
6315
|
":"
|
|
6369
6316
|
] }),
|
|
6370
6317
|
" ",
|
|
6371
|
-
/* @__PURE__ */ (0,
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6372
6319
|
column.meta.mobileCell,
|
|
6373
6320
|
{
|
|
6374
6321
|
column,
|
|
@@ -6379,7 +6326,7 @@ function ModalContent2() {
|
|
|
6379
6326
|
]
|
|
6380
6327
|
},
|
|
6381
6328
|
`${column.id}-${index}`
|
|
6382
|
-
) : /* @__PURE__ */ (0,
|
|
6329
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6383
6330
|
MobileDataGridColumn,
|
|
6384
6331
|
{
|
|
6385
6332
|
column,
|
|
@@ -6392,7 +6339,7 @@ function ModalContent2() {
|
|
|
6392
6339
|
}
|
|
6393
6340
|
|
|
6394
6341
|
// src/components/MobileDataGrid/RowDetailModalProvider/index.tsx
|
|
6395
|
-
var
|
|
6342
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6396
6343
|
function RowDetailModalProvider() {
|
|
6397
6344
|
var _a;
|
|
6398
6345
|
const context = useGridContext();
|
|
@@ -6404,7 +6351,7 @@ function RowDetailModalProvider() {
|
|
|
6404
6351
|
primaryKey,
|
|
6405
6352
|
closeRowDetail
|
|
6406
6353
|
} = context;
|
|
6407
|
-
return /* @__PURE__ */ (0,
|
|
6354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6408
6355
|
Modal,
|
|
6409
6356
|
{
|
|
6410
6357
|
fixedHeightScrolling: true,
|
|
@@ -6413,7 +6360,7 @@ function RowDetailModalProvider() {
|
|
|
6413
6360
|
hideCloseIcon: true,
|
|
6414
6361
|
size: "medium",
|
|
6415
6362
|
className: "!p-0",
|
|
6416
|
-
headerIcon: /* @__PURE__ */ (0,
|
|
6363
|
+
headerIcon: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
6417
6364
|
Stack,
|
|
6418
6365
|
{
|
|
6419
6366
|
horizontal: true,
|
|
@@ -6422,8 +6369,8 @@ function RowDetailModalProvider() {
|
|
|
6422
6369
|
justify: "between",
|
|
6423
6370
|
width: "full",
|
|
6424
6371
|
children: [
|
|
6425
|
-
/* @__PURE__ */ (0,
|
|
6426
|
-
/* @__PURE__ */ (0,
|
|
6372
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Heading2, { children: (_a = currentRow == null ? void 0 : currentRow[primaryKey != null ? primaryKey : "id"]) != null ? _a : "Grid Detail" }),
|
|
6373
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6427
6374
|
Button,
|
|
6428
6375
|
{
|
|
6429
6376
|
id: id ? `${id}-open-in-new-button` : void 0,
|
|
@@ -6431,25 +6378,25 @@ function RowDetailModalProvider() {
|
|
|
6431
6378
|
iconOnly: true,
|
|
6432
6379
|
variant: "tertiary",
|
|
6433
6380
|
onClick: closeRowDetail,
|
|
6434
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
6381
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "open_in_new", size: 24 }) })
|
|
6435
6382
|
}
|
|
6436
6383
|
)
|
|
6437
6384
|
]
|
|
6438
6385
|
}
|
|
6439
6386
|
),
|
|
6440
|
-
customActions: /* @__PURE__ */ (0,
|
|
6387
|
+
customActions: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Button, { onClick: closeRowDetail, className: "w-full", children: "Close" }),
|
|
6441
6388
|
showButtons: true,
|
|
6442
|
-
children: /* @__PURE__ */ (0,
|
|
6389
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "bg-white max-h-full flex flex-col flex-grow-1", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ModalContent2, {}) })
|
|
6443
6390
|
}
|
|
6444
6391
|
);
|
|
6445
6392
|
}
|
|
6446
6393
|
|
|
6447
6394
|
// src/components/MobileDataGrid/ColumnList.tsx
|
|
6448
|
-
var
|
|
6395
|
+
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
6449
6396
|
|
|
6450
6397
|
// src/components/MobileDataGrid/MobileDataGridCard/index.tsx
|
|
6451
|
-
var
|
|
6452
|
-
var
|
|
6398
|
+
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
6399
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
6453
6400
|
function MobileDataGridCard({
|
|
6454
6401
|
renderLink,
|
|
6455
6402
|
renderChevron = true,
|
|
@@ -6461,12 +6408,12 @@ function MobileDataGridCard({
|
|
|
6461
6408
|
var _a;
|
|
6462
6409
|
const context = useGridContext();
|
|
6463
6410
|
const { id, testid, visibleColumns, getId, handleRowSelect, openRowDetail } = context;
|
|
6464
|
-
return /* @__PURE__ */ (0,
|
|
6411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
6465
6412
|
"li",
|
|
6466
6413
|
{
|
|
6467
6414
|
id: id ? `${id}-card-${getId(data)}` : void 0,
|
|
6468
6415
|
"data-testid": testid ? `${testid}-card-${getId(data)}` : void 0,
|
|
6469
|
-
className: (0,
|
|
6416
|
+
className: (0, import_clsx38.default)(
|
|
6470
6417
|
"flex flex-col",
|
|
6471
6418
|
"hover:bg-action-100 cursor-pointer list-none",
|
|
6472
6419
|
selected ? "bg-action-100" : "bg-background-grouped-primary-normal",
|
|
@@ -6476,9 +6423,9 @@ function MobileDataGridCard({
|
|
|
6476
6423
|
),
|
|
6477
6424
|
onClick: () => openRowDetail(data),
|
|
6478
6425
|
children: [
|
|
6479
|
-
/* @__PURE__ */ (0,
|
|
6480
|
-
/* @__PURE__ */ (0,
|
|
6481
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
6426
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Stack, { sizing: "component", children: [
|
|
6427
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Stack, { horizontal: true, horizontalMobile: true, items: "center", justify: "between", children: [
|
|
6428
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6482
6429
|
Stack,
|
|
6483
6430
|
{
|
|
6484
6431
|
sizing: "component",
|
|
@@ -6486,7 +6433,7 @@ function MobileDataGridCard({
|
|
|
6486
6433
|
width: "fit",
|
|
6487
6434
|
style: { paddingLeft: 0, paddingRight: 8 },
|
|
6488
6435
|
onClick: (e) => e.stopPropagation(),
|
|
6489
|
-
children: /* @__PURE__ */ (0,
|
|
6436
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6490
6437
|
Checkbox,
|
|
6491
6438
|
{
|
|
6492
6439
|
id: id ? `${id}-${getId(data)}-select-checkbox` : void 0,
|
|
@@ -6497,17 +6444,17 @@ function MobileDataGridCard({
|
|
|
6497
6444
|
)
|
|
6498
6445
|
}
|
|
6499
6446
|
),
|
|
6500
|
-
/* @__PURE__ */ (0,
|
|
6447
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6501
6448
|
Stack,
|
|
6502
6449
|
{
|
|
6503
6450
|
sizing: "component",
|
|
6504
6451
|
padding: true,
|
|
6505
6452
|
onClick: (e) => e.stopPropagation(),
|
|
6506
6453
|
style: { paddingInline: 0 },
|
|
6507
|
-
children: renderLink ? renderLink(data) : /* @__PURE__ */ (0,
|
|
6454
|
+
children: renderLink ? renderLink(data) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Subheader, { children: String((_a = data[context.primaryKey]) != null ? _a : "") })
|
|
6508
6455
|
}
|
|
6509
6456
|
),
|
|
6510
|
-
/* @__PURE__ */ (0,
|
|
6457
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6511
6458
|
Stack,
|
|
6512
6459
|
{
|
|
6513
6460
|
horizontal: true,
|
|
@@ -6520,18 +6467,18 @@ function MobileDataGridCard({
|
|
|
6520
6467
|
}
|
|
6521
6468
|
)
|
|
6522
6469
|
] }),
|
|
6523
|
-
/* @__PURE__ */ (0,
|
|
6470
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Stack, { sizing: "layout-group", children: visibleColumns.filter((x) => {
|
|
6524
6471
|
var _a2, _b;
|
|
6525
6472
|
return ((_a2 = x.meta) == null ? void 0 : _a2.visible) !== false && !((_b = x.id) == null ? void 0 : _b.startsWith("__"));
|
|
6526
6473
|
}).map(
|
|
6527
6474
|
(column, index) => {
|
|
6528
6475
|
var _a2, _b;
|
|
6529
|
-
return ((_a2 = column.meta) == null ? void 0 : _a2.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0,
|
|
6476
|
+
return ((_a2 = column.meta) == null ? void 0 : _a2.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
6530
6477
|
"div",
|
|
6531
6478
|
{
|
|
6532
6479
|
className: "grid grid-cols-2 gap-2 items-center flex-1",
|
|
6533
6480
|
children: [
|
|
6534
|
-
/* @__PURE__ */ (0,
|
|
6481
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
6535
6482
|
Paragraph,
|
|
6536
6483
|
{
|
|
6537
6484
|
color: "text-secondary-normal",
|
|
@@ -6543,7 +6490,7 @@ function MobileDataGridCard({
|
|
|
6543
6490
|
}
|
|
6544
6491
|
),
|
|
6545
6492
|
" ",
|
|
6546
|
-
/* @__PURE__ */ (0,
|
|
6493
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6547
6494
|
column.meta.mobileCell,
|
|
6548
6495
|
{
|
|
6549
6496
|
column,
|
|
@@ -6554,7 +6501,7 @@ function MobileDataGridCard({
|
|
|
6554
6501
|
]
|
|
6555
6502
|
},
|
|
6556
6503
|
`${column.id}-${index}`
|
|
6557
|
-
) : /* @__PURE__ */ (0,
|
|
6504
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6558
6505
|
MobileDataGridColumn,
|
|
6559
6506
|
{
|
|
6560
6507
|
column,
|
|
@@ -6565,14 +6512,14 @@ function MobileDataGridCard({
|
|
|
6565
6512
|
}
|
|
6566
6513
|
) })
|
|
6567
6514
|
] }),
|
|
6568
|
-
renderChevron && /* @__PURE__ */ (0,
|
|
6515
|
+
renderChevron && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Stack, { items: "center", justify: "center", horizontal: true, horizontalMobile: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-icon-primary-normal", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "keyboard_arrow_down" }) }) })
|
|
6569
6516
|
]
|
|
6570
6517
|
}
|
|
6571
6518
|
);
|
|
6572
6519
|
}
|
|
6573
6520
|
|
|
6574
6521
|
// src/components/MobileDataGrid/ColumnList.tsx
|
|
6575
|
-
var
|
|
6522
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6576
6523
|
function ColumnList(props) {
|
|
6577
6524
|
const {
|
|
6578
6525
|
withBorder,
|
|
@@ -6584,19 +6531,19 @@ function ColumnList(props) {
|
|
|
6584
6531
|
} = props;
|
|
6585
6532
|
const ctx = useGridContext();
|
|
6586
6533
|
const { id, testid, data, getId, selectedRowIds } = ctx;
|
|
6587
|
-
return /* @__PURE__ */ (0,
|
|
6534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6588
6535
|
"div",
|
|
6589
6536
|
{
|
|
6590
|
-
className: (0,
|
|
6537
|
+
className: (0, import_clsx39.default)(
|
|
6591
6538
|
"flex flex-col flex-1 relative overflow-y-auto overflow-x-hidden",
|
|
6592
6539
|
!!Footer && "mb-20"
|
|
6593
6540
|
),
|
|
6594
|
-
children: /* @__PURE__ */ (0,
|
|
6541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
6595
6542
|
"ul",
|
|
6596
6543
|
{
|
|
6597
6544
|
id,
|
|
6598
6545
|
"data-testid": testid,
|
|
6599
|
-
className: (0,
|
|
6546
|
+
className: (0, import_clsx39.default)(
|
|
6600
6547
|
"rounded absolute top-0 left-0 w-full flex-1",
|
|
6601
6548
|
"divide-y divide-border-primary-normal",
|
|
6602
6549
|
withBorder && "border border-border-primary-normal"
|
|
@@ -6604,7 +6551,7 @@ function ColumnList(props) {
|
|
|
6604
6551
|
children: [
|
|
6605
6552
|
data.map((item) => {
|
|
6606
6553
|
const id2 = getId(item);
|
|
6607
|
-
return /* @__PURE__ */ (0,
|
|
6554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6608
6555
|
MobileDataGridCard,
|
|
6609
6556
|
{
|
|
6610
6557
|
data: item,
|
|
@@ -6617,7 +6564,7 @@ function ColumnList(props) {
|
|
|
6617
6564
|
id2
|
|
6618
6565
|
);
|
|
6619
6566
|
}),
|
|
6620
|
-
!!Footer && /* @__PURE__ */ (0,
|
|
6567
|
+
!!Footer && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "fixed left-0 right-0 bottom-0 flex flex-col w-full min-h-20", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Footer, __spreadValues({}, ctx)) })
|
|
6621
6568
|
]
|
|
6622
6569
|
}
|
|
6623
6570
|
)
|
|
@@ -6626,7 +6573,7 @@ function ColumnList(props) {
|
|
|
6626
6573
|
}
|
|
6627
6574
|
|
|
6628
6575
|
// src/components/MobileDataGrid/index.tsx
|
|
6629
|
-
var
|
|
6576
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
6630
6577
|
function MobileDataGrid(props) {
|
|
6631
6578
|
const {
|
|
6632
6579
|
columns,
|
|
@@ -6648,7 +6595,7 @@ function MobileDataGrid(props) {
|
|
|
6648
6595
|
rowActions,
|
|
6649
6596
|
rounded
|
|
6650
6597
|
} = props;
|
|
6651
|
-
return /* @__PURE__ */ (0,
|
|
6598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
6652
6599
|
GridContextProvider,
|
|
6653
6600
|
{
|
|
6654
6601
|
initialColumns: columns,
|
|
@@ -6660,7 +6607,7 @@ function MobileDataGrid(props) {
|
|
|
6660
6607
|
numberOfColumnsToShow,
|
|
6661
6608
|
primaryKey,
|
|
6662
6609
|
children: [
|
|
6663
|
-
/* @__PURE__ */ (0,
|
|
6610
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
6664
6611
|
Stack,
|
|
6665
6612
|
{
|
|
6666
6613
|
height: "full",
|
|
@@ -6668,7 +6615,7 @@ function MobileDataGrid(props) {
|
|
|
6668
6615
|
overflowX: "hidden",
|
|
6669
6616
|
overflowY: "hidden",
|
|
6670
6617
|
children: [
|
|
6671
|
-
!hideHeader && /* @__PURE__ */ (0,
|
|
6618
|
+
!hideHeader && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6672
6619
|
MobileDataGridHeader,
|
|
6673
6620
|
{
|
|
6674
6621
|
header,
|
|
@@ -6676,7 +6623,7 @@ function MobileDataGrid(props) {
|
|
|
6676
6623
|
enableRowSelection
|
|
6677
6624
|
}
|
|
6678
6625
|
),
|
|
6679
|
-
/* @__PURE__ */ (0,
|
|
6626
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6680
6627
|
ColumnList,
|
|
6681
6628
|
{
|
|
6682
6629
|
withBorder,
|
|
@@ -6690,7 +6637,7 @@ function MobileDataGrid(props) {
|
|
|
6690
6637
|
]
|
|
6691
6638
|
}
|
|
6692
6639
|
),
|
|
6693
|
-
/* @__PURE__ */ (0,
|
|
6640
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(RowDetailModalProvider, {})
|
|
6694
6641
|
]
|
|
6695
6642
|
}
|
|
6696
6643
|
);
|