@dashforge/tw 0.6.0-beta → 0.8.0-beta
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/CHANGELOG.md +451 -0
- package/THEME-AUDIT.md +175 -0
- package/dist/index.esm.js +2009 -87
- package/dist/src/components/Accordion/accordion.variants.d.ts.map +1 -1
- package/dist/src/components/Box/box.variants.d.ts.map +1 -1
- package/dist/src/components/DataGrid/DataGrid.d.ts +29 -0
- package/dist/src/components/DataGrid/DataGrid.d.ts.map +1 -0
- package/dist/src/components/DataGrid/dataGrid.types.d.ts +214 -0
- package/dist/src/components/DataGrid/dataGrid.types.d.ts.map +1 -0
- package/dist/src/components/DataGrid/dataGrid.variants.d.ts +222 -0
- package/dist/src/components/DataGrid/dataGrid.variants.d.ts.map +1 -0
- package/dist/src/components/DataGrid/filters/ColumnFilters.d.ts +23 -0
- package/dist/src/components/DataGrid/filters/ColumnFilters.d.ts.map +1 -0
- package/dist/src/components/DataGrid/reorder/useColumnReorder.d.ts +50 -0
- package/dist/src/components/DataGrid/reorder/useColumnReorder.d.ts.map +1 -0
- package/dist/src/components/DataGrid/resize/useColumnResize.d.ts +32 -0
- package/dist/src/components/DataGrid/resize/useColumnResize.d.ts.map +1 -0
- package/dist/src/components/DataGrid/visibility/ColumnVisibilityDialog.d.ts +33 -0
- package/dist/src/components/DataGrid/visibility/ColumnVisibilityDialog.d.ts.map +1 -0
- package/dist/src/components/Dialog/dialog.variants.d.ts.map +1 -1
- package/dist/src/components/Divider/divider.variants.d.ts.map +1 -1
- package/dist/src/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/src/components/Pagination/pagination.variants.d.ts.map +1 -1
- package/dist/src/components/Popover/popover.variants.d.ts.map +1 -1
- package/dist/src/components/Skeleton/skeleton.variants.d.ts.map +1 -1
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/table.types.d.ts +77 -5
- package/dist/src/components/Table/table.types.d.ts.map +1 -1
- package/dist/src/components/Tabs/tabs.variants.d.ts.map +1 -1
- package/dist/src/components/Tooltip/tooltip.variants.d.ts.map +1 -1
- package/dist/src/components/Typography/typography.variants.d.ts.map +1 -1
- package/dist/src/components/_shared/data/getNestedValue.d.ts.map +1 -0
- package/dist/src/components/{Table/_internal → _shared/data}/useColumnAutoDetect.d.ts +1 -1
- package/dist/src/components/_shared/data/useColumnAutoDetect.d.ts.map +1 -0
- package/dist/src/components/_shared/data/useControllableState.d.ts.map +1 -0
- package/dist/src/components/_shared/data/useDebouncedValue.d.ts.map +1 -0
- package/dist/src/components/_shared/data/useTableFilter.d.ts +36 -0
- package/dist/src/components/_shared/data/useTableFilter.d.ts.map +1 -0
- package/dist/src/components/{Table/_internal → _shared/data}/useTableSearch.d.ts +1 -1
- package/dist/src/components/_shared/data/useTableSearch.d.ts.map +1 -0
- package/dist/src/components/{Table/_internal → _shared/data}/useTableSelection.d.ts +1 -1
- package/dist/src/components/_shared/data/useTableSelection.d.ts.map +1 -0
- package/dist/src/components/{Table/_internal → _shared/data}/useTableSort.d.ts +1 -1
- package/dist/src/components/_shared/data/useTableSort.d.ts.map +1 -0
- package/dist/src/components/_shared/data/useVirtualizer.d.ts +107 -0
- package/dist/src/components/_shared/data/useVirtualizer.d.ts.map +1 -0
- package/dist/src/index.d.ts +6 -3
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/Accordion/accordion.variants.ts +5 -3
- package/src/components/Box/Box.test.tsx +32 -11
- package/src/components/Box/box.variants.ts +23 -4
- package/src/components/DataGrid/DataGrid.test.tsx +917 -0
- package/src/components/DataGrid/DataGrid.tsx +1199 -0
- package/src/components/DataGrid/dataGrid.types.ts +238 -0
- package/src/components/DataGrid/dataGrid.variants.ts +152 -0
- package/src/components/DataGrid/filters/ColumnFilters.tsx +432 -0
- package/src/components/DataGrid/reorder/useColumnReorder.test.ts +38 -0
- package/src/components/DataGrid/reorder/useColumnReorder.ts +144 -0
- package/src/components/DataGrid/resize/useColumnResize.ts +106 -0
- package/src/components/DataGrid/visibility/ColumnVisibilityDialog.tsx +200 -0
- package/src/components/Dialog/dialog.variants.ts +10 -6
- package/src/components/Divider/Divider.test.tsx +3 -1
- package/src/components/Divider/Divider.tsx +1 -1
- package/src/components/Divider/divider.variants.ts +2 -1
- package/src/components/Pagination/Pagination.tsx +3 -1
- package/src/components/Pagination/pagination.variants.ts +19 -13
- package/src/components/Popover/popover.variants.ts +10 -4
- package/src/components/Skeleton/skeleton.variants.ts +2 -1
- package/src/components/Table/Table.tsx +22 -8
- package/src/components/Table/table.types.ts +83 -5
- package/src/components/Tabs/tabs.variants.ts +19 -8
- package/src/components/Tooltip/tooltip.variants.ts +12 -2
- package/src/components/Typography/Typography.test.tsx +3 -1
- package/src/components/Typography/typography.variants.ts +6 -2
- package/src/components/{Table/_internal → _shared/data}/useColumnAutoDetect.test.ts +1 -1
- package/src/components/{Table/_internal → _shared/data}/useColumnAutoDetect.ts +1 -1
- package/src/components/_shared/data/useTableFilter.test.ts +166 -0
- package/src/components/_shared/data/useTableFilter.ts +118 -0
- package/src/components/{Table/_internal → _shared/data}/useTableSearch.test.ts +1 -1
- package/src/components/{Table/_internal → _shared/data}/useTableSearch.ts +1 -1
- package/src/components/{Table/_internal → _shared/data}/useTableSelection.ts +1 -1
- package/src/components/{Table/_internal → _shared/data}/useTableSort.test.ts +1 -1
- package/src/components/{Table/_internal → _shared/data}/useTableSort.ts +1 -1
- package/src/components/_shared/data/useVirtualizer.test.ts +158 -0
- package/src/components/_shared/data/useVirtualizer.ts +199 -0
- package/src/components/_shared/themeIdentity.test.ts +113 -0
- package/src/index.ts +20 -2
- package/dist/src/components/Table/_internal/getNestedValue.d.ts.map +0 -1
- package/dist/src/components/Table/_internal/useColumnAutoDetect.d.ts.map +0 -1
- package/dist/src/components/Table/_internal/useControllableState.d.ts.map +0 -1
- package/dist/src/components/Table/_internal/useDebouncedValue.d.ts.map +0 -1
- package/dist/src/components/Table/_internal/useTableFilter.d.ts +0 -13
- package/dist/src/components/Table/_internal/useTableFilter.d.ts.map +0 -1
- package/dist/src/components/Table/_internal/useTableSearch.d.ts.map +0 -1
- package/dist/src/components/Table/_internal/useTableSelection.d.ts.map +0 -1
- package/dist/src/components/Table/_internal/useTableSort.d.ts.map +0 -1
- package/src/components/Table/_internal/themeIdentity.test.ts +0 -84
- package/src/components/Table/_internal/useTableFilter.ts +0 -37
- /package/dist/src/components/{Table/_internal → _shared/data}/getNestedValue.d.ts +0 -0
- /package/dist/src/components/{Table/_internal → _shared/data}/useControllableState.d.ts +0 -0
- /package/dist/src/components/{Table/_internal → _shared/data}/useDebouncedValue.d.ts +0 -0
- /package/src/components/{Table/_internal → _shared/data}/getNestedValue.test.ts +0 -0
- /package/src/components/{Table/_internal → _shared/data}/getNestedValue.ts +0 -0
- /package/src/components/{Table/_internal → _shared/data}/useControllableState.ts +0 -0
- /package/src/components/{Table/_internal → _shared/data}/useDebouncedValue.ts +0 -0
- /package/src/components/{Table/_internal → _shared/data}/useTableSelection.test.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Accordion/accordion.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"accordion.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Accordion/accordion.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CA2B5B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Box/box.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"box.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Box/box.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAqLtB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DataGridProps } from './dataGrid.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dashforge TW `<DataGrid>` — virtualized data table.
|
|
4
|
+
*
|
|
5
|
+
* Companion to `<Table>` for large data sets (~500+ rows up to
|
|
6
|
+
* millions via virtualization). Same column model, sort/search/
|
|
7
|
+
* filter/selection logic (shared via `_shared/data/` helpers) —
|
|
8
|
+
* differs in render path: only the visible window of rows is mounted
|
|
9
|
+
* in DOM, with spacer `<tr>` above and below to preserve scrollbar
|
|
10
|
+
* size.
|
|
11
|
+
*
|
|
12
|
+
* Virtualization: hand-rolled (`useVirtualizer`) using
|
|
13
|
+
* `IntersectionObserver` + scroll-event + `requestAnimationFrame`
|
|
14
|
+
* debounce + `ResizeObserver`. Zero new runtime deps.
|
|
15
|
+
*
|
|
16
|
+
* Server-side mode (4 independent opt-in flags):
|
|
17
|
+
* - `serverSideSort` — emits `onSortChange` but does NOT sort locally
|
|
18
|
+
* - `serverSideFilter` — emits `onFilterChange` but does NOT filter
|
|
19
|
+
* - `serverSideSearch` — emits `onSearchQueryChange` (debounced)
|
|
20
|
+
* - `serverSidePagination` — `totalCount` prop sizes the virtual
|
|
21
|
+
* scrollbar; `rows` is the page slice from the server
|
|
22
|
+
*
|
|
23
|
+
* Selection at scale: `selectAllScope`:
|
|
24
|
+
* - `'allLoaded'` (default) — header checkbox toggles all rows in
|
|
25
|
+
* `rows` prop
|
|
26
|
+
* - `'visible'` — toggles only the current viewport window
|
|
27
|
+
*/
|
|
28
|
+
export declare function DataGrid<T extends object>(props: DataGridProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
29
|
+
//# sourceMappingURL=DataGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/DataGrid.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA6CzD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,kDAohBjE"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AccessRequirement } from '@dashforge/rbac';
|
|
3
|
+
import type { DataGridVariants } from './dataGrid.variants.js';
|
|
4
|
+
import type { TableColumn, TableSortModel, TableFilterModel, TableRowSelectionMode, TableLabels } from '../Table/table.types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Determines what the "select all" header checkbox covers when
|
|
7
|
+
* `rowSelection="multiple"` is enabled.
|
|
8
|
+
*
|
|
9
|
+
* - `'visible'` — only the rows currently in the viewport (after
|
|
10
|
+
* virtualization windowing) are toggled. Useful when the
|
|
11
|
+
* underlying data is paginated server-side and "all" semantically
|
|
12
|
+
* refers to the screen.
|
|
13
|
+
* - `'allLoaded'` (default) — all rows currently in the `rows` prop
|
|
14
|
+
* are toggled. The standard "select everything I can see in this
|
|
15
|
+
* dataset" pattern.
|
|
16
|
+
*
|
|
17
|
+
* For "select all in server-side dataset", the consumer wires it
|
|
18
|
+
* themselves (e.g. fetch all ids + setSelectedRowIds).
|
|
19
|
+
*/
|
|
20
|
+
export type DataGridSelectAllScope = 'visible' | 'allLoaded';
|
|
21
|
+
/**
|
|
22
|
+
* Independent opt-in flags that delegate the corresponding pipeline
|
|
23
|
+
* step to the consumer. With each flag enabled, DataGrid emits the
|
|
24
|
+
* `onXChange` callback but does NOT perform the operation locally
|
|
25
|
+
* — the consumer is expected to provide the resulting `rows` array.
|
|
26
|
+
*/
|
|
27
|
+
export interface DataGridServerSideFlags {
|
|
28
|
+
serverSideSort?: boolean;
|
|
29
|
+
serverSideFilter?: boolean;
|
|
30
|
+
serverSideSearch?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* When true, DataGrid does NOT slice `rows` for pagination. The
|
|
33
|
+
* virtualization math uses `totalCount` (required) to size the
|
|
34
|
+
* scroll container.
|
|
35
|
+
*/
|
|
36
|
+
serverSidePagination?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface DataGridPaginationConfig {
|
|
39
|
+
page: number;
|
|
40
|
+
pageSize: number;
|
|
41
|
+
onPageChange: (page: number) => void;
|
|
42
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
43
|
+
pageSizeOptions?: number[];
|
|
44
|
+
}
|
|
45
|
+
export interface DataGridSlotProps {
|
|
46
|
+
root?: {
|
|
47
|
+
className?: string;
|
|
48
|
+
};
|
|
49
|
+
toolbar?: {
|
|
50
|
+
className?: string;
|
|
51
|
+
};
|
|
52
|
+
search?: {
|
|
53
|
+
className?: string;
|
|
54
|
+
};
|
|
55
|
+
scroll?: {
|
|
56
|
+
className?: string;
|
|
57
|
+
};
|
|
58
|
+
table?: {
|
|
59
|
+
className?: string;
|
|
60
|
+
};
|
|
61
|
+
thead?: {
|
|
62
|
+
className?: string;
|
|
63
|
+
};
|
|
64
|
+
tbody?: {
|
|
65
|
+
className?: string;
|
|
66
|
+
};
|
|
67
|
+
headerRow?: {
|
|
68
|
+
className?: string;
|
|
69
|
+
};
|
|
70
|
+
headerCell?: {
|
|
71
|
+
className?: string;
|
|
72
|
+
};
|
|
73
|
+
row?: {
|
|
74
|
+
className?: string;
|
|
75
|
+
};
|
|
76
|
+
cell?: {
|
|
77
|
+
className?: string;
|
|
78
|
+
};
|
|
79
|
+
emptyState?: {
|
|
80
|
+
className?: string;
|
|
81
|
+
};
|
|
82
|
+
loadingOverlay?: {
|
|
83
|
+
className?: string;
|
|
84
|
+
};
|
|
85
|
+
selectionCell?: {
|
|
86
|
+
className?: string;
|
|
87
|
+
};
|
|
88
|
+
rowActionsCell?: {
|
|
89
|
+
className?: string;
|
|
90
|
+
};
|
|
91
|
+
bulkActionFooter?: {
|
|
92
|
+
className?: string;
|
|
93
|
+
};
|
|
94
|
+
/** Optional Pagination wrapper below the virtualized scroll. */
|
|
95
|
+
pagination?: {
|
|
96
|
+
className?: string;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Props for `<DataGrid>`.
|
|
101
|
+
*
|
|
102
|
+
* Companion to `<Table>` for large data sets. Where Table renders
|
|
103
|
+
* every row in DOM, DataGrid uses **homemade virtualization**
|
|
104
|
+
* (`IntersectionObserver` + scroll-event + `requestAnimationFrame`
|
|
105
|
+
* — no external libs) to render only a window of visible rows.
|
|
106
|
+
*
|
|
107
|
+
* Required:
|
|
108
|
+
* - `rows`, `cols`, `getRowId` — same as Table
|
|
109
|
+
* - `rowHeight` (fixed in v1; variable-height deferred to v1-bis)
|
|
110
|
+
* - `height` — explicit container height in CSS units, OR
|
|
111
|
+
* consumer sets it via `sx` / parent layout (the scroll container
|
|
112
|
+
* needs a bounded height for virtualization to work)
|
|
113
|
+
*
|
|
114
|
+
* Optional:
|
|
115
|
+
* - `overscan` — extra rows above/below viewport (default 5)
|
|
116
|
+
* - Server-side mode flags (4 independent opt-ins)
|
|
117
|
+
* - Internal pagination (opt-in via `pagination` config)
|
|
118
|
+
* - `selectAllScope` — `'visible'` vs `'allLoaded'` for header
|
|
119
|
+
* select-all checkbox
|
|
120
|
+
* - Everything Table accepts: sort / filter / search / selection /
|
|
121
|
+
* row actions / RBAC / variants / i18n labels / sx / slotProps
|
|
122
|
+
*/
|
|
123
|
+
export interface DataGridProps<T extends object> extends Pick<DataGridVariants, 'variant' | 'size' | 'density'>, DataGridServerSideFlags {
|
|
124
|
+
rows: T[];
|
|
125
|
+
cols: TableColumn<T>[];
|
|
126
|
+
getRowId: (row: T, index: number) => string;
|
|
127
|
+
/** Required: total dataset count. In client-side mode equals
|
|
128
|
+
* `rows.length`; in `serverSidePagination` mode the consumer
|
|
129
|
+
* provides the full count so the virtual scroll height matches. */
|
|
130
|
+
totalCount?: number;
|
|
131
|
+
/** Fixed row height in pixels. Required for windowing math. */
|
|
132
|
+
rowHeight: number;
|
|
133
|
+
/** Rows rendered above/below the viewport. @default 5 */
|
|
134
|
+
overscan?: number;
|
|
135
|
+
/** Container height in CSS units (e.g. `"600px"`, `"100vh"`).
|
|
136
|
+
* Required for the scroll container to bound the virtualization. */
|
|
137
|
+
height?: string;
|
|
138
|
+
sortModel?: TableSortModel;
|
|
139
|
+
onSortChange?: (model: TableSortModel) => void;
|
|
140
|
+
defaultSortModel?: TableSortModel;
|
|
141
|
+
enableSearch?: boolean;
|
|
142
|
+
searchQuery?: string;
|
|
143
|
+
onSearchQueryChange?: (q: string) => void;
|
|
144
|
+
searchPlaceholder?: string;
|
|
145
|
+
searchDebounceMs?: number;
|
|
146
|
+
filterModel?: TableFilterModel;
|
|
147
|
+
onFilterChange?: (model: TableFilterModel) => void;
|
|
148
|
+
/**
|
|
149
|
+
* List of column `field`s currently hidden. Drives the column
|
|
150
|
+
* visibility dialog. When omitted, the dialog manages state
|
|
151
|
+
* internally (seeded from each column's `defaultHidden`).
|
|
152
|
+
*/
|
|
153
|
+
hiddenColumns?: string[];
|
|
154
|
+
/** Called when the user commits a change in the visibility dialog. */
|
|
155
|
+
onHiddenColumnsChange?: (next: string[]) => void;
|
|
156
|
+
/**
|
|
157
|
+
* Show the "Columns" button in the toolbar. Defaults to `true` so
|
|
158
|
+
* the dialog is discoverable; set `false` for embedded / compact
|
|
159
|
+
* grids where columns are externally controlled.
|
|
160
|
+
* @default true
|
|
161
|
+
*/
|
|
162
|
+
enableColumnVisibility?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Map of `field → width (px)` for user-resized columns. When
|
|
165
|
+
* omitted, DataGrid manages widths internally — seeded from each
|
|
166
|
+
* column's `width` prop.
|
|
167
|
+
*/
|
|
168
|
+
columnWidths?: Record<string, number>;
|
|
169
|
+
/** Called when the user finishes (or actively drags) a resize. */
|
|
170
|
+
onColumnWidthsChange?: (next: Record<string, number>) => void;
|
|
171
|
+
/**
|
|
172
|
+
* Allow user-driven column resize via drag on the right edge of
|
|
173
|
+
* each `<th>`. Per-column opt-out via `col.resizable = false`.
|
|
174
|
+
* @default true
|
|
175
|
+
*/
|
|
176
|
+
enableColumnResize?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Custom display order, as a list of `field`s. Columns not in the
|
|
179
|
+
* list are appended in their original order at the end. When
|
|
180
|
+
* omitted, DataGrid uses the order from the `cols` prop.
|
|
181
|
+
*/
|
|
182
|
+
columnOrder?: string[];
|
|
183
|
+
/** Called when the user finishes a reorder drag. */
|
|
184
|
+
onColumnOrderChange?: (next: string[]) => void;
|
|
185
|
+
/**
|
|
186
|
+
* Allow user-driven column reorder via native HTML5 drag-and-drop
|
|
187
|
+
* on each `<th>`. Per-column opt-out via `col.reorderable = false`.
|
|
188
|
+
* @default true
|
|
189
|
+
*/
|
|
190
|
+
enableColumnReorder?: boolean;
|
|
191
|
+
rowSelection?: TableRowSelectionMode;
|
|
192
|
+
selectedRowIds?: string[];
|
|
193
|
+
onSelectionChange?: (ids: string[]) => void;
|
|
194
|
+
/** Bulk action sticky footer (visible only when selection > 0). */
|
|
195
|
+
bulkActions?: (selectedRows: T[]) => ReactNode;
|
|
196
|
+
/**
|
|
197
|
+
* Scope of the "select all" header checkbox.
|
|
198
|
+
* @default 'allLoaded'
|
|
199
|
+
*/
|
|
200
|
+
selectAllScope?: DataGridSelectAllScope;
|
|
201
|
+
pagination?: DataGridPaginationConfig;
|
|
202
|
+
rowActions?: (row: T) => ReactNode;
|
|
203
|
+
loading?: boolean;
|
|
204
|
+
loadingRowCount?: number;
|
|
205
|
+
emptyState?: ReactNode;
|
|
206
|
+
stickyHeader?: boolean;
|
|
207
|
+
caption?: ReactNode;
|
|
208
|
+
showCaption?: boolean;
|
|
209
|
+
access?: AccessRequirement;
|
|
210
|
+
labels?: TableLabels;
|
|
211
|
+
sx?: string;
|
|
212
|
+
slotProps?: DataGridSlotProps;
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=dataGrid.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataGrid.types.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/dataGrid.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAQjC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,WAAW,CAAC;AAI7D;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAID,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAID,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAA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1,222 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
/**
|
|
3
|
+
* `<DataGrid>` variant recipe.
|
|
4
|
+
*
|
|
5
|
+
* Sibling of `tableVariants` — shares the same visual axes (variant /
|
|
6
|
+
* size / density) and the same identity-rule patterns:
|
|
7
|
+
* - No `dark:` variants on neutral palette (auto-invert via the
|
|
8
|
+
* dashforgePreset() CSS var swap).
|
|
9
|
+
* - Selected row uses LeftNav `itemActive` pattern
|
|
10
|
+
* (`bg-primary-100 text-primary-900`) — guaranteed contrast.
|
|
11
|
+
* - Hover uses one-tier elevation (`bg-neutral-100`).
|
|
12
|
+
*
|
|
13
|
+
* DataGrid-specific slot additions vs Table:
|
|
14
|
+
* - `stickyLeftCell` — column that uses `cols[i].sticky === 'left'`.
|
|
15
|
+
* Z-index ordering: `thead` (z-10) < `stickyLeftCell` (z-11) <
|
|
16
|
+
* `header × stickyLeft top-left corner cell` (z-20).
|
|
17
|
+
* - `paginationFooter` — wraps the optional `<Pagination>`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const dataGridVariants: import("tailwind-variants").TVReturnType<{
|
|
20
|
+
variant: {
|
|
21
|
+
plain: {};
|
|
22
|
+
lines: {};
|
|
23
|
+
striped: {
|
|
24
|
+
row: string;
|
|
25
|
+
};
|
|
26
|
+
bordered: {
|
|
27
|
+
table: string;
|
|
28
|
+
cell: string;
|
|
29
|
+
headerCell: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
size: {
|
|
33
|
+
sm: {
|
|
34
|
+
headerCell: string;
|
|
35
|
+
cell: string;
|
|
36
|
+
search: string;
|
|
37
|
+
};
|
|
38
|
+
md: {
|
|
39
|
+
headerCell: string;
|
|
40
|
+
cell: string;
|
|
41
|
+
search: string;
|
|
42
|
+
};
|
|
43
|
+
lg: {
|
|
44
|
+
headerCell: string;
|
|
45
|
+
cell: string;
|
|
46
|
+
search: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
density: {
|
|
50
|
+
compact: {
|
|
51
|
+
headerCell: string;
|
|
52
|
+
cell: string;
|
|
53
|
+
};
|
|
54
|
+
comfortable: {
|
|
55
|
+
headerCell: string;
|
|
56
|
+
cell: string;
|
|
57
|
+
};
|
|
58
|
+
spacious: {
|
|
59
|
+
headerCell: string;
|
|
60
|
+
cell: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}, {
|
|
64
|
+
root: string;
|
|
65
|
+
toolbar: string;
|
|
66
|
+
search: string[];
|
|
67
|
+
scroll: string;
|
|
68
|
+
table: string;
|
|
69
|
+
thead: string;
|
|
70
|
+
tbody: string;
|
|
71
|
+
headerRow: string;
|
|
72
|
+
headerCell: string[];
|
|
73
|
+
headerCellButton: string[];
|
|
74
|
+
row: string[];
|
|
75
|
+
cell: string[];
|
|
76
|
+
selectionCell: string;
|
|
77
|
+
rowActionsCell: string[];
|
|
78
|
+
emptyState: string;
|
|
79
|
+
loadingOverlay: string;
|
|
80
|
+
bulkActionFooter: string[];
|
|
81
|
+
stickyLeftCell: string;
|
|
82
|
+
stickyLeftHeaderCell: string;
|
|
83
|
+
stickyRightCell: string;
|
|
84
|
+
stickyRightHeaderCell: string;
|
|
85
|
+
paginationFooter: string;
|
|
86
|
+
}, undefined, {
|
|
87
|
+
variant: {
|
|
88
|
+
plain: {};
|
|
89
|
+
lines: {};
|
|
90
|
+
striped: {
|
|
91
|
+
row: string;
|
|
92
|
+
};
|
|
93
|
+
bordered: {
|
|
94
|
+
table: string;
|
|
95
|
+
cell: string;
|
|
96
|
+
headerCell: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
size: {
|
|
100
|
+
sm: {
|
|
101
|
+
headerCell: string;
|
|
102
|
+
cell: string;
|
|
103
|
+
search: string;
|
|
104
|
+
};
|
|
105
|
+
md: {
|
|
106
|
+
headerCell: string;
|
|
107
|
+
cell: string;
|
|
108
|
+
search: string;
|
|
109
|
+
};
|
|
110
|
+
lg: {
|
|
111
|
+
headerCell: string;
|
|
112
|
+
cell: string;
|
|
113
|
+
search: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
density: {
|
|
117
|
+
compact: {
|
|
118
|
+
headerCell: string;
|
|
119
|
+
cell: string;
|
|
120
|
+
};
|
|
121
|
+
comfortable: {
|
|
122
|
+
headerCell: string;
|
|
123
|
+
cell: string;
|
|
124
|
+
};
|
|
125
|
+
spacious: {
|
|
126
|
+
headerCell: string;
|
|
127
|
+
cell: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
}, {
|
|
131
|
+
root: string;
|
|
132
|
+
toolbar: string;
|
|
133
|
+
search: string[];
|
|
134
|
+
scroll: string;
|
|
135
|
+
table: string;
|
|
136
|
+
thead: string;
|
|
137
|
+
tbody: string;
|
|
138
|
+
headerRow: string;
|
|
139
|
+
headerCell: string[];
|
|
140
|
+
headerCellButton: string[];
|
|
141
|
+
row: string[];
|
|
142
|
+
cell: string[];
|
|
143
|
+
selectionCell: string;
|
|
144
|
+
rowActionsCell: string[];
|
|
145
|
+
emptyState: string;
|
|
146
|
+
loadingOverlay: string;
|
|
147
|
+
bulkActionFooter: string[];
|
|
148
|
+
stickyLeftCell: string;
|
|
149
|
+
stickyLeftHeaderCell: string;
|
|
150
|
+
stickyRightCell: string;
|
|
151
|
+
stickyRightHeaderCell: string;
|
|
152
|
+
paginationFooter: string;
|
|
153
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
154
|
+
variant: {
|
|
155
|
+
plain: {};
|
|
156
|
+
lines: {};
|
|
157
|
+
striped: {
|
|
158
|
+
row: string;
|
|
159
|
+
};
|
|
160
|
+
bordered: {
|
|
161
|
+
table: string;
|
|
162
|
+
cell: string;
|
|
163
|
+
headerCell: string;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
size: {
|
|
167
|
+
sm: {
|
|
168
|
+
headerCell: string;
|
|
169
|
+
cell: string;
|
|
170
|
+
search: string;
|
|
171
|
+
};
|
|
172
|
+
md: {
|
|
173
|
+
headerCell: string;
|
|
174
|
+
cell: string;
|
|
175
|
+
search: string;
|
|
176
|
+
};
|
|
177
|
+
lg: {
|
|
178
|
+
headerCell: string;
|
|
179
|
+
cell: string;
|
|
180
|
+
search: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
density: {
|
|
184
|
+
compact: {
|
|
185
|
+
headerCell: string;
|
|
186
|
+
cell: string;
|
|
187
|
+
};
|
|
188
|
+
comfortable: {
|
|
189
|
+
headerCell: string;
|
|
190
|
+
cell: string;
|
|
191
|
+
};
|
|
192
|
+
spacious: {
|
|
193
|
+
headerCell: string;
|
|
194
|
+
cell: string;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
}, {
|
|
198
|
+
root: string;
|
|
199
|
+
toolbar: string;
|
|
200
|
+
search: string[];
|
|
201
|
+
scroll: string;
|
|
202
|
+
table: string;
|
|
203
|
+
thead: string;
|
|
204
|
+
tbody: string;
|
|
205
|
+
headerRow: string;
|
|
206
|
+
headerCell: string[];
|
|
207
|
+
headerCellButton: string[];
|
|
208
|
+
row: string[];
|
|
209
|
+
cell: string[];
|
|
210
|
+
selectionCell: string;
|
|
211
|
+
rowActionsCell: string[];
|
|
212
|
+
emptyState: string;
|
|
213
|
+
loadingOverlay: string;
|
|
214
|
+
bulkActionFooter: string[];
|
|
215
|
+
stickyLeftCell: string;
|
|
216
|
+
stickyLeftHeaderCell: string;
|
|
217
|
+
stickyRightCell: string;
|
|
218
|
+
stickyRightHeaderCell: string;
|
|
219
|
+
paginationFooter: string;
|
|
220
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
221
|
+
export type DataGridVariants = VariantProps<typeof dataGridVariants>;
|
|
222
|
+
//# sourceMappingURL=dataGrid.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataGrid.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/dataGrid.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAkI3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TableFilterModel, TableFilterType } from '../../Table/table.types.js';
|
|
2
|
+
export interface ColumnFilterLabels {
|
|
3
|
+
filterColumn?: string;
|
|
4
|
+
filterApply?: string;
|
|
5
|
+
filterClear?: string;
|
|
6
|
+
filterMin?: string;
|
|
7
|
+
filterMax?: string;
|
|
8
|
+
filterFrom?: string;
|
|
9
|
+
filterTo?: string;
|
|
10
|
+
filterAll?: string;
|
|
11
|
+
filterTrue?: string;
|
|
12
|
+
filterFalse?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ColumnFilterTriggerProps {
|
|
15
|
+
field: string;
|
|
16
|
+
filterType: TableFilterType;
|
|
17
|
+
filterModel: TableFilterModel;
|
|
18
|
+
onFilterChange: (model: TableFilterModel) => void;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
labels?: ColumnFilterLabels;
|
|
21
|
+
}
|
|
22
|
+
export declare function ColumnFilterTrigger(props: ColumnFilterTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=ColumnFilters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnFilters.d.ts","sourceRoot":"","sources":["../../../../../src/components/DataGrid/filters/ColumnFilters.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,gBAAgB,EAChB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAqCpC,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAiBD,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,eAAe,CAAC;IAC5B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,cAAc,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAkDlE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type DragEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Native HTML5 drag-and-drop reorder for DataGrid column headers.
|
|
4
|
+
*
|
|
5
|
+
* Zero new runtime deps — uses the browser's built-in drag events.
|
|
6
|
+
* The hook returns handler factories you wire onto each `<th>` plus
|
|
7
|
+
* a `dropTarget` state used to render the visual indicator (a left
|
|
8
|
+
* or right border on the hovered column).
|
|
9
|
+
*
|
|
10
|
+
* - `dragStart(field)` → onDragStart; stashes source field in a ref
|
|
11
|
+
* + sets `dataTransfer.effectAllowed = 'move'`.
|
|
12
|
+
* - `dragOver(field)` → onDragOver; preventDefault + computes
|
|
13
|
+
* whether the cursor is over the LEFT or RIGHT half of the
|
|
14
|
+
* target → updates dropTarget so the indicator renders.
|
|
15
|
+
* - `drop(field)` → onDrop; computes the new order array via
|
|
16
|
+
* `moveColumn(source, target, side)` and commits it.
|
|
17
|
+
* - `dragEnd()` → onDragEnd; clears state.
|
|
18
|
+
*
|
|
19
|
+
* Reorder math: when dropping `source` onto the LEFT half of
|
|
20
|
+
* `target`, the source is inserted BEFORE the target's position
|
|
21
|
+
* in the order list. RIGHT half → AFTER.
|
|
22
|
+
*/
|
|
23
|
+
export interface UseColumnReorderArgs {
|
|
24
|
+
/** The current order. */
|
|
25
|
+
order: string[];
|
|
26
|
+
/** Commit a new order. */
|
|
27
|
+
onChange: (next: string[]) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface DropTarget {
|
|
30
|
+
field: string;
|
|
31
|
+
side: 'left' | 'right';
|
|
32
|
+
}
|
|
33
|
+
export interface ColumnReorderHandlers {
|
|
34
|
+
/** Current drop target (used by the renderer to show the indicator). */
|
|
35
|
+
dropTarget: DropTarget | null;
|
|
36
|
+
/** Field currently being dragged (used to dim the source header). */
|
|
37
|
+
draggingField: string | null;
|
|
38
|
+
dragStart: (field: string) => (e: DragEvent<HTMLElement>) => void;
|
|
39
|
+
dragOver: (field: string) => (e: DragEvent<HTMLElement>) => void;
|
|
40
|
+
drop: (field: string) => (e: DragEvent<HTMLElement>) => void;
|
|
41
|
+
dragEnd: () => void;
|
|
42
|
+
}
|
|
43
|
+
export declare function useColumnReorder(args: UseColumnReorderArgs): ColumnReorderHandlers;
|
|
44
|
+
/**
|
|
45
|
+
* Move `source` next to `target` in the `order` list.
|
|
46
|
+
* `side='left'` inserts before; `side='right'` inserts after.
|
|
47
|
+
* Exposed for unit testing.
|
|
48
|
+
*/
|
|
49
|
+
export declare function moveColumn(order: string[], source: string, target: string, side: 'left' | 'right'): string[];
|
|
50
|
+
//# sourceMappingURL=useColumnReorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColumnReorder.d.ts","sourceRoot":"","sources":["../../../../../src/components/DataGrid/reorder/useColumnReorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,oBAAoB;IACnC,yBAAyB;IACzB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,0BAA0B;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,qEAAqE;IACrE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAClE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACjE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,oBAAoB,GACzB,qBAAqB,CA+DvB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GAAG,OAAO,GACrB,MAAM,EAAE,CAUV"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type PointerEvent as RPointerEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Native column-resize behavior for DataGrid (and Table later if
|
|
4
|
+
* promoted to `_shared`).
|
|
5
|
+
*
|
|
6
|
+
* The returned `startResize` is wired to a `pointerdown` handler on a
|
|
7
|
+
* thin grabber positioned at the right edge of a `<th>`. We capture
|
|
8
|
+
* the pointer on the target element so `pointermove` / `pointerup`
|
|
9
|
+
* keep flowing even if the cursor leaves the grabber.
|
|
10
|
+
*
|
|
11
|
+
* Why native pointer events vs a drag library:
|
|
12
|
+
* - Zero new runtime deps (sprint constraint)
|
|
13
|
+
* - Pointer events normalize mouse/touch/pen out of the box
|
|
14
|
+
* - Pointer capture means we don't have to track the global
|
|
15
|
+
* `mousemove` / `mouseup` — the browser routes events to our
|
|
16
|
+
* listener until release.
|
|
17
|
+
*/
|
|
18
|
+
export interface UseColumnResizeArgs {
|
|
19
|
+
/** Current column widths (Record<field, px>). */
|
|
20
|
+
widths: Record<string, number>;
|
|
21
|
+
/** Commit a new width map. */
|
|
22
|
+
onChange: (next: Record<string, number>) => void;
|
|
23
|
+
/** Hard floor for any column (px). @default 40 */
|
|
24
|
+
minWidth?: number;
|
|
25
|
+
/** Hard ceiling for any column (px). @default 1200 */
|
|
26
|
+
maxWidth?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface ColumnResizeHandlers {
|
|
29
|
+
startResize: (field: string, startWidth: number, clampMin: number, clampMax: number) => (e: RPointerEvent<HTMLElement>) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function useColumnResize(args: UseColumnResizeArgs): ColumnResizeHandlers;
|
|
32
|
+
//# sourceMappingURL=useColumnResize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColumnResize.d.ts","sourceRoot":"","sources":["../../../../../src/components/DataGrid/resize/useColumnResize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,YAAY,IAAI,aAAa,EAAE,MAAM,OAAO,CAAC;AAEhF;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,8BAA8B;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACjD,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,CACX,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,KACb,CAAC,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAC9C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,oBAAoB,CA4D/E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TableColumn } from '../../Table/table.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Column visibility dialog for DataGrid.
|
|
4
|
+
*
|
|
5
|
+
* Renders a toolbar button (the trigger) that opens a `<Dialog>` with
|
|
6
|
+
* one checkbox per `hideable` column. The consumer can:
|
|
7
|
+
* - Show/hide individual columns
|
|
8
|
+
* - "Show all" / "Hide all" shortcuts
|
|
9
|
+
* - Persist visibility via the controllable `hiddenColumns` model
|
|
10
|
+
*
|
|
11
|
+
* Columns with `hideable: false` are NEVER shown in the dialog —
|
|
12
|
+
* those are considered structurally required (e.g. an ID column).
|
|
13
|
+
*
|
|
14
|
+
* RBAC-hidden columns (`access.onUnauthorized === 'hide'`) are also
|
|
15
|
+
* excluded — they're already removed from `visibleCols` upstream.
|
|
16
|
+
*/
|
|
17
|
+
export interface ColumnVisibilityLabels {
|
|
18
|
+
columnsButton?: string;
|
|
19
|
+
columnsTitle?: string;
|
|
20
|
+
columnsDescription?: string;
|
|
21
|
+
columnsShowAll?: string;
|
|
22
|
+
columnsHideAll?: string;
|
|
23
|
+
columnsDone?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ColumnVisibilityTriggerProps<T extends object> {
|
|
26
|
+
cols: TableColumn<T>[];
|
|
27
|
+
hiddenColumns: string[];
|
|
28
|
+
onChange: (next: string[]) => void;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
labels?: ColumnVisibilityLabels;
|
|
31
|
+
}
|
|
32
|
+
export declare function ColumnVisibilityTrigger<T extends object>(props: ColumnVisibilityTriggerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=ColumnVisibilityDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnVisibilityDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/DataGrid/visibility/ColumnVisibilityDialog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAWD,MAAM,WAAW,4BAA4B,CAAC,CAAC,SAAS,MAAM;IAC5D,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,sBAAsB,CAAC;CACjC;AAED,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,EACtD,KAAK,EAAE,4BAA4B,CAAC,CAAC,CAAC,2CA8CvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/dialog.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dialog.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/dialog.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CA6CzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Divider/divider.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEA0B1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;AAYnE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+
|
|
1
|
+
{"version":3,"file":"divider.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Divider/divider.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEA0B1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;AAYnE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA0C9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../../src/components/Pagination/Pagination.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,uBAAuB,CAAC;AAgB/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../../src/components/Pagination/Pagination.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,uBAAuB,CAAC;AAgB/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAmOhD"}
|