rez-table-listing-mui 1.2.19 → 1.3.1
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/package.json +2 -3
- package/src/index.ts +1 -0
- package/src/listing/components/common/loader/loader.tsx +1 -0
- package/src/listing/components/filter/components/attributes-filter.tsx +3 -91
- package/src/listing/components/filter/components/forms/components/Date.tsx +2 -2
- package/src/listing/components/filter/components/forms/components/Dropdown.tsx +2 -2
- package/src/listing/components/filter/components/forms/components/Filter-criteria.tsx +31 -82
- package/src/listing/components/filter/components/forms/components/Multi-Select.tsx +2 -2
- package/src/listing/components/filter/components/forms/components/Select.tsx +2 -2
- package/src/listing/components/filter/components/forms/components/Textfield.tsx +2 -2
- package/src/listing/components/filter/components/forms/components/empty-list.tsx +17 -0
- package/src/listing/components/filter/components/forms/components/filter-criteria-entity-list.tsx +92 -0
- package/src/listing/components/filter/components/forms/components/filter-criteria-list.tsx +104 -0
- package/src/listing/components/filter/components/forms/components/styles.tsx +2 -1
- package/src/listing/components/filter/components/forms/index.tsx +238 -174
- package/src/listing/components/filter/components/main-filter.tsx +6 -14
- package/src/listing/components/filter/components/saved-edit-filter.tsx +0 -31
- package/src/listing/components/filter/components/saved-filter.tsx +0 -22
- package/src/listing/components/filter/components/search/index.tsx +2 -2
- package/src/listing/components/filter/index.tsx +162 -130
- package/src/listing/components/filter/style.ts +20 -3
- package/src/listing/libs/hooks/useCraftTable.tsx +9 -0
- package/src/listing/libs/hooks/useEntityTableAPI.tsx +25 -0
- package/src/listing/libs/utils/apiColumn.ts +27 -1
- package/src/listing/libs/utils/deep-merge-objects.ts +18 -0
- package/src/listing/types/common.ts +0 -2
- package/src/listing/types/filter.ts +54 -7
- package/src/listing/types/table-options.ts +8 -0
- package/src/view/FIlterWrapper.tsx +45 -6
- package/dist/index.d.ts +0 -361
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -1
|
@@ -62,6 +62,30 @@ export interface FilterDropdownDataProps {
|
|
|
62
62
|
[key: string]: FilterOperationListProps[];
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
export interface FilterComponentOptionsMainFilterOptions {
|
|
66
|
+
showSaveButton?: boolean;
|
|
67
|
+
showClearAllButton?: boolean;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type FilterComponentOptions =
|
|
71
|
+
| {
|
|
72
|
+
showMainHeader?: boolean;
|
|
73
|
+
showTabs?: true; // when true → additional fields allowed
|
|
74
|
+
showMainFilter?: boolean;
|
|
75
|
+
showSavedFilter?: boolean;
|
|
76
|
+
showAttributesFilter?: boolean;
|
|
77
|
+
tabOptions?: {
|
|
78
|
+
mainFilter?: FilterComponentOptionsMainFilterOptions;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
| {
|
|
82
|
+
showMainHeader?: boolean;
|
|
83
|
+
showTabs?: false; // explicitly false or omitted
|
|
84
|
+
tabOptions?: {
|
|
85
|
+
mainFilter?: FilterComponentOptionsMainFilterOptions;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
|
|
65
89
|
export interface FilterDrawerProps {
|
|
66
90
|
tableStates: CraftTableOptionsProps;
|
|
67
91
|
open?: boolean;
|
|
@@ -84,6 +108,7 @@ export interface FilterDrawerProps {
|
|
|
84
108
|
updatedFilters,
|
|
85
109
|
filterMaster,
|
|
86
110
|
}: onFilterChangeFunctionProps) => void;
|
|
111
|
+
filterComponentOptions?: FilterComponentOptions;
|
|
87
112
|
}
|
|
88
113
|
|
|
89
114
|
export interface FilterCriteria {
|
|
@@ -107,9 +132,6 @@ export interface FilterStateProps {
|
|
|
107
132
|
filter_attribute: string;
|
|
108
133
|
filter_operator: string;
|
|
109
134
|
filter_value: string | string[];
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export interface UpdatedFilterStateProps extends FilterStateProps {
|
|
113
135
|
id: string | number;
|
|
114
136
|
name: string | undefined;
|
|
115
137
|
data_type: FilterInputDataTypes | undefined;
|
|
@@ -122,6 +144,8 @@ export interface UpdatedFilterStateProps extends FilterStateProps {
|
|
|
122
144
|
label?: string | undefined;
|
|
123
145
|
value?: string | undefined;
|
|
124
146
|
};
|
|
147
|
+
filter_entity_type?: string;
|
|
148
|
+
filter_entity_name?: string;
|
|
125
149
|
}
|
|
126
150
|
|
|
127
151
|
interface FilterDetail {
|
|
@@ -171,10 +195,6 @@ export interface FilterFormComponentProps {
|
|
|
171
195
|
columnsData: FilterColumnsDataProps;
|
|
172
196
|
dropdownData: FilterDropdownDataProps;
|
|
173
197
|
tableStates: CraftTableOptionsProps;
|
|
174
|
-
selectedFilters: UpdatedFilterStateProps[];
|
|
175
|
-
setSelectedFilters: React.Dispatch<
|
|
176
|
-
React.SetStateAction<UpdatedFilterStateProps[]>
|
|
177
|
-
>;
|
|
178
198
|
editMode?: boolean;
|
|
179
199
|
setEditMode?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
180
200
|
setDeleteFilterModalOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -184,6 +204,7 @@ export interface FilterFormComponentProps {
|
|
|
184
204
|
updatedFilters,
|
|
185
205
|
filterMaster,
|
|
186
206
|
}: onFilterChangeFunctionProps) => void;
|
|
207
|
+
filterComponentOptions?: FilterComponentOptions;
|
|
187
208
|
}
|
|
188
209
|
|
|
189
210
|
export interface FilterMasterStateProps {
|
|
@@ -224,3 +245,29 @@ export interface viewSettingsPayload {
|
|
|
224
245
|
column: string;
|
|
225
246
|
sort_by: string;
|
|
226
247
|
}
|
|
248
|
+
|
|
249
|
+
export interface FilterDataMainFilterEntityListProps {
|
|
250
|
+
value: string;
|
|
251
|
+
id: string | number;
|
|
252
|
+
label: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface FilterDataMainFilterEntityWiseCriteriaProps {
|
|
256
|
+
id: string;
|
|
257
|
+
name: string;
|
|
258
|
+
attribute_key: string;
|
|
259
|
+
element_type: FilterInputDataTypes;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface FilterDataProps {
|
|
263
|
+
mainFilter?: {
|
|
264
|
+
entityList?: {
|
|
265
|
+
data?: FilterDataMainFilterEntityListProps[];
|
|
266
|
+
isPending?: boolean;
|
|
267
|
+
};
|
|
268
|
+
entityWiseCriteria?: {
|
|
269
|
+
data?: FilterDataMainFilterEntityWiseCriteriaProps[];
|
|
270
|
+
isPending?: boolean;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
}
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
} from "@tanstack/react-table";
|
|
8
8
|
import { Dispatch, SetStateAction } from "react";
|
|
9
9
|
import {
|
|
10
|
+
FilterDataMainFilterEntityListProps,
|
|
11
|
+
FilterDataProps,
|
|
10
12
|
FilterMasterStateProps,
|
|
11
13
|
FilterOperationListProps,
|
|
12
14
|
FilterStateProps,
|
|
@@ -48,6 +50,12 @@ export interface CraftTableOptionsProps {
|
|
|
48
50
|
setShowFilterOption: Dispatch<SetStateAction<boolean>>;
|
|
49
51
|
columnPinning: ColumnPinningState;
|
|
50
52
|
setColumnPinning: Dispatch<SetStateAction<ColumnPinningState>>;
|
|
53
|
+
filterData: FilterDataProps | null;
|
|
54
|
+
setFilterData: Dispatch<SetStateAction<FilterDataProps | null>>;
|
|
55
|
+
selectedFilterEntity: FilterDataMainFilterEntityListProps | undefined;
|
|
56
|
+
setSelectedFilterEntity: Dispatch<
|
|
57
|
+
SetStateAction<FilterDataMainFilterEntityListProps | undefined>
|
|
58
|
+
>;
|
|
51
59
|
}
|
|
52
60
|
|
|
53
61
|
export interface craftTableFilterSettingsOptionsProps {
|
|
@@ -1,28 +1,66 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
|
-
import { CraftTableFilter } from "..";
|
|
2
|
+
import { CraftTableFilter, CraftTableOptionsProps } from "..";
|
|
3
3
|
import { useGetNavigationLayoutAPI } from "../listing/libs/hooks/useGetNavigationLayoutAPI";
|
|
4
4
|
import { ENTITY_TYPE } from "../listing/libs/utils/common";
|
|
5
5
|
import {
|
|
6
6
|
useDeleteFilterAPI,
|
|
7
|
+
useGetFilterEntityList,
|
|
7
8
|
useSavedFilterAPI,
|
|
8
9
|
useUpdateFilterAPI,
|
|
9
10
|
} from "../listing/libs/hooks/useEntityTableAPI";
|
|
10
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
FilterColumnsDataProps,
|
|
13
|
+
FilterComponentOptions,
|
|
14
|
+
FilterDropdownDataProps,
|
|
15
|
+
FilterDataProps,
|
|
16
|
+
FilterMasterStateProps,
|
|
17
|
+
} from "../listing/types/filter";
|
|
18
|
+
import { onFilterChangeFunctionProps } from "../listing/types/common";
|
|
11
19
|
|
|
12
20
|
const CraftTableFilterWrapper = ({
|
|
13
21
|
tableStates,
|
|
14
22
|
dropdownData,
|
|
15
23
|
onChangeFunction,
|
|
16
24
|
columnsData,
|
|
17
|
-
|
|
25
|
+
filterComponentOptions,
|
|
26
|
+
}: {
|
|
27
|
+
tableStates: CraftTableOptionsProps;
|
|
28
|
+
columnsData: FilterColumnsDataProps;
|
|
29
|
+
dropdownData: FilterDropdownDataProps;
|
|
30
|
+
onChangeFunction: ({
|
|
31
|
+
updatedFilters,
|
|
32
|
+
filterMaster,
|
|
33
|
+
}: onFilterChangeFunctionProps) => void;
|
|
34
|
+
filterComponentOptions?: FilterComponentOptions;
|
|
35
|
+
}) => {
|
|
18
36
|
const getNavigationLayoutQuery = useGetNavigationLayoutAPI(ENTITY_TYPE);
|
|
19
37
|
|
|
20
|
-
const {
|
|
21
|
-
|
|
38
|
+
const {
|
|
39
|
+
filters,
|
|
40
|
+
filterMaster,
|
|
41
|
+
setFilterMaster,
|
|
42
|
+
filterToDelete,
|
|
43
|
+
setFilterData,
|
|
44
|
+
} = tableStates;
|
|
22
45
|
|
|
23
46
|
const { savedMutation } = useSavedFilterAPI(); //API CALL FOR SAVED FILTER
|
|
24
47
|
const { updateMutation } = useUpdateFilterAPI(); //API FOR UPDATE FILTER
|
|
25
48
|
const { deleteMutation } = useDeleteFilterAPI(tableStates); //API FOR DELETING FILTER
|
|
49
|
+
const filterEntityList: any = useGetFilterEntityList({
|
|
50
|
+
entity_type: ENTITY_TYPE,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (filterEntityList?.data) {
|
|
55
|
+
setFilterData((prev: FilterDataProps | null) => ({
|
|
56
|
+
...prev,
|
|
57
|
+
mainFilter: {
|
|
58
|
+
...prev?.mainFilter,
|
|
59
|
+
entityList: filterEntityList?.data,
|
|
60
|
+
},
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
}, [filterEntityList?.data, filterEntityList?.isPending]);
|
|
26
64
|
|
|
27
65
|
// API to handle saving a filter
|
|
28
66
|
const handleSaveFilter = (name: string) => {
|
|
@@ -48,7 +86,7 @@ const CraftTableFilterWrapper = ({
|
|
|
48
86
|
const newFilterId = response?.id;
|
|
49
87
|
if (newFilterId) {
|
|
50
88
|
setFilterMaster(
|
|
51
|
-
(prev: FilterMasterStateProps) =>
|
|
89
|
+
(prev: FilterMasterStateProps | null) =>
|
|
52
90
|
({
|
|
53
91
|
...prev,
|
|
54
92
|
saved_filters: {
|
|
@@ -123,6 +161,7 @@ const CraftTableFilterWrapper = ({
|
|
|
123
161
|
onDeleteFilter={handleRemoveFilter}
|
|
124
162
|
onSaveFilter={handleSaveFilter}
|
|
125
163
|
onChangeFunction={onChangeFunction}
|
|
164
|
+
filterComponentOptions={filterComponentOptions}
|
|
126
165
|
/>
|
|
127
166
|
);
|
|
128
167
|
};
|
package/dist/index.d.ts
DELETED
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { SortingState, PaginationState, RowSelectionState, ExpandedState, ColumnPinningState, ColumnDef, Row, Table, ColumnOrderState, Header } from '@tanstack/react-table';
|
|
3
|
-
import React, { Dispatch, SetStateAction } from 'react';
|
|
4
|
-
|
|
5
|
-
interface onFilterChangeFunctionProps {
|
|
6
|
-
updatedFilters?: any;
|
|
7
|
-
filterMaster?: any;
|
|
8
|
-
filters?: any;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface OperationProps {
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}
|
|
15
|
-
type OperationMapProps = {
|
|
16
|
-
[key in FilterInputDataTypes]?: OperationProps[];
|
|
17
|
-
};
|
|
18
|
-
interface FilterOperationListProps {
|
|
19
|
-
label: string;
|
|
20
|
-
value: string;
|
|
21
|
-
}
|
|
22
|
-
type FilterInputDataTypes = "text" | "select" | "multiselect" | "date" | "year" | "number";
|
|
23
|
-
interface FilterColumnsListProps {
|
|
24
|
-
created_date: string | null;
|
|
25
|
-
entity_type: string;
|
|
26
|
-
id: string;
|
|
27
|
-
name: string;
|
|
28
|
-
status: string | null;
|
|
29
|
-
parent_type: string;
|
|
30
|
-
parent_id: string;
|
|
31
|
-
code: string | null;
|
|
32
|
-
created_by: string | null;
|
|
33
|
-
modified_by: string | null;
|
|
34
|
-
modified_date: string | null;
|
|
35
|
-
enterprise_id: string | null;
|
|
36
|
-
organization_id: string | null;
|
|
37
|
-
app_code: string | null;
|
|
38
|
-
mapped_entity_type: string;
|
|
39
|
-
menu_code: string | null;
|
|
40
|
-
table_name: string | null;
|
|
41
|
-
col_position: number;
|
|
42
|
-
sortable: string | null;
|
|
43
|
-
searchable: string | null;
|
|
44
|
-
attribute_key: string;
|
|
45
|
-
sort_type: string | null;
|
|
46
|
-
data_type: FilterInputDataTypes;
|
|
47
|
-
data_source_type: string | null;
|
|
48
|
-
datasource_list: any | null;
|
|
49
|
-
visible: string;
|
|
50
|
-
}
|
|
51
|
-
interface FilterColumnsDataProps {
|
|
52
|
-
column_list: FilterColumnsListProps[];
|
|
53
|
-
operation_list: OperationMapProps;
|
|
54
|
-
saved_filter: FilterOperationListProps[];
|
|
55
|
-
}
|
|
56
|
-
interface FilterDropdownDataProps {
|
|
57
|
-
[key: string]: FilterOperationListProps[];
|
|
58
|
-
}
|
|
59
|
-
interface FilterDrawerProps {
|
|
60
|
-
tableStates: CraftTableOptionsProps;
|
|
61
|
-
open?: boolean;
|
|
62
|
-
onClose?: () => void;
|
|
63
|
-
onDeleteFilter?: () => void;
|
|
64
|
-
onSaveFilter?: (name: string) => void;
|
|
65
|
-
onUpdateFilter?: (name: string) => void;
|
|
66
|
-
columnsData: FilterColumnsDataProps;
|
|
67
|
-
dropdownData: FilterDropdownDataProps;
|
|
68
|
-
defaultFilters?: Array<{
|
|
69
|
-
filter_attribute: string;
|
|
70
|
-
filter_operator: string;
|
|
71
|
-
filter_value: string;
|
|
72
|
-
}>;
|
|
73
|
-
savedFilters?: Array<{
|
|
74
|
-
label: string;
|
|
75
|
-
value: string;
|
|
76
|
-
}>;
|
|
77
|
-
tableData?: {
|
|
78
|
-
entity_list: any[];
|
|
79
|
-
};
|
|
80
|
-
onChangeFunction: ({ updatedFilters, filterMaster, }: onFilterChangeFunctionProps) => void;
|
|
81
|
-
}
|
|
82
|
-
interface FilterStateProps {
|
|
83
|
-
filter_attribute: string;
|
|
84
|
-
filter_operator: string;
|
|
85
|
-
filter_value: string | string[];
|
|
86
|
-
}
|
|
87
|
-
interface FilterMasterStateProps {
|
|
88
|
-
attributes: {
|
|
89
|
-
selected: string;
|
|
90
|
-
radio: string[];
|
|
91
|
-
};
|
|
92
|
-
saved_filters: {
|
|
93
|
-
selectedId: string;
|
|
94
|
-
selectedName: string;
|
|
95
|
-
};
|
|
96
|
-
activeFilterTabIndex: number;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
interface QuickFilterModalProps {
|
|
100
|
-
view?: string;
|
|
101
|
-
show?: boolean;
|
|
102
|
-
filterSettingStates: craftTableFilterSettingsOptionsProps;
|
|
103
|
-
onClose?: () => void;
|
|
104
|
-
columnsData: FilterColumnsDataProps;
|
|
105
|
-
columnsDataLoading: boolean;
|
|
106
|
-
tabsApiData?: string[];
|
|
107
|
-
tabsApiDataLoading?: boolean;
|
|
108
|
-
onSaveSettingsData?: (data: any) => void;
|
|
109
|
-
}
|
|
110
|
-
type TabName = string;
|
|
111
|
-
type SortingType = "asc" | "desc";
|
|
112
|
-
type QuickTabSortingType = "asc" | "dsc" | "count_asc" | "count_dsc" | "custom";
|
|
113
|
-
interface QuickTabConfigProps {
|
|
114
|
-
attribute?: string;
|
|
115
|
-
sorting?: QuickTabSortingType;
|
|
116
|
-
hide_list?: string[];
|
|
117
|
-
show_list?: string[];
|
|
118
|
-
isAllSelected?: boolean;
|
|
119
|
-
isCombineOther?: boolean;
|
|
120
|
-
}
|
|
121
|
-
interface ColumnItem {
|
|
122
|
-
label: string;
|
|
123
|
-
value: string;
|
|
124
|
-
}
|
|
125
|
-
interface ColumnTab {
|
|
126
|
-
tab_name: TabName;
|
|
127
|
-
show_list: ColumnItem[];
|
|
128
|
-
hide_list: ColumnItem[];
|
|
129
|
-
}
|
|
130
|
-
interface SortingConfigSortByProps {
|
|
131
|
-
column: string;
|
|
132
|
-
order: SortingType;
|
|
133
|
-
}
|
|
134
|
-
interface SortingConfigTabProps {
|
|
135
|
-
tab_name: TabName;
|
|
136
|
-
sortby: SortingConfigSortByProps[];
|
|
137
|
-
}
|
|
138
|
-
interface SortingConfigProps {
|
|
139
|
-
isDefault?: boolean;
|
|
140
|
-
sortby?: SortingConfigSortByProps[];
|
|
141
|
-
tabs?: SortingConfigTabProps[];
|
|
142
|
-
}
|
|
143
|
-
interface ColumnTabConfigProps {
|
|
144
|
-
isDefault?: boolean;
|
|
145
|
-
show_list?: ColumnItem[];
|
|
146
|
-
hide_list?: ColumnItem[];
|
|
147
|
-
tabs?: ColumnTab[];
|
|
148
|
-
}
|
|
149
|
-
interface SettingsDataProps {
|
|
150
|
-
isDefault?: boolean;
|
|
151
|
-
show_list?: ColumnItem[];
|
|
152
|
-
hide_list?: ColumnItem[];
|
|
153
|
-
tabs?: ColumnTab[];
|
|
154
|
-
quick_tab?: QuickTabConfigProps;
|
|
155
|
-
column?: ColumnTabConfigProps;
|
|
156
|
-
sorting?: SortingConfigProps;
|
|
157
|
-
}
|
|
158
|
-
interface SavedButtonErrorProps {
|
|
159
|
-
hasError: boolean;
|
|
160
|
-
messages: {
|
|
161
|
-
type: string;
|
|
162
|
-
message: string;
|
|
163
|
-
}[];
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
interface CraftTableOptionsProps {
|
|
167
|
-
sorting: SortingState;
|
|
168
|
-
setSorting: Dispatch<SetStateAction<SortingState>>;
|
|
169
|
-
pagination: PaginationState;
|
|
170
|
-
setPagination: Dispatch<SetStateAction<PaginationState>>;
|
|
171
|
-
rowSelection: RowSelectionState;
|
|
172
|
-
setRowSelection: Dispatch<SetStateAction<RowSelectionState>>;
|
|
173
|
-
isCompactTable?: boolean;
|
|
174
|
-
setIsCompactTable?: Dispatch<SetStateAction<boolean>>;
|
|
175
|
-
expanded: ExpandedState;
|
|
176
|
-
setExpanded: Dispatch<SetStateAction<ExpandedState>>;
|
|
177
|
-
wrapColumns: Record<string, boolean>;
|
|
178
|
-
setWrapColumns: Dispatch<SetStateAction<Record<string, boolean>>>;
|
|
179
|
-
filters: FilterStateProps[];
|
|
180
|
-
setFilters: Dispatch<SetStateAction<FilterStateProps[]>>;
|
|
181
|
-
savedFilterEditValue: string | number;
|
|
182
|
-
setSavedFilterEditValue: Dispatch<SetStateAction<string | number>>;
|
|
183
|
-
filterToDelete: FilterOperationListProps | null;
|
|
184
|
-
setFilterToDelete: Dispatch<SetStateAction<FilterOperationListProps | null>>;
|
|
185
|
-
filterSelectedAttributeValue: string;
|
|
186
|
-
setFilterSelectedAttributeValue: Dispatch<SetStateAction<string>>;
|
|
187
|
-
filterMaster: FilterMasterStateProps | null;
|
|
188
|
-
setFilterMaster: Dispatch<SetStateAction<FilterMasterStateProps | null>>;
|
|
189
|
-
showTableFilter: boolean;
|
|
190
|
-
setShowTableFilter: Dispatch<SetStateAction<boolean>>;
|
|
191
|
-
showFilterOptions: boolean;
|
|
192
|
-
setShowFilterOption: Dispatch<SetStateAction<boolean>>;
|
|
193
|
-
columnPinning: ColumnPinningState;
|
|
194
|
-
setColumnPinning: Dispatch<SetStateAction<ColumnPinningState>>;
|
|
195
|
-
}
|
|
196
|
-
interface craftTableFilterSettingsOptionsProps {
|
|
197
|
-
settingsData: SettingsDataProps;
|
|
198
|
-
setSettingsData: Dispatch<SetStateAction<SettingsDataProps>>;
|
|
199
|
-
showListViewSettings: boolean;
|
|
200
|
-
setShowListViewSettings: Dispatch<SetStateAction<boolean>>;
|
|
201
|
-
quickTabStates: QuickTabConfigProps;
|
|
202
|
-
setQuickTabStates: Dispatch<SetStateAction<QuickTabConfigProps>>;
|
|
203
|
-
columnTabState: ColumnTabConfigProps;
|
|
204
|
-
setColumnTabState: Dispatch<SetStateAction<ColumnTabConfigProps>>;
|
|
205
|
-
sortingTabState: SortingConfigProps;
|
|
206
|
-
setSortingTabState: Dispatch<SetStateAction<SortingConfigProps>>;
|
|
207
|
-
saveButtonError: SavedButtonErrorProps;
|
|
208
|
-
setSaveButtonError: Dispatch<SetStateAction<SavedButtonErrorProps>>;
|
|
209
|
-
}
|
|
210
|
-
interface CraftTableFeatureProps {
|
|
211
|
-
enableSorting?: boolean;
|
|
212
|
-
enableServerSidePagination?: boolean;
|
|
213
|
-
enableServerSideSorting?: boolean;
|
|
214
|
-
enableRowSelection?: boolean;
|
|
215
|
-
enableColumnResizing?: boolean;
|
|
216
|
-
enableColumnReordering?: boolean;
|
|
217
|
-
enableColumnPinning?: boolean;
|
|
218
|
-
enableMultiColumnSorting?: boolean;
|
|
219
|
-
enableTopbar?: boolean;
|
|
220
|
-
enableWordBreakAll?: boolean;
|
|
221
|
-
stickyHeader?: boolean;
|
|
222
|
-
compactTable?: boolean;
|
|
223
|
-
striped?: boolean;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
interface CraftTablePaginationProps {
|
|
227
|
-
totalRows?: number;
|
|
228
|
-
rowsPerPageArray?: number[];
|
|
229
|
-
showPagination?: boolean;
|
|
230
|
-
paginationPosition?: "top" | "bottom";
|
|
231
|
-
paginationView?: "full" | "compact";
|
|
232
|
-
}
|
|
233
|
-
interface LoadingOptionsProps {
|
|
234
|
-
isLoading: boolean;
|
|
235
|
-
loaderText?: string;
|
|
236
|
-
loadingComponent?: React.ReactNode;
|
|
237
|
-
}
|
|
238
|
-
interface TopbarOptionsProps {
|
|
239
|
-
tableStates: CraftTableOptionsProps;
|
|
240
|
-
leftSideComponent?: React.ReactNode;
|
|
241
|
-
rightSideComponent?: React.ReactNode;
|
|
242
|
-
showColumnToggle?: boolean;
|
|
243
|
-
showCompactTableToggle?: boolean;
|
|
244
|
-
showChangeLayoutToggle?: boolean;
|
|
245
|
-
viewMoreToggle?: boolean;
|
|
246
|
-
showSearch?: boolean;
|
|
247
|
-
showSortingToggle?: boolean;
|
|
248
|
-
showFilterToggle?: boolean;
|
|
249
|
-
searchValue?: string;
|
|
250
|
-
onSearchChange?: (val: string) => void;
|
|
251
|
-
onFilterButtonClick?: () => void;
|
|
252
|
-
}
|
|
253
|
-
interface CustomRenderContext<T> {
|
|
254
|
-
value: unknown;
|
|
255
|
-
row: Row<T>;
|
|
256
|
-
table: Row<T>[];
|
|
257
|
-
}
|
|
258
|
-
type CustomRenderFnMap<T> = {
|
|
259
|
-
[key: string]: (ctx: CustomRenderContext<T>) => React.ReactNode;
|
|
260
|
-
};
|
|
261
|
-
type CustomColumnMeta = {
|
|
262
|
-
type?: "custom";
|
|
263
|
-
propName?: string;
|
|
264
|
-
[key: string]: any;
|
|
265
|
-
};
|
|
266
|
-
type CustomColumnDef<T> = ColumnDef<T> & {
|
|
267
|
-
meta?: CustomColumnMeta;
|
|
268
|
-
};
|
|
269
|
-
interface CraftTableStyleProps {
|
|
270
|
-
wrapperStyle?: React.CSSProperties;
|
|
271
|
-
}
|
|
272
|
-
interface FilterOptionsProps {
|
|
273
|
-
onClick?: () => void;
|
|
274
|
-
show?: boolean;
|
|
275
|
-
component: React.ReactNode;
|
|
276
|
-
}
|
|
277
|
-
interface settingsOptionsProps {
|
|
278
|
-
showIcon?: boolean;
|
|
279
|
-
onClick?: () => void;
|
|
280
|
-
}
|
|
281
|
-
interface CraftTableProps<T> {
|
|
282
|
-
data: T[];
|
|
283
|
-
columns: CustomColumnDef<T>[];
|
|
284
|
-
tableStates: CraftTableOptionsProps;
|
|
285
|
-
paginationOptions?: CraftTablePaginationProps;
|
|
286
|
-
featureOptions?: CraftTableFeatureProps;
|
|
287
|
-
nestedComponent?: React.ComponentType<{
|
|
288
|
-
row: Row<T>;
|
|
289
|
-
}>;
|
|
290
|
-
loadingOptions?: LoadingOptionsProps;
|
|
291
|
-
topbarOptions?: TopbarOptionsProps;
|
|
292
|
-
customRenderFn?: CustomRenderFnMap<T>;
|
|
293
|
-
shouldHideColumn?: (accessorKey?: string) => boolean;
|
|
294
|
-
styleOptions?: CraftTableStyleProps;
|
|
295
|
-
emptyListComponent?: React.ReactNode;
|
|
296
|
-
filterOptions?: FilterOptionsProps;
|
|
297
|
-
settingsOptions?: settingsOptionsProps;
|
|
298
|
-
craftTableFilterSettingsOptions?: craftTableFilterSettingsOptionsProps;
|
|
299
|
-
}
|
|
300
|
-
interface CraftTableComponentProps<T> {
|
|
301
|
-
table: Table<T>;
|
|
302
|
-
featureOptions: CraftTableFeatureProps;
|
|
303
|
-
NestedComponent?: React.ComponentType<{
|
|
304
|
-
row: Row<T>;
|
|
305
|
-
}>;
|
|
306
|
-
columnOrder: ColumnOrderState;
|
|
307
|
-
setColumnOrder: React.Dispatch<React.SetStateAction<ColumnOrderState>>;
|
|
308
|
-
isCompactTable: boolean;
|
|
309
|
-
tableStates: CraftTableOptionsProps;
|
|
310
|
-
}
|
|
311
|
-
interface TableHeaderProps<T> {
|
|
312
|
-
header: Header<T, unknown>;
|
|
313
|
-
featureOptions: CraftTableFeatureProps;
|
|
314
|
-
tableStates: CraftTableOptionsProps;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
declare function TableWrapper<T>({ data, columns, tableStates, paginationOptions, featureOptions, topbarOptions, nestedComponent, loadingOptions, customRenderFn, shouldHideColumn, emptyListComponent, filterOptions, }: CraftTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
318
|
-
|
|
319
|
-
declare function useCraftTable(paginationPageSize?: number): CraftTableOptionsProps;
|
|
320
|
-
|
|
321
|
-
declare function useCraftTableFilterSettings(): craftTableFilterSettingsOptionsProps;
|
|
322
|
-
|
|
323
|
-
interface TabDataProps {
|
|
324
|
-
tab_value: string | null;
|
|
325
|
-
tab_value_count: string | number;
|
|
326
|
-
}
|
|
327
|
-
interface TableTabsProps {
|
|
328
|
-
loading?: boolean;
|
|
329
|
-
tabsData?: TabDataProps[];
|
|
330
|
-
activeTab?: string;
|
|
331
|
-
tableStates: CraftTableOptionsProps;
|
|
332
|
-
onClick: (state: string) => void;
|
|
333
|
-
columns?: any[];
|
|
334
|
-
settingsOptions?: settingsOptionsProps;
|
|
335
|
-
}
|
|
336
|
-
declare function TableTabs({ loading, tabsData, activeTab, onClick, tableStates, settingsOptions, }: TableTabsProps): react_jsx_runtime.JSX.Element;
|
|
337
|
-
|
|
338
|
-
declare function TableFilter({ onClose, columnsData, tableStates, onDeleteFilter, onSaveFilter, onUpdateFilter, dropdownData, onChangeFunction, }: FilterDrawerProps): react_jsx_runtime.JSX.Element;
|
|
339
|
-
|
|
340
|
-
declare function QuickFilterSettings({ view, show, filterSettingStates, onClose, columnsData, columnsDataLoading, tabsApiData, tabsApiDataLoading, onSaveSettingsData, }: QuickFilterModalProps): react_jsx_runtime.JSX.Element;
|
|
341
|
-
|
|
342
|
-
interface TableSearchProps {
|
|
343
|
-
value: string;
|
|
344
|
-
onChange: (value: string) => void;
|
|
345
|
-
}
|
|
346
|
-
declare const TableSearch: ({ value, onChange, }: TableSearchProps) => JSX.Element;
|
|
347
|
-
|
|
348
|
-
declare const Kanban: ({ metaData, data, isLoading, KanbanCardComponent, showSettings, onOpenSettings, }: {
|
|
349
|
-
metaData: any;
|
|
350
|
-
data: any;
|
|
351
|
-
isLoading?: boolean;
|
|
352
|
-
KanbanCardComponent: React.ComponentType<{
|
|
353
|
-
key: string | number;
|
|
354
|
-
cardData: any;
|
|
355
|
-
}>;
|
|
356
|
-
showSettings: boolean;
|
|
357
|
-
onOpenSettings?: () => void;
|
|
358
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
359
|
-
|
|
360
|
-
export { TableFilter as CraftTableFilter, TableSearch as CraftTableSearch, QuickFilterSettings as CraftTableSettings, TableTabs as CraftTableTabs, Kanban as KanbanWrapper, TableWrapper, useCraftTable, useCraftTableFilterSettings };
|
|
361
|
-
export type { CraftTableComponentProps, CraftTableFeatureProps, CraftTableOptionsProps, CraftTablePaginationProps, CraftTableProps, CustomRenderContext, CustomRenderFnMap, FilterOptionsProps, TableHeaderProps, TopbarOptionsProps, craftTableFilterSettingsOptionsProps, settingsOptionsProps };
|