sykj 0.1.7 → 0.1.9
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/lib/common.ts +11 -1
- package/lib/focus.ts +4 -7
- package/package.json +2 -1
- package/packages/keyboard/index.ts +1 -1
- package/packages/keyboard/src/Keyboardcon.vue +969 -944
- package/packages/loading/index.ts +8 -8
- package/packages/loading/index.vue +39 -0
package/lib/common.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import "./store";
|
|
2
|
-
|
|
3
2
|
import "./focus";
|
|
4
3
|
|
|
5
4
|
import SyKeyboard from "../packages/keyboard/index.ts"; // 引入封装好的组件
|
|
5
|
+
// import * as SyLoading from "../packages/loading/index.ts"; // 引入封装好的组件
|
|
6
|
+
import { SyLoading } from "../packages/loading/index.ts"; // 一键导出所有组件
|
|
7
|
+
|
|
8
|
+
const a = () => {
|
|
9
|
+
console.log(123);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// 使用命名导出
|
|
6
13
|
export { SyKeyboard as default };
|
|
14
|
+
export { SyLoading };
|
|
15
|
+
|
|
16
|
+
export { a };
|
package/lib/focus.ts
CHANGED
|
@@ -16,22 +16,19 @@ document.addEventListener("focusin", (event) => {
|
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
document.addEventListener("focusout", (event) => {
|
|
19
|
-
st = setTimeout(() => {
|
|
20
|
-
globalKey.close();
|
|
21
|
-
// globalKey.currentElement = null;
|
|
22
|
-
}, 100);
|
|
23
19
|
const target = event.target as HTMLElement;
|
|
24
20
|
if (target?.tagName === "INPUT" || target?.tagName === "TEXTAREA") {
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
if (!isEditableFormComponent(target)) return;
|
|
22
|
+
globalKey.close();
|
|
27
23
|
}
|
|
28
24
|
});
|
|
29
25
|
|
|
30
26
|
// 是否展示输入法
|
|
31
27
|
const isEditableFormComponent = (el: HTMLElement): boolean => {
|
|
28
|
+
// 类型守卫
|
|
32
29
|
const notType: Array<string> = ["checkbox", "radio"];
|
|
33
30
|
if (!(el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement))
|
|
34
|
-
return false;
|
|
31
|
+
return false;
|
|
35
32
|
if (el.readOnly || notType.includes(el.type)) {
|
|
36
33
|
return false;
|
|
37
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sykj",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "rem adaptation🚀",
|
|
5
5
|
"main": "lib/common.ts",
|
|
6
6
|
"files": [
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"amfe-flexible": "^2.2.1",
|
|
27
27
|
"axios": "^1.6.8",
|
|
28
28
|
"element-plus": "^2.7.2",
|
|
29
|
+
"lottie-web": "^5.12.2",
|
|
29
30
|
"pinia": "^2.1.7",
|
|
30
31
|
"vitepress": "^1.3.1",
|
|
31
32
|
"vue": "^3.4.21",
|