sadais-piui 1.2.7-beta71 → 1.2.7-beta73

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.
@@ -1,15 +1,15 @@
1
1
  <template>
2
- <view class="pi-input-wrap" :style="[getInputWrapStyle]" :class="[{ disabled: getDisabled }]">
3
- <view
4
- v-if="type === 'textarea' && readonly"
5
- class="pi-input-textarea"
6
- :style="[customStyle, readonlyStyle]"
7
- :class="[customClass, readonlyClass]"
8
- >
9
- {{ val || placeholder }}
10
- </view>
2
+ <view
3
+ class="pi-input-wrap"
4
+ :style="[getInputWrapStyle]"
5
+ :class="[{ disabled: getDisabled }]"
6
+ @tap="handleItemClick"
7
+ >
8
+ <!-- 当disabled,增加一个abso的蒙层,为了触发click事件 -->
9
+ <view v-if="getDisabled" class="pi-input-mask pi-abso-full" />
10
+
11
11
  <textarea
12
- v-else-if="type === 'textarea'"
12
+ v-if="type === 'textarea'"
13
13
  class="pi-input-textarea"
14
14
  :style="[customStyle]"
15
15
  :class="[customClass]"
@@ -18,10 +18,10 @@
18
18
  :placeholder="placeholder"
19
19
  :placeholder-style="placeholderStyle"
20
20
  :placeholder-class="placeholderClass"
21
- :disabled="getDisabled"
22
21
  :maxlength="maxlength"
23
22
  :cursor-spacing="cursorSpacing"
24
23
  :focus="focus"
24
+ :disabled="getDisabled"
25
25
  :confirm-hold="confirmHold"
26
26
  :cursor="cursor"
27
27
  :selection-start="selectionStart"
@@ -32,7 +32,6 @@
32
32
  :show-confirm-bar="showConfirmbar"
33
33
  :auto-height="autoHeight"
34
34
  :disable-default-padding="disableDefaultPadding"
35
- @tap="handleItemClick"
36
35
  @input="handleInput"
37
36
  @focus="handleFocus"
38
37
  @blur="handleBlur"
@@ -51,10 +50,10 @@
51
50
  :placeholder="placeholder"
52
51
  :placeholder-style="placeholderStyle"
53
52
  :placeholder-class="placeholderClass"
54
- :disabled="getDisabled"
55
53
  :maxlength="maxlength"
56
54
  :cursor-spacing="cursorSpacing"
57
55
  :focus="focus"
56
+ :disabled="getDisabled"
58
57
  :confirm-hold="confirmHold"
59
58
  :cursor="cursor"
60
59
  :selection-start="selectionStart"
@@ -62,7 +61,6 @@
62
61
  :adjust-position="adjustPosition"
63
62
  :hold-keyboard="holdKeyboard"
64
63
  :auto-blur="autoBlur"
65
- @tap="handleItemClick"
66
64
  @input="handleInput"
67
65
  @focus="handleFocus"
68
66
  @blur="handleBlur"
@@ -81,7 +79,7 @@
81
79
  :color="clearIcon.color"
82
80
  :size="clearIcon.size"
83
81
  :class-prefix="clearIcon.classPrefix"
84
- @tap="handleChange('')"
82
+ @tap.stop="handleChange('')"
85
83
  />
86
84
  </view>
87
85
  </template>
@@ -274,10 +272,6 @@ export default {
274
272
  default() {
275
273
  return input.clearIcon
276
274
  }
277
- },
278
- readonly: {
279
- type: Boolean,
280
- default: input.readonly || false
281
275
  }
282
276
  },
283
277
  data() {
@@ -286,12 +280,6 @@ export default {
286
280
  }
287
281
  },
288
282
  computed: {
289
- readonlyClass() {
290
- return this.val ? '' : this.placeholderClass
291
- },
292
- readonlyStyle() {
293
- return this.val ? '' : this.placeholderStyle
294
- },
295
283
  getDisabled() {
296
284
  const parentFormItem = this.$pi.parent(this, 'PiFormItem')
297
285
  const disabled = this.disabled || (parentFormItem && parentFormItem.getDisabled)
@@ -313,6 +301,7 @@ export default {
313
301
  },
314
302
  methods: {
315
303
  handleItemClick(e) {
304
+ console.log(123)
316
305
  this.$emit('click', e)
317
306
  },
318
307
  handleInput: debounce(function(e) {
@@ -355,6 +344,7 @@ export default {
355
344
 
356
345
  <style lang="scss" scoped>
357
346
  .pi-input-wrap {
347
+ position: relative;
358
348
  width: 100%;
359
349
  display: flex;
360
350
  align-items: center;
@@ -362,5 +352,10 @@ export default {
362
352
  .pi-input-textarea {
363
353
  width: 100%;
364
354
  }
355
+
356
+ .pi-input-mask {
357
+ background: transparent;
358
+ z-index: 101;
359
+ }
365
360
  }
366
361
  </style>
package/config/input.js CHANGED
@@ -26,7 +26,6 @@ export default {
26
26
  fixed: false, // 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true
27
27
  disableDefaultPadding: false, // 是否去掉 iOS 下的默认内边距
28
28
  clearable: false, // 是否可以清空
29
- readonly: false, // 是否只读
30
29
  clearIcon: {
31
30
  // 清空图标设置
32
31
  ...icon,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta71",
3
+ "version": "1.2.7-beta73",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {