mrxy-yk 1.2.11 → 1.3.0
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/dist/components/echarts-canvas/EChartsCanvas.vue.js +3 -3
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +2 -1
- package/dist/utils/echarts/themes/default.d.ts +2 -0
- package/dist/utils/echarts/themes/index.d.ts +1 -0
- package/dist/utils/echarts/themes/index.js +8 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, shallowRef, onMounted, openBlock, createElementBlock, createBlock, unref, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, renderSlot } from "vue";
|
|
2
2
|
import { EChartsUtil } from "../../utils/echarts/utils/index.js";
|
|
3
3
|
import { echarts } from "../../utils/echarts/index.js";
|
|
4
|
-
import { initDarkTheme } from "../../utils/echarts/themes/index.js";
|
|
4
|
+
import { initDefaultTheme, initDarkTheme } from "../../utils/echarts/themes/index.js";
|
|
5
5
|
import _sfc_main$1 from "../empty/Empty.vue.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { EcBasicOption } from "../../utils/echarts/modules/coordinate/basic.js";
|
|
@@ -35,14 +35,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
function getChartTheme() {
|
|
38
|
-
let chartTheme = props.theme;
|
|
38
|
+
let chartTheme = props.theme || "default";
|
|
39
39
|
if (props.theme === "auto") {
|
|
40
40
|
const classList = [...document.documentElement.classList.values()];
|
|
41
41
|
if (classList.includes("dark")) {
|
|
42
42
|
chartTheme = "dark";
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
if (chartTheme === "default")
|
|
45
|
+
if (chartTheme === "default") initDefaultTheme();
|
|
46
46
|
if (chartTheme === "dark") initDarkTheme();
|
|
47
47
|
return chartTheme;
|
|
48
48
|
}
|
package/dist/config/index.d.ts
CHANGED
package/dist/config/index.js
CHANGED
|
@@ -6,6 +6,13 @@ function initDarkTheme() {
|
|
|
6
6
|
echarts.registerTheme("dark", getThemeConfig());
|
|
7
7
|
isDarkThemeInit = true;
|
|
8
8
|
}
|
|
9
|
+
let isDefaultThemeInit = false;
|
|
10
|
+
function initDefaultTheme() {
|
|
11
|
+
if (isDefaultThemeInit) return;
|
|
12
|
+
echarts.registerTheme("default", getThemeConfig());
|
|
13
|
+
isDefaultThemeInit = true;
|
|
14
|
+
}
|
|
9
15
|
export {
|
|
10
|
-
initDarkTheme
|
|
16
|
+
initDarkTheme,
|
|
17
|
+
initDefaultTheme
|
|
11
18
|
};
|
package/package.json
CHANGED