uview-plus 3.8.55 → 3.8.106

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 (229) hide show
  1. package/changelog.md +2147 -1828
  2. package/components/u-action-sheet/props.js +3 -1
  3. package/components/u-action-sheet/u-action-sheet.vue +22 -2
  4. package/components/u-album/props.js +3 -1
  5. package/components/u-alert/props.js +4 -2
  6. package/components/u-avatar/props.js +4 -1
  7. package/components/u-avatar-group/props.js +4 -1
  8. package/components/u-back-top/props.js +4 -1
  9. package/components/u-badge/props.js +4 -1
  10. package/components/u-barcode/u-barcode.vue +44 -15
  11. package/components/u-box/props.js +5 -2
  12. package/components/u-button/props.js +4 -1
  13. package/components/u-button/u-button.vue +2 -5
  14. package/components/u-button/vue.scss +3 -3
  15. package/components/u-calendar/calendar.js +8 -0
  16. package/components/u-calendar/props.js +43 -1
  17. package/components/u-calendar/u-calendar.vue +16 -0
  18. package/components/u-calendar-strip/props.js +3 -1
  19. package/components/u-canvas/u-canvas.vue +1028 -423
  20. package/components/u-car-keyboard/props.js +3 -1
  21. package/components/u-card/props.js +3 -1
  22. package/components/u-cell/props.js +4 -1
  23. package/components/u-cell/u-cell.vue +9 -1
  24. package/components/u-cell-group/props.js +4 -1
  25. package/components/u-checkbox/props.js +4 -1
  26. package/components/u-checkbox/u-checkbox.vue +7 -3
  27. package/components/u-checkbox-group/props.js +3 -1
  28. package/components/u-circle-progress/props.js +4 -1
  29. package/components/u-code/props.js +4 -1
  30. package/components/u-code-input/props.js +4 -1
  31. package/components/u-col/props.js +4 -1
  32. package/components/u-collapse/props.js +4 -1
  33. package/components/u-collapse-item/props.js +4 -1
  34. package/components/u-color-picker/u-color-picker.vue +1 -0
  35. package/components/u-column-notice/props.js +4 -1
  36. package/components/u-count-down/props.js +4 -1
  37. package/components/u-count-to/props.js +4 -1
  38. package/components/u-cropper/u-cropper.vue +95 -51
  39. package/components/u-datetime-picker/props.js +4 -1
  40. package/components/u-datetime-picker/u-datetime-picker.vue +53 -4
  41. package/components/u-divider/props.js +4 -1
  42. package/components/u-dragsort/u-dragsort.vue +57 -32
  43. package/components/u-dropdown/props.js +3 -1
  44. package/components/u-dropdown-item/props.js +3 -1
  45. package/components/u-empty/props.js +4 -1
  46. package/components/u-form/props.js +4 -1
  47. package/components/u-form-item/props.js +4 -1
  48. package/components/u-gap/props.js +4 -1
  49. package/components/u-grid/props.js +4 -1
  50. package/components/u-grid-item/props.js +4 -1
  51. package/components/u-guide/props.js +3 -1
  52. package/components/u-icon/props.js +4 -1
  53. package/components/u-icon/u-icon.vue +11 -2
  54. package/components/u-icon/upicon.ttf +0 -0
  55. package/components/u-icon/util.js +103 -10
  56. package/components/u-image/props.js +4 -1
  57. package/components/u-image/u-image.vue +280 -267
  58. package/components/u-index-anchor/props.js +4 -1
  59. package/components/u-index-item/props.js +2 -1
  60. package/components/u-index-item/u-index-item.vue +1 -1
  61. package/components/u-index-list/props.js +4 -1
  62. package/components/u-index-list/u-index-list.vue +1 -1
  63. package/components/u-input/props.js +3 -1
  64. package/components/u-keyboard/props.js +4 -1
  65. package/components/u-line/props.js +4 -1
  66. package/components/u-line-progress/props.js +6 -3
  67. package/components/u-link/props.js +4 -1
  68. package/components/u-list/props.js +4 -1
  69. package/components/u-list-item/props.js +4 -1
  70. package/components/u-loading-icon/props.js +4 -1
  71. package/components/u-loading-page/props.js +3 -1
  72. package/components/u-loadmore/props.js +4 -1
  73. package/components/u-markdown/u-markdown.vue +45 -3
  74. package/components/u-modal/props.js +4 -1
  75. package/components/u-navbar/props.js +4 -2
  76. package/components/u-navbar/u-navbar.vue +15 -9
  77. package/components/u-no-network/props.js +4 -1
  78. package/components/u-notice-bar/props.js +4 -1
  79. package/components/u-notify/props.js +4 -1
  80. package/components/u-novel-reader/content-normalizer.js +80 -0
  81. package/components/u-novel-reader/layout-engine.js +225 -0
  82. package/components/u-novel-reader/measure-adapter.js +69 -0
  83. package/components/u-novel-reader/novelReader.js +35 -0
  84. package/components/u-novel-reader/persistence.js +144 -0
  85. package/components/u-novel-reader/props.js +100 -0
  86. package/components/u-novel-reader/reader-catalog.vue +234 -0
  87. package/components/u-novel-reader/reader-content.vue +226 -0
  88. package/components/u-novel-reader/reader-core.js +151 -0
  89. package/components/u-novel-reader/reader-settings.vue +325 -0
  90. package/components/u-novel-reader/reader-toolbar.vue +313 -0
  91. package/components/u-novel-reader/theme-vars.scss +49 -0
  92. package/components/u-novel-reader/u-novel-reader.vue +836 -0
  93. package/components/u-number-box/props.js +4 -1
  94. package/components/u-number-box/u-number-box.vue +2 -2
  95. package/components/u-number-keyboard/props.js +4 -1
  96. package/components/u-overlay/props.js +4 -1
  97. package/components/u-pagination/u-pagination.vue +60 -39
  98. package/components/u-parse/props.js +4 -1
  99. package/components/u-picker/props.js +4 -1
  100. package/components/u-picker-column/props.js +3 -1
  101. package/components/u-popover/props.js +2 -1
  102. package/components/u-popup/props.js +4 -1
  103. package/components/u-poster/u-poster.vue +246 -214
  104. package/components/u-qrcode/qrcode.js +105 -97
  105. package/components/u-qrcode/u-qrcode.vue +242 -289
  106. package/components/u-radio/props.js +4 -1
  107. package/components/u-radio/u-radio.vue +7 -3
  108. package/components/u-radio-group/props.js +4 -1
  109. package/components/u-rate/props.js +4 -1
  110. package/components/u-read-more/props.js +4 -1
  111. package/components/u-row/props.js +4 -1
  112. package/components/u-row-notice/props.js +4 -1
  113. package/components/u-safe-bottom/props.js +2 -1
  114. package/components/u-scroll-list/props.js +4 -1
  115. package/components/u-scroll-list/scrollWxs.wxs +1 -1
  116. package/components/u-search/props.js +3 -1
  117. package/components/u-skeleton/props.js +4 -1
  118. package/components/u-slider/props.js +3 -1
  119. package/components/u-slider/u-slider.vue +71 -29
  120. package/components/u-status-bar/props.js +4 -1
  121. package/components/u-steps/props.js +4 -1
  122. package/components/u-steps-item/props.js +4 -1
  123. package/components/u-sticky/props.js +4 -1
  124. package/components/u-sticky/u-sticky.vue +11 -0
  125. package/components/u-subsection/props.js +3 -1
  126. package/components/u-swipe-action/props.js +4 -1
  127. package/components/u-swipe-action-item/index.wxs +43 -25
  128. package/components/u-swipe-action-item/nvue.js +9 -0
  129. package/components/u-swipe-action-item/other.js +32 -21
  130. package/components/u-swipe-action-item/props.js +9 -1
  131. package/components/u-swipe-action-item/swipeActionItem.js +1 -0
  132. package/components/u-swipe-action-item/u-swipe-action-item.vue +42 -4
  133. package/components/u-swiper/props.js +9 -1
  134. package/components/u-swiper/swiper.js +1 -0
  135. package/components/u-swiper/u-swiper.vue +2 -0
  136. package/components/u-swiper-indicator/props.js +4 -1
  137. package/components/u-switch/props.js +4 -1
  138. package/components/u-switch/u-switch.vue +1 -1
  139. package/components/u-tabbar/props.js +3 -1
  140. package/components/u-tabbar/u-tabbar.vue +2 -1
  141. package/components/u-tabbar-item/props.js +4 -1
  142. package/components/u-tabbar-item/u-tabbar-item.vue +64 -21
  143. package/components/u-table/props.js +3 -1
  144. package/components/u-table2/tableRow.vue +155 -69
  145. package/components/u-table2/u-table2.vue +327 -137
  146. package/components/u-tabs/props.js +4 -1
  147. package/components/u-tabs/u-tabs.vue +11 -8
  148. package/components/u-tabs-item/props.js +3 -1
  149. package/components/u-tabs-pro/u-tabs-pro.vue +212 -0
  150. package/components/u-tag/props.js +4 -1
  151. package/components/u-td/props.js +3 -1
  152. package/components/u-text/props.js +4 -1
  153. package/components/u-text/text.js +1 -1
  154. package/components/u-text/u-text.vue +18 -6
  155. package/components/u-textarea/props.js +3 -1
  156. package/components/u-textarea/u-textarea.vue +16 -5
  157. package/components/u-th/props.js +3 -1
  158. package/components/u-toolbar/props.js +4 -1
  159. package/components/u-tooltip/props.js +10 -2
  160. package/components/u-tooltip/tooltip.js +2 -1
  161. package/components/u-tooltip/u-tooltip.vue +31 -3
  162. package/components/u-tr/props.js +3 -1
  163. package/components/u-transition/nvue-ani-map.js +75 -68
  164. package/components/u-transition/props.js +4 -1
  165. package/components/u-transition/transitionMixin.js +164 -163
  166. package/components/u-upload/props.js +4 -1
  167. package/components/u-upload/u-upload.vue +48 -41
  168. package/components/u-waterfall/u-waterfall.vue +162 -110
  169. package/index.js +65 -8
  170. package/libs/config/config.js +1 -1
  171. package/libs/config/props.js +180 -204
  172. package/libs/css/components.scss +3 -0
  173. package/libs/function/index.js +66 -0
  174. package/libs/function/uni-api-shims.js +29 -0
  175. package/libs/i18n/index.js +71 -36
  176. package/libs/i18n/locale-packs.js +11 -0
  177. package/libs/i18n/locales/all.js +23 -0
  178. package/libs/i18n/locales/{de.json → de.js} +1 -1
  179. package/libs/i18n/locales/{en.json → en.js} +2 -2
  180. package/libs/i18n/locales/{es.json → es.js} +1 -1
  181. package/libs/i18n/locales/{fr.json → fr.js} +2 -2
  182. package/libs/i18n/locales/{ja.json → ja.js} +1 -1
  183. package/libs/i18n/locales/{ko.json → ko.js} +1 -1
  184. package/libs/i18n/locales/{ru.json → ru.js} +1 -1
  185. package/libs/i18n/locales/{th.json → th.js} +1 -1
  186. package/libs/i18n/locales/{zh-Hans.json → zh-Hans.js} +1 -1
  187. package/libs/i18n/locales/{zh-Hant.json → zh-Hant.js} +1 -1
  188. package/libs/mixin/mixin.js +18 -54
  189. package/libs/root/index.js +78 -5
  190. package/libs/root/page.js +7 -7
  191. package/libs/root/root.js +73 -3
  192. package/libs/util/app-nvue-webview-canvas.js +486 -0
  193. package/libs/util/gcanvas/bridge/bridge-weex.js +10 -7
  194. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  195. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  196. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  197. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  198. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  199. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  200. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  201. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  202. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  203. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  204. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  205. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  206. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  207. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  208. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  209. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  210. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  211. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  212. package/libs/util/gcanvas/env/canvas.js +0 -0
  213. package/libs/util/gcanvas/env/image.js +0 -0
  214. package/libs/util/gcanvas/env/tool.js +0 -0
  215. package/libs/util/gcanvas/index.js +3 -3
  216. package/package.json +4 -5
  217. package/tsconfig.json +18 -0
  218. package/types/comps/calendar.d.ts +38 -0
  219. package/types/comps/checkbox.d.ts +12 -0
  220. package/types/comps/lineProgress.d.ts +5 -0
  221. package/types/comps/navbar.d.ts +3 -3
  222. package/types/comps/swipeActionItem.d.ts +13 -0
  223. package/types/comps/swiper.d.ts +5 -0
  224. package/types/comps/tabs.d.ts +2 -1
  225. package/types/comps/text.d.ts +1 -1
  226. package/types/comps/tooltip.d.ts +36 -1
  227. package/types/func.d.ts +23 -0
  228. package/types/index.d.ts +1 -0
  229. /package/components/u-markdown/{marked.esm.js → marked.esm.mjs} +0 -0
