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,159 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { componentProps, componentTypes, componentShapes } from '../../../constants';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 标签 closePlace 有效值
|
|
6
|
+
*/
|
|
7
|
+
export const tagClosePlaces = ['right', 'right-top'] as const;
|
|
8
|
+
|
|
9
|
+
export const tagProps = {
|
|
10
|
+
/**
|
|
11
|
+
* @description 序号,用于区分多个标签
|
|
12
|
+
*/
|
|
13
|
+
index: {
|
|
14
|
+
type: [String, Number],
|
|
15
|
+
default: ''
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* @description 是否显示
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
show: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* @description 标签类型
|
|
27
|
+
* @values 'primary' - 主色, 'error' - 错误, 'success' - 成功, 'warning' - 警告, 'info' - 信息
|
|
28
|
+
* @default 'primary'
|
|
29
|
+
*/
|
|
30
|
+
type: {
|
|
31
|
+
type: String,
|
|
32
|
+
values: componentTypes,
|
|
33
|
+
default: 'primary'
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* @description 标签的大小
|
|
37
|
+
* @default 'medium'
|
|
38
|
+
*/
|
|
39
|
+
size: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'medium'
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* @description tag的形状
|
|
45
|
+
* @values 'circle' - 两边半圆形, 'square' - 方形,带圆角
|
|
46
|
+
* @default 'square'
|
|
47
|
+
*/
|
|
48
|
+
shape: {
|
|
49
|
+
type: String,
|
|
50
|
+
values: componentShapes,
|
|
51
|
+
default: 'square'
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* @description 标签文字
|
|
55
|
+
*/
|
|
56
|
+
text: {
|
|
57
|
+
type: [String, Number],
|
|
58
|
+
default: ''
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* @description 背景颜色,默认为空字符串,即不处理
|
|
62
|
+
*/
|
|
63
|
+
bgColor: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: ''
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* @description 标签字体颜色,默认为空字符串,即不处理
|
|
69
|
+
*/
|
|
70
|
+
color: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: ''
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* @description 标签的边框颜色
|
|
76
|
+
*/
|
|
77
|
+
borderColor: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: ''
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* @description 镂空时是否填充背景色
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
plainFill: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* @description 是否镂空
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
plain: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* @description 是否可关闭
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
closable: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: false
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* @description 关闭按钮图标的颜色
|
|
107
|
+
* @default '#C6C7CB'
|
|
108
|
+
*/
|
|
109
|
+
closeColor: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: '#C6C7CB'
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* @description 关闭按钮图标的位置
|
|
115
|
+
* @values 'right' - 右边, 'right-top' - 右上
|
|
116
|
+
* @default 'right-top'
|
|
117
|
+
*/
|
|
118
|
+
closePlace: {
|
|
119
|
+
type: String,
|
|
120
|
+
values: tagClosePlaces,
|
|
121
|
+
default: 'right-top'
|
|
122
|
+
},
|
|
123
|
+
/**
|
|
124
|
+
* @description 内置图标,或绝对路径的图片
|
|
125
|
+
*/
|
|
126
|
+
icon: {
|
|
127
|
+
type: String,
|
|
128
|
+
default: ''
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* @description 图标颜色
|
|
132
|
+
*/
|
|
133
|
+
iconColor: {
|
|
134
|
+
type: String,
|
|
135
|
+
default: ''
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* @description nvue模式下 是否直接显示,在fu-list等cell下面使用就需要设置
|
|
139
|
+
*/
|
|
140
|
+
cellChild: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: false
|
|
143
|
+
},
|
|
144
|
+
...componentProps
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const tagEmits = {
|
|
148
|
+
/**
|
|
149
|
+
* @description 点击标签时触发
|
|
150
|
+
*/
|
|
151
|
+
click: (_e: any) => true,
|
|
152
|
+
/**
|
|
153
|
+
* @description 点击标签关闭按钮触发
|
|
154
|
+
*/
|
|
155
|
+
close: (_e: any) => true
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export type TagProps = ExtractPropTypes<typeof tagProps>;
|
|
159
|
+
export type TagEmits = typeof tagEmits;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<fu-transition mode="fade" :show="
|
|
2
|
+
<fu-transition mode="fade" :show="isShow" :cell-child="cellChild">
|
|
3
3
|
<view class="fu-tag">
|
|
4
4
|
<view
|
|
5
5
|
class="fu-tag--wrapper"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
:style="[{
|
|
15
15
|
marginRight: closable && closePlace =='right-top'? '10px': 0,
|
|
16
16
|
marginTop: closable && closePlace =='right-top'? '10px': 0,
|
|
17
|
-
},
|
|
17
|
+
}, tagStyle, $fu.addStyle(customStyle)]"
|
|
18
18
|
@tap="handleClick">
|
|
19
19
|
<slot name="icon">
|
|
20
20
|
<view class="fu-tag__icon" v-if="icon">
|
|
@@ -52,14 +52,12 @@
|
|
|
52
52
|
</fu-transition>
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
|
-
<script>
|
|
56
|
-
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
57
|
-
import mixin from '../../libs/mixin/mixin.js'
|
|
58
|
-
import props from './props.js';
|
|
55
|
+
<script lang="ts" setup>
|
|
59
56
|
/**
|
|
60
57
|
* Tag 标签
|
|
61
58
|
* @description 此组件一般用于标记和选择,我们提供了更加丰富的表现形式,能够较全面的涵盖您的使用场景
|
|
62
|
-
* @
|
|
59
|
+
* @tutorial http://www.fusions.top/components/tag.html
|
|
60
|
+
* @property {String | Number} index 序号,用于区分多个标签 同时 点击时返回的索引值,用于区分例遍的数组哪个元素被点击了
|
|
63
61
|
* @property {Boolean} show = [true|false] 标签是否显示(默认 true )
|
|
64
62
|
* @property {String} type = [primary|error|success|warning|info] 标签预置按钮样式(默认 'primary' )
|
|
65
63
|
* @value primary 主色
|
|
@@ -68,10 +66,10 @@
|
|
|
68
66
|
* @value warning 警告
|
|
69
67
|
* @value info 信息
|
|
70
68
|
* @property {String} size = [large|medium|mini] 标签的大小,large,medium,mini(默认 'medium' )
|
|
71
|
-
* @property {String} shape = [circle|square] tag
|
|
69
|
+
* @property {String} shape = [circle|square] tag的形状(默认 'square' )
|
|
72
70
|
* @value circle 两边半圆形
|
|
73
71
|
* @value square 方形,带圆角
|
|
74
|
-
* @property {String
|
|
72
|
+
* @property {String | Number} text 标签的文字内容 如果直接使用插槽nvue中无法控制字体样式
|
|
75
73
|
* @property {String} bgColor 背景颜色,默认为空字符串,即不处理
|
|
76
74
|
* @property {String} color 标签字体颜色,默认为空字符串,即不处理
|
|
77
75
|
* @property {String} borderColor 镂空形式标签的边框颜色
|
|
@@ -88,78 +86,40 @@
|
|
|
88
86
|
* @event {Function} close closable为true时,点击标签关闭按钮触发 index: 传递的index参数值
|
|
89
87
|
* @example <fu-tag text="标签" type="error" plain plainFill></fu-tag>
|
|
90
88
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
style.color = this.color;
|
|
114
|
-
}
|
|
115
|
-
return style
|
|
116
|
-
},
|
|
117
|
-
imgStyle() {
|
|
118
|
-
const width = this.size === 'large' ? '17px' : this.size === 'medium' ? '15px' : '13px';
|
|
119
|
-
return {
|
|
120
|
-
width,
|
|
121
|
-
height: width
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
// 文本的样式
|
|
125
|
-
closeSize() {
|
|
126
|
-
const size = this.size === 'large' ? 15 : this.size === 'medium' ? 12 : 12;
|
|
127
|
-
return size
|
|
128
|
-
},
|
|
129
|
-
// 图标大小
|
|
130
|
-
iconSize() {
|
|
131
|
-
const size = this.size === 'large' ? 21 : this.size === 'medium' ? 19 : 16;
|
|
132
|
-
return size
|
|
133
|
-
},
|
|
134
|
-
// 图标颜色
|
|
135
|
-
elIconColor() {
|
|
136
|
-
return this.iconColor ? this.iconColor : this.plain ? this.type : '#ffffff';
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
methods: {
|
|
140
|
-
// 点击标签
|
|
141
|
-
handleClick() {
|
|
142
|
-
this.$emit('click', this.index)
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
// 点击关闭按钮
|
|
146
|
-
handleClose() {
|
|
147
|
-
this.$emit('close', this.index)
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
89
|
+
import { tagEmits, tagProps } from './tag';
|
|
90
|
+
import { useTag, useTagCustomStyle } from './composables';
|
|
91
|
+
|
|
92
|
+
defineOptions({ name: 'FuTag', options: { virtualHost: true } });
|
|
93
|
+
|
|
94
|
+
const props = defineProps(tagProps);
|
|
95
|
+
const $emit = defineEmits(tagEmits);
|
|
96
|
+
|
|
97
|
+
const {
|
|
98
|
+
isShow,
|
|
99
|
+
handleClick,
|
|
100
|
+
handleClose
|
|
101
|
+
} = useTag(props, $emit);
|
|
102
|
+
|
|
103
|
+
const {
|
|
104
|
+
tagStyle,
|
|
105
|
+
textColor,
|
|
106
|
+
imgStyle,
|
|
107
|
+
closeSize,
|
|
108
|
+
iconSize,
|
|
109
|
+
elIconColor
|
|
110
|
+
} = useTagCustomStyle(props);
|
|
151
111
|
</script>
|
|
152
112
|
|
|
153
113
|
<style lang="scss" scoped>
|
|
154
|
-
@
|
|
155
|
-
@
|
|
114
|
+
@use '../../../style/components.scss';
|
|
115
|
+
@use '../../../style/color.scss' as *;
|
|
156
116
|
|
|
157
117
|
.fu-tag {
|
|
158
118
|
position: relative;
|
|
159
119
|
width: fit-content;
|
|
160
120
|
|
|
161
121
|
&--wrapper {
|
|
162
|
-
@include flex;
|
|
122
|
+
@include components.flex;
|
|
163
123
|
align-items: center;
|
|
164
124
|
border-style: solid;
|
|
165
125
|
}
|
|
@@ -224,14 +184,14 @@
|
|
|
224
184
|
}
|
|
225
185
|
|
|
226
186
|
&--primary {
|
|
227
|
-
background-color: $fu-primary;
|
|
187
|
+
background-color: $fu-color-primary;
|
|
228
188
|
border-width: 1px;
|
|
229
|
-
border-color: $fu-primary;
|
|
189
|
+
border-color: $fu-color-primary;
|
|
230
190
|
}
|
|
231
191
|
|
|
232
192
|
&--primary--plain {
|
|
233
193
|
border-width: 1px;
|
|
234
|
-
border-color: $fu-primary;
|
|
194
|
+
border-color: $fu-color-primary;
|
|
235
195
|
}
|
|
236
196
|
|
|
237
197
|
&--primary--plain--fill {
|
|
@@ -243,18 +203,18 @@
|
|
|
243
203
|
}
|
|
244
204
|
|
|
245
205
|
&__text--primary--plain {
|
|
246
|
-
color: $fu-primary;
|
|
206
|
+
color: $fu-color-primary;
|
|
247
207
|
}
|
|
248
208
|
|
|
249
209
|
&--error {
|
|
250
|
-
background-color: $fu-error;
|
|
210
|
+
background-color: $fu-color-error;
|
|
251
211
|
border-width: 1px;
|
|
252
|
-
border-color: $fu-error;
|
|
212
|
+
border-color: $fu-color-error;
|
|
253
213
|
}
|
|
254
214
|
|
|
255
215
|
&--error--plain {
|
|
256
216
|
border-width: 1px;
|
|
257
|
-
border-color: $fu-error;
|
|
217
|
+
border-color: $fu-color-error;
|
|
258
218
|
}
|
|
259
219
|
|
|
260
220
|
&--error--plain--fill {
|
|
@@ -266,18 +226,18 @@
|
|
|
266
226
|
}
|
|
267
227
|
|
|
268
228
|
&__text--error--plain {
|
|
269
|
-
color: $fu-error;
|
|
229
|
+
color: $fu-color-error;
|
|
270
230
|
}
|
|
271
231
|
|
|
272
232
|
&--warning {
|
|
273
|
-
background-color: $fu-warning;
|
|
233
|
+
background-color: $fu-color-warning;
|
|
274
234
|
border-width: 1px;
|
|
275
|
-
border-color: $fu-warning;
|
|
235
|
+
border-color: $fu-color-warning;
|
|
276
236
|
}
|
|
277
237
|
|
|
278
238
|
&--warning--plain {
|
|
279
239
|
border-width: 1px;
|
|
280
|
-
border-color: $fu-warning;
|
|
240
|
+
border-color: $fu-color-warning;
|
|
281
241
|
}
|
|
282
242
|
|
|
283
243
|
&--warning--plain--fill {
|
|
@@ -289,18 +249,18 @@
|
|
|
289
249
|
}
|
|
290
250
|
|
|
291
251
|
&__text--warning--plain {
|
|
292
|
-
color: $fu-warning;
|
|
252
|
+
color: $fu-color-warning;
|
|
293
253
|
}
|
|
294
254
|
|
|
295
255
|
&--success {
|
|
296
|
-
background-color: $fu-success;
|
|
256
|
+
background-color: $fu-color-success;
|
|
297
257
|
border-width: 1px;
|
|
298
|
-
border-color: $fu-success;
|
|
258
|
+
border-color: $fu-color-success;
|
|
299
259
|
}
|
|
300
260
|
|
|
301
261
|
&--success--plain {
|
|
302
262
|
border-width: 1px;
|
|
303
|
-
border-color: $fu-success;
|
|
263
|
+
border-color: $fu-color-success;
|
|
304
264
|
}
|
|
305
265
|
|
|
306
266
|
&--success--plain--fill {
|
|
@@ -312,18 +272,18 @@
|
|
|
312
272
|
}
|
|
313
273
|
|
|
314
274
|
&__text--success--plain {
|
|
315
|
-
color: $fu-success;
|
|
275
|
+
color: $fu-color-success;
|
|
316
276
|
}
|
|
317
277
|
|
|
318
278
|
&--info {
|
|
319
|
-
background-color: $fu-info;
|
|
279
|
+
background-color: $fu-color-info;
|
|
320
280
|
border-width: 1px;
|
|
321
|
-
border-color: $fu-info;
|
|
281
|
+
border-color: $fu-color-info;
|
|
322
282
|
}
|
|
323
283
|
|
|
324
284
|
&--info--plain {
|
|
325
285
|
border-width: 1px;
|
|
326
|
-
border-color: $fu-info;
|
|
286
|
+
border-color: $fu-color-info;
|
|
327
287
|
}
|
|
328
288
|
|
|
329
289
|
&--info--plain--fill {
|
|
@@ -335,13 +295,13 @@
|
|
|
335
295
|
}
|
|
336
296
|
|
|
337
297
|
&__text--info--plain {
|
|
338
|
-
color: $fu-info;
|
|
298
|
+
color: $fu-color-info;
|
|
339
299
|
}
|
|
340
300
|
|
|
341
301
|
&__close {
|
|
342
302
|
border-radius: 100px;
|
|
343
303
|
background-color: #C6C7CB;
|
|
344
|
-
@include flex(row);
|
|
304
|
+
@include components.flex(row);
|
|
345
305
|
align-items: center;
|
|
346
306
|
justify-content: center;
|
|
347
307
|
transform: scale(0.6);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/text'
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { computed, type CSSProperties } from 'vue';
|
|
2
|
+
import type { TextProps } from '../text';
|
|
3
|
+
|
|
4
|
+
export const useTextCustomStyle = (props: TextProps) => {
|
|
5
|
+
const valueStyle = computed<CSSProperties>(() => {
|
|
6
|
+
const style: Record<string, any> = {
|
|
7
|
+
textDecoration: props.decoration,
|
|
8
|
+
wordWrap: props.wordWrap,
|
|
9
|
+
fontSize: uni.$fu.addUnit(props.size)
|
|
10
|
+
};
|
|
11
|
+
!props.type && (style.color = props.color);
|
|
12
|
+
props.lineHeight && (style.lineHeight = uni.$fu.addUnit(props.lineHeight));
|
|
13
|
+
isNvue.value && props.lines && (style.lines = props.lines);
|
|
14
|
+
if(isNvue.value && props.mode != 'price' && !props.prefixIcon && !props.suffixIcon) {
|
|
15
|
+
style.flex = 1;
|
|
16
|
+
style.textAlign = props.align === 'left' ? 'flex-start' : props.align === 'center' ? 'center' : 'right';
|
|
17
|
+
}
|
|
18
|
+
!isNvue.value && props.block && (style.display = 'block');
|
|
19
|
+
return uni.$fu.deepMerge(style, uni.$fu.addStyle(props.customStyle));
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const isNvue = computed(() => {
|
|
23
|
+
let nvue = false;
|
|
24
|
+
// #ifdef APP-NVUE
|
|
25
|
+
nvue = true;
|
|
26
|
+
// #endif
|
|
27
|
+
return nvue
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const isMp = computed(() => {
|
|
31
|
+
let mp = false;
|
|
32
|
+
// #ifdef MP
|
|
33
|
+
mp = true;
|
|
34
|
+
// #endif
|
|
35
|
+
return mp
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const value = computed(() => {
|
|
39
|
+
const { text, mode, format, href } = props;
|
|
40
|
+
// 价格类型
|
|
41
|
+
switch(mode) {
|
|
42
|
+
case 'price':
|
|
43
|
+
// 如果text不为金额进行提示
|
|
44
|
+
if (!/^\d+(\.\d+)?$/.test(text.toString())) {
|
|
45
|
+
uni.$fu.error('金额模式下,text参数需要为金额格式');
|
|
46
|
+
}
|
|
47
|
+
// 进行格式化,判断用户传入的format参数为正则,或者函数,如果没有传入format,则使用默认的金额格式化处理
|
|
48
|
+
if (uni.$fu.isFunc(format)) {
|
|
49
|
+
// 如果用户传入的是函数,使用函数格式化
|
|
50
|
+
return (format as Function)(text)
|
|
51
|
+
}
|
|
52
|
+
// 如果format非正则,非函数,则使用默认的金额格式化方法进行操作
|
|
53
|
+
return uni.$fu.priceFormat(text, 2)
|
|
54
|
+
case 'date':
|
|
55
|
+
// 判断是否合法的日期或者时间戳
|
|
56
|
+
!uni.$fu.checkDate(text) && uni.$fu.error('日期模式下,text参数需要为日期或时间戳格式')
|
|
57
|
+
// 进行格式化,判断用户传入的format参数为正则,或者函数,如果没有传入format,则使用默认的格式化处理
|
|
58
|
+
if (uni.$fu.isFunc(format)) {
|
|
59
|
+
// 如果用户传入的是函数,使用函数格式化
|
|
60
|
+
return (format as Function)(text)
|
|
61
|
+
} if (format) {
|
|
62
|
+
// 如果format非正则,非函数,则使用默认的时间格式化方法进行操作
|
|
63
|
+
return uni.$fu.formatTime(text, format)
|
|
64
|
+
}
|
|
65
|
+
// 如果没有设置format,则设置为默认的时间格式化形式
|
|
66
|
+
return uni.$fu.formatTime(text, 'Y-M-D')
|
|
67
|
+
case 'phone':
|
|
68
|
+
// 判断是否合法的手机号
|
|
69
|
+
// !mobile(text) && error('手机号模式下,text参数需要为手机号码格式')
|
|
70
|
+
if (uni.$fu.isFunc(format)) {
|
|
71
|
+
// 如果用户传入的是函数,使用函数格式化
|
|
72
|
+
return (format as Function)(text)
|
|
73
|
+
} if (format === 'encrypt') {
|
|
74
|
+
// 如果format为encrypt,则将手机号进行星号加密处理
|
|
75
|
+
return `${text.toString().substring(0, 3)}****${text.toString().substring(7)}`
|
|
76
|
+
}
|
|
77
|
+
return text
|
|
78
|
+
case 'name':
|
|
79
|
+
// 判断是否合法的字符粗
|
|
80
|
+
!(typeof (text) === 'string') && uni.$fu.error('姓名模式下,text参数需要为字符串格式')
|
|
81
|
+
if (uni.$fu.isFunc(format)) {
|
|
82
|
+
// 如果用户传入的是函数,使用函数格式化
|
|
83
|
+
return (format as Function)(text)
|
|
84
|
+
} if (format === 'encrypt') {
|
|
85
|
+
// 如果format为encrypt,则将姓名进行星号加密处理
|
|
86
|
+
return formatName(String(text))
|
|
87
|
+
}
|
|
88
|
+
return text
|
|
89
|
+
case 'link':
|
|
90
|
+
// 判断是否合法的字符粗
|
|
91
|
+
!uni.$fu.isUrl(href) && uni.$fu.error('超链接模式下,href参数需要为URL格式')
|
|
92
|
+
return text
|
|
93
|
+
default:
|
|
94
|
+
return text
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const formatName = (name: string) => {
|
|
99
|
+
let value = '';
|
|
100
|
+
if (name.length === 2) {
|
|
101
|
+
value = name.substring(0, 1) + '*';
|
|
102
|
+
} else if (name.length > 2) {
|
|
103
|
+
let char = '';
|
|
104
|
+
for (let i = 0, len = name.length - 2; i < len; i++) {
|
|
105
|
+
char += '*';
|
|
106
|
+
}
|
|
107
|
+
value = name.substring(0, 1) + char + name.substring(-1, 1);
|
|
108
|
+
} else {
|
|
109
|
+
value = name;
|
|
110
|
+
}
|
|
111
|
+
return value
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
valueStyle,
|
|
116
|
+
isNvue,
|
|
117
|
+
isMp,
|
|
118
|
+
value
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { SetupContext } from 'vue';
|
|
2
|
+
import type { TextProps, TextEmits } from '../text';
|
|
3
|
+
|
|
4
|
+
export const useText = (props: TextProps, $emit: SetupContext<TextEmits>['emit']) => {
|
|
5
|
+
const handleClick = () => {
|
|
6
|
+
// 如果为手机号模式,拨打电话
|
|
7
|
+
if (props.call && props.mode === 'phone') {
|
|
8
|
+
uni.makePhoneCall({
|
|
9
|
+
phoneNumber: props.text as string
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
$emit('click');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const onGetPhoneNumber = (e: any) => {
|
|
16
|
+
$emit('getphonenumber', e.detail)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const onGetUserInfo = (e: any) => {
|
|
20
|
+
$emit('getuserinfo', e)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const onError = (e: any) => {
|
|
24
|
+
$emit('error', e.detail)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const onOpenSetting = (e: any) => {
|
|
28
|
+
$emit('opensetting', e.detail)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const onLaunchApp = (e: any) => {
|
|
32
|
+
$emit('launchapp', e.detail)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const onContact = (e: any) => {
|
|
36
|
+
$emit('contact', e.detail)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const onChooseavatar = (e: any) => {
|
|
40
|
+
$emit('chooseavatar', e.detail)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const onAgreeprivacyauthorization = (e: any) => {
|
|
44
|
+
$emit('agreeprivacyauthorization', e.detail)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const onAddgroupapp = (e: any) => {
|
|
48
|
+
$emit('addgroupapp', e.detail)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const onChooseaddress = (e: any) => {
|
|
52
|
+
$emit('chooseaddress', e.detail)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const onSubscribe = (e: any) => {
|
|
56
|
+
$emit('subscribe', e.detail)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const onLogin = (e: any) => {
|
|
60
|
+
$emit('login', e.detail)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const onIm = (e: any) => {
|
|
64
|
+
$emit('im', e.detail)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
handleClick,
|
|
69
|
+
onGetPhoneNumber,
|
|
70
|
+
onGetUserInfo,
|
|
71
|
+
onError,
|
|
72
|
+
onOpenSetting,
|
|
73
|
+
onLaunchApp,
|
|
74
|
+
onContact,
|
|
75
|
+
onChooseavatar,
|
|
76
|
+
onAgreeprivacyauthorization,
|
|
77
|
+
onAddgroupapp,
|
|
78
|
+
onChooseaddress,
|
|
79
|
+
onSubscribe,
|
|
80
|
+
onLogin,
|
|
81
|
+
onIm
|
|
82
|
+
}
|
|
83
|
+
};
|