@10yun/cv-mobile-ui 0.4.1 → 0.4.2

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 (112) hide show
  1. package/package.json +1 -1
  2. package/ui-cv/cv-badge/{uni-badge.vue → cv-badge.vue} +2 -2
  3. package/ui-cv/cv-calendar/calendar.js +762 -345
  4. package/ui-cv/cv-calendar/cv-calendar-item.vue +198 -0
  5. package/ui-cv/cv-calendar/cv-calendar.vue +508 -0
  6. package/ui-cv/cv-card/cv-card.vue +427 -0
  7. package/ui-cv/cv-col/cv-col.vue +2965 -0
  8. package/ui-cv/cv-collapse/cv-collapse.vue +146 -0
  9. package/ui-cv/cv-collapse-item/cv-collapse-item.vue +395 -0
  10. package/ui-cv/cv-combox/cv-combox.vue +250 -0
  11. package/ui-cv/cv-countdown/cv-countdown.vue +245 -0
  12. package/ui-cv/cv-data-checkbox/cv-data-checkbox.vue +841 -0
  13. package/ui-cv/cv-data-indexed-list/cv-data-indexed-list-item.vue +154 -0
  14. package/ui-cv/cv-data-indexed-list/cv-data-indexed-list.vue +376 -0
  15. package/ui-cv/cv-data-picker/cv-data-picker.vue +486 -0
  16. package/ui-cv/cv-data-pickerview/{uni-data-picker.js → cv-data-picker.js} +0 -0
  17. package/ui-cv/cv-data-pickerview/cv-data-pickerview.vue +304 -0
  18. package/ui-cv/cv-dateformat/cv-dateformat.vue +86 -0
  19. package/ui-cv/cv-datetime-picker/calendar.vue +752 -738
  20. package/ui-cv/cv-datetime-picker/cv-datetime-picker.vue +958 -0
  21. package/ui-cv/cv-datetime-picker/time-picker.vue +900 -892
  22. package/ui-cv/cv-easyinput/cv-easyinput.vue +514 -0
  23. package/ui-cv/cv-fab/cv-fab.vue +465 -0
  24. package/ui-cv/cv-fab/{uni-fab.vue.bak → cv-fab.vue.bak} +2 -2
  25. package/ui-cv/cv-fav/cv-fav.vue +150 -0
  26. package/ui-cv/cv-file-picker/cv-file-picker.vue +619 -0
  27. package/ui-cv/cv-form-item/cv-form-item.vue +1 -1
  28. package/ui-cv/cv-goods-nav/{uni-goods-nav.vue → cv-goods-nav.vue} +1 -1
  29. package/ui-cv/{cv-icons2/cv-icons2.vue → cv-icon2/cv-icon2.vue} +3 -3
  30. package/ui-cv/{cv-icons2 → cv-icon2}/icons.js +0 -0
  31. package/ui-cv/{cv-icons2 → cv-icon2}/uni.ttf +0 -0
  32. package/ui-cv/cv-indexed-list/cv-indexed-list-item.vue +154 -0
  33. package/ui-cv/cv-indexed-list/cv-indexed-list.vue +371 -0
  34. package/ui-cv/cv-input-password/cv-input-password.vue +2 -2
  35. package/ui-cv/{cv-link/uni-link.vue → cv-link2/cv-link2.vue} +1 -1
  36. package/ui-cv/cv-list/cv-list.vue +107 -0
  37. package/ui-cv/cv-list/cv-refresh.vue +65 -0
  38. package/ui-cv/cv-list-ad/cv-list-ad.vue +113 -0
  39. package/ui-cv/cv-list-chat/{uni-list-chat.scss → cv-list-chat.scss} +0 -0
  40. package/ui-cv/cv-list-chat/{uni-list-chat.vue → cv-list-chat.vue} +0 -0
  41. package/ui-cv/cv-list-item/cv-list-item.vue +449 -0
  42. package/ui-cv/cv-nav-bar/cv-nav-bar.vue +256 -0
  43. package/ui-cv/cv-nav-bar/{uni-status-bar.vue → cv-status-bar.vue} +0 -0
  44. package/ui-cv/cv-notice-bar/cv-notice-bar.vue +453 -0
  45. package/ui-cv/cv-number-box/cv-number-box.vue +223 -0
  46. package/ui-cv/cv-pagination/cv-pagination.vue +397 -0
  47. package/ui-cv/cv-popup/cv-popup.vue +429 -0
  48. package/ui-cv/cv-popup-dialog/{uni-popup-dialog.vue → cv-popup-dialog.vue} +0 -0
  49. package/ui-cv/cv-popup-message/cv-popup-message.vue +143 -0
  50. package/ui-cv/cv-popup-share/{uni-popup-share.vue → cv-popup-share.vue} +0 -0
  51. package/ui-cv/cv-row/{uni-row.vue → cv-row.vue} +1 -1
  52. package/ui-cv/cv-search-bar/cv-search-bar.vue +280 -0
  53. package/ui-cv/cv-section/{uni-section.vue → cv-section.vue} +0 -0
  54. package/ui-cv/cv-segmented-control/{uni-segmented-control.vue → cv-segmented-control.vue} +0 -0
  55. package/ui-cv/cv-status-bar/{uni-status-bar.vue → cv-status-bar.vue} +0 -0
  56. package/ui-cv/cv-steps/cv-steps.vue +293 -0
  57. package/ui-cv/cv-swipe-action/{uni-swipe-action.vue → cv-swipe-action.vue} +0 -0
  58. package/ui-cv/cv-swipe-action-item/{uni-swipe-action-item.vue → cv-swipe-action-item.vue} +0 -0
  59. package/ui-cv/cv-swiper-dot/cv-swiper-dot.vue +255 -0
  60. package/ui-cv/cv-table/cv-table.vue +460 -0
  61. package/ui-cv/cv-tag/cv-tag.vue +276 -0
  62. package/ui-cv/cv-tbody/cv-tbody.vue +28 -0
  63. package/ui-cv/cv-td/cv-td.vue +93 -0
  64. package/ui-cv/cv-test/{uni-test.vue → cv-test.vue} +0 -0
  65. package/ui-cv/cv-th/cv-th.vue +270 -0
  66. package/ui-cv/cv-thead/cv-thead.vue +114 -0
  67. package/ui-cv/cv-title/cv-title.vue +168 -0
  68. package/ui-cv/cv-tr/cv-tr.vue +166 -0
  69. package/ui-cv/cv-transition/cv-transition.vue +279 -0
  70. package/ui-cv/cv-calendar/uni-calendar-item.vue +0 -171
  71. package/ui-cv/cv-calendar/uni-calendar.vue +0 -504
  72. package/ui-cv/cv-card/uni-card.vue +0 -420
  73. package/ui-cv/cv-col/uni-col.vue +0 -2968
  74. package/ui-cv/cv-collapse/uni-collapse.vue +0 -146
  75. package/ui-cv/cv-collapse-item/uni-collapse-item.vue +0 -378
  76. package/ui-cv/cv-combox/uni-combox.vue +0 -237
  77. package/ui-cv/cv-countdown/uni-countdown.vue +0 -234
  78. package/ui-cv/cv-data-checkbox/uni-data-checkbox.vue +0 -792
  79. package/ui-cv/cv-data-indexed-list/uni-data-indexed-list-item.vue +0 -142
  80. package/ui-cv/cv-data-indexed-list/uni-data-indexed-list.vue +0 -364
  81. package/ui-cv/cv-data-picker/uni-data-picker.vue +0 -468
  82. package/ui-cv/cv-data-pickerview/uni-data-pickerview.vue +0 -298
  83. package/ui-cv/cv-dateformat/uni-dateformat.vue +0 -88
  84. package/ui-cv/cv-datetime-picker/uni-datetime-picker.vue +0 -874
  85. package/ui-cv/cv-easyinput/uni-easyinput.vue +0 -438
  86. package/ui-cv/cv-fab/uni-fab.vue +0 -443
  87. package/ui-cv/cv-fav/uni-fav.vue +0 -136
  88. package/ui-cv/cv-file-picker/uni-file-picker.vue +0 -614
  89. package/ui-cv/cv-indexed-list/uni-indexed-list-item.vue +0 -142
  90. package/ui-cv/cv-indexed-list/uni-indexed-list.vue +0 -357
  91. package/ui-cv/cv-list/uni-list.vue +0 -107
  92. package/ui-cv/cv-list/uni-refresh.vue +0 -65
  93. package/ui-cv/cv-list-ad/uni-list-ad.vue +0 -106
  94. package/ui-cv/cv-list-item/uni-list-item.vue +0 -428
  95. package/ui-cv/cv-nav-bar/uni-nav-bar.vue +0 -244
  96. package/ui-cv/cv-notice-bar/uni-notice-bar.vue +0 -394
  97. package/ui-cv/cv-number-box/uni-number-box.vue +0 -224
  98. package/ui-cv/cv-pagination/uni-pagination.vue +0 -376
  99. package/ui-cv/cv-popup/uni-popup.vue +0 -412
  100. package/ui-cv/cv-popup-message/uni-popup-message.vue +0 -143
  101. package/ui-cv/cv-search-bar/uni-search-bar.vue +0 -262
  102. package/ui-cv/cv-steps/uni-steps.vue +0 -250
  103. package/ui-cv/cv-swiper-dot/uni-swiper-dot.vue +0 -205
  104. package/ui-cv/cv-table/uni-table.vue +0 -455
  105. package/ui-cv/cv-tag/uni-tag.vue +0 -283
  106. package/ui-cv/cv-tbody/uni-tbody.vue +0 -30
  107. package/ui-cv/cv-td/uni-td.vue +0 -88
  108. package/ui-cv/cv-th/uni-th.vue +0 -259
  109. package/ui-cv/cv-thead/uni-thead.vue +0 -114
  110. package/ui-cv/cv-title/uni-title.vue +0 -171
  111. package/ui-cv/cv-tr/uni-tr.vue +0 -156
  112. package/ui-cv/cv-transition/uni-transition.vue +0 -287
