@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
@@ -0,0 +1,310 @@
1
+ <template>
2
+ <!-- #ifndef APP-NVUE -->
3
+ <view
4
+ v-show="isShow"
5
+ ref="ani"
6
+ :animation="animationData"
7
+ :class="customClass"
8
+ :style="transformStyles"
9
+ @click="onClick"
10
+ ><slot></slot
11
+ ></view>
12
+ <!-- #endif -->
13
+ <!-- #ifdef APP-NVUE -->
14
+ <!-- <view
15
+ v-if="isShow"
16
+ ref="ani"
17
+ :animation="animationData"
18
+ :class="customClass"
19
+ :style="transformStyles"
20
+ @click="onClick"
21
+ ><slot></slot
22
+ ></view> -->
23
+ <!-- #endif -->
24
+ </template>
25
+
26
+ <script>
27
+ import { createAnimation } from './createAnimation';
28
+
29
+ /**
30
+ * Transition 过渡动画
31
+ * @description 简单过渡动画组件
32
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=985
33
+ * @property {Boolean} show = [false|true] 控制组件显示或隐藏
34
+ * @property {Array|String} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
35
+ * @value fade 渐隐渐出过渡
36
+ * @value slide-top 由上至下过渡
37
+ * @value slide-right 由右至左过渡
38
+ * @value slide-bottom 由下至上过渡
39
+ * @value slide-left 由左至右过渡
40
+ * @value zoom-in 由小到大过渡
41
+ * @value zoom-out 由大到小过渡
42
+ * @property {Number} duration 过渡动画持续时间
43
+ * @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
44
+ */
45
+ export default {
46
+ name: 'uniTransition',
47
+ emits: ['click', 'change'],
48
+ props: {
49
+ show: {
50
+ type: Boolean,
51
+ default: false
52
+ },
53
+ modeClass: {
54
+ type: [Array, String],
55
+ default() {
56
+ return 'fade';
57
+ }
58
+ },
59
+ duration: {
60
+ type: Number,
61
+ default: 300
62
+ },
63
+ styles: {
64
+ type: Object,
65
+ default() {
66
+ return {};
67
+ }
68
+ },
69
+ customClass: {
70
+ type: String,
71
+ default: ''
72
+ },
73
+ onceRender: {
74
+ type: Boolean,
75
+ default: false
76
+ }
77
+ },
78
+ data() {
79
+ return {
80
+ isShow: false,
81
+ transform: '',
82
+ opacity: 1,
83
+ animationData: {},
84
+ durationTime: 300,
85
+ config: {}
86
+ };
87
+ },
88
+ watch: {
89
+ show: {
90
+ handler(newVal) {
91
+ if (newVal) {
92
+ this.open();
93
+ } else {
94
+ // 避免上来就执行 close,导致动画错乱
95
+ if (this.isShow) {
96
+ this.close();
97
+ }
98
+ }
99
+ },
100
+ immediate: true
101
+ }
102
+ },
103
+ computed: {
104
+ // 生成样式数据
105
+ stylesObject() {
106
+ let styles = {
107
+ ...this.styles,
108
+ 'transition-duration': this.duration / 1000 + 's'
109
+ };
110
+ let transform = '';
111
+ for (let i in styles) {
112
+ let line = this.toLine(i);
113
+ transform += line + ':' + styles[i] + ';';
114
+ }
115
+ return transform;
116
+ },
117
+ // 初始化动画条件
118
+ transformStyles() {
119
+ return (
120
+ 'transform:' +
121
+ this.transform +
122
+ ';' +
123
+ 'opacity:' +
124
+ this.opacity +
125
+ ';' +
126
+ this.stylesObject
127
+ );
128
+ }
129
+ },
130
+ created() {
131
+ // 动画默认配置
132
+ this.config = {
133
+ duration: this.duration,
134
+ timingFunction: 'ease',
135
+ transformOrigin: '50% 50%',
136
+ delay: 0
137
+ };
138
+ this.durationTime = this.duration;
139
+ },
140
+ methods: {
141
+ /**
142
+ * ref 触发 初始化动画
143
+ */
144
+ init(obj = {}) {
145
+ if (obj.duration) {
146
+ this.durationTime = obj.duration;
147
+ }
148
+ this.animation = createAnimation(Object.assign(this.config, obj), this);
149
+ },
150
+ /**
151
+ * 点击组件触发回调
152
+ */
153
+ onClick() {
154
+ this.$emit('click', {
155
+ detail: this.isShow
156
+ });
157
+ },
158
+ /**
159
+ * ref 触发 动画分组
160
+ * @param {Object} obj
161
+ */
162
+ step(obj, config = {}) {
163
+ if (!this.animation) return;
164
+ for (let i in obj) {
165
+ try {
166
+ if (typeof obj[i] === 'object') {
167
+ this.animation[i](...obj[i]);
168
+ } else {
169
+ this.animation[i](obj[i]);
170
+ }
171
+ } catch (e) {
172
+ console.error(`方法 ${i} 不存在`);
173
+ }
174
+ }
175
+ this.animation.step(config);
176
+ return this;
177
+ },
178
+ /**
179
+ * ref 触发 执行动画
180
+ */
181
+ run(fn) {
182
+ if (!this.animation) return;
183
+ this.animation.run(fn);
184
+ },
185
+ // 开始过度动画
186
+ open() {
187
+ clearTimeout(this.timer);
188
+ this.transform = '';
189
+ this.isShow = true;
190
+ let { opacity, transform } = this.styleInit(false);
191
+ if (typeof opacity !== 'undefined') {
192
+ this.opacity = opacity;
193
+ }
194
+ this.transform = transform;
195
+ // 确保动态样式已经生效后,执行动画,如果不加 nextTick ,会导致 wx 动画执行异常
196
+ this.$nextTick(() => {
197
+ // TODO 定时器保证动画完全执行,目前有些问题,后面会取消定时器
198
+ this.timer = setTimeout(() => {
199
+ this.animation = createAnimation(this.config, this);
200
+ this.tranfromInit(false).step();
201
+ this.animation.run();
202
+ this.$emit('change', {
203
+ detail: this.isShow
204
+ });
205
+ }, 20);
206
+ });
207
+ },
208
+ // 关闭过度动画
209
+ close(type) {
210
+ if (!this.animation) return;
211
+ this.tranfromInit(true)
212
+ .step()
213
+ .run(() => {
214
+ this.isShow = false;
215
+ this.animationData = null;
216
+ this.animation = null;
217
+ let { opacity, transform } = this.styleInit(false);
218
+ this.opacity = opacity || 1;
219
+ this.transform = transform;
220
+ this.$emit('change', {
221
+ detail: this.isShow
222
+ });
223
+ });
224
+ },
225
+ // 处理动画开始前的默认样式
226
+ styleInit(type) {
227
+ let styles = {
228
+ transform: ''
229
+ };
230
+ let buildStyle = (type, mode) => {
231
+ if (mode === 'fade') {
232
+ styles.opacity = this.animationType(type)[mode];
233
+ } else {
234
+ styles.transform += this.animationType(type)[mode] + ' ';
235
+ }
236
+ };
237
+ if (typeof this.modeClass === 'string') {
238
+ buildStyle(type, this.modeClass);
239
+ } else {
240
+ this.modeClass.forEach((mode) => {
241
+ buildStyle(type, mode);
242
+ });
243
+ }
244
+ return styles;
245
+ },
246
+ // 处理内置组合动画
247
+ tranfromInit(type) {
248
+ let buildTranfrom = (type, mode) => {
249
+ let aniNum = null;
250
+ if (mode === 'fade') {
251
+ aniNum = type ? 0 : 1;
252
+ } else {
253
+ aniNum = type ? '-100%' : '0';
254
+ if (mode === 'zoom-in') {
255
+ aniNum = type ? 0.8 : 1;
256
+ }
257
+ if (mode === 'zoom-out') {
258
+ aniNum = type ? 1.2 : 1;
259
+ }
260
+ if (mode === 'slide-right') {
261
+ aniNum = type ? '100%' : '0';
262
+ }
263
+ if (mode === 'slide-bottom') {
264
+ aniNum = type ? '100%' : '0';
265
+ }
266
+ }
267
+ this.animation[this.animationMode()[mode]](aniNum);
268
+ };
269
+ if (typeof this.modeClass === 'string') {
270
+ buildTranfrom(type, this.modeClass);
271
+ } else {
272
+ this.modeClass.forEach((mode) => {
273
+ buildTranfrom(type, mode);
274
+ });
275
+ }
276
+
277
+ return this.animation;
278
+ },
279
+ animationType(type) {
280
+ return {
281
+ fade: type ? 0 : 1,
282
+ 'slide-top': `translateY(${type ? '0' : '-100%'})`,
283
+ 'slide-right': `translateX(${type ? '0' : '100%'})`,
284
+ 'slide-bottom': `translateY(${type ? '0' : '100%'})`,
285
+ 'slide-left': `translateX(${type ? '0' : '-100%'})`,
286
+ 'zoom-in': `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
287
+ 'zoom-out': `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
288
+ };
289
+ },
290
+ // 内置动画类型与实际动画对应字典
291
+ animationMode() {
292
+ return {
293
+ fade: 'opacity',
294
+ 'slide-top': 'translateY',
295
+ 'slide-right': 'translateX',
296
+ 'slide-bottom': 'translateY',
297
+ 'slide-left': 'translateX',
298
+ 'zoom-in': 'scale',
299
+ 'zoom-out': 'scale'
300
+ };
301
+ },
302
+ // 驼峰转中横线
303
+ toLine(name) {
304
+ return name.replace(/([A-Z])/g, '-$1').toLowerCase();
305
+ }
306
+ }
307
+ };
308
+ </script>
309
+
310
+ <style></style>
package/src/version.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/materials
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.10.6
5
+ * @version 0.10.8
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export const version = '0.10.6';
8
+ export const version = '0.10.8';