@@ -32,14 +32,14 @@
32
32
  </view>
33
33
  <!-- #ifdef APP-VUE || MP-WEIXIN || MP-QQ || H5 -->
34
34
  <view class="u-swipe-action-item__content" @touchstart="wxs.touchstart" @touchmove="wxs.touchmove"
35
- @touchend="wxs.touchend" :status="status" :change:status="wxs.statusChange" :size="size"
35
+ @touchend="wxs.touchend" @touchcancel="wxs.touchcancel" :status="status" :change:status="wxs.statusChange" :size="size"
36
36
  :change:size="wxs.sizeChange">
37
37
  <slot></slot>
38
38
  </view>
39
39
  <!-- #endif -->
40
40
  <!-- #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO-->
41
41
  <view class="u-swipe-action-item__content" @click="clickHandler" @touchstart="touchstart" @touchmove="touchmove"
42
- @touchend="touchend" :style="sliderStyle">
42
+ @touchend="touchend" @touchcancel="touchcancel" :style="sliderStyle">
43
43
  <slot></slot>
44
44
  </view>
45
45
  <!-- <view class="u-swipe-action-item__content" @touchstart="mysjs.touchstart" @touchmove="mysjs.touchmove"
@@ -81,16 +81,18 @@
81
81
  * @property {String | Number} index 标识符,如果是v-for,可用index索引
