@paygreen/pgui 3.0.3 → 3.0.5
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/components/index.d.ts +1 -0
- package/dist/components/scroll-shadow/scroll-shadow.d.ts +7 -0
- package/dist/components/select/select.d.ts +10 -2
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-debounced-load-options.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -40
- package/dist/index.mjs +2758 -2747
- package/dist/pgui.css +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/shiki-adapter.d.ts +2 -0
- package/package.json +2 -1
- package/dist/hooks/scroll-shadow.d.ts +0 -7
|
@@ -12,6 +12,7 @@ export * from './loader/loader';
|
|
|
12
12
|
export * from './logos/logoPaygreenByLemonway';
|
|
13
13
|
export * from './modal/modal';
|
|
14
14
|
export * from './pagination/pagination';
|
|
15
|
+
export * from './scroll-shadow/scroll-shadow';
|
|
15
16
|
export * from './select/select';
|
|
16
17
|
export * from './sidebar/sidebar';
|
|
17
18
|
export * from './tooltip/tooltip';
|
|
@@ -13,7 +13,7 @@ export interface SelectOptionType {
|
|
|
13
13
|
/**
|
|
14
14
|
* Props for single-select mode
|
|
15
15
|
*/
|
|
16
|
-
export interface SingleSelectProps extends Omit<ReactSelectProps<SelectOptionType, false>, 'options' | 'isMulti' | 'onChange' | 'value'> {
|
|
16
|
+
export interface SingleSelectProps extends Omit<ReactSelectProps<SelectOptionType, false>, 'options' | 'isMulti' | 'onChange' | 'value' | 'noOptionsMessage'> {
|
|
17
17
|
/** Array of options to display */
|
|
18
18
|
options?: SelectOptionType[];
|
|
19
19
|
/** Enable multi-selection - must be false or undefined */
|
|
@@ -28,16 +28,20 @@ export interface SingleSelectProps extends Omit<ReactSelectProps<SelectOptionTyp
|
|
|
28
28
|
isCreatable?: boolean;
|
|
29
29
|
/** Function to load options asynchronously */
|
|
30
30
|
loadOptions?: (inputValue: string) => Promise<SelectOptionType[]>;
|
|
31
|
+
/** Debounce delay in milliseconds for async loading */
|
|
32
|
+
debounceDelay?: number;
|
|
31
33
|
/** Name attribute for form integration */
|
|
32
34
|
name?: string;
|
|
33
35
|
/** Whether the select is in invalid state */
|
|
34
36
|
invalid?: boolean;
|
|
35
37
|
disabled?: boolean;
|
|
38
|
+
/** Custom message to display when no options are available */
|
|
39
|
+
noOptionsMessage?: string;
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* Props for multi-select mode
|
|
39
43
|
*/
|
|
40
|
-
export interface MultiSelectProps extends Omit<ReactSelectProps<SelectOptionType, true>, 'options' | 'isMulti' | 'onChange' | 'value'> {
|
|
44
|
+
export interface MultiSelectProps extends Omit<ReactSelectProps<SelectOptionType, true>, 'options' | 'isMulti' | 'onChange' | 'value' | 'noOptionsMessage'> {
|
|
41
45
|
/** Array of options to display */
|
|
42
46
|
options?: SelectOptionType[];
|
|
43
47
|
/** Enable multi-selection - must be true */
|
|
@@ -52,11 +56,15 @@ export interface MultiSelectProps extends Omit<ReactSelectProps<SelectOptionType
|
|
|
52
56
|
isCreatable?: boolean;
|
|
53
57
|
/** Function to load options asynchronously */
|
|
54
58
|
loadOptions?: (inputValue: string) => Promise<SelectOptionType[]>;
|
|
59
|
+
/** Debounce delay in milliseconds for async loading (default: 300ms) */
|
|
60
|
+
debounceDelay?: number;
|
|
55
61
|
/** Name attribute for form integration */
|
|
56
62
|
name?: string;
|
|
57
63
|
/** Whether the select is in invalid state */
|
|
58
64
|
invalid?: boolean;
|
|
59
65
|
disabled?: boolean;
|
|
66
|
+
/** Custom message to display when no options are available */
|
|
67
|
+
noOptionsMessage?: string;
|
|
60
68
|
}
|
|
61
69
|
/**
|
|
62
70
|
* Union type for Select component props
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SelectOptionType } from '../components/select/select';
|
|
2
|
+
/**
|
|
3
|
+
* Create a debounced load options function for async Select components
|
|
4
|
+
*
|
|
5
|
+
* @param loadOptions - The async function to load options
|
|
6
|
+
* @param debounceDelay - The delay in milliseconds before calling loadOptions
|
|
7
|
+
* @returns A debounced function that can be used with react-select async components
|
|
8
|
+
*/
|
|
9
|
+
export declare const useDebouncedLoadOptions: (loadOptions: ((inputValue: string) => Promise<SelectOptionType[]>) | undefined, debounceDelay: number) => (inputValue: string, callback: (options: SelectOptionType[]) => void) => void;
|
package/dist/index.d.ts
CHANGED