@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,179 @@
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>
10
+ </template>
11
+
12
+ <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
+ }
77
+ </script>
78
+
79
+ <style lang="scss">
80
+ $uni-primary: #007aff !default;
81
+ $border-color: #DCDFE6;
82
+ $disable:0.4;
83
+
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;
92
+
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;
106
+
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
+ }
126
+
127
+ &.checkbox--indeterminate {
128
+ border-color: $uni-primary;
129
+ background-color: $uni-primary;
130
+
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
+ }
160
+
161
+ // 选中
162
+ &.is-checked {
163
+ border-color: $uni-primary;
164
+ background-color: $uni-primary;
165
+
166
+ .checkbox__inner-icon {
167
+ opacity: 1;
168
+ transform: rotate(45deg);
169
+ }
170
+
171
+ // 选中禁用
172
+ &.is-disable {
173
+ opacity: $disable;
174
+ }
175
+ }
176
+
177
+ }
178
+ }
179
+ </style>
@@ -0,0 +1,171 @@
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: { tableCheckbox },
31
+ props: {
32
+ disabled: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ keyValue: {
37
+ type: [String, Number],
38
+ default: ''
39
+ }
40
+ },
41
+ options: {
42
+ virtualHost: true
43
+ },
44
+ data() {
45
+ return {
46
+ value: false,
47
+ border: false,
48
+ selection: false,
49
+ widthThArr: [],
50
+ ishead: true,
51
+ checked: false,
52
+ indeterminate:false
53
+ }
54
+ },
55
+ created() {
56
+ this.root = this.getTable()
57
+ this.head = this.getTable('uniThead')
58
+ if (this.head) {
59
+ this.ishead = false
60
+ this.head.init(this)
61
+ }
62
+ this.border = this.root.border
63
+ this.selection = this.root.type
64
+ this.root.trChildren.push(this)
65
+ const rowData = this.root.data.find(v => v[this.root.rowKey] === this.keyValue)
66
+ if(rowData){
67
+ this.rowData = rowData
68
+ }
69
+ this.root.isNodata()
70
+ },
71
+ mounted() {
72
+ if (this.widthThArr.length > 0) {
73
+ const selectionWidth = this.selection === 'selection' ? 50 : 0
74
+ this.root.minWidth = this.widthThArr.reduce((a, b) => Number(a) + Number(b)) + selectionWidth
75
+ }
76
+ },
77
+ // #ifndef VUE3
78
+ destroyed() {
79
+ const index = this.root.trChildren.findIndex(i => i === this)
80
+ this.root.trChildren.splice(index, 1)
81
+ this.root.isNodata()
82
+ },
83
+ // #endif
84
+ // #ifdef VUE3
85
+ unmounted() {
86
+ const index = this.root.trChildren.findIndex(i => i === this)
87
+ this.root.trChildren.splice(index, 1)
88
+ this.root.isNodata()
89
+ },
90
+ // #endif
91
+ methods: {
92
+ minWidthUpdate(width) {
93
+ this.widthThArr.push(width)
94
+ },
95
+ // 选中
96
+ checkboxSelected(e) {
97
+ let rootData = this.root.data.find(v => v[this.root.rowKey] === this.keyValue)
98
+ this.checked = e.checked
99
+ this.root.check(rootData||this, e.checked,rootData? this.keyValue:null)
100
+ },
101
+ change(e) {
102
+ this.root.trChildren.forEach(item => {
103
+ if (item === this) {
104
+ this.root.check(this, e.detail.value.length > 0 ? true : false)
105
+ }
106
+ })
107
+ },
108
+ /**
109
+ * 获取父元素实例
110
+ */
111
+ getTable(name = 'uniTable') {
112
+ let parent = this.$parent
113
+ let parentName = parent.$options.name
114
+ while (parentName !== name) {
115
+ parent = parent.$parent
116
+ if (!parent) return false
117
+ parentName = parent.$options.name
118
+ }
119
+ return parent
120
+ }
121
+ }
122
+ }
123
+ </script>
124
+
125
+ <style lang="scss">
126
+ $border-color: #ebeef5;
127
+
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 $border-color solid;
147
+ font-size: 14px;
148
+ // text-align: center;
149
+ }
150
+
151
+ .tr-table--border {
152
+ border-right: 1px $border-color solid;
153
+ }
154
+
155
+ /* #ifndef APP-NVUE */
156
+ .uni-table-tr {
157
+ ::v-deep .uni-table-th {
158
+ &.table--border:last-child {
159
+ // border-right: none;
160
+ }
161
+ }
162
+
163
+ ::v-deep .uni-table-td {
164
+ &.table--border:last-child {
165
+ // border-right: none;
166
+ }
167
+ }
168
+ }
169
+
170
+ /* #endif */
171
+ </style>
@@ -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
+ }