@apexcura/ui-components 0.0.14-Beta292 → 0.0.14-Beta294

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 CHANGED
@@ -874,7 +874,6 @@ var DatePickerElement = (props) => {
874
874
  var import_react21 = __toESM(require("react"));
875
875
  var import_antd15 = require("antd");
876
876
  var import_dayjs2 = __toESM(require("dayjs"));
877
- var import_moment2 = __toESM(require("moment"));
878
877
  var DateRangePickerElement = (props) => {
879
878
  const { value } = props;
880
879
  const { RangePicker } = import_antd15.DatePicker;
@@ -886,7 +885,9 @@ var DateRangePickerElement = (props) => {
886
885
  if (start && start.isBefore(today) && end && end.isAfter(today)) {
887
886
  end = today;
888
887
  }
889
- const adjustedDates = [start, end].map((date) => date ? date.format("DD-MM-YYYY") : null);
888
+ const adjustedDates = [start, end].map(
889
+ (date) => date ? date.format("DD-MM-YYYY") : null
890
+ );
890
891
  props.onChange && props.onChange(adjustedDates);
891
892
  } else {
892
893
  props.onChange && props.onChange("");
@@ -900,9 +901,9 @@ var DateRangePickerElement = (props) => {
900
901
  ];
901
902
  const disabledDate = (current) => {
902
903
  if (props.weekrange) {
903
- return current && current < today.subtract(7, "d");
904
+ return current && current < today.subtract(7, "d") || current > today;
904
905
  }
905
- return current && current > (0, import_moment2.default)();
906
+ return current && current > today;
906
907
  };
907
908
  const handleCalendarChange = (dates) => {
908
909
  if (dates) {
@@ -910,8 +911,12 @@ var DateRangePickerElement = (props) => {
910
911
  if (start && start.isBefore(today) && end && end.isAfter(today)) {
911
912
  end = today;
912
913
  }
913
- const adjustedDates = [start, end];
914
+ const adjustedDates = [start, end].map(
915
+ (date) => date ? date.format("DD-MM-YYYY") : null
916
+ );
914
917
  props.onChange && props.onChange(adjustedDates);
918
+ } else {
919
+ props.onChange && props.onChange("");
915
920
  }
916
921
  };
917
922
  return /* @__PURE__ */ import_react21.default.createElement(import_antd15.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react21.default.createElement(
package/dist/index.mjs CHANGED
@@ -807,7 +807,6 @@ var DatePickerElement = (props) => {
807
807
  import React21 from "react";
808
808
  import { DatePicker as DatePicker2, Space } from "antd";
809
809
  import dayjs2 from "dayjs";
810
- import moment2 from "moment";
811
810
  var DateRangePickerElement = (props) => {
812
811
  const { value } = props;
813
812
  const { RangePicker } = DatePicker2;
@@ -819,7 +818,9 @@ var DateRangePickerElement = (props) => {
819
818
  if (start && start.isBefore(today) && end && end.isAfter(today)) {
820
819
  end = today;
821
820
  }
822
- const adjustedDates = [start, end].map((date) => date ? date.format("DD-MM-YYYY") : null);
821
+ const adjustedDates = [start, end].map(
822
+ (date) => date ? date.format("DD-MM-YYYY") : null
823
+ );
823
824
  props.onChange && props.onChange(adjustedDates);
824
825
  } else {
825
826
  props.onChange && props.onChange("");
@@ -833,9 +834,9 @@ var DateRangePickerElement = (props) => {
833
834
  ];
834
835
  const disabledDate = (current) => {
835
836
  if (props.weekrange) {
836
- return current && current < today.subtract(7, "d");
837
+ return current && current < today.subtract(7, "d") || current > today;
837
838
  }
838
- return current && current > moment2();
839
+ return current && current > today;
839
840
  };
840
841
  const handleCalendarChange = (dates) => {
841
842
  if (dates) {
@@ -843,8 +844,12 @@ var DateRangePickerElement = (props) => {
843
844
  if (start && start.isBefore(today) && end && end.isAfter(today)) {
844
845
  end = today;
845
846
  }
846
- const adjustedDates = [start, end];
847
+ const adjustedDates = [start, end].map(
848
+ (date) => date ? date.format("DD-MM-YYYY") : null
849
+ );
847
850
  props.onChange && props.onChange(adjustedDates);
851
+ } else {
852
+ props.onChange && props.onChange("");
848
853
  }
849
854
  };
850
855
  return /* @__PURE__ */ React21.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React21.createElement(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta292",
3
+ "version": "0.0.14-Beta294",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",