feat!: move to esm and drop support for vue 2.6

This commit is contained in:
Justineo
2024-06-29 00:31:57 +08:00
committed by GU Yiling
parent 861674352b
commit 27c79b9012
20 changed files with 866 additions and 728 deletions

View File

@ -1,7 +0,0 @@
import "echarts";
import ECharts, * as exported from "./index";
export default {
...ECharts,
...exported
};

3
src/index.vue2.d.ts vendored
View File

@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/ban-types */
import type { DefineComponent } from "@vue/runtime-core";
import type { Ref } from "vue-demi";
import type { Ref, DefineComponent } from "vue-demi";
import type {
Option,
InitOptions,

63
src/index.vue2_7.d.ts vendored
View File

@ -1,63 +0,0 @@
/* eslint-disable @typescript-eslint/ban-types */
import type { Ref, DefineComponent } from "vue-demi";
import type {
Option,
InitOptions,
UpdateOptions,
EChartsType,
Emits
} from "./types";
declare const LOADING_OPTIONS_KEY = "ecLoadingOptions";
declare const THEME_KEY = "ecTheme";
declare const INIT_OPTIONS_KEY = "ecInitOptions";
declare const UPDATE_OPTIONS_KEY = "ecUpdateOptions";
declare type ChartProps = {
loading?: boolean;
loadingOptions?: Record<string, unknown>;
autoresize?: boolean;
option?: Option;
theme?: string | Record<string, unknown>;
initOptions?: InitOptions;
updateOptions?: UpdateOptions;
group?: string;
manualUpdate?: boolean;
};
type MethodNames =
| "getWidth"
| "getHeight"
| "getDom"
| "getOption"
| "resize"
| "dispatchAction"
| "convertToPixel"
| "convertFromPixel"
| "containPixel"
| "getDataURL"
| "getConnectedDataURL"
| "appendData"
| "clear"
| "isDisposed"
| "dispose"
| "setOption";
declare type ChartMethods = Pick<EChartsType, MethodNames>;
declare const Chart: DefineComponent<
ChartProps,
{
root: Ref<HTMLElement | undefined>;
chart: Ref<EChartsType | undefined>;
},
{},
{},
ChartMethods,
{},
{},
Emits
>;
export default Chart;
export { INIT_OPTIONS_KEY, LOADING_OPTIONS_KEY, THEME_KEY, UPDATE_OPTIONS_KEY };