oxy-uni-ui 1.2.3 → 2.1.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 +512 -343
- 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 +48 -21
- 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 +4 -4
- 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 +15 -15
- 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 -8
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
- package/components/oxy-calendar-view/year/index.scss +5 -5
- 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 +12 -12
- 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 +33 -33
- 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 +5 -5
- package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
- package/components/oxy-drop-menu-item/index.scss +3 -3
- 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 +30 -29
- 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 +23 -23
- 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 +9 -2
- package/components/oxy-message-box/types.ts +9 -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 +6 -5
- 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 +4 -4
- package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
- package/components/oxy-popover/index.scss +13 -13
- package/components/oxy-popup/index.scss +4 -4
- 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 +25 -19
- 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 +37 -36
- package/components/oxy-rich-text/mp-html/card/card.vue +3 -3
- 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 +7 -7
- package/components/oxy-segmented/index.scss +19 -16
- package/components/oxy-segmented/oxy-segmented.vue +23 -3
- package/components/oxy-select/index.scss +213 -89
- package/components/oxy-select/oxy-select.vue +106 -58
- 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 +2 -2
- package/components/oxy-signature/oxy-signature.vue +18 -10
- package/components/oxy-signature/types.ts +106 -13
- package/components/oxy-skeleton/index.scss +1 -1
- package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
- package/components/oxy-skeleton/types.ts +1 -1
- package/components/oxy-slider/index.scss +6 -6
- package/components/oxy-sort-button/index.scss +8 -8
- package/components/oxy-splitter/index.scss +19 -0
- package/components/oxy-splitter/oxy-splitter.vue +409 -0
- package/components/oxy-splitter/types.ts +75 -0
- package/components/oxy-splitter-panel/index.scss +366 -0
- package/components/oxy-splitter-panel/oxy-splitter-panel.vue +432 -0
- package/components/oxy-splitter-panel/types.ts +63 -0
- 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 +16 -16
- package/components/oxy-sticky/oxy-sticky.vue +6 -6
- package/components/oxy-stream-render/oxy-stream-render.vue +230 -4
- 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-swiper-nav/index.scss +3 -3
- package/components/oxy-switch/index.scss +10 -10
- 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 +2 -2
- package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
- package/components/oxy-table/index.scss +8 -8
- package/components/oxy-table/oxy-table.vue +8 -6
- package/components/oxy-table/types.ts +2 -2
- package/components/oxy-table-col/index.scss +3 -3
- 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 +52 -22
- package/components/oxy-tabs/oxy-tabs.vue +53 -19
- package/components/oxy-tabs/types.ts +15 -3
- package/components/oxy-tag/index.scss +111 -36
- 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 +23 -23
- 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 +5 -5
- 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 +937 -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 +4 -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
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
@include when(shadow) {
|
|
26
26
|
&::after {
|
|
27
|
-
background:
|
|
27
|
+
background: $-table-fixed-shadow-dark;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
@include e(header) {
|
|
57
57
|
width: 100%;
|
|
58
|
-
height:
|
|
58
|
+
height: 100rpx;
|
|
59
59
|
position: sticky;
|
|
60
60
|
top: 0;
|
|
61
61
|
z-index: 2;
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
align-items: center;
|
|
85
85
|
box-sizing: border-box;
|
|
86
86
|
background: $-table-bg;
|
|
87
|
-
width:
|
|
88
|
-
min-height:
|
|
89
|
-
padding:
|
|
87
|
+
width: 200rpx;
|
|
88
|
+
min-height: 100rpx;
|
|
89
|
+
padding: 20rpx 24rpx;
|
|
90
90
|
font-size: $-table-font-size;
|
|
91
91
|
color: $-table-color;
|
|
92
|
-
--oxy-sort-button-height:
|
|
92
|
+
--oxy-sort-button-height: 64rpx;
|
|
93
93
|
|
|
94
94
|
@include when(border) {
|
|
95
95
|
border-right: 1px solid $-table-border-color;
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
top: 0;
|
|
116
116
|
width: 30rpx;
|
|
117
117
|
height: 100%;
|
|
118
|
-
background:
|
|
118
|
+
background: $-table-fixed-shadow-light;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -160,4 +160,4 @@
|
|
|
160
160
|
@include multiEllipsis(2);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
}
|
|
163
|
+
}
|
|
@@ -122,7 +122,7 @@ export default {
|
|
|
122
122
|
import OxyTableCol from '../oxy-table-col/oxy-table-col.vue'
|
|
123
123
|
import OxySortButton from '../oxy-sort-button/oxy-sort-button.vue'
|
|
124
124
|
import { type CSSProperties, computed, reactive, ref } from 'vue'
|
|
125
|
-
import {
|
|
125
|
+
import { withDefaultUnit, debounce, isDef, isObj, objToStyle, uuid } from '../common/util'
|
|
126
126
|
import type { SortDirection, TableColumn, TableColumnInstance, TableColumnProps } from '../oxy-table-col/types'
|
|
127
127
|
import { TABLE_KEY, tableProps, type TableProvide } from './types'
|
|
128
128
|
import { useTranslate } from '../composables/useTranslate'
|
|
@@ -160,7 +160,7 @@ const scroll = debounce(handleScroll, 100, { leading: false }) // 滚动事件
|
|
|
160
160
|
const tableStyle = computed(() => {
|
|
161
161
|
const style: CSSProperties = {}
|
|
162
162
|
if (isDef(props.height)) {
|
|
163
|
-
style['max-height'] =
|
|
163
|
+
style['max-height'] = withDefaultUnit(props.height)
|
|
164
164
|
}
|
|
165
165
|
return `${objToStyle(style)}${props.customStyle}`
|
|
166
166
|
})
|
|
@@ -171,7 +171,7 @@ const realWidthStyle = computed(() => {
|
|
|
171
171
|
}
|
|
172
172
|
let width: string | number = ''
|
|
173
173
|
children.forEach((child) => {
|
|
174
|
-
width = width ? `${width} + ${
|
|
174
|
+
width = width ? `${width} + ${withDefaultUnit(child.width)}` : withDefaultUnit(child.width)
|
|
175
175
|
})
|
|
176
176
|
style['width'] = `calc(${width})`
|
|
177
177
|
return objToStyle(style)
|
|
@@ -180,7 +180,9 @@ const realWidthStyle = computed(() => {
|
|
|
180
180
|
const bodyStyle = computed(() => {
|
|
181
181
|
const style: CSSProperties = {}
|
|
182
182
|
if (isDef(props.height)) {
|
|
183
|
-
style['height'] = isDef(props.rowHeight)
|
|
183
|
+
style['height'] = isDef(props.rowHeight)
|
|
184
|
+
? `calc(${props.data.length} * ${withDefaultUnit(props.rowHeight)})`
|
|
185
|
+
: `calc(${props.data.length} * 100rpx)`
|
|
184
186
|
}
|
|
185
187
|
return `${objToStyle(style)}`
|
|
186
188
|
})
|
|
@@ -208,7 +210,7 @@ function getIsLastFixed(column: { fixed: boolean; prop: string }) {
|
|
|
208
210
|
function getCellStyle(columnIndex: number) {
|
|
209
211
|
let style: CSSProperties = {}
|
|
210
212
|
if (isDef(children[columnIndex].width)) {
|
|
211
|
-
style['width'] =
|
|
213
|
+
style['width'] = withDefaultUnit(children[columnIndex].width)
|
|
212
214
|
}
|
|
213
215
|
if (children[columnIndex].fixed) {
|
|
214
216
|
style = getFixedStyle(columnIndex, style)
|
|
@@ -225,7 +227,7 @@ function getFixedStyle(columnIndex: number, style: CSSProperties) {
|
|
|
225
227
|
let left: string | number = ''
|
|
226
228
|
children.forEach((column, index) => {
|
|
227
229
|
if (index < columnIndex) {
|
|
228
|
-
left = left ? `${left} + ${
|
|
230
|
+
left = left ? `${left} + ${withDefaultUnit(column.width)}` : withDefaultUnit(column.width)
|
|
229
231
|
}
|
|
230
232
|
})
|
|
231
233
|
style['left'] = `calc(${left})`
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
@include b(table-col) {
|
|
8
8
|
@include when(shadow) {
|
|
9
9
|
&::after {
|
|
10
|
-
background:
|
|
10
|
+
background: $-table-fixed-shadow-dark;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
top: 0;
|
|
35
35
|
width: 30rpx;
|
|
36
36
|
height: 100%;
|
|
37
|
-
background:
|
|
37
|
+
background: $-table-fixed-shadow-light;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
border-bottom: none;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
}
|
|
46
|
+
}
|
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
</script>
|
|
29
29
|
<script lang="ts" setup>
|
|
30
30
|
import { type CSSProperties, computed, ref } from 'vue'
|
|
31
|
-
import {
|
|
31
|
+
import { withDefaultUnit, isDef, objToStyle, isOdd, isFunction } from '../common/util'
|
|
32
32
|
import { tableColumnProps, type SortDirection } from './types'
|
|
33
33
|
import { useParent } from '../composables/useParent'
|
|
34
34
|
import { TABLE_KEY } from '../oxy-table/types'
|
|
@@ -87,7 +87,7 @@ const isLastFixed = computed(() => {
|
|
|
87
87
|
const columnStyle = computed(() => {
|
|
88
88
|
let style: CSSProperties = {}
|
|
89
89
|
if (isDef(props.width)) {
|
|
90
|
-
style['width'] =
|
|
90
|
+
style['width'] = withDefaultUnit(props.width)
|
|
91
91
|
}
|
|
92
92
|
if (props.fixed && isDef(table) && isFunction(table.getFixedStyle)) {
|
|
93
93
|
style = table.getFixedStyle(columnIndex.value, style)
|
|
@@ -102,7 +102,7 @@ const cellStyle = computed(() => {
|
|
|
102
102
|
let style: CSSProperties = {}
|
|
103
103
|
const rowHeight: string | number = isDef(table) && isDef(table.props) ? table.props.rowHeight : 50 // 自定义行高
|
|
104
104
|
if (isDef(rowHeight)) {
|
|
105
|
-
style['height'] =
|
|
105
|
+
style['height'] = withDefaultUnit(rowHeight)
|
|
106
106
|
}
|
|
107
107
|
if (props.fixed && isDef(table) && isFunction(table.getFixedStyle)) {
|
|
108
108
|
style = table.getFixedStyle(columnIndex.value, style)
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
|
|
31
31
|
@include when(active) {
|
|
32
32
|
color: $-dark-color;
|
|
33
|
-
border:
|
|
33
|
+
border: 2rpx solid $-tabs-nav-active-color;
|
|
34
34
|
background-color: $-dark-background;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
@include when(disabled) {
|
|
38
38
|
color: $-dark-color-gray;
|
|
39
|
-
border-color:
|
|
39
|
+
border-color: $-tabs-nav-map-disabled-border-color;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
|
|
64
64
|
@include b(tabs) {
|
|
65
65
|
position: relative;
|
|
66
|
-
background:
|
|
66
|
+
background: $-tabs-nav-bg;
|
|
67
67
|
width: 100%;
|
|
68
68
|
|
|
69
69
|
@include e(nav) {
|
|
70
70
|
left: 0;
|
|
71
71
|
right: 0;
|
|
72
72
|
height: $-tabs-nav-height;
|
|
73
|
-
background-color:
|
|
73
|
+
background-color: $-tabs-nav-bg;
|
|
74
74
|
width: 100%;
|
|
75
75
|
position: relative;
|
|
76
76
|
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
|
|
126
126
|
@include e(line) {
|
|
127
127
|
position: absolute;
|
|
128
|
-
bottom:
|
|
128
|
+
bottom: 8rpx;
|
|
129
129
|
left: 0;
|
|
130
130
|
z-index: 1;
|
|
131
131
|
height: $-tabs-nav-line-height;
|
|
@@ -139,6 +139,25 @@
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
@include edeep(nav-item-pills){
|
|
143
|
+
.oxy-tabs__nav-item-text {
|
|
144
|
+
padding: $-tabs-nav-pills-padding-y $-tabs-nav-pills-padding-x;
|
|
145
|
+
}
|
|
146
|
+
.oxy-tabs__nav-item-badge {
|
|
147
|
+
.oxy-badge__content {
|
|
148
|
+
margin-top: $-tabs-nav-pills-padding-y;
|
|
149
|
+
margin-right: $-tabs-nav-pills-padding-x;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
@include when(active) {
|
|
153
|
+
.oxy-tabs__nav-item-text {
|
|
154
|
+
background-color: $-tabs-nav-pills-bg-color;
|
|
155
|
+
border-radius: $-tabs-nav-pills-border-radius;
|
|
156
|
+
color: $-tabs-nav-pills-color;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
142
161
|
@include e(container) {
|
|
143
162
|
overflow: hidden;
|
|
144
163
|
}
|
|
@@ -179,8 +198,8 @@
|
|
|
179
198
|
position: absolute;
|
|
180
199
|
content: '';
|
|
181
200
|
top: 0;
|
|
182
|
-
left: -
|
|
183
|
-
width:
|
|
201
|
+
left: -48rpx;
|
|
202
|
+
width: 48rpx;
|
|
184
203
|
height: $-tabs-nav-height - 1;
|
|
185
204
|
background: $-tabs-nav-map-btn-before-bg;
|
|
186
205
|
}
|
|
@@ -197,13 +216,13 @@
|
|
|
197
216
|
|
|
198
217
|
@include e(map-header) {
|
|
199
218
|
position: relative;
|
|
200
|
-
padding-left:
|
|
219
|
+
padding-left: 36rpx;
|
|
201
220
|
height: $-tabs-nav-height;
|
|
202
221
|
line-height: $-tabs-nav-height;
|
|
203
222
|
font-size: $-tabs-nav-map-fs;
|
|
204
223
|
color: $-tabs-nav-map-color;
|
|
205
224
|
transition: opacity .3s;
|
|
206
|
-
background:
|
|
225
|
+
background: $-tabs-nav-bg;
|
|
207
226
|
opacity: 0;
|
|
208
227
|
|
|
209
228
|
@include halfPixelBorder;
|
|
@@ -216,8 +235,8 @@
|
|
|
216
235
|
@include e(map-body) {
|
|
217
236
|
display: flex;
|
|
218
237
|
flex-wrap: wrap;
|
|
219
|
-
padding:
|
|
220
|
-
background:
|
|
238
|
+
padding: 40rpx 32rpx 24rpx;
|
|
239
|
+
background: $-tabs-nav-bg;
|
|
221
240
|
transition: transform .3s;
|
|
222
241
|
transform: scaleY(0);
|
|
223
242
|
transform-origin: center top;
|
|
@@ -242,13 +261,15 @@
|
|
|
242
261
|
@include e(map-nav-btn) {
|
|
243
262
|
@include buttonClear;
|
|
244
263
|
@include lineEllipsis;
|
|
245
|
-
display: inline-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
264
|
+
display: inline-flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
justify-content: center;
|
|
267
|
+
width: 214rpx;
|
|
268
|
+
height: 64rpx;
|
|
269
|
+
line-height: 1.2;
|
|
249
270
|
background-color: $-tabs-nav-map-button-back-color;
|
|
250
271
|
border-color: transparent;
|
|
251
|
-
margin-bottom:
|
|
272
|
+
margin-bottom: 24rpx;
|
|
252
273
|
border-radius: $-tabs-nav-map-button-radius;
|
|
253
274
|
color: $-tabs-nav-map-color;
|
|
254
275
|
font-size: $-tabs-nav-map-fs;
|
|
@@ -257,13 +278,13 @@
|
|
|
257
278
|
|
|
258
279
|
@include when(active) {
|
|
259
280
|
color: $-tabs-nav-active-color;
|
|
260
|
-
border:
|
|
281
|
+
border: 2rpx solid $-tabs-nav-active-color;
|
|
261
282
|
background-color: $-tabs-nav-bg
|
|
262
283
|
}
|
|
263
284
|
|
|
264
285
|
@include when(disabled) {
|
|
265
286
|
color: $-tabs-nav-disabled-color;
|
|
266
|
-
border-color:
|
|
287
|
+
border-color: $-tabs-nav-map-disabled-border-color;
|
|
267
288
|
}
|
|
268
289
|
}
|
|
269
290
|
|
|
@@ -281,19 +302,28 @@
|
|
|
281
302
|
@include when(slide) {
|
|
282
303
|
.oxy-tabs__nav-item {
|
|
283
304
|
flex: 0 0 auto;
|
|
284
|
-
padding: 0
|
|
305
|
+
padding: 0 36rpx;
|
|
285
306
|
}
|
|
286
307
|
}
|
|
287
308
|
|
|
288
309
|
@include when(map) {
|
|
289
310
|
.oxy-tabs__nav--wrap {
|
|
290
|
-
padding-right:
|
|
311
|
+
padding-right: 80rpx;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
@include when(fullscreen) {
|
|
316
|
+
height: 100%;
|
|
317
|
+
display: flex;
|
|
318
|
+
flex-direction: column;
|
|
319
|
+
.oxy-tabs__container {
|
|
320
|
+
flex: 1;
|
|
291
321
|
}
|
|
292
322
|
}
|
|
293
323
|
}
|
|
294
324
|
|
|
295
325
|
@media screen and (max-width: 330px) {
|
|
296
326
|
.oxy-tabs__map-nav-btn {
|
|
297
|
-
width:
|
|
327
|
+
width: 180rpx;
|
|
298
328
|
}
|
|
299
|
-
}
|
|
329
|
+
}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
<template v-if="sticky">
|
|
3
3
|
<oxy-sticky-box>
|
|
4
4
|
<view
|
|
5
|
-
:class="`oxy-tabs ${customClass} ${innerSlidable ? 'is-slide' : ''} ${mapNum < children.length && mapNum !== 0 ? 'is-map' : ''}
|
|
5
|
+
:class="`oxy-tabs ${customClass} ${innerSlidable ? 'is-slide' : ''} ${mapNum < children.length && mapNum !== 0 ? 'is-map' : ''} ${
|
|
6
|
+
fullscreen ? 'is-fullscreen' : ''
|
|
7
|
+
}`"
|
|
6
8
|
:style="customStyle"
|
|
7
9
|
>
|
|
8
10
|
<oxy-sticky :offset-top="offsetTop">
|
|
@@ -14,17 +16,32 @@
|
|
|
14
16
|
@click="handleSelect(index)"
|
|
15
17
|
v-for="(item, index) in children"
|
|
16
18
|
:key="index"
|
|
17
|
-
:class="`oxy-tabs__nav-item
|
|
19
|
+
:class="`oxy-tabs__nav-item ${props.pills ? 'oxy-tabs__nav-item-pills' : ''} ${state.activeIndex === index ? 'is-active' : ''} ${
|
|
20
|
+
item.disabled ? 'is-disabled' : ''
|
|
21
|
+
}`"
|
|
18
22
|
:style="state.activeIndex === index ? (color ? 'color:' + color : '') : inactiveColor ? 'color:' + inactiveColor : ''"
|
|
19
23
|
>
|
|
20
24
|
<oxy-badge v-if="item.badgeProps" v-bind="item.badgeProps">
|
|
21
|
-
<text
|
|
25
|
+
<text
|
|
26
|
+
class="oxy-tabs__nav-item-text"
|
|
27
|
+
:style="props.pills && props.pillsColor && state.activeIndex === index ? 'background-color:' + props.pillsColor : ''"
|
|
28
|
+
>
|
|
29
|
+
{{ item.title }}
|
|
30
|
+
</text>
|
|
22
31
|
</oxy-badge>
|
|
23
|
-
<text
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
<text
|
|
33
|
+
v-else
|
|
34
|
+
class="oxy-tabs__nav-item-text"
|
|
35
|
+
:style="props.pills && props.pillsColor && state.activeIndex === index ? 'background-color:' + props.pillsColor : ''"
|
|
36
|
+
>
|
|
37
|
+
{{ item.title }}
|
|
38
|
+
</text>
|
|
39
|
+
<view
|
|
40
|
+
class="oxy-tabs__line oxy-tabs__line--inner"
|
|
41
|
+
v-if="!props.pills && state.activeIndex === index && state.useInnerLine"
|
|
42
|
+
></view>
|
|
26
43
|
</view>
|
|
27
|
-
<view class="oxy-tabs__line" :style="state.lineStyle"></view>
|
|
44
|
+
<view v-if="!props.pills" class="oxy-tabs__line" :style="state.lineStyle"></view>
|
|
28
45
|
</view>
|
|
29
46
|
</scroll-view>
|
|
30
47
|
</view>
|
|
@@ -75,7 +92,11 @@
|
|
|
75
92
|
</template>
|
|
76
93
|
|
|
77
94
|
<template v-else>
|
|
78
|
-
<view
|
|
95
|
+
<view
|
|
96
|
+
:class="`oxy-tabs ${customClass} ${innerSlidable ? 'is-slide' : ''} ${mapNum < children.length && mapNum !== 0 ? 'is-map' : ''} ${
|
|
97
|
+
fullscreen ? 'is-fullscreen' : ''
|
|
98
|
+
}`"
|
|
99
|
+
>
|
|
79
100
|
<view class="oxy-tabs__nav">
|
|
80
101
|
<view class="oxy-tabs__nav--wrap">
|
|
81
102
|
<scroll-view :scroll-x="innerSlidable" scroll-with-animation :scroll-left="state.scrollLeft">
|
|
@@ -84,16 +105,29 @@
|
|
|
84
105
|
v-for="(item, index) in children"
|
|
85
106
|
@click="handleSelect(index)"
|
|
86
107
|
:key="index"
|
|
87
|
-
:class="`oxy-tabs__nav-item ${
|
|
108
|
+
:class="`oxy-tabs__nav-item ${props.pills ? 'oxy-tabs__nav-item-pills' : ''} ${state.activeIndex === index ? 'is-active' : ''} ${
|
|
109
|
+
item.disabled ? 'is-disabled' : ''
|
|
110
|
+
}`"
|
|
88
111
|
:style="state.activeIndex === index ? (color ? 'color:' + color : '') : inactiveColor ? 'color:' + inactiveColor : ''"
|
|
89
112
|
>
|
|
90
113
|
<oxy-badge custom-class="oxy-tabs__nav-item-badge" v-if="item.badgeProps" v-bind="item.badgeProps">
|
|
91
|
-
<text
|
|
114
|
+
<text
|
|
115
|
+
class="oxy-tabs__nav-item-text"
|
|
116
|
+
:style="props.pills && props.pillsColor && state.activeIndex === index ? 'background-color:' + props.pillsColor : ''"
|
|
117
|
+
>
|
|
118
|
+
{{ item.title }}
|
|
119
|
+
</text>
|
|
92
120
|
</oxy-badge>
|
|
93
|
-
<text
|
|
94
|
-
|
|
121
|
+
<text
|
|
122
|
+
v-else
|
|
123
|
+
class="oxy-tabs__nav-item-text"
|
|
124
|
+
:style="props.pills && props.pillsColor && state.activeIndex === index ? 'background-color:' + props.pillsColor : ''"
|
|
125
|
+
>
|
|
126
|
+
{{ item.title }}
|
|
127
|
+
</text>
|
|
128
|
+
<view class="oxy-tabs__line oxy-tabs__line--inner" v-if="!props.pills && state.activeIndex === index && state.useInnerLine"></view>
|
|
95
129
|
</view>
|
|
96
|
-
<view class="oxy-tabs__line" :style="state.lineStyle"></view>
|
|
130
|
+
<view v-if="!props.pills" class="oxy-tabs__line" :style="state.lineStyle"></view>
|
|
97
131
|
</view>
|
|
98
132
|
</scroll-view>
|
|
99
133
|
</view>
|
|
@@ -145,7 +179,7 @@ import OxyIcon from '../oxy-icon/oxy-icon.vue'
|
|
|
145
179
|
import OxySticky from '../oxy-sticky/oxy-sticky.vue'
|
|
146
180
|
import OxyStickyBox from '../oxy-sticky-box/oxy-sticky-box.vue'
|
|
147
181
|
import { computed, getCurrentInstance, onMounted, watch, nextTick, reactive, type CSSProperties, type ComponentInstance } from 'vue'
|
|
148
|
-
import {
|
|
182
|
+
import { withDefaultUnit, checkNumRange, debounce, getRect, isDef, isNumber, isString, objToStyle, unitConvert } from '../common/util'
|
|
149
183
|
import { useTouch } from '../composables/useTouch'
|
|
150
184
|
import { TABS_KEY, tabsProps, type TabsExpose } from './types'
|
|
151
185
|
import { useChildren } from '../composables/useChildren'
|
|
@@ -316,23 +350,23 @@ async function updateLineStyle(animation: boolean = true) {
|
|
|
316
350
|
try {
|
|
317
351
|
const lineStyle: CSSProperties = {}
|
|
318
352
|
if (isDef(lineWidth)) {
|
|
319
|
-
lineStyle.width =
|
|
353
|
+
lineStyle.width = withDefaultUnit(lineWidth)
|
|
320
354
|
} else {
|
|
321
355
|
if (autoLineWidth) {
|
|
322
356
|
const textRects = await getRect($itemText, true, proxy)
|
|
323
357
|
const textWidth = Number(textRects[state.activeIndex].width)
|
|
324
|
-
lineStyle.width =
|
|
358
|
+
lineStyle.width = unitConvert(textWidth, 0, { output: 'px' })
|
|
325
359
|
}
|
|
326
360
|
}
|
|
327
361
|
if (isDef(lineHeight)) {
|
|
328
|
-
lineStyle.height =
|
|
329
|
-
lineStyle.borderRadius = `calc(${
|
|
362
|
+
lineStyle.height = withDefaultUnit(lineHeight)
|
|
363
|
+
lineStyle.borderRadius = `calc(${withDefaultUnit(lineHeight)} / 2)`
|
|
330
364
|
}
|
|
331
365
|
const rects = await getRect($item, true, proxy)
|
|
332
366
|
const rect = rects[state.activeIndex]
|
|
333
367
|
let left = rects.slice(0, state.activeIndex).reduce((prev, curr) => prev + Number(curr.width), 0) + Number(rect.width) / 2
|
|
334
368
|
if (left) {
|
|
335
|
-
lineStyle.transform = `translateX(${left}
|
|
369
|
+
lineStyle.transform = `translateX(${unitConvert(left, 0, { output: 'px' })}) translateX(-50%)`
|
|
336
370
|
if (animation) {
|
|
337
371
|
lineStyle.transition = 'width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);'
|
|
338
372
|
}
|
|
@@ -52,11 +52,11 @@ export const tabsProps = {
|
|
|
52
52
|
*/
|
|
53
53
|
autoLineWidth: makeBooleanProp(false),
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* 底部条宽度,支持 `px/rpx`
|
|
56
56
|
*/
|
|
57
57
|
lineWidth: numericProp,
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* 底部条高度,支持 `px/rpx`
|
|
60
60
|
*/
|
|
61
61
|
lineHeight: numericProp,
|
|
62
62
|
/**
|
|
@@ -80,7 +80,19 @@ export const tabsProps = {
|
|
|
80
80
|
* 可选值:'auto' | 'always'
|
|
81
81
|
* @default auto
|
|
82
82
|
*/
|
|
83
|
-
slidable: makeStringProp<TabsSlidable>('auto')
|
|
83
|
+
slidable: makeStringProp<TabsSlidable>('auto'),
|
|
84
|
+
/**
|
|
85
|
+
* 是否开启胶囊模式
|
|
86
|
+
*/
|
|
87
|
+
pills: makeBooleanProp(false),
|
|
88
|
+
/**
|
|
89
|
+
* 胶囊背景颜色
|
|
90
|
+
*/
|
|
91
|
+
pillsColor: makeStringProp(''),
|
|
92
|
+
/**
|
|
93
|
+
* 是否开启全屏模式
|
|
94
|
+
*/
|
|
95
|
+
fullscreen: makeBooleanProp(false)
|
|
84
96
|
}
|
|
85
97
|
|
|
86
98
|
export type TabsExpose = {
|