fusions-ui 1.2.4 → 1.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/components/fu-avatar/fu-avatar.vue +4 -2
- package/components/fu-avatar/props.js +52 -15
- package/components/fu-avatar-group/fu-avatar-group.vue +3 -2
- package/components/fu-avatar-group/props.js +31 -9
- package/components/fu-badge/fu-badge.vue +8 -14
- package/components/fu-badge/props.js +56 -16
- package/components/fu-banner-arc/fu-banner-arc.vue +4 -5
- package/components/fu-banner-arc/props.js +15 -4
- package/components/fu-button/fu-button.vue +18 -20
- package/components/fu-button/props.js +108 -35
- package/components/fu-cell/fu-cell.vue +9 -8
- package/components/fu-cell-group/fu-cell-group.vue +2 -1
- package/components/fu-cell-group/props.js +7 -2
- package/components/fu-checkbox/fu-checkbox.vue +5 -4
- package/components/fu-checkbox/props.js +51 -14
- package/components/fu-code-input/fu-code-input.vue +10 -6
- package/components/fu-code-input/props.js +66 -17
- package/components/fu-code-verify/fu-code-verify.vue +9 -5
- package/components/fu-code-verify/props.js +64 -17
- package/components/fu-collapse/fu-collapse.vue +10 -3
- package/components/fu-collapse/props.js +9 -3
- package/components/fu-collapse-item/fu-collapse-item.vue +45 -31
- package/components/fu-collapse-item/props.js +49 -16
- package/components/fu-countdown/fu-countdown.vue +2 -1
- package/components/fu-countdown/props.js +15 -4
- package/components/fu-datetime-picker/fu-datetime-picker.vue +6 -5
- package/components/fu-datetime-picker/props.js +91 -25
- package/components/fu-form/fu-form.vue +2 -1
- package/components/fu-form/props.js +34 -6
- package/components/fu-form-item/fu-form-item.vue +26 -33
- package/components/fu-form-item/props.js +30 -8
- package/components/fu-grid/fu-grid.vue +16 -17
- package/components/fu-grid/props.js +20 -5
- package/components/fu-grid-item/fu-grid-item.vue +31 -35
- package/components/fu-grid-item/props.js +11 -3
- package/components/fu-icon/fu-icon.vue +110 -0
- package/components/fu-icon/fuicon.css +584 -0
- package/components/{fu-icons/icons.js → fu-icon/fuicon.js} +1031 -1031
- package/components/{fu-icons/fuicons.ttf → fu-icon/fuicon.ttf} +0 -0
- package/components/fu-icon/props.js +55 -0
- package/components/fu-image/fu-image.vue +15 -10
- package/components/fu-image/props.js +69 -18
- package/components/fu-index-anchor/fu-index-anchor.vue +6 -5
- package/components/fu-index-anchor/props.js +20 -6
- package/components/fu-index-item/fu-index-item.vue +4 -4
- package/components/fu-index-list/fu-index-list.vue +9 -9
- package/components/fu-index-list/props.js +19 -6
- package/components/fu-input/fu-input.vue +54 -68
- package/components/fu-input/props.js +145 -53
- package/components/fu-keyboard/fu-keyboard.vue +19 -9
- package/components/fu-keyboard/keyboard-car.vue +33 -22
- package/components/fu-keyboard/keyboard-number.vue +17 -9
- package/components/fu-keyboard/props.js +66 -17
- package/components/fu-line/fu-line.vue +17 -13
- package/components/fu-line/props.js +30 -5
- package/components/fu-link/fu-link.vue +14 -8
- package/components/fu-link/props.js +22 -7
- package/components/fu-loading/fu-loading.vue +32 -27
- package/components/fu-loading/props.js +28 -8
- package/components/fu-loading-more/fu-loading-more.vue +19 -23
- package/components/fu-loading-more/props.js +27 -13
- package/components/fu-modal/fu-modal.vue +11 -6
- package/components/fu-modal/props.js +61 -17
- package/components/{fu-nav-bar/fu-nav-bar.vue → fu-navbar/fu-navbar.vue} +37 -44
- package/components/fu-notice-bar/fu-notice-bar.vue +10 -8
- package/components/fu-notice-bar/notice-column.vue +187 -122
- package/components/fu-notice-bar/notice-row.vue +85 -28
- package/components/fu-notice-bar/props.js +83 -22
- package/components/fu-number-box/fu-number-box.vue +26 -28
- package/components/fu-number-box/props.js +37 -11
- package/components/fu-parse/fu-parse.vue +0 -1
- package/components/fu-picker/fu-picker.vue +22 -17
- package/components/fu-picker/props.js +70 -19
- package/components/fu-popup/fu-popup.vue +38 -43
- package/components/fu-popup/props.js +34 -9
- package/components/fu-progress/fu-progress.vue +3 -2
- package/components/fu-progress/props.js +36 -9
- package/components/fu-rate/fu-rate.vue +40 -32
- package/components/fu-rate/props.js +47 -13
- package/components/fu-read-more/fu-read-more.vue +19 -14
- package/components/fu-read-more/props.js +68 -46
- package/components/fu-ribbon/fu-ribbon.vue +8 -7
- package/components/fu-ribbon/props.js +15 -4
- package/components/fu-scroll-list/fu-scroll-list.vue +18 -34
- package/components/fu-scroll-list/props.js +19 -10
- package/components/fu-search/fu-search.vue +13 -18
- package/components/fu-search/props.js +69 -17
- package/components/fu-section/fu-section.vue +19 -22
- package/components/fu-section/props.js +30 -4
- package/components/fu-sign-board/fu-sign-board.vue +34 -17
- package/components/fu-sign-board/props.js +15 -5
- package/components/fu-skeleton/fu-skeleton.vue +8 -12
- package/components/fu-skeleton/props.js +15 -4
- package/components/fu-steps/fu-steps.vue +3 -2
- package/components/fu-steps/props.js +23 -7
- package/components/fu-steps-item/fu-steps-item.vue +3 -3
- package/components/fu-steps-item/props.js +15 -5
- package/components/fu-sticky/fu-sticky.vue +3 -3
- package/components/fu-sticky/props.js +21 -7
- package/components/fu-subsection/fu-subsection.vue +29 -22
- package/components/fu-subsection/props.js +40 -10
- package/components/fu-swipe-action-item/bindingx.js +1 -1
- package/components/fu-swipe-action-item/fu-swipe-action-item.vue +134 -123
- package/components/fu-swipe-action-item/mpwxs.js +1 -1
- package/components/fu-swipe-action-item/props.js +22 -6
- package/components/fu-swiper/fu-swiper.vue +29 -27
- package/components/fu-swiper/props.js +81 -25
- package/components/fu-switch/fu-switch.vue +20 -12
- package/components/fu-switch/props.js +48 -13
- package/components/fu-tabs/fu-tabs.vue +36 -33
- package/components/fu-tabs/props.js +46 -13
- package/components/fu-tag/fu-tag.vue +24 -21
- package/components/fu-tag/props.js +63 -17
- package/components/fu-text/fu-text.vue +72 -33
- package/components/fu-text/props.js +85 -27
- package/components/fu-text/value.js +6 -6
- package/components/fu-textarea/fu-textarea.vue +13 -17
- package/components/fu-textarea/props.js +103 -30
- package/components/fu-timeaxis/fu-timeaxis.vue +1 -1
- package/components/fu-timeaxis-item/fu-timeaxis-item.vue +8 -4
- package/components/fu-transition/fu-transition.vue +48 -49
- package/components/fu-transition/props.js +21 -0
- package/components/fu-upload/fu-upload.vue +3 -1
- package/components/fu-upload/props.js +67 -19
- package/components/fu-upload/upload-file.vue +31 -18
- package/components/fu-upload/upload-image.vue +37 -19
- package/components/fu-vtabs/fu-vtabs.vue +6 -4
- package/components/fu-vtabs/props.js +50 -15
- package/components/fu-waterfall/fu-waterfall.vue +11 -9
- package/components/fu-waterfall/props.js +37 -15
- package/index.js +17 -24
- package/index.scss +9 -7
- package/libs/config/config.js +16 -9
- package/libs/function/applyEven.js +9 -9
- package/libs/function/check.js +81 -89
- package/libs/function/{index.js → common.js} +5 -5
- package/libs/function/message.js +0 -27
- package/libs/mixin/mixin.js +26 -21
- package/libs/{utils/min.router.config.js → route/min.route.config.js} +7 -7
- package/libs/{utils/router.config.js → route/route.config.js} +10 -11
- package/libs/{css/main.scss → style/common.scss} +50 -87
- package/libs/style/style.h5.scss +8 -0
- package/libs/style/style.mp.scss +15 -0
- package/package.json +1 -1
- package/components/fu-calendar/calendar-item.vue +0 -214
- package/components/fu-calendar/calendar.js +0 -546
- package/components/fu-calendar/fu-calendar.vue +0 -536
- package/components/fu-calendar/i18n/en.json +0 -12
- package/components/fu-calendar/i18n/index.js +0 -8
- package/components/fu-calendar/i18n/zh-Hans.json +0 -12
- package/components/fu-calendar/i18n/zh-Hant.json +0 -12
- package/components/fu-calendar/util.js +0 -360
- package/components/fu-date-picker/calendar-item.vue +0 -177
- package/components/fu-date-picker/calendar.vue +0 -917
- package/components/fu-date-picker/fu-date-picker.vue +0 -1069
- package/components/fu-date-picker/i18n/en.json +0 -22
- package/components/fu-date-picker/i18n/index.js +0 -8
- package/components/fu-date-picker/i18n/zh-Hans.json +0 -22
- package/components/fu-date-picker/i18n/zh-Hant.json +0 -22
- package/components/fu-date-picker/props.js +0 -68
- package/components/fu-date-picker/time-picker.vue +0 -924
- package/components/fu-date-picker/util.js +0 -419
- package/components/fu-icons/fu-icons.vue +0 -102
- package/components/fu-icons/fuicons.css +0 -585
- package/components/fu-landscape/fu-landscape.vue +0 -167
- package/components/fu-landscape/props.js +0 -64
- package/components/fu-tabbar/fu-tabbar.vue +0 -333
- package/components/fu-tabbar/props.js +0 -78
- package/libs/css/style.h5.scss +0 -35
- package/libs/css/style.mp.scss +0 -50
- package/libs/utils/util.js +0 -58
- /package/components/{fu-nav-bar → fu-navbar}/props.js +0 -0
- /package/components/{fu-nav-bar → fu-navbar}/status-bar.vue +0 -0
- /package/{components/fu-datetime-picker → libs/function}/dayjs.js +0 -0
- /package/libs/{css → style}/color.scss +0 -0
- /package/libs/{css/component.scss → style/components.scss} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="fu-input" :class="inputClass" :style="[wrapperStyle]">
|
|
3
|
-
<view class="fu-input__content"
|
|
2
|
+
<view class="fu-input" :class="inputClass" :style="[wrapperStyle]" @click="handleClick">
|
|
3
|
+
<view class="fu-input__content">
|
|
4
4
|
<view class="fu-input__content__prefix-icon">
|
|
5
5
|
<slot name="prefix">
|
|
6
|
-
<fu-
|
|
6
|
+
<fu-icon :name="prefixIcon" :size="prefixSize" :color="prefixColor" />
|
|
7
7
|
</slot>
|
|
8
8
|
</view>
|
|
9
9
|
<view class="fu-input__content__field-box">
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
:selection-start="selectionStart"
|
|
26
26
|
:password="password || type === 'password' || undefined"
|
|
27
27
|
:ignoreCompositionEvent="ignoreCompositionEvent"
|
|
28
|
-
@input="
|
|
29
|
-
@blur="
|
|
30
|
-
@focus="
|
|
31
|
-
@confirm="
|
|
32
|
-
@keyboardheightchange="
|
|
28
|
+
@input="handleInput"
|
|
29
|
+
@blur="handleBlur"
|
|
30
|
+
@focus="handleFocus"
|
|
31
|
+
@confirm="handleConfirm"
|
|
32
|
+
@keyboardheightchange="handleKeyboardheightchange" />
|
|
33
33
|
</view>
|
|
34
|
-
<view class="fu-input__content__clear" v-if="isShowClear" @tap="
|
|
35
|
-
<fu-
|
|
34
|
+
<view class="fu-input__content__clear" v-if="isShowClear" @tap="handleClear">
|
|
35
|
+
<fu-icon name="close-fill" size="25" color="#CCCCCC" />
|
|
36
36
|
</view>
|
|
37
37
|
<view class="fu-input__content__subfix-icon">
|
|
38
38
|
<slot name="suffix">
|
|
39
|
-
<fu-
|
|
39
|
+
<fu-icon :name="suffixIcon" :size="suffixSize" :color="suffixColor" />
|
|
40
40
|
</slot>
|
|
41
41
|
</view>
|
|
42
42
|
</view>
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
* @value left 左显示
|
|
81
81
|
* @value center 居中显示
|
|
82
82
|
* @value right 右显示
|
|
83
|
-
* @property {String,Number} size 输入框字体的大小( 默认
|
|
83
|
+
* @property {String,Number} size 输入框字体的大小( 默认 14)
|
|
84
84
|
* @property {String} color 输入框字体颜色( 默认 '#333333' )
|
|
85
85
|
* @property {String} prefixIcon 输入框前置图标
|
|
86
|
-
* @property {String,Number} prefixSize 输入框前置图标大小(默认18)
|
|
86
|
+
* @property {String,Number} prefixSize 输入框前置图标大小(默认 18)
|
|
87
87
|
* @property {String} prefixColor 输入框前置图标颜色 默认(#8f9ca2)
|
|
88
88
|
* @property {String} suffixIcon 输入框后置图标
|
|
89
89
|
* @property {String,Number} suffixSize 输入框后置图标大小(默认18)
|
|
@@ -92,16 +92,14 @@
|
|
|
92
92
|
* @value surround 四周边框
|
|
93
93
|
* @value bottom 底部边框
|
|
94
94
|
* @value none 无边框
|
|
95
|
-
* @property {String} shape = [circle|square] 输入框形状,circle-圆形,square
|
|
95
|
+
* @property {String} shape = [circle|square] 输入框形状,circle-圆形,square-方形(默认 'square')
|
|
96
96
|
* @value circle 圆形
|
|
97
97
|
* @value square 方形
|
|
98
|
-
* @property {String,Number} radius 设置圆角 仅border = [surround|none]支持 (默认 '')
|
|
99
|
-
* @property {String,Number} height 自定义输入框高度 (默认 22)
|
|
100
|
-
* @property {String,Number} padding 自定左右内间距(默认 6)
|
|
101
98
|
* @property {String} margin 自定义外间距(默认 '0')
|
|
102
99
|
* @property {Function} formatter 内容式化函数
|
|
103
|
-
* @property {String,Object} customStyle
|
|
100
|
+
* @property {String,Object} customStyle 定义需要用到的外部样式
|
|
104
101
|
* @property {Boolean} ignoreCompositionEvent 是否忽略组件内对文本合成系统事件的处理
|
|
102
|
+
*
|
|
105
103
|
* @event {Function} click readonly或disabled为true时 点击input时触发
|
|
106
104
|
* @event {Function} input 输入内容变化时触发
|
|
107
105
|
* @event {Function} change 输入内容变化时触发
|
|
@@ -110,11 +108,12 @@
|
|
|
110
108
|
* @event {Function} confirm 点击完成按钮时触发
|
|
111
109
|
* @event {Function} focus 输入框聚焦时触发
|
|
112
110
|
* @event {Function} keyboardheightchange 键盘高度发生变化的时候触发此事件 微信小程序基础库2.7.0+、App 3.1.0+
|
|
111
|
+
* @example <fu-input placeholder="请输入内容"></fu-input>
|
|
113
112
|
*/
|
|
114
113
|
export default {
|
|
115
114
|
name:"FuInput",
|
|
116
|
-
emits: ['input', 'update:modelValue', 'change', 'clear', 'blur', 'confirm', 'focus', 'click', 'keyboardheightchange'],
|
|
117
115
|
mixins: [mpMixin, mixin, props],
|
|
116
|
+
emits: ['input', 'update:modelValue', 'change', 'clear', 'blur', 'confirm', 'focus', 'click', 'keyboardheightchange'],
|
|
118
117
|
model: {
|
|
119
118
|
prop: 'modelValue',
|
|
120
119
|
event: 'update:modelValue'
|
|
@@ -142,35 +141,29 @@
|
|
|
142
141
|
// 组件的类名
|
|
143
142
|
inputClass() {
|
|
144
143
|
let classes = [], { border, disabled, shape } = this;
|
|
145
|
-
border ===
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
border === "bottom" && (classes = classes.concat(["fu-border-bottom"]));
|
|
151
|
-
return classes.join(" ");
|
|
144
|
+
border === 'surround' && (classes = classes.concat(['fu-border']));
|
|
145
|
+
classes.push(`fu-input-${shape}`);
|
|
146
|
+
border === 'bottom' && (classes = classes.concat(['fu-border-bottom', 'fu-input-no-radius']));
|
|
147
|
+
return classes.join(' ');
|
|
152
148
|
},
|
|
153
149
|
// 组件的样式
|
|
154
150
|
wrapperStyle() {
|
|
155
|
-
const style = {
|
|
156
|
-
|
|
157
|
-
|
|
151
|
+
const style = {
|
|
152
|
+
margin: this.margin
|
|
153
|
+
};
|
|
158
154
|
// 禁用状态下,被背景色加上对应的样式
|
|
159
155
|
if (this.disabled) {
|
|
160
156
|
style.backgroundColor = this.disabledColor;
|
|
161
157
|
}
|
|
162
|
-
if((this.border === 'surround' || this.border === 'none') && this.radius) {
|
|
163
|
-
style.borderRadius = this.$fu.addUnit(this.radius);
|
|
164
|
-
}
|
|
165
158
|
// 无边框时,去除内边距
|
|
166
159
|
if (this.border === "none") {
|
|
167
160
|
style.padding = "0";
|
|
168
161
|
} else {
|
|
169
162
|
// 由于uni-app的iOS开发者能力有限,导致需要分开写才有效
|
|
170
|
-
style.paddingTop = '
|
|
171
|
-
style.paddingBottom = '
|
|
172
|
-
style.paddingLeft =
|
|
173
|
-
style.paddingRight =
|
|
163
|
+
style.paddingTop = '10px';
|
|
164
|
+
style.paddingBottom = '10px';
|
|
165
|
+
style.paddingLeft = '8px';
|
|
166
|
+
style.paddingRight = '8px';
|
|
174
167
|
}
|
|
175
168
|
return this.$fu.deepMerge(style, this.$fu.addStyle(this.customStyle));
|
|
176
169
|
},
|
|
@@ -180,7 +173,6 @@
|
|
|
180
173
|
color: this.color,
|
|
181
174
|
fontSize: this.$fu.addUnit(this.size),
|
|
182
175
|
textAlign: this.align,
|
|
183
|
-
height: this.$fu.addUnit(this.height)
|
|
184
176
|
};
|
|
185
177
|
if(this.disabled || this.readonly) {
|
|
186
178
|
style['pointer-events'] = 'none';
|
|
@@ -199,8 +191,8 @@
|
|
|
199
191
|
},
|
|
200
192
|
|
|
201
193
|
// 当键盘输入时,触发input事件
|
|
202
|
-
|
|
203
|
-
let { value =
|
|
194
|
+
handleInput(e) {
|
|
195
|
+
let { value = '' } = e.detail || {};
|
|
204
196
|
// 格式化过滤方法
|
|
205
197
|
const formatter = this.formatter || this.innerFormatter
|
|
206
198
|
const formatValue = formatter(value)
|
|
@@ -217,18 +209,17 @@
|
|
|
217
209
|
const value = this.innerValue;
|
|
218
210
|
this.$nextTick(() => {
|
|
219
211
|
// 兼容 Vue2
|
|
220
|
-
this.$emit(
|
|
212
|
+
this.$emit('input', value);
|
|
221
213
|
// 兼容 Vue3
|
|
222
214
|
this.$emit('update:modelValue', value);
|
|
223
215
|
// 标识value值的变化是由内部引起的
|
|
224
216
|
this.changeFromInner = true;
|
|
225
|
-
this.$emit(
|
|
226
|
-
// console.log(this.fuFormItem)
|
|
217
|
+
this.$emit('change', value);
|
|
227
218
|
});
|
|
228
219
|
},
|
|
229
220
|
|
|
230
221
|
// 输入框失去焦点时触发
|
|
231
|
-
|
|
222
|
+
handleBlur(e) {
|
|
232
223
|
this.$emit("blur", e.detail.value);
|
|
233
224
|
// H5端的blur会先于点击清除控件的点击click事件触发,导致focused
|
|
234
225
|
// 瞬间为false,从而隐藏了清除控件而无法被点击到
|
|
@@ -238,13 +229,13 @@
|
|
|
238
229
|
},
|
|
239
230
|
|
|
240
231
|
// 输入框聚焦时触发
|
|
241
|
-
|
|
232
|
+
handleFocus(e) {
|
|
242
233
|
this.focused = true;
|
|
243
234
|
this.$emit("focus");
|
|
244
235
|
},
|
|
245
236
|
|
|
246
237
|
// 点击清除控件
|
|
247
|
-
|
|
238
|
+
handleClear() {
|
|
248
239
|
this.innerValue = "";
|
|
249
240
|
this.$nextTick(() => {
|
|
250
241
|
this.valueChange();
|
|
@@ -253,19 +244,20 @@
|
|
|
253
244
|
},
|
|
254
245
|
|
|
255
246
|
// 点击完成按钮时触发
|
|
256
|
-
|
|
247
|
+
handleConfirm(event) {
|
|
257
248
|
this.$emit("confirm", this.innerValue);
|
|
258
249
|
},
|
|
250
|
+
|
|
259
251
|
// 键盘高度发生变化的时候触发此事件
|
|
260
252
|
// 兼容性:微信小程序2.7.0+、App 3.1.0+
|
|
261
|
-
|
|
253
|
+
handleKeyboardheightchange() {
|
|
262
254
|
this.$emit("keyboardheightchange");
|
|
263
255
|
},
|
|
264
256
|
|
|
265
|
-
// readonly
|
|
266
|
-
|
|
257
|
+
// 点击input时触发(仅readonly=true时生效)
|
|
258
|
+
handleClick(event) {
|
|
267
259
|
event.stopPropagation(); // 阻止事件向上传播
|
|
268
|
-
if(this.readonly
|
|
260
|
+
if(this.readonly) {
|
|
269
261
|
this.$emit('click')
|
|
270
262
|
}
|
|
271
263
|
}
|
|
@@ -310,42 +302,32 @@
|
|
|
310
302
|
</script>
|
|
311
303
|
|
|
312
304
|
<style lang="scss" scoped>
|
|
313
|
-
|
|
305
|
+
@import '../../libs/style/components.scss';
|
|
306
|
+
$color_333333: #333333;
|
|
314
307
|
$color_dadbde: #dadbde;
|
|
315
308
|
|
|
316
309
|
.fu-input {
|
|
317
|
-
|
|
318
|
-
/* #ifdef APP-NVUE */
|
|
319
|
-
flex-direction: row;
|
|
320
|
-
/* #endif */
|
|
310
|
+
@include flex(row);
|
|
321
311
|
align-items: center;
|
|
322
312
|
justify-content: space-between;
|
|
323
313
|
flex: 1;
|
|
324
314
|
|
|
325
315
|
&__content {
|
|
316
|
+
@include flex(row);
|
|
326
317
|
flex: 1;
|
|
327
|
-
display: flex;
|
|
328
|
-
/* #ifdef APP-NVUE */
|
|
329
|
-
flex-direction: row;
|
|
330
|
-
/* #endif */
|
|
331
318
|
align-items: center;
|
|
332
319
|
justify-content: space-between;
|
|
333
320
|
|
|
334
321
|
&__field-box {
|
|
322
|
+
@include flex(row);
|
|
335
323
|
position: relative;
|
|
336
|
-
display: flex;
|
|
337
|
-
/* #ifdef APP-NVUE */
|
|
338
|
-
flex-direction: row;
|
|
339
|
-
/* #endif */
|
|
340
324
|
margin: 0;
|
|
341
325
|
flex: 1;
|
|
342
326
|
|
|
343
327
|
&__field {
|
|
344
|
-
line-height: 26px;
|
|
345
328
|
text-align: left;
|
|
346
|
-
color: $
|
|
347
|
-
|
|
348
|
-
font-size: 15px;
|
|
329
|
+
color: $color_333333;
|
|
330
|
+
font-size: 14px;
|
|
349
331
|
flex: 1;
|
|
350
332
|
/* #ifdef MP-ALIPAY */
|
|
351
333
|
padding: 0;
|
|
@@ -395,7 +377,11 @@
|
|
|
395
377
|
}
|
|
396
378
|
|
|
397
379
|
.fu-input-square {
|
|
398
|
-
border-radius:
|
|
380
|
+
border-radius: 5px;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.fu-input-no-radius {
|
|
384
|
+
border-radius: 0;
|
|
399
385
|
}
|
|
400
386
|
|
|
401
387
|
.fu-input-password {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description value / v-model 输入的值
|
|
5
|
+
*/
|
|
4
6
|
value: {
|
|
5
7
|
type: [String,Number],
|
|
6
8
|
default: ''
|
|
@@ -9,188 +11,278 @@ export default {
|
|
|
9
11
|
type: [String,Number],
|
|
10
12
|
default: ''
|
|
11
13
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @description number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
|
|
16
|
+
* idcard-身份证输入键盘,微信、支付宝、百度、QQ小程序
|
|
17
|
+
* digit-带小数点的数字键盘,App的nvue页面、微信、支付宝、百度、头条、QQ小程序
|
|
18
|
+
* text-文本输入键盘
|
|
19
|
+
* @default 'text'
|
|
20
|
+
*/
|
|
16
21
|
type: {
|
|
17
22
|
type: String,
|
|
18
23
|
default: 'text'
|
|
19
24
|
},
|
|
20
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @description 是否禁用输入框
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
21
29
|
disabled: {
|
|
22
30
|
type: Boolean,
|
|
23
31
|
default: false
|
|
24
32
|
},
|
|
25
|
-
|
|
33
|
+
/**
|
|
34
|
+
* @description 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
26
37
|
readonly: {
|
|
27
38
|
type: Boolean,
|
|
28
39
|
default: false
|
|
29
40
|
},
|
|
30
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @description 禁用状态时的背景色
|
|
43
|
+
* @default '#F5F7FA'
|
|
44
|
+
*/
|
|
31
45
|
disabledColor: {
|
|
32
46
|
type: String,
|
|
33
47
|
default: '#F5F7FA'
|
|
34
48
|
},
|
|
35
|
-
|
|
49
|
+
/**
|
|
50
|
+
* @description 是否显示清除控件
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
36
53
|
clearable: {
|
|
37
54
|
type: Boolean,
|
|
38
55
|
default: false
|
|
39
56
|
},
|
|
40
|
-
|
|
57
|
+
/**
|
|
58
|
+
* @description 是否密码类型
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
41
61
|
password: {
|
|
42
62
|
type: Boolean,
|
|
43
63
|
default: false
|
|
44
64
|
},
|
|
45
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @description 最大输入长度,设置为 -1 的时候不限制最大长度
|
|
67
|
+
* @default -1
|
|
68
|
+
*/
|
|
46
69
|
maxlength: {
|
|
47
70
|
type: [String, Number],
|
|
48
71
|
default: -1
|
|
49
72
|
},
|
|
50
|
-
|
|
73
|
+
/**
|
|
74
|
+
* @description 输入框为空时的占位符
|
|
75
|
+
* @default null
|
|
76
|
+
*/
|
|
51
77
|
placeholder: {
|
|
52
78
|
type: String,
|
|
53
79
|
default: null
|
|
54
80
|
},
|
|
55
|
-
|
|
81
|
+
/**
|
|
82
|
+
* @description 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写:deep(...)
|
|
83
|
+
* @default 'input-placeholder'
|
|
84
|
+
*/
|
|
56
85
|
placeholderClass: {
|
|
57
86
|
type: String,
|
|
58
87
|
default: 'input-placeholder'
|
|
59
88
|
},
|
|
60
|
-
|
|
89
|
+
/**
|
|
90
|
+
* @description 指定placeholder的样式
|
|
91
|
+
* @default 'color: #CCCCCC'
|
|
92
|
+
*/
|
|
61
93
|
placeholderStyle: {
|
|
62
94
|
type: [String, Object],
|
|
63
|
-
default: 'color: #CCCCCC'
|
|
95
|
+
default: 'color: #CCCCCC'
|
|
64
96
|
},
|
|
65
|
-
|
|
66
|
-
|
|
97
|
+
/**
|
|
98
|
+
* @description 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档https://uniapp.dcloud.io/component/input
|
|
99
|
+
* @default 'done'
|
|
100
|
+
*/
|
|
67
101
|
confirmType: {
|
|
68
102
|
type: String,
|
|
69
103
|
default: 'done'
|
|
70
104
|
},
|
|
71
|
-
|
|
105
|
+
/**
|
|
106
|
+
* @description 点击键盘右下角按钮时是否保持键盘不收起,H5无效
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
72
109
|
confirmHold: {
|
|
73
110
|
type: Boolean,
|
|
74
111
|
default: false
|
|
75
112
|
},
|
|
76
|
-
|
|
113
|
+
/**
|
|
114
|
+
* @description focus时,点击页面的时候不收起键盘,微信小程序有效
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
77
117
|
holdKeyboard: {
|
|
78
118
|
type: Boolean,
|
|
79
119
|
default: false
|
|
80
120
|
},
|
|
81
|
-
|
|
82
|
-
|
|
121
|
+
/**
|
|
122
|
+
* @description 自动获取焦点
|
|
123
|
+
* 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
83
126
|
focus: {
|
|
84
127
|
type: Boolean,
|
|
85
128
|
default: false
|
|
86
129
|
},
|
|
87
|
-
|
|
130
|
+
/**
|
|
131
|
+
* @description 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
|
|
132
|
+
* @default false
|
|
133
|
+
*/
|
|
88
134
|
autoBlur: {
|
|
89
135
|
type: Boolean,
|
|
90
136
|
default: false
|
|
91
137
|
},
|
|
92
|
-
|
|
138
|
+
/**
|
|
139
|
+
* @description 指定focus时光标的位置
|
|
140
|
+
* @default -1
|
|
141
|
+
*/
|
|
93
142
|
cursor: {
|
|
94
143
|
type: [String, Number],
|
|
95
144
|
default: -1
|
|
96
145
|
},
|
|
97
|
-
|
|
146
|
+
/**
|
|
147
|
+
* @description 输入框聚焦时底部与键盘的距离
|
|
148
|
+
* @default 30
|
|
149
|
+
*/
|
|
98
150
|
cursorSpacing: {
|
|
99
151
|
type: [String, Number],
|
|
100
152
|
default: 30
|
|
101
153
|
},
|
|
102
|
-
|
|
154
|
+
/**
|
|
155
|
+
* @description 光标起始位置,自动聚集时有效,需与selection-end搭配使用
|
|
156
|
+
* @default -1
|
|
157
|
+
*/
|
|
103
158
|
selectionStart: {
|
|
104
159
|
type: [String, Number],
|
|
105
160
|
default: -1
|
|
106
161
|
},
|
|
107
|
-
|
|
162
|
+
/**
|
|
163
|
+
* @description 光标结束位置,自动聚集时有效,需与selection-start搭配使用
|
|
164
|
+
* @default -1
|
|
165
|
+
*/
|
|
108
166
|
selectionEnd: {
|
|
109
167
|
type: [String, Number],
|
|
110
168
|
default: -1
|
|
111
169
|
},
|
|
112
|
-
|
|
170
|
+
/**
|
|
171
|
+
* @description 键盘弹起时,是否自动上推页面
|
|
172
|
+
* @default true
|
|
173
|
+
*/
|
|
113
174
|
adjustPosition: {
|
|
114
175
|
type: Boolean,
|
|
115
176
|
default: true
|
|
116
177
|
},
|
|
117
|
-
|
|
178
|
+
/**
|
|
179
|
+
* @description 输入框内容对齐方式
|
|
180
|
+
* @values 'left' - 左对齐, 'center' - 居中, 'right' - 右对齐
|
|
181
|
+
* @default 'left'
|
|
182
|
+
*/
|
|
118
183
|
align: {
|
|
119
184
|
type: String,
|
|
120
185
|
default: 'left'
|
|
121
186
|
},
|
|
122
|
-
|
|
187
|
+
/**
|
|
188
|
+
* @description 输入框字体的大小
|
|
189
|
+
* @default 14
|
|
190
|
+
*/
|
|
123
191
|
size: {
|
|
124
192
|
type: [String, Number],
|
|
125
|
-
default:
|
|
193
|
+
default: 14
|
|
126
194
|
},
|
|
127
|
-
|
|
195
|
+
/**
|
|
196
|
+
* @description 输入框字体颜色
|
|
197
|
+
* @default '#333333'
|
|
198
|
+
*/
|
|
128
199
|
color: {
|
|
129
200
|
type: String,
|
|
130
201
|
default: '#333333'
|
|
131
202
|
},
|
|
132
|
-
|
|
203
|
+
/**
|
|
204
|
+
* @description 输入框前置图标
|
|
205
|
+
*/
|
|
133
206
|
prefixIcon: {
|
|
134
207
|
type: String,
|
|
135
208
|
default: ''
|
|
136
209
|
},
|
|
137
|
-
|
|
210
|
+
/**
|
|
211
|
+
* @description 输入框前置图标大小
|
|
212
|
+
* @default 18
|
|
213
|
+
*/
|
|
138
214
|
prefixSize: {
|
|
139
215
|
type: [String,Number],
|
|
140
216
|
default: 18
|
|
141
217
|
},
|
|
142
|
-
|
|
218
|
+
/**
|
|
219
|
+
* @description 输入框前置图标颜色
|
|
220
|
+
* @default '#8f9ca2'
|
|
221
|
+
*/
|
|
143
222
|
prefixColor: {
|
|
144
223
|
type: String,
|
|
145
224
|
default: '#8f9ca2'
|
|
146
225
|
},
|
|
147
|
-
|
|
226
|
+
/**
|
|
227
|
+
* @description 输入框后置图标
|
|
228
|
+
*/
|
|
148
229
|
suffixIcon: {
|
|
149
230
|
type: String,
|
|
150
231
|
default: ''
|
|
151
232
|
},
|
|
152
|
-
|
|
233
|
+
/**
|
|
234
|
+
* @description 输入框后置图标大小
|
|
235
|
+
* @default 18
|
|
236
|
+
*/
|
|
153
237
|
suffixSize: {
|
|
154
238
|
type: [String,Number],
|
|
155
239
|
default: 18
|
|
156
240
|
},
|
|
157
|
-
|
|
241
|
+
/**
|
|
242
|
+
* @description 输入框后置图标颜色
|
|
243
|
+
* @default '#8f9ca2'
|
|
244
|
+
*/
|
|
158
245
|
suffixColor: {
|
|
159
246
|
type: String,
|
|
160
247
|
default: '#8f9ca2'
|
|
161
248
|
},
|
|
162
|
-
|
|
249
|
+
/**
|
|
250
|
+
* @description 边框类型
|
|
251
|
+
* @values 'surround' - 四周边框, 'bottom' - 底部边框, 'none' - 无边框
|
|
252
|
+
* @default 'surround'
|
|
253
|
+
*/
|
|
163
254
|
border: {
|
|
164
255
|
type: String,
|
|
165
256
|
default: 'surround'
|
|
166
257
|
},
|
|
167
|
-
|
|
258
|
+
/**
|
|
259
|
+
* @description 输入框形状,circle-圆形,square-方形
|
|
260
|
+
* @values 'circle' - 圆形, 'square' - 方形
|
|
261
|
+
* @default 'square'
|
|
262
|
+
*/
|
|
168
263
|
shape: {
|
|
169
264
|
type: String,
|
|
170
265
|
default: 'square'
|
|
171
266
|
},
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
height: {
|
|
177
|
-
type: [String,Number],
|
|
178
|
-
default: 22
|
|
179
|
-
},
|
|
180
|
-
padding: {
|
|
181
|
-
type: [String,Number],
|
|
182
|
-
default: 6
|
|
183
|
-
},
|
|
267
|
+
/**
|
|
268
|
+
* @description 设置外间距
|
|
269
|
+
*/
|
|
184
270
|
margin: {
|
|
185
271
|
type: String,
|
|
186
272
|
default: '0'
|
|
187
273
|
},
|
|
188
|
-
|
|
274
|
+
/**
|
|
275
|
+
* @description 用于处理或者过滤输入框内容的方法
|
|
276
|
+
* @default null
|
|
277
|
+
*/
|
|
189
278
|
formatter: {
|
|
190
279
|
type: [Function, null],
|
|
191
280
|
default: null
|
|
192
281
|
},
|
|
193
|
-
|
|
282
|
+
/**
|
|
283
|
+
* @description 是否忽略组件内对文本合成系统事件的处理
|
|
284
|
+
* @default true
|
|
285
|
+
*/
|
|
194
286
|
ignoreCompositionEvent: {
|
|
195
287
|
type: Boolean,
|
|
196
288
|
default: true
|