@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.
@@ -20,7 +20,6 @@ export interface ButtonProps {
20
20
  type?: 'button' | 'submit' | 'reset';
21
21
  loading?: boolean;
22
22
  style?: React.CSSProperties;
23
- fullWidth?: boolean;
24
23
  }
25
24
 
26
25
  interface ButtonComponent extends React.FC<ButtonProps> {
@@ -12,7 +12,6 @@ export interface DrawerProps {
12
12
  mask?: boolean;
13
13
  maskClosable?: boolean;
14
14
  closable?: boolean;
15
- push?: boolean | { distance: string | number };
16
15
  destroyOnClose?: boolean;
17
16
  className?: string;
18
17
  bodyStyle?: React.CSSProperties;
@@ -1,115 +1,107 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
 
3
3
  export interface SelectOption {
4
- value: any;
5
- label: React.ReactNode;
6
- disabled?: boolean;
7
- title?: string;
8
- suffix?: React.ReactNode;
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
- 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;
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
- value: any;
86
- disabled?: boolean;
87
- title?: string;
88
- className?: string;
89
- style?: React.CSSProperties;
90
- children?: React.ReactNode;
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
- * OneHaul Select component
96
- *
97
- * @example
98
- * ```jsx
99
- * <Select
100
- * placeholder="Select option"
101
- * value={selectedValue}
102
- * onChange={handleChange}
103
- * options={options}
104
- * onFocusLoad={(params) => loadUsersWithParams(params)}
105
- * onSearchLoad={(searchTerm) => searchProductsWithParams(searchTerm, { category: 'electronics' })}
106
- * cacheOptions={true}
107
- * onCacheHit={(key, data) => console.log(`Cache hit: ${key}`)}
108
- * onCacheMiss={(key) => console.log(`Cache miss: ${key}`)}
109
- * />
110
- * ```
111
- */
112
- Option: React.FC<SelectOptionProps>;
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;
@@ -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;