uview-plus 3.1.50 → 3.1.52
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/README.md +10 -10
- package/changelog.md +18 -1
- package/components/u-action-sheet/props.js +10 -11
- package/components/u-album/props.js +11 -12
- package/components/u-alert/props.js +8 -9
- package/components/u-avatar/props.js +14 -15
- package/components/u-avatar-group/props.js +9 -10
- package/components/u-back-top/props.js +10 -11
- package/components/u-back-top/u-back-top.vue +1 -1
- package/components/u-badge/props.js +14 -15
- package/components/u-badge/u-badge.vue +1 -1
- package/components/u-button/props.js +28 -29
- package/components/u-button/u-button.vue +6 -6
- package/components/u-button/vue.scss +8 -7
- package/components/u-calendar/month.vue +1 -1
- package/components/u-calendar/props.js +27 -28
- package/components/u-car-keyboard/props.js +0 -1
- package/components/u-car-keyboard/u-car-keyboard.vue +1 -1
- package/components/u-cell/props.js +17 -18
- package/components/u-cell/u-cell.vue +14 -4
- package/components/u-cell-group/props.js +2 -3
- package/components/u-cell-group/u-cell-group.vue +1 -1
- package/components/u-checkbox/props.js +13 -14
- package/components/u-checkbox/u-checkbox.vue +1 -1
- package/components/u-checkbox-group/props.js +16 -17
- package/components/u-circle-progress/props.js +1 -2
- package/components/u-code/props.js +6 -7
- package/components/u-code/u-code.vue +5 -0
- package/components/u-code-input/props.js +16 -17
- package/components/u-col/props.js +5 -6
- package/components/u-collapse/props.js +3 -4
- package/components/u-collapse-item/props.js +11 -12
- package/components/u-column-notice/props.js +10 -11
- package/components/u-copy/u-copy.vue +70 -0
- package/components/u-count-down/props.js +4 -5
- package/components/u-count-down/u-count-down.vue +6 -1
- package/components/u-count-to/props.js +11 -12
- package/components/u-datetime-picker/props.js +37 -25
- package/components/u-datetime-picker/u-datetime-picker.vue +58 -3
- package/components/u-divider/props.js +8 -9
- package/components/u-dropdown/props.js +0 -1
- package/components/u-dropdown-item/props.js +0 -1
- package/components/u-empty/props.js +11 -12
- package/components/u-form/props.js +8 -9
- package/components/u-form/u-form.vue +1 -1
- package/components/u-form-item/props.js +13 -9
- package/components/u-form-item/u-form-item.vue +1 -0
- package/components/u-gap/props.js +4 -5
- package/components/u-gap/u-gap.vue +5 -4
- package/components/u-grid/props.js +3 -4
- package/components/u-grid-item/props.js +2 -3
- package/components/u-grid-item/u-grid-item.vue +5 -0
- package/components/u-icon/props.js +17 -18
- package/components/u-icon/u-icon.vue +9 -6
- package/components/u-image/props.js +16 -17
- package/components/u-image/u-image.vue +1 -1
- package/components/u-index-anchor/props.js +5 -6
- package/components/u-index-anchor/u-index-anchor.vue +1 -1
- package/components/u-index-item/props.js +0 -1
- package/components/u-index-item/u-index-item.vue +1 -1
- package/components/u-index-list/props.js +5 -6
- package/components/u-index-list/u-index-list.vue +3 -2
- package/components/u-input/props.js +35 -36
- package/components/u-input/u-input.vue +10 -4
- package/components/u-keyboard/props.js +16 -17
- package/components/u-line/props.js +6 -7
- package/components/u-line-progress/props.js +5 -6
- package/components/u-link/props.js +7 -8
- package/components/u-list/props.js +14 -15
- package/components/u-list-item/props.js +1 -2
- package/components/u-loading-icon/props.js +11 -12
- package/components/u-loading-page/props.js +9 -10
- package/components/u-loadmore/props.js +18 -19
- package/components/u-modal/props.js +16 -17
- package/components/u-navbar/props.js +16 -17
- package/components/u-no-network/props.js +3 -4
- package/components/u-notice-bar/props.js +13 -14
- package/components/u-notify/props.js +9 -10
- package/components/u-notify/u-notify.vue +5 -0
- package/components/u-number-box/props.js +22 -23
- package/components/u-number-box/u-number-box.vue +21 -1
- package/components/u-number-keyboard/props.js +3 -4
- package/components/u-overlay/props.js +4 -5
- package/components/u-parse/props.js +8 -9
- package/components/u-parse/u-parse.vue +6 -1
- package/components/u-picker/props.js +16 -17
- package/components/u-picker-column/props.js +0 -1
- package/components/u-popup/props.js +15 -16
- package/components/u-qrcode/qrcode.js +1206 -0
- package/components/u-qrcode/u-qrcode.vue +199 -0
- package/components/u-radio/props.js +13 -14
- package/components/u-radio-group/props.js +17 -18
- package/components/u-rate/props.js +14 -15
- package/components/u-read-more/props.js +8 -9
- package/components/u-row/props.js +3 -4
- package/components/u-row-notice/props.js +7 -8
- package/components/u-row-notice/u-row-notice.vue +5 -0
- package/components/u-safe-bottom/props.js +0 -1
- package/components/u-scroll-list/props.js +6 -7
- package/components/u-search/props.js +24 -25
- package/components/u-skeleton/props.js +11 -12
- package/components/u-slider/props.js +11 -12
- package/components/u-status-bar/props.js +1 -2
- package/components/u-status-bar/u-status-bar.vue +1 -1
- package/components/u-steps/props.js +7 -8
- package/components/u-steps/u-steps.vue +1 -1
- package/components/u-steps-item/props.js +4 -5
- package/components/u-steps-item/u-steps-item.vue +1 -1
- package/components/u-sticky/props.js +6 -7
- package/components/u-sticky/u-sticky.vue +5 -0
- package/components/u-subsection/props.js +9 -10
- package/components/u-subsection/u-subsection.vue +2 -2
- package/components/u-swipe-action/props.js +1 -2
- package/components/u-swipe-action-item/nvue.js +5 -0
- package/components/u-swipe-action-item/props.js +6 -7
- package/components/u-swiper/props.js +24 -25
- package/components/u-swiper-indicator/props.js +5 -6
- package/components/u-switch/props.js +11 -12
- package/components/u-tabbar/props.js +8 -9
- package/components/u-tabbar-item/props.js +6 -7
- package/components/u-table/props.js +0 -1
- package/components/u-tabs/props.js +12 -13
- package/components/u-tabs-item/props.js +0 -1
- package/components/u-tag/props.js +15 -16
- package/components/u-td/props.js +0 -1
- package/components/u-text/props.js +21 -22
- package/components/u-textarea/props.js +23 -24
- package/components/u-toast/u-toast.vue +5 -0
- package/components/u-toolbar/props.js +6 -7
- package/components/u-tooltip/props.js +11 -12
- package/components/u-tooltip/u-tooltip.vue +0 -28
- package/components/u-tr/props.js +0 -1
- package/components/u-transition/props.js +4 -5
- package/components/u-transition/transition.js +8 -9
- package/components/u-transition/u-transition.vue +1 -1
- package/components/u-upload/props.js +22 -23
- package/components/u-upload/u-upload.vue +1 -1
- package/index.js +6 -6
- package/libs/config/props/actionSheet.js +1 -1
- package/libs/config/props/album.js +1 -1
- package/libs/config/props/avatarGroup.js +1 -1
- package/libs/config/props/backtop.js +2 -2
- package/libs/config/props/badge.js +1 -1
- package/libs/config/props/calendar.js +3 -3
- package/libs/config/props/checkboxGroup.js +1 -1
- package/libs/config/props/datetimePicker.js +1 -1
- package/libs/config/props/form.js +3 -3
- package/libs/config/props/formItem.js +1 -0
- package/libs/config/props/indexList.js +1 -1
- package/libs/config/props/noticeBar.js +1 -1
- package/libs/config/props/picker.js +2 -2
- package/libs/config/props/popup.js +1 -1
- package/libs/config/props/search.js +2 -2
- package/libs/config/props/slider.js +1 -1
- package/libs/config/props/swiper.js +1 -1
- package/libs/config/props/tabs.js +7 -7
- package/libs/config/props/text.js +2 -2
- package/libs/config/props/toast.js +1 -1
- package/libs/config/props/tooltip.js +1 -1
- package/libs/config/props/upload.js +3 -3
- package/libs/css/components.scss +11 -1
- package/libs/css/flex.scss +103 -101
- package/libs/function/colorGradient.js +8 -8
- package/libs/function/debounce.js +2 -2
- package/libs/function/digit.js +5 -5
- package/libs/function/index.js +29 -29
- package/libs/function/test.js +28 -28
- package/libs/function/throttle.js +2 -2
- package/package.json +4 -3
package/libs/function/test.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 验证电子邮箱格式
|
|
3
3
|
*/
|
|
4
|
-
function email(value) {
|
|
4
|
+
export function email(value) {
|
|
5
5
|
return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value)
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* 验证手机格式
|
|
10
10
|
*/
|
|
11
|
-
function mobile(value) {
|
|
11
|
+
export function mobile(value) {
|
|
12
12
|
return /^1[23456789]\d{9}$/.test(value)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* 验证URL格式
|
|
17
17
|
*/
|
|
18
|
-
function url(value) {
|
|
18
|
+
export function url(value) {
|
|
19
19
|
return /^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/
|
|
20
20
|
.test(value)
|
|
21
21
|
}
|
|
@@ -23,7 +23,7 @@ function url(value) {
|
|
|
23
23
|
/**
|
|
24
24
|
* 验证日期格式
|
|
25
25
|
*/
|
|
26
|
-
function date(value) {
|
|
26
|
+
export function date(value) {
|
|
27
27
|
if (!value) return false
|
|
28
28
|
// 判断是否数值或者字符串数值(意味着为时间戳),转为数值,否则new Date无法识别字符串时间戳
|
|
29
29
|
if (number(value)) value = +value
|
|
@@ -33,35 +33,35 @@ function date(value) {
|
|
|
33
33
|
/**
|
|
34
34
|
* 验证ISO类型的日期格式
|
|
35
35
|
*/
|
|
36
|
-
function dateISO(value) {
|
|
36
|
+
export function dateISO(value) {
|
|
37
37
|
return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* 验证十进制数字
|
|
42
42
|
*/
|
|
43
|
-
function number(value) {
|
|
43
|
+
export function number(value) {
|
|
44
44
|
return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value)
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* 验证字符串
|
|
49
49
|
*/
|
|
50
|
-
function string(value) {
|
|
50
|
+
export function string(value) {
|
|
51
51
|
return typeof value === 'string'
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* 验证整数
|
|
56
56
|
*/
|
|
57
|
-
function digits(value) {
|
|
57
|
+
export function digits(value) {
|
|
58
58
|
return /^\d+$/.test(value)
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* 验证身份证号码
|
|
63
63
|
*/
|
|
64
|
-
function idCard(value) {
|
|
64
|
+
export function idCard(value) {
|
|
65
65
|
return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
|
|
66
66
|
value
|
|
67
67
|
)
|
|
@@ -70,7 +70,7 @@ function idCard(value) {
|
|
|
70
70
|
/**
|
|
71
71
|
* 是否车牌号
|
|
72
72
|
*/
|
|
73
|
-
function carNo(value) {
|
|
73
|
+
export function carNo(value) {
|
|
74
74
|
// 新能源车牌
|
|
75
75
|
const xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/
|
|
76
76
|
// 旧车牌
|
|
@@ -86,7 +86,7 @@ function carNo(value) {
|
|
|
86
86
|
/**
|
|
87
87
|
* 金额,只允许2位小数
|
|
88
88
|
*/
|
|
89
|
-
function amount(value) {
|
|
89
|
+
export function amount(value) {
|
|
90
90
|
// 金额,只允许保留两位小数
|
|
91
91
|
return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value)
|
|
92
92
|
}
|
|
@@ -94,7 +94,7 @@ function amount(value) {
|
|
|
94
94
|
/**
|
|
95
95
|
* 中文
|
|
96
96
|
*/
|
|
97
|
-
function chinese(value) {
|
|
97
|
+
export function chinese(value) {
|
|
98
98
|
const reg = /^[\u4e00-\u9fa5]+$/gi
|
|
99
99
|
return reg.test(value)
|
|
100
100
|
}
|
|
@@ -102,14 +102,14 @@ function chinese(value) {
|
|
|
102
102
|
/**
|
|
103
103
|
* 只能输入字母
|
|
104
104
|
*/
|
|
105
|
-
function letter(value) {
|
|
105
|
+
export function letter(value) {
|
|
106
106
|
return /^[a-zA-Z]*$/.test(value)
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* 只能是字母或者数字
|
|
111
111
|
*/
|
|
112
|
-
function enOrNum(value) {
|
|
112
|
+
export function enOrNum(value) {
|
|
113
113
|
// 英文或者数字
|
|
114
114
|
const reg = /^[0-9a-zA-Z]*$/g
|
|
115
115
|
return reg.test(value)
|
|
@@ -118,28 +118,28 @@ function enOrNum(value) {
|
|
|
118
118
|
/**
|
|
119
119
|
* 验证是否包含某个值
|
|
120
120
|
*/
|
|
121
|
-
function contains(value, param) {
|
|
121
|
+
export function contains(value, param) {
|
|
122
122
|
return value.indexOf(param) >= 0
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
126
|
* 验证一个值范围[min, max]
|
|
127
127
|
*/
|
|
128
|
-
function range(value, param) {
|
|
128
|
+
export function range(value, param) {
|
|
129
129
|
return value >= param[0] && value <= param[1]
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
133
|
* 验证一个长度范围[min, max]
|
|
134
134
|
*/
|
|
135
|
-
function rangeLength(value, param) {
|
|
135
|
+
export function rangeLength(value, param) {
|
|
136
136
|
return value.length >= param[0] && value.length <= param[1]
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
140
|
* 是否固定电话
|
|
141
141
|
*/
|
|
142
|
-
function landline(value) {
|
|
142
|
+
export function landline(value) {
|
|
143
143
|
const reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/
|
|
144
144
|
return reg.test(value)
|
|
145
145
|
}
|
|
@@ -147,7 +147,7 @@ function landline(value) {
|
|
|
147
147
|
/**
|
|
148
148
|
* 判断是否为空
|
|
149
149
|
*/
|
|
150
|
-
function empty(value) {
|
|
150
|
+
export function empty(value) {
|
|
151
151
|
switch (typeof value) {
|
|
152
152
|
case 'undefined':
|
|
153
153
|
return true
|
|
@@ -173,7 +173,7 @@ function empty(value) {
|
|
|
173
173
|
/**
|
|
174
174
|
* 是否json字符串
|
|
175
175
|
*/
|
|
176
|
-
function jsonString(value) {
|
|
176
|
+
export function jsonString(value) {
|
|
177
177
|
if (typeof value === 'string') {
|
|
178
178
|
try {
|
|
179
179
|
const obj = JSON.parse(value)
|
|
@@ -191,7 +191,7 @@ function jsonString(value) {
|
|
|
191
191
|
/**
|
|
192
192
|
* 是否数组
|
|
193
193
|
*/
|
|
194
|
-
function array(value) {
|
|
194
|
+
export function array(value) {
|
|
195
195
|
if (typeof Array.isArray === 'function') {
|
|
196
196
|
return Array.isArray(value)
|
|
197
197
|
}
|
|
@@ -201,14 +201,14 @@ function array(value) {
|
|
|
201
201
|
/**
|
|
202
202
|
* 是否对象
|
|
203
203
|
*/
|
|
204
|
-
function object(value) {
|
|
204
|
+
export function object(value) {
|
|
205
205
|
return Object.prototype.toString.call(value) === '[object Object]'
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
/**
|
|
209
209
|
* 是否短信验证码
|
|
210
210
|
*/
|
|
211
|
-
function code(value, len = 6) {
|
|
211
|
+
export function code(value, len = 6) {
|
|
212
212
|
return new RegExp(`^\\d{${len}}$`).test(value)
|
|
213
213
|
}
|
|
214
214
|
|
|
@@ -216,7 +216,7 @@ function code(value, len = 6) {
|
|
|
216
216
|
* 是否函数方法
|
|
217
217
|
* @param {Object} value
|
|
218
218
|
*/
|
|
219
|
-
function func(value) {
|
|
219
|
+
export function func(value) {
|
|
220
220
|
return typeof value === 'function'
|
|
221
221
|
}
|
|
222
222
|
|
|
@@ -224,14 +224,14 @@ function func(value) {
|
|
|
224
224
|
* 是否promise对象
|
|
225
225
|
* @param {Object} value
|
|
226
226
|
*/
|
|
227
|
-
function promise(value) {
|
|
227
|
+
export function promise(value) {
|
|
228
228
|
return object(value) && func(value.then) && func(value.catch)
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
/** 是否图片格式
|
|
232
232
|
* @param {Object} value
|
|
233
233
|
*/
|
|
234
|
-
function image(value) {
|
|
234
|
+
export function image(value) {
|
|
235
235
|
const newValue = value.split('?')[0]
|
|
236
236
|
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i
|
|
237
237
|
return IMAGE_REGEXP.test(newValue)
|
|
@@ -241,7 +241,7 @@ function image(value) {
|
|
|
241
241
|
* 是否视频格式
|
|
242
242
|
* @param {Object} value
|
|
243
243
|
*/
|
|
244
|
-
function video(value) {
|
|
244
|
+
export function video(value) {
|
|
245
245
|
const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i
|
|
246
246
|
return VIDEO_REGEXP.test(value)
|
|
247
247
|
}
|
|
@@ -251,7 +251,7 @@ function video(value) {
|
|
|
251
251
|
* @param {Object}
|
|
252
252
|
* @return {Boolean}
|
|
253
253
|
*/
|
|
254
|
-
function regExp(o) {
|
|
254
|
+
export function regExp(o) {
|
|
255
255
|
return o && Object.prototype.toString.call(o) === '[object RegExp]'
|
|
256
256
|
}
|
|
257
257
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let timer; let
|
|
1
|
+
let timer; let
|
|
2
2
|
flag
|
|
3
3
|
/**
|
|
4
4
|
* 节流原理:在一定时间内,只能触发一次
|
|
@@ -8,7 +8,7 @@ let timer; let
|
|
|
8
8
|
* @param {Boolean} immediate 是否立即执行
|
|
9
9
|
* @return null
|
|
10
10
|
*/
|
|
11
|
-
function throttle(func, wait = 500, immediate = true) {
|
|
11
|
+
export function throttle(func, wait = 500, immediate = true) {
|
|
12
12
|
if (immediate) {
|
|
13
13
|
if (!flag) {
|
|
14
14
|
flag = true
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "uview-plus",
|
|
3
3
|
"name": "uview-plus",
|
|
4
4
|
"displayName": "uview-plus3.0重磅发布,全面的Vue3移动组件库。",
|
|
5
|
-
"version": "3.1.
|
|
5
|
+
"version": "3.1.52",
|
|
6
6
|
"description": "uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"uview",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"contact": {
|
|
30
|
-
"qq": "
|
|
30
|
+
"qq": "598821125"
|
|
31
31
|
},
|
|
32
32
|
"declaration": {
|
|
33
33
|
"ads": "无",
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"platforms": {
|
|
44
44
|
"cloud": {
|
|
45
45
|
"tcb": "y",
|
|
46
|
-
|
|
46
|
+
"aliyun": "y",
|
|
47
|
+
"alipay": "n"
|
|
47
48
|
},
|
|
48
49
|
"client": {
|
|
49
50
|
"Vue": {
|