@kengic/uni 0.5.1 → 0.5.2-beta.1

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 (146) hide show
  1. package/dist/uni/uni-ui/uni-badge/uni-badge.vue +222 -219
  2. package/dist/uni/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +29 -29
  3. package/dist/uni/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +88 -88
  4. package/dist/uni/uni-ui/uni-calendar/calendar.js +936 -532
  5. package/dist/uni/uni-ui/uni-calendar/i18n/en.json +10 -10
  6. package/dist/uni/uni-ui/uni-calendar/i18n/index.js +8 -7
  7. package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hans.json +10 -10
  8. package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hant.json +10 -10
  9. package/dist/uni/uni-ui/uni-calendar/uni-calendar-item.vue +190 -168
  10. package/dist/uni/uni-ui/uni-calendar/uni-calendar.vue +459 -459
  11. package/dist/uni/uni-ui/uni-calendar/util.js +324 -340
  12. package/dist/uni/uni-ui/uni-card/uni-card.vue +8 -1
  13. package/dist/uni/uni-ui/uni-col/uni-col.vue +294 -287
  14. package/dist/uni/uni-ui/uni-collapse/uni-collapse.vue +139 -140
  15. package/dist/uni/uni-ui/uni-collapse-item/uni-collapse-item.vue +381 -378
  16. package/dist/uni/uni-ui/uni-combox/uni-combox.vue +280 -272
  17. package/dist/uni/uni-ui/uni-countdown/i18n/en.json +4 -4
  18. package/dist/uni/uni-ui/uni-countdown/i18n/index.js +8 -7
  19. package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hans.json +4 -4
  20. package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hant.json +4 -4
  21. package/dist/uni/uni-ui/uni-countdown/uni-countdown.vue +249 -257
  22. package/dist/uni/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +832 -813
  23. package/dist/uni/uni-ui/uni-data-picker/keypress.js +42 -42
  24. package/dist/uni/uni-ui/uni-data-picker/uni-data-picker.vue +535 -516
  25. package/dist/uni/uni-ui/uni-data-pickerview/uni-data-picker.js +623 -618
  26. package/dist/uni/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +293 -288
  27. package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +495 -509
  28. package/dist/uni/uni-ui/uni-dateformat/date-format.js +181 -184
  29. package/dist/uni/uni-ui/uni-dateformat/uni-dateformat.vue +81 -82
  30. package/dist/uni/uni-ui/uni-datetime-picker/calendar-item.vue +176 -170
  31. package/dist/uni/uni-ui/uni-datetime-picker/calendar.vue +926 -920
  32. package/dist/uni/uni-ui/uni-datetime-picker/i18n/en.json +20 -20
  33. package/dist/uni/uni-ui/uni-datetime-picker/i18n/index.js +8 -7
  34. package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +21 -21
  35. package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +21 -21
  36. package/dist/uni/uni-ui/uni-datetime-picker/time-picker.vue +921 -926
  37. package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1059 -1012
  38. package/dist/uni/uni-ui/uni-datetime-picker/util.js +366 -377
  39. package/dist/uni/uni-ui/uni-drawer/keypress.js +42 -42
  40. package/dist/uni/uni-ui/uni-drawer/uni-drawer.vue +176 -167
  41. package/dist/uni/uni-ui/uni-easyinput/common.js +40 -42
  42. package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +628 -547
  43. package/dist/uni/uni-ui/uni-fab/uni-fab.vue +507 -483
  44. package/dist/uni/uni-ui/uni-fav/i18n/en.json +2 -2
  45. package/dist/uni/uni-ui/uni-fav/i18n/index.js +8 -7
  46. package/dist/uni/uni-ui/uni-fav/i18n/zh-Hans.json +2 -2
  47. package/dist/uni/uni-ui/uni-fav/i18n/zh-Hant.json +2 -2
  48. package/dist/uni/uni-ui/uni-fav/uni-fav.vue +155 -147
  49. package/dist/uni/uni-ui/uni-file-picker/choose-and-upload-file.js +172 -198
  50. package/dist/uni/uni-ui/uni-file-picker/uni-file-picker.vue +636 -634
  51. package/dist/uni/uni-ui/uni-file-picker/upload-file.vue +294 -293
  52. package/dist/uni/uni-ui/uni-file-picker/upload-image.vue +267 -270
  53. package/dist/uni/uni-ui/uni-file-picker/utils.js +81 -82
  54. package/dist/uni/uni-ui/uni-forms/uni-forms.vue +360 -372
  55. package/dist/uni/uni-ui/uni-forms/utils.js +170 -174
  56. package/dist/uni/uni-ui/uni-forms/validate.js +447 -456
  57. package/dist/uni/uni-ui/uni-forms-item/uni-forms-item.vue +497 -497
  58. package/dist/uni/uni-ui/uni-goods-nav/i18n/en.json +4 -4
  59. package/dist/uni/uni-ui/uni-goods-nav/i18n/index.js +8 -7
  60. package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hans.json +4 -4
  61. package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hant.json +4 -4
  62. package/dist/uni/uni-ui/uni-goods-nav/uni-goods-nav.vue +238 -222
  63. package/dist/uni/uni-ui/uni-grid/uni-grid.vue +134 -134
  64. package/dist/uni/uni-ui/uni-grid-item/uni-grid-item.vue +121 -119
  65. package/dist/uni/uni-ui/uni-group/uni-group.vue +121 -121
  66. package/dist/uni/uni-ui/uni-icons/icons.js +1170 -1168
  67. package/dist/uni/uni-ui/uni-icons/uni-icons.vue +91 -86
  68. package/dist/uni/uni-ui/uni-icons/uniicons.css +166 -166
  69. package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +129 -129
  70. package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list.vue +352 -347
  71. package/dist/uni/uni-ui/uni-link/uni-link.vue +134 -119
  72. package/dist/uni/uni-ui/uni-list/uni-list.vue +119 -110
  73. package/dist/uni/uni-ui/uni-list/uni-refresh.vue +14 -14
  74. package/dist/uni/uni-ui/uni-list/uni-refresh.wxs +14 -14
  75. package/dist/uni/uni-ui/uni-list-ad/uni-list-ad.vue +101 -95
  76. package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.scss +18 -18
  77. package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.vue +602 -586
  78. package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
  79. package/dist/uni/uni-ui/uni-load-more/i18n/en.json +3 -3
  80. package/dist/uni/uni-ui/uni-load-more/i18n/index.js +8 -7
  81. package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hans.json +3 -3
  82. package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hant.json +3 -3
  83. package/dist/uni/uni-ui/uni-load-more/uni-load-more.vue +402 -392
  84. package/dist/uni/uni-ui/uni-nav-bar/uni-nav-bar.vue +328 -330
  85. package/dist/uni/uni-ui/uni-nav-bar/uni-status-bar.vue +17 -17
  86. package/dist/uni/uni-ui/uni-notice-bar/uni-notice-bar.vue +422 -401
  87. package/dist/uni/uni-ui/uni-number-box/uni-number-box.vue +211 -205
  88. package/dist/uni/uni-ui/uni-pagination/i18n/en.json +3 -3
  89. package/dist/uni/uni-ui/uni-pagination/i18n/es.json +3 -3
  90. package/dist/uni/uni-ui/uni-pagination/i18n/fr.json +3 -3
  91. package/dist/uni/uni-ui/uni-pagination/i18n/index.js +12 -11
  92. package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hans.json +3 -3
  93. package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hant.json +3 -3
  94. package/dist/uni/uni-ui/uni-pagination/uni-pagination.vue +450 -433
  95. package/dist/uni/uni-ui/uni-popup/uni-popup.vue +404 -404
  96. package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
  97. package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +1 -0
  98. package/dist/uni/uni-ui/uni-popup-message/uni-popup-message.vue +126 -125
  99. package/dist/uni/uni-ui/uni-popup-share/uni-popup-share.vue +172 -172
  100. package/dist/uni/uni-ui/uni-rate/uni-rate.vue +343 -347
  101. package/dist/uni/uni-ui/uni-row/uni-row.vue +180 -182
  102. package/dist/uni/uni-ui/uni-scss/changelog.md +11 -4
  103. package/dist/uni/uni-ui/uni-scss/package.json +73 -73
  104. package/dist/uni/uni-ui/uni-scss/readme.md +2 -1
  105. package/dist/uni/uni-ui/uni-scss/styles/setting/_border.scss +2 -2
  106. package/dist/uni/uni-ui/uni-scss/styles/setting/_color.scss +46 -47
  107. package/dist/uni/uni-ui/uni-scss/styles/setting/_radius.scss +49 -49
  108. package/dist/uni/uni-ui/uni-scss/styles/setting/_space.scss +52 -53
  109. package/dist/uni/uni-ui/uni-scss/styles/setting/_styles.scss +142 -147
  110. package/dist/uni/uni-ui/uni-scss/styles/setting/_text.scss +20 -20
  111. package/dist/uni/uni-ui/uni-scss/styles/setting/_variables.scss +111 -95
  112. package/dist/uni/uni-ui/uni-scss/styles/tools/functions.scss +28 -18
  113. package/dist/uni/uni-ui/uni-scss/theme.scss +10 -7
  114. package/dist/uni/uni-ui/uni-scss/variables.scss +42 -24
  115. package/dist/uni/uni-ui/uni-search-bar/i18n/en.json +3 -3
  116. package/dist/uni/uni-ui/uni-search-bar/i18n/index.js +8 -7
  117. package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hans.json +2 -2
  118. package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hant.json +2 -2
  119. package/dist/uni/uni-ui/uni-search-bar/uni-search-bar.vue +290 -281
  120. package/dist/uni/uni-ui/uni-section/uni-section.vue +149 -146
  121. package/dist/uni/uni-ui/uni-segmented-control/uni-segmented-control.vue +141 -131
  122. package/dist/uni/uni-ui/uni-steps/uni-steps.vue +255 -236
  123. package/dist/uni/uni-ui/uni-swipe-action/uni-swipe-action.vue +51 -51
  124. package/dist/uni/uni-ui/uni-swipe-action-item/bindingx.js +276 -282
  125. package/dist/uni/uni-ui/uni-swipe-action-item/isPC.js +10 -10
  126. package/dist/uni/uni-ui/uni-swipe-action-item/mpalipay.js +182 -187
  127. package/dist/uni/uni-ui/uni-swipe-action-item/mpother.js +235 -244
  128. package/dist/uni/uni-ui/uni-swipe-action-item/mpwxs.js +70 -75
  129. package/dist/uni/uni-ui/uni-swipe-action-item/render.js +238 -247
  130. package/dist/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +387 -313
  131. package/dist/uni/uni-ui/uni-swipe-action-item/wx.wxs +206 -215
  132. package/dist/uni/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +241 -197
  133. package/dist/uni/uni-ui/uni-table/uni-table.vue +445 -447
  134. package/dist/uni/uni-ui/uni-tag/uni-tag.vue +234 -244
  135. package/dist/uni/uni-ui/uni-tbody/uni-tbody.vue +20 -23
  136. package/dist/uni/uni-ui/uni-td/uni-td.vue +79 -80
  137. package/dist/uni/uni-ui/uni-th/filter-dropdown.vue +510 -503
  138. package/dist/uni/uni-ui/uni-th/uni-th.vue +289 -273
  139. package/dist/uni/uni-ui/uni-thead/uni-thead.vue +115 -114
  140. package/dist/uni/uni-ui/uni-title/uni-title.vue +151 -154
  141. package/dist/uni/uni-ui/uni-tooltip/uni-tooltip.vue +55 -60
  142. package/dist/uni/uni-ui/uni-tr/table-checkbox.vue +162 -163
  143. package/dist/uni/uni-ui/uni-tr/uni-tr.vue +158 -157
  144. package/dist/uni/uni-ui/uni-transition/createAnimation.js +130 -113
  145. package/dist/uni/uni-ui/uni-transition/uni-transition.vue +274 -272
  146. package/package.json +1 -1
