@dmsi/wedgekit-react 2.0.0 → 2.0.2
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.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.js +78 -0
- package/dist/components/Breadcrumbs.js +111 -0
- package/dist/components/Button.js +137 -0
- package/dist/components/CalendarRange.d.ts.map +1 -1
- package/dist/components/CalendarRange.js +406 -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 +121 -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.d.ts.map +1 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +28 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.d.ts.map +1 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +80 -0
- package/dist/components/DataGrid/PinnedColumns.js +165 -0
- package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
- package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
- package/dist/components/DataGrid/SummaryRow/index.js +86 -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.js +136 -0
- package/dist/components/DataGrid/TableBody/index.js +161 -0
- package/dist/components/DataGrid/index.js +696 -0
- package/dist/components/DataGrid/utils.js +20 -0
- package/dist/components/DataGridCell.js +412 -0
- package/dist/components/DataTable.js +700 -0
- package/dist/components/DateInput.d.ts.map +1 -1
- package/dist/components/DateInput.js +194 -0
- package/dist/components/DateRangeInput.d.ts.map +1 -1
- package/dist/components/DateRangeInput.js +369 -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.d.ts.map +1 -1
- package/dist/components/EmblaCarousel/index.js +154 -0
- package/dist/components/EmblaCarousel/usePrevNextButtons.d.ts.map +1 -1
- package/dist/components/EmblaCarousel/usePrevNextButtons.js +22 -0
- package/dist/components/EmblaCarousel/useSelectedSnapDisplay.d.ts.map +1 -1
- package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +16 -0
- package/dist/components/EmptyCartIcon.js +25 -0
- 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.js +73 -0
- package/dist/components/ImagePlaceholder.d.ts.map +1 -1
- package/dist/components/ImagePlaceholder.js +23 -0
- 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 +55 -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.js +202 -0
- package/dist/components/MenuOption.js +161 -0
- package/dist/components/MobileDataGrid/ColumnList.js +85 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +101 -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.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/GridContextProvider/index.js +81 -0
- package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +12 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
- package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
- package/dist/components/MobileDataGrid/index.js +78 -0
- package/dist/components/MobileNavMenu.js +173 -0
- package/dist/components/Modal.js +201 -0
- package/dist/components/ModalButtons.js +57 -0
- 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.js +119 -0
- package/dist/components/Notification.js +91 -0
- 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.js +124 -0
- 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.map +1 -1
- package/dist/components/ProductImagePreview/MobileImageCarousel.js +147 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +139 -0
- package/dist/components/ProductImagePreview/Thumbnail.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/Thumbnail.js +47 -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 +190 -0
- package/dist/components/ProductImagePreview/useProductImagePreview.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/useProductImagePreview.js +86 -0
- 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.d.ts.map +1 -1
- package/dist/components/SearchResultImage/index.js +27 -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.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.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.js +25 -0
- package/dist/components/Time.d.ts.map +1 -1
- package/dist/components/Time.js +226 -0
- package/dist/components/Toast.js +170 -0
- package/dist/components/Tooltip.js +102 -0
- package/dist/components/TopBar.js +119 -0
- package/dist/components/Upload.js +107 -0
- package/dist/components/WorldpayIframe.js +19 -0
- package/dist/hooks/useEditCell.d.ts.map +1 -1
- package/dist/hooks/useEditCell.js +24 -0
- package/dist/hooks/useInfiniteScroll.js +25 -0
- package/dist/hooks/useKeydown.d.ts.map +1 -1
- package/dist/hooks/useKeydown.js +21 -0
- package/dist/hooks/useMatchesMedia.d.ts.map +1 -1
- package/dist/hooks/useMatchesMedia.js +16 -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 -53839
- 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/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.d.ts +1 -1
- 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,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
|
+
};
|
|
@@ -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
|
+
};
|