rez-table-listing-mui 1.3.29 → 1.3.30
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.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/index.tsx +955 -1063
- package/src/listing/components/filter/components/forms/utils/filter-date-input-resolver.tsx +20 -15
|
@@ -4,14 +4,20 @@ import FormTextfield from "../components/Textfield";
|
|
|
4
4
|
import FormDatePicker from "../components/Date";
|
|
5
5
|
import FormMultiSelect from "../components/Multi-Select";
|
|
6
6
|
|
|
7
|
-
// Operators that
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
7
|
+
// Operators that should show a Date Picker
|
|
8
|
+
const dateAllowedOperators = [
|
|
9
|
+
"equal",
|
|
10
|
+
"before",
|
|
11
|
+
"after",
|
|
12
|
+
"between",
|
|
13
|
+
"is",
|
|
14
|
+
"today",
|
|
15
|
+
"is_before",
|
|
16
|
+
"is_after",
|
|
17
|
+
"is_on_or_before",
|
|
18
|
+
"is_on_or_after",
|
|
19
|
+
"empty",
|
|
20
|
+
"not_empty",
|
|
15
21
|
];
|
|
16
22
|
|
|
17
23
|
export const resolveFilterInput = ({
|
|
@@ -52,14 +58,14 @@ export const resolveFilterInput = ({
|
|
|
52
58
|
);
|
|
53
59
|
}
|
|
54
60
|
|
|
55
|
-
// DATE FIELD
|
|
61
|
+
// DATE FIELD
|
|
56
62
|
if (dataType === "date") {
|
|
57
|
-
const
|
|
63
|
+
const showDatePicker = operator && dateAllowedOperators.includes(operator);
|
|
58
64
|
|
|
59
|
-
if (
|
|
60
|
-
//
|
|
65
|
+
if (showDatePicker) {
|
|
66
|
+
// Date Picker
|
|
61
67
|
return (
|
|
62
|
-
<
|
|
68
|
+
<FormDatePicker
|
|
63
69
|
filter={filter}
|
|
64
70
|
control={control}
|
|
65
71
|
onValueChange={updateFiltersFromForm}
|
|
@@ -67,9 +73,8 @@ export const resolveFilterInput = ({
|
|
|
67
73
|
);
|
|
68
74
|
}
|
|
69
75
|
|
|
70
|
-
// Default for all other operators → Date Picker
|
|
71
76
|
return (
|
|
72
|
-
<
|
|
77
|
+
<FormTextfield
|
|
73
78
|
filter={filter}
|
|
74
79
|
control={control}
|
|
75
80
|
onValueChange={updateFiltersFromForm}
|