@douyinfe/semi-foundation 2.21.0 → 2.21.1
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.
|
@@ -28,7 +28,7 @@ export default class ModalContentFoundation extends BaseFoundation<ModalContentA
|
|
|
28
28
|
destroy(): void;
|
|
29
29
|
handleDialogMouseDown(): void;
|
|
30
30
|
handleMaskMouseUp(): void;
|
|
31
|
-
handleKeyDown(e: any)
|
|
31
|
+
handleKeyDown: (e: any) => void;
|
|
32
32
|
handleKeyDownEventListenerMount(): void;
|
|
33
33
|
handleKeyDownEventListenerUnmount(): void;
|
|
34
34
|
getMouseState(): void;
|
|
@@ -14,6 +14,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
14
14
|
class ModalContentFoundation extends _foundation.default {
|
|
15
15
|
constructor(adapter) {
|
|
16
16
|
super(Object.assign(Object.assign({}, ModalContentFoundation.defaultAdapter), adapter));
|
|
17
|
+
|
|
18
|
+
this.handleKeyDown = e => {
|
|
19
|
+
const {
|
|
20
|
+
closeOnEsc
|
|
21
|
+
} = this.getProps();
|
|
22
|
+
|
|
23
|
+
if (closeOnEsc && e.keyCode === _keyCode.default.ESC) {
|
|
24
|
+
e.stopPropagation();
|
|
25
|
+
this.close(e);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
17
29
|
}
|
|
18
30
|
|
|
19
31
|
destroy() {
|
|
@@ -30,18 +42,6 @@ class ModalContentFoundation extends _foundation.default {
|
|
|
30
42
|
this._adapter.notifyDialogMouseUp();
|
|
31
43
|
}
|
|
32
44
|
|
|
33
|
-
handleKeyDown(e) {
|
|
34
|
-
const {
|
|
35
|
-
closeOnEsc
|
|
36
|
-
} = this.getProps();
|
|
37
|
-
|
|
38
|
-
if (closeOnEsc && e.keyCode === _keyCode.default.ESC) {
|
|
39
|
-
e.stopPropagation();
|
|
40
|
-
this.close(e);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
45
|
handleKeyDownEventListenerMount() {
|
|
46
46
|
this._adapter.addKeyDownEventListener();
|
|
47
47
|
}
|
|
@@ -28,7 +28,7 @@ export default class ModalContentFoundation extends BaseFoundation<ModalContentA
|
|
|
28
28
|
destroy(): void;
|
|
29
29
|
handleDialogMouseDown(): void;
|
|
30
30
|
handleMaskMouseUp(): void;
|
|
31
|
-
handleKeyDown(e: any)
|
|
31
|
+
handleKeyDown: (e: any) => void;
|
|
32
32
|
handleKeyDownEventListenerMount(): void;
|
|
33
33
|
handleKeyDownEventListenerUnmount(): void;
|
|
34
34
|
getMouseState(): void;
|
|
@@ -3,6 +3,18 @@ import KeyCode from '../utils/keyCode';
|
|
|
3
3
|
export default class ModalContentFoundation extends BaseFoundation {
|
|
4
4
|
constructor(adapter) {
|
|
5
5
|
super(Object.assign(Object.assign({}, ModalContentFoundation.defaultAdapter), adapter));
|
|
6
|
+
|
|
7
|
+
this.handleKeyDown = e => {
|
|
8
|
+
const {
|
|
9
|
+
closeOnEsc
|
|
10
|
+
} = this.getProps();
|
|
11
|
+
|
|
12
|
+
if (closeOnEsc && e.keyCode === KeyCode.ESC) {
|
|
13
|
+
e.stopPropagation();
|
|
14
|
+
this.close(e);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
6
18
|
}
|
|
7
19
|
|
|
8
20
|
destroy() {
|
|
@@ -19,18 +31,6 @@ export default class ModalContentFoundation extends BaseFoundation {
|
|
|
19
31
|
this._adapter.notifyDialogMouseUp();
|
|
20
32
|
}
|
|
21
33
|
|
|
22
|
-
handleKeyDown(e) {
|
|
23
|
-
const {
|
|
24
|
-
closeOnEsc
|
|
25
|
-
} = this.getProps();
|
|
26
|
-
|
|
27
|
-
if (closeOnEsc && e.keyCode === KeyCode.ESC) {
|
|
28
|
-
e.stopPropagation();
|
|
29
|
-
this.close(e);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
34
|
handleKeyDownEventListenerMount() {
|
|
35
35
|
this._adapter.addKeyDownEventListener();
|
|
36
36
|
}
|
|
@@ -48,7 +48,7 @@ export default class ModalContentFoundation extends BaseFoundation<ModalContentA
|
|
|
48
48
|
this._adapter.notifyDialogMouseUp();
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
handleKeyDown(e: any) {
|
|
51
|
+
handleKeyDown = (e: any) => {
|
|
52
52
|
const { closeOnEsc } = this.getProps();
|
|
53
53
|
if (closeOnEsc && e.keyCode === KeyCode.ESC) {
|
|
54
54
|
e.stopPropagation();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"*.scss",
|
|
24
24
|
"*.css"
|
|
25
25
|
],
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "ae80a064a1525cbc26fe498ac236beb0d075e362",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
29
29
|
"@babel/preset-env": "^7.15.8",
|