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.
@@ -0,0 +1,2 @@
1
+ import ExUpload from './index.vue'
2
+ export default ExUpload
@@ -1,2 +1,2 @@
1
- import ConfigProvider from './index.vue'
2
- export default ConfigProvider
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: '12px',
143
- medium: '14px',
144
- large: '16px'
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'] .xt-text--primary {
80
- }
81
-
82
- [data-theme='dark'] .xt-text--success {
83
- color: $xt-dark-color-success;
84
- }
85
-
86
- [data-theme='dark'] .xt-text--warning {
87
- color: $xt-dark-color-warning;
88
- }
89
-
90
- [data-theme='dark'] .xt-text--danger {
91
- color: $xt-dark-color-danger;
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);
@@ -70,7 +70,7 @@
70
70
 
71
71
  /* 深色主题 */
72
72
  :root[data-theme="dark"],
73
- [data-theme="dark"] {
73
+ [data-theme="dark"], html.dark {
74
74
  --el-color-primary: #409eff;
75
75
  --el-text-color-primary: #ffffff;
76
76
  --el-color-primary-light-9: #1d1e1f;
@@ -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.removeAttribute('data-theme')
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
@@ -1,2 +0,0 @@
1
- import XtUpload from './index.vue'
2
- export default XtUpload
File without changes