sadais-piui 1.2.7-beta110 → 1.2.7-beta112

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.
@@ -37,6 +37,7 @@
37
37
  :auto-height="autoHeight"
38
38
  :disable-default-padding="disableDefaultPadding"
39
39
  @focus="handleFocus"
40
+ @input="handleInput"
40
41
  @blur="handleBlur"
41
42
  @confirm="handleConfirm"
42
43
  @keyboardheightchange="$emit('keyboardheightchange', $event)"
@@ -66,6 +67,7 @@
66
67
  :hold-keyboard="holdKeyboard"
67
68
  :auto-blur="autoBlur"
68
69
  @focus="handleFocus"
70
+ @input="handleInput"
69
71
  @blur="handleBlur"
70
72
  @confirm="handleConfirm"
71
73
  @keyboardheightchange="$emit('keyboardheightchange', $event)"
@@ -336,14 +338,16 @@ export default {
336
338
  handleItemClick(e) {
337
339
  this.$emit('click', e)
338
340
  },
341
+ handleInput(e) {
342
+ const value = e.detail.value
343
+ this.handleChange(value)
344
+ },
339
345
  handleFocus() {
340
346
  this.focused = true
341
347
  // 获得焦点
342
348
  this.$emit('focus')
343
349
  },
344
- handleBlur(e) {
345
- const value = e.detail.value
346
- this.handleChange(value)
350
+ handleBlur() {
347
351
  setTimeout(() => {
348
352
  this.focused = false
349
353
  }, 100)
@@ -1,5 +1,9 @@
1
1
  <template>
2
- <view class="pi-align-center pi-w-100P" :style="[customStyle]" :class="[customClass]">
2
+ <view
3
+ class="pi-align-center pi-w-100P"
4
+ :style="[customStyle]"
5
+ :class="[customClass]"
6
+ >
3
7
  <view v-if="searchLabel" class="pi-pd-right-18" :style="[searchLabelStyle]">
4
8
  {{ searchLabel }}
5
9
  </view>
@@ -67,7 +71,11 @@
67
71
  @focus="handleInputFocus"
68
72
  />
69
73
  <!-- clear action -->
70
- <view v-if="clearable && val" class="pi-pd-lr-18" @tap="handleClearInput">
74
+ <view
75
+ v-if="clearable && val"
76
+ class="pi-pd-lr-18"
77
+ @tap="handleClearInput"
78
+ >
71
79
  <view class="pi-icon-roundclosefill" :style="[clearIconStyle]" />
72
80
  </view>
73
81
  </view>
@@ -130,7 +138,7 @@ export default {
130
138
  type: String,
131
139
  // `'round'`
132
140
  default: search.shape,
133
- validator: function (value) {
141
+ validator: function(value) {
134
142
  return ['square', 'round'].includes(value)
135
143
  }
136
144
  },
@@ -251,7 +259,7 @@ export default {
251
259
  type: String,
252
260
  // `'left'`
253
261
  default: search.searchIconPosition,
254
- validator: function (value) {
262
+ validator: function(value) {
255
263
  return ['left', 'right'].includes(value)
256
264
  }
257
265
  },
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  * @Author: zhangzhenfei
3
3
  * @Date: 2021-08-13 11:31:57
4
- * @LastEditTime: 2024-06-07 12:06:47
4
+ * @LastEditTime: 2024-06-11 09:52:29
5
5
  * @LastEditors: zhangzhenfei
6
6
  * @Description: 图片上传组件
7
7
  * @FilePath: /piui-awesome/src/piui/components/pi-upload-img/index.vue
@@ -491,9 +491,9 @@ export default {
491
491
  getExtension() {
492
492
  let extension = []
493
493
  if (this.type === 'image') {
494
- extension = this.getChooseImageOpts.extension
494
+ extension = this.getChooseImageOpts.extension || []
495
495
  } else if (this.type === 'video') {
496
- extension = this.getChooseVideoOpts.extension
496
+ extension = this.getChooseVideoOpts.extension || []
497
497
  } else {
498
498
  // all
499
499
  extension = [
@@ -506,7 +506,7 @@ export default {
506
506
  : [])
507
507
  ]
508
508
  }
509
- return extension.filter(ext => !!ext)
509
+ return extension?.filter(ext => !!ext)
510
510
  }
511
511
  },
512
512
  methods: {
@@ -53,6 +53,7 @@ export default {
53
53
  // 当type为 "image"时生效,调用uni.chooseImage参数
54
54
  chooseImageOpts: {
55
55
  sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认album
56
+ extension: [], // 允许上传的文件类型,不填则不限制
56
57
  sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认compressed
57
58
  crop: {} // 图像裁剪参数,设置后 sizeType 失效
58
59
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta110",
3
+ "version": "1.2.7-beta112",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {