oxy-uni-ui 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/components/common/abstracts/variable.scss +132 -98
- package/components/common/util.ts +25 -0
- package/components/composables/useDynamicVirtualScroll.ts +80 -0
- package/components/oxy-action-sheet/index.scss +6 -6
- package/components/oxy-backtop/index.scss +1 -1
- package/components/oxy-badge/index.scss +2 -2
- package/components/oxy-button/index.scss +3 -6
- package/components/oxy-calendar/index.scss +2 -2
- package/components/oxy-calendar/oxy-calendar.vue +3 -3
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +72 -37
- package/components/oxy-calendar-view/monthPanel/types.ts +43 -1
- package/components/oxy-calendar-view/types.ts +1 -1
- package/components/oxy-calendar-view/utils.ts +12 -1
- package/components/oxy-calendar-view/yearPanel/types.ts +36 -2
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +64 -45
- package/components/oxy-card/index.scss +4 -4
- package/components/oxy-cell/index.scss +1 -1
- package/components/oxy-cell-group/index.scss +2 -2
- package/components/oxy-checkbox/index.scss +73 -218
- package/components/oxy-collapse/index.scss +1 -1
- package/components/oxy-collapse-item/index.scss +2 -2
- package/components/oxy-corner/index.scss +3 -3
- package/components/oxy-count-to/oxy-count-to.vue +3 -3
- package/components/oxy-count-to/types.ts +1 -1
- package/components/oxy-date-strip-item/index.scss +4 -4
- package/components/oxy-datetime-picker/types.ts +1 -1
- package/components/oxy-datetime-picker-view/types.ts +2 -2
- package/components/oxy-fab/index.scss +1 -5
- package/components/oxy-file-list/index.scss +2 -2
- package/components/oxy-footer/index.scss +2 -2
- package/components/oxy-footer/oxy-footer.vue +2 -3
- package/components/oxy-form-item/index.scss +0 -5
- package/components/oxy-grid/oxy-grid.vue +1 -1
- package/components/oxy-grid-item/index.scss +1 -1
- package/components/oxy-guidance/index.scss +2 -2
- package/components/oxy-img/index.scss +2 -2
- package/components/oxy-img-cropper/index.scss +0 -2
- package/components/oxy-img-lazy/index.scss +0 -1
- package/components/oxy-index-anchor/index.scss +3 -3
- package/components/oxy-input/index.scss +2 -2
- package/components/oxy-input-number/index.scss +21 -3
- package/components/oxy-input-number/oxy-input-number.vue +9 -1
- package/components/oxy-keyboard/index.scss +1 -1
- package/components/oxy-link/index.scss +11 -10
- package/components/oxy-loading/index.scss +1 -1
- package/components/oxy-loadmore/index.scss +1 -1
- package/components/oxy-message-box/index.scss +7 -7
- package/components/oxy-navbar/index.scss +1 -1
- package/components/oxy-navbar/oxy-navbar.vue +2 -3
- package/components/oxy-password-input/index.scss +4 -4
- package/components/oxy-picker/types.ts +1 -1
- package/components/oxy-picker-view/oxy-picker-view.vue +8 -5
- package/components/oxy-picker-view/types.ts +2 -2
- package/components/oxy-progress/index.scss +2 -2
- package/components/oxy-radio/index.scss +8 -4
- package/components/oxy-radio-group/index.scss +0 -1
- package/components/oxy-rich-text/index.scss +2 -6
- package/components/oxy-rich-text/mp-html/mp-html.d.ts +2 -0
- package/components/oxy-rich-text/mp-html/mp-html.vue +2 -1
- package/components/oxy-rich-text/mp-html/node/node.vue +23 -0
- package/components/oxy-rich-text/mp-html/parser.js +6 -6
- package/components/oxy-rich-text/oxy-rich-text.vue +23 -0
- package/components/oxy-search/index.scss +1 -1
- package/components/oxy-segmented/index.scss +4 -8
- package/components/oxy-select/index.scss +6 -6
- package/components/oxy-sidebar-item/index.scss +20 -11
- package/components/oxy-slider/index.scss +4 -5
- package/components/oxy-sort-button/index.scss +3 -5
- package/components/oxy-splitter-panel/index.scss +8 -8
- package/components/oxy-step/index.scss +9 -9
- package/components/oxy-swiper-nav/index.scss +2 -2
- package/components/oxy-switch/index.scss +3 -3
- package/components/oxy-tab/index.scss +8 -2
- package/components/oxy-tabbar/index.scss +3 -3
- package/components/oxy-tabbar/oxy-tabbar.vue +3 -3
- package/components/oxy-table/index.scss +0 -1
- package/components/oxy-table-col/index.scss +1 -2
- package/components/oxy-tabs/index.scss +3 -3
- package/components/oxy-tag/index.scss +4 -4
- package/components/oxy-text/index.scss +1 -1
- package/components/oxy-textarea/index.scss +2 -6
- package/components/oxy-toast/index.scss +1 -1
- package/components/oxy-tree/index.scss +31 -11
- package/components/oxy-tree/oxy-tree.vue +113 -2
- package/components/oxy-tree/types.ts +1 -0
- package/components/oxy-upload/index.scss +3 -3
- package/components/oxy-video-preview/index.scss +3 -3
- package/components/oxy-virtual-scroll/index.scss +1 -1
- package/components/oxy-voice-player/index.scss +36 -36
- package/components/oxy-watermark/index.scss +1 -1
- package/package.json +1 -1
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="oxy-year-panel">
|
|
3
3
|
<view v-if="showPanelTitle" class="oxy-year-panel__title">{{ title }}</view>
|
|
4
|
-
<scroll-view
|
|
5
|
-
class="oxy-year-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
:default-time="defaultTime"
|
|
23
|
-
:showTitle="index !== 0"
|
|
24
|
-
@change="handleDateChange"
|
|
25
|
-
/>
|
|
4
|
+
<scroll-view class="oxy-year-panel__container" :style="`height: ${scrollHeight}px`" scroll-y @scroll="yearScroll" :scroll-top="scrollTop">
|
|
5
|
+
<view class="oxy-year-panel__list" :style="`height: ${totalHeight}px; position: relative;`">
|
|
6
|
+
<view v-for="item in visibleYears" :key="item.date" :id="`year${item.index}`" :style="`position: absolute; top: ${item.top}px; width: 100%;`">
|
|
7
|
+
<year
|
|
8
|
+
:type="type"
|
|
9
|
+
:date="item.date"
|
|
10
|
+
:value="value"
|
|
11
|
+
:min-date="minDate"
|
|
12
|
+
:max-date="maxDate"
|
|
13
|
+
:max-range="maxRange"
|
|
14
|
+
:formatter="formatter"
|
|
15
|
+
:range-prompt="rangePrompt"
|
|
16
|
+
:allow-same-day="allowSameDay"
|
|
17
|
+
:default-time="defaultTime"
|
|
18
|
+
:showTitle="item.index !== 0"
|
|
19
|
+
@change="handleDateChange"
|
|
20
|
+
/>
|
|
21
|
+
</view>
|
|
26
22
|
</view>
|
|
27
23
|
</scroll-view>
|
|
28
24
|
</view>
|
|
@@ -39,8 +35,19 @@ export default {
|
|
|
39
35
|
|
|
40
36
|
<script lang="ts" setup>
|
|
41
37
|
import { computed, ref, onMounted } from 'vue'
|
|
42
|
-
import {
|
|
38
|
+
import {
|
|
39
|
+
compareYear,
|
|
40
|
+
formatYearTitle,
|
|
41
|
+
getYears,
|
|
42
|
+
designPxToRuntimePx,
|
|
43
|
+
YEAR_HEIGHT_WITH_TITLE,
|
|
44
|
+
YEAR_HEIGHT_WITHOUT_TITLE,
|
|
45
|
+
PANEL_EXTRA_NO_TITLE,
|
|
46
|
+
PANEL_EXTRA_WITH_TITLE,
|
|
47
|
+
YEAR_TITLE_HEIGHT
|
|
48
|
+
} from '../utils'
|
|
43
49
|
import { isArray, isNumber, pause, unitConvert } from '../../common/util'
|
|
50
|
+
import { useDynamicVirtualScroll } from '../../composables/useDynamicVirtualScroll'
|
|
44
51
|
import Year from '../year/year.vue'
|
|
45
52
|
import { yearPanelProps, type YearInfo, type YearPanelExpose } from './types'
|
|
46
53
|
|
|
@@ -48,34 +55,47 @@ const props = defineProps(yearPanelProps)
|
|
|
48
55
|
const emit = defineEmits(['change'])
|
|
49
56
|
|
|
50
57
|
const scrollTop = ref<number>(0) // 滚动位置
|
|
58
|
+
const currentScrollTop = ref<number>(0) // 当前虚拟渲染滚动位置
|
|
51
59
|
const scrollIndex = ref<number>(0) // 当前显示的年份索引
|
|
52
60
|
|
|
53
|
-
const designPxToRuntimePx = (designPx: number): number => unitConvert(`${designPx * 2}rpx`)
|
|
54
|
-
const YEAR_MONTH_HEIGHT = designPxToRuntimePx(64)
|
|
55
|
-
const YEAR_MONTH_GAP = designPxToRuntimePx(4)
|
|
56
|
-
const YEAR_TITLE_HEIGHT = designPxToRuntimePx(45)
|
|
57
|
-
const PANEL_EXTRA_WITH_TITLE = designPxToRuntimePx(26)
|
|
58
|
-
const PANEL_EXTRA_NO_TITLE = designPxToRuntimePx(16)
|
|
59
|
-
const YEAR_HEIGHT_WITHOUT_TITLE = YEAR_MONTH_HEIGHT * 3 + YEAR_MONTH_GAP * 2
|
|
60
|
-
const YEAR_HEIGHT_WITH_TITLE = YEAR_HEIGHT_WITHOUT_TITLE + YEAR_TITLE_HEIGHT
|
|
61
|
-
|
|
62
61
|
// 滚动区域的高度
|
|
63
62
|
const scrollHeight = computed(() => {
|
|
64
63
|
const panelHeight = designPxToRuntimePx(props.panelHeight)
|
|
65
|
-
const scrollHeight: number = panelHeight
|
|
64
|
+
const scrollHeight: number = panelHeight - (props.showPanelTitle ? YEAR_TITLE_HEIGHT : 0)
|
|
66
65
|
return scrollHeight
|
|
67
66
|
})
|
|
68
67
|
|
|
69
68
|
// 年份信息
|
|
70
69
|
const years = computed<YearInfo[]>(() => {
|
|
70
|
+
let top = 0
|
|
71
71
|
return getYears(props.minDate, props.maxDate).map((year, index) => {
|
|
72
|
+
const height = index === 0 ? YEAR_HEIGHT_WITHOUT_TITLE : YEAR_HEIGHT_WITH_TITLE
|
|
73
|
+
const currentTop = top
|
|
74
|
+
top += height
|
|
72
75
|
return {
|
|
73
76
|
date: year,
|
|
74
|
-
height
|
|
77
|
+
height,
|
|
78
|
+
top: currentTop
|
|
75
79
|
}
|
|
76
80
|
})
|
|
77
81
|
})
|
|
78
82
|
|
|
83
|
+
const totalHeight = computed(() => {
|
|
84
|
+
if (years.value.length === 0) return 0
|
|
85
|
+
const last = years.value[years.value.length - 1]
|
|
86
|
+
return last.top + last.height
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
// 滚动区域的高度(用于计算可视区域)
|
|
90
|
+
const viewportHeight = computed(() => designPxToRuntimePx(props.panelHeight))
|
|
91
|
+
|
|
92
|
+
// 引入动态虚拟滚动 Hook
|
|
93
|
+
const { visibleData: visibleYears, getTargetIndex } = useDynamicVirtualScroll<YearInfo>({
|
|
94
|
+
data: years,
|
|
95
|
+
scrollTop: currentScrollTop,
|
|
96
|
+
viewportHeight
|
|
97
|
+
})
|
|
98
|
+
|
|
79
99
|
// 标题
|
|
80
100
|
const title = computed(() => {
|
|
81
101
|
return formatYearTitle(years.value[scrollIndex.value].date)
|
|
@@ -107,8 +127,13 @@ async function scrollIntoView() {
|
|
|
107
127
|
}
|
|
108
128
|
scrollTop.value = 0
|
|
109
129
|
if (top > 0) {
|
|
130
|
+
const targetTop = top + (activeDate && compareYear(years.value[0].date, activeDate) !== 0 ? YEAR_TITLE_HEIGHT : 0)
|
|
131
|
+
currentScrollTop.value = targetTop
|
|
132
|
+
// 在首次渲染前同步 currentScrollTop,避免闪烁
|
|
133
|
+
scrollTop.value = targetTop
|
|
110
134
|
await pause()
|
|
111
|
-
|
|
135
|
+
} else {
|
|
136
|
+
currentScrollTop.value = 0
|
|
112
137
|
}
|
|
113
138
|
}
|
|
114
139
|
|
|
@@ -116,8 +141,9 @@ const yearScroll = (event: { detail: { scrollTop: number } }) => {
|
|
|
116
141
|
if (years.value.length <= 1) {
|
|
117
142
|
return
|
|
118
143
|
}
|
|
119
|
-
const
|
|
120
|
-
|
|
144
|
+
const st = Math.max(0, event.detail.scrollTop)
|
|
145
|
+
currentScrollTop.value = st
|
|
146
|
+
doSetSubtitle(st)
|
|
121
147
|
}
|
|
122
148
|
|
|
123
149
|
/**
|
|
@@ -125,14 +151,7 @@ const yearScroll = (event: { detail: { scrollTop: number } }) => {
|
|
|
125
151
|
* scrollTop 滚动条位置
|
|
126
152
|
*/
|
|
127
153
|
function doSetSubtitle(scrollTop: number) {
|
|
128
|
-
|
|
129
|
-
for (let index = 0; index < years.value.length; index++) {
|
|
130
|
-
height = height + years.value[index].height
|
|
131
|
-
if (scrollTop < height) {
|
|
132
|
-
scrollIndex.value = index
|
|
133
|
-
return
|
|
134
|
-
}
|
|
135
|
-
}
|
|
154
|
+
scrollIndex.value = getTargetIndex(scrollTop)
|
|
136
155
|
}
|
|
137
156
|
|
|
138
157
|
function handleDateChange({ value }: { value: number[] }) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
background-color: $-dark-background2;
|
|
6
6
|
|
|
7
7
|
@include when(rectangle) {
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
.oxy-card__content {
|
|
10
10
|
@include halfPixelBorder('top', 0, $-dark-border-color);
|
|
11
11
|
}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
border-radius: $-card-radius;
|
|
32
32
|
box-shadow: $-card-shadow-color;
|
|
33
33
|
font-size: $-card-fs;
|
|
34
|
-
margin-bottom:
|
|
34
|
+
margin-bottom: $-spacing-24;
|
|
35
35
|
|
|
36
36
|
@include when(rectangle) {
|
|
37
37
|
margin-left: 0;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
box-shadow: none;
|
|
41
41
|
|
|
42
42
|
.oxy-card__title-content {
|
|
43
|
-
font-size: $-card-fs;
|
|
43
|
+
font-size: $-card-title-fs;
|
|
44
44
|
}
|
|
45
45
|
.oxy-card__content {
|
|
46
46
|
position: relative;
|
|
@@ -68,4 +68,4 @@
|
|
|
68
68
|
padding: $-card-footer-padding;
|
|
69
69
|
text-align: right;
|
|
70
70
|
}
|
|
71
|
-
}
|
|
71
|
+
}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
font-size: $-cell-group-title-fs;
|
|
45
45
|
color: $-cell-group-title-color;
|
|
46
46
|
font-weight: $-fw-medium;
|
|
47
|
-
line-height:
|
|
47
|
+
line-height: $-line-height-loose;
|
|
48
48
|
}
|
|
49
49
|
@include e(right) {
|
|
50
50
|
color: $-cell-group-value-color;
|
|
@@ -53,4 +53,4 @@
|
|
|
53
53
|
@include e(body) {
|
|
54
54
|
background: $-color-white;
|
|
55
55
|
}
|
|
56
|
-
}
|
|
56
|
+
}
|
|
@@ -1,102 +1,45 @@
|
|
|
1
|
-
@import '
|
|
2
|
-
@import '
|
|
3
|
-
|
|
1
|
+
@import '../common/abstracts/variable.scss';
|
|
2
|
+
@import '../common/abstracts/_mixin.scss';
|
|
4
3
|
.oxy-theme-dark {
|
|
5
4
|
@include b(checkbox) {
|
|
6
5
|
@include e(shape) {
|
|
7
|
-
background:
|
|
8
|
-
border-color: $-
|
|
9
|
-
color: $-checkbox-check-color;
|
|
6
|
+
background-color: $-dark-background;
|
|
7
|
+
border-color: $-color-gray-6;
|
|
10
8
|
}
|
|
11
|
-
|
|
12
|
-
@include e(label) {
|
|
9
|
+
@include e(txt) {
|
|
13
10
|
color: $-dark-color;
|
|
14
11
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.oxy-checkbox__shape {
|
|
18
|
-
border-color: $-dark-color-gray;
|
|
19
|
-
background: $-dark-background4;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.oxy-checkbox__label {
|
|
23
|
-
color: $-dark-color-gray;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
:deep(.oxy-checkbox__check) {
|
|
27
|
-
color: $-dark-color-gray;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@include when(checked) {
|
|
31
|
-
.oxy-checkbox__shape {
|
|
32
|
-
color: $-dark-color-gray;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.oxy-checkbox__label {
|
|
36
|
-
color: $-dark-color-gray;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@include when(button) {
|
|
41
|
-
.oxy-checkbox__label {
|
|
42
|
-
border-color: $-color-gray-5;
|
|
43
|
-
background: $-dark-border-color;
|
|
44
|
-
color: $-dark-color-gray;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@include when(checked) {
|
|
48
|
-
.oxy-checkbox__label {
|
|
49
|
-
border-color: $-color-gray-5;
|
|
50
|
-
background: $-dark-border-color;
|
|
51
|
-
color: $-color-gray-5;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@include when(button) {
|
|
58
|
-
.oxy-checkbox__label {
|
|
59
|
-
background-color: $-dark-background;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@include when(checked) {
|
|
63
|
-
.oxy-checkbox__label {
|
|
64
|
-
background-color: $-dark-background2;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
12
|
+
@include e(label) {
|
|
13
|
+
color: $-dark-color3;
|
|
67
14
|
}
|
|
68
15
|
}
|
|
69
16
|
}
|
|
70
|
-
|
|
71
17
|
@include b(checkbox) {
|
|
72
18
|
display: block;
|
|
73
19
|
margin-bottom: $-checkbox-margin;
|
|
74
|
-
font-size: 0;
|
|
75
20
|
-webkit-tap-highlight-color: transparent;
|
|
76
21
|
// line-height: 1.2;
|
|
77
|
-
|
|
78
22
|
@include when(last-child) {
|
|
79
23
|
margin-bottom: 0;
|
|
80
24
|
}
|
|
81
|
-
|
|
82
25
|
@include e(shape) {
|
|
83
26
|
position: relative;
|
|
84
|
-
display: inline-
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
85
30
|
width: $-checkbox-size;
|
|
86
31
|
height: $-checkbox-size;
|
|
87
32
|
border: 4rpx solid $-checkbox-border-color;
|
|
88
|
-
border-radius:
|
|
33
|
+
border-radius: $-radius-circle;
|
|
89
34
|
color: $-checkbox-check-color;
|
|
90
35
|
background: $-checkbox-bg;
|
|
91
36
|
vertical-align: middle;
|
|
92
37
|
transition: background 0.2s;
|
|
93
38
|
box-sizing: border-box;
|
|
94
|
-
|
|
95
39
|
@include when(square) {
|
|
96
40
|
border-radius: $-checkbox-square-radius;
|
|
97
41
|
}
|
|
98
42
|
}
|
|
99
|
-
|
|
100
43
|
@include e(input) {
|
|
101
44
|
position: absolute;
|
|
102
45
|
width: 0;
|
|
@@ -104,21 +47,22 @@
|
|
|
104
47
|
margin: 0;
|
|
105
48
|
opacity: 0;
|
|
106
49
|
}
|
|
107
|
-
|
|
50
|
+
@include edeep(check, indeterminate) {
|
|
51
|
+
font-size: $-checkbox-icon-size;
|
|
52
|
+
}
|
|
108
53
|
@include edeep(btn-check) {
|
|
109
54
|
display: inline-block;
|
|
110
55
|
font-size: $-checkbox-icon-size;
|
|
111
56
|
margin-right: 8rpx;
|
|
112
57
|
vertical-align: middle;
|
|
58
|
+
color: currentColor;
|
|
113
59
|
}
|
|
114
|
-
|
|
115
60
|
@include e(txt) {
|
|
116
61
|
display: inline-block;
|
|
117
62
|
vertical-align: middle;
|
|
118
|
-
line-height:
|
|
63
|
+
line-height: $-lh-base;
|
|
119
64
|
@include lineEllipsis;
|
|
120
65
|
}
|
|
121
|
-
|
|
122
66
|
@include e(label) {
|
|
123
67
|
position: relative;
|
|
124
68
|
display: inline-block;
|
|
@@ -127,189 +71,100 @@
|
|
|
127
71
|
font-size: $-checkbox-label-fs;
|
|
128
72
|
color: $-checkbox-label-color;
|
|
129
73
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
@include edeep(indeterminate) {
|
|
139
|
-
color: $-checkbox-check-color;
|
|
140
|
-
font-size: $-checkbox-icon-size;
|
|
141
|
-
opacity: 0;
|
|
142
|
-
transition: opacity 0.2s;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
@include when(indeterminate) {
|
|
146
|
-
.oxy-checkbox__shape {
|
|
147
|
-
color: $-checkbox-checked-color;
|
|
148
|
-
background: currentColor;
|
|
149
|
-
border-color: currentColor;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
:deep(.oxy-checkbox__indeterminate) {
|
|
153
|
-
opacity: 1;
|
|
154
|
-
position: absolute;
|
|
155
|
-
left: 50%;
|
|
156
|
-
top: 50%;
|
|
157
|
-
transform: translate(-50%, -50%);
|
|
158
|
-
}
|
|
159
|
-
:deep(.oxy-checkbox__check) {
|
|
160
|
-
display: none;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
@include when(checked) {
|
|
165
|
-
.oxy-checkbox__shape {
|
|
166
|
-
display: inline-block;
|
|
167
|
-
color: $-checkbox-checked-color;
|
|
168
|
-
background: currentColor;
|
|
169
|
-
border-color: currentColor;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
:deep(.oxy-checkbox__check) {
|
|
173
|
-
opacity: 1;
|
|
174
|
-
position: absolute;
|
|
175
|
-
left: 50%;
|
|
176
|
-
top: 50%;
|
|
177
|
-
transform: translate(-50%, -50%);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
:deep(.oxy-checkbox__indeterminate) {
|
|
181
|
-
display: none;
|
|
74
|
+
@include e(icon) {
|
|
75
|
+
background: $-color-white;
|
|
76
|
+
border-radius: $-checkbox-square-radius;
|
|
77
|
+
@include when(icon-checked) {
|
|
78
|
+
background: $-checkbox-checked-color;
|
|
79
|
+
border-color: $-checkbox-checked-color;
|
|
182
80
|
}
|
|
183
81
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
82
|
@include when(button) {
|
|
187
83
|
display: inline-block;
|
|
84
|
+
width: 33.3333%;
|
|
188
85
|
margin-bottom: 0;
|
|
189
|
-
margin-right: $-checkbox-margin;
|
|
190
|
-
vertical-align: top;
|
|
191
|
-
font-size: $-checkbox-button-font-size;
|
|
192
|
-
|
|
193
|
-
@include when(last-child) {
|
|
194
|
-
margin-right: 0;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.oxy-checkbox__shape {
|
|
198
|
-
width: 0;
|
|
199
|
-
height: 0;
|
|
200
|
-
overflow: hidden;
|
|
201
|
-
opacity: 0;
|
|
202
|
-
border: none;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
86
|
.oxy-checkbox__label {
|
|
206
|
-
display:
|
|
207
|
-
flex-direction: row;
|
|
208
|
-
justify-content: center;
|
|
87
|
+
display: flex;
|
|
209
88
|
align-items: center;
|
|
210
|
-
|
|
89
|
+
justify-content: center;
|
|
211
90
|
height: $-checkbox-button-height;
|
|
212
|
-
|
|
213
|
-
margin-left: 0;
|
|
91
|
+
min-width: $-checkbox-button-min-width;
|
|
214
92
|
padding: 16rpx 32rpx;
|
|
215
93
|
border: 1px solid $-checkbox-button-border;
|
|
216
|
-
background-color: $-checkbox-button-bg;
|
|
217
|
-
border-radius: $-checkbox-button-radius;
|
|
218
|
-
transition: color 0.2s, border 0.2s;
|
|
219
94
|
box-sizing: border-box;
|
|
95
|
+
border-radius: $-checkbox-button-radius;
|
|
96
|
+
background: $-checkbox-button-bg;
|
|
97
|
+
transition: background 0.2s;
|
|
220
98
|
}
|
|
221
|
-
|
|
222
|
-
@include when(checked) {
|
|
99
|
+
@include when(disabled) {
|
|
223
100
|
.oxy-checkbox__label {
|
|
224
|
-
color: $-checkbox-
|
|
225
|
-
|
|
226
|
-
border-color: $-checkbox-checked-color;
|
|
227
|
-
border-color: currentColor;
|
|
101
|
+
border-color: $-checkbox-button-disabled-border;
|
|
102
|
+
color: $-checkbox-disabled-label-color;
|
|
228
103
|
}
|
|
229
104
|
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
@include when(inline) {
|
|
233
|
-
display: inline-block;
|
|
234
|
-
margin-bottom: 0;
|
|
235
|
-
margin-right: $-checkbox-margin;
|
|
236
|
-
|
|
237
|
-
@include when(last-child) {
|
|
238
|
-
margin-right: 0;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
@include when(disabled) {
|
|
243
|
-
.oxy-checkbox__shape {
|
|
244
|
-
border-color: $-checkbox-border-color;
|
|
245
|
-
background: $-checkbox-disabled-check-bg;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.oxy-checkbox__label {
|
|
249
|
-
color: $-checkbox-disabled-label-color;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
105
|
@include when(checked) {
|
|
253
|
-
.oxy-checkbox__shape {
|
|
254
|
-
color: $-checkbox-disabled-check-color;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
106
|
.oxy-checkbox__label {
|
|
258
|
-
color: $-checkbox-
|
|
107
|
+
border-color: $-checkbox-checked-color;
|
|
108
|
+
background: $-color-white;
|
|
109
|
+
color: $-checkbox-checked-color;
|
|
259
110
|
}
|
|
260
111
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
.oxy-checkbox__label {
|
|
264
|
-
background: $-checkbox-disabled-color;
|
|
265
|
-
border-color: $-checkbox-button-border;
|
|
266
|
-
color: $-checkbox-disabled-label-color;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
@include when(checked) {
|
|
112
|
+
@include when(checked) {
|
|
113
|
+
@include when(disabled) {
|
|
270
114
|
.oxy-checkbox__label {
|
|
271
|
-
border-color: $-checkbox-
|
|
115
|
+
border-color: $-checkbox-disabled-check-bg;
|
|
116
|
+
background: $-checkbox-disabled-check-bg;
|
|
117
|
+
color: $-checkbox-disabled-check-color;
|
|
272
118
|
}
|
|
273
119
|
}
|
|
274
120
|
}
|
|
275
121
|
}
|
|
276
|
-
|
|
277
|
-
// 以下内容用于解决父子组件样式隔离的问题 —— START
|
|
278
122
|
@include when(cell-box) {
|
|
123
|
+
display: inline-block;
|
|
279
124
|
padding: 32rpx 32rpx;
|
|
280
|
-
margin: 0;
|
|
281
|
-
|
|
282
|
-
@include when(large) {
|
|
283
|
-
padding: 32rpx 32rpx;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
@include when(button-box) {
|
|
288
|
-
display: inline-flex;
|
|
289
125
|
width: 33.3333%;
|
|
290
|
-
padding: 24rpx 24rpx 0 0;
|
|
291
126
|
box-sizing: border-box;
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
&:last-child::after {
|
|
298
|
-
content: '';
|
|
299
|
-
display: table;
|
|
300
|
-
clear: both;
|
|
127
|
+
font-size: 0;
|
|
128
|
+
@include when(checked) {
|
|
129
|
+
color: $-checkbox-checked-color;
|
|
301
130
|
}
|
|
302
131
|
}
|
|
303
|
-
|
|
304
132
|
@include when(large) {
|
|
305
133
|
.oxy-checkbox__shape {
|
|
306
134
|
width: $-checkbox-large-size;
|
|
307
135
|
height: $-checkbox-large-size;
|
|
308
|
-
font-size: $-checkbox-large-size;
|
|
309
136
|
}
|
|
310
|
-
|
|
311
137
|
.oxy-checkbox__label {
|
|
312
138
|
font-size: $-checkbox-large-label-fs;
|
|
313
139
|
}
|
|
140
|
+
@include edeep(check, indeterminate, btn-check) {
|
|
141
|
+
font-size: $-checkbox-large-icon-size;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
@include when(checked) {
|
|
145
|
+
.oxy-checkbox__shape {
|
|
146
|
+
background-color: $-checkbox-checked-color;
|
|
147
|
+
border-color: $-checkbox-checked-color;
|
|
148
|
+
}
|
|
149
|
+
.oxy-checkbox__icon {
|
|
150
|
+
background: $-checkbox-checked-color;
|
|
151
|
+
border-color: $-checkbox-checked-color;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
@include when(indeterminate) {
|
|
155
|
+
.oxy-checkbox__shape {
|
|
156
|
+
background-color: $-checkbox-checked-color;
|
|
157
|
+
border-color: $-checkbox-checked-color;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
@include when(disabled) {
|
|
161
|
+
.oxy-checkbox__shape {
|
|
162
|
+
border-color: $-checkbox-disabled-check-bg;
|
|
163
|
+
background: $-checkbox-disabled-color;
|
|
164
|
+
color: $-checkbox-disabled-check-color;
|
|
165
|
+
}
|
|
166
|
+
.oxy-checkbox__label {
|
|
167
|
+
color: $-checkbox-disabled-label-color;
|
|
168
|
+
}
|
|
314
169
|
}
|
|
315
170
|
}
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
display: block;
|
|
60
60
|
font-size: $-collapse-arrow-size;
|
|
61
61
|
color: $-collapse-arrow-color;
|
|
62
|
-
transition: transform
|
|
62
|
+
transition: transform $-transition-duration-slow;
|
|
63
63
|
|
|
64
64
|
@include when(retract) {
|
|
65
65
|
transform: rotate(-180deg);
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
color: $-collapse-body-color;
|
|
77
77
|
font-size: $-collapse-body-fs;
|
|
78
78
|
padding: $-collapse-body-padding;
|
|
79
|
-
line-height:
|
|
79
|
+
line-height: $-line-height-loose;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
@include when(disabled) {
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
border-bottom-left-radius: 0;
|
|
161
161
|
border-bottom-right-radius: 64rpx;
|
|
162
162
|
padding-left: 0;
|
|
163
|
-
padding-right:
|
|
163
|
+
padding-right: $-spacing-24;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
&.is-bottom-left{
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
border-bottom-left-radius: 0;
|
|
178
178
|
border-top-right-radius: 64rpx;
|
|
179
179
|
padding-left: 0;
|
|
180
|
-
padding-right:
|
|
180
|
+
padding-right: $-spacing-24;
|
|
181
181
|
> span{
|
|
182
182
|
transform: none;
|
|
183
183
|
}
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
right: 0;
|
|
248
248
|
top: 0;
|
|
249
249
|
transform: none;
|
|
250
|
-
padding-left:
|
|
250
|
+
padding-left: $-spacing-24;
|
|
251
251
|
box-sizing: border-box;
|
|
252
252
|
font-size: $-corner-embedded-font-size;
|
|
253
253
|
font-weight: $-corner-embedded-font-weight;
|
|
@@ -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 * 0.7}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}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 * 0.7}rpx`" :text="props.suffix"></oxy-text>
|
|
14
14
|
</slot>
|
|
15
15
|
</view>
|
|
16
16
|
</template>
|