sadais-piui 1.2.2-beta1 → 1.2.2-beta4
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;
|
|
@@ -127,6 +127,12 @@ export default {
|
|
|
127
127
|
validator: function(value) {
|
|
128
128
|
return ['line', 'line-circle', 'fill', 'fill-circle'].includes(value)
|
|
129
129
|
}
|
|
130
|
+
},
|
|
131
|
+
// 能否取消选中状态
|
|
132
|
+
canCancel: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
// false
|
|
135
|
+
default: radio.canCancel
|
|
130
136
|
}
|
|
131
137
|
},
|
|
132
138
|
data() {
|
|
@@ -172,6 +178,9 @@ export default {
|
|
|
172
178
|
? this.$pi.common.addUnit(this.inheritProps.iconSize)
|
|
173
179
|
: this.$pi.common.addUnit(this.iconSize)
|
|
174
180
|
},
|
|
181
|
+
getCanCancel() {
|
|
182
|
+
return this.inheritProps.canCancel !== null ? this.inheritProps.canCancel : this.canCancel
|
|
183
|
+
},
|
|
175
184
|
radioStyle() {
|
|
176
185
|
const style = {
|
|
177
186
|
width: this.getSize,
|
|
@@ -37,7 +37,8 @@ export default {
|
|
|
37
37
|
'size',
|
|
38
38
|
'iconSize',
|
|
39
39
|
'activeColor',
|
|
40
|
-
'activeMode'
|
|
40
|
+
'activeMode',
|
|
41
|
+
'canCancel'
|
|
41
42
|
])
|
|
42
43
|
], // 注入value与val,进行双向绑定
|
|
43
44
|
options: {
|
|
@@ -137,6 +138,12 @@ export default {
|
|
|
137
138
|
validator: function(value) {
|
|
138
139
|
return ['', 'line', 'line-circle', 'fill', 'fill-circle'].includes(value)
|
|
139
140
|
}
|
|
141
|
+
},
|
|
142
|
+
// 能否取消选中状态
|
|
143
|
+
canCancel: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
// null
|
|
146
|
+
default: radioGroup.canCancel
|
|
140
147
|
}
|
|
141
148
|
},
|
|
142
149
|
methods: {
|
|
@@ -146,7 +153,19 @@ export default {
|
|
|
146
153
|
* @arg pi-radio的name属性值
|
|
147
154
|
*/
|
|
148
155
|
emitChange(childName) {
|
|
149
|
-
|
|
156
|
+
let canCancel = this.canCancel
|
|
157
|
+
if (!canCancel) {
|
|
158
|
+
this._children.forEach(child => {
|
|
159
|
+
if (child.name === childName) {
|
|
160
|
+
canCancel = child.getCanCancel
|
|
161
|
+
}
|
|
162
|
+
})
|
|
163
|
+
}
|
|
164
|
+
if (canCancel && this.val === childName) {
|
|
165
|
+
this.val = ''
|
|
166
|
+
} else {
|
|
167
|
+
this.val = childName
|
|
168
|
+
}
|
|
150
169
|
this.handleEmitChange()
|
|
151
170
|
}
|
|
152
171
|
}
|
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', //
|
|
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/config/radio.js
CHANGED
package/config/radioGroup.js
CHANGED
package/package.json
CHANGED
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
|
* 背景颜色
|