kui-vue 3.3.0 → 3.3.1
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/demo/callbacks.md +25 -0
- package/components/affix/demo/index.vue +2 -2
- package/components/avatar/demo/change.md +7 -8
- package/components/avatar/demo/index.vue +9 -2
- package/components/avatar/demo/types.md +4 -4
- package/components/badge/demo/color.md +1 -1
- package/components/badge/demo/dot.md +1 -1
- package/components/badge/demo/index.vue +8 -8
- package/components/base/input.jsx +2 -1
- package/components/breadcrumb/demo/icon.md +1 -1
- package/components/breadcrumb/demo/index.vue +4 -4
- package/components/breadcrumb/demo/separator.md +5 -7
- package/components/breadcrumb/styles/index.less +12 -0
- package/components/button/demo/index.vue +7 -7
- package/components/button/demo/normal.md +2 -2
- package/components/button/demo/size.md +1 -1
- package/components/button/styles/index.less +145 -44
- package/components/card/demo/index.vue +3 -3
- package/components/carousel/demo/index.vue +1 -1
- package/components/checkbox/demo/disabled.md +15 -10
- package/components/checkbox/demo/index.vue +16 -9
- package/components/collapse/demo/index.vue +6 -6
- package/components/colorPicker/colorpicker.jsx +1 -0
- package/components/colorPicker/demo/index.vue +2 -2
- package/components/colorPicker/styles/index.less +293 -240
- package/components/datePicker/demo/index.vue +1 -1
- package/components/datePicker/styles/datepicker.less +1 -0
- package/components/descriptions/demo/index.vue +2 -2
- package/components/divider/demo/index.vue +4 -4
- package/components/drawer/demo/form.md +0 -26
- package/components/drawer/demo/index.vue +16 -8
- package/components/dropdown/demo/base.md +2 -2
- package/components/dropdown/demo/index.vue +12 -3
- package/components/dropdown/demo/placement.md +0 -8
- package/components/empty/demo/custom.md +2 -2
- package/components/empty/demo/index.vue +5 -5
- package/components/form/styles/index.less +39 -4
- package/components/icon/demo/index.vue +3 -3
- package/components/image/demo/base.md +1 -1
- package/components/image/demo/errors.md +2 -2
- package/components/image/demo/extra.md +3 -3
- package/components/image/demo/extra_globle.md +3 -3
- package/components/image/demo/globle.md +4 -4
- package/components/image/demo/group.md +2 -2
- package/components/image/demo/index.vue +8 -8
- package/components/image/demo/origin.md +2 -2
- package/components/image/preview.jsx +13 -6
- package/components/image/styles/index.less +5 -2
- package/components/input/demo/index.vue +9 -9
- package/components/input/styles/index.less +21 -8
- package/components/input/textarea.jsx +5 -0
- package/components/inputNumber/demo/index.vue +6 -6
- package/components/inputNumber/styles/index.less +1 -1
- package/components/layout/styles/index.less +5 -1
- package/components/loading/demo/index.vue +10 -3
- package/components/locale/index.js +1 -1
- package/components/menu/styles/dropmenu.less +19 -1
- package/components/menu/styles/index.less +156 -19
- package/components/message/demo/index.vue +16 -7
- package/components/modal/demo/base.md +3 -1
- package/components/modal/demo/confrim.md +3 -2
- package/components/modal/demo/index.vue +17 -8
- package/components/modal/index.js +6 -5
- package/components/modal/modal.jsx +1 -1
- package/components/modal/styles/index.less +18 -14
- package/components/notice/demo/index.vue +16 -7
- package/components/notice/styles/index.less +1 -0
- package/components/page/demo/index.vue +6 -6
- package/components/page/styles/index.less +10 -3
- package/components/popconfirm/demo/index.vue +1 -1
- package/components/popconfirm/styles/index.less +1 -1
- package/components/poptip/demo/index.vue +1 -1
- package/components/poptip/styles/index.less +197 -170
- package/components/progress/demo/index.vue +1 -1
- package/components/radio/demo/index.vue +9 -10
- package/components/radio/styles/index.less +1 -1
- package/components/rate/demo/index.vue +9 -9
- package/components/select/demo/index.vue +10 -10
- package/components/skeleton/demo/custom.md +1 -1
- package/components/skeleton/demo/index.vue +1 -1
- package/components/slider/demo/index.vue +8 -8
- package/components/slider/styles/index.less +5 -1
- package/components/slider/thumb.jsx +25 -7
- package/components/space/demo/index.vue +8 -8
- package/components/spin/demo/base.md +3 -1
- package/components/spin/demo/index.vue +5 -5
- package/components/spin/spin.jsx +8 -1
- package/components/spin/styles/index.less +18 -4
- package/components/styles/color.less +18 -2
- package/components/styles/var.less +26 -4
- package/components/switch/demo/index.vue +8 -8
- package/components/switch/styles/index.less +28 -1
- package/components/table/demo/base.md +1 -1
- package/components/table/demo/fixed-head.md +3 -1
- package/components/table/demo/index.vue +19 -21
- package/components/table/extend.jsx +41 -23
- package/components/table/index.md +1 -0
- package/components/table/styles/index.less +10 -1
- package/components/table/table.jsx +3 -3
- package/components/tabs/demo/index.vue +10 -10
- package/components/tag/demo/index.vue +4 -4
- package/components/timeline/demo/index.vue +4 -4
- package/components/tooltip/demo/index.vue +1 -1
- package/components/tooltip/styles/index.less +1 -1
- package/components/tree/demo/index.vue +1 -1
- package/components/upload/demo/index.vue +12 -12
- package/components/upload/demo/picture.md +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.js +2 -2
- package/dist/locale/de.js +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/ua.js +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/zhCN.js +1 -1
- package/dist/locale/zhTW.js +1 -1
- package/package.json +17 -20
- package/readme.md +2 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Info from "./info";
|
|
3
|
-
import Base from "./base";
|
|
4
|
-
import Container from "./container";
|
|
5
|
-
import Mode from "./mode";
|
|
2
|
+
import Info from "./info.md";
|
|
3
|
+
import Base from "./base.md";
|
|
4
|
+
import Container from "./container.md";
|
|
5
|
+
import Mode from "./mode.md";
|
|
6
6
|
|
|
7
7
|
import CN from "../index.md";
|
|
8
8
|
export default {
|
|
9
9
|
render() {
|
|
10
10
|
return (
|
|
11
|
-
<div class="
|
|
11
|
+
<div class="demo-spin">
|
|
12
12
|
<Info class="typo" />
|
|
13
13
|
<Base />
|
|
14
14
|
<Container />
|
package/components/spin/spin.jsx
CHANGED
|
@@ -3,6 +3,11 @@ export default {
|
|
|
3
3
|
props: {
|
|
4
4
|
value: { type: Boolean, default: true },
|
|
5
5
|
delay: { type: Number, default: 500 },
|
|
6
|
+
size: {
|
|
7
|
+
type: String, default: 'default', validator(value) {
|
|
8
|
+
return ["large", "default", "small"].indexOf(value) >= 0;
|
|
9
|
+
}
|
|
10
|
+
},
|
|
6
11
|
mode: {
|
|
7
12
|
type: String, default: 'rotate', validator(value) {
|
|
8
13
|
return ["bounce", "flip", "rotate", "zoom"].indexOf(value) >= 0;
|
|
@@ -27,9 +32,11 @@ export default {
|
|
|
27
32
|
}
|
|
28
33
|
},
|
|
29
34
|
render() {
|
|
30
|
-
let { mode, spinning, $slots } = this
|
|
35
|
+
let { mode, spinning, $slots, size } = this
|
|
31
36
|
const classes = [{
|
|
32
37
|
[`k-spin-loading`]: spinning,
|
|
38
|
+
[`k-spin-lg`]: size == 'large',
|
|
39
|
+
[`k-spin-sm`]: size == 'small',
|
|
33
40
|
[`k-spin-${mode}`]: mode && spinning,
|
|
34
41
|
}]
|
|
35
42
|
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
}
|
|
69
69
|
&-rotate {
|
|
70
70
|
&::before, &::after {
|
|
71
|
-
border:
|
|
71
|
+
border: 4px solid var(--kui-color-main-90);
|
|
72
72
|
border-radius: 50%;
|
|
73
73
|
content: '';
|
|
74
|
-
width:
|
|
75
|
-
height:
|
|
74
|
+
width: 30px;
|
|
75
|
+
height: 30px;
|
|
76
76
|
position: absolute;
|
|
77
77
|
top: 50%;
|
|
78
78
|
left: 50%;
|
|
@@ -80,12 +80,26 @@
|
|
|
80
80
|
margin-top: -20px;
|
|
81
81
|
}
|
|
82
82
|
&::after {
|
|
83
|
-
border:
|
|
83
|
+
border: 4px solid transparent;
|
|
84
84
|
border-top-color: var(--kui-color-main);
|
|
85
85
|
animation: k-spin-animate-rotate 1s infinite linear;
|
|
86
86
|
box-sizing: content-box;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
+
&-lg{
|
|
90
|
+
&::before, &::after {
|
|
91
|
+
border-width: 5px;
|
|
92
|
+
width: 40px;
|
|
93
|
+
height: 40px;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
&-sm{
|
|
97
|
+
&::before, &::after {
|
|
98
|
+
border-width: 3px;
|
|
99
|
+
width: 20px;
|
|
100
|
+
height: 20px;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
89
103
|
}
|
|
90
104
|
|
|
91
105
|
@keyframes k-spin-animate-flip {
|
|
@@ -2,23 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
//颜色
|
|
4
4
|
@main: #3a95ff; //主体色
|
|
5
|
+
@main-hover: darken(@main,10%);
|
|
6
|
+
@main-actived: darken(@main,25%);
|
|
5
7
|
@main-10: fadeout(@main,10%);
|
|
6
8
|
@main-30: fadeout(@main,30%);
|
|
7
9
|
@main-60: fadeout(@main,60%);
|
|
8
10
|
@main-80: fadeout(@main,80%);
|
|
9
11
|
@main-90: fadeout(@main,90%);
|
|
10
12
|
@success: #00bb5d; //成功
|
|
13
|
+
@success-hover: darken(@success,10%);
|
|
14
|
+
@success-actived: darken(@success,25%);
|
|
11
15
|
@success-30: fadeout(@success,30%);
|
|
12
16
|
@success-60: fadeout(@success,60%);
|
|
13
17
|
@success-80: fadeout(@success,80%);
|
|
14
18
|
@success-90: fadeout(@success,90%);
|
|
15
19
|
@danger: #ff3300;
|
|
20
|
+
@danger-hover: darken(@danger,10%);
|
|
21
|
+
@danger-actived: darken(@danger,25%);
|
|
16
22
|
@danger-30: fadeout(@danger,30%);
|
|
17
23
|
@danger-60: fadeout(@danger,60%);
|
|
18
24
|
@danger-80: fadeout(@danger,80%);
|
|
19
25
|
@danger-90: fadeout(@danger,90%);
|
|
20
26
|
@dark-danger: darken(#ff3300,20%);
|
|
21
27
|
@warning: #ffa500;
|
|
28
|
+
@warning-hover: darken(@warning,10%);
|
|
29
|
+
@warning-actived: darken(@warning,25%);
|
|
22
30
|
@warning-30: fadeout(@warning,30%);
|
|
23
31
|
@warning-60: fadeout(@warning,60%);
|
|
24
32
|
@warning-80: fadeout(@warning,80%);
|
|
@@ -104,7 +112,10 @@
|
|
|
104
112
|
|
|
105
113
|
@gray: #969696;
|
|
106
114
|
@gray-30: fadeout(@gray,30%);
|
|
115
|
+
@gray-40: fadeout(@gray,40%);
|
|
116
|
+
@gray-50: fadeout(@gray,50%);
|
|
107
117
|
@gray-60: fadeout(@gray,60%);
|
|
118
|
+
@gray-70: fadeout(@gray,70%);
|
|
108
119
|
@gray-80: fadeout(@gray,80%);
|
|
109
120
|
@gray-90: fadeout(@gray,90%);
|
|
110
121
|
|
|
@@ -130,7 +141,9 @@
|
|
|
130
141
|
@back-color: #fff; //组件背景
|
|
131
142
|
@back-color-10: #fff;
|
|
132
143
|
@back-color-30: darken(#fff,30%);
|
|
144
|
+
@back-color-50: darken(#fff,50%);
|
|
133
145
|
@back-color-60: darken(#fff,60%);
|
|
146
|
+
@back-color-70: darken(#fff,70%);
|
|
134
147
|
@back-color-80: darken(#fff,80%);
|
|
135
148
|
@back-color-90: darken(#fff,90%);
|
|
136
149
|
|
|
@@ -141,13 +154,16 @@
|
|
|
141
154
|
@dark-back-color-10: lighten(#1f1f1f,10%);
|
|
142
155
|
@dark-back-color-30: lighten(#1f1f1f,30%);
|
|
143
156
|
@dark-back-color-60: lighten(#1f1f1f,60%);
|
|
157
|
+
@dark-back-color-70: lighten(#1f1f1f,70%);
|
|
158
|
+
@dark-back-color-80: lighten(#1f1f1f,80%);
|
|
144
159
|
@dark-back-color-90: lighten(#1f1f1f,90%);
|
|
145
160
|
|
|
146
161
|
@icon-color: rgba(0, 0, 0, .4); //图标颜色
|
|
147
162
|
@dark-icon-color: rgba(255, 255, 255, .4);
|
|
148
163
|
|
|
149
|
-
@hover-color:fadeout(@main,
|
|
150
|
-
@
|
|
164
|
+
@hover-color:fadeout(@main, 90%); //item 的 hover 颜色
|
|
165
|
+
@actived-color:fadeout(@main, 80%); //item 的 hover 颜色
|
|
166
|
+
@selected-color:fadeout(@main, 75%); //item 的 selected 颜色
|
|
151
167
|
|
|
152
168
|
@border-color: rgba(216, 216, 216, 0.5); //边框颜色
|
|
153
169
|
@dark-border-color: rgba(83, 83, 83, 0.5);
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
@import './color.less';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
html,
|
|
4
|
+
*[theme-mode=light],
|
|
5
|
+
*[theme-mode=light] {
|
|
6
|
+
color-scheme: light;
|
|
3
7
|
--kui-border-radius: @radius;
|
|
4
8
|
--kui-color-main: @main;
|
|
9
|
+
--kui-color-main-hover: @main-hover;
|
|
10
|
+
--kui-color-main-actived: @main-actived;
|
|
5
11
|
--kui-color-main-10: @main-10;
|
|
6
12
|
--kui-color-main-30: @main-30;
|
|
7
13
|
--kui-color-main-60: @main-60;
|
|
8
14
|
--kui-color-main-80: @main-80;
|
|
9
15
|
--kui-color-main-90: @main-90;
|
|
10
16
|
--kui-color-success: @success;
|
|
17
|
+
--kui-color-success-hover: @success-hover;
|
|
18
|
+
--kui-color-success-actived: @success-actived;
|
|
11
19
|
--kui-color-success-30: @success-30;
|
|
12
20
|
--kui-color-success-60: @success-60;
|
|
13
21
|
--kui-color-success-80: @success-80;
|
|
14
22
|
--kui-color-success-90: @success-90;
|
|
15
23
|
--kui-color-danger: @danger;
|
|
24
|
+
--kui-color-danger-hover: @danger-hover;
|
|
25
|
+
--kui-color-danger-actived: @danger-actived;
|
|
16
26
|
--kui-color-danger-30: @danger-30;
|
|
17
27
|
--kui-color-danger-60: @danger-60;
|
|
18
28
|
--kui-color-danger-80: @danger-80;
|
|
19
29
|
--kui-color-danger-90: @danger-90;
|
|
20
30
|
--kui-color-warning: @warning;
|
|
31
|
+
--kui-color-warning-hover: @warning-hover;
|
|
32
|
+
--kui-color-warning-actived: @warning-actived;
|
|
21
33
|
--kui-color-warning-30: @warning-30;
|
|
22
34
|
--kui-color-warning-60: @warning-60;
|
|
23
35
|
--kui-color-warning-80: @warning-80;
|
|
@@ -89,7 +101,10 @@ body, *[theme-mode=light], *[theme-mode=light] {
|
|
|
89
101
|
--kui-color-lime-90: @lime-90;
|
|
90
102
|
--kui-color-gray: @gray;
|
|
91
103
|
--kui-color-gray-30: @gray-30;
|
|
104
|
+
--kui-color-gray-40: @gray-40;
|
|
105
|
+
--kui-color-gray-50: @gray-50;
|
|
92
106
|
--kui-color-gray-60: @gray-60;
|
|
107
|
+
--kui-color-gray-70: @gray-70;
|
|
93
108
|
--kui-color-gray-80: @gray-80;
|
|
94
109
|
--kui-color-gray-90: @gray-90;
|
|
95
110
|
--kui-color-dark: @dark;
|
|
@@ -105,10 +120,14 @@ body, *[theme-mode=light], *[theme-mode=light] {
|
|
|
105
120
|
--kui-color-back: @back-color;
|
|
106
121
|
--kui-color-control-10: @back-color-10;
|
|
107
122
|
--kui-color-control-30: @back-color-30;
|
|
123
|
+
--kui-color-control-50: @back-color-50;
|
|
108
124
|
--kui-color-control-60: @back-color-60;
|
|
125
|
+
--kui-color-control-70: @back-color-70;
|
|
126
|
+
--kui-color-control-80: @back-color-80;
|
|
109
127
|
--kui-color-control-90: @back-color-90;
|
|
110
128
|
--kui-color-icon: @icon-color;
|
|
111
129
|
--kui-color-hover: @hover-color;
|
|
130
|
+
--kui-color-actived: @actived-color;
|
|
112
131
|
--kui-color-selected: @selected-color;
|
|
113
132
|
--kui-color-border: @border-color;
|
|
114
133
|
--kui-color-disable-border: @disable-border;
|
|
@@ -118,10 +137,13 @@ body, *[theme-mode=light], *[theme-mode=light] {
|
|
|
118
137
|
--kui-color-table-border: #f0f0f0;
|
|
119
138
|
--kui-color-table-hover: #fafafa;
|
|
120
139
|
--kui-color-table-header-hover: #f1f1f1;
|
|
121
|
-
--kui-color-shadow:rgba(0, 0, 0, .15);
|
|
140
|
+
--kui-color-shadow: rgba(0, 0, 0, .15);
|
|
122
141
|
}
|
|
123
142
|
|
|
124
|
-
|
|
143
|
+
[theme-mode=dark],
|
|
144
|
+
html[theme-mode=dark],
|
|
145
|
+
*[theme-mode=dark] {
|
|
146
|
+
color-scheme: dark;
|
|
125
147
|
--kui-color-font: @dark-font-color;
|
|
126
148
|
--kui-color-title: @dark-title-color;
|
|
127
149
|
--kui-color-sub-title: @dark-sub-title-color;
|
|
@@ -140,5 +162,5 @@ body[theme-mode=dark], *[theme-mode=dark] {
|
|
|
140
162
|
--kui-color-table-border: #303030;
|
|
141
163
|
--kui-color-table-hover: #262626;
|
|
142
164
|
--kui-color-table-header-hover: #303030;
|
|
143
|
-
--kui-color-shadow:rgba(0, 0, 0, .65);
|
|
165
|
+
--kui-color-shadow: rgba(0, 0, 0, .65);
|
|
144
166
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Base from './base'
|
|
3
|
-
import Info from './info'
|
|
4
|
-
import Text from './text'
|
|
5
|
-
import Disabled from './disabled'
|
|
6
|
-
import Size from './size'
|
|
7
|
-
import Loading from './loading'
|
|
2
|
+
import Base from './base.md'
|
|
3
|
+
import Info from './info.md'
|
|
4
|
+
import Text from './text.md'
|
|
5
|
+
import Disabled from './disabled.md'
|
|
6
|
+
import Size from './size.md'
|
|
7
|
+
import Loading from './loading.md'
|
|
8
8
|
import CN from '../index.md'
|
|
9
9
|
export default {
|
|
10
10
|
render() {
|
|
11
11
|
return (
|
|
12
|
-
<div class="switch
|
|
12
|
+
<div class="demo-switch">
|
|
13
13
|
<Info class="typo" />
|
|
14
14
|
<Base />
|
|
15
15
|
<Text />
|
|
@@ -24,7 +24,7 @@ export default {
|
|
|
24
24
|
|
|
25
25
|
</script>
|
|
26
26
|
<style lang="less">
|
|
27
|
-
.switch
|
|
27
|
+
.demo-switch .k-switch {
|
|
28
28
|
margin: 0 10px 10px 0;
|
|
29
29
|
}
|
|
30
30
|
</style>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import '../../styles/var.less';
|
|
2
|
+
|
|
2
3
|
.k-switch {
|
|
3
4
|
min-width: 44px;
|
|
4
5
|
height: 24px;
|
|
@@ -20,13 +21,16 @@
|
|
|
20
21
|
overflow: hidden;
|
|
21
22
|
outline: none;
|
|
22
23
|
color: var(--kui-color-font);
|
|
24
|
+
|
|
23
25
|
&:focus {
|
|
24
26
|
// border: 1px solid var(--kui-color-main);
|
|
25
27
|
// box-shadow: 0 0 5px var(--kui-color-main-30);
|
|
26
28
|
}
|
|
29
|
+
|
|
27
30
|
.k-icon {
|
|
28
31
|
font-size: 16px;
|
|
29
32
|
}
|
|
33
|
+
|
|
30
34
|
&::before {
|
|
31
35
|
content: '';
|
|
32
36
|
width: 18px;
|
|
@@ -41,6 +45,7 @@
|
|
|
41
45
|
transition: all .36s cubic-bezier(.78, .14, .15, .86);
|
|
42
46
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.3);
|
|
43
47
|
}
|
|
48
|
+
|
|
44
49
|
.k-switch-inner {
|
|
45
50
|
color: var(--kui-color-gray-70);
|
|
46
51
|
margin-left: 25px;
|
|
@@ -48,11 +53,13 @@
|
|
|
48
53
|
display: flex;
|
|
49
54
|
line-height: 22px;
|
|
50
55
|
}
|
|
56
|
+
|
|
51
57
|
&:active:not(&:disabled) {
|
|
52
58
|
&::before {
|
|
53
59
|
width: 22px;
|
|
54
60
|
}
|
|
55
61
|
}
|
|
62
|
+
|
|
56
63
|
.k-switch-loading {
|
|
57
64
|
color: #000; //var(--kui-color-main);
|
|
58
65
|
position: absolute;
|
|
@@ -65,32 +72,38 @@
|
|
|
65
72
|
.k-switch-sm {
|
|
66
73
|
min-width: 28px;
|
|
67
74
|
height: 16px;
|
|
75
|
+
|
|
68
76
|
&::before {
|
|
69
77
|
width: 12px;
|
|
70
78
|
height: 12px;
|
|
71
79
|
border-radius: 12px;
|
|
72
80
|
left: 2px;
|
|
73
81
|
}
|
|
82
|
+
|
|
74
83
|
&:active {
|
|
75
84
|
&::before {
|
|
76
85
|
width: 15px;
|
|
77
86
|
}
|
|
78
87
|
}
|
|
88
|
+
|
|
79
89
|
&:active:not(&:disabled) {
|
|
80
90
|
&::before {
|
|
81
91
|
width: 15px;
|
|
82
92
|
}
|
|
83
93
|
}
|
|
94
|
+
|
|
84
95
|
.k-switch-loading {
|
|
85
96
|
left: 3px;
|
|
86
97
|
font-size: 10px;
|
|
87
98
|
margin-top: -5px;
|
|
88
99
|
// top: 3px;
|
|
89
100
|
}
|
|
101
|
+
|
|
90
102
|
&.k-switch-checked {
|
|
91
103
|
&::before {
|
|
92
104
|
margin-left: -2px;
|
|
93
105
|
}
|
|
106
|
+
|
|
94
107
|
.k-switch-loading {
|
|
95
108
|
right: 3px;
|
|
96
109
|
left: auto;
|
|
@@ -101,26 +114,40 @@
|
|
|
101
114
|
.k-switch-checked {
|
|
102
115
|
background: var(--kui-color-main);
|
|
103
116
|
border-color: var(--kui-color-main);
|
|
117
|
+
|
|
104
118
|
&::before {
|
|
105
119
|
left: 100%;
|
|
106
120
|
transform: translate3d(-100%, -50%, 0);
|
|
107
121
|
margin-left: -3px;
|
|
108
122
|
}
|
|
123
|
+
|
|
109
124
|
.k-switch-inner {
|
|
110
125
|
margin-left: 8px;
|
|
111
126
|
margin-right: 25px;
|
|
112
|
-
color
|
|
127
|
+
color:#fff;
|
|
113
128
|
}
|
|
129
|
+
|
|
114
130
|
.k-switch-loading {
|
|
115
131
|
// margin-left: -3px;
|
|
116
132
|
left: auto;
|
|
117
133
|
right: 4px;
|
|
118
134
|
}
|
|
135
|
+
|
|
136
|
+
&:hover,
|
|
137
|
+
&:focus {
|
|
138
|
+
border-color: var(--kui-color-main-hover);
|
|
139
|
+
background: var(--kui-color-main-hover);
|
|
140
|
+
}
|
|
141
|
+
&:active {
|
|
142
|
+
border-color: var(--kui-color-main-actived);
|
|
143
|
+
background: var(--kui-color-main-actived);
|
|
144
|
+
}
|
|
119
145
|
}
|
|
120
146
|
|
|
121
147
|
.k-switch-disabled {
|
|
122
148
|
opacity: .6;
|
|
123
149
|
cursor: not-allowed;
|
|
150
|
+
|
|
124
151
|
.k-switch-loading {
|
|
125
152
|
color: #000;
|
|
126
153
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<Table :data="data" :columns="columns" @row-click="test">
|
|
8
|
+
<Table :data="data" :columns="columns" @row-click="test" :sticky="52">
|
|
9
9
|
<template v-slot:tags="value">
|
|
10
10
|
<Tag v-for="tag in value" :key="tag" :color="tag=='Python'?'red':'orange'">{{tag}}</Tag>
|
|
11
11
|
</template>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<cn>
|
|
2
2
|
#### 固定表头
|
|
3
3
|
方便一页内展示大量数据。指定 `Table` 的高度 `height` 和 `column ` 的宽度(不指定默认150)。
|
|
4
|
+
`sticky` 为 `true`, 表示全局吸顶,为 `number` 时,表示全局吸顶的距离
|
|
5
|
+
> 表头全局吸顶,依赖 sticky 属性,当父级style 存在 `overflow` 属性,吸顶会失效
|
|
4
6
|
</cn>
|
|
5
7
|
|
|
6
8
|
```vue
|
|
7
9
|
<template>
|
|
8
|
-
<Table :data="data" :columns="columns" :height="300"/>
|
|
10
|
+
<Table :data="data" :columns="columns" :height="300" :sticky="52"/>
|
|
9
11
|
</template>
|
|
10
12
|
<script>
|
|
11
13
|
export default{
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Base from './base'
|
|
3
|
-
import BaseRender from './base-render'
|
|
4
|
-
import CustomHeader from './custom-header'
|
|
5
|
-
import Info from './info'
|
|
6
|
-
import Ellipsis from './ellipsis'
|
|
7
|
-
import Filter from './filter'
|
|
8
|
-
import Bordered from './bordered'
|
|
9
|
-
import Span from './span'
|
|
10
|
-
import Edit from './edit'
|
|
11
|
-
import FixedHead from './fixed-head'
|
|
12
|
-
import FixedCol from './fixed-col'
|
|
13
|
-
import Fixed from './fixed'
|
|
14
|
-
import FixedSpan from './fixedspan'
|
|
15
|
-
import Selection from './selection'
|
|
16
|
-
import Expand from './expand'
|
|
17
|
-
import Embed from './embed'
|
|
18
|
-
import Size from './size'
|
|
2
|
+
import Base from './base.md'
|
|
3
|
+
import BaseRender from './base-render.md'
|
|
4
|
+
import CustomHeader from './custom-header.md'
|
|
5
|
+
import Info from './info.md'
|
|
6
|
+
import Ellipsis from './ellipsis.md'
|
|
7
|
+
import Filter from './filter.md'
|
|
8
|
+
import Bordered from './bordered.md'
|
|
9
|
+
import Span from './span.md'
|
|
10
|
+
import Edit from './edit.md'
|
|
11
|
+
import FixedHead from './fixed-head.md'
|
|
12
|
+
import FixedCol from './fixed-col.md'
|
|
13
|
+
import Fixed from './fixed.md'
|
|
14
|
+
import FixedSpan from './fixedspan.md'
|
|
15
|
+
import Selection from './selection.md'
|
|
16
|
+
import Expand from './expand.md'
|
|
17
|
+
import Embed from './embed.md'
|
|
18
|
+
import Size from './size.md'
|
|
19
19
|
import CN from '../index.md'
|
|
20
20
|
export default {
|
|
21
21
|
render() {
|
|
22
22
|
return (
|
|
23
|
-
<div class="
|
|
23
|
+
<div class="demo-table">
|
|
24
24
|
<Info class="typo" />
|
|
25
25
|
<Base />
|
|
26
26
|
<BaseRender />
|
|
@@ -43,6 +43,4 @@ export default {
|
|
|
43
43
|
)
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
</script>
|
|
48
|
-
|
|
46
|
+
</script>
|
|
@@ -14,6 +14,7 @@ export default {
|
|
|
14
14
|
width: Number,
|
|
15
15
|
hasExpand: Boolean,
|
|
16
16
|
indeterminate: Boolean,
|
|
17
|
+
sticky: [Boolean, Number],
|
|
17
18
|
checkAll: Boolean,
|
|
18
19
|
},
|
|
19
20
|
data() {
|
|
@@ -69,7 +70,7 @@ export default {
|
|
|
69
70
|
}
|
|
70
71
|
},
|
|
71
72
|
renderCol(hasHead) {
|
|
72
|
-
const isFixedHeader = this.height
|
|
73
|
+
const isFixedHeader = this.height !== undefined
|
|
73
74
|
let cols = []
|
|
74
75
|
let columns = this.columns2 || this.columns
|
|
75
76
|
columns.forEach((col, i) => {
|
|
@@ -217,8 +218,14 @@ export default {
|
|
|
217
218
|
if (!head.length) {
|
|
218
219
|
head.push(<tr>{ths}</tr>)
|
|
219
220
|
}
|
|
220
|
-
|
|
221
|
-
|
|
221
|
+
let props = { style: {} }
|
|
222
|
+
if (!this.height && this.sticky) {
|
|
223
|
+
props.class = 'k-table-thead-sticky'
|
|
224
|
+
if (this.sticky > 0) {
|
|
225
|
+
props.style.top = this.sticky + 'px'
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return <thead ref="head" {...props}>{head}</thead>
|
|
222
229
|
},
|
|
223
230
|
renderTable(hasHead, body) {
|
|
224
231
|
let props = {}
|
|
@@ -240,20 +247,20 @@ export default {
|
|
|
240
247
|
scrollLeft = Math.round(scrollLeft);
|
|
241
248
|
// console.log(e, target)
|
|
242
249
|
if (target) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
250
|
+
if (target == 'tbody') {
|
|
251
|
+
if (!this.theadSync) {
|
|
252
|
+
this.theadSync = true
|
|
253
|
+
this.$refs[target].scrollLeft = scrollLeft
|
|
254
|
+
}
|
|
255
|
+
this.theadSync = false
|
|
256
|
+
}
|
|
257
|
+
if (target == 'thead') {
|
|
258
|
+
if (!this.tbodySync) {
|
|
259
|
+
this.tbodySync = true
|
|
246
260
|
this.$refs[target].scrollLeft = scrollLeft
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
// if (target == 'thead') {
|
|
251
|
-
// if (!this.tbodySync) {
|
|
252
|
-
// this.tbodySync = true
|
|
253
|
-
// this.$refs[target].scrollLeft = scrollLeft
|
|
254
|
-
// }
|
|
255
|
-
// this.tbodySync = false
|
|
256
|
-
// }
|
|
261
|
+
}
|
|
262
|
+
this.tbodySync = false
|
|
263
|
+
}
|
|
257
264
|
}
|
|
258
265
|
let ping = 'left'
|
|
259
266
|
// console.log(min, scrollLeft, max)
|
|
@@ -269,7 +276,7 @@ export default {
|
|
|
269
276
|
}
|
|
270
277
|
},
|
|
271
278
|
render() {
|
|
272
|
-
let { height, width, body, scrollBarHeight } = this
|
|
279
|
+
let { height, width, body, scrollBarHeight, sticky } = this
|
|
273
280
|
let rootProps = {
|
|
274
281
|
// ref: 'table',
|
|
275
282
|
// class: [`k-table-container`,
|
|
@@ -279,14 +286,14 @@ export default {
|
|
|
279
286
|
on: {}
|
|
280
287
|
}
|
|
281
288
|
if (width && !height) {
|
|
282
|
-
rootProps.style.overflow = 'auto';
|
|
289
|
+
// rootProps.style.overflow = 'auto';
|
|
283
290
|
// rootProps.on.scroll = e => this.asyncScroll(e)
|
|
284
291
|
}
|
|
285
|
-
|
|
292
|
+
let has_sticky = sticky !== undefined && sticky >= 0
|
|
286
293
|
const content = []
|
|
287
|
-
if (height) {
|
|
294
|
+
if (height || (width && has_sticky)) {
|
|
288
295
|
let headProps = {
|
|
289
|
-
class: `k-table-thead`,
|
|
296
|
+
class: [`k-table-thead`, { 'k-table-thead-sticky': has_sticky }],
|
|
290
297
|
on: {
|
|
291
298
|
scroll: e => this.asyncScroll(e, 'tbody')
|
|
292
299
|
},
|
|
@@ -295,10 +302,16 @@ export default {
|
|
|
295
302
|
// marginBottom: -scrollBarHeight + 'px'
|
|
296
303
|
}
|
|
297
304
|
}
|
|
298
|
-
if (
|
|
305
|
+
if (has_sticky && sticky > 0) {
|
|
306
|
+
headProps.style.top = sticky + 'px'
|
|
307
|
+
}
|
|
308
|
+
if (width && height && !has_sticky) {
|
|
299
309
|
headProps.style.marginBottom = -scrollBarHeight + 'px'
|
|
300
310
|
}
|
|
301
|
-
|
|
311
|
+
|
|
312
|
+
if (sticky) {
|
|
313
|
+
headProps.style.overflow = 'hidden'
|
|
314
|
+
} else if (height) {
|
|
302
315
|
headProps.style.overflow = 'auto'
|
|
303
316
|
}
|
|
304
317
|
content.push(<div {...headProps}>{this.renderTable(true, false)}</div>)
|
|
@@ -317,7 +330,12 @@ export default {
|
|
|
317
330
|
height: height + 'px',
|
|
318
331
|
overflow: 'auto scroll'
|
|
319
332
|
}
|
|
333
|
+
} else if (width && has_sticky) {
|
|
334
|
+
props.style = {
|
|
335
|
+
overflow: 'auto hidden'
|
|
336
|
+
}
|
|
320
337
|
}
|
|
338
|
+
|
|
321
339
|
content.push(<div {...props}>{this.renderTable(false, body)}</div>)
|
|
322
340
|
} else {
|
|
323
341
|
content.push(this.renderTable(true, body))
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
| loading | 表格异步加载模式 | Boolean | false |
|
|
11
11
|
| data | 显示的结构化数据 | Array | [ ] |
|
|
12
12
|
| columns | 表格列的配置描述, | Array | [ ] |
|
|
13
|
+
| sticky | 设置粘性头部和滚动条 | Boolean ,Number | - |
|
|
13
14
|
| row-click | 单击某一行时触发 | Function | 返回当前行的数据,index |
|
|
14
15
|
| change | 当排序和筛选改变时触发 | Function | - |
|
|
15
16
|
| on-change | 选中项发生变化时的回调 | Function(keys,selected,selectedRows) | - |
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
position: relative;
|
|
9
9
|
color: var(--kui-color-font);
|
|
10
|
+
&-thead-sticky{
|
|
11
|
+
position: sticky;
|
|
12
|
+
position: -webkit-sticky;
|
|
13
|
+
top: 0;
|
|
14
|
+
z-index: 3;
|
|
15
|
+
}
|
|
10
16
|
.k-table-cell-fixed-left {
|
|
11
17
|
position: sticky;
|
|
12
18
|
left: 0;
|
|
@@ -52,7 +58,10 @@
|
|
|
52
58
|
tr>th, tr>td {
|
|
53
59
|
font-size: 14px;
|
|
54
60
|
padding: 10px;
|
|
55
|
-
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
// overflow-wrap: break-word;
|
|
63
|
+
// word-wrap: break-word;
|
|
64
|
+
word-break: break-all;
|
|
56
65
|
word-wrap: break-word;
|
|
57
66
|
border-bottom: 1px solid var(--kui-color-table-border);
|
|
58
67
|
}
|
|
@@ -21,6 +21,7 @@ export default {
|
|
|
21
21
|
data: { type: Array, default: () => [] }, // 表格数据
|
|
22
22
|
columns: { type: Array, default: () => [] }, // 表格类目
|
|
23
23
|
loading: Boolean,
|
|
24
|
+
sticky: [Boolean, Number],
|
|
24
25
|
emptyText: String,
|
|
25
26
|
},
|
|
26
27
|
data() {
|
|
@@ -31,7 +32,7 @@ export default {
|
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
render() {
|
|
34
|
-
let { $slots, data, $scopedSlots, loading, height, width } = this
|
|
35
|
+
let { $slots, data, $scopedSlots, loading, height, width, sticky } = this
|
|
35
36
|
// bordered = true
|
|
36
37
|
const { header, footer } = $slots
|
|
37
38
|
let isTableFixed = width || height
|
|
@@ -42,7 +43,6 @@ export default {
|
|
|
42
43
|
content.push(<div class="k-table-header"> {header}</div>)
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
const isFixedHeader = height
|
|
46
46
|
|
|
47
47
|
let expandNode = $scopedSlots['expandedRowRender']
|
|
48
48
|
|
|
@@ -174,6 +174,7 @@ export default {
|
|
|
174
174
|
indeterminate,
|
|
175
175
|
checkAll,
|
|
176
176
|
width,
|
|
177
|
+
sticky:52,
|
|
177
178
|
hasExpand: expandNode != null
|
|
178
179
|
},
|
|
179
180
|
on: {
|
|
@@ -195,7 +196,6 @@ export default {
|
|
|
195
196
|
'k-table-fixed': isTableFixed,
|
|
196
197
|
'k-table-sm': this.size == 'small',
|
|
197
198
|
'k-table-lg': this.size == 'large',
|
|
198
|
-
// 'k-table-fixed-header': isFixedHeader,
|
|
199
199
|
'k-table-bordered': this.bordered,
|
|
200
200
|
[`k-table-ping-${this.ping}`]: width !== undefined
|
|
201
201
|
}]
|