@snmt-react-ui/async-select 1.7.1 → 1.7.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.
- package/dist/AsyncSelect.d.ts +13 -1
- package/dist/async-select.js +1568 -1501
- package/dist/index.css +1 -1
- package/dist/usePrevious.d.ts +1 -0
- package/package.json +3 -3
package/dist/AsyncSelect.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { OptionProps, SingleSelectProps, MultiSelectProps } from '@snmt-react-ui/select';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* AsyncSelect is a flexible select component that loads its options asynchronously.
|
|
5
|
+
* It is suitable for large or remote datasets, supporting both single and multiple selection modes.
|
|
6
|
+
*/
|
|
3
7
|
export type AsyncSelectProps = BaseAsyncSelectProps & (Omit<SingleSelectProps, 'options'> | Omit<MultiSelectProps, 'options'>);
|
|
4
8
|
export type AsyncSelectRef = {
|
|
5
9
|
refetchOptions: () => Promise<void>;
|
|
6
10
|
};
|
|
7
11
|
interface BaseAsyncSelectProps {
|
|
8
12
|
/** Function for load options asynchronously */
|
|
9
|
-
loadOptions: (
|
|
13
|
+
loadOptions: (params: {
|
|
10
14
|
offset: number;
|
|
11
15
|
limit: number;
|
|
12
16
|
search?: string;
|
|
@@ -15,7 +19,15 @@ interface BaseAsyncSelectProps {
|
|
|
15
19
|
count: number;
|
|
16
20
|
limit: number;
|
|
17
21
|
}>;
|
|
22
|
+
/**
|
|
23
|
+
* If true, options are loaded when the dropdown is closed (e.g., in the background).
|
|
24
|
+
* If false, options are reloaded every time the dropdown
|
|
25
|
+
* is opened (previous options are reset on each open).
|
|
26
|
+
*/
|
|
27
|
+
/**@deprecated Use preloadOptions instead*/
|
|
18
28
|
loadOnClosedState?: boolean;
|
|
29
|
+
/**Use preloadOptions instead. */
|
|
30
|
+
preloadOptions?: boolean;
|
|
19
31
|
}
|
|
20
32
|
export declare const AsyncSelect: import('react').ForwardRefExoticComponent<AsyncSelectProps & import('react').RefAttributes<AsyncSelectRef>>;
|
|
21
33
|
export {};
|