@@ -1,156 +0,0 @@
1
- <template>
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
- </template>
20
-
21
- <script>
22
- import tableCheckbox from './table-checkbox.vue'
23
- /**
24
- * Tr 表格行组件
25
- * @description 表格行组件 仅包含 th,td 组件
26
- * @tutorial https://ext.dcloud.net.cn/plugin?id=
27
- */
28
- export default {
29
- name: 'uniTr',
30
- components: {
31
- tableCheckbox
32
- },
33
- props: {
34
- disabled: {
35
- type: Boolean,
36
- default: false
37
- },
38
- keyValue: {
39
- type: [String, Number],
40
- default: ''
41
- }
42
- },
43
- options: {
44
- virtualHost: true
45
- },
46
- data() {
47
- return {
48
- value: false,
49
- border: false,
50
- selection: false,
51
- widthThArr: [],
52
- ishead: true,
53
- checked: false,
54
- indeterminate: false
55
- }
56
- },
57
- created() {
58
- this.root = this.getTable()
59
- this.head = this.getTable('uniThead')
60
- if (this.head) {
61
- this.ishead = false
62
- this.head.init(this)
63
- }
64
- this.border = this.root.border
65
- this.selection = this.root.type
66
- this.root.trChildren.push(this)
67
- const rowData = this.root.data.find(v => v[this.root.rowKey] === this.keyValue)
68
- if (rowData) {
69
- this.rowData = rowData
70
- }
71
- this.root.isNodata()
72
- },
73
- mounted() {
74
- if (this.widthThArr.length > 0) {
75
- const selectionWidth = this.selection === 'selection' ? 50 : 0
76
- this.root.minWidth = this.widthThArr.reduce((a, b) => Number(a) + Number(b)) + selectionWidth
77
- }
78
- },
79
- // #ifndef VUE3
80
- destroyed() {
81
- const index = this.root.trChildren.findIndex(i => i === this)
82
- this.root.trChildren.splice(index, 1)
83
- this.root.isNodata()
84
- },
85
- // #endif
86
- // #ifdef VUE3
87
- unmounted() {
88
- const index = this.root.trChildren.findIndex(i => i === this)
89
- this.root.trChildren.splice(index, 1)
90
- this.root.isNodata()
91
- },
92
- // #endif
93
- methods: {
94
- minWidthUpdate(width) {
95
- this.widthThArr.push(width)
96
- },
97
- // 选中
98
- checkboxSelected(e) {
99
- let rootData = this.root.data.find(v => v[this.root.rowKey] === this.keyValue)
100
- this.checked = e.checked
101
- this.root.check(rootData || this, e.checked, rootData ? this.keyValue : null)
102
- },
103
- change(e) {
104
- this.root.trChildren.forEach(item => {
105
- if (item === this) {
106
- this.root.check(this, e.detail.value.length > 0 ? true : false)
107
- }
108
- })
109
- },
110
- /**
111
- * 获取父元素实例
112
- */
113
- getTable(name = 'uniTable') {
114
- let parent = this.$parent
115
- let parentName = parent.$options.name
116
- while (parentName !== name) {
117
- parent = parent.$parent
118
- if (!parent) return false
119
- parentName = parent.$options.name
120
- }
121
- return parent
122
- }
123
- }
124
- }
125
- </script>
126
-
127
- <style scoped>
128
- .uni-table-tr {
129
- /* #ifndef APP-NVUE */
130
- display: table-row;
131
- transition: all 0.3s;
132
- box-sizing: border-box;
133
- /* #endif */
134
- }
135
-
136
- .checkbox {
137
- padding: 0 8px;
138
- width: 26px;
139
- padding-left: 12px;
140
- /* #ifndef APP-NVUE */
141
- display: table-cell;
142
- vertical-align: middle;
143
- /* #endif */
144
- color: #333;
145
- font-weight: 500;
146
- border-bottom: 1px #ebeef5 solid;
147
- font-size: 14px;
148
- }
149
-
150
- .tr-table--border {
151
- border-right: 1px #ebeef5 solid;
152
- }
153
-
154
- /* #ifndef APP-NVUE */
155
- /* #endif */
156
- </style>
@@ -1,287 +0,0 @@
1
- <template>
2
- <view v-if="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick">
3
- <slot></slot>
4
- </view>
5
- </template>
6
-
7
- <script>
8
- import {
9
- createAnimation
10
- } from './createAnimation'
11
-
12
- /**
13
- * Transition 过渡动画
14
- * @description 简单过渡动画组件
15
- * @tutorial https://ext.dcloud.net.cn/plugin?id=985
16
- * @property {Boolean} show = [false|true] 控制组件显示或隐藏
17
- * @property {Array|String} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
18
- * @value fade 渐隐渐出过渡
19
- * @value slide-top 由上至下过渡
20
- * @value slide-right 由右至左过渡
21
- * @value slide-bottom 由下至上过渡
22
- * @value slide-left 由左至右过渡
23
- * @value zoom-in 由小到大过渡
24
- * @value zoom-out 由大到小过渡
25
- * @property {Number} duration 过渡动画持续时间
26
- * @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
27
- */
28
- export default {
29
- name: 'uniTransition',
30
- emits: ['click', 'change'],
31
- props: {
32
- show: {
33
- type: Boolean,
34
- default: false
35
- },
36
- modeClass: {
37
- type: [Array, String],
38
- default () {
39
- return 'fade'
40
- }
41
- },
42
- duration: {
43
- type: Number,
44
- default: 300
45
- },
46
- styles: {
47
- type: Object,
48
- default () {
49
- return {}
50
- }
51
- },
52
- customClass: {
53
- type: String,
54
- default: ''
55
- }
56
- },
57
- data() {
58
- return {
59
- isShow: false,
60
- transform: '',
61
- opacity: 1,
62
- animationData: {},
63
- durationTime: 300,
64
- config: {}
65
- }
66
- },
67
- watch: {
68
- show: {
69
- handler(newVal) {
70
- if (newVal) {
71
- this.open()
72
- } else {
73
- // 避免上来就执行 close,导致动画错乱
74
- if (this.isShow) {
75
- this.close()
76
- }
77
- }
78
- },
79
- immediate: true
80
- }
81
- },
82
- computed: {
83
- // 生成样式数据
84
- stylesObject() {
85
- let styles = {
86
- ...this.styles,
87
- 'transition-duration': this.duration / 1000 + 's'
88
- }
89
- let transform = ''
90
- for (let i in styles) {
91
- let line = this.toLine(i)
92
- transform += line + ':' + styles[i] + ';'
93
- }
94
- return transform
95
- },
96
- // 初始化动画条件
97
- transformStyles() {
98
- return 'transform:' + this.transform + ';' + 'opacity:' + this.opacity + ';' + this.stylesObject
99
- }
100
- },
101
- created() {
102
- // 动画默认配置
103
- this.config = {
104
- duration: this.duration,
105
- timingFunction: 'ease',
106
- transformOrigin: '50% 50%',
107
- delay: 0
108
- }
109
- this.durationTime = this.duration
110
- },
111
- methods: {
112
- /**
113
- * ref 触发 初始化动画
114
- */
115
- init(obj = {}) {
116
- if (obj.duration) {
117
- this.durationTime = obj.duration
118
- }
119
- this.animation = createAnimation(Object.assign(this.config, obj))
120
- },
121
- /**
122
- * 点击组件触发回调
123
- */
124
- onClick() {
125
- this.$emit('click', {
126
- detail: this.isShow
127
- })
128
- },
129
- /**
130
- * ref 触发 动画分组
131
- * @param {Object} obj
132
- */
133
- step(obj, config = {}) {
134
- if (!this.animation) return
135
- for (let i in obj) {
136
- try {
137
- if (typeof obj[i] === 'object') {
138
- this.animation[i](...obj[i])
139
- } else {
140
- this.animation[i](obj[i])
141
- }
142
- } catch (e) {
143
- console.error(`方法 ${i} 不存在`)
144
- }
145
- }
146
- this.animation.step(config)
147
- return this
148
- },
149
- /**
150
- * ref 触发 执行动画
151
- */
152
- run(fn) {
153
- if (!this.animation) return
154
- this.animation.run(fn)
155
- },
156
- // 开始过度动画
157
- open() {
158
- clearTimeout(this.timer)
159
- this.transform = ''
160
- this.isShow = true
161
- let {
162
- opacity,
163
- transform
164
- } = this.styleInit(false)
165
- if (typeof opacity !== 'undefined') {
166
- this.opacity = opacity
167
- }
168
- this.transform = transform
169
- // 确保动态样式已经生效后,执行动画,如果不加 nextTick ,会导致 wx 动画执行异常
170
- this.$nextTick(() => {
171
- // TODO 定时器保证动画完全执行,目前有些问题,后面会取消定时器
172
- this.timer = setTimeout(() => {
173
- this.animation = createAnimation(this.config, this)
174
- this.tranfromInit(false).step()
175
- this.animation.run()
176
- this.$emit('change', {
177
- detail: this.isShow
178
- })
179
- }, 20)
180
- })
181
- },
182
- // 关闭过度动画
183
- close(type) {
184
- if (!this.animation) return
185
- this.tranfromInit(true)
186
- .step()
187
- .run(() => {
188
- this.isShow = false
189
- this.animationData = null
190
- this.animation = null
191
- let {
192
- opacity,
193
- transform
194
- } = this.styleInit(false)
195
- this.opacity = opacity || 1
196
- this.transform = transform
197
- this.$emit('change', {
198
- detail: this.isShow
199
- })
200
- })
201
- },
202
- // 处理动画开始前的默认样式
203
- styleInit(type) {
204
- let styles = {
205
- transform: ''
206
- }
207
- let buildStyle = (type, mode) => {
208
- if (mode === 'fade') {
209
- styles.opacity = this.animationType(type)[mode]
210
- } else {
211
- styles.transform += this.animationType(type)[mode] + ' '
212
- }
213
- }
214
- if (typeof this.modeClass === 'string') {
215
- buildStyle(type, this.modeClass)
216
- } else {
217
- this.modeClass.forEach(mode => {
218
- buildStyle(type, mode)
219
- })
220
- }
221
- return styles
222
- },
223
- // 处理内置组合动画
224
- tranfromInit(type) {
225
- let buildTranfrom = (type, mode) => {
226
- let aniNum = null
227
- if (mode === 'fade') {
228
- aniNum = type ? 0 : 1
229
- } else {
230
- aniNum = type ? '-100%' : '0'
231
- if (mode === 'zoom-in') {
232
- aniNum = type ? 0.8 : 1
233
- }
234
- if (mode === 'zoom-out') {
235
- aniNum = type ? 1.2 : 1
236
- }
237
- if (mode === 'slide-right') {
238
- aniNum = type ? '100%' : '0'
239
- }
240
- if (mode === 'slide-bottom') {
241
- aniNum = type ? '100%' : '0'
242
- }
243
- }
244
- this.animation[this.animationMode()[mode]](aniNum)
245
- }
246
- if (typeof this.modeClass === 'string') {
247
- buildTranfrom(type, this.modeClass)
248
- } else {
249
- this.modeClass.forEach(mode => {
250
- buildTranfrom(type, mode)
251
- })
252
- }
253
-
254
- return this.animation
255
- },
256
- animationType(type) {
257
- return {
258
- fade: type ? 1 : 0,
259
- 'slide-top': `translateY(${type ? '0' : '-100%'})`,
260
- 'slide-right': `translateX(${type ? '0' : '100%'})`,
261
- 'slide-bottom': `translateY(${type ? '0' : '100%'})`,
262
- 'slide-left': `translateX(${type ? '0' : '-100%'})`,
263
- 'zoom-in': `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
264
- 'zoom-out': `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
265
- }
266
- },
267
- // 内置动画类型与实际动画对应字典
268
- animationMode() {
269
- return {
270
- fade: 'opacity',
271
- 'slide-top': 'translateY',
272
- 'slide-right': 'translateX',
273
- 'slide-bottom': 'translateY',
274
- 'slide-left': 'translateX',
275
- 'zoom-in': 'scale',
276
- 'zoom-out': 'scale'
277
- }
278
- },
279
- // 驼峰转中横线
280
- toLine(name) {
281
- return name.replace(/([A-Z])/g, '-$1').toLowerCase()
282
- }
283
- }
284
- }
285
- </script>
286
-
287
- <style scoped></style>