kui-vue 3.3.0-rc2 → 3.3.2
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/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/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-render.md +1 -1
- package/components/table/demo/base.md +1 -1
- package/components/table/demo/bordered.md +1 -1
- package/components/table/demo/custom-header.md +1 -1
- package/components/table/demo/edit.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 +29 -11
- 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,16 +1,16 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Base from './base'
|
|
3
|
-
import Info from './info'
|
|
4
|
-
import Disabled from './disabled'
|
|
5
|
-
import Group from './group'
|
|
6
|
-
import Options from './options'
|
|
7
|
-
import GroupVertical from './group-vertical'
|
|
8
|
-
import Button from './button'
|
|
2
|
+
import Base from './base.md'
|
|
3
|
+
import Info from './info.md'
|
|
4
|
+
import Disabled from './disabled.md'
|
|
5
|
+
import Group from './group.md'
|
|
6
|
+
import Options from './options.md'
|
|
7
|
+
import GroupVertical from './group-vertical.md'
|
|
8
|
+
import Button from './button.md'
|
|
9
9
|
import CN from '../index.md'
|
|
10
10
|
export default {
|
|
11
11
|
render() {
|
|
12
12
|
return (
|
|
13
|
-
<div class="
|
|
13
|
+
<div class="demo-radio">
|
|
14
14
|
<Info class="typo" />
|
|
15
15
|
<Base />
|
|
16
16
|
<Disabled />
|
|
@@ -23,5 +23,4 @@ export default {
|
|
|
23
23
|
)
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
</script>
|
|
26
|
+
</script>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Info from "./info";
|
|
3
|
-
import Base from "./base";
|
|
4
|
-
import Half from "./half";
|
|
5
|
-
import Tips from "./tips";
|
|
6
|
-
import Disabled from "./disabled";
|
|
7
|
-
import Clear from "./clear";
|
|
8
|
-
import Character from "./character";
|
|
9
|
-
import Custom from "./custom";
|
|
2
|
+
import Info from "./info.md";
|
|
3
|
+
import Base from "./base.md";
|
|
4
|
+
import Half from "./half.md";
|
|
5
|
+
import Tips from "./tips.md";
|
|
6
|
+
import Disabled from "./disabled.md";
|
|
7
|
+
import Clear from "./clear.md";
|
|
8
|
+
import Character from "./character.md";
|
|
9
|
+
import Custom from "./custom.md";
|
|
10
10
|
|
|
11
11
|
import CN from "../index.md";
|
|
12
12
|
export default {
|
|
13
13
|
render() {
|
|
14
14
|
return (
|
|
15
|
-
<div class="
|
|
15
|
+
<div class="demo-rate">
|
|
16
16
|
<Info class="typo" />
|
|
17
17
|
<Base />
|
|
18
18
|
<Half />
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Info from './info'
|
|
3
|
-
import Base from './base'
|
|
4
|
-
import Theme from './theme'
|
|
5
|
-
import Icons from './icon'
|
|
6
|
-
import Size from './size'
|
|
7
|
-
import Clearable from './clearable'
|
|
8
|
-
import NoBordered from './nobordered'
|
|
9
|
-
import Multiple from './multiple'
|
|
10
|
-
import Filterable from './filterable'
|
|
11
|
-
import Search from './search'
|
|
2
|
+
import Info from './info.md'
|
|
3
|
+
import Base from './base.md'
|
|
4
|
+
import Theme from './theme.md'
|
|
5
|
+
import Icons from './icon.md'
|
|
6
|
+
import Size from './size.md'
|
|
7
|
+
import Clearable from './clearable.md'
|
|
8
|
+
import NoBordered from './nobordered.md'
|
|
9
|
+
import Multiple from './multiple.md'
|
|
10
|
+
import Filterable from './filterable.md'
|
|
11
|
+
import Search from './search.md'
|
|
12
12
|
import CN from '../index.md'
|
|
13
13
|
export default {
|
|
14
14
|
render() {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
height:100px;
|
|
32
32
|
width:166px;
|
|
33
33
|
border-radius:8px;
|
|
34
|
-
background:url("https://
|
|
34
|
+
background:url("https://cdn.chuchur.com/upload/demo/test_300.jpg") no-repeat center;
|
|
35
35
|
background-size:cover;
|
|
36
36
|
}
|
|
37
37
|
.demo-skeleton-card h2{
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Info from "./info";
|
|
3
|
-
import Base from "./base";
|
|
4
|
-
import WithNumber from "./withNumber";
|
|
5
|
-
import Formatter from "./formatter";
|
|
6
|
-
import Marks from "./marks";
|
|
7
|
-
import Vertical from "./vertical";
|
|
8
|
-
import Reverse from "./reverse";
|
|
2
|
+
import Info from "./info.md";
|
|
3
|
+
import Base from "./base.md";
|
|
4
|
+
import WithNumber from "./withNumber.md";
|
|
5
|
+
import Formatter from "./formatter.md";
|
|
6
|
+
import Marks from "./marks.md";
|
|
7
|
+
import Vertical from "./vertical.md";
|
|
8
|
+
import Reverse from "./reverse.md";
|
|
9
9
|
|
|
10
10
|
import CN from "../index.md";
|
|
11
11
|
export default {
|
|
12
12
|
render() {
|
|
13
13
|
return (
|
|
14
|
-
<div class="
|
|
14
|
+
<div class="demo-slider">
|
|
15
15
|
<Info class="typo" />
|
|
16
16
|
<Base />
|
|
17
17
|
<WithNumber />
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
position: relative;
|
|
15
15
|
}
|
|
16
16
|
.k-slider-thumb {
|
|
17
|
+
outline: none;
|
|
17
18
|
user-select: none;
|
|
19
|
+
touch-action: none;
|
|
18
20
|
box-shadow: 0 4px 6px rgb(0 0 0 / 10%), 0 0 1px rgb(0 0 0 / 30%);
|
|
19
21
|
width: 24px;
|
|
20
22
|
height: 24px;
|
|
@@ -22,12 +24,13 @@
|
|
|
22
24
|
border: none;
|
|
23
25
|
border-radius: 50%;
|
|
24
26
|
position: absolute;
|
|
25
|
-
cursor:
|
|
27
|
+
cursor: grab;
|
|
26
28
|
background: #fff;
|
|
27
29
|
border: 1px solid #fff;
|
|
28
30
|
transform: translateX(-50%);
|
|
29
31
|
&:active {
|
|
30
32
|
border: 1px solid var(--kui-color-main);
|
|
33
|
+
cursor: grabbing;
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
.k-slider-track {
|
|
@@ -40,6 +43,7 @@
|
|
|
40
43
|
pointer-events: none;
|
|
41
44
|
}
|
|
42
45
|
.k-slider-rail {
|
|
46
|
+
touch-action: none;
|
|
43
47
|
cursor: pointer;
|
|
44
48
|
height: 4px;
|
|
45
49
|
border-radius: 2px;
|
|
@@ -20,13 +20,27 @@ export default {
|
|
|
20
20
|
data() {
|
|
21
21
|
return {
|
|
22
22
|
index: 1,
|
|
23
|
-
showTip: false
|
|
23
|
+
showTip: false,
|
|
24
|
+
touch: false
|
|
24
25
|
}
|
|
25
26
|
},
|
|
27
|
+
mounted() {
|
|
28
|
+
let touch = !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch)
|
|
29
|
+
this.touch = touch
|
|
30
|
+
},
|
|
26
31
|
methods: {
|
|
27
32
|
mouseMove(e) {
|
|
28
33
|
if (this.isMouseDown) {
|
|
29
|
-
|
|
34
|
+
e.preventDefault()
|
|
35
|
+
let clientX, clientY;
|
|
36
|
+
// let { clientX, clientY } = e
|
|
37
|
+
if (e.touches && e.touches.length == 1) {
|
|
38
|
+
clientX = e.touches[0].clientX
|
|
39
|
+
clientY = e.touches[0].clientY
|
|
40
|
+
} else {
|
|
41
|
+
clientX = e.clientX
|
|
42
|
+
clientY = e.clientY
|
|
43
|
+
}
|
|
30
44
|
// let r = e.target.getBoundingClientRect()
|
|
31
45
|
// console.log(e)
|
|
32
46
|
// let clientX = r.left + r.width / 2, clientY = r.top + r.height / 2
|
|
@@ -67,8 +81,9 @@ export default {
|
|
|
67
81
|
} else {
|
|
68
82
|
this.showTip = false
|
|
69
83
|
}
|
|
70
|
-
|
|
71
|
-
document.removeEventListener(
|
|
84
|
+
let [e1, e2] = this.touch ? ['touchmove', 'touchend'] : ['mousemove', 'mouseup']
|
|
85
|
+
document.removeEventListener(e1, this.mouseMove)
|
|
86
|
+
document.removeEventListener(e2, this.mouseUp)
|
|
72
87
|
},
|
|
73
88
|
onMouseDown(e) {
|
|
74
89
|
if (this.disabled) return;
|
|
@@ -76,9 +91,11 @@ export default {
|
|
|
76
91
|
this.showTip = true
|
|
77
92
|
this.index = 2
|
|
78
93
|
// this.mouseMove(e)
|
|
79
|
-
|
|
80
|
-
document.addEventListener(
|
|
81
|
-
|
|
94
|
+
let [e1, e2] = this.touch ? ['touchmove', 'touchend'] : ['mousemove', 'mouseup']
|
|
95
|
+
document.addEventListener(e1, this.mouseMove)
|
|
96
|
+
document.addEventListener(e2, this.mouseUp)
|
|
97
|
+
},
|
|
98
|
+
|
|
82
99
|
},
|
|
83
100
|
render() {
|
|
84
101
|
let { vertical, value, index, disabled, max, min, tipFormatter, range, type, reverse, tooltipVisible } = this
|
|
@@ -90,6 +107,7 @@ export default {
|
|
|
90
107
|
},
|
|
91
108
|
on: {
|
|
92
109
|
mousedown: this.onMouseDown,
|
|
110
|
+
touchstart: this.onMouseDown,
|
|
93
111
|
mouseenter: () => {
|
|
94
112
|
if (!disabled) this.showTip = true
|
|
95
113
|
},
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Info from "./info";
|
|
3
|
-
import Base from "./base";
|
|
4
|
-
import Vertical from "./vertical";
|
|
5
|
-
import Align from "./align";
|
|
6
|
-
import Size from "./size";
|
|
7
|
-
import Warp from "./wrap";
|
|
8
|
-
import CustomSize from "./custom-size";
|
|
2
|
+
import Info from "./info.md";
|
|
3
|
+
import Base from "./base.md";
|
|
4
|
+
import Vertical from "./vertical.md";
|
|
5
|
+
import Align from "./align.md";
|
|
6
|
+
import Size from "./size.md";
|
|
7
|
+
import Warp from "./wrap.md";
|
|
8
|
+
import CustomSize from "./custom-size.md";
|
|
9
9
|
|
|
10
10
|
import CN from "../index.md";
|
|
11
11
|
export default {
|
|
12
12
|
render() {
|
|
13
13
|
return (
|
|
14
|
-
<div class="
|
|
14
|
+
<div class="demo-space">
|
|
15
15
|
<Info class="typo" />
|
|
16
16
|
<Base />
|
|
17
17
|
<Vertical />
|
|
@@ -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
|
}
|