@tplc/wot 0.0.1
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/components/common/AbortablePromise.ts +36 -0
- package/components/common/abstracts/_config.scss +7 -0
- package/components/common/abstracts/_function.scss +76 -0
- package/components/common/abstracts/_mixin.scss +339 -0
- package/components/common/abstracts/variable.scss +1346 -0
- package/components/common/base64.ts +30 -0
- package/components/common/canvasHelper.ts +49 -0
- package/components/common/clickoutside.ts +34 -0
- package/components/common/dayjs.ts +157 -0
- package/components/common/event.ts +8 -0
- package/components/common/props.ts +51 -0
- package/components/common/util.ts +751 -0
- package/components/composables/useCell.ts +13 -0
- package/components/composables/useChildren.ts +122 -0
- package/components/composables/useCountDown.ts +138 -0
- package/components/composables/useLockScroll.ts +39 -0
- package/components/composables/useParent.ts +41 -0
- package/components/composables/usePopover.ts +193 -0
- package/components/composables/useQueue.ts +52 -0
- package/components/composables/useRaf.ts +37 -0
- package/components/composables/useTouch.ts +44 -0
- package/components/composables/useTranslate.ts +22 -0
- package/components/wd-action-sheet/index.scss +204 -0
- package/components/wd-action-sheet/types.ts +128 -0
- package/components/wd-action-sheet/wd-action-sheet.vue +174 -0
- package/components/wd-backtop/index.scss +25 -0
- package/components/wd-backtop/types.ts +37 -0
- package/components/wd-backtop/wd-backtop.vue +48 -0
- package/components/wd-badge/index.scss +59 -0
- package/components/wd-badge/types.ts +53 -0
- package/components/wd-badge/wd-badge.vue +69 -0
- package/components/wd-button/index.scss +340 -0
- package/components/wd-button/types.ts +112 -0
- package/components/wd-button/wd-button.vue +176 -0
- package/components/wd-calendar/index.scss +244 -0
- package/components/wd-calendar/types.ts +235 -0
- package/components/wd-calendar/wd-calendar.vue +456 -0
- package/components/wd-calendar-view/index.scss +9 -0
- package/components/wd-calendar-view/month/index.scss +151 -0
- package/components/wd-calendar-view/month/month.vue +391 -0
- package/components/wd-calendar-view/month/types.ts +19 -0
- package/components/wd-calendar-view/monthPanel/index.scss +89 -0
- package/components/wd-calendar-view/monthPanel/month-panel.vue +388 -0
- package/components/wd-calendar-view/monthPanel/types.ts +48 -0
- package/components/wd-calendar-view/types.ts +134 -0
- package/components/wd-calendar-view/utils.ts +451 -0
- package/components/wd-calendar-view/wd-calendar-view.vue +111 -0
- package/components/wd-calendar-view/year/index.scss +148 -0
- package/components/wd-calendar-view/year/types.ts +19 -0
- package/components/wd-calendar-view/year/year.vue +220 -0
- package/components/wd-calendar-view/yearPanel/index.scss +24 -0
- package/components/wd-calendar-view/yearPanel/types.ts +38 -0
- package/components/wd-calendar-view/yearPanel/year-panel.vue +140 -0
- package/components/wd-card/index.scss +70 -0
- package/components/wd-card/types.ts +30 -0
- package/components/wd-card/wd-card.vue +40 -0
- package/components/wd-cell/index.scss +189 -0
- package/components/wd-cell/types.ts +96 -0
- package/components/wd-cell/wd-cell.vue +135 -0
- package/components/wd-cell-group/index.scss +55 -0
- package/components/wd-cell-group/types.ts +41 -0
- package/components/wd-cell-group/wd-cell-group.vue +45 -0
- package/components/wd-checkbox/index.scss +285 -0
- package/components/wd-checkbox/types.ts +68 -0
- package/components/wd-checkbox/wd-checkbox.vue +185 -0
- package/components/wd-checkbox-group/index.scss +20 -0
- package/components/wd-checkbox-group/types.ts +59 -0
- package/components/wd-checkbox-group/wd-checkbox-group.vue +103 -0
- package/components/wd-circle/index.scss +18 -0
- package/components/wd-circle/types.ts +54 -0
- package/components/wd-circle/wd-circle.vue +318 -0
- package/components/wd-col/index.scss +19 -0
- package/components/wd-col/types.ts +15 -0
- package/components/wd-col/wd-col.vue +91 -0
- package/components/wd-col-picker/index.scss +241 -0
- package/components/wd-col-picker/types.ts +170 -0
- package/components/wd-col-picker/wd-col-picker.vue +550 -0
- package/components/wd-collapse/index.scss +55 -0
- package/components/wd-collapse/types.ts +63 -0
- package/components/wd-collapse/wd-collapse.vue +160 -0
- package/components/wd-collapse-item/index.scss +79 -0
- package/components/wd-collapse-item/types.ts +36 -0
- package/components/wd-collapse-item/wd-collapse-item.vue +182 -0
- package/components/wd-config-provider/types.ts +1023 -0
- package/components/wd-config-provider/wd-config-provider.vue +82 -0
- package/components/wd-count-down/index.scss +14 -0
- package/components/wd-count-down/types.ts +41 -0
- package/components/wd-count-down/utils.ts +52 -0
- package/components/wd-count-down/wd-count-down.vue +60 -0
- package/components/wd-count-to/index.scss +6 -0
- package/components/wd-count-to/types.ts +110 -0
- package/components/wd-count-to/wd-count-to.vue +134 -0
- package/components/wd-curtain/index.scss +80 -0
- package/components/wd-curtain/types.ts +45 -0
- package/components/wd-curtain/wd-curtain.vue +174 -0
- package/components/wd-datetime-picker/index.scss +243 -0
- package/components/wd-datetime-picker/types.ts +225 -0
- package/components/wd-datetime-picker/wd-datetime-picker.vue +827 -0
- package/components/wd-datetime-picker-view/index.scss +0 -0
- package/components/wd-datetime-picker-view/types.ts +137 -0
- package/components/wd-datetime-picker-view/wd-datetime-picker-view.vue +514 -0
- package/components/wd-divider/index.scss +32 -0
- package/components/wd-divider/types.ts +12 -0
- package/components/wd-divider/wd-divider.vue +29 -0
- package/components/wd-drop-menu/index.scss +89 -0
- package/components/wd-drop-menu/types.ts +38 -0
- package/components/wd-drop-menu/wd-drop-menu.vue +128 -0
- package/components/wd-drop-menu-item/index.scss +66 -0
- package/components/wd-drop-menu-item/types.ts +78 -0
- package/components/wd-drop-menu-item/wd-drop-menu-item.vue +230 -0
- package/components/wd-fab/index.scss +115 -0
- package/components/wd-fab/types.ts +61 -0
- package/components/wd-fab/wd-fab.vue +257 -0
- package/components/wd-form/index.scss +10 -0
- package/components/wd-form/types.ts +93 -0
- package/components/wd-form/wd-form.vue +185 -0
- package/components/wd-form-item/index.scss +17 -0
- package/components/wd-form-item/types.ts +22 -0
- package/components/wd-form-item/wd-form-item.vue +65 -0
- package/components/wd-gap/index.scss +9 -0
- package/components/wd-gap/types.ts +23 -0
- package/components/wd-gap/wd-gap.vue +39 -0
- package/components/wd-grid/index.scss +9 -0
- package/components/wd-grid/types.ts +54 -0
- package/components/wd-grid/wd-grid.vue +107 -0
- package/components/wd-grid-item/index.scss +137 -0
- package/components/wd-grid-item/types.ts +74 -0
- package/components/wd-grid-item/wd-grid-item.vue +181 -0
- package/components/wd-icon/index.scss +1222 -0
- package/components/wd-icon/types.ts +21 -0
- package/components/wd-icon/wd-icon.vue +53 -0
- package/components/wd-icon/wd-icons.ttf +0 -0
- package/components/wd-img/index.scss +19 -0
- package/components/wd-img/types.ts +53 -0
- package/components/wd-img/wd-img.vue +76 -0
- package/components/wd-img-cropper/index.scss +227 -0
- package/components/wd-img-cropper/types.ts +87 -0
- package/components/wd-img-cropper/wd-img-cropper.vue +659 -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 +57 -0
- package/components/wd-index-bar/index.scss +39 -0
- package/components/wd-index-bar/type.ts +28 -0
- package/components/wd-index-bar/wd-index-bar.vue +158 -0
- package/components/wd-input/index.scss +326 -0
- package/components/wd-input/types.ts +182 -0
- package/components/wd-input/wd-input.vue +327 -0
- package/components/wd-input-number/index.scss +132 -0
- package/components/wd-input-number/types.ts +78 -0
- package/components/wd-input-number/wd-input-number.vue +221 -0
- package/components/wd-loading/index.scss +34 -0
- package/components/wd-loading/types.ts +31 -0
- package/components/wd-loading/wd-loading.vue +90 -0
- package/components/wd-loadmore/index.scss +39 -0
- package/components/wd-loadmore/types.ts +24 -0
- package/components/wd-loadmore/wd-loadmore.vue +53 -0
- package/components/wd-message-box/index.scss +121 -0
- package/components/wd-message-box/index.ts +95 -0
- package/components/wd-message-box/types.ts +116 -0
- package/components/wd-message-box/wd-message-box.vue +326 -0
- package/components/wd-navbar/index.scss +103 -0
- package/components/wd-navbar/types.ts +52 -0
- package/components/wd-navbar/wd-navbar.vue +142 -0
- package/components/wd-navbar-capsule/index.scss +65 -0
- package/components/wd-navbar-capsule/types.ts +0 -0
- package/components/wd-navbar-capsule/wd-navbar-capsule.vue +31 -0
- package/components/wd-notice-bar/index.scss +86 -0
- package/components/wd-notice-bar/types.ts +56 -0
- package/components/wd-notice-bar/wd-notice-bar.vue +223 -0
- package/components/wd-notify/index.scss +34 -0
- package/components/wd-notify/index.ts +59 -0
- package/components/wd-notify/types.ts +62 -0
- package/components/wd-notify/wd-notify.vue +83 -0
- package/components/wd-number-keyboard/index.scss +78 -0
- package/components/wd-number-keyboard/key/index.scss +79 -0
- package/components/wd-number-keyboard/key/index.vue +76 -0
- package/components/wd-number-keyboard/key/types.ts +11 -0
- package/components/wd-number-keyboard/types.ts +79 -0
- package/components/wd-number-keyboard/wd-number-keyboard.vue +173 -0
- package/components/wd-overlay/index.scss +17 -0
- package/components/wd-overlay/types.ts +25 -0
- package/components/wd-overlay/wd-overlay.vue +46 -0
- package/components/wd-pagination/index.scss +57 -0
- package/components/wd-pagination/types.ts +41 -0
- package/components/wd-pagination/wd-pagination.vue +121 -0
- package/components/wd-password-input/index.scss +123 -0
- package/components/wd-password-input/types.ts +48 -0
- package/components/wd-password-input/wd-password-input.vue +58 -0
- package/components/wd-picker/index.scss +216 -0
- package/components/wd-picker/types.ts +186 -0
- package/components/wd-picker/wd-picker.vue +409 -0
- package/components/wd-picker-view/index.scss +91 -0
- package/components/wd-picker-view/types.ts +162 -0
- package/components/wd-picker-view/wd-picker-view.vue +361 -0
- package/components/wd-popover/index.scss +123 -0
- package/components/wd-popover/types.ts +69 -0
- package/components/wd-popover/wd-popover.vue +216 -0
- package/components/wd-popup/index.scss +112 -0
- package/components/wd-popup/types.ts +68 -0
- package/components/wd-popup/wd-popup.vue +227 -0
- package/components/wd-progress/index.scss +62 -0
- package/components/wd-progress/types.ts +40 -0
- package/components/wd-progress/wd-progress.vue +201 -0
- package/components/wd-radio/index.scss +300 -0
- package/components/wd-radio/types.ts +42 -0
- package/components/wd-radio/wd-radio.vue +136 -0
- package/components/wd-radio-group/index.scss +23 -0
- package/components/wd-radio-group/types.ts +36 -0
- package/components/wd-radio-group/wd-radio-group.vue +54 -0
- package/components/wd-rate/index.scss +24 -0
- package/components/wd-rate/types.ts +91 -0
- package/components/wd-rate/wd-rate.vue +131 -0
- package/components/wd-resize/index.scss +26 -0
- package/components/wd-resize/types.ts +6 -0
- package/components/wd-resize/wd-resize.vue +155 -0
- package/components/wd-row/index.scss +10 -0
- package/components/wd-row/types.ts +16 -0
- package/components/wd-row/wd-row.vue +63 -0
- package/components/wd-search/index.scss +148 -0
- package/components/wd-search/types.ts +83 -0
- package/components/wd-search/wd-search.vue +237 -0
- package/components/wd-segmented/index.scss +97 -0
- package/components/wd-segmented/types.ts +68 -0
- package/components/wd-segmented/wd-segmented.vue +143 -0
- package/components/wd-select-picker/index.scss +177 -0
- package/components/wd-select-picker/types.ts +116 -0
- package/components/wd-select-picker/wd-select-picker.vue +486 -0
- package/components/wd-sidebar/index.scss +25 -0
- package/components/wd-sidebar/types.ts +28 -0
- package/components/wd-sidebar/wd-sidebar.vue +41 -0
- package/components/wd-sidebar-item/index.scss +93 -0
- package/components/wd-sidebar-item/types.ts +31 -0
- package/components/wd-sidebar-item/wd-sidebar-item.vue +114 -0
- package/components/wd-skeleton/index.scss +101 -0
- package/components/wd-skeleton/index.ts +1 -0
- package/components/wd-skeleton/types.ts +69 -0
- package/components/wd-skeleton/wd-skeleton.vue +135 -0
- package/components/wd-slider/index.scss +91 -0
- package/components/wd-slider/types.ts +104 -0
- package/components/wd-slider/wd-slider.vue +377 -0
- package/components/wd-sort-button/index.scss +86 -0
- package/components/wd-sort-button/types.ts +43 -0
- package/components/wd-sort-button/wd-sort-button.vue +76 -0
- package/components/wd-status-tip/index.scss +37 -0
- package/components/wd-status-tip/types.ts +59 -0
- package/components/wd-status-tip/wd-status-tip.vue +94 -0
- package/components/wd-step/index.scss +236 -0
- package/components/wd-step/types.ts +33 -0
- package/components/wd-step/wd-step.vue +151 -0
- package/components/wd-steps/index.scss +10 -0
- package/components/wd-steps/types.ts +59 -0
- package/components/wd-steps/wd-steps.vue +37 -0
- package/components/wd-sticky/index.scss +9 -0
- package/components/wd-sticky/types.ts +13 -0
- package/components/wd-sticky/wd-sticky.vue +190 -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 +154 -0
- package/components/wd-swipe-action/index.scss +22 -0
- package/components/wd-swipe-action/types.ts +43 -0
- package/components/wd-swipe-action/wd-swipe-action.vue +307 -0
- package/components/wd-swiper/index.scss +23 -0
- package/components/wd-swiper/types.ts +189 -0
- package/components/wd-swiper/wd-swiper.vue +202 -0
- package/components/wd-swiper-nav/index.scss +153 -0
- package/components/wd-swiper-nav/types.ts +42 -0
- package/components/wd-swiper-nav/wd-swiper-nav.vue +37 -0
- package/components/wd-switch/index.scss +58 -0
- package/components/wd-switch/types.ts +56 -0
- package/components/wd-switch/wd-switch.vue +83 -0
- package/components/wd-tab/index.scss +8 -0
- package/components/wd-tab/types.ts +20 -0
- package/components/wd-tab/wd-tab.vue +100 -0
- package/components/wd-tabbar/index.scss +57 -0
- package/components/wd-tabbar/types.ts +88 -0
- package/components/wd-tabbar/wd-tabbar.vue +104 -0
- package/components/wd-tabbar-item/index.scss +52 -0
- package/components/wd-tabbar-item/types.ts +51 -0
- package/components/wd-tabbar-item/wd-tabbar-item.vue +101 -0
- package/components/wd-table/index.scss +132 -0
- package/components/wd-table/types.ts +69 -0
- package/components/wd-table/wd-table.vue +255 -0
- package/components/wd-table-col/index.scss +44 -0
- package/components/wd-table-col/types.ts +54 -0
- package/components/wd-table-col/wd-table-col.vue +149 -0
- package/components/wd-tabs/index.scss +280 -0
- package/components/wd-tabs/types.ts +71 -0
- package/components/wd-tabs/wd-tabs.vue +528 -0
- package/components/wd-tag/index.scss +115 -0
- package/components/wd-tag/types.ts +81 -0
- package/components/wd-tag/wd-tag.vue +154 -0
- package/components/wd-text/index.scss +34 -0
- package/components/wd-text/types.ts +98 -0
- package/components/wd-text/wd-text.vue +138 -0
- package/components/wd-textarea/index.scss +343 -0
- package/components/wd-textarea/types.ts +298 -0
- package/components/wd-textarea/wd-textarea.vue +303 -0
- package/components/wd-toast/index.scss +66 -0
- package/components/wd-toast/index.ts +109 -0
- package/components/wd-toast/types.ts +76 -0
- package/components/wd-toast/wd-toast.vue +212 -0
- package/components/wd-tooltip/index.scss +61 -0
- package/components/wd-tooltip/types.ts +102 -0
- package/components/wd-tooltip/wd-tooltip.vue +167 -0
- package/components/wd-transition/index.scss +91 -0
- package/components/wd-transition/types.ts +89 -0
- package/components/wd-transition/wd-transition.vue +221 -0
- package/components/wd-upload/index.scss +173 -0
- package/components/wd-upload/types.ts +378 -0
- package/components/wd-upload/utils.ts +152 -0
- package/components/wd-upload/wd-upload.vue +737 -0
- package/components/wd-video-preview/index.scss +34 -0
- package/components/wd-video-preview/types.ts +32 -0
- package/components/wd-video-preview/wd-video-preview.vue +76 -0
- package/components/wd-watermark/index.scss +18 -0
- package/components/wd-watermark/types.ts +82 -0
- package/components/wd-watermark/wd-watermark.vue +592 -0
- package/components/wot-design-uni/wot-design-uni.vue +14 -0
- package/global.d.ts +108 -0
- package/index.ts +30 -0
- package/locale/index.ts +41 -0
- package/locale/lang/en-US.ts +128 -0
- package/locale/lang/th-TH.ts +127 -0
- package/locale/lang/vi-VN.ts +89 -0
- package/locale/lang/zh-CN.ts +127 -0
- package/locale/lang/zh-HK.ts +84 -0
- package/locale/lang/zh-TW.ts +84 -0
- package/package.json +20 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
baseProps,
|
|
4
|
+
makeArrayProp,
|
|
5
|
+
makeBooleanProp,
|
|
6
|
+
makeNumberProp,
|
|
7
|
+
makeStringProp,
|
|
8
|
+
} from '../common/props'
|
|
9
|
+
import type { ColumnItem, PickerViewColumnChange } from '../wd-picker-view/types'
|
|
10
|
+
import type { FormItemRule } from '../wd-form/types'
|
|
11
|
+
|
|
12
|
+
export const pickerProps = {
|
|
13
|
+
...baseProps,
|
|
14
|
+
/**
|
|
15
|
+
* label 外部自定义样式
|
|
16
|
+
*/
|
|
17
|
+
customLabelClass: makeStringProp(''),
|
|
18
|
+
/**
|
|
19
|
+
* value 外部自定义样式
|
|
20
|
+
*/
|
|
21
|
+
customValueClass: makeStringProp(''),
|
|
22
|
+
/**
|
|
23
|
+
* pickerView 外部自定义样式
|
|
24
|
+
*/
|
|
25
|
+
customViewClass: makeStringProp(''),
|
|
26
|
+
/**
|
|
27
|
+
* 选择器左侧文案
|
|
28
|
+
*/
|
|
29
|
+
label: String,
|
|
30
|
+
/**
|
|
31
|
+
* 选择器占位符
|
|
32
|
+
*/
|
|
33
|
+
placeholder: String,
|
|
34
|
+
/**
|
|
35
|
+
* 是否禁用
|
|
36
|
+
*/
|
|
37
|
+
disabled: makeBooleanProp(false),
|
|
38
|
+
/**
|
|
39
|
+
* 是否只读
|
|
40
|
+
*/
|
|
41
|
+
readonly: makeBooleanProp(false),
|
|
42
|
+
/**
|
|
43
|
+
* 加载中
|
|
44
|
+
*/
|
|
45
|
+
loading: makeBooleanProp(false),
|
|
46
|
+
/**
|
|
47
|
+
* 加载中颜色
|
|
48
|
+
*/
|
|
49
|
+
loadingColor: makeStringProp('#4D80F0'),
|
|
50
|
+
/* popup */
|
|
51
|
+
/**
|
|
52
|
+
* 弹出层标题
|
|
53
|
+
*/
|
|
54
|
+
title: String,
|
|
55
|
+
/**
|
|
56
|
+
* 取消按钮文案
|
|
57
|
+
*/
|
|
58
|
+
cancelButtonText: String,
|
|
59
|
+
/**
|
|
60
|
+
* 确认按钮文案
|
|
61
|
+
*/
|
|
62
|
+
confirmButtonText: String,
|
|
63
|
+
/**
|
|
64
|
+
* 是否必填
|
|
65
|
+
*/
|
|
66
|
+
required: makeBooleanProp(false),
|
|
67
|
+
/**
|
|
68
|
+
* 尺寸
|
|
69
|
+
*/
|
|
70
|
+
size: String,
|
|
71
|
+
/**
|
|
72
|
+
* 标签宽度
|
|
73
|
+
*/
|
|
74
|
+
labelWidth: String,
|
|
75
|
+
/**
|
|
76
|
+
* 使用默认插槽
|
|
77
|
+
*/
|
|
78
|
+
useDefaultSlot: makeBooleanProp(false),
|
|
79
|
+
/**
|
|
80
|
+
* 使用标签插槽
|
|
81
|
+
*/
|
|
82
|
+
useLabelSlot: makeBooleanProp(false),
|
|
83
|
+
/**
|
|
84
|
+
* 错误状态
|
|
85
|
+
*/
|
|
86
|
+
error: makeBooleanProp(false),
|
|
87
|
+
/**
|
|
88
|
+
* 右对齐
|
|
89
|
+
*/
|
|
90
|
+
alignRight: makeBooleanProp(false),
|
|
91
|
+
/**
|
|
92
|
+
* 确定前校验函数,接收 (value, resolve, picker) 参数,通过 resolve 继续执行 picker,resolve 接收1个boolean参数
|
|
93
|
+
*/
|
|
94
|
+
beforeConfirm: Function as PropType<PickerBeforeConfirm>,
|
|
95
|
+
/**
|
|
96
|
+
* 点击蒙层关闭
|
|
97
|
+
*/
|
|
98
|
+
closeOnClickModal: makeBooleanProp(true),
|
|
99
|
+
/**
|
|
100
|
+
* 底部安全区域内
|
|
101
|
+
*/
|
|
102
|
+
safeAreaInsetBottom: makeBooleanProp(true),
|
|
103
|
+
/**
|
|
104
|
+
* 文本溢出显示省略号
|
|
105
|
+
*/
|
|
106
|
+
ellipsis: makeBooleanProp(false),
|
|
107
|
+
/**
|
|
108
|
+
* 选项总高度
|
|
109
|
+
*/
|
|
110
|
+
columnsHeight: makeNumberProp(217),
|
|
111
|
+
/**
|
|
112
|
+
* 选项值对应的键名
|
|
113
|
+
*/
|
|
114
|
+
valueKey: makeStringProp('value'),
|
|
115
|
+
/**
|
|
116
|
+
* 选项文本对应的键名
|
|
117
|
+
*/
|
|
118
|
+
labelKey: makeStringProp('label'),
|
|
119
|
+
/**
|
|
120
|
+
* 选中项,如果为多列选择器,则其类型应为数组
|
|
121
|
+
*/
|
|
122
|
+
modelValue: {
|
|
123
|
+
type: [String, Number, Array] as PropType<string | number | Array<string> | Array<number>>,
|
|
124
|
+
default: '',
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* 选择器数据,可以为字符串数组,也可以为对象数组,如果为二维数组,则为多列选择器
|
|
128
|
+
*/
|
|
129
|
+
columns: {
|
|
130
|
+
type: Array as PropType<
|
|
131
|
+
Array<string | number | ColumnItem | Array<string | number | ColumnItem>>
|
|
132
|
+
>,
|
|
133
|
+
default: () => [],
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* 接收 pickerView 实例、选中项、当前修改列的下标、resolve 作为入参,根据选中项和列下标进行判断,通过 pickerView 实例暴露出来的 setColumnData 方法修改其他列的数据源。
|
|
137
|
+
*/
|
|
138
|
+
columnChange: Function as PropType<PickerViewColumnChange>,
|
|
139
|
+
/**
|
|
140
|
+
* 自定义展示文案的格式化函数,返回一个字符串
|
|
141
|
+
*/
|
|
142
|
+
displayFormat: Function as PropType<PickerDisplayFormat>,
|
|
143
|
+
/**
|
|
144
|
+
* 自定义层级
|
|
145
|
+
*/
|
|
146
|
+
zIndex: makeNumberProp(15),
|
|
147
|
+
/**
|
|
148
|
+
* 表单域 model 字段名,在使用表单校验功能的情况下,该属性是必填的
|
|
149
|
+
*/
|
|
150
|
+
prop: String,
|
|
151
|
+
/**
|
|
152
|
+
* 表单验证规则,结合wd-form组件使用
|
|
153
|
+
*/
|
|
154
|
+
rules: makeArrayProp<FormItemRule>(),
|
|
155
|
+
/**
|
|
156
|
+
* 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件,1.2.25版本起提供,仅微信小程序和支付宝小程序支持。
|
|
157
|
+
*/
|
|
158
|
+
immediateChange: makeBooleanProp(false),
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type PickerProps = ExtractPropTypes<typeof pickerProps>
|
|
162
|
+
|
|
163
|
+
export type PickerDisplayFormat = (
|
|
164
|
+
item: ColumnItem | ColumnItem[],
|
|
165
|
+
vl: { valueKey: string; labelKey: string },
|
|
166
|
+
) => string
|
|
167
|
+
|
|
168
|
+
export type PickerBeforeConfirm = (
|
|
169
|
+
value: string | number | boolean | string[] | number[] | boolean[],
|
|
170
|
+
resolve: (isPass: boolean) => void,
|
|
171
|
+
picker: any,
|
|
172
|
+
) => void
|
|
173
|
+
|
|
174
|
+
export type PickerExpose = {
|
|
175
|
+
// 打开picker弹框
|
|
176
|
+
open: () => void
|
|
177
|
+
// 关闭picker弹框
|
|
178
|
+
close: () => void
|
|
179
|
+
/**
|
|
180
|
+
* 设置加载状态
|
|
181
|
+
* @param loading 加载状态
|
|
182
|
+
*/
|
|
183
|
+
setLoading: (loading: boolean) => void
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type PickerInstance = ComponentPublicInstance<PickerExpose, PickerProps>
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
:class="`wd-picker ${disabled ? 'is-disabled' : ''} ${size ? 'is-' + size : ''} ${cell.border.value ? 'is-border' : ''} ${
|
|
4
|
+
alignRight ? 'is-align-right' : ''
|
|
5
|
+
} ${error ? 'is-error' : ''} ${customClass}`"
|
|
6
|
+
:style="customStyle"
|
|
7
|
+
>
|
|
8
|
+
<view class="wd-picker__field" @click="showPopup">
|
|
9
|
+
<slot v-if="useDefaultSlot"></slot>
|
|
10
|
+
<view v-else class="wd-picker__cell">
|
|
11
|
+
<view
|
|
12
|
+
v-if="label || useLabelSlot"
|
|
13
|
+
:class="`wd-picker__label ${customLabelClass} ${isRequired ? 'is-required' : ''}`"
|
|
14
|
+
:style="labelWidth ? 'min-width:' + labelWidth + ';max-width:' + labelWidth + ';' : ''"
|
|
15
|
+
>
|
|
16
|
+
<template v-if="label">{{ label }}</template>
|
|
17
|
+
<slot v-else name="label"></slot>
|
|
18
|
+
</view>
|
|
19
|
+
<view class="wd-picker__body">
|
|
20
|
+
<view class="wd-picker__value-wraper">
|
|
21
|
+
<view
|
|
22
|
+
:class="`wd-picker__value ${ellipsis && 'is-ellipsis'} ${customValueClass} ${showValue ? '' : 'wd-picker__placeholder'}`"
|
|
23
|
+
>
|
|
24
|
+
{{ showValue ? showValue : placeholder || translate('placeholder') }}
|
|
25
|
+
</view>
|
|
26
|
+
<wd-icon
|
|
27
|
+
v-if="!disabled && !readonly"
|
|
28
|
+
custom-class="wd-picker__arrow"
|
|
29
|
+
name="arrow-right"
|
|
30
|
+
/>
|
|
31
|
+
</view>
|
|
32
|
+
<view v-if="errorMessage" class="wd-picker__error-message">{{ errorMessage }}</view>
|
|
33
|
+
</view>
|
|
34
|
+
</view>
|
|
35
|
+
</view>
|
|
36
|
+
<wd-popup
|
|
37
|
+
v-model="popupShow"
|
|
38
|
+
position="bottom"
|
|
39
|
+
:hide-when-close="false"
|
|
40
|
+
:close-on-click-modal="closeOnClickModal"
|
|
41
|
+
:z-index="zIndex"
|
|
42
|
+
:safe-area-inset-bottom="safeAreaInsetBottom"
|
|
43
|
+
@close="onCancel"
|
|
44
|
+
custom-class="wd-picker__popup"
|
|
45
|
+
>
|
|
46
|
+
<view class="wd-picker__wraper">
|
|
47
|
+
<view class="wd-picker__toolbar" @touchmove="noop">
|
|
48
|
+
<view class="wd-picker__action wd-picker__action--cancel" @click="onCancel">
|
|
49
|
+
{{ cancelButtonText || translate('cancel') }}
|
|
50
|
+
</view>
|
|
51
|
+
<view v-if="title" class="wd-picker__title">{{ title }}</view>
|
|
52
|
+
<view :class="`wd-picker__action ${isLoading ? 'is-loading' : ''}`" @click="onConfirm">
|
|
53
|
+
{{ confirmButtonText || translate('done') }}
|
|
54
|
+
</view>
|
|
55
|
+
</view>
|
|
56
|
+
<wd-picker-view
|
|
57
|
+
ref="pickerViewWd"
|
|
58
|
+
:custom-class="customViewClass"
|
|
59
|
+
v-model="pickerValue"
|
|
60
|
+
:columns="displayColumns"
|
|
61
|
+
:loading="isLoading"
|
|
62
|
+
:loading-color="loadingColor"
|
|
63
|
+
:columns-height="columnsHeight"
|
|
64
|
+
:value-key="valueKey"
|
|
65
|
+
:label-key="labelKey"
|
|
66
|
+
:immediate-change="immediateChange"
|
|
67
|
+
@change="pickerViewChange"
|
|
68
|
+
@pickstart="onPickStart"
|
|
69
|
+
@pickend="onPickEnd"
|
|
70
|
+
:column-change="columnChange"
|
|
71
|
+
/>
|
|
72
|
+
</view>
|
|
73
|
+
</wd-popup>
|
|
74
|
+
</view>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script lang="ts">
|
|
78
|
+
export default {
|
|
79
|
+
name: 'wd-picker',
|
|
80
|
+
options: {
|
|
81
|
+
virtualHost: true,
|
|
82
|
+
addGlobalClass: true,
|
|
83
|
+
styleIsolation: 'shared',
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<script lang="ts" setup>
|
|
89
|
+
import { getCurrentInstance, onBeforeMount, ref, watch, computed, onMounted, nextTick } from 'vue'
|
|
90
|
+
import {
|
|
91
|
+
deepClone,
|
|
92
|
+
defaultDisplayFormat,
|
|
93
|
+
getType,
|
|
94
|
+
isArray,
|
|
95
|
+
isDef,
|
|
96
|
+
isFunction,
|
|
97
|
+
} from '../common/util'
|
|
98
|
+
import { useCell } from '../composables/useCell'
|
|
99
|
+
import { type ColumnItem, formatArray, type PickerViewInstance } from '../wd-picker-view/types'
|
|
100
|
+
import { FORM_KEY, type FormItemRule } from '../wd-form/types'
|
|
101
|
+
import { useParent } from '../composables/useParent'
|
|
102
|
+
import { useTranslate } from '../composables/useTranslate'
|
|
103
|
+
import { pickerProps, type PickerExpose } from './types'
|
|
104
|
+
const { translate } = useTranslate('picker')
|
|
105
|
+
|
|
106
|
+
const props = defineProps(pickerProps)
|
|
107
|
+
const emit = defineEmits(['confirm', 'open', 'cancel', 'update:modelValue'])
|
|
108
|
+
|
|
109
|
+
const pickerViewWd = ref<PickerViewInstance | null>(null)
|
|
110
|
+
const cell = useCell()
|
|
111
|
+
|
|
112
|
+
const innerLoading = ref<boolean>(false) // 内部控制是否loading
|
|
113
|
+
|
|
114
|
+
// 弹出层是否显示
|
|
115
|
+
const popupShow = ref<boolean>(false)
|
|
116
|
+
// 选定后展示的选中项
|
|
117
|
+
const showValue = ref<string>('')
|
|
118
|
+
const pickerValue = ref<string | number | boolean | string[] | number[] | boolean[]>('')
|
|
119
|
+
const displayColumns = ref<
|
|
120
|
+
Array<string | number | ColumnItem | Array<string | number | ColumnItem>>
|
|
121
|
+
>([]) // 传入 pickerView 的columns
|
|
122
|
+
const resetColumns = ref<Array<string | number | ColumnItem | Array<string | number | ColumnItem>>>(
|
|
123
|
+
[],
|
|
124
|
+
) // 保存之前的 columns,当取消时,将数据源回滚,避免多级联动数据源不正确的情况
|
|
125
|
+
const isPicking = ref<boolean>(false) // 判断pickview是否还在滑动中
|
|
126
|
+
const hasConfirmed = ref<boolean>(false) // 判断用户是否点击了确认按钮
|
|
127
|
+
|
|
128
|
+
const isLoading = computed(() => {
|
|
129
|
+
return props.loading || innerLoading.value
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
watch(
|
|
133
|
+
() => props.displayFormat,
|
|
134
|
+
(fn) => {
|
|
135
|
+
if (fn && !isFunction(fn)) {
|
|
136
|
+
console.error('The type of displayFormat must be Function')
|
|
137
|
+
}
|
|
138
|
+
if (pickerViewWd.value && pickerViewWd.value.getSelectedIndex().length !== 0) {
|
|
139
|
+
handleShowValueUpdate(props.modelValue)
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
immediate: true,
|
|
144
|
+
deep: true,
|
|
145
|
+
},
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
watch(
|
|
149
|
+
() => props.modelValue,
|
|
150
|
+
(newValue) => {
|
|
151
|
+
pickerValue.value = newValue
|
|
152
|
+
// 获取初始选中项,并展示初始选中文案
|
|
153
|
+
handleShowValueUpdate(newValue)
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
deep: true,
|
|
157
|
+
immediate: true,
|
|
158
|
+
},
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
watch(
|
|
162
|
+
() => props.columns,
|
|
163
|
+
(newValue) => {
|
|
164
|
+
displayColumns.value = deepClone(newValue)
|
|
165
|
+
resetColumns.value = deepClone(newValue)
|
|
166
|
+
// 获取初始选中项,并展示初始选中文案
|
|
167
|
+
handleShowValueUpdate(props.modelValue)
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
deep: true,
|
|
171
|
+
immediate: true,
|
|
172
|
+
},
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
watch(
|
|
176
|
+
() => props.columnChange,
|
|
177
|
+
(newValue) => {
|
|
178
|
+
if (newValue && !isFunction(newValue)) {
|
|
179
|
+
console.error('The type of columnChange must be Function')
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
deep: true,
|
|
184
|
+
immediate: true,
|
|
185
|
+
},
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
const { parent: form } = useParent(FORM_KEY)
|
|
189
|
+
|
|
190
|
+
// 表单校验错误信息
|
|
191
|
+
const errorMessage = computed(() => {
|
|
192
|
+
if (form && props.prop && form.errorMessages && form.errorMessages[props.prop]) {
|
|
193
|
+
return form.errorMessages[props.prop]
|
|
194
|
+
} else {
|
|
195
|
+
return ''
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
// 是否展示必填
|
|
200
|
+
const isRequired = computed(() => {
|
|
201
|
+
let formRequired = false
|
|
202
|
+
if (form && form.props.rules) {
|
|
203
|
+
const rules = form.props.rules
|
|
204
|
+
for (const key in rules) {
|
|
205
|
+
if (
|
|
206
|
+
Object.prototype.hasOwnProperty.call(rules, key) &&
|
|
207
|
+
key === props.prop &&
|
|
208
|
+
Array.isArray(rules[key])
|
|
209
|
+
) {
|
|
210
|
+
formRequired = rules[key].some((rule: FormItemRule) => rule.required)
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return props.required || props.rules.some((rule) => rule.required) || formRequired
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
const { proxy } = getCurrentInstance() as any
|
|
218
|
+
|
|
219
|
+
onMounted(() => {
|
|
220
|
+
handleShowValueUpdate(props.modelValue)
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
onBeforeMount(() => {
|
|
224
|
+
displayColumns.value = deepClone(props.columns)
|
|
225
|
+
resetColumns.value = deepClone(props.columns)
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* 值变更时更新显示内容
|
|
230
|
+
* @param value
|
|
231
|
+
*/
|
|
232
|
+
function handleShowValueUpdate(value: string | number | Array<string | number>) {
|
|
233
|
+
// 获取初始选中项,并展示初始选中文案
|
|
234
|
+
if ((isArray(value) && value.length > 0) || (isDef(value) && !isArray(value) && value !== '')) {
|
|
235
|
+
if (pickerViewWd.value) {
|
|
236
|
+
nextTick(() => {
|
|
237
|
+
setShowValue(pickerViewWd.value!.getSelects())
|
|
238
|
+
})
|
|
239
|
+
} else {
|
|
240
|
+
setShowValue(getSelects(value)!)
|
|
241
|
+
}
|
|
242
|
+
} else {
|
|
243
|
+
showValue.value = ''
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @description 根据传入的value,picker组件获取当前cell展示值。
|
|
249
|
+
* @param {String|Number|Array<String|Number|Array<any>>}value
|
|
250
|
+
*/
|
|
251
|
+
function getSelects(value: string | number | Array<string | number | Array<any>>) {
|
|
252
|
+
const formatColumns = formatArray(props.columns, props.valueKey, props.labelKey)
|
|
253
|
+
if (props.columns.length === 0) return
|
|
254
|
+
|
|
255
|
+
// 使其默认选中首项
|
|
256
|
+
if (value === '' || !isDef(value) || (isArray(value) && value.length === 0)) {
|
|
257
|
+
return
|
|
258
|
+
}
|
|
259
|
+
const valueType = getType(value)
|
|
260
|
+
const type = ['string', 'number', 'boolean', 'array']
|
|
261
|
+
if (type.indexOf(valueType) === -1) return []
|
|
262
|
+
/**
|
|
263
|
+
* 1.单key转为Array<key>
|
|
264
|
+
* 2.根据formatColumns的长度截取Array<String>,保证下面的遍历不溢出
|
|
265
|
+
* 3.根据每列的key值找到选项中value为此key的下标并记录
|
|
266
|
+
*/
|
|
267
|
+
value = isArray(value) ? value : [value]
|
|
268
|
+
value = value.slice(0, formatColumns.length)
|
|
269
|
+
|
|
270
|
+
if (value.length === 0) {
|
|
271
|
+
value = formatColumns.map(() => 0)
|
|
272
|
+
}
|
|
273
|
+
const selected: number[] = []
|
|
274
|
+
value.forEach((target, col) => {
|
|
275
|
+
let row = formatColumns[col].findIndex((row) => {
|
|
276
|
+
return row[props.valueKey].toString() === target.toString()
|
|
277
|
+
})
|
|
278
|
+
row = row === -1 ? 0 : row
|
|
279
|
+
selected.push(row)
|
|
280
|
+
})
|
|
281
|
+
|
|
282
|
+
const selects = selected.map((row, col) => formatColumns[col][row])
|
|
283
|
+
// 单列选择器,则返回单项
|
|
284
|
+
if (selects.length === 1) {
|
|
285
|
+
return selects[0]
|
|
286
|
+
}
|
|
287
|
+
return selects
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// 对外暴露方法,打开弹框
|
|
291
|
+
function open() {
|
|
292
|
+
showPopup()
|
|
293
|
+
}
|
|
294
|
+
// 对外暴露方法,关闭弹框
|
|
295
|
+
function close() {
|
|
296
|
+
onCancel()
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* 展示popup
|
|
300
|
+
*/
|
|
301
|
+
function showPopup() {
|
|
302
|
+
if (props.disabled || props.readonly) return
|
|
303
|
+
|
|
304
|
+
emit('open')
|
|
305
|
+
popupShow.value = true
|
|
306
|
+
pickerValue.value = props.modelValue
|
|
307
|
+
displayColumns.value = resetColumns.value
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* 点击取消按钮触发。关闭popup,触发cancel事件。
|
|
312
|
+
*/
|
|
313
|
+
function onCancel() {
|
|
314
|
+
popupShow.value = false
|
|
315
|
+
emit('cancel')
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* 点击确定按钮触发。展示选中值,触发cancel事件。
|
|
319
|
+
*/
|
|
320
|
+
function onConfirm() {
|
|
321
|
+
if (isLoading.value) return
|
|
322
|
+
|
|
323
|
+
// 如果当前还在滑动且未停止下来,则锁住先不确认,等滑完再自动确认,避免pickview值未更新
|
|
324
|
+
if (isPicking.value) {
|
|
325
|
+
hasConfirmed.value = true
|
|
326
|
+
return
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
const { beforeConfirm } = props
|
|
330
|
+
if (beforeConfirm && isFunction(beforeConfirm)) {
|
|
331
|
+
beforeConfirm(
|
|
332
|
+
pickerValue.value,
|
|
333
|
+
(isPass: boolean) => {
|
|
334
|
+
isPass && handleConfirm()
|
|
335
|
+
},
|
|
336
|
+
proxy.$.exposed,
|
|
337
|
+
)
|
|
338
|
+
} else {
|
|
339
|
+
handleConfirm()
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function handleConfirm() {
|
|
343
|
+
if (isLoading.value || props.disabled) {
|
|
344
|
+
popupShow.value = false
|
|
345
|
+
return
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
const selects = pickerViewWd.value!.getSelects()
|
|
349
|
+
const values = pickerViewWd.value!.getValues()
|
|
350
|
+
// 获取当前的数据源,并设置给 resetColumns,用于取消时可以回退数据源
|
|
351
|
+
const columns = pickerViewWd.value!.getColumnsData()
|
|
352
|
+
popupShow.value = false
|
|
353
|
+
resetColumns.value = deepClone(columns)
|
|
354
|
+
emit('update:modelValue', values)
|
|
355
|
+
|
|
356
|
+
setShowValue(selects)
|
|
357
|
+
emit('confirm', {
|
|
358
|
+
value: values,
|
|
359
|
+
selectedItems: selects,
|
|
360
|
+
})
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* 初始change事件
|
|
364
|
+
* @param event
|
|
365
|
+
*/
|
|
366
|
+
function pickerViewChange({ value }: any) {
|
|
367
|
+
pickerValue.value = value
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* 设置展示值
|
|
371
|
+
* @param items
|
|
372
|
+
*/
|
|
373
|
+
function setShowValue(items: ColumnItem | ColumnItem[]) {
|
|
374
|
+
// 避免值为空时调用自定义展示函数
|
|
375
|
+
if ((isArray(items) && !items.length) || !items) return
|
|
376
|
+
|
|
377
|
+
const { valueKey, labelKey } = props
|
|
378
|
+
showValue.value = (props.displayFormat || defaultDisplayFormat)(items, { valueKey, labelKey })
|
|
379
|
+
}
|
|
380
|
+
function noop() {}
|
|
381
|
+
function onPickStart() {
|
|
382
|
+
isPicking.value = true
|
|
383
|
+
}
|
|
384
|
+
function onPickEnd() {
|
|
385
|
+
isPicking.value = false
|
|
386
|
+
|
|
387
|
+
if (hasConfirmed.value) {
|
|
388
|
+
hasConfirmed.value = false
|
|
389
|
+
onConfirm()
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* 外部设置是否loading
|
|
395
|
+
* @param loading 是否loading
|
|
396
|
+
*/
|
|
397
|
+
function setLoading(loading: boolean) {
|
|
398
|
+
innerLoading.value = loading
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
defineExpose<PickerExpose>({
|
|
402
|
+
close,
|
|
403
|
+
open,
|
|
404
|
+
setLoading,
|
|
405
|
+
})
|
|
406
|
+
</script>
|
|
407
|
+
<style lang="scss" scoped>
|
|
408
|
+
@import './index.scss';
|
|
409
|
+
</style>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@import './../common/abstracts/_mixin';
|
|
2
|
+
@import './../common/abstracts/variable';
|
|
3
|
+
|
|
4
|
+
.wot-theme-dark {
|
|
5
|
+
@include b(picker-view) {
|
|
6
|
+
@include e(columns) {
|
|
7
|
+
background: $-dark-background2;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:deep(.wd-picker-view__roller) {
|
|
11
|
+
background: $-dark-background4;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@include b(picker-view-column) {
|
|
16
|
+
color: $-dark-color;
|
|
17
|
+
|
|
18
|
+
@include e(item) {
|
|
19
|
+
@include m(disabled) {
|
|
20
|
+
color: $-dark-color-gray;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@include b(picker-view) {
|
|
27
|
+
position: relative;
|
|
28
|
+
padding: 10px 0;
|
|
29
|
+
|
|
30
|
+
@include e(columns) {
|
|
31
|
+
position: relative;
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
background: $-picker-bg;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@include edeep(mask) {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 0;
|
|
41
|
+
left: 0;
|
|
42
|
+
z-index: 2;
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
pointer-events: none;
|
|
46
|
+
background: $-picker-mask;
|
|
47
|
+
filter: blur(4px);
|
|
48
|
+
background-repeat: no-repeat;
|
|
49
|
+
background-position: top, bottom;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include e(loading) {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 0;
|
|
55
|
+
right: 0;
|
|
56
|
+
bottom: 0;
|
|
57
|
+
left: 0;
|
|
58
|
+
z-index: 3;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
background: $-picker-loading-bg;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@include edeep(roller) {
|
|
66
|
+
z-index: 0;
|
|
67
|
+
background: rgba(245, 245, 245, 1);
|
|
68
|
+
|
|
69
|
+
&::before,
|
|
70
|
+
&::after {
|
|
71
|
+
display: none;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@include b(picker-view-column) {
|
|
77
|
+
flex: 1;
|
|
78
|
+
font-size: $-picker-column-fs;
|
|
79
|
+
color: $-picker-column-color;
|
|
80
|
+
text-align: center;
|
|
81
|
+
transition-timing-function: cubic-bezier(0.28, 0.8, 0.63, 1);
|
|
82
|
+
|
|
83
|
+
@include e(item) {
|
|
84
|
+
padding: $-picker-column-padding;
|
|
85
|
+
@include lineEllipsis;
|
|
86
|
+
|
|
87
|
+
@include m(disabled) {
|
|
88
|
+
color: $-picker-column-disabled-color;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|