uview-plus 3.3.5 → 3.3.7

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 (43) hide show
  1. package/changelog.md +55 -0
  2. package/components/u-action-sheet/props.js +6 -1
  3. package/components/u-action-sheet/u-action-sheet.vue +4 -5
  4. package/components/u-album/props.js +10 -0
  5. package/components/u-album/u-album.vue +9 -3
  6. package/components/u-calendar/header.vue +2 -0
  7. package/components/u-calendar/month.vue +1 -0
  8. package/components/u-cell/u-cell.vue +20 -1
  9. package/components/u-checkbox/u-checkbox.vue +28 -18
  10. package/components/u-code/u-code.vue +0 -5
  11. package/components/u-count-down/u-count-down.vue +0 -5
  12. package/components/u-form-item/u-form-item.vue +1 -1
  13. package/components/u-grid-item/u-grid-item.vue +0 -5
  14. package/components/u-index-list/props.js +6 -1
  15. package/components/u-index-list/u-index-list.vue +169 -42
  16. package/components/u-modal/u-modal.vue +3 -3
  17. package/components/u-notify/u-notify.vue +0 -5
  18. package/components/u-number-box/u-number-box.vue +1 -0
  19. package/components/u-parse/node/node.vue +1 -1
  20. package/components/u-parse/u-parse.vue +1 -7
  21. package/components/u-picker/u-picker.vue +2 -1
  22. package/components/u-popup/u-popup.vue +3 -1
  23. package/components/u-row-notice/u-row-notice.vue +1 -8
  24. package/components/u-scroll-list/nvue.js +1 -1
  25. package/components/u-scroll-list/u-scroll-list.vue +5 -2
  26. package/components/u-slider/props.js +45 -19
  27. package/components/u-slider/u-slider.vue +376 -7
  28. package/components/u-sticky/u-sticky.vue +0 -5
  29. package/components/u-swipe-action-item/nvue.js +0 -5
  30. package/components/u-tabs/u-tabs.vue +11 -3
  31. package/components/u-toast/u-toast.vue +10 -10
  32. package/components/u-upload/u-upload.vue +9 -4
  33. package/components/u-upload/utils.js +10 -4
  34. package/components/u-waterfall/u-waterfall.vue +1 -1
  35. package/libs/config/props/actionSheet.js +2 -1
  36. package/libs/config/props/indexList.js +2 -1
  37. package/libs/config/props/slider.js +3 -1
  38. package/libs/css/common.scss +1 -1
  39. package/libs/mixin/mixin.js +1 -7
  40. package/package.json +1 -1
  41. package/types/comps/album.d.ts +10 -0
  42. package/types/index.d.ts +155 -29
  43. package/components/u-slider/nvue - /345/211/257/346/234/254.js" +0 -180
package/changelog.md CHANGED
@@ -1,3 +1,58 @@
1
+ ## 3.3.7(2024-07-29)
2
+ feat: 支持IndexList组件支持在弹窗等场景下使用及联动优化
3
+
4
+ feat: popup组件支持v-model:show双向绑定
5
+
6
+ feat: 优化tabs的current双向绑定
7
+
8
+ fix: checkbox独立使用时checked赋初始值可以,但是手动切换时值没有做双向绑定! #455
9
+
10
+ feat: slider组件支持区间双滑块
11
+
12
+ fix: toast 支持自定义图标?可传入了决对路径的 icon也没有用 #409
13
+
14
+ feat: form-item校验失败时 增加class方便自定义显示错误的展示方式 #394
15
+
16
+ fix: up-cell的required配置不生效 #395
17
+
18
+ fix: 横向滚动组件,微信小程序编译后会有警告 #415
19
+
20
+ fix: u-picker内部对默认值defaultIndex的监听 #425
21
+
22
+ feat: toast 组件支持遮掩层穿透 #417
23
+
24
+ fix: 兼容vue的slot编译bug #423
25
+
26
+ fix: upload 微信小程序 点击预览视频报错 #424
27
+
28
+ fix: u-number-box 组件修改【integer, decimalLength, min, max 】props时没有触发绑定值更新 #429
29
+
30
+ feat: Tabs组件能否支持自定义插槽 #439
31
+
32
+ feat: ActionSheet 可以配置最大高度吗, 我当做select使用了。 #445
33
+
34
+ fix: cursor-pointer优化
35
+
36
+ feat: 新版slider组件兼容NVUE改造
37
+
38
+ feat: 新增slider组件手动实现以支持样式自定义
39
+
40
+ perf:补充TS声明提示信息
41
+
42
+ 修复:ActionSheet 操作菜单cancelText属性为空DOM节点还存在并且可以点击问题
43
+
44
+ fix: 去除预留的beforeDestroy兼容容易在某些sdk下不识别条件编译
45
+
46
+ ## 3.3.6(2024-07-23)
47
+ feat: u-album组件添加radius,shape参数,定义参考当前u-image参数
48
+
49
+ fix: 修复了calendar组件title和日期title未垂直居中的问题
50
+
51
+ fix: update:modelValue缺失emit定义
52
+
53
+ ## 3.3.5(2024-07-10)
54
+ picker组件支持hasInput模式
55
+
1
56
  ## 3.3.4(2024-07-07)
