@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,210 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
:id="buttonId"
|
|
4
|
+
:hover-class="`${disabled || loading ? '' : 'wd-button--active'}`"
|
|
5
|
+
:style="customStyle"
|
|
6
|
+
:class="[
|
|
7
|
+
'wd-button',
|
|
8
|
+
'is-' + type,
|
|
9
|
+
'is-' + size,
|
|
10
|
+
isIcon ? 'is-icon' : '',
|
|
11
|
+
round ? 'is-round' : '',
|
|
12
|
+
hairline ? 'is-hairline' : '',
|
|
13
|
+
variant !== 'base' ? 'is-' + variant : '',
|
|
14
|
+
disabled ? 'is-disabled' : '',
|
|
15
|
+
block ? 'is-block' : '',
|
|
16
|
+
loading ? 'is-loading' : '',
|
|
17
|
+
customClass
|
|
18
|
+
]"
|
|
19
|
+
:hover-start-time="hoverStartTime"
|
|
20
|
+
:hover-stay-time="hoverStayTime"
|
|
21
|
+
:open-type="openTypeValue"
|
|
22
|
+
:send-message-title="sendMessageTitle"
|
|
23
|
+
:send-message-path="sendMessagePath"
|
|
24
|
+
:send-message-img="sendMessageImg"
|
|
25
|
+
:app-parameter="appParameter"
|
|
26
|
+
:show-message-card="showMessageCard"
|
|
27
|
+
:session-from="sessionFrom"
|
|
28
|
+
:lang="lang"
|
|
29
|
+
:hover-stop-propagation="hoverStopPropagation"
|
|
30
|
+
:scope="scope"
|
|
31
|
+
@click="handleClick"
|
|
32
|
+
@getAuthorize="handleGetAuthorize"
|
|
33
|
+
@getuserinfo="handleGetUserInfo"
|
|
34
|
+
@contact="handleContact"
|
|
35
|
+
@getphonenumber="handleGetPhoneNumber"
|
|
36
|
+
@getrealtimephonenumber="handleGetRealtimePhoneNumber"
|
|
37
|
+
@error="handleError"
|
|
38
|
+
@launchapp="handleLaunchApp"
|
|
39
|
+
@opensetting="handleOpenSetting"
|
|
40
|
+
@chooseavatar="handleChooseAvatar"
|
|
41
|
+
@agreeprivacyauthorization="handleAgreePrivacyAuthorization"
|
|
42
|
+
>
|
|
43
|
+
<view class="wd-button__content">
|
|
44
|
+
<wd-loading v-if="loading" v-bind="customLoadingProps"></wd-loading>
|
|
45
|
+
<wd-icon v-else-if="icon" custom-class="wd-button__icon" :name="icon" :classPrefix="classPrefix"></wd-icon>
|
|
46
|
+
<view class="wd-button__text" v-if="$slots.default || text">
|
|
47
|
+
<slot>{{ text }}</slot>
|
|
48
|
+
</view>
|
|
49
|
+
</view>
|
|
50
|
+
</button>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script lang="ts">
|
|
54
|
+
export default {
|
|
55
|
+
name: 'wd-button',
|
|
56
|
+
options: {
|
|
57
|
+
addGlobalClass: true,
|
|
58
|
+
// #ifndef MP-TOUTIAO
|
|
59
|
+
virtualHost: true,
|
|
60
|
+
// #endif
|
|
61
|
+
styleIsolation: 'shared'
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<script lang="ts" setup>
|
|
67
|
+
import wdIcon from '../wd-icon/wd-icon.vue'
|
|
68
|
+
import { computed, useSlots } from 'vue'
|
|
69
|
+
import { buttonProps } from './types'
|
|
70
|
+
import { isDef, omitBy, isUndefined } from '../../common/util'
|
|
71
|
+
import { type LoadingProps } from '../wd-loading/types'
|
|
72
|
+
|
|
73
|
+
const slots = useSlots()
|
|
74
|
+
|
|
75
|
+
const props = defineProps(buttonProps)
|
|
76
|
+
const emit = defineEmits<{
|
|
77
|
+
(e: 'click', event: any): void
|
|
78
|
+
(e: 'getuserinfo', event: any): void
|
|
79
|
+
(e: 'contact', event: any): void
|
|
80
|
+
(e: 'getphonenumber', event: any): void
|
|
81
|
+
(e: 'getrealtimephonenumber', event: any): void
|
|
82
|
+
(e: 'error', event: any): void
|
|
83
|
+
(e: 'launchapp', event: any): void
|
|
84
|
+
(e: 'opensetting', event: any): void
|
|
85
|
+
(e: 'chooseavatar', event: any): void
|
|
86
|
+
(e: 'agreeprivacyauthorization', event: any): void
|
|
87
|
+
}>()
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 加载配置项
|
|
91
|
+
*/
|
|
92
|
+
const customLoadingProps = computed(() => {
|
|
93
|
+
const loadingProps: Partial<LoadingProps> = isDef(props.loadingProps) ? omitBy(props.loadingProps, isUndefined) : {}
|
|
94
|
+
loadingProps.customSpinnerClass = `${isDef(loadingProps.customSpinnerClass) ? loadingProps.customSpinnerClass : ''} wd-button__loading`
|
|
95
|
+
loadingProps.inheritColor = isDef(loadingProps.inheritColor) ? loadingProps.inheritColor : true
|
|
96
|
+
return loadingProps
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 开放能力类型
|
|
101
|
+
*/
|
|
102
|
+
const openTypeValue = computed(() => {
|
|
103
|
+
return props.disabled || props.loading ? undefined : props.openType
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* 是否仅展示图标
|
|
108
|
+
*/
|
|
109
|
+
const isIcon = computed(() => {
|
|
110
|
+
return !slots.default && !props.text && props.icon
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 处理点击事件
|
|
115
|
+
* @param event
|
|
116
|
+
*/
|
|
117
|
+
function handleClick(event: any) {
|
|
118
|
+
if (!props.disabled && !props.loading) {
|
|
119
|
+
emit('click', event)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 支付宝小程序授权
|
|
125
|
+
* @param event
|
|
126
|
+
*/
|
|
127
|
+
function handleGetAuthorize(event: any) {
|
|
128
|
+
if (props.scope === 'phoneNumber') {
|
|
129
|
+
handleGetPhoneNumber(event)
|
|
130
|
+
} else if (props.scope === 'userInfo') {
|
|
131
|
+
handleGetUserInfo(event)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 获取用户信息回调
|
|
137
|
+
* @param event
|
|
138
|
+
*/
|
|
139
|
+
function handleGetUserInfo(event: any) {
|
|
140
|
+
emit('getuserinfo', event)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 客服会话回调
|
|
145
|
+
* @param event
|
|
146
|
+
*/
|
|
147
|
+
function handleContact(event: any) {
|
|
148
|
+
emit('contact', event)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 获取手机号回调
|
|
153
|
+
* @param event
|
|
154
|
+
*/
|
|
155
|
+
function handleGetPhoneNumber(event: any) {
|
|
156
|
+
emit('getphonenumber', event)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 获取实时手机号回调
|
|
161
|
+
* @param event
|
|
162
|
+
*/
|
|
163
|
+
function handleGetRealtimePhoneNumber(event: any) {
|
|
164
|
+
emit('getrealtimephonenumber', event)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* 当使用开放能力发生错误时回调
|
|
169
|
+
* @param event
|
|
170
|
+
*/
|
|
171
|
+
function handleError(event: any) {
|
|
172
|
+
emit('error', event)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* 打开 APP 成功的回调
|
|
177
|
+
* @param event
|
|
178
|
+
*/
|
|
179
|
+
function handleLaunchApp(event: any) {
|
|
180
|
+
emit('launchapp', event)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* 在打开授权设置页后回调
|
|
185
|
+
* @param event
|
|
186
|
+
*/
|
|
187
|
+
function handleOpenSetting(event: any) {
|
|
188
|
+
emit('opensetting', event)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* 获取头像回调
|
|
193
|
+
* @param event
|
|
194
|
+
*/
|
|
195
|
+
function handleChooseAvatar(event: any) {
|
|
196
|
+
emit('chooseavatar', event)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* 隐私协议授权回调
|
|
201
|
+
* @param event
|
|
202
|
+
*/
|
|
203
|
+
function handleAgreePrivacyAuthorization(event: any) {
|
|
204
|
+
emit('agreeprivacyauthorization', event)
|
|
205
|
+
}
|
|
206
|
+
</script>
|
|
207
|
+
|
|
208
|
+
<style lang="scss">
|
|
209
|
+
@use './index.scss';
|
|
210
|
+
</style>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss'as *;
|
|
2
|
+
@use '../../styles/variable.scss'as *;
|
|
3
|
+
|
|
4
|
+
$calendar-bg: var(--wot-calendar-bg, $filled-oppo) !default; // 日历弹层背景色
|
|
5
|
+
$calendar-tabs-width: var(--wot-calendar-tabs-width, 100%) !default; // Tabs 宽度
|
|
6
|
+
$calendar-tabs-padding: var(--wot-calendar-tabs-padding, $padding-zero $padding-extra-loose) !default; // Tabs 内边距
|
|
7
|
+
$calendar-shortcuts-padding: var(--wot-calendar-shortcuts-padding, $padding-extra-tight $padding-zero) !default; // 快捷选项内边距
|
|
8
|
+
$calendar-tag-spacing-right: var(--wot-calendar-tag-spacing-right, $spacing-extra-loose) !default; // 标签右间距
|
|
9
|
+
$calendar-range-padding: var(--wot-calendar-range-padding, $padding-zero $padding-loose $padding-extra-loose) !default; // 范围标签内边距
|
|
10
|
+
$calendar-range-font-size: var(--wot-calendar-range-font-size, $typography-body-size-main) !default; // 范围标签字号
|
|
11
|
+
$calendar-range-item-font-size: var(--wot-calendar-range-item-font-size, $typography-body-size-extra-large) !default; // 范围标签项字号
|
|
12
|
+
$calendar-range-item-font-weight: var(--wot-calendar-range-item-font-weight, $font-weight-medium) !default; // 范围标签项字重
|
|
13
|
+
$calendar-range-item-line-height: var(--wot-calendar-range-item-line-height, $typography-body-line--height-size-extra-large) !default; // 范围标签项行高
|
|
14
|
+
$calendar-range-item-padding: var(--wot-calendar-range-item-padding, $spacing-loose $spacing-zero) !default; // 范围标签项内边距
|
|
15
|
+
$calendar-range-item-color: var(--wot-calendar-range-item-color, $primary-6) !default; // 范围标签项颜色
|
|
16
|
+
$calendar-range-item-color-placeholder: var(--wot-calendar-range-item-color-placeholder, $text-placeholder) !default; // 占位符颜色
|
|
17
|
+
$calendar-range-item-line-color: var(--wot-calendar-range-item-line-color, $primary-6) !default; // 范围标签项下划线颜色
|
|
18
|
+
$calendar-range-item-line-color-placeholder: var(--wot-calendar-range-item-line-color-placeholder, $border-main) !default; // 范围标签项下划线占位符颜色
|
|
19
|
+
$calendar-range-separator-margin: var(--wot-calendar-range-separator-margin, $spacing-zero $spacing-tight) !default; // 分隔符水平间距
|
|
20
|
+
$calendar-range-separator-color: var(--wot-calendar-range-separator-color, $text-auxiliary) !default; // 分隔符颜色
|
|
21
|
+
$calendar-range-separator-width: var(--wot-calendar-range-separator-width, $n-8) !default; // 分隔符宽度
|
|
22
|
+
$calendar-range-separator-height: var(--wot-calendar-range-separator-height, $stroke-main) !default; // 分隔符高度
|
|
23
|
+
$calendar-confirm-padding: var(--wot-calendar-confirm-padding, $padding-tight $padding-loose) !default; // 确认区域内边距
|
|
24
|
+
$calendar-confirm-border-color: var(--wot-calendar-confirm-border-color, $border-light) !default; // 确认区域上边框颜色
|
|
25
|
+
|
|
26
|
+
@include b(calendar) {
|
|
27
|
+
|
|
28
|
+
@include e(header) {
|
|
29
|
+
position: relative;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@include edeep(popup) {
|
|
34
|
+
background: $calendar-bg;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@include e(tabs) {
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
width: $calendar-tabs-width;
|
|
40
|
+
padding: $calendar-tabs-padding;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@include e(shortcuts) {
|
|
44
|
+
padding: $calendar-shortcuts-padding;
|
|
45
|
+
text-align: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@include edeep(tag) {
|
|
49
|
+
margin-right: $calendar-tag-spacing-right;
|
|
50
|
+
@include when(last-tag) {
|
|
51
|
+
margin-right: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
@include e(range) {
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
align-items: center;
|
|
58
|
+
font-size: $calendar-range-font-size;
|
|
59
|
+
padding: $calendar-range-padding;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@include e(range-item) {
|
|
63
|
+
flex: 1;
|
|
64
|
+
color: $calendar-range-item-color;
|
|
65
|
+
font-size: $calendar-range-item-font-size;
|
|
66
|
+
font-weight: $calendar-range-item-font-weight;
|
|
67
|
+
line-height: $calendar-range-item-line-height;
|
|
68
|
+
padding: $calendar-range-item-padding;
|
|
69
|
+
text-align: center;
|
|
70
|
+
@include pixelBorder(bottom, 0, $calendar-range-item-line-color);
|
|
71
|
+
|
|
72
|
+
@include when(placeholder) {
|
|
73
|
+
color: $calendar-range-item-color-placeholder;
|
|
74
|
+
@include pixelBorder(bottom, 0, $calendar-range-item-line-color-placeholder);
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@include e(range-separator) {
|
|
80
|
+
width: $calendar-range-separator-width;
|
|
81
|
+
height: $calendar-range-separator-height;
|
|
82
|
+
position: relative;
|
|
83
|
+
margin: $calendar-range-separator-margin;
|
|
84
|
+
background: $calendar-range-separator-color;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@include e(confirm) {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
padding: $calendar-confirm-padding;
|
|
91
|
+
@include pixelBorder(top, 0, $calendar-confirm-border-color);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@include e(confirm-btn-wrapper) {
|
|
95
|
+
flex-grow: 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
|
|
2
|
+
import { baseProps, makeArrayProp, makeBooleanProp, makeNumberProp, makeRequiredProp, makeStringProp } from '../../common/props'
|
|
3
|
+
import type { CalendarFormatter, CalendarTimeFilter, CalendarType } from '../wd-calendar-view/types'
|
|
4
|
+
|
|
5
|
+
const now = new Date()
|
|
6
|
+
const defaultMinDate = new Date(now.getFullYear(), now.getMonth() - 6, now.getDate()).getTime()
|
|
7
|
+
const defaultMaxDate = new Date(now.getFullYear(), now.getMonth() + 6, now.getDate(), 23, 59, 59).getTime()
|
|
8
|
+
|
|
9
|
+
export const calendarProps = {
|
|
10
|
+
...baseProps,
|
|
11
|
+
/**
|
|
12
|
+
* 选中值,为 13 位时间戳或时间戳数组
|
|
13
|
+
* 类型: number | number[] | null
|
|
14
|
+
* 默认值: null
|
|
15
|
+
*/
|
|
16
|
+
modelValue: makeRequiredProp([Number, Array, null] as PropType<number | number[] | null>),
|
|
17
|
+
/**
|
|
18
|
+
* 日期类型
|
|
19
|
+
* 类型: CalendarType
|
|
20
|
+
* 可选值: 'date' | 'dates' | 'datetime' | 'week' | 'month' | 'daterange' | 'datetimerange' | 'weekrange' | 'monthrange'
|
|
21
|
+
* 默认值: 'date'
|
|
22
|
+
*/
|
|
23
|
+
type: makeStringProp<CalendarType>('date'),
|
|
24
|
+
/**
|
|
25
|
+
* 最小日期,为 13 位时间戳
|
|
26
|
+
* 类型: number
|
|
27
|
+
* 默认值: 当前日期 - 6个月
|
|
28
|
+
*/
|
|
29
|
+
minDate: makeNumberProp(defaultMinDate),
|
|
30
|
+
/**
|
|
31
|
+
* 最大日期,为 13 位时间戳
|
|
32
|
+
* 类型: number
|
|
33
|
+
* 默认值: 当前日期 + 6个月
|
|
34
|
+
*/
|
|
35
|
+
maxDate: makeNumberProp(defaultMaxDate),
|
|
36
|
+
/**
|
|
37
|
+
* 周起始天
|
|
38
|
+
* 类型: number
|
|
39
|
+
* 默认值: 0
|
|
40
|
+
*/
|
|
41
|
+
firstDayOfWeek: makeNumberProp(0),
|
|
42
|
+
/**
|
|
43
|
+
* 日期格式化函数
|
|
44
|
+
* 类型: CalendarFormatter
|
|
45
|
+
*/
|
|
46
|
+
formatter: Function as PropType<CalendarFormatter>,
|
|
47
|
+
/**
|
|
48
|
+
* type 为范围选择时有效,最大日期范围
|
|
49
|
+
* 类型: number
|
|
50
|
+
*/
|
|
51
|
+
maxRange: Number,
|
|
52
|
+
/**
|
|
53
|
+
* type 为范围选择时有效,选择超出最大日期范围时的错误提示文案
|
|
54
|
+
* 类型: string
|
|
55
|
+
*/
|
|
56
|
+
rangePrompt: String,
|
|
57
|
+
/**
|
|
58
|
+
* type 为范围选择时有效,是否允许选择同一天
|
|
59
|
+
* 类型: boolean
|
|
60
|
+
* 默认值: false
|
|
61
|
+
*/
|
|
62
|
+
allowSameDay: makeBooleanProp(false),
|
|
63
|
+
/**
|
|
64
|
+
* 选中日期所使用的当日内具体时刻
|
|
65
|
+
* 类型: string | string[]
|
|
66
|
+
*/
|
|
67
|
+
defaultTime: {
|
|
68
|
+
type: [String, Array] as PropType<string | string[]>
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* type 为 'datetime' 或 'datetimerange' 时有效,用于过滤时间选择器的数据
|
|
72
|
+
* 类型: CalendarTimeFilter
|
|
73
|
+
*/
|
|
74
|
+
timeFilter: Function as PropType<CalendarTimeFilter>,
|
|
75
|
+
/**
|
|
76
|
+
* type 为 'datetime' 或 'datetimerange' 时有效,是否不展示秒修改
|
|
77
|
+
* 类型: boolean
|
|
78
|
+
* 默认值: false
|
|
79
|
+
*/
|
|
80
|
+
hideSecond: makeBooleanProp(false),
|
|
81
|
+
/**
|
|
82
|
+
* 弹出层标题
|
|
83
|
+
* 类型: string
|
|
84
|
+
*/
|
|
85
|
+
title: String,
|
|
86
|
+
/**
|
|
87
|
+
* 点击遮罩是否关闭
|
|
88
|
+
* 类型: boolean
|
|
89
|
+
* 默认值: true
|
|
90
|
+
*/
|
|
91
|
+
closeOnClickModal: makeBooleanProp(true),
|
|
92
|
+
/**
|
|
93
|
+
* 弹框层级
|
|
94
|
+
* 类型: number
|
|
95
|
+
* 默认值: 15
|
|
96
|
+
*/
|
|
97
|
+
zIndex: makeNumberProp(15),
|
|
98
|
+
/**
|
|
99
|
+
* 是否显示确定按钮
|
|
100
|
+
* 类型: boolean
|
|
101
|
+
* 默认值: true
|
|
102
|
+
*/
|
|
103
|
+
showConfirm: makeBooleanProp(true),
|
|
104
|
+
/**
|
|
105
|
+
* 确定按钮文字
|
|
106
|
+
* 类型: string
|
|
107
|
+
*/
|
|
108
|
+
confirmText: String,
|
|
109
|
+
/**
|
|
110
|
+
* 自定义范围选择类型的面板内部回显,返回一个字符串
|
|
111
|
+
* 类型: CalendarInnerDisplayFormat
|
|
112
|
+
*/
|
|
113
|
+
innerDisplayFormat: Function as PropType<CalendarInnerDisplayFormat>,
|
|
114
|
+
/**
|
|
115
|
+
* 是否超出隐藏
|
|
116
|
+
* 类型: boolean
|
|
117
|
+
* 默认值: false
|
|
118
|
+
*/
|
|
119
|
+
ellipsis: makeBooleanProp(false),
|
|
120
|
+
/**
|
|
121
|
+
* 是否显示类型切换功能
|
|
122
|
+
* 类型: boolean
|
|
123
|
+
* 默认值: false
|
|
124
|
+
*/
|
|
125
|
+
showTypeSwitch: makeBooleanProp(false),
|
|
126
|
+
/**
|
|
127
|
+
* 快捷选项,为对象数组,其中对象的 text 必传
|
|
128
|
+
* 类型: Record<string, any>[]
|
|
129
|
+
*/
|
|
130
|
+
shortcuts: makeArrayProp<Record<string, any>>(),
|
|
131
|
+
/**
|
|
132
|
+
* 快捷操作点击回调
|
|
133
|
+
* 类型: CalendarOnShortcutsClick
|
|
134
|
+
*/
|
|
135
|
+
onShortcutsClick: Function as PropType<CalendarOnShortcutsClick>,
|
|
136
|
+
/**
|
|
137
|
+
* 弹出面板是否设置底部安全距离(iphone X 类型的机型)
|
|
138
|
+
* 类型: boolean
|
|
139
|
+
* 默认值: true
|
|
140
|
+
*/
|
|
141
|
+
safeAreaInsetBottom: makeBooleanProp(true),
|
|
142
|
+
/**
|
|
143
|
+
* 确定前校验函数,接收目标 value,返回 false 可阻止确认,支持返回 Promise<boolean>
|
|
144
|
+
* 类型: CalendarBeforeConfirm
|
|
145
|
+
*/
|
|
146
|
+
beforeConfirm: Function as PropType<CalendarBeforeConfirm>,
|
|
147
|
+
/**
|
|
148
|
+
* 自定义视图类名
|
|
149
|
+
* 类型: string
|
|
150
|
+
*/
|
|
151
|
+
customViewClass: makeStringProp(''),
|
|
152
|
+
/**
|
|
153
|
+
* 是否在手指松开时立即触发picker-view的 change 事件。若不开启则会在滚动动画结束后触发 change 事件,1.2.25版本起提供,仅微信小程序和支付宝小程序支持。
|
|
154
|
+
* 类型: boolean
|
|
155
|
+
* 默认值: false
|
|
156
|
+
*/
|
|
157
|
+
immediateChange: makeBooleanProp(false),
|
|
158
|
+
/**
|
|
159
|
+
* 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
|
|
160
|
+
* 类型: boolean
|
|
161
|
+
* 默认值: false
|
|
162
|
+
*/
|
|
163
|
+
rootPortal: makeBooleanProp(false),
|
|
164
|
+
/**
|
|
165
|
+
* 控制弹窗显示
|
|
166
|
+
* 类型: boolean
|
|
167
|
+
* 默认值: false
|
|
168
|
+
*/
|
|
169
|
+
visible: makeBooleanProp(false),
|
|
170
|
+
/**
|
|
171
|
+
* 可滚动面板的高度
|
|
172
|
+
* 类型: number
|
|
173
|
+
* 默认值: 316
|
|
174
|
+
*/
|
|
175
|
+
panelHeight: makeNumberProp(316),
|
|
176
|
+
/**
|
|
177
|
+
* 是否展示面板标题,自动计算当前滚动的日期月份
|
|
178
|
+
* 类型: boolean
|
|
179
|
+
* 默认值: true
|
|
180
|
+
*/
|
|
181
|
+
showPanelTitle: makeBooleanProp(true),
|
|
182
|
+
/**
|
|
183
|
+
* 切换模式
|
|
184
|
+
* 类型: 'none' | 'month' | 'year-month'
|
|
185
|
+
* 可选值: none 平铺展示所有月份/年份,不展示切换按钮 | month 支持按月切换,展示上个月/下个月按钮 | year-month 支持按年切换,也支持按月切换,展示上一年/下一年,上个月/下个月按钮
|
|
186
|
+
* 默认值: 'none'
|
|
187
|
+
*/
|
|
188
|
+
switchMode: makeStringProp<'none' | 'month' | 'year-month'>('none'),
|
|
189
|
+
/**
|
|
190
|
+
* 弹框动画持续时间
|
|
191
|
+
* 类型: number
|
|
192
|
+
* 默认值: 200
|
|
193
|
+
*/
|
|
194
|
+
duration: makeNumberProp(200)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type CalendarInnerDisplayFormat = (value: number, rangeType: 'start' | 'end', type: CalendarType) => string
|
|
198
|
+
|
|
199
|
+
export type CalendarBeforeConfirm = (value: number | number[] | null) => boolean | Promise<boolean>
|
|
200
|
+
|
|
201
|
+
export type CalendarOnShortcutsClickOption = {
|
|
202
|
+
item: Record<string, any>
|
|
203
|
+
index: number
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export type CalendarOnShortcutsClick = (option: CalendarOnShortcutsClickOption) => number | number[]
|
|
207
|
+
|
|
208
|
+
export type CalendarExpose = {
|
|
209
|
+
/**
|
|
210
|
+
* 关闭时间选择器弹窗
|
|
211
|
+
*/
|
|
212
|
+
close: () => void
|
|
213
|
+
/**
|
|
214
|
+
* 打开时间选择器弹窗
|
|
215
|
+
*/
|
|
216
|
+
open: () => void
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export type CalendarProps = ExtractPropTypes<typeof calendarProps>
|
|
220
|
+
|
|
221
|
+
export type CalendarInstance = ComponentPublicInstance<CalendarProps, CalendarExpose>
|