@vtj/materials 0.10.6 → 0.10.8
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 +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/assets/uni-h5/index.umd.js +3 -3
- package/dist/assets/uni-ui/index.umd.js +3 -3
- 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 +3 -3
- package/dist/deps/@vtj/utils/index.umd.js +20 -20
- package/dist/deps/@vueuse/core/index.iife.min.js +1 -1
- package/dist/deps/uni-ui/index.umd.js +1 -1
- package/dist/deps/uni-ui/style.css +1 -1
- package/package.json +7 -7
- package/src/uni-h5/components/input.ts +2 -2
- package/src/uni-h5/components/scrollView.ts +3 -3
- package/src/uni-h5/components/video.ts +1 -1
- package/src/uni-ui/components/badge.ts +1 -5
- package/src/uni-ui/components/breadcrumb.ts +1 -20
- package/src/uni-ui/components/collapse.ts +22 -23
- package/src/uni-ui/components/grid.ts +0 -9
- package/src/uni-ui/components/group.ts +1 -10
- package/src/uni-ui/components/index.ts +4 -4
- package/src/uni-ui/components/popup.ts +10 -2
- package/src/uni-ui/components/swiperDot.ts +21 -7
- package/src/uni-ui/components/table.ts +9 -3
- package/src/uni-ui/components/transition.ts +10 -1
- package/src/uni-ui/index.ts +19 -44
- package/src/uni-ui/lib/uni-collapse/uni-collapse.vue +153 -0
- package/src/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +425 -0
- package/src/uni-ui/lib/uni-data-picker/keypress.js +45 -0
- package/src/uni-ui/lib/uni-data-picker/uni-data-picker.vue +604 -0
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +622 -0
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.css +76 -0
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +335 -0
- package/src/uni-ui/lib/uni-datetime-picker/calendar-item.vue +181 -170
- package/src/uni-ui/lib/uni-datetime-picker/calendar.vue +977 -939
- package/src/uni-ui/lib/uni-datetime-picker/time-picker.vue +1024 -932
- package/src/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +15 -17
- package/src/uni-ui/lib/uni-datetime-picker/util.js +419 -392
- package/src/uni-ui/lib/uni-fav/i18n/en.json +4 -0
- package/src/uni-ui/lib/uni-fav/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hans.json +4 -0
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hant.json +4 -0
- package/src/uni-ui/lib/uni-fav/uni-fav.vue +170 -0
- package/src/uni-ui/lib/uni-file-picker/choose-and-upload-file.js +280 -0
- package/src/uni-ui/lib/uni-file-picker/uni-file-picker.vue +668 -0
- package/src/uni-ui/lib/uni-file-picker/upload-file.vue +325 -0
- package/src/uni-ui/lib/uni-file-picker/upload-image.vue +292 -0
- package/src/uni-ui/lib/uni-file-picker/utils.js +110 -0
- package/src/uni-ui/lib/uni-grid/uni-grid.vue +148 -0
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +152 -128
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +50 -50
- package/src/uni-ui/lib/uni-load-more/i18n/en.json +5 -0
- package/src/uni-ui/lib/uni-load-more/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hans.json +5 -0
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hant.json +5 -0
- package/src/uni-ui/lib/uni-load-more/uni-load-more.vue +456 -0
- package/src/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +484 -0
- package/src/uni-ui/lib/uni-popup/uni-popup.vue +4 -4
- package/src/uni-ui/lib/uni-popup-message/uni-popup-message.vue +149 -0
- package/src/uni-ui/lib/uni-rate/uni-rate.vue +362 -343
- package/src/uni-ui/lib/uni-row/uni-row.vue +193 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/en.json +4 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hans.json +4 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hant.json +4 -0
- package/src/uni-ui/lib/uni-search-bar/uni-search-bar.vue +339 -0
- package/src/uni-ui/lib/uni-swipe-action-item/bindingx.js +294 -285
- package/src/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +8 -9
- package/src/uni-ui/lib/uni-th/filter-dropdown.vue +551 -503
- package/src/uni-ui/lib/uni-tr/table-checkbox.vue +165 -163
- package/src/uni-ui/lib/uni-tr/uni-tr.vue +6 -6
- package/src/uni-ui/lib/uni-transition/createAnimation.js +131 -0
- package/src/uni-ui/lib/uni-transition/uni-transition.vue +310 -0
- package/src/version.ts +2 -2
@@ -1,179 +1,181 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
<view class="uni-table-checkbox" @click="selected">
|
3
|
+
<view
|
4
|
+
v-if="!indeterminate"
|
5
|
+
class="checkbox__inner"
|
6
|
+
:class="{ 'is-checked': isChecked, 'is-disable': isDisabled }">
|
7
|
+
<view class="checkbox__inner-icon"></view>
|
8
|
+
</view>
|
9
|
+
<view v-else class="checkbox__inner checkbox--indeterminate">
|
10
|
+
<view class="checkbox__inner-icon"></view>
|
11
|
+
</view>
|
12
|
+
</view>
|
10
13
|
</template>
|
11
14
|
|
12
15
|
<script>
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
16
|
+
export default {
|
17
|
+
name: 'TableCheckbox',
|
18
|
+
emits: ['checkboxSelected'],
|
19
|
+
props: {
|
20
|
+
indeterminate: {
|
21
|
+
type: Boolean,
|
22
|
+
default: false
|
23
|
+
},
|
24
|
+
checked: {
|
25
|
+
type: [Boolean, String],
|
26
|
+
default: false
|
27
|
+
},
|
28
|
+
disabled: {
|
29
|
+
type: Boolean,
|
30
|
+
default: false
|
31
|
+
},
|
32
|
+
index: {
|
33
|
+
type: Number,
|
34
|
+
default: -1
|
35
|
+
},
|
36
|
+
cellData: {
|
37
|
+
type: Object,
|
38
|
+
default() {
|
39
|
+
return {};
|
40
|
+
}
|
41
|
+
}
|
42
|
+
},
|
43
|
+
watch: {
|
44
|
+
checked(newVal) {
|
45
|
+
if (typeof this.checked === 'boolean') {
|
46
|
+
this.isChecked = newVal;
|
47
|
+
} else {
|
48
|
+
this.isChecked = true;
|
49
|
+
}
|
50
|
+
},
|
51
|
+
indeterminate(newVal) {
|
52
|
+
this.isIndeterminate = newVal;
|
53
|
+
}
|
54
|
+
},
|
55
|
+
data() {
|
56
|
+
return {
|
57
|
+
isChecked: false,
|
58
|
+
isDisabled: false,
|
59
|
+
isIndeterminate: false
|
60
|
+
};
|
61
|
+
},
|
62
|
+
created() {
|
63
|
+
if (typeof this.checked === 'boolean') {
|
64
|
+
this.isChecked = this.checked;
|
65
|
+
}
|
66
|
+
this.isDisabled = this.disabled;
|
67
|
+
},
|
68
|
+
methods: {
|
69
|
+
selected() {
|
70
|
+
if (this.isDisabled) return;
|
71
|
+
this.isIndeterminate = false;
|
72
|
+
this.isChecked = !this.isChecked;
|
73
|
+
this.$emit('checkboxSelected', {
|
74
|
+
checked: this.isChecked,
|
75
|
+
data: this.cellData
|
76
|
+
});
|
77
|
+
}
|
78
|
+
}
|
79
|
+
};
|
77
80
|
</script>
|
78
81
|
|
79
82
|
<style lang="scss">
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
+
$uni-primary: #007aff !default;
|
84
|
+
$border-color: #dcdfe6;
|
85
|
+
$disable: 0.4;
|
83
86
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
87
|
+
.uni-table-checkbox {
|
88
|
+
display: flex;
|
89
|
+
flex-direction: row;
|
90
|
+
align-items: center;
|
91
|
+
justify-content: center;
|
92
|
+
position: relative;
|
93
|
+
margin: 5px 0;
|
94
|
+
cursor: pointer;
|
92
95
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
96
|
+
// 多选样式
|
97
|
+
.checkbox__inner {
|
98
|
+
/* #ifndef APP-NVUE */
|
99
|
+
flex-shrink: 0;
|
100
|
+
box-sizing: border-box;
|
101
|
+
/* #endif */
|
102
|
+
position: relative;
|
103
|
+
width: 16px;
|
104
|
+
height: 16px;
|
105
|
+
border: 1px solid $border-color;
|
106
|
+
border-radius: 2px;
|
107
|
+
background-color: #fff;
|
108
|
+
z-index: 1;
|
106
109
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
110
|
+
.checkbox__inner-icon {
|
111
|
+
position: absolute;
|
112
|
+
/* #ifdef APP-NVUE */
|
113
|
+
top: 2px;
|
114
|
+
/* #endif */
|
115
|
+
/* #ifndef APP-NVUE */
|
116
|
+
top: 2px;
|
117
|
+
/* #endif */
|
118
|
+
left: 5px;
|
119
|
+
height: 7px;
|
120
|
+
width: 3px;
|
121
|
+
border: 1px solid #fff;
|
122
|
+
border-left: 0;
|
123
|
+
border-top: 0;
|
124
|
+
opacity: 0;
|
125
|
+
transform-origin: center;
|
126
|
+
transform: rotate(45deg);
|
127
|
+
box-sizing: content-box;
|
128
|
+
}
|
126
129
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
+
&.checkbox--indeterminate {
|
131
|
+
border-color: $uni-primary;
|
132
|
+
background-color: $uni-primary;
|
130
133
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
134
|
+
.checkbox__inner-icon {
|
135
|
+
position: absolute;
|
136
|
+
opacity: 1;
|
137
|
+
transform: rotate(0deg);
|
138
|
+
height: 2px;
|
139
|
+
top: 0;
|
140
|
+
bottom: 0;
|
141
|
+
margin: auto;
|
142
|
+
left: 0px;
|
143
|
+
right: 0px;
|
144
|
+
bottom: 0;
|
145
|
+
width: auto;
|
146
|
+
border: none;
|
147
|
+
border-radius: 2px;
|
148
|
+
transform: scale(0.5);
|
149
|
+
background-color: #fff;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
&:hover {
|
153
|
+
border-color: $uni-primary;
|
154
|
+
}
|
155
|
+
// 禁用
|
156
|
+
&.is-disable {
|
157
|
+
/* #ifdef H5 */
|
158
|
+
cursor: not-allowed;
|
159
|
+
/* #endif */
|
160
|
+
background-color: #f2f6fc;
|
161
|
+
border-color: $border-color;
|
162
|
+
}
|
160
163
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
164
|
+
// 选中
|
165
|
+
&.is-checked {
|
166
|
+
border-color: $uni-primary;
|
167
|
+
background-color: $uni-primary;
|
165
168
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
169
|
+
.checkbox__inner-icon {
|
170
|
+
opacity: 1;
|
171
|
+
transform: rotate(45deg);
|
172
|
+
}
|
170
173
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
}
|
174
|
+
// 选中禁用
|
175
|
+
&.is-disable {
|
176
|
+
opacity: $disable;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
}
|
179
181
|
</style>
|
@@ -56,7 +56,7 @@
|
|
56
56
|
},
|
57
57
|
options: {
|
58
58
|
// #ifdef MP-TOUTIAO
|
59
|
-
virtualHost: false,
|
59
|
+
// virtualHost: false,
|
60
60
|
// #endif
|
61
61
|
// #ifndef MP-TOUTIAO
|
62
62
|
virtualHost: true
|
@@ -100,11 +100,11 @@
|
|
100
100
|
}
|
101
101
|
},
|
102
102
|
// #ifndef VUE3
|
103
|
-
destroyed() {
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
},
|
103
|
+
// destroyed() {
|
104
|
+
// const index = this.root.trChildren.findIndex((i) => i === this);
|
105
|
+
// this.root.trChildren.splice(index, 1);
|
106
|
+
// this.root.isNodata();
|
107
|
+
// },
|
108
108
|
// #endif
|
109
109
|
// #ifdef VUE3
|
110
110
|
unmounted() {
|
@@ -0,0 +1,131 @@
|
|
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
|
+
}
|