sadais-piui 1.2.2-beta2 → 1.2.2-beta5

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.
@@ -62,12 +62,12 @@ export default {
62
62
  },
63
63
  // 按钮的预置样式
64
64
  type: {
65
- // `'default'` `'primary'` `'warn'` `'secondary'` `'line'`
65
+ // `'default'` `'primary'` `'warn'` `'secondary'` `'line'` `text`
66
66
  type: String,
67
67
  // 'default'
68
68
  default: button.type,
69
69
  validator: function(value) {
70
- return ['default', 'primary', 'warn', 'secondary', 'line'].includes(value)
70
+ return ['default', 'primary', 'warn', 'secondary', 'line', 'text'].includes(value)
71
71
  }
72
72
  },
73
73
  // 按钮是否镂空
@@ -461,6 +461,16 @@ export default {
461
461
  background-color: rgba($pi-primary-color, 0.08);
462
462
  }
463
463
 
464
+ &[type='text'] {
465
+ background-color: transparent;
466
+ &::after {
467
+ border: none;
468
+ }
469
+ }
470
+ &.button-hover[type='line'] {
471
+ background-color: rgba($pi-primary-color, 0.08);
472
+ }
473
+
464
474
  .wave-ripple {
465
475
  position: absolute;
466
476
  z-index: 0;
@@ -246,19 +246,17 @@ export default {
246
246
  },
247
247
  computed: {
248
248
  getShowRightIcon() {
249
- return this.inheritProps.showRightIcon !== null
250
- ? this.inheritProps.showRightIcon
251
- : this.showRightIcon
249
+ return this.$pi.expand.getPropValue(this.inheritProps.showRightIcon, this.showRightIcon)
252
250
  },
253
251
  getRightIcon() {
254
252
  const rightIcon = this.$pi.lang.mergeDeep(this.inheritProps.rightIcon, this.rightIcon)
255
253
  return this.$pi.lang.mergeDeep(formItem.rightIcon, rightIcon)
256
254
  },
257
255
  getBorder() {
258
- return this.inheritProps.border !== null ? this.inheritProps.border : this.border
256
+ return this.$pi.expand.getPropValue(this.inheritProps.border, this.border)
259
257
  },
260
258
  getWrap() {
261
- return this.inheritProps.wrap !== null ? this.inheritProps.wrap : this.wrap
259
+ return this.$pi.expand.getPropValue(this.inheritProps.wrap, this.wrap)
262
260
  },
263
261
  getLabelWrapBorder() {
264
262
  return this.inheritProps.labelWrapBorder !== null
@@ -266,26 +264,26 @@ export default {
266
264
  : this.labelWrapBorder
267
265
  },
268
266
  getColon() {
269
- return this.inheritProps.colon !== null ? this.inheritProps.colon : this.colon
267
+ return this.$pi.expand.getPropValue(this.inheritProps.colon, this.colon)
270
268
  },
271
269
  getDisabled() {
272
- return this.inheritProps.disabled !== null ? this.inheritProps.disabled : this.disabled
270
+ return this.$pi.expand.getPropValue(this.inheritProps.disabled, this.disabled)
273
271
  },
274
272
  getLabelAlign() {
275
- return this.inheritProps.labelAlign !== null ? this.inheritProps.labelAlign : this.labelAlign
273
+ return this.$pi.expand.getPropValue(this.inheritProps.labelAlign, this.labelAlign)
276
274
  },
277
275
  getInputAlign() {
278
- return this.inheritProps.inputAlign !== null ? this.inheritProps.inputAlign : this.inputAlign
276
+ return this.$pi.expand.getPropValue(this.inheritProps.inputAlign, this.inputAlign)
279
277
  },
280
278
  getErrorType() {
281
279
  return this.inheritProps.errorType
282
280
  },
283
281
  getPadding() {
284
- const padding = this.inheritProps.padding !== null ? this.inheritProps.padding : this.padding
282
+ const padding = this.$pi.expand.getPropValue(this.inheritProps.padding, this.padding)
285
283
  return this.$pi.common.addUnit(padding)
286
284
  },
287
285
  getHeight() {
288
- const height = this.inheritProps.height !== null ? this.inheritProps.height : this.height
286
+ const height = this.$pi.expand.getPropValue(this.inheritProps.height, this.height)
289
287
  return this.$pi.common.addUnit(height)
290
288
  },
291
289
  itemStyle() {
@@ -296,7 +294,7 @@ export default {
296
294
  return style
297
295
  },
298
296
  getLabelStyle() {
299
- return this.inheritProps.labelStyle !== null ? this.inheritProps.labelStyle : this.labelStyle
297
+ return this.$pi.expand.getPropValue(this.inheritProps.labelStyle, this.labelStyle)
300
298
  },
301
299
  computedLabelStyle() {
302
300
  const style = {}
package/config/button.js CHANGED
@@ -3,7 +3,7 @@ export default {
3
3
  customStyle: {}, // 自定义样式,对象形式(默认值:{})
4
4
  width: '', // 按钮宽度,不设置默认自动撑开,如果需要占满一行,填写’100%‘
5
5
  size: 'default', // 按钮尺寸,default,large medium small tiny mini
6
- type: 'default', // 按钮的预置样式,default,primary,warn(默认值:'default')
6
+ type: 'default', // 按钮的预置样式,`'default'` `'primary'` `'warn'` `'secondary'` `'line'` `text`(默认值:'default')
7
7
  plain: false, // 按钮是否镂空(默认值:false)
8
8
  disabled: false, // 是否禁止状态(默认值:false)
9
9
  loading: false, // 是否加载中(默认值:false)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.2-beta2",
3
+ "version": "1.2.2-beta5",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/scss/common.scss CHANGED
@@ -6,27 +6,6 @@
6
6
  * 颜色
7
7
  * -------------------------------------------------------------------------------------------------
8
8
  */
9
-
10
- // 主要颜色
11
- .pi-primary {
12
- color: $pi-primary-color;
13
- }
14
- // 次级颜色
15
- .pi-secondary {
16
- color: $pi-secondary-color;
17
- }
18
- // 第三级颜色
19
- .pi-tertiary {
20
- color: $pi-tertiary-color;
21
- }
22
- // 第四级颜色
23
- .pi-fourth {
24
- color: $pi-fourth-color;
25
- }
26
- // 第五级颜色
27
- .pi-fifth {
28
- color: $pi-fifth-color;
29
- }
30
9
  // 黑色
31
10
  .pi-black {
32
11
  color: #000000;
@@ -47,6 +26,26 @@
47
26
  .pi-light-gray {
48
27
  color: #999999;
49
28
  }
29
+ // 主要颜色
30
+ .pi-primary {
31
+ color: $pi-primary-color;
32
+ }
33
+ // 次级颜色
34
+ .pi-secondary {
35
+ color: $pi-secondary-color;
36
+ }
37
+ // 第三级颜色
38
+ .pi-tertiary {
39
+ color: $pi-tertiary-color;
40
+ }
41
+ // 第四级颜色
42
+ .pi-fourth {
43
+ color: $pi-fourth-color;
44
+ }
45
+ // 第五级颜色
46
+ .pi-fifth {
47
+ color: $pi-fifth-color;
48
+ }
50
49
 
51
50
  /**
52
51
  * 背景颜色
package/tools/index.js CHANGED
@@ -1,3 +1,11 @@
1
1
  import tool from '@sadais/piui-tool'
2
2
 
3
+ tool.expand = {
4
+ getPropValue(inheritProp, prop) {
5
+ if (inheritProp === null) return prop
6
+ else if (inheritProp !== prop) return prop
7
+ return inheritProp
8
+ }
9
+ }
10
+
3
11
  export default tool