xt-element-ui 2.0.4 → 2.0.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/docs/components/base/xt-upload.md +1 -1
- package/lib/index.common.js +141 -73
- package/lib/index.css +1 -1
- package/lib/index.umd.js +141 -73
- package/lib/index.umd.min.js +3 -3
- package/package.json +1 -1
- package/src/components/xt-badge/index.vue +19 -9
- package/src/components/xt-chart/theme/dark.js +26 -9
- package/src/components/xt-chart/theme/white.js +9 -0
- package/src/components/xt-chart/utils.js +28 -0
- package/src/components/xt-config-provider/index.vue +5 -1
package/package.json
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span class="
|
|
3
|
-
`xt-badge--${type}`,
|
|
4
|
-
{ 'xt-badge--dot': isDot },
|
|
5
|
-
{ 'xt-badge--hidden': hidden },
|
|
6
|
-
{ 'xt-badge--fixed': fixed }
|
|
7
|
-
]">
|
|
2
|
+
<span :class="rootClasses">
|
|
8
3
|
<span class="xt-badge__content">
|
|
9
4
|
<slot></slot>
|
|
10
5
|
</span>
|
|
@@ -13,9 +8,9 @@
|
|
|
13
8
|
class="xt-badge__badge"
|
|
14
9
|
:style="badgeStyle"
|
|
15
10
|
>
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
<
|
|
11
|
+
<span v-if="isDot"></span>
|
|
12
|
+
<span v-else-if="isOverflow">{{ overflowText }}</span>
|
|
13
|
+
<span v-else>{{ value }}</span>
|
|
19
14
|
</span>
|
|
20
15
|
</span>
|
|
21
16
|
</template>
|
|
@@ -59,12 +54,27 @@ export default {
|
|
|
59
54
|
}
|
|
60
55
|
},
|
|
61
56
|
computed: {
|
|
57
|
+
rootClasses() {
|
|
58
|
+
return [
|
|
59
|
+
'xt-badge',
|
|
60
|
+
`xt-badge--${this.type}`,
|
|
61
|
+
{ 'xt-badge--dot': this.isDot },
|
|
62
|
+
{ 'xt-badge--hidden': this.hidden },
|
|
63
|
+
{ 'xt-badge--fixed': this.fixed }
|
|
64
|
+
]
|
|
65
|
+
},
|
|
62
66
|
badgeStyle() {
|
|
63
67
|
const style = {}
|
|
64
68
|
if (this.color) {
|
|
65
69
|
style.backgroundColor = this.color
|
|
66
70
|
}
|
|
67
71
|
return style
|
|
72
|
+
},
|
|
73
|
+
overflowText() {
|
|
74
|
+
return this.max + '+'
|
|
75
|
+
},
|
|
76
|
+
isOverflow() {
|
|
77
|
+
return this.showOverflow && this.value > this.max
|
|
68
78
|
}
|
|
69
79
|
}
|
|
70
80
|
}
|
|
@@ -14,9 +14,6 @@ export default {
|
|
|
14
14
|
color: "#ffffff"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
axisLabel: {
|
|
18
|
-
color: "#ffffff"
|
|
19
|
-
},
|
|
20
17
|
line: {
|
|
21
18
|
itemStyle: {
|
|
22
19
|
},
|
|
@@ -60,14 +57,34 @@ export default {
|
|
|
60
57
|
borderColor: "#ffffff"
|
|
61
58
|
}
|
|
62
59
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
xAxis: {
|
|
61
|
+
axisLine: {
|
|
62
|
+
lineStyle: {
|
|
63
|
+
color: "#DCDFE6"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
axisTick: {
|
|
67
|
+
lineStyle: {
|
|
68
|
+
color: "#DCDFE6"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
axisLabel: {
|
|
72
|
+
color: "#ffffff"
|
|
66
73
|
}
|
|
67
74
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
yAxis: {
|
|
76
|
+
axisLine: {
|
|
77
|
+
lineStyle: {
|
|
78
|
+
color: "#DCDFE6"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
axisTick: {
|
|
82
|
+
lineStyle: {
|
|
83
|
+
color: "#DCDFE6"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
axisLabel: {
|
|
87
|
+
color: "#ffffff"
|
|
71
88
|
}
|
|
72
89
|
},
|
|
73
90
|
splitLine: {
|
|
@@ -45,6 +45,9 @@ export default {
|
|
|
45
45
|
borderColor: "#fff"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
axisLabel: {
|
|
49
|
+
color: "#666666"
|
|
50
|
+
},
|
|
48
51
|
gauge: {
|
|
49
52
|
axisLine: {
|
|
50
53
|
lineStyle: {
|
|
@@ -68,6 +71,9 @@ export default {
|
|
|
68
71
|
color: "#DFE9EE"
|
|
69
72
|
},
|
|
70
73
|
show: false
|
|
74
|
+
},
|
|
75
|
+
axisLabel: {
|
|
76
|
+
color: "#666666"
|
|
71
77
|
}
|
|
72
78
|
},
|
|
73
79
|
yAxis: {
|
|
@@ -87,6 +93,9 @@ export default {
|
|
|
87
93
|
type: "dashed",
|
|
88
94
|
color: "#DFE9EE"
|
|
89
95
|
}
|
|
96
|
+
},
|
|
97
|
+
axisLabel: {
|
|
98
|
+
color: "#666666"
|
|
90
99
|
}
|
|
91
100
|
},
|
|
92
101
|
splitArea: {
|
|
@@ -312,6 +312,34 @@ EchartsUtil.applyFontSize = function(themeOption, size) {
|
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
+
// 调整坐标轴标签字体大小和颜色
|
|
316
|
+
const applyAxisLabel = function(axis) {
|
|
317
|
+
if (!axis) return;
|
|
318
|
+
if (!axis.axisLabel) {
|
|
319
|
+
axis.axisLabel = {};
|
|
320
|
+
}
|
|
321
|
+
if (result.axisLabel && result.axisLabel.color) {
|
|
322
|
+
axis.axisLabel.color = result.axisLabel.color;
|
|
323
|
+
}
|
|
324
|
+
axis.axisLabel.fontSize = fontSizeConfig.axisLabel;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
if (result.xAxis) {
|
|
328
|
+
if (Array.isArray(result.xAxis)) {
|
|
329
|
+
result.xAxis.forEach(applyAxisLabel);
|
|
330
|
+
} else {
|
|
331
|
+
applyAxisLabel(result.xAxis);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (result.yAxis) {
|
|
336
|
+
if (Array.isArray(result.yAxis)) {
|
|
337
|
+
result.yAxis.forEach(applyAxisLabel);
|
|
338
|
+
} else {
|
|
339
|
+
applyAxisLabel(result.yAxis);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
315
343
|
return result;
|
|
316
344
|
};
|
|
317
345
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import EchartsUtil from '../xt-chart/utils.js'
|
|
3
|
+
|
|
4
|
+
// SSR 兼容:Node.js 环境中 HTMLElement 不存在
|
|
5
|
+
const HTMLElementType = typeof HTMLElement !== 'undefined' ? HTMLElement : Object
|
|
6
|
+
|
|
3
7
|
export default {
|
|
4
8
|
name: 'XtConfigProvider',
|
|
5
9
|
inheritAttrs: false,
|
|
@@ -107,7 +111,7 @@ export default {
|
|
|
107
111
|
default: false
|
|
108
112
|
},
|
|
109
113
|
proxyElement: {
|
|
110
|
-
type: [
|
|
114
|
+
type: [HTMLElementType, String, Object],
|
|
111
115
|
default: null,
|
|
112
116
|
description: '代理元素,将样式应用到该元素上。支持 HTMLElement、CSS选择器字符串或 ref 对象'
|
|
113
117
|
},
|