@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,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wd-popup
|
|
3
|
+
v-model="state.visible"
|
|
4
|
+
:custom-style="popupStyle"
|
|
5
|
+
:position="state.position"
|
|
6
|
+
:z-index="state.zIndex"
|
|
7
|
+
:modal="false"
|
|
8
|
+
:root-portal="state.rootPortal"
|
|
9
|
+
@leave="onClosed"
|
|
10
|
+
@enter="onOpened"
|
|
11
|
+
>
|
|
12
|
+
<view
|
|
13
|
+
:class="[
|
|
14
|
+
'wd-notify',
|
|
15
|
+
`wd-notify--${state.type}`,
|
|
16
|
+
`wd-notify--${state.position}`,
|
|
17
|
+
state.variant === 'floating' ? 'wd-notify--floating' : '',
|
|
18
|
+
customClass
|
|
19
|
+
]"
|
|
20
|
+
:style="rootStyle"
|
|
21
|
+
@click="onClick"
|
|
22
|
+
>
|
|
23
|
+
<slot name="prefix">
|
|
24
|
+
<wd-icon v-if="iconName" :name="iconName" custom-class="wd-notify__prefix"></wd-icon>
|
|
25
|
+
</slot>
|
|
26
|
+
<view class="wd-notify__content">
|
|
27
|
+
<slot>
|
|
28
|
+
<text>{{ state.message }}</text>
|
|
29
|
+
</slot>
|
|
30
|
+
</view>
|
|
31
|
+
<slot name="close" v-if="state.closable">
|
|
32
|
+
<wd-icon name="close" custom-class="wd-notify__close" @click="handleClose"></wd-icon>
|
|
33
|
+
</slot>
|
|
34
|
+
</view>
|
|
35
|
+
</wd-popup>
|
|
36
|
+
</template>
|
|
37
|
+
<script lang="ts">
|
|
38
|
+
export default {
|
|
39
|
+
name: 'wd-notify',
|
|
40
|
+
options: {
|
|
41
|
+
// #ifndef MP-TOUTIAO
|
|
42
|
+
virtualHost: true,
|
|
43
|
+
// #endif
|
|
44
|
+
addGlobalClass: true,
|
|
45
|
+
styleIsolation: 'shared'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<script lang="ts" setup>
|
|
51
|
+
import wdPopup from '../wd-popup/wd-popup.vue'
|
|
52
|
+
import { inject, computed, watch, ref, type CSSProperties } from 'vue'
|
|
53
|
+
import { notifyProps, type NotifyProps } from './types'
|
|
54
|
+
import { getNotifyOptionKey } from '.'
|
|
55
|
+
import { addUnit, isFunction, objToStyle } from '../../common/util'
|
|
56
|
+
|
|
57
|
+
const props = defineProps(notifyProps)
|
|
58
|
+
const emits = defineEmits<{
|
|
59
|
+
(e: 'update:visible', value: boolean): void
|
|
60
|
+
(e: 'click', event: MouseEvent): void
|
|
61
|
+
(e: 'closed'): void
|
|
62
|
+
(e: 'opened'): void
|
|
63
|
+
}>()
|
|
64
|
+
const state = inject(getNotifyOptionKey(props.selector), ref<NotifyProps>(props))
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 根据消息类型获取对应的图标
|
|
68
|
+
*/
|
|
69
|
+
const iconName = computed(() => {
|
|
70
|
+
const { type } = state.value
|
|
71
|
+
switch (type) {
|
|
72
|
+
case 'success':
|
|
73
|
+
return 'check-circle-fill'
|
|
74
|
+
case 'warning':
|
|
75
|
+
return 'exclamation-circle-fill'
|
|
76
|
+
case 'danger':
|
|
77
|
+
return 'close-circle-fill'
|
|
78
|
+
default:
|
|
79
|
+
return 'info-circle-fill'
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 计算通知的自定义样式
|
|
85
|
+
*/
|
|
86
|
+
const popupStyle = computed(() => {
|
|
87
|
+
const { safeHeight, position, variant } = state.value
|
|
88
|
+
const styles: CSSProperties = {
|
|
89
|
+
overflow: 'unset',
|
|
90
|
+
background: 'transparent'
|
|
91
|
+
}
|
|
92
|
+
switch (position) {
|
|
93
|
+
case 'top':
|
|
94
|
+
styles['top'] = `calc(var(--window-top) + ${addUnit(safeHeight || 0)})`
|
|
95
|
+
break
|
|
96
|
+
case 'bottom':
|
|
97
|
+
styles['bottom'] = 'var(--window-bottom)'
|
|
98
|
+
break
|
|
99
|
+
default:
|
|
100
|
+
break
|
|
101
|
+
}
|
|
102
|
+
if (variant === 'floating') {
|
|
103
|
+
styles['left'] = '12px'
|
|
104
|
+
styles['right'] = '12px'
|
|
105
|
+
styles['width'] = 'auto'
|
|
106
|
+
}
|
|
107
|
+
return objToStyle(styles)
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const rootStyle = computed(() => {
|
|
111
|
+
const { customStyle } = props
|
|
112
|
+
const style: CSSProperties = {}
|
|
113
|
+
if (state.value.color) {
|
|
114
|
+
style.color = state.value.color
|
|
115
|
+
}
|
|
116
|
+
if (state.value.background) {
|
|
117
|
+
style.background = state.value.background
|
|
118
|
+
}
|
|
119
|
+
return `${objToStyle(style)};${customStyle}`
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 处理点击事件
|
|
124
|
+
* @param {MouseEvent} event 鼠标事件
|
|
125
|
+
*/
|
|
126
|
+
const onClick = (event: MouseEvent) => {
|
|
127
|
+
if (isFunction(state.value.onClick)) return state.value.onClick(event)
|
|
128
|
+
emits('click', event)
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* 处理关闭动画结束事件
|
|
132
|
+
*/
|
|
133
|
+
const onClosed = () => {
|
|
134
|
+
if (isFunction(state.value.onClosed)) return state.value.onClosed()
|
|
135
|
+
emits('closed')
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* 处理打开动画结束事件
|
|
139
|
+
*/
|
|
140
|
+
const onOpened = () => {
|
|
141
|
+
if (isFunction(state.value.onOpened)) return state.value.onOpened()
|
|
142
|
+
emits('opened')
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* 点击关闭按钮处理
|
|
146
|
+
*/
|
|
147
|
+
const handleClose = () => {
|
|
148
|
+
state.value.visible = false
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
watch(
|
|
152
|
+
() => state.value.visible,
|
|
153
|
+
(visible) => {
|
|
154
|
+
emits('update:visible', visible as boolean)
|
|
155
|
+
},
|
|
156
|
+
{ deep: true }
|
|
157
|
+
)
|
|
158
|
+
</script>
|
|
159
|
+
|
|
160
|
+
<style lang="scss">
|
|
161
|
+
@use './index.scss';
|
|
162
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss'as *;
|
|
2
|
+
@use '../../styles/variable.scss'as *;
|
|
3
|
+
|
|
4
|
+
// 遮罩层背景色
|
|
5
|
+
$overlay-bg: var(--wot-overlay-bg, $opac-7_55) !default;
|
|
6
|
+
|
|
7
|
+
@include b(overlay) {
|
|
8
|
+
position: fixed;
|
|
9
|
+
left: 0;
|
|
10
|
+
top: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
background: $overlay-bg;
|
|
14
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: weisheng
|
|
3
|
+
* @Date: 2025-05-08 22:54:27
|
|
4
|
+
* @LastEditTime: 2026-01-19 16:46:33
|
|
5
|
+
* @LastEditors: weisheng
|
|
6
|
+
* @Description:
|
|
7
|
+
* @FilePath: /wot-ui/src/uni_modules/wot-ui/components/wd-overlay/types.ts
|
|
8
|
+
* 记得注释
|
|
9
|
+
*/
|
|
10
|
+
import type { PropType } from 'vue'
|
|
11
|
+
import { baseProps, makeBooleanProp, makeNumberProp } from '../../common/props'
|
|
12
|
+
|
|
13
|
+
export const overlayProps = {
|
|
14
|
+
...baseProps,
|
|
15
|
+
/**
|
|
16
|
+
* 是否展示遮罩层
|
|
17
|
+
* 类型: boolean
|
|
18
|
+
* 默认值: false
|
|
19
|
+
*/
|
|
20
|
+
show: makeBooleanProp(false),
|
|
21
|
+
/**
|
|
22
|
+
* 动画时长,单位毫秒
|
|
23
|
+
* 类型: Record<string, number> | number | boolean
|
|
24
|
+
* 默认值: 300
|
|
25
|
+
*/
|
|
26
|
+
duration: {
|
|
27
|
+
type: [Object, Number, Boolean] as PropType<Record<string, number> | number | boolean>,
|
|
28
|
+
default: 300
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* 是否锁定滚动
|
|
32
|
+
* 类型: boolean
|
|
33
|
+
* 默认值: true
|
|
34
|
+
*/
|
|
35
|
+
lockScroll: makeBooleanProp(true),
|
|
36
|
+
/**
|
|
37
|
+
* 层级
|
|
38
|
+
* 类型: number
|
|
39
|
+
* 默认值: 10
|
|
40
|
+
*/
|
|
41
|
+
zIndex: makeNumberProp(10)
|
|
42
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wd-transition
|
|
3
|
+
:show="show"
|
|
4
|
+
name="fade"
|
|
5
|
+
:custom-class="`wd-overlay ${customClass}`"
|
|
6
|
+
:duration="duration"
|
|
7
|
+
:custom-style="`z-index: ${zIndex}; ${customStyle}`"
|
|
8
|
+
:disable-touch-move="lockScroll"
|
|
9
|
+
@before-enter="emit('before-enter')"
|
|
10
|
+
@enter="emit('enter')"
|
|
11
|
+
@after-enter="emit('after-enter')"
|
|
12
|
+
@before-leave="emit('before-leave')"
|
|
13
|
+
@leave="emit('leave')"
|
|
14
|
+
@after-leave="emit('after-leave')"
|
|
15
|
+
@click="handleClick"
|
|
16
|
+
>
|
|
17
|
+
<slot></slot>
|
|
18
|
+
</wd-transition>
|
|
19
|
+
</template>
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
export default {
|
|
22
|
+
name: 'wd-overlay',
|
|
23
|
+
options: {
|
|
24
|
+
// #ifndef MP-TOUTIAO
|
|
25
|
+
virtualHost: true,
|
|
26
|
+
// #endif
|
|
27
|
+
addGlobalClass: true,
|
|
28
|
+
styleIsolation: 'shared'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<script lang="ts" setup>
|
|
34
|
+
import wdTransition from '../wd-transition/wd-transition.vue'
|
|
35
|
+
import { overlayProps } from './types'
|
|
36
|
+
// #ifdef H5
|
|
37
|
+
import { useLockScroll } from '../../composables/useLockScroll'
|
|
38
|
+
// #endif
|
|
39
|
+
|
|
40
|
+
const props = defineProps(overlayProps)
|
|
41
|
+
|
|
42
|
+
const emit = defineEmits(['click', 'before-enter', 'enter', 'after-enter', 'before-leave', 'leave', 'after-leave'])
|
|
43
|
+
|
|
44
|
+
function handleClick() {
|
|
45
|
+
emit('click')
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// #ifdef H5
|
|
49
|
+
useLockScroll(() => props.show && props.lockScroll)
|
|
50
|
+
// #endif
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<style lang="scss">
|
|
54
|
+
@use './index.scss';
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@use '../../styles/variable.scss' as *;
|
|
2
|
+
@use '../../styles/mixin/_mixin.scss' as *;
|
|
3
|
+
|
|
4
|
+
// 分页背景色
|
|
5
|
+
$pagination-bg: var(--wot-pagination-bg, $filled-oppo) !default;
|
|
6
|
+
// 分页内边距
|
|
7
|
+
$pagination-padding: var(--wot-pagination-padding, $padding-loose) !default;
|
|
8
|
+
// 分页图标尺寸
|
|
9
|
+
$pagination-icon-size: var(--wot-pagination-icon-size, $n-16) !default;
|
|
10
|
+
// 辅助文案颜色
|
|
11
|
+
$pagination-message-color: var(--wot-pagination-message-color, $text-secondary) !default;
|
|
12
|
+
// 辅助文案字号
|
|
13
|
+
$pagination-message-font-size: var(--wot-pagination-message-font-size, $typography-body-size-main) !default;
|
|
14
|
+
// 辅助文案行高
|
|
15
|
+
$pagination-message-line-height: var(--wot-pagination-message-line-height, $typography-body-line--height-size-main) !default;
|
|
16
|
+
// 辅助文案顶部间距
|
|
17
|
+
$pagination-message-margin-top: var(--wot-pagination-message-margin-top, $spacing-super-tight) !default;
|
|
18
|
+
// 翻页按钮最小宽度
|
|
19
|
+
$pagination-nav-width: var(--wot-pagination-nav-width, $n-64) !default;
|
|
20
|
+
// 页码字号
|
|
21
|
+
$pagination-size-font-size: var(--wot-pagination-size-font-size, $typography-title-size-main) !default;
|
|
22
|
+
// 页码行高
|
|
23
|
+
$pagination-size-line-height: var(--wot-pagination-size-line-height, $typography-title-line--height-size-main) !default;
|
|
24
|
+
// 页码颜色
|
|
25
|
+
$pagination-size-color: var(--wot-pagination-size-color, $text-main) !default;
|
|
26
|
+
// 当前页码颜色
|
|
27
|
+
$pagination-size-current-color: var(--wot-pagination-size-current-color, $primary-6) !default;
|
|
28
|
+
// 分隔符外边距
|
|
29
|
+
$pagination-size-separator-margin: var(--wot-pagination-size-separator-margin, $spacing-zero $spacing-super-tight) !default;
|
|
30
|
+
|
|
31
|
+
@include b(pagination) {
|
|
32
|
+
user-select: none;
|
|
33
|
+
background-color: $pagination-bg;
|
|
34
|
+
padding: $pagination-padding;
|
|
35
|
+
|
|
36
|
+
@include edeep(icon) {
|
|
37
|
+
font-size: $pagination-icon-size;
|
|
38
|
+
line-height: $pagination-icon-size;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@include e(content) {
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
align-items: center;
|
|
45
|
+
}
|
|
46
|
+
@include e(message) {
|
|
47
|
+
text-align: center;
|
|
48
|
+
color: $pagination-message-color;
|
|
49
|
+
font-size: $pagination-message-font-size;
|
|
50
|
+
line-height: $pagination-message-line-height;
|
|
51
|
+
margin-top: $pagination-message-margin-top;
|
|
52
|
+
}
|
|
53
|
+
@include edeep(nav) {
|
|
54
|
+
min-width: $pagination-nav-width;
|
|
55
|
+
}
|
|
56
|
+
@include e(size) {
|
|
57
|
+
flex: 1;
|
|
58
|
+
text-align: center;
|
|
59
|
+
font-size: $pagination-size-font-size;
|
|
60
|
+
line-height: $pagination-size-line-height;
|
|
61
|
+
color: $pagination-size-color;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include e(separator) {
|
|
65
|
+
margin: $pagination-size-separator-margin;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@include e(current) {
|
|
69
|
+
color: $pagination-size-current-color;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type PropType } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeNumberProp, makeRequiredProp } from '../../common/props'
|
|
3
|
+
import { type ButtonVariant } from '../wd-button/types'
|
|
4
|
+
|
|
5
|
+
export const paginationProps = {
|
|
6
|
+
...baseProps,
|
|
7
|
+
/**
|
|
8
|
+
* 当前页
|
|
9
|
+
* 类型: number
|
|
10
|
+
* 默认值: 必填
|
|
11
|
+
*/
|
|
12
|
+
modelValue: makeRequiredProp(Number),
|
|
13
|
+
/**
|
|
14
|
+
* 总页数,如果有total,则优先使用total计算页数
|
|
15
|
+
* 类型: number
|
|
16
|
+
* 默认值: 1
|
|
17
|
+
*/
|
|
18
|
+
totalPage: makeNumberProp(1),
|
|
19
|
+
/**
|
|
20
|
+
* 是否展示分页为Icon图标
|
|
21
|
+
* 类型: boolean
|
|
22
|
+
* 默认值: false
|
|
23
|
+
*/
|
|
24
|
+
showIcon: makeBooleanProp(false),
|
|
25
|
+
/**
|
|
26
|
+
* 按钮的variant
|
|
27
|
+
* 类型: ButtonVariant
|
|
28
|
+
* 可选值: 'base' | 'plain' | 'dashed' | 'text'
|
|
29
|
+
* 默认值: 'text'
|
|
30
|
+
*/
|
|
31
|
+
buttonVariant: {
|
|
32
|
+
type: String as PropType<ButtonVariant>,
|
|
33
|
+
default: 'text'
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* 是否展示总条数
|
|
37
|
+
* 类型: boolean
|
|
38
|
+
* 默认值: false
|
|
39
|
+
*/
|
|
40
|
+
showMessage: makeBooleanProp(false),
|
|
41
|
+
/**
|
|
42
|
+
* 总条数
|
|
43
|
+
* 类型: number
|
|
44
|
+
* 默认值: 0
|
|
45
|
+
*/
|
|
46
|
+
total: makeNumberProp(0),
|
|
47
|
+
/**
|
|
48
|
+
* 每页条数
|
|
49
|
+
* 类型: number
|
|
50
|
+
* 默认值: 10
|
|
51
|
+
*/
|
|
52
|
+
pageSize: makeNumberProp(10),
|
|
53
|
+
/**
|
|
54
|
+
* 上一页文本
|
|
55
|
+
* 类型: string
|
|
56
|
+
*/
|
|
57
|
+
prevText: String,
|
|
58
|
+
/**
|
|
59
|
+
* 下一页文本
|
|
60
|
+
* 类型: string
|
|
61
|
+
*/
|
|
62
|
+
nextText: String,
|
|
63
|
+
/**
|
|
64
|
+
* 总页数只有一页时是否隐藏
|
|
65
|
+
* 类型: boolean
|
|
66
|
+
* 默认值: false
|
|
67
|
+
*/
|
|
68
|
+
hideIfOnePage: makeBooleanProp(false)
|
|
69
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="`wd-pagination ${customClass}`" :style="customStyle" v-if="!(hideIfOnePage && totalPageNum === 1)">
|
|
3
|
+
<view class="wd-pagination__content">
|
|
4
|
+
<slot name="prev" :modelValue="modelValue" :totalPageNum="totalPageNum" :total="total" :pageSize="pageSize">
|
|
5
|
+
<wd-button
|
|
6
|
+
:plain="modelValue > 1"
|
|
7
|
+
type="info"
|
|
8
|
+
:variant="buttonVariant"
|
|
9
|
+
size="small"
|
|
10
|
+
:disabled="modelValue <= 1"
|
|
11
|
+
:custom-class="`wd-pagination__nav`"
|
|
12
|
+
:icon="showIcon ? 'left' : ''"
|
|
13
|
+
:text="showIcon ? '' : prevText || translate('prev')"
|
|
14
|
+
@click="sub"
|
|
15
|
+
></wd-button>
|
|
16
|
+
</slot>
|
|
17
|
+
<slot name="size" :modelValue="modelValue" :totalPageNum="totalPageNum" :total="total" :pageSize="pageSize">
|
|
18
|
+
<view class="wd-pagination__size">
|
|
19
|
+
<text class="wd-pagination__current">{{ modelValue }}</text>
|
|
20
|
+
<text class="wd-pagination__separator">/</text>
|
|
21
|
+
<text class="wd-pagination__total">{{ totalPageNum }}</text>
|
|
22
|
+
</view>
|
|
23
|
+
</slot>
|
|
24
|
+
<slot name="next" :modelValue="modelValue" :totalPageNum="totalPageNum" :total="total" :pageSize="pageSize">
|
|
25
|
+
<wd-button
|
|
26
|
+
:plain="modelValue < totalPageNum"
|
|
27
|
+
type="primary"
|
|
28
|
+
:variant="buttonVariant"
|
|
29
|
+
size="small"
|
|
30
|
+
:disabled="modelValue >= totalPageNum"
|
|
31
|
+
:custom-class="`wd-pagination__nav`"
|
|
32
|
+
:icon="showIcon ? 'right' : ''"
|
|
33
|
+
:text="showIcon ? '' : nextText || translate('next')"
|
|
34
|
+
@click="add"
|
|
35
|
+
></wd-button>
|
|
36
|
+
</slot>
|
|
37
|
+
</view>
|
|
38
|
+
<slot name="message" :modelValue="modelValue" :totalPageNum="totalPageNum" :total="total" :pageSize="pageSize" v-if="showMessage">
|
|
39
|
+
<view class="wd-pagination__message">
|
|
40
|
+
<text>{{ translate('page', modelValue) }},</text>
|
|
41
|
+
<text v-if="total">{{ translate('total', total) }},</text>
|
|
42
|
+
<text>{{ translate('size', pageSize) }}</text>
|
|
43
|
+
</view>
|
|
44
|
+
</slot>
|
|
45
|
+
</view>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script lang="ts">
|
|
49
|
+
export default {
|
|
50
|
+
name: 'wd-pagination',
|
|
51
|
+
options: {
|
|
52
|
+
// #ifndef MP-TOUTIAO
|
|
53
|
+
virtualHost: true,
|
|
54
|
+
// #endif
|
|
55
|
+
addGlobalClass: true,
|
|
56
|
+
styleIsolation: 'shared'
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<script lang="ts" setup>
|
|
62
|
+
import wdButton from '../wd-button/wd-button.vue'
|
|
63
|
+
import { ref, watch } from 'vue'
|
|
64
|
+
import { useTranslate } from '../../composables/useTranslate'
|
|
65
|
+
import { paginationProps } from './types'
|
|
66
|
+
|
|
67
|
+
const { translate } = useTranslate('pagination')
|
|
68
|
+
|
|
69
|
+
const props = defineProps(paginationProps)
|
|
70
|
+
const emit = defineEmits(['change', 'update:modelValue'])
|
|
71
|
+
|
|
72
|
+
const totalPageNum = ref<number>(0) // 总页数
|
|
73
|
+
|
|
74
|
+
watch(
|
|
75
|
+
() => props.totalPage,
|
|
76
|
+
(newValue) => {
|
|
77
|
+
if (!totalPageNum.value && newValue) {
|
|
78
|
+
totalPageNum.value = newValue
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{ immediate: true, deep: true }
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
watch(
|
|
85
|
+
() => props.total,
|
|
86
|
+
() => {
|
|
87
|
+
updateTotalPage()
|
|
88
|
+
},
|
|
89
|
+
{ immediate: true, deep: true }
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
function add() {
|
|
93
|
+
const { modelValue } = props
|
|
94
|
+
if (modelValue > totalPageNum.value - 1) {
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
emit('change', { value: modelValue + 1 })
|
|
98
|
+
emit('update:modelValue', modelValue + 1)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function sub() {
|
|
102
|
+
const { modelValue } = props
|
|
103
|
+
if (modelValue < 2) {
|
|
104
|
+
return
|
|
105
|
+
}
|
|
106
|
+
emit('change', { value: modelValue - 1 })
|
|
107
|
+
emit('update:modelValue', modelValue - 1)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function updateTotalPage() {
|
|
111
|
+
const { total, pageSize } = props
|
|
112
|
+
totalPageNum.value = Math.ceil(total / pageSize)
|
|
113
|
+
}
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<style lang="scss">
|
|
117
|
+
@use './index.scss';
|
|
118
|
+
</style>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss' as *;
|
|
2
|
+
@use '../../styles/variable.scss' as *;
|
|
3
|
+
|
|
4
|
+
// 输入区域高度
|
|
5
|
+
$password-input-height: var(--wot-password-input-height, $n-50) !default;
|
|
6
|
+
// 组件外边距
|
|
7
|
+
$password-input-margin: var(--wot-password-input-margin, $n-16) !default;
|
|
8
|
+
// 输入字号
|
|
9
|
+
$password-input-font-size: var(--wot-password-input-font-size, $typography-title-size-large) !default;
|
|
10
|
+
// 输入行高
|
|
11
|
+
$password-input-line-height: var(--wot-password-input-line-height, $typography-title-line--height-size-large) !default;
|
|
12
|
+
// 输入格圆角
|
|
13
|
+
$password-input-radius: var(--wot-password-input-radius, $n-6) !default;
|
|
14
|
+
// 输入格背景色
|
|
15
|
+
$password-input-bg: var(--wot-password-input-bg, $filled-oppo) !default;
|
|
16
|
+
// 提示信息颜色
|
|
17
|
+
$password-input-info-color: var(--wot-password-input-info-color, $text-auxiliary) !default;
|
|
18
|
+
// 提示信息字号
|
|
19
|
+
$password-input-info-font-size: var(--wot-password-input-info-font-size, $typography-body-size-main) !default;
|
|
20
|
+
// 边框颜色
|
|
21
|
+
$password-input-border-color: var(--wot-password-input-border-color, $border-main) !default;
|
|
22
|
+
// 边框宽度
|
|
23
|
+
$password-input-border-width: var(--wot-password-input-border-width, $stroke-main) !default;
|
|
24
|
+
// 错误提示颜色
|
|
25
|
+
$password-input-error-info-color: var(--wot-password-input-error-info-color, $danger-main) !default;
|
|
26
|
+
// 密码点尺寸
|
|
27
|
+
$password-input-dot-size: var(--wot-password-input-dot-size, $n-10) !default;
|
|
28
|
+
// 密码点颜色
|
|
29
|
+
$password-input-dot-color: var(--wot-password-input-dot-color, $text-main) !default;
|
|
30
|
+
// 密码点圆角
|
|
31
|
+
$password-input-dot-radius: var(--wot-password-input-dot-radius, $radius-radius-full) !default;
|
|
32
|
+
// 输入文本颜色
|
|
33
|
+
$password-input-text-color: var(--wot-password-input-text-color, $text-main) !default;
|
|
34
|
+
// 光标颜色
|
|
35
|
+
$password-input-cursor-color: var(--wot-password-input-cursor-color, $text-main) !default;
|
|
36
|
+
// 光标宽度
|
|
37
|
+
$password-input-cursor-width: var(--wot-password-input-cursor-width, $n-1) !default;
|
|
38
|
+
// 光标高度
|
|
39
|
+
$password-input-cursor-height: var(--wot-password-input-cursor-height, 40%) !default;
|
|
40
|
+
// 光标闪烁周期
|
|
41
|
+
$password-input-cursor-duration: var(--wot-password-input-cursor-duration, 1s) !default;
|
|
42
|
+
|
|
43
|
+
@include b(password-input) {
|
|
44
|
+
position: relative;
|
|
45
|
+
margin: 0 $password-input-margin;
|
|
46
|
+
user-select: none;
|
|
47
|
+
|
|
48
|
+
@include e(security) {
|
|
49
|
+
display: flex;
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: $password-input-height;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@include e(item) {
|
|
56
|
+
position: relative;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex: 1;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
height: 100%;
|
|
62
|
+
color: $password-input-text-color;
|
|
63
|
+
font-size: $password-input-font-size;
|
|
64
|
+
line-height: $password-input-line-height;
|
|
65
|
+
background: $password-input-bg;
|
|
66
|
+
|
|
67
|
+
@include when(border) {
|
|
68
|
+
border: $password-input-border-width solid $password-input-border-color;
|
|
69
|
+
|
|
70
|
+
&:not(:last-child) {
|
|
71
|
+
border-right: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:first-child {
|
|
75
|
+
border-top-left-radius: $password-input-radius;
|
|
76
|
+
border-bottom-left-radius: $password-input-radius;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:last-child {
|
|
80
|
+
border-top-right-radius: $password-input-radius;
|
|
81
|
+
border-bottom-right-radius: $password-input-radius;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@include e(mask) {
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: 50%;
|
|
89
|
+
left: 50%;
|
|
90
|
+
width: $password-input-dot-size;
|
|
91
|
+
height: $password-input-dot-size;
|
|
92
|
+
background: $password-input-dot-color;
|
|
93
|
+
border-radius: $password-input-dot-radius;
|
|
94
|
+
transform: translate(-50%, -50%);
|
|
95
|
+
visibility: hidden;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@include e(cursor) {
|
|
99
|
+
position: absolute;
|
|
100
|
+
top: 50%;
|
|
101
|
+
left: 50%;
|
|
102
|
+
width: $password-input-cursor-width;
|
|
103
|
+
height: $password-input-cursor-height;
|
|
104
|
+
background: $password-input-cursor-color;
|
|
105
|
+
transform: translate(-50%, -50%);
|
|
106
|
+
animation: $password-input-cursor-duration cursor-flicker infinite;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@include e(info) {
|
|
110
|
+
margin-top: $password-input-margin;
|
|
111
|
+
font-size: $password-input-info-font-size;
|
|
112
|
+
text-align: center;
|
|
113
|
+
color: $password-input-info-color;
|
|
114
|
+
|
|
115
|
+
@include when(error) {
|
|
116
|
+
color: $password-input-error-info-color;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@keyframes cursor-flicker {
|
|
123
|
+
from {
|
|
124
|
+
opacity: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
50% {
|
|
128
|
+
opacity: 1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
100% {
|
|
132
|
+
opacity: 0;
|
|
133
|
+
}
|
|
134
|
+
}
|