@@ -1,347 +1,421 @@
1
1
  <template>
2
- <!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
3
- <!-- #ifdef APP-VUE || MP-WEIXIN || H5 -->
4
- <view class="uni-swipe">
5
- <!-- #ifdef MP-WEIXIN || VUE3 -->
6
- <view class="uni-swipe_box" :change:prop="wxsswipe.showWatch" :prop="is_show" :data-threshold="threshold"
7
- :data-disabled="disabled" @touchstart="wxsswipe.touchstart" @touchmove="wxsswipe.touchmove"
8
- @touchend="wxsswipe.touchend">
9
- <!-- #endif -->
10
- <!-- #ifndef MP-WEIXIN || VUE3 -->
11
- <view class="uni-swipe_box" :change:prop="renderswipe.showWatch" :prop="is_show" :data-threshold="threshold"
12
- :data-disabled="disabled+''" @touchstart="renderswipe.touchstart" @touchmove="renderswipe.touchmove"
13
- @touchend="renderswipe.touchend">
14
- <!-- #endif -->
15
- <!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
16
- <view class="uni-swipe_button-group button-group--left">
17
- <slot name="left">
18
- <view v-for="(item,index) in leftOptions" :key="index" :style="{
19
- backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
20
- }" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
21
- @touchend="appTouchEnd($event,index,item,'left')"
22
- @click.stop="onClickForPC(index,item,'left')">
23
- <text class="uni-swipe_button-text"
24
- :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
25
- </view>
26
- </slot>
27
- </view>
28
- <view class="uni-swipe_text--center">
29
- <slot></slot>
30
- </view>
31
- <view class="uni-swipe_button-group button-group--right">
32
- <slot name="right">
33
- <view v-for="(item,index) in rightOptions" :key="index" :style="{
34
- backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
35
- }" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
36
- @touchend="appTouchEnd($event,index,item,'right')"
37
- @click.stop="onClickForPC(index,item,'right')"><text class="uni-swipe_button-text"
38
- :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
39
- </view>
40
- </slot>
41
- </view>
42
- </view>
43
- </view>
44
- <!-- #endif -->
45
- <!-- app nvue端 使用 bindingx -->
46
- <!-- #ifdef APP-NVUE -->
47
- <view ref="selector-box--hock" class="uni-swipe" @horizontalpan="touchstart" @touchend="touchend">
48
- <view ref='selector-left-button--hock' class="uni-swipe_button-group button-group--left">
49
- <slot name="left">
50
- <view v-for="(item,index) in leftOptions" :key="index" :style="{
51
- backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
52
- }" class="uni-swipe_button button-hock" @click.stop="onClick(index,item,'left')"><text
53
- class="uni-swipe_button-text"
54
- :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF', fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
55
- </view>
56
- </slot>
57
- </view>
58
- <view ref='selector-right-button--hock' class="uni-swipe_button-group button-group--right">
59
- <slot name="right">
60
- <view v-for="(item,index) in rightOptions" :key="index" :style="{
61
- backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
62
- }" class="uni-swipe_button button-hock" @click.stop="onClick(index,item,'right')"><text
63
- class="uni-swipe_button-text"
64
- :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
65
- </view>
66
- </slot>
67
- </view>
68
- <view ref='selector-content--hock' class="uni-swipe_box">
69
- <slot></slot>
70
- </view>
71
- </view>
72
- <!-- #endif -->
73
- <!-- 其他平台使用 js ,长列表性能可能会有影响-->
74
- <!-- #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || MP-QQ -->
75
- <view class="uni-swipe">
76
- <view class="uni-swipe_box" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend"
77
- :style="{transform:moveLeft}" :class="{ani:ani}">
78
- <view class="uni-swipe_button-group button-group--left" :class="[elClass]">
79
- <slot name="left">
80
- <view v-for="(item,index) in leftOptions" :key="index" :style="{
81
- backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
82
- fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
83
- }" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
84
- @touchend="appTouchEnd($event,index,item,'left')"><text class="uni-swipe_button-text"
85
- :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
86
- </view>
87
- </slot>
88
- </view>
89
- <slot></slot>
90
- <view class="uni-swipe_button-group button-group--right" :class="[elClass]">
91
- <slot name="right">
92
- <view v-for="(item,index) in rightOptions" :key="index" :style="{
93
- backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
94
- fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
95
- }" @touchstart="appTouchStart" @touchend="appTouchEnd($event,index,item,'right')"
96
- class="uni-swipe_button button-hock"><text class="uni-swipe_button-text"
97
- :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
98
- </view>
99
- </slot>
100
- </view>
101
- </view>
102
- </view>
103
- <!-- #endif -->
104
-
2
+ <!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
3
+ <!-- #ifdef APP-VUE || MP-WEIXIN || H5 -->
4
+ <view class="uni-swipe">
5
+ <!-- #ifdef MP-WEIXIN || VUE3 -->
6
+ <view
7
+ class="uni-swipe_box"
8
+ :change:prop="wxsswipe.showWatch"
9
+ :prop="is_show"
10
+ :data-threshold="threshold"
11
+ :data-disabled="disabled"
12
+ @touchstart="wxsswipe.touchstart"
13
+ @touchmove="wxsswipe.touchmove"
14
+ @touchend="wxsswipe.touchend"
15
+ >
16
+ <!-- #endif -->
17
+ <!-- #ifndef MP-WEIXIN || VUE3 -->
18
+ <view
19
+ class="uni-swipe_box"
20
+ :change:prop="renderswipe.showWatch"
21
+ :prop="is_show"
22
+ :data-threshold="threshold"
23
+ :data-disabled="disabled + ''"
24
+ @touchstart="renderswipe.touchstart"
25
+ @touchmove="renderswipe.touchmove"
26
+ @touchend="renderswipe.touchend"
27
+ >
28
+ <!-- #endif -->
29
+ <!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
30
+ <view class="uni-swipe_button-group button-group--left">
31
+ <slot name="left">
32
+ <view
33
+ v-for="(item, index) in leftOptions"
34
+ :key="index"
35
+ :style="{
36
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
37
+ }"
38
+ class="uni-swipe_button button-hock"
39
+ @touchstart="appTouchStart"
40
+ @touchend="appTouchEnd($event, index, item, 'left')"
41
+ @click.stop="onClickForPC(index, item, 'left')"
42
+ >
43
+ <text
44
+ class="uni-swipe_button-text"
45
+ :style="{
46
+ color: item.style && item.style.color ? item.style.color : '#FFFFFF',
47
+ fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px',
48
+ }"
49
+ >{{ item.text }}</text
50
+ >
51
+ </view>
52
+ </slot>
53
+ </view>
54
+ <view class="uni-swipe_text--center">
55
+ <slot></slot>
56
+ </view>
57
+ <view class="uni-swipe_button-group button-group--right">
58
+ <slot name="right">
59
+ <view
60
+ v-for="(item, index) in rightOptions"
61
+ :key="index"
62
+ :style="{
63
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
64
+ }"
65
+ class="uni-swipe_button button-hock"
66
+ @touchstart="appTouchStart"
67
+ @touchend="appTouchEnd($event, index, item, 'right')"
68
+ @click.stop="onClickForPC(index, item, 'right')"
69
+ ><text
70
+ class="uni-swipe_button-text"
71
+ :style="{
72
+ color: item.style && item.style.color ? item.style.color : '#FFFFFF',
73
+ fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px',
74
+ }"
75
+ >{{ item.text }}</text
76
+ >
77
+ </view>
78
+ </slot>
79
+ </view>
80
+ </view>
81
+ </view>
82
+ <!-- #ifdef MP-WEIXIN || VUE3 -->
83
+ </view>
84
+ <!-- #endif -->
85
+ <!-- #endif -->
86
+ <!-- app nvue端 使用 bindingx -->
87
+ <!-- #ifdef APP-NVUE -->
88
+ <view ref="selector-box--hock" class="uni-swipe" @horizontalpan="touchstart" @touchend="touchend">
89
+ <view ref="selector-left-button--hock" class="uni-swipe_button-group button-group--left">
90
+ <slot name="left">
91
+ <view
92
+ v-for="(item, index) in leftOptions"
93
+ :key="index"
94
+ :style="{
95
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
96
+ }"
97
+ class="uni-swipe_button button-hock"
98
+ @click.stop="onClick(index, item, 'left')"
99
+ ><text
100
+ class="uni-swipe_button-text"
101
+ :style="{
102
+ color: item.style && item.style.color ? item.style.color : '#FFFFFF',
103
+ fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px',
104
+ }"
105
+ >{{ item.text }}</text
106
+ >
107
+ </view>
108
+ </slot>
109
+ </view>
110
+ <view ref="selector-right-button--hock" class="uni-swipe_button-group button-group--right">
111
+ <slot name="right">
112
+ <view
113
+ v-for="(item, index) in rightOptions"
114
+ :key="index"
115
+ :style="{
116
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
117
+ }"
118
+ class="uni-swipe_button button-hock"
119
+ @click.stop="onClick(index, item, 'right')"
120
+ ><text
121
+ class="uni-swipe_button-text"
122
+ :style="{
123
+ color: item.style && item.style.color ? item.style.color : '#FFFFFF',
124
+ fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px',
125
+ }"
126
+ >{{ item.text }}</text
127
+ >
128
+ </view>
129
+ </slot>
130
+ </view>
131
+ <view ref="selector-content--hock" class="uni-swipe_box">
132
+ <slot></slot>
133
+ </view>
134
+ </view>
135
+ <!-- #endif -->
136
+ <!-- 其他平台使用 js ,长列表性能可能会有影响-->
137
+ <!-- #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || MP-QQ -->
138
+ <view class="uni-swipe">
139
+ <view class="uni-swipe_box" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend" :style="{ transform: moveLeft }" :class="{ ani: ani }">
140
+ <view class="uni-swipe_button-group button-group--left" :class="[elClass]">
141
+ <slot name="left">
142
+ <view
143
+ v-for="(item, index) in leftOptions"
144
+ :key="index"
145
+ :style="{
146
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
147
+ fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px',
148
+ }"
149
+ class="uni-swipe_button button-hock"
150
+ @touchstart="appTouchStart"
151
+ @touchend="appTouchEnd($event, index, item, 'left')"
152
+ ><text class="uni-swipe_button-text" :style="{ color: item.style && item.style.color ? item.style.color : '#FFFFFF' }">{{
153
+ item.text
154
+ }}</text>
155
+ </view>
156
+ </slot>
157
+ </view>
158
+ <slot></slot>
159
+ <view class="uni-swipe_button-group button-group--right" :class="[elClass]">
160
+ <slot name="right">
161
+ <view
162
+ v-for="(item, index) in rightOptions"
163
+ :key="index"
164
+ :style="{
165
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
166
+ fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px',
167
+ }"
168
+ @touchstart="appTouchStart"
169
+ @touchend="appTouchEnd($event, index, item, 'right')"
170
+ class="uni-swipe_button button-hock"
171
+ ><text class="uni-swipe_button-text" :style="{ color: item.style && item.style.color ? item.style.color : '#FFFFFF' }">{{
172
+ item.text
173
+ }}</text>
174
+ </view>
175
+ </slot>
176
+ </view>
177
+ </view>
178
+ </view>
179
+ <!-- #endif -->
105
180
  </template>
