mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-11-06 04:46:53 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f5819e4361 | |||
| 16b9274ae1 | |||
| cf963efc6d | |||
| fd36c5120b | |||
| 4fab6c272b | |||
| 0edfb3936c | |||
| ed4bd392ff | |||
| 58e7b13652 | |||
| 0a4601bc1a | |||
| 3b2f2b547b |
17
CHANGELOG.md
17
CHANGELOG.md
@ -1,3 +1,20 @@
|
|||||||
|
## 6.5.1
|
||||||
|
|
||||||
|
* Fixed types for mouse events.
|
||||||
|
|
||||||
|
## 6.5.0
|
||||||
|
|
||||||
|
* Use more precise typings for all event params.
|
||||||
|
* Updated peer deps for `echarts` to `^5.4.1`.
|
||||||
|
|
||||||
|
## 6.4.1
|
||||||
|
|
||||||
|
* Improve typings for mouse event params.
|
||||||
|
|
||||||
|
## 6.4.0
|
||||||
|
|
||||||
|
* Delay the disposal of the ECharts instance to the moment the element is disconnected from the DOM if possible (#433).
|
||||||
|
|
||||||
## 6.3.3
|
## 6.3.3
|
||||||
|
|
||||||
* Make autoresize work for grid layout by default (#675).
|
* Make autoresize work for grid layout by default (#675).
|
||||||
|
|||||||
@ -26,7 +26,7 @@ To make `vue-echarts` work for _Vue 2_ (<2.7.0), you need to have `@vue/composit
|
|||||||
npm i -D @vue/composition-api
|
npm i -D @vue/composition-api
|
||||||
```
|
```
|
||||||
|
|
||||||
If you are using _NuxtJS_ on top of _Vue 2_ (<2.7.0), you'll also need `@nuxtjs/composition-api`:
|
If you are using _NuxtJS_ on top of _Vue 2_, you'll also need `@nuxtjs/composition-api`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm i -D @nuxtjs/composition-api
|
npm i -D @nuxtjs/composition-api
|
||||||
@ -227,7 +227,7 @@ Drop `<script>` inside your HTML file and access the component via `window.VueEC
|
|||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue@3.2.37"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue@3.2.37"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script>
|
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.3.2"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.1"></script>
|
||||||
```
|
```
|
||||||
<!-- vue3Scripts:end -->
|
<!-- vue3Scripts:end -->
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ app.component('v-chart', VueECharts)
|
|||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.5"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.5"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script>
|
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.3.2"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.1"></script>
|
||||||
```
|
```
|
||||||
<!-- vue2Scripts:end -->
|
<!-- vue2Scripts:end -->
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ $ npm install echarts vue-echarts
|
|||||||
npm i -D @vue/composition-api
|
npm i -D @vue/composition-api
|
||||||
```
|
```
|
||||||
|
|
||||||
如果你在使用基于 _Vue 2_(<2.7.0)的 _NuxtJS_,那么还需要安装 `@nuxtjs/composition-api`:
|
如果你在使用基于 _Vue 2_ 的 _NuxtJS_,那么还需要安装 `@nuxtjs/composition-api`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm i -D @nuxtjs/composition-api
|
npm i -D @nuxtjs/composition-api
|
||||||
@ -225,7 +225,7 @@ import "echarts";
|
|||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue@3.2.37"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue@3.2.37"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script>
|
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.3.2"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.1"></script>
|
||||||
```
|
```
|
||||||
<!-- vue3Scripts:end -->
|
<!-- vue3Scripts:end -->
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ app.component('v-chart', VueECharts)
|
|||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.5"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.5"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script>
|
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.3.2"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.1"></script>
|
||||||
```
|
```
|
||||||
<!-- vue2Scripts:end -->
|
<!-- vue2Scripts:end -->
|
||||||
|
|
||||||
|
|||||||
50
package.json
50
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-echarts",
|
"name": "vue-echarts",
|
||||||
"version": "6.3.3",
|
"version": "6.5.1",
|
||||||
"description": "Vue.js component for Apache ECharts.",
|
"description": "Vue.js component for Apache ECharts.",
|
||||||
"author": "GU Yiling <justice360@gmail.com>",
|
"author": "GU Yiling <justice360@gmail.com>",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -26,48 +26,48 @@
|
|||||||
"vue-demi": "^0.13.2"
|
"vue-demi": "^0.13.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.17.10",
|
"@babel/core": "^7.18.6",
|
||||||
"@rollup/plugin-node-resolve": "^11.1.1",
|
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
||||||
"@typescript-eslint/parser": "^4.15.1",
|
"@typescript-eslint/parser": "^4.33.0",
|
||||||
"@vue/cli-plugin-babel": "^5.0.4",
|
"@vue/cli-plugin-babel": "^5.0.7",
|
||||||
"@vue/cli-plugin-eslint": "^5.0.4",
|
"@vue/cli-plugin-eslint": "^5.0.7",
|
||||||
"@vue/cli-plugin-typescript": "^5.0.4",
|
"@vue/cli-plugin-typescript": "^5.0.7",
|
||||||
"@vue/cli-service": "^5.0.4",
|
"@vue/cli-service": "^5.0.7",
|
||||||
"@vue/compiler-sfc": "^3.2.33",
|
"@vue/compiler-sfc": "^3.2.37",
|
||||||
"@vue/composition-api": "^1.7.0",
|
"@vue/composition-api": "^1.7.0",
|
||||||
"@vue/eslint-config-prettier": "^6.0.0",
|
"@vue/eslint-config-prettier": "^6.0.0",
|
||||||
"@vue/eslint-config-typescript": "^10.0.0",
|
"@vue/eslint-config-typescript": "^10.0.0",
|
||||||
"comment-mark": "^1.0.0",
|
"comment-mark": "^1.1.1",
|
||||||
"core-js": "^3.23.0",
|
"core-js": "^3.23.3",
|
||||||
"echarts": "^5.3.2",
|
"echarts": "^5.4.1",
|
||||||
"echarts-liquidfill": "^3.1.0",
|
"echarts-liquidfill": "^3.1.0",
|
||||||
"eslint": "^7.20.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.4.1",
|
||||||
"eslint-plugin-vue": "^8.7.1",
|
"eslint-plugin-vue": "^8.7.1",
|
||||||
"esm": "^3.2.25",
|
"esm": "^3.2.25",
|
||||||
"postcss": "^8.3.0",
|
"postcss": "^8.4.14",
|
||||||
"postcss-loader": "^5.0.0",
|
"postcss-loader": "^5.3.0",
|
||||||
"postcss-nested": "^5.0.5",
|
"postcss-nested": "^5.0.6",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.7.1",
|
||||||
"qs": "^6.10.5",
|
"qs": "^6.11.0",
|
||||||
"raw-loader": "^4.0.2",
|
"raw-loader": "^4.0.2",
|
||||||
"resize-detector": "^0.3.0",
|
"resize-detector": "^0.3.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rollup": "^2.72.1",
|
"rollup": "^2.75.7",
|
||||||
"rollup-plugin-dts": "^4.2.1",
|
"rollup-plugin-dts": "^4.2.2",
|
||||||
"rollup-plugin-styles": "^4.0.0",
|
"rollup-plugin-styles": "^4.0.0",
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"rollup-plugin-ts": "^2.0.7",
|
"rollup-plugin-ts": "^2.0.7",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"typescript": "4.6.4",
|
"typescript": "4.6.4",
|
||||||
"vue": "^3.2.33",
|
"vue": "^3.2.37",
|
||||||
"vue2": "npm:vue@^2.7.14",
|
"vue2": "npm:vue@^2.7.14",
|
||||||
"webpack": "^5.72.1"
|
"webpack": "^5.73.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@vue/composition-api": "^1.0.5",
|
"@vue/composition-api": "^1.0.5",
|
||||||
"echarts": "^5.1.2",
|
"echarts": "^5.4.1",
|
||||||
"vue": "^2.6.12 || ^3.1.1"
|
"vue": "^2.6.12 || ^3.1.1"
|
||||||
},
|
},
|
||||||
"jsdelivr": "dist/index.umd.min.js",
|
"jsdelivr": "dist/index.umd.min.js",
|
||||||
|
|||||||
157
pnpm-lock.yaml
generated
157
pnpm-lock.yaml
generated
@ -1,45 +1,45 @@
|
|||||||
lockfileVersion: 5.4
|
lockfileVersion: 5.4
|
||||||
|
|
||||||
specifiers:
|
specifiers:
|
||||||
'@babel/core': ^7.17.10
|
'@babel/core': ^7.18.6
|
||||||
'@rollup/plugin-node-resolve': ^11.1.1
|
'@rollup/plugin-node-resolve': ^11.2.1
|
||||||
'@typescript-eslint/eslint-plugin': ^4.15.1
|
'@typescript-eslint/eslint-plugin': ^4.33.0
|
||||||
'@typescript-eslint/parser': ^4.15.1
|
'@typescript-eslint/parser': ^4.33.0
|
||||||
'@vue/cli-plugin-babel': ^5.0.4
|
'@vue/cli-plugin-babel': ^5.0.7
|
||||||
'@vue/cli-plugin-eslint': ^5.0.4
|
'@vue/cli-plugin-eslint': ^5.0.7
|
||||||
'@vue/cli-plugin-typescript': ^5.0.4
|
'@vue/cli-plugin-typescript': ^5.0.7
|
||||||
'@vue/cli-service': ^5.0.4
|
'@vue/cli-service': ^5.0.7
|
||||||
'@vue/compiler-sfc': ^3.2.33
|
'@vue/compiler-sfc': ^3.2.37
|
||||||
'@vue/composition-api': ^1.7.0
|
'@vue/composition-api': ^1.7.0
|
||||||
'@vue/eslint-config-prettier': ^6.0.0
|
'@vue/eslint-config-prettier': ^6.0.0
|
||||||
'@vue/eslint-config-typescript': ^10.0.0
|
'@vue/eslint-config-typescript': ^10.0.0
|
||||||
comment-mark: ^1.0.0
|
comment-mark: ^1.1.1
|
||||||
core-js: ^3.23.0
|
core-js: ^3.23.3
|
||||||
echarts: ^5.3.2
|
echarts: ^5.4.1
|
||||||
echarts-liquidfill: ^3.1.0
|
echarts-liquidfill: ^3.1.0
|
||||||
eslint: ^7.20.0
|
eslint: ^7.32.0
|
||||||
eslint-plugin-prettier: ^3.3.1
|
eslint-plugin-prettier: ^3.4.1
|
||||||
eslint-plugin-vue: ^8.7.1
|
eslint-plugin-vue: ^8.7.1
|
||||||
esm: ^3.2.25
|
esm: ^3.2.25
|
||||||
postcss: ^8.3.0
|
postcss: ^8.4.14
|
||||||
postcss-loader: ^5.0.0
|
postcss-loader: ^5.3.0
|
||||||
postcss-nested: ^5.0.5
|
postcss-nested: ^5.0.6
|
||||||
prettier: ^2.6.2
|
prettier: ^2.7.1
|
||||||
qs: ^6.10.5
|
qs: ^6.11.0
|
||||||
raw-loader: ^4.0.2
|
raw-loader: ^4.0.2
|
||||||
resize-detector: ^0.3.0
|
resize-detector: ^0.3.0
|
||||||
rimraf: ^3.0.2
|
rimraf: ^3.0.2
|
||||||
rollup: ^2.72.1
|
rollup: ^2.75.7
|
||||||
rollup-plugin-dts: ^4.2.1
|
rollup-plugin-dts: ^4.2.2
|
||||||
rollup-plugin-styles: ^4.0.0
|
rollup-plugin-styles: ^4.0.0
|
||||||
rollup-plugin-terser: ^7.0.2
|
rollup-plugin-terser: ^7.0.2
|
||||||
rollup-plugin-ts: ^2.0.7
|
rollup-plugin-ts: ^2.0.7
|
||||||
tslib: ^2.4.0
|
tslib: ^2.4.0
|
||||||
typescript: 4.6.4
|
typescript: 4.6.4
|
||||||
vue: ^3.2.33
|
vue: ^3.2.37
|
||||||
vue-demi: ^0.13.2
|
vue-demi: ^0.13.2
|
||||||
vue2: npm:vue@^2.7.14
|
vue2: npm:vue@^2.7.14
|
||||||
webpack: ^5.72.1
|
webpack: ^5.73.0
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
resize-detector: 0.3.0
|
resize-detector: 0.3.0
|
||||||
@ -60,8 +60,8 @@ devDependencies:
|
|||||||
'@vue/eslint-config-typescript': 10.0.0_yzev4ryi2uowr3tzgilgj3i2em
|
'@vue/eslint-config-typescript': 10.0.0_yzev4ryi2uowr3tzgilgj3i2em
|
||||||
comment-mark: 1.1.1
|
comment-mark: 1.1.1
|
||||||
core-js: 3.23.3
|
core-js: 3.23.3
|
||||||
echarts: 5.3.3
|
echarts: 5.4.1
|
||||||
echarts-liquidfill: 3.1.0_echarts@5.3.3
|
echarts-liquidfill: 3.1.0_echarts@5.4.1
|
||||||
eslint: 7.32.0
|
eslint: 7.32.0
|
||||||
eslint-plugin-prettier: 3.4.1_fqyzhpusvewbsl54pqqbxqaegm
|
eslint-plugin-prettier: 3.4.1_fqyzhpusvewbsl54pqqbxqaegm
|
||||||
eslint-plugin-vue: 8.7.1_eslint@7.32.0
|
eslint-plugin-vue: 8.7.1_eslint@7.32.0
|
||||||
@ -346,10 +346,20 @@ packages:
|
|||||||
'@babel/types': 7.18.7
|
'@babel/types': 7.18.7
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@babel/helper-string-parser/7.19.4:
|
||||||
|
resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==}
|
||||||
|
engines: {node: '>=6.9.0'}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@babel/helper-validator-identifier/7.18.6:
|
/@babel/helper-validator-identifier/7.18.6:
|
||||||
resolution: {integrity: sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==}
|
resolution: {integrity: sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
|
/@babel/helper-validator-identifier/7.19.1:
|
||||||
|
resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==}
|
||||||
|
engines: {node: '>=6.9.0'}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@babel/helper-validator-option/7.18.6:
|
/@babel/helper-validator-option/7.18.6:
|
||||||
resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==}
|
resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
@ -394,6 +404,14 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@babel/types': 7.18.7
|
'@babel/types': 7.18.7
|
||||||
|
|
||||||
|
/@babel/parser/7.20.7:
|
||||||
|
resolution: {integrity: sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg==}
|
||||||
|
engines: {node: '>=6.0.0'}
|
||||||
|
hasBin: true
|
||||||
|
dependencies:
|
||||||
|
'@babel/types': 7.20.7
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.18.6_@babel+core@7.18.6:
|
/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.18.6_@babel+core@7.18.6:
|
||||||
resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==}
|
resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
@ -1294,6 +1312,15 @@ packages:
|
|||||||
'@babel/helper-validator-identifier': 7.18.6
|
'@babel/helper-validator-identifier': 7.18.6
|
||||||
to-fast-properties: 2.0.0
|
to-fast-properties: 2.0.0
|
||||||
|
|
||||||
|
/@babel/types/7.20.7:
|
||||||
|
resolution: {integrity: sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==}
|
||||||
|
engines: {node: '>=6.9.0'}
|
||||||
|
dependencies:
|
||||||
|
'@babel/helper-string-parser': 7.19.4
|
||||||
|
'@babel/helper-validator-identifier': 7.19.1
|
||||||
|
to-fast-properties: 2.0.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@eslint/eslintrc/0.4.3:
|
/@eslint/eslintrc/0.4.3:
|
||||||
resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==}
|
resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==}
|
||||||
engines: {node: ^10.12.0 || >=12.0.0}
|
engines: {node: ^10.12.0 || >=12.0.0}
|
||||||
@ -2191,7 +2218,7 @@ packages:
|
|||||||
'@vue/cli-plugin-vuex': 5.0.7_@vue+cli-service@5.0.7
|
'@vue/cli-plugin-vuex': 5.0.7_@vue+cli-service@5.0.7
|
||||||
'@vue/cli-shared-utils': 5.0.7
|
'@vue/cli-shared-utils': 5.0.7
|
||||||
'@vue/component-compiler-utils': 3.3.0
|
'@vue/component-compiler-utils': 3.3.0
|
||||||
'@vue/vue-loader-v15': /vue-loader/15.10.0_bq3n4ba3oabtyijop4fktu76xe
|
'@vue/vue-loader-v15': /vue-loader/15.10.1_bq3n4ba3oabtyijop4fktu76xe
|
||||||
'@vue/web-component-wrapper': 1.3.0
|
'@vue/web-component-wrapper': 1.3.0
|
||||||
acorn: 8.7.1
|
acorn: 8.7.1
|
||||||
acorn-walk: 8.2.0
|
acorn-walk: 8.2.0
|
||||||
@ -2343,8 +2370,8 @@ packages:
|
|||||||
/@vue/compiler-sfc/2.7.14:
|
/@vue/compiler-sfc/2.7.14:
|
||||||
resolution: {integrity: sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==}
|
resolution: {integrity: sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/parser': 7.18.6
|
'@babel/parser': 7.20.7
|
||||||
postcss: 8.4.14
|
postcss: 8.4.21
|
||||||
source-map: 0.6.1
|
source-map: 0.6.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@ -2380,7 +2407,7 @@ packages:
|
|||||||
source-map: 0.6.1
|
source-map: 0.6.1
|
||||||
vue-template-es2015-compiler: 1.9.1
|
vue-template-es2015-compiler: 1.9.1
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
prettier: 2.7.1
|
prettier: 2.8.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- arc-templates
|
- arc-templates
|
||||||
- atpl
|
- atpl
|
||||||
@ -2837,7 +2864,7 @@ packages:
|
|||||||
postcss: ^8.1.0
|
postcss: ^8.1.0
|
||||||
dependencies:
|
dependencies:
|
||||||
browserslist: 4.21.1
|
browserslist: 4.21.1
|
||||||
caniuse-lite: 1.0.30001363
|
caniuse-lite: 1.0.30001442
|
||||||
fraction.js: 4.2.0
|
fraction.js: 4.2.0
|
||||||
normalize-range: 0.1.2
|
normalize-range: 0.1.2
|
||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
@ -2991,7 +3018,7 @@ packages:
|
|||||||
'@types/semver': 7.3.10
|
'@types/semver': 7.3.10
|
||||||
'@types/ua-parser-js': 0.7.36
|
'@types/ua-parser-js': 0.7.36
|
||||||
browserslist: 4.20.2
|
browserslist: 4.20.2
|
||||||
caniuse-lite: 1.0.30001363
|
caniuse-lite: 1.0.30001442
|
||||||
isbot: 3.4.5
|
isbot: 3.4.5
|
||||||
object-path: 0.11.8
|
object-path: 0.11.8
|
||||||
semver: 7.3.7
|
semver: 7.3.7
|
||||||
@ -3003,7 +3030,7 @@ packages:
|
|||||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dependencies:
|
dependencies:
|
||||||
caniuse-lite: 1.0.30001363
|
caniuse-lite: 1.0.30001442
|
||||||
electron-to-chromium: 1.4.180
|
electron-to-chromium: 1.4.180
|
||||||
escalade: 3.1.1
|
escalade: 3.1.1
|
||||||
node-releases: 2.0.5
|
node-releases: 2.0.5
|
||||||
@ -3015,7 +3042,7 @@ packages:
|
|||||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dependencies:
|
dependencies:
|
||||||
caniuse-lite: 1.0.30001363
|
caniuse-lite: 1.0.30001442
|
||||||
electron-to-chromium: 1.4.180
|
electron-to-chromium: 1.4.180
|
||||||
node-releases: 2.0.5
|
node-releases: 2.0.5
|
||||||
update-browserslist-db: 1.0.4_browserslist@4.21.1
|
update-browserslist-db: 1.0.4_browserslist@4.21.1
|
||||||
@ -3080,13 +3107,13 @@ packages:
|
|||||||
resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==}
|
resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==}
|
||||||
dependencies:
|
dependencies:
|
||||||
browserslist: 4.21.1
|
browserslist: 4.21.1
|
||||||
caniuse-lite: 1.0.30001363
|
caniuse-lite: 1.0.30001442
|
||||||
lodash.memoize: 4.1.2
|
lodash.memoize: 4.1.2
|
||||||
lodash.uniq: 4.5.0
|
lodash.uniq: 4.5.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/caniuse-lite/1.0.30001363:
|
/caniuse-lite/1.0.30001442:
|
||||||
resolution: {integrity: sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg==}
|
resolution: {integrity: sha512-239m03Pqy0hwxYPYR5JwOIxRJfLTWtle9FV8zosfV5pHg+/51uD4nxcUlM8+mWWGfwKtt8lJNHnD3cWw9VZ6ow==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/case-sensitive-paths-webpack-plugin/2.4.0:
|
/case-sensitive-paths-webpack-plugin/2.4.0:
|
||||||
@ -3740,8 +3767,8 @@ packages:
|
|||||||
/csstype/2.6.20:
|
/csstype/2.6.20:
|
||||||
resolution: {integrity: sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==}
|
resolution: {integrity: sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==}
|
||||||
|
|
||||||
/csstype/3.1.0:
|
/csstype/3.1.1:
|
||||||
resolution: {integrity: sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==}
|
resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/debug/2.6.9:
|
/debug/2.6.9:
|
||||||
@ -3925,19 +3952,19 @@ packages:
|
|||||||
engines: {node: '>=6.0.0'}
|
engines: {node: '>=6.0.0'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/echarts-liquidfill/3.1.0_echarts@5.3.3:
|
/echarts-liquidfill/3.1.0_echarts@5.4.1:
|
||||||
resolution: {integrity: sha512-5Dlqs/jTsdTUAsd+K5LPLLTgrbbNORUSBQyk8PSy1Mg2zgHDWm83FmvA4s0ooNepCJojFYRITTQ4GU1UUSKYLw==}
|
resolution: {integrity: sha512-5Dlqs/jTsdTUAsd+K5LPLLTgrbbNORUSBQyk8PSy1Mg2zgHDWm83FmvA4s0ooNepCJojFYRITTQ4GU1UUSKYLw==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
echarts: ^5.0.1
|
echarts: ^5.0.1
|
||||||
dependencies:
|
dependencies:
|
||||||
echarts: 5.3.3
|
echarts: 5.4.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/echarts/5.3.3:
|
/echarts/5.4.1:
|
||||||
resolution: {integrity: sha512-BRw2serInRwO5SIwRviZ6Xgm5Lb7irgz+sLiFMmy/HOaf4SQ+7oYqxKzRHAKp4xHQ05AuHw1xvoQWJjDQq/FGw==}
|
resolution: {integrity: sha512-9ltS3M2JB0w2EhcYjCdmtrJ+6haZcW6acBolMGIuf01Hql1yrIV01L1aRj7jsaaIULJslEP9Z3vKlEmnJaWJVQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib: 2.3.0
|
tslib: 2.3.0
|
||||||
zrender: 5.3.2
|
zrender: 5.4.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/ee-first/1.1.1:
|
/ee-first/1.1.1:
|
||||||
@ -5127,6 +5154,13 @@ packages:
|
|||||||
minimist: 1.2.6
|
minimist: 1.2.6
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/json5/1.0.2:
|
||||||
|
resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==}
|
||||||
|
hasBin: true
|
||||||
|
dependencies:
|
||||||
|
minimist: 1.2.6
|
||||||
|
dev: true
|
||||||
|
|
||||||
/json5/2.2.1:
|
/json5/2.2.1:
|
||||||
resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==}
|
resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
@ -5195,6 +5229,15 @@ packages:
|
|||||||
json5: 1.0.1
|
json5: 1.0.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/loader-utils/1.4.2:
|
||||||
|
resolution: {integrity: sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==}
|
||||||
|
engines: {node: '>=4.0.0'}
|
||||||
|
dependencies:
|
||||||
|
big.js: 5.2.2
|
||||||
|
emojis-list: 3.0.0
|
||||||
|
json5: 1.0.2
|
||||||
|
dev: true
|
||||||
|
|
||||||
/loader-utils/2.0.2:
|
/loader-utils/2.0.2:
|
||||||
resolution: {integrity: sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==}
|
resolution: {integrity: sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==}
|
||||||
engines: {node: '>=8.9.0'}
|
engines: {node: '>=8.9.0'}
|
||||||
@ -6208,6 +6251,15 @@ packages:
|
|||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
source-map-js: 1.0.2
|
source-map-js: 1.0.2
|
||||||
|
|
||||||
|
/postcss/8.4.21:
|
||||||
|
resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==}
|
||||||
|
engines: {node: ^10 || ^12 || >=14}
|
||||||
|
dependencies:
|
||||||
|
nanoid: 3.3.4
|
||||||
|
picocolors: 1.0.0
|
||||||
|
source-map-js: 1.0.2
|
||||||
|
dev: true
|
||||||
|
|
||||||
/prelude-ls/1.2.1:
|
/prelude-ls/1.2.1:
|
||||||
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
|
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
|
||||||
engines: {node: '>= 0.8.0'}
|
engines: {node: '>= 0.8.0'}
|
||||||
@ -6226,6 +6278,13 @@ packages:
|
|||||||
hasBin: true
|
hasBin: true
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/prettier/2.8.2:
|
||||||
|
resolution: {integrity: sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw==}
|
||||||
|
engines: {node: '>=10.13.0'}
|
||||||
|
hasBin: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
/pretty-error/4.0.0:
|
/pretty-error/4.0.0:
|
||||||
resolution: {integrity: sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==}
|
resolution: {integrity: sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -7400,8 +7459,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==}
|
resolution: {integrity: sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/vue-loader/15.10.0_bq3n4ba3oabtyijop4fktu76xe:
|
/vue-loader/15.10.1_bq3n4ba3oabtyijop4fktu76xe:
|
||||||
resolution: {integrity: sha512-VU6tuO8eKajrFeBzMssFUP9SvakEeeSi1BxdTH5o3+1yUyrldp8IERkSdXlMI2t4kxF2sqYUDsQY+WJBxzBmZg==}
|
resolution: {integrity: sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@vue/compiler-sfc': ^3.0.8
|
'@vue/compiler-sfc': ^3.0.8
|
||||||
cache-loader: '*'
|
cache-loader: '*'
|
||||||
@ -7420,7 +7479,7 @@ packages:
|
|||||||
'@vue/component-compiler-utils': 3.3.0
|
'@vue/component-compiler-utils': 3.3.0
|
||||||
css-loader: 6.7.1_webpack@5.73.0
|
css-loader: 6.7.1_webpack@5.73.0
|
||||||
hash-sum: 1.0.2
|
hash-sum: 1.0.2
|
||||||
loader-utils: 1.4.0
|
loader-utils: 1.4.2
|
||||||
vue-hot-reload-api: 2.3.4
|
vue-hot-reload-api: 2.3.4
|
||||||
vue-style-loader: 4.1.3
|
vue-style-loader: 4.1.3
|
||||||
webpack: 5.73.0
|
webpack: 5.73.0
|
||||||
@ -7506,7 +7565,7 @@ packages:
|
|||||||
resolution: {integrity: sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ==}
|
resolution: {integrity: sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@vue/compiler-sfc': 2.7.14
|
'@vue/compiler-sfc': 2.7.14
|
||||||
csstype: 3.1.0
|
csstype: 3.1.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/vue/3.2.37:
|
/vue/3.2.37:
|
||||||
@ -7831,8 +7890,8 @@ packages:
|
|||||||
strip-indent: 2.0.0
|
strip-indent: 2.0.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/zrender/5.3.2:
|
/zrender/5.4.1:
|
||||||
resolution: {integrity: sha512-8IiYdfwHj2rx0UeIGZGGU4WEVSDEdeVCaIg/fomejg1Xu6OifAL1GVzIPHg2D+MyUkbNgPWji90t0a8IDk+39w==}
|
resolution: {integrity: sha512-M4Z05BHWtajY2241EmMPHglDQAJ1UyHQcYsxDNzD9XLSkPDqMq4bB28v9Pb4mvHnVQ0GxyTklZ/69xCFP6RXBA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib: 2.3.0
|
tslib: 2.3.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
computed,
|
computed,
|
||||||
inject,
|
inject,
|
||||||
onMounted,
|
onMounted,
|
||||||
onUnmounted,
|
onBeforeUnmount,
|
||||||
h,
|
h,
|
||||||
nextTick,
|
nextTick,
|
||||||
watchEffect,
|
watchEffect,
|
||||||
@ -38,9 +38,10 @@ import {
|
|||||||
loadingProps
|
loadingProps
|
||||||
} from "./composables";
|
} from "./composables";
|
||||||
import { omitOn, unwrapInjected } from "./utils";
|
import { omitOn, unwrapInjected } from "./utils";
|
||||||
|
import { register, TAG_NAME, type EChartsElement } from "./wc";
|
||||||
import "./style.css";
|
import "./style.css";
|
||||||
|
|
||||||
const TAG_NAME = "x-vue-echarts";
|
const wcRegistered = register();
|
||||||
|
|
||||||
if (Vue2) {
|
if (Vue2) {
|
||||||
Vue2.config.ignoredElements.push(TAG_NAME);
|
Vue2.config.ignoredElements.push(TAG_NAME);
|
||||||
@ -67,10 +68,10 @@ export default defineComponent({
|
|||||||
...autoresizeProps,
|
...autoresizeProps,
|
||||||
...loadingProps
|
...loadingProps
|
||||||
},
|
},
|
||||||
emits: [] as unknown as Emits,
|
emits: {} as unknown as Emits,
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
setup(props, { attrs }) {
|
setup(props, { attrs }) {
|
||||||
const root = shallowRef<HTMLElement>();
|
const root = shallowRef<EChartsElement>();
|
||||||
const chart = shallowRef<EChartsType>();
|
const chart = shallowRef<EChartsType>();
|
||||||
const manualOption = shallowRef<Option>();
|
const manualOption = shallowRef<Option>();
|
||||||
const defaultTheme = inject(THEME_KEY, null);
|
const defaultTheme = inject(THEME_KEY, null);
|
||||||
@ -273,7 +274,17 @@ export default defineComponent({
|
|||||||
init();
|
init();
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(cleanup);
|
onBeforeUnmount(() => {
|
||||||
|
if (wcRegistered && root.value) {
|
||||||
|
// For registered web component, we can leverage the
|
||||||
|
// `disconnectedCallback` to dispose the chart instance
|
||||||
|
// so that we can delay the cleanup after exsiting leaving
|
||||||
|
// transition.
|
||||||
|
root.value.__dispose = cleanup;
|
||||||
|
} else {
|
||||||
|
cleanup();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
chart,
|
chart,
|
||||||
|
|||||||
74
src/types.ts
74
src/types.ts
@ -1,4 +1,9 @@
|
|||||||
import { init, type SetOptionOpts } from "echarts/core";
|
import {
|
||||||
|
init,
|
||||||
|
type SetOptionOpts,
|
||||||
|
type ECElementEvent,
|
||||||
|
type ElementEvent
|
||||||
|
} from "echarts/core";
|
||||||
import type { Ref } from "vue";
|
import type { Ref } from "vue";
|
||||||
|
|
||||||
export type Injection<T> = T | null | Ref<T | null> | { value: T | null };
|
export type Injection<T> = T | null | Ref<T | null> | { value: T | null };
|
||||||
@ -20,16 +25,31 @@ export type EventTarget = EChartsType | ZRenderType;
|
|||||||
type SetOptionType = EChartsType["setOption"];
|
type SetOptionType = EChartsType["setOption"];
|
||||||
export type Option = Parameters<SetOptionType>[0];
|
export type Option = Parameters<SetOptionType>[0];
|
||||||
|
|
||||||
type EChartsEventName =
|
type MouseEventName =
|
||||||
| "click"
|
| "click"
|
||||||
| "dblclick"
|
| "dblclick"
|
||||||
|
| "mouseout"
|
||||||
|
| "mouseover"
|
||||||
|
| "mouseup"
|
||||||
| "mousedown"
|
| "mousedown"
|
||||||
| "mousemove"
|
| "mousemove"
|
||||||
| "mouseup"
|
|
||||||
| "mouseover"
|
|
||||||
| "mouseout"
|
|
||||||
| "globalout"
|
|
||||||
| "contextmenu"
|
| "contextmenu"
|
||||||
|
| "globalout";
|
||||||
|
|
||||||
|
type ElementEventName =
|
||||||
|
| MouseEventName
|
||||||
|
| "mousewheel"
|
||||||
|
| "drag"
|
||||||
|
| "dragstart"
|
||||||
|
| "dragend"
|
||||||
|
| "dragenter"
|
||||||
|
| "dragleave"
|
||||||
|
| "dragover"
|
||||||
|
| "drop";
|
||||||
|
|
||||||
|
type ZRenderEventName = `zr:${ElementEventName}`;
|
||||||
|
|
||||||
|
type OtherEventName =
|
||||||
| "highlight"
|
| "highlight"
|
||||||
| "downplay"
|
| "downplay"
|
||||||
| "selectchanged"
|
| "selectchanged"
|
||||||
@ -56,28 +76,22 @@ type EChartsEventName =
|
|||||||
| "brush"
|
| "brush"
|
||||||
| "brushEnd"
|
| "brushEnd"
|
||||||
| "brushselected"
|
| "brushselected"
|
||||||
| "globalcursortaken"
|
| "globalcursortaken";
|
||||||
| "rendered"
|
|
||||||
| "finished";
|
type MouseEmits = {
|
||||||
type ZRenderEventName =
|
[key in MouseEventName]: (params: ECElementEvent) => boolean;
|
||||||
| "click"
|
|
||||||
| "dblclick"
|
|
||||||
| "mousewheel"
|
|
||||||
| "mouseout"
|
|
||||||
| "mouseover"
|
|
||||||
| "mouseup"
|
|
||||||
| "mousedown"
|
|
||||||
| "mousemove"
|
|
||||||
| "contextmenu"
|
|
||||||
| "drag"
|
|
||||||
| "dragstart"
|
|
||||||
| "dragend"
|
|
||||||
| "dragenter"
|
|
||||||
| "dragleave"
|
|
||||||
| "dragover"
|
|
||||||
| "drop"
|
|
||||||
| "globalout";
|
|
||||||
type EventName = EChartsEventName | `zr:${ZRenderEventName}`;
|
|
||||||
export type Emits = {
|
|
||||||
[key in EventName]: null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type ZRenderEmits = {
|
||||||
|
[key in ZRenderEventName]: (params: ElementEvent) => boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
type OtherEmits = {
|
||||||
|
[key in OtherEventName]: null;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type Emits = MouseEmits &
|
||||||
|
OtherEmits & {
|
||||||
|
rendered: (params: { elapsedTime: number }) => boolean;
|
||||||
|
finished: () => boolean;
|
||||||
|
} & ZRenderEmits;
|
||||||
|
|||||||
51
src/wc.ts
Normal file
51
src/wc.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
let registered: boolean | null = null;
|
||||||
|
|
||||||
|
export const TAG_NAME = "x-vue-echarts";
|
||||||
|
|
||||||
|
export interface EChartsElement extends HTMLElement {
|
||||||
|
__dispose: (() => void) | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function register(): boolean {
|
||||||
|
if (registered != null) {
|
||||||
|
return registered;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
typeof HTMLElement === "undefined" ||
|
||||||
|
typeof customElements === "undefined"
|
||||||
|
) {
|
||||||
|
return (registered = false);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Class definitions cannot be transpiled to ES5
|
||||||
|
// so we are doing a little trick here to ensure
|
||||||
|
// we are using native classes. As we use this as
|
||||||
|
// a progressive enhancement, it will be fine even
|
||||||
|
// if the browser doesn't support native classes.
|
||||||
|
const reg = new Function(
|
||||||
|
"tag",
|
||||||
|
`class EChartsElement extends HTMLElement {
|
||||||
|
__dispose = null;
|
||||||
|
|
||||||
|
disconnectedCallback() {
|
||||||
|
if (this.__dispose) {
|
||||||
|
this.__dispose();
|
||||||
|
this.__dispose = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (customElements.get(tag) == null) {
|
||||||
|
customElements.define(tag, EChartsElement);
|
||||||
|
}
|
||||||
|
`
|
||||||
|
);
|
||||||
|
reg(TAG_NAME);
|
||||||
|
} catch (e) {
|
||||||
|
return (registered = false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (registered = true);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user