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,251 @@
|
|
|
1
|
+
import { ref, watch, nextTick, type SetupContext } from 'vue';
|
|
2
|
+
import type { TransitionProps, TransitionEmits } from '../transition';
|
|
3
|
+
import { createAnimation, type AnimationCtx } from './createAnimation';
|
|
4
|
+
|
|
5
|
+
export const useTransition = (props: TransitionProps, $emit: SetupContext<TransitionEmits>['emit']) => {
|
|
6
|
+
const ani = ref();
|
|
7
|
+
const timerRef = ref<any>(null);
|
|
8
|
+
const isShow = ref(false);
|
|
9
|
+
const transform = ref('');
|
|
10
|
+
const opacity = ref<any>(1);
|
|
11
|
+
const animationData = ref<any>({});
|
|
12
|
+
const durationTime = ref(300);
|
|
13
|
+
let animation: any = null;
|
|
14
|
+
// animation base config
|
|
15
|
+
let config = {
|
|
16
|
+
duration: props.duration,
|
|
17
|
+
timingFunction: 'ease',
|
|
18
|
+
transformOrigin: '50% 50%',
|
|
19
|
+
delay: 0
|
|
20
|
+
};
|
|
21
|
+
// 构建动画上下文
|
|
22
|
+
const buildCtx = (): AnimationCtx => ({
|
|
23
|
+
targetRef: ani,
|
|
24
|
+
animationDataRef: animationData,
|
|
25
|
+
durationTimeRef: durationTime,
|
|
26
|
+
timerRef,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* ref 触发 初始化动画
|
|
31
|
+
*/
|
|
32
|
+
const init = (obj: Record<string, any> = {}) => {
|
|
33
|
+
if (obj.duration) {
|
|
34
|
+
durationTime.value = obj.duration;
|
|
35
|
+
}
|
|
36
|
+
animation = createAnimation(Object.assign({}, config, obj), buildCtx())
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* ref 触发 动画分组
|
|
41
|
+
* @param {Object} obj
|
|
42
|
+
*/
|
|
43
|
+
const step = (obj: Record<string, any>, config: Record<string, any> = {}) => {
|
|
44
|
+
if (!animation) return
|
|
45
|
+
for (let i in obj) {
|
|
46
|
+
try {
|
|
47
|
+
const v = obj[i];
|
|
48
|
+
if (typeof v === 'object') {
|
|
49
|
+
(animation as any)[i](...(Array.isArray(v)? v: [v]))
|
|
50
|
+
} else {
|
|
51
|
+
(animation as any)[i](v)
|
|
52
|
+
}
|
|
53
|
+
} catch (e) {
|
|
54
|
+
console.error(`方法 ${i} 不存在`)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
animation.step(config)
|
|
59
|
+
|
|
60
|
+
return { step, run }
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* ref 触发 执行动画
|
|
65
|
+
*/
|
|
66
|
+
const run = (fn?: () => void) => {
|
|
67
|
+
if (!animation) return
|
|
68
|
+
animation.run(fn)
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 开始过度动画
|
|
73
|
+
*/
|
|
74
|
+
const open = () => {
|
|
75
|
+
clearTimeout(timerRef.value)
|
|
76
|
+
transform.value = '';
|
|
77
|
+
isShow.value = true;
|
|
78
|
+
let { opacity: op, transform: tr } = styleInit(false);
|
|
79
|
+
if (typeof opacity !== 'undefined') opacity.value = op as any;
|
|
80
|
+
transform.value = tr;
|
|
81
|
+
// 确保动态样式已经生效后,执行动画,如果不加 nextTick ,会导致 wx 动画执行异常
|
|
82
|
+
nextTick(() => {
|
|
83
|
+
// 定时器保证动画完全执行,目前有些问题,后面会取消定时器
|
|
84
|
+
timerRef.value = setTimeout(() => {
|
|
85
|
+
animation = createAnimation(config, buildCtx())
|
|
86
|
+
tranfromInit(false).step()
|
|
87
|
+
animation.run(() => {
|
|
88
|
+
// #ifdef APP-NVUE
|
|
89
|
+
transform.value = styleInit(false).transform || ''
|
|
90
|
+
opacity.value = styleInit(false).opacity || 1
|
|
91
|
+
// #endif
|
|
92
|
+
// #ifndef APP-NVUE
|
|
93
|
+
transform.value = ''
|
|
94
|
+
opacity.value = styleInit(false).opacity || 1
|
|
95
|
+
// #endif
|
|
96
|
+
$emit('change', {
|
|
97
|
+
detail: isShow.value
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
}, 20)
|
|
101
|
+
})
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 关闭过度动画
|
|
106
|
+
*/
|
|
107
|
+
const close = (type?: any) => {
|
|
108
|
+
if (!animation) return
|
|
109
|
+
tranfromInit(true).step().run(() => {
|
|
110
|
+
isShow.value = false;
|
|
111
|
+
animationData.value = null;
|
|
112
|
+
animation = null;
|
|
113
|
+
let { opacity: op, transform: tr } = styleInit(false);
|
|
114
|
+
opacity.value = op || 1;
|
|
115
|
+
transform.value = tr;
|
|
116
|
+
$emit('change', {
|
|
117
|
+
detail: isShow.value
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 处理动画开始前的默认样式
|
|
124
|
+
*/
|
|
125
|
+
const styleInit = (type: boolean) => {
|
|
126
|
+
let style: Record<string, any> = {
|
|
127
|
+
transform: ''
|
|
128
|
+
};
|
|
129
|
+
let buildStyle = (type: boolean, mode: string) => {
|
|
130
|
+
if (mode === 'fade') {
|
|
131
|
+
style.opacity = animationType(type)[mode];
|
|
132
|
+
} else {
|
|
133
|
+
style.transform += animationType(type)[mode] + ' ';
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (typeof props.mode === 'string') {
|
|
137
|
+
buildStyle(type, props.mode as string)
|
|
138
|
+
} else {
|
|
139
|
+
(props.mode as string[]).forEach(mode => {
|
|
140
|
+
buildStyle(type, mode)
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
return style
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* 处理内置组合动画
|
|
148
|
+
*/
|
|
149
|
+
const tranfromInit = (type: boolean) => {
|
|
150
|
+
let buildTranfrom = (type: boolean, mode: string) => {
|
|
151
|
+
let aniNum = null;
|
|
152
|
+
if (mode === 'fade') {
|
|
153
|
+
aniNum = type ? 0 : 1;
|
|
154
|
+
} else {
|
|
155
|
+
aniNum = type ? '-100%' : '0';
|
|
156
|
+
if (mode === 'zoom-in') {
|
|
157
|
+
aniNum = type ? 0.8 : 1;
|
|
158
|
+
}
|
|
159
|
+
if (mode === 'zoom-out') {
|
|
160
|
+
aniNum = type ? 1.2 : 1;
|
|
161
|
+
}
|
|
162
|
+
if (mode === 'slide-right') {
|
|
163
|
+
aniNum = type ? '100%' : '0';
|
|
164
|
+
}
|
|
165
|
+
if (mode === 'slide-bottom') {
|
|
166
|
+
aniNum = type ? '100%' : '0';
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
(animation as any)[animationMode()[mode]](aniNum)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (typeof props.mode === 'string') {
|
|
173
|
+
buildTranfrom(type, props.mode as string)
|
|
174
|
+
} else {
|
|
175
|
+
(props.mode as string[]).forEach(mode => {
|
|
176
|
+
buildTranfrom(type, mode)
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return animation
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* 处理动画类型
|
|
185
|
+
*/
|
|
186
|
+
const animationType = (type: boolean) => {
|
|
187
|
+
return {
|
|
188
|
+
fade: type ? 1 : 0,
|
|
189
|
+
'slide-top': `translateY(${type ? '0' : '-100%'})`,
|
|
190
|
+
'slide-right': `translateX(${type ? '0' : '100%'})`,
|
|
191
|
+
'slide-bottom': `translateY(${type ? '0' : '100%'})`,
|
|
192
|
+
'slide-left': `translateX(${type ? '0' : '-100%'})`,
|
|
193
|
+
'zoom-in': `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
|
|
194
|
+
'zoom-out': `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
|
|
195
|
+
} as Record<string, any>
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* 内置动画类型与实际动画对应字典
|
|
200
|
+
*/
|
|
201
|
+
const animationMode = () => {
|
|
202
|
+
return {
|
|
203
|
+
fade: 'opacity',
|
|
204
|
+
'slide-top': 'translateY',
|
|
205
|
+
'slide-right': 'translateX',
|
|
206
|
+
'slide-bottom': 'translateY',
|
|
207
|
+
'slide-left': 'translateX',
|
|
208
|
+
'zoom-in': 'scale',
|
|
209
|
+
'zoom-out': 'scale'
|
|
210
|
+
} as Record<string, any>
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 驼峰转中横线
|
|
215
|
+
*/
|
|
216
|
+
const toLine = (name: string) => {
|
|
217
|
+
return name.replace(/([A-Z])/g, '-$1').toLowerCase()
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const handleClick = (isShow: boolean) => {
|
|
221
|
+
$emit('click', {
|
|
222
|
+
detail: isShow
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// watch监听事件
|
|
227
|
+
watch(() => props.show, (newVal) => {
|
|
228
|
+
if (newVal) {
|
|
229
|
+
open()
|
|
230
|
+
} else {
|
|
231
|
+
// 避免上来就执行 close,导致动画错乱
|
|
232
|
+
if (isShow.value) {
|
|
233
|
+
close()
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}, { immediate: true });
|
|
237
|
+
|
|
238
|
+
return {
|
|
239
|
+
ani,
|
|
240
|
+
isShow,
|
|
241
|
+
transform,
|
|
242
|
+
opacity,
|
|
243
|
+
animationData,
|
|
244
|
+
init,
|
|
245
|
+
step,
|
|
246
|
+
run,
|
|
247
|
+
open,
|
|
248
|
+
close,
|
|
249
|
+
handleClick
|
|
250
|
+
}
|
|
251
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { componentProps } from '../../../constants';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 动画mode有效值
|
|
6
|
+
*/
|
|
7
|
+
export const transitionModes = [
|
|
8
|
+
'fade',
|
|
9
|
+
'slide-top',
|
|
10
|
+
'slide-right',
|
|
11
|
+
'slide-bottom',
|
|
12
|
+
'slide-left',
|
|
13
|
+
'zoom-in',
|
|
14
|
+
'zoom-out'
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
export const transitionProps = {
|
|
18
|
+
/**
|
|
19
|
+
* @description 是否展示组件
|
|
20
|
+
* @default false
|
|
21
|
+
* @example <transition :show="true"></transition>
|
|
22
|
+
*/
|
|
23
|
+
show: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* @description 使用的动画模式
|
|
29
|
+
* @values 'fade' - 渐隐渐出过渡, 'slide-top' - 由上至下过渡, 'slide-right' - 由右至左过渡, 'slide-bottom' - 由下至上过渡, 'slide-left' - 由左至右过渡, 'zoom-in' - 由小到大过渡, 'zoom-out' - 由大到小过渡
|
|
30
|
+
* @default 'fade'
|
|
31
|
+
* @example <transition mode="slide-top"></transition>
|
|
32
|
+
*/
|
|
33
|
+
mode: {
|
|
34
|
+
type: [Array, String],
|
|
35
|
+
values: transitionModes,
|
|
36
|
+
default() {
|
|
37
|
+
return 'fade'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* @description 动画的执行时间,单位ms
|
|
42
|
+
* @default 300
|
|
43
|
+
* @example <transition :duration="1000"></transition>
|
|
44
|
+
*/
|
|
45
|
+
duration: {
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 300
|
|
48
|
+
},
|
|
49
|
+
...componentProps
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const transitionEmits = {
|
|
53
|
+
/**
|
|
54
|
+
* @description 动画点击事件
|
|
55
|
+
*/
|
|
56
|
+
click: (_e: any) => true,
|
|
57
|
+
/**
|
|
58
|
+
* @description 组件改变时触发
|
|
59
|
+
*/
|
|
60
|
+
change: (_e: any) => true
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type TransitionProps = ExtractPropTypes<typeof transitionProps>
|
|
64
|
+
export type TransitionEmits = typeof transitionEmits;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- #ifndef APP-NVUE -->
|
|
3
|
+
<view v-if="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyle" @click="handleClick(isShow)">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</view>
|
|
6
|
+
<!-- #endif -->
|
|
7
|
+
<!-- #ifdef APP-NVUE -->
|
|
8
|
+
<view v-if="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyle" @click="handleClick(isShow)">
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</view>
|
|
11
|
+
<!-- #endif -->
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
/**
|
|
16
|
+
* Transition 过渡动画
|
|
17
|
+
* @description 此组件为过渡动画
|
|
18
|
+
* @tutorial http://www.fusions.top/components/transition.html
|
|
19
|
+
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
|
|
20
|
+
* @property {Array|String} mode = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
|
|
21
|
+
* @value fade 渐隐渐出过渡
|
|
22
|
+
* @value slide-top 由上至下过渡
|
|
23
|
+
* @value slide-right 由右至左过渡
|
|
24
|
+
* @value slide-bottom 由下至上过渡
|
|
25
|
+
* @value slide-left 由左至右过渡
|
|
26
|
+
* @value zoom-in 由小到大过渡
|
|
27
|
+
* @value zoom-out 由大到小过渡
|
|
28
|
+
* @property {Number} duration 过渡动画持续时间
|
|
29
|
+
* @property {String} customClass 定义需要用到的外部类
|
|
30
|
+
* @property {String|Object} customStyle 定义需要用到的外部样式
|
|
31
|
+
*/
|
|
32
|
+
import { transitionEmits, transitionProps } from './transition';
|
|
33
|
+
import { useTransition, useTransitionCustomStyle } from './composables';
|
|
34
|
+
|
|
35
|
+
defineOptions({ name: 'FuTransition', options: { virtualHost: true } })
|
|
36
|
+
|
|
37
|
+
const props = defineProps(transitionProps);
|
|
38
|
+
const $emit = defineEmits(transitionEmits);
|
|
39
|
+
|
|
40
|
+
const {
|
|
41
|
+
ani,
|
|
42
|
+
isShow,
|
|
43
|
+
transform,
|
|
44
|
+
opacity,
|
|
45
|
+
animationData,
|
|
46
|
+
init,
|
|
47
|
+
step,
|
|
48
|
+
run,
|
|
49
|
+
open,
|
|
50
|
+
close,
|
|
51
|
+
handleClick
|
|
52
|
+
} = useTransition(props, $emit);
|
|
53
|
+
|
|
54
|
+
const {
|
|
55
|
+
transformStyle
|
|
56
|
+
} = useTransitionCustomStyle(props, transform, opacity)
|
|
57
|
+
|
|
58
|
+
// 暴露方法给父组件
|
|
59
|
+
defineExpose({
|
|
60
|
+
init,
|
|
61
|
+
step,
|
|
62
|
+
run,
|
|
63
|
+
open,
|
|
64
|
+
close
|
|
65
|
+
});
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style>
|
|
69
|
+
|
|
70
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/upload'
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import type { UploadFileProps } from '../upload-file';
|
|
3
|
+
|
|
4
|
+
export const useUploadFileCustomStyle = (props: UploadFileProps) => {
|
|
5
|
+
const styles = computed(() => {
|
|
6
|
+
let styles = {
|
|
7
|
+
border: true,
|
|
8
|
+
dividline: true,
|
|
9
|
+
'border-style': {}
|
|
10
|
+
};
|
|
11
|
+
return uni.$fu.deepMerge(styles, uni.$fu.addStyle(props.listStyles))
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const borderStyle = computed(() => {
|
|
15
|
+
let { border } = styles.value;
|
|
16
|
+
let obj: Record<string, any> = {};
|
|
17
|
+
if (!border) {
|
|
18
|
+
obj.border = 'none';
|
|
19
|
+
} else {
|
|
20
|
+
const { width = 1, radius = 5, style = 'solid', color = '#eeeeee' } = border || {};
|
|
21
|
+
const borderWidth = value2px(width);
|
|
22
|
+
const borderRadius = value2px(radius);
|
|
23
|
+
obj = {
|
|
24
|
+
'border-width': borderWidth,
|
|
25
|
+
'border-style': style,
|
|
26
|
+
'border-color': color,
|
|
27
|
+
'border-radius': borderRadius
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return uni.$fu.addStyle(obj, 'string')
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const borderLineStyle = computed(() => {
|
|
35
|
+
let obj: Record<string, any> = {};
|
|
36
|
+
let { borderStyle } = styles.value;
|
|
37
|
+
if (borderStyle && borderStyle.color) {
|
|
38
|
+
obj['border-color'] = borderStyle.color;
|
|
39
|
+
}
|
|
40
|
+
if (borderStyle && borderStyle.width) {
|
|
41
|
+
let width = borderStyle && borderStyle.width || 1;
|
|
42
|
+
let style = borderStyle && borderStyle.style || 0;
|
|
43
|
+
obj['border-width'] = value2px(width);
|
|
44
|
+
obj['border-top-style'] = value2px(style);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return uni.$fu.addStyle(obj, 'string')
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const value2px = (value: string | number): string => {
|
|
51
|
+
let result: string = String(value);
|
|
52
|
+
|
|
53
|
+
if (typeof value === 'number') {
|
|
54
|
+
result = value + 'px';
|
|
55
|
+
}
|
|
56
|
+
if (result.indexOf('%') === -1 && result.indexOf('px') === -1) {
|
|
57
|
+
result = value + 'px';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return result
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
styles,
|
|
65
|
+
borderStyle,
|
|
66
|
+
borderLineStyle
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import type { UploadImageProps } from '../upload-image';
|
|
3
|
+
|
|
4
|
+
export const useUploadImageCustomStyle = (props: UploadImageProps) => {
|
|
5
|
+
const styles = computed(() => {
|
|
6
|
+
let style = {
|
|
7
|
+
width: 'auto',
|
|
8
|
+
height: 'auto',
|
|
9
|
+
border: {}
|
|
10
|
+
};
|
|
11
|
+
return uni.$fu.deepMerge(style, uni.$fu.addStyle(props.imageStyles))
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const boxStyle = computed(() => {
|
|
15
|
+
const { width = 'auto', height = 'auto', background } = styles.value;
|
|
16
|
+
let obj: Record<string, any> = { background };
|
|
17
|
+
|
|
18
|
+
if (height !== 'auto') {
|
|
19
|
+
obj.height = value2px(height);
|
|
20
|
+
obj['padding-top'] = 0;
|
|
21
|
+
} else if (width !== 'auto') {
|
|
22
|
+
obj.height = value2px(width);
|
|
23
|
+
obj['padding-top'] = 0;
|
|
24
|
+
} else {
|
|
25
|
+
obj.height = 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (width !== 'auto') {
|
|
29
|
+
obj.width = value2px(width);
|
|
30
|
+
} else if (height !== 'auto') {
|
|
31
|
+
obj.width = value2px(height);
|
|
32
|
+
} else {
|
|
33
|
+
obj.width = '33.3%';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return uni.$fu.addStyle(obj, 'string')
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const borderStyle = computed(() => {
|
|
40
|
+
let { border } = styles.value;
|
|
41
|
+
let obj: Record<string, any> = {};
|
|
42
|
+
if (typeof border === 'boolean') {
|
|
43
|
+
obj.border = border ? '1px #eeeeee solid' : 'none';
|
|
44
|
+
} else {
|
|
45
|
+
const { width = 1, radius = 3, style = 'solid', color = '#eeeeee' } = border || {};
|
|
46
|
+
const borderWidth = value2px(width);
|
|
47
|
+
const borderRadius = value2px(radius);
|
|
48
|
+
obj = {
|
|
49
|
+
'border-width': borderWidth,
|
|
50
|
+
'border-style': style,
|
|
51
|
+
'border-color': color,
|
|
52
|
+
'border-radius': borderRadius
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return uni.$fu.addStyle(obj, 'string')
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const value2px = (value: string | number): string => {
|
|
60
|
+
let result: string = String(value);
|
|
61
|
+
|
|
62
|
+
if (typeof value === 'number') {
|
|
63
|
+
result = value + 'px';
|
|
64
|
+
}
|
|
65
|
+
if (result.indexOf('%') === -1 && result.indexOf('px') === -1) {
|
|
66
|
+
result = value + 'px';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return result
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
boxStyle,
|
|
74
|
+
borderStyle
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SetupContext } from 'vue';
|
|
2
|
+
import type { UploadFileProps, UploadFileEmits } from '../upload-file';
|
|
3
|
+
|
|
4
|
+
export const useUploadFile = (props: UploadFileProps, $emit: SetupContext<UploadFileEmits>['emit']) => {
|
|
5
|
+
const uploadFiles = (item: any, index: number) => {
|
|
6
|
+
$emit("uploadFiles", {
|
|
7
|
+
item,
|
|
8
|
+
index
|
|
9
|
+
})
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const chooseFile = () => {
|
|
13
|
+
if(!props.disabled) {
|
|
14
|
+
$emit("choose")
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const chooseDelFile = (index: number) => {
|
|
19
|
+
$emit('delFile', index)
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
uploadFiles,
|
|
24
|
+
chooseFile,
|
|
25
|
+
chooseDelFile
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { SetupContext } from 'vue';
|
|
2
|
+
import type { UploadImageProps, UploadImageEmits } from '../upload-image';
|
|
3
|
+
|
|
4
|
+
export const useUploadImage = (props: UploadImageProps, $emit: SetupContext<UploadImageEmits>['emit']) => {
|
|
5
|
+
const uploadFiles = (item: any) => {
|
|
6
|
+
$emit("uploadFiles", item)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const chooseImage = () => {
|
|
10
|
+
$emit("choose")
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const chooseDelFile = (index: number) => {
|
|
14
|
+
$emit('delFile', index)
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const choosePrviewImage = (index: number) => {
|
|
18
|
+
let urls = [];
|
|
19
|
+
if(Number(props.maxCount) === 1 && props.disablePreview && !props.disabled){
|
|
20
|
+
$emit("choose")
|
|
21
|
+
}
|
|
22
|
+
if(props.disablePreview) return
|
|
23
|
+
props.list.forEach(i => {
|
|
24
|
+
urls.push((i as any).url)
|
|
25
|
+
})
|
|
26
|
+
uni.previewImage({
|
|
27
|
+
urls: urls,
|
|
28
|
+
current: index
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
uploadFiles,
|
|
34
|
+
chooseImage,
|
|
35
|
+
chooseDelFile,
|
|
36
|
+
choosePrviewImage
|
|
37
|
+
}
|
|
38
|
+
}
|