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
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
import resize from '../_tool/resize'
|
|
3
3
|
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
top = element.offsetTop - element.parentElement.offsetTop
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
top, height, width, scrollTop,
|
|
15
|
-
targetTop: targetRect.top,
|
|
16
|
-
targetHeight: targetRect.height,
|
|
17
|
-
targetInnerHeight: target.innerHeight || target.clientHeight
|
|
18
|
-
}
|
|
19
|
-
}
|
|
4
|
+
// function getStyle(el, attr) {
|
|
5
|
+
// if (el.currentStyle) {
|
|
6
|
+
// return el.currentStyle[attr];
|
|
7
|
+
// } else {
|
|
8
|
+
// return getComputedStyle(el, false)[attr];
|
|
9
|
+
// }
|
|
10
|
+
// }
|
|
20
11
|
|
|
21
12
|
export default {
|
|
22
13
|
name: 'Affix',
|
|
@@ -31,10 +22,7 @@ export default {
|
|
|
31
22
|
fixed: false,
|
|
32
23
|
width: 0,
|
|
33
24
|
height: 0,
|
|
34
|
-
|
|
35
|
-
offsetModeOfBottom: false,
|
|
36
|
-
offsetTopValue: this.offsetTop,
|
|
37
|
-
offsetBottomValue: this.offsetBottom
|
|
25
|
+
offsetTopValue: 0,
|
|
38
26
|
}
|
|
39
27
|
},
|
|
40
28
|
|
|
@@ -42,64 +30,29 @@ export default {
|
|
|
42
30
|
let target = this.target()
|
|
43
31
|
if (target) {
|
|
44
32
|
target.addEventListener('scroll', e => {
|
|
45
|
-
// console.log(e)
|
|
46
33
|
this.updatePosition(e)
|
|
47
|
-
// console.log(e)
|
|
48
34
|
})
|
|
49
35
|
}
|
|
50
|
-
// this.updatePosition(target)
|
|
51
36
|
},
|
|
52
37
|
methods: {
|
|
53
38
|
updatePosition(e) {
|
|
54
39
|
let { offsetBottom, offsetTop, $refs } = this
|
|
55
|
-
if (!$refs.blob) return;
|
|
56
|
-
|
|
57
40
|
let target = this.target()
|
|
41
|
+
if (!$refs.blob || !target) return;
|
|
58
42
|
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
offsetTop = target === window ? offsetTop : scrollTop
|
|
62
|
-
if (this.fixed) {
|
|
43
|
+
let rect = $refs.blob.getBoundingClientRect();
|
|
44
|
+
let rect2 = target != window && target != document ? target.getBoundingClientRect() : { top: 0, bottom: document.documentElement.clientHeight }
|
|
63
45
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
if (target !== window && top !== targetTop) {
|
|
76
|
-
this.offsetTopValue = targetTop
|
|
77
|
-
}
|
|
78
|
-
if (!this.fixed) {
|
|
79
|
-
this.fixed = false
|
|
80
|
-
this.$emit('change', false)
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
if (typeof offsetBottom != undefined && offsetBottom >= 0) {
|
|
84
|
-
//fixedBottom
|
|
85
|
-
if (0 <= top + height + offsetBottom - targetInnerHeight) {
|
|
86
|
-
this.offsetModeOfBottom = true
|
|
87
|
-
this.fixed = true
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
if (top <= offsetTop) { //fixedTop
|
|
91
|
-
this.fixed = true
|
|
92
|
-
this.offsetModeOfTop = true
|
|
93
|
-
if (target !== window) {
|
|
94
|
-
this.offsetTopValue = targetTop
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (this.fixed) {
|
|
99
|
-
this.$emit('change', true)
|
|
100
|
-
this.width = width
|
|
101
|
-
this.height = height
|
|
102
|
-
}
|
|
46
|
+
let hasbottom = typeof offsetBottom == 'number' && offsetBottom >= 0
|
|
47
|
+
let fx = hasbottom ? rect2.bottom - rect.bottom >= offsetBottom : rect.top - rect2.top <= offsetTop
|
|
48
|
+
if (!fx) {
|
|
49
|
+
this.offsetTopValue = rect.top
|
|
50
|
+
}
|
|
51
|
+
if (this.fixed != fx) {
|
|
52
|
+
this.fixed = fx
|
|
53
|
+
this.$emit('change', this.fixed)
|
|
54
|
+
this.width = rect.width
|
|
55
|
+
this.height = rect.height
|
|
103
56
|
}
|
|
104
57
|
}
|
|
105
58
|
},
|
|
@@ -112,13 +65,8 @@ export default {
|
|
|
112
65
|
}
|
|
113
66
|
fixedStyle = {
|
|
114
67
|
width: `${this.width}px`,
|
|
115
|
-
height: `${this.height}px
|
|
116
|
-
|
|
117
|
-
if (this.offsetModeOfBottom) {
|
|
118
|
-
fixedStyle.bottom = `${this.offsetBottom}px`
|
|
119
|
-
}
|
|
120
|
-
if (this.offsetModeOfTop) {
|
|
121
|
-
fixedStyle.top = `${this.offsetTopValue}px`
|
|
68
|
+
height: `${this.height}px`,
|
|
69
|
+
top: `${this.offsetTopValue}px`
|
|
122
70
|
}
|
|
123
71
|
classes = { ['k-affix']: this.fixed }
|
|
124
72
|
}
|
|
@@ -7,25 +7,32 @@
|
|
|
7
7
|
<template>
|
|
8
8
|
<div class="demo-affix-scroll" ref="container">
|
|
9
9
|
<div class="demo-affix-inner" >
|
|
10
|
-
<
|
|
10
|
+
<div style="padding:50px 0;" />
|
|
11
|
+
<Affix :target="() => this.$refs.container" :offsetTop="50">
|
|
11
12
|
<Button type="primary" id="tesss">Affix at the top of container</Button>
|
|
12
13
|
</Affix>
|
|
14
|
+
<div style="padding:200px 0;" />
|
|
15
|
+
<Affix :target="() => this.$refs.container" :offsetBottom="50">
|
|
16
|
+
<Button type="primary" id="tesss">Affix at the bottom of container</Button>
|
|
17
|
+
</Affix>
|
|
13
18
|
</div>
|
|
14
19
|
</div>
|
|
15
20
|
</template>
|
|
16
21
|
|
|
17
22
|
<style scoped>
|
|
18
23
|
.demo-affix-scroll{
|
|
19
|
-
height:
|
|
24
|
+
height:400px;
|
|
20
25
|
overflow-y:scroll;
|
|
26
|
+
background-image: linear-gradient(-45deg, #cdcdcd 25%, transparent 0), linear-gradient(45deg, #cdcdcd 25%, transparent 0), linear-gradient(-45deg, transparent 75%, #cdcdcd 0), linear-gradient(45deg, transparent 75%, #cdcdcd 0);
|
|
27
|
+
background-size: 20px 20px;
|
|
28
|
+
background-position: 0 0, 0 -10px, -10px 10px, 10px 0;
|
|
21
29
|
}
|
|
22
30
|
.demo-affix-inner{
|
|
23
|
-
height:
|
|
31
|
+
height:800px;
|
|
24
32
|
/* background:#efefef; */
|
|
25
|
-
padding-top:30px;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
background-position: 0 0, 0 -10px, -10px 10px, 10px 0;
|
|
33
|
+
/* padding-top:30px; */
|
|
34
|
+
|
|
35
|
+
|
|
29
36
|
}
|
|
30
37
|
</style>
|
|
31
38
|
```
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
## API
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
|
5
|
-
|
|
|
6
|
-
|
|
|
2
|
+
|
|
3
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
4
|
+
| ------------ | -------------------------------------------------------------------- | -------------- | ------ |
|
|
5
|
+
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | String, Number | 0 |
|
|
6
|
+
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | String, Number | - |
|
|
7
|
+
| change | 在固定状态发生改变时触发, 返回当前固定状态 `false` , `true` | Function | - |
|
|
8
|
+
| target | 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | HTMLElement | window |
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
font-size: 12px;
|
|
10
10
|
transition: all .3s;
|
|
11
11
|
overflow: hidden;
|
|
12
|
-
background:
|
|
13
|
-
border: 1px solid
|
|
12
|
+
background: fadeout(@warning, 90%);
|
|
13
|
+
border: 1px solid fadeout(@warning, 70%);
|
|
14
14
|
&-icon {
|
|
15
15
|
color: @warning;
|
|
16
16
|
position: absolute;
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
left: 10px;
|
|
19
19
|
font-size: 20px;
|
|
20
20
|
}
|
|
21
|
+
&-message {
|
|
22
|
+
color: @color;
|
|
23
|
+
}
|
|
21
24
|
&-has-icon {
|
|
22
25
|
padding-left: 38px;
|
|
23
26
|
}
|
|
@@ -37,9 +40,11 @@
|
|
|
37
40
|
font-size: 14px;
|
|
38
41
|
font-weight: 500;
|
|
39
42
|
margin-bottom: 5px;
|
|
43
|
+
color: @color;
|
|
40
44
|
}
|
|
41
45
|
.k-alert-description {
|
|
42
46
|
font-size: 14px;
|
|
47
|
+
color: @color;
|
|
43
48
|
}
|
|
44
49
|
&.k-alert-has-icon {
|
|
45
50
|
padding-left: 50px;
|
|
@@ -63,22 +68,22 @@
|
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
&-success {
|
|
66
|
-
background:
|
|
67
|
-
border-color:
|
|
71
|
+
background: fadeout(@success, 90%);
|
|
72
|
+
border-color: fadeout(@success, 70%);
|
|
68
73
|
.k-alert-icon {
|
|
69
74
|
color: @success;
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
77
|
&-error {
|
|
73
|
-
background:
|
|
74
|
-
border-color:
|
|
78
|
+
background: fadeout(@danger, 90%);
|
|
79
|
+
border-color: fadeout(@danger, 70%);
|
|
75
80
|
.k-alert-icon {
|
|
76
81
|
color: @danger;
|
|
77
82
|
}
|
|
78
83
|
}
|
|
79
84
|
&-info {
|
|
80
|
-
background:
|
|
81
|
-
border-color:
|
|
85
|
+
background: fadeout(@main, 90%);
|
|
86
|
+
border-color: fadeout(@main, 70%);
|
|
82
87
|
.k-alert-icon {
|
|
83
88
|
color: @main;
|
|
84
89
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import Icon from '../icon'
|
|
2
|
+
import { getChild, isVnode } from '../_tool/utils'
|
|
3
|
+
export default {
|
|
4
|
+
props: {
|
|
5
|
+
icon: String,
|
|
6
|
+
shape: { type: String, },
|
|
7
|
+
size: {
|
|
8
|
+
type: [Number, String],
|
|
9
|
+
default: 'default',
|
|
10
|
+
validator: (val) => typeof val == 'number' ? 1 : ['large', 'small', 'default'].indexOf(val) >= 0
|
|
11
|
+
},
|
|
12
|
+
src: String
|
|
13
|
+
},
|
|
14
|
+
updated() {
|
|
15
|
+
this.udpateSize()
|
|
16
|
+
},
|
|
17
|
+
methods: {
|
|
18
|
+
udpateSize() {
|
|
19
|
+
let inner = this.$refs.inner
|
|
20
|
+
if (inner) {
|
|
21
|
+
let scale = 1, max = this.$el.offsetWidth - 8;
|
|
22
|
+
if (inner.scrollWidth > max)
|
|
23
|
+
scale = (max) / inner.scrollWidth
|
|
24
|
+
inner.style = 'transform: scale(' + scale + ') translateX(-50%);'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
mounted() {
|
|
29
|
+
this.udpateSize()
|
|
30
|
+
},
|
|
31
|
+
render() {
|
|
32
|
+
let { size, shape, src, icon } = this
|
|
33
|
+
let styles = {}
|
|
34
|
+
if (typeof size == 'number') {
|
|
35
|
+
styles = {
|
|
36
|
+
width: `${size}px`,
|
|
37
|
+
height: `${size}px`,
|
|
38
|
+
lineHeight: `${size}px`,
|
|
39
|
+
fontSize: `${size / 2}px`,
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
let child = getChild(this.$slots.default)
|
|
43
|
+
let hasIcon = child.filter(x => (x.componentOptions || {}).tag == 'Icon').length
|
|
44
|
+
let text = child.filter(x => !x.context).length == child.length
|
|
45
|
+
|
|
46
|
+
let cls = ['k-avatar', {
|
|
47
|
+
'k-avatar-lg': size == 'large',
|
|
48
|
+
'k-avatar-sm': size == 'small',
|
|
49
|
+
'k-avatar-image': src,
|
|
50
|
+
'k-avatar-icon': icon || hasIcon,
|
|
51
|
+
'k-avatar-square': shape == 'square'
|
|
52
|
+
}]
|
|
53
|
+
return <div class={cls} style={styles} >
|
|
54
|
+
{
|
|
55
|
+
icon ?
|
|
56
|
+
<Icon type={icon} /> :
|
|
57
|
+
(
|
|
58
|
+
src ? <img src={src} /> : (text ? <span class="k-avatar-string" ref="inner">{child}</span> : child)
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
</div >
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 基本
|
|
3
|
+
头像有三种尺寸,两种形状可选。
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<div>
|
|
10
|
+
<Avatar :size="64" icon="person-outline" />
|
|
11
|
+
<Avatar size="large" icon="person-outline" />
|
|
12
|
+
<Avatar icon="person-outline" />
|
|
13
|
+
<Avatar size="small" icon="person-outline" />
|
|
14
|
+
</div>
|
|
15
|
+
<br />
|
|
16
|
+
<div>
|
|
17
|
+
<Avatar shape="square" :size="64" icon="person-outline" />
|
|
18
|
+
<Avatar shape="square" size="large" icon="person-outline" />
|
|
19
|
+
<Avatar shape="square" icon="person-outline" />
|
|
20
|
+
<Avatar shape="square" size="small" icon="person-outline" />
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 自动调整字符大小
|
|
3
|
+
对于字符型的头像,当字符串较长时,字体大小可以根据头像宽度自动调整。
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<Avatar
|
|
10
|
+
size="large"
|
|
11
|
+
:style="{ backgroundColor: color, verticalAlign: 'middle' }"
|
|
12
|
+
>
|
|
13
|
+
{{ text }}
|
|
14
|
+
</Avatar>
|
|
15
|
+
<Button size="small" @click="changeValue">改变</Button>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
<script>
|
|
19
|
+
function ran(min, max) {
|
|
20
|
+
return parseInt((Math.random() * (max - min)) + min)
|
|
21
|
+
}
|
|
22
|
+
const userList = ['K', '王','邱先生', 'Jack', 'Jone'];
|
|
23
|
+
const colorList = ['#3a95ff', '#00bb5d', '#ff3300', '#ffa500'];
|
|
24
|
+
export default {
|
|
25
|
+
data() {
|
|
26
|
+
return {
|
|
27
|
+
text: userList[0],
|
|
28
|
+
color: colorList[0],
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
changeValue() {
|
|
33
|
+
this.text = userList[ran(0,3)]
|
|
34
|
+
this.color = colorList[ran(0,3)]
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Info from './info.md'
|
|
3
|
+
import Base from './base.md'
|
|
4
|
+
import Types from './types.md'
|
|
5
|
+
import Change from './change.md'
|
|
6
|
+
import CN from '../index.md'
|
|
7
|
+
export default {
|
|
8
|
+
render() {
|
|
9
|
+
return (
|
|
10
|
+
<div>
|
|
11
|
+
<Info class="typo" />
|
|
12
|
+
<Base />
|
|
13
|
+
<Types />
|
|
14
|
+
<Change />
|
|
15
|
+
<CN class="typo" />
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 类型
|
|
3
|
+
支持三种类型:图片、Icon 以及字符,其中 Icon 和字符型可以自定义图标颜色及背景色。
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<Avatar icon="person-outline" />
|
|
10
|
+
<Avatar>
|
|
11
|
+
<Icon type="person-outline" />
|
|
12
|
+
</Avatar>
|
|
13
|
+
<Avatar>U</Avatar>
|
|
14
|
+
<Avatar>USER</Avatar>
|
|
15
|
+
<Avatar src="https://chuchur.com/img/icons/apple-icon-57x57.png" />
|
|
16
|
+
<Avatar style="color: #f51212; background-color: #ffc57d">
|
|
17
|
+
U
|
|
18
|
+
</Avatar>
|
|
19
|
+
<Avatar style="background-color:#d06868" icon="person-outline" />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## API
|
|
2
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
+
| ----- | ---------------------------- | -------------------------- | ------- |
|
|
4
|
+
| icon | 设置头像的图标类型 | String,Number | 400 |
|
|
5
|
+
| shape | 指定头像的形状 circle,square | String | circle |
|
|
6
|
+
| size | 设置头像的大小 | large,small,default,Number | default |
|
|
7
|
+
| src | 图片类头像的资源地址 | String | - |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@import '../../styles/global.less';
|
|
2
|
+
.k-avatar {
|
|
3
|
+
margin: 0;
|
|
4
|
+
padding: 0;
|
|
5
|
+
color: @back-color;
|
|
6
|
+
background-color: @border-color;
|
|
7
|
+
border-radius: 50%;
|
|
8
|
+
height: 32px;
|
|
9
|
+
width: 32px;
|
|
10
|
+
line-height: 32px;
|
|
11
|
+
text-align: center;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
display: inline-block;
|
|
16
|
+
vertical-align: middle;
|
|
17
|
+
position: relative;
|
|
18
|
+
zoom: 1;
|
|
19
|
+
&>img {
|
|
20
|
+
display: block;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
-o-object-fit: cover;
|
|
24
|
+
object-fit: cover;
|
|
25
|
+
}
|
|
26
|
+
&.k-avatar-icon {
|
|
27
|
+
font-size: 18px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.k-avatar-lg {
|
|
32
|
+
width: 40px;
|
|
33
|
+
height: 40px;
|
|
34
|
+
line-height: 40px;
|
|
35
|
+
&.k-avatar-icon {
|
|
36
|
+
font-size: 24px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.k-avatar-sm {
|
|
41
|
+
width: 24px;
|
|
42
|
+
height: 24px;
|
|
43
|
+
line-height: 24px;
|
|
44
|
+
&.k-avatar-icon {
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.k-avatar-square {
|
|
50
|
+
border-radius: 4px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.k-avatar-image {
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.k-avatar-string {
|
|
58
|
+
position: absolute;
|
|
59
|
+
left: 50%;
|
|
60
|
+
transform-origin: 0 center;
|
|
61
|
+
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
font-size: 12px;
|
|
22
22
|
white-space: nowrap;
|
|
23
23
|
z-index: 10;
|
|
24
|
-
box-shadow: 0 0 0 1px
|
|
24
|
+
box-shadow: 0 0 0 1px @back-color;
|
|
25
25
|
box-sizing: border-box;
|
|
26
26
|
}
|
|
27
27
|
&-mark {
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
min-width: 20px;
|
|
31
31
|
background: #ed3f14;
|
|
32
32
|
color: #fff;
|
|
33
|
-
color: #fff;
|
|
34
33
|
height: 20px;
|
|
35
34
|
line-height: 20px;
|
|
36
35
|
text-align: center;
|
package/components/base/pop.jsx
CHANGED
|
@@ -126,7 +126,7 @@ export default {
|
|
|
126
126
|
props: {
|
|
127
127
|
transfer,
|
|
128
128
|
value: this.opened,
|
|
129
|
-
className: [`k-${preCls}-content`, { [`k-${preCls}-${color}`]: color && !/^#/.test(color) }],
|
|
129
|
+
className: [`k-${preCls}-content`, { [`k-${preCls}-${color}`]: color && !/^#/.test(color), [`k-${preCls}-has-color`]: /^#/.test(color) }],
|
|
130
130
|
width: this.width,
|
|
131
131
|
selection: this.selection,
|
|
132
132
|
placement,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
margin: 0;
|
|
6
6
|
padding: 0;
|
|
7
7
|
list-style: none;
|
|
8
|
-
color:
|
|
8
|
+
color: @disable-color;
|
|
9
9
|
font-size: 14px;
|
|
10
10
|
&-item {
|
|
11
11
|
.k-icon {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
>span {
|
|
22
22
|
&:last-child {
|
|
23
|
-
color:
|
|
23
|
+
color: @title-color;
|
|
24
24
|
.k-breadcrumb-separator {
|
|
25
25
|
display: none;
|
|
26
26
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
user-select: none;
|
|
13
13
|
outline: none;
|
|
14
14
|
border: 1px solid @border-color;
|
|
15
|
-
background-color:
|
|
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;
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
|
|
107
107
|
.k-btn.k-btn-hollow {
|
|
108
108
|
background: 0 0;
|
|
109
|
-
color:
|
|
110
|
-
border-color:
|
|
109
|
+
color: @color;
|
|
110
|
+
border-color: @border-color;
|
|
111
111
|
&:focus, &:hover {
|
|
112
112
|
border-color: @main;
|
|
113
113
|
color: @main;
|
|
@@ -212,8 +212,8 @@
|
|
|
212
212
|
opacity: .9;
|
|
213
213
|
cursor: not-allowed;
|
|
214
214
|
color: darken(@disable-color, 8%);
|
|
215
|
-
background: darken( @disable-back, 8%);
|
|
216
|
-
border-color: darken(@disable-border, 8%);
|
|
215
|
+
// background: darken( @disable-back, 8%);
|
|
216
|
+
// border-color: darken(@disable-border, 8%);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
@import '../../styles/global.less';
|
|
2
2
|
.k-card {
|
|
3
|
-
background:
|
|
3
|
+
background: @back-color;
|
|
4
4
|
position: relative;
|
|
5
5
|
border-radius: @radius;
|
|
6
|
+
color: @color;
|
|
6
7
|
.k-card-head {
|
|
7
8
|
position: relative;
|
|
8
|
-
border-bottom: 1px solid
|
|
9
|
+
border-bottom: 1px solid @border-color;
|
|
9
10
|
padding: 14px 16px;
|
|
10
11
|
line-height: 1;
|
|
11
12
|
.k-icon {
|
|
@@ -40,5 +41,5 @@
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
.k-card-bordered {
|
|
43
|
-
border: 1px solid
|
|
44
|
+
border: 1px solid @border-color;
|
|
44
45
|
}
|
|
@@ -51,12 +51,14 @@ export default {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
// console.log(checked)
|
|
54
|
-
const wpclasses = ["k-checkbox-wrapper", {
|
|
54
|
+
const wpclasses = ["k-checkbox-wrapper", {
|
|
55
|
+
["k-checkbox-disabled"]: disabled,
|
|
56
|
+
["k-checkbox-checked"]: checked && !indeterminate,
|
|
57
|
+
}]
|
|
55
58
|
|
|
56
59
|
const classes = [
|
|
57
60
|
"k-checkbox",
|
|
58
61
|
{
|
|
59
|
-
["k-checkbox-checked"]: checked && !indeterminate,
|
|
60
62
|
["k-checkbox-indeterminate"]: indeterminate
|
|
61
63
|
}
|
|
62
64
|
];
|