fusions-ui 1.2.4 → 1.2.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/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 +107 -0
- package/components/fu-icon/icon.css +584 -0
- package/components/{fu-icons/icons.js → fu-icon/icon.js} +1031 -1031
- package/components/{fu-icons/fuicons.ttf → fu-icon/icon.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 +18 -3
- 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
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
this.$fu.error('金额模式下,text参数需要为金额格式');
|
|
12
12
|
}
|
|
13
13
|
// 进行格式化,判断用户传入的format参数为正则,或者函数,如果没有传入format,则使用默认的金额格式化处理
|
|
14
|
-
if (this.$fu.
|
|
14
|
+
if (this.$fu.isFunc(format)) {
|
|
15
15
|
// 如果用户传入的是函数,使用函数格式化
|
|
16
16
|
return format(text)
|
|
17
17
|
}
|
|
@@ -20,9 +20,9 @@ export default {
|
|
|
20
20
|
break
|
|
21
21
|
case 'date':
|
|
22
22
|
// 判断是否合法的日期或者时间戳
|
|
23
|
-
!this.$fu.
|
|
23
|
+
!this.$fu.checkDate(text) && this.$fu.error('日期模式下,text参数需要为日期或时间戳格式')
|
|
24
24
|
// 进行格式化,判断用户传入的format参数为正则,或者函数,如果没有传入format,则使用默认的格式化处理
|
|
25
|
-
if (this.$fu.
|
|
25
|
+
if (this.$fu.isFunc(format)) {
|
|
26
26
|
// 如果用户传入的是函数,使用函数格式化
|
|
27
27
|
return format(text)
|
|
28
28
|
} if (format) {
|
|
@@ -35,7 +35,7 @@ export default {
|
|
|
35
35
|
case 'phone':
|
|
36
36
|
// 判断是否合法的手机号
|
|
37
37
|
// !mobile(text) && error('手机号模式下,text参数需要为手机号码格式')
|
|
38
|
-
if (this.$fu.
|
|
38
|
+
if (this.$fu.isFunc(format)) {
|
|
39
39
|
// 如果用户传入的是函数,使用函数格式化
|
|
40
40
|
return format(text)
|
|
41
41
|
} if (format === 'encrypt') {
|
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
case 'name':
|
|
48
48
|
// 判断是否合法的字符粗
|
|
49
49
|
!(typeof (text) === 'string') && this.$fu.error('姓名模式下,text参数需要为字符串格式')
|
|
50
|
-
if (this.$fu.
|
|
50
|
+
if (this.$fu.isFunc(format)) {
|
|
51
51
|
// 如果用户传入的是函数,使用函数格式化
|
|
52
52
|
return format(text)
|
|
53
53
|
} if (format === 'encrypt') {
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
break
|
|
59
59
|
case 'link':
|
|
60
60
|
// 判断是否合法的字符粗
|
|
61
|
-
!this.$fu.
|
|
61
|
+
!this.$fu.isUrl(href) && this.$fu.error('超链接模式下,href参数需要为URL格式')
|
|
62
62
|
return text
|
|
63
63
|
break
|
|
64
64
|
default:
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
* @value surround 四周边框
|
|
68
68
|
* @value bottom 底部边框
|
|
69
69
|
* @property {String} borderColor 边框颜色(默认 '#dadbde')
|
|
70
|
-
* @property {String,Number} radius 定义圆角(默认 5)
|
|
71
70
|
* @property {String,Number} size 自定义字体大小(默认 14)
|
|
72
|
-
* @property {String,Object} customStyle
|
|
71
|
+
* @property {String,Object} customStyle 定义需要用到的外部样式
|
|
73
72
|
* @event {Function} formatter 内容式化函数
|
|
73
|
+
*
|
|
74
74
|
* @event {Function(e)} focus 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度
|
|
75
75
|
* @event {Function(e)} blur 输入框失去焦点时触发,event.detail = {value, cursor}
|
|
76
76
|
* @event {Function(e)} linechange 输入框行数变化时调用,event.detail = {height: 0, heightRpx: 0, lineCount: 0}
|
|
@@ -127,14 +127,14 @@
|
|
|
127
127
|
// 组件的样式
|
|
128
128
|
textareaStyle() {
|
|
129
129
|
const style = {
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
borderColor: this.borderColor,
|
|
131
|
+
backgroundColor: this.disabled && this.disabledColor
|
|
132
132
|
};
|
|
133
133
|
// #ifdef APP-NVUE
|
|
134
134
|
// 由于textarea在安卓nvue上的差异性,需要额外再调整其内边距
|
|
135
135
|
if (this.$fu.os() === "android") {
|
|
136
136
|
style.paddingTop = "6px";
|
|
137
|
-
style.paddingLeft = "
|
|
137
|
+
style.paddingLeft = "6px";
|
|
138
138
|
style.paddingBottom = "3px";
|
|
139
139
|
style.paddingRight = "6px";
|
|
140
140
|
}
|
|
@@ -231,24 +231,20 @@
|
|
|
231
231
|
</script>
|
|
232
232
|
|
|
233
233
|
<style lang="scss" scoped>
|
|
234
|
+
@import '../../libs/style/components.scss';
|
|
234
235
|
$color_dadbde: #dadbde;
|
|
236
|
+
$color-disabled: #F5F7FA;
|
|
235
237
|
|
|
236
238
|
.fu-textarea {
|
|
237
|
-
|
|
238
|
-
background-color: #
|
|
239
|
+
@include flex(row);
|
|
240
|
+
background-color: #ffffff;
|
|
239
241
|
position: relative;
|
|
240
|
-
/* #ifndef APP-NVUE */
|
|
241
|
-
display: flex;
|
|
242
|
-
/* #endif */
|
|
243
|
-
/* #ifdef APP-NVUE */
|
|
244
|
-
flex-direction: row;
|
|
245
|
-
/* #endif */
|
|
246
242
|
flex: 1;
|
|
247
|
-
padding:
|
|
243
|
+
padding: 9px 12px;
|
|
248
244
|
|
|
249
245
|
&__field {
|
|
250
246
|
flex: 1;
|
|
251
|
-
font-size:
|
|
247
|
+
font-size: 14px;
|
|
252
248
|
color: #333333;
|
|
253
249
|
width: 100%;
|
|
254
250
|
/* #ifdef MP-ALIPAY */
|
|
@@ -257,7 +253,7 @@
|
|
|
257
253
|
}
|
|
258
254
|
|
|
259
255
|
&--radius {
|
|
260
|
-
border-radius:
|
|
256
|
+
border-radius: 5px;
|
|
261
257
|
}
|
|
262
258
|
|
|
263
259
|
&--no-radius {
|
|
@@ -265,7 +261,7 @@
|
|
|
265
261
|
}
|
|
266
262
|
|
|
267
263
|
&--disabled {
|
|
268
|
-
background-color:
|
|
264
|
+
background-color: $color-disabled;
|
|
269
265
|
}
|
|
270
266
|
|
|
271
267
|
&__count {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 输入框的内容
|
|
5
|
+
*/
|
|
4
6
|
value: {
|
|
5
7
|
type: [String,Number],
|
|
6
8
|
default: ''
|
|
@@ -9,122 +11,193 @@ export default {
|
|
|
9
11
|
type: [String,Number],
|
|
10
12
|
default: ''
|
|
11
13
|
},
|
|
12
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @description 输入框为空时占位符
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
13
18
|
placeholder: {
|
|
14
19
|
type: [String,Number],
|
|
15
20
|
default: null
|
|
16
21
|
},
|
|
17
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @description 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写:depp(...)
|
|
24
|
+
* @default 'textarea-placeholder'
|
|
25
|
+
*/
|
|
18
26
|
placeholderClass: {
|
|
19
27
|
type: String,
|
|
20
28
|
default: 'textarea-placeholder'
|
|
21
29
|
},
|
|
22
|
-
|
|
30
|
+
/**
|
|
31
|
+
* @description 指定placeholder的样式
|
|
32
|
+
* @default 'color: #CCCCCC'
|
|
33
|
+
*/
|
|
23
34
|
placeholderStyle: {
|
|
24
35
|
type: [String,Object],
|
|
25
36
|
default: 'color: #CCCCCC'
|
|
26
37
|
},
|
|
27
|
-
|
|
38
|
+
/**
|
|
39
|
+
* @description 输入框高度
|
|
40
|
+
* @default 70
|
|
41
|
+
*/
|
|
28
42
|
height: {
|
|
29
43
|
type: [String,Number],
|
|
30
44
|
default: 70
|
|
31
45
|
},
|
|
32
|
-
|
|
46
|
+
/**
|
|
47
|
+
* @description 设置键盘右下角按钮的文字,仅微信小程序,App-vue和H5有效
|
|
48
|
+
* @default 'done'
|
|
49
|
+
*/
|
|
33
50
|
confirmType: {
|
|
34
51
|
type: String,
|
|
35
52
|
default: 'done'
|
|
36
53
|
},
|
|
37
|
-
|
|
54
|
+
/**
|
|
55
|
+
* @description 是否禁用
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
38
58
|
disabled: {
|
|
39
59
|
type: Boolean,
|
|
40
60
|
default: false
|
|
41
61
|
},
|
|
42
|
-
|
|
62
|
+
/**
|
|
63
|
+
* @description 禁用状态时的背景色
|
|
64
|
+
* @default '#F5F7FA'
|
|
65
|
+
*/
|
|
66
|
+
disabledColor: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: '#F5F7FA'
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* @description 是否显示统计字数
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
43
74
|
count: {
|
|
44
75
|
type: Boolean,
|
|
45
76
|
default: false
|
|
46
77
|
},
|
|
47
|
-
|
|
78
|
+
/**
|
|
79
|
+
* @description 是否自动获取焦点,nvue不支持,H5取决于浏览器的实现
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
48
82
|
focus: {
|
|
49
83
|
type: Boolean,
|
|
50
84
|
default: false
|
|
51
85
|
},
|
|
52
|
-
|
|
86
|
+
/**
|
|
87
|
+
* @description 是否自动增加高度
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
53
90
|
autoHeight: {
|
|
54
91
|
type: Boolean,
|
|
55
92
|
default: false
|
|
56
93
|
},
|
|
57
|
-
|
|
94
|
+
/**
|
|
95
|
+
* @description 如果textarea是在一个position:fixed的区域,需要显示指定属性fixed为true
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
58
98
|
fixed: {
|
|
59
99
|
type: Boolean,
|
|
60
100
|
default: false
|
|
61
101
|
},
|
|
62
|
-
|
|
102
|
+
/**
|
|
103
|
+
* @description 指定光标与键盘的距离
|
|
104
|
+
*/
|
|
63
105
|
cursorSpacing: {
|
|
64
106
|
type: Number,
|
|
65
107
|
default: 0
|
|
66
108
|
},
|
|
67
|
-
|
|
109
|
+
/**
|
|
110
|
+
* @description 指定focus时的光标位置
|
|
111
|
+
*/
|
|
68
112
|
cursor: {
|
|
69
113
|
type: [String,Number],
|
|
70
114
|
default: ''
|
|
71
115
|
},
|
|
72
|
-
|
|
116
|
+
/**
|
|
117
|
+
* @description 是否显示键盘上方带有“完成”按钮那一栏
|
|
118
|
+
* @default true
|
|
119
|
+
*/
|
|
73
120
|
showConfirmBar: {
|
|
74
121
|
type: Boolean,
|
|
75
122
|
default: true
|
|
76
123
|
},
|
|
77
|
-
|
|
124
|
+
/**
|
|
125
|
+
* @description 光标起始位置,自动聚焦时有效,需与selection-end搭配使用
|
|
126
|
+
* @default -1
|
|
127
|
+
*/
|
|
78
128
|
selectionStart: {
|
|
79
129
|
type: Number,
|
|
80
130
|
default: -1
|
|
81
131
|
},
|
|
82
|
-
|
|
132
|
+
/**
|
|
133
|
+
* @description 光标结束位置,自动聚焦时有效,需与selection-start搭配使用
|
|
134
|
+
* @default -1
|
|
135
|
+
*/
|
|
83
136
|
selectionEnd: {
|
|
84
137
|
type: Number,
|
|
85
138
|
default: -1
|
|
86
139
|
},
|
|
87
|
-
|
|
140
|
+
/**
|
|
141
|
+
* @description 键盘弹起时,是否自动上推页面
|
|
142
|
+
* @default true
|
|
143
|
+
*/
|
|
88
144
|
adjustPosition: {
|
|
89
145
|
type: Boolean,
|
|
90
146
|
default: true
|
|
91
147
|
},
|
|
92
|
-
|
|
148
|
+
/**
|
|
149
|
+
* @description 是否去掉 iOS 下的默认内边距,只微信小程序有效
|
|
150
|
+
* @default false
|
|
151
|
+
*/
|
|
93
152
|
disableDefaultPadding: {
|
|
94
153
|
type: Boolean,
|
|
95
154
|
default: false
|
|
96
155
|
},
|
|
97
|
-
|
|
156
|
+
/**
|
|
157
|
+
* @description focus时,点击页面的时候不收起键盘,只微信小程序有效
|
|
158
|
+
* @default false
|
|
159
|
+
*/
|
|
98
160
|
holdKeyboard: {
|
|
99
161
|
type: Boolean,
|
|
100
162
|
default: false
|
|
101
163
|
},
|
|
102
|
-
|
|
164
|
+
/**
|
|
165
|
+
* @description 最大输入长度,设置为 -1 的时候不限制最大长度
|
|
166
|
+
* @default 140
|
|
167
|
+
*/
|
|
103
168
|
maxlength: {
|
|
104
169
|
type: [String,Number],
|
|
105
170
|
default: 140
|
|
106
171
|
},
|
|
107
|
-
|
|
172
|
+
/**
|
|
173
|
+
* @description 边框类型
|
|
174
|
+
* @values 'surround' - 四周边框, 'bottom' - 底部边框
|
|
175
|
+
* @default 'surround'
|
|
176
|
+
*/
|
|
108
177
|
border: {
|
|
109
178
|
type: String,
|
|
110
179
|
default: 'surround'
|
|
111
180
|
},
|
|
112
|
-
|
|
181
|
+
/**
|
|
182
|
+
* @description 边框颜色
|
|
183
|
+
* @default '#dadbde'
|
|
184
|
+
*/
|
|
113
185
|
borderColor: {
|
|
114
186
|
type: String,
|
|
115
187
|
default: '#dadbde'
|
|
116
188
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
// 文本域字体大小(默认 '14px')
|
|
189
|
+
/**
|
|
190
|
+
* @description 文本域字体大小
|
|
191
|
+
* @default 14
|
|
192
|
+
*/
|
|
123
193
|
size: {
|
|
124
194
|
type: [String,Number],
|
|
125
|
-
default:
|
|
195
|
+
default: 14
|
|
126
196
|
},
|
|
127
|
-
|
|
197
|
+
/**
|
|
198
|
+
* @description 用于处理或者过滤输入框内容的方法
|
|
199
|
+
* @default null
|
|
200
|
+
*/
|
|
128
201
|
formatter: {
|
|
129
202
|
type: [Function,null],
|
|
130
203
|
default: null
|
|
@@ -14,12 +14,16 @@
|
|
|
14
14
|
export default {
|
|
15
15
|
name: "FuTimeaxisItem",
|
|
16
16
|
props: {
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @description 左侧节点背景颜色
|
|
19
|
+
*/
|
|
18
20
|
bgColor: {
|
|
19
21
|
type: String,
|
|
20
22
|
default: ""
|
|
21
23
|
},
|
|
22
|
-
|
|
24
|
+
/**
|
|
25
|
+
* @description 左侧节点绝对定位top值
|
|
26
|
+
*/
|
|
23
27
|
nodeTop: {
|
|
24
28
|
type: [String,Number],
|
|
25
29
|
default: 0
|
|
@@ -40,7 +44,7 @@
|
|
|
40
44
|
</script>
|
|
41
45
|
|
|
42
46
|
<style lang="scss" scoped>
|
|
43
|
-
@import '../../libs/
|
|
47
|
+
@import '../../libs/style/components.scss';
|
|
44
48
|
|
|
45
49
|
.fu-timeaxis-item {
|
|
46
50
|
@include flex(column);
|
|
@@ -59,6 +63,6 @@
|
|
|
59
63
|
align-items: center;
|
|
60
64
|
justify-content: center;
|
|
61
65
|
z-index: 99;
|
|
62
|
-
font-size:
|
|
66
|
+
font-size: 12px;
|
|
63
67
|
}
|
|
64
68
|
</style>
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- #ifndef APP-NVUE -->
|
|
3
|
-
<view v-if="isShow" ref="ani" :animation="animationData" :
|
|
3
|
+
<view v-if="isShow" ref="ani" :animation="animationData" :style="transformStyle" @click="handleClick">
|
|
4
4
|
<slot></slot>
|
|
5
5
|
</view>
|
|
6
6
|
<!-- #endif -->
|
|
7
7
|
<!-- #ifdef APP-NVUE -->
|
|
8
|
-
<view v-if="isShow" ref="ani" :animation="animationData" :
|
|
8
|
+
<view v-if="isShow" ref="ani" :animation="animationData" :style="transformStyle" @click="handleClick">
|
|
9
9
|
<slot></slot>
|
|
10
10
|
</view>
|
|
11
11
|
<!-- #endif -->
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script>
|
|
15
|
+
import mixin from '../../libs/mixin/mixin.js'
|
|
15
16
|
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
16
17
|
import { createAnimation } from './createAnimation'
|
|
18
|
+
import props from './props.js'
|
|
17
19
|
/**
|
|
18
20
|
* Transition 过渡动画
|
|
19
|
-
* @description
|
|
21
|
+
* @description 此组件为过渡动画
|
|
20
22
|
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
|
|
21
23
|
* @property {Array,String} mode = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
|
|
22
24
|
* @value fade 渐隐渐出过渡
|
|
@@ -27,43 +29,12 @@
|
|
|
27
29
|
* @value zoom-in 由小到大过渡
|
|
28
30
|
* @value zoom-out 由大到小过渡
|
|
29
31
|
* @property {Number} duration 过渡动画持续时间
|
|
30
|
-
* @property {Object}
|
|
32
|
+
* @property {Object} customStyle 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
|
|
31
33
|
*/
|
|
32
34
|
export default {
|
|
33
35
|
name: 'FuTransition',
|
|
34
36
|
emits: ['click', 'change'],
|
|
35
|
-
mixins: [mpMixin],
|
|
36
|
-
props: {
|
|
37
|
-
// 是否展示组件
|
|
38
|
-
show: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: false
|
|
41
|
-
},
|
|
42
|
-
// 使用的动画模式
|
|
43
|
-
mode: {
|
|
44
|
-
type: [Array, String],
|
|
45
|
-
default() {
|
|
46
|
-
return 'fade'
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
// 动画的执行时间,单位ms
|
|
50
|
-
duration: {
|
|
51
|
-
type: Number,
|
|
52
|
-
default: 300
|
|
53
|
-
},
|
|
54
|
-
// 组件样式
|
|
55
|
-
styles: {
|
|
56
|
-
type: Object,
|
|
57
|
-
default() {
|
|
58
|
-
return {}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
// 自定义Class
|
|
62
|
-
customClass:{
|
|
63
|
-
type: String,
|
|
64
|
-
default: ''
|
|
65
|
-
}
|
|
66
|
-
},
|
|
37
|
+
mixins: [mixin, mpMixin, props],
|
|
67
38
|
data() {
|
|
68
39
|
return {
|
|
69
40
|
isShow: false,
|
|
@@ -91,11 +62,11 @@
|
|
|
91
62
|
},
|
|
92
63
|
computed: {
|
|
93
64
|
// 初始化动画条件及样式数据
|
|
94
|
-
|
|
65
|
+
transformStyle() {
|
|
95
66
|
const style = {
|
|
96
67
|
transform: this.transform,
|
|
97
68
|
opacity: this.opacity,
|
|
98
|
-
...this.$fu.addStyle(this.
|
|
69
|
+
...this.$fu.addStyle(this.customStyle),
|
|
99
70
|
'transition-duration': this.duration / 1000 + 's'
|
|
100
71
|
}
|
|
101
72
|
return this.$fu.addStyle(style, 'string');
|
|
@@ -121,14 +92,16 @@
|
|
|
121
92
|
}
|
|
122
93
|
this.animation = createAnimation(Object.assign(this.config, obj), this)
|
|
123
94
|
},
|
|
95
|
+
|
|
124
96
|
/**
|
|
125
97
|
* 点击组件触发回调
|
|
126
98
|
*/
|
|
127
|
-
|
|
99
|
+
handleClick() {
|
|
128
100
|
this.$emit('click', {
|
|
129
101
|
detail: this.isShow
|
|
130
102
|
})
|
|
131
103
|
},
|
|
104
|
+
|
|
132
105
|
/**
|
|
133
106
|
* ref 触发 动画分组
|
|
134
107
|
* @param {Object} obj
|
|
@@ -146,9 +119,12 @@
|
|
|
146
119
|
console.error(`方法 ${i} 不存在`)
|
|
147
120
|
}
|
|
148
121
|
}
|
|
122
|
+
|
|
149
123
|
this.animation.step(config)
|
|
124
|
+
|
|
150
125
|
return this
|
|
151
126
|
},
|
|
127
|
+
|
|
152
128
|
/**
|
|
153
129
|
* ref 触发 执行动画
|
|
154
130
|
*/
|
|
@@ -156,7 +132,10 @@
|
|
|
156
132
|
if (!this.animation) return
|
|
157
133
|
this.animation.run(fn)
|
|
158
134
|
},
|
|
159
|
-
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 开始过度动画
|
|
138
|
+
*/
|
|
160
139
|
open() {
|
|
161
140
|
clearTimeout(this.timer)
|
|
162
141
|
this.transform = '';
|
|
@@ -188,7 +167,10 @@
|
|
|
188
167
|
}, 20)
|
|
189
168
|
})
|
|
190
169
|
},
|
|
191
|
-
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* 关闭过度动画
|
|
173
|
+
*/
|
|
192
174
|
close(type) {
|
|
193
175
|
if (!this.animation) return
|
|
194
176
|
this.tranfromInit(true).step().run(() => {
|
|
@@ -203,16 +185,19 @@
|
|
|
203
185
|
})
|
|
204
186
|
})
|
|
205
187
|
},
|
|
206
|
-
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* 处理动画开始前的默认样式
|
|
191
|
+
*/
|
|
207
192
|
styleInit(type) {
|
|
208
|
-
let
|
|
193
|
+
let style = {
|
|
209
194
|
transform: ''
|
|
210
195
|
};
|
|
211
196
|
let buildStyle = (type, mode) => {
|
|
212
197
|
if (mode === 'fade') {
|
|
213
|
-
|
|
198
|
+
style.opacity = this.animationType(type)[mode];
|
|
214
199
|
} else {
|
|
215
|
-
|
|
200
|
+
style.transform += this.animationType(type)[mode] + ' ';
|
|
216
201
|
}
|
|
217
202
|
}
|
|
218
203
|
if (typeof this.mode === 'string') {
|
|
@@ -222,9 +207,12 @@
|
|
|
222
207
|
buildStyle(type, mode)
|
|
223
208
|
})
|
|
224
209
|
}
|
|
225
|
-
return
|
|
210
|
+
return style
|
|
226
211
|
},
|
|
227
|
-
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 处理内置组合动画
|
|
215
|
+
*/
|
|
228
216
|
tranfromInit(type) {
|
|
229
217
|
let buildTranfrom = (type, mode) => {
|
|
230
218
|
let aniNum = null;
|
|
@@ -247,6 +235,7 @@
|
|
|
247
235
|
}
|
|
248
236
|
this.animation[this.animationMode()[mode]](aniNum)
|
|
249
237
|
}
|
|
238
|
+
|
|
250
239
|
if (typeof this.mode === 'string') {
|
|
251
240
|
buildTranfrom(type, this.mode)
|
|
252
241
|
} else {
|
|
@@ -257,6 +246,10 @@
|
|
|
257
246
|
|
|
258
247
|
return this.animation
|
|
259
248
|
},
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* 处理动画类型
|
|
252
|
+
*/
|
|
260
253
|
animationType(type) {
|
|
261
254
|
return {
|
|
262
255
|
fade: type ? 1 : 0,
|
|
@@ -268,7 +261,10 @@
|
|
|
268
261
|
'zoom-out': `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
|
|
269
262
|
}
|
|
270
263
|
},
|
|
271
|
-
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* 内置动画类型与实际动画对应字典
|
|
267
|
+
*/
|
|
272
268
|
animationMode() {
|
|
273
269
|
return {
|
|
274
270
|
fade: 'opacity',
|
|
@@ -280,7 +276,10 @@
|
|
|
280
276
|
'zoom-out': 'scale'
|
|
281
277
|
}
|
|
282
278
|
},
|
|
283
|
-
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* 驼峰转中横线
|
|
282
|
+
*/
|
|
284
283
|
toLine(name) {
|
|
285
284
|
return name.replace(/([A-Z])/g, '-$1').toLowerCase()
|
|
286
285
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
// 是否展示组件
|
|
4
|
+
show: {
|
|
5
|
+
type: Boolean,
|
|
6
|
+
default: false
|
|
7
|
+
},
|
|
8
|
+
// 使用的动画模式
|
|
9
|
+
mode: {
|
|
10
|
+
type: [Array, String],
|
|
11
|
+
default() {
|
|
12
|
+
return 'fade'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
// 动画的执行时间,单位ms
|
|
16
|
+
duration: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 300
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -92,11 +92,13 @@
|
|
|
92
92
|
* @property {Boolean} showFileList = [true|false] 是否显示已上传的文件列表(默认 true)
|
|
93
93
|
* @value true 显示列表
|
|
94
94
|
* @value false 隐藏列表
|
|
95
|
+
*
|
|
95
96
|
* @event {Function} select 选择文件后触发
|
|
96
97
|
* @event {Function} progress 文件上传时触发
|
|
97
98
|
* @event {Function} success 上传成功触发
|
|
98
99
|
* @event {Function} fail 上传失败触发
|
|
99
100
|
* @event {Function} delete 文件从列表移除时触发
|
|
101
|
+
* @example <fu-upload></fu-upload>
|
|
100
102
|
*/
|
|
101
103
|
export default {
|
|
102
104
|
name:"FuUpload",
|
|
@@ -530,7 +532,7 @@
|
|
|
530
532
|
</script>
|
|
531
533
|
|
|
532
534
|
<style lang="scss" scoped>
|
|
533
|
-
@import '../../libs/
|
|
535
|
+
@import '../../libs/style/components.scss';
|
|
534
536
|
|
|
535
537
|
.fu-upload {
|
|
536
538
|
/* #ifndef APP-NVUE */
|