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
|
@@ -1,535 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="fu-form-item"
|
|
3
|
-
:class="['is-direction-' + localLabelPos , border?'fu-form-item--border': '' , border && isFirstBorder? 'is-first-border': '']">
|
|
4
|
-
<slot name="label">
|
|
5
|
-
<view class="fu-form-item__label" :class="{'no-label': !label && !required}" :style="{width: localLabelWidth, justifyContent: localLabelAlign}">
|
|
6
|
-
<text v-if="required" class="is-required">*</text>
|
|
7
|
-
<text>{{ label }}</text>
|
|
8
|
-
</view>
|
|
9
|
-
</slot>
|
|
10
|
-
<!-- #ifndef APP-NVUE -->
|
|
11
|
-
<view class="fu-form-item__content">
|
|
12
|
-
<slot></slot>
|
|
13
|
-
<view class="fu-form-item__error" :class="{'msg--active': msg}">
|
|
14
|
-
<text>{{ msg }}</text>
|
|
15
|
-
</view>
|
|
16
|
-
</view>
|
|
17
|
-
<!-- #endif -->
|
|
18
|
-
<!-- #ifdef APP-NVUE -->
|
|
19
|
-
<view class="fu-form-item__nuve-content">
|
|
20
|
-
<view class="fu-form-item__content">
|
|
21
|
-
<slot></slot>
|
|
22
|
-
</view>
|
|
23
|
-
<view class="fu-form-item__error" :class="{'msg--active': msg}">
|
|
24
|
-
<text class="error-text">{{ msg }}</text>
|
|
25
|
-
</view>
|
|
26
|
-
</view>
|
|
27
|
-
<!-- #endif -->
|
|
28
|
-
</view>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<script>
|
|
32
|
-
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
33
|
-
import props from './props.js'
|
|
34
|
-
/**
|
|
35
|
-
* 表单子组件
|
|
36
|
-
* @description 此组件表单子组件,提供了基础布局已经校验能力 需配合fu-form组件一起使用
|
|
37
|
-
* @property {Boolean} required = [true|false] 是否必填,左边显示红色"*"号
|
|
38
|
-
* @property {String } label 输入框左边的文字提示
|
|
39
|
-
* @property {Number } labelWidth label的宽度,单位px(默认70)
|
|
40
|
-
* @property {String } labelAlign = [left|center|right] label的文字对齐方式(默认left)
|
|
41
|
-
* @value left label 左侧显示
|
|
42
|
-
* @value center label 居中
|
|
43
|
-
* @value right label 右侧对齐
|
|
44
|
-
* @property {String } message 显示的错误提示内容,如果为空字符串或者false,则不显示错误信息
|
|
45
|
-
* @property {String } prop 表单域的属性名,在使用校验规则时必填
|
|
46
|
-
* @property {String } labelPosition = [top|left] label的文字的位置,优先级高于fu-form组件中的labelPosition
|
|
47
|
-
* @value top 顶部显示 label
|
|
48
|
-
* @value left 左侧显示 label
|
|
49
|
-
*/
|
|
50
|
-
export default {
|
|
51
|
-
name:"FuFormItem",
|
|
52
|
-
provide() {
|
|
53
|
-
return {
|
|
54
|
-
fuFormItem: this
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
inject: {
|
|
58
|
-
form: {
|
|
59
|
-
from: 'fuForm',
|
|
60
|
-
default: null
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
mixins: [mpMixin, props],
|
|
64
|
-
data() {
|
|
65
|
-
return {
|
|
66
|
-
errMsg: '',
|
|
67
|
-
userRules: null,
|
|
68
|
-
localLabelAlign: 'left',
|
|
69
|
-
localLabelWidth: '70px',
|
|
70
|
-
localLabelPos: 'left',
|
|
71
|
-
border: false,
|
|
72
|
-
isFirstBorder: false,
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
computed: {
|
|
76
|
-
// 处理错误信息
|
|
77
|
-
msg() {
|
|
78
|
-
return this.message || this.errMsg;
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
created() {
|
|
82
|
-
this.init(true)
|
|
83
|
-
if (this.prop && this.form) {
|
|
84
|
-
// 处理头条Vue3 watch不生效的问题
|
|
85
|
-
// #ifdef MP-TOUTIAO
|
|
86
|
-
this.$watch('form.formRules', () => {
|
|
87
|
-
this.init()
|
|
88
|
-
})
|
|
89
|
-
// #endif
|
|
90
|
-
|
|
91
|
-
// 监听变化
|
|
92
|
-
this.$watch(() => {
|
|
93
|
-
const val = this.form._getDataValue(this.prop, this.form.localData);
|
|
94
|
-
return val
|
|
95
|
-
}, (value, oldVal) => {
|
|
96
|
-
const isEqual = this.form._isEqual(value, oldVal)
|
|
97
|
-
// 简单判断前后值的变化,只有发生变化才会发生校验
|
|
98
|
-
// 如果 oldVal = undefined,那么大概率是源数据里没有值导致 ,这个情况不哦校验,可能不严谨,需要在做观察
|
|
99
|
-
// 暂时取消 && oldVal !== undefined,如果formData中不存在,可能会不校验
|
|
100
|
-
if (!isEqual) {
|
|
101
|
-
const val = this.itemSetValue(value)
|
|
102
|
-
this.onFieldChange(val, false)
|
|
103
|
-
}
|
|
104
|
-
}, { immediate: false }
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
methods: {
|
|
110
|
-
/**
|
|
111
|
-
* 外部调用方法
|
|
112
|
-
* 设置规则 ,主要用于小程序自定义检验规则
|
|
113
|
-
* @param {Array} rules 规则源数据
|
|
114
|
-
*/
|
|
115
|
-
setRules(rules = null) {
|
|
116
|
-
this.userRules = rules;
|
|
117
|
-
this.init(false)
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* 外部调用方法
|
|
122
|
-
* 校验数据
|
|
123
|
-
* @param {any} value 需要校验的数据
|
|
124
|
-
* @param {boolean} 是否立即校验
|
|
125
|
-
* @return {Array|null} 校验内容
|
|
126
|
-
*/
|
|
127
|
-
async onFieldChange(value, formtrigger = true) {
|
|
128
|
-
const {
|
|
129
|
-
formData,
|
|
130
|
-
localData,
|
|
131
|
-
errShowType,
|
|
132
|
-
validateCheck,
|
|
133
|
-
validateTrigger,
|
|
134
|
-
_isRequiredField,
|
|
135
|
-
_realProp
|
|
136
|
-
} = this.form;
|
|
137
|
-
|
|
138
|
-
const prop = _realProp(this.prop);
|
|
139
|
-
if (!value) {
|
|
140
|
-
value = this.form.formData[prop];
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// 解决没有检验规则的情况下,抛出错误的问题
|
|
144
|
-
const ruleLen = this.itemRules.rules && this.itemRules.rules.length;
|
|
145
|
-
if (!this.validator || !ruleLen || ruleLen === 0) return;
|
|
146
|
-
|
|
147
|
-
// 检验时机
|
|
148
|
-
const isRequiredField = _isRequiredField(this.itemRules.rules || []);
|
|
149
|
-
let result = null;
|
|
150
|
-
// 只有等于 bind 时 ,才能开启时实校验
|
|
151
|
-
if (validateTrigger === 'bind' || formtrigger) {
|
|
152
|
-
// 校验当前表单项
|
|
153
|
-
result = await this.validator.validateUpdate({
|
|
154
|
-
[prop]: value
|
|
155
|
-
},
|
|
156
|
-
formData
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
// 判断是否必填,非必填,不填不校验,填写才校验 ,暂时只处理 undefined 和空的情况
|
|
160
|
-
if (!isRequiredField && (value === undefined || value === '')) {
|
|
161
|
-
result = null;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// 判断错误信息显示类型
|
|
165
|
-
if (result && result.message) {
|
|
166
|
-
if (errShowType === 'undertext') {
|
|
167
|
-
// 获取错误信息
|
|
168
|
-
this.errMsg = !result? '': result.message;
|
|
169
|
-
}
|
|
170
|
-
if (errShowType === 'toast') {
|
|
171
|
-
uni.showToast({
|
|
172
|
-
title: result.message || '校验错误',
|
|
173
|
-
icon: 'none'
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
if (errShowType === 'modal') {
|
|
177
|
-
uni.showModal({
|
|
178
|
-
title: '提示',
|
|
179
|
-
content: result.message || '校验错误'
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
} else {
|
|
183
|
-
this.errMsg = ''
|
|
184
|
-
}
|
|
185
|
-
// 通知 form 组件更新事件
|
|
186
|
-
validateCheck(result? result: null)
|
|
187
|
-
} else {
|
|
188
|
-
this.errMsg = '';
|
|
189
|
-
}
|
|
190
|
-
return result? result: null;
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* 初始组件数据
|
|
195
|
-
*/
|
|
196
|
-
init(type = false) {
|
|
197
|
-
const {
|
|
198
|
-
validator,
|
|
199
|
-
formRules,
|
|
200
|
-
childrens,
|
|
201
|
-
formData,
|
|
202
|
-
localData,
|
|
203
|
-
_realProp,
|
|
204
|
-
labelWidth,
|
|
205
|
-
_getDataValue,
|
|
206
|
-
_setDataValue
|
|
207
|
-
} = this.form || {};
|
|
208
|
-
// 对齐方式
|
|
209
|
-
this.localLabelAlign = this._justifyContent();
|
|
210
|
-
// 宽度
|
|
211
|
-
this.localLabelWidth = this._labelWidthUnit(labelWidth);
|
|
212
|
-
// 标签位置
|
|
213
|
-
this.localLabelPos = this.labelPosition || this._labelPosition();
|
|
214
|
-
// 将需要校验的子组件加入form 队列
|
|
215
|
-
this.form && type && childrens.push(this)
|
|
216
|
-
|
|
217
|
-
if (!validator || !formRules) return
|
|
218
|
-
// 判断第一个 item
|
|
219
|
-
if (!this.form.isFirstBorder) {
|
|
220
|
-
this.form.isFirstBorder = true;
|
|
221
|
-
this.isFirstBorder = true;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// 判断 group 里的第一个 item
|
|
225
|
-
if (this.group) {
|
|
226
|
-
if (!this.group.isFirstBorder) {
|
|
227
|
-
this.group.isFirstBorder = true;
|
|
228
|
-
this.isFirstBorder = true;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
this.border = this.form.border;
|
|
232
|
-
// 获取子域的真实名称
|
|
233
|
-
const prop = _realProp(this.prop)
|
|
234
|
-
const itemRule = this.userRules || this.rules;
|
|
235
|
-
if (typeof formRules === 'object' && itemRule) {
|
|
236
|
-
// 子规则替换父规则
|
|
237
|
-
formRules[prop] = {
|
|
238
|
-
rules: itemRule
|
|
239
|
-
};
|
|
240
|
-
validator.updateSchema(formRules);
|
|
241
|
-
}
|
|
242
|
-
// 注册校验规则
|
|
243
|
-
const itemRules = formRules[prop] || {};
|
|
244
|
-
this.itemRules = itemRules;
|
|
245
|
-
// 注册校验函数
|
|
246
|
-
this.validator = validator;
|
|
247
|
-
// 默认值赋予
|
|
248
|
-
this.itemSetValue(_getDataValue(this.prop, localData))
|
|
249
|
-
},
|
|
250
|
-
|
|
251
|
-
fuInit() {
|
|
252
|
-
if (this.form) {
|
|
253
|
-
const {
|
|
254
|
-
childrens,
|
|
255
|
-
formData,
|
|
256
|
-
_realProp
|
|
257
|
-
} = this.form;
|
|
258
|
-
childrens.forEach((item, index) => {
|
|
259
|
-
if (item === this) {
|
|
260
|
-
this.form.childrens.splice(index, 1)
|
|
261
|
-
delete formData[_realProp(item.prop)]
|
|
262
|
-
}
|
|
263
|
-
})
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
// 设置item 的值
|
|
268
|
-
itemSetValue(value) {
|
|
269
|
-
const prop = this.form._realProp(this.prop)
|
|
270
|
-
const rules = this.itemRules.rules || [];
|
|
271
|
-
const val = this.form._getValue(prop, value, rules)
|
|
272
|
-
this.form._setDataValue(prop, this.form.formData, val)
|
|
273
|
-
return val
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* 移除该表单项的校验结果
|
|
278
|
-
*/
|
|
279
|
-
clearValidate() {
|
|
280
|
-
this.errMsg = '';
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
// 是否显示星号
|
|
284
|
-
_isRequired() {
|
|
285
|
-
return this.required
|
|
286
|
-
},
|
|
287
|
-
|
|
288
|
-
// 处理对齐方式
|
|
289
|
-
_justifyContent() {
|
|
290
|
-
if (this.form) {
|
|
291
|
-
const {
|
|
292
|
-
labelAlign
|
|
293
|
-
} = this.form;
|
|
294
|
-
let labelAli = this.labelAlign ? this.labelAlign : labelAlign;
|
|
295
|
-
if (labelAli === 'left') return 'flex-start';
|
|
296
|
-
if (labelAli === 'center') return 'center';
|
|
297
|
-
if (labelAli === 'right') return 'flex-end';
|
|
298
|
-
}
|
|
299
|
-
return 'flex-start';
|
|
300
|
-
},
|
|
301
|
-
|
|
302
|
-
// 处理 label宽度单位 ,继承父元素的值
|
|
303
|
-
_labelWidthUnit(labelWidth) {
|
|
304
|
-
return this.num2px(this.labelWidth? this.labelWidth : (labelWidth || (this.label? 70: 'auto')))
|
|
305
|
-
},
|
|
306
|
-
|
|
307
|
-
// 处理 label 位置
|
|
308
|
-
_labelPosition() {
|
|
309
|
-
if (this.form) return this.form.labelPosition || 'left'
|
|
310
|
-
return 'left'
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* 触发时机
|
|
315
|
-
* @param {Object} rule 当前规则内时机
|
|
316
|
-
* @param {Object} itemRlue 当前组件时机
|
|
317
|
-
* @param {Object} parentRule 父组件时机
|
|
318
|
-
*/
|
|
319
|
-
isTrigger(rule, itemRlue, parentRule) {
|
|
320
|
-
// bind submit
|
|
321
|
-
if (rule === 'submit' || !rule) {
|
|
322
|
-
if (rule === undefined) {
|
|
323
|
-
if (itemRlue !== 'bind') {
|
|
324
|
-
if (!itemRlue) {
|
|
325
|
-
return parentRule === '' ? 'bind' : 'submit';
|
|
326
|
-
}
|
|
327
|
-
return 'submit';
|
|
328
|
-
}
|
|
329
|
-
return 'bind';
|
|
330
|
-
}
|
|
331
|
-
return 'submit';
|
|
332
|
-
}
|
|
333
|
-
return 'bind';
|
|
334
|
-
},
|
|
335
|
-
|
|
336
|
-
num2px(num) {
|
|
337
|
-
if (typeof num === 'number') {
|
|
338
|
-
return `${num}px`
|
|
339
|
-
}
|
|
340
|
-
return num
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
watch: {
|
|
344
|
-
// 规则发生变化通知子组件更新
|
|
345
|
-
'form.formRules'(val) {
|
|
346
|
-
// 处理头条vue3 watch不生效的问题
|
|
347
|
-
// #ifndef MP-TOUTIAO
|
|
348
|
-
this.init()
|
|
349
|
-
// #endif
|
|
350
|
-
},
|
|
351
|
-
'form.labelWidth'(val) {
|
|
352
|
-
// 宽度
|
|
353
|
-
this.localLabelWidth = this._labelWidthUnit(val)
|
|
354
|
-
|
|
355
|
-
},
|
|
356
|
-
'form.labelPosition'(val) {
|
|
357
|
-
// 标签位置
|
|
358
|
-
this.localLabelPos = this.labelPosition || this._labelPosition()
|
|
359
|
-
},
|
|
360
|
-
'form.labelAlign'(val) {
|
|
361
|
-
// 标签对齐方式
|
|
362
|
-
this.localLabelAlign = this._justifyContent();
|
|
363
|
-
}
|
|
364
|
-
},
|
|
365
|
-
// #ifndef VUE3
|
|
366
|
-
destroyed() {
|
|
367
|
-
if (this.__isUnmounted) return
|
|
368
|
-
this.fuInit()
|
|
369
|
-
},
|
|
370
|
-
// #endif
|
|
371
|
-
// #ifdef VUE3
|
|
372
|
-
unmounted() {
|
|
373
|
-
this.__isUnmounted = true;
|
|
374
|
-
this.fuInit()
|
|
375
|
-
},
|
|
376
|
-
// #endif
|
|
377
|
-
}
|
|
378
|
-
</script>
|
|
379
|
-
|
|
380
|
-
<style lang="scss" scoped>
|
|
381
|
-
@import '../../libs/style/components.scss';
|
|
382
|
-
|
|
383
|
-
.fu-form-item {
|
|
384
|
-
@include flex(row);
|
|
385
|
-
position: relative;
|
|
386
|
-
/* #ifdef APP-NVUE */
|
|
387
|
-
// 在 nvue 中,使用 margin-bottom error 信息会被隐藏
|
|
388
|
-
padding-bottom: 22px;
|
|
389
|
-
/* #endif */
|
|
390
|
-
/* #ifndef APP-NVUE */
|
|
391
|
-
margin-bottom: 22px;
|
|
392
|
-
/* #endif */
|
|
393
|
-
|
|
394
|
-
&__label {
|
|
395
|
-
@include flex(row);
|
|
396
|
-
align-items: center;
|
|
397
|
-
text-align: left;
|
|
398
|
-
font-size: 14px;
|
|
399
|
-
color: #606266;
|
|
400
|
-
height: 40px;
|
|
401
|
-
padding: 0 12px 0 0;
|
|
402
|
-
/* #ifndef APP-NVUE */
|
|
403
|
-
vertical-align: middle;
|
|
404
|
-
flex: 0 0 auto;
|
|
405
|
-
box-sizing: border-box;
|
|
406
|
-
/* #endif */
|
|
407
|
-
|
|
408
|
-
&.no-label {
|
|
409
|
-
padding: 0;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
&__content {
|
|
414
|
-
/* #ifndef MP-TOUTIAO */
|
|
415
|
-
// display: flex;
|
|
416
|
-
// align-items: center;
|
|
417
|
-
/* #endif */
|
|
418
|
-
position: relative;
|
|
419
|
-
font-size: 14px;
|
|
420
|
-
flex: 1;
|
|
421
|
-
/* #ifndef APP-NVUE */
|
|
422
|
-
box-sizing: border-box;
|
|
423
|
-
/* #endif */
|
|
424
|
-
flex-direction: row;
|
|
425
|
-
|
|
426
|
-
/* #ifndef APP || H5 || MP-WEIXIN || APP-NVUE */
|
|
427
|
-
// 因为小程序平台会多一层标签节点 ,所以需要在多余节点继承当前样式
|
|
428
|
-
&>fu-easyinput,
|
|
429
|
-
&>fu-data-picker {
|
|
430
|
-
width: 100%;
|
|
431
|
-
}
|
|
432
|
-
/* #endif */
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
& .fu-form-item__nuve-content {
|
|
436
|
-
@include flex(column);
|
|
437
|
-
flex: 1;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
&__error {
|
|
441
|
-
color: #f56c6c;
|
|
442
|
-
font-size: 12px;
|
|
443
|
-
line-height: 1;
|
|
444
|
-
padding-top: 4px;
|
|
445
|
-
position: absolute;
|
|
446
|
-
/* #ifndef APP-NVUE */
|
|
447
|
-
top: 100%;
|
|
448
|
-
left: 0;
|
|
449
|
-
transition: transform 0.3s;
|
|
450
|
-
transform: translateY(-100%);
|
|
451
|
-
/* #endif */
|
|
452
|
-
/* #ifdef APP-NVUE */
|
|
453
|
-
bottom: 5px;
|
|
454
|
-
/* #endif */
|
|
455
|
-
|
|
456
|
-
opacity: 0;
|
|
457
|
-
|
|
458
|
-
.error-text {
|
|
459
|
-
// 只有 nvue 下这个样式才生效
|
|
460
|
-
color: #f56c6c;
|
|
461
|
-
font-size: 12px;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
&.msg--active {
|
|
465
|
-
opacity: 1;
|
|
466
|
-
transform: translateY(0%);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
// 位置修饰样式
|
|
471
|
-
&.is-direction-left {
|
|
472
|
-
flex-direction: row;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
&.is-direction-top {
|
|
476
|
-
flex-direction: column;
|
|
477
|
-
|
|
478
|
-
.fu-form-item__label {
|
|
479
|
-
padding: 0 0 8px;
|
|
480
|
-
text-align: left;
|
|
481
|
-
/* #ifndef APP-NVUE */
|
|
482
|
-
white-space: initial;
|
|
483
|
-
/* #endif */
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
.is-required {
|
|
488
|
-
color: #dd524d;
|
|
489
|
-
font-weight: bold;
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
.fu-form-item--border {
|
|
495
|
-
margin-bottom: 0;
|
|
496
|
-
padding: 10px 0;
|
|
497
|
-
border-top: 1px #eeeeee solid;
|
|
498
|
-
|
|
499
|
-
/* #ifndef APP-NVUE */
|
|
500
|
-
.fu-form-item__content {
|
|
501
|
-
flex-direction: column;
|
|
502
|
-
justify-content: flex-start;
|
|
503
|
-
align-items: flex-start;
|
|
504
|
-
|
|
505
|
-
.fu-form-item__error {
|
|
506
|
-
position: relative;
|
|
507
|
-
top: 5px;
|
|
508
|
-
left: 0;
|
|
509
|
-
padding-top: 0;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
/* #endif */
|
|
513
|
-
|
|
514
|
-
/* #ifdef APP-NVUE */
|
|
515
|
-
@include flex(column);
|
|
516
|
-
|
|
517
|
-
.fu-form-item__error {
|
|
518
|
-
position: relative;
|
|
519
|
-
top: 0px;
|
|
520
|
-
left: 0;
|
|
521
|
-
padding-top: 0;
|
|
522
|
-
margin-top: 5px;
|
|
523
|
-
}
|
|
524
|
-
/* #endif */
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
.is-first-border {
|
|
528
|
-
/* #ifndef APP-NVUE */
|
|
529
|
-
border: none;
|
|
530
|
-
/* #endif */
|
|
531
|
-
/* #ifdef APP-NVUE */
|
|
532
|
-
border-width: 0;
|
|
533
|
-
/* #endif */
|
|
534
|
-
}
|
|
535
|
-
</style>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
props: {
|
|
3
|
-
/**
|
|
4
|
-
* @description 表单校验规则
|
|
5
|
-
* @default null
|
|
6
|
-
*/
|
|
7
|
-
rules: {
|
|
8
|
-
type: Array,
|
|
9
|
-
default () {
|
|
10
|
-
return null
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
/**
|
|
14
|
-
* @description 表单域的属性名,在使用校验规则时必填
|
|
15
|
-
*/
|
|
16
|
-
prop: {
|
|
17
|
-
type: [String, Array],
|
|
18
|
-
default: ''
|
|
19
|
-
},
|
|
20
|
-
/**
|
|
21
|
-
* @description 是否必填,左边显示红色"*"号
|
|
22
|
-
* @default false
|
|
23
|
-
*/
|
|
24
|
-
required: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false
|
|
27
|
-
},
|
|
28
|
-
/**
|
|
29
|
-
* @description 输入框左边的文字提示
|
|
30
|
-
*/
|
|
31
|
-
label: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: ''
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* @description label的宽度
|
|
37
|
-
*/
|
|
38
|
-
labelWidth: {
|
|
39
|
-
type: [String, Number],
|
|
40
|
-
default: ''
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* @description label 居中方式
|
|
44
|
-
* @values 'left' - 左对齐, 'center' - 居中, 'right' - 右对齐
|
|
45
|
-
* @default 'left'
|
|
46
|
-
*/
|
|
47
|
-
labelAlign: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: 'left'
|
|
50
|
-
},
|
|
51
|
-
/**
|
|
52
|
-
* @description 强制显示错误信息
|
|
53
|
-
*/
|
|
54
|
-
message: {
|
|
55
|
-
type: [String, Boolean],
|
|
56
|
-
default: ''
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* @description label的文字的位置,优先级高于fu-form组件中的labelPosition
|
|
60
|
-
*/
|
|
61
|
-
labelPosition: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: ''
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="fu-grid-wrap">
|
|
3
|
-
<view
|
|
4
|
-
:id="elId"
|
|
5
|
-
ref="fu-grid"
|
|
6
|
-
class="fu-grid"
|
|
7
|
-
:class="{ 'fu-grid--border': showBorder }"
|
|
8
|
-
:style="{ 'border-left-color': borderColor}">
|
|
9
|
-
<slot />
|
|
10
|
-
</view>
|
|
11
|
-
</view>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
16
|
-
import mixin from '../../libs/mixin/mixin.js'
|
|
17
|
-
import props from './props.js'
|
|
18
|
-
// #ifdef APP-NVUE
|
|
19
|
-
const dom = uni.requireNativePlugin('dom')
|
|
20
|
-
// #endif
|
|
21
|
-
/**
|
|
22
|
-
* Grid 宫格
|
|
23
|
-
* @description 此组件一般用于同时展示多个同类项目的场景,可以给宫格的项目设置徽标组件(badge),或者图标等,也可以扩展为左右滑动的轮播形式
|
|
24
|
-
* @property {Number} column 宫格的列数
|
|
25
|
-
* @property {String} borderColor 边框颜色
|
|
26
|
-
* @property {Boolean} showBorder = [true|false] 是否显示边框(默认 true)
|
|
27
|
-
* @property {Boolean} square = [true|false] 是否方形显示(默认 true)
|
|
28
|
-
* @property {Boolean} highlight = [true|false] 点击背景是否高亮(默认 true)
|
|
29
|
-
* @event {Function} change 点击 grid 触发,e={detail:{index:0}},index 为当前点击 gird 下标
|
|
30
|
-
*/
|
|
31
|
-
export default {
|
|
32
|
-
name: 'FuGrid',
|
|
33
|
-
emits:['change'],
|
|
34
|
-
mixins: [mpMixin, mixin, props],
|
|
35
|
-
provide() {
|
|
36
|
-
return {
|
|
37
|
-
grid: this
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
data() {
|
|
41
|
-
const elId = this.$fu.uuid();
|
|
42
|
-
return {
|
|
43
|
-
elId,
|
|
44
|
-
width: 0
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
created() {
|
|
48
|
-
this.children = [];
|
|
49
|
-
},
|
|
50
|
-
mounted() {
|
|
51
|
-
this.init()
|
|
52
|
-
},
|
|
53
|
-
methods: {
|
|
54
|
-
init() {
|
|
55
|
-
this.$nextTick(() => {
|
|
56
|
-
this.getSize((width) => {
|
|
57
|
-
this.children.forEach(item => item.width = width)
|
|
58
|
-
})
|
|
59
|
-
})
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
change(e) {
|
|
63
|
-
this.$emit('change', e)
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
getSize(fn) {
|
|
67
|
-
// #ifndef APP-NVUE
|
|
68
|
-
this.$fuGetRect(`#${this.elId}`).then(res => {
|
|
69
|
-
this.width = parseInt((res.width - 1) / this.column) + 'px';
|
|
70
|
-
fn(this.width)
|
|
71
|
-
})
|
|
72
|
-
// #endif
|
|
73
|
-
// #ifdef APP-NVUE
|
|
74
|
-
dom.getComponentRect(this.$refs['fu-grid'], (res) => {
|
|
75
|
-
this.width = parseInt((res.size.width - 1) / this.column) + 'px';
|
|
76
|
-
fn(this.width)
|
|
77
|
-
})
|
|
78
|
-
// #endif
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
</script>
|
|
83
|
-
|
|
84
|
-
<style lang="scss" scoped>
|
|
85
|
-
@import '../../libs/style/components.scss';
|
|
86
|
-
$border-color: #D2D2D2;
|
|
87
|
-
|
|
88
|
-
.fu-grid-wrap {
|
|
89
|
-
@include flex(column);
|
|
90
|
-
flex: 1;
|
|
91
|
-
/* #ifdef H5 */
|
|
92
|
-
width: 100%;
|
|
93
|
-
/* #endif */
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.fu-grid {
|
|
97
|
-
@include flex(row);
|
|
98
|
-
flex-wrap: wrap;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.fu-grid--border {
|
|
102
|
-
position: relative;
|
|
103
|
-
/* #ifdef APP-NVUE */
|
|
104
|
-
border-left-color: $border-color;
|
|
105
|
-
border-left-style: solid;
|
|
106
|
-
border-left-width: 0.5px;
|
|
107
|
-
/* #endif */
|
|
108
|
-
/* #ifndef APP-NVUE */
|
|
109
|
-
z-index: 1;
|
|
110
|
-
border-left: 1px solid $border-color;
|
|
111
|
-
/* #endif */
|
|
112
|
-
}
|
|
113
|
-
</style>
|