2
57
  fix: input组件双向绑定问题 #419
3
58
 
@@ -52,6 +52,11 @@ export const props = defineMixin({
52
52
  round: {
53
53
  type: [Boolean, String, Number],
54
54
  default: () => defProps.actionSheet.round
55
- }
55
+ },
56
+ // 选项区域最大高度
57
+ wrapMaxHeight: {
58
+ type: [String],
59
+ default: () => defProps.actionSheet.wrapMaxHeight
60
+ },
56
61
  }
57
62
  })
@@ -34,7 +34,7 @@
34
34
  >{{description}}</text>
35
35
  <slot>
36
36
  <u-line v-if="description"></u-line>
37
- <view class="u-action-sheet__item-wrap">
37
+ <scroll-view scroll-y class="u-action-sheet__item-wrap" :style="{maxHeight: wrapMaxHeight}">
38
38
  <view :key="index" v-for="(item, index) in actions">
39
39
  <!-- #ifdef MP -->
40
40
  <button
@@ -85,7 +85,7 @@
85
85
  <!-- #endif -->
86
86
  <u-line v-if="index !== actions.length - 1"></u-line>
87
87
  </view>
88
- </view>
88
+ </scroll-view>
89
89
  </slot>
90
90
  <u-gap
91
91
  bgColor="#eaeaec"
@@ -93,11 +93,10 @@
93
93
  v-if="cancelText"
94
94
  ></u-gap>
95
95
  <view class="u-action-sheet__item-wrap__item u-action-sheet__cancel"
96
- hover-class="u-action-sheet--hover" @tap="cancel">
96
+ hover-class="u-action-sheet--hover" @tap="cancel" v-if="cancelText">
97
97
  <text
98
98
  @touchmove.stop.prevent
99
99
  :hover-stay-time="150"
100
- v-if="cancelText"
101
100
  class="u-action-sheet__cancel-text"
102
101
  >{{cancelText}}</text>
103
102
  </view>
@@ -271,7 +270,7 @@
271
270
  font-size: $u-action-sheet-cancel-text-font-size;
272
271
  color: $u-action-sheet-cancel-text-color;
273
272
  text-align: center;
274
- padding: $u-action-sheet-cancel-text-font-size;
273
+ // padding: $u-action-sheet-cancel-text-font-size;
275
274
  }
276
275
 
277
276
  &--hover {
@@ -56,6 +56,16 @@ export const props = defineMixin({
56
56
  showMore: {
57
57
  type: Boolean,
58
58
  default: () => defProps.album.showMore
59
+ },
60
+ // 图片形状,circle-圆形,square-方形
61
+ shape: {
62
+ type: String,
63
+ default: () => defProps.image.shape
64
+ },
65
+ // 圆角,单位任意
66
+ radius: {
67
+ type: [String, Number],
68
+ default: () => defProps.image.radius
59
69
  }
60
70
  }
61
71
  })
@@ -26,7 +26,8 @@
26
26
  :style="[
27
27
  {
28
28
  width: imageWidth,
29
- height: imageHeight
29
+ height: imageHeight,
30
+ borderRadius: shape == 'circle' ? '10000px' : addUnit(radius)
30
31
  }
