rez-table-listing-mui 1.3.26 → 1.3.28
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/components/Textfield.tsx +4 -1
- package/src/listing/components/filter/components/forms/index.tsx +40 -30
package/package.json
CHANGED
|
@@ -33,7 +33,10 @@ const FormTextfield = ({
|
|
|
33
33
|
padding: "12px 20px",
|
|
34
34
|
},
|
|
35
35
|
}}
|
|
36
|
-
type={filter?.filter_attribute_data_type || "text" || "number"}
|
|
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) => {
|
|
@@ -879,22 +879,46 @@ const FilterForm = ({
|
|
|
879
879
|
];
|
|
880
880
|
|
|
881
881
|
// Should the date picker be shown?
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
882
|
+
if (filter?.filter_attribute_data_type === "date") {
|
|
883
|
+
const showDatePicker =
|
|
884
|
+
operator &&
|
|
885
|
+
dateAllowedOperators.includes(operator);
|
|
886
|
+
|
|
887
|
+
const showTextInsteadOfDate =
|
|
888
|
+
!operator ||
|
|
889
|
+
!dateAllowedOperators.includes(operator);
|
|
890
|
+
|
|
891
|
+
if (showTextInsteadOfDate) {
|
|
892
|
+
console.log(
|
|
893
|
+
"Inside showtext",
|
|
894
|
+
showTextInsteadOfDate
|
|
895
|
+
);
|
|
896
|
+
|
|
897
|
+
return (
|
|
898
|
+
<FormTextfield
|
|
899
|
+
filter={filter}
|
|
900
|
+
control={control}
|
|
901
|
+
onValueChange={updateFiltersFromForm}
|
|
902
|
+
/>
|
|
903
|
+
);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
// const showDatePicker =
|
|
908
|
+
// filter?.filter_attribute_data_type === "date" &&
|
|
909
|
+
// operator &&
|
|
910
|
+
// dateAllowedOperators.includes(operator);
|
|
911
|
+
|
|
912
|
+
// // Should textfield shown instead for date?
|
|
913
|
+
// const showTextInsteadOfDate =
|
|
914
|
+
// !operator ||
|
|
915
|
+
// !dateAllowedOperators.includes(operator);
|
|
916
|
+
|
|
917
|
+
// console.log("Show Date Picker:", showDatePicker);
|
|
918
|
+
// console.log(
|
|
919
|
+
// "Show Text Instead:",
|
|
920
|
+
// showTextInsteadOfDate
|
|
921
|
+
// );
|
|
898
922
|
|
|
899
923
|
// Now render exactly same logic except date override
|
|
900
924
|
if (
|
|
@@ -923,20 +947,6 @@ const FilterForm = ({
|
|
|
923
947
|
|
|
924
948
|
// DATE LOGIC
|
|
925
949
|
|
|
926
|
-
if (showTextInsteadOfDate) {
|
|
927
|
-
console.log(
|
|
928
|
-
"Inside showtext",
|
|
929
|
-
showTextInsteadOfDate
|
|
930
|
-
);
|
|
931
|
-
|
|
932
|
-
return (
|
|
933
|
-
<FormTextfield
|
|
934
|
-
filter={filter}
|
|
935
|
-
control={control}
|
|
936
|
-
onValueChange={updateFiltersFromForm}
|
|
937
|
-
/>
|
|
938
|
-
);
|
|
939
|
-
}
|
|
940
950
|
// if (showDatePicker) {
|
|
941
951
|
// console.log("Inside Date", showDatePicker);
|
|
942
952
|
// return (
|