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

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,31 @@ 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 handleFirstChange = (value) => {
880
+ if (props.onChange) {
881
+ const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
882
+ props.onChange({ firstvalue: filterOption2 });
888
883
  }
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);
884
+ };
885
+ const handleSecondChange = (value) => {
886
+ if (props.onChange) {
887
+ const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
888
+ props.onChange({ secondValue: filterOption2 });
898
889
  }
899
890
  };
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(
891
+ 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
892
  import_antd19.Select,
903
893
  {
904
- onChange: handleChange,
894
+ onChange: handleFirstChange,
905
895
  variant: props.variant,
906
- options
896
+ options: props.options
907
897
  }
908
898
  ), /* @__PURE__ */ import_react27.default.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ import_react27.default.createElement(
909
899
  import_antd19.Select,
910
900
  {
911
- onChange: handleChange,
901
+ onChange: handleSecondChange,
912
902
  variant: props.variant,
913
- options
903
+ options: props.options
914
904
  }
915
905
  ));
916
906
  };
package/dist/index.mjs CHANGED
@@ -817,44 +817,34 @@ 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 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 handleFirstChange = (value) => {
824
+ if (props.onChange) {
825
+ const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
826
+ props.onChange({ firstvalue: filterOption2 });
832
827
  }
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);
828
+ };
829
+ const handleSecondChange = (value) => {
830
+ if (props.onChange) {
831
+ const filterOption2 = props.options && props.options.find((eachOption) => eachOption.value === value);
832
+ props.onChange({ secondValue: filterOption2 });
842
833
  }
843
834
  };
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(
835
+ 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
836
  Select4,
847
837
  {
848
- onChange: handleChange,
838
+ onChange: handleFirstChange,
849
839
  variant: props.variant,
850
- options
840
+ options: props.options
851
841
  }
852
842
  ), /* @__PURE__ */ React26.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React26.createElement(
853
843
  Select4,
854
844
  {
855
- onChange: handleChange,
845
+ onChange: handleSecondChange,
856
846
  variant: props.variant,
857
- options
847
+ options: props.options
858
848
  }
859
849
  ));
860
850
  };
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-Beta36",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",