@snmt-react-ui/async-select 1.1.0 → 1.1.2

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.
@@ -1,7 +1,8 @@
1
1
  import { OptionProps, SingleSelectProps, MultiSelectProps } from '@snmt-react-ui/select';
2
2
 
3
- export interface SingleAsyncSelectProps extends SingleSelectProps {
4
- /** Sets value for the city select */
3
+ type AsyncSelectProps = BaseAsyncSelectProps & (Omit<SingleSelectProps, 'options'> | Omit<MultiSelectProps, 'options'>);
4
+ interface BaseAsyncSelectProps {
5
+ /** Function for load options asynchronously */
5
6
  loadOptions: (pagination: {
6
7
  offset: number;
7
8
  limit: number;
@@ -11,22 +12,7 @@ export interface SingleAsyncSelectProps extends SingleSelectProps {
11
12
  count: number;
12
13
  limit: number;
13
14
  }>;
14
- /** Boolean flag to load options even when the dropdown is closed */
15
- loadOptionsOnClosedState?: boolean;
15
+ loadOnClosedState?: boolean;
16
16
  }
17
- export interface MultipleAsyncSelectProps extends MultiSelectProps {
18
- /** Sets value for the city select */
19
- loadOptions: (pagination: {
20
- offset: number;
21
- limit: number;
22
- search?: string;
23
- }) => Promise<{
24
- options: OptionProps[];
25
- count: number;
26
- limit: number;
27
- }>;
28
- /** Boolean flag to load options even when the dropdown is closed */
29
- loadOptionsOnClosedState?: boolean;
30
- }
31
- export type AsyncSelectProps = SingleAsyncSelectProps | MultipleAsyncSelectProps;
32
17
  export declare const AsyncSelect: import('react').ForwardRefExoticComponent<AsyncSelectProps & import('react').RefAttributes<any>>;
18
+ export {};