@wot-ui/ui 1.0.0 → 2.0.0-alpha.3
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 +53 -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 +2063 -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/types.ts +147 -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 +12 -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 +11 -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,205 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss'as *;
|
|
2
|
+
@use '../../styles/variable.scss'as *;
|
|
3
|
+
|
|
4
|
+
// 主色模式颜色
|
|
5
|
+
$loading-color-main: var(--wot-loading-color-main, $primary-6) !default;
|
|
6
|
+
// 常规模式颜色
|
|
7
|
+
$loading-color-normal: var(--wot-loading-color-normal, $icon-secondary) !default;
|
|
8
|
+
// 白色模式颜色
|
|
9
|
+
$loading-color-white: var(--wot-loading-color-white, $icon-white) !default;
|
|
10
|
+
// 文本颜色
|
|
11
|
+
$loading-color-text: var(--wot-loading-color-text, $text-main) !default;
|
|
12
|
+
// 组件基准尺寸
|
|
13
|
+
$loading-size: var(--wot-loading-size, $n-28) !default;
|
|
14
|
+
// 容器宽度
|
|
15
|
+
$loading-size-width: var(--wot-loading-size-width, 1em) !default;
|
|
16
|
+
// 容器高度
|
|
17
|
+
$loading-size-height: var(--wot-loading-size-height, 1em) !default;
|
|
18
|
+
// 圆形加载器描边宽度
|
|
19
|
+
$loading-spinner-circle-stroke-width: var(--wot-loading-spinner-circle-stroke-width, 15%) !default;
|
|
20
|
+
// 圆形加载器圆角
|
|
21
|
+
$loading-spinner-circle-radius: var(--wot-loading-spinner-circle-radius, $radius-radius-full) !default;
|
|
22
|
+
// 旋转动画时长
|
|
23
|
+
$loading-spinner-animation-duration: var(--wot-loading-spinner-animation-duration, 0.8s) !default;
|
|
24
|
+
// 条状点宽度
|
|
25
|
+
$loading-spinner-dot-width: var(--wot-loading-spinner-dot-width, 10%) !default;
|
|
26
|
+
// 条状点高度
|
|
27
|
+
$loading-spinner-dot-height: var(--wot-loading-spinner-dot-height, 25%) !default;
|
|
28
|
+
// 条状点圆角
|
|
29
|
+
$loading-spinner-dot-radius: var(--wot-loading-spinner-dot-radius, $radius-radius-full) !default;
|
|
30
|
+
// 点状加载器单点尺寸
|
|
31
|
+
$loading-spinner-dots-dot-size: var(--wot-loading-spinner-dots-dot-size, 20%) !default;
|
|
32
|
+
// 点状加载器单点圆角
|
|
33
|
+
$loading-spinner-dots-dot-radius: var(--wot-loading-spinner-dots-dot-radius, $radius-radius-full) !default;
|
|
34
|
+
// 加载器内边距
|
|
35
|
+
$loading-spinner-padding: var(--wot-loading-spinner-padding, $padding-ultra-tight) !default;
|
|
36
|
+
// 文本与加载器间距
|
|
37
|
+
$loading-text-spacing: var(--wot-loading-text-spacing, $spacing-extra-tight) !default;
|
|
38
|
+
// 文本字号
|
|
39
|
+
$loading-text-font-size: var(--wot-loading-text-font-size, $typography-body-size-main) !default;
|
|
40
|
+
// 文本行高
|
|
41
|
+
$loading-text-line-height: var(--wot-loading-text-line-height, $typography-body-line--height-size-main) !default;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@mixin generate($n, $i: 1) {
|
|
45
|
+
@if $i <=$n {
|
|
46
|
+
&:nth-of-type(#{$i}) {
|
|
47
|
+
transform: rotate(90deg - $i * 30deg);
|
|
48
|
+
opacity: 1 - calc(0.75 / 12) * ($i - 1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@include generate($n, $i + 1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@mixin dot-delay($n, $duration) {
|
|
56
|
+
@for $i from 1 through $n {
|
|
57
|
+
&:nth-of-type(#{$i}) {
|
|
58
|
+
animation-delay: calc(#{$duration} * #{($i - 1)} / 3);
|
|
59
|
+
animation-duration: $duration;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include b(loading) {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
color: $loading-color-main;
|
|
69
|
+
font-size: $loading-size;
|
|
70
|
+
|
|
71
|
+
@include m(horizontal) {
|
|
72
|
+
flex-direction: row;
|
|
73
|
+
|
|
74
|
+
@include me(text){
|
|
75
|
+
margin-left: $loading-text-spacing;
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@include m(vertical) {
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
|
|
83
|
+
@include me(text){
|
|
84
|
+
margin-top: $loading-text-spacing;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@include e(spinner) {
|
|
89
|
+
flex: none;
|
|
90
|
+
position: relative;
|
|
91
|
+
font-size: inherit;
|
|
92
|
+
width: $loading-size-width;
|
|
93
|
+
height: $loading-size-height;
|
|
94
|
+
animation: wd-rotate $loading-spinner-animation-duration linear infinite;
|
|
95
|
+
padding: $loading-spinner-padding;
|
|
96
|
+
box-sizing: border-box;
|
|
97
|
+
|
|
98
|
+
@include m(circular) {
|
|
99
|
+
@include me(spinner-wraper) {
|
|
100
|
+
border-radius: $loading-spinner-circle-radius;
|
|
101
|
+
border: none;
|
|
102
|
+
mask: radial-gradient(closest-side,
|
|
103
|
+
transparent calc(100% - $loading-spinner-circle-stroke-width),
|
|
104
|
+
$base-white calc(100% - $loading-spinner-circle-stroke-width),
|
|
105
|
+
$base-white 100%);
|
|
106
|
+
background: conic-gradient(from 0deg at 50% 50%, $base-transparent 0deg, $base-transparent 90deg, currentColor 330deg, currentColor 360deg);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@include m(spinner) {
|
|
111
|
+
animation-timing-function: steps(12);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@include m(dots) {
|
|
115
|
+
animation: none;
|
|
116
|
+
|
|
117
|
+
@include me(spinner-wraper) {
|
|
118
|
+
display: flex;
|
|
119
|
+
justify-content: space-between;
|
|
120
|
+
align-items: center;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@include me(spinner-dot) {
|
|
124
|
+
position: static;
|
|
125
|
+
width: $loading-spinner-dots-dot-size;
|
|
126
|
+
height: $loading-spinner-dots-dot-size;
|
|
127
|
+
border-radius: $loading-spinner-dots-dot-radius;
|
|
128
|
+
background-color: currentColor;
|
|
129
|
+
animation-name: wd-dotting;
|
|
130
|
+
animation-timing-function: linear;
|
|
131
|
+
animation-iteration-count: infinite;
|
|
132
|
+
animation-fill-mode: both;
|
|
133
|
+
|
|
134
|
+
&::before {
|
|
135
|
+
content: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@include dot-delay(3, $loading-spinner-animation-duration);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@include e(spinner-dot) {
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: 0;
|
|
146
|
+
left: 0;
|
|
147
|
+
width: 100%;
|
|
148
|
+
height: 100%;
|
|
149
|
+
@include generate(12);
|
|
150
|
+
|
|
151
|
+
&::before {
|
|
152
|
+
display: block;
|
|
153
|
+
width: $loading-spinner-dot-width;
|
|
154
|
+
height: $loading-spinner-dot-height;
|
|
155
|
+
margin: 0 auto;
|
|
156
|
+
background-color: currentColor;
|
|
157
|
+
border-radius: $loading-spinner-dot-radius;
|
|
158
|
+
content: ' ';
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@include e(spinner-wraper) {
|
|
163
|
+
position: relative;
|
|
164
|
+
width: 100%;
|
|
165
|
+
height: 100%;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@include e(text) {
|
|
169
|
+
font-size: $loading-text-font-size;
|
|
170
|
+
line-height: $loading-text-line-height;
|
|
171
|
+
color: currentColor;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@keyframes wd-rotate {
|
|
176
|
+
from {
|
|
177
|
+
transform: rotate(0deg);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
to {
|
|
181
|
+
transform: rotate(360deg);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@keyframes wd-dotting {
|
|
186
|
+
0% {
|
|
187
|
+
opacity: 0.15;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
1% {
|
|
191
|
+
opacity: 0.8;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
33% {
|
|
195
|
+
opacity: 0.8;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
34% {
|
|
199
|
+
opacity: 0.15;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
100% {
|
|
203
|
+
opacity: 0.15;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: weisheng
|
|
3
|
+
* @Date: 2024-03-15 20:40:34
|
|
4
|
+
* @LastEditTime: 2026-01-23 14:59:32
|
|
5
|
+
* @LastEditors: weisheng
|
|
6
|
+
* @Description:
|
|
7
|
+
* @FilePath: /wot-ui/src/uni_modules/wot-ui/components/wd-loading/types.ts
|
|
8
|
+
* 记得注释
|
|
9
|
+
*/
|
|
10
|
+
import type { ExtractPropTypes } from 'vue'
|
|
11
|
+
import { baseProps, makeStringProp, numericProp } from '../../common/props'
|
|
12
|
+
|
|
13
|
+
export type LoadingType = 'circular' | 'spinner' | 'dots' // 提示信息加载状态类型
|
|
14
|
+
|
|
15
|
+
export type LoadingDirection = 'horizontal' | 'vertical' // 加载指示器方向,可选值:'horizontal' | 'vertical',默认值:'vertical'
|
|
16
|
+
|
|
17
|
+
export const loadingProps = {
|
|
18
|
+
...baseProps,
|
|
19
|
+
/**
|
|
20
|
+
* 自定义加载指示器样式类
|
|
21
|
+
* 类型: string
|
|
22
|
+
*/
|
|
23
|
+
customSpinnerClass: makeStringProp(''),
|
|
24
|
+
/**
|
|
25
|
+
* 加载指示器类型
|
|
26
|
+
* 类型: LoadingType
|
|
27
|
+
* 可选值: 'circular' | 'spinner' | 'dots'
|
|
28
|
+
* 默认值: 'circular'
|
|
29
|
+
*/
|
|
30
|
+
type: makeStringProp<LoadingType>('circular'),
|
|
31
|
+
/**
|
|
32
|
+
* 设置加载指示器颜色
|
|
33
|
+
* 类型: string
|
|
34
|
+
*/
|
|
35
|
+
color: String,
|
|
36
|
+
/**
|
|
37
|
+
* 设置加载指示器大小
|
|
38
|
+
* 类型: string | number
|
|
39
|
+
*/
|
|
40
|
+
size: numericProp,
|
|
41
|
+
/**
|
|
42
|
+
* 加载指示器方向
|
|
43
|
+
* 类型: LoadingDirection
|
|
44
|
+
* 可选值: 'horizontal' | 'vertical'
|
|
45
|
+
* 默认值: 'vertical'
|
|
46
|
+
*/
|
|
47
|
+
direction: makeStringProp<LoadingDirection>('vertical'),
|
|
48
|
+
/**
|
|
49
|
+
* 加载指示器文字
|
|
50
|
+
* 类型: string
|
|
51
|
+
*/
|
|
52
|
+
text: String,
|
|
53
|
+
/**
|
|
54
|
+
* 是否继承父元素颜色
|
|
55
|
+
* 类型: boolean
|
|
56
|
+
* 默认值: false
|
|
57
|
+
*/
|
|
58
|
+
inheritColor: Boolean
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type LoadingProps = ExtractPropTypes<typeof loadingProps>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="`wd-loading wd-loading--${direction} ${customClass}`" :style="rootStyle">
|
|
3
|
+
<view :class="`wd-loading__spinner wd-loading__spinner--${type} ${customSpinnerClass}`" :style="spinnerStyle">
|
|
4
|
+
<template v-if="type === 'circular'">
|
|
5
|
+
<view class="wd-loading__spinner-wraper"></view>
|
|
6
|
+
</template>
|
|
7
|
+
<template v-if="type === 'spinner'">
|
|
8
|
+
<view class="wd-loading__spinner-wraper">
|
|
9
|
+
<view class="wd-loading__spinner-dot" v-for="i in dots" :key="i"></view>
|
|
10
|
+
</view>
|
|
11
|
+
</template>
|
|
12
|
+
<template v-else-if="type === 'dots'">
|
|
13
|
+
<view class="wd-loading__spinner-wraper">
|
|
14
|
+
<view class="wd-loading__spinner-dot" v-for="i in 3" :key="i"></view>
|
|
15
|
+
</view>
|
|
16
|
+
</template>
|
|
17
|
+
</view>
|
|
18
|
+
<view class="wd-loading__text" v-if="$slots.default || text">
|
|
19
|
+
<slot>{{ text }}</slot>
|
|
20
|
+
</view>
|
|
21
|
+
</view>
|
|
22
|
+
</template>
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
export default {
|
|
25
|
+
name: 'wd-loading',
|
|
26
|
+
options: {
|
|
27
|
+
// #ifndef MP-TOUTIAO
|
|
28
|
+
virtualHost: true,
|
|
29
|
+
// #endif
|
|
30
|
+
addGlobalClass: true,
|
|
31
|
+
styleIsolation: 'shared'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<script lang="ts" setup>
|
|
37
|
+
import { computed, type CSSProperties } from 'vue'
|
|
38
|
+
|
|
39
|
+
import { objToStyle, addUnit, isDef } from '../../common/util'
|
|
40
|
+
import { loadingProps } from './types'
|
|
41
|
+
|
|
42
|
+
const props = defineProps(loadingProps)
|
|
43
|
+
|
|
44
|
+
// 长度为 12 的数组
|
|
45
|
+
const dots = Array.from({ length: 12 }, (_, i) => i)
|
|
46
|
+
|
|
47
|
+
const rootStyle = computed(() => {
|
|
48
|
+
const style: CSSProperties = {}
|
|
49
|
+
if (isDef(props.color)) {
|
|
50
|
+
style.color = props.color
|
|
51
|
+
}
|
|
52
|
+
if (props.inheritColor) {
|
|
53
|
+
style.color = 'inherit'
|
|
54
|
+
}
|
|
55
|
+
return `${objToStyle(style)} ${props.customStyle}`
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const spinnerStyle = computed(() => {
|
|
59
|
+
const style: CSSProperties = {}
|
|
60
|
+
if (isDef(props.size)) {
|
|
61
|
+
style.height = addUnit(props.size)
|
|
62
|
+
style.width = addUnit(props.size)
|
|
63
|
+
}
|
|
64
|
+
return objToStyle(style)
|
|
65
|
+
})
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style lang="scss">
|
|
69
|
+
@use './index.scss';
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss' as *;
|
|
2
|
+
@use '../../styles/variable.scss' as *;
|
|
3
|
+
|
|
4
|
+
// 组件最小高度
|
|
5
|
+
$loadmore-height: var(--wot-loadmore-height, $n-48) !default;
|
|
6
|
+
// 组件内边距
|
|
7
|
+
$loadmore-padding: var(--wot-loadmore-padding, $spacing-main $spacing-loose) !default;
|
|
8
|
+
// 默认文字颜色
|
|
9
|
+
$loadmore-color: var(--wot-loadmore-color, $text-secondary) !default;
|
|
10
|
+
// 默认文字字号
|
|
11
|
+
$loadmore-font-size: var(--wot-loadmore-font-size, $typography-body-size-main) !default;
|
|
12
|
+
// 默认文字行高
|
|
13
|
+
$loadmore-line-height: var(--wot-loadmore-line-height, $typography-body-line--height-size-main) !default;
|
|
14
|
+
// 加载图标尺寸
|
|
15
|
+
$loadmore-loading-size: var(--wot-loadmore-loading-size, $n-28) !default;
|
|
16
|
+
// 加载图标与文字间距
|
|
17
|
+
$loadmore-loading-spacing: var(--wot-loadmore-loading-spacing, $spacing-tight) !default;
|
|
18
|
+
// 刷新态文字颜色
|
|
19
|
+
$loadmore-refresh-color: var(--wot-loadmore-refresh-color, $primary-6) !default;
|
|
20
|
+
// 刷新图标字号
|
|
21
|
+
$loadmore-refresh-font-size: var(--wot-loadmore-refresh-font-size, $typography-body-size-extra-large) !default;
|
|
22
|
+
// 刷新图标行高
|
|
23
|
+
$loadmore-refresh-line-height: var(--wot-loadmore-refresh-line-height, $typography-body-line--height-size-extra-large) !default;
|
|
24
|
+
// 重试文案与图标间距
|
|
25
|
+
$loadmore-retry-spacing: var(--wot-loadmore-retry-spacing, 0 $spacing-extra-tight) !default;
|
|
26
|
+
|
|
27
|
+
@include b(loadmore) {
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
align-items: center;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
width: 100%;
|
|
33
|
+
min-height: $loadmore-height;
|
|
34
|
+
padding: $loadmore-padding;
|
|
35
|
+
color: $loadmore-color;
|
|
36
|
+
|
|
37
|
+
@include edeep(divider) {
|
|
38
|
+
width: 100%;
|
|
39
|
+
margin: $spacing-zero;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include edeep(loading) {
|
|
43
|
+
margin-right: $loadmore-loading-spacing;
|
|
44
|
+
font-size: $loadmore-loading-size;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@include e(text,refresh-text) {
|
|
48
|
+
font-size: $loadmore-font-size;
|
|
49
|
+
line-height: $loadmore-line-height;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include e(refresh-text) {
|
|
53
|
+
margin: $loadmore-retry-spacing;
|
|
54
|
+
color: $loadmore-refresh-color;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@include edeep(refresh) {
|
|
58
|
+
color: $loadmore-refresh-color;
|
|
59
|
+
font-size: $loadmore-refresh-font-size;
|
|
60
|
+
line-height: $loadmore-refresh-line-height;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { PropType } from 'vue'
|
|
2
|
+
import { baseProps } from '../../common/props'
|
|
3
|
+
import type { LoadingProps } from '../wd-loading/types'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* loadmore 组件的加载状态
|
|
7
|
+
* - loading: 加载中
|
|
8
|
+
* - error: 加载失败
|
|
9
|
+
* - finished: 加载完成
|
|
10
|
+
*/
|
|
11
|
+
export type LoadMoreState = 'loading' | 'error' | 'finished'
|
|
12
|
+
|
|
13
|
+
export const loadmoreProps = {
|
|
14
|
+
...baseProps,
|
|
15
|
+
/**
|
|
16
|
+
* 加载状态
|
|
17
|
+
* 可选值: 'loading' | 'error' | 'finished'
|
|
18
|
+
* 默认值: undefined
|
|
19
|
+
*/
|
|
20
|
+
state: String as PropType<LoadMoreState>,
|
|
21
|
+
/**
|
|
22
|
+
* 加载中的提示文案
|
|
23
|
+
* 默认值: 国际化文案
|
|
24
|
+
*/
|
|
25
|
+
loadingText: String,
|
|
26
|
+
/**
|
|
27
|
+
* 加载完成的提示文案
|
|
28
|
+
* 默认值: 国际化文案
|
|
29
|
+
*/
|
|
30
|
+
finishedText: String,
|
|
31
|
+
/**
|
|
32
|
+
* 加载失败的提示文案
|
|
33
|
+
* 默认值: 国际化文案
|
|
34
|
+
*/
|
|
35
|
+
errorText: String,
|
|
36
|
+
/**
|
|
37
|
+
* Loading 组件配置属性
|
|
38
|
+
* 类型: Partial<LoadingProps>
|
|
39
|
+
* 默认值: {}
|
|
40
|
+
*/
|
|
41
|
+
loadingProps: Object as PropType<Partial<LoadingProps>>
|
|
42
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="['wd-loadmore', customClass]" :style="customStyle" @click="reload">
|
|
3
|
+
<slot v-if="state === 'finished'" name="finished">
|
|
4
|
+
<wd-divider custom-class="wd-loadmore__divider">{{ finishedText || translate('finished') }}</wd-divider>
|
|
5
|
+
</slot>
|
|
6
|
+
<slot v-else-if="state === 'error'" name="error">
|
|
7
|
+
<text class="wd-loadmore__text">{{ errorText || translate('error') }}</text>
|
|
8
|
+
<text class="wd-loadmore__refresh-text">{{ translate('retry') }}</text>
|
|
9
|
+
<wd-icon name="refresh" custom-class="wd-loadmore__refresh" />
|
|
10
|
+
</slot>
|
|
11
|
+
<slot v-else-if="state === 'loading'" name="loading">
|
|
12
|
+
<wd-loading v-bind="customLoadingProps" />
|
|
13
|
+
<text class="wd-loadmore__text">{{ loadingText || translate('loading') }}</text>
|
|
14
|
+
</slot>
|
|
15
|
+
</view>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
export default {
|
|
20
|
+
name: 'wd-loadmore',
|
|
21
|
+
options: {
|
|
22
|
+
// #ifndef MP-TOUTIAO
|
|
23
|
+
virtualHost: true,
|
|
24
|
+
// #endif
|
|
25
|
+
addGlobalClass: true,
|
|
26
|
+
styleIsolation: 'shared'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<script lang="ts" setup>
|
|
32
|
+
import wdDivider from '../wd-divider/wd-divider.vue'
|
|
33
|
+
import wdLoading from '../wd-loading/wd-loading.vue'
|
|
34
|
+
import wdIcon from '../wd-icon/wd-icon.vue'
|
|
35
|
+
import { computed, ref } from 'vue'
|
|
36
|
+
import { useTranslate } from '../../composables/useTranslate'
|
|
37
|
+
import { loadmoreProps, type LoadMoreState } from './types'
|
|
38
|
+
import type { LoadingProps } from '../wd-loading/types'
|
|
39
|
+
import { isDef, isUndefined, omitBy } from '../../common/util'
|
|
40
|
+
|
|
41
|
+
// 计算 Loading 组件的属性 - 合并用户传入的属性和组件需要的自定义样式
|
|
42
|
+
const customLoadingProps = computed(() => {
|
|
43
|
+
const loadingProps: Partial<LoadingProps> = isDef(props.loadingProps) ? omitBy(props.loadingProps, isUndefined) : {}
|
|
44
|
+
loadingProps.customClass = `wd-loadmore__loading ${loadingProps.customClass || ''}`
|
|
45
|
+
return loadingProps
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const props = defineProps(loadmoreProps)
|
|
49
|
+
const emit = defineEmits(['reload'])
|
|
50
|
+
|
|
51
|
+
const { translate } = useTranslate('loadmore')
|
|
52
|
+
|
|
53
|
+
/** 当前加载状态 */
|
|
54
|
+
const currentState = ref<LoadMoreState | null>(null)
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 处理重新加载操作 - 当加载失败时,点击可触发 reload 事件
|
|
58
|
+
*/
|
|
59
|
+
function reload() {
|
|
60
|
+
if (props.state !== 'error') return
|
|
61
|
+
currentState.value = 'loading'
|
|
62
|
+
emit('reload')
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<style lang="scss">
|
|
67
|
+
@use './index.scss';
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss' as *;
|
|
2
|
+
@use '../../styles/variable.scss' as *;
|
|
3
|
+
|
|
4
|
+
// 导航栏高度
|
|
5
|
+
$navbar-height: var(--wot-navbar-height, $n-44) !default;
|
|
6
|
+
// 导航栏背景色
|
|
7
|
+
$navbar-bg: var(--wot-navbar-bg, $filled-oppo) !default;
|
|
8
|
+
// 标题文字颜色
|
|
9
|
+
$navbar-color: var(--wot-navbar-color, $text-main) !default;
|
|
10
|
+
// 标题字重
|
|
11
|
+
$navbar-title-font-weight: var(--wot-navbar-title-font-weight, $font-weight-medium) !default;
|
|
12
|
+
// 标题字号
|
|
13
|
+
$navbar-title-font-size: var(--wot-navbar-title-font-size, $typography-title-size-main) !default;
|
|
14
|
+
// 描述区域字号
|
|
15
|
+
$navbar-desc-font-size: var(--wot-navbar-desc-font-size, $typography-body-size-extra-large) !default;
|
|
16
|
+
// 描述区域文字颜色
|
|
17
|
+
$navbar-desc-color: var(--wot-navbar-desc-color, $text-main) !default;
|
|
18
|
+
// 箭头图标大小
|
|
19
|
+
$navbar-arrow-size: var(--wot-navbar-arrow-size, $n-24) !default;
|
|
20
|
+
// 禁用态透明度
|
|
21
|
+
$navbar-opacity-disabled: var(--wot-navbar-opacity-disabled, $opacity-disabled) !default;
|
|
22
|
+
// 左侧内边距
|
|
23
|
+
$navbar-left-padding: var(--wot-navbar-left-padding, $padding-zero $padding-loose) !default;
|
|
24
|
+
// 固定定位层级
|
|
25
|
+
$navbar-z-index: var(--wot-navbar-z-index, 10) !default;
|
|
26
|
+
|
|
27
|
+
@include b(navbar) {
|
|
28
|
+
position: relative;
|
|
29
|
+
text-align: center;
|
|
30
|
+
user-select: none;
|
|
31
|
+
height: $navbar-height;
|
|
32
|
+
line-height: $navbar-height;
|
|
33
|
+
background-color: $navbar-bg;
|
|
34
|
+
box-sizing: content-box;
|
|
35
|
+
|
|
36
|
+
@include e(content) {
|
|
37
|
+
position: relative;
|
|
38
|
+
height: 100%;
|
|
39
|
+
width: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include e(title) {
|
|
43
|
+
max-width: 60%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
margin: 0 auto;
|
|
46
|
+
color: $navbar-color;
|
|
47
|
+
font-weight: $navbar-title-font-weight;
|
|
48
|
+
font-size: $navbar-title-font-size;
|
|
49
|
+
@include lineEllipsis();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include e(text) {
|
|
53
|
+
display: inline-block;
|
|
54
|
+
vertical-align: middle;
|
|
55
|
+
color: $navbar-desc-color;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@include e(left, right, capsule) {
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: 0;
|
|
61
|
+
bottom: 0;
|
|
62
|
+
font-size: $navbar-desc-font-size;
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
padding: $navbar-left-padding;
|
|
66
|
+
|
|
67
|
+
@include when(disabled) {
|
|
68
|
+
opacity: $navbar-opacity-disabled;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@include e(left, capsule) {
|
|
73
|
+
left: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@include e(right) {
|
|
77
|
+
right: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@include edeep(arrow) {
|
|
81
|
+
font-size: $navbar-arrow-size;
|
|
82
|
+
color: $navbar-color;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@include when(border) {
|
|
86
|
+
@include halfPixelBorder('bottom');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@include when(fixed) {
|
|
90
|
+
position: fixed;
|
|
91
|
+
top: 0;
|
|
92
|
+
left: 0;
|
|
93
|
+
width: 100%;
|
|
94
|
+
z-index: $navbar-z-index;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeNumberProp } from '../../common/props'
|
|
3
|
+
|
|
4
|
+
export const navbarProps = {
|
|
5
|
+
...baseProps,
|
|
6
|
+
/**
|
|
7
|
+
* 标题文字
|
|
8
|
+
* 类型: string
|
|
9
|
+
* 默认值: ''
|
|
10
|
+
*/
|
|
11
|
+
title: String,
|
|
12
|
+
/**
|
|
13
|
+
* 左侧文案
|
|
14
|
+
* 类型: string
|
|
15
|
+
* 默认值: ''
|
|
16
|
+
*/
|
|
17
|
+
leftText: String,
|
|
18
|
+
/**
|
|
19
|
+
* 右侧文案
|
|
20
|
+
* 类型: string
|
|
21
|
+
* 默认值: ''
|
|
22
|
+
*/
|
|
23
|
+
rightText: String,
|
|
24
|
+
/**
|
|
25
|
+
* 是否显示左侧箭头
|
|
26
|
+
* 类型: boolean
|
|
27
|
+
* 默认值: false
|
|
28
|
+
*/
|
|
29
|
+
leftArrow: makeBooleanProp(false),
|
|
30
|
+
/**
|
|
31
|
+
* 是否显示下边框
|
|
32
|
+
* 类型: boolean
|
|
33
|
+
* 默认值: false
|
|
34
|
+
*/
|
|
35
|
+
bordered: makeBooleanProp(false),
|
|
36
|
+
/**
|
|
37
|
+
* 是否固定到顶部
|
|
38
|
+
* 类型: boolean
|
|
39
|
+
* 默认值: false
|
|
40
|
+
*/
|
|
41
|
+
fixed: makeBooleanProp(false),
|
|
42
|
+
/**
|
|
43
|
+
* 固定在顶部时,是否在标签位置生成一个等高的占位元素
|
|
44
|
+
* 类型: boolean
|
|
45
|
+
* 默认值: false
|
|
46
|
+
*/
|
|
47
|
+
placeholder: makeBooleanProp(false),
|
|
48
|
+
/**
|
|
49
|
+
* 导航栏 z-index
|
|
50
|
+
* 类型: number
|
|
51
|
+
* 默认值: 10
|
|
52
|
+
*/
|
|
53
|
+
zIndex: makeNumberProp(10),
|
|
54
|
+
/**
|
|
55
|
+
* 是否开启顶部安全区适配
|
|
56
|
+
* 类型: boolean
|
|
57
|
+
* 默认值: false
|
|
58
|
+
*/
|
|
59
|
+
safeAreaInsetTop: makeBooleanProp(false),
|
|
60
|
+
/**
|
|
61
|
+
* 是否禁用左侧按钮,禁用时透明度降低,且无法点击
|
|
62
|
+
* 类型: boolean
|
|
63
|
+
* 默认值: false
|
|
64
|
+
*/
|
|
65
|
+
leftDisabled: makeBooleanProp(false),
|
|
66
|
+
/**
|
|
67
|
+
* 是否禁用右侧按钮,禁用时透明度降低,且无法点击
|
|
68
|
+
* 类型: boolean
|
|
69
|
+
* 默认值: false
|
|
70
|
+
*/
|
|
71
|
+
rightDisabled: makeBooleanProp(false)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type NavbarProps = ExtractPropTypes<typeof navbarProps>
|