@bsol-oss/react-datatable5 1.0.63 → 1.0.64
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 +105 -70
- package/dist/index.js +218 -205
- package/dist/index.mjs +136 -123
- package/dist/types/components/DataTable/DataTableContext.d.ts +1 -0
- package/dist/types/components/DataTable/useDataTable.d.ts +1 -0
- package/dist/types/index.d.ts +40 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,69 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RowData, OnChangeFn, Updater, FilterFn, ColumnDef, RowSelectionState, ColumnFiltersState, SortingState, VisibilityState, Row, Table as Table$1, Column } from '@tanstack/react-table';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { RankingInfo } from '@tanstack/match-sorter-utils';
|
|
5
4
|
import React$1, { ReactNode } from 'react';
|
|
6
|
-
import
|
|
5
|
+
import { RankingInfo } from '@tanstack/match-sorter-utils';
|
|
7
6
|
import { TableProps as TableProps$1, GridProps, TextProps, TooltipProps } from '@chakra-ui/react';
|
|
8
7
|
import * as _tanstack_table_core from '@tanstack/table-core';
|
|
8
|
+
import * as react_icons_lib from 'react-icons/lib';
|
|
9
|
+
|
|
10
|
+
interface DensityToggleButtonProps {
|
|
11
|
+
icon?: React$1.ReactElement;
|
|
12
|
+
text?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const DensityToggleButton: ({ text, icon, }: DensityToggleButtonProps) => react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
interface EditFilterButtonProps {
|
|
17
|
+
text?: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
closeText?: string;
|
|
20
|
+
resetText?: string;
|
|
21
|
+
icon?: React.ReactElement;
|
|
22
|
+
}
|
|
23
|
+
declare const EditFilterButton: ({ text, title, closeText, resetText, icon, ...props }: EditFilterButtonProps) => react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
interface EditOrderButtonProps {
|
|
26
|
+
title?: string;
|
|
27
|
+
icon?: React$1.ReactElement;
|
|
28
|
+
text?: string;
|
|
29
|
+
}
|
|
30
|
+
declare const EditOrderButton: ({ text, icon, title, }: EditOrderButtonProps) => react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
32
|
+
interface EditSortingButtonProps {
|
|
33
|
+
title?: string;
|
|
34
|
+
icon?: React.ReactElement;
|
|
35
|
+
text?: string;
|
|
36
|
+
}
|
|
37
|
+
declare const EditSortingButton: ({ text, icon, title, }: EditSortingButtonProps) => react_jsx_runtime.JSX.Element;
|
|
38
|
+
|
|
39
|
+
interface EditViewButtonProps {
|
|
40
|
+
text?: string;
|
|
41
|
+
icon?: React$1.ReactElement;
|
|
42
|
+
title?: string;
|
|
43
|
+
}
|
|
44
|
+
declare const EditViewButton: ({ text, icon, title, }: EditViewButtonProps) => react_jsx_runtime.JSX.Element;
|
|
45
|
+
|
|
46
|
+
interface PageSizeControlProps {
|
|
47
|
+
pageSizes?: number[];
|
|
48
|
+
}
|
|
49
|
+
declare const PageSizeControl: ({ pageSizes, }: PageSizeControlProps) => react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
interface ResetFilteringButtonProps {
|
|
52
|
+
text?: string;
|
|
53
|
+
}
|
|
54
|
+
declare const ResetFilteringButton: ({ text, }: ResetFilteringButtonProps) => react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
interface ResetSelectionButtonProps {
|
|
57
|
+
text?: string;
|
|
58
|
+
}
|
|
59
|
+
declare const ResetSelectionButton: ({ text, }: ResetSelectionButtonProps) => react_jsx_runtime.JSX.Element;
|
|
60
|
+
|
|
61
|
+
interface ResetSortingButtonProps {
|
|
62
|
+
text?: string;
|
|
63
|
+
}
|
|
64
|
+
declare const ResetSortingButton: ({ text, }: ResetSortingButtonProps) => react_jsx_runtime.JSX.Element;
|
|
65
|
+
|
|
66
|
+
declare const RowCountText: () => react_jsx_runtime.JSX.Element;
|
|
9
67
|
|
|
10
68
|
type DensityState = "sm" | "md" | "lg";
|
|
11
69
|
interface DensityTableState {
|
|
@@ -108,73 +166,6 @@ interface DefaultTableProps extends TableControlsProps {
|
|
|
108
166
|
}
|
|
109
167
|
declare const DefaultTable: ({ totalText, showFilter, showFooter, fitTableWidth, fitTableHeight, isMobile, filterOptions, showFilterTags, showFilterName, }: DefaultTableProps) => react_jsx_runtime.JSX.Element;
|
|
110
168
|
|
|
111
|
-
interface DensityToggleButtonProps {
|
|
112
|
-
icon?: React$1.ReactElement;
|
|
113
|
-
text?: string;
|
|
114
|
-
}
|
|
115
|
-
declare const DensityToggleButton: ({ text, icon, }: DensityToggleButtonProps) => react_jsx_runtime.JSX.Element;
|
|
116
|
-
|
|
117
|
-
interface EditFilterButtonProps {
|
|
118
|
-
text?: string;
|
|
119
|
-
title?: string;
|
|
120
|
-
closeText?: string;
|
|
121
|
-
resetText?: string;
|
|
122
|
-
icon?: React.ReactElement;
|
|
123
|
-
}
|
|
124
|
-
declare const EditFilterButton: ({ text, title, closeText, resetText, icon, ...props }: EditFilterButtonProps) => react_jsx_runtime.JSX.Element;
|
|
125
|
-
|
|
126
|
-
interface EditOrderButtonProps {
|
|
127
|
-
title?: string;
|
|
128
|
-
icon?: React$1.ReactElement;
|
|
129
|
-
text?: string;
|
|
130
|
-
}
|
|
131
|
-
declare const EditOrderButton: ({ text, icon, title, }: EditOrderButtonProps) => react_jsx_runtime.JSX.Element;
|
|
132
|
-
|
|
133
|
-
interface EditSortingButtonProps {
|
|
134
|
-
title?: string;
|
|
135
|
-
icon?: React.ReactElement;
|
|
136
|
-
text?: string;
|
|
137
|
-
}
|
|
138
|
-
declare const EditSortingButton: ({ text, icon, title, }: EditSortingButtonProps) => react_jsx_runtime.JSX.Element;
|
|
139
|
-
|
|
140
|
-
interface EditViewButtonProps {
|
|
141
|
-
text?: string;
|
|
142
|
-
icon?: React$1.ReactElement;
|
|
143
|
-
title?: string;
|
|
144
|
-
}
|
|
145
|
-
declare const EditViewButton: ({ text, icon, title, }: EditViewButtonProps) => react_jsx_runtime.JSX.Element;
|
|
146
|
-
|
|
147
|
-
interface FilterOptionsProps {
|
|
148
|
-
column: string;
|
|
149
|
-
}
|
|
150
|
-
declare const FilterOptions: ({ column }: FilterOptionsProps) => react_jsx_runtime.JSX.Element;
|
|
151
|
-
|
|
152
|
-
declare const GlobalFilter: ({ icon }: {
|
|
153
|
-
icon?: react_icons_lib.IconType | undefined;
|
|
154
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
155
|
-
|
|
156
|
-
interface PageSizeControlProps {
|
|
157
|
-
pageSizes?: number[];
|
|
158
|
-
}
|
|
159
|
-
declare const PageSizeControl: ({ pageSizes, }: PageSizeControlProps) => react_jsx_runtime.JSX.Element;
|
|
160
|
-
|
|
161
|
-
interface ResetFilteringButtonProps {
|
|
162
|
-
text?: string;
|
|
163
|
-
}
|
|
164
|
-
declare const ResetFilteringButton: ({ text, }: ResetFilteringButtonProps) => react_jsx_runtime.JSX.Element;
|
|
165
|
-
|
|
166
|
-
interface ResetSelectionButtonProps {
|
|
167
|
-
text?: string;
|
|
168
|
-
}
|
|
169
|
-
declare const ResetSelectionButton: ({ text, }: ResetSelectionButtonProps) => react_jsx_runtime.JSX.Element;
|
|
170
|
-
|
|
171
|
-
interface ResetSortingButtonProps {
|
|
172
|
-
text?: string;
|
|
173
|
-
}
|
|
174
|
-
declare const ResetSortingButton: ({ text, }: ResetSortingButtonProps) => react_jsx_runtime.JSX.Element;
|
|
175
|
-
|
|
176
|
-
declare const RowCountText: () => react_jsx_runtime.JSX.Element;
|
|
177
|
-
|
|
178
169
|
interface TableProps extends TableProps$1 {
|
|
179
170
|
showLoading?: boolean;
|
|
180
171
|
loadingComponent?: JSX.Element;
|
|
@@ -287,22 +278,66 @@ declare const useDataTable: () => {
|
|
|
287
278
|
globalFilter: string;
|
|
288
279
|
setGlobalFilter: (filter: string) => void;
|
|
289
280
|
loading: boolean;
|
|
281
|
+
hasError: boolean;
|
|
290
282
|
};
|
|
291
283
|
|
|
284
|
+
interface FilterOptionsProps {
|
|
285
|
+
column: string;
|
|
286
|
+
}
|
|
287
|
+
declare const FilterOptions: ({ column }: FilterOptionsProps) => react_jsx_runtime.JSX.Element;
|
|
288
|
+
|
|
289
|
+
declare const GlobalFilter: ({ icon }: {
|
|
290
|
+
icon?: react_icons_lib.IconType | undefined;
|
|
291
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
292
|
+
|
|
292
293
|
declare module "@tanstack/react-table" {
|
|
293
294
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
295
|
+
/**
|
|
296
|
+
* The display name of the column, used for rendering headers.
|
|
297
|
+
*/
|
|
294
298
|
displayName?: string;
|
|
295
299
|
/**
|
|
296
|
-
*
|
|
300
|
+
* Specifies the type of filter to be used for the column.
|
|
301
|
+
*
|
|
302
|
+
* @remarks You should provide a proper `filterfn` to handle filtering when choosing `boolean`, `dateRange`, and `custom`.
|
|
303
|
+
*
|
|
304
|
+
* @remarks You should decide `renderFilter` to display filter ui when choosing `custom`.
|
|
305
|
+
*
|
|
306
|
+
* Possible values:
|
|
307
|
+
* - "text": A text input filter.
|
|
308
|
+
* - "range": A numerical range filter.
|
|
309
|
+
* - "select": A dropdown select filter.
|
|
310
|
+
* - "tag": A tag-based filter.
|
|
311
|
+
* - "boolean": A true/false filter.
|
|
312
|
+
* - "dateRange": A date range filter.
|
|
313
|
+
* - "custom": A custom filter function.
|
|
297
314
|
*/
|
|
298
315
|
filterVariant?: "text" | "range" | "select" | "tag" | "boolean" | "dateRange" | "custom";
|
|
316
|
+
/**
|
|
317
|
+
* Options for the select filter variant, if applicable.
|
|
318
|
+
*/
|
|
299
319
|
filterOptions?: string[];
|
|
320
|
+
/**
|
|
321
|
+
* Configuration for the range filter variant, if applicable.
|
|
322
|
+
*
|
|
323
|
+
* Properties:
|
|
324
|
+
* - `min`: Minimum value for the range.
|
|
325
|
+
* - `max`: Maximum value for the range.
|
|
326
|
+
* - `step`: Step increment for the range.
|
|
327
|
+
* - `defaultValue`: Default range values for the filter.
|
|
328
|
+
*/
|
|
300
329
|
filterRangeConfig?: {
|
|
301
330
|
min: number;
|
|
302
331
|
max: number;
|
|
303
332
|
step: number;
|
|
304
333
|
defaultValue: [number, number];
|
|
305
334
|
};
|
|
335
|
+
/**
|
|
336
|
+
* A function that renders the filter component for the column.
|
|
337
|
+
*
|
|
338
|
+
* @param column - The column for which the filter is being rendered.
|
|
339
|
+
* @returns A JSX element representing the filter UI.
|
|
340
|
+
*/
|
|
306
341
|
renderFilter?: (column: Column<TData>) => JSX.Element;
|
|
307
342
|
}
|
|
308
343
|
}
|