@douyinfe/semi-foundation 2.47.0 → 2.48.0-alpha.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/input/input.scss +0 -1
- package/lib/cjs/input/input.css +0 -1
- package/lib/cjs/input/input.scss +0 -1
- package/lib/cjs/table/table.css +3 -0
- package/lib/cjs/table/table.scss +4 -0
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- package/lib/cjs/treeSelect/foundation.d.ts +2 -1
- package/lib/cjs/treeSelect/foundation.js +12 -6
- package/lib/cjs/upload/constants.d.ts +1 -1
- package/lib/es/input/input.css +0 -1
- package/lib/es/input/input.scss +0 -1
- package/lib/es/table/table.css +3 -0
- package/lib/es/table/table.scss +4 -0
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/treeSelect/foundation.d.ts +2 -1
- package/lib/es/treeSelect/foundation.js +12 -6
- package/lib/es/upload/constants.d.ts +1 -1
- package/package.json +3 -3
- package/table/table.scss +4 -0
- package/treeSelect/foundation.ts +12 -8
package/input/input.scss
CHANGED
package/lib/cjs/input/input.css
CHANGED
|
@@ -179,7 +179,6 @@
|
|
|
179
179
|
}
|
|
180
180
|
.semi-input-wrapper.semi-input-wrapper__with-prepend-only .semi-input:not(:last-child) {
|
|
181
181
|
border-right-style: none;
|
|
182
|
-
border-radius: 0;
|
|
183
182
|
}
|
|
184
183
|
.semi-input-wrapper.semi-input-wrapper__with-prepend, .semi-input-wrapper.semi-input-wrapper__with-append {
|
|
185
184
|
display: inline-flex;
|
package/lib/cjs/input/input.scss
CHANGED
package/lib/cjs/table/table.css
CHANGED
|
@@ -94,6 +94,9 @@
|
|
|
94
94
|
.semi-table-header-sticky .semi-table-thead > .semi-table-row > .semi-table-row-head {
|
|
95
95
|
background-color: var(--semi-color-bg-1);
|
|
96
96
|
}
|
|
97
|
+
.semi-table-header-hidden {
|
|
98
|
+
height: 0;
|
|
99
|
+
}
|
|
97
100
|
.semi-table-align-center .semi-table-operate-wrapper {
|
|
98
101
|
justify-content: center;
|
|
99
102
|
}
|
package/lib/cjs/table/table.scss
CHANGED
|
@@ -84,6 +84,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
|
|
|
84
84
|
export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
|
|
85
85
|
export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
|
|
86
86
|
export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
|
|
87
|
-
export declare function calcDropRelativePosition(event: any, treeNode: any):
|
|
87
|
+
export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
|
|
88
88
|
export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
|
|
89
89
|
export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
|
|
@@ -75,7 +75,7 @@ export interface BasicTreeSelectProps extends Pick<BasicTreeProps, 'virtualize'
|
|
|
75
75
|
onVisibleChange?: (isVisible: boolean) => void;
|
|
76
76
|
onLoad?: (keys: Set<string>, data: BasicTreeNodeData) => void;
|
|
77
77
|
}
|
|
78
|
-
export interface BasicTreeSelectInnerData extends Pick<BasicTreeInnerData, 'keyEntities' | 'treeData' | 'flattenNodes' | 'selectedKeys' | 'checkedKeys' | 'halfCheckedKeys' | 'motionKeys' | 'motionType' | 'expandedKeys' | 'filteredKeys' | 'filteredExpandedKeys' | 'filteredShownKeys' | 'cachedKeyValuePairs' | 'inputValue' | 'disabledKeys' | 'loadedKeys' | 'loadingKeys' | 'realCheckedKeys'> {
|
|
78
|
+
export interface BasicTreeSelectInnerData extends Pick<BasicTreeInnerData, 'keyEntities' | 'treeData' | 'flattenNodes' | 'cachedFlattenNodes' | 'selectedKeys' | 'checkedKeys' | 'halfCheckedKeys' | 'motionKeys' | 'motionType' | 'expandedKeys' | 'filteredKeys' | 'filteredExpandedKeys' | 'filteredShownKeys' | 'cachedKeyValuePairs' | 'inputValue' | 'disabledKeys' | 'loadedKeys' | 'loadingKeys' | 'realCheckedKeys'> {
|
|
79
79
|
inputTriggerFocus: boolean;
|
|
80
80
|
isOpen: boolean;
|
|
81
81
|
rePosKey: number;
|
|
@@ -135,6 +135,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
|
|
|
135
135
|
_notifyMultipleChange(key: string[], e: any): void;
|
|
136
136
|
_notifyChange(key: any, e: any): void;
|
|
137
137
|
_registerClickOutsideHandler: (e: any) => void;
|
|
138
|
+
clearInputValue: () => void;
|
|
138
139
|
_notifyFocus(e: any): void;
|
|
139
140
|
handleTriggerFocus(e: any): void;
|
|
140
141
|
_notifyBlur(e: any): void;
|
|
@@ -26,6 +26,12 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
26
26
|
this.close(e);
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
+
this.clearInputValue = () => {
|
|
30
|
+
const {
|
|
31
|
+
inputValue
|
|
32
|
+
} = this.getStates();
|
|
33
|
+
inputValue && this._adapter.updateInputValue('');
|
|
34
|
+
};
|
|
29
35
|
}
|
|
30
36
|
init() {
|
|
31
37
|
const {
|
|
@@ -177,7 +183,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
177
183
|
const isSearching = Boolean(inputValue);
|
|
178
184
|
const treeNodeProps = {
|
|
179
185
|
eventKey: key,
|
|
180
|
-
expanded: isSearching
|
|
186
|
+
expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
181
187
|
selected: selectedKeys.includes(key),
|
|
182
188
|
checked: realChecked,
|
|
183
189
|
halfChecked: realHalfChecked,
|
|
@@ -450,8 +456,8 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
450
456
|
expandedOptsKeys.forEach(item => newExpandedKeys.add(item));
|
|
451
457
|
const newFlattenNodes = (0, _treeUtil.flattenTreeData)(treeData, newExpandedKeys, keyMaps);
|
|
452
458
|
this._adapter.updateState({
|
|
453
|
-
expandedKeys:
|
|
454
|
-
flattenNodes:
|
|
459
|
+
expandedKeys: newExpandedKeys,
|
|
460
|
+
flattenNodes: newFlattenNodes,
|
|
455
461
|
inputValue: '',
|
|
456
462
|
motionKeys: new Set([]),
|
|
457
463
|
filteredKeys: new Set([]),
|
|
@@ -500,8 +506,8 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
500
506
|
const newFilteredExpandedKeys = new Set(expandedOptsKeys);
|
|
501
507
|
this._adapter.notifySearch(sugInput, Array.from(newFilteredExpandedKeys));
|
|
502
508
|
this._adapter.updateState({
|
|
503
|
-
expandedKeys:
|
|
504
|
-
flattenNodes:
|
|
509
|
+
expandedKeys: newExpandedKeys,
|
|
510
|
+
flattenNodes: newFlattenNodes,
|
|
505
511
|
motionKeys: new Set([]),
|
|
506
512
|
filteredKeys: new Set(filteredOptsKeys),
|
|
507
513
|
filteredExpandedKeys: newFilteredExpandedKeys,
|
|
@@ -709,7 +715,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
709
715
|
return;
|
|
710
716
|
}
|
|
711
717
|
const isExpandControlled = this._isExpandControlled();
|
|
712
|
-
if (isSearching
|
|
718
|
+
if (isSearching) {
|
|
713
719
|
this.handleNodeExpandInSearch(e, treeNode);
|
|
714
720
|
return;
|
|
715
721
|
}
|
|
@@ -18,7 +18,7 @@ declare const strings: {
|
|
|
18
18
|
DRAG_AREA_ILLEGAL: string;
|
|
19
19
|
TRIGGER_AUTO: "auto";
|
|
20
20
|
TRIGGER_CUSTOM: "custom";
|
|
21
|
-
UPLOAD_TRIGGER: ("
|
|
21
|
+
UPLOAD_TRIGGER: ("custom" | "auto")[];
|
|
22
22
|
VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
|
|
23
23
|
PROMPT_POSITION: readonly ["left", "right", "bottom"];
|
|
24
24
|
};
|
package/lib/es/input/input.css
CHANGED
|
@@ -179,7 +179,6 @@
|
|
|
179
179
|
}
|
|
180
180
|
.semi-input-wrapper.semi-input-wrapper__with-prepend-only .semi-input:not(:last-child) {
|
|
181
181
|
border-right-style: none;
|
|
182
|
-
border-radius: 0;
|
|
183
182
|
}
|
|
184
183
|
.semi-input-wrapper.semi-input-wrapper__with-prepend, .semi-input-wrapper.semi-input-wrapper__with-append {
|
|
185
184
|
display: inline-flex;
|
package/lib/es/input/input.scss
CHANGED
package/lib/es/table/table.css
CHANGED
|
@@ -94,6 +94,9 @@
|
|
|
94
94
|
.semi-table-header-sticky .semi-table-thead > .semi-table-row > .semi-table-row-head {
|
|
95
95
|
background-color: var(--semi-color-bg-1);
|
|
96
96
|
}
|
|
97
|
+
.semi-table-header-hidden {
|
|
98
|
+
height: 0;
|
|
99
|
+
}
|
|
97
100
|
.semi-table-align-center .semi-table-operate-wrapper {
|
|
98
101
|
justify-content: center;
|
|
99
102
|
}
|
package/lib/es/table/table.scss
CHANGED
|
@@ -84,6 +84,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
|
|
|
84
84
|
export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
|
|
85
85
|
export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
|
|
86
86
|
export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
|
|
87
|
-
export declare function calcDropRelativePosition(event: any, treeNode: any):
|
|
87
|
+
export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
|
|
88
88
|
export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
|
|
89
89
|
export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
|
|
@@ -75,7 +75,7 @@ export interface BasicTreeSelectProps extends Pick<BasicTreeProps, 'virtualize'
|
|
|
75
75
|
onVisibleChange?: (isVisible: boolean) => void;
|
|
76
76
|
onLoad?: (keys: Set<string>, data: BasicTreeNodeData) => void;
|
|
77
77
|
}
|
|
78
|
-
export interface BasicTreeSelectInnerData extends Pick<BasicTreeInnerData, 'keyEntities' | 'treeData' | 'flattenNodes' | 'selectedKeys' | 'checkedKeys' | 'halfCheckedKeys' | 'motionKeys' | 'motionType' | 'expandedKeys' | 'filteredKeys' | 'filteredExpandedKeys' | 'filteredShownKeys' | 'cachedKeyValuePairs' | 'inputValue' | 'disabledKeys' | 'loadedKeys' | 'loadingKeys' | 'realCheckedKeys'> {
|
|
78
|
+
export interface BasicTreeSelectInnerData extends Pick<BasicTreeInnerData, 'keyEntities' | 'treeData' | 'flattenNodes' | 'cachedFlattenNodes' | 'selectedKeys' | 'checkedKeys' | 'halfCheckedKeys' | 'motionKeys' | 'motionType' | 'expandedKeys' | 'filteredKeys' | 'filteredExpandedKeys' | 'filteredShownKeys' | 'cachedKeyValuePairs' | 'inputValue' | 'disabledKeys' | 'loadedKeys' | 'loadingKeys' | 'realCheckedKeys'> {
|
|
79
79
|
inputTriggerFocus: boolean;
|
|
80
80
|
isOpen: boolean;
|
|
81
81
|
rePosKey: number;
|
|
@@ -135,6 +135,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
|
|
|
135
135
|
_notifyMultipleChange(key: string[], e: any): void;
|
|
136
136
|
_notifyChange(key: any, e: any): void;
|
|
137
137
|
_registerClickOutsideHandler: (e: any) => void;
|
|
138
|
+
clearInputValue: () => void;
|
|
138
139
|
_notifyFocus(e: any): void;
|
|
139
140
|
handleTriggerFocus(e: any): void;
|
|
140
141
|
_notifyBlur(e: any): void;
|
|
@@ -19,6 +19,12 @@ export default class TreeSelectFoundation extends BaseFoundation {
|
|
|
19
19
|
this.close(e);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
+
this.clearInputValue = () => {
|
|
23
|
+
const {
|
|
24
|
+
inputValue
|
|
25
|
+
} = this.getStates();
|
|
26
|
+
inputValue && this._adapter.updateInputValue('');
|
|
27
|
+
};
|
|
22
28
|
}
|
|
23
29
|
init() {
|
|
24
30
|
const {
|
|
@@ -170,7 +176,7 @@ export default class TreeSelectFoundation extends BaseFoundation {
|
|
|
170
176
|
const isSearching = Boolean(inputValue);
|
|
171
177
|
const treeNodeProps = {
|
|
172
178
|
eventKey: key,
|
|
173
|
-
expanded: isSearching
|
|
179
|
+
expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
174
180
|
selected: selectedKeys.includes(key),
|
|
175
181
|
checked: realChecked,
|
|
176
182
|
halfChecked: realHalfChecked,
|
|
@@ -443,8 +449,8 @@ export default class TreeSelectFoundation extends BaseFoundation {
|
|
|
443
449
|
expandedOptsKeys.forEach(item => newExpandedKeys.add(item));
|
|
444
450
|
const newFlattenNodes = flattenTreeData(treeData, newExpandedKeys, keyMaps);
|
|
445
451
|
this._adapter.updateState({
|
|
446
|
-
expandedKeys:
|
|
447
|
-
flattenNodes:
|
|
452
|
+
expandedKeys: newExpandedKeys,
|
|
453
|
+
flattenNodes: newFlattenNodes,
|
|
448
454
|
inputValue: '',
|
|
449
455
|
motionKeys: new Set([]),
|
|
450
456
|
filteredKeys: new Set([]),
|
|
@@ -493,8 +499,8 @@ export default class TreeSelectFoundation extends BaseFoundation {
|
|
|
493
499
|
const newFilteredExpandedKeys = new Set(expandedOptsKeys);
|
|
494
500
|
this._adapter.notifySearch(sugInput, Array.from(newFilteredExpandedKeys));
|
|
495
501
|
this._adapter.updateState({
|
|
496
|
-
expandedKeys:
|
|
497
|
-
flattenNodes:
|
|
502
|
+
expandedKeys: newExpandedKeys,
|
|
503
|
+
flattenNodes: newFlattenNodes,
|
|
498
504
|
motionKeys: new Set([]),
|
|
499
505
|
filteredKeys: new Set(filteredOptsKeys),
|
|
500
506
|
filteredExpandedKeys: newFilteredExpandedKeys,
|
|
@@ -702,7 +708,7 @@ export default class TreeSelectFoundation extends BaseFoundation {
|
|
|
702
708
|
return;
|
|
703
709
|
}
|
|
704
710
|
const isExpandControlled = this._isExpandControlled();
|
|
705
|
-
if (isSearching
|
|
711
|
+
if (isSearching) {
|
|
706
712
|
this.handleNodeExpandInSearch(e, treeNode);
|
|
707
713
|
return;
|
|
708
714
|
}
|
|
@@ -18,7 +18,7 @@ declare const strings: {
|
|
|
18
18
|
DRAG_AREA_ILLEGAL: string;
|
|
19
19
|
TRIGGER_AUTO: "auto";
|
|
20
20
|
TRIGGER_CUSTOM: "custom";
|
|
21
|
-
UPLOAD_TRIGGER: ("
|
|
21
|
+
UPLOAD_TRIGGER: ("custom" | "auto")[];
|
|
22
22
|
VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
|
|
23
23
|
PROMPT_POSITION: readonly ["left", "right", "bottom"];
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.48.0-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
7
7
|
"prepublishOnly": "npm run build:lib"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@douyinfe/semi-animation": "2.
|
|
10
|
+
"@douyinfe/semi-animation": "2.48.0-alpha.0",
|
|
11
11
|
"async-validator": "^3.5.0",
|
|
12
12
|
"classnames": "^2.2.6",
|
|
13
13
|
"date-fns": "^2.29.3",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"*.scss",
|
|
24
24
|
"*.css"
|
|
25
25
|
],
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "930287380571d83f7a34d99fb13d80b4474adff8",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
29
29
|
"@babel/preset-env": "^7.15.8",
|
package/table/table.scss
CHANGED
package/treeSelect/foundation.ts
CHANGED
|
@@ -150,6 +150,7 @@ export interface BasicTreeSelectInnerData extends Pick<BasicTreeInnerData,
|
|
|
150
150
|
'keyEntities'
|
|
151
151
|
| 'treeData'
|
|
152
152
|
| 'flattenNodes'
|
|
153
|
+
| 'cachedFlattenNodes'
|
|
153
154
|
| 'selectedKeys'
|
|
154
155
|
| 'checkedKeys'
|
|
155
156
|
| 'halfCheckedKeys'
|
|
@@ -346,9 +347,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
|
|
|
346
347
|
const isSearching = Boolean(inputValue);
|
|
347
348
|
const treeNodeProps: BasicTreeNodeProps = {
|
|
348
349
|
eventKey: key,
|
|
349
|
-
expanded: isSearching
|
|
350
|
-
? filteredExpandedKeys.has(key)
|
|
351
|
-
: expandedKeys.has(key),
|
|
350
|
+
expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
352
351
|
selected: selectedKeys.includes(key),
|
|
353
352
|
checked: realChecked,
|
|
354
353
|
halfChecked: realHalfChecked,
|
|
@@ -444,6 +443,11 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
|
|
|
444
443
|
});
|
|
445
444
|
}
|
|
446
445
|
|
|
446
|
+
clearInputValue = () => {
|
|
447
|
+
const { inputValue } = this.getStates();
|
|
448
|
+
inputValue && this._adapter.updateInputValue('');
|
|
449
|
+
}
|
|
450
|
+
|
|
447
451
|
// Scenes that may trigger focus:
|
|
448
452
|
// 1、click selection
|
|
449
453
|
_notifyFocus(e: any) {
|
|
@@ -597,8 +601,8 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
|
|
|
597
601
|
const newFlattenNodes = flattenTreeData(treeData, newExpandedKeys, keyMaps);
|
|
598
602
|
|
|
599
603
|
this._adapter.updateState({
|
|
600
|
-
expandedKeys:
|
|
601
|
-
flattenNodes:
|
|
604
|
+
expandedKeys: newExpandedKeys,
|
|
605
|
+
flattenNodes: newFlattenNodes,
|
|
602
606
|
inputValue: '',
|
|
603
607
|
motionKeys: new Set([]),
|
|
604
608
|
filteredKeys: new Set([]),
|
|
@@ -637,8 +641,8 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
|
|
|
637
641
|
const newFilteredExpandedKeys = new Set(expandedOptsKeys);
|
|
638
642
|
this._adapter.notifySearch(sugInput, Array.from(newFilteredExpandedKeys));
|
|
639
643
|
this._adapter.updateState({
|
|
640
|
-
expandedKeys:
|
|
641
|
-
flattenNodes:
|
|
644
|
+
expandedKeys: newExpandedKeys,
|
|
645
|
+
flattenNodes: newFlattenNodes,
|
|
642
646
|
motionKeys: new Set([]),
|
|
643
647
|
filteredKeys: new Set(filteredOptsKeys),
|
|
644
648
|
filteredExpandedKeys: newFilteredExpandedKeys,
|
|
@@ -808,7 +812,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
|
|
|
808
812
|
}
|
|
809
813
|
|
|
810
814
|
const isExpandControlled = this._isExpandControlled();
|
|
811
|
-
if (isSearching
|
|
815
|
+
if (isSearching) {
|
|
812
816
|
this.handleNodeExpandInSearch(e, treeNode);
|
|
813
817
|
return;
|
|
814
818
|
}
|