@bsol-oss/react-datatable5 12.0.0-beta.80 → 12.0.0-beta.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +387 -348
- package/dist/index.js +1286 -966
- package/dist/index.mjs +1289 -970
- package/dist/types/components/DataTable/display/Table.d.ts +2 -1
- package/dist/types/components/DataTable/hooks/useResponsiveColumnVisibility.d.ts +13 -0
- package/dist/types/components/Form/components/MediaLibraryBrowser.d.ts +22 -0
- package/dist/types/components/Form/components/fields/FilePicker.d.ts +16 -0
- package/dist/types/components/Form/components/fields/FormMediaLibraryBrowser.d.ts +2 -0
- package/dist/types/components/Form/components/fields/StringInputField.d.ts +4 -0
- package/dist/types/components/Form/components/types/CustomJSONSchema7.d.ts +6 -0
- package/dist/types/components/Form/components/viewers/SchemaViewer.d.ts +1 -1
- package/dist/types/index.d.ts +65 -57
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Row,
|
|
2
|
+
import { Row, Table as Table$1, RowData, OnChangeFn, Updater, SortingState, ColumnFiltersState, PaginationState, RowSelectionState, ColumnOrderState, VisibilityState, FilterFn, ColumnDef, Column } from '@tanstack/react-table';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import react__default, { ReactNode, Dispatch, SetStateAction } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import {
|
|
6
|
+
import { TableHeaderProps as TableHeaderProps$1, TableRowProps, GridProps, TableRootProps, BoxProps, FlexProps, CardBodyProps, TextProps, ImageProps } from '@chakra-ui/react';
|
|
7
7
|
import { IconType } from 'react-icons';
|
|
8
8
|
import * as react_i18next from 'react-i18next';
|
|
9
9
|
import { UseTranslationResponse } from 'react-i18next';
|
|
10
|
-
import { RankingInfo } from '@tanstack/match-sorter-utils';
|
|
11
10
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
11
|
+
import { RankingInfo } from '@tanstack/match-sorter-utils';
|
|
12
12
|
import { JSONSchema7 } from 'json-schema';
|
|
13
13
|
import { ForeignKeyProps as ForeignKeyProps$1 } from '@/components/Form/components/fields/StringInputField';
|
|
14
14
|
import { AxiosRequestConfig } from 'axios';
|
|
@@ -16,6 +16,57 @@ import * as react_hook_form from 'react-hook-form';
|
|
|
16
16
|
import { UseFormReturn, FieldValues, SubmitHandler } from 'react-hook-form';
|
|
17
17
|
import { RenderProps, Props } from '@bsol-oss/dayzed-react19';
|
|
18
18
|
|
|
19
|
+
interface TableHeaderTexts {
|
|
20
|
+
pinColumn?: string;
|
|
21
|
+
cancelPin?: string;
|
|
22
|
+
sortAscending?: string;
|
|
23
|
+
sortDescending?: string;
|
|
24
|
+
clearSorting?: string;
|
|
25
|
+
}
|
|
26
|
+
interface TableHeaderProps {
|
|
27
|
+
canResize?: boolean;
|
|
28
|
+
showSelector?: boolean;
|
|
29
|
+
isSticky?: boolean;
|
|
30
|
+
tableHeaderProps?: TableHeaderProps$1;
|
|
31
|
+
tableRowProps?: TableRowProps;
|
|
32
|
+
/**
|
|
33
|
+
* Default text configuration for all columns.
|
|
34
|
+
* Can be overridden per column via meta.headerTexts.
|
|
35
|
+
*/
|
|
36
|
+
defaultTexts?: TableHeaderTexts;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* TableHeader component with configurable text strings.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* // Using default texts
|
|
43
|
+
* <TableHeader />
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* // Customizing default texts for all columns
|
|
47
|
+
* <TableHeader
|
|
48
|
+
* defaultTexts={{
|
|
49
|
+
* pinColumn: "Pin This Column",
|
|
50
|
+
* sortAscending: "Sort A-Z"
|
|
51
|
+
* }}
|
|
52
|
+
* />
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Customizing texts per column via meta
|
|
56
|
+
* const columns = [
|
|
57
|
+
* columnHelper.accessor("name", {
|
|
58
|
+
* header: "Name",
|
|
59
|
+
* meta: {
|
|
60
|
+
* headerTexts: {
|
|
61
|
+
* pinColumn: "Pin Name Column",
|
|
62
|
+
* sortAscending: "Sort Names A-Z"
|
|
63
|
+
* }
|
|
64
|
+
* }
|
|
65
|
+
* })
|
|
66
|
+
* ];
|
|
67
|
+
*/
|
|
68
|
+
declare const TableHeader: ({ canResize, showSelector, isSticky, tableHeaderProps, tableRowProps, defaultTexts, }: TableHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
69
|
+
|
|
19
70
|
interface DensityToggleButtonProps {
|
|
20
71
|
icon?: react__default.ReactElement;
|
|
21
72
|
text?: string;
|
|
@@ -54,6 +105,124 @@ interface EditViewButtonProps {
|
|
|
54
105
|
}
|
|
55
106
|
declare const ViewDialog: ({ icon }: EditViewButtonProps) => react_jsx_runtime.JSX.Element;
|
|
56
107
|
|
|
108
|
+
interface ReloadButtonProps {
|
|
109
|
+
variant?: string;
|
|
110
|
+
}
|
|
111
|
+
declare const ReloadButton: ({ variant, }: ReloadButtonProps) => react_jsx_runtime.JSX.Element;
|
|
112
|
+
|
|
113
|
+
declare const GlobalFilter: () => react_jsx_runtime.JSX.Element;
|
|
114
|
+
|
|
115
|
+
declare const TableSelector: () => react_jsx_runtime.JSX.Element;
|
|
116
|
+
|
|
117
|
+
declare const TableSorter: () => react_jsx_runtime.JSX.Element;
|
|
118
|
+
|
|
119
|
+
declare const TableViewer: () => react_jsx_runtime.JSX.Element;
|
|
120
|
+
|
|
121
|
+
interface TableControlsProps {
|
|
122
|
+
totalText?: string;
|
|
123
|
+
fitTableWidth?: boolean;
|
|
124
|
+
fitTableHeight?: boolean;
|
|
125
|
+
children?: ReactNode;
|
|
126
|
+
showGlobalFilter?: boolean;
|
|
127
|
+
showFilter?: boolean;
|
|
128
|
+
showFilterName?: boolean;
|
|
129
|
+
showFilterTags?: boolean;
|
|
130
|
+
showReload?: boolean;
|
|
131
|
+
showPagination?: boolean;
|
|
132
|
+
showPageSizeControl?: boolean;
|
|
133
|
+
showPageCountText?: boolean;
|
|
134
|
+
showView?: boolean;
|
|
135
|
+
filterTagsOptions?: {
|
|
136
|
+
column: string;
|
|
137
|
+
options: {
|
|
138
|
+
label: string;
|
|
139
|
+
value: string;
|
|
140
|
+
}[];
|
|
141
|
+
}[];
|
|
142
|
+
extraItems?: ReactNode;
|
|
143
|
+
loading?: boolean;
|
|
144
|
+
hasError?: boolean;
|
|
145
|
+
gridProps?: GridProps;
|
|
146
|
+
}
|
|
147
|
+
declare const TableControls: ({ fitTableWidth, fitTableHeight, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, showPagination, showPageSizeControl, showPageCountText, showView, filterTagsOptions, extraItems, loading, hasError, gridProps, }: TableControlsProps) => react_jsx_runtime.JSX.Element;
|
|
148
|
+
|
|
149
|
+
declare const TableFilter: () => react_jsx_runtime.JSX.Element;
|
|
150
|
+
|
|
151
|
+
declare const TableFilterTags: () => react_jsx_runtime.JSX.Element;
|
|
152
|
+
|
|
153
|
+
interface TableProps extends TableRootProps {
|
|
154
|
+
showLoading?: boolean;
|
|
155
|
+
loadingComponent?: ReactNode;
|
|
156
|
+
emptyComponent?: ReactNode;
|
|
157
|
+
canResize?: boolean;
|
|
158
|
+
showSelector?: boolean;
|
|
159
|
+
children: ReactNode;
|
|
160
|
+
}
|
|
161
|
+
declare const Table: ({ children, emptyComponent, canResize, showLoading, showSelector, ...props }: TableProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null;
|
|
162
|
+
|
|
163
|
+
interface TableBodyProps {
|
|
164
|
+
pinnedBgColor?: {
|
|
165
|
+
light: string;
|
|
166
|
+
dark: string;
|
|
167
|
+
};
|
|
168
|
+
showSelector?: boolean;
|
|
169
|
+
alwaysShowSelector?: boolean;
|
|
170
|
+
canResize?: boolean;
|
|
171
|
+
}
|
|
172
|
+
interface TableRowSelectorProps<TData> {
|
|
173
|
+
index: number;
|
|
174
|
+
row: Row<TData>;
|
|
175
|
+
hoveredRow: number;
|
|
176
|
+
pinnedBgColor?: {
|
|
177
|
+
light: string;
|
|
178
|
+
dark: string;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
declare const TableBody: ({ showSelector, canResize, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
|
|
182
|
+
|
|
183
|
+
interface TableCardContainerProps extends BoxProps {
|
|
184
|
+
children: ReactNode;
|
|
185
|
+
variant?: "carousel" | "";
|
|
186
|
+
gap?: string;
|
|
187
|
+
gridTemplateColumns?: string;
|
|
188
|
+
direction?: FlexProps["direction"];
|
|
189
|
+
}
|
|
190
|
+
declare const TableCardContainer: ({ children, variant, gap, gridTemplateColumns, direction, ...props }: TableCardContainerProps) => react_jsx_runtime.JSX.Element;
|
|
191
|
+
|
|
192
|
+
interface TableCardsProps<TData> {
|
|
193
|
+
isSelectable?: boolean;
|
|
194
|
+
showDisplayNameOnly?: boolean;
|
|
195
|
+
renderTitle?: (row: Row<TData>) => ReactNode | undefined;
|
|
196
|
+
cardBodyProps?: CardBodyProps;
|
|
197
|
+
}
|
|
198
|
+
declare const DefaultCardTitle: () => react_jsx_runtime.JSX.Element;
|
|
199
|
+
declare const TableCards: <TData>({ isSelectable, showDisplayNameOnly, renderTitle, cardBodyProps, }: TableCardsProps<TData>) => react_jsx_runtime.JSX.Element;
|
|
200
|
+
|
|
201
|
+
interface TableRendererProps<TData> {
|
|
202
|
+
render: (render: Table$1<TData>) => react__default.ReactElement;
|
|
203
|
+
}
|
|
204
|
+
declare const TableComponent: <TData>({ render, }: TableRendererProps<TData>) => react__default.ReactElement<unknown, string | react__default.JSXElementConstructor<any>>;
|
|
205
|
+
|
|
206
|
+
interface TableFooterProps {
|
|
207
|
+
showSelector?: boolean;
|
|
208
|
+
alwaysShowSelector?: boolean;
|
|
209
|
+
}
|
|
210
|
+
declare const TableFooter: ({ showSelector, alwaysShowSelector, }: TableFooterProps) => react_jsx_runtime.JSX.Element;
|
|
211
|
+
|
|
212
|
+
interface TableLoadingComponentProps {
|
|
213
|
+
render: (loading: boolean) => ReactNode;
|
|
214
|
+
}
|
|
215
|
+
declare const TableLoadingComponent: ({ render, }: TableLoadingComponentProps) => react_jsx_runtime.JSX.Element;
|
|
216
|
+
|
|
217
|
+
interface TextCellProps {
|
|
218
|
+
label?: string;
|
|
219
|
+
noOfLines?: number[];
|
|
220
|
+
children: string | number | ReactNode | ReactNode[];
|
|
221
|
+
containerProps?: FlexProps;
|
|
222
|
+
textProps?: TextProps;
|
|
223
|
+
}
|
|
224
|
+
declare const TextCell: ({ label, containerProps, textProps, children, }: TextCellProps) => react_jsx_runtime.JSX.Element;
|
|
225
|
+
|
|
57
226
|
interface CardHeaderProps<TData> {
|
|
58
227
|
row: Row<TData>;
|
|
59
228
|
imageColumnId?: keyof TData;
|
|
@@ -98,103 +267,6 @@ declare module "@tanstack/react-table" {
|
|
|
98
267
|
}
|
|
99
268
|
}
|
|
100
269
|
|
|
101
|
-
declare module '@tanstack/react-table' {
|
|
102
|
-
interface FilterFns {
|
|
103
|
-
fuzzy: FilterFn<unknown>;
|
|
104
|
-
}
|
|
105
|
-
interface FilterMeta {
|
|
106
|
-
itemRank: RankingInfo;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
interface DataTableProps<TData = unknown> {
|
|
110
|
-
children?: ReactNode | ReactNode[];
|
|
111
|
-
/**
|
|
112
|
-
* Data array for the table.
|
|
113
|
-
*
|
|
114
|
-
* It will pass into as the data in `@tanstack/react-table`
|
|
115
|
-
* Do not toggle the data array, it will cause the table to re-render in infinite loop.
|
|
116
|
-
*
|
|
117
|
-
* @default []
|
|
118
|
-
*
|
|
119
|
-
*/
|
|
120
|
-
data: TData[];
|
|
121
|
-
/**
|
|
122
|
-
* Column definitions for the table.
|
|
123
|
-
*
|
|
124
|
-
* It will pass into as the column definitions in `@tanstack/react-table`
|
|
125
|
-
*
|
|
126
|
-
* @link https://tanstack.com/table/latest/docs/guide/column-defs
|
|
127
|
-
*/
|
|
128
|
-
columns: ColumnDef<TData, unknown>[];
|
|
129
|
-
enableRowSelection?: boolean;
|
|
130
|
-
enableMultiRowSelection?: boolean;
|
|
131
|
-
enableSubRowSelection?: boolean;
|
|
132
|
-
onRowSelect?: (rowSelectionState: RowSelectionState, data: TData[]) => void;
|
|
133
|
-
columnOrder: ColumnOrderState;
|
|
134
|
-
columnFilters: ColumnFiltersState;
|
|
135
|
-
globalFilter: string;
|
|
136
|
-
density: DensityState;
|
|
137
|
-
pagination: PaginationState;
|
|
138
|
-
sorting: SortingState;
|
|
139
|
-
rowSelection: RowSelectionState;
|
|
140
|
-
columnVisibility: VisibilityState;
|
|
141
|
-
setPagination: OnChangeFn<PaginationState>;
|
|
142
|
-
setSorting: OnChangeFn<SortingState>;
|
|
143
|
-
setColumnFilters: OnChangeFn<ColumnFiltersState>;
|
|
144
|
-
setRowSelection: OnChangeFn<RowSelectionState>;
|
|
145
|
-
setGlobalFilter: OnChangeFn<string>;
|
|
146
|
-
setColumnOrder: OnChangeFn<ColumnOrderState>;
|
|
147
|
-
setDensity: OnChangeFn<DensityState>;
|
|
148
|
-
setColumnVisibility: OnChangeFn<VisibilityState>;
|
|
149
|
-
translate: UseTranslationResponse<any, any>;
|
|
150
|
-
tableLabel?: DataTableLabel;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* DataTable will create a context to hold all values to
|
|
154
|
-
* help the render of the DataTable in serverside
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* The query is required to be a GET request that can receive
|
|
158
|
-
* specified params and return a specified response
|
|
159
|
-
*
|
|
160
|
-
* @link https://tanstack.com/table/latest/docs/guide/column-defs
|
|
161
|
-
*/
|
|
162
|
-
declare function DataTable<TData = unknown>({ columns, data, enableRowSelection, enableMultiRowSelection, enableSubRowSelection, columnOrder, columnFilters, columnVisibility, density, globalFilter, pagination, sorting, rowSelection, setPagination, setSorting, setColumnFilters, setRowSelection, setGlobalFilter, setColumnOrder, setDensity, setColumnVisibility, translate, children, tableLabel, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
163
|
-
|
|
164
|
-
interface DataTableLabel {
|
|
165
|
-
view: string;
|
|
166
|
-
edit: string;
|
|
167
|
-
filterButtonText: string;
|
|
168
|
-
filterTitle: string;
|
|
169
|
-
filterReset: string;
|
|
170
|
-
filterClose: string;
|
|
171
|
-
reloadTooltip: string;
|
|
172
|
-
reloadButtonText: string;
|
|
173
|
-
resetSelection: string;
|
|
174
|
-
resetSorting: string;
|
|
175
|
-
rowCountText: string;
|
|
176
|
-
hasErrorText: string;
|
|
177
|
-
globalFilterPlaceholder: string;
|
|
178
|
-
trueLabel: string;
|
|
179
|
-
falseLabel: string;
|
|
180
|
-
}
|
|
181
|
-
interface DataTableContextProps<TData = unknown> extends DataTableProps {
|
|
182
|
-
table: Table$1<TData>;
|
|
183
|
-
globalFilter: string;
|
|
184
|
-
setGlobalFilter: OnChangeFn<string>;
|
|
185
|
-
type: "client" | "server";
|
|
186
|
-
translate: UseTranslationResponse<any, unknown>;
|
|
187
|
-
tableLabel: DataTableLabel;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
declare const useDataTableContext: <TData>() => DataTableContextProps<TData>;
|
|
191
|
-
|
|
192
|
-
interface DataDisplayProps {
|
|
193
|
-
variant?: "horizontal" | "stats" | "";
|
|
194
|
-
translate?: UseTranslationResponse<any, any>;
|
|
195
|
-
}
|
|
196
|
-
declare const DataDisplay: ({ variant }: DataDisplayProps) => react_jsx_runtime.JSX.Element;
|
|
197
|
-
|
|
198
270
|
interface DataTableDefaultState {
|
|
199
271
|
sorting?: SortingState;
|
|
200
272
|
columnFilters?: ColumnFiltersState;
|
|
@@ -305,255 +377,98 @@ interface QueryParams {
|
|
|
305
377
|
where: ColumnFiltersState;
|
|
306
378
|
searching: string;
|
|
307
379
|
}
|
|
308
|
-
declare const useDataTableServer: <TData>(props: UseDataTableServerProps<TData>) => UseDataTableServerReturn<TData>;
|
|
309
|
-
|
|
310
|
-
interface DataTableServerProps<TData = unknown> {
|
|
311
|
-
children: ReactNode | ReactNode[];
|
|
312
|
-
/**
|
|
313
|
-
* Column definitions for the table.
|
|
314
|
-
*
|
|
315
|
-
* It will pass into as the column definitions in `@tanstack/react-table`
|
|
316
|
-
*
|
|
317
|
-
* @link https://tanstack.com/table/latest/docs/guide/column-defs
|
|
318
|
-
*/
|
|
319
|
-
columns: ColumnDef<TData>[];
|
|
320
|
-
enableRowSelection?: boolean;
|
|
321
|
-
enableMultiRowSelection?: boolean;
|
|
322
|
-
enableSubRowSelection?: boolean;
|
|
323
|
-
columnOrder: ColumnOrderState;
|
|
324
|
-
columnFilters: ColumnFiltersState;
|
|
325
|
-
globalFilter: string;
|
|
326
|
-
density: DensityState;
|
|
327
|
-
pagination: PaginationState;
|
|
328
|
-
sorting: SortingState;
|
|
329
|
-
rowSelection: RowSelectionState;
|
|
330
|
-
columnVisibility: VisibilityState;
|
|
331
|
-
setPagination: OnChangeFn<PaginationState>;
|
|
332
|
-
setSorting: OnChangeFn<SortingState>;
|
|
333
|
-
setColumnFilters: OnChangeFn<ColumnFiltersState>;
|
|
334
|
-
setRowSelection: OnChangeFn<RowSelectionState>;
|
|
335
|
-
setGlobalFilter: OnChangeFn<string>;
|
|
336
|
-
setColumnOrder: OnChangeFn<ColumnOrderState>;
|
|
337
|
-
setDensity: OnChangeFn<DensityState>;
|
|
338
|
-
setColumnVisibility: OnChangeFn<VisibilityState>;
|
|
339
|
-
query: UseQueryResult<DataResponse<TData>>;
|
|
340
|
-
url?: string;
|
|
341
|
-
translate: UseTranslationResponse<any, any>;
|
|
342
|
-
tableLabel?: DataTableLabel;
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* DataTableServer will create a context to hold all values to
|
|
346
|
-
* help the render of the DataTable in serverside
|
|
347
|
-
*
|
|
348
|
-
* The query is required to be a GET request that can receive
|
|
349
|
-
* specified params and return a specified response
|
|
350
|
-
*
|
|
351
|
-
* The `useDataTableServer` can help to create the specified request and response
|
|
352
|
-
*
|
|
353
|
-
* @link https://tanstack.com/table/latest/docs/guide/column-defs
|
|
354
|
-
*/
|
|
355
|
-
declare function DataTableServer<TData = unknown>({ columns, enableRowSelection, enableMultiRowSelection, enableSubRowSelection, columnOrder, columnFilters, columnVisibility, density, globalFilter, pagination, sorting, rowSelection, setPagination, setSorting, setColumnFilters, setRowSelection, setGlobalFilter, setColumnOrder, setDensity, setColumnVisibility, query, url, translate, children, tableLabel, }: DataTableServerProps<TData>): react_jsx_runtime.JSX.Element;
|
|
356
|
-
|
|
357
|
-
interface TableControlsProps {
|
|
358
|
-
totalText?: string;
|
|
359
|
-
fitTableWidth?: boolean;
|
|
360
|
-
fitTableHeight?: boolean;
|
|
361
|
-
children?: ReactNode;
|
|
362
|
-
showGlobalFilter?: boolean;
|
|
363
|
-
showFilter?: boolean;
|
|
364
|
-
showFilterName?: boolean;
|
|
365
|
-
showFilterTags?: boolean;
|
|
366
|
-
showReload?: boolean;
|
|
367
|
-
showPagination?: boolean;
|
|
368
|
-
showPageSizeControl?: boolean;
|
|
369
|
-
showPageCountText?: boolean;
|
|
370
|
-
showView?: boolean;
|
|
371
|
-
filterTagsOptions?: {
|
|
372
|
-
column: string;
|
|
373
|
-
options: {
|
|
374
|
-
label: string;
|
|
375
|
-
value: string;
|
|
376
|
-
}[];
|
|
377
|
-
}[];
|
|
378
|
-
extraItems?: ReactNode;
|
|
379
|
-
loading?: boolean;
|
|
380
|
-
hasError?: boolean;
|
|
381
|
-
gridProps?: GridProps;
|
|
382
|
-
}
|
|
383
|
-
declare const TableControls: ({ fitTableWidth, fitTableHeight, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, showPagination, showPageSizeControl, showPageCountText, showView, filterTagsOptions, extraItems, loading, hasError, gridProps, }: TableControlsProps) => react_jsx_runtime.JSX.Element;
|
|
384
|
-
|
|
385
|
-
interface TableProps extends TableRootProps {
|
|
386
|
-
showLoading?: boolean;
|
|
387
|
-
loadingComponent?: ReactNode;
|
|
388
|
-
emptyComponent?: ReactNode;
|
|
389
|
-
canResize?: boolean;
|
|
390
|
-
children: ReactNode;
|
|
391
|
-
}
|
|
392
|
-
declare const Table: ({ children, emptyComponent, canResize, showLoading, ...props }: TableProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null;
|
|
393
|
-
|
|
394
|
-
interface TableBodyProps {
|
|
395
|
-
pinnedBgColor?: {
|
|
396
|
-
light: string;
|
|
397
|
-
dark: string;
|
|
398
|
-
};
|
|
399
|
-
showSelector?: boolean;
|
|
400
|
-
alwaysShowSelector?: boolean;
|
|
401
|
-
canResize?: boolean;
|
|
402
|
-
}
|
|
403
|
-
interface TableRowSelectorProps<TData> {
|
|
404
|
-
index: number;
|
|
405
|
-
row: Row<TData>;
|
|
406
|
-
hoveredRow: number;
|
|
407
|
-
pinnedBgColor?: {
|
|
408
|
-
light: string;
|
|
409
|
-
dark: string;
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
declare const TableBody: ({ showSelector, canResize, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
|
|
413
|
-
|
|
414
|
-
interface TableFooterProps {
|
|
415
|
-
showSelector?: boolean;
|
|
416
|
-
alwaysShowSelector?: boolean;
|
|
417
|
-
}
|
|
418
|
-
declare const TableFooter: ({ showSelector, alwaysShowSelector, }: TableFooterProps) => react_jsx_runtime.JSX.Element;
|
|
419
|
-
|
|
420
|
-
interface TableHeaderTexts {
|
|
421
|
-
pinColumn?: string;
|
|
422
|
-
cancelPin?: string;
|
|
423
|
-
sortAscending?: string;
|
|
424
|
-
sortDescending?: string;
|
|
425
|
-
clearSorting?: string;
|
|
426
|
-
}
|
|
427
|
-
interface TableHeaderProps {
|
|
428
|
-
canResize?: boolean;
|
|
429
|
-
showSelector?: boolean;
|
|
430
|
-
isSticky?: boolean;
|
|
431
|
-
tableHeaderProps?: TableHeaderProps$1;
|
|
432
|
-
tableRowProps?: TableRowProps;
|
|
433
|
-
/**
|
|
434
|
-
* Default text configuration for all columns.
|
|
435
|
-
* Can be overridden per column via meta.headerTexts.
|
|
436
|
-
*/
|
|
437
|
-
defaultTexts?: TableHeaderTexts;
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* TableHeader component with configurable text strings.
|
|
441
|
-
*
|
|
442
|
-
* @example
|
|
443
|
-
* // Using default texts
|
|
444
|
-
* <TableHeader />
|
|
445
|
-
*
|
|
446
|
-
* @example
|
|
447
|
-
* // Customizing default texts for all columns
|
|
448
|
-
* <TableHeader
|
|
449
|
-
* defaultTexts={{
|
|
450
|
-
* pinColumn: "Pin This Column",
|
|
451
|
-
* sortAscending: "Sort A-Z"
|
|
452
|
-
* }}
|
|
453
|
-
* />
|
|
454
|
-
*
|
|
455
|
-
* @example
|
|
456
|
-
* // Customizing texts per column via meta
|
|
457
|
-
* const columns = [
|
|
458
|
-
* columnHelper.accessor("name", {
|
|
459
|
-
* header: "Name",
|
|
460
|
-
* meta: {
|
|
461
|
-
* headerTexts: {
|
|
462
|
-
* pinColumn: "Pin Name Column",
|
|
463
|
-
* sortAscending: "Sort Names A-Z"
|
|
464
|
-
* }
|
|
465
|
-
* }
|
|
466
|
-
* })
|
|
467
|
-
* ];
|
|
468
|
-
*/
|
|
469
|
-
declare const TableHeader: ({ canResize, showSelector, isSticky, tableHeaderProps, tableRowProps, defaultTexts, }: TableHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
470
|
-
|
|
471
|
-
interface DefaultTableProps {
|
|
472
|
-
showFooter?: boolean;
|
|
473
|
-
tableProps?: Omit<TableProps, 'children'>;
|
|
474
|
-
tableHeaderProps?: TableHeaderProps;
|
|
475
|
-
tableBodyProps?: TableBodyProps;
|
|
476
|
-
tableFooterProps?: TableFooterProps;
|
|
477
|
-
controlProps?: TableControlsProps;
|
|
478
|
-
variant?: '' | 'greedy';
|
|
479
|
-
isLoading?: boolean;
|
|
480
|
-
}
|
|
481
|
-
declare const DefaultTable: ({ showFooter, tableProps, tableHeaderProps, tableBodyProps, tableFooterProps, controlProps, variant, isLoading, }: DefaultTableProps) => react_jsx_runtime.JSX.Element;
|
|
380
|
+
declare const useDataTableServer: <TData>(props: UseDataTableServerProps<TData>) => UseDataTableServerReturn<TData>;
|
|
482
381
|
|
|
483
|
-
|
|
382
|
+
declare module '@tanstack/react-table' {
|
|
383
|
+
interface FilterFns {
|
|
384
|
+
fuzzy: FilterFn<unknown>;
|
|
385
|
+
}
|
|
386
|
+
interface FilterMeta {
|
|
387
|
+
itemRank: RankingInfo;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
interface DataTableProps<TData = unknown> {
|
|
391
|
+
children?: ReactNode | ReactNode[];
|
|
484
392
|
/**
|
|
485
|
-
*
|
|
486
|
-
*
|
|
393
|
+
* Data array for the table.
|
|
394
|
+
*
|
|
395
|
+
* It will pass into as the data in `@tanstack/react-table`
|
|
396
|
+
* Do not toggle the data array, it will cause the table to re-render in infinite loop.
|
|
397
|
+
*
|
|
398
|
+
* @default []
|
|
399
|
+
*
|
|
487
400
|
*/
|
|
488
|
-
|
|
401
|
+
data: TData[];
|
|
402
|
+
/**
|
|
403
|
+
* Column definitions for the table.
|
|
404
|
+
*
|
|
405
|
+
* It will pass into as the column definitions in `@tanstack/react-table`
|
|
406
|
+
*
|
|
407
|
+
* @link https://tanstack.com/table/latest/docs/guide/column-defs
|
|
408
|
+
*/
|
|
409
|
+
columns: ColumnDef<TData, unknown>[];
|
|
410
|
+
enableRowSelection?: boolean;
|
|
411
|
+
enableMultiRowSelection?: boolean;
|
|
412
|
+
enableSubRowSelection?: boolean;
|
|
413
|
+
onRowSelect?: (rowSelectionState: RowSelectionState, data: TData[]) => void;
|
|
414
|
+
columnOrder: ColumnOrderState;
|
|
415
|
+
columnFilters: ColumnFiltersState;
|
|
416
|
+
globalFilter: string;
|
|
417
|
+
density: DensityState;
|
|
418
|
+
pagination: PaginationState;
|
|
419
|
+
sorting: SortingState;
|
|
420
|
+
rowSelection: RowSelectionState;
|
|
421
|
+
columnVisibility: VisibilityState;
|
|
422
|
+
setPagination: OnChangeFn<PaginationState>;
|
|
423
|
+
setSorting: OnChangeFn<SortingState>;
|
|
424
|
+
setColumnFilters: OnChangeFn<ColumnFiltersState>;
|
|
425
|
+
setRowSelection: OnChangeFn<RowSelectionState>;
|
|
426
|
+
setGlobalFilter: OnChangeFn<string>;
|
|
427
|
+
setColumnOrder: OnChangeFn<ColumnOrderState>;
|
|
428
|
+
setDensity: OnChangeFn<DensityState>;
|
|
429
|
+
setColumnVisibility: OnChangeFn<VisibilityState>;
|
|
430
|
+
translate: UseTranslationResponse<any, any>;
|
|
431
|
+
tableLabel?: DataTableLabel;
|
|
489
432
|
}
|
|
490
433
|
/**
|
|
491
|
-
*
|
|
492
|
-
*
|
|
434
|
+
* DataTable will create a context to hold all values to
|
|
435
|
+
* help the render of the DataTable in serverside
|
|
493
436
|
*
|
|
494
|
-
* Use this component when working with DataTableServer to automatically
|
|
495
|
-
* show skeleton loading state during data fetching.
|
|
496
437
|
*
|
|
497
|
-
*
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
* </DataTableServer>
|
|
502
|
-
* ```
|
|
438
|
+
* The query is required to be a GET request that can receive
|
|
439
|
+
* specified params and return a specified response
|
|
440
|
+
*
|
|
441
|
+
* @link https://tanstack.com/table/latest/docs/guide/column-defs
|
|
503
442
|
*/
|
|
504
|
-
declare
|
|
505
|
-
|
|
506
|
-
interface ReloadButtonProps {
|
|
507
|
-
variant?: string;
|
|
508
|
-
}
|
|
509
|
-
declare const ReloadButton: ({ variant, }: ReloadButtonProps) => react_jsx_runtime.JSX.Element;
|
|
510
|
-
|
|
511
|
-
interface TableCardContainerProps extends BoxProps {
|
|
512
|
-
children: ReactNode;
|
|
513
|
-
variant?: "carousel" | "";
|
|
514
|
-
gap?: string;
|
|
515
|
-
gridTemplateColumns?: string;
|
|
516
|
-
direction?: FlexProps["direction"];
|
|
517
|
-
}
|
|
518
|
-
declare const TableCardContainer: ({ children, variant, gap, gridTemplateColumns, direction, ...props }: TableCardContainerProps) => react_jsx_runtime.JSX.Element;
|
|
519
|
-
|
|
520
|
-
interface TableCardsProps<TData> {
|
|
521
|
-
isSelectable?: boolean;
|
|
522
|
-
showDisplayNameOnly?: boolean;
|
|
523
|
-
renderTitle?: (row: Row<TData>) => ReactNode | undefined;
|
|
524
|
-
cardBodyProps?: CardBodyProps;
|
|
525
|
-
}
|
|
526
|
-
declare const DefaultCardTitle: () => react_jsx_runtime.JSX.Element;
|
|
527
|
-
declare const TableCards: <TData>({ isSelectable, showDisplayNameOnly, renderTitle, cardBodyProps, }: TableCardsProps<TData>) => react_jsx_runtime.JSX.Element;
|
|
443
|
+
declare function DataTable<TData = unknown>({ columns, data, enableRowSelection, enableMultiRowSelection, enableSubRowSelection, columnOrder, columnFilters, columnVisibility, density, globalFilter, pagination, sorting, rowSelection, setPagination, setSorting, setColumnFilters, setRowSelection, setGlobalFilter, setColumnOrder, setDensity, setColumnVisibility, translate, children, tableLabel, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
528
444
|
|
|
529
|
-
interface
|
|
530
|
-
|
|
445
|
+
interface DataTableLabel {
|
|
446
|
+
view: string;
|
|
447
|
+
edit: string;
|
|
448
|
+
filterButtonText: string;
|
|
449
|
+
filterTitle: string;
|
|
450
|
+
filterReset: string;
|
|
451
|
+
filterClose: string;
|
|
452
|
+
reloadTooltip: string;
|
|
453
|
+
reloadButtonText: string;
|
|
454
|
+
resetSelection: string;
|
|
455
|
+
resetSorting: string;
|
|
456
|
+
rowCountText: string;
|
|
457
|
+
hasErrorText: string;
|
|
458
|
+
globalFilterPlaceholder: string;
|
|
459
|
+
trueLabel: string;
|
|
460
|
+
falseLabel: string;
|
|
531
461
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
render: (loading: boolean) => ReactNode;
|
|
462
|
+
interface DataTableContextProps<TData = unknown> extends DataTableProps {
|
|
463
|
+
table: Table$1<TData>;
|
|
464
|
+
globalFilter: string;
|
|
465
|
+
setGlobalFilter: OnChangeFn<string>;
|
|
466
|
+
type: "client" | "server";
|
|
467
|
+
translate: UseTranslationResponse<any, unknown>;
|
|
468
|
+
tableLabel: DataTableLabel;
|
|
540
469
|
}
|
|
541
|
-
declare const TableLoadingComponent: ({ render, }: TableLoadingComponentProps) => react_jsx_runtime.JSX.Element;
|
|
542
|
-
|
|
543
|
-
declare const TableSelector: () => react_jsx_runtime.JSX.Element;
|
|
544
|
-
|
|
545
|
-
declare const TableSorter: () => react_jsx_runtime.JSX.Element;
|
|
546
|
-
|
|
547
|
-
declare const TableViewer: () => react_jsx_runtime.JSX.Element;
|
|
548
470
|
|
|
549
|
-
|
|
550
|
-
label?: string;
|
|
551
|
-
noOfLines?: number[];
|
|
552
|
-
children: string | number | ReactNode | ReactNode[];
|
|
553
|
-
containerProps?: FlexProps;
|
|
554
|
-
textProps?: TextProps;
|
|
555
|
-
}
|
|
556
|
-
declare const TextCell: ({ label, containerProps, textProps, children, }: TextCellProps) => react_jsx_runtime.JSX.Element;
|
|
471
|
+
declare const useDataTableContext: <TData>() => DataTableContextProps<TData>;
|
|
557
472
|
|
|
558
473
|
interface GetColumnsConfigs<K extends RowData> {
|
|
559
474
|
schema: JSONSchema7;
|
|
@@ -569,14 +484,6 @@ interface GetColumnsConfigs<K extends RowData> {
|
|
|
569
484
|
declare const widthSanityCheck: <K extends unknown>(widthList: number[], ignoreList: K[], properties: { [key in K as string]?: object | undefined; }) => void;
|
|
570
485
|
declare const getColumns: <TData extends unknown>({ schema, include, ignore, width, meta, defaultWidth, translate, }: GetColumnsConfigs<TData>) => ColumnDef<TData>[];
|
|
571
486
|
|
|
572
|
-
interface TableDataDisplayProps {
|
|
573
|
-
colorPalette?: string;
|
|
574
|
-
emptyComponent?: ReactNode;
|
|
575
|
-
}
|
|
576
|
-
declare const TableDataDisplay: ({ colorPalette, emptyComponent, }: TableDataDisplayProps) => react_jsx_runtime.JSX.Element;
|
|
577
|
-
|
|
578
|
-
declare const GlobalFilter: () => react_jsx_runtime.JSX.Element;
|
|
579
|
-
|
|
580
487
|
interface CustomQueryFnResponse {
|
|
581
488
|
/**
|
|
582
489
|
* The data of the query
|
|
@@ -591,6 +498,10 @@ interface CustomQueryFnParams {
|
|
|
591
498
|
searching: string;
|
|
592
499
|
limit: number;
|
|
593
500
|
offset: number;
|
|
501
|
+
where?: Array<{
|
|
502
|
+
id: string;
|
|
503
|
+
value: string | string[];
|
|
504
|
+
}>;
|
|
594
505
|
}
|
|
595
506
|
type CustomQueryFn = (params: CustomQueryFnParams) => Promise<CustomQueryFnResponse>;
|
|
596
507
|
interface ForeignKeyProps {
|
|
@@ -860,6 +771,10 @@ interface FilePickerLabels {
|
|
|
860
771
|
noFilesFound?: string;
|
|
861
772
|
cancel?: string;
|
|
862
773
|
select?: string;
|
|
774
|
+
uploadTab?: string;
|
|
775
|
+
browseTab?: string;
|
|
776
|
+
uploading?: string;
|
|
777
|
+
uploadFailed?: string;
|
|
863
778
|
}
|
|
864
779
|
interface CustomJSONSchema7 extends JSONSchema7 {
|
|
865
780
|
gridColumn?: string;
|
|
@@ -906,6 +821,8 @@ interface FilePickerProps {
|
|
|
906
821
|
onFetchFiles?: (search: string) => Promise<FilePickerMediaFile[]>;
|
|
907
822
|
enableMediaLibrary?: boolean;
|
|
908
823
|
filterImageOnly?: boolean;
|
|
824
|
+
enableUpload?: boolean;
|
|
825
|
+
onUploadFile?: (file: File) => Promise<string>;
|
|
909
826
|
}
|
|
910
827
|
|
|
911
828
|
interface FormRootProps<TData extends FieldValues> {
|
|
@@ -964,6 +881,27 @@ declare const FormTitle: () => react_jsx_runtime.JSX.Element;
|
|
|
964
881
|
|
|
965
882
|
declare const FormBody: <TData extends object>() => string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
966
883
|
|
|
884
|
+
type MediaLibraryBrowserPropsBase = {
|
|
885
|
+
onFetchFiles?: (search: string) => Promise<FilePickerMediaFile[]>;
|
|
886
|
+
filterImageOnly?: boolean;
|
|
887
|
+
labels?: FilePickerLabels;
|
|
888
|
+
enabled?: boolean;
|
|
889
|
+
};
|
|
890
|
+
type MediaLibraryBrowserPropsSingle = MediaLibraryBrowserPropsBase & {
|
|
891
|
+
multiple?: false;
|
|
892
|
+
onFileSelect?: (fileId: string) => void;
|
|
893
|
+
selectedFileId?: string;
|
|
894
|
+
onSelectedFileIdChange?: (fileId: string) => void;
|
|
895
|
+
};
|
|
896
|
+
type MediaLibraryBrowserPropsMultiple = MediaLibraryBrowserPropsBase & {
|
|
897
|
+
multiple: true;
|
|
898
|
+
onFileSelect?: (fileId: string[]) => void;
|
|
899
|
+
selectedFileId?: string[];
|
|
900
|
+
onSelectedFileIdChange?: (fileId: string[]) => void;
|
|
901
|
+
};
|
|
902
|
+
type MediaLibraryBrowserProps = MediaLibraryBrowserPropsSingle | MediaLibraryBrowserPropsMultiple;
|
|
903
|
+
declare const MediaLibraryBrowser: ({ onFetchFiles, filterImageOnly, labels, enabled, multiple, onFileSelect, selectedFileId: controlledSelectedFileId, onSelectedFileIdChange, }: MediaLibraryBrowserProps) => react_jsx_runtime.JSX.Element | null;
|
|
904
|
+
|
|
967
905
|
interface UseFormProps {
|
|
968
906
|
preLoadedValues?: FieldValues | undefined;
|
|
969
907
|
keyPrefix?: string;
|
|
@@ -1052,7 +990,101 @@ interface RecordDisplayProps {
|
|
|
1052
990
|
}
|
|
1053
991
|
declare const RecordDisplay: ({ object, boxProps, translate, prefix, }: RecordDisplayProps) => react_jsx_runtime.JSX.Element;
|
|
1054
992
|
|
|
1055
|
-
|
|
993
|
+
interface TableDataDisplayProps {
|
|
994
|
+
colorPalette?: string;
|
|
995
|
+
emptyComponent?: ReactNode;
|
|
996
|
+
}
|
|
997
|
+
declare const TableDataDisplay: ({ colorPalette, emptyComponent, }: TableDataDisplayProps) => react_jsx_runtime.JSX.Element;
|
|
998
|
+
|
|
999
|
+
interface DefaultTableProps {
|
|
1000
|
+
showFooter?: boolean;
|
|
1001
|
+
tableProps?: Omit<TableProps, 'children'>;
|
|
1002
|
+
tableHeaderProps?: TableHeaderProps;
|
|
1003
|
+
tableBodyProps?: TableBodyProps;
|
|
1004
|
+
tableFooterProps?: TableFooterProps;
|
|
1005
|
+
controlProps?: TableControlsProps;
|
|
1006
|
+
variant?: '' | 'greedy';
|
|
1007
|
+
isLoading?: boolean;
|
|
1008
|
+
}
|
|
1009
|
+
declare const DefaultTable: ({ showFooter, tableProps, tableHeaderProps, tableBodyProps, tableFooterProps, controlProps, variant, isLoading, }: DefaultTableProps) => react_jsx_runtime.JSX.Element;
|
|
1010
|
+
|
|
1011
|
+
interface DefaultTableServerProps extends DefaultTableProps {
|
|
1012
|
+
/**
|
|
1013
|
+
* Optional isLoading prop to override auto-detected loading state.
|
|
1014
|
+
* If not provided, will automatically detect from DataTableServerContext.
|
|
1015
|
+
*/
|
|
1016
|
+
isLoading?: boolean;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* DefaultTableServer is a wrapper around DefaultTable that automatically
|
|
1020
|
+
* detects server-side loading state from DataTableServerContext.
|
|
1021
|
+
*
|
|
1022
|
+
* Use this component when working with DataTableServer to automatically
|
|
1023
|
+
* show skeleton loading state during data fetching.
|
|
1024
|
+
*
|
|
1025
|
+
* @example
|
|
1026
|
+
* ```tsx
|
|
1027
|
+
* <DataTableServer columns={columns} {...datatableServer}>
|
|
1028
|
+
* <DefaultTableServer />
|
|
1029
|
+
* </DataTableServer>
|
|
1030
|
+
* ```
|
|
1031
|
+
*/
|
|
1032
|
+
declare const DefaultTableServer: ({ isLoading: isLoadingOverride, ...props }: DefaultTableServerProps) => react_jsx_runtime.JSX.Element;
|
|
1033
|
+
|
|
1034
|
+
interface DataDisplayProps {
|
|
1035
|
+
variant?: "horizontal" | "stats" | "";
|
|
1036
|
+
translate?: UseTranslationResponse<any, any>;
|
|
1037
|
+
}
|
|
1038
|
+
declare const DataDisplay: ({ variant }: DataDisplayProps) => react_jsx_runtime.JSX.Element;
|
|
1039
|
+
|
|
1040
|
+
interface DataTableServerProps<TData = unknown> {
|
|
1041
|
+
children: ReactNode | ReactNode[];
|
|
1042
|
+
/**
|
|
1043
|
+
* Column definitions for the table.
|
|
1044
|
+
*
|
|
1045
|
+
* It will pass into as the column definitions in `@tanstack/react-table`
|
|
1046
|
+
*
|
|
1047
|
+
* @link https://tanstack.com/table/latest/docs/guide/column-defs
|
|
1048
|
+
*/
|
|
1049
|
+
columns: ColumnDef<TData>[];
|
|
1050
|
+
enableRowSelection?: boolean;
|
|
1051
|
+
enableMultiRowSelection?: boolean;
|
|
1052
|
+
enableSubRowSelection?: boolean;
|
|
1053
|
+
columnOrder: ColumnOrderState;
|
|
1054
|
+
columnFilters: ColumnFiltersState;
|
|
1055
|
+
globalFilter: string;
|
|
1056
|
+
density: DensityState;
|
|
1057
|
+
pagination: PaginationState;
|
|
1058
|
+
sorting: SortingState;
|
|
1059
|
+
rowSelection: RowSelectionState;
|
|
1060
|
+
columnVisibility: VisibilityState;
|
|
1061
|
+
setPagination: OnChangeFn<PaginationState>;
|
|
1062
|
+
setSorting: OnChangeFn<SortingState>;
|
|
1063
|
+
setColumnFilters: OnChangeFn<ColumnFiltersState>;
|
|
1064
|
+
setRowSelection: OnChangeFn<RowSelectionState>;
|
|
1065
|
+
setGlobalFilter: OnChangeFn<string>;
|
|
1066
|
+
setColumnOrder: OnChangeFn<ColumnOrderState>;
|
|
1067
|
+
setDensity: OnChangeFn<DensityState>;
|
|
1068
|
+
setColumnVisibility: OnChangeFn<VisibilityState>;
|
|
1069
|
+
query: UseQueryResult<DataResponse<TData>>;
|
|
1070
|
+
url?: string;
|
|
1071
|
+
translate: UseTranslationResponse<any, any>;
|
|
1072
|
+
tableLabel?: DataTableLabel;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* DataTableServer will create a context to hold all values to
|
|
1076
|
+
* help the render of the DataTable in serverside
|
|
1077
|
+
*
|
|
1078
|
+
* The query is required to be a GET request that can receive
|
|
1079
|
+
* specified params and return a specified response
|
|
1080
|
+
*
|
|
1081
|
+
* The `useDataTableServer` can help to create the specified request and response
|
|
1082
|
+
*
|
|
1083
|
+
* @link https://tanstack.com/table/latest/docs/guide/column-defs
|
|
1084
|
+
*/
|
|
1085
|
+
declare function DataTableServer<TData = unknown>({ columns, enableRowSelection, enableMultiRowSelection, enableSubRowSelection, columnOrder, columnFilters, columnVisibility, density, globalFilter, pagination, sorting, rowSelection, setPagination, setSorting, setColumnFilters, setRowSelection, setGlobalFilter, setColumnOrder, setDensity, setColumnVisibility, query, url, translate, children, tableLabel, }: DataTableServerProps<TData>): react_jsx_runtime.JSX.Element;
|
|
1086
|
+
|
|
1087
|
+
declare module '@tanstack/react-table' {
|
|
1056
1088
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
1057
1089
|
/**
|
|
1058
1090
|
* If `showCustomDisplay` is `true`, it will use the cell render to render the value.
|
|
@@ -1091,7 +1123,7 @@ declare module "@tanstack/react-table" {
|
|
|
1091
1123
|
* - "dateRange": A date range filter.
|
|
1092
1124
|
* - "custom": A custom filter function.
|
|
1093
1125
|
*/
|
|
1094
|
-
filterVariant?:
|
|
1126
|
+
filterVariant?: 'text' | 'range' | 'select' | 'tag' | 'boolean' | 'dateRange' | 'custom';
|
|
1095
1127
|
/**
|
|
1096
1128
|
* Options for the select filter variant, if applicable.
|
|
1097
1129
|
*/
|
|
@@ -1121,7 +1153,14 @@ declare module "@tanstack/react-table" {
|
|
|
1121
1153
|
* @returns A JSX element representing the filter UI.
|
|
1122
1154
|
*/
|
|
1123
1155
|
renderFilter?: (column: Column<TData>) => ReactNode;
|
|
1156
|
+
/**
|
|
1157
|
+
* Priority for responsive column hiding when table width is too narrow.
|
|
1158
|
+
* Lower priority numbers = hide first (e.g., priority 1 hides before priority 10).
|
|
1159
|
+
* Columns without priority default to Infinity (highest priority, never auto-hide).
|
|
1160
|
+
* Only applies when canResize={false}.
|
|
1161
|
+
*/
|
|
1162
|
+
responsivePriority?: number;
|
|
1124
1163
|
}
|
|
1125
1164
|
}
|
|
1126
1165
|
|
|
1127
|
-
export { type CalendarProps, CardHeader, type CardHeaderProps, type CustomJSONSchema7, type CustomJSONSchema7Definition, DataDisplay, type DataDisplayProps, type DataResponse, DataTable, type DataTableDefaultState, type DataTableProps, DataTableServer, type DataTableServerProps, type DatePickerLabels, type DatePickerProps, type DateTimePickerLabels, DefaultCardTitle, DefaultForm, type DefaultFormProps, DefaultTable, type DefaultTableProps, DefaultTableServer, type DefaultTableServerProps, DensityToggleButton, type DensityToggleButtonProps, type EditFilterButtonProps, EditSortingButton, type EditSortingButtonProps, type EditViewButtonProps, EmptyState, type EmptyStateProps, type EnumPickerLabels, ErrorAlert, type ErrorAlertProps, type ErrorMessageConfig, type ErrorMessageResult, type FieldErrorConfig, type FilePickerLabels, type FilePickerMediaFile, type FilePickerProps, FilterDialog, FormBody, FormRoot, type FormRootProps, FormTitle, type GetColumnsConfigs, type GetDateColorProps, type GetMultiDatesProps, type GetRangeDatesProps, type GetStyleProps, type GetVariantProps, GlobalFilter, type IdPickerLabels, PageSizeControl, type PageSizeControlProps, Pagination, type QueryParams, type RangeCalendarProps, type RangeDatePickerProps, RecordDisplay, type RecordDisplayProps, ReloadButton, type ReloadButtonProps, ResetFilteringButton, ResetSelectionButton, ResetSortingButton, type Result, RowCountText, Table, TableBody, type TableBodyProps, TableCardContainer, type TableCardContainerProps, TableCards, type TableCardsProps, TableComponent, TableControls, type TableControlsProps, TableDataDisplay, type TableDataDisplayProps, TableFilter, TableFilterTags, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, type TableHeaderTexts, TableLoadingComponent, type TableLoadingComponentProps, type TableProps, type TableRendererProps, type TableRowSelectorProps, TableSelector, TableSorter, TableViewer, type TagPickerProps, TextCell, type TextCellProps, type UseDataTableProps, type UseDataTableReturn, type UseDataTableServerProps, type UseDataTableServerReturn, type UseFormProps, type ValidationErrorType, ViewDialog, buildErrorMessages, buildFieldErrors, buildRequiredErrors, convertToAjvErrorsFormat, createErrorMessage, getColumns, getMultiDates, getRangeDates, idPickerSanityCheck, useDataTable, useDataTableContext, useDataTableServer, useForm, widthSanityCheck };
|
|
1166
|
+
export { type CalendarProps, CardHeader, type CardHeaderProps, type CustomJSONSchema7, type CustomJSONSchema7Definition, DataDisplay, type DataDisplayProps, type DataResponse, DataTable, type DataTableDefaultState, type DataTableProps, DataTableServer, type DataTableServerProps, type DatePickerLabels, type DatePickerProps, type DateTimePickerLabels, DefaultCardTitle, DefaultForm, type DefaultFormProps, DefaultTable, type DefaultTableProps, DefaultTableServer, type DefaultTableServerProps, DensityToggleButton, type DensityToggleButtonProps, type EditFilterButtonProps, EditSortingButton, type EditSortingButtonProps, type EditViewButtonProps, EmptyState, type EmptyStateProps, type EnumPickerLabels, ErrorAlert, type ErrorAlertProps, type ErrorMessageConfig, type ErrorMessageResult, type FieldErrorConfig, type FilePickerLabels, type FilePickerMediaFile, type FilePickerProps, FilterDialog, FormBody, FormRoot, type FormRootProps, FormTitle, type GetColumnsConfigs, type GetDateColorProps, type GetMultiDatesProps, type GetRangeDatesProps, type GetStyleProps, type GetVariantProps, GlobalFilter, type IdPickerLabels, MediaLibraryBrowser, type MediaLibraryBrowserProps, PageSizeControl, type PageSizeControlProps, Pagination, type QueryParams, type RangeCalendarProps, type RangeDatePickerProps, RecordDisplay, type RecordDisplayProps, ReloadButton, type ReloadButtonProps, ResetFilteringButton, ResetSelectionButton, ResetSortingButton, type Result, RowCountText, Table, TableBody, type TableBodyProps, TableCardContainer, type TableCardContainerProps, TableCards, type TableCardsProps, TableComponent, TableControls, type TableControlsProps, TableDataDisplay, type TableDataDisplayProps, TableFilter, TableFilterTags, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, type TableHeaderTexts, TableLoadingComponent, type TableLoadingComponentProps, type TableProps, type TableRendererProps, type TableRowSelectorProps, TableSelector, TableSorter, TableViewer, type TagPickerProps, TextCell, type TextCellProps, type UseDataTableProps, type UseDataTableReturn, type UseDataTableServerProps, type UseDataTableServerReturn, type UseFormProps, type ValidationErrorType, ViewDialog, buildErrorMessages, buildFieldErrors, buildRequiredErrors, convertToAjvErrorsFormat, createErrorMessage, getColumns, getMultiDates, getRangeDates, idPickerSanityCheck, useDataTable, useDataTableContext, useDataTableServer, useForm, widthSanityCheck };
|