@loadsmart/loadsmart-ui 5.11.1 → 5.12.0

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.
@@ -51,6 +51,9 @@ export declare type Components = {
51
51
  CreatableOption?: CreatableOptionType;
52
52
  };
53
53
  export declare type CreateOptionPosition = 'first' | 'last';
54
+ export declare type OnChange = (event: EventLike<Option | Option[] | null>) => void;
55
+ export declare type OnCreate = (query: string) => Promise<void | Option> | void | Option;
56
+ export declare type OnQueryChange = (e: ChangeEvent<HTMLInputElement>) => void;
54
57
  export interface SelectProps extends DropdownProps {
55
58
  name: string;
56
59
  placeholder?: string;
@@ -60,11 +63,15 @@ export interface SelectProps extends DropdownProps {
60
63
  datasources?: SelectDatasourceFunction<any>[];
61
64
  options?: GenericOption[];
62
65
  components?: Components;
63
- onChange?: (event: EventLike<Option | Option[] | null>) => void;
64
- onCreate?: (query: string) => Promise<void | Option> | void | Option;
65
- onQueryChange?: (e: ChangeEvent<HTMLInputElement>) => void;
66
+ onChange?: OnChange;
67
+ onCreate?: OnCreate;
68
+ onQueryChange?: OnQueryChange;
66
69
  isValidNewOption?: ((query: string) => boolean) | boolean;
67
70
  createOptionPosition?: CreateOptionPosition;
71
+ /**
72
+ * Hide the clear button on the Single Select.
73
+ */
74
+ hideClear?: boolean;
68
75
  }
69
76
  export declare type SelectOptionProps = {
70
77
  value: SelectableKeyType;
@@ -1,3 +1,3 @@
1
1
  export { default as Select } from './Select';
2
- export type { SelectProps, useSelectExternalReturn as useSelectReturn, SelectComponentsOptionProps as SelectOptionProps, SelectComponentsEmptyProps as SelectEmptyProps, } from './Select.types';
2
+ export type { SelectProps, useSelectExternalReturn as useSelectReturn, SelectComponentsOptionProps as SelectOptionProps, SelectComponentsEmptyProps as SelectEmptyProps, Option as SelectOption, OnChange as SelectOnChange, OnCreate as SelectOnCreate, OnQueryChange as SelectOnQueryChange, } from './Select.types';
3
3
  export { useSelectExternal as useSelect } from './useSelectExternal';