sykj 0.1.0 → 0.1.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.
- package/README.md +1 -1
- package/lib/{common.js → common.ts} +3 -3
- package/lib/{focus.js → focus.ts} +10 -9
- package/package.json +1 -1
- package/packages/keyboard/{index.js → index.ts} +2 -2
- package/packages/keyboard/src/Keyboardcon.vue +8 -7
- package/packages/loading/{index.js → index.ts} +2 -2
- package/types/global.d.ts +11 -0
- package/types/index.d.ts +4 -0
- /package/lib/{store.js → store.ts} +0 -0
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@ import "/lib/store";
|
|
|
2
2
|
|
|
3
3
|
import "/lib/focus";
|
|
4
4
|
|
|
5
|
-
import SyKeyboard from "/packages/keyboard/index.
|
|
6
|
-
import SyLoading from "/packages/loading/index.
|
|
5
|
+
import SyKeyboard from "/packages/keyboard/index.ts"; // 引入封装好的组件
|
|
6
|
+
import SyLoading from "/packages/loading/index.ts";
|
|
7
7
|
|
|
8
8
|
// export { SyKeyboard as default };
|
|
9
9
|
// export { SyLoading };
|
|
@@ -19,7 +19,7 @@ const components = [
|
|
|
19
19
|
// 其他组件...
|
|
20
20
|
];
|
|
21
21
|
|
|
22
|
-
const install = function (Vue) {
|
|
22
|
+
const install = function (Vue: { component: (arg0: any, arg1: any) => void }) {
|
|
23
23
|
components.forEach((component) => {
|
|
24
24
|
Vue.component(component.name, component);
|
|
25
25
|
});
|
|
@@ -5,10 +5,8 @@ const globalKey = window.$sy.key;
|
|
|
5
5
|
|
|
6
6
|
let st = null;
|
|
7
7
|
document.addEventListener("focusin", (event) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
event.target?.tagName === "TEXTAREA"
|
|
11
|
-
) {
|
|
8
|
+
const target = event.target as HTMLElement;
|
|
9
|
+
if (target?.tagName === "INPUT" || target?.tagName === "TEXTAREA") {
|
|
12
10
|
console.log(
|
|
13
11
|
"🚀 ~ file: focus.js:15 ~ document.addEventListener ~ event.target:",
|
|
14
12
|
event.target
|
|
@@ -17,18 +15,21 @@ document.addEventListener("focusin", (event) => {
|
|
|
17
15
|
clearTimeout(st);
|
|
18
16
|
globalKey.open();
|
|
19
17
|
globalKey.currentElement = event.target;
|
|
18
|
+
console.log(
|
|
19
|
+
"🚀 ~ file: focus.ts:18 ~ document.addEventListener ~ globalKey:",
|
|
20
|
+
globalKey
|
|
21
|
+
);
|
|
20
22
|
}
|
|
21
23
|
});
|
|
22
24
|
document.addEventListener("focusout", (event) => {
|
|
23
25
|
st = setTimeout(() => {
|
|
24
26
|
globalKey.close();
|
|
27
|
+
// globalKey.currentElement = null;
|
|
25
28
|
}, 100);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
event.target?.tagName === "TEXTAREA"
|
|
29
|
-
) {
|
|
29
|
+
const target = event.target as HTMLElement;
|
|
30
|
+
if (target?.tagName === "INPUT" || target?.tagName === "TEXTAREA") {
|
|
30
31
|
// window.showKeyboard()
|
|
31
|
-
|
|
32
|
+
//
|
|
32
33
|
console.log(2);
|
|
33
34
|
}
|
|
34
35
|
});
|
package/package.json
CHANGED
|
@@ -447,13 +447,14 @@ const setInputValue = (item) => {
|
|
|
447
447
|
text = text.slice(0, carePos) + item + text.slice(carePos);
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
-
if (toUpKeyCase.value) {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
} else {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
}
|
|
450
|
+
// if (toUpKeyCase.value) {
|
|
451
|
+
// // keyStore.currentElement.value = `${text}`.toUpperCase();
|
|
452
|
+
// globalKey.currentElement.value = `${text}`.toUpperCase();
|
|
453
|
+
// } else {
|
|
454
|
+
// // keyStore.currentElement.value = text;
|
|
455
|
+
// globalKey.currentElement.value = text;
|
|
456
|
+
// }
|
|
457
|
+
globalKey.currentElement.value = text;
|
|
457
458
|
carePos += item.length + 1;
|
|
458
459
|
|
|
459
460
|
// keyStore.currentElement.setSelectionRange(carePos - 1, carePos - 1);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import Loading1 from "./Loading1.vue";
|
|
2
2
|
import Loading2 from "./Loading2.vue";
|
|
3
|
-
|
|
3
|
+
import { App } from "vue";
|
|
4
4
|
const components = [Loading1, Loading2];
|
|
5
5
|
|
|
6
6
|
components.forEach((i) => {
|
|
7
|
-
i.install = function (Vue) {
|
|
7
|
+
i.install = function (Vue: App) {
|
|
8
8
|
Vue.component(i.name, i);
|
|
9
9
|
};
|
|
10
10
|
});
|
package/types/index.d.ts
ADDED
|
File without changes
|