sadais-piui 1.2.7-beta25 → 1.2.7-beta28

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.
@@ -21,7 +21,7 @@
21
21
  <!-- 展示dropdownItem下的数据 -->
22
22
  <view
23
23
  class="pi-dropdown-content"
24
- :class="[contentClass, show ? 'pi-ani-slide-bottom-show' : 'pi-ani-slide-bottom-hide']"
24
+ :class="[contentClass]"
25
25
  :style="[contentStyle, contentCombinationStyle]"
26
26
  >
27
27
  <slot />
@@ -276,7 +276,7 @@ export default {
276
276
  // 每次点击都重新更新父容器的位置
277
277
  this.containerRect = await this.$pi.common.queryRect(this, '.pi-dropdown', false)
278
278
  this.openMask()
279
- this._children.find(child => {
279
+ this._children.forEach(child => {
280
280
  child.show = child._uid === item.id
281
281
  })
282
282
  },
@@ -295,6 +295,9 @@ export default {
295
295
  closeMask() {
296
296
  if (!this.show || !this.showed) return
297
297
  console.log(TAG, '隐藏下拉菜单遮罩层')
298
+ this._children.forEach(child => {
299
+ child.show = false
300
+ })
298
301
  this.show = false
299
302
  this.showed = false
300
303
  this.tabs = this.tabs.map(tab => {
@@ -1,60 +1,64 @@
1
1
  <template>
2
- <scroll-view v-if="show" scroll-y class="pi-dropdown-item pi-w-100P">
3
- <slot>
4
- <view
5
- v-for="item in options"
6
- :key="item[getKeyField]"
7
- class="item-wrap pi-pd-tb-24 pi-pd-lr-32 pi-w-100P pi-align-center"
8
- :class="[
9
- customClass,
10
- item[getDisabledField] ? 'disabled' : '',
11
- getSelectedCheckbox === 'none' ? 'pi-justify-center' : 'pi-justify-between'
12
- ]"
13
- :style="[customStyle, getItemStyle]"
14
- @tap="handleSelectItem(item)"
15
- >
16
- <view :class="[{ 'pi-primary': item[keyField] === val }]">
17
- {{ item[getDisplayField] }}
2
+ <view class="pi-dropdown-item pi-w-100P pi-flex-column" :class="[{ show }]">
3
+ <!-- extra slot -->
4
+ <slot name="extra" />
5
+ <scroll-view scroll-y class="pi-scroll">
6
+ <slot>
7
+ <view
8
+ v-for="item in options"
9
+ :key="item[getKeyField]"
10
+ class="item-wrap pi-pd-tb-24 pi-pd-lr-32 pi-w-100P pi-align-center"
11
+ :class="[
12
+ customClass,
13
+ item[getDisabledField] ? 'disabled' : '',
14
+ getSelectedCheckbox === 'none' ? 'pi-justify-center' : 'pi-justify-between'
15
+ ]"
16
+ :style="[customStyle, getItemStyle]"
17
+ @tap="handleSelectItem(item)"
18
+ >
19
+ <view :class="[{ 'pi-primary': item[keyField] === val }]">
20
+ {{ item[getDisplayField] }}
21
+ </view>
22
+ <!-- 如果配置了图片地址,使用图片 -->
23
+ <pi-img
24
+ v-if="getSelectedImg.src && item[keyField] === val"
25
+ :src="getSelectedImg.src"
26
+ :mode="getSelectedImg.mode"
27
+ :width="getSelectedImg.width"
28
+ :height="getSelectedImg.height"
29
+ :dot="getSelectedImg.dot"
30
+ :dot-radius="getSelectedImg.dotRadius"
31
+ :badge="getSelectedImg.badge"
32
+ :shape="getSelectedImg.shape"
33
+ :border-radius="getSelectedImg.borderRadius"
34
+ :show-loading="getSelectedImg.showLoading"
35
+ :loading-color="getSelectedImg.loadingColor"
36
+ :loading-type="getSelectedImg.loadingType"
37
+ :loading-size="getSelectedImg.loadingSize"
38
+ :show-error="getSelectedImg.showError"
39
+ :webp="getSelectedImg.webp"
40
+ custom-class="pi-mg-left-24"
41
+ />
42
+ <!-- 默认使用复选框 -->
43
+ <pi-checkbox
44
+ v-if="!getSelectedImg.src && getSelectedCheckbox !== 'none'"
45
+ readonly
46
+ :value="item[keyField] === val"
47
+ :name="getSelectedCheckbox.name"
48
+ :shape="getSelectedCheckbox.shape"
49
+ :border-radius="getSelectedCheckbox.borderRadius"
50
+ :border="getSelectedCheckbox.border"
51
+ :disabled="getSelectedCheckbox.disabled"
52
+ :size="getSelectedCheckbox.size"
53
+ :icon-size="getSelectedCheckbox.iconSize"
54
+ :active-color="getSelectedCheckbox.activeColor"
55
+ :active-mode="getSelectedCheckbox.activeMode"
56
+ custom-class="pi-mg-left-24"
57
+ />
18
58
  </view>
19
- <!-- 如果配置了图片地址,使用图片 -->
20
- <pi-img
21
- v-if="getSelectedImg.src && item[keyField] === val"
22
- :src="getSelectedImg.src"
23
- :mode="getSelectedImg.mode"
24
- :width="getSelectedImg.width"
25
- :height="getSelectedImg.height"
26
- :dot="getSelectedImg.dot"
27
- :dot-radius="getSelectedImg.dotRadius"
28
- :badge="getSelectedImg.badge"
29
- :shape="getSelectedImg.shape"
30
- :border-radius="getSelectedImg.borderRadius"
31
- :show-loading="getSelectedImg.showLoading"
32
- :loading-color="getSelectedImg.loadingColor"
33
- :loading-type="getSelectedImg.loadingType"
34
- :loading-size="getSelectedImg.loadingSize"
35
- :show-error="getSelectedImg.showError"
36
- :webp="getSelectedImg.webp"
37
- custom-class="pi-mg-left-24"
38
- />
39
- <!-- 默认使用复选框 -->
40
- <pi-checkbox
41
- v-if="!getSelectedImg.src && getSelectedCheckbox !== 'none'"
42
- readonly
43
- :value="item[keyField] === val"
44
- :name="getSelectedCheckbox.name"
45
- :shape="getSelectedCheckbox.shape"
46
- :border-radius="getSelectedCheckbox.borderRadius"
47
- :border="getSelectedCheckbox.border"
48
- :disabled="getSelectedCheckbox.disabled"
49
- :size="getSelectedCheckbox.size"
50
- :icon-size="getSelectedCheckbox.iconSize"
51
- :active-color="getSelectedCheckbox.activeColor"
52
- :active-mode="getSelectedCheckbox.activeMode"
53
- custom-class="pi-mg-left-24"
54
- />
55
- </view>
56
- </slot>
57
- </scroll-view>
59
+ </slot>
60
+ </scroll-view>
61
+ </view>
58
62
  </template>
59
63
 
60
64
  <script>
@@ -223,7 +227,15 @@ export default {
223
227
  @import '../../scss/mixin.scss';
224
228
 
225
229
  .pi-dropdown-item {
226
- max-height: 600rpx;
230
+ max-height: 0;
231
+ opacity: 0;
232
+ transition: opacity $pi-animation-duration $pi-animation-timing-function,
233
+ max-height $pi-animation-duration $pi-animation-timing-function;
234
+ &.show {
235
+ max-height: 600rpx;
236
+ height: 600rpx;
237
+ opacity: 1;
238
+ }
227
239
  .item-wrap {
228
240
  &:not(:last-child) {
229
241
  @include pi-border;
@@ -263,7 +263,7 @@ export default {
263
263
  data() {
264
264
  return {
265
265
  initialValue: '', // 初始值
266
- validateState: '', // 是否校验成功
266
+ validateState: 'success', // 是否校验成功
267
267
  validateMessage: '' // 校验失败的提示语
268
268
  }
269
269
  },
@@ -400,7 +400,7 @@ export default {
400
400
  // 从pi-form的rules属性中,取出当前pi-form-item的校验规则
401
401
  getRules() {
402
402
  // 父组件的所有规则
403
- const parentRules = this._parent && (this._parent.validRules || this._parent.rules)
403
+ const parentRules = this._parent && this._parent.validRules
404
404
  const rules = parentRules ? parentRules[this.prop] : []
405
405
  return [].concat(rules || [])
406
406
  },
@@ -423,6 +423,9 @@ export default {
423
423
  return new Promise((resolve, reject) => {
424
424
  const rules = this.getFilteredRule(trigger)
425
425
  if (!this.prop || !rules || rules.length === 0) {
426
+ this.validateState = 'success'
427
+ this.validateMessage = ''
428
+ console.log(TAG, '字段无需校验', this.prop)
426
429
  return resolve(_getResolve())
427
430
  }
428
431
  const fieldValue = this._parent ? this._parent.model[this.prop] : undefined
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="pi-input-wrap" :style="[getInputWrapStyle]">
2
+ <view class="pi-input-wrap" :style="[getInputWrapStyle]" :class="[{ disabled: getDisabled }]">
3
3
  <textarea
4
4
  v-if="type === 'textarea'"
5
5
  class="pi-input-textarea"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7beta25",
3
+ "version": "1.2.7beta28",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {