sadais-piui 1.2.4-beta9 → 1.2.5

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.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # Changelog
2
2
 
3
- <a name="1.2.3"></a>
4
- ## 1.2.3 (2022-03-26)
3
+ <a name="1.2.5"></a>
4
+ ## 1.2.5 (2022-04-25)
5
5
 
6
6
  ### Added
7
7
 
8
+ - ✨ feat: 增加pi-search的action事件返回参数 [d32d620]
9
+ - ✨ feat: 优化日期选择器,增加滚动中不可确认的功能 [8c6af79]
10
+ - ✨ feat: 增加了图片处理事件的抛出(remove,crop,cancelCrop,croped) [7ab0f42]
11
+ - ✨ feat: 图片上传组件增加uploaded事件 [fa84748]
12
+ - ✨ feat: 日历组件范围支持选择同一天 [76db20f]
13
+ - ✨ feat: 修复日历组件无法选中的问题 [9978654]
8
14
  - ✨ feat: pi-select增加single-confirm选项配置 [def559e]
9
15
  - ✨ feat: 增加pi-action-sheet组件 [bf179cd]
10
16
  - ✨ feat: 增加文字按钮类型 [767a4a6]
@@ -17,14 +23,41 @@
17
23
 
18
24
  ### Fixed
19
25
 
26
+ - 🐛 fix: 修复marquee组件在小程序异常的问题 #18 [a777efc]
27
+ - 🐛 fix: 修复跑马灯子元素宽度等于父元素宽度时候,没有动画的问题 [8ec77ab]
28
+ - 🐛 fix: 修复pi-img-crop运行时报错 [2c2490f]
29
+ - 🐛 fix: 修复某些sass版本解析报错的问题 [5f185a1]
30
+ - 🐛 fix: 修复表单height和padding设置无效的问题 [9d97100]
31
+ - 🐛 fix: 修复pi-form labelStyle设置无效的问题 [4dd8bcf]
32
+ - 🐛 fix: 修复pi-list-item标题过长无法换行的问题 [e5b18b0]
33
+ - 🐛 fix: 修复表单属性设置无效的问题 [55262eb]
34
+ - 🐛 fix: 修复日历组件不设置默认值的时候,需要手动确定才能同步日历的问题 [659e896]
35
+ - 🐛 fix: 修复日历组件设置最小时间展示全部禁用的问题 [02b1feb]
36
+ - 🐛 fix: 修复地区选择组件异步数据以及没有默认值无法正常显示的问题 [f4fa447]
20
37
  - 🐛 fix: 修复input组件keyboardheightchange方法没有声明的问题 [6d26acf]
21
38
  - 🐛 fix: 修复表单属性无法覆盖的问题 [b7308e5]
22
39
  - 🐛 fix: 修复主题颜色被覆盖的问题 [12666d2]
23
40
  - 🐛 fix: 修复pi-img缺失show-menu-by-longpress的问题 [be8a020]
24
41
 
25
- ### Miscellaneous
26
42
 
27
- - 📝 docs: 更新群二维码信息 [796040f]
43
+
44
+ <a name="1.2.3"></a>
45
+ ## 1.2.3 (2022-03-26)
46
+
47
+ ### Added
48
+
49
+ - ✨ feat: pi-select增加single-confirm选项配置 [def559e]
50
+ - ✨ feat: 增加pi-action-sheet组件 [bf179cd]
51
+ - ✨ feat: 增加文字按钮类型 [767a4a6]
52
+ - ✨ feat: pi-radio pi-radio-group 增加canCancel属性 [7874058]
53
+ - ✨ feat: 优化pi-bottom-bar下按钮显示字数 [a671bd6]
54
+
55
+ ### Fixed
56
+
57
+ - 🐛 fix: 修复input组件keyboardheightchange方法没有声明的问题 [6d26acf]
58
+ - 🐛 fix: 修复表单属性无法覆盖的问题 [b7308e5]
59
+ - 🐛 fix: 修复主题颜色被覆盖的问题 [12666d2]
60
+ - 🐛 fix: 修复pi-img缺失show-menu-by-longpress的问题 [be8a020]
28
61
 
