uview-plus 3.4.36 → 3.4.38

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 (33) hide show
  1. package/changelog.md +11 -0
  2. package/components/u-datetime-picker/u-datetime-picker.vue +1 -1
  3. package/components/u-modal/modal.js +1 -0
  4. package/components/u-modal/props.js +5 -0
  5. package/components/u-modal/u-modal.vue +2 -1
  6. package/components/u-picker/picker.js +1 -0
  7. package/components/u-picker/props.js +5 -0
  8. package/components/u-picker/u-picker.vue +65 -19
  9. package/components/u-picker-data/u-picker-data.vue +1 -1
  10. package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
  11. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  12. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  13. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  14. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  15. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  16. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  17. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  18. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  19. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  20. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  21. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  22. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  23. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  24. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  25. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  26. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  27. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  28. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  29. package/libs/util/gcanvas/env/canvas.js +0 -0
  30. package/libs/util/gcanvas/env/image.js +0 -0
  31. package/libs/util/gcanvas/env/tool.js +0 -0
  32. package/libs/util/gcanvas/index.js +0 -0
  33. package/package.json +1 -1
package/changelog.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 3.4.38(2025-05-30)
2
+ fix: 修复picker-data快捷组件缺少index
3
+
4
+ fix: 修复picker组件双向绑定初始化及取消后复原再次打开后的当前项目
5
+
6
+
7
+ ## 3.4.37(2025-05-29)
8
+ feat: modal支持设置动画时间
9
+
10
+ fix: DatetimePicker v-model 绑定异步设置无效 (#803)
11
+
1
12
  ## 3.4.36(2025-05-28)
2
13
  fix: lazy-load图片为空时显示错误
3
14
 
@@ -131,7 +131,7 @@
131
131
  computed: {
132
132
  // 如果以下这些变量发生了变化,意味着需要重新初始化各列的值
133
133
  propsChange() {
134
- return [this.mode, this.maxDate, this.minDate, this.minHour, this.maxHour, this.minMinute, this.maxMinute, this.filter, ]
134
+ return [this.mode, this.maxDate, this.minDate, this.minHour, this.maxHour, this.minMinute, this.maxMinute, this.filter, this.modelValue]
135
135
  },
136
136
  // input的props
137
137
  inputPropsInner() {
@@ -26,6 +26,7 @@ export default {
26
26
  negativeTop: 0,
27
27
  width: '650rpx',
28
28
  confirmButtonShape: '',
29
+ duration: 400,
29
30
  contentTextAlign: 'left',
30
31
  asyncCloseTip: '操作中...',
31
32
  asyncCancelClose: false,
@@ -82,6 +82,11 @@ export const props = defineMixin({
82
82
  type: String,
83
83
  default: () => defProps.modal.confirmButtonShape
84
84
  },
85
+ // 弹窗动画过度时间
86
+ duration: {
87
+ type: [Number],
88
+ default: defProps.modal.duration
89
+ },
85
90
  // 文案对齐方式
86
91
  contentTextAlign: {
87
92
  type: String,
@@ -11,7 +11,7 @@
11
11
  }"
12
12
  :closeOnClickOverlay="closeOnClickOverlay"
13
13
  :safeAreaInsetBottom="false"
14
- :duration="400"
14
+ :duration="duration"
15
15
  @click="clickHandler"
16
16
  >
17
17
  <view
@@ -118,6 +118,7 @@
118
118
  * @property {String | Number} negativeTop 往上偏移的值,给一个负的margin-top,往上偏移,避免和键盘重合的情况,单位任意,数值则默认为px单位 (默认 0 )
119
119
  * @property {String | Number} width modal宽度,不支持百分比,可以数值,px,rpx单位 (默认 '650rpx' )
120
120
  * @property {String} confirmButtonShape 确认按钮的样式,如设置,将不会显示取消按钮
121
+ * @property {Number} duration 弹窗动画过度时间 (默认 400 )
121
122
  * @event {Function} confirm 点击确认按钮时触发
122
123
  * @event {Function} cancel 点击取消按钮时触发
123
124
  * @event {Function} close 点击遮罩关闭出发,closeOnClickOverlay为true有效
@@ -23,6 +23,7 @@ export default {
23
23
  confirmColor: '',
24
24
  visibleItemCount: 5,
25
25
  keyName: 'text',
26
+ valueName: 'value',
26
27
  closeOnClickOverlay: false,
27
28
  defaultIndex: [],
28
29
  immediateChange: true,
@@ -93,6 +93,11 @@ export const props = defineMixin({
93
93
  type: String,
94
94
  default: () => defProps.picker.keyName
95
95
  },
96
+ // 选项对象中,需要获取的属性值键名
97
+ valueName: {
98
+ type: String,
99
+ default: () => defProps.picker.valueName
100
+ },
96
101
  // 是否允许点击遮罩关闭选择器
97
102
  closeOnClickOverlay: {
98
103
  type: Boolean,
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="u-picker-warrper">
2
+ <view class="u-picker-wraper">
3
3
  <view v-if="hasInput" class="u-picker-input cursor-pointer" @click="onShowByClickInput">
4
4
  <slot :value="inputLabel">
5
5
  </slot>
@@ -124,6 +124,14 @@ export default {
124
124
  }
125
125
  },
126
126
  watch: {
127
+ // 监听columns参数的变化
128
+ columns: {
129
+ immediate: true,
130
+ deep:true,
131
+ handler(n) {
132
+ this.setColumns(n)
133
+ }
134
+ },
127
135
  // 监听默认索引的变化,重新设置对应的值
128
136
  defaultIndex: {
129
137
  immediate: true,
@@ -137,14 +145,41 @@ export default {
137
145
  }
138
146
  }
139
147
  },
140
- // 监听columns参数的变化
141
- columns: {
148
+ modelValue: {
142
149
  immediate: true,
143
150
  deep:true,
144
- handler(n) {
145
- this.setColumns(n)
151
+ handler(n,o) {
152
+ // 修复uniapp调用子组件直接:defaultIndex="[0]"这样写
153
+ // v-model的值变化时候导致defaultIndexwatch也会执行的问题
154
+ //单纯vue不会出现
155
+ if (!o || n.join("/") != o.join("/")) {
156
+ let arr = [];
157
+ if (n != null) {
158
+ n.forEach((element, index) => {
159
+ let currentCols = this.getColumnValues(index)
160
+ if (currentCols && Object.prototype.toString.call(currentCols) === '[object Object]') {
161
+ currentCols.forEach((item, index2) => {
162
+ if (item[this.keyName] == element) {
163
+ arr.push(index2)
164
+ }
165
+ })
166
+ } else {
167
+ currentCols.forEach((item, index2) => {
168
+ if (item == element) {
169
+ arr.push(index2)
170
+ }
171
+ })
172
+ }
173
+ });
174
+ // alert(arr)
175
+ if (arr.length == 0 && this.defaultIndex) {
176
+ } else {
177
+ this.setIndexs(arr, true)
178
+ }
179
+ }
180
+ }
146
181
  }
147
- },
182
+ }
148
183
  },
149
184
  emits: ['close', 'cancel', 'confirm', 'change', 'update:modelValue', 'update:show'],
150
185
  computed: {
@@ -178,9 +213,9 @@ export default {
178
213
  let res = []
179
214
  //区分是不是对象数组
180
215
  if (items[0] && Object.prototype.toString.call(items[0]) === '[object Object]') {
181
- //对象数组返回id集合
216
+ //对象数组返回属性值集合
182
217
  items.forEach(element => {
183
- res.push(element && element['id'])
218
+ res.push(element && element[this.valueName])
184
219
  });
185
220
  } else {
186
221
  //非对象数组返回元素集合
@@ -213,6 +248,7 @@ export default {
213
248
  if (this.hasInput) {
214
249
  this.showByClickInput = false
215
250
  }
251
+ this.setDefault()
216
252
  this.$emit('update:show', false)
217
253
  this.$emit('close')
218
254
  }
@@ -222,14 +258,13 @@ export default {
222
258
  if (this.hasInput) {
223
259
  this.showByClickInput = false
224
260
  }
261
+ this.setDefault()
225
262
  this.$emit('update:show', false)
226
263
  this.$emit('cancel')
227
264
  },
228
- // 点击工具栏的确定按钮
229
- confirm() {
230
- //如果用户有没有触发过change
231
- if (!this.currentActiveValue.length) {
232
- let arr = [0]
265
+ setDefault() {
266
+ let arr = [0]
267
+ if (this.lastIndex.length == 0) {
233
268
  //如果有默认值&&默认值的数组长度是正确的,就用默认值
234
269
  if (Array.isArray(this.defaultIndex) && this.defaultIndex.length == this.innerColumns.length) {
235
270
  arr = [...this.defaultIndex];
@@ -237,13 +272,23 @@ export default {
237
272
  //否则默认都选中第一个
238
273
  arr = Array(this.innerColumns.length).fill(0);
239
274
  }
240
- this.setLastIndex(arr)
241
- this.setIndexs(arr)
275
+ } else {
276
+ arr = deepClone(this.lastIndex)
277
+ }
278
+ this.setLastIndex(arr)
279
+ this.setIndexs(arr)
280
+ },
281
+ // 点击工具栏的确定按钮
282
+ confirm() {
283
+ // 如果用户有没有触发过change
284
+ if (!this.currentActiveValue.length) {
285
+ this.setDefault()
242
286
  }
243
287
  this.$emit('update:modelValue', this.inputValue)
244
288
  if (this.hasInput) {
245
289
  this.showByClickInput = false
246
290
  }
291
+ this.setLastIndex(this.innerIndex)
247
292
  this.$emit('update:show', false)
248
293
  this.$emit('confirm', {
249
294
  indexs: this.innerIndex,
@@ -274,13 +319,14 @@ export default {
274
319
  this.columnIndex = columnIndex
275
320
  const values = this.innerColumns
276
321
  // 将当前的各项变化索引,设置为"上一次"的索引变化值
277
- this.setLastIndex(value)
322
+ // this.setLastIndex(value)
278
323
  this.setIndexs(value)
279
324
  //如果是非自带输入框才会在change时候触发v-model绑值的变化
280
325
  //否则会非常的奇怪,用户未确认,值就变了
281
- if (!this.hasInput) {
282
- this.$emit('update:modelValue', this.inputValue)
283
- }
326
+ // if (!this.hasInput) {
327
+ // this.$emit('update:modelValue', this.inputValue)
328
+ // }
329
+
284
330
  this.$emit('change', {
285
331
  // #ifndef MP-WEIXIN || MP-LARK
286
332
  // 微信小程序不能传递this,会因为循环引用而报错
@@ -74,7 +74,7 @@ export default {
74
74
  watch: {
75
75
  modelValue() {
76
76
  if (this.modelValue) {
77
- this.options.forEach((ele) => {
77
+ this.options.forEach((ele, index) => {
78
78
  if (ele[this.valueKey] == this.modelValue) {
79
79
  this.current = ele[this.labelKey]
80
80
  this.defaultIndex = [index]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙移动组件库。",
5
- "version": "3.4.36",
5
+ "version": "3.4.38",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水。",
7
7
  "keywords": [
8
8
  "uview",