31
32
  ]"
32
33
  ></image>
@@ -38,6 +39,9 @@
38
39
  index1 === showUrls[showUrls.length - 1].length - 1
39
40
  "
40
41
  class="u-album__row__wrapper__text"
42
+ :style="{
43
+ borderRadius: shape == 'circle' ? '50%' : addUnit(radius),
44
+ }"
41
45
  >
42
46
  <up-text
43
47
  :text="`+${urls.length - maxCount}`"
@@ -79,7 +83,8 @@ const dom = uni.requireNativePlugin('dom')
79
83
  * @property {Boolean} previewFullImage 是否可以预览图片 (默认 true )
80
84
  * @property {String | Number} rowCount 每行展示图片数量,如设置,singleSize和multipleSize将会无效 (默认 3 )
81
85
  * @property {Boolean} showMore 超出maxCount时是否显示查看更多的提示 (默认 true )
82
- *
86
+ * @property {String} shape 图片形状,circle-圆形,square-方形 (默认 'square' )
87
+ * @property {String | Number} radius 圆角值,单位任意,如果为数值,则为px单位 (默认 0 )
83
88
  * @event {Function} albumWidth 某些特殊的情况下,需要让文字与相册的宽度相等,这里事件的形式对外发送 (回调参数 width )
84
89
  * @example <u-album :urls="urls2" @albumWidth="width => albumWidth = width" multipleSize="68" ></u-album>
85
90
  */
@@ -173,6 +178,7 @@ export default {
173
178
  }
174
179
  },
