stellar-ui-plus 1.16.18
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/README.md +176 -0
- package/common/css/common.scss +19 -0
- package/common/useProps.js +9 -0
- package/components/ste-animate/ATTRIBUTES.md +10 -0
- package/components/ste-animate/README.md +115 -0
- package/components/ste-animate/animate.scss +247 -0
- package/components/ste-animate/config.json +5 -0
- package/components/ste-animate/props.ts +9 -0
- package/components/ste-animate/ste-animate.easycom.json +39 -0
- package/components/ste-animate/ste-animate.scss +113 -0
- package/components/ste-animate/ste-animate.vue +67 -0
- package/components/ste-badge/ATTRIBUTES.md +17 -0
- package/components/ste-badge/README.md +162 -0
- package/components/ste-badge/config.json +5 -0
- package/components/ste-badge/props.ts +17 -0
- package/components/ste-badge/ste-badge.easycom.json +96 -0
- package/components/ste-badge/ste-badge.vue +157 -0
- package/components/ste-barcode/ATTRIBUTES.md +14 -0
- package/components/ste-barcode/README.md +28 -0
- package/components/ste-barcode/config.json +5 -0
- package/components/ste-barcode/encode.ts +317 -0
- package/components/ste-barcode/props.ts +7 -0
- package/components/ste-barcode/ste-barcode.easycom.json +44 -0
- package/components/ste-barcode/ste-barcode.vue +152 -0
- package/components/ste-button/ATTRIBUTES.md +32 -0
- package/components/ste-button/README.md +119 -0
- package/components/ste-button/config.json +5 -0
- package/components/ste-button/props.ts +21 -0
- package/components/ste-button/ste-button.easycom.json +168 -0
- package/components/ste-button/ste-button.vue +275 -0
- package/components/ste-calendar/ATTRIBUTES.md +31 -0
- package/components/ste-calendar/README.md +241 -0
- package/components/ste-calendar/config.json +5 -0
- package/components/ste-calendar/date.ts +110 -0
- package/components/ste-calendar/props.ts +26 -0
- package/components/ste-calendar/ste-calendar.easycom.json +172 -0
- package/components/ste-calendar/ste-calendar.vue +376 -0
- package/components/ste-calendar/useData.ts +30 -0
- package/components/ste-checkbox/ATTRIBUTES.md +25 -0
- package/components/ste-checkbox/README.md +302 -0
- package/components/ste-checkbox/config.json +5 -0
- package/components/ste-checkbox/props.ts +33 -0
- package/components/ste-checkbox/ste-checkbox.easycom.json +151 -0
- package/components/ste-checkbox/ste-checkbox.vue +206 -0
- package/components/ste-checkbox/type.d.ts +2 -0
- package/components/ste-checkbox-group/props.ts +34 -0
- package/components/ste-checkbox-group/ste-checkbox-group.vue +34 -0
- package/components/ste-code-input/ATTRIBUTES.md +22 -0
- package/components/ste-code-input/README.md +56 -0
- package/components/ste-code-input/config.json +5 -0
- package/components/ste-code-input/props.ts +19 -0
- package/components/ste-code-input/ste-code-input.easycom.json +99 -0
- package/components/ste-code-input/ste-code-input.vue +222 -0
- package/components/ste-date-picker/ATTRIBUTES.md +25 -0
- package/components/ste-date-picker/README.md +119 -0
- package/components/ste-date-picker/config.json +5 -0
- package/components/ste-date-picker/props.ts +62 -0
- package/components/ste-date-picker/ste-date-picker.easycom.json +137 -0
- package/components/ste-date-picker/ste-date-picker.vue +290 -0
- package/components/ste-date-picker/types.d.ts +3 -0
- package/components/ste-drag/ATTRIBUTES.md +13 -0
- package/components/ste-drag/README.md +88 -0
- package/components/ste-drag/config.json +5 -0
- package/components/ste-drag/props.ts +10 -0
- package/components/ste-drag/ste-drag.easycom.json +50 -0
- package/components/ste-drag/ste-drag.vue +172 -0
- package/components/ste-dropdown-menu/ATTRIBUTES.md +22 -0
- package/components/ste-dropdown-menu/README.md +325 -0
- package/components/ste-dropdown-menu/config.json +5 -0
- package/components/ste-dropdown-menu/constans.ts +4 -0
- package/components/ste-dropdown-menu/props.ts +30 -0
- package/components/ste-dropdown-menu/ste-dropdown-menu.easycom.json +111 -0
- package/components/ste-dropdown-menu/ste-dropdown-menu.scss +99 -0
- package/components/ste-dropdown-menu/ste-dropdown-menu.vue +223 -0
- package/components/ste-dropdown-menu-item/props.ts +17 -0
- package/components/ste-dropdown-menu-item/ste-dropdown-menu-item.scss +61 -0
- package/components/ste-dropdown-menu-item/ste-dropdown-menu-item.vue +84 -0
- package/components/ste-dropdown-menu-item/type.d.ts +4 -0
- package/components/ste-icon/ATTRIBUTES.md +19 -0
- package/components/ste-icon/README.md +72 -0
- package/components/ste-icon/config.json +5 -0
- package/components/ste-icon/iconfont.css +22 -0
- package/components/ste-icon/props.ts +14 -0
- package/components/ste-icon/ste-icon.easycom.json +71 -0
- package/components/ste-icon/ste-icon.vue +80 -0
- package/components/ste-image/ATTRIBUTES.md +21 -0
- package/components/ste-image/README.md +118 -0
- package/components/ste-image/config.json +5 -0
- package/components/ste-image/props.ts +15 -0
- package/components/ste-image/ste-image.easycom.json +189 -0
- package/components/ste-image/ste-image.vue +146 -0
- package/components/ste-index-item/props.ts +4 -0
- package/components/ste-index-item/ste-index-item.vue +83 -0
- package/components/ste-index-list/ATTRIBUTES.md +15 -0
- package/components/ste-index-list/README.md +138 -0
- package/components/ste-index-list/config.json +5 -0
- package/components/ste-index-list/props.ts +17 -0
- package/components/ste-index-list/ste-index-list.easycom.json +48 -0
- package/components/ste-index-list/ste-index-list.vue +109 -0
- package/components/ste-input/ATTRIBUTES.md +37 -0
- package/components/ste-input/README.md +130 -0
- package/components/ste-input/config.json +5 -0
- package/components/ste-input/props.ts +46 -0
- package/components/ste-input/ste-input.easycom.json +282 -0
- package/components/ste-input/ste-input.scss +124 -0
- package/components/ste-input/ste-input.vue +221 -0
- package/components/ste-loading/ATTRIBUTES.md +11 -0
- package/components/ste-loading/README.md +74 -0
- package/components/ste-loading/config.json +5 -0
- package/components/ste-loading/props.ts +8 -0
- package/components/ste-loading/ste-loading.easycom.json +54 -0
- package/components/ste-loading/ste-loading.vue +127 -0
- package/components/ste-media-preview/ATTRIBUTES.md +20 -0
- package/components/ste-media-preview/README.md +252 -0
- package/components/ste-media-preview/TouchScaleing.ts +117 -0
- package/components/ste-media-preview/config.json +5 -0
- package/components/ste-media-preview/props.ts +12 -0
- package/components/ste-media-preview/ste-media-preview.easycom.json +88 -0
- package/components/ste-media-preview/ste-media-preview.vue +201 -0
- package/components/ste-media-preview/useData.ts +63 -0
- package/components/ste-message-box/ATTRIBUTES.md +6 -0
- package/components/ste-message-box/README.md +222 -0
- package/components/ste-message-box/config.json +5 -0
- package/components/ste-message-box/constants.ts +25 -0
- package/components/ste-message-box/ste-message-box.easycom.json +14 -0
- package/components/ste-message-box/ste-message-box.ts +1 -0
- package/components/ste-message-box/ste-message-box.vue +355 -0
- package/components/ste-message-box/use-message-box.ts +26 -0
- package/components/ste-message-box/useData.ts +56 -0
- package/components/ste-notice-bar/ATTRIBUTES.md +22 -0
- package/components/ste-notice-bar/README.md +124 -0
- package/components/ste-notice-bar/config.json +5 -0
- package/components/ste-notice-bar/props.ts +15 -0
- package/components/ste-notice-bar/ste-notice-bar.easycom.json +109 -0
- package/components/ste-notice-bar/ste-notice-bar.vue +262 -0
- package/components/ste-number-keyboard/ATTRIBUTES.md +31 -0
- package/components/ste-number-keyboard/KeyboardVue.vue +142 -0
- package/components/ste-number-keyboard/README.md +192 -0
- package/components/ste-number-keyboard/config.json +5 -0
- package/components/ste-number-keyboard/props.ts +35 -0
- package/components/ste-number-keyboard/ste-number-keyboard.easycom.json +177 -0
- package/components/ste-number-keyboard/ste-number-keyboard.vue +81 -0
- package/components/ste-number-keyboard/useData.ts +144 -0
- package/components/ste-picker/props.ts +16 -0
- package/components/ste-picker/ste-picker.vue +194 -0
- package/components/ste-popup/ATTRIBUTES.md +24 -0
- package/components/ste-popup/README.md +135 -0
- package/components/ste-popup/config.json +6 -0
- package/components/ste-popup/event.ts +0 -0
- package/components/ste-popup/props.ts +19 -0
- package/components/ste-popup/ste-popup.easycom.json +122 -0
- package/components/ste-popup/ste-popup.vue +253 -0
- package/components/ste-price/ATTRIBUTES.md +26 -0
- package/components/ste-price/README.md +110 -0
- package/components/ste-price/config.json +5 -0
- package/components/ste-price/props.ts +23 -0
- package/components/ste-price/ste-price.easycom.json +154 -0
- package/components/ste-price/ste-price.vue +148 -0
- package/components/ste-progress/ATTRIBUTES.md +17 -0
- package/components/ste-progress/README.md +88 -0
- package/components/ste-progress/config.json +5 -0
- package/components/ste-progress/props.ts +16 -0
- package/components/ste-progress/ste-progress.easycom.json +80 -0
- package/components/ste-progress/ste-progress.vue +135 -0
- package/components/ste-qrcode/ATTRIBUTES.md +16 -0
- package/components/ste-qrcode/README.md +34 -0
- package/components/ste-qrcode/config.json +5 -0
- package/components/ste-qrcode/props.ts +16 -0
- package/components/ste-qrcode/ste-qrcode.easycom.json +56 -0
- package/components/ste-qrcode/ste-qrcode.vue +134 -0
- package/components/ste-qrcode/uqrcode.d.ts +57 -0
- package/components/ste-qrcode/uqrcode.js +34 -0
- package/components/ste-radio/ATTRIBUTES.md +25 -0
- package/components/ste-radio/README.md +260 -0
- package/components/ste-radio/config.json +5 -0
- package/components/ste-radio/props.ts +33 -0
- package/components/ste-radio/ste-radio.easycom.json +150 -0
- package/components/ste-radio/ste-radio.vue +188 -0
- package/components/ste-radio/type.d.ts +2 -0
- package/components/ste-radio-group/props.ts +33 -0
- package/components/ste-radio-group/ste-radio-group.vue +34 -0
- package/components/ste-rate/ATTRIBUTES.md +21 -0
- package/components/ste-rate/README.md +97 -0
- package/components/ste-rate/config.json +5 -0
- package/components/ste-rate/props.ts +16 -0
- package/components/ste-rate/ste-rate.easycom.json +85 -0
- package/components/ste-rate/ste-rate.vue +143 -0
- package/components/ste-read-more/ATTRIBUTES.md +16 -0
- package/components/ste-read-more/README.md +93 -0
- package/components/ste-read-more/config.json +5 -0
- package/components/ste-read-more/props.ts +9 -0
- package/components/ste-read-more/ste-read-more.easycom.json +54 -0
- package/components/ste-read-more/ste-read-more.vue +106 -0
- package/components/ste-rich-text/ATTRIBUTES.md +8 -0
- package/components/ste-rich-text/README.md +26 -0
- package/components/ste-rich-text/config.json +5 -0
- package/components/ste-rich-text/props.ts +8 -0
- package/components/ste-rich-text/ste-rich-text.easycom.json +40 -0
- package/components/ste-rich-text/ste-rich-text.vue +33 -0
- package/components/ste-scroll-to/ATTRIBUTES.md +11 -0
- package/components/ste-scroll-to/README.md +47 -0
- package/components/ste-scroll-to/config.json +5 -0
- package/components/ste-scroll-to/props.ts +17 -0
- package/components/ste-scroll-to/ste-scroll-to.easycom.json +25 -0
- package/components/ste-scroll-to/ste-scroll-to.vue +42 -0
- package/components/ste-scroll-to/useData.ts +214 -0
- package/components/ste-scroll-to-item/ste-scroll-to-item.vue +24 -0
- package/components/ste-search/ATTRIBUTES.md +39 -0
- package/components/ste-search/README.md +232 -0
- package/components/ste-search/config.json +5 -0
- package/components/ste-search/props.ts +124 -0
- package/components/ste-search/ste-search.easycom.json +232 -0
- package/components/ste-search/ste-search.vue +379 -0
- package/components/ste-search/useData.ts +34 -0
- package/components/ste-select/ATTRIBUTES.md +39 -0
- package/components/ste-select/README.md +324 -0
- package/components/ste-select/config.json +5 -0
- package/components/ste-select/datapager.vue +54 -0
- package/components/ste-select/datetime.vue +109 -0
- package/components/ste-select/defaultDate.ts +138 -0
- package/components/ste-select/props.ts +67 -0
- package/components/ste-select/ste-select.easycom.json +287 -0
- package/components/ste-select/ste-select.vue +437 -0
- package/components/ste-select/useData.ts +471 -0
- package/components/ste-signature/ATTRIBUTES.md +18 -0
- package/components/ste-signature/README.md +97 -0
- package/components/ste-signature/config.json +5 -0
- package/components/ste-signature/props.ts +12 -0
- package/components/ste-signature/ste-signature.easycom.json +74 -0
- package/components/ste-signature/ste-signature.vue +183 -0
- package/components/ste-signature/types.d.ts +4 -0
- package/components/ste-slider/ATTRIBUTES.md +25 -0
- package/components/ste-slider/README.md +149 -0
- package/components/ste-slider/config.json +5 -0
- package/components/ste-slider/props.ts +32 -0
- package/components/ste-slider/ste-slider.easycom.json +128 -0
- package/components/ste-slider/ste-slider.scss +150 -0
- package/components/ste-slider/ste-slider.vue +293 -0
- package/components/ste-slider/type.d.ts +4 -0
- package/components/ste-slider/useData.ts +79 -0
- package/components/ste-step/props.ts +10 -0
- package/components/ste-step/ste-step.scss +104 -0
- package/components/ste-step/ste-step.vue +122 -0
- package/components/ste-stepper/ATTRIBUTES.md +33 -0
- package/components/ste-stepper/README.md +172 -0
- package/components/ste-stepper/config.json +5 -0
- package/components/ste-stepper/props.ts +41 -0
- package/components/ste-stepper/ste-stepper.easycom.json +220 -0
- package/components/ste-stepper/ste-stepper.vue +249 -0
- package/components/ste-steps/ATTRIBUTES.md +12 -0
- package/components/ste-steps/README.md +139 -0
- package/components/ste-steps/config.json +5 -0
- package/components/ste-steps/props.ts +18 -0
- package/components/ste-steps/ste-steps.easycom.json +46 -0
- package/components/ste-steps/ste-steps.vue +44 -0
- package/components/ste-sticky/ATTRIBUTES.md +15 -0
- package/components/ste-sticky/README.md +56 -0
- package/components/ste-sticky/config.json +5 -0
- package/components/ste-sticky/props.ts +7 -0
- package/components/ste-sticky/ste-sticky.easycom.json +48 -0
- package/components/ste-sticky/ste-sticky.vue +88 -0
- package/components/ste-swipe-action/ATTRIBUTES.md +16 -0
- package/components/ste-swipe-action/README.md +195 -0
- package/components/ste-swipe-action/config.json +5 -0
- package/components/ste-swipe-action/props.ts +23 -0
- package/components/ste-swipe-action/ste-swipe-action.easycom.json +74 -0
- package/components/ste-swipe-action/ste-swipe-action.vue +138 -0
- package/components/ste-swipe-action/useData.ts +204 -0
- package/components/ste-swipe-action-group/ATTRIBUTES.md +17 -0
- package/components/ste-swipe-action-group/props.ts +22 -0
- package/components/ste-swipe-action-group/ste-swipe-action-group.easycom.json +90 -0
- package/components/ste-swipe-action-group/ste-swipe-action-group.vue +57 -0
- package/components/ste-swiper/ATTRIBUTES.md +24 -0
- package/components/ste-swiper/README.md +156 -0
- package/components/ste-swiper/config.json +5 -0
- package/components/ste-swiper/props.ts +41 -0
- package/components/ste-swiper/ste-swiper.easycom.json +123 -0
- package/components/ste-swiper/ste-swiper.vue +98 -0
- package/components/ste-swiper/useData.ts +365 -0
- package/components/ste-swiper-item/ste-swiper-item.vue +41 -0
- package/components/ste-switch/ATTRIBUTES.md +17 -0
- package/components/ste-switch/README.md +105 -0
- package/components/ste-switch/config.json +5 -0
- package/components/ste-switch/props.ts +9 -0
- package/components/ste-switch/ste-switch.easycom.json +60 -0
- package/components/ste-switch/ste-switch.vue +96 -0
- package/components/ste-tab/ATTRIBUTES.md +14 -0
- package/components/ste-tab/props.ts +25 -0
- package/components/ste-tab/ste-tab.easycom.json +56 -0
- package/components/ste-tab/ste-tab.vue +26 -0
- package/components/ste-table/ATTRIBUTES.md +41 -0
- package/components/ste-table/README.md +638 -0
- package/components/ste-table/config.json +5 -0
- package/components/ste-table/props.ts +72 -0
- package/components/ste-table/ste-table.easycom.json +188 -0
- package/components/ste-table/ste-table.vue +427 -0
- package/components/ste-table/types.d.ts +3 -0
- package/components/ste-table/useData.ts +233 -0
- package/components/ste-table/utils.ts +11 -0
- package/components/ste-table-column/checkbox-icon.vue +35 -0
- package/components/ste-table-column/common.scss +52 -0
- package/components/ste-table-column/props.ts +18 -0
- package/components/ste-table-column/radio-icon.vue +99 -0
- package/components/ste-table-column/ste-table-column.vue +169 -0
- package/components/ste-table-column/var.scss +1 -0
- package/components/ste-tabs/ATTRIBUTES.md +52 -0
- package/components/ste-tabs/README.md +165 -0
- package/components/ste-tabs/config.json +5 -0
- package/components/ste-tabs/props.ts +133 -0
- package/components/ste-tabs/ste-tabs.easycom.json +278 -0
- package/components/ste-tabs/ste-tabs.vue +447 -0
- package/components/ste-tabs/useData.ts +364 -0
- package/components/ste-text/ATTRIBUTES.md +9 -0
- package/components/ste-text/README.md +58 -0
- package/components/ste-text/config.json +6 -0
- package/components/ste-text/props.ts +10 -0
- package/components/ste-text/ste-text.easycom.json +30 -0
- package/components/ste-text/ste-text.vue +46 -0
- package/components/ste-toast/ATTRIBUTES.md +15 -0
- package/components/ste-toast/README.md +222 -0
- package/components/ste-toast/config.json +5 -0
- package/components/ste-toast/props.ts +7 -0
- package/components/ste-toast/ste-toast.easycom.json +73 -0
- package/components/ste-toast/ste-toast.vue +209 -0
- package/components/ste-toast/use-toast.ts +26 -0
- package/components/ste-touch-swipe/ATTRIBUTES.md +18 -0
- package/components/ste-touch-swipe/README.md +89 -0
- package/components/ste-touch-swipe/TouchEvent.ts +79 -0
- package/components/ste-touch-swipe/config.json +5 -0
- package/components/ste-touch-swipe/props.ts +23 -0
- package/components/ste-touch-swipe/ste-touch-swipe.easycom.json +83 -0
- package/components/ste-touch-swipe/ste-touch-swipe.vue +283 -0
- package/components/ste-touch-swipe/useData.ts +51 -0
- package/components/ste-touch-swipe-item/ste-touch-swipe-item.vue +32 -0
- package/components/ste-tour/ATTRIBUTES.md +26 -0
- package/components/ste-tour/README.md +134 -0
- package/components/ste-tour/config.json +5 -0
- package/components/ste-tour/props.ts +45 -0
- package/components/ste-tour/ste-tour.easycom.json +120 -0
- package/components/ste-tour/ste-tour.vue +152 -0
- package/components/ste-tour/useData.ts +220 -0
- package/components/ste-tree/ATTRIBUTES.md +19 -0
- package/components/ste-tree/README.md +217 -0
- package/components/ste-tree/config.json +5 -0
- package/components/ste-tree/props.ts +24 -0
- package/components/ste-tree/ste-tree.easycom.json +106 -0
- package/components/ste-tree/ste-tree.vue +140 -0
- package/components/ste-tree/useData.ts +219 -0
- package/components/ste-upload/ATTRIBUTES.md +35 -0
- package/components/ste-upload/README.md +208 -0
- package/components/ste-upload/ReadFile.ts +305 -0
- package/components/ste-upload/config.json +5 -0
- package/components/ste-upload/props.ts +25 -0
- package/components/ste-upload/ste-upload.easycom.json +267 -0
- package/components/ste-upload/ste-upload.vue +386 -0
- package/components/ste-upload/useData.ts +46 -0
- package/components/ste-video/ATTRIBUTES.md +34 -0
- package/components/ste-video/README.md +48 -0
- package/components/ste-video/config.json +5 -0
- package/components/ste-video/props.ts +86 -0
- package/components/ste-video/ste-video.easycom.json +226 -0
- package/components/ste-video/ste-video.scss +201 -0
- package/components/ste-video/ste-video.vue +390 -0
- package/components/ste-video/types.d.ts +4 -0
- package/components/ste-video/useData.ts +140 -0
- package/composables.ts +2 -0
- package/config/color.ts +16 -0
- package/config/index.ts +48 -0
- package/index.ts +118 -0
- package/package.json +22 -0
- package/store/color.ts +24 -0
- package/store/index.ts +12 -0
- package/store/message-box.ts +54 -0
- package/store/toast.ts +50 -0
- package/types/components.d.ts +124 -0
- package/types/event.d.ts +51 -0
- package/types/index.d.ts +112 -0
- package/types/refComponents.d.ts +118 -0
- package/utils/Color.ts +66 -0
- package/utils/System.ts +114 -0
- package/utils/mixin.ts +122 -0
- package/utils/utils.ts +520 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ste-search",
|
|
3
|
+
"description": "搜索",
|
|
4
|
+
"example": "<ste-search />",
|
|
5
|
+
"tutorial": "https://stellar-ui.intecloud.com.cn/plus/#/?active=search",
|
|
6
|
+
"attributes": [
|
|
7
|
+
{
|
|
8
|
+
"name": "type",
|
|
9
|
+
"description": "组件类型",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"values": [
|
|
12
|
+
{
|
|
13
|
+
"name": "default",
|
|
14
|
+
"description": "正常搜索"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "nav",
|
|
18
|
+
"description": "导航栏"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"default": "default"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "modelValue",
|
|
25
|
+
"description": "当前值(支持v-model双向绑定)",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"default": ""
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "placeholder",
|
|
31
|
+
"description": "占位提示符",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"default": ""
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "hotWords",
|
|
37
|
+
"description": "热词列表",
|
|
38
|
+
"type": "string[]",
|
|
39
|
+
"default": "[]"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "interval",
|
|
43
|
+
"description": "热词列表自动切换时间间隔",
|
|
44
|
+
"type": "number",
|
|
45
|
+
"default": 3000
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "autoplay",
|
|
49
|
+
"description": "热词列表是否自动切换",
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"default": "true"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "disabled",
|
|
55
|
+
"description": "是否禁用状态",
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"default": "false"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "hiddenLine",
|
|
61
|
+
"description": "是否隐藏分割线",
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"default": "false"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "hiddenBtn",
|
|
67
|
+
"description": "是否隐藏搜索按钮",
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"default": "false"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "btnText",
|
|
73
|
+
"description": "搜索按钮文字",
|
|
74
|
+
"type": "string",
|
|
75
|
+
"default": "搜索"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "hiddenInput",
|
|
79
|
+
"description": "是否隐藏输入框",
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"default": "false"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "clearable",
|
|
85
|
+
"description": "是否可清空",
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"default": "true"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "borderColor",
|
|
91
|
+
"description": "边框颜色",
|
|
92
|
+
"type": "string",
|
|
93
|
+
"default": "#dddddd"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "background",
|
|
97
|
+
"description": "背景",
|
|
98
|
+
"type": "string",
|
|
99
|
+
"default": "#ffffff"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "prefixIconColor",
|
|
103
|
+
"description": "前置图标颜色",
|
|
104
|
+
"type": "string",
|
|
105
|
+
"default": "#bbbbbb"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "placeholderColor",
|
|
109
|
+
"description": "占位符字体颜色",
|
|
110
|
+
"type": "string",
|
|
111
|
+
"default": "#bbbbbb"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "inputTextColor",
|
|
115
|
+
"description": "输入框文字颜色",
|
|
116
|
+
"type": "string",
|
|
117
|
+
"default": "#000000"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "clearIconColor",
|
|
121
|
+
"description": "清除图标颜色",
|
|
122
|
+
"type": "string",
|
|
123
|
+
"default": "#bbbbbb"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "btnTextColor",
|
|
127
|
+
"description": "搜索按钮文字颜色",
|
|
128
|
+
"type": "string",
|
|
129
|
+
"default": "#0090FF"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "btnBackground",
|
|
133
|
+
"description": "搜索按钮背景",
|
|
134
|
+
"type": "string"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "height",
|
|
138
|
+
"description": "高度,单位rpx",
|
|
139
|
+
"type": "number",
|
|
140
|
+
"default": 64
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "radius",
|
|
144
|
+
"description": "圆角弧度,单位rpx",
|
|
145
|
+
"type": "number",
|
|
146
|
+
"default": 32
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "focus",
|
|
150
|
+
"description": "是否聚焦(双向绑定)",
|
|
151
|
+
"type": "boolean",
|
|
152
|
+
"default": "false"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "suggestionsList",
|
|
156
|
+
"description": "搜索建议对应的数据",
|
|
157
|
+
"type": "array",
|
|
158
|
+
"default": "[]"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "[event]input",
|
|
162
|
+
"description": "输入事件",
|
|
163
|
+
"type": "(value: string) => void",
|
|
164
|
+
"params": [
|
|
165
|
+
{
|
|
166
|
+
"name": "value",
|
|
167
|
+
"description": "输入框的值"
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "[event]focus",
|
|
173
|
+
"description": "聚焦焦点事件",
|
|
174
|
+
"type": "(value: string) => void",
|
|
175
|
+
"params": [
|
|
176
|
+
{
|
|
177
|
+
"name": "value",
|
|
178
|
+
"description": "输入框的值"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "[event]blur",
|
|
184
|
+
"description": "失去焦点事件",
|
|
185
|
+
"type": "(value: string) => void",
|
|
186
|
+
"params": [
|
|
187
|
+
{
|
|
188
|
+
"name": "value",
|
|
189
|
+
"description": "输入框的值"
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "[event]search",
|
|
195
|
+
"description": "确定搜索时触发",
|
|
196
|
+
"type": "(value: string) => void",
|
|
197
|
+
"params": [
|
|
198
|
+
{
|
|
199
|
+
"name": "value",
|
|
200
|
+
"description": "输入框的值"
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "[event]clear",
|
|
206
|
+
"description": "点击清除按钮后触发",
|
|
207
|
+
"type": "() => void"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"name": "[event]click",
|
|
211
|
+
"description": "点击事件",
|
|
212
|
+
"type": "(value: string) => void",
|
|
213
|
+
"params": [
|
|
214
|
+
{
|
|
215
|
+
"name": "value",
|
|
216
|
+
"description": "输入框的值"
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "[event]selectSuggestion",
|
|
222
|
+
"description": "点击搜索建议触发",
|
|
223
|
+
"type": "(item: object) => void",
|
|
224
|
+
"params": [
|
|
225
|
+
{
|
|
226
|
+
"name": "item",
|
|
227
|
+
"description": "热词列表对象"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
}
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, watch, defineOptions, nextTick } from 'vue';
|
|
3
|
+
import type { SwiperOnChangeEvent } from '@uni-helper/uni-app-types';
|
|
4
|
+
import utils from '../../utils/utils';
|
|
5
|
+
import type { SearchSuggestion, Obj } from '../../types';
|
|
6
|
+
import useData from './useData';
|
|
7
|
+
import propsData from './props';
|
|
8
|
+
|
|
9
|
+
defineOptions({
|
|
10
|
+
name: 'ste-search',
|
|
11
|
+
options: {
|
|
12
|
+
virtualHost: true,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const props = defineProps(propsData);
|
|
17
|
+
const { dataValue, setDataValue, switchIndex, setSwitchIndex, cursorNumber, setCursorNumber, setShowSuggestionsBox, showSuggestionsBox } = useData();
|
|
18
|
+
|
|
19
|
+
const cmpRootStyle = computed(() => {
|
|
20
|
+
const style: Obj = {
|
|
21
|
+
'--search-root-height': utils.formatPx(props.height),
|
|
22
|
+
'--search-root-radius': utils.formatPx(props.radius),
|
|
23
|
+
'--search-btn-text-color': props.btnTextColor,
|
|
24
|
+
'--search-placeholder-color': props.placeholderColor,
|
|
25
|
+
'--search-input-color': props.inputTextColor,
|
|
26
|
+
'--search-border-color': props.borderColor,
|
|
27
|
+
background: props.background,
|
|
28
|
+
};
|
|
29
|
+
if (!props.hiddenBtn || !props.hiddenInput) {
|
|
30
|
+
style['padding'] = `0 ${utils.formatPx(8)} 0 ${utils.formatPx(16)}`;
|
|
31
|
+
}
|
|
32
|
+
return style;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const cmpPlaceholder = computed(() => (props.hotWords?.length ? '' : props.placeholder));
|
|
36
|
+
const cmpShowSwitch = computed(() => props.hotWords?.length && !dataValue.value);
|
|
37
|
+
const cmpbtnBackground = computed(() => ({ background: props.btnBackground }));
|
|
38
|
+
const cmpHiddenLine = computed(() => props.hiddenLine || props.hiddenBtn);
|
|
39
|
+
|
|
40
|
+
watch(() => props.modelValue, setDataValue, { immediate: true });
|
|
41
|
+
watch(
|
|
42
|
+
() => props.hotWords,
|
|
43
|
+
() => setSwitchIndex(0)
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const emits = defineEmits<{
|
|
47
|
+
(e: 'input', value: string): void;
|
|
48
|
+
(e: 'update:modelValue', value: string): void;
|
|
49
|
+
(e: 'focus', value: string): void;
|
|
50
|
+
(e: 'update:focus', bool: boolean): void;
|
|
51
|
+
(e: 'blur', value: string): void;
|
|
52
|
+
(e: 'search', value: string): void;
|
|
53
|
+
(e: 'click', value: string): void;
|
|
54
|
+
(e: 'clear'): void;
|
|
55
|
+
(e: 'selectSuggestion', item: SearchSuggestion): void;
|
|
56
|
+
}>();
|
|
57
|
+
|
|
58
|
+
const onInput = () => {
|
|
59
|
+
if (props.disabled) return;
|
|
60
|
+
nextTick(() => {
|
|
61
|
+
emits('input', dataValue.value);
|
|
62
|
+
emits('update:modelValue', dataValue.value);
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
const onSearch = () => {
|
|
66
|
+
if (props.disabled) return;
|
|
67
|
+
let searchValue = dataValue.value;
|
|
68
|
+
if (!searchValue && props.hotWords.length) {
|
|
69
|
+
searchValue = props.hotWords[switchIndex.value];
|
|
70
|
+
}
|
|
71
|
+
emits('search', searchValue);
|
|
72
|
+
};
|
|
73
|
+
const onFocus = () => {
|
|
74
|
+
if (props.disabled) return;
|
|
75
|
+
emits('focus', dataValue.value);
|
|
76
|
+
emits('update:focus', true);
|
|
77
|
+
setShowSuggestionsBox(true);
|
|
78
|
+
};
|
|
79
|
+
const onBlur = () => {
|
|
80
|
+
if (props.disabled) return;
|
|
81
|
+
emits('blur', dataValue.value);
|
|
82
|
+
emits('update:focus', false);
|
|
83
|
+
};
|
|
84
|
+
const onClear = () => {
|
|
85
|
+
if (props.disabled) return;
|
|
86
|
+
setDataValue('');
|
|
87
|
+
emits('input', '');
|
|
88
|
+
emits('update:modelValue', '');
|
|
89
|
+
emits('clear');
|
|
90
|
+
};
|
|
91
|
+
const onSwitchChange = (e: SwiperOnChangeEvent) => {
|
|
92
|
+
setSwitchIndex(e.detail.current);
|
|
93
|
+
};
|
|
94
|
+
const onClick = () => {
|
|
95
|
+
if (props.disabled) return;
|
|
96
|
+
let searchValue = dataValue.value;
|
|
97
|
+
if (!searchValue && props.hotWords.length) {
|
|
98
|
+
searchValue = props.hotWords[switchIndex.value];
|
|
99
|
+
}
|
|
100
|
+
emits('click', searchValue);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const handleSuggestionClick = (item: SearchSuggestion) => {
|
|
104
|
+
setDataValue(item.label);
|
|
105
|
+
emits('input', item.label);
|
|
106
|
+
emits('selectSuggestion', item);
|
|
107
|
+
setShowSuggestionsBox(false);
|
|
108
|
+
|
|
109
|
+
setTimeout(() => {
|
|
110
|
+
setCursorNumber(item.label.length);
|
|
111
|
+
}, 50);
|
|
112
|
+
};
|
|
113
|
+
</script>
|
|
114
|
+
<template>
|
|
115
|
+
<view class="ste-search-root" :class="{ disabled: props.disabled }" :style="[cmpRootStyle]" @click="onClick">
|
|
116
|
+
<view class="content">
|
|
117
|
+
<view class="icon-box">
|
|
118
|
+
<ste-icon code="" :color="prefixIconColor" size="44" />
|
|
119
|
+
</view>
|
|
120
|
+
<view class="input-box" v-if="!hiddenInput">
|
|
121
|
+
<ste-input
|
|
122
|
+
rootClass="ste-search-input"
|
|
123
|
+
placeholder-class="search-input-placeholder"
|
|
124
|
+
:disabled="props.disabled"
|
|
125
|
+
:placeholder="cmpPlaceholder"
|
|
126
|
+
v-model="dataValue"
|
|
127
|
+
@input="onInput"
|
|
128
|
+
@confirm="onSearch"
|
|
129
|
+
@focus="onFocus"
|
|
130
|
+
@blur="onBlur"
|
|
131
|
+
@clear="onClear"
|
|
132
|
+
:focus="focus"
|
|
133
|
+
:clearable="clearable"
|
|
134
|
+
:fontColor="inputTextColor"
|
|
135
|
+
background="transparent"
|
|
136
|
+
:cursor="cursorNumber"
|
|
137
|
+
/>
|
|
138
|
+
<swiper v-if="cmpShowSwitch" class="placeholder-list" :current="switchIndex" :autoplay="autoplay" :interval="interval" circular vertical @change="onSwitchChange">
|
|
139
|
+
<swiper-item class="placeholder-item" v-for="(item, i) in hotWords" :key="i">
|
|
140
|
+
{{ item }}
|
|
141
|
+
</swiper-item>
|
|
142
|
+
</swiper>
|
|
143
|
+
</view>
|
|
144
|
+
<view v-if="!cmpHiddenLine" class="secrch-line" :class="{ disabled: props.disabled }" />
|
|
145
|
+
<view v-if="!hiddenBtn" class="search-button" :class="{ disabled: props.disabled }" :style="[cmpbtnBackground]" @click="onSearch">
|
|
146
|
+
{{ btnText }}
|
|
147
|
+
</view>
|
|
148
|
+
</view>
|
|
149
|
+
<view class="nav-box" v-if="type === 'nav'" />
|
|
150
|
+
<!-- 输入建议 -->
|
|
151
|
+
<view v-if="suggestionList.length > 0" class="suggestions-box" :class="showSuggestionsBox == null ? 'asdf' : showSuggestionsBox ? 'show' : 'hide'">
|
|
152
|
+
<scroll-view scroll-y class="scroll-box">
|
|
153
|
+
<view class="item" @click="handleSuggestionClick(item)" v-for="(item, key) in suggestionList" :key="key">
|
|
154
|
+
{{ item.label }}
|
|
155
|
+
</view>
|
|
156
|
+
</scroll-view>
|
|
157
|
+
</view>
|
|
158
|
+
</view>
|
|
159
|
+
</template>
|
|
160
|
+
|
|
161
|
+
<style lang="scss" scoped>
|
|
162
|
+
.ste-search-root {
|
|
163
|
+
width: 100%;
|
|
164
|
+
height: var(--search-root-height);
|
|
165
|
+
background-color: #fff;
|
|
166
|
+
background-repeat: no-repeat;
|
|
167
|
+
background-size: 100% 100%;
|
|
168
|
+
border-radius: var(--search-root-radius);
|
|
169
|
+
border: 1rpx solid var(--search-border-color);
|
|
170
|
+
position: relative;
|
|
171
|
+
|
|
172
|
+
& {
|
|
173
|
+
box-sizing: border-box;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.content {
|
|
177
|
+
width: 100%;
|
|
178
|
+
height: 100%;
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: row;
|
|
181
|
+
align-items: center;
|
|
182
|
+
justify-content: center;
|
|
183
|
+
position: relative;
|
|
184
|
+
|
|
185
|
+
.icon-box {
|
|
186
|
+
width: 28rpx;
|
|
187
|
+
height: 28rpx;
|
|
188
|
+
flex-shrink: 0;
|
|
189
|
+
display: flex;
|
|
190
|
+
align-items: center;
|
|
191
|
+
justify-content: center;
|
|
192
|
+
|
|
193
|
+
.image {
|
|
194
|
+
width: 100%;
|
|
195
|
+
height: 100%;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
& + .input-box {
|
|
199
|
+
margin-left: 16rpx;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.input-box {
|
|
204
|
+
position: relative;
|
|
205
|
+
flex: 1;
|
|
206
|
+
height: 100%;
|
|
207
|
+
|
|
208
|
+
.ste-search-input {
|
|
209
|
+
height: 100%;
|
|
210
|
+
border-style: none;
|
|
211
|
+
font-size: var(--font-size-28, 28rpx);
|
|
212
|
+
color: var(--search-input-color);
|
|
213
|
+
// #ifdef MP-ALIPAY
|
|
214
|
+
background-color: rgba(0, 0, 0, 0);
|
|
215
|
+
// #endif
|
|
216
|
+
|
|
217
|
+
.content {
|
|
218
|
+
padding: 0;
|
|
219
|
+
height: 100%;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.search-input-placeholder {
|
|
224
|
+
color: var(--search-placeholder-color);
|
|
225
|
+
font-family:
|
|
226
|
+
Alibaba PuHuiTi 2,
|
|
227
|
+
Alibaba PuHuiTi 20;
|
|
228
|
+
font-weight: normal;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.placeholder-list {
|
|
232
|
+
width: 100%;
|
|
233
|
+
height: 100%;
|
|
234
|
+
pointer-events: none;
|
|
235
|
+
position: absolute;
|
|
236
|
+
top: 0;
|
|
237
|
+
left: 0;
|
|
238
|
+
|
|
239
|
+
.placeholder-item {
|
|
240
|
+
font-size: var(--font-size-28, 28rpx);
|
|
241
|
+
color: var(--search-placeholder-color);
|
|
242
|
+
font-family:
|
|
243
|
+
Alibaba PuHuiTi 2,
|
|
244
|
+
Alibaba PuHuiTi 20;
|
|
245
|
+
font-weight: normal;
|
|
246
|
+
display: flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.clear-icon {
|
|
252
|
+
width: 48rpx;
|
|
253
|
+
height: 100%;
|
|
254
|
+
display: flex;
|
|
255
|
+
align-items: center;
|
|
256
|
+
justify-content: flex-end;
|
|
257
|
+
position: absolute;
|
|
258
|
+
right: 8rpx;
|
|
259
|
+
top: 50%;
|
|
260
|
+
z-index: 2;
|
|
261
|
+
transform: translateY(-50%);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.secrch-line {
|
|
266
|
+
margin-left: 16rpx;
|
|
267
|
+
width: 2rpx;
|
|
268
|
+
flex-shrink: 0;
|
|
269
|
+
height: 24rpx;
|
|
270
|
+
background-color: var(--search-btn-text-color);
|
|
271
|
+
|
|
272
|
+
&.disabled {
|
|
273
|
+
background: #bbbbbb;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.search-button {
|
|
278
|
+
padding: 0 16rpx;
|
|
279
|
+
height: 40rpx;
|
|
280
|
+
font-size: var(--font-size-28, 28rpx);
|
|
281
|
+
line-height: 40rpx;
|
|
282
|
+
flex-shrink: 0;
|
|
283
|
+
text-align: center;
|
|
284
|
+
font-family:
|
|
285
|
+
Alibaba PuHuiTi 2,
|
|
286
|
+
Alibaba PuHuiTi 20;
|
|
287
|
+
font-weight: normal;
|
|
288
|
+
color: var(--search-btn-text-color);
|
|
289
|
+
border-radius: 20rpx;
|
|
290
|
+
background-repeat: no-repeat;
|
|
291
|
+
background-size: 100% 100%;
|
|
292
|
+
|
|
293
|
+
&.disabled {
|
|
294
|
+
color: #bbbbbb;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.nav-box {
|
|
300
|
+
position: absolute;
|
|
301
|
+
width: 100%;
|
|
302
|
+
height: 100%;
|
|
303
|
+
top: 0;
|
|
304
|
+
left: 0;
|
|
305
|
+
z-index: 2;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.suggestions-box {
|
|
309
|
+
z-index: 999;
|
|
310
|
+
position: absolute;
|
|
311
|
+
left: 0;
|
|
312
|
+
top: 100%;
|
|
313
|
+
overflow-y: hidden;
|
|
314
|
+
opacity: 0;
|
|
315
|
+
max-height: 0;
|
|
316
|
+
|
|
317
|
+
margin: 20rpx 0;
|
|
318
|
+
width: 100%;
|
|
319
|
+
|
|
320
|
+
background-color: #ffffff;
|
|
321
|
+
box-shadow: 0 4rpx 24rpx 0 rgba(0, 0, 0, 0.1);
|
|
322
|
+
border-radius: 8rpx;
|
|
323
|
+
padding: 16rpx 0;
|
|
324
|
+
|
|
325
|
+
.scroll-box {
|
|
326
|
+
width: 100%;
|
|
327
|
+
max-height: calc(400rpx - 32rpx);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.item {
|
|
331
|
+
padding-left: 16rpx;
|
|
332
|
+
width: 100%;
|
|
333
|
+
height: 60rpx;
|
|
334
|
+
display: flex;
|
|
335
|
+
align-items: center;
|
|
336
|
+
font-size: var(--font-size-28, 28rpx);
|
|
337
|
+
color: #bbbbbb;
|
|
338
|
+
|
|
339
|
+
&:focus {
|
|
340
|
+
background-color: red;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
&.show {
|
|
345
|
+
opacity: 1;
|
|
346
|
+
max-height: 400rpx;
|
|
347
|
+
animation: suggestions-show 0.2s ease-out;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
&.hide {
|
|
351
|
+
animation: suggestions-hide 0.2s ease-out;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
@keyframes suggestions-show {
|
|
356
|
+
0% {
|
|
357
|
+
opacity: 0;
|
|
358
|
+
max-height: 0;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
100% {
|
|
362
|
+
opacity: 1;
|
|
363
|
+
max-height: 400rpx;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
@keyframes suggestions-hide {
|
|
368
|
+
0% {
|
|
369
|
+
opacity: 1;
|
|
370
|
+
max-height: 400rpx;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
100% {
|
|
374
|
+
opacity: 0;
|
|
375
|
+
max-height: 0;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
export default function useData() {
|
|
4
|
+
const dataValue = ref('')
|
|
5
|
+
const setDataValue = (value: string) => {
|
|
6
|
+
dataValue.value = value
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const switchIndex = ref(0)
|
|
10
|
+
const setSwitchIndex = (index: number) => {
|
|
11
|
+
switchIndex.value = index
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const cursorNumber = ref(0)
|
|
15
|
+
const setCursorNumber = (num: number) => {
|
|
16
|
+
cursorNumber.value = num
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const showSuggestionsBox = ref<null | boolean>(null)
|
|
20
|
+
const setShowSuggestionsBox = (value: boolean) => {
|
|
21
|
+
showSuggestionsBox.value = value
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
dataValue,
|
|
26
|
+
setDataValue,
|
|
27
|
+
switchIndex,
|
|
28
|
+
setSwitchIndex,
|
|
29
|
+
cursorNumber,
|
|
30
|
+
setCursorNumber,
|
|
31
|
+
showSuggestionsBox,
|
|
32
|
+
setShowSuggestionsBox,
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#### Props
|
|
2
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
|
+
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
|
+
| `modelValue` | 绑定的值,支持v-model双向绑定 | `number / string / Array<number / string>` | - | - | - |
|
|
5
|
+
| `list` | 选项数据 | `SelectOption[] / SelectOption[][]` | `[]` | - | - |
|
|
6
|
+
| `mode` | 选择模式 | `string` | `default` | `default`:默认模式<br/>`filterable`:可搜索选择器<br/>`tree`:树形选择器<br/>`date`:日期时间选择器模式:日期选择器(该模式下list属性无效)<br/>`datetime`:日期时间选择器模式:日期时间选择器(该模式下list属性无效)<br/>`time`:日期时间选择器模式:时间选择器(该模式下list属性无效)<br/>`month`:日期时间选择器模式:年月选择器(该模式下list属性无效)<br/>`minute`:日期时间选择器模式:时分选择器(该模式下list属性无效) | - |
|
|
7
|
+
| `minDate` | 最小日期,mode为日期时间选择器时生效 | `number / string / Date` | - | - | - |
|
|
8
|
+
| `maxDate` | 最大日期,mode为日期时间选择器时生效 | `number / string / Date` | - | - | - |
|
|
9
|
+
| `dateUnit` | 选项是否显示时间单位,mode为日期时间选择器时生效 | `boolean` | - | - | - |
|
|
10
|
+
| `width` | 宽度,单位rpx | `number / string` | `100%` | - | - |
|
|
11
|
+
| `height` | 高度,单位rpx | `number / string` | `64` | - | - |
|
|
12
|
+
| `fontSize` | 字体大小,单位rpx | `number / string` | `28` | - | - |
|
|
13
|
+
| `background` | 背景 | `string` | `#fff` | - | - |
|
|
14
|
+
| `maskClose` | 点击遮罩层是否关闭 | `boolean` | `true` | - | - |
|
|
15
|
+
| `optionsWidth` | 选项框宽度,默认跟随width | `number / string` | `auto` | - | - |
|
|
16
|
+
| `placeholder` | 占位符 | `string` | `请选择` | - | - |
|
|
17
|
+
| `labelKey` | 选项标签Key | `string` | `label` | - | - |
|
|
18
|
+
| `valueKey` | 选项值Key | `string` | `value` | - | - |
|
|
19
|
+
| `childrenKey` | 数据列表中显示的键名(mode为tree时生效) | `string` | `children` | - | - |
|
|
20
|
+
| `multiple` | 是否多选(list为一维数组时生效) | `boolean` | `false` | - | - |
|
|
21
|
+
| `allowCreate` | 是否允许创建(mode为filterable时生效) | `boolean` | `false` | - | - |
|
|
22
|
+
| `borderColor` | 边框颜色,若不要边框可设置为透明色 | `string` | `#ebebeb` | - | - |
|
|
23
|
+
| `borderRadius` | 圆角大小,单位RPX | `number / string` | `8` | - | - |
|
|
24
|
+
| `optionsPosition` | 选项框位置 | `string` | `auto` | `auto`:自动展示位置,默认<br/>`auto-start`:上下自适应,左侧对其<br/>`auto-end`:上下自适应,右侧对其<br/>`bottom`:在下方展示,左右自适应<br/>`bottom-auto`:同bottom<br/>`bottom-start`:在下方展示,左侧对其<br/>`bottom-end`:在下方展示,右侧对其<br/>`top`:在上方展示,左右自适应<br/>`top-auto`:同top<br/>`top-start`:在上方展示,左侧对其<br/>`top-end`:在上方展示,右侧对其 | - |
|
|
25
|
+
| `disabled` | 禁用(所有功能失效) | `boolean` | `false` | - | - |
|
|
26
|
+
| `autoFilterable` | 是否自动过滤条目(mode为filterable时生效) | `boolean` | `true` | - | `1.16.16` |
|
|
27
|
+
| `loading` | 加载动画 | `boolean` | `false` | - | `1.16.16` |
|
|
28
|
+
| `total` | 数据总数(list选项数量大于或等于total值时不触发上拉触底事件) | `number` | `0` | - | `1.16.16` |
|
|
29
|
+
| `clearable` | 显示清楚按钮 | `boolean` | `false` | - | `1.16.17` |
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
#### Events
|
|
33
|
+
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
34
|
+
| ----- | ----- | ------- | -------- |
|
|
35
|
+
| `change` | 选择时触发 | `value`:选中的值或选中值列表<br/>`option`:选中的选项或选中项列表 | - |
|
|
36
|
+
| `cancel` | 取消选择时触发 | - | - |
|
|
37
|
+
| `confirm` | 确定选择时触发 | `value`:选中的值或选中值列表 | - |
|
|
38
|
+
| `inputFilterable` | 搜索框输入数据时触发 | - | `1.16.16` |
|
|
39
|
+
| `loadMore` | 上拉触底时触发 | - | `1.16.16` |
|