@wot-ui/ui 1.0.0 → 2.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +134 -0
- package/attributes.json +1 -0
- package/changelog.md +63 -0
- package/common/AbortablePromise.ts +28 -0
- package/common/canvasHelper.ts +49 -0
- package/common/clickoutside.ts +25 -0
- package/common/event.ts +8 -0
- package/common/formatDate.ts +68 -0
- package/common/interceptor.ts +43 -0
- package/common/props.ts +53 -0
- package/common/util.ts +836 -0
- package/components/wd-action-sheet/index.scss +232 -0
- package/components/wd-action-sheet/types.ts +155 -0
- package/components/wd-action-sheet/wd-action-sheet.vue +176 -0
- package/components/wd-avatar/index.scss +150 -0
- package/components/wd-avatar/types.ts +98 -0
- package/components/wd-avatar/wd-avatar.vue +184 -0
- package/components/wd-avatar-group/index.scss +11 -0
- package/components/wd-avatar-group/types.ts +61 -0
- package/components/wd-avatar-group/wd-avatar-group.vue +115 -0
- package/components/wd-backtop/index.scss +67 -0
- package/components/wd-backtop/types.ts +66 -0
- package/components/wd-backtop/wd-backtop.vue +57 -0
- package/components/wd-badge/index.scss +116 -0
- package/components/wd-badge/types.ts +94 -0
- package/components/wd-badge/wd-badge.vue +78 -0
- package/components/wd-button/index.scss +436 -0
- package/components/wd-button/types.ts +204 -0
- package/components/wd-button/wd-button.vue +210 -0
- package/components/wd-calendar/index.scss +97 -0
- package/components/wd-calendar/types.ts +221 -0
- package/components/wd-calendar/wd-calendar.vue +339 -0
- package/components/wd-calendar-view/index.scss +41 -0
- package/components/wd-calendar-view/month/index.scss +144 -0
- package/components/wd-calendar-view/month/month.vue +389 -0
- package/components/wd-calendar-view/month/types.ts +70 -0
- package/components/wd-calendar-view/monthPanel/index.scss +84 -0
- package/components/wd-calendar-view/monthPanel/month-panel.vue +541 -0
- package/components/wd-calendar-view/monthPanel/types.ts +151 -0
- package/components/wd-calendar-view/types.ts +166 -0
- package/components/wd-calendar-view/utils.ts +318 -0
- package/components/wd-calendar-view/wd-calendar-view.vue +117 -0
- package/components/wd-calendar-view/year/index.scss +148 -0
- package/components/wd-calendar-view/year/types.ts +74 -0
- package/components/wd-calendar-view/year/year.vue +206 -0
- package/components/wd-calendar-view/yearPanel/index.scss +42 -0
- package/components/wd-calendar-view/yearPanel/types.ts +96 -0
- package/components/wd-calendar-view/yearPanel/year-panel.vue +249 -0
- package/components/wd-card/index.scss +104 -0
- package/components/wd-card/types.ts +47 -0
- package/components/wd-card/wd-card.vue +38 -0
- package/components/wd-cascader/index.scss +154 -0
- package/components/wd-cascader/types.ts +191 -0
- package/components/wd-cascader/wd-cascader.vue +589 -0
- package/components/wd-cell/index.scss +244 -0
- package/components/wd-cell/types.ts +205 -0
- package/components/wd-cell/wd-cell.vue +172 -0
- package/components/wd-cell-group/index.scss +53 -0
- package/components/wd-cell-group/types.ts +97 -0
- package/components/wd-cell-group/wd-cell-group.vue +48 -0
- package/components/wd-checkbox/index.scss +166 -0
- package/components/wd-checkbox/types.ts +118 -0
- package/components/wd-checkbox/wd-checkbox.vue +216 -0
- package/components/wd-checkbox-group/index.scss +5 -0
- package/components/wd-checkbox-group/types.ts +93 -0
- package/components/wd-checkbox-group/wd-checkbox-group.vue +148 -0
- package/components/wd-circle/index.scss +28 -0
- package/components/wd-circle/types.ts +54 -0
- package/components/wd-circle/wd-circle.vue +306 -0
- package/components/wd-col/index.scss +5 -0
- package/components/wd-col/types.ts +16 -0
- package/components/wd-col/wd-col.vue +83 -0
- package/components/wd-collapse/index.scss +71 -0
- package/components/wd-collapse/types.ts +68 -0
- package/components/wd-collapse/wd-collapse.vue +165 -0
- package/components/wd-collapse-item/index.scss +86 -0
- package/components/wd-collapse-item/types.ts +62 -0
- package/components/wd-collapse-item/wd-collapse-item.vue +184 -0
- package/components/wd-config-provider/index.scss +10 -0
- package/components/wd-config-provider/types.ts +2061 -0
- package/components/wd-config-provider/wd-config-provider.vue +61 -0
- package/components/wd-count-down/index.scss +16 -0
- package/components/wd-count-down/types.ts +58 -0
- package/components/wd-count-down/utils.ts +52 -0
- package/components/wd-count-down/wd-count-down.vue +62 -0
- package/components/wd-count-to/index.scss +25 -0
- package/components/wd-count-to/types.ts +121 -0
- package/components/wd-count-to/wd-count-to.vue +126 -0
- package/components/wd-curtain/index.scss +96 -0
- package/components/wd-curtain/types.ts +82 -0
- package/components/wd-curtain/wd-curtain.vue +172 -0
- package/components/wd-datetime-picker/index.scss +133 -0
- package/components/wd-datetime-picker/types.ts +198 -0
- package/components/wd-datetime-picker/wd-datetime-picker.vue +526 -0
- package/components/wd-datetime-picker-view/types.ts +171 -0
- package/components/wd-datetime-picker-view/util.ts +30 -0
- package/components/wd-datetime-picker-view/wd-datetime-picker-view.vue +402 -0
- package/components/wd-dialog/index.scss +281 -0
- package/components/wd-dialog/index.ts +168 -0
- package/components/wd-dialog/types.ts +452 -0
- package/components/wd-dialog/wd-dialog.vue +586 -0
- package/components/wd-divider/index.scss +122 -0
- package/components/wd-divider/types.ts +50 -0
- package/components/wd-divider/wd-divider.vue +54 -0
- package/components/wd-drop-menu/index.scss +90 -0
- package/components/wd-drop-menu/types.ts +38 -0
- package/components/wd-drop-menu/wd-drop-menu.vue +168 -0
- package/components/wd-drop-menu-item/index.scss +96 -0
- package/components/wd-drop-menu-item/types.ts +93 -0
- package/components/wd-drop-menu-item/wd-drop-menu-item.vue +205 -0
- package/components/wd-empty/index.scss +46 -0
- package/components/wd-empty/types.ts +37 -0
- package/components/wd-empty/wd-empty.vue +47 -0
- package/components/wd-fab/index.scss +124 -0
- package/components/wd-fab/types.ts +119 -0
- package/components/wd-fab/wd-fab.vue +322 -0
- package/components/wd-floating-panel/index.scss +73 -0
- package/components/wd-floating-panel/type.ts +32 -0
- package/components/wd-floating-panel/wd-floating-panel.vue +142 -0
- package/components/wd-form/adapters/zod.ts +56 -0
- package/components/wd-form/index.ts +2 -0
- package/components/wd-form/types.ts +133 -0
- package/components/wd-form/wd-form.vue +121 -0
- package/components/wd-form-item/index.scss +26 -0
- package/components/wd-form-item/types.ts +134 -0
- package/components/wd-form-item/wd-form-item.vue +182 -0
- package/components/wd-gap/index.scss +9 -0
- package/components/wd-gap/types.ts +26 -0
- package/components/wd-gap/wd-gap.vue +38 -0
- package/components/wd-grid/index.scss +11 -0
- package/components/wd-grid/types.ts +97 -0
- package/components/wd-grid/wd-grid.vue +48 -0
- package/components/wd-grid-item/index.scss +187 -0
- package/components/wd-grid-item/types.ts +98 -0
- package/components/wd-grid-item/wd-grid-item.vue +295 -0
- package/components/wd-icon/index.scss +46 -0
- package/components/wd-icon/types.ts +44 -0
- package/components/wd-icon/wd-icon.vue +66 -0
- package/components/wd-image-preview/index.scss +94 -0
- package/components/wd-image-preview/index.ts +95 -0
- package/components/wd-image-preview/types.ts +165 -0
- package/components/wd-image-preview/wd-image-preview.vue +233 -0
- package/components/wd-img/index.scss +82 -0
- package/components/wd-img/types.ts +96 -0
- package/components/wd-img/wd-img.vue +91 -0
- package/components/wd-img-cropper/index.scss +259 -0
- package/components/wd-img-cropper/types.ts +101 -0
- package/components/wd-img-cropper/wd-img-cropper.vue +653 -0
- package/components/wd-index-anchor/index.scss +34 -0
- package/components/wd-index-anchor/type.ts +9 -0
- package/components/wd-index-anchor/wd-index-anchor.vue +55 -0
- package/components/wd-index-bar/index.scss +68 -0
- package/components/wd-index-bar/type.ts +23 -0
- package/components/wd-index-bar/wd-index-bar.vue +157 -0
- package/components/wd-input/index.scss +129 -0
- package/components/wd-input/types.ts +165 -0
- package/components/wd-input/wd-input.vue +237 -0
- package/components/wd-input-number/index.scss +233 -0
- package/components/wd-input-number/types.ts +131 -0
- package/components/wd-input-number/wd-input-number.vue +473 -0
- package/components/wd-keyboard/constants.ts +81 -0
- package/components/wd-keyboard/index.scss +104 -0
- package/components/wd-keyboard/key/index.scss +103 -0
- package/components/wd-keyboard/key/index.vue +84 -0
- package/components/wd-keyboard/key/types.ts +44 -0
- package/components/wd-keyboard/types.ts +138 -0
- package/components/wd-keyboard/wd-keyboard.vue +236 -0
- package/components/wd-loading/index.scss +205 -0
- package/components/wd-loading/types.ts +61 -0
- package/components/wd-loading/wd-loading.vue +70 -0
- package/components/wd-loadmore/index.scss +62 -0
- package/components/wd-loadmore/types.ts +42 -0
- package/components/wd-loadmore/wd-loadmore.vue +68 -0
- package/components/wd-navbar/index.scss +96 -0
- package/components/wd-navbar/types.ts +74 -0
- package/components/wd-navbar/wd-navbar.vue +136 -0
- package/components/wd-navbar-capsule/index.scss +70 -0
- package/components/wd-navbar-capsule/types.ts +11 -0
- package/components/wd-navbar-capsule/wd-navbar-capsule.vue +48 -0
- package/components/wd-notice-bar/index.scss +94 -0
- package/components/wd-notice-bar/types.ts +97 -0
- package/components/wd-notice-bar/wd-notice-bar.vue +270 -0
- package/components/wd-notify/index.scss +114 -0
- package/components/wd-notify/index.ts +63 -0
- package/components/wd-notify/types.ts +130 -0
- package/components/wd-notify/wd-notify.vue +162 -0
- package/components/wd-overlay/index.scss +14 -0
- package/components/wd-overlay/types.ts +42 -0
- package/components/wd-overlay/wd-overlay.vue +55 -0
- package/components/wd-pagination/index.scss +71 -0
- package/components/wd-pagination/types.ts +69 -0
- package/components/wd-pagination/wd-pagination.vue +118 -0
- package/components/wd-password-input/index.scss +134 -0
- package/components/wd-password-input/types.ts +42 -0
- package/components/wd-password-input/wd-password-input.vue +51 -0
- package/components/wd-picker/index.scss +72 -0
- package/components/wd-picker/types.ts +141 -0
- package/components/wd-picker/wd-picker.vue +220 -0
- package/components/wd-picker-view/index.scss +93 -0
- package/components/wd-picker-view/types.ts +145 -0
- package/components/wd-picker-view/useSelection.ts +385 -0
- package/components/wd-picker-view/wd-picker-view.vue +227 -0
- package/components/wd-popover/index.scss +117 -0
- package/components/wd-popover/types.ts +106 -0
- package/components/wd-popover/wd-popover.vue +212 -0
- package/components/wd-popup/index.scss +89 -0
- package/components/wd-popup/types.ts +110 -0
- package/components/wd-popup/wd-popup.vue +174 -0
- package/components/wd-progress/index.scss +155 -0
- package/components/wd-progress/types.ts +94 -0
- package/components/wd-progress/wd-progress.vue +249 -0
- package/components/wd-radio/index.scss +189 -0
- package/components/wd-radio/types.ts +64 -0
- package/components/wd-radio/wd-radio.vue +164 -0
- package/components/wd-radio-group/index.scss +5 -0
- package/components/wd-radio-group/types.ts +70 -0
- package/components/wd-radio-group/wd-radio-group.vue +53 -0
- package/components/wd-rate/index.scss +57 -0
- package/components/wd-rate/types.ts +86 -0
- package/components/wd-rate/wd-rate.vue +168 -0
- package/components/wd-resize/index.scss +31 -0
- package/components/wd-resize/types.ts +14 -0
- package/components/wd-resize/wd-resize.vue +157 -0
- package/components/wd-root-portal/wd-root-portal.vue +77 -0
- package/components/wd-row/index.scss +6 -0
- package/components/wd-row/types.ts +36 -0
- package/components/wd-row/wd-row.vue +88 -0
- package/components/wd-search/index.scss +171 -0
- package/components/wd-search/types.ts +107 -0
- package/components/wd-search/wd-search.vue +198 -0
- package/components/wd-segmented/index.scss +155 -0
- package/components/wd-segmented/types.ts +81 -0
- package/components/wd-segmented/wd-segmented.vue +169 -0
- package/components/wd-select-picker/index.scss +72 -0
- package/components/wd-select-picker/types.ts +72 -0
- package/components/wd-select-picker/wd-select-picker.vue +371 -0
- package/components/wd-sidebar/index.scss +25 -0
- package/components/wd-sidebar/types.ts +34 -0
- package/components/wd-sidebar/wd-sidebar.vue +57 -0
- package/components/wd-sidebar-item/index.scss +91 -0
- package/components/wd-sidebar-item/types.ts +28 -0
- package/components/wd-sidebar-item/wd-sidebar-item.vue +118 -0
- package/components/wd-signature/index.scss +42 -0
- package/components/wd-signature/types.ts +295 -0
- package/components/wd-signature/wd-signature.vue +664 -0
- package/components/wd-skeleton/index.scss +112 -0
- package/components/wd-skeleton/types.ts +124 -0
- package/components/wd-skeleton/wd-skeleton.vue +110 -0
- package/components/wd-slide-verify/index.scss +112 -0
- package/components/wd-slide-verify/types.ts +98 -0
- package/components/wd-slide-verify/wd-slide-verify.vue +222 -0
- package/components/wd-slider/index.scss +485 -0
- package/components/wd-slider/types.ts +166 -0
- package/components/wd-slider/wd-slider.vue +529 -0
- package/components/wd-sort-button/index.scss +126 -0
- package/components/wd-sort-button/types.ts +68 -0
- package/components/wd-sort-button/wd-sort-button.vue +67 -0
- package/components/wd-step/index.scss +366 -0
- package/components/wd-step/types.ts +43 -0
- package/components/wd-step/wd-step.vue +181 -0
- package/components/wd-steps/index.scss +7 -0
- package/components/wd-steps/types.ts +50 -0
- package/components/wd-steps/wd-steps.vue +39 -0
- package/components/wd-sticky/index.scss +9 -0
- package/components/wd-sticky/types.ts +13 -0
- package/components/wd-sticky/wd-sticky.vue +192 -0
- package/components/wd-sticky-box/index.scss +6 -0
- package/components/wd-sticky-box/types.ts +20 -0
- package/components/wd-sticky-box/wd-sticky-box.vue +157 -0
- package/components/wd-swipe-action/index.scss +22 -0
- package/components/wd-swipe-action/types.ts +87 -0
- package/components/wd-swipe-action/wd-swipe-action.vue +320 -0
- package/components/wd-swiper/index.scss +69 -0
- package/components/wd-swiper/types.ts +275 -0
- package/components/wd-swiper/wd-swiper.vue +332 -0
- package/components/wd-swiper-nav/index.scss +179 -0
- package/components/wd-swiper-nav/types.ts +42 -0
- package/components/wd-swiper-nav/wd-swiper-nav.vue +42 -0
- package/components/wd-switch/index.scss +177 -0
- package/components/wd-switch/types.ts +93 -0
- package/components/wd-switch/wd-switch.vue +107 -0
- package/components/wd-tab/index.scss +16 -0
- package/components/wd-tab/types.ts +45 -0
- package/components/wd-tab/wd-tab.vue +99 -0
- package/components/wd-tabbar/index.scss +71 -0
- package/components/wd-tabbar/types.ts +79 -0
- package/components/wd-tabbar/wd-tabbar.vue +109 -0
- package/components/wd-tabbar-item/index.scss +50 -0
- package/components/wd-tabbar-item/types.ts +45 -0
- package/components/wd-tabbar-item/wd-tabbar-item.vue +101 -0
- package/components/wd-table/index.scss +128 -0
- package/components/wd-table/types.ts +160 -0
- package/components/wd-table/wd-table.vue +331 -0
- package/components/wd-table-column/index.scss +15 -0
- package/components/wd-table-column/types.ts +81 -0
- package/components/wd-table-column/wd-table-column.vue +198 -0
- package/components/wd-tabs/index.scss +332 -0
- package/components/wd-tabs/types.ts +155 -0
- package/components/wd-tabs/wd-tabs.vue +508 -0
- package/components/wd-tag/index.scss +325 -0
- package/components/wd-tag/types.ts +90 -0
- package/components/wd-tag/wd-tag.vue +158 -0
- package/components/wd-text/index.scss +52 -0
- package/components/wd-text/types.ts +107 -0
- package/components/wd-text/wd-text.vue +141 -0
- package/components/wd-textarea/index.scss +112 -0
- package/components/wd-textarea/types.ts +151 -0
- package/components/wd-textarea/wd-textarea.vue +212 -0
- package/components/wd-toast/index.scss +92 -0
- package/components/wd-toast/index.ts +97 -0
- package/components/wd-toast/types.ts +190 -0
- package/components/wd-toast/wd-toast.vue +158 -0
- package/components/wd-tooltip/index.scss +77 -0
- package/components/wd-tooltip/types.ts +105 -0
- package/components/wd-tooltip/wd-tooltip.vue +169 -0
- package/components/wd-tour/index.scss +106 -0
- package/components/wd-tour/types.ts +268 -0
- package/components/wd-tour/wd-tour.vue +518 -0
- package/components/wd-transition/index.scss +67 -0
- package/components/wd-transition/types.ts +106 -0
- package/components/wd-transition/wd-transition.vue +238 -0
- package/components/wd-upload/index.scss +204 -0
- package/components/wd-upload/types.ts +390 -0
- package/components/wd-upload/wd-upload.vue +565 -0
- package/components/wd-video-preview/index.scss +54 -0
- package/components/wd-video-preview/index.ts +64 -0
- package/components/wd-video-preview/types.ts +66 -0
- package/components/wd-video-preview/wd-video-preview.vue +141 -0
- package/components/wd-watermark/index.scss +21 -0
- package/components/wd-watermark/types.ts +130 -0
- package/components/wd-watermark/wd-watermark.vue +718 -0
- package/components/wot-ui/wot-ui.vue +5 -0
- package/composables/index.ts +16 -0
- package/composables/useCell.ts +34 -0
- package/composables/useChildren.ts +120 -0
- package/composables/useConfigProvider.ts +45 -0
- package/composables/useCountDown.ts +138 -0
- package/composables/useDeviceInfo.ts +136 -0
- package/composables/useLockScroll.ts +37 -0
- package/composables/useParent.ts +51 -0
- package/composables/usePopover.ts +212 -0
- package/composables/useQueue.ts +52 -0
- package/composables/useRaf.ts +37 -0
- package/composables/useTouch.ts +43 -0
- package/composables/useTranslate.ts +12 -0
- package/composables/useUpload.ts +366 -0
- package/global.d.ts +106 -0
- package/index.ts +6 -0
- package/locale/index.ts +32 -0
- package/locale/lang/ar-SA.ts +150 -0
- package/locale/lang/de-DE.ts +150 -0
- package/locale/lang/en-US.ts +150 -0
- package/locale/lang/es-ES.ts +150 -0
- package/locale/lang/fr-FR.ts +150 -0
- package/locale/lang/ja-JP.ts +150 -0
- package/locale/lang/ko-KR.ts +150 -0
- package/locale/lang/pt-PT.ts +150 -0
- package/locale/lang/ru-RU.ts +150 -0
- package/locale/lang/th-TH.ts +150 -0
- package/locale/lang/tr-TR.ts +155 -0
- package/locale/lang/ug-CN.ts +154 -0
- package/locale/lang/vi-VN.ts +89 -0
- package/locale/lang/zh-CN.ts +154 -0
- package/locale/lang/zh-HK.ts +78 -0
- package/locale/lang/zh-TW.ts +78 -0
- package/package.json +1 -11
- package/styles/iconfont/iconfont.scss +1243 -0
- package/styles/mixin/_config.scss +7 -0
- package/styles/mixin/_function.scss +44 -0
- package/styles/mixin/_mixin.scss +473 -0
- package/styles/theme/base/color.scss +210 -0
- package/styles/theme/base/font.scss +13 -0
- package/styles/theme/base/index.scss +8 -0
- package/styles/theme/base/insets.scss +32 -0
- package/styles/theme/base/number.scss +36 -0
- package/styles/theme/base/opacity.scss +9 -0
- package/styles/theme/base/radius.scss +13 -0
- package/styles/theme/base/stroke.scss +9 -0
- package/styles/theme/base/typography.scss +44 -0
- package/styles/theme/dark.scss +101 -0
- package/styles/theme/index.scss +16 -0
- package/styles/theme/light.scss +101 -0
- package/styles/variable.scss +472 -0
- package/tags.json +1 -0
- package/web-types.json +1 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss'as *;
|
|
2
|
+
@use '../../styles/variable.scss'as *;
|
|
3
|
+
|
|
4
|
+
// 组件高度
|
|
5
|
+
$sort-button-height: var(--wot-sort-button-height, $n-48) !default;
|
|
6
|
+
// 文字字号
|
|
7
|
+
$sort-button-text-font-size: var(--wot-sort-button-text-font-size, $typography-body-size-main) !default;
|
|
8
|
+
// 文字行高
|
|
9
|
+
$sort-button-text-line-height: var(--wot-sort-button-text-line-height, $typography-body-line--height-size-main) !default;
|
|
10
|
+
// 箭头图标尺寸
|
|
11
|
+
$sort-button-arrow-icon-size: var(--wot-sort-button-arrow-icon-size, $n-24) !default;
|
|
12
|
+
// 右侧区域尺寸
|
|
13
|
+
$sort-button-right-size: var(--wot-sort-button-right-size, $n-16) !default;
|
|
14
|
+
// 图标颜色
|
|
15
|
+
$sort-button-icon-color: var(--wot-sort-button-icon-color, $icon-auxiliary) !default;
|
|
16
|
+
// 图标激活颜色
|
|
17
|
+
$sort-button-icon-color-active: var(--wot-sort-button-icon-color-active, $primary-6) !default;
|
|
18
|
+
// 文字颜色
|
|
19
|
+
$sort-button-color: var(--wot-sort-button-color, $text-secondary) !default;
|
|
20
|
+
// 文字激活颜色
|
|
21
|
+
$sort-button-color-active: var(--wot-sort-button-color-active, $text-main) !default;
|
|
22
|
+
// 文字激活字重
|
|
23
|
+
$sort-button-font-weight-active: var(--wot-sort-button-font-weight-active, $font-weight-medium) !default;
|
|
24
|
+
// 下划线宽度
|
|
25
|
+
$sort-button-line-width: var(--wot-sort-button-line-width, $n-24) !default;
|
|
26
|
+
// 下划线高度
|
|
27
|
+
$sort-button-line-height: var(--wot-sort-button-line-height, $n-4) !default;
|
|
28
|
+
// 下划线颜色
|
|
29
|
+
$sort-button-line-color: var(--wot-sort-button-line-color, $primary-6) !default;
|
|
30
|
+
// 下划线底部距离
|
|
31
|
+
$sort-button-line-bottom: var(--wot-sort-button-line-bottom, $spacing-ultra-tight) !default;
|
|
32
|
+
// 右侧区域左间距
|
|
33
|
+
$sort-button-right-spacing-left: var(--wot-sort-button-right-spacing-left, $spacing-extra-tight) !default;
|
|
34
|
+
// 排序图标纵向间距
|
|
35
|
+
$sort-button-sort-spacing: var(--wot-sort-button-sort-spacing, $spacing-ultra-tight) !default;
|
|
36
|
+
|
|
37
|
+
@include b(sort-button) {
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
height: $sort-button-height;
|
|
40
|
+
align-items: center;
|
|
41
|
+
|
|
42
|
+
@include m(line) {
|
|
43
|
+
@include me(left) {
|
|
44
|
+
&::after {
|
|
45
|
+
position: absolute;
|
|
46
|
+
content: '';
|
|
47
|
+
width: $sort-button-line-width;
|
|
48
|
+
height: $sort-button-line-height;
|
|
49
|
+
bottom: $sort-button-line-bottom;
|
|
50
|
+
left: 50%;
|
|
51
|
+
transform: translate(-50%, 0);
|
|
52
|
+
background: $sort-button-line-color;
|
|
53
|
+
border-radius: calc($sort-button-line-height / 2);
|
|
54
|
+
transition: opacity .15s;
|
|
55
|
+
opacity: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&.is-active::after {
|
|
59
|
+
opacity: 1;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include e(wrapper) {
|
|
65
|
+
font-size: $sort-button-text-font-size;
|
|
66
|
+
line-height: $sort-button-text-line-height;
|
|
67
|
+
color: $sort-button-color;
|
|
68
|
+
word-break: break-all;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
height: 100%;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@include e(left) {
|
|
76
|
+
position: relative;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
height: 100%;
|
|
80
|
+
|
|
81
|
+
@include when(active) {
|
|
82
|
+
font-weight: $sort-button-font-weight-active;
|
|
83
|
+
color: $sort-button-color-active;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@include e(right) {
|
|
88
|
+
position: relative;
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
width: $sort-button-right-size;
|
|
92
|
+
height: $sort-button-right-size;
|
|
93
|
+
margin-left: $sort-button-right-spacing-left;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
align-items: center;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@include edeep(icon-up, icon-down) {
|
|
99
|
+
font-size: $sort-button-arrow-icon-size;
|
|
100
|
+
color: $sort-button-icon-color;
|
|
101
|
+
transition: color .15s;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@include edeep(icon-up) {
|
|
105
|
+
position: absolute;
|
|
106
|
+
top: 0;
|
|
107
|
+
transform: scale(0.5) translateY(calc(-1 * $sort-button-sort-spacing));
|
|
108
|
+
transform-origin: top;
|
|
109
|
+
|
|
110
|
+
@include m(active){
|
|
111
|
+
color: $sort-button-icon-color-active;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@include edeep(icon-down) {
|
|
116
|
+
position: absolute;
|
|
117
|
+
bottom: 0;
|
|
118
|
+
transform: scale(0.5) translateY($sort-button-sort-spacing);
|
|
119
|
+
transform-origin: bottom;
|
|
120
|
+
|
|
121
|
+
@include m(active){
|
|
122
|
+
color: $sort-button-icon-color-active;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeNumberProp, makeStringProp } from '../../common/props'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 排序按钮的排序方向值
|
|
6
|
+
* 可选值: -1 | 0 | 1
|
|
7
|
+
*/
|
|
8
|
+
export type SortButtonValue = -1 | 0 | 1
|
|
9
|
+
|
|
10
|
+
export const sortButtonProps = {
|
|
11
|
+
...baseProps,
|
|
12
|
+
/**
|
|
13
|
+
* 选中的箭头方向,1 表示升序,0 表示重置状态,-1 表示降序
|
|
14
|
+
* 类型: SortButtonValue
|
|
15
|
+
* 可选值: -1 | 0 | 1
|
|
16
|
+
* 默认值: 0
|
|
17
|
+
*/
|
|
18
|
+
modelValue: makeNumberProp<SortButtonValue>(0),
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 排序按钮展示的文案
|
|
22
|
+
* 类型: string
|
|
23
|
+
* 默认值: ''
|
|
24
|
+
*/
|
|
25
|
+
title: makeStringProp(''),
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 当展示双箭头时,是否允许手动重置按钮
|
|
29
|
+
* 类型: boolean
|
|
30
|
+
* 默认值: false
|
|
31
|
+
*/
|
|
32
|
+
allowReset: makeBooleanProp(false),
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 是否优先切换为降序,如果不开启则默认优先切换为升序
|
|
36
|
+
* 类型: boolean
|
|
37
|
+
* 默认值: false
|
|
38
|
+
*/
|
|
39
|
+
descFirst: makeBooleanProp(false),
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 是否展示下划线,当只有一个排序按钮时,通常不展示下划线
|
|
43
|
+
* 类型: boolean
|
|
44
|
+
* 默认值: false
|
|
45
|
+
*/
|
|
46
|
+
line: makeBooleanProp(false)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type SortButtonProps = ExtractPropTypes<typeof sortButtonProps>
|
|
50
|
+
|
|
51
|
+
/** 排序按钮 change 事件参数 */
|
|
52
|
+
export type SortButtonChangeDetail = {
|
|
53
|
+
/** 当前排序方向值 */
|
|
54
|
+
value: SortButtonValue
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type SortButtonEmits = {
|
|
58
|
+
/**
|
|
59
|
+
* 更新 modelValue 事件,切换排序方向时触发
|
|
60
|
+
* @param value 排序方向值
|
|
61
|
+
*/
|
|
62
|
+
'update:modelValue': [value: SortButtonValue]
|
|
63
|
+
/**
|
|
64
|
+
* 排序方向变化事件
|
|
65
|
+
* @param detail 变化事件参数
|
|
66
|
+
*/
|
|
67
|
+
change: [detail: SortButtonChangeDetail]
|
|
68
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="`wd-sort-button ${line ? 'wd-sort-button--line' : ''} ${customClass}`" :style="customStyle" @click="handleClick">
|
|
3
|
+
<view class="wd-sort-button__wrapper">
|
|
4
|
+
<view :class="`wd-sort-button__left ${modelValue !== 0 ? 'is-active' : ''}`">
|
|
5
|
+
{{ title }}
|
|
6
|
+
</view>
|
|
7
|
+
<view class="wd-sort-button__right">
|
|
8
|
+
<wd-icon name="caret-up" :custom-class="`wd-sort-button__icon-up ${modelValue === -1 ? 'wd-sort-button__icon-up--active' : ''}`" />
|
|
9
|
+
<wd-icon name="caret-down" :custom-class="`wd-sort-button__icon-down ${modelValue === 1 ? 'wd-sort-button__icon-down--active' : ''}`" />
|
|
10
|
+
</view>
|
|
11
|
+
</view>
|
|
12
|
+
</view>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
export default {
|
|
17
|
+
name: 'wd-sort-button',
|
|
18
|
+
options: {
|
|
19
|
+
addGlobalClass: true,
|
|
20
|
+
// #ifndef MP-TOUTIAO
|
|
21
|
+
virtualHost: true,
|
|
22
|
+
// #endif
|
|
23
|
+
styleIsolation: 'shared'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script lang="ts" setup>
|
|
29
|
+
import wdIcon from '../wd-icon/wd-icon.vue'
|
|
30
|
+
import { sortButtonProps, type SortButtonEmits, type SortButtonValue } from './types'
|
|
31
|
+
|
|
32
|
+
const props = defineProps(sortButtonProps)
|
|
33
|
+
|
|
34
|
+
const emit = defineEmits<SortButtonEmits>()
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 处理点击事件,按排序循环切换排序方向
|
|
38
|
+
* descFirst 开启时循环:0 → -1 → 1 → (0 或 -1)
|
|
39
|
+
* descFirst 关闭时循环:0 → 1 → -1 → (0 或 1)
|
|
40
|
+
*/
|
|
41
|
+
function handleClick() {
|
|
42
|
+
let { modelValue: value, allowReset, descFirst } = props
|
|
43
|
+
let next: SortButtonValue
|
|
44
|
+
if (descFirst) {
|
|
45
|
+
if (value === 0) {
|
|
46
|
+
next = -1
|
|
47
|
+
} else if (value === -1) {
|
|
48
|
+
next = 1
|
|
49
|
+
} else {
|
|
50
|
+
next = allowReset ? 0 : -1
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
if (value === 0) {
|
|
54
|
+
next = 1
|
|
55
|
+
} else if (value === 1) {
|
|
56
|
+
next = -1
|
|
57
|
+
} else {
|
|
58
|
+
next = allowReset ? 0 : 1
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
emit('update:modelValue', next)
|
|
62
|
+
emit('change', { value: next })
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
<style lang="scss">
|
|
66
|
+
@use './index.scss';
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss'as *;
|
|
2
|
+
@use '../../styles/variable.scss'as *;
|
|
3
|
+
|
|
4
|
+
// 组件级 CSS 变量定义
|
|
5
|
+
|
|
6
|
+
// 基础容器与布局 (Base & Layout)
|
|
7
|
+
// 内容区距头部的顶部外边距
|
|
8
|
+
$step-content-margin-top: var(--wot-step-content-margin-top, $spacing-super-tight) !default;
|
|
9
|
+
// 垂直布局时内容区的左外边距
|
|
10
|
+
$step-vertical-content-margin-left: var(--wot-step-vertical-content-margin-left, $n-32) !default;
|
|
11
|
+
// 垂直布局时内容区的底部内边距
|
|
12
|
+
$step-vertical-content-padding-bottom: var(--wot-step-vertical-content-padding-bottom, $n-20) !default;
|
|
13
|
+
// 垂直布局且为点状指示器时,头部的顶部绝对定位距离
|
|
14
|
+
$step-vertical-header-dot-top: var(--wot-step-vertical-header-dot-top, $n-6) !default;
|
|
15
|
+
|
|
16
|
+
// 步骤指示器(圆形/背景) (Indicator Circle)
|
|
17
|
+
// 圆形指示器的宽高尺寸
|
|
18
|
+
$step-indicator-size: var(--wot-step-indicator-size, $n-18) !default;
|
|
19
|
+
// 圆形指示器的圆角大小
|
|
20
|
+
$step-circle-border-radius: var(--wot-step-circle-border-radius, $radius-radius-full) !default;
|
|
21
|
+
// 等待 (wait) 状态下圆形指示器的背景色
|
|
22
|
+
$step-circle-bg: var(--wot-step-circle-bg, $filled-strong) !default;
|
|
23
|
+
// 进行中 (process) 状态下圆形指示器的背景色
|
|
24
|
+
$step-process-bg: var(--wot-step-process-bg, $primary-6) !default;
|
|
25
|
+
// 已完成 (finished) 状态下圆形指示器的背景色
|
|
26
|
+
$step-finished-bg: var(--wot-step-finished-bg, $primary-1) !default;
|
|
27
|
+
// 错误 (error) 状态下圆形指示器的背景色
|
|
28
|
+
$step-error-bg: var(--wot-step-error-bg, $danger-main) !default;
|
|
29
|
+
|
|
30
|
+
// 指示器文本(数字/对齐) (Indicator Text)
|
|
31
|
+
// 圆形指示器内部文本的字号
|
|
32
|
+
$step-circle-text-font-size: var(--wot-step-circle-text-font-size, $typography-label-size-main) !default;
|
|
33
|
+
// 圆形指示器内部文本的行高
|
|
34
|
+
$step-circle-text-line-height: var(--wot-step-circle-text-line-height, $typography-label-line--height-size-main) !default;
|
|
35
|
+
// 圆形指示器内部文本的字重
|
|
36
|
+
$step-circle-text-font-weight: var(--wot-step-circle-text-font-weight, $font-weight-medium) !default;
|
|
37
|
+
// 等待状态或默认状态下圆形指示器内文本颜色
|
|
38
|
+
$step-circle-text-color: var(--wot-step-circle-text-color, $text-secondary) !default;
|
|
39
|
+
// 进行中状态下圆形指示器内文本颜色
|
|
40
|
+
$step-circle-text-process-color: var(--wot-step-circle-text-process-color, $text-white) !default;
|
|
41
|
+
// 已完成状态下圆形指示器内文本颜色
|
|
42
|
+
$step-circle-text-finished-color: var(--wot-step-circle-text-finished-color, $primary-6) !default;
|
|
43
|
+
|
|
44
|
+
// 指示器图标 (Indicator Icon)
|
|
45
|
+
// 圆形指示器内置状态图标 (如完成时的对号或错误时的叉号) 的字号大小
|
|
46
|
+
$step-circle-icon-size: var(--wot-step-circle-icon-size, $n-12) !default;
|
|
47
|
+
// 外部自定义传入的图标 (通过 icon 属性) 的字号大小
|
|
48
|
+
$step-icon-size: var(--wot-step-icon-size, $n-18) !default;
|
|
49
|
+
// 等待或默认状态下图标的颜色
|
|
50
|
+
$step-icon-color: var(--wot-step-icon-color, $icon-auxiliary) !default;
|
|
51
|
+
// 激活 (如 process 或 finished) 状态下图标的颜色
|
|
52
|
+
$step-icon-color-active: var(--wot-step-icon-color-active, $primary-6) !default;
|
|
53
|
+
// 错误 (error) 状态下图标的颜色
|
|
54
|
+
$step-icon-error-color: var(--wot-step-icon-error-color, $danger-main) !default;
|
|
55
|
+
// 未激活部分的占位文本颜色
|
|
56
|
+
$step-inactive-color: var(--wot-step-inactive-color, $text-placeholder) !default;
|
|
57
|
+
// 错误状态整体的主色调(纯白文本场景下等使用)
|
|
58
|
+
$step-error-color: var(--wot-step-error-color, $text-white) !default;
|
|
59
|
+
|
|
60
|
+
// 连接线 (Line)
|
|
61
|
+
// 连接线与两侧指示器之间的间距
|
|
62
|
+
$step-line-spacing: var(--wot-step-line-spacing, $spacing-tight) !default;
|
|
63
|
+
// 连接线的默认底色 (对应未激活的线段)
|
|
64
|
+
$step-line-color: var(--wot-step-line-color, $border-main) !default;
|
|
65
|
+
// 激活 (完成状态) 下连接线的颜色
|
|
66
|
+
$step-line-active-color: var(--wot-step-line-active-color, $primary-6) !default;
|
|
67
|
+
|
|
68
|
+
// 点状指示器 (Dot Indicator)
|
|
69
|
+
// 点状指示器的宽高尺寸
|
|
70
|
+
$step-dot-size: var(--wot-step-dot-size, $n-10) !default;
|
|
71
|
+
// 等待 (wait) 状态下点状指示器的背景色
|
|
72
|
+
$step-dot-wait-bg: var(--wot-step-dot-wait-bg, $filled-strong) !default;
|
|
73
|
+
// 进行中 (process) 状态下点状指示器的背景色
|
|
74
|
+
$step-dot-process-bg: var(--wot-step-dot-process-bg, $primary-6) !default;
|
|
75
|
+
// 进行中 (process) 状态下点状指示器的描边颜色
|
|
76
|
+
$step-dot-process-border-color: var(--wot-step-dot-process-border-color, $primary-3) !default;
|
|
77
|
+
// 已完成 (finished) 状态下点状指示器的背景色
|
|
78
|
+
$step-dot-finished-bg: var(--wot-step-dot-finished-bg, $primary-3) !default;
|
|
79
|
+
// 已完成 (finished) 状态下点状指示器的描边颜色
|
|
80
|
+
$step-dot-finished-border-color: var(--wot-step-dot-finished-border-color, $primary-6) !default;
|
|
81
|
+
// 错误 (error) 状态下点状指示器的背景色
|
|
82
|
+
$step-dot-error-bg: var(--wot-step-dot-error-bg, $danger-main) !default;
|
|
83
|
+
|
|
84
|
+
// 标题文本 (Title Text)
|
|
85
|
+
// 标题文本字号大小
|
|
86
|
+
$step-title-font-size: var(--wot-step-title-font-size, $typography-body-size-main) !default;
|
|
87
|
+
// 标题文本行高
|
|
88
|
+
$step-title-line-height: var(--wot-step-title-line-height, $typography-body-line--height-size-main) !default;
|
|
89
|
+
// 标题文本字重
|
|
90
|
+
$step-title-font-weight: var(--wot-step-title-font-weight, $font-weight-regular) !default;
|
|
91
|
+
// 等待与完成状态下标题的颜色
|
|
92
|
+
$step-title-color: var(--wot-step-title-color, $text-secondary) !default;
|
|
93
|
+
// 进行中状态下标题的激活颜色
|
|
94
|
+
$step-title-color-active: var(--wot-step-title-color-active, $primary-6) !default;
|
|
95
|
+
// 错误状态下标题的颜色
|
|
96
|
+
$step-title-error-color: var(--wot-step-title-error-color, $danger-main) !default;
|
|
97
|
+
|
|
98
|
+
// 描述文本 (Description Text)
|
|
99
|
+
// 描述文本字号大小
|
|
100
|
+
$step-description-font-size: var(--wot-step-description-font-size, $typography-label-size-main) !default;
|
|
101
|
+
// 描述文本行高
|
|
102
|
+
$step-description-line-height: var(--wot-step-description-line-height, $typography-label-line--height-size-main) !default;
|
|
103
|
+
// 描述文本字重
|
|
104
|
+
$step-description-font-weight: var(--wot-step-description-font-weight, $font-weight-regular) !default;
|
|
105
|
+
// 描述文本颜色
|
|
106
|
+
$step-description-color: var(--wot-step-description-color, $text-secondary) !default;
|
|
107
|
+
// 描述文本距标题的距离
|
|
108
|
+
$step-description-margin-top: var(--wot-step-description-margin-top, $spacing-super-tight) !default;
|
|
109
|
+
// 描述文本的内边距
|
|
110
|
+
$step-description-padding: var(--wot-step-description-padding, $padding-zero $padding-ultra-tight) !default;
|
|
111
|
+
|
|
112
|
+
@include b(step) {
|
|
113
|
+
position: relative;
|
|
114
|
+
display: inline-block;
|
|
115
|
+
|
|
116
|
+
@include e(header) {
|
|
117
|
+
position: relative;
|
|
118
|
+
font-size: 0;
|
|
119
|
+
|
|
120
|
+
&.is-dot {
|
|
121
|
+
.wd-step__line {
|
|
122
|
+
width: calc(100% - 2 * $step-line-spacing - $step-dot-size);
|
|
123
|
+
left: calc($step-line-spacing + $step-dot-size);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@include e(indicator) {
|
|
129
|
+
display: inline-flex;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
align-items: center;
|
|
132
|
+
position: relative;
|
|
133
|
+
z-index: 1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@include e(circle) {
|
|
137
|
+
display: flex;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
align-items: center;
|
|
140
|
+
width: $step-indicator-size;
|
|
141
|
+
height: $step-indicator-size;
|
|
142
|
+
border-radius: $step-circle-border-radius;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// 状态提升至组件层,使用 @include me 控制内部所有元素的样式
|
|
146
|
+
@each $status in (finished, process, error, wait) {
|
|
147
|
+
@include m($status) {
|
|
148
|
+
@include me(circle) {
|
|
149
|
+
@if $status==finished {
|
|
150
|
+
background: $step-finished-bg;
|
|
151
|
+
color: $step-circle-text-finished-color;
|
|
152
|
+
@include pixelBorderSurround($step-circle-text-finished-color);
|
|
153
|
+
:deep(.wd-step__finished-icon) {
|
|
154
|
+
color: $step-circle-text-finished-color;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@else if $status==process {
|
|
159
|
+
background: $step-process-bg;
|
|
160
|
+
color: $step-circle-text-process-color;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@else if $status==error {
|
|
164
|
+
background: $step-error-bg;
|
|
165
|
+
color: $step-error-color;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@else if $status==wait {
|
|
169
|
+
background: $step-circle-bg;
|
|
170
|
+
color: $step-circle-text-color;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@else {
|
|
174
|
+
background: $step-circle-bg;
|
|
175
|
+
color: $step-circle-text-color;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@include me(dot) {
|
|
180
|
+
@if $status==finished {
|
|
181
|
+
background: $step-dot-finished-bg;
|
|
182
|
+
@include pixelBorderSurround($step-dot-finished-border-color);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@else if $status==process {
|
|
186
|
+
background: $step-dot-process-bg;
|
|
187
|
+
@include pixelBorderSurround($step-dot-process-border-color);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@else if $status==error {
|
|
191
|
+
background: $step-dot-error-bg;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@else if $status==wait {
|
|
195
|
+
background: $step-dot-wait-bg;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@else {
|
|
199
|
+
background: $step-dot-wait-bg;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@include me(line){
|
|
204
|
+
@if $status==finished {
|
|
205
|
+
background: $step-line-active-color;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
:deep(.wd-step__icon) {
|
|
210
|
+
@if $status==finished {
|
|
211
|
+
color: $step-icon-color-active;
|
|
212
|
+
}
|
|
213
|
+
@else if $status==process {
|
|
214
|
+
color: $step-icon-color-active;
|
|
215
|
+
}
|
|
216
|
+
@else if $status==error {
|
|
217
|
+
color: $step-icon-error-color;
|
|
218
|
+
}
|
|
219
|
+
@else if $status==wait {
|
|
220
|
+
color: $step-icon-color;
|
|
221
|
+
}
|
|
222
|
+
@else {
|
|
223
|
+
color: $step-icon-color;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@include me(title){
|
|
228
|
+
@if $status==finished {
|
|
229
|
+
color: $step-title-color;
|
|
230
|
+
}
|
|
231
|
+
@else if $status==process {
|
|
232
|
+
color: $step-title-color-active;
|
|
233
|
+
}
|
|
234
|
+
@else if $status==error {
|
|
235
|
+
color: $step-title-error-color;
|
|
236
|
+
}
|
|
237
|
+
@else if $status==wait {
|
|
238
|
+
color: $step-title-color;
|
|
239
|
+
}
|
|
240
|
+
@else {
|
|
241
|
+
color: $step-title-color;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@include edeep(finished-icon,error-icon) {
|
|
248
|
+
font-size: $step-circle-icon-size;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@include edeep(icon) {
|
|
252
|
+
font-size: $step-icon-size;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
@include e(circle-text) {
|
|
256
|
+
font-size: $step-circle-text-font-size;
|
|
257
|
+
line-height: $step-circle-text-line-height;
|
|
258
|
+
font-weight: $step-circle-text-font-weight;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@include e(line) {
|
|
262
|
+
position: absolute;
|
|
263
|
+
width: calc(100% - 2 * $step-line-spacing - $step-indicator-size);
|
|
264
|
+
height: $stroke-main;
|
|
265
|
+
background: $step-line-color;
|
|
266
|
+
// transform: scaleY(0.5);
|
|
267
|
+
top: 50%;
|
|
268
|
+
left: calc($step-line-spacing + $step-indicator-size);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
@include e(dot) {
|
|
272
|
+
position: relative;
|
|
273
|
+
display: block;
|
|
274
|
+
width: $step-dot-size;
|
|
275
|
+
height: $step-dot-size;
|
|
276
|
+
border-radius: 50%;
|
|
277
|
+
background: $step-line-color;
|
|
278
|
+
box-sizing: border-box;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
@include e(content) {
|
|
282
|
+
margin-top: $step-content-margin-top;
|
|
283
|
+
display: flex;
|
|
284
|
+
flex-direction: column;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@include e(title) {
|
|
288
|
+
color: $step-title-color;
|
|
289
|
+
font-weight: $step-title-font-weight;
|
|
290
|
+
font-size: $step-title-font-size;
|
|
291
|
+
line-height: $step-title-line-height;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
@include e(description) {
|
|
295
|
+
margin-top: $step-description-margin-top;
|
|
296
|
+
padding: $step-description-padding;
|
|
297
|
+
color: $step-description-color;
|
|
298
|
+
font-weight: $step-description-font-weight;
|
|
299
|
+
font-size: $step-description-font-size;
|
|
300
|
+
line-height: $step-description-line-height;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@include when(center) {
|
|
304
|
+
text-align: center;
|
|
305
|
+
.wd-step__line {
|
|
306
|
+
left: calc(50% + $step-line-spacing + $step-indicator-size / 2);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.wd-step__header.is-dot {
|
|
310
|
+
.wd-step__line {
|
|
311
|
+
left: calc(50% + $step-line-spacing + $step-dot-size / 2);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
@include when(vertical) {
|
|
317
|
+
display: block;
|
|
318
|
+
|
|
319
|
+
.wd-step__header {
|
|
320
|
+
position: absolute;
|
|
321
|
+
left: 0;
|
|
322
|
+
top: 0;
|
|
323
|
+
height: 100%;
|
|
324
|
+
|
|
325
|
+
&.is-dot {
|
|
326
|
+
top: $step-vertical-header-dot-top;
|
|
327
|
+
|
|
328
|
+
.wd-step__line {
|
|
329
|
+
left: 50%;
|
|
330
|
+
margin-left: 0;
|
|
331
|
+
margin-top: 0;
|
|
332
|
+
}
|
|
333
|
+
.wd-step__indicator {
|
|
334
|
+
width: $step-indicator-size; // Use same container size so text/dots align nicely along left edge automatically
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.wd-step__content {
|
|
340
|
+
margin-left: $step-vertical-content-margin-left;
|
|
341
|
+
margin-top: 0;
|
|
342
|
+
padding-bottom: $step-vertical-content-padding-bottom;
|
|
343
|
+
min-height: $step-indicator-size;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.wd-step__line {
|
|
347
|
+
top: calc($step-indicator-size + $step-line-spacing);
|
|
348
|
+
left: 50%;
|
|
349
|
+
width: $stroke-main;
|
|
350
|
+
height: calc(100% - $step-indicator-size - 2 * $step-line-spacing);
|
|
351
|
+
transform: scaleX(0.5);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.wd-step__header.is-dot {
|
|
355
|
+
.wd-step__line {
|
|
356
|
+
top: calc($step-dot-size + $step-line-spacing);
|
|
357
|
+
height: calc(100% - $step-dot-size - 2 * $step-line-spacing);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.wd-step__icon.is-dot {
|
|
362
|
+
margin-left: 0;
|
|
363
|
+
margin-top: -$n-1;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue'
|
|
2
|
+
import { baseProps } from '../../common/props'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 步骤状态类型
|
|
6
|
+
* 可选值: 'finished' | 'process' | 'error' | 'wait'
|
|
7
|
+
*/
|
|
8
|
+
export type StepStatus = 'finished' | 'process' | 'error' | 'wait'
|
|
9
|
+
|
|
10
|
+
export const stepProps = {
|
|
11
|
+
...baseProps,
|
|
12
|
+
/**
|
|
13
|
+
* 步骤标题,如果没有则使用默认文案。
|
|
14
|
+
* 当只有标题而没有描述时,标题的字号会小2号。
|
|
15
|
+
* 类型: string
|
|
16
|
+
* 默认值: ''
|
|
17
|
+
*/
|
|
18
|
+
title: String,
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 步骤描述。
|
|
22
|
+
* 类型: string
|
|
23
|
+
* 默认值: ''
|
|
24
|
+
*/
|
|
25
|
+
description: String,
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 步骤图标。
|
|
29
|
+
* 类型: string
|
|
30
|
+
* 默认值: ''
|
|
31
|
+
*/
|
|
32
|
+
icon: String,
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 步骤状态
|
|
36
|
+
* 类型: StepStatus
|
|
37
|
+
* 可选值: 'finished' | 'process' | 'error' | 'wait'
|
|
38
|
+
* 默认值: 'wait'
|
|
39
|
+
*/
|
|
40
|
+
status: String as PropType<StepStatus>
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type StepProps = ExtractPropTypes<typeof stepProps>
|