uview-plus 3.1.52 → 3.2.5

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 (134) hide show
  1. package/changelog.md +51 -0
  2. package/components/u-action-sheet/u-action-sheet.vue +1 -1
  3. package/components/u-album/u-album.vue +261 -261
  4. package/components/u-avatar/u-avatar.vue +3 -2
  5. package/components/u-avatar-group/u-avatar-group.vue +106 -106
  6. package/components/u-button/u-button.vue +6 -1
  7. package/components/u-calendar/u-calendar.vue +4 -3
  8. package/components/u-cell/u-cell.vue +4 -2
  9. package/components/u-checkbox/props.js +5 -0
  10. package/components/u-checkbox/u-checkbox.vue +29 -17
  11. package/components/u-code/u-code.vue +1 -1
  12. package/components/u-dropdown/props.js +8 -14
  13. package/components/u-dropdown/u-dropdown.vue +202 -77
  14. package/components/u-dropdown-item/props.js +45 -36
  15. package/components/u-dropdown-item/u-dropdown-item.vue +121 -148
  16. package/components/u-form/u-form.vue +1 -1
  17. package/components/u-form-item/props.js +6 -1
  18. package/components/u-form-item/u-form-item.vue +1 -1
  19. package/components/u-grid/u-grid.vue +4 -2
  20. package/components/u-grid-item/u-grid-item.vue +8 -7
  21. package/components/u-input/u-input.vue +1 -1
  22. package/components/u-lazy-load/u-lazy-load.vue +251 -0
  23. package/components/u-number-box/u-number-box.vue +4 -4
  24. package/components/u-picker/u-picker.vue +5 -2
  25. package/components/u-popup/u-popup.vue +1 -1
  26. package/components/u-radio/u-radio.vue +2 -2
  27. package/components/u-rate/u-rate.vue +1 -1
  28. package/components/u-read-more/u-read-more.vue +164 -160
  29. package/components/u-slider/u-slider.vue +6 -6
  30. package/components/u-steps-item/u-steps-item.vue +318 -318
  31. package/components/u-subsection/u-subsection.vue +35 -21
  32. package/components/u-swiper/u-swiper.vue +6 -8
  33. package/components/u-switch/u-switch.vue +1 -1
  34. package/components/u-tabbar-item/u-tabbar-item.vue +1 -1
  35. package/components/u-tabs/u-tabs.vue +1 -0
  36. package/components/u-tag/props.js +5 -2
  37. package/components/u-tag/u-tag.vue +1 -1
  38. package/components/u-text/u-text.vue +226 -226
  39. package/components/u-textarea/u-textarea.vue +275 -275
  40. package/components/u-transition/u-transition.vue +1 -1
  41. package/components/u-waterfall/u-waterfall.vue +225 -0
  42. package/index.js +5 -2
  43. package/libs/config/props/formItem.js +1 -0
  44. package/libs/config/props/tag.js +30 -29
  45. package/libs/css/common.scss +4 -1
  46. package/libs/css/components.scss +5 -5
  47. package/libs/css/flex.scss +45 -45
  48. package/libs/mixin/mixin.js +2 -2
  49. package/libs/mixin/mpShare.js +15 -13
  50. package/package.json +1 -1
  51. package/types/comps/_common.d.ts +9 -0
  52. package/types/comps/actionSheet.d.ts +121 -0
  53. package/types/comps/album.d.ts +72 -0
  54. package/types/comps/alert.d.ts +55 -0
  55. package/types/comps/avatar.d.ts +85 -0
  56. package/types/comps/avatarGroup.d.ts +62 -0
  57. package/types/comps/backTop.d.ts +74 -0
  58. package/types/comps/badge.d.ts +76 -0
  59. package/types/comps/button.d.ts +169 -0
  60. package/types/comps/calendar.d.ts +164 -0
  61. package/types/comps/cell.d.ts +133 -0
  62. package/types/comps/cellGroup.d.ts +27 -0
  63. package/types/comps/checkbox.d.ts +69 -0
  64. package/types/comps/checkboxGroup.d.ts +93 -0
  65. package/types/comps/code.d.ts +69 -0
  66. package/types/comps/codeInput.d.ts +98 -0
  67. package/types/comps/col.d.ts +43 -0
  68. package/types/comps/collapse.d.ts +52 -0
  69. package/types/comps/collapseItem.d.ts +83 -0
  70. package/types/comps/countDown.d.ts +60 -0
  71. package/types/comps/countTo.d.ts +88 -0
  72. package/types/comps/datetimePicker.d.ts +146 -0
  73. package/types/comps/divider.d.ts +58 -0
  74. package/types/comps/empty.d.ts +72 -0
  75. package/types/comps/form.d.ts +76 -0
  76. package/types/comps/formItem.d.ts +68 -0
  77. package/types/comps/gap.d.ts +35 -0
  78. package/types/comps/grid.d.ts +34 -0
  79. package/types/comps/gridItem.d.ts +28 -0
  80. package/types/comps/icon.d.ts +93 -0
  81. package/types/comps/image.d.ts +119 -0
  82. package/types/comps/indexAnchor.d.ts +38 -0
  83. package/types/comps/indexItem.d.ts +18 -0
  84. package/types/comps/indexList.d.ts +39 -0
  85. package/types/comps/input.d.ts +234 -0
  86. package/types/comps/keyboard.d.ts +125 -0
  87. package/types/comps/line.d.ts +44 -0
  88. package/types/comps/lineProgress.d.ts +51 -0
  89. package/types/comps/link.d.ts +51 -0
  90. package/types/comps/list.d.ts +92 -0
  91. package/types/comps/listItem.d.ts +18 -0
  92. package/types/comps/loadMore.d.ts +108 -0
  93. package/types/comps/loadingIcon.d.ts +68 -0
  94. package/types/comps/loadingPage.d.ts +58 -0
  95. package/types/comps/modal.d.ts +115 -0
  96. package/types/comps/navbar.d.ts +113 -0
  97. package/types/comps/noNetwork.d.ts +40 -0
  98. package/types/comps/noticeBar.d.ts +85 -0
  99. package/types/comps/notify.d.ts +73 -0
  100. package/types/comps/numberBox.d.ts +155 -0
  101. package/types/comps/overlay.d.ts +46 -0
  102. package/types/comps/parse.d.ts +101 -0
  103. package/types/comps/picker.d.ts +115 -0
  104. package/types/comps/popup.d.ts +103 -0
  105. package/types/comps/radio.d.ts +77 -0
  106. package/types/comps/radioGroup.d.ts +97 -0
  107. package/types/comps/rate.d.ts +85 -0
  108. package/types/comps/readMore.d.ts +80 -0
  109. package/types/comps/row.d.ts +34 -0
  110. package/types/comps/scrollList.d.ts +51 -0
  111. package/types/comps/search.d.ts +167 -0
  112. package/types/comps/skeleton.d.ts +70 -0
  113. package/types/comps/slider.d.ts +79 -0
  114. package/types/comps/steps.d.ts +48 -0
  115. package/types/comps/stepsItem.d.ts +41 -0
  116. package/types/comps/sticky.d.ts +48 -0
  117. package/types/comps/subsection.d.ts +64 -0
  118. package/types/comps/swipeAction.d.ts +24 -0
  119. package/types/comps/swipeActionItem.d.ts +58 -0
  120. package/types/comps/swiper.d.ts +142 -0
  121. package/types/comps/swiperIndicator.d.ts +37 -0
  122. package/types/comps/switch.d.ts +73 -0
  123. package/types/comps/tabbar.d.ts +54 -0
  124. package/types/comps/tabbarItem.d.ts +52 -0
  125. package/types/comps/tabs.d.ts +85 -0
  126. package/types/comps/tag.d.ts +93 -0
  127. package/types/comps/text.d.ts +110 -0
  128. package/types/comps/textarea.d.ts +158 -0
  129. package/types/comps/toast.d.ts +59 -0
  130. package/types/comps/tooltip.d.ts +71 -0
  131. package/types/comps/transition.d.ts +61 -0
  132. package/types/comps/upload.d.ts +163 -0
  133. package/types/comps.d.ts +99 -0
  134. package/types/index.d.ts +47 -0
