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,183 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, getCurrentInstance, defineOptions, ref } from 'vue';
|
|
3
|
+
import utils from '../../utils/utils';
|
|
4
|
+
import type { Stroke } from './types';
|
|
5
|
+
import type { HTMLMouseEvent, UniTouchEvent } from '../../types/event.d';
|
|
6
|
+
import propsData from './props';
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: 'ste-signature',
|
|
10
|
+
options: {
|
|
11
|
+
virtualHost: true,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const props = defineProps(propsData);
|
|
16
|
+
const emits = defineEmits<{
|
|
17
|
+
(e: 'start'): void;
|
|
18
|
+
(e: 'signing'): void;
|
|
19
|
+
(e: 'end'): void;
|
|
20
|
+
}>();
|
|
21
|
+
|
|
22
|
+
const cmpRootStyle = computed(() => ({
|
|
23
|
+
width: utils.formatPx(props.width),
|
|
24
|
+
height: utils.formatPx(props.height),
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
const canvasId = computed(() => utils.guid(8));
|
|
28
|
+
|
|
29
|
+
const ctx = ref<UniNamespace.CanvasContext>();
|
|
30
|
+
|
|
31
|
+
const strokeing = ref<Stroke[]>([]);
|
|
32
|
+
const strokes = ref<Stroke[][]>([]);
|
|
33
|
+
const thas = ref<globalThis.ComponentPublicInstance | null>();
|
|
34
|
+
|
|
35
|
+
const initCtx = () => {
|
|
36
|
+
thas.value = getCurrentInstance()?.proxy;
|
|
37
|
+
ctx.value = uni.createCanvasContext(canvasId.value, thas.value);
|
|
38
|
+
drawStrokes();
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const drawStrokes = () => {
|
|
42
|
+
ctx.value?.setLineCap('round');
|
|
43
|
+
ctx.value?.setLineWidth(props.lineWidth);
|
|
44
|
+
ctx.value?.setStrokeStyle(props.strokeColor);
|
|
45
|
+
ctx.value?.setLineJoin('round');
|
|
46
|
+
ctx.value?.clearRect(0, 0, 1920, 1080);
|
|
47
|
+
if (props.background !== 'none') {
|
|
48
|
+
ctx.value?.setFillStyle(props.background);
|
|
49
|
+
ctx.value?.fillRect(0, 0, 1920, 1080);
|
|
50
|
+
}
|
|
51
|
+
ctx.value?.draw();
|
|
52
|
+
if (!strokes.value.length) {
|
|
53
|
+
ctx.value?.stroke();
|
|
54
|
+
ctx.value?.draw(true);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
strokes.value.forEach(stroke => {
|
|
58
|
+
if (!stroke.length) return;
|
|
59
|
+
ctx.value?.beginPath();
|
|
60
|
+
ctx.value?.moveTo(stroke[0].x, stroke[0].y);
|
|
61
|
+
stroke.forEach(({ x, y }, index) => {
|
|
62
|
+
if (index == 0) return;
|
|
63
|
+
ctx.value?.lineTo(x, y);
|
|
64
|
+
});
|
|
65
|
+
ctx.value?.stroke();
|
|
66
|
+
ctx.value?.draw(true);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const drawStrokeing = () => {
|
|
71
|
+
const length = strokeing.value.length;
|
|
72
|
+
if (!length) return;
|
|
73
|
+
ctx.value?.beginPath();
|
|
74
|
+
const end = strokeing.value[length - 1];
|
|
75
|
+
const start = strokeing.value[length - 2] || end;
|
|
76
|
+
ctx.value?.moveTo(start.x, start.y);
|
|
77
|
+
ctx.value?.lineTo(end.x, end.y);
|
|
78
|
+
ctx.value?.stroke();
|
|
79
|
+
ctx.value?.draw(true);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// #ifdef H5
|
|
83
|
+
const getH5MousePosition = async (e: HTMLMouseEvent) => {
|
|
84
|
+
const el = await utils.querySelector<false>(`.ste-signature-root #${canvasId.value}`, thas.value);
|
|
85
|
+
if (!el) return { x: 0, y: 0 };
|
|
86
|
+
return {
|
|
87
|
+
x: e.clientX - (el.left || 0),
|
|
88
|
+
y: e.clientY - (el.top || 0),
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
// #endif
|
|
92
|
+
|
|
93
|
+
const onMousedown = (e: MouseEvent) => onTouchStart(e as unknown as UniTouchEvent);
|
|
94
|
+
const onMousemove = (e: MouseEvent) => onTouchMove(e as unknown as UniTouchEvent);
|
|
95
|
+
|
|
96
|
+
const onTouchStart = async (e: UniTouchEvent) => {
|
|
97
|
+
// #ifdef H5
|
|
98
|
+
strokeing.value = [await getH5MousePosition(e as unknown as HTMLMouseEvent)];
|
|
99
|
+
// #endif
|
|
100
|
+
// #ifdef MP
|
|
101
|
+
strokeing.value = [{ x: e.changedTouches[0]?.x || 0, y: e.changedTouches[0]?.y || 0 }];
|
|
102
|
+
// #endif
|
|
103
|
+
// #ifdef APP
|
|
104
|
+
strokeing.value = [{ x: e.touches[0]?.x || 0, y: e.touches[0]?.y || 0 }];
|
|
105
|
+
// #endif
|
|
106
|
+
drawStrokeing();
|
|
107
|
+
emits('start');
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const onTouchMove = async (e: UniTouchEvent) => {
|
|
111
|
+
if (!strokeing.value.length) return;
|
|
112
|
+
// #ifdef H5
|
|
113
|
+
strokeing.value.push(await getH5MousePosition(e as unknown as HTMLMouseEvent));
|
|
114
|
+
// #endif
|
|
115
|
+
// #ifdef MP
|
|
116
|
+
strokeing.value.push({ x: e.changedTouches[0].x || 0, y: e.changedTouches[0].y || 0 });
|
|
117
|
+
// #endif
|
|
118
|
+
// #ifdef APP
|
|
119
|
+
strokeing.value.push({ x: e.touches[0]?.x || 0, y: e.touches[0]?.y || 0 });
|
|
120
|
+
// #endif
|
|
121
|
+
drawStrokeing();
|
|
122
|
+
emits('signing');
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const onTouchEnd = () => {
|
|
126
|
+
strokes.value.push(strokeing.value);
|
|
127
|
+
strokeing.value = [];
|
|
128
|
+
emits('end');
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
onMounted(() => {
|
|
132
|
+
initCtx();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const clear = () => {
|
|
136
|
+
strokes.value = [];
|
|
137
|
+
drawStrokes();
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const back = () => {
|
|
141
|
+
strokes.value.pop();
|
|
142
|
+
drawStrokes();
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const save = async (callback: (res: string) => void, error?: (err: any) => void) => {
|
|
146
|
+
if (!strokes.value.length) {
|
|
147
|
+
console.warn('没有绘制签名内容');
|
|
148
|
+
if (error) error('请绘制签名');
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const canvas = await utils.querySelector<false>(`.ste-signature-root #${canvasId.value}`, thas.value);
|
|
152
|
+
if (!canvas) {
|
|
153
|
+
console.error('找不到canvas');
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
uni.canvasToTempFilePath(
|
|
157
|
+
{
|
|
158
|
+
canvasId: canvasId.value,
|
|
159
|
+
width: canvas.width,
|
|
160
|
+
height: canvas.height,
|
|
161
|
+
destWidth: (canvas.width || 0) * 2, // 设置导出图片的宽度,这里设置为canvas宽度的两倍
|
|
162
|
+
destHeight: (canvas.height || 0) * 2, // 设置导出图片的高度,这里设置为canvas高度的两倍
|
|
163
|
+
fileType: props.type, // 设置导出图片的类型,如'png'、'jpg'等
|
|
164
|
+
success: res => {
|
|
165
|
+
if (callback) callback(res.tempFilePath);
|
|
166
|
+
},
|
|
167
|
+
fail: err => {
|
|
168
|
+
console.error(err);
|
|
169
|
+
if (error) error(err);
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
thas.value
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
defineExpose({ save, clear, back });
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<template>
|
|
180
|
+
<view class="ste-signature-root" :style="cmpRootStyle" @mousedown="onMousedown" @mousemove="onMousemove" @mouseup="onTouchEnd" @mosueleave="onTouchEnd">
|
|
181
|
+
<canvas :id="canvasId" :canvas-id="canvasId" :style="cmpRootStyle" disable-scroll @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd" />
|
|
182
|
+
</view>
|
|
183
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#### Props
|
|
2
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
|
+
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
|
+
| `value` | 当前进度百分比,在双滑块模式下为数组格式(数组的值都是从小到大) | `number / string / array` | - | - | - |
|
|
5
|
+
| `min` | 最小值 | `number / string` | `0` | - | - |
|
|
6
|
+
| `max` | 最大值 | `number / string` | `100` | - | - |
|
|
7
|
+
| `step` | 步长 | `number / string` | `1` | - | - |
|
|
8
|
+
| `barHeight` | 进度条高度,默认单位为 rpx | `number / string` | `4` | - | - |
|
|
9
|
+
| `buttonSize` | 滑块按钮大小,默认单位为 rpx | `number / string` | `20` | - | - |
|
|
10
|
+
| `activeColor` | 进度条激活态颜色 | `string` | `#3c9cff` | - | - |
|
|
11
|
+
| `inactiveColor` | 进度条非激活态颜色 | `string` | `#ebedf0` | - | - |
|
|
12
|
+
| `range` | 是否为范围选择 | `boolean` | `false` | - | - |
|
|
13
|
+
| `vertical` | 是否竖向模式 | `boolean` | `false` | - | - |
|
|
14
|
+
| `disabled` | 是否禁用滑块 | `boolean` | `false` | - | - |
|
|
15
|
+
| `readonly` | 是否为只读状态,只读状态下无法修改滑块的值 | `boolean` | `false` | - | - |
|
|
16
|
+
| `marks` | 标记,key 的类型必须为 number 且取值在闭区间 [min, max] 内,每个标记可以单独设置样式 | `object` | - | - | - |
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
#### Events
|
|
20
|
+
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
21
|
+
| ----- | ----- | ------- | -------- |
|
|
22
|
+
| `change` | 进度变化且结束拖动后触发 | `percentage`:进度百分比 | - |
|
|
23
|
+
| `dragStart` | 开始拖动时触发 | `e`:拖动事件 | - |
|
|
24
|
+
| `dragEnd` | 结束拖动时触发 | `e`:拖动事件 | - |
|
|
25
|
+
| `input` | 进度变化时实时触发 | `percentage`:进度百分比 | - |
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Slider 滑块
|
|
2
|
+
|
|
3
|
+
滑块
|
|
4
|
+
|
|
5
|
+
---$
|
|
6
|
+
|
|
7
|
+
### 代码演示
|
|
8
|
+
|
|
9
|
+
#### 基础使用
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<ste-slider value="30"></ste-slider>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
#### 滑块条高度 & 滑块大小
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<ste-slider barHeight="26" value="30"></ste-slider>
|
|
19
|
+
<ste-slider buttonSize="50" value="30"></ste-slider>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
#### 进度条颜色
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<ste-slider value="30" activeColor="#ff0000" inactiveColor="#a9ee13"></ste-slider>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### 范围选择
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<ste-slider :value="[10, 20]" range></ste-slider>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### 竖向
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<ste-slider vertical value="30"></ste-slider>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
#### 禁用
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<ste-slider disabled value="30"></ste-slider>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### 只读
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<ste-slider readonly value="30"></ste-slider>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### 间断点
|
|
53
|
+
|
|
54
|
+
当`showStops`为`true`时,会根据最大值(`max`)、最小值(`min`)、步长(`step`)来显示间断点
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<ste-slider showStops :step="10" value="30"></ste-slider>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### 标记
|
|
61
|
+
|
|
62
|
+
当同时配置了`showStops`属性和`marks`属性时,会显示自定义节点
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<script lang="ts" setup>
|
|
66
|
+
import { ref } from 'vue';
|
|
67
|
+
const marks = ref({
|
|
68
|
+
10: '0°C',
|
|
69
|
+
20: '8°C',
|
|
70
|
+
37: '37°C',
|
|
71
|
+
80: {
|
|
72
|
+
style: {
|
|
73
|
+
color: '#1989FA',
|
|
74
|
+
},
|
|
75
|
+
label: '合格',
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<ste-slider showStops :marks="marks" value="30"></ste-slider>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### 自定义滑块
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<ste-slider :step="10" showStops value="30" activeColor="#ff0000">
|
|
87
|
+
<view class="c-slider-1" slot="button">
|
|
88
|
+
<view class="content">
|
|
89
|
+
<text>滑块</text>
|
|
90
|
+
</view>
|
|
91
|
+
</view>
|
|
92
|
+
</ste-slider>
|
|
93
|
+
<ste-slider :step="10" showStops :value="[10, 40]" range>
|
|
94
|
+
<view class="c-slider-2" slot="leftButton">
|
|
95
|
+
<view class="content">
|
|
96
|
+
<ste-icon code="" color="#fff"></ste-icon>
|
|
97
|
+
</view>
|
|
98
|
+
</view>
|
|
99
|
+
<view class="c-slider-2" slot="rightButton">
|
|
100
|
+
<view class="content">
|
|
101
|
+
<ste-icon code="" color="#fff"></ste-icon>
|
|
102
|
+
</view>
|
|
103
|
+
</view>
|
|
104
|
+
</ste-slider>
|
|
105
|
+
<style lang="scss">
|
|
106
|
+
.c-slider-1 {
|
|
107
|
+
.content {
|
|
108
|
+
padding: 0 16rpx;
|
|
109
|
+
background-color: #ff0000;
|
|
110
|
+
border-radius: 20rpx;
|
|
111
|
+
|
|
112
|
+
color: #ffffff;
|
|
113
|
+
font-size: 24rpx;
|
|
114
|
+
|
|
115
|
+
text {
|
|
116
|
+
white-space: nowrap;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
.c-slider-2 {
|
|
121
|
+
.content {
|
|
122
|
+
background-color: #0090ff;
|
|
123
|
+
border-radius: 50%;
|
|
124
|
+
height: 40rpx;
|
|
125
|
+
width: 40rpx;
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---$
|
|
135
|
+
|
|
136
|
+
### API
|
|
137
|
+
|
|
138
|
+
<!-- props -->
|
|
139
|
+
|
|
140
|
+
#### 组件插槽(Slots)
|
|
141
|
+
|
|
142
|
+
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
143
|
+
| -------- | -------------------------------- | -------- | -------- |
|
|
144
|
+
| `button` | 自定义滑块按钮 | - | - |
|
|
145
|
+
| `button` | 自定义左侧滑块按钮(范围选择下) | - | - |
|
|
146
|
+
| `button` | 自定义右侧滑块按钮(范围选择下) | - | - |
|
|
147
|
+
|
|
148
|
+
---$
|
|
149
|
+
{{fuyuwei}}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import type { UniTouchEvent } from '../../types/event'
|
|
3
|
+
|
|
4
|
+
const sliderProps = {
|
|
5
|
+
value: { type: [Number, String, Array], default: 0 },
|
|
6
|
+
min: { type: [Number, String], default: 0 },
|
|
7
|
+
max: { type: [Number, String], default: 100 },
|
|
8
|
+
step: { type: [Number, String], default: 1 },
|
|
9
|
+
barHeight: { type: [String, Number], default: 8 },
|
|
10
|
+
buttonSize: { type: [String, Number], default: 40 },
|
|
11
|
+
activeColor: { type: String, default: '' },
|
|
12
|
+
inactiveColor: { type: String, default: '#eeeeee' },
|
|
13
|
+
range: { type: Boolean, default: false },
|
|
14
|
+
vertical: { type: Boolean, default: false },
|
|
15
|
+
disabled: { type: Boolean, default: false },
|
|
16
|
+
readonly: { type: Boolean, default: false },
|
|
17
|
+
showStops: { type: Boolean, default: false },
|
|
18
|
+
marks: { type: Object, default: () => {} },
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default sliderProps
|
|
22
|
+
|
|
23
|
+
export type SliderProps = ExtractPropTypes<typeof sliderProps>
|
|
24
|
+
|
|
25
|
+
export const sliderEmits = {
|
|
26
|
+
input: (val: number | number[]) => typeof val === 'number' || Array.isArray(val),
|
|
27
|
+
change: (val: number | number[]) => typeof val === 'number' || Array.isArray(val),
|
|
28
|
+
dragStart: (e: UniTouchEvent | MouseEvent) => e instanceof Object,
|
|
29
|
+
dragEnd: (e: UniTouchEvent | MouseEvent) => e instanceof Object,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type SliderEmits = typeof sliderEmits
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ste-slider",
|
|
3
|
+
"description": "滑块组件",
|
|
4
|
+
"example": "<ste-slider />",
|
|
5
|
+
"tutorial": "https://stellar-ui.intecloud.com.cn/plus/#/?active=slider",
|
|
6
|
+
"attributes": [
|
|
7
|
+
{
|
|
8
|
+
"name": "value",
|
|
9
|
+
"description": "当前进度百分比,在双滑块模式下为数组格式(数组的值都是从小到大)",
|
|
10
|
+
"type": "number | string | array"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "min",
|
|
14
|
+
"description": "最小值",
|
|
15
|
+
"type": "number | string",
|
|
16
|
+
"default": "0"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "max",
|
|
20
|
+
"description": "最大值",
|
|
21
|
+
"type": "number | string",
|
|
22
|
+
"default": "100"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "step",
|
|
26
|
+
"description": "步长",
|
|
27
|
+
"type": "number | string",
|
|
28
|
+
"default": "1"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "barHeight",
|
|
32
|
+
"description": "进度条高度,默认单位为 rpx",
|
|
33
|
+
"type": "number | string",
|
|
34
|
+
"default": "4"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "buttonSize",
|
|
38
|
+
"description": "滑块按钮大小,默认单位为 rpx",
|
|
39
|
+
"type": "number | string",
|
|
40
|
+
"default": "20"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "activeColor",
|
|
44
|
+
"description": "进度条激活态颜色",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"default": "#3c9cff"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "inactiveColor",
|
|
50
|
+
"description": "进度条非激活态颜色",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"default": "#ebedf0"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "range",
|
|
56
|
+
"description": "是否为范围选择",
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": "false"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "vertical",
|
|
62
|
+
"description": "是否竖向模式",
|
|
63
|
+
"type": "boolean",
|
|
64
|
+
"default": "false"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "disabled",
|
|
68
|
+
"description": "是否禁用滑块",
|
|
69
|
+
"type": "boolean",
|
|
70
|
+
"default": "false"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "readonly",
|
|
74
|
+
"description": "是否为只读状态,只读状态下无法修改滑块的值",
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"default": "false"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "marks",
|
|
80
|
+
"description": "标记,key 的类型必须为 number 且取值在闭区间 [min, max] 内,每个标记可以单独设置样式",
|
|
81
|
+
"type": "object"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "[event]change",
|
|
85
|
+
"description": "进度变化且结束拖动后触发",
|
|
86
|
+
"type": "(percentage)=>void",
|
|
87
|
+
"params": [
|
|
88
|
+
{
|
|
89
|
+
"name": "percentage",
|
|
90
|
+
"description": "进度百分比"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "[event]dragStart",
|
|
96
|
+
"description": "开始拖动时触发",
|
|
97
|
+
"type": "(e)=>void",
|
|
98
|
+
"params": [
|
|
99
|
+
{
|
|
100
|
+
"name": "e",
|
|
101
|
+
"description": "拖动事件"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "[event]dragEnd",
|
|
107
|
+
"description": "结束拖动时触发",
|
|
108
|
+
"type": "(e)=>void",
|
|
109
|
+
"params": [
|
|
110
|
+
{
|
|
111
|
+
"name": "e",
|
|
112
|
+
"description": "拖动事件"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "[event]input",
|
|
118
|
+
"description": "进度变化时实时触发",
|
|
119
|
+
"type": "(percentage)=>void",
|
|
120
|
+
"params": [
|
|
121
|
+
{
|
|
122
|
+
"name": "percentage",
|
|
123
|
+
"description": "进度百分比"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
.ste-slider-root {
|
|
2
|
+
position: relative;
|
|
3
|
+
z-index: 1;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: var(--progress-height);
|
|
6
|
+
border-radius: 24rpx;
|
|
7
|
+
|
|
8
|
+
&.ste-slider-disabled {
|
|
9
|
+
.active-box {
|
|
10
|
+
background-color: #cccccc;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.inactive-box {
|
|
14
|
+
background-color: #eeeeee;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.slider-bar-box {
|
|
18
|
+
.slider-bar {
|
|
19
|
+
border-color: #cccccc;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.ste-slider-drag {
|
|
25
|
+
.active-box {
|
|
26
|
+
transition: none !important;
|
|
27
|
+
}
|
|
28
|
+
.slider-bar-box {
|
|
29
|
+
transition: none !important;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
&.ste-slider-vertical {
|
|
33
|
+
display: inline-block;
|
|
34
|
+
margin: 0 16rpx;
|
|
35
|
+
width: var(--progress-height);
|
|
36
|
+
height: 100%;
|
|
37
|
+
|
|
38
|
+
.inactive-box {
|
|
39
|
+
height: 100%;
|
|
40
|
+
width: var(--progress-height);
|
|
41
|
+
}
|
|
42
|
+
.active-box {
|
|
43
|
+
align-items: flex-end;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
width: 100%;
|
|
46
|
+
transition: height 0.3s ease;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.slider-bar-box {
|
|
50
|
+
transition: top 0.3s ease;
|
|
51
|
+
left: 50%;
|
|
52
|
+
top: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.mark-box {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
transform: translateY(-50%);
|
|
59
|
+
.dot {
|
|
60
|
+
margin-right: 20rpx;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
&.ste-slider-horizontal {
|
|
65
|
+
margin: 16rpx 0;
|
|
66
|
+
.mark-box {
|
|
67
|
+
transform: translateX(-50%);
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
align-items: center;
|
|
72
|
+
|
|
73
|
+
.dot {
|
|
74
|
+
margin-bottom: 20rpx;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.slider-bar-box {
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.inactive-box {
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: var(--progress-height);
|
|
84
|
+
border-radius: 24rpx;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.active-box {
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: var(--progress-height);
|
|
90
|
+
border-radius: 24rpx;
|
|
91
|
+
position: absolute;
|
|
92
|
+
left: 0;
|
|
93
|
+
top: 0;
|
|
94
|
+
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: flex-end;
|
|
98
|
+
transition: width 0.3s ease;
|
|
99
|
+
z-index: 2;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.slider-bar-box {
|
|
103
|
+
cursor: grab;
|
|
104
|
+
position: absolute;
|
|
105
|
+
left: 0;
|
|
106
|
+
top: 50%;
|
|
107
|
+
transform: translate(-50%, -50%);
|
|
108
|
+
z-index: 9;
|
|
109
|
+
padding: 12rpx;
|
|
110
|
+
|
|
111
|
+
transition: left 0.3s ease;
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
/* 其他样式 */
|
|
114
|
+
view {
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
}
|
|
117
|
+
text {
|
|
118
|
+
white-space: nowrap;
|
|
119
|
+
}
|
|
120
|
+
.slider-bar {
|
|
121
|
+
min-width: var(--bar-size);
|
|
122
|
+
height: var(--bar-size);
|
|
123
|
+
width: var(--bar-size);
|
|
124
|
+
border-radius: 50%;
|
|
125
|
+
background-color: #ffffff;
|
|
126
|
+
border: 2rpx solid var(--active-color);
|
|
127
|
+
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.mark-box {
|
|
135
|
+
position: absolute;
|
|
136
|
+
z-index: 3;
|
|
137
|
+
.dot {
|
|
138
|
+
height: var(--progress-height);
|
|
139
|
+
width: var(--progress-height);
|
|
140
|
+
border-radius: 100%;
|
|
141
|
+
background-color: #fff;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.marks-label {
|
|
145
|
+
white-space: nowrap;
|
|
146
|
+
|
|
147
|
+
font-size: 24rpx;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|