fusions-ui 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/changelog.md +2 -0
- package/components/avatar/index.ts +1 -0
- package/components/avatar/src/avatar.ts +131 -0
- package/components/avatar/src/avatar.vue +104 -0
- package/components/avatar/src/composables/index.ts +1 -0
- package/components/avatar/src/composables/use-avatar.ts +61 -0
- package/components/avatar-group/index.ts +1 -0
- package/components/avatar-group/src/avatar-group.ts +86 -0
- package/components/{fu-avatar-group/fu-avatar-group.vue → avatar-group/src/avatar-group.vue} +27 -34
- package/components/avatar-group/src/composables/index.ts +1 -0
- package/components/avatar-group/src/composables/use-avatar-group.ts +17 -0
- package/components/badge/index.ts +1 -0
- package/components/badge/src/badge.ts +126 -0
- package/components/{fu-badge/fu-badge.vue → badge/src/badge.vue} +26 -62
- package/components/badge/src/composables/badge-custom.ts +51 -0
- package/components/badge/src/composables/index.ts +1 -0
- package/components/banner-arc/index.ts +1 -0
- package/components/banner-arc/src/banner-arc.ts +41 -0
- package/components/banner-arc/src/banner-arc.vue +49 -0
- package/components/banner-arc/src/composables/banner-arc-custom.ts +19 -0
- package/components/banner-arc/src/composables/index.ts +1 -0
- package/components/button/index.ts +1 -0
- package/components/button/src/button.ts +332 -0
- package/components/{fu-button/fu-button.vue → button/src/button.vue} +57 -163
- package/components/button/src/composables/button-custom.ts +90 -0
- package/components/button/src/composables/index.ts +2 -0
- package/components/button/src/composables/use-button.ts +137 -0
- package/components/cell/index.ts +1 -0
- package/components/cell/src/cell.ts +167 -0
- package/components/{fu-cell/fu-cell.vue → cell/src/cell.vue} +29 -38
- package/components/cell/src/composables/index.ts +1 -0
- package/components/cell/src/composables/use-cell.ts +20 -0
- package/components/cell-group/index.ts +1 -0
- package/components/cell-group/src/cell-group.ts +23 -0
- package/components/{fu-cell-group/fu-cell-group.vue → cell-group/src/cell-group.vue} +8 -13
- package/components/checkbox/index.ts +1 -0
- package/components/checkbox/src/checkbox.ts +144 -0
- package/components/checkbox/src/checkbox.vue +270 -0
- package/components/checkbox/src/composables/checkbox-custom.ts +15 -0
- package/components/checkbox/src/composables/index.ts +2 -0
- package/components/checkbox/src/composables/use-checkbox.ts +200 -0
- package/components/code-input/index.ts +1 -0
- package/components/code-input/src/code-input.ts +157 -0
- package/components/code-input/src/code-input.vue +158 -0
- package/components/code-input/src/composables/code-input-custom.ts +74 -0
- package/components/code-input/src/composables/index.ts +2 -0
- package/components/code-input/src/composables/use-code-input.ts +67 -0
- package/components/code-verify/index.ts +1 -0
- package/components/code-verify/src/code-verify.ts +160 -0
- package/components/code-verify/src/code-verify.vue +87 -0
- package/components/code-verify/src/composables/code-verify-custom.ts +23 -0
- package/components/code-verify/src/composables/index.ts +2 -0
- package/components/code-verify/src/composables/use-code-verify.ts +132 -0
- package/components/collapse/index.ts +1 -0
- package/components/collapse/src/collapse.ts +41 -0
- package/components/collapse/src/collapse.vue +48 -0
- package/components/collapse/src/composables/index.ts +1 -0
- package/components/collapse/src/composables/use-collapse.ts +150 -0
- package/components/collapse-item/index.ts +1 -0
- package/components/collapse-item/src/collapse-item.ts +102 -0
- package/components/{fu-collapse-item/fu-collapse-item.vue → collapse-item/src/collapse-item.vue} +20 -159
- package/components/collapse-item/src/composables/index.ts +1 -0
- package/components/collapse-item/src/composables/use-collapse-item.ts +139 -0
- package/components/countdown/index.ts +1 -0
- package/components/countdown/src/composables/index.ts +1 -0
- package/components/countdown/src/composables/use-countdown.ts +133 -0
- package/components/countdown/src/countdown.ts +63 -0
- package/components/countdown/src/countdown.vue +60 -0
- package/components/{fu-countdown/util.js → countdown/src/util.ts} +5 -5
- package/components/datetime-picker/index.ts +1 -0
- package/components/datetime-picker/src/composables/index.ts +1 -0
- package/components/datetime-picker/src/composables/use-datetime-picker.ts +325 -0
- package/components/datetime-picker/src/datetime-picker.ts +223 -0
- package/components/datetime-picker/src/datetime-picker.vue +96 -0
- package/components/form/index.ts +1 -0
- package/components/form/src/composables/index.ts +1 -0
- package/components/form/src/composables/use-form.ts +256 -0
- package/components/form/src/form.ts +108 -0
- package/components/form/src/form.vue +64 -0
- package/components/{fu-form/utils.js → form/src/utils.ts} +49 -42
- package/components/{fu-form/validate.js → form/src/validate.ts} +58 -49
- package/components/form-item/index.ts +1 -0
- package/components/form-item/src/composables/index.ts +1 -0
- package/components/form-item/src/composables/use-form-item.ts +292 -0
- package/components/form-item/src/form-item.ts +81 -0
- package/components/form-item/src/form-item.vue +229 -0
- package/components/fusions-ui/src/fusions-ui.vue +8 -0
- package/components/grid/index.ts +1 -0
- package/components/grid/src/composables/index.ts +1 -0
- package/components/grid/src/composables/use-grid.ts +67 -0
- package/components/grid/src/grid.ts +54 -0
- package/components/grid/src/grid.vue +69 -0
- package/components/grid-item/index.ts +1 -0
- package/components/grid-item/src/composables/grid-item-custom.ts +16 -0
- package/components/grid-item/src/composables/index.ts +2 -0
- package/components/grid-item/src/composables/use-grid-item.ts +55 -0
- package/components/grid-item/src/grid-item.ts +15 -0
- package/components/grid-item/src/grid-item.vue +102 -0
- package/components/icon/index.ts +1 -0
- package/components/icon/src/composables/icon-custom.ts +41 -0
- package/components/icon/src/composables/index.ts +2 -0
- package/components/icon/src/composables/use-icon.ts +14 -0
- package/components/{fu-icon → icon/src}/fuicon.css +584 -584
- package/components/icon/src/fuicon.ts +1023 -0
- package/components/icon/src/icon.ts +84 -0
- package/components/icon/src/icon.vue +92 -0
- package/components/image/index.ts +1 -0
- package/components/image/src/composables/image-custom.ts +36 -0
- package/components/image/src/composables/index.ts +2 -0
- package/components/image/src/composables/use-image.ts +135 -0
- package/components/image/src/image.ts +185 -0
- package/components/image/src/image.vue +152 -0
- package/components/index-anchor/index.ts +1 -0
- package/components/index-anchor/src/composables/index.ts +1 -0
- package/components/index-anchor/src/composables/use-index-anchor.ts +44 -0
- package/components/index-anchor/src/index-anchor.ts +45 -0
- package/components/index-anchor/src/index-anchor.vue +60 -0
- package/components/index-item/index.ts +1 -0
- package/components/index-item/src/composables/index.ts +1 -0
- package/components/index-item/src/composables/use-index-item.ts +75 -0
- package/components/index-item/src/index-item.ts +13 -0
- package/components/index-item/src/index-item.vue +32 -0
- package/components/index-list/index.ts +1 -0
- package/components/index-list/src/composables/index.ts +1 -0
- package/components/index-list/src/composables/use-index-list.ts +297 -0
- package/components/index-list/src/index-list.ts +52 -0
- package/components/index-list/src/index-list.vue +178 -0
- package/components/index.ts +62 -0
- package/components/input/index.ts +1 -0
- package/components/input/src/composables/index.ts +2 -0
- package/components/input/src/composables/input-custom.ts +69 -0
- package/components/input/src/composables/use-input.ts +117 -0
- package/components/input/src/input.ts +360 -0
- package/components/input/src/input.vue +241 -0
- package/components/keyboard/index.ts +1 -0
- package/components/keyboard/src/composables/index.ts +3 -0
- package/components/keyboard/src/composables/use-keyboard-car.ts +99 -0
- package/components/keyboard/src/composables/use-keyboard-number.ts +81 -0
- package/components/keyboard/src/composables/use-keyboard.ts +61 -0
- package/components/keyboard/src/keyboard-car.ts +53 -0
- package/components/{fu-keyboard → keyboard/src}/keyboard-car.vue +37 -199
- package/components/keyboard/src/keyboard-number.ts +44 -0
- package/components/keyboard/src/keyboard-number.vue +108 -0
- package/components/keyboard/src/keyboard.ts +174 -0
- package/components/{fu-keyboard/fu-keyboard.vue → keyboard/src/keyboard.vue} +38 -63
- package/components/line/index.ts +1 -0
- package/components/line/src/composables/index.ts +1 -0
- package/components/line/src/composables/line-custom.ts +30 -0
- package/components/line/src/line.ts +82 -0
- package/components/line/src/line.vue +44 -0
- package/components/link/index.ts +1 -0
- package/components/link/src/composables/index.ts +2 -0
- package/components/link/src/composables/link-custom.ts +19 -0
- package/components/link/src/composables/use-link.ts +33 -0
- package/components/link/src/link.ts +61 -0
- package/components/link/src/link.vue +62 -0
- package/components/loading/index.ts +1 -0
- package/{libs/function/colorGradient.js → components/loading/src/composables/colorGradient.ts} +4 -4
- package/components/loading/src/composables/index.ts +2 -0
- package/components/loading/src/composables/loading-custom.ts +21 -0
- package/components/loading/src/composables/use-loading.ts +100 -0
- package/components/loading/src/loading.ts +77 -0
- package/components/{fu-loading/fu-loading.vue → loading/src/loading.vue} +23 -119
- package/components/loading-more/index.ts +1 -0
- package/components/loading-more/src/loading-more.ts +75 -0
- package/components/{fu-loading-more/fu-loading-more.vue → loading-more/src/loading-more.vue} +18 -19
- package/components/modal/index.ts +1 -0
- package/components/modal/src/composables/index.ts +2 -0
- package/components/modal/src/composables/modal-custom.ts +17 -0
- package/components/modal/src/composables/use-modal.ts +56 -0
- package/components/modal/src/modal.ts +152 -0
- package/components/{fu-modal/fu-modal.vue → modal/src/modal.vue} +41 -69
- package/components/navbar/index.ts +1 -0
- package/components/navbar/src/composables/index.ts +2 -0
- package/components/navbar/src/composables/navbar-custom.ts +62 -0
- package/components/navbar/src/composables/use-navbar.ts +42 -0
- package/components/navbar/src/navbar.ts +151 -0
- package/components/navbar/src/navbar.vue +249 -0
- package/components/notice-bar/index.ts +3 -0
- package/components/notice-bar/src/composables/index.ts +5 -0
- package/components/notice-bar/src/composables/notice-column-custom.ts +43 -0
- package/components/notice-bar/src/composables/notice-row-custom.ts +26 -0
- package/components/notice-bar/src/composables/use-notice-bar.ts +34 -0
- package/components/notice-bar/src/composables/use-notice-column.ts +31 -0
- package/components/notice-bar/src/composables/use-notice-row.ts +88 -0
- package/components/notice-bar/src/notice-bar.ts +197 -0
- package/components/{fu-notice-bar/fu-notice-bar.vue → notice-bar/src/notice-bar.vue} +28 -41
- package/components/notice-bar/src/notice-column.ts +172 -0
- package/components/notice-bar/src/notice-column.vue +129 -0
- package/components/notice-bar/src/notice-row.ts +155 -0
- package/components/notice-bar/src/notice-row.vue +135 -0
- package/components/number-box/index.ts +1 -0
- package/components/number-box/src/composables/index.ts +2 -0
- package/components/number-box/src/composables/number-box-custom.ts +16 -0
- package/components/number-box/src/composables/use-number-box.ts +84 -0
- package/components/number-box/src/number-box.ts +98 -0
- package/components/number-box/src/number-box.vue +123 -0
- package/components/parse/index.ts +1 -0
- package/components/parse/src/app-plus/html/js/handler.js +254 -0
- package/components/parse/src/app-plus/html/js/uni.webview.min.js +188 -0
- package/components/parse/src/app-plus/html/local.html +32 -0
- package/components/parse/src/composables/index.ts +1 -0
- package/components/parse/src/composables/use-parse.ts +428 -0
- package/components/parse/src/node/node.vue +635 -0
- package/components/parse/src/parse.ts +156 -0
- package/components/parse/src/parse.vue +131 -0
- package/components/parse/src/parser.ts +1402 -0
- package/components/picker/index.ts +1 -0
- package/components/picker/src/composables/index.ts +2 -0
- package/components/picker/src/composables/picker-custom.ts +40 -0
- package/components/picker/src/composables/use-picker.ts +179 -0
- package/components/picker/src/picker.ts +172 -0
- package/components/picker/src/picker.vue +197 -0
- package/components/popup/index.ts +1 -0
- package/components/popup/src/composables/index.ts +1 -0
- package/components/popup/src/composables/use-popup.ts +346 -0
- package/components/popup/src/keypress.ts +55 -0
- package/components/popup/src/popup.ts +101 -0
- package/components/popup/src/popup.vue +204 -0
- package/components/progress/index.ts +1 -0
- package/components/progress/src/composables/index.ts +2 -0
- package/components/progress/src/composables/progress-custom.ts +24 -0
- package/components/progress/src/composables/use-progress.ts +159 -0
- package/components/progress/src/progress.ts +84 -0
- package/components/progress/src/progress.vue +150 -0
- package/components/rate/index.ts +1 -0
- package/components/rate/src/composables/index.ts +1 -0
- package/components/rate/src/composables/use-rate.ts +196 -0
- package/components/rate/src/rate.ts +114 -0
- package/components/rate/src/rate.vue +113 -0
- package/components/read-more/index.ts +1 -0
- package/components/read-more/src/composables/index.ts +2 -0
- package/components/read-more/src/composables/read-more-custom.ts +46 -0
- package/components/read-more/src/composables/use-read-more.ts +72 -0
- package/components/read-more/src/read-more.ts +102 -0
- package/components/read-more/src/read-more.vue +104 -0
- package/components/safe-bottom/index.ts +1 -0
- package/components/safe-bottom/src/composables/index.ts +2 -0
- package/components/safe-bottom/src/composables/safe-bottom-custom.ts +18 -0
- package/components/safe-bottom/src/composables/use-safe-bottom.ts +17 -0
- package/components/safe-bottom/src/safe-bottom.ts +8 -0
- package/components/safe-bottom/src/safe-bottom.vue +43 -0
- package/components/scroll-list/index.ts +1 -0
- package/components/scroll-list/src/composables/index.ts +2 -0
- package/components/scroll-list/src/composables/scroll-list-custom.ts +41 -0
- package/components/scroll-list/src/composables/use-scroll-list.ts +126 -0
- package/components/scroll-list/src/scroll-list.ts +57 -0
- package/components/scroll-list/src/scroll-list.vue +143 -0
- package/components/{fu-scroll-list/scrollWxs.wxs → scroll-list/src/scroll-wxs.wxs} +2 -2
- package/components/search/index.ts +1 -0
- package/components/search/src/composables/index.ts +2 -0
- package/components/search/src/composables/search-custom.ts +25 -0
- package/components/search/src/composables/use-search.ts +106 -0
- package/components/search/src/search.ts +186 -0
- package/components/{fu-search/fu-search.vue → search/src/search.vue} +42 -154
- package/components/section/index.ts +1 -0
- package/components/section/src/composables/index.ts +1 -0
- package/components/section/src/composables/use-section.ts +19 -0
- package/components/section/src/section.ts +83 -0
- package/components/{fu-section/fu-section.vue → section/src/section.vue} +36 -35
- package/components/sign-board/index.ts +1 -0
- package/components/sign-board/src/composables/index.ts +1 -0
- package/components/sign-board/src/composables/use-sign-board.ts +552 -0
- package/components/sign-board/src/sign-board.ts +48 -0
- package/components/sign-board/src/sign-board.vue +191 -0
- package/components/skeleton/index.ts +1 -0
- package/components/skeleton/src/composables/index.ts +2 -0
- package/components/skeleton/src/composables/skeleton-custom.ts +23 -0
- package/components/skeleton/src/composables/use-skeleton.ts +102 -0
- package/components/skeleton/src/skeleton.ts +37 -0
- package/components/skeleton/src/skeleton.vue +147 -0
- package/components/status-bar/src/composables/index.ts +1 -0
- package/components/status-bar/src/composables/use-status-bar.ts +29 -0
- package/components/status-bar/src/status-bar.vue +21 -0
- package/components/steps/index.ts +1 -0
- package/components/steps/src/composables/index.ts +1 -0
- package/components/steps/src/composables/use-steps.ts +27 -0
- package/components/steps/src/steps.ts +65 -0
- package/components/steps/src/steps.vue +46 -0
- package/components/steps-item/index.ts +1 -0
- package/components/steps-item/src/composables/index.ts +2 -0
- package/components/steps-item/src/composables/steps-item-custom.ts +81 -0
- package/components/steps-item/src/composables/use-steps-item.ts +87 -0
- package/components/steps-item/src/steps-item.ts +38 -0
- package/components/steps-item/src/steps-item.vue +224 -0
- package/components/sticky/index.ts +1 -0
- package/components/sticky/src/composables/index.ts +2 -0
- package/components/sticky/src/composables/sticky-custom.ts +57 -0
- package/components/sticky/src/composables/use-sticky.ts +152 -0
- package/components/sticky/src/sticky.ts +62 -0
- package/components/sticky/src/sticky.vue +65 -0
- package/components/subsection/index.ts +1 -0
- package/components/subsection/src/composables/index.ts +2 -0
- package/components/subsection/src/composables/subsection-custom.ts +71 -0
- package/components/subsection/src/composables/use-subsection.ts +85 -0
- package/components/subsection/src/subsection.ts +107 -0
- package/components/subsection/src/subsection.vue +165 -0
- package/components/swipe-action/src/composables/index.ts +1 -0
- package/components/swipe-action/src/composables/use-swipe-action.ts +58 -0
- package/components/swipe-action/src/swipe-action.vue +81 -0
- package/components/swipe-action-item/index.ts +1 -0
- package/components/{fu-swipe-action-item/mpwxs.js → swipe-action-item/src/mpwxs.ts} +22 -27
- package/components/swipe-action-item/src/swipe-action-item.ts +68 -0
- package/components/{fu-swipe-action-item/fu-swipe-action-item.vue → swipe-action-item/src/swipe-action-item.vue} +24 -17
- package/components/{fu-swipe-action-item → swipe-action-item/src}/wx.wxs +2 -2
- package/components/swiper/index.ts +1 -0
- package/components/swiper/src/composables/index.ts +2 -0
- package/components/swiper/src/composables/swiper-custom.ts +40 -0
- package/components/swiper/src/composables/use-swiper.ts +75 -0
- package/components/swiper/src/swiper.ts +189 -0
- package/components/{fu-swiper/fu-swiper.vue → swiper/src/swiper.vue} +49 -118
- package/components/switch/index.ts +1 -0
- package/components/switch/src/composables/index.ts +2 -0
- package/components/switch/src/composables/switch-custom.ts +32 -0
- package/components/switch/src/composables/use-switch.ts +38 -0
- package/components/switch/src/switch.ts +115 -0
- package/components/{fu-switch/fu-switch.vue → switch/src/switch.vue} +25 -73
- package/components/tabs/index.ts +1 -0
- package/components/tabs/src/composables/index.ts +2 -0
- package/components/tabs/src/composables/tabs-custom.ts +43 -0
- package/components/tabs/src/composables/use-tabs.ts +210 -0
- package/components/tabs/src/tabs.ts +123 -0
- package/components/tabs/src/tabs.vue +153 -0
- package/components/tag/index.ts +1 -0
- package/components/tag/src/composables/index.ts +2 -0
- package/components/tag/src/composables/tag-custom.ts +61 -0
- package/components/tag/src/composables/use-tag.ts +23 -0
- package/components/tag/src/tag.ts +159 -0
- package/components/{fu-tag/fu-tag.vue → tag/src/tag.vue} +53 -93
- package/components/text/index.ts +1 -0
- package/components/text/src/composables/index.ts +2 -0
- package/components/text/src/composables/text-custom.ts +120 -0
- package/components/text/src/composables/use-text.ts +83 -0
- package/components/text/src/text.ts +261 -0
- package/components/text/src/text.vue +186 -0
- package/components/textarea/index.ts +1 -0
- package/components/textarea/src/composables/index.ts +2 -0
- package/components/textarea/src/composables/textarea-custom.ts +50 -0
- package/components/textarea/src/composables/use-textarea.ts +88 -0
- package/components/textarea/src/textarea.ts +250 -0
- package/components/textarea/src/textarea.vue +162 -0
- package/components/{fu-timeaxis/fu-timeaxis.vue → timeaxis/src/timeaxis.vue} +3 -9
- package/components/timeaxis-item/index.ts +1 -0
- package/components/timeaxis-item/src/timeaxis-item.ts +20 -0
- package/components/timeaxis-item/src/timeaxis-item.vue +50 -0
- package/components/transition/index.ts +1 -0
- package/components/transition/src/composables/createAnimation.ts +171 -0
- package/components/transition/src/composables/index.ts +2 -0
- package/components/transition/src/composables/transform-custom.ts +18 -0
- package/components/transition/src/composables/use-transition.ts +251 -0
- package/components/transition/src/transition.ts +64 -0
- package/components/transition/src/transition.vue +70 -0
- package/components/upload/index.ts +1 -0
- package/components/upload/src/composables/index.ts +5 -0
- package/components/upload/src/composables/upload-file-custom.ts +68 -0
- package/components/upload/src/composables/upload-image-custom.ts +76 -0
- package/components/upload/src/composables/use-upload-file.ts +27 -0
- package/components/upload/src/composables/use-upload-image.ts +38 -0
- package/components/upload/src/composables/use-upload.ts +388 -0
- package/components/upload/src/upload-file.ts +84 -0
- package/components/upload/src/upload-file.vue +193 -0
- package/components/upload/src/upload-image.ts +90 -0
- package/components/upload/src/upload-image.vue +158 -0
- package/components/upload/src/upload.ts +196 -0
- package/components/upload/src/upload.vue +151 -0
- package/components/{fu-upload/utils.js → upload/src/utils.ts} +12 -12
- package/components/vtabs/index.ts +1 -0
- package/components/vtabs/src/composables/index.ts +2 -0
- package/components/vtabs/src/composables/use-vtabs.ts +276 -0
- package/components/vtabs/src/composables/vtabs-custom.ts +54 -0
- package/components/vtabs/src/vtabs.ts +130 -0
- package/components/vtabs/src/vtabs.vue +189 -0
- package/components/vtabs-item/index.ts +1 -0
- package/components/vtabs-item/src/composables/index.ts +1 -0
- package/components/vtabs-item/src/composables/use-vtabs-item.ts +60 -0
- package/components/vtabs-item/src/vtabs-item.ts +10 -0
- package/components/vtabs-item/src/vtabs-item.vue +20 -0
- package/components/waterfall/index.ts +1 -0
- package/components/waterfall/src/composables/index.ts +2 -0
- package/components/waterfall/src/composables/use-waterfall.ts +139 -0
- package/components/waterfall/src/composables/waterfall-custom.ts +18 -0
- package/components/waterfall/src/waterfall.ts +114 -0
- package/components/waterfall/src/waterfall.vue +104 -0
- package/{libs/config/config.js → config/config.ts} +13 -7
- package/constants/images.ts +18 -0
- package/constants/index.ts +6 -0
- package/constants/open-types.ts +33 -0
- package/constants/props.ts +18 -0
- package/constants/shapes.ts +6 -0
- package/constants/types.ts +10 -0
- package/constants/z-index.ts +27 -0
- package/global.d.ts +103 -0
- package/hooks/index.ts +25 -0
- package/index.scss +3 -5
- package/index.ts +56 -0
- package/package.json +1 -1
- package/{libs/route/min.route.config.js → route/min.route.config.ts} +62 -23
- package/route/route.config.ts +93 -0
- package/style/color.scss +26 -0
- package/{libs/style → style}/common.scss +1 -14
- package/{libs/function/applyEven.js → utils/applyEven.ts} +21 -12
- package/utils/check.ts +276 -0
- package/{libs/function/chooseUploadFile.js → utils/chooseUploadFile.ts} +22 -26
- package/utils/common.ts +609 -0
- package/{libs/function/digit.js → utils/digit.ts} +63 -33
- package/{components/fu-swipe-action-item/isPC.js → utils/isPC.ts} +1 -1
- package/utils/toast.ts +42 -0
- package/components/fu-avatar/fu-avatar.vue +0 -157
- package/components/fu-avatar/props.js +0 -117
- package/components/fu-avatar-group/props.js +0 -74
- package/components/fu-badge/props.js +0 -112
- package/components/fu-banner-arc/fu-banner-arc.vue +0 -58
- package/components/fu-banner-arc/props.js +0 -35
- package/components/fu-button/props.js +0 -228
- package/components/fu-cell/props.js +0 -108
- package/components/fu-cell-group/props.js +0 -19
- package/components/fu-checkbox/fu-checkbox.vue +0 -469
- package/components/fu-checkbox/props.js +0 -126
- package/components/fu-code-input/fu-code-input.vue +0 -269
- package/components/fu-code-input/props.js +0 -136
- package/components/fu-code-verify/fu-code-verify.vue +0 -221
- package/components/fu-code-verify/props.js +0 -136
- package/components/fu-collapse/fu-collapse.vue +0 -143
- package/components/fu-collapse/props.js +0 -29
- package/components/fu-collapse-item/props.js +0 -101
- package/components/fu-countdown/fu-countdown.vue +0 -164
- package/components/fu-countdown/props.js +0 -35
- package/components/fu-datetime-picker/fu-datetime-picker.vue +0 -375
- package/components/fu-datetime-picker/props.js +0 -194
- package/components/fu-form/fu-form.vue +0 -284
- package/components/fu-form/props.js +0 -74
- package/components/fu-form-item/fu-form-item.vue +0 -535
- package/components/fu-form-item/props.js +0 -66
- package/components/fu-grid/fu-grid.vue +0 -113
- package/components/fu-grid/props.js +0 -44
- package/components/fu-grid-item/fu-grid-item.vue +0 -136
- package/components/fu-grid-item/props.js +0 -27
- package/components/fu-icon/fu-icon.vue +0 -110
- package/components/fu-icon/fuicon.js +0 -1031
- package/components/fu-icon/props.js +0 -55
- package/components/fu-image/fu-image.vue +0 -268
- package/components/fu-image/props.js +0 -145
- package/components/fu-index-anchor/fu-index-anchor.vue +0 -91
- package/components/fu-index-anchor/props.js +0 -43
- package/components/fu-index-item/fu-index-item.vue +0 -79
- package/components/fu-index-list/fu-index-list.vue +0 -426
- package/components/fu-index-list/props.js +0 -42
- package/components/fu-input/fu-input.vue +0 -393
- package/components/fu-input/props.js +0 -291
- package/components/fu-keyboard/keyboard-number.vue +0 -195
- package/components/fu-keyboard/props.js +0 -138
- package/components/fu-line/fu-line.vue +0 -64
- package/components/fu-line/props.js +0 -58
- package/components/fu-link/fu-link.vue +0 -91
- package/components/fu-link/props.js +0 -49
- package/components/fu-loading/props.js +0 -60
- package/components/fu-loading-more/props.js +0 -59
- package/components/fu-modal/props.js +0 -128
- package/components/fu-navbar/fu-navbar.vue +0 -271
- package/components/fu-navbar/props.js +0 -72
- package/components/fu-navbar/status-bar.vue +0 -27
- package/components/fu-notice-bar/notice-column.vue +0 -313
- package/components/fu-notice-bar/notice-row.vue +0 -363
- package/components/fu-notice-bar/props.js +0 -173
- package/components/fu-number-box/fu-number-box.vue +0 -210
- package/components/fu-number-box/props.js +0 -79
- package/components/fu-parse/fu-parse.vue +0 -508
- package/components/fu-parse/node/node.vue +0 -576
- package/components/fu-parse/parser.js +0 -1335
- package/components/fu-picker/fu-picker.vue +0 -347
- package/components/fu-picker/props.js +0 -150
- package/components/fu-popup/fu-popup.vue +0 -475
- package/components/fu-popup/keypress.js +0 -45
- package/components/fu-popup/props.js +0 -83
- package/components/fu-progress/fu-progress.vue +0 -292
- package/components/fu-progress/props.js +0 -76
- package/components/fu-rate/fu-rate.vue +0 -301
- package/components/fu-rate/props.js +0 -103
- package/components/fu-read-more/fu-read-more.vue +0 -191
- package/components/fu-read-more/props.js +0 -72
- package/components/fu-ribbon/fu-ribbon.vue +0 -106
- package/components/fu-ribbon/props.js +0 -35
- package/components/fu-safe-area/fu-safe-area.vue +0 -61
- package/components/fu-scroll-list/fu-scroll-list.vue +0 -196
- package/components/fu-scroll-list/nvue.js +0 -28
- package/components/fu-scroll-list/props.js +0 -43
- package/components/fu-search/props.js +0 -149
- package/components/fu-section/props.js +0 -59
- package/components/fu-sign-board/fu-sign-board.vue +0 -730
- package/components/fu-sign-board/props.js +0 -34
- package/components/fu-skeleton/fu-skeleton.vue +0 -238
- package/components/fu-skeleton/props.js +0 -35
- package/components/fu-steps/fu-steps.vue +0 -81
- package/components/fu-steps/props.js +0 -55
- package/components/fu-steps-item/fu-steps-item.vue +0 -274
- package/components/fu-steps-item/props.js +0 -34
- package/components/fu-sticky/fu-sticky.vue +0 -232
- package/components/fu-sticky/props.js +0 -54
- package/components/fu-subsection/fu-subsection.vue +0 -288
- package/components/fu-subsection/props.js +0 -88
- package/components/fu-swipe-action/fu-swipe-action.vue +0 -64
- package/components/fu-swipe-action-item/props.js +0 -54
- package/components/fu-swiper/props.js +0 -163
- package/components/fu-switch/props.js +0 -102
- package/components/fu-tabs/fu-tabs.vue +0 -361
- package/components/fu-tabs/props.js +0 -109
- package/components/fu-tag/props.js +0 -135
- package/components/fu-text/button.js +0 -13
- package/components/fu-text/fu-text.vue +0 -254
- package/components/fu-text/openType.js +0 -47
- package/components/fu-text/props.js +0 -173
- package/components/fu-text/value.js +0 -88
- package/components/fu-textarea/fu-textarea.vue +0 -288
- package/components/fu-textarea/props.js +0 -206
- package/components/fu-timeaxis-item/fu-timeaxis-item.vue +0 -68
- package/components/fu-transition/createAnimation.js +0 -131
- package/components/fu-transition/fu-transition.vue +0 -292
- package/components/fu-transition/props.js +0 -21
- package/components/fu-upload/fu-upload.vue +0 -563
- package/components/fu-upload/props.js +0 -171
- package/components/fu-upload/upload-file.vue +0 -332
- package/components/fu-upload/upload-image.vue +0 -304
- package/components/fu-vtabs/fu-vtabs.vue +0 -443
- package/components/fu-vtabs/props.js +0 -114
- package/components/fu-vtabs-item/fu-vtabs-item.vue +0 -71
- package/components/fu-waterfall/fu-waterfall.vue +0 -238
- package/components/fu-waterfall/props.js +0 -85
- package/index.js +0 -71
- package/libs/function/check.js +0 -215
- package/libs/function/common.js +0 -527
- package/libs/function/message.js +0 -47
- package/libs/mixin/button.js +0 -85
- package/libs/mixin/mixin.js +0 -94
- package/libs/mixin/mpMixin.js +0 -8
- package/libs/mixin/mpShare.js +0 -15
- package/libs/route/route.config.js +0 -66
- package/libs/style/color.scss +0 -24
- /package/components/{fu-icon → icon/src}/fuicon.ttf +0 -0
- /package/components/{fu-swipe-action-item → swipe-action-item/src}/bindingx.js +0 -0
- /package/components/{fu-swipe-action-item → swipe-action-item/src}/mpalipay.js +0 -0
- /package/components/{fu-swipe-action-item → swipe-action-item/src}/mpother.js +0 -0
- /package/components/{fu-swipe-action-item → swipe-action-item/src}/render.js +0 -0
- /package/{libs/style → style}/components.scss +0 -0
- /package/{libs/style → style}/style.h5.scss +0 -0
- /package/{libs/style → style}/style.mp.scss +0 -0
- /package/{libs/function → utils}/dayjs.js +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { computed, ref, type SetupContext } from 'vue';
|
|
2
|
+
import type { KeyboardNumberProps, KeyboardNumberEmits } from '../keyboard-number';
|
|
3
|
+
|
|
4
|
+
export const useKeyboardNumber = (props : KeyboardNumberProps, $emit : SetupContext<KeyboardNumberEmits>['emit']) => {
|
|
5
|
+
const backspace = 'backspace'; // 退格键内容
|
|
6
|
+
const dot = '.'; // 点
|
|
7
|
+
const cardX = 'X'; // 身份证的X符号
|
|
8
|
+
const timer = ref<any>(null); // 长按多次删除的事件监听
|
|
9
|
+
|
|
10
|
+
// 键盘需要显示的内容
|
|
11
|
+
const numList = computed(() => {
|
|
12
|
+
if (props.dotDisabled && props.mode == 'number') {
|
|
13
|
+
if (!props.random) {
|
|
14
|
+
return [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
|
|
15
|
+
} else {
|
|
16
|
+
return uni.$fu.randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]);
|
|
17
|
+
}
|
|
18
|
+
} else if (!props.dotDisabled && props.mode == 'number') {
|
|
19
|
+
if (!props.random) {
|
|
20
|
+
return [1, 2, 3, 4, 5, 6, 7, 8, 9, dot, 0];
|
|
21
|
+
} else {
|
|
22
|
+
let data = uni.$fu.randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]);
|
|
23
|
+
data.splice(-1, 0, dot,)
|
|
24
|
+
return data
|
|
25
|
+
}
|
|
26
|
+
} else if (props.mode == 'card') {
|
|
27
|
+
if (!props.random) {
|
|
28
|
+
return [1, 2, 3, 4, 5, 6, 7, 8, 9, cardX, 0];
|
|
29
|
+
} else {
|
|
30
|
+
return uni.$fu.randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, cardX, 0]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// 按键的样式,在非乱序&&数字键盘&&不显示点按钮时,index为9时,按键占位两个空间
|
|
36
|
+
const itemStyle = computed(() => {
|
|
37
|
+
return (index: number) => {
|
|
38
|
+
let style: Record<string, any> = {};
|
|
39
|
+
if (props.mode == 'number' && props.dotDisabled && index == 9) style.width = '464rpx';
|
|
40
|
+
return style;
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// 是否让按键显示灰色,只在非乱序&&数字键盘&&且允许点按键的时候
|
|
45
|
+
const btnBgGray = computed(() => {
|
|
46
|
+
return (index: number) => {
|
|
47
|
+
if (!props.random && index == 9 && (props.mode != 'number' || (props.mode == 'number' && !props.dotDisabled))) return true;
|
|
48
|
+
else return false;
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// 点击退格键
|
|
53
|
+
const backspaceClick = () => {
|
|
54
|
+
$emit('backspace');
|
|
55
|
+
clearInterval(timer.value); //再次清空定时器,防止重复注册定时器
|
|
56
|
+
timer.value = null;
|
|
57
|
+
timer.value = setInterval(() => {
|
|
58
|
+
$emit('backspace');
|
|
59
|
+
}, 250);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const clearTimer = () => {
|
|
63
|
+
clearInterval(timer.value);
|
|
64
|
+
timer.value = null;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// 获取键盘显示的内容
|
|
68
|
+
const keyboardClick = (val: string | number) => {
|
|
69
|
+
// 允许键盘显示点模式和触发非点按键时,将内容转为数字类型
|
|
70
|
+
if (!props.dotDisabled && val != dot && val != cardX) val = Number(val);
|
|
71
|
+
$emit('change', val);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
numList,
|
|
76
|
+
itemStyle,
|
|
77
|
+
backspaceClick,
|
|
78
|
+
clearTimer,
|
|
79
|
+
keyboardClick
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ref, type SetupContext } from 'vue';
|
|
2
|
+
import type { KeyboardProps, KeyboardEmits } from '../keyboard';
|
|
3
|
+
|
|
4
|
+
export const useKeyboard = (props : KeyboardProps, $emit : SetupContext<KeyboardEmits>['emit']) => {
|
|
5
|
+
const popupRef = ref<any>(null);
|
|
6
|
+
const keyboardCarRef = ref<any>(null);
|
|
7
|
+
|
|
8
|
+
// 打开
|
|
9
|
+
const open = () => {
|
|
10
|
+
popupRef.value?.open();
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// 关闭
|
|
14
|
+
const close = () => {
|
|
15
|
+
popupRef.value?.close();
|
|
16
|
+
$emit('close')
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const change = (e: string | number) => {
|
|
20
|
+
$emit('change', e);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// 输入完成
|
|
24
|
+
const handleConfirm = () => {
|
|
25
|
+
$emit('confirm');
|
|
26
|
+
if(props.closeOnClickConfirm) close();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// 取消输入
|
|
30
|
+
const handleCancel = () => {
|
|
31
|
+
$emit('cancel');
|
|
32
|
+
close();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// 退格键
|
|
36
|
+
const backspace = () => {
|
|
37
|
+
$emit('backspace');
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// car模式切换中文|英文方法
|
|
41
|
+
const changeCarInputMode = (e) => {
|
|
42
|
+
$emit('changeCarInputMode',e);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const changeCarMode = () => {
|
|
46
|
+
keyboardCarRef.value?.changeCarInputMode?.();
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
popupRef,
|
|
51
|
+
keyboardCarRef,
|
|
52
|
+
open,
|
|
53
|
+
close,
|
|
54
|
+
change,
|
|
55
|
+
handleConfirm,
|
|
56
|
+
handleCancel,
|
|
57
|
+
backspace,
|
|
58
|
+
changeCarInputMode,
|
|
59
|
+
changeCarMode
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const keyboardCarProps = {
|
|
4
|
+
/**
|
|
5
|
+
* @description 是否打乱键盘按键的顺序
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
random: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: false
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* @description 输入一个中文后,是否自动切换到英文
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
autoChange: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* @description 被禁用的键
|
|
22
|
+
*/
|
|
23
|
+
disKeys: {
|
|
24
|
+
type: Array,
|
|
25
|
+
default: () => []
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* @description 是否自定义abc
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
customabc: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const keyboardCarEmits = {
|
|
38
|
+
/**
|
|
39
|
+
* @description 点击键盘触发
|
|
40
|
+
*/
|
|
41
|
+
change: (_e: any) => true,
|
|
42
|
+
/**
|
|
43
|
+
* @description 点击退格键触发
|
|
44
|
+
*/
|
|
45
|
+
backspace: () => true,
|
|
46
|
+
/**
|
|
47
|
+
* @description 切换中英文模式触发
|
|
48
|
+
*/
|
|
49
|
+
changeCarInputMode: (_e: any) => true
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type KeyboardCarProps = ExtractPropTypes<typeof keyboardCarProps>;
|
|
53
|
+
export type KeyboardCarEmits = typeof keyboardCarEmits;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
</view>
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
|
-
<script>
|
|
35
|
+
<script lang="ts" setup>
|
|
36
36
|
/**
|
|
37
37
|
* keyboardCar 键盘组件
|
|
38
38
|
* @description keyboardCar 车牌号自定义的键盘面板,内含了数字键盘,车牌号键,身份证号键盘3种模式,都有可以打乱按键顺序的选项。
|
|
@@ -45,210 +45,48 @@
|
|
|
45
45
|
* @event {Function} backspace 点击退格键触发
|
|
46
46
|
* @example <fu-keyboard ref="uKeyboard" mode="car" v-model="show"></fu-keyboard>
|
|
47
47
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
default: false
|
|
67
|
-
},
|
|
68
|
-
/**
|
|
69
|
-
* @description 被禁用的键
|
|
70
|
-
*/
|
|
71
|
-
disKeys: {
|
|
72
|
-
type: Array,
|
|
73
|
-
default: ()=>[]
|
|
74
|
-
},
|
|
75
|
-
/**
|
|
76
|
-
* @description 是否自定义abc
|
|
77
|
-
* @default false
|
|
78
|
-
*/
|
|
79
|
-
customabc: {
|
|
80
|
-
type: Boolean,
|
|
81
|
-
default: false
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
data() {
|
|
85
|
-
return {
|
|
86
|
-
// 车牌输入时,abc=true为输入车牌号码,bac=false为输入省份中文简称
|
|
87
|
-
abc: false
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
computed: {
|
|
91
|
-
areaList() {
|
|
92
|
-
let data = [
|
|
93
|
-
'京',
|
|
94
|
-
'沪',
|
|
95
|
-
'粤',
|
|
96
|
-
'津',
|
|
97
|
-
'冀',
|
|
98
|
-
'豫',
|
|
99
|
-
'云',
|
|
100
|
-
'辽',
|
|
101
|
-
'黑',
|
|
102
|
-
'湘',
|
|
103
|
-
'皖',
|
|
104
|
-
'鲁',
|
|
105
|
-
'苏',
|
|
106
|
-
'浙',
|
|
107
|
-
'赣',
|
|
108
|
-
'鄂',
|
|
109
|
-
'桂',
|
|
110
|
-
'甘',
|
|
111
|
-
'晋',
|
|
112
|
-
'陕',
|
|
113
|
-
'蒙',
|
|
114
|
-
'吉',
|
|
115
|
-
'闽',
|
|
116
|
-
'贵',
|
|
117
|
-
'渝',
|
|
118
|
-
'川',
|
|
119
|
-
'青',
|
|
120
|
-
'琼',
|
|
121
|
-
'宁',
|
|
122
|
-
'挂',
|
|
123
|
-
'藏',
|
|
124
|
-
'港',
|
|
125
|
-
'澳',
|
|
126
|
-
'新',
|
|
127
|
-
'使',
|
|
128
|
-
'学'
|
|
129
|
-
];
|
|
130
|
-
let tmp = [];
|
|
131
|
-
// 打乱顺序
|
|
132
|
-
if (this.random) data = this.$fu.randomArray(data);
|
|
133
|
-
// 切割成二维数组
|
|
134
|
-
tmp[0] = data.slice(0, 10);
|
|
135
|
-
tmp[1] = data.slice(10, 20);
|
|
136
|
-
tmp[2] = data.slice(20, 30);
|
|
137
|
-
tmp[3] = data.slice(30, 36);
|
|
138
|
-
return tmp;
|
|
139
|
-
},
|
|
140
|
-
engKeyBoardList() {
|
|
141
|
-
let data = [
|
|
142
|
-
1,
|
|
143
|
-
2,
|
|
144
|
-
3,
|
|
145
|
-
4,
|
|
146
|
-
5,
|
|
147
|
-
6,
|
|
148
|
-
7,
|
|
149
|
-
8,
|
|
150
|
-
9,
|
|
151
|
-
0,
|
|
152
|
-
'Q',
|
|
153
|
-
'W',
|
|
154
|
-
'E',
|
|
155
|
-
'R',
|
|
156
|
-
'T',
|
|
157
|
-
'Y',
|
|
158
|
-
'U',
|
|
159
|
-
'I',
|
|
160
|
-
'O',
|
|
161
|
-
'P',
|
|
162
|
-
'A',
|
|
163
|
-
'S',
|
|
164
|
-
'D',
|
|
165
|
-
'F',
|
|
166
|
-
'G',
|
|
167
|
-
'H',
|
|
168
|
-
'J',
|
|
169
|
-
'K',
|
|
170
|
-
'L',
|
|
171
|
-
'Z',
|
|
172
|
-
'X',
|
|
173
|
-
'C',
|
|
174
|
-
'V',
|
|
175
|
-
'B',
|
|
176
|
-
'N',
|
|
177
|
-
'M'
|
|
178
|
-
];
|
|
179
|
-
let tmp = [];
|
|
180
|
-
if (this.random) data = this.$fu.randomArray(data);
|
|
181
|
-
tmp[0] = data.slice(0, 10);
|
|
182
|
-
tmp[1] = data.slice(10, 20);
|
|
183
|
-
tmp[2] = data.slice(20, 30);
|
|
184
|
-
tmp[3] = data.slice(30, 36);
|
|
185
|
-
return tmp;
|
|
186
|
-
},
|
|
187
|
-
isDisabled(i,j) {
|
|
188
|
-
return (i,j)=>{
|
|
189
|
-
let value = '';
|
|
190
|
-
if (this.abc) value = this.engKeyBoardList[i][j];
|
|
191
|
-
else value = this.areaList[i][j];
|
|
192
|
-
return this.disKeys.indexOf(value) > -1;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
methods: {
|
|
197
|
-
// 点击键盘按钮
|
|
198
|
-
carInputClick(i, j) {
|
|
199
|
-
if(this.isDisabled(i,j)) return;
|
|
200
|
-
let value = '';
|
|
201
|
-
// 不同模式,获取不同数组的值
|
|
202
|
-
if (this.abc) value = this.engKeyBoardList[i][j];
|
|
203
|
-
else value = this.areaList[i][j];
|
|
204
|
-
// 如果允许自动切换,则将中文状态切换为英文
|
|
205
|
-
if (!this.abc && this.autoChange) this.$fu.sleep(200).then(() => this.abc = true)
|
|
206
|
-
this.$emit('change', value);
|
|
207
|
-
},
|
|
208
|
-
// 修改汽车牌键盘的输入模式,中文|英文
|
|
209
|
-
changeCarInputMode() {
|
|
210
|
-
this.abc = !this.abc;
|
|
211
|
-
this.$emit('changeCarInputMode',this.abc);
|
|
212
|
-
},
|
|
213
|
-
// 点击退格键
|
|
214
|
-
backspaceClick() {
|
|
215
|
-
this.$emit('backspace');
|
|
216
|
-
clearInterval(this.timer); //再次清空定时器,防止重复注册定时器
|
|
217
|
-
this.timer = null;
|
|
218
|
-
this.timer = setInterval(() => {
|
|
219
|
-
this.$emit('backspace');
|
|
220
|
-
}, 250);
|
|
221
|
-
},
|
|
222
|
-
clearTimer() {
|
|
223
|
-
clearInterval(this.timer);
|
|
224
|
-
this.timer = null;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
};
|
|
48
|
+
import { keyboardCarEmits, keyboardCarProps } from './keyboard-car';
|
|
49
|
+
import { useKeyboardCar } from './composables';
|
|
50
|
+
|
|
51
|
+
defineOptions({ name: 'KeyboardCar', options: { virtualHost: true } });
|
|
52
|
+
|
|
53
|
+
const props = defineProps(keyboardCarProps);
|
|
54
|
+
const $emit = defineEmits(keyboardCarEmits);
|
|
55
|
+
|
|
56
|
+
const {
|
|
57
|
+
abc,
|
|
58
|
+
areaList,
|
|
59
|
+
engKeyBoardList,
|
|
60
|
+
isDisabled,
|
|
61
|
+
carInputClick,
|
|
62
|
+
changeCarInputMode,
|
|
63
|
+
backspaceClick,
|
|
64
|
+
clearTimer
|
|
65
|
+
} = useKeyboardCar(props, $emit);
|
|
228
66
|
</script>
|
|
229
67
|
|
|
230
68
|
<style lang="scss" scoped>
|
|
231
|
-
@
|
|
69
|
+
@use '../../../style/components.scss';
|
|
232
70
|
$show-hover: 1;
|
|
233
|
-
$fu-car-keyboard-background-color:
|
|
234
|
-
$fu-car-keyboard-padding:6px 0 6px !default;
|
|
235
|
-
$fu-car-keyboard-button-inner-width:64rpx !default;
|
|
236
|
-
$fu-car-keyboard-button-inner-background-color
|
|
237
|
-
$fu-car-keyboard-button-height:80rpx !default;
|
|
238
|
-
$fu-car-keyboard-button-inner-box-shadow:0 1px 0px #999992 !default;
|
|
239
|
-
$fu-car-keyboard-button-border-radius:4px !default;
|
|
240
|
-
$fu-car-keyboard-button-inner-margin:8rpx 5rpx !default;
|
|
241
|
-
$fu-car-keyboard-button-text-font-size:16px !default;
|
|
71
|
+
$fu-car-keyboard-background-color: #f5f5f5 !default;
|
|
72
|
+
$fu-car-keyboard-padding: 6px 0 6px !default;
|
|
73
|
+
$fu-car-keyboard-button-inner-width: 64rpx !default;
|
|
74
|
+
$fu-car-keyboard-button-inner-background-color: #FFFFFF !default;
|
|
75
|
+
$fu-car-keyboard-button-height: 80rpx !default;
|
|
76
|
+
$fu-car-keyboard-button-inner-box-shadow: 0 1px 0px #999992 !default;
|
|
77
|
+
$fu-car-keyboard-button-border-radius: 4px !default;
|
|
78
|
+
$fu-car-keyboard-button-inner-margin: 8rpx 5rpx !default;
|
|
79
|
+
$fu-car-keyboard-button-text-font-size: 16px !default;
|
|
242
80
|
$fu-car-keyboard-button-text-color: #303133 !default;
|
|
243
81
|
$fu-car-keyboard-center-inner-margin: 0 4rpx !default;
|
|
244
|
-
$fu-car-keyboard-special-button-width:134rpx !default;
|
|
245
|
-
$fu-car-keyboard-lang-font-size:16px !default;
|
|
82
|
+
$fu-car-keyboard-special-button-width: 134rpx !default;
|
|
83
|
+
$fu-car-keyboard-lang-font-size: 16px !default;
|
|
246
84
|
$fu-car-keyboard-lang-color: #303133 !default;
|
|
247
85
|
$fu-car-keyboard-active-color: #dd524d !default;
|
|
248
|
-
$fu-car-keyboard-line-font-size:15px !default;
|
|
86
|
+
$fu-car-keyboard-line-font-size: 15px !default;
|
|
249
87
|
$fu-car-keyboard-line-color: #303133 !default;
|
|
250
|
-
$fu-car-keyboard-line-margin:0 1px !default;
|
|
251
|
-
$fu-car-keyboard-fu-hover-class-background-color
|
|
88
|
+
$fu-car-keyboard-line-margin: 0 1px !default;
|
|
89
|
+
$fu-car-keyboard-fu-hover-class-background-color: #eaeaea !default;
|
|
252
90
|
|
|
253
91
|
.fu-keyboard {
|
|
254
92
|
flex-direction: column;
|
|
@@ -258,7 +96,7 @@
|
|
|
258
96
|
padding: $fu-car-keyboard-padding;
|
|
259
97
|
|
|
260
98
|
&__button {
|
|
261
|
-
@include flex(row);
|
|
99
|
+
@include components.flex(row);
|
|
262
100
|
justify-content: center;
|
|
263
101
|
flex: 1;
|
|
264
102
|
/* #ifndef APP-NVUE */
|
|
@@ -281,7 +119,7 @@
|
|
|
281
119
|
}
|
|
282
120
|
|
|
283
121
|
&__inner {
|
|
284
|
-
@include flex(row);
|
|
122
|
+
@include components.flex(row);
|
|
285
123
|
justify-content: center;
|
|
286
124
|
align-items: center;
|
|
287
125
|
width: $fu-car-keyboard-button-inner-width;
|
|
@@ -305,7 +143,7 @@
|
|
|
305
143
|
width: $fu-car-keyboard-special-button-width;
|
|
306
144
|
height: $fu-car-keyboard-button-height;
|
|
307
145
|
background-color: $fu-car-keyboard-fu-hover-class-background-color;
|
|
308
|
-
@include flex(row);
|
|
146
|
+
@include components.flex(row);
|
|
309
147
|
justify-content: center;
|
|
310
148
|
align-items: center;
|
|
311
149
|
box-shadow: $fu-car-keyboard-button-inner-box-shadow;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const keyboardNumberProps = {
|
|
4
|
+
/**
|
|
5
|
+
* @description 键盘的类型
|
|
6
|
+
* @values 'number' - 数字键盘, 'card' - 身份证键盘
|
|
7
|
+
* @default 'number'
|
|
8
|
+
*/
|
|
9
|
+
mode: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: 'number'
|
|
12
|
+
},
|
|
13
|
+
/**
|
|
14
|
+
* @description 是否显示键盘的"."符号
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
dotDisabled: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* @description 是否打乱键盘按键的顺序
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
random: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const keyboardNumberEmits = {
|
|
32
|
+
/**
|
|
33
|
+
* @description 点击键盘触发
|
|
34
|
+
*/
|
|
35
|
+
change: (_e: any) => true,
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @description 点击退格键触发
|
|
39
|
+
*/
|
|
40
|
+
backspace: () => true
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type KeyboardNumberProps = ExtractPropTypes<typeof keyboardNumberProps>;
|
|
44
|
+
export type KeyboardNumberEmits = typeof keyboardNumberEmits;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="fu-keyboard" @touchmove.stop.prevent="false">
|
|
3
|
+
<view class="fu-keyboard__button-wrapper" v-for="(item, index) in numList" :key="index">
|
|
4
|
+
<view class="fu-keyboard__button-wrapper__button" :style="[itemStyle(index)]" hover-class="fu-hover-class" :hover-stay-time="200" @tap="keyboardClick(item)">
|
|
5
|
+
<text class="fu-keyboard__button-wrapper__button__text">{{ item }}</text>
|
|
6
|
+
</view>
|
|
7
|
+
</view>
|
|
8
|
+
<view class="fu-keyboard__button-wrapper">
|
|
9
|
+
<view class="fu-keyboard__button-wrapper__button fu-keyboard__button-wrapper__button--gray" hover-class="fu-hover-class" :hover-stay-time="200" @touchstart.stop="backspaceClick" @touchend="clearTimer">
|
|
10
|
+
<fu-icon name="backspace" size="28" color="#303133" />
|
|
11
|
+
</view>
|
|
12
|
+
</view>
|
|
13
|
+
</view>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script lang="ts" setup>
|
|
17
|
+
/**
|
|
18
|
+
* KeyboardNumber 键盘组件
|
|
19
|
+
* @description KeyboardNumber 数字键盘组件
|
|
20
|
+
* @property {String} mode 键盘的类型,number 数字键盘,card 身份证键盘
|
|
21
|
+
* @value number 数字键盘
|
|
22
|
+
* @value card 身份证键盘
|
|
23
|
+
* @property {Boolean} dotDisabled = [true|false] 是否显示键盘的"."符号(默认 false)
|
|
24
|
+
* @property {Boolean} random = [true|false] 是否打乱键盘按键的顺序(默认 false)
|
|
25
|
+
* @event {Function} change 点击键盘触发
|
|
26
|
+
* @event {Function} backspace 点击退格键触发
|
|
27
|
+
*/
|
|
28
|
+
import { keyboardNumberEmits, keyboardNumberProps } from './keyboard-number';
|
|
29
|
+
import { useKeyboardNumber } from './composables';
|
|
30
|
+
|
|
31
|
+
defineOptions({ name: 'KeyboardNumber', options: { virtualHost: true } });
|
|
32
|
+
|
|
33
|
+
const props = defineProps(keyboardNumberProps);
|
|
34
|
+
const $emit = defineEmits(keyboardNumberEmits);
|
|
35
|
+
|
|
36
|
+
const {
|
|
37
|
+
numList,
|
|
38
|
+
itemStyle,
|
|
39
|
+
backspaceClick,
|
|
40
|
+
clearTimer,
|
|
41
|
+
keyboardClick
|
|
42
|
+
} = useKeyboardNumber(props, $emit);
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style lang="scss" scoped>
|
|
46
|
+
@use '../../../style/components.scss';
|
|
47
|
+
$show-hover: 1;
|
|
48
|
+
$fu-number-keyboard-background-color: #f5f5f5 !default;
|
|
49
|
+
$fu-number-keyboard-padding: 8px 10rpx 8px 10rpx !default;
|
|
50
|
+
$fu-number-keyboard-button-width: 222rpx !default;
|
|
51
|
+
$fu-number-keyboard-button-margin: 4px 6rpx !default;
|
|
52
|
+
$fu-number-keyboard-button-border-top-left-radius: 4px !default;
|
|
53
|
+
$fu-number-keyboard-button-border-top-right-radius: 4px !default;
|
|
54
|
+
$fu-number-keyboard-button-border-bottom-left-radius: 4px !default;
|
|
55
|
+
$fu-number-keyboard-button-border-bottom-right-radius: 4px !default;
|
|
56
|
+
$fu-number-keyboard-button-height: 90rpx !default;
|
|
57
|
+
$fu-number-keyboard-button-background-color: #FFFFFF !default;
|
|
58
|
+
$fu-number-keyboard-button-box-shadow: 0 2px 0px #BBBCBE !default;
|
|
59
|
+
$fu-number-keyboard-text-font-size: 20px !default;
|
|
60
|
+
$fu-number-keyboard-text-font-weight: 500 !default;
|
|
61
|
+
$fu-number-keyboard-text-color: #303133 !default;
|
|
62
|
+
$fu-number-keyboard-gray-background-color: #eaeaea !default;
|
|
63
|
+
$fu-number-keyboard-fu-hover-class-background-color: #f5f5f5 !default;
|
|
64
|
+
|
|
65
|
+
.fu-keyboard {
|
|
66
|
+
@include components.flex(row);
|
|
67
|
+
justify-content: space-around;
|
|
68
|
+
background-color: $fu-number-keyboard-background-color;
|
|
69
|
+
flex-wrap: wrap;
|
|
70
|
+
padding: $fu-number-keyboard-padding;
|
|
71
|
+
|
|
72
|
+
&__button-wrapper {
|
|
73
|
+
box-shadow: $fu-number-keyboard-button-box-shadow;
|
|
74
|
+
margin: $fu-number-keyboard-button-margin;
|
|
75
|
+
border-top-left-radius: $fu-number-keyboard-button-border-top-left-radius;
|
|
76
|
+
border-top-right-radius: $fu-number-keyboard-button-border-top-right-radius;
|
|
77
|
+
border-bottom-left-radius: $fu-number-keyboard-button-border-bottom-left-radius;
|
|
78
|
+
border-bottom-right-radius: $fu-number-keyboard-button-border-bottom-right-radius;
|
|
79
|
+
|
|
80
|
+
&__button {
|
|
81
|
+
width: $fu-number-keyboard-button-width;
|
|
82
|
+
height: $fu-number-keyboard-button-height;
|
|
83
|
+
background-color: $fu-number-keyboard-button-background-color;
|
|
84
|
+
@include components.flex(row);
|
|
85
|
+
justify-content: center;
|
|
86
|
+
align-items: center;
|
|
87
|
+
border-top-left-radius: $fu-number-keyboard-button-border-top-left-radius;
|
|
88
|
+
border-top-right-radius: $fu-number-keyboard-button-border-top-right-radius;
|
|
89
|
+
border-bottom-left-radius: $fu-number-keyboard-button-border-bottom-left-radius;
|
|
90
|
+
border-bottom-right-radius: $fu-number-keyboard-button-border-bottom-right-radius;
|
|
91
|
+
|
|
92
|
+
&__text {
|
|
93
|
+
font-size: $fu-number-keyboard-text-font-size;
|
|
94
|
+
font-weight: $fu-number-keyboard-text-font-weight;
|
|
95
|
+
color: $fu-number-keyboard-text-color;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&--gray {
|
|
99
|
+
background-color: $fu-number-keyboard-gray-background-color;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.fu-hover-class {
|
|
106
|
+
background-color: $fu-number-keyboard-fu-hover-class-background-color;
|
|
107
|
+
}
|
|
108
|
+
</style>
|