@web-utils/component 2.7.29 → 2.7.31
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.7dec2bf2.js → config.75161c38.js} +29 -29
- package/dist/chunks/confirmable-mixin.851d6299.js +137 -0
- package/dist/chunks/dataformat.b8c8c01a.js +237 -0
- package/dist/chunks/detail.6135ade5.js +55 -0
- package/dist/chunks/dic.e57b75f2.js +215 -0
- package/dist/chunks/{event.fc358074.js → event.812c361c.js} +54 -23
- package/dist/chunks/{form-input-mixin.760cd65d.js → form-input-mixin.3e63b57f.js} +4 -4
- package/dist/chunks/{form-item-mixin.fa314b67.js → form-item-mixin.a56c101a.js} +44 -17
- package/dist/chunks/{form-pick-mixin.c4e0391b.js → form-pick-mixin.822300f3.js} +1 -1
- package/dist/chunks/{init.e0133910.js → init.38cbb3a2.js} +41 -21
- package/dist/chunks/{input-number-mixin.6849fa63.js → input-number-mixin.44b78389.js} +4 -4
- package/dist/chunks/{mixins.6a394a6c.js → mixins.e1939731.js} +3 -2
- package/dist/chunks/{packages.419bde01.js → packages.c4ea639d.js} +12 -6
- package/dist/chunks/{permission.07c49abf.js → permission.9c766972.js} +6 -1
- package/dist/chunks/slot.55598d0f.js +35 -0
- package/dist/chunks/{tab-mixin.9d568df9.js → tab-mixin.9d848bf6.js} +29 -11
- package/dist/chunks/util.b0d0b0ad.js +478 -0
- package/dist/chunks/{utils.d7f73f8d.js → utils.2a3ffac9.js} +89 -24
- package/dist/chunks/{utils.f44207f4.js → utils.a8891d2c.js} +9 -5
- package/dist/chunks/vueComponentNormalizer.9c6b8b3d.js +59 -0
- package/dist/components/address-input/index.js +30 -17
- package/dist/components/address-input/style.css +15 -1
- package/dist/components/affix/index.js +78 -28
- package/dist/components/affix/style.css +5 -1
- package/dist/components/aside-menu/index.js +14 -8
- package/dist/components/aside-menu/style.css +9 -1
- package/dist/components/avatar/index.js +33 -15
- package/dist/components/avatar/style.css +57 -1
- package/dist/components/awesome-button/index.js +45 -31
- package/dist/components/base.css +410 -1
- package/dist/components/capsule-tab/index.js +13 -7
- package/dist/components/capsule-tab/style.css +32 -1
- package/dist/components/card/index.js +33 -20
- package/dist/components/card/style.css +90 -1
- package/dist/components/carousel/index.js +18 -12
- package/dist/components/carousel/style.css +41 -1
- package/dist/components/chat/index.js +245 -139
- package/dist/components/chat/style.css +279 -1
- package/dist/components/chunk-file-uploader/index.js +63 -29
- package/dist/components/chunk-file-uploader/style.css +4 -1
- package/dist/components/chunk-file-uploader-button/index.js +15 -9
- package/dist/components/chunk-file-uploader-button/style.css +17 -1
- package/dist/components/chunk-file-uploader-drop/index.js +45 -27
- package/dist/components/chunk-file-uploader-drop/style.css +12 -1
- package/dist/components/chunk-file-uploader-file/index.js +150 -73
- package/dist/components/chunk-file-uploader-file/style.css +125 -1
- package/dist/components/chunk-file-uploader-files/index.js +15 -9
- package/dist/components/chunk-file-uploader-files/style.css +9 -1
- package/dist/components/chunk-file-uploader-list/index.js +16 -10
- package/dist/components/chunk-file-uploader-list/style.css +9 -1
- package/dist/components/chunk-file-uploader-un-support/index.js +18 -10
- package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
- package/dist/components/code-mirror-editor/index.js +75 -47
- package/dist/components/code-mirror-editor/style.css +17 -1
- package/dist/components/color-picker/index.js +62 -39
- package/dist/components/column/index.js +54 -29
- package/dist/components/column-default/index.js +47 -33
- package/dist/components/column-dynamic/index.js +26 -19
- package/dist/components/column-menu/index.js +98 -86
- package/dist/components/column-slot/index.js +135 -75
- package/dist/components/comment/index.js +28 -15
- package/dist/components/comment/style.css +92 -1
- package/dist/components/confirm-button/index.js +7 -5
- package/dist/components/confirmable/index.js +5 -4
- package/dist/components/context-menu/index.js +54 -32
- package/dist/components/context-menu/style.css +88 -1
- package/dist/components/count-up/index.js +55 -38
- package/dist/components/custom-scrollbar/index.js +45 -21
- package/dist/components/data-box/index.js +22 -16
- package/dist/components/data-box/style.css +58 -1
- package/dist/components/data-card/index.js +21 -15
- package/dist/components/data-card/style.css +46 -1
- package/dist/components/data-cardtext/index.js +19 -13
- package/dist/components/data-cardtext/style.css +36 -1
- package/dist/components/data-display/index.js +22 -16
- package/dist/components/data-display/style.css +37 -1
- package/dist/components/data-icons/index.js +23 -17
- package/dist/components/data-icons/style.css +53 -1
- package/dist/components/data-imgtext/index.js +26 -20
- package/dist/components/data-imgtext/style.css +70 -1
- package/dist/components/data-operatext/index.js +20 -14
- package/dist/components/data-operatext/style.css +81 -1
- package/dist/components/data-panel/index.js +21 -15
- package/dist/components/data-panel/style.css +37 -1
- package/dist/components/data-pay/index.js +29 -23
- package/dist/components/data-pay/style.css +102 -1
- package/dist/components/data-price/index.js +19 -13
- package/dist/components/data-price/style.css +81 -1
- package/dist/components/data-progress/index.js +26 -20
- package/dist/components/data-progress/style.css +30 -1
- package/dist/components/data-rotate/index.js +21 -15
- package/dist/components/data-rotate/style.css +50 -1
- package/dist/components/data-table-picker/index.js +47 -28
- package/dist/components/data-tabs/index.js +22 -16
- package/dist/components/data-tabs/style.css +70 -1
- package/dist/components/dialog-column/index.js +46 -33
- package/dist/components/dialog-excel/index.js +102 -53
- package/dist/components/dialog-filter/index.js +64 -51
- package/dist/components/dialog-form/index.js +56 -115
- package/dist/components/dialog-form/style.css +10 -1
- package/dist/components/dynamic-table/index.js +66 -42
- package/dist/components/dynamic-table/style.css +30 -1
- package/dist/components/e-charts/index.js +127 -46
- package/dist/components/e-charts/style.css +10 -1
- package/dist/components/easy-popup/index.js +32 -14
- package/dist/components/easy-popup/style.css +18 -1
- package/dist/components/editable-progress/index.js +64 -31
- package/dist/components/editable-progress/style.css +37 -1
- package/dist/components/editable-tree/index.js +513 -287
- package/dist/components/editable-tree/style.css +82 -1
- package/dist/components/egd-collapse/index.js +25 -12
- package/dist/components/egd-collapse-item/index.js +41 -25
- package/dist/components/element-dialog/index.js +101 -48
- package/dist/components/element-dialog/style.css +88 -1
- package/dist/components/empty-view/index.js +13 -7
- package/dist/components/empty-view/style.css +17 -1
- package/dist/components/error-view/index.js +12 -6
- package/dist/components/error-view/style.css +17 -1
- package/dist/components/flex-column/index.js +39 -17
- package/dist/components/flex-item/index.js +59 -24
- package/dist/components/flex-row/index.js +39 -17
- package/dist/components/flex-scroller/index.js +13 -7
- package/dist/components/flex-scroller/style.css +20 -1
- package/dist/components/flow/index.js +116 -64
- package/dist/components/flow/style.css +44 -1
- package/dist/components/flow-node/index.js +29 -21
- package/dist/components/flow-viewer/index.js +97 -52
- package/dist/components/flow-viewer/style.css +19 -1
- package/dist/components/form-button/index.js +12 -8
- package/dist/components/form-cascader/index.js +55 -40
- package/dist/components/form-checkbox-group/index.js +90 -60
- package/dist/components/form-checkbox-group/style.css +51 -1
- package/dist/components/form-date-picker/index.js +113 -44
- package/dist/components/form-group/index.js +23 -17
- package/dist/components/form-group/style.css +76 -1
- package/dist/components/form-holder/index.js +41 -30
- package/dist/components/form-input/index.js +42 -31
- package/dist/components/form-input-email/index.js +47 -30
- package/dist/components/form-input-id-card/index.js +40 -29
- package/dist/components/form-input-number/index.js +50 -38
- package/dist/components/form-input-number/style.css +12 -1
- package/dist/components/form-input-phone-number/index.js +40 -29
- package/dist/components/form-input-time/index.js +40 -29
- package/dist/components/form-item/index.js +99 -47
- package/dist/components/form-item/style.css +11 -1
- package/dist/components/form-item-config-provider/index.js +9 -8
- package/dist/components/form-item-group/index.js +69 -43
- package/dist/components/form-item-group/style.css +30 -1
- package/dist/components/form-radio-group/index.js +77 -53
- package/dist/components/form-radio-group/style.css +53 -1
- package/dist/components/form-select/index.js +71 -51
- package/dist/components/form-switch/index.js +41 -30
- package/dist/components/form-temp/index.js +49 -29
- package/dist/components/form-textarea/index.js +45 -34
- package/dist/components/form-view/index.js +152 -81
- package/dist/components/form-view/style.css +158 -1
- package/dist/components/fy-array/index.js +51 -43
- package/dist/components/fy-array/style.css +18 -1
- package/dist/components/fy-article/index.js +24 -13
- package/dist/components/fy-article/style.css +40 -1
- package/dist/components/fy-cascader/index.js +39 -29
- package/dist/components/fy-checkbox/index.js +38 -27
- package/dist/components/fy-checkbox/style.css +15 -1
- package/dist/components/fy-code/index.js +19 -12
- package/dist/components/fy-curd/index.js +290 -152
- package/dist/components/fy-curd/style.css +239 -1
- package/dist/components/fy-date/index.js +24 -18
- package/dist/components/fy-date/style.css +21 -1
- package/dist/components/fy-dialog-form/index.js +127 -54
- package/dist/components/fy-draggable/index.js +196 -73
- package/dist/components/fy-draggable/style.css +136 -1
- package/dist/components/fy-dynamic/index.js +116 -73
- package/dist/components/fy-dynamic/style.css +35 -1
- package/dist/components/fy-empty/index.js +15 -9
- package/dist/components/fy-empty/style.css +24 -1
- package/dist/components/fy-form/index.js +399 -221
- package/dist/components/fy-form/style.css +79 -1
- package/dist/components/fy-form-design/index.js +2267 -1630
- package/dist/components/fy-form-design/style.css +578 -1
- package/dist/components/fy-form-menu/index.js +43 -35
- package/dist/components/fy-input/index.js +46 -35
- package/dist/components/fy-input-color/index.js +40 -33
- package/dist/components/fy-input-icon/index.js +58 -37
- package/dist/components/fy-input-icon/style.css +39 -1
- package/dist/components/fy-input-map/index.js +113 -68
- package/dist/components/fy-input-map/style.css +50 -1
- package/dist/components/fy-input-number/index.js +29 -24
- package/dist/components/fy-input-table/index.js +82 -48
- package/dist/components/fy-input-table/style.css +10 -1
- package/dist/components/fy-input-tree/index.js +104 -60
- package/dist/components/fy-input-tree/style.css +25 -1
- package/dist/components/fy-progress/index.js +15 -10
- package/dist/components/fy-radio/index.js +20 -14
- package/dist/components/fy-radio/style.css +12 -1
- package/dist/components/fy-rate/index.js +21 -15
- package/dist/components/fy-rate/style.css +9 -1
- package/dist/components/fy-select/index.js +73 -55
- package/dist/components/fy-select/style.css +25 -1
- package/dist/components/fy-slider/index.js +22 -17
- package/dist/components/fy-switch/index.js +17 -12
- package/dist/components/fy-tabs/index.js +20 -12
- package/dist/components/fy-tabs/style.css +6 -0
- package/dist/components/fy-time/index.js +29 -18
- package/dist/components/fy-title/index.js +16 -8
- package/dist/components/fy-title/style.css +11 -1
- package/dist/components/fy-tree/index.js +135 -72
- package/dist/components/fy-tree/style.css +46 -1
- package/dist/components/fy-u-editor/index.js +172 -67
- package/dist/components/fy-u-editor/style.css +15 -1
- package/dist/components/fy-upload/index.js +317 -148
- package/dist/components/fy-upload/style.css +60 -1
- package/dist/components/guide-steps/index.js +31 -17
- package/dist/components/guide-steps/style.css +34 -1
- package/dist/components/header-menu/index.js +86 -66
- package/dist/components/header-search/index.js +92 -60
- package/dist/components/highlight-j-s/index.js +28 -15
- package/dist/components/highlight-j-s/style.css +21 -1
- package/dist/components/icon-card/index.js +13 -7
- package/dist/components/icon-card/style.css +56 -1
- package/dist/components/icon-temp/index.js +12 -6
- package/dist/components/icon-temp/style.css +21 -1
- package/dist/components/iframe-window/index.js +20 -14
- package/dist/components/iframe-window/style.css +20 -1
- package/dist/components/image-cropper/index.js +71 -162
- package/dist/components/image-cropper/style.css +34 -1
- package/dist/components/image-preview/index.js +78 -170
- package/dist/components/image-preview/style.css +72 -1
- package/dist/components/image-viewer/index.js +40 -22
- package/dist/components/image-viewer/style.css +21 -1
- package/dist/components/input-number/index.js +122 -56
- package/dist/components/input-number/style.css +15 -1
- package/dist/components/input-number-range/index.js +32 -20
- package/dist/components/input-number-range/style.css +12 -1
- package/dist/components/keep-view-alive/index.js +68 -21
- package/dist/components/keyboard/index.js +217 -132
- package/dist/components/keyboard/style.css +547 -1
- package/dist/components/license/index.js +81 -35
- package/dist/components/loading-view/index.js +12 -6
- package/dist/components/loading-view/style.css +17 -1
- package/dist/components/login/index.js +91 -62
- package/dist/components/login/style.css +25 -1
- package/dist/components/name-avatar/index.js +32 -10
- package/dist/components/name-avatar/style.css +35 -1
- package/dist/components/nav-bar/index.js +21 -11
- package/dist/components/nav-bar/style.css +17 -1
- package/dist/components/not-implement/index.js +16 -8
- package/dist/components/not-implement/style.css +15 -1
- package/dist/components/notice/index.js +40 -27
- package/dist/components/notice/style.css +54 -1
- package/dist/components/page/index.js +13 -7
- package/dist/components/page/style.css +12 -1
- package/dist/components/page-header/index.js +15 -9
- package/dist/components/page-header/style.css +14 -1
- package/dist/components/page-index/index.js +62 -37
- package/dist/components/page-index/style.css +23 -1
- package/dist/components/page-index-top/index.js +53 -34
- package/dist/components/page-skeleton/index.js +15 -9
- package/dist/components/page-skeleton/style.css +23 -1
- package/dist/components/page-skeleton-new/index.js +15 -9
- package/dist/components/page-skeleton-new/style.css +42 -1
- package/dist/components/pageable-table/index.js +187 -106
- package/dist/components/pageable-table/style.css +72 -1
- package/dist/components/pageable-view/index.js +164 -80
- package/dist/components/pageable-view/style.css +69 -1
- package/dist/components/photo-swipe/index.js +92 -46
- package/dist/components/process-designer/index.js +961 -772
- package/dist/components/process-designer/style.css +1186 -1
- package/dist/components/properties-panel/index.js +1488 -1044
- package/dist/components/properties-panel/style.css +122 -1
- package/dist/components/queue/index.js +24 -12
- package/dist/components/record-video/index.js +53 -27
- package/dist/components/record-video/style.css +53 -1
- package/dist/components/resize-observer/index.js +52 -18
- package/dist/components/resize-observer/style.css +31 -1
- package/dist/components/search/index.js +41 -22
- package/dist/components/search/style.css +57 -1
- package/dist/components/search-popover/index.js +153 -91
- package/dist/components/search-popover/style.css +93 -1
- package/dist/components/sign/index.js +138 -35
- package/dist/components/sign/style.css +12 -1
- package/dist/components/sign-panel/index.js +96 -46
- package/dist/components/sign-panel/style.css +97 -1
- package/dist/components/skeleton/index.js +22 -12
- package/dist/components/skeleton/style.css +61 -1
- package/dist/components/split-pane/index.js +125 -60
- package/dist/components/split-pane/style.css +100 -1
- package/dist/components/stateful/index.js +8 -5
- package/dist/components/stateful/style.css +33 -1
- package/dist/components/static-pageable-table/index.js +22 -15
- package/dist/components/static-pageable-table/style.css +9 -1
- package/dist/components/swiper/index.js +127 -58
- package/dist/components/swiper/style.css +43 -1
- package/dist/components/tab/index.js +34 -16
- package/dist/components/tab/style.css +122 -1
- package/dist/components/tab-item/index.js +14 -9
- package/dist/components/table-column/index.js +26 -17
- package/dist/components/table-page/index.js +42 -23
- package/dist/components/table-view/index.js +162 -87
- package/dist/components/table-view/style.css +95 -1
- package/dist/components/tag-render/index.js +41 -22
- package/dist/components/tag-render/style.css +33 -1
- package/dist/components/text-ellipsis/index.js +48 -26
- package/dist/components/text-ellipsis/style.css +9 -1
- package/dist/components/tinymce-editor/index.js +80 -60
- package/dist/components/tinymce-editor/style.css +43 -1
- package/dist/components/tinymce-wrapper/index.js +77 -41
- package/dist/components/tinymce-wrapper/style.css +36 -1
- package/dist/components/toolbar/index.js +46 -25
- package/dist/components/toolbar/style.css +39 -1
- package/dist/components/toolbar-button/index.js +46 -35
- package/dist/components/toolbar-button/style.css +21 -1
- package/dist/components/trigger/index.js +15 -8
- package/dist/components/verify/index.js +15 -8
- package/dist/components/verify/style.css +15 -1
- package/dist/components/vue-tags-input/index.js +233 -113
- package/dist/components/vue-tags-input/style.css +688 -1
- package/dist/components/watermark/index.js +33 -14
- package/dist/components/watermark/style.css +11 -1
- package/dist/index.css +2434 -1750
- package/dist/index.es.js +15982 -9409
- package/package.json +4 -4
- package/web-types.json +1 -1
- package/dist/chunks/confirmable-mixin.35bd1934.js +0 -104
- package/dist/chunks/dataformat.9cc4428a.js +0 -158
- package/dist/chunks/detail.544c52b0.js +0 -29
- package/dist/chunks/dic.9de2fe5a.js +0 -135
- package/dist/chunks/slot.a7387ecc.js +0 -27
- package/dist/chunks/util.89913643.js +0 -261
- package/dist/chunks/vueComponentNormalizer.77ec6792.js +0 -32
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.
|
|
2
|
-
let Keyboard$1 = class {
|
|
1
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.9c6b8b3d.js";
|
|
2
|
+
let Keyboard$1 = class Keyboard {
|
|
3
3
|
constructor(obj) {
|
|
4
|
-
if (typeof obj
|
|
4
|
+
if (typeof obj !== "object") {
|
|
5
5
|
console.error('aKeyboard: The obj parameter needs to be an object <In "new aKeyboard()">');
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
8
|
this.obj = obj;
|
|
9
9
|
const el = document.querySelector(obj.el);
|
|
10
10
|
let keyboardStyle = "";
|
|
11
|
-
if (typeof obj.style
|
|
12
|
-
for (const i in obj.style)
|
|
11
|
+
if (typeof obj.style === "object") {
|
|
12
|
+
for (const i in obj.style) {
|
|
13
13
|
keyboardStyle += `${i}: ${obj.style[i]};`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
14
16
|
let html = `<div class="akeyboard-keyboard${obj.fixedBottomCenter ? " akeyboard-keyboard-fixedBottomCenter" : ""}" style="${keyboardStyle}">`;
|
|
15
17
|
const numberKeys = [];
|
|
16
|
-
for (let i = 1; i < 10; i++)
|
|
18
|
+
for (let i = 1; i < 10; i++) {
|
|
17
19
|
numberKeys.push(i.toString());
|
|
20
|
+
}
|
|
18
21
|
numberKeys.push("0");
|
|
19
22
|
const keys = obj.keys || [
|
|
20
23
|
["`"].concat(numberKeys).concat([
|
|
@@ -28,12 +31,16 @@ let Keyboard$1 = class {
|
|
|
28
31
|
["Space"]
|
|
29
32
|
];
|
|
30
33
|
let thisKeys;
|
|
31
|
-
const shiftKey = []
|
|
34
|
+
const shiftKey = [];
|
|
35
|
+
const capsKey = [];
|
|
32
36
|
for (let i = 0; i < keys.length; i++) {
|
|
33
|
-
shiftKey.push([])
|
|
37
|
+
shiftKey.push([]);
|
|
38
|
+
capsKey.push([]);
|
|
39
|
+
thisKeys = keys[i];
|
|
34
40
|
for (let a = 0; a < thisKeys.length; a++) {
|
|
35
41
|
if (thisKeys[a].length === 1) {
|
|
36
|
-
|
|
42
|
+
capsKey[i].push(thisKeys[a].toUpperCase());
|
|
43
|
+
switch (thisKeys[a]) {
|
|
37
44
|
case "`":
|
|
38
45
|
shiftKey[i].push("~");
|
|
39
46
|
continue;
|
|
@@ -101,225 +108,296 @@ let Keyboard$1 = class {
|
|
|
101
108
|
shiftKey[i].push(thisKeys[a].toUpperCase());
|
|
102
109
|
continue;
|
|
103
110
|
}
|
|
104
|
-
shiftKey[i].push(thisKeys[a])
|
|
111
|
+
shiftKey[i].push(thisKeys[a]);
|
|
112
|
+
capsKey[i].push(thisKeys[a]);
|
|
105
113
|
}
|
|
106
114
|
}
|
|
107
115
|
for (let i = 0; i < keys.length; i++) {
|
|
108
|
-
thisKeys = keys[i]
|
|
109
|
-
|
|
116
|
+
thisKeys = keys[i];
|
|
117
|
+
html += '<div class="akeyboard-keyboard-innerKeys">';
|
|
118
|
+
for (let a = 0; a < thisKeys.length; a++) {
|
|
110
119
|
html += `<div class="akeyboard-keyboard-keys akeyboard-keyboard-keys-${thisKeys[a]}">${thisKeys[a]}</div>`;
|
|
120
|
+
}
|
|
111
121
|
html += "</div>";
|
|
112
122
|
}
|
|
113
|
-
html += "</div>"
|
|
114
|
-
|
|
123
|
+
html += "</div>";
|
|
124
|
+
el.innerHTML = html;
|
|
125
|
+
let containShift = false;
|
|
115
126
|
keys.forEach((key) => {
|
|
116
|
-
key.includes("Shift")
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
127
|
+
if (key.includes("Shift")) {
|
|
128
|
+
containShift = true;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
if (containShift) {
|
|
132
|
+
const elKeysEl = document.querySelectorAll(`${obj.el} .akeyboard-keyboard-keys-Shift`);
|
|
133
|
+
elKeysEl.forEach((el2) => {
|
|
134
|
+
el2.onclick = function() {
|
|
135
|
+
if (!this.isShift) {
|
|
136
|
+
const caps = document.querySelector(`${obj.el} .akeyboard-keyboard-keys-Caps`);
|
|
137
|
+
if (caps && caps.isCaps) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
el2.isShift = true;
|
|
141
|
+
el2.innerHTML = "SHIFT";
|
|
142
|
+
this.classList.add("keyboard-keyboard-keys-focus");
|
|
143
|
+
const keysInnerEl2 = document.querySelectorAll(`${obj.el} .akeyboard-keyboard-innerKeys`);
|
|
144
|
+
let thisEl2;
|
|
145
|
+
for (let i = 0; i < keysInnerEl2.length; i++) {
|
|
146
|
+
thisEl2 = keysInnerEl2[i];
|
|
147
|
+
for (let a = 0; a < thisEl2.childNodes.length; a++) {
|
|
148
|
+
if (shiftKey[i][a] === "Shift") {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
thisEl2.childNodes[a].innerHTML = shiftKey[i][a];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
122
154
|
return;
|
|
123
|
-
el2.isShift = !0, el2.innerHTML = "SHIFT", this.classList.add("keyboard-keyboard-keys-focus");
|
|
124
|
-
const keysInnerEl2 = document.querySelectorAll(`${obj.el} .akeyboard-keyboard-innerKeys`);
|
|
125
|
-
let thisEl2;
|
|
126
|
-
for (let i = 0; i < keysInnerEl2.length; i++) {
|
|
127
|
-
thisEl2 = keysInnerEl2[i];
|
|
128
|
-
for (let a = 0; a < thisEl2.childNodes.length; a++)
|
|
129
|
-
shiftKey[i][a] !== "Shift" && (thisEl2.childNodes[a].innerHTML = shiftKey[i][a]);
|
|
130
155
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
156
|
+
el2.isShift = false;
|
|
157
|
+
el2.innerHTML = "Shift";
|
|
158
|
+
this.classList.remove("keyboard-keyboard-keys-focus");
|
|
159
|
+
const keysInnerEl = document.querySelectorAll(`${obj.el} .akeyboard-keyboard-innerKeys`);
|
|
160
|
+
let thisEl;
|
|
161
|
+
for (let i = 0; i < keysInnerEl.length; i++) {
|
|
162
|
+
thisEl = keysInnerEl[i];
|
|
163
|
+
for (let a = 0; a < thisEl.childNodes.length; a++) {
|
|
164
|
+
thisEl.childNodes[a].innerHTML = keys[i][a];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
let containCaps = false;
|
|
144
171
|
keys.forEach((key) => {
|
|
145
|
-
key.includes("Caps")
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
172
|
+
if (key.includes("Caps")) {
|
|
173
|
+
containCaps = true;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
if (containCaps) {
|
|
177
|
+
const elCapsEl = document.querySelectorAll(`${obj.el} .akeyboard-keyboard-keys-Caps`);
|
|
178
|
+
elCapsEl.forEach((el2) => {
|
|
179
|
+
el2.onclick = function() {
|
|
180
|
+
if (!this.isCaps) {
|
|
181
|
+
const shift = document.querySelector(`${obj.el} .akeyboard-keyboard-keys-Shift`);
|
|
182
|
+
if (shift && shift.isShift) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.isCaps = true;
|
|
186
|
+
this.classList.add("keyboard-keyboard-keys-focus");
|
|
187
|
+
const keysInnerEl2 = document.querySelectorAll(`${obj.el} .akeyboard-keyboard-innerKeys`);
|
|
188
|
+
let thisEl2;
|
|
189
|
+
for (let i = 0; i < keysInnerEl2.length; i++) {
|
|
190
|
+
thisEl2 = keysInnerEl2[i];
|
|
191
|
+
for (let a = 0; a < thisEl2.childNodes.length; a++) {
|
|
192
|
+
thisEl2.childNodes[a].innerHTML = capsKey[i][a];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
151
195
|
return;
|
|
152
|
-
this.isCaps = !0, this.classList.add("keyboard-keyboard-keys-focus");
|
|
153
|
-
const keysInnerEl2 = document.querySelectorAll(`${obj.el} .akeyboard-keyboard-innerKeys`);
|
|
154
|
-
let thisEl2;
|
|
155
|
-
for (let i = 0; i < keysInnerEl2.length; i++) {
|
|
156
|
-
thisEl2 = keysInnerEl2[i];
|
|
157
|
-
for (let a = 0; a < thisEl2.childNodes.length; a++)
|
|
158
|
-
thisEl2.childNodes[a].innerHTML = capsKey[i][a];
|
|
159
196
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
197
|
+
this.isCaps = false;
|
|
198
|
+
this.classList.remove("keyboard-keyboard-keys-focus");
|
|
199
|
+
const keysInnerEl = document.querySelectorAll(`${obj.el} .akeyboard-keyboard-innerKeys`);
|
|
200
|
+
let thisEl;
|
|
201
|
+
for (let i = 0; i < keysInnerEl.length; i++) {
|
|
202
|
+
thisEl = keysInnerEl[i];
|
|
203
|
+
for (let a = 0; a < thisEl.childNodes.length; a++) {
|
|
204
|
+
thisEl.childNodes[a].innerHTML = keys[i][a];
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
}
|
|
172
210
|
}
|
|
173
211
|
inputOn(inputEle, type, fn, customClick) {
|
|
174
|
-
if (typeof inputEle
|
|
212
|
+
if (typeof inputEle !== "string") {
|
|
175
213
|
console.error('aKeyboard: The inputEle parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
176
214
|
return;
|
|
177
215
|
}
|
|
178
|
-
if (typeof type
|
|
216
|
+
if (typeof type !== "string") {
|
|
179
217
|
console.error('aKeyboard: The type parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
180
218
|
return;
|
|
181
219
|
}
|
|
182
|
-
const inputEl = document.querySelector(inputEle)
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
elKeysEl[i].onclick = function() {
|
|
193
|
-
inputEl[type] += " ", fn("Tab", inputEl[type]);
|
|
194
|
-
};
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
if (elKeysEl[i].innerHTML === "Enter") {
|
|
198
|
-
elKeysEl[i].onclick = function() {
|
|
199
|
-
inputEl[type] += `
|
|
200
|
-
`, fn("Enter", inputEl[type]);
|
|
201
|
-
};
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
if (elKeysEl[i].innerHTML === "Space") {
|
|
205
|
-
elKeysEl[i].onclick = function() {
|
|
206
|
-
inputEl[type] += " ", fn("Space", inputEl[type]);
|
|
207
|
-
};
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
customClick && typeof customClick == "object" && Object.keys(customClick).length > 0 && customClick[elKeysEl[i].innerHTML] ? elKeysEl[i].onclick = customClick[elKeysEl[i].innerHTML] : elKeysEl[i].onclick = function() {
|
|
211
|
-
inputEl[type] += this.innerText, fn(this.innerText, inputEl[type]);
|
|
220
|
+
const inputEl = document.querySelector(inputEle);
|
|
221
|
+
const elKeysEl = document.querySelectorAll(`${this.obj.el} .akeyboard-keyboard-keys`);
|
|
222
|
+
for (let i = 0; i < elKeysEl.length; i++) {
|
|
223
|
+
if (["Shift", "Caps"].includes(elKeysEl[i].innerHTML)) {
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (elKeysEl[i].innerHTML === "Delete") {
|
|
227
|
+
elKeysEl[i].onclick = function() {
|
|
228
|
+
inputEl[type] = inputEl[type].substr(0, inputEl[type].length - 1);
|
|
229
|
+
fn("Delete", inputEl[type]);
|
|
212
230
|
};
|
|
231
|
+
continue;
|
|
213
232
|
}
|
|
233
|
+
if (elKeysEl[i].innerHTML === "Tab") {
|
|
234
|
+
elKeysEl[i].onclick = function() {
|
|
235
|
+
inputEl[type] += " ";
|
|
236
|
+
fn("Tab", inputEl[type]);
|
|
237
|
+
};
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
if (elKeysEl[i].innerHTML === "Enter") {
|
|
241
|
+
elKeysEl[i].onclick = function() {
|
|
242
|
+
inputEl[type] += "\n";
|
|
243
|
+
fn("Enter", inputEl[type]);
|
|
244
|
+
};
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
if (elKeysEl[i].innerHTML === "Space") {
|
|
248
|
+
elKeysEl[i].onclick = function() {
|
|
249
|
+
inputEl[type] += " ";
|
|
250
|
+
fn("Space", inputEl[type]);
|
|
251
|
+
};
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
if (customClick && typeof customClick === "object" && Object.keys(customClick).length > 0 && customClick[elKeysEl[i].innerHTML]) {
|
|
255
|
+
elKeysEl[i].onclick = customClick[elKeysEl[i].innerHTML];
|
|
256
|
+
} else {
|
|
257
|
+
elKeysEl[i].onclick = function() {
|
|
258
|
+
inputEl[type] += this.innerText;
|
|
259
|
+
fn(this.innerText, inputEl[type]);
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
|
214
263
|
}
|
|
215
264
|
onclick(btn, fn) {
|
|
216
|
-
if (typeof btn
|
|
265
|
+
if (typeof btn !== "string") {
|
|
217
266
|
console.error('aKeyboard: The btn parameter needs to be a string <In "aKeyboard.onclick()">');
|
|
218
267
|
return;
|
|
219
268
|
}
|
|
220
|
-
if (typeof fn
|
|
269
|
+
if (typeof fn !== "function") {
|
|
221
270
|
console.error('aKeyboard: The fn parameter needs to be a function <In "aKeyboard.onclick()">');
|
|
222
271
|
return;
|
|
223
272
|
}
|
|
224
273
|
const elKeysEl = document.querySelector(`${this.obj.el} .akeyboard-keyboard-keys-${btn}`);
|
|
225
|
-
|
|
274
|
+
if (elKeysEl)
|
|
275
|
+
elKeysEl.onclick = fn;
|
|
276
|
+
else
|
|
277
|
+
console.error(`Can not find key: ${btn}`);
|
|
226
278
|
}
|
|
227
279
|
};
|
|
228
280
|
class NumberKeyboard {
|
|
229
281
|
constructor(obj) {
|
|
230
|
-
if (typeof obj
|
|
282
|
+
if (typeof obj !== "object") {
|
|
231
283
|
console.error('aKeyboard: The obj parameter needs to be an object <In "new aKeyboard()">');
|
|
232
284
|
return;
|
|
233
285
|
}
|
|
234
286
|
this.obj = obj;
|
|
235
287
|
const el = document.querySelector(obj.el);
|
|
236
288
|
let keyboardStyle = "";
|
|
237
|
-
if (typeof obj.style
|
|
238
|
-
for (const i in obj.style)
|
|
289
|
+
if (typeof obj.style === "object") {
|
|
290
|
+
for (const i in obj.style) {
|
|
239
291
|
keyboardStyle += `${i}: ${obj.style[i]};`;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
240
294
|
let html = `<div class="akeyboard-numberKeyboard${obj.fixedBottomCenter ? " akeyboard-keyboard-fixedBottomCenter" : ""}" style="${keyboardStyle}">`;
|
|
241
295
|
html += '<div class="akeyboard-keyboard-innerKeys">';
|
|
242
|
-
for (let i = 1; i < 10; i++)
|
|
243
|
-
html += `<div class="akeyboard-keyboard-keys akeyboard-keyboard-keys-${i}">${i}</div
|
|
244
|
-
|
|
296
|
+
for (let i = 1; i < 10; i++) {
|
|
297
|
+
html += `<div class="akeyboard-keyboard-keys akeyboard-keyboard-keys-${i}">${i}</div>`;
|
|
298
|
+
if (i % 3 === 0) {
|
|
299
|
+
html += '</div><div class="akeyboard-keyboard-innerKeys">';
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
html += '<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>';
|
|
303
|
+
html += "</div>";
|
|
304
|
+
el.innerHTML = html;
|
|
245
305
|
}
|
|
246
306
|
inputOn(inputEle, type, fn, customClick) {
|
|
247
|
-
if (typeof inputEle
|
|
307
|
+
if (typeof inputEle !== "string") {
|
|
248
308
|
console.error('aKeyboard: The inputEle parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
249
309
|
return;
|
|
250
310
|
}
|
|
251
|
-
if (typeof type
|
|
311
|
+
if (typeof type !== "string") {
|
|
252
312
|
console.error('aKeyboard: The type parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
253
313
|
return;
|
|
254
314
|
}
|
|
255
|
-
const inputEl = document.querySelector(inputEle)
|
|
315
|
+
const inputEl = document.querySelector(inputEle);
|
|
316
|
+
const elKeysEl = document.querySelectorAll(`${this.obj.el} .akeyboard-keyboard-keys`);
|
|
256
317
|
for (let i = 0; i < elKeysEl.length; i++) {
|
|
257
318
|
if (elKeysEl[i].innerHTML === "Delete") {
|
|
258
319
|
elKeysEl[i].onclick = function() {
|
|
259
|
-
inputEl[type] = inputEl[type].substr(0, inputEl[type].length - 1)
|
|
320
|
+
inputEl[type] = inputEl[type].substr(0, inputEl[type].length - 1);
|
|
321
|
+
fn("Delete", inputEl[type]);
|
|
260
322
|
};
|
|
261
323
|
continue;
|
|
262
324
|
}
|
|
263
325
|
if (elKeysEl[i].innerHTML === "Enter") {
|
|
264
326
|
elKeysEl[i].onclick = function() {
|
|
265
|
-
inputEl[type] +=
|
|
266
|
-
|
|
327
|
+
inputEl[type] += "\n";
|
|
328
|
+
fn("Enter", inputEl[type]);
|
|
267
329
|
};
|
|
268
330
|
continue;
|
|
269
331
|
}
|
|
270
|
-
customClick && typeof customClick
|
|
271
|
-
|
|
272
|
-
}
|
|
332
|
+
if (customClick && typeof customClick === "object" && Object.keys(customClick).length > 0 && customClick[elKeysEl[i].innerHTML]) {
|
|
333
|
+
elKeysEl[i].onclick = customClick[elKeysEl[i].innerHTML];
|
|
334
|
+
} else {
|
|
335
|
+
elKeysEl[i].onclick = function() {
|
|
336
|
+
inputEl[type] += this.innerText;
|
|
337
|
+
fn(this.innerText, inputEl[type]);
|
|
338
|
+
};
|
|
339
|
+
}
|
|
273
340
|
}
|
|
274
341
|
}
|
|
275
342
|
onclick(btn, fn) {
|
|
276
|
-
if (typeof btn
|
|
343
|
+
if (typeof btn !== "string") {
|
|
277
344
|
console.error('aKeyboard: The btn parameter needs to be a string <In "aKeyboard.onclick()">');
|
|
278
345
|
return;
|
|
279
346
|
}
|
|
280
|
-
if (typeof fn
|
|
347
|
+
if (typeof fn !== "function") {
|
|
281
348
|
console.error('aKeyboard: The fn parameter needs to be a function <In "aKeyboard.onclick()">');
|
|
282
349
|
return;
|
|
283
350
|
}
|
|
284
351
|
const elKeysEl = document.querySelector(`${this.obj.el} .akeyboard-keyboard-keys-${btn}`);
|
|
285
|
-
|
|
352
|
+
if (elKeysEl)
|
|
353
|
+
elKeysEl.onclick = fn;
|
|
354
|
+
else
|
|
355
|
+
console.error(`Can not find key: ${btn}`);
|
|
286
356
|
}
|
|
287
357
|
}
|
|
288
358
|
var render = function() {
|
|
289
|
-
var _vm = this
|
|
359
|
+
var _vm = this;
|
|
360
|
+
var _h = _vm.$createElement;
|
|
361
|
+
var _c = _vm._self._c || _h;
|
|
290
362
|
return _c("div", {
|
|
291
363
|
class: ["avue-keyboard", _vm.className]
|
|
292
364
|
}, [_c("div", {
|
|
293
365
|
attrs: {
|
|
294
|
-
id: "keyboard"
|
|
366
|
+
"id": "keyboard"
|
|
295
367
|
}
|
|
296
368
|
})]);
|
|
297
|
-
}
|
|
369
|
+
};
|
|
370
|
+
var staticRenderFns = [];
|
|
371
|
+
const Keyboard_vue_vue_type_style_index_0_lang = "";
|
|
298
372
|
const __vue2_script = {
|
|
299
373
|
name: "Keyboard",
|
|
300
374
|
props: {
|
|
301
375
|
ele: {
|
|
302
376
|
type: String,
|
|
303
|
-
required:
|
|
377
|
+
required: true
|
|
304
378
|
},
|
|
305
379
|
keys: Array,
|
|
306
380
|
theme: {
|
|
307
381
|
type: String,
|
|
308
382
|
default: "default",
|
|
309
|
-
validator: (value) =>
|
|
383
|
+
validator: (value) => {
|
|
384
|
+
return ["default", "dark", "green", "classic"].includes(value);
|
|
385
|
+
}
|
|
310
386
|
},
|
|
311
387
|
type: {
|
|
312
388
|
type: String,
|
|
313
389
|
default: "default",
|
|
314
|
-
validator: (value) =>
|
|
390
|
+
validator: (value) => {
|
|
391
|
+
return ["default", "number", "mobile"].includes(value);
|
|
392
|
+
}
|
|
315
393
|
},
|
|
316
394
|
fixedBottomCenter: {
|
|
317
395
|
type: Boolean,
|
|
318
|
-
default:
|
|
396
|
+
default: false
|
|
319
397
|
},
|
|
320
398
|
rebind: {
|
|
321
399
|
type: Boolean,
|
|
322
|
-
default:
|
|
400
|
+
default: true
|
|
323
401
|
}
|
|
324
402
|
},
|
|
325
403
|
data() {
|
|
@@ -351,30 +429,37 @@ const __vue2_script = {
|
|
|
351
429
|
keys: this.keys,
|
|
352
430
|
fixedBottomCenter: this.fixedBottomCenter
|
|
353
431
|
};
|
|
354
|
-
|
|
432
|
+
if (this.type === "default")
|
|
433
|
+
keyboard = new Keyboard$1(config);
|
|
434
|
+
else if (this.type === "number")
|
|
435
|
+
keyboard = new NumberKeyboard(config);
|
|
355
436
|
const ele = this.ele.indexOf("#") === 0 ? this.ele.substring(1) : this.ele;
|
|
356
437
|
keyboard.inputOn(`#${ele}`, "value", (e, val) => {
|
|
357
438
|
this.$emit("click", e, val);
|
|
358
|
-
}, this.rebind ? this.customClick : null)
|
|
439
|
+
}, this.rebind ? this.customClick : null);
|
|
440
|
+
this.keyboard = keyboard;
|
|
359
441
|
},
|
|
360
442
|
bindClick(btn, fn) {
|
|
361
|
-
this.keyboard.onclick(btn, fn)
|
|
443
|
+
this.keyboard.onclick(btn, fn);
|
|
444
|
+
this.customClick[btn] = fn;
|
|
362
445
|
}
|
|
363
446
|
}
|
|
364
|
-
}
|
|
447
|
+
};
|
|
448
|
+
const __cssModules = {};
|
|
365
449
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
366
450
|
__vue2_script,
|
|
367
451
|
render,
|
|
368
452
|
staticRenderFns,
|
|
369
|
-
|
|
453
|
+
false,
|
|
370
454
|
__vue2_injectStyles,
|
|
371
455
|
null,
|
|
372
456
|
null,
|
|
373
457
|
null
|
|
374
458
|
);
|
|
375
459
|
function __vue2_injectStyles(context) {
|
|
376
|
-
for (let o in __cssModules)
|
|
460
|
+
for (let o in __cssModules) {
|
|
377
461
|
this[o] = __cssModules[o];
|
|
462
|
+
}
|
|
378
463
|
}
|
|
379
464
|
const Keyboard2 = /* @__PURE__ */ function() {
|
|
380
465
|
return __component__.exports;
|