@apexcura/ui-components 0.0.14-Beta26 → 0.0.14-Beta28

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
@@ -740,13 +740,16 @@ var TableElement = (props) => {
740
740
  // src/Components/DatePicker.tsx
741
741
  var import_react21 = __toESM(require("react"));
742
742
  var import_antd15 = require("antd");
743
+ var import_dayjs = __toESM(require("dayjs"));
744
+ var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"));
745
+ import_dayjs.default.extend(import_customParseFormat.default);
743
746
  var DatePickerElement = (props) => {
744
747
  const [dateState, setDateState] = (0, import_react21.useState)("");
745
748
  const dateFormat = "DD/MM/YYYY";
746
749
  const handleChange = (date, dateString) => {
747
750
  if (date) {
748
751
  const formattedDate = date.format(dateFormat);
749
- setDateState(formattedDate);
752
+ setDateState(date);
750
753
  if (props.onChange) {
751
754
  props.onChange(formattedDate);
752
755
  }
@@ -761,7 +764,8 @@ var DatePickerElement = (props) => {
761
764
  import_antd15.DatePicker,
762
765
  {
763
766
  placeholder: props.placeholder,
764
- value: dateState,
767
+ value: (0, import_dayjs.default)(dateState, dateFormat),
768
+ format: dateFormat,
765
769
  variant: "borderless",
766
770
  onChange: handleChange
767
771
  }
@@ -771,7 +775,7 @@ var DatePickerElement = (props) => {
771
775
  // src/Components/DateRangePickerElement.tsx
772
776
  var import_react22 = __toESM(require("react"));
773
777
  var import_antd16 = require("antd");
774
- var import_dayjs = __toESM(require("dayjs"));
778
+ var import_dayjs2 = __toESM(require("dayjs"));
775
779
  var DateRangePickerElement = (props) => {
776
780
  const { RangePicker } = import_antd16.DatePicker;
777
781
  const handleChange = (dates, dateStrings) => {
@@ -782,10 +786,10 @@ var DateRangePickerElement = (props) => {
782
786
  }
783
787
  };
784
788
  const rangePresets = [
785
- { label: "Last 7 Days", value: [(0, import_dayjs.default)().add(-7, "d"), (0, import_dayjs.default)()] },
786
- { label: "Last 14 Days", value: [(0, import_dayjs.default)().add(-14, "d"), (0, import_dayjs.default)()] },
787
- { label: "Last 30 Days", value: [(0, import_dayjs.default)().add(-30, "d"), (0, import_dayjs.default)()] },
788
- { label: "Last 90 Days", value: [(0, import_dayjs.default)().add(-90, "d"), (0, import_dayjs.default)()] }
789
+ { label: "Last 7 Days", value: [(0, import_dayjs2.default)().add(-7, "d"), (0, import_dayjs2.default)()] },
790
+ { label: "Last 14 Days", value: [(0, import_dayjs2.default)().add(-14, "d"), (0, import_dayjs2.default)()] },
791
+ { label: "Last 30 Days", value: [(0, import_dayjs2.default)().add(-30, "d"), (0, import_dayjs2.default)()] },
792
+ { label: "Last 90 Days", value: [(0, import_dayjs2.default)().add(-90, "d"), (0, import_dayjs2.default)()] }
789
793
  ];
790
794
  return /* @__PURE__ */ import_react22.default.createElement(import_antd16.Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ import_react22.default.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
791
795
  };
@@ -814,19 +818,21 @@ var import_antd18 = require("antd");
814
818
  var DropDownGroup = (props) => {
815
819
  const [selectedValue, setSelectedValue] = (0, import_react25.useState)({
816
820
  firstValue: {},
817
- secondValue: {}
821
+ secondValue: {},
822
+ temp: ""
818
823
  });
819
824
  const handleFirstChange = (value) => {
825
+ console.log(selectedValue.temp);
820
826
  const filterOption2 = props.firstOptions?.find(
821
827
  (eachOption) => eachOption.value === value
822
828
  );
823
829
  setSelectedValue((prev) => {
824
830
  const newValue = { ...prev, firstValue: filterOption2 };
831
+ const { temp, ...rest } = newValue;
825
832
  if (newValue.firstValue) {
826
- props.onChange?.(newValue);
833
+ props.onChange?.(rest);
827
834
  }
828
- console.log("selectedValue1=====", selectedValue);
829
- return selectedValue;
835
+ return newValue;
830
836
  });
831
837
  };
832
838
  const handleSecondChange = (value) => {
@@ -835,11 +841,11 @@ var DropDownGroup = (props) => {
835
841
  );
836
842
  setSelectedValue((prev) => {
837
843
  const newValue = { ...prev, secondValue: filterOption2 };
844
+ const { temp, ...rest } = newValue;
838
845
  if (newValue.secondValue) {
839
- props.onChange?.(newValue);
846
+ props.onChange?.(rest);
840
847
  }
841
- console.log("selectedValue2=====", selectedValue);
842
- return selectedValue;
848
+ return newValue;
843
849
  });
844
850
  };
845
851
  return /* @__PURE__ */ import_react25.default.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ import_react25.default.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ import_react25.default.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ import_react25.default.createElement(
package/dist/index.mjs CHANGED
@@ -682,13 +682,16 @@ var TableElement = (props) => {
682
682
  // src/Components/DatePicker.tsx
683
683
  import React21, { useState as useState6 } from "react";
684
684
  import { DatePicker } from "antd";
685
+ import dayjs from "dayjs";
686
+ import customParseFormat from "dayjs/plugin/customParseFormat.js";
687
+ dayjs.extend(customParseFormat);
685
688
  var DatePickerElement = (props) => {
686
689
  const [dateState, setDateState] = useState6("");
687
690
  const dateFormat = "DD/MM/YYYY";
688
691
  const handleChange = (date, dateString) => {
689
692
  if (date) {
690
693
  const formattedDate = date.format(dateFormat);
691
- setDateState(formattedDate);
694
+ setDateState(date);
692
695
  if (props.onChange) {
693
696
  props.onChange(formattedDate);
694
697
  }
@@ -703,7 +706,8 @@ var DatePickerElement = (props) => {
703
706
  DatePicker,
704
707
  {
705
708
  placeholder: props.placeholder,
706
- value: dateState,
709
+ value: dayjs(dateState, dateFormat),
710
+ format: dateFormat,
707
711
  variant: "borderless",
708
712
  onChange: handleChange
709
713
  }
@@ -713,7 +717,7 @@ var DatePickerElement = (props) => {
713
717
  // src/Components/DateRangePickerElement.tsx
714
718
  import React22 from "react";
715
719
  import { DatePicker as DatePicker2, Space } from "antd";
716
- import dayjs from "dayjs";
720
+ import dayjs2 from "dayjs";
717
721
  var DateRangePickerElement = (props) => {
718
722
  const { RangePicker } = DatePicker2;
719
723
  const handleChange = (dates, dateStrings) => {
@@ -724,10 +728,10 @@ var DateRangePickerElement = (props) => {
724
728
  }
725
729
  };
726
730
  const rangePresets = [
727
- { label: "Last 7 Days", value: [dayjs().add(-7, "d"), dayjs()] },
728
- { label: "Last 14 Days", value: [dayjs().add(-14, "d"), dayjs()] },
729
- { label: "Last 30 Days", value: [dayjs().add(-30, "d"), dayjs()] },
730
- { label: "Last 90 Days", value: [dayjs().add(-90, "d"), dayjs()] }
731
+ { label: "Last 7 Days", value: [dayjs2().add(-7, "d"), dayjs2()] },
732
+ { label: "Last 14 Days", value: [dayjs2().add(-14, "d"), dayjs2()] },
733
+ { label: "Last 30 Days", value: [dayjs2().add(-30, "d"), dayjs2()] },
734
+ { label: "Last 90 Days", value: [dayjs2().add(-90, "d"), dayjs2()] }
731
735
  ];
732
736
  return /* @__PURE__ */ React22.createElement(Space, { direction: "vertical", size: 12 }, /* @__PURE__ */ React22.createElement(RangePicker, { presets: rangePresets, onChange: handleChange }));
733
737
  };
@@ -756,19 +760,21 @@ import { Select as Select4 } from "antd";
756
760
  var DropDownGroup = (props) => {
757
761
  const [selectedValue, setSelectedValue] = useState7({
758
762
  firstValue: {},
759
- secondValue: {}
763
+ secondValue: {},
764
+ temp: ""
760
765
  });
761
766
  const handleFirstChange = (value) => {
767
+ console.log(selectedValue.temp);
762
768
  const filterOption2 = props.firstOptions?.find(
763
769
  (eachOption) => eachOption.value === value
764
770
  );
765
771
  setSelectedValue((prev) => {
766
772
  const newValue = { ...prev, firstValue: filterOption2 };
773
+ const { temp, ...rest } = newValue;
767
774
  if (newValue.firstValue) {
768
- props.onChange?.(newValue);
775
+ props.onChange?.(rest);
769
776
  }
770
- console.log("selectedValue1=====", selectedValue);
771
- return selectedValue;
777
+ return newValue;
772
778
  });
773
779
  };
774
780
  const handleSecondChange = (value) => {
@@ -777,11 +783,11 @@ var DropDownGroup = (props) => {
777
783
  );
778
784
  setSelectedValue((prev) => {
779
785
  const newValue = { ...prev, secondValue: filterOption2 };
786
+ const { temp, ...rest } = newValue;
780
787
  if (newValue.secondValue) {
781
- props.onChange?.(newValue);
788
+ props.onChange?.(rest);
782
789
  }
783
- console.log("selectedValue2=====", selectedValue);
784
- return selectedValue;
790
+ return newValue;
785
791
  });
786
792
  };
787
793
  return /* @__PURE__ */ React25.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React25.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React25.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ React25.createElement(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta26",
3
+ "version": "0.0.14-Beta28",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",