@kengic/uni 0.3.2-beta.10

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 (166) hide show
  1. package/README.md +1 -0
  2. package/dist/index.css +1 -0
  3. package/dist/kengic-uni.js +5 -0
  4. package/dist/src/consts/i18n/en.d.ts +45 -0
  5. package/dist/src/consts/i18n/index.d.ts +90 -0
  6. package/dist/src/consts/i18n/zh_CN.d.ts +45 -0
  7. package/dist/src/consts/index.d.ts +1 -0
  8. package/dist/src/index.d.ts +2 -0
  9. package/dist/src/utils/index.d.ts +1 -0
  10. package/dist/src/utils/kg.util.d.ts +5 -0
  11. package/dist/uni-ui/index.ts +11 -0
  12. package/dist/uni-ui/uni-badge/uni-badge.vue +253 -0
  13. package/dist/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +41 -0
  14. package/dist/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +121 -0
  15. package/dist/uni-ui/uni-calendar/calendar.js +546 -0
  16. package/dist/uni-ui/uni-calendar/i18n/en.json +12 -0
  17. package/dist/uni-ui/uni-calendar/i18n/index.js +8 -0
  18. package/dist/uni-ui/uni-calendar/i18n/zh-Hans.json +12 -0
  19. package/dist/uni-ui/uni-calendar/i18n/zh-Hant.json +12 -0
  20. package/dist/uni-ui/uni-calendar/uni-calendar-item.vue +187 -0
  21. package/dist/uni-ui/uni-calendar/uni-calendar.vue +566 -0
  22. package/dist/uni-ui/uni-calendar/util.js +360 -0
  23. package/dist/uni-ui/uni-card/uni-card.vue +281 -0
  24. package/dist/uni-ui/uni-col/uni-col.vue +317 -0
  25. package/dist/uni-ui/uni-collapse/uni-collapse.vue +147 -0
  26. package/dist/uni-ui/uni-collapse-item/uni-collapse-item.vue +402 -0
  27. package/dist/uni-ui/uni-combox/uni-combox.vue +294 -0
  28. package/dist/uni-ui/uni-countdown/i18n/en.json +6 -0
  29. package/dist/uni-ui/uni-countdown/i18n/index.js +8 -0
  30. package/dist/uni-ui/uni-countdown/i18n/zh-Hans.json +6 -0
  31. package/dist/uni-ui/uni-countdown/i18n/zh-Hant.json +6 -0
  32. package/dist/uni-ui/uni-countdown/uni-countdown.vue +267 -0
  33. package/dist/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +821 -0
  34. package/dist/uni-ui/uni-data-picker/keypress.js +45 -0
  35. package/dist/uni-ui/uni-data-picker/uni-data-picker.vue +551 -0
  36. package/dist/uni-ui/uni-data-pickerview/uni-data-picker.js +622 -0
  37. package/dist/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +323 -0
  38. package/dist/uni-ui/uni-data-select/uni-data-select.vue +517 -0
  39. package/dist/uni-ui/uni-dateformat/date-format.js +200 -0
  40. package/dist/uni-ui/uni-dateformat/uni-dateformat.vue +88 -0
  41. package/dist/uni-ui/uni-datetime-picker/calendar-item.vue +177 -0
  42. package/dist/uni-ui/uni-datetime-picker/calendar.vue +928 -0
  43. package/dist/uni-ui/uni-datetime-picker/i18n/en.json +22 -0
  44. package/dist/uni-ui/uni-datetime-picker/i18n/index.js +8 -0
  45. package/dist/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +22 -0
  46. package/dist/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +22 -0
  47. package/dist/uni-ui/uni-datetime-picker/time-picker.vue +934 -0
  48. package/dist/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1026 -0
  49. package/dist/uni-ui/uni-datetime-picker/util.js +403 -0
  50. package/dist/uni-ui/uni-drawer/keypress.js +45 -0
  51. package/dist/uni-ui/uni-drawer/uni-drawer.vue +181 -0
  52. package/dist/uni-ui/uni-easyinput/common.js +56 -0
  53. package/dist/uni-ui/uni-easyinput/uni-easyinput.vue +660 -0
  54. package/dist/uni-ui/uni-fab/uni-fab.vue +491 -0
  55. package/dist/uni-ui/uni-fav/i18n/en.json +4 -0
  56. package/dist/uni-ui/uni-fav/i18n/index.js +8 -0
  57. package/dist/uni-ui/uni-fav/i18n/zh-Hans.json +4 -0
  58. package/dist/uni-ui/uni-fav/i18n/zh-Hant.json +4 -0
  59. package/dist/uni-ui/uni-fav/uni-fav.vue +161 -0
  60. package/dist/uni-ui/uni-file-picker/choose-and-upload-file.js +224 -0
  61. package/dist/uni-ui/uni-file-picker/uni-file-picker.vue +667 -0
  62. package/dist/uni-ui/uni-file-picker/upload-file.vue +325 -0
  63. package/dist/uni-ui/uni-file-picker/upload-image.vue +292 -0
  64. package/dist/uni-ui/uni-file-picker/utils.js +109 -0
  65. package/dist/uni-ui/uni-forms/uni-forms.vue +398 -0
  66. package/dist/uni-ui/uni-forms/utils.js +293 -0
  67. package/dist/uni-ui/uni-forms/validate.js +486 -0
  68. package/dist/uni-ui/uni-forms-item/uni-forms-item.vue +601 -0
  69. package/dist/uni-ui/uni-goods-nav/i18n/en.json +6 -0
  70. package/dist/uni-ui/uni-goods-nav/i18n/index.js +8 -0
  71. package/dist/uni-ui/uni-goods-nav/i18n/zh-Hans.json +6 -0
  72. package/dist/uni-ui/uni-goods-nav/i18n/zh-Hant.json +6 -0
  73. package/dist/uni-ui/uni-goods-nav/uni-goods-nav.vue +229 -0
  74. package/dist/uni-ui/uni-grid/uni-grid.vue +143 -0
  75. package/dist/uni-ui/uni-grid-item/uni-grid-item.vue +129 -0
  76. package/dist/uni-ui/uni-group/uni-group.vue +134 -0
  77. package/dist/uni-ui/uni-icons/icons.js +1169 -0
  78. package/dist/uni-ui/uni-icons/uni-icons.vue +96 -0
  79. package/dist/uni-ui/uni-icons/uniicons.css +663 -0
  80. package/dist/uni-ui/uni-icons/uniicons.ttf +0 -0
  81. package/dist/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +144 -0
  82. package/dist/uni-ui/uni-indexed-list/uni-indexed-list.vue +367 -0
  83. package/dist/uni-ui/uni-link/uni-link.vue +128 -0
  84. package/dist/uni-ui/uni-list/uni-list.vue +123 -0
  85. package/dist/uni-ui/uni-list/uni-refresh.vue +65 -0
  86. package/dist/uni-ui/uni-list/uni-refresh.wxs +87 -0
  87. package/dist/uni-ui/uni-list-ad/uni-list-ad.vue +107 -0
  88. package/dist/uni-ui/uni-list-chat/uni-list-chat.scss +58 -0
  89. package/dist/uni-ui/uni-list-chat/uni-list-chat.vue +593 -0
  90. package/dist/uni-ui/uni-list-item/uni-list-item.vue +534 -0
  91. package/dist/uni-ui/uni-load-more/i18n/en.json +5 -0
  92. package/dist/uni-ui/uni-load-more/i18n/index.js +8 -0
  93. package/dist/uni-ui/uni-load-more/i18n/zh-Hans.json +5 -0
  94. package/dist/uni-ui/uni-load-more/i18n/zh-Hant.json +5 -0
  95. package/dist/uni-ui/uni-load-more/uni-load-more.vue +399 -0
  96. package/dist/uni-ui/uni-nav-bar/uni-nav-bar.vue +357 -0
  97. package/dist/uni-ui/uni-nav-bar/uni-status-bar.vue +24 -0
  98. package/dist/uni-ui/uni-notice-bar/uni-notice-bar.vue +426 -0
  99. package/dist/uni-ui/uni-number-box/uni-number-box.vue +221 -0
  100. package/dist/uni-ui/uni-pagination/i18n/en.json +5 -0
  101. package/dist/uni-ui/uni-pagination/i18n/es.json +5 -0
  102. package/dist/uni-ui/uni-pagination/i18n/fr.json +5 -0
  103. package/dist/uni-ui/uni-pagination/i18n/index.js +12 -0
  104. package/dist/uni-ui/uni-pagination/i18n/zh-Hans.json +5 -0
  105. package/dist/uni-ui/uni-pagination/i18n/zh-Hant.json +5 -0
  106. package/dist/uni-ui/uni-pagination/uni-pagination.vue +465 -0
  107. package/dist/uni-ui/uni-popup/i18n/en.json +7 -0
  108. package/dist/uni-ui/uni-popup/i18n/index.js +9 -0
  109. package/dist/uni-ui/uni-popup/i18n/zh-Hans.json +7 -0
  110. package/dist/uni-ui/uni-popup/i18n/zh-Hant.json +7 -0
  111. package/dist/uni-ui/uni-popup/keypress.js +45 -0
  112. package/dist/uni-ui/uni-popup/popup.js +23 -0
  113. package/dist/uni-ui/uni-popup/uni-popup.vue +464 -0
  114. package/dist/uni-ui/uni-popup-dialog/keypress.js +45 -0
  115. package/dist/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +275 -0
  116. package/dist/uni-ui/uni-popup-message/uni-popup-message.vue +143 -0
  117. package/dist/uni-ui/uni-popup-share/uni-popup-share.vue +187 -0
  118. package/dist/uni-ui/uni-rate/uni-rate.vue +365 -0
  119. package/dist/uni-ui/uni-row/uni-row.vue +190 -0
  120. package/dist/uni-ui/uni-scss/changelog.md +8 -0
  121. package/dist/uni-ui/uni-scss/index.scss +1 -0
  122. package/dist/uni-ui/uni-scss/package.json +82 -0
  123. package/dist/uni-ui/uni-scss/readme.md +4 -0
  124. package/dist/uni-ui/uni-scss/styles/index.scss +7 -0
  125. package/dist/uni-ui/uni-scss/styles/setting/_border.scss +3 -0
  126. package/dist/uni-ui/uni-scss/styles/setting/_color.scss +66 -0
  127. package/dist/uni-ui/uni-scss/styles/setting/_radius.scss +55 -0
  128. package/dist/uni-ui/uni-scss/styles/setting/_space.scss +56 -0
  129. package/dist/uni-ui/uni-scss/styles/setting/_styles.scss +167 -0
  130. package/dist/uni-ui/uni-scss/styles/setting/_text.scss +24 -0
  131. package/dist/uni-ui/uni-scss/styles/setting/_variables.scss +146 -0
  132. package/dist/uni-ui/uni-scss/styles/tools/functions.scss +19 -0
  133. package/dist/uni-ui/uni-scss/theme.scss +31 -0
  134. package/dist/uni-ui/uni-scss/variables.scss +62 -0
  135. package/dist/uni-ui/uni-search-bar/i18n/en.json +4 -0
  136. package/dist/uni-ui/uni-search-bar/i18n/index.js +8 -0
  137. package/dist/uni-ui/uni-search-bar/i18n/zh-Hans.json +4 -0
  138. package/dist/uni-ui/uni-search-bar/i18n/zh-Hant.json +4 -0
  139. package/dist/uni-ui/uni-search-bar/uni-search-bar.vue +298 -0
  140. package/dist/uni-ui/uni-section/uni-section.vue +167 -0
  141. package/dist/uni-ui/uni-segmented-control/uni-segmented-control.vue +145 -0
  142. package/dist/uni-ui/uni-steps/uni-steps.vue +269 -0
  143. package/dist/uni-ui/uni-swipe-action/uni-swipe-action.vue +60 -0
  144. package/dist/uni-ui/uni-swipe-action-item/bindingx.js +302 -0
  145. package/dist/uni-ui/uni-swipe-action-item/isPC.js +12 -0
  146. package/dist/uni-ui/uni-swipe-action-item/mpalipay.js +195 -0
  147. package/dist/uni-ui/uni-swipe-action-item/mpother.js +260 -0
  148. package/dist/uni-ui/uni-swipe-action-item/mpwxs.js +84 -0
  149. package/dist/uni-ui/uni-swipe-action-item/render.js +270 -0
  150. package/dist/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +347 -0
  151. package/dist/uni-ui/uni-swipe-action-item/wx.wxs +341 -0
  152. package/dist/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +218 -0
  153. package/dist/uni-ui/uni-table/uni-table.vue +455 -0
  154. package/dist/uni-ui/uni-tag/uni-tag.vue +252 -0
  155. package/dist/uni-ui/uni-tbody/uni-tbody.vue +29 -0
  156. package/dist/uni-ui/uni-td/uni-td.vue +90 -0
  157. package/dist/uni-ui/uni-th/filter-dropdown.vue +511 -0
  158. package/dist/uni-ui/uni-th/uni-th.vue +285 -0
  159. package/dist/uni-ui/uni-thead/uni-thead.vue +129 -0
  160. package/dist/uni-ui/uni-title/uni-title.vue +171 -0
  161. package/dist/uni-ui/uni-tooltip/uni-tooltip.vue +68 -0
  162. package/dist/uni-ui/uni-tr/table-checkbox.vue +179 -0
  163. package/dist/uni-ui/uni-tr/uni-tr.vue +171 -0
  164. package/dist/uni-ui/uni-transition/createAnimation.js +131 -0
  165. package/dist/uni-ui/uni-transition/uni-transition.vue +281 -0
  166. package/package.json +90 -0
