better-table 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -120
- package/dist/better-table.cjs.js +1 -1
- package/dist/better-table.cjs.js.map +1 -1
- package/dist/better-table.css +1 -1
- package/dist/better-table.es.js +1643 -1331
- package/dist/better-table.es.js.map +1 -1
- package/dist/components/BetterTable/__tests__/helpers/test-data.d.ts +96 -96
- package/dist/components/BetterTable/components/TableExpandedRow.d.ts +8 -0
- package/dist/components/BetterTable/components/TableRow.d.ts +2 -1
- package/dist/components/BetterTable/components/TableVirtualBody.d.ts +10 -0
- package/dist/components/BetterTable/components/index.d.ts +2 -0
- package/dist/components/BetterTable/constants.d.ts +20 -0
- package/dist/components/BetterTable/context/TableContext.d.ts +15 -80
- package/dist/components/BetterTable/context/TableDataContext.d.ts +18 -0
- package/dist/components/BetterTable/context/TableFilterContext.d.ts +17 -0
- package/dist/components/BetterTable/context/TablePaginationContext.d.ts +19 -0
- package/dist/components/BetterTable/context/TableSelectionContext.d.ts +15 -0
- package/dist/components/BetterTable/context/TableSortContext.d.ts +10 -0
- package/dist/components/BetterTable/context/TableUIContext.d.ts +33 -0
- package/dist/components/BetterTable/context/index.d.ts +14 -2
- package/dist/components/BetterTable/hooks/index.d.ts +4 -0
- package/dist/components/BetterTable/hooks/useColumnResize.d.ts +23 -0
- package/dist/components/BetterTable/hooks/useExpandableRows.d.ts +19 -0
- package/dist/components/BetterTable/hooks/useFocusTrap.d.ts +6 -0
- package/dist/components/BetterTable/hooks/useTableFilter.d.ts +3 -1
- package/dist/components/BetterTable/hooks/useTablePagination.d.ts +3 -1
- package/dist/components/BetterTable/hooks/useTableSearch.d.ts +3 -1
- package/dist/components/BetterTable/hooks/useTableSort.d.ts +3 -1
- package/dist/components/BetterTable/hooks/useVirtualization.d.ts +25 -0
- package/dist/components/BetterTable/index.d.ts +2 -2
- package/dist/components/BetterTable/types.d.ts +58 -0
- package/dist/index.d.ts +4 -4
- package/package.json +19 -14
|
@@ -25,101 +25,101 @@ export declare const getTable: (container: HTMLElement) => HTMLElement;
|
|
|
25
25
|
* Helper para buscar dentro de la tabla tradicional
|
|
26
26
|
*/
|
|
27
27
|
export declare const withinTable: (container: HTMLElement) => {
|
|
28
|
-
getByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
29
|
-
getAllByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
30
|
-
queryByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
31
|
-
queryAllByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
32
|
-
findByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
33
|
-
findAllByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
34
|
-
getByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
35
|
-
getAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
36
|
-
queryByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
37
|
-
queryAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
38
|
-
findByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
39
|
-
findAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
40
|
-
getByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
41
|
-
getAllByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
42
|
-
queryByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
43
|
-
queryAllByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
44
|
-
findByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
45
|
-
findAllByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
46
|
-
getByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
47
|
-
getAllByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
48
|
-
queryByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
49
|
-
queryAllByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
50
|
-
findByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
51
|
-
findAllByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
52
|
-
getByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
53
|
-
getAllByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
54
|
-
queryByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
55
|
-
queryAllByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
56
|
-
findByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
57
|
-
findAllByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
58
|
-
getByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
59
|
-
getAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
60
|
-
queryByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
61
|
-
queryAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
62
|
-
findByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
63
|
-
findAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
64
|
-
getByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/
|
|
65
|
-
getAllByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/
|
|
66
|
-
queryByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/
|
|
67
|
-
queryAllByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/
|
|
68
|
-
findByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/
|
|
69
|
-
findAllByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/
|
|
70
|
-
getByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
71
|
-
getAllByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
72
|
-
queryByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
73
|
-
queryAllByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
74
|
-
findByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
75
|
-
findAllByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/
|
|
28
|
+
getByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined): ReturnType<import('@testing-library/react').GetByText<T>>;
|
|
29
|
+
getAllByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByText<T>>;
|
|
30
|
+
queryByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined): ReturnType<import('@testing-library/react').QueryByText<T>>;
|
|
31
|
+
queryAllByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByText<T>>;
|
|
32
|
+
findByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindByText<T>>;
|
|
33
|
+
findAllByLabelText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindAllByText<T>>;
|
|
34
|
+
getByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').GetByBoundAttribute<T>>;
|
|
35
|
+
getAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByBoundAttribute<T>>;
|
|
36
|
+
queryByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').QueryByBoundAttribute<T>>;
|
|
37
|
+
queryAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByBoundAttribute<T>>;
|
|
38
|
+
findByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindByBoundAttribute<T>>;
|
|
39
|
+
findAllByPlaceholderText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindAllByBoundAttribute<T>>;
|
|
40
|
+
getByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined): ReturnType<import('@testing-library/react').GetByText<T>>;
|
|
41
|
+
getAllByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByText<T>>;
|
|
42
|
+
queryByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined): ReturnType<import('@testing-library/react').QueryByText<T>>;
|
|
43
|
+
queryAllByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByText<T>>;
|
|
44
|
+
findByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindByText<T>>;
|
|
45
|
+
findAllByText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindAllByText<T>>;
|
|
46
|
+
getByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').GetByBoundAttribute<T>>;
|
|
47
|
+
getAllByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByBoundAttribute<T>>;
|
|
48
|
+
queryByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').QueryByBoundAttribute<T>>;
|
|
49
|
+
queryAllByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByBoundAttribute<T>>;
|
|
50
|
+
findByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindByBoundAttribute<T>>;
|
|
51
|
+
findAllByAltText<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindAllByBoundAttribute<T>>;
|
|
52
|
+
getByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').GetByBoundAttribute<T>>;
|
|
53
|
+
getAllByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByBoundAttribute<T>>;
|
|
54
|
+
queryByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').QueryByBoundAttribute<T>>;
|
|
55
|
+
queryAllByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByBoundAttribute<T>>;
|
|
56
|
+
findByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindByBoundAttribute<T>>;
|
|
57
|
+
findAllByTitle<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindAllByBoundAttribute<T>>;
|
|
58
|
+
getByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').GetByBoundAttribute<T>>;
|
|
59
|
+
getAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByBoundAttribute<T>>;
|
|
60
|
+
queryByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').QueryByBoundAttribute<T>>;
|
|
61
|
+
queryAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByBoundAttribute<T>>;
|
|
62
|
+
findByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindByBoundAttribute<T>>;
|
|
63
|
+
findAllByDisplayValue<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindAllByBoundAttribute<T>>;
|
|
64
|
+
getByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined): ReturnType<import('@testing-library/react').GetByRole<T>>;
|
|
65
|
+
getAllByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined): ReturnType<import('@testing-library/react').AllByRole<T>>;
|
|
66
|
+
queryByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined): ReturnType<import('@testing-library/react').QueryByRole<T>>;
|
|
67
|
+
queryAllByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined): ReturnType<import('@testing-library/react').AllByRole<T>>;
|
|
68
|
+
findByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindByRole<T>>;
|
|
69
|
+
findAllByRole<T extends HTMLElement = HTMLElement>(role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindAllByRole<T>>;
|
|
70
|
+
getByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').GetByBoundAttribute<T>>;
|
|
71
|
+
getAllByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByBoundAttribute<T>>;
|
|
72
|
+
queryByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').QueryByBoundAttribute<T>>;
|
|
73
|
+
queryAllByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined): ReturnType<import('@testing-library/react').AllByBoundAttribute<T>>;
|
|
74
|
+
findByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindByBoundAttribute<T>>;
|
|
75
|
+
findAllByTestId<T extends HTMLElement = HTMLElement>(id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined): ReturnType<import('@testing-library/react').FindAllByBoundAttribute<T>>;
|
|
76
76
|
} & {
|
|
77
|
-
getByLabelText: (id: import('@testing-library/
|
|
78
|
-
getAllByLabelText: (id: import('@testing-library/
|
|
79
|
-
queryByLabelText: (id: import('@testing-library/
|
|
80
|
-
queryAllByLabelText: (id: import('@testing-library/
|
|
81
|
-
findByLabelText: (id: import('@testing-library/
|
|
82
|
-
findAllByLabelText: (id: import('@testing-library/
|
|
83
|
-
getByPlaceholderText: (id: import('@testing-library/
|
|
84
|
-
getAllByPlaceholderText: (id: import('@testing-library/
|
|
85
|
-
queryByPlaceholderText: (id: import('@testing-library/
|
|
86
|
-
queryAllByPlaceholderText: (id: import('@testing-library/
|
|
87
|
-
findByPlaceholderText: (id: import('@testing-library/
|
|
88
|
-
findAllByPlaceholderText: (id: import('@testing-library/
|
|
89
|
-
getByText: (id: import('@testing-library/
|
|
90
|
-
getAllByText: (id: import('@testing-library/
|
|
91
|
-
queryByText: (id: import('@testing-library/
|
|
92
|
-
queryAllByText: (id: import('@testing-library/
|
|
93
|
-
findByText: (id: import('@testing-library/
|
|
94
|
-
findAllByText: (id: import('@testing-library/
|
|
95
|
-
getByAltText: (id: import('@testing-library/
|
|
96
|
-
getAllByAltText: (id: import('@testing-library/
|
|
97
|
-
queryByAltText: (id: import('@testing-library/
|
|
98
|
-
queryAllByAltText: (id: import('@testing-library/
|
|
99
|
-
findByAltText: (id: import('@testing-library/
|
|
100
|
-
findAllByAltText: (id: import('@testing-library/
|
|
101
|
-
getByTitle: (id: import('@testing-library/
|
|
102
|
-
getAllByTitle: (id: import('@testing-library/
|
|
103
|
-
queryByTitle: (id: import('@testing-library/
|
|
104
|
-
queryAllByTitle: (id: import('@testing-library/
|
|
105
|
-
findByTitle: (id: import('@testing-library/
|
|
106
|
-
findAllByTitle: (id: import('@testing-library/
|
|
107
|
-
getByDisplayValue: (id: import('@testing-library/
|
|
108
|
-
getAllByDisplayValue: (id: import('@testing-library/
|
|
109
|
-
queryByDisplayValue: (id: import('@testing-library/
|
|
110
|
-
queryAllByDisplayValue: (id: import('@testing-library/
|
|
111
|
-
findByDisplayValue: (id: import('@testing-library/
|
|
112
|
-
findAllByDisplayValue: (id: import('@testing-library/
|
|
113
|
-
getByRole: (role: import('@testing-library/
|
|
114
|
-
getAllByRole: (role: import('@testing-library/
|
|
115
|
-
queryByRole: (role: import('@testing-library/
|
|
116
|
-
queryAllByRole: (role: import('@testing-library/
|
|
117
|
-
findByRole: (role: import('@testing-library/
|
|
118
|
-
findAllByRole: (role: import('@testing-library/
|
|
119
|
-
getByTestId: (id: import('@testing-library/
|
|
120
|
-
getAllByTestId: (id: import('@testing-library/
|
|
121
|
-
queryByTestId: (id: import('@testing-library/
|
|
122
|
-
queryAllByTestId: (id: import('@testing-library/
|
|
123
|
-
findByTestId: (id: import('@testing-library/
|
|
124
|
-
findAllByTestId: (id: import('@testing-library/
|
|
77
|
+
getByLabelText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined) => HTMLElement;
|
|
78
|
+
getAllByLabelText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
79
|
+
queryByLabelText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
80
|
+
queryAllByLabelText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
81
|
+
findByLabelText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement>;
|
|
82
|
+
findAllByLabelText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
83
|
+
getByPlaceholderText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement;
|
|
84
|
+
getAllByPlaceholderText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement[];
|
|
85
|
+
queryByPlaceholderText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement | null;
|
|
86
|
+
queryAllByPlaceholderText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement[];
|
|
87
|
+
findByPlaceholderText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement>;
|
|
88
|
+
findAllByPlaceholderText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
89
|
+
getByText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined) => HTMLElement;
|
|
90
|
+
getAllByText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
91
|
+
queryByText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
92
|
+
queryAllByText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
93
|
+
findByText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement>;
|
|
94
|
+
findAllByText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
95
|
+
getByAltText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement;
|
|
96
|
+
getAllByAltText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement[];
|
|
97
|
+
queryByAltText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement | null;
|
|
98
|
+
queryAllByAltText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement[];
|
|
99
|
+
findByAltText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement>;
|
|
100
|
+
findAllByAltText: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
101
|
+
getByTitle: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement;
|
|
102
|
+
getAllByTitle: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement[];
|
|
103
|
+
queryByTitle: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement | null;
|
|
104
|
+
queryAllByTitle: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement[];
|
|
105
|
+
findByTitle: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement>;
|
|
106
|
+
findAllByTitle: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
107
|
+
getByDisplayValue: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement;
|
|
108
|
+
getAllByDisplayValue: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement[];
|
|
109
|
+
queryByDisplayValue: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement | null;
|
|
110
|
+
queryAllByDisplayValue: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement[];
|
|
111
|
+
findByDisplayValue: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement>;
|
|
112
|
+
findAllByDisplayValue: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
113
|
+
getByRole: (role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined) => HTMLElement;
|
|
114
|
+
getAllByRole: (role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined) => HTMLElement[];
|
|
115
|
+
queryByRole: (role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined) => HTMLElement | null;
|
|
116
|
+
queryAllByRole: (role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined) => HTMLElement[];
|
|
117
|
+
findByRole: (role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement>;
|
|
118
|
+
findAllByRole: (role: import('@testing-library/react').ByRoleMatcher, options?: import('@testing-library/react').ByRoleOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
119
|
+
getByTestId: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement;
|
|
120
|
+
getAllByTestId: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement[];
|
|
121
|
+
queryByTestId: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement | null;
|
|
122
|
+
queryAllByTestId: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined) => HTMLElement[];
|
|
123
|
+
findByTestId: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement>;
|
|
124
|
+
findAllByTestId: (id: import('@testing-library/react').Matcher, options?: import('@testing-library/react').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/react').waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
125
125
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableData } from '../types';
|
|
2
|
+
interface TableExpandedRowProps<T extends TableData> {
|
|
3
|
+
row: T;
|
|
4
|
+
rowIndex: number;
|
|
5
|
+
}
|
|
6
|
+
declare function TableExpandedRowInner<T extends TableData>({ row, rowIndex }: TableExpandedRowProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare const TableExpandedRow: typeof TableExpandedRowInner;
|
|
8
|
+
export {};
|
|
@@ -2,7 +2,8 @@ import { TableData } from '../types';
|
|
|
2
2
|
interface TableRowProps<T extends TableData> {
|
|
3
3
|
row: T;
|
|
4
4
|
rowIndex: number;
|
|
5
|
+
rowKey: string;
|
|
5
6
|
}
|
|
6
|
-
declare function TableRowInner<T extends TableData>({ row, rowIndex }: TableRowProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function TableRowInner<T extends TableData>({ row, rowIndex, rowKey }: TableRowProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export declare const TableRow: typeof TableRowInner;
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TableData } from '../types';
|
|
2
|
+
interface TableVirtualBodyProps {
|
|
3
|
+
startIndex: number;
|
|
4
|
+
endIndex: number;
|
|
5
|
+
totalHeight: number;
|
|
6
|
+
offsetTop: number;
|
|
7
|
+
}
|
|
8
|
+
declare function TableVirtualBodyInner<T extends TableData>({ startIndex, endIndex, totalHeight, offsetTop, }: TableVirtualBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const TableVirtualBody: typeof TableVirtualBodyInner;
|
|
10
|
+
export {};
|
|
@@ -15,4 +15,6 @@ export { TableToolbar } from './TableToolbar';
|
|
|
15
15
|
export { TableEmpty } from './TableEmpty';
|
|
16
16
|
export { TableLoading, TableLoadingOverlay } from './TableLoading';
|
|
17
17
|
export { TableModal } from './TableModal';
|
|
18
|
+
export { TableVirtualBody } from './TableVirtualBody';
|
|
19
|
+
export { TableExpandedRow } from './TableExpandedRow';
|
|
18
20
|
export { BetterTable, default } from './Table';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Virtualization constants
|
|
3
|
+
*
|
|
4
|
+
* VIRTUALIZATION_THRESHOLD: Minimum number of rows to auto-enable virtualization
|
|
5
|
+
* when pagination is disabled. Below this threshold, all rows render normally.
|
|
6
|
+
* Above it, only visible rows + buffer are rendered for performance.
|
|
7
|
+
*
|
|
8
|
+
* To change this value, update it here — it's the single source of truth.
|
|
9
|
+
*/
|
|
10
|
+
export declare const VIRTUALIZATION_THRESHOLD = 500;
|
|
11
|
+
/**
|
|
12
|
+
* Default fixed row height in pixels for virtualized rendering.
|
|
13
|
+
* Assumes uniform row height (variable height is not supported yet).
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_ROW_HEIGHT = 48;
|
|
16
|
+
/**
|
|
17
|
+
* Number of extra rows rendered above and below the visible viewport
|
|
18
|
+
* to prevent flicker during fast scrolling.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEFAULT_VIRTUAL_BUFFER = 5;
|
|
@@ -1,83 +1,18 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { TableData
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
clearSort: () => void;
|
|
17
|
-
columnVisibilityEnabled: boolean;
|
|
18
|
-
hiddenColumnIds: Set<string>;
|
|
19
|
-
toggleColumn: (columnId: string) => void;
|
|
20
|
-
showAllColumns: () => void;
|
|
21
|
-
isColumnVisible: (columnId: string) => boolean;
|
|
22
|
-
filters: FilterState;
|
|
23
|
-
setFilter: (columnId: string, value: string | number | boolean | import('../types').DateFilterRange | null) => void;
|
|
24
|
-
clearFilter: (columnId: string) => void;
|
|
25
|
-
clearFilters: () => void;
|
|
26
|
-
searchValue: string;
|
|
27
|
-
handleSearch: (value: string) => void;
|
|
28
|
-
clearSearch: () => void;
|
|
29
|
-
searchable: boolean;
|
|
30
|
-
selectedRows: T[];
|
|
31
|
-
isSelected: (row: T, index: number) => boolean;
|
|
32
|
-
toggleRow: (row: T, index: number) => void;
|
|
33
|
-
selectAll: () => void;
|
|
34
|
-
deselectAll: () => void;
|
|
35
|
-
isAllSelected: boolean;
|
|
36
|
-
isPartiallySelected: boolean;
|
|
37
|
-
selectedCount: number;
|
|
38
|
-
selectable: boolean;
|
|
39
|
-
selectionMode: 'single' | 'multiple';
|
|
40
|
-
page: number;
|
|
41
|
-
pageSize: number;
|
|
42
|
-
totalPages: number;
|
|
43
|
-
totalItems: number;
|
|
44
|
-
goToPage: (page: number) => void;
|
|
45
|
-
nextPage: () => void;
|
|
46
|
-
prevPage: () => void;
|
|
47
|
-
changePageSize: (size: number) => void;
|
|
48
|
-
hasNextPage: boolean;
|
|
49
|
-
hasPrevPage: boolean;
|
|
50
|
-
startIndex: number;
|
|
51
|
-
endIndex: number;
|
|
52
|
-
paginationEnabled: boolean;
|
|
53
|
-
pageSizeOptions: number[];
|
|
54
|
-
showSizeChanger: boolean;
|
|
55
|
-
loading: boolean;
|
|
56
|
-
loadingComponent?: ReactNode;
|
|
57
|
-
emptyComponent?: ReactNode;
|
|
58
|
-
locale: TableLocale;
|
|
59
|
-
classNames: TableClassNames;
|
|
60
|
-
size: 'small' | 'medium' | 'large';
|
|
61
|
-
bordered: boolean;
|
|
62
|
-
striped: boolean;
|
|
63
|
-
hoverable: boolean;
|
|
64
|
-
stickyHeader: boolean;
|
|
65
|
-
onRowClick?: (row: T, rowIndex: number) => void;
|
|
66
|
-
onRowDoubleClick?: (row: T, rowIndex: number) => void;
|
|
67
|
-
filterPanelOpen: boolean;
|
|
68
|
-
toggleFilterPanel: () => void;
|
|
69
|
-
hasFilterableColumns: boolean;
|
|
70
|
-
filterMode: 'floating' | 'panel' | 'both';
|
|
71
|
-
openModal: (content: ReactNode) => void;
|
|
72
|
-
closeModal: () => void;
|
|
73
|
-
modalContent: ReactNode | null;
|
|
74
|
-
isModalOpen: boolean;
|
|
75
|
-
}
|
|
76
|
-
export declare function useTableContext<T extends TableData>(): TableContextValue<T>;
|
|
77
|
-
interface TableProviderProps<T extends TableData> {
|
|
78
|
-
value: TableContextValue<T>;
|
|
2
|
+
import { TableData } from '../types';
|
|
3
|
+
import { TableDataContextValue } from './TableDataContext';
|
|
4
|
+
import { TableSortContextValue } from './TableSortContext';
|
|
5
|
+
import { TableFilterContextValue } from './TableFilterContext';
|
|
6
|
+
import { TableSelectionContextValue } from './TableSelectionContext';
|
|
7
|
+
import { TablePaginationContextValue } from './TablePaginationContext';
|
|
8
|
+
import { TableUIContextValue } from './TableUIContext';
|
|
9
|
+
export interface TableProviderProps<T extends TableData = TableData> {
|
|
10
|
+
data: TableDataContextValue<T>;
|
|
11
|
+
sort: TableSortContextValue;
|
|
12
|
+
filter: TableFilterContextValue;
|
|
13
|
+
selection: TableSelectionContextValue<T>;
|
|
14
|
+
pagination: TablePaginationContextValue;
|
|
15
|
+
ui: TableUIContextValue<T>;
|
|
79
16
|
children: ReactNode;
|
|
80
17
|
}
|
|
81
|
-
export declare function TableProvider<T extends TableData>({
|
|
82
|
-
export declare const defaultTableContext: Partial<TableContextValue>;
|
|
83
|
-
export {};
|
|
18
|
+
export declare function TableProvider<T extends TableData>({ data, sort, filter, selection, pagination, ui, children, }: TableProviderProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TableData, Column, RowAction, GlobalAction } from '../types';
|
|
3
|
+
export interface TableDataContextValue<T extends TableData = TableData> {
|
|
4
|
+
data: T[];
|
|
5
|
+
processedData: T[];
|
|
6
|
+
columns: Column<T>[];
|
|
7
|
+
visibleColumns: Column<T>[];
|
|
8
|
+
rowKey: keyof T | ((row: T, index: number) => string);
|
|
9
|
+
rowActions?: RowAction<T>[];
|
|
10
|
+
globalActions?: GlobalAction<T>[];
|
|
11
|
+
maxVisibleActions: number;
|
|
12
|
+
expandableRender?: (row: T, rowIndex: number) => ReactNode;
|
|
13
|
+
isExpanded: (rowKey: string) => boolean;
|
|
14
|
+
toggleExpand: (rowKey: string) => void;
|
|
15
|
+
expandableEnabled: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function useTableData<T extends TableData>(): TableDataContextValue<T>;
|
|
18
|
+
export declare const TableDataProvider: import('react').Provider<TableDataContextValue<TableData> | null>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FilterState, DateFilterRange } from '../types';
|
|
2
|
+
export interface TableFilterContextValue {
|
|
3
|
+
filters: FilterState;
|
|
4
|
+
setFilter: (columnId: string, value: string | number | boolean | DateFilterRange | null) => void;
|
|
5
|
+
clearFilter: (columnId: string) => void;
|
|
6
|
+
clearFilters: () => void;
|
|
7
|
+
searchValue: string;
|
|
8
|
+
handleSearch: (value: string) => void;
|
|
9
|
+
clearSearch: () => void;
|
|
10
|
+
searchable: boolean;
|
|
11
|
+
filterPanelOpen: boolean;
|
|
12
|
+
toggleFilterPanel: () => void;
|
|
13
|
+
hasFilterableColumns: boolean;
|
|
14
|
+
filterMode: 'floating' | 'panel' | 'both';
|
|
15
|
+
}
|
|
16
|
+
export declare function useTableFilterContext(): TableFilterContextValue;
|
|
17
|
+
export declare const TableFilterProvider: import('react').Provider<TableFilterContextValue | null>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface TablePaginationContextValue {
|
|
2
|
+
page: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
totalPages: number;
|
|
5
|
+
totalItems: number;
|
|
6
|
+
goToPage: (page: number) => void;
|
|
7
|
+
nextPage: () => void;
|
|
8
|
+
prevPage: () => void;
|
|
9
|
+
changePageSize: (size: number) => void;
|
|
10
|
+
hasNextPage: boolean;
|
|
11
|
+
hasPrevPage: boolean;
|
|
12
|
+
startIndex: number;
|
|
13
|
+
endIndex: number;
|
|
14
|
+
paginationEnabled: boolean;
|
|
15
|
+
pageSizeOptions: number[];
|
|
16
|
+
showSizeChanger: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function useTablePaginationContext(): TablePaginationContextValue;
|
|
19
|
+
export declare const TablePaginationProvider: import('react').Provider<TablePaginationContextValue | null>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TableData } from '../types';
|
|
2
|
+
export interface TableSelectionContextValue<T extends TableData = TableData> {
|
|
3
|
+
selectedRows: T[];
|
|
4
|
+
isSelected: (row: T, index: number) => boolean;
|
|
5
|
+
toggleRow: (row: T, index: number) => void;
|
|
6
|
+
selectAll: () => void;
|
|
7
|
+
deselectAll: () => void;
|
|
8
|
+
isAllSelected: boolean;
|
|
9
|
+
isPartiallySelected: boolean;
|
|
10
|
+
selectedCount: number;
|
|
11
|
+
selectable: boolean;
|
|
12
|
+
selectionMode: 'single' | 'multiple';
|
|
13
|
+
}
|
|
14
|
+
export declare function useTableSelectionContext<T extends TableData>(): TableSelectionContextValue<T>;
|
|
15
|
+
export declare const TableSelectionProvider: import('react').Provider<TableSelectionContextValue<TableData> | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SortState, MultiSortState } from '../types';
|
|
2
|
+
export interface TableSortContextValue {
|
|
3
|
+
sortState: SortState;
|
|
4
|
+
handleSort: (columnId: string) => void;
|
|
5
|
+
multiSortState: MultiSortState;
|
|
6
|
+
isMultiSort: boolean;
|
|
7
|
+
clearSort: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useTableSortContext(): TableSortContextValue;
|
|
10
|
+
export declare const TableSortProvider: import('react').Provider<TableSortContextValue | null>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TableData, TableLocale, TableClassNames, Column } from '../types';
|
|
3
|
+
export interface TableUIContextValue<T extends TableData = TableData> {
|
|
4
|
+
locale: TableLocale;
|
|
5
|
+
classNames: TableClassNames;
|
|
6
|
+
size: 'small' | 'medium' | 'large';
|
|
7
|
+
bordered: boolean;
|
|
8
|
+
striped: boolean;
|
|
9
|
+
hoverable: boolean;
|
|
10
|
+
stickyHeader: boolean;
|
|
11
|
+
loading: boolean;
|
|
12
|
+
loadingComponent?: ReactNode;
|
|
13
|
+
emptyComponent?: ReactNode;
|
|
14
|
+
onRowClick?: (row: T, rowIndex: number) => void;
|
|
15
|
+
onRowDoubleClick?: (row: T, rowIndex: number) => void;
|
|
16
|
+
openModal: (content: ReactNode) => void;
|
|
17
|
+
closeModal: () => void;
|
|
18
|
+
modalContent: ReactNode | null;
|
|
19
|
+
isModalOpen: boolean;
|
|
20
|
+
columnVisibilityEnabled: boolean;
|
|
21
|
+
hiddenColumnIds: Set<string>;
|
|
22
|
+
toggleColumn: (columnId: string) => void;
|
|
23
|
+
showAllColumns: () => void;
|
|
24
|
+
isColumnVisible: (columnId: string) => boolean;
|
|
25
|
+
columns: Column<T>[];
|
|
26
|
+
resizable: boolean;
|
|
27
|
+
columnWidths: Record<string, number>;
|
|
28
|
+
isResizing: boolean;
|
|
29
|
+
startResize: (columnId: string, startX: number) => void;
|
|
30
|
+
getColumnWidth: (columnId: string) => number | undefined;
|
|
31
|
+
}
|
|
32
|
+
export declare function useTableUI<T extends TableData>(): TableUIContextValue<T>;
|
|
33
|
+
export declare const TableUIProvider: import('react').Provider<TableUIContextValue<TableData> | null>;
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
export { TableProvider
|
|
2
|
-
export type {
|
|
1
|
+
export { TableProvider } from './TableContext';
|
|
2
|
+
export type { TableProviderProps } from './TableContext';
|
|
3
|
+
export { useTableData } from './TableDataContext';
|
|
4
|
+
export type { TableDataContextValue } from './TableDataContext';
|
|
5
|
+
export { useTableSortContext } from './TableSortContext';
|
|
6
|
+
export type { TableSortContextValue } from './TableSortContext';
|
|
7
|
+
export { useTableFilterContext } from './TableFilterContext';
|
|
8
|
+
export type { TableFilterContextValue } from './TableFilterContext';
|
|
9
|
+
export { useTableSelectionContext } from './TableSelectionContext';
|
|
10
|
+
export type { TableSelectionContextValue } from './TableSelectionContext';
|
|
11
|
+
export { useTablePaginationContext } from './TablePaginationContext';
|
|
12
|
+
export type { TablePaginationContextValue } from './TablePaginationContext';
|
|
13
|
+
export { useTableUI } from './TableUIContext';
|
|
14
|
+
export type { TableUIContextValue } from './TableUIContext';
|
|
@@ -4,4 +4,8 @@ export { useTablePagination } from './useTablePagination';
|
|
|
4
4
|
export { useTableSelection } from './useTableSelection';
|
|
5
5
|
export { useTableSearch } from './useTableSearch';
|
|
6
6
|
export { useColumnVisibility } from './useColumnVisibility';
|
|
7
|
+
export { useColumnResize } from './useColumnResize';
|
|
7
8
|
export { useMediaQuery } from './useMediaQuery';
|
|
9
|
+
export { useFocusTrap } from './useFocusTrap';
|
|
10
|
+
export { useVirtualization } from './useVirtualization';
|
|
11
|
+
export { useExpandableRows } from './useExpandableRows';
|