kui-vue 3.2.2-rc1 → 3.2.2-rc5
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/components/checkbox/checkbox.jsx +4 -2
- package/components/checkbox/styles/index.less +43 -43
- package/components/drawer/drawer.jsx +10 -8
- package/components/image/preview.jsx +10 -8
- package/components/modal/modal.jsx +10 -8
- package/components/radio/radio.jsx +3 -5
- package/components/radio/styles/index.less +55 -54
- package/components/styles/index.less +2 -1
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.js +2 -2
- package/package.json +4 -7
|
@@ -51,12 +51,14 @@ export default {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
// console.log(checked)
|
|
54
|
-
const wpclasses = ["k-checkbox-wrapper", {
|
|
54
|
+
const wpclasses = ["k-checkbox-wrapper", {
|
|
55
|
+
["k-checkbox-disabled"]: disabled,
|
|
56
|
+
["k-checkbox-checked"]: checked && !indeterminate,
|
|
57
|
+
}]
|
|
55
58
|
|
|
56
59
|
const classes = [
|
|
57
60
|
"k-checkbox",
|
|
58
61
|
{
|
|
59
|
-
["k-checkbox-checked"]: checked && !indeterminate,
|
|
60
62
|
["k-checkbox-indeterminate"]: indeterminate
|
|
61
63
|
}
|
|
62
64
|
];
|
|
@@ -16,52 +16,45 @@
|
|
|
16
16
|
margin: 0;
|
|
17
17
|
box-sizing: content-box;
|
|
18
18
|
font-size: 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
left: 50%;
|
|
37
|
-
top: 50%;
|
|
38
|
-
transform: translate3d(-50%, -50%, 0);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
.k-checkbox-input {
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
.k-checkbox-inner {
|
|
21
|
+
box-sizing: content-box;
|
|
22
|
+
display: inline-block;
|
|
23
|
+
width: 14px;
|
|
24
|
+
height: 14px;
|
|
25
|
+
position: relative;
|
|
26
|
+
top: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
border: 1px solid @border-color;
|
|
29
|
+
border-radius: 2px;
|
|
30
|
+
background-color: #fff;
|
|
31
|
+
transition: border-color .2s ease-in-out, background-color .2s ease-in-out;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
color: #fff;
|
|
34
|
+
.k-icon {
|
|
35
|
+
font-size: 18px;
|
|
44
36
|
position: absolute;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
right: 0;
|
|
49
|
-
z-index: 1;
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
opacity: 0;
|
|
52
|
-
&:focus {
|
|
53
|
-
+.k-checkbox-inner {
|
|
54
|
-
border: 1px solid @main;
|
|
55
|
-
box-shadow: 0 0 5px fade(@main, 75%);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
37
|
+
left: 50%;
|
|
38
|
+
top: 50%;
|
|
39
|
+
transform: translate3d(-50%, -50%, 0);
|
|
58
40
|
}
|
|
59
41
|
}
|
|
60
|
-
.k-checkbox-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
42
|
+
.k-checkbox-input {
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 0;
|
|
47
|
+
bottom: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
right: 0;
|
|
50
|
+
z-index: 1;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
opacity: 0;
|
|
53
|
+
&:focus {
|
|
54
|
+
+.k-checkbox-inner {
|
|
55
|
+
border: 1px solid @main;
|
|
56
|
+
box-shadow: 0 0 5px fade(@main, 75%);
|
|
57
|
+
}
|
|
65
58
|
}
|
|
66
59
|
}
|
|
67
60
|
.k-checkbox-indeterminate {
|
|
@@ -93,6 +86,13 @@
|
|
|
93
86
|
}
|
|
94
87
|
}
|
|
95
88
|
|
|
89
|
+
.k-checkbox-checked {
|
|
90
|
+
.k-checkbox-inner {
|
|
91
|
+
background: @main;
|
|
92
|
+
border-color: @main;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
96
|
.k-checkbox-disabled {
|
|
97
97
|
cursor: not-allowed;
|
|
98
98
|
color: @disable-color;
|
|
@@ -65,24 +65,26 @@ export default {
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
resetBodyStyle(opened) {
|
|
68
|
+
let target = this.target();
|
|
68
69
|
if (!this.visible && !cacheBodyOverflow.hasOwnProperty('overflow')) {
|
|
69
70
|
cacheBodyOverflow = {
|
|
70
|
-
width:
|
|
71
|
-
overflow:
|
|
72
|
-
overflowX:
|
|
73
|
-
overflowY:
|
|
71
|
+
width: target.width,
|
|
72
|
+
overflow: target.overflow,
|
|
73
|
+
overflowX: target.overflowX,
|
|
74
|
+
overflowY: target.overflowY,
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
if (opened) {
|
|
77
78
|
let barWidth = measureScrollBar(true)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
let hasBar = target.scrollHeight > target.clientHeight || target.offsetHeight > target.clientHeight
|
|
80
|
+
if (barWidth && hasBar) {
|
|
81
|
+
target.style.width = `calc(100% - ${barWidth}px)`
|
|
82
|
+
target.style.overflow = `hidden`
|
|
81
83
|
}
|
|
82
84
|
} else {
|
|
83
85
|
setTimeout(() => {
|
|
84
86
|
Object.keys(cacheBodyOverflow).forEach(key => {
|
|
85
|
-
|
|
87
|
+
target.style[key] = cacheBodyOverflow[key] || ''
|
|
86
88
|
delete cacheBodyOverflow[key]
|
|
87
89
|
})
|
|
88
90
|
}, 300)
|
|
@@ -200,24 +200,26 @@ export default {
|
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
202
|
resetBodyStyle(opened) {
|
|
203
|
+
let target = document.body
|
|
203
204
|
if (!this.show && !cacheBodyOverflow.hasOwnProperty('overflow')) {
|
|
204
205
|
cacheBodyOverflow = {
|
|
205
|
-
width:
|
|
206
|
-
overflow:
|
|
207
|
-
overflowX:
|
|
208
|
-
overflowY:
|
|
206
|
+
width: target.width,
|
|
207
|
+
overflow: target.overflow,
|
|
208
|
+
overflowX: target.overflowX,
|
|
209
|
+
overflowY: target.overflowY,
|
|
209
210
|
}
|
|
210
211
|
}
|
|
211
212
|
if (opened) {
|
|
212
213
|
let barWidth = measureScrollBar(true)
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
let hasBar = target.scrollHeight > target.clientHeight || target.offsetHeight > target.clientHeight
|
|
215
|
+
if (barWidth && hasBar) {
|
|
216
|
+
target.style.width = `calc(100% - ${barWidth}px)`
|
|
217
|
+
target.style.overflow = `hidden`
|
|
216
218
|
}
|
|
217
219
|
} else {
|
|
218
220
|
setTimeout(() => {
|
|
219
221
|
Object.keys(cacheBodyOverflow).forEach(key => {
|
|
220
|
-
|
|
222
|
+
target.style[key] = cacheBodyOverflow[key] || ''
|
|
221
223
|
delete cacheBodyOverflow[key]
|
|
222
224
|
})
|
|
223
225
|
}, 300)
|
|
@@ -66,25 +66,27 @@ export default {
|
|
|
66
66
|
this.resetBodyStyle(visible)
|
|
67
67
|
},
|
|
68
68
|
resetBodyStyle(opened) {
|
|
69
|
+
let target = document.body;
|
|
69
70
|
if (!this.show && !cacheBodyOverflow.hasOwnProperty('overflow')) {
|
|
70
71
|
cacheBodyOverflow = {
|
|
71
|
-
width:
|
|
72
|
-
overflow:
|
|
73
|
-
overflowX:
|
|
74
|
-
overflowY:
|
|
72
|
+
width: target.width,
|
|
73
|
+
overflow: target.overflow,
|
|
74
|
+
overflowX: target.overflowX,
|
|
75
|
+
overflowY: target.overflowY,
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
if (opened) {
|
|
78
79
|
let barWidth = measureScrollBar(true)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
let hasBar = target.scrollHeight > target.clientHeight || target.offsetHeight > target.clientHeight
|
|
81
|
+
if (barWidth && hasBar) {
|
|
82
|
+
target.style.width = `calc(100% - ${barWidth}px)`
|
|
83
|
+
target.style.overflow = `hidden`
|
|
82
84
|
}
|
|
83
85
|
} else {
|
|
84
86
|
setTimeout(() => {
|
|
85
87
|
let task = (this.tasks && this.tasks.length == 0) || !this.tasks
|
|
86
88
|
task && Object.keys(cacheBodyOverflow).forEach(key => {
|
|
87
|
-
|
|
89
|
+
target.style[key] = cacheBodyOverflow[key] || ''
|
|
88
90
|
delete cacheBodyOverflow[key]
|
|
89
91
|
})
|
|
90
92
|
}, 300)
|
|
@@ -53,15 +53,13 @@ export default {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
const wpclasses = [
|
|
56
|
-
"k-radio-wrapper", { ["k-radio-disabled"]: disabled }
|
|
57
|
-
];
|
|
58
|
-
const classes = [
|
|
59
|
-
"k-radio", { ["k-radio-checked"]: checked }
|
|
56
|
+
"k-radio-wrapper", { ["k-radio-disabled"]: disabled, ["k-radio-checked"]: checked }
|
|
60
57
|
];
|
|
58
|
+
|
|
61
59
|
const labelNode = label || $slots.default
|
|
62
60
|
return (
|
|
63
61
|
<label class={wpclasses} onClick={e => e.stopPropagation()}>
|
|
64
|
-
<span class=
|
|
62
|
+
<span class="k-radio">
|
|
65
63
|
<input type="radio" class="k-radio-input" disabled={disabled} checked={checked} onChange={change} />
|
|
66
64
|
<span class="k-radio-inner"></span>
|
|
67
65
|
</span>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '../../styles/global.less';
|
|
2
2
|
.k-radio-group {
|
|
3
3
|
display: inline-block;
|
|
4
|
-
font-size: 0;
|
|
4
|
+
// font-size: 0;
|
|
5
5
|
// vertical-align: middle;
|
|
6
6
|
white-space: nowrap;
|
|
7
7
|
.k-btn {
|
|
@@ -59,64 +59,50 @@
|
|
|
59
59
|
position: relative;
|
|
60
60
|
margin: 0;
|
|
61
61
|
font-size: 0;
|
|
62
|
-
|
|
62
|
+
}
|
|
63
|
+
.k-radio-inner {
|
|
64
|
+
box-sizing: content-box;
|
|
65
|
+
display: inline-block;
|
|
66
|
+
width: 14px;
|
|
67
|
+
height: 14px;
|
|
68
|
+
position: relative;
|
|
69
|
+
top: 0;
|
|
70
|
+
left: 0;
|
|
71
|
+
border: 1px solid @border-color;
|
|
72
|
+
border-radius: 2px;
|
|
73
|
+
background-color: #fff;
|
|
74
|
+
transition: border-color .2s ease-in-out, background-color .2s ease-in-out;
|
|
75
|
+
border-radius: 50%;
|
|
76
|
+
&:after {
|
|
63
77
|
box-sizing: content-box;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
height: 14px;
|
|
67
|
-
position: relative;
|
|
68
|
-
top: 0;
|
|
69
|
-
left: 0;
|
|
70
|
-
border: 1px solid @border-color;
|
|
71
|
-
border-radius: 2px;
|
|
72
|
-
background-color: #fff;
|
|
73
|
-
transition: border-color .2s ease-in-out, background-color .2s ease-in-out;
|
|
74
|
-
border-radius: 50%;
|
|
75
|
-
&:after {
|
|
76
|
-
box-sizing: content-box;
|
|
77
|
-
width: 4px;
|
|
78
|
-
height: 4px;
|
|
79
|
-
position: absolute;
|
|
80
|
-
left: 5px;
|
|
81
|
-
top: 5px;
|
|
82
|
-
border-radius: 6px;
|
|
83
|
-
display: block;
|
|
84
|
-
content: " ";
|
|
85
|
-
opacity: 0;
|
|
86
|
-
background-color: @main;
|
|
87
|
-
transition: all .2s ease-in-out;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
.k-radio-input {
|
|
91
|
-
width: 100%;
|
|
92
|
-
height: 100%;
|
|
78
|
+
width: 4px;
|
|
79
|
+
height: 4px;
|
|
93
80
|
position: absolute;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
cursor: pointer;
|
|
81
|
+
left: 5px;
|
|
82
|
+
top: 5px;
|
|
83
|
+
border-radius: 6px;
|
|
84
|
+
display: block;
|
|
85
|
+
content: " ";
|
|
100
86
|
opacity: 0;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
border: 1px solid @main;
|
|
104
|
-
box-shadow: 0 0 5px fade(@main, 75%);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
87
|
+
background-color: @main;
|
|
88
|
+
transition: all .2s ease-in-out;
|
|
107
89
|
}
|
|
108
90
|
}
|
|
109
|
-
.k-radio-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
91
|
+
.k-radio-input {
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 100%;
|
|
94
|
+
position: absolute;
|
|
95
|
+
top: 0;
|
|
96
|
+
bottom: 0;
|
|
97
|
+
left: 0;
|
|
98
|
+
right: 0;
|
|
99
|
+
z-index: 1;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
opacity: 0;
|
|
102
|
+
&:focus {
|
|
103
|
+
+.k-radio-inner {
|
|
104
|
+
border: 1px solid @main;
|
|
105
|
+
box-shadow: 0 0 5px fade(@main, 75%);
|
|
120
106
|
}
|
|
121
107
|
}
|
|
122
108
|
}
|
|
@@ -126,6 +112,21 @@
|
|
|
126
112
|
}
|
|
127
113
|
}
|
|
128
114
|
|
|
115
|
+
.k-radio-checked {
|
|
116
|
+
.k-radio-inner {
|
|
117
|
+
background: #fff;
|
|
118
|
+
border-color: @main;
|
|
119
|
+
position: relative;
|
|
120
|
+
&:after {
|
|
121
|
+
opacity: 1;
|
|
122
|
+
width: 8px;
|
|
123
|
+
height: 8px;
|
|
124
|
+
left: 3px;
|
|
125
|
+
top: 3px;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
129
130
|
.k-radio-disabled {
|
|
130
131
|
cursor: not-allowed;
|
|
131
132
|
// opacity: .5;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
@import '../grid/styles/index.less';
|
|
21
21
|
@import '../input/styles/index.less';
|
|
22
22
|
@import '../image/styles/index.less';
|
|
23
|
-
|
|
23
|
+
@import '../loading/styles/index.less';
|
|
24
24
|
@import '../layout/styles/index.less';
|
|
25
25
|
@import '../modal/styles/index.less';
|
|
26
26
|
@import '../message/styles/index.less';
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
@import '../popconfirm/styles/index.less';
|
|
33
33
|
@import '../progress/styles/index.less';
|
|
34
34
|
@import '../radio/styles/index.less';
|
|
35
|
+
@import '../rate/styles/index.less';
|
|
35
36
|
// @import '../scroll/scroll';
|
|
36
37
|
@import '../spin/styles/index.less';
|
|
37
38
|
@import '../select/styles/index.less';
|