@onehaul/ui 1.1.15 → 1.1.16
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/Button/index.d.ts +0 -1
- package/dist/components/Drawer/index.d.ts +0 -1
- package/dist/components/Select/index.d.ts +93 -101
- package/dist/icons/index.d.ts +0 -7
- package/dist/icons/index.esm.js +1 -1
- package/dist/icons/index.esm.js.map +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,115 +1,107 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
|
|
3
3
|
export interface SelectOption {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
value: any;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
suffix?: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface SelectProps {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
surface?: 'dropdown' | 'bottom-sheet';
|
|
75
|
-
sheetHeight?: string | number;
|
|
76
|
-
optionsMaxHeight?: string | number;
|
|
77
|
-
topCornerRadius?: string | number;
|
|
78
|
-
sheetTitle?: React.ReactNode;
|
|
79
|
-
showHeader?: boolean;
|
|
80
|
-
showBackButton?: boolean;
|
|
81
|
-
onBackButtonClick?: () => void;
|
|
12
|
+
id?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
value?: any;
|
|
15
|
+
defaultValue?: any;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
allowClear?: boolean;
|
|
20
|
+
showSearch?: boolean;
|
|
21
|
+
filterOption?: boolean | ((input: string, option: any) => boolean);
|
|
22
|
+
mode?: "single" | "multiple";
|
|
23
|
+
size?: "md" | "lg";
|
|
24
|
+
maxTagCount?: number | "responsive";
|
|
25
|
+
options?: SelectOption[];
|
|
26
|
+
onChange?: (value: any, option?: any) => void;
|
|
27
|
+
onSelect?: (value: any, option: any) => void;
|
|
28
|
+
onDeselect?: (value: any, option: any) => void;
|
|
29
|
+
onSearch?: (value: string) => void;
|
|
30
|
+
onFocus?: (e: React.FocusEvent) => void;
|
|
31
|
+
onBlur?: (e: React.FocusEvent) => void;
|
|
32
|
+
className?: string;
|
|
33
|
+
style?: React.CSSProperties;
|
|
34
|
+
dropdownStyle?: React.CSSProperties;
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
helperText?: string;
|
|
37
|
+
error?: boolean;
|
|
38
|
+
debounceTimeout?: number;
|
|
39
|
+
type?: "primary" | "secondary";
|
|
40
|
+
fetchOptions?: (search: string) => Promise<SelectOption[]>;
|
|
41
|
+
prefix?: React.ReactNode;
|
|
42
|
+
suffix?: React.ReactNode;
|
|
43
|
+
showTickIcon?: boolean;
|
|
44
|
+
plainLabel?: boolean;
|
|
45
|
+
plainLabelClearable?: boolean;
|
|
46
|
+
|
|
47
|
+
// Enhanced async props - functions can handle their own parameters internally
|
|
48
|
+
onFocusLoad?: (params?: any) => Promise<SelectOption[]>;
|
|
49
|
+
onSearchLoad?: (searchValue: string) => Promise<SelectOption[]>;
|
|
50
|
+
loadOnMount?: boolean;
|
|
51
|
+
cacheOptions?: boolean;
|
|
52
|
+
searchThreshold?: number;
|
|
53
|
+
|
|
54
|
+
// Cache-related props
|
|
55
|
+
cacheTimeout?: number; // Cache timeout in milliseconds
|
|
56
|
+
cacheKey?: string; // Custom cache key for this instance
|
|
57
|
+
|
|
58
|
+
// Utility functions (optional - for debugging/monitoring)
|
|
59
|
+
onCacheHit?: (key: string, data: any) => void;
|
|
60
|
+
onCacheMiss?: (key: string) => void;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Callback triggered when scrolling reaches near the bottom of the dropdown
|
|
64
|
+
* Returns a promise that resolves when the loading is complete
|
|
65
|
+
* @param event The scroll event
|
|
66
|
+
*/
|
|
67
|
+
onScrollEnd?: (event: React.UIEvent<HTMLDivElement>) => Promise<any> | any;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Distance from the bottom (in pixels) to trigger onScrollEnd
|
|
71
|
+
* @default 50
|
|
72
|
+
*/
|
|
73
|
+
scrollThreshold?: number;
|
|
82
74
|
}
|
|
83
75
|
|
|
84
76
|
export interface SelectOptionProps {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
77
|
+
value: any;
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
title?: string;
|
|
80
|
+
className?: string;
|
|
81
|
+
style?: React.CSSProperties;
|
|
82
|
+
children?: React.ReactNode;
|
|
91
83
|
}
|
|
92
84
|
|
|
93
85
|
interface SelectComponent extends React.FC<SelectProps> {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
86
|
+
/**
|
|
87
|
+
* OneHaul Select component
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```jsx
|
|
91
|
+
* <Select
|
|
92
|
+
* placeholder="Select option"
|
|
93
|
+
* value={selectedValue}
|
|
94
|
+
* onChange={handleChange}
|
|
95
|
+
* options={options}
|
|
96
|
+
* onFocusLoad={(params) => loadUsersWithParams(params)}
|
|
97
|
+
* onSearchLoad={(searchTerm) => searchProductsWithParams(searchTerm, { category: 'electronics' })}
|
|
98
|
+
* cacheOptions={true}
|
|
99
|
+
* onCacheHit={(key, data) => console.log(`Cache hit: ${key}`)}
|
|
100
|
+
* onCacheMiss={(key) => console.log(`Cache miss: ${key}`)}
|
|
101
|
+
* />
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
Option: React.FC<SelectOptionProps>;
|
|
113
105
|
}
|
|
114
106
|
|
|
115
107
|
declare const Select: SelectComponent;
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -109,10 +109,3 @@ export declare const Statics: IconComponent;
|
|
|
109
109
|
export declare const Shipment: IconComponent;
|
|
110
110
|
export declare const Collapse: IconComponent;
|
|
111
111
|
export declare const DragIndicator: IconComponent;
|
|
112
|
-
export declare const Minus: IconComponent;
|
|
113
|
-
export declare const User: IconComponent;
|
|
114
|
-
export declare const Users: IconComponent;
|
|
115
|
-
export declare const Container: IconComponent;
|
|
116
|
-
export declare const Commodity: IconComponent;
|
|
117
|
-
export declare const Ship: IconComponent;
|
|
118
|
-
export declare const Time: IconComponent;
|