rez-table-listing-mui 0.0.24 → 0.0.26
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/.env.uat +1 -0
- package/.eslintrc.cjs +11 -9
- package/dist/index.d.ts +104 -11
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +6 -10
- package/src/App.tsx +185 -142
- package/src/assets/svg.tsx +33 -2
- package/src/components/common/confirm-modal/index.tsx +200 -0
- package/src/components/filter/components/attributes-filter.tsx +26 -0
- package/src/components/filter/components/forms/components/Attributes-select.tsx +180 -0
- package/src/components/filter/components/forms/components/Date.tsx +58 -0
- package/src/components/filter/components/forms/components/Dropdown.tsx +62 -0
- package/src/components/filter/components/forms/components/Filter-criteria.tsx +164 -0
- package/src/components/filter/components/forms/components/Multi-Select.tsx +57 -0
- package/src/components/filter/components/forms/components/Select.tsx +53 -0
- package/src/components/filter/components/forms/components/Textfield.tsx +43 -0
- package/src/components/filter/components/forms/components/styles.tsx +11 -0
- package/src/components/filter/components/forms/index.tsx +424 -0
- package/src/components/filter/components/main-filter.tsx +53 -0
- package/src/components/filter/components/saved-edit-filter.tsx +101 -0
- package/src/components/filter/components/saved-filter.tsx +148 -0
- package/src/components/filter/components/search/index.tsx +56 -0
- package/src/components/filter/components/tabs/custom-tab-panel.tsx +29 -0
- package/src/components/filter/components/tabs/index.tsx +52 -0
- package/src/components/filter/index.tsx +258 -0
- package/src/components/index-table.tsx +20 -14
- package/src/components/index.scss +4 -0
- package/src/components/login/index.tsx +49 -0
- package/src/components/search/index.tsx +0 -1
- package/src/components/table-body-dnd-cell.tsx +3 -3
- package/src/components/table-body.tsx +8 -5
- package/src/components/table-head-popover.tsx +2 -1
- package/src/components/table-head.tsx +0 -10
- package/src/components/topbar/index.scss +6 -1
- package/src/components/topbar/index.tsx +59 -33
- package/src/components/viewmore/index.tsx +33 -17
- package/src/libs/hooks/useCraftTable.tsx +32 -6
- package/src/libs/hooks/useDefaultColumns.tsx +6 -5
- package/src/libs/hooks/useEntityTableAPI.tsx +183 -0
- package/src/libs/hooks/useEntityTableHooks.ts +25 -0
- package/src/libs/utils/apiColumn.ts +123 -0
- package/src/libs/utils/common.ts +42 -0
- package/src/main.tsx +6 -3
- package/src/types/common.ts +67 -0
- package/src/types/filter.ts +211 -0
- package/src/types/table-options.ts +15 -2
- package/src/types/table.ts +7 -6
- package/tsconfig.json +1 -1
- package/vite.config.ts +3 -3
package/.env.uat
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VITE_API_BASE_URL = 'http://13.200.182.92:9090/api'
|
package/.eslintrc.cjs
CHANGED
|
@@ -2,17 +2,19 @@ module.exports = {
|
|
|
2
2
|
root: true,
|
|
3
3
|
env: { browser: true, es2020: true },
|
|
4
4
|
extends: [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
"eslint:recommended",
|
|
6
|
+
"plugin:@typescript-eslint/recommended",
|
|
7
|
+
"plugin:react-hooks/recommended",
|
|
8
8
|
],
|
|
9
|
-
ignorePatterns: [
|
|
10
|
-
parser:
|
|
11
|
-
plugins: [
|
|
9
|
+
ignorePatterns: ["dist", ".eslintrc.cjs"],
|
|
10
|
+
parser: "@typescript-eslint/parser",
|
|
11
|
+
plugins: ["react-refresh"],
|
|
12
12
|
rules: {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
"react-refresh/only-export-components": [
|
|
14
|
+
"warn",
|
|
15
15
|
{ allowConstantExport: true },
|
|
16
16
|
],
|
|
17
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
18
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
17
19
|
},
|
|
18
|
-
}
|
|
20
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,93 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { SortingState, PaginationState, RowSelectionState, ExpandedState, Row, Table, ColumnOrderState, Header
|
|
2
|
+
import { SortingState, PaginationState, RowSelectionState, ExpandedState, ColumnDef, Row, Table, ColumnOrderState, Header } from '@tanstack/react-table';
|
|
3
3
|
import React, { Dispatch, SetStateAction } from 'react';
|
|
4
4
|
|
|
5
|
+
interface OperationProps {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
type OperationMapProps = {
|
|
10
|
+
[key in FilterInputDataTypes]?: OperationProps[];
|
|
11
|
+
};
|
|
12
|
+
interface FilterOperationListProps {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
type FilterInputDataTypes = "text" | "select" | "multiselect" | "date" | "number";
|
|
17
|
+
interface FilterColumnsListProps {
|
|
18
|
+
created_date: string | null;
|
|
19
|
+
entity_type: string;
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
status: string | null;
|
|
23
|
+
parent_type: string;
|
|
24
|
+
parent_id: string;
|
|
25
|
+
code: string | null;
|
|
26
|
+
created_by: string | null;
|
|
27
|
+
modified_by: string | null;
|
|
28
|
+
modified_date: string | null;
|
|
29
|
+
enterprise_id: string | null;
|
|
30
|
+
organization_id: string | null;
|
|
31
|
+
app_code: string | null;
|
|
32
|
+
mapped_entity_type: string;
|
|
33
|
+
menu_code: string | null;
|
|
34
|
+
table_name: string | null;
|
|
35
|
+
col_position: number;
|
|
36
|
+
sortable: string | null;
|
|
37
|
+
searchable: string | null;
|
|
38
|
+
attribute_key: string;
|
|
39
|
+
sort_type: string | null;
|
|
40
|
+
data_type: FilterInputDataTypes;
|
|
41
|
+
data_source_type: string | null;
|
|
42
|
+
datasource_list: any | null;
|
|
43
|
+
visible: string;
|
|
44
|
+
}
|
|
45
|
+
interface FilterColumnsDataProps {
|
|
46
|
+
column_list: FilterColumnsListProps[];
|
|
47
|
+
operation_list: OperationMapProps;
|
|
48
|
+
saved_filter: FilterOperationListProps[];
|
|
49
|
+
}
|
|
50
|
+
interface FilterDropdownDataProps {
|
|
51
|
+
[key: string]: FilterOperationListProps[];
|
|
52
|
+
}
|
|
53
|
+
interface FilterDrawerProps {
|
|
54
|
+
tableStates: CraftTableOptionsProps;
|
|
55
|
+
open?: boolean;
|
|
56
|
+
onClose?: () => void;
|
|
57
|
+
onDeleteFilter?: () => void;
|
|
58
|
+
onSaveFilter?: (name: string) => void;
|
|
59
|
+
onUpdateFilter?: (name: string) => void;
|
|
60
|
+
columnsData: FilterColumnsDataProps;
|
|
61
|
+
dropdownData: FilterDropdownDataProps;
|
|
62
|
+
defaultFilters?: Array<{
|
|
63
|
+
filter_attribute: string;
|
|
64
|
+
filter_operator: string;
|
|
65
|
+
filter_value: string;
|
|
66
|
+
}>;
|
|
67
|
+
savedFilters?: Array<{
|
|
68
|
+
label: string;
|
|
69
|
+
value: string;
|
|
70
|
+
}>;
|
|
71
|
+
tableData?: {
|
|
72
|
+
entity_list: any[];
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
interface FilterStateProps {
|
|
76
|
+
filter_attribute: string;
|
|
77
|
+
filter_operator: string;
|
|
78
|
+
filter_value: string | string[];
|
|
79
|
+
}
|
|
80
|
+
interface FilterMasterStateProps {
|
|
81
|
+
attributes: {
|
|
82
|
+
selected: string;
|
|
83
|
+
radio: string;
|
|
84
|
+
};
|
|
85
|
+
saved_filters: {
|
|
86
|
+
selectedId: string;
|
|
87
|
+
selectedName: string;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
5
91
|
interface CraftTableOptionsProps {
|
|
6
92
|
sorting: SortingState;
|
|
7
93
|
setSorting: Dispatch<SetStateAction<SortingState>>;
|
|
@@ -15,8 +101,16 @@ interface CraftTableOptionsProps {
|
|
|
15
101
|
setExpanded: Dispatch<SetStateAction<ExpandedState>>;
|
|
16
102
|
wrapColumns: Record<string, boolean>;
|
|
17
103
|
setWrapColumns: Dispatch<SetStateAction<Record<string, boolean>>>;
|
|
18
|
-
|
|
19
|
-
|
|
104
|
+
filters: FilterStateProps[];
|
|
105
|
+
setFilters: Dispatch<SetStateAction<FilterStateProps[]>>;
|
|
106
|
+
savedFilterEditValue: string | number;
|
|
107
|
+
setSavedFilterEditValue: Dispatch<SetStateAction<string | number>>;
|
|
108
|
+
filterToDelete: FilterOperationListProps | null;
|
|
109
|
+
setFilterToDelete: Dispatch<SetStateAction<FilterOperationListProps | null>>;
|
|
110
|
+
filterSelectedAttributeValue: string;
|
|
111
|
+
setFilterSelectedAttributeValue: Dispatch<SetStateAction<string>>;
|
|
112
|
+
filterMaster: FilterMasterStateProps | null;
|
|
113
|
+
setFilterMaster: Dispatch<SetStateAction<FilterMasterStateProps | null>>;
|
|
20
114
|
}
|
|
21
115
|
interface CraftTableFeatureProps {
|
|
22
116
|
enableSorting?: boolean;
|
|
@@ -47,17 +141,19 @@ interface LoadingOptionsProps {
|
|
|
47
141
|
loadingComponent?: React.ReactNode;
|
|
48
142
|
}
|
|
49
143
|
interface TopbarOptionsProps {
|
|
144
|
+
tableStates: CraftTableOptionsProps;
|
|
50
145
|
leftSideComponent?: React.ReactNode;
|
|
51
146
|
rightSideComponent?: React.ReactNode;
|
|
52
|
-
showFullscreenToggle?: boolean;
|
|
53
147
|
showColumnToggle?: boolean;
|
|
54
148
|
showCompactTableToggle?: boolean;
|
|
55
149
|
showChangeLayoutToggle?: boolean;
|
|
56
150
|
viewMoreToggle?: boolean;
|
|
57
|
-
showAddNewButton?: boolean;
|
|
58
151
|
showSearch?: boolean;
|
|
59
|
-
|
|
60
|
-
|
|
152
|
+
showSortingToggle?: boolean;
|
|
153
|
+
showFilterToggle?: boolean;
|
|
154
|
+
searchValue?: string;
|
|
155
|
+
onSearchChange?: (val: string) => void;
|
|
156
|
+
filterOptions?: FilterDrawerProps;
|
|
61
157
|
}
|
|
62
158
|
interface CustomRenderContext<T> {
|
|
63
159
|
value: unknown;
|
|
@@ -92,8 +188,6 @@ interface CraftTableProps<T> {
|
|
|
92
188
|
customRenderFn?: CustomRenderFnMap<T>;
|
|
93
189
|
shouldHideColumn?: (accessorKey?: string) => boolean;
|
|
94
190
|
styleOptions?: CraftTableStyleProps;
|
|
95
|
-
searchValue?: string;
|
|
96
|
-
onSearchChange?: (val: string) => void;
|
|
97
191
|
}
|
|
98
192
|
interface CraftTableComponentProps<T> {
|
|
99
193
|
table: Table<T>;
|
|
@@ -112,8 +206,7 @@ interface TableHeaderProps<T> {
|
|
|
112
206
|
tableStates: CraftTableOptionsProps;
|
|
113
207
|
}
|
|
114
208
|
|
|
115
|
-
declare function TableWrapper<T>({ data, columns, tableStates, paginationOptions, featureOptions, topbarOptions, nestedComponent, loadingOptions, customRenderFn, shouldHideColumn,
|
|
116
|
-
onSearchChange, }: CraftTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
209
|
+
declare function TableWrapper<T>({ data, columns, tableStates, paginationOptions, featureOptions, topbarOptions, nestedComponent, loadingOptions, customRenderFn, shouldHideColumn, }: CraftTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
117
210
|
|
|
118
211
|
declare function useCraftTable(paginationPageSize?: number): CraftTableOptionsProps;
|
|
119
212
|
|