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,346 @@
|
|
|
1
|
+
import { ref, computed, onBeforeUnmount, onMounted, watch, type SetupContext, CSSProperties } from 'vue';
|
|
2
|
+
import type { PopupProps, PopupEmits } from '../popup';
|
|
3
|
+
|
|
4
|
+
export const usePopup = (props: PopupProps, $emit: SetupContext<PopupEmits>['emit']) => {
|
|
5
|
+
const duration = ref(300);
|
|
6
|
+
const ani = ref([]);
|
|
7
|
+
const showPopup = ref(false);
|
|
8
|
+
const showTrans = ref(false);
|
|
9
|
+
const popupWidth = ref(0);
|
|
10
|
+
const popupHeight = ref(0);
|
|
11
|
+
const config = ref({
|
|
12
|
+
top: 'top',
|
|
13
|
+
bottom: 'bottom',
|
|
14
|
+
center: 'center',
|
|
15
|
+
left: 'left',
|
|
16
|
+
right: 'right'
|
|
17
|
+
});
|
|
18
|
+
const maskClass = ref({
|
|
19
|
+
position: 'fixed',
|
|
20
|
+
bottom: 0,
|
|
21
|
+
top: 0,
|
|
22
|
+
left: 0,
|
|
23
|
+
right: 0,
|
|
24
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
25
|
+
});
|
|
26
|
+
const transClass: Record<string, any> = ref({
|
|
27
|
+
position: 'fixed',
|
|
28
|
+
left: 0,
|
|
29
|
+
right: 0
|
|
30
|
+
});
|
|
31
|
+
const maskShow = ref(true);
|
|
32
|
+
const popupstyle = ref('');
|
|
33
|
+
const direction = ref(props.mode);
|
|
34
|
+
const mkclick = ref(true);
|
|
35
|
+
const clearPropagation = ref(false);
|
|
36
|
+
const closeIconPosition = ref('');
|
|
37
|
+
|
|
38
|
+
const bg = computed(() => {
|
|
39
|
+
if (props.bgColor === '' || props.bgColor === 'none') {
|
|
40
|
+
return 'transparent'
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return props.bgColor
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const getStyle = computed<CSSProperties>(() => {
|
|
47
|
+
let style: Record<string, any> = {};
|
|
48
|
+
if (props.bgColor) {
|
|
49
|
+
style.backgroundColor = bg.value
|
|
50
|
+
}
|
|
51
|
+
if(props.radius) {
|
|
52
|
+
const value = uni.$fu.addUnit(props.radius);
|
|
53
|
+
const mode = direction.value? direction.value: props.mode;
|
|
54
|
+
style.backgroundColor = props.bgColor;
|
|
55
|
+
if(mode === 'top') {
|
|
56
|
+
style.borderBottomLeftRadius = value;
|
|
57
|
+
style.borderBottomRightRadius = value;
|
|
58
|
+
} else if(mode === 'bottom') {
|
|
59
|
+
style.borderTopLeftRadius = value;
|
|
60
|
+
style.borderTopRightRadius = value;
|
|
61
|
+
} else if(mode === 'center') {
|
|
62
|
+
style.borderRadius = value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return uni.$fu.deepMerge(style, uni.$fu.addStyle(props.customStyle))
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const isDesktop = computed(() => {
|
|
70
|
+
return popupWidth.value >= 500 && popupHeight.value >= 500
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const closeIconPo = computed(() => {
|
|
74
|
+
return props.closeIconPos
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
closeIconPosition.value = closeIconPo.value;
|
|
78
|
+
|
|
79
|
+
const setH5Visible = () => {
|
|
80
|
+
// #ifdef H5
|
|
81
|
+
// 处理 h5 滚动穿透的问题
|
|
82
|
+
document.getElementsByTagName('body')[0].style.overflow = 'visible'
|
|
83
|
+
// #endif
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 公用方法,不显示遮罩层
|
|
88
|
+
*/
|
|
89
|
+
const closeMask = () => {
|
|
90
|
+
mkclick.value = false;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// Nvue 取消冒泡
|
|
94
|
+
const clear = (e: TouchEvent) => {
|
|
95
|
+
// #ifndef APP-NVUE
|
|
96
|
+
e.stopPropagation()
|
|
97
|
+
// #endif
|
|
98
|
+
clearPropagation.value = true;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// 打开
|
|
102
|
+
const open = (mode?: string) => {
|
|
103
|
+
// 处理快速打开关闭的情况
|
|
104
|
+
if (showPopup.value) return
|
|
105
|
+
let innerMode = ['top', 'center', 'bottom', 'left', 'right'];
|
|
106
|
+
if (!(mode && innerMode.indexOf(mode) !== -1)) {
|
|
107
|
+
mode = props.mode;
|
|
108
|
+
} else {
|
|
109
|
+
direction.value = mode;
|
|
110
|
+
}
|
|
111
|
+
if(!props.closeIconPos) {
|
|
112
|
+
closeIconPosition.value = mode === 'top'? 'bottom-right': (mode === 'center' || mode === 'bottom' || mode === 'left')? 'top-right': mode === 'right'? 'top-left': ''
|
|
113
|
+
}
|
|
114
|
+
if (!config.value[mode]) {
|
|
115
|
+
console.error('缺少类型:', direction.value)
|
|
116
|
+
return
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const fn = config.value[mode];
|
|
120
|
+
switch(fn) {
|
|
121
|
+
case 'top':
|
|
122
|
+
top()
|
|
123
|
+
break
|
|
124
|
+
case 'center':
|
|
125
|
+
center()
|
|
126
|
+
break
|
|
127
|
+
case 'bottom':
|
|
128
|
+
bottom()
|
|
129
|
+
break
|
|
130
|
+
case 'left':
|
|
131
|
+
left()
|
|
132
|
+
break
|
|
133
|
+
case 'right':
|
|
134
|
+
right()
|
|
135
|
+
break
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
$emit('change', {
|
|
139
|
+
show: true,
|
|
140
|
+
mode: direction.value
|
|
141
|
+
})
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// 关闭
|
|
145
|
+
const close = (mode?: string) => {
|
|
146
|
+
showTrans.value = false;
|
|
147
|
+
$emit('change', {
|
|
148
|
+
show: false,
|
|
149
|
+
mode: props.mode
|
|
150
|
+
})
|
|
151
|
+
uni.$fu.sleep(duration.value).then(() => {
|
|
152
|
+
showPopup.value = false;
|
|
153
|
+
})
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
|
|
157
|
+
const touchstart = () => {
|
|
158
|
+
clearPropagation.value = false;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// 点击遮罩触发
|
|
162
|
+
const onTap = () => {
|
|
163
|
+
if (clearPropagation.value) {
|
|
164
|
+
// fix by mehaotian 兼容 nvue
|
|
165
|
+
clearPropagation.value = false;
|
|
166
|
+
return
|
|
167
|
+
}
|
|
168
|
+
$emit('maskClick')
|
|
169
|
+
if (!mkclick.value) return
|
|
170
|
+
close()
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 顶部弹出样式处理
|
|
175
|
+
*/
|
|
176
|
+
const top = (mode?: string | boolean) => {
|
|
177
|
+
popupstyle.value = isDesktop.value ? 'fixforpc-top' : 'top';
|
|
178
|
+
ani.value = ['slide-top'];
|
|
179
|
+
transClass.value = {
|
|
180
|
+
position: 'fixed',
|
|
181
|
+
left: 0,
|
|
182
|
+
right: 0,
|
|
183
|
+
...getStyle.value
|
|
184
|
+
};
|
|
185
|
+
if (mode) return
|
|
186
|
+
showPopup.value = true;
|
|
187
|
+
showTrans.value = true;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* 底部弹出样式处理
|
|
192
|
+
*/
|
|
193
|
+
const bottom = (mode?: string | boolean) => {
|
|
194
|
+
popupstyle.value = 'bottom';
|
|
195
|
+
ani.value = ['slide-bottom'];
|
|
196
|
+
transClass.value = {
|
|
197
|
+
position: 'fixed',
|
|
198
|
+
left: 0,
|
|
199
|
+
right: 0,
|
|
200
|
+
bottom: 0,
|
|
201
|
+
...getStyle.value
|
|
202
|
+
};
|
|
203
|
+
if (mode) return
|
|
204
|
+
showPopup.value = true;
|
|
205
|
+
showTrans.value = true;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* 中间弹出样式处理
|
|
210
|
+
*/
|
|
211
|
+
const center = (mode?: string | boolean) => {
|
|
212
|
+
popupstyle.value = 'center';
|
|
213
|
+
ani.value = ['zoom-out', 'fade'];
|
|
214
|
+
transClass.value = {
|
|
215
|
+
position: 'fixed',
|
|
216
|
+
/* #ifndef APP-NVUE */
|
|
217
|
+
display: 'flex',
|
|
218
|
+
flexDirection: 'column',
|
|
219
|
+
/* #endif */
|
|
220
|
+
bottom: 0,
|
|
221
|
+
left: 0,
|
|
222
|
+
right: 0,
|
|
223
|
+
top: 0,
|
|
224
|
+
justifyContent: 'center',
|
|
225
|
+
alignItems: 'center'
|
|
226
|
+
};
|
|
227
|
+
if (mode) return
|
|
228
|
+
showPopup.value = true;
|
|
229
|
+
showTrans.value = true;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* 左侧弹出样式处理
|
|
234
|
+
*/
|
|
235
|
+
const left = (mode?: string | boolean) => {
|
|
236
|
+
popupstyle.value = 'left';
|
|
237
|
+
ani.value = ['slide-left'];
|
|
238
|
+
transClass.value = {
|
|
239
|
+
position: 'fixed',
|
|
240
|
+
left: 0,
|
|
241
|
+
bottom: 0,
|
|
242
|
+
top: 0,
|
|
243
|
+
...getStyle.value,
|
|
244
|
+
/* #ifndef APP-NVUE */
|
|
245
|
+
display: 'flex',
|
|
246
|
+
flexDirection: 'column'
|
|
247
|
+
/* #endif */
|
|
248
|
+
};
|
|
249
|
+
if (mode) return
|
|
250
|
+
showPopup.value = true;
|
|
251
|
+
showTrans.value = true;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* 右侧弹出样式处理
|
|
256
|
+
*/
|
|
257
|
+
const right = (mode?: string | boolean) => {
|
|
258
|
+
popupstyle.value = 'right';
|
|
259
|
+
ani.value = ['slide-right']
|
|
260
|
+
transClass.value = {
|
|
261
|
+
position: 'fixed',
|
|
262
|
+
bottom: 0,
|
|
263
|
+
right: 0,
|
|
264
|
+
top: 0,
|
|
265
|
+
...getStyle.value,
|
|
266
|
+
/* #ifndef APP-NVUE */
|
|
267
|
+
display: 'flex',
|
|
268
|
+
flexDirection: 'column'
|
|
269
|
+
/* #endif */
|
|
270
|
+
};
|
|
271
|
+
if (mode) return
|
|
272
|
+
showPopup.value = true;
|
|
273
|
+
showTrans.value = true;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
// 生命周期
|
|
277
|
+
onMounted(() => {
|
|
278
|
+
mkclick.value = props.isMaskClick || false;
|
|
279
|
+
if (props.animation) {
|
|
280
|
+
duration.value = 300;
|
|
281
|
+
} else {
|
|
282
|
+
duration.value = 0
|
|
283
|
+
}
|
|
284
|
+
// 解决头条冒泡的问题
|
|
285
|
+
clearPropagation.value = false
|
|
286
|
+
maskClass.value.backgroundColor = props.maskBgColor;
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
onBeforeUnmount(() => {
|
|
290
|
+
setH5Visible()
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* 监听mode类型
|
|
295
|
+
*/
|
|
296
|
+
watch(() => props.mode, (newVal) => {
|
|
297
|
+
if (!config.value[newVal]) return
|
|
298
|
+
const fn = config.value[newVal];
|
|
299
|
+
if(fn === 'top') top(true)
|
|
300
|
+
else if(fn === 'center') center(true)
|
|
301
|
+
else if(fn === 'bottom') bottom(true)
|
|
302
|
+
else if(fn === 'left') left(true)
|
|
303
|
+
else if(fn === 'right') right(true)
|
|
304
|
+
}, { immediate: true });
|
|
305
|
+
|
|
306
|
+
watch(() => isDesktop.value, () => {
|
|
307
|
+
if (!config.value[direction.value || props.mode]) return
|
|
308
|
+
const fn = config.value[direction.value || props.mode];
|
|
309
|
+
if(fn === 'top') top(true)
|
|
310
|
+
else if(fn === 'center') center(true)
|
|
311
|
+
else if(fn === 'bottom') bottom(true)
|
|
312
|
+
else if(fn === 'left') left(true)
|
|
313
|
+
else if(fn === 'right') right(true)
|
|
314
|
+
}, { immediate: true });
|
|
315
|
+
|
|
316
|
+
watch(() => props.isMaskClick, (newVal) => {
|
|
317
|
+
mkclick.value = newVal;
|
|
318
|
+
}, { immediate: true });
|
|
319
|
+
|
|
320
|
+
watch(() => showPopup.value, (newVal) => {
|
|
321
|
+
// #ifdef H5
|
|
322
|
+
// fix by mehaotian 处理 h5 滚动穿透的问题
|
|
323
|
+
document.getElementsByTagName('body')[0].style.overflow = newVal ? 'hidden' : 'visible'
|
|
324
|
+
// #endif
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
return {
|
|
328
|
+
ani,
|
|
329
|
+
duration,
|
|
330
|
+
showTrans,
|
|
331
|
+
maskClass,
|
|
332
|
+
transClass,
|
|
333
|
+
showPopup,
|
|
334
|
+
maskShow,
|
|
335
|
+
popupstyle,
|
|
336
|
+
direction,
|
|
337
|
+
isDesktop,
|
|
338
|
+
closeIconPosition,
|
|
339
|
+
getStyle,
|
|
340
|
+
touchstart,
|
|
341
|
+
onTap,
|
|
342
|
+
clear,
|
|
343
|
+
open,
|
|
344
|
+
close
|
|
345
|
+
}
|
|
346
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// #ifdef H5
|
|
2
|
+
import { defineComponent, onMounted, onBeforeUnmount } from 'vue';
|
|
3
|
+
|
|
4
|
+
const keyNames : Record<string, string | string[]> = {
|
|
5
|
+
esc: ['Esc', 'Escape'],
|
|
6
|
+
tab: 'Tab',
|
|
7
|
+
enter: 'Enter',
|
|
8
|
+
space: [' ', 'Spacebar'],
|
|
9
|
+
up: ['Up', 'ArrowUp'],
|
|
10
|
+
left: ['Left', 'ArrowLeft'],
|
|
11
|
+
right: ['Right', 'ArrowRight'],
|
|
12
|
+
down: ['Down', 'ArrowDown'],
|
|
13
|
+
delete: ['Backspace', 'Delete', 'Del']
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: 'Keypress',
|
|
18
|
+
props: {
|
|
19
|
+
disable: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
emits: ['esc', 'tab', 'enter', 'space', 'up', 'left', 'right', 'down', 'delete'],
|
|
25
|
+
setup(props, { emit }) {
|
|
26
|
+
const listener = ($event : KeyboardEvent) => {
|
|
27
|
+
if (props.disable) {
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
const keyName: any = Object.keys(keyNames).find(key => {
|
|
31
|
+
const keyName = $event.key
|
|
32
|
+
const value = keyNames[key]
|
|
33
|
+
return value === keyName || (Array.isArray(value) && value.includes(keyName))
|
|
34
|
+
})
|
|
35
|
+
if (keyName) {
|
|
36
|
+
// 避免和其他按键事件冲突
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
emit(keyName, {})
|
|
39
|
+
}, 0)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 生命周期
|
|
44
|
+
onMounted(() => {
|
|
45
|
+
document.addEventListener('keyup', listener);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
onBeforeUnmount(() => {
|
|
49
|
+
document.removeEventListener('keyup', listener);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return () => null;
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
// #endif
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { componentProps, ZIndex } from '../../../constants';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 弹出层mode有效值
|
|
6
|
+
*/
|
|
7
|
+
export const popupModes = ['top', 'center', 'bottom', 'left', 'right'] as const;
|
|
8
|
+
|
|
9
|
+
export const popupProps = {
|
|
10
|
+
/**
|
|
11
|
+
* @description 是否开启动画
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
animation: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: true
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* @description 弹出层方向
|
|
20
|
+
* @values 'top' - 顶部弹出, 'center' - 中间弹出, 'bottom' - 底部弹出, 'left' - 左侧弹出, 'right' - 右侧弹出
|
|
21
|
+
* @default 'center'
|
|
22
|
+
*/
|
|
23
|
+
mode: {
|
|
24
|
+
type: String,
|
|
25
|
+
values: popupModes,
|
|
26
|
+
default: 'center'
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* @description 蒙版点击是否关闭弹窗
|
|
30
|
+
*/
|
|
31
|
+
isMaskClick: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* @description 主窗口背景色
|
|
37
|
+
*/
|
|
38
|
+
bgColor: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '#FFFFFF'
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* @description 是否适配底部安全区
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
safeArea: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* @description 蒙版颜色
|
|
52
|
+
*/
|
|
53
|
+
maskBgColor: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: 'rgba(0, 0, 0, 0.4)'
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* @description 弹出层的层级
|
|
59
|
+
*/
|
|
60
|
+
zIndex: {
|
|
61
|
+
type: [String,Number],
|
|
62
|
+
default: ZIndex.popup
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* @description 是否显示关闭图标
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
showClose: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* @description 设置关闭图标位置
|
|
74
|
+
*/
|
|
75
|
+
closeIconPos: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: ''
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* @description 设置圆角
|
|
81
|
+
*/
|
|
82
|
+
radius: {
|
|
83
|
+
type: [String,Number],
|
|
84
|
+
default: 0
|
|
85
|
+
},
|
|
86
|
+
...componentProps
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const popupEmits = {
|
|
90
|
+
/**
|
|
91
|
+
* @description 打开关闭弹窗触发
|
|
92
|
+
*/
|
|
93
|
+
change: (_e: any) => true,
|
|
94
|
+
/**
|
|
95
|
+
* @description 点击遮罩触发
|
|
96
|
+
*/
|
|
97
|
+
maskClick: () => true
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type PopupProps = ExtractPropTypes<typeof popupProps>;
|
|
101
|
+
export type PopupEmits = typeof popupEmits;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="fu-popup"
|
|
4
|
+
:class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']"
|
|
5
|
+
:style="{zIndex: zIndex}"
|
|
6
|
+
v-if="showPopup">
|
|
7
|
+
<view @touchstart="touchstart">
|
|
8
|
+
<fu-transition
|
|
9
|
+
key="1"
|
|
10
|
+
name="mask"
|
|
11
|
+
mode="fade"
|
|
12
|
+
:customStyle="maskClass"
|
|
13
|
+
:duration="duration"
|
|
14
|
+
:show="showTrans"
|
|
15
|
+
v-if="maskShow"
|
|
16
|
+
@click="onTap" />
|
|
17
|
+
<fu-transition
|
|
18
|
+
key="2"
|
|
19
|
+
:mode="ani"
|
|
20
|
+
name="content"
|
|
21
|
+
:customStyle="transClass"
|
|
22
|
+
:duration="duration"
|
|
23
|
+
:show="showTrans"
|
|
24
|
+
@click="onTap">
|
|
25
|
+
<view class="fu-popup__wrapper" :style="[getStyle]" :class="[popupstyle]" @click="clear">
|
|
26
|
+
<slot />
|
|
27
|
+
<fu-safe-bottom v-if="safeArea && direction == 'bottom'" />
|
|
28
|
+
<view
|
|
29
|
+
class="fu-popup__wrapper__close"
|
|
30
|
+
:class="['fu-popup__wrapper__close--' + closeIconPosition]"
|
|
31
|
+
hover-class="fu-popup__wrapper__close--hover"
|
|
32
|
+
hover-stay-time="150"
|
|
33
|
+
@tap.stop="close"
|
|
34
|
+
v-if="showClose">
|
|
35
|
+
<fu-icon name="cancel" color="#909399" size="18" bold></fu-icon>
|
|
36
|
+
</view>
|
|
37
|
+
</view>
|
|
38
|
+
</fu-transition>
|
|
39
|
+
</view>
|
|
40
|
+
<!-- #ifdef H5 -->
|
|
41
|
+
<keypress v-if="maskShow" @esc="onTap" />
|
|
42
|
+
<!-- #endif -->
|
|
43
|
+
</view>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script lang="ts" setup>
|
|
47
|
+
/**
|
|
48
|
+
* PopUp 弹出层
|
|
49
|
+
* @description 此组件弹出层,为了解决遮罩弹层的问题
|
|
50
|
+
* @tutorial http://www.fusions.top/components/popup.html
|
|
51
|
+
* @property {String} mode = [top|center|bottom|left|right] 弹出层方向
|
|
52
|
+
* @value top 顶部弹出
|
|
53
|
+
* @value center 中间弹出
|
|
54
|
+
* @value bottom 底部弹出
|
|
55
|
+
* @value left 左侧弹出
|
|
56
|
+
* @value right 右侧弹出
|
|
57
|
+
* @property {Boolean} animation = [true|false] 是否开启动画
|
|
58
|
+
* @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗
|
|
59
|
+
* @property {String} bgColor 主窗口背景色
|
|
60
|
+
* @property {String} maskBgColor 蒙版颜色
|
|
61
|
+
* @property {Boolean} safeArea 是否适配底部安全区(默认 true)
|
|
62
|
+
* @property {String | Number} zIndex 弹出层的层级
|
|
63
|
+
* @property {Boolean} showClose 是否显示关闭图标,默认false
|
|
64
|
+
* @property {String} closeIconPos = [top-left|top-right|bottom-left|bottom-right] 自定义关闭图标位置
|
|
65
|
+
* @value top-left 左上角
|
|
66
|
+
* @value top-right 右上角
|
|
67
|
+
* @value bottom-left 左下角
|
|
68
|
+
* @value bottom-right 右下角
|
|
69
|
+
* @property {String | Number} radius 自定义圆角
|
|
70
|
+
*
|
|
71
|
+
* @event {Function} change 打开关闭弹窗触发,e={show: false}
|
|
72
|
+
* @event {Function} maskClick 点击遮罩触发
|
|
73
|
+
* @example <fu-popup>弹窗内容</fu-popup>
|
|
74
|
+
*/
|
|
75
|
+
import { defineComponent } from 'vue';
|
|
76
|
+
import { popupEmits, popupProps } from './popup';
|
|
77
|
+
import { usePopup } from './composables';
|
|
78
|
+
// #ifdef H5
|
|
79
|
+
import keypress from './keypress';
|
|
80
|
+
// #endif
|
|
81
|
+
|
|
82
|
+
defineOptions({ name: 'FuPopup', options: { virtualHost: true } })
|
|
83
|
+
|
|
84
|
+
defineComponent({
|
|
85
|
+
// #ifdef H5
|
|
86
|
+
keypress
|
|
87
|
+
// #endif
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const props = defineProps(popupProps);
|
|
91
|
+
const $emit = defineEmits(popupEmits);
|
|
92
|
+
|
|
93
|
+
const {
|
|
94
|
+
ani,
|
|
95
|
+
duration,
|
|
96
|
+
showTrans,
|
|
97
|
+
maskClass,
|
|
98
|
+
transClass,
|
|
99
|
+
showPopup,
|
|
100
|
+
maskShow,
|
|
101
|
+
popupstyle,
|
|
102
|
+
direction,
|
|
103
|
+
isDesktop,
|
|
104
|
+
closeIconPosition,
|
|
105
|
+
getStyle,
|
|
106
|
+
touchstart,
|
|
107
|
+
onTap,
|
|
108
|
+
clear,
|
|
109
|
+
open,
|
|
110
|
+
close
|
|
111
|
+
} = usePopup(props, $emit);
|
|
112
|
+
|
|
113
|
+
// 暴露方法给父组件
|
|
114
|
+
defineExpose({
|
|
115
|
+
open,
|
|
116
|
+
close
|
|
117
|
+
})
|
|
118
|
+
</script>
|
|
119
|
+
<style lang="scss" scoped>
|
|
120
|
+
.fu-popup {
|
|
121
|
+
position: fixed;
|
|
122
|
+
/* #ifndef APP-NVUE */
|
|
123
|
+
z-index: 99;
|
|
124
|
+
/* #endif */
|
|
125
|
+
|
|
126
|
+
&.top,
|
|
127
|
+
&.left,
|
|
128
|
+
&.right {
|
|
129
|
+
/* #ifdef H5 */
|
|
130
|
+
top: var(--window-top);
|
|
131
|
+
/* #endif */
|
|
132
|
+
/* #ifndef H5 */
|
|
133
|
+
top: 0;
|
|
134
|
+
/* #endif */
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.fu-popup__wrapper {
|
|
138
|
+
/* #ifndef APP-NVUE */
|
|
139
|
+
display: block;
|
|
140
|
+
/* #endif */
|
|
141
|
+
position: relative;
|
|
142
|
+
|
|
143
|
+
/* iphonex 等安全区设置,底部安全区适配 */
|
|
144
|
+
/* #ifndef APP-NVUE */
|
|
145
|
+
// padding-bottom: constant(safe-area-inset-bottom); /* 兼容IOS 设备 */
|
|
146
|
+
// padding-bottom: env(safe-area-inset-bottom); /* 兼容IPhone X 及以上设备 */
|
|
147
|
+
/* #endif */
|
|
148
|
+
&.left,
|
|
149
|
+
&.right {
|
|
150
|
+
/* #ifdef H5 */
|
|
151
|
+
padding-top: var(--window-top);
|
|
152
|
+
/* #endif */
|
|
153
|
+
/* #ifndef H5 */
|
|
154
|
+
padding-top: 0;
|
|
155
|
+
/* #endif */
|
|
156
|
+
flex: 1;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&.bottom {
|
|
160
|
+
/* #ifdef H5 */
|
|
161
|
+
padding-bottom: var(--window-bottom);
|
|
162
|
+
/* #endif */
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&__close {
|
|
166
|
+
position: absolute;
|
|
167
|
+
|
|
168
|
+
&--hover {
|
|
169
|
+
opacity: 0.4;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&__close--top-left {
|
|
174
|
+
top: 15px;
|
|
175
|
+
left: 15px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&__close--top-right {
|
|
179
|
+
top: 15px;
|
|
180
|
+
right: 15px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&__close--bottom-left {
|
|
184
|
+
bottom: 15px;
|
|
185
|
+
left: 15px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&__close--bottom-right {
|
|
189
|
+
right: 15px;
|
|
190
|
+
bottom: 15px;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.fixforpc-z-index {
|
|
196
|
+
/* #ifndef APP-NVUE */
|
|
197
|
+
z-index: 999;
|
|
198
|
+
/* #endif */
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.fixforpc-top {
|
|
202
|
+
top: 0;
|
|
203
|
+
}
|
|
204
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/progress'
|