82
82
  * @property {Boolean} disabled 是否禁用(默认 false )
83
83
  * @property {Boolean} autoClose 是否自动关闭其他swipe按钮组(默认 true )
84
+ * @property {Boolean} scrolling 是否正在横向滑动,可用于v-model:scrolling暂停外部滚动(默认 false )
84
85
  * @property {Number} threshold 滑动距离阈值,只有大于此值,才被认为是要打开菜单(默认 30 )
85
86
  * @property {Array} options 右侧按钮内容
86
87
  * @property {String | Number} duration 动画过渡时间,单位ms(默认 350 )
88
+ * @event {Function(value)} scrolling 横向滑动状态变化时触发,参数为Boolean
87
89
  * @event {Function(index)} open 组件打开时触发
88
90
  * @event {Function(index)} close 组件关闭时触发
89
91
  * @example <u-swipe-action><u-swipe-action-item :options="options1" ></u-swipe-action-item></u-swipe-action>
90
92
  */
91
93
  export default {
92
94
  name: 'u-swipe-action-item',
93
- emits: ['click', 'update:show'],
95
+ emits: ['click', 'update:show', 'update:scrolling', 'scrolling'],
94
96
  mixins: [
95
97
  mpMixin,
96
98
  mixin,
@@ -118,7 +120,9 @@
118
120
  },
119
121
  // 当前状态,open-打开,close-关闭
120
122
  status: '',
121
- sliderStyle: {}
123
+ sliderStyle: {},
124
+ // 内部缓存横向滑动状态,避免一次手势重复触发相同事件
125
+ innerScrolling: this.scrolling
122
126
  }
