kui-vue 3.2.2 → 3.2.4
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/affix/affix.jsx +23 -75
- package/components/affix/demo/container.md +14 -7
- package/components/affix/index.md +7 -5
- package/components/alert/styles/index.less +13 -8
- package/components/avatar/avatar.jsx +63 -0
- package/components/avatar/demo/base.md +24 -0
- package/components/avatar/demo/change.md +40 -0
- package/components/avatar/demo/index.vue +20 -0
- package/components/avatar/demo/info.md +7 -0
- package/components/avatar/demo/types.md +23 -0
- package/components/avatar/index.js +2 -0
- package/components/avatar/index.md +7 -0
- package/components/avatar/styles/index.less +61 -0
- package/components/badge/styles/index.less +1 -2
- package/components/base/pop.jsx +1 -1
- package/components/breadcrumb/styles/index.less +2 -2
- package/components/button/demo/hollow.md +1 -1
- package/components/button/styles/index.less +5 -5
- package/components/card/demo/border.md +1 -1
- package/components/card/styles/index.less +4 -3
- package/components/checkbox/checkbox.jsx +4 -2
- package/components/checkbox/styles/index.less +49 -44
- package/components/collapse/styles/index.less +3 -10
- package/components/colorPicker/styles/index.less +5 -3
- package/components/datePicker/styles/calendar.less +6 -5
- package/components/datePicker/styles/datepicker.less +3 -3
- package/components/divider/styles/index.less +7 -6
- package/components/drawer/drawer.jsx +10 -8
- package/components/drawer/styles/index.less +2 -1
- package/components/dropdown/demo/rightmenu.md +2 -3
- package/components/dropdown/styles/index.less +2 -2
- package/components/empty/styles/index.less +1 -1
- package/components/form/styles/index.less +1 -0
- package/components/grid/demo/align.md +3 -3
- package/components/grid/demo/fill.md +3 -3
- package/components/grid/demo/flex.md +5 -5
- package/components/grid/demo/index.vue +0 -1
- package/components/icon/demo/search.vue +2 -2
- package/components/image/instance.js +1 -1
- package/components/image/preview.jsx +50 -20
- package/components/image/styles/index.less +7 -5
- package/components/index.js +7 -1
- package/components/input/styles/index.less +2 -1
- package/components/layout/demo/base.md +3 -4
- package/components/layout/demo/layout1.md +4 -4
- package/components/layout/demo/layout2.md +5 -6
- package/components/layout/demo/layout3.md +3 -4
- package/components/layout/demo/layout4.md +4 -4
- package/components/layout/demo/layout5.md +8 -8
- package/components/layout/demo/layout6.md +2 -2
- package/components/layout/styles/index.less +2 -3
- package/components/loading/styles/index.less +1 -1
- package/components/menu/styles/dropmenu.less +7 -6
- package/components/menu/styles/index.less +13 -9
- package/components/message/styles/index.less +1 -1
- package/components/modal/modal.jsx +10 -8
- package/components/modal/styles/index.less +7 -6
- package/components/notice/styles/index.less +1 -1
- package/components/page/styles/index.less +1 -1
- package/components/popconfirm/styles/index.less +3 -2
- package/components/poptip/styles/index.less +4 -3
- package/components/progress/styles/index.less +3 -3
- package/components/radio/radio.jsx +3 -5
- package/components/radio/styles/index.less +60 -55
- package/components/rate/index.md +3 -3
- package/components/rate/styles/index.less +1 -1
- package/components/select/styles/index.less +8 -7
- package/components/slider/demo/base.md +35 -0
- package/components/slider/demo/index.vue +18 -0
- package/components/slider/demo/info.md +7 -0
- package/components/slider/demo/vertical.md +13 -0
- package/components/slider/index.md +7 -0
- package/components/slider/slider.jsx +58 -0
- package/components/slider/styles/index.less +60 -32
- package/components/space/demo/align.md +46 -0
- package/components/space/demo/base.md +20 -0
- package/components/space/demo/custom-size.md +35 -0
- package/components/space/demo/index.vue +25 -0
- package/components/space/demo/info.md +11 -0
- package/components/space/demo/size.md +35 -0
- package/components/space/demo/vertical.md +19 -0
- package/components/space/index.js +2 -0
- package/components/space/index.md +6 -0
- package/components/space/space.jsx +57 -0
- package/components/space/styles/index.less +23 -0
- package/components/spin/demo/container.md +1 -2
- package/components/spin/demo/mode.md +1 -2
- package/components/spin/styles/index.less +1 -1
- package/components/styles/dark.less +70 -0
- package/components/styles/global-dark.less +36 -0
- package/components/styles/global.less +22 -12
- package/components/styles/index.less +8 -10
- package/components/switch/styles/index.less +4 -3
- package/components/table/demo/base-render.md +1 -1
- package/components/table/demo/base.md +5 -2
- package/components/table/styles/index.less +11 -7
- package/components/table/table.jsx +10 -7
- package/components/tabs/demo/sample.md +1 -1
- package/components/tabs/styles/index.less +7 -10
- package/components/tag/styles/index.less +40 -39
- package/components/timeline/styles/index.less +3 -2
- package/components/tooltip/styles/index.less +22 -3
- package/components/tree/styles/index.less +8 -8
- package/dist/k-ui-dark.css +1 -0
- package/dist/k-ui.css +1 -7
- package/dist/k-ui.js +2 -2
- package/package.json +11 -9
- package/components/slider/demo/slider.js +0 -5
- package/components/slider/slider.vue +0 -21
- package/components/slider/sliderButton.vue +0 -76
- package/components/styles.js +0 -43
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
.k-poptip-content {
|
|
8
8
|
min-width: 200px;
|
|
9
9
|
// max-width: 300px;
|
|
10
|
+
color: @color;
|
|
10
11
|
font-size: 12px;
|
|
11
12
|
line-height: 1.5;
|
|
12
13
|
position: absolute;
|
|
13
14
|
z-index: 1001;
|
|
14
15
|
transform: translateZ(0);
|
|
15
16
|
.k-poptip-inner {
|
|
16
|
-
background:
|
|
17
|
+
background: @back-color;
|
|
17
18
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
18
19
|
border-radius: @radius;
|
|
19
20
|
}
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
margin: 0;
|
|
29
30
|
padding: 8px 16px;
|
|
30
31
|
position: relative;
|
|
31
|
-
border-bottom: 1px solid
|
|
32
|
+
border-bottom: 1px solid darken(@back-color,5%);
|
|
32
33
|
text-overflow: ellipsis;
|
|
33
34
|
overflow: hidden;
|
|
34
35
|
}
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
align-items: center;
|
|
42
43
|
width: 19px;
|
|
43
44
|
.k-poptip-arrow-content {
|
|
44
|
-
background-color:
|
|
45
|
+
background-color: @back-color;
|
|
45
46
|
transform: rotate(45deg);
|
|
46
47
|
width: 12px;
|
|
47
48
|
height: 12px;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
.k-progress-inner {
|
|
4
4
|
display: inline-block;
|
|
5
5
|
border-radius: 10px;
|
|
6
|
-
background-color: @
|
|
7
|
-
stroke: @
|
|
6
|
+
background-color: fadeout(@border-color, 50%);
|
|
7
|
+
stroke: fadeout(@border-color, 50%);
|
|
8
8
|
overflow: hidden;
|
|
9
9
|
vertical-align: middle;
|
|
10
10
|
width: calc(100% - 38px);
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
top: 0;
|
|
97
97
|
width: 0;
|
|
98
98
|
height: 100%;
|
|
99
|
-
background-color:
|
|
99
|
+
background-color: @back-color;
|
|
100
100
|
opacity: 0;
|
|
101
101
|
border-radius: 10px;
|
|
102
102
|
animation: k-progress-active 2.4s linear infinite;
|
|
@@ -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 {
|
|
@@ -30,6 +30,9 @@
|
|
|
30
30
|
color: @main;
|
|
31
31
|
border-color: @main;
|
|
32
32
|
}
|
|
33
|
+
.k-radio-wrapper {
|
|
34
|
+
margin-right: 16px;
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
.k-radio-cirle {
|
|
@@ -49,6 +52,7 @@
|
|
|
49
52
|
font-size: 12px;
|
|
50
53
|
display: inline-block;
|
|
51
54
|
line-height: 1;
|
|
55
|
+
color: @color;
|
|
52
56
|
.k-radio {
|
|
53
57
|
display: inline-block;
|
|
54
58
|
vertical-align: middle;
|
|
@@ -59,73 +63,74 @@
|
|
|
59
63
|
position: relative;
|
|
60
64
|
margin: 0;
|
|
61
65
|
font-size: 0;
|
|
62
|
-
|
|
66
|
+
}
|
|
67
|
+
.k-radio-inner {
|
|
68
|
+
box-sizing: content-box;
|
|
69
|
+
display: inline-block;
|
|
70
|
+
width: 14px;
|
|
71
|
+
height: 14px;
|
|
72
|
+
position: relative;
|
|
73
|
+
top: 0;
|
|
74
|
+
left: 0;
|
|
75
|
+
border: 1px solid @border-color;
|
|
76
|
+
border-radius: 2px;
|
|
77
|
+
background-color: @back-color;
|
|
78
|
+
transition: border-color .2s ease-in-out, background-color .2s ease-in-out;
|
|
79
|
+
border-radius: 50%;
|
|
80
|
+
&:after {
|
|
63
81
|
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%;
|
|
82
|
+
width: 4px;
|
|
83
|
+
height: 4px;
|
|
93
84
|
position: absolute;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
cursor: pointer;
|
|
85
|
+
left: 5px;
|
|
86
|
+
top: 5px;
|
|
87
|
+
border-radius: 6px;
|
|
88
|
+
display: block;
|
|
89
|
+
content: " ";
|
|
100
90
|
opacity: 0;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
border: 1px solid @main;
|
|
104
|
-
box-shadow: 0 0 5px fade(@main, 75%);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
91
|
+
background-color: @main;
|
|
92
|
+
transition: all .2s ease-in-out;
|
|
107
93
|
}
|
|
108
94
|
}
|
|
109
|
-
.k-radio-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
95
|
+
.k-radio-input {
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 100%;
|
|
98
|
+
position: absolute;
|
|
99
|
+
top: 0;
|
|
100
|
+
bottom: 0;
|
|
101
|
+
left: 0;
|
|
102
|
+
right: 0;
|
|
103
|
+
z-index: 1;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
opacity: 0;
|
|
106
|
+
&:focus {
|
|
107
|
+
+.k-radio-inner {
|
|
108
|
+
border: 1px solid @main;
|
|
109
|
+
box-shadow: 0 0 5px fade(@main, 75%);
|
|
120
110
|
}
|
|
121
111
|
}
|
|
122
112
|
}
|
|
123
113
|
.k-radio-label {
|
|
124
|
-
padding:
|
|
114
|
+
padding-left: 8px;
|
|
125
115
|
vertical-align: middle;
|
|
126
116
|
}
|
|
127
117
|
}
|
|
128
118
|
|
|
119
|
+
.k-radio-checked {
|
|
120
|
+
.k-radio-inner {
|
|
121
|
+
background: @back-color;
|
|
122
|
+
border-color: @main;
|
|
123
|
+
position: relative;
|
|
124
|
+
&:after {
|
|
125
|
+
opacity: 1;
|
|
126
|
+
width: 8px;
|
|
127
|
+
height: 8px;
|
|
128
|
+
left: 3px;
|
|
129
|
+
top: 3px;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
129
134
|
.k-radio-disabled {
|
|
130
135
|
cursor: not-allowed;
|
|
131
136
|
// opacity: .5;
|
package/components/rate/index.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
### Rate API
|
|
2
2
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
-
|
|
3
|
+
| -------------- | ---------------------- | ----------------------- | ------ |
|
|
4
4
|
| value(v-model) | 当前数,受控值 | Number | - |
|
|
5
5
|
| allowClear | 是否允许再次点击后清除 | Boolean | false |
|
|
6
6
|
| allowHalf | 是否允许半选 | Boolean | - |
|
|
7
7
|
| showScore | 是否显示分数 | Boolean | - |
|
|
8
8
|
| character | 自定义字符 | String | - |
|
|
9
|
-
| count | star 总数 |
|
|
9
|
+
| count | star 总数 | Number | - |
|
|
10
10
|
| disabled | 只读,无法进行交互 | String | - |
|
|
11
11
|
| tooltips | 自定义每项的提示信息 | String[] | - |
|
|
12
|
-
|
|
|
12
|
+
| change | 选择时的回调 | Function(value:number)) | - |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
min-width: 80px;
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
vertical-align: middle;
|
|
9
|
-
color:
|
|
9
|
+
color: @color;
|
|
10
10
|
font-size: 12px;
|
|
11
11
|
position: relative;
|
|
12
12
|
outline: none;
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
user-select: none;
|
|
28
28
|
cursor: pointer;
|
|
29
29
|
position: relative;
|
|
30
|
-
background-color: #fff;
|
|
31
30
|
border: 1px solid @border-color;
|
|
32
31
|
min-height: 32px;
|
|
33
32
|
position: relative;
|
|
@@ -50,6 +49,7 @@
|
|
|
50
49
|
background: none;
|
|
51
50
|
outline: none;
|
|
52
51
|
font-size: 12px;
|
|
52
|
+
color: @color;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
&-labels {
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
width: inherit;
|
|
184
184
|
max-height: 200px;
|
|
185
185
|
overflow: auto;
|
|
186
|
-
background-color:
|
|
186
|
+
background-color: @back-color;
|
|
187
187
|
box-sizing: border-box;
|
|
188
188
|
box-shadow: 0 1px 6px rgba(0, 0, 0, .2);
|
|
189
189
|
position: absolute;
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
line-height: normal;
|
|
210
210
|
padding: 7px 16px;
|
|
211
211
|
clear: both;
|
|
212
|
-
color:
|
|
212
|
+
color: @color;
|
|
213
213
|
font-size: 12px !important;
|
|
214
214
|
white-space: nowrap;
|
|
215
215
|
list-style: none;
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
cursor: pointer;
|
|
221
221
|
position: relative;
|
|
222
222
|
&:hover {
|
|
223
|
-
background: @
|
|
223
|
+
background: @hover-color;
|
|
224
224
|
}
|
|
225
225
|
.k-icon {
|
|
226
226
|
position: absolute;
|
|
@@ -237,11 +237,11 @@
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
.k-select-item-selected {
|
|
240
|
-
background:
|
|
240
|
+
background: @selected-color;
|
|
241
241
|
color: @main;
|
|
242
242
|
font-weight: 500;
|
|
243
243
|
&:hover {
|
|
244
|
-
background:
|
|
244
|
+
background: @selected-color;
|
|
245
245
|
}
|
|
246
246
|
.k-icon {
|
|
247
247
|
color: @main;
|
|
@@ -351,6 +351,7 @@
|
|
|
351
351
|
}
|
|
352
352
|
.k-select-search-mirror, .k-select-search {
|
|
353
353
|
font-size: 14px;
|
|
354
|
+
color: @color;
|
|
354
355
|
}
|
|
355
356
|
}
|
|
356
357
|
.k-select-labels {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 基本用法
|
|
3
|
+
基本用法
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<Slider value="30"/>
|
|
10
|
+
<Slider value="30" disabled/>
|
|
11
|
+
<br/>
|
|
12
|
+
<br/>
|
|
13
|
+
<Space>
|
|
14
|
+
<Slider min="1" v-model="v" max="10"/>
|
|
15
|
+
<Input v-model="v" size="small" style="width:60px">
|
|
16
|
+
</Space>
|
|
17
|
+
<br/>
|
|
18
|
+
<br/>
|
|
19
|
+
<Space>
|
|
20
|
+
<Slider min="1" v-model="v2" max="10" :step="0.1"/>
|
|
21
|
+
<Input v-model="v2" size="small" style="width:60px">
|
|
22
|
+
</Space>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
<script>
|
|
26
|
+
export default{
|
|
27
|
+
data(){
|
|
28
|
+
return{
|
|
29
|
+
v:3,
|
|
30
|
+
v2:3.5
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Info from "./info";
|
|
3
|
+
import Base from "./base";
|
|
4
|
+
// import Vertical from "./vertical";
|
|
5
|
+
|
|
6
|
+
import CN from "../index.md";
|
|
7
|
+
export default {
|
|
8
|
+
render() {
|
|
9
|
+
return (
|
|
10
|
+
<div class="switch-demo">
|
|
11
|
+
<Info class="typo" />
|
|
12
|
+
<Base />
|
|
13
|
+
<CN class="typo" />
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
</script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
### Slider API
|
|
2
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
+
| ------ | -------------------------------------------------------------------------- | ----------------------------------------------- | ------ |
|
|
4
|
+
| min | 最小值 | number | 0 |
|
|
5
|
+
| max | 最大值 | number | 100 |
|
|
6
|
+
| step | 间距大小 | 步长,取值必须大于 0,并且可被 (max - min) 整除 | 1 |
|
|
7
|
+
| change | 当 Slider 的值发生改变时,会触发 change 事件,并把改变后的值作为参数传入。 | Function | - |
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
value: [String, Number],
|
|
4
|
+
min: { type: [Number, String], default: 0 },
|
|
5
|
+
max: { type: [Number, String], default: 100 },
|
|
6
|
+
disabled: Boolean,
|
|
7
|
+
step: {
|
|
8
|
+
type: [Number, String],
|
|
9
|
+
default: 1,
|
|
10
|
+
validator: (val) => val > 0
|
|
11
|
+
},
|
|
12
|
+
direction: {
|
|
13
|
+
//todo:
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'horizontal',
|
|
16
|
+
validator: (val) => ['horizontal', 'vertical'].indexOf(val) >= 0
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
defaultValue: this.value || 0,
|
|
22
|
+
timer: null,
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
change(e) {
|
|
27
|
+
let value = e.target.value * 1
|
|
28
|
+
this.defaultValue = value
|
|
29
|
+
this.$emit('input', value)
|
|
30
|
+
|
|
31
|
+
clearTimeout(this.timer)
|
|
32
|
+
this.timer = setTimeout(() => {
|
|
33
|
+
this.$emit('change', value)
|
|
34
|
+
}, 300);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
render() {
|
|
38
|
+
let { min, max, step, disabled, direction } = this
|
|
39
|
+
let props = {
|
|
40
|
+
class: 'k-slider-bar',
|
|
41
|
+
attrs: {
|
|
42
|
+
min, max, step,
|
|
43
|
+
value: this.defaultValue,
|
|
44
|
+
type: 'range',
|
|
45
|
+
disabled,
|
|
46
|
+
},
|
|
47
|
+
style: {
|
|
48
|
+
'background': `linear-gradient(to right, #3a95ff ${(this.defaultValue - min) / (max - min) * 100}%, rgba(255, 255, 255, 0.3) 0%)`
|
|
49
|
+
},
|
|
50
|
+
on: {
|
|
51
|
+
input: this.change
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// todo: 懒得写, 用input range 替代, 等需求复杂了, 再继续写更多
|
|
55
|
+
return <div class={['k-slider', { 'k-slider-disabled': disabled }]}><input {...props} /></div>
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
@@ -1,35 +1,63 @@
|
|
|
1
|
+
@import '../../styles/global.less';
|
|
1
2
|
.k-slider {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
}
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
position: relative;
|
|
6
|
+
height: 12px;
|
|
7
|
+
font-size: 0;
|
|
8
|
+
&::before {
|
|
9
|
+
content: '';
|
|
10
|
+
position: absolute;
|
|
11
|
+
height: 4px;
|
|
12
|
+
border-radius: 2px;
|
|
13
|
+
background: @border-color;
|
|
14
|
+
top: 4px;
|
|
15
|
+
width: 100%;
|
|
16
|
+
left: 0;
|
|
17
|
+
}
|
|
18
|
+
.k-slider-bar {
|
|
19
|
+
position: relative;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
margin-top: 4px;
|
|
22
|
+
-webkit-appearance: none;
|
|
23
|
+
// background: linear-gradient(to right, #1CE4FF 41.6777%, rgba(255, 255, 255, 0.3) 0%);
|
|
24
|
+
border-radius: 3px;
|
|
25
|
+
width: 100%;
|
|
26
|
+
// 轨道
|
|
27
|
+
&::-webkit-slider-runnable-track {
|
|
28
|
+
height: 4px;
|
|
29
|
+
border-radius: 3px;
|
|
30
|
+
// box-shadow: 0 1px 1px #def3f8, inset 0 .125em .125em #0d1112;
|
|
31
|
+
// background: @border-color;
|
|
32
|
+
border-radius: 2px;
|
|
34
33
|
}
|
|
34
|
+
//滑块
|
|
35
|
+
&::-webkit-slider-thumb {
|
|
36
|
+
-webkit-appearance: none;
|
|
37
|
+
height: 12px;
|
|
38
|
+
width: 12px;
|
|
39
|
+
margin-top: -4px;
|
|
40
|
+
// background: @main;
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
border: 2px solid @main;
|
|
43
|
+
background-color: @back-color;
|
|
44
|
+
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
&:disabled {
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
}
|
|
50
|
+
&:focus {
|
|
51
|
+
&::-webkit-slider-thumb {
|
|
52
|
+
box-shadow: 0 0 0px 5px fadeout(@main,80%);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.k-slider-disabled {
|
|
59
|
+
opacity: .5;
|
|
60
|
+
// {
|
|
61
|
+
// -webkit-appearance: slider-vertical;
|
|
62
|
+
// }
|
|
35
63
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 对齐
|
|
3
|
+
设置对齐模式。
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div class="demo-space">
|
|
9
|
+
Align start
|
|
10
|
+
<Space align="start">
|
|
11
|
+
<Button size="large">large</Button>
|
|
12
|
+
<Button>default</Button>
|
|
13
|
+
<Button size="small">small</Button>
|
|
14
|
+
Start text
|
|
15
|
+
</Space>
|
|
16
|
+
<br/>
|
|
17
|
+
<br/>
|
|
18
|
+
Align end
|
|
19
|
+
<Space align="end">
|
|
20
|
+
<Button size="large">large</Button>
|
|
21
|
+
<Button>default</Button>
|
|
22
|
+
<Button size="small">small</Button>
|
|
23
|
+
End text
|
|
24
|
+
</Space>
|
|
25
|
+
<br/>
|
|
26
|
+
<br/>
|
|
27
|
+
Align center
|
|
28
|
+
<Space align="center">
|
|
29
|
+
<Button size="large">large</Button>
|
|
30
|
+
<Button>default</Button>
|
|
31
|
+
<Button size="small">small</Button>
|
|
32
|
+
Center text
|
|
33
|
+
</Space>
|
|
34
|
+
<br/>
|
|
35
|
+
<br/>
|
|
36
|
+
Align baseline
|
|
37
|
+
<Space align="start">
|
|
38
|
+
<Button>button</Button>
|
|
39
|
+
<span style="background:#eee">Baseline text</span>
|
|
40
|
+
</Space>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
<style scoped>
|
|
44
|
+
|
|
45
|
+
</style>
|
|
46
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 基本用法
|
|
3
|
+
相邻组件水平间距。
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<Space>
|
|
9
|
+
Space
|
|
10
|
+
<Button>Button</Button>
|
|
11
|
+
<Button icon="search">Button</Button>
|
|
12
|
+
<Tooltip placement="top">
|
|
13
|
+
<Button>Space</Button>
|
|
14
|
+
<template slot="title">
|
|
15
|
+
<p>I am space</p>
|
|
16
|
+
</template>
|
|
17
|
+
</Tooltip>
|
|
18
|
+
</Space>
|
|
19
|
+
</template>
|
|
20
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 自定义尺寸
|
|
3
|
+
自定义间距大小。
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<Slider v-model="size" max="50"/>
|
|
10
|
+
<br/>
|
|
11
|
+
<br/>
|
|
12
|
+
<Space :size="size">
|
|
13
|
+
<Button type="primary">Primary</Button>
|
|
14
|
+
<Button type="danger">Danger</Button>
|
|
15
|
+
<Button>Default</Button>
|
|
16
|
+
<Button type="dashed">Dashed</Button>
|
|
17
|
+
<Button type="link">Link</Button>
|
|
18
|
+
</Space>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
<script>
|
|
22
|
+
export default {
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
size: 12,
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
methods:{
|
|
29
|
+
change(e){
|
|
30
|
+
this.size =e.target.value*1
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
35
|
+
```
|