@dmsi/wedgekit-react 1.0.1 → 2.0.1
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/classNames.d.ts +1 -0
- package/dist/classNames.d.ts.map +1 -1
- package/dist/classNames.js +150 -0
- package/dist/components/AccessCard.js +63 -0
- package/dist/components/AccessCardGroup.js +73 -0
- package/dist/components/AccessChangerTabItem.js +51 -0
- package/dist/components/Accordion.js +99 -0
- package/dist/components/Alert.d.ts.map +1 -1
- package/dist/components/Alert.js +78 -0
- package/dist/components/Breadcrumbs.js +111 -0
- package/dist/components/Button.js +137 -0
- package/dist/components/CalendarRange.js +405 -0
- package/dist/components/Caption.js +99 -0
- package/dist/components/Card.js +50 -0
- package/dist/components/Checkbox.js +108 -0
- package/dist/components/CompactImagesPreview.d.ts.map +1 -1
- package/dist/components/CompactImagesPreview.js +120 -0
- package/dist/components/ContentTab.js +68 -0
- package/dist/components/ContentTabs.js +96 -0
- package/dist/components/DMSiLogo.js +54 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +27 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +79 -0
- package/dist/components/DataGrid/PinnedColumns.d.ts +9 -2
- package/dist/components/DataGrid/PinnedColumns.d.ts.map +1 -1
- package/dist/components/DataGrid/PinnedColumns.js +165 -0
- package/dist/components/DataGrid/SummaryRow/SummaryCell.d.ts +18 -0
- package/dist/components/DataGrid/SummaryRow/SummaryCell.d.ts.map +1 -0
- package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
- package/dist/components/DataGrid/SummaryRow/aggregations.d.ts +39 -0
- package/dist/components/DataGrid/SummaryRow/aggregations.d.ts.map +1 -0
- package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
- package/dist/components/DataGrid/SummaryRow/index.d.ts +18 -0
- package/dist/components/DataGrid/SummaryRow/index.d.ts.map +1 -0
- package/dist/components/DataGrid/SummaryRow/index.js +86 -0
- package/dist/components/DataGrid/TableBody/GroupRow.d.ts +18 -0
- package/dist/components/DataGrid/TableBody/GroupRow.d.ts.map +1 -0
- package/dist/components/DataGrid/TableBody/GroupRow.js +243 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.js +33 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.d.ts +3 -2
- package/dist/components/DataGrid/TableBody/TableBodyRow.d.ts.map +1 -1
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +136 -0
- package/dist/components/DataGrid/TableBody/index.d.ts +3 -1
- package/dist/components/DataGrid/TableBody/index.d.ts.map +1 -1
- package/dist/components/DataGrid/TableBody/index.js +161 -0
- package/dist/components/DataGrid/index.d.ts +1 -1
- package/dist/components/DataGrid/index.d.ts.map +1 -1
- package/dist/components/DataGrid/index.js +696 -0
- package/dist/components/DataGrid/types.d.ts +141 -1
- package/dist/components/DataGrid/types.d.ts.map +1 -1
- package/dist/components/DataGrid/utils.d.ts +2 -0
- package/dist/components/DataGrid/utils.d.ts.map +1 -1
- package/dist/components/DataGrid/utils.js +20 -0
- package/dist/components/DataGridCell.d.ts +5 -2
- package/dist/components/DataGridCell.d.ts.map +1 -1
- package/dist/components/DataGridCell.js +412 -0
- package/dist/components/DataTable.js +700 -0
- package/dist/components/DateInput.js +193 -0
- package/dist/components/DateRangeInput.js +368 -0
- package/dist/components/DebugJson.js +28 -0
- package/dist/components/Display.js +46 -0
- package/dist/components/EditingContext.js +34 -0
- package/dist/components/EmblaCarousel/ArrowButtons.js +83 -0
- package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +12 -0
- package/dist/components/EmblaCarousel/index.js +153 -0
- package/dist/components/EmblaCarousel/usePrevNextButtons.js +21 -0
- package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +15 -0
- package/dist/components/EmptyCartIcon.js +25 -0
- package/dist/components/FilterGroup.d.ts +5 -3
- package/dist/components/FilterGroup.d.ts.map +1 -1
- package/dist/components/FilterGroup.js +198 -0
- package/dist/components/FullViewportBox.js +19 -0
- package/dist/components/Grid.js +54 -0
- package/dist/components/Heading.js +50 -0
- package/dist/components/HorizontalDivider.js +20 -0
- package/dist/components/Icon.d.ts +5 -2
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/Icon.js +73 -0
- package/dist/components/ImagePlaceholder.js +22 -0
- package/dist/components/Input.d.ts +11 -9
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Input.js +469 -0
- package/dist/components/InputGroup.js +45 -0
- package/dist/components/Label.js +37 -0
- package/dist/components/Link.js +69 -0
- package/dist/components/List.js +12 -0
- package/dist/components/ListGroup.d.ts.map +1 -1
- package/dist/components/ListGroup.js +54 -0
- package/dist/components/LiveChatComponent.js +25 -0
- package/dist/components/LoadingScrim.js +22 -0
- package/dist/components/LogoAgilityTopBar.js +90 -0
- package/dist/components/LogoDMSiTopBar.js +54 -0
- package/dist/components/LogoMillworkTopBar.js +196 -0
- package/dist/components/MainBar.js +58 -0
- package/dist/components/MaxViewportBox.js +19 -0
- package/dist/components/Menu.d.ts.map +1 -1
- package/dist/components/Menu.js +202 -0
- package/dist/components/MenuOption.js +161 -0
- package/dist/components/MobileDataGrid/ColumnList.js +85 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +100 -0
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +6 -0
- package/dist/components/MobileDataGrid/GridContextProvider/index.js +80 -0
- package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +11 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.d.ts +2 -1
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
- package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
- package/dist/components/MobileDataGrid/index.d.ts +1 -1
- package/dist/components/MobileDataGrid/index.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/index.js +78 -0
- package/dist/components/MobileNavMenu.d.ts.map +1 -1
- package/dist/components/MobileNavMenu.js +173 -0
- package/dist/components/Modal.d.ts +1 -2
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Modal.js +201 -0
- package/dist/components/ModalButtons.d.ts.map +1 -1
- package/dist/components/ModalButtons.js +57 -0
- package/dist/components/ModalContent.d.ts +1 -2
- package/dist/components/ModalContent.d.ts.map +1 -1
- package/dist/components/ModalContent.js +24 -0
- package/dist/components/ModalHeader.js +74 -0
- package/dist/components/ModalScrim.js +32 -0
- package/dist/components/NavigationTab.js +72 -0
- package/dist/components/NavigationTabs.js +45 -0
- package/dist/components/NestedMenu.d.ts.map +1 -1
- package/dist/components/NestedMenu.js +119 -0
- package/dist/components/Notification.js +91 -0
- package/dist/components/OptionPill.d.ts +2 -1
- package/dist/components/OptionPill.d.ts.map +1 -1
- package/dist/components/OptionPill.js +103 -0
- package/dist/components/OrderCheckIcon.js +28 -0
- package/dist/components/PDFViewer/DownloadIcon.js +25 -0
- package/dist/components/PDFViewer/PDFElement.js +77 -0
- package/dist/components/PDFViewer/PDFNavigation.js +64 -0
- package/dist/components/PDFViewer/PDFPage.js +28 -0
- package/dist/components/PDFViewer/index.d.ts.map +1 -1
- package/dist/components/PDFViewer/index.js +124 -0
- package/dist/components/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination.js +117 -0
- package/dist/components/Paragraph.js +43 -0
- package/dist/components/Password.js +47 -0
- package/dist/components/ProductImagePreview/CarouselPagination.js +48 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts +2 -1
- package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/MobileImageCarousel.js +146 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts +2 -1
- package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +138 -0
- package/dist/components/ProductImagePreview/Thumbnail.d.ts +2 -1
- package/dist/components/ProductImagePreview/Thumbnail.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/Thumbnail.js +46 -0
- package/dist/components/ProductImagePreview/ZoomWindow.js +74 -0
- package/dist/components/ProductImagePreview/index.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/index.js +189 -0
- package/dist/components/ProductImagePreview/useProductImagePreview.js +85 -0
- package/dist/components/ProjectBar.d.ts +1 -1
- package/dist/components/ProjectBar.js +54 -0
- package/dist/components/Radio.js +113 -0
- package/dist/components/Search.js +89 -0
- package/dist/components/SearchResultImage/index.js +26 -0
- package/dist/components/Select.js +122 -0
- package/dist/components/SideMenu.js +24 -0
- package/dist/components/SideMenuGroup.js +80 -0
- package/dist/components/SideMenuItem.js +79 -0
- package/dist/components/SimpleTable.js +60 -0
- package/dist/components/SkeletonParagraph.js +24 -0
- package/dist/components/Spinner.d.ts +1 -1
- package/dist/components/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner.js +30 -0
- package/dist/components/Stack.js +174 -0
- package/dist/components/StatusPill.js +44 -0
- package/dist/components/Stepper.js +138 -0
- package/dist/components/Subheader.d.ts +2 -1
- package/dist/components/Subheader.d.ts.map +1 -1
- package/dist/components/Subheader.js +41 -0
- package/dist/components/Surface.js +30 -0
- package/dist/components/Swatch.js +1498 -0
- package/dist/components/Textarea.js +106 -0
- package/dist/components/Theme.d.ts +1 -1
- package/dist/components/Theme.d.ts.map +1 -1
- package/dist/components/Theme.js +25 -0
- package/dist/components/Time.d.ts +2 -1
- package/dist/components/Time.d.ts.map +1 -1
- package/dist/components/Time.js +225 -0
- package/dist/components/Toast.d.ts +4 -3
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +170 -0
- package/dist/components/Tooltip.js +102 -0
- package/dist/components/TopBar.d.ts.map +1 -1
- package/dist/components/TopBar.js +119 -0
- package/dist/components/Upload.js +107 -0
- package/dist/components/WorldpayIframe.d.ts.map +1 -1
- package/dist/components/WorldpayIframe.js +19 -0
- package/dist/hooks/useEditCell.js +23 -0
- package/dist/hooks/useInfiniteScroll.js +25 -0
- package/dist/hooks/useKeydown.js +20 -0
- package/dist/hooks/useMatchesMedia.js +15 -0
- package/dist/hooks/useMenuSystem.js +186 -0
- package/dist/hooks/useMounted.js +9 -0
- package/dist/hooks/useTableLayout/computeColumns.js +59 -0
- package/dist/hooks/useTableLayout/storage.js +64 -0
- package/dist/hooks/useTableLayout/useTableLayout.js +163 -0
- package/dist/index.js +249 -52864
- package/dist/lib/loadFonts.js +11 -0
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2299 -0
- package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +367 -0
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
- package/dist/node_modules/@headlessui/react/dist/components/description/description.js +45 -0
- package/dist/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
- package/dist/node_modules/@headlessui/react/dist/components/label/label.js +62 -0
- package/dist/node_modules/@headlessui/react/dist/components/switch/switch.js +56 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-controllable.js +10 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-slot.js +7 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +16 -0
- package/dist/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
- package/dist/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
- package/dist/node_modules/@headlessui/react/dist/internal/id.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/bugs.js +19 -0
- package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
- package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
- package/dist/node_modules/@headlessui/react/dist/utils/dom.js +34 -0
- package/dist/node_modules/@headlessui/react/dist/utils/env.js +34 -0
- package/dist/node_modules/@headlessui/react/dist/utils/form.js +32 -0
- package/dist/node_modules/@headlessui/react/dist/utils/match.js +11 -0
- package/dist/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/owner.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/render.js +126 -0
- package/dist/node_modules/@js-temporal/polyfill/dist/index.esm.js +3913 -0
- package/dist/node_modules/@mikecousins/react-pdf/dist/index.js +83 -0
- package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocus.js +31 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +99 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js +59 -0
- package/dist/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
- package/dist/node_modules/@react-aria/interactions/dist/utils.js +68 -0
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +32 -0
- package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
- package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
- package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
- package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
- package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
- package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
- package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
- package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +94 -0
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1954 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +575 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
- package/dist/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1204 -0
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +126 -0
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +24 -0
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +35 -0
- package/dist/node_modules/jsbi/dist/jsbi.js +1040 -0
- package/dist/node_modules/react-use/esm/usePrevious.js +10 -0
- package/dist/static/no-results-image.png.js +4 -0
- package/dist/styles.css +1 -1
- package/dist/utils/date-patch-dashes.js +28 -0
- package/dist/utils/date.js +95 -0
- package/dist/utils/formatting.js +22 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/mergeObjectArrays.js +18 -0
- package/dist/utils.js +20 -0
- package/package.json +1 -1
- /package/dist/{pdf-l6QfMa5e.js → node_modules/pdfjs-dist/build/pdf.js} +0 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { jsx as o, jsxs as k, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as f } from "../../../node_modules/clsx/dist/clsx.js";
|
|
3
|
+
import { typography as M } from "../../../classNames.js";
|
|
4
|
+
import { formatCurrencyDisplay as Q } from "../../../utils/formatting.js";
|
|
5
|
+
import { Checkbox as U } from "../../Checkbox.js";
|
|
6
|
+
import { DataGridCell as m, DragAlongCell as X } from "../../DataGridCell.js";
|
|
7
|
+
import { Icon as Z } from "../../Icon.js";
|
|
8
|
+
import { computeCount as ee, computeSum as ne } from "../SummaryRow/aggregations.js";
|
|
9
|
+
import { handleRowArrowKeyDown as te } from "../utils.js";
|
|
10
|
+
const le = 40;
|
|
11
|
+
function oe(t) {
|
|
12
|
+
return t === 0 ? "bg-brand-500" : t === 1 ? "bg-brand-300" : "bg-brand-200";
|
|
13
|
+
}
|
|
14
|
+
function G(t) {
|
|
15
|
+
return t >= 2 ? "text-neutral-500" : "text-neutral-000";
|
|
16
|
+
}
|
|
17
|
+
function ie(t) {
|
|
18
|
+
return f(
|
|
19
|
+
M.label,
|
|
20
|
+
"!leading-6 whitespace-nowrap overflow-hidden text-ellipsis",
|
|
21
|
+
G(t)
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function fe({
|
|
25
|
+
id: t,
|
|
26
|
+
testid: r,
|
|
27
|
+
row: e,
|
|
28
|
+
virtualRow: V,
|
|
29
|
+
showFilterRow: j,
|
|
30
|
+
locked: a,
|
|
31
|
+
groupRowMode: A = "spanning",
|
|
32
|
+
groupSelectionMode: R = "row",
|
|
33
|
+
columnVirtualizer: H,
|
|
34
|
+
virtualPaddingLeft: D,
|
|
35
|
+
virtualPaddingRight: I
|
|
36
|
+
}) {
|
|
37
|
+
const x = e.getIsExpanded(), u = e.depth, E = R === "group" || R === "both", d = oe(u), C = ie(u), F = () => {
|
|
38
|
+
e.toggleExpanded();
|
|
39
|
+
}, P = (n) => {
|
|
40
|
+
if (n.key === "Enter" || n.key === " ") {
|
|
41
|
+
n.preventDefault(), e.toggleExpanded();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
te(n);
|
|
45
|
+
}, T = (n) => {
|
|
46
|
+
const l = n.columnDef.meta;
|
|
47
|
+
if (l?.groupCell)
|
|
48
|
+
return l.groupCell({
|
|
49
|
+
rows: e.getLeafRows().map((i) => i.original),
|
|
50
|
+
groupValue: e.groupingValue,
|
|
51
|
+
depth: u,
|
|
52
|
+
isExpanded: x
|
|
53
|
+
});
|
|
54
|
+
if (!l?.aggregationFn) return;
|
|
55
|
+
if (l.aggregationFn === "count")
|
|
56
|
+
return String(ee(e.getLeafRows()));
|
|
57
|
+
if (!n.accessorFn) return;
|
|
58
|
+
const c = ne(
|
|
59
|
+
e.getLeafRows(),
|
|
60
|
+
(i) => n.accessorFn(i.original, 0)
|
|
61
|
+
);
|
|
62
|
+
if (c !== void 0)
|
|
63
|
+
return l.format === "currency" ? Q(String(c)) : String(c);
|
|
64
|
+
}, _ = () => {
|
|
65
|
+
const n = e.getIsAllSubRowsSelected(), l = e.getIsSomeSelected();
|
|
66
|
+
return /* @__PURE__ */ o("div", { className: "contents", onClick: (c) => c.stopPropagation(), children: /* @__PURE__ */ o(
|
|
67
|
+
U,
|
|
68
|
+
{
|
|
69
|
+
id: t ? `${t}-group-checkbox-${e.id}` : void 0,
|
|
70
|
+
testid: r ? `${r}-group-checkbox-${e.id}` : void 0,
|
|
71
|
+
checked: n,
|
|
72
|
+
indeterminate: l,
|
|
73
|
+
onChange: () => {
|
|
74
|
+
const c = !n;
|
|
75
|
+
e.getLeafRows().forEach((i) => i.toggleSelected(c));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
) });
|
|
79
|
+
}, B = (n) => /* @__PURE__ */ o(
|
|
80
|
+
m,
|
|
81
|
+
{
|
|
82
|
+
id: t ? `${t}-group-checkbox-cell-${e.id}` : void 0,
|
|
83
|
+
testid: r ? `${r}-group-checkbox-cell-${e.id}` : void 0,
|
|
84
|
+
component: "checkbox",
|
|
85
|
+
width: `${n.column.getSize()}px`,
|
|
86
|
+
className: d,
|
|
87
|
+
children: _()
|
|
88
|
+
},
|
|
89
|
+
n.id
|
|
90
|
+
), $ = (n) => {
|
|
91
|
+
if (!E) return { checkboxCell: null, remainingCells: n };
|
|
92
|
+
const l = n.findIndex((c) => c.column.columnDef.meta?.checkbox);
|
|
93
|
+
return l === -1 ? { checkboxCell: null, remainingCells: n } : {
|
|
94
|
+
checkboxCell: B(n[l]),
|
|
95
|
+
remainingCells: n.filter((c, i) => i !== l)
|
|
96
|
+
};
|
|
97
|
+
}, K = (n) => {
|
|
98
|
+
const l = T(n.column);
|
|
99
|
+
return l === void 0 ? null : /* @__PURE__ */ o("span", { className: C, children: l });
|
|
100
|
+
}, W = (n) => {
|
|
101
|
+
const l = n.column.columnDef.meta?.align ?? "left";
|
|
102
|
+
return f(d, {
|
|
103
|
+
"justify-start": l === "left",
|
|
104
|
+
"justify-end": l === "right",
|
|
105
|
+
"justify-center": l === "center"
|
|
106
|
+
});
|
|
107
|
+
}, b = /* @__PURE__ */ o(
|
|
108
|
+
m,
|
|
109
|
+
{
|
|
110
|
+
id: t ? `${t}-group-chevron-${e.id}` : void 0,
|
|
111
|
+
testid: r ? `${r}-group-chevron-${e.id}` : void 0,
|
|
112
|
+
noPadding: !0,
|
|
113
|
+
width: `${le + u * 16}px`,
|
|
114
|
+
style: { paddingLeft: u * 16 },
|
|
115
|
+
className: f(d, "justify-center"),
|
|
116
|
+
children: /* @__PURE__ */ o("span", { className: f(G(u), "contents"), children: /* @__PURE__ */ o(Z, { name: x ? "expand_more" : "chevron_right", size: 24 }) })
|
|
117
|
+
}
|
|
118
|
+
), O = (() => {
|
|
119
|
+
if (A === "columns") {
|
|
120
|
+
const i = a === "left" ? e.getLeftVisibleCells() : a === "right" ? e.getRightVisibleCells() : e.getCenterVisibleCells(), g = H?.getVirtualItems() ?? [], p = a ? m : X, { checkboxCell: h, remainingCells: v } = $(i), y = E ? i.find((s) => s.column.columnDef.meta?.checkbox)?.column.id : void 0, Y = e.getLeftVisibleCells().length > 0, q = a === "left" || a === !1 && !Y, S = e.getAllCells().find((s) => s.column.id === e.groupingColumnId), w = !!S?.column.columnDef.meta?.groupCell, J = a === !1 && !w ? /* @__PURE__ */ o(
|
|
121
|
+
m,
|
|
122
|
+
{
|
|
123
|
+
id: t ? `${t}-group-value-${e.id}` : void 0,
|
|
124
|
+
testid: r ? `${r}-group-value-${e.id}` : void 0,
|
|
125
|
+
width: S ? `${S.column.getSize()}px` : void 0,
|
|
126
|
+
className: d,
|
|
127
|
+
children: /* @__PURE__ */ o("span", { className: C, style: { paddingLeft: u * 16 }, children: String(e.groupingValue) })
|
|
128
|
+
}
|
|
129
|
+
) : null, z = (s) => /* @__PURE__ */ o(
|
|
130
|
+
p,
|
|
131
|
+
{
|
|
132
|
+
cell: s,
|
|
133
|
+
id: t ? `${t}-group-cell-${e.id}-${s.column.id}` : void 0,
|
|
134
|
+
testid: r ? `${r}-group-cell-${e.id}-${s.column.id}` : void 0,
|
|
135
|
+
width: `${s.column.getSize()}px`,
|
|
136
|
+
className: W(s),
|
|
137
|
+
children: K(s)
|
|
138
|
+
},
|
|
139
|
+
s.id
|
|
140
|
+
);
|
|
141
|
+
return /* @__PURE__ */ k(L, { children: [
|
|
142
|
+
h,
|
|
143
|
+
q ? b : null,
|
|
144
|
+
J,
|
|
145
|
+
!a && D ? /* @__PURE__ */ o("td", { style: { display: "flex", width: D } }) : null,
|
|
146
|
+
a ? v.map(z) : g.map((s) => {
|
|
147
|
+
const N = i[s.index];
|
|
148
|
+
return !N || N.column.id === y ? null : z(N);
|
|
149
|
+
}),
|
|
150
|
+
!a && I ? /* @__PURE__ */ o("td", { style: { display: "flex", width: I } }) : null
|
|
151
|
+
] });
|
|
152
|
+
}
|
|
153
|
+
if (a === "left") {
|
|
154
|
+
const i = e.getLeftVisibleCells(), { checkboxCell: g, remainingCells: p } = $(i);
|
|
155
|
+
return /* @__PURE__ */ k(L, { children: [
|
|
156
|
+
g,
|
|
157
|
+
b,
|
|
158
|
+
p.slice(1).map((h) => /* @__PURE__ */ o(
|
|
159
|
+
m,
|
|
160
|
+
{
|
|
161
|
+
noPadding: !0,
|
|
162
|
+
width: `${h.column.getSize()}px`,
|
|
163
|
+
className: d
|
|
164
|
+
},
|
|
165
|
+
h.id
|
|
166
|
+
))
|
|
167
|
+
] });
|
|
168
|
+
}
|
|
169
|
+
if (a === "right")
|
|
170
|
+
return e.getRightVisibleCells().map((g) => /* @__PURE__ */ o(
|
|
171
|
+
m,
|
|
172
|
+
{
|
|
173
|
+
noPadding: !0,
|
|
174
|
+
width: `${g.column.getSize()}px`,
|
|
175
|
+
className: d
|
|
176
|
+
},
|
|
177
|
+
g.id
|
|
178
|
+
));
|
|
179
|
+
const n = e.getCenterVisibleCells();
|
|
180
|
+
if (!(e.getLeftVisibleCells().length > 0) && n.length > 0) {
|
|
181
|
+
const { checkboxCell: i, remainingCells: g } = $(n), [, ...p] = g, h = p.reduce(
|
|
182
|
+
(v, y) => v + y.column.getSize(),
|
|
183
|
+
0
|
|
184
|
+
);
|
|
185
|
+
return /* @__PURE__ */ k(L, { children: [
|
|
186
|
+
i,
|
|
187
|
+
b,
|
|
188
|
+
/* @__PURE__ */ o(
|
|
189
|
+
m,
|
|
190
|
+
{
|
|
191
|
+
id: t ? `${t}-group-value-${e.id}` : void 0,
|
|
192
|
+
testid: r ? `${r}-group-value-${e.id}` : void 0,
|
|
193
|
+
colSpan: p.length,
|
|
194
|
+
width: `${h}px`,
|
|
195
|
+
className: d,
|
|
196
|
+
children: /* @__PURE__ */ o("span", { className: C, style: { paddingLeft: u * 16 }, children: String(e.groupingValue) })
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
] });
|
|
200
|
+
}
|
|
201
|
+
const c = n.reduce(
|
|
202
|
+
(i, g) => i + g.column.getSize(),
|
|
203
|
+
0
|
|
204
|
+
);
|
|
205
|
+
return /* @__PURE__ */ o(
|
|
206
|
+
m,
|
|
207
|
+
{
|
|
208
|
+
id: t ? `${t}-group-value-${e.id}` : void 0,
|
|
209
|
+
testid: r ? `${r}-group-value-${e.id}` : void 0,
|
|
210
|
+
colSpan: n.length,
|
|
211
|
+
width: `${c}px`,
|
|
212
|
+
className: d,
|
|
213
|
+
children: /* @__PURE__ */ o("span", { className: C, style: { paddingLeft: u * 16 }, children: String(e.groupingValue) })
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
})();
|
|
217
|
+
return /* @__PURE__ */ o(
|
|
218
|
+
"tr",
|
|
219
|
+
{
|
|
220
|
+
id: t ? `${t}-group-row-${e.id}` : void 0,
|
|
221
|
+
"data-testid": r ? `${r}-group-row-${e.id}` : void 0,
|
|
222
|
+
"data-group-row": "true",
|
|
223
|
+
"data-depth": u,
|
|
224
|
+
role: "row",
|
|
225
|
+
"aria-expanded": x,
|
|
226
|
+
"aria-level": u + 1,
|
|
227
|
+
tabIndex: 0,
|
|
228
|
+
onClick: F,
|
|
229
|
+
onKeyDown: P,
|
|
230
|
+
className: f("flex cursor-pointer min-h-10", d),
|
|
231
|
+
style: {
|
|
232
|
+
display: "flex",
|
|
233
|
+
position: "absolute",
|
|
234
|
+
transform: `translateY(${j ? V.start + 40 : V.start}px)`,
|
|
235
|
+
width: "100%"
|
|
236
|
+
},
|
|
237
|
+
children: O
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
export {
|
|
242
|
+
fe as GroupRow
|
|
243
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox as $ } from "../../Checkbox.js";
|
|
3
|
+
import { DataGridCell as l } from "../../DataGridCell.js";
|
|
4
|
+
import { Input as d } from "../../Input.js";
|
|
5
|
+
function p({
|
|
6
|
+
id: r,
|
|
7
|
+
testid: e,
|
|
8
|
+
column: n
|
|
9
|
+
}) {
|
|
10
|
+
const o = `loading-${n.id}`;
|
|
11
|
+
return n.cell === "checkbox" ? /* @__PURE__ */ i(l, { id: r ? `${r}-${o}` : void 0, testid: e ? `${e}-${o}` : void 0, children: /* @__PURE__ */ i($, { id: r ? `${r}-${o}-checkbox` : void 0, testid: e ? `${e}-${o}-checkbox` : void 0, disabled: !0 }) }, o) : n.cell === "input" ? /* @__PURE__ */ i(
|
|
12
|
+
l,
|
|
13
|
+
{
|
|
14
|
+
id: r ? `${r}-${o}` : void 0,
|
|
15
|
+
testid: e ? `${e}-${o}` : void 0,
|
|
16
|
+
component: "input",
|
|
17
|
+
children: /* @__PURE__ */ i(
|
|
18
|
+
d,
|
|
19
|
+
{
|
|
20
|
+
id: r ? `${r}-${o}-input` : void 0,
|
|
21
|
+
testid: e ? `${e}-${o}-input` : void 0,
|
|
22
|
+
align: "left",
|
|
23
|
+
disabled: !0,
|
|
24
|
+
wrapperClassName: "!rounded-none !border-0"
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
},
|
|
28
|
+
o
|
|
29
|
+
) : /* @__PURE__ */ i(l, { id: r ? `${r}-${o}` : void 0, testid: e ? `${e}-${o}` : void 0, children: /* @__PURE__ */ i("div", { className: "bg-linear-270 to-neutral-300/[24%] from-neutral-300/[12%] rounded-xs w-full max-w-25 h-6" }) }, o);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
p as LoadingCell
|
|
33
|
+
};
|
|
@@ -12,11 +12,12 @@ interface TableBodyRowProps<T> {
|
|
|
12
12
|
showFilterRow: boolean;
|
|
13
13
|
enableColumnSelector?: boolean;
|
|
14
14
|
locked?: boolean;
|
|
15
|
-
pinDirection?:
|
|
15
|
+
pinDirection?: 'left' | 'right';
|
|
16
|
+
groupSelectionMode?: 'group' | 'row' | 'both';
|
|
16
17
|
disabled?: boolean;
|
|
17
18
|
hoveredRowId?: string | null;
|
|
18
19
|
setHoveredRowId?: (rowId: string | null) => void;
|
|
19
20
|
}
|
|
20
|
-
export declare function TableBodyRow<T>({ id, testid, columnVirtualizer, row, virtualPaddingLeft, virtualPaddingRight, virtualRow, showFilterRow, locked, pinDirection, disabled, hoveredRowId, setHoveredRowId, }: TableBodyRowProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function TableBodyRow<T>({ id, testid, columnVirtualizer, row, virtualPaddingLeft, virtualPaddingRight, virtualRow, showFilterRow, locked, pinDirection, groupSelectionMode, disabled, hoveredRowId, setHoveredRowId, }: TableBodyRowProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
export {};
|
|
22
23
|
//# sourceMappingURL=TableBodyRow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBodyRow.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/TableBody/TableBodyRow.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"TableBodyRow.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/TableBody/TableBodyRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAwCnE,UAAU,iBAAiB,CAAC,CAAC;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,WAAW,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC;IACtE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,cAAc,EAAE,WAAW,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;IACjE,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,WAAW,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,EAAE,EACF,MAAM,EACN,iBAAiB,EACjB,GAAG,EAEH,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,aAAa,EAEb,MAAM,EACN,YAAY,EACZ,kBAA0B,EAC1B,QAAQ,EACR,YAAY,EACZ,eAAe,GAChB,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAqJtB"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsxs as z, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as y } from "../../../node_modules/clsx/dist/clsx.js";
|
|
3
|
+
import { DataGridCell as A, DragAlongCell as E } from "../../DataGridCell.js";
|
|
4
|
+
import { Paragraph as F } from "../../Paragraph.js";
|
|
5
|
+
import { Tooltip as K } from "../../Tooltip.js";
|
|
6
|
+
import { formatDate as T } from "../../../utils/date.js";
|
|
7
|
+
import { formatCurrencyDisplay as I } from "../../../utils/formatting.js";
|
|
8
|
+
import { handleRowArrowKeyDown as M } from "../utils.js";
|
|
9
|
+
function h({
|
|
10
|
+
cell: o
|
|
11
|
+
}) {
|
|
12
|
+
const n = o.column.columnDef.cell;
|
|
13
|
+
return n == null ? null : typeof n == "function" ? n(o.getContext()) : n;
|
|
14
|
+
}
|
|
15
|
+
const b = {
|
|
16
|
+
date: (o) => typeof o == "string" ? T(o) : "",
|
|
17
|
+
currency: (o) => I(o)
|
|
18
|
+
};
|
|
19
|
+
function N(o) {
|
|
20
|
+
return typeof o == "string" && o in b;
|
|
21
|
+
}
|
|
22
|
+
function J({
|
|
23
|
+
id: o,
|
|
24
|
+
testid: n,
|
|
25
|
+
columnVirtualizer: x,
|
|
26
|
+
row: t,
|
|
27
|
+
// rowVirtualizer,
|
|
28
|
+
virtualPaddingLeft: d,
|
|
29
|
+
virtualPaddingRight: f,
|
|
30
|
+
virtualRow: a,
|
|
31
|
+
showFilterRow: C,
|
|
32
|
+
// enableColumnSelector = false,
|
|
33
|
+
locked: r,
|
|
34
|
+
pinDirection: D,
|
|
35
|
+
groupSelectionMode: v = "row",
|
|
36
|
+
disabled: i,
|
|
37
|
+
hoveredRowId: V,
|
|
38
|
+
setHoveredRowId: g
|
|
39
|
+
}) {
|
|
40
|
+
let c;
|
|
41
|
+
r ? c = D === "left" ? t.getLeftVisibleCells() : t.getRightVisibleCells() : c = t.getCenterVisibleCells();
|
|
42
|
+
const S = x?.getVirtualItems() ?? [], j = r ? c : S, w = typeof t.original == "object" && t.original !== null && "rowState" in t.original && t.original.rowState === "error", m = r ? A : E, k = V === t.id;
|
|
43
|
+
return /* @__PURE__ */ z(
|
|
44
|
+
"tr",
|
|
45
|
+
{
|
|
46
|
+
className: y(
|
|
47
|
+
"min-h-10",
|
|
48
|
+
"transition-colors",
|
|
49
|
+
!i && (a.index % 2 === 0 ? "bg-background-grouped-primary-normal" : "bg-background-grouped-secondary-normal"),
|
|
50
|
+
!i && k && "!bg-background-action-secondary-hover",
|
|
51
|
+
t.getIsSelected() && !i && "!bg-background-action-secondary-hover",
|
|
52
|
+
w && !i && "!bg-background-action-critical-secondary-hover"
|
|
53
|
+
),
|
|
54
|
+
onMouseEnter: () => g?.(t.id),
|
|
55
|
+
onMouseLeave: () => g?.(null),
|
|
56
|
+
id: o ? `${o}-row-${t.id}` : void 0,
|
|
57
|
+
"data-testid": n ? `${n}-row-${t.id}` : void 0,
|
|
58
|
+
role: "row",
|
|
59
|
+
tabIndex: 0,
|
|
60
|
+
onKeyDown: M,
|
|
61
|
+
style: {
|
|
62
|
+
display: "flex",
|
|
63
|
+
position: "absolute",
|
|
64
|
+
transform: `translateY(${C ? a.start + 40 : a.start}px)`,
|
|
65
|
+
width: "100%"
|
|
66
|
+
},
|
|
67
|
+
children: [
|
|
68
|
+
!r && d ? (
|
|
69
|
+
// fake empty column to the left for virtualization scroll padding
|
|
70
|
+
/* @__PURE__ */ l("td", { style: { display: "flex", width: d } })
|
|
71
|
+
) : null,
|
|
72
|
+
j.map((p) => {
|
|
73
|
+
const e = r ? p : c[p.index];
|
|
74
|
+
if (!e)
|
|
75
|
+
return;
|
|
76
|
+
if (e.column.columnDef.meta?.checkbox && v === "group")
|
|
77
|
+
return /* @__PURE__ */ l(
|
|
78
|
+
m,
|
|
79
|
+
{
|
|
80
|
+
id: o ? `${o}-row-${t.id}-cell-${e.id}` : void 0,
|
|
81
|
+
testid: n ? `${n}-row-${t.id}-cell-${e.id}` : void 0,
|
|
82
|
+
cell: e,
|
|
83
|
+
width: `${e.column.getSize()}px`
|
|
84
|
+
},
|
|
85
|
+
e.id
|
|
86
|
+
);
|
|
87
|
+
const s = e.column.columnDef.meta?.format, u = s && N(s) ? b[s](e.getValue()) : e.getValue(), $ = e.column.columnDef.meta?.align ?? (typeof u == "number" ? "right" : "left");
|
|
88
|
+
return e.column.columnDef.meta?.useCustomRenderer && e.column.columnDef.meta?.checkbox ? /* @__PURE__ */ l(
|
|
89
|
+
m,
|
|
90
|
+
{
|
|
91
|
+
id: o ? `${o}-row-${t.id}-cell-${e.id}` : void 0,
|
|
92
|
+
testid: n ? `${n}-row-${t.id}-cell-${e.id}` : void 0,
|
|
93
|
+
cell: e,
|
|
94
|
+
width: `${e.column.getSize()}px`,
|
|
95
|
+
component: "checkbox",
|
|
96
|
+
children: /* @__PURE__ */ l(h, { cell: e })
|
|
97
|
+
},
|
|
98
|
+
e.id
|
|
99
|
+
) : e.column.columnDef.meta?.useCustomRenderer ? /* @__PURE__ */ l(h, { cell: e }, e.id) : /* @__PURE__ */ l(
|
|
100
|
+
m,
|
|
101
|
+
{
|
|
102
|
+
id: o ? `${o}-row-${t.id}-cell-${e.id}` : void 0,
|
|
103
|
+
testid: n ? `${n}-row-${t.id}-cell-${e.id}` : void 0,
|
|
104
|
+
cell: e,
|
|
105
|
+
width: `${e.column.getSize()}px`,
|
|
106
|
+
className: y({
|
|
107
|
+
"justify-start": $ === "left",
|
|
108
|
+
"justify-end": $ === "right"
|
|
109
|
+
}),
|
|
110
|
+
children: /* @__PURE__ */ l(
|
|
111
|
+
K,
|
|
112
|
+
{
|
|
113
|
+
id: o ? `${o}-tooltip-${e.id}` : void 0,
|
|
114
|
+
testid: n ? `${n}-tooltip-${e.id}` : void 0,
|
|
115
|
+
showOnTruncation: !0,
|
|
116
|
+
message: u,
|
|
117
|
+
position: "bottom",
|
|
118
|
+
children: /* @__PURE__ */ l(F, { addOverflow: !0, tall: !0, children: u })
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
},
|
|
122
|
+
e.id
|
|
123
|
+
);
|
|
124
|
+
}),
|
|
125
|
+
!r && f ? (
|
|
126
|
+
// fake empty column to the right for virtualization scroll padding
|
|
127
|
+
/* @__PURE__ */ l("td", { style: { display: "flex", width: f } })
|
|
128
|
+
) : null
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
t.id
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
J as TableBodyRow
|
|
136
|
+
};
|
|
@@ -16,11 +16,13 @@ interface TableBodyProps<TData extends RowData> {
|
|
|
16
16
|
enableColumnSelector?: boolean;
|
|
17
17
|
locked?: boolean;
|
|
18
18
|
pinDirection?: "left" | "right";
|
|
19
|
+
groupRowMode?: "spanning" | "columns";
|
|
20
|
+
groupSelectionMode?: "group" | "row" | "both";
|
|
19
21
|
rowDisabled?: boolean;
|
|
20
22
|
rowDisabledAccessor?: (row: TData) => boolean;
|
|
21
23
|
hoveredRowId?: string | null;
|
|
22
24
|
setHoveredRowId?: (rowId: string | null) => void;
|
|
23
25
|
}
|
|
24
|
-
export declare function TableBody<T>({ id, testid, columnVirtualizer, table, tableContainerRef, virtualPaddingLeft, virtualPaddingRight, pagination, isLoadingMore, hasMore, showFilterRow, enableColumnSelector, locked, pinDirection, rowDisabled, rowDisabledAccessor, hoveredRowId, setHoveredRowId, }: TableBodyProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function TableBody<T>({ id, testid, columnVirtualizer, table, tableContainerRef, virtualPaddingLeft, virtualPaddingRight, pagination, isLoadingMore, hasMore, showFilterRow, enableColumnSelector, locked, pinDirection, groupRowMode, groupSelectionMode, rowDisabled, rowDisabledAccessor, hoveredRowId, setHoveredRowId, }: TableBodyProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
25
27
|
export {};
|
|
26
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/TableBody/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAkB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/TableBody/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAkB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAQ9C,UAAU,cAAc,CAAC,KAAK,SAAS,OAAO;IAC5C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,WAAW,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC;IACtE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC1D,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC3C,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,YAAY,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACtC,kBAAkB,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAC9C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,OAAO,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAClD;AACD,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAC3B,EAAE,EACF,MAAM,EACN,iBAAiB,EACjB,KAAK,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,OAAO,EACP,aAAa,EACb,oBAA4B,EAC5B,MAAM,EACN,YAAY,EACZ,YAAyB,EACzB,kBAA0B,EAC1B,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,eAAe,GAChB,EAAE,cAAc,CAAC,CAAC,CAAC,2CA4KnB"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { jsxs as L, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useVirtualizer as T } from "../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
3
|
+
import { DataGridCell as V, DragAlongCell as H } from "../../DataGridCell.js";
|
|
4
|
+
import { Search as N } from "../../Search.js";
|
|
5
|
+
import { clsx as R } from "../../../node_modules/clsx/dist/clsx.js";
|
|
6
|
+
import { TableBodyRow as j } from "./TableBodyRow.js";
|
|
7
|
+
import { GroupRow as B } from "./GroupRow.js";
|
|
8
|
+
import { LoadingCell as E } from "./LoadingCell.js";
|
|
9
|
+
function K({
|
|
10
|
+
id: l,
|
|
11
|
+
testid: o,
|
|
12
|
+
columnVirtualizer: c,
|
|
13
|
+
table: n,
|
|
14
|
+
tableContainerRef: h,
|
|
15
|
+
virtualPaddingLeft: p,
|
|
16
|
+
virtualPaddingRight: d,
|
|
17
|
+
pagination: v,
|
|
18
|
+
isLoadingMore: C,
|
|
19
|
+
hasMore: b,
|
|
20
|
+
showFilterRow: a,
|
|
21
|
+
enableColumnSelector: w = !1,
|
|
22
|
+
locked: i,
|
|
23
|
+
pinDirection: m,
|
|
24
|
+
groupRowMode: G = "spanning",
|
|
25
|
+
groupSelectionMode: f = "row",
|
|
26
|
+
rowDisabled: z,
|
|
27
|
+
rowDisabledAccessor: y,
|
|
28
|
+
hoveredRowId: S,
|
|
29
|
+
setHoveredRowId: k
|
|
30
|
+
}) {
|
|
31
|
+
const { rows: x } = n.getRowModel(), s = T({
|
|
32
|
+
count: x.length,
|
|
33
|
+
estimateSize: () => 40,
|
|
34
|
+
getScrollElement: () => h.current,
|
|
35
|
+
overscan: 8
|
|
36
|
+
}), u = s.getVirtualItems(), I = i ? V : H;
|
|
37
|
+
let g;
|
|
38
|
+
return m === "left" ? g = n.getLeftHeaderGroups() : m === "right" ? g = n.getRightHeaderGroups() : g = n.getCenterHeaderGroups(), /* @__PURE__ */ L(
|
|
39
|
+
"tbody",
|
|
40
|
+
{
|
|
41
|
+
className: R(i ? "shadow-16" : ""),
|
|
42
|
+
style: {
|
|
43
|
+
display: "grid",
|
|
44
|
+
height: `${a ? s.getTotalSize() + 40 : s.getTotalSize()}px`,
|
|
45
|
+
// tells scrollbar how big the table is
|
|
46
|
+
position: "relative"
|
|
47
|
+
// needed for absolute positioning of rows
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
a && /* @__PURE__ */ t(
|
|
51
|
+
"tr",
|
|
52
|
+
{
|
|
53
|
+
style: {
|
|
54
|
+
display: "flex",
|
|
55
|
+
position: "sticky",
|
|
56
|
+
top: "40px",
|
|
57
|
+
width: "100%",
|
|
58
|
+
height: "40px",
|
|
59
|
+
zIndex: 10
|
|
60
|
+
},
|
|
61
|
+
className: "even:bg-background-grouped-primary-normal odd:bg-background-grouped-secondary-normal",
|
|
62
|
+
"data-testid": o ? `${o}-filter-row` : void 0,
|
|
63
|
+
children: g.flatMap(
|
|
64
|
+
(r) => r.headers.map((e) => /* @__PURE__ */ t(
|
|
65
|
+
I,
|
|
66
|
+
{
|
|
67
|
+
id: l ? `${l}-filter-cell-${e.id}` : void 0,
|
|
68
|
+
testid: o ? `${o}-filter-cell-${e.id}` : void 0,
|
|
69
|
+
noPadding: !0,
|
|
70
|
+
cell: e,
|
|
71
|
+
width: e.column.columnDef.meta?.headerWidth || `${e.column.getSize()}px`,
|
|
72
|
+
children: e.column.getCanFilter() && (e.column.columnDef.meta?.filterRowCell?.({
|
|
73
|
+
header: e,
|
|
74
|
+
table: n
|
|
75
|
+
}) ?? /* @__PURE__ */ t(
|
|
76
|
+
N,
|
|
77
|
+
{
|
|
78
|
+
id: l ? `${l}-filter-search-${e.id}` : void 0,
|
|
79
|
+
testid: o ? `${o}-filter-search-${e.id}` : void 0,
|
|
80
|
+
removeRoundness: !0,
|
|
81
|
+
onChange: ($) => e.column.setFilterValue($.target.value),
|
|
82
|
+
value: e.column.getFilterValue() ?? "",
|
|
83
|
+
placeholder: "",
|
|
84
|
+
removeSearchIcon: !0
|
|
85
|
+
}
|
|
86
|
+
))
|
|
87
|
+
},
|
|
88
|
+
e.id
|
|
89
|
+
))
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
u.map((r) => {
|
|
94
|
+
const e = x[r.index];
|
|
95
|
+
return e.getIsGrouped() ? /* @__PURE__ */ t(
|
|
96
|
+
B,
|
|
97
|
+
{
|
|
98
|
+
id: l,
|
|
99
|
+
testid: o,
|
|
100
|
+
row: e,
|
|
101
|
+
virtualRow: r,
|
|
102
|
+
showFilterRow: a,
|
|
103
|
+
locked: i ? m === "left" ? "left" : "right" : !1,
|
|
104
|
+
groupRowMode: G,
|
|
105
|
+
groupSelectionMode: f,
|
|
106
|
+
columnVirtualizer: c,
|
|
107
|
+
virtualPaddingLeft: p,
|
|
108
|
+
virtualPaddingRight: d
|
|
109
|
+
},
|
|
110
|
+
e.id
|
|
111
|
+
) : /* @__PURE__ */ t(
|
|
112
|
+
j,
|
|
113
|
+
{
|
|
114
|
+
id: l,
|
|
115
|
+
testid: o,
|
|
116
|
+
columnVirtualizer: c,
|
|
117
|
+
row: e,
|
|
118
|
+
rowVirtualizer: s,
|
|
119
|
+
virtualPaddingLeft: p,
|
|
120
|
+
virtualPaddingRight: d,
|
|
121
|
+
virtualRow: r,
|
|
122
|
+
showFilterRow: a,
|
|
123
|
+
enableColumnSelector: w,
|
|
124
|
+
locked: i,
|
|
125
|
+
pinDirection: m,
|
|
126
|
+
groupSelectionMode: f,
|
|
127
|
+
disabled: y ? y(e.original) : z,
|
|
128
|
+
hoveredRowId: S,
|
|
129
|
+
setHoveredRowId: k
|
|
130
|
+
},
|
|
131
|
+
e.id
|
|
132
|
+
);
|
|
133
|
+
}),
|
|
134
|
+
!v && C && b && /* @__PURE__ */ t(
|
|
135
|
+
"tr",
|
|
136
|
+
{
|
|
137
|
+
style: {
|
|
138
|
+
display: "flex",
|
|
139
|
+
position: "absolute",
|
|
140
|
+
width: "100%",
|
|
141
|
+
transform: `translateY(${u[u.length - 1].start + 40}px)`
|
|
142
|
+
},
|
|
143
|
+
className: "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal",
|
|
144
|
+
children: n.getAllLeafColumns().map((r) => /* @__PURE__ */ t(
|
|
145
|
+
E,
|
|
146
|
+
{
|
|
147
|
+
id: l,
|
|
148
|
+
testid: o,
|
|
149
|
+
column: r.columnDef
|
|
150
|
+
},
|
|
151
|
+
r.id
|
|
152
|
+
))
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
K as TableBody
|
|
161
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataGridProps } from './types';
|
|
2
|
-
export declare function DataGrid<T extends Record<string, unknown>>({ id, rowIdAccessor, testid, data, columns, status, isLoadingMore, onLoadMore, pagination, showFilterRow, hasMore, sorting: externalSorting, onSortingChange, columnFilters: externalColumnFilters, onColumnFiltersChange, rowSelection: externalRowSelection, onRowSelectionChange, filteredSortedData, totalRowCount, hideStatusBar, centerHeader, enableColumnSelector, predeterminedLeftPins, predeterminedRightPins, useMenuDefaultMinWidth, rowDisabled, rowDisabledAccessor, ref, }: DataGridProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function DataGrid<T extends Record<string, unknown>>({ id, rowIdAccessor, testid, data, columns, status, isLoadingMore, onLoadMore, pagination, showFilterRow, hasMore, sorting: externalSorting, onSortingChange, columnFilters: externalColumnFilters, onColumnFiltersChange, rowSelection: externalRowSelection, onRowSelectionChange, filteredSortedData, totalRowCount, hideStatusBar, centerHeader, enableColumnSelector, predeterminedLeftPins, predeterminedRightPins, useMenuDefaultMinWidth, rowDisabled, rowDisabledAccessor, isLoading, loadingMessage, loadingDescription, maxHeight, fillHeight, manualFiltering, notifications, summaryRow, groupBy, groupRowMode, groupDefaultExpand, allowUserGrouping, groupSelectionMode, hideGroupedColumns, grouping: externalGrouping, onGroupingChange, expanded: externalExpanded, onExpandedChange, ref, }: DataGridProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export type { ColumnDef } from '@tanstack/react-table';
|
|
4
4
|
export default DataGrid;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/index.tsx"],"names":[],"mappings":"AAsDA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAgBxC,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC1D,EAAE,EACF,aAAa,EACb,MAAM,EACN,IAAI,EACJ,OAAO,EACP,MAAM,EACN,aAAqB,EACrB,UAAU,EACV,UAAU,EACV,aAAqB,EACrB,OAAe,EACf,OAAO,EAAE,eAAe,EACxB,eAAe,EACf,aAAa,EAAE,qBAAqB,EACpC,qBAAqB,EACrB,YAAY,EAAE,oBAAoB,EAClC,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,qBAA0B,EAC1B,sBAA2B,EAC3B,sBAAsB,EACtB,WAAW,EACX,mBAAmB,EACnB,SAAiB,EACjB,cAAkC,EAClC,kBAAkB,EAClB,SAAS,EACT,UAAkB,EAClB,eAAuB,EACvB,aAAa,EACb,UAAU,EACV,OAAO,EACP,YAAyB,EACzB,kBAA2B,EAC3B,iBAAiB,EACjB,kBAA0B,EAC1B,kBAAkB,EAClB,QAAQ,EAAE,gBAAgB,EAC1B,gBAAgB,EAChB,QAAQ,EAAE,gBAAgB,EAC1B,gBAAgB,EAChB,GAAG,GACJ,EAAE,aAAa,CAAC,CAAC,CAAC,2CAi7BlB;AAeD,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,eAAe,QAAQ,CAAC"}
|