@apexcura/ui-components 0.0.13-Beta86 → 0.0.13-Beta88

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
@@ -807,21 +807,26 @@ var import_react25 = __toESM(require("react"));
807
807
  var import_antd18 = require("antd");
808
808
  var DropDownGroup = (props) => {
809
809
  const [selectedValue, setSelectedValue] = (0, import_react25.useState)({ firstValue: {}, secondValue: {} });
810
+ console.log(selectedValue);
810
811
  const handleFirstChange = (value) => {
811
- if (props.onChange) {
812
- const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
813
- setSelectedValue((prev) => ({ ...prev, firstValue: filterOption2 }));
814
- console.log("selectedValue----------", selectedValue);
815
- props.onChange(selectedValue);
816
- }
812
+ const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
813
+ setSelectedValue((prev) => {
814
+ const newValue = { ...prev, firstValue: filterOption2 };
815
+ if (props.onChange) {
816
+ props.onChange(newValue);
817
+ }
818
+ return newValue;
819
+ });
817
820
  };
818
821
  const handleSecondChange = (value) => {
819
- if (props.onChange) {
820
- const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
821
- console.log("filterOption2--------", filterOption2);
822
- setSelectedValue((prev) => ({ ...prev, secondValue: filterOption2 }));
823
- props.onChange(selectedValue);
824
- }
822
+ const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
823
+ setSelectedValue((prev) => {
824
+ const newValue = { ...prev, secondValue: filterOption2 };
825
+ if (props.onChange) {
826
+ props.onChange(newValue);
827
+ }
828
+ return newValue;
829
+ });
825
830
  };
826
831
  return /* @__PURE__ */ import_react25.default.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray", width: "100px" } }, /* @__PURE__ */ import_react25.default.createElement(
827
832
  import_antd18.Select,
package/dist/index.mjs CHANGED
@@ -750,21 +750,26 @@ import React25, { useState as useState7 } from "react";
750
750
  import { Select as Select4 } from "antd";
751
751
  var DropDownGroup = (props) => {
752
752
  const [selectedValue, setSelectedValue] = useState7({ firstValue: {}, secondValue: {} });
753
+ console.log(selectedValue);
753
754
  const handleFirstChange = (value) => {
754
- if (props.onChange) {
755
- const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
756
- setSelectedValue((prev) => ({ ...prev, firstValue: filterOption2 }));
757
- console.log("selectedValue----------", selectedValue);
758
- props.onChange(selectedValue);
759
- }
755
+ const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
756
+ setSelectedValue((prev) => {
757
+ const newValue = { ...prev, firstValue: filterOption2 };
758
+ if (props.onChange) {
759
+ props.onChange(newValue);
760
+ }
761
+ return newValue;
762
+ });
760
763
  };
761
764
  const handleSecondChange = (value) => {
762
- if (props.onChange) {
763
- const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
764
- console.log("filterOption2--------", filterOption2);
765
- setSelectedValue((prev) => ({ ...prev, secondValue: filterOption2 }));
766
- props.onChange(selectedValue);
767
- }
765
+ const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
766
+ setSelectedValue((prev) => {
767
+ const newValue = { ...prev, secondValue: filterOption2 };
768
+ if (props.onChange) {
769
+ props.onChange(newValue);
770
+ }
771
+ return newValue;
772
+ });
768
773
  };
769
774
  return /* @__PURE__ */ React25.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray", width: "100px" } }, /* @__PURE__ */ React25.createElement(
770
775
  Select4,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.13-Beta86",
3
+ "version": "0.0.13-Beta88",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",