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,191 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="fu-sign-board-class fu-sign-board" :style="{top: `${customBarHeight}px`, height: `calc(100% - ${customBarHeight}px)`}" v-if="show">
|
|
3
|
+
<!-- 签名canvas -->
|
|
4
|
+
<view class="fu-sign-board__content">
|
|
5
|
+
<view class="fu-sign-board__content__wrapper">
|
|
6
|
+
<canvas
|
|
7
|
+
:id="canvasId"
|
|
8
|
+
:canvas-id="canvasId"
|
|
9
|
+
class="fu-sign-board__content__canvas"
|
|
10
|
+
disableScroll
|
|
11
|
+
@touchstart="onTouchStart"
|
|
12
|
+
@touchmove="onTouchMove"
|
|
13
|
+
@touchend="onTouchEnd">
|
|
14
|
+
</canvas>
|
|
15
|
+
</view>
|
|
16
|
+
</view>
|
|
17
|
+
|
|
18
|
+
<!-- 底部工具栏 -->
|
|
19
|
+
<view class="fu-sign-board__tools">
|
|
20
|
+
<!-- 可选颜色 -->
|
|
21
|
+
<view class="fu-sign-board__tools__color">
|
|
22
|
+
<view
|
|
23
|
+
class="fu-sign-board__tools__color__item"
|
|
24
|
+
:class="[{'fu-sign-board__tools__color__item--active': currentSelectColor === item}]"
|
|
25
|
+
:style="{backgroundColor: (item as string)}"
|
|
26
|
+
v-for="(item, index) in signSelectColor" :key="index"
|
|
27
|
+
@tap="colorSwitch(item as string)">
|
|
28
|
+
</view>
|
|
29
|
+
</view>
|
|
30
|
+
|
|
31
|
+
<!-- 按钮 -->
|
|
32
|
+
<view class="fu-sign-board__tools__button">
|
|
33
|
+
<view class="fu-sign-board__tools__button__item fu-bg-red" @tap="resetDraw">清除</view>
|
|
34
|
+
<view class="fu-sign-board__tools__button__item fu-bg-blue" @tap="handleSave">保存</view>
|
|
35
|
+
<view class="fu-sign-board__tools__button__item fu-bg-indigo" @tap="previewImage">预览</view>
|
|
36
|
+
<view class="fu-sign-board__tools__button__item fu-bg-orange" @tap="closeBoard">关闭</view>
|
|
37
|
+
</view>
|
|
38
|
+
</view>
|
|
39
|
+
|
|
40
|
+
<!-- 伪全屏生成旋转图片canvas容器,不在页面上展示 -->
|
|
41
|
+
<view style="position: fixed; left: -2000px; width: 0; height: 0; overflow: hidden;">
|
|
42
|
+
<canvas
|
|
43
|
+
id="temp-fu-sign-canvas"
|
|
44
|
+
canvas-id="temp-fu-sign-canvas"
|
|
45
|
+
:style="{width: `${canvasHeight}px`, height: `${canvasHeight}px`}">
|
|
46
|
+
</canvas>
|
|
47
|
+
</view>
|
|
48
|
+
</view>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script lang="ts" setup>
|
|
52
|
+
/**
|
|
53
|
+
* @description SignBoard签名板
|
|
54
|
+
* @tutorial http://www.fusions.top/components/signBoard.html
|
|
55
|
+
* @property {Boolean} show = [true|false] 是否显示(默认 false)
|
|
56
|
+
* @property {Array} signSelectColor 可选签名颜色(默认 ['#060606', '#ec3930'])
|
|
57
|
+
* @property {Boolean} rotate 是否旋转输出图片(默认 true)
|
|
58
|
+
* @property {String | Number} customBarHeight 自定义顶栏的高度(默认 0)
|
|
59
|
+
*
|
|
60
|
+
* @event {Function} save 保存时触发
|
|
61
|
+
* @event {Function} close 关闭时触发
|
|
62
|
+
*/
|
|
63
|
+
import { signBoardEmits, signBoardProps } from './sign-board';
|
|
64
|
+
import { useSignBoard } from './composables';
|
|
65
|
+
|
|
66
|
+
defineOptions({ name: 'FuSignBoard', options: { virtualHost: true } });
|
|
67
|
+
|
|
68
|
+
const props = defineProps(signBoardProps);
|
|
69
|
+
const $emit = defineEmits(signBoardEmits);
|
|
70
|
+
|
|
71
|
+
const {
|
|
72
|
+
canvasId,
|
|
73
|
+
canvasWidth,
|
|
74
|
+
canvasHeight,
|
|
75
|
+
currentSelectColor,
|
|
76
|
+
onTouchStart,
|
|
77
|
+
onTouchMove,
|
|
78
|
+
onTouchEnd,
|
|
79
|
+
resetDraw,
|
|
80
|
+
handleSave,
|
|
81
|
+
previewImage,
|
|
82
|
+
closeBoard,
|
|
83
|
+
colorSwitch
|
|
84
|
+
} = useSignBoard(props, $emit);
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style lang="scss" scoped>
|
|
88
|
+
.fu-sign-board {
|
|
89
|
+
position: fixed;
|
|
90
|
+
top: 0;
|
|
91
|
+
left: 0;
|
|
92
|
+
right: 0;
|
|
93
|
+
bottom: 0;
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
background-color: #E6E6E6;
|
|
97
|
+
z-index: 997;
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: row-reverse;
|
|
100
|
+
|
|
101
|
+
&__content {
|
|
102
|
+
width: 84%;
|
|
103
|
+
height: 100%;
|
|
104
|
+
|
|
105
|
+
&__wrapper {
|
|
106
|
+
width: calc(100% - 60rpx);
|
|
107
|
+
height: calc(100% - 60rpx);
|
|
108
|
+
margin: 30rpx;
|
|
109
|
+
border-radius: 20rpx;
|
|
110
|
+
border: 2rpx dotted #AAAAAA;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&__canvas {
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
background-color: #FFFFFF;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&__tools {
|
|
122
|
+
width: 16%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
align-items: center;
|
|
127
|
+
justify-content: space-between;
|
|
128
|
+
|
|
129
|
+
&__color {
|
|
130
|
+
margin-top: 30rpx;
|
|
131
|
+
|
|
132
|
+
&__item {
|
|
133
|
+
width: 70rpx;
|
|
134
|
+
height: 70rpx;
|
|
135
|
+
border-radius: 100rpx;
|
|
136
|
+
margin: 20rpx auto;
|
|
137
|
+
|
|
138
|
+
&--active {
|
|
139
|
+
position: relative;
|
|
140
|
+
|
|
141
|
+
&::after {
|
|
142
|
+
content: '';
|
|
143
|
+
position: absolute;
|
|
144
|
+
top: 50%;
|
|
145
|
+
left: 50%;
|
|
146
|
+
width: 40%;
|
|
147
|
+
height: 40%;
|
|
148
|
+
border-radius: 100rpx;
|
|
149
|
+
background-color: #FFFFFF;
|
|
150
|
+
transform: translate(-50%, -50%);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&__button {
|
|
157
|
+
margin-bottom: 30rpx;
|
|
158
|
+
display: flex;
|
|
159
|
+
flex-direction: column;
|
|
160
|
+
|
|
161
|
+
&__item {
|
|
162
|
+
width: 130rpx;
|
|
163
|
+
height: 60rpx;
|
|
164
|
+
line-height: 60rpx;
|
|
165
|
+
text-align: center;
|
|
166
|
+
margin: 60rpx auto;
|
|
167
|
+
border-radius: 10rpx;
|
|
168
|
+
color: #FFFFFF;
|
|
169
|
+
transform-origin: center center;
|
|
170
|
+
transform: rotateZ(90deg);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.fu-bg-red {
|
|
177
|
+
background-color: #E83A30;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.fu-bg-blue {
|
|
181
|
+
background-color: #3D7EFF;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.fu-bg-indigo {
|
|
185
|
+
background-color: #31C9E8;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.fu-bg-orange {
|
|
189
|
+
background-color: #FFA726;
|
|
190
|
+
}
|
|
191
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/skeleton'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import type { SkeletonProps } from '../skeleton';
|
|
3
|
+
|
|
4
|
+
export const useSkeletonCustomStyle = (props: SkeletonProps) => {
|
|
5
|
+
const animateClass = computed(() => {
|
|
6
|
+
return props.animate ? 'fu-skeleton--animation' : 'fu-skeleton--static';
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const roundClass = computed(() => {
|
|
10
|
+
return props.round ? 'fu-skeleton--round' : 'fu-skeleton--radius';
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const getItemStyle = (item: any) => {
|
|
14
|
+
let style: Record<string, any> = {};
|
|
15
|
+
return uni.$fu.deepMerge(style, uni.$fu.addStyle(item.style));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
animateClass,
|
|
20
|
+
roundClass,
|
|
21
|
+
getItemStyle
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ref, onMounted } from 'vue';
|
|
2
|
+
import type { SkeletonProps } from '../skeleton';
|
|
3
|
+
// #ifdef APP-NVUE
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
const animation = weex.requireModule('animation');
|
|
6
|
+
// #endif
|
|
7
|
+
|
|
8
|
+
export const useSkeleton = (props: SkeletonProps) => {
|
|
9
|
+
const skeleton = ref();
|
|
10
|
+
const elements = ref([]);
|
|
11
|
+
const opacity = ref(0.5);
|
|
12
|
+
const duration = ref(500);
|
|
13
|
+
|
|
14
|
+
// 初始化骨架屏数据
|
|
15
|
+
const init = () => {
|
|
16
|
+
let result = [];
|
|
17
|
+
if (!uni.$fu.isArray(props.skeleton)) return uni.$fu.error('skeleton参数必须为数组形式,参考文档示例:');
|
|
18
|
+
props.skeleton.forEach(item => {
|
|
19
|
+
const elClass = getElCounts(item);
|
|
20
|
+
result = result.concat(elClass);
|
|
21
|
+
})
|
|
22
|
+
elements.value = [...result];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 处理骨架屏参数内容
|
|
27
|
+
* @param {Object} e 每项数据
|
|
28
|
+
*/
|
|
29
|
+
const getElCounts = (e: any) => {
|
|
30
|
+
let elements = [];
|
|
31
|
+
let children = [];
|
|
32
|
+
if (uni.$fu.checkNumber(e)) return [{ type: 'gap', height: e }];
|
|
33
|
+
const type = e.type || 'line';
|
|
34
|
+
const num = e.num || 1;
|
|
35
|
+
const style = e.style || {};
|
|
36
|
+
const styleIsArray = uni.$fu.isArray(style);
|
|
37
|
+
const gap = e.gap || '20rpx';
|
|
38
|
+
const child = e.children || [];
|
|
39
|
+
for (let i = 0; i < child.length; i++) {
|
|
40
|
+
children[i] = {
|
|
41
|
+
classs: child[i].type.indexOf('avatar') > -1 || child[i].type.indexOf('custom') > -1? '': 'fu-skeleton__group__sub',
|
|
42
|
+
elements: getElCounts(child[i])
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
for (let i = 0; i < num; i++) {
|
|
46
|
+
if (gap && i < num && i > 0) {
|
|
47
|
+
elements.push({
|
|
48
|
+
type: 'gap',
|
|
49
|
+
height: gap
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
elements.push({
|
|
53
|
+
classs: `fu-skeleton__${type}`,
|
|
54
|
+
type,
|
|
55
|
+
style: styleIsArray ? style[i] : style,
|
|
56
|
+
gap,
|
|
57
|
+
children
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return elements;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// 创建动画
|
|
64
|
+
const createAnimation = (opacitys: number = 1) => {
|
|
65
|
+
// loading结束之后或未开启动画不执行
|
|
66
|
+
if (!props.loading || !props.animate) return;
|
|
67
|
+
const skeletons = skeleton.value;
|
|
68
|
+
const total = skeletons.length;
|
|
69
|
+
let completed = 0;
|
|
70
|
+
skeletons.forEach((item: any) => {
|
|
71
|
+
animation.transition(item, {
|
|
72
|
+
styles: {
|
|
73
|
+
opacity: opacitys,
|
|
74
|
+
},
|
|
75
|
+
duration: duration.value
|
|
76
|
+
}, () => {
|
|
77
|
+
if (++completed >= total) {
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
createAnimation(opacitys < 1 ? 1 : opacity.value);
|
|
80
|
+
}, 200)
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// 生命周期
|
|
87
|
+
onMounted(() => {
|
|
88
|
+
init()
|
|
89
|
+
// #ifdef APP-NVUE
|
|
90
|
+
if (props.loading && props.animate) {
|
|
91
|
+
uni.$fu.sleep(50).then(() => {
|
|
92
|
+
createAnimation(opacity.value);
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
// #endif
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
skeleton,
|
|
100
|
+
elements
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const skeletonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* @description 是否显示骨架
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
loading: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: true
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* @description 骨架内容 具体说明参考文档:
|
|
14
|
+
*/
|
|
15
|
+
skeleton: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => []
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* @description 是否开启动画效果
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
animate: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: true
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* @description 是否圆角骨架风格
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
round: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type SkeletonProps = ExtractPropTypes<typeof skeletonProps>;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="fu-skeleton">
|
|
3
|
+
<view v-if="loading">
|
|
4
|
+
<view v-for="(item, index) in elements" :key="index">
|
|
5
|
+
<!-- 横向并列布局 -->
|
|
6
|
+
<view class="fu-skeleton__group" :style="[getItemStyle(item)]" v-if="item.type=='flex'">
|
|
7
|
+
<view :class="[item2.classs]" :style="[getItemStyle(item2)]" v-for="(item2,index2) in item.children" :key="index2">
|
|
8
|
+
<view v-for="(item3,index3) in item2.elements" :key="index3">
|
|
9
|
+
<!-- 垂直高度占位 -->
|
|
10
|
+
<view :style="{height: $fu.addUnit(item3.height, 'rpx')}" v-if="item3.type=='gap'"></view>
|
|
11
|
+
<!-- 基本单位 -->
|
|
12
|
+
<view ref="skeleton" :class="[item3.classs, roundClass, animateClass]" :style="[getItemStyle(item3)]" v-else></view>
|
|
13
|
+
</view>
|
|
14
|
+
</view>
|
|
15
|
+
</view>
|
|
16
|
+
<!-- 自定义骨架屏内容 -->
|
|
17
|
+
<view ref="skeleton" :class="[item.classs, animateClass]" :style="[getItemStyle(item)]" v-else-if="item.type == 'custom'"></view>
|
|
18
|
+
<!-- 垂直高度占位 -->
|
|
19
|
+
<view :style="{height: $fu.addUnit(item.height, 'rpx')}" v-else-if="item.type=='gap'"></view>
|
|
20
|
+
<!-- 其他基本单位 -->
|
|
21
|
+
<view ref="skeleton" :class="[item.classs, roundClass, animateClass]" :style="[getItemStyle(item)]" v-else></view>
|
|
22
|
+
</view>
|
|
23
|
+
</view>
|
|
24
|
+
<view v-else>
|
|
25
|
+
<slot />
|
|
26
|
+
</view>
|
|
27
|
+
</view>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts" setup>
|
|
31
|
+
/**
|
|
32
|
+
* Skeleton 骨架屏
|
|
33
|
+
* @description 用于在页面加载数据期间显示占位图形,提升用户体验。
|
|
34
|
+
* @tutorial http://www.fusions.top/components/skeleton.html
|
|
35
|
+
* @property {Boolean} loading 是否显示骨架(默认 true)
|
|
36
|
+
* @property {Array} skeleton 骨架内容 具体说明参考文档:
|
|
37
|
+
* @property {Boolean} animate 是否开启动画效果(默认 true)
|
|
38
|
+
* @property {Boolean} round 是否圆角骨架风格(默认 false)
|
|
39
|
+
*
|
|
40
|
+
* @example <fu-skeleton :skeleton="skeletonConfig" :loading="true"></fu-skeleton>
|
|
41
|
+
*/
|
|
42
|
+
import { skeletonProps } from './skeleton';
|
|
43
|
+
import { useSkeleton, useSkeletonCustomStyle } from './composables';
|
|
44
|
+
|
|
45
|
+
defineOptions({ name: 'FuSkeleton', options: { virtualHost: true } });
|
|
46
|
+
|
|
47
|
+
const props = defineProps(skeletonProps);
|
|
48
|
+
|
|
49
|
+
const {
|
|
50
|
+
skeleton,
|
|
51
|
+
elements
|
|
52
|
+
} = useSkeleton(props);
|
|
53
|
+
|
|
54
|
+
const {
|
|
55
|
+
animateClass,
|
|
56
|
+
roundClass,
|
|
57
|
+
getItemStyle
|
|
58
|
+
} = useSkeletonCustomStyle(props);
|
|
59
|
+
</script>
|
|
60
|
+
<style lang="scss" scoped>
|
|
61
|
+
@use '../../../style/components.scss';
|
|
62
|
+
$avatar: 100rpx;
|
|
63
|
+
$avatarSm: 50rpx;
|
|
64
|
+
$avatarLg: 200rpx;
|
|
65
|
+
$marginBottom: 30rpx;
|
|
66
|
+
|
|
67
|
+
@mixin background {
|
|
68
|
+
/* #ifdef APP-NVUE */
|
|
69
|
+
background-color: #eeeeee;
|
|
70
|
+
/* #endif */
|
|
71
|
+
/* #ifndef APP-NVUE */
|
|
72
|
+
background: linear-gradient(90deg, #eff0f1 25%, #e1e1e1 37%, #eff0f1 50%);
|
|
73
|
+
background-size: 400% 100%;
|
|
74
|
+
/* #endif */
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.fu-skeleton__line {
|
|
78
|
+
height: 32rpx;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.fu-skeleton__line--sm {
|
|
82
|
+
height: 24rpx;
|
|
83
|
+
margin-bottom: $marginBottom;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.fu-skeleton__line--lg {
|
|
87
|
+
height: 48rpx;
|
|
88
|
+
margin-bottom: $marginBottom;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.fu-skeleton--static {
|
|
92
|
+
@include background;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.fu-skeleton--radius {
|
|
96
|
+
border-radius: 8rpx;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.fu-skeleton--round {
|
|
100
|
+
border-radius: 30rpx;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.fu-skeleton__avatar {
|
|
104
|
+
width: $avatar;
|
|
105
|
+
height: $avatar;
|
|
106
|
+
border-radius: 50rpx;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.fu-skeleton__avatar--sm {
|
|
110
|
+
width: $avatarSm;
|
|
111
|
+
height: $avatarSm;
|
|
112
|
+
border-radius: 25rpx;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.fu-skeleton__avatar--lg {
|
|
116
|
+
width: $avatarLg;
|
|
117
|
+
height: $avatarLg;
|
|
118
|
+
border-radius: 100rpx;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.fu-skeleton__group {
|
|
122
|
+
@include components.flex;
|
|
123
|
+
|
|
124
|
+
&__sub {
|
|
125
|
+
flex: 1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.fu-skeleton--animation {
|
|
130
|
+
@include background;
|
|
131
|
+
/* #ifndef APP-NVUE */
|
|
132
|
+
animation: skeleton 2s ease infinite
|
|
133
|
+
/* #endif */
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* #ifndef APP-NVUE */
|
|
137
|
+
@keyframes skeleton {
|
|
138
|
+
0% {
|
|
139
|
+
background-position: 100% 50%
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
100% {
|
|
143
|
+
background-position: 0 50%
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/* #endif */
|
|
147
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-status-bar'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const useStatusBar = () => {
|
|
4
|
+
const statusBarHeight = computed(() => {
|
|
5
|
+
const height = getStatusBarHeight();
|
|
6
|
+
return uni.$fu.addUnit(height, 'px')
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const getStatusBarHeight = (): number => {
|
|
10
|
+
let statusBarHeight: number;
|
|
11
|
+
|
|
12
|
+
// #ifdef MP-WEIXIN
|
|
13
|
+
try {
|
|
14
|
+
statusBarHeight = uni.getWindowInfo().statusBarHeight;
|
|
15
|
+
} catch (e) {
|
|
16
|
+
statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
|
17
|
+
}
|
|
18
|
+
// #endif
|
|
19
|
+
// #ifndef MP-WEIXIN
|
|
20
|
+
statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
|
21
|
+
// #endif
|
|
22
|
+
|
|
23
|
+
return statusBarHeight
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
statusBarHeight
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="fu-status-bar" :style="{height: statusBarHeight}">
|
|
3
|
+
<slot />
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { useStatusBar } from './composables';
|
|
9
|
+
|
|
10
|
+
defineOptions({ name: 'FuStatusBar', options: { virtualHost: true } });
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
statusBarHeight
|
|
14
|
+
} = useStatusBar()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style lang="scss" >
|
|
18
|
+
.fu-status-bar {
|
|
19
|
+
height: 20px;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/steps'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-steps'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ref, provide } from 'vue';
|
|
2
|
+
import type { StepsProps } from '../steps';
|
|
3
|
+
|
|
4
|
+
export const useSteps = (props: StepsProps) => {
|
|
5
|
+
const children = ref([]);
|
|
6
|
+
|
|
7
|
+
// 更新子组件的数据
|
|
8
|
+
const updateChildData = () => {
|
|
9
|
+
children.value.map(item => {
|
|
10
|
+
if (item && typeof item.exposed.init === 'function') {
|
|
11
|
+
item.exposed.init();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// 提供父组件上下文
|
|
17
|
+
provide('stepsContext', {
|
|
18
|
+
...props,
|
|
19
|
+
children,
|
|
20
|
+
updateChildData
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
children,
|
|
25
|
+
updateChildData
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { componentProps } from '../../../constants';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 步骤条 direction 有效值
|
|
6
|
+
*/
|
|
7
|
+
export const stepsDirections = ['row', 'column'] as const;
|
|
8
|
+
|
|
9
|
+
export const stepsProps = {
|
|
10
|
+
/**
|
|
11
|
+
* @description 排列方向
|
|
12
|
+
* @values 'row' - 横向, 'column' - 竖向
|
|
13
|
+
* @default 'row'
|
|
14
|
+
*/
|
|
15
|
+
direction: {
|
|
16
|
+
type: String,
|
|
17
|
+
values: stepsDirections,
|
|
18
|
+
default: 'row'
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* @description 设置第几个步骤
|
|
22
|
+
*/
|
|
23
|
+
current: {
|
|
24
|
+
type: [String, Number],
|
|
25
|
+
default: 0
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* @description 激活状态颜色
|
|
29
|
+
*/
|
|
30
|
+
activeColor: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: '#2979ff'
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* @description 未激活状态颜色
|
|
36
|
+
*/
|
|
37
|
+
inactiveColor: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: '#969799'
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* @description 激活状态的图标
|
|
43
|
+
*/
|
|
44
|
+
activeIcon: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ''
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* @description 未激活状态图标
|
|
50
|
+
*/
|
|
51
|
+
inactiveIcon: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: ''
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* @description 是否显示点类型
|
|
57
|
+
*/
|
|
58
|
+
dot: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
...componentProps
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type StepsProps = ExtractPropTypes<typeof stepsProps>;
|