@kengic/uni 0.5.1 → 0.5.2-beta.0
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/uni/uni-ui/uni-badge/uni-badge.vue +222 -219
- package/dist/uni/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +29 -29
- package/dist/uni/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +88 -88
- package/dist/uni/uni-ui/uni-calendar/calendar.js +936 -532
- package/dist/uni/uni-ui/uni-calendar/i18n/en.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hans.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hant.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/uni-calendar-item.vue +190 -168
- package/dist/uni/uni-ui/uni-calendar/uni-calendar.vue +459 -459
- package/dist/uni/uni-ui/uni-calendar/util.js +324 -340
- package/dist/uni/uni-ui/uni-card/uni-card.vue +8 -1
- package/dist/uni/uni-ui/uni-col/uni-col.vue +294 -287
- package/dist/uni/uni-ui/uni-collapse/uni-collapse.vue +139 -140
- package/dist/uni/uni-ui/uni-collapse-item/uni-collapse-item.vue +381 -378
- package/dist/uni/uni-ui/uni-combox/uni-combox.vue +280 -272
- package/dist/uni/uni-ui/uni-countdown/i18n/en.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hans.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hant.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/uni-countdown.vue +249 -257
- package/dist/uni/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +832 -813
- package/dist/uni/uni-ui/uni-data-picker/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-data-picker/uni-data-picker.vue +535 -516
- package/dist/uni/uni-ui/uni-data-pickerview/uni-data-picker.js +623 -618
- package/dist/uni/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +293 -288
- package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +495 -509
- package/dist/uni/uni-ui/uni-dateformat/date-format.js +181 -184
- package/dist/uni/uni-ui/uni-dateformat/uni-dateformat.vue +81 -82
- package/dist/uni/uni-ui/uni-datetime-picker/calendar-item.vue +176 -170
- package/dist/uni/uni-ui/uni-datetime-picker/calendar.vue +926 -920
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/en.json +20 -20
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +21 -21
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +21 -21
- package/dist/uni/uni-ui/uni-datetime-picker/time-picker.vue +921 -926
- package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1059 -1012
- package/dist/uni/uni-ui/uni-datetime-picker/util.js +366 -377
- package/dist/uni/uni-ui/uni-drawer/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-drawer/uni-drawer.vue +176 -167
- package/dist/uni/uni-ui/uni-easyinput/common.js +40 -42
- package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +628 -547
- package/dist/uni/uni-ui/uni-fab/uni-fab.vue +507 -483
- package/dist/uni/uni-ui/uni-fav/i18n/en.json +2 -2
- package/dist/uni/uni-ui/uni-fav/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-fav/i18n/zh-Hans.json +2 -2
- package/dist/uni/uni-ui/uni-fav/i18n/zh-Hant.json +2 -2
- package/dist/uni/uni-ui/uni-fav/uni-fav.vue +155 -147
- package/dist/uni/uni-ui/uni-file-picker/choose-and-upload-file.js +172 -198
- package/dist/uni/uni-ui/uni-file-picker/uni-file-picker.vue +636 -634
- package/dist/uni/uni-ui/uni-file-picker/upload-file.vue +294 -293
- package/dist/uni/uni-ui/uni-file-picker/upload-image.vue +267 -270
- package/dist/uni/uni-ui/uni-file-picker/utils.js +81 -82
- package/dist/uni/uni-ui/uni-forms/uni-forms.vue +360 -372
- package/dist/uni/uni-ui/uni-forms/utils.js +170 -174
- package/dist/uni/uni-ui/uni-forms/validate.js +447 -456
- package/dist/uni/uni-ui/uni-forms-item/uni-forms-item.vue +497 -497
- package/dist/uni/uni-ui/uni-goods-nav/i18n/en.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hans.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hant.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/uni-goods-nav.vue +238 -222
- package/dist/uni/uni-ui/uni-grid/uni-grid.vue +134 -134
- package/dist/uni/uni-ui/uni-grid-item/uni-grid-item.vue +121 -119
- package/dist/uni/uni-ui/uni-group/uni-group.vue +121 -121
- package/dist/uni/uni-ui/uni-icons/icons.js +1170 -1168
- package/dist/uni/uni-ui/uni-icons/uni-icons.vue +91 -86
- package/dist/uni/uni-ui/uni-icons/uniicons.css +166 -166
- package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +129 -129
- package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list.vue +352 -347
- package/dist/uni/uni-ui/uni-link/uni-link.vue +134 -119
- package/dist/uni/uni-ui/uni-list/uni-list.vue +119 -110
- package/dist/uni/uni-ui/uni-list/uni-refresh.vue +14 -14
- package/dist/uni/uni-ui/uni-list/uni-refresh.wxs +14 -14
- package/dist/uni/uni-ui/uni-list-ad/uni-list-ad.vue +101 -95
- package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.scss +18 -18
- package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.vue +602 -586
- package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
- package/dist/uni/uni-ui/uni-load-more/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hans.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hant.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/uni-load-more.vue +402 -392
- package/dist/uni/uni-ui/uni-nav-bar/uni-nav-bar.vue +328 -330
- package/dist/uni/uni-ui/uni-nav-bar/uni-status-bar.vue +17 -17
- package/dist/uni/uni-ui/uni-notice-bar/uni-notice-bar.vue +422 -401
- package/dist/uni/uni-ui/uni-number-box/uni-number-box.vue +211 -205
- package/dist/uni/uni-ui/uni-pagination/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/es.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/fr.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/index.js +12 -11
- package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hans.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hant.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/uni-pagination.vue +450 -433
- package/dist/uni/uni-ui/uni-popup/uni-popup.vue +404 -404
- package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +1 -0
- package/dist/uni/uni-ui/uni-popup-message/uni-popup-message.vue +126 -125
- package/dist/uni/uni-ui/uni-popup-share/uni-popup-share.vue +172 -172
- package/dist/uni/uni-ui/uni-rate/uni-rate.vue +343 -347
- package/dist/uni/uni-ui/uni-row/uni-row.vue +180 -182
- package/dist/uni/uni-ui/uni-scss/changelog.md +11 -4
- package/dist/uni/uni-ui/uni-scss/package.json +73 -73
- package/dist/uni/uni-ui/uni-scss/readme.md +2 -1
- package/dist/uni/uni-ui/uni-scss/styles/setting/_border.scss +2 -2
- package/dist/uni/uni-ui/uni-scss/styles/setting/_color.scss +46 -47
- package/dist/uni/uni-ui/uni-scss/styles/setting/_radius.scss +49 -49
- package/dist/uni/uni-ui/uni-scss/styles/setting/_space.scss +52 -53
- package/dist/uni/uni-ui/uni-scss/styles/setting/_styles.scss +142 -147
- package/dist/uni/uni-ui/uni-scss/styles/setting/_text.scss +20 -20
- package/dist/uni/uni-ui/uni-scss/styles/setting/_variables.scss +111 -95
- package/dist/uni/uni-ui/uni-scss/styles/tools/functions.scss +28 -18
- package/dist/uni/uni-ui/uni-scss/theme.scss +10 -7
- package/dist/uni/uni-ui/uni-scss/variables.scss +42 -24
- package/dist/uni/uni-ui/uni-search-bar/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-search-bar/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hans.json +2 -2
- package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hant.json +2 -2
- package/dist/uni/uni-ui/uni-search-bar/uni-search-bar.vue +290 -281
- package/dist/uni/uni-ui/uni-section/uni-section.vue +149 -146
- package/dist/uni/uni-ui/uni-segmented-control/uni-segmented-control.vue +141 -131
- package/dist/uni/uni-ui/uni-steps/uni-steps.vue +255 -236
- package/dist/uni/uni-ui/uni-swipe-action/uni-swipe-action.vue +51 -51
- package/dist/uni/uni-ui/uni-swipe-action-item/bindingx.js +276 -282
- package/dist/uni/uni-ui/uni-swipe-action-item/isPC.js +10 -10
- package/dist/uni/uni-ui/uni-swipe-action-item/mpalipay.js +182 -187
- package/dist/uni/uni-ui/uni-swipe-action-item/mpother.js +235 -244
- package/dist/uni/uni-ui/uni-swipe-action-item/mpwxs.js +70 -75
- package/dist/uni/uni-ui/uni-swipe-action-item/render.js +238 -247
- package/dist/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +392 -313
- package/dist/uni/uni-ui/uni-swipe-action-item/wx.wxs +206 -215
- package/dist/uni/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +241 -197
- package/dist/uni/uni-ui/uni-table/uni-table.vue +445 -447
- package/dist/uni/uni-ui/uni-tag/uni-tag.vue +234 -244
- package/dist/uni/uni-ui/uni-tbody/uni-tbody.vue +20 -23
- package/dist/uni/uni-ui/uni-td/uni-td.vue +79 -80
- package/dist/uni/uni-ui/uni-th/filter-dropdown.vue +510 -503
- package/dist/uni/uni-ui/uni-th/uni-th.vue +289 -273
- package/dist/uni/uni-ui/uni-thead/uni-thead.vue +115 -114
- package/dist/uni/uni-ui/uni-title/uni-title.vue +151 -154
- package/dist/uni/uni-ui/uni-tooltip/uni-tooltip.vue +55 -60
- package/dist/uni/uni-ui/uni-tr/table-checkbox.vue +162 -163
- package/dist/uni/uni-ui/uni-tr/uni-tr.vue +158 -157
- package/dist/uni/uni-ui/uni-transition/createAnimation.js +130 -113
- package/dist/uni/uni-ui/uni-transition/uni-transition.vue +274 -272
- package/package.json +1 -1
|
@@ -1,171 +1,172 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
<!-- #ifdef H5 -->
|
|
3
|
+
<tr class="uni-table-tr">
|
|
4
|
+
<th v-if="selection === 'selection' && ishead" class="checkbox" :class="{ 'tr-table--border': border }">
|
|
5
|
+
<table-checkbox :checked="checked" :indeterminate="indeterminate" :disabled="disabled" @checkboxSelected="checkboxSelected"></table-checkbox>
|
|
6
|
+
</th>
|
|
7
|
+
<slot></slot>
|
|
8
|
+
<!-- <uni-th class="th-fixed">123</uni-th> -->
|
|
9
|
+
</tr>
|
|
10
|
+
<!-- #endif -->
|
|
11
|
+
<!-- #ifndef H5 -->
|
|
12
|
+
<view class="uni-table-tr">
|
|
13
|
+
<view v-if="selection === 'selection'" class="checkbox" :class="{ 'tr-table--border': border }">
|
|
14
|
+
<table-checkbox :checked="checked" :indeterminate="indeterminate" :disabled="disabled" @checkboxSelected="checkboxSelected"></table-checkbox>
|
|
15
|
+
</view>
|
|
16
|
+
<slot></slot>
|
|
17
|
+
</view>
|
|
18
|
+
<!-- #endif -->
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
22
|
+
import tableCheckbox from './table-checkbox.vue';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Tr 表格行组件
|
|
26
|
+
* @description 表格行组件 仅包含 th,td 组件
|
|
27
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=
|
|
28
|
+
*/
|
|
29
|
+
export default {
|
|
30
|
+
name: 'uniTr',
|
|
31
|
+
components: { tableCheckbox },
|
|
32
|
+
props: {
|
|
33
|
+
disabled: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
keyValue: {
|
|
38
|
+
type: [String, Number],
|
|
39
|
+
default: '',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
options: {
|
|
43
|
+
virtualHost: true,
|
|
44
|
+
},
|
|
45
|
+
data() {
|
|
46
|
+
return {
|
|
47
|
+
value: false,
|
|
48
|
+
border: false,
|
|
49
|
+
selection: false,
|
|
50
|
+
widthThArr: [],
|
|
51
|
+
ishead: true,
|
|
52
|
+
checked: false,
|
|
53
|
+
indeterminate: false,
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
created() {
|
|
57
|
+
this.root = this.getTable();
|
|
58
|
+
this.head = this.getTable('uniThead');
|
|
59
|
+
if (this.head) {
|
|
60
|
+
this.ishead = false;
|
|
61
|
+
this.head.init(this);
|
|
62
|
+
}
|
|
63
|
+
this.border = this.root.border;
|
|
64
|
+
this.selection = this.root.type;
|
|
65
|
+
this.root.trChildren.push(this);
|
|
66
|
+
const rowData = this.root.data.find((v) => v[this.root.rowKey] === this.keyValue);
|
|
67
|
+
if (rowData) {
|
|
68
|
+
this.rowData = rowData;
|
|
69
|
+
}
|
|
70
|
+
this.root.isNodata();
|
|
71
|
+
},
|
|
72
|
+
mounted() {
|
|
73
|
+
if (this.widthThArr.length > 0) {
|
|
74
|
+
const selectionWidth = this.selection === 'selection' ? 50 : 0;
|
|
75
|
+
this.root.minWidth = this.widthThArr.reduce((a, b) => Number(a) + Number(b)) + selectionWidth;
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
// #ifndef VUE3
|
|
79
|
+
destroyed() {
|
|
80
|
+
const index = this.root.trChildren.findIndex((i) => i === this);
|
|
81
|
+
this.root.trChildren.splice(index, 1);
|
|
82
|
+
this.root.isNodata();
|
|
83
|
+
},
|
|
84
|
+
// #endif
|
|
85
|
+
// #ifdef VUE3
|
|
86
|
+
unmounted() {
|
|
87
|
+
const index = this.root.trChildren.findIndex((i) => i === this);
|
|
88
|
+
this.root.trChildren.splice(index, 1);
|
|
89
|
+
this.root.isNodata();
|
|
90
|
+
},
|
|
91
|
+
// #endif
|
|
92
|
+
methods: {
|
|
93
|
+
minWidthUpdate(width) {
|
|
94
|
+
this.widthThArr.push(width);
|
|
95
|
+
},
|
|
96
|
+
// 选中
|
|
97
|
+
checkboxSelected(e) {
|
|
98
|
+
let rootData = this.root.data.find((v) => v[this.root.rowKey] === this.keyValue);
|
|
99
|
+
this.checked = e.checked;
|
|
100
|
+
this.root.check(rootData || this, e.checked, rootData ? this.keyValue : null);
|
|
101
|
+
},
|
|
102
|
+
change(e) {
|
|
103
|
+
this.root.trChildren.forEach((item) => {
|
|
104
|
+
if (item === this) {
|
|
105
|
+
this.root.check(this, e.detail.value.length > 0 ? true : false);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* 获取父元素实例
|
|
111
|
+
*/
|
|
112
|
+
getTable(name = 'uniTable') {
|
|
113
|
+
let parent = this.$parent;
|
|
114
|
+
let parentName = parent.$options.name;
|
|
115
|
+
while (parentName !== name) {
|
|
116
|
+
parent = parent.$parent;
|
|
117
|
+
if (!parent) return false;
|
|
118
|
+
parentName = parent.$options.name;
|
|
119
|
+
}
|
|
120
|
+
return parent;
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
};
|
|
123
124
|
</script>
|
|
124
125
|
|
|
125
126
|
<style lang="scss">
|
|
126
|
-
$border-color: #ebeef5;
|
|
127
|
+
$border-color: #ebeef5;
|
|
127
128
|
|
|
128
|
-
.uni-table-tr {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
129
|
+
.uni-table-tr {
|
|
130
|
+
/* #ifndef APP-NVUE */
|
|
131
|
+
display: table-row;
|
|
132
|
+
transition: all 0.3s;
|
|
133
|
+
box-sizing: border-box;
|
|
134
|
+
/* #endif */
|
|
135
|
+
}
|
|
135
136
|
|
|
136
|
-
.checkbox {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
137
|
+
.checkbox {
|
|
138
|
+
padding: 0 8px;
|
|
139
|
+
width: 26px;
|
|
140
|
+
padding-left: 12px;
|
|
141
|
+
/* #ifndef APP-NVUE */
|
|
142
|
+
display: table-cell;
|
|
143
|
+
vertical-align: middle;
|
|
144
|
+
/* #endif */
|
|
145
|
+
color: #333;
|
|
146
|
+
font-weight: 500;
|
|
147
|
+
border-bottom: 1px $border-color solid;
|
|
148
|
+
font-size: 14px;
|
|
149
|
+
// text-align: center;
|
|
150
|
+
}
|
|
150
151
|
|
|
151
|
-
.tr-table--border {
|
|
152
|
-
|
|
153
|
-
}
|
|
152
|
+
.tr-table--border {
|
|
153
|
+
border-right: 1px $border-color solid;
|
|
154
|
+
}
|
|
154
155
|
|
|
155
|
-
/* #ifndef APP-NVUE */
|
|
156
|
-
.uni-table-tr {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
/* #ifndef APP-NVUE */
|
|
157
|
+
.uni-table-tr {
|
|
158
|
+
::v-deep .uni-table-th {
|
|
159
|
+
&.table--border:last-child {
|
|
160
|
+
// border-right: none;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
162
163
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
164
|
+
::v-deep .uni-table-td {
|
|
165
|
+
&.table--border:last-child {
|
|
166
|
+
// border-right: none;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
169
170
|
|
|
170
|
-
/* #endif */
|
|
171
|
+
/* #endif */
|
|
171
172
|
</style>
|
|
@@ -5,127 +5,144 @@
|
|
|
5
5
|
// transformOrigin: '50% 50% 0'
|
|
6
6
|
// }
|
|
7
7
|
// #ifdef APP-NVUE
|
|
8
|
-
const nvueAnimation = uni.requireNativePlugin('animation')
|
|
8
|
+
const nvueAnimation = uni.requireNativePlugin('animation');
|
|
9
9
|
// #endif
|
|
10
10
|
class MPAnimation {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
+
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
_nvuePushAnimates(type, args) {
|
|
23
|
+
let aniObj = this.currentStepAnimates[this.next];
|
|
24
|
+
let styles = {};
|
|
25
|
+
if (!aniObj) {
|
|
26
|
+
styles = {
|
|
27
|
+
styles: {},
|
|
28
|
+
config: {},
|
|
29
|
+
};
|
|
30
|
+
} else {
|
|
31
|
+
styles = aniObj;
|
|
32
|
+
}
|
|
33
|
+
if (animateTypes1.includes(type)) {
|
|
34
|
+
if (!styles.styles.transform) {
|
|
35
|
+
styles.styles.transform = '';
|
|
36
|
+
}
|
|
37
|
+
let unit = '';
|
|
38
|
+
if (type === 'rotate') {
|
|
39
|
+
unit = 'deg';
|
|
40
|
+
}
|
|
41
|
+
styles.styles.transform += `${type}(${args + unit}) `;
|
|
42
|
+
} else {
|
|
43
|
+
styles.styles[type] = `${args}`;
|
|
44
|
+
}
|
|
45
|
+
this.currentStepAnimates[this.next] = styles;
|
|
46
|
+
}
|
|
47
|
+
_animateRun(styles = {}, config = {}) {
|
|
48
|
+
let ref = this.$.$refs['ani'].ref;
|
|
49
|
+
if (!ref) return;
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
nvueAnimation.transition(
|
|
52
|
+
ref,
|
|
53
|
+
{
|
|
54
|
+
styles,
|
|
55
|
+
...config,
|
|
56
|
+
},
|
|
57
|
+
(res) => {
|
|
58
|
+
resolve();
|
|
59
|
+
},
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
22
63
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
}
|
|
64
|
+
_nvueNextAnimate(animates, step = 0, fn) {
|
|
65
|
+
let obj = animates[step];
|
|
66
|
+
if (obj) {
|
|
67
|
+
let { styles, config } = 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
|
+
}
|
|
60
78
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} else {
|
|
73
|
-
this.currentStepAnimates = {}
|
|
74
|
-
typeof fn === 'function' && fn()
|
|
75
|
-
this.isEnd = true
|
|
76
|
-
}
|
|
77
|
-
}
|
|
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
|
+
}
|
|
78
90
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
}
|
|
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
106
|
}
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
108
|
+
const animateTypes1 = [
|
|
109
|
+
'matrix',
|
|
110
|
+
'matrix3d',
|
|
111
|
+
'rotate',
|
|
112
|
+
'rotate3d',
|
|
113
|
+
'rotateX',
|
|
114
|
+
'rotateY',
|
|
115
|
+
'rotateZ',
|
|
116
|
+
'scale',
|
|
117
|
+
'scale3d',
|
|
118
|
+
'scaleX',
|
|
119
|
+
'scaleY',
|
|
120
|
+
'scaleZ',
|
|
121
|
+
'skew',
|
|
122
|
+
'skewX',
|
|
123
|
+
'skewY',
|
|
124
|
+
'translate',
|
|
125
|
+
'translate3d',
|
|
126
|
+
'translateX',
|
|
127
|
+
'translateY',
|
|
128
|
+
'translateZ',
|
|
129
|
+
];
|
|
130
|
+
const animateTypes2 = ['opacity', 'backgroundColor'];
|
|
131
|
+
const animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
|
|
132
|
+
animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => {
|
|
133
|
+
MPAnimation.prototype[type] = function (...args) {
|
|
134
|
+
// #ifndef APP-NVUE
|
|
135
|
+
this.animation[type](...args);
|
|
136
|
+
// #endif
|
|
137
|
+
// #ifdef APP-NVUE
|
|
138
|
+
this._nvuePushAnimates(type, args);
|
|
139
|
+
// #endif
|
|
140
|
+
return this;
|
|
141
|
+
};
|
|
142
|
+
});
|
|
126
143
|
|
|
127
144
|
export function createAnimation(option, _this) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
145
|
+
if (!_this) return;
|
|
146
|
+
clearTimeout(_this.timer);
|
|
147
|
+
return new MPAnimation(option, _this);
|
|
131
148
|
}
|