@vtj/charts 0.8.135 → 0.8.137

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
@@ -6,19 +6,19 @@ import { debounce as y } from "@vtj/utils";
6
6
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
7
7
  * @name @vtj/charts
8
8
  * @author CHC chenhuachun1549@dingtalk.com
9
- * @version 0.8.135
9
+ * @version 0.8.137
10
10
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
11
11
  */
12
- const S = "0.8.135";
13
- function w(s, r, n) {
12
+ const S = "0.8.137";
13
+ function w(n, r, s) {
14
14
  const e = o();
15
15
  return u(() => {
16
16
  const t = c(r);
17
- t && (e.value || (e.value = h(s.init(t))), e.value && e.value.setOption(n.value || {}));
17
+ t && (e.value || (e.value = h(n.init(t))), e.value && e.value.setOption(s.value || {}));
18
18
  }), p(() => {
19
19
  e.value && e.value.dispose();
20
20
  }), f(
21
- n,
21
+ s,
22
22
  (t) => {
23
23
  e.value && e.value.setOption(t || {});
24
24
  },
@@ -47,10 +47,10 @@ const C = l({
47
47
  type: Object
48
48
  }
49
49
  },
50
- setup(s) {
51
- const { width: r, height: n, option: e } = v(s), t = o(), a = d(() => ({
50
+ setup(n) {
51
+ const { width: r, height: s, option: e } = v(n), t = o(), a = d(() => ({
52
52
  width: r.value,
53
- height: n.value
53
+ height: s.value
54
54
  })), { echartsInstance: i } = w(R, t, e);
55
55
  return {
56
56
  chartRef: t,
@@ -60,7 +60,8 @@ const C = l({
60
60
  };
61
61
  },
62
62
  render() {
63
- return m("div", { class: "x-chart", ref: "chartRef", style: this.styles });
63
+ const { styles: n } = this;
64
+ return m("div", { class: "x-chart", ref: "chartRef", style: n });
64
65
  },
65
66
  expose: ["chartRef", "option", "echartsInstance"]
66
67
  }), b = [C];
package/dist/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
- (function(t,i){typeof exports=="object"&&typeof module!="undefined"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(t=typeof globalThis!="undefined"?globalThis:t||self,i(t.VtjCharts={}))})(this,function(t){"use strict";/**!
1
+ (function(t,o){typeof exports=="object"&&typeof module!="undefined"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(t=typeof globalThis!="undefined"?globalThis:t||self,o(t.VtjCharts={}))})(this,function(t){"use strict";/**!
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/charts
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.8.135
5
+ * @version 0.8.137
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const i="0.8.135";function f(u,n,o){const e=Vue.ref();return Vue.onMounted(()=>{const s=Vue.unref(n);s&&(e.value||(e.value=Vue.markRaw(u.init(s))),e.value&&e.value.setOption(o.value||{}))}),Vue.onUnmounted(()=>{e.value&&e.value.dispose()}),Vue.watch(o,s=>{e.value&&e.value.setOption(s||{})},{deep:!0}),VueUse.useResizeObserver(n,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(u){const{width:n,height:o,option:e}=Vue.toRefs(u),s=Vue.ref(),l=Vue.computed(()=>({width:n.value,height:o.value})),{echartsInstance:d}=f(echarts,s,e);return{chartRef:s,option:e,styles:l,echartsInstance:d}},render(){return Vue.h("div",{class:"x-chart",ref:"chartRef",style:this.styles})},expose:["chartRef","option","echartsInstance"]}),c=[a],r=Symbol("INSTALLED_KEY");function h(u){u[r]||(u[r]=!0,c.forEach(n=>{n.name&&u.component(n.name,n)}))}t.INSTALLED_KEY=r,t.VTJ_CHARTS_VERSION=i,t.XChart=a,t.components=c,t.install=h,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
7
+ */const o="0.8.137";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.8.135",
4
+ "version": "0.8.137",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=16.0.0"
@@ -9,11 +9,11 @@
9
9
  "dependencies": {
10
10
  "@vueuse/core": "~11.0.3",
11
11
  "echarts": "~5.5.0",
12
- "@vtj/icons": "~0.8.135",
13
- "@vtj/utils": "~0.8.135"
12
+ "@vtj/icons": "~0.8.137",
13
+ "@vtj/utils": "~0.8.137"
14
14
  },
15
15
  "devDependencies": {
16
- "@vtj/cli": "~0.8.30"
16
+ "@vtj/cli": "~0.8.32"
17
17
  },
18
18
  "files": [
19
19
  "dist",
@@ -1,9 +1,8 @@
1
- import { PropType, DefineComponent, Ref, ComputedRef, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
1
+ import { PropType, ComputedRef, DefineComponent, ExtractPropTypes, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
2
  import { EChartsOption, ECharts } from 'echarts';
3
-
4
3
  export type ChartOption = EChartsOption;
5
4
  export type EChartsInstance = ECharts;
6
- declare const _default: DefineComponent<{
5
+ declare const _default: DefineComponent<ExtractPropTypes<{
7
6
  width: {
8
7
  type: StringConstructor;
9
8
  default: string;
@@ -15,15 +14,12 @@ declare const _default: DefineComponent<{
15
14
  option: {
16
15
  type: PropType<ChartOption>;
17
16
  };
18
- }, {
19
- chartRef: Ref<any>;
20
- option: Ref<EChartsOption | undefined>;
21
- styles: ComputedRef<{
22
- width: string;
23
- height: string;
24
- }>;
25
- echartsInstance: Ref<ECharts | undefined>;
26
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
17
+ }>, {
18
+ chartRef: Ref<any, any>;
19
+ option: Ref<EChartsOption | undefined, EChartsOption | undefined>;
20
+ styles: ComputedRef<Record<string, any>>;
21
+ echartsInstance: Ref<ECharts | undefined, ECharts | undefined>;
22
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
27
23
  width: {
28
24
  type: StringConstructor;
29
25
  default: string;
@@ -35,8 +31,8 @@ declare const _default: DefineComponent<{
35
31
  option: {
36
32
  type: PropType<ChartOption>;
37
33
  };
38
- }>>, {
34
+ }>> & Readonly<{}>, {
39
35
  width: string;
40
36
  height: string;
41
- }, {}>;
37
+ }, {}, {}, {}, "chartRef" | "option" | "echartsInstance", ComponentProvideOptions, true, {}, any>;
42
38
  export default _default;
@@ -1,4 +1,3 @@
1
1
  import { default as XChart } from './Chart';
2
-
3
2
  export declare const components: any[];
4
3
  export { XChart };
@@ -1,6 +1,5 @@
1
1
  import { MaybeRef, Ref } from 'vue';
2
2
  import { ECharts, EChartsOption } from 'echarts';
3
-
4
3
  export declare function useChart(echarts: any, el: MaybeRef<HTMLElement>, option: Ref<EChartsOption | undefined>): {
5
- echartsInstance: Ref<ECharts | undefined>;
4
+ echartsInstance: Ref<ECharts | undefined, ECharts | undefined>;
6
5
  };
package/types/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
-
2
1
  export { version as VTJ_CHARTS_VERSION } from './version';
3
2
  export * from './components';
@@ -1,5 +1,4 @@
1
1
  import { App } from 'vue';
2
-
3
2
  export declare const INSTALLED_KEY: unique symbol;
4
3
  export declare function install(app: App): void;
5
4
  export * from './index';
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/charts
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.8.134
5
+ * @version 0.8.136
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.8.134";
8
+ export declare const version = "0.8.136";