175
180
  methods: {
181
+ addUnit,
176
182
  // 预览图片
177
183
  onPreviewTap(url) {
178
184
  const urls = this.urls.map((item) => {
@@ -261,4 +267,4 @@ export default {
261
267
  }
262
268
  }
263
269
  }
264
- </style>
270
+ </style>
@@ -65,6 +65,8 @@
65
65
  @import "../../libs/css/components.scss";
66
66
 
67
67
  .u-calendar-header {
68
+ display: flex;
69
+ flex-direction: column;
68
70
  padding-bottom: 4px;
69
71
 
70
72
  &__title {
@@ -468,6 +468,7 @@
468
468
  .u-calendar-month {
469
469
 
470
470
  &__title {
471
+ display: flex;
471
472
  font-size: 14px;
472
473
  line-height: 42px;
473
474
  height: 42px;
@@ -16,7 +16,7 @@
16
16
  <slot name="title" v-if="$slots.title || !title">
17
17
  </slot>
18
18
  <text v-else class="u-cell__title-text" :style="[titleTextStyle]"
19
- :class="[disabled && 'u-cell--disabled', size === 'large' && 'u-cell__title-text--large']">{{ title }}</text>
19
+ :class="[required && 'u-cell--required', disabled && 'u-cell--disabled', size === 'large' && 'u-cell__title-text--large']">{{ title }}</text>
20
20
  <slot name="label">
21
21
  <text class="u-cell__label" v-if="label"
22
22
  :class="[disabled && 'u-cell--disabled', size === 'large' && 'u-cell__label--large']">{{ label }}</text>
@@ -231,6 +231,25 @@
231
231
  }
232
232
  }
233
233
 
234
+ &--required {
235
+ /* #ifndef APP-NVUE */
236
+ overflow: visible;
237
+ /* #endif */
238
+ @include flex;
239
+ align-items: center;
240
+ }
241
+
242
+ &--required:before {
243
+ position: absolute;
244
+ /* #ifndef APP-NVUE */
245
+ content: '*';
246
+ /* #endif */
247
+ left: -8px;
248
+ margin-top: 4rpx;
249
+ font-size: 14px;
250
+ color: $u-error;
251
+ }
252
+
234
253
  &--clickable {
235
254
  background-color: $u-cell-clickable-color;
236
255
  }
@@ -189,7 +189,7 @@
189
189
  mounted() {
190
190
  this.init()
191
191
  },
192
- emits: ["change"],
192
+ emits: ["change", "update:checked"],
193
193
  methods: {
194
194
  init() {
195
195
  if (!this.usedAlone) {
@@ -198,21 +198,25 @@
198
198
  if (!this.parent) {
199
199
  error('u-checkbox必须搭配u-checkbox-group组件使用')
200
200
  }
201
- }
202
- // #ifdef VUE2
203
- const value = this.parentData.value
204
- // #endif
205
- // #ifdef VUE3
206
- const value = this.parentData.modelValue
207
- // #endif
208
- // 设置初始化时,是否默认选中的状态,父组件u-checkbox-group的value可能是array,所以额外判断
209
- if (this.checked) {
210
- this.isChecked = true
211
- } else if (!this.usedAlone && test.array(value)) {
212
- // 查找数组是是否存在this.name元素值
213
- this.isChecked = value.some(item => {
214
- return item === this.name
215
- })
201
+ // #ifdef VUE2
202
+ const value = this.parentData.value
203
+ // #endif
204
+ // #ifdef VUE3
205
+ const value = this.parentData.modelValue
206
+ // #endif
207
+ // 设置初始化时,是否默认选中的状态,父组件u-checkbox-group的value可能是array,所以额外判断
208
+ if (this.checked) {
209
+ this.isChecked = true
210
+ } else if (!this.usedAlone && test.array(value)) {
211
+ // 查找数组是是否存在this.name元素值
212
+ this.isChecked = value.some(item => {
213
+ return item === this.name
214
+ })
215
+ }
216
+ } else {
217
+ if (this.checked) {
218
+ this.isChecked = true
219
+ }
216
220
  }
217
221
  },
218
222
  updateParentData() {
@@ -244,6 +248,10 @@
244
248
  },
245
249
  emitEvent() {
246
250
  this.$emit('change', this.isChecked)
251
+ // 双向绑定
252
+ if (this.usedAlone) {
253
+ this.$emit('update:checked', this.isChecked)
254
+ }
247
255
  // 尝试调用u-form的验证方法,进行一定延迟,否则微信小程序更新可能会不及时
248
256
  this.$nextTick(() => {
249
257
  formValidate(this, 'change')
@@ -262,8 +270,10 @@
262
270
  }
263
271
  },
264
272
  watch:{
265
- checked(){
266
- this.isChecked = this.checked
273
+ checked(newValue, oldValue){
274
+ if (newValue !== this.isChecked) {
275
+ this.isChecked = newValue
276
+ }
267
277
  }
268
278
  }
269
279
  }
@@ -119,12 +119,7 @@
119
119
  }
120
120
  },
121
121
  // 组件销毁的时候,清除定时器,否则定时器会继续存在,系统不会自动清除
122
- // #ifdef VUE2
123
- beforeDestroy() {
124
- // #endif
125
- // #ifdef VUE3
126
122
  beforeUnmount() {
127
- // #endif
128
123
  this.setTimeToStorage()
129
124
  clearTimeout(this.timer)
130
125
  this.timer = null
@@ -141,12 +141,7 @@
141
141
  this.timer = null
142
142
  }
143
143
  },
144
- // #ifdef VUE2
145
- beforeDestroy() {
146
- // #endif
147
- // #ifdef VUE3
148
144
  beforeUnmount() {
149
- // #endif
150
145
  this.clearTimeout()
151
146
  }
152
147
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="u-form-item">
2
+ <view class="u-form-item" :class="{'u-form-item--error':(!!message && parentData.errorType === 'message')}">
3
3
  <view
4
4
  class="u-form-item__body"
5
5
  @tap="clickHandler"
@@ -172,12 +172,7 @@
172
172
  }
173
173
  }
174
174
  },
175
- // #ifdef VUE2
176
- beforeDestroy() {
177
- // #endif
178
- // #ifdef VUE3
179
175
  beforeUnmount() {
180
- // #endif
181
176
  // 移除事件监听,释放性能
182
177
  uni.$off('$uGridItem')
183
178
  }
@@ -26,6 +26,11 @@ export const props = defineMixin({
26
26
  customNavHeight: {
27
27
  type: [String, Number],
28
28
  default: () => defProps.indexList.customNavHeight
29
- }
29
+ },
30
+ // 是否开启底部安全距离适配
31
+ safeBottomFix: {
32
+ type: Boolean,
33
+ default: () => defProps.indexList.safeBottomFix
34
+ },
30
35
  }
31
36
  })