29
62
 
30
63
  <a name="1.2.0"></a>
@@ -6,7 +6,10 @@
6
6
  :style="[dividerStyle]"
7
7
  />
8
8
  <!-- $slots.$default 是为了支持支付宝小程序 -->
9
- <view v-if="$slots.default || $slots.$default" :style="[{ padding: contentPadding }]">
9
+ <view
10
+ v-if="$slots.default || $slots.$default"
11
+ :style="[{ padding: contentPadding }, contentStyle]"
12
+ >
10
13
  <slot />
11
14
  </view>
12
15
  <view
@@ -8,7 +8,7 @@
8
8
  { 'pi-align-center': !getWrap },
9
9
  customClass
10
10
  ]"
11
- @tap.stop="handleItemClick"
11
+ @tap="handleItemClick"
12
12
  >
13
13
  <!-- 表单标题 -->
14
14
  <view
@@ -352,11 +352,11 @@ export default {
352
352
  this.validation('change')
353
353
  })
354
354
  },
355
- // 从u-form的rules属性中,取出当前u-form-item的校验规则
355
+ // 从pi-form的rules属性中,取出当前pi-form-item的校验规则
356
356
  getRules() {
357
357
  // 父组件的所有规则
358
- let rules = this._parent.rules
359
- rules = rules ? rules[this.prop] : []
358
+ const parentRules = this._parent ? this._parent.rules : undefined
359
+ const rules = parentRules ? parentRules[this.prop] : []
360
360
  return [].concat(rules || [])
361
361
  },
362
362
  // 过滤出符合要求的rule规则
