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
|
@@ -69,28 +69,24 @@
|
|
|
69
69
|
</view>
|
|
70
70
|
</template>
|
|
71
71
|
|
|
72
|
-
<script>
|
|
73
|
-
import { debounce, throttle } from '../../libs/function/applyEven.js'
|
|
74
|
-
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
75
|
-
import mixin from '../../libs/mixin/mixin.js'
|
|
76
|
-
import button from '../../libs/mixin/button.js'
|
|
77
|
-
import props from './props.js'
|
|
72
|
+
<script lang="ts" setup>
|
|
78
73
|
/**
|
|
79
74
|
* Button 按钮
|
|
80
75
|
* @description 此组件内部实现以uni-app的button组件为基础,对其进行了扩展,使其能够在uni-app的各个平台上表现一致。
|
|
81
|
-
* @
|
|
76
|
+
* @tutorial http://www.fusions.top/components/button.html
|
|
77
|
+
* @property {String | Number} index 按钮索引,用于区分多个按钮
|
|
82
78
|
* @property {String} type = [primary|error|success|warning|info] 按钮的预置样式 (默认 primary)
|
|
83
79
|
* @value primary 主色
|
|
84
80
|
* @value error 错误
|
|
85
81
|
* @value success 成功
|
|
86
82
|
* @value warning 警告
|
|
87
83
|
* @value info 信息
|
|
88
|
-
* @property {String
|
|
89
|
-
* @property {String} shape = [square|circle] 按钮形状
|
|
90
|
-
* @value square
|
|
91
|
-
* @value circle
|
|
92
|
-
* @property {String
|
|
93
|
-
* @property {String
|
|
84
|
+
* @property {String | Number} text 按钮文字,之所以通过props传入,是因为slot传入的话(注:nvue中无法控制文字的样式)
|
|
85
|
+
* @property {String} shape = [square|circle] 按钮形状 (默认 'square')
|
|
86
|
+
* @value square - 带圆角
|
|
87
|
+
* @value circle - 两边为半圆
|
|
88
|
+
* @property {String | Number} width 宽度(默认 auto)
|
|
89
|
+
* @property {String | Number} height 高度(默认 '')
|
|
94
90
|
* @property {String} size = [large|normal|small|mini] 按钮尺寸(默认 normal)
|
|
95
91
|
* @value large 16px
|
|
96
92
|
* @value normal 14px
|
|
@@ -102,7 +98,7 @@
|
|
|
102
98
|
* @property {Boolean} loading = [true|false] 是否显示加载图标(默认 false)
|
|
103
99
|
* @property {String} loadingText 加载中提示文字
|
|
104
100
|
* @property {String} loadingMode 加载状态图标类型 (默认 'flower')
|
|
105
|
-
* @property {String
|
|
101
|
+
* @property {String | Number} loadingSize 加载图标大小 (默认 14)
|
|
106
102
|
* @property {String} formType 触发form表单的事件类型
|
|
107
103
|
* @property {String} openType 开放能力,具体请看uniapp稳定关于button组件部分说明 https://uniapp.dcloud.io/component/button
|
|
108
104
|
* @property {Boolean} hoverStopPropagation = [true|false] 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效(默认 false )
|
|
@@ -112,8 +108,8 @@
|
|
|
112
108
|
* @property {String} sendMessageImg 会话内消息卡片图片,openType="contact"时有效
|
|
113
109
|
* @property {Boolean} showMessageCard = [true|false] 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效(默认 false)
|
|
114
110
|
* @property {String} color 按钮颜色,支持传入linear-gradient渐变色
|
|
115
|
-
* @property {String
|
|
116
|
-
* @property {String
|
|
111
|
+
* @property {String | Number} hoverStartTime 按住后多久出现点击态,单位毫秒 (默认 0 )
|
|
112
|
+
* @property {String | Number} hoverStayTime 手指松开后点击态保留时间,单位毫秒 (默认 200 )
|
|
117
113
|
* @property {String} scene = [none|debounce|throttle] 场景:(none: 不开启防抖节流模式,debounce:防抖模式 throttle:节流模式(默认 'throttle')
|
|
118
114
|
* @value none 不开启防抖节流模式
|
|
119
115
|
* @value debounce 防抖模式
|
|
@@ -121,8 +117,8 @@
|
|
|
121
117
|
* @property {Number} sceneTime 防抖节流间隔时间单位毫秒(默认300)
|
|
122
118
|
* @property {String} lang = [zh_CN|zh_TW|en] 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文(默认 en )
|
|
123
119
|
* @property {String} customClass 定义需要用到的外部样式类
|
|
124
|
-
* @property {Object
|
|
125
|
-
* @property {Object
|
|
120
|
+
* @property {String | Object} customStyle 定义需要用到的外部样式
|
|
121
|
+
* @property {Object | String} customTextStyle 定义需要用到的外部按钮文本样式
|
|
126
122
|
*
|
|
127
123
|
* @event {Function} click 非禁止并且非加载中,才能点击
|
|
128
124
|
* @event {Function} tap 非禁止并且非加载中,才能点击
|
|
@@ -133,145 +129,43 @@
|
|
|
133
129
|
* @event {Function} contact open-type="contact"时有效
|
|
134
130
|
* @example <fu-button text="按钮"></fu-button>
|
|
135
131
|
*/
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
if (this.type === "info") {
|
|
170
|
-
return "#c9c9c9";
|
|
171
|
-
}
|
|
172
|
-
return "rgb(200, 200, 200)";
|
|
173
|
-
},
|
|
174
|
-
baseColor() {
|
|
175
|
-
let style = {
|
|
176
|
-
...(this.width && { width: this.$fu.addUnit(this.width) }),
|
|
177
|
-
...(this.height && { height: this.$fu.addUnit(this.height) }),
|
|
178
|
-
...(this.height && { lineHeight: this.$fu.addUnit(this.height) }),
|
|
179
|
-
};
|
|
180
|
-
if (this.color) {
|
|
181
|
-
// 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
|
|
182
|
-
style.color = this.plain ? this.color : "white";
|
|
183
|
-
if (!this.plain) {
|
|
184
|
-
// 非镂空,背景色使用自定义的颜色
|
|
185
|
-
style["background-color"] = this.color;
|
|
186
|
-
}
|
|
187
|
-
if (this.color.indexOf("gradient") !== -1) {
|
|
188
|
-
// 如果自定义的颜色为渐变色,不显示边框,以及通过backgroundImage设置渐变色
|
|
189
|
-
// weex文档说明可以写borderWidth的形式,为什么这里需要分开写?
|
|
190
|
-
// 因为weex是阿里巴巴为了部门业绩考核而做的你懂的东西,所以需要这么写才有效
|
|
191
|
-
style.borderTopWidth = 0;
|
|
192
|
-
style.borderRightWidth = 0;
|
|
193
|
-
style.borderBottomWidth = 0;
|
|
194
|
-
style.borderLeftWidth = 0;
|
|
195
|
-
if (!this.plain) style.backgroundImage = this.color;
|
|
196
|
-
} else {
|
|
197
|
-
// 非渐变色,则设置边框相关的属性
|
|
198
|
-
style.borderColor = this.color;
|
|
199
|
-
style.borderWidth = "1px";
|
|
200
|
-
style.borderStyle = "solid";
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return style;
|
|
204
|
-
},
|
|
205
|
-
// 字体大小
|
|
206
|
-
textSize() {
|
|
207
|
-
const sizeMap = {
|
|
208
|
-
large: 16,
|
|
209
|
-
normal: 14,
|
|
210
|
-
small: 12,
|
|
211
|
-
mini: 10
|
|
212
|
-
}
|
|
213
|
-
return sizeMap[this.size] || 14
|
|
214
|
-
},
|
|
215
|
-
// 设置外层盒子的宽度,其他样式不需要
|
|
216
|
-
btnWrapperStyle() {
|
|
217
|
-
const style = {
|
|
218
|
-
margin: this.margin
|
|
219
|
-
};
|
|
220
|
-
const customStyle = this.$fu.addStyle(this.customStyle);
|
|
221
|
-
if(customStyle.width || this.width) style.width = customStyle.width || this.$fu.addUnit(this.width);
|
|
222
|
-
return style;
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
methods: {
|
|
226
|
-
//防抖模式
|
|
227
|
-
debounceClick(e) {
|
|
228
|
-
debounce(() => {
|
|
229
|
-
this.emitClick(e);
|
|
230
|
-
}, this.sceneTime)
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
//节流模式
|
|
234
|
-
throttleClick(e) {
|
|
235
|
-
throttle(() => {
|
|
236
|
-
this.emitClick(e);
|
|
237
|
-
}, this.sceneTime)
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
emitClick(e) {
|
|
241
|
-
//触发事件
|
|
242
|
-
this.$emit('click', {
|
|
243
|
-
...e,
|
|
244
|
-
index: Number(this.index)
|
|
245
|
-
})
|
|
246
|
-
// 兼容tap事件
|
|
247
|
-
this.$emit('tap', {
|
|
248
|
-
...e,
|
|
249
|
-
index: Number(this.index)
|
|
250
|
-
})
|
|
251
|
-
},
|
|
252
|
-
|
|
253
|
-
// 按钮点击事件
|
|
254
|
-
handleClick(e) {
|
|
255
|
-
// 非禁止并且非加载中,才能点击
|
|
256
|
-
if (this.disabled || this.loading) return
|
|
257
|
-
|
|
258
|
-
//普通模式,触发多少次就回调多少次
|
|
259
|
-
if (this.scene === 'none') {
|
|
260
|
-
this.emitClick(e);
|
|
261
|
-
} else if (this.scene == 'debounce') {
|
|
262
|
-
//防抖模式
|
|
263
|
-
this.debounceClick(e);
|
|
264
|
-
} else {
|
|
265
|
-
//节流模式
|
|
266
|
-
this.throttleClick(e);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
132
|
+
import { buttonEmits, buttonProps } from './button';
|
|
133
|
+
import { useButton, useButtonCustomStyle } from './composables';
|
|
134
|
+
|
|
135
|
+
defineOptions({ name: 'FuButton', options: { virtualHost: true } });
|
|
136
|
+
|
|
137
|
+
const props = defineProps(buttonProps);
|
|
138
|
+
const $emit = defineEmits(buttonEmits);
|
|
139
|
+
|
|
140
|
+
const {
|
|
141
|
+
handleClick,
|
|
142
|
+
handleGetPhoneNumber,
|
|
143
|
+
handleGetUserInfo,
|
|
144
|
+
handleError,
|
|
145
|
+
handleOpenSetting,
|
|
146
|
+
handleLaunchApp,
|
|
147
|
+
handleContact,
|
|
148
|
+
handleChooseavatar,
|
|
149
|
+
handleAgreeprivacyauthorization,
|
|
150
|
+
handleAddgroupapp,
|
|
151
|
+
handleChooseaddress,
|
|
152
|
+
handleChooseinvoicetitle,
|
|
153
|
+
handleSubscribe,
|
|
154
|
+
handleLogin,
|
|
155
|
+
handleIm
|
|
156
|
+
} = useButton(props, $emit);
|
|
157
|
+
|
|
158
|
+
const {
|
|
159
|
+
buttonClass,
|
|
160
|
+
loadingColor,
|
|
161
|
+
baseColor,
|
|
162
|
+
textSize,
|
|
163
|
+
btnWrapperStyle
|
|
164
|
+
} = useButtonCustomStyle(props);
|
|
271
165
|
</script>
|
|
272
166
|
|
|
273
167
|
<style lang="scss" scoped>
|
|
274
|
-
@
|
|
168
|
+
@use '../../../style/color.scss' as *;
|
|
275
169
|
$fu-button-height: 40px !default;
|
|
276
170
|
$fu-button-loading-text-font-size: 15px !default;
|
|
277
171
|
$fu-button-loading-text-margin-left: 4px !default;
|
|
@@ -295,22 +189,22 @@
|
|
|
295
189
|
$fu-button-info-border-width: 1px !default;
|
|
296
190
|
$fu-button-info-border-style: solid !default;
|
|
297
191
|
$fu-button-success-color: #fff !default;
|
|
298
|
-
$fu-button-success-bg-color: $fu-success !default;
|
|
192
|
+
$fu-button-success-bg-color: $fu-color-success !default;
|
|
299
193
|
$fu-button-success-border-color: $fu-button-success-bg-color !default;
|
|
300
194
|
$fu-button-success-border-width: 1px !default;
|
|
301
195
|
$fu-button-success-border-style: solid !default;
|
|
302
196
|
$fu-button-primary-color: #fff !default;
|
|
303
|
-
$fu-button-primary-bg-color: $fu-primary !default;
|
|
197
|
+
$fu-button-primary-bg-color: $fu-color-primary !default;
|
|
304
198
|
$fu-button-primary-border-color: $fu-button-primary-bg-color !default;
|
|
305
199
|
$fu-button-primary-border-width: 1px !default;
|
|
306
200
|
$fu-button-primary-border-style: solid !default;
|
|
307
201
|
$fu-button-error-color: #fff !default;
|
|
308
|
-
$fu-button-error-bg-color: $fu-error !default;
|
|
202
|
+
$fu-button-error-bg-color: $fu-color-error !default;
|
|
309
203
|
$fu-button-error-border-color: $fu-button-error-bg-color !default;
|
|
310
204
|
$fu-button-error-border-width: 1px !default;
|
|
311
205
|
$fu-button-error-border-style: solid !default;
|
|
312
206
|
$fu-button-warning-color: #fff !default;
|
|
313
|
-
$fu-button-warning-bg-color: $fu-warning !default;
|
|
207
|
+
$fu-button-warning-bg-color: $fu-color-warning !default;
|
|
314
208
|
$fu-button-warning-border-color: $fu-button-warning-bg-color !default;
|
|
315
209
|
$fu-button-warning-border-width: 1px !default;
|
|
316
210
|
$fu-button-warning-border-style: solid !default;
|
|
@@ -389,23 +283,23 @@
|
|
|
389
283
|
background-image: none;
|
|
390
284
|
|
|
391
285
|
&.fu-button--primary {
|
|
392
|
-
color: $fu-primary;
|
|
286
|
+
color: $fu-color-primary;
|
|
393
287
|
}
|
|
394
288
|
|
|
395
289
|
&.fu-button--info {
|
|
396
|
-
color: $fu-info;
|
|
290
|
+
color: $fu-color-info;
|
|
397
291
|
}
|
|
398
292
|
|
|
399
293
|
&.fu-button--success {
|
|
400
|
-
color: $fu-success;
|
|
294
|
+
color: $fu-color-success;
|
|
401
295
|
}
|
|
402
296
|
|
|
403
297
|
&.fu-button--error {
|
|
404
|
-
color: $fu-error;
|
|
298
|
+
color: $fu-color-error;
|
|
405
299
|
}
|
|
406
300
|
|
|
407
301
|
&.fu-button--warning {
|
|
408
|
-
color: $fu-warning;
|
|
302
|
+
color: $fu-color-warning;
|
|
409
303
|
}
|
|
410
304
|
}
|
|
411
305
|
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { computed, type CSSProperties } from 'vue';
|
|
2
|
+
import type { ButtonProps } from '../button';
|
|
3
|
+
|
|
4
|
+
export const useButtonCustomStyle = (props: ButtonProps) => {
|
|
5
|
+
// 根据不同的参数动态生成class
|
|
6
|
+
const buttonClass = computed(() => {
|
|
7
|
+
const prefix = 'fu-button--';
|
|
8
|
+
const classes = [
|
|
9
|
+
`${prefix}${props.type}`,
|
|
10
|
+
`${prefix}${props.size}`,
|
|
11
|
+
`${prefix}${props.shape}`,
|
|
12
|
+
props.plain? `${(prefix as string)}plain` : '',
|
|
13
|
+
props.disabled ? 'fu-button--disabled' : ''
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
return classes.filter(Boolean).join(' ');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const loadingColor = computed(() => {
|
|
20
|
+
if (props.plain) {
|
|
21
|
+
// 如果有设置color值,则用color值,否则使用type主题颜色
|
|
22
|
+
return props.color? props.color: '#2979ff';
|
|
23
|
+
}
|
|
24
|
+
if (props.type === "info") {
|
|
25
|
+
return "#c9c9c9";
|
|
26
|
+
}
|
|
27
|
+
return "rgb(200, 200, 200)";
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const baseColor = computed<CSSProperties>(() => {
|
|
31
|
+
let style: Record<string, any> = {
|
|
32
|
+
...(props.width && { width: uni.$fu.addUnit(props.width) }),
|
|
33
|
+
...(props.height && { height: uni.$fu.addUnit(props.height) }),
|
|
34
|
+
...(props.height && { lineHeight: uni.$fu.addUnit(props.height) }),
|
|
35
|
+
};
|
|
36
|
+
if (props.color) {
|
|
37
|
+
// 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
|
|
38
|
+
style.color = props.plain ? props.color : "white";
|
|
39
|
+
if (!props.plain) {
|
|
40
|
+
// 非镂空,背景色使用自定义的颜色
|
|
41
|
+
style["background-color"] = props.color;
|
|
42
|
+
}
|
|
43
|
+
if (props.color.indexOf("gradient") !== -1) {
|
|
44
|
+
// 如果自定义的颜色为渐变色,不显示边框,以及通过backgroundImage设置渐变色
|
|
45
|
+
// weex文档说明可以写borderWidth的形式,为什么这里需要分开写?
|
|
46
|
+
// 因为weex是阿里巴巴为了部门业绩考核而做的你懂的东西,所以需要这么写才有效
|
|
47
|
+
style.borderTopWidth = 0;
|
|
48
|
+
style.borderRightWidth = 0;
|
|
49
|
+
style.borderBottomWidth = 0;
|
|
50
|
+
style.borderLeftWidth = 0;
|
|
51
|
+
if (!props.plain) style.backgroundImage = props.color;
|
|
52
|
+
} else {
|
|
53
|
+
// 非渐变色,则设置边框相关的属性
|
|
54
|
+
style.borderColor = props.color;
|
|
55
|
+
style.borderWidth = "1px";
|
|
56
|
+
style.borderStyle = "solid";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return style;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// 字体大小
|
|
63
|
+
const textSize = computed(() => {
|
|
64
|
+
const sizeMap = {
|
|
65
|
+
large: 16,
|
|
66
|
+
normal: 14,
|
|
67
|
+
small: 12,
|
|
68
|
+
mini: 10
|
|
69
|
+
}
|
|
70
|
+
return sizeMap[props.size] || 14
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// 设置外层盒子的宽度,其他样式不需要
|
|
74
|
+
const btnWrapperStyle = computed<CSSProperties>(() => {
|
|
75
|
+
const style: Record<string, any> = {
|
|
76
|
+
margin: props.margin
|
|
77
|
+
};
|
|
78
|
+
const customStyle = uni.$fu.addStyle(props.customStyle);
|
|
79
|
+
if(customStyle.width || props.width) style.width = customStyle.width || uni.$fu.addUnit(props.width);
|
|
80
|
+
return style;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
buttonClass,
|
|
85
|
+
loadingColor,
|
|
86
|
+
baseColor,
|
|
87
|
+
textSize,
|
|
88
|
+
btnWrapperStyle
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { SetupContext } from 'vue';
|
|
2
|
+
import type { ButtonProps, ButtonEmits } from '../button';
|
|
3
|
+
import { debounce, throttle } from '../../../../utils/applyEven';
|
|
4
|
+
|
|
5
|
+
export const useButton = (props: ButtonProps, $emit: SetupContext<ButtonEmits>['emit']) => {
|
|
6
|
+
// 防抖模式
|
|
7
|
+
const debounceClick = (e: TouchEvent) => {
|
|
8
|
+
debounce(() => {
|
|
9
|
+
emitClick(e);
|
|
10
|
+
}, props.sceneTime)
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// 节流模式
|
|
14
|
+
const throttleClick = (e: TouchEvent) => {
|
|
15
|
+
throttle(() => {
|
|
16
|
+
emitClick(e);
|
|
17
|
+
}, props.sceneTime)
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const emitClick = (e: TouchEvent) => {
|
|
21
|
+
//触发事件
|
|
22
|
+
$emit('click', {
|
|
23
|
+
...e,
|
|
24
|
+
index: Number(props.index)
|
|
25
|
+
});
|
|
26
|
+
// 兼容tap事件
|
|
27
|
+
$emit('tap', {
|
|
28
|
+
...e,
|
|
29
|
+
index: Number(props.index)
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// 按钮点击事件
|
|
34
|
+
const handleClick = (e: TouchEvent) => {
|
|
35
|
+
// 非禁止并且非加载中,才能点击
|
|
36
|
+
if (props.disabled || props.loading) return
|
|
37
|
+
|
|
38
|
+
//普通模式,触发多少次就回调多少次
|
|
39
|
+
if (props.scene === 'none') {
|
|
40
|
+
emitClick(e);
|
|
41
|
+
} else if (props.scene == 'debounce') {
|
|
42
|
+
//防抖模式
|
|
43
|
+
debounceClick(e);
|
|
44
|
+
} else {
|
|
45
|
+
//节流模式
|
|
46
|
+
throttleClick(e);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// 微信小程序、百度小程序、抖音小程序、支付宝小程序、快手小程序、京东小程序。
|
|
51
|
+
const handleGetPhoneNumber = (event: any) => {
|
|
52
|
+
$emit('getphonenumber', event.detail)
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// 微信小程序、百度小程序、QQ小程序、快手小程序、京东小程序、360小程序
|
|
56
|
+
const handleGetUserInfo = (event: any) => {
|
|
57
|
+
$emit('getuserinfo', event.detail)
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// 微信、QQ、快手、京东小程序
|
|
61
|
+
const handleError = (event: any) => {
|
|
62
|
+
$emit('error', event.detail)
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// 微信、QQ、百度、快手、京东小程序、小红书小程序
|
|
66
|
+
const handleOpenSetting = (event: any) => {
|
|
67
|
+
$emit('opensetting', event.detail)
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// 微信、QQ、快手、京东小程序
|
|
71
|
+
const handleLaunchApp = (event: any) => {
|
|
72
|
+
$emit('launchapp', event.detail)
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// 微信小程序、百度小程序、快手小程序、抖音小程序
|
|
76
|
+
const handleContact = (event: any) => {
|
|
77
|
+
$emit('contact', event.detail)
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// 微信小程序、支付宝小程序
|
|
81
|
+
const handleChooseavatar = (event: any) => {
|
|
82
|
+
$emit('chooseavatar', event.detail)
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// 微信小程序2.32.3
|
|
86
|
+
const handleAgreeprivacyauthorization = (event: any) => {
|
|
87
|
+
$emit('agreeprivacyauthorization', event.detail)
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// QQ小程序
|
|
91
|
+
const handleAddgroupapp = (event: any) => {
|
|
92
|
+
$emit('addgroupapp', event.detail)
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// 百度小程序
|
|
96
|
+
const handleChooseaddress = (event: any) => {
|
|
97
|
+
$emit('chooseaddress', event.detail)
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// 百度小程序
|
|
101
|
+
const handleChooseinvoicetitle = (event: any) => {
|
|
102
|
+
$emit('chooseinvoicetitle', event.detail)
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// 百度小程序
|
|
106
|
+
const handleSubscribe = (event: any) => {
|
|
107
|
+
$emit('subscribe', event.detail)
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// 百度小程序
|
|
111
|
+
const handleLogin = (event: any) => {
|
|
112
|
+
$emit('login', event.detail)
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// 抖音小程序2.68.0版本+
|
|
116
|
+
const handleIm = (event: any) => {
|
|
117
|
+
$emit('im', event.detail)
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
handleClick,
|
|
122
|
+
handleGetPhoneNumber,
|
|
123
|
+
handleGetUserInfo,
|
|
124
|
+
handleError,
|
|
125
|
+
handleOpenSetting,
|
|
126
|
+
handleLaunchApp,
|
|
127
|
+
handleContact,
|
|
128
|
+
handleChooseavatar,
|
|
129
|
+
handleAgreeprivacyauthorization,
|
|
130
|
+
handleAddgroupapp,
|
|
131
|
+
handleChooseaddress,
|
|
132
|
+
handleChooseinvoicetitle,
|
|
133
|
+
handleSubscribe,
|
|
134
|
+
handleLogin,
|
|
135
|
+
handleIm
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/cell'
|