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