uview-plus 3.5.5 → 3.5.15
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 +35 -0
- package/components/u-calendar/month.vue +1 -1
- package/components/u-calendar/u-calendar.vue +2 -2
- package/components/u-color-picker/u-color-picker.vue +1095 -0
- package/components/u-datetime-picker/datetimePicker.js +1 -0
- package/components/u-datetime-picker/props.js +5 -0
- package/components/u-datetime-picker/u-datetime-picker.vue +4 -3
- package/components/u-input/props.js +6 -1
- package/components/u-input/u-input.vue +9 -2
- package/components/u-pdf-reader/props.js +19 -0
- package/components/u-pdf-reader/u-pdf-reader.vue +52 -0
- package/components/u-picker/picker.js +2 -1
- package/components/u-picker/props.js +6 -1
- package/components/u-picker/u-picker.vue +2 -1
- package/components/u-popup/props.js +2 -2
- package/components/u-poster/u-poster.vue +622 -0
- package/components/u-qrcode/u-qrcode.vue +18 -12
- package/components/u-search/props.js +152 -134
- package/components/u-search/u-search.vue +14 -2
- package/components/u-short-video/u-short-video.vue +463 -0
- package/components/u-slider/props.js +5 -1
- package/components/u-slider/slider.js +2 -1
- package/components/u-slider/u-slider.vue +8 -3
- package/components/u-tabbar/props.js +10 -0
- package/components/u-tabbar/tabbar.js +3 -1
- package/components/u-tabbar/u-tabbar.vue +7 -0
- package/package.json +1 -1
|
@@ -1,138 +1,156 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
2
|
import defProps from '../../libs/config/props.js'
|
|
3
|
+
|
|
3
4
|
export const props = defineMixin({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
// 占位提示文字
|
|
16
|
-
placeholder: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: () => defProps.search.placeholder
|
|
19
|
-
},
|
|
20
|
-
// 是否启用清除控件
|
|
21
|
-
clearabled: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: () => defProps.search.clearabled
|
|
24
|
-
},
|
|
25
|
-
// 是否自动聚焦
|
|
26
|
-
focus: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: () => defProps.search.focus
|
|
29
|
-
},
|
|
30
|
-
// 是否在搜索框右侧显示取消按钮
|
|
31
|
-
showAction: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: () => defProps.search.showAction
|
|
34
|
-
},
|
|
35
|
-
// 右边控件的样式
|
|
36
|
-
actionStyle: {
|
|
37
|
-
type: Object,
|
|
38
|
-
default: () => defProps.search.actionStyle
|
|
39
|
-
},
|
|
40
|
-
// 取消按钮文字
|
|
41
|
-
actionText: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: () => defProps.search.actionText
|
|
44
|
-
},
|
|
45
|
-
// 输入框内容对齐方式,可选值为 left|center|right
|
|
46
|
-
inputAlign: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: () => defProps.search.inputAlign
|
|
49
|
-
},
|
|
50
|
-
// input输入框的样式,可以定义文字颜色,大小等,对象形式
|
|
51
|
-
inputStyle: {
|
|
52
|
-
type: Object,
|
|
53
|
-
default: () => defProps.search.inputStyle
|
|
54
|
-
},
|
|
55
|
-
// 是否启用输入框
|
|
56
|
-
disabled: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: () => defProps.search.disabled
|
|
59
|
-
},
|
|
60
|
-
// 边框颜色
|
|
61
|
-
borderColor: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: () => defProps.search.borderColor
|
|
64
|
-
},
|
|
65
|
-
// 搜索图标的颜色,默认同输入框字体颜色
|
|
66
|
-
searchIconColor: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: () => defProps.search.searchIconColor
|
|
69
|
-
},
|
|
70
|
-
// 输入框字体颜色
|
|
71
|
-
color: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: () => defProps.search.color
|
|
74
|
-
},
|
|
75
|
-
// placeholder的颜色
|
|
76
|
-
placeholderColor: {
|
|
77
|
-
type: String,
|
|
78
|
-
default: () => defProps.search.placeholderColor
|
|
79
|
-
},
|
|
80
|
-
// 左边输入框的图标,可以为uView图标名称或图片路径
|
|
81
|
-
searchIcon: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: () => defProps.search.searchIcon
|
|
84
|
-
},
|
|
85
|
-
searchIconSize: {
|
|
86
|
-
type: [Number, String],
|
|
87
|
-
default: () => defProps.search.searchIconSize
|
|
88
|
-
},
|
|
89
|
-
// 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30px"、"30px 20px"等写法
|
|
90
|
-
margin: {
|
|
91
|
-
type: String,
|
|
92
|
-
default: () => defProps.search.margin
|
|
93
|
-
},
|
|
94
|
-
// 开启showAction时,是否在input获取焦点时才显示
|
|
95
|
-
animation: {
|
|
96
|
-
type: Boolean,
|
|
97
|
-
default: () => defProps.search.animation
|
|
98
|
-
},
|
|
99
|
-
// 输入框的初始化内容
|
|
100
|
-
modelValue: {
|
|
101
|
-
type: String,
|
|
102
|
-
default: () => defProps.search.value
|
|
103
|
-
},
|
|
5
|
+
props: {
|
|
6
|
+
// #ifdef VUE3
|
|
7
|
+
// 绑定的值
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: [String, Number],
|
|
10
|
+
default: () => defProps.search.value
|
|
11
|
+
},
|
|
12
|
+
// #endif
|
|
13
|
+
// #ifdef VUE2
|
|
14
|
+
// 绑定的值
|
|
104
15
|
value: {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
16
|
+
type: [String, Number],
|
|
17
|
+
default: () => defProps.search.value
|
|
18
|
+
},
|
|
19
|
+
// #endif
|
|
20
|
+
// 搜索框形状,round-圆形,square-方形
|
|
21
|
+
shape: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: () => defProps.search.shape
|
|
24
|
+
},
|
|
25
|
+
// 搜索框背景色
|
|
26
|
+
bgColor: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: () => defProps.search.bgColor
|
|
29
|
+
},
|
|
30
|
+
// 占位提示文字
|
|
31
|
+
placeholder: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: () => defProps.search.placeholder
|
|
34
|
+
},
|
|
35
|
+
// 是否启用清除控件
|
|
36
|
+
clearabled: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: () => defProps.search.clearabled
|
|
39
|
+
},
|
|
40
|
+
// 是否仅聚焦时显示清除控件
|
|
41
|
+
onlyClearableOnFocused: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true
|
|
44
|
+
},
|
|
45
|
+
// 是否自动聚焦
|
|
46
|
+
focus: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: () => defProps.search.focus
|
|
49
|
+
},
|
|
50
|
+
// 是否在搜索框右侧显示取消按钮
|
|
51
|
+
showAction: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: () => defProps.search.showAction
|
|
54
|
+
},
|
|
55
|
+
// 右侧取消按钮文字
|
|
56
|
+
actionText: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: () => defProps.search.actionText
|
|
59
|
+
},
|
|
60
|
+
// 搜索框左侧文本
|
|
61
|
+
label: {
|
|
62
|
+
type: [String, Number, null],
|
|
63
|
+
default: () => defProps.search.label
|
|
64
|
+
},
|
|
65
|
+
// 输入框内容对齐方式,可选值为:left|center|right
|
|
66
|
+
inputAlign: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: () => defProps.search.inputAlign
|
|
69
|
+
},
|
|
70
|
+
// 是否启用输入框
|
|
71
|
+
disabled: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: () => defProps.search.disabled
|
|
74
|
+
},
|
|
75
|
+
// 开启showAction时,是否在input获取焦点时才显示
|
|
76
|
+
animation: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: () => defProps.search.animation
|
|
79
|
+
},
|
|
80
|
+
// 边框颜色,只要配置了颜色,才会有边框
|
|
81
|
+
borderColor: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: () => defProps.search.borderColor
|
|
84
|
+
},
|
|
85
|
+
// 搜索图标的颜色,默认同输入框字体颜色
|
|
86
|
+
searchIconColor: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: () => defProps.search.searchIconColor
|
|
89
|
+
},
|
|
90
|
+
// 搜索图标的大小
|
|
91
|
+
searchIconSize: {
|
|
92
|
+
type: [Number, String],
|
|
93
|
+
default: () => defProps.search.searchIconSize
|
|
94
|
+
},
|
|
95
|
+
// 输入框字体颜色
|
|
96
|
+
color: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: () => defProps.search.color
|
|
99
|
+
},
|
|
100
|
+
// placeholder的颜色
|
|
101
|
+
placeholderColor: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: () => defProps.search.placeholderColor
|
|
104
|
+
},
|
|
105
|
+
// 左边输入框的图标,可以为uView图标名称或图片路径
|
|
106
|
+
searchIcon: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: () => defProps.search.searchIcon
|
|
109
|
+
},
|
|
110
|
+
// 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30px"
|
|
111
|
+
margin: {
|
|
112
|
+
type: String,
|
|
113
|
+
default: () => defProps.search.margin
|
|
114
|
+
},
|
|
115
|
+
// 应该是uView-plus版本新增的,用于控制搜索图标的插槽位置
|
|
116
|
+
iconPosition: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: () => defProps.search.iconPosition
|
|
119
|
+
},
|
|
120
|
+
// 输入框最大能输入的长度,-1为不限制长度
|
|
121
|
+
maxlength: {
|
|
122
|
+
type: [String, Number],
|
|
123
|
+
default: () => defProps.search.maxlength
|
|
124
|
+
},
|
|
125
|
+
// 输入框高度,单位px
|
|
126
|
+
height: {
|
|
127
|
+
type: [String, Number],
|
|
128
|
+
default: () => defProps.search.height
|
|
129
|
+
},
|
|
130
|
+
// 键盘弹起时,是否自动上推页面
|
|
131
|
+
adjustPosition: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: () => defProps.search.adjustPosition
|
|
134
|
+
},
|
|
135
|
+
// 键盘收起时,是否自动失去焦点
|
|
136
|
+
autoBlur: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
default: () => defProps.search.autoBlur
|
|
139
|
+
},
|
|
140
|
+
// 输入框的样式,对象形式
|
|
141
|
+
inputStyle: {
|
|
142
|
+
type: Object,
|
|
143
|
+
default: () => defProps.search.inputStyle
|
|
144
|
+
},
|
|
145
|
+
// 右侧控件的样式,对象形式
|
|
146
|
+
actionStyle: {
|
|
147
|
+
type: Object,
|
|
148
|
+
default: () => defProps.search.actionStyle
|
|
149
|
+
},
|
|
150
|
+
// 自定义样式,对象形式
|
|
151
|
+
customStyle: {
|
|
152
|
+
type: Object,
|
|
153
|
+
default: () => defProps.search.customStyle
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
})
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
/>
|
|
56
56
|
<view
|
|
57
57
|
class="u-search__content__icon u-search__content__close"
|
|
58
|
-
v-if="
|
|
58
|
+
v-if="isShowClear"
|
|
59
59
|
@click="clear"
|
|
60
60
|
>
|
|
61
61
|
<up-icon
|
|
@@ -111,6 +111,7 @@
|
|
|
111
111
|
* @property {String | Number} label 搜索框左边显示内容
|
|
112
112
|
* @property {Boolean} adjustPosition 键盘弹起时,是否自动上推页面
|
|
113
113
|
* @property {Boolean} autoBlur 键盘收起时,是否自动失去焦点
|
|
114
|
+
* @property {Boolean} onlyClearableOnFocused 是否仅在聚焦时显示清除控件(默认 true )
|
|
114
115
|
* @property {Object} customStyle 定义需要用到的外部样式
|
|
115
116
|
*
|
|
116
117
|
* @event {Function} change 输入框内容发生变化时触发
|
|
@@ -125,7 +126,6 @@
|
|
|
125
126
|
data() {
|
|
126
127
|
return {
|
|
127
128
|
keyword: '',
|
|
128
|
-
showClear: false, // 是否显示右边的清除图标
|
|
129
129
|
show: false,
|
|
130
130
|
// 标记input当前状态是否处于聚焦中,如果是,才会显示右侧的清除控件
|
|
131
131
|
focused: this.focus
|
|
@@ -165,6 +165,18 @@
|
|
|
165
165
|
computed: {
|
|
166
166
|
showActionBtn() {
|
|
167
167
|
return !this.animation && this.showAction
|
|
168
|
+
},
|
|
169
|
+
// 是否显示清除控件
|
|
170
|
+
isShowClear() {
|
|
171
|
+
const { clearabled, focused, keyword, onlyClearableOnFocused } = this;
|
|
172
|
+
if (!clearabled) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
if (onlyClearableOnFocused) {
|
|
176
|
+
return !!focused && keyword !== "";
|
|
177
|
+
} else {
|
|
178
|
+
return keyword !== "";
|
|
179
|
+
}
|
|
168
180
|
}
|
|
169
181
|
},
|
|
170
182
|
emits: ['clear', 'search', 'custom', 'focus', 'blur', 'click', 'clickIcon', 'update:modelValue', 'change'],
|