@alifd/chat 0.3.28 → 0.3.29-beta.0
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/es/form/index.d.ts +23 -0
- package/es/form/index.js +33 -0
- package/es/form/main.scss +5 -0
- package/es/form/style.d.ts +1 -0
- package/es/form/style.js +1 -0
- package/es/form/types.d.ts +518 -0
- package/es/form/types.js +1 -0
- package/es/html-render/utils.d.ts +2 -0
- package/es/html-render/utils.js +2 -0
- package/es/icon/icon.css +363 -0
- package/es/index.js +1 -1
- package/es/select/index.d.ts +80 -78
- package/es/select/index.js +48 -3
- package/es/select/main.scss +34 -0
- package/es/select/style.d.ts +2 -0
- package/es/select/style.js +2 -0
- package/es/select/types.d.ts +2 -0
- package/lib/form/index.d.ts +23 -0
- package/lib/form/index.js +35 -0
- package/lib/form/main.scss +5 -0
- package/lib/form/style.d.ts +1 -0
- package/lib/form/style.js +3 -0
- package/lib/form/types.d.ts +518 -0
- package/lib/form/types.js +2 -0
- package/lib/html-render/utils.d.ts +2 -0
- package/lib/html-render/utils.js +5 -0
- package/lib/icon/icon.css +363 -0
- package/lib/index.js +1 -1
- package/lib/select/index.d.ts +80 -78
- package/lib/select/index.js +47 -2
- package/lib/select/main.scss +34 -0
- package/lib/select/style.d.ts +2 -0
- package/lib/select/style.js +2 -0
- package/lib/select/types.d.ts +2 -0
- package/package.json +1 -1
package/es/select/index.d.ts
CHANGED
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
* @when Select 用于替代原生 select,在限定的可选项内进行选择,核心能力是选择
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import type { DataSourceItem, ObjectItem } from '@alifd/next/types/select/types';
|
|
10
|
+
import type { SelectProps } from './types';
|
|
9
11
|
export * from './types';
|
|
10
|
-
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<
|
|
12
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<SelectProps & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/select/types").SelectProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
|
|
11
13
|
selectAllYet: boolean;
|
|
12
|
-
componentDidUpdate(prevProps: import("@alifd/next/types/select").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
14
|
+
componentDidUpdate(prevProps: import("@alifd/next/types/select/types").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
13
15
|
componentDidMount(): void;
|
|
14
16
|
ie9Hack(): void;
|
|
15
17
|
useDetailValue(): boolean;
|
|
@@ -21,8 +23,8 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
21
23
|
};
|
|
22
24
|
}): false | void;
|
|
23
25
|
handleItemClick(key: string): void;
|
|
24
|
-
handleSingleSelect(key: string, triggerType: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
25
|
-
handleMultipleSelect(keys: import("@alifd/next/types/select").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
26
|
+
handleSingleSelect(key: string, triggerType: import("@alifd/next/types/select/types").VisibleChangeType): void;
|
|
27
|
+
handleMultipleSelect(keys: import("@alifd/next/types/select/types").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select/types").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
26
28
|
updateSelectAllYet(value?: unknown): void;
|
|
27
29
|
handleSearchValue(value: string): void;
|
|
28
30
|
handleSearch(value: string, e: import("react").ChangeEvent<HTMLInputElement>): void;
|
|
@@ -30,12 +32,12 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
30
32
|
handleSearchKeyDown(e: import("react").KeyboardEvent<HTMLElement>): void;
|
|
31
33
|
chooseMultipleItem(key: string): void;
|
|
32
34
|
chooseHighlightItem(proxy: unknown, e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
33
|
-
handleTagClose(item: import("@alifd/next/types/select").ObjectItem): boolean;
|
|
35
|
+
handleTagClose(item: import("@alifd/next/types/select/types").ObjectItem): boolean;
|
|
34
36
|
handleDeleteTag(e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
35
37
|
handleSelectAll(e: import("react").UIEvent<HTMLElement, UIEvent>): void;
|
|
36
|
-
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
38
|
+
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select/types").VisibleChangeType): void;
|
|
37
39
|
afterClose(): void;
|
|
38
|
-
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select").ObjectItem[], totalValues: import("@alifd/next/types/select").ObjectItem[]): string;
|
|
40
|
+
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select/types").ObjectItem[], totalValues: import("@alifd/next/types/select/types").ObjectItem[]): string;
|
|
39
41
|
renderValues(): import("react").ReactNode;
|
|
40
42
|
handleWrapClick: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
41
43
|
handleArrowClick: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
@@ -57,16 +59,16 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
57
59
|
inputRef: import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>;
|
|
58
60
|
valueDataSource: {
|
|
59
61
|
value?: string | number | boolean | (string | number | boolean | null | undefined)[] | null | undefined;
|
|
60
|
-
valueDS?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined;
|
|
61
|
-
mapValueDS?: Record<string, import("@alifd/next/types/select").ObjectItem> | undefined;
|
|
62
|
+
valueDS?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined;
|
|
63
|
+
mapValueDS?: Record<string, import("@alifd/next/types/select/types").ObjectItem> | undefined;
|
|
62
64
|
};
|
|
63
65
|
componentWillUnmount(): void;
|
|
64
66
|
syncWidth(): void;
|
|
65
67
|
handleResize(): void;
|
|
66
|
-
setDataSource(props: import("@alifd/next/types/select").SelectProps): import("@alifd/next/types/select/types").NormalizedObjectItem[];
|
|
67
|
-
setVisible(visible: boolean, type?: import("@alifd/next/types/select").VisibleChangeType | undefined): void;
|
|
68
|
+
setDataSource(props: import("@alifd/next/types/select/types").SelectProps): import("@alifd/next/types/select/types").NormalizedObjectItem[];
|
|
69
|
+
setVisible(visible: boolean, type?: import("@alifd/next/types/select/types").VisibleChangeType | undefined): void;
|
|
68
70
|
setFirstHightLightKeyForMenu(searchValue?: unknown): void;
|
|
69
|
-
handleChange(value: import("@alifd/next/types/select").DataSourceItem | import("@alifd/next/types/select").DataSourceItem[], args_0: unknown, args_1?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined): void;
|
|
71
|
+
handleChange(value: import("@alifd/next/types/select/types").DataSourceItem | import("@alifd/next/types/select/types").DataSourceItem[], args_0: unknown, args_1?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined): void;
|
|
70
72
|
handleMenuBodyClick(): void;
|
|
71
73
|
toggleHighlightItem(dir: number): false | import("@alifd/next/types/select/types").NormalizedObjectItem | undefined;
|
|
72
74
|
scrollMenuIntoView(): void;
|
|
@@ -83,27 +85,27 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
83
85
|
savePopupRef: (ref: HTMLDivElement) => void;
|
|
84
86
|
shouldAutoWidth(): boolean | undefined;
|
|
85
87
|
context: any;
|
|
86
|
-
setState<K extends keyof import("@alifd/next/types/select/select").SelectState>(state: import("@alifd/next/types/select/select").SelectState | ((prevState: Readonly<import("@alifd/next/types/select/select").SelectState>, props: Readonly<import("@alifd/next/types/select").SelectProps>) => import("@alifd/next/types/select/select").SelectState | Pick<import("@alifd/next/types/select/select").SelectState, K> | null) | Pick<import("@alifd/next/types/select/select").SelectState, K> | null, callback?: (() => void) | undefined): void;
|
|
88
|
+
setState<K extends keyof import("@alifd/next/types/select/select").SelectState>(state: import("@alifd/next/types/select/select").SelectState | ((prevState: Readonly<import("@alifd/next/types/select/select").SelectState>, props: Readonly<import("@alifd/next/types/select/types").SelectProps>) => import("@alifd/next/types/select/select").SelectState | Pick<import("@alifd/next/types/select/select").SelectState, K> | null) | Pick<import("@alifd/next/types/select/select").SelectState, K> | null, callback?: (() => void) | undefined): void;
|
|
87
89
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
88
|
-
readonly props: Readonly<import("@alifd/next/types/select").SelectProps> & Readonly<{
|
|
90
|
+
readonly props: Readonly<import("@alifd/next/types/select/types").SelectProps> & Readonly<{
|
|
89
91
|
children?: import("react").ReactNode;
|
|
90
92
|
}>;
|
|
91
93
|
state: Readonly<import("@alifd/next/types/select/select").SelectState>;
|
|
92
94
|
refs: {
|
|
93
95
|
[key: string]: import("react").ReactInstance;
|
|
94
96
|
};
|
|
95
|
-
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
97
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
96
98
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
97
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
99
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
98
100
|
componentWillMount?(): void;
|
|
99
101
|
UNSAFE_componentWillMount?(): void;
|
|
100
|
-
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
101
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
102
|
-
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
103
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
102
|
+
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextContext: any): void;
|
|
103
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextContext: any): void;
|
|
104
|
+
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
105
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
104
106
|
}> & Pick<{
|
|
105
107
|
selectAllYet: boolean;
|
|
106
|
-
componentDidUpdate(prevProps: import("@alifd/next/types/select").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
108
|
+
componentDidUpdate(prevProps: import("@alifd/next/types/select/types").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
107
109
|
componentDidMount(): void;
|
|
108
110
|
ie9Hack(): void;
|
|
109
111
|
useDetailValue(): boolean;
|
|
@@ -115,8 +117,8 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
115
117
|
};
|
|
116
118
|
}): false | void;
|
|
117
119
|
handleItemClick(key: string): void;
|
|
118
|
-
handleSingleSelect(key: string, triggerType: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
119
|
-
handleMultipleSelect(keys: import("@alifd/next/types/select").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
120
|
+
handleSingleSelect(key: string, triggerType: import("@alifd/next/types/select/types").VisibleChangeType): void;
|
|
121
|
+
handleMultipleSelect(keys: import("@alifd/next/types/select/types").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select/types").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
120
122
|
updateSelectAllYet(value?: unknown): void;
|
|
121
123
|
handleSearchValue(value: string): void;
|
|
122
124
|
handleSearch(value: string, e: import("react").ChangeEvent<HTMLInputElement>): void;
|
|
@@ -124,12 +126,12 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
124
126
|
handleSearchKeyDown(e: import("react").KeyboardEvent<HTMLElement>): void;
|
|
125
127
|
chooseMultipleItem(key: string): void;
|
|
126
128
|
chooseHighlightItem(proxy: unknown, e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
127
|
-
handleTagClose(item: import("@alifd/next/types/select").ObjectItem): boolean;
|
|
129
|
+
handleTagClose(item: import("@alifd/next/types/select/types").ObjectItem): boolean;
|
|
128
130
|
handleDeleteTag(e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
129
131
|
handleSelectAll(e: import("react").UIEvent<HTMLElement, UIEvent>): void;
|
|
130
|
-
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
132
|
+
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select/types").VisibleChangeType): void;
|
|
131
133
|
afterClose(): void;
|
|
132
|
-
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select").ObjectItem[], totalValues: import("@alifd/next/types/select").ObjectItem[]): string;
|
|
134
|
+
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select/types").ObjectItem[], totalValues: import("@alifd/next/types/select/types").ObjectItem[]): string;
|
|
133
135
|
renderValues(): import("react").ReactNode;
|
|
134
136
|
handleWrapClick: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
135
137
|
handleArrowClick: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
@@ -151,16 +153,16 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
151
153
|
inputRef: import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>;
|
|
152
154
|
valueDataSource: {
|
|
153
155
|
value?: string | number | boolean | (string | number | boolean | null | undefined)[] | null | undefined;
|
|
154
|
-
valueDS?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined;
|
|
155
|
-
mapValueDS?: Record<string, import("@alifd/next/types/select").ObjectItem> | undefined;
|
|
156
|
+
valueDS?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined;
|
|
157
|
+
mapValueDS?: Record<string, import("@alifd/next/types/select/types").ObjectItem> | undefined;
|
|
156
158
|
};
|
|
157
159
|
componentWillUnmount(): void;
|
|
158
160
|
syncWidth(): void;
|
|
159
161
|
handleResize(): void;
|
|
160
|
-
setDataSource(props: import("@alifd/next/types/select").SelectProps): import("@alifd/next/types/select/types").NormalizedObjectItem[];
|
|
161
|
-
setVisible(visible: boolean, type?: import("@alifd/next/types/select").VisibleChangeType | undefined): void;
|
|
162
|
+
setDataSource(props: import("@alifd/next/types/select/types").SelectProps): import("@alifd/next/types/select/types").NormalizedObjectItem[];
|
|
163
|
+
setVisible(visible: boolean, type?: import("@alifd/next/types/select/types").VisibleChangeType | undefined): void;
|
|
162
164
|
setFirstHightLightKeyForMenu(searchValue?: unknown): void;
|
|
163
|
-
handleChange(value: import("@alifd/next/types/select").DataSourceItem | import("@alifd/next/types/select").DataSourceItem[], args_0: unknown, args_1?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined): void;
|
|
165
|
+
handleChange(value: import("@alifd/next/types/select/types").DataSourceItem | import("@alifd/next/types/select/types").DataSourceItem[], args_0: unknown, args_1?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined): void;
|
|
164
166
|
handleMenuBodyClick(): void;
|
|
165
167
|
toggleHighlightItem(dir: number): false | import("@alifd/next/types/select/types").NormalizedObjectItem | undefined;
|
|
166
168
|
scrollMenuIntoView(): void;
|
|
@@ -177,27 +179,27 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
177
179
|
savePopupRef: (ref: HTMLDivElement) => void;
|
|
178
180
|
shouldAutoWidth(): boolean | undefined;
|
|
179
181
|
context: any;
|
|
180
|
-
setState<K extends keyof import("@alifd/next/types/select/select").SelectState>(state: import("@alifd/next/types/select/select").SelectState | ((prevState: Readonly<import("@alifd/next/types/select/select").SelectState>, props: Readonly<import("@alifd/next/types/select").SelectProps>) => import("@alifd/next/types/select/select").SelectState | Pick<import("@alifd/next/types/select/select").SelectState, K> | null) | Pick<import("@alifd/next/types/select/select").SelectState, K> | null, callback?: (() => void) | undefined): void;
|
|
182
|
+
setState<K extends keyof import("@alifd/next/types/select/select").SelectState>(state: import("@alifd/next/types/select/select").SelectState | ((prevState: Readonly<import("@alifd/next/types/select/select").SelectState>, props: Readonly<import("@alifd/next/types/select/types").SelectProps>) => import("@alifd/next/types/select/select").SelectState | Pick<import("@alifd/next/types/select/select").SelectState, K> | null) | Pick<import("@alifd/next/types/select/select").SelectState, K> | null, callback?: (() => void) | undefined): void;
|
|
181
183
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
182
|
-
readonly props: Readonly<import("@alifd/next/types/select").SelectProps> & Readonly<{
|
|
184
|
+
readonly props: Readonly<import("@alifd/next/types/select/types").SelectProps> & Readonly<{
|
|
183
185
|
children?: import("react").ReactNode;
|
|
184
186
|
}>;
|
|
185
187
|
state: Readonly<import("@alifd/next/types/select/select").SelectState>;
|
|
186
188
|
refs: {
|
|
187
189
|
[key: string]: import("react").ReactInstance;
|
|
188
190
|
};
|
|
189
|
-
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
191
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
190
192
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
191
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
193
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
192
194
|
componentWillMount?(): void;
|
|
193
195
|
UNSAFE_componentWillMount?(): void;
|
|
194
|
-
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
195
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
196
|
-
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
197
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
198
|
-
}, "focusInput" | "handleSearchClear">>,
|
|
196
|
+
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextContext: any): void;
|
|
197
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextContext: any): void;
|
|
198
|
+
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
199
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
200
|
+
}, "focusInput" | "handleSearchClear">>, "key" | keyof SelectProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/select/types").SelectProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
|
|
199
201
|
selectAllYet: boolean;
|
|
200
|
-
componentDidUpdate(prevProps: import("@alifd/next/types/select").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
202
|
+
componentDidUpdate(prevProps: import("@alifd/next/types/select/types").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
201
203
|
componentDidMount(): void;
|
|
202
204
|
ie9Hack(): void;
|
|
203
205
|
useDetailValue(): boolean;
|
|
@@ -209,8 +211,8 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
209
211
|
};
|
|
210
212
|
}): false | void;
|
|
211
213
|
handleItemClick(key: string): void;
|
|
212
|
-
handleSingleSelect(key: string, triggerType: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
213
|
-
handleMultipleSelect(keys: import("@alifd/next/types/select").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
214
|
+
handleSingleSelect(key: string, triggerType: import("@alifd/next/types/select/types").VisibleChangeType): void;
|
|
215
|
+
handleMultipleSelect(keys: import("@alifd/next/types/select/types").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select/types").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
214
216
|
updateSelectAllYet(value?: unknown): void;
|
|
215
217
|
handleSearchValue(value: string): void;
|
|
216
218
|
handleSearch(value: string, e: import("react").ChangeEvent<HTMLInputElement>): void;
|
|
@@ -218,12 +220,12 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
218
220
|
handleSearchKeyDown(e: import("react").KeyboardEvent<HTMLElement>): void;
|
|
219
221
|
chooseMultipleItem(key: string): void;
|
|
220
222
|
chooseHighlightItem(proxy: unknown, e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
221
|
-
handleTagClose(item: import("@alifd/next/types/select").ObjectItem): boolean;
|
|
223
|
+
handleTagClose(item: import("@alifd/next/types/select/types").ObjectItem): boolean;
|
|
222
224
|
handleDeleteTag(e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
223
225
|
handleSelectAll(e: import("react").UIEvent<HTMLElement, UIEvent>): void;
|
|
224
|
-
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
226
|
+
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select/types").VisibleChangeType): void;
|
|
225
227
|
afterClose(): void;
|
|
226
|
-
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select").ObjectItem[], totalValues: import("@alifd/next/types/select").ObjectItem[]): string;
|
|
228
|
+
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select/types").ObjectItem[], totalValues: import("@alifd/next/types/select/types").ObjectItem[]): string;
|
|
227
229
|
renderValues(): import("react").ReactNode;
|
|
228
230
|
handleWrapClick: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
229
231
|
handleArrowClick: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
@@ -245,16 +247,16 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
245
247
|
inputRef: import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>;
|
|
246
248
|
valueDataSource: {
|
|
247
249
|
value?: string | number | boolean | (string | number | boolean | null | undefined)[] | null | undefined;
|
|
248
|
-
valueDS?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined;
|
|
249
|
-
mapValueDS?: Record<string, import("@alifd/next/types/select").ObjectItem> | undefined;
|
|
250
|
+
valueDS?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined;
|
|
251
|
+
mapValueDS?: Record<string, import("@alifd/next/types/select/types").ObjectItem> | undefined;
|
|
250
252
|
};
|
|
251
253
|
componentWillUnmount(): void;
|
|
252
254
|
syncWidth(): void;
|
|
253
255
|
handleResize(): void;
|
|
254
|
-
setDataSource(props: import("@alifd/next/types/select").SelectProps): import("@alifd/next/types/select/types").NormalizedObjectItem[];
|
|
255
|
-
setVisible(visible: boolean, type?: import("@alifd/next/types/select").VisibleChangeType | undefined): void;
|
|
256
|
+
setDataSource(props: import("@alifd/next/types/select/types").SelectProps): import("@alifd/next/types/select/types").NormalizedObjectItem[];
|
|
257
|
+
setVisible(visible: boolean, type?: import("@alifd/next/types/select/types").VisibleChangeType | undefined): void;
|
|
256
258
|
setFirstHightLightKeyForMenu(searchValue?: unknown): void;
|
|
257
|
-
handleChange(value: import("@alifd/next/types/select").DataSourceItem | import("@alifd/next/types/select").DataSourceItem[], args_0: unknown, args_1?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined): void;
|
|
259
|
+
handleChange(value: import("@alifd/next/types/select/types").DataSourceItem | import("@alifd/next/types/select/types").DataSourceItem[], args_0: unknown, args_1?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined): void;
|
|
258
260
|
handleMenuBodyClick(): void;
|
|
259
261
|
toggleHighlightItem(dir: number): false | import("@alifd/next/types/select/types").NormalizedObjectItem | undefined;
|
|
260
262
|
scrollMenuIntoView(): void;
|
|
@@ -271,27 +273,27 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
271
273
|
savePopupRef: (ref: HTMLDivElement) => void;
|
|
272
274
|
shouldAutoWidth(): boolean | undefined;
|
|
273
275
|
context: any;
|
|
274
|
-
setState<K extends keyof import("@alifd/next/types/select/select").SelectState>(state: import("@alifd/next/types/select/select").SelectState | ((prevState: Readonly<import("@alifd/next/types/select/select").SelectState>, props: Readonly<import("@alifd/next/types/select").SelectProps>) => import("@alifd/next/types/select/select").SelectState | Pick<import("@alifd/next/types/select/select").SelectState, K> | null) | Pick<import("@alifd/next/types/select/select").SelectState, K> | null, callback?: (() => void) | undefined): void;
|
|
276
|
+
setState<K extends keyof import("@alifd/next/types/select/select").SelectState>(state: import("@alifd/next/types/select/select").SelectState | ((prevState: Readonly<import("@alifd/next/types/select/select").SelectState>, props: Readonly<import("@alifd/next/types/select/types").SelectProps>) => import("@alifd/next/types/select/select").SelectState | Pick<import("@alifd/next/types/select/select").SelectState, K> | null) | Pick<import("@alifd/next/types/select/select").SelectState, K> | null, callback?: (() => void) | undefined): void;
|
|
275
277
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
276
|
-
readonly props: Readonly<import("@alifd/next/types/select").SelectProps> & Readonly<{
|
|
278
|
+
readonly props: Readonly<import("@alifd/next/types/select/types").SelectProps> & Readonly<{
|
|
277
279
|
children?: import("react").ReactNode;
|
|
278
280
|
}>;
|
|
279
281
|
state: Readonly<import("@alifd/next/types/select/select").SelectState>;
|
|
280
282
|
refs: {
|
|
281
283
|
[key: string]: import("react").ReactInstance;
|
|
282
284
|
};
|
|
283
|
-
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
285
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
284
286
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
285
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
287
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
286
288
|
componentWillMount?(): void;
|
|
287
289
|
UNSAFE_componentWillMount?(): void;
|
|
288
|
-
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
289
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
290
|
-
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
291
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
290
|
+
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextContext: any): void;
|
|
291
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextContext: any): void;
|
|
292
|
+
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
293
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
292
294
|
}> & Pick<{
|
|
293
295
|
selectAllYet: boolean;
|
|
294
|
-
componentDidUpdate(prevProps: import("@alifd/next/types/select").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
296
|
+
componentDidUpdate(prevProps: import("@alifd/next/types/select/types").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
295
297
|
componentDidMount(): void;
|
|
296
298
|
ie9Hack(): void;
|
|
297
299
|
useDetailValue(): boolean;
|
|
@@ -303,8 +305,8 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
303
305
|
};
|
|
304
306
|
}): false | void;
|
|
305
307
|
handleItemClick(key: string): void;
|
|
306
|
-
handleSingleSelect(key: string, triggerType: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
307
|
-
handleMultipleSelect(keys: import("@alifd/next/types/select").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
308
|
+
handleSingleSelect(key: string, triggerType: import("@alifd/next/types/select/types").VisibleChangeType): void;
|
|
309
|
+
handleMultipleSelect(keys: import("@alifd/next/types/select/types").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select/types").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
308
310
|
updateSelectAllYet(value?: unknown): void;
|
|
309
311
|
handleSearchValue(value: string): void;
|
|
310
312
|
handleSearch(value: string, e: import("react").ChangeEvent<HTMLInputElement>): void;
|
|
@@ -312,12 +314,12 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
312
314
|
handleSearchKeyDown(e: import("react").KeyboardEvent<HTMLElement>): void;
|
|
313
315
|
chooseMultipleItem(key: string): void;
|
|
314
316
|
chooseHighlightItem(proxy: unknown, e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
315
|
-
handleTagClose(item: import("@alifd/next/types/select").ObjectItem): boolean;
|
|
317
|
+
handleTagClose(item: import("@alifd/next/types/select/types").ObjectItem): boolean;
|
|
316
318
|
handleDeleteTag(e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
317
319
|
handleSelectAll(e: import("react").UIEvent<HTMLElement, UIEvent>): void;
|
|
318
|
-
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
320
|
+
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select/types").VisibleChangeType): void;
|
|
319
321
|
afterClose(): void;
|
|
320
|
-
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select").ObjectItem[], totalValues: import("@alifd/next/types/select").ObjectItem[]): string;
|
|
322
|
+
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select/types").ObjectItem[], totalValues: import("@alifd/next/types/select/types").ObjectItem[]): string;
|
|
321
323
|
renderValues(): import("react").ReactNode;
|
|
322
324
|
handleWrapClick: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
323
325
|
handleArrowClick: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
@@ -339,16 +341,16 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
339
341
|
inputRef: import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>;
|
|
340
342
|
valueDataSource: {
|
|
341
343
|
value?: string | number | boolean | (string | number | boolean | null | undefined)[] | null | undefined;
|
|
342
|
-
valueDS?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined;
|
|
343
|
-
mapValueDS?: Record<string, import("@alifd/next/types/select").ObjectItem> | undefined;
|
|
344
|
+
valueDS?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined;
|
|
345
|
+
mapValueDS?: Record<string, import("@alifd/next/types/select/types").ObjectItem> | undefined;
|
|
344
346
|
};
|
|
345
347
|
componentWillUnmount(): void;
|
|
346
348
|
syncWidth(): void;
|
|
347
349
|
handleResize(): void;
|
|
348
|
-
setDataSource(props: import("@alifd/next/types/select").SelectProps): import("@alifd/next/types/select/types").NormalizedObjectItem[];
|
|
349
|
-
setVisible(visible: boolean, type?: import("@alifd/next/types/select").VisibleChangeType | undefined): void;
|
|
350
|
+
setDataSource(props: import("@alifd/next/types/select/types").SelectProps): import("@alifd/next/types/select/types").NormalizedObjectItem[];
|
|
351
|
+
setVisible(visible: boolean, type?: import("@alifd/next/types/select/types").VisibleChangeType | undefined): void;
|
|
350
352
|
setFirstHightLightKeyForMenu(searchValue?: unknown): void;
|
|
351
|
-
handleChange(value: import("@alifd/next/types/select").DataSourceItem | import("@alifd/next/types/select").DataSourceItem[], args_0: unknown, args_1?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined): void;
|
|
353
|
+
handleChange(value: import("@alifd/next/types/select/types").DataSourceItem | import("@alifd/next/types/select/types").DataSourceItem[], args_0: unknown, args_1?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined): void;
|
|
352
354
|
handleMenuBodyClick(): void;
|
|
353
355
|
toggleHighlightItem(dir: number): false | import("@alifd/next/types/select/types").NormalizedObjectItem | undefined;
|
|
354
356
|
scrollMenuIntoView(): void;
|
|
@@ -365,23 +367,23 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
365
367
|
savePopupRef: (ref: HTMLDivElement) => void;
|
|
366
368
|
shouldAutoWidth(): boolean | undefined;
|
|
367
369
|
context: any;
|
|
368
|
-
setState<K extends keyof import("@alifd/next/types/select/select").SelectState>(state: import("@alifd/next/types/select/select").SelectState | ((prevState: Readonly<import("@alifd/next/types/select/select").SelectState>, props: Readonly<import("@alifd/next/types/select").SelectProps>) => import("@alifd/next/types/select/select").SelectState | Pick<import("@alifd/next/types/select/select").SelectState, K> | null) | Pick<import("@alifd/next/types/select/select").SelectState, K> | null, callback?: (() => void) | undefined): void;
|
|
370
|
+
setState<K extends keyof import("@alifd/next/types/select/select").SelectState>(state: import("@alifd/next/types/select/select").SelectState | ((prevState: Readonly<import("@alifd/next/types/select/select").SelectState>, props: Readonly<import("@alifd/next/types/select/types").SelectProps>) => import("@alifd/next/types/select/select").SelectState | Pick<import("@alifd/next/types/select/select").SelectState, K> | null) | Pick<import("@alifd/next/types/select/select").SelectState, K> | null, callback?: (() => void) | undefined): void;
|
|
369
371
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
370
|
-
readonly props: Readonly<import("@alifd/next/types/select").SelectProps> & Readonly<{
|
|
372
|
+
readonly props: Readonly<import("@alifd/next/types/select/types").SelectProps> & Readonly<{
|
|
371
373
|
children?: import("react").ReactNode;
|
|
372
374
|
}>;
|
|
373
375
|
state: Readonly<import("@alifd/next/types/select/select").SelectState>;
|
|
374
376
|
refs: {
|
|
375
377
|
[key: string]: import("react").ReactInstance;
|
|
376
378
|
};
|
|
377
|
-
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
379
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
378
380
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
379
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
381
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
380
382
|
componentWillMount?(): void;
|
|
381
383
|
UNSAFE_componentWillMount?(): void;
|
|
382
|
-
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
383
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
384
|
-
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
385
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
384
|
+
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextContext: any): void;
|
|
385
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextContext: any): void;
|
|
386
|
+
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
387
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select/types").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
386
388
|
}, "focusInput" | "handleSearchClear">, {}>;
|
|
387
389
|
export default _default;
|
package/es/select/index.js
CHANGED
|
@@ -7,12 +7,57 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { __rest } from "tslib";
|
|
9
9
|
import React, { forwardRef } from 'react';
|
|
10
|
-
import { Select as NextSelect, ConfigProvider } from '@alifd/next';
|
|
10
|
+
import { Select as NextSelect, ConfigProvider, Button } from '@alifd/next';
|
|
11
11
|
import cs from 'classnames';
|
|
12
12
|
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
13
13
|
const Select = forwardRef((_a, ref) => {
|
|
14
|
-
var { className, size = 'medium' } = _a, props = __rest(_a, ["className", "size"]);
|
|
15
|
-
|
|
14
|
+
var { className, size = 'medium', display = 'select', buttonCols = 2, dataSource, mode = 'single', onChange } = _a, props = __rest(_a, ["className", "size", "display", "buttonCols", "dataSource", "mode", "onChange"]);
|
|
15
|
+
if (display === 'button') {
|
|
16
|
+
const renderRowButtons = (items) => {
|
|
17
|
+
if (!items || !items.length) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const selected = props === null || props === void 0 ? void 0 : props.value;
|
|
21
|
+
return items.map((item, index) => {
|
|
22
|
+
if (!item) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const { value, label, disabled } = item;
|
|
26
|
+
let status = 'normal';
|
|
27
|
+
if (typeof selected === 'string' && selected === value) {
|
|
28
|
+
status = 'selected';
|
|
29
|
+
}
|
|
30
|
+
else if (Array.isArray(selected) && selected.includes(value)) {
|
|
31
|
+
status = 'selected';
|
|
32
|
+
}
|
|
33
|
+
else if (typeof selected === 'object' && 'value' in selected && selected.value === value) {
|
|
34
|
+
status = 'selected';
|
|
35
|
+
}
|
|
36
|
+
return (React.createElement(Button, { onClick: () => {
|
|
37
|
+
if (mode === 'multiple') {
|
|
38
|
+
if (Array.isArray(selected)) {
|
|
39
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(status === 'normal' ? [...selected, value] : selected.filter((v) => v !== value), 'itemClick');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (mode === 'single') {
|
|
43
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(status === 'normal' ? item : undefined, 'itemClick');
|
|
44
|
+
}
|
|
45
|
+
}, type: 'normal', key: `select_${index}`, disabled: disabled, className: `select-item ${status} row${buttonCols}` }, label));
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const rows = Math.ceil(((dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || 0) / buttonCols);
|
|
49
|
+
const buttonRows = Array.from({ length: rows }, (_, index) => {
|
|
50
|
+
const start = index * buttonCols;
|
|
51
|
+
const end = Math.min(start + buttonCols, (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || 0);
|
|
52
|
+
const buttonsDataSource = dataSource === null || dataSource === void 0 ? void 0 : dataSource.slice(start, end);
|
|
53
|
+
if (!(buttonsDataSource === null || buttonsDataSource === void 0 ? void 0 : buttonsDataSource.length)) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
return React.createElement("div", { key: `row_${index}`, className: 'select-row-container' }, renderRowButtons(buttonsDataSource));
|
|
57
|
+
});
|
|
58
|
+
return React.createElement("div", { className: cs(`${PREFIX_DEFAULT}select`) }, buttonRows);
|
|
59
|
+
}
|
|
60
|
+
return React.createElement(NextSelect, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}select`, className), size: size, dataSource: dataSource, ref: ref, mode: mode, onChange: onChange }));
|
|
16
61
|
});
|
|
17
62
|
const SelectWithSub = assignSubComponent(Select, {
|
|
18
63
|
displayName: 'Select',
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@import "../core/variables.scss";
|
|
2
|
+
|
|
3
|
+
.#{$prefix}select {
|
|
4
|
+
.select-row-container {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
margin-top: 8px;
|
|
8
|
+
|
|
9
|
+
&:first-child {
|
|
10
|
+
margin-top: 0px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.select-item {
|
|
14
|
+
margin-right: 8px;
|
|
15
|
+
|
|
16
|
+
&.selected {
|
|
17
|
+
border-color: $color-brand1-6;
|
|
18
|
+
color: $color-brand1-6;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.row2{
|
|
22
|
+
width: calc(50% - 8px);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.row3{
|
|
26
|
+
width: calc(33.33% - 8px);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:last-child {
|
|
30
|
+
margin-right: 0px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
package/es/select/style.d.ts
CHANGED
package/es/select/style.js
CHANGED
package/es/select/types.d.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @component 输入框
|
|
3
|
+
* @en Input
|
|
4
|
+
* @type 通用 - General
|
|
5
|
+
* @remarks 同 Next Input,按钮用于开始一个即时操作。- Same as Next.Input, Input used to trigger an action.
|
|
6
|
+
* @when 标记一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。- Inputs are used for emphasizing important functions on your page.
|
|
7
|
+
* @others
|
|
8
|
+
* ## 无障碍键盘操作指南
|
|
9
|
+
* | 按键 | 说明 |
|
|
10
|
+
* | :---- | :---------- |
|
|
11
|
+
* | Enter | 触发 onClick 事件 |
|
|
12
|
+
* | SPACE | 触发 onClick 事件 |
|
|
13
|
+
* @othersEn
|
|
14
|
+
* ## ARIA and KeyBoard
|
|
15
|
+
* | KeyBoard | Description |
|
|
16
|
+
* | :---------- | :------------------------------ |
|
|
17
|
+
* | Enter | Trigger the onClick event |
|
|
18
|
+
* | SPACE | Trigger the onClick event |
|
|
19
|
+
*/
|
|
20
|
+
import React from 'react';
|
|
21
|
+
export * from './types';
|
|
22
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<Pick<any, string | number | symbol> & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/input").InputProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>> & Pick<import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>, "focus" | "getInputNode">>, string | number | symbol> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/input").InputProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>> & Pick<import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>, "focus" | "getInputNode">, {}>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @component 输入框
|
|
4
|
+
* @en Input
|
|
5
|
+
* @type 通用 - General
|
|
6
|
+
* @remarks 同 Next Input,按钮用于开始一个即时操作。- Same as Next.Input, Input used to trigger an action.
|
|
7
|
+
* @when 标记一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。- Inputs are used for emphasizing important functions on your page.
|
|
8
|
+
* @others
|
|
9
|
+
* ## 无障碍键盘操作指南
|
|
10
|
+
* | 按键 | 说明 |
|
|
11
|
+
* | :---- | :---------- |
|
|
12
|
+
* | Enter | 触发 onClick 事件 |
|
|
13
|
+
* | SPACE | 触发 onClick 事件 |
|
|
14
|
+
* @othersEn
|
|
15
|
+
* ## ARIA and KeyBoard
|
|
16
|
+
* | KeyBoard | Description |
|
|
17
|
+
* | :---------- | :------------------------------ |
|
|
18
|
+
* | Enter | Trigger the onClick event |
|
|
19
|
+
* | SPACE | Trigger the onClick event |
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
const tslib_1 = require("tslib");
|
|
23
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
24
|
+
const next_1 = require("@alifd/next");
|
|
25
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
26
|
+
const utils_1 = require("../utils");
|
|
27
|
+
const Input = (0, react_1.forwardRef)((_a, ref) => {
|
|
28
|
+
var { className, size = 'medium' } = _a, props = tslib_1.__rest(_a, ["className", "size"]);
|
|
29
|
+
return (react_1.default.createElement(next_1.Input, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}input`, className), size: size, ref: ref })));
|
|
30
|
+
});
|
|
31
|
+
const InputWithSub = (0, utils_1.assignSubComponent)(Input, {
|
|
32
|
+
displayName: 'Input',
|
|
33
|
+
});
|
|
34
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
35
|
+
exports.default = next_1.ConfigProvider.config(InputWithSub);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@alifd/next/lib/input/style2';
|