@tecsinapse/cortex-react 2.2.0-beta.2 → 2.2.0-beta.3

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.
@@ -23,6 +23,7 @@ const Autocomplete = ({
23
23
  setInputValue,
24
24
  label,
25
25
  onChange,
26
+ onSelect,
26
27
  disabled,
27
28
  options
28
29
  }) => {
@@ -44,6 +45,7 @@ const Autocomplete = ({
44
45
  }
45
46
  setInputValue("");
46
47
  setOpen(false);
48
+ onSelect(option);
47
49
  };
48
50
  const handleChange = (event) => {
49
51
  onChange(event);
@@ -21,6 +21,7 @@ const Autocomplete = ({
21
21
  setInputValue,
22
22
  label,
23
23
  onChange,
24
+ onSelect,
24
25
  disabled,
25
26
  options
26
27
  }) => {
@@ -42,6 +43,7 @@ const Autocomplete = ({
42
43
  }
43
44
  setInputValue("");
44
45
  setOpen(false);
46
+ onSelect(option);
45
47
  };
46
48
  const handleChange = (event) => {
47
49
  onChange(event);
@@ -3,6 +3,7 @@ interface AutocompleteProps {
3
3
  inputValue: string;
4
4
  setInputValue: React.Dispatch<React.SetStateAction<string>>;
5
5
  onChange: ChangeEventHandler<HTMLInputElement>;
6
+ onSelect: (option: Option) => void;
6
7
  label?: string;
7
8
  placeholder?: string;
8
9
  disabled?: boolean;
@@ -12,5 +13,5 @@ interface Option {
12
13
  label: string;
13
14
  value: string;
14
15
  }
15
- export declare const Autocomplete: ({ inputValue, setInputValue, label, onChange, disabled, options, }: AutocompleteProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const Autocomplete: ({ inputValue, setInputValue, label, onChange, onSelect, disabled, options, }: AutocompleteProps) => import("react/jsx-runtime").JSX.Element;
16
17
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tecsinapse/cortex-react",
3
- "version": "2.2.0-beta.2",
3
+ "version": "2.2.0-beta.3",
4
4
  "description": "React components based in @tecsinapse/cortex-core",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
@@ -48,5 +48,5 @@
48
48
  "react-icons": ">=5.2.0",
49
49
  "tailwindcss": "^4.1.16"
50
50
  },
51
- "gitHead": "e4febec476bbf4dc7a3b735b3eaf5a05c3fc6fee"
51
+ "gitHead": "a8768e0f4e02c8b8c0494f0741284d21c2eb0e4b"
52
52
  }