rez-table-listing-mui 1.3.38 → 1.3.39
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 +2 -45
- 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/filter/components/forms/components/Date.tsx +25 -4
- package/src/listing/components/filter/components/forms/components/filter-criteria-list.tsx +0 -1
- package/src/listing/components/filter/components/forms/index.tsx +13 -582
- package/src/listing/components/filter/components/main-filter.tsx +6 -6
- package/src/listing/components/filter/components/saved-edit-filter.tsx +3 -5
- package/src/listing/components/filter/components/saved-filter.tsx +124 -300
- package/src/listing/components/filter/components/search/index.tsx +0 -1
- package/src/listing/components/filter/components/single-filter-rendering.tsx +3 -3
- package/src/listing/components/filter/index.tsx +5 -130
- package/src/listing/components/login/index.tsx +6 -3
- package/src/listing/libs/hooks/useEntityTableAPI.tsx +0 -3
- package/src/listing/libs/utils/common.ts +0 -1
- package/src/listing/types/filter.ts +1 -48
- package/src/view/FIlterWrapper.tsx +0 -15
- package/src/view/ListingView.tsx +1 -1
- package/src/listing/components/common/saved-filter-modal/index.tsx +0 -517
package/package.json
CHANGED
|
@@ -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 { FilterStateProps } from "../../../../../types/filter";
|
|
7
|
-
import { SxProps, Theme, Box } from "@mui/material";
|
|
7
|
+
import { SxProps, Theme, Box, TextField } from "@mui/material";
|
|
8
8
|
|
|
9
9
|
type FormDatePickerProps = {
|
|
10
10
|
filter: FilterStateProps;
|
|
@@ -23,6 +23,13 @@ const FormDatePicker = ({
|
|
|
23
23
|
}: FormDatePickerProps) => {
|
|
24
24
|
const isRange = filter.filter_operator === "between";
|
|
25
25
|
const isRelativeToToday = filter.filter_operator === "today";
|
|
26
|
+
const isEmptyOperator =
|
|
27
|
+
filter.filter_operator === "empty" ||
|
|
28
|
+
filter.filter_operator === "not_empty";
|
|
29
|
+
|
|
30
|
+
if (isEmptyOperator) {
|
|
31
|
+
return <TextField fullWidth disabled value="" size="small" />;
|
|
32
|
+
}
|
|
26
33
|
|
|
27
34
|
return (
|
|
28
35
|
<LocalizationProvider dateAdapter={AdapterDateFns}>
|
|
@@ -30,11 +37,22 @@ const FormDatePicker = ({
|
|
|
30
37
|
<Controller
|
|
31
38
|
name={`${filter?.filter_attribute_name}.value`}
|
|
32
39
|
control={control}
|
|
40
|
+
// defaultValue={
|
|
41
|
+
// isRange
|
|
42
|
+
// ? ["", ""]
|
|
43
|
+
// : isRelativeToToday
|
|
44
|
+
// ? moment().format("YYYY-MM-DD")
|
|
45
|
+
// : filter.filter_value
|
|
46
|
+
// ? moment(filter.filter_value, "YYYY-MM-DD").toDate()
|
|
47
|
+
// : null
|
|
48
|
+
// }
|
|
33
49
|
defaultValue={
|
|
34
50
|
isRange
|
|
35
51
|
? ["", ""]
|
|
36
52
|
: isRelativeToToday
|
|
37
53
|
? moment().format("YYYY-MM-DD")
|
|
54
|
+
: isEmptyOperator
|
|
55
|
+
? null
|
|
38
56
|
: filter.filter_value
|
|
39
57
|
? moment(filter.filter_value, "YYYY-MM-DD").toDate()
|
|
40
58
|
: null
|
|
@@ -73,7 +91,8 @@ const FormDatePicker = ({
|
|
|
73
91
|
field.onChange(updated);
|
|
74
92
|
onValueChange?.();
|
|
75
93
|
}}
|
|
76
|
-
disabled={isRelativeToToday}
|
|
94
|
+
// disabled={isRelativeToToday}
|
|
95
|
+
disabled={isRelativeToToday || isEmptyOperator}
|
|
77
96
|
format={
|
|
78
97
|
views?.length === 1 && views[0] === "year"
|
|
79
98
|
? "yyyy"
|
|
@@ -122,7 +141,8 @@ const FormDatePicker = ({
|
|
|
122
141
|
field.onChange(updated);
|
|
123
142
|
onValueChange?.();
|
|
124
143
|
}}
|
|
125
|
-
disabled={isRelativeToToday}
|
|
144
|
+
// disabled={isRelativeToToday}
|
|
145
|
+
disabled={isRelativeToToday || isEmptyOperator}
|
|
126
146
|
format={
|
|
127
147
|
views?.length === 1 && views[0] === "year"
|
|
128
148
|
? "yyyy"
|
|
@@ -173,7 +193,8 @@ const FormDatePicker = ({
|
|
|
173
193
|
field.onChange(formatted);
|
|
174
194
|
onValueChange?.();
|
|
175
195
|
}}
|
|
176
|
-
disabled={isRelativeToToday}
|
|
196
|
+
// disabled={isRelativeToToday}
|
|
197
|
+
disabled={isRelativeToToday || isEmptyOperator}
|
|
177
198
|
format={
|
|
178
199
|
views?.length === 1 && views[0] === "year"
|
|
179
200
|
? "yyyy"
|