@web-utils/component 2.7.30 → 2.7.32
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.mjs} +29 -29
- package/dist/chunks/confirmable-mixin.851d6299.mjs +137 -0
- package/dist/chunks/dataformat.3388d88a.mjs +237 -0
- package/dist/chunks/detail.37726835.mjs +55 -0
- package/dist/chunks/dic.09a81bc8.mjs +215 -0
- package/dist/chunks/{event.fc358074.js → event.6fc3df3a.mjs} +54 -23
- package/dist/chunks/{form-input-mixin.760cd65d.js → form-input-mixin.e7f93f4c.mjs} +4 -4
- package/dist/chunks/{form-item-mixin.fa314b67.js → form-item-mixin.a2ed6693.mjs} +44 -17
- package/dist/chunks/{form-pick-mixin.c4e0391b.js → form-pick-mixin.822300f3.mjs} +1 -1
- package/dist/chunks/{init.e0133910.js → init.3407e589.mjs} +41 -21
- package/dist/chunks/{input-number-mixin.6849fa63.js → input-number-mixin.44b78389.mjs} +4 -4
- package/dist/chunks/{mixins.6a394a6c.js → mixins.e1939731.mjs} +3 -2
- package/dist/chunks/{packages.419bde01.js → packages.c4ea639d.mjs} +12 -6
- package/dist/chunks/{permission.07c49abf.js → permission.9c766972.mjs} +6 -1
- package/dist/chunks/slot.55598d0f.mjs +35 -0
- package/dist/chunks/{tab-mixin.9d568df9.js → tab-mixin.9d848bf6.mjs} +29 -11
- package/dist/chunks/util.b0d0b0ad.mjs +478 -0
- package/dist/chunks/{utils.d7f73f8d.js → utils.2a3ffac9.mjs} +89 -24
- package/dist/chunks/{utils.f44207f4.js → utils.a8891d2c.mjs} +9 -5
- package/dist/chunks/vueComponentNormalizer.9c6b8b3d.mjs +59 -0
- package/dist/components/address-input/{index.js → index.mjs} +30 -17
- package/dist/components/address-input/style.css +15 -1
- package/dist/components/affix/index.mjs +152 -0
- package/dist/components/affix/style.css +5 -1
- package/dist/components/aside-menu/{index.js → index.mjs} +14 -8
- package/dist/components/aside-menu/style.css +9 -1
- package/dist/components/avatar/{index.js → index.mjs} +33 -15
- package/dist/components/avatar/style.css +57 -1
- package/dist/components/awesome-button/{index.js → index.mjs} +45 -31
- package/dist/components/base.css +410 -1
- package/dist/components/capsule-tab/{index.js → index.mjs} +13 -7
- package/dist/components/capsule-tab/style.css +32 -1
- package/dist/components/card/{index.js → index.mjs} +33 -20
- package/dist/components/card/style.css +90 -1
- package/dist/components/carousel/{index.js → index.mjs} +18 -12
- package/dist/components/carousel/style.css +41 -1
- package/dist/components/chat/{index.js → index.mjs} +245 -139
- package/dist/components/chat/style.css +279 -1
- package/dist/components/chunk-file-uploader/index.mjs +153 -0
- package/dist/components/chunk-file-uploader/style.css +4 -1
- package/dist/components/chunk-file-uploader-button/{index.js → index.mjs} +15 -9
- package/dist/components/chunk-file-uploader-button/style.css +17 -1
- package/dist/components/chunk-file-uploader-drop/index.mjs +101 -0
- package/dist/components/chunk-file-uploader-drop/style.css +12 -1
- package/dist/components/chunk-file-uploader-file/{index.js → index.mjs} +150 -73
- package/dist/components/chunk-file-uploader-file/style.css +125 -1
- package/dist/components/chunk-file-uploader-files/{index.js → index.mjs} +15 -9
- package/dist/components/chunk-file-uploader-files/style.css +9 -1
- package/dist/components/chunk-file-uploader-list/{index.js → index.mjs} +16 -10
- package/dist/components/chunk-file-uploader-list/style.css +9 -1
- package/dist/components/chunk-file-uploader-un-support/{index.js → index.mjs} +18 -10
- package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
- package/dist/components/code-mirror-editor/{index.js → index.mjs} +75 -47
- package/dist/components/code-mirror-editor/style.css +17 -1
- package/dist/components/color-picker/{index.js → index.mjs} +62 -39
- package/dist/components/column/{index.js → index.mjs} +54 -29
- package/dist/components/column-default/{index.js → index.mjs} +47 -33
- package/dist/components/column-dynamic/{index.js → index.mjs} +26 -19
- package/dist/components/column-menu/{index.js → index.mjs} +98 -86
- package/dist/components/column-slot/{index.js → index.mjs} +135 -75
- package/dist/components/comment/{index.js → index.mjs} +28 -15
- package/dist/components/comment/style.css +92 -1
- package/dist/components/confirm-button/{index.js → index.mjs} +7 -5
- package/dist/components/confirmable/{index.js → index.mjs} +5 -4
- package/dist/components/context-menu/{index.js → index.mjs} +54 -32
- package/dist/components/context-menu/style.css +88 -1
- package/dist/components/count-up/index.mjs +148 -0
- package/dist/components/custom-scrollbar/{index.js → index.mjs} +45 -21
- package/dist/components/data-box/{index.js → index.mjs} +22 -16
- package/dist/components/data-box/style.css +58 -1
- package/dist/components/data-card/{index.js → index.mjs} +21 -15
- package/dist/components/data-card/style.css +46 -1
- package/dist/components/data-cardtext/{index.js → index.mjs} +19 -13
- package/dist/components/data-cardtext/style.css +36 -1
- package/dist/components/data-display/{index.js → index.mjs} +22 -16
- package/dist/components/data-display/style.css +37 -1
- package/dist/components/data-icons/{index.js → index.mjs} +23 -17
- package/dist/components/data-icons/style.css +53 -1
- package/dist/components/data-imgtext/{index.js → index.mjs} +26 -20
- package/dist/components/data-imgtext/style.css +70 -1
- package/dist/components/data-operatext/{index.js → index.mjs} +20 -14
- package/dist/components/data-operatext/style.css +81 -1
- package/dist/components/data-panel/{index.js → index.mjs} +21 -15
- package/dist/components/data-panel/style.css +37 -1
- package/dist/components/data-pay/{index.js → index.mjs} +29 -23
- package/dist/components/data-pay/style.css +102 -1
- package/dist/components/data-price/{index.js → index.mjs} +19 -13
- package/dist/components/data-price/style.css +81 -1
- package/dist/components/data-progress/{index.js → index.mjs} +26 -20
- package/dist/components/data-progress/style.css +30 -1
- package/dist/components/data-rotate/{index.js → index.mjs} +21 -15
- package/dist/components/data-rotate/style.css +50 -1
- package/dist/components/data-table-picker/{index.js → index.mjs} +47 -28
- package/dist/components/data-tabs/{index.js → index.mjs} +22 -16
- package/dist/components/data-tabs/style.css +70 -1
- package/dist/components/dialog-column/{index.js → index.mjs} +46 -33
- package/dist/components/dialog-excel/{index.js → index.mjs} +102 -53
- package/dist/components/dialog-filter/{index.js → index.mjs} +64 -51
- package/dist/components/dialog-form/{index.js → index.mjs} +54 -34
- package/dist/components/dialog-form/style.css +10 -0
- package/dist/components/dynamic-table/{index.js → index.mjs} +66 -42
- package/dist/components/dynamic-table/style.css +30 -1
- package/dist/components/e-charts/{index.js → index.mjs} +127 -46
- package/dist/components/e-charts/style.css +10 -1
- package/dist/components/easy-popup/{index.js → index.mjs} +32 -14
- package/dist/components/easy-popup/style.css +18 -1
- package/dist/components/editable-progress/{index.js → index.mjs} +64 -31
- package/dist/components/editable-progress/style.css +37 -1
- package/dist/components/editable-tree/{index.js → index.mjs} +513 -287
- package/dist/components/editable-tree/style.css +82 -1
- package/dist/components/egd-collapse/{index.js → index.mjs} +25 -12
- package/dist/components/egd-collapse-item/{index.js → index.mjs} +41 -25
- package/dist/components/element-dialog/{index.js → index.mjs} +101 -48
- package/dist/components/element-dialog/style.css +88 -1
- package/dist/components/empty-view/{index.js → index.mjs} +13 -7
- package/dist/components/empty-view/style.css +17 -1
- package/dist/components/error-view/{index.js → index.mjs} +12 -6
- package/dist/components/error-view/style.css +17 -1
- package/dist/components/flex-column/index.mjs +84 -0
- package/dist/components/flex-item/index.mjs +116 -0
- package/dist/components/flex-row/index.mjs +84 -0
- package/dist/components/flex-scroller/{index.js → index.mjs} +13 -7
- package/dist/components/flex-scroller/style.css +20 -1
- package/dist/components/flow/{index.js → index.mjs} +116 -64
- package/dist/components/flow/style.css +44 -1
- package/dist/components/flow-node/{index.js → index.mjs} +29 -21
- package/dist/components/flow-viewer/index.mjs +207 -0
- package/dist/components/flow-viewer/style.css +19 -1
- package/dist/components/form-button/{index.js → index.mjs} +12 -8
- package/dist/components/form-cascader/{index.js → index.mjs} +55 -40
- package/dist/components/form-checkbox-group/{index.js → index.mjs} +90 -60
- package/dist/components/form-checkbox-group/style.css +51 -1
- package/dist/components/form-date-picker/{index.js → index.mjs} +113 -44
- package/dist/components/form-group/{index.js → index.mjs} +23 -17
- package/dist/components/form-group/style.css +76 -1
- package/dist/components/form-holder/{index.js → index.mjs} +41 -30
- package/dist/components/form-input/{index.js → index.mjs} +42 -31
- package/dist/components/form-input-email/{index.js → index.mjs} +47 -30
- package/dist/components/form-input-id-card/{index.js → index.mjs} +40 -29
- package/dist/components/form-input-number/{index.js → index.mjs} +50 -38
- package/dist/components/form-input-number/style.css +12 -1
- package/dist/components/form-input-phone-number/{index.js → index.mjs} +40 -29
- package/dist/components/form-input-time/{index.js → index.mjs} +40 -29
- package/dist/components/form-item/index.mjs +199 -0
- package/dist/components/form-item/style.css +11 -1
- package/dist/components/form-item-config-provider/{index.js → index.mjs} +9 -8
- package/dist/components/form-item-group/{index.js → index.mjs} +69 -43
- package/dist/components/form-item-group/style.css +30 -1
- package/dist/components/form-radio-group/{index.js → index.mjs} +77 -53
- package/dist/components/form-radio-group/style.css +53 -1
- package/dist/components/form-select/{index.js → index.mjs} +71 -51
- package/dist/components/form-switch/{index.js → index.mjs} +41 -30
- package/dist/components/form-temp/{index.js → index.mjs} +49 -29
- package/dist/components/form-textarea/{index.js → index.mjs} +45 -34
- package/dist/components/form-view/{index.js → index.mjs} +152 -81
- package/dist/components/form-view/style.css +158 -1
- package/dist/components/fy-array/{index.js → index.mjs} +51 -43
- package/dist/components/fy-array/style.css +18 -1
- package/dist/components/fy-article/{index.js → index.mjs} +24 -13
- package/dist/components/fy-article/style.css +40 -1
- package/dist/components/fy-cascader/{index.js → index.mjs} +39 -29
- package/dist/components/fy-checkbox/{index.js → index.mjs} +38 -27
- package/dist/components/fy-checkbox/style.css +15 -1
- package/dist/components/fy-code/{index.js → index.mjs} +19 -12
- package/dist/components/fy-curd/{index.js → index.mjs} +290 -152
- package/dist/components/fy-curd/style.css +239 -1
- package/dist/components/fy-date/{index.js → index.mjs} +24 -18
- package/dist/components/fy-date/style.css +21 -1
- package/dist/components/fy-dialog-form/{index.js → index.mjs} +127 -54
- package/dist/components/fy-draggable/{index.js → index.mjs} +196 -73
- package/dist/components/fy-draggable/style.css +136 -1
- package/dist/components/fy-dynamic/{index.js → index.mjs} +116 -73
- package/dist/components/fy-dynamic/style.css +35 -1
- package/dist/components/fy-empty/{index.js → index.mjs} +15 -9
- package/dist/components/fy-empty/style.css +24 -1
- package/dist/components/fy-form/{index.js → index.mjs} +399 -221
- package/dist/components/fy-form/style.css +79 -1
- package/dist/components/fy-form-design/{index.js → index.mjs} +2267 -1630
- package/dist/components/fy-form-design/style.css +578 -1
- package/dist/components/fy-form-menu/{index.js → index.mjs} +43 -35
- package/dist/components/fy-input/{index.js → index.mjs} +46 -35
- package/dist/components/fy-input-color/{index.js → index.mjs} +40 -33
- package/dist/components/fy-input-icon/{index.js → index.mjs} +58 -37
- package/dist/components/fy-input-icon/style.css +39 -1
- package/dist/components/fy-input-map/{index.js → index.mjs} +113 -68
- package/dist/components/fy-input-map/style.css +50 -1
- package/dist/components/fy-input-number/{index.js → index.mjs} +29 -24
- package/dist/components/fy-input-table/{index.js → index.mjs} +82 -48
- package/dist/components/fy-input-table/style.css +10 -1
- package/dist/components/fy-input-tree/{index.js → index.mjs} +104 -60
- package/dist/components/fy-input-tree/style.css +25 -1
- package/dist/components/fy-progress/{index.js → index.mjs} +15 -10
- package/dist/components/fy-radio/{index.js → index.mjs} +20 -14
- package/dist/components/fy-radio/style.css +12 -1
- package/dist/components/fy-rate/{index.js → index.mjs} +21 -15
- package/dist/components/fy-rate/style.css +9 -1
- package/dist/components/fy-select/{index.js → index.mjs} +73 -55
- package/dist/components/fy-select/style.css +25 -1
- package/dist/components/fy-slider/{index.js → index.mjs} +22 -17
- package/dist/components/fy-switch/{index.js → index.mjs} +17 -12
- package/dist/components/fy-tabs/{index.js → index.mjs} +20 -12
- package/dist/components/fy-tabs/style.css +6 -0
- package/dist/components/fy-time/{index.js → index.mjs} +29 -18
- package/dist/components/fy-title/{index.js → index.mjs} +16 -8
- package/dist/components/fy-title/style.css +11 -1
- package/dist/components/fy-tree/{index.js → index.mjs} +135 -72
- package/dist/components/fy-tree/style.css +46 -1
- package/dist/components/fy-u-editor/{index.js → index.mjs} +172 -67
- package/dist/components/fy-u-editor/style.css +15 -1
- package/dist/components/fy-upload/{index.js → index.mjs} +317 -148
- package/dist/components/fy-upload/style.css +60 -1
- package/dist/components/guide-steps/{index.js → index.mjs} +31 -17
- package/dist/components/guide-steps/style.css +34 -1
- package/dist/components/header-menu/{index.js → index.mjs} +86 -66
- package/dist/components/header-search/{index.js → index.mjs} +92 -60
- package/dist/components/highlight-j-s/{index.js → index.mjs} +28 -15
- package/dist/components/highlight-j-s/style.css +21 -1
- package/dist/components/icon-card/{index.js → index.mjs} +13 -7
- package/dist/components/icon-card/style.css +56 -1
- package/dist/components/icon-temp/{index.js → index.mjs} +12 -6
- package/dist/components/icon-temp/style.css +21 -1
- package/dist/components/iframe-window/{index.js → index.mjs} +20 -14
- package/dist/components/iframe-window/style.css +20 -1
- package/dist/components/image-cropper/{index.js → index.mjs} +69 -51
- package/dist/components/image-cropper/style.css +34 -1
- package/dist/components/image-preview/{index.js → index.mjs} +77 -46
- package/dist/components/image-preview/style.css +72 -1
- package/dist/components/image-viewer/{index.js → index.mjs} +40 -22
- package/dist/components/image-viewer/style.css +21 -1
- package/dist/components/input-number/{index.js → index.mjs} +122 -56
- package/dist/components/input-number/style.css +15 -1
- package/dist/components/input-number-range/{index.js → index.mjs} +32 -20
- package/dist/components/input-number-range/style.css +12 -1
- package/dist/components/j-s-x-component/{index.js → index.mjs} +0 -0
- package/dist/components/keep-view-alive/{index.js → index.mjs} +68 -21
- package/dist/components/keyboard/index.mjs +469 -0
- package/dist/components/keyboard/style.css +547 -1
- package/dist/components/license/index.mjs +180 -0
- package/dist/components/loading-view/{index.js → index.mjs} +12 -6
- package/dist/components/loading-view/style.css +17 -1
- package/dist/components/login/{index.js → index.mjs} +91 -62
- package/dist/components/login/style.css +25 -1
- package/dist/components/name-avatar/{index.js → index.mjs} +32 -10
- package/dist/components/name-avatar/style.css +35 -1
- package/dist/components/nav-bar/{index.js → index.mjs} +21 -11
- package/dist/components/nav-bar/style.css +17 -1
- package/dist/components/not-implement/{index.js → index.mjs} +16 -8
- package/dist/components/not-implement/style.css +15 -1
- package/dist/components/notice/{index.js → index.mjs} +40 -27
- package/dist/components/notice/style.css +54 -1
- package/dist/components/page/{index.js → index.mjs} +13 -7
- package/dist/components/page/style.css +12 -1
- package/dist/components/page-header/{index.js → index.mjs} +15 -9
- package/dist/components/page-header/style.css +14 -1
- package/dist/components/page-index/{index.js → index.mjs} +62 -37
- package/dist/components/page-index/style.css +23 -1
- package/dist/components/page-index-top/{index.js → index.mjs} +53 -34
- package/dist/components/page-skeleton/{index.js → index.mjs} +15 -9
- package/dist/components/page-skeleton/style.css +23 -1
- package/dist/components/page-skeleton-new/{index.js → index.mjs} +15 -9
- package/dist/components/page-skeleton-new/style.css +42 -1
- package/dist/components/pageable-table/{index.js → index.mjs} +187 -106
- package/dist/components/pageable-table/style.css +72 -1
- package/dist/components/pageable-view/{index.js → index.mjs} +164 -80
- package/dist/components/pageable-view/style.css +69 -1
- package/dist/components/photo-swipe/index.mjs +175 -0
- package/dist/components/process-designer/{index.js → index.mjs} +961 -772
- package/dist/components/process-designer/style.css +1186 -1
- package/dist/components/properties-panel/{index.js → index.mjs} +1488 -1044
- package/dist/components/properties-panel/style.css +122 -1
- package/dist/components/queue/{index.js → index.mjs} +24 -12
- package/dist/components/record-video/{index.js → index.mjs} +53 -27
- package/dist/components/record-video/style.css +53 -1
- package/dist/components/resize-observer/index.mjs +96 -0
- package/dist/components/resize-observer/style.css +31 -1
- package/dist/components/search/{index.js → index.mjs} +41 -22
- package/dist/components/search/style.css +57 -1
- package/dist/components/search-popover/{index.js → index.mjs} +153 -91
- package/dist/components/search-popover/style.css +93 -1
- package/dist/components/sign/index.mjs +236 -0
- package/dist/components/sign/style.css +12 -1
- package/dist/components/sign-panel/{index.js → index.mjs} +96 -46
- package/dist/components/sign-panel/style.css +97 -1
- package/dist/components/skeleton/{index.js → index.mjs} +22 -12
- package/dist/components/skeleton/style.css +61 -1
- package/dist/components/split-pane/{index.js → index.mjs} +125 -60
- package/dist/components/split-pane/style.css +100 -1
- package/dist/components/stateful/{index.js → index.mjs} +8 -5
- package/dist/components/stateful/style.css +33 -1
- package/dist/components/static-pageable-table/{index.js → index.mjs} +22 -15
- package/dist/components/static-pageable-table/style.css +9 -1
- package/dist/components/swiper/index.mjs +247 -0
- package/dist/components/swiper/style.css +43 -1
- package/dist/components/tab/{index.js → index.mjs} +34 -16
- package/dist/components/tab/style.css +122 -1
- package/dist/components/tab-item/{index.js → index.mjs} +14 -9
- package/dist/components/table-column/{index.js → index.mjs} +26 -17
- package/dist/components/table-page/{index.js → index.mjs} +42 -23
- package/dist/components/table-view/{index.js → index.mjs} +162 -87
- package/dist/components/table-view/style.css +95 -1
- package/dist/components/tag-render/{index.js → index.mjs} +41 -22
- package/dist/components/tag-render/style.css +33 -1
- package/dist/components/text-ellipsis/{index.js → index.mjs} +48 -26
- package/dist/components/text-ellipsis/style.css +9 -1
- package/dist/components/tinymce-editor/{index.js → index.mjs} +80 -60
- package/dist/components/tinymce-editor/style.css +43 -1
- package/dist/components/tinymce-wrapper/{index.js → index.mjs} +77 -41
- package/dist/components/tinymce-wrapper/style.css +36 -1
- package/dist/components/toolbar/{index.js → index.mjs} +46 -25
- package/dist/components/toolbar/style.css +39 -1
- package/dist/components/toolbar-button/{index.js → index.mjs} +46 -35
- package/dist/components/toolbar-button/style.css +21 -1
- package/dist/components/trigger/{index.js → index.mjs} +15 -8
- package/dist/components/verify/{index.js → index.mjs} +15 -8
- package/dist/components/verify/style.css +15 -1
- package/dist/components/vue-tags-input/{index.js → index.mjs} +233 -113
- package/dist/components/vue-tags-input/style.css +688 -1
- package/dist/components/watermark/{index.js → index.mjs} +33 -14
- package/dist/components/watermark/style.css +11 -1
- package/dist/index.css +2434 -1750
- package/dist/{index.es.js → index.mjs} +15944 -9317
- 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
- package/dist/components/affix/index.js +0 -102
- package/dist/components/chunk-file-uploader/index.js +0 -119
- package/dist/components/chunk-file-uploader-drop/index.js +0 -83
- package/dist/components/count-up/index.js +0 -131
- package/dist/components/flex-column/index.js +0 -62
- package/dist/components/flex-item/index.js +0 -81
- package/dist/components/flex-row/index.js +0 -62
- package/dist/components/flow-viewer/index.js +0 -162
- package/dist/components/form-item/index.js +0 -147
- package/dist/components/fy-dialog-form/style.css +0 -1
- package/dist/components/keyboard/index.js +0 -384
- package/dist/components/license/index.js +0 -134
- package/dist/components/photo-swipe/index.js +0 -129
- package/dist/components/resize-observer/index.js +0 -62
- package/dist/components/sign/index.js +0 -133
- package/dist/components/swiper/index.js +0 -178
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
|
|
2
|
-
let Keyboard$1 = class {
|
|
3
|
-
constructor(obj) {
|
|
4
|
-
if (typeof obj != "object") {
|
|
5
|
-
console.error('aKeyboard: The obj parameter needs to be an object <In "new aKeyboard()">');
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
this.obj = obj;
|
|
9
|
-
const el = document.querySelector(obj.el);
|
|
10
|
-
let keyboardStyle = "";
|
|
11
|
-
if (typeof obj.style == "object")
|
|
12
|
-
for (const i in obj.style)
|
|
13
|
-
keyboardStyle += `${i}: ${obj.style[i]};`;
|
|
14
|
-
let html = `<div class="akeyboard-keyboard${obj.fixedBottomCenter ? " akeyboard-keyboard-fixedBottomCenter" : ""}" style="${keyboardStyle}">`;
|
|
15
|
-
const numberKeys = [];
|
|
16
|
-
for (let i = 1; i < 10; i++)
|
|
17
|
-
numberKeys.push(i.toString());
|
|
18
|
-
numberKeys.push("0");
|
|
19
|
-
const keys = obj.keys || [
|
|
20
|
-
["`"].concat(numberKeys).concat([
|
|
21
|
-
"-",
|
|
22
|
-
"=",
|
|
23
|
-
"Delete"
|
|
24
|
-
]),
|
|
25
|
-
["Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "\\"],
|
|
26
|
-
["Caps", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "Enter"],
|
|
27
|
-
["Shift", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "Shift"],
|
|
28
|
-
["Space"]
|
|
29
|
-
];
|
|
30
|
-
let thisKeys;
|
|
31
|
-
const shiftKey = [], capsKey = [];
|
|
32
|
-
for (let i = 0; i < keys.length; i++) {
|
|
33
|
-
shiftKey.push([]), capsKey.push([]), thisKeys = keys[i];
|
|
34
|
-
for (let a = 0; a < thisKeys.length; a++) {
|
|
35
|
-
if (thisKeys[a].length === 1) {
|
|
36
|
-
switch (capsKey[i].push(thisKeys[a].toUpperCase()), thisKeys[a]) {
|
|
37
|
-
case "`":
|
|
38
|
-
shiftKey[i].push("~");
|
|
39
|
-
continue;
|
|
40
|
-
case "1":
|
|
41
|
-
shiftKey[i].push("!");
|
|
42
|
-
continue;
|
|
43
|
-
case "2":
|
|
44
|
-
shiftKey[i].push("@");
|
|
45
|
-
continue;
|
|
46
|
-
case "3":
|
|
47
|
-
shiftKey[i].push("#");
|
|
48
|
-
continue;
|
|
49
|
-
case "4":
|
|
50
|
-
shiftKey[i].push("$");
|
|
51
|
-
continue;
|
|
52
|
-
case "5":
|
|
53
|
-
shiftKey[i].push("%");
|
|
54
|
-
continue;
|
|
55
|
-
case "6":
|
|
56
|
-
shiftKey[i].push("^");
|
|
57
|
-
continue;
|
|
58
|
-
case "7":
|
|
59
|
-
shiftKey[i].push("&");
|
|
60
|
-
continue;
|
|
61
|
-
case "8":
|
|
62
|
-
shiftKey[i].push("*");
|
|
63
|
-
continue;
|
|
64
|
-
case "9":
|
|
65
|
-
shiftKey[i].push("(");
|
|
66
|
-
continue;
|
|
67
|
-
case "0":
|
|
68
|
-
shiftKey[i].push(")");
|
|
69
|
-
continue;
|
|
70
|
-
case "-":
|
|
71
|
-
shiftKey[i].push("_");
|
|
72
|
-
continue;
|
|
73
|
-
case "=":
|
|
74
|
-
shiftKey[i].push("+");
|
|
75
|
-
continue;
|
|
76
|
-
case "[":
|
|
77
|
-
shiftKey[i].push("{");
|
|
78
|
-
continue;
|
|
79
|
-
case "]":
|
|
80
|
-
shiftKey[i].push("}");
|
|
81
|
-
continue;
|
|
82
|
-
case "\\":
|
|
83
|
-
shiftKey[i].push("|");
|
|
84
|
-
continue;
|
|
85
|
-
case ";":
|
|
86
|
-
shiftKey[i].push(":");
|
|
87
|
-
continue;
|
|
88
|
-
case "'":
|
|
89
|
-
shiftKey[i].push('"');
|
|
90
|
-
continue;
|
|
91
|
-
case ",":
|
|
92
|
-
shiftKey[i].push("<");
|
|
93
|
-
continue;
|
|
94
|
-
case ".":
|
|
95
|
-
shiftKey[i].push(">");
|
|
96
|
-
continue;
|
|
97
|
-
case "/":
|
|
98
|
-
shiftKey[i].push("?");
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
shiftKey[i].push(thisKeys[a].toUpperCase());
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
shiftKey[i].push(thisKeys[a]), capsKey[i].push(thisKeys[a]);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
for (let i = 0; i < keys.length; i++) {
|
|
108
|
-
thisKeys = keys[i], html += '<div class="akeyboard-keyboard-innerKeys">';
|
|
109
|
-
for (let a = 0; a < thisKeys.length; a++)
|
|
110
|
-
html += `<div class="akeyboard-keyboard-keys akeyboard-keyboard-keys-${thisKeys[a]}">${thisKeys[a]}</div>`;
|
|
111
|
-
html += "</div>";
|
|
112
|
-
}
|
|
113
|
-
html += "</div>", el.innerHTML = html;
|
|
114
|
-
let containShift = !1;
|
|
115
|
-
keys.forEach((key) => {
|
|
116
|
-
key.includes("Shift") && (containShift = !0);
|
|
117
|
-
}), containShift && document.querySelectorAll(`${obj.el} .akeyboard-keyboard-keys-Shift`).forEach((el2) => {
|
|
118
|
-
el2.onclick = function() {
|
|
119
|
-
if (!this.isShift) {
|
|
120
|
-
const caps = document.querySelector(`${obj.el} .akeyboard-keyboard-keys-Caps`);
|
|
121
|
-
if (caps && caps.isCaps)
|
|
122
|
-
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
|
-
}
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
el2.isShift = !1, el2.innerHTML = "Shift", this.classList.remove("keyboard-keyboard-keys-focus");
|
|
134
|
-
const keysInnerEl = document.querySelectorAll(`${obj.el} .akeyboard-keyboard-innerKeys`);
|
|
135
|
-
let thisEl;
|
|
136
|
-
for (let i = 0; i < keysInnerEl.length; i++) {
|
|
137
|
-
thisEl = keysInnerEl[i];
|
|
138
|
-
for (let a = 0; a < thisEl.childNodes.length; a++)
|
|
139
|
-
thisEl.childNodes[a].innerHTML = keys[i][a];
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
});
|
|
143
|
-
let containCaps = !1;
|
|
144
|
-
keys.forEach((key) => {
|
|
145
|
-
key.includes("Caps") && (containCaps = !0);
|
|
146
|
-
}), containCaps && document.querySelectorAll(`${obj.el} .akeyboard-keyboard-keys-Caps`).forEach((el2) => {
|
|
147
|
-
el2.onclick = function() {
|
|
148
|
-
if (!this.isCaps) {
|
|
149
|
-
const shift = document.querySelector(`${obj.el} .akeyboard-keyboard-keys-Shift`);
|
|
150
|
-
if (shift && shift.isShift)
|
|
151
|
-
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
|
-
}
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
this.isCaps = !1, this.classList.remove("keyboard-keyboard-keys-focus");
|
|
163
|
-
const keysInnerEl = document.querySelectorAll(`${obj.el} .akeyboard-keyboard-innerKeys`);
|
|
164
|
-
let thisEl;
|
|
165
|
-
for (let i = 0; i < keysInnerEl.length; i++) {
|
|
166
|
-
thisEl = keysInnerEl[i];
|
|
167
|
-
for (let a = 0; a < thisEl.childNodes.length; a++)
|
|
168
|
-
thisEl.childNodes[a].innerHTML = keys[i][a];
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
inputOn(inputEle, type, fn, customClick) {
|
|
174
|
-
if (typeof inputEle != "string") {
|
|
175
|
-
console.error('aKeyboard: The inputEle parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
if (typeof type != "string") {
|
|
179
|
-
console.error('aKeyboard: The type parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
const inputEl = document.querySelector(inputEle), elKeysEl = document.querySelectorAll(`${this.obj.el} .akeyboard-keyboard-keys`);
|
|
183
|
-
for (let i = 0; i < elKeysEl.length; i++)
|
|
184
|
-
if (!["Shift", "Caps"].includes(elKeysEl[i].innerHTML)) {
|
|
185
|
-
if (elKeysEl[i].innerHTML === "Delete") {
|
|
186
|
-
elKeysEl[i].onclick = function() {
|
|
187
|
-
inputEl[type] = inputEl[type].substr(0, inputEl[type].length - 1), fn("Delete", inputEl[type]);
|
|
188
|
-
};
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
if (elKeysEl[i].innerHTML === "Tab") {
|
|
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]);
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
onclick(btn, fn) {
|
|
216
|
-
if (typeof btn != "string") {
|
|
217
|
-
console.error('aKeyboard: The btn parameter needs to be a string <In "aKeyboard.onclick()">');
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
if (typeof fn != "function") {
|
|
221
|
-
console.error('aKeyboard: The fn parameter needs to be a function <In "aKeyboard.onclick()">');
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
const elKeysEl = document.querySelector(`${this.obj.el} .akeyboard-keyboard-keys-${btn}`);
|
|
225
|
-
elKeysEl ? elKeysEl.onclick = fn : console.error(`Can not find key: ${btn}`);
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
class NumberKeyboard {
|
|
229
|
-
constructor(obj) {
|
|
230
|
-
if (typeof obj != "object") {
|
|
231
|
-
console.error('aKeyboard: The obj parameter needs to be an object <In "new aKeyboard()">');
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
this.obj = obj;
|
|
235
|
-
const el = document.querySelector(obj.el);
|
|
236
|
-
let keyboardStyle = "";
|
|
237
|
-
if (typeof obj.style == "object")
|
|
238
|
-
for (const i in obj.style)
|
|
239
|
-
keyboardStyle += `${i}: ${obj.style[i]};`;
|
|
240
|
-
let html = `<div class="akeyboard-numberKeyboard${obj.fixedBottomCenter ? " akeyboard-keyboard-fixedBottomCenter" : ""}" style="${keyboardStyle}">`;
|
|
241
|
-
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>`, i % 3 === 0 && (html += '</div><div class="akeyboard-keyboard-innerKeys">');
|
|
244
|
-
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>', html += "</div>", el.innerHTML = html;
|
|
245
|
-
}
|
|
246
|
-
inputOn(inputEle, type, fn, customClick) {
|
|
247
|
-
if (typeof inputEle != "string") {
|
|
248
|
-
console.error('aKeyboard: The inputEle parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
if (typeof type != "string") {
|
|
252
|
-
console.error('aKeyboard: The type parameter needs to be a string <In "aKeyboard.inputOn()">');
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
const inputEl = document.querySelector(inputEle), elKeysEl = document.querySelectorAll(`${this.obj.el} .akeyboard-keyboard-keys`);
|
|
256
|
-
for (let i = 0; i < elKeysEl.length; i++) {
|
|
257
|
-
if (elKeysEl[i].innerHTML === "Delete") {
|
|
258
|
-
elKeysEl[i].onclick = function() {
|
|
259
|
-
inputEl[type] = inputEl[type].substr(0, inputEl[type].length - 1), fn("Delete", inputEl[type]);
|
|
260
|
-
};
|
|
261
|
-
continue;
|
|
262
|
-
}
|
|
263
|
-
if (elKeysEl[i].innerHTML === "Enter") {
|
|
264
|
-
elKeysEl[i].onclick = function() {
|
|
265
|
-
inputEl[type] += `
|
|
266
|
-
`, fn("Enter", inputEl[type]);
|
|
267
|
-
};
|
|
268
|
-
continue;
|
|
269
|
-
}
|
|
270
|
-
customClick && typeof customClick == "object" && Object.keys(customClick).length > 0 && customClick[elKeysEl[i].innerHTML] ? elKeysEl[i].onclick = customClick[elKeysEl[i].innerHTML] : elKeysEl[i].onclick = function() {
|
|
271
|
-
inputEl[type] += this.innerText, fn(this.innerText, inputEl[type]);
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
onclick(btn, fn) {
|
|
276
|
-
if (typeof btn != "string") {
|
|
277
|
-
console.error('aKeyboard: The btn parameter needs to be a string <In "aKeyboard.onclick()">');
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
if (typeof fn != "function") {
|
|
281
|
-
console.error('aKeyboard: The fn parameter needs to be a function <In "aKeyboard.onclick()">');
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
const elKeysEl = document.querySelector(`${this.obj.el} .akeyboard-keyboard-keys-${btn}`);
|
|
285
|
-
elKeysEl ? elKeysEl.onclick = fn : console.error(`Can not find key: ${btn}`);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
var render = function() {
|
|
289
|
-
var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
|
|
290
|
-
return _c("div", {
|
|
291
|
-
class: ["avue-keyboard", _vm.className]
|
|
292
|
-
}, [_c("div", {
|
|
293
|
-
attrs: {
|
|
294
|
-
id: "keyboard"
|
|
295
|
-
}
|
|
296
|
-
})]);
|
|
297
|
-
}, staticRenderFns = [];
|
|
298
|
-
const __vue2_script = {
|
|
299
|
-
name: "Keyboard",
|
|
300
|
-
props: {
|
|
301
|
-
ele: {
|
|
302
|
-
type: String,
|
|
303
|
-
required: !0
|
|
304
|
-
},
|
|
305
|
-
keys: Array,
|
|
306
|
-
theme: {
|
|
307
|
-
type: String,
|
|
308
|
-
default: "default",
|
|
309
|
-
validator: (value) => ["default", "dark", "green", "classic"].includes(value)
|
|
310
|
-
},
|
|
311
|
-
type: {
|
|
312
|
-
type: String,
|
|
313
|
-
default: "default",
|
|
314
|
-
validator: (value) => ["default", "number", "mobile"].includes(value)
|
|
315
|
-
},
|
|
316
|
-
fixedBottomCenter: {
|
|
317
|
-
type: Boolean,
|
|
318
|
-
default: !1
|
|
319
|
-
},
|
|
320
|
-
rebind: {
|
|
321
|
-
type: Boolean,
|
|
322
|
-
default: !0
|
|
323
|
-
}
|
|
324
|
-
},
|
|
325
|
-
data() {
|
|
326
|
-
return {
|
|
327
|
-
customClick: {}
|
|
328
|
-
};
|
|
329
|
-
},
|
|
330
|
-
computed: {
|
|
331
|
-
className() {
|
|
332
|
-
return `avue-keyboard--${this.theme}`;
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
|
-
watch: {
|
|
336
|
-
ele() {
|
|
337
|
-
this.init();
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
mounted() {
|
|
341
|
-
this.init();
|
|
342
|
-
},
|
|
343
|
-
methods: {
|
|
344
|
-
init() {
|
|
345
|
-
if (!this.ele)
|
|
346
|
-
return;
|
|
347
|
-
let keyboard;
|
|
348
|
-
const config = {
|
|
349
|
-
el: "#keyboard",
|
|
350
|
-
style: {},
|
|
351
|
-
keys: this.keys,
|
|
352
|
-
fixedBottomCenter: this.fixedBottomCenter
|
|
353
|
-
};
|
|
354
|
-
this.type === "default" ? keyboard = new Keyboard$1(config) : this.type === "number" && (keyboard = new NumberKeyboard(config));
|
|
355
|
-
const ele = this.ele.indexOf("#") === 0 ? this.ele.substring(1) : this.ele;
|
|
356
|
-
keyboard.inputOn(`#${ele}`, "value", (e, val) => {
|
|
357
|
-
this.$emit("click", e, val);
|
|
358
|
-
}, this.rebind ? this.customClick : null), this.keyboard = keyboard;
|
|
359
|
-
},
|
|
360
|
-
bindClick(btn, fn) {
|
|
361
|
-
this.keyboard.onclick(btn, fn), this.customClick[btn] = fn;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}, __cssModules = {};
|
|
365
|
-
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
366
|
-
__vue2_script,
|
|
367
|
-
render,
|
|
368
|
-
staticRenderFns,
|
|
369
|
-
!1,
|
|
370
|
-
__vue2_injectStyles,
|
|
371
|
-
null,
|
|
372
|
-
null,
|
|
373
|
-
null
|
|
374
|
-
);
|
|
375
|
-
function __vue2_injectStyles(context) {
|
|
376
|
-
for (let o in __cssModules)
|
|
377
|
-
this[o] = __cssModules[o];
|
|
378
|
-
}
|
|
379
|
-
const Keyboard2 = /* @__PURE__ */ function() {
|
|
380
|
-
return __component__.exports;
|
|
381
|
-
}();
|
|
382
|
-
export {
|
|
383
|
-
Keyboard2 as default
|
|
384
|
-
};
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { B as downFile } from "../../chunks/util.89913643.js";
|
|
2
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
|
|
3
|
-
var render = function() {
|
|
4
|
-
var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
|
|
5
|
-
return _c("div", {
|
|
6
|
-
staticClass: "avue-license",
|
|
7
|
-
staticStyle: {
|
|
8
|
-
position: "relative"
|
|
9
|
-
}
|
|
10
|
-
}, [_c("canvas", {
|
|
11
|
-
ref: "canvas",
|
|
12
|
-
attrs: {
|
|
13
|
-
id: `canvas${_vm.id}`
|
|
14
|
-
}
|
|
15
|
-
}), _vm._t("default")], 2);
|
|
16
|
-
}, staticRenderFns = [];
|
|
17
|
-
const __vue2_script = {
|
|
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 beauty = new Image();
|
|
60
|
-
beauty.src = this.img, beauty.onload = () => {
|
|
61
|
-
const width = this.option.width || beauty.width, height = this.option.width ? beauty.height / beauty.width * this.option.width : beauty.height;
|
|
62
|
-
this.$refs.canvas.width = width, this.$refs.canvas.height = height, this.context.clearRect(0, 0, width, height), this.context.drawImage(beauty, 0, 0, width, height), this.list.forEach((ele, index) => {
|
|
63
|
-
const callback = () => {
|
|
64
|
-
index === this.list.length - 1 && setTimeout(() => {
|
|
65
|
-
this.draw = !0;
|
|
66
|
-
}, 0);
|
|
67
|
-
};
|
|
68
|
-
if (ele.img) {
|
|
69
|
-
const img = new Image();
|
|
70
|
-
img.src = ele.img, img.onload = () => {
|
|
71
|
-
const widths = ele.width || img.width, heights = ele.width ? img.height / img.width * ele.width : img.height;
|
|
72
|
-
this.context.drawImage(img, ele.left, ele.top, widths, heights), callback();
|
|
73
|
-
};
|
|
74
|
-
} else
|
|
75
|
-
ele.bold ? this.context.font = `bold ${ele.size}px ${ele.style}` : this.context.font = `${ele.size}px ${ele.style}`, this.context.fillStyle = ele.color, this.context.fillText(ele.text, ele.left, ele.top), this.context.stroke(), callback();
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
},
|
|
79
|
-
getFile(name = new Date().getTime()) {
|
|
80
|
-
return new Promise((resolve) => {
|
|
81
|
-
const time = setInterval(() => {
|
|
82
|
-
if (this.draw) {
|
|
83
|
-
const data = this.canvas.toDataURL("image/jpeg", 1), file = this.dataURLtoFile(data, name);
|
|
84
|
-
clearInterval(time), resolve(file);
|
|
85
|
-
}
|
|
86
|
-
}, 1e3);
|
|
87
|
-
});
|
|
88
|
-
},
|
|
89
|
-
downFile(filename = new Date().getTime()) {
|
|
90
|
-
downFile(this.base64, filename);
|
|
91
|
-
},
|
|
92
|
-
getBase64() {
|
|
93
|
-
return new Promise((resolve) => {
|
|
94
|
-
const time = setInterval(() => {
|
|
95
|
-
if (this.draw) {
|
|
96
|
-
const data = this.canvas.toDataURL("image/jpeg", 1);
|
|
97
|
-
this.base64 = data, clearInterval(time), resolve(data);
|
|
98
|
-
}
|
|
99
|
-
}, 100);
|
|
100
|
-
});
|
|
101
|
-
},
|
|
102
|
-
getPdf(name = new Date().getTime()) {
|
|
103
|
-
const contentWidth = this.canvas.width, contentHeight = this.canvas.height, pageHeight = contentWidth / 592.28 * 841.89;
|
|
104
|
-
let leftHeight = contentHeight, position = 0;
|
|
105
|
-
const imgWidth = 595.28, imgHeight = 592.28 / contentWidth * contentHeight, pageData = this.canvas.toDataURL("image/jpeg", 1), PDF = new window.jsPDF("", "pt", "a4");
|
|
106
|
-
if (leftHeight < pageHeight)
|
|
107
|
-
PDF.addImage(pageData, "JPEG", 0, 0, imgWidth, imgHeight);
|
|
108
|
-
else
|
|
109
|
-
for (; leftHeight > 0; )
|
|
110
|
-
PDF.addImage(pageData, "JPEG", 0, position, imgWidth, imgHeight), leftHeight -= pageHeight, position -= 841.89, leftHeight > 0 && PDF.addPage();
|
|
111
|
-
PDF.save(`${name}.pdf`);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}, __cssModules = {};
|
|
115
|
-
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
116
|
-
__vue2_script,
|
|
117
|
-
render,
|
|
118
|
-
staticRenderFns,
|
|
119
|
-
!1,
|
|
120
|
-
__vue2_injectStyles,
|
|
121
|
-
null,
|
|
122
|
-
null,
|
|
123
|
-
null
|
|
124
|
-
);
|
|
125
|
-
function __vue2_injectStyles(context) {
|
|
126
|
-
for (let o in __cssModules)
|
|
127
|
-
this[o] = __cssModules[o];
|
|
128
|
-
}
|
|
129
|
-
const License = /* @__PURE__ */ function() {
|
|
130
|
-
return __component__.exports;
|
|
131
|
-
}();
|
|
132
|
-
export {
|
|
133
|
-
License as default
|
|
134
|
-
};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
var __async = (__this, __arguments, generator) => new Promise((resolve, reject) => {
|
|
2
|
-
var fulfilled = (value) => {
|
|
3
|
-
try {
|
|
4
|
-
step(generator.next(value));
|
|
5
|
-
} catch (e) {
|
|
6
|
-
reject(e);
|
|
7
|
-
}
|
|
8
|
-
}, rejected = (value) => {
|
|
9
|
-
try {
|
|
10
|
-
step(generator.throw(value));
|
|
11
|
-
} catch (e) {
|
|
12
|
-
reject(e);
|
|
13
|
-
}
|
|
14
|
-
}, step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
15
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
16
|
-
});
|
|
17
|
-
import PhotoSwipe$1 from "photoswipe";
|
|
18
|
-
import "photoswipe/dist/photoswipe.css";
|
|
19
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
|
|
20
|
-
function initPhotoSwipe(options) {
|
|
21
|
-
new PhotoSwipe$1(options).init();
|
|
22
|
-
}
|
|
23
|
-
function photoswipe(_0, _1) {
|
|
24
|
-
return __async(this, arguments, function* (event, thumbnailsWrapperDom, options = { selector: "chat-image" }) {
|
|
25
|
-
const target = event.target;
|
|
26
|
-
if (!(!target || target.classList.contains(options.selector) || target.tagName === "IMG"))
|
|
27
|
-
return;
|
|
28
|
-
const galleryItems = thumbnailsWrapperDom.querySelectorAll(options.selector === "img" ? options.selector : `.${options.selector}`), position = [...galleryItems].findIndex((value) => value === target);
|
|
29
|
-
position >= 0 && (options.index = position);
|
|
30
|
-
const dataSource = yield getDataSource(galleryItems);
|
|
31
|
-
yield initPhotoSwipe({ dataSource, index: position });
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function getDataSource(images) {
|
|
35
|
-
return __async(this, null, function* () {
|
|
36
|
-
const dataSource = [];
|
|
37
|
-
for (let i = 0, length = images.length; i < length; i++) {
|
|
38
|
-
const image = images[i], src = image.getAttribute("data-src") || image.getAttribute("src"), item = {
|
|
39
|
-
src,
|
|
40
|
-
msrc: src,
|
|
41
|
-
alt: image.getAttribute("data-title") || image.getAttribute("alt"),
|
|
42
|
-
element: image
|
|
43
|
-
}, height = image.getAttribute("data-height"), width = image.getAttribute("data-width");
|
|
44
|
-
let rect = { width, height };
|
|
45
|
-
!height && !width && (rect = yield getImageSize(image), image.setAttribute("data-height", rect.height), image.setAttribute("data-width", rect.width)), item.w = rect.width, item.width = rect.width, item.h = rect.height, item.height = rect.height, dataSource.push(item);
|
|
46
|
-
}
|
|
47
|
-
return dataSource;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function getImageSize(ele) {
|
|
51
|
-
const url = ele.getAttribute("data-src") || ele.getAttribute("src"), height = ele.getAttribute("data-height"), width = ele.getAttribute("data-width");
|
|
52
|
-
return height && width ? { width, height } : ele.complete ? {
|
|
53
|
-
width: ele.naturalWidth,
|
|
54
|
-
height: ele.naturalHeight
|
|
55
|
-
} : new Promise((resolve) => {
|
|
56
|
-
const image = new Image();
|
|
57
|
-
image.src = url;
|
|
58
|
-
const rect = {};
|
|
59
|
-
image.complete ? (rect.width = image.width, rect.height = image.height, resolve(rect)) : (image.onload = () => {
|
|
60
|
-
rect.width = image.width, rect.height = image.height, resolve(rect);
|
|
61
|
-
}, image.onerror = () => {
|
|
62
|
-
rect.width = 0, rect.height = 0, resolve(rect);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
var render = function() {
|
|
67
|
-
var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
|
|
68
|
-
return _c("div", {
|
|
69
|
-
ref: "wrapper"
|
|
70
|
-
}, [_vm._t("default", function() {
|
|
71
|
-
return _vm._l(_vm.urls, function(item) {
|
|
72
|
-
return _c("img", {
|
|
73
|
-
key: item.src,
|
|
74
|
-
staticStyle: {
|
|
75
|
-
cursor: "pointer"
|
|
76
|
-
},
|
|
77
|
-
attrs: {
|
|
78
|
-
width: "100",
|
|
79
|
-
src: item.src,
|
|
80
|
-
alt: ""
|
|
81
|
-
},
|
|
82
|
-
on: {
|
|
83
|
-
click: _vm.preview
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}, {
|
|
88
|
-
urls: _vm.urls,
|
|
89
|
-
preview: _vm.preview
|
|
90
|
-
})], 2);
|
|
91
|
-
}, staticRenderFns = [];
|
|
92
|
-
const __vue2_script = {
|
|
93
|
-
name: "PhotoSwipe",
|
|
94
|
-
photoswipe,
|
|
95
|
-
props: {
|
|
96
|
-
urls: Array,
|
|
97
|
-
selector: {
|
|
98
|
-
type: String,
|
|
99
|
-
default: "img"
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
methods: {
|
|
103
|
-
preview(e) {
|
|
104
|
-
return __async(this, null, function* () {
|
|
105
|
-
yield photoswipe(e, this.$refs.wrapper, { selector: this.selector });
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}, __cssModules = {};
|
|
110
|
-
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
111
|
-
__vue2_script,
|
|
112
|
-
render,
|
|
113
|
-
staticRenderFns,
|
|
114
|
-
!1,
|
|
115
|
-
__vue2_injectStyles,
|
|
116
|
-
null,
|
|
117
|
-
null,
|
|
118
|
-
null
|
|
119
|
-
);
|
|
120
|
-
function __vue2_injectStyles(context) {
|
|
121
|
-
for (let o in __cssModules)
|
|
122
|
-
this[o] = __cssModules[o];
|
|
123
|
-
}
|
|
124
|
-
const PhotoSwipe = /* @__PURE__ */ function() {
|
|
125
|
-
return __component__.exports;
|
|
126
|
-
}();
|
|
127
|
-
export {
|
|
128
|
-
PhotoSwipe as default
|
|
129
|
-
};
|