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
package/global.d.ts
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import type { Common } from './utils/common';
|
|
3
|
+
import type { Config } from './config/config';
|
|
4
|
+
import type { Check } from './utils/check';
|
|
5
|
+
import type { ApplyEven } from './utils/applyEven'
|
|
6
|
+
import type { Toast } from './utils/toast';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* $fu 工具类型声明
|
|
10
|
+
* @description 封装了常用的方法函数,可直接通过`uni.$fu`形式调用
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface Utils extends Common, Check, Toast, ApplyEven {
|
|
14
|
+
config: Config;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare global {
|
|
19
|
+
interface Uni {
|
|
20
|
+
$fu: Utils;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 声明全局组件类型
|
|
25
|
+
declare module 'vue' {
|
|
26
|
+
interface ComponentCustomProperties {
|
|
27
|
+
$fu: Utils;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface GlobalComponents {
|
|
31
|
+
FuAvatar: typeof import('./components/avatar/src/avatar.vue')['default'];
|
|
32
|
+
FuAvatarGroup: typeof import('./components/avatar-group/src/avatar-group.vue')['default'];
|
|
33
|
+
FuBadge: typeof import('./components/badge/src/badge.vue')['default'];
|
|
34
|
+
FuBannerArc: typeof import('./components/banner-arc/src/banner-arc.vue')['default'];
|
|
35
|
+
FuButton: typeof import('./components/button/src/button.vue')['default'];
|
|
36
|
+
FuCell: typeof import('./components/cell/src/cell.vue')['default'];
|
|
37
|
+
FuCellGroup: typeof import('./components/cell-group/src/cell-group.vue')['default'];
|
|
38
|
+
FuCheckbox: typeof import('./components/checkbox/src/checkbox.vue')['default'];
|
|
39
|
+
FuCodeInput: typeof import('./components/code-input/src/code-input.vue')['default'];
|
|
40
|
+
FuCodeVerify: typeof import('./components/code-verify/src/code-verify.vue')['default'];
|
|
41
|
+
FuCollapse: typeof import('./components/collapse/src/collapse.vue')['default'];
|
|
42
|
+
FuCollapseItem: typeof import('./components/collapse-item/src/collapse-item.vue')['default'];
|
|
43
|
+
FuCountdown: typeof import('./components/countdown/src/countdown.vue')['default'];
|
|
44
|
+
FuDatetimePicker: typeof import('./components/datetime-picker/src/datetime-picker.vue')['default'];
|
|
45
|
+
FuForm: typeof import('./components/form/src/form.vue')['default'];
|
|
46
|
+
FuFormItem: typeof import('./components/form-item/src/form-item.vue')['default'];
|
|
47
|
+
FuGrid: typeof import('./components/grid/src/grid.vue')['default'];
|
|
48
|
+
FuGridItem: typeof import('./components/grid-item/src/grid-item.vue')['default'];
|
|
49
|
+
FuIcon: typeof import('./components/icon/src/icon.vue')['default'];
|
|
50
|
+
FuImage: typeof import('./components/image/src/image.vue')['default'];
|
|
51
|
+
FuIndexAnchor: typeof import('./components/index-anchor/src/index-anchor.vue')['default'];
|
|
52
|
+
FuIndexItem: typeof import('./components/index-item/src/index-item.vue')['default'];
|
|
53
|
+
FuIndexList: typeof import('./components/index-list/src/index-list.vue')['default'];
|
|
54
|
+
FuInput: typeof import('./components/input/src/input.vue')['default'];
|
|
55
|
+
FuKeyboard: typeof import('./components/keyboard/src/keyboard.vue')['default'];
|
|
56
|
+
FuLine: typeof import('./components/line/src/line.vue')['default'];
|
|
57
|
+
FuLink: typeof import('./components/link/src/link.vue')['default'];
|
|
58
|
+
FuLoading: typeof import('./components/loading/src/loading.vue')['default'];
|
|
59
|
+
FuLoadingMore: typeof import('./components/loading-more/src/loading-more.vue')['default'];
|
|
60
|
+
FuModal: typeof import('./components/modal/src/modal.vue')['default'];
|
|
61
|
+
FuNavbar: typeof import('./components/navbar/src/navbar.vue')['default'];
|
|
62
|
+
FuNoticeBar: typeof import('./components/notice-bar/src/notice-bar.vue')['default'];
|
|
63
|
+
FuNumberBox: typeof import('./components/number-box/src/number-box.vue')['default'];
|
|
64
|
+
FuParse: typeof import('./components/parse/src/parse.vue')['default'];
|
|
65
|
+
FuPicker: typeof import('./components/picker/src/picker.vue')['default'];
|
|
66
|
+
FuPopup: typeof import('./components/popup/src/popup.vue')['default'];
|
|
67
|
+
FuProgress: typeof import('./components/progress/src/progress.vue')['default'];
|
|
68
|
+
FuRate: typeof import('./components/rate/src/rate.vue')['default'];
|
|
69
|
+
FuReadMore: typeof import('./components/read-more/src/read-more.vue')['default'];
|
|
70
|
+
FuSafeBottom: typeof import('./components/safe-bottom/src/safe-bottom.vue')['default'];
|
|
71
|
+
FuScrollList: typeof import('./components/scroll-list/src/scroll-list.vue')['default'];
|
|
72
|
+
FuSearch: typeof import('./components/search/src/search.vue')['default'];
|
|
73
|
+
FuSection: typeof import('./components/section/src/section.vue')['default'];
|
|
74
|
+
FuSignBoard: typeof import('./components/sign-board/src/sign-board.vue')['default'];
|
|
75
|
+
FuSkeleton: typeof import('./components/skeleton/src/skeleton.vue')['default'];
|
|
76
|
+
FuStatusBar: typeof import('./components/status-bar/src/status-bar.vue')['default'];
|
|
77
|
+
FuSteps: typeof import('./components/steps/src/steps.vue')['default'];
|
|
78
|
+
FuStepsItem: typeof import('./components/steps-item/src/steps-item.vue')['default'];
|
|
79
|
+
FuSticky: typeof import('./components/sticky/src/sticky.vue')['default'];
|
|
80
|
+
FuSubsection: typeof import('./components/subsection/src/subsection.vue')['default'];
|
|
81
|
+
FuSwipeAction: typeof import('./components/swipe-action/src/swipe-action.vue')['default'];
|
|
82
|
+
FuSwipeActionItem: typeof import('./components/swipe-action-item/src/swipe-action-item.vue')['default'];
|
|
83
|
+
FuSwiper: typeof import('./components/swiper/src/swiper.vue')['default'];
|
|
84
|
+
FuSwitch: typeof import('./components/switch/src/switch.vue')['default'];
|
|
85
|
+
FuTabs: typeof import('./components/tabs/src/tabs.vue')['default'];
|
|
86
|
+
FuTag: typeof import('./components/tag/src/tag.vue')['default'];
|
|
87
|
+
FuText: typeof import('./components/text/src/text.vue')['default'];
|
|
88
|
+
FuTextarea: typeof import('./components/textarea/src/textarea.vue')['default'];
|
|
89
|
+
FuTimeaxis: typeof import('./components/timeaxis/src/timeaxis.vue')['default'];
|
|
90
|
+
FuTimeaxisItem: typeof import('./components/timeaxis-item/src/timeaxis-item.vue')['default'];
|
|
91
|
+
FuTransition: typeof import('./components/transition/src/transition.vue')['default'];
|
|
92
|
+
FuUpload: typeof import('./components/upload/src/upload.vue')['default'];
|
|
93
|
+
FuVtabs: typeof import('./components/vtabs/src/vtabs.vue')['default'];
|
|
94
|
+
FuVtabsItem: typeof import('./components/vtabs-item/src/vtabs-item.vue')['default'];
|
|
95
|
+
FuWaterfall: typeof import('./components/waterfall/src/waterfall.vue')['default'];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare const fusionsui: {
|
|
100
|
+
install: (app: App) => void;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export default fusionsui;
|
package/hooks/index.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getCurrentInstance } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const useCommon = () => {
|
|
4
|
+
const instance = getCurrentInstance();
|
|
5
|
+
|
|
6
|
+
// 查询节点信息
|
|
7
|
+
// 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
|
|
8
|
+
// 解决办法为在组件根部再套一个没有任何作用的view元素
|
|
9
|
+
const getRect = (selector: string, all?: boolean) => {
|
|
10
|
+
return new Promise((resolve) => {
|
|
11
|
+
uni.createSelectorQuery().in(instance?.proxy)[all? 'selectAll': 'select'](selector).boundingClientRect((res: any) => {
|
|
12
|
+
if (all && Array.isArray(res) && res.length) {
|
|
13
|
+
resolve(res)
|
|
14
|
+
}
|
|
15
|
+
if (!all && res) {
|
|
16
|
+
resolve(res)
|
|
17
|
+
}
|
|
18
|
+
}).exec()
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
getRect
|
|
24
|
+
}
|
|
25
|
+
}
|
package/index.scss
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
// 引入公共基础样式
|
|
2
|
-
@
|
|
3
|
-
@import './libs/style/color.scss';
|
|
4
|
-
@import './libs/style/components.scss';
|
|
2
|
+
@use './style/common.scss' as *;
|
|
5
3
|
|
|
6
4
|
// 小程序特有样式
|
|
7
5
|
/* #ifdef MP */
|
|
8
|
-
@
|
|
6
|
+
@use './style/style.mp.scss' as *;
|
|
9
7
|
/* #endif */
|
|
10
8
|
|
|
11
9
|
// H5特有样式
|
|
12
10
|
/* #ifdef H5 */
|
|
13
|
-
@
|
|
11
|
+
@use './style/style.h5.scss' as *;
|
|
14
12
|
/* #endif */
|
package/index.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 示例:
|
|
4
|
+
* import FusionsUI from 'fusions-ui'
|
|
5
|
+
* Vue.use(FusionsUI)
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// 工具函数
|
|
9
|
+
import * as common from './utils/common';
|
|
10
|
+
// 配置信息
|
|
11
|
+
import config from './config/config';
|
|
12
|
+
// 规则校验
|
|
13
|
+
import check from './utils/check';
|
|
14
|
+
// 防抖方法 debounce 节流方法 throttle
|
|
15
|
+
import { debounce, throttle } from './utils/applyEven'
|
|
16
|
+
// 内置路由管理
|
|
17
|
+
import minRouteConfig from './route/min.route.config'
|
|
18
|
+
import routeConfig from './route/route.config'
|
|
19
|
+
// 消息工具
|
|
20
|
+
import toast from './utils/toast';
|
|
21
|
+
// 选择文件
|
|
22
|
+
import { chooseUploadFile, uploadCloudFiles } from './utils/chooseUploadFile';
|
|
23
|
+
|
|
24
|
+
// 定义全局挂在对象
|
|
25
|
+
export const $fu = {
|
|
26
|
+
config,
|
|
27
|
+
version: config.version,
|
|
28
|
+
debounce,
|
|
29
|
+
throttle,
|
|
30
|
+
chooseUploadFile,
|
|
31
|
+
uploadCloudFiles,
|
|
32
|
+
...common,
|
|
33
|
+
...check,
|
|
34
|
+
...toast,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// 将$fu挂载到 uni 对象上
|
|
38
|
+
uni.$fu = $fu;
|
|
39
|
+
|
|
40
|
+
interface InstallOptions {
|
|
41
|
+
openRouter?: boolean;
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const install = (app: App, options: InstallOptions = {}): void => {
|
|
46
|
+
// 内置路由
|
|
47
|
+
if(options.openRouter) {
|
|
48
|
+
app.use(minRouteConfig, routeConfig)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
app.config.globalProperties.$fu = $fu;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
install
|
|
56
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fusions-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9",
|
|
4
4
|
"description": "FusionsUI Component library",
|
|
5
|
-
"main": "index.
|
|
5
|
+
"main": "index.ts",
|
|
6
|
+
"types": "global.d.ts",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
9
|
},
|
|
@@ -16,6 +17,12 @@
|
|
|
16
17
|
"fusions UI",
|
|
17
18
|
"fusionsUI"
|
|
18
19
|
],
|
|
19
|
-
"author": "
|
|
20
|
-
"license": "ISC"
|
|
21
|
-
|
|
20
|
+
"author": "fusions",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"vue": "^3.0.0"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* min.router.config.js
|
|
3
3
|
* 使用方法
|
|
4
|
-
* Vue2
|
|
5
|
-
* 示例:this.$openPage({name: 'my', query: {id: 123}, type: 'navigateTo'}) 传参方式
|
|
6
|
-
* 示例:this.$openPage('my') 不传参数可以简写
|
|
7
4
|
* Vue3 setup语法糖
|
|
8
5
|
* 示例:
|
|
9
6
|
* import { getCurrentInstance } from 'vue';
|
|
@@ -15,31 +12,61 @@
|
|
|
15
12
|
* @param name 字符串地址名
|
|
16
13
|
* @param query 传递的参数
|
|
17
14
|
* @param type 跳转的方式 ['navigateTo', 'switchTab', 'reLaunch', 'redirectTo'] 不传默认navigateTo
|
|
18
|
-
*
|
|
19
|
-
* 使用方法在接收参数页
|
|
15
|
+
* uni.$fu.$parseURL() 解析路由参数
|
|
16
|
+
* 使用方法在接收参数页uni.$fu.$parseURL(options)
|
|
20
17
|
*/
|
|
21
18
|
const toString = Object.prototype.toString
|
|
22
19
|
|
|
23
|
-
function isObject(value) {
|
|
20
|
+
function isObject(value: unknown): value is Record<string, any> {
|
|
24
21
|
return toString.call(value) === '[object Object]'
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
function isString(value) {
|
|
24
|
+
function isString(value: unknown): value is string {
|
|
28
25
|
return toString.call(value) === '[object String]'
|
|
29
26
|
}
|
|
30
27
|
|
|
31
|
-
function isDefault(value) {
|
|
28
|
+
function isDefault(value: unknown): value is undefined {
|
|
32
29
|
return value === void 0
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
// 定义导航类型
|
|
33
|
+
type NavigateType = 'navigateTo' | 'switchTab' | 'reLaunch' | 'redirectTo';
|
|
34
|
+
|
|
35
|
+
// 路由配置项接口
|
|
36
|
+
interface RouteConfig {
|
|
37
|
+
name: string;
|
|
38
|
+
path: string;
|
|
39
|
+
type?: NavigateType;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// openPage函数参数对象接口
|
|
43
|
+
interface OpenPageOptions {
|
|
44
|
+
name: string;
|
|
45
|
+
type?: NavigateType;
|
|
46
|
+
query?: Record<string, any>
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// 定义合法的 API 映射
|
|
50
|
+
const apiMap = {
|
|
51
|
+
navigateTo: uni.navigateTo,
|
|
52
|
+
redirectTo: uni.redirectTo,
|
|
53
|
+
reLaunch: uni.reLaunch,
|
|
54
|
+
switchTab: uni.switchTab
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
function openPage(args: string | OpenPageOptions) {
|
|
58
|
+
let name: string;
|
|
59
|
+
let query = {};
|
|
60
|
+
let queryStr: string | null = null;
|
|
61
|
+
let path: string = '';
|
|
62
|
+
let type: NavigateType = 'navigateTo';
|
|
63
|
+
let isName = false;
|
|
37
64
|
switch (true) {
|
|
38
65
|
case isObject(args):
|
|
39
|
-
({ name, type, query = {} } = args)
|
|
66
|
+
({ name, type, query = {} } = args as OpenPageOptions)
|
|
40
67
|
break
|
|
41
68
|
case isString(args):
|
|
42
|
-
name = args;
|
|
69
|
+
name = args as string;
|
|
43
70
|
break
|
|
44
71
|
default:
|
|
45
72
|
throw new Error('参数必须是对象或者字符串')
|
|
@@ -49,7 +76,7 @@ function openPage(args) {
|
|
|
49
76
|
} else {
|
|
50
77
|
throw new Error('query数据必须是Object')
|
|
51
78
|
}
|
|
52
|
-
this.$routerConfig.forEach(item => {
|
|
79
|
+
(this.$routerConfig as RouteConfig[]).forEach(item => {
|
|
53
80
|
if (item.name === name) {
|
|
54
81
|
path = item.path;
|
|
55
82
|
type = type || (item.type || 'navigateTo');
|
|
@@ -62,9 +89,16 @@ function openPage(args) {
|
|
|
62
89
|
if (!['navigateTo', 'switchTab', 'reLaunch', 'redirectTo'].includes(type)) {
|
|
63
90
|
throw new Error(`name:${name}里面的type必须是以下的值['navigateTo', 'switchTab', 'reLaunch', 'redirectTo']`)
|
|
64
91
|
}
|
|
65
|
-
|
|
92
|
+
|
|
93
|
+
const apiMap = {
|
|
94
|
+
navigateTo: uni.navigateTo,
|
|
95
|
+
switchTab: uni.switchTab,
|
|
96
|
+
reLaunch: uni.reLaunch,
|
|
97
|
+
redirectTo: uni.redirectTo
|
|
98
|
+
};
|
|
99
|
+
|
|
66
100
|
return new Promise((resolve, reject) => {
|
|
67
|
-
|
|
101
|
+
apiMap[type]({
|
|
68
102
|
url: `/${path}?query=${queryStr}`,
|
|
69
103
|
success: resolve,
|
|
70
104
|
fail: reject
|
|
@@ -72,16 +106,24 @@ function openPage(args) {
|
|
|
72
106
|
})
|
|
73
107
|
}
|
|
74
108
|
|
|
75
|
-
function parseURL(
|
|
76
|
-
const query = args;
|
|
109
|
+
function parseURL(query?: string): Record<string, any> {
|
|
77
110
|
if (query) {
|
|
78
|
-
|
|
111
|
+
try {
|
|
112
|
+
return JSON.parse(decodeURIComponent(query));
|
|
113
|
+
} catch (error) {
|
|
114
|
+
console.error('解析 URL 参数失败:', error);
|
|
115
|
+
return {};
|
|
116
|
+
}
|
|
79
117
|
} else {
|
|
80
118
|
return {}
|
|
81
119
|
}
|
|
82
120
|
}
|
|
83
121
|
|
|
84
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Vue 实例类型(兼容 Vue 2 和 Vue 3)
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
function install(Vue: any, routerConfig: any): void {
|
|
85
127
|
if (!routerConfig || !Array.isArray(routerConfig.options.routes)) {
|
|
86
128
|
throw new Error("routerConfig 必须是一个带有 routes 属性的对象");
|
|
87
129
|
}
|
|
@@ -122,14 +164,11 @@ function install(Vue, routerConfig) {
|
|
|
122
164
|
}
|
|
123
165
|
})
|
|
124
166
|
|
|
125
|
-
if(!uni.$fu) {
|
|
126
|
-
uni.$fu = {};
|
|
127
|
-
}
|
|
128
167
|
uni.$fu.$openPage = openPage.bind(globalProperties);
|
|
129
168
|
uni.$fu.$parseURL = parseURL.bind(globalProperties)
|
|
130
169
|
}
|
|
131
170
|
|
|
132
|
-
function minRouteConfig(options) {
|
|
171
|
+
function minRouteConfig(options: any) {
|
|
133
172
|
if (!(this instanceof minRouteConfig)) {
|
|
134
173
|
throw Error("minRouteConfig是一个构造函数,应该用`new`关键字调用")
|
|
135
174
|
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 使用方法
|
|
3
|
+
* Vue3 示例:
|
|
4
|
+
* import { getCurrentInstance } from 'vue';
|
|
5
|
+
* const { $openPage } = getCurrentInstance().appContext.config.globalProperties;
|
|
6
|
+
* $openPage({name: 'my', query: {id: 123}, type: 'navigateTo'}) 传参方式
|
|
7
|
+
* $openPage('my') 不传参数可以简写
|
|
8
|
+
* Vue2 和 Vue3
|
|
9
|
+
* 视图中可直接使用 $openPage('my')
|
|
10
|
+
* 配置参数项说明:
|
|
11
|
+
* name:可选配置 (路由名称)
|
|
12
|
+
* path:必填配置 (路由地址)
|
|
13
|
+
* type 跳转的方式 ['navigateTo', 'switchTab', 'reLaunch', 'redirectTo'] 不传默认navigateTo
|
|
14
|
+
*/
|
|
15
|
+
import pagesJson from '@/pages.json';
|
|
16
|
+
import minRouteConfig from './min.route.config.js';
|
|
17
|
+
|
|
18
|
+
// 定义导航类型
|
|
19
|
+
type NavigateType = 'navigateTo' | 'switchTab' | 'reLaunch' | 'redirectTo';
|
|
20
|
+
|
|
21
|
+
// 处理 pages 数组
|
|
22
|
+
interface PageConfig {
|
|
23
|
+
name?: string;
|
|
24
|
+
path: string;
|
|
25
|
+
type?: NavigateType;
|
|
26
|
+
[key: string]: any; // 允许其他属性
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function processPages(pages: PageConfig[]) {
|
|
30
|
+
if (!Array.isArray(pages)) {
|
|
31
|
+
console.warn('pages 必须是一个数组');
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return pages.map(page => {
|
|
36
|
+
const processedPage = {
|
|
37
|
+
name: page.name || page.path,
|
|
38
|
+
path: page.path,
|
|
39
|
+
type: page.type
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// 仅在 type 不存在时不添加默认值
|
|
43
|
+
if(page.type) {
|
|
44
|
+
processedPage.type = page.type;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return processedPage
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 处理 subPackages 数组
|
|
52
|
+
interface PagesJsonSubPackage {
|
|
53
|
+
root: string;
|
|
54
|
+
pages: PageConfig[];
|
|
55
|
+
name?: string;
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function processSubPackages(subPackages?: PagesJsonSubPackage[]): PageConfig[] {
|
|
60
|
+
// 如果 subPackages 不存在或不是数组,返回空数组
|
|
61
|
+
if (!subPackages || !Array.isArray(subPackages)) {
|
|
62
|
+
return []
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let routes: PageConfig[] = [];
|
|
66
|
+
subPackages.forEach(subPackage => {
|
|
67
|
+
routes = routes.concat(processPages(subPackage.pages).map(page => {
|
|
68
|
+
return {
|
|
69
|
+
...page,
|
|
70
|
+
name: page.name || subPackage.root + '/' + page.path,
|
|
71
|
+
path: subPackage.root + '/' + page.path
|
|
72
|
+
};
|
|
73
|
+
}));
|
|
74
|
+
});
|
|
75
|
+
return routes;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface PagesJson {
|
|
79
|
+
pages: PageConfig[];
|
|
80
|
+
subPackages?: PagesJsonSubPackage[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 类型断言
|
|
84
|
+
const pagesJsons = pagesJson as PagesJson;
|
|
85
|
+
|
|
86
|
+
const route = new minRouteConfig({
|
|
87
|
+
routes: [
|
|
88
|
+
...processPages(pagesJsons.pages),
|
|
89
|
+
...processSubPackages(pagesJsons.subPackages || [])
|
|
90
|
+
]
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
export default route
|
package/style/color.scss
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
$fu-color-main: #333333;
|
|
2
|
+
|
|
3
|
+
$fu-color-primary: #2979ff;
|
|
4
|
+
$fu-color-primary-dark: #1a5fd9;
|
|
5
|
+
$fu-color-primary-disabled: #7ab1ff;
|
|
6
|
+
$fu-color-primary-light: #d0e3ff;
|
|
7
|
+
|
|
8
|
+
$fu-color-warning: #fcb03d;
|
|
9
|
+
$fu-color-warning-dark: #e09a35;
|
|
10
|
+
$fu-color-warning-disabled: #fdd58e;
|
|
11
|
+
$fu-color-warning-light: #fef2e0;
|
|
12
|
+
|
|
13
|
+
$fu-color-success: #5fd126;
|
|
14
|
+
$fu-color-success-dark: #4fb020;
|
|
15
|
+
$fu-color-success-disabled: #a8e88a;
|
|
16
|
+
$fu-color-success-light: #e8f8e1;
|
|
17
|
+
|
|
18
|
+
$fu-color-error: #f86d6d;
|
|
19
|
+
$fu-color-error-dark: #e05c5c;
|
|
20
|
+
$fu-color-error-disabled: #fcb3b3;
|
|
21
|
+
$fu-color-error-light: #fee8e8;
|
|
22
|
+
|
|
23
|
+
$fu-color-info: #9ca0a6;
|
|
24
|
+
$fu-color-info-dark: #7e8288;
|
|
25
|
+
$fu-color-info-disabled: #d0d2d5;
|
|
26
|
+
$fu-color-info-light: #f2f3f4;
|
|
@@ -31,19 +31,6 @@ $gap: (5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95
|
|
|
31
31
|
}
|
|
32
32
|
/* #endif */
|
|
33
33
|
|
|
34
|
-
/* 遮罩层 */
|
|
35
|
-
.fu-mask-layer {
|
|
36
|
-
width: 100%;
|
|
37
|
-
height: 100%;
|
|
38
|
-
background: #000000;
|
|
39
|
-
opacity: 0.5;
|
|
40
|
-
position: fixed;
|
|
41
|
-
z-index: 98;
|
|
42
|
-
top: 0;
|
|
43
|
-
left: 0;
|
|
44
|
-
overflow: hidden;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
34
|
/* flex 弹性布局 */
|
|
48
35
|
.fu-flex {
|
|
49
36
|
/* #ifndef APP-NVUE */
|
|
@@ -441,7 +428,7 @@ $font-weight: (
|
|
|
441
428
|
);
|
|
442
429
|
|
|
443
430
|
@each $short, $long in $font-weight {
|
|
444
|
-
.fu-font
|
|
431
|
+
.fu-font-w#{$short} {
|
|
445
432
|
font-weight: $long;
|
|
446
433
|
}
|
|
447
434
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
let timeout = null;
|
|
1
|
+
let timeout: NodeJS.Timeout | null = null;
|
|
2
2
|
/**
|
|
3
|
-
* 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
|
|
3
|
+
* @description 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
|
|
4
|
+
*
|
|
4
5
|
* @param {Function} func 要执行的回调函数
|
|
5
|
-
* @param {
|
|
6
|
-
* @param {
|
|
7
|
-
* @return null
|
|
6
|
+
* @param {number} wait 延时的时间
|
|
7
|
+
* @param {boolean} immediate 是否立即执行
|
|
8
8
|
*/
|
|
9
|
-
export function debounce(func, wait = 500, immediate = false) {
|
|
9
|
+
export function debounce(func: () => void, wait: number = 500, immediate: boolean = false) {
|
|
10
10
|
// 清除定时器
|
|
11
11
|
if (timeout !== null) clearTimeout(timeout)
|
|
12
12
|
// 立即执行,此类情况一般用不到
|
|
@@ -24,16 +24,16 @@ export function debounce(func, wait = 500, immediate = false) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
let timer
|
|
27
|
+
let timer: NodeJS.Timeout | null = null;
|
|
28
|
+
let flag: boolean | undefined;
|
|
28
29
|
/**
|
|
29
|
-
* 节流原理:在一定时间内,只能触发一次
|
|
30
|
+
* @description 节流原理:在一定时间内,只能触发一次
|
|
30
31
|
*
|
|
31
32
|
* @param {Function} func 要执行的回调函数
|
|
32
|
-
* @param {
|
|
33
|
-
* @param {
|
|
34
|
-
* @return null
|
|
33
|
+
* @param {number} wait 延时的时间
|
|
34
|
+
* @param {boolean} immediate 是否立即执行
|
|
35
35
|
*/
|
|
36
|
-
export function throttle(func, wait = 500, immediate = true) {
|
|
36
|
+
export function throttle(func: () => void, wait: number = 500, immediate: boolean = true) {
|
|
37
37
|
if (immediate) {
|
|
38
38
|
if (!flag) {
|
|
39
39
|
flag = true;
|
|
@@ -52,3 +52,12 @@ export function throttle(func, wait = 500, immediate = true) {
|
|
|
52
52
|
}, wait)
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 公共类型声明
|
|
58
|
+
*/
|
|
59
|
+
export type ApplyEven = {
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
debounce: typeof debounce;
|
|
62
|
+
throttle: typeof throttle;
|
|
63
|
+
}
|