rez-table-listing-mui 1.3.32 → 1.3.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/listing/components/common/saved-filter-modal/index.tsx +54 -16
- package/src/listing/components/filter/components/forms/components/Date.tsx +1 -1
- package/src/listing/components/filter/components/forms/components/Dropdown.tsx +2 -135
- package/src/listing/components/filter/components/forms/components/Textfield.tsx +4 -1
- package/src/listing/components/filter/components/forms/index.tsx +107 -59
- package/src/listing/components/filter/components/forms/utils/filter-date-input-resolver.tsx +24 -48
- package/src/listing/components/filter/components/saved-filter.tsx +742 -63
- package/src/listing/components/filter/index.tsx +7 -0
- package/src/listing/libs/utils/common.ts +1 -0
- package/src/listing/types/filter.ts +8 -0
- package/src/view/FIlterWrapper.tsx +5 -0
- package/src/view/ListingView.tsx +1 -1
package/package.json
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
FilterMasterStateProps,
|
|
25
25
|
} from "../../../types/filter";
|
|
26
26
|
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
|
27
|
+
import { USER_ID } from "../../../libs/utils/common";
|
|
27
28
|
// import { set } from "react-hook-form";
|
|
28
29
|
|
|
29
30
|
const primary = "#7A5AF8";
|
|
@@ -52,6 +53,8 @@ const SavedFilterModalView = ({
|
|
|
52
53
|
const [shareWithTeam, setShareWithTeam] = useState<boolean>(false);
|
|
53
54
|
const [allowTeamEdit, setAllowTeamEdit] = useState<boolean>(false);
|
|
54
55
|
const filterNameValue = filterMaster?.saved_filters?.selectedName ?? "";
|
|
56
|
+
const discriptionValue = filterMaster?.saved_filters?.description ?? "";
|
|
57
|
+
|
|
55
58
|
const isSaveDisabled =
|
|
56
59
|
!filterNameValue.trim() || (allowTeamEdit && !shareWithTeam);
|
|
57
60
|
|
|
@@ -62,9 +65,11 @@ const SavedFilterModalView = ({
|
|
|
62
65
|
if (!open) return;
|
|
63
66
|
|
|
64
67
|
const filterId = filterMaster?.saved_filters?.selectedId;
|
|
65
|
-
|
|
68
|
+
const filterObj1 = columnsData?.shared_filter?.find(
|
|
69
|
+
(f: any) => f.id === filterId
|
|
70
|
+
);
|
|
66
71
|
// NEW FILTER → RESET everything
|
|
67
|
-
if (!filterId) {
|
|
72
|
+
if (!filterId && !filterObj1) {
|
|
68
73
|
setFilterMaster((prev: any) => {
|
|
69
74
|
if (!prev) return prev;
|
|
70
75
|
return {
|
|
@@ -85,7 +90,7 @@ const SavedFilterModalView = ({
|
|
|
85
90
|
}
|
|
86
91
|
|
|
87
92
|
// EXISTING FILTER → Load from columnsData.saved_filter
|
|
88
|
-
const filterObj = columnsData?.
|
|
93
|
+
const filterObj = columnsData?.shared_filter?.find(
|
|
89
94
|
(f: any) => f.id === filterId
|
|
90
95
|
);
|
|
91
96
|
if (filterObj) {
|
|
@@ -103,12 +108,22 @@ const SavedFilterModalView = ({
|
|
|
103
108
|
},
|
|
104
109
|
};
|
|
105
110
|
});
|
|
106
|
-
const initialShare = filterObj.is_shared ?? false;
|
|
107
|
-
const initialAllow = initialShare
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
// const initialShare = filterObj.is_shared ?? false;
|
|
112
|
+
// const initialAllow = initialShare
|
|
113
|
+
// ? filterObj.is_editable === "true"
|
|
114
|
+
// : false;
|
|
115
|
+
// setShareWithTeam(initialShare);
|
|
116
|
+
// setAllowTeamEdit(initialAllow);
|
|
117
|
+
const initialShare =
|
|
118
|
+
filterObj.is_shared === true || filterObj.is_shared === "true";
|
|
119
|
+
const initialAllow =
|
|
120
|
+
initialShare &&
|
|
121
|
+
(filterObj.is_editable === true || filterObj.is_editable === "true");
|
|
122
|
+
|
|
110
123
|
setShareWithTeam(initialShare);
|
|
111
124
|
setAllowTeamEdit(initialAllow);
|
|
125
|
+
|
|
126
|
+
persistPreferences(initialShare, initialAllow);
|
|
112
127
|
}
|
|
113
128
|
}, [
|
|
114
129
|
open,
|
|
@@ -189,13 +204,20 @@ const SavedFilterModalView = ({
|
|
|
189
204
|
(f: any) => f.id === selectedFilterId
|
|
190
205
|
);
|
|
191
206
|
|
|
207
|
+
const isOwner = String(selectedSavedFilter?.is_owner) === "true";
|
|
208
|
+
|
|
192
209
|
// Check if we should show prefields
|
|
193
210
|
const showPrefields =
|
|
194
|
-
selectedSavedFilter && selectedSavedFilter.is_editable === "true"
|
|
211
|
+
(selectedSavedFilter && selectedSavedFilter.is_editable === "true") ||
|
|
212
|
+
selectedSavedFilter;
|
|
195
213
|
|
|
196
214
|
// Disable checkboxes if prefields are shown
|
|
197
215
|
const showCheckboxes = !showPrefields;
|
|
198
216
|
|
|
217
|
+
const isNewFilter = !selectedSavedFilter;
|
|
218
|
+
|
|
219
|
+
const isshow = isOwner;
|
|
220
|
+
|
|
199
221
|
return (
|
|
200
222
|
<Dialog open={open} onClose={onClose} maxWidth="sm" fullWidth>
|
|
201
223
|
<DialogTitle sx={{ display: "flex", justifyContent: "space-between" }}>
|
|
@@ -251,6 +273,7 @@ const SavedFilterModalView = ({
|
|
|
251
273
|
<TextField
|
|
252
274
|
fullWidth
|
|
253
275
|
minRows={3}
|
|
276
|
+
value={discriptionValue}
|
|
254
277
|
size="small"
|
|
255
278
|
sx={{
|
|
256
279
|
mb: 1,
|
|
@@ -277,7 +300,7 @@ const SavedFilterModalView = ({
|
|
|
277
300
|
(Max. 300 Characters)
|
|
278
301
|
</Typography>
|
|
279
302
|
{/* Sharing Controls */}
|
|
280
|
-
{
|
|
303
|
+
{shouldShowSharingControls && (showCheckboxes || isshow) && (
|
|
281
304
|
<Box
|
|
282
305
|
sx={{
|
|
283
306
|
display: "flex",
|
|
@@ -320,7 +343,7 @@ const SavedFilterModalView = ({
|
|
|
320
343
|
</Box>
|
|
321
344
|
)}
|
|
322
345
|
{/* prefields */}
|
|
323
|
-
{showPrefields && (
|
|
346
|
+
{showPrefields && !isshow && (
|
|
324
347
|
<Box
|
|
325
348
|
sx={{
|
|
326
349
|
display: "grid",
|
|
@@ -343,7 +366,6 @@ const SavedFilterModalView = ({
|
|
|
343
366
|
|
|
344
367
|
<TextField
|
|
345
368
|
fullWidth
|
|
346
|
-
sx={{ bgcolor: "#0E0C0B0F" }}
|
|
347
369
|
size="small"
|
|
348
370
|
value={
|
|
349
371
|
selectedFilter?.created_date
|
|
@@ -357,6 +379,10 @@ const SavedFilterModalView = ({
|
|
|
357
379
|
<CalendarTodayIcon fontSize="small" />
|
|
358
380
|
</IconButton>
|
|
359
381
|
),
|
|
382
|
+
sx: {
|
|
383
|
+
backgroundColor: "#0E0C0B0F",
|
|
384
|
+
borderRadius: "4px",
|
|
385
|
+
},
|
|
360
386
|
}}
|
|
361
387
|
/>
|
|
362
388
|
</Box>
|
|
@@ -374,10 +400,15 @@ const SavedFilterModalView = ({
|
|
|
374
400
|
</Typography>
|
|
375
401
|
<TextField
|
|
376
402
|
fullWidth
|
|
377
|
-
sx={{ bgcolor: "#0E0C0B0F" }}
|
|
378
403
|
size="small"
|
|
379
|
-
value={selectedFilter?.
|
|
380
|
-
InputProps={{
|
|
404
|
+
value={selectedFilter?.created_by || ""}
|
|
405
|
+
InputProps={{
|
|
406
|
+
readOnly: true,
|
|
407
|
+
sx: {
|
|
408
|
+
backgroundColor: "#0E0C0B0F",
|
|
409
|
+
borderRadius: "4px",
|
|
410
|
+
},
|
|
411
|
+
}}
|
|
381
412
|
/>
|
|
382
413
|
</Box>
|
|
383
414
|
|
|
@@ -395,7 +426,6 @@ const SavedFilterModalView = ({
|
|
|
395
426
|
|
|
396
427
|
<TextField
|
|
397
428
|
fullWidth
|
|
398
|
-
sx={{ bgcolor: "#0E0C0B0F" }}
|
|
399
429
|
size="small"
|
|
400
430
|
value={
|
|
401
431
|
selectedFilter?.modified_date
|
|
@@ -409,6 +439,11 @@ const SavedFilterModalView = ({
|
|
|
409
439
|
<CalendarTodayIcon fontSize="small" />
|
|
410
440
|
</IconButton>
|
|
411
441
|
),
|
|
442
|
+
|
|
443
|
+
sx: {
|
|
444
|
+
backgroundColor: "#0E0C0B0F",
|
|
445
|
+
borderRadius: "4px",
|
|
446
|
+
},
|
|
412
447
|
}}
|
|
413
448
|
/>
|
|
414
449
|
</Box>
|
|
@@ -426,11 +461,14 @@ const SavedFilterModalView = ({
|
|
|
426
461
|
</Typography>
|
|
427
462
|
<TextField
|
|
428
463
|
fullWidth
|
|
429
|
-
sx={{ bgcolor: "#0E0C0B0F" }}
|
|
430
464
|
size="small"
|
|
431
465
|
value={selectedFilter?.modified_by || ""}
|
|
432
466
|
InputProps={{
|
|
433
467
|
readOnly: true,
|
|
468
|
+
sx: {
|
|
469
|
+
backgroundColor: "#0E0C0B0F",
|
|
470
|
+
borderRadius: "4px",
|
|
471
|
+
},
|
|
434
472
|
}}
|
|
435
473
|
/>
|
|
436
474
|
</Box>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// !! DON'T DELETE THIS OLD CODE !! //
|
|
2
|
+
|
|
1
3
|
import { FormControl, MenuItem, Select, SxProps, Theme } from "@mui/material";
|
|
2
4
|
import { Controller, UseFormSetValue } from "react-hook-form";
|
|
3
5
|
import { FilterStateProps } from "../../../../../types/filter";
|
|
@@ -16,24 +18,6 @@ interface FormDropdownProps {
|
|
|
16
18
|
onValueChange?: () => void;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
// Allowed date-based operators
|
|
20
|
-
const DATE_ALLOWED_OPERATORS = [
|
|
21
|
-
"equal",
|
|
22
|
-
"before",
|
|
23
|
-
"after",
|
|
24
|
-
"between",
|
|
25
|
-
"is",
|
|
26
|
-
"today",
|
|
27
|
-
"is_day_before",
|
|
28
|
-
"is_day_after",
|
|
29
|
-
"is_month_before",
|
|
30
|
-
"is_month_after",
|
|
31
|
-
"is_before",
|
|
32
|
-
"is_after",
|
|
33
|
-
"is_on_or_before",
|
|
34
|
-
"is_on_or_after",
|
|
35
|
-
];
|
|
36
|
-
|
|
37
21
|
const FormDropdown = ({
|
|
38
22
|
filter,
|
|
39
23
|
control,
|
|
@@ -74,19 +58,6 @@ const FormDropdown = ({
|
|
|
74
58
|
|
|
75
59
|
field.onChange(e);
|
|
76
60
|
|
|
77
|
-
// Reset value if operator switches date → non-date or non-date → date
|
|
78
|
-
if (filter.filter_attribute_data_type === "date") {
|
|
79
|
-
const wasDateOp = DATE_ALLOWED_OPERATORS.includes(oldOperator);
|
|
80
|
-
const isDateOpNow =
|
|
81
|
-
DATE_ALLOWED_OPERATORS.includes(newOperator);
|
|
82
|
-
|
|
83
|
-
if (wasDateOp !== isDateOpNow) {
|
|
84
|
-
setValue(`${filter?.filter_attribute_name}.value`, "", {
|
|
85
|
-
shouldDirty: true,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
61
|
if (
|
|
91
62
|
(filter?.filter_attribute_data_type === "date" ||
|
|
92
63
|
filter?.filter_attribute_data_type === "year") &&
|
|
@@ -130,107 +101,3 @@ const FormDropdown = ({
|
|
|
130
101
|
};
|
|
131
102
|
|
|
132
103
|
export default FormDropdown;
|
|
133
|
-
|
|
134
|
-
// !! DON'T DELETE THIS OLD CODE !! //
|
|
135
|
-
|
|
136
|
-
// import { FormControl, MenuItem, Select, SxProps, Theme } from "@mui/material";
|
|
137
|
-
// import { Controller, UseFormSetValue } from "react-hook-form";
|
|
138
|
-
// import { FilterStateProps } from "../../../../../types/filter";
|
|
139
|
-
// import moment from "moment";
|
|
140
|
-
|
|
141
|
-
// interface FormDropdownProps {
|
|
142
|
-
// filter: FilterStateProps;
|
|
143
|
-
// control: any;
|
|
144
|
-
// setValue: UseFormSetValue<any>;
|
|
145
|
-
// dropdownList: {
|
|
146
|
-
// label?: string;
|
|
147
|
-
// value?: string;
|
|
148
|
-
// }[];
|
|
149
|
-
// isLoading?: boolean;
|
|
150
|
-
// sx?: SxProps<Theme>;
|
|
151
|
-
// onValueChange?: () => void;
|
|
152
|
-
// }
|
|
153
|
-
|
|
154
|
-
// const FormDropdown = ({
|
|
155
|
-
// filter,
|
|
156
|
-
// control,
|
|
157
|
-
// setValue,
|
|
158
|
-
// dropdownList,
|
|
159
|
-
// isLoading = false,
|
|
160
|
-
// sx,
|
|
161
|
-
// onValueChange,
|
|
162
|
-
// }: FormDropdownProps) => {
|
|
163
|
-
// return (
|
|
164
|
-
// <Controller
|
|
165
|
-
// name={`${filter?.filter_attribute_name}.operator`}
|
|
166
|
-
// control={control}
|
|
167
|
-
// defaultValue={filter?.filter_operator || dropdownList?.[0]?.value || ""}
|
|
168
|
-
// render={({ field }) => (
|
|
169
|
-
// <FormControl sx={sx} size="small">
|
|
170
|
-
// <Select
|
|
171
|
-
// {...field}
|
|
172
|
-
// variant="standard"
|
|
173
|
-
// sx={{
|
|
174
|
-
// fontSize: "0.875rem",
|
|
175
|
-
// minWidth: 50,
|
|
176
|
-
// border: "none",
|
|
177
|
-
// boxShadow: "none",
|
|
178
|
-
// "& .MuiSelect-icon": {
|
|
179
|
-
// top: "45%",
|
|
180
|
-
// transform: "translateY(-50%)",
|
|
181
|
-
// "& .MuiOutlinedInput-input": {
|
|
182
|
-
// padding: "12px 20px",
|
|
183
|
-
// },
|
|
184
|
-
// },
|
|
185
|
-
// }}
|
|
186
|
-
// disabled={isLoading}
|
|
187
|
-
// disableUnderline
|
|
188
|
-
// onChange={(e) => {
|
|
189
|
-
// const newOperator = e.target.value;
|
|
190
|
-
// const oldOperator = field.value;
|
|
191
|
-
|
|
192
|
-
// field.onChange(e);
|
|
193
|
-
|
|
194
|
-
// if (
|
|
195
|
-
// (filter?.filter_attribute_data_type === "date" ||
|
|
196
|
-
// filter?.filter_attribute_data_type === "year") &&
|
|
197
|
-
// newOperator !== oldOperator
|
|
198
|
-
// ) {
|
|
199
|
-
// if (newOperator === "today") {
|
|
200
|
-
// setValue(
|
|
201
|
-
// `${filter?.filter_attribute_name}.value`,
|
|
202
|
-
// moment().format("YYYY-MM-DD"),
|
|
203
|
-
// {
|
|
204
|
-
// shouldDirty: true,
|
|
205
|
-
// }
|
|
206
|
-
// );
|
|
207
|
-
// } else if (newOperator === "between") {
|
|
208
|
-
// setValue(`${filter?.filter_attribute_name}.value`, ["", ""], {
|
|
209
|
-
// shouldDirty: true,
|
|
210
|
-
// });
|
|
211
|
-
// } else if (
|
|
212
|
-
// oldOperator === "between" ||
|
|
213
|
-
// oldOperator === "today"
|
|
214
|
-
// ) {
|
|
215
|
-
// setValue(`${filter?.filter_attribute_name}.value`, "", {
|
|
216
|
-
// shouldDirty: true,
|
|
217
|
-
// });
|
|
218
|
-
// }
|
|
219
|
-
// }
|
|
220
|
-
|
|
221
|
-
// onValueChange?.();
|
|
222
|
-
// }}
|
|
223
|
-
// >
|
|
224
|
-
// {dropdownList?.map((item, idx) => (
|
|
225
|
-
// <MenuItem key={idx} value={item.value}>
|
|
226
|
-
// {item.label}
|
|
227
|
-
// </MenuItem>
|
|
228
|
-
// ))}
|
|
229
|
-
// </Select>
|
|
230
|
-
// </FormControl>
|
|
231
|
-
// )}
|
|
232
|
-
// />
|
|
233
|
-
// );
|
|
234
|
-
// };
|
|
235
|
-
|
|
236
|
-
// export default FormDropdown;
|
|
@@ -33,7 +33,10 @@ const FormTextfield = ({
|
|
|
33
33
|
padding: "12px 20px",
|
|
34
34
|
},
|
|
35
35
|
}}
|
|
36
|
-
type={filter?.filter_attribute_data_type || "text"}
|
|
36
|
+
// type={filter?.filter_attribute_data_type || "text" || "number"}
|
|
37
|
+
type={
|
|
38
|
+
filter?.filter_attribute_data_type === "number" ? "number" : "text"
|
|
39
|
+
}
|
|
37
40
|
placeholder={"Enter value"}
|
|
38
41
|
disabled={isLoading}
|
|
39
42
|
onChange={(e) => {
|
|
@@ -253,14 +253,14 @@ const FilterForm = ({
|
|
|
253
253
|
)}
|
|
254
254
|
/>
|
|
255
255
|
<Box onClick={(e) => e.stopPropagation()}>
|
|
256
|
-
<IconButton
|
|
256
|
+
{/* <IconButton
|
|
257
257
|
size="small"
|
|
258
258
|
onClick={() =>
|
|
259
259
|
setDeleteFilterModalOpen && setDeleteFilterModalOpen(true)
|
|
260
260
|
}
|
|
261
261
|
>
|
|
262
262
|
<DeleteIcon />
|
|
263
|
-
</IconButton>
|
|
263
|
+
</IconButton> */}
|
|
264
264
|
</Box>
|
|
265
265
|
</Box>
|
|
266
266
|
)}
|
|
@@ -350,7 +350,7 @@ const FilterForm = ({
|
|
|
350
350
|
`${filter?.filter_attribute_name}.operator`
|
|
351
351
|
);
|
|
352
352
|
|
|
353
|
-
//
|
|
353
|
+
// Toggle dummy field to force form dirty
|
|
354
354
|
const dummy = watch("dummyChange");
|
|
355
355
|
setValue(
|
|
356
356
|
"dummyChange",
|
|
@@ -469,7 +469,7 @@ const FilterForm = ({
|
|
|
469
469
|
|
|
470
470
|
export default FilterForm;
|
|
471
471
|
|
|
472
|
-
// !! PLEASE DO NOT DELETE THIS
|
|
472
|
+
// !! PLEASE DO NOT DELETE THIS COMMENTED BLOCK !!
|
|
473
473
|
// import {
|
|
474
474
|
// Box,
|
|
475
475
|
// Button,
|
|
@@ -831,7 +831,7 @@ export default FilterForm;
|
|
|
831
831
|
// `${filter?.filter_attribute_name}.operator`
|
|
832
832
|
// );
|
|
833
833
|
|
|
834
|
-
// //
|
|
834
|
+
// // Toggle dummy field to force form dirty
|
|
835
835
|
// const dummy = watch("dummyChange");
|
|
836
836
|
// setValue(
|
|
837
837
|
// "dummyChange",
|
|
@@ -850,60 +850,108 @@ export default FilterForm;
|
|
|
850
850
|
// </Box>
|
|
851
851
|
|
|
852
852
|
// <Box>
|
|
853
|
-
// {
|
|
854
|
-
//
|
|
855
|
-
//
|
|
856
|
-
//
|
|
857
|
-
//
|
|
858
|
-
//
|
|
859
|
-
|
|
860
|
-
//
|
|
861
|
-
|
|
862
|
-
//
|
|
863
|
-
//
|
|
864
|
-
//
|
|
865
|
-
//
|
|
866
|
-
//
|
|
867
|
-
//
|
|
868
|
-
//
|
|
869
|
-
//
|
|
870
|
-
//
|
|
871
|
-
//
|
|
872
|
-
//
|
|
873
|
-
//
|
|
874
|
-
//
|
|
875
|
-
//
|
|
876
|
-
//
|
|
877
|
-
|
|
878
|
-
//
|
|
879
|
-
//
|
|
880
|
-
//
|
|
881
|
-
//
|
|
882
|
-
|
|
883
|
-
//
|
|
884
|
-
// filter
|
|
885
|
-
//
|
|
886
|
-
//
|
|
887
|
-
//
|
|
888
|
-
//
|
|
889
|
-
//
|
|
890
|
-
//
|
|
891
|
-
//
|
|
892
|
-
//
|
|
893
|
-
//
|
|
894
|
-
//
|
|
895
|
-
|
|
896
|
-
//
|
|
897
|
-
//
|
|
898
|
-
//
|
|
899
|
-
//
|
|
900
|
-
//
|
|
901
|
-
//
|
|
902
|
-
//
|
|
903
|
-
//
|
|
904
|
-
//
|
|
905
|
-
//
|
|
906
|
-
//
|
|
853
|
+
// {(() => {
|
|
854
|
+
// const fieldValue = formValues[
|
|
855
|
+
// filter?.filter_attribute_name as string
|
|
856
|
+
// ] as
|
|
857
|
+
// | { value: string | string[]; operator: string }
|
|
858
|
+
// | undefined;
|
|
859
|
+
|
|
860
|
+
// const operator = fieldValue?.operator;
|
|
861
|
+
|
|
862
|
+
// // Operators that should show a Date Picker
|
|
863
|
+
// const dateAllowedOperators = [
|
|
864
|
+
// "equal",
|
|
865
|
+
// "before",
|
|
866
|
+
// "after",
|
|
867
|
+
// "between",
|
|
868
|
+
// "is",
|
|
869
|
+
// "today",
|
|
870
|
+
// "is_before",
|
|
871
|
+
// "is_after",
|
|
872
|
+
// "is_on_or_before",
|
|
873
|
+
// "is_on_or_after",
|
|
874
|
+
// "empty",
|
|
875
|
+
// "not_empty",
|
|
876
|
+
// ];
|
|
877
|
+
|
|
878
|
+
// const showDatePicker =
|
|
879
|
+
// filter?.filter_attribute_data_type === "date" &&
|
|
880
|
+
// operator &&
|
|
881
|
+
// dateAllowedOperators.includes(operator);
|
|
882
|
+
|
|
883
|
+
// if (
|
|
884
|
+
// filter?.filter_attribute_data_type === "text" ||
|
|
885
|
+
// filter?.filter_attribute_data_type === "number"
|
|
886
|
+
// ) {
|
|
887
|
+
// return (
|
|
888
|
+
// <FormTextfield
|
|
889
|
+
// filter={filter}
|
|
890
|
+
// control={control}
|
|
891
|
+
// onValueChange={updateFiltersFromForm}
|
|
892
|
+
// />
|
|
893
|
+
// );
|
|
894
|
+
// }
|
|
895
|
+
|
|
896
|
+
// if (
|
|
897
|
+
// filter?.filter_attribute_data_type === "select"
|
|
898
|
+
// ) {
|
|
899
|
+
// return (
|
|
900
|
+
// <FormMultiSelect
|
|
901
|
+
// filter={filter}
|
|
902
|
+
// control={control}
|
|
903
|
+
// dropdownData={dropdownData}
|
|
904
|
+
// onValueChange={updateFiltersFromForm}
|
|
905
|
+
// />
|
|
906
|
+
// );
|
|
907
|
+
// }
|
|
908
|
+
|
|
909
|
+
// if (
|
|
910
|
+
// filter?.filter_attribute_data_type ===
|
|
911
|
+
// "multiselect"
|
|
912
|
+
// ) {
|
|
913
|
+
// return (
|
|
914
|
+
// <FormMultiSelect
|
|
915
|
+
// filter={filter}
|
|
916
|
+
// control={control}
|
|
917
|
+
// dropdownData={dropdownData}
|
|
918
|
+
// onValueChange={updateFiltersFromForm}
|
|
919
|
+
// />
|
|
920
|
+
// );
|
|
921
|
+
// }
|
|
922
|
+
|
|
923
|
+
// if (filter?.filter_attribute_data_type === "year") {
|
|
924
|
+
// return (
|
|
925
|
+
// <FormDatePicker
|
|
926
|
+
// filter={filter}
|
|
927
|
+
// control={control}
|
|
928
|
+
// views={["year"]}
|
|
929
|
+
// onValueChange={updateFiltersFromForm}
|
|
930
|
+
// />
|
|
931
|
+
// );
|
|
932
|
+
// }
|
|
933
|
+
|
|
934
|
+
// // DATE LOGIC
|
|
935
|
+
// if (showDatePicker) {
|
|
936
|
+
// return (
|
|
937
|
+
// <FormDatePicker
|
|
938
|
+
// filter={filter}
|
|
939
|
+
// control={control}
|
|
940
|
+
// onValueChange={updateFiltersFromForm}
|
|
941
|
+
// />
|
|
942
|
+
// );
|
|
943
|
+
// } else {
|
|
944
|
+
// return (
|
|
945
|
+
// <FormTextfield
|
|
946
|
+
// filter={filter}
|
|
947
|
+
// control={control}
|
|
948
|
+
// onValueChange={updateFiltersFromForm}
|
|
949
|
+
// />
|
|
950
|
+
// );
|
|
951
|
+
// }
|
|
952
|
+
|
|
953
|
+
// return <FormControl fullWidth size="small" />;
|
|
954
|
+
// })()}
|
|
907
955
|
// </Box>
|
|
908
956
|
// </Box>
|
|
909
957
|
// );
|