@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,153 @@
|
|
|
1
|
+
@import '../common/abstracts/variable';
|
|
2
|
+
@import '../common/abstracts/mixin';
|
|
3
|
+
|
|
4
|
+
@include b(swiper-nav) {
|
|
5
|
+
@include e(btn) {
|
|
6
|
+
@include m(prev, next) {
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 50%;
|
|
9
|
+
width: $-swiper-nav-btn-size;
|
|
10
|
+
height: $-swiper-nav-btn-size;
|
|
11
|
+
background: $-swiper-nav-btn-bg-color;
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
transform: translateY(-50%);
|
|
14
|
+
|
|
15
|
+
&::after {
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 50%;
|
|
18
|
+
left: 50%;
|
|
19
|
+
display: block;
|
|
20
|
+
width: 12rpx;
|
|
21
|
+
height: 12rpx;
|
|
22
|
+
content: '';
|
|
23
|
+
border-color: $-swiper-nav-btn-color;
|
|
24
|
+
border-style: solid;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@include m(prev) {
|
|
29
|
+
left: 30rpx;
|
|
30
|
+
|
|
31
|
+
&::after {
|
|
32
|
+
margin-left: 4rpx;
|
|
33
|
+
border-width: 2rpx 0 0 2rpx;
|
|
34
|
+
transform: translate(-50%, -50%) rotateZ(-45deg);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@include m(next) {
|
|
39
|
+
right: 30rpx;
|
|
40
|
+
|
|
41
|
+
&::after {
|
|
42
|
+
margin-left: -4rpx;
|
|
43
|
+
border-width: 2rpx 2rpx 0 0;
|
|
44
|
+
transform: translate(-50%, -50%) rotateZ(45deg);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@include m(dots, dots-bar) {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: row;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@include m(fraction) {
|
|
55
|
+
height: $-swiper-nav-fraction-height;
|
|
56
|
+
padding: 0 16rpx;
|
|
57
|
+
font-size: $-swiper-nav-fraction-font-size;
|
|
58
|
+
line-height: $-swiper-nav-fraction-height;
|
|
59
|
+
color: $-swiper-nav-fraction-color;
|
|
60
|
+
background: $-swiper-nav-fraction-bg-color;
|
|
61
|
+
border-radius: calc($-swiper-nav-fraction-height / 2);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include e(item) {
|
|
65
|
+
@include m(dots, dots-bar) {
|
|
66
|
+
width: $-swiper-nav-dot-size;
|
|
67
|
+
height: $-swiper-nav-dot-size;
|
|
68
|
+
margin: 0 10rpx;
|
|
69
|
+
background: $-swiper-nav-dot-color;
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
transition: all 0.4s ease-in;
|
|
72
|
+
|
|
73
|
+
@include when(vertical) {
|
|
74
|
+
margin: 10rpx 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@include when(active) {
|
|
78
|
+
background-color: $-swiper-nav-dot-active-color;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@include m(dots-bar) {
|
|
83
|
+
@include when(vertical) {
|
|
84
|
+
@include when(active) {
|
|
85
|
+
width: $-swiper-nav-dot-size;
|
|
86
|
+
height: $-swiper-nav-dots-bar-active-width;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@include when(active) {
|
|
91
|
+
width: $-swiper-nav-dots-bar-active-width;
|
|
92
|
+
background-color: $-swiper-nav-dot-active-color;
|
|
93
|
+
border-radius: calc($-swiper-nav-dot-size / 2);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@include m(left) {
|
|
99
|
+
position: absolute;
|
|
100
|
+
top: 50%;
|
|
101
|
+
left: 24rpx;
|
|
102
|
+
transform: translateY(-50%);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@include m(right) {
|
|
106
|
+
position: absolute;
|
|
107
|
+
top: 50%;
|
|
108
|
+
right: 24rpx;
|
|
109
|
+
transform: translateY(-50%);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@include m(top-left) {
|
|
113
|
+
position: absolute;
|
|
114
|
+
top: 24rpx;
|
|
115
|
+
left: 24rpx;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@include m(top) {
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: 24rpx;
|
|
121
|
+
left: 50%;
|
|
122
|
+
transform: translateX(-50%);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@include m(top-right) {
|
|
126
|
+
position: absolute;
|
|
127
|
+
top: 24rpx;
|
|
128
|
+
right: 24rpx;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@include m(bottom-left) {
|
|
132
|
+
position: absolute;
|
|
133
|
+
bottom: 24rpx;
|
|
134
|
+
left: 24rpx;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@include m(bottom) {
|
|
138
|
+
position: absolute;
|
|
139
|
+
bottom: 24rpx;
|
|
140
|
+
left: 50%;
|
|
141
|
+
transform: translateX(-50%);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@include m(bottom-right) {
|
|
145
|
+
position: absolute;
|
|
146
|
+
right: 24rpx;
|
|
147
|
+
bottom: 24rpx;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@include m(vertical) {
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeNumberProp, makeStringProp } from '../common/props'
|
|
3
|
+
import type { DirectionType, IndicatorPositionType } from '../wd-swiper/types'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 指示器类型,点状(dots)、点条状(dots-bar)、分式(fraction)等
|
|
7
|
+
*/
|
|
8
|
+
export type SwiperIndicatorType = 'dots' | 'dots-bar' | 'fraction'
|
|
9
|
+
|
|
10
|
+
export const swiperNavprops = {
|
|
11
|
+
...baseProps,
|
|
12
|
+
/**
|
|
13
|
+
* 当前轮播在哪一项(下标)
|
|
14
|
+
*/
|
|
15
|
+
current: makeNumberProp(0),
|
|
16
|
+
/**
|
|
17
|
+
* 轮播滑动方向,包括横向滑动和纵向滑动两个方向
|
|
18
|
+
*/
|
|
19
|
+
direction: makeStringProp<DirectionType>('horizontal'),
|
|
20
|
+
/**
|
|
21
|
+
* 小于这个数字不会显示导航器
|
|
22
|
+
*/
|
|
23
|
+
minShowNum: makeNumberProp(2),
|
|
24
|
+
/**
|
|
25
|
+
* 指示器位置
|
|
26
|
+
*/
|
|
27
|
+
indicatorPosition: makeStringProp<IndicatorPositionType>('bottom'),
|
|
28
|
+
/**
|
|
29
|
+
* 是否显示两侧的控制按钮
|
|
30
|
+
*/
|
|
31
|
+
showControls: makeBooleanProp(false),
|
|
32
|
+
/**
|
|
33
|
+
* 总共的项数
|
|
34
|
+
*/
|
|
35
|
+
total: makeNumberProp(0),
|
|
36
|
+
/**
|
|
37
|
+
* 指示器类型,点状(dots)、点条状(dots-bar)、分式(fraction)等
|
|
38
|
+
*/
|
|
39
|
+
type: makeStringProp<SwiperIndicatorType>('dots'),
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type SwiperNavProps = ExtractPropTypes<typeof swiperNavprops>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view v-if="showControls" class="wd-swiper-nav__btn">
|
|
3
|
+
<view class="wd-swiper-nav__btn--prev" @click="handleNav('prev')" />
|
|
4
|
+
<view class="wd-swiper-nav__btn--next" @click="handleNav('next')" />
|
|
5
|
+
</view>
|
|
6
|
+
<view
|
|
7
|
+
v-if="total >= minShowNum"
|
|
8
|
+
:style="customStyle"
|
|
9
|
+
:class="`wd-swiper-nav wd-swiper-nav--${direction} wd-swiper-nav--${type} wd-swiper-nav--${indicatorPosition} ${customClass}`"
|
|
10
|
+
>
|
|
11
|
+
<block v-if="type === 'dots' || type === 'dots-bar'">
|
|
12
|
+
<view
|
|
13
|
+
v-for="(item, index) in total"
|
|
14
|
+
:key="index"
|
|
15
|
+
:class="`wd-swiper-nav__item--${type} ${current === index ? 'is-active' : ''} is-${direction}`"
|
|
16
|
+
></view>
|
|
17
|
+
</block>
|
|
18
|
+
<block v-if="type === 'fraction'">{{ current + 1 }}/{{ total }}</block>
|
|
19
|
+
</view>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script lang="ts" setup>
|
|
23
|
+
import { swiperNavprops } from './types'
|
|
24
|
+
|
|
25
|
+
defineProps(swiperNavprops)
|
|
26
|
+
|
|
27
|
+
const emit = defineEmits(['change'])
|
|
28
|
+
|
|
29
|
+
function handleNav(dir: 'prev' | 'next') {
|
|
30
|
+
const source: string = 'nav'
|
|
31
|
+
emit('change', { dir, source })
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style lang="scss" scoped>
|
|
36
|
+
@import './index';
|
|
37
|
+
</style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@import '../common/abstracts/variable';
|
|
2
|
+
@import '../common/abstracts/mixin';
|
|
3
|
+
|
|
4
|
+
@include b(switch) {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: inline-block;
|
|
7
|
+
width: $-switch-width;
|
|
8
|
+
height: $-switch-height;
|
|
9
|
+
font-size: $-switch-size;
|
|
10
|
+
background: $-switch-inactive-color;
|
|
11
|
+
border-radius: $-switch-circle-size;
|
|
12
|
+
transition: all 0.3s;
|
|
13
|
+
|
|
14
|
+
@include e(checkbox) {
|
|
15
|
+
position: absolute;
|
|
16
|
+
width: 0;
|
|
17
|
+
height: 0;
|
|
18
|
+
margin: 0;
|
|
19
|
+
opacity: 0;
|
|
20
|
+
}
|
|
21
|
+
@include e(circle) {
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 2px;
|
|
24
|
+
left: 2px;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
display: inline-block;
|
|
27
|
+
width: $-switch-circle-size;
|
|
28
|
+
height: $-switch-circle-size;
|
|
29
|
+
background: #fff;
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
box-shadow: 0 2px 4px 0 $-switch-inactive-shadow-color;
|
|
32
|
+
transition: left 0.3s ease-out;
|
|
33
|
+
|
|
34
|
+
&::after {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 50%;
|
|
37
|
+
left: 50%;
|
|
38
|
+
width: calc(200% - 2px);
|
|
39
|
+
height: calc(200% - 2px);
|
|
40
|
+
content: '';
|
|
41
|
+
border: 1px solid $-switch-border-color;
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
transform: translate(-50%, -50%) scale(0.5);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
@include when(checked) {
|
|
47
|
+
background: $-switch-active-color;
|
|
48
|
+
border-color: $-switch-active-color;
|
|
49
|
+
|
|
50
|
+
.wd-switch__circle {
|
|
51
|
+
left: calc($-switch-width - $-switch-circle-size - 2px);
|
|
52
|
+
box-shadow: 0 2px 4px 0 $-switch-active-shadow-color;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
@include when(disabled) {
|
|
56
|
+
opacity: 0.5;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeNumberProp, makeNumericProp } from '../common/props'
|
|
3
|
+
|
|
4
|
+
export type SwitchBeforeChangeOption = {
|
|
5
|
+
value: number | string | boolean
|
|
6
|
+
resolve: (pass: boolean) => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type SwitchBeforeChange = (option: SwitchBeforeChangeOption) => void
|
|
10
|
+
|
|
11
|
+
export const switchProps = {
|
|
12
|
+
...baseProps,
|
|
13
|
+
/**
|
|
14
|
+
* 绑定值
|
|
15
|
+
*/
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: [Boolean, String, Number],
|
|
18
|
+
required: true,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* 是否禁用
|
|
23
|
+
*/
|
|
24
|
+
disabled: makeBooleanProp(false),
|
|
25
|
+
/**
|
|
26
|
+
* 激活值
|
|
27
|
+
*/
|
|
28
|
+
activeValue: {
|
|
29
|
+
type: [Boolean, String, Number],
|
|
30
|
+
default: true,
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* 非激活值
|
|
34
|
+
*/
|
|
35
|
+
inactiveValue: {
|
|
36
|
+
type: [Boolean, String, Number],
|
|
37
|
+
default: false,
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* 激活颜色
|
|
41
|
+
*/
|
|
42
|
+
activeColor: String,
|
|
43
|
+
/**
|
|
44
|
+
* 非激活颜色
|
|
45
|
+
*/
|
|
46
|
+
inactiveColor: String,
|
|
47
|
+
/**
|
|
48
|
+
* 大小
|
|
49
|
+
*/
|
|
50
|
+
size: makeNumericProp(28),
|
|
51
|
+
/**
|
|
52
|
+
* 在改变前执行的函数
|
|
53
|
+
*/
|
|
54
|
+
beforeChange: Function as PropType<SwitchBeforeChange>,
|
|
55
|
+
}
|
|
56
|
+
export type SwitchProps = ExtractPropTypes<typeof switchProps>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="rootClass" :style="rootStyle" @click="switchValue">
|
|
3
|
+
<view class="wd-switch__circle" :style="circleStyle"></view>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
export default {
|
|
8
|
+
name: 'wd-switch',
|
|
9
|
+
options: {
|
|
10
|
+
addGlobalClass: true,
|
|
11
|
+
virtualHost: true,
|
|
12
|
+
styleIsolation: 'shared',
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { computed, onBeforeMount } from 'vue'
|
|
19
|
+
import { addUnit, isFunction, objToStyle } from '../common/util'
|
|
20
|
+
import { switchProps } from './types'
|
|
21
|
+
|
|
22
|
+
const props = defineProps(switchProps)
|
|
23
|
+
const emit = defineEmits(['change', 'update:modelValue'])
|
|
24
|
+
|
|
25
|
+
const rootClass = computed(() => {
|
|
26
|
+
return `wd-switch ${props.customClass} ${props.disabled ? 'is-disabled' : ''} ${props.modelValue === props.activeValue ? 'is-checked' : ''}`
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const rootStyle = computed(() => {
|
|
30
|
+
const rootStyle: Record<string, any> = {
|
|
31
|
+
'font-size': addUnit(props.size),
|
|
32
|
+
background: props.modelValue === props.activeValue ? props.activeColor : props.inactiveColor,
|
|
33
|
+
'border-color':
|
|
34
|
+
props.modelValue === props.activeValue ? props.activeColor : props.inactiveColor,
|
|
35
|
+
}
|
|
36
|
+
return `${objToStyle(rootStyle)};${props.customStyle}`
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const circleStyle = computed(() => {
|
|
40
|
+
const circleStyle: string =
|
|
41
|
+
(props.modelValue === props.activeValue && props.activeColor) ||
|
|
42
|
+
(props.modelValue !== props.activeValue && props.inactiveColor)
|
|
43
|
+
? 'box-shadow: none;'
|
|
44
|
+
: ''
|
|
45
|
+
return circleStyle
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
function switchValue() {
|
|
49
|
+
if (props.disabled) return
|
|
50
|
+
const newVal = props.modelValue === props.activeValue ? props.inactiveValue : props.activeValue
|
|
51
|
+
|
|
52
|
+
if (props.beforeChange && isFunction(props.beforeChange)) {
|
|
53
|
+
props.beforeChange({
|
|
54
|
+
value: newVal,
|
|
55
|
+
resolve: (pass: boolean) => {
|
|
56
|
+
if (pass) {
|
|
57
|
+
emit('update:modelValue', newVal)
|
|
58
|
+
emit('change', {
|
|
59
|
+
value: newVal,
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
} else {
|
|
65
|
+
emit('update:modelValue', newVal)
|
|
66
|
+
emit('change', {
|
|
67
|
+
value: newVal,
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
onBeforeMount(() => {
|
|
73
|
+
if ([props.activeValue, props.inactiveValue].indexOf(props.modelValue) === -1) {
|
|
74
|
+
emit('update:modelValue', props.inactiveValue)
|
|
75
|
+
emit('change', {
|
|
76
|
+
value: props.inactiveValue,
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
</script>
|
|
81
|
+
<style lang="scss" scoped>
|
|
82
|
+
@import './index';
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, numericProp } from '../common/props'
|
|
3
|
+
|
|
4
|
+
export const tabProps = {
|
|
5
|
+
...baseProps,
|
|
6
|
+
/**
|
|
7
|
+
* 唯一标识符
|
|
8
|
+
*/
|
|
9
|
+
name: numericProp,
|
|
10
|
+
/**
|
|
11
|
+
* tab的标题
|
|
12
|
+
*/
|
|
13
|
+
title: String,
|
|
14
|
+
/**
|
|
15
|
+
* 是否禁用,无法点击
|
|
16
|
+
*/
|
|
17
|
+
disabled: makeBooleanProp(false),
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type TabProps = ExtractPropTypes<typeof tabProps>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="`wd-tab ${customClass}`" :style="customStyle">
|
|
3
|
+
<view v-if="painted" class="wd-tab__body" :style="isShow ? '' : 'display: none;'">
|
|
4
|
+
<slot />
|
|
5
|
+
</view>
|
|
6
|
+
</view>
|
|
7
|
+
</template>
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default {
|
|
10
|
+
name: 'wd-tab',
|
|
11
|
+
options: {
|
|
12
|
+
addGlobalClass: true,
|
|
13
|
+
virtualHost: true,
|
|
14
|
+
styleIsolation: 'shared',
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { getCurrentInstance, ref, watch, computed } from 'vue'
|
|
20
|
+
import { isDef, isNumber, isString } from '../common/util'
|
|
21
|
+
import { useParent } from '../composables/useParent'
|
|
22
|
+
import { TABS_KEY } from '../wd-tabs/types'
|
|
23
|
+
import { tabProps } from './types'
|
|
24
|
+
|
|
25
|
+
const props = defineProps(tabProps)
|
|
26
|
+
|
|
27
|
+
const painted = ref<boolean>(false) // 初始状态tab不会渲染,必须通过tabs来设置painted使tab渲染
|
|
28
|
+
const isShow = ref<boolean>(false)
|
|
29
|
+
const { proxy } = getCurrentInstance() as any
|
|
30
|
+
const { parent: tabs, index } = useParent(TABS_KEY)
|
|
31
|
+
|
|
32
|
+
// 激活项下标
|
|
33
|
+
const activeIndex = computed(() => {
|
|
34
|
+
return isDef(tabs) ? tabs.state.activeIndex : 0
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
watch(
|
|
38
|
+
() => props.name,
|
|
39
|
+
(newValue) => {
|
|
40
|
+
if (isDef(newValue) && !isNumber(newValue) && !isString(newValue)) {
|
|
41
|
+
console.error('[wot design] error(wd-tab): the type of name should be number or string')
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
if (tabs) {
|
|
45
|
+
checkName(proxy)
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
deep: true,
|
|
50
|
+
immediate: true,
|
|
51
|
+
},
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
watch(
|
|
55
|
+
() => activeIndex.value,
|
|
56
|
+
(newValue) => {
|
|
57
|
+
if (newValue === index.value) {
|
|
58
|
+
setShow(true, true)
|
|
59
|
+
} else {
|
|
60
|
+
setShow(painted.value, false)
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{ deep: true, immediate: true },
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @description 检测tab绑定的name是否和其它tab的name冲突
|
|
68
|
+
* @param {Object} self 自身
|
|
69
|
+
*/
|
|
70
|
+
function checkName(self: any) {
|
|
71
|
+
const { name: myName } = props
|
|
72
|
+
if (myName === undefined || myName === null || myName === '') {
|
|
73
|
+
return
|
|
74
|
+
}
|
|
75
|
+
tabs &&
|
|
76
|
+
tabs.children.forEach((child: any) => {
|
|
77
|
+
if (child.$.uid !== self.$.uid && child.name === myName) {
|
|
78
|
+
console.error(`The tab's bound value: ${myName} has been used`)
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 设置子组件展示
|
|
85
|
+
* @param setPainted
|
|
86
|
+
* @param setIsShow
|
|
87
|
+
*/
|
|
88
|
+
function setShow(setPainted: boolean, setIsShow: boolean) {
|
|
89
|
+
painted.value = setPainted
|
|
90
|
+
isShow.value = setIsShow
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
defineExpose({
|
|
94
|
+
setShow,
|
|
95
|
+
painted,
|
|
96
|
+
})
|
|
97
|
+
</script>
|
|
98
|
+
<style lang="scss" scoped>
|
|
99
|
+
@import './index';
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@import '../common/abstracts/variable';
|
|
2
|
+
@import '../common/abstracts/mixin';
|
|
3
|
+
|
|
4
|
+
.wot-theme-dark {
|
|
5
|
+
@include b(tabbar) {
|
|
6
|
+
background: $-dark-background;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@include b(tabbar) {
|
|
11
|
+
position: relative;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-wrap: nowrap;
|
|
14
|
+
align-items: center;
|
|
15
|
+
height: $-tabbar-height;
|
|
16
|
+
background: $-color-white;
|
|
17
|
+
|
|
18
|
+
@include e(placeholder) {
|
|
19
|
+
padding-bottom: constant(safe-area-inset-bottom);
|
|
20
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@include m(round) {
|
|
24
|
+
margin-right: 32rpx;
|
|
25
|
+
margin-left: 32rpx;
|
|
26
|
+
border-radius: 999px;
|
|
27
|
+
box-shadow: $-tabbar-box-shadow;
|
|
28
|
+
|
|
29
|
+
@include when(fixed) {
|
|
30
|
+
@include when(safe) {
|
|
31
|
+
bottom: constant(safe-area-inset-bottom);
|
|
32
|
+
bottom: env(safe-area-inset-bottom);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@include m(default) {
|
|
38
|
+
@include when(fixed) {
|
|
39
|
+
@include when(safe) {
|
|
40
|
+
padding-bottom: constant(safe-area-inset-bottom);
|
|
41
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@include when(border) {
|
|
46
|
+
@include halfPixelBorder('top');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@include when(fixed) {
|
|
51
|
+
position: fixed;
|
|
52
|
+
right: 0;
|
|
53
|
+
bottom: 0;
|
|
54
|
+
left: 0;
|
|
55
|
+
z-index: 500;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: weisheng
|
|
3
|
+
* @Date: 2024-03-15 20:40:34
|
|
4
|
+
* @LastEditTime: 2024-03-18 15:38:37
|
|
5
|
+
* @LastEditors: weisheng
|
|
6
|
+
* @Description:
|
|
7
|
+
* @FilePath: \wot-design-uni\src\uni_modules\wot-design-uni\components\wd-tabbar\types.ts
|
|
8
|
+
* 记得注释
|
|
9
|
+
*/
|
|
10
|
+
import { type ExtractPropTypes, type InjectionKey } from 'vue'
|
|
11
|
+
import {
|
|
12
|
+
baseProps,
|
|
13
|
+
makeBooleanProp,
|
|
14
|
+
makeNumberProp,
|
|
15
|
+
makeNumericProp,
|
|
16
|
+
makeStringProp,
|
|
17
|
+
} from '../common/props'
|
|
18
|
+
import type { TabbarItem } from '../wd-tabbar-item/types'
|
|
19
|
+
|
|
20
|
+
type TabbarShape = 'default' | 'round'
|
|
21
|
+
|
|
22
|
+
export type TabbarProvide = {
|
|
23
|
+
props: {
|
|
24
|
+
// 选中标签的索引值或者名称
|
|
25
|
+
modelValue?: number | string
|
|
26
|
+
// 是否固定在底部
|
|
27
|
+
fixed?: boolean
|
|
28
|
+
// 是否设置底部安全距离(iphone X 类型的机型)
|
|
29
|
+
safeAreaInsetBottom?: boolean
|
|
30
|
+
// 是否显示顶部边框
|
|
31
|
+
bordered?: boolean
|
|
32
|
+
// 标签栏的形状。可选项:default/round
|
|
33
|
+
shape?: TabbarShape
|
|
34
|
+
// 激活标签的颜色
|
|
35
|
+
activeColor?: string
|
|
36
|
+
// 未激活标签的颜色
|
|
37
|
+
inactiveColor?: string
|
|
38
|
+
// 固定在底部时,是否在标签位置生成一个等高的占位元素
|
|
39
|
+
placeholder?: boolean
|
|
40
|
+
// 自定义组件的层级
|
|
41
|
+
zIndex?: number
|
|
42
|
+
}
|
|
43
|
+
setChange: (child: TabbarItem) => void
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const TABBAR_KEY: InjectionKey<TabbarProvide> = Symbol('wd-tabbar')
|
|
47
|
+
|
|
48
|
+
export const tabbarProps = {
|
|
49
|
+
...baseProps,
|
|
50
|
+
/**
|
|
51
|
+
* 选中标签的索引值或者名称
|
|
52
|
+
*/
|
|
53
|
+
modelValue: makeNumericProp(0),
|
|
54
|
+
/**
|
|
55
|
+
* 是否固定在底部
|
|
56
|
+
*/
|
|
57
|
+
fixed: makeBooleanProp(false),
|
|
58
|
+
/**
|
|
59
|
+
* 是否显示顶部边框
|
|
60
|
+
*/
|
|
61
|
+
bordered: makeBooleanProp(true),
|
|
62
|
+
/**
|
|
63
|
+
* 是否设置底部安全距禿(iPhone X 类型的机型)
|
|
64
|
+
*/
|
|
65
|
+
safeAreaInsetBottom: makeBooleanProp(false),
|
|
66
|
+
/**
|
|
67
|
+
* 标签栏的形状。可选项:default/round
|
|
68
|
+
*/
|
|
69
|
+
shape: makeStringProp<TabbarShape>('default'),
|
|
70
|
+
/**
|
|
71
|
+
* 激活标签的颜色
|
|
72
|
+
*/
|
|
73
|
+
activeColor: String,
|
|
74
|
+
/**
|
|
75
|
+
* 未激活标签的颜色
|
|
76
|
+
*/
|
|
77
|
+
inactiveColor: String,
|
|
78
|
+
/**
|
|
79
|
+
* 固定在底部时,是否在标签位置生成一个等高的占位元素
|
|
80
|
+
*/
|
|
81
|
+
placeholder: makeBooleanProp(false),
|
|
82
|
+
/**
|
|
83
|
+
* 自定义组件的层级
|
|
84
|
+
*/
|
|
85
|
+
zIndex: makeNumberProp(99),
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type TabbarProps = ExtractPropTypes<typeof tabbarProps>
|