@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,552 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<view
|
3
|
-
v-if="showPopup"
|
4
|
-
class="uni-popup"
|
5
|
-
:class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']">
|
6
|
-
<view @touchstart="touchstart">
|
7
|
-
<uni-transition
|
8
|
-
key="1"
|
9
|
-
v-if="maskShow"
|
10
|
-
name="mask"
|
11
|
-
mode-class="fade"
|
12
|
-
:styles="maskClass"
|
13
|
-
:duration="duration"
|
14
|
-
:show="showTrans"
|
15
|
-
@click="onTap" />
|
16
|
-
<uni-transition
|
17
|
-
key="2"
|
18
|
-
:mode-class="ani"
|
19
|
-
name="content"
|
20
|
-
:styles="transClass"
|
21
|
-
:duration="duration"
|
22
|
-
:show="showTrans"
|
23
|
-
@click="onTap">
|
24
|
-
<view
|
25
|
-
class="uni-popup__wrapper"
|
26
|
-
:style="getStyles"
|
27
|
-
:class="[popupstyle]"
|
28
|
-
@click="clear">
|
29
|
-
<slot />
|
30
|
-
</view>
|
31
|
-
</uni-transition>
|
32
|
-
</view>
|
33
|
-
<!-- #ifdef H5 -->
|
34
|
-
<keypress v-if="maskShow" @esc="onTap" />
|
35
|
-
<!-- #endif -->
|
36
|
-
</view>
|
37
|
-
</template>
|
38
|
-
|
39
|
-
<script>
|
40
|
-
// #ifdef H5
|
41
|
-
import keypress from './keypress.js';
|
42
|
-
// #endif
|
43
|
-
|
44
|
-
/**
|
45
|
-
* PopUp 弹出层
|
46
|
-
* @description 弹出层组件,为了解决遮罩弹层的问题
|
47
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
|
48
|
-
* @property {String} type = [top|center|bottom|left|right|message|dialog|share] 弹出方式
|
49
|
-
* @value top 顶部弹出
|
50
|
-
* @value center 中间弹出
|
51
|
-
* @value bottom 底部弹出
|
52
|
-
* @value left 左侧弹出
|
53
|
-
* @value right 右侧弹出
|
54
|
-
* @value message 消息提示
|
55
|
-
* @value dialog 对话框
|
56
|
-
* @value share 底部分享示例
|
57
|
-
* @property {Boolean} animation = [true|false] 是否开启动画
|
58
|
-
* @property {Boolean} maskClick = [true|false] 蒙版点击是否关闭弹窗(废弃)
|
59
|
-
* @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗
|
60
|
-
* @property {String} backgroundColor 主窗口背景色
|
61
|
-
* @property {String} maskBackgroundColor 蒙版颜色
|
62
|
-
* @property {String} borderRadius 设置圆角(左上、右上、右下和左下) 示例:"10px 10px 10px 10px"
|
63
|
-
* @property {Boolean} safeArea 是否适配底部安全区
|
64
|
-
* @event {Function} change 打开关闭弹窗触发,e={show: false}
|
65
|
-
* @event {Function} maskClick 点击遮罩触发
|
66
|
-
*/
|
67
|
-
|
68
|
-
export default {
|
69
|
-
name: 'uniPopup',
|
70
|
-
components: {
|
71
|
-
// #ifdef H5
|
72
|
-
keypress
|
73
|
-
// #endif
|
74
|
-
},
|
75
|
-
emits: ['change', 'maskClick'],
|
76
|
-
props: {
|
77
|
-
// 开启动画
|
78
|
-
animation: {
|
79
|
-
type: Boolean,
|
80
|
-
default: true
|
81
|
-
},
|
82
|
-
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
|
83
|
-
// message: 消息提示 ; dialog : 对话框
|
84
|
-
type: {
|
85
|
-
type: String,
|
86
|
-
default: 'center'
|
87
|
-
},
|
88
|
-
// maskClick
|
89
|
-
isMaskClick: {
|
90
|
-
type: Boolean,
|
91
|
-
default: null
|
92
|
-
},
|
93
|
-
// TODO 2 个版本后废弃属性 ,使用 isMaskClick
|
94
|
-
maskClick: {
|
95
|
-
type: Boolean,
|
96
|
-
default: null
|
97
|
-
},
|
98
|
-
backgroundColor: {
|
99
|
-
type: String,
|
100
|
-
default: 'none'
|
101
|
-
},
|
102
|
-
safeArea: {
|
103
|
-
type: Boolean,
|
104
|
-
default: true
|
105
|
-
},
|
106
|
-
maskBackgroundColor: {
|
107
|
-
type: String,
|
108
|
-
default: 'rgba(0, 0, 0, 0.4)'
|
109
|
-
},
|
110
|
-
borderRadius: {
|
111
|
-
type: String
|
112
|
-
}
|
113
|
-
},
|
114
|
-
|
115
|
-
watch: {
|
116
|
-
/**
|
117
|
-
* 监听type类型
|
118
|
-
*/
|
119
|
-
type: {
|
120
|
-
handler: function (type) {
|
121
|
-
if (!this.config[type]) return;
|
122
|
-
this[this.config[type]](true);
|
123
|
-
},
|
124
|
-
immediate: true
|
125
|
-
},
|
126
|
-
isDesktop: {
|
127
|
-
handler: function (newVal) {
|
128
|
-
if (!this.config[newVal]) return;
|
129
|
-
this[this.config[this.type]](true);
|
130
|
-
},
|
131
|
-
immediate: true
|
132
|
-
},
|
133
|
-
/**
|
134
|
-
* 监听遮罩是否可点击
|
135
|
-
* @param {Object} val
|
136
|
-
*/
|
137
|
-
maskClick: {
|
138
|
-
handler: function (val) {
|
139
|
-
this.mkclick = val;
|
140
|
-
},
|
141
|
-
immediate: true
|
142
|
-
},
|
143
|
-
isMaskClick: {
|
144
|
-
handler: function (val) {
|
145
|
-
this.mkclick = val;
|
146
|
-
},
|
147
|
-
immediate: true
|
148
|
-
},
|
149
|
-
// H5 下禁止底部滚动
|
150
|
-
showPopup(show) {
|
151
|
-
// #ifdef H5
|
152
|
-
// fix by mehaotian 处理 h5 滚动穿透的问题
|
153
|
-
document.getElementsByTagName('body')[0].style.overflow = show
|
154
|
-
? 'hidden'
|
155
|
-
: 'visible';
|
156
|
-
// #endif
|
157
|
-
}
|
158
|
-
},
|
159
|
-
data() {
|
160
|
-
return {
|
161
|
-
duration: 300,
|
162
|
-
ani: [],
|
163
|
-
showPopup: false,
|
164
|
-
showTrans: false,
|
165
|
-
popupWidth: 0,
|
166
|
-
popupHeight: 0,
|
167
|
-
config: {
|
168
|
-
top: 'top',
|
169
|
-
bottom: 'bottom',
|
170
|
-
center: 'center',
|
171
|
-
left: 'left',
|
172
|
-
right: 'right',
|
173
|
-
message: 'top',
|
174
|
-
dialog: 'center',
|
175
|
-
share: 'bottom'
|
176
|
-
},
|
177
|
-
maskClass: {
|
178
|
-
position: 'fixed',
|
179
|
-
bottom: 0,
|
180
|
-
top: 0,
|
181
|
-
left: 0,
|
182
|
-
right: 0,
|
183
|
-
backgroundColor: 'rgba(0, 0, 0, 0.4)'
|
184
|
-
},
|
185
|
-
transClass: {
|
186
|
-
backgroundColor: 'transparent',
|
187
|
-
borderRadius: this.borderRadius || '0',
|
188
|
-
position: 'fixed',
|
189
|
-
left: 0,
|
190
|
-
right: 0
|
191
|
-
},
|
192
|
-
maskShow: true,
|
193
|
-
mkclick: true,
|
194
|
-
popupstyle: 'top'
|
195
|
-
};
|
196
|
-
},
|
197
|
-
computed: {
|
198
|
-
getStyles() {
|
199
|
-
let res = { backgroundColor: this.bg };
|
200
|
-
if (this.borderRadius || '0') {
|
201
|
-
res = Object.assign(res, { borderRadius: this.borderRadius });
|
202
|
-
}
|
203
|
-
return res;
|
204
|
-
},
|
205
|
-
isDesktop() {
|
206
|
-
return this.popupWidth >= 500 && this.popupHeight >= 500;
|
207
|
-
},
|
208
|
-
bg() {
|
209
|
-
if (this.backgroundColor === '' || this.backgroundColor === 'none') {
|
210
|
-
return 'transparent';
|
211
|
-
}
|
212
|
-
return this.backgroundColor;
|
213
|
-
}
|
214
|
-
},
|
215
|
-
mounted() {
|
216
|
-
const fixSize = () => {
|
217
|
-
// #ifdef MP-WEIXIN
|
218
|
-
const {
|
219
|
-
windowWidth,
|
220
|
-
windowHeight,
|
221
|
-
windowTop,
|
222
|
-
safeArea,
|
223
|
-
screenHeight,
|
224
|
-
safeAreaInsets
|
225
|
-
} = uni.getWindowInfo();
|
226
|
-
// #endif
|
227
|
-
// #ifndef MP-WEIXIN
|
228
|
-
// const {
|
229
|
-
// windowWidth,
|
230
|
-
// windowHeight,
|
231
|
-
// windowTop,
|
232
|
-
// safeArea,
|
233
|
-
// screenHeight,
|
234
|
-
// safeAreaInsets
|
235
|
-
// } = uni.getSystemInfoSync()
|
236
|
-
// #endif
|
237
|
-
this.popupWidth = windowWidth;
|
238
|
-
this.popupHeight = windowHeight + (windowTop || 0);
|
239
|
-
// TODO fix by mehaotian 是否适配底部安全区 ,目前微信ios 、和 app ios 计算有差异,需要框架修复
|
240
|
-
if (safeArea && this.safeArea) {
|
241
|
-
// #ifdef MP-WEIXIN
|
242
|
-
// this.safeAreaInsets = screenHeight - safeArea.bottom;
|
243
|
-
// #endif
|
244
|
-
// #ifndef MP-WEIXIN
|
245
|
-
this.safeAreaInsets = safeAreaInsets.bottom;
|
246
|
-
// #endif
|
247
|
-
} else {
|
248
|
-
this.safeAreaInsets = 0;
|
249
|
-
}
|
250
|
-
};
|
251
|
-
fixSize();
|
252
|
-
// #ifdef H5
|
253
|
-
// window.addEventListener('resize', fixSize)
|
254
|
-
// this.$once('hook:beforeDestroy', () => {
|
255
|
-
// window.removeEventListener('resize', fixSize)
|
256
|
-
// })
|
257
|
-
// #endif
|
258
|
-
},
|
259
|
-
// #ifndef VUE3
|
260
|
-
// TODO vue2
|
261
|
-
// destroyed() {
|
262
|
-
// this.setH5Visible();
|
263
|
-
// },
|
264
|
-
// #endif
|
265
|
-
// #ifdef VUE3
|
266
|
-
// TODO vue3
|
267
|
-
unmounted() {
|
268
|
-
this.setH5Visible();
|
269
|
-
},
|
270
|
-
// #endif
|
271
|
-
activated() {
|
272
|
-
this.setH5Visible(!this.showPopup);
|
273
|
-
},
|
274
|
-
deactivated() {
|
275
|
-
this.setH5Visible(true);
|
276
|
-
},
|
277
|
-
created() {
|
278
|
-
// this.mkclick = this.isMaskClick || this.maskClick
|
279
|
-
if (this.isMaskClick === null && this.maskClick === null) {
|
280
|
-
this.mkclick = true;
|
281
|
-
} else {
|
282
|
-
this.mkclick =
|
283
|
-
this.isMaskClick !== null ? this.isMaskClick : this.maskClick;
|
284
|
-
}
|
285
|
-
if (this.animation) {
|
286
|
-
this.duration = 300;
|
287
|
-
} else {
|
288
|
-
this.duration = 0;
|
289
|
-
}
|
290
|
-
// TODO 处理 message 组件生命周期异常的问题
|
291
|
-
this.messageChild = null;
|
292
|
-
// TODO 解决头条冒泡的问题
|
293
|
-
this.clearPropagation = false;
|
294
|
-
this.maskClass.backgroundColor = this.maskBackgroundColor;
|
295
|
-
},
|
296
|
-
methods: {
|
297
|
-
setH5Visible(visible = true) {
|
298
|
-
// #ifdef H5
|
299
|
-
// fix by mehaotian 处理 h5 滚动穿透的问题
|
300
|
-
document.getElementsByTagName('body')[0].style.overflow = visible
|
301
|
-
? 'visible'
|
302
|
-
: 'hidden';
|
303
|
-
// #endif
|
304
|
-
},
|
305
|
-
/**
|
306
|
-
* 公用方法,不显示遮罩层
|
307
|
-
*/
|
308
|
-
closeMask() {
|
309
|
-
this.maskShow = false;
|
310
|
-
},
|
311
|
-
/**
|
312
|
-
* 公用方法,遮罩层禁止点击
|
313
|
-
*/
|
314
|
-
disableMask() {
|
315
|
-
this.mkclick = false;
|
316
|
-
},
|
317
|
-
// TODO nvue 取消冒泡
|
318
|
-
clear(e) {
|
319
|
-
// #ifndef APP-NVUE
|
320
|
-
e.stopPropagation();
|
321
|
-
// #endif
|
322
|
-
this.clearPropagation = true;
|
323
|
-
},
|
324
|
-
|
325
|
-
open(direction) {
|
326
|
-
// fix by mehaotian 处理快速打开关闭的情况
|
327
|
-
if (this.showPopup) {
|
328
|
-
return;
|
329
|
-
}
|
330
|
-
let innerType = [
|
331
|
-
'top',
|
332
|
-
'center',
|
333
|
-
'bottom',
|
334
|
-
'left',
|
335
|
-
'right',
|
336
|
-
'message',
|
337
|
-
'dialog',
|
338
|
-
'share'
|
339
|
-
];
|
340
|
-
if (!(direction && innerType.indexOf(direction) !== -1)) {
|
341
|
-
direction = this.type;
|
342
|
-
}
|
343
|
-
if (!this.config[direction]) {
|
344
|
-
console.error('缺少类型:', direction);
|
345
|
-
return;
|
346
|
-
}
|
347
|
-
this[this.config[direction]]();
|
348
|
-
this.$emit('change', {
|
349
|
-
show: true,
|
350
|
-
type: direction
|
351
|
-
});
|
352
|
-
},
|
353
|
-
close(type) {
|
354
|
-
this.showTrans = false;
|
355
|
-
this.$emit('change', {
|
356
|
-
show: false,
|
357
|
-
type: this.type
|
358
|
-
});
|
359
|
-
clearTimeout(this.timer);
|
360
|
-
// // 自定义关闭事件
|
361
|
-
// this.customOpen && this.customClose()
|
362
|
-
this.timer = setTimeout(() => {
|
363
|
-
this.showPopup = false;
|
364
|
-
}, 300);
|
365
|
-
},
|
366
|
-
// TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
|
367
|
-
touchstart() {
|
368
|
-
this.clearPropagation = false;
|
369
|
-
},
|
370
|
-
|
371
|
-
onTap() {
|
372
|
-
if (this.clearPropagation) {
|
373
|
-
// fix by mehaotian 兼容 nvue
|
374
|
-
this.clearPropagation = false;
|
375
|
-
return;
|
376
|
-
}
|
377
|
-
this.$emit('maskClick');
|
378
|
-
if (!this.mkclick) return;
|
379
|
-
this.close();
|
380
|
-
},
|
381
|
-
/**
|
382
|
-
* 顶部弹出样式处理
|
383
|
-
*/
|
384
|
-
top(type) {
|
385
|
-
this.popupstyle = this.isDesktop ? 'fixforpc-top' : 'top';
|
386
|
-
this.ani = ['slide-top'];
|
387
|
-
this.transClass = {
|
388
|
-
position: 'fixed',
|
389
|
-
left: 0,
|
390
|
-
right: 0,
|
391
|
-
backgroundColor: this.bg,
|
392
|
-
borderRadius: this.borderRadius || '0'
|
393
|
-
};
|
394
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
395
|
-
if (type) return;
|
396
|
-
this.showPopup = true;
|
397
|
-
this.showTrans = true;
|
398
|
-
this.$nextTick(() => {
|
399
|
-
this.showPoptrans();
|
400
|
-
if (this.messageChild && this.type === 'message') {
|
401
|
-
this.messageChild.timerClose();
|
402
|
-
}
|
403
|
-
});
|
404
|
-
},
|
405
|
-
/**
|
406
|
-
* 底部弹出样式处理
|
407
|
-
*/
|
408
|
-
bottom(type) {
|
409
|
-
this.popupstyle = 'bottom';
|
410
|
-
this.ani = ['slide-bottom'];
|
411
|
-
this.transClass = {
|
412
|
-
position: 'fixed',
|
413
|
-
left: 0,
|
414
|
-
right: 0,
|
415
|
-
bottom: 0,
|
416
|
-
paddingBottom: this.safeAreaInsets + 'px',
|
417
|
-
backgroundColor: this.bg,
|
418
|
-
borderRadius: this.borderRadius || '0'
|
419
|
-
};
|
420
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
421
|
-
if (type) return;
|
422
|
-
this.showPoptrans();
|
423
|
-
},
|
424
|
-
/**
|
425
|
-
* 中间弹出样式处理
|
426
|
-
*/
|
427
|
-
center(type) {
|
428
|
-
this.popupstyle = 'center';
|
429
|
-
//微信小程序下,组合动画会出现文字向上闪动问题,再此做特殊处理
|
430
|
-
// #ifdef MP-WEIXIN
|
431
|
-
this.ani = ['fade'];
|
432
|
-
// #endif
|
433
|
-
// #ifndef MP-WEIXIN
|
434
|
-
this.ani = ['zoom-out', 'fade'];
|
435
|
-
// #endif
|
436
|
-
this.transClass = {
|
437
|
-
position: 'fixed',
|
438
|
-
/* #ifndef APP-NVUE */
|
439
|
-
display: 'flex',
|
440
|
-
flexDirection: 'column',
|
441
|
-
/* #endif */
|
442
|
-
bottom: 0,
|
443
|
-
left: 0,
|
444
|
-
right: 0,
|
445
|
-
top: 0,
|
446
|
-
justifyContent: 'center',
|
447
|
-
alignItems: 'center',
|
448
|
-
borderRadius: this.borderRadius || '0'
|
449
|
-
};
|
450
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
451
|
-
if (type) return;
|
452
|
-
this.showPoptrans();
|
453
|
-
},
|
454
|
-
left(type) {
|
455
|
-
this.popupstyle = 'left';
|
456
|
-
this.ani = ['slide-left'];
|
457
|
-
this.transClass = {
|
458
|
-
position: 'fixed',
|
459
|
-
left: 0,
|
460
|
-
bottom: 0,
|
461
|
-
top: 0,
|
462
|
-
backgroundColor: this.bg,
|
463
|
-
borderRadius: this.borderRadius || '0',
|
464
|
-
/* #ifndef APP-NVUE */
|
465
|
-
display: 'flex',
|
466
|
-
flexDirection: 'column'
|
467
|
-
/* #endif */
|
468
|
-
};
|
469
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
470
|
-
if (type) return;
|
471
|
-
this.showPoptrans();
|
472
|
-
},
|
473
|
-
right(type) {
|
474
|
-
this.popupstyle = 'right';
|
475
|
-
this.ani = ['slide-right'];
|
476
|
-
this.transClass = {
|
477
|
-
position: 'fixed',
|
478
|
-
bottom: 0,
|
479
|
-
right: 0,
|
480
|
-
top: 0,
|
481
|
-
backgroundColor: this.bg,
|
482
|
-
borderRadius: this.borderRadius || '0',
|
483
|
-
/* #ifndef APP-NVUE */
|
484
|
-
display: 'flex',
|
485
|
-
flexDirection: 'column'
|
486
|
-
/* #endif */
|
487
|
-
};
|
488
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
489
|
-
if (type) return;
|
490
|
-
this.showPoptrans();
|
491
|
-
},
|
492
|
-
showPoptrans() {
|
493
|
-
this.$nextTick(() => {
|
494
|
-
this.showPopup = true;
|
495
|
-
this.showTrans = true;
|
496
|
-
});
|
497
|
-
}
|
498
|
-
}
|
499
|
-
};
|
500
|
-
</script>
|
501
|
-
<style lang="scss">
|
502
|
-
.uni-popup {
|
503
|
-
position: fixed;
|
504
|
-
/* #ifndef APP-NVUE */
|
505
|
-
z-index: 99;
|
506
|
-
|
507
|
-
/* #endif */
|
508
|
-
&.top,
|
509
|
-
&.left,
|
510
|
-
&.right {
|
511
|
-
/* #ifdef H5 */
|
512
|
-
top: var(--window-top);
|
513
|
-
/* #endif */
|
514
|
-
/* #ifndef H5 */
|
515
|
-
top: 0;
|
516
|
-
/* #endif */
|
517
|
-
}
|
518
|
-
|
519
|
-
.uni-popup__wrapper {
|
520
|
-
/* #ifndef APP-NVUE */
|
521
|
-
display: block;
|
522
|
-
/* #endif */
|
523
|
-
position: relative;
|
524
|
-
|
525
|
-
/* iphonex 等安全区设置,底部安全区适配 */
|
526
|
-
/* #ifndef APP-NVUE */
|
527
|
-
// padding-bottom: constant(safe-area-inset-bottom);
|
528
|
-
// padding-bottom: env(safe-area-inset-bottom);
|
529
|
-
/* #endif */
|
530
|
-
&.left,
|
531
|
-
&.right {
|
532
|
-
/* #ifdef H5 */
|
533
|
-
padding-top: var(--window-top);
|
534
|
-
/* #endif */
|
535
|
-
/* #ifndef H5 */
|
536
|
-
padding-top: 0;
|
537
|
-
/* #endif */
|
538
|
-
flex: 1;
|
539
|
-
}
|
540
|
-
}
|
541
|
-
}
|
542
|
-
|
543
|
-
.fixforpc-z-index {
|
544
|
-
/* #ifndef APP-NVUE */
|
545
|
-
z-index: 999;
|
546
|
-
/* #endif */
|
547
|
-
}
|
548
|
-
|
549
|
-
.fixforpc-top {
|
550
|
-
top: 0;
|
551
|
-
}
|
552
|
-
</style>
|
@@ -1,45 +0,0 @@
|
|
1
|
-
// #ifdef H5
|
2
|
-
export default {
|
3
|
-
name: 'Keypress',
|
4
|
-
props: {
|
5
|
-
disable: {
|
6
|
-
type: Boolean,
|
7
|
-
default: false
|
8
|
-
}
|
9
|
-
},
|
10
|
-
mounted () {
|
11
|
-
const keyNames = {
|
12
|
-
esc: ['Esc', 'Escape'],
|
13
|
-
tab: 'Tab',
|
14
|
-
enter: 'Enter',
|
15
|
-
space: [' ', 'Spacebar'],
|
16
|
-
up: ['Up', 'ArrowUp'],
|
17
|
-
left: ['Left', 'ArrowLeft'],
|
18
|
-
right: ['Right', 'ArrowRight'],
|
19
|
-
down: ['Down', 'ArrowDown'],
|
20
|
-
delete: ['Backspace', 'Delete', 'Del']
|
21
|
-
}
|
22
|
-
const listener = ($event) => {
|
23
|
-
if (this.disable) {
|
24
|
-
return
|
25
|
-
}
|
26
|
-
const keyName = Object.keys(keyNames).find(key => {
|
27
|
-
const keyName = $event.key
|
28
|
-
const value = keyNames[key]
|
29
|
-
return value === keyName || (Array.isArray(value) && value.includes(keyName))
|
30
|
-
})
|
31
|
-
if (keyName) {
|
32
|
-
// 避免和其他按键事件冲突
|
33
|
-
setTimeout(() => {
|
34
|
-
this.$emit(keyName, {})
|
35
|
-
}, 0)
|
36
|
-
}
|
37
|
-
}
|
38
|
-
document.addEventListener('keyup', listener)
|
39
|
-
this.$once('hook:beforeDestroy', () => {
|
40
|
-
document.removeEventListener('keyup', listener)
|
41
|
-
})
|
42
|
-
},
|
43
|
-
render: () => {}
|
44
|
-
}
|
45
|
-
// #endif
|