uview-plus 3.2.6 → 3.2.7
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 +5 -0
- package/components/u-action-sheet/props.js +11 -10
- package/components/u-album/props.js +12 -11
- package/components/u-alert/props.js +9 -8
- package/components/u-avatar/props.js +15 -14
- package/components/u-avatar-group/props.js +10 -9
- package/components/u-back-top/props.js +11 -10
- package/components/u-badge/props.js +15 -14
- package/components/u-button/props.js +29 -37
- package/components/u-calendar/props.js +28 -27
- package/components/u-car-keyboard/props.js +1 -0
- package/components/u-cell/props.js +21 -20
- package/components/u-cell/u-cell.vue +3 -2
- package/components/u-cell-group/props.js +3 -2
- package/components/u-checkbox/props.js +14 -13
- package/components/u-checkbox-group/props.js +17 -16
- package/components/u-circle-progress/props.js +2 -1
- package/components/u-code/props.js +7 -6
- package/components/u-code-input/props.js +17 -16
- package/components/u-col/props.js +6 -5
- package/components/u-collapse/props.js +4 -3
- package/components/u-collapse-item/props.js +12 -11
- package/components/u-column-notice/props.js +11 -10
- package/components/u-count-down/props.js +5 -4
- package/components/u-count-to/props.js +12 -11
- package/components/u-datetime-picker/props.js +25 -24
- package/components/u-divider/props.js +9 -8
- package/components/u-dropdown/props.js +1 -0
- package/components/u-dropdown-item/props.js +1 -0
- package/components/u-dropdown-item/u-dropdown-item.vue +3 -5
- package/components/u-empty/props.js +12 -11
- package/components/u-form/props.js +9 -8
- package/components/u-form-item/props.js +11 -10
- package/components/u-gap/props.js +5 -4
- package/components/u-grid/props.js +4 -3
- package/components/u-grid-item/props.js +3 -2
- package/components/u-icon/props.js +18 -17
- package/components/u-image/props.js +17 -16
- package/components/u-index-anchor/props.js +6 -5
- package/components/u-index-item/props.js +1 -0
- package/components/u-index-list/props.js +6 -5
- package/components/u-input/props.js +36 -35
- package/components/u-keyboard/props.js +17 -16
- package/components/u-line/props.js +7 -6
- package/components/u-line-progress/props.js +6 -5
- package/components/u-link/props.js +8 -7
- package/components/u-list/props.js +15 -14
- package/components/u-list-item/props.js +2 -1
- package/components/u-loading-icon/props.js +12 -11
- package/components/u-loading-page/props.js +10 -9
- package/components/u-loadmore/props.js +19 -18
- package/components/u-modal/props.js +17 -16
- package/components/u-navbar/props.js +17 -16
- package/components/u-no-network/props.js +4 -3
- package/components/u-notice-bar/props.js +14 -13
- package/components/u-notify/props.js +10 -9
- package/components/u-number-box/props.js +23 -22
- package/components/u-number-keyboard/props.js +4 -3
- package/components/u-overlay/props.js +5 -4
- package/components/u-parse/props.js +9 -8
- package/components/u-picker/props.js +17 -16
- package/components/u-picker-column/props.js +1 -0
- package/components/u-popup/props.js +16 -15
- package/components/u-radio/props.js +14 -13
- package/components/u-radio-group/props.js +18 -17
- package/components/u-rate/props.js +15 -14
- package/components/u-read-more/props.js +9 -8
- package/components/u-row/props.js +4 -3
- package/components/u-row-notice/props.js +8 -7
- package/components/u-safe-bottom/props.js +1 -0
- package/components/u-scroll-list/props.js +7 -6
- package/components/u-search/props.js +25 -24
- package/components/u-skeleton/props.js +12 -11
- package/components/u-slider/props.js +12 -11
- package/components/u-status-bar/props.js +2 -1
- package/components/u-steps/props.js +8 -7
- package/components/u-steps-item/props.js +5 -4
- package/components/u-sticky/props.js +7 -6
- package/components/u-subsection/props.js +10 -9
- package/components/u-swipe-action/props.js +2 -1
- package/components/u-swipe-action-item/props.js +8 -7
- package/components/u-swiper/props.js +25 -24
- package/components/u-swiper-indicator/props.js +6 -5
- package/components/u-switch/props.js +12 -11
- package/components/u-tabbar/props.js +9 -8
- package/components/u-tabbar-item/props.js +7 -6
- package/components/u-table/props.js +1 -0
- package/components/u-tabs/props.js +13 -12
- package/components/u-tabs-item/props.js +1 -0
- package/components/u-tag/props.js +20 -18
- package/components/u-td/props.js +1 -0
- package/components/u-text/props.js +22 -21
- package/components/u-textarea/props.js +24 -23
- package/components/u-toolbar/props.js +7 -6
- package/components/u-tooltip/props.js +12 -11
- package/components/u-tr/props.js +1 -0
- package/components/u-transition/props.js +5 -4
- package/components/u-upload/props.js +23 -22
- package/index.js +16 -1
- package/libs/function/index.js +30 -23
- package/package.json +1 -1
|
@@ -1,24 +1,25 @@
|
|
|
1
|
+
import defProps from '../../libs/config/props.js';
|
|
1
2
|
export default {
|
|
2
3
|
props: {
|
|
3
4
|
// 是否展示组件
|
|
4
5
|
show: {
|
|
5
6
|
type: Boolean,
|
|
6
|
-
default: () =>
|
|
7
|
+
default: () => defProps.transition.show
|
|
7
8
|
},
|
|
8
9
|
// 使用的动画模式
|
|
9
10
|
mode: {
|
|
10
11
|
type: String,
|
|
11
|
-
default: () =>
|
|
12
|
+
default: () => defProps.transition.mode
|
|
12
13
|
},
|
|
13
14
|
// 动画的执行时间,单位ms
|
|
14
15
|
duration: {
|
|
15
16
|
type: [String, Number],
|
|
16
|
-
default: () =>
|
|
17
|
+
default: () => defProps.transition.duration
|
|
17
18
|
},
|
|
18
19
|
// 使用的动画过渡函数
|
|
19
20
|
timingFunction: {
|
|
20
21
|
type: String,
|
|
21
|
-
default: () =>
|
|
22
|
+
default: () => defProps.transition.timingFunction
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
+
import defProps from '../../libs/config/props.js';
|
|
1
2
|
export default {
|
|
2
3
|
props: {
|
|
3
4
|
// 接受的文件类型, 可选值为all media image file video
|
|
4
5
|
accept: {
|
|
5
6
|
type: String,
|
|
6
|
-
default: () =>
|
|
7
|
+
default: () => defProps.upload.accept
|
|
7
8
|
},
|
|
8
9
|
// 图片或视频拾取模式,当accept为image类型时设置capture可选额外camera可以直接调起摄像头
|
|
9
10
|
capture: {
|
|
10
11
|
type: [String, Array],
|
|
11
|
-
default: () =>
|
|
12
|
+
default: () => defProps.upload.capture
|
|
12
13
|
},
|
|
13
14
|
// 当accept为video时生效,是否压缩视频,默认为true
|
|
14
15
|
compressed: {
|
|
15
16
|
type: Boolean,
|
|
16
|
-
default: () =>
|
|
17
|
+
default: () => defProps.upload.compressed
|
|
17
18
|
},
|
|
18
19
|
// 当accept为video时生效,可选值为back或front
|
|
19
20
|
camera: {
|
|
20
21
|
type: String,
|
|
21
|
-
default: () =>
|
|
22
|
+
default: () => defProps.upload.camera
|
|
22
23
|
},
|
|
23
24
|
// 当accept为video时生效,拍摄视频最长拍摄时间,单位秒
|
|
24
25
|
maxDuration: {
|
|
25
26
|
type: Number,
|
|
26
|
-
default: () =>
|
|
27
|
+
default: () => defProps.upload.maxDuration
|
|
27
28
|
},
|
|
28
29
|
// 上传区域的图标,只能内置图标
|
|
29
30
|
uploadIcon: {
|
|
30
31
|
type: String,
|
|
31
|
-
default: () =>
|
|
32
|
+
default: () => defProps.upload.uploadIcon
|
|
32
33
|
},
|
|
33
34
|
// 上传区域的图标的颜色,默认
|
|
34
35
|
uploadIconColor: {
|
|
35
36
|
type: String,
|
|
36
|
-
default: () =>
|
|
37
|
+
default: () => defProps.upload.uploadIconColor
|
|
37
38
|
},
|
|
38
39
|
// 是否开启文件读取前事件
|
|
39
40
|
useBeforeRead: {
|
|
40
41
|
type: Boolean,
|
|
41
|
-
default: () =>
|
|
42
|
+
default: () => defProps.upload.useBeforeRead
|
|
42
43
|
},
|
|
43
44
|
// 读取后的处理函数
|
|
44
45
|
afterRead: {
|
|
@@ -53,72 +54,72 @@ export default {
|
|
|
53
54
|
// 是否显示组件自带的图片预览功能
|
|
54
55
|
previewFullImage: {
|
|
55
56
|
type: Boolean,
|
|
56
|
-
default: () =>
|
|
57
|
+
default: () => defProps.upload.previewFullImage
|
|
57
58
|
},
|
|
58
59
|
// 最大上传数量
|
|
59
60
|
maxCount: {
|
|
60
61
|
type: [String, Number],
|
|
61
|
-
default: () =>
|
|
62
|
+
default: () => defProps.upload.maxCount
|
|
62
63
|
},
|
|
63
64
|
// 是否启用
|
|
64
65
|
disabled: {
|
|
65
66
|
type: Boolean,
|
|
66
|
-
default: () =>
|
|
67
|
+
default: () => defProps.upload.disabled
|
|
67
68
|
},
|
|
68
69
|
// 预览上传的图片时的裁剪模式,和image组件mode属性一致
|
|
69
70
|
imageMode: {
|
|
70
71
|
type: String,
|
|
71
|
-
default: () =>
|
|
72
|
+
default: () => defProps.upload.imageMode
|
|
72
73
|
},
|
|
73
74
|
// 标识符,可以在回调函数的第二项参数中获取
|
|
74
75
|
name: {
|
|
75
76
|
type: String,
|
|
76
|
-
default: () =>
|
|
77
|
+
default: () => defProps.upload.name
|
|
77
78
|
},
|
|
78
79
|
// 所选的图片的尺寸, 可选值为original compressed
|
|
79
80
|
sizeType: {
|
|
80
81
|
type: Array,
|
|
81
|
-
default: () =>
|
|
82
|
+
default: () => defProps.upload.sizeType
|
|
82
83
|
},
|
|
83
84
|
// 是否开启图片多选,部分安卓机型不支持
|
|
84
85
|
multiple: {
|
|
85
86
|
type: Boolean,
|
|
86
|
-
default: () =>
|
|
87
|
+
default: () => defProps.upload.multiple
|
|
87
88
|
},
|
|
88
89
|
// 是否展示删除按钮
|
|
89
90
|
deletable: {
|
|
90
91
|
type: Boolean,
|
|
91
|
-
default: () =>
|
|
92
|
+
default: () => defProps.upload.deletable
|
|
92
93
|
},
|
|
93
94
|
// 文件大小限制,单位为byte
|
|
94
95
|
maxSize: {
|
|
95
96
|
type: [String, Number],
|
|
96
|
-
default: () =>
|
|
97
|
+
default: () => defProps.upload.maxSize
|
|
97
98
|
},
|
|
98
99
|
// 显示已上传的文件列表
|
|
99
100
|
fileList: {
|
|
100
101
|
type: Array,
|
|
101
|
-
default: () =>
|
|
102
|
+
default: () => defProps.upload.fileList
|
|
102
103
|
},
|
|
103
104
|
// 上传区域的提示文字
|
|
104
105
|
uploadText: {
|
|
105
106
|
type: String,
|
|
106
|
-
default: () =>
|
|
107
|
+
default: () => defProps.upload.uploadText
|
|
107
108
|
},
|
|
108
109
|
// 内部预览图片区域和选择图片按钮的区域宽度
|
|
109
110
|
width: {
|
|
110
111
|
type: [String, Number],
|
|
111
|
-
default: () =>
|
|
112
|
+
default: () => defProps.upload.width
|
|
112
113
|
},
|
|
113
114
|
// 内部预览图片区域和选择图片按钮的区域高度
|
|
114
115
|
height: {
|
|
115
116
|
type: [String, Number],
|
|
116
|
-
default: () =>
|
|
117
|
+
default: () => defProps.upload.height
|
|
117
118
|
},
|
|
118
119
|
// 是否在上传完成后展示预览图
|
|
119
120
|
previewImage: {
|
|
120
121
|
type: Boolean,
|
|
121
|
-
default: () =>
|
|
122
|
+
default: () => defProps.upload.previewImage
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
}
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// 看到此报错,是因为没有配置
|
|
1
|
+
// 看到此报错,是因为没有配置vite.config.js的【transpileDependencies】
|
|
2
2
|
const pleaseSetTranspileDependencies = {}, babelTest = pleaseSetTranspileDependencies?.test
|
|
3
3
|
|
|
4
4
|
// 引入全局mixin
|
|
@@ -40,6 +40,21 @@ export { route, http, debounce, throttle, platform, themeType, mixin, mpMixin, p
|
|
|
40
40
|
export * from './libs/function/index.js'
|
|
41
41
|
export * from './libs/function/colorGradient.js'
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* @description 修改uView内置属性值
|
|
45
|
+
* @param {object} props 修改内置props属性
|
|
46
|
+
* @param {object} config 修改内置config属性
|
|
47
|
+
* @param {object} color 修改内置color属性
|
|
48
|
+
* @param {object} zIndex 修改内置zIndex属性
|
|
49
|
+
*/
|
|
50
|
+
export function setConfig(configs) {
|
|
51
|
+
index.shallowMerge(config, configs.config || {})
|
|
52
|
+
index.shallowMerge(props, configs.props || {})
|
|
53
|
+
index.shallowMerge(color, configs.color || {})
|
|
54
|
+
index.shallowMerge(zIndex, configs.zIndex || {})
|
|
55
|
+
}
|
|
56
|
+
index.setConfig = setConfig
|
|
57
|
+
|
|
43
58
|
const $u = {
|
|
44
59
|
route,
|
|
45
60
|
date: index.timeFormat, // 另名date
|
package/libs/function/index.js
CHANGED
|
@@ -229,6 +229,34 @@ export function deepMerge(target = {}, source = {}) {
|
|
|
229
229
|
}
|
|
230
230
|
return target
|
|
231
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* @description JS对象深度合并
|
|
234
|
+
* @param {object} target 需要拷贝的对象
|
|
235
|
+
* @param {object} source 拷贝的来源对象
|
|
236
|
+
* @returns {object|boolean} 深度合并后的对象或者false(入参有不是对象)
|
|
237
|
+
*/
|
|
238
|
+
export function shallowMerge(target, source = {}) {
|
|
239
|
+
if (typeof target !== 'object' || typeof source !== 'object') return false
|
|
240
|
+
for (const prop in source) {
|
|
241
|
+
if (!source.hasOwnProperty(prop)) continue
|
|
242
|
+
if (prop in target) {
|
|
243
|
+
if (source[prop] == null) {
|
|
244
|
+
target[prop] = source[prop]
|
|
245
|
+
}else if (typeof target[prop] !== 'object') {
|
|
246
|
+
target[prop] = source[prop]
|
|
247
|
+
} else if (typeof source[prop] !== 'object') {
|
|
248
|
+
target[prop] = source[prop]
|
|
249
|
+
} else if (target[prop].concat && source[prop].concat) {
|
|
250
|
+
target[prop] = target[prop].concat(source[prop])
|
|
251
|
+
} else {
|
|
252
|
+
target[prop] = shallowMerge(target[prop], source[prop])
|
|
253
|
+
}
|
|
254
|
+
} else {
|
|
255
|
+
target[prop] = source[prop]
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return target
|
|
259
|
+
}
|
|
232
260
|
|
|
233
261
|
/**
|
|
234
262
|
* @description error提示
|
|
@@ -655,28 +683,6 @@ export function pages() {
|
|
|
655
683
|
return pages
|
|
656
684
|
}
|
|
657
685
|
|
|
658
|
-
/**
|
|
659
|
-
* @description 修改uView内置属性值
|
|
660
|
-
* @param {object} props 修改内置props属性
|
|
661
|
-
* @param {object} config 修改内置config属性
|
|
662
|
-
* @param {object} color 修改内置color属性
|
|
663
|
-
* @param {object} zIndex 修改内置zIndex属性
|
|
664
|
-
*/
|
|
665
|
-
export function setConfig({
|
|
666
|
-
props = {},
|
|
667
|
-
config = {},
|
|
668
|
-
color = {},
|
|
669
|
-
zIndex = {}
|
|
670
|
-
}) {
|
|
671
|
-
const {
|
|
672
|
-
deepMerge,
|
|
673
|
-
} = uni.$u
|
|
674
|
-
uni.$u.config = deepMerge(uni.$u.config, config)
|
|
675
|
-
uni.$u.props = deepMerge(uni.$u.props, props)
|
|
676
|
-
uni.$u.color = deepMerge(uni.$u.color, color)
|
|
677
|
-
uni.$u.zIndex = deepMerge(uni.$u.zIndex, zIndex)
|
|
678
|
-
}
|
|
679
|
-
|
|
680
686
|
export default {
|
|
681
687
|
range,
|
|
682
688
|
getPx,
|
|
@@ -690,6 +696,7 @@ export default {
|
|
|
690
696
|
addUnit,
|
|
691
697
|
deepClone,
|
|
692
698
|
deepMerge,
|
|
699
|
+
shallowMerge,
|
|
693
700
|
error,
|
|
694
701
|
randomArray,
|
|
695
702
|
timeFormat,
|
|
@@ -706,5 +713,5 @@ export default {
|
|
|
706
713
|
setProperty,
|
|
707
714
|
page,
|
|
708
715
|
pages,
|
|
709
|
-
setConfig
|
|
716
|
+
// setConfig
|
|
710
717
|
}
|