123
127
  },
124
128
  watch: {
@@ -142,6 +146,14 @@
142
146
  } else {
143
147
  this.status = 'close'
144
148
  }
149
+ },
150
+ scrolling(newValue) {
151
+ this.innerScrolling = !!newValue
152
+ },
153
+ disabled(newValue) {
154
+ if (newValue) {
155
+ this.setScrolling(false)
156
+ }
145
157
  }
146
158
  },
147
159
  computed: {
@@ -160,6 +172,11 @@
160
172
  },
161
173
  beforeUmount() {
162
174
  this.closeHandler()
175
+ this.setScrolling(false)
176
+ },
177
+ beforeUnmount() {
178
+ this.closeHandler()
179
+ this.setScrolling(false)
163
180
  },
164
181
  methods: {
165
182
  addUnit,
@@ -177,6 +194,13 @@
177
194
  // 此方法在mixin中
178
195
  this.getParentData('u-swipe-action')
179
196
  },
197
+ setScrolling(value) {
198
+ const next = !!value
199
+ if (this.innerScrolling === next) return
200
+ this.innerScrolling = next
201
+ this.$emit('update:scrolling', next)
202
+ this.$emit('scrolling', next)
203
+ },
180
204
  // #ifndef APP-NVUE
181
205
  // 查询节点
