@dmsi/wedgekit-react 0.0.550 → 0.0.552
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-U3QGZAVS.js → chunk-JADOJNBI.js} +4 -4
- package/dist/{chunk-N2KPADIL.js → chunk-WNGFRQ4Y.js} +7 -7
- package/dist/{chunk-ZVY3TLXL.js → chunk-ZIPJMN2E.js} +4 -4
- package/dist/components/Alert.js +2 -2
- package/dist/components/CalendarRange.js +10 -10
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +10 -10
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +10 -10
- package/dist/components/DataGrid/PinnedColumns.js +10 -10
- package/dist/components/DataGrid/TableBody/LoadingCell.js +10 -10
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +10 -10
- package/dist/components/DataGrid/TableBody/index.js +10 -10
- package/dist/components/DataGrid/index.js +10 -10
- package/dist/components/DataGrid/utils.js +10 -10
- package/dist/components/DateInput.js +10 -10
- package/dist/components/DateRangeInput.js +10 -10
- package/dist/components/FilterGroup.js +5 -5
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +10 -10
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +10 -10
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +5 -5
- package/dist/components/MobileDataGrid/index.js +10 -10
- package/dist/components/Modal.js +4 -4
- package/dist/components/ModalButtons.js +2 -2
- package/dist/components/ModalHeader.js +2 -2
- package/dist/components/NavigationTab.js +2 -2
- package/dist/components/NavigationTabs.js +2 -2
- package/dist/components/NestedMenu.js +3 -3
- package/dist/components/Notification.js +3 -3
- package/dist/components/OptionPill.js +2 -2
- package/dist/components/PDFViewer/DownloadIcon.js +2 -2
- package/dist/components/PDFViewer/PDFNavigation.js +2 -2
- package/dist/components/PDFViewer/index.js +6 -6
- package/dist/components/ProductImagePreview/index.js +1 -1
- package/dist/components/Stepper.js +3 -3
- package/dist/components/Toast.js +3 -3
- package/dist/components/Upload.js +3 -3
- package/dist/components/index.js +16 -16
- package/package.json +8 -9
- package/src/brand.css +0 -125
- package/src/classNames.ts +0 -174
- package/src/components/AccessChangerTabItem.tsx +0 -71
- package/src/components/Accordion.tsx +0 -108
- package/src/components/Alert.tsx +0 -81
- package/src/components/Breadcrumbs.tsx +0 -142
- package/src/components/Button.tsx +0 -216
- package/src/components/CalendarRange.tsx +0 -628
- package/src/components/Caption.tsx +0 -144
- package/src/components/Card.tsx +0 -88
- package/src/components/Checkbox.tsx +0 -206
- package/src/components/CompactImagesPreview.tsx +0 -135
- package/src/components/ContentTab.tsx +0 -84
- package/src/components/ContentTabs.tsx +0 -136
- package/src/components/DMSiLogo.tsx +0 -33
- package/src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx +0 -35
- package/src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx +0 -74
- package/src/components/DataGrid/PinnedColumns.tsx +0 -183
- package/src/components/DataGrid/TableBody/LoadingCell.tsx +0 -44
- package/src/components/DataGrid/TableBody/TableBodyRow.tsx +0 -157
- package/src/components/DataGrid/TableBody/index.tsx +0 -185
- package/src/components/DataGrid/index.tsx +0 -756
- package/src/components/DataGrid/types.ts +0 -98
- package/src/components/DataGrid/utils.tsx +0 -15
- package/src/components/DataGridCell.tsx +0 -526
- package/src/components/DataTable.tsx +0 -881
- package/src/components/DateInput.tsx +0 -306
- package/src/components/DateRangeInput.tsx +0 -758
- package/src/components/DebugJson.tsx +0 -28
- package/src/components/Display.tsx +0 -66
- package/src/components/EditingContext.tsx +0 -43
- package/src/components/EmptyCartIcon.tsx +0 -18
- package/src/components/FilterGroup.tsx +0 -264
- package/src/components/FullViewportBox.tsx +0 -19
- package/src/components/Grid.tsx +0 -97
- package/src/components/Heading.tsx +0 -72
- package/src/components/HorizontalDivider.tsx +0 -22
- package/src/components/Icon.tsx +0 -39
- package/src/components/ImagePlaceholder.tsx +0 -22
- package/src/components/Input.tsx +0 -609
- package/src/components/InputGroup.tsx +0 -59
- package/src/components/Label.tsx +0 -46
- package/src/components/Link.tsx +0 -117
- package/src/components/List.tsx +0 -18
- package/src/components/ListGroup.tsx +0 -82
- package/src/components/LiveChatComponent.tsx +0 -56
- package/src/components/LoadingScrim.tsx +0 -33
- package/src/components/LogoAgilityTopBar.tsx +0 -54
- package/src/components/LogoDMSiTopBar.tsx +0 -33
- package/src/components/LogoMillworkTopBar.tsx +0 -119
- package/src/components/MainBar.tsx +0 -91
- package/src/components/MaxViewportBox.tsx +0 -19
- package/src/components/Menu.tsx +0 -316
- package/src/components/MenuOption.tsx +0 -330
- package/src/components/MobileDataGrid/ColumnList.tsx +0 -66
- package/src/components/MobileDataGrid/ColumnSelector/index.tsx +0 -97
- package/src/components/MobileDataGrid/GridContextProvider/GridContext.tsx +0 -25
- package/src/components/MobileDataGrid/GridContextProvider/index.tsx +0 -132
- package/src/components/MobileDataGrid/GridContextProvider/useGridContext.ts +0 -10
- package/src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx +0 -27
- package/src/components/MobileDataGrid/MobileDataGridCard/index.tsx +0 -138
- package/src/components/MobileDataGrid/MobileDataGridHeader.tsx +0 -81
- package/src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx +0 -42
- package/src/components/MobileDataGrid/RowDetailModalProvider/index.tsx +0 -68
- package/src/components/MobileDataGrid/dataGridReducer.ts +0 -55
- package/src/components/MobileDataGrid/index.tsx +0 -92
- package/src/components/MobileDataGrid/types.ts +0 -4
- package/src/components/Modal.tsx +0 -312
- package/src/components/ModalButtons.tsx +0 -62
- package/src/components/ModalContent.tsx +0 -31
- package/src/components/ModalHeader.tsx +0 -78
- package/src/components/ModalScrim.tsx +0 -42
- package/src/components/NavigationTab.tsx +0 -95
- package/src/components/NavigationTabs.tsx +0 -70
- package/src/components/NestedMenu.tsx +0 -131
- package/src/components/Notification.tsx +0 -128
- package/src/components/OptionPill.tsx +0 -139
- package/src/components/OrderCheckIcon.tsx +0 -19
- package/src/components/PDFViewer/DownloadIcon.tsx +0 -25
- package/src/components/PDFViewer/PDFElement.tsx +0 -90
- package/src/components/PDFViewer/PDFNavigation.tsx +0 -68
- package/src/components/PDFViewer/PDFPage.tsx +0 -34
- package/src/components/PDFViewer/index.tsx +0 -128
- package/src/components/Pagination.tsx +0 -182
- package/src/components/Paragraph.tsx +0 -55
- package/src/components/Password.tsx +0 -62
- package/src/components/ProductImagePreview/CarouselPagination.tsx +0 -54
- package/src/components/ProductImagePreview/MobileImageCarousel.tsx +0 -226
- package/src/components/ProductImagePreview/ProductPrimaryImage.tsx +0 -219
- package/src/components/ProductImagePreview/Thumbnail.tsx +0 -55
- package/src/components/ProductImagePreview/ZoomWindow.tsx +0 -136
- package/src/components/ProductImagePreview/index.tsx +0 -182
- package/src/components/ProductImagePreview/useProductImagePreview.ts +0 -211
- package/src/components/ProjectBar.tsx +0 -82
- package/src/components/Radio.tsx +0 -146
- package/src/components/Search.tsx +0 -152
- package/src/components/SearchResultImage/index.tsx +0 -39
- package/src/components/Select.tsx +0 -114
- package/src/components/SideMenu.tsx +0 -30
- package/src/components/SideMenuGroup.tsx +0 -95
- package/src/components/SideMenuItem.tsx +0 -109
- package/src/components/SimpleTable.tsx +0 -77
- package/src/components/SkeletonParagraph.tsx +0 -31
- package/src/components/Spinner.tsx +0 -32
- package/src/components/Stack.tsx +0 -347
- package/src/components/StatusPill.tsx +0 -59
- package/src/components/Stepper.tsx +0 -128
- package/src/components/Subheader.tsx +0 -50
- package/src/components/Surface.tsx +0 -37
- package/src/components/Swatch.tsx +0 -1341
- package/src/components/Textarea.tsx +0 -102
- package/src/components/Theme.tsx +0 -27
- package/src/components/Time.tsx +0 -460
- package/src/components/Toast.tsx +0 -268
- package/src/components/Tooltip.tsx +0 -159
- package/src/components/TopBar.tsx +0 -139
- package/src/components/Upload.tsx +0 -107
- package/src/components/WorldpayIframe.tsx +0 -7
- package/src/components/index.ts +0 -34
- package/src/components/useMenuSystem.tsx +0 -456
- package/src/components/useMounted.tsx +0 -14
- package/src/darkmode.css +0 -278
- package/src/fonts.css +0 -23
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useInfiniteScroll.tsx +0 -40
- package/src/hooks/useKeydown.ts +0 -42
- package/src/hooks/useMatchesMedia.ts +0 -18
- package/src/hooks/useTableLayout.ts +0 -106
- package/src/index.css +0 -800
- package/src/index.tsx +0 -5
- package/src/types.ts +0 -150
- package/src/utils/date.ts +0 -236
- package/src/utils/formatting.tsx +0 -81
- package/src/utils/index.ts +0 -4
- package/src/utils/mergeObjectArrays.ts +0 -18
- package/src/utils.ts +0 -24
- package/dist/{chunk-7FQ7PGUF.js → chunk-7COWXCPA.js} +3 -3
- package/dist/{chunk-NKCFYM7A.js → chunk-7SFFUICM.js} +3 -3
- package/dist/{chunk-25RZP3VR.js → chunk-AKJUBFJK.js} +3 -3
- package/dist/{chunk-TAPYQBQU.js → chunk-CMMQTIVM.js} +3 -3
- package/dist/{chunk-GYEXSNFP.js → chunk-FWCVZWE6.js} +3 -3
- package/dist/{chunk-MV6W7OMC.js → chunk-QMMPHXVE.js} +3 -3
- package/dist/{chunk-GG5OZTI5.js → chunk-XRE52QTN.js} +3 -3
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { HeaderGroup, Row, RowData, Table } from "@tanstack/react-table";
|
|
2
|
-
import { useVirtualizer, Virtualizer } from "@tanstack/react-virtual";
|
|
3
|
-
import { DataGridPagination } from "../types";
|
|
4
|
-
import { DataGridCell, DragAlongCell, Search } from "../..";
|
|
5
|
-
import clsx from "clsx";
|
|
6
|
-
import { TableBodyRow } from "./TableBodyRow";
|
|
7
|
-
import { LoadingCell } from "./LoadingCell";
|
|
8
|
-
|
|
9
|
-
interface TableBodyProps<TData extends RowData> {
|
|
10
|
-
id?: string;
|
|
11
|
-
testid?: string;
|
|
12
|
-
columnVirtualizer?: Virtualizer<HTMLDivElement, HTMLTableCellElement>;
|
|
13
|
-
table: Table<TData>;
|
|
14
|
-
tableContainerRef: React.RefObject<HTMLDivElement | null>;
|
|
15
|
-
virtualPaddingLeft?: number | undefined;
|
|
16
|
-
virtualPaddingRight?: number | undefined;
|
|
17
|
-
pagination: DataGridPagination | undefined;
|
|
18
|
-
isLoadingMore: boolean;
|
|
19
|
-
hasMore: boolean;
|
|
20
|
-
showFilterRow: boolean;
|
|
21
|
-
enableColumnSelector?: boolean;
|
|
22
|
-
locked?: boolean;
|
|
23
|
-
pinDirection?: "left" | "right";
|
|
24
|
-
rowDisabled?: boolean;
|
|
25
|
-
rowDisabledAccessor?: (row: TData) => boolean;
|
|
26
|
-
}
|
|
27
|
-
export function TableBody<T>({
|
|
28
|
-
id,
|
|
29
|
-
testid,
|
|
30
|
-
columnVirtualizer,
|
|
31
|
-
table,
|
|
32
|
-
tableContainerRef,
|
|
33
|
-
virtualPaddingLeft,
|
|
34
|
-
virtualPaddingRight,
|
|
35
|
-
pagination,
|
|
36
|
-
isLoadingMore,
|
|
37
|
-
hasMore,
|
|
38
|
-
showFilterRow,
|
|
39
|
-
enableColumnSelector = false,
|
|
40
|
-
locked,
|
|
41
|
-
pinDirection,
|
|
42
|
-
rowDisabled,
|
|
43
|
-
rowDisabledAccessor,
|
|
44
|
-
}: TableBodyProps<T>) {
|
|
45
|
-
const { rows } = table.getRowModel();
|
|
46
|
-
|
|
47
|
-
const rowVirtualizer = useVirtualizer<HTMLDivElement, HTMLTableRowElement>({
|
|
48
|
-
count: rows.length,
|
|
49
|
-
estimateSize: () => 40,
|
|
50
|
-
getScrollElement: () => tableContainerRef.current,
|
|
51
|
-
overscan: 8,
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
55
|
-
const CellElement = locked ? DataGridCell : DragAlongCell;
|
|
56
|
-
|
|
57
|
-
let headerGroups: HeaderGroup<T>[];
|
|
58
|
-
if (pinDirection === "left") {
|
|
59
|
-
headerGroups = table.getLeftHeaderGroups();
|
|
60
|
-
} else if (pinDirection === "right") {
|
|
61
|
-
headerGroups = table.getRightHeaderGroups();
|
|
62
|
-
} else {
|
|
63
|
-
headerGroups = table.getCenterHeaderGroups();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<tbody
|
|
68
|
-
className={clsx(locked ? "shadow-16" : "")}
|
|
69
|
-
style={{
|
|
70
|
-
display: "grid",
|
|
71
|
-
height: `${
|
|
72
|
-
showFilterRow
|
|
73
|
-
? rowVirtualizer.getTotalSize() + 40
|
|
74
|
-
: rowVirtualizer.getTotalSize()
|
|
75
|
-
}px`, // tells scrollbar how big the table is
|
|
76
|
-
position: "relative", // needed for absolute positioning of rows
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
{showFilterRow && (
|
|
80
|
-
<tr
|
|
81
|
-
style={{
|
|
82
|
-
display: "flex",
|
|
83
|
-
position: "sticky",
|
|
84
|
-
top: "40px",
|
|
85
|
-
width: "100%",
|
|
86
|
-
height: "40px",
|
|
87
|
-
zIndex: 10,
|
|
88
|
-
}}
|
|
89
|
-
className="even:bg-background-grouped-primary-normal odd:bg-background-grouped-secondary-normal"
|
|
90
|
-
data-testid={testid ? `${testid}-filter-row` : undefined}
|
|
91
|
-
>
|
|
92
|
-
{headerGroups.flatMap((x) =>
|
|
93
|
-
x.headers.map((header) => (
|
|
94
|
-
<CellElement
|
|
95
|
-
id={id ? `${id}-filter-cell-${header.id}` : undefined}
|
|
96
|
-
testid={
|
|
97
|
-
testid ? `${testid}-filter-cell-${header.id}` : undefined
|
|
98
|
-
}
|
|
99
|
-
noPadding
|
|
100
|
-
key={header.id}
|
|
101
|
-
cell={header}
|
|
102
|
-
width={
|
|
103
|
-
header.column.columnDef.meta?.headerWidth ||
|
|
104
|
-
(locked ? `${header.column.getSize()}px` : "")
|
|
105
|
-
}
|
|
106
|
-
>
|
|
107
|
-
{header.column.getCanFilter() &&
|
|
108
|
-
(header.column.columnDef.meta?.filterRowCell?.({
|
|
109
|
-
header,
|
|
110
|
-
table,
|
|
111
|
-
}) ?? (
|
|
112
|
-
<Search
|
|
113
|
-
id={id ? `${id}-filter-search-${header.id}` : undefined}
|
|
114
|
-
testid={
|
|
115
|
-
testid
|
|
116
|
-
? `${testid}-filter-search-${header.id}`
|
|
117
|
-
: undefined
|
|
118
|
-
}
|
|
119
|
-
removeRoundness
|
|
120
|
-
onChange={(e) =>
|
|
121
|
-
header.column.setFilterValue(e.target.value)
|
|
122
|
-
}
|
|
123
|
-
value={(header.column.getFilterValue() ?? "") as string}
|
|
124
|
-
placeholder=""
|
|
125
|
-
removeSearchIcon
|
|
126
|
-
/>
|
|
127
|
-
))}
|
|
128
|
-
</CellElement>
|
|
129
|
-
)),
|
|
130
|
-
)}
|
|
131
|
-
</tr>
|
|
132
|
-
)}
|
|
133
|
-
|
|
134
|
-
{virtualRows.map((virtualRow) => {
|
|
135
|
-
const row = rows[virtualRow.index] as Row<T>;
|
|
136
|
-
|
|
137
|
-
return (
|
|
138
|
-
<TableBodyRow
|
|
139
|
-
id={id}
|
|
140
|
-
testid={testid}
|
|
141
|
-
columnVirtualizer={columnVirtualizer}
|
|
142
|
-
key={row.id}
|
|
143
|
-
row={row}
|
|
144
|
-
rowVirtualizer={rowVirtualizer}
|
|
145
|
-
virtualPaddingLeft={virtualPaddingLeft}
|
|
146
|
-
virtualPaddingRight={virtualPaddingRight}
|
|
147
|
-
virtualRow={virtualRow}
|
|
148
|
-
showFilterRow={showFilterRow}
|
|
149
|
-
enableColumnSelector={enableColumnSelector}
|
|
150
|
-
locked={locked}
|
|
151
|
-
pinDirection={pinDirection}
|
|
152
|
-
disabled={
|
|
153
|
-
rowDisabledAccessor
|
|
154
|
-
? rowDisabledAccessor(row.original as T)
|
|
155
|
-
: rowDisabled
|
|
156
|
-
}
|
|
157
|
-
/>
|
|
158
|
-
);
|
|
159
|
-
})}
|
|
160
|
-
|
|
161
|
-
{!pagination && isLoadingMore && hasMore && (
|
|
162
|
-
<tr
|
|
163
|
-
style={{
|
|
164
|
-
display: "flex",
|
|
165
|
-
position: "absolute",
|
|
166
|
-
width: "100%",
|
|
167
|
-
transform: `translateY(${
|
|
168
|
-
virtualRows[virtualRows.length - 1].start + 40
|
|
169
|
-
}px)`,
|
|
170
|
-
}}
|
|
171
|
-
className="odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal"
|
|
172
|
-
>
|
|
173
|
-
{table.getAllLeafColumns().map((column) => (
|
|
174
|
-
<LoadingCell
|
|
175
|
-
id={id}
|
|
176
|
-
testid={testid}
|
|
177
|
-
key={column.id}
|
|
178
|
-
column={column.columnDef}
|
|
179
|
-
/>
|
|
180
|
-
))}
|
|
181
|
-
</tr>
|
|
182
|
-
)}
|
|
183
|
-
</tbody>
|
|
184
|
-
);
|
|
185
|
-
}
|