stellar-ui-v2 1.37.0 → 1.38.0
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/.babelrc +8 -0
- package/App.vue +22 -0
- package/LICENSE +21 -0
- package/README.md +8 -8
- package/common/account.js +59 -0
- package/common/app-mixin.js +61 -0
- package/common/config.js +69 -0
- package/common/css/common.scss +155 -54
- package/common/css/vars.scss +51 -0
- package/common/request.js +38 -0
- package/common/token.js +13 -0
- package/common/uploadFile.js +21 -0
- package/common/usePosition.js +159 -0
- package/common/utils.js +303 -0
- package/components/item-view/item-view.vue +84 -0
- package/components/page-nav/page-nav.vue +245 -0
- package/components/t-color-picker/t-color-picker.vue +820 -0
- package/index.html +20 -0
- package/main.js +22 -0
- package/manifest.json +84 -0
- package/mp/animate-demo/animate-demo.vue +132 -0
- package/mp/badge-demo/badge-demo.vue +211 -0
- package/mp/barcode-demo/barcode-demo.vue +59 -0
- package/mp/button-demo/button-demo.vue +211 -0
- package/mp/calendar-demo/calendar-demo.vue +266 -0
- package/mp/checkbox-demo/checkbox-demo.vue +274 -0
- package/mp/code-input-demo/code-input-demo.vue +113 -0
- package/mp/color-demo/color-demo.vue +363 -0
- package/mp/date-picker-demo/date-picker-demo.vue +158 -0
- package/mp/drag-demo/drag-demo.vue +112 -0
- package/mp/dropdown-menu-demo/dropdown-menu-demo.vue +380 -0
- package/mp/icon-demo/icon-demo.vue +223 -0
- package/mp/icon-demo/icon-vertical-align.vue +236 -0
- package/mp/image-demo/image-demo.vue +140 -0
- package/mp/index/index.vue +588 -0
- package/mp/index-list-demo/index-list-demo.vue +111 -0
- package/mp/input-demo/input-demo.vue +230 -0
- package/mp/loading-demo/loading-demo.vue +71 -0
- package/mp/media-preview-demo/media-preview-demo.vue +139 -0
- package/mp/message-box-demo/message-box-demo.vue +200 -0
- package/mp/notice-bar-demo/notice-bar-demo.vue +107 -0
- package/mp/number-keyboard-demo/number-keyboard-demo.vue +138 -0
- package/mp/popup-demo/popup-demo.vue +351 -0
- package/mp/price-demo/price-demo.vue +163 -0
- package/mp/progress-demo/progress-demo.vue +219 -0
- package/mp/qrcode-demo/qrcode-demo.vue +74 -0
- package/mp/radio-demo/radio-demo.vue +276 -0
- package/mp/rate-demo/rate-demo.vue +112 -0
- package/mp/read-more-demo/read-more-demo.vue +118 -0
- package/mp/rich-text-demo/rich-text-demo.vue +58 -0
- package/mp/scroll-to-demo/scroll-to-demo.vue +65 -0
- package/mp/search-demo/search-demo.vue +225 -0
- package/mp/select-demo/select-demo.vue +245 -0
- package/mp/signature-demo/signature-demo.vue +74 -0
- package/mp/slider-demo/slider-demo.vue +197 -0
- package/mp/stepper-demo/stepper-demo.vue +201 -0
- package/mp/steps-demo/steps-demo.vue +119 -0
- package/mp/sticky-demo/sticky-demo.vue +64 -0
- package/mp/swipe-action-demo/swipe-action-demo.vue +223 -0
- package/mp/swiper-demo/swiper-demo.vue +120 -0
- package/mp/switch-demo/switch-demo.vue +108 -0
- package/mp/table-demo/table-demo.vue +647 -0
- package/mp/tabs-demo/tabs-demo.vue +518 -0
- package/mp/test-demo/test-demo.vue +248 -0
- package/mp/text-demo/text-demo.vue +109 -0
- package/mp/toast-demo/toast-demo.vue +189 -0
- package/mp/touch-swipe-demo/touch-swipe-demo.vue +97 -0
- package/mp/tour-demo/tour-demo.vue +103 -0
- package/mp/tree-demo/tree-demo.vue +156 -0
- package/mp/upload-demo/upload-demo.vue +176 -0
- package/mp/video-demo/video-demo.vue +61 -0
- package/package.json +27 -6
- package/pages/404/404.vue +194 -0
- package/pages/gitlab/gitlab.vue +50 -0
- package/pages/index/index.vue +36 -0
- package/pages/login/login.vue +149 -0
- package/pages/user/user.vue +277 -0
- package/pages.json +809 -0
- package/pc/index/components/append-link.vue +61 -0
- package/pc/index/components/comment.vue +347 -0
- package/pc/index/components/comp-nav.vue +135 -0
- package/pc/index/components/header-nav.vue +74 -0
- package/pc/index/components/version-select.vue +217 -0
- package/pc/index/iPhone13.png +0 -0
- package/pc/index/index.vue +554 -0
- package/pc/index/login.vue +146 -0
- package/pc/index/md2html.js +163 -0
- package/pc/index/mdStyle.scss +270 -0
- package/pc/index/sse.js +22 -0
- package/pc/markdown/devGuide/93-/347/273/204/344/273/266/346/233/277/346/215/242/350/247/204/350/214/203.md +18 -0
- package/pc/markdown/devGuide/94-/345/274/200/345/217/221/350/256/241/345/210/222.md +1083 -0
- package/pc/markdown/devGuide/95-/347/273/204/344/273/266/345/221/275/345/220/215/350/247/204/350/214/203.md +78 -0
- package/pc/markdown/devGuide/96-/347/273/204/344/273/266/347/244/272/344/276/213/346/250/241/346/235/277.md +49 -0
- package/pc/markdown/devGuide/99-/347/273/204/344/273/266/345/272/223/345/274/200/345/217/221/346/214/207/345/215/227.md +93 -0
- package/pc/markdown/devGuide/config.json +5 -0
- package/pc/markdown/handbook/1-/344/273/213/347/273/215.md +34 -0
- package/pc/markdown/handbook/2-/345/277/253/351/200/237/344/270/212/346/211/213.md +59 -0
- package/pc/markdown/handbook/3-/350/207/252/345/256/232/344/271/211/344/270/273/351/242/230.md +35 -0
- package/pc/markdown/handbook/4-/347/273/204/344/273/266/346/265/213/350/257/225.md +24 -0
- package/pc/markdown/handbook/97-/346/233/264/346/226/260/346/227/245/345/277/227.md +1773 -0
- package/pc/markdown/handbook/98-/345/205/266/344/273/226/346/217/222/344/273/266.md +28 -0
- package/pc/markdown/handbook/99-/345/217/213/346/203/205/351/223/276/346/216/245.md +71 -0
- package/pc/markdown/handbook/config.json +4 -0
- package/pc/markdown/index.js +75 -0
- package/pc/markdown/requireFiles.js +103 -0
- package/pc/service/app.js +33 -0
- package/pc/service/config.json +16 -0
- package/pc/service/datas/ste-rich-text.txt +2 -0
- package/pc/service/package-lock.json +1328 -0
- package/pc/service/package.json +27 -0
- package/pc/service/src/routers.js +100 -0
- package/pc/service/src/utils/Applet.js +7 -0
- package/pc/service/src/utils/Code.js +70 -0
- package/pc/service/src/utils/Data.js +84 -0
- package/pc/service/src/utils/Redis.js +35 -0
- package/pc/service/src/utils/User.js +65 -0
- package/pc/service/src/utils/Utils.js +31 -0
- package/pc/service/src/utils/getConfig.js +7 -0
- package/pc/service/webs/index.js +11 -0
- package/prettier.config.js +20 -0
- package/router.js +22 -0
- package/static/astronaut.svg +1 -0
- package/static/favicon.png +0 -0
- package/static/planet.svg +1 -0
- package/static/reset.png +0 -0
- package/static/tabbars/home.png +0 -0
- package/static/tabbars/home_fill.png +0 -0
- package/static/tabbars/people.png +0 -0
- package/static/tabbars/people_fill.png +0 -0
- package/template.h5.html +31 -0
- package/test/components/badge.test.js +75 -0
- package/test/components/barcode.test.js +22 -0
- package/test/components/button.test.js +52 -0
- package/test/components/calendar.test.js +105 -0
- package/test/components/checkbox.test.js +103 -0
- package/test/components/code-input.test.js +61 -0
- package/test/components/date-picker.test.js +18 -0
- package/test/components/drag.test.js +6 -0
- package/test/components/drop-down-menu.test.js +47 -0
- package/test/components/icon.test.js +65 -0
- package/test/components/image.test.js +64 -0
- package/test/components/index-list.test.js +77 -0
- package/test/components/input.test.js +82 -0
- package/test/components/loading.test.js +63 -0
- package/test/components/media-preview.test.js +46 -0
- package/test/components/message-box.test.js +118 -0
- package/test/components/notice-bar.test.js +59 -0
- package/test/components/number-keyboard.test.js +77 -0
- package/test/components/popup.test.js +20 -0
- package/test/components/price.test.js +116 -0
- package/test/components/progress.test.js +94 -0
- package/test/components/radio.test.js +98 -0
- package/test/components/rate.test.js +94 -0
- package/test/components/read-more.test.js +33 -0
- package/test/components/rich-text.test.js +20 -0
- package/test/components/scroll-to.test.js +54 -0
- package/test/components/search.test.js +107 -0
- package/test/components/select.test.js +111 -0
- package/test/components/signature.test.js +50 -0
- package/test/components/slider.test.js +69 -0
- package/test/components/stepper.test.js +113 -0
- package/test/components/steps.test.js +54 -0
- package/test/components/sticky.test.js +40 -0
- package/test/components/swipe-action.test.js +76 -0
- package/test/components/swiper.test.js +130 -0
- package/test/components/switch.test.js +53 -0
- package/test/components/tabs.test.js +273 -0
- package/test/components/text.test.js +17 -0
- package/test/components/touch-swipe.test.js +113 -0
- package/test/components/tour.test.js +146 -0
- package/test/components/tree.test.js +111 -0
- package/test/components/upload.test.js +116 -0
- package/test/components/video.test.js +48 -0
- package/test/methods.js +74 -0
- package/test/setup.js +32 -0
- package/test/utils/Color.test.js +26 -0
- package/test/utils/utils.test.js +42 -0
- package/uni.promisify.adaptor.js +10 -0
- package/uni.scss +4 -0
- package/uni_modules/stellar-ui/README.md +177 -0
- package/uni_modules/stellar-ui/common/css/common.scss +61 -0
- package/{components → uni_modules/stellar-ui/components}/ste-calendar/README.md +1 -1
- package/{components → uni_modules/stellar-ui/components}/ste-date-picker/ste-date-picker.vue +407 -407
- package/{components → uni_modules/stellar-ui/components}/ste-input/README.md +1 -1
- package/{components → uni_modules/stellar-ui/components}/ste-picker/ste-picker.vue +2 -2
- package/{components → uni_modules/stellar-ui/components}/ste-search/ste-search.vue +1 -1
- package/{components → uni_modules/stellar-ui/components}/ste-table/README.md +4 -4
- package/uni_modules/stellar-ui/package-lock.json +22 -0
- package/uni_modules/stellar-ui/package.json +18 -0
- package/vitest.config.js +14 -0
- package/vue.config.js +32 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-animate/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-animate/animate.scss +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-animate/ste-animate.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-badge/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-badge/ste-badge.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-barcode/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-barcode/encode2.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-barcode/ste-barcode.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-button/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-button/ste-button.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-calendar/self-date.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-calendar/ste-calendar.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-checkbox/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-checkbox/ste-checkbox.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-checkbox-group/ste-checkbox-group.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-code-input/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-code-input/ste-code-input.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-date-picker/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-drag/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-drag/ste-drag.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-dropdown-menu/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-dropdown-menu/ste-dropdown-menu.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-dropdown-menu-item/ste-dropdown-menu-item.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-icon/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-icon/iconfont.css +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-icon/ste-icon.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-image/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-image/ste-image.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-index-item/ste-index-item.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-index-list/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-index-list/ste-index-list.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-input/ste-input.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-loading/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-loading/ste-loading.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-media-preview/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-media-preview/TouchScaleing.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-media-preview/ste-media-preview.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-message-box/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-message-box/ste-message-box.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-message-box/ste-message-box.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-notice-bar/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-notice-bar/ste-notice-bar.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-number-keyboard/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-number-keyboard/keyboard.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-number-keyboard/ste-number-keyboard.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-popup/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-popup/ste-popup.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-price/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-price/ste-price.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-progress/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-progress/ste-progress.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-qrcode/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-qrcode/ste-qrcode.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-qrcode/uqrcode.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-radio/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-radio/ste-radio.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-radio-group/ste-radio-group.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-rate/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-rate/ste-rate.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-read-more/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-read-more/ste-read-more.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-rich-text/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-rich-text/ste-rich-text.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-scroll-to/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-scroll-to/mixin.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-scroll-to/ste-scroll-to.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-scroll-to-item/ste-scroll-to-item.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-search/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-select/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-select/datapager.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-select/datetime.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-select/defaultDate.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-select/ste-select.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-signature/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-signature/ste-signature.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-slider/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-slider/ste-slider.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-step/ste-step.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-stepper/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-stepper/ste-stepper.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-steps/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-steps/ste-steps.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-sticky/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-sticky/ste-sticky.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-swipe-action/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-swipe-action/ste-swipe-action.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-swipe-action-group/ste-swipe-action-group.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-swiper/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-swiper/ste-swiper.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-swiper-item/ste-swiper-item.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-switch/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-switch/ste-switch.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-tab/ste-tab.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-table/common.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-table/ste-table.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-table/utils.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-table-column/checkbox-icon.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-table-column/common.scss +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-table-column/radio-icon.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-table-column/ste-table-column.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-table-column/sub-table.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-table-column/table-popover.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-table-column/var.scss +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-tabs/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-tabs/props.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-tabs/ste-tabs.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-text/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-text/ste-text.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-toast/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-toast/ste-toast.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-toast/ste-toast.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-touch-swipe/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-touch-swipe/TouchEvent.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-touch-swipe/ste-touch-swipe.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-touch-swipe-item/ste-touch-swipe-item.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-tour/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-tour/ste-tour.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-tree/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-tree/ste-tree.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-upload/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-upload/ReadFile.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-upload/ste-upload.vue +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-video/README.md +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-video/props.js +0 -0
- /package/{components → uni_modules/stellar-ui/components}/ste-video/ste-video.vue +0 -0
- /package/{config → uni_modules/stellar-ui/config}/color.js +0 -0
- /package/{index.js → uni_modules/stellar-ui/index.js} +0 -0
- /package/{utils → uni_modules/stellar-ui/utils}/Color.js +0 -0
- /package/{utils → uni_modules/stellar-ui/utils}/System.js +0 -0
- /package/{utils → uni_modules/stellar-ui/utils}/dayjs.min.js +0 -0
- /package/{utils → uni_modules/stellar-ui/utils}/mixin.js +0 -0
- /package/{utils → uni_modules/stellar-ui/utils}/store.js +0 -0
- /package/{utils → uni_modules/stellar-ui/utils}/utils.js +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { nextTick } from 'vue';
|
|
3
|
+
import Steps from '../../uni_modules/stellar-ui/components/ste-steps/ste-steps.vue';
|
|
4
|
+
import Step from '../../uni_modules/stellar-ui/components/ste-step/ste-step.vue';
|
|
5
|
+
import { createVue, triggerClick } from '../methods';
|
|
6
|
+
|
|
7
|
+
describe('Steps Vue Component', async () => {
|
|
8
|
+
const vm = createVue(
|
|
9
|
+
{
|
|
10
|
+
components: { 'ste-steps': Steps, 'ste-step': Step },
|
|
11
|
+
template: `<ste-steps :active="active">
|
|
12
|
+
<ste-step></ste-step>
|
|
13
|
+
<ste-step></ste-step>
|
|
14
|
+
<ste-step></ste-step>
|
|
15
|
+
</ste-steps>
|
|
16
|
+
`,
|
|
17
|
+
data() {
|
|
18
|
+
return {
|
|
19
|
+
active: 0,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
true
|
|
24
|
+
);
|
|
25
|
+
const wrapper = mount(Steps, {
|
|
26
|
+
propsData: {
|
|
27
|
+
direction: 'row',
|
|
28
|
+
dot: false,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
await new Promise((p) => setTimeout(p, 500));
|
|
33
|
+
|
|
34
|
+
test('init', async () => {
|
|
35
|
+
// 默认隐藏
|
|
36
|
+
const els = vm.$el.querySelectorAll('[data-test="step"]');
|
|
37
|
+
expect(els.length).toBe(3);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('active', async () => {
|
|
41
|
+
vm.active = 1;
|
|
42
|
+
await nextTick();
|
|
43
|
+
const els = vm.$el.querySelectorAll('[data-test="step"]');
|
|
44
|
+
expect(els[1].style._values['---color']).toBe('#0090FF');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('direction', () => {
|
|
48
|
+
expect(wrapper.props('direction')).toBe('row');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('dot', () => {
|
|
52
|
+
expect(wrapper.props('dot')).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { nextTick } from 'vue';
|
|
3
|
+
import Sticky from '../../uni_modules/stellar-ui/components/ste-sticky/ste-sticky.vue';
|
|
4
|
+
import { style2obj } from '../methods';
|
|
5
|
+
describe('Sticky Comp', async () => {
|
|
6
|
+
const wrapper = mount(Sticky, {
|
|
7
|
+
propsData: {
|
|
8
|
+
offsetTop: 120,
|
|
9
|
+
customNavHeight: 0,
|
|
10
|
+
disabled: false,
|
|
11
|
+
background: "#f00",
|
|
12
|
+
zIndex: 98,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
await nextTick();
|
|
16
|
+
const view = wrapper.find('[data-test="sticky"]');
|
|
17
|
+
const style = style2obj(view);
|
|
18
|
+
console.log(style);
|
|
19
|
+
|
|
20
|
+
test('offsetTop', async () => {
|
|
21
|
+
expect(style.top).toBe('60px');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('customNavHeight', async () => {
|
|
25
|
+
expect(wrapper.props().customNavHeight).toBe(0);
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
test('disabled', async () => {
|
|
30
|
+
expect(style.position).toBe("sticky");
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('background', async () => {
|
|
34
|
+
expect(style['background-color']).toBe('rgb(255, 0, 0)');
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
test('zIndex', async () => {
|
|
38
|
+
expect(style['z-index']).toBe("98");
|
|
39
|
+
})
|
|
40
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { expect, test, vi, describe } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import { nextTick } from 'vue';
|
|
4
|
+
import SwipeAction from '../../uni_modules/stellar-ui/components/ste-swipe-action/ste-swipe-action.vue';
|
|
5
|
+
import SwipeActionGroup from '../../uni_modules/stellar-ui/components/ste-swipe-action-group/ste-swipe-action-group.vue';
|
|
6
|
+
import { style2obj } from '../methods';
|
|
7
|
+
|
|
8
|
+
describe('Test SwipeActionGroup', async () => {
|
|
9
|
+
test('SwipeAction', async () => {
|
|
10
|
+
const wrapper = mount(SwipeAction, {
|
|
11
|
+
template: `<ste-swipe-action>
|
|
12
|
+
<view style="height: 90rpx;">内容区域</view>
|
|
13
|
+
<template v-slot:right>
|
|
14
|
+
<div data-test="right-btn" style="width:100px;height: 100%;">删除</div>
|
|
15
|
+
</template>
|
|
16
|
+
</ste-swipe-action>`
|
|
17
|
+
})
|
|
18
|
+
await nextTick();
|
|
19
|
+
const el = wrapper.find('[data-test="swipe-action-view"]');
|
|
20
|
+
expect(el.exists()).toBe(true);
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const items = Array.from({ length: 10 }, (_, i) => ({
|
|
24
|
+
components: { SwipeAction },
|
|
25
|
+
template: `<SwipeAction>
|
|
26
|
+
<div style="height: 90rpx;">单元格${i + 1}</div>
|
|
27
|
+
<template v-slot:right>
|
|
28
|
+
<div data-test="right-btn" style="width:100px;height: 100%;">侧边按钮</div>
|
|
29
|
+
</template>
|
|
30
|
+
</SwipeAction>`
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
const wrapper = mount(SwipeActionGroup, {
|
|
34
|
+
slots: {
|
|
35
|
+
// 将子组件传递给默认插槽,并为子组件传参
|
|
36
|
+
default: items
|
|
37
|
+
},
|
|
38
|
+
propsData: {
|
|
39
|
+
mode: "right",
|
|
40
|
+
autoClose: true,
|
|
41
|
+
disabled: false,
|
|
42
|
+
swipeThreshold: 0.35,
|
|
43
|
+
duration: 300,
|
|
44
|
+
leftIcon: false,
|
|
45
|
+
rightIcon: false,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('SwipeActionGroup', async () => {
|
|
50
|
+
const itemEls = wrapper.findAll('[data-test="swipe-action"]');
|
|
51
|
+
expect(itemEls.length).toBe(10);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('mode', async () => {
|
|
55
|
+
expect(wrapper.props('mode')).toBe('right');
|
|
56
|
+
})
|
|
57
|
+
test('autoClose', async () => {
|
|
58
|
+
expect(wrapper.props('autoClose')).toBe(true);
|
|
59
|
+
})
|
|
60
|
+
test('disabled', async () => {
|
|
61
|
+
expect(wrapper.props('disabled')).toBe(false);
|
|
62
|
+
})
|
|
63
|
+
test('swipeThreshold', async () => {
|
|
64
|
+
expect(wrapper.props('swipeThreshold')).toBe(0.35);
|
|
65
|
+
})
|
|
66
|
+
test('duration', async () => {
|
|
67
|
+
expect(wrapper.props('duration')).toBe(300);
|
|
68
|
+
})
|
|
69
|
+
test('leftIcon', async () => {
|
|
70
|
+
expect(wrapper.props('leftIcon')).toBe(false);
|
|
71
|
+
})
|
|
72
|
+
test('rightIcon', async () => {
|
|
73
|
+
expect(wrapper.props('rightIcon')).toBe(false);
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import Swiper from '../../uni_modules/stellar-ui/components/ste-swiper/ste-swiper.vue';
|
|
3
|
+
import SwiperItem from '../../uni_modules/stellar-ui/components/ste-swiper-item/ste-swiper-item.vue';
|
|
4
|
+
import { createVue } from '../methods';
|
|
5
|
+
import { mount } from '@vue/test-utils';
|
|
6
|
+
|
|
7
|
+
describe('Swiper Component', async () => {
|
|
8
|
+
const vm = createVue({
|
|
9
|
+
components: { "ste-swiper": Swiper, "ste-swiper-item": SwiperItem },
|
|
10
|
+
template: `<ste-swiper ref="swiper" :current.sync="current" width="750">
|
|
11
|
+
<ste-swiper-item v-for="(m, i) in imgs" :key="i">
|
|
12
|
+
<view>内容{{ i + 1 }}</view>
|
|
13
|
+
<image :src="m" mode="widthFix"></image>
|
|
14
|
+
</ste-swiper-item>
|
|
15
|
+
</ste-swiper>`,
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
width: 750,
|
|
19
|
+
current: 0,
|
|
20
|
+
imgs: [
|
|
21
|
+
'https://image.whzb.com/chain/StellarUI/image/img1.jpg',
|
|
22
|
+
'https://image.whzb.com/chain/StellarUI/image/img2.jfif',
|
|
23
|
+
'https://image.whzb.com/chain/StellarUI/image/img3.jpg',
|
|
24
|
+
'https://image.whzb.com/chain/StellarUI/image/img4.jpg',
|
|
25
|
+
'https://image.whzb.com/chain/StellarUI/image/img1.jpg',
|
|
26
|
+
'https://image.whzb.com/chain/StellarUI/image/img2.jfif',
|
|
27
|
+
'https://image.whzb.com/chain/StellarUI/image/img3.jpg',
|
|
28
|
+
'https://image.whzb.com/chain/StellarUI/image/img4.jpg',
|
|
29
|
+
],
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}, true)
|
|
33
|
+
|
|
34
|
+
const wrapper = mount(Swiper, {
|
|
35
|
+
propsData: {
|
|
36
|
+
disabled: false,
|
|
37
|
+
width: 750,
|
|
38
|
+
height: 1334,
|
|
39
|
+
duration: 300,
|
|
40
|
+
swipeThreshold: 0.35,
|
|
41
|
+
indicatorDots: false,
|
|
42
|
+
indicatorColor: "#ffffff",
|
|
43
|
+
indicatorActiveColor: "#ffffff",
|
|
44
|
+
autoplay: false,
|
|
45
|
+
interval: 3000,
|
|
46
|
+
circular: false,
|
|
47
|
+
previousMargin: 0,
|
|
48
|
+
nextMargin: 0
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
await new Promise(r => setTimeout(r, 500));
|
|
53
|
+
|
|
54
|
+
test("list-item", async () => {
|
|
55
|
+
const list = vm.$el.querySelectorAll('[data-test="swiper-item"]');
|
|
56
|
+
expect(list.length).toBe(8);
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
test("position", async () => {
|
|
60
|
+
const translateX = vm.$refs.swiper.translateX
|
|
61
|
+
expect(translateX).toBe(0)
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
test("current", async () => {
|
|
65
|
+
vm.current = 1
|
|
66
|
+
await new Promise(resolve => setTimeout(resolve, 500))
|
|
67
|
+
expect(vm.$refs.swiper.translateX).toBe(-375)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
test("direction-vertical", async () => {
|
|
71
|
+
const vm = createVue({
|
|
72
|
+
components: { "ste-swiper": Swiper, "ste-swiper-item": SwiperItem },
|
|
73
|
+
template: `<ste-swiper ref="swiper" :current.sync="current" height="1334" direction="vertical">
|
|
74
|
+
<ste-swiper-item v-for="(m, i) in imgs" :key="i">
|
|
75
|
+
<view>内容{{ i + 1 }}</view>
|
|
76
|
+
<image :src="m" mode="widthFix"></image>
|
|
77
|
+
</ste-swiper-item>
|
|
78
|
+
</ste-swiper>`,
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
current: 0,
|
|
82
|
+
imgs: [
|
|
83
|
+
'https://image.whzb.com/chain/StellarUI/image/img1.jpg',
|
|
84
|
+
'https://image.whzb.com/chain/StellarUI/image/img2.jfif',
|
|
85
|
+
'https://image.whzb.com/chain/StellarUI/image/img3.jpg',
|
|
86
|
+
'https://image.whzb.com/chain/StellarUI/image/img4.jpg',
|
|
87
|
+
'https://image.whzb.com/chain/StellarUI/image/img1.jpg',
|
|
88
|
+
'https://image.whzb.com/chain/StellarUI/image/img2.jfif',
|
|
89
|
+
'https://image.whzb.com/chain/StellarUI/image/img3.jpg',
|
|
90
|
+
'https://image.whzb.com/chain/StellarUI/image/img4.jpg',
|
|
91
|
+
],
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
await nextTick();
|
|
96
|
+
const translateX = vm.$refs.swiper.translateY
|
|
97
|
+
expect(translateX).toBe(0)
|
|
98
|
+
vm.current = 1
|
|
99
|
+
await new Promise(resolve => setTimeout(resolve, 500))
|
|
100
|
+
expect(vm.$refs.swiper.translateY).toBe(-667)
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
test("disabled", () => {
|
|
104
|
+
expect(wrapper.props().disabled).toBe(false)
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
test("autoplay", () => {
|
|
108
|
+
expect(wrapper.props().autoplay).toBe(false)
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
test("current", () => {
|
|
112
|
+
expect(wrapper.props().current).toBe(0)
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
test("interval", () => {
|
|
116
|
+
expect(wrapper.props().interval).toBe(3000)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
test("circular", () => {
|
|
120
|
+
expect(wrapper.props().circular).toBe(false)
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
test("previousMargin", () => {
|
|
124
|
+
expect(wrapper.props().previousMargin).toBe(0)
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
test("nextMargin", () => {
|
|
128
|
+
expect(wrapper.props().nextMargin).toBe(0)
|
|
129
|
+
})
|
|
130
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { nextTick } from 'vue';
|
|
3
|
+
import steSwitch from '../../uni_modules/stellar-ui/components/ste-switch/ste-switch.vue';
|
|
4
|
+
import { expect } from 'vitest';
|
|
5
|
+
|
|
6
|
+
describe('Switch', () => {
|
|
7
|
+
let size = 100;
|
|
8
|
+
const wrapper = mount(steSwitch, {
|
|
9
|
+
propsData: {
|
|
10
|
+
size,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
const switchDom = wrapper.get('[data-test="switch"]');
|
|
14
|
+
|
|
15
|
+
test('size', () => {
|
|
16
|
+
let width = (size * 2 + 4) / 2 + 'px';
|
|
17
|
+
let height = (size + 4) / 2 + 'px';
|
|
18
|
+
expect(switchDom.element.style._values.width).toBe(width);
|
|
19
|
+
expect(switchDom.element.style._values.height).toBe(height);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('activeColor', () => {
|
|
23
|
+
let activeColor = 'red';
|
|
24
|
+
const wrapper = mount(steSwitch, {
|
|
25
|
+
propsData: {
|
|
26
|
+
value: true,
|
|
27
|
+
activeColor,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const switchDom = wrapper.get('[data-test="switch"]');
|
|
31
|
+
expect(switchDom.element.style._values.background).toBe(activeColor);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('inactiveColor', () => {
|
|
35
|
+
let inactiveColor = 'black';
|
|
36
|
+
const wrapper = mount(steSwitch, {
|
|
37
|
+
propsData: {
|
|
38
|
+
inactiveColor,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
const switchDom = wrapper.get('[data-test="switch"]');
|
|
42
|
+
expect(switchDom.element.style._values.background).toBe(inactiveColor);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('loading', () => {
|
|
46
|
+
const wrapper = mount(steSwitch, {
|
|
47
|
+
propsData: {
|
|
48
|
+
loading: true,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
expect(wrapper.contains('[data-test="loading"]')).toBe(true);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import Tabs from '../../uni_modules/stellar-ui/components/ste-tabs/ste-tabs.vue';
|
|
3
|
+
import Tab from '../../uni_modules/stellar-ui/components/ste-tab/ste-tab.vue';
|
|
4
|
+
import { createVue, style2obj } from '../methods';
|
|
5
|
+
import { mount } from '@vue/test-utils';
|
|
6
|
+
const list = [
|
|
7
|
+
{
|
|
8
|
+
title: '标签1',
|
|
9
|
+
image: `https://image.whzb.com/chain/StellarUI/图片.jpg`,
|
|
10
|
+
content: 'https://image.whzb.com/chain/StellarUI/image/img1.jpg',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
title: '标签2',
|
|
14
|
+
image: `https://image.whzb.com/chain/StellarUI/图片.jpg`,
|
|
15
|
+
content: 'https://image.whzb.com/chain/StellarUI/image/img2.jfif',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: '标签3标签3标签3标签3',
|
|
19
|
+
image: `https://image.whzb.com/chain/StellarUI/图片.jpg`,
|
|
20
|
+
content: 'https://image.whzb.com/chain/StellarUI/image/img3.jpg',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: '标签4',
|
|
24
|
+
image: `https://image.whzb.com/chain/StellarUI/图片.jpg`,
|
|
25
|
+
content: 'https://image.whzb.com/chain/StellarUI/image/img4.jpg',
|
|
26
|
+
},
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
describe('Tabs Component', async () => {
|
|
30
|
+
const vm = createVue({
|
|
31
|
+
components: { "ste-tabs": Tabs, "ste-tab": Tab },
|
|
32
|
+
template: `<ste-tabs ref="tabs" >
|
|
33
|
+
<ste-tab v-for="(item, index) in list" :key="index" :title="item.title" :index="index">
|
|
34
|
+
<view>{{ item.title }}内容</view>
|
|
35
|
+
<image style="width: 100%; height: 300px" :src="item.content" />
|
|
36
|
+
</ste-tab>
|
|
37
|
+
</ste-tabs>`,
|
|
38
|
+
data() {
|
|
39
|
+
return { list }
|
|
40
|
+
}
|
|
41
|
+
}, true)
|
|
42
|
+
|
|
43
|
+
const wrapper = mount(Tabs, {
|
|
44
|
+
propsData: {
|
|
45
|
+
active: 0,
|
|
46
|
+
type: "line",
|
|
47
|
+
showImage: false,
|
|
48
|
+
showTitle: true,
|
|
49
|
+
showSubtitle: false,
|
|
50
|
+
color: "#0090ff",
|
|
51
|
+
background: "#000000",
|
|
52
|
+
radius: 0,
|
|
53
|
+
duration: 0.3,
|
|
54
|
+
showLine: true,
|
|
55
|
+
lineWidth: 52,
|
|
56
|
+
lineHeight: 6,
|
|
57
|
+
border: false,
|
|
58
|
+
ellipsis: false,
|
|
59
|
+
tabWidth: "auto",
|
|
60
|
+
tabPadding: 24,
|
|
61
|
+
tabSpace: 0,
|
|
62
|
+
divideNum: 4,
|
|
63
|
+
sticky: false,
|
|
64
|
+
offsetTop: 0,
|
|
65
|
+
swipeable: false,
|
|
66
|
+
titleColor: "#000000",
|
|
67
|
+
activeTitleColor: "#000000",
|
|
68
|
+
titleHeight: 48,
|
|
69
|
+
subColor: "#000000",
|
|
70
|
+
activeSubColor: "#ffffff",
|
|
71
|
+
subTitleHeight: 42,
|
|
72
|
+
subTitleRadius: 21,
|
|
73
|
+
imageWidth: 80,
|
|
74
|
+
imageHeight: 80,
|
|
75
|
+
imageRadius: "50%",
|
|
76
|
+
imageBorderWidth: 4,
|
|
77
|
+
showGapLine: false,
|
|
78
|
+
lock: false,
|
|
79
|
+
disabled: false,
|
|
80
|
+
pullDown: false,
|
|
81
|
+
placeholder: "请选择",
|
|
82
|
+
maskTop: 0,
|
|
83
|
+
maskRight: 0,
|
|
84
|
+
maskBottom: 0,
|
|
85
|
+
maskLeft: 0,
|
|
86
|
+
maskZindex: 1001
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
92
|
+
|
|
93
|
+
test("tab-item", async () => {
|
|
94
|
+
const tabs = vm.$el.querySelectorAll('[data-test="tab"]');
|
|
95
|
+
expect(tabs.length).toBe(4);
|
|
96
|
+
const titles = vm.$el.querySelectorAll('[data-test="tab-title"]');
|
|
97
|
+
expect(titles.length).toBe(4);
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
test("showImage", async () => {
|
|
101
|
+
const vm = createVue({
|
|
102
|
+
components: { "ste-tabs": Tabs, "ste-tab": Tab },
|
|
103
|
+
template: `<ste-tabs ref="tabs" :showImage="true">
|
|
104
|
+
<ste-tab v-for="(item, index) in list" :key="index" :title="item.title" :index="index" >
|
|
105
|
+
<view>{{ item.title }}内容</view>
|
|
106
|
+
<image style="width: 100%; height: 300px" :src="item.content" />
|
|
107
|
+
</ste-tab>
|
|
108
|
+
</ste-tabs>`,
|
|
109
|
+
data() {
|
|
110
|
+
return { list }
|
|
111
|
+
}
|
|
112
|
+
}, true)
|
|
113
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
114
|
+
const imgs = vm.$el.querySelectorAll('[date-test="tab-image"]');
|
|
115
|
+
expect(imgs.length).toBe(4);
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
test("showSubtitle", async () => {
|
|
119
|
+
const vm = createVue({
|
|
120
|
+
components: { "ste-tabs": Tabs, "ste-tab": Tab },
|
|
121
|
+
template: `<ste-tabs ref="tabs" :showSubtitle="true">
|
|
122
|
+
<ste-tab v-for="(item, index) in list" :key="index" :title="item.title" :index="index" >
|
|
123
|
+
<view>{{ item.title }}内容</view>
|
|
124
|
+
<image style="width: 100%; height: 300px" :src="item.content" />
|
|
125
|
+
</ste-tab>
|
|
126
|
+
</ste-tabs>`,
|
|
127
|
+
data() {
|
|
128
|
+
return { list }
|
|
129
|
+
}
|
|
130
|
+
}, true)
|
|
131
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
132
|
+
const subtitles = vm.$el.querySelectorAll('[data-test="tab-sub-title"]');
|
|
133
|
+
expect(subtitles.length).toBe(4);
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
test("color", async () => {
|
|
137
|
+
const vm = createVue({
|
|
138
|
+
components: { "ste-tabs": Tabs, "ste-tab": Tab },
|
|
139
|
+
template: `<ste-tabs ref="tabs" color="#f00">
|
|
140
|
+
<ste-tab v-for="(item, index) in list" :key="index" :title="item.title" :index="index" >
|
|
141
|
+
<view>{{ item.title }}内容</view>
|
|
142
|
+
<image style="width: 100%; height: 300px" :src="item.content" />
|
|
143
|
+
</ste-tab>
|
|
144
|
+
</ste-tabs>`,
|
|
145
|
+
data() {
|
|
146
|
+
return { list }
|
|
147
|
+
}
|
|
148
|
+
}, true)
|
|
149
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
150
|
+
const tabs = vm.$el;
|
|
151
|
+
expect(tabs.style._values["--tabs-card-background-active"]).toBe('rgba(255,0,0,0.1)');
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
test("background", async () => {
|
|
155
|
+
const vm = createVue({
|
|
156
|
+
components: { "ste-tabs": Tabs, "ste-tab": Tab },
|
|
157
|
+
template: `<ste-tabs ref="tabs" background="#f00">
|
|
158
|
+
<ste-tab v-for="(item, index) in list" :key="index" :title="item.title" :index="index" >
|
|
159
|
+
<view>{{ item.title }}内容</view>
|
|
160
|
+
<image style="width: 100%; height: 300px" :src="item.content" />
|
|
161
|
+
</ste-tab>
|
|
162
|
+
</ste-tabs>`,
|
|
163
|
+
data() {
|
|
164
|
+
return { list }
|
|
165
|
+
}
|
|
166
|
+
})
|
|
167
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
168
|
+
const bg = vm.$refs.tabs.cmpListBackground.backgroundColor;
|
|
169
|
+
expect(bg).toBe('#f00');
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
test("titleColor and activeTitleColor", async () => {
|
|
173
|
+
const vm = createVue({
|
|
174
|
+
components: { "ste-tabs": Tabs, "ste-tab": Tab },
|
|
175
|
+
template: `<ste-tabs ref="tabs" titleColor="#f00" activeTitleColor="#00f">
|
|
176
|
+
<ste-tab v-for="(item, index) in list" :key="index" :title="item.title" :index="index" >
|
|
177
|
+
<view>{{ item.title }}内容</view>
|
|
178
|
+
<image style="width: 100%; height: 300px" :src="item.content" />
|
|
179
|
+
</ste-tab>
|
|
180
|
+
</ste-tabs>`,
|
|
181
|
+
data() {
|
|
182
|
+
return { list }
|
|
183
|
+
}
|
|
184
|
+
})
|
|
185
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
186
|
+
const style = vm.$refs.tabs.cmpRootStyle;
|
|
187
|
+
expect(style['--tabs-title-color']).toBe('#f00');
|
|
188
|
+
expect(style['--tabs-active-title-color']).toBe('#00f');
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
test("el-height", async () => {
|
|
192
|
+
const vm = createVue({
|
|
193
|
+
components: { "ste-tabs": Tabs, "ste-tab": Tab },
|
|
194
|
+
template: `<ste-tabs ref="tabs" titleHeight="90" subTitleHeight="60" subTitleRadius="30" imageWidth="60" imageHeight="60" imageRadius="10">
|
|
195
|
+
<ste-tab v-for="(item, index) in list" :key="index" :title="item.title" :index="index" >
|
|
196
|
+
<view>{{ item.title }}内容</view>
|
|
197
|
+
<image style="width: 100%; height: 300px" :src="item.content" />
|
|
198
|
+
</ste-tab>
|
|
199
|
+
</ste-tabs>`,
|
|
200
|
+
data() {
|
|
201
|
+
return { list }
|
|
202
|
+
}
|
|
203
|
+
})
|
|
204
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
205
|
+
const style = vm.$refs.tabs.cmpRootStyle;
|
|
206
|
+
expect(style['--tabs-title-height']).toBe('45px');
|
|
207
|
+
expect(style['--tabs-sub-title-height']).toBe('30px');
|
|
208
|
+
expect(style['--tabs-sub-title-radius']).toBe('15px');
|
|
209
|
+
expect(style['--tabs-image-width']).toBe('30px');
|
|
210
|
+
expect(style['--tabs-image-height']).toBe('30px');
|
|
211
|
+
expect(style['--tabs-image-radius']).toBe('5px');
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
test("active", async () => {
|
|
215
|
+
expect(wrapper.props().active).toBe(0);
|
|
216
|
+
})
|
|
217
|
+
test("type", async () => {
|
|
218
|
+
expect(wrapper.props().type).toBe('line');
|
|
219
|
+
})
|
|
220
|
+
test("radius", () => {
|
|
221
|
+
expect(wrapper.props().radius).toBe(0);
|
|
222
|
+
})
|
|
223
|
+
test("titleColor", () => {
|
|
224
|
+
expect(wrapper.props().titleColor).toBe('#000000');
|
|
225
|
+
})
|
|
226
|
+
test("activeTitleColor", () => {
|
|
227
|
+
expect(wrapper.props().activeTitleColor).toBe('#000000');
|
|
228
|
+
})
|
|
229
|
+
test("titleHeight", () => {
|
|
230
|
+
expect(wrapper.props().titleHeight).toBe(48);
|
|
231
|
+
})
|
|
232
|
+
test("subTitleHeight", () => {
|
|
233
|
+
expect(wrapper.props().subTitleHeight).toBe(42);
|
|
234
|
+
})
|
|
235
|
+
test("imageBorderWidth", () => {
|
|
236
|
+
expect(wrapper.props().imageBorderWidth).toBe(4);
|
|
237
|
+
})
|
|
238
|
+
test("showGapLine", () => {
|
|
239
|
+
expect(wrapper.props().showGapLine).toBe(false);
|
|
240
|
+
})
|
|
241
|
+
test("lock", () => {
|
|
242
|
+
expect(wrapper.props().lock).toBe(false);
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
test("disabled", () => {
|
|
246
|
+
expect(wrapper.props().disabled).toBe(false);
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
test("pullDown", () => {
|
|
250
|
+
expect(wrapper.props().pullDown).toBe(false);
|
|
251
|
+
})
|
|
252
|
+
|
|
253
|
+
test("placeholder", () => {
|
|
254
|
+
expect(wrapper.props().placeholder).toBe("请选择");
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
test("maskTop", () => {
|
|
258
|
+
expect(wrapper.props().maskTop).toBe(0);
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
test("maskBottom", () => {
|
|
262
|
+
expect(wrapper.props().maskBottom).toBe(0)
|
|
263
|
+
})
|
|
264
|
+
test("maskRight", () => {
|
|
265
|
+
expect(wrapper.props().maskRight).toBe(0)
|
|
266
|
+
})
|
|
267
|
+
test("maskLeft", () => {
|
|
268
|
+
expect(wrapper.props().maskLeft).toBe(0)
|
|
269
|
+
})
|
|
270
|
+
test("maskZindex", () => {
|
|
271
|
+
expect(wrapper.props().maskZindex).toBe(1001)
|
|
272
|
+
})
|
|
273
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { nextTick } from 'vue';
|
|
3
|
+
import steText from '../../uni_modules/stellar-ui/components/ste-text/ste-text.vue';
|
|
4
|
+
|
|
5
|
+
describe('Test Text', () => {
|
|
6
|
+
test('text', async () => {
|
|
7
|
+
const text = 'Stellar UI,全面的组件和便捷的工具会让您信手拈来,如鱼得水';
|
|
8
|
+
const wrapper = mount(steText, {
|
|
9
|
+
slots: {
|
|
10
|
+
default: text,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const rootEl = wrapper.get('.ste-text-root');
|
|
15
|
+
expect(rootEl.text()).toBe(text);
|
|
16
|
+
});
|
|
17
|
+
});
|