@web-utils/component 2.0.14 → 2.7.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/dist/chunks/config.46422d7f.js +73 -0
- package/dist/chunks/{3a79781b.js → confirmable-mixin.3a79781b.js} +0 -0
- package/dist/chunks/dataformat.fb35ee10.js +61 -0
- package/dist/chunks/detail.a3249549.js +28 -0
- package/dist/chunks/dic.5f7e3523.js +132 -0
- package/dist/chunks/event.50c365eb.js +235 -0
- package/dist/chunks/{76680a03.js → form-input-mixin.ff5b58f7.js} +2 -2
- package/dist/chunks/{b4acd3a6.js → form-item-mixin.79f6eaff.js} +3 -1
- package/dist/chunks/{61ad06b2.js → form-pick-mixin.61ad06b2.js} +0 -0
- package/dist/chunks/init.352281f5.js +121 -0
- package/dist/chunks/{41a066be.js → input-number-mixin.41a066be.js} +0 -0
- package/dist/chunks/{5a78e0db.js → mixins.5a78e0db.js} +0 -0
- package/dist/chunks/packages.5d7a86c4.js +114 -0
- package/dist/chunks/permission.ce5d2121.js +16 -0
- package/dist/chunks/slot.1b8d2b1b.js +27 -0
- package/dist/chunks/{8c0142e0.js → tab-mixin.8c0142e0.js} +0 -0
- package/dist/chunks/util.5053d54e.js +264 -0
- package/dist/chunks/{97652d86.js → utils.97652d86.js} +0 -0
- package/dist/chunks/{f71045fc.js → utils.fa73de78.js} +1 -0
- package/dist/chunks/{5d4282fb.js → vueComponentNormalizer.71e2aa87.js} +3 -1
- package/dist/components/address-input/index.js +1 -1
- package/dist/components/affix/index.js +102 -0
- package/dist/components/affix/style.css +1 -0
- package/dist/components/array/index.js +156 -0
- package/dist/components/array/style.css +1 -0
- package/dist/components/article/index.js +93 -0
- package/dist/components/article/style.css +1 -0
- package/dist/components/aside-menu/index.js +1 -1
- package/dist/components/avatar/index.js +106 -0
- package/dist/components/avatar/style.css +1 -0
- package/dist/components/awesome-button/index.js +1 -1
- package/dist/components/base.css +1 -1
- package/dist/components/capsule-tab/index.js +1 -1
- package/dist/components/card/index.js +130 -0
- package/dist/components/card/style.css +1 -0
- package/dist/components/carousel/index.js +70 -0
- package/dist/components/carousel/style.css +1 -0
- package/dist/components/chat/index.js +567 -0
- package/dist/components/chat/style.css +1 -0
- package/dist/components/chunk-file-uploader/index.js +2 -2
- package/dist/components/chunk-file-uploader-button/index.js +2 -2
- package/dist/components/chunk-file-uploader-drop/index.js +2 -2
- package/dist/components/chunk-file-uploader-file/index.js +2 -2
- package/dist/components/chunk-file-uploader-files/index.js +2 -2
- package/dist/components/chunk-file-uploader-list/index.js +2 -2
- package/dist/components/chunk-file-uploader-un-support/index.js +2 -2
- package/dist/components/code/index.js +66 -0
- package/dist/components/code-mirror-editor/index.js +4 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/column/index.js +114 -0
- package/dist/components/column-default/index.js +105 -0
- package/dist/components/column-dynamic/index.js +93 -0
- package/dist/components/column-menu/index.js +286 -0
- package/dist/components/column-slot/index.js +265 -0
- package/dist/components/comment/index.js +94 -0
- package/dist/components/comment/style.css +1 -0
- package/dist/components/confirm-button/index.js +2 -2
- package/dist/components/confirmable/index.js +2 -2
- package/dist/components/context-menu/index.js +11 -1
- package/dist/components/count-up/index.js +120 -0
- package/dist/components/custom-scrollbar/index.js +2 -2
- package/dist/components/data-box/index.js +97 -0
- package/dist/components/data-box/style.css +1 -0
- package/dist/components/data-card/index.js +98 -0
- package/dist/components/data-card/style.css +1 -0
- package/dist/components/data-cardtext/index.js +82 -0
- package/dist/components/data-cardtext/style.css +1 -0
- package/dist/components/data-display/index.js +93 -0
- package/dist/components/data-display/style.css +1 -0
- package/dist/components/data-icons/index.js +104 -0
- package/dist/components/data-icons/style.css +1 -0
- package/dist/components/data-imgtext/index.js +106 -0
- package/dist/components/data-imgtext/style.css +1 -0
- package/dist/components/data-operatext/index.js +99 -0
- package/dist/components/data-operatext/style.css +1 -0
- package/dist/components/data-panel/index.js +93 -0
- package/dist/components/data-panel/style.css +1 -0
- package/dist/components/data-pay/index.js +149 -0
- package/dist/components/data-pay/style.css +1 -0
- package/dist/components/data-price/index.js +84 -0
- package/dist/components/data-price/style.css +1 -0
- package/dist/components/data-progress/index.js +97 -0
- package/dist/components/data-progress/style.css +1 -0
- package/dist/components/data-rotate/index.js +96 -0
- package/dist/components/data-rotate/style.css +1 -0
- package/dist/components/data-table-picker/index.js +2 -2
- package/dist/components/data-tabs/index.js +94 -0
- package/dist/components/data-tabs/style.css +1 -0
- package/dist/components/dialog-column/index.js +138 -0
- package/dist/components/dialog-excel/index.js +214 -0
- package/dist/components/dialog-filter/index.js +245 -0
- package/dist/components/dialog-form/index.js +275 -0
- package/dist/components/draggable/index.js +384 -0
- package/dist/components/draggable/style.css +1 -0
- package/dist/components/dynamic-table/index.js +1 -1
- package/dist/components/e-charts/index.js +7 -1
- package/dist/components/editable-progress/index.js +1 -1
- package/dist/components/editable-tree/index.js +2 -2
- package/dist/components/egd-collapse/index.js +1 -1
- package/dist/components/egd-collapse-item/index.js +1 -1
- package/dist/components/element-dialog/index.js +1 -1
- package/dist/components/empty/index.js +59 -0
- package/dist/components/empty/style.css +1 -0
- package/dist/components/empty-view/index.js +1 -1
- package/dist/components/error-view/index.js +1 -1
- package/dist/components/flex-column/index.js +2 -2
- package/dist/components/flex-item/index.js +2 -2
- package/dist/components/flex-row/index.js +2 -2
- package/dist/components/flex-scroller/index.js +1 -1
- package/dist/components/flow/index.js +278 -0
- package/dist/components/flow/style.css +1 -0
- package/dist/components/flow-node/index.js +102 -0
- package/dist/components/form-button/index.js +2 -2
- package/dist/components/form-cascader/index.js +4 -4
- package/dist/components/form-checkbox-group/index.js +4 -4
- package/dist/components/form-date-picker/index.js +4 -4
- package/dist/components/form-group/index.js +122 -0
- package/dist/components/form-group/style.css +1 -0
- package/dist/components/form-holder/index.js +23 -2
- package/dist/components/form-input/index.js +3 -3
- package/dist/components/form-input-email/index.js +3 -3
- package/dist/components/form-input-id-card/index.js +3 -3
- package/dist/components/form-input-number/index.js +4 -4
- package/dist/components/form-input-phone-number/index.js +3 -3
- package/dist/components/form-input-time/index.js +3 -3
- package/dist/components/form-item/index.js +2 -2
- package/dist/components/form-item-config-provider/index.js +1 -1
- package/dist/components/form-item-group/index.js +1 -1
- package/dist/components/form-radio-group/index.js +4 -4
- package/dist/components/form-select/index.js +4 -4
- package/dist/components/form-switch/index.js +3 -3
- package/dist/components/form-temp/index.js +149 -0
- package/dist/components/form-textarea/index.js +3 -3
- package/dist/components/form-view/index.js +1 -1
- package/dist/components/fy-cascader/index.js +132 -0
- package/dist/components/fy-checkbox/index.js +116 -0
- package/dist/components/fy-checkbox/style.css +1 -0
- package/dist/components/fy-curd/index.js +846 -0
- package/dist/components/fy-curd/style.css +1 -0
- package/dist/components/fy-date/index.js +84 -0
- package/dist/components/fy-date/style.css +1 -0
- package/dist/components/fy-dialog-form/index.js +278 -0
- package/dist/components/fy-dialog-form/style.css +1 -0
- package/dist/components/fy-dynamic/index.js +335 -0
- package/dist/components/fy-dynamic/style.css +1 -0
- package/dist/components/fy-form/index.js +754 -0
- package/dist/components/fy-form/style.css +1 -0
- package/dist/components/fy-form-menu/index.js +95 -0
- package/dist/components/fy-input/index.js +162 -0
- package/dist/components/fy-input-color/index.js +96 -0
- package/dist/components/fy-input-icon/index.js +161 -0
- package/dist/components/fy-input-icon/style.css +1 -0
- package/dist/components/fy-input-map/index.js +275 -0
- package/dist/components/fy-input-map/style.css +1 -0
- package/dist/components/fy-input-number/index.js +87 -0
- package/dist/components/fy-input-table/index.js +172 -0
- package/dist/components/fy-input-table/style.css +1 -0
- package/dist/components/fy-input-tree/index.js +265 -0
- package/dist/components/fy-input-tree/style.css +1 -0
- package/dist/components/fy-radio/index.js +68 -0
- package/dist/components/fy-radio/style.css +1 -0
- package/dist/components/fy-rate/index.js +105 -0
- package/dist/components/fy-rate/style.css +1 -0
- package/dist/components/fy-select/index.js +223 -0
- package/dist/components/fy-select/style.css +1 -0
- package/dist/components/fy-slider/index.js +79 -0
- package/dist/components/fy-switch/index.js +73 -0
- package/dist/components/fy-time/index.js +95 -0
- package/dist/components/fy-title/index.js +40 -0
- package/dist/components/fy-title/style.css +1 -0
- package/dist/components/fy-upload/index.js +704 -0
- package/dist/components/fy-upload/style.css +1 -0
- package/dist/components/guide-steps/index.js +1 -1
- package/dist/components/header-menu/index.js +238 -0
- package/dist/components/header-search/index.js +246 -0
- package/dist/components/icon-card/index.js +1 -1
- package/dist/components/icon-temp/index.js +50 -0
- package/dist/components/icon-temp/style.css +1 -0
- package/dist/components/iframe-window/index.js +1 -1
- package/dist/components/image-viewer/index.js +1 -1
- package/dist/components/input-number/index.js +2 -2
- package/dist/components/input-number-range/index.js +1 -1
- package/dist/components/keep-view-alive/index.js +6 -2
- package/dist/components/keyboard/index.js +389 -0
- package/dist/components/keyboard/style.css +1 -0
- package/dist/components/license/index.js +134 -0
- package/dist/components/loading-view/index.js +1 -1
- package/dist/components/login/index.js +244 -0
- package/dist/components/login/style.css +1 -0
- package/dist/components/name-avatar/index.js +66 -0
- package/dist/components/name-avatar/style.css +1 -0
- package/dist/components/nav-bar/index.js +1 -1
- package/dist/components/not-implement/index.js +1 -1
- package/dist/components/notice/index.js +143 -0
- package/dist/components/notice/style.css +1 -0
- package/dist/components/page/index.js +1 -1
- package/dist/components/page-header/index.js +1 -1
- package/dist/components/page-index/index.js +1 -1
- package/dist/components/page-index-top/index.js +1 -1
- package/dist/components/page-skeleton/index.js +1 -1
- package/dist/components/page-skeleton-new/index.js +1 -1
- package/dist/components/pageable-table/index.js +6 -2
- package/dist/components/pageable-view/index.js +7 -2
- package/dist/components/photo-swipe/index.js +7 -1
- package/dist/components/progress/index.js +60 -0
- package/dist/components/queue/index.js +76 -0
- package/dist/components/record-video/index.js +173 -0
- package/dist/components/record-video/style.css +1 -0
- package/dist/components/resize-observer/index.js +2 -2
- package/dist/components/search/index.js +142 -0
- package/dist/components/search/style.css +1 -0
- package/dist/components/search-popover/index.js +1 -1
- package/dist/components/sign/index.js +128 -0
- package/dist/components/sign/style.css +1 -0
- package/dist/components/sign-panel/index.js +14 -1
- package/dist/components/skeleton/index.js +82 -0
- package/dist/components/skeleton/style.css +1 -0
- package/dist/components/split-pane/index.js +7 -1
- package/dist/components/stateful/index.js +1 -1
- package/dist/components/static-pageable-table/index.js +1 -1
- package/dist/components/swiper/index.js +1 -1
- package/dist/components/tab/index.js +4 -2
- package/dist/components/tab-item/index.js +2 -2
- package/dist/components/table-column/index.js +1 -1
- package/dist/components/table-page/index.js +129 -0
- package/dist/components/table-view/index.js +2 -2
- package/dist/components/tabs/index.js +90 -0
- package/dist/components/tabs/style.css +0 -0
- package/dist/components/tag-render/index.js +1 -1
- package/dist/components/text-ellipsis/index.js +107 -0
- package/dist/components/text-ellipsis/style.css +1 -0
- package/dist/components/tinymce-editor/index.js +1 -1
- package/dist/components/tinymce-wrapper/index.js +1 -1
- package/dist/components/toolbar/index.js +1 -1
- package/dist/components/toolbar-button/index.js +1 -1
- package/dist/components/tree/index.js +427 -0
- package/dist/components/tree/style.css +1 -0
- package/dist/components/trigger/index.js +1 -1
- package/dist/components/verify/index.js +80 -0
- package/dist/components/verify/style.css +1 -0
- package/dist/components/vue-tags-input/index.js +115 -1
- package/dist/components/watermark/index.js +20 -2
- package/dist/index.css +4128 -745
- package/dist/index.es.js +21634 -7064
- package/package.json +20 -4
- package/web-types.json +12777 -2788
- package/dist/components/x-dialog/index.js +0 -173
- package/dist/components/x-dialog/style.css +0 -1
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { n as S } from "../../chunks/vueComponentNormalizer.71e2aa87.js";
|
|
2
|
+
let T = class {
|
|
3
|
+
constructor(e) {
|
|
4
|
+
if (typeof e != "object") {
|
|
5
|
+
console.error('aKeyboard: The obj parameter needs to be an object <In "new aKeyboard()">');
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
this.obj = e;
|
|
9
|
+
const r = document.querySelector(e.el);
|
|
10
|
+
let l = "";
|
|
11
|
+
if (typeof e.style == "object")
|
|
12
|
+
for (let t in e.style)
|
|
13
|
+
l += t + ": " + e.style[t] + ";";
|
|
14
|
+
let i = '<div class="akeyboard-keyboard' + (e.fixedBottomCenter ? " akeyboard-keyboard-fixedBottomCenter" : "") + '" style="' + l + '">', o = [];
|
|
15
|
+
for (let t = 1; t < 10; t++)
|
|
16
|
+
o.push(t.toString());
|
|
17
|
+
o.push("0");
|
|
18
|
+
const s = e.keys || [
|
|
19
|
+
["`"].concat(o).concat([
|
|
20
|
+
"-",
|
|
21
|
+
"=",
|
|
22
|
+
"Delete"
|
|
23
|
+
]),
|
|
24
|
+
["Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "\\"],
|
|
25
|
+
["Caps", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "Enter"],
|
|
26
|
+
["Shift", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "Shift"],
|
|
27
|
+
["Space"]
|
|
28
|
+
];
|
|
29
|
+
let n;
|
|
30
|
+
const a = [], m = [];
|
|
31
|
+
for (let t = 0; t < s.length; t++) {
|
|
32
|
+
a.push([]), m.push([]), n = s[t];
|
|
33
|
+
for (let c = 0; c < n.length; c++) {
|
|
34
|
+
if (n[c].length === 1) {
|
|
35
|
+
switch (m[t].push(n[c].toUpperCase()), n[c]) {
|
|
36
|
+
case "`":
|
|
37
|
+
a[t].push("~");
|
|
38
|
+
continue;
|
|
39
|
+
case "1":
|
|
40
|
+
a[t].push("!");
|
|
41
|
+
continue;
|
|
42
|
+
case "2":
|
|
43
|
+
a[t].push("@");
|
|
44
|
+
continue;
|
|
45
|
+
case "3":
|
|
46
|
+
a[t].push("#");
|
|
47
|
+
continue;
|
|
48
|
+
case "4":
|
|
49
|
+
a[t].push("$");
|
|
50
|
+
continue;
|
|
51
|
+
case "5":
|
|
52
|
+
a[t].push("%");
|
|
53
|
+
continue;
|
|
54
|
+
case "6":
|
|
55
|
+
a[t].push("^");
|
|
56
|
+
continue;
|
|
57
|
+
case "7":
|
|
58
|
+
a[t].push("&");
|
|
59
|
+
continue;
|
|
60
|
+
case "8":
|
|
61
|
+
a[t].push("*");
|
|
62
|
+
continue;
|
|
63
|
+
case "9":
|
|
64
|
+
a[t].push("(");
|
|
65
|
+
continue;
|
|
66
|
+
case "0":
|
|
67
|
+
a[t].push(")");
|
|
68
|
+
continue;
|
|
69
|
+
case "-":
|
|
70
|
+
a[t].push("_");
|
|
71
|
+
continue;
|
|
72
|
+
case "=":
|
|
73
|
+
a[t].push("+");
|
|
74
|
+
continue;
|
|
75
|
+
case "[":
|
|
76
|
+
a[t].push("{");
|
|
77
|
+
continue;
|
|
78
|
+
case "]":
|
|
79
|
+
a[t].push("}");
|
|
80
|
+
continue;
|
|
81
|
+
case "\\":
|
|
82
|
+
a[t].push("|");
|
|
83
|
+
continue;
|
|
84
|
+
case ";":
|
|
85
|
+
a[t].push(":");
|
|
86
|
+
continue;
|
|
87
|
+
case "'":
|
|
88
|
+
a[t].push('"');
|
|
89
|
+
continue;
|
|
90
|
+
case ",":
|
|
91
|
+
a[t].push("<");
|
|
92
|
+
continue;
|
|
93
|
+
case ".":
|
|
94
|
+
a[t].push(">");
|
|
95
|
+
continue;
|
|
96
|
+
case "/":
|
|
97
|
+
a[t].push("?");
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
a[t].push(n[c].toUpperCase());
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
a[t].push(n[c]), m[t].push(n[c]);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
for (let t = 0; t < s.length; t++) {
|
|
107
|
+
n = s[t], i += '<div class="akeyboard-keyboard-innerKeys">';
|
|
108
|
+
for (let c = 0; c < n.length; c++)
|
|
109
|
+
i += '<div class="akeyboard-keyboard-keys akeyboard-keyboard-keys-' + n[c] + '">' + n[c] + "</div>";
|
|
110
|
+
i += "</div>";
|
|
111
|
+
}
|
|
112
|
+
i += "</div>", r.innerHTML = i;
|
|
113
|
+
let K = !1;
|
|
114
|
+
s.forEach((t) => {
|
|
115
|
+
if (t.includes("Shift")) {
|
|
116
|
+
K = !0;
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
}), K && document.querySelectorAll(e.el + " .akeyboard-keyboard-keys-Shift").forEach((c) => {
|
|
120
|
+
c.onclick = function() {
|
|
121
|
+
if (!this.isShift) {
|
|
122
|
+
const y = document.querySelector(e.el + " .akeyboard-keyboard-keys-Caps");
|
|
123
|
+
if (y && y.isCaps)
|
|
124
|
+
return;
|
|
125
|
+
c.isShift = !0, c.innerHTML = "SHIFT", this.classList.add("keyboard-keyboard-keys-focus");
|
|
126
|
+
const u = document.querySelectorAll(e.el + " .akeyboard-keyboard-innerKeys");
|
|
127
|
+
let b;
|
|
128
|
+
for (let h = 0; h < u.length; h++) {
|
|
129
|
+
b = u[h];
|
|
130
|
+
for (let f = 0; f < b.childNodes.length; f++)
|
|
131
|
+
a[h][f] !== "Shift" && (b.childNodes[f].innerHTML = a[h][f]);
|
|
132
|
+
}
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
c.isShift = !1, c.innerHTML = "Shift", this.classList.remove("keyboard-keyboard-keys-focus");
|
|
136
|
+
const p = document.querySelectorAll(e.el + " .akeyboard-keyboard-innerKeys");
|
|
137
|
+
let k;
|
|
138
|
+
for (let y = 0; y < p.length; y++) {
|
|
139
|
+
k = p[y];
|
|
140
|
+
for (let u = 0; u < k.childNodes.length; u++)
|
|
141
|
+
k.childNodes[u].innerHTML = s[y][u];
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
let v = !1;
|
|
146
|
+
s.forEach((t) => {
|
|
147
|
+
if (t.includes("Caps")) {
|
|
148
|
+
v = !0;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
}), v && document.querySelectorAll(e.el + " .akeyboard-keyboard-keys-Caps").forEach((c) => {
|
|
152
|
+
c.onclick = function() {
|
|
153
|
+
if (!this.isCaps) {
|
|
154
|
+
const y = document.querySelector(e.el + " .akeyboard-keyboard-keys-Shift");
|
|
155
|
+
if (y && y.isShift)
|
|
156
|
+
return;
|
|
157
|
+
this.isCaps = !0, this.classList.add("keyboard-keyboard-keys-focus");
|
|
158
|
+
const u = document.querySelectorAll(e.el + " .akeyboard-keyboard-innerKeys");
|
|
159
|
+
let b;
|
|
160
|
+
for (let h = 0; h < u.length; h++) {
|
|
161
|
+
b = u[h];
|
|
162
|
+
for (let f = 0; f < b.childNodes.length; f++)
|
|
163
|
+
b.childNodes[f].innerHTML = m[h][f];
|
|
164
|
+
}
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
this.isCaps = !1, this.classList.remove("keyboard-keyboard-keys-focus");
|
|
168
|
+
const p = document.querySelectorAll(e.el + " .akeyboard-keyboard-innerKeys");
|
|
169
|
+
let k;
|
|
170
|
+
for (let y = 0; y < p.length; y++) {
|
|
171
|
+
k = p[y];
|
|
172
|
+
for (let u = 0; u < k.childNodes.length; u++)
|
|
173
|
+
k.childNodes[u].innerHTML = s[y][u];
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
inputOn(e, r, l, i) {
|
|
179
|
+
if (typeof e != "string") {
|
|
180
|
+
console.error('aKeyboard: The inputEle parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (typeof r != "string") {
|
|
184
|
+
console.error('aKeyboard: The type parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const o = document.querySelector(e), s = document.querySelectorAll(this.obj.el + " .akeyboard-keyboard-keys");
|
|
188
|
+
for (let n = 0; n < s.length; n++)
|
|
189
|
+
if (!["Shift", "Caps"].includes(s[n].innerHTML)) {
|
|
190
|
+
if (s[n].innerHTML === "Delete") {
|
|
191
|
+
s[n].onclick = function() {
|
|
192
|
+
o[r] = o[r].substr(0, o[r].length - 1), l("Delete", o[r]);
|
|
193
|
+
};
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
if (s[n].innerHTML === "Tab") {
|
|
197
|
+
s[n].onclick = function() {
|
|
198
|
+
o[r] += " ", l("Tab", o[r]);
|
|
199
|
+
};
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
if (s[n].innerHTML === "Enter") {
|
|
203
|
+
s[n].onclick = function() {
|
|
204
|
+
o[r] += `
|
|
205
|
+
`, l("Enter", o[r]);
|
|
206
|
+
};
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
if (s[n].innerHTML === "Space") {
|
|
210
|
+
s[n].onclick = function() {
|
|
211
|
+
o[r] += " ", l("Space", o[r]);
|
|
212
|
+
};
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
i && typeof i == "object" && Object.keys(i).length > 0 && i[s[n].innerHTML] ? s[n].onclick = i[s[n].innerHTML] : s[n].onclick = function() {
|
|
216
|
+
o[r] += this.innerText, l(this.innerText, o[r]);
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
onclick(e, r) {
|
|
221
|
+
if (typeof e != "string") {
|
|
222
|
+
console.error('aKeyboard: The btn parameter needs to be a string <In "aKeyboard.onclick()">');
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (typeof r != "function") {
|
|
226
|
+
console.error('aKeyboard: The fn parameter needs to be a function <In "aKeyboard.onclick()">');
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
let l = document.querySelector(this.obj.el + " .akeyboard-keyboard-keys-" + e);
|
|
230
|
+
l ? l.onclick = r : console.error("Can not find key: " + e);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
class E {
|
|
234
|
+
constructor(e) {
|
|
235
|
+
if (typeof e != "object") {
|
|
236
|
+
console.error('aKeyboard: The obj parameter needs to be an object <In "new aKeyboard()">');
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
this.obj = e;
|
|
240
|
+
const r = document.querySelector(e.el);
|
|
241
|
+
let l = "";
|
|
242
|
+
if (typeof e.style == "object")
|
|
243
|
+
for (let o in e.style)
|
|
244
|
+
l += o + ": " + e.style[o] + ";";
|
|
245
|
+
let i = '<div class="akeyboard-numberKeyboard' + (e.fixedBottomCenter ? " akeyboard-keyboard-fixedBottomCenter" : "") + '" style="' + l + '">';
|
|
246
|
+
i += '<div class="akeyboard-keyboard-innerKeys">';
|
|
247
|
+
for (let o = 1; o < 10; o++)
|
|
248
|
+
i += '<div class="akeyboard-keyboard-keys akeyboard-keyboard-keys-' + o + '">' + o + "</div>", o % 3 === 0 && (i += '</div><div class="akeyboard-keyboard-innerKeys">');
|
|
249
|
+
i += '<div class="akeyboard-keyboard-keys akeyboard-keyboard-keys-0">0</div><div class="akeyboard-keyboard-keys akeyboard-keyboard-keys-Delete">Delete</div></div><div class="akeyboard-keyboard-innerKeys"><div class="akeyboard-keyboard-keys akeyboard-numberKeyboard-keys-Enter">Enter</div></div>', i += "</div>", r.innerHTML = i;
|
|
250
|
+
}
|
|
251
|
+
inputOn(e, r, l, i) {
|
|
252
|
+
if (typeof e != "string") {
|
|
253
|
+
console.error('aKeyboard: The inputEle parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (typeof r != "string") {
|
|
257
|
+
console.error('aKeyboard: The type parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const o = document.querySelector(e), s = document.querySelectorAll(this.obj.el + " .akeyboard-keyboard-keys");
|
|
261
|
+
for (let n = 0; n < s.length; n++) {
|
|
262
|
+
if (s[n].innerHTML === "Delete") {
|
|
263
|
+
s[n].onclick = function() {
|
|
264
|
+
o[r] = o[r].substr(0, o[r].length - 1), l("Delete", o[r]);
|
|
265
|
+
};
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
if (s[n].innerHTML === "Enter") {
|
|
269
|
+
s[n].onclick = function() {
|
|
270
|
+
o[r] += `
|
|
271
|
+
`, l("Enter", o[r]);
|
|
272
|
+
};
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
i && typeof i == "object" && Object.keys(i).length > 0 && i[s[n].innerHTML] ? s[n].onclick = i[s[n].innerHTML] : s[n].onclick = function() {
|
|
276
|
+
o[r] += this.innerText, l(this.innerText, o[r]);
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
onclick(e, r) {
|
|
281
|
+
if (typeof e != "string") {
|
|
282
|
+
console.error('aKeyboard: The btn parameter needs to be a string <In "aKeyboard.onclick()">');
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
if (typeof r != "function") {
|
|
286
|
+
console.error('aKeyboard: The fn parameter needs to be a function <In "aKeyboard.onclick()">');
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
let l = document.querySelector(this.obj.el + " .akeyboard-keyboard-keys-" + e);
|
|
290
|
+
l ? l.onclick = r : console.error("Can not find key: " + e);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
var _ = function() {
|
|
294
|
+
var d = this, e = d.$createElement, r = d._self._c || e;
|
|
295
|
+
return r("div", {
|
|
296
|
+
class: ["avue-keyboard", d.className]
|
|
297
|
+
}, [r("div", {
|
|
298
|
+
attrs: {
|
|
299
|
+
id: "keyboard"
|
|
300
|
+
}
|
|
301
|
+
})]);
|
|
302
|
+
}, L = [];
|
|
303
|
+
const M = {
|
|
304
|
+
name: "Keyboard",
|
|
305
|
+
props: {
|
|
306
|
+
ele: {
|
|
307
|
+
type: String,
|
|
308
|
+
required: !0
|
|
309
|
+
},
|
|
310
|
+
keys: Array,
|
|
311
|
+
theme: {
|
|
312
|
+
type: String,
|
|
313
|
+
default: "default",
|
|
314
|
+
validator: (d) => ["default", "dark", "green", "classic"].includes(d)
|
|
315
|
+
},
|
|
316
|
+
type: {
|
|
317
|
+
type: String,
|
|
318
|
+
default: "default",
|
|
319
|
+
validator: (d) => ["default", "number", "mobile"].includes(d)
|
|
320
|
+
},
|
|
321
|
+
fixedBottomCenter: {
|
|
322
|
+
type: Boolean,
|
|
323
|
+
default: !1
|
|
324
|
+
},
|
|
325
|
+
rebind: {
|
|
326
|
+
type: Boolean,
|
|
327
|
+
default: !0
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
data() {
|
|
331
|
+
return {
|
|
332
|
+
customClick: {}
|
|
333
|
+
};
|
|
334
|
+
},
|
|
335
|
+
computed: {
|
|
336
|
+
className() {
|
|
337
|
+
return `avue-keyboard--${this.theme}`;
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
watch: {
|
|
341
|
+
ele() {
|
|
342
|
+
this.init();
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
mounted() {
|
|
346
|
+
this.init();
|
|
347
|
+
},
|
|
348
|
+
methods: {
|
|
349
|
+
init() {
|
|
350
|
+
if (!this.ele)
|
|
351
|
+
return;
|
|
352
|
+
let d;
|
|
353
|
+
const e = {
|
|
354
|
+
el: "#keyboard",
|
|
355
|
+
style: {},
|
|
356
|
+
keys: this.keys,
|
|
357
|
+
fixedBottomCenter: this.fixedBottomCenter
|
|
358
|
+
};
|
|
359
|
+
this.type === "default" ? d = new T(e) : this.type === "number" ? d = new E(e) : this.type === "mobile" && (d = new MobileKeyBoard(e));
|
|
360
|
+
const r = this.ele.indexOf("#") === 0 ? this.ele.substring(1) : this.ele;
|
|
361
|
+
d.inputOn(`#${r}`, "value", (l, i) => {
|
|
362
|
+
this.$emit("click", l, i);
|
|
363
|
+
}, this.rebind ? this.customClick : null), this.keyboard = d;
|
|
364
|
+
},
|
|
365
|
+
bindClick(d, e) {
|
|
366
|
+
this.keyboard.onclick(d, e), this.customClick[d] = e;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}, g = {};
|
|
370
|
+
var C = /* @__PURE__ */ S(
|
|
371
|
+
M,
|
|
372
|
+
_,
|
|
373
|
+
L,
|
|
374
|
+
!1,
|
|
375
|
+
H,
|
|
376
|
+
null,
|
|
377
|
+
null,
|
|
378
|
+
null
|
|
379
|
+
);
|
|
380
|
+
function H(d) {
|
|
381
|
+
for (let e in g)
|
|
382
|
+
this[e] = g[e];
|
|
383
|
+
}
|
|
384
|
+
const I = /* @__PURE__ */ function() {
|
|
385
|
+
return C.exports;
|
|
386
|
+
}();
|
|
387
|
+
export {
|
|
388
|
+
I as default
|
|
389
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.avue-keyboard--default .akeyboard-keyboard{height:100%;width:100%;background:#f0f0f0;border-radius:5px;padding:9px 5px 5px;box-sizing:border-box}.avue-keyboard--default .akeyboard-keyboard-innerKeys{text-align:center}.avue-keyboard--default .akeyboard-keyboard-keys{height:40px;min-width:40px;padding:0 10px;border-radius:5px;background:white;display:inline-block;line-height:40px;text-align:center;box-sizing:border-box;margin:4px;cursor:pointer;user-select:none}.avue-keyboard--default .akeyboard-keyboard-keys:hover{background:#1e9fff;color:#fff}.avue-keyboard--default .akeyboard-keyboard-keys-Delete,.avue-keyboard--default .akeyboard-keyboard-keys-Tab{width:80px}.avue-keyboard--default .akeyboard-keyboard-keys-Caps{width:77px}.avue-keyboard--default .akeyboard-keyboard-keys-Enter{width:90px}.avue-keyboard--default .akeyboard-keyboard-keys-Shift{width:106px}.avue-keyboard--default .akeyboard-keyboard-keys-Space{width:350px}.avue-keyboard--default .keyboard-keyboard-keys-focus{background:#1e9fff;color:#fff}.avue-keyboard--default .akeyboard-keyboard-fixedBottomCenter{width:100%!important;height:auto!important;position:fixed;bottom:0px;left:0px;border-radius:0!important}.avue-keyboard--default .akeyboard-numberKeyboard{height:100%;width:100%;background:#f0f0f0;border-radius:5px;padding:10px 5px 5px;box-sizing:border-box}.avue-keyboard--default .akeyboard-numberKeyboard-keys-Enter{height:40px;width:100px}.avue-keyboard--default .akeyboard-mobileKeyboard{height:100%;width:100%;background:#f0f0f0;border-radius:5px;padding:11px 5px 5px;box-sizing:border-box}.avue-keyboard--default .akeyboard-mobileKeyboard-keys{height:25px;min-width:25px;padding:0 10px;border-radius:3px;background:white;display:inline-block;line-height:25px;text-align:center;box-sizing:border-box;margin:3px 2px 2px;cursor:pointer;user-select:none;font-size:10px}.avue-keyboard--default .akeyboard-mobileKeyboard-keys:hover{background:#1e9fff!important;color:#fff}.avue-keyboard--default .akeyboard-mobileKeyboard-keys-\21e7 ,.avue-keyboard--default .akeyboard-mobileKeyboard-keys-\21e6 {width:25px;background-color:#999faf}.avue-keyboard--default .akeyboard-mobileKeyboard-keys-Space{height:28px;width:100px;line-height:28px;margin-left:55px}.avue-keyboard--default .akeyboard-mobileKeyboard-keys-Enter{height:28px;width:55px;line-height:28px;background:#1e9fff!important;color:#fff}.avue-keyboard--default .akeyboard-mobileKeyboard-keys-focus{background:#1e9fff!important;color:#fff}.avue-keyboard--green .akeyboard-keyboard{height:100%;width:100%;background:#003300;border-radius:5px;padding:9px 5px 5px;box-sizing:border-box}.avue-keyboard--green .akeyboard-keyboard-innerKeys{text-align:center}.avue-keyboard--green .akeyboard-keyboard-keys{height:40px;min-width:40px;padding:0 10px;border-radius:5px;background:#cccc99;display:inline-block;line-height:40px;text-align:center;box-sizing:border-box;margin:4px;cursor:pointer;user-select:none}.avue-keyboard--green .akeyboard-keyboard-keys:hover{background:#669933;color:#fff}.avue-keyboard--green .akeyboard-keyboard-keys-Delete,.avue-keyboard--green .akeyboard-keyboard-keys-Tab{width:80px}.avue-keyboard--green .akeyboard-keyboard-keys-Caps{width:77px}.avue-keyboard--green .akeyboard-keyboard-keys-Enter{width:90px}.avue-keyboard--green .akeyboard-keyboard-keys-Shift{width:106px}.avue-keyboard--green .akeyboard-keyboard-keys-Space{width:350px}.avue-keyboard--green .keyboard-keyboard-keys-focus{background:#669933;color:#fff}.avue-keyboard--green .akeyboard-keyboard-fixedBottomCenter{width:100%!important;height:auto!important;position:fixed;bottom:0px;left:0px;border-radius:0!important}.avue-keyboard--green .akeyboard-numberKeyboard{height:100%;width:100%;background:#003300;border-radius:5px;padding:10px 5px 5px;box-sizing:border-box}.avue-keyboard--green .akeyboard-numberKeyboard-keys-Enter{height:40px;width:100px}.avue-keyboard--green .akeyboard-mobileKeyboard{height:100%;width:100%;background:#003300;border-radius:5px;padding:11px 5px 5px;box-sizing:border-box}.avue-keyboard--green .akeyboard-mobileKeyboard-keys{height:25px;min-width:25px;padding:0 10px;border-radius:3px;background:#cccc99;display:inline-block;line-height:25px;text-align:center;box-sizing:border-box;margin:3px 2px 2px;cursor:pointer;user-select:none;font-size:10px}.avue-keyboard--green .akeyboard-mobileKeyboard-keys:hover{background:#669933!important;color:#fff}.avue-keyboard--green .akeyboard-mobileKeyboard-keys-\21e7 ,.avue-keyboard--green .akeyboard-mobileKeyboard-keys-\21e6 {width:25px;background-color:#999faf}.avue-keyboard--green .akeyboard-mobileKeyboard-keys-Space{height:28px;width:100px;line-height:28px;margin-left:55px}.avue-keyboard--green .akeyboard-mobileKeyboard-keys-Enter{height:28px;width:55px;line-height:28px;background:#669933!important;color:#fff}.avue-keyboard--green .akeyboard-mobileKeyboard-keys-focus{background:#669933!important;color:#fff}.avue-keyboard--dark .akeyboard-keyboard{height:100%;width:100%;background:black;color:#fff;border-radius:5px;padding:9px 5px 5px;box-sizing:border-box}.avue-keyboard--dark .akeyboard-keyboard-innerKeys{text-align:center}.avue-keyboard--dark .akeyboard-keyboard-keys{height:40px;min-width:40px;padding:0 10px;border-radius:5px;background:#393d49;color:#fff;display:inline-block;line-height:40px;text-align:center;box-sizing:border-box;margin:4px;cursor:pointer;user-select:none}.avue-keyboard--dark .akeyboard-keyboard-keys:hover{background:#1e9fff}.avue-keyboard--dark .akeyboard-keyboard-keys-Delete,.avue-keyboard--dark .akeyboard-keyboard-keys-Tab{width:80px}.avue-keyboard--dark .akeyboard-keyboard-keys-Caps{width:77px}.avue-keyboard--dark .akeyboard-keyboard-keys-Enter{width:90px}.avue-keyboard--dark .akeyboard-keyboard-keys-Shift{width:106px}.avue-keyboard--dark .akeyboard-keyboard-keys-Space{width:350px}.avue-keyboard--dark .keyboard-keyboard-keys-focus{background:#1e9fff}.avue-keyboard--dark .akeyboard-keyboard-fixedBottomCenter{width:100%!important;height:auto!important;position:fixed;bottom:0px;left:0px;border-radius:0!important}.avue-keyboard--dark .akeyboard-numberKeyboard{height:100%;width:100%;background:black;border-radius:5px;padding:10px 5px 5px;box-sizing:border-box}.avue-keyboard--dark .akeyboard-numberKeyboard-keys-Enter{height:40px;width:100px}.avue-keyboard--dark .akeyboard-mobileKeyboard{height:100%;width:100%;background:black;border-radius:5px;padding:11px 5px 5px;box-sizing:border-box}.avue-keyboard--dark .akeyboard-mobileKeyboard-keys{height:25px;min-width:25px;padding:0 10px;border-radius:3px;background:#393d49;color:#fff;display:inline-block;line-height:25px;text-align:center;box-sizing:border-box;margin:3px 2px 2px;cursor:pointer;user-select:none;font-size:10px}.avue-keyboard--dark .akeyboard-mobileKeyboard-keys:hover{background:#1e9fff!important;color:#fff}.avue-keyboard--dark .akeyboard-mobileKeyboard-keys-\21e7 ,.avue-keyboard--dark .akeyboard-mobileKeyboard-keys-\21e6 {width:25px;background-color:#999faf}.avue-keyboard--dark .akeyboard-mobileKeyboard-keys-Space{height:28px;width:100px;line-height:28px;margin-left:55px}.avue-keyboard--dark .akeyboard-mobileKeyboard-keys-Enter{height:28px;width:55px;line-height:28px;background:#1e9fff!important;color:#fff}.avue-keyboard--dark .akeyboard-mobileKeyboard-keys-focus{background:#1e9fff!important;color:#fff}.avue-keyboard--classic .akeyboard-keyboard{height:100%;width:100%;background:#2f4056;border-radius:5px;padding:9px 5px 5px;box-sizing:border-box}.avue-keyboard--classic .akeyboard-keyboard-innerKeys{text-align:center}.avue-keyboard--classic .akeyboard-keyboard-keys{height:40px;min-width:40px;padding:0 10px;border-radius:5px;background:white;display:inline-block;line-height:40px;text-align:center;box-sizing:border-box;margin:4px;cursor:pointer;user-select:none}.avue-keyboard--classic .akeyboard-keyboard-keys:hover{background:#c2c2c2;color:#fff}.avue-keyboard--classic .akeyboard-keyboard-keys-Delete,.avue-keyboard--classic .akeyboard-keyboard-keys-Tab{width:80px}.avue-keyboard--classic .akeyboard-keyboard-keys-Caps{width:77px}.avue-keyboard--classic .akeyboard-keyboard-keys-Enter{width:90px}.avue-keyboard--classic .akeyboard-keyboard-keys-Shift{width:106px}.avue-keyboard--classic .akeyboard-keyboard-keys-Space{width:350px}.avue-keyboard--classic .keyboard-keyboard-keys-focus{background:#c2c2c2;color:#fff}.avue-keyboard--classic .akeyboard-keyboard-fixedBottomCenter{width:100%!important;height:auto!important;position:fixed;bottom:0px;left:0px;border-radius:0!important}.avue-keyboard--classic .akeyboard-numberKeyboard{height:100%;width:100%;background:#2f4056;border-radius:5px;padding:10px 5px 5px;box-sizing:border-box}.avue-keyboard--classic .akeyboard-numberKeyboard-keys-Enter{height:40px;width:100px}.avue-keyboard--classic .akeyboard-mobileKeyboard{height:100%;width:100%;background:#2f4056;border-radius:5px;padding:11px 5px 5px;box-sizing:border-box}.avue-keyboard--classic .akeyboard-mobileKeyboard-keys{height:25px;min-width:25px;padding:0 10px;border-radius:3px;background:white;display:inline-block;line-height:25px;text-align:center;box-sizing:border-box;margin:3px 2px 2px;cursor:pointer;user-select:none;font-size:10px}.avue-keyboard--classic .akeyboard-mobileKeyboard-keys:hover{background:#c2c2c2!important;color:#fff}.avue-keyboard--classic .akeyboard-mobileKeyboard-keys-\21e7 ,.avue-keyboard--classic .akeyboard-mobileKeyboard-keys-\21e6 {width:25px;background-color:#999faf}.avue-keyboard--classic .akeyboard-mobileKeyboard-keys-Space{height:28px;width:100px;line-height:28px;margin-left:55px}.avue-keyboard--classic .akeyboard-mobileKeyboard-keys-Enter{height:28px;width:55px;line-height:28px;background:#c2c2c2!important;color:#fff}.avue-keyboard--classic .akeyboard-mobileKeyboard-keys-focus{background:#c2c2c2!important;color:#fff}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { z as l } from "../../chunks/util.5053d54e.js";
|
|
2
|
+
import { n as g } from "../../chunks/vueComponentNormalizer.71e2aa87.js";
|
|
3
|
+
var m = function() {
|
|
4
|
+
var t = this, e = t.$createElement, s = t._self._c || e;
|
|
5
|
+
return s("div", {
|
|
6
|
+
staticClass: "avue-license",
|
|
7
|
+
staticStyle: {
|
|
8
|
+
position: "relative"
|
|
9
|
+
}
|
|
10
|
+
}, [s("canvas", {
|
|
11
|
+
ref: "canvas",
|
|
12
|
+
attrs: {
|
|
13
|
+
id: "canvas" + t.id
|
|
14
|
+
}
|
|
15
|
+
}), t._t("default")], 2);
|
|
16
|
+
}, f = [];
|
|
17
|
+
const w = {
|
|
18
|
+
name: "License",
|
|
19
|
+
props: {
|
|
20
|
+
id: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ""
|
|
23
|
+
},
|
|
24
|
+
option: {
|
|
25
|
+
type: Object,
|
|
26
|
+
default: () => ({})
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
base64: "",
|
|
32
|
+
draw: !1,
|
|
33
|
+
canvas: "",
|
|
34
|
+
context: ""
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
computed: {
|
|
38
|
+
img() {
|
|
39
|
+
return this.option.img;
|
|
40
|
+
},
|
|
41
|
+
list() {
|
|
42
|
+
return this.option.list || [];
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
watch: {
|
|
46
|
+
option: {
|
|
47
|
+
handler() {
|
|
48
|
+
this.init();
|
|
49
|
+
},
|
|
50
|
+
deep: !0
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
mounted() {
|
|
54
|
+
this.canvas = document.getElementById("canvas" + this.id), this.context = this.canvas.getContext("2d"), this.init();
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
init() {
|
|
58
|
+
this.draw = !1;
|
|
59
|
+
const t = new Image();
|
|
60
|
+
t.src = this.img, t.onload = () => {
|
|
61
|
+
const e = this.option.width || t.width, s = this.option.width ? t.height / t.width * this.option.width : t.height;
|
|
62
|
+
this.$refs.canvas.width = e, this.$refs.canvas.height = s, this.context.clearRect(0, 0, e, s), this.context.drawImage(t, 0, 0, e, s), this.list.forEach((i, a) => {
|
|
63
|
+
const o = () => {
|
|
64
|
+
a === this.list.length - 1 && setTimeout(() => {
|
|
65
|
+
this.draw = !0;
|
|
66
|
+
}, 0);
|
|
67
|
+
};
|
|
68
|
+
if (i.img) {
|
|
69
|
+
const n = new Image();
|
|
70
|
+
n.src = i.img, n.onload = () => {
|
|
71
|
+
const h = i.width || n.width, c = i.width ? n.height / n.width * i.width : n.height;
|
|
72
|
+
this.context.drawImage(n, i.left, i.top, h, c), o();
|
|
73
|
+
};
|
|
74
|
+
} else
|
|
75
|
+
i.bold ? this.context.font = `bold ${i.size}px ${i.style}` : this.context.font = `${i.size}px ${i.style}`, this.context.fillStyle = i.color, this.context.fillText(i.text, i.left, i.top), this.context.stroke(), o();
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
getFile(t = new Date().getTime()) {
|
|
80
|
+
return new Promise((e) => {
|
|
81
|
+
const s = setInterval(() => {
|
|
82
|
+
if (this.draw) {
|
|
83
|
+
const i = this.canvas.toDataURL("image/jpeg", 1), a = this.dataURLtoFile(i, t);
|
|
84
|
+
clearInterval(s), e(a);
|
|
85
|
+
}
|
|
86
|
+
}, 1e3);
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
downFile(t = new Date().getTime()) {
|
|
90
|
+
l(this.base64, t);
|
|
91
|
+
},
|
|
92
|
+
getBase64() {
|
|
93
|
+
return new Promise((t) => {
|
|
94
|
+
const e = setInterval(() => {
|
|
95
|
+
if (this.draw) {
|
|
96
|
+
const s = this.canvas.toDataURL("image/jpeg", 1);
|
|
97
|
+
this.base64 = s, clearInterval(e), t(s);
|
|
98
|
+
}
|
|
99
|
+
}, 100);
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
getPdf(t = new Date().getTime()) {
|
|
103
|
+
const e = this.canvas.width, s = this.canvas.height, i = e / 592.28 * 841.89;
|
|
104
|
+
let a = s, o = 0;
|
|
105
|
+
const n = 595.28, h = 592.28 / e * s, c = this.canvas.toDataURL("image/jpeg", 1), r = new window.jsPDF("", "pt", "a4");
|
|
106
|
+
if (a < i)
|
|
107
|
+
r.addImage(c, "JPEG", 0, 0, n, h);
|
|
108
|
+
else
|
|
109
|
+
for (; a > 0; )
|
|
110
|
+
r.addImage(c, "JPEG", 0, o, n, h), a -= i, o -= 841.89, a > 0 && r.addPage();
|
|
111
|
+
r.save(`${t}.pdf`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, d = {};
|
|
115
|
+
var p = /* @__PURE__ */ g(
|
|
116
|
+
w,
|
|
117
|
+
m,
|
|
118
|
+
f,
|
|
119
|
+
!1,
|
|
120
|
+
v,
|
|
121
|
+
null,
|
|
122
|
+
null,
|
|
123
|
+
null
|
|
124
|
+
);
|
|
125
|
+
function v(t) {
|
|
126
|
+
for (let e in d)
|
|
127
|
+
this[e] = d[e];
|
|
128
|
+
}
|
|
129
|
+
const _ = /* @__PURE__ */ function() {
|
|
130
|
+
return p.exports;
|
|
131
|
+
}();
|
|
132
|
+
export {
|
|
133
|
+
_ as default
|
|
134
|
+
};
|