@alifd/chat 0.3.40-beta.0 → 0.3.40-beta.2
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/ai-loading/types.d.ts +1 -0
- package/es/button/button.d.ts +1 -2
- package/es/button/button.js +13 -19
- package/es/button/group.js +5 -42
- package/es/button/main.scss +36 -77
- package/es/card/main.scss +1 -1
- package/es/checkbox-group/main.scss +6 -7
- package/es/checkbox-group/types.d.ts +6 -0
- package/es/code-view/index.d.ts +11 -0
- package/es/code-view/index.js +63 -0
- package/es/code-view/main.scss +54 -0
- package/es/code-view/style.d.ts +4 -0
- package/es/code-view/style.js +4 -0
- package/es/code-view/types.d.ts +27 -0
- package/es/code-view/types.js +1 -0
- package/es/collapse/index.d.ts +157 -0
- package/es/collapse/index.js +20 -0
- package/es/collapse/main.scss +97 -0
- package/es/collapse/style.d.ts +2 -0
- package/es/collapse/style.js +2 -0
- package/es/collapse/types.d.ts +82 -0
- package/es/collapse/types.js +2 -0
- package/es/core/variables.scss +27 -12
- package/es/date-picker/DatePicker.d.ts +5 -0
- package/es/date-picker/DatePicker.js +15 -0
- package/es/date-picker/MonthPicker.d.ts +4 -0
- package/es/date-picker/MonthPicker.js +15 -0
- package/es/date-picker/RangePicker.d.ts +4 -0
- package/es/date-picker/RangePicker.js +17 -0
- package/es/date-picker/YearPicker.d.ts +4 -0
- package/es/date-picker/YearPicker.js +15 -0
- package/es/date-picker/index.d.ts +5 -23
- package/es/date-picker/index.js +11 -29
- package/es/date-picker/main.scss +23 -1
- package/es/date-picker/style.d.ts +1 -0
- package/es/date-picker/style.js +1 -0
- package/es/date-picker/types.d.ts +161 -81
- package/es/float-button/hooks/useAutoAlign.d.ts +1 -1
- package/es/form/style.d.ts +0 -1
- package/es/form/style.js +2 -1
- package/es/form/types.d.ts +3 -517
- package/es/form/types.js +5 -1
- package/es/html-render/index.d.ts +1 -1
- package/es/html-render/index.js +118 -106
- package/es/html-render/main.scss +27 -8
- package/es/html-render/style.d.ts +1 -0
- package/es/html-render/style.js +1 -0
- package/es/icon/index.d.ts +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -1
- package/es/input/index.d.ts +1 -1
- package/es/input/index.js +16 -6
- package/es/input/main.scss +25 -0
- package/es/input/style.d.ts +1 -0
- package/es/input/style.js +1 -0
- package/es/input/types.d.ts +58 -15
- package/es/markdown/index.d.ts +1 -2
- package/es/markdown/index.js +26 -15
- package/es/markdown/main.scss +4 -3
- package/es/markdown/style.d.ts +2 -1
- package/es/markdown/style.js +2 -1
- package/es/markdown/types.d.ts +20 -9
- package/es/message/index.d.ts +4 -4
- package/es/person-picker/index.d.ts +3 -190
- package/es/person-picker/index.js +23 -21
- package/es/person-picker/main.scss +15 -1
- package/es/person-picker/types.d.ts +53 -11
- package/es/radio-group/index.d.ts +1 -1
- package/es/radio-group/index.js +9 -3
- package/es/radio-group/main.scss +13 -5
- package/es/radio-group/types.d.ts +5 -3
- package/es/reference/index.d.ts +1 -1
- package/es/reference/index.js +14 -15
- package/es/reference/main.scss +1 -1
- package/es/reference/types.d.ts +1 -0
- package/es/select/button.d.ts +3 -0
- package/es/select/button.js +70 -0
- package/es/select/index.d.ts +79 -79
- package/es/select/index.js +13 -57
- package/es/select/main.scss +22 -4
- package/es/select/types.d.ts +108 -1
- package/es/step/index.js +2 -2
- package/es/step/main.scss +115 -66
- package/es/step/types.d.ts +13 -2
- package/es/table/index.d.ts +12 -0
- package/es/table/index.js +23 -0
- package/es/table/main.scss +30 -0
- package/es/table/style.d.ts +2 -0
- package/es/table/style.js +2 -0
- package/es/table/types.d.ts +98 -0
- package/es/table/types.js +1 -0
- package/es/tag/index.d.ts +5 -3
- package/es/tag/index.js +18 -2
- package/es/tag/main.scss +20 -4
- package/es/tag/types.d.ts +55 -0
- package/es/text/index.js +1 -1
- package/es/text/main.scss +4 -1
- package/es/text/types.d.ts +8 -0
- package/es/time-picker/index.d.ts +6 -15
- package/es/time-picker/index.js +71 -24
- package/es/time-picker/main.scss +19 -1
- package/es/time-picker/style.d.ts +1 -0
- package/es/time-picker/style.js +1 -0
- package/es/time-picker/types.d.ts +133 -8
- package/es/tool-status/index.d.ts +1 -1
- package/es/tool-status/index.js +1 -1
- package/es/tool-status/main.scss +2 -1
- package/es/tool-status/types.d.ts +7 -2
- package/es/utils/func.d.ts +1 -0
- package/es/utils/func.js +13 -0
- package/es/utils/github-dark.scss +137 -0
- package/es/utils/github.scss +137 -0
- package/es/utils/hoc/main.scss +166 -0
- package/es/utils/hoc/withLabel.d.ts +94 -0
- package/es/utils/hoc/withLabel.js +57 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/lib/ai-loading/types.d.ts +1 -0
- package/lib/button/button.d.ts +1 -2
- package/lib/button/button.js +13 -19
- package/lib/button/group.js +4 -41
- package/lib/button/main.scss +36 -77
- package/lib/card/main.scss +1 -1
- package/lib/checkbox-group/main.scss +6 -7
- package/lib/checkbox-group/types.d.ts +6 -0
- package/lib/code-view/index.d.ts +11 -0
- package/lib/code-view/index.js +66 -0
- package/lib/code-view/main.scss +54 -0
- package/lib/code-view/style.d.ts +4 -0
- package/lib/code-view/style.js +6 -0
- package/lib/code-view/types.d.ts +27 -0
- package/lib/code-view/types.js +2 -0
- package/lib/collapse/index.d.ts +157 -0
- package/lib/collapse/index.js +22 -0
- package/lib/collapse/main.scss +97 -0
- package/lib/collapse/style.d.ts +2 -0
- package/lib/collapse/style.js +4 -0
- package/lib/collapse/types.d.ts +82 -0
- package/lib/collapse/types.js +3 -0
- package/lib/core/variables.scss +27 -12
- package/lib/date-picker/DatePicker.d.ts +5 -0
- package/lib/date-picker/DatePicker.js +17 -0
- package/lib/date-picker/MonthPicker.d.ts +4 -0
- package/lib/date-picker/MonthPicker.js +17 -0
- package/lib/date-picker/RangePicker.d.ts +4 -0
- package/lib/date-picker/RangePicker.js +19 -0
- package/lib/date-picker/YearPicker.d.ts +4 -0
- package/lib/date-picker/YearPicker.js +17 -0
- package/lib/date-picker/index.d.ts +5 -23
- package/lib/date-picker/index.js +10 -27
- package/lib/date-picker/main.scss +23 -1
- package/lib/date-picker/style.d.ts +1 -0
- package/lib/date-picker/style.js +1 -0
- package/lib/date-picker/types.d.ts +161 -81
- package/lib/float-button/hooks/useAutoAlign.d.ts +1 -1
- package/lib/form/style.d.ts +0 -1
- package/lib/form/style.js +1 -2
- package/lib/form/types.d.ts +3 -517
- package/lib/form/types.js +4 -1
- package/lib/html-render/index.d.ts +1 -1
- package/lib/html-render/index.js +118 -106
- package/lib/html-render/main.scss +27 -8
- package/lib/html-render/style.d.ts +1 -0
- package/lib/html-render/style.js +1 -0
- package/lib/icon/index.d.ts +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +8 -2
- package/lib/input/index.d.ts +1 -1
- package/lib/input/index.js +16 -6
- package/lib/input/main.scss +25 -0
- package/lib/input/style.d.ts +1 -0
- package/lib/input/style.js +1 -0
- package/lib/input/types.d.ts +58 -15
- package/lib/markdown/index.d.ts +1 -2
- package/lib/markdown/index.js +26 -15
- package/lib/markdown/main.scss +4 -3
- package/lib/markdown/style.d.ts +2 -1
- package/lib/markdown/style.js +2 -1
- package/lib/markdown/types.d.ts +20 -9
- package/lib/message/index.d.ts +4 -4
- package/lib/person-picker/index.d.ts +3 -190
- package/lib/person-picker/index.js +22 -20
- package/lib/person-picker/main.scss +15 -1
- package/lib/person-picker/types.d.ts +53 -11
- package/lib/radio-group/index.d.ts +1 -1
- package/lib/radio-group/index.js +8 -2
- package/lib/radio-group/main.scss +13 -5
- package/lib/radio-group/types.d.ts +5 -3
- package/lib/reference/index.d.ts +1 -1
- package/lib/reference/index.js +17 -18
- package/lib/reference/main.scss +1 -1
- package/lib/reference/types.d.ts +1 -0
- package/lib/select/button.d.ts +3 -0
- package/lib/select/button.js +74 -0
- package/lib/select/index.d.ts +79 -79
- package/lib/select/index.js +11 -55
- package/lib/select/main.scss +22 -4
- package/lib/select/types.d.ts +108 -1
- package/lib/step/index.js +2 -2
- package/lib/step/main.scss +115 -66
- package/lib/step/types.d.ts +13 -2
- package/lib/table/index.d.ts +12 -0
- package/lib/table/index.js +25 -0
- package/lib/table/main.scss +30 -0
- package/lib/table/style.d.ts +2 -0
- package/lib/table/style.js +4 -0
- package/lib/table/types.d.ts +98 -0
- package/lib/table/types.js +2 -0
- package/lib/tag/index.d.ts +5 -3
- package/lib/tag/index.js +17 -1
- package/lib/tag/main.scss +20 -4
- package/lib/tag/types.d.ts +55 -0
- package/lib/text/index.js +1 -1
- package/lib/text/main.scss +4 -1
- package/lib/text/types.d.ts +8 -0
- package/lib/time-picker/index.d.ts +6 -15
- package/lib/time-picker/index.js +71 -23
- package/lib/time-picker/main.scss +19 -1
- package/lib/time-picker/style.d.ts +1 -0
- package/lib/time-picker/style.js +1 -0
- package/lib/time-picker/types.d.ts +133 -8
- package/lib/tool-status/index.d.ts +1 -1
- package/lib/tool-status/index.js +1 -1
- package/lib/tool-status/main.scss +2 -1
- package/lib/tool-status/types.d.ts +7 -2
- package/lib/utils/func.d.ts +1 -0
- package/lib/utils/func.js +15 -0
- package/lib/utils/github-dark.scss +137 -0
- package/lib/utils/github.scss +137 -0
- package/lib/utils/hoc/main.scss +166 -0
- package/lib/utils/hoc/withLabel.d.ts +94 -0
- package/lib/utils/hoc/withLabel.js +60 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/package.json +49 -4
- package/es/form/index.d.ts +0 -23
- package/es/form/index.js +0 -33
- package/es/form/main.scss +0 -5
- package/lib/form/index.d.ts +0 -23
- package/lib/form/index.js +0 -35
- package/lib/form/main.scss +0 -5
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
* | SPACE | Trigger the onClick event |
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
|
+
import type { PersonPickerProps } from './types';
|
|
21
22
|
export * from './types';
|
|
22
|
-
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<Pick<
|
|
23
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<Pick<Omit<PersonPickerProps, "label" | "required"> & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/select").SelectProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
|
|
23
24
|
selectAllYet: boolean;
|
|
24
25
|
componentDidUpdate(prevProps: import("@alifd/next/types/select").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
25
26
|
componentDidMount(): void;
|
|
@@ -207,193 +208,5 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
207
208
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
208
209
|
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
209
210
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
210
|
-
}, "focusInput" | "handleSearchClear"
|
|
211
|
-
selectAllYet: boolean;
|
|
212
|
-
componentDidUpdate(prevProps: import("@alifd/next/types/select").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
213
|
-
componentDidMount(): void;
|
|
214
|
-
ie9Hack(): void;
|
|
215
|
-
useDetailValue(): boolean;
|
|
216
|
-
hasSearch(): boolean;
|
|
217
|
-
getTagSize(): "small" | "medium" | "large" | undefined;
|
|
218
|
-
handleMenuSelect(keys: string[], item: {
|
|
219
|
-
props: {
|
|
220
|
-
_key: string;
|
|
221
|
-
};
|
|
222
|
-
}): false | void;
|
|
223
|
-
handleItemClick(key: string): void;
|
|
224
|
-
handleSingleSelect(key: string, triggerType: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
225
|
-
handleMultipleSelect(keys: import("@alifd/next/types/select").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
226
|
-
updateSelectAllYet(value?: unknown): void;
|
|
227
|
-
handleSearchValue(value: string): void;
|
|
228
|
-
handleSearch(value: string, e: import("react").ChangeEvent<HTMLInputElement>): void;
|
|
229
|
-
handleSearchClear(triggerType?: string | undefined): void;
|
|
230
|
-
handleSearchKeyDown(e: import("react").KeyboardEvent<HTMLElement>): void;
|
|
231
|
-
chooseMultipleItem(key: string): void;
|
|
232
|
-
chooseHighlightItem(proxy: unknown, e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
233
|
-
handleTagClose(item: import("@alifd/next/types/select").ObjectItem): boolean;
|
|
234
|
-
handleDeleteTag(e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
235
|
-
handleSelectAll(e: import("react").UIEvent<HTMLElement, UIEvent>): void;
|
|
236
|
-
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
237
|
-
afterClose(): void;
|
|
238
|
-
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select").ObjectItem[], totalValues: import("@alifd/next/types/select").ObjectItem[]): string;
|
|
239
|
-
renderValues(): import("react").ReactNode;
|
|
240
|
-
handleWrapClick: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
241
|
-
handleArrowClick: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
242
|
-
handleClear: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
243
|
-
hasClear(): boolean | undefined;
|
|
244
|
-
renderExtraNode(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
|
|
245
|
-
renderSelect(): import("react").JSX.Element;
|
|
246
|
-
renderSearchInput(valueNodes: import("react").ReactNode, placeholder: string | undefined, inputEl: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>): import("react").JSX.Element;
|
|
247
|
-
renderMenuHeader(): import("react").ReactNode;
|
|
248
|
-
render(): import("react").JSX.Element;
|
|
249
|
-
dataStore: import("@alifd/next/types/select/data-store").default;
|
|
250
|
-
selectDOM: HTMLElement;
|
|
251
|
-
width: string | number;
|
|
252
|
-
popupRef: HTMLDivElement;
|
|
253
|
-
resizeTimeout: number;
|
|
254
|
-
highlightTimer: number | undefined;
|
|
255
|
-
menuRef: import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/menu").MenuProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/menu/view/menu").Menu> | null;
|
|
256
|
-
isAutoComplete: boolean;
|
|
257
|
-
inputRef: import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>;
|
|
258
|
-
valueDataSource: {
|
|
259
|
-
value?: string | number | boolean | (string | number | boolean | null | undefined)[] | null | undefined;
|
|
260
|
-
valueDS?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined;
|
|
261
|
-
mapValueDS?: Record<string, import("@alifd/next/types/select").ObjectItem> | undefined;
|
|
262
|
-
};
|
|
263
|
-
componentWillUnmount(): void;
|
|
264
|
-
syncWidth(): void;
|
|
265
|
-
handleResize(): void;
|
|
266
|
-
setDataSource(props: import("@alifd/next/types/select").SelectProps): import("@alifd/next/types/select/types").NormalizedObjectItem[];
|
|
267
|
-
setVisible(visible: boolean, type?: import("@alifd/next/types/select").VisibleChangeType | undefined): void;
|
|
268
|
-
setFirstHightLightKeyForMenu(searchValue?: unknown): void;
|
|
269
|
-
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;
|
|
270
|
-
handleMenuBodyClick(): void;
|
|
271
|
-
toggleHighlightItem(dir: number): false | import("@alifd/next/types/select/types").NormalizedObjectItem | undefined;
|
|
272
|
-
scrollMenuIntoView(): void;
|
|
273
|
-
handleSelect(): void;
|
|
274
|
-
handleMouseDown: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
275
|
-
renderMenu(): import("react").JSX.Element;
|
|
276
|
-
renderMenuItem(dataSource: import("@alifd/next/types/select/types").NormalizedObjectItem[]): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
|
|
277
|
-
saveSelectRef: (ref: HTMLElement | null) => void;
|
|
278
|
-
saveInputRef: (ref: 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">) => void;
|
|
279
|
-
focusInput(): void;
|
|
280
|
-
focus(start?: number | undefined, end?: number | undefined, preventScroll?: boolean): void;
|
|
281
|
-
beforeOpen(): void;
|
|
282
|
-
beforeClose(): void;
|
|
283
|
-
savePopupRef: (ref: HTMLDivElement) => void;
|
|
284
|
-
shouldAutoWidth(): boolean | undefined;
|
|
285
|
-
context: any;
|
|
286
|
-
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;
|
|
287
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
288
|
-
readonly props: Readonly<import("@alifd/next/types/select").SelectProps> & Readonly<{
|
|
289
|
-
children?: import("react").ReactNode;
|
|
290
|
-
}>;
|
|
291
|
-
state: Readonly<import("@alifd/next/types/select/select").SelectState>;
|
|
292
|
-
refs: {
|
|
293
|
-
[key: string]: import("react").ReactInstance;
|
|
294
|
-
};
|
|
295
|
-
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
296
|
-
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
297
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
298
|
-
componentWillMount?(): void;
|
|
299
|
-
UNSAFE_componentWillMount?(): void;
|
|
300
|
-
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
301
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
302
|
-
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
303
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
304
|
-
}> & Pick<{
|
|
305
|
-
selectAllYet: boolean;
|
|
306
|
-
componentDidUpdate(prevProps: import("@alifd/next/types/select").SelectProps, prevState: import("@alifd/next/types/select/base").BaseState): void;
|
|
307
|
-
componentDidMount(): void;
|
|
308
|
-
ie9Hack(): void;
|
|
309
|
-
useDetailValue(): boolean;
|
|
310
|
-
hasSearch(): boolean;
|
|
311
|
-
getTagSize(): "small" | "medium" | "large" | undefined;
|
|
312
|
-
handleMenuSelect(keys: string[], item: {
|
|
313
|
-
props: {
|
|
314
|
-
_key: string;
|
|
315
|
-
};
|
|
316
|
-
}): false | void;
|
|
317
|
-
handleItemClick(key: string): void;
|
|
318
|
-
handleSingleSelect(key: string, triggerType: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
319
|
-
handleMultipleSelect(keys: import("@alifd/next/types/select").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
320
|
-
updateSelectAllYet(value?: unknown): void;
|
|
321
|
-
handleSearchValue(value: string): void;
|
|
322
|
-
handleSearch(value: string, e: import("react").ChangeEvent<HTMLInputElement>): void;
|
|
323
|
-
handleSearchClear(triggerType?: string | undefined): void;
|
|
324
|
-
handleSearchKeyDown(e: import("react").KeyboardEvent<HTMLElement>): void;
|
|
325
|
-
chooseMultipleItem(key: string): void;
|
|
326
|
-
chooseHighlightItem(proxy: unknown, e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
327
|
-
handleTagClose(item: import("@alifd/next/types/select").ObjectItem): boolean;
|
|
328
|
-
handleDeleteTag(e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
329
|
-
handleSelectAll(e: import("react").UIEvent<HTMLElement, UIEvent>): void;
|
|
330
|
-
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
331
|
-
afterClose(): void;
|
|
332
|
-
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select").ObjectItem[], totalValues: import("@alifd/next/types/select").ObjectItem[]): string;
|
|
333
|
-
renderValues(): import("react").ReactNode;
|
|
334
|
-
handleWrapClick: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
335
|
-
handleArrowClick: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
336
|
-
handleClear: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
337
|
-
hasClear(): boolean | undefined;
|
|
338
|
-
renderExtraNode(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
|
|
339
|
-
renderSelect(): import("react").JSX.Element;
|
|
340
|
-
renderSearchInput(valueNodes: import("react").ReactNode, placeholder: string | undefined, inputEl: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>): import("react").JSX.Element;
|
|
341
|
-
renderMenuHeader(): import("react").ReactNode;
|
|
342
|
-
render(): import("react").JSX.Element;
|
|
343
|
-
dataStore: import("@alifd/next/types/select/data-store").default;
|
|
344
|
-
selectDOM: HTMLElement;
|
|
345
|
-
width: string | number;
|
|
346
|
-
popupRef: HTMLDivElement;
|
|
347
|
-
resizeTimeout: number;
|
|
348
|
-
highlightTimer: number | undefined;
|
|
349
|
-
menuRef: import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/menu").MenuProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/menu/view/menu").Menu> | null;
|
|
350
|
-
isAutoComplete: boolean;
|
|
351
|
-
inputRef: import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>;
|
|
352
|
-
valueDataSource: {
|
|
353
|
-
value?: string | number | boolean | (string | number | boolean | null | undefined)[] | null | undefined;
|
|
354
|
-
valueDS?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined;
|
|
355
|
-
mapValueDS?: Record<string, import("@alifd/next/types/select").ObjectItem> | undefined;
|
|
356
|
-
};
|
|
357
|
-
componentWillUnmount(): void;
|
|
358
|
-
syncWidth(): void;
|
|
359
|
-
handleResize(): void;
|
|
360
|
-
setDataSource(props: import("@alifd/next/types/select").SelectProps): import("@alifd/next/types/select/types").NormalizedObjectItem[];
|
|
361
|
-
setVisible(visible: boolean, type?: import("@alifd/next/types/select").VisibleChangeType | undefined): void;
|
|
362
|
-
setFirstHightLightKeyForMenu(searchValue?: unknown): void;
|
|
363
|
-
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;
|
|
364
|
-
handleMenuBodyClick(): void;
|
|
365
|
-
toggleHighlightItem(dir: number): false | import("@alifd/next/types/select/types").NormalizedObjectItem | undefined;
|
|
366
|
-
scrollMenuIntoView(): void;
|
|
367
|
-
handleSelect(): void;
|
|
368
|
-
handleMouseDown: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
369
|
-
renderMenu(): import("react").JSX.Element;
|
|
370
|
-
renderMenuItem(dataSource: import("@alifd/next/types/select/types").NormalizedObjectItem[]): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
|
|
371
|
-
saveSelectRef: (ref: HTMLElement | null) => void;
|
|
372
|
-
saveInputRef: (ref: 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">) => void;
|
|
373
|
-
focusInput(): void;
|
|
374
|
-
focus(start?: number | undefined, end?: number | undefined, preventScroll?: boolean): void;
|
|
375
|
-
beforeOpen(): void;
|
|
376
|
-
beforeClose(): void;
|
|
377
|
-
savePopupRef: (ref: HTMLDivElement) => void;
|
|
378
|
-
shouldAutoWidth(): boolean | undefined;
|
|
379
|
-
context: any;
|
|
380
|
-
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;
|
|
381
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
382
|
-
readonly props: Readonly<import("@alifd/next/types/select").SelectProps> & Readonly<{
|
|
383
|
-
children?: import("react").ReactNode;
|
|
384
|
-
}>;
|
|
385
|
-
state: Readonly<import("@alifd/next/types/select/select").SelectState>;
|
|
386
|
-
refs: {
|
|
387
|
-
[key: string]: import("react").ReactInstance;
|
|
388
|
-
};
|
|
389
|
-
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
390
|
-
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
391
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
392
|
-
componentWillMount?(): void;
|
|
393
|
-
UNSAFE_componentWillMount?(): void;
|
|
394
|
-
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
395
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextContext: any): void;
|
|
396
|
-
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
397
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): void;
|
|
398
|
-
}, "focusInput" | "handleSearchClear">, {}>;
|
|
211
|
+
}, "focusInput" | "handleSearchClear">> & import("../utils").WithLabelProps, "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "warning" | "pure" | "rtl" | "device" | "locale" | "key" | "errorBoundary" | keyof import("../utils").WithLabelProps | "value" | "mode" | "pageSize"> & React.RefAttributes<any>, "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "warning" | "pure" | "rtl" | "device" | "locale" | "key" | "errorBoundary" | keyof import("../utils").WithLabelProps | "value" | "mode" | "pageSize"> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, any, {}>;
|
|
399
212
|
export default _default;
|
|
@@ -28,22 +28,6 @@ const PersonPicker = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
28
28
|
var { className, size = 'medium', defaultValue, readOnly } = _a, props = tslib_1.__rest(_a, ["className", "size", "defaultValue", "readOnly"]);
|
|
29
29
|
const [dataSource, setDataSource] = (0, react_1.useState)([]);
|
|
30
30
|
const debounceTimerRef = (0, react_1.useRef)(null);
|
|
31
|
-
// 默认出现最近联系人
|
|
32
|
-
(0, react_1.useEffect)(() => {
|
|
33
|
-
handleUserSearch('');
|
|
34
|
-
}, []);
|
|
35
|
-
const tagRender = (selectItem) => {
|
|
36
|
-
return react_1.default.createElement("div", { className: "tag-container" },
|
|
37
|
-
react_1.default.createElement("img", { src: `https://work.alibaba-inc.com/photo/${selectItem.value}.40x40.jpg` }),
|
|
38
|
-
react_1.default.createElement("div", { className: 'right-container' },
|
|
39
|
-
react_1.default.createElement("div", { className: 'nick-name' }, selectItem.label),
|
|
40
|
-
react_1.default.createElement("div", { className: 'dept-name' }, (selectItem === null || selectItem === void 0 ? void 0 : selectItem.deptName) || '')));
|
|
41
|
-
};
|
|
42
|
-
const labelRender = (selectItem) => {
|
|
43
|
-
return react_1.default.createElement("div", { className: "label-container" },
|
|
44
|
-
react_1.default.createElement("img", { style: { width: '20px', height: '20px', borderRadius: '4px' }, src: `https://work.alibaba-inc.com/photo/${selectItem.value}.20x20.jpg` }),
|
|
45
|
-
react_1.default.createElement("span", { className: "label-text" }, selectItem.label));
|
|
46
|
-
};
|
|
47
31
|
const fetchUserData = (keyword) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
48
32
|
var _a;
|
|
49
33
|
if (readOnly) {
|
|
@@ -66,9 +50,9 @@ const PersonPicker = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
66
50
|
},
|
|
67
51
|
});
|
|
68
52
|
const responseData = yield response.json();
|
|
69
|
-
const newDataSource = (_a = responseData === null || responseData === void 0 ? void 0 : responseData.content) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
53
|
+
const newDataSource = ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.content) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
70
54
|
return Object.assign(Object.assign({}, item), { label: item.nickName, value: item.workNo });
|
|
71
|
-
});
|
|
55
|
+
})) || [];
|
|
72
56
|
setDataSource(newDataSource);
|
|
73
57
|
}
|
|
74
58
|
catch (error) {
|
|
@@ -86,9 +70,27 @@ const PersonPicker = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
86
70
|
fetchUserData(keyword);
|
|
87
71
|
}, 200);
|
|
88
72
|
};
|
|
89
|
-
|
|
73
|
+
// 默认出现最近联系人
|
|
74
|
+
(0, react_1.useEffect)(() => {
|
|
75
|
+
handleUserSearch('');
|
|
76
|
+
}, []);
|
|
77
|
+
const tagRender = (selectItem) => {
|
|
78
|
+
return react_1.default.createElement("div", { className: "tag-container" },
|
|
79
|
+
react_1.default.createElement("img", { src: `https://work.alibaba-inc.com/photo/${selectItem.value}.40x40.jpg`, alt: `${selectItem.label} 头像` }),
|
|
80
|
+
react_1.default.createElement("div", { className: 'right-container' },
|
|
81
|
+
react_1.default.createElement("div", { className: 'nick-name' }, selectItem.label),
|
|
82
|
+
react_1.default.createElement("div", { className: 'dept-name' }, (selectItem === null || selectItem === void 0 ? void 0 : selectItem.deptName) || '')));
|
|
83
|
+
};
|
|
84
|
+
const labelRender = (selectItem) => {
|
|
85
|
+
return react_1.default.createElement("div", { className: "label-container" },
|
|
86
|
+
react_1.default.createElement("img", { style: { width: '20px', height: '20px', borderRadius: '4px' }, src: `https://work.alibaba-inc.com/photo/${selectItem.value}.20x20.jpg`, alt: `${selectItem.label} 头像` }),
|
|
87
|
+
react_1.default.createElement("span", { className: "label-text" }, selectItem.label));
|
|
88
|
+
};
|
|
89
|
+
return (react_1.default.createElement(next_1.Select, Object.assign({}, props, { popupClassName: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}person-picker-popup`, className), itemRender: tagRender, className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}person-picker`, className), valueRender: labelRender, mode: "multiple", showSearch: true, filterLocal: false, hiddenSelected: true, dataSource: dataSource, onSearch: handleUserSearch, size: size, ref: ref, readOnly: readOnly, state: props.state })));
|
|
90
90
|
});
|
|
91
|
-
|
|
91
|
+
// Apply withLabel HOC to PersonPicker
|
|
92
|
+
const PersonPickerWithLabel = (0, utils_1.withLabel)(PersonPicker, {});
|
|
93
|
+
const PersonPickerWithSub = (0, utils_1.assignSubComponent)(PersonPickerWithLabel, {
|
|
92
94
|
displayName: 'PersonPicker',
|
|
93
95
|
});
|
|
94
96
|
tslib_1.__exportStar(require("./types"), exports);
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
@import "../core/variables.scss";
|
|
2
2
|
|
|
3
3
|
.#{$prefix}person-picker {
|
|
4
|
+
width: 100%;
|
|
5
|
+
position: relative;
|
|
6
|
+
top: 0.5px;
|
|
7
|
+
|
|
8
|
+
.next-input .next-tag {
|
|
9
|
+
padding-top: 2px;
|
|
10
|
+
|
|
11
|
+
.next-tag-close-btn {
|
|
12
|
+
line-height: 20px;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.#{$prefix}person-picker-popup {
|
|
4
18
|
.next-menu-item-inner {
|
|
5
19
|
height: var(--s--6, 44px);
|
|
6
20
|
}
|
|
@@ -22,7 +36,7 @@
|
|
|
22
36
|
line-height: var(--font-size-body-2, 14px);
|
|
23
37
|
font-size: var(--font-size-body-2, 14px);
|
|
24
38
|
margin-bottom: var(--s--1, 4px);
|
|
25
|
-
color: var(--color-text1-4, #
|
|
39
|
+
color: var(--color-text1-4, #333333);
|
|
26
40
|
}
|
|
27
41
|
.dept-name {
|
|
28
42
|
font-size: var(--s--3, 12px);
|
|
@@ -1,20 +1,62 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
type
|
|
2
|
+
import type { WithLabelProps } from '../utils/hoc/withLabel';
|
|
3
|
+
import type { CommonProps } from '@alifd/next/types/util';
|
|
4
|
+
type HTMLAttributesWeak = Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'defaultValue' | 'value' | 'onClick' | 'onSelect'>;
|
|
3
5
|
/**
|
|
4
|
-
* @api
|
|
6
|
+
* @api PersonPicker
|
|
5
7
|
*/
|
|
6
|
-
export interface
|
|
8
|
+
export interface PersonPickerBaseProps extends HTMLAttributesWeak, CommonProps {
|
|
7
9
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @en
|
|
10
|
-
* @defaultValue '
|
|
10
|
+
* 选择器尺寸
|
|
11
|
+
* @en Size of person picker
|
|
12
|
+
* @defaultValue 'medium'
|
|
11
13
|
*/
|
|
12
|
-
|
|
14
|
+
size?: 'medium';
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
15
|
-
* @en
|
|
16
|
-
|
|
16
|
+
* 默认值
|
|
17
|
+
* @en Default selected value(s)
|
|
18
|
+
*/
|
|
19
|
+
defaultValue?: Array<{
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* 当前值
|
|
25
|
+
* @en Current selected value(s)
|
|
26
|
+
*/
|
|
27
|
+
value?: Array<{
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* 是否只读
|
|
33
|
+
* @en Whether is readonly
|
|
34
|
+
* @defaultValue false
|
|
35
|
+
*/
|
|
36
|
+
readOnly?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 每页显示的数量
|
|
39
|
+
* @en Page size for search results
|
|
40
|
+
* @defaultValue 5
|
|
41
|
+
*/
|
|
42
|
+
pageSize?: number;
|
|
43
|
+
/**
|
|
44
|
+
* 选择器模式
|
|
45
|
+
* @en Select mode
|
|
46
|
+
* @defaultValue 'multiple'
|
|
17
47
|
*/
|
|
18
|
-
|
|
48
|
+
mode?: 'single' | 'multiple';
|
|
49
|
+
/**
|
|
50
|
+
* 值改变时的回调
|
|
51
|
+
* @en Callback when value changes
|
|
52
|
+
*/
|
|
53
|
+
onChange?: (value: Array<{
|
|
54
|
+
value: string;
|
|
55
|
+
label: string;
|
|
56
|
+
}>) => void;
|
|
19
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @api PersonPicker
|
|
60
|
+
*/
|
|
61
|
+
export type PersonPickerProps = PersonPickerBaseProps & WithLabelProps;
|
|
20
62
|
export {};
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
export * from './types';
|
|
9
|
-
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<Pick<any, string | number | symbol> & React.RefAttributes<HTMLDivElement>, string | number | symbol> & import("@alifd/next/types/config-provider/types").ComponentCommonProps,
|
|
9
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<Pick<Pick<any, string | number | symbol> & React.RefAttributes<HTMLDivElement> & import("../utils").WithLabelProps, string | number | symbol> & React.RefAttributes<any>, string | number | symbol> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, any, {}>;
|
|
10
10
|
export default _default;
|
package/lib/radio-group/index.js
CHANGED
|
@@ -22,13 +22,19 @@ const RadioGroup = (0, react_1.forwardRef)((props) => {
|
|
|
22
22
|
const onItemClick = (value) => {
|
|
23
23
|
props.onChange && props.onChange(value);
|
|
24
24
|
};
|
|
25
|
-
return (react_1.default.createElement("div", { className: `${utils_1.PREFIX_DEFAULT}radio-group` }, props.options.map((item) => (react_1.default.createElement("div", { className: (0, classnames_1.default)('radio-item', { active: item.value === props.value }), key: item.value, onClick: () => onItemClick(item.value) },
|
|
25
|
+
return (react_1.default.createElement("div", { className: `${utils_1.PREFIX_DEFAULT}radio-group` }, props.options.map((item) => (react_1.default.createElement("div", { className: (0, classnames_1.default)('radio-item', { active: item.value === props.value, 'disabled': props.disabled || item.disabled }), key: item.value, onClick: () => onItemClick(item.value) },
|
|
26
26
|
react_1.default.createElement("div", { className: "radio-item-title-container" },
|
|
27
27
|
react_1.default.createElement("div", { className: "radio-item-title" }, item.label),
|
|
28
28
|
react_1.default.createElement(ArrowIcon, null)),
|
|
29
29
|
item.description && (react_1.default.createElement("div", { className: "radio-item-desc" }, item.description)))))));
|
|
30
30
|
});
|
|
31
|
-
const
|
|
31
|
+
const LabeledRadioGroup = (0, utils_1.withLabel)(RadioGroup, {
|
|
32
|
+
labelLayout: 'vertical',
|
|
33
|
+
coverStyle: false,
|
|
34
|
+
enableHoverState: false,
|
|
35
|
+
enableDisabledState: false,
|
|
36
|
+
});
|
|
37
|
+
const RadioGroupWithSub = (0, utils_1.assignSubComponent)(LabeledRadioGroup, {
|
|
32
38
|
displayName: 'RadioGroup',
|
|
33
39
|
});
|
|
34
40
|
tslib_1.__exportStar(require("./types"), exports);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
@import '../core/variables.scss';
|
|
2
2
|
|
|
3
3
|
.#{$prefix}radio-group {
|
|
4
|
+
width: 100%;
|
|
5
|
+
|
|
4
6
|
.radio-item {
|
|
5
|
-
padding:
|
|
6
|
-
margin-bottom: 8px;
|
|
7
|
-
border-radius: 6px;
|
|
7
|
+
padding: var(--s-2, 8px);
|
|
8
|
+
margin-bottom: var(--s-2, 8px);
|
|
9
|
+
border-radius: var(--corner-2, 6px);
|
|
8
10
|
background-color: $color-fill1-1;
|
|
9
11
|
cursor: pointer;
|
|
10
12
|
|
|
@@ -15,6 +17,11 @@
|
|
|
15
17
|
&.active {
|
|
16
18
|
background-color: $color-fill1-2;
|
|
17
19
|
}
|
|
20
|
+
|
|
21
|
+
&.disabled {
|
|
22
|
+
background-color: $color-fill1-2;
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
}
|
|
18
25
|
}
|
|
19
26
|
|
|
20
27
|
.radio-item-title-container {
|
|
@@ -25,12 +32,12 @@
|
|
|
25
32
|
|
|
26
33
|
.radio-item-title {
|
|
27
34
|
width: calc(100% - 24px);
|
|
28
|
-
margin-right: 8px;
|
|
35
|
+
margin-right: var(--s-2, 8px);
|
|
29
36
|
flex-shrink: 1;
|
|
30
37
|
overflow: hidden;
|
|
31
38
|
font-size: 14px;
|
|
32
39
|
font-weight: 500;
|
|
33
|
-
line-height:
|
|
40
|
+
line-height: 20px;
|
|
34
41
|
color: $color-text1-4;
|
|
35
42
|
overflow: hidden;
|
|
36
43
|
text-overflow: ellipsis;
|
|
@@ -54,5 +61,6 @@
|
|
|
54
61
|
text-overflow: ellipsis;
|
|
55
62
|
white-space: nowrap;
|
|
56
63
|
user-select: none;
|
|
64
|
+
margin-top: 2px;
|
|
57
65
|
}
|
|
58
66
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { WithLabelProps } from '../utils';
|
|
1
2
|
export interface RadioItem {
|
|
2
3
|
label: string;
|
|
3
4
|
value: string;
|
|
4
5
|
description?: string;
|
|
6
|
+
disabled?: boolean;
|
|
5
7
|
}
|
|
6
|
-
export interface RadioGroupProps {
|
|
8
|
+
export interface RadioGroupProps extends Partial<WithLabelProps> {
|
|
7
9
|
options: RadioItem[];
|
|
8
|
-
value
|
|
9
|
-
onChange
|
|
10
|
+
value?: string;
|
|
11
|
+
onChange?: (value: string) => void;
|
|
10
12
|
}
|
package/lib/reference/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @when Reference
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import { ReferenceProps } from './types';
|
|
8
|
+
import { type ReferenceProps } from './types';
|
|
9
9
|
export * from './types';
|
|
10
10
|
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<ReferenceProps & React.RefAttributes<HTMLDivElement>, "key" | keyof ReferenceProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, HTMLDivElement, {}>;
|
|
11
11
|
export default _default;
|
package/lib/reference/index.js
CHANGED
|
@@ -9,10 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
const tslib_1 = require("tslib");
|
|
10
10
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
11
11
|
const next_1 = require("@alifd/next");
|
|
12
|
-
const icon_1 = tslib_1.__importDefault(require("../icon"));
|
|
13
12
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
13
|
+
const icon_1 = tslib_1.__importStar(require("../icon"));
|
|
14
14
|
const utils_1 = require("../utils");
|
|
15
|
-
const icon_2 = require("../icon");
|
|
16
15
|
const DEFAULT_REFERENCE_ICON = 'https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg';
|
|
17
16
|
const DEFAULT_DETAIL_CLOSE_ICON = 'close';
|
|
18
17
|
const DEFAULT_DETAIL_TITLE = '引用信息';
|
|
@@ -43,6 +42,18 @@ const Reference = (0, react_1.forwardRef)(({ className, defaultExpanded = false,
|
|
|
43
42
|
event.stopPropagation();
|
|
44
43
|
onContentClick === null || onContentClick === void 0 ? void 0 : onContentClick(isExpanded);
|
|
45
44
|
};
|
|
45
|
+
const renderDetailHeader = () => {
|
|
46
|
+
if (header === false) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const headerIcon = (header === null || header === void 0 ? void 0 : header.icon) || DEFAULT_DETAIL_CLOSE_ICON;
|
|
50
|
+
const headerTitle = (header === null || header === void 0 ? void 0 : header.title) || DEFAULT_DETAIL_TITLE;
|
|
51
|
+
return (react_1.default.createElement("div", { className: `reference-header ${mode}` },
|
|
52
|
+
react_1.default.createElement("div", { className: 'reference-text' }, headerTitle),
|
|
53
|
+
react_1.default.createElement("div", { className: 'reference-close', onClick: () => {
|
|
54
|
+
onHeaderClose === null || onHeaderClose === void 0 ? void 0 : onHeaderClose();
|
|
55
|
+
} }, (0, icon_1.renderCommonIcon)(headerIcon, 'xs'))));
|
|
56
|
+
};
|
|
46
57
|
const renderHeader = () => {
|
|
47
58
|
if (header === false) {
|
|
48
59
|
return null;
|
|
@@ -50,31 +61,19 @@ const Reference = (0, react_1.forwardRef)(({ className, defaultExpanded = false,
|
|
|
50
61
|
if (mode === 'detail') {
|
|
51
62
|
return renderDetailHeader();
|
|
52
63
|
}
|
|
53
|
-
|
|
64
|
+
const headerIcon = (header === null || header === void 0 ? void 0 : header.icon) || DEFAULT_REFERENCE_ICON;
|
|
54
65
|
const iconType = isExpanded ? 'arrow-up' : 'arrow-down';
|
|
55
66
|
return (react_1.default.createElement("div", { className: `reference-header ${mode}`, onClick: (e) => {
|
|
56
67
|
handleHeaderClick(e);
|
|
57
68
|
} },
|
|
58
69
|
react_1.default.createElement("div", { className: 'reference-name' },
|
|
59
|
-
(0,
|
|
70
|
+
(0, icon_1.renderCommonIcon)(headerIcon),
|
|
60
71
|
react_1.default.createElement("div", { className: 'reference-title' }, header === null || header === void 0 ? void 0 : header.title)),
|
|
61
72
|
react_1.default.createElement("div", { className: 'reference-operate', onClick: (e) => {
|
|
62
73
|
handleExpandedClick(e);
|
|
63
74
|
} },
|
|
64
75
|
react_1.default.createElement(icon_1.default, { type: iconType, size: 'xs' }))));
|
|
65
76
|
};
|
|
66
|
-
const renderDetailHeader = () => {
|
|
67
|
-
if (header === false) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
const headerIcon = (header === null || header === void 0 ? void 0 : header.icon) || DEFAULT_DETAIL_CLOSE_ICON;
|
|
71
|
-
const headerTitle = (header === null || header === void 0 ? void 0 : header.title) || DEFAULT_DETAIL_TITLE;
|
|
72
|
-
return (react_1.default.createElement("div", { className: `reference-header ${mode}` },
|
|
73
|
-
react_1.default.createElement("div", { className: 'reference-text' }, headerTitle),
|
|
74
|
-
react_1.default.createElement("div", { className: 'reference-close', onClick: () => {
|
|
75
|
-
onHeaderClose === null || onHeaderClose === void 0 ? void 0 : onHeaderClose();
|
|
76
|
-
} }, (0, icon_2.renderCommonIcon)(headerIcon, 'xs'))));
|
|
77
|
-
};
|
|
78
77
|
const handleReferenceClick = (item, index, event) => {
|
|
79
78
|
event.stopPropagation();
|
|
80
79
|
if (onItemClick) {
|
|
@@ -88,7 +87,7 @@ const Reference = (0, react_1.forwardRef)(({ className, defaultExpanded = false,
|
|
|
88
87
|
react_1.default.createElement("div", { className: 'reference-title' },
|
|
89
88
|
react_1.default.createElement("div", { className: 'reference-name' },
|
|
90
89
|
react_1.default.createElement("span", { className: 'reference-item-index' }, index + 1),
|
|
91
|
-
(item === null || item === void 0 ? void 0 : item.sourceIcon) && (0,
|
|
90
|
+
(item === null || item === void 0 ? void 0 : item.sourceIcon) && (0, icon_1.renderCommonIcon)(item === null || item === void 0 ? void 0 : item.sourceIcon),
|
|
92
91
|
react_1.default.createElement("span", null, item === null || item === void 0 ? void 0 : item.name)),
|
|
93
92
|
(item === null || item === void 0 ? void 0 : item.modifyTime) && false && react_1.default.createElement("div", { className: 'reference-time' }, item === null || item === void 0 ? void 0 : item.modifyTime)),
|
|
94
93
|
(item === null || item === void 0 ? void 0 : item.content) && react_1.default.createElement("div", { className: 'reference-content' }, item === null || item === void 0 ? void 0 : item.content))));
|
|
@@ -105,7 +104,7 @@ const Reference = (0, react_1.forwardRef)(({ className, defaultExpanded = false,
|
|
|
105
104
|
} },
|
|
106
105
|
isExpanded && mode === 'simple' && listItems.map((item, index) => (react_1.default.createElement("div", { key: index, className: 'reference-item' },
|
|
107
106
|
react_1.default.createElement("span", { className: 'reference-item-index' }, index + 1),
|
|
108
|
-
(item === null || item === void 0 ? void 0 : item.sourceIcon) && (0,
|
|
107
|
+
(item === null || item === void 0 ? void 0 : item.sourceIcon) && (0, icon_1.renderCommonIcon)(item === null || item === void 0 ? void 0 : item.sourceIcon),
|
|
109
108
|
react_1.default.createElement("div", { className: 'reference-text', onClick: (e) => handleReferenceClick(item, index, e) }, item === null || item === void 0 ? void 0 : item.name),
|
|
110
109
|
(item === null || item === void 0 ? void 0 : item.modifyTime) && false && react_1.default.createElement("div", { className: 'reference-time' }, item === null || item === void 0 ? void 0 : item.modifyTime)))),
|
|
111
110
|
mode === 'detail' && renderDetailList()));
|
package/lib/reference/main.scss
CHANGED