182
206
  queryRect() {
@@ -214,11 +238,23 @@
214
238
  /* #ifndef APP-NVUE || MP-WEIXIN */
215
239
  touch-action: pan-y;
216
240
  /* #endif */
241
+ /* #ifndef APP-NVUE */
242
+ // 触发独立合成层,避免 H5 下 overflow 裁剪失效导致右侧按钮露边
243
+ transform: translateZ(0);
244
+ /* #endif */
217
245
 
218
246
  &__content {
247
+ position: relative;
248
+ // 保证内容层始终铺满整行,避免关闭态右侧露出删除按钮底色
249
+ width: 100%;
219
250
  transform: translateX(0px); // 修复某些情况下默认右侧按钮是展开的问题
220
251
  background-color: var(--up-card-bg-color, #FFFFFF);
221
252
  z-index: 10;
253
+ /* #ifndef APP-NVUE */
254
+ // 覆盖 H5 亚像素渲染时内容层与容器之间的 1px 缝隙
255
+ box-shadow: 1px 0 0 var(--up-card-bg-color, #FFFFFF);
256
+ box-sizing: border-box;
257
+ /* #endif */
222
258
  }
223
259
 
224
260
  &__right {
@@ -226,6 +262,8 @@
226
262
  top: 0;
227
263
  bottom: 0;
228
264
  right: 0;
265
+ height: 100%;
266
+ z-index: 1;
229
267
  @include flex;
230
268
 
231
269
  &__button {
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import SwiperDefaultProps from './swiper'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(SwiperDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // 列表数组,元素可为字符串,如为对象可通过keyName指定目标属性名
@@ -62,6 +65,11 @@ export const props = defineMixin({
62
65
  type: Boolean,
63
66
  default: () => defProps.swiper.circular
64
67
  },
68
+ // 滑动方向是否为纵向
69
+ vertical: {
70
+ type: Boolean,
71
+ default: () => defProps.swiper.vertical
72
+ },
65
73
  // 前边距,可用于露出前一项的一小部分,nvue和支付宝不支持
66
74
  previousMargin: {
67
75
  type: [String, Number],
@@ -22,6 +22,7 @@ export default {
22
22
  interval: 3000,
23
23
  duration: 300,
24
24
  circular: false,
25
+ vertical: false,
25
26
  previousMargin: 0,
26
27
  nextMargin: 0,
27
28
  acceleration: false,
@@ -27,6 +27,7 @@
27
27
  :autoplay="autoplay"
28
28
  :current="current"
29
29
  :currentItemId="currentItemId"
30
+ :vertical="vertical"
30
31
  :previousMargin="addUnit(previousMargin)"
31
32
  :nextMargin="addUnit(nextMargin)"
32
33
  :acceleration="acceleration"
@@ -113,6 +114,7 @@
113
114
  * @property {String | Number} interval 滑块自动切换时间间隔(ms)(默认 3000 )
114
115
  * @property {String | Number} duration 滑块切换过程所需时间(ms)(默认 300 )
115
116
  * @property {Boolean} circular 播放到末尾后是否重新回到开头(默认 false )
117
+ * @property {Boolean} vertical 滑动方向是否为纵向(默认 false )
116
118
  * @property {String | Number} previousMargin 前边距,可用于露出前一项的一小部分,nvue和支付宝不支持(默认 0 )
117
119
  * @property {String | Number} nextMargin 后边距,可用于露出后一项的一小部分,nvue和支付宝不支持(默认 0 )
118
120
  * @property {Boolean} acceleration 当开启时,会根据滑动速度,连续滑动多屏,支付宝不支持(默认 false )
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import SwiperIndicatorDefaultProps from './swipterIndicator'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(SwiperIndicatorDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // 轮播的长度
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import SwitchDefaultProps from './switch'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(SwitchDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // 是否为加载中状态
@@ -212,7 +212,7 @@
212
212
  border-style: solid;
213
213
  justify-content: flex-end;
214
214
  align-items: center;
215
- // 由于weex为阿里逗着玩的KPI项目,导致bug奇多,这必须要写这一行,
215
+ // 由于weex bug奇多,这必须要写这一行,
216
216
  // 否则在iOS上,点击页面任意地方,都会触发switch的点击事件
217
217
  overflow: hidden;
218
218
 
@@ -1,6 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import TabbarDefaultProps from './tabbar'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
3
4
 
5
+ const defProps = registerComponentProps(TabbarDefaultProps)
4
6
  export const props = defineMixin({
5
7
  props: {
6
8
  // 当前匹配项的name
@@ -98,7 +98,8 @@
98
98
  this.inactiveBackgroundColor,
99
99
  this.itemShape,
100
100
  this.iconScale,
101
- this.textMode
101
+ this.textMode,
102
+ this.borderColor
102
103
  ]
103
104
  },
104
105
  updatePlaceholder() {
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import TabbarItemDefaultProps from './tabbarItem'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(TabbarItemDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // item标签的名称,作为与u-tabbar的value参数匹配的标识符
@@ -11,10 +11,8 @@
11
11
  class="u-tabbar-item__icon"
12
12
  :class="iconClassNames"
13
13
  >
14
- <view v-if="isMidButton" class="u-tabbar-item__mid-button-arc">
15
- <svg viewBox="0 0 72 72" preserveAspectRatio="none">
16
- <path d="M 4 36 A 32 32 0 0 1 68 36"></path>
17
- </svg>
14
+ <view v-if="isMidButton" class="u-tabbar-item__mid-button-border">
15
+ <view class="u-tabbar-item__mid-button-border-circle" :style="midButtonBorderCircleStyle"></view>
18
16
  </view>
19
17
  <view v-if="isMidButton" class="u-tabbar-item__mid-button-inner"></view>
20
18
  <up-icon
@@ -22,6 +20,7 @@
22
20
  :name="resolvedIconName"
23
21
  :color="isMidButton ? resolvedMidButtonIconColor : (isActive ? resolvedActiveColor : resolvedInactiveColor)"
24
22
  :size="isMidButton ? midButtonIconSize : 24"
23
+ :customStyle="midButtonIconStyle"
25
24
  ></up-icon>
26
25
  <template v-else>
27
26
  <slot
@@ -94,7 +93,8 @@
94
93
  inactiveBackgroundColor: '',
95
94
  itemShape: 'default',
96
95
  iconScale: 1.1,
97
- textMode: 'always'
96
+ textMode: 'always',
97
+ borderColor: ''
98
98
  }
99
99
  }
100
100
  },
@@ -135,10 +135,41 @@
135
135
  if (this.midButtonIconColor) return this.midButtonIconColor
136
136
  return this.isMidButton ? '#3c9cff' : this.resolvedActiveColor
137
137
  },
138
+ midButtonIconStyle() {
139
+ return this.isMidButton
140
+ ? {
141
+ position: 'relative',
142
+ zIndex: 2
143
+ }
144
+ : {}
145
+ },
146
+ hasMidButtonText() {
147
+ return !!this.$slots.text || String(this.text || '').length > 0
148
+ },
149
+ resolvedMidButtonOffsetY() {
150
+ const offset = Number.parseFloat(this.midButtonOffsetY)
151
+ return Number.isFinite(offset) ? offset : -10
152
+ },
153
+ midButtonTranslateY() {
154
+ return `${this.resolvedMidButtonOffsetY}px`
155
+ },
156
+ midButtonBorderClipHeight() {
157
+ const clipBaseHeight = this.hasMidButtonText ? 15.5 : 7
158
+ const clipHeight = clipBaseHeight - this.resolvedMidButtonOffsetY
159
+ return `${Math.min(Math.max(clipHeight, 0), 64)}px`
160
+ },
161
+ midButtonBorderCircleStyle() {
162
+ return this.isMidButton && this.parentData.borderColor
163
+ ? {
164
+ borderColor: this.parentData.borderColor
165
+ }
166
+ : {}
167
+ },
138
168
  itemClassNames() {
139
169
  return [
140
170
  this.isActive ? 'u-tabbar-item--active' : 'u-tabbar-item--inactive',
141
171
  this.isMidButton ? 'u-tabbar-item--mid-button' : '',
172
+ this.isMidButton && !this.hasMidButtonText ? 'u-tabbar-item--mid-button-no-text' : '',
142
173
  `u-tabbar-item--${this.resolvedStyleType}`,
143
174
  this.resolvedAnimationType !== 'none' && this.isActive ? `u-tabbar-item--anim-${this.resolvedAnimationType}` : '',
144
175
  this.resolvedItemShape !== 'default' ? `u-tabbar-item--shape-${this.resolvedItemShape}` : '',
@@ -276,6 +307,11 @@
276
307
 
277
308
  &--mid-button {
278
309
  justify-content: center;
310
+ position: relative;
311
+ z-index: 1;
312
+ /* #ifndef APP-NVUE */
313
+ transform: translateY(v-bind('midButtonTranslateY'));
314
+ /* #endif */
279
315
  }
280
316
  }
281
317
 
@@ -381,9 +417,6 @@
381
417
 
382
418
  // 中间按钮样式
383
419
  .u-tabbar-item--mid-button {
384
- /* #ifndef APP-NVUE */
385
- transform: translateY(v-bind('`${midButtonOffsetY}px`'));
386
- /* #endif */
387
420
  z-index: 2;
388
421
  flex: 1;
389
422
  }
@@ -401,26 +434,36 @@
401
434
  overflow: visible;
402
435
  }
403
436
 
404
- .u-tabbar-item__mid-button-arc {
437
+ .u-tabbar-item__mid-button-border {
405
438
  position: absolute;
406
- left: -4px;
407
- top: -4px;
408
- width: calc(100% + 8px);
409
- height: calc(100% + 8px);
439
+ left: 0;
440
+ top: 0;
441
+ width: 64px;
442
+ height: v-bind('midButtonBorderClipHeight');
443
+ box-sizing: border-box;
444
+ background: transparent;
445
+ overflow: hidden;
410
446
  pointer-events: none;
411
447
  z-index: 0;
412
448
  }
413
449
 
414
- .u-tabbar-item__mid-button-arc svg {
415
- width: 100%;
416
- height: 100%;
450
+ /* #ifdef APP-NVUE */
451
+ .u-tabbar-item__mid-button-border {
452
+ height: 15.5px;
417
453
  }
418
454
 
419
- .u-tabbar-item__mid-button-arc path {
420
- fill: none;
421
- stroke: none;
422
- stroke-width: 0;
423
- stroke-linecap: round;
455
+ .u-tabbar-item--mid-button-no-text .u-tabbar-item__mid-button-border {
456
+ height: 7px;
457
+ }
458
+ /* #endif */
459
+
460
+ .u-tabbar-item__mid-button-border-circle {
461
+ width: 64px;
462
+ height: 64px;
463
+ box-sizing: border-box;
464
+ background: transparent;
465
+ border: 1px solid var(--up-border-color, rgba(0, 0, 0, 0.08));
466
+ border-radius: 999px;
424
467
  }
425
468
 
426
469
  .u-tabbar-item__mid-button-inner {
@@ -1,5 +1,7 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import { registerComponentProps } from '../../libs/config/props.js'
3
+
4
+ const defProps = registerComponentProps({ table: {} })
3
5
  export const props = defineMixin({
4
6
  props: {
5
7