@alifd/chat 0.1.16 → 0.2.0-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/card/view/collapsable.d.ts +1 -1
- package/es/card-loading/index.d.ts +11 -0
- package/es/card-loading/index.js +18 -0
- package/es/card-loading/main.scss +5 -0
- package/es/card-loading/style.d.ts +2 -0
- package/es/card-loading/style.js +2 -0
- package/es/card-loading/types.d.ts +10 -0
- package/es/card-loading/types.js +1 -0
- package/es/feedback/types.d.ts +8 -0
- package/es/float-button/hooks/useAutoHide.d.ts +0 -1
- package/es/float-button/hooks/useDragable.d.ts +0 -1
- package/es/float-button/index.d.ts +0 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/list/index.d.ts +8 -0
- package/es/list/index.js +8 -0
- package/es/list/style.d.ts +1 -0
- package/es/list/style.js +1 -0
- package/es/list/types.d.ts +93 -0
- package/es/list/types.js +1 -0
- package/es/message/index.d.ts +8 -8
- package/es/person-picker/index.d.ts +90 -90
- package/es/person-picker/index.js +2 -2
- package/es/tag/index.d.ts +18 -18
- package/lib/card/view/card.js +2 -3
- package/lib/card/view/collapsable.d.ts +1 -1
- package/lib/card-loading/index.d.ts +11 -0
- package/lib/card-loading/index.js +21 -0
- package/lib/card-loading/main.scss +5 -0
- package/lib/card-loading/style.d.ts +2 -0
- package/lib/card-loading/style.js +4 -0
- package/lib/card-loading/types.d.ts +10 -0
- package/lib/card-loading/types.js +2 -0
- package/lib/feedback/types.d.ts +8 -0
- package/lib/float-button/hooks/useAutoAlign.js +1 -2
- package/lib/float-button/hooks/useAutoHide.d.ts +0 -1
- package/lib/float-button/hooks/useAutoHide.js +1 -2
- package/lib/float-button/hooks/useDragable.d.ts +0 -1
- package/lib/float-button/hooks/useDragable.js +1 -2
- package/lib/float-button/hooks/useNestleEdge.js +1 -2
- package/lib/float-button/hooks/useTriggerType.js +1 -2
- package/lib/float-button/index.d.ts +0 -1
- package/lib/float-button/util.js +4 -5
- package/lib/float-button/view/balloon.js +1 -2
- package/lib/float-button/view/drawer.js +1 -2
- package/lib/float-button/view/inner-drawer.js +1 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.js +21 -19
- package/lib/list/index.d.ts +8 -0
- package/lib/list/index.js +12 -0
- package/lib/list/style.d.ts +1 -0
- package/lib/list/style.js +3 -0
- package/lib/list/types.d.ts +93 -0
- package/lib/list/types.js +2 -0
- package/lib/message/index.d.ts +8 -8
- package/lib/person-picker/index.d.ts +90 -90
- package/lib/person-picker/index.js +2 -2
- package/lib/tag/index.d.ts +18 -18
- package/lib/utils/common.js +1 -2
- package/lib/utils/dingtalk.js +3 -4
- package/lib/utils/func.js +2 -3
- package/lib/utils/hooks/useControlable.js +1 -2
- package/lib/utils/hooks/useDebounce.js +1 -2
- package/lib/utils/hooks/useThrottle.js +1 -2
- package/package.json +25 -1
|
@@ -37,27 +37,27 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
37
37
|
handleMultipleSelect(keys: import("@alifd/next/types/select").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
38
38
|
updateSelectAllYet(value?: unknown): void;
|
|
39
39
|
handleSearchValue(value: string): void;
|
|
40
|
-
handleSearch(value: string, e:
|
|
40
|
+
handleSearch(value: string, e: import("react").ChangeEvent<HTMLInputElement>): void;
|
|
41
41
|
handleSearchClear(triggerType?: string | undefined): void;
|
|
42
|
-
handleSearchKeyDown(e:
|
|
42
|
+
handleSearchKeyDown(e: import("react").KeyboardEvent<HTMLElement>): void;
|
|
43
43
|
chooseMultipleItem(key: string): void;
|
|
44
|
-
chooseHighlightItem(proxy: unknown, e:
|
|
44
|
+
chooseHighlightItem(proxy: unknown, e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
45
45
|
handleTagClose(item: import("@alifd/next/types/select").ObjectItem): boolean;
|
|
46
|
-
handleDeleteTag(e:
|
|
47
|
-
handleSelectAll(e:
|
|
46
|
+
handleDeleteTag(e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
47
|
+
handleSelectAll(e: import("react").UIEvent<HTMLElement, UIEvent>): void;
|
|
48
48
|
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
49
49
|
afterClose(): void;
|
|
50
50
|
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select").ObjectItem[], totalValues: import("@alifd/next/types/select").ObjectItem[]): string;
|
|
51
|
-
renderValues():
|
|
52
|
-
handleWrapClick: (e:
|
|
53
|
-
handleArrowClick: (e:
|
|
54
|
-
handleClear: (e:
|
|
51
|
+
renderValues(): import("react").ReactNode;
|
|
52
|
+
handleWrapClick: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
53
|
+
handleArrowClick: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
54
|
+
handleClear: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
55
55
|
hasClear(): boolean | undefined;
|
|
56
|
-
renderExtraNode():
|
|
57
|
-
renderSelect():
|
|
58
|
-
renderSearchInput(valueNodes:
|
|
59
|
-
renderMenuHeader():
|
|
60
|
-
render():
|
|
56
|
+
renderExtraNode(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
|
|
57
|
+
renderSelect(): import("react").JSX.Element;
|
|
58
|
+
renderSearchInput(valueNodes: import("react").ReactNode, placeholder: string | undefined, inputEl: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>): import("react").JSX.Element;
|
|
59
|
+
renderMenuHeader(): import("react").ReactNode;
|
|
60
|
+
render(): import("react").JSX.Element;
|
|
61
61
|
dataStore: import("@alifd/next/types/select/data-store").default;
|
|
62
62
|
selectDOM: HTMLElement;
|
|
63
63
|
width: string | number;
|
|
@@ -69,7 +69,7 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
69
69
|
inputRef: import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>;
|
|
70
70
|
valueDataSource: {
|
|
71
71
|
value?: string | number | boolean | (string | number | boolean | null | undefined)[] | null | undefined;
|
|
72
|
-
valueDS?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined;
|
|
72
|
+
valueDS?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined;
|
|
73
73
|
mapValueDS?: Record<string, import("@alifd/next/types/select").ObjectItem> | undefined;
|
|
74
74
|
};
|
|
75
75
|
componentWillUnmount(): void;
|
|
@@ -83,13 +83,13 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
83
83
|
toggleHighlightItem(dir: number): false | import("@alifd/next/types/select/types").NormalizedObjectItem | undefined;
|
|
84
84
|
scrollMenuIntoView(): void;
|
|
85
85
|
handleSelect(): void;
|
|
86
|
-
handleMouseDown: (e:
|
|
87
|
-
renderMenu():
|
|
88
|
-
renderMenuItem(dataSource: import("@alifd/next/types/select/types").NormalizedObjectItem[]):
|
|
86
|
+
handleMouseDown: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
87
|
+
renderMenu(): import("react").JSX.Element;
|
|
88
|
+
renderMenuItem(dataSource: import("@alifd/next/types/select/types").NormalizedObjectItem[]): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
|
|
89
89
|
saveSelectRef: (ref: HTMLElement | null) => void;
|
|
90
90
|
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;
|
|
91
91
|
focusInput(): void;
|
|
92
|
-
focus(start?: number | undefined, end?: number | undefined, preventScroll?: boolean
|
|
92
|
+
focus(start?: number | undefined, end?: number | undefined, preventScroll?: boolean): void;
|
|
93
93
|
beforeOpen(): void;
|
|
94
94
|
beforeClose(): void;
|
|
95
95
|
savePopupRef: (ref: HTMLDivElement) => void;
|
|
@@ -98,14 +98,14 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
98
98
|
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;
|
|
99
99
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
100
100
|
readonly props: Readonly<import("@alifd/next/types/select").SelectProps> & Readonly<{
|
|
101
|
-
children?:
|
|
101
|
+
children?: import("react").ReactNode;
|
|
102
102
|
}>;
|
|
103
103
|
state: Readonly<import("@alifd/next/types/select/select").SelectState>;
|
|
104
104
|
refs: {
|
|
105
|
-
[key: string]:
|
|
105
|
+
[key: string]: import("react").ReactInstance;
|
|
106
106
|
};
|
|
107
107
|
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
108
|
-
componentDidCatch?(error: Error, errorInfo:
|
|
108
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
109
109
|
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
110
110
|
componentWillMount?(): void;
|
|
111
111
|
UNSAFE_componentWillMount?(): void;
|
|
@@ -131,27 +131,27 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
131
131
|
handleMultipleSelect(keys: import("@alifd/next/types/select").DataSourceItem[] | undefined, triggerType: import("@alifd/next/types/select").VisibleChangeType, key?: string | null | undefined, keepSearchValue?: boolean | undefined): void;
|
|
132
132
|
updateSelectAllYet(value?: unknown): void;
|
|
133
133
|
handleSearchValue(value: string): void;
|
|
134
|
-
handleSearch(value: string, e:
|
|
134
|
+
handleSearch(value: string, e: import("react").ChangeEvent<HTMLInputElement>): void;
|
|
135
135
|
handleSearchClear(triggerType?: string | undefined): void;
|
|
136
|
-
handleSearchKeyDown(e:
|
|
136
|
+
handleSearchKeyDown(e: import("react").KeyboardEvent<HTMLElement>): void;
|
|
137
137
|
chooseMultipleItem(key: string): void;
|
|
138
|
-
chooseHighlightItem(proxy: unknown, e:
|
|
138
|
+
chooseHighlightItem(proxy: unknown, e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
139
139
|
handleTagClose(item: import("@alifd/next/types/select").ObjectItem): boolean;
|
|
140
|
-
handleDeleteTag(e:
|
|
141
|
-
handleSelectAll(e:
|
|
140
|
+
handleDeleteTag(e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
141
|
+
handleSelectAll(e: import("react").UIEvent<HTMLElement, UIEvent>): void;
|
|
142
142
|
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
143
143
|
afterClose(): void;
|
|
144
144
|
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select").ObjectItem[], totalValues: import("@alifd/next/types/select").ObjectItem[]): string;
|
|
145
|
-
renderValues():
|
|
146
|
-
handleWrapClick: (e:
|
|
147
|
-
handleArrowClick: (e:
|
|
148
|
-
handleClear: (e:
|
|
145
|
+
renderValues(): import("react").ReactNode;
|
|
146
|
+
handleWrapClick: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
147
|
+
handleArrowClick: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
148
|
+
handleClear: (e: import("react").UIEvent<HTMLElement, UIEvent>) => void;
|
|
149
149
|
hasClear(): boolean | undefined;
|
|
150
|
-
renderExtraNode():
|
|
151
|
-
renderSelect():
|
|
152
|
-
renderSearchInput(valueNodes:
|
|
153
|
-
renderMenuHeader():
|
|
154
|
-
render():
|
|
150
|
+
renderExtraNode(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
|
|
151
|
+
renderSelect(): import("react").JSX.Element;
|
|
152
|
+
renderSearchInput(valueNodes: import("react").ReactNode, placeholder: string | undefined, inputEl: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>): import("react").JSX.Element;
|
|
153
|
+
renderMenuHeader(): import("react").ReactNode;
|
|
154
|
+
render(): import("react").JSX.Element;
|
|
155
155
|
dataStore: import("@alifd/next/types/select/data-store").default;
|
|
156
156
|
selectDOM: HTMLElement;
|
|
157
157
|
width: string | number;
|
|
@@ -163,7 +163,7 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
163
163
|
inputRef: import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>;
|
|
164
164
|
valueDataSource: {
|
|
165
165
|
value?: string | number | boolean | (string | number | boolean | null | undefined)[] | null | undefined;
|
|
166
|
-
valueDS?: import("@alifd/next/types/select").ObjectItem | import("@alifd/next/types/select").ObjectItem[] | undefined;
|
|
166
|
+
valueDS?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined;
|
|
167
167
|
mapValueDS?: Record<string, import("@alifd/next/types/select").ObjectItem> | undefined;
|
|
168
168
|
};
|
|
169
169
|
componentWillUnmount(): void;
|
|
@@ -177,29 +177,29 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
177
177
|
toggleHighlightItem(dir: number): false | import("@alifd/next/types/select/types").NormalizedObjectItem | undefined;
|
|
178
178
|
scrollMenuIntoView(): void;
|
|
179
179
|
handleSelect(): void;
|
|
180
|
-
handleMouseDown: (e:
|
|
181
|
-
renderMenu():
|
|
182
|
-
renderMenuItem(dataSource: import("@alifd/next/types/select/types").NormalizedObjectItem[]):
|
|
180
|
+
handleMouseDown: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
181
|
+
renderMenu(): import("react").JSX.Element;
|
|
182
|
+
renderMenuItem(dataSource: import("@alifd/next/types/select/types").NormalizedObjectItem[]): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
|
|
183
183
|
saveSelectRef: (ref: HTMLElement | null) => void;
|
|
184
184
|
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;
|
|
185
185
|
focusInput(): void;
|
|
186
|
-
focus(start?: number | undefined, end?: number | undefined, preventScroll?: boolean
|
|
186
|
+
focus(start?: number | undefined, end?: number | undefined, preventScroll?: boolean): void;
|
|
187
187
|
beforeOpen(): void;
|
|
188
188
|
beforeClose(): void;
|
|
189
189
|
savePopupRef: (ref: HTMLDivElement) => void;
|
|
190
190
|
shouldAutoWidth(): boolean | undefined;
|
|
191
191
|
context: any;
|
|
192
|
-
setState<
|
|
192
|
+
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;
|
|
193
193
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
194
194
|
readonly props: Readonly<import("@alifd/next/types/select").SelectProps> & Readonly<{
|
|
195
|
-
children?:
|
|
195
|
+
children?: import("react").ReactNode;
|
|
196
196
|
}>;
|
|
197
197
|
state: Readonly<import("@alifd/next/types/select/select").SelectState>;
|
|
198
198
|
refs: {
|
|
199
|
-
[key: string]:
|
|
199
|
+
[key: string]: import("react").ReactInstance;
|
|
200
200
|
};
|
|
201
201
|
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/select").SelectProps>, nextState: Readonly<import("@alifd/next/types/select/select").SelectState>, nextContext: any): boolean;
|
|
202
|
-
componentDidCatch?(error: Error, errorInfo:
|
|
202
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
203
203
|
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
204
204
|
componentWillMount?(): void;
|
|
205
205
|
UNSAFE_componentWillMount?(): void;
|
|
@@ -225,27 +225,27 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
225
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
226
|
updateSelectAllYet(value?: unknown): void;
|
|
227
227
|
handleSearchValue(value: string): void;
|
|
228
|
-
handleSearch(value: string, e:
|
|
228
|
+
handleSearch(value: string, e: import("react").ChangeEvent<HTMLInputElement>): void;
|
|
229
229
|
handleSearchClear(triggerType?: string | undefined): void;
|
|
230
|
-
handleSearchKeyDown(e:
|
|
230
|
+
handleSearchKeyDown(e: import("react").KeyboardEvent<HTMLElement>): void;
|
|
231
231
|
chooseMultipleItem(key: string): void;
|
|
232
|
-
chooseHighlightItem(proxy: unknown, e:
|
|
232
|
+
chooseHighlightItem(proxy: unknown, e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
233
233
|
handleTagClose(item: import("@alifd/next/types/select").ObjectItem): boolean;
|
|
234
|
-
handleDeleteTag(e:
|
|
235
|
-
handleSelectAll(e:
|
|
234
|
+
handleDeleteTag(e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
235
|
+
handleSelectAll(e: import("react").UIEvent<HTMLElement, UIEvent>): void;
|
|
236
236
|
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
237
237
|
afterClose(): void;
|
|
238
238
|
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select").ObjectItem[], totalValues: import("@alifd/next/types/select").ObjectItem[]): string;
|
|
239
|
-
renderValues():
|
|
240
|
-
handleWrapClick: (e:
|
|
241
|
-
handleArrowClick: (e:
|
|
242
|
-
handleClear: (e:
|
|
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
243
|
hasClear(): boolean | undefined;
|
|
244
|
-
renderExtraNode():
|
|
245
|
-
renderSelect():
|
|
246
|
-
renderSearchInput(valueNodes:
|
|
247
|
-
renderMenuHeader():
|
|
248
|
-
render():
|
|
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
249
|
dataStore: import("@alifd/next/types/select/data-store").default;
|
|
250
250
|
selectDOM: HTMLElement;
|
|
251
251
|
width: string | number;
|
|
@@ -257,7 +257,7 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
257
257
|
inputRef: import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>;
|
|
258
258
|
valueDataSource: {
|
|
259
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;
|
|
260
|
+
valueDS?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined;
|
|
261
261
|
mapValueDS?: Record<string, import("@alifd/next/types/select").ObjectItem> | undefined;
|
|
262
262
|
};
|
|
263
263
|
componentWillUnmount(): void;
|
|
@@ -271,13 +271,13 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
271
271
|
toggleHighlightItem(dir: number): false | import("@alifd/next/types/select/types").NormalizedObjectItem | undefined;
|
|
272
272
|
scrollMenuIntoView(): void;
|
|
273
273
|
handleSelect(): void;
|
|
274
|
-
handleMouseDown: (e:
|
|
275
|
-
renderMenu():
|
|
276
|
-
renderMenuItem(dataSource: import("@alifd/next/types/select/types").NormalizedObjectItem[]):
|
|
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
277
|
saveSelectRef: (ref: HTMLElement | null) => void;
|
|
278
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
279
|
focusInput(): void;
|
|
280
|
-
focus(start?: number | undefined, end?: number | undefined, preventScroll?: boolean
|
|
280
|
+
focus(start?: number | undefined, end?: number | undefined, preventScroll?: boolean): void;
|
|
281
281
|
beforeOpen(): void;
|
|
282
282
|
beforeClose(): void;
|
|
283
283
|
savePopupRef: (ref: HTMLDivElement) => void;
|
|
@@ -286,14 +286,14 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
286
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
287
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
288
288
|
readonly props: Readonly<import("@alifd/next/types/select").SelectProps> & Readonly<{
|
|
289
|
-
children?:
|
|
289
|
+
children?: import("react").ReactNode;
|
|
290
290
|
}>;
|
|
291
291
|
state: Readonly<import("@alifd/next/types/select/select").SelectState>;
|
|
292
292
|
refs: {
|
|
293
|
-
[key: string]:
|
|
293
|
+
[key: string]: import("react").ReactInstance;
|
|
294
294
|
};
|
|
295
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:
|
|
296
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
297
297
|
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
298
298
|
componentWillMount?(): void;
|
|
299
299
|
UNSAFE_componentWillMount?(): void;
|
|
@@ -319,27 +319,27 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
319
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
320
|
updateSelectAllYet(value?: unknown): void;
|
|
321
321
|
handleSearchValue(value: string): void;
|
|
322
|
-
handleSearch(value: string, e:
|
|
322
|
+
handleSearch(value: string, e: import("react").ChangeEvent<HTMLInputElement>): void;
|
|
323
323
|
handleSearchClear(triggerType?: string | undefined): void;
|
|
324
|
-
handleSearchKeyDown(e:
|
|
324
|
+
handleSearchKeyDown(e: import("react").KeyboardEvent<HTMLElement>): void;
|
|
325
325
|
chooseMultipleItem(key: string): void;
|
|
326
|
-
chooseHighlightItem(proxy: unknown, e:
|
|
326
|
+
chooseHighlightItem(proxy: unknown, e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
327
327
|
handleTagClose(item: import("@alifd/next/types/select").ObjectItem): boolean;
|
|
328
|
-
handleDeleteTag(e:
|
|
329
|
-
handleSelectAll(e:
|
|
328
|
+
handleDeleteTag(e: import("react").UIEvent<HTMLElement, UIEvent>): false | undefined;
|
|
329
|
+
handleSelectAll(e: import("react").UIEvent<HTMLElement, UIEvent>): void;
|
|
330
330
|
handleVisibleChange(visible: boolean, type: import("@alifd/next/types/select").VisibleChangeType): void;
|
|
331
331
|
afterClose(): void;
|
|
332
332
|
maxTagPlaceholder(selectedValues: import("@alifd/next/types/select").ObjectItem[], totalValues: import("@alifd/next/types/select").ObjectItem[]): string;
|
|
333
|
-
renderValues():
|
|
334
|
-
handleWrapClick: (e:
|
|
335
|
-
handleArrowClick: (e:
|
|
336
|
-
handleClear: (e:
|
|
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
337
|
hasClear(): boolean | undefined;
|
|
338
|
-
renderExtraNode():
|
|
339
|
-
renderSelect():
|
|
340
|
-
renderSearchInput(valueNodes:
|
|
341
|
-
renderMenuHeader():
|
|
342
|
-
render():
|
|
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
343
|
dataStore: import("@alifd/next/types/select/data-store").default;
|
|
344
344
|
selectDOM: HTMLElement;
|
|
345
345
|
width: string | number;
|
|
@@ -351,7 +351,7 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
351
351
|
inputRef: import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>;
|
|
352
352
|
valueDataSource: {
|
|
353
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;
|
|
354
|
+
valueDS?: import("@alifd/next/types/select/types").ObjectItem | import("@alifd/next/types/select/types").ObjectItem[] | undefined;
|
|
355
355
|
mapValueDS?: Record<string, import("@alifd/next/types/select").ObjectItem> | undefined;
|
|
356
356
|
};
|
|
357
357
|
componentWillUnmount(): void;
|
|
@@ -365,29 +365,29 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
365
365
|
toggleHighlightItem(dir: number): false | import("@alifd/next/types/select/types").NormalizedObjectItem | undefined;
|
|
366
366
|
scrollMenuIntoView(): void;
|
|
367
367
|
handleSelect(): void;
|
|
368
|
-
handleMouseDown: (e:
|
|
369
|
-
renderMenu():
|
|
370
|
-
renderMenuItem(dataSource: import("@alifd/next/types/select/types").NormalizedObjectItem[]):
|
|
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
371
|
saveSelectRef: (ref: HTMLElement | null) => void;
|
|
372
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
373
|
focusInput(): void;
|
|
374
|
-
focus(start?: number | undefined, end?: number | undefined, preventScroll?: boolean
|
|
374
|
+
focus(start?: number | undefined, end?: number | undefined, preventScroll?: boolean): void;
|
|
375
375
|
beforeOpen(): void;
|
|
376
376
|
beforeClose(): void;
|
|
377
377
|
savePopupRef: (ref: HTMLDivElement) => void;
|
|
378
378
|
shouldAutoWidth(): boolean | undefined;
|
|
379
379
|
context: any;
|
|
380
|
-
setState<
|
|
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
381
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
382
382
|
readonly props: Readonly<import("@alifd/next/types/select").SelectProps> & Readonly<{
|
|
383
|
-
children?:
|
|
383
|
+
children?: import("react").ReactNode;
|
|
384
384
|
}>;
|
|
385
385
|
state: Readonly<import("@alifd/next/types/select/select").SelectState>;
|
|
386
386
|
refs: {
|
|
387
|
-
[key: string]:
|
|
387
|
+
[key: string]: import("react").ReactInstance;
|
|
388
388
|
};
|
|
389
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:
|
|
390
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
391
391
|
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/select").SelectProps>, prevState: Readonly<import("@alifd/next/types/select/select").SelectState>): any;
|
|
392
392
|
componentWillMount?(): void;
|
|
393
393
|
UNSAFE_componentWillMount?(): void;
|
|
@@ -45,7 +45,7 @@ const PersonPicker = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
45
45
|
react_1.default.createElement("span", { className: "label-text" }, selectItem.label));
|
|
46
46
|
};
|
|
47
47
|
const handleUserSearch = (keyword) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
var
|
|
48
|
+
var _a, _b;
|
|
49
49
|
if (readOnly) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
@@ -57,7 +57,7 @@ const PersonPicker = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
57
57
|
const response = yield axios_1.default.get('/_gw/employee360Service/searchEmpInfo.json', {
|
|
58
58
|
params: queryParams,
|
|
59
59
|
});
|
|
60
|
-
const newDataSource = (
|
|
60
|
+
const newDataSource = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.map((item) => {
|
|
61
61
|
return Object.assign(Object.assign({}, item), { label: item.nickName, value: item.workNo });
|
|
62
62
|
});
|
|
63
63
|
setDataSource(newDataSource);
|
package/lib/tag/index.d.ts
CHANGED
|
@@ -13,13 +13,13 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
13
13
|
tagNode: HTMLDivElement | null;
|
|
14
14
|
componentWillUnmount(): void;
|
|
15
15
|
handleClose(from: import("@alifd/next/types/tag").CloseArea): void;
|
|
16
|
-
handleBodyClick(e:
|
|
17
|
-
onKeyDown: (e:
|
|
18
|
-
handleTailClick(e:
|
|
16
|
+
handleBodyClick(e: import("react").MouseEvent<HTMLDivElement, MouseEvent>): void;
|
|
17
|
+
onKeyDown: (e: import("react").KeyboardEvent<HTMLDivElement>) => void;
|
|
18
|
+
handleTailClick(e: import("react").MouseEvent<HTMLSpanElement, MouseEvent>): void;
|
|
19
19
|
handleAnimationInit(node: HTMLElement): void;
|
|
20
20
|
handleAnimationEnd(node: HTMLElement): void;
|
|
21
|
-
renderAnimatedTag(children:
|
|
22
|
-
renderTailNode():
|
|
21
|
+
renderAnimatedTag(children: import("react").ReactNode, animationName: string): import("react").JSX.Element;
|
|
22
|
+
renderTailNode(): import("react").JSX.Element | null;
|
|
23
23
|
isPresetColor(): boolean;
|
|
24
24
|
getTagStyle(): {
|
|
25
25
|
accentColor?: import("csstype").Property.AccentColor | undefined;
|
|
@@ -848,7 +848,7 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
848
848
|
textAnchor?: import("csstype").Property.TextAnchor | undefined;
|
|
849
849
|
vectorEffect?: import("csstype").Property.VectorEffect | undefined;
|
|
850
850
|
};
|
|
851
|
-
render():
|
|
851
|
+
render(): import("react").JSX.Element | null;
|
|
852
852
|
context: any;
|
|
853
853
|
setState<K extends "visible">(state: {
|
|
854
854
|
visible: boolean;
|
|
@@ -863,19 +863,19 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
863
863
|
}, K> | null, callback?: (() => void) | undefined): void;
|
|
864
864
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
865
865
|
readonly props: Readonly<TagProps> & Readonly<{
|
|
866
|
-
children?:
|
|
866
|
+
children?: import("react").ReactNode;
|
|
867
867
|
}>;
|
|
868
868
|
state: Readonly<{
|
|
869
869
|
visible: boolean;
|
|
870
870
|
}>;
|
|
871
871
|
refs: {
|
|
872
|
-
[key: string]:
|
|
872
|
+
[key: string]: import("react").ReactInstance;
|
|
873
873
|
};
|
|
874
874
|
componentDidMount?(): void;
|
|
875
875
|
shouldComponentUpdate?(nextProps: Readonly<TagProps>, nextState: Readonly<{
|
|
876
876
|
visible: boolean;
|
|
877
877
|
}>, nextContext: any): boolean;
|
|
878
|
-
componentDidCatch?(error: Error, errorInfo:
|
|
878
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
879
879
|
getSnapshotBeforeUpdate?(prevProps: Readonly<TagProps>, prevState: Readonly<{
|
|
880
880
|
visible: boolean;
|
|
881
881
|
}>): any;
|
|
@@ -897,13 +897,13 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
897
897
|
tagNode: HTMLDivElement | null;
|
|
898
898
|
componentWillUnmount(): void;
|
|
899
899
|
handleClose(from: import("@alifd/next/types/tag").CloseArea): void;
|
|
900
|
-
handleBodyClick(e:
|
|
901
|
-
onKeyDown: (e:
|
|
902
|
-
handleTailClick(e:
|
|
900
|
+
handleBodyClick(e: import("react").MouseEvent<HTMLDivElement, MouseEvent>): void;
|
|
901
|
+
onKeyDown: (e: import("react").KeyboardEvent<HTMLDivElement>) => void;
|
|
902
|
+
handleTailClick(e: import("react").MouseEvent<HTMLSpanElement, MouseEvent>): void;
|
|
903
903
|
handleAnimationInit(node: HTMLElement): void;
|
|
904
904
|
handleAnimationEnd(node: HTMLElement): void;
|
|
905
|
-
renderAnimatedTag(children:
|
|
906
|
-
renderTailNode():
|
|
905
|
+
renderAnimatedTag(children: import("react").ReactNode, animationName: string): import("react").JSX.Element;
|
|
906
|
+
renderTailNode(): import("react").JSX.Element | null;
|
|
907
907
|
isPresetColor(): boolean;
|
|
908
908
|
getTagStyle(): {
|
|
909
909
|
accentColor?: import("csstype").Property.AccentColor | undefined;
|
|
@@ -1732,7 +1732,7 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
1732
1732
|
textAnchor?: import("csstype").Property.TextAnchor | undefined;
|
|
1733
1733
|
vectorEffect?: import("csstype").Property.VectorEffect | undefined;
|
|
1734
1734
|
};
|
|
1735
|
-
render():
|
|
1735
|
+
render(): import("react").JSX.Element | null;
|
|
1736
1736
|
context: any;
|
|
1737
1737
|
setState<K extends "visible">(state: {
|
|
1738
1738
|
visible: boolean;
|
|
@@ -1747,19 +1747,19 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
|
|
|
1747
1747
|
}, K> | null, callback?: (() => void) | undefined): void;
|
|
1748
1748
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
1749
1749
|
readonly props: Readonly<TagProps> & Readonly<{
|
|
1750
|
-
children?:
|
|
1750
|
+
children?: import("react").ReactNode;
|
|
1751
1751
|
}>;
|
|
1752
1752
|
state: Readonly<{
|
|
1753
1753
|
visible: boolean;
|
|
1754
1754
|
}>;
|
|
1755
1755
|
refs: {
|
|
1756
|
-
[key: string]:
|
|
1756
|
+
[key: string]: import("react").ReactInstance;
|
|
1757
1757
|
};
|
|
1758
1758
|
componentDidMount?(): void;
|
|
1759
1759
|
shouldComponentUpdate?(nextProps: Readonly<TagProps>, nextState: Readonly<{
|
|
1760
1760
|
visible: boolean;
|
|
1761
1761
|
}>, nextContext: any): boolean;
|
|
1762
|
-
componentDidCatch?(error: Error, errorInfo:
|
|
1762
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
1763
1763
|
getSnapshotBeforeUpdate?(prevProps: Readonly<TagProps>, prevState: Readonly<{
|
|
1764
1764
|
visible: boolean;
|
|
1765
1765
|
}>): any;
|
package/lib/utils/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assignSubComponent =
|
|
3
|
+
exports.assignSubComponent = assignSubComponent;
|
|
4
4
|
function assignSubComponent(Component, SubComponents) {
|
|
5
5
|
for (const key in SubComponents) {
|
|
6
6
|
if (Object.prototype.hasOwnProperty.call(SubComponents, key)) {
|
|
@@ -9,4 +9,3 @@ function assignSubComponent(Component, SubComponents) {
|
|
|
9
9
|
}
|
|
10
10
|
return Component;
|
|
11
11
|
}
|
|
12
|
-
exports.assignSubComponent = assignSubComponent;
|
package/lib/utils/dingtalk.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.userPicker = userPicker;
|
|
4
|
+
exports.quitApp = quitApp;
|
|
5
|
+
exports.addZeroInWorkNo = addZeroInWorkNo;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
7
|
require("@ali/dingtalk-jsapi/entry/union");
|
|
6
8
|
const quit_1 = tslib_1.__importDefault(require("@ali/dingtalk-jsapi/api/biz/navigation/quit"));
|
|
@@ -28,7 +30,6 @@ function userPicker({ pickedUsers, onSuccess }) {
|
|
|
28
30
|
onSuccess,
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
|
-
exports.userPicker = userPicker;
|
|
32
33
|
function quitApp() {
|
|
33
34
|
try {
|
|
34
35
|
if (dingtalk_jsapi_1.env.platform === 'pc') {
|
|
@@ -45,7 +46,6 @@ function quitApp() {
|
|
|
45
46
|
console.log('quitApp error:', err);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
exports.quitApp = quitApp;
|
|
49
49
|
function addZeroInWorkNo(workNo) {
|
|
50
50
|
if (!workNo) {
|
|
51
51
|
return '';
|
|
@@ -57,4 +57,3 @@ function addZeroInWorkNo(workNo) {
|
|
|
57
57
|
const str = `0000000${workNo}`;
|
|
58
58
|
return str.slice(str.length - 6, str.length);
|
|
59
59
|
}
|
|
60
|
-
exports.addZeroInWorkNo = addZeroInWorkNo;
|
package/lib/utils/func.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.debounce = debounce;
|
|
4
|
+
exports.throttle = throttle;
|
|
4
5
|
function debounce(callback, delay, leading = false) {
|
|
5
6
|
let timer;
|
|
6
7
|
let isFirstRun = true;
|
|
@@ -20,7 +21,6 @@ function debounce(callback, delay, leading = false) {
|
|
|
20
21
|
};
|
|
21
22
|
return fn;
|
|
22
23
|
}
|
|
23
|
-
exports.debounce = debounce;
|
|
24
24
|
function throttle(callback, delay) {
|
|
25
25
|
let lastTime;
|
|
26
26
|
const fn = (...args) => {
|
|
@@ -32,4 +32,3 @@ function throttle(callback, delay) {
|
|
|
32
32
|
};
|
|
33
33
|
return fn;
|
|
34
34
|
}
|
|
35
|
-
exports.throttle = throttle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useControlable =
|
|
3
|
+
exports.useControlable = useControlable;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
function upperFirst(str) {
|
|
6
6
|
return `${str.slice(0, 1).toUpperCase()}${str.slice(1)}`;
|
|
@@ -29,4 +29,3 @@ function useControlable(props, { valueName = 'value', defaultValueName = getDefa
|
|
|
29
29
|
}, [propValue, isControl]);
|
|
30
30
|
return [value, handleChange];
|
|
31
31
|
}
|
|
32
|
-
exports.useControlable = useControlable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useDebounce =
|
|
3
|
+
exports.useDebounce = useDebounce;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const func_1 = require("../func");
|
|
6
6
|
function useDebounce(callback, delay = 0, leading = false) {
|
|
@@ -10,4 +10,3 @@ function useDebounce(callback, delay = 0, leading = false) {
|
|
|
10
10
|
return (0, func_1.debounce)((...args) => callbackRef.current(...args), delay, leading);
|
|
11
11
|
}, [delay, leading]);
|
|
12
12
|
}
|
|
13
|
-
exports.useDebounce = useDebounce;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useThrottle =
|
|
3
|
+
exports.useThrottle = useThrottle;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const func_1 = require("../func");
|
|
6
6
|
function useThrottle(callback, delay = 0) {
|
|
@@ -10,4 +10,3 @@ function useThrottle(callback, delay = 0) {
|
|
|
10
10
|
return (0, func_1.throttle)((...args) => callbackRef.current(...args), delay);
|
|
11
11
|
}, [delay]);
|
|
12
12
|
}
|
|
13
|
-
exports.useThrottle = useThrottle;
|