106
- <script src='./wx.wxs' module="wxsswipe" lang="wxs"></script>
181
+ <script src="./wx.wxs" module="wxsswipe" lang="wxs"></script>
107
182
 
108
183
  <script module="renderswipe" lang="renderjs">
109
- import render from './render.js'
110
- export default {
111
- mounted(e, ins, owner) {
112
- this.state = {}
113
- },
114
- methods: {
115
- showWatch(newVal, oldVal, ownerInstance, instance) {
116
- render.showWatch(newVal, oldVal, ownerInstance, instance, this)
117
- },
118
- touchstart(e, ownerInstance) {
119
- render.touchstart(e, ownerInstance, this)
120
- },
121
- touchmove(e, ownerInstance) {
122
- render.touchmove(e, ownerInstance, this)
123
- },
124
- touchend(e, ownerInstance) {
125
- render.touchend(e, ownerInstance, this)
126
- }
127
- }
128
- }
184
+ import render from './render.js'
185
+ export default {
186
+ mounted(e, ins, owner) {
187
+ this.state = {}
188
+ },
189
+ methods: {
190
+ showWatch(newVal, oldVal, ownerInstance, instance) {
191
+ render.showWatch(newVal, oldVal, ownerInstance, instance, this)
192
+ },
193
+ touchstart(e, ownerInstance) {
194
+ render.touchstart(e, ownerInstance, this)
195
+ },
196
+ touchmove(e, ownerInstance) {
197
+ render.touchmove(e, ownerInstance, this)
198
+ },
199
+ touchend(e, ownerInstance) {
200
+ render.touchend(e, ownerInstance, this)
201
+ }
202
+ }
203
+ }
129
204
  </script>
