oxy-uni-ui 1.2.0 → 2.0.0
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/attributes.json +1 -1
- package/components/common/abstracts/variable.scss +396 -321
- package/components/common/path.ts +9 -0
- package/components/common/util.ts +200 -5
- package/components/composables/index.ts +1 -0
- package/components/composables/useGlobalLoading.ts +42 -0
- package/components/composables/useGlobalMessage.ts +48 -0
- package/components/composables/useGlobalToast.ts +84 -0
- package/components/composables/usePopover.ts +24 -20
- package/components/composables/useVirtualScroll.ts +13 -11
- package/components/composables/useWindowResize.ts +35 -0
- package/components/oxy-action-sheet/index.scss +24 -11
- package/components/oxy-action-sheet/oxy-action-sheet.vue +27 -19
- package/components/oxy-action-sheet/types.ts +7 -0
- package/components/oxy-backtop/index.scss +3 -3
- package/components/oxy-backtop/oxy-backtop.vue +9 -6
- package/components/oxy-backtop/types.ts +7 -7
- package/components/oxy-badge/index.scss +4 -4
- package/components/oxy-badge/oxy-badge.vue +3 -3
- package/components/oxy-badge/types.ts +2 -2
- package/components/oxy-button/index.scss +5 -5
- package/components/oxy-button/oxy-button.vue +5 -1
- package/components/oxy-calendar/index.scss +11 -11
- package/components/oxy-calendar/oxy-calendar.vue +1 -0
- package/components/oxy-calendar/types.ts +5 -0
- package/components/oxy-calendar-view/month/index.scss +4 -4
- package/components/oxy-calendar-view/month/types.ts +36 -0
- package/components/oxy-calendar-view/monthPanel/index.scss +7 -7
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
- package/components/oxy-calendar-view/year/index.scss +4 -4
- package/components/oxy-calendar-view/yearPanel/index.scss +4 -4
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +21 -5
- package/components/oxy-card/index.scss +2 -2
- package/components/oxy-cell/index.scss +8 -8
- package/components/oxy-cell/oxy-cell.vue +15 -2
- package/components/oxy-cell/types.ts +4 -0
- package/components/oxy-checkbox/index.scss +8 -8
- package/components/oxy-checkbox/oxy-checkbox.vue +2 -2
- package/components/oxy-checkbox-group/index.scss +2 -2
- package/components/oxy-circle/oxy-circle.vue +10 -7
- package/components/oxy-circle/types.ts +5 -5
- package/components/oxy-col/oxy-col.vue +2 -2
- package/components/oxy-col-picker/index.scss +4 -4
- package/components/oxy-col-picker/oxy-col-picker.vue +9 -5
- package/components/oxy-col-picker/types.ts +12 -3
- package/components/oxy-collapse/index.scss +2 -2
- package/components/oxy-collapse-item/oxy-collapse-item.vue +3 -3
- package/components/oxy-corner/index.scss +32 -32
- package/components/oxy-corner/oxy-corner.vue +15 -3
- package/components/oxy-corner/types.ts +15 -1
- package/components/oxy-count-to/oxy-count-to.vue +3 -3
- package/components/oxy-curtain/index.scss +15 -15
- package/components/oxy-curtain/oxy-curtain.vue +4 -2
- package/components/oxy-curtain/types.ts +6 -1
- package/components/oxy-date-strip/index.scss +10 -0
- package/components/oxy-date-strip/oxy-date-strip.vue +198 -0
- package/components/oxy-date-strip/types.ts +98 -0
- package/components/oxy-date-strip/utils.ts +67 -0
- package/components/oxy-date-strip-item/index.scss +94 -0
- package/components/oxy-date-strip-item/oxy-date-strip-item.vue +102 -0
- package/components/oxy-date-strip-item/types.ts +53 -0
- package/components/oxy-datetime-picker/index.scss +11 -11
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +4 -1
- package/components/oxy-datetime-picker/types.ts +10 -1
- package/components/oxy-drop-menu/index.scss +3 -3
- package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
- package/components/oxy-drop-menu-item/index.scss +1 -1
- package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +4 -3
- package/components/oxy-drop-menu-item/types.ts +5 -0
- package/components/oxy-echarts/index.scss +17 -0
- package/components/oxy-echarts/index.ts +1 -0
- package/components/oxy-echarts/oxy-echarts.vue +32 -0
- package/components/oxy-echarts/types.ts +18 -0
- package/components/oxy-fab/index.scss +8 -8
- package/components/oxy-fab/oxy-fab.vue +22 -3
- package/components/oxy-file-list/index.scss +42 -15
- package/components/oxy-file-list/oxy-file-list.vue +208 -34
- package/components/oxy-file-list/types.ts +58 -2
- package/components/oxy-floating-panel/oxy-floating-panel.vue +13 -9
- package/components/oxy-floating-panel/{type.ts → types.ts} +8 -8
- package/components/oxy-footer/index.scss +19 -0
- package/components/oxy-footer/oxy-footer.vue +78 -0
- package/components/oxy-footer/types.ts +17 -0
- package/components/oxy-form-item/types.ts +22 -1
- package/components/oxy-gap/oxy-gap.vue +2 -2
- package/components/oxy-gap/types.ts +2 -2
- package/components/oxy-global-loading/oxy-global-loading.vue +53 -0
- package/components/oxy-global-message/oxy-global-message.vue +64 -0
- package/components/oxy-global-toast/oxy-global-toast.vue +53 -0
- package/components/oxy-grid/oxy-grid.vue +1 -1
- package/components/oxy-grid/types.ts +1 -1
- package/components/oxy-grid-item/index.scss +1 -1
- package/components/oxy-grid-item/oxy-grid-item.vue +7 -5
- package/components/oxy-grid-item/types.ts +1 -1
- package/components/oxy-guidance/index.scss +75 -0
- package/components/oxy-guidance/oxy-guidance.vue +201 -0
- package/components/oxy-guidance/types.ts +33 -0
- package/components/oxy-icon/oxy-icon.vue +2 -2
- package/components/oxy-icon/types.ts +1 -1
- package/components/oxy-img/oxy-img.vue +4 -4
- package/components/oxy-img/types.ts +3 -3
- package/components/oxy-img-cropper/index.scss +12 -12
- package/components/oxy-img-cropper/oxy-img-cropper.vue +97 -52
- package/components/oxy-img-cropper/types.ts +2 -2
- package/components/oxy-img-lazy/index.scss +17 -0
- package/components/oxy-img-lazy/oxy-img-lazy.vue +332 -0
- package/components/oxy-img-lazy/types.ts +69 -0
- package/components/oxy-index-anchor/index.scss +2 -2
- package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
- package/components/oxy-index-anchor/{type.ts → types.ts} +3 -0
- package/components/oxy-index-bar/index.scss +3 -3
- package/components/oxy-index-bar/oxy-index-bar.vue +3 -3
- package/components/oxy-index-bar/{type.ts → types.ts} +2 -2
- package/components/oxy-input/index.scss +1 -1
- package/components/oxy-input-number/index.scss +5 -5
- package/components/oxy-input-number/oxy-input-number.vue +2 -2
- package/components/oxy-input-number/types.ts +3 -2
- package/components/oxy-keyboard/index.scss +5 -5
- package/components/oxy-keyboard/key/index.scss +3 -3
- package/components/oxy-keyboard/key/index.vue +2 -2
- package/components/oxy-keyboard/key/types.ts +15 -0
- package/components/oxy-keyboard/oxy-keyboard.vue +1 -0
- package/components/oxy-keyboard/types.ts +5 -0
- package/components/oxy-link/index.scss +57 -0
- package/components/oxy-link/oxy-link.vue +130 -0
- package/components/oxy-link/types.ts +81 -0
- package/components/oxy-list/index.scss +7 -1
- package/components/oxy-list/oxy-list.vue +4 -3
- package/components/oxy-list/types.ts +1 -1
- package/components/oxy-loading/oxy-loading.vue +8 -4
- package/components/oxy-loading/types.ts +1 -1
- package/components/oxy-loadmore/index.scss +3 -3
- package/components/oxy-long-press-menu/index.scss +93 -0
- package/components/oxy-long-press-menu/oxy-long-press-menu.vue +338 -0
- package/components/oxy-long-press-menu/types.ts +34 -0
- package/components/oxy-message-box/index.scss +12 -11
- package/components/oxy-message-box/oxy-message-box.vue +11 -3
- package/components/oxy-message-box/types.ts +14 -0
- package/components/oxy-navbar/index.scss +2 -2
- package/components/oxy-navbar/oxy-navbar.vue +58 -13
- package/components/oxy-navbar/types.ts +8 -1
- package/components/oxy-navbar-capsule/types.ts +3 -0
- package/components/oxy-notice-bar/index.scss +3 -3
- package/components/oxy-notice-bar/oxy-notice-bar.vue +9 -5
- package/components/oxy-notice-bar/types.ts +3 -3
- package/components/oxy-notify/index.ts +1 -0
- package/components/oxy-notify/oxy-notify.vue +3 -2
- package/components/oxy-notify/types.ts +7 -0
- package/components/oxy-pagination/index.scss +1 -1
- package/components/oxy-password-input/oxy-password-input.vue +2 -2
- package/components/oxy-password-input/types.ts +1 -1
- package/components/oxy-picker/index.scss +45 -2
- package/components/oxy-picker/oxy-picker.vue +103 -14
- package/components/oxy-picker/types.ts +33 -1
- package/components/oxy-picker-view/index.scss +3 -3
- package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
- package/components/oxy-popover/index.scss +9 -9
- package/components/oxy-popup/index.scss +2 -2
- package/components/oxy-popup/oxy-popup.vue +35 -2
- package/components/oxy-popup/types.ts +8 -1
- package/components/oxy-progress/index.scss +3 -3
- package/components/oxy-qrcode/draw.ts +398 -0
- package/components/oxy-qrcode/index.scss +2 -0
- package/components/oxy-qrcode/oxy-qrcode.vue +124 -0
- package/components/oxy-qrcode/qrcode.ts +936 -0
- package/components/oxy-qrcode/types.ts +42 -0
- package/components/oxy-radio/index.scss +13 -13
- package/components/oxy-radio/oxy-radio.vue +1 -1
- package/components/oxy-radio-group/index.scss +2 -2
- package/components/oxy-rate/types.ts +4 -4
- package/components/oxy-resize/index.scss +2 -2
- package/components/oxy-resize/oxy-resize.vue +4 -4
- package/components/oxy-resize/types.ts +3 -0
- package/components/oxy-rich-text/icon/emjio.svg +1 -0
- package/components/oxy-rich-text/icon/quote.svg +1 -0
- package/components/oxy-rich-text/icon/text.svg +1 -0
- package/components/oxy-rich-text/icon/title.svg +1 -0
- package/components/oxy-rich-text/index.scss +160 -0
- package/components/oxy-rich-text/mp-html/card/card.vue +122 -0
- package/components/oxy-rich-text/mp-html/card/index.js +7 -0
- package/components/oxy-rich-text/mp-html/editable/config.js +15 -0
- package/components/oxy-rich-text/mp-html/editable/index.js +553 -0
- package/components/oxy-rich-text/mp-html/emoji/index.js +203 -0
- package/components/oxy-rich-text/mp-html/highlight/config.js +5 -0
- package/components/oxy-rich-text/mp-html/highlight/index.js +96 -0
- package/components/oxy-rich-text/mp-html/highlight/prism.css +1 -0
- package/components/oxy-rich-text/mp-html/highlight/prism.min.js +7 -0
- package/components/oxy-rich-text/mp-html/img-cache/index.js +138 -0
- package/components/oxy-rich-text/mp-html/latex/index.js +80 -0
- package/components/oxy-rich-text/mp-html/latex/katex.css +1 -0
- package/components/oxy-rich-text/mp-html/latex/katex.min.js +1 -0
- package/components/oxy-rich-text/mp-html/markdown/index.js +50 -0
- package/components/oxy-rich-text/mp-html/markdown/marked.min.js +71 -0
- package/components/oxy-rich-text/mp-html/mp-html.d.ts +184 -0
- package/components/oxy-rich-text/mp-html/mp-html.vue +684 -0
- package/components/oxy-rich-text/mp-html/node/node.vue +1172 -0
- package/components/oxy-rich-text/mp-html/parser.js +1428 -0
- package/components/oxy-rich-text/mp-html/search/index.js +132 -0
- package/components/oxy-rich-text/mp-html/style/index.js +129 -0
- package/components/oxy-rich-text/mp-html/style/parser.js +175 -0
- package/components/oxy-rich-text/mp-html/template/index.js +67 -0
- package/components/oxy-rich-text/mp-html/txv-video/index.js +46 -0
- package/components/oxy-rich-text/oxy-rich-text.vue +642 -0
- package/components/oxy-rich-text/types.ts +76 -0
- package/components/oxy-row/oxy-row.vue +3 -3
- package/components/oxy-row/types.ts +1 -1
- package/components/oxy-search/index.scss +3 -3
- package/components/oxy-segmented/index.scss +16 -16
- package/components/oxy-segmented/oxy-segmented.vue +23 -3
- package/components/oxy-select/index.scss +331 -0
- package/components/oxy-select/oxy-select.vue +456 -0
- package/components/oxy-select/types.ts +83 -0
- package/components/oxy-select-picker/index.scss +7 -7
- package/components/oxy-select-picker/oxy-select-picker.vue +4 -0
- package/components/oxy-select-picker/types.ts +7 -1
- package/components/oxy-sidebar-item/index.scss +1 -1
- package/components/oxy-signature/oxy-signature.vue +18 -10
- package/components/oxy-signature/types.ts +106 -13
- package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
- package/components/oxy-skeleton/types.ts +1 -1
- package/components/oxy-slider/index.scss +3 -3
- package/components/oxy-sort-button/index.scss +8 -8
- package/components/oxy-status-tip/index.scss +4 -4
- package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
- package/components/oxy-status-tip/types.ts +3 -3
- package/components/oxy-step/index.scss +14 -14
- package/components/oxy-sticky/oxy-sticky.vue +6 -6
- package/components/oxy-stream-render/index.scss +6 -0
- package/components/oxy-stream-render/oxy-stream-render.vue +204 -0
- package/components/oxy-stream-render/types.ts +8 -0
- package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
- package/components/oxy-swiper/oxy-swiper.vue +6 -6
- package/components/oxy-swiper/types.ts +5 -5
- package/components/oxy-switch/index.scss +8 -8
- package/components/oxy-switch/oxy-switch.vue +2 -2
- package/components/oxy-switch/types.ts +1 -1
- package/components/oxy-tab/index.scss +11 -1
- package/components/oxy-tabbar/index.scss +1 -1
- package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
- package/components/oxy-table/index.scss +5 -5
- package/components/oxy-table/oxy-table.vue +8 -6
- package/components/oxy-table/types.ts +2 -2
- package/components/oxy-table-col/oxy-table-col.vue +3 -3
- package/components/oxy-table-col/types.ts +2 -2
- package/components/oxy-tabs/index.scss +43 -15
- package/components/oxy-tabs/oxy-tabs.vue +53 -19
- package/components/oxy-tabs/types.ts +15 -3
- package/components/oxy-tag/index.scss +15 -15
- package/components/oxy-text/index.scss +5 -1
- package/components/oxy-text/oxy-text.vue +76 -7
- package/components/oxy-text/types.ts +12 -0
- package/components/oxy-textarea/index.scss +6 -6
- package/components/oxy-toast/oxy-toast.vue +24 -8
- package/components/oxy-tooltip/index.scss +9 -9
- package/components/oxy-tree/index.scss +61 -9
- package/components/oxy-tree/oxy-tree.vue +102 -17
- package/components/oxy-tree/types.ts +23 -10
- package/components/oxy-upload/index.scss +21 -21
- package/components/oxy-upload/types.ts +2 -2
- package/components/oxy-verification-code/index.scss +6 -0
- package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
- package/components/oxy-verification-code/types.ts +82 -0
- package/components/oxy-video-preview/index.scss +4 -4
- package/components/oxy-virtual-scroll/index.scss +4 -4
- package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
- package/components/oxy-virtual-scroll/types.ts +14 -14
- package/components/oxy-voice-player/index.scss +908 -0
- package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
- package/components/oxy-voice-player/types.ts +567 -0
- package/components/oxy-waterfall/index.scss +18 -0
- package/components/oxy-waterfall/oxy-waterfall.vue +218 -0
- package/components/oxy-waterfall/types.ts +90 -0
- package/components/oxy-waterfall-item/index.scss +8 -0
- package/components/oxy-waterfall-item/oxy-waterfall-item.vue +89 -0
- package/components/oxy-waterfall-item/types.ts +16 -0
- package/components/oxy-watermark/oxy-watermark.vue +35 -13
- package/components/oxy-watermark/types.ts +14 -14
- package/global.d.ts +9 -0
- package/index.ts +3 -0
- package/locale/lang/ar-SA.ts +3 -0
- package/locale/lang/en-US.ts +29 -0
- package/locale/lang/zh-CN.ts +29 -0
- package/package.json +97 -1
- package/tags.json +1 -1
- package/uni-echarts/changelog.md +2 -0
- package/uni-echarts/components/index.js +1 -0
- package/uni-echarts/components/uni-echarts/events.js +95 -0
- package/uni-echarts/components/uni-echarts/types.d.ts +183 -0
- package/uni-echarts/components/uni-echarts/types.js +1 -0
- package/uni-echarts/components/uni-echarts/uni-echarts.vue +530 -0
- package/uni-echarts/components/uni-echarts/uni-echarts.vue.d.ts +19 -0
- package/uni-echarts/global.d.ts +7 -0
- package/uni-echarts/index.d.ts +440 -0
- package/uni-echarts/index.js +2 -0
- package/uni-echarts/package.json +105 -0
- package/uni-echarts/shared-core.d.ts +269 -0
- package/uni-echarts/shared-core.js +900 -0
- package/web-types.json +1 -1
- package/components/oxy-number-keyboard/index.scss +0 -78
- package/components/oxy-number-keyboard/key/index.scss +0 -81
- package/components/oxy-number-keyboard/key/index.vue +0 -78
- package/components/oxy-number-keyboard/key/types.ts +0 -11
- package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
- package/components/oxy-number-keyboard/types.ts +0 -83
- package/components/oxy-tree/components/tree-node-content.vue +0 -72
- package/components/oxy-tree/index.ts +0 -51
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
position: absolute;
|
|
12
12
|
top: 0;
|
|
13
13
|
right: 0;
|
|
14
|
-
width:
|
|
15
|
-
height:
|
|
14
|
+
width: 160rpx;
|
|
15
|
+
height: 160rpx;
|
|
16
16
|
overflow: hidden;
|
|
17
17
|
@include when(round) {
|
|
18
18
|
border-top-right-radius: $-corner-radius;
|
|
@@ -103,8 +103,8 @@
|
|
|
103
103
|
}
|
|
104
104
|
.oxy-corner__text {
|
|
105
105
|
transform: rotate(-45deg);
|
|
106
|
-
top:
|
|
107
|
-
left: -
|
|
106
|
+
top: 20rpx;
|
|
107
|
+
left: -52rpx;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
&.is-bottom-left{
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
}
|
|
118
118
|
.oxy-corner__text {
|
|
119
119
|
transform: rotate(-135deg);
|
|
120
|
-
bottom:
|
|
121
|
-
left: -
|
|
120
|
+
bottom: 20rpx;
|
|
121
|
+
left: -52rpx;
|
|
122
122
|
top: auto;
|
|
123
123
|
> span{
|
|
124
124
|
transform: rotate(180deg);
|
|
@@ -136,8 +136,8 @@
|
|
|
136
136
|
}
|
|
137
137
|
.oxy-corner__text {
|
|
138
138
|
transform: rotate(135deg);
|
|
139
|
-
bottom:
|
|
140
|
-
right: -
|
|
139
|
+
bottom: 20rpx;
|
|
140
|
+
right: -52rpx;
|
|
141
141
|
top: auto;
|
|
142
142
|
> span{
|
|
143
143
|
transform: rotate(180deg);
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
&.is-top-left{
|
|
150
150
|
&::after {
|
|
151
151
|
left: auto;
|
|
152
|
-
right: -
|
|
152
|
+
right: -12rpx;
|
|
153
153
|
bottom: 0;
|
|
154
154
|
transform: skewX(-30deg);
|
|
155
155
|
}
|
|
@@ -158,15 +158,15 @@
|
|
|
158
158
|
top: 0;
|
|
159
159
|
left: 0;
|
|
160
160
|
border-bottom-left-radius: 0;
|
|
161
|
-
border-bottom-right-radius:
|
|
161
|
+
border-bottom-right-radius: 64rpx;
|
|
162
162
|
padding-left: 0;
|
|
163
|
-
padding-right:
|
|
163
|
+
padding-right: 24rpx;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
&.is-bottom-left{
|
|
167
167
|
&::after {
|
|
168
168
|
left: auto;
|
|
169
|
-
right: -
|
|
169
|
+
right: -12rpx;
|
|
170
170
|
bottom: 0;
|
|
171
171
|
transform: skewX(30deg);
|
|
172
172
|
}
|
|
@@ -175,9 +175,9 @@
|
|
|
175
175
|
bottom: 0;
|
|
176
176
|
left: 0;
|
|
177
177
|
border-bottom-left-radius: 0;
|
|
178
|
-
border-top-right-radius:
|
|
178
|
+
border-top-right-radius: 64rpx;
|
|
179
179
|
padding-left: 0;
|
|
180
|
-
padding-right:
|
|
180
|
+
padding-right: 24rpx;
|
|
181
181
|
> span{
|
|
182
182
|
transform: none;
|
|
183
183
|
}
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
}
|
|
186
186
|
&.is-bottom-right{
|
|
187
187
|
&::after {
|
|
188
|
-
left: -
|
|
188
|
+
left: -12rpx;
|
|
189
189
|
bottom: 0;
|
|
190
190
|
transform: skewX(-30deg);
|
|
191
191
|
}
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
bottom: 0;
|
|
195
195
|
right: 0;
|
|
196
196
|
border-bottom-left-radius: 0;
|
|
197
|
-
border-top-left-radius:
|
|
197
|
+
border-top-left-radius: 64rpx;
|
|
198
198
|
> span{
|
|
199
199
|
transform: none;
|
|
200
200
|
}
|
|
@@ -202,13 +202,13 @@
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
.oxy-corner__text {
|
|
205
|
-
width:
|
|
206
|
-
height:
|
|
205
|
+
width: 212rpx;
|
|
206
|
+
height: 64rpx;
|
|
207
207
|
position: absolute;
|
|
208
|
-
right: -
|
|
209
|
-
top:
|
|
208
|
+
right: -52rpx;
|
|
209
|
+
top: 20rpx;
|
|
210
210
|
text-align: center;
|
|
211
|
-
line-height:
|
|
211
|
+
line-height: 64rpx;
|
|
212
212
|
overflow: hidden;
|
|
213
213
|
transform: rotate(45deg);
|
|
214
214
|
box-sizing: border-box;
|
|
@@ -219,27 +219,27 @@
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
&.is-horizontal {
|
|
222
|
-
width:
|
|
223
|
-
height:
|
|
222
|
+
width: 320rpx;
|
|
223
|
+
height: 80rpx;
|
|
224
224
|
.oxy-corner__text {
|
|
225
|
-
padding-right:
|
|
225
|
+
padding-right: 40rpx;
|
|
226
226
|
box-sizing: border-box;
|
|
227
227
|
font-size: $-corner-horizontal-font-size;
|
|
228
228
|
font-weight: $-corner-horizontal-font-weight;
|
|
229
|
-
line-height:
|
|
229
|
+
line-height: 80rpx;
|
|
230
230
|
text-align: right;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
&.is-embedded {
|
|
234
|
-
width:
|
|
235
|
-
height:
|
|
234
|
+
width: 212rpx;
|
|
235
|
+
height: 64rpx;
|
|
236
236
|
&::after {
|
|
237
237
|
content: '';
|
|
238
238
|
position: absolute;
|
|
239
|
-
left: -
|
|
239
|
+
left: -12rpx;
|
|
240
240
|
bottom: 0;
|
|
241
|
-
width:
|
|
242
|
-
height:
|
|
241
|
+
width: 32rpx;
|
|
242
|
+
height: 64rpx;
|
|
243
243
|
background-color: #ffffff;
|
|
244
244
|
transform: skewX(30deg);
|
|
245
245
|
}
|
|
@@ -247,11 +247,11 @@
|
|
|
247
247
|
right: 0;
|
|
248
248
|
top: 0;
|
|
249
249
|
transform: none;
|
|
250
|
-
padding-left:
|
|
250
|
+
padding-left: 24rpx;
|
|
251
251
|
box-sizing: border-box;
|
|
252
252
|
font-size: $-corner-embedded-font-size;
|
|
253
253
|
font-weight: $-corner-embedded-font-weight;
|
|
254
|
-
border-bottom-left-radius:
|
|
254
|
+
border-bottom-left-radius: 64rpx;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="oxy-corner">
|
|
2
|
+
<view :class="`oxy-corner ${customClass}`" :style="customStyle">
|
|
3
3
|
<slot />
|
|
4
4
|
<view v-if="text || $slots.text" :class="textClass">
|
|
5
|
-
<view class="oxy-corner__text">
|
|
5
|
+
<view class="oxy-corner__text" :style="textStyle">
|
|
6
6
|
<slot name="text">
|
|
7
7
|
<span>{{ text }}</span>
|
|
8
8
|
</slot>
|
|
@@ -22,6 +22,7 @@ export default {
|
|
|
22
22
|
}
|
|
23
23
|
</script>
|
|
24
24
|
<script lang="ts" setup>
|
|
25
|
+
import { objToStyle } from '../common/util'
|
|
25
26
|
import { computed, ref, watch } from 'vue'
|
|
26
27
|
import { cornerProps } from './types'
|
|
27
28
|
|
|
@@ -49,7 +50,18 @@ watch(
|
|
|
49
50
|
)
|
|
50
51
|
|
|
51
52
|
const textClass = computed(() => {
|
|
52
|
-
return `oxy-corner__box ${
|
|
53
|
+
return `oxy-corner__box ${cornerClass.value}`
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const textStyle = computed(() => {
|
|
57
|
+
const textStyle: Record<string, any> = {}
|
|
58
|
+
if (props.color) {
|
|
59
|
+
textStyle['color'] = props.color
|
|
60
|
+
}
|
|
61
|
+
if (props.bgColor) {
|
|
62
|
+
textStyle['background'] = props.bgColor
|
|
63
|
+
}
|
|
64
|
+
return objToStyle(textStyle)
|
|
53
65
|
})
|
|
54
66
|
|
|
55
67
|
function computeCornerClass() {
|
|
@@ -44,7 +44,21 @@ export const cornerProps = {
|
|
|
44
44
|
* 类型:string
|
|
45
45
|
* 默认值:空字符串
|
|
46
46
|
*/
|
|
47
|
-
text: makeStringProp('')
|
|
47
|
+
text: makeStringProp(''),
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 文字颜色
|
|
51
|
+
* 类型:string
|
|
52
|
+
* 默认值:空字符串
|
|
53
|
+
*/
|
|
54
|
+
color: makeStringProp(''),
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 背景色和边框色
|
|
58
|
+
* 类型:string
|
|
59
|
+
* 默认值:空字符串
|
|
60
|
+
*/
|
|
61
|
+
bgColor: makeStringProp('')
|
|
48
62
|
}
|
|
49
63
|
|
|
50
64
|
export type CornerProps = ExtractPropTypes<typeof cornerProps>
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
<view :class="rootClass">
|
|
3
3
|
<!-- 前缀插槽 -->
|
|
4
4
|
<slot name="prefix">
|
|
5
|
-
<oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize *
|
|
5
|
+
<oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize * 1.4}rpx`" :text="props.prefix"></oxy-text>
|
|
6
6
|
</slot>
|
|
7
7
|
<!-- 默认文本插槽 -->
|
|
8
8
|
<slot>
|
|
9
|
-
<oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize}
|
|
9
|
+
<oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize * 2}rpx`" :text="timeText"></oxy-text>
|
|
10
10
|
</slot>
|
|
11
11
|
<!-- 后缀插槽 -->
|
|
12
12
|
<slot name="suffix">
|
|
13
|
-
<oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize *
|
|
13
|
+
<oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize * 1.4}rpx`" :text="props.suffix"></oxy-text>
|
|
14
14
|
</slot>
|
|
15
15
|
</view>
|
|
16
16
|
</template>
|
|
@@ -33,53 +33,53 @@
|
|
|
33
33
|
@include edeep(content-close) {
|
|
34
34
|
position: absolute;
|
|
35
35
|
margin: 0;
|
|
36
|
-
padding:
|
|
37
|
-
top:
|
|
38
|
-
right:
|
|
36
|
+
padding: 12rpx;
|
|
37
|
+
top: 20rpx;
|
|
38
|
+
right: 20rpx;
|
|
39
39
|
color: $-curtain-content-close-color;
|
|
40
40
|
font-size: $-curtain-content-close-fs;
|
|
41
41
|
-webkit-tap-highlight-color: transparent;
|
|
42
42
|
&.top {
|
|
43
|
-
margin: 0 0 0 -
|
|
44
|
-
top: -
|
|
43
|
+
margin: 0 0 0 -36rpx;
|
|
44
|
+
top: -124rpx;
|
|
45
45
|
right: unset;
|
|
46
46
|
left: 50%;
|
|
47
47
|
bottom: unset;
|
|
48
48
|
}
|
|
49
49
|
&.top-left {
|
|
50
50
|
margin: 0;
|
|
51
|
-
top: -
|
|
51
|
+
top: -124rpx;
|
|
52
52
|
right: unset;
|
|
53
|
-
left: -
|
|
53
|
+
left: -12rpx;
|
|
54
54
|
bottom: unset;
|
|
55
55
|
}
|
|
56
56
|
&.top-right {
|
|
57
57
|
margin: 0;
|
|
58
|
-
top: -
|
|
59
|
-
right: -
|
|
58
|
+
top: -124rpx;
|
|
59
|
+
right: -12rpx;
|
|
60
60
|
left: unset;
|
|
61
61
|
bottom: unset;
|
|
62
62
|
}
|
|
63
63
|
&.bottom {
|
|
64
|
-
margin: 0 0 0 -
|
|
64
|
+
margin: 0 0 0 -36rpx;
|
|
65
65
|
top: unset;
|
|
66
66
|
right: unset;
|
|
67
67
|
left: 50%;
|
|
68
|
-
bottom: -
|
|
68
|
+
bottom: -124rpx;
|
|
69
69
|
}
|
|
70
70
|
&.bottom-left {
|
|
71
71
|
margin: 0;
|
|
72
72
|
top: unset;
|
|
73
73
|
right: unset;
|
|
74
|
-
left: -
|
|
75
|
-
bottom: -
|
|
74
|
+
left: -12rpx;
|
|
75
|
+
bottom: -124rpx;
|
|
76
76
|
}
|
|
77
77
|
&.bottom-right {
|
|
78
78
|
margin: 0;
|
|
79
79
|
top: unset;
|
|
80
|
-
right: -
|
|
80
|
+
right: -12rpx;
|
|
81
81
|
left: unset;
|
|
82
|
-
bottom: -
|
|
82
|
+
bottom: -124rpx;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
position="center"
|
|
7
7
|
:close-on-click-modal="closeOnClickModal"
|
|
8
8
|
:hide-when-close="hideWhenClose"
|
|
9
|
+
:max-width="popupMaxWidth"
|
|
9
10
|
:z-index="zIndex"
|
|
10
11
|
:root-portal="rootPortal"
|
|
11
12
|
@before-enter="beforeenter"
|
|
@@ -57,6 +58,7 @@ export default {
|
|
|
57
58
|
import OxyIcon from '../oxy-icon/oxy-icon.vue'
|
|
58
59
|
import OxyPopup from '../oxy-popup/oxy-popup.vue'
|
|
59
60
|
import { computed, ref, watch } from 'vue'
|
|
61
|
+
import { withDefaultUnit } from '../common/util'
|
|
60
62
|
import { curtainProps } from './types'
|
|
61
63
|
|
|
62
64
|
const props = defineProps(curtainProps)
|
|
@@ -105,8 +107,8 @@ const imgScale = ref<number>(1)
|
|
|
105
107
|
const imgStyle = computed(() => {
|
|
106
108
|
let style = ''
|
|
107
109
|
if (props.width) {
|
|
108
|
-
style += `width: ${props.width}
|
|
109
|
-
style += `height: ${props.width / imgScale.value}
|
|
110
|
+
style += `width: ${withDefaultUnit(props.width)};`
|
|
111
|
+
style += `height: ${withDefaultUnit(props.width / imgScale.value)}`
|
|
110
112
|
}
|
|
111
113
|
return style
|
|
112
114
|
})
|
|
@@ -27,7 +27,7 @@ export const curtainProps = {
|
|
|
27
27
|
*/
|
|
28
28
|
to: String,
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* 幕帘图片宽度,number 类型按 `rpx` 语义处理
|
|
31
31
|
*/
|
|
32
32
|
width: Number,
|
|
33
33
|
/**
|
|
@@ -44,6 +44,11 @@ export const curtainProps = {
|
|
|
44
44
|
* 默认值:10
|
|
45
45
|
*/
|
|
46
46
|
zIndex: makeNumberProp(10),
|
|
47
|
+
/**
|
|
48
|
+
* 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;
|
|
49
|
+
* `%` 在弹层打开时按屏幕宽度换算为 `rpx`
|
|
50
|
+
*/
|
|
51
|
+
popupMaxWidth: makeStringProp('1200rpx'),
|
|
47
52
|
/**
|
|
48
53
|
* 自定义关闭按钮的类名
|
|
49
54
|
* 类型:string
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<scroll-view
|
|
3
|
+
:class="`oxy-date-strip oxy-date-strip__scroll ${customClass}`"
|
|
4
|
+
:scroll-x="true"
|
|
5
|
+
:scroll-left="scrollLeft"
|
|
6
|
+
:show-scrollbar="false"
|
|
7
|
+
direction="horizontal"
|
|
8
|
+
:style="rootStyle"
|
|
9
|
+
v-if="switchMode === 'none'"
|
|
10
|
+
>
|
|
11
|
+
<oxy-date-strip-item
|
|
12
|
+
:dates="displayWeeks[0].dates"
|
|
13
|
+
:color="color"
|
|
14
|
+
:activeBgColor="activeBgColor"
|
|
15
|
+
:activeColor="activeColor"
|
|
16
|
+
:bgColor="bgColor"
|
|
17
|
+
:radius="radius"
|
|
18
|
+
:switchMode="switchMode"
|
|
19
|
+
:shape="shape"
|
|
20
|
+
@click="onClick"
|
|
21
|
+
></oxy-date-strip-item>
|
|
22
|
+
</scroll-view>
|
|
23
|
+
<swiper
|
|
24
|
+
v-else
|
|
25
|
+
:class="`oxy-date-strip ${customClass}`"
|
|
26
|
+
:style="rootStyle"
|
|
27
|
+
:current="currentWeekIndex"
|
|
28
|
+
:circular="swiperCircular"
|
|
29
|
+
@change="swiperChange"
|
|
30
|
+
>
|
|
31
|
+
<swiper-item v-for="(week, g) in displayWeeks" :key="g">
|
|
32
|
+
<oxy-date-strip-item
|
|
33
|
+
:dates="week.dates"
|
|
34
|
+
:color="color"
|
|
35
|
+
:activeBgColor="activeBgColor"
|
|
36
|
+
:activeColor="activeColor"
|
|
37
|
+
:bgColor="bgColor"
|
|
38
|
+
:radius="radius"
|
|
39
|
+
:switchMode="switchMode"
|
|
40
|
+
:shape="shape"
|
|
41
|
+
@click="onClick"
|
|
42
|
+
></oxy-date-strip-item>
|
|
43
|
+
</swiper-item>
|
|
44
|
+
</swiper>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script lang="ts">
|
|
48
|
+
export default {
|
|
49
|
+
name: 'oxy-date-strip',
|
|
50
|
+
options: {
|
|
51
|
+
addGlobalClass: true,
|
|
52
|
+
virtualHost: true,
|
|
53
|
+
styleIsolation: 'shared'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<script lang="ts" setup>
|
|
59
|
+
import OxyDateStripItem from '../oxy-date-strip-item/oxy-date-strip-item.vue'
|
|
60
|
+
import { ref, computed, watch, onMounted, nextTick, reactive } from 'vue'
|
|
61
|
+
import { objToStyle, unitConvertWithDefault } from '../common/util'
|
|
62
|
+
import { getWeekRange, addDays, addWeeks, calcType, daysBetween } from './utils'
|
|
63
|
+
import { dateStripProps, type WeekDateCollection, type DateStriPDay } from './types'
|
|
64
|
+
|
|
65
|
+
const props = defineProps(dateStripProps)
|
|
66
|
+
const emit = defineEmits(['change', 'select', 'update:modelValue', 'input'])
|
|
67
|
+
|
|
68
|
+
// 当前选中的周索引
|
|
69
|
+
const currentWeekIndex = ref(0)
|
|
70
|
+
const scrollLeft = ref(0)
|
|
71
|
+
// 是否循环滚动
|
|
72
|
+
const swiperCircular = ref(true)
|
|
73
|
+
const selectedDate = ref<Date | null>(null)
|
|
74
|
+
// 计算一周的星期顺序
|
|
75
|
+
const firstDayOfWeek = computed((): number => Math.min(Math.max(props.firstDayOfWeek, 0), 6))
|
|
76
|
+
|
|
77
|
+
// 计算最小和最大日期
|
|
78
|
+
const today = new Date()
|
|
79
|
+
const minDate = computed((): Date => (props.minDate !== null ? new Date(props.minDate!) : today))
|
|
80
|
+
const maxDate = computed((): Date => (props.maxDate !== null ? new Date(props.maxDate!) : addDays(today, 31)))
|
|
81
|
+
|
|
82
|
+
const days = computed((): number => {
|
|
83
|
+
return daysBetween(maxDate.value, minDate.value)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const rootStyle = computed(() => {
|
|
87
|
+
const style: Record<string, any> = {}
|
|
88
|
+
if (props.height) {
|
|
89
|
+
style['height'] = props.height
|
|
90
|
+
}
|
|
91
|
+
if (props.bgColor) {
|
|
92
|
+
style['background'] = props.bgColor
|
|
93
|
+
}
|
|
94
|
+
return `${objToStyle(style)}${props.customStyle}`
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
const cache = new Map<number, WeekDateCollection>()
|
|
98
|
+
const createWeek = (currentStartDate: Date, length: number): WeekDateCollection => {
|
|
99
|
+
const dates: DateStriPDay[] = []
|
|
100
|
+
const time = currentStartDate.getTime()
|
|
101
|
+
if (cache.has(time)) {
|
|
102
|
+
return cache.get(time)!
|
|
103
|
+
}
|
|
104
|
+
for (let i = 0; i < length; i++) {
|
|
105
|
+
const date = new Date(time)
|
|
106
|
+
date.setDate(currentStartDate.getDate() + i)
|
|
107
|
+
const week = date.getDay()
|
|
108
|
+
const year = date.getFullYear()
|
|
109
|
+
const month = date.getMonth() + 1
|
|
110
|
+
const day = date.getDate()
|
|
111
|
+
const dateObj = reactive<DateStriPDay>({
|
|
112
|
+
key: `${year}-${month}-${day}`,
|
|
113
|
+
date,
|
|
114
|
+
year,
|
|
115
|
+
month,
|
|
116
|
+
day,
|
|
117
|
+
text: `${day}`.padStart(2, '0'),
|
|
118
|
+
type: calcType(date, minDate.value, maxDate.value, selectedDate.value, props.disableDate),
|
|
119
|
+
prefix: props.weekdays[week]
|
|
120
|
+
})
|
|
121
|
+
dates.push(props.format !== null ? props.format!(dateObj) : dateObj)
|
|
122
|
+
}
|
|
123
|
+
const obj: WeekDateCollection = {
|
|
124
|
+
start: new Date(dates[0].year, dates[0].month - 1, dates[0].day).getTime(),
|
|
125
|
+
end: new Date(dates[length - 1].year, dates[length - 1].month - 1, dates[length - 1].day).getTime(),
|
|
126
|
+
dates
|
|
127
|
+
} as WeekDateCollection
|
|
128
|
+
return obj
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const currentDate = ref<Date>(today)
|
|
132
|
+
|
|
133
|
+
// 计算要显示的三周数据
|
|
134
|
+
const displayWeeks = computed((): WeekDateCollection[] => {
|
|
135
|
+
const weeks: WeekDateCollection[] = []
|
|
136
|
+
if (props.switchMode === 'week') {
|
|
137
|
+
const currentRange = getWeekRange(currentDate.value, firstDayOfWeek.value)
|
|
138
|
+
const offsetMap = new Map<number, number[]>([
|
|
139
|
+
[0, [0, 1, -1]],
|
|
140
|
+
[1, [-1, 0, 1]],
|
|
141
|
+
[2, [1, -1, 0]]
|
|
142
|
+
])
|
|
143
|
+
let indices = offsetMap.get(currentWeekIndex.value)!
|
|
144
|
+
indices.forEach((i) => {
|
|
145
|
+
const weekDate = addWeeks(currentRange.start, i)
|
|
146
|
+
weeks.push(createWeek(weekDate, 7))
|
|
147
|
+
})
|
|
148
|
+
} else {
|
|
149
|
+
weeks.push(createWeek(minDate.value, days.value))
|
|
150
|
+
}
|
|
151
|
+
return weeks
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
const swiperChange = (event: any) => {
|
|
155
|
+
const delta = event.detail.current - currentWeekIndex.value
|
|
156
|
+
const newDate = addWeeks(currentDate.value, delta == 1 || delta == -2 ? 1 : -1)
|
|
157
|
+
currentDate.value = newDate
|
|
158
|
+
currentWeekIndex.value = event.detail.current
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const onClick = (day: DateStriPDay) => {
|
|
162
|
+
if (day.type == 'disabled') return
|
|
163
|
+
selectedDate.value = day.date
|
|
164
|
+
const v = day.date.getTime()
|
|
165
|
+
emit('change', v)
|
|
166
|
+
emit('select', v)
|
|
167
|
+
emit('update:modelValue', v)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const scrollToDate = (date: Date) => {
|
|
171
|
+
currentDate.value = date
|
|
172
|
+
if (props.switchMode !== 'none') return
|
|
173
|
+
scrollLeft.value = unitConvertWithDefault(props.gridWidth, { defaultUnit: 'rpx' }) * daysBetween(date, minDate.value)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
watch(
|
|
177
|
+
() => props.modelValue,
|
|
178
|
+
(value) => {
|
|
179
|
+
if (!value) return
|
|
180
|
+
selectedDate.value = new Date(value)
|
|
181
|
+
},
|
|
182
|
+
{ deep: true, immediate: true }
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
onMounted(() => {
|
|
186
|
+
nextTick(() => {
|
|
187
|
+
scrollToDate(currentDate.value)
|
|
188
|
+
})
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
defineExpose({
|
|
192
|
+
scrollToDate
|
|
193
|
+
})
|
|
194
|
+
</script>
|
|
195
|
+
|
|
196
|
+
<style lang="scss" scoped>
|
|
197
|
+
@import './index.scss';
|
|
198
|
+
</style>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
|
|
2
|
+
|
|
3
|
+
import { baseProps, makeArrayProp, makeNumberProp, makeStringProp } from '../common/props'
|
|
4
|
+
|
|
5
|
+
export type DateType = 'selected' | 'disabled' | ''
|
|
6
|
+
export type DisableDate = (date: Date) => boolean
|
|
7
|
+
export type FormatDate = (day: DateStriPDay) => DateStriPDay
|
|
8
|
+
|
|
9
|
+
export type DateStripSwitchMode = 'week' | 'none'
|
|
10
|
+
export type DateStripShape = 'square' | 'circle' | 'none'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 定义一个表示周范围的类
|
|
14
|
+
*/
|
|
15
|
+
export type WeekRange = {
|
|
16
|
+
start: Date
|
|
17
|
+
end: Date
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type DateStriPDay = {
|
|
21
|
+
date: Date
|
|
22
|
+
key: string
|
|
23
|
+
day: number
|
|
24
|
+
year: number
|
|
25
|
+
month: number
|
|
26
|
+
text: string
|
|
27
|
+
type: DateType
|
|
28
|
+
prefix: string
|
|
29
|
+
suffix?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type WeekDateCollection = {
|
|
33
|
+
start: number
|
|
34
|
+
end: number
|
|
35
|
+
dates: DateStriPDay[]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const dateStripProps = {
|
|
39
|
+
...baseProps,
|
|
40
|
+
// 当前选择的日期
|
|
41
|
+
modelValue: {
|
|
42
|
+
type: [Number, null] as PropType<number | null>,
|
|
43
|
+
default: null
|
|
44
|
+
},
|
|
45
|
+
// 日期行高
|
|
46
|
+
height: makeStringProp(''),
|
|
47
|
+
// 第一天从星期几开始,默认 1 = 周一
|
|
48
|
+
firstDayOfWeek: makeNumberProp(0),
|
|
49
|
+
// 日期格式,可选
|
|
50
|
+
format: {
|
|
51
|
+
type: Function as PropType<FormatDate>,
|
|
52
|
+
default: null
|
|
53
|
+
},
|
|
54
|
+
// 最大可选日期,不传则默认半年后
|
|
55
|
+
maxDate: {
|
|
56
|
+
type: [Number, null] as PropType<number | null>,
|
|
57
|
+
default: null
|
|
58
|
+
},
|
|
59
|
+
// 最小可选日期,不传则默认今天
|
|
60
|
+
minDate: {
|
|
61
|
+
type: [Number, null] as PropType<number | null>,
|
|
62
|
+
default: null
|
|
63
|
+
},
|
|
64
|
+
// 网格宽度
|
|
65
|
+
gridWidth: makeStringProp('100rpx'),
|
|
66
|
+
// 主题色,对底部按钮和选中日期生效
|
|
67
|
+
color: makeStringProp(''),
|
|
68
|
+
// 选中日期的背景色
|
|
69
|
+
activeBgColor: makeStringProp(''),
|
|
70
|
+
// 选中日期的文字颜色
|
|
71
|
+
activeColor: makeStringProp(''),
|
|
72
|
+
// 背景色
|
|
73
|
+
bgColor: makeStringProp(''),
|
|
74
|
+
// 圆角半径
|
|
75
|
+
radius: makeStringProp(''),
|
|
76
|
+
// 切换模式,'week' 或 'none'
|
|
77
|
+
switchMode: makeStringProp<DateStripSwitchMode>('week'),
|
|
78
|
+
// 形状,'square'、'circle' 或 'none'
|
|
79
|
+
shape: makeStringProp<DateStripShape>('square'),
|
|
80
|
+
// 星期几的名称数组
|
|
81
|
+
weekdays: {
|
|
82
|
+
...makeArrayProp<string>(),
|
|
83
|
+
default: () => ['日', '一', '二', '三', '四', '五', '六']
|
|
84
|
+
},
|
|
85
|
+
// 禁用日期函数
|
|
86
|
+
disableDate: {
|
|
87
|
+
type: Function as PropType<DisableDate>,
|
|
88
|
+
default: null
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type DateStripProps = ExtractPropTypes<typeof dateStripProps>
|
|
93
|
+
|
|
94
|
+
export type DateStripExpose = {
|
|
95
|
+
scrollToDate: (date: Date) => void
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type DateStripInstance = ComponentPublicInstance<DateStripProps, DateStripExpose>
|