uview-pro 0.3.5 → 0.3.6
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 +22 -0
- package/components/u-calendar/types.ts +3 -2
- package/components/u-calendar/u-calendar.vue +2 -2
- package/components/u-checkbox-group/types.ts +2 -1
- package/components/u-checkbox-group/u-checkbox-group.vue +1 -1
- package/components/u-city-select/u-city-select.vue +2 -2
- package/components/u-dropdown/types.ts +3 -2
- package/components/u-dropdown/u-dropdown.vue +1 -1
- package/components/u-index-anchor/u-index-anchor.vue +1 -1
- package/components/u-index-list/types.ts +2 -1
- package/components/u-index-list/u-index-list.vue +1 -1
- package/components/u-link/types.ts +2 -1
- package/components/u-message-input/types.ts +3 -2
- package/components/u-message-input/u-message-input.vue +1 -1
- package/components/u-modal/types.ts +3 -2
- package/components/u-modal/u-modal.vue +1 -1
- package/components/u-picker/types.ts +8 -2
- package/components/u-picker/u-picker.vue +276 -126
- package/components/u-radio/u-radio.vue +2 -2
- package/components/u-radio-group/types.ts +2 -1
- package/components/u-radio-group/u-radio-group.vue +1 -1
- package/components/u-read-more/types.ts +2 -1
- package/components/u-read-more/u-read-more.vue +1 -1
- package/components/u-select/types.ts +5 -2
- package/components/u-select/u-select.vue +56 -18
- package/components/u-slider/types.ts +3 -2
- package/components/u-slider/u-slider.vue +2 -2
- package/components/u-step/types.ts +29 -0
- package/components/u-step/u-step.vue +264 -0
- package/components/u-steps/types.ts +3 -2
- package/components/u-steps/u-steps.vue +17 -106
- package/components/u-switch/types.ts +2 -1
- package/components/u-switch/u-switch.vue +2 -2
- package/components/u-tabs/types.ts +3 -2
- package/components/u-tabs/u-tabs.vue +1 -1
- package/components/u-tabs-swiper/types.ts +3 -2
- package/components/u-tabs-swiper/u-tabs-swiper.vue +1 -1
- package/package.json +1 -1
- package/types/components.d.ts +1 -0
- package/types/global.d.ts +2 -0
package/changelog.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## 0.3.6(2025-10-24)
|
|
2
|
+
|
|
3
|
+
### ✨ Features | 新功能
|
|
4
|
+
|
|
5
|
+
- **u-select:** 优化选择器组件 u-select 默认值处理逻辑,添加 preserveSelection 属性,用于控制是否保留用户上次确认的选择 ([8493ff1](https://github.com/anyup/uView-Pro/commit/8493ff16d2eee42fabe926917d940a350b86abe0))
|
|
6
|
+
- **u-picker:** 优化 picker 的初始化和渲染流程,实现多次打开 picker 时保留用户选择的逻辑,新增 preserveSelection 属性支持 ([974872e](https://github.com/anyup/uView-Pro/commit/974872ec944fbb28cdb3c40fda08c9039bf0b960))
|
|
7
|
+
|
|
8
|
+
### ♻️ Code Refactoring | 代码重构
|
|
9
|
+
|
|
10
|
+
- **components:** 使用主题色替代硬编码颜色值,统一组件的颜色风格,便于未来主题颜色的调整和维护 ([ec348d4](https://github.com/anyup/uView-Pro/commit/ec348d4a8bff4dee62da78eadd23fc3a292ebdca))
|
|
11
|
+
- **example:** 代码示例中使用主题色替换硬编码颜色值 ([3216497](https://github.com/anyup/uView-Pro/commit/32164973d54cfff3edcbe765a8ed27158f4bec7d))
|
|
12
|
+
- **u-steps:** 新增u-step ([6b86eea](https://github.com/anyup/uView-Pro/commit/6b86eeaf7699eb13f739fc038d86efb4e3b48f8a))
|
|
13
|
+
- **u-step:** 替换步骤条组件中的默认硬编码颜色值 ([f3408ef](https://github.com/anyup/uView-Pro/commit/f3408ef006991702895432e775f266fb196ddf12))
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
16
|
+
|
|
17
|
+
- **u-picker:** 修复使用u-picker组件选择地区不设置默认值报错的问题 ([7941135](https://github.com/anyup/uView-Pro/commit/7941135a87a3511a562ed10e34573ef7f786fb57))
|
|
18
|
+
|
|
19
|
+
### 👥 Contributors
|
|
20
|
+
|
|
21
|
+
<a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a> <a href="https://github.com/lonelyflyer"><img src="https://github.com/lonelyflyer.png?size=40" width="40" height="40" alt="Lonelyflyer" title="Lonelyflyer"/></a>
|
|
22
|
+
|
|
1
23
|
## 0.3.5(2025-10-21)
|
|
2
24
|
|
|
3
25
|
### 🐛 Bug Fixes | Bug 修复
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ExtractPropTypes, type PropType } from 'vue';
|
|
2
2
|
import type { CalendarChangeDate, CalendarChangeRange, CalendarMode, ThemeType } from '../../types/global';
|
|
3
3
|
import { baseProps } from '../common/props';
|
|
4
|
+
import { $u } from '../../';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* calendar 日历类型定义
|
|
@@ -39,13 +40,13 @@ export const CalendarProps = {
|
|
|
39
40
|
/** 默认日期字体颜色 */
|
|
40
41
|
color: { type: String, default: '#303133' },
|
|
41
42
|
/** 选中|起始结束日期背景色 */
|
|
42
|
-
activeBgColor: { type: String, default:
|
|
43
|
+
activeBgColor: { type: String, default: $u.color.primary },
|
|
43
44
|
/** 选中|起始结束日期字体颜色 */
|
|
44
45
|
activeColor: { type: String, default: '#ffffff' },
|
|
45
46
|
/** 范围内日期背景色 */
|
|
46
47
|
rangeBgColor: { type: String, default: 'rgba(41,121,255,0.13)' },
|
|
47
48
|
/** 范围内日期字体颜色 */
|
|
48
|
-
rangeColor: { type: String, default:
|
|
49
|
+
rangeColor: { type: String, default: $u.color.primary },
|
|
49
50
|
/** mode=range时生效,起始日期自定义文案 */
|
|
50
51
|
startText: { type: String, default: '开始' },
|
|
51
52
|
/** mode=range时生效,结束日期自定义文案 */
|
|
@@ -270,11 +270,11 @@ import Calendar from '../../libs/util/calendar';
|
|
|
270
270
|
* @property {String} month-arrow-color 月份切换按钮箭头颜色(默认#606266)
|
|
271
271
|
* @property {String} year-arrow-color 年份切换按钮箭头颜色(默认#909399)
|
|
272
272
|
* @property {String} color 日期字体的默认颜色(默认#303133)
|
|
273
|
-
* @property {String} active-bg-color 起始/结束日期按钮的背景色(
|
|
273
|
+
* @property {String} active-bg-color 起始/结束日期按钮的背景色(默认主题色primary)
|
|
274
274
|
* @property {String Number} z-index 弹出时的z-index值(默认10075)
|
|
275
275
|
* @property {String} active-color 起始/结束日期按钮的字体颜色(默认#ffffff)
|
|
276
276
|
* @property {String} range-bg-color 起始/结束日期之间的区域的背景颜色(默认rgba(41,121,255,0.13))
|
|
277
|
-
* @property {String} range-color 选择范围内字体颜色(
|
|
277
|
+
* @property {String} range-color 选择范围内字体颜色(默认主题色primary)
|
|
278
278
|
* @property {String} start-text 起始日期底部的提示文字(默认 '开始')
|
|
279
279
|
* @property {String} end-text 结束日期底部的提示文字(默认 '结束')
|
|
280
280
|
* @property {String} btn-type 底部确定按钮的主题(默认 'primary')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ExtractPropTypes, type PropType } from 'vue';
|
|
2
2
|
import type { Shape } from '../../types/global';
|
|
3
3
|
import { baseProps } from '../common/props';
|
|
4
|
+
import { $u } from '../../';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* checkbox-group 复选框组类型定义
|
|
@@ -20,7 +21,7 @@ export const CheckboxGroupProps = {
|
|
|
20
21
|
/** 形状,square为方形,circle为原型 */
|
|
21
22
|
shape: { type: String as PropType<Shape>, default: 'square' },
|
|
22
23
|
/** 选中状态下的颜色 */
|
|
23
|
-
activeColor: { type: String, default:
|
|
24
|
+
activeColor: { type: String, default: $u.color.primary },
|
|
24
25
|
/** 组件的整体大小 */
|
|
25
26
|
size: { type: [String, Number], default: 34 },
|
|
26
27
|
/** 每个checkbox占u-checkbox-group的宽度 */
|
|
@@ -34,7 +34,7 @@ import { CheckboxGroupProps } from './types';
|
|
|
34
34
|
* @property {String} width 宽度,需带单位
|
|
35
35
|
* @property {String} shape 外观形状,shape-方形,circle-圆形(默认circle)
|
|
36
36
|
* @property {Boolean} wrap 是否每个checkbox都换行(默认false)
|
|
37
|
-
* @property {String} active-color 选中时的颜色,应用到所有子Checkbox
|
|
37
|
+
* @property {String} active-color 选中时的颜色,应用到所有子Checkbox组件(默认主题色primary)
|
|
38
38
|
* @event {Function} change 任一个checkbox状态发生变化时触发,回调为一个对象
|
|
39
39
|
* @example <u-checkbox-group></u-checkbox-group>
|
|
40
40
|
*/
|
|
@@ -116,13 +116,13 @@ import { $u } from '../..';
|
|
|
116
116
|
* u-city-select 城市选择器
|
|
117
117
|
* @description 用于选择省、市、区三级行政区域,支持回显和自定义初始值。
|
|
118
118
|
* @property {Boolean} modelValue 控制弹窗显示与隐藏(v-model)
|
|
119
|
-
* @property {Array} defaultRegion 默认选中的省市区名称数组,如 ['
|
|
119
|
+
* @property {Array} defaultRegion 默认选中的省市区名称数组,如 ['山东省', '青岛市', '崂山区']
|
|
120
120
|
* @property {Array} areaCode 默认选中的省市区编码数组,如 ['440000', '440100', '440106']
|
|
121
121
|
* @property {Boolean} maskCloseAble 是否允许点击遮罩关闭弹窗(默认 true)
|
|
122
122
|
* @property {String|Number} zIndex 弹窗层级(默认 0,自动适配)
|
|
123
123
|
* @event update:modelValue v-model 绑定值变化时触发
|
|
124
124
|
* @event city-change 选择省市区后触发,返回选中的省市区对象
|
|
125
|
-
* @example <u-city-select v-model="show" :defaultRegion="['
|
|
125
|
+
* @example <u-city-select v-model="show" :defaultRegion="['山东省', '青岛市', '崂山区']" @city-change="onChange"></u-city-select>
|
|
126
126
|
*/
|
|
127
127
|
const props = defineProps(CitySelectProps);
|
|
128
128
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import { baseProps } from '../common/props';
|
|
3
|
+
import { $u } from '../../';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* u-dropdown 下拉菜单 Props
|
|
@@ -8,9 +9,9 @@ import { baseProps } from '../common/props';
|
|
|
8
9
|
export const DropdownProps = {
|
|
9
10
|
...baseProps,
|
|
10
11
|
/** 菜单标题和选项的激活态颜色 */
|
|
11
|
-
activeColor: { type: String, default:
|
|
12
|
+
activeColor: { type: String, default: $u.color.primary },
|
|
12
13
|
/** 菜单标题和选项的未激活态颜色 */
|
|
13
|
-
inactiveColor: { type: String, default:
|
|
14
|
+
inactiveColor: { type: String, default: $u.color.contentColor },
|
|
14
15
|
/** 点击遮罩是否关闭菜单 */
|
|
15
16
|
closeOnClickMask: { type: Boolean, default: true },
|
|
16
17
|
/** 点击当前激活项标题是否关闭菜单 */
|
|
@@ -83,7 +83,7 @@ import { DropdownProps } from './types';
|
|
|
83
83
|
* dropdown 下拉菜单
|
|
84
84
|
* @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
|
|
85
85
|
* @tutorial https://uviewpro.cn/zh/components/dropdown.html
|
|
86
|
-
* @property {String} active-color
|
|
86
|
+
* @property {String} active-color 标题和选项卡选中的颜色(默认主题色primary)
|
|
87
87
|
* @property {String} inactive-color 标题和选项卡未选中的颜色(默认#606266)
|
|
88
88
|
* @property {Boolean} close-on-click-mask 点击遮罩是否关闭菜单(默认true)
|
|
89
89
|
* @property {Boolean} close-on-click-self 点击当前激活项标题是否关闭菜单(默认true)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { $u } from '../../';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* u-index-list 组件 props 类型定义
|
|
@@ -33,7 +34,7 @@ export const IndexListProps = {
|
|
|
33
34
|
/** 锚点和右边索引字符高亮颜色 */
|
|
34
35
|
activeColor: {
|
|
35
36
|
type: String,
|
|
36
|
-
default:
|
|
37
|
+
default: $u.color.primary
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
40
|
|
|
@@ -61,7 +61,7 @@ import { IndexListProps } from './types';
|
|
|
61
61
|
* @property {Number|String} z-index 锚点吸顶时的层级(默认965)
|
|
62
62
|
* @property {Boolean} sticky 是否开启锚点自动吸顶(默认true)
|
|
63
63
|
* @property {Number|String} offset-top 锚点自动吸顶时与顶部的距离(默认0)
|
|
64
|
-
* @property {String} highlight-color
|
|
64
|
+
* @property {String} highlight-color 锚点和右边索引字符高亮颜色(默认主题色primary)
|
|
65
65
|
* @event {Function} select 选中右边索引字符时触发
|
|
66
66
|
* @example <u-index-list :scrollTop="scrollTop"></u-index-list>
|
|
67
67
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { $u } from '../../';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* u-link 组件 props 类型定义
|
|
@@ -8,7 +9,7 @@ export const LinkProps = {
|
|
|
8
9
|
/** 文字颜色 */
|
|
9
10
|
color: {
|
|
10
11
|
type: String,
|
|
11
|
-
default:
|
|
12
|
+
default: $u.color.primary
|
|
12
13
|
},
|
|
13
14
|
/** 字体大小,单位rpx */
|
|
14
15
|
fontSize: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { MessageInputMode } from '../../types/global';
|
|
3
|
+
import { $u } from '../../';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* u-message-input 组件 props 类型定义
|
|
@@ -49,12 +50,12 @@ export const MessageInputProps = {
|
|
|
49
50
|
/** 激活样式 */
|
|
50
51
|
activeColor: {
|
|
51
52
|
type: String,
|
|
52
|
-
default:
|
|
53
|
+
default: $u.color.primary
|
|
53
54
|
},
|
|
54
55
|
/** 未激活的样式 */
|
|
55
56
|
inactiveColor: {
|
|
56
57
|
type: String,
|
|
57
|
-
default:
|
|
58
|
+
default: $u.color.contentColor
|
|
58
59
|
},
|
|
59
60
|
/** 输入框的大小,单位rpx,宽等于高 */
|
|
60
61
|
width: {
|
|
@@ -99,7 +99,7 @@ import { MessageInputProps } from './types';
|
|
|
99
99
|
* @property {Boolean} focus 是否自动获取焦点(默认false)
|
|
100
100
|
* @property {Boolean} bold 字体和输入横线是否加粗(默认true)
|
|
101
101
|
* @property {String|Number} font-size 字体大小,单位rpx(默认60)
|
|
102
|
-
* @property {String} active-color
|
|
102
|
+
* @property {String} active-color 当前激活输入框的样式(默认主题色primary)
|
|
103
103
|
* @property {String} inactive-color 非激活输入框的样式,文字颜色同此值(默认#606266)
|
|
104
104
|
* @property {String|Number} width 输入框宽度,单位rpx,高等于宽(默认80)
|
|
105
105
|
* @property {Boolean} disabled-keyboard 禁止点击输入框唤起系统键盘(默认false)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { $u } from '../../';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* u-modal 组件 props 类型定义
|
|
@@ -58,12 +59,12 @@ export const ModalProps = {
|
|
|
58
59
|
/** 确认按钮颜色 */
|
|
59
60
|
confirmColor: {
|
|
60
61
|
type: String,
|
|
61
|
-
default:
|
|
62
|
+
default: $u.color.primary
|
|
62
63
|
},
|
|
63
64
|
/** 取消文字颜色 */
|
|
64
65
|
cancelColor: {
|
|
65
66
|
type: String,
|
|
66
|
-
default:
|
|
67
|
+
default: $u.color.contentColor
|
|
67
68
|
},
|
|
68
69
|
/** 圆角值 */
|
|
69
70
|
borderRadius: {
|
|
@@ -88,7 +88,7 @@ import { ModalProps } from './types';
|
|
|
88
88
|
* @property {String} confirm-text 确认按钮的文字内容(默认"确认")
|
|
89
89
|
* @property {String} cancel-text 取消按钮的文字内容(默认"取消")
|
|
90
90
|
* @property {String} cancel-color 取消按钮的颜色(默认"#606266")
|
|
91
|
-
* @property {String} confirm-color
|
|
91
|
+
* @property {String} confirm-color 确认按钮的文字内容(默认主题色primary)
|
|
92
92
|
* @property {String | Number} border-radius 模态框圆角值,单位rpx(默认16)
|
|
93
93
|
* @property {Object} title-style 自定义标题样式,对象形式
|
|
94
94
|
* @property {Object} content-style 自定义内容样式,对象形式
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { PickerMode, PickerParams } from '../../types/global';
|
|
3
|
+
import { $u } from '../../';
|
|
3
4
|
|
|
4
5
|
const defaultParams: PickerParams = {
|
|
5
6
|
year: true,
|
|
@@ -33,6 +34,11 @@ export const PickerProps = {
|
|
|
33
34
|
type: Array as PropType<any[]>,
|
|
34
35
|
default: () => [0]
|
|
35
36
|
},
|
|
37
|
+
/** 是否保留用户上次确认的选择(true:优先使用已保存选择;false:优先使用外部传入的 defaultSelector/defaultTime/defaultRegion) */
|
|
38
|
+
preserveSelection: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
36
42
|
/** 当 range 是一个 Array<Object> 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容 */
|
|
37
43
|
rangeKey: {
|
|
38
44
|
type: String,
|
|
@@ -56,12 +62,12 @@ export const PickerProps = {
|
|
|
56
62
|
/** "取消"按钮的颜色 */
|
|
57
63
|
cancelColor: {
|
|
58
64
|
type: String,
|
|
59
|
-
default:
|
|
65
|
+
default: $u.color.contentColor
|
|
60
66
|
},
|
|
61
67
|
/** "确定"按钮的颜色 */
|
|
62
68
|
confirmColor: {
|
|
63
69
|
type: String,
|
|
64
|
-
default:
|
|
70
|
+
default: $u.color.primary
|
|
65
71
|
},
|
|
66
72
|
/** 默认显示的时间,2025-07-02 || 2025-07-02 13:01:00 || 2025/07/02 */
|
|
67
73
|
defaultTime: {
|