130
205
  <script>
131
- import mpwxs from './mpwxs'
132
- import bindingx from './bindingx.js'
133
- import mpother from './mpother'
134
-
135
- /**
136
- * SwipeActionItem 滑动操作子组件
137
- * @description 通过滑动触发选项的容器
138
- * @tutorial https://ext.dcloud.net.cn/plugin?id=181
139
- * @property {Boolean} show = [left|right|none] 开启关闭组件,auto-close = false 时生效
140
- * @property {Boolean} disabled = [true|false] 是否禁止滑动
141
- * @property {Boolean} autoClose = [true|false] 滑动打开当前组件,是否关闭其他组件
142
- * @property {Number} threshold 滑动缺省值
143
- * @property {Array} leftOptions 左侧选项内容及样式
144
- * @property {Array} rgihtOptions 右侧选项内容及样式
145
- * @event {Function} click 点击选项按钮时触发事件,e = {content,index} ,content(点击内容)、index(下标)
146
- * @event {Function} change 组件打开或关闭时触发,left\right\none
147
- */
206
+ import mpwxs from './mpwxs';
207
+ import bindingx from './bindingx.js';
208
+ import mpother from './mpother';
148
209
 
149
- export default {
150
- mixins: [mpwxs, bindingx, mpother],
151
- emits: ['click', 'change'],
152
- props: {
153
- // 控制开关
154
- show: {
155
- type: String,
156
- default: 'none'
157
- },
210
+ /**
211
+ * SwipeActionItem 滑动操作子组件
212
+ * @description 通过滑动触发选项的容器
213
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=181
214
+ * @property {Boolean} show = [left|right|none] 开启关闭组件,auto-close = false 时生效
215
+ * @property {Boolean} disabled = [true|false] 是否禁止滑动
216
+ * @property {Boolean} autoClose = [true|false] 滑动打开当前组件,是否关闭其他组件
217
+ * @property {Number} threshold 滑动缺省值
218
+ * @property {Array} leftOptions 左侧选项内容及样式
219
+ * @property {Array} rgihtOptions 右侧选项内容及样式
220
+ * @event {Function} click 点击选项按钮时触发事件,e = {content,index} ,content(点击内容)、index(下标)
221
+ * @event {Function} change 组件打开或关闭时触发,left\right\none
222
+ */
158
223
 
159
- // 禁用
160
- disabled: {
161
- type: Boolean,
162
- default: false
163
- },
224
+ export default {
225
+ mixins: [mpwxs, bindingx, mpother],
226
+ emits: ['click', 'change'],
227
+ props: {
228
+ // 控制开关
229
+ show: {
230
+ type: String,
231
+ default: 'none',
232
+ },
164
233
 
165
- // 是否自动关闭
166
- autoClose: {
167
- type: Boolean,
168
- default: true
169
- },
234
+ // 禁用
235
+ disabled: {
236
+ type: Boolean,
237
+ default: false,
238
+ },
170
239
 
171
- // 滑动缺省距离
172
- threshold: {
173
- type: Number,
174
- default: 20
175
- },
240
+ // 是否自动关闭
241
+ autoClose: {
242
+ type: Boolean,
243
+ default: true,
244
+ },
176
245
 
177
- // 左侧按钮内容
178
- leftOptions: {
179
- type: Array,
180
- default () {
181
- return []
182
- }
183
- },
246
+ // 滑动缺省距离
247
+ threshold: {
248
+ type: Number,
249
+ default: 20,
250
+ },
184
251
 
185
- // 右侧按钮内容
186
- rightOptions: {
187
- type: Array,
188
- default () {
189
- return []
190
- }
191
- }
252
+ // 左侧按钮内容
253
+ leftOptions: {
254
+ type: Array,
255
+ default() {
256
+ return [];
257
+ },
258
+ },
192
259
 
193
- },
194
- // #ifndef VUE3
195
- // TODO vue2
196
- destroyed() {
197
- if (this.__isUnmounted) return
198
- this.uninstall()
199
- },
200
- // #endif
201
- // #ifdef VUE3
202
- // TODO vue3
203
- unmounted() {
204
- this.__isUnmounted = true
205
- this.uninstall()
206
- },
207
- // #endif
260
+ // 右侧按钮内容
261
+ rightOptions: {
262
+ type: Array,
263
+ default() {
264
+ return [];
265
+ },
266
+ },
267
+ },
268
+ // #ifndef VUE3
269
+ // TODO vue2
270
+ destroyed() {
271
+ if (this.__isUnmounted) return;
272
+ this.uninstall();
273
+ },
274
+ // #endif
275
+ // #ifdef VUE3
276
+ // TODO vue3
277
+ unmounted() {
278
+ this.__isUnmounted = true;
279
+ this.uninstall();
280
+ },
281
+ // #endif
208
282
 
209
- methods: {
210
- uninstall() {
211
- if (this.swipeaction) {
212
- this.swipeaction.children.forEach((item, index) => {
213
- if (item === this) {
214
- this.swipeaction.children.splice(index, 1)
215
- }
216
- })
217
- }
218
- },
219
- /**
220
- * 获取父元素实例
221
- */
222
- getSwipeAction(name = 'uniSwipeAction') {
223
- let parent = this.$parent;
224
- let parentName = parent.$options.name;
225
- while (parentName !== name) {
226
- parent = parent.$parent;
227
- if (!parent) return false;
228
- parentName = parent.$options.name;
229
- }
230
- return parent;
231
- }
232
- }
233
- }
283
+ methods: {
284
+ uninstall() {
285
+ if (this.swipeaction) {
286
+ this.swipeaction.children.forEach((item, index) => {
287
+ if (item === this) {
288
+ this.swipeaction.children.splice(index, 1);
289
+ }
290
+ });
291
+ }
292
+ },
293
+ /**
294
+ * 获取父元素实例
295
+ */
296
+ getSwipeAction(name = 'uniSwipeAction') {
297
+ let parent = this.$parent;
298
+ let parentName = parent.$options.name;
299
+ while (parentName !== name) {
300
+ parent = parent.$parent;
301
+ if (!parent) return false;
302
+ parentName = parent.$options.name;
303
+ }
304
+ return parent;
305
+ },
306
+ },
307
+ };
234
308
  </script>
