oxy-uni-ui 1.2.3 → 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 +353 -328
- package/components/common/util.ts +185 -32
- package/components/composables/index.ts +1 -0
- package/components/composables/usePopover.ts +24 -20
- package/components/composables/useVirtualScroll.ts +10 -9
- 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-checkbox/index.scss +7 -7
- 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 +6 -5
- package/components/oxy-col-picker/types.ts +7 -2
- 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-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/oxy-date-strip.vue +2 -2
- package/components/oxy-date-strip/types.ts +1 -1
- package/components/oxy-date-strip-item/index.scss +3 -3
- package/components/oxy-datetime-picker/index.scss +11 -11
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +1 -0
- package/components/oxy-datetime-picker/types.ts +5 -0
- 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/types.ts +6 -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 +24 -23
- package/components/oxy-file-list/oxy-file-list.vue +2 -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-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/oxy-img-lazy.vue +3 -3
- package/components/oxy-img-lazy/types.ts +3 -3
- 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 +2 -2
- package/components/oxy-list/oxy-list.vue +4 -3
- 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 +100 -14
- package/components/oxy-picker/types.ts +29 -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 +10 -10
- 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/index.scss +30 -29
- package/components/oxy-rich-text/mp-html/mp-html.vue +33 -24
- package/components/oxy-rich-text/mp-html/node/node.vue +30 -19
- package/components/oxy-rich-text/oxy-rich-text.vue +31 -31
- package/components/oxy-rich-text/types.ts +6 -1
- 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 +144 -68
- package/components/oxy-select/oxy-select.vue +85 -50
- package/components/oxy-select/types.ts +13 -1
- package/components/oxy-select-picker/index.scss +7 -7
- package/components/oxy-select-picker/oxy-select-picker.vue +1 -0
- package/components/oxy-select-picker/types.ts +2 -0
- 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/types.ts +4 -1
- 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 +51 -15
- package/components/oxy-tree/oxy-tree.vue +13 -9
- package/components/oxy-tree/types.ts +12 -9
- 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/oxy-waterfall.vue +6 -6
- package/components/oxy-waterfall/types.ts +6 -6
- package/components/oxy-watermark/oxy-watermark.vue +35 -13
- package/components/oxy-watermark/types.ts +14 -14
- package/global.d.ts +2 -0
- package/locale/lang/ar-SA.ts +3 -0
- package/locale/lang/en-US.ts +3 -0
- package/locale/lang/zh-CN.ts +3 -0
- package/package.json +97 -1
- package/tags.json +1 -1
- 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
- package/oxy-uni-ui.zip +0 -0
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
-webkit-tap-highlight-color: transparent;
|
|
41
41
|
box-sizing: border-box;
|
|
42
42
|
width: 100%;
|
|
43
|
-
overflow: hidden;
|
|
43
|
+
// overflow: hidden;
|
|
44
44
|
|
|
45
45
|
@include when(border) {
|
|
46
46
|
.oxy-cell__wrapper {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
padding: $-cell-wrapper-padding $-cell-padding $-cell-wrapper-padding 0;
|
|
55
55
|
justify-content: space-between;
|
|
56
56
|
align-items: flex-start;
|
|
57
|
-
overflow: hidden;
|
|
57
|
+
// overflow: hidden;
|
|
58
58
|
|
|
59
59
|
@include when(vertical) {
|
|
60
60
|
display: block;
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
@include e(label) {
|
|
112
|
-
margin-top:
|
|
112
|
+
margin-top: 4rpx;
|
|
113
113
|
font-size: $-cell-label-fs;
|
|
114
114
|
color: $-cell-label-color;
|
|
115
115
|
}
|
|
@@ -134,15 +134,15 @@
|
|
|
134
134
|
font-size: $-cell-value-fs;
|
|
135
135
|
color: $-cell-value-color;
|
|
136
136
|
vertical-align: middle;
|
|
137
|
-
|
|
137
|
+
|
|
138
138
|
@include m(left) {
|
|
139
139
|
text-align: left;
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
|
|
142
142
|
@include m(right) {
|
|
143
143
|
text-align: right;
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
|
|
146
146
|
@include m(ellipsis) {
|
|
147
147
|
@include lineEllipsis;
|
|
148
148
|
min-width: 0;
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
|
|
152
152
|
@include edeep(arrow-right) {
|
|
153
153
|
display: block;
|
|
154
|
-
margin-left:
|
|
154
|
+
margin-left: 16rpx;
|
|
155
155
|
width: $-cell-arrow-size;
|
|
156
156
|
font-size: $-cell-arrow-size;
|
|
157
157
|
color: $-cell-arrow-color;
|
|
@@ -203,4 +203,4 @@
|
|
|
203
203
|
align-items: center;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
}
|
|
206
|
+
}
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
display: inline-block;
|
|
85
85
|
width: $-checkbox-size;
|
|
86
86
|
height: $-checkbox-size;
|
|
87
|
-
border:
|
|
87
|
+
border: 4rpx solid $-checkbox-border-color;
|
|
88
88
|
border-radius: 50%;
|
|
89
89
|
color: $-checkbox-check-color;
|
|
90
90
|
background: $-checkbox-bg;
|
|
@@ -108,14 +108,14 @@
|
|
|
108
108
|
@include edeep(btn-check) {
|
|
109
109
|
display: inline-block;
|
|
110
110
|
font-size: $-checkbox-icon-size;
|
|
111
|
-
margin-right:
|
|
111
|
+
margin-right: 8rpx;
|
|
112
112
|
vertical-align: middle;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
@include e(txt) {
|
|
116
116
|
display: inline-block;
|
|
117
117
|
vertical-align: middle;
|
|
118
|
-
line-height:
|
|
118
|
+
line-height: 40rpx;
|
|
119
119
|
@include lineEllipsis;
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
height: $-checkbox-button-height;
|
|
212
212
|
font-size: $-checkbox-button-font-size;
|
|
213
213
|
margin-left: 0;
|
|
214
|
-
padding:
|
|
214
|
+
padding: 10rpx 30rpx;
|
|
215
215
|
border: 1px solid $-checkbox-button-border;
|
|
216
216
|
background-color: $-checkbox-button-bg;
|
|
217
217
|
border-radius: $-checkbox-button-radius;
|
|
@@ -276,18 +276,18 @@
|
|
|
276
276
|
|
|
277
277
|
// 以下内容用于解决父子组件样式隔离的问题 —— START
|
|
278
278
|
@include when(cell-box) {
|
|
279
|
-
padding:
|
|
279
|
+
padding: 26rpx 30rpx;
|
|
280
280
|
margin: 0;
|
|
281
281
|
|
|
282
282
|
@include when(large) {
|
|
283
|
-
padding:
|
|
283
|
+
padding: 28rpx 30rpx;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
@include when(button-box) {
|
|
288
288
|
display: inline-flex;
|
|
289
289
|
width: 33.3333%;
|
|
290
|
-
padding:
|
|
290
|
+
padding: 24rpx 24rpx 0 0;
|
|
291
291
|
box-sizing: border-box;
|
|
292
292
|
|
|
293
293
|
.oxy-checkbox__label {
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
@include b(checkbox-group) {
|
|
10
10
|
background-color: $-checkbox-bg;
|
|
11
11
|
|
|
12
|
-
// 上下
|
|
12
|
+
// 上下40rpx 左右30rpx 内部间隔24rpx
|
|
13
13
|
@include when(button) {
|
|
14
14
|
width: 100%;
|
|
15
|
-
padding:
|
|
15
|
+
padding: 16rpx 6rpx 40rpx 30rpx;
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
overflow: hidden;
|
|
18
18
|
height: auto;
|
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
</script>
|
|
30
30
|
<script lang="ts" setup>
|
|
31
31
|
import { computed, getCurrentInstance, onBeforeMount, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
32
|
-
import {
|
|
32
|
+
import { isObj, objToStyle, unitConvert, unitConvertWithDefault, withDefaultUnit, uuid } from '../common/util'
|
|
33
33
|
import { circleProps } from './types'
|
|
34
34
|
// #ifdef MP-WEIXIN
|
|
35
35
|
import { canvas2dAdapter } from '../common/canvasHelper'
|
|
@@ -55,10 +55,12 @@ const interval = ref<any>(null) // 定时器
|
|
|
55
55
|
const pixelRatio = ref<number>(1) // 像素比
|
|
56
56
|
const canvasId = ref<string>(`oxy-circle${uuid()}`) // canvasId
|
|
57
57
|
let ctx: UniApp.CanvasContext | null = null
|
|
58
|
+
const toNumber = (value: number | string | null | undefined) => unitConvertWithDefault(value, { defaultUnit: 'rpx' })
|
|
59
|
+
const toPx = (value: number | string | null | undefined) => unitConvert(withDefaultUnit(value, 'rpx'), 0, { output: 'px' })
|
|
58
60
|
|
|
59
61
|
// canvas渲染大小
|
|
60
62
|
const canvasSize = computed(() => {
|
|
61
|
-
let size = props.size
|
|
63
|
+
let size = toNumber(props.size)
|
|
62
64
|
// #ifdef MP-ALIPAY
|
|
63
65
|
size = size * pixelRatio.value
|
|
64
66
|
// #endif
|
|
@@ -68,7 +70,7 @@ const canvasSize = computed(() => {
|
|
|
68
70
|
|
|
69
71
|
// 进度条宽度
|
|
70
72
|
const sWidth = computed(() => {
|
|
71
|
-
let sWidth = props.strokeWidth
|
|
73
|
+
let sWidth = toNumber(props.strokeWidth)
|
|
72
74
|
// #ifdef MP-ALIPAY
|
|
73
75
|
sWidth = sWidth * pixelRatio.value
|
|
74
76
|
// #endif
|
|
@@ -78,8 +80,8 @@ const sWidth = computed(() => {
|
|
|
78
80
|
// Circle 样式
|
|
79
81
|
const canvasStyle = computed(() => {
|
|
80
82
|
const style = {
|
|
81
|
-
width:
|
|
82
|
-
height:
|
|
83
|
+
width: toPx(props.size),
|
|
84
|
+
height: toPx(props.size)
|
|
83
85
|
}
|
|
84
86
|
return `${objToStyle(style)}`
|
|
85
87
|
})
|
|
@@ -148,8 +150,9 @@ function getContext() {
|
|
|
148
150
|
if (res && res.node) {
|
|
149
151
|
const canvas = res.node
|
|
150
152
|
ctx = canvas2dAdapter(canvas.getContext('2d') as CanvasRenderingContext2D)
|
|
151
|
-
|
|
152
|
-
canvas.
|
|
153
|
+
const size = toNumber(props.size)
|
|
154
|
+
canvas.width = size * pixelRatio.value
|
|
155
|
+
canvas.height = size * pixelRatio.value
|
|
153
156
|
ctx.scale(pixelRatio.value, pixelRatio.value)
|
|
154
157
|
resolve(ctx)
|
|
155
158
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue'
|
|
2
|
-
import { baseProps, makeBooleanProp, makeNumberProp, makeStringProp } from '../common/props'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeNumberProp, makeNumericProp, makeStringProp } from '../common/props'
|
|
3
3
|
|
|
4
4
|
// 进度条端点的形状,可选值为 "butt" | "round" | "square"
|
|
5
5
|
export type StrokeLinecapType = 'butt' | 'round' | 'square'
|
|
@@ -11,9 +11,9 @@ export const circleProps = {
|
|
|
11
11
|
*/
|
|
12
12
|
modelValue: makeNumberProp(0),
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* 圆环直径,支持 number / string(如 `200rpx`、`100px`),number 与纯数字字符串按 rpx 处理
|
|
15
15
|
*/
|
|
16
|
-
size:
|
|
16
|
+
size: makeNumericProp(200),
|
|
17
17
|
/**
|
|
18
18
|
* 进度条颜色,传入对象格式可以定义渐变色
|
|
19
19
|
*/
|
|
@@ -38,9 +38,9 @@ export const circleProps = {
|
|
|
38
38
|
*/
|
|
39
39
|
text: String,
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* 进度条宽度,支持 number / string(如 `20rpx`、`10px`),number 与纯数字字符串按 rpx 处理
|
|
42
42
|
*/
|
|
43
|
-
strokeWidth:
|
|
43
|
+
strokeWidth: makeNumericProp(20),
|
|
44
44
|
/**
|
|
45
45
|
* 进度条端点的形状,可选值为 "butt" | "round" | "square"
|
|
46
46
|
*/
|
|
@@ -20,14 +20,14 @@ import { computed, watch } from 'vue'
|
|
|
20
20
|
import { useParent } from '../composables/useParent'
|
|
21
21
|
import { ROW_KEY } from '../oxy-row/types'
|
|
22
22
|
import { colProps } from './types'
|
|
23
|
-
import { isDef } from '../common/util'
|
|
23
|
+
import { isDef, withDefaultUnit } from '../common/util'
|
|
24
24
|
|
|
25
25
|
const props = defineProps(colProps)
|
|
26
26
|
const { parent: row } = useParent(ROW_KEY)
|
|
27
27
|
|
|
28
28
|
const rootStyle = computed(() => {
|
|
29
29
|
const gutter = isDef(row) ? row.props.gutter || 0 : 0
|
|
30
|
-
const padding =
|
|
30
|
+
const padding = withDefaultUnit(gutter / 2)
|
|
31
31
|
const style = gutter > 0 ? `padding-left: ${padding}; padding-right: ${padding};background-clip: content-box;` : ''
|
|
32
32
|
return `${style}${props.customStyle}`
|
|
33
33
|
})
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
|
|
96
96
|
@include e(selected-line) {
|
|
97
97
|
position: absolute;
|
|
98
|
-
bottom:
|
|
98
|
+
bottom: 10rpx;
|
|
99
99
|
width: $-col-picker-line-width;
|
|
100
100
|
left: 0;
|
|
101
101
|
height: $-col-picker-line-height;
|
|
@@ -141,18 +141,18 @@
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
@include e(list-item-tip) {
|
|
144
|
-
margin-top:
|
|
144
|
+
margin-top: 4rpx;
|
|
145
145
|
font-size: $-col-picker-list-fs-tip;
|
|
146
146
|
color: $-col-picker-list-color-tip;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
@include e(confirm) {
|
|
150
|
-
padding:
|
|
150
|
+
padding: 24rpx 50rpx 28rpx;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
@include edeep(checked) {
|
|
154
154
|
display: block;
|
|
155
|
-
margin-left:
|
|
155
|
+
margin-left: 8rpx;
|
|
156
156
|
font-size: $-col-picker-list-checked-icon-size;
|
|
157
157
|
color: $-col-picker-list-color-checked;
|
|
158
158
|
opacity: 0;
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
:title="title || translate('title')"
|
|
37
37
|
:close-on-click-modal="closeOnClickModal"
|
|
38
38
|
:z-index="zIndex"
|
|
39
|
+
:max-width="popupMaxWidth"
|
|
39
40
|
:safe-area-inset-bottom="safeAreaInsetBottom"
|
|
40
41
|
:root-portal="rootPortal"
|
|
41
42
|
@open="handlePickerOpend"
|
|
@@ -106,7 +107,7 @@ import OxyLoading from '../oxy-loading/oxy-loading.vue'
|
|
|
106
107
|
import OxyActionSheet from '../oxy-action-sheet/oxy-action-sheet.vue'
|
|
107
108
|
import OxyCell from '../oxy-cell/oxy-cell.vue'
|
|
108
109
|
import { computed, getCurrentInstance, onMounted, ref, watch, type CSSProperties, type ComponentPublicInstance, reactive } from 'vue'
|
|
109
|
-
import {
|
|
110
|
+
import { withDefaultUnit, debounce, getRect, isArray, isBoolean, isDef, isFunction, objToStyle, unitConvert } from '../common/util'
|
|
110
111
|
import { useTranslate } from '../composables/useTranslate'
|
|
111
112
|
import { colPickerProps, type ColPickerExpose } from './types'
|
|
112
113
|
|
|
@@ -453,15 +454,15 @@ function setLineStyle(animation: boolean = true) {
|
|
|
453
454
|
.then((rects) => {
|
|
454
455
|
const lineStyle: CSSProperties = {}
|
|
455
456
|
if (isDef(lineWidth)) {
|
|
456
|
-
lineStyle.width =
|
|
457
|
+
lineStyle.width = withDefaultUnit(lineWidth)
|
|
457
458
|
}
|
|
458
459
|
if (isDef(lineHeight)) {
|
|
459
|
-
lineStyle.height =
|
|
460
|
-
lineStyle.borderRadius = `calc(${
|
|
460
|
+
lineStyle.height = withDefaultUnit(lineHeight)
|
|
461
|
+
lineStyle.borderRadius = `calc(${withDefaultUnit(lineHeight)} / 2)`
|
|
461
462
|
}
|
|
462
463
|
const rect = rects[currentCol.value]
|
|
463
464
|
let left = rects.slice(0, currentCol.value).reduce((prev, curr) => prev + Number(curr.width), 0) + Number(rect.width) / 2
|
|
464
|
-
lineStyle.transform = `translateX(${left}
|
|
465
|
+
lineStyle.transform = `translateX(${unitConvert(left, 0, { output: 'px' })}) translateX(-50%)`
|
|
465
466
|
|
|
466
467
|
if (animation) {
|
|
467
468
|
lineStyle.transition = 'width 300ms ease, transform 300ms ease'
|
|
@@ -100,6 +100,11 @@ export const colPickerProps = {
|
|
|
100
100
|
* 弹窗层级
|
|
101
101
|
*/
|
|
102
102
|
zIndex: makeNumberProp(15),
|
|
103
|
+
/**
|
|
104
|
+
* 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;
|
|
105
|
+
* `%` 在弹层打开时按屏幕宽度换算为 `rpx`
|
|
106
|
+
*/
|
|
107
|
+
popupMaxWidth: makeStringProp('1200rpx'),
|
|
103
108
|
/**
|
|
104
109
|
* 是否显示确定按钮
|
|
105
110
|
*/
|
|
@@ -129,11 +134,11 @@ export const colPickerProps = {
|
|
|
129
134
|
*/
|
|
130
135
|
rules: makeArrayProp<FormItemRule>(),
|
|
131
136
|
/**
|
|
132
|
-
*
|
|
137
|
+
* 底部条宽度,支持 `px/rpx`
|
|
133
138
|
*/
|
|
134
139
|
lineWidth: numericProp,
|
|
135
140
|
/**
|
|
136
|
-
*
|
|
141
|
+
* 底部条高度,支持 `px/rpx`
|
|
137
142
|
*/
|
|
138
143
|
lineHeight: numericProp,
|
|
139
144
|
/**
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
@include e(more) {
|
|
32
32
|
display: inline-block;
|
|
33
33
|
font-size: $-collapse-retract-fs;
|
|
34
|
-
margin-top:
|
|
34
|
+
margin-top: 16rpx;
|
|
35
35
|
color: $-collapse-more-color;
|
|
36
36
|
user-select: none;
|
|
37
37
|
}
|
|
38
38
|
@include e(more-txt) {
|
|
39
39
|
display: inline-block;
|
|
40
40
|
vertical-align: middle;
|
|
41
|
-
margin-right:
|
|
41
|
+
margin-right: 8rpx;
|
|
42
42
|
}
|
|
43
43
|
@include e(arrow) {
|
|
44
44
|
display: inline-block;
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
<script lang="ts" setup>
|
|
33
33
|
import OxyIcon from '../oxy-icon/oxy-icon.vue'
|
|
34
34
|
import { computed, getCurrentInstance, onMounted, ref, watch, type CSSProperties } from 'vue'
|
|
35
|
-
import {
|
|
35
|
+
import { getRect, isArray, isDef, isPromise, isString, objToStyle, pause, unitConvert, uuid } from '../common/util'
|
|
36
36
|
import { useParent } from '../composables/useParent'
|
|
37
37
|
import { COLLAPSE_KEY } from '../oxy-collapse/types'
|
|
38
38
|
import { collapseItemProps, type CollapseItemExpose } from './types'
|
|
@@ -64,9 +64,9 @@ const contentStyle = computed(() => {
|
|
|
64
64
|
style.transition = 'height 0.3s ease-in-out'
|
|
65
65
|
}
|
|
66
66
|
if (!expanded.value) {
|
|
67
|
-
style.height = '
|
|
67
|
+
style.height = '0'
|
|
68
68
|
} else if (height.value) {
|
|
69
|
-
style.height =
|
|
69
|
+
style.height = unitConvert(height.value, 0, { output: 'px' })
|
|
70
70
|
}
|
|
71
71
|
return objToStyle(style)
|
|
72
72
|
})
|
|
@@ -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
|
}
|
|
@@ -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
|