@douyinfe/semi-foundation 2.85.0-alpha.0 → 2.85.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/input/foundation.ts +11 -2
- package/input/textareaFoundation.ts +11 -2
- package/lib/cjs/input/foundation.d.ts +5 -1
- package/lib/cjs/input/foundation.js +6 -1
- package/lib/cjs/input/textareaFoundation.d.ts +5 -1
- package/lib/cjs/input/textareaFoundation.js +6 -1
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- package/lib/cjs/upload/constants.d.ts +1 -1
- package/lib/es/input/foundation.d.ts +5 -1
- package/lib/es/input/foundation.js +6 -1
- package/lib/es/input/textareaFoundation.d.ts +5 -1
- package/lib/es/input/textareaFoundation.js +6 -1
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/upload/constants.d.ts +1 -1
- package/package.json +4 -4
package/input/foundation.ts
CHANGED
|
@@ -23,6 +23,9 @@ export interface InputAdapter extends Partial<DefaultAdapter>, Partial<InputDefa
|
|
|
23
23
|
notifyKeyUp(e: any): void;
|
|
24
24
|
notifyKeyPress(e: any): void;
|
|
25
25
|
notifyEnterPress(e: any): void;
|
|
26
|
+
notifyCompositionStart(e: any): void;
|
|
27
|
+
notifyCompositionEnd(e: any): void;
|
|
28
|
+
notifyCompositionUpdate(e: any): void;
|
|
26
29
|
isEventTarget(e: any): boolean
|
|
27
30
|
}
|
|
28
31
|
|
|
@@ -92,13 +95,15 @@ class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
92
95
|
}
|
|
93
96
|
}
|
|
94
97
|
|
|
95
|
-
handleCompositionStart = () => {
|
|
98
|
+
handleCompositionStart = (e) => {
|
|
96
99
|
this.compositionEnter = true;
|
|
100
|
+
this._adapter.notifyCompositionStart(e);
|
|
97
101
|
}
|
|
98
102
|
|
|
99
103
|
handleCompositionEnd = (e: any) => {
|
|
100
104
|
const value = e.target.value;
|
|
101
105
|
this.compositionEnter = false;
|
|
106
|
+
this._adapter.notifyCompositionEnd(e);
|
|
102
107
|
const { getValueLength, maxLength, minLength } = this.getProps();
|
|
103
108
|
if (!isFunction(getValueLength)) {
|
|
104
109
|
return;
|
|
@@ -109,7 +114,11 @@ class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
109
114
|
}
|
|
110
115
|
if (minLength) {
|
|
111
116
|
this.handleVisibleMinLength(value);
|
|
112
|
-
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
handleCompositionUpdate = (e) => {
|
|
121
|
+
this._adapter.notifyCompositionUpdate(e);
|
|
113
122
|
}
|
|
114
123
|
|
|
115
124
|
/**
|
|
@@ -18,7 +18,10 @@ export interface TextAreaDefaultAdapter {
|
|
|
18
18
|
notifyKeyDown: noopFunction;
|
|
19
19
|
notifyEnterPress: noopFunction;
|
|
20
20
|
toggleHovering(hovering: boolean): void;
|
|
21
|
-
notifyClear(e: any): void
|
|
21
|
+
notifyClear(e: any): void;
|
|
22
|
+
notifyCompositionStart(e: any): void;
|
|
23
|
+
notifyCompositionEnd(e: any): void;
|
|
24
|
+
notifyCompositionUpdate(e: any): void
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
export interface TextAreaAdapter extends Partial<DefaultAdapter>, Partial<TextAreaDefaultAdapter> {
|
|
@@ -89,12 +92,14 @@ export default class TextAreaFoundation extends BaseFoundation<TextAreaAdapter>
|
|
|
89
92
|
return value;
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
handleCompositionStart = () => {
|
|
95
|
+
handleCompositionStart = (e) => {
|
|
93
96
|
this.compositionEnter = true;
|
|
97
|
+
this._adapter.notifyCompositionStart(e);
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
handleCompositionEnd = (e: any) => {
|
|
97
101
|
this.compositionEnter = false;
|
|
102
|
+
this._adapter.notifyCompositionEnd(e);
|
|
98
103
|
const { getValueLength, maxLength, minLength } = this.getProps();
|
|
99
104
|
if (!isFunction(getValueLength)) {
|
|
100
105
|
return;
|
|
@@ -108,6 +113,10 @@ export default class TextAreaFoundation extends BaseFoundation<TextAreaAdapter>
|
|
|
108
113
|
this.handleVisibleMinLength(value);
|
|
109
114
|
}
|
|
110
115
|
}
|
|
116
|
+
|
|
117
|
+
handleCompositionUpdate = (e) => {
|
|
118
|
+
this._adapter.notifyCompositionUpdate(e);
|
|
119
|
+
}
|
|
111
120
|
|
|
112
121
|
/**
|
|
113
122
|
* Modify minLength to trigger browser check for minimum length
|
|
@@ -16,6 +16,9 @@ export interface InputAdapter extends Partial<DefaultAdapter>, Partial<InputDefa
|
|
|
16
16
|
notifyKeyUp(e: any): void;
|
|
17
17
|
notifyKeyPress(e: any): void;
|
|
18
18
|
notifyEnterPress(e: any): void;
|
|
19
|
+
notifyCompositionStart(e: any): void;
|
|
20
|
+
notifyCompositionEnd(e: any): void;
|
|
21
|
+
notifyCompositionUpdate(e: any): void;
|
|
19
22
|
isEventTarget(e: any): boolean;
|
|
20
23
|
}
|
|
21
24
|
declare class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
@@ -32,8 +35,9 @@ declare class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
32
35
|
handleChange(value: any, e: any): void;
|
|
33
36
|
getNextValue: (value: any) => any;
|
|
34
37
|
changeInput: (value: any, e: any) => void;
|
|
35
|
-
handleCompositionStart: () => void;
|
|
38
|
+
handleCompositionStart: (e: any) => void;
|
|
36
39
|
handleCompositionEnd: (e: any) => void;
|
|
40
|
+
handleCompositionUpdate: (e: any) => void;
|
|
37
41
|
/**
|
|
38
42
|
* Modify minLength to trigger browser check for minimum length
|
|
39
43
|
* Controlled mode is not checked
|
|
@@ -56,12 +56,14 @@ class InputFoundation extends _foundation.default {
|
|
|
56
56
|
// this.checkAllowClear(value);
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
this.handleCompositionStart =
|
|
59
|
+
this.handleCompositionStart = e => {
|
|
60
60
|
this.compositionEnter = true;
|
|
61
|
+
this._adapter.notifyCompositionStart(e);
|
|
61
62
|
};
|
|
62
63
|
this.handleCompositionEnd = e => {
|
|
63
64
|
const value = e.target.value;
|
|
64
65
|
this.compositionEnter = false;
|
|
66
|
+
this._adapter.notifyCompositionEnd(e);
|
|
65
67
|
const {
|
|
66
68
|
getValueLength,
|
|
67
69
|
maxLength,
|
|
@@ -78,6 +80,9 @@ class InputFoundation extends _foundation.default {
|
|
|
78
80
|
this.handleVisibleMinLength(value);
|
|
79
81
|
}
|
|
80
82
|
};
|
|
83
|
+
this.handleCompositionUpdate = e => {
|
|
84
|
+
this._adapter.notifyCompositionUpdate(e);
|
|
85
|
+
};
|
|
81
86
|
}
|
|
82
87
|
destroy() {
|
|
83
88
|
if (this._timer) {
|
|
@@ -9,6 +9,9 @@ export interface TextAreaDefaultAdapter {
|
|
|
9
9
|
notifyEnterPress: noopFunction;
|
|
10
10
|
toggleHovering(hovering: boolean): void;
|
|
11
11
|
notifyClear(e: any): void;
|
|
12
|
+
notifyCompositionStart(e: any): void;
|
|
13
|
+
notifyCompositionEnd(e: any): void;
|
|
14
|
+
notifyCompositionUpdate(e: any): void;
|
|
12
15
|
}
|
|
13
16
|
export interface TextAreaAdapter extends Partial<DefaultAdapter>, Partial<TextAreaDefaultAdapter> {
|
|
14
17
|
setMinLength(length: number): void;
|
|
@@ -34,8 +37,9 @@ export default class TextAreaFoundation extends BaseFoundation<TextAreaAdapter>
|
|
|
34
37
|
handleChange(value: string, e: any): void;
|
|
35
38
|
_changeValue: (value: any, e: any) => void;
|
|
36
39
|
getNextValue: (value: any) => any;
|
|
37
|
-
handleCompositionStart: () => void;
|
|
40
|
+
handleCompositionStart: (e: any) => void;
|
|
38
41
|
handleCompositionEnd: (e: any) => void;
|
|
42
|
+
handleCompositionUpdate: (e: any) => void;
|
|
39
43
|
/**
|
|
40
44
|
* Modify minLength to trigger browser check for minimum length
|
|
41
45
|
* Controlled mode is not checked
|
|
@@ -54,11 +54,13 @@ class TextAreaFoundation extends _foundation.default {
|
|
|
54
54
|
}
|
|
55
55
|
return value;
|
|
56
56
|
};
|
|
57
|
-
this.handleCompositionStart =
|
|
57
|
+
this.handleCompositionStart = e => {
|
|
58
58
|
this.compositionEnter = true;
|
|
59
|
+
this._adapter.notifyCompositionStart(e);
|
|
59
60
|
};
|
|
60
61
|
this.handleCompositionEnd = e => {
|
|
61
62
|
this.compositionEnter = false;
|
|
63
|
+
this._adapter.notifyCompositionEnd(e);
|
|
62
64
|
const {
|
|
63
65
|
getValueLength,
|
|
64
66
|
maxLength,
|
|
@@ -76,6 +78,9 @@ class TextAreaFoundation extends _foundation.default {
|
|
|
76
78
|
this.handleVisibleMinLength(value);
|
|
77
79
|
}
|
|
78
80
|
};
|
|
81
|
+
this.handleCompositionUpdate = e => {
|
|
82
|
+
this._adapter.notifyCompositionUpdate(e);
|
|
83
|
+
};
|
|
79
84
|
this.resizeTextarea = () => {
|
|
80
85
|
var _a;
|
|
81
86
|
const {
|
|
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
|
|
|
83
83
|
export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
|
|
84
84
|
export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
|
|
85
85
|
export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
|
|
86
|
-
export declare function calcDropRelativePosition(event: any, treeNode: any):
|
|
86
|
+
export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
|
|
87
87
|
export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
|
|
88
88
|
export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
|
|
@@ -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: ("auto" | "custom")[];
|
|
22
22
|
VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
|
|
23
23
|
PROMPT_POSITION: readonly ["left", "right", "bottom"];
|
|
24
24
|
};
|
|
@@ -16,6 +16,9 @@ export interface InputAdapter extends Partial<DefaultAdapter>, Partial<InputDefa
|
|
|
16
16
|
notifyKeyUp(e: any): void;
|
|
17
17
|
notifyKeyPress(e: any): void;
|
|
18
18
|
notifyEnterPress(e: any): void;
|
|
19
|
+
notifyCompositionStart(e: any): void;
|
|
20
|
+
notifyCompositionEnd(e: any): void;
|
|
21
|
+
notifyCompositionUpdate(e: any): void;
|
|
19
22
|
isEventTarget(e: any): boolean;
|
|
20
23
|
}
|
|
21
24
|
declare class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
@@ -32,8 +35,9 @@ declare class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
32
35
|
handleChange(value: any, e: any): void;
|
|
33
36
|
getNextValue: (value: any) => any;
|
|
34
37
|
changeInput: (value: any, e: any) => void;
|
|
35
|
-
handleCompositionStart: () => void;
|
|
38
|
+
handleCompositionStart: (e: any) => void;
|
|
36
39
|
handleCompositionEnd: (e: any) => void;
|
|
40
|
+
handleCompositionUpdate: (e: any) => void;
|
|
37
41
|
/**
|
|
38
42
|
* Modify minLength to trigger browser check for minimum length
|
|
39
43
|
* Controlled mode is not checked
|
|
@@ -49,12 +49,14 @@ class InputFoundation extends BaseFoundation {
|
|
|
49
49
|
// this.checkAllowClear(value);
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
this.handleCompositionStart =
|
|
52
|
+
this.handleCompositionStart = e => {
|
|
53
53
|
this.compositionEnter = true;
|
|
54
|
+
this._adapter.notifyCompositionStart(e);
|
|
54
55
|
};
|
|
55
56
|
this.handleCompositionEnd = e => {
|
|
56
57
|
const value = e.target.value;
|
|
57
58
|
this.compositionEnter = false;
|
|
59
|
+
this._adapter.notifyCompositionEnd(e);
|
|
58
60
|
const {
|
|
59
61
|
getValueLength,
|
|
60
62
|
maxLength,
|
|
@@ -71,6 +73,9 @@ class InputFoundation extends BaseFoundation {
|
|
|
71
73
|
this.handleVisibleMinLength(value);
|
|
72
74
|
}
|
|
73
75
|
};
|
|
76
|
+
this.handleCompositionUpdate = e => {
|
|
77
|
+
this._adapter.notifyCompositionUpdate(e);
|
|
78
|
+
};
|
|
74
79
|
}
|
|
75
80
|
destroy() {
|
|
76
81
|
if (this._timer) {
|
|
@@ -9,6 +9,9 @@ export interface TextAreaDefaultAdapter {
|
|
|
9
9
|
notifyEnterPress: noopFunction;
|
|
10
10
|
toggleHovering(hovering: boolean): void;
|
|
11
11
|
notifyClear(e: any): void;
|
|
12
|
+
notifyCompositionStart(e: any): void;
|
|
13
|
+
notifyCompositionEnd(e: any): void;
|
|
14
|
+
notifyCompositionUpdate(e: any): void;
|
|
12
15
|
}
|
|
13
16
|
export interface TextAreaAdapter extends Partial<DefaultAdapter>, Partial<TextAreaDefaultAdapter> {
|
|
14
17
|
setMinLength(length: number): void;
|
|
@@ -34,8 +37,9 @@ export default class TextAreaFoundation extends BaseFoundation<TextAreaAdapter>
|
|
|
34
37
|
handleChange(value: string, e: any): void;
|
|
35
38
|
_changeValue: (value: any, e: any) => void;
|
|
36
39
|
getNextValue: (value: any) => any;
|
|
37
|
-
handleCompositionStart: () => void;
|
|
40
|
+
handleCompositionStart: (e: any) => void;
|
|
38
41
|
handleCompositionEnd: (e: any) => void;
|
|
42
|
+
handleCompositionUpdate: (e: any) => void;
|
|
39
43
|
/**
|
|
40
44
|
* Modify minLength to trigger browser check for minimum length
|
|
41
45
|
* Controlled mode is not checked
|
|
@@ -47,11 +47,13 @@ export default class TextAreaFoundation extends BaseFoundation {
|
|
|
47
47
|
}
|
|
48
48
|
return value;
|
|
49
49
|
};
|
|
50
|
-
this.handleCompositionStart =
|
|
50
|
+
this.handleCompositionStart = e => {
|
|
51
51
|
this.compositionEnter = true;
|
|
52
|
+
this._adapter.notifyCompositionStart(e);
|
|
52
53
|
};
|
|
53
54
|
this.handleCompositionEnd = e => {
|
|
54
55
|
this.compositionEnter = false;
|
|
56
|
+
this._adapter.notifyCompositionEnd(e);
|
|
55
57
|
const {
|
|
56
58
|
getValueLength,
|
|
57
59
|
maxLength,
|
|
@@ -69,6 +71,9 @@ export default class TextAreaFoundation extends BaseFoundation {
|
|
|
69
71
|
this.handleVisibleMinLength(value);
|
|
70
72
|
}
|
|
71
73
|
};
|
|
74
|
+
this.handleCompositionUpdate = e => {
|
|
75
|
+
this._adapter.notifyCompositionUpdate(e);
|
|
76
|
+
};
|
|
72
77
|
this.resizeTextarea = () => {
|
|
73
78
|
var _a;
|
|
74
79
|
const {
|
|
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
|
|
|
83
83
|
export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
|
|
84
84
|
export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
|
|
85
85
|
export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
|
|
86
|
-
export declare function calcDropRelativePosition(event: any, treeNode: any):
|
|
86
|
+
export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
|
|
87
87
|
export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
|
|
88
88
|
export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
|
|
@@ -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: ("auto" | "custom")[];
|
|
22
22
|
VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
|
|
23
23
|
PROMPT_POSITION: readonly ["left", "right", "bottom"];
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.85.0-
|
|
3
|
+
"version": "2.85.0-beta.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.
|
|
11
|
-
"@douyinfe/semi-json-viewer-core": "2.
|
|
10
|
+
"@douyinfe/semi-animation": "2.85.0-beta.0",
|
|
11
|
+
"@douyinfe/semi-json-viewer-core": "2.85.0-beta.0",
|
|
12
12
|
"@mdx-js/mdx": "^3.0.1",
|
|
13
13
|
"async-validator": "^3.5.0",
|
|
14
14
|
"classnames": "^2.2.6",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"*.scss",
|
|
30
30
|
"*.css"
|
|
31
31
|
],
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "33738dd3e18dad726469b193229b64bbf1f9c4d3",
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
35
35
|
"@babel/preset-env": "^7.15.8",
|