235
309
  <style lang="scss">
236
- .uni-swipe {
237
- position: relative;
238
- /* #ifndef APP-NVUE */
239
- overflow: hidden;
240
- /* #endif */
241
- }
310
+ .uni-swipe {
311
+ position: relative;
312
+ /* #ifndef APP-NVUE */
313
+ overflow: hidden;
314
+ /* #endif */
315
+ }
242
316
 
243
- .uni-swipe_box {
244
- /* #ifndef APP-NVUE */
245
- display: flex;
246
- flex-shrink: 0;
247
- // touch-action: none;
248
- /* #endif */
249
- position: relative;
250
- }
317
+ .uni-swipe_box {
318
+ /* #ifndef APP-NVUE */
319
+ display: flex;
320
+ flex-shrink: 0;
321
+ // touch-action: none;
322
+ /* #endif */
323
+ position: relative;
324
+ }
251
325
 
252
- .uni-swipe_content {
253
- // border: 1px red solid;
254
- }
326
+ .uni-swipe_content {
327
+ // border: 1px red solid;
328
+ }
255
329
 
256
- .uni-swipe_text--center {
257
- width: 100%;
258
- /* #ifndef APP-NVUE */
259
- cursor: grab;
260
- /* #endif */
261
- }
330
+ .uni-swipe_text--center {
331
+ width: 100%;
332
+ /* #ifndef APP-NVUE */
333
+ cursor: grab;
334
+ /* #endif */
335
+ }
262
336
 
