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,60 @@
|
|
|
1
|
+
import { getCurrentInstance, inject, onMounted, ref } from 'vue';
|
|
2
|
+
import { useCommon } from '../../../../hooks';
|
|
3
|
+
// #ifdef APP-NVUE
|
|
4
|
+
const dom = uni.requireNativePlugin('dom');
|
|
5
|
+
// #endif
|
|
6
|
+
|
|
7
|
+
export const useVtabsItem = () => {
|
|
8
|
+
const instance = getCurrentInstance();
|
|
9
|
+
const { getRect } = useCommon();
|
|
10
|
+
// 记录item的离顶部的距离
|
|
11
|
+
const top = ref(0);
|
|
12
|
+
// 记录item的高度
|
|
13
|
+
const height = ref(0);
|
|
14
|
+
const vtabs = inject<any>('vtabsContext', null);
|
|
15
|
+
|
|
16
|
+
const init = async () => {
|
|
17
|
+
if (!vtabs) {
|
|
18
|
+
return uni.$fu.error('fu-vtabs必须要搭配fu-vtabs-item组件使用')
|
|
19
|
+
}
|
|
20
|
+
if(!vtabs.chain) return;
|
|
21
|
+
await uni.$fu.sleep();
|
|
22
|
+
getItemRect().then((size: any) => {
|
|
23
|
+
// 由于对象的引用特性,此处会同时生效到父组件的children数组的本实例的top属性中,供父组件判断读取
|
|
24
|
+
top.value = size.top;
|
|
25
|
+
height.value = size.height;
|
|
26
|
+
if(vtabs.children.value) {
|
|
27
|
+
vtabs.children.value.push({
|
|
28
|
+
top: top.value,
|
|
29
|
+
height: height.value
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const getItemRect = () => {
|
|
36
|
+
return new Promise(resolve => {
|
|
37
|
+
// #ifndef APP-NVUE
|
|
38
|
+
// 组件内部一般用getRect,对外的为getRect,二者功能一致
|
|
39
|
+
getRect('.fu-vtabs-item').then(size => {
|
|
40
|
+
resolve(size)
|
|
41
|
+
})
|
|
42
|
+
// #endif
|
|
43
|
+
// #ifdef APP-NVUE
|
|
44
|
+
const ref = instance?.proxy?.$refs?.['fu-vtabs-item']
|
|
45
|
+
dom.getComponentRect(ref, (res: any) => {
|
|
46
|
+
resolve(res.size)
|
|
47
|
+
})
|
|
48
|
+
// #endif
|
|
49
|
+
})
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// 生命周期
|
|
53
|
+
onMounted(() => {
|
|
54
|
+
init()
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view ref="fu-vtabs-item" :id="`content_${index}`" class="fu-vtabs-item">
|
|
3
|
+
<slot />
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { vtabsItemProps } from './vtabs-item';
|
|
9
|
+
import { useVtabsItem } from './composables';
|
|
10
|
+
|
|
11
|
+
defineOptions({ name: 'FuVtabsItem', options: { virtualHost: true } });
|
|
12
|
+
|
|
13
|
+
defineProps(vtabsItemProps);
|
|
14
|
+
|
|
15
|
+
const {} = useVtabsItem()
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
|
|
20
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/waterfall'
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { ref, watch, onMounted, type SetupContext, onBeforeMount, computed, nextTick } from 'vue';
|
|
2
|
+
import type { WaterfallProps, WaterfallEmits } from '../waterfall';
|
|
3
|
+
import { useCommon } from '../../../../hooks';
|
|
4
|
+
|
|
5
|
+
export const useWaterfall = (props: WaterfallProps, $emit: SetupContext<WaterfallEmits>['emit']) => {
|
|
6
|
+
const { getRect } = useCommon();
|
|
7
|
+
const colunmList = ref([]);
|
|
8
|
+
// 临时列表
|
|
9
|
+
const tempList = ref([]);
|
|
10
|
+
|
|
11
|
+
// 破坏value变量引用,否则数据会保持不变
|
|
12
|
+
const copyValue = computed(() => {
|
|
13
|
+
return uni.$fu.deepClone(props.modelValue)
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 计算列
|
|
18
|
+
* @param {Object} size 列数
|
|
19
|
+
*/
|
|
20
|
+
const calculateColumn = (size: number) => {
|
|
21
|
+
colunmList.value = [];
|
|
22
|
+
for (let i = 1; i <= size; i++) {
|
|
23
|
+
let obj: Record<string, any> = {};
|
|
24
|
+
obj.id = props.idPrefix + i;
|
|
25
|
+
obj.keyVal = `list${i}`;
|
|
26
|
+
obj.index = i;
|
|
27
|
+
obj[`list${i}`] = [];
|
|
28
|
+
colunmList.value.push(obj);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// 获取最小值
|
|
33
|
+
const getMin = (arr: any[]) => {
|
|
34
|
+
const zeroHeightItems = arr.filter(item => item.height === 0);
|
|
35
|
+
if(zeroHeightItems.length > 0) {
|
|
36
|
+
return zeroHeightItems.reduce((min, item) => {
|
|
37
|
+
const topIndex = colunmList.value.findIndex(obj => obj.id === item.id);
|
|
38
|
+
const len = colunmList.value[topIndex][`list${arr.indexOf(item) + 1}`].length;
|
|
39
|
+
return len < min.len? { len, item }: min;
|
|
40
|
+
}, { len: Infinity }).item;
|
|
41
|
+
}
|
|
42
|
+
return arr.reduce((min, item) => item.height < min.height? item: min);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// 拆分数据
|
|
46
|
+
const splitData = async () => {
|
|
47
|
+
let rectArr: any[] = [];
|
|
48
|
+
if (!tempList.value.length) return
|
|
49
|
+
for (let i = 1; i <= Number(props.columnCount); i++) {
|
|
50
|
+
const rect = await getRect(`#${props.idPrefix}${i}`);
|
|
51
|
+
const rectObj = rect && typeof rect === 'object'? rect : {};
|
|
52
|
+
rectArr.push({ ...rectObj, name: i });
|
|
53
|
+
}
|
|
54
|
+
const minCol = getMin(rectArr);
|
|
55
|
+
if(!minCol) return
|
|
56
|
+
const topIndex = colunmList.value.findIndex(obj => obj.id === minCol.id);
|
|
57
|
+
const item = tempList.value.shift();
|
|
58
|
+
if(!item) return
|
|
59
|
+
item.width = minCol.width;
|
|
60
|
+
colunmList.value[topIndex][`list${minCol.name}`].push(item);
|
|
61
|
+
$emit('changeList', { name: `list${minCol.name}`, value: item });
|
|
62
|
+
if(tempList.value.length) {
|
|
63
|
+
await uni.$fu.sleep(Math.max(props.addTime, 200));
|
|
64
|
+
splitData()
|
|
65
|
+
} else {
|
|
66
|
+
$emit('finish')
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// 滚动到底部触发事件
|
|
71
|
+
const scrolltolower = () => {
|
|
72
|
+
uni.$fu.sleep(30).then(() => {
|
|
73
|
+
$emit('scrolltolower')
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// 清空数据列表
|
|
78
|
+
const clear = async () => {
|
|
79
|
+
// 清除数据
|
|
80
|
+
for (let i = 0; i < Number(props.columnCount); i++) {
|
|
81
|
+
colunmList.value[i][`list${i+1}`] = [];
|
|
82
|
+
}
|
|
83
|
+
$emit('input', [])
|
|
84
|
+
$emit('update:modelValue', [])
|
|
85
|
+
tempList.value = []
|
|
86
|
+
await uni.$fu.sleep(300);
|
|
87
|
+
$emit('clear');
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// 清除指定的某一条数据,根据id来实现
|
|
91
|
+
const remove = (id: string | number) => {
|
|
92
|
+
let index = -1
|
|
93
|
+
// 删除组件数据
|
|
94
|
+
for (let i = 1; i <= Number(props.columnCount); i++) {
|
|
95
|
+
index = colunmList.value[i - 1][`list${i}`].findIndex((item: any) => item[props.idKey] == id)
|
|
96
|
+
if (index != -1) {
|
|
97
|
+
colunmList.value[i - 1][`list${i}`].splice(index, 1)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// 同时删除父组件对应的数据
|
|
101
|
+
index = props.modelValue.findIndex(item => item[props.idKey] == id)
|
|
102
|
+
if (index != -1) $emit('update:modelValue', props.modelValue.splice(index, 1))
|
|
103
|
+
$emit('remove', id);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// 生命周期
|
|
107
|
+
onMounted(() => {
|
|
108
|
+
// #ifndef APP-NVUE
|
|
109
|
+
nextTick(() => {
|
|
110
|
+
tempList.value = uni.$fu.deepClone(copyValue.value);
|
|
111
|
+
splitData()
|
|
112
|
+
})
|
|
113
|
+
// #endif
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
onBeforeMount(() => {
|
|
117
|
+
calculateColumn(Number(props.columnCount));
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// watch监听事件
|
|
121
|
+
watch(() => copyValue.value, (newVal, oldVal) => {
|
|
122
|
+
// #ifndef APP-NVUE
|
|
123
|
+
if (newVal && newVal.length > 0) {
|
|
124
|
+
// 取出数组发生变化的部分
|
|
125
|
+
let startIndex = Array.isArray(oldVal) && oldVal.length > 0 ? oldVal.length : 0;
|
|
126
|
+
// 拼接原有数据
|
|
127
|
+
tempList.value = tempList.value.concat(uni.$fu.deepClone(newVal.slice(startIndex)));
|
|
128
|
+
splitData()
|
|
129
|
+
}
|
|
130
|
+
// #endif
|
|
131
|
+
}, { deep: true });
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
colunmList,
|
|
135
|
+
scrolltolower,
|
|
136
|
+
clear,
|
|
137
|
+
remove
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import type { WaterfallProps } from '../waterfall';
|
|
3
|
+
|
|
4
|
+
export const useWaterfallCustomStyle = (props: WaterfallProps) => {
|
|
5
|
+
const nvueWaterfallStyle = computed(() => {
|
|
6
|
+
const style: Record<string, any> = {};
|
|
7
|
+
if (props.width != 0) style.width = uni.$fu.addUnit(props.width)
|
|
8
|
+
if (props.height != 0) style.height = uni.$fu.addUnit(props.height)
|
|
9
|
+
// 如果没有定义列表高度,则默认使用屏幕高度
|
|
10
|
+
if (!style.width) style.width = uni.$fu.addUnit(uni.$fu.sys().windowWidth, 'px')
|
|
11
|
+
if (!style.height) style.height = uni.$fu.addUnit(uni.$fu.sys().windowHeight, 'px')
|
|
12
|
+
return uni.$fu.deepMerge(style, uni.$fu.addStyle(props.customStyle))
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
nvueWaterfallStyle
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { componentProps } from '../../../constants';
|
|
3
|
+
|
|
4
|
+
export const waterfallProps = {
|
|
5
|
+
/**
|
|
6
|
+
* @description 瀑布流数据
|
|
7
|
+
*/
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: Array,
|
|
10
|
+
default: () => []
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* @description 数据的id值,根据id值对数据执行删除操作, 如数据为:{id: 1, name: 'fusions-ui'},那么该值设置为id
|
|
14
|
+
* @default 'id'
|
|
15
|
+
*/
|
|
16
|
+
idKey: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'id'
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* @description 前置标识
|
|
22
|
+
* @default 'fu-waterfall-'
|
|
23
|
+
*/
|
|
24
|
+
idPrefix: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'fu-waterfall-'
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* @description 每次插入数据的事件间隔,间隔越长能保证两列高度相近,但是用户体验不好,单位ms
|
|
30
|
+
* @default 200
|
|
31
|
+
*/
|
|
32
|
+
addTime: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 200
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* @description 瀑布流的列数
|
|
38
|
+
* @default 2
|
|
39
|
+
*/
|
|
40
|
+
columnCount: {
|
|
41
|
+
type: [String, Number],
|
|
42
|
+
default: 2
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* @description 列与列的间隙
|
|
46
|
+
* @default 15
|
|
47
|
+
*/
|
|
48
|
+
columnGap: {
|
|
49
|
+
type: [String, Number],
|
|
50
|
+
default: 15
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* @description 是否显示滚动条,仅nvue生效
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
showScrollbar: {
|
|
57
|
+
type: [Boolean],
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* @description 列宽,nvue生效
|
|
62
|
+
* @default 'auto'
|
|
63
|
+
*/
|
|
64
|
+
columnWidth: {
|
|
65
|
+
type: [String, Number],
|
|
66
|
+
default: 'auto'
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* @description 瀑布流的宽度,nvue生效
|
|
70
|
+
*/
|
|
71
|
+
width: {
|
|
72
|
+
type: [String, Number],
|
|
73
|
+
default: ''
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* @description 瀑布流的高度,nvue生效
|
|
77
|
+
*/
|
|
78
|
+
height: {
|
|
79
|
+
type: [String, Number],
|
|
80
|
+
default: ''
|
|
81
|
+
},
|
|
82
|
+
...componentProps
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const waterfallEmits = {
|
|
86
|
+
'update:modelValue': (_e: any) => true,
|
|
87
|
+
/**
|
|
88
|
+
* @description 处理数据时触发(仅vue生效)
|
|
89
|
+
*/
|
|
90
|
+
changeList: (_e: any) => true,
|
|
91
|
+
/**
|
|
92
|
+
* @description 瀑布流加载完成触发事件(vue生效)
|
|
93
|
+
*/
|
|
94
|
+
finish: () => true,
|
|
95
|
+
/**
|
|
96
|
+
* @description 输入事件
|
|
97
|
+
*/
|
|
98
|
+
input: (_e: any) => true,
|
|
99
|
+
/**
|
|
100
|
+
* @description 清空数据列表触发事件(vue生效)
|
|
101
|
+
*/
|
|
102
|
+
clear: () => true,
|
|
103
|
+
/**
|
|
104
|
+
* @description 删除列表中某条数据触发事件(vue生效)
|
|
105
|
+
*/
|
|
106
|
+
remove: (_e: any) => true,
|
|
107
|
+
/**
|
|
108
|
+
* @description 滚动到底部触发事件(nvue生效)
|
|
109
|
+
*/
|
|
110
|
+
scrolltolower: () => true
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type WaterfallProps = ExtractPropTypes<typeof waterfallProps>;
|
|
114
|
+
export type WaterfallEmits = typeof waterfallEmits;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="fu-waterfall"
|
|
3
|
+
<!-- #ifndef APP-NVUE -->
|
|
4
|
+
:style="{margin: columnGap + 'px'}"
|
|
5
|
+
<!-- #endif -->>
|
|
6
|
+
<!-- #ifndef APP-NVUE -->
|
|
7
|
+
<block v-for="(item, index) in colunmList" :key="index">
|
|
8
|
+
<view
|
|
9
|
+
:id="item.id"
|
|
10
|
+
class="fu-waterfall__column"
|
|
11
|
+
:style="{marginRight: columnGap + 'px'}">
|
|
12
|
+
<slot :name="item.keyVal"></slot>
|
|
13
|
+
</view>
|
|
14
|
+
</block>
|
|
15
|
+
<!-- #endif -->
|
|
16
|
+
<!-- #ifdef APP-NVUE -->
|
|
17
|
+
<view class="waterfall-warapper">
|
|
18
|
+
<waterfall
|
|
19
|
+
:style="[nvueWaterfallStyle]"
|
|
20
|
+
:column-count="columnCount"
|
|
21
|
+
:show-scrollbar="false"
|
|
22
|
+
column-width="auto"
|
|
23
|
+
:column-gap="columnGap"
|
|
24
|
+
:left-gap="columnGap"
|
|
25
|
+
:right-gap="columnGap"
|
|
26
|
+
:always-scrollable-vertical="true"
|
|
27
|
+
@loadmore="scrolltolower">
|
|
28
|
+
<slot></slot>
|
|
29
|
+
</waterfall>
|
|
30
|
+
</view>
|
|
31
|
+
<!-- #endif -->
|
|
32
|
+
</view>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script lang="ts" setup>
|
|
36
|
+
/**
|
|
37
|
+
* @description Waterfall 瀑布流
|
|
38
|
+
* @tutorial http://www.fusions.top/components/waterfall.html
|
|
39
|
+
* @property {Array} modelValue 瀑布流数组数据,仅vue生效 (默认 [])
|
|
40
|
+
* @property {String} idKey 数据的id值,根据id值对数据执行删除操作
|
|
41
|
+
* @property {String} idPrefix 前置标识(默认 'fu-waterfall-')
|
|
42
|
+
* @property {Number} addTime 每次插入数据的事件间隔,间隔越长能保证两列高度相近,但是用户体验不好,单位ms(默认 200)
|
|
43
|
+
* @property {String | Number} columnCount 瀑布流的列数(默认2)
|
|
44
|
+
* @property {String | Number} columnGap 列与列的间(默认 15)
|
|
45
|
+
* @property {Boolean} showScrollbar = [true|false] 是否显示滚动条,仅nvue生效(默认 false)
|
|
46
|
+
* @property {String | Number} columnWidth 列宽,单位px,仅nvue生效(默认 'auto')
|
|
47
|
+
* @property {String | Number} width 瀑布流的宽度,仅nvue生效
|
|
48
|
+
* @property {String | Number} height 瀑布流的高度,仅nvue生效
|
|
49
|
+
*
|
|
50
|
+
* @event {Function} changeList 处理数据时触发,为了兼容某些端不支持插槽回传参数的情况(仅vue生效)例:列表数据,columnCount=2时、第一次返回{list1:{...}},第二次返回{list2:{...}}...;返回后需要手动追加对应的列数据
|
|
51
|
+
* @event {Function} finish 瀑布流加载完成触发事件(vue生效)
|
|
52
|
+
* @event {Function} clear 清空数据列表触发事件(vue生效)
|
|
53
|
+
* @event {Function} remove 删除列表中某条数据触发事件(vue生效)
|
|
54
|
+
* @event {Function} scrolltolower 滚动到底部触发事件(nvue生效)
|
|
55
|
+
* @example <fu-waterfall v-model="list"></fu-waterfall>
|
|
56
|
+
*/
|
|
57
|
+
import { waterfallEmits, waterfallProps } from './waterfall';
|
|
58
|
+
import { useWaterfall, useWaterfallCustomStyle } from './composables';
|
|
59
|
+
|
|
60
|
+
defineOptions({ name: 'FuWaterfall', options: { virtualHost: true } });
|
|
61
|
+
|
|
62
|
+
const props = defineProps(waterfallProps);
|
|
63
|
+
const $emit = defineEmits(waterfallEmits);
|
|
64
|
+
|
|
65
|
+
const {
|
|
66
|
+
colunmList,
|
|
67
|
+
scrolltolower,
|
|
68
|
+
clear,
|
|
69
|
+
remove
|
|
70
|
+
} = useWaterfall(props, $emit);
|
|
71
|
+
|
|
72
|
+
const {
|
|
73
|
+
nvueWaterfallStyle
|
|
74
|
+
} = useWaterfallCustomStyle(props);
|
|
75
|
+
|
|
76
|
+
// 暴露方法
|
|
77
|
+
defineExpose({
|
|
78
|
+
clear,
|
|
79
|
+
remove
|
|
80
|
+
});
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<style lang="scss" scoped>
|
|
84
|
+
@use '../../../style/components.scss';
|
|
85
|
+
|
|
86
|
+
/* 瀑布流最外层 */
|
|
87
|
+
.fu-waterfall {
|
|
88
|
+
@include components.flex(row);
|
|
89
|
+
align-items: flex-start;
|
|
90
|
+
|
|
91
|
+
&__column {
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
flex: 1;
|
|
94
|
+
// #ifndef APP-NVUE
|
|
95
|
+
height: auto;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
// #endif
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.fu-waterfall .fu-waterfall__column:last-child {
|
|
102
|
+
margin-right: 0px !important;
|
|
103
|
+
}
|
|
104
|
+
</style>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { version } from '../package.json';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/**
|
|
4
|
+
* 此版本发布于2026-10-10
|
|
5
|
+
* @description 开发环境提示,生产环境不会提示
|
|
6
|
+
*/
|
|
7
7
|
if (process.env.NODE_ENV === 'development') {
|
|
8
8
|
const t = `
|
|
9
9
|
_
|
|
@@ -15,11 +15,17 @@ if (process.env.NODE_ENV === 'development') {
|
|
|
15
15
|
console.log("%c ".concat(t), "color: #2979ff;");
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
export interface Config {
|
|
19
|
+
v: string;
|
|
20
|
+
version: string;
|
|
21
|
+
unit: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const config: Config = {
|
|
19
25
|
v: version,
|
|
20
26
|
version,
|
|
21
27
|
// 默认单位,可以通过配置为rpx,在用于传入组件大小参数为数值时,就默认为rpx
|
|
22
28
|
unit: 'px'
|
|
23
|
-
}
|
|
29
|
+
}
|
|
24
30
|
|
|
25
31
|
export default config
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const componentImages = [
|
|
2
|
+
'scaleToFill',
|
|
3
|
+
'aspectFit',
|
|
4
|
+
'aspectFill',
|
|
5
|
+
'widthFix',
|
|
6
|
+
'heightFix',
|
|
7
|
+
'top',
|
|
8
|
+
'bottom',
|
|
9
|
+
'center',
|
|
10
|
+
'left',
|
|
11
|
+
'right',
|
|
12
|
+
'top left',
|
|
13
|
+
'top right',
|
|
14
|
+
'bottom left',
|
|
15
|
+
'bottom right'
|
|
16
|
+
] as const
|
|
17
|
+
|
|
18
|
+
export type ComponentImage = (typeof componentImages)[number]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const componentOpenTypes = [
|
|
2
|
+
'feedback',
|
|
3
|
+
'share',
|
|
4
|
+
'getUserInfo',
|
|
5
|
+
'contact',
|
|
6
|
+
'getPhoneNumber',
|
|
7
|
+
'launchApp',
|
|
8
|
+
'openSetting',
|
|
9
|
+
'chooseAvatar',
|
|
10
|
+
'agreePrivacyAuthorization',
|
|
11
|
+
'uploadDouyinVideo',
|
|
12
|
+
'im',
|
|
13
|
+
'getAuthorize',
|
|
14
|
+
'lifestyle',
|
|
15
|
+
'contactShare',
|
|
16
|
+
'openGroupProfile',
|
|
17
|
+
'openGuildProfile',
|
|
18
|
+
'openPublicProfile',
|
|
19
|
+
'shareMessageToFriend',
|
|
20
|
+
'addFriend',
|
|
21
|
+
'addColorSign',
|
|
22
|
+
'addGroupApp',
|
|
23
|
+
'addToFavorites',
|
|
24
|
+
'chooseAddress',
|
|
25
|
+
'chooseInvoiceTitle',
|
|
26
|
+
'login',
|
|
27
|
+
'subscribe',
|
|
28
|
+
'favorite',
|
|
29
|
+
'watchLater',
|
|
30
|
+
'openProfile'
|
|
31
|
+
] as const;
|
|
32
|
+
|
|
33
|
+
export type ComponentOpenType = (typeof componentOpenTypes)[number]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const componentProps = {
|
|
4
|
+
/**
|
|
5
|
+
* @description 定义需要用到的外部样式
|
|
6
|
+
*/
|
|
7
|
+
customStyle: {
|
|
8
|
+
type: [String,Object] as PropType<Record<string, any> | string>,
|
|
9
|
+
default: () => ({})
|
|
10
|
+
},
|
|
11
|
+
/**
|
|
12
|
+
* @description 定义需要用到的外部类
|
|
13
|
+
*/
|
|
14
|
+
customClass: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ''
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const ZIndex: Record<string, number | (() => number)> = {
|
|
2
|
+
/**
|
|
3
|
+
* popup 弹出层
|
|
4
|
+
*/
|
|
5
|
+
popup: () => {
|
|
6
|
+
let value: number;
|
|
7
|
+
// #ifdef H5
|
|
8
|
+
value = 997
|
|
9
|
+
// #endif
|
|
10
|
+
// #ifndef H5
|
|
11
|
+
value = 10065
|
|
12
|
+
// #endif
|
|
13
|
+
return value
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* modal 询问框
|
|
17
|
+
*/
|
|
18
|
+
modal: 10066,
|
|
19
|
+
/**
|
|
20
|
+
* 吸顶
|
|
21
|
+
*/
|
|
22
|
+
sticky: 10050,
|
|
23
|
+
/**
|
|
24
|
+
* 键盘
|
|
25
|
+
*/
|
|
26
|
+
keyboard: 10075
|
|
27
|
+
}
|