xt-element-ui 1.2.2 → 1.2.3
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/lib/index.common.js +1211 -1154
- package/lib/index.css +1 -1
- package/lib/index.umd.js +1216 -1159
- package/lib/index.umd.min.js +5 -5
- package/package.json +1 -1
- package/src/components/ex-button/index.vue +1 -1
- package/src/components/ex-button/style/index.scss +10 -4
- package/src/components/ex-chart/theme/dark.js +1 -1
- package/src/components/ex-chart/utils.js +1 -1
- package/src/components/ex-page/index.js +2 -0
- package/src/components/ex-select-tree/index.js +2 -0
- package/src/components/{xt-select-tree → ex-select-tree}/index.vue +1 -1
- package/src/components/ex-table/ExTableCell.vue +3 -2
- package/src/components/ex-table/VirtualElTable.vue +234 -0
- package/src/components/ex-table/index.vue +176 -445
- package/src/components/ex-upload/index.js +2 -0
- package/src/components/xt-config-provider/index.js +2 -2
- package/src/components/xt-config-provider/index.vue +7 -3
- package/src/components/xt-text/style/index.scss +13 -13
- package/src/styles/css-variables.scss +1 -1
- package/src/styles/element-theme.scss +1 -1
- package/src/utils/index.js +11 -2
- package/src/components/xt-page/index.js +0 -0
- package/src/components/xt-select-tree/index.js +0 -0
- package/src/components/xt-upload/index.js +0 -2
- /package/src/components/{xt-page → ex-page}/index.vue +0 -0
- /package/src/components/{xt-upload → ex-upload}/index.vue +0 -0
- /package/src/components/{xt-upload → ex-upload}/preview.vue +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default
|
|
1
|
+
import XtConfigProvider from './index.vue'
|
|
2
|
+
export default XtConfigProvider
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import EchartsUtil from '../ex-chart/utils.js'
|
|
2
3
|
export default {
|
|
3
4
|
name: 'XtConfigProvider',
|
|
4
5
|
inheritAttrs: false,
|
|
@@ -139,9 +140,9 @@ export default {
|
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
const sizeMap = {
|
|
142
|
-
small: '
|
|
143
|
-
medium: '
|
|
144
|
-
large: '
|
|
143
|
+
small: '14px',
|
|
144
|
+
medium: '16px',
|
|
145
|
+
large: '18px'
|
|
145
146
|
}
|
|
146
147
|
if (sizeMap[this.size]) {
|
|
147
148
|
result['--xt-font-size-base'] = sizeMap[this.size]
|
|
@@ -308,6 +309,9 @@ export default {
|
|
|
308
309
|
|
|
309
310
|
// 设置 data-theme 属性
|
|
310
311
|
element.setAttribute('data-theme', this.theme)
|
|
312
|
+
|
|
313
|
+
// 更新图表颜色
|
|
314
|
+
EchartsUtil.changeAllTheme(this.theme, this.size, this.primaryColor)
|
|
311
315
|
|
|
312
316
|
// 触发主题改变钩子(当主题实际发生变化时)
|
|
313
317
|
if (prevTheme !== this.theme && typeof this.onThemeChange === 'function') {
|
|
@@ -76,17 +76,17 @@
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
// 暗色主题
|
|
79
|
-
[data-theme='dark'] .
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
[data-theme='dark'], html.dark {
|
|
80
|
+
.xt-text--primary {
|
|
81
|
+
color: $xt-dark-color-primary;
|
|
82
|
+
}
|
|
83
|
+
.xt-text--success {
|
|
84
|
+
color: $xt-dark-color-success;
|
|
85
|
+
}
|
|
86
|
+
.xt-text--warning {
|
|
87
|
+
color: $xt-dark-color-warning;
|
|
88
|
+
}
|
|
89
|
+
.xt-text--danger {
|
|
90
|
+
color: $xt-dark-color-danger;
|
|
91
|
+
}
|
|
92
92
|
}
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
// 暗色主题(参考 Element Plus)
|
|
184
184
|
// ============================
|
|
185
185
|
:root[data-theme="dark"],
|
|
186
|
-
[data-theme="dark"] {
|
|
186
|
+
[data-theme="dark"], html.dark {
|
|
187
187
|
color-scheme: dark;
|
|
188
188
|
--xt-color-primary: #409eff;
|
|
189
189
|
--xt-color-primary-light-3: rgb(51, 117, 185);
|
package/src/utils/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import EchartsUtil from '../components/ex-chart/utils'
|
|
1
2
|
// 默认配置
|
|
2
3
|
const defaultConfig = {
|
|
3
4
|
theme: 'white',
|
|
@@ -44,7 +45,7 @@ export const setConfig = function(config) {
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
|
|
47
|
-
// 设置主题
|
|
48
|
+
// 设置主题 并更新图表主题
|
|
48
49
|
export const setTheme = function(theme) {
|
|
49
50
|
const validThemes = ['white', 'dark']
|
|
50
51
|
if (!validThemes.includes(theme)) {
|
|
@@ -59,9 +60,13 @@ export const setTheme = function(theme) {
|
|
|
59
60
|
if (theme === 'dark') {
|
|
60
61
|
root.setAttribute('data-theme', 'dark')
|
|
61
62
|
} else {
|
|
62
|
-
root.
|
|
63
|
+
root.setAttribute('data-theme', theme)
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
// 更新图表主题
|
|
67
|
+
EchartsUtil.changeAllTheme(currentConfig.theme, currentConfig.size)
|
|
68
|
+
console.log('更新图表主题')
|
|
69
|
+
|
|
65
70
|
emitConfigChange('theme', theme)
|
|
66
71
|
}
|
|
67
72
|
|
|
@@ -75,6 +80,10 @@ export const setSize = function(size) {
|
|
|
75
80
|
|
|
76
81
|
currentConfig.size = size
|
|
77
82
|
document.documentElement.setAttribute('data-size', size)
|
|
83
|
+
// 更新图表主题
|
|
84
|
+
EchartsUtil.changeAllTheme(currentConfig.theme, currentConfig.size)
|
|
85
|
+
console.log('更新图表字体')
|
|
86
|
+
|
|
78
87
|
emitConfigChange('size', size)
|
|
79
88
|
}
|
|
80
89
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|