@apexcura/ui-components 0.0.14-Beta279 → 0.0.14-Beta280
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 +21 -3
- package/dist/index.mjs +21 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -884,11 +884,11 @@ var DateRangePickerElement = (props) => {
|
|
|
884
884
|
let [start, end] = dates;
|
|
885
885
|
const today2 = (0, import_dayjs2.default)();
|
|
886
886
|
if (end && end.isAfter(today2)) {
|
|
887
|
-
start = today2;
|
|
888
|
-
}
|
|
889
|
-
if (start && start.isBefore(today2)) {
|
|
890
887
|
end = today2;
|
|
891
888
|
}
|
|
889
|
+
if (start && start.isAfter(today2)) {
|
|
890
|
+
start = today2;
|
|
891
|
+
}
|
|
892
892
|
const adjustedDates = [start, end].map((date) => date ? date.format("DD-MM-YYYY") : null);
|
|
893
893
|
props.onChange && props.onChange(adjustedDates);
|
|
894
894
|
} else {
|
|
@@ -915,6 +915,23 @@ var DateRangePickerElement = (props) => {
|
|
|
915
915
|
return current && current > (0, import_moment2.default)();
|
|
916
916
|
};
|
|
917
917
|
}
|
|
918
|
+
const handleCalendarChange = (dates) => {
|
|
919
|
+
if (dates) {
|
|
920
|
+
let [start, end] = dates;
|
|
921
|
+
const today2 = (0, import_dayjs2.default)();
|
|
922
|
+
if (end && end.isAfter(today2)) {
|
|
923
|
+
end = today2;
|
|
924
|
+
}
|
|
925
|
+
if (start && start.isAfter(today2)) {
|
|
926
|
+
start = today2;
|
|
927
|
+
}
|
|
928
|
+
if (start && start.isBefore(today2)) {
|
|
929
|
+
end = today2;
|
|
930
|
+
}
|
|
931
|
+
const adjustedDates = [start, end].map((date) => date ? date : null);
|
|
932
|
+
props.onChange && props.onChange(adjustedDates);
|
|
933
|
+
}
|
|
934
|
+
};
|
|
918
935
|
return /* @__PURE__ */ import_react21.default.createElement(import_antd15.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react21.default.createElement(
|
|
919
936
|
RangePicker,
|
|
920
937
|
{
|
|
@@ -922,6 +939,7 @@ var DateRangePickerElement = (props) => {
|
|
|
922
939
|
...!props.weekrange && { presets: rangePresets },
|
|
923
940
|
format: "DD-MM-YYYY",
|
|
924
941
|
onChange: handleChange,
|
|
942
|
+
onCalendarChange: handleCalendarChange,
|
|
925
943
|
value: dateValues
|
|
926
944
|
}
|
|
927
945
|
));
|
package/dist/index.mjs
CHANGED
|
@@ -817,11 +817,11 @@ var DateRangePickerElement = (props) => {
|
|
|
817
817
|
let [start, end] = dates;
|
|
818
818
|
const today2 = dayjs2();
|
|
819
819
|
if (end && end.isAfter(today2)) {
|
|
820
|
-
start = today2;
|
|
821
|
-
}
|
|
822
|
-
if (start && start.isBefore(today2)) {
|
|
823
820
|
end = today2;
|
|
824
821
|
}
|
|
822
|
+
if (start && start.isAfter(today2)) {
|
|
823
|
+
start = today2;
|
|
824
|
+
}
|
|
825
825
|
const adjustedDates = [start, end].map((date) => date ? date.format("DD-MM-YYYY") : null);
|
|
826
826
|
props.onChange && props.onChange(adjustedDates);
|
|
827
827
|
} else {
|
|
@@ -848,6 +848,23 @@ var DateRangePickerElement = (props) => {
|
|
|
848
848
|
return current && current > moment2();
|
|
849
849
|
};
|
|
850
850
|
}
|
|
851
|
+
const handleCalendarChange = (dates) => {
|
|
852
|
+
if (dates) {
|
|
853
|
+
let [start, end] = dates;
|
|
854
|
+
const today2 = dayjs2();
|
|
855
|
+
if (end && end.isAfter(today2)) {
|
|
856
|
+
end = today2;
|
|
857
|
+
}
|
|
858
|
+
if (start && start.isAfter(today2)) {
|
|
859
|
+
start = today2;
|
|
860
|
+
}
|
|
861
|
+
if (start && start.isBefore(today2)) {
|
|
862
|
+
end = today2;
|
|
863
|
+
}
|
|
864
|
+
const adjustedDates = [start, end].map((date) => date ? date : null);
|
|
865
|
+
props.onChange && props.onChange(adjustedDates);
|
|
866
|
+
}
|
|
867
|
+
};
|
|
851
868
|
return /* @__PURE__ */ React21.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React21.createElement(
|
|
852
869
|
RangePicker,
|
|
853
870
|
{
|
|
@@ -855,6 +872,7 @@ var DateRangePickerElement = (props) => {
|
|
|
855
872
|
...!props.weekrange && { presets: rangePresets },
|
|
856
873
|
format: "DD-MM-YYYY",
|
|
857
874
|
onChange: handleChange,
|
|
875
|
+
onCalendarChange: handleCalendarChange,
|
|
858
876
|
value: dateValues
|
|
859
877
|
}
|
|
860
878
|
));
|