uview-pro 0.3.16 → 0.4.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/changelog.md +66 -0
- package/components/u-action-sheet-item/u-action-sheet-item.vue +1 -1
- package/components/u-alert-tips/u-alert-tips.vue +2 -2
- package/components/u-avatar/u-avatar.vue +5 -5
- package/components/u-avatar-cropper/u-avatar-cropper.vue +5 -5
- package/components/u-avatar-cropper/weCropper.js +1 -1
- package/components/u-avatar-cropper/weCropper.ts +1 -1
- package/components/u-back-top/types.ts +1 -1
- package/components/u-back-top/u-back-top.vue +1 -1
- package/components/u-badge/u-badge.vue +1 -31
- package/components/u-button/types.ts +1 -1
- package/components/u-button/u-button.vue +45 -37
- package/components/u-calendar/types.ts +4 -4
- package/components/u-calendar/u-calendar.vue +8 -8
- package/components/u-car-keyboard/u-car-keyboard.vue +5 -5
- package/components/u-card/types.ts +2 -2
- package/components/u-card/u-card.vue +3 -3
- package/components/u-cell-group/u-cell-group.vue +1 -1
- package/components/u-cell-item/u-cell-item.vue +2 -2
- package/components/u-checkbox/u-checkbox.vue +7 -7
- package/components/u-circle-progress/types.ts +4 -3
- package/components/u-circle-progress/u-circle-progress.vue +3 -3
- package/components/u-city-select/u-city-select.vue +1 -1
- package/components/u-collapse/types.ts +2 -2
- package/components/u-collapse/u-collapse.vue +1 -1
- package/components/u-collapse-item/u-collapse-item.vue +1 -1
- package/components/u-column-notice/u-column-notice.vue +2 -2
- package/components/u-config-provider/types.ts +34 -0
- package/components/u-config-provider/u-config-provider.vue +141 -0
- package/components/u-count-down/types.ts +4 -4
- package/components/u-count-down/u-count-down.vue +4 -4
- package/components/u-count-to/types.ts +1 -1
- package/components/u-count-to/u-count-to.vue +1 -1
- package/components/u-divider/types.ts +3 -3
- package/components/u-divider/u-divider.vue +4 -4
- package/components/u-dropdown/u-dropdown.vue +3 -3
- package/components/u-empty/types.ts +2 -2
- package/components/u-empty/u-empty.vue +1 -1
- package/components/u-field/types.ts +3 -3
- package/components/u-field/u-field.vue +6 -6
- package/components/u-form-item/u-form-item.vue +1 -1
- package/components/u-full-screen/u-full-screen.vue +1 -1
- package/components/u-gap/u-gap.vue +2 -2
- package/components/u-grid-item/types.ts +1 -1
- package/components/u-grid-item/u-grid-item.vue +3 -3
- package/components/u-icon/types.ts +2 -2
- package/components/u-icon/u-icon.vue +2 -2
- package/components/u-image/types.ts +4 -2
- package/components/u-image/u-image.vue +7 -2
- package/components/u-index-anchor/u-index-anchor.vue +3 -3
- package/components/u-index-list/u-index-list.vue +1 -1
- package/components/u-input/types.ts +4 -4
- package/components/u-input/u-input.vue +7 -7
- package/components/u-keyboard/u-keyboard.vue +3 -3
- package/components/u-lazy-load/u-lazy-load.vue +1 -1
- package/components/u-line/types.ts +1 -1
- package/components/u-line/u-line.vue +1 -1
- package/components/u-line-progress/types.ts +2 -2
- package/components/u-line-progress/u-line-progress.vue +3 -3
- package/components/u-link/u-link.vue +1 -1
- package/components/u-loading/types.ts +1 -1
- package/components/u-loading/u-loading.vue +3 -3
- package/components/u-loading-popup/types.ts +1 -1
- package/components/u-loading-popup/u-loading-popup.vue +2 -2
- package/components/u-loadmore/types.ts +2 -2
- package/components/u-loadmore/u-loadmore.vue +6 -6
- package/components/u-message-input/u-message-input.vue +5 -5
- package/components/u-modal/u-modal.vue +2 -2
- package/components/u-navbar/types.ts +4 -4
- package/components/u-navbar/u-navbar.vue +27 -20
- package/components/u-no-network/u-no-network.vue +2 -2
- package/components/u-number-box/types.ts +4 -4
- package/components/u-number-box/u-number-box.vue +6 -6
- package/components/u-number-keyboard/u-number-keyboard.vue +2 -2
- package/components/u-picker/u-picker.vue +4 -4
- package/components/u-popup/types.ts +1 -1
- package/components/u-popup/u-popup.vue +6 -6
- package/components/u-radio/u-radio.vue +7 -7
- package/components/u-rate/types.ts +2 -2
- package/components/u-rate/u-rate.vue +2 -2
- package/components/u-read-more/types.ts +1 -1
- package/components/u-row-notice/u-row-notice.vue +2 -2
- package/components/u-search/types.ts +4 -4
- package/components/u-search/u-search.vue +4 -4
- package/components/u-section/types.ts +2 -2
- package/components/u-section/u-section.vue +2 -2
- package/components/u-select/u-select.vue +6 -6
- package/components/u-skeleton/types.ts +2 -2
- package/components/u-skeleton/u-skeleton.vue +2 -2
- package/components/u-slider/types.ts +1 -1
- package/components/u-slider/u-slider.vue +4 -4
- package/components/u-step/u-step.vue +4 -4
- package/components/u-steps/u-steps.vue +3 -3
- package/components/u-sticky/types.ts +1 -1
- package/components/u-sticky/u-sticky.vue +1 -1
- package/components/u-subsection/types.ts +4 -4
- package/components/u-subsection/u-subsection.vue +7 -7
- package/components/u-swipe-action/types.ts +1 -1
- package/components/u-swipe-action/u-swipe-action.vue +2 -2
- package/components/u-swiper/types.ts +1 -1
- package/components/u-swiper/u-swiper.vue +1 -1
- package/components/u-switch/types.ts +1 -1
- package/components/u-switch/u-switch.vue +5 -5
- package/components/u-tabbar/types.ts +5 -4
- package/components/u-tabbar/u-tabbar.vue +5 -5
- package/components/u-table/types.ts +3 -3
- package/components/u-table/u-table.vue +3 -3
- package/components/u-tabs/types.ts +1 -1
- package/components/u-tabs/u-tabs.vue +2 -2
- package/components/u-tabs-swiper/types.ts +1 -1
- package/components/u-tabs-swiper/u-tabs-swiper.vue +2 -2
- package/components/u-tag/u-tag.vue +12 -12
- package/components/u-text/types.ts +1 -1
- package/components/u-text/u-text.vue +1 -1
- package/components/u-textarea/types.ts +1 -1
- package/components/u-textarea/u-textarea.vue +6 -6
- package/components/u-time-line/u-time-line.vue +1 -1
- package/components/u-time-line-item/types.ts +1 -1
- package/components/u-time-line-item/u-time-line-item.vue +2 -3
- package/components/u-toast/u-toast.vue +8 -8
- package/components/u-top-tips/u-top-tips.vue +1 -1
- package/components/u-upload/types.ts +2 -2
- package/components/u-upload/u-upload.vue +1 -1
- package/index.scss +1 -0
- package/index.ts +35 -10
- package/libs/config/theme-tokens.ts +101 -0
- package/libs/css/style.theme.scss +31 -0
- package/libs/css/style.vue.scss +1 -1
- package/libs/function/clipboard.ts +6 -11
- package/libs/function/color.ts +53 -22
- package/libs/hooks/index.ts +2 -0
- package/libs/hooks/useColor.ts +61 -0
- package/libs/hooks/useTheme.ts +162 -0
- package/libs/index.ts +4 -3
- package/libs/util/config-provider.ts +558 -0
- package/libs/util/system-theme.ts +25 -0
- package/package.json +107 -107
- package/theme.scss +50 -34
- package/types/components.d.ts +1 -0
- package/types/global.d.ts +47 -2
|
@@ -7,8 +7,8 @@ import type { ExtractPropTypes, PropType } from 'vue';
|
|
|
7
7
|
export const NumberBoxProps = {
|
|
8
8
|
/** 输入框初始值(默认1) */
|
|
9
9
|
modelValue: { type: Number, default: 1 },
|
|
10
|
-
/**
|
|
11
|
-
bgColor: { type: String, default: '
|
|
10
|
+
/** 输入框和按钮的背景颜色(默认var(--u-bg-gray-light)) */
|
|
11
|
+
bgColor: { type: String, default: 'var(--u-bg-gray-light)' },
|
|
12
12
|
/** 用户可输入的最小值(默认0) */
|
|
13
13
|
min: { type: Number, default: 0 },
|
|
14
14
|
/** 用户可输入的最大值(默认99999) */
|
|
@@ -19,8 +19,8 @@ export const NumberBoxProps = {
|
|
|
19
19
|
disabled: { type: Boolean, default: false },
|
|
20
20
|
/** 输入框文字和按钮字体大小,单位rpx(默认26) */
|
|
21
21
|
size: { type: [Number, String] as PropType<number | string>, default: 26 },
|
|
22
|
-
/**
|
|
23
|
-
color: { type: String, default: '
|
|
22
|
+
/** 输入框文字和加减按钮图标的颜色(默认var(--u-main-color)) */
|
|
23
|
+
color: { type: String, default: 'var(--u-main-color)' },
|
|
24
24
|
/** 输入框宽度,单位rpx(默认80) */
|
|
25
25
|
inputWidth: { type: [Number, String] as PropType<number | string>, default: 80 },
|
|
26
26
|
/** 输入框和按钮的高度,单位rpx(默认50) */
|
|
@@ -68,7 +68,7 @@ import { NumberBoxProps } from './types';
|
|
|
68
68
|
* @description 该组件一般用于商城购物选择物品数量的场景。注意:该输入框只能输入大于或等于0的整数,不支持小数输入
|
|
69
69
|
* @tutorial https://uviewpro.cn/zh/components/numberBox.html
|
|
70
70
|
* @property {Number} modelValue 输入框初始值(默认1)
|
|
71
|
-
* @property {String} bg-color
|
|
71
|
+
* @property {String} bg-color 输入框和按钮的背景颜色(默认var(--u-bg-gray-light))
|
|
72
72
|
* @property {Number} min 用户可输入的最小值(默认0)
|
|
73
73
|
* @property {Number} max 用户可输入的最大值(默认99999)
|
|
74
74
|
* @property {Number} step 步长,每次加或减的值(默认1)
|
|
@@ -76,7 +76,7 @@ import { NumberBoxProps } from './types';
|
|
|
76
76
|
* @property {Boolean} disabled-input 是否禁止输入框手动输入值(默认false)
|
|
77
77
|
* @property {Boolean} positive-integer 是否只能输入正整数(默认true)
|
|
78
78
|
* @property {String | Number} size 输入框文字和按钮字体大小,单位rpx(默认26)
|
|
79
|
-
* @property {String} color
|
|
79
|
+
* @property {String} color 输入框文字和加减按钮图标的颜色(默认var(--u-main-color))
|
|
80
80
|
* @property {String | Number} input-width 输入框宽度,单位rpx(默认80)
|
|
81
81
|
* @property {String | Number} input-height 输入框和按钮的高度,单位rpx(默认50)
|
|
82
82
|
* @property {String | Number} index 事件回调时用以区分当前发生变化的是哪个输入框
|
|
@@ -310,12 +310,12 @@ function handleChange(value: number, type: 'update:modelValue' | 'change' | 'blu
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
.u-icon-disabled {
|
|
313
|
-
color:
|
|
314
|
-
background:
|
|
313
|
+
color: var(--u-bg-gray-light) !important;
|
|
314
|
+
background: var(--u-bg-gray-light) !important;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
.u-input-disabled {
|
|
318
|
-
color:
|
|
319
|
-
background-color:
|
|
318
|
+
color: var(--u-bg-gray-light) !important;
|
|
319
|
+
background-color: var(--u-bg-gray-light) !important;
|
|
320
320
|
}
|
|
321
321
|
</style>
|
|
@@ -166,7 +166,7 @@ function keyboardClick(val: string | number) {
|
|
|
166
166
|
flex: 0 0 33.3333333333%;
|
|
167
167
|
text-align: center;
|
|
168
168
|
font-size: 50rpx;
|
|
169
|
-
color:
|
|
169
|
+
color: var(--u-main-color);
|
|
170
170
|
@include vue-flex;
|
|
171
171
|
align-items: center;
|
|
172
172
|
justify-content: center;
|
|
@@ -183,6 +183,6 @@ function keyboardClick(val: string | number) {
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
.u-keyboard-hover {
|
|
186
|
-
background-color:
|
|
186
|
+
background-color: var(--u-divider-color);
|
|
187
187
|
}
|
|
188
188
|
</style>
|
|
@@ -167,7 +167,7 @@ import { PickerProps } from './types';
|
|
|
167
167
|
* @property {String Number} end-year 可选的结束年份,mode=time时有效(默认2050)
|
|
168
168
|
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配(默认false)
|
|
169
169
|
* @property {Boolean} show-time-tag 时间模式时,是否显示后面的年月日中文提示
|
|
170
|
-
* @property {String} cancel-color
|
|
170
|
+
* @property {String} cancel-color 取消按钮的颜色(默认var(--u-content-color))
|
|
171
171
|
* @property {String} confirm-color 确认按钮的颜色(默认主题色primary)
|
|
172
172
|
* @property {String} default-time 默认选中的时间,mode=time时有效
|
|
173
173
|
* @property {String} confirm-text 确认按钮的文字
|
|
@@ -773,14 +773,14 @@ onMounted(() => {
|
|
|
773
773
|
align-items: center;
|
|
774
774
|
box-sizing: border-box;
|
|
775
775
|
font-size: 30rpx;
|
|
776
|
-
background:
|
|
776
|
+
background-color: var(--u-bg-white);
|
|
777
777
|
position: relative;
|
|
778
778
|
}
|
|
779
779
|
|
|
780
780
|
.u-picker-header::after {
|
|
781
781
|
content: '';
|
|
782
782
|
position: absolute;
|
|
783
|
-
border-bottom: 1rpx solid
|
|
783
|
+
border-bottom: 1rpx solid var(--u-bg-gray-light);
|
|
784
784
|
-webkit-transform: scaleY(0.5);
|
|
785
785
|
transform: scaleY(0.5);
|
|
786
786
|
bottom: 0;
|
|
@@ -796,7 +796,7 @@ onMounted(() => {
|
|
|
796
796
|
width: 100%;
|
|
797
797
|
height: 500rpx;
|
|
798
798
|
overflow: hidden;
|
|
799
|
-
background-color:
|
|
799
|
+
background-color: var(--u-bg-white);
|
|
800
800
|
}
|
|
801
801
|
|
|
802
802
|
.u-column-item {
|
|
@@ -41,7 +41,7 @@ export const PopupProps = {
|
|
|
41
41
|
/** 自定义关闭图标位置,top-left为左上角,top-right为右上角,bottom-left为左下角,bottom-right为右下角 */
|
|
42
42
|
closeIconPos: { type: String as PropType<PopupCloseIconPos>, default: 'top-right' },
|
|
43
43
|
/** 关闭图标的颜色 */
|
|
44
|
-
closeIconColor: { type: String, default: '
|
|
44
|
+
closeIconColor: { type: String, default: 'var(--u-tips-color)' },
|
|
45
45
|
/** 关闭图标的大小,单位rpx */
|
|
46
46
|
closeIconSize: { type: [String, Number] as PropType<number | string>, default: '30' },
|
|
47
47
|
/** 弹窗宽度 */
|
|
@@ -92,7 +92,7 @@ import { PopupProps } from './types';
|
|
|
92
92
|
* @property {Boolean} closeable 是否显示关闭图标(默认false)
|
|
93
93
|
* @property {String} close-icon 关闭图标的名称,只能uView的内置图标
|
|
94
94
|
* @property {String} close-icon-pos 自定义关闭图标位置(默认top-right)
|
|
95
|
-
* @property {String} close-icon-color
|
|
95
|
+
* @property {String} close-icon-color 关闭图标的颜色(默认var(--u-tips-color))
|
|
96
96
|
* @property {Number | String} close-icon-size 关闭图标的大小,单位rpx(默认30)
|
|
97
97
|
* @event {Function} open 弹出层打开
|
|
98
98
|
* @event {Function} close 弹出层收起
|
|
@@ -293,28 +293,28 @@ function change(param1: 'showDrawer' | 'visibleSync', param2: 'visibleSync' | 's
|
|
|
293
293
|
top: 0;
|
|
294
294
|
bottom: 0;
|
|
295
295
|
left: 0;
|
|
296
|
-
background-color:
|
|
296
|
+
background-color: var(--u-bg-white);
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
.u-drawer-right {
|
|
300
300
|
right: 0;
|
|
301
301
|
top: 0;
|
|
302
302
|
bottom: 0;
|
|
303
|
-
background-color:
|
|
303
|
+
background-color: var(--u-bg-white);
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
.u-drawer-top {
|
|
307
307
|
top: 0;
|
|
308
308
|
left: 0;
|
|
309
309
|
right: 0;
|
|
310
|
-
background-color:
|
|
310
|
+
background-color: var(--u-bg-white);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
.u-drawer-bottom {
|
|
314
314
|
bottom: 0;
|
|
315
315
|
left: 0;
|
|
316
316
|
right: 0;
|
|
317
|
-
background-color:
|
|
317
|
+
background-color: var(--u-bg-white);
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
.u-drawer-center {
|
|
@@ -337,7 +337,7 @@ function change(param1: 'showDrawer' | 'visibleSync', param2: 'visibleSync' | 's
|
|
|
337
337
|
display: block;
|
|
338
338
|
/* #endif */
|
|
339
339
|
position: relative;
|
|
340
|
-
background-color:
|
|
340
|
+
background-color: var(--u-bg-white);
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
.u-drawer-content-visible.u-drawer-center {
|
|
@@ -136,7 +136,7 @@ const iconStyle = computed(() => {
|
|
|
136
136
|
return style;
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
-
const iconColor = computed(() => (props.name == parentData.value.value ? '
|
|
139
|
+
const iconColor = computed(() => (props.name == parentData.value.value ? 'var(--u-white-color)' : 'transparent'));
|
|
140
140
|
|
|
141
141
|
const iconClass = computed(() => {
|
|
142
142
|
let classes: string[] = [];
|
|
@@ -230,7 +230,7 @@ function setRadioCheckedStatus() {
|
|
|
230
230
|
text-align: center;
|
|
231
231
|
transition-property: color, border-color, background-color;
|
|
232
232
|
font-size: 20px;
|
|
233
|
-
border: 1px solid
|
|
233
|
+
border: 1px solid var(--u-border-color);
|
|
234
234
|
transition-duration: 0.2s;
|
|
235
235
|
|
|
236
236
|
/* #ifdef MP-TOUTIAO */
|
|
@@ -249,18 +249,18 @@ function setRadioCheckedStatus() {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
&--checked {
|
|
252
|
-
color:
|
|
252
|
+
color: var(--u-white-color);
|
|
253
253
|
background-color: $u-type-primary;
|
|
254
254
|
border-color: $u-type-primary;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
&--disabled {
|
|
258
|
-
background-color:
|
|
259
|
-
border-color:
|
|
258
|
+
background-color: var(--u-bg-gray-light);
|
|
259
|
+
border-color: var(--u-border-color);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
&--disabled--checked {
|
|
263
|
-
color:
|
|
263
|
+
color: var(--u-bg-gray-light) !important;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
|
|
@@ -272,7 +272,7 @@ function setRadioCheckedStatus() {
|
|
|
272
272
|
font-size: 30rpx;
|
|
273
273
|
|
|
274
274
|
&--disabled {
|
|
275
|
-
color:
|
|
275
|
+
color: var(--u-bg-gray-light);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
}
|
|
@@ -18,9 +18,9 @@ export const RateProps = {
|
|
|
18
18
|
/** 星星的大小,单位rpx */
|
|
19
19
|
size: { type: [Number, String] as PropType<number | string>, default: 32 },
|
|
20
20
|
/** 未选中时的颜色 */
|
|
21
|
-
inactiveColor: { type: String, default: '
|
|
21
|
+
inactiveColor: { type: String, default: 'var(--u-light-color)' },
|
|
22
22
|
/** 选中的颜色 */
|
|
23
|
-
activeColor: { type: String, default: '
|
|
23
|
+
activeColor: { type: String, default: 'var(--u-type-error)' },
|
|
24
24
|
/** 星星之间的间距,单位rpx */
|
|
25
25
|
gutter: { type: [Number, String] as PropType<number | string>, default: 10 },
|
|
26
26
|
/** 最少能选择的星星个数 */
|
|
@@ -50,8 +50,8 @@ import { RateProps } from './types';
|
|
|
50
50
|
* @property {String|Number} current 默认选中的星星数量(默认0)
|
|
51
51
|
* @property {Boolean} disabled 是否禁止用户操作(默认false)
|
|
52
52
|
* @property {String|Number} size 星星的大小,单位rpx(默认32)
|
|
53
|
-
* @property {String} inactive-color
|
|
54
|
-
* @property {String} active-color
|
|
53
|
+
* @property {String} inactive-color 未选中星星的颜色(默认var(--u-light-color))
|
|
54
|
+
* @property {String} active-color 选中的星星颜色(默认var(--u-type-error))
|
|
55
55
|
* @property {String} active-icon 选中时的图标名,只能为uView的内置图标(默认star-fill)
|
|
56
56
|
* @property {String} inactive-icon 未选中时的图标名,只能为uView的内置图标(默认star)
|
|
57
57
|
* @property {String|Number} gutter 星星之间的距离(默认10)
|
|
@@ -24,7 +24,7 @@ export const ReadMoreProps = {
|
|
|
24
24
|
shadowStyle: {
|
|
25
25
|
type: Object as PropType<Record<string, any>>,
|
|
26
26
|
default: () => ({
|
|
27
|
-
backgroundImage: 'linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%,
|
|
27
|
+
backgroundImage: 'linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, var(--u-bg-white) 80%)',
|
|
28
28
|
paddingTop: '300rpx',
|
|
29
29
|
marginTop: '-300rpx'
|
|
30
30
|
})
|
|
@@ -99,7 +99,7 @@ const showText = ref(''); // 显示的文本
|
|
|
99
99
|
const computeColor = computed(() => {
|
|
100
100
|
if (props.color) return props.color;
|
|
101
101
|
// 如果是无主题,就默认使用content-color
|
|
102
|
-
else if (props.type === 'none') return '
|
|
102
|
+
else if (props.type === 'none') return 'var(--u-content-color)';
|
|
103
103
|
else return props.type;
|
|
104
104
|
});
|
|
105
105
|
|
|
@@ -109,7 +109,7 @@ const computeColor = computed(() => {
|
|
|
109
109
|
const textStyle = computed(() => {
|
|
110
110
|
const style: Record<string, any> = {};
|
|
111
111
|
if (props.color) style.color = props.color;
|
|
112
|
-
else if (props.type === 'none') style.color = '
|
|
112
|
+
else if (props.type === 'none') style.color = 'var(--u-content-color)';
|
|
113
113
|
style.fontSize = props.fontSize + 'rpx';
|
|
114
114
|
return style;
|
|
115
115
|
});
|
|
@@ -10,8 +10,8 @@ export const SearchProps = {
|
|
|
10
10
|
...baseProps,
|
|
11
11
|
/** 搜索框形状,round-圆形,square-方形 */
|
|
12
12
|
shape: { type: String as PropType<SearchShape>, default: 'round' },
|
|
13
|
-
/**
|
|
14
|
-
bgColor: { type: String, default: '
|
|
13
|
+
/** 搜索框背景色,默认值var(--u-bg-gray-light) */
|
|
14
|
+
bgColor: { type: String, default: 'var(--u-bg-gray-light)' },
|
|
15
15
|
/** 占位提示文字 */
|
|
16
16
|
placeholder: { type: String, default: '请输入关键字' },
|
|
17
17
|
/** 是否启用清除控件 */
|
|
@@ -43,9 +43,9 @@ export const SearchProps = {
|
|
|
43
43
|
/** 搜索图标的颜色,默认同输入框字体颜色 */
|
|
44
44
|
searchIconColor: { type: String, default: '' },
|
|
45
45
|
/** 输入框字体颜色 */
|
|
46
|
-
color: { type: String, default: '
|
|
46
|
+
color: { type: String, default: 'var(--u-content-color)' },
|
|
47
47
|
/** placeholder的颜色 */
|
|
48
|
-
placeholderColor: { type: String, default: '
|
|
48
|
+
placeholderColor: { type: String, default: 'var(--u-tips-color)' },
|
|
49
49
|
/** 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30rpx"、"30rpx 20rpx"等写法 */
|
|
50
50
|
margin: { type: String, default: '0' },
|
|
51
51
|
/** 左边输入框的图标,可以为uView图标名称或图片路径 */
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
]"
|
|
48
48
|
/>
|
|
49
49
|
<view class="u-close-wrap" v-if="keyword && clearabled && focused" @tap="clear">
|
|
50
|
-
<u-icon class="u-clear-icon" name="close-circle-fill" size="34" color="
|
|
50
|
+
<u-icon class="u-clear-icon" name="close-circle-fill" size="34" color="var(--u-light-color)"></u-icon>
|
|
51
51
|
</view>
|
|
52
52
|
</view>
|
|
53
53
|
<view
|
|
@@ -84,7 +84,7 @@ import { $u } from '../..';
|
|
|
84
84
|
* @description 搜索组件,集成了常见搜索框所需功能,用户可以一键引入,开箱即用。
|
|
85
85
|
* @tutorial https://uviewpro.cn/zh/components/search.html
|
|
86
86
|
* @property {String} shape 搜索框形状,round-圆形,square-方形(默认round)
|
|
87
|
-
* @property {String} bg-color
|
|
87
|
+
* @property {String} bg-color 搜索框背景颜色(默认var(--u-bg-gray-light))
|
|
88
88
|
* @property {String} border-color 边框颜色,配置了颜色,才会有边框
|
|
89
89
|
* @property {String} placeholder 占位文字内容(默认“请输入关键字”)
|
|
90
90
|
* @property {Boolean} clearabled 是否启用清除控件(默认true)
|
|
@@ -96,8 +96,8 @@ import { $u } from '../..';
|
|
|
96
96
|
* @property {Object} input-style 自定义输入框样式,对象形式
|
|
97
97
|
* @property {Boolean} disabled 是否启用输入框(默认false)
|
|
98
98
|
* @property {String} search-icon-color 搜索图标的颜色,默认同输入框字体颜色
|
|
99
|
-
* @property {String} color
|
|
100
|
-
* @property {String} placeholder-color placeholder
|
|
99
|
+
* @property {String} color 输入框字体颜色(默认var(--u-content-color))
|
|
100
|
+
* @property {String} placeholder-color placeholder的颜色(默认var(--u-tips-color))
|
|
101
101
|
* @property {String} search-icon 输入框左边的图标,可以为uView图标名称或图片路径
|
|
102
102
|
* @property {String} margin 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30rpx"
|
|
103
103
|
* @property {Boolean} animation 是否开启动画,见上方说明(默认false)
|
|
@@ -20,9 +20,9 @@ export const SectionProps = {
|
|
|
20
20
|
/** 主标题是否加粗 */
|
|
21
21
|
bold: { type: Boolean, default: true },
|
|
22
22
|
/** 主标题的颜色 */
|
|
23
|
-
color: { type: String, default: '
|
|
23
|
+
color: { type: String, default: 'var(--u-main-color)' },
|
|
24
24
|
/** 右边副标题的颜色 */
|
|
25
|
-
subColor: { type: String, default: '
|
|
25
|
+
subColor: { type: String, default: 'var(--u-tips-color)' },
|
|
26
26
|
/** 是否显示左边的竖条 */
|
|
27
27
|
showLine: { type: Boolean, default: true },
|
|
28
28
|
/** 左边竖线的颜色 */
|
|
@@ -79,8 +79,8 @@ import { $u } from '../..';
|
|
|
79
79
|
* @property {Boolean} arrow 是否显示右边箭头(默认true)
|
|
80
80
|
* @property {String|Number} fontSize 主标题的字体大小(默认28)
|
|
81
81
|
* @property {Boolean} bold 主标题是否加粗(默认true)
|
|
82
|
-
* @property {String} color
|
|
83
|
-
* @property {String} subColor
|
|
82
|
+
* @property {String} color 主标题颜色(默认var(--u-main-color))
|
|
83
|
+
* @property {String} subColor 右边副标题颜色(默认var(--u-tips-color))
|
|
84
84
|
* @property {String} lineColor 左边竖线的颜色
|
|
85
85
|
* @event click 组件右侧的内容被点击时触发,用于跳转"更多"
|
|
86
86
|
* @example <u-section title="今日热门" :right="false"></u-section>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<view class="u-select__action__icon" :class="{
|
|
7
7
|
'u-select__action__icon--reverse': value == true
|
|
8
8
|
}">
|
|
9
|
-
<u-icon name="arrow-down-fill" size="26" color="
|
|
9
|
+
<u-icon name="arrow-down-fill" size="26" color="var(--u-light-color)"></u-icon>
|
|
10
10
|
</view>
|
|
11
11
|
</view> -->
|
|
12
12
|
<u-popup
|
|
@@ -94,7 +94,7 @@ import { $u } from '../..';
|
|
|
94
94
|
* @property {Array} list 列数据,数组形式,见官网说明
|
|
95
95
|
* @property {Boolean} v-model 布尔值变量,用于控制选择器的弹出与收起
|
|
96
96
|
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配(默认false)
|
|
97
|
-
* @property {String} cancel-color
|
|
97
|
+
* @property {String} cancel-color 取消按钮的颜色(默认var(--u-content-color))
|
|
98
98
|
* @property {String} confirm-color 确认按钮的颜色(默认主题色primary)
|
|
99
99
|
* @property {String} confirm-text 确认按钮的文字
|
|
100
100
|
* @property {String} cancel-text 取消按钮的文字
|
|
@@ -363,8 +363,8 @@ function is2DList(list: SelectListItem[] | SelectListItem[][]): list is SelectLi
|
|
|
363
363
|
.u-select {
|
|
364
364
|
&__action {
|
|
365
365
|
position: relative;
|
|
366
|
-
line-height:
|
|
367
|
-
height:
|
|
366
|
+
line-height: 70rpx;
|
|
367
|
+
height: 70rpx;
|
|
368
368
|
|
|
369
369
|
&__icon {
|
|
370
370
|
position: absolute;
|
|
@@ -383,7 +383,7 @@ function is2DList(list: SelectListItem[] | SelectListItem[][]): list is SelectLi
|
|
|
383
383
|
&--border {
|
|
384
384
|
border-radius: 6rpx;
|
|
385
385
|
border-radius: 4px;
|
|
386
|
-
border: 1px solid $u-
|
|
386
|
+
border: 1px solid $u-border-color;
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
&__header {
|
|
@@ -406,7 +406,7 @@ function is2DList(list: SelectListItem[] | SelectListItem[][]): list is SelectLi
|
|
|
406
406
|
width: 100%;
|
|
407
407
|
height: 500rpx;
|
|
408
408
|
overflow: hidden;
|
|
409
|
-
background-color:
|
|
409
|
+
background-color: var(--u-bg-white);
|
|
410
410
|
|
|
411
411
|
&__picker-view {
|
|
412
412
|
height: 100%;
|
|
@@ -8,9 +8,9 @@ import { baseProps } from '../common/props';
|
|
|
8
8
|
export const SkeletonProps = {
|
|
9
9
|
...baseProps,
|
|
10
10
|
/** 骨架块状元素的背景颜色 */
|
|
11
|
-
elColor: { type: String, default: '
|
|
11
|
+
elColor: { type: String, default: 'var(--u-divider-color)' },
|
|
12
12
|
/** 整个骨架屏页面的背景颜色 */
|
|
13
|
-
bgColor: { type: String, default: '
|
|
13
|
+
bgColor: { type: String, default: 'var(--u-bg-white)' },
|
|
14
14
|
/** 是否显示加载动画 */
|
|
15
15
|
animation: { type: Boolean, default: false },
|
|
16
16
|
/** 圆角值,只对类名为u-skeleton-fillet的元素生效 */
|
|
@@ -43,8 +43,8 @@ import { SkeletonProps } from './types';
|
|
|
43
43
|
* skeleton 骨架屏
|
|
44
44
|
* @description 骨架屏一般用于页面在请求远程数据尚未完成时,页面用灰色块预显示本来的页面结构,给用户更好的体验。
|
|
45
45
|
* @tutorial https://uviewpro.cn/zh/components/skeleton.html
|
|
46
|
-
* @property {String} elColor
|
|
47
|
-
* @property {String} bgColor
|
|
46
|
+
* @property {String} elColor 骨架块状元素的背景颜色(默认var(--u-divider-color))
|
|
47
|
+
* @property {String} bgColor 骨架组件背景颜色(默认var(--u-bg-white))
|
|
48
48
|
* @property {Boolean} animation 骨架块是否显示动画效果(默认false)
|
|
49
49
|
* @property {String|Number} borderRadius u-skeleton-fillet类名元素,对应的骨架块的圆角大小,单位rpx(默认10)
|
|
50
50
|
* @property {Boolean} loading 是否显示骨架组件,请求完成后,将此值设置为false(默认true)
|
|
@@ -27,7 +27,7 @@ export const SliderProps = {
|
|
|
27
27
|
/** 进度条的背景颜色 */
|
|
28
28
|
inactiveColor: { type: String, default: () => getColor('lightColor') },
|
|
29
29
|
/** 滑块的背景颜色 */
|
|
30
|
-
blockColor: { type: String, default: '
|
|
30
|
+
blockColor: { type: String, default: 'var(--u-bg-white)' },
|
|
31
31
|
/** 用户对滑块的自定义颜色 */
|
|
32
32
|
blockStyle: { type: Object as PropType<Record<string, any>>, default: () => ({}) }
|
|
33
33
|
};
|
|
@@ -65,9 +65,9 @@ import { SliderProps } from './types';
|
|
|
65
65
|
* @property {Number | String} step 步长(默认1)
|
|
66
66
|
* @property {Number | String} blockWidth 滑块宽度,高等于宽(30)
|
|
67
67
|
* @property {Number | String} height 滑块条高度,单位rpx(默认6)
|
|
68
|
-
* @property {String} inactiveColor
|
|
68
|
+
* @property {String} inactiveColor 底部条背景颜色(默认var(--u-light-color))
|
|
69
69
|
* @property {String} activeColor 底部选择部分的背景颜色(默认主题色primary)
|
|
70
|
-
* @property {String} blockColor
|
|
70
|
+
* @property {String} blockColor 滑块颜色(默认var(--u-bg-white))
|
|
71
71
|
* @property {Object} blockStyle 给滑块自定义样式,对象形式
|
|
72
72
|
* @property {Boolean} disabled 是否禁用滑块(默认为false)
|
|
73
73
|
* @event start 滑动触发
|
|
@@ -213,7 +213,7 @@ function onClick(event: any) {
|
|
|
213
213
|
.u-slider {
|
|
214
214
|
position: relative;
|
|
215
215
|
border-radius: 999px;
|
|
216
|
-
background-color:
|
|
216
|
+
background-color: var(--u-bg-gray-light);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
.u-slider:before {
|
|
@@ -238,7 +238,7 @@ function onClick(event: any) {
|
|
|
238
238
|
height: 24px;
|
|
239
239
|
border-radius: 50%;
|
|
240
240
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
|
241
|
-
background-color:
|
|
241
|
+
background-color: var(--u-bg-white);
|
|
242
242
|
cursor: pointer;
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<view v-else class="u-steps__item__num--circle">
|
|
15
15
|
<slot name="icon">
|
|
16
16
|
<view class="u-steps__item__num--icon" :style="numberStyle(childIndex)">
|
|
17
|
-
<u-icon size="22" color="
|
|
17
|
+
<u-icon size="22" color="var(--u-white-color)" :name="iconName"></u-icon>
|
|
18
18
|
</view>
|
|
19
19
|
</slot>
|
|
20
20
|
</view>
|
|
@@ -119,7 +119,7 @@ const iconName = computed(() => {
|
|
|
119
119
|
|
|
120
120
|
// 计算当前步骤的样式
|
|
121
121
|
const numberStyle = (index: number) => ({
|
|
122
|
-
backgroundColor: currentIndex.value < index ? '
|
|
122
|
+
backgroundColor: currentIndex.value < index ? 'var(--u-white-color)' : activeColor.value,
|
|
123
123
|
borderColor: currentIndex.value < index ? unActiveColor.value : activeColor.value
|
|
124
124
|
});
|
|
125
125
|
|
|
@@ -149,7 +149,7 @@ $u-steps-item-dot-width: 20rpx;
|
|
|
149
149
|
position: relative;
|
|
150
150
|
min-width: 100rpx;
|
|
151
151
|
font-size: 26rpx;
|
|
152
|
-
color:
|
|
152
|
+
color: var(--u-tips-color);
|
|
153
153
|
@include vue-flex;
|
|
154
154
|
flex-direction: column;
|
|
155
155
|
|
|
@@ -222,7 +222,7 @@ $u-steps-item-dot-width: 20rpx;
|
|
|
222
222
|
}
|
|
223
223
|
&--text,
|
|
224
224
|
&--icon {
|
|
225
|
-
border: 1px solid
|
|
225
|
+
border: 1px solid var(--u-tips-color);
|
|
226
226
|
border-radius: 50%;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<text v-if="currentIndex < index" :style="textStyle(index)">
|
|
21
21
|
{{ index + 1 }}
|
|
22
22
|
</text>
|
|
23
|
-
<u-icon v-else size="22" color="
|
|
23
|
+
<u-icon v-else size="22" color="var(--u-white-color)" :name="icon"></u-icon>
|
|
24
24
|
</view>
|
|
25
25
|
<view class="u-steps__item__dot" v-if="mode == 'dot'" :style="dotStyle(index)"></view>
|
|
26
26
|
<text class="u-line-1" :style="textStyle(index)" :class="['u-steps__item__text--' + direction]">
|
|
@@ -66,9 +66,9 @@ import { $u, useParent } from '../..';
|
|
|
66
66
|
* @property {String} direction row-横向,column-竖向(默认row)
|
|
67
67
|
* @property {Number|String} current 设置当前处于第几步
|
|
68
68
|
* @property {String} activeColor 已完成步骤的激活颜色,如设置,type值会失效
|
|
69
|
-
* @property {String} unActiveColor
|
|
69
|
+
* @property {String} unActiveColor 未激活的颜色,用于表示未完成步骤的颜色(默认var(--u-content-color))
|
|
70
70
|
* @property {String} icon 自定义图标
|
|
71
|
-
* @example <u-steps :list="numList" active-color="
|
|
71
|
+
* @example <u-steps :list="numList" active-color="var(--u-type-error)"></u-steps>
|
|
72
72
|
*/
|
|
73
73
|
|
|
74
74
|
const props = defineProps(StepsProps);
|
|
@@ -16,7 +16,7 @@ export const StickyProps = {
|
|
|
16
16
|
/** h5顶部导航栏的高度 */
|
|
17
17
|
h5NavHeight: { type: [Number, String] as PropType<number | string>, default: 44 },
|
|
18
18
|
/** 吸顶区域的背景颜色 */
|
|
19
|
-
bgColor: { type: String, default: '
|
|
19
|
+
bgColor: { type: String, default: 'var(--u-bg-white)' },
|
|
20
20
|
/** z-index值 */
|
|
21
21
|
zIndex: { type: [Number, String] as PropType<number | string>, default: '' }
|
|
22
22
|
};
|
|
@@ -54,7 +54,7 @@ import { StickyProps } from './types';
|
|
|
54
54
|
* @property {String|Number} offsetTop 吸顶时与顶部的距离,单位rpx(默认0)
|
|
55
55
|
* @property {String|Number} index 自定义标识,用于区分是哪一个组件
|
|
56
56
|
* @property {Boolean} enable 是否开启吸顶功能(默认true)
|
|
57
|
-
* @property {String} bgColor
|
|
57
|
+
* @property {String} bgColor 组件背景颜色(默认var(--u-bg-white))
|
|
58
58
|
* @property {String|Number} zIndex 吸顶时的z-index值(默认970)
|
|
59
59
|
* @property {String|Number} h5NavHeight 导航栏高度,自定义导航栏时(无导航栏时需设置为0),需要传入此值,单位px(默认44)
|
|
60
60
|
* @event fixed 组件吸顶时触发
|
|
@@ -14,9 +14,9 @@ export const SubsectionProps = {
|
|
|
14
14
|
/** 当前活动的tab的index */
|
|
15
15
|
current: { type: [Number, String] as PropType<number | string>, default: 0 },
|
|
16
16
|
/** 激活的颜色 */
|
|
17
|
-
activeColor: { type: String, default: '
|
|
17
|
+
activeColor: { type: String, default: 'var(--u-main-color)' },
|
|
18
18
|
/** 未激活的颜色 */
|
|
19
|
-
inactiveColor: { type: String, default: '
|
|
19
|
+
inactiveColor: { type: String, default: 'var(--u-content-color)' },
|
|
20
20
|
/** 模式选择,mode=button为按钮形式,mode=subsection时为分段模式 */
|
|
21
21
|
mode: { type: String as PropType<SubsectionMode>, default: 'button' },
|
|
22
22
|
/** 字体大小,单位rpx */
|
|
@@ -28,9 +28,9 @@ export const SubsectionProps = {
|
|
|
28
28
|
/** 激活tab的字体是否加粗 */
|
|
29
29
|
bold: { type: Boolean, default: true },
|
|
30
30
|
/** mode=button时,组件背景颜色 */
|
|
31
|
-
bgColor: { type: String, default: '
|
|
31
|
+
bgColor: { type: String, default: 'var(--u-divider-color)' },
|
|
32
32
|
/** mode = button时,滑块背景颜色 */
|
|
33
|
-
buttonColor: { type: String, default: '
|
|
33
|
+
buttonColor: { type: String, default: 'var(--u-bg-white)' },
|
|
34
34
|
/** 在切换分段器的时候,是否让设备震一下 */
|
|
35
35
|
vibrateShort: { type: Boolean, default: false }
|
|
36
36
|
};
|
|
@@ -38,18 +38,18 @@ import { SubsectionProps } from './types';
|
|
|
38
38
|
* @tutorial https://uviewpro.cn/zh/components/subsection.html
|
|
39
39
|
* @property {Array} list 选项的数组,形式见上方"基本使用"
|
|
40
40
|
* @property {String | Number} current 初始化时默认选中的选项索引值(默认0)
|
|
41
|
-
* @property {String} activeColor 激活时的颜色,mode为subsection
|
|
42
|
-
* @property {String} inactiveColor 未激活时字体的颜色,mode为subsection
|
|
41
|
+
* @property {String} activeColor 激活时的颜色,mode为subsection时固定为白色(默认var(--u-main-color))
|
|
42
|
+
* @property {String} inactiveColor 未激活时字体的颜色,mode为subsection时无效(默认var(--u-content-color))
|
|
43
43
|
* @property {String} mode 模式选择,见官网"模式选择"说明(默认button)
|
|
44
44
|
* @property {String | Number} fontSize 字体大小,单位rpx(默认28)
|
|
45
45
|
* @property {String | Number} height 组件高度,单位rpx(默认70)
|
|
46
46
|
* @property {Boolean} animation 是否开启动画效果,见上方说明(默认true)
|
|
47
47
|
* @property {Boolean} bold 激活选项的字体是否加粗(默认true)
|
|
48
|
-
* @property {String} bgColor 组件背景颜色,mode为button
|
|
49
|
-
* @property {String} buttonColor 按钮背景颜色,mode为button
|
|
48
|
+
* @property {String} bgColor 组件背景颜色,mode为button时有效(默认var(--u-divider-color))
|
|
49
|
+
* @property {String} buttonColor 按钮背景颜色,mode为button时有效(默认var(--u-bg-white))
|
|
50
50
|
* @property {Boolean} vibrateShort 在切换分段器的时候,是否让设备震一下(默认false)
|
|
51
51
|
* @event {Function} change 分段器选项发生改变时触发
|
|
52
|
-
* @example <u-subsection active-color="
|
|
52
|
+
* @example <u-subsection active-color="var(--u-type-warning)"></u-subsection>
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
55
|
interface ListItem {
|
|
@@ -67,7 +67,7 @@ const listInfo = ref<ListItem[]>([]);
|
|
|
67
67
|
const itemBgStyle = ref<{ [key: string]: any }>({
|
|
68
68
|
width: 0,
|
|
69
69
|
left: 0,
|
|
70
|
-
backgroundColor: '
|
|
70
|
+
backgroundColor: 'var(--u-bg-white)',
|
|
71
71
|
height: '100%',
|
|
72
72
|
transition: ''
|
|
73
73
|
});
|
|
@@ -152,7 +152,7 @@ const textStyle = computed<(index: number) => Record<string, any>>(() => {
|
|
|
152
152
|
const style: Record<string, any> = {};
|
|
153
153
|
// 设置字体颜色
|
|
154
154
|
if (props.mode === 'subsection') {
|
|
155
|
-
style.color = index === currentIndex.value ? '
|
|
155
|
+
style.color = index === currentIndex.value ? 'var(--u-white-color)' : props.activeColor;
|
|
156
156
|
} else {
|
|
157
157
|
style.color = index === currentIndex.value ? props.activeColor : props.inactiveColor;
|
|
158
158
|
}
|