fusions-ui 1.2.7 → 1.2.9
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 +12 -5
- 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,62 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { componentProps, ZIndex } from '../../../constants';
|
|
3
|
+
|
|
4
|
+
export const stickyProps = {
|
|
5
|
+
/**
|
|
6
|
+
* @description 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px
|
|
7
|
+
*/
|
|
8
|
+
offsetTop: {
|
|
9
|
+
type: [String, Number],
|
|
10
|
+
default: 0
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* @description 自定义导航栏的高度
|
|
14
|
+
*/
|
|
15
|
+
customNavHeight: {
|
|
16
|
+
type: [String, Number],
|
|
17
|
+
default: () => {
|
|
18
|
+
let value: number;
|
|
19
|
+
// #ifdef H5
|
|
20
|
+
// H5端的导航栏属于“自定义”导航栏的范畴,因为它是非原生的,与普通元素一致
|
|
21
|
+
value = 44;
|
|
22
|
+
// #endif
|
|
23
|
+
// #ifndef H5
|
|
24
|
+
value = 0;
|
|
25
|
+
// #endif
|
|
26
|
+
return value
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* @description 是否禁用吸顶功能
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
disabled: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* @description 吸顶区域的背景颜色
|
|
39
|
+
*/
|
|
40
|
+
bgColor: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: ''
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* @description z-index值
|
|
46
|
+
* @default 99
|
|
47
|
+
*/
|
|
48
|
+
zIndex: {
|
|
49
|
+
type: [String, Number],
|
|
50
|
+
default: ZIndex.sticky
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* @description 列表中的索引值
|
|
54
|
+
*/
|
|
55
|
+
index: {
|
|
56
|
+
type: [String, Number],
|
|
57
|
+
default: 0
|
|
58
|
+
},
|
|
59
|
+
...componentProps
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type StickyProps = ExtractPropTypes<typeof stickyProps>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :id="elId" class="fu-sticky" :class="[customClass]" :style="[stickyStyle]">
|
|
3
|
+
<view :style="[stickyContent]">
|
|
4
|
+
<slot />
|
|
5
|
+
</view>
|
|
6
|
+
</view>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
/**
|
|
11
|
+
* Sticky 吸顶
|
|
12
|
+
* @description 此组件与CSS中position: sticky属性实现的效果一致,当组件达到预设的到顶部距离时, 就会固定在指定位置,组件位置大于预设的顶部距离时,会重新按照正常的布局排列。
|
|
13
|
+
* @tutorial http://www.fusions.top/components/sticky.html
|
|
14
|
+
* @property {String | Number} offsetTop 吸顶时与顶部的距离,单位px(默认 0 )
|
|
15
|
+
* @property {String | Number} customNavHeight 自定义导航栏的高度 (h5 默认44 其他默认 0 )
|
|
16
|
+
* @property {Boolean} disabled = [true|false] 是否禁用吸顶功能 (默认 false )
|
|
17
|
+
* @property {String} bgColor 背景颜色
|
|
18
|
+
* @property {String | Number} zIndex 吸顶时的z-index值(默认 99)
|
|
19
|
+
* @property {String | Number} index 自定义标识,用于区分是哪一个组件(默认 0)
|
|
20
|
+
* @property {String} customClass 自定义外部样式类
|
|
21
|
+
* @property {String | Object} customStyle 自定义外部的样式
|
|
22
|
+
*
|
|
23
|
+
* @example <fu-sticky offsetTop="200"><view>此处吸顶</view></fu-sticky>
|
|
24
|
+
*/
|
|
25
|
+
import { stickyProps } from './sticky';
|
|
26
|
+
import { useSticky, useStickyCustomStyle } from './composables';
|
|
27
|
+
|
|
28
|
+
defineOptions({ name: 'FuSticky', options: { virtualHost: true } });
|
|
29
|
+
|
|
30
|
+
const props = defineProps(stickyProps);
|
|
31
|
+
|
|
32
|
+
const {
|
|
33
|
+
elId,
|
|
34
|
+
cssSticky,
|
|
35
|
+
stickyTop,
|
|
36
|
+
left,
|
|
37
|
+
width,
|
|
38
|
+
height,
|
|
39
|
+
fixed,
|
|
40
|
+
} = useSticky(props);
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
stickyStyle,
|
|
44
|
+
stickyContent
|
|
45
|
+
} = useStickyCustomStyle(
|
|
46
|
+
props,
|
|
47
|
+
cssSticky,
|
|
48
|
+
stickyTop,
|
|
49
|
+
fixed,
|
|
50
|
+
left,
|
|
51
|
+
width,
|
|
52
|
+
height
|
|
53
|
+
);
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped>
|
|
57
|
+
.fu-sticky {
|
|
58
|
+
/* #ifdef APP-VUE || MP-WEIXIN */
|
|
59
|
+
// 此处默认写sticky属性,是为了给微信和APP通过uni.createSelectorQuery查询是否支持css sticky使用
|
|
60
|
+
position: sticky;
|
|
61
|
+
/* #endif */
|
|
62
|
+
// 此处为解决个别机型会出现缝隙
|
|
63
|
+
// box-shadow: 0 -1px #ffffff;
|
|
64
|
+
}
|
|
65
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/subsection'
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Ref, computed, ref } from 'vue';
|
|
2
|
+
import type { SubsectionProps } from '../subsection';
|
|
3
|
+
|
|
4
|
+
export const useSubsectionCustomStyle = (props: SubsectionProps, itemRect: Ref<any>) => {
|
|
5
|
+
const firstTime = ref<boolean>(true);
|
|
6
|
+
|
|
7
|
+
const wrapperStyle = computed(() => {
|
|
8
|
+
const style: Record<string, any> = {};
|
|
9
|
+
// button模式时,设置背景色
|
|
10
|
+
if (props.mode === "button") {
|
|
11
|
+
style.backgroundColor = props.bgColor;
|
|
12
|
+
}
|
|
13
|
+
return style;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// 滑块的样式
|
|
17
|
+
const barStyle = computed(() => {
|
|
18
|
+
const style: Record<string, any> = {
|
|
19
|
+
width: `${itemRect.value.width}px`,
|
|
20
|
+
height: `${itemRect.value.height}px`
|
|
21
|
+
};
|
|
22
|
+
// 通过translateX移动滑块,其移动的距离为索引*item的宽度
|
|
23
|
+
// #ifndef APP-NVUE
|
|
24
|
+
style.transform = `translateX(${ (props.current as number) * itemRect.value.width }px)`;
|
|
25
|
+
style.transitionDuration = `${firstTime.value? 0 : parseInt(props.duration as string)}ms`;
|
|
26
|
+
// 如果是第一次执行此方法,让滑块在初始化时,瞬间滑动到默认的current第一个subsection item的中间
|
|
27
|
+
// 这里需要一个定时器,因为在非nvue下,是直接通过style绑定过渡时间,需要等其过渡完成后,再设置为false(非第一次移动滑块)
|
|
28
|
+
if (firstTime.value) {
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
firstTime.value = false;
|
|
31
|
+
}, 50);
|
|
32
|
+
}
|
|
33
|
+
// #endif
|
|
34
|
+
if (props.mode === "subsection") {
|
|
35
|
+
// 在subsection模式下,需要动态设置滑块的圆角,因为移动滑块使用的是translateX,无法通过父元素设置overflow: hidden隐藏滑块的直角
|
|
36
|
+
style.backgroundColor = props.activeColor;
|
|
37
|
+
}
|
|
38
|
+
return uni.$fu.deepMerge(style, uni.$fu.addStyle(props.customItemStyle));
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// 分段器item的样式
|
|
42
|
+
const itemStyle = computed(() => {
|
|
43
|
+
if (props.mode !== "subsection") return {};
|
|
44
|
+
return {
|
|
45
|
+
borderColor: props.activeColor,
|
|
46
|
+
borderWidth: "1px",
|
|
47
|
+
borderStyle: "solid"
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// 分段器文字颜色
|
|
52
|
+
const textStyle = computed(() => {
|
|
53
|
+
return (index: number) => {
|
|
54
|
+
const isActive = props.current === index;
|
|
55
|
+
const { mode, inactiveColor, activeColor, size, bold } = props;
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
fontWeight: bold && isActive ? "bold" : "normal",
|
|
59
|
+
fontSize: uni.$fu.addUnit(size), // 单位转换结果缓存
|
|
60
|
+
color: mode === "subsection"? (isActive ? "#fff" : inactiveColor): (isActive ? activeColor : inactiveColor)
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
wrapperStyle,
|
|
67
|
+
barStyle,
|
|
68
|
+
itemStyle,
|
|
69
|
+
textStyle
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { getCurrentInstance, ref, onMounted, type SetupContext, watch } from 'vue';
|
|
2
|
+
import type { SubsectionProps, SubsectionEmits } from '../subsection';
|
|
3
|
+
import { useCommon } from '../../../../hooks';
|
|
4
|
+
// #ifdef APP-NVUE
|
|
5
|
+
// @ts-nocheck
|
|
6
|
+
const dom = uni.requireNativePlugin("dom");
|
|
7
|
+
const animation = uni.requireNativePlugin("animation");
|
|
8
|
+
// #endif
|
|
9
|
+
|
|
10
|
+
export const useSubsection = (props: SubsectionProps, $emit: SetupContext<SubsectionEmits>['emit']) => {
|
|
11
|
+
const instance = getCurrentInstance();
|
|
12
|
+
const { getRect } = useCommon();
|
|
13
|
+
const subsectionRef = ref();
|
|
14
|
+
// 组件尺寸
|
|
15
|
+
const itemRect = ref({
|
|
16
|
+
width: 0,
|
|
17
|
+
height: 0,
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
// 初始化
|
|
21
|
+
const init = () => {
|
|
22
|
+
uni.$fu.sleep().then(() => initGetRect());
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// 判断展示文本
|
|
26
|
+
const getText = (item: any) => {
|
|
27
|
+
return typeof item === 'object' ? item[props.keyName] : item
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// 获取组件的尺寸
|
|
31
|
+
const initGetRect = () => {
|
|
32
|
+
// #ifndef APP-NVUE
|
|
33
|
+
getRect(".fu-subsection__item--0").then((size: any) => {
|
|
34
|
+
itemRect.value = size;
|
|
35
|
+
});
|
|
36
|
+
// #endif
|
|
37
|
+
|
|
38
|
+
// #ifdef APP-NVUE
|
|
39
|
+
const ref = instance?.refs["fu-subsection__item--0"]?.[0];
|
|
40
|
+
ref && dom.getComponentRect(ref, (res: any) => {
|
|
41
|
+
itemRect.value = res.size;
|
|
42
|
+
});
|
|
43
|
+
// #endif
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const handleClick = (index: number) => {
|
|
47
|
+
$emit("change", index);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// 生命周期
|
|
51
|
+
onMounted(() => {
|
|
52
|
+
init()
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// watch监听事件
|
|
56
|
+
watch(() => props.list, () => {
|
|
57
|
+
init()
|
|
58
|
+
}, { deep: true });
|
|
59
|
+
|
|
60
|
+
watch(() => props.current, async (newVal) => {
|
|
61
|
+
// #ifdef APP-NVUE
|
|
62
|
+
// 在安卓nvue上,如果通过translateX进行位移,到最后一个时,会导致右侧无法绘制圆角
|
|
63
|
+
// 故用animation模块进行位移
|
|
64
|
+
const subsectionElement = subsectionRef.value;
|
|
65
|
+
// 不存在ref的时候(理解为第一次初始化时,需要渲染dom,进行一定延时再获取ref),这里的100ms是经过测试得出的结果(某些安卓需要延时久一点),勿随意修改
|
|
66
|
+
await uni.$fu.sleep(subsectionElement? 0: 150)
|
|
67
|
+
if(subsectionElement) {
|
|
68
|
+
animation.transition(subsectionRef.value, {
|
|
69
|
+
styles: {
|
|
70
|
+
transform: `translateX(${ Number(newVal) * itemRect.value.width }px)`,
|
|
71
|
+
transformOrigin: "center center"
|
|
72
|
+
},
|
|
73
|
+
duration: 300,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
// #endif
|
|
77
|
+
}, { immediate: true });
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
subsectionRef,
|
|
81
|
+
itemRect,
|
|
82
|
+
getText,
|
|
83
|
+
handleClick
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { componentProps } from '../../../constants';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 分段器 mode 有效值
|
|
6
|
+
*/
|
|
7
|
+
export const subsectionModes = [] as const;
|
|
8
|
+
|
|
9
|
+
export const subsectionProps = {
|
|
10
|
+
/**
|
|
11
|
+
* @description 滑块的移动过渡时间,单位ms
|
|
12
|
+
* @default 300
|
|
13
|
+
*/
|
|
14
|
+
duration: {
|
|
15
|
+
type: [String, Number],
|
|
16
|
+
default: 300
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* @description subsection的数据
|
|
20
|
+
*/
|
|
21
|
+
list: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: () => []
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* @description 当前活动的subsection的index
|
|
27
|
+
*/
|
|
28
|
+
current: {
|
|
29
|
+
type: [String, Number],
|
|
30
|
+
default: 0
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* @description 激活的颜色
|
|
34
|
+
*/
|
|
35
|
+
activeColor: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: '#2979ff'
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* @description 未激活的颜色
|
|
41
|
+
*/
|
|
42
|
+
inactiveColor: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: '#303133'
|
|
45
|
+
},
|
|
46
|
+
// 模式选择(默认 'button')
|
|
47
|
+
/**
|
|
48
|
+
* @description 模式选择
|
|
49
|
+
* @values 'button' - 按钮模式, 'subsection' - 分段器模式
|
|
50
|
+
* @default 'button'
|
|
51
|
+
*/
|
|
52
|
+
mode: {
|
|
53
|
+
type: String,
|
|
54
|
+
values: subsectionModes,
|
|
55
|
+
default: 'button'
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* @description 字体大小
|
|
59
|
+
* @default 12
|
|
60
|
+
*/
|
|
61
|
+
size: {
|
|
62
|
+
type: [String, Number],
|
|
63
|
+
default: 12
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* @description 激活subsection的字体是否加粗
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
69
|
+
bold: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: true
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* @description 组件背景颜色(仅mode=button时生效)
|
|
75
|
+
* @default '#efeff0'
|
|
76
|
+
*/
|
|
77
|
+
bgColor: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: '#efeff0'
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* @description 从list元素对象中读取的键名
|
|
83
|
+
* @default 'name'
|
|
84
|
+
*/
|
|
85
|
+
keyName: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: 'name'
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* @description 自定义item外部样式
|
|
91
|
+
*/
|
|
92
|
+
customItemStyle: {
|
|
93
|
+
type: [String, Object],
|
|
94
|
+
default: ''
|
|
95
|
+
},
|
|
96
|
+
...componentProps
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const subsectionEmits = {
|
|
100
|
+
/**
|
|
101
|
+
* @description 分段器选项发生改变时触发
|
|
102
|
+
*/
|
|
103
|
+
change: (_e: any) => true
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export type SubsectionProps = ExtractPropTypes<typeof subsectionProps>;
|
|
107
|
+
export type SubsectionEmits = typeof subsectionEmits;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view ref="fu-subsection" class="fu-subsection" :class="[`fu-subsection--${mode}`]" :style="[$fu.addStyle(customStyle), wrapperStyle]">
|
|
3
|
+
<view
|
|
4
|
+
ref="subsectionRef"
|
|
5
|
+
class="fu-subsection__bar"
|
|
6
|
+
:style="[barStyle]"
|
|
7
|
+
:class="[
|
|
8
|
+
mode === 'button' && 'fu-subsection--button__bar',
|
|
9
|
+
current === 0 && mode === 'subsection' && 'fu-subsection__bar--first',
|
|
10
|
+
current > 0 && current < list.length - 1 && mode === 'subsection' && 'fu-subsection__bar--center',
|
|
11
|
+
current === list.length - 1 && mode === 'subsection' && 'fu-subsection__bar--last'
|
|
12
|
+
]"></view>
|
|
13
|
+
<view
|
|
14
|
+
:ref="`fu-subsection__item--${index}`"
|
|
15
|
+
class="fu-subsection__item"
|
|
16
|
+
:class="[
|
|
17
|
+
`fu-subsection__item--${index}`,
|
|
18
|
+
index < list.length - 1 && 'fu-subsection__item--no-border-right',
|
|
19
|
+
index === 0 && 'fu-subsection__item--first',
|
|
20
|
+
index === list.length - 1 && 'fu-subsection__item--last'
|
|
21
|
+
]" :style="[itemStyle]" v-for="(item, index) in list" :key="index" @tap="handleClick(index)">
|
|
22
|
+
<text class="fu-subsection__item__text" :style="[textStyle(index)]">{{ getText(item) }}</text>
|
|
23
|
+
</view>
|
|
24
|
+
</view>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script lang="ts" setup>
|
|
28
|
+
/**
|
|
29
|
+
* Subsection 分段器
|
|
30
|
+
* @description 此组件分段器一般用于用户从几个选项中选择某一个的场景
|
|
31
|
+
* @tutorial http://www.fusions.top/components/subsection.html
|
|
32
|
+
* @property {String | Number} duration 滑块的移动过渡时间,单位ms (默认 300)
|
|
33
|
+
* @property {Array} list 选项的数组
|
|
34
|
+
* @property {String | Number} current 当前激活的选项索引index(默认 0 )
|
|
35
|
+
* @property {String} activeColor 激活时的颜色(默认 '#2979ff' )
|
|
36
|
+
* @property {String} inactiveColor 未激活时的颜色(默认 '#303133' )
|
|
37
|
+
* @property {String} mode = [button|subsection] 模式选择(默认 'button' )
|
|
38
|
+
* @value button 按钮模式
|
|
39
|
+
* @value subsection 分段器模式
|
|
40
|
+
* @property {String | Number} size 字体大小,单位px(默认 12 )
|
|
41
|
+
* @property {Boolean} bold = [true|false] 激活选项的字体是否加粗(默认 true )
|
|
42
|
+
* @property {String} bgColor 组件背景颜色,mode为button时有效(默认 '#efeff0' )
|
|
43
|
+
* @property {String | Object} customStyle 定义需要用到的外部样式
|
|
44
|
+
* @property {String | Object} customItemStyle 自定义选项样式
|
|
45
|
+
* @property {String} keyName 从`list`元素对象中读取的键名(默认 'name' )
|
|
46
|
+
*
|
|
47
|
+
* @event {Function} change 分段器选项发生改变时触发 回调 index:选项的index索引值,从0开始
|
|
48
|
+
* @example <fu-subsection :list="list" :current="current" @change="sectionChange"></fu-subsection>
|
|
49
|
+
*/
|
|
50
|
+
import { subsectionEmits, subsectionProps } from "./subsection";
|
|
51
|
+
import { useSubsection, useSubsectionCustomStyle } from './composables';
|
|
52
|
+
|
|
53
|
+
defineOptions({ name: 'fuSubsection', options: { virtualHost: true } });
|
|
54
|
+
|
|
55
|
+
const props = defineProps(subsectionProps);
|
|
56
|
+
const $emit = defineEmits(subsectionEmits);
|
|
57
|
+
|
|
58
|
+
const {
|
|
59
|
+
subsectionRef,
|
|
60
|
+
itemRect,
|
|
61
|
+
getText,
|
|
62
|
+
handleClick
|
|
63
|
+
} = useSubsection(props, $emit);
|
|
64
|
+
|
|
65
|
+
const {
|
|
66
|
+
wrapperStyle,
|
|
67
|
+
barStyle,
|
|
68
|
+
itemStyle,
|
|
69
|
+
textStyle
|
|
70
|
+
} = useSubsectionCustomStyle(props, itemRect)
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<style lang="scss" scoped>
|
|
74
|
+
@use '../../../style/components.scss';
|
|
75
|
+
$padding: 3px;
|
|
76
|
+
$border-radius: 3px;
|
|
77
|
+
|
|
78
|
+
.fu-subsection {
|
|
79
|
+
@include components.flex(row);
|
|
80
|
+
position: relative;
|
|
81
|
+
/* #ifndef APP-NVUE */
|
|
82
|
+
width: 100%;
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
/* #endif */
|
|
86
|
+
|
|
87
|
+
&--button {
|
|
88
|
+
height: 32px;
|
|
89
|
+
background-color: rgb(238, 238, 239);
|
|
90
|
+
padding: $padding;
|
|
91
|
+
border-radius: $border-radius;
|
|
92
|
+
align-items: stretch;
|
|
93
|
+
|
|
94
|
+
&__bar {
|
|
95
|
+
background-color: #ffffff;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&--subsection {
|
|
100
|
+
height: 30px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&__bar {
|
|
104
|
+
position: absolute;
|
|
105
|
+
/* #ifndef APP-NVUE */
|
|
106
|
+
transition-property: transform, color;
|
|
107
|
+
transition-duration: 0.3s;
|
|
108
|
+
transition-timing-function: ease-in-out;
|
|
109
|
+
/* #endif */
|
|
110
|
+
|
|
111
|
+
&--first {
|
|
112
|
+
border-top-left-radius: $border-radius;
|
|
113
|
+
border-bottom-left-radius: $border-radius;
|
|
114
|
+
border-top-right-radius: 0px;
|
|
115
|
+
border-bottom-right-radius: 0px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&--center {
|
|
119
|
+
border-top-left-radius: 0px;
|
|
120
|
+
border-bottom-left-radius: 0px;
|
|
121
|
+
border-top-right-radius: 0px;
|
|
122
|
+
border-bottom-right-radius: 0px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&--last {
|
|
126
|
+
border-top-left-radius: 0px;
|
|
127
|
+
border-bottom-left-radius: 0px;
|
|
128
|
+
border-top-right-radius: $border-radius;
|
|
129
|
+
border-bottom-right-radius: $border-radius;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&__item {
|
|
134
|
+
@include components.flex(row);
|
|
135
|
+
justify-content: center;
|
|
136
|
+
align-items: center;
|
|
137
|
+
flex: 1;
|
|
138
|
+
// vue环境下,需要设置相对定位,因为滑块为绝对定位,item需要在滑块的上面
|
|
139
|
+
position: relative;
|
|
140
|
+
|
|
141
|
+
&--no-border-right {
|
|
142
|
+
border-right-width: 0 !important;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&--first {
|
|
146
|
+
border-top-left-radius: $border-radius;
|
|
147
|
+
border-bottom-left-radius: $border-radius;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&--last {
|
|
151
|
+
border-top-right-radius: $border-radius;
|
|
152
|
+
border-bottom-right-radius: $border-radius;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&__text {
|
|
156
|
+
@include components.flex(row);
|
|
157
|
+
font-size: 12px;
|
|
158
|
+
line-height: 12px;
|
|
159
|
+
align-items: center;
|
|
160
|
+
transition-property: color;
|
|
161
|
+
transition-duration: 0.3s;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-swipe-action'
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ref, provide } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const useSwipeAction = () => {
|
|
4
|
+
const children: any[] = [];
|
|
5
|
+
const openItem = ref<any>(null);
|
|
6
|
+
|
|
7
|
+
// 公开给用户使用,重制组件样式
|
|
8
|
+
const resize = () => {
|
|
9
|
+
// wxs 会自己计算组件大小,所以无需执行下面代码
|
|
10
|
+
// #ifndef APP-VUE || H5 || MP-WEIXIN
|
|
11
|
+
children.forEach(item => {
|
|
12
|
+
item.init()
|
|
13
|
+
})
|
|
14
|
+
// #endif
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// 公开给用户使用,关闭全部 已经打开的组件
|
|
18
|
+
const closeAll = () => {
|
|
19
|
+
children.forEach( item => {
|
|
20
|
+
// #ifdef APP-VUE || H5 || MP-WEIXIN
|
|
21
|
+
item.is_show = 'none';
|
|
22
|
+
// #endif
|
|
23
|
+
|
|
24
|
+
// #ifndef APP-VUE || H5 || MP-WEIXIN
|
|
25
|
+
item.close()
|
|
26
|
+
// #endif
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const closeOther = (item: any) => {
|
|
31
|
+
if (openItem.value && openItem.value !== item) {
|
|
32
|
+
// #ifdef APP-VUE || H5 || MP-WEIXIN
|
|
33
|
+
openItem.value.is_show = 'none';
|
|
34
|
+
// #endif
|
|
35
|
+
|
|
36
|
+
// #ifndef APP-VUE || H5 || MP-WEIXIN
|
|
37
|
+
openItem.value.close()
|
|
38
|
+
// #endif
|
|
39
|
+
}
|
|
40
|
+
// 记录上一个打开的 swipe-action-item ,用于 auto-close
|
|
41
|
+
openItem.value = item
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// 提供父组件上下文
|
|
45
|
+
provide('swipeActionContext', {
|
|
46
|
+
children,
|
|
47
|
+
resize,
|
|
48
|
+
closeAll,
|
|
49
|
+
closeOther
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
children,
|
|
54
|
+
resize,
|
|
55
|
+
closeAll,
|
|
56
|
+
closeOther
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="fu-swipe-action">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
/**
|
|
9
|
+
* SwipeAction 滑动菜单
|
|
10
|
+
* @description 此组件一般用于左滑唤出操作菜单的场景,用的最多的是左滑删除操作。
|
|
11
|
+
* @tutorial http://www.fusions.top/components/swipeAction.html
|
|
12
|
+
*/
|
|
13
|
+
import { useSwipeAction } from './composables';
|
|
14
|
+
|
|
15
|
+
defineOptions({ name: 'FuSwipeAction', options: { virtualHost: true } });
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
children,
|
|
19
|
+
resize,
|
|
20
|
+
closeAll,
|
|
21
|
+
closeOther
|
|
22
|
+
} = useSwipeAction();
|
|
23
|
+
|
|
24
|
+
// 暴露方法
|
|
25
|
+
defineExpose({
|
|
26
|
+
children,
|
|
27
|
+
resize,
|
|
28
|
+
closeAll,
|
|
29
|
+
closeOther
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// export default {
|
|
33
|
+
// name:"FuSwipeAction",
|
|
34
|
+
// data() {
|
|
35
|
+
// return {};
|
|
36
|
+
// },
|
|
37
|
+
// created() {
|
|
38
|
+
// this.children = [];
|
|
39
|
+
// },
|
|
40
|
+
// methods: {
|
|
41
|
+
// // 公开给用户使用,重制组件样式
|
|
42
|
+
// resize(){
|
|
43
|
+
// // wxs 会自己计算组件大小,所以无需执行下面代码
|
|
44
|
+
// // #ifndef APP-VUE || H5 || MP-WEIXIN
|
|
45
|
+
// this.children.forEach(item=>{
|
|
46
|
+
// item.init()
|
|
47
|
+
// })
|
|
48
|
+
// // #endif
|
|
49
|
+
// },
|
|
50
|
+
// // 公开给用户使用,关闭全部 已经打开的组件
|
|
51
|
+
// closeAll(){
|
|
52
|
+
// this.children.forEach(item=>{
|
|
53
|
+
// // #ifdef APP-VUE || H5 || MP-WEIXIN
|
|
54
|
+
// item.is_show = 'none';
|
|
55
|
+
// // #endif
|
|
56
|
+
|
|
57
|
+
// // #ifndef APP-VUE || H5 || MP-WEIXIN
|
|
58
|
+
// item.close()
|
|
59
|
+
// // #endif
|
|
60
|
+
// })
|
|
61
|
+
// },
|
|
62
|
+
// closeOther(item) {
|
|
63
|
+
// if (this.openItem && this.openItem !== item) {
|
|
64
|
+
// // #ifdef APP-VUE || H5 || MP-WEIXIN
|
|
65
|
+
// this.openItem.is_show = 'none';
|
|
66
|
+
// // #endif
|
|
67
|
+
|
|
68
|
+
// // #ifndef APP-VUE || H5 || MP-WEIXIN
|
|
69
|
+
// this.openItem.close()
|
|
70
|
+
// // #endif
|
|
71
|
+
// }
|
|
72
|
+
// // 记录上一个打开的 swipe-action-item ,用于 auto-close
|
|
73
|
+
// this.openItem = item
|
|
74
|
+
// }
|
|
75
|
+
// }
|
|
76
|
+
// }
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style>
|
|
80
|
+
|
|
81
|
+
</style>
|