@zuilib/data-grid 0.3.0 → 0.4.0
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/README.md +18 -3
- package/dist/cells.js +1 -1
- package/dist/data-grid.d.ts +4 -4
- package/dist/data-grid.js +73 -62
- package/dist/index.d.ts +2 -2
- package/dist/index.js +74 -63
- package/dist/server-adapter.d.ts +2 -2
- package/dist/{state-9r5WYKo_.d.ts → state-BK7izXrC.d.ts} +1 -1
- package/dist/tailwind.css +2 -0
- package/dist/use-data-grid.d.ts +2 -2
- package/package.json +9 -11
- package/dist/types-B00kY3c9.d.ts +0 -97
- package/dist/types-Br4lyM03.d.ts +0 -192
- package/dist/types-D4DDIl3w.d.ts +0 -73
- package/dist/types-D8c-NBWy.d.ts +0 -117
- package/dist/types-DJh1--C1.d.ts +0 -188
- package/dist/types-j91R0mPE.d.ts +0 -75
package/dist/types-Br4lyM03.d.ts
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { ColumnDef, PaginationState, SortingState, ColumnFiltersState, VisibilityState, ColumnOrderState, ColumnPinningState, RowSelectionState, ExpandedState, ColumnSizingState } from '@tanstack/react-table';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Everything the grid can change. The consumer owns it: every interaction
|
|
5
|
-
* calls `onStateChange` with the whole next state, and the grid renders
|
|
6
|
-
* whatever comes back (a server round-trip in between is the point).
|
|
7
|
-
*/
|
|
8
|
-
interface DataGridState {
|
|
9
|
-
pagination: PaginationState;
|
|
10
|
-
sorting: SortingState;
|
|
11
|
-
columnFilters: ColumnFiltersState;
|
|
12
|
-
globalFilter: string;
|
|
13
|
-
columnVisibility: VisibilityState;
|
|
14
|
-
columnOrder: ColumnOrderState;
|
|
15
|
-
columnPinning: ColumnPinningState;
|
|
16
|
-
rowSelection: RowSelectionState;
|
|
17
|
-
/** Expanded rows, keyed by row id. UI-only: `toQuery` leaves it out. */
|
|
18
|
-
expanded: ExpandedState;
|
|
19
|
-
/**
|
|
20
|
-
* "Select all N": every row matching the current query is selected, not
|
|
21
|
-
* only the ones on this page. Set by the bulk bar; cleared by any other
|
|
22
|
-
* selection change. `toQuery` passes it on, the server acts on it.
|
|
23
|
-
*/
|
|
24
|
-
allMatching?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Column widths in px, keyed by column id. Optional: left out, the grid
|
|
27
|
-
* keeps the widths itself; passed (even `{}`), resizes go out through
|
|
28
|
-
* `onStateChange` so they can be persisted. UI-only: `toQuery` leaves it out.
|
|
29
|
-
*/
|
|
30
|
-
columnSizing?: ColumnSizingState;
|
|
31
|
-
}
|
|
32
|
-
declare const DEFAULT_PAGE_SIZE = 25;
|
|
33
|
-
declare const defaultDataGridState: DataGridState;
|
|
34
|
-
/** Fills the keys a consumer left out, so the grid always sees a full state. */
|
|
35
|
-
declare function resolveDataGridState(state: Partial<DataGridState> | undefined): DataGridState;
|
|
36
|
-
type DataGridAlign = 'start' | 'center' | 'end';
|
|
37
|
-
/** A text filter: one string, matched however the server matches it. */
|
|
38
|
-
interface DataGridTextFilter {
|
|
39
|
-
type: 'text';
|
|
40
|
-
placeholder?: string;
|
|
41
|
-
}
|
|
42
|
-
/** A facet filter: a list of options, of which any number may be picked. */
|
|
43
|
-
interface DataGridSelectFilter {
|
|
44
|
-
type: 'select';
|
|
45
|
-
options: readonly {
|
|
46
|
-
value: string;
|
|
47
|
-
label?: string;
|
|
48
|
-
}[];
|
|
49
|
-
}
|
|
50
|
-
/** A date range: ISO `YYYY-MM-DD` bounds, either side optional. */
|
|
51
|
-
interface DataGridDateRangeFilter {
|
|
52
|
-
type: 'date-range';
|
|
53
|
-
}
|
|
54
|
-
type DataGridFilter = DataGridTextFilter | DataGridSelectFilter | DataGridDateRangeFilter;
|
|
55
|
-
interface DataGridDateRange {
|
|
56
|
-
from?: string;
|
|
57
|
-
to?: string;
|
|
58
|
-
}
|
|
59
|
-
/** The ZUI extras on a TanStack column definition. */
|
|
60
|
-
interface DataGridColumnExtras {
|
|
61
|
-
/** Double-click or Enter on a cell turns it into an input; see `onCellEdit`. */
|
|
62
|
-
enableInlineEdit?: boolean;
|
|
63
|
-
/** Horizontal alignment of the head and the cells; `end` for numbers. */
|
|
64
|
-
align?: DataGridAlign;
|
|
65
|
-
/** Initial width in px (TanStack `size`); the user can resize from there. */
|
|
66
|
-
width?: number;
|
|
67
|
-
/** Declares the column's filter popover. */
|
|
68
|
-
filter?: DataGridFilter;
|
|
69
|
-
}
|
|
70
|
-
type DataGridColumnDef<TData, TValue = unknown> = ColumnDef<TData, TValue> & DataGridColumnExtras;
|
|
71
|
-
/** The extras may also be declared on `meta` (the TanStack way of extending a column). */
|
|
72
|
-
interface DataGridColumnMeta extends DataGridColumnExtras {
|
|
73
|
-
/** The column's name in the column manager, the filter chips and the pin labels, when `header` is not a string. */
|
|
74
|
-
label?: string;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Every string the grid renders or announces, overridable for another
|
|
78
|
-
* language. A `{name}` placeholder is replaced with the value named.
|
|
79
|
-
*/
|
|
80
|
-
interface DataGridLabels {
|
|
81
|
-
/** @default 'Pin left' */
|
|
82
|
-
pinLeft: string;
|
|
83
|
-
/** @default 'Pin right' */
|
|
84
|
-
pinRight: string;
|
|
85
|
-
/** @default 'Unpin' */
|
|
86
|
-
unpin: string;
|
|
87
|
-
/** @default 'Expand row' */
|
|
88
|
-
expandRow: string;
|
|
89
|
-
/** @default 'Collapse row' */
|
|
90
|
-
collapseRow: string;
|
|
91
|
-
/** The sr-only head of the expand column. @default 'Expand' */
|
|
92
|
-
expandColumn: string;
|
|
93
|
-
/** Bulk bar: the count of selected rows. `{count}` is replaced. @default '{count} selected' */
|
|
94
|
-
selectedCount: string;
|
|
95
|
-
/** Bulk bar: the count when every matching row is selected. `{count}` is replaced. @default 'All {count} selected' */
|
|
96
|
-
allMatchingSelected: string;
|
|
97
|
-
/** Bulk bar: the button that selects every matching row. `{count}` is replaced. @default 'Select all {count}' */
|
|
98
|
-
selectAllMatching: string;
|
|
99
|
-
/** @default 'Clear selection' */
|
|
100
|
-
clearSelection: string;
|
|
101
|
-
/** The bulk bar's region name. @default 'Bulk actions' */
|
|
102
|
-
bulkActions: string;
|
|
103
|
-
/** The head checkbox. @default 'Select all rows on this page' */
|
|
104
|
-
selectAllOnPage: string;
|
|
105
|
-
/** A row checkbox. @default 'Select row' */
|
|
106
|
-
selectRow: string;
|
|
107
|
-
/** The footer's `<nav>` name. @default 'Pagination' */
|
|
108
|
-
pagination: string;
|
|
109
|
-
/** @default 'Rows per page' */
|
|
110
|
-
rowsPerPage: string;
|
|
111
|
-
/** The range text while loading. @default 'Loading…' */
|
|
112
|
-
loading: string;
|
|
113
|
-
/** The range text. `{first}`, `{last}` and `{total}` are replaced. @default '{first}–{last} of {total}' */
|
|
114
|
-
range: string;
|
|
115
|
-
/** @default 'First page' */
|
|
116
|
-
firstPage: string;
|
|
117
|
-
/** @default 'Previous page' */
|
|
118
|
-
previousPage: string;
|
|
119
|
-
/** @default 'Next page' */
|
|
120
|
-
nextPage: string;
|
|
121
|
-
/** @default 'Last page' */
|
|
122
|
-
lastPage: string;
|
|
123
|
-
/** The toolbar search field's name. @default 'Search' */
|
|
124
|
-
search: string;
|
|
125
|
-
/** The toolbar search field's placeholder. @default 'Search…' */
|
|
126
|
-
searchPlaceholder: string;
|
|
127
|
-
/** The filter chip list's name. @default 'Active filters' */
|
|
128
|
-
activeFilters: string;
|
|
129
|
-
/** A chip's remove button. `{column}` is replaced. @default 'Remove {column} filter' */
|
|
130
|
-
removeFilter: string;
|
|
131
|
-
/** The column manager button and its list. @default 'Columns' */
|
|
132
|
-
columns: string;
|
|
133
|
-
/** `{column}` is replaced. @default 'Move {column} up' */
|
|
134
|
-
moveUp: string;
|
|
135
|
-
/** `{column}` is replaced. @default 'Move {column} down' */
|
|
136
|
-
moveDown: string;
|
|
137
|
-
/** The column manager's addable-fields section. @default 'Add column' */
|
|
138
|
-
addColumnSection: string;
|
|
139
|
-
/** An addable field's button. `{column}` is replaced. @default 'Add {column}' */
|
|
140
|
-
addColumn: string;
|
|
141
|
-
/** The funnel button. `{column}` is replaced. @default 'Filter {column}' */
|
|
142
|
-
filterColumn: string;
|
|
143
|
-
/** The funnel button while a filter is set. `{column}` is replaced. @default 'Filter {column} (active)' */
|
|
144
|
-
filterColumnActive: string;
|
|
145
|
-
/** The text filter input. @default 'Filter value' */
|
|
146
|
-
filterValue: string;
|
|
147
|
-
/** The text filter placeholder when the column declares none. @default 'Contains…' */
|
|
148
|
-
filterPlaceholder: string;
|
|
149
|
-
/** The facet filter's checkbox group. @default 'Options' */
|
|
150
|
-
filterOptions: string;
|
|
151
|
-
/** @default 'From' */
|
|
152
|
-
from: string;
|
|
153
|
-
/** @default 'To' */
|
|
154
|
-
to: string;
|
|
155
|
-
/** @default 'Clear' */
|
|
156
|
-
clear: string;
|
|
157
|
-
/** @default 'Apply' */
|
|
158
|
-
apply: string;
|
|
159
|
-
/** A date-range chip with only a lower bound. `{date}` is replaced. @default 'from {date}' */
|
|
160
|
-
rangeFrom: string;
|
|
161
|
-
/** A date-range chip with only an upper bound. `{date}` is replaced. @default 'until {date}' */
|
|
162
|
-
rangeUntil: string;
|
|
163
|
-
/** The resize handle. `{column}` is replaced. @default 'Resize {column}' */
|
|
164
|
-
resizeColumn: string;
|
|
165
|
-
/** The inline edit input. `{column}` is replaced. @default 'Edit {column}' */
|
|
166
|
-
editColumn: string;
|
|
167
|
-
/** The default empty state's title. @default 'No results' */
|
|
168
|
-
noResults: string;
|
|
169
|
-
/** The default empty state's description. @default 'Try a different search or clear the filters.' */
|
|
170
|
-
noResultsDescription: string;
|
|
171
|
-
}
|
|
172
|
-
declare const defaultDataGridLabels: DataGridLabels;
|
|
173
|
-
interface DataGridCellEdit {
|
|
174
|
-
rowId: string;
|
|
175
|
-
columnId: string;
|
|
176
|
-
value: string;
|
|
177
|
-
}
|
|
178
|
-
interface DataGridBulkActionContext {
|
|
179
|
-
/** `true` when "Select all N" is on: act on every row matching the query, not only `selectedIds`. */
|
|
180
|
-
allMatching: boolean;
|
|
181
|
-
/** The rows matching the query (`rowCount`), the size of the set when `allMatching` is on. */
|
|
182
|
-
rowCount: number;
|
|
183
|
-
}
|
|
184
|
-
interface DataGridBulkAction {
|
|
185
|
-
id: string;
|
|
186
|
-
label: string;
|
|
187
|
-
variant?: 'primary' | 'secondary' | 'destructive' | 'outline' | 'ghost';
|
|
188
|
-
onAction: (selectedIds: string[], context: DataGridBulkActionContext) => void;
|
|
189
|
-
}
|
|
190
|
-
type DataGridDensity = 'compact' | 'comfortable';
|
|
191
|
-
|
|
192
|
-
export { DEFAULT_PAGE_SIZE as D, type DataGridAlign as a, type DataGridBulkAction as b, type DataGridBulkActionContext as c, type DataGridCellEdit as d, type DataGridColumnDef as e, type DataGridColumnExtras as f, type DataGridColumnMeta as g, type DataGridDateRange as h, type DataGridDateRangeFilter as i, type DataGridDensity as j, type DataGridFilter as k, type DataGridLabels as l, type DataGridSelectFilter as m, type DataGridState as n, type DataGridTextFilter as o, defaultDataGridLabels as p, defaultDataGridState as q, resolveDataGridState as r };
|
package/dist/types-D4DDIl3w.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ColumnDef, PaginationState, SortingState, ColumnFiltersState, VisibilityState, ColumnOrderState, ColumnPinningState, RowSelectionState } from '@tanstack/react-table';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Everything the grid can change. The consumer owns it: every interaction
|
|
5
|
-
* calls `onStateChange` with the whole next state, and the grid renders
|
|
6
|
-
* whatever comes back (a server round-trip in between is the point).
|
|
7
|
-
*/
|
|
8
|
-
interface DataGridState {
|
|
9
|
-
pagination: PaginationState;
|
|
10
|
-
sorting: SortingState;
|
|
11
|
-
columnFilters: ColumnFiltersState;
|
|
12
|
-
globalFilter: string;
|
|
13
|
-
columnVisibility: VisibilityState;
|
|
14
|
-
columnOrder: ColumnOrderState;
|
|
15
|
-
columnPinning: ColumnPinningState;
|
|
16
|
-
rowSelection: RowSelectionState;
|
|
17
|
-
}
|
|
18
|
-
declare const DEFAULT_PAGE_SIZE = 25;
|
|
19
|
-
declare const defaultDataGridState: DataGridState;
|
|
20
|
-
/** Fills the keys a consumer left out, so the grid always sees a full state. */
|
|
21
|
-
declare function resolveDataGridState(state: Partial<DataGridState> | undefined): DataGridState;
|
|
22
|
-
type DataGridAlign = 'start' | 'center' | 'end';
|
|
23
|
-
/** A text filter: one string, matched however the server matches it. */
|
|
24
|
-
interface DataGridTextFilter {
|
|
25
|
-
type: 'text';
|
|
26
|
-
placeholder?: string;
|
|
27
|
-
}
|
|
28
|
-
/** A facet filter: a list of options, of which any number may be picked. */
|
|
29
|
-
interface DataGridSelectFilter {
|
|
30
|
-
type: 'select';
|
|
31
|
-
options: readonly {
|
|
32
|
-
value: string;
|
|
33
|
-
label?: string;
|
|
34
|
-
}[];
|
|
35
|
-
}
|
|
36
|
-
/** A date range: ISO `YYYY-MM-DD` bounds, either side optional. */
|
|
37
|
-
interface DataGridDateRangeFilter {
|
|
38
|
-
type: 'date-range';
|
|
39
|
-
}
|
|
40
|
-
type DataGridFilter = DataGridTextFilter | DataGridSelectFilter | DataGridDateRangeFilter;
|
|
41
|
-
interface DataGridDateRange {
|
|
42
|
-
from?: string;
|
|
43
|
-
to?: string;
|
|
44
|
-
}
|
|
45
|
-
/** The ZUI extras on a TanStack column definition. */
|
|
46
|
-
interface DataGridColumnExtras {
|
|
47
|
-
/** Double-click or Enter on a cell turns it into an input; see `onCellEdit`. */
|
|
48
|
-
enableInlineEdit?: boolean;
|
|
49
|
-
/** Horizontal alignment of the head and the cells; `end` for numbers. */
|
|
50
|
-
align?: DataGridAlign;
|
|
51
|
-
/** Initial width in px (TanStack `size`); the user can resize from there. */
|
|
52
|
-
width?: number;
|
|
53
|
-
/** Declares the column's filter popover. */
|
|
54
|
-
filter?: DataGridFilter;
|
|
55
|
-
}
|
|
56
|
-
type DataGridColumnDef<TData, TValue = unknown> = ColumnDef<TData, TValue> & DataGridColumnExtras;
|
|
57
|
-
/** The extras may also be declared on `meta` (the TanStack way of extending a column). */
|
|
58
|
-
interface DataGridColumnMeta extends DataGridColumnExtras {
|
|
59
|
-
}
|
|
60
|
-
interface DataGridCellEdit {
|
|
61
|
-
rowId: string;
|
|
62
|
-
columnId: string;
|
|
63
|
-
value: string;
|
|
64
|
-
}
|
|
65
|
-
interface DataGridBulkAction {
|
|
66
|
-
id: string;
|
|
67
|
-
label: string;
|
|
68
|
-
variant?: 'primary' | 'secondary' | 'destructive' | 'outline' | 'ghost';
|
|
69
|
-
onAction: (selectedIds: string[]) => void;
|
|
70
|
-
}
|
|
71
|
-
type DataGridDensity = 'compact' | 'comfortable';
|
|
72
|
-
|
|
73
|
-
export { type DataGridState as D, type DataGridDensity as a, type DataGridCellEdit as b, type DataGridBulkAction as c, DEFAULT_PAGE_SIZE as d, type DataGridAlign as e, type DataGridColumnDef as f, type DataGridColumnExtras as g, type DataGridColumnMeta as h, type DataGridDateRange as i, type DataGridDateRangeFilter as j, type DataGridFilter as k, type DataGridSelectFilter as l, type DataGridTextFilter as m, defaultDataGridState as n, resolveDataGridState as r };
|
package/dist/types-D8c-NBWy.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { ColumnDef, PaginationState, SortingState, ColumnFiltersState, VisibilityState, ColumnOrderState, ColumnPinningState, RowSelectionState, ExpandedState, ColumnSizingState } from '@tanstack/react-table';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Everything the grid can change. The consumer owns it: every interaction
|
|
5
|
-
* calls `onStateChange` with the whole next state, and the grid renders
|
|
6
|
-
* whatever comes back (a server round-trip in between is the point).
|
|
7
|
-
*/
|
|
8
|
-
interface DataGridState {
|
|
9
|
-
pagination: PaginationState;
|
|
10
|
-
sorting: SortingState;
|
|
11
|
-
columnFilters: ColumnFiltersState;
|
|
12
|
-
globalFilter: string;
|
|
13
|
-
columnVisibility: VisibilityState;
|
|
14
|
-
columnOrder: ColumnOrderState;
|
|
15
|
-
columnPinning: ColumnPinningState;
|
|
16
|
-
rowSelection: RowSelectionState;
|
|
17
|
-
/** Expanded rows, keyed by row id. UI-only: `toQuery` leaves it out. */
|
|
18
|
-
expanded: ExpandedState;
|
|
19
|
-
/**
|
|
20
|
-
* "Select all N": every row matching the current query is selected, not
|
|
21
|
-
* only the ones on this page. Set by the bulk bar; cleared by any other
|
|
22
|
-
* selection change. `toQuery` passes it on, the server acts on it.
|
|
23
|
-
*/
|
|
24
|
-
allMatching?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Column widths in px, keyed by column id. Optional: left out, the grid
|
|
27
|
-
* keeps the widths itself; passed (even `{}`), resizes go out through
|
|
28
|
-
* `onStateChange` so they can be persisted. UI-only: `toQuery` leaves it out.
|
|
29
|
-
*/
|
|
30
|
-
columnSizing?: ColumnSizingState;
|
|
31
|
-
}
|
|
32
|
-
declare const DEFAULT_PAGE_SIZE = 25;
|
|
33
|
-
declare const defaultDataGridState: DataGridState;
|
|
34
|
-
/** Fills the keys a consumer left out, so the grid always sees a full state. */
|
|
35
|
-
declare function resolveDataGridState(state: Partial<DataGridState> | undefined): DataGridState;
|
|
36
|
-
type DataGridAlign = 'start' | 'center' | 'end';
|
|
37
|
-
/** A text filter: one string, matched however the server matches it. */
|
|
38
|
-
interface DataGridTextFilter {
|
|
39
|
-
type: 'text';
|
|
40
|
-
placeholder?: string;
|
|
41
|
-
}
|
|
42
|
-
/** A facet filter: a list of options, of which any number may be picked. */
|
|
43
|
-
interface DataGridSelectFilter {
|
|
44
|
-
type: 'select';
|
|
45
|
-
options: readonly {
|
|
46
|
-
value: string;
|
|
47
|
-
label?: string;
|
|
48
|
-
}[];
|
|
49
|
-
}
|
|
50
|
-
/** A date range: ISO `YYYY-MM-DD` bounds, either side optional. */
|
|
51
|
-
interface DataGridDateRangeFilter {
|
|
52
|
-
type: 'date-range';
|
|
53
|
-
}
|
|
54
|
-
type DataGridFilter = DataGridTextFilter | DataGridSelectFilter | DataGridDateRangeFilter;
|
|
55
|
-
interface DataGridDateRange {
|
|
56
|
-
from?: string;
|
|
57
|
-
to?: string;
|
|
58
|
-
}
|
|
59
|
-
/** The ZUI extras on a TanStack column definition. */
|
|
60
|
-
interface DataGridColumnExtras {
|
|
61
|
-
/** Double-click or Enter on a cell turns it into an input; see `onCellEdit`. */
|
|
62
|
-
enableInlineEdit?: boolean;
|
|
63
|
-
/** Horizontal alignment of the head and the cells; `end` for numbers. */
|
|
64
|
-
align?: DataGridAlign;
|
|
65
|
-
/** Initial width in px (TanStack `size`); the user can resize from there. */
|
|
66
|
-
width?: number;
|
|
67
|
-
/** Declares the column's filter popover. */
|
|
68
|
-
filter?: DataGridFilter;
|
|
69
|
-
}
|
|
70
|
-
type DataGridColumnDef<TData, TValue = unknown> = ColumnDef<TData, TValue> & DataGridColumnExtras;
|
|
71
|
-
/** The extras may also be declared on `meta` (the TanStack way of extending a column). */
|
|
72
|
-
interface DataGridColumnMeta extends DataGridColumnExtras {
|
|
73
|
-
/** The column's name in the column manager, the filter chips and the pin labels, when `header` is not a string. */
|
|
74
|
-
label?: string;
|
|
75
|
-
}
|
|
76
|
-
/** The grid's own strings, overridable for another language. */
|
|
77
|
-
interface DataGridLabels {
|
|
78
|
-
/** @default 'Pin left' */
|
|
79
|
-
pinLeft: string;
|
|
80
|
-
/** @default 'Pin right' */
|
|
81
|
-
pinRight: string;
|
|
82
|
-
/** @default 'Unpin' */
|
|
83
|
-
unpin: string;
|
|
84
|
-
/** @default 'Expand row' */
|
|
85
|
-
expandRow: string;
|
|
86
|
-
/** @default 'Collapse row' */
|
|
87
|
-
collapseRow: string;
|
|
88
|
-
/** Bulk bar: the count of selected rows. `{count}` is replaced. @default '{count} selected' */
|
|
89
|
-
selectedCount: string;
|
|
90
|
-
/** Bulk bar: the count when every matching row is selected. `{count}` is replaced. @default 'All {count} selected' */
|
|
91
|
-
allMatchingSelected: string;
|
|
92
|
-
/** Bulk bar: the button that selects every matching row. `{count}` is replaced. @default 'Select all {count}' */
|
|
93
|
-
selectAllMatching: string;
|
|
94
|
-
/** @default 'Clear selection' */
|
|
95
|
-
clearSelection: string;
|
|
96
|
-
}
|
|
97
|
-
declare const defaultDataGridLabels: DataGridLabels;
|
|
98
|
-
interface DataGridCellEdit {
|
|
99
|
-
rowId: string;
|
|
100
|
-
columnId: string;
|
|
101
|
-
value: string;
|
|
102
|
-
}
|
|
103
|
-
interface DataGridBulkActionContext {
|
|
104
|
-
/** `true` when "Select all N" is on: act on every row matching the query, not only `selectedIds`. */
|
|
105
|
-
allMatching: boolean;
|
|
106
|
-
/** The rows matching the query (`rowCount`), the size of the set when `allMatching` is on. */
|
|
107
|
-
rowCount: number;
|
|
108
|
-
}
|
|
109
|
-
interface DataGridBulkAction {
|
|
110
|
-
id: string;
|
|
111
|
-
label: string;
|
|
112
|
-
variant?: 'primary' | 'secondary' | 'destructive' | 'outline' | 'ghost';
|
|
113
|
-
onAction: (selectedIds: string[], context: DataGridBulkActionContext) => void;
|
|
114
|
-
}
|
|
115
|
-
type DataGridDensity = 'compact' | 'comfortable';
|
|
116
|
-
|
|
117
|
-
export { DEFAULT_PAGE_SIZE as D, type DataGridAlign as a, type DataGridBulkAction as b, type DataGridBulkActionContext as c, type DataGridCellEdit as d, type DataGridColumnDef as e, type DataGridColumnExtras as f, type DataGridColumnMeta as g, type DataGridDateRange as h, type DataGridDateRangeFilter as i, type DataGridDensity as j, type DataGridFilter as k, type DataGridLabels as l, type DataGridSelectFilter as m, type DataGridState as n, type DataGridTextFilter as o, defaultDataGridLabels as p, defaultDataGridState as q, resolveDataGridState as r };
|
package/dist/types-DJh1--C1.d.ts
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { ColumnDef, PaginationState, SortingState, ColumnFiltersState, VisibilityState, ColumnOrderState, ColumnPinningState, RowSelectionState, ExpandedState, ColumnSizingState } from '@tanstack/react-table';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Everything the grid can change. The consumer owns it: every interaction
|
|
5
|
-
* calls `onStateChange` with the whole next state, and the grid renders
|
|
6
|
-
* whatever comes back (a server round-trip in between is the point).
|
|
7
|
-
*/
|
|
8
|
-
interface DataGridState {
|
|
9
|
-
pagination: PaginationState;
|
|
10
|
-
sorting: SortingState;
|
|
11
|
-
columnFilters: ColumnFiltersState;
|
|
12
|
-
globalFilter: string;
|
|
13
|
-
columnVisibility: VisibilityState;
|
|
14
|
-
columnOrder: ColumnOrderState;
|
|
15
|
-
columnPinning: ColumnPinningState;
|
|
16
|
-
rowSelection: RowSelectionState;
|
|
17
|
-
/** Expanded rows, keyed by row id. UI-only: `toQuery` leaves it out. */
|
|
18
|
-
expanded: ExpandedState;
|
|
19
|
-
/**
|
|
20
|
-
* "Select all N": every row matching the current query is selected, not
|
|
21
|
-
* only the ones on this page. Set by the bulk bar; cleared by any other
|
|
22
|
-
* selection change. `toQuery` passes it on, the server acts on it.
|
|
23
|
-
*/
|
|
24
|
-
allMatching?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Column widths in px, keyed by column id. Optional: left out, the grid
|
|
27
|
-
* keeps the widths itself; passed (even `{}`), resizes go out through
|
|
28
|
-
* `onStateChange` so they can be persisted. UI-only: `toQuery` leaves it out.
|
|
29
|
-
*/
|
|
30
|
-
columnSizing?: ColumnSizingState;
|
|
31
|
-
}
|
|
32
|
-
declare const DEFAULT_PAGE_SIZE = 25;
|
|
33
|
-
declare const defaultDataGridState: DataGridState;
|
|
34
|
-
/** Fills the keys a consumer left out, so the grid always sees a full state. */
|
|
35
|
-
declare function resolveDataGridState(state: Partial<DataGridState> | undefined): DataGridState;
|
|
36
|
-
type DataGridAlign = 'start' | 'center' | 'end';
|
|
37
|
-
/** A text filter: one string, matched however the server matches it. */
|
|
38
|
-
interface DataGridTextFilter {
|
|
39
|
-
type: 'text';
|
|
40
|
-
placeholder?: string;
|
|
41
|
-
}
|
|
42
|
-
/** A facet filter: a list of options, of which any number may be picked. */
|
|
43
|
-
interface DataGridSelectFilter {
|
|
44
|
-
type: 'select';
|
|
45
|
-
options: readonly {
|
|
46
|
-
value: string;
|
|
47
|
-
label?: string;
|
|
48
|
-
}[];
|
|
49
|
-
}
|
|
50
|
-
/** A date range: ISO `YYYY-MM-DD` bounds, either side optional. */
|
|
51
|
-
interface DataGridDateRangeFilter {
|
|
52
|
-
type: 'date-range';
|
|
53
|
-
}
|
|
54
|
-
type DataGridFilter = DataGridTextFilter | DataGridSelectFilter | DataGridDateRangeFilter;
|
|
55
|
-
interface DataGridDateRange {
|
|
56
|
-
from?: string;
|
|
57
|
-
to?: string;
|
|
58
|
-
}
|
|
59
|
-
/** The ZUI extras on a TanStack column definition. */
|
|
60
|
-
interface DataGridColumnExtras {
|
|
61
|
-
/** Double-click or Enter on a cell turns it into an input; see `onCellEdit`. */
|
|
62
|
-
enableInlineEdit?: boolean;
|
|
63
|
-
/** Horizontal alignment of the head and the cells; `end` for numbers. */
|
|
64
|
-
align?: DataGridAlign;
|
|
65
|
-
/** Initial width in px (TanStack `size`); the user can resize from there. */
|
|
66
|
-
width?: number;
|
|
67
|
-
/** Declares the column's filter popover. */
|
|
68
|
-
filter?: DataGridFilter;
|
|
69
|
-
}
|
|
70
|
-
type DataGridColumnDef<TData, TValue = unknown> = ColumnDef<TData, TValue> & DataGridColumnExtras;
|
|
71
|
-
/** The extras may also be declared on `meta` (the TanStack way of extending a column). */
|
|
72
|
-
interface DataGridColumnMeta extends DataGridColumnExtras {
|
|
73
|
-
/** The column's name in the column manager, the filter chips and the pin labels, when `header` is not a string. */
|
|
74
|
-
label?: string;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Every string the grid renders or announces, overridable for another
|
|
78
|
-
* language. A `{name}` placeholder is replaced with the value named.
|
|
79
|
-
*/
|
|
80
|
-
interface DataGridLabels {
|
|
81
|
-
/** @default 'Pin left' */
|
|
82
|
-
pinLeft: string;
|
|
83
|
-
/** @default 'Pin right' */
|
|
84
|
-
pinRight: string;
|
|
85
|
-
/** @default 'Unpin' */
|
|
86
|
-
unpin: string;
|
|
87
|
-
/** @default 'Expand row' */
|
|
88
|
-
expandRow: string;
|
|
89
|
-
/** @default 'Collapse row' */
|
|
90
|
-
collapseRow: string;
|
|
91
|
-
/** The sr-only head of the expand column. @default 'Expand' */
|
|
92
|
-
expandColumn: string;
|
|
93
|
-
/** Bulk bar: the count of selected rows. `{count}` is replaced. @default '{count} selected' */
|
|
94
|
-
selectedCount: string;
|
|
95
|
-
/** Bulk bar: the count when every matching row is selected. `{count}` is replaced. @default 'All {count} selected' */
|
|
96
|
-
allMatchingSelected: string;
|
|
97
|
-
/** Bulk bar: the button that selects every matching row. `{count}` is replaced. @default 'Select all {count}' */
|
|
98
|
-
selectAllMatching: string;
|
|
99
|
-
/** @default 'Clear selection' */
|
|
100
|
-
clearSelection: string;
|
|
101
|
-
/** The bulk bar's region name. @default 'Bulk actions' */
|
|
102
|
-
bulkActions: string;
|
|
103
|
-
/** The head checkbox. @default 'Select all rows on this page' */
|
|
104
|
-
selectAllOnPage: string;
|
|
105
|
-
/** A row checkbox. @default 'Select row' */
|
|
106
|
-
selectRow: string;
|
|
107
|
-
/** The footer's `<nav>` name. @default 'Pagination' */
|
|
108
|
-
pagination: string;
|
|
109
|
-
/** @default 'Rows per page' */
|
|
110
|
-
rowsPerPage: string;
|
|
111
|
-
/** The range text while loading. @default 'Loading…' */
|
|
112
|
-
loading: string;
|
|
113
|
-
/** The range text. `{first}`, `{last}` and `{total}` are replaced. @default '{first}–{last} of {total}' */
|
|
114
|
-
range: string;
|
|
115
|
-
/** @default 'First page' */
|
|
116
|
-
firstPage: string;
|
|
117
|
-
/** @default 'Previous page' */
|
|
118
|
-
previousPage: string;
|
|
119
|
-
/** @default 'Next page' */
|
|
120
|
-
nextPage: string;
|
|
121
|
-
/** @default 'Last page' */
|
|
122
|
-
lastPage: string;
|
|
123
|
-
/** The toolbar search field's name. @default 'Search' */
|
|
124
|
-
search: string;
|
|
125
|
-
/** The toolbar search field's placeholder. @default 'Search…' */
|
|
126
|
-
searchPlaceholder: string;
|
|
127
|
-
/** The filter chip list's name. @default 'Active filters' */
|
|
128
|
-
activeFilters: string;
|
|
129
|
-
/** A chip's remove button. `{column}` is replaced. @default 'Remove {column} filter' */
|
|
130
|
-
removeFilter: string;
|
|
131
|
-
/** The column manager button and its list. @default 'Columns' */
|
|
132
|
-
columns: string;
|
|
133
|
-
/** `{column}` is replaced. @default 'Move {column} up' */
|
|
134
|
-
moveUp: string;
|
|
135
|
-
/** `{column}` is replaced. @default 'Move {column} down' */
|
|
136
|
-
moveDown: string;
|
|
137
|
-
/** The funnel button. `{column}` is replaced. @default 'Filter {column}' */
|
|
138
|
-
filterColumn: string;
|
|
139
|
-
/** The funnel button while a filter is set. `{column}` is replaced. @default 'Filter {column} (active)' */
|
|
140
|
-
filterColumnActive: string;
|
|
141
|
-
/** The text filter input. @default 'Filter value' */
|
|
142
|
-
filterValue: string;
|
|
143
|
-
/** The text filter placeholder when the column declares none. @default 'Contains…' */
|
|
144
|
-
filterPlaceholder: string;
|
|
145
|
-
/** The facet filter's checkbox group. @default 'Options' */
|
|
146
|
-
filterOptions: string;
|
|
147
|
-
/** @default 'From' */
|
|
148
|
-
from: string;
|
|
149
|
-
/** @default 'To' */
|
|
150
|
-
to: string;
|
|
151
|
-
/** @default 'Clear' */
|
|
152
|
-
clear: string;
|
|
153
|
-
/** @default 'Apply' */
|
|
154
|
-
apply: string;
|
|
155
|
-
/** A date-range chip with only a lower bound. `{date}` is replaced. @default 'from {date}' */
|
|
156
|
-
rangeFrom: string;
|
|
157
|
-
/** A date-range chip with only an upper bound. `{date}` is replaced. @default 'until {date}' */
|
|
158
|
-
rangeUntil: string;
|
|
159
|
-
/** The resize handle. `{column}` is replaced. @default 'Resize {column}' */
|
|
160
|
-
resizeColumn: string;
|
|
161
|
-
/** The inline edit input. `{column}` is replaced. @default 'Edit {column}' */
|
|
162
|
-
editColumn: string;
|
|
163
|
-
/** The default empty state's title. @default 'No results' */
|
|
164
|
-
noResults: string;
|
|
165
|
-
/** The default empty state's description. @default 'Try a different search or clear the filters.' */
|
|
166
|
-
noResultsDescription: string;
|
|
167
|
-
}
|
|
168
|
-
declare const defaultDataGridLabels: DataGridLabels;
|
|
169
|
-
interface DataGridCellEdit {
|
|
170
|
-
rowId: string;
|
|
171
|
-
columnId: string;
|
|
172
|
-
value: string;
|
|
173
|
-
}
|
|
174
|
-
interface DataGridBulkActionContext {
|
|
175
|
-
/** `true` when "Select all N" is on: act on every row matching the query, not only `selectedIds`. */
|
|
176
|
-
allMatching: boolean;
|
|
177
|
-
/** The rows matching the query (`rowCount`), the size of the set when `allMatching` is on. */
|
|
178
|
-
rowCount: number;
|
|
179
|
-
}
|
|
180
|
-
interface DataGridBulkAction {
|
|
181
|
-
id: string;
|
|
182
|
-
label: string;
|
|
183
|
-
variant?: 'primary' | 'secondary' | 'destructive' | 'outline' | 'ghost';
|
|
184
|
-
onAction: (selectedIds: string[], context: DataGridBulkActionContext) => void;
|
|
185
|
-
}
|
|
186
|
-
type DataGridDensity = 'compact' | 'comfortable';
|
|
187
|
-
|
|
188
|
-
export { DEFAULT_PAGE_SIZE as D, type DataGridAlign as a, type DataGridBulkAction as b, type DataGridBulkActionContext as c, type DataGridCellEdit as d, type DataGridColumnDef as e, type DataGridColumnExtras as f, type DataGridColumnMeta as g, type DataGridDateRange as h, type DataGridDateRangeFilter as i, type DataGridDensity as j, type DataGridFilter as k, type DataGridLabels as l, type DataGridSelectFilter as m, type DataGridState as n, type DataGridTextFilter as o, defaultDataGridLabels as p, defaultDataGridState as q, resolveDataGridState as r };
|
package/dist/types-j91R0mPE.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { ColumnDef, PaginationState, SortingState, ColumnFiltersState, VisibilityState, ColumnOrderState, ColumnPinningState, RowSelectionState, ExpandedState } from '@tanstack/react-table';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Everything the grid can change. The consumer owns it: every interaction
|
|
5
|
-
* calls `onStateChange` with the whole next state, and the grid renders
|
|
6
|
-
* whatever comes back (a server round-trip in between is the point).
|
|
7
|
-
*/
|
|
8
|
-
interface DataGridState {
|
|
9
|
-
pagination: PaginationState;
|
|
10
|
-
sorting: SortingState;
|
|
11
|
-
columnFilters: ColumnFiltersState;
|
|
12
|
-
globalFilter: string;
|
|
13
|
-
columnVisibility: VisibilityState;
|
|
14
|
-
columnOrder: ColumnOrderState;
|
|
15
|
-
columnPinning: ColumnPinningState;
|
|
16
|
-
rowSelection: RowSelectionState;
|
|
17
|
-
/** Expanded rows, keyed by row id. UI-only: `toQuery` leaves it out. */
|
|
18
|
-
expanded: ExpandedState;
|
|
19
|
-
}
|
|
20
|
-
declare const DEFAULT_PAGE_SIZE = 25;
|
|
21
|
-
declare const defaultDataGridState: DataGridState;
|
|
22
|
-
/** Fills the keys a consumer left out, so the grid always sees a full state. */
|
|
23
|
-
declare function resolveDataGridState(state: Partial<DataGridState> | undefined): DataGridState;
|
|
24
|
-
type DataGridAlign = 'start' | 'center' | 'end';
|
|
25
|
-
/** A text filter: one string, matched however the server matches it. */
|
|
26
|
-
interface DataGridTextFilter {
|
|
27
|
-
type: 'text';
|
|
28
|
-
placeholder?: string;
|
|
29
|
-
}
|
|
30
|
-
/** A facet filter: a list of options, of which any number may be picked. */
|
|
31
|
-
interface DataGridSelectFilter {
|
|
32
|
-
type: 'select';
|
|
33
|
-
options: readonly {
|
|
34
|
-
value: string;
|
|
35
|
-
label?: string;
|
|
36
|
-
}[];
|
|
37
|
-
}
|
|
38
|
-
/** A date range: ISO `YYYY-MM-DD` bounds, either side optional. */
|
|
39
|
-
interface DataGridDateRangeFilter {
|
|
40
|
-
type: 'date-range';
|
|
41
|
-
}
|
|
42
|
-
type DataGridFilter = DataGridTextFilter | DataGridSelectFilter | DataGridDateRangeFilter;
|
|
43
|
-
interface DataGridDateRange {
|
|
44
|
-
from?: string;
|
|
45
|
-
to?: string;
|
|
46
|
-
}
|
|
47
|
-
/** The ZUI extras on a TanStack column definition. */
|
|
48
|
-
interface DataGridColumnExtras {
|
|
49
|
-
/** Double-click or Enter on a cell turns it into an input; see `onCellEdit`. */
|
|
50
|
-
enableInlineEdit?: boolean;
|
|
51
|
-
/** Horizontal alignment of the head and the cells; `end` for numbers. */
|
|
52
|
-
align?: DataGridAlign;
|
|
53
|
-
/** Initial width in px (TanStack `size`); the user can resize from there. */
|
|
54
|
-
width?: number;
|
|
55
|
-
/** Declares the column's filter popover. */
|
|
56
|
-
filter?: DataGridFilter;
|
|
57
|
-
}
|
|
58
|
-
type DataGridColumnDef<TData, TValue = unknown> = ColumnDef<TData, TValue> & DataGridColumnExtras;
|
|
59
|
-
/** The extras may also be declared on `meta` (the TanStack way of extending a column). */
|
|
60
|
-
interface DataGridColumnMeta extends DataGridColumnExtras {
|
|
61
|
-
}
|
|
62
|
-
interface DataGridCellEdit {
|
|
63
|
-
rowId: string;
|
|
64
|
-
columnId: string;
|
|
65
|
-
value: string;
|
|
66
|
-
}
|
|
67
|
-
interface DataGridBulkAction {
|
|
68
|
-
id: string;
|
|
69
|
-
label: string;
|
|
70
|
-
variant?: 'primary' | 'secondary' | 'destructive' | 'outline' | 'ghost';
|
|
71
|
-
onAction: (selectedIds: string[]) => void;
|
|
72
|
-
}
|
|
73
|
-
type DataGridDensity = 'compact' | 'comfortable';
|
|
74
|
-
|
|
75
|
-
export { type DataGridState as D, type DataGridDensity as a, type DataGridCellEdit as b, type DataGridBulkAction as c, DEFAULT_PAGE_SIZE as d, type DataGridAlign as e, type DataGridColumnDef as f, type DataGridColumnExtras as g, type DataGridColumnMeta as h, type DataGridDateRange as i, type DataGridDateRangeFilter as j, type DataGridFilter as k, type DataGridSelectFilter as l, type DataGridTextFilter as m, defaultDataGridState as n, resolveDataGridState as r };
|