rez-table-listing-mui 1.0.35 → 1.0.37
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.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/App.tsx +7 -9
- package/src/components/filter/components/forms/components/Date.tsx +161 -109
- package/src/components/filter/components/forms/components/Filter-criteria.tsx +59 -21
- package/src/components/filter/components/forms/index.tsx +3 -3
- package/src/components/filter/components/main-filter.tsx +6 -1
- package/src/components/filter/components/saved-filter.tsx +8 -2
- package/src/components/filter/index.tsx +0 -3
- package/src/components/filter/style.ts +18 -0
- package/src/components/index.scss +0 -2
- package/src/libs/utils/apiColumn.ts +0 -1
- package/src/libs/utils/common.ts +3 -3
package/src/App.tsx
CHANGED
|
@@ -25,7 +25,7 @@ function App() {
|
|
|
25
25
|
const [columns, setColumns] = useState<any[]>([]);
|
|
26
26
|
const [searchTerm, setSearchTerm] = useState("");
|
|
27
27
|
// const [data, setData] = useState<Person[]>(() => makeData(50, 3, 2));
|
|
28
|
-
// const [entity_type] = useState(ENTITY_TYPE); //OR
|
|
28
|
+
// const [entity_type] = useState(ENTITY_TYPE); //OR AYR BRD
|
|
29
29
|
|
|
30
30
|
const [selectedTab, setSelectedTab] = useState("ALL");
|
|
31
31
|
|
|
@@ -34,7 +34,7 @@ function App() {
|
|
|
34
34
|
|
|
35
35
|
const { defaultColumns } = useDefaultColumns();
|
|
36
36
|
|
|
37
|
-
const { metaQuery } = useFetchData("
|
|
37
|
+
const { metaQuery } = useFetchData("AYR");
|
|
38
38
|
const { detailsQuery } = useDetailsQueryAPI(
|
|
39
39
|
filterMaster?.saved_filters?.selectedId
|
|
40
40
|
? filterMaster?.saved_filters?.selectedId
|
|
@@ -54,7 +54,7 @@ function App() {
|
|
|
54
54
|
|
|
55
55
|
const fetchMeta = async () => {
|
|
56
56
|
try {
|
|
57
|
-
const { res } = await entityTableMetaMaster("
|
|
57
|
+
const { res } = await entityTableMetaMaster("AYR");
|
|
58
58
|
setColumns(res);
|
|
59
59
|
} catch (error) {
|
|
60
60
|
console.error("Failed to fetch metadata:", error);
|
|
@@ -73,7 +73,7 @@ function App() {
|
|
|
73
73
|
const { tableData, isTableDataPending } = useEntityTableAPI({
|
|
74
74
|
page: 0,
|
|
75
75
|
size: 50,
|
|
76
|
-
entity_type: "
|
|
76
|
+
entity_type: "AYR",
|
|
77
77
|
tabs: {
|
|
78
78
|
columnName: "status",
|
|
79
79
|
sortBy: "ASC",
|
|
@@ -147,12 +147,11 @@ function App() {
|
|
|
147
147
|
filter_operator: f.filter_operator,
|
|
148
148
|
filter_value: f.filter_value,
|
|
149
149
|
}));
|
|
150
|
-
console.log("Quick Filter in App.tsx", quickFilter);
|
|
151
150
|
|
|
152
151
|
const payload = {
|
|
153
152
|
name,
|
|
154
153
|
is_default: false,
|
|
155
|
-
mapped_entity_type: "
|
|
154
|
+
mapped_entity_type: "AYR", // For that entity type
|
|
156
155
|
status: "ACTIVE",
|
|
157
156
|
entity_type: "SFM", // FIXED entity type
|
|
158
157
|
filterDetails: quickFilter,
|
|
@@ -167,7 +166,7 @@ function App() {
|
|
|
167
166
|
name: filterToDelete?.label,
|
|
168
167
|
id: filterToDelete?.value,
|
|
169
168
|
is_default: false,
|
|
170
|
-
mapped_entity_type: "
|
|
169
|
+
mapped_entity_type: "AYR",
|
|
171
170
|
status: "INACTIVE",
|
|
172
171
|
entity_type: "SFM",
|
|
173
172
|
};
|
|
@@ -182,13 +181,12 @@ function App() {
|
|
|
182
181
|
filter_operator: f.filter_operator,
|
|
183
182
|
filter_value: f.filter_value,
|
|
184
183
|
}));
|
|
185
|
-
console.log("Quick Filter in App.tsx", quickFilter);
|
|
186
184
|
|
|
187
185
|
const payload = {
|
|
188
186
|
name: filterMaster?.saved_filters?.selectedName, // Name of the filter
|
|
189
187
|
is_default: false,
|
|
190
188
|
id: filterMaster?.saved_filters?.selectedId,
|
|
191
|
-
mapped_entity_type: "
|
|
189
|
+
mapped_entity_type: "AYR",
|
|
192
190
|
status: "ACTIVE",
|
|
193
191
|
entity_type: "SFM",
|
|
194
192
|
filterDetails: quickFilter,
|
|
@@ -4,7 +4,7 @@ import { DatePicker } from "@mui/x-date-pickers/DatePicker";
|
|
|
4
4
|
import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
|
|
5
5
|
import moment from "moment";
|
|
6
6
|
import { UpdatedFilterStateProps } from "../../../../../types/filter";
|
|
7
|
-
import { SxProps, Theme } from "@mui/material";
|
|
7
|
+
import { SxProps, Theme, Box } from "@mui/material";
|
|
8
8
|
|
|
9
9
|
type FormDatePickerProps = {
|
|
10
10
|
filter: UpdatedFilterStateProps;
|
|
@@ -18,121 +18,173 @@ const FormDatePicker = ({
|
|
|
18
18
|
filter,
|
|
19
19
|
control,
|
|
20
20
|
sx,
|
|
21
|
-
views = ["day", "month", "year"],
|
|
21
|
+
views = ["day", "month", "year"],
|
|
22
22
|
onValueChange,
|
|
23
23
|
}: FormDatePickerProps) => {
|
|
24
|
+
const isRange = filter.filter_operator === "between";
|
|
25
|
+
|
|
26
|
+
console.log("filter", filter.filter_operator);
|
|
27
|
+
|
|
24
28
|
return (
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
value=
|
|
39
|
-
|
|
29
|
+
<LocalizationProvider dateAdapter={AdapterDateFns}>
|
|
30
|
+
<Box display="flex" gap={1}>
|
|
31
|
+
<Controller
|
|
32
|
+
name={`${filter?.name}.value`}
|
|
33
|
+
control={control}
|
|
34
|
+
defaultValue={
|
|
35
|
+
isRange
|
|
36
|
+
? ["", ""] // range default
|
|
37
|
+
: filter.filter_value
|
|
38
|
+
? moment(filter.filter_value, "YYYY-MM-DD").toDate() //
|
|
39
|
+
: null
|
|
40
|
+
}
|
|
41
|
+
render={({ field }) => {
|
|
42
|
+
const value = field.value;
|
|
43
|
+
|
|
44
|
+
if (isRange) {
|
|
45
|
+
const fromDate = Array.isArray(value) ? value[0] : "";
|
|
46
|
+
const toDate = Array.isArray(value) ? value[1] : "";
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
<DatePicker
|
|
51
|
+
views={views}
|
|
52
|
+
value={
|
|
53
|
+
fromDate ? moment(fromDate, "YYYY-MM-DD").toDate() : null //
|
|
54
|
+
}
|
|
55
|
+
onChange={(date) => {
|
|
56
|
+
let formatted = "";
|
|
57
|
+
if (date) {
|
|
58
|
+
formatted =
|
|
59
|
+
views?.length === 1 && views[0] === "year"
|
|
60
|
+
? moment(date).format("YYYY")
|
|
61
|
+
: moment(date).format("YYYY-MM-DD"); //
|
|
62
|
+
}
|
|
63
|
+
const updated: [string, string] = [
|
|
64
|
+
formatted,
|
|
65
|
+
toDate || "",
|
|
66
|
+
];
|
|
67
|
+
field.onChange(updated);
|
|
68
|
+
onValueChange?.();
|
|
69
|
+
}}
|
|
70
|
+
format={
|
|
71
|
+
views?.length === 1 && views[0] === "year"
|
|
72
|
+
? "yyyy"
|
|
73
|
+
: "dd-MM-yyyy"
|
|
74
|
+
}
|
|
75
|
+
sx={{
|
|
76
|
+
"& .MuiOutlinedInput-input": {
|
|
77
|
+
padding: "12px 20px",
|
|
78
|
+
},
|
|
79
|
+
...sx,
|
|
80
|
+
}}
|
|
81
|
+
slotProps={{
|
|
82
|
+
textField: {
|
|
83
|
+
size: "small",
|
|
84
|
+
fullWidth: true,
|
|
85
|
+
placeholder:
|
|
86
|
+
views?.length === 1 && views[0] === "year"
|
|
87
|
+
? "YYYY"
|
|
88
|
+
: "From Date",
|
|
89
|
+
},
|
|
90
|
+
}}
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<DatePicker
|
|
94
|
+
views={views}
|
|
95
|
+
value={
|
|
96
|
+
toDate ? moment(toDate, "YYYY-MM-DD").toDate() : null //
|
|
97
|
+
}
|
|
98
|
+
onChange={(date) => {
|
|
99
|
+
let formatted = "";
|
|
100
|
+
if (date) {
|
|
101
|
+
formatted =
|
|
102
|
+
views?.length === 1 && views[0] === "year"
|
|
103
|
+
? moment(date).format("YYYY")
|
|
104
|
+
: moment(date).format("YYYY-MM-DD"); //
|
|
105
|
+
}
|
|
106
|
+
const updated: [string, string] = [
|
|
107
|
+
fromDate || "",
|
|
108
|
+
formatted,
|
|
109
|
+
];
|
|
110
|
+
field.onChange(updated);
|
|
111
|
+
onValueChange?.();
|
|
112
|
+
}}
|
|
113
|
+
format={
|
|
114
|
+
views?.length === 1 && views[0] === "year"
|
|
115
|
+
? "yyyy"
|
|
116
|
+
: "dd-MM-yyyy"
|
|
117
|
+
}
|
|
118
|
+
sx={{
|
|
119
|
+
"& .MuiOutlinedInput-input": {
|
|
120
|
+
padding: "12px 20px",
|
|
121
|
+
},
|
|
122
|
+
...sx,
|
|
123
|
+
}}
|
|
124
|
+
slotProps={{
|
|
125
|
+
textField: {
|
|
126
|
+
size: "small",
|
|
127
|
+
fullWidth: true,
|
|
128
|
+
placeholder:
|
|
129
|
+
views?.length === 1 && views[0] === "year"
|
|
130
|
+
? "YYYY"
|
|
131
|
+
: "To Date",
|
|
132
|
+
},
|
|
133
|
+
}}
|
|
134
|
+
/>
|
|
135
|
+
</>
|
|
136
|
+
);
|
|
40
137
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
138
|
+
|
|
139
|
+
// single date picker fallback
|
|
140
|
+
return (
|
|
141
|
+
<DatePicker
|
|
142
|
+
{...field}
|
|
143
|
+
views={views}
|
|
144
|
+
value={
|
|
145
|
+
field.value
|
|
146
|
+
? moment(field.value, "YYYY-MM-DD").toDate() //
|
|
147
|
+
: null
|
|
48
148
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}}
|
|
62
|
-
slotProps={{
|
|
63
|
-
textField: {
|
|
64
|
-
size: "small",
|
|
65
|
-
fullWidth: true,
|
|
66
|
-
placeholder:
|
|
149
|
+
onChange={(date) => {
|
|
150
|
+
let formatted = "";
|
|
151
|
+
if (date) {
|
|
152
|
+
formatted =
|
|
153
|
+
views?.length === 1 && views[0] === "year"
|
|
154
|
+
? moment(date).format("YYYY")
|
|
155
|
+
: moment(date).format("YYYY-MM-DD"); //
|
|
156
|
+
}
|
|
157
|
+
field.onChange(formatted);
|
|
158
|
+
onValueChange?.();
|
|
159
|
+
}}
|
|
160
|
+
format={
|
|
67
161
|
views?.length === 1 && views[0] === "year"
|
|
68
|
-
? "
|
|
69
|
-
: "
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
162
|
+
? "yyyy"
|
|
163
|
+
: "dd-MM-yyyy"
|
|
164
|
+
}
|
|
165
|
+
sx={{
|
|
166
|
+
"& .MuiOutlinedInput-input": {
|
|
167
|
+
padding: "12px 20px",
|
|
168
|
+
},
|
|
169
|
+
...sx,
|
|
170
|
+
}}
|
|
171
|
+
slotProps={{
|
|
172
|
+
textField: {
|
|
173
|
+
size: "small",
|
|
174
|
+
fullWidth: true,
|
|
175
|
+
placeholder:
|
|
176
|
+
views?.length === 1 && views[0] === "year"
|
|
177
|
+
? "YYYY"
|
|
178
|
+
: "DD-MM-YYYY",
|
|
179
|
+
},
|
|
180
|
+
}}
|
|
181
|
+
/>
|
|
182
|
+
);
|
|
183
|
+
}}
|
|
184
|
+
/>
|
|
185
|
+
</Box>
|
|
186
|
+
</LocalizationProvider>
|
|
76
187
|
);
|
|
77
188
|
};
|
|
78
189
|
|
|
79
190
|
export default FormDatePicker;
|
|
80
|
-
|
|
81
|
-
// import { Controller } from "react-hook-form";
|
|
82
|
-
// import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
|
|
83
|
-
// import { DatePicker } from "@mui/x-date-pickers/DatePicker";
|
|
84
|
-
// import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
|
|
85
|
-
// import moment from "moment";
|
|
86
|
-
// import { UpdatedFilterStateProps } from "../../../../../types/filter";
|
|
87
|
-
// import { SxProps, Theme } from "@mui/material";
|
|
88
|
-
|
|
89
|
-
// const FormDatePicker = ({
|
|
90
|
-
// filter,
|
|
91
|
-
// control,
|
|
92
|
-
// sx,
|
|
93
|
-
// }: {
|
|
94
|
-
// filter: UpdatedFilterStateProps;
|
|
95
|
-
// control: any;
|
|
96
|
-
// sx?: SxProps<Theme>;
|
|
97
|
-
// }) => {
|
|
98
|
-
// return (
|
|
99
|
-
// <Controller
|
|
100
|
-
// name={`${filter?.name}.value`} // or use a consistent structure like `filters.${index}.filter_value`
|
|
101
|
-
// control={control}
|
|
102
|
-
// defaultValue={
|
|
103
|
-
// filter.filter_value
|
|
104
|
-
// ? moment(filter.filter_value, "DD-MM-YYYY").toDate()
|
|
105
|
-
// : null
|
|
106
|
-
// }
|
|
107
|
-
// render={({ field }) => (
|
|
108
|
-
// <LocalizationProvider dateAdapter={AdapterDateFns}>
|
|
109
|
-
// <DatePicker
|
|
110
|
-
// sx={{
|
|
111
|
-
// "& .MuiOutlinedInput-input": {
|
|
112
|
-
// padding: "12px 20px",
|
|
113
|
-
// },
|
|
114
|
-
// }}
|
|
115
|
-
// {...field}
|
|
116
|
-
// value={
|
|
117
|
-
// field.value ? moment(field.value, "DD-MM-YYYY").toDate() : null
|
|
118
|
-
// }
|
|
119
|
-
// onChange={(date) => {
|
|
120
|
-
// const formatted = date ? moment(date).format("DD-MM-YYYY") : "";
|
|
121
|
-
// field.onChange(formatted);
|
|
122
|
-
// }}
|
|
123
|
-
// format="dd-MM-yyyy"
|
|
124
|
-
// slotProps={{
|
|
125
|
-
// textField: {
|
|
126
|
-
// size: "small",
|
|
127
|
-
// fullWidth: true,
|
|
128
|
-
// placeholder: "DD-MM-YYYY",
|
|
129
|
-
// },
|
|
130
|
-
// }}
|
|
131
|
-
// />
|
|
132
|
-
// </LocalizationProvider>
|
|
133
|
-
// )}
|
|
134
|
-
// />
|
|
135
|
-
// );
|
|
136
|
-
// };
|
|
137
|
-
|
|
138
|
-
// export default FormDatePicker;
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from "../../../../../types/filter";
|
|
17
17
|
import { CraftTableOptionsProps } from "../../../../../types/table-options";
|
|
18
18
|
import CustomSearch from "../../search";
|
|
19
|
+
import { filterStyles } from "../../../style";
|
|
19
20
|
|
|
20
21
|
const FilterCriteria = ({
|
|
21
22
|
columnsData,
|
|
@@ -47,21 +48,65 @@ const FilterCriteria = ({
|
|
|
47
48
|
const { filters, setFilters } = tableStates;
|
|
48
49
|
const filterButtonRef = useRef<HTMLButtonElement>(null);
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
//Remove this function once date with range is fixed
|
|
52
|
+
// const handleAddFilter = (column: FilterColumnsListProps) => {
|
|
53
|
+
// const dropdownOptions = columnsData.operation_list[column.data_type];
|
|
54
|
+
|
|
55
|
+
// // console.log("dropdownOptionssssss", dropdownOptions);
|
|
56
|
+
|
|
57
|
+
// const defaultValue = column.data_type === "multiselect" ? [] : "";
|
|
58
|
+
// console.log("defaultValue", defaultValue);
|
|
59
|
+
|
|
60
|
+
// const defaultOperator = dropdownOptions?.[0]?.value || "";
|
|
61
|
+
// // console.log("defaultOperator", defaultOperator);
|
|
62
|
+
|
|
63
|
+
// const matchingDropdownList =
|
|
64
|
+
// columnsData.operation_list[column.data_type] || [];
|
|
65
|
+
|
|
66
|
+
// // console.log("matchingDropdownList", matchingDropdownList);
|
|
52
67
|
|
|
53
|
-
|
|
68
|
+
// const newFilter = {
|
|
69
|
+
// filter_attribute: column.attribute_key,
|
|
70
|
+
// filter_operator: defaultOperator,
|
|
71
|
+
// filter_value: defaultValue,
|
|
72
|
+
// };
|
|
54
73
|
|
|
55
|
-
|
|
56
|
-
|
|
74
|
+
// const newSelectedFilter = {
|
|
75
|
+
// ...newFilter,
|
|
76
|
+
// id: column.id,
|
|
77
|
+
// name: column.name,
|
|
78
|
+
// data_type: column.data_type,
|
|
79
|
+
// dropdown_list: matchingDropdownList,
|
|
80
|
+
// };
|
|
81
|
+
|
|
82
|
+
// setFilters((prev) => [...prev, newFilter]);
|
|
83
|
+
// setSelectedFilters((prev) => [...prev, newSelectedFilter]);
|
|
84
|
+
// // if (editMode) {
|
|
85
|
+
// // setEditFilters((prev) => [...prev, newFilter]);
|
|
86
|
+
// // setSelectedFilters((prev) => [...prev, newSelectedFilter]);
|
|
87
|
+
// // } else {
|
|
88
|
+
// // setFilters((prev) => [...prev, newFilter]);
|
|
89
|
+
// // setSelectedFilters((prev) => [...prev, newSelectedFilter]);
|
|
90
|
+
// // }
|
|
91
|
+
|
|
92
|
+
// setShowFilterOption(false);
|
|
93
|
+
// };
|
|
94
|
+
|
|
95
|
+
// Updated this function to handle the addition of date with
|
|
96
|
+
|
|
97
|
+
const handleAddFilter = (column: FilterColumnsListProps) => {
|
|
98
|
+
const dropdownOptions = columnsData.operation_list[column.data_type] || [];
|
|
57
99
|
|
|
58
|
-
const defaultOperator = dropdownOptions
|
|
59
|
-
// console.log("defaultOperator", defaultOperator);
|
|
100
|
+
const defaultOperator = dropdownOptions[0]?.value || "";
|
|
60
101
|
|
|
61
|
-
const
|
|
62
|
-
|
|
102
|
+
const defaultValue =
|
|
103
|
+
column.data_type === "date" && defaultOperator === "between"
|
|
104
|
+
? ["", ""] // range-based value for "between"
|
|
105
|
+
: column.data_type === "multiselect"
|
|
106
|
+
? []
|
|
107
|
+
: "";
|
|
63
108
|
|
|
64
|
-
|
|
109
|
+
const matchingDropdownList = dropdownOptions;
|
|
65
110
|
|
|
66
111
|
const newFilter = {
|
|
67
112
|
filter_attribute: column.attribute_key,
|
|
@@ -79,13 +124,6 @@ const FilterCriteria = ({
|
|
|
79
124
|
|
|
80
125
|
setFilters((prev) => [...prev, newFilter]);
|
|
81
126
|
setSelectedFilters((prev) => [...prev, newSelectedFilter]);
|
|
82
|
-
// if (editMode) {
|
|
83
|
-
// setEditFilters((prev) => [...prev, newFilter]);
|
|
84
|
-
// setSelectedFilters((prev) => [...prev, newSelectedFilter]);
|
|
85
|
-
// } else {
|
|
86
|
-
// setFilters((prev) => [...prev, newFilter]);
|
|
87
|
-
// setSelectedFilters((prev) => [...prev, newSelectedFilter]);
|
|
88
|
-
// }
|
|
89
127
|
|
|
90
128
|
setShowFilterOption(false);
|
|
91
129
|
};
|
|
@@ -118,7 +156,6 @@ const FilterCriteria = ({
|
|
|
118
156
|
width: filterButtonRef.current?.offsetWidth || 360, // Dynamic width based on button
|
|
119
157
|
p: 1,
|
|
120
158
|
mt: 2,
|
|
121
|
-
// overflowY: "auto",
|
|
122
159
|
cursor: "pointer",
|
|
123
160
|
position: "absolute",
|
|
124
161
|
zIndex: 1300,
|
|
@@ -126,8 +163,10 @@ const FilterCriteria = ({
|
|
|
126
163
|
>
|
|
127
164
|
<Box
|
|
128
165
|
sx={{
|
|
129
|
-
|
|
130
|
-
|
|
166
|
+
maxHeight: `calc(100vh - 440px)`,
|
|
167
|
+
overflowY: "auto",
|
|
168
|
+
width: "100%",
|
|
169
|
+
...filterStyles.scrollbarCustom,
|
|
131
170
|
}}
|
|
132
171
|
>
|
|
133
172
|
<List>
|
|
@@ -140,7 +179,6 @@ const FilterCriteria = ({
|
|
|
140
179
|
<Box
|
|
141
180
|
sx={{
|
|
142
181
|
my: 2,
|
|
143
|
-
maxHeight: `calc(100vh - 360px)`,
|
|
144
182
|
overflowY: "auto",
|
|
145
183
|
transition: "all 0.4s ease-in-out",
|
|
146
184
|
}}
|
|
@@ -163,9 +163,9 @@ const FilterForm = ({
|
|
|
163
163
|
"&.Mui-focused fieldset": { borderColor: "#7A5AF8" },
|
|
164
164
|
},
|
|
165
165
|
display: "flex",
|
|
166
|
-
alignItems: "center",
|
|
167
|
-
justifyContent: "center",
|
|
168
|
-
|
|
166
|
+
alignItems: "center",
|
|
167
|
+
justifyContent: "center",
|
|
168
|
+
padding: "0.5rem 0 1rem 0",
|
|
169
169
|
gap: 1,
|
|
170
170
|
}}
|
|
171
171
|
>
|
|
@@ -38,8 +38,13 @@ const MainFilter = ({
|
|
|
38
38
|
);
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
+
const mainBoxStyles = {
|
|
42
|
+
...filterStyles.filterMainComponentWrapper,
|
|
43
|
+
...filterStyles.scrollbarCustom,
|
|
44
|
+
};
|
|
45
|
+
|
|
41
46
|
return (
|
|
42
|
-
<Box sx={
|
|
47
|
+
<Box sx={mainBoxStyles}>
|
|
43
48
|
{/* Set selectedFilters state */}
|
|
44
49
|
|
|
45
50
|
{/* Render selectedFilters state */}
|
|
@@ -74,7 +74,8 @@ const SavedFilter = ({
|
|
|
74
74
|
<>
|
|
75
75
|
<CustomSearch value={searchTerm} onChange={setSearchTerm} />
|
|
76
76
|
|
|
77
|
-
{columnsData
|
|
77
|
+
{!Array.isArray(columnsData?.saved_filter) ||
|
|
78
|
+
columnsData?.saved_filter?.length === 0 ? (
|
|
78
79
|
<Typography sx={{ mt: 2 }}>No saved filters yet.</Typography>
|
|
79
80
|
) : (
|
|
80
81
|
<List
|
|
@@ -124,8 +125,13 @@ const SavedFilter = ({
|
|
|
124
125
|
</>
|
|
125
126
|
);
|
|
126
127
|
|
|
128
|
+
const mainBoxStyles = {
|
|
129
|
+
...filterStyles.filterMainComponentWrapper,
|
|
130
|
+
...filterStyles.scrollbarCustom,
|
|
131
|
+
};
|
|
132
|
+
|
|
127
133
|
return (
|
|
128
|
-
<Box sx={
|
|
134
|
+
<Box sx={mainBoxStyles}>
|
|
129
135
|
{/* Render search input and list */}
|
|
130
136
|
{!editMode && renderList()}
|
|
131
137
|
|
|
@@ -52,10 +52,7 @@ export function TableFilter({
|
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
console.log("main useEffect triggered");
|
|
56
|
-
|
|
57
55
|
const updated = filters?.map((filter) => {
|
|
58
|
-
console.log("inside map");
|
|
59
56
|
const matchingColumn = columnsData.column_list.find(
|
|
60
57
|
(column) => column.attribute_key === filter.filter_attribute
|
|
61
58
|
);
|
|
@@ -5,6 +5,7 @@ interface StyleProps {
|
|
|
5
5
|
filterMainHeader: SxProps<Theme>;
|
|
6
6
|
filterMainComponentWrapper: SxProps<Theme>;
|
|
7
7
|
filterAttributeMainSelect: SxProps<Theme>;
|
|
8
|
+
scrollbarCustom: SxProps<Theme>;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
interface filterFormStyleType {
|
|
@@ -17,11 +18,28 @@ interface filterFormStyleType {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export const filterStyles: StyleProps = {
|
|
21
|
+
scrollbarCustom: {
|
|
22
|
+
overflowY: "auto",
|
|
23
|
+
pr: 1,
|
|
24
|
+
|
|
25
|
+
"&::-webkit-scrollbar": {
|
|
26
|
+
width: "4px",
|
|
27
|
+
},
|
|
28
|
+
"&::-webkit-scrollbar-thumb": {
|
|
29
|
+
backgroundColor: "#999",
|
|
30
|
+
borderRadius: "4px",
|
|
31
|
+
},
|
|
32
|
+
"&::-webkit-scrollbar-track": {
|
|
33
|
+
backgroundColor: "#f0f0f0",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
|
|
20
37
|
filterContainer: {
|
|
21
38
|
height: "100%",
|
|
22
39
|
overflowY: "hidden",
|
|
23
40
|
boxShadow: "0px 3px 8px 0px rgba(34, 48, 62, 0.10)",
|
|
24
41
|
borderRadius: "0.5rem",
|
|
42
|
+
minHeight: "calc(100vh - 200px)",
|
|
25
43
|
},
|
|
26
44
|
|
|
27
45
|
filterMainHeader: {
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
opacity: 0;
|
|
29
29
|
margin-right: calc(-1 * var(--filter-width));
|
|
30
30
|
transition: all 0.4s ease-in-out;
|
|
31
|
-
max-height: calc(100vh - 50px);
|
|
32
31
|
}
|
|
33
32
|
.ts__table__filter.show {
|
|
34
33
|
transition: all 0.4s ease-in-out;
|
|
@@ -37,7 +36,6 @@
|
|
|
37
36
|
max-width: var(--filter-width);
|
|
38
37
|
margin-left: 1.25rem;
|
|
39
38
|
margin-right: 0rem;
|
|
40
|
-
min-height: calc(100vh - 50px);
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
|
|
@@ -37,7 +37,6 @@ export const entityTableFilterMaster = async (entity_type: string) => {
|
|
|
37
37
|
(item: any) => item.attribute_key !== "action"
|
|
38
38
|
),
|
|
39
39
|
};
|
|
40
|
-
// console.log("response", filteredData.column_list);
|
|
41
40
|
// return response.data.data;
|
|
42
41
|
return filteredData; // FOR ACTION COLUMN REMOVE
|
|
43
42
|
} catch (error) {
|
package/src/libs/utils/common.ts
CHANGED
|
@@ -77,11 +77,11 @@ export function customDebounce<T extends (...args: any[]) => any>(
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// uat http://13.200.182.92:9091/api
|
|
80
|
-
// local http://localhost:
|
|
80
|
+
// local http://localhost:4010/api
|
|
81
81
|
|
|
82
82
|
// API INTEGRATION
|
|
83
83
|
export const api = axios.create({
|
|
84
|
-
baseURL: "http://
|
|
84
|
+
baseURL: "http://localhost:4010/api",
|
|
85
85
|
timeout: 10000,
|
|
86
86
|
headers: {
|
|
87
87
|
"Content-Type": "application/json",
|
|
@@ -101,4 +101,4 @@ api.interceptors.request.use(
|
|
|
101
101
|
}
|
|
102
102
|
);
|
|
103
103
|
|
|
104
|
-
export const ENTITY_TYPE = "
|
|
104
|
+
export const ENTITY_TYPE = "AYR";
|