@vtj/charts 0.9.24 → 0.9.26

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/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { ref as o, onMounted as u, unref as c, markRaw as h, onUnmounted as p, watch as f, defineComponent as l, toRefs as v, computed as d, h as m } from "vue";
1
+ import { ref as o, onMounted as u, unref as c, markRaw as h, onUnmounted as p, watch as f, defineComponent as l, h as v, toRefs as d, computed as m } from "vue";
2
2
  import * as R from "echarts";
3
3
  import { useResizeObserver as g } from "@vueuse/core";
4
4
  import { debounce as y } from "@vtj/utils";
@@ -6,10 +6,10 @@ import { debounce as y } from "@vtj/utils";
6
6
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
7
7
  * @name @vtj/charts
8
8
  * @author CHC chenhuachun1549@dingtalk.com
9
- * @version 0.9.24
9
+ * @version 0.9.26
10
10
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
11
11
  */
12
- const S = "0.9.24";
12
+ const S = "0.9.26";
13
13
  function w(n, r, s) {
14
14
  const e = o();
15
15
  return u(() => {
@@ -48,7 +48,7 @@ const C = l({
48
48
  }
49
49
  },
50
50
  setup(n) {
51
- const { width: r, height: s, option: e } = v(n), t = o(), a = d(() => ({
51
+ const { width: r, height: s, option: e } = d(n), t = o(), a = m(() => ({
52
52
  width: r.value,
53
53
  height: s.value
54
54
  })), { echartsInstance: i } = w(R, t, e);
@@ -61,7 +61,7 @@ const C = l({
61
61
  },
62
62
  render() {
63
63
  const { styles: n } = this;
64
- return m("div", { class: "x-chart", ref: "chartRef", style: n });
64
+ return v("div", { class: "x-chart", ref: "chartRef", style: n });
65
65
  },
66
66
  expose: ["chartRef", "option", "echartsInstance"]
67
67
  }), b = [C];
package/dist/index.umd.js CHANGED
@@ -2,6 +2,6 @@
2
2
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/charts
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.9.24
5
+ * @version 0.9.26
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const o="0.9.24";function f(n,u,i){const e=Vue.ref();return Vue.onMounted(()=>{const s=Vue.unref(u);s&&(e.value||(e.value=Vue.markRaw(n.init(s))),e.value&&e.value.setOption(i.value||{}))}),Vue.onUnmounted(()=>{e.value&&e.value.dispose()}),Vue.watch(i,s=>{e.value&&e.value.setOption(s||{})},{deep:!0}),VueUse.useResizeObserver(u,VtjUtils.debounce(()=>{e.value&&e.value.resize()},150)),{echartsInstance:e}}const a=Vue.defineComponent({name:"XChart",props:{width:{type:String,default:"100%"},height:{type:String,default:"400px"},option:{type:Object}},setup(n){const{width:u,height:i,option:e}=Vue.toRefs(n),s=Vue.ref(),l=Vue.computed(()=>({width:u.value,height:i.value})),{echartsInstance:d}=f(echarts,s,e);return{chartRef:s,option:e,styles:l,echartsInstance:d}},render(){const{styles:n}=this;return Vue.h("div",{class:"x-chart",ref:"chartRef",style:n})},expose:["chartRef","option","echartsInstance"]}),c=[a],r=Symbol("INSTALLED_KEY");function h(n){n[r]||(n[r]=!0,c.forEach(u=>{u.name&&n.component(u.name,u)}))}t.INSTALLED_KEY=r,t.VTJ_CHARTS_VERSION=o,t.XChart=a,t.components=c,t.install=h,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
7
+ */const o="0.9.26";function f(n,u,i){const e=Vue.ref();return Vue.onMounted(()=>{const s=Vue.unref(u);s&&(e.value||(e.value=Vue.markRaw(n.init(s))),e.value&&e.value.setOption(i.value||{}))}),Vue.onUnmounted(()=>{e.value&&e.value.dispose()}),Vue.watch(i,s=>{e.value&&e.value.setOption(s||{})},{deep:!0}),VueUse.useResizeObserver(u,VtjUtils.debounce(()=>{e.value&&e.value.resize()},150)),{echartsInstance:e}}const a=Vue.defineComponent({name:"XChart",props:{width:{type:String,default:"100%"},height:{type:String,default:"400px"},option:{type:Object}},setup(n){const{width:u,height:i,option:e}=Vue.toRefs(n),s=Vue.ref(),l=Vue.computed(()=>({width:u.value,height:i.value})),{echartsInstance:d}=f(echarts,s,e);return{chartRef:s,option:e,styles:l,echartsInstance:d}},render(){const{styles:n}=this;return Vue.h("div",{class:"x-chart",ref:"chartRef",style:n})},expose:["chartRef","option","echartsInstance"]}),c=[a],r=Symbol("INSTALLED_KEY");function h(n){n[r]||(n[r]=!0,c.forEach(u=>{u.name&&n.component(u.name,u)}))}t.INSTALLED_KEY=r,t.VTJ_CHARTS_VERSION=o,t.XChart=a,t.components=c,t.install=h,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/charts",
3
3
  "private": false,
4
- "version": "0.9.24",
4
+ "version": "0.9.26",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=16.0.0"
@@ -9,8 +9,8 @@
9
9
  "dependencies": {
10
10
  "@vueuse/core": "~12.2.0",
11
11
  "echarts": "~5.6.0",
12
- "@vtj/icons": "~0.9.24",
13
- "@vtj/utils": "~0.9.24"
12
+ "@vtj/icons": "~0.9.26",
13
+ "@vtj/utils": "~0.9.26"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@vtj/cli": "~0.9.8"
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/charts
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.9.23
5
+ * @version 0.9.25
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.9.23";
8
+ export declare const version = "0.9.25";