@tplc/wot 1.0.7 → 1.0.9
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/CHANGELOG.md +14 -0
- package/components/common/AbortablePromise.ts +3 -11
- package/components/common/abstracts/_config.scss +1 -1
- package/components/common/abstracts/_function.scss +26 -13
- package/components/common/abstracts/_mixin.scss +117 -71
- package/components/common/abstracts/variable.scss +325 -697
- package/components/common/base64.ts +1 -2
- package/components/common/canvasHelper.ts +1 -1
- package/components/common/interceptor.ts +43 -0
- package/components/common/props.ts +8 -8
- package/components/common/util.ts +145 -60
- package/components/composables/index.ts +11 -0
- package/components/composables/useChildren.ts +9 -18
- package/components/composables/useCountDown.ts +2 -2
- package/components/composables/useLockScroll.ts +1 -3
- package/components/composables/useParent.ts +4 -4
- package/components/composables/usePopover.ts +43 -60
- package/components/composables/useQueue.ts +2 -2
- package/components/composables/useTouch.ts +2 -3
- package/components/composables/useTranslate.ts +2 -13
- package/components/composables/useUpload.ts +389 -0
- package/components/wd-action-sheet/index.scss +22 -22
- package/components/wd-action-sheet/types.ts +11 -21
- package/components/wd-action-sheet/wd-action-sheet.vue +21 -40
- package/components/wd-backtop/index.scss +5 -5
- package/components/wd-backtop/types.ts +3 -15
- package/components/wd-backtop/wd-backtop.vue +12 -20
- package/components/wd-badge/index.scss +14 -10
- package/components/wd-badge/types.ts +6 -9
- package/components/wd-badge/wd-badge.vue +29 -37
- package/components/wd-button/index.scss +76 -80
- package/components/wd-button/types.ts +43 -13
- package/components/wd-button/wd-button.vue +41 -22
- package/components/wd-calendar/index.scss +58 -145
- package/components/wd-calendar/types.ts +23 -41
- package/components/wd-calendar/wd-calendar.vue +123 -130
- package/components/wd-calendar-view/month/index.scss +33 -65
- package/components/wd-calendar-view/month/month.vue +80 -113
- package/components/wd-calendar-view/month/types.ts +2 -1
- package/components/wd-calendar-view/monthPanel/index.scss +15 -15
- package/components/wd-calendar-view/monthPanel/month-panel.vue +64 -78
- package/components/wd-calendar-view/monthPanel/types.ts +58 -10
- package/components/wd-calendar-view/types.ts +12 -36
- package/components/wd-calendar-view/utils.ts +14 -36
- package/components/wd-calendar-view/wd-calendar-view.vue +7 -7
- package/components/wd-calendar-view/year/index.scss +18 -13
- package/components/wd-calendar-view/year/types.ts +2 -1
- package/components/wd-calendar-view/year/year.vue +25 -43
- package/components/wd-calendar-view/yearPanel/index.scss +4 -4
- package/components/wd-calendar-view/yearPanel/types.ts +2 -2
- package/components/wd-calendar-view/yearPanel/year-panel.vue +36 -41
- package/components/wd-card/index.scss +11 -10
- package/components/wd-card/types.ts +1 -1
- package/components/wd-card/wd-card.vue +6 -9
- package/components/wd-cell/index.scss +56 -41
- package/components/wd-cell/types.ts +23 -8
- package/components/wd-cell/wd-cell.vue +48 -18
- package/components/wd-cell-group/index.scss +8 -7
- package/components/wd-cell-group/types.ts +1 -1
- package/components/wd-cell-group/wd-cell-group.vue +5 -5
- package/components/wd-checkbox/index.scss +35 -35
- package/components/wd-checkbox/types.ts +6 -6
- package/components/wd-checkbox/wd-checkbox.vue +12 -20
- package/components/wd-checkbox-group/index.scss +4 -4
- package/components/wd-checkbox-group/types.ts +2 -2
- package/components/wd-checkbox-group/wd-checkbox-group.vue +9 -12
- package/components/wd-circle/index.scss +5 -5
- package/components/wd-circle/types.ts +2 -2
- package/components/wd-circle/wd-circle.vue +18 -40
- package/components/wd-col/index.scss +2 -2
- package/components/wd-col/types.ts +1 -1
- package/components/wd-col/wd-col.vue +11 -53
- package/components/wd-col-picker/index.scss +41 -115
- package/components/wd-col-picker/types.ts +10 -14
- package/components/wd-col-picker/wd-col-picker.vue +103 -155
- package/components/wd-collapse/index.scss +7 -13
- package/components/wd-collapse/types.ts +4 -10
- package/components/wd-collapse/wd-collapse.vue +22 -55
- package/components/wd-collapse-item/index.scss +16 -5
- package/components/wd-collapse-item/types.ts +14 -2
- package/components/wd-collapse-item/wd-collapse-item.vue +70 -81
- package/components/wd-config-provider/types.ts +69 -40
- package/components/wd-config-provider/wd-config-provider.vue +11 -11
- package/components/wd-count-down/index.scss +3 -2
- package/components/wd-count-down/types.ts +1 -1
- package/components/wd-count-down/wd-count-down.vue +5 -5
- package/components/wd-count-to/index.scss +2 -1
- package/components/wd-count-to/types.ts +10 -3
- package/components/wd-count-to/wd-count-to.vue +9 -18
- package/components/wd-curtain/index.scss +28 -23
- package/components/wd-curtain/types.ts +46 -9
- package/components/wd-curtain/wd-curtain.vue +45 -47
- package/components/wd-datetime-picker/index.scss +65 -145
- package/components/wd-datetime-picker/types.ts +41 -31
- package/components/wd-datetime-picker/wd-datetime-picker.vue +307 -333
- package/components/wd-datetime-picker-view/types.ts +29 -46
- package/components/wd-datetime-picker-view/util.ts +30 -0
- package/components/wd-datetime-picker-view/wd-datetime-picker-view.vue +104 -119
- package/components/wd-divider/index.scss +78 -10
- package/components/wd-divider/types.ts +26 -3
- package/components/wd-divider/wd-divider.vue +33 -10
- package/components/wd-drop-menu/index.scss +17 -45
- package/components/wd-drop-menu/types.ts +3 -3
- package/components/wd-drop-menu/wd-drop-menu.vue +61 -25
- package/components/wd-drop-menu-item/index.scss +15 -15
- package/components/wd-drop-menu-item/types.ts +18 -15
- package/components/wd-drop-menu-item/wd-drop-menu-item.vue +33 -54
- package/components/wd-fab/index.scss +13 -12
- package/components/wd-fab/types.ts +9 -4
- package/components/wd-fab/wd-fab.vue +70 -51
- package/components/wd-floating-panel/index.scss +64 -0
- package/components/wd-floating-panel/type.ts +32 -0
- package/components/wd-floating-panel/wd-floating-panel.vue +140 -0
- package/components/wd-form/types.ts +8 -16
- package/components/wd-form/wd-form.vue +67 -45
- package/components/wd-form-item/index.scss +3 -2
- package/components/wd-form-item/types.ts +2 -8
- package/components/wd-form-item/wd-form-item.vue +3 -3
- package/components/wd-grid/index.scss +2 -2
- package/components/wd-grid/types.ts +5 -0
- package/components/wd-grid/wd-grid.vue +11 -12
- package/components/wd-grid-item/index.scss +44 -33
- package/components/wd-grid-item/types.ts +7 -4
- package/components/wd-grid-item/wd-grid-item.vue +39 -44
- package/components/wd-icon/index.scss +311 -303
- package/components/wd-icon/types.ts +3 -3
- package/components/wd-icon/wd-icon.vue +6 -6
- package/components/wd-img/types.ts +1 -1
- package/components/wd-img/wd-img.vue +12 -4
- package/components/wd-img-cropper/index.scss +43 -39
- package/components/wd-img-cropper/types.ts +6 -8
- package/components/wd-img-cropper/wd-img-cropper.vue +132 -127
- package/components/wd-index-anchor/index.scss +7 -6
- package/components/wd-index-anchor/type.ts +2 -2
- package/components/wd-index-anchor/wd-index-anchor.vue +3 -9
- package/components/wd-index-bar/index.scss +5 -5
- package/components/wd-index-bar/type.ts +3 -2
- package/components/wd-index-bar/wd-index-bar.vue +15 -51
- package/components/wd-input/index.scss +44 -33
- package/components/wd-input/placeholder.css +20 -0
- package/components/wd-input/types.ts +40 -19
- package/components/wd-input/wd-input.vue +58 -42
- package/components/wd-input-number/index.scss +23 -31
- package/components/wd-input-number/types.ts +42 -14
- package/components/wd-input-number/wd-input-number.vue +374 -141
- package/components/wd-keyboard/constants.ts +81 -0
- package/components/wd-keyboard/index.scss +102 -0
- package/components/wd-keyboard/key/index.scss +79 -0
- package/components/wd-keyboard/key/index.vue +71 -0
- package/components/wd-keyboard/key/types.ts +11 -0
- package/components/wd-keyboard/types.ts +92 -0
- package/components/wd-keyboard/wd-keyboard.vue +206 -0
- package/components/wd-loading/index.scss +9 -6
- package/components/wd-loading/types.ts +1 -1
- package/components/wd-loading/wd-loading.vue +9 -9
- package/components/wd-loadmore/index.scss +5 -5
- package/components/wd-loadmore/types.ts +8 -2
- package/components/wd-loadmore/wd-loadmore.vue +28 -13
- package/components/wd-message-box/index.scss +21 -34
- package/components/wd-message-box/index.ts +30 -29
- package/components/wd-message-box/types.ts +33 -8
- package/components/wd-message-box/wd-message-box.vue +130 -152
- package/components/wd-navbar/index.scss +14 -24
- package/components/wd-navbar/types.ts +1 -1
- package/components/wd-navbar/wd-navbar.vue +14 -45
- package/components/wd-navbar-capsule/index.scss +16 -15
- package/components/wd-navbar-capsule/types.ts +8 -0
- package/components/wd-navbar-capsule/wd-navbar-capsule.vue +8 -4
- package/components/wd-notice-bar/index.scss +15 -33
- package/components/wd-notice-bar/types.ts +14 -3
- package/components/wd-notice-bar/wd-notice-bar.vue +109 -66
- package/components/wd-notify/index.scss +5 -5
- package/components/wd-notify/index.ts +17 -15
- package/components/wd-notify/types.ts +4 -0
- package/components/wd-notify/wd-notify.vue +21 -19
- package/components/wd-number-keyboard/index.scss +10 -10
- package/components/wd-number-keyboard/key/index.scss +7 -5
- package/components/wd-number-keyboard/key/index.vue +6 -9
- package/components/wd-number-keyboard/key/types.ts +1 -1
- package/components/wd-number-keyboard/types.ts +4 -0
- package/components/wd-number-keyboard/wd-number-keyboard.vue +22 -44
- package/components/wd-overlay/index.scss +3 -3
- package/components/wd-overlay/types.ts +2 -2
- package/components/wd-overlay/wd-overlay.vue +7 -15
- package/components/wd-pagination/index.scss +17 -17
- package/components/wd-pagination/types.ts +1 -1
- package/components/wd-pagination/wd-pagination.vue +10 -21
- package/components/wd-password-input/index.scss +7 -6
- package/components/wd-password-input/types.ts +2 -8
- package/components/wd-password-input/wd-password-input.vue +6 -15
- package/components/wd-picker/index.scss +46 -153
- package/components/wd-picker/types.ts +22 -19
- package/components/wd-picker/wd-picker.vue +89 -86
- package/components/wd-picker-view/index.scss +13 -12
- package/components/wd-picker-view/types.ts +16 -26
- package/components/wd-picker-view/wd-picker-view.vue +32 -24
- package/components/wd-popover/index.scss +29 -36
- package/components/wd-popover/types.ts +1 -1
- package/components/wd-popover/wd-popover.vue +20 -56
- package/components/wd-popup/index.scss +47 -75
- package/components/wd-popup/types.ts +40 -4
- package/components/wd-popup/wd-popup.vue +100 -157
- package/components/wd-progress/index.scss +20 -14
- package/components/wd-progress/types.ts +10 -6
- package/components/wd-progress/wd-progress.vue +137 -141
- package/components/wd-radio/index.scss +54 -53
- package/components/wd-radio/types.ts +15 -6
- package/components/wd-radio/wd-radio.vue +41 -59
- package/components/wd-radio-group/index.scss +5 -5
- package/components/wd-radio-group/types.ts +4 -1
- package/components/wd-radio-group/wd-radio-group.vue +6 -9
- package/components/wd-rate/index.scss +1 -1
- package/components/wd-rate/types.ts +10 -5
- package/components/wd-rate/wd-rate.vue +35 -17
- package/components/wd-resize/index.scss +2 -1
- package/components/wd-resize/types.ts +1 -1
- package/components/wd-resize/wd-resize.vue +11 -22
- package/components/wd-root-portal/wd-root-portal.vue +50 -0
- package/components/wd-row/index.scss +1 -1
- package/components/wd-row/types.ts +1 -1
- package/components/wd-row/wd-row.vue +14 -35
- package/components/wd-search/index.scss +29 -29
- package/components/wd-search/types.ts +22 -3
- package/components/wd-search/wd-search.vue +70 -120
- package/components/wd-segmented/index.scss +19 -15
- package/components/wd-segmented/types.ts +16 -4
- package/components/wd-segmented/wd-segmented.vue +34 -34
- package/components/wd-select-picker/index.scss +55 -122
- package/components/wd-select-picker/types.ts +29 -36
- package/components/wd-select-picker/wd-select-picker.vue +128 -274
- package/components/wd-sidebar/index.scss +5 -5
- package/components/wd-sidebar/types.ts +22 -3
- package/components/wd-sidebar/wd-sidebar.vue +26 -4
- package/components/wd-sidebar-item/index.scss +17 -13
- package/components/wd-sidebar-item/types.ts +3 -3
- package/components/wd-sidebar-item/wd-sidebar-item.vue +12 -10
- package/components/wd-signature/index.scss +31 -0
- package/components/wd-signature/types.ts +263 -0
- package/components/wd-signature/wd-signature.vue +630 -0
- package/components/wd-skeleton/index.scss +8 -13
- package/components/wd-skeleton/types.ts +6 -6
- package/components/wd-skeleton/wd-skeleton.vue +15 -31
- package/components/wd-slider/index.scss +24 -17
- package/components/wd-slider/types.ts +45 -17
- package/components/wd-slider/wd-slider.vue +275 -297
- package/components/wd-sort-button/index.scss +10 -7
- package/components/wd-sort-button/types.ts +1 -1
- package/components/wd-sort-button/wd-sort-button.vue +7 -14
- package/components/wd-status-tip/index.scss +8 -8
- package/components/wd-status-tip/types.ts +8 -2
- package/components/wd-status-tip/wd-status-tip.vue +14 -37
- package/components/wd-step/index.scss +29 -30
- package/components/wd-step/types.ts +1 -1
- package/components/wd-step/wd-step.vue +8 -9
- package/components/wd-steps/index.scss +1 -1
- package/components/wd-steps/types.ts +1 -1
- package/components/wd-steps/wd-steps.vue +5 -5
- package/components/wd-sticky/index.scss +1 -1
- package/components/wd-sticky/types.ts +1 -1
- package/components/wd-sticky/wd-sticky.vue +21 -29
- package/components/wd-sticky-box/index.scss +1 -1
- package/components/wd-sticky-box/wd-sticky-box.vue +7 -6
- package/components/wd-swipe-action/index.scss +1 -1
- package/components/wd-swipe-action/types.ts +2 -5
- package/components/wd-swipe-action/wd-swipe-action.vue +9 -22
- package/components/wd-swiper-nav/index.scss +22 -16
- package/components/wd-swiper-nav/types.ts +1 -9
- package/components/wd-swiper-nav/wd-swiper-nav.vue +2 -5
- package/components/wd-switch/index.scss +15 -15
- package/components/wd-switch/types.ts +8 -6
- package/components/wd-switch/wd-switch.vue +15 -15
- package/components/wd-tab/index.scss +11 -3
- package/components/wd-tab/types.ts +11 -1
- package/components/wd-tab/wd-tab.vue +28 -36
- package/components/wd-tabbar/index.scss +12 -7
- package/components/wd-tabbar/types.ts +3 -18
- package/components/wd-tabbar/wd-tabbar.vue +10 -23
- package/components/wd-tabbar-item/index.scss +15 -12
- package/components/wd-tabbar-item/types.ts +3 -3
- package/components/wd-tabbar-item/wd-tabbar-item.vue +11 -13
- package/components/wd-table/index.scss +40 -9
- package/components/wd-table/types.ts +13 -15
- package/components/wd-table/wd-table.vue +123 -94
- package/components/wd-table-col/index.scss +6 -4
- package/components/wd-table-col/types.ts +1 -1
- package/components/wd-table-col/wd-table-col.vue +12 -12
- package/components/wd-tag/index.scss +19 -19
- package/components/wd-tag/types.ts +1 -1
- package/components/wd-tag/wd-tag.vue +14 -20
- package/components/wd-text/index.scss +4 -1
- package/components/wd-text/types.ts +4 -4
- package/components/wd-text/wd-text.vue +12 -11
- package/components/wd-textarea/index.scss +51 -41
- package/components/wd-textarea/placeholder.css +20 -0
- package/components/wd-textarea/types.ts +24 -34
- package/components/wd-textarea/wd-textarea.vue +53 -33
- package/components/wd-toast/index.scss +31 -18
- package/components/wd-toast/index.ts +26 -43
- package/components/wd-toast/types.ts +117 -3
- package/components/wd-toast/wd-toast.vue +49 -69
- package/components/wd-tooltip/index.scss +21 -16
- package/components/wd-tooltip/types.ts +8 -3
- package/components/wd-tooltip/wd-tooltip.vue +17 -43
- package/components/wd-tour/index.scss +123 -0
- package/components/wd-tour/types.ts +153 -0
- package/components/wd-tour/wd-tour.vue +509 -0
- package/components/wd-transition/index.scss +39 -35
- package/components/wd-transition/types.ts +27 -9
- package/components/wd-transition/wd-transition.vue +45 -34
- package/components/wd-upload/index.scss +23 -21
- package/components/wd-upload/types.ts +43 -30
- package/components/wd-upload/wd-upload.vue +183 -247
- package/components/wd-video-preview/index.scss +9 -9
- package/components/wd-video-preview/types.ts +1 -1
- package/components/wd-video-preview/wd-video-preview.vue +18 -22
- package/components/wd-watermark/index.scss +7 -7
- package/components/wd-watermark/types.ts +2 -8
- package/components/wd-watermark/wd-watermark.vue +38 -135
- package/dayjs/constant.js +26 -0
- package/dayjs/index.d.ts +430 -0
- package/dayjs/index.js +542 -0
- package/dayjs/locale/en.js +13 -0
- package/dayjs/utils.js +59 -0
- package/global.d.ts +97 -91
- package/index.ts +2 -10
- package/locale/index.ts +3 -15
- package/locale/lang/ar-SA.ts +133 -0
- package/locale/lang/de-DE.ts +133 -0
- package/locale/lang/en-US.ts +31 -26
- package/locale/lang/es-ES.ts +133 -0
- package/locale/lang/fr-FR.ts +133 -0
- package/locale/lang/ja-JP.ts +133 -0
- package/locale/lang/ko-KR.ts +133 -0
- package/locale/lang/pt-PT.ts +133 -0
- package/locale/lang/ru-RU.ts +133 -0
- package/locale/lang/th-TH.ts +28 -22
- package/locale/lang/tr-TR.ts +138 -0
- package/locale/lang/ug-CN.ts +137 -0
- package/locale/lang/vi-VN.ts +27 -30
- package/locale/lang/zh-CN.ts +32 -22
- package/locale/lang/zh-HK.ts +18 -31
- package/locale/lang/zh-TW.ts +22 -31
- package/package.json +1 -1
- package/types/components/common/interceptor.d.ts +15 -0
- package/types/components/common/util.d.ts +61 -1
- package/types/components/composables/useCell.d.ts +1 -1
- package/types/components/composables/useLockScroll.d.ts +1 -2
- package/types/components/composables/useParent.d.ts +1 -1
- package/types/components/composables/usePopover.d.ts +2 -2
- package/types/components/composables/useUpload.d.ts +41 -0
- package/types/components/wd-action-sheet/types.d.ts +13 -4
- package/types/components/wd-action-sheet/wd-action-sheet.vue.d.ts +20 -11
- package/types/components/wd-backtop/types.d.ts +1 -9
- package/types/components/wd-backtop/wd-backtop.vue.d.ts +6 -25
- package/types/components/wd-badge/types.d.ts +3 -6
- package/types/components/wd-badge/wd-badge.vue.d.ts +7 -14
- package/types/components/wd-button/types.d.ts +44 -8
- package/types/components/wd-button/wd-button.vue.d.ts +13 -9
- package/types/components/wd-calendar/types.d.ts +24 -18
- package/types/components/wd-calendar/wd-calendar.vue.d.ts +48 -32
- package/types/components/wd-calendar-view/month/month.vue.d.ts +11 -3
- package/types/components/wd-calendar-view/month/types.d.ts +4 -0
- package/types/components/wd-calendar-view/monthPanel/month-panel.vue.d.ts +18 -12
- package/types/components/wd-calendar-view/monthPanel/types.d.ts +48 -6
- package/types/components/wd-calendar-view/types.d.ts +11 -4
- package/types/components/wd-calendar-view/utils.d.ts +3 -12
- package/types/components/wd-calendar-view/wd-calendar-view.vue.d.ts +1 -1
- package/types/components/wd-calendar-view/year/types.d.ts +4 -0
- package/types/components/wd-calendar-view/year/year.vue.d.ts +11 -3
- package/types/components/wd-cell/types.d.ts +37 -1
- package/types/components/wd-cell/wd-cell.vue.d.ts +53 -9
- package/types/components/wd-checkbox/wd-checkbox.vue.d.ts +2 -2
- package/types/components/wd-checkbox-group/wd-checkbox-group.vue.d.ts +2 -2
- package/types/components/wd-circle/wd-circle.vue.d.ts +3 -3
- package/types/components/wd-col-picker/types.d.ts +14 -0
- package/types/components/wd-col-picker/wd-col-picker.vue.d.ts +36 -19
- package/types/components/wd-collapse/types.d.ts +1 -5
- package/types/components/wd-collapse/wd-collapse.vue.d.ts +3 -11
- package/types/components/wd-collapse-item/types.d.ts +19 -1
- package/types/components/wd-collapse-item/wd-collapse-item.vue.d.ts +20 -1
- package/types/components/wd-config-provider/types.d.ts +64 -7
- package/types/components/wd-config-provider/wd-config-provider.vue.d.ts +1 -1
- package/types/components/wd-count-to/types.d.ts +11 -0
- package/types/components/wd-count-to/wd-count-to.vue.d.ts +13 -4
- package/types/components/wd-curtain/types.d.ts +56 -0
- package/types/components/wd-curtain/wd-curtain.vue.d.ts +152 -77
- package/types/components/wd-datetime-picker/types.d.ts +49 -15
- package/types/components/wd-datetime-picker/wd-datetime-picker.vue.d.ts +75 -38
- package/types/components/wd-datetime-picker-view/types.d.ts +36 -14
- package/types/components/wd-datetime-picker-view/util.d.ts +12 -0
- package/types/components/wd-datetime-picker-view/wd-datetime-picker-view.vue.d.ts +35 -9
- package/types/components/wd-divider/types.d.ts +32 -4
- package/types/components/wd-divider/wd-divider.vue.d.ts +30 -7
- package/types/components/wd-drop-menu/types.d.ts +3 -3
- package/types/components/wd-drop-menu/wd-drop-menu.vue.d.ts +8 -8
- package/types/components/wd-drop-menu-item/types.d.ts +27 -15
- package/types/components/wd-drop-menu-item/wd-drop-menu-item.vue.d.ts +47 -36
- package/types/components/wd-fab/types.d.ts +19 -3
- package/types/components/wd-fab/wd-fab.vue.d.ts +13 -1
- package/types/components/wd-floating-panel/type.d.ts +54 -0
- package/types/components/wd-floating-panel/wd-floating-panel.vue.d.ts +109 -0
- package/types/components/wd-form/types.d.ts +1 -1
- package/types/components/wd-form/wd-form.vue.d.ts +2 -2
- package/types/components/wd-form-item/wd-form-item.vue.d.ts +2 -2
- package/types/components/wd-grid/types.d.ts +5 -0
- package/types/components/wd-grid/wd-grid.vue.d.ts +2 -0
- package/types/components/wd-grid-item/types.d.ts +4 -1
- package/types/components/wd-grid-item/wd-grid-item.vue.d.ts +3 -3
- package/types/components/wd-icon/types.d.ts +1 -1
- package/types/components/wd-icon/wd-icon.vue.d.ts +3 -3
- package/types/components/wd-img/types.d.ts +4 -1
- package/types/components/wd-img/wd-img.vue.d.ts +11 -4
- package/types/components/wd-img-cropper/types.d.ts +7 -0
- package/types/components/wd-img-cropper/wd-img-cropper.vue.d.ts +12 -3
- package/types/components/wd-index-bar/type.d.ts +2 -1
- package/types/components/wd-index-bar/wd-index-bar.vue.d.ts +1 -5
- package/types/components/wd-input/types.d.ts +53 -37
- package/types/components/wd-input/wd-input.vue.d.ts +50 -52
- package/types/components/wd-input-number/types.d.ts +51 -6
- package/types/components/wd-input-number/wd-input-number.vue.d.ts +152 -125
- package/types/components/wd-keyboard/constants.d.ts +8 -0
- package/types/components/wd-keyboard/key/index.vue.d.ts +70 -0
- package/types/components/wd-keyboard/key/types.d.ts +23 -0
- package/types/components/wd-keyboard/types.d.ts +137 -0
- package/types/components/wd-keyboard/wd-keyboard.vue.d.ts +200 -0
- package/types/components/wd-loading/wd-loading.vue.d.ts +2 -2
- package/types/components/wd-loadmore/types.d.ts +7 -4
- package/types/components/wd-loadmore/wd-loadmore.vue.d.ts +5 -9
- package/types/components/wd-message-box/index.d.ts +3 -8
- package/types/components/wd-message-box/types.d.ts +36 -5
- package/types/components/wd-message-box/wd-message-box.vue.d.ts +18 -2
- package/types/components/wd-navbar/wd-navbar.vue.d.ts +3 -3
- package/types/components/wd-navbar-capsule/types.d.ts +12 -0
- package/types/components/wd-navbar-capsule/wd-navbar-capsule.vue.d.ts +27 -4
- package/types/components/wd-notice-bar/types.d.ts +9 -1
- package/types/components/wd-notice-bar/wd-notice-bar.vue.d.ts +7 -5
- package/types/components/wd-notify/types.d.ts +7 -0
- package/types/components/wd-notify/wd-notify.vue.d.ts +13 -4
- package/types/components/wd-number-keyboard/types.d.ts +7 -0
- package/types/components/wd-number-keyboard/wd-number-keyboard.vue.d.ts +18 -9
- package/types/components/wd-overlay/wd-overlay.vue.d.ts +2 -2
- package/types/components/wd-pagination/wd-pagination.vue.d.ts +1 -1
- package/types/components/wd-password-input/wd-password-input.vue.d.ts +2 -2
- package/types/components/wd-picker/types.d.ts +28 -2
- package/types/components/wd-picker/wd-picker.vue.d.ts +55 -19
- package/types/components/wd-picker-view/types.d.ts +10 -0
- package/types/components/wd-picker-view/wd-picker-view.vue.d.ts +15 -3
- package/types/components/wd-popover/wd-popover.vue.d.ts +4 -4
- package/types/components/wd-popup/types.d.ts +44 -5
- package/types/components/wd-popup/wd-popup.vue.d.ts +35 -24
- package/types/components/wd-progress/types.d.ts +6 -3
- package/types/components/wd-progress/wd-progress.vue.d.ts +4 -6
- package/types/components/wd-qr-code/uqrcode.vue.d.ts +3 -3
- package/types/components/wd-qr-code/wd-qr-code.vue.d.ts +4 -4
- package/types/components/wd-radio/types.d.ts +8 -0
- package/types/components/wd-radio/wd-radio.vue.d.ts +7 -0
- package/types/components/wd-radio-group/types.d.ts +7 -1
- package/types/components/wd-radio-group/wd-radio-group.vue.d.ts +11 -2
- package/types/components/wd-rate/types.d.ts +9 -0
- package/types/components/wd-rate/wd-rate.vue.d.ts +13 -4
- package/types/components/wd-root-portal/wd-root-portal.vue.d.ts +26 -0
- package/types/components/wd-search/types.d.ts +16 -1
- package/types/components/wd-search/wd-search.vue.d.ts +28 -8
- package/types/components/wd-segmented/types.d.ts +10 -1
- package/types/components/wd-segmented/wd-segmented.vue.d.ts +6 -4
- package/types/components/wd-select-picker/types.d.ts +37 -22
- package/types/components/wd-select-picker/wd-select-picker.vue.d.ts +59 -30
- package/types/components/wd-sidebar/types.d.ts +19 -3
- package/types/components/wd-sidebar/wd-sidebar.vue.d.ts +4 -2
- package/types/components/wd-signature/types.d.ts +252 -0
- package/types/components/wd-signature/wd-signature.vue.d.ts +229 -0
- package/types/components/wd-skeleton/types.d.ts +3 -4
- package/types/components/wd-skeleton/wd-skeleton.vue.d.ts +10 -10
- package/types/components/wd-slider/types.d.ts +39 -15
- package/types/components/wd-slider/wd-slider.vue.d.ts +12 -38
- package/types/components/wd-sort-button/wd-sort-button.vue.d.ts +3 -3
- package/types/components/wd-status-tip/types.d.ts +9 -0
- package/types/components/wd-status-tip/wd-status-tip.vue.d.ts +69 -49
- package/types/components/wd-steps/wd-steps.vue.d.ts +1 -1
- package/types/components/wd-sticky/wd-sticky.vue.d.ts +3 -7
- package/types/components/wd-swipe-action/wd-swipe-action.vue.d.ts +3 -3
- package/types/components/wd-swiper/wd-swiper.vue.d.ts +4 -4
- package/types/components/wd-swiper-nav/types.d.ts +0 -14
- package/types/components/wd-swiper-nav/wd-swiper-nav.vue.d.ts +0 -18
- package/types/components/wd-switch/types.d.ts +0 -1
- package/types/components/wd-switch/wd-switch.vue.d.ts +2 -5
- package/types/components/wd-tab/types.d.ts +16 -3
- package/types/components/wd-tab/wd-tab.vue.d.ts +12 -4
- package/types/components/wd-tabbar/types.d.ts +1 -1
- package/types/components/wd-tabbar/wd-tabbar.vue.d.ts +5 -5
- package/types/components/wd-tabbar-item/wd-tabbar-item.vue.d.ts +1 -1
- package/types/components/wd-table/types.d.ts +12 -8
- package/types/components/wd-table/wd-table.vue.d.ts +16 -13
- package/types/components/wd-table-col/wd-table-col.vue.d.ts +1 -1
- package/types/components/wd-tabs/wd-tabs.vue.d.ts +7 -7
- package/types/components/wd-tag/wd-tag.vue.d.ts +4 -4
- package/types/components/wd-text/types.d.ts +2 -2
- package/types/components/wd-text/wd-text.vue.d.ts +7 -7
- package/types/components/wd-textarea/types.d.ts +41 -39
- package/types/components/wd-textarea/wd-textarea.vue.d.ts +46 -46
- package/types/components/wd-toast/index.d.ts +1 -6
- package/types/components/wd-toast/types.d.ts +127 -5
- package/types/components/wd-toast/wd-toast.vue.d.ts +101 -0
- package/types/components/wd-tooltip/types.d.ts +1 -1
- package/types/components/wd-tooltip/wd-tooltip.vue.d.ts +7 -7
- package/types/components/wd-tour/types.d.ts +194 -0
- package/types/components/wd-tour/wd-tour.vue.d.ts +267 -0
- package/types/components/wd-transition/types.d.ts +22 -7
- package/types/components/wd-transition/wd-transition.vue.d.ts +33 -20
- package/types/components/wd-upload/types.d.ts +39 -10
- package/types/components/wd-upload/wd-upload.vue.d.ts +42 -16
- package/types/components/wd-watermark/wd-watermark.vue.d.ts +7 -7
- package/types/locale/index.d.ts +0 -3
- package/types/locale/lang/zh-CN.d.ts +9 -0
- package/components/wd-datetime-picker-view/index.scss +0 -0
- package/components/wd-form/index.scss +0 -10
- package/components/wd-upload/utils.ts +0 -152
- package/types/components/common/dayjs.d.ts +0 -26
- package/types/components/wd-upload/utils.d.ts +0 -11
- package/types/locale/lang/en-US.d.ts +0 -128
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
1
|
+
@import "./../common/abstracts/_mixin.scss";
|
|
2
|
+
@import "./../common/abstracts/variable.scss";
|
|
3
3
|
|
|
4
4
|
.wot-theme-dark {
|
|
5
5
|
@include b(navbar-capsule) {
|
|
@@ -17,39 +17,40 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
|
|
20
21
|
@include b(navbar-capsule) {
|
|
21
22
|
position: relative;
|
|
22
23
|
box-sizing: border-box;
|
|
24
|
+
width: $-navbar-capsule-width;
|
|
25
|
+
height: $-navbar-capsule-height;
|
|
23
26
|
display: flex;
|
|
24
27
|
align-items: center;
|
|
25
28
|
justify-content: center;
|
|
26
|
-
width: $-navbar-capsule-width;
|
|
27
|
-
height: $-navbar-capsule-height;
|
|
28
29
|
|
|
29
30
|
&::before {
|
|
31
|
+
content: '';
|
|
30
32
|
position: absolute;
|
|
31
33
|
top: 0;
|
|
32
34
|
left: 0;
|
|
33
|
-
box-sizing: border-box;
|
|
34
35
|
width: 200%;
|
|
35
36
|
height: 200%;
|
|
36
|
-
content: '';
|
|
37
|
-
border: 2rpx solid $-navbar-capsule-border-color;
|
|
38
|
-
border-radius: calc($-navbar-capsule-border-radius * 2);
|
|
39
37
|
transform: scale(0.5);
|
|
40
38
|
transform-origin: 0 0;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
border-radius: calc($-navbar-capsule-border-radius * 2);
|
|
41
|
+
border: 2rpx solid $-navbar-capsule-border-color;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
&::after {
|
|
45
|
+
content: '';
|
|
46
|
+
display: block;
|
|
44
47
|
position: absolute;
|
|
45
|
-
top: 50%;
|
|
46
48
|
left: 50%;
|
|
47
|
-
|
|
49
|
+
top: 50%;
|
|
50
|
+
transform: translateY(-50%);
|
|
48
51
|
width: 1px;
|
|
49
52
|
height: 36rpx;
|
|
50
|
-
content: '';
|
|
51
53
|
background: $-navbar-capsule-border-color;
|
|
52
|
-
transform: translateY(-50%);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
&:empty {
|
|
@@ -57,9 +58,9 @@
|
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
@include edeep(icon) {
|
|
60
|
-
position: relative;
|
|
61
61
|
flex: 1;
|
|
62
|
-
|
|
62
|
+
position: relative;
|
|
63
63
|
color: $-navbar-desc-font-color;
|
|
64
|
+
font-size: $-navbar-capsule-icon-size;
|
|
64
65
|
}
|
|
65
|
-
}
|
|
66
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="wd-navbar-capsule">
|
|
2
|
+
<view :class="`wd-navbar-capsule ${customClass}`" :style="customStyle">
|
|
3
3
|
<wd-icon @click="handleBack" name="chevron-left" custom-class="wd-navbar-capsule__icon" />
|
|
4
4
|
<wd-icon @click="handleBackHome" name="home" custom-class="wd-navbar-capsule__icon" />
|
|
5
5
|
</view>
|
|
@@ -10,13 +10,17 @@ export default {
|
|
|
10
10
|
options: {
|
|
11
11
|
virtualHost: true,
|
|
12
12
|
addGlobalClass: true,
|
|
13
|
-
styleIsolation: 'shared'
|
|
14
|
-
}
|
|
13
|
+
styleIsolation: 'shared'
|
|
14
|
+
}
|
|
15
15
|
}
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<script lang="ts" setup>
|
|
19
|
+
import wdIcon from '../wd-icon/wd-icon.vue'
|
|
20
|
+
import { navbarCapsuleProps } from './types'
|
|
21
|
+
|
|
19
22
|
const emit = defineEmits(['back', 'back-home'])
|
|
23
|
+
defineProps(navbarCapsuleProps)
|
|
20
24
|
|
|
21
25
|
function handleBack() {
|
|
22
26
|
emit('back')
|
|
@@ -27,5 +31,5 @@ function handleBackHome() {
|
|
|
27
31
|
</script>
|
|
28
32
|
|
|
29
33
|
<style lang="scss">
|
|
30
|
-
@import './index';
|
|
34
|
+
@import './index.scss';
|
|
31
35
|
</style>
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
@import '../common/abstracts/mixin';
|
|
3
3
|
|
|
4
4
|
@include b(notice-bar) {
|
|
5
|
-
position: relative;
|
|
6
|
-
box-sizing: border-box;
|
|
7
5
|
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
6
|
padding: $-notice-bar-padding;
|
|
7
|
+
align-items: center;
|
|
10
8
|
font-size: $-notice-bar-fs;
|
|
11
9
|
border-radius: $-notice-bar-border-radius;
|
|
10
|
+
position: relative;
|
|
11
|
+
box-sizing: border-box;
|
|
12
12
|
@include when(warning) {
|
|
13
|
-
color: $-notice-bar-warning-color;
|
|
14
13
|
background: $-notice-bar-warning-bg;
|
|
14
|
+
color: $-notice-bar-warning-color;
|
|
15
15
|
}
|
|
16
16
|
@include when(info) {
|
|
17
|
-
color: $-notice-bar-info-color;
|
|
18
17
|
background: $-notice-bar-info-bg;
|
|
18
|
+
color: $-notice-bar-info-color;
|
|
19
19
|
}
|
|
20
20
|
@include when(danger) {
|
|
21
|
-
color: $-notice-bar-danger-color;
|
|
22
21
|
background: $-notice-bar-danger-bg;
|
|
22
|
+
color: $-notice-bar-danger-color;
|
|
23
23
|
}
|
|
24
24
|
@include edeep(prefix) {
|
|
25
25
|
padding-right: 4px;
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@include edeep(suffix) {
|
|
30
|
-
position: absolute;
|
|
31
|
-
top: 0;
|
|
32
|
-
right: 0;
|
|
33
|
-
display: inline-block;
|
|
34
|
-
padding: 0;
|
|
35
|
-
font-size: $-notice-bar-close-size;
|
|
36
|
-
color: $-notice-bar-close-color;
|
|
37
30
|
text-align: center;
|
|
31
|
+
font-size: $-notice-bar-close-size;
|
|
32
|
+
display: inline-block;
|
|
38
33
|
background-color: $-notice-bar-close-bg;
|
|
34
|
+
color: $-notice-bar-close-color;
|
|
35
|
+
padding: 0;
|
|
39
36
|
border-radius: 0px 8px 0px 4px;
|
|
37
|
+
position: absolute;
|
|
38
|
+
right: 0;
|
|
39
|
+
top: 0;
|
|
40
40
|
}
|
|
41
41
|
@include e(wrap) {
|
|
42
42
|
position: relative;
|
|
@@ -48,13 +48,6 @@
|
|
|
48
48
|
@include e(content) {
|
|
49
49
|
position: absolute;
|
|
50
50
|
white-space: nowrap;
|
|
51
|
-
|
|
52
|
-
@include m(play) {
|
|
53
|
-
animation: notice-bar-play linear both;
|
|
54
|
-
}
|
|
55
|
-
@include m(play-infinite) {
|
|
56
|
-
animation: notice-bar-play-infinite linear infinite both;
|
|
57
|
-
}
|
|
58
51
|
}
|
|
59
52
|
@include m(ellipse) {
|
|
60
53
|
.wd-notice-bar__content {
|
|
@@ -63,6 +56,7 @@
|
|
|
63
56
|
}
|
|
64
57
|
}
|
|
65
58
|
@include m(wrap) {
|
|
59
|
+
|
|
66
60
|
.wd-notice-bar__wrap {
|
|
67
61
|
height: auto;
|
|
68
62
|
}
|
|
@@ -71,16 +65,4 @@
|
|
|
71
65
|
white-space: normal;
|
|
72
66
|
}
|
|
73
67
|
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@keyframes notice-bar-play {
|
|
77
|
-
100% {
|
|
78
|
-
transform: translate3d(-100%, 0, 0);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@keyframes notice-bar-play-infinite {
|
|
83
|
-
100% {
|
|
84
|
-
transform: translate3d(-100%, 0, 0);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
68
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PropType } from 'vue'
|
|
1
|
+
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
|
|
2
2
|
import { baseProps, makeBooleanProp, makeNumberProp, makeStringProp } from '../common/props'
|
|
3
3
|
|
|
4
4
|
export type NoticeBarType = 'warning' | 'info' | 'danger' | ''
|
|
@@ -11,7 +11,7 @@ export const noticeBarProps = {
|
|
|
11
11
|
*/
|
|
12
12
|
text: {
|
|
13
13
|
type: [String, Array] as PropType<string | string[]>,
|
|
14
|
-
default: ''
|
|
14
|
+
default: ''
|
|
15
15
|
},
|
|
16
16
|
/**
|
|
17
17
|
* 设置通知栏类型,可选值为:'warning' | 'info' | 'danger'
|
|
@@ -52,5 +52,16 @@ export const noticeBarProps = {
|
|
|
52
52
|
/**
|
|
53
53
|
* 滚动方向
|
|
54
54
|
*/
|
|
55
|
-
direction: makeStringProp<NoticeBarScrollDirection>('horizontal')
|
|
55
|
+
direction: makeStringProp<NoticeBarScrollDirection>('horizontal')
|
|
56
56
|
}
|
|
57
|
+
|
|
58
|
+
export type NoticeBarProps = ExtractPropTypes<typeof noticeBarProps>
|
|
59
|
+
|
|
60
|
+
export type NoticeBarExpose = {
|
|
61
|
+
/**
|
|
62
|
+
* 重置NoticeBar动画
|
|
63
|
+
*/
|
|
64
|
+
reset: () => void
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type NoticeBarInstance = ComponentPublicInstance<NoticeBarProps, NoticeBarExpose>
|
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
<wd-icon v-if="prefix" custom-class="wd-notice-bar__prefix" :name="prefix"></wd-icon>
|
|
4
4
|
<slot v-else name="prefix"></slot>
|
|
5
5
|
<view class="wd-notice-bar__wrap">
|
|
6
|
-
<view
|
|
7
|
-
class="wd-notice-bar__content"
|
|
8
|
-
:style="animation"
|
|
9
|
-
@transitionend="animationEnd"
|
|
10
|
-
@click="handleClick"
|
|
11
|
-
>
|
|
6
|
+
<view class="wd-notice-bar__content" :style="animation" @transitionend="animationEnd" @click="handleClick">
|
|
12
7
|
<template v-if="isVertical">
|
|
13
8
|
<view v-for="item in textArray" :key="item">{{ item }}</view>
|
|
14
9
|
<view v-if="textArray.length > 1">{{ textArray[0] }}</view>
|
|
@@ -16,12 +11,7 @@
|
|
|
16
11
|
<slot v-else>{{ currentText }}</slot>
|
|
17
12
|
</view>
|
|
18
13
|
</view>
|
|
19
|
-
<wd-icon
|
|
20
|
-
v-if="closable"
|
|
21
|
-
custom-class="wd-notice-bar__suffix"
|
|
22
|
-
name="close-bold"
|
|
23
|
-
@click="handleClose"
|
|
24
|
-
></wd-icon>
|
|
14
|
+
<wd-icon v-if="closable" custom-class="wd-notice-bar__suffix" name="close-bold" @click="handleClose"></wd-icon>
|
|
25
15
|
<slot v-else name="suffix"></slot>
|
|
26
16
|
</view>
|
|
27
17
|
</template>
|
|
@@ -31,16 +21,16 @@ export default {
|
|
|
31
21
|
options: {
|
|
32
22
|
virtualHost: true,
|
|
33
23
|
addGlobalClass: true,
|
|
34
|
-
styleIsolation: 'shared'
|
|
35
|
-
}
|
|
24
|
+
styleIsolation: 'shared'
|
|
25
|
+
}
|
|
36
26
|
}
|
|
37
27
|
</script>
|
|
38
28
|
|
|
39
29
|
<script lang="ts" setup>
|
|
40
|
-
import
|
|
30
|
+
import wdIcon from '../wd-icon/wd-icon.vue'
|
|
31
|
+
import { ref, watch, nextTick, computed, getCurrentInstance, type CSSProperties, onMounted, onActivated, onDeactivated, reactive } from 'vue'
|
|
41
32
|
import { getRect, isArray, isDef, objToStyle } from '../common/util'
|
|
42
|
-
import { noticeBarProps } from './types'
|
|
43
|
-
|
|
33
|
+
import { type NoticeBarExpose, noticeBarProps } from './types'
|
|
44
34
|
const $wrap = '.wd-notice-bar__wrap'
|
|
45
35
|
const $content = '.wd-notice-bar__content'
|
|
46
36
|
|
|
@@ -49,14 +39,27 @@ const emit = defineEmits(['close', 'next', 'click'])
|
|
|
49
39
|
|
|
50
40
|
const wrapWidth = ref<number>(0)
|
|
51
41
|
const show = ref<boolean>(true)
|
|
52
|
-
const
|
|
53
|
-
const currentIndex = ref(0)
|
|
42
|
+
const currentIndex = ref<number>(0)
|
|
54
43
|
const textArray = computed(() => (Array.isArray(props.text) ? props.text : [props.text]))
|
|
55
44
|
const currentText = computed(() => textArray.value[currentIndex.value])
|
|
56
|
-
const verticalIndex = ref(0)
|
|
45
|
+
const verticalIndex = ref<number>(0)
|
|
46
|
+
const wrapRect = ref<UniApp.NodeInfo | null>(null) // 外层容器节点信息
|
|
47
|
+
const contentRect = ref<UniApp.NodeInfo | null>(null) // 内容节点信息
|
|
57
48
|
const isHorizontal = computed(() => props.direction === 'horizontal')
|
|
58
49
|
const isVertical = computed(() => props.direction === 'vertical')
|
|
59
50
|
|
|
51
|
+
const transitionState = reactive<CSSProperties>({
|
|
52
|
+
transitionProperty: 'unset',
|
|
53
|
+
transitionDelay: 'unset',
|
|
54
|
+
transitionDuration: 'unset',
|
|
55
|
+
transform: 'none',
|
|
56
|
+
transitionTimingFunction: 'linear'
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const animation = computed(() => {
|
|
60
|
+
return objToStyle(transitionState)
|
|
61
|
+
})
|
|
62
|
+
|
|
60
63
|
const rootStyle = computed(() => {
|
|
61
64
|
const style: CSSProperties = {}
|
|
62
65
|
if (isDef(props.color)) {
|
|
@@ -67,12 +70,12 @@ const rootStyle = computed(() => {
|
|
|
67
70
|
style.background = props.backgroundColor
|
|
68
71
|
}
|
|
69
72
|
|
|
70
|
-
return `${objToStyle(style)}
|
|
73
|
+
return `${objToStyle(style)}${props.customStyle}`
|
|
71
74
|
})
|
|
72
75
|
const noticeBarClass = computed(() => {
|
|
73
76
|
const { type, wrapable, scrollable } = props
|
|
74
77
|
|
|
75
|
-
|
|
78
|
+
let noticeBarClasses: string[] = []
|
|
76
79
|
type && noticeBarClasses.push(`is-${type}`)
|
|
77
80
|
|
|
78
81
|
if (isHorizontal.value) {
|
|
@@ -88,36 +91,66 @@ const noticeBarClass = computed(() => {
|
|
|
88
91
|
const { proxy } = getCurrentInstance() as any
|
|
89
92
|
|
|
90
93
|
watch(
|
|
91
|
-
|
|
94
|
+
() => props.text,
|
|
92
95
|
() => {
|
|
93
|
-
|
|
96
|
+
reset()
|
|
94
97
|
},
|
|
95
|
-
{ deep: true
|
|
98
|
+
{ deep: true }
|
|
96
99
|
)
|
|
97
100
|
|
|
101
|
+
onMounted(() => {
|
|
102
|
+
startTransition()
|
|
103
|
+
// #ifdef APP-PLUS
|
|
104
|
+
const pages = getCurrentPages()
|
|
105
|
+
const currentPage = pages[pages.length - 1]
|
|
106
|
+
const currentWebview = currentPage.$getAppWebview!()
|
|
107
|
+
currentWebview.addEventListener('hide', () => {
|
|
108
|
+
stopTransition()
|
|
109
|
+
})
|
|
110
|
+
currentWebview.addEventListener('show', () => {
|
|
111
|
+
startTransition()
|
|
112
|
+
})
|
|
113
|
+
// #endif
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
onActivated(() => {
|
|
117
|
+
startTransition()
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
onDeactivated(() => {
|
|
121
|
+
stopTransition()
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
function reset() {
|
|
125
|
+
stopTransition()
|
|
126
|
+
startTransition()
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function startTransition() {
|
|
130
|
+
nextTick(() => scroll())
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function stopTransition() {
|
|
134
|
+
transitionState.transitionProperty = 'unset'
|
|
135
|
+
transitionState.transitionDelay = 'unset'
|
|
136
|
+
transitionState.transitionDuration = 'unset'
|
|
137
|
+
transitionState.transform = 'none'
|
|
138
|
+
transitionState.transitionTimingFunction = 'linear'
|
|
139
|
+
currentIndex.value = 0
|
|
140
|
+
verticalIndex.value = 0
|
|
141
|
+
}
|
|
142
|
+
|
|
98
143
|
function handleClose() {
|
|
99
144
|
show.value = false
|
|
100
145
|
emit('close')
|
|
101
146
|
}
|
|
102
147
|
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
delay
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
delay: number
|
|
110
|
-
translate: number
|
|
111
|
-
}) {
|
|
112
|
-
const style: CSSProperties = {
|
|
113
|
-
transitionProperty: 'all',
|
|
114
|
-
transitionDelay: `${delay}s`,
|
|
115
|
-
transitionDuration: `${duration}s`,
|
|
116
|
-
transform: `${props.direction === 'vertical' ? 'translateY' : 'translateX'}(${translate}px)`,
|
|
117
|
-
transitionTimingFunction: 'linear',
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return objToStyle(style)
|
|
148
|
+
function setTransition({ duration, delay, translate }: { duration: number; delay: number; translate: number }) {
|
|
149
|
+
transitionState.transitionProperty = 'all'
|
|
150
|
+
transitionState.transitionDelay = `${delay}s`
|
|
151
|
+
transitionState.transitionDuration = `${duration}s`
|
|
152
|
+
transitionState.transform = `${props.direction === 'vertical' ? 'translateY' : 'translateX'}(${translate}px)`
|
|
153
|
+
transitionState.transitionTimingFunction = 'linear'
|
|
121
154
|
}
|
|
122
155
|
|
|
123
156
|
function queryRect() {
|
|
@@ -126,30 +159,31 @@ function queryRect() {
|
|
|
126
159
|
|
|
127
160
|
async function verticalAnimate(height: number) {
|
|
128
161
|
const translate = -(height / (textArray.value.length + 1)) * (currentIndex.value + 1)
|
|
129
|
-
|
|
162
|
+
setTransition({
|
|
130
163
|
duration: height / (textArray.value.length + 1) / props.speed,
|
|
131
164
|
delay: props.delay,
|
|
132
|
-
translate
|
|
165
|
+
translate
|
|
133
166
|
})
|
|
134
167
|
}
|
|
135
168
|
|
|
136
169
|
async function scroll() {
|
|
137
|
-
const [
|
|
138
|
-
if (!
|
|
139
|
-
|
|
140
|
-
|
|
170
|
+
const [wRect, cRect] = await queryRect()
|
|
171
|
+
if (!wRect.width || !cRect.width || !cRect.height) return
|
|
172
|
+
wrapRect.value = wRect
|
|
173
|
+
contentRect.value = cRect
|
|
174
|
+
wrapWidth.value = wRect.width
|
|
141
175
|
|
|
142
176
|
if (isHorizontal.value) {
|
|
143
177
|
if (props.scrollable) {
|
|
144
|
-
|
|
145
|
-
duration:
|
|
178
|
+
setTransition({
|
|
179
|
+
duration: cRect.width / props.speed,
|
|
146
180
|
delay: props.delay,
|
|
147
|
-
translate: -
|
|
181
|
+
translate: -cRect.width
|
|
148
182
|
})
|
|
149
183
|
}
|
|
150
184
|
} else {
|
|
151
185
|
if (textArray.value.length > 1) {
|
|
152
|
-
verticalAnimate(
|
|
186
|
+
verticalAnimate(cRect.height)
|
|
153
187
|
}
|
|
154
188
|
}
|
|
155
189
|
}
|
|
@@ -165,18 +199,18 @@ function next() {
|
|
|
165
199
|
|
|
166
200
|
function animationEnd() {
|
|
167
201
|
if (isHorizontal.value) {
|
|
168
|
-
|
|
202
|
+
setTransition({
|
|
169
203
|
duration: 0,
|
|
170
204
|
delay: 0,
|
|
171
|
-
translate: wrapWidth.value + 1
|
|
205
|
+
translate: wrapWidth.value + 1
|
|
172
206
|
})
|
|
173
207
|
} else {
|
|
174
208
|
if (++verticalIndex.value >= textArray.value.length) {
|
|
175
209
|
verticalIndex.value = 0
|
|
176
|
-
|
|
210
|
+
setTransition({
|
|
177
211
|
duration: 0,
|
|
178
212
|
delay: 0,
|
|
179
|
-
translate: 0
|
|
213
|
+
translate: 0
|
|
180
214
|
})
|
|
181
215
|
}
|
|
182
216
|
}
|
|
@@ -185,18 +219,25 @@ function animationEnd() {
|
|
|
185
219
|
next() // 更换下一条文本
|
|
186
220
|
|
|
187
221
|
nextTick(async () => {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
222
|
+
try {
|
|
223
|
+
const [wRect, cRect] = await queryRect()
|
|
224
|
+
wrapRect.value = wRect
|
|
225
|
+
contentRect.value = cRect
|
|
226
|
+
wrapWidth.value = wRect.width || 0
|
|
227
|
+
} catch (error) {
|
|
228
|
+
// console.error(error)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (!contentRect.value || !contentRect.value.width || !contentRect.value.height) return
|
|
191
232
|
|
|
192
233
|
if (isHorizontal.value) {
|
|
193
|
-
|
|
194
|
-
duration: (wrapWidth.value + contentRect.width) / props.speed,
|
|
234
|
+
setTransition({
|
|
235
|
+
duration: (wrapWidth.value + contentRect.value.width) / props.speed,
|
|
195
236
|
delay: props.delay,
|
|
196
|
-
translate: -contentRect.width
|
|
237
|
+
translate: -contentRect.value.width
|
|
197
238
|
})
|
|
198
239
|
} else {
|
|
199
|
-
verticalAnimate(contentRect.height)
|
|
240
|
+
verticalAnimate(contentRect.value.height)
|
|
200
241
|
}
|
|
201
242
|
})
|
|
202
243
|
|
|
@@ -208,14 +249,16 @@ function handleClick() {
|
|
|
208
249
|
const result = isArray(props.text)
|
|
209
250
|
? {
|
|
210
251
|
index: currentIndex.value,
|
|
211
|
-
text: props.text[currentIndex.value]
|
|
252
|
+
text: props.text[currentIndex.value]
|
|
212
253
|
}
|
|
213
254
|
: {
|
|
214
255
|
index: 0,
|
|
215
|
-
text: props.text
|
|
256
|
+
text: props.text
|
|
216
257
|
}
|
|
217
258
|
emit('click', result)
|
|
218
259
|
}
|
|
260
|
+
|
|
261
|
+
defineExpose<NoticeBarExpose>({ reset })
|
|
219
262
|
</script>
|
|
220
263
|
|
|
221
264
|
<style lang="scss" scoped>
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
@import '../common/abstracts/mixin';
|
|
3
3
|
|
|
4
4
|
@include b(notify) {
|
|
5
|
-
box-sizing: border-box;
|
|
6
5
|
display: flex;
|
|
7
6
|
align-items: center;
|
|
8
7
|
justify-content: center;
|
|
8
|
+
box-sizing: border-box;
|
|
9
9
|
padding: $-notify-padding;
|
|
10
10
|
font-size: $-notify-font-size;
|
|
11
11
|
line-height: $-notify-line-height;
|
|
12
12
|
color: $-notify-text-color;
|
|
13
|
-
|
|
14
|
-
word-wrap: break-word;
|
|
15
|
-
|
|
13
|
+
|
|
16
14
|
// allow newline character
|
|
17
15
|
white-space: pre-wrap;
|
|
16
|
+
text-align: center;
|
|
17
|
+
word-wrap: break-word;
|
|
18
18
|
|
|
19
19
|
@include m(primary) {
|
|
20
20
|
background: $-notify-primary-background;
|
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
@include m(warning) {
|
|
32
32
|
background: $-notify-warning-background;
|
|
33
33
|
}
|
|
34
|
-
}
|
|
34
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { provide, reactive } from 'vue'
|
|
1
|
+
import { inject, provide, reactive, ref } from 'vue'
|
|
2
2
|
import type { NotifyProps } from './types'
|
|
3
3
|
import { deepMerge, isString } from '../common/util'
|
|
4
4
|
|
|
5
5
|
let timer: ReturnType<typeof setTimeout>
|
|
6
6
|
let currentOptions = getDefaultOptions()
|
|
7
7
|
const notifyDefaultOptionKey = '__NOTIFY_OPTION__'
|
|
8
|
+
const None = Symbol('None')
|
|
8
9
|
export const setNotifyDefaultOptions = (options: NotifyProps) => {
|
|
9
10
|
currentOptions = deepMerge(currentOptions, options) as NotifyProps
|
|
10
11
|
}
|
|
@@ -12,30 +13,31 @@ export const resetNotifyDefaultOptions = () => {
|
|
|
12
13
|
currentOptions = getDefaultOptions()
|
|
13
14
|
}
|
|
14
15
|
export const useNotify = (selector: string = '') => {
|
|
15
|
-
const
|
|
16
|
-
const showNotify = (option: NotifyProps | string) => {
|
|
17
|
-
const options = deepMerge(
|
|
18
|
-
currentOptions,
|
|
19
|
-
isString(option) ? { message: option } : option,
|
|
20
|
-
) as NotifyProps
|
|
16
|
+
const notifyOptionKey = getNotifyOptionKey(selector)
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const notifyOption = inject(notifyOptionKey, ref<NotifyProps | typeof None>(None))
|
|
19
|
+
if (notifyOption.value === None) {
|
|
20
|
+
notifyOption.value = currentOptions
|
|
21
|
+
provide(notifyOptionKey, notifyOption)
|
|
22
|
+
}
|
|
23
|
+
const showNotify = (option: NotifyProps | string) => {
|
|
24
|
+
const options = deepMerge(currentOptions, isString(option) ? { message: option } : option) as NotifyProps
|
|
25
|
+
notifyOption.value = deepMerge(options, { visible: true })
|
|
26
|
+
if (notifyOption.value.duration && notifyOption.value.duration > 0) {
|
|
24
27
|
timer && clearTimeout(timer)
|
|
25
28
|
timer = setTimeout(() => closeNotify(), options.duration)
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
const closeNotify = () => {
|
|
29
32
|
timer && clearTimeout(timer)
|
|
30
|
-
notifyOption.
|
|
33
|
+
if (notifyOption.value !== None) {
|
|
34
|
+
notifyOption.value.visible = false
|
|
35
|
+
}
|
|
31
36
|
}
|
|
32
37
|
|
|
33
|
-
// provide
|
|
34
|
-
provide(getNotifyOptionKey(selector), notifyOption)
|
|
35
|
-
|
|
36
38
|
return {
|
|
37
39
|
showNotify,
|
|
38
|
-
closeNotify
|
|
40
|
+
closeNotify
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
export const getNotifyOptionKey = (selector: string) => {
|
|
@@ -54,6 +56,6 @@ function getDefaultOptions(): NotifyProps {
|
|
|
54
56
|
background: undefined,
|
|
55
57
|
onClick: undefined,
|
|
56
58
|
onClosed: undefined,
|
|
57
|
-
onOpened: undefined
|
|
59
|
+
onOpened: undefined
|
|
58
60
|
}
|
|
59
61
|
}
|