sykj 0.1.6 → 0.1.8

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 CHANGED
@@ -1,6 +1,12 @@
1
1
  import "./store";
2
-
3
2
  import "./focus";
4
3
 
5
4
  import SyKeyboard from "../packages/keyboard/index.ts"; // 引入封装好的组件
5
+ import {
6
+ Loading1 as SyLoading1,
7
+ Loading2 as SyLoading2,
8
+ } from "../packages/loading/index.ts"; // 引入封装好的组件
9
+
10
+ // 使用命名导出
6
11
  export { SyKeyboard as default };
12
+ export { SyLoading1, SyLoading2 };
package/lib/focus.ts CHANGED
@@ -6,8 +6,6 @@ const globalKey = window.$sy.key;
6
6
  let st: any = null;
7
7
 
8
8
  document.addEventListener("focusin", (event) => {
9
- console.log(123);
10
-
11
9
  const target = event.target as HTMLElement;
12
10
  if (target?.tagName === "INPUT" || target?.tagName === "TEXTAREA") {
13
11
  if (!isEditableFormComponent(target)) return;
@@ -18,23 +16,21 @@ document.addEventListener("focusin", (event) => {
18
16
  });
19
17
 
20
18
  document.addEventListener("focusout", (event) => {
21
- st = setTimeout(() => {
22
- globalKey.close();
23
- // globalKey.currentElement = null;
24
- }, 100);
25
- const target = event.target as HTMLElement;
26
- if (target?.tagName === "INPUT" || target?.tagName === "TEXTAREA") {
27
- // window.showKeyboard()
28
- //
29
- }
19
+ globalKey.close();
20
+
21
+ // st = setTimeout(() => {
22
+ // // globalKey.currentElement = null;
23
+ // }, 100);
24
+ // const target = event.target as HTMLElement;
25
+ // if (target?.tagName === "INPUT" || target?.tagName === "TEXTAREA") {
26
+ // // window.showKeyboard()
27
+ // //
28
+ // }
30
29
  });
31
30
 
32
31
  // 是否展示输入法
33
32
  const isEditableFormComponent = (el: HTMLElement): boolean => {
34
- console.log(el.isContentEditable);
35
-
36
33
  const notType: Array<string> = ["checkbox", "radio"];
37
-
38
34
  if (!(el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement))
39
35
  return false; // 类型守卫
40
36
  if (el.readOnly || notType.includes(el.type)) {
package/lib/store.ts CHANGED
@@ -1,4 +1,4 @@
1
- window.globalThis.$sy = {
1
+ (window.globalThis as any).$sy = {
2
2
  key: {
3
3
  show_keyboard: false,
4
4
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sykj",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "rem adaptation🚀",
5
5
  "main": "lib/common.ts",
6
6
  "files": [