@@ -11,14 +11,14 @@
11
11
  :style="[barStyle]"
12
12
  :class="[
13
13
  mode === 'button' && 'u-subsection--button__bar',
14
- current === 0 &&
14
+ innerCurrent === 0 &&
15
15
  mode === 'subsection' &&
16
16
  'u-subsection__bar--first',
17
- current > 0 &&
18
- current < list.length - 1 &&
17
+ innerCurrent > 0 &&
18
+ innerCurrent < list.length - 1 &&
19
19
  mode === 'subsection' &&
20
20
  'u-subsection__bar--center',
21
- current === list.length - 1 &&
21
+ innerCurrent === list.length - 1 &&
22
22
  mode === 'subsection' &&
23
23
  'u-subsection__bar--last',
24
24
  ]"
@@ -83,6 +83,8 @@ export default {
83
83
  width: 0,
84
84
  height: 0,
85
85
  },
86
+ innerCurrent: '',
87
+ windowResizeCallback: {}
86
88
  };
87
89
  },
88
90
  watch: {
@@ -92,6 +94,9 @@ export default {
92
94
  current: {
93
95
  immediate: true,
94
96
  handler(n) {
97
+ if (n !== this.innerCurrent) {
98
+ this.innerCurrent = n
99
+ }
95
100
  // #ifdef APP-NVUE
96
101
  // 在安卓nvue上,如果通过translateX进行位移,到最后一个时,会导致右侧无法绘制圆角
97
102
  // 故用animation模块进行位移
@@ -129,7 +134,7 @@ export default {
129
134
  // 通过translateX移动滑块,其移动的距离为索引*item的宽度
130
135
  // #ifndef APP-NVUE
131
136
  style.transform = `translateX(${
132
- this.current * this.itemRect.width
137
+ this.innerCurrent * this.itemRect.width
133
138
  }px)`;
134
139
  // #endif
135
140
  if (this.mode === "subsection") {
@@ -156,16 +161,16 @@ export default {
156
161
  return (index) => {
157
162
  const style = {};
158
163
  style.fontWeight =
159
- this.bold && this.current === index ? "bold" : "normal";
164
+ this.bold && this.innerCurrent === index ? "bold" : "normal";
160
165
  style.fontSize = uni.$u.addUnit(this.fontSize);
161
166
  // subsection模式下,激活时默认为白色的文字
162
167
  if (this.mode === "subsection") {
163
168
  style.color =
164
- this.current === index ? "#fff" : this.inactiveColor;
169
+ this.innerCurrent === index ? "#fff" : this.inactiveColor;
165
170
  } else {
166
171
  // button模式下,激活时文字颜色默认为activeColor
167
172
  style.color =
168
- this.current === index
173
+ this.innerCurrent === index
169
174
  ? this.activeColor
170
175
  : this.inactiveColor;
171
176
  }
@@ -175,10 +180,18 @@ export default {
175
180
  },
176
181
  mounted() {
177
182
  this.init();
183
+ this.windowResizeCallback = (res) => {
184
+ this.init();
185
+ }
186
+ uni.onWindowResize(this.windowResizeCallback)
187
+ },
188
+ beforeUnmount() {
189
+ uni.offWindowResize(this.windowResizeCallback)
178
190
  },
179
191
  emits: ["change"],
180
192
  methods: {
181
193
  init() {
194
+ this.innerCurrent = this.current
182
195
  uni.$u.sleep().then(() => this.getRect());
183
196
  },
184
197
  // 判断展示文本
@@ -202,6 +215,7 @@ export default {
202
215
  // #endif
203
216
  },
204
217
  clickHandler(index) {
218
+ this.innerCurrent = index
205
219
  this.$emit("change", index);
206
220
  },
207
221
  },
@@ -221,20 +235,20 @@ export default {
221
235
  /* #endif */
222
236
 
223
237
  &--button {
224
- height: 32px;
238
+ height: 34px;
225
239
  background-color: rgb(238, 238, 239);
226
240
  padding: 3px;
227
- border-radius: 3px;
241
+ border-radius: 4px;
228
242
  align-items: stretch;
229
243
 
230
244
  &__bar {
231
245
  background-color: #ffffff;
232
- border-radius: 3px !important;
246
+ border-radius: 4px !important;
233
247
  }
234
248
  }
235
249
 
236
250
  &--subsection {
237
- height: 30px;
251
+ height: 32px;
238
252
  }
239
253
 
240
254
  &__bar {
@@ -246,8 +260,8 @@ export default {
246
260
  /* #endif */
247
261
 
248
262
  &--first {
249
- border-top-left-radius: 3px;
250
- border-bottom-left-radius: 3px;
263
+ border-top-left-radius: 4px;
264
+ border-bottom-left-radius: 4px;
251
265
  border-top-right-radius: 0px;
252
266
  border-bottom-right-radius: 0px;
253
267
  }
@@ -262,8 +276,8 @@ export default {
262
276
  &--last {
263
277
  border-top-left-radius: 0px;
264
278
  border-bottom-left-radius: 0px;
265
- border-top-right-radius: 3px;
266
- border-bottom-right-radius: 3px;
279
+ border-top-right-radius: 4px;
280
+ border-bottom-right-radius: 4px;
267
281
  }
268
282
  }
269
283
 
@@ -280,18 +294,18 @@ export default {
280
294
  }
281
295
 
282
296
  &--first {
283
- border-top-left-radius: 3px;
284
- border-bottom-left-radius: 3px;
297
+ border-top-left-radius: 4px;
298
+ border-bottom-left-radius: 4px;
285
299
  }
286
300
 
287
301
  &--last {
288
- border-top-right-radius: 3px;
289
- border-bottom-right-radius: 3px;
302
+ border-top-right-radius: 4px;
303
+ border-bottom-right-radius: 4px;
290
304
  }
291
305
 
292
306
  &__text {
293
307
  font-size: 12px;
294
- line-height: 12px;
308
+ line-height: 14px;
295
309
  @include flex;
296
310
  align-items: center;
297
311
  transition-property: color;
@@ -2,7 +2,7 @@
2
2
  <view
3
3
  class="u-swiper"
4
4
  :style="{
5
- backgroundColor: bgColor,
5
+ backgroundColor: bgColor,
6
6
  height: $u.addUnit(height),
7
7
  borderRadius: $u.addUnit(radius)
8
8
  }"
@@ -13,11 +13,10 @@
13
13
  >
14
14
  <u-loading-icon mode="circle"></u-loading-icon>
15
15
  </view>
16
- <swiper
17
- v-else
16
+ <swiper
18
17
  class="u-swiper__wrapper"
19
- :style="{
20
- height: $u.addUnit(height),
18
+ :style="{
19
+ height: $u.addUnit(height)
21
20
  }"
22
21
  @change="change"
23
22
  :circular="circular"
@@ -206,7 +205,7 @@
206
205
 
207
206
  <style lang="scss" scoped>
208
207
  @import "../../libs/css/components.scss";
209
-
208
+
210
209
  .u-swiper {
211
210
  @include flex;
212
211
  justify-content: center;
@@ -214,8 +213,7 @@
214
213
  position: relative;
215
214
  overflow: hidden;
216
215
 
217
- &__wrapper {
218
- flex: 1;
216
+ &__wrapper {
219
217
 
220
218
  &__item {
221
219
  flex: 1;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view
3
- class="u-switch"
3
+ class="u-switch cursor-pointer"
4
4
  :class="[disabled && 'u-switch--disabled']"
5
5
  :style="[switchStyle, $u.addStyle(customStyle)]"
6
6
  @tap="clickHandler"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view
3
- class="u-tabbar-item"
3
+ class="u-tabbar-item cursor-pointer"
4
4
  :style="[$u.addStyle(customStyle)]"
5
5
  @tap="clickHandler"
6
6
  >
@@ -335,6 +335,7 @@
335
335
  &__text {
336
336
  font-size: 15px;
337
337
  color: $u-content-color;
338
+ white-space: nowrap;
338
339
 
339
340
  &--disabled {
340
341
  color: $u-disabled-color !important;
@@ -78,7 +78,10 @@ export default {
78
78
  // 内置图标,或绝对路径的图片
79
79
  icon: {
80
80
  type: String,
81
- default: () => uni.$u.props.tag.icon
82
- }
81
+ default: () => uni.$u.props.tag.icon,
82
+ },
83
+ type: String,
84
+ default: () => uni.$u.props.tag.iconColor
85
+ }
83
86
  }
84
87
  }
@@ -4,7 +4,7 @@
4
4
  :show="show"
5
5
  style="display: inline-flex;"
6
6
  >
7
- <view class="u-tag-wrapper">
7
+ <view class="u-tag-wrapper cursor-pointer">
8
8
  <view
9
9
  class="u-tag"
10
10
  :class="[`u-tag--${shape}`, !plain && `u-tag--${type}`, plain && `u-tag--${type}--plain`, `u-tag--${size}`, plain && plainFill && `u-tag--${type}--plain--fill`]"