@vtj/charts 0.12.20 → 0.12.22
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 +131 -38
- package/dist/index.umd.js +3 -3
- package/package.json +3 -3
- package/types/components/Chart.d.ts +4 -3
- package/types/components/MapChart.d.ts +182 -0
- package/types/components/index.d.ts +3 -1
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/useChart.d.ts +5 -3
- package/types/hooks/useListeners.d.ts +1 -0
- package/types/hooks/useMapChart.d.ts +106 -0
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
@@ -1,38 +1,85 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import { useResizeObserver as
|
4
|
-
import { debounce as
|
1
|
+
import * as v from "echarts";
|
2
|
+
import { reactive as w, ref as f, onMounted as h, unref as b, markRaw as S, onUnmounted as d, watch as p, shallowRef as j, defineComponent as g, h as m, toRefs as y, computed as C } from "vue";
|
3
|
+
import { useResizeObserver as E } from "@vueuse/core";
|
4
|
+
import { kebabCase as M, camelCase as x, debounce as k } from "@vtj/utils";
|
5
5
|
/**!
|
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.12.
|
9
|
+
* @version 0.12.22
|
10
10
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
11
11
|
*/
|
12
|
-
const
|
13
|
-
function
|
14
|
-
const
|
15
|
-
|
16
|
-
const
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
const I = "0.12.22";
|
13
|
+
function J(a) {
|
14
|
+
const o = w({});
|
15
|
+
for (const [c, e] of Object.entries(a)) {
|
16
|
+
const [r, ...s] = M(c).split("-");
|
17
|
+
if (r === "on" && typeof e == "function") {
|
18
|
+
const t = x(s.join("-"));
|
19
|
+
o[t] = e;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
return o;
|
23
|
+
}
|
24
|
+
function L(a, o, c) {
|
25
|
+
const e = f(), r = J(c);
|
26
|
+
return h(() => {
|
27
|
+
const t = b(a);
|
28
|
+
if (t && (e.value || (e.value = S(v.init(t))), e.value)) {
|
29
|
+
for (const [i, n] of Object.entries(r))
|
30
|
+
e.value.on(i, n);
|
31
|
+
e.value.setOption(o.value || {});
|
32
|
+
}
|
33
|
+
}), d(() => {
|
34
|
+
if (e.value) {
|
35
|
+
for (const t of Object.keys(r))
|
36
|
+
e.value.off(t);
|
37
|
+
e.value.dispose();
|
38
|
+
}
|
39
|
+
}), p(
|
40
|
+
o,
|
41
|
+
async (t) => {
|
23
42
|
e.value && e.value.setOption(t || {});
|
24
43
|
},
|
25
44
|
{ deep: !0 }
|
26
|
-
),
|
27
|
-
|
28
|
-
|
45
|
+
), E(
|
46
|
+
a,
|
47
|
+
k(() => {
|
29
48
|
e.value && e.value.resize();
|
30
49
|
}, 150)
|
31
50
|
), {
|
32
|
-
|
51
|
+
instance: e,
|
52
|
+
getEChart: () => e.value
|
53
|
+
};
|
54
|
+
}
|
55
|
+
function X(a, o, c) {
|
56
|
+
const e = f(), r = j(null), s = f({}), t = async (i, n) => {
|
57
|
+
const u = e.value?.instance;
|
58
|
+
u && u.showLoading();
|
59
|
+
const l = typeof n == "string" ? await fetch(n).then((O) => O.json()).catch(() => null) : n;
|
60
|
+
return u && u.hideLoading(), l && v.registerMap(i, l), l;
|
61
|
+
};
|
62
|
+
return p([a, o], async () => {
|
63
|
+
r.value = await t(a.value, o.value);
|
64
|
+
}), p(r, (i) => {
|
65
|
+
if (i) {
|
66
|
+
const n = c.option || {};
|
67
|
+
n.geo && (n.geo.map = a.value), (n.series || []).map((l) => {
|
68
|
+
l?.type === "map" && (l.map = a.value);
|
69
|
+
}), s.value = n;
|
70
|
+
}
|
71
|
+
}), h(async () => {
|
72
|
+
r.value = await t(a.value, o.value);
|
73
|
+
}), d(() => {
|
74
|
+
const i = e.value?.instance;
|
75
|
+
i && i.hideLoading();
|
76
|
+
}), {
|
77
|
+
chartRef: e,
|
78
|
+
geoJSON: r,
|
79
|
+
option: s
|
33
80
|
};
|
34
81
|
}
|
35
|
-
const
|
82
|
+
const R = g({
|
36
83
|
name: "XChart",
|
37
84
|
props: {
|
38
85
|
width: {
|
@@ -47,26 +94,72 @@ const C = l({
|
|
47
94
|
type: Object
|
48
95
|
}
|
49
96
|
},
|
50
|
-
setup(
|
51
|
-
const { width:
|
52
|
-
width:
|
53
|
-
height:
|
54
|
-
})), {
|
55
|
-
return {
|
56
|
-
|
57
|
-
option:
|
58
|
-
|
59
|
-
|
97
|
+
setup(a, { expose: o, attrs: c }) {
|
98
|
+
const { width: e, height: r, option: s } = y(a), t = f(), i = C(() => ({
|
99
|
+
width: e.value,
|
100
|
+
height: r.value
|
101
|
+
})), { instance: n, getEChart: u } = L(t, s, c);
|
102
|
+
return o({
|
103
|
+
elRef: t,
|
104
|
+
option: s,
|
105
|
+
instance: n,
|
106
|
+
getEChart: u
|
107
|
+
}), {
|
108
|
+
elRef: t,
|
109
|
+
option: s,
|
110
|
+
styles: i,
|
111
|
+
instance: n,
|
112
|
+
getEChart: u
|
113
|
+
};
|
114
|
+
},
|
115
|
+
render() {
|
116
|
+
return m("div", { class: "x-chart", ref: "elRef", style: this.styles });
|
117
|
+
}
|
118
|
+
}), T = g({
|
119
|
+
name: "XMapChart",
|
120
|
+
inheritAttrs: !1,
|
121
|
+
props: {
|
122
|
+
geoJson: {
|
123
|
+
type: [String, Object],
|
124
|
+
default: "https://unpkg.com/vtj-geojson@0.1.3/geo/100000/100000.geoJson"
|
125
|
+
},
|
126
|
+
name: {
|
127
|
+
type: String,
|
128
|
+
default: "china"
|
129
|
+
}
|
130
|
+
},
|
131
|
+
emits: ["ready"],
|
132
|
+
async setup(a, { attrs: o, emit: c }) {
|
133
|
+
const { name: e, geoJson: r } = y(a), { chartRef: s, geoJSON: t, option: i } = X(e, r, o), n = C(() => s.value?.instance);
|
134
|
+
return h(() => {
|
135
|
+
c("ready", n.value);
|
136
|
+
}), {
|
137
|
+
chartRef: s,
|
138
|
+
option: i,
|
139
|
+
instance: n,
|
140
|
+
getChartRef: () => s.value,
|
141
|
+
getEChart: () => s.value?.getEChart(),
|
142
|
+
geoJSON: t
|
60
143
|
};
|
61
144
|
},
|
62
145
|
render() {
|
63
|
-
|
64
|
-
|
146
|
+
return m(
|
147
|
+
R,
|
148
|
+
{
|
149
|
+
...this.$attrs,
|
150
|
+
ref: "chartRef",
|
151
|
+
class: "x-map-chart",
|
152
|
+
option: this.option
|
153
|
+
},
|
154
|
+
this.$slots
|
155
|
+
);
|
65
156
|
},
|
66
|
-
|
67
|
-
}),
|
157
|
+
methods: {}
|
158
|
+
}), V = [R];
|
68
159
|
export {
|
69
|
-
|
70
|
-
|
71
|
-
|
160
|
+
I as VTJ_CHARTS_VERSION,
|
161
|
+
R as XChart,
|
162
|
+
T as XMapChart,
|
163
|
+
V as components,
|
164
|
+
v as echarts
|
72
165
|
};
|
package/dist/index.umd.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
(function(
|
1
|
+
(function(r,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(r=typeof globalThis<"u"?globalThis:r||self,h(r.VtjCharts={}))})(this,function(r){"use strict";/**!
|
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.12.
|
5
|
+
* @version 0.12.22
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
7
|
-
*/const
|
7
|
+
*/const h="0.12.22";function V(n){const a=Vue.reactive({});for(const[l,e]of Object.entries(n)){const[i,...o]=VtjUtils.kebabCase(l).split("-");if(i==="on"&&typeof e=="function"){const s=VtjUtils.camelCase(o.join("-"));a[s]=e}}return a}function m(n,a,l){const e=Vue.ref(),i=V(l);return Vue.onMounted(()=>{const s=Vue.unref(n);if(s&&(e.value||(e.value=Vue.markRaw(echarts.init(s))),e.value)){for(const[c,t]of Object.entries(i))e.value.on(c,t);e.value.setOption(a.value||{})}}),Vue.onUnmounted(()=>{if(e.value){for(const s of Object.keys(i))e.value.off(s);e.value.dispose()}}),Vue.watch(a,async s=>{e.value&&e.value.setOption(s||{})},{deep:!0}),VueUse.useResizeObserver(n,VtjUtils.debounce(()=>{e.value&&e.value.resize()},150)),{instance:e,getEChart:()=>e.value}}function y(n,a,l){const e=Vue.ref(),i=Vue.shallowRef(null),o=Vue.ref({}),s=async(c,t)=>{var g;const u=(g=e.value)==null?void 0:g.instance;u&&u.showLoading();const f=typeof t=="string"?await fetch(t).then(j=>j.json()).catch(()=>null):t;return u&&u.hideLoading(),f&&echarts.registerMap(c,f),f};return Vue.watch([n,a],async()=>{i.value=await s(n.value,a.value)}),Vue.watch(i,c=>{if(c){const t=l.option||{};t.geo&&(t.geo.map=n.value),(t.series||[]).map(f=>{(f==null?void 0:f.type)==="map"&&(f.map=n.value)}),o.value=t}}),Vue.onMounted(async()=>{i.value=await s(n.value,a.value)}),Vue.onUnmounted(()=>{var t;const c=(t=e.value)==null?void 0:t.instance;c&&c.hideLoading()}),{chartRef:e,geoJSON:i,option:o}}const p=Vue.defineComponent({name:"XChart",props:{width:{type:String,default:"100%"},height:{type:String,default:"400px"},option:{type:Object}},setup(n,{expose:a,attrs:l}){const{width:e,height:i,option:o}=Vue.toRefs(n),s=Vue.ref(),c=Vue.computed(()=>({width:e.value,height:i.value})),{instance:t,getEChart:u}=m(s,o,l);return a({elRef:s,option:o,instance:t,getEChart:u}),{elRef:s,option:o,styles:c,instance:t,getEChart:u}},render(){return Vue.h("div",{class:"x-chart",ref:"elRef",style:this.styles})}}),C=Vue.defineComponent({name:"XMapChart",inheritAttrs:!1,props:{geoJson:{type:[String,Object],default:"https://unpkg.com/vtj-geojson@0.1.3/geo/100000/100000.geoJson"},name:{type:String,default:"china"}},emits:["ready"],async setup(n,{attrs:a,emit:l}){const{name:e,geoJson:i}=Vue.toRefs(n),{chartRef:o,geoJSON:s,option:c}=y(e,i,a),t=Vue.computed(()=>{var u;return(u=o.value)==null?void 0:u.instance});return Vue.onMounted(()=>{l("ready",t.value)}),{chartRef:o,option:c,instance:t,getChartRef:()=>o.value,getEChart:()=>{var u;return(u=o.value)==null?void 0:u.getEChart()},geoJSON:s}},render(){return Vue.h(p,{...this.$attrs,ref:"chartRef",class:"x-map-chart",option:this.option},this.$slots)},methods:{}}),v=[p];var b=echarts;const d=Symbol("INSTALLED_KEY");function S(n){n[d]||(n[d]=!0,v.forEach(a=>{a.name&&n.component(a.name,a)}))}r.INSTALLED_KEY=d,r.VTJ_CHARTS_VERSION=h,r.XChart=p,r.XMapChart=C,r.components=v,r.echarts=b,r.install=S,Object.defineProperty(r,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.12.
|
4
|
+
"version": "0.12.22",
|
5
5
|
"type": "module",
|
6
6
|
"keywords": [
|
7
7
|
"低代码引擎",
|
@@ -26,8 +26,8 @@
|
|
26
26
|
"dependencies": {
|
27
27
|
"@vueuse/core": "~13.1.0",
|
28
28
|
"echarts": "~5.6.0",
|
29
|
-
"@vtj/icons": "~0.12.
|
30
|
-
"@vtj/utils": "~0.12.
|
29
|
+
"@vtj/icons": "~0.12.22",
|
30
|
+
"@vtj/utils": "~0.12.22"
|
31
31
|
},
|
32
32
|
"devDependencies": {
|
33
33
|
"@vtj/cli": "~0.12.2"
|
@@ -15,10 +15,11 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
15
15
|
type: PropType<ChartOption>;
|
16
16
|
};
|
17
17
|
}>, {
|
18
|
-
|
18
|
+
elRef: Ref<any, any>;
|
19
19
|
option: Ref<EChartsOption | undefined, EChartsOption | undefined>;
|
20
20
|
styles: ComputedRef<Record<string, any>>;
|
21
|
-
|
21
|
+
instance: Ref<ECharts | undefined, ECharts | undefined>;
|
22
|
+
getEChart: () => ECharts | undefined;
|
22
23
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
23
24
|
width: {
|
24
25
|
type: StringConstructor;
|
@@ -34,5 +35,5 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
34
35
|
}>> & Readonly<{}>, {
|
35
36
|
width: string;
|
36
37
|
height: string;
|
37
|
-
}, {}, {}, {},
|
38
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
38
39
|
export default _default;
|
@@ -0,0 +1,182 @@
|
|
1
|
+
import { DefineComponent, ExtractPropTypes, Ref, CreateComponentPublicInstanceWithMixins, PropType, ComputedRef, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ShallowRef } from 'vue';
|
2
|
+
import { ChartOption } from './Chart';
|
3
|
+
import { EChartsOption, ECharts } from 'echarts';
|
4
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
5
|
+
geoJson: {
|
6
|
+
type: (ObjectConstructor | StringConstructor)[];
|
7
|
+
default: string;
|
8
|
+
};
|
9
|
+
name: {
|
10
|
+
type: StringConstructor;
|
11
|
+
default: string;
|
12
|
+
};
|
13
|
+
}>, {
|
14
|
+
chartRef: Ref< CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
15
|
+
width: {
|
16
|
+
type: StringConstructor;
|
17
|
+
default: string;
|
18
|
+
};
|
19
|
+
height: {
|
20
|
+
type: StringConstructor;
|
21
|
+
default: string;
|
22
|
+
};
|
23
|
+
option: {
|
24
|
+
type: PropType<ChartOption>;
|
25
|
+
};
|
26
|
+
}>> & Readonly<{}>, {
|
27
|
+
elRef: Ref<any, any>;
|
28
|
+
option: Ref< EChartsOption | undefined, EChartsOption | undefined>;
|
29
|
+
styles: ComputedRef<Record<string, any>>;
|
30
|
+
instance: Ref< ECharts | undefined, ECharts | undefined>;
|
31
|
+
getEChart: () => ECharts | undefined;
|
32
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
33
|
+
width: string;
|
34
|
+
height: string;
|
35
|
+
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
36
|
+
P: {};
|
37
|
+
B: {};
|
38
|
+
D: {};
|
39
|
+
C: {};
|
40
|
+
M: {};
|
41
|
+
Defaults: {};
|
42
|
+
}, Readonly< ExtractPropTypes<{
|
43
|
+
width: {
|
44
|
+
type: StringConstructor;
|
45
|
+
default: string;
|
46
|
+
};
|
47
|
+
height: {
|
48
|
+
type: StringConstructor;
|
49
|
+
default: string;
|
50
|
+
};
|
51
|
+
option: {
|
52
|
+
type: PropType<ChartOption>;
|
53
|
+
};
|
54
|
+
}>> & Readonly<{}>, {
|
55
|
+
elRef: Ref<any, any>;
|
56
|
+
option: Ref< EChartsOption | undefined, EChartsOption | undefined>;
|
57
|
+
styles: ComputedRef<Record<string, any>>;
|
58
|
+
instance: Ref< ECharts | undefined, ECharts | undefined>;
|
59
|
+
getEChart: () => ECharts | undefined;
|
60
|
+
}, {}, {}, {}, {
|
61
|
+
width: string;
|
62
|
+
height: string;
|
63
|
+
}> | undefined, CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
64
|
+
width: {
|
65
|
+
type: StringConstructor;
|
66
|
+
default: string;
|
67
|
+
};
|
68
|
+
height: {
|
69
|
+
type: StringConstructor;
|
70
|
+
default: string;
|
71
|
+
};
|
72
|
+
option: {
|
73
|
+
type: PropType<ChartOption>;
|
74
|
+
};
|
75
|
+
}>> & Readonly<{}>, {
|
76
|
+
elRef: Ref<any, any>;
|
77
|
+
option: Ref< EChartsOption | undefined, EChartsOption | undefined>;
|
78
|
+
styles: ComputedRef<Record<string, any>>;
|
79
|
+
instance: Ref< ECharts | undefined, ECharts | undefined>;
|
80
|
+
getEChart: () => ECharts | undefined;
|
81
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
82
|
+
width: string;
|
83
|
+
height: string;
|
84
|
+
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
85
|
+
P: {};
|
86
|
+
B: {};
|
87
|
+
D: {};
|
88
|
+
C: {};
|
89
|
+
M: {};
|
90
|
+
Defaults: {};
|
91
|
+
}, Readonly< ExtractPropTypes<{
|
92
|
+
width: {
|
93
|
+
type: StringConstructor;
|
94
|
+
default: string;
|
95
|
+
};
|
96
|
+
height: {
|
97
|
+
type: StringConstructor;
|
98
|
+
default: string;
|
99
|
+
};
|
100
|
+
option: {
|
101
|
+
type: PropType<ChartOption>;
|
102
|
+
};
|
103
|
+
}>> & Readonly<{}>, {
|
104
|
+
elRef: Ref<any, any>;
|
105
|
+
option: Ref< EChartsOption | undefined, EChartsOption | undefined>;
|
106
|
+
styles: ComputedRef<Record<string, any>>;
|
107
|
+
instance: Ref< ECharts | undefined, ECharts | undefined>;
|
108
|
+
getEChart: () => ECharts | undefined;
|
109
|
+
}, {}, {}, {}, {
|
110
|
+
width: string;
|
111
|
+
height: string;
|
112
|
+
}> | undefined>;
|
113
|
+
option: Ref<any, any>;
|
114
|
+
instance: ComputedRef< ECharts | undefined>;
|
115
|
+
getChartRef: () => CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
116
|
+
width: {
|
117
|
+
type: StringConstructor;
|
118
|
+
default: string;
|
119
|
+
};
|
120
|
+
height: {
|
121
|
+
type: StringConstructor;
|
122
|
+
default: string;
|
123
|
+
};
|
124
|
+
option: {
|
125
|
+
type: PropType<ChartOption>;
|
126
|
+
};
|
127
|
+
}>> & Readonly<{}>, {
|
128
|
+
elRef: Ref<any, any>;
|
129
|
+
option: Ref< EChartsOption | undefined, EChartsOption | undefined>;
|
130
|
+
styles: ComputedRef<Record<string, any>>;
|
131
|
+
instance: Ref< ECharts | undefined, ECharts | undefined>;
|
132
|
+
getEChart: () => ECharts | undefined;
|
133
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
134
|
+
width: string;
|
135
|
+
height: string;
|
136
|
+
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
137
|
+
P: {};
|
138
|
+
B: {};
|
139
|
+
D: {};
|
140
|
+
C: {};
|
141
|
+
M: {};
|
142
|
+
Defaults: {};
|
143
|
+
}, Readonly< ExtractPropTypes<{
|
144
|
+
width: {
|
145
|
+
type: StringConstructor;
|
146
|
+
default: string;
|
147
|
+
};
|
148
|
+
height: {
|
149
|
+
type: StringConstructor;
|
150
|
+
default: string;
|
151
|
+
};
|
152
|
+
option: {
|
153
|
+
type: PropType<ChartOption>;
|
154
|
+
};
|
155
|
+
}>> & Readonly<{}>, {
|
156
|
+
elRef: Ref<any, any>;
|
157
|
+
option: Ref< EChartsOption | undefined, EChartsOption | undefined>;
|
158
|
+
styles: ComputedRef<Record<string, any>>;
|
159
|
+
instance: Ref< ECharts | undefined, ECharts | undefined>;
|
160
|
+
getEChart: () => ECharts | undefined;
|
161
|
+
}, {}, {}, {}, {
|
162
|
+
width: string;
|
163
|
+
height: string;
|
164
|
+
}> | undefined;
|
165
|
+
getEChart: () => ECharts | undefined;
|
166
|
+
geoJSON: ShallowRef<any, any>;
|
167
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "ready"[], "ready", PublicProps, Readonly< ExtractPropTypes<{
|
168
|
+
geoJson: {
|
169
|
+
type: (ObjectConstructor | StringConstructor)[];
|
170
|
+
default: string;
|
171
|
+
};
|
172
|
+
name: {
|
173
|
+
type: StringConstructor;
|
174
|
+
default: string;
|
175
|
+
};
|
176
|
+
}>> & Readonly<{
|
177
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
178
|
+
}>, {
|
179
|
+
name: string;
|
180
|
+
geoJson: string | Record<string, any>;
|
181
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
182
|
+
export default _default;
|
package/types/hooks/index.d.ts
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
import { MaybeRef, Ref } from 'vue';
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
2
|
+
import { EChartsOption } from 'echarts';
|
3
|
+
import * as echarts from 'echarts';
|
4
|
+
export declare function useChart(el: MaybeRef<HTMLElement>, option: Ref<EChartsOption | undefined>, attrs: Record<string, any>): {
|
5
|
+
instance: Ref<echarts.ECharts | undefined, echarts.ECharts | undefined>;
|
6
|
+
getEChart: () => echarts.ECharts | undefined;
|
5
7
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function useListeners(attrs: Record<string, any>): Record<string, (...args: any) => void>;
|
@@ -0,0 +1,106 @@
|
|
1
|
+
import { Ref, CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, ComputedRef, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ShallowRef } from 'vue';
|
2
|
+
import { ChartOption } from '../components/Chart';
|
3
|
+
import * as echarts from 'echarts';
|
4
|
+
export declare function useMapChart(name: Ref<string>, geoJson: Ref<any>, attrs: Record<string, any>): {
|
5
|
+
chartRef: Ref< CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
6
|
+
width: {
|
7
|
+
type: StringConstructor;
|
8
|
+
default: string;
|
9
|
+
};
|
10
|
+
height: {
|
11
|
+
type: StringConstructor;
|
12
|
+
default: string;
|
13
|
+
};
|
14
|
+
option: {
|
15
|
+
type: PropType<ChartOption>;
|
16
|
+
};
|
17
|
+
}>> & Readonly<{}>, {
|
18
|
+
elRef: Ref<any, any>;
|
19
|
+
option: Ref<echarts.EChartsOption | undefined, echarts.EChartsOption | undefined>;
|
20
|
+
styles: ComputedRef<Record<string, any>>;
|
21
|
+
instance: Ref<echarts.ECharts | undefined, echarts.ECharts | undefined>;
|
22
|
+
getEChart: () => echarts.ECharts | undefined;
|
23
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
24
|
+
width: string;
|
25
|
+
height: string;
|
26
|
+
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
27
|
+
P: {};
|
28
|
+
B: {};
|
29
|
+
D: {};
|
30
|
+
C: {};
|
31
|
+
M: {};
|
32
|
+
Defaults: {};
|
33
|
+
}, Readonly< ExtractPropTypes<{
|
34
|
+
width: {
|
35
|
+
type: StringConstructor;
|
36
|
+
default: string;
|
37
|
+
};
|
38
|
+
height: {
|
39
|
+
type: StringConstructor;
|
40
|
+
default: string;
|
41
|
+
};
|
42
|
+
option: {
|
43
|
+
type: PropType<ChartOption>;
|
44
|
+
};
|
45
|
+
}>> & Readonly<{}>, {
|
46
|
+
elRef: Ref<any, any>;
|
47
|
+
option: Ref<echarts.EChartsOption | undefined, echarts.EChartsOption | undefined>;
|
48
|
+
styles: ComputedRef<Record<string, any>>;
|
49
|
+
instance: Ref<echarts.ECharts | undefined, echarts.ECharts | undefined>;
|
50
|
+
getEChart: () => echarts.ECharts | undefined;
|
51
|
+
}, {}, {}, {}, {
|
52
|
+
width: string;
|
53
|
+
height: string;
|
54
|
+
}> | undefined, CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
55
|
+
width: {
|
56
|
+
type: StringConstructor;
|
57
|
+
default: string;
|
58
|
+
};
|
59
|
+
height: {
|
60
|
+
type: StringConstructor;
|
61
|
+
default: string;
|
62
|
+
};
|
63
|
+
option: {
|
64
|
+
type: PropType<ChartOption>;
|
65
|
+
};
|
66
|
+
}>> & Readonly<{}>, {
|
67
|
+
elRef: Ref<any, any>;
|
68
|
+
option: Ref<echarts.EChartsOption | undefined, echarts.EChartsOption | undefined>;
|
69
|
+
styles: ComputedRef<Record<string, any>>;
|
70
|
+
instance: Ref<echarts.ECharts | undefined, echarts.ECharts | undefined>;
|
71
|
+
getEChart: () => echarts.ECharts | undefined;
|
72
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
73
|
+
width: string;
|
74
|
+
height: string;
|
75
|
+
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
76
|
+
P: {};
|
77
|
+
B: {};
|
78
|
+
D: {};
|
79
|
+
C: {};
|
80
|
+
M: {};
|
81
|
+
Defaults: {};
|
82
|
+
}, Readonly< ExtractPropTypes<{
|
83
|
+
width: {
|
84
|
+
type: StringConstructor;
|
85
|
+
default: string;
|
86
|
+
};
|
87
|
+
height: {
|
88
|
+
type: StringConstructor;
|
89
|
+
default: string;
|
90
|
+
};
|
91
|
+
option: {
|
92
|
+
type: PropType<ChartOption>;
|
93
|
+
};
|
94
|
+
}>> & Readonly<{}>, {
|
95
|
+
elRef: Ref<any, any>;
|
96
|
+
option: Ref<echarts.EChartsOption | undefined, echarts.EChartsOption | undefined>;
|
97
|
+
styles: ComputedRef<Record<string, any>>;
|
98
|
+
instance: Ref<echarts.ECharts | undefined, echarts.ECharts | undefined>;
|
99
|
+
getEChart: () => echarts.ECharts | undefined;
|
100
|
+
}, {}, {}, {}, {
|
101
|
+
width: string;
|
102
|
+
height: string;
|
103
|
+
}> | undefined>;
|
104
|
+
geoJSON: ShallowRef<any, any>;
|
105
|
+
option: Ref<any, any>;
|
106
|
+
};
|
package/types/version.d.ts
CHANGED
@@ -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.12.
|
5
|
+
* @version 0.12.21
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
7
7
|
*/
|
8
|
-
export declare const version = "0.12.
|
8
|
+
export declare const version = "0.12.21";
|