ar-design 0.2.19 → 0.2.20

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.
@@ -20,6 +20,7 @@ interface ISingle {
20
20
  }
21
21
  export type Props = {
22
22
  options: Option[];
23
+ onSearch?: (searchText: string) => void;
23
24
  onClick?: () => void;
24
25
  onCreate?: (option: Option) => void;
25
26
  placeholder?: string;
@@ -6,7 +6,7 @@ import Chip from "../../data-display/chip";
6
6
  import Checkbox from "../checkbox";
7
7
  import Utils from "../../../libs/infrastructure/shared/Utils";
8
8
  import ReactDOM from "react-dom";
9
- const Select = ({ variant = "outlined", status, border = { radius: "sm" }, options, value, onChange, onClick, onCreate, multiple, placeholder, validation, upperCase, disabled, }) => {
9
+ const Select = ({ variant = "outlined", status, border = { radius: "sm" }, options, value, onChange, onSearch, onClick, onCreate, multiple, placeholder, validation, upperCase, disabled, }) => {
10
10
  const _selectionClassName = ["selections"];
11
11
  // refs
12
12
  const _arSelect = useRef(null);
@@ -219,6 +219,8 @@ const Select = ({ variant = "outlined", status, border = { radius: "sm" }, optio
219
219
  optionItems[_navigationIndex.current]?.classList.add("navigate-with-arrow-keys");
220
220
  // Yeniden konumlandır.
221
221
  setTimeout(() => handlePosition(), 0);
222
+ // Aramayı bileşen dışında kullanmak için dışarı aktarım metodu.
223
+ onSearch && onSearch(searchText);
222
224
  }, [searchText]);
223
225
  useEffect(() => {
224
226
  // Seçilen öğeye 'navigate-with-arrow-keys' sınıfını ekle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",