uview-plus 3.3.6 → 3.3.8

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 (46) hide show
  1. package/changelog.md +58 -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-cell/u-cell.vue +20 -1
  5. package/components/u-checkbox/u-checkbox.vue +29 -19
  6. package/components/u-code/u-code.vue +0 -5
  7. package/components/u-collapse-item/props.js +6 -1
  8. package/components/u-collapse-item/u-collapse-item.vue +5 -3
  9. package/components/u-count-down/u-count-down.vue +0 -5
  10. package/components/u-dropdown/u-dropdown.vue +1 -1
  11. package/components/u-form-item/u-form-item.vue +1 -1
  12. package/components/u-grid-item/u-grid-item.vue +0 -5
  13. package/components/u-index-list/props.js +6 -1
  14. package/components/u-index-list/u-index-list.vue +168 -42
  15. package/components/u-lazy-load/u-lazy-load.vue +10 -3
  16. package/components/u-loading-icon/u-loading-icon.vue +2 -0
  17. package/components/u-modal/u-modal.vue +6 -3
  18. package/components/u-notify/u-notify.vue +0 -5
  19. package/components/u-number-box/u-number-box.vue +1 -0
  20. package/components/u-parse/node/node.vue +9 -1
  21. package/components/u-parse/u-parse.vue +1 -7
  22. package/components/u-picker/u-picker.vue +1 -0
  23. package/components/u-popup/u-popup.vue +3 -1
  24. package/components/u-row-notice/u-row-notice.vue +1 -8
  25. package/components/u-scroll-list/nvue.js +1 -1
  26. package/components/u-scroll-list/u-scroll-list.vue +5 -2
  27. package/components/u-slider/props.js +45 -19
  28. package/components/u-slider/u-slider.vue +414 -7
  29. package/components/u-sticky/u-sticky.vue +0 -5
  30. package/components/u-swipe-action-item/nvue.js +0 -5
  31. package/components/u-tabbar-item/u-tabbar-item.vue +3 -0
  32. package/components/u-tabs/u-tabs.vue +21 -4
  33. package/components/u-toast/u-toast.vue +10 -10
  34. package/components/u-upload/u-upload.vue +9 -4
  35. package/components/u-upload/utils.js +10 -4
  36. package/components/u-waterfall/u-waterfall.vue +11 -5
  37. package/libs/config/props/actionSheet.js +2 -1
  38. package/libs/config/props/collapseItem.js +2 -1
  39. package/libs/config/props/indexList.js +2 -1
  40. package/libs/config/props/slider.js +3 -1
  41. package/libs/css/common.scss +1 -1
  42. package/libs/css/flex.scss +3 -0
  43. package/libs/mixin/mixin.js +23 -8
  44. package/package.json +1 -1
  45. package/types/index.d.ts +154 -29
  46. package/components/u-slider/nvue - /345/211/257/346/234/254.js" +0 -180
package/changelog.md CHANGED
@@ -1,3 +1,61 @@
1
+ ## 3.3.8(2024-07-31)
2
+ feat: slider支持进度条任意位置触发按钮拖动
3
+
4
+ fix: 修复app-vue下modal标题不居中
5
+
6
+ fix: #459 TS setConfig 声明异常
7
+
8
+ feat: tabs组件增加longPress长按事件
9
+
10
+ feat: 新增showRight属性控制collapse右侧图标显隐
11
+
12
+ fix: 优化nvue下css警告
13
+
14
+ ## 3.3.7(2024-07-29)
15
+ feat: 支持IndexList组件支持在弹窗等场景下使用及联动优化
16
+
17
+ feat: popup组件支持v-model:show双向绑定
18
+
19
+ feat: 优化tabs的current双向绑定
20
+
21
+ fix: checkbox独立使用时checked赋初始值可以,但是手动切换时值没有做双向绑定! #455
22
+
23
+ feat: slider组件支持区间双滑块
24
+
25
+ fix: toast 支持自定义图标?可传入了决对路径的 icon也没有用 #409
26
+
27
+ feat: form-item校验失败时 增加class方便自定义显示错误的展示方式 #394
28
+
29
+ fix: up-cell的required配置不生效 #395
30
+
31
+ fix: 横向滚动组件,微信小程序编译后会有警告 #415
32
+
33
+ fix: u-picker内部对默认值defaultIndex的监听 #425
34
+
35
+ feat: toast 组件支持遮掩层穿透 #417
36
+
37
+ fix: 兼容vue的slot编译bug #423
38
+
39
+ fix: upload 微信小程序 点击预览视频报错 #424
40
+
41
+ fix: u-number-box 组件修改【integer, decimalLength, min, max 】props时没有触发绑定值更新 #429
42
+
43
+ feat: Tabs组件能否支持自定义插槽 #439
44
+
45
+ feat: ActionSheet 可以配置最大高度吗, 我当做select使用了。 #445
46
+
47
+ fix: cursor-pointer优化
48
+
49
+ feat: 新版slider组件兼容NVUE改造
50
+
51
+ feat: 新增slider组件手动实现以支持样式自定义
52
+
53
+ perf:补充TS声明提示信息
54
+
55
+ 修复:ActionSheet 操作菜单cancelText属性为空DOM节点还存在并且可以点击问题
56
+
57
+ fix: 去除预留的beforeDestroy兼容容易在某些sdk下不识别条件编译
58
+
1
59
  ## 3.3.6(2024-07-23)
2
60
  feat: u-album组件添加radius,shape参数,定义参考当前u-image参数
3
61
 
@@ -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 {
@@ -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
  }
@@ -91,7 +91,7 @@
91
91
  }
92
92
  },
93
93
  computed: {
94
- // 是否禁用,如果父组件u-raios-group禁用的话,将会忽略子组件的配置
94
+ // 是否禁用,如果父组件u-radios-group禁用的话,将会忽略子组件的配置
95
95
  elDisabled() {
96
96
  return this.disabled !== '' ? this.disabled : this.parentData.disabled !== null ? this.parentData.disabled : false;
97
97
  },
@@ -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
@@ -56,6 +56,11 @@ export const props = defineMixin({
56
56
  duration: {
57
57
  type: Number,
58
58
  default: () => defProps.collapseItem.duration
59
- }
59
+ },
60
+ // 显示右侧图标
61
+ showRight: {
62
+ type: Boolean,
63
+ default: () => defProps.collapseItem.showRight
64
+ },
60
65
  }
61
66
  })
@@ -33,9 +33,11 @@
33
33
  </slot>
34
34
  </template>
35
35
  <template #right-icon>
36
- <u-icon v-if="!$slots['right-icon']" :size="16" name="arrow-right"></u-icon>
37
- <slot name="right-icon">
38
- </slot>
36
+ <template v-if="showRight">
37
+ <u-icon v-if="!$slots['right-icon']" :size="16" name="arrow-right"></u-icon>
38
+ <slot name="right-icon">
39
+ </slot>
40
+ </template>
39
41
  </template>
40
42
  </u-cell>
41
43
  <view
@@ -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
  }
@@ -244,7 +244,7 @@
244
244
  &__popup {
245
245
  position: relative;
246
246
  z-index: 10;
247
- transition: all 0.3s;
247
+ transition: transform 0.3s;
248
248
  transform: translate3D(0, -100%, 0);
249
249
  overflow: hidden;
250
250
  }
@@ -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
  })