263
- .uni-swipe_button-group {
264
- /* #ifndef APP-NVUE */
265
- box-sizing: border-box;
266
- display: flex;
267
- /* #endif */
268
- flex-direction: row;
269
- position: absolute;
270
- top: 0;
271
- bottom: 0;
272
- /* #ifdef H5 */
273
- cursor: pointer;
274
- /* #endif */
275
- }
337
+ .uni-swipe_button-group {
338
+ /* #ifndef APP-NVUE */
339
+ box-sizing: border-box;
340
+ display: flex;
341
+ /* #endif */
342
+ flex-direction: row;
343
+ position: absolute;
344
+ top: 0;
345
+ bottom: 0;
346
+ /* #ifdef H5 */
347
+ cursor: pointer;
348
+ /* #endif */
349
+ }
276
350
 
277
- .button-group--left {
278
- left: 0;
279
- transform: translateX(-100%)
280
- }
351
+ .button-group--left {
352
+ left: 0;
353
+ transform: translateX(-100%);
354
+ }
281
355
 
282
- .button-group--right {
283
- right: 0;
284
- transform: translateX(100%)
285
- }
356
+ .button-group--right {
357
+ right: 0;
358
+ transform: translateX(100%);
359
+ }
286
360
 
287
- .uni-swipe_button {
288
- /* #ifdef APP-NVUE */
289
- flex: 1;
290
- /* #endif */
291
- /* #ifndef APP-NVUE */
292
- display: flex;
293
- /* #endif */
294
- flex-direction: row;
295
- justify-content: center;
296
- align-items: center;
297
- padding: 0 20px;
298
- }
361
+ .uni-swipe_button {
362
+ /* #ifdef APP-NVUE */
363
+ flex: 1;
364
+ /* #endif */
365
+ /* #ifndef APP-NVUE */
366
+ display: flex;
367
+ /* #endif */
368
+ flex-direction: row;
369
+ justify-content: center;
370
+ align-items: center;
371
+ padding: 0 20px;
372
+ }
299
373
 
