@dmsi/wedgekit-react 0.0.25 → 0.0.27
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-KDEPZ6I7.js → chunk-2S2Z3L56.js} +5 -1
- package/dist/{chunk-TU55CHXU.js → chunk-4JLU7TAC.js} +3 -1
- package/dist/{chunk-Z2LOGSGE.js → chunk-4N2PED4P.js} +15 -3
- package/dist/{chunk-U42SKNR6.js → chunk-57WRM337.js} +68 -30
- package/dist/{chunk-ZFGGZXB6.js → chunk-AY7ELVQY.js} +5 -2
- package/dist/{chunk-I2UVVKQI.js → chunk-CHTO7PW4.js} +3 -2
- package/dist/{chunk-WIDBAFBU.js → chunk-FWPJ73IK.js} +3 -1
- package/dist/{chunk-5TLFMKSR.js → chunk-INYI65WW.js} +15 -5
- package/dist/{chunk-TJ44JJCB.js → chunk-J6LETUNM.js} +5 -2
- package/dist/{chunk-T6HZARR7.js → chunk-MZJS2ZAU.js} +6 -3
- package/dist/{chunk-ZCBSLV7U.js → chunk-O4M2GISS.js} +5 -2
- package/dist/{chunk-OUTEIXV4.js → chunk-OUSNH76S.js} +11 -3
- package/dist/{chunk-YDREJNAS.js → chunk-PDDZ5PMY.js} +18 -4
- package/dist/{chunk-4RD5ZF2V.js → chunk-QBIEU25R.js} +10 -4
- package/dist/chunk-QUPHLL7D.js +61 -0
- package/dist/{chunk-OISE6NMA.js → chunk-QV2EFOYF.js} +17 -6
- package/dist/{chunk-YZQNTOIF.js → chunk-QZGUMB7T.js} +10 -5
- package/dist/{chunk-S7R37IUP.js → chunk-S5K22XTH.js} +5 -2
- package/dist/{chunk-GCPJH5R6.js → chunk-S5KPS4IQ.js} +22 -7
- package/dist/{chunk-VELXLFMJ.js → chunk-SAMX4YGM.js} +4 -1
- package/dist/{chunk-TWP6YSFO.js → chunk-SKHSGGO3.js} +14 -6
- package/dist/chunk-TVDFTRGL.js +57 -0
- package/dist/{chunk-N32PXOA5.js → chunk-UT7XCBZF.js} +9 -4
- package/dist/{chunk-L4UM372R.js → chunk-VC3R5EUH.js} +3 -0
- package/dist/{chunk-UIQ733QP.js → chunk-VG4EPHJA.js} +7 -3
- package/dist/components/Breadcrumbs.cjs +29 -9
- package/dist/components/Breadcrumbs.js +29 -9
- package/dist/components/Button.cjs +6 -3
- package/dist/components/Button.js +1 -1
- package/dist/components/CalendarRange.cjs +11 -3
- package/dist/components/CalendarRange.js +1 -1
- package/dist/components/Caption.cjs +53 -9
- package/dist/components/Caption.js +53 -9
- package/dist/components/Checkbox.cjs +15 -6
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/ContentTab.cjs +20 -7
- package/dist/components/ContentTab.js +2 -2
- package/dist/components/ContentTabs.cjs +32 -18
- package/dist/components/ContentTabs.js +14 -13
- package/dist/components/DMSiLogo.cjs +22 -4
- package/dist/components/DMSiLogo.js +9 -5
- package/dist/components/DataGrid.cjs +374 -243
- package/dist/components/DataGrid.js +283 -226
- package/dist/components/DataGridCell.cjs +79 -21
- package/dist/components/DataGridCell.js +7 -7
- package/dist/components/DataTable.cjs +197 -139
- package/dist/components/DataTable.js +197 -139
- package/dist/components/DateInput.cjs +36 -10
- package/dist/components/DateInput.js +7 -3
- package/dist/components/DateRangeInput.cjs +36 -10
- package/dist/components/DateRangeInput.js +7 -3
- package/dist/components/DebugJson.cjs +21 -13
- package/dist/components/DebugJson.js +21 -13
- package/dist/components/Display.cjs +5 -2
- package/dist/components/Display.js +1 -1
- package/dist/components/EditingContext.cjs +4 -1
- package/dist/components/EditingContext.js +4 -1
- package/dist/components/FilterGroup.cjs +102 -32
- package/dist/components/FilterGroup.js +41 -17
- package/dist/components/FullViewportBox.cjs +10 -2
- package/dist/components/FullViewportBox.js +10 -2
- package/dist/components/Grid.cjs +3 -1
- package/dist/components/Grid.js +3 -1
- package/dist/components/Heading.cjs +5 -2
- package/dist/components/Heading.js +1 -1
- package/dist/components/HorizontalDivider.cjs +2 -2
- package/dist/components/HorizontalDivider.js +2 -2
- package/dist/components/Input.cjs +21 -7
- package/dist/components/Input.js +2 -2
- package/dist/components/InputGroup.cjs +13 -6
- package/dist/components/InputGroup.js +9 -5
- package/dist/components/Label.cjs +5 -2
- package/dist/components/Label.js +1 -1
- package/dist/components/List.cjs +3 -2
- package/dist/components/List.js +3 -2
- package/dist/components/LogoAgilityTopBar.cjs +22 -4
- package/dist/components/LogoAgilityTopBar.js +9 -5
- package/dist/components/LogoDMSiTopBar.cjs +22 -4
- package/dist/components/LogoDMSiTopBar.js +1 -1
- package/dist/components/LogoMillworkTopBar.cjs +22 -4
- package/dist/components/LogoMillworkTopBar.js +9 -5
- package/dist/components/MainBar.cjs +2 -0
- package/dist/components/MainBar.js +2 -0
- package/dist/components/Menu.cjs +3 -0
- package/dist/components/Menu.js +1 -1
- package/dist/components/MenuOption.cjs +28 -7
- package/dist/components/MenuOption.js +3 -3
- package/dist/components/MobileDataGrid.cjs +101 -46
- package/dist/components/MobileDataGrid.js +23 -11
- package/dist/components/Modal.cjs +96 -51
- package/dist/components/Modal.js +19 -7
- package/dist/components/ModalButtons.cjs +43 -26
- package/dist/components/ModalButtons.js +2 -2
- package/dist/components/ModalContent.cjs +3 -1
- package/dist/components/ModalContent.js +1 -1
- package/dist/components/ModalHeader.cjs +40 -25
- package/dist/components/ModalHeader.js +3 -3
- package/dist/components/ModalScrim.cjs +3 -1
- package/dist/components/ModalScrim.js +1 -1
- package/dist/components/NavigationTab.cjs +9 -3
- package/dist/components/NavigationTab.js +2 -2
- package/dist/components/NavigationTabs.cjs +15 -7
- package/dist/components/NavigationTabs.js +8 -6
- package/dist/components/NestedMenu.cjs +28 -7
- package/dist/components/NestedMenu.js +3 -3
- package/dist/components/Notification.cjs +84 -38
- package/dist/components/Notification.js +8 -4
- package/dist/components/OptionPill.cjs +24 -6
- package/dist/components/OptionPill.js +3 -3
- package/dist/components/Paragraph.cjs +7 -3
- package/dist/components/Paragraph.js +1 -1
- package/dist/components/Password.cjs +33 -11
- package/dist/components/Password.js +14 -6
- package/dist/components/ProjectBar.cjs +3 -1
- package/dist/components/ProjectBar.js +3 -1
- package/dist/components/Radio.cjs +13 -7
- package/dist/components/Radio.js +7 -5
- package/dist/components/Search.cjs +34 -12
- package/dist/components/Search.js +3 -3
- package/dist/components/Select.cjs +25 -7
- package/dist/components/Select.js +3 -3
- package/dist/components/SideMenu.cjs +6 -1
- package/dist/components/SideMenu.js +6 -1
- package/dist/components/SideMenuGroup.cjs +96 -49
- package/dist/components/SideMenuGroup.js +31 -19
- package/dist/components/SideMenuItem.cjs +99 -43
- package/dist/components/SideMenuItem.js +32 -12
- package/dist/components/Stack.cjs +91 -30
- package/dist/components/Stack.js +1 -1
- package/dist/components/StatusPill.cjs +13 -6
- package/dist/components/StatusPill.js +9 -5
- package/dist/components/Stepper.cjs +35 -17
- package/dist/components/Stepper.js +11 -10
- package/dist/components/Subheader.cjs +5 -2
- package/dist/components/Subheader.js +1 -1
- package/dist/components/Surface.cjs +5 -2
- package/dist/components/Surface.js +5 -2
- package/dist/components/Swatch.cjs +1544 -1308
- package/dist/components/Swatch.js +1469 -1275
- package/dist/components/Textarea.cjs +5 -2
- package/dist/components/Textarea.js +5 -2
- package/dist/components/Theme.cjs +3 -2
- package/dist/components/Theme.js +1 -1
- package/dist/components/Time.cjs +98 -40
- package/dist/components/Time.js +18 -6
- package/dist/components/Toast.cjs +38 -15
- package/dist/components/Toast.js +23 -10
- package/dist/components/Tooltip.cjs +5 -4
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/TopBar.cjs +16 -8
- package/dist/components/TopBar.js +12 -5
- package/package.json +1 -1
- package/src/components/Breadcrumbs.tsx +24 -15
- package/src/components/Button.tsx +7 -3
- package/src/components/CalendarRange.tsx +9 -0
- package/src/components/Caption.tsx +36 -6
- package/src/components/Checkbox.tsx +7 -2
- package/src/components/ContentTab.tsx +13 -3
- package/src/components/ContentTabs.tsx +11 -8
- package/src/components/DMSiLogo.tsx +2 -1
- package/src/components/DataGrid.tsx +85 -23
- package/src/components/DataGridCell.tsx +15 -2
- package/src/components/DataTable.tsx +64 -14
- package/src/components/DateInput.tsx +5 -1
- package/src/components/DateRangeInput.tsx +5 -1
- package/src/components/DebugJson.tsx +7 -3
- package/src/components/Display.tsx +3 -0
- package/src/components/EditingContext.tsx +8 -6
- package/src/components/FilterGroup.tsx +23 -3
- package/src/components/FullViewportBox.tsx +6 -1
- package/src/components/Grid.tsx +3 -0
- package/src/components/Heading.tsx +3 -0
- package/src/components/HorizontalDivider.tsx +4 -2
- package/src/components/Input.tsx +19 -10
- package/src/components/InputGroup.tsx +8 -4
- package/src/components/Label.tsx +3 -0
- package/src/components/Link.tsx +1 -0
- package/src/components/List.tsx +7 -1
- package/src/components/LogoAgilityTopBar.tsx +2 -1
- package/src/components/LogoDMSiTopBar.tsx +2 -1
- package/src/components/LogoMillworkTopBar.tsx +2 -1
- package/src/components/MainBar.tsx +3 -0
- package/src/components/Menu.tsx +3 -0
- package/src/components/MenuOption.tsx +72 -58
- package/src/components/MobileDataGrid.tsx +15 -4
- package/src/components/Modal.tsx +10 -1
- package/src/components/ModalButtons.tsx +12 -1
- package/src/components/ModalContent.tsx +3 -0
- package/src/components/ModalHeader.tsx +16 -6
- package/src/components/ModalScrim.tsx +3 -0
- package/src/components/NavigationTab.tsx +6 -3
- package/src/components/NavigationTabs.tsx +5 -2
- package/src/components/Notification.tsx +4 -0
- package/src/components/OptionPill.tsx +9 -1
- package/src/components/Paragraph.tsx +3 -0
- package/src/components/Password.tsx +9 -3
- package/src/components/ProjectBar.tsx +3 -0
- package/src/components/Radio.tsx +3 -2
- package/src/components/Search.tsx +56 -41
- package/src/components/Select.tsx +6 -1
- package/src/components/SideMenu.tsx +7 -1
- package/src/components/SideMenuGroup.tsx +13 -2
- package/src/components/SideMenuItem.tsx +15 -2
- package/src/components/Stack.tsx +8 -3
- package/src/components/StatusPill.tsx +4 -2
- package/src/components/Stepper.tsx +5 -5
- package/src/components/Subheader.tsx +3 -0
- package/src/components/Surface.tsx +3 -0
- package/src/components/Swatch.tsx +415 -140
- package/src/components/Textarea.tsx +6 -3
- package/src/components/Theme.tsx +3 -1
- package/src/components/Time.tsx +21 -5
- package/src/components/Toast.tsx +29 -14
- package/src/components/Tooltip.tsx +46 -32
- package/src/components/TopBar.tsx +7 -3
- package/dist/chunk-DBYSGYST.js +0 -47
- package/dist/chunk-UK3WG7HQ.js +0 -48
|
@@ -214,7 +214,8 @@ var Button = (_a) => {
|
|
|
214
214
|
children,
|
|
215
215
|
iconOnly = false,
|
|
216
216
|
colorClassName,
|
|
217
|
-
href
|
|
217
|
+
href,
|
|
218
|
+
id
|
|
218
219
|
} = _b, props = __objRest(_b, [
|
|
219
220
|
"variant",
|
|
220
221
|
"as",
|
|
@@ -227,7 +228,8 @@ var Button = (_a) => {
|
|
|
227
228
|
"children",
|
|
228
229
|
"iconOnly",
|
|
229
230
|
"colorClassName",
|
|
230
|
-
"href"
|
|
231
|
+
"href",
|
|
232
|
+
"id"
|
|
231
233
|
]);
|
|
232
234
|
const primaryVariantStyles = variant === "primary" && (0, import_clsx2.default)(
|
|
233
235
|
(colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
|
|
@@ -317,6 +319,7 @@ var Button = (_a) => {
|
|
|
317
319
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
318
320
|
Element,
|
|
319
321
|
__spreadProps(__spreadValues({
|
|
322
|
+
id,
|
|
320
323
|
type: Element === "button" ? "button" : void 0,
|
|
321
324
|
className: buttonClasses
|
|
322
325
|
}, props), {
|
|
@@ -324,7 +327,7 @@ var Button = (_a) => {
|
|
|
324
327
|
href,
|
|
325
328
|
children: [
|
|
326
329
|
leftIcon && leftIcon,
|
|
327
|
-
!iconOnly && children && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: labelClasses, children }),
|
|
330
|
+
!iconOnly && children && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { id: id ? `${id}-label` : void 0, className: labelClasses, children }),
|
|
328
331
|
rightIcon && rightIcon
|
|
329
332
|
]
|
|
330
333
|
})
|
|
@@ -379,7 +382,8 @@ var Paragraph = (_a) => {
|
|
|
379
382
|
tall,
|
|
380
383
|
addOverflow,
|
|
381
384
|
children,
|
|
382
|
-
as = "p"
|
|
385
|
+
as = "p",
|
|
386
|
+
id
|
|
383
387
|
} = _b, props = __objRest(_b, [
|
|
384
388
|
"className",
|
|
385
389
|
"color",
|
|
@@ -388,12 +392,15 @@ var Paragraph = (_a) => {
|
|
|
388
392
|
"tall",
|
|
389
393
|
"addOverflow",
|
|
390
394
|
"children",
|
|
391
|
-
"as"
|
|
395
|
+
"as",
|
|
396
|
+
"id"
|
|
392
397
|
]);
|
|
393
398
|
const Element = as;
|
|
394
399
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
395
400
|
Element,
|
|
396
|
-
__spreadProps(__spreadValues({
|
|
401
|
+
__spreadProps(__spreadValues({
|
|
402
|
+
id
|
|
403
|
+
}, props), {
|
|
397
404
|
className: (0, import_clsx4.default)(
|
|
398
405
|
typography.paragraph,
|
|
399
406
|
className,
|
|
@@ -424,7 +431,8 @@ var Checkbox = (_a) => {
|
|
|
424
431
|
checked,
|
|
425
432
|
onChange,
|
|
426
433
|
indeterminate,
|
|
427
|
-
paragraphClassName
|
|
434
|
+
paragraphClassName,
|
|
435
|
+
id
|
|
428
436
|
} = _b, props = __objRest(_b, [
|
|
429
437
|
"label",
|
|
430
438
|
"error",
|
|
@@ -433,7 +441,8 @@ var Checkbox = (_a) => {
|
|
|
433
441
|
"checked",
|
|
434
442
|
"onChange",
|
|
435
443
|
"indeterminate",
|
|
436
|
-
"paragraphClassName"
|
|
444
|
+
"paragraphClassName",
|
|
445
|
+
"id"
|
|
437
446
|
]);
|
|
438
447
|
const selected = indeterminate || checked;
|
|
439
448
|
const normalClassName = (0, import_clsx5.default)(
|
|
@@ -461,6 +470,8 @@ var Checkbox = (_a) => {
|
|
|
461
470
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
462
471
|
"label",
|
|
463
472
|
{
|
|
473
|
+
id,
|
|
474
|
+
htmlFor: `${id}-input`,
|
|
464
475
|
className: (0, import_clsx5.default)(
|
|
465
476
|
"flex items-center",
|
|
466
477
|
componentGap,
|
|
@@ -472,12 +483,12 @@ var Checkbox = (_a) => {
|
|
|
472
483
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
473
484
|
"input",
|
|
474
485
|
__spreadValues({
|
|
486
|
+
id: id ? `${id}-input` : void 0,
|
|
475
487
|
type: "checkbox",
|
|
476
488
|
className: "sr-only peer",
|
|
477
489
|
disabled,
|
|
478
490
|
checked: selected,
|
|
479
491
|
onChange: handleOnChange,
|
|
480
|
-
id: props.id,
|
|
481
492
|
"data-indeterminate": indeterminate
|
|
482
493
|
}, props)
|
|
483
494
|
),
|
|
@@ -503,6 +514,7 @@ var Checkbox = (_a) => {
|
|
|
503
514
|
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
504
515
|
Paragraph,
|
|
505
516
|
{
|
|
517
|
+
id: id ? `${id}-label` : void 0,
|
|
506
518
|
as: "span",
|
|
507
519
|
padded: true,
|
|
508
520
|
className: (0, import_clsx5.default)(
|
|
@@ -597,18 +609,21 @@ var Label = (_a) => {
|
|
|
597
609
|
padded,
|
|
598
610
|
className,
|
|
599
611
|
color,
|
|
600
|
-
align
|
|
612
|
+
align,
|
|
613
|
+
id
|
|
601
614
|
} = _b, props = __objRest(_b, [
|
|
602
615
|
"as",
|
|
603
616
|
"padded",
|
|
604
617
|
"className",
|
|
605
618
|
"color",
|
|
606
|
-
"align"
|
|
619
|
+
"align",
|
|
620
|
+
"id"
|
|
607
621
|
]);
|
|
608
622
|
const Element = as;
|
|
609
623
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
610
624
|
Element,
|
|
611
625
|
__spreadProps(__spreadValues({
|
|
626
|
+
id,
|
|
612
627
|
className: (0, import_clsx6.default)(
|
|
613
628
|
typography.label,
|
|
614
629
|
align === "left" && "text-left",
|
|
@@ -663,6 +678,7 @@ function formatCurrencyDisplay(value) {
|
|
|
663
678
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
664
679
|
var InputBase = (_a) => {
|
|
665
680
|
var _b = _a, {
|
|
681
|
+
id,
|
|
666
682
|
before,
|
|
667
683
|
after,
|
|
668
684
|
type,
|
|
@@ -679,6 +695,7 @@ var InputBase = (_a) => {
|
|
|
679
695
|
wrapperClassName,
|
|
680
696
|
focus
|
|
681
697
|
} = _b, props = __objRest(_b, [
|
|
698
|
+
"id",
|
|
682
699
|
"before",
|
|
683
700
|
"after",
|
|
684
701
|
"type",
|
|
@@ -700,6 +717,7 @@ var InputBase = (_a) => {
|
|
|
700
717
|
"data-focus": focus || null
|
|
701
718
|
};
|
|
702
719
|
const inputRef = (0, import_react2.useRef)(null);
|
|
720
|
+
const inputId = `${id}-input`;
|
|
703
721
|
(0, import_react2.useEffect)(() => {
|
|
704
722
|
var _a2;
|
|
705
723
|
const input = inputRef.current;
|
|
@@ -740,6 +758,8 @@ var InputBase = (_a) => {
|
|
|
740
758
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
741
759
|
"label",
|
|
742
760
|
{
|
|
761
|
+
id,
|
|
762
|
+
htmlFor: inputId,
|
|
743
763
|
ref: inputContainerRef,
|
|
744
764
|
className: (0, import_clsx7.default)(
|
|
745
765
|
"w-full flex flex-col",
|
|
@@ -753,6 +773,7 @@ var InputBase = (_a) => {
|
|
|
753
773
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
754
774
|
Label,
|
|
755
775
|
{
|
|
776
|
+
id: id ? `${id}-label` : void 0,
|
|
756
777
|
className: (0, import_clsx7.default)(
|
|
757
778
|
props.disabled || props.readOnly ? "cursor-default" : "cursor-pointer"
|
|
758
779
|
),
|
|
@@ -789,7 +810,7 @@ var InputBase = (_a) => {
|
|
|
789
810
|
type,
|
|
790
811
|
required
|
|
791
812
|
}, props), attributes), {
|
|
792
|
-
id:
|
|
813
|
+
id: inputId,
|
|
793
814
|
className: (0, import_clsx7.default)(
|
|
794
815
|
"flex-1 outline-none w-full max-w-full min-h-6 min-w-0",
|
|
795
816
|
"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
@@ -807,7 +828,7 @@ var InputBase = (_a) => {
|
|
|
807
828
|
]
|
|
808
829
|
}
|
|
809
830
|
),
|
|
810
|
-
caption
|
|
831
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { id: id ? `${id}-caption` : void 0, children: caption })
|
|
811
832
|
]
|
|
812
833
|
}
|
|
813
834
|
);
|
|
@@ -821,7 +842,8 @@ var Input = (_a) => {
|
|
|
821
842
|
value: propValue,
|
|
822
843
|
onChange,
|
|
823
844
|
onBlur,
|
|
824
|
-
onClear
|
|
845
|
+
onClear,
|
|
846
|
+
id
|
|
825
847
|
} = _b, props = __objRest(_b, [
|
|
826
848
|
"variant",
|
|
827
849
|
"decimals",
|
|
@@ -830,7 +852,8 @@ var Input = (_a) => {
|
|
|
830
852
|
"value",
|
|
831
853
|
"onChange",
|
|
832
854
|
"onBlur",
|
|
833
|
-
"onClear"
|
|
855
|
+
"onClear",
|
|
856
|
+
"id"
|
|
834
857
|
]);
|
|
835
858
|
const [internalValue, setInternalValue] = (0, import_react2.useState)("");
|
|
836
859
|
const [displayValue, setDisplayValue] = (0, import_react2.useState)("");
|
|
@@ -856,7 +879,9 @@ var Input = (_a) => {
|
|
|
856
879
|
}, [propValue, decimals, variant]);
|
|
857
880
|
const getInputProps = () => {
|
|
858
881
|
var _a2;
|
|
859
|
-
const baseProps = __spreadProps(__spreadValues(__spreadValues({}, props),
|
|
882
|
+
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
883
|
+
id
|
|
884
|
+
}), getDecimalPlaceholder(decimals)), {
|
|
860
885
|
value: propValue
|
|
861
886
|
});
|
|
862
887
|
switch (variant) {
|
|
@@ -903,6 +928,7 @@ var Input = (_a) => {
|
|
|
903
928
|
return hasValue && !props.readOnly ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
904
929
|
Icon,
|
|
905
930
|
{
|
|
931
|
+
id: id ? `${id}-clear-button` : void 0,
|
|
906
932
|
name: "close",
|
|
907
933
|
onClick: handleSearchReset,
|
|
908
934
|
className: "cursor-pointer absolute right-2 bottom-2/4 translate-y-2/4"
|
|
@@ -1034,23 +1060,23 @@ Percentage.displayName = "Percentage";
|
|
|
1034
1060
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1035
1061
|
var Search = (_a) => {
|
|
1036
1062
|
var _b = _a, {
|
|
1063
|
+
id,
|
|
1037
1064
|
label,
|
|
1038
1065
|
error,
|
|
1039
1066
|
children,
|
|
1040
1067
|
readOnly,
|
|
1041
1068
|
renderMenu,
|
|
1042
1069
|
onClick,
|
|
1043
|
-
className,
|
|
1044
1070
|
wrapperClassName,
|
|
1045
1071
|
removeRoundness
|
|
1046
1072
|
} = _b, props = __objRest(_b, [
|
|
1073
|
+
"id",
|
|
1047
1074
|
"label",
|
|
1048
1075
|
"error",
|
|
1049
1076
|
"children",
|
|
1050
1077
|
"readOnly",
|
|
1051
1078
|
"renderMenu",
|
|
1052
1079
|
"onClick",
|
|
1053
|
-
"className",
|
|
1054
1080
|
"wrapperClassName",
|
|
1055
1081
|
"removeRoundness"
|
|
1056
1082
|
]);
|
|
@@ -1073,6 +1099,7 @@ var Search = (_a) => {
|
|
|
1073
1099
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1074
1100
|
Input,
|
|
1075
1101
|
__spreadValues({
|
|
1102
|
+
id,
|
|
1076
1103
|
variant: "search",
|
|
1077
1104
|
inputContainerRef,
|
|
1078
1105
|
ref: inputRef,
|
|
@@ -1096,10 +1123,14 @@ var Search = (_a) => {
|
|
|
1096
1123
|
setShow(true);
|
|
1097
1124
|
if (["ArrowUp", "ArrowDown"].includes(e.key)) {
|
|
1098
1125
|
e.preventDefault();
|
|
1099
|
-
const menu = document.querySelector(
|
|
1126
|
+
const menu = document.querySelector(
|
|
1127
|
+
`[data-menu="${searchMenuName}"]`
|
|
1128
|
+
);
|
|
1100
1129
|
const selectedMenuOption = menu == null ? void 0 : menu.querySelector("[data-selected]");
|
|
1101
1130
|
if (selectedMenuOption) {
|
|
1102
|
-
const allMenuOptions = Array.from(
|
|
1131
|
+
const allMenuOptions = Array.from(
|
|
1132
|
+
(menu == null ? void 0 : menu.querySelectorAll('[role="menuitem"]')) || []
|
|
1133
|
+
);
|
|
1103
1134
|
const currentIndex = allMenuOptions.indexOf(selectedMenuOption);
|
|
1104
1135
|
let targetOption;
|
|
1105
1136
|
if (e.key === "ArrowDown") {
|
|
@@ -1109,7 +1140,9 @@ var Search = (_a) => {
|
|
|
1109
1140
|
}
|
|
1110
1141
|
targetOption == null ? void 0 : targetOption.focus();
|
|
1111
1142
|
} else {
|
|
1112
|
-
const toFocusMenuOption = e.key === "ArrowDown" ? menu == null ? void 0 : menu.querySelector('[role="menuitem"]') : menu == null ? void 0 : menu.querySelector(
|
|
1143
|
+
const toFocusMenuOption = e.key === "ArrowDown" ? menu == null ? void 0 : menu.querySelector('[role="menuitem"]') : menu == null ? void 0 : menu.querySelector(
|
|
1144
|
+
'[role="menuitem"]:last-child'
|
|
1145
|
+
);
|
|
1113
1146
|
toFocusMenuOption == null ? void 0 : toFocusMenuOption.focus();
|
|
1114
1147
|
}
|
|
1115
1148
|
}
|
|
@@ -1121,6 +1154,7 @@ var Search = (_a) => {
|
|
|
1121
1154
|
}, props)
|
|
1122
1155
|
),
|
|
1123
1156
|
renderMenu ? renderMenu({
|
|
1157
|
+
id: `${id}-menu`,
|
|
1124
1158
|
positionTo: inputContainerRef,
|
|
1125
1159
|
show,
|
|
1126
1160
|
setShow,
|
|
@@ -1478,6 +1512,7 @@ function findDocumentRoot(element) {
|
|
|
1478
1512
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1479
1513
|
var Menu = (_a) => {
|
|
1480
1514
|
var _b = _a, {
|
|
1515
|
+
id,
|
|
1481
1516
|
children,
|
|
1482
1517
|
className,
|
|
1483
1518
|
ref,
|
|
@@ -1494,6 +1529,7 @@ var Menu = (_a) => {
|
|
|
1494
1529
|
autoFocusOff,
|
|
1495
1530
|
menuName
|
|
1496
1531
|
} = _b, props = __objRest(_b, [
|
|
1532
|
+
"id",
|
|
1497
1533
|
"children",
|
|
1498
1534
|
"className",
|
|
1499
1535
|
"ref",
|
|
@@ -1573,6 +1609,7 @@ var Menu = (_a) => {
|
|
|
1573
1609
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1574
1610
|
"div",
|
|
1575
1611
|
__spreadProps(__spreadValues({
|
|
1612
|
+
id,
|
|
1576
1613
|
ref: setRefs,
|
|
1577
1614
|
className: (0, import_clsx8.default)(
|
|
1578
1615
|
"shadow-4 rounded-base bg-background-grouped-primary-normal overflow-x-hidden overflow-y-auto flex flex-col outline-0",
|
|
@@ -1707,6 +1744,7 @@ var import_clsx9 = __toESM(require("clsx"), 1);
|
|
|
1707
1744
|
var import_react7 = require("react");
|
|
1708
1745
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1709
1746
|
var MenuOption = ({
|
|
1747
|
+
id,
|
|
1710
1748
|
children,
|
|
1711
1749
|
disabled = false,
|
|
1712
1750
|
variant = "normal",
|
|
@@ -1778,6 +1816,7 @@ var MenuOption = ({
|
|
|
1778
1816
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1779
1817
|
"div",
|
|
1780
1818
|
__spreadProps(__spreadValues({
|
|
1819
|
+
id,
|
|
1781
1820
|
ref: actualRef,
|
|
1782
1821
|
className: (0, import_clsx9.default)(
|
|
1783
1822
|
"flex items-center cursor-pointer w-full text-left relative outline-none",
|
|
@@ -1818,7 +1857,15 @@ var MenuOption = ({
|
|
|
1818
1857
|
onMouseLeave: handleMouseLeave,
|
|
1819
1858
|
"data-submenu-parent": menuId.current,
|
|
1820
1859
|
"data-menu-level": subMenuLevel + 1,
|
|
1821
|
-
children: subMenu({
|
|
1860
|
+
children: subMenu({
|
|
1861
|
+
menuId: menuId.current,
|
|
1862
|
+
positionTo: actualRef,
|
|
1863
|
+
mobilePositionTo,
|
|
1864
|
+
position: "right",
|
|
1865
|
+
subMenuLevel,
|
|
1866
|
+
mobileBackMenuOption,
|
|
1867
|
+
mobileHide: isMobile && activeMenu !== menuId.current
|
|
1868
|
+
})
|
|
1822
1869
|
}
|
|
1823
1870
|
)
|
|
1824
1871
|
] });
|
|
@@ -1837,6 +1884,7 @@ var MenuOption = ({
|
|
|
1837
1884
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1838
1885
|
MenuOption,
|
|
1839
1886
|
{
|
|
1887
|
+
id: id ? `${id}-back` : void 0,
|
|
1840
1888
|
onClick: () => {
|
|
1841
1889
|
closeSubMenuLevel == null ? void 0 : closeSubMenuLevel(currentSubMenuLevel != null ? currentSubMenuLevel : 0);
|
|
1842
1890
|
},
|
|
@@ -1852,7 +1900,10 @@ function highlightMatch(text, searchValue) {
|
|
|
1852
1900
|
if (!searchValue || !searchValue.trim()) {
|
|
1853
1901
|
return text;
|
|
1854
1902
|
}
|
|
1855
|
-
const regex = new RegExp(
|
|
1903
|
+
const regex = new RegExp(
|
|
1904
|
+
`(${searchValue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`,
|
|
1905
|
+
"gi"
|
|
1906
|
+
);
|
|
1856
1907
|
const parts = text.split(regex);
|
|
1857
1908
|
return parts.map(
|
|
1858
1909
|
(part, index) => regex.test(part) ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "font-bold", children: part }, index) : part
|
|
@@ -1864,6 +1915,7 @@ var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
|
1864
1915
|
var DataGridCell = (0, import_react8.memo)(
|
|
1865
1916
|
(_a) => {
|
|
1866
1917
|
var _b = _a, {
|
|
1918
|
+
id,
|
|
1867
1919
|
type = "default",
|
|
1868
1920
|
component = "static",
|
|
1869
1921
|
children,
|
|
@@ -1879,6 +1931,7 @@ var DataGridCell = (0, import_react8.memo)(
|
|
|
1879
1931
|
center,
|
|
1880
1932
|
width
|
|
1881
1933
|
} = _b, props = __objRest(_b, [
|
|
1934
|
+
"id",
|
|
1882
1935
|
"type",
|
|
1883
1936
|
"component",
|
|
1884
1937
|
"children",
|
|
@@ -1960,6 +2013,7 @@ var DataGridCell = (0, import_react8.memo)(
|
|
|
1960
2013
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1961
2014
|
Element,
|
|
1962
2015
|
__spreadProps(__spreadValues({
|
|
2016
|
+
id,
|
|
1963
2017
|
className: (0, import_clsx10.default)("flex", !width && "flex-1"),
|
|
1964
2018
|
style: { width }
|
|
1965
2019
|
}, props), {
|
|
@@ -1987,11 +2041,13 @@ function DraggableCellHeader(_a) {
|
|
|
1987
2041
|
var _b = _a, {
|
|
1988
2042
|
header,
|
|
1989
2043
|
children,
|
|
1990
|
-
locked = false
|
|
2044
|
+
locked = false,
|
|
2045
|
+
id
|
|
1991
2046
|
} = _b, props = __objRest(_b, [
|
|
1992
2047
|
"header",
|
|
1993
2048
|
"children",
|
|
1994
|
-
"locked"
|
|
2049
|
+
"locked",
|
|
2050
|
+
"id"
|
|
1995
2051
|
]);
|
|
1996
2052
|
var _a2;
|
|
1997
2053
|
const { attributes, isDragging, listeners, setNodeRef, transform, node } = (0, import_sortable.useSortable)({
|
|
@@ -2029,6 +2085,7 @@ function DraggableCellHeader(_a) {
|
|
|
2029
2085
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2030
2086
|
DataGridCell,
|
|
2031
2087
|
__spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues({
|
|
2088
|
+
id,
|
|
2032
2089
|
locked,
|
|
2033
2090
|
type: "header",
|
|
2034
2091
|
component: "header",
|
|
@@ -2044,6 +2101,7 @@ function DraggableCellHeader(_a) {
|
|
|
2044
2101
|
header.column.getCanFilter() && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2045
2102
|
Menu,
|
|
2046
2103
|
{
|
|
2104
|
+
id: id ? `${id}-menu` : void 0,
|
|
2047
2105
|
ref: menuRootRef,
|
|
2048
2106
|
positionTo: node,
|
|
2049
2107
|
show: showMenu,
|
|
@@ -2051,12 +2109,16 @@ function DraggableCellHeader(_a) {
|
|
|
2051
2109
|
mobileHide,
|
|
2052
2110
|
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2053
2111
|
MenuOption,
|
|
2054
|
-
__spreadProps(__spreadValues({
|
|
2112
|
+
__spreadProps(__spreadValues({
|
|
2113
|
+
id: id ? `${id}-filter-option` : void 0
|
|
2114
|
+
}, subMenuListeners), {
|
|
2055
2115
|
subMenu: (_b2) => {
|
|
2056
2116
|
var _c = _b2, { menuId, subMenuLevel } = _c, props2 = __objRest(_c, ["menuId", "subMenuLevel"]);
|
|
2057
2117
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2058
2118
|
Menu,
|
|
2059
|
-
__spreadProps(__spreadValues({
|
|
2119
|
+
__spreadProps(__spreadValues({
|
|
2120
|
+
id: id ? `${id}-filter-submenu` : void 0
|
|
2121
|
+
}, props2), {
|
|
2060
2122
|
show: isMenuActive(menuId, subMenuLevel),
|
|
2061
2123
|
ref: (el) => {
|
|
2062
2124
|
registerSubMenu(menuId, el);
|
|
@@ -2065,6 +2127,7 @@ function DraggableCellHeader(_a) {
|
|
|
2065
2127
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: (0, import_clsx10.default)(paddingUsingComponentGap), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2066
2128
|
Search,
|
|
2067
2129
|
{
|
|
2130
|
+
id: id ? `${id}-filter-search` : void 0,
|
|
2068
2131
|
onChange: (event) => {
|
|
2069
2132
|
setFilter(event.target.value);
|
|
2070
2133
|
},
|
|
@@ -2079,6 +2142,7 @@ function DraggableCellHeader(_a) {
|
|
|
2079
2142
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2080
2143
|
MenuOption,
|
|
2081
2144
|
{
|
|
2145
|
+
id: id ? `${id}-filter-contains` : void 0,
|
|
2082
2146
|
onClick: handleFilterFnChange,
|
|
2083
2147
|
before: menuOptionIcon("includesString"),
|
|
2084
2148
|
children: "Contains"
|
|
@@ -2087,6 +2151,7 @@ function DraggableCellHeader(_a) {
|
|
|
2087
2151
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2088
2152
|
MenuOption,
|
|
2089
2153
|
{
|
|
2154
|
+
id: id ? `${id}-filter-startswith` : void 0,
|
|
2090
2155
|
onClick: handleFilterFnChange,
|
|
2091
2156
|
before: menuOptionIcon("startsWith"),
|
|
2092
2157
|
children: "Starts with"
|
|
@@ -2095,6 +2160,7 @@ function DraggableCellHeader(_a) {
|
|
|
2095
2160
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2096
2161
|
MenuOption,
|
|
2097
2162
|
{
|
|
2163
|
+
id: id ? `${id}-filter-endswith` : void 0,
|
|
2098
2164
|
onClick: handleFilterFnChange,
|
|
2099
2165
|
before: menuOptionIcon("endsWith"),
|
|
2100
2166
|
children: "Ends with"
|
|
@@ -2171,6 +2237,7 @@ var import_clsx11 = __toESM(require("clsx"), 1);
|
|
|
2171
2237
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2172
2238
|
var Select = (_a) => {
|
|
2173
2239
|
var _b = _a, {
|
|
2240
|
+
id,
|
|
2174
2241
|
label,
|
|
2175
2242
|
error,
|
|
2176
2243
|
children,
|
|
@@ -2183,6 +2250,7 @@ var Select = (_a) => {
|
|
|
2183
2250
|
displayValue,
|
|
2184
2251
|
value
|
|
2185
2252
|
} = _b, props = __objRest(_b, [
|
|
2253
|
+
"id",
|
|
2186
2254
|
"label",
|
|
2187
2255
|
"error",
|
|
2188
2256
|
"children",
|
|
@@ -2211,6 +2279,7 @@ var Select = (_a) => {
|
|
|
2211
2279
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2212
2280
|
InputBase,
|
|
2213
2281
|
__spreadProps(__spreadValues({
|
|
2282
|
+
id,
|
|
2214
2283
|
inputContainerRef,
|
|
2215
2284
|
ref: inputRef,
|
|
2216
2285
|
label,
|
|
@@ -2250,6 +2319,7 @@ var Select = (_a) => {
|
|
|
2250
2319
|
})
|
|
2251
2320
|
),
|
|
2252
2321
|
renderMenu ? renderMenu({
|
|
2322
|
+
id: `${id}-menu`,
|
|
2253
2323
|
positionTo: inputContainerRef,
|
|
2254
2324
|
show,
|
|
2255
2325
|
setShow,
|
|
@@ -2269,19 +2339,22 @@ var Subheader = (_a) => {
|
|
|
2269
2339
|
as = "span",
|
|
2270
2340
|
align,
|
|
2271
2341
|
color,
|
|
2272
|
-
tall
|
|
2342
|
+
tall,
|
|
2343
|
+
id
|
|
2273
2344
|
} = _b, props = __objRest(_b, [
|
|
2274
2345
|
"className",
|
|
2275
2346
|
"children",
|
|
2276
2347
|
"as",
|
|
2277
2348
|
"align",
|
|
2278
2349
|
"color",
|
|
2279
|
-
"tall"
|
|
2350
|
+
"tall",
|
|
2351
|
+
"id"
|
|
2280
2352
|
]);
|
|
2281
2353
|
const Element = as;
|
|
2282
2354
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2283
2355
|
Element,
|
|
2284
2356
|
__spreadProps(__spreadValues({
|
|
2357
|
+
id,
|
|
2285
2358
|
className: (0, import_clsx12.default)(
|
|
2286
2359
|
typography.subheader,
|
|
2287
2360
|
className,
|
|
@@ -2306,6 +2379,7 @@ var import_react10 = require("react");
|
|
|
2306
2379
|
var import_react_dom2 = require("react-dom");
|
|
2307
2380
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2308
2381
|
var Tooltip = ({
|
|
2382
|
+
id,
|
|
2309
2383
|
message,
|
|
2310
2384
|
position = "top",
|
|
2311
2385
|
children,
|
|
@@ -2314,7 +2388,6 @@ var Tooltip = ({
|
|
|
2314
2388
|
}) => {
|
|
2315
2389
|
const ref = (0, import_react10.useRef)(null);
|
|
2316
2390
|
const tooltipRef = (0, import_react10.useRef)(null);
|
|
2317
|
-
const [isTruncated, setIsTruncated] = (0, import_react10.useState)(false);
|
|
2318
2391
|
const [tooltipPosition, setTooltipPosition] = (0, import_react10.useState)({ top: 0, left: 0 });
|
|
2319
2392
|
const [isVisible, setIsVisible] = (0, import_react10.useState)(false);
|
|
2320
2393
|
const [removeOpacity, setRemoveOpacity] = (0, import_react10.useState)(false);
|
|
@@ -2372,6 +2445,7 @@ var Tooltip = ({
|
|
|
2372
2445
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2373
2446
|
"div",
|
|
2374
2447
|
{
|
|
2448
|
+
id,
|
|
2375
2449
|
ref,
|
|
2376
2450
|
className: "relative inline-grid grid-cols-[auto_1fr] items-center",
|
|
2377
2451
|
onMouseEnter: handleMouseEnter,
|
|
@@ -2382,6 +2456,7 @@ var Tooltip = ({
|
|
|
2382
2456
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2383
2457
|
"div",
|
|
2384
2458
|
{
|
|
2459
|
+
id: id ? `${id}-message` : void 0,
|
|
2385
2460
|
ref: tooltipRef,
|
|
2386
2461
|
style: {
|
|
2387
2462
|
position: "fixed",
|
|
@@ -2407,9 +2482,8 @@ var Tooltip = ({
|
|
|
2407
2482
|
if (showOnTruncation && ref.current) {
|
|
2408
2483
|
const paragraph = ref.current.querySelector("p");
|
|
2409
2484
|
if (paragraph) {
|
|
2410
|
-
const
|
|
2411
|
-
|
|
2412
|
-
return isTruncated2;
|
|
2485
|
+
const isTruncated = paragraph.scrollWidth > paragraph.clientWidth;
|
|
2486
|
+
return isTruncated;
|
|
2413
2487
|
}
|
|
2414
2488
|
}
|
|
2415
2489
|
return false;
|
|
@@ -2462,6 +2536,7 @@ function adaptTableStateSetter(setter) {
|
|
|
2462
2536
|
};
|
|
2463
2537
|
}
|
|
2464
2538
|
function DataGrid({
|
|
2539
|
+
id,
|
|
2465
2540
|
data,
|
|
2466
2541
|
columns,
|
|
2467
2542
|
status,
|
|
@@ -2506,7 +2581,7 @@ function DataGrid({
|
|
|
2506
2581
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
2507
2582
|
(onRowSelectionChange != null ? onRowSelectionChange : setLocalRowSelection)(value);
|
|
2508
2583
|
} : setLocalRowSelection;
|
|
2509
|
-
const
|
|
2584
|
+
const dndId = (0, import_react12.useId)();
|
|
2510
2585
|
const containerRef = import_react12.default.useRef(null);
|
|
2511
2586
|
const [columnVisibility, setColumnVisibility] = (0, import_react12.useState)(() => {
|
|
2512
2587
|
const initialVisibility = {};
|
|
@@ -2519,8 +2594,8 @@ function DataGrid({
|
|
|
2519
2594
|
return initialVisibility;
|
|
2520
2595
|
});
|
|
2521
2596
|
const toggleColumnVisibility = (0, import_react12.useCallback)(
|
|
2522
|
-
(
|
|
2523
|
-
setColumnVisibility((prev) => __spreadProps(__spreadValues({}, prev), { [
|
|
2597
|
+
(columnId, isVisible) => {
|
|
2598
|
+
setColumnVisibility((prev) => __spreadProps(__spreadValues({}, prev), { [columnId]: isVisible }));
|
|
2524
2599
|
},
|
|
2525
2600
|
[setColumnVisibility]
|
|
2526
2601
|
);
|
|
@@ -2573,21 +2648,23 @@ function DataGrid({
|
|
|
2573
2648
|
{ length: totalRowCount != null ? totalRowCount : data.length },
|
|
2574
2649
|
(_, i) => String(i + 1)
|
|
2575
2650
|
);
|
|
2576
|
-
const allSelectedAcrossPages = allRowIds.every(
|
|
2577
|
-
|
|
2651
|
+
const allSelectedAcrossPages = allRowIds.every(
|
|
2652
|
+
(rowId) => rowSelection[rowId]
|
|
2653
|
+
);
|
|
2654
|
+
const someSelectedAcrossPages = !allSelectedAcrossPages && allRowIds.some((rowId) => rowSelection[rowId]);
|
|
2578
2655
|
const toggleSelectAllAcrossPages = () => {
|
|
2579
2656
|
setRowSelection((prev) => {
|
|
2580
2657
|
const isSelecting = !allSelectedAcrossPages;
|
|
2581
2658
|
if (isSelecting) {
|
|
2582
2659
|
const newSelection = {};
|
|
2583
|
-
for (const
|
|
2584
|
-
newSelection[
|
|
2660
|
+
for (const rowId of allRowIds) {
|
|
2661
|
+
newSelection[rowId] = true;
|
|
2585
2662
|
}
|
|
2586
2663
|
return __spreadValues(__spreadValues({}, prev), newSelection);
|
|
2587
2664
|
} else {
|
|
2588
2665
|
const updatedSelection = __spreadValues({}, prev);
|
|
2589
|
-
for (const
|
|
2590
|
-
delete updatedSelection[
|
|
2666
|
+
for (const rowId of allRowIds) {
|
|
2667
|
+
delete updatedSelection[rowId];
|
|
2591
2668
|
}
|
|
2592
2669
|
return updatedSelection;
|
|
2593
2670
|
}
|
|
@@ -2635,7 +2712,7 @@ function DataGrid({
|
|
|
2635
2712
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2636
2713
|
import_core.DndContext,
|
|
2637
2714
|
{
|
|
2638
|
-
id,
|
|
2715
|
+
id: dndId,
|
|
2639
2716
|
collisionDetection: import_core.closestCenter,
|
|
2640
2717
|
modifiers: [import_modifiers.restrictToHorizontalAxis],
|
|
2641
2718
|
onDragEnd: handleDragEnd,
|
|
@@ -2645,204 +2722,226 @@ function DataGrid({
|
|
|
2645
2722
|
{
|
|
2646
2723
|
items: columnOrder,
|
|
2647
2724
|
strategy: import_sortable2.horizontalListSortingStrategy,
|
|
2648
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
2664
|
-
const header = headerGroup.headers[virtualColumn.index];
|
|
2665
|
-
if (typeof header.column.columnDef.header === "string") {
|
|
2666
|
-
const customHeaderWidth = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.headerWidth;
|
|
2667
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2668
|
-
DraggableCellHeader,
|
|
2725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2726
|
+
"div",
|
|
2727
|
+
{
|
|
2728
|
+
id,
|
|
2729
|
+
className: "flex flex-col flex-1 h-full w-full rounded border border-border-primary-normal overflow-hidden text-text-primary-normal",
|
|
2730
|
+
children: [
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2732
|
+
"div",
|
|
2733
|
+
{
|
|
2734
|
+
className: "overflow-auto scrollbar-thin relative contain-paint will-change-transform",
|
|
2735
|
+
ref: containerRef,
|
|
2736
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: "min-w-full grid", children: [
|
|
2737
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { className: "sticky top-0 z-10 grid", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("tr", { className: "flex w-full", children: [
|
|
2738
|
+
virtualPaddingLeft ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2739
|
+
"th",
|
|
2669
2740
|
{
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
)
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
header
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2741
|
+
style: { display: "flex", width: virtualPaddingLeft }
|
|
2742
|
+
}
|
|
2743
|
+
) : null,
|
|
2744
|
+
virtualColumns.map((virtualColumn) => {
|
|
2745
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
2746
|
+
const header = headerGroup.headers[virtualColumn.index];
|
|
2747
|
+
if (typeof header.column.columnDef.header === "string") {
|
|
2748
|
+
const customHeaderWidth = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.headerWidth;
|
|
2749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2750
|
+
DraggableCellHeader,
|
|
2751
|
+
{
|
|
2752
|
+
id: id ? `${id}-header-${header.id}` : void 0,
|
|
2753
|
+
header,
|
|
2754
|
+
locked: (_b2 = header.column.columnDef.meta) == null ? void 0 : _b2.locked,
|
|
2755
|
+
center: centerHeader,
|
|
2756
|
+
width: customHeaderWidth,
|
|
2757
|
+
className: (0, import_clsx14.default)(
|
|
2758
|
+
header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
|
|
2759
|
+
"group"
|
|
2760
|
+
),
|
|
2761
|
+
children: [
|
|
2762
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Subheader, { tall: true, children: header.column.columnDef.header }),
|
|
2763
|
+
getSortIcon(header.column.getIsSorted()),
|
|
2764
|
+
!header.column.getIsSorted() && header.column.getCanSort() && getSortIcon(
|
|
2765
|
+
header.column.getNextSortingOrder(),
|
|
2766
|
+
true
|
|
2767
|
+
),
|
|
2768
|
+
header.column.getSortIndex() !== -1 && table.getState().sorting.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Subheader, { tall: true, children: header.column.getSortIndex() + 1 }),
|
|
2769
|
+
!((_c2 = header.column.columnDef.meta) == null ? void 0 : _c2.locked) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2770
|
+
"div",
|
|
2771
|
+
{
|
|
2772
|
+
onDoubleClick: (e) => {
|
|
2773
|
+
e.stopPropagation();
|
|
2774
|
+
header.column.resetSize();
|
|
2775
|
+
},
|
|
2776
|
+
onMouseDown: (e) => {
|
|
2777
|
+
e.stopPropagation();
|
|
2778
|
+
header.getResizeHandler()(e);
|
|
2779
|
+
},
|
|
2780
|
+
onTouchStart: (e) => {
|
|
2781
|
+
e.stopPropagation();
|
|
2782
|
+
header.getResizeHandler()(e);
|
|
2783
|
+
},
|
|
2784
|
+
className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
|
|
2785
|
+
}
|
|
2786
|
+
)
|
|
2787
|
+
]
|
|
2788
|
+
},
|
|
2789
|
+
header.id
|
|
2790
|
+
);
|
|
2791
|
+
}
|
|
2792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react12.default.Fragment, { children: ((_d2 = header.column.columnDef.meta) == null ? void 0 : _d2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2793
|
+
DataGridCell,
|
|
2794
|
+
{
|
|
2795
|
+
id: id ? `${id}-header-${header.id}` : void 0,
|
|
2796
|
+
type: "header",
|
|
2797
|
+
component: "checkbox",
|
|
2798
|
+
locked: (_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.locked,
|
|
2799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2800
|
+
Checkbox,
|
|
2688
2801
|
{
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
onMouseDown: (e) => {
|
|
2694
|
-
e.stopPropagation();
|
|
2695
|
-
header.getResizeHandler()(e);
|
|
2696
|
-
},
|
|
2697
|
-
onTouchStart: (e) => {
|
|
2698
|
-
e.stopPropagation();
|
|
2699
|
-
header.getResizeHandler()(e);
|
|
2700
|
-
},
|
|
2701
|
-
className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
|
|
2802
|
+
id: id ? `${id}-select-all-checkbox` : void 0,
|
|
2803
|
+
checked: allSelectedAcrossPages,
|
|
2804
|
+
indeterminate: someSelectedAcrossPages,
|
|
2805
|
+
onChange: toggleSelectAllAcrossPages
|
|
2702
2806
|
}
|
|
2703
2807
|
)
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
locked: (_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.locked,
|
|
2715
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2716
|
-
Checkbox,
|
|
2808
|
+
}
|
|
2809
|
+
) : (0, import_react_table.flexRender)(
|
|
2810
|
+
header.column.columnDef.header,
|
|
2811
|
+
header.getContext()
|
|
2812
|
+
) }, header.id);
|
|
2813
|
+
}),
|
|
2814
|
+
virtualPaddingRight ? (
|
|
2815
|
+
//fake empty column to the right for virtualization scroll padding
|
|
2816
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2817
|
+
"th",
|
|
2717
2818
|
{
|
|
2718
|
-
|
|
2719
|
-
indeterminate: someSelectedAcrossPages,
|
|
2720
|
-
onChange: toggleSelectAllAcrossPages
|
|
2819
|
+
style: { display: "flex", width: virtualPaddingRight }
|
|
2721
2820
|
}
|
|
2722
2821
|
)
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2822
|
+
) : null,
|
|
2823
|
+
enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2824
|
+
ColumnSelectorHeaderCell,
|
|
2825
|
+
{
|
|
2826
|
+
id: id ? `${id}-column-selector` : void 0,
|
|
2827
|
+
table,
|
|
2828
|
+
toggleColumnVisibility,
|
|
2829
|
+
resetColumnVisibility
|
|
2830
|
+
}
|
|
2831
|
+
)
|
|
2832
|
+
] }, headerGroup.id)) }),
|
|
2731
2833
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2732
|
-
|
|
2834
|
+
TableBody,
|
|
2733
2835
|
{
|
|
2734
|
-
|
|
2836
|
+
id,
|
|
2837
|
+
columnVirtualizer,
|
|
2838
|
+
table,
|
|
2839
|
+
tableContainerRef: containerRef,
|
|
2840
|
+
virtualPaddingLeft,
|
|
2841
|
+
virtualPaddingRight,
|
|
2842
|
+
pagination,
|
|
2843
|
+
isLoadingMore,
|
|
2844
|
+
hasMore,
|
|
2845
|
+
showFilterRow,
|
|
2846
|
+
enableColumnSelector
|
|
2735
2847
|
}
|
|
2736
2848
|
)
|
|
2737
|
-
)
|
|
2738
|
-
|
|
2739
|
-
ColumnSelectorHeaderCell,
|
|
2740
|
-
{
|
|
2741
|
-
table,
|
|
2742
|
-
toggleColumnVisibility,
|
|
2743
|
-
resetColumnVisibility
|
|
2744
|
-
}
|
|
2745
|
-
)
|
|
2746
|
-
] }, headerGroup.id)) }),
|
|
2747
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2748
|
-
TableBody,
|
|
2749
|
-
{
|
|
2750
|
-
columnVirtualizer,
|
|
2751
|
-
table,
|
|
2752
|
-
tableContainerRef: containerRef,
|
|
2753
|
-
virtualPaddingLeft,
|
|
2754
|
-
virtualPaddingRight,
|
|
2755
|
-
pagination,
|
|
2756
|
-
isLoadingMore,
|
|
2757
|
-
hasMore,
|
|
2758
|
-
showFilterRow,
|
|
2759
|
-
enableColumnSelector
|
|
2760
|
-
}
|
|
2761
|
-
)
|
|
2762
|
-
] })
|
|
2763
|
-
}
|
|
2764
|
-
),
|
|
2765
|
-
table.getRowModel().rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2766
|
-
"div",
|
|
2767
|
-
{
|
|
2768
|
-
className: (0, import_clsx14.default)(
|
|
2769
|
-
NO_RESULTS_HEIGHT,
|
|
2770
|
-
"flex flex-col items-center justify-center",
|
|
2771
|
-
componentGap,
|
|
2772
|
-
componentPadding
|
|
2849
|
+
] })
|
|
2850
|
+
}
|
|
2773
2851
|
),
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2852
|
+
table.getRowModel().rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2853
|
+
"div",
|
|
2854
|
+
{
|
|
2855
|
+
className: (0, import_clsx14.default)(
|
|
2856
|
+
NO_RESULTS_HEIGHT,
|
|
2857
|
+
"flex flex-col items-center justify-center",
|
|
2858
|
+
componentGap,
|
|
2859
|
+
componentPadding
|
|
2860
|
+
),
|
|
2861
|
+
children: [
|
|
2862
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Subheader, { color: "text-secondary-normal", children: "No Results" }),
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Paragraph, { color: "text-secondary-normal", children: "To view results, enter or update your search criteria." })
|
|
2864
|
+
]
|
|
2865
|
+
}
|
|
2866
|
+
),
|
|
2867
|
+
!hideStatusBar && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "p-2 pt-[7px] border-t border-border-primary-normal h-full min-h-[34px]", children: [
|
|
2868
|
+
pagination && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex justify-between items-center", children: [
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-1 w-min", children: [
|
|
2870
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2871
|
+
Select,
|
|
2794
2872
|
{
|
|
2795
|
-
|
|
2796
|
-
|
|
2873
|
+
id: id ? `${id}-pagesize-select` : void 0,
|
|
2874
|
+
wrapperClassName: "!w-20",
|
|
2875
|
+
value: pagination.pageSize.toString(),
|
|
2876
|
+
onChange: (e) => {
|
|
2797
2877
|
var _a2;
|
|
2798
|
-
return (_a2 = pagination.onPageSizeChange) == null ? void 0 : _a2.call(pagination,
|
|
2878
|
+
return (_a2 = pagination.onPageSizeChange) == null ? void 0 : _a2.call(pagination, Number(e.target.value));
|
|
2799
2879
|
},
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2880
|
+
renderMenu: (props) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2881
|
+
Menu,
|
|
2882
|
+
__spreadProps(__spreadValues({}, props), {
|
|
2883
|
+
id: id ? `${id}-pagesize-menu` : void 0,
|
|
2884
|
+
children: PAGE_SIZE_OPTIONS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2885
|
+
MenuOption,
|
|
2886
|
+
{
|
|
2887
|
+
id: id ? `${id}-pagesize-option-${option}` : void 0,
|
|
2888
|
+
selected: pagination.pageSize === option,
|
|
2889
|
+
onClick: () => {
|
|
2890
|
+
var _a2;
|
|
2891
|
+
return (_a2 = pagination.onPageSizeChange) == null ? void 0 : _a2.call(pagination, option);
|
|
2892
|
+
},
|
|
2893
|
+
children: option
|
|
2894
|
+
},
|
|
2895
|
+
option
|
|
2896
|
+
))
|
|
2897
|
+
})
|
|
2898
|
+
)
|
|
2899
|
+
}
|
|
2900
|
+
),
|
|
2901
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Label, { children: "Per Page" })
|
|
2902
|
+
] }),
|
|
2903
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2904
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2905
|
+
Button,
|
|
2906
|
+
{
|
|
2907
|
+
id: id ? `${id}-prev-page-button` : void 0,
|
|
2908
|
+
iconOnly: true,
|
|
2909
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "chevron_left" }),
|
|
2910
|
+
onClick: () => pagination.onPageChange(pagination.pageIndex - 1),
|
|
2911
|
+
variant: "tertiary",
|
|
2912
|
+
disabled: pagination.pageIndex === 0
|
|
2913
|
+
}
|
|
2914
|
+
),
|
|
2915
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Paragraph, { children: [
|
|
2916
|
+
pagination.pageIndex * pagination.pageSize + 1,
|
|
2917
|
+
" -",
|
|
2918
|
+
" ",
|
|
2919
|
+
Math.min(
|
|
2920
|
+
(pagination.pageIndex + 1) * pagination.pageSize,
|
|
2921
|
+
pagination.total
|
|
2922
|
+
),
|
|
2923
|
+
" ",
|
|
2924
|
+
"of ",
|
|
2925
|
+
pagination.total
|
|
2926
|
+
] }),
|
|
2927
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2928
|
+
Button,
|
|
2929
|
+
{
|
|
2930
|
+
id: id ? `${id}-next-page-button` : void 0,
|
|
2931
|
+
iconOnly: true,
|
|
2932
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "chevron_right" }),
|
|
2933
|
+
onClick: () => pagination.onPageChange(pagination.pageIndex + 1),
|
|
2934
|
+
variant: "tertiary",
|
|
2935
|
+
disabled: (pagination.pageIndex + 1) * pagination.pageSize >= pagination.total
|
|
2936
|
+
}
|
|
2937
|
+
)
|
|
2938
|
+
] })
|
|
2830
2939
|
] }),
|
|
2831
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2832
|
-
Button,
|
|
2833
|
-
{
|
|
2834
|
-
iconOnly: true,
|
|
2835
|
-
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "chevron_right" }),
|
|
2836
|
-
onClick: () => pagination.onPageChange(pagination.pageIndex + 1),
|
|
2837
|
-
variant: "tertiary",
|
|
2838
|
-
disabled: (pagination.pageIndex + 1) * pagination.pageSize >= pagination.total
|
|
2839
|
-
}
|
|
2840
|
-
)
|
|
2940
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Paragraph, { children: status })
|
|
2841
2941
|
] })
|
|
2842
|
-
]
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
] })
|
|
2942
|
+
]
|
|
2943
|
+
}
|
|
2944
|
+
)
|
|
2846
2945
|
}
|
|
2847
2946
|
)
|
|
2848
2947
|
}
|
|
@@ -2850,6 +2949,7 @@ function DataGrid({
|
|
|
2850
2949
|
}
|
|
2851
2950
|
DataGrid.displayName = "DataGrid";
|
|
2852
2951
|
function TableBody({
|
|
2952
|
+
id,
|
|
2853
2953
|
columnVirtualizer,
|
|
2854
2954
|
table,
|
|
2855
2955
|
tableContainerRef,
|
|
@@ -2898,6 +2998,7 @@ function TableBody({
|
|
|
2898
2998
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2899
2999
|
DragAlongCell,
|
|
2900
3000
|
{
|
|
3001
|
+
id: id ? `${id}-filter-cell-${header.id}` : void 0,
|
|
2901
3002
|
noPadding: true,
|
|
2902
3003
|
cell: header,
|
|
2903
3004
|
width: (_a = header.column.columnDef.meta) == null ? void 0 : _a.headerWidth,
|
|
@@ -2907,6 +3008,7 @@ function TableBody({
|
|
|
2907
3008
|
})) != null ? _e : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2908
3009
|
Search,
|
|
2909
3010
|
{
|
|
3011
|
+
id: id ? `${id}-filter-search-${header.id}` : void 0,
|
|
2910
3012
|
removeRoundness: true,
|
|
2911
3013
|
onChange: (e) => header.column.setFilterValue(e.target.value),
|
|
2912
3014
|
value: (_d = header.column.getFilterValue()) != null ? _d : "",
|
|
@@ -2926,6 +3028,7 @@ function TableBody({
|
|
|
2926
3028
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2927
3029
|
TableBodyRow,
|
|
2928
3030
|
{
|
|
3031
|
+
id,
|
|
2929
3032
|
columnVirtualizer,
|
|
2930
3033
|
row,
|
|
2931
3034
|
rowVirtualizer,
|
|
@@ -2948,7 +3051,7 @@ function TableBody({
|
|
|
2948
3051
|
transform: `translateY(${virtualRows[virtualRows.length - 1].start + 40}px)`
|
|
2949
3052
|
},
|
|
2950
3053
|
className: "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal",
|
|
2951
|
-
children: table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoadingCell, { column: column.columnDef }, column.id))
|
|
3054
|
+
children: table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoadingCell, { id, column: column.columnDef }, column.id))
|
|
2952
3055
|
}
|
|
2953
3056
|
)
|
|
2954
3057
|
]
|
|
@@ -2956,6 +3059,7 @@ function TableBody({
|
|
|
2956
3059
|
);
|
|
2957
3060
|
}
|
|
2958
3061
|
function TableBodyRow({
|
|
3062
|
+
id,
|
|
2959
3063
|
columnVirtualizer,
|
|
2960
3064
|
row,
|
|
2961
3065
|
// rowVirtualizer,
|
|
@@ -2991,15 +3095,24 @@ function TableBodyRow({
|
|
|
2991
3095
|
virtualColumns.map((virtualColumn) => {
|
|
2992
3096
|
var _a;
|
|
2993
3097
|
const cell = visibleCells[virtualColumn.index];
|
|
2994
|
-
return ((_a = cell.column.columnDef.meta) == null ? void 0 : _a.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react12.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2995
|
-
|
|
3098
|
+
return ((_a = cell.column.columnDef.meta) == null ? void 0 : _a.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react12.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3099
|
+
DragAlongCell,
|
|
2996
3100
|
{
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3101
|
+
id: id ? `${id}-cell-${cell.id}` : void 0,
|
|
3102
|
+
cell,
|
|
3103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3104
|
+
Tooltip,
|
|
3105
|
+
{
|
|
3106
|
+
id: id ? `${id}-tooltip-${cell.id}` : void 0,
|
|
3107
|
+
showOnTruncation: true,
|
|
3108
|
+
message: cell.getValue(),
|
|
3109
|
+
position: "bottom",
|
|
3110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Paragraph, { addOverflow: true, tall: true, children: cell.getValue() })
|
|
3111
|
+
}
|
|
3112
|
+
)
|
|
3113
|
+
},
|
|
3114
|
+
cell.id
|
|
3115
|
+
);
|
|
3003
3116
|
}),
|
|
3004
3117
|
virtualPaddingRight ? (
|
|
3005
3118
|
// fake empty column to the right for virtualization scroll padding
|
|
@@ -3012,25 +3125,36 @@ function TableBodyRow({
|
|
|
3012
3125
|
);
|
|
3013
3126
|
}
|
|
3014
3127
|
var LoadingCell = ({
|
|
3128
|
+
id,
|
|
3015
3129
|
column
|
|
3016
3130
|
}) => {
|
|
3017
3131
|
const key = `loading-${column.id}`;
|
|
3018
3132
|
if (column.cell === "checkbox") {
|
|
3019
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DataGridCell, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Checkbox, { disabled: true }) }, key);
|
|
3133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DataGridCell, { id: id ? `${id}-${key}` : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Checkbox, { id: id ? `${id}-${key}-checkbox` : void 0, disabled: true }) }, key);
|
|
3020
3134
|
}
|
|
3021
3135
|
if (column.cell === "input") {
|
|
3022
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3023
|
-
|
|
3136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3137
|
+
DataGridCell,
|
|
3024
3138
|
{
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3139
|
+
id: id ? `${id}-${key}` : void 0,
|
|
3140
|
+
component: "input",
|
|
3141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3142
|
+
Input,
|
|
3143
|
+
{
|
|
3144
|
+
id: id ? `${id}-${key}-input` : void 0,
|
|
3145
|
+
align: "left",
|
|
3146
|
+
disabled: true,
|
|
3147
|
+
wrapperClassName: "!rounded-none !border-0"
|
|
3148
|
+
}
|
|
3149
|
+
)
|
|
3150
|
+
},
|
|
3151
|
+
key
|
|
3152
|
+
);
|
|
3030
3153
|
}
|
|
3031
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DataGridCell, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "bg-linear-270 to-neutral-300/[24%] from-neutral-300/[12%] rounded-xs w-full max-w-25 h-6" }) }, key);
|
|
3154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DataGridCell, { id: id ? `${id}-${key}` : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "bg-linear-270 to-neutral-300/[24%] from-neutral-300/[12%] rounded-xs w-full max-w-25 h-6" }) }, key);
|
|
3032
3155
|
};
|
|
3033
3156
|
function ColumnSelectorHeaderCell({
|
|
3157
|
+
id,
|
|
3034
3158
|
table,
|
|
3035
3159
|
toggleColumnVisibility,
|
|
3036
3160
|
resetColumnVisibility
|
|
@@ -3040,6 +3164,7 @@ function ColumnSelectorHeaderCell({
|
|
|
3040
3164
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3041
3165
|
DataGridCell,
|
|
3042
3166
|
{
|
|
3167
|
+
id,
|
|
3043
3168
|
width: "48",
|
|
3044
3169
|
type: "header",
|
|
3045
3170
|
color: "text-secondary-normal",
|
|
@@ -3048,6 +3173,7 @@ function ColumnSelectorHeaderCell({
|
|
|
3048
3173
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3049
3174
|
Button,
|
|
3050
3175
|
{
|
|
3176
|
+
id: id ? `${id}-button` : void 0,
|
|
3051
3177
|
onClick: () => setShow((prev) => !prev),
|
|
3052
3178
|
variant: "navigation",
|
|
3053
3179
|
iconOnly: true,
|
|
@@ -3057,6 +3183,7 @@ function ColumnSelectorHeaderCell({
|
|
|
3057
3183
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3058
3184
|
Menu,
|
|
3059
3185
|
{
|
|
3186
|
+
id: id ? `${id}-menu` : void 0,
|
|
3060
3187
|
positionTo: ref,
|
|
3061
3188
|
position: "bottom-right",
|
|
3062
3189
|
show,
|
|
@@ -3065,6 +3192,7 @@ function ColumnSelectorHeaderCell({
|
|
|
3065
3192
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3066
3193
|
Button,
|
|
3067
3194
|
{
|
|
3195
|
+
id: id ? `${id}-reset-button` : void 0,
|
|
3068
3196
|
variant: "tertiary",
|
|
3069
3197
|
onClick: () => {
|
|
3070
3198
|
resetColumnVisibility();
|
|
@@ -3079,6 +3207,7 @@ function ColumnSelectorHeaderCell({
|
|
|
3079
3207
|
}).map((column) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3080
3208
|
ColumnSelectorMenuOption,
|
|
3081
3209
|
{
|
|
3210
|
+
id: id ? `${id}-option-${column.id}` : void 0,
|
|
3082
3211
|
column,
|
|
3083
3212
|
toggleColumnVisibility
|
|
3084
3213
|
},
|
|
@@ -3092,14 +3221,16 @@ function ColumnSelectorHeaderCell({
|
|
|
3092
3221
|
);
|
|
3093
3222
|
}
|
|
3094
3223
|
function ColumnSelectorMenuOption({
|
|
3224
|
+
id,
|
|
3095
3225
|
column,
|
|
3096
3226
|
toggleColumnVisibility
|
|
3097
3227
|
}) {
|
|
3098
3228
|
const [isVisible, setIsVisible] = (0, import_react12.useState)(column.getIsVisible());
|
|
3099
3229
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
3100
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuOption, { selected: isVisible, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuOption, { id, selected: isVisible, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3101
3231
|
Checkbox,
|
|
3102
3232
|
{
|
|
3233
|
+
id: id ? `${id}-checkbox` : void 0,
|
|
3103
3234
|
label: label != null ? label : "Unknown",
|
|
3104
3235
|
checked: isVisible,
|
|
3105
3236
|
onChange: (e) => {
|