@@ -0,0 +1,455 @@
1
+ <template>
2
+ <view class="uni-table-scroll" :class="{ 'table--border': border, 'border-none': !noData }">
3
+ <!-- #ifdef H5 -->
4
+ <table class="uni-table" border="0" cellpadding="0" cellspacing="0" :class="{ 'table--stripe': stripe }" :style="{ 'min-width': minWidth + 'px' }">
5
+ <slot></slot>
6
+ <tr v-if="noData" class="uni-table-loading">
7
+ <td class="uni-table-text" :class="{ 'empty-border': border }">{{ emptyText }}</td>
8
+ </tr>
9
+ <view v-if="loading" class="uni-table-mask" :class="{ 'empty-border': border }"><div class="uni-table--loader"></div></view>
10
+ </table>
11
+ <!-- #endif -->
12
+ <!-- #ifndef H5 -->
13
+ <view class="uni-table" :style="{ 'min-width': minWidth + 'px' }" :class="{ 'table--stripe': stripe }">
14
+ <slot></slot>
15
+ <view v-if="noData" class="uni-table-loading">
16
+ <view class="uni-table-text" :class="{ 'empty-border': border }">{{ emptyText }}</view>
17
+ </view>
18
+ <view v-if="loading" class="uni-table-mask" :class="{ 'empty-border': border }"><div class="uni-table--loader"></div></view>
19
+ </view>
20
+ <!-- #endif -->
21
+ </view>
22
+ </template>
23
+
24
+ <script>
25
+ /**
26
+ * Table 表格
27
+ * @description 用于展示多条结构类似的数据
28
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=3270
29
+ * @property {Boolean} border 是否带有纵向边框
30
+ * @property {Boolean} stripe 是否显示斑马线
31
+ * @property {Boolean} type 是否开启多选
32
+ * @property {String} emptyText 空数据时显示的文本内容
33
+ * @property {Boolean} loading 显示加载中
34
+ * @event {Function} selection-change 开启多选时,当选择项发生变化时会触发该事件
35
+ */
36
+ export default {
37
+ name: 'uniTable',
38
+ options: {
39
+ virtualHost: true
40
+ },
41
+ emits:['selection-change'],
42
+ props: {
43
+ data: {
44
+ type: Array,
45
+ default() {
46
+ return []
47
+ }
48
+ },
49
+ // 是否有竖线
50
+ border: {
51
+ type: Boolean,
52
+ default: false
53
+ },
54
+ // 是否显示斑马线
55
+ stripe: {
56
+ type: Boolean,
57
+ default: false
58
+ },
59
+ // 多选
60
+ type: {
61
+ type: String,
62
+ default: ''
63
+ },
64
+ // 没有更多数据
65
+ emptyText: {
66
+ type: String,
67
+ default: '没有更多数据'
68
+ },
69
+ loading: {
70
+ type: Boolean,
71
+ default: false
72
+ },
73
+ rowKey: {
74
+ type: String,
75
+ default: ''
76
+ }
77
+ },
78
+ data() {
79
+ return {
80
+ noData: true,
81
+ minWidth: 0,
82
+ multiTableHeads: []
83
+ }
84
+ },
85
+ watch: {
86
+ loading(val) {},
87
+ data(newVal) {
88
+ let theadChildren = this.theadChildren
89
+ let rowspan = 1
90
+ if (this.theadChildren) {
91
+ rowspan = this.theadChildren.rowspan
92
+ }
93
+
94
+ // this.trChildren.length - rowspan
95
+ this.noData = false
96
+ // this.noData = newVal.length === 0
97
+ }
98
+ },
99
+ created() {
100
+ // 定义tr的实例数组
101
+ this.trChildren = []
102
+ this.thChildren = []
103
+ this.theadChildren = null
104
+ this.backData = []
105
+ this.backIndexData = []
106
+ },
107
+
108
+ methods: {
109
+ isNodata() {
110
+ let theadChildren = this.theadChildren
111
+ let rowspan = 1
112
+ if (this.theadChildren) {
113
+ rowspan = this.theadChildren.rowspan
114
+ }
115
+ this.noData = this.trChildren.length - rowspan <= 0
116
+ },
117
+ /**
118
+ * 选中所有
119
+ */
120
+ selectionAll() {
121
+ let startIndex = 1
122
+ let theadChildren = this.theadChildren
123
+ if (!this.theadChildren) {
124
+ theadChildren = this.trChildren[0]
125
+ } else {
126
+ startIndex = theadChildren.rowspan - 1
127
+ }
128
+ let isHaveData = this.data && this.data.length > 0
129
+ theadChildren.checked = true
130
+ theadChildren.indeterminate = false
131
+ this.trChildren.forEach((item, index) => {
132
+ if (!item.disabled) {
133
+ item.checked = true
134
+ if (isHaveData && item.keyValue) {
135
+ const row = this.data.find(v => v[this.rowKey] === item.keyValue)
136
+ if (!this.backData.find(v => v[this.rowKey] === row[this.rowKey])) {
137
+ this.backData.push(row)
138
+ }
139
+ }
140
+ if (index > (startIndex - 1) && this.backIndexData.indexOf(index - startIndex) === -1) {
141
+ this.backIndexData.push(index - startIndex)
142
+ }
143
+ }
144
+ })
145
+ // this.backData = JSON.parse(JSON.stringify(this.data))
146
+ this.$emit('selection-change', {
147
+ detail: {
148
+ value: this.backData,
149
+ index: this.backIndexData
150
+ }
151
+ })
152
+ },
153
+ /**
154
+ * 用于多选表格,切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中)
155
+ */
156
+ toggleRowSelection(row, selected) {
157
+ // if (!this.theadChildren) return
158
+ row = [].concat(row)
159
+
160
+ this.trChildren.forEach((item, index) => {
161
+ // if (item.keyValue) {
162
+
163
+ const select = row.findIndex(v => {
164
+ //
165
+ if (typeof v === 'number') {
166
+ return v === index - 1
167
+ } else {
168
+ return v[this.rowKey] === item.keyValue
169
+ }
170
+ })
171
+ let ischeck = item.checked
172
+ if (select !== -1) {
173
+ if (typeof selected === 'boolean') {
174
+ item.checked = selected
175
+ } else {
176
+ item.checked = !item.checked
177
+ }
178
+ if (ischeck !== item.checked) {
179
+ this.check(item.rowData||item, item.checked, item.rowData?item.keyValue:null, true)
180
+ }
181
+ }
182
+ // }
183
+ })
184
+ this.$emit('selection-change', {
185
+ detail: {
186
+ value: this.backData,
187
+ index:this.backIndexData
188
+ }
189
+ })
190
+ },
191
+
192
+ /**
193
+ * 用于多选表格,清空用户的选择
194
+ */
195
+ clearSelection() {
196
+ let theadChildren = this.theadChildren
197
+ if (!this.theadChildren) {
198
+ theadChildren = this.trChildren[0]
199
+ }
200
+ // if (!this.theadChildren) return
201
+ theadChildren.checked = false
202
+ theadChildren.indeterminate = false
203
+ this.trChildren.forEach(item => {
204
+ // if (item.keyValue) {
205
+ item.checked = false
206
+ // }
207
+ })
208
+ this.backData = []
209
+ this.backIndexData = []
210
+ this.$emit('selection-change', {
211
+ detail: {
212
+ value: [],
213
+ index: []
214
+ }
215
+ })
216
+ },
217
+ /**
218
+ * 用于多选表格,切换所有行的选中状态
219
+ */
220
+ toggleAllSelection() {
221
+ let list = []
222
+ let startIndex = 1
223
+ let theadChildren = this.theadChildren
224
+ if (!this.theadChildren) {
225
+ theadChildren = this.trChildren[0]
226
+ } else {
227
+ startIndex = theadChildren.rowspan - 1
228
+ }
229
+ this.trChildren.forEach((item, index) => {
230
+ if (!item.disabled) {
231
+ if (index > (startIndex - 1) ) {
232
+ list.push(index-startIndex)
233
+ }
234
+ }
235
+ })
236
+ this.toggleRowSelection(list)
237
+ },
238
+
239
+ /**
240
+ * 选中\取消选中
241
+ * @param {Object} child
242
+ * @param {Object} check
243
+ * @param {Object} rowValue
244
+ */
245
+ check(child, check, keyValue, emit) {
246
+ let theadChildren = this.theadChildren
247
+ if (!this.theadChildren) {
248
+ theadChildren = this.trChildren[0]
249
+ }
250
+
251
+
252
+
253
+ let childDomIndex = this.trChildren.findIndex((item, index) => child === item)
254
+ if(childDomIndex < 0){
255
+ childDomIndex = this.data.findIndex(v=>v[this.rowKey] === keyValue) + 1
256
+ }
257
+ const dataLen = this.trChildren.filter(v => !v.disabled && v.keyValue).length
258
+ if (childDomIndex === 0) {
259
+ check ? this.selectionAll() : this.clearSelection()
260
+ return
261
+ }
262
+
263
+ if (check) {
264
+ if (keyValue) {
265
+ this.backData.push(child)
266
+ }
267
+ this.backIndexData.push(childDomIndex - 1)
268
+ } else {
269
+ const index = this.backData.findIndex(v => v[this.rowKey] === keyValue)
270
+ const idx = this.backIndexData.findIndex(item => item === childDomIndex - 1)
271
+ if (keyValue) {
272
+ this.backData.splice(index, 1)
273
+ }
274
+ this.backIndexData.splice(idx, 1)
275
+ }
276
+
277
+ const domCheckAll = this.trChildren.find((item, index) => index > 0 && !item.checked && !item.disabled)
278
+ if (!domCheckAll) {
279
+ theadChildren.indeterminate = false
280
+ theadChildren.checked = true
281
+ } else {
282
+ theadChildren.indeterminate = true
283
+ theadChildren.checked = false
284
+ }
285
+
286
+ if (this.backIndexData.length === 0) {
287
+ theadChildren.indeterminate = false
288
+ }
289
+
290
+ if (!emit) {
291
+ this.$emit('selection-change', {
292
+ detail: {
293
+ value: this.backData,
294
+ index: this.backIndexData
295
+ }
296
+ })
297
+ }
298
+ }
299
+ }
300
+ }
301
+ </script>
302
+
303
+ <style lang="scss">
304
+ $border-color: #ebeef5;
305
+
306
+ .uni-table-scroll {
307
+ width: 100%;
308
+ /* #ifndef APP-NVUE */
309
+ overflow-x: auto;
310
+ /* #endif */
311
+ }
312
+
313
+ .uni-table {
314
+ position: relative;
315
+ width: 100%;
316
+ border-radius: 5px;
317
+ // box-shadow: 0px 0px 3px 1px rgba(0, 0, 0, 0.1);
318
+ background-color: #fff;
319
+ /* #ifndef APP-NVUE */
320
+ box-sizing: border-box;
321
+ display: table;
322
+ overflow-x: auto;
323
+ ::v-deep .uni-table-tr:nth-child(n + 2) {
324
+ &:hover {
325
+ background-color: #f5f7fa;
326
+ }
327
+ }
328
+ ::v-deep .uni-table-thead {
329
+ .uni-table-tr {
330
+ // background-color: #f5f7fa;
331
+ &:hover {
332
+ background-color:#fafafa;
333
+ }
334
+ }
335
+ }
336
+ /* #endif */
337
+ }
338
+
339
+ .table--border {
340
+ border: 1px $border-color solid;
341
+ border-right: none;
342
+ }
343
+
344
+ .border-none {
345
+ /* #ifndef APP-NVUE */
346
+ border-bottom: none;
347
+ /* #endif */
348
+ }
349
+
350
+ .table--stripe {
351
+ /* #ifndef APP-NVUE */
352
+ ::v-deep .uni-table-tr:nth-child(2n + 3) {
353
+ background-color: #fafafa;
354
+ }
355
+ /* #endif */
356
+ }
357
+
358
+ /* 表格加载、无数据样式 */
359
+ .uni-table-loading {
360
+ position: relative;
361
+ /* #ifndef APP-NVUE */
362
+ display: table-row;
363
+ /* #endif */
364
+ height: 50px;
365
+ line-height: 50px;
366
+ overflow: hidden;
367
+ box-sizing: border-box;
368
+ }
369
+ .empty-border {
370
+ border-right: 1px $border-color solid;
371
+ }
372
+ .uni-table-text {
373
+ position: absolute;
374
+ right: 0;
375
+ left: 0;
376
+ text-align: center;
377
+ font-size: 14px;
378
+ color: #999;
379
+ }
380
+
381
+ .uni-table-mask {
382
+ position: absolute;
383
+ top: 0;
384
+ bottom: 0;
385
+ left: 0;
386
+ right: 0;
387
+ background-color: rgba(255, 255, 255, 0.8);
388
+ z-index: 99;
389
+ /* #ifndef APP-NVUE */
390
+ display: flex;
391
+ margin: auto;
392
+ transition: all 0.5s;
393
+ /* #endif */
394
+ justify-content: center;
395
+ align-items: center;
396
+ }
397
+
398
+ .uni-table--loader {
399
+ width: 30px;
400
+ height: 30px;
401
+ border: 2px solid #aaa;
402
+ // border-bottom-color: transparent;
403
+ border-radius: 50%;
404
+ /* #ifndef APP-NVUE */
405
+ animation: 2s uni-table--loader linear infinite;
406
+ /* #endif */
407
+ position: relative;
408
+ }
409
+
410
+ @keyframes uni-table--loader {
411
+ 0% {
412
+ transform: rotate(360deg);
413
+ }
414
+
415
+ 10% {
416
+ border-left-color: transparent;
417
+ }
418
+
419
+ 20% {
420
+ border-bottom-color: transparent;
421
+ }
422
+
423
+ 30% {
424
+ border-right-color: transparent;
425
+ }
426
+
427
+ 40% {
428
+ border-top-color: transparent;
429
+ }
430
+
431
+ 50% {
432
+ transform: rotate(0deg);
433
+ }
434
+
435
+ 60% {
436
+ border-top-color: transparent;
437
+ }
438
+
439
+ 70% {
440
+ border-left-color: transparent;
441
+ }
442
+
443
+ 80% {
444
+ border-bottom-color: transparent;
445
+ }
446
+
447
+ 90% {
448
+ border-right-color: transparent;
449
+ }
450
+
451
+ 100% {
452
+ transform: rotate(-360deg);
453
+ }
454
+ }
455
+ </style>
@@ -0,0 +1,252 @@
1
+ <template>
2
+ <text class="uni-tag" v-if="text" :class="classes" :style="customStyle" @click="onClick">{{text}}</text>
3
+ </template>
4
+
5
+ <script>
6
+ /**
7
+ * Tag 标签
8
+ * @description 用于展示1个或多个文字标签,可点击切换选中、不选中的状态
9
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=35
10
+ * @property {String} text 标签内容
11
+ * @property {String} size = [default|small|mini] 大小尺寸
12
+ * @value default 正常
13
+ * @value small 小尺寸
14
+ * @value mini 迷你尺寸
15
+ * @property {String} type = [default|primary|success|warning|error] 颜色类型
16
+ * @value default 灰色
17
+ * @value primary 蓝色
18
+ * @value success 绿色
19
+ * @value warning 黄色
20
+ * @value error 红色
21
+ * @property {Boolean} disabled = [true|false] 是否为禁用状态
22
+ * @property {Boolean} inverted = [true|false] 是否无需背景颜色(空心标签)
23
+ * @property {Boolean} circle = [true|false] 是否为圆角
24
+ * @event {Function} click 点击 Tag 触发事件
25
+ */
26
+
27
+ export default {
28
+ name: "UniTag",
29
+ emits: ['click'],
30
+ props: {
31
+ type: {
32
+ // 标签类型default、primary、success、warning、error、royal
33
+ type: String,
34
+ default: "default"
35
+ },
36
+ size: {
37
+ // 标签大小 normal, small
38
+ type: String,
39
+ default: "normal"
40
+ },
41
+ // 标签内容
42
+ text: {
43
+ type: String,
44
+ default: ""
45
+ },
46
+ disabled: {
47
+ // 是否为禁用状态
48
+ type: [Boolean, String],
49
+ default: false
50
+ },
51
+ inverted: {
52
+ // 是否为空心
53
+ type: [Boolean, String],
54
+ default: false
55
+ },
56
+ circle: {
57
+ // 是否为圆角样式
58
+ type: [Boolean, String],
59
+ default: false
60
+ },
61
+ mark: {
62
+ // 是否为标记样式
63
+ type: [Boolean, String],
64
+ default: false
65
+ },
66
+ customStyle: {
67
+ type: String,
68
+ default: ''
69
+ }
70
+ },
71
+ computed: {
72
+ classes() {
73
+ const {
74
+ type,
75
+ disabled,
76
+ inverted,
77
+ circle,
78
+ mark,
79
+ size,
80
+ isTrue
81
+ } = this
82
+ const classArr = [
83
+ 'uni-tag--' + type,
84
+ 'uni-tag--' + size,
85
+ isTrue(disabled) ? 'uni-tag--disabled' : '',
86
+ isTrue(inverted) ? 'uni-tag--' + type + '--inverted' : '',
87
+ isTrue(circle) ? 'uni-tag--circle' : '',
88
+ isTrue(mark) ? 'uni-tag--mark' : '',
89
+ // type === 'default' ? 'uni-tag--default' : 'uni-tag-text',
90
+ isTrue(inverted) ? 'uni-tag--inverted uni-tag-text--' + type : '',
91
+ size === 'small' ? 'uni-tag-text--small' : ''
92
+ ]
93
+ // 返回类的字符串,兼容字节小程序
94
+ return classArr.join(' ')
95
+ }
96
+ },
97
+ methods: {
98
+ isTrue(value) {
99
+ return value === true || value === 'true'
100
+ },
101
+ onClick() {
102
+ if (this.isTrue(this.disabled)) return
103
+ this.$emit("click");
104
+ }
105
+ }
106
+ };
107
+ </script>
108
+
109
+ <style lang="scss">
110
+ $uni-primary: #2979ff !default;
111
+ $uni-success: #18bc37 !default;
112
+ $uni-warning: #f3a73f !default;
113
+ $uni-error: #e43d33 !default;
114
+ $uni-info: #8f939c !default;
115
+
116
+
117
+ $tag-default-pd: 4px 7px;
118
+ $tag-small-pd: 2px 5px;
119
+ $tag-mini-pd: 1px 3px;
120
+
121
+ .uni-tag {
122
+ line-height: 14px;
123
+ font-size: 12px;
124
+ font-weight: 200;
125
+ padding: $tag-default-pd;
126
+ color: #fff;
127
+ border-radius: 3px;
128
+ background-color: $uni-info;
129
+ border-width: 1rpx;
130
+ border-style: solid;
131
+ border-color: $uni-info;
132
+ /* #ifdef H5 */
133
+ cursor: pointer;
134
+ /* #endif */
135
+
136
+ // size attr
137
+ &--default {
138
+ font-size: 12px;
139
+ }
140
+
141
+ &--default--inverted {
142
+ color: $uni-info;
143
+ border-color: $uni-info;
144
+ }
145
+
146
+ &--small {
147
+ padding: $tag-small-pd;
148
+ font-size: 12px;
149
+ border-radius: 2px;
150
+ }
151
+
152
+ &--mini {
153
+ padding: $tag-mini-pd;
154
+ font-size: 12px;
155
+ border-radius: 2px;
156
+ }
157
+
158
+ // type attr
159
+ &--primary {
160
+ background-color: $uni-primary;
161
+ border-color: $uni-primary;
162
+ color: #fff;
163
+ }
164
+
165
+ &--success {
166
+ color: #fff;
167
+ background-color: $uni-success;
168
+ border-color: $uni-success;
169
+ }
170
+
171
+ &--warning {
172
+ color: #fff;
173
+ background-color: $uni-warning;
174
+ border-color: $uni-warning;
175
+ }
176
+
177
+ &--error {
178
+ color: #fff;
179
+ background-color: $uni-error;
180
+ border-color: $uni-error;
181
+ }
182
+
183
+ &--primary--inverted {
184
+ color: $uni-primary;
185
+ border-color: $uni-primary;
186
+ }
187
+
188
+ &--success--inverted {
189
+ color: $uni-success;
190
+ border-color: $uni-success;
191
+ }
192
+
193
+ &--warning--inverted {
194
+ color: $uni-warning;
195
+ border-color: $uni-warning;
196
+ }
197
+
198
+ &--error--inverted {
199
+ color: $uni-error;
200
+ border-color: $uni-error;
201
+ }
202
+
203
+ &--inverted {
204
+ background-color: #fff;
205
+ }
206
+
207
+ // other attr
208
+ &--circle {
209
+ border-radius: 15px !important;
210
+ }
211
+
212
+ &--mark {
213
+ border-top-left-radius: 0 !important;
214
+ border-bottom-left-radius: 0 !important;
215
+ border-top-right-radius: 15px !important;
216
+ border-bottom-right-radius: 15px !important;
217
+ }
218
+
219
+ &--disabled {
220
+ opacity: 0.5;
221
+ /* #ifdef H5 */
222
+ cursor: not-allowed;
223
+ /* #endif */
224
+ }
225
+ }
226
+
227
+
228
+ .uni-tag-text {
229
+ color: #fff;
230
+ font-size: 14px;
231
+
232
+ &--primary {
233
+ color: $uni-primary;
234
+ }
235
+
236
+ &--success {
237
+ color: $uni-success;
238
+ }
239
+
240
+ &--warning {
241
+ color: $uni-warning;
242
+ }
243
+
244
+ &--error {
245
+ color: $uni-error;
246
+ }
247
+
248
+ &--small {
249
+ font-size: 12px;
250
+ }
251
+ }
252
+ </style>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <!-- #ifdef H5 -->
3
+ <tbody>
4
+ <slot></slot>
5
+ </tbody>
6
+ <!-- #endif -->
7
+ <!-- #ifndef H5 -->
8
+ <view><slot></slot></view>
9
+ <!-- #endif -->
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: 'uniBody',
15
+ options: {
16
+ virtualHost: true
17
+ },
18
+ data() {
19
+ return {
20
+
21
+ }
22
+ },
23
+ created() {},
24
+ methods: {}
25
+ }
26
+ </script>
27
+
28
+ <style>
29
+ </style>