@apexcura/ui-components 0.0.13-Beta34 → 0.0.13-Beta37

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.d.mts CHANGED
@@ -13,7 +13,7 @@ type ElementType = {
13
13
  prefix?: React.ReactNode;
14
14
  type?: string;
15
15
  size?: SizeType;
16
- value?: string | number | boolean | any[] | null | undefined;
16
+ value?: string | number | boolean | any[] | null | object | undefined;
17
17
  status?: "error" | "warning";
18
18
  styles?: React.CSSProperties;
19
19
  variant?: "outlined" | "borderless" | "filled";
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ type ElementType = {
13
13
  prefix?: React.ReactNode;
14
14
  type?: string;
15
15
  size?: SizeType;
16
- value?: string | number | boolean | any[] | null | undefined;
16
+ value?: string | number | boolean | any[] | null | object | undefined;
17
17
  status?: "error" | "warning";
18
18
  styles?: React.CSSProperties;
19
19
  variant?: "outlined" | "borderless" | "filled";
package/dist/index.js CHANGED
@@ -876,41 +876,34 @@ var SingleCheckbox = (props) => {
876
876
  var import_react27 = __toESM(require("react"));
877
877
  var import_antd19 = require("antd");
878
878
  var MultiSelect = (props) => {
879
- const [options, setOptions] = (0, import_react27.useState)([]);
880
- const [selectedOptions, setSelectedOptions] = (0, import_react27.useState)([]);
881
- (0, import_react27.useEffect)(() => {
882
- const newOptions = [];
883
- for (let i = 1; i < 100; i++) {
884
- newOptions.push({
885
- value: i,
886
- label: i
887
- });
879
+ const [selectedValue, setSelectedValue] = (0, import_react27.useState)({ firstValue: {}, secondValue: {} });
880
+ const handleFirstChange = (value) => {
881
+ if (props.onChange) {
882
+ const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
883
+ setSelectedValue((prev) => ({ ...prev, firstValue: filterOption2 }));
884
+ props.onChange(selectedValue);
888
885
  }
889
- setOptions(newOptions && newOptions);
890
- console.log("options========", options);
891
- }, []);
892
- const handleChange = (value) => {
893
- const filterOption2 = options.find((eachOption) => eachOption.value === value);
894
- console.log("filterOption", filterOption2);
895
- if (filterOption2) {
896
- setSelectedOptions((prev) => [...prev, filterOption2]);
897
- console.log(selectedOptions);
886
+ };
887
+ const handleSecondChange = (value) => {
888
+ if (props.onChange) {
889
+ const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
890
+ setSelectedValue((prev) => ({ ...prev, firstValue: filterOption2 }));
891
+ props.onChange({ secondValue: filterOption2 });
898
892
  }
899
893
  };
900
- console.log("selectedOptions", selectedOptions);
901
- return /* @__PURE__ */ import_react27.default.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray", width: "200px" } }, /* @__PURE__ */ import_react27.default.createElement(
894
+ return /* @__PURE__ */ import_react27.default.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray", width: "100px" } }, /* @__PURE__ */ import_react27.default.createElement(
902
895
  import_antd19.Select,
903
896
  {
904
- onChange: handleChange,
897
+ onChange: handleFirstChange,
905
898
  variant: props.variant,
906
- options
899
+ options: props.options
907
900
  }
908
901
  ), /* @__PURE__ */ import_react27.default.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ import_react27.default.createElement(
909
902
  import_antd19.Select,
910
903
  {
911
- onChange: handleChange,
904
+ onChange: handleSecondChange,
912
905
  variant: props.variant,
913
- options
906
+ options: props.options
914
907
  }
915
908
  ));
916
909
  };
package/dist/index.mjs CHANGED
@@ -817,44 +817,37 @@ var SingleCheckbox = (props) => {
817
817
  };
818
818
 
819
819
  // src/Components/MultiSelect.tsx
820
- import React26, { useState as useState7, useEffect as useEffect2 } from "react";
820
+ import React26, { useState as useState7 } from "react";
821
821
  import { Select as Select4 } from "antd";
822
822
  var MultiSelect = (props) => {
823
- const [options, setOptions] = useState7([]);
824
- const [selectedOptions, setSelectedOptions] = useState7([]);
825
- useEffect2(() => {
826
- const newOptions = [];
827
- for (let i = 1; i < 100; i++) {
828
- newOptions.push({
829
- value: i,
830
- label: i
831
- });
823
+ const [selectedValue, setSelectedValue] = useState7({ firstValue: {}, secondValue: {} });
824
+ const handleFirstChange = (value) => {
825
+ if (props.onChange) {
826
+ const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
827
+ setSelectedValue((prev) => ({ ...prev, firstValue: filterOption2 }));
828
+ props.onChange(selectedValue);
832
829
  }
833
- setOptions(newOptions && newOptions);
834
- console.log("options========", options);
835
- }, []);
836
- const handleChange = (value) => {
837
- const filterOption2 = options.find((eachOption) => eachOption.value === value);
838
- console.log("filterOption", filterOption2);
839
- if (filterOption2) {
840
- setSelectedOptions((prev) => [...prev, filterOption2]);
841
- console.log(selectedOptions);
830
+ };
831
+ const handleSecondChange = (value) => {
832
+ if (props.onChange) {
833
+ const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
834
+ setSelectedValue((prev) => ({ ...prev, firstValue: filterOption2 }));
835
+ props.onChange({ secondValue: filterOption2 });
842
836
  }
843
837
  };
844
- console.log("selectedOptions", selectedOptions);
845
- return /* @__PURE__ */ React26.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray", width: "200px" } }, /* @__PURE__ */ React26.createElement(
838
+ return /* @__PURE__ */ React26.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray", width: "100px" } }, /* @__PURE__ */ React26.createElement(
846
839
  Select4,
847
840
  {
848
- onChange: handleChange,
841
+ onChange: handleFirstChange,
849
842
  variant: props.variant,
850
- options
843
+ options: props.options
851
844
  }
852
845
  ), /* @__PURE__ */ React26.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React26.createElement(
853
846
  Select4,
854
847
  {
855
- onChange: handleChange,
848
+ onChange: handleSecondChange,
856
849
  variant: props.variant,
857
- options
850
+ options: props.options
858
851
  }
859
852
  ));
860
853
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.13-Beta34",
3
+ "version": "0.0.13-Beta37",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",