uview-plus 3.3.34 → 3.3.35

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 (35) hide show
  1. package/changelog.md +8 -0
  2. package/components/u-action-sheet/u-action-sheet.vue +3 -3
  3. package/components/u-checkbox/u-checkbox.vue +11 -10
  4. package/components/u-modal/u-modal.vue +6 -2
  5. package/components/u-picker/u-picker.vue +4 -1
  6. package/components/u-popup/u-popup.vue +1 -1
  7. package/components/u-swipe-action-item/index.wxs +20 -15
  8. package/components/u-swipe-action-item/props.js +4 -0
  9. package/components/u-swipe-action-item/swipeActionItem.js +1 -0
  10. package/components/u-swipe-action-item/u-swipe-action-item.vue +17 -4
  11. package/components/u-text/u-text.vue +3 -2
  12. package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
  13. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  14. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  15. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  16. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  17. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  18. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  19. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  20. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  21. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  22. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  23. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  24. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  25. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  26. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  27. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  28. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  29. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  30. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  31. package/libs/util/gcanvas/env/canvas.js +0 -0
  32. package/libs/util/gcanvas/env/image.js +0 -0
  33. package/libs/util/gcanvas/env/tool.js +0 -0
  34. package/libs/util/gcanvas/index.js +0 -0
  35. package/package.json +1 -1
package/changelog.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 3.3.35(2024-10-08)
2
+ feat: modal和picker支持v-model:show双向绑定
3
+
4
+ feat: 支持checkbox使用slot自定义label后自带点击事件 #522
5
+
6
+ feat: swipe-action支持自动关闭特性及初始化打开状态
7
+
8
+
1
9
  ## 3.3.34(2024-09-23)
2
10
  feat: 支持toast设置duration值为-1时不自动关闭
3
11
 
@@ -171,13 +171,13 @@
171
171
  closeHandler() {
172
172
  // 允许点击遮罩关闭时,才发出close事件
173
173
  if(this.closeOnClickOverlay) {
174
- this.$emit('update:show')
174
+ this.$emit('update:show', false)
175
175
  this.$emit('close')
176
176
  }
177
177
  },
178
178
  // 点击取消按钮
179
179
  cancel() {
180
- this.$emit('update:show')
180
+ this.$emit('update:show', false)
181
181
  this.$emit('close')
182
182
  },
183
183
  selectHandler(index) {
@@ -185,7 +185,7 @@
185
185
  if (item && !item.disabled && !item.loading) {
186
186
  this.$emit('select', item)
187
187
  if (this.closeOnClickAction) {
188
- this.$emit('update:show')
188
+ this.$emit('update:show', false)
189
189
  this.$emit('close')
190
190
  }
191
191
  }
@@ -20,16 +20,17 @@
20
20
  />
21
21
  </slot>
22
22
  </view>
23
- <slot name="label" :label="label" :elDisabled="elDisabled">
24
- <text
25
- @tap.stop="labelClickHandler"
26
- :style="{
27
- color: elDisabled ? elInactiveColor : elLabelColor,
28
- fontSize: elLabelSize,
29
- lineHeight: elLabelSize
30
- }"
31
- >{{label}}</text>
32
- </slot>
23
+ <view class="u-checkbox__label-wrap cursor-pointer" @tap.stop="labelClickHandler">
24
+ <slot name="label" :label="label" :elDisabled="elDisabled">
25
+ <text
26
+ :style="{
27
+ color: elDisabled ? elInactiveColor : elLabelColor,
28
+ fontSize: elLabelSize,
29
+ lineHeight: elLabelSize
30
+ }"
31
+ >{{label}}</text>
32
+ </slot>
33
+ </view>
33
34
  </view>
34
35
  </template>
35
36
 
@@ -120,7 +120,7 @@
120
120
  * @event {Function} confirm 点击确认按钮时触发
121
121
  * @event {Function} cancel 点击取消按钮时触发
122
122
  * @event {Function} close 点击遮罩关闭出发,closeOnClickOverlay为true有效
123
- * @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" />
123
+ * @example <u-modal :show="show" />
124
124
  */
125
125
  export default {
126
126
  name: 'u-modal',
@@ -137,7 +137,7 @@
137
137
  if (n && this.loading) this.loading = false
138
138
  }
139
139
  },
140
- emits: ["confirm", "cancel", "close"],
140
+ emits: ["confirm", "cancel", "close", "update:show"],
141
141
  methods: {
142
142
  addUnit,
143
143
  // 点击确定按钮
@@ -145,11 +145,14 @@
145
145
  // 如果配置了异步关闭,将按钮值为loading状态
146
146
  if (this.asyncClose) {
147
147
  this.loading = true;
148
+ } else {
149
+ this.$emit('update:show', false)
148
150
  }
149
151
  this.$emit('confirm')
150
152
  },
