@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 +10 -9
- package/dist/index.umd.js +3 -3
- package/package.json +4 -4
- package/types/components/Chart.d.ts +10 -14
- package/types/components/index.d.ts +0 -1
- package/types/hooks/useChart.d.ts +1 -2
- package/types/index.d.ts +0 -1
- package/types/install.d.ts +0 -1
- package/types/version.d.ts +2 -2
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.
|
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.
|
13
|
-
function w(
|
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(
|
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
|
-
|
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(
|
51
|
-
const { width: r, height:
|
50
|
+
setup(n) {
|
51
|
+
const { width: r, height: s, option: e } = v(n), t = o(), a = d(() => ({
|
52
52
|
width: r.value,
|
53
|
-
height:
|
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
|
-
|
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,
|
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.
|
5
|
+
* @version 0.8.137
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
7
|
-
*/const
|
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.
|
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.
|
13
|
-
"@vtj/utils": "~0.8.
|
12
|
+
"@vtj/icons": "~0.8.137",
|
13
|
+
"@vtj/utils": "~0.8.137"
|
14
14
|
},
|
15
15
|
"devDependencies": {
|
16
|
-
"@vtj/cli": "~0.8.
|
16
|
+
"@vtj/cli": "~0.8.32"
|
17
17
|
},
|
18
18
|
"files": [
|
19
19
|
"dist",
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import { PropType, DefineComponent,
|
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
|
-
|
23
|
-
|
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,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
package/types/install.d.ts
CHANGED
package/types/version.d.ts
CHANGED
@@ -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.
|
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.
|
8
|
+
export declare const version = "0.8.136";
|