kui-vue 3.2.3-rc1 → 3.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/components/_tool/utils.js +2 -2
- package/components/affix/affix.jsx +23 -75
- package/components/affix/demo/container.md +14 -7
- package/components/affix/index.md +6 -5
- package/components/alert/styles/index.less +19 -19
- 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/backtop/styles/index.less +2 -2
- package/components/badge/demo/dot.md +1 -1
- package/components/badge/demo/dynamic.md +1 -1
- package/components/badge/demo/max.md +1 -1
- package/components/badge/styles/index.less +21 -21
- package/components/base/input.jsx +16 -10
- package/components/breadcrumb/styles/index.less +4 -4
- package/components/button/button.jsx +14 -8
- package/components/button/buttonGroup.jsx +6 -6
- package/components/button/demo/base.md +2 -1
- package/components/button/demo/disabled.md +14 -16
- package/components/button/demo/group.md +2 -2
- package/components/button/demo/index.vue +6 -2
- package/components/button/demo/light.md +26 -0
- package/components/button/demo/loading.md +1 -1
- package/components/button/demo/normal.md +25 -0
- package/components/button/demo/size.md +2 -2
- package/components/button/demo/solid.md +16 -0
- package/components/button/demo/with-icon.md +4 -3
- package/components/button/index.md +3 -3
- package/components/button/styles/index.less +106 -45
- package/components/card/demo/base.md +1 -1
- package/components/card/demo/border.md +2 -2
- package/components/card/styles/index.less +6 -6
- package/components/carousel/styles/index.less +1 -1
- package/components/checkbox/demo/group-vertical.md +47 -0
- package/components/checkbox/demo/index.vue +4 -0
- package/components/checkbox/demo/options.md +46 -0
- package/components/checkbox/group.jsx +9 -3
- package/components/checkbox/index.md +8 -7
- package/components/checkbox/styles/index.less +35 -21
- package/components/collapse/styles/index.less +10 -10
- package/components/colorPicker/styles/index.less +14 -14
- package/components/datePicker/datepicker.jsx +11 -3
- package/components/datePicker/demo/index.vue +2 -0
- package/components/datePicker/demo/theme.md +34 -0
- package/components/datePicker/index.md +4 -1
- package/components/datePicker/styles/calendar.less +39 -38
- package/components/datePicker/styles/datepicker.less +37 -20
- package/components/divider/styles/index.less +6 -6
- package/components/drawer/styles/index.less +12 -10
- package/components/dropdown/demo/base.md +4 -4
- package/components/dropdown/demo/cascading.md +3 -3
- package/components/dropdown/demo/divider.md +3 -3
- package/components/dropdown/styles/index.less +4 -4
- package/components/empty/styles/index.less +2 -2
- package/components/form/demo/base.md +25 -2
- package/components/form/demo/index.vue +1 -1
- package/components/form/demo/valid.md +9 -0
- package/components/form/form.jsx +2 -0
- package/components/form/formitem.jsx +18 -10
- package/components/form/styles/index.less +17 -13
- package/components/grid/styles/index.less +1 -1
- package/components/icon/demo/base.md +4 -4
- package/components/icon/demo/search.vue +6 -9
- package/components/image/styles/index.less +18 -18
- package/components/index.js +10 -2
- package/components/input/demo/index.vue +3 -1
- package/components/input/demo/theme.md +39 -0
- package/components/input/index.md +9 -6
- package/components/input/input.jsx +10 -3
- package/components/input/styles/index.less +120 -78
- package/components/input/textarea.jsx +1 -0
- package/components/layout/demo/base.md +5 -3
- package/components/layout/demo/index.vue +0 -2
- package/components/layout/demo/info.md +0 -2
- package/components/layout/demo/layout1.md +40 -47
- package/components/layout/demo/layout2.md +42 -49
- package/components/layout/demo/layout3.md +44 -22
- package/components/layout/demo/layout4.md +19 -18
- package/components/layout/demo/layout5.md +47 -44
- package/components/layout/styles/index.less +1 -6
- package/components/loading/styles/index.less +4 -4
- package/components/menu/demo/accrodion.md +2 -2
- package/components/menu/demo/base.md +5 -13
- package/components/menu/demo/collapsed.md +2 -2
- package/components/menu/demo/index.vue +0 -2
- package/components/menu/demo/inline.md +6 -10
- package/components/menu/demo/mode.md +2 -2
- package/components/menu/demo/theme.md +2 -2
- package/components/menu/demo/vertical.md +2 -2
- package/components/menu/index.md +0 -3
- package/components/menu/menu.jsx +4 -4
- package/components/menu/menuitem.jsx +1 -13
- package/components/menu/styles/dropmenu.less +28 -20
- package/components/menu/styles/index.less +148 -251
- package/components/menu/submenu.jsx +4 -64
- package/components/message/group.jsx +1 -1
- package/components/message/styles/index.less +13 -8
- package/components/modal/demo/base.md +15 -2
- package/components/modal/demo/custom.md +2 -2
- package/components/modal/demo/more.md +6 -6
- package/components/modal/modal.jsx +11 -5
- package/components/modal/styles/index.less +24 -17
- package/components/notice/styles/index.less +14 -13
- package/components/page/styles/index.less +16 -16
- package/components/popconfirm/styles/index.less +6 -6
- package/components/poptip/styles/index.less +10 -9
- package/components/progress/styles/index.less +13 -13
- package/components/radio/button.jsx +2 -2
- package/components/radio/demo/button.md +3 -3
- package/components/radio/demo/group-vertical.md +46 -0
- package/components/radio/demo/index.vue +4 -0
- package/components/radio/demo/options.md +43 -0
- package/components/radio/group.jsx +14 -8
- package/components/radio/index.md +11 -9
- package/components/radio/styles/index.less +37 -23
- package/components/rate/styles/index.less +2 -2
- package/components/select/demo/icon.md +40 -0
- package/components/select/demo/index.vue +4 -0
- package/components/select/demo/size.md +5 -5
- package/components/select/demo/theme.md +46 -0
- package/components/select/index.md +5 -2
- package/components/select/select.jsx +20 -13
- package/components/select/styles/index.less +113 -49
- 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 +63 -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/styles/index.less +7 -11
- package/components/steps/styles/index.less +11 -11
- package/components/styles/color.less +158 -0
- package/components/styles/index.less +6 -1
- package/components/styles/sys.less +34 -0
- package/components/styles/var.less +150 -0
- package/components/switch/styles/index.less +11 -11
- package/components/table/styles/index.less +29 -32
- package/components/tabs/styles/index.less +20 -19
- package/components/tag/styles/index.less +45 -45
- package/components/timeline/styles/index.less +5 -5
- package/components/tooltip/styles/index.less +19 -18
- package/components/tree/styles/index.less +15 -15
- package/components/treeselect/styles/index.less +5 -5
- package/components/upload/demo/accept.md +68 -0
- package/components/upload/demo/avatar.md +40 -0
- package/components/upload/demo/base.md +40 -0
- package/components/upload/demo/custom.md +47 -0
- package/components/upload/demo/directory.md +36 -0
- package/components/upload/demo/drag.md +0 -0
- package/components/upload/demo/draggable.md +45 -0
- package/components/upload/demo/exceed.md +42 -0
- package/components/upload/demo/file-list.md +42 -0
- package/components/upload/demo/form.md +120 -0
- package/components/upload/demo/index.vue +37 -0
- package/components/upload/demo/info.md +10 -0
- package/components/upload/demo/picture.md +54 -0
- package/components/upload/index.md +26 -0
- package/components/upload/styles/index.less +258 -0
- package/components/upload/upload.jsx +336 -0
- package/dist/k-ui.css +1 -1
- package/dist/k-ui.js +2 -2
- package/package.json +10 -4
- package/components/button/demo/hollow.md +0 -15
- package/components/layout/demo/layout6.md +0 -142
- package/components/menu/demo/vertical-affix.md +0 -69
- 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/dark.less +0 -67
- package/components/styles/global-dark.less +0 -36
- package/components/styles/global.less +0 -44
- package/components/upload/upload.vue +0 -137
- package/dist/k-ui-dark.css +0 -1
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
@import '../../styles/
|
|
1
|
+
@import '../../styles/var.less';
|
|
2
2
|
.k-btn {
|
|
3
|
-
color:
|
|
4
|
-
font-size:
|
|
3
|
+
color: var(--kui-color-font);
|
|
4
|
+
font-size: 14px;
|
|
5
5
|
height: 32px;
|
|
6
6
|
line-height: 30px;
|
|
7
7
|
padding: 0 15px;
|
|
8
8
|
box-sizing: border-box;
|
|
9
|
-
border-radius:
|
|
9
|
+
border-radius: var(--kui-border-radius);
|
|
10
10
|
display: inline-block;
|
|
11
11
|
vertical-align: middle; // transition: opacity .2s ease-in-out;
|
|
12
12
|
user-select: none;
|
|
13
13
|
outline: none;
|
|
14
|
-
border: 1px solid
|
|
14
|
+
border: 1px solid var(--kui-color-border);
|
|
15
15
|
background-color: transparent;
|
|
16
16
|
transition: all .3s cubic-bezier(.645, .045, .355, 1);
|
|
17
17
|
z-index: 0;
|
|
18
18
|
white-space: nowrap;
|
|
19
|
+
cursor: pointer;
|
|
19
20
|
&:focus, &:hover {
|
|
20
|
-
border-color:
|
|
21
|
-
color:
|
|
21
|
+
border-color: var(--kui-color-main);
|
|
22
|
+
color: var(--kui-color-main);
|
|
22
23
|
z-index: 1;
|
|
23
24
|
}
|
|
24
25
|
&>.k-icon +span, span +.k-icon {
|
|
@@ -29,6 +30,26 @@
|
|
|
29
30
|
vertical-align: middle;
|
|
30
31
|
margin-top: -2px;
|
|
31
32
|
}
|
|
33
|
+
&.k-btn-light {
|
|
34
|
+
background-color: var(--kui-color-gray-80);
|
|
35
|
+
border: none;
|
|
36
|
+
}
|
|
37
|
+
&.k-btn-solid {
|
|
38
|
+
background: 0 0;
|
|
39
|
+
color: var(--kui-color-font);
|
|
40
|
+
border-color: var(--kui-color-border);
|
|
41
|
+
&:focus, &:hover {
|
|
42
|
+
border-color: var(--kui-color-main);
|
|
43
|
+
color: var(--kui-color-main);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
&.k-btn-normal {
|
|
47
|
+
background: 0 0;
|
|
48
|
+
border: none;
|
|
49
|
+
&:hover {
|
|
50
|
+
background-color: var(--kui-color-gray-80);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
32
53
|
}
|
|
33
54
|
|
|
34
55
|
.k-btn-block {
|
|
@@ -72,8 +93,8 @@
|
|
|
72
93
|
|
|
73
94
|
.k-btn-primary {
|
|
74
95
|
color: #fff;
|
|
75
|
-
background:
|
|
76
|
-
border-color:
|
|
96
|
+
background: var(--kui-color-main);
|
|
97
|
+
border-color: var(--kui-color-main);
|
|
77
98
|
&:hover {
|
|
78
99
|
opacity: .8;
|
|
79
100
|
zoom: 0%;
|
|
@@ -82,51 +103,89 @@
|
|
|
82
103
|
&:focus {
|
|
83
104
|
color: #fff;
|
|
84
105
|
}
|
|
106
|
+
&.k-btn-light {
|
|
107
|
+
background-color: var(--kui-color-gray-80);
|
|
108
|
+
color: var(--kui-color-main);
|
|
109
|
+
border: none;
|
|
110
|
+
}
|
|
111
|
+
&.k-btn-solid {
|
|
112
|
+
color: var(--kui-color-main);
|
|
113
|
+
border-color: var(--kui-color-main);
|
|
114
|
+
&:focus {
|
|
115
|
+
border-color: var(--kui-color-main);
|
|
116
|
+
color: var(--kui-color-main);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
&.k-btn-normal {
|
|
120
|
+
color: var(--kui-color-main);
|
|
121
|
+
}
|
|
85
122
|
}
|
|
86
123
|
|
|
87
124
|
.k-btn-danger {
|
|
88
125
|
color: #fff;
|
|
89
|
-
border-color:
|
|
90
|
-
background:
|
|
126
|
+
border-color: var(--kui-color-danger);
|
|
127
|
+
background: var(--kui-color-danger);
|
|
91
128
|
&:hover {
|
|
92
129
|
opacity: .8;
|
|
93
130
|
zoom: 0%;
|
|
94
131
|
color: #fff;
|
|
95
|
-
border-color:
|
|
132
|
+
border-color: var(--kui-color-danger);
|
|
96
133
|
}
|
|
97
134
|
&:focus {
|
|
98
|
-
border-color:
|
|
135
|
+
border-color: var(--kui-color-danger);
|
|
99
136
|
color: #fff;
|
|
100
137
|
}
|
|
101
138
|
.badge-count {
|
|
102
|
-
border-color:
|
|
103
|
-
color:
|
|
139
|
+
border-color: var(--kui-color-danger);
|
|
140
|
+
color: var(--kui-color-danger);
|
|
104
141
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
border-color:
|
|
113
|
-
|
|
142
|
+
&.k-btn-light {
|
|
143
|
+
background-color: var(--kui-color-gray-80);
|
|
144
|
+
color: var(--kui-color-danger);
|
|
145
|
+
border: none;
|
|
146
|
+
}
|
|
147
|
+
&.k-btn-solid {
|
|
148
|
+
color: var(--kui-color-danger);
|
|
149
|
+
border-color: var(--kui-color-danger);
|
|
150
|
+
&, &:focus, &:hover {
|
|
151
|
+
border-color: var(--kui-color-danger);
|
|
152
|
+
color: var(--kui-color-danger);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
&.k-btn-normal {
|
|
156
|
+
color: var(--kui-color-danger);
|
|
114
157
|
}
|
|
115
158
|
}
|
|
116
159
|
|
|
117
|
-
.k-btn-
|
|
118
|
-
color:
|
|
119
|
-
border-color:
|
|
160
|
+
.k-btn-warning {
|
|
161
|
+
color: #fff;
|
|
162
|
+
border-color: var(--kui-color-warning);
|
|
163
|
+
background: var(--kui-color-warning);
|
|
164
|
+
&:hover {
|
|
165
|
+
opacity: .8;
|
|
166
|
+
zoom: 0%;
|
|
167
|
+
color: #fff;
|
|
168
|
+
border-color: var(--kui-color-warning);
|
|
169
|
+
}
|
|
120
170
|
&:focus {
|
|
121
|
-
border-color:
|
|
122
|
-
color:
|
|
171
|
+
border-color: var(--kui-color-warning);
|
|
172
|
+
color: #fff;
|
|
123
173
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
174
|
+
&.k-btn-light {
|
|
175
|
+
background-color: var(--kui-color-gray-80);
|
|
176
|
+
color: var(--kui-color-warning);
|
|
177
|
+
border: none;
|
|
178
|
+
}
|
|
179
|
+
&.k-btn-solid {
|
|
180
|
+
color: var(--kui-color-warning);
|
|
181
|
+
border-color: var(--kui-color-warning);
|
|
182
|
+
&:focus {
|
|
183
|
+
border-color: var(--kui-color-warning);
|
|
184
|
+
color: var(--kui-color-warning);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
&.k-btn-normal {
|
|
188
|
+
color: var(--kui-color-warning);
|
|
130
189
|
}
|
|
131
190
|
}
|
|
132
191
|
|
|
@@ -141,10 +200,10 @@
|
|
|
141
200
|
margin-right: 0;
|
|
142
201
|
border-radius: 0;
|
|
143
202
|
&:first-child {
|
|
144
|
-
border-radius:
|
|
203
|
+
border-radius: var(--kui-border-radius) 0 0 var(--kui-border-radius);
|
|
145
204
|
}
|
|
146
205
|
&:last-child {
|
|
147
|
-
border-radius: 0
|
|
206
|
+
border-radius: 0 var(--kui-border-radius) var(--kui-border-radius) 0;
|
|
148
207
|
}
|
|
149
208
|
}
|
|
150
209
|
}
|
|
@@ -202,25 +261,27 @@
|
|
|
202
261
|
&, &:hover, &:active, &:active, &:focus {
|
|
203
262
|
opacity: .8;
|
|
204
263
|
cursor: not-allowed;
|
|
205
|
-
color:
|
|
206
|
-
background:
|
|
207
|
-
border-color:
|
|
264
|
+
color: var(--kui-color-disable-color);
|
|
265
|
+
background: var(--kui-color-disable-back);
|
|
266
|
+
border-color: var(--kui-color-disable-border);
|
|
208
267
|
}
|
|
209
268
|
}
|
|
269
|
+
|
|
210
270
|
.k-btn-primary[disabled='disabled'] {
|
|
211
271
|
&, &:hover, &:active, &:active, &:focus {
|
|
212
272
|
opacity: .9;
|
|
213
273
|
cursor: not-allowed;
|
|
214
|
-
color:
|
|
215
|
-
// background: darken( @disable-back, 8%);
|
|
216
|
-
// border-color: darken(@disable-border, 8%);
|
|
274
|
+
color: var(--kui-color-disable-color);
|
|
217
275
|
}
|
|
218
276
|
}
|
|
219
277
|
|
|
220
278
|
.k-btn-link {
|
|
221
279
|
background: none;
|
|
222
|
-
border: none
|
|
223
|
-
color:
|
|
280
|
+
border: none;
|
|
281
|
+
color: var(--kui-color-main);
|
|
282
|
+
&:hover {
|
|
283
|
+
opacity: .8;
|
|
284
|
+
}
|
|
224
285
|
&:disabled {
|
|
225
286
|
&, &:hover, &:active, &:active, &:focus {
|
|
226
287
|
background: 0 0;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<template>
|
|
8
8
|
<div class="demo-card">
|
|
9
9
|
<Card title="卡片标题" icon="heart" :bordered="false">
|
|
10
|
-
<a slot="extra" @click="$Message.info('click')"
|
|
10
|
+
<a slot="extra" @click="$Message.info('click')">更多</a>
|
|
11
11
|
<p>card content</p>
|
|
12
12
|
<p>card content</p>
|
|
13
13
|
<p>card content</p>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<style scoped>
|
|
21
21
|
.demo-card{
|
|
22
22
|
padding:20px;
|
|
23
|
-
background-color
|
|
23
|
+
background-color:#7f7f7f26;
|
|
24
24
|
}
|
|
25
25
|
</style>
|
|
26
26
|
```
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
@import '../../styles/
|
|
1
|
+
@import '../../styles/var.less';
|
|
2
2
|
.k-card {
|
|
3
|
-
background:
|
|
3
|
+
background: var(--kui-color-back);
|
|
4
4
|
position: relative;
|
|
5
|
-
border-radius:
|
|
6
|
-
color:
|
|
5
|
+
border-radius: var(--kui-border-radius);
|
|
6
|
+
color: var(--kui-color-font);
|
|
7
7
|
.k-card-head {
|
|
8
8
|
position: relative;
|
|
9
|
-
border-bottom: 1px solid
|
|
9
|
+
border-bottom: 1px solid var(--kui-color-gray-80);
|
|
10
10
|
padding: 14px 16px;
|
|
11
11
|
line-height: 1;
|
|
12
12
|
.k-icon {
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.k-card-bordered {
|
|
44
|
-
border: 1px solid
|
|
44
|
+
border: 1px solid var(--kui-color-border);
|
|
45
45
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 组合垂直布局
|
|
3
|
+
组合垂直布局
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<p>{{data}}</p>
|
|
10
|
+
<br/>
|
|
11
|
+
<Button @click="data=[]" size="small">Clear</Button>
|
|
12
|
+
<Button @click="data=['apple']" size="small">Select apple</Button>
|
|
13
|
+
<br/>
|
|
14
|
+
<br/>
|
|
15
|
+
<CheckboxGroup v-model="data" direction="vertical">
|
|
16
|
+
<Checkbox label="Apple" value="apple" />
|
|
17
|
+
<Checkbox label="Orange" value="orange" />
|
|
18
|
+
<Checkbox label="Banana" value="banana" />
|
|
19
|
+
<Checkbox label="Grape" value="grape" disabled/>
|
|
20
|
+
<Checkbox label="Pear" value="pear" disabled/>
|
|
21
|
+
</CheckboxGroup>
|
|
22
|
+
<br/>
|
|
23
|
+
<p>{{cities}}</p>
|
|
24
|
+
<br/>
|
|
25
|
+
<CheckboxGroup :options="options" v-model="cities" direction="vertical"/>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
<script>
|
|
29
|
+
export default {
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
checked: true,
|
|
33
|
+
data: ['apple','grape'],
|
|
34
|
+
options: [
|
|
35
|
+
{ label: 'Beijing', value: 'beijing' },
|
|
36
|
+
{ label: 'Shenzhen', value: 'shenzhen' },
|
|
37
|
+
{ label: 'Shanghai', value: 'shanghai' },
|
|
38
|
+
{ label: 'Guangzhou', value: 'guangzhou' },
|
|
39
|
+
{ label: 'Wuhan', value: 'wuhan' },
|
|
40
|
+
{ label: 'Other', value: 'other',disabled:true },
|
|
41
|
+
],
|
|
42
|
+
cities:['wuhan']
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
```
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import Base from './base'
|
|
3
3
|
import Info from './info'
|
|
4
4
|
import Disabled from './disabled'
|
|
5
|
+
import Options from './options'
|
|
5
6
|
import Group from './group'
|
|
7
|
+
import GroupVertical from './group-vertical'
|
|
6
8
|
import CheckAll from './check-all'
|
|
7
9
|
import CN from '../index.md'
|
|
8
10
|
export default {
|
|
@@ -12,7 +14,9 @@ export default {
|
|
|
12
14
|
<Info class="typo" />
|
|
13
15
|
<Base />
|
|
14
16
|
<Disabled />
|
|
17
|
+
<Options />
|
|
15
18
|
<Group />
|
|
19
|
+
<GroupVertical />
|
|
16
20
|
<CheckAll />
|
|
17
21
|
<CN class="typo"/>
|
|
18
22
|
</div>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 组合使用Options
|
|
3
|
+
- 组合使用可以直接使用 `CheckboxGroup` 的 `options` 来赋值,
|
|
4
|
+
- 或者结合子组件 `Checkbox` 来组合使用,通过 `disabled` 可以设置组件是否被禁用
|
|
5
|
+
</cn>
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<RadioGroup :options="types" v-model="direction" type="button"/>
|
|
10
|
+
<br />
|
|
11
|
+
<br />
|
|
12
|
+
<CheckboxGroup
|
|
13
|
+
:options="options"
|
|
14
|
+
v-model="cities"
|
|
15
|
+
@change="change"
|
|
16
|
+
:direction="direction"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
data() {
|
|
22
|
+
return {
|
|
23
|
+
direction:'horizontal',
|
|
24
|
+
types:[
|
|
25
|
+
{ label: '垂直', value:'vertical'},
|
|
26
|
+
{ label: '水平' ,value:'horizontal'}
|
|
27
|
+
],
|
|
28
|
+
options: [
|
|
29
|
+
{ label: 'Beijing', value: 'beijing' },
|
|
30
|
+
{ label: 'Shenzhen', value: 'shenzhen' },
|
|
31
|
+
{ label: 'Shanghai', value: 'shanghai' },
|
|
32
|
+
{ label: 'Guangzhou', value: 'guangzhou' },
|
|
33
|
+
{ label: 'Wuhan', value: 'wuhan' },
|
|
34
|
+
{ label: 'Other', value: 'other',disabled:true },
|
|
35
|
+
],
|
|
36
|
+
cities:['wuhan']
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
change({value,label,checked}){
|
|
41
|
+
this.$Message.info(`Value: ${value} , Label:${label} , Checked:${checked}`)
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
```
|
|
@@ -5,6 +5,11 @@ export default {
|
|
|
5
5
|
props: {
|
|
6
6
|
disabled: Boolean,
|
|
7
7
|
options: Array,
|
|
8
|
+
direction: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: 'horizontal',
|
|
11
|
+
validator: (val) => ['horizontal', 'vertical'].indexOf(val) >= 0
|
|
12
|
+
},
|
|
8
13
|
value: { type: Array, default: () => [] },
|
|
9
14
|
},
|
|
10
15
|
provide() {
|
|
@@ -22,11 +27,12 @@ export default {
|
|
|
22
27
|
value.splice(index, 1);
|
|
23
28
|
}
|
|
24
29
|
this.$emit("input", value);
|
|
25
|
-
|
|
30
|
+
let item = Object.assign(data, { checked: index < 0 })
|
|
31
|
+
this.$emit("change", item);
|
|
26
32
|
}
|
|
27
33
|
},
|
|
28
34
|
render() {
|
|
29
|
-
const { options, $slots } = this
|
|
35
|
+
const { options, $slots, direction } = this
|
|
30
36
|
let childs = getChild($slots.default)
|
|
31
37
|
|
|
32
38
|
if (options && options.length) {
|
|
@@ -39,6 +45,6 @@ export default {
|
|
|
39
45
|
/>
|
|
40
46
|
))
|
|
41
47
|
}
|
|
42
|
-
return (<div class=
|
|
48
|
+
return (<div class={['k-checkbox-group', { 'k-checkbox-group-vertical': direction == 'vertical' }]}>{childs}</div>)
|
|
43
49
|
}
|
|
44
50
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
### API
|
|
2
2
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
-
|
|
3
|
+
| ------------- | --------------------------------------------- | ----------------- | ------ |
|
|
4
4
|
| checked | 是否选中状态,可以使用 `v-model` 双向绑定数据 | Boolean | false |
|
|
5
5
|
| label | 显示的文字 | String 、 Number | - |
|
|
6
6
|
| disabled | 是否禁用当前项 | Boolean | false |
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
| change | 在选项状态发生改变时回调 | Function(e:Event) | - |
|
|
9
9
|
| value | 组合使用时表示的值 | String、Number | - |
|
|
10
10
|
### CheckboxGroup API
|
|
11
|
-
| 属性
|
|
12
|
-
|
|
13
|
-
| value
|
|
14
|
-
| disabled
|
|
15
|
-
| change
|
|
16
|
-
|
|
|
11
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
12
|
+
| --------- | ---------------------------------------------------- | ------------------------------------------------- | ---------- |
|
|
13
|
+
| value | 用于设置当前选中的值,可以使用 `v-model` 双向绑定数据 | Array | - |
|
|
14
|
+
| disabled | 是否禁用组件 | Boolean | false |
|
|
15
|
+
| change | 在选项状态发生改变时触发,返回当前选中的项和状态 | Function({label,value,checked}) | - |
|
|
16
|
+
| direction | 布局方向,可选值 `horizontal`、`vertical` | Sting | horizontal |
|
|
17
|
+
| options | 可以指定子项 `checkbox` | Array <{label:string/number,value:string/number}> | - |
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
@import '../../styles/
|
|
1
|
+
@import '../../styles/var.less';
|
|
2
2
|
.k-checkbox-wrapper {
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
font-size: 12px;
|
|
5
5
|
display: inline-block;
|
|
6
6
|
user-select: none;
|
|
7
7
|
line-height: 1;
|
|
8
|
-
color:
|
|
8
|
+
color: var(--kui-color-font);
|
|
9
|
+
// margin-right: 16px;
|
|
9
10
|
.k-checkbox {
|
|
10
11
|
display: inline-block;
|
|
11
12
|
vertical-align: middle;
|
|
@@ -26,12 +27,12 @@
|
|
|
26
27
|
position: relative;
|
|
27
28
|
top: 0;
|
|
28
29
|
left: 0;
|
|
29
|
-
border: 1px solid
|
|
30
|
+
border: 1px solid var(--kui-color-border);
|
|
30
31
|
border-radius: 2px;
|
|
31
|
-
background-color:
|
|
32
|
+
background-color: var(--kui-color-back);
|
|
32
33
|
transition: border-color .2s ease-in-out, background-color .2s ease-in-out;
|
|
33
34
|
overflow: hidden;
|
|
34
|
-
color:
|
|
35
|
+
color: var(--kui-color-back);
|
|
35
36
|
.k-icon {
|
|
36
37
|
font-size: 18px;
|
|
37
38
|
position: absolute;
|
|
@@ -53,19 +54,19 @@
|
|
|
53
54
|
opacity: 0;
|
|
54
55
|
&:focus {
|
|
55
56
|
+.k-checkbox-inner {
|
|
56
|
-
border: 1px solid
|
|
57
|
-
box-shadow: 0 0 5px
|
|
57
|
+
border: 1px solid var(--kui-color-main);
|
|
58
|
+
box-shadow: 0 0 5px var(--kui-color-main-30);
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
.k-checkbox-indeterminate {
|
|
62
63
|
.k-checkbox-inner {
|
|
63
|
-
// background:
|
|
64
|
-
// border-color:
|
|
64
|
+
// background: var(--kui-color-main);
|
|
65
|
+
// border-color: var(--kui-color-main);
|
|
65
66
|
position: relative;
|
|
66
67
|
&:after {
|
|
67
68
|
box-sizing: content-box;
|
|
68
|
-
background-color:
|
|
69
|
+
background-color: var(--kui-color-main);
|
|
69
70
|
position: absolute;
|
|
70
71
|
width: 8px;
|
|
71
72
|
height: 8px;
|
|
@@ -79,43 +80,56 @@
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
&:hover .k-checkbox-inner {
|
|
82
|
-
border-color:
|
|
83
|
+
border-color: var(--kui-color-main);
|
|
83
84
|
}
|
|
84
85
|
.k-checkbox-label {
|
|
85
|
-
padding:
|
|
86
|
+
padding-left: 8px;
|
|
86
87
|
vertical-align: middle;
|
|
88
|
+
font-size: 14px;
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
.k-checkbox-checked {
|
|
91
93
|
.k-checkbox-inner {
|
|
92
|
-
background:
|
|
93
|
-
border-color:
|
|
94
|
+
background: var(--kui-color-main);
|
|
95
|
+
border-color: var(--kui-color-main);
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
.k-checkbox-disabled {
|
|
98
100
|
cursor: not-allowed;
|
|
99
|
-
color:
|
|
101
|
+
color: var(--kui-color-disable-color);
|
|
100
102
|
.k-checkbox {
|
|
101
103
|
.k-checkbox-input {
|
|
102
104
|
cursor: not-allowed;
|
|
103
105
|
}
|
|
104
106
|
.k-checkbox-inner {
|
|
105
|
-
background:
|
|
106
|
-
border-color:
|
|
107
|
-
color:
|
|
107
|
+
background: var(--kui-color-disable-back);
|
|
108
|
+
border-color: var(--kui-color-disable-border);
|
|
109
|
+
color: var(--kui-color-disable-color);
|
|
108
110
|
&:after {
|
|
109
|
-
background-color:
|
|
110
|
-
color:
|
|
111
|
+
background-color: var(--kui-color-disable-back);
|
|
112
|
+
color: var(--kui-color-disable-color);
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
.k-checkbox-indeterminate .k-checkbox-inner:after {
|
|
115
|
-
background-color:
|
|
117
|
+
background-color: var(--kui-color-disable-border);
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
.k-checkbox-group {
|
|
120
122
|
display: inline-block;
|
|
123
|
+
.k-checkbox-wrapper {
|
|
124
|
+
margin-right: 16px;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.k-checkbox-group-vertical {
|
|
129
|
+
display: block;
|
|
130
|
+
.k-checkbox-wrapper {
|
|
131
|
+
display: block;
|
|
132
|
+
margin-right: 0;
|
|
133
|
+
margin-bottom: 16px;
|
|
134
|
+
}
|
|
121
135
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
@import '../../styles/
|
|
1
|
+
@import '../../styles/var.less';
|
|
2
2
|
.k-collapse {
|
|
3
|
-
background-color:
|
|
4
|
-
border: 1px solid
|
|
5
|
-
border-radius:
|
|
3
|
+
background-color: var(--kui-color-back);
|
|
4
|
+
border: 1px solid var(--kui-color-border);
|
|
5
|
+
border-radius: var(--kui-border-radius);
|
|
6
6
|
border-bottom: 0;
|
|
7
7
|
overflow: hidden;
|
|
8
|
-
color:
|
|
8
|
+
color: var(--kui-color-font);
|
|
9
9
|
&>.k-collapse-item {
|
|
10
|
-
border-bottom: 1px solid
|
|
10
|
+
border-bottom: 1px solid var(--kui-color-border);
|
|
11
11
|
&>.k-collapse-header {
|
|
12
12
|
line-height: 22px;
|
|
13
13
|
padding: 12px 16px 12px 40px;
|
|
14
14
|
cursor: pointer;
|
|
15
15
|
position: relative;
|
|
16
|
-
color:
|
|
16
|
+
color: var(--kui-color-title);
|
|
17
17
|
font-size: 14px;
|
|
18
18
|
&>.k-collapse-arrow {
|
|
19
19
|
position: absolute;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
.k-collapse-content {
|
|
33
33
|
// background-color: #fff;
|
|
34
|
-
border-top: 1px solid
|
|
34
|
+
border-top: 1px solid var(--kui-color-border);
|
|
35
35
|
padding: 0 16px;
|
|
36
36
|
transition: all .3s ease-in-out;
|
|
37
37
|
box-sizing: border-box;
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
border: none;
|
|
53
53
|
background: none;
|
|
54
54
|
.k-collapse-item {
|
|
55
|
-
background:
|
|
55
|
+
background: var(--kui-color-gray-90);
|
|
56
56
|
border: none;
|
|
57
57
|
margin-bottom: 10px;
|
|
58
|
-
border-radius:
|
|
58
|
+
border-radius: var(--kui-border-radius);
|
|
59
59
|
overflow: hidden;
|
|
60
60
|
.k-collapse-content {
|
|
61
61
|
border: none;
|