151
153
  // 点击取消按钮
152
154
  cancelHandler() {
155
+ this.$emit('update:show', false)
153
156
  this.$emit('cancel')
154
157
  },
155
158
  // 点击遮罩
@@ -159,6 +162,7 @@
159
162
  // 透明遮罩的子元素做了.stop处理,所以点击内容区,也不会导致误触发
160
163
  clickHandler() {
161
164
  if (this.closeOnClickOverlay) {
165
+ this.$emit('update:show', false)
162
166
  this.$emit('close')
163
167
  }
164
168
  }
@@ -132,7 +132,7 @@ export default {
132
132
  }
133
133
  },
134
134
  },
135
- emits: ['close', 'cancel', 'confirm', 'change', 'update:modelValue'],
135
+ emits: ['close', 'cancel', 'confirm', 'change', 'update:modelValue', 'update:show'],
136
136
  computed: {
137
137
  inputLabel() {
138
138
  let items = this.innerColumns.map((item, index) => item[this.innerIndex[index]])
@@ -168,6 +168,7 @@ export default {
168
168
  if (this.hasInput) {
169
169
  this.showByClickInput = false
170
170
  }
171
+ this.$emit('update:show', false)
171
172
  this.$emit('close')
172
173
  }
173
174
  },
@@ -176,6 +177,7 @@ export default {
176
177
  if (this.hasInput) {
177
178
  this.showByClickInput = false
178
179
  }
180
+ this.$emit('update:show', false)
179
181
  this.$emit('cancel')
180
182
  },
181
183
  // 点击工具栏的确定按钮
@@ -184,6 +186,7 @@ export default {
184
186
  if (this.hasInput) {
185
187
  this.showByClickInput = false
186
188
  }
189
+ this.$emit('update:show', false)
187
190
  this.$emit('confirm', {
188
191
  indexs: this.innerIndex,
189
192
  value: this.innerColumns.map((item, index) => item[this.innerIndex[index]]),
@@ -72,7 +72,7 @@
72
72
  * @property {Object} customStyle 组件的样式,对象形式
73
73
  * @event {Function} open 弹出层打开
74
74
  * @event {Function} close 弹出层收起
75
- * @example <u-popup v-model="show"><text>出淤泥而不染,濯清涟而不妖</text></u-popup>
75
+ * @example <u-popup v-model:show="show"><text>出淤泥而不染,濯清涟而不妖</text></u-popup>
76
76
  */
77
77
  export default {
78
78
  name: 'u-popup',
@@ -9,7 +9,7 @@ function touchstart(event, ownerInstance) {
9
9
  var instance = event.instance
10
10
  // wxs内的局部变量快照,此快照是属于整个组件的,在touchstart和touchmove事件中都能获取到相同的结果
11
11
  var state = instance.getState()
12
- if (state.disabled) return
12
+ if (state.disabled) return
13
13
  var touches = event.touches
14
14
  // 如果进行的是多指触控,不允许进行操作
15
15
  if (touches && touches.length > 1) return
@@ -17,8 +17,8 @@ function touchstart(event, ownerInstance) {
17
17
  state.moving = true
18
18
  // 记录触摸开始点的坐标值
19
19
  state.startX = touches[0].pageX
20
- state.startY = touches[0].pageY
21
-
20
+ state.startY = touches[0].pageY
21
+
22
22
  ownerInstance.callMethod('closeOther')
23
23
  }
24
24
 
@@ -70,7 +70,7 @@ function touchend(event, ownerInstance) {
70
70
  var instance = event.instance
71
71
  // wxs内的局部变量快照
72
72
  var state = instance.getState()
73
- if (!state.moving || state.disabled) return
73
+ if (!state.moving || state.disabled) return
74
74
  var touches = event.changedTouches ? event.changedTouches[0] : {}
75
75
  var pageX = touches.pageX
76
76
  var pageY = touches.pageY
@@ -185,10 +185,10 @@ function closeSwipeAction(instance, ownerInstance) {
185
185
 
186
186
  // status的状态发生变化
187
187
  function statusChange(newValue, oldValue, ownerInstance, instance) {
188
- var state = instance.getState()
189
- if (state.disabled) return
188
+ var state = instance.getState()
189
+ if (state.disabled) return
190
190
  // 打开或关闭单元格
191
- if (newValue === 'close' && state.status === 'open') {
191
+ if (newValue === 'close' && state.status === 'open') {
192
192
  closeSwipeAction(instance, ownerInstance)
193
193
  } else if(newValue === 'open' && state.status === 'close') {
194
194
  openSwipeAction(instance, ownerInstance)
@@ -198,18 +198,18 @@ function statusChange(newValue, oldValue, ownerInstance, instance) {
198
198
  // 菜单尺寸发生变化
199
199
  function sizeChange(newValue, oldValue, ownerInstance, instance) {
200
200
  // wxs内的局部变量快照
201
- var state = instance.getState()
202
- // 临时防止nv_disabled报错
203
- if (!state || !newValue) {
204
- return;
205
- }
201
+ var state = instance.getState()
202
+ // 临时防止nv_disabled报错
203
+ if (!state || !newValue) {
204
+ return;
205
+ }
206
206
  state.disabled = newValue.disabled
207
207
  state.duration = newValue.duration
208
208
  state.show = newValue.show
209
209
  state.threshold = newValue.threshold
210
210
  state.buttons = newValue.buttons
211
211
 
212
- if (state.buttons) {
212
+ if (state.buttons) {
213
213
  var len = state.buttons.length
214
214
  var buttonsWidth = 0
215
215
  var buttons = newValue.buttons
@@ -217,7 +217,12 @@ function sizeChange(newValue, oldValue, ownerInstance, instance) {
217
217
  buttonsWidth += buttons[i].width
218
218
  }
219
219
  }
220
- state.buttonsWidth = buttonsWidth
220
+ state.buttonsWidth = buttonsWidth
221
+
222
+ // 支持默认打开
223
+ if (state.show) {
224
+ openSwipeAction(instance, ownerInstance)
225
+ }
221
226
  }
222
227
 
223
228
  module.exports = {
@@ -226,4 +231,4 @@ module.exports = {
226
231
  touchend: touchend,
227
232
  sizeChange: sizeChange,
228
233
  statusChange: statusChange
229
- }
234
+ }
@@ -7,6 +7,10 @@ export const props = defineMixin({
7
7
  type: Boolean,
8
8
  default: () => defProps.swipeActionItem.show
9
9
  },
10
+ closeOnClick: {
11
+ type: Boolean,
12
+ default: () => defProps.swipeActionItem.closeOnClick
13
+ },
10
14
  // 标识符,如果是v-for,可用index索引值
11
15
  name: {
12
16
  type: [String, Number],
@@ -11,6 +11,7 @@ export default {
11
11
  // swipeActionItem 组件
12
12
  swipeActionItem: {
13
13
  show: false,
14
+ closeOnClick: true,
14
15
  name: '',
15
16
  disabled: false,
16
17
  threshold: 20,
@@ -90,8 +90,7 @@
90
90
  */
91
91
  export default {
92
92
  name: 'u-swipe-action-item',
93
- emits: ['click'],
94
-
93
+ emits: ['click', 'update:show'],
95
94
  mixins: [
96
95
  mpMixin,
97
96
  mixin,
@@ -118,7 +117,7 @@
118
117
  autoClose: true,
119
118
  },
120
119
  // 当前状态,open-打开,close-关闭
121
- status: 'close',
120
+ status: '',
122
121
  sliderStyle: {}
123
122
  }
124
123
  },
@@ -131,7 +130,17 @@
131
130
  // #endif
132
131
  status(newValue) {
133
132
  if (newValue === 'open') {
133
+ this.$emit('update:show', true)
134
134
  this.parent && this.parent.setOpendItem(this)
135
+ } else {
136
+ this.$emit('update:show', false)
137
+ }
138
+ },
139
+ show(newValue) {
140
+ if (newValue) {
141
+ this.status = 'open'
142
+ } else {
143
+ this.status = 'close'
135
144
  }
136
145
  }
137
146
  },
@@ -178,10 +187,14 @@
178
187
  // #endif
179
188
  // 按钮被点击
180
189
  buttonClickHandler(item, index) {
181
- this.$emit('click', {
190
+ let ret = this.$emit('click', {
182
191
  index,
183
192
  name: this.name
193
+ }, () => {
184
194
  })
195
+ if (this.closeOnClick) {
196
+ this.closeHandler()
197
+ }
185
198
  }
186
199
  },
187
200
  }
@@ -22,8 +22,9 @@
22
22
  ></u-icon>
23
23
  </view>
24
24
  <u-link
25
- v-if="mode === 'link'" class="u-text__value"
26
- :style="{fontWeight: valueStyle.fontWeight, wordWrap: valueStyle.wordWrap, fontSize: valueStyle.fontSize}" :class="[ type && `u-text__value--${type}`, lines && `u-line-${lines}` ]" :text="value"
25
+ v-if="mode === 'link'" class="u-text__value"
26
+ :style="{fontWeight: valueStyle.fontWeight, wordWrap: valueStyle.wordWrap, fontSize: valueStyle.fontSize}"
27
+ :class="[type && `u-text__value--${type}`,lines && `u-line-${lines}`]" :text="value"
27
28
  :href="href"
28
29
  underLine
29
30
  ></u-link>
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.3.34",
5
+ "version": "3.3.35",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",