nuxt-echarts 0.2.4 → 0.2.6

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 - present, Yue JIN
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 - present, Yue JIN
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -9,10 +9,6 @@
9
9
 
10
10
  Nuxt Module for Apache ECharts™
11
11
 
12
- > [!IMPORTANT]
13
- >
14
- > Nuxt ECharts SSR is based on [experimental `<NuxtIsland>`](https://nuxt.com/docs/api/components/nuxt-island). If you found any issue, design flaw, or have ideas to improve it, please open an [issue](https://github.com/kingyue737/nuxt-echarts/issues) or a [Discussion](https://github.com/kingyue737/nuxt-echarts/discussions).
15
-
16
12
  - [📖 &nbsp;Documentation](https://echarts.nuxt.dev)
17
13
 
18
14
  - [✨ &nbsp;Release Notes](/CHANGELOG.md)
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.2.0"
6
6
  },
7
- "version": "0.2.4",
7
+ "version": "0.2.6",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -18,6 +18,11 @@ const module = defineNuxtModule({
18
18
  nuxt.options.experimental.componentIslands = true;
19
19
  }
20
20
  const { resolve } = createResolver(import.meta.url);
21
+ nuxt.options.vite.optimizeDeps ??= {};
22
+ nuxt.options.vite.optimizeDeps.exclude ??= [];
23
+ if (!nuxt.options.vite.optimizeDeps.exclude.includes("echarts")) {
24
+ nuxt.options.vite.optimizeDeps.exclude.push("echarts");
25
+ }
21
26
  addPlugin(resolve("./runtime/plugin"));
22
27
  addComponentsDir({
23
28
  path: resolve("./runtime/components"),
@@ -94,9 +99,7 @@ const module = defineNuxtModule({
94
99
  const chartOptionNames = options.charts?.map(
95
100
  (name) => `${name.slice(0, -5)}SeriesOption`
96
101
  );
97
- const componentOptionNames = options.components?.map(
98
- (name) => `${name}Option`
99
- );
102
+ const componentOptionNames = options.components?.filter((name) => name !== "TransformComponent").map((name) => `${name}Option`);
100
103
  addTypeTemplate({
101
104
  filename: "types/nuxt-echarts.d.ts",
102
105
  getContents: () => [
@@ -1,32 +1,32 @@
1
- <script setup lang="ts">
2
- import * as echarts from 'echarts'
3
- import '#build/echarts.mjs'
4
- import { ref } from 'vue'
5
- import type { Option, InitOptions, Theme } from '../types'
6
-
7
- const props = defineProps<{
8
- option?: Option
9
- initOptions?: InitOptions
10
- theme?: Theme
11
- }>()
12
-
13
- const svgStr = ref('')
14
- const initOptions: InitOptions = echarts.util.merge(
15
- { renderer: 'svg', ssr: true } satisfies InitOptions,
16
- props.initOptions || {},
17
- )
18
- const chart = echarts.init(null, props.theme, initOptions)
19
- chart.setOption(props.option || {})
20
- svgStr.value = chart.renderToSVGString()
21
-
22
- chart.dispose()
23
-
24
- defineSlots<{ fallback: any }>()
25
- </script>
26
-
27
- <template>
28
- <div class="vue-echarts-container">
29
- <!--eslint-disable-next-line vue/no-v-html-->
30
- <div class="vue-echarts-inner" v-html="svgStr" />
31
- </div>
32
- </template>
1
+ <script setup lang="ts">
2
+ import * as echarts from 'echarts'
3
+ import '#build/echarts.mjs'
4
+ import { ref } from 'vue'
5
+ import type { Option, InitOptions, Theme } from '../types'
6
+
7
+ const props = defineProps<{
8
+ option?: Option
9
+ initOptions?: InitOptions
10
+ theme?: Theme
11
+ }>()
12
+
13
+ const svgStr = ref('')
14
+ const initOptions: InitOptions = echarts.util.merge(
15
+ { renderer: 'svg', ssr: true } satisfies InitOptions,
16
+ props.initOptions || {},
17
+ )
18
+ const chart = echarts.init(null, props.theme, initOptions)
19
+ chart.setOption(props.option || {})
20
+ svgStr.value = chart.renderToSVGString()
21
+
22
+ chart.dispose()
23
+
24
+ defineSlots<{ fallback: any }>()
25
+ </script>
26
+
27
+ <template>
28
+ <div class="vue-echarts-container">
29
+ <!--eslint-disable-next-line vue/no-v-html-->
30
+ <div class="vue-echarts-inner" v-html="svgStr" />
31
+ </div>
32
+ </template>
@@ -51,13 +51,13 @@ export default defineComponent({
51
51
  return { root };
52
52
  }
53
53
  });
54
- </script>
55
-
56
- <template>
57
- <VChartServer
58
- ref="root"
59
- :option="option"
60
- :init-options="initOptions"
61
- :theme="theme"
62
- />
63
- </template>
54
+ </script>
55
+
56
+ <template>
57
+ <VChartServer
58
+ ref="root"
59
+ :option="option"
60
+ :init-options="initOptions"
61
+ :theme="theme"
62
+ />
63
+ </template>
@@ -12,17 +12,121 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
12
12
  root: import("vue").Ref<({
13
13
  $: import("vue").ComponentInternalInstance;
14
14
  $data: {};
15
- $props: Partial<{}> & Omit<{
15
+ $props: {
16
16
  readonly option?: Option | undefined;
17
- readonly initOptions?: InitOptions | undefined;
18
17
  readonly theme?: Theme | undefined;
18
+ readonly initOptions?: InitOptions | undefined;
19
19
  readonly onError?: ((error: unknown) => any) | undefined;
20
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
20
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
21
21
  $attrs: {
22
22
  [x: string]: unknown;
23
23
  };
24
24
  $refs: {
25
25
  [x: string]: unknown;
26
+ } & {
27
+ root: ({
28
+ $: import("vue").ComponentInternalInstance;
29
+ $data: {};
30
+ $props: {
31
+ readonly option?: Option | undefined;
32
+ readonly initOptions?: InitOptions | undefined;
33
+ readonly theme?: Theme | undefined;
34
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
35
+ $attrs: {
36
+ [x: string]: unknown;
37
+ };
38
+ $refs: {
39
+ [x: string]: unknown;
40
+ };
41
+ $slots: Readonly<{
42
+ [name: string]: import("vue").Slot<any> | undefined;
43
+ }>;
44
+ $root: import("vue").ComponentPublicInstance | null;
45
+ $parent: import("vue").ComponentPublicInstance | null;
46
+ $host: Element | null;
47
+ $emit: (event: string, ...args: any[]) => void;
48
+ $el: HTMLDivElement;
49
+ $options: import("vue").ComponentOptionsBase<Readonly<{
50
+ option?: Option;
51
+ initOptions?: InitOptions;
52
+ theme?: Theme;
53
+ }> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
54
+ beforeCreate?: (() => void) | (() => void)[];
55
+ created?: (() => void) | (() => void)[];
56
+ beforeMount?: (() => void) | (() => void)[];
57
+ mounted?: (() => void) | (() => void)[];
58
+ beforeUpdate?: (() => void) | (() => void)[];
59
+ updated?: (() => void) | (() => void)[];
60
+ activated?: (() => void) | (() => void)[];
61
+ deactivated?: (() => void) | (() => void)[];
62
+ beforeDestroy?: (() => void) | (() => void)[];
63
+ beforeUnmount?: (() => void) | (() => void)[];
64
+ destroyed?: (() => void) | (() => void)[];
65
+ unmounted?: (() => void) | (() => void)[];
66
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
67
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
68
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
69
+ };
70
+ $forceUpdate: () => void;
71
+ $nextTick: typeof nextTick;
72
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
73
+ } & Readonly<{}> & Omit<Readonly<{
74
+ option?: Option;
75
+ initOptions?: InitOptions;
76
+ theme?: Theme;
77
+ }> & Readonly<{}>, never> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
78
+ $slots: {
79
+ fallback: any;
80
+ };
81
+ } & {
82
+ $: import("vue").ComponentInternalInstance;
83
+ $data: {};
84
+ $props: Partial<{}> & Omit<{}, never>;
85
+ $attrs: {
86
+ [x: string]: unknown;
87
+ };
88
+ $refs: {
89
+ [x: string]: unknown;
90
+ };
91
+ $slots: Readonly<{
92
+ fallback: import("vue").Slot<{
93
+ error: unknown;
94
+ }>;
95
+ }>;
96
+ $root: import("vue").ComponentPublicInstance | null;
97
+ $parent: import("vue").ComponentPublicInstance | null;
98
+ $host: Element | null;
99
+ $emit: (event: string, ...args: any[]) => void;
100
+ $el: any;
101
+ $options: import("vue").ComponentOptionsBase<{}, {
102
+ refresh: () => Promise<void>;
103
+ }, {}, {}, {}, {}, {}, {}, string, {}, {}, string, import("vue").SlotsType<{
104
+ fallback: {
105
+ error: unknown;
106
+ };
107
+ }>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
108
+ beforeCreate?: (() => void) | (() => void)[];
109
+ created?: (() => void) | (() => void)[];
110
+ beforeMount?: (() => void) | (() => void)[];
111
+ mounted?: (() => void) | (() => void)[];
112
+ beforeUpdate?: (() => void) | (() => void)[];
113
+ updated?: (() => void) | (() => void)[];
114
+ activated?: (() => void) | (() => void)[];
115
+ deactivated?: (() => void) | (() => void)[];
116
+ beforeDestroy?: (() => void) | (() => void)[];
117
+ beforeUnmount?: (() => void) | (() => void)[];
118
+ destroyed?: (() => void) | (() => void)[];
119
+ unmounted?: (() => void) | (() => void)[];
120
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
121
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
122
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
123
+ };
124
+ $forceUpdate: () => void;
125
+ $nextTick: typeof nextTick;
126
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
127
+ } & Readonly<{}> & Omit<{}, "refresh"> & import("vue").ShallowUnwrapRef<{
128
+ refresh: () => Promise<void>;
129
+ }>) | null;
26
130
  };
27
131
  $slots: Readonly<{
28
132
  [name: string]: import("vue").Slot<any> | undefined;
@@ -31,21 +135,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
31
135
  $parent: import("vue").ComponentPublicInstance | null;
32
136
  $host: Element | null;
33
137
  $emit: (event: "error", error: unknown) => void;
34
- $el: any;
35
- $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
36
- option: {
37
- type: PropType<import("echarts/core").EChartsCoreOption>;
38
- };
39
- theme: {
40
- type: PropType<Theme>;
41
- };
42
- initOptions: {
43
- type: PropType<import("echarts/core").EChartsInitOpts>;
44
- };
45
- }>> & Readonly<{
138
+ $el: HTMLDivElement;
139
+ $options: import("vue").ComponentOptionsBase<Readonly<{
140
+ option?: Option;
141
+ theme?: Theme;
142
+ initOptions?: InitOptions;
143
+ }> & Readonly<{
46
144
  onError?: ((error: unknown) => any) | undefined;
47
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
- error: (error: unknown) => void;
145
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
146
+ error: (error: unknown) => any;
49
147
  }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
50
148
  beforeCreate?: (() => void) | (() => void)[];
51
149
  created?: (() => void) | (() => void)[];
@@ -66,36 +164,134 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
66
164
  $forceUpdate: () => void;
67
165
  $nextTick: typeof nextTick;
68
166
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
69
- } & Readonly<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{
70
- option: {
71
- type: PropType<import("echarts/core").EChartsCoreOption>;
72
- };
73
- theme: {
74
- type: PropType<Theme>;
75
- };
76
- initOptions: {
77
- type: PropType<import("echarts/core").EChartsInitOpts>;
78
- };
79
- }>> & Readonly<{
167
+ } & Readonly<{}> & Omit<Readonly<{
168
+ option?: Option;
169
+ theme?: Theme;
170
+ initOptions?: InitOptions;
171
+ }> & Readonly<{
80
172
  onError?: ((error: unknown) => any) | undefined;
81
173
  }>, never> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
82
174
  $slots: {
83
- fallback?(_: {}): any;
175
+ fallback?: ((props: {}) => any) | undefined;
84
176
  };
85
177
  }) | null, ({
86
178
  $: import("vue").ComponentInternalInstance;
87
179
  $data: {};
88
- $props: Partial<{}> & Omit<{
180
+ $props: {
89
181
  readonly option?: Option | undefined;
90
- readonly initOptions?: InitOptions | undefined;
91
182
  readonly theme?: Theme | undefined;
183
+ readonly initOptions?: InitOptions | undefined;
92
184
  readonly onError?: ((error: unknown) => any) | undefined;
93
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
185
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
94
186
  $attrs: {
95
187
  [x: string]: unknown;
96
188
  };
97
189
  $refs: {
98
190
  [x: string]: unknown;
191
+ } & {
192
+ root: ({
193
+ $: import("vue").ComponentInternalInstance;
194
+ $data: {};
195
+ $props: {
196
+ readonly option?: Option | undefined;
197
+ readonly initOptions?: InitOptions | undefined;
198
+ readonly theme?: Theme | undefined;
199
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
200
+ $attrs: {
201
+ [x: string]: unknown;
202
+ };
203
+ $refs: {
204
+ [x: string]: unknown;
205
+ };
206
+ $slots: Readonly<{
207
+ [name: string]: import("vue").Slot<any> | undefined;
208
+ }>;
209
+ $root: import("vue").ComponentPublicInstance | null;
210
+ $parent: import("vue").ComponentPublicInstance | null;
211
+ $host: Element | null;
212
+ $emit: (event: string, ...args: any[]) => void;
213
+ $el: HTMLDivElement;
214
+ $options: import("vue").ComponentOptionsBase<Readonly<{
215
+ option?: Option;
216
+ initOptions?: InitOptions;
217
+ theme?: Theme;
218
+ }> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
219
+ beforeCreate?: (() => void) | (() => void)[];
220
+ created?: (() => void) | (() => void)[];
221
+ beforeMount?: (() => void) | (() => void)[];
222
+ mounted?: (() => void) | (() => void)[];
223
+ beforeUpdate?: (() => void) | (() => void)[];
224
+ updated?: (() => void) | (() => void)[];
225
+ activated?: (() => void) | (() => void)[];
226
+ deactivated?: (() => void) | (() => void)[];
227
+ beforeDestroy?: (() => void) | (() => void)[];
228
+ beforeUnmount?: (() => void) | (() => void)[];
229
+ destroyed?: (() => void) | (() => void)[];
230
+ unmounted?: (() => void) | (() => void)[];
231
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
232
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
233
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
234
+ };
235
+ $forceUpdate: () => void;
236
+ $nextTick: typeof nextTick;
237
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
238
+ } & Readonly<{}> & Omit<Readonly<{
239
+ option?: Option;
240
+ initOptions?: InitOptions;
241
+ theme?: Theme;
242
+ }> & Readonly<{}>, never> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
243
+ $slots: {
244
+ fallback: any;
245
+ };
246
+ } & {
247
+ $: import("vue").ComponentInternalInstance;
248
+ $data: {};
249
+ $props: Partial<{}> & Omit<{}, never>;
250
+ $attrs: {
251
+ [x: string]: unknown;
252
+ };
253
+ $refs: {
254
+ [x: string]: unknown;
255
+ };
256
+ $slots: Readonly<{
257
+ fallback: import("vue").Slot<{
258
+ error: unknown;
259
+ }>;
260
+ }>;
261
+ $root: import("vue").ComponentPublicInstance | null;
262
+ $parent: import("vue").ComponentPublicInstance | null;
263
+ $host: Element | null;
264
+ $emit: (event: string, ...args: any[]) => void;
265
+ $el: any;
266
+ $options: import("vue").ComponentOptionsBase<{}, {
267
+ refresh: () => Promise<void>;
268
+ }, {}, {}, {}, {}, {}, {}, string, {}, {}, string, import("vue").SlotsType<{
269
+ fallback: {
270
+ error: unknown;
271
+ };
272
+ }>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
273
+ beforeCreate?: (() => void) | (() => void)[];
274
+ created?: (() => void) | (() => void)[];
275
+ beforeMount?: (() => void) | (() => void)[];
276
+ mounted?: (() => void) | (() => void)[];
277
+ beforeUpdate?: (() => void) | (() => void)[];
278
+ updated?: (() => void) | (() => void)[];
279
+ activated?: (() => void) | (() => void)[];
280
+ deactivated?: (() => void) | (() => void)[];
281
+ beforeDestroy?: (() => void) | (() => void)[];
282
+ beforeUnmount?: (() => void) | (() => void)[];
283
+ destroyed?: (() => void) | (() => void)[];
284
+ unmounted?: (() => void) | (() => void)[];
285
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
286
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
287
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
288
+ };
289
+ $forceUpdate: () => void;
290
+ $nextTick: typeof nextTick;
291
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
292
+ } & Readonly<{}> & Omit<{}, "refresh"> & import("vue").ShallowUnwrapRef<{
293
+ refresh: () => Promise<void>;
294
+ }>) | null;
99
295
  };
100
296
  $slots: Readonly<{
101
297
  [name: string]: import("vue").Slot<any> | undefined;
@@ -104,21 +300,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
104
300
  $parent: import("vue").ComponentPublicInstance | null;
105
301
  $host: Element | null;
106
302
  $emit: (event: "error", error: unknown) => void;
107
- $el: any;
108
- $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
109
- option: {
110
- type: PropType<import("echarts/core").EChartsCoreOption>;
111
- };
112
- theme: {
113
- type: PropType<Theme>;
114
- };
115
- initOptions: {
116
- type: PropType<import("echarts/core").EChartsInitOpts>;
117
- };
118
- }>> & Readonly<{
303
+ $el: HTMLDivElement;
304
+ $options: import("vue").ComponentOptionsBase<Readonly<{
305
+ option?: Option;
306
+ theme?: Theme;
307
+ initOptions?: InitOptions;
308
+ }> & Readonly<{
119
309
  onError?: ((error: unknown) => any) | undefined;
120
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
121
- error: (error: unknown) => void;
310
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
311
+ error: (error: unknown) => any;
122
312
  }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
123
313
  beforeCreate?: (() => void) | (() => void)[];
124
314
  created?: (() => void) | (() => void)[];
@@ -139,21 +329,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
139
329
  $forceUpdate: () => void;
140
330
  $nextTick: typeof nextTick;
141
331
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
142
- } & Readonly<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{
143
- option: {
144
- type: PropType<import("echarts/core").EChartsCoreOption>;
145
- };
146
- theme: {
147
- type: PropType<Theme>;
148
- };
149
- initOptions: {
150
- type: PropType<import("echarts/core").EChartsInitOpts>;
151
- };
152
- }>> & Readonly<{
332
+ } & Readonly<{}> & Omit<Readonly<{
333
+ option?: Option;
334
+ theme?: Theme;
335
+ initOptions?: InitOptions;
336
+ }> & Readonly<{
153
337
  onError?: ((error: unknown) => any) | undefined;
154
338
  }>, never> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
155
339
  $slots: {
156
- fallback?(_: {}): any;
340
+ fallback?: ((props: {}) => any) | undefined;
157
341
  };
158
342
  }) | null>;
159
343
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<ECSSREvent, ECSSRHandler>, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -168,12 +352,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
168
352
  onMouseover?: ((params: ECSSRClientEventParams) => any) | undefined;
169
353
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
170
354
  export default _default;
171
- declare module 'vue' {
172
- interface GlobalComponents {
173
- }
174
- interface GlobalDirectives {
175
- }
176
- }
177
355
  declare global {
178
356
  const __VLS_intrinsicElements: __VLS_IntrinsicElements;
179
357
  const __VLS_directiveBindingRestFields: {
@@ -183,6 +361,7 @@ declare global {
183
361
  dir: any;
184
362
  };
185
363
  const __VLS_unref: typeof import('vue').unref;
364
+ const __VLS_placeholder: any;
186
365
  const __VLS_nativeElements: {
187
366
  a: HTMLAnchorElement;
188
367
  abbr: HTMLElement;
@@ -358,17 +537,19 @@ declare global {
358
537
  };
359
538
  type __VLS_IntrinsicElements = import('vue/jsx-runtime').JSX.IntrinsicElements;
360
539
  type __VLS_Element = import('vue/jsx-runtime').JSX.Element;
361
- type __VLS_GlobalComponents = import('vue').GlobalComponents & Pick<typeof import('vue'), 'Transition' | 'TransitionGroup' | 'KeepAlive' | 'Suspense' | 'Teleport'>;
540
+ type __VLS_GlobalComponents = import('vue').GlobalComponents;
362
541
  type __VLS_GlobalDirectives = import('vue').GlobalDirectives;
363
542
  type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
364
543
  type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
365
544
  type __VLS_unknownDirective = (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
366
- type __VLS_WithComponent<N0 extends string, LocalComponents, N1 extends string, N2 extends string, N3 extends string> = N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
545
+ type __VLS_WithComponent<N0 extends string, LocalComponents, Self, N1 extends string, N2 extends string, N3 extends string> = N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
367
546
  [K in N0]: LocalComponents[N1];
368
547
  } : N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
369
548
  [K in N0]: LocalComponents[N2];
370
549
  } : N3 extends keyof LocalComponents ? N3 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
371
550
  [K in N0]: LocalComponents[N3];
551
+ } : Self extends object ? {
552
+ [K in N0]: Self;
372
553
  } : N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
373
554
  [K in N0]: __VLS_GlobalComponents[N1];
374
555
  } : N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
@@ -384,6 +565,11 @@ declare global {
384
565
  };
385
566
  } ? NonNullable<P> : never : T extends (props: infer P, ...args: any) => any ? P : {};
386
567
  type __VLS_IsFunction<T, K> = K extends keyof T ? __VLS_IsAny<T[K]> extends false ? unknown extends T[K] ? false : true : false : false;
568
+ type __VLS_NormalizeComponentEvent<Props, Events, onEvent extends keyof Props, Event extends keyof Events, CamelizedEvent extends keyof Events> = (__VLS_IsFunction<Props, onEvent> extends true ? Props : __VLS_IsFunction<Events, Event> extends true ? {
569
+ [K in onEvent]?: Events[Event];
570
+ } : __VLS_IsFunction<Events, CamelizedEvent> extends true ? {
571
+ [K in onEvent]?: Events[CamelizedEvent];
572
+ } : Props) & Record<string, unknown>;
387
573
  type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never;
388
574
  type __VLS_OverloadUnionInner<T, U = unknown> = U & T extends (...args: infer A) => infer R ? U extends T ? never : __VLS_OverloadUnionInner<T, Pick<T, keyof T> & U & ((...args: A) => R)> | ((...args: A) => R) : never;
389
575
  type __VLS_OverloadUnion<T> = Exclude<__VLS_OverloadUnionInner<(() => never) & T>, T extends () => never ? never : () => never>;
@@ -401,12 +587,14 @@ declare global {
401
587
  type __VLS_PickFunctionalComponentCtx<T, K> = NonNullable<__VLS_PickNotAny<'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
402
588
  __ctx?: infer Ctx;
403
589
  } ? Ctx : never : any, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any>>;
590
+ type __VLS_OmitStringIndex<T> = {
591
+ [K in keyof T as string extends K ? never : K]: T[K];
592
+ };
404
593
  type __VLS_UseTemplateRef<T> = Readonly<import('vue').ShallowRef<T | null>>;
405
- function __VLS_getVForSourceType(source: number): [number, number, number][];
406
- function __VLS_getVForSourceType(source: string): [string, number, number][];
594
+ function __VLS_getVForSourceType(source: number): [number, number][];
595
+ function __VLS_getVForSourceType(source: string): [string, number][];
407
596
  function __VLS_getVForSourceType<T extends any[]>(source: T): [
408
597
  item: T[number],
409
- key: number,
410
598
  index: number
411
599
  ][];
412
600
  function __VLS_getVForSourceType<T extends {
@@ -415,8 +603,7 @@ declare global {
415
603
  item: T extends {
416
604
  [Symbol.iterator](): Iterator<infer T1>;
417
605
  } ? T1 : never,
418
- key: number,
419
- index: undefined
606
+ index: number
420
607
  ][];
421
608
  function __VLS_getVForSourceType<T extends number | {
422
609
  [Symbol.iterator](): Iterator<any>;
@@ -424,8 +611,7 @@ declare global {
424
611
  item: number | (Exclude<T, number> extends {
425
612
  [Symbol.iterator](): Iterator<infer T1>;
426
613
  } ? T1 : never),
427
- key: number,
428
- index: undefined
614
+ index: number
429
615
  ][];
430
616
  function __VLS_getVForSourceType<T>(source: T): [
431
617
  item: T[keyof T],
@@ -439,7 +625,6 @@ declare global {
439
625
  function __VLS_makeOptional<T>(t: T): {
440
626
  [K in keyof T]?: T[K];
441
627
  };
442
- function __VLS_nonNullable<T>(t: T): T extends null | undefined ? never : T;
443
628
  function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K): T extends new (...args: any) => any ? (props: (K extends {
444
629
  $props: infer Props;
445
630
  } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & {
@@ -466,7 +651,7 @@ declare global {
466
651
  props?: {} & Record<string, unknown>;
467
652
  };
468
653
  };
469
- function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T & Record<string, unknown>) => void;
654
+ function __VLS_asFunctionalElement<T>(tag: T, endTag?: T): (_: T & Record<string, unknown>) => void;
470
655
  function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
471
656
  function __VLS_normalizeSlot<S>(s: S): S extends () => infer R ? (props: {}) => R : S;
472
657
  function __VLS_tryAsConstant<const T>(t: T): T;
@@ -1,48 +1,48 @@
1
- <script setup lang="ts">
2
- import { computed, unref, inject, ref } from 'vue'
3
- import type { InitOptions, Option, Theme } from '../types'
4
- import { THEME_KEY, INIT_OPTIONS_KEY } from '../utils/injection'
5
- import type { VChartIsland } from '#components'
6
-
7
- const defaultTheme = inject(THEME_KEY, null)
8
- const defaultInitOptions = inject(INIT_OPTIONS_KEY, null)
9
-
10
- const props = defineProps<{
11
- option?: Option
12
- theme?: Theme
13
- initOptions?: InitOptions
14
- }>()
15
- const emits = defineEmits<{ (event: 'error', error: unknown): void }>()
16
-
17
- const realTheme = computed(() => props.theme || unref(defaultTheme) || {})
18
- const realInitOptions = computed(
19
- () => props.initOptions || unref(defaultInitOptions) || {},
20
- )
21
- function onError(e: unknown) {
22
- // https://github.com/nuxt/nuxt/issues/27491
23
- if (
24
- e instanceof TypeError &&
25
- e.message === "Cannot read properties of undefined (reading 'link')"
26
- ) {
27
- root.value?.refresh()
28
- }
29
- emits('error', e)
30
- }
31
- const root = ref<InstanceType<typeof VChartIsland> | null>(null)
32
- </script>
33
-
34
- <template>
35
- <div class="vue-echarts-server">
36
- <VChartIsland
37
- ref="root"
38
- :theme="realTheme"
39
- :option="option"
40
- :init-options="realInitOptions"
41
- @error="onError"
42
- >
43
- <template #fallback>
44
- <slot name="fallback" />
45
- </template>
46
- </VChartIsland>
47
- </div>
48
- </template>
1
+ <script setup lang="ts">
2
+ import { computed, unref, inject, ref } from 'vue'
3
+ import type { InitOptions, Option, Theme } from '../types'
4
+ import { THEME_KEY, INIT_OPTIONS_KEY } from '../utils/injection'
5
+ import type { VChartIsland } from '#components'
6
+
7
+ const defaultTheme = inject(THEME_KEY, null)
8
+ const defaultInitOptions = inject(INIT_OPTIONS_KEY, null)
9
+
10
+ const props = defineProps<{
11
+ option?: Option
12
+ theme?: Theme
13
+ initOptions?: InitOptions
14
+ }>()
15
+ const emits = defineEmits<{ (event: 'error', error: unknown): void }>()
16
+
17
+ const realTheme = computed(() => props.theme || unref(defaultTheme) || {})
18
+ const realInitOptions = computed(
19
+ () => props.initOptions || unref(defaultInitOptions) || {},
20
+ )
21
+ function onError(e: unknown) {
22
+ // https://github.com/nuxt/nuxt/issues/27491
23
+ if (
24
+ e instanceof TypeError &&
25
+ e.message === "Cannot read properties of undefined (reading 'link')"
26
+ ) {
27
+ root.value?.refresh()
28
+ }
29
+ emits('error', e)
30
+ }
31
+ const root = ref<InstanceType<typeof VChartIsland> | null>(null)
32
+ </script>
33
+
34
+ <template>
35
+ <div class="vue-echarts-server">
36
+ <VChartIsland
37
+ ref="root"
38
+ :theme="realTheme"
39
+ :option="option"
40
+ :init-options="realInitOptions"
41
+ @error="onError"
42
+ >
43
+ <template #fallback>
44
+ <slot name="fallback" />
45
+ </template>
46
+ </VChartIsland>
47
+ </div>
48
+ </template>
@@ -1,2 +1,2 @@
1
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
1
+ declare const _default: any;
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-echarts",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Nuxt Module for Apache ECharts™",
5
5
  "keywords": [
6
6
  "vue",
@@ -14,7 +14,7 @@
14
14
  "repository": "kingyue737/nuxt-echarts",
15
15
  "license": "MIT",
16
16
  "type": "module",
17
- "packageManager": "pnpm@9.11.0",
17
+ "packageManager": "pnpm@10.4.1",
18
18
  "exports": {
19
19
  ".": {
20
20
  "types": "./dist/types.d.ts",
@@ -45,30 +45,36 @@
45
45
  "test:types": "vue-tsc --noEmit && nuxi typecheck playground"
46
46
  },
47
47
  "dependencies": {
48
- "@nuxt/kit": "^3.14.159",
49
- "echarts": "^5.5.1"
48
+ "@nuxt/kit": "^3.15.4",
49
+ "echarts": "^5.6.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@nuxt/devtools": "^1.6.0",
53
- "@nuxt/eslint-config": "^0.6.1",
52
+ "@nuxt/eslint-config": "^1.1.0",
54
53
  "@nuxt/module-builder": "^0.8.4",
55
- "@nuxt/schema": "^3.14.159",
56
- "@nuxt/test-utils": "^3.14.4",
57
- "@types/node": "^22.9.0",
54
+ "@nuxt/schema": "^3.15.4",
55
+ "@nuxt/test-utils": "^3.17.0",
56
+ "@types/node": "^22.13.5",
58
57
  "changelogen": "^0.5.7",
59
- "eslint": "^9.14.0",
60
- "nuxt": "^3.14.159",
61
- "prettier": "^3.3.3",
62
- "prettier-plugin-tailwindcss": "^0.6.8",
63
- "typescript": "^5.6.3",
64
- "vite": "^5.4.10",
65
- "vitest": "^2.1.4",
66
- "vue-tsc": "^2.1.10"
58
+ "eslint": "^9.21.0",
59
+ "nuxt": "^3.15.4",
60
+ "prettier": "^3.5.2",
61
+ "prettier-plugin-tailwindcss": "^0.6.11",
62
+ "typescript": "~5.6",
63
+ "vite": "^6.1.1",
64
+ "vitest": "^3.0.6",
65
+ "vue-tsc": "^2.2.2"
67
66
  },
68
67
  "peerDependencies": {
69
68
  "echarts": "^5.5.1"
70
69
  },
70
+ "pnpm": {
71
+ "overrides": {
72
+ "vite-plugin-checker": "^0.9.0",
73
+ "@vercel/nft": "^0.29.2",
74
+ "@tailwindcss/vite": "4.0.7"
75
+ }
76
+ },
71
77
  "stackblitz": {
72
78
  "startCommand": "pnpm run dev:prepare && pnpm run dev"
73
79
  }
74
- }
80
+ }