@kengic/uni 0.3.2-beta.10
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 +1 -0
- package/dist/index.css +1 -0
- package/dist/kengic-uni.js +5 -0
- package/dist/src/consts/i18n/en.d.ts +45 -0
- package/dist/src/consts/i18n/index.d.ts +90 -0
- package/dist/src/consts/i18n/zh_CN.d.ts +45 -0
- package/dist/src/consts/index.d.ts +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/kg.util.d.ts +5 -0
- package/dist/uni-ui/index.ts +11 -0
- package/dist/uni-ui/uni-badge/uni-badge.vue +253 -0
- package/dist/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +41 -0
- package/dist/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +121 -0
- package/dist/uni-ui/uni-calendar/calendar.js +546 -0
- package/dist/uni-ui/uni-calendar/i18n/en.json +12 -0
- package/dist/uni-ui/uni-calendar/i18n/index.js +8 -0
- package/dist/uni-ui/uni-calendar/i18n/zh-Hans.json +12 -0
- package/dist/uni-ui/uni-calendar/i18n/zh-Hant.json +12 -0
- package/dist/uni-ui/uni-calendar/uni-calendar-item.vue +187 -0
- package/dist/uni-ui/uni-calendar/uni-calendar.vue +566 -0
- package/dist/uni-ui/uni-calendar/util.js +360 -0
- package/dist/uni-ui/uni-card/uni-card.vue +281 -0
- package/dist/uni-ui/uni-col/uni-col.vue +317 -0
- package/dist/uni-ui/uni-collapse/uni-collapse.vue +147 -0
- package/dist/uni-ui/uni-collapse-item/uni-collapse-item.vue +402 -0
- package/dist/uni-ui/uni-combox/uni-combox.vue +294 -0
- package/dist/uni-ui/uni-countdown/i18n/en.json +6 -0
- package/dist/uni-ui/uni-countdown/i18n/index.js +8 -0
- package/dist/uni-ui/uni-countdown/i18n/zh-Hans.json +6 -0
- package/dist/uni-ui/uni-countdown/i18n/zh-Hant.json +6 -0
- package/dist/uni-ui/uni-countdown/uni-countdown.vue +267 -0
- package/dist/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +821 -0
- package/dist/uni-ui/uni-data-picker/keypress.js +45 -0
- package/dist/uni-ui/uni-data-picker/uni-data-picker.vue +551 -0
- package/dist/uni-ui/uni-data-pickerview/uni-data-picker.js +622 -0
- package/dist/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +323 -0
- package/dist/uni-ui/uni-data-select/uni-data-select.vue +517 -0
- package/dist/uni-ui/uni-dateformat/date-format.js +200 -0
- package/dist/uni-ui/uni-dateformat/uni-dateformat.vue +88 -0
- package/dist/uni-ui/uni-datetime-picker/calendar-item.vue +177 -0
- package/dist/uni-ui/uni-datetime-picker/calendar.vue +928 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/en.json +22 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/index.js +8 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +22 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +22 -0
- package/dist/uni-ui/uni-datetime-picker/time-picker.vue +934 -0
- package/dist/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1026 -0
- package/dist/uni-ui/uni-datetime-picker/util.js +403 -0
- package/dist/uni-ui/uni-drawer/keypress.js +45 -0
- package/dist/uni-ui/uni-drawer/uni-drawer.vue +181 -0
- package/dist/uni-ui/uni-easyinput/common.js +56 -0
- package/dist/uni-ui/uni-easyinput/uni-easyinput.vue +660 -0
- package/dist/uni-ui/uni-fab/uni-fab.vue +491 -0
- package/dist/uni-ui/uni-fav/i18n/en.json +4 -0
- package/dist/uni-ui/uni-fav/i18n/index.js +8 -0
- package/dist/uni-ui/uni-fav/i18n/zh-Hans.json +4 -0
- package/dist/uni-ui/uni-fav/i18n/zh-Hant.json +4 -0
- package/dist/uni-ui/uni-fav/uni-fav.vue +161 -0
- package/dist/uni-ui/uni-file-picker/choose-and-upload-file.js +224 -0
- package/dist/uni-ui/uni-file-picker/uni-file-picker.vue +667 -0
- package/dist/uni-ui/uni-file-picker/upload-file.vue +325 -0
- package/dist/uni-ui/uni-file-picker/upload-image.vue +292 -0
- package/dist/uni-ui/uni-file-picker/utils.js +109 -0
- package/dist/uni-ui/uni-forms/uni-forms.vue +398 -0
- package/dist/uni-ui/uni-forms/utils.js +293 -0
- package/dist/uni-ui/uni-forms/validate.js +486 -0
- package/dist/uni-ui/uni-forms-item/uni-forms-item.vue +601 -0
- package/dist/uni-ui/uni-goods-nav/i18n/en.json +6 -0
- package/dist/uni-ui/uni-goods-nav/i18n/index.js +8 -0
- package/dist/uni-ui/uni-goods-nav/i18n/zh-Hans.json +6 -0
- package/dist/uni-ui/uni-goods-nav/i18n/zh-Hant.json +6 -0
- package/dist/uni-ui/uni-goods-nav/uni-goods-nav.vue +229 -0
- package/dist/uni-ui/uni-grid/uni-grid.vue +143 -0
- package/dist/uni-ui/uni-grid-item/uni-grid-item.vue +129 -0
- package/dist/uni-ui/uni-group/uni-group.vue +134 -0
- package/dist/uni-ui/uni-icons/icons.js +1169 -0
- package/dist/uni-ui/uni-icons/uni-icons.vue +96 -0
- package/dist/uni-ui/uni-icons/uniicons.css +663 -0
- package/dist/uni-ui/uni-icons/uniicons.ttf +0 -0
- package/dist/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +144 -0
- package/dist/uni-ui/uni-indexed-list/uni-indexed-list.vue +367 -0
- package/dist/uni-ui/uni-link/uni-link.vue +128 -0
- package/dist/uni-ui/uni-list/uni-list.vue +123 -0
- package/dist/uni-ui/uni-list/uni-refresh.vue +65 -0
- package/dist/uni-ui/uni-list/uni-refresh.wxs +87 -0
- package/dist/uni-ui/uni-list-ad/uni-list-ad.vue +107 -0
- package/dist/uni-ui/uni-list-chat/uni-list-chat.scss +58 -0
- package/dist/uni-ui/uni-list-chat/uni-list-chat.vue +593 -0
- package/dist/uni-ui/uni-list-item/uni-list-item.vue +534 -0
- package/dist/uni-ui/uni-load-more/i18n/en.json +5 -0
- package/dist/uni-ui/uni-load-more/i18n/index.js +8 -0
- package/dist/uni-ui/uni-load-more/i18n/zh-Hans.json +5 -0
- package/dist/uni-ui/uni-load-more/i18n/zh-Hant.json +5 -0
- package/dist/uni-ui/uni-load-more/uni-load-more.vue +399 -0
- package/dist/uni-ui/uni-nav-bar/uni-nav-bar.vue +357 -0
- package/dist/uni-ui/uni-nav-bar/uni-status-bar.vue +24 -0
- package/dist/uni-ui/uni-notice-bar/uni-notice-bar.vue +426 -0
- package/dist/uni-ui/uni-number-box/uni-number-box.vue +221 -0
- package/dist/uni-ui/uni-pagination/i18n/en.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/es.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/fr.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/index.js +12 -0
- package/dist/uni-ui/uni-pagination/i18n/zh-Hans.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/zh-Hant.json +5 -0
- package/dist/uni-ui/uni-pagination/uni-pagination.vue +465 -0
- package/dist/uni-ui/uni-popup/i18n/en.json +7 -0
- package/dist/uni-ui/uni-popup/i18n/index.js +9 -0
- package/dist/uni-ui/uni-popup/i18n/zh-Hans.json +7 -0
- package/dist/uni-ui/uni-popup/i18n/zh-Hant.json +7 -0
- package/dist/uni-ui/uni-popup/keypress.js +45 -0
- package/dist/uni-ui/uni-popup/popup.js +23 -0
- package/dist/uni-ui/uni-popup/uni-popup.vue +464 -0
- package/dist/uni-ui/uni-popup-dialog/keypress.js +45 -0
- package/dist/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +275 -0
- package/dist/uni-ui/uni-popup-message/uni-popup-message.vue +143 -0
- package/dist/uni-ui/uni-popup-share/uni-popup-share.vue +187 -0
- package/dist/uni-ui/uni-rate/uni-rate.vue +365 -0
- package/dist/uni-ui/uni-row/uni-row.vue +190 -0
- package/dist/uni-ui/uni-scss/changelog.md +8 -0
- package/dist/uni-ui/uni-scss/index.scss +1 -0
- package/dist/uni-ui/uni-scss/package.json +82 -0
- package/dist/uni-ui/uni-scss/readme.md +4 -0
- package/dist/uni-ui/uni-scss/styles/index.scss +7 -0
- package/dist/uni-ui/uni-scss/styles/setting/_border.scss +3 -0
- package/dist/uni-ui/uni-scss/styles/setting/_color.scss +66 -0
- package/dist/uni-ui/uni-scss/styles/setting/_radius.scss +55 -0
- package/dist/uni-ui/uni-scss/styles/setting/_space.scss +56 -0
- package/dist/uni-ui/uni-scss/styles/setting/_styles.scss +167 -0
- package/dist/uni-ui/uni-scss/styles/setting/_text.scss +24 -0
- package/dist/uni-ui/uni-scss/styles/setting/_variables.scss +146 -0
- package/dist/uni-ui/uni-scss/styles/tools/functions.scss +19 -0
- package/dist/uni-ui/uni-scss/theme.scss +31 -0
- package/dist/uni-ui/uni-scss/variables.scss +62 -0
- package/dist/uni-ui/uni-search-bar/i18n/en.json +4 -0
- package/dist/uni-ui/uni-search-bar/i18n/index.js +8 -0
- package/dist/uni-ui/uni-search-bar/i18n/zh-Hans.json +4 -0
- package/dist/uni-ui/uni-search-bar/i18n/zh-Hant.json +4 -0
- package/dist/uni-ui/uni-search-bar/uni-search-bar.vue +298 -0
- package/dist/uni-ui/uni-section/uni-section.vue +167 -0
- package/dist/uni-ui/uni-segmented-control/uni-segmented-control.vue +145 -0
- package/dist/uni-ui/uni-steps/uni-steps.vue +269 -0
- package/dist/uni-ui/uni-swipe-action/uni-swipe-action.vue +60 -0
- package/dist/uni-ui/uni-swipe-action-item/bindingx.js +302 -0
- package/dist/uni-ui/uni-swipe-action-item/isPC.js +12 -0
- package/dist/uni-ui/uni-swipe-action-item/mpalipay.js +195 -0
- package/dist/uni-ui/uni-swipe-action-item/mpother.js +260 -0
- package/dist/uni-ui/uni-swipe-action-item/mpwxs.js +84 -0
- package/dist/uni-ui/uni-swipe-action-item/render.js +270 -0
- package/dist/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +347 -0
- package/dist/uni-ui/uni-swipe-action-item/wx.wxs +341 -0
- package/dist/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +218 -0
- package/dist/uni-ui/uni-table/uni-table.vue +455 -0
- package/dist/uni-ui/uni-tag/uni-tag.vue +252 -0
- package/dist/uni-ui/uni-tbody/uni-tbody.vue +29 -0
- package/dist/uni-ui/uni-td/uni-td.vue +90 -0
- package/dist/uni-ui/uni-th/filter-dropdown.vue +511 -0
- package/dist/uni-ui/uni-th/uni-th.vue +285 -0
- package/dist/uni-ui/uni-thead/uni-thead.vue +129 -0
- package/dist/uni-ui/uni-title/uni-title.vue +171 -0
- package/dist/uni-ui/uni-tooltip/uni-tooltip.vue +68 -0
- package/dist/uni-ui/uni-tr/table-checkbox.vue +179 -0
- package/dist/uni-ui/uni-tr/uni-tr.vue +171 -0
- package/dist/uni-ui/uni-transition/createAnimation.js +131 -0
- package/dist/uni-ui/uni-transition/uni-transition.vue +281 -0
- package/package.json +90 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view v-if="isShow||onceRender" v-show="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import { createAnimation } from './createAnimation'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Transition 过渡动画
|
|
10
|
+
* @description 简单过渡动画组件
|
|
11
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=985
|
|
12
|
+
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
|
|
13
|
+
* @property {Array|String} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
|
|
14
|
+
* @value fade 渐隐渐出过渡
|
|
15
|
+
* @value slide-top 由上至下过渡
|
|
16
|
+
* @value slide-right 由右至左过渡
|
|
17
|
+
* @value slide-bottom 由下至上过渡
|
|
18
|
+
* @value slide-left 由左至右过渡
|
|
19
|
+
* @value zoom-in 由小到大过渡
|
|
20
|
+
* @value zoom-out 由大到小过渡
|
|
21
|
+
* @property {Number} duration 过渡动画持续时间
|
|
22
|
+
* @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
|
|
23
|
+
*/
|
|
24
|
+
export default {
|
|
25
|
+
name: 'UniTransition',
|
|
26
|
+
emits:['click','change'],
|
|
27
|
+
props: {
|
|
28
|
+
show: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
modeClass: {
|
|
33
|
+
type: [Array, String],
|
|
34
|
+
default() {
|
|
35
|
+
return 'fade'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
duration: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 300
|
|
41
|
+
},
|
|
42
|
+
styles: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default() {
|
|
45
|
+
return {}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
customClass:{
|
|
49
|
+
type: String,
|
|
50
|
+
default: ''
|
|
51
|
+
},
|
|
52
|
+
onceRender:{
|
|
53
|
+
type:Boolean,
|
|
54
|
+
default:false
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
data() {
|
|
58
|
+
return {
|
|
59
|
+
isShow: false,
|
|
60
|
+
transform: '',
|
|
61
|
+
opacity: 1,
|
|
62
|
+
animationData: {},
|
|
63
|
+
durationTime: 300,
|
|
64
|
+
config: {}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
watch: {
|
|
68
|
+
show: {
|
|
69
|
+
handler(newVal) {
|
|
70
|
+
if (newVal) {
|
|
71
|
+
this.open()
|
|
72
|
+
} else {
|
|
73
|
+
// 避免上来就执行 close,导致动画错乱
|
|
74
|
+
if (this.isShow) {
|
|
75
|
+
this.close()
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
immediate: true
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
computed: {
|
|
83
|
+
// 生成样式数据
|
|
84
|
+
stylesObject() {
|
|
85
|
+
let styles = {
|
|
86
|
+
...this.styles,
|
|
87
|
+
'transition-duration': this.duration / 1000 + 's'
|
|
88
|
+
}
|
|
89
|
+
let transform = ''
|
|
90
|
+
for (let i in styles) {
|
|
91
|
+
let line = this.toLine(i)
|
|
92
|
+
transform += line + ':' + styles[i] + ';'
|
|
93
|
+
}
|
|
94
|
+
return transform
|
|
95
|
+
},
|
|
96
|
+
// 初始化动画条件
|
|
97
|
+
transformStyles() {
|
|
98
|
+
return 'transform:' + this.transform + ';' + 'opacity:' + this.opacity + ';' + this.stylesObject
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
created() {
|
|
102
|
+
// 动画默认配置
|
|
103
|
+
this.config = {
|
|
104
|
+
duration: this.duration,
|
|
105
|
+
timingFunction: 'ease',
|
|
106
|
+
transformOrigin: '50% 50%',
|
|
107
|
+
delay: 0
|
|
108
|
+
}
|
|
109
|
+
this.durationTime = this.duration
|
|
110
|
+
},
|
|
111
|
+
methods: {
|
|
112
|
+
/**
|
|
113
|
+
* ref 触发 初始化动画
|
|
114
|
+
*/
|
|
115
|
+
init(obj = {}) {
|
|
116
|
+
if (obj.duration) {
|
|
117
|
+
this.durationTime = obj.duration
|
|
118
|
+
}
|
|
119
|
+
this.animation = createAnimation(Object.assign(this.config, obj),this)
|
|
120
|
+
},
|
|
121
|
+
/**
|
|
122
|
+
* 点击组件触发回调
|
|
123
|
+
*/
|
|
124
|
+
onClick() {
|
|
125
|
+
this.$emit('click', {
|
|
126
|
+
detail: this.isShow
|
|
127
|
+
})
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* ref 触发 动画分组
|
|
131
|
+
* @param {Object} obj
|
|
132
|
+
*/
|
|
133
|
+
step(obj, config = {}) {
|
|
134
|
+
if (!this.animation) return
|
|
135
|
+
for (let i in obj) {
|
|
136
|
+
try {
|
|
137
|
+
if(typeof obj[i] === 'object'){
|
|
138
|
+
this.animation[i](...obj[i])
|
|
139
|
+
}else{
|
|
140
|
+
this.animation[i](obj[i])
|
|
141
|
+
}
|
|
142
|
+
} catch (e) {
|
|
143
|
+
console.error(`方法 ${i} 不存在`)
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
this.animation.step(config)
|
|
147
|
+
return this
|
|
148
|
+
},
|
|
149
|
+
/**
|
|
150
|
+
* ref 触发 执行动画
|
|
151
|
+
*/
|
|
152
|
+
run(fn) {
|
|
153
|
+
if (!this.animation) return
|
|
154
|
+
this.animation.run(fn)
|
|
155
|
+
},
|
|
156
|
+
// 开始过度动画
|
|
157
|
+
open() {
|
|
158
|
+
clearTimeout(this.timer)
|
|
159
|
+
this.transform = ''
|
|
160
|
+
this.isShow = true
|
|
161
|
+
let { opacity, transform } = this.styleInit(false)
|
|
162
|
+
if (typeof opacity !== 'undefined') {
|
|
163
|
+
this.opacity = opacity
|
|
164
|
+
}
|
|
165
|
+
this.transform = transform
|
|
166
|
+
// 确保动态样式已经生效后,执行动画,如果不加 nextTick ,会导致 wx 动画执行异常
|
|
167
|
+
this.$nextTick(() => {
|
|
168
|
+
// TODO 定时器保证动画完全执行,目前有些问题,后面会取消定时器
|
|
169
|
+
this.timer = setTimeout(() => {
|
|
170
|
+
this.animation = createAnimation(this.config, this)
|
|
171
|
+
this.tranfromInit(false).step()
|
|
172
|
+
this.animation.run()
|
|
173
|
+
this.$emit('change', {
|
|
174
|
+
detail: this.isShow
|
|
175
|
+
})
|
|
176
|
+
}, 20)
|
|
177
|
+
})
|
|
178
|
+
},
|
|
179
|
+
// 关闭过度动画
|
|
180
|
+
close(type) {
|
|
181
|
+
if (!this.animation) return
|
|
182
|
+
this.tranfromInit(true)
|
|
183
|
+
.step()
|
|
184
|
+
.run(() => {
|
|
185
|
+
this.isShow = false
|
|
186
|
+
this.animationData = null
|
|
187
|
+
this.animation = null
|
|
188
|
+
let { opacity, transform } = this.styleInit(false)
|
|
189
|
+
this.opacity = opacity || 1
|
|
190
|
+
this.transform = transform
|
|
191
|
+
this.$emit('change', {
|
|
192
|
+
detail: this.isShow
|
|
193
|
+
})
|
|
194
|
+
})
|
|
195
|
+
},
|
|
196
|
+
// 处理动画开始前的默认样式
|
|
197
|
+
styleInit(type) {
|
|
198
|
+
let styles = {
|
|
199
|
+
transform: ''
|
|
200
|
+
}
|
|
201
|
+
let buildStyle = (type, mode) => {
|
|
202
|
+
if (mode === 'fade') {
|
|
203
|
+
styles.opacity = this.animationType(type)[mode]
|
|
204
|
+
} else {
|
|
205
|
+
styles.transform += this.animationType(type)[mode] + ' '
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (typeof this.modeClass === 'string') {
|
|
209
|
+
buildStyle(type, this.modeClass)
|
|
210
|
+
} else {
|
|
211
|
+
this.modeClass.forEach(mode => {
|
|
212
|
+
buildStyle(type, mode)
|
|
213
|
+
})
|
|
214
|
+
}
|
|
215
|
+
return styles
|
|
216
|
+
},
|
|
217
|
+
// 处理内置组合动画
|
|
218
|
+
tranfromInit(type) {
|
|
219
|
+
let buildTranfrom = (type, mode) => {
|
|
220
|
+
let aniNum = null
|
|
221
|
+
if (mode === 'fade') {
|
|
222
|
+
aniNum = type ? 0 : 1
|
|
223
|
+
} else {
|
|
224
|
+
aniNum = type ? '-100%' : '0'
|
|
225
|
+
if (mode === 'zoom-in') {
|
|
226
|
+
aniNum = type ? 0.8 : 1
|
|
227
|
+
}
|
|
228
|
+
if (mode === 'zoom-out') {
|
|
229
|
+
aniNum = type ? 1.2 : 1
|
|
230
|
+
}
|
|
231
|
+
if (mode === 'slide-right') {
|
|
232
|
+
aniNum = type ? '100%' : '0'
|
|
233
|
+
}
|
|
234
|
+
if (mode === 'slide-bottom') {
|
|
235
|
+
aniNum = type ? '100%' : '0'
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
this.animation[this.animationMode()[mode]](aniNum)
|
|
239
|
+
}
|
|
240
|
+
if (typeof this.modeClass === 'string') {
|
|
241
|
+
buildTranfrom(type, this.modeClass)
|
|
242
|
+
} else {
|
|
243
|
+
this.modeClass.forEach(mode => {
|
|
244
|
+
buildTranfrom(type, mode)
|
|
245
|
+
})
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return this.animation
|
|
249
|
+
},
|
|
250
|
+
animationType(type) {
|
|
251
|
+
return {
|
|
252
|
+
fade: type ? 1 : 0,
|
|
253
|
+
'slide-top': `translateY(${type ? '0' : '-100%'})`,
|
|
254
|
+
'slide-right': `translateX(${type ? '0' : '100%'})`,
|
|
255
|
+
'slide-bottom': `translateY(${type ? '0' : '100%'})`,
|
|
256
|
+
'slide-left': `translateX(${type ? '0' : '-100%'})`,
|
|
257
|
+
'zoom-in': `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
|
|
258
|
+
'zoom-out': `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
// 内置动画类型与实际动画对应字典
|
|
262
|
+
animationMode() {
|
|
263
|
+
return {
|
|
264
|
+
fade: 'opacity',
|
|
265
|
+
'slide-top': 'translateY',
|
|
266
|
+
'slide-right': 'translateX',
|
|
267
|
+
'slide-bottom': 'translateY',
|
|
268
|
+
'slide-left': 'translateX',
|
|
269
|
+
'zoom-in': 'scale',
|
|
270
|
+
'zoom-out': 'scale'
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
// 驼峰转中横线
|
|
274
|
+
toLine(name) {
|
|
275
|
+
return name.replace(/([A-Z])/g, '-$1').toLowerCase()
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
</script>
|
|
280
|
+
|
|
281
|
+
<style></style>
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kengic/uni",
|
|
3
|
+
"version": "0.3.2-beta.10",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "rimraf dist && vue-tsc && vite build",
|
|
6
|
+
"build:dev": "rimraf dist && vue-tsc && vite build --mode development",
|
|
7
|
+
"publish:all:beta": "npm run bump-version:beta && npm run publish:all",
|
|
8
|
+
"publish:all:patch": "npm run bump-version:patch && npm run publish:all",
|
|
9
|
+
"publish:all:minor": "npm run bump-version:minor && npm run publish:all",
|
|
10
|
+
"publish:all:major": "npm run bump-version:major && npm run publish:all",
|
|
11
|
+
"-------------------- C": "",
|
|
12
|
+
"bump-to:luotao.c.wms-pda": "tsx scripts/bump-to.luotao.c.wms-pda.ts",
|
|
13
|
+
"copy-to:luotao.c.wms-pda": "tsx scripts/copy-to.luotao.c.wms-pda.ts",
|
|
14
|
+
"copy-to:luotao.c.wms-pda & build": "npm run build:dev && npm run copy-to:luotao.c.wms-pda",
|
|
15
|
+
"-------------------- D": "",
|
|
16
|
+
"bump-to:luotao.wms-pda": "tsx scripts/bump-to.luotao.wms-pda.ts",
|
|
17
|
+
"copy-to:luotao.wms-pda": "tsx scripts/copy-to.luotao.wms-pda.ts",
|
|
18
|
+
"copy-to:luotao.wms-pda & build": "npm run build:dev && npm run copy-to:luotao.wms-pda",
|
|
19
|
+
"--------------------": "",
|
|
20
|
+
"gen:apis:WMS": "kengic-pont generate-apis --config kg.config.ts --origin WMS",
|
|
21
|
+
"bump-version:beta": "tsx scripts/bump.ts beta",
|
|
22
|
+
"bump-version:major": "tsx scripts/bump.ts major",
|
|
23
|
+
"bump-version:minor": "tsx scripts/bump.ts minor",
|
|
24
|
+
"bump-version:patch": "tsx scripts/bump.ts patch",
|
|
25
|
+
"publish:all": "tsx scripts/publish.ts",
|
|
26
|
+
"publish:npm": "npmrc kengic && npm publish ./ --registry https://registry.npmjs.org/ --access public"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"vue": "3.2.47"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@ant-design/icons-vue": "6.1.0",
|
|
33
|
+
"@iconify-icons/ant-design": "1.2.5",
|
|
34
|
+
"@iconify/vue": "4.1.1",
|
|
35
|
+
"@vueuse/core": "8.9.4",
|
|
36
|
+
"@vueuse/shared": "8.9.4",
|
|
37
|
+
"lodash-es": "4.17.21",
|
|
38
|
+
"pinia": "2.0.35"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@dcloudio/types": "3.3.3",
|
|
42
|
+
"@kengic/pont": "1.2.10-beta.37",
|
|
43
|
+
"@types/lodash-es": "~4.17.7",
|
|
44
|
+
"@types/node": "~18.14.6",
|
|
45
|
+
"@types/semver": "~7.3.13",
|
|
46
|
+
"@vitejs/plugin-vue": "4.2.1",
|
|
47
|
+
"@vitejs/plugin-vue-jsx": "3.0.1",
|
|
48
|
+
"chalk": "~4.1.2",
|
|
49
|
+
"less": "~4.1.3",
|
|
50
|
+
"prettier": "~2.8.4",
|
|
51
|
+
"rimraf": "~3.0.2",
|
|
52
|
+
"rollup": "~2.79.1",
|
|
53
|
+
"sass": "1.62.1",
|
|
54
|
+
"sass-loader": "10.4.1",
|
|
55
|
+
"semver": "~7.3.8",
|
|
56
|
+
"tsx": "3.12.7",
|
|
57
|
+
"typescript": "4.9.5",
|
|
58
|
+
"vite": "4.3.4",
|
|
59
|
+
"vue": "3.2.47",
|
|
60
|
+
"vue-tsc": "1.6.4"
|
|
61
|
+
},
|
|
62
|
+
"main": "./dist/kengic-uni.js",
|
|
63
|
+
"module": "./dist/kengic-uni.js",
|
|
64
|
+
"types": "./dist/src/index.d.ts",
|
|
65
|
+
"exports": {
|
|
66
|
+
".": {
|
|
67
|
+
"import": "./dist/kengic-uni.js"
|
|
68
|
+
},
|
|
69
|
+
"./dist/index.css": "./dist/index.css",
|
|
70
|
+
"./dist/uni-ui": "./dist/uni-ui/index.ts",
|
|
71
|
+
"./uni-ui/uni-icons/uni-icons.vue": "./dist/uni-ui/uni-icons/uni-icons.vue",
|
|
72
|
+
"./uni-ui/uni-easyinput/uni-easyinput.vue": "./dist/uni-ui/uni-easyinput/uni-easyinput.vue",
|
|
73
|
+
"./uni-ui/uni-card/uni-card.vue": "./dist/uni-ui/uni-card/uni-card.vue",
|
|
74
|
+
"./uni-ui/uni-popup/uni-popup.vue": "./dist/uni-ui/uni-popup/uni-popup.vue",
|
|
75
|
+
"./uni-ui/uni-grid/uni-grid.vue": "./dist/uni-ui/uni-grid/uni-grid.vue",
|
|
76
|
+
"./uni-ui/uni-grid-item/uni-grid-item.vue": "./dist/uni-ui/uni-grid-item/uni-grid-item.vue",
|
|
77
|
+
"./uni-ui/uni-list/uni-list.vue": "./dist/uni-ui/uni-list/uni-list.vue",
|
|
78
|
+
"./uni-ui/uni-badge/uni-badge.vue": "./dist/uni-ui/uni-badge/uni-badge.vue",
|
|
79
|
+
"./uni-ui/uni-list-item/uni-list-item.vue": "./dist/uni-ui/uni-list-item/uni-list-item.vue",
|
|
80
|
+
"./uni-ui/uni-transition/uni-transition.vue": "./dist/uni-ui/uni-transition/uni-transition.vue"
|
|
81
|
+
},
|
|
82
|
+
"prettier": {
|
|
83
|
+
"endOfLine": "auto",
|
|
84
|
+
"printWidth": 160,
|
|
85
|
+
"semi": true,
|
|
86
|
+
"singleQuote": true,
|
|
87
|
+
"tabWidth": 4,
|
|
88
|
+
"trailingComma": "all"
|
|
89
|
+
}
|
|
90
|
+
}
|