@douyinfe/semi-foundation 2.40.0-alpha.0 → 2.40.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/anchor/foundation.ts +0 -2
- package/anchor/linkFoundation.ts +0 -1
- package/autoComplete/foundation.ts +0 -1
- package/autoComplete/optionFoundation.ts +0 -2
- package/avatar/constants.ts +21 -4
- package/avatar/foundation.ts +3 -3
- package/base/foundation.ts +0 -1
- package/breadcrumb/foundation.ts +0 -1
- package/button/button.scss +0 -1
- package/calendar/eventUtil.ts +0 -2
- package/calendar/foundation.ts +0 -1
- package/cascader/foundation.ts +0 -5
- package/checkbox/checkbox.scss +0 -1
- package/checkbox/checkboxFoundation.ts +1 -2
- package/checkbox/checkboxGroupFoundation.ts +0 -1
- package/datePicker/foundation.ts +1 -4
- package/datePicker/inputFoundation.ts +0 -3
- package/datePicker/monthFoundation.ts +0 -1
- package/datePicker/monthsGridFoundation.ts +0 -2
- package/datePicker/yearAndMonthFoundation.ts +0 -2
- package/form/foundation.ts +12 -10
- package/form/interface.ts +4 -5
- package/form/utils.ts +0 -3
- package/image/image.scss +8 -4
- package/image/previewImageFoundation.ts +1 -1
- package/image/previewInnerFoundation.ts +11 -7
- package/image/variables.scss +1 -1
- package/input/foundation.ts +0 -2
- package/input/textareaFoundation.ts +0 -2
- package/inputNumber/foundation.ts +0 -5
- package/lib/cjs/anchor/foundation.js +0 -2
- package/lib/cjs/anchor/linkFoundation.js +0 -1
- package/lib/cjs/autoComplete/foundation.js +0 -2
- package/lib/cjs/autoComplete/optionFoundation.js +0 -2
- package/lib/cjs/avatar/constants.js +0 -1
- package/lib/cjs/avatar/foundation.js +2 -2
- package/lib/cjs/breadcrumb/foundation.js +0 -2
- package/lib/cjs/button/button.css +0 -1
- package/lib/cjs/button/button.scss +0 -1
- package/lib/cjs/calendar/eventUtil.js +0 -2
- package/lib/cjs/calendar/foundation.js +0 -1
- package/lib/cjs/cascader/foundation.js +0 -5
- package/lib/cjs/checkbox/checkbox.css +0 -1
- package/lib/cjs/checkbox/checkbox.scss +0 -1
- package/lib/cjs/checkbox/checkboxFoundation.js +0 -1
- package/lib/cjs/checkbox/checkboxGroupFoundation.js +0 -1
- package/lib/cjs/datePicker/foundation.js +0 -5
- package/lib/cjs/datePicker/inputFoundation.js +0 -4
- package/lib/cjs/datePicker/monthFoundation.js +0 -1
- package/lib/cjs/datePicker/monthsGridFoundation.js +0 -3
- package/lib/cjs/datePicker/yearAndMonthFoundation.js +0 -2
- package/lib/cjs/form/foundation.d.ts +4 -4
- package/lib/cjs/form/foundation.js +9 -8
- package/lib/cjs/form/interface.d.ts +4 -4
- package/lib/cjs/form/utils.js +0 -3
- package/lib/cjs/image/image.css +3 -1
- package/lib/cjs/image/image.scss +8 -4
- package/lib/cjs/image/previewInnerFoundation.d.ts +4 -2
- package/lib/cjs/image/previewInnerFoundation.js +2 -1
- package/lib/cjs/image/variables.scss +1 -1
- package/lib/cjs/input/foundation.js +0 -2
- package/lib/cjs/input/textareaFoundation.js +0 -2
- package/lib/cjs/inputNumber/foundation.js +0 -6
- package/lib/cjs/navigation/NavItem.js +0 -2
- package/lib/cjs/navigation/foundation.js +1 -4
- package/lib/cjs/navigation/itemFoundation.js +0 -1
- package/lib/cjs/navigation/subNavFoundation.js +1 -2
- package/lib/cjs/notification/notificationListFoundation.js +0 -2
- package/lib/cjs/pagination/foundation.d.ts +2 -0
- package/lib/cjs/pagination/foundation.js +16 -4
- package/lib/cjs/popconfirm/popconfirmFoundation.js +0 -2
- package/lib/cjs/radio/radio.css +1 -0
- package/lib/cjs/radio/radio.scss +1 -0
- package/lib/cjs/radio/radioGroupFoundation.js +0 -1
- package/lib/cjs/radio/radioInnerFoundation.js +0 -1
- package/lib/cjs/radio/variables.scss +1 -0
- package/lib/cjs/rating/foundation.js +0 -2
- package/lib/cjs/select/foundation.js +0 -5
- package/lib/cjs/select/optionFoundation.js +0 -2
- package/lib/cjs/select/select.css +0 -35
- package/lib/cjs/select/select.scss +11 -63
- package/lib/cjs/select/variables.scss +0 -10
- package/lib/cjs/skeleton/skeleton.css +2 -2
- package/lib/cjs/skeleton/variables.scss +2 -2
- package/lib/cjs/slider/foundation.js +0 -8
- package/lib/cjs/switch/foundation.js +0 -1
- package/lib/cjs/table/bodyFoundation.js +0 -1
- package/lib/cjs/table/constants.js +0 -2
- package/lib/cjs/table/foundation.js +0 -9
- package/lib/cjs/table/tableRowFoundation.js +0 -1
- package/lib/cjs/table/utils.js +0 -4
- package/lib/cjs/tag/constants.js +0 -2
- package/lib/cjs/tagInput/foundation.js +0 -2
- package/lib/cjs/timePicker/foundation.js +6 -8
- package/lib/cjs/timePicker/inputFoundation.js +0 -2
- package/lib/cjs/timePicker/utils/index.js +2 -2
- package/lib/cjs/tooltip/foundation.js +0 -11
- package/lib/cjs/transfer/foundation.js +0 -1
- package/lib/cjs/tree/foundation.js +0 -1
- package/lib/cjs/tree/treeUtil.js +0 -9
- package/lib/cjs/treeSelect/foundation.js +0 -1
- package/lib/cjs/upload/foundation.js +3 -1
- package/lib/cjs/utils/Event.js +0 -1
- package/lib/cjs/utils/date-fns-extra.js +0 -3
- package/lib/cjs/utils/function.js +0 -1
- package/lib/cjs/utils/object.js +0 -4
- package/lib/es/anchor/foundation.js +0 -2
- package/lib/es/anchor/linkFoundation.js +0 -1
- package/lib/es/autoComplete/foundation.js +0 -1
- package/lib/es/autoComplete/optionFoundation.js +0 -2
- package/lib/es/avatar/constants.js +0 -1
- package/lib/es/avatar/foundation.js +2 -2
- package/lib/es/breadcrumb/foundation.js +0 -1
- package/lib/es/button/button.css +0 -1
- package/lib/es/button/button.scss +0 -1
- package/lib/es/calendar/eventUtil.js +0 -2
- package/lib/es/calendar/foundation.js +0 -1
- package/lib/es/cascader/foundation.js +0 -5
- package/lib/es/checkbox/checkbox.css +0 -1
- package/lib/es/checkbox/checkbox.scss +0 -1
- package/lib/es/checkbox/checkboxFoundation.js +0 -1
- package/lib/es/checkbox/checkboxGroupFoundation.js +0 -1
- package/lib/es/datePicker/foundation.js +0 -4
- package/lib/es/datePicker/inputFoundation.js +0 -3
- package/lib/es/datePicker/monthFoundation.js +0 -1
- package/lib/es/datePicker/monthsGridFoundation.js +0 -2
- package/lib/es/datePicker/yearAndMonthFoundation.js +0 -2
- package/lib/es/form/foundation.d.ts +4 -4
- package/lib/es/form/foundation.js +9 -7
- package/lib/es/form/interface.d.ts +4 -4
- package/lib/es/form/utils.js +0 -3
- package/lib/es/image/image.css +3 -1
- package/lib/es/image/image.scss +8 -4
- package/lib/es/image/previewInnerFoundation.d.ts +4 -2
- package/lib/es/image/previewInnerFoundation.js +2 -1
- package/lib/es/image/variables.scss +1 -1
- package/lib/es/input/foundation.js +0 -2
- package/lib/es/input/textareaFoundation.js +0 -2
- package/lib/es/inputNumber/foundation.js +0 -5
- package/lib/es/navigation/NavItem.js +0 -2
- package/lib/es/navigation/foundation.js +1 -3
- package/lib/es/navigation/itemFoundation.js +0 -1
- package/lib/es/navigation/subNavFoundation.js +1 -2
- package/lib/es/notification/notificationListFoundation.js +0 -1
- package/lib/es/pagination/foundation.d.ts +2 -0
- package/lib/es/pagination/foundation.js +16 -3
- package/lib/es/popconfirm/popconfirmFoundation.js +0 -1
- package/lib/es/radio/radio.css +1 -0
- package/lib/es/radio/radio.scss +1 -0
- package/lib/es/radio/radioGroupFoundation.js +0 -1
- package/lib/es/radio/radioInnerFoundation.js +0 -1
- package/lib/es/radio/variables.scss +1 -0
- package/lib/es/rating/foundation.js +0 -1
- package/lib/es/select/foundation.js +0 -5
- package/lib/es/select/optionFoundation.js +0 -2
- package/lib/es/select/select.css +0 -35
- package/lib/es/select/select.scss +11 -63
- package/lib/es/select/variables.scss +0 -10
- package/lib/es/skeleton/skeleton.css +2 -2
- package/lib/es/skeleton/variables.scss +2 -2
- package/lib/es/slider/foundation.js +0 -7
- package/lib/es/switch/foundation.js +0 -1
- package/lib/es/table/bodyFoundation.js +0 -1
- package/lib/es/table/constants.js +0 -1
- package/lib/es/table/foundation.js +0 -8
- package/lib/es/table/tableRowFoundation.js +0 -1
- package/lib/es/table/utils.js +0 -3
- package/lib/es/tag/constants.js +0 -1
- package/lib/es/tagInput/foundation.js +0 -2
- package/lib/es/timePicker/foundation.js +6 -7
- package/lib/es/timePicker/inputFoundation.js +0 -2
- package/lib/es/timePicker/utils/index.js +2 -1
- package/lib/es/tooltip/foundation.js +0 -10
- package/lib/es/transfer/foundation.js +0 -1
- package/lib/es/tree/foundation.js +0 -1
- package/lib/es/tree/treeUtil.js +0 -9
- package/lib/es/treeSelect/foundation.js +0 -1
- package/lib/es/upload/foundation.js +3 -1
- package/lib/es/utils/Event.js +0 -1
- package/lib/es/utils/date-fns-extra.js +0 -2
- package/lib/es/utils/function.js +0 -1
- package/lib/es/utils/object.js +0 -3
- package/modal/modalFoundation.ts +3 -4
- package/navigation/NavItem.ts +0 -2
- package/navigation/foundation.ts +1 -3
- package/navigation/itemFoundation.ts +0 -1
- package/navigation/subNavFoundation.ts +1 -2
- package/notification/notificationListFoundation.ts +0 -2
- package/package.json +3 -3
- package/pagination/foundation.ts +13 -3
- package/popconfirm/popconfirmFoundation.ts +0 -1
- package/radio/radio.scss +1 -0
- package/radio/radioGroupFoundation.ts +0 -1
- package/radio/radioInnerFoundation.ts +0 -1
- package/radio/variables.scss +1 -0
- package/rating/foundation.ts +0 -1
- package/select/foundation.ts +0 -5
- package/select/optionFoundation.ts +0 -2
- package/select/select.scss +11 -63
- package/select/variables.scss +0 -10
- package/skeleton/variables.scss +2 -2
- package/slider/foundation.ts +0 -7
- package/switch/foundation.ts +0 -1
- package/table/bodyFoundation.ts +0 -1
- package/table/constants.ts +0 -1
- package/table/foundation.ts +0 -8
- package/table/tableRowFoundation.ts +0 -1
- package/table/utils.ts +0 -3
- package/tag/constants.ts +19 -2
- package/tagInput/foundation.ts +0 -2
- package/timePicker/foundation.ts +7 -8
- package/timePicker/inputFoundation.ts +0 -2
- package/timePicker/utils/index.ts +2 -1
- package/toast/toastFoundation.ts +1 -4
- package/toast/toastListFoundation.ts +0 -1
- package/tooltip/foundation.ts +0 -10
- package/transfer/foundation.ts +0 -1
- package/tree/foundation.ts +0 -1
- package/tree/treeUtil.ts +1 -10
- package/treeSelect/foundation.ts +0 -1
- package/upload/foundation.ts +3 -1
- package/utils/Event.ts +0 -1
- package/utils/date-fns-extra.ts +0 -2
- package/utils/function.ts +0 -1
- package/utils/object.ts +0 -3
package/tag/constants.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
1
|
import { BASE_CLASS_PREFIX } from '../base/constants';
|
|
3
2
|
|
|
4
3
|
const cssClasses = {
|
|
@@ -7,7 +6,25 @@ const cssClasses = {
|
|
|
7
6
|
|
|
8
7
|
const strings = {
|
|
9
8
|
TAG_SIZE: ['default', 'small', 'large'],
|
|
10
|
-
TAG_COLOR: [
|
|
9
|
+
TAG_COLOR: [
|
|
10
|
+
'grey',
|
|
11
|
+
'red',
|
|
12
|
+
'pink',
|
|
13
|
+
'purple',
|
|
14
|
+
'violet',
|
|
15
|
+
'indigo',
|
|
16
|
+
'blue',
|
|
17
|
+
'light-blue',
|
|
18
|
+
'cyan',
|
|
19
|
+
'teal',
|
|
20
|
+
'green',
|
|
21
|
+
'light-green',
|
|
22
|
+
'lime',
|
|
23
|
+
'yellow',
|
|
24
|
+
'amber',
|
|
25
|
+
'orange',
|
|
26
|
+
'white',
|
|
27
|
+
],
|
|
11
28
|
TAG_TYPE: ['light', 'solid', 'ghost'],
|
|
12
29
|
AVATAR_SHAPE: ['square', 'circle'],
|
|
13
30
|
};
|
package/tagInput/foundation.ts
CHANGED
|
@@ -117,10 +117,8 @@ class TagInputFoundation extends BaseFoundation<TagInputAdapter> {
|
|
|
117
117
|
const maxLen = Math.max(valueArr.length, inputArr.length);
|
|
118
118
|
for (let i = 0; i < maxLen; i++) {
|
|
119
119
|
// When the input length is increasing
|
|
120
|
-
// eslint-disable-next-line max-len
|
|
121
120
|
if (!isUndefined(valueArr[i]) && (isUndefined(inputArr[i]) || valueArr[i].length > inputArr[i].length)) {
|
|
122
121
|
// When the input length exceeds maxLength
|
|
123
|
-
// eslint-disable-next-line max-depth
|
|
124
122
|
if (valueArr[i].length > maxLength) {
|
|
125
123
|
allowChange = false;
|
|
126
124
|
isFunction(onInputExceed) && onInputExceed(value);
|
package/timePicker/foundation.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
1
|
import { strings } from './constants';
|
|
3
2
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
4
3
|
import {
|
|
@@ -214,14 +213,14 @@ class TimePickerFoundation<P = Record<string, any>, S = Record<string, any>> ext
|
|
|
214
213
|
)
|
|
215
214
|
);
|
|
216
215
|
}
|
|
217
|
-
const inputValue = this.formatValue(dates);
|
|
218
|
-
|
|
219
|
-
this.setState({
|
|
220
|
-
value: dates,
|
|
221
|
-
invalid,
|
|
222
|
-
inputValue,
|
|
223
|
-
} as any);
|
|
224
216
|
}
|
|
217
|
+
const inputValue = this.formatValue(dates);
|
|
218
|
+
|
|
219
|
+
this.setState({
|
|
220
|
+
value: dates,
|
|
221
|
+
invalid,
|
|
222
|
+
inputValue,
|
|
223
|
+
} as any);
|
|
225
224
|
}
|
|
226
225
|
|
|
227
226
|
handleFocus(e: any) {
|
|
@@ -13,10 +13,8 @@ class TimePickerFoundation extends BaseFoundation<TimeInputAdapter> {
|
|
|
13
13
|
super({ ...adapter });
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
17
16
|
init() {}
|
|
18
17
|
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
20
18
|
destroy() {}
|
|
21
19
|
|
|
22
20
|
handleFocus(e: any) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
1
|
import { format, parse } from 'date-fns';
|
|
3
2
|
import { toNumber } from 'lodash';
|
|
4
3
|
import { strings } from '../constants';
|
|
@@ -26,6 +25,8 @@ export const parseToDate = (input: string | Date | number, formatToken = strings
|
|
|
26
25
|
// console.log(curDate, formatToken);
|
|
27
26
|
|
|
28
27
|
return curDate;
|
|
28
|
+
} else if (typeof input === 'undefined') {
|
|
29
|
+
return undefined;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
return new Date();
|
package/toast/toastFoundation.ts
CHANGED
|
@@ -35,10 +35,7 @@ export interface ToastInstance extends ToastProps{
|
|
|
35
35
|
motion?: boolean
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
export interface ToastState{
|
|
40
|
-
|
|
41
|
-
}
|
|
38
|
+
export interface ToastState{}
|
|
42
39
|
|
|
43
40
|
|
|
44
41
|
export interface ToastAdapter extends DefaultAdapter<ToastProps, ToastState>{
|
package/tooltip/foundation.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-param-reassign */
|
|
2
|
-
/* eslint-disable prefer-destructuring, max-lines-per-function, one-var, max-len, @typescript-eslint/restrict-plus-operands */
|
|
3
|
-
/* argus-disable unPkgSensitiveInfo */
|
|
4
1
|
import { get, isEmpty } from 'lodash';
|
|
5
2
|
import { DOMRectLikeType } from '../utils/dom';
|
|
6
3
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
@@ -325,7 +322,6 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
325
322
|
this._adapter.insertPortal(content, { left: -9999, top: -9999 }); // offscreen rendering
|
|
326
323
|
|
|
327
324
|
if (trigger === 'custom') {
|
|
328
|
-
// eslint-disable-next-line
|
|
329
325
|
this._adapter.registerClickOutsideHandler(() => {});
|
|
330
326
|
}
|
|
331
327
|
|
|
@@ -367,7 +363,6 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
367
363
|
}
|
|
368
364
|
|
|
369
365
|
calcTransformOrigin(position: Position, triggerRect: DOMRect, translateX: number, translateY: number) {
|
|
370
|
-
// eslint-disable-next-line
|
|
371
366
|
if (position && triggerRect && translateX != null && translateY != null) {
|
|
372
367
|
if (this.getProp('transformFromCenter')) {
|
|
373
368
|
if (['topLeft', 'bottomLeft'].includes(position)) {
|
|
@@ -402,9 +397,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
402
397
|
...defaultRect,
|
|
403
398
|
};
|
|
404
399
|
const wrapperRect = (isEmpty(props.wrapperRect) ? props.wrapperRect : this._adapter.getWrapperBounding()) || { ...defaultRect as any };
|
|
405
|
-
// eslint-disable-next-line
|
|
406
400
|
const position = props.position != null ? props.position : this.getProp('position');
|
|
407
|
-
// eslint-disable-next-line
|
|
408
401
|
const SPACING = spacing != null ? spacing : this.getProp('spacing');
|
|
409
402
|
const { arrowPointAtCenter, showArrow, arrowBounding } = this.getProps();
|
|
410
403
|
const pointAtCenter = showArrow && arrowPointAtCenter;
|
|
@@ -600,7 +593,6 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
600
593
|
|
|
601
594
|
let transform = '';
|
|
602
595
|
|
|
603
|
-
// eslint-disable-next-line
|
|
604
596
|
if (translateX != null) {
|
|
605
597
|
transform += `translateX(${translateX * 100}%) `;
|
|
606
598
|
Object.defineProperty(style, 'translateX', {
|
|
@@ -608,7 +600,6 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
608
600
|
value: translateX,
|
|
609
601
|
});
|
|
610
602
|
}
|
|
611
|
-
// eslint-disable-next-line
|
|
612
603
|
if (translateY != null) {
|
|
613
604
|
transform += `translateY(${translateY * 100}%) `;
|
|
614
605
|
Object.defineProperty(style, 'translateY', {
|
|
@@ -616,7 +607,6 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
616
607
|
value: translateY,
|
|
617
608
|
});
|
|
618
609
|
}
|
|
619
|
-
// eslint-disable-next-line
|
|
620
610
|
if (transformOrigin != null) {
|
|
621
611
|
style.transformOrigin = transformOrigin;
|
|
622
612
|
}
|
package/transfer/foundation.ts
CHANGED
|
@@ -42,7 +42,6 @@ export interface TransferAdapter<P = Record<string, any>, S = Record<string, any
|
|
|
42
42
|
searchTree: (keyword: string) => void
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
// eslint-disable-next-line max-len
|
|
46
45
|
export default class TransferFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<TransferAdapter<P, S>> {
|
|
47
46
|
constructor(adapter: TransferAdapter<P, S>) {
|
|
48
47
|
super({ ...adapter });
|
package/tree/foundation.ts
CHANGED
|
@@ -674,7 +674,6 @@ export default class TreeFoundation extends BaseFoundation<TreeAdapter, BasicTre
|
|
|
674
674
|
});
|
|
675
675
|
}
|
|
676
676
|
|
|
677
|
-
// eslint-disable-next-line max-len
|
|
678
677
|
handleNodeLoad(loadedKeys: Set<string>, loadingKeys: Set<string>, data: BasicTreeNodeData, resolve: (value?: any) => void) {
|
|
679
678
|
const { loadData, onLoad } = this.getProps();
|
|
680
679
|
const { key } = data;
|
package/tree/treeUtil.ts
CHANGED
|
@@ -37,7 +37,6 @@ function isValid(val: any) {
|
|
|
37
37
|
* @param filteredShownKeys
|
|
38
38
|
* need expanded keys, provides `true` means all expanded
|
|
39
39
|
*/
|
|
40
|
-
// eslint-disable-next-line max-len
|
|
41
40
|
export function flattenTreeData(treeNodeList: any[], expandedKeys: Set<string>, filteredShownKeys: boolean | Set<any> = false) {
|
|
42
41
|
const flattenList: any[] = [];
|
|
43
42
|
const filterSearch = Boolean(filteredShownKeys);
|
|
@@ -61,7 +60,6 @@ export function flattenTreeData(treeNodeList: any[], expandedKeys: Set<string>,
|
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
// Loop treeNode children
|
|
64
|
-
// eslint-disable-next-line max-len
|
|
65
63
|
if (expandedKeys.has(mergedKey) && (!filterSearch || (!isBooleanFilteredShownKeys && filteredShownKeys.has(mergedKey)))) {
|
|
66
64
|
flattenNode.children = flatten(treeNode.children || [], flattenNode);
|
|
67
65
|
} else {
|
|
@@ -317,7 +315,7 @@ export function calcCheckedKeys(values: any, keyEntities: KeyEntities) {
|
|
|
317
315
|
let halfCheckedKeys = new Set([]);
|
|
318
316
|
let visited: any[] = [];
|
|
319
317
|
|
|
320
|
-
const levelMap:{[key: number]: string[]} = getSortedKeyList(keyList, keyEntities);
|
|
318
|
+
const levelMap: {[key: number]: string[]} = getSortedKeyList(keyList, keyEntities);
|
|
321
319
|
|
|
322
320
|
const calcCurrLevel = (node: any) => {
|
|
323
321
|
const { key, parent, level } = node;
|
|
@@ -369,7 +367,6 @@ export function calcExpandedKeys(keyList: any[] = [], keyEntities: KeyEntities,
|
|
|
369
367
|
}
|
|
370
368
|
|
|
371
369
|
/* Calculate the expanded node by value */
|
|
372
|
-
// eslint-disable-next-line max-len
|
|
373
370
|
export function calcExpandedKeysForValues(value: any, keyEntities: KeyEntities, isMultiple: boolean, valueEntities: any) {
|
|
374
371
|
const keys = findKeysForValues(value, valueEntities, isMultiple);
|
|
375
372
|
return new Set(findAncestorKeys(keys, keyEntities, false));
|
|
@@ -481,7 +478,6 @@ export function getMotionKeys(eventKey: string, expandedKeys: Set<string>, keyEn
|
|
|
481
478
|
return res;
|
|
482
479
|
}
|
|
483
480
|
|
|
484
|
-
// eslint-disable-next-line max-len
|
|
485
481
|
export function calcCheckedKeysForChecked(key: string, keyEntities: KeyEntities, checkedKeys: Set<string>, halfCheckedKeys: Set<string>) {
|
|
486
482
|
const descendantKeys = findDescendantKeys([key], keyEntities, true);
|
|
487
483
|
const nodeItem = keyEntities[key];
|
|
@@ -490,10 +486,8 @@ export function calcCheckedKeysForChecked(key: string, keyEntities: KeyEntities,
|
|
|
490
486
|
if (!node.parent) {
|
|
491
487
|
return;
|
|
492
488
|
}
|
|
493
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
494
489
|
const { key } = node;
|
|
495
490
|
const siblingKeys = findSiblingKeys([key], keyEntities);
|
|
496
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
497
491
|
const allChecked = siblingKeys.every(key => checkedKeys.has(key));
|
|
498
492
|
if (!allChecked) {
|
|
499
493
|
const ancestorKeys = findAncestorKeys([key], keyEntities, false);
|
|
@@ -511,7 +505,6 @@ export function calcCheckedKeysForChecked(key: string, keyEntities: KeyEntities,
|
|
|
511
505
|
};
|
|
512
506
|
}
|
|
513
507
|
|
|
514
|
-
// eslint-disable-next-line max-len
|
|
515
508
|
export function calcCheckedKeysForUnchecked(key: string, keyEntities: KeyEntities, checkedKeys: Set<string>, halfCheckedKeys: Set<string>) {
|
|
516
509
|
const descendantKeys = findDescendantKeys([key], keyEntities, true);
|
|
517
510
|
const nodeItem = keyEntities[key];
|
|
@@ -534,10 +527,8 @@ export function calcCheckedKeysForUnchecked(key: string, keyEntities: KeyEntitie
|
|
|
534
527
|
return;
|
|
535
528
|
}
|
|
536
529
|
// Has a parent node, and the parent node is checked or halfChecked
|
|
537
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
538
530
|
const { key } = node;
|
|
539
531
|
const siblingKeys = findSiblingKeys([key], keyEntities);
|
|
540
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
541
532
|
const anyChecked = siblingKeys.some(key => checkedKeys.has(key) || halfCheckedKeys.has(key));
|
|
542
533
|
const ancestorKeys = findAncestorKeys([key], keyEntities, false);
|
|
543
534
|
// If there is checked or halfChecked in the sibling node, you need to change the parent node to halfChecked
|
package/treeSelect/foundation.ts
CHANGED
|
@@ -200,7 +200,6 @@ export interface TreeSelectAdapter<P = Record<string, any>, S = Record<string, a
|
|
|
200
200
|
updateIsFocus: (bool: boolean) => void
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
// eslint-disable-next-line max-len
|
|
204
203
|
export default class TreeSelectFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<TreeSelectAdapter<P, S>, P, S> {
|
|
205
204
|
|
|
206
205
|
constructor(adapter: TreeSelectAdapter<P, S>) {
|
package/upload/foundation.ts
CHANGED
|
@@ -255,7 +255,9 @@ class UploadFoundation<P = Record<string, any>, S = Record<string, any>> extends
|
|
|
255
255
|
this._adapter.notifyChange({ currentFile: newFileItem, fileList: newFileList });
|
|
256
256
|
this._adapter.updateFileList(newFileList, () => {
|
|
257
257
|
this._adapter.resetReplaceInput();
|
|
258
|
-
|
|
258
|
+
if (!newFileItem._sizeInvalid) {
|
|
259
|
+
this.upload(newFileItem);
|
|
260
|
+
}
|
|
259
261
|
});
|
|
260
262
|
}
|
|
261
263
|
|
package/utils/Event.ts
CHANGED
|
@@ -29,7 +29,6 @@ export default class Event {
|
|
|
29
29
|
const callbacks = this._eventMap.get(event);
|
|
30
30
|
if (Array.isArray(callbacks) && callbacks.length) {
|
|
31
31
|
let index = -1;
|
|
32
|
-
// eslint-disable-next-line max-depth
|
|
33
32
|
while ((index = callbacks.findIndex(cb => cb === callback)) > -1) {
|
|
34
33
|
callbacks.splice(index, 1);
|
|
35
34
|
}
|
package/utils/date-fns-extra.ts
CHANGED
package/utils/function.ts
CHANGED
package/utils/object.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
/* argus-disable unPkgSensitiveInfo */
|
|
3
1
|
import {
|
|
4
2
|
get as lodashGet,
|
|
5
3
|
set as lodashSet,
|
|
@@ -68,7 +66,6 @@ function cleanup(obj: ObjectType, path: string[], pull = true) {
|
|
|
68
66
|
// }
|
|
69
67
|
|
|
70
68
|
// Delete object if its empty
|
|
71
|
-
// eslint-disable-next-line
|
|
72
69
|
if (Array.isArray(target) && target.every(e => e == null)) {
|
|
73
70
|
lodashUnset(obj, path);
|
|
74
71
|
} else if (isEmptyObject(target)) {
|