300
- .uni-swipe_button-text {
301
- /* #ifndef APP-NVUE */
302
- flex-shrink: 0;
303
- /* #endif */
304
- font-size: 14px;
305
- }
374
+ .uni-swipe_button-text {
375
+ /* #ifndef APP-NVUE */
376
+ flex-shrink: 0;
377
+ /* #endif */
378
+ font-size: 14px;
379
+ }
306
380
 
307
- .ani {
308
- transition-property: transform;
309
- transition-duration: 0.3s;
310
- transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
311
- }
381
+ .ani {
382
+ transition-property: transform;
383
+ transition-duration: 0.3s;
384
+ transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
385
+ }
312
386
 
313
- /* #ifdef MP-ALIPAY */
314
- .movable-area {
315
- /* width: 100%; */
316
- height: 45px;
317
- }
387
+ /* #ifdef MP-ALIPAY */
388
+ .movable-area {
389
+ /* width: 100%; */
390
+ height: 45px;
391
+ }
318
392
 
319
- .movable-view {
320
- display: flex;
321
- /* justify-content: center; */
322
- position: relative;
323
- flex: 1;
324
- height: 45px;
325
- z-index: 2;
326
- }
393
+ .movable-view {
394
+ display: flex;
395
+ /* justify-content: center; */
396
+ position: relative;
397
+ flex: 1;
398
+ height: 45px;
399
+ z-index: 2;
400
+ }
327
401
 
328
- .movable-view-button {
329
- display: flex;
330
- flex-shrink: 0;
331
- flex-direction: row;
332
- height: 100%;
333
- background: #C0C0C0;
334
- }
402
+ .movable-view-button {
403
+ display: flex;
404
+ flex-shrink: 0;
405
+ flex-direction: row;
406
+ height: 100%;
407
+ background: #c0c0c0;
408
+ }
335
409
 
336
- /* .transition {
410
+ /* .transition {
337
411
  transition: all 0.3s;
338
412
  } */
339
413
 
340
- .movable-view-box {
341
- flex-shrink: 0;
342
- height: 100%;
343
- background-color: #fff;
344
- }
414
+ .movable-view-box {
415
+ flex-shrink: 0;
416
+ height: 100%;
417
+ background-color: #fff;
418
+ }
345
419
 
346
- /* #endif */
420
+ /* #endif */
347
421
  </style>