@@ -380,7 +380,7 @@ export default {
380
380
  if (!this.prop || !rules || rules.length === 0) {
381
381
  return resolve(_getResolve())
382
382
  }
383
- const fieldValue = this._parent.model[this.prop]
383
+ const fieldValue = this._parent ? this._parent.model[this.prop] : undefined
384
384
  // 设置当前的装填,标识为校验中
385
385
  this.validateState = 'validating'
386
386
  // 调用async-validator的方法
@@ -15,6 +15,7 @@
15
15
  :key="idx"
16
16
  class="marquee-item"
17
17
  :class="{ vertical: isVertical }"
18
+ :style="[getItemStyle]"
18
19
  >
19
20
  <!-- item插槽 -->
20
21
  <slot name="item" :item="item">
@@ -28,8 +29,10 @@
28
29
 
29
30
  <script>
30
31
  import { getConfig } from '../../config'
31
- // const TAG = 'PiMarquee'
32
+
33
+ const TAG = 'PiMarquee'
32
34
  const { marquee } = getConfig()
35
+
33
36
  export default {
34
37
  name: 'PiMarquee',
35
38
  props: {
@@ -72,11 +75,24 @@ export default {
72
75
  type: Array,
73
76
  // `[]`
74
77
  default: () => marquee.items
78
+ },
79
+ // 每个item是否占据整个宽度
80
+ itemFullWidth: {
81
+ type: Boolean,
82
+ // false
83
+ default: marquee.itemFullWidth
84
+ },
85
+ // 延迟多少毫秒后开始滚动
86
+ runDelay: {
87
+ type: [Number, String],
88
+ // 500
89
+ default: marquee.runDelay
75
90
  }
76
91
  },
77
92
  data() {
78
93
  return {
79
94
  animate: {},
95
+ containerWidth: 'auto',
80
96
  cloneItems: false
81
97
  }
82
98
  },
@@ -84,6 +100,13 @@ export default {
84
100
  isVertical() {
85
101
  return ['tb', 'bt'].includes(this.direction)
86
102
  },
103
+ getItemStyle() {
104
+ const style = {}
105
+ if (this.itemFullWidth && this.containerWidth !== 'auto') {
106
+ style.width = `${this.containerWidth}px`
107
+ }
108
+ return style
109
+ },
87
110
  getItems() {
88
111
  if (!this.cloneItems) return [this.items]
89
112
  return [this.items, this.items]
@@ -91,19 +114,19 @@ export default {
91
114
  },
92
115
  watch: {
93
116
  customStyle() {
94
- this.updateTime()
117
+ this.init()
95
118
  },
96
119
  customClass() {
97
- this.updateTime()
120
+ this.init()
98
121
  },
99
122
  direction() {
100
- this.updateTime()
123
+ this.init()
101
124
  },
102
125
  speed: {
103
126
  immediate: true,
104
127
  handler() {
105
128
  this.handlePause()
106
- this.updateTime()
129
+ this.init()
107
130
  this.handleStart()
108
131
  }
109
132
  },
@@ -111,16 +134,16 @@ export default {
111
134
  immediate: true,
112
135
  handler() {
113
136
  this.handlePause()
114
- this.updateTime()
137
+ this.init()
115
138
  this.handleStart()
116
139
  }
117
140
  }
118
141
  },
119
142
  mounted() {
120
- window && window.addEventListener('resize', this.updateTime)
143
+ window && window.addEventListener('resize', this.init)
121
144
  },
122
145
  beforeDestroy() {
123
- window && window.removeEventListener('resize', this.updateTime)
146
+ window && window.removeEventListener('resize', this.init)
124
147
  },
125
148
  methods: {
126
149
  /**
@@ -143,12 +166,14 @@ export default {
143
166
  if (!this.hoverPause) {
144
167
  return
145
168
  }
146
- this.$set(this.animate, 'animationPlayState', 'running')
169
+ setTimeout(() => {
170
+ this.$set(this.animate, 'animationPlayState', 'running')
171
+ }, parseInt(this.runDelay, 10))
147
172
  },
148
- updateTime() {
173
+ init() {
149
174
  this.$nextTick(async () => {
150
175
  const rect = await this.$pi.common.queryRect(this, '.marquee-container', false)
151
- const containerWidth = rect.width
176
+ this.containerWidth = rect.width
152
177
  const containerHeight = rect.height
153
178
  const inner = await this.$pi.common.queryRect(this, '.inner', false)
154
179
 
@@ -159,7 +184,9 @@ export default {
159
184
  return
160
185
  }
161
186
  if (!this.isVertical) {
162
- if (inner.width <= containerWidth) {
187
+ console.log(TAG, '横向滚动', inner.width, this.containerWidth)
188
+ // 横向滚动
189
+ if (!this.itemFullWidth && inner.width < this.containerWidth) {
163
190
  this.handlePause()
164
191
  this.cloneItems = false
165
192
  } else {
@@ -168,7 +195,8 @@ export default {
168
195
  this.cloneItems = true
169
196
  }
170
197
  } else {
171
- if (inner.height <= containerHeight) {
198
+ // 纵向滚动
199
+ if (inner.height < containerHeight) {
172
200
  this.$set(this.animate, 'animationPlayState', 'paused')
173
201
  this.cloneItems = false
174
202
  } else {
@@ -186,7 +214,7 @@ export default {
186
214
  <style lang="scss" scoped>
187
215
  .marquee-container {
188
216
  width: 100%;
189
- overflow: auto hidden;
217
+ overflow: hidden;
190
218
  font-size: 0;
191
219
  white-space: nowrap;
192
220
  background: #ffffff;
@@ -213,6 +241,7 @@ export default {
213
241
  .inner-wrap {
214
242
  display: inline-block;
215
243
  white-space: nowrap;
244
+
216
245
  &.lr {
217
246
  animation: roll-lr 0s linear infinite;
218
247
  }
package/config/marquee.js CHANGED
@@ -4,5 +4,7 @@ export default {
4
4
  hoverPause: true,
5
5
  customStyle: {},
6
6
  customClass: '',
7
- items: []
7
+ items: [],
8
+ itemFullWidth: false, // 每个item是否占据整个宽度
9
+ runDelay: 500 // 延迟多少毫秒后开始滚动
8
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.4-beta9",
3
+ "version": "1.2.5",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,3 +23,4 @@
23
23
  },
24
24
  "homepage": "https://github.com/sadais-org/piui#readme"
25
25
  }
26
+