@vtj/materials 0.13.15 → 0.13.17
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/dist/assets/antdv/index.umd.js +2 -2
- package/dist/assets/charts/index.umd.js +2 -2
- package/dist/assets/element/index.umd.js +3 -3
- package/dist/assets/icons/index.umd.js +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/assets/uni-h5/index.umd.js +2 -2
- package/dist/assets/uni-ui/index.umd.js +2 -2
- package/dist/assets/vant/index.umd.js +2 -2
- package/dist/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/deps/@vtj/ui/index.umd.js +4 -4
- package/dist/deps/@vtj/ui/style.css +1 -1
- package/dist/deps/@vtj/utils/index.umd.js +28 -33
- package/dist/deps/@vueuse/core/index.iife.min.js +1 -1
- package/dist/deps/element-plus/index.css +1 -1
- package/dist/deps/element-plus/index.full.min.js +14 -14
- package/dist/deps/element-plus/zh-cn.js +1 -1
- package/dist/deps/uni-app/index.umd.js +1 -1
- package/dist/deps/uni-h5/index.umd.js +8 -8
- package/dist/deps/uni-h5/style.css +1 -1
- package/dist/deps/uni-h5-vue/index.umd.js +1 -1
- package/dist/deps/uni-ui/index.umd.js +6 -1
- package/dist/deps/uni-ui/style.css +1 -1
- package/dist/deps/vue/vue.global.js +88 -53
- package/dist/deps/vue/vue.global.prod.js +9 -9
- package/package.json +12 -12
- package/src/antdv/image.ts +1 -1
- package/src/element/image.ts +1 -1
- package/src/element/virtualizedTable.ts +6 -6
- package/src/manifest.json +69 -0
- package/src/pages/index.vue +2 -0
- package/src/pages.json +19 -0
- package/src/uni-ui/index.ts +88 -58
- package/src/{uni-ui/lib/uni.scss → uni.scss} +4 -0
- package/src/version.ts +2 -2
- package/src/uni-ui/lib/uni-col/uni-col.vue +0 -324
- package/src/uni-ui/lib/uni-collapse/uni-collapse.vue +0 -153
- package/src/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +0 -425
- package/src/uni-ui/lib/uni-data-picker/keypress.js +0 -45
- package/src/uni-ui/lib/uni-data-picker/uni-data-picker.vue +0 -604
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +0 -622
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.css +0 -76
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +0 -335
- package/src/uni-ui/lib/uni-data-select/uni-data-select.vue +0 -590
- package/src/uni-ui/lib/uni-datetime-picker/calendar-item.vue +0 -188
- package/src/uni-ui/lib/uni-datetime-picker/calendar.vue +0 -985
- package/src/uni-ui/lib/uni-datetime-picker/i18n/en.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-datetime-picker/i18n/zh-Hans.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/i18n/zh-Hant.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/time-picker.vue +0 -1032
- package/src/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +0 -1230
- package/src/uni-ui/lib/uni-datetime-picker/util.js +0 -448
- package/src/uni-ui/lib/uni-easyinput/common.js +0 -54
- package/src/uni-ui/lib/uni-easyinput/uni-easyinput.vue +0 -790
- package/src/uni-ui/lib/uni-fav/i18n/en.json +0 -4
- package/src/uni-ui/lib/uni-fav/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hans.json +0 -4
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hant.json +0 -4
- package/src/uni-ui/lib/uni-fav/uni-fav.vue +0 -170
- package/src/uni-ui/lib/uni-file-picker/choose-and-upload-file.js +0 -280
- package/src/uni-ui/lib/uni-file-picker/uni-file-picker.vue +0 -668
- package/src/uni-ui/lib/uni-file-picker/upload-file.vue +0 -325
- package/src/uni-ui/lib/uni-file-picker/upload-image.vue +0 -292
- package/src/uni-ui/lib/uni-file-picker/utils.js +0 -110
- package/src/uni-ui/lib/uni-forms/uni-forms.vue +0 -416
- package/src/uni-ui/lib/uni-forms/utils.js +0 -293
- package/src/uni-ui/lib/uni-forms/validate.js +0 -486
- package/src/uni-ui/lib/uni-forms-item/uni-forms-item.vue +0 -630
- package/src/uni-ui/lib/uni-goods-nav/i18n/en.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hans.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hant.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +0 -231
- package/src/uni-ui/lib/uni-grid/uni-grid.vue +0 -148
- package/src/uni-ui/lib/uni-icons/uni-icons.uvue +0 -91
- package/src/uni-ui/lib/uni-icons/uni-icons.vue +0 -114
- package/src/uni-ui/lib/uni-icons/uniicons.css +0 -664
- package/src/uni-ui/lib/uni-icons/uniicons.ttf +0 -0
- package/src/uni-ui/lib/uni-icons/uniicons_file.ts +0 -664
- package/src/uni-ui/lib/uni-icons/uniicons_file_vue.js +0 -649
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +0 -168
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +0 -404
- package/src/uni-ui/lib/uni-list/uni-list.vue +0 -123
- package/src/uni-ui/lib/uni-list/uni-refresh.vue +0 -65
- package/src/uni-ui/lib/uni-list/uni-refresh.wxs +0 -87
- package/src/uni-ui/lib/uni-load-more/i18n/en.json +0 -5
- package/src/uni-ui/lib/uni-load-more/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hans.json +0 -5
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hant.json +0 -5
- package/src/uni-ui/lib/uni-load-more/uni-load-more.vue +0 -456
- package/src/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +0 -484
- package/src/uni-ui/lib/uni-popup/i18n/en.json +0 -7
- package/src/uni-ui/lib/uni-popup/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-popup/i18n/zh-Hans.json +0 -7
- package/src/uni-ui/lib/uni-popup/i18n/zh-Hant.json +0 -7
- package/src/uni-ui/lib/uni-popup/keypress.js +0 -45
- package/src/uni-ui/lib/uni-popup/popup.js +0 -26
- package/src/uni-ui/lib/uni-popup/uni-popup.uvue +0 -90
- package/src/uni-ui/lib/uni-popup/uni-popup.vue +0 -552
- package/src/uni-ui/lib/uni-popup-dialog/keypress.js +0 -45
- package/src/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +0 -324
- package/src/uni-ui/lib/uni-popup-message/uni-popup-message.vue +0 -149
- package/src/uni-ui/lib/uni-rate/uni-rate.vue +0 -380
- package/src/uni-ui/lib/uni-row/uni-row.vue +0 -193
- package/src/uni-ui/lib/uni-search-bar/i18n/en.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hans.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hant.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/uni-search-bar.vue +0 -339
- package/src/uni-ui/lib/uni-swipe-action-item/bindingx.js +0 -311
- package/src/uni-ui/lib/uni-swipe-action-item/isPC.js +0 -12
- package/src/uni-ui/lib/uni-swipe-action-item/mpalipay.js +0 -195
- package/src/uni-ui/lib/uni-swipe-action-item/mpother.js +0 -260
- package/src/uni-ui/lib/uni-swipe-action-item/mpwxs.js +0 -84
- package/src/uni-ui/lib/uni-swipe-action-item/render.js +0 -270
- package/src/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +0 -493
- package/src/uni-ui/lib/uni-swipe-action-item/wx.wxs +0 -341
- package/src/uni-ui/lib/uni-table/uni-table.vue +0 -496
- package/src/uni-ui/lib/uni-td/uni-td.vue +0 -99
- package/src/uni-ui/lib/uni-th/filter-dropdown.vue +0 -559
- package/src/uni-ui/lib/uni-th/uni-th.vue +0 -322
- package/src/uni-ui/lib/uni-tr/table-checkbox.vue +0 -181
- package/src/uni-ui/lib/uni-tr/uni-tr.vue +0 -208
- package/src/uni-ui/lib/uni-transition/createAnimation.js +0 -131
- package/src/uni-ui/lib/uni-transition/uni-transition.vue +0 -310
- package/src/uni-ui/polyfill.ts +0 -41
@@ -1,131 +0,0 @@
|
|
1
|
-
// const defaultOption = {
|
2
|
-
// duration: 300,
|
3
|
-
// timingFunction: 'linear',
|
4
|
-
// delay: 0,
|
5
|
-
// transformOrigin: '50% 50% 0'
|
6
|
-
// }
|
7
|
-
// #ifdef APP-NVUE
|
8
|
-
const nvueAnimation = uni.requireNativePlugin('animation')
|
9
|
-
// #endif
|
10
|
-
class MPAnimation {
|
11
|
-
constructor(options, _this) {
|
12
|
-
this.options = options
|
13
|
-
// 在iOS10+QQ小程序平台下,传给原生的对象一定是个普通对象而不是Proxy对象,否则会报parameter should be Object instead of ProxyObject的错误
|
14
|
-
this.animation = uni.createAnimation({
|
15
|
-
...options
|
16
|
-
})
|
17
|
-
this.currentStepAnimates = {}
|
18
|
-
this.next = 0
|
19
|
-
this.$ = _this
|
20
|
-
|
21
|
-
}
|
22
|
-
|
23
|
-
_nvuePushAnimates(type, args) {
|
24
|
-
let aniObj = this.currentStepAnimates[this.next]
|
25
|
-
let styles = {}
|
26
|
-
if (!aniObj) {
|
27
|
-
styles = {
|
28
|
-
styles: {},
|
29
|
-
config: {}
|
30
|
-
}
|
31
|
-
} else {
|
32
|
-
styles = aniObj
|
33
|
-
}
|
34
|
-
if (animateTypes1.includes(type)) {
|
35
|
-
if (!styles.styles.transform) {
|
36
|
-
styles.styles.transform = ''
|
37
|
-
}
|
38
|
-
let unit = ''
|
39
|
-
if(type === 'rotate'){
|
40
|
-
unit = 'deg'
|
41
|
-
}
|
42
|
-
styles.styles.transform += `${type}(${args+unit}) `
|
43
|
-
} else {
|
44
|
-
styles.styles[type] = `${args}`
|
45
|
-
}
|
46
|
-
this.currentStepAnimates[this.next] = styles
|
47
|
-
}
|
48
|
-
_animateRun(styles = {}, config = {}) {
|
49
|
-
let ref = this.$.$refs['ani'].ref
|
50
|
-
if (!ref) return
|
51
|
-
return new Promise((resolve, reject) => {
|
52
|
-
nvueAnimation.transition(ref, {
|
53
|
-
styles,
|
54
|
-
...config
|
55
|
-
}, res => {
|
56
|
-
resolve()
|
57
|
-
})
|
58
|
-
})
|
59
|
-
}
|
60
|
-
|
61
|
-
_nvueNextAnimate(animates, step = 0, fn) {
|
62
|
-
let obj = animates[step]
|
63
|
-
if (obj) {
|
64
|
-
let {
|
65
|
-
styles,
|
66
|
-
config
|
67
|
-
} = obj
|
68
|
-
this._animateRun(styles, config).then(() => {
|
69
|
-
step += 1
|
70
|
-
this._nvueNextAnimate(animates, step, fn)
|
71
|
-
})
|
72
|
-
} else {
|
73
|
-
this.currentStepAnimates = {}
|
74
|
-
typeof fn === 'function' && fn()
|
75
|
-
this.isEnd = true
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
step(config = {}) {
|
80
|
-
// #ifndef APP-NVUE
|
81
|
-
this.animation.step(config)
|
82
|
-
// #endif
|
83
|
-
// #ifdef APP-NVUE
|
84
|
-
this.currentStepAnimates[this.next].config = Object.assign({}, this.options, config)
|
85
|
-
this.currentStepAnimates[this.next].styles.transformOrigin = this.currentStepAnimates[this.next].config.transformOrigin
|
86
|
-
this.next++
|
87
|
-
// #endif
|
88
|
-
return this
|
89
|
-
}
|
90
|
-
|
91
|
-
run(fn) {
|
92
|
-
// #ifndef APP-NVUE
|
93
|
-
this.$.animationData = this.animation.export()
|
94
|
-
this.$.timer = setTimeout(() => {
|
95
|
-
typeof fn === 'function' && fn()
|
96
|
-
}, this.$.durationTime)
|
97
|
-
// #endif
|
98
|
-
// #ifdef APP-NVUE
|
99
|
-
this.isEnd = false
|
100
|
-
let ref = this.$.$refs['ani'] && this.$.$refs['ani'].ref
|
101
|
-
if(!ref) return
|
102
|
-
this._nvueNextAnimate(this.currentStepAnimates, 0, fn)
|
103
|
-
this.next = 0
|
104
|
-
// #endif
|
105
|
-
}
|
106
|
-
}
|
107
|
-
|
108
|
-
|
109
|
-
const animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d',
|
110
|
-
'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY',
|
111
|
-
'translateZ'
|
112
|
-
]
|
113
|
-
const animateTypes2 = ['opacity', 'backgroundColor']
|
114
|
-
const animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom']
|
115
|
-
animateTypes1.concat(animateTypes2, animateTypes3).forEach(type => {
|
116
|
-
MPAnimation.prototype[type] = function(...args) {
|
117
|
-
// #ifndef APP-NVUE
|
118
|
-
this.animation[type](...args)
|
119
|
-
// #endif
|
120
|
-
// #ifdef APP-NVUE
|
121
|
-
this._nvuePushAnimates(type, args)
|
122
|
-
// #endif
|
123
|
-
return this
|
124
|
-
}
|
125
|
-
})
|
126
|
-
|
127
|
-
export function createAnimation(option, _this) {
|
128
|
-
if(!_this) return
|
129
|
-
clearTimeout(_this.timer)
|
130
|
-
return new MPAnimation(option, _this)
|
131
|
-
}
|
@@ -1,310 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<!-- #ifndef APP-NVUE -->
|
3
|
-
<view
|
4
|
-
v-show="isShow"
|
5
|
-
ref="ani"
|
6
|
-
:animation="animationData"
|
7
|
-
:class="customClass"
|
8
|
-
:style="transformStyles"
|
9
|
-
@click="onClick"
|
10
|
-
><slot></slot
|
11
|
-
></view>
|
12
|
-
<!-- #endif -->
|
13
|
-
<!-- #ifdef APP-NVUE -->
|
14
|
-
<!-- <view
|
15
|
-
v-if="isShow"
|
16
|
-
ref="ani"
|
17
|
-
:animation="animationData"
|
18
|
-
:class="customClass"
|
19
|
-
:style="transformStyles"
|
20
|
-
@click="onClick"
|
21
|
-
><slot></slot
|
22
|
-
></view> -->
|
23
|
-
<!-- #endif -->
|
24
|
-
</template>
|
25
|
-
|
26
|
-
<script>
|
27
|
-
import { createAnimation } from './createAnimation';
|
28
|
-
|
29
|
-
/**
|
30
|
-
* Transition 过渡动画
|
31
|
-
* @description 简单过渡动画组件
|
32
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=985
|
33
|
-
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
|
34
|
-
* @property {Array|String} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
|
35
|
-
* @value fade 渐隐渐出过渡
|
36
|
-
* @value slide-top 由上至下过渡
|
37
|
-
* @value slide-right 由右至左过渡
|
38
|
-
* @value slide-bottom 由下至上过渡
|
39
|
-
* @value slide-left 由左至右过渡
|
40
|
-
* @value zoom-in 由小到大过渡
|
41
|
-
* @value zoom-out 由大到小过渡
|
42
|
-
* @property {Number} duration 过渡动画持续时间
|
43
|
-
* @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
|
44
|
-
*/
|
45
|
-
export default {
|
46
|
-
name: 'uniTransition',
|
47
|
-
emits: ['click', 'change'],
|
48
|
-
props: {
|
49
|
-
show: {
|
50
|
-
type: Boolean,
|
51
|
-
default: false
|
52
|
-
},
|
53
|
-
modeClass: {
|
54
|
-
type: [Array, String],
|
55
|
-
default() {
|
56
|
-
return 'fade';
|
57
|
-
}
|
58
|
-
},
|
59
|
-
duration: {
|
60
|
-
type: Number,
|
61
|
-
default: 300
|
62
|
-
},
|
63
|
-
styles: {
|
64
|
-
type: Object,
|
65
|
-
default() {
|
66
|
-
return {};
|
67
|
-
}
|
68
|
-
},
|
69
|
-
customClass: {
|
70
|
-
type: String,
|
71
|
-
default: ''
|
72
|
-
},
|
73
|
-
onceRender: {
|
74
|
-
type: Boolean,
|
75
|
-
default: false
|
76
|
-
}
|
77
|
-
},
|
78
|
-
data() {
|
79
|
-
return {
|
80
|
-
isShow: false,
|
81
|
-
transform: '',
|
82
|
-
opacity: 1,
|
83
|
-
animationData: {},
|
84
|
-
durationTime: 300,
|
85
|
-
config: {}
|
86
|
-
};
|
87
|
-
},
|
88
|
-
watch: {
|
89
|
-
show: {
|
90
|
-
handler(newVal) {
|
91
|
-
if (newVal) {
|
92
|
-
this.open();
|
93
|
-
} else {
|
94
|
-
// 避免上来就执行 close,导致动画错乱
|
95
|
-
if (this.isShow) {
|
96
|
-
this.close();
|
97
|
-
}
|
98
|
-
}
|
99
|
-
},
|
100
|
-
immediate: true
|
101
|
-
}
|
102
|
-
},
|
103
|
-
computed: {
|
104
|
-
// 生成样式数据
|
105
|
-
stylesObject() {
|
106
|
-
let styles = {
|
107
|
-
...this.styles,
|
108
|
-
'transition-duration': this.duration / 1000 + 's'
|
109
|
-
};
|
110
|
-
let transform = '';
|
111
|
-
for (let i in styles) {
|
112
|
-
let line = this.toLine(i);
|
113
|
-
transform += line + ':' + styles[i] + ';';
|
114
|
-
}
|
115
|
-
return transform;
|
116
|
-
},
|
117
|
-
// 初始化动画条件
|
118
|
-
transformStyles() {
|
119
|
-
return (
|
120
|
-
'transform:' +
|
121
|
-
this.transform +
|
122
|
-
';' +
|
123
|
-
'opacity:' +
|
124
|
-
this.opacity +
|
125
|
-
';' +
|
126
|
-
this.stylesObject
|
127
|
-
);
|
128
|
-
}
|
129
|
-
},
|
130
|
-
created() {
|
131
|
-
// 动画默认配置
|
132
|
-
this.config = {
|
133
|
-
duration: this.duration,
|
134
|
-
timingFunction: 'ease',
|
135
|
-
transformOrigin: '50% 50%',
|
136
|
-
delay: 0
|
137
|
-
};
|
138
|
-
this.durationTime = this.duration;
|
139
|
-
},
|
140
|
-
methods: {
|
141
|
-
/**
|
142
|
-
* ref 触发 初始化动画
|
143
|
-
*/
|
144
|
-
init(obj = {}) {
|
145
|
-
if (obj.duration) {
|
146
|
-
this.durationTime = obj.duration;
|
147
|
-
}
|
148
|
-
this.animation = createAnimation(Object.assign(this.config, obj), this);
|
149
|
-
},
|
150
|
-
/**
|
151
|
-
* 点击组件触发回调
|
152
|
-
*/
|
153
|
-
onClick() {
|
154
|
-
this.$emit('click', {
|
155
|
-
detail: this.isShow
|
156
|
-
});
|
157
|
-
},
|
158
|
-
/**
|
159
|
-
* ref 触发 动画分组
|
160
|
-
* @param {Object} obj
|
161
|
-
*/
|
162
|
-
step(obj, config = {}) {
|
163
|
-
if (!this.animation) return;
|
164
|
-
for (let i in obj) {
|
165
|
-
try {
|
166
|
-
if (typeof obj[i] === 'object') {
|
167
|
-
this.animation[i](...obj[i]);
|
168
|
-
} else {
|
169
|
-
this.animation[i](obj[i]);
|
170
|
-
}
|
171
|
-
} catch (e) {
|
172
|
-
console.error(`方法 ${i} 不存在`);
|
173
|
-
}
|
174
|
-
}
|
175
|
-
this.animation.step(config);
|
176
|
-
return this;
|
177
|
-
},
|
178
|
-
/**
|
179
|
-
* ref 触发 执行动画
|
180
|
-
*/
|
181
|
-
run(fn) {
|
182
|
-
if (!this.animation) return;
|
183
|
-
this.animation.run(fn);
|
184
|
-
},
|
185
|
-
// 开始过度动画
|
186
|
-
open() {
|
187
|
-
clearTimeout(this.timer);
|
188
|
-
this.transform = '';
|
189
|
-
this.isShow = true;
|
190
|
-
let { opacity, transform } = this.styleInit(false);
|
191
|
-
if (typeof opacity !== 'undefined') {
|
192
|
-
this.opacity = opacity;
|
193
|
-
}
|
194
|
-
this.transform = transform;
|
195
|
-
// 确保动态样式已经生效后,执行动画,如果不加 nextTick ,会导致 wx 动画执行异常
|
196
|
-
this.$nextTick(() => {
|
197
|
-
// TODO 定时器保证动画完全执行,目前有些问题,后面会取消定时器
|
198
|
-
this.timer = setTimeout(() => {
|
199
|
-
this.animation = createAnimation(this.config, this);
|
200
|
-
this.tranfromInit(false).step();
|
201
|
-
this.animation.run();
|
202
|
-
this.$emit('change', {
|
203
|
-
detail: this.isShow
|
204
|
-
});
|
205
|
-
}, 20);
|
206
|
-
});
|
207
|
-
},
|
208
|
-
// 关闭过度动画
|
209
|
-
close(type) {
|
210
|
-
if (!this.animation) return;
|
211
|
-
this.tranfromInit(true)
|
212
|
-
.step()
|
213
|
-
.run(() => {
|
214
|
-
this.isShow = false;
|
215
|
-
this.animationData = null;
|
216
|
-
this.animation = null;
|
217
|
-
let { opacity, transform } = this.styleInit(false);
|
218
|
-
this.opacity = opacity || 1;
|
219
|
-
this.transform = transform;
|
220
|
-
this.$emit('change', {
|
221
|
-
detail: this.isShow
|
222
|
-
});
|
223
|
-
});
|
224
|
-
},
|
225
|
-
// 处理动画开始前的默认样式
|
226
|
-
styleInit(type) {
|
227
|
-
let styles = {
|
228
|
-
transform: ''
|
229
|
-
};
|
230
|
-
let buildStyle = (type, mode) => {
|
231
|
-
if (mode === 'fade') {
|
232
|
-
styles.opacity = this.animationType(type)[mode];
|
233
|
-
} else {
|
234
|
-
styles.transform += this.animationType(type)[mode] + ' ';
|
235
|
-
}
|
236
|
-
};
|
237
|
-
if (typeof this.modeClass === 'string') {
|
238
|
-
buildStyle(type, this.modeClass);
|
239
|
-
} else {
|
240
|
-
this.modeClass.forEach((mode) => {
|
241
|
-
buildStyle(type, mode);
|
242
|
-
});
|
243
|
-
}
|
244
|
-
return styles;
|
245
|
-
},
|
246
|
-
// 处理内置组合动画
|
247
|
-
tranfromInit(type) {
|
248
|
-
let buildTranfrom = (type, mode) => {
|
249
|
-
let aniNum = null;
|
250
|
-
if (mode === 'fade') {
|
251
|
-
aniNum = type ? 0 : 1;
|
252
|
-
} else {
|
253
|
-
aniNum = type ? '-100%' : '0';
|
254
|
-
if (mode === 'zoom-in') {
|
255
|
-
aniNum = type ? 0.8 : 1;
|
256
|
-
}
|
257
|
-
if (mode === 'zoom-out') {
|
258
|
-
aniNum = type ? 1.2 : 1;
|
259
|
-
}
|
260
|
-
if (mode === 'slide-right') {
|
261
|
-
aniNum = type ? '100%' : '0';
|
262
|
-
}
|
263
|
-
if (mode === 'slide-bottom') {
|
264
|
-
aniNum = type ? '100%' : '0';
|
265
|
-
}
|
266
|
-
}
|
267
|
-
this.animation[this.animationMode()[mode]](aniNum);
|
268
|
-
};
|
269
|
-
if (typeof this.modeClass === 'string') {
|
270
|
-
buildTranfrom(type, this.modeClass);
|
271
|
-
} else {
|
272
|
-
this.modeClass.forEach((mode) => {
|
273
|
-
buildTranfrom(type, mode);
|
274
|
-
});
|
275
|
-
}
|
276
|
-
|
277
|
-
return this.animation;
|
278
|
-
},
|
279
|
-
animationType(type) {
|
280
|
-
return {
|
281
|
-
fade: type ? 0 : 1,
|
282
|
-
'slide-top': `translateY(${type ? '0' : '-100%'})`,
|
283
|
-
'slide-right': `translateX(${type ? '0' : '100%'})`,
|
284
|
-
'slide-bottom': `translateY(${type ? '0' : '100%'})`,
|
285
|
-
'slide-left': `translateX(${type ? '0' : '-100%'})`,
|
286
|
-
'zoom-in': `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
|
287
|
-
'zoom-out': `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
|
288
|
-
};
|
289
|
-
},
|
290
|
-
// 内置动画类型与实际动画对应字典
|
291
|
-
animationMode() {
|
292
|
-
return {
|
293
|
-
fade: 'opacity',
|
294
|
-
'slide-top': 'translateY',
|
295
|
-
'slide-right': 'translateX',
|
296
|
-
'slide-bottom': 'translateY',
|
297
|
-
'slide-left': 'translateX',
|
298
|
-
'zoom-in': 'scale',
|
299
|
-
'zoom-out': 'scale'
|
300
|
-
};
|
301
|
-
},
|
302
|
-
// 驼峰转中横线
|
303
|
-
toLine(name) {
|
304
|
-
return name.replace(/([A-Z])/g, '-$1').toLowerCase();
|
305
|
-
}
|
306
|
-
}
|
307
|
-
};
|
308
|
-
</script>
|
309
|
-
|
310
|
-
<style></style>
|
package/src/uni-ui/polyfill.ts
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
const _weex = (window as any).weex;
|
2
|
-
const _uniCloud = (window as any).uniCloud;
|
3
|
-
const _uni = (window as any).uni;
|
4
|
-
const _Vue = (window as any).Vue;
|
5
|
-
if (!_weex) {
|
6
|
-
(window as any).weex = {
|
7
|
-
requireModule: () => {
|
8
|
-
return {
|
9
|
-
addRule: () => {}
|
10
|
-
};
|
11
|
-
}
|
12
|
-
};
|
13
|
-
}
|
14
|
-
|
15
|
-
if (!_uniCloud) {
|
16
|
-
(window as any).uniCloud = {};
|
17
|
-
}
|
18
|
-
|
19
|
-
if (!_uni) {
|
20
|
-
(window as any).uni = {
|
21
|
-
getSystemInfoSync() {
|
22
|
-
return {
|
23
|
-
platform: 'h5'
|
24
|
-
};
|
25
|
-
},
|
26
|
-
getDeviceInfo() {
|
27
|
-
return {
|
28
|
-
platform: 'h5'
|
29
|
-
};
|
30
|
-
},
|
31
|
-
requireNativePlugin() {}
|
32
|
-
};
|
33
|
-
}
|
34
|
-
|
35
|
-
if (!_Vue) {
|
36
|
-
(window as any).Vue = {
|
37
|
-
prototype: {}
|
38
|
-
};
|
39
|
-
} else {
|
40
|
-
// _Vue.prototype = _Vue.prototype || {};
|
41
|
-
}
|