@stealthscale/component-tables 0.1.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/LICENSE +21 -0
- package/README.md +520 -0
- package/dist/cyclonedx/bom.json +1 -0
- package/dist/index.d.ts +867 -0
- package/dist/index.js +6001 -0
- package/dist/recipe-DKCE3olL.js +488 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/theme.d.ts +11 -0
- package/dist/theme.js +16 -0
- package/package.json +91 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,867 @@
|
|
|
1
|
+
import "@stealthscale/component-actions";
|
|
2
|
+
import { Popover } from "@stealthscale/component-disclosure";
|
|
3
|
+
import { Sortable, Table } from "@stealthscale/component-collections";
|
|
4
|
+
import { Checkbox, NativeSelect, SearchInputProps } from "@stealthscale/component-forms";
|
|
5
|
+
import { Column, ColumnFiltersState, ColumnHelper, DisplayColumnDef, ExpandedState, GroupingState, PaginationState, ReactTable, RowData, SortingState, TableOptions } from "@tanstack/react-table";
|
|
6
|
+
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
7
|
+
import { Pagination } from "@stealthscale/component-navigation";
|
|
8
|
+
//#region src/data-table/features.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Describes the props a column's editor receives: its name, its state, the draft, and the calls
|
|
11
|
+
* that change, save or abandon the draft.
|
|
12
|
+
*/
|
|
13
|
+
interface EditorProps {
|
|
14
|
+
/**
|
|
15
|
+
* Id of the reason a value was refused, which the control's description points at, or
|
|
16
|
+
* undefined while no value is refused.
|
|
17
|
+
*/
|
|
18
|
+
readonly "aria-describedby": string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the table refused the last value saved.
|
|
21
|
+
*/
|
|
22
|
+
readonly "aria-invalid": boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Accessible name of the control, which names the column.
|
|
25
|
+
*/
|
|
26
|
+
readonly "aria-label": string;
|
|
27
|
+
/**
|
|
28
|
+
* Abandons the edit: the draft is dropped and focus returns to the cell.
|
|
29
|
+
*/
|
|
30
|
+
readonly cancel: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Saves the draft, or the value passed, through the column's check and the table's
|
|
33
|
+
* `onCellEdit`. A control that knows its value when a person picks it passes the value.
|
|
34
|
+
*/
|
|
35
|
+
readonly commit: (next?: string) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Id of the control, which takes focus when the editor opens.
|
|
38
|
+
*/
|
|
39
|
+
readonly id: string;
|
|
40
|
+
/**
|
|
41
|
+
* Replaces the draft.
|
|
42
|
+
*/
|
|
43
|
+
readonly setValue: (next: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Size of the table, which the control takes so its text matches the cells'.
|
|
46
|
+
*/
|
|
47
|
+
readonly size: "lg" | "md" | "sm";
|
|
48
|
+
/**
|
|
49
|
+
* The draft.
|
|
50
|
+
*/
|
|
51
|
+
readonly value: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Describes how a grid edits a column's cells: the control and the check of a value.
|
|
55
|
+
*/
|
|
56
|
+
interface CellEdit {
|
|
57
|
+
/**
|
|
58
|
+
* Renders the control that edits a cell. A text field at the table's size unless stated.
|
|
59
|
+
*/
|
|
60
|
+
readonly editor?: ((props: EditorProps) => ReactNode) | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Returns why a value cannot be saved, from its text and the row's record, or undefined for a
|
|
63
|
+
* value that can.
|
|
64
|
+
*/
|
|
65
|
+
readonly validate?: ((text: string, record: RowData) => string | undefined) | undefined;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Describes what a column states about its cells beyond TanStack's column definition.
|
|
69
|
+
*/
|
|
70
|
+
interface ColumnMeta {
|
|
71
|
+
/**
|
|
72
|
+
* Returns the content of the detail row rendered under an expanded row, from the row's record.
|
|
73
|
+
* `DataTable.expandColumn` sets it.
|
|
74
|
+
*/
|
|
75
|
+
readonly detail?: ((record: RowData) => ReactNode) | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* How a grid edits the column's cells. A column without it is read-only.
|
|
78
|
+
*/
|
|
79
|
+
readonly edit?: CellEdit | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Filter `DataTable.ColumnFilter` offers for the column: a text the values contain, a choice of
|
|
82
|
+
* the column's values, or a range of figures.
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* `text` writes a string, which TanStack's `includesString` reads, the function it picks for a
|
|
86
|
+
* column of strings. `range` writes a minimum and a maximum, which `inNumberRange` reads, the
|
|
87
|
+
* function it picks for a column of numbers. `select` writes the chosen values in an array, so
|
|
88
|
+
* the column states `filterFn: "arrHas"`.
|
|
89
|
+
*/
|
|
90
|
+
readonly filter?: "range" | "select" | "text" | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Whether the column is as narrow as its content while the table lays out its columns by their
|
|
93
|
+
* content, such as a column of checkboxes. The kit's select, expand and pin columns set it.
|
|
94
|
+
*/
|
|
95
|
+
readonly fit?: boolean | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Name of the column in words, which the sort announcement reads. The header when it is a
|
|
98
|
+
* string, and the column's id otherwise, unless stated.
|
|
99
|
+
*/
|
|
100
|
+
readonly label?: string | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Whether the column contains figures, aligned to the end in tabular figures.
|
|
103
|
+
*/
|
|
104
|
+
readonly numeric?: boolean | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Whether the column's cells render as row headers, the `th` a screen reader names each row by.
|
|
107
|
+
*/
|
|
108
|
+
readonly rowHeader?: boolean | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Whether the column's cells select their rows. While the column is visible each row states
|
|
111
|
+
* `aria-selected`. `DataTable.selectColumn` sets it.
|
|
112
|
+
*/
|
|
113
|
+
readonly selects?: boolean | undefined;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Registers every stock feature, each row model, the stock functions and the column meta type.
|
|
117
|
+
*/
|
|
118
|
+
declare const FEATURES: {
|
|
119
|
+
cellSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
120
|
+
cellSpanningFeature: import("@tanstack/react-table").TableFeature;
|
|
121
|
+
columnFacetingFeature: import("@tanstack/react-table").TableFeature;
|
|
122
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
123
|
+
columnGroupingFeature: import("@tanstack/react-table").TableFeature;
|
|
124
|
+
columnOrderingFeature: import("@tanstack/react-table").TableFeature;
|
|
125
|
+
columnPinningFeature: import("@tanstack/react-table").TableFeature;
|
|
126
|
+
columnResizingFeature: import("@tanstack/react-table").TableFeature;
|
|
127
|
+
columnSizingFeature: import("@tanstack/react-table").TableFeature;
|
|
128
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
129
|
+
globalFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
130
|
+
rowAggregationFeature: import("@tanstack/react-table").TableFeature;
|
|
131
|
+
rowExpandingFeature: import("@tanstack/react-table").TableFeature;
|
|
132
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
133
|
+
rowPinningFeature: import("@tanstack/react-table").TableFeature;
|
|
134
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
135
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
136
|
+
aggregationFns: {
|
|
137
|
+
count: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
|
|
138
|
+
extent: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, [(number | Date) | undefined, (number | Date) | undefined]>;
|
|
139
|
+
first: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown>;
|
|
140
|
+
last: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown>;
|
|
141
|
+
max: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
|
|
142
|
+
mean: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number | undefined>;
|
|
143
|
+
median: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number | undefined>;
|
|
144
|
+
min: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
|
|
145
|
+
sum: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
|
|
146
|
+
unique: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, unknown[]>;
|
|
147
|
+
uniqueCount: import("@tanstack/react-table").AggregationFnDef<any, any, unknown, number>;
|
|
148
|
+
};
|
|
149
|
+
columnMeta: ColumnMeta;
|
|
150
|
+
expandedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
151
|
+
facetedMinMaxValues: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => undefined | [number, number];
|
|
152
|
+
facetedRowModel: (table: import("@tanstack/react-table").Table<any, any>, columnId: string) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
153
|
+
facetedUniqueValues: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => Map<any, number>;
|
|
154
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
155
|
+
filterFns: {
|
|
156
|
+
arrHas: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
157
|
+
arrIncludes: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
158
|
+
arrIncludesAll: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
159
|
+
arrIncludesSome: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
160
|
+
between: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
161
|
+
betweenInclusive: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
162
|
+
empty: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
163
|
+
endsWith: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
164
|
+
equals: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
165
|
+
equalsString: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
166
|
+
equalsStringSensitive: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
167
|
+
greaterThan: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
168
|
+
greaterThanOrEqualTo: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
169
|
+
includesString: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
170
|
+
includesStringSensitive: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
171
|
+
inDateRange: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
172
|
+
inNumberRange: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
173
|
+
lessThan: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
174
|
+
lessThanOrEqualTo: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
175
|
+
notEmpty: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
176
|
+
startsWith: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
177
|
+
weakEquals: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
178
|
+
};
|
|
179
|
+
groupedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
180
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
181
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
182
|
+
sortFns: {
|
|
183
|
+
alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
184
|
+
alphanumericCaseSensitive: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
185
|
+
basic: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
186
|
+
datetime: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
187
|
+
text: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
188
|
+
textCaseSensitive: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Describes the features every data table registers.
|
|
193
|
+
*/
|
|
194
|
+
type Features = typeof FEATURES;
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/data-table/use-data-table.d.ts
|
|
197
|
+
/**
|
|
198
|
+
* Describes the options of a data table: TanStack's table options without `features`, which the
|
|
199
|
+
* kit states.
|
|
200
|
+
*
|
|
201
|
+
* @typeParam Row - Type of one record.
|
|
202
|
+
*/
|
|
203
|
+
type DataTableOptions<Row extends RowData> = Omit<TableOptions<Features, Row>, "features">;
|
|
204
|
+
/**
|
|
205
|
+
* Describes the table `useDataTable` returns, which `DataTable.Root` takes.
|
|
206
|
+
*
|
|
207
|
+
* @typeParam Row - Type of one record.
|
|
208
|
+
*/
|
|
209
|
+
type DataTableApi<Row extends RowData = RowData> = ReactTable<Features, Row>;
|
|
210
|
+
/**
|
|
211
|
+
* Creates a data table and renders the calling component again on every change of its state.
|
|
212
|
+
*
|
|
213
|
+
* @typeParam Row - Type of one record.
|
|
214
|
+
* @param options - TanStack's table options without `features`. A stated option applies over the
|
|
215
|
+
* kit's default.
|
|
216
|
+
* @returns The table, a new object after each change.
|
|
217
|
+
*/
|
|
218
|
+
declare function useDataTable<Row extends RowData>(options: DataTableOptions<Row>): DataTableApi<Row>;
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/data-table/columns.d.ts
|
|
221
|
+
/**
|
|
222
|
+
* Describes a column of a data table, which a column's actions receive.
|
|
223
|
+
*/
|
|
224
|
+
type TableColumn = Column<Features, RowData>;
|
|
225
|
+
/**
|
|
226
|
+
* Describes the function that returns the controls a column's header renders beside its name, such
|
|
227
|
+
* as `DataTable.ColumnMenu`, from the column.
|
|
228
|
+
*/
|
|
229
|
+
type ColumnActions = (column: TableColumn) => ReactNode;
|
|
230
|
+
/**
|
|
231
|
+
* Describes a sort direction in the words `aria-sort` takes.
|
|
232
|
+
*/
|
|
233
|
+
type Direction = "ascending" | "descending";
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/data-table/column-filter.d.ts
|
|
236
|
+
/**
|
|
237
|
+
* Describes the props of a column's filter: the column, the glyphs and the words.
|
|
238
|
+
*/
|
|
239
|
+
interface ColumnFilterProps {
|
|
240
|
+
/**
|
|
241
|
+
* Glyph inside a checked box of a `select` filter, such as a check mark.
|
|
242
|
+
*/
|
|
243
|
+
readonly checkIndicator?: ReactNode | undefined;
|
|
244
|
+
/**
|
|
245
|
+
* Words of the button that clears the filter. "Clear" unless stated.
|
|
246
|
+
*/
|
|
247
|
+
readonly clearLabel?: string | undefined;
|
|
248
|
+
/**
|
|
249
|
+
* Column the filter acts on, which `DataTable.Table`'s `columnActions` receives.
|
|
250
|
+
*/
|
|
251
|
+
readonly column: TableColumn;
|
|
252
|
+
/**
|
|
253
|
+
* Glyph inside the button, such as a funnel.
|
|
254
|
+
*/
|
|
255
|
+
readonly indicator: ReactNode;
|
|
256
|
+
/**
|
|
257
|
+
* Returns the accessible name of the button from the column's name and whether the column
|
|
258
|
+
* filters, and the panel's title while `active` is false. "Filter Amount" and "Filter Amount,
|
|
259
|
+
* active" unless stated.
|
|
260
|
+
*/
|
|
261
|
+
readonly label?: ((column: string, active: boolean) => string) | undefined;
|
|
262
|
+
/**
|
|
263
|
+
* Label of a `range` filter's field for the maximum. "Maximum" unless stated.
|
|
264
|
+
*/
|
|
265
|
+
readonly maxLabel?: string | undefined;
|
|
266
|
+
/**
|
|
267
|
+
* Label of a `range` filter's field for the minimum. "Minimum" unless stated.
|
|
268
|
+
*/
|
|
269
|
+
readonly minLabel?: string | undefined;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Renders the column's filter, or nothing for a column without one.
|
|
273
|
+
*
|
|
274
|
+
* @param props - The column, the glyphs and the words.
|
|
275
|
+
* @returns The popover's root, or `null`.
|
|
276
|
+
*/
|
|
277
|
+
declare function ColumnFilter({ checkIndicator, clearLabel, column, indicator, label, maxLabel, minLabel }: ColumnFilterProps): null | ReactElement;
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/data-table/column-helper.d.ts
|
|
280
|
+
/**
|
|
281
|
+
* Creates a column helper typed with the kit's features.
|
|
282
|
+
*
|
|
283
|
+
* @typeParam Row - Type of one record.
|
|
284
|
+
* @returns TanStack's helper: `accessor`, `display`, `group` and `columns`.
|
|
285
|
+
*/
|
|
286
|
+
declare function createColumnHelper$1<Row extends RowData>(): ColumnHelper<Features, Row>;
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/data-table/column-manager.d.ts
|
|
289
|
+
/**
|
|
290
|
+
* Describes the props of the column manager: the glyphs, the words and the sortable kit's words.
|
|
291
|
+
*/
|
|
292
|
+
interface ColumnManagerProps extends Sortable.SortableWords {
|
|
293
|
+
/**
|
|
294
|
+
* Glyph inside a checked box, such as a check mark.
|
|
295
|
+
*/
|
|
296
|
+
readonly checkIndicator?: ReactNode | undefined;
|
|
297
|
+
/**
|
|
298
|
+
* Glyph inside each row's handle, such as a grip.
|
|
299
|
+
*/
|
|
300
|
+
readonly handleIndicator?: ReactNode | undefined;
|
|
301
|
+
/**
|
|
302
|
+
* Accessible name of the list. "Columns" unless stated.
|
|
303
|
+
*/
|
|
304
|
+
readonly label?: string | undefined;
|
|
305
|
+
/**
|
|
306
|
+
* Words of the button that restores the order and the visibility. "Reset" unless stated.
|
|
307
|
+
*/
|
|
308
|
+
readonly resetLabel?: string | undefined;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Renders the column manager.
|
|
312
|
+
*
|
|
313
|
+
* @param props - The glyphs, the words and the sortable kit's words.
|
|
314
|
+
* @returns The `div` around the list and the reset button.
|
|
315
|
+
*/
|
|
316
|
+
declare function ColumnManager({ checkIndicator, handleIndicator, label, resetLabel, ...words }: ColumnManagerProps): ReactElement;
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/data-table/column-menu.d.ts
|
|
319
|
+
/**
|
|
320
|
+
* Describes an action a column's menu lists.
|
|
321
|
+
*/
|
|
322
|
+
type ColumnMenuAction = "ascending" | "descending" | "end" | "grouped" | "hide" | "start" | "ungrouped" | "unpinned" | "unsorted";
|
|
323
|
+
/**
|
|
324
|
+
* Describes the glyph each action's row leads with, by the action.
|
|
325
|
+
*/
|
|
326
|
+
type ColumnMenuIndicators = Readonly<Partial<Record<ColumnMenuAction, ReactNode>>>;
|
|
327
|
+
/**
|
|
328
|
+
* Describes the props of a column's menu: the column, the button's glyph and name, and the glyph
|
|
329
|
+
* and the words of each action.
|
|
330
|
+
*/
|
|
331
|
+
interface ColumnMenuProps {
|
|
332
|
+
/**
|
|
333
|
+
* Glyph each action's row leads with, such as an arrow for a sort. A row without one starts with
|
|
334
|
+
* its words.
|
|
335
|
+
*/
|
|
336
|
+
readonly actionIndicators?: ColumnMenuIndicators | undefined;
|
|
337
|
+
/**
|
|
338
|
+
* Words of the action that sorts the column ascending. "Sort ascending" unless stated.
|
|
339
|
+
*/
|
|
340
|
+
readonly ascendingLabel?: string | undefined;
|
|
341
|
+
/**
|
|
342
|
+
* Column the menu acts on, which `DataTable.Table`'s `columnActions` receives.
|
|
343
|
+
*/
|
|
344
|
+
readonly column: TableColumn;
|
|
345
|
+
/**
|
|
346
|
+
* Words of the action that sorts the column descending. "Sort descending" unless stated.
|
|
347
|
+
*/
|
|
348
|
+
readonly descendingLabel?: string | undefined;
|
|
349
|
+
/**
|
|
350
|
+
* Words of the action that pins the column to the end. "Pin to end" unless stated.
|
|
351
|
+
*/
|
|
352
|
+
readonly endLabel?: string | undefined;
|
|
353
|
+
/**
|
|
354
|
+
* Words of the action that groups the rows by the column. "Group by column" unless stated.
|
|
355
|
+
*/
|
|
356
|
+
readonly groupedLabel?: string | undefined;
|
|
357
|
+
/**
|
|
358
|
+
* Words of the action that hides the column. "Hide column" unless stated.
|
|
359
|
+
*/
|
|
360
|
+
readonly hideLabel?: string | undefined;
|
|
361
|
+
/**
|
|
362
|
+
* Glyph inside the button, such as three dots.
|
|
363
|
+
*/
|
|
364
|
+
readonly indicator: ReactNode;
|
|
365
|
+
/**
|
|
366
|
+
* Returns the accessible name of the button from the column's name. "Options for Amount" unless
|
|
367
|
+
* stated.
|
|
368
|
+
*/
|
|
369
|
+
readonly label?: ((column: string) => string) | undefined;
|
|
370
|
+
/**
|
|
371
|
+
* Words of the action that pins the column to the start. "Pin to start" unless stated.
|
|
372
|
+
*/
|
|
373
|
+
readonly startLabel?: string | undefined;
|
|
374
|
+
/**
|
|
375
|
+
* Words of the action that stops grouping the rows by the column. "Ungroup" unless stated.
|
|
376
|
+
*/
|
|
377
|
+
readonly ungroupedLabel?: string | undefined;
|
|
378
|
+
/**
|
|
379
|
+
* Words of the action that unpins the column. "Unpin" unless stated.
|
|
380
|
+
*/
|
|
381
|
+
readonly unpinnedLabel?: string | undefined;
|
|
382
|
+
/**
|
|
383
|
+
* Words of the action that clears the column's sort. "Clear sort" unless stated.
|
|
384
|
+
*/
|
|
385
|
+
readonly unsortedLabel?: string | undefined;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Renders the column's menu, or nothing for a column without an action that changes it.
|
|
389
|
+
*
|
|
390
|
+
* @param props - The column, the button's glyph and name, and the glyph and the words of each
|
|
391
|
+
* action.
|
|
392
|
+
* @returns The menu's root, or `null`.
|
|
393
|
+
*/
|
|
394
|
+
declare function ColumnMenu(props: ColumnMenuProps): null | ReactElement;
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/data-table/cross-tab.d.ts
|
|
397
|
+
/**
|
|
398
|
+
* Computes a pivot's cross-tab from flat records: a cell for each row path and column value, a
|
|
399
|
+
* total for each row and each column value, and the grand total.
|
|
400
|
+
*
|
|
401
|
+
* @remarks
|
|
402
|
+
* Every total is aggregated from the records, never from the cells. With `sum` the two agree, and
|
|
403
|
+
* with `average` they do not: a row of one record of 10 and ninety-nine of 90 in two cells has
|
|
404
|
+
* cell averages of 10 and 90, whose mean is 50, while its records average 89.2. `min` and `max`
|
|
405
|
+
* differ the same way. A cell no record falls into is `null` with a count of zero, never `0`,
|
|
406
|
+
* because no records and records that sum to zero are different facts. The rows follow the
|
|
407
|
+
* first-seen order of each dimension, level by level, so the rows of an outer group are
|
|
408
|
+
* adjacent. The column values follow their first-seen order.
|
|
409
|
+
*/
|
|
410
|
+
/**
|
|
411
|
+
* Describes a built-in aggregate: the sum, the mean, the least or the greatest of a cell's
|
|
412
|
+
* figures, or the number of its records.
|
|
413
|
+
*/
|
|
414
|
+
type PivotAggregate = "average" | "count" | "max" | "min" | "sum";
|
|
415
|
+
/**
|
|
416
|
+
* Describes a function that returns one figure from a cell's records, or `null` for nothing to
|
|
417
|
+
* measure.
|
|
418
|
+
*
|
|
419
|
+
* @typeParam Row - Type of one record.
|
|
420
|
+
*/
|
|
421
|
+
type PivotAggregator<Row> = (records: readonly Row[]) => null | number;
|
|
422
|
+
/**
|
|
423
|
+
* Describes a field of a record that a pivot reads.
|
|
424
|
+
*
|
|
425
|
+
* @typeParam Row - Type of one record.
|
|
426
|
+
*/
|
|
427
|
+
type PivotField<Row> = Extract<keyof Row, string>;
|
|
428
|
+
/**
|
|
429
|
+
* Describes one cell of a cross-tab: its figure and the number of records it aggregates.
|
|
430
|
+
*/
|
|
431
|
+
interface PivotCell {
|
|
432
|
+
/**
|
|
433
|
+
* Number of records that fall into the cell, zero for a cell no record falls into.
|
|
434
|
+
*/
|
|
435
|
+
readonly count: number;
|
|
436
|
+
/**
|
|
437
|
+
* Figure the aggregate returns, or `null` for a cell with nothing to measure.
|
|
438
|
+
*/
|
|
439
|
+
readonly value: null | number;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Describes one value of the column dimension: the value and the total of its records.
|
|
443
|
+
*/
|
|
444
|
+
interface PivotColumn {
|
|
445
|
+
/**
|
|
446
|
+
* Cell aggregated from every record with the value.
|
|
447
|
+
*/
|
|
448
|
+
readonly total: PivotCell;
|
|
449
|
+
/**
|
|
450
|
+
* Value of the column dimension, as text.
|
|
451
|
+
*/
|
|
452
|
+
readonly value: string;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Describes one row of a cross-tab: its path through the row dimensions, a cell per column value
|
|
456
|
+
* and its total.
|
|
457
|
+
*/
|
|
458
|
+
interface PivotRow {
|
|
459
|
+
/**
|
|
460
|
+
* Cells in the order of the cross-tab's columns.
|
|
461
|
+
*/
|
|
462
|
+
readonly cells: readonly PivotCell[];
|
|
463
|
+
/**
|
|
464
|
+
* Value of each row dimension as text, the outermost first.
|
|
465
|
+
*/
|
|
466
|
+
readonly path: readonly string[];
|
|
467
|
+
/**
|
|
468
|
+
* Cell aggregated from every record of the row.
|
|
469
|
+
*/
|
|
470
|
+
readonly total: PivotCell;
|
|
471
|
+
}
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region src/data-table/expand-column.d.ts
|
|
474
|
+
/**
|
|
475
|
+
* Describes the options of the expand column: the detail, the names and the glyph.
|
|
476
|
+
*
|
|
477
|
+
* @typeParam Row - Type of one record.
|
|
478
|
+
*/
|
|
479
|
+
interface ExpandColumnOptions<Row extends RowData> {
|
|
480
|
+
/**
|
|
481
|
+
* Returns the content of the detail row from the record.
|
|
482
|
+
*/
|
|
483
|
+
readonly detail: (record: Row) => ReactNode;
|
|
484
|
+
/**
|
|
485
|
+
* Name of the column, which only assistive technology reads. "Details" unless stated.
|
|
486
|
+
*/
|
|
487
|
+
readonly header?: string | undefined;
|
|
488
|
+
/**
|
|
489
|
+
* Glyph inside each button, pointing to the inline end, such as a chevron.
|
|
490
|
+
*/
|
|
491
|
+
readonly indicator?: ReactNode | undefined;
|
|
492
|
+
/**
|
|
493
|
+
* Returns the accessible name of a row's button from its record, such as "Details of Halden
|
|
494
|
+
* Freight".
|
|
495
|
+
*/
|
|
496
|
+
readonly label: (record: Row) => string;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Creates the expand column, with the id `expand`.
|
|
500
|
+
*
|
|
501
|
+
* @typeParam Row - Type of one record.
|
|
502
|
+
* @param options - The detail, the names and the glyph.
|
|
503
|
+
* @returns The column's definition.
|
|
504
|
+
*/
|
|
505
|
+
declare function expandColumn<Row extends RowData>(options: ExpandColumnOptions<Row>): DisplayColumnDef<Features, Row>;
|
|
506
|
+
//#endregion
|
|
507
|
+
//#region src/data-table/page-size.d.ts
|
|
508
|
+
/**
|
|
509
|
+
* Describes the props of the page size select: the sizes, the label, the glyph and the props of
|
|
510
|
+
* the native select's box.
|
|
511
|
+
*/
|
|
512
|
+
interface PageSizeProps extends Omit<NativeSelect.RootProps, "children"> {
|
|
513
|
+
/**
|
|
514
|
+
* Glyph at the select's end, such as a chevron.
|
|
515
|
+
*/
|
|
516
|
+
readonly indicator?: ReactNode | undefined;
|
|
517
|
+
/**
|
|
518
|
+
* Words of the label before the select, such as "Rows per page", for a select outside a `Field`.
|
|
519
|
+
*/
|
|
520
|
+
readonly label?: string | undefined;
|
|
521
|
+
/**
|
|
522
|
+
* Sizes a person chooses from, in the order the options list them.
|
|
523
|
+
*/
|
|
524
|
+
readonly sizes: readonly number[];
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Renders the select on the table's page size, after its label when one is given.
|
|
528
|
+
*
|
|
529
|
+
* @param props - The sizes, the label, the glyph and the props of the native select's box.
|
|
530
|
+
* @returns The row of the label and the select, or the native select's box alone.
|
|
531
|
+
*/
|
|
532
|
+
declare function PageSize({ indicator, label, sizes, ...props }: PageSizeProps): ReactElement;
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region src/data-table/pagination.d.ts
|
|
535
|
+
/**
|
|
536
|
+
* Describes the props of the pagination: the navigation pagination root's props without the
|
|
537
|
+
* count, the page and the page size, which the table's state supplies.
|
|
538
|
+
*/
|
|
539
|
+
type PaginationProps = Omit<Pagination.RootProps, "count" | "defaultPage" | "defaultPageSize" | "onPageChange" | "onPageSizeChange" | "page" | "pageSize">;
|
|
540
|
+
/**
|
|
541
|
+
* Renders the pagination on the table's page state, which the kit exports as
|
|
542
|
+
* `DataTable.Pagination`.
|
|
543
|
+
*
|
|
544
|
+
* @param props - The navigation pagination root's props, its triggers, pages and page text
|
|
545
|
+
* included.
|
|
546
|
+
* @returns The `nav` element.
|
|
547
|
+
*/
|
|
548
|
+
declare function TablePagination(props: PaginationProps): ReactElement;
|
|
549
|
+
//#endregion
|
|
550
|
+
//#region src/data-table/pin-column.d.ts
|
|
551
|
+
/**
|
|
552
|
+
* Describes the options of the pin column: the region, the names and the glyph.
|
|
553
|
+
*
|
|
554
|
+
* @typeParam Row - Type of one record.
|
|
555
|
+
*/
|
|
556
|
+
interface PinColumnOptions<Row extends RowData> {
|
|
557
|
+
/**
|
|
558
|
+
* Name of the column, which only assistive technology reads. "Pin" unless stated.
|
|
559
|
+
*/
|
|
560
|
+
readonly header?: string | undefined;
|
|
561
|
+
/**
|
|
562
|
+
* Glyph inside each toggle, such as a pin.
|
|
563
|
+
*/
|
|
564
|
+
readonly indicator?: ReactNode | undefined;
|
|
565
|
+
/**
|
|
566
|
+
* Returns the accessible name of a row's toggle from its record, such as "Pin Halden Freight".
|
|
567
|
+
*/
|
|
568
|
+
readonly label: (record: Row) => string;
|
|
569
|
+
/**
|
|
570
|
+
* Region a press pins a row to. `top` unless stated.
|
|
571
|
+
*/
|
|
572
|
+
readonly position?: "bottom" | "top" | undefined;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Creates the pin column, with the id `pin`.
|
|
576
|
+
*
|
|
577
|
+
* @typeParam Row - Type of one record.
|
|
578
|
+
* @param options - The region, the names and the glyph.
|
|
579
|
+
* @returns The column's definition.
|
|
580
|
+
*/
|
|
581
|
+
declare function pinColumn<Row extends RowData>(options: PinColumnOptions<Row>): DisplayColumnDef<Features, Row>;
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region src/data-table/pivot.d.ts
|
|
584
|
+
/**
|
|
585
|
+
* Describes the options of a pivot: its dimensions, the measured field, the aggregate and the words
|
|
586
|
+
* of its headers and cells.
|
|
587
|
+
*
|
|
588
|
+
* @typeParam Row - Type of one record.
|
|
589
|
+
*/
|
|
590
|
+
interface PivotOptions<Row> {
|
|
591
|
+
/**
|
|
592
|
+
* Aggregate of each cell's records: `sum` unless stated, `average`, `min`, `max`, `count`, or a
|
|
593
|
+
* function of the records.
|
|
594
|
+
*/
|
|
595
|
+
readonly aggregate?: PivotAggregate | PivotAggregator<Row> | undefined;
|
|
596
|
+
/**
|
|
597
|
+
* Field whose values become the columns, in the order they first appear.
|
|
598
|
+
*/
|
|
599
|
+
readonly column: PivotField<Row>;
|
|
600
|
+
/**
|
|
601
|
+
* Options of `Intl.NumberFormat` every figure is written with, such as a currency.
|
|
602
|
+
*/
|
|
603
|
+
readonly format?: Intl.NumberFormatOptions | undefined;
|
|
604
|
+
/**
|
|
605
|
+
* Header of each row dimension's column, by field. The field unless stated.
|
|
606
|
+
*/
|
|
607
|
+
readonly headers?: Readonly<Partial<Record<PivotField<Row>, string>>> | undefined;
|
|
608
|
+
/**
|
|
609
|
+
* Words that only assistive technology reads in a cell with nothing to measure. "No value"
|
|
610
|
+
* unless stated.
|
|
611
|
+
*/
|
|
612
|
+
readonly missingLabel?: string | undefined;
|
|
613
|
+
/**
|
|
614
|
+
* Fields whose values become the rows, the outermost first.
|
|
615
|
+
*/
|
|
616
|
+
readonly rows: ReadonlyArray<PivotField<Row>>;
|
|
617
|
+
/**
|
|
618
|
+
* Header of the totals column and name of the footer row. "Total" unless stated.
|
|
619
|
+
*/
|
|
620
|
+
readonly totalLabel?: string | undefined;
|
|
621
|
+
/**
|
|
622
|
+
* Whether the table renders the totals column and the footer row. `true` unless stated.
|
|
623
|
+
*/
|
|
624
|
+
readonly totals?: boolean | undefined;
|
|
625
|
+
/**
|
|
626
|
+
* Field the built-in aggregates measure. `count` reads none.
|
|
627
|
+
*/
|
|
628
|
+
readonly value?: PivotField<Row> | undefined;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Describes what `pivot` returns: the columns, the rows and the row ids `useDataTable` takes.
|
|
632
|
+
*/
|
|
633
|
+
type Pivot = Required<Pick<DataTableOptions<PivotRow>, "columns" | "data" | "getRowId">>;
|
|
634
|
+
/**
|
|
635
|
+
* Returns the columns, rows and row ids of a pivot table of records, for `useDataTable`.
|
|
636
|
+
*
|
|
637
|
+
* @typeParam Row - Type of one record.
|
|
638
|
+
* @param records - The records to aggregate, filtered and translated by the caller.
|
|
639
|
+
* @param options - The dimensions, the measured field, the aggregate and the words.
|
|
640
|
+
* @returns The options that render the cross-tab.
|
|
641
|
+
*/
|
|
642
|
+
declare function pivot<Row>(records: readonly Row[], options: PivotOptions<NoInfer<Row>>): Pivot;
|
|
643
|
+
//#endregion
|
|
644
|
+
//#region src/data-table/root.d.ts
|
|
645
|
+
/**
|
|
646
|
+
* Renders the `div` with the recipe's root class.
|
|
647
|
+
*/
|
|
648
|
+
declare const Column$1: import("@stealthscale/theme").StyledComponent<"div", {}>;
|
|
649
|
+
/**
|
|
650
|
+
* Describes the props of the root: the table and the props of a `div`.
|
|
651
|
+
*
|
|
652
|
+
* @typeParam Row - Type of one record.
|
|
653
|
+
*/
|
|
654
|
+
interface RootProps<Row extends RowData> extends ComponentProps<typeof Column$1> {
|
|
655
|
+
/**
|
|
656
|
+
* Table `useDataTable` returns, which every part reads.
|
|
657
|
+
*/
|
|
658
|
+
readonly table: DataTableApi<Row>;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Renders the column inside the table's provider.
|
|
662
|
+
*
|
|
663
|
+
* @typeParam Row - Type of one record.
|
|
664
|
+
* @param props - The table and the props of a `div`.
|
|
665
|
+
* @returns The `div` element inside the provider.
|
|
666
|
+
*/
|
|
667
|
+
declare function Root<Row extends RowData>({ table, ...props }: RootProps<Row>): ReactElement;
|
|
668
|
+
//#endregion
|
|
669
|
+
//#region src/data-table/search.d.ts
|
|
670
|
+
/**
|
|
671
|
+
* Describes the props of the search field: the search input's props without its value, which the
|
|
672
|
+
* table's global filter supplies.
|
|
673
|
+
*/
|
|
674
|
+
type SearchProps = Omit<SearchInputProps, "defaultValue" | "onValueChange" | "value">;
|
|
675
|
+
/**
|
|
676
|
+
* Renders the search field.
|
|
677
|
+
*
|
|
678
|
+
* @param props - The search input's props, its name included.
|
|
679
|
+
* @returns The `div` around the search input.
|
|
680
|
+
*/
|
|
681
|
+
declare function Search(props: SearchProps): ReactElement;
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region src/data-table/select-column.d.ts
|
|
684
|
+
/**
|
|
685
|
+
* Describes the options of the select column: the names of its boxes and their glyphs.
|
|
686
|
+
*
|
|
687
|
+
* @typeParam Row - Type of one record.
|
|
688
|
+
*/
|
|
689
|
+
interface SelectColumnOptions<Row extends RowData> {
|
|
690
|
+
/**
|
|
691
|
+
* Accessible name of the header's box, which selects every row.
|
|
692
|
+
*/
|
|
693
|
+
readonly allLabel: string;
|
|
694
|
+
/**
|
|
695
|
+
* Glyph inside a box while some of the rows it selects are selected, such as a dash: the header's
|
|
696
|
+
* box, and a row's box while some rows under the row are.
|
|
697
|
+
*/
|
|
698
|
+
readonly indeterminateIndicator?: ReactNode | undefined;
|
|
699
|
+
/**
|
|
700
|
+
* Glyph inside a checked box, such as a check mark.
|
|
701
|
+
*/
|
|
702
|
+
readonly indicator?: ReactNode | undefined;
|
|
703
|
+
/**
|
|
704
|
+
* Returns the accessible name of a row's box from its record, such as "Select Halden Freight".
|
|
705
|
+
*/
|
|
706
|
+
readonly label: (record: Row) => string;
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Creates the select column, with the id `select`.
|
|
710
|
+
*
|
|
711
|
+
* @typeParam Row - Type of one record.
|
|
712
|
+
* @param options - The names of the boxes and their glyphs.
|
|
713
|
+
* @returns The column's definition.
|
|
714
|
+
*/
|
|
715
|
+
declare function selectColumn<Row extends RowData>(options: SelectColumnOptions<Row>): DisplayColumnDef<Features, Row>;
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/data-table/bound.d.ts
|
|
718
|
+
/**
|
|
719
|
+
* Describes the props of the collections table's scroller, which the frame takes.
|
|
720
|
+
*/
|
|
721
|
+
type ScrollerProps = Table.ScrollerProps;
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region src/data-table/use-grid.d.ts
|
|
724
|
+
/**
|
|
725
|
+
* Describes an edit a grid saves: the cell's column and row, the row's record and the text.
|
|
726
|
+
*/
|
|
727
|
+
interface CellEditEvent {
|
|
728
|
+
/**
|
|
729
|
+
* Id of the cell's column.
|
|
730
|
+
*/
|
|
731
|
+
readonly columnId: string;
|
|
732
|
+
/**
|
|
733
|
+
* Record of the cell's row.
|
|
734
|
+
*/
|
|
735
|
+
readonly record: unknown;
|
|
736
|
+
/**
|
|
737
|
+
* Id of the cell's row.
|
|
738
|
+
*/
|
|
739
|
+
readonly rowId: string;
|
|
740
|
+
/**
|
|
741
|
+
* Text saved.
|
|
742
|
+
*/
|
|
743
|
+
readonly value: string;
|
|
744
|
+
}
|
|
745
|
+
//#endregion
|
|
746
|
+
//#region src/data-table/table.d.ts
|
|
747
|
+
/**
|
|
748
|
+
* Describes the props of the table: its caption, its empty row, the glyphs of the sort and the
|
|
749
|
+
* toggles, the words of the announcements, the separators and the toggles, the window, whether it
|
|
750
|
+
* is a grid, and the scroller's props with the collections table's axes.
|
|
751
|
+
*/
|
|
752
|
+
interface TableProps extends Omit<ScrollerProps, "children" | "grid" | "viewportRef"> {
|
|
753
|
+
/**
|
|
754
|
+
* Caption rendered under the table, and the accessible name of the table and its scroll region.
|
|
755
|
+
*/
|
|
756
|
+
readonly caption?: ReactNode | undefined;
|
|
757
|
+
/**
|
|
758
|
+
* Accessible name of the toggle of an open row in a table with levels. "Collapse" unless stated.
|
|
759
|
+
*/
|
|
760
|
+
readonly collapseLabel?: string | undefined;
|
|
761
|
+
/**
|
|
762
|
+
* Returns the controls a column's header renders beside its name from the column, such as
|
|
763
|
+
* `DataTable.ColumnFilter` and `DataTable.ColumnMenu`.
|
|
764
|
+
*/
|
|
765
|
+
readonly columnActions?: ColumnActions | undefined;
|
|
766
|
+
/**
|
|
767
|
+
* Returns the accessible name of a grid cell's editor from its column's name. "Edit Amount"
|
|
768
|
+
* unless stated.
|
|
769
|
+
*/
|
|
770
|
+
readonly editLabel?: ((column: string) => string) | undefined;
|
|
771
|
+
/**
|
|
772
|
+
* Content of the full-width row rendered while the table has no rows. "No rows" unless stated.
|
|
773
|
+
*/
|
|
774
|
+
readonly empty?: ReactNode | undefined;
|
|
775
|
+
/**
|
|
776
|
+
* Height in pixels a windowed table takes for a body row before it measures the first one, whose
|
|
777
|
+
* height it takes after. 40 unless stated.
|
|
778
|
+
*/
|
|
779
|
+
readonly estimateSize?: number | undefined;
|
|
780
|
+
/**
|
|
781
|
+
* Glyph inside each toggle of a table with levels, pointing to the inline end, such as a
|
|
782
|
+
* chevron. The recipe turns it a quarter while its row is open.
|
|
783
|
+
*/
|
|
784
|
+
readonly expandIndicator?: ReactNode | undefined;
|
|
785
|
+
/**
|
|
786
|
+
* Accessible name of the toggle of a closed row in a table with levels. "Expand" unless stated.
|
|
787
|
+
*/
|
|
788
|
+
readonly expandLabel?: string | undefined;
|
|
789
|
+
/**
|
|
790
|
+
* Returns the announcement of the rows that match the filters, from their count and the count of
|
|
791
|
+
* every row. "12 of 40 rows" unless stated.
|
|
792
|
+
*/
|
|
793
|
+
readonly filteredAnnouncement?: ((count: number, total: number) => string) | undefined;
|
|
794
|
+
/**
|
|
795
|
+
* Whether the table is a grid of cells a person selects, moves between with the arrow keys and
|
|
796
|
+
* copies, as in a spreadsheet. A table with levels remains a `treegrid`.
|
|
797
|
+
*/
|
|
798
|
+
readonly grid?: boolean | undefined;
|
|
799
|
+
/**
|
|
800
|
+
* Words of the row under an open row whose sub-rows have not arrived, in a table with levels.
|
|
801
|
+
* "Loading…" unless stated.
|
|
802
|
+
*/
|
|
803
|
+
readonly loadingLabel?: string | undefined;
|
|
804
|
+
/**
|
|
805
|
+
* Receives each edit a person saves in a grid cell of an editable column, whose text the caller
|
|
806
|
+
* writes into `data`.
|
|
807
|
+
*/
|
|
808
|
+
readonly onCellEdit?: ((edit: CellEditEvent) => void) | undefined;
|
|
809
|
+
/**
|
|
810
|
+
* Runs when a windowed table's last row comes within `overscan` rows of the viewport, once per
|
|
811
|
+
* number of rows, so a caller loads the next rows.
|
|
812
|
+
*/
|
|
813
|
+
readonly onEndReached?: (() => void) | undefined;
|
|
814
|
+
/**
|
|
815
|
+
* Number of rows a windowed table renders beyond each end of the viewport. 8 unless stated.
|
|
816
|
+
*/
|
|
817
|
+
readonly overscan?: number | undefined;
|
|
818
|
+
/**
|
|
819
|
+
* Returns the accessible name of a column's resize separator. "Resize Amount" unless stated.
|
|
820
|
+
*/
|
|
821
|
+
readonly resizeLabel?: ((column: string) => string) | undefined;
|
|
822
|
+
/**
|
|
823
|
+
* Returns a column's size in words. "150 pixels" unless stated.
|
|
824
|
+
*/
|
|
825
|
+
readonly resizeValue?: ((size: number) => string) | undefined;
|
|
826
|
+
/**
|
|
827
|
+
* Returns the announcement of a sort from the column's name and the direction. "Sorted by
|
|
828
|
+
* Amount, descending" unless stated.
|
|
829
|
+
*/
|
|
830
|
+
readonly sortedAnnouncement?: ((column: string, direction: Direction) => string) | undefined;
|
|
831
|
+
/**
|
|
832
|
+
* Glyph beside a sortable column's name, pointing up. The recipe turns it for a descending sort.
|
|
833
|
+
*/
|
|
834
|
+
readonly sortIndicator?: ReactNode | undefined;
|
|
835
|
+
/**
|
|
836
|
+
* Returns whether a grid cell has a change the caller has not saved, from its row's and its
|
|
837
|
+
* column's ids. The cell marks its inline start and states the change for assistive technology.
|
|
838
|
+
*/
|
|
839
|
+
readonly unsaved?: ((rowId: string, columnId: string) => boolean) | undefined;
|
|
840
|
+
/**
|
|
841
|
+
* Words of an unsaved change, which a cell with one renders for assistive technology. "Unsaved
|
|
842
|
+
* change" unless stated.
|
|
843
|
+
*/
|
|
844
|
+
readonly unsavedLabel?: string | undefined;
|
|
845
|
+
/**
|
|
846
|
+
* Announcement of a table sorted by no column. "Not sorted" unless stated.
|
|
847
|
+
*/
|
|
848
|
+
readonly unsortedAnnouncement?: string | undefined;
|
|
849
|
+
/**
|
|
850
|
+
* Whether the table renders only the body rows in or near the viewport, for thousands of rows.
|
|
851
|
+
* The caller gives the scroller a height, such as `style={{ maxBlockSize: "24rem" }}`.
|
|
852
|
+
*/
|
|
853
|
+
readonly windowed?: boolean | undefined;
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Renders the scroller with the table inside it.
|
|
857
|
+
*
|
|
858
|
+
* @param props - The caption, the empty row, the glyphs, the words, the window, whether the table
|
|
859
|
+
* is a grid, and the scroller's props.
|
|
860
|
+
* @returns The scroller element.
|
|
861
|
+
*/
|
|
862
|
+
declare function Table$1(props: TableProps): ReactElement;
|
|
863
|
+
declare namespace index_d_exports {
|
|
864
|
+
export { CellEdit, CellEditEvent, ColumnActions, ColumnFilter, ColumnFilterProps, ColumnFiltersState, ColumnManager, ColumnManagerProps, ColumnMenu, ColumnMenuAction, ColumnMenuIndicators, ColumnMenuProps, ColumnMeta, DataTableApi, DataTableOptions, EditorProps, ExpandColumnOptions, ExpandedState, GroupingState, PageSize, PageSizeProps, TablePagination as Pagination, PaginationProps, PaginationState, PinColumnOptions, Pivot, PivotAggregate, PivotAggregator, PivotCell, PivotColumn, PivotField, PivotOptions, PivotRow, Root, RootProps, Search, SearchProps, SelectColumnOptions, SortingState, Table$1 as Table, TableColumn, TableProps, createColumnHelper$1 as createColumnHelper, expandColumn, pinColumn, pivot, selectColumn, useDataTable };
|
|
865
|
+
}
|
|
866
|
+
//#endregion
|
|
867
|
+
export { index_d_exports as DataTable };
|