@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,172 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wd-popup
|
|
3
|
+
v-model="modelValue"
|
|
4
|
+
transition="zoom-in"
|
|
5
|
+
position="center"
|
|
6
|
+
:close-on-click-modal="closeOnClickModal"
|
|
7
|
+
:hide-when-close="hideWhenClose"
|
|
8
|
+
:z-index="zIndex"
|
|
9
|
+
:root-portal="rootPortal"
|
|
10
|
+
@before-enter="beforeenter"
|
|
11
|
+
@enter="enter"
|
|
12
|
+
@after-enter="afterenter"
|
|
13
|
+
@before-leave="beforeleave"
|
|
14
|
+
@leave="leave"
|
|
15
|
+
@after-leave="afterleave"
|
|
16
|
+
@close="close"
|
|
17
|
+
@click-modal="clickModal"
|
|
18
|
+
:custom-class="`wd-curtain ${customClass}`"
|
|
19
|
+
:custom-style="customStyle"
|
|
20
|
+
>
|
|
21
|
+
<view class="wd-curtain__content">
|
|
22
|
+
<image
|
|
23
|
+
:src="src"
|
|
24
|
+
class="wd-curtain__content-img"
|
|
25
|
+
:style="imgStyle"
|
|
26
|
+
:show-menu-by-longpress="showMenuByLongpress"
|
|
27
|
+
@click="clickImage"
|
|
28
|
+
@error="imgErr"
|
|
29
|
+
@load="imgLoad"
|
|
30
|
+
></image>
|
|
31
|
+
<slot name="close">
|
|
32
|
+
<wd-icon
|
|
33
|
+
name="close-circle"
|
|
34
|
+
:custom-class="`wd-curtain__content-close ${closePosition} ${customCloseClass}`"
|
|
35
|
+
:custom-style="customCloseStyle"
|
|
36
|
+
@click="close"
|
|
37
|
+
/>
|
|
38
|
+
</slot>
|
|
39
|
+
</view>
|
|
40
|
+
</wd-popup>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script lang="ts">
|
|
44
|
+
export default {
|
|
45
|
+
name: 'wd-curtain',
|
|
46
|
+
options: {
|
|
47
|
+
// #ifndef MP-TOUTIAO
|
|
48
|
+
virtualHost: true,
|
|
49
|
+
// #endif
|
|
50
|
+
addGlobalClass: true,
|
|
51
|
+
styleIsolation: 'shared'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<script lang="ts" setup>
|
|
57
|
+
import wdIcon from '../wd-icon/wd-icon.vue'
|
|
58
|
+
import wdPopup from '../wd-popup/wd-popup.vue'
|
|
59
|
+
import { computed, ref, watch } from 'vue'
|
|
60
|
+
import { curtainProps } from './types'
|
|
61
|
+
|
|
62
|
+
const props = defineProps(curtainProps)
|
|
63
|
+
const emit = defineEmits([
|
|
64
|
+
'beforeenter',
|
|
65
|
+
'enter',
|
|
66
|
+
'afterenter',
|
|
67
|
+
'beforeleave',
|
|
68
|
+
'leave',
|
|
69
|
+
'afterleave',
|
|
70
|
+
'close',
|
|
71
|
+
'closed',
|
|
72
|
+
'click-modal',
|
|
73
|
+
'load',
|
|
74
|
+
'error',
|
|
75
|
+
'click',
|
|
76
|
+
'update:modelValue'
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
const modelValue = ref(props.modelValue || props.value)
|
|
80
|
+
|
|
81
|
+
watch(
|
|
82
|
+
() => props.modelValue,
|
|
83
|
+
(newVal) => {
|
|
84
|
+
modelValue.value = newVal
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
watch(
|
|
89
|
+
() => props.value,
|
|
90
|
+
(newVal) => {
|
|
91
|
+
modelValue.value = newVal
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
watch(modelValue, (newVal) => {
|
|
96
|
+
emit('update:modelValue', newVal)
|
|
97
|
+
if (!newVal) {
|
|
98
|
+
emit('close')
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
const imgSucc = ref<boolean>(true)
|
|
103
|
+
const imgScale = ref<number>(1)
|
|
104
|
+
|
|
105
|
+
const imgStyle = computed(() => {
|
|
106
|
+
let style = ''
|
|
107
|
+
if (props.width) {
|
|
108
|
+
style += `width: ${props.width}px ;`
|
|
109
|
+
style += `height: ${props.width / imgScale.value}px`
|
|
110
|
+
}
|
|
111
|
+
return style
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
function beforeenter() {
|
|
115
|
+
emit('beforeenter')
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function enter() {
|
|
119
|
+
emit('enter')
|
|
120
|
+
}
|
|
121
|
+
function afterenter() {
|
|
122
|
+
emit('afterenter')
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function beforeleave() {
|
|
126
|
+
emit('beforeleave')
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function leave() {
|
|
130
|
+
emit('leave')
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function afterleave() {
|
|
134
|
+
emit('afterleave')
|
|
135
|
+
emit('closed')
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function close() {
|
|
139
|
+
modelValue.value = false
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function clickModal() {
|
|
143
|
+
emit('click-modal')
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function imgLoad(event: any) {
|
|
147
|
+
const { height, width } = event.detail
|
|
148
|
+
imgScale.value = width / height
|
|
149
|
+
imgSucc.value = true
|
|
150
|
+
emit('load')
|
|
151
|
+
}
|
|
152
|
+
function imgErr() {
|
|
153
|
+
imgSucc.value = false
|
|
154
|
+
emit('error')
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function clickImage() {
|
|
158
|
+
if (props.to) {
|
|
159
|
+
uni.navigateTo({
|
|
160
|
+
url: props.to
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
emit('click')
|
|
164
|
+
if (props.closeOnClick) {
|
|
165
|
+
close()
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</script>
|
|
169
|
+
|
|
170
|
+
<style lang="scss">
|
|
171
|
+
@use './index.scss';
|
|
172
|
+
</style>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss' as *;
|
|
2
|
+
@use '../../styles/variable.scss' as *;
|
|
3
|
+
|
|
4
|
+
// 日期时间选择器弹窗圆角
|
|
5
|
+
$datetime-picker-popup-radius: var(--wot-datetime-picker-popup-radius, $radius-large $radius-large $radius-zero $radius-zero) !default;
|
|
6
|
+
// 标题文字颜色
|
|
7
|
+
$datetime-picker-title-color: var(--wot-datetime-picker-title-color, $text-main) !default;
|
|
8
|
+
// 标题区域高度
|
|
9
|
+
$datetime-picker-title-height: var(--wot-datetime-picker-title-height, $n-56) !default;
|
|
10
|
+
// 标题文字字号
|
|
11
|
+
$datetime-picker-title-font-size: var(--wot-datetime-picker-title-font-size, $typography-title-size-main) !default;
|
|
12
|
+
// 标题文字行高
|
|
13
|
+
$datetime-picker-title-line-height: var(--wot-datetime-picker-title-line-height, $typography-title-line--height-size-main) !default;
|
|
14
|
+
// 标题文字字重
|
|
15
|
+
$datetime-picker-title-font-weight: var(--wot-datetime-picker-title-font-weight, $font-weight-medium) !default;
|
|
16
|
+
// 标题区域内边距
|
|
17
|
+
$datetime-picker-title-padding: var(--wot-datetime-picker-title-padding, $padding-zero $padding-loose) !default;
|
|
18
|
+
// 操作按钮字号
|
|
19
|
+
$datetime-picker-action-font-size: var(--wot-datetime-picker-action-font-size, $typography-body-size-large) !default;
|
|
20
|
+
// 操作按钮行高
|
|
21
|
+
$datetime-picker-action-line-height: var(--wot-datetime-picker-action-line-height, $typography-body-line--height-size-large) !default;
|
|
22
|
+
// 操作按钮文字颜色
|
|
23
|
+
$datetime-picker-action-color: var(--wot-datetime-picker-action-color, $primary-6) !default;
|
|
24
|
+
// 范围标签内边距
|
|
25
|
+
$datetime-picker-range-padding: var(--wot-datetime-picker-range-padding, 0 $padding-loose $padding-extra-loose) !default;
|
|
26
|
+
// 范围标签字号
|
|
27
|
+
$datetime-picker-range-font-size: var(--wot-datetime-picker-range-font-size, $typography-body-size-main) !default;
|
|
28
|
+
// 范围标签项字号
|
|
29
|
+
$datetime-picker-range-item-font-size: var(--wot-datetime-picker-range-item-font-size, $typography-body-size-extra-large) !default;
|
|
30
|
+
// 范围标签项字重
|
|
31
|
+
$datetime-picker-range-item-font-weight: var(--wot-datetime-picker-range-item-font-weight, $font-weight-medium) !default;
|
|
32
|
+
// 范围标签项行高
|
|
33
|
+
$datetime-picker-range-item-line-height: var(--wot-datetime-picker-range-item-line-height, $typography-body-line--height-size-extra-large) !default;
|
|
34
|
+
// 范围标签项内边距
|
|
35
|
+
$datetime-picker-range-item-padding: var(--wot-datetime-picker-range-item-padding, $spacing-loose $spacing-zero) !default;
|
|
36
|
+
// 范围标签项颜色
|
|
37
|
+
$datetime-picker-range-item-color: var(--wot-datetime-picker-range-item-color, $primary-6) !default;
|
|
38
|
+
// 占位符颜色
|
|
39
|
+
$datetime-picker-range-item-placeholder-color: var(--wot-datetime-picker-range-item-placeholder-color, $text-placeholder) !default;
|
|
40
|
+
// 范围标签项下划线颜色
|
|
41
|
+
$datetime-picker-range-item-line-color: var(--wot-datetime-picker-range-item-line-color, $primary-6) !default;
|
|
42
|
+
// 范围标签项下划线占位符颜色
|
|
43
|
+
$datetime-picker-range-item-line-placeholder-color: var(--wot-datetime-picker-range-item-line-placeholder-color, $border-main) !default;
|
|
44
|
+
// 分隔符水平间距
|
|
45
|
+
$datetime-picker-range-separator-margin: var(--wot-datetime-picker-range-separator-margin, $spacing-zero $spacing-tight) !default;
|
|
46
|
+
// 分隔符颜色
|
|
47
|
+
$datetime-picker-range-separator-color: var(--wot-datetime-picker-range-separator-color, $text-auxiliary) !default;
|
|
48
|
+
// 分隔符宽度
|
|
49
|
+
$datetime-picker-range-separator-width: var(--wot-datetime-picker-range-separator-width, $n-8) !default;
|
|
50
|
+
// 分隔符高度
|
|
51
|
+
$datetime-picker-range-separator-height: var(--wot-datetime-picker-range-separator-height, $stroke-main) !default;
|
|
52
|
+
|
|
53
|
+
@include b(datetime-picker) {
|
|
54
|
+
|
|
55
|
+
@include edeep(popup) {
|
|
56
|
+
border-radius: $datetime-picker-popup-radius;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@include e(wraper) {
|
|
60
|
+
padding-bottom: var(--window-bottom);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@include e(title) {
|
|
64
|
+
position: relative;
|
|
65
|
+
display: flex;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
align-items: center;
|
|
68
|
+
box-sizing: border-box;
|
|
69
|
+
height: $datetime-picker-title-height;
|
|
70
|
+
padding: $datetime-picker-title-padding;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@include e(action) {
|
|
74
|
+
display: block;
|
|
75
|
+
border: none;
|
|
76
|
+
outline: none;
|
|
77
|
+
font-size: $datetime-picker-action-font-size;
|
|
78
|
+
line-height: $datetime-picker-action-line-height;
|
|
79
|
+
color: $datetime-picker-action-color;
|
|
80
|
+
background: transparent;
|
|
81
|
+
}
|
|
82
|
+
@include e(title-text) {
|
|
83
|
+
display: block;
|
|
84
|
+
float: 1;
|
|
85
|
+
color: $datetime-picker-title-color;
|
|
86
|
+
font-size: $datetime-picker-title-font-size;
|
|
87
|
+
line-height: $datetime-picker-title-height;
|
|
88
|
+
font-weight: $datetime-picker-title-font-weight;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@include e(range) {
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
align-items: center;
|
|
95
|
+
font-size: $datetime-picker-range-font-size;
|
|
96
|
+
padding: $datetime-picker-range-padding;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@include e(range-item) {
|
|
100
|
+
flex: 1;
|
|
101
|
+
color: $datetime-picker-range-item-placeholder-color;
|
|
102
|
+
font-size: $datetime-picker-range-item-font-size;
|
|
103
|
+
font-weight: $datetime-picker-range-item-font-weight;
|
|
104
|
+
line-height: $datetime-picker-range-item-line-height;
|
|
105
|
+
padding: $datetime-picker-range-item-padding;
|
|
106
|
+
text-align: center;
|
|
107
|
+
@include pixelBorder(bottom, 0, $datetime-picker-range-item-line-placeholder-color);
|
|
108
|
+
|
|
109
|
+
@include when(active) {
|
|
110
|
+
color: $datetime-picker-range-item-color;
|
|
111
|
+
@include pixelBorder(bottom, 0, $datetime-picker-range-item-line-color);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@include e(range-separator) {
|
|
116
|
+
width: $datetime-picker-range-separator-width;
|
|
117
|
+
height: $datetime-picker-range-separator-height;
|
|
118
|
+
position: relative;
|
|
119
|
+
margin: $datetime-picker-range-separator-margin;
|
|
120
|
+
background: $datetime-picker-range-separator-color;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@include e(hidden) {
|
|
124
|
+
visibility: hidden;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
height: 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@include e(show) {
|
|
130
|
+
visibility: visible;
|
|
131
|
+
height: auto;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeNumberProp, makeRequiredProp, makeStringProp } from '../../common/props'
|
|
3
|
+
import type { DateTimeType, DatetimePickerViewFilter, DatetimePickerViewFormatter } from '../wd-datetime-picker-view/types'
|
|
4
|
+
|
|
5
|
+
const now = new Date()
|
|
6
|
+
const defaultMinDate = new Date(now.getFullYear() - 10, 0, 1).getTime()
|
|
7
|
+
const defaultMaxDate = new Date(now.getFullYear() + 10, 11, 31, 23, 59, 59).getTime()
|
|
8
|
+
|
|
9
|
+
export const datetimePickerProps = {
|
|
10
|
+
...baseProps,
|
|
11
|
+
/**
|
|
12
|
+
* 选项高度
|
|
13
|
+
* 类型: number
|
|
14
|
+
* 默认值: 44
|
|
15
|
+
*/
|
|
16
|
+
itemHeight: makeNumberProp(44),
|
|
17
|
+
/**
|
|
18
|
+
* 可见选项数量
|
|
19
|
+
* 类型: number
|
|
20
|
+
* 默认值: 6
|
|
21
|
+
*/
|
|
22
|
+
visibleItemCount: makeNumberProp(6),
|
|
23
|
+
/**
|
|
24
|
+
* 弹出层标题
|
|
25
|
+
* 类型: string
|
|
26
|
+
*/
|
|
27
|
+
title: String,
|
|
28
|
+
/**
|
|
29
|
+
* 取消按钮文案
|
|
30
|
+
* 类型: string
|
|
31
|
+
*/
|
|
32
|
+
cancelButtonText: String,
|
|
33
|
+
/**
|
|
34
|
+
* 确认按钮文案
|
|
35
|
+
* 类型: string
|
|
36
|
+
*/
|
|
37
|
+
confirmButtonText: String,
|
|
38
|
+
/**
|
|
39
|
+
* 点击遮罩是否关闭
|
|
40
|
+
* 类型: boolean
|
|
41
|
+
* 默认值: true
|
|
42
|
+
*/
|
|
43
|
+
closeOnClickModal: makeBooleanProp(true),
|
|
44
|
+
/**
|
|
45
|
+
* 弹出面板是否设置底部安全距离(iphone X 类型的机型)
|
|
46
|
+
* 类型: boolean
|
|
47
|
+
* 默认值: true
|
|
48
|
+
*/
|
|
49
|
+
safeAreaInsetBottom: makeBooleanProp(true),
|
|
50
|
+
/**
|
|
51
|
+
* 选项的key
|
|
52
|
+
* 类型: string
|
|
53
|
+
* 默认值: 'value'
|
|
54
|
+
*/
|
|
55
|
+
valueKey: makeStringProp('value'),
|
|
56
|
+
/**
|
|
57
|
+
* 选项的label
|
|
58
|
+
* 类型: string
|
|
59
|
+
* 默认值: 'label'
|
|
60
|
+
*/
|
|
61
|
+
labelKey: makeStringProp('label'),
|
|
62
|
+
/**
|
|
63
|
+
* 选中项,当 type 为 time 时,类型为字符串;当 type 为 Array 时,类型为范围选择;否则为 时间戳
|
|
64
|
+
* 类型: string | number | Array<string | number>
|
|
65
|
+
* 必填
|
|
66
|
+
*/
|
|
67
|
+
modelValue: makeRequiredProp([String, Number, Array] as PropType<string | number | Array<string | number>>),
|
|
68
|
+
/**
|
|
69
|
+
* 选择器类型
|
|
70
|
+
* 类型: string
|
|
71
|
+
* 可选值: 'date' | 'year-month' | 'time' | 'datetime' | 'year'
|
|
72
|
+
* 默认值: 'datetime'
|
|
73
|
+
*/
|
|
74
|
+
type: makeStringProp<DateTimeType>('datetime'),
|
|
75
|
+
/**
|
|
76
|
+
* 最小日期
|
|
77
|
+
* 类型: number
|
|
78
|
+
* 默认值: 十年前的1月1日
|
|
79
|
+
*/
|
|
80
|
+
minDate: makeNumberProp(defaultMinDate),
|
|
81
|
+
/**
|
|
82
|
+
* 最大日期
|
|
83
|
+
* 类型: number
|
|
84
|
+
* 默认值: 十年后的12月31日
|
|
85
|
+
*/
|
|
86
|
+
maxDate: makeNumberProp(defaultMaxDate),
|
|
87
|
+
/**
|
|
88
|
+
* 最小小时,time类型时生效
|
|
89
|
+
* 类型: number
|
|
90
|
+
* 默认值: 0
|
|
91
|
+
*/
|
|
92
|
+
minHour: makeNumberProp(0),
|
|
93
|
+
/**
|
|
94
|
+
* 最大小时,time类型时生效
|
|
95
|
+
* 类型: number
|
|
96
|
+
* 默认值: 23
|
|
97
|
+
*/
|
|
98
|
+
maxHour: makeNumberProp(23),
|
|
99
|
+
/**
|
|
100
|
+
* 最小分钟,time类型时生效
|
|
101
|
+
* 类型: number
|
|
102
|
+
* 默认值: 0
|
|
103
|
+
*/
|
|
104
|
+
minMinute: makeNumberProp(0),
|
|
105
|
+
/**
|
|
106
|
+
* 最大分钟,time类型时生效
|
|
107
|
+
* 类型: number
|
|
108
|
+
* 默认值: 59
|
|
109
|
+
*/
|
|
110
|
+
maxMinute: makeNumberProp(59),
|
|
111
|
+
/**
|
|
112
|
+
* 是否启用秒选择,仅在 time 和 datetime 类型下生效
|
|
113
|
+
* 类型: boolean
|
|
114
|
+
* 默认值: false
|
|
115
|
+
*/
|
|
116
|
+
useSecond: makeBooleanProp(false),
|
|
117
|
+
/**
|
|
118
|
+
* 最小秒数,仅在 time 和 datetime 类型下生效
|
|
119
|
+
* 类型: number
|
|
120
|
+
* 默认值: 0
|
|
121
|
+
*/
|
|
122
|
+
minSecond: makeNumberProp(0),
|
|
123
|
+
/**
|
|
124
|
+
* 最大秒数,仅在 time 和 datetime 类型下生效
|
|
125
|
+
* 类型: number
|
|
126
|
+
* 默认值: 59
|
|
127
|
+
*/
|
|
128
|
+
maxSecond: makeNumberProp(59),
|
|
129
|
+
/**
|
|
130
|
+
* 自定义过滤选项的函数,返回列的选项数组
|
|
131
|
+
* 类型: function
|
|
132
|
+
*/
|
|
133
|
+
filter: Function as PropType<DatetimePickerViewFilter>,
|
|
134
|
+
/**
|
|
135
|
+
* 自定义弹出层选项文案的格式化函数,返回一个字符串
|
|
136
|
+
* 类型: function
|
|
137
|
+
*/
|
|
138
|
+
formatter: Function as PropType<DatetimePickerViewFormatter>,
|
|
139
|
+
/**
|
|
140
|
+
* 确定前校验函数,接收 (value) 参数,返回 boolean 或 Promise<boolean>
|
|
141
|
+
* 类型: function
|
|
142
|
+
*/
|
|
143
|
+
beforeConfirm: Function as PropType<DatetimePickerBeforeConfirm>,
|
|
144
|
+
/**
|
|
145
|
+
* 在区域选择模式下,自定义展示tab标签文案的格式化函数,返回一个字符串
|
|
146
|
+
* 类型: function
|
|
147
|
+
*/
|
|
148
|
+
displayFormatTabLabel: Function as PropType<DatetimePickerDisplayFormatTabLabel>,
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 弹窗层级
|
|
152
|
+
* 类型: number
|
|
153
|
+
* 默认值: 15
|
|
154
|
+
*/
|
|
155
|
+
zIndex: makeNumberProp(15),
|
|
156
|
+
/**
|
|
157
|
+
* pickerView 外部自定义样式
|
|
158
|
+
* 类型: string
|
|
159
|
+
*/
|
|
160
|
+
customViewClass: makeStringProp(''),
|
|
161
|
+
/**
|
|
162
|
+
* 是否在手指松开时立即触发picker-view的 change 事件。若不开启则会在滚动动画结束后触发 change 事件,1.2.25版本起提供,仅微信小程序和支付宝小程序支持。
|
|
163
|
+
* 类型: boolean
|
|
164
|
+
* 默认值: false
|
|
165
|
+
*/
|
|
166
|
+
immediateChange: makeBooleanProp(false),
|
|
167
|
+
/**
|
|
168
|
+
* 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
|
|
169
|
+
* 类型: boolean
|
|
170
|
+
* 默认值: false
|
|
171
|
+
*/
|
|
172
|
+
rootPortal: makeBooleanProp(false),
|
|
173
|
+
/**
|
|
174
|
+
* 控制弹窗显示
|
|
175
|
+
* 类型: boolean
|
|
176
|
+
* 默认值: false
|
|
177
|
+
*/
|
|
178
|
+
visible: makeBooleanProp(false)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export type DatetimePickerBeforeConfirm = (value: number | string | (number | string)[]) => boolean | Promise<boolean>
|
|
182
|
+
|
|
183
|
+
export type DatetimePickerDisplayFormatTabLabel = (items: Record<string, any>[]) => string
|
|
184
|
+
|
|
185
|
+
export type DatetimePickerExpose = {
|
|
186
|
+
/**
|
|
187
|
+
* 打开picker弹框
|
|
188
|
+
*/
|
|
189
|
+
open: () => void
|
|
190
|
+
/**
|
|
191
|
+
* 关闭picker弹框
|
|
192
|
+
*/
|
|
193
|
+
close: () => void
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export type DatetimePickerProps = ExtractPropTypes<typeof datetimePickerProps>
|
|
197
|
+
|
|
198
|
+
export type DatetimePickerInstance = ComponentPublicInstance<DatetimePickerProps, DatetimePickerExpose>
|