This commit is contained in:
2025-11-03 17:03:57 +08:00
commit 7a04b85667
16804 changed files with 2492292 additions and 0 deletions

21
frontend/node_modules/vue-echarts/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016-present GU Yiling & ECOMFE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

523
frontend/node_modules/vue-echarts/README.md generated vendored Normal file
View File

@@ -0,0 +1,523 @@
<h1 align="center">Vue-ECharts</h1>
<p align="center">Vue.js <sup>(v2/v3)</sup> component for Apache ECharts™ <sup>(v5)</sup>.</p>
<p align="center"><a href="https://vue-echarts.dev/">View Demo →</a></p>
<p align="center"><a href="https:///pr.new/ecomfe/vue-echarts"><img alt="Open in Codeflow" src="https://developer.stackblitz.com/img/open_in_codeflow.svg" height="28"/></a> <a href="https://codesandbox.io/p/github/ecomfe/vue-echarts"><img alt="Edit in CodeSandbox" src="https://assets.codesandbox.io/github/button-edit-lime.svg" height="28"/></a></p>
> [!IMPORTANT]
> We have released an [import code generator](https://vue-echarts.dev/#codegen) that can generate precise import code by pasting the `option` code.
>
> ![](https://github.com/ecomfe/vue-echarts/assets/1726061/f9c38a06-3422-4f0e-ab8c-f242d9aea9aa)
>
> [Try it →](https://vue-echarts.dev/#codegen)
---
<h2>💡 Heads up 💡 <a href="./README.zh-Hans.md"><img src="https://img.shields.io/badge/%F0%9F%87%A8%F0%9F%87%B3-%E4%B8%AD%E6%96%87%E7%89%88-white?labelColor=white" alt="前往中文版" align="right" height="24"/></a></h2>
If you are migrating from `vue-echarts` ≤ 5, you should read the _[Migration to v6](#migration-to-v6)_ section before you update to v6.
Not ready yet? Read documentation for older versions [here →](https://github.com/ecomfe/vue-echarts/tree/5.x)
## Installation & Usage
### npm & ESM
```sh
npm i echarts vue-echarts
```
To make `vue-echarts` work for _Vue 2_ (<2.7.0), you need to have `@vue/composition-api` installed (`@vue/runtime-core` for TypeScript support):
```sh
npm i @vue/composition-api
npm i @vue/runtime-core # for TypeScript support
```
If you are using _NuxtJS_ on top of _Vue 2_, you'll need `@nuxtjs/composition-api`:
```sh
npm i @nuxtjs/composition-api
```
And then add `'@nuxtjs/composition-api/module'` in the `buildModules` option in your `nuxt.config.js`.
#### Example
<details>
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-vue-3?file=src%2FApp.vue">Demo →</a></summary>
```vue
<template>
<v-chart class="chart" :option="option" />
</template>
<script setup>
import { use } from "echarts/core";
import { CanvasRenderer } from "echarts/renderers";
import { PieChart } from "echarts/charts";
import {
TitleComponent,
TooltipComponent,
LegendComponent
} from "echarts/components";
import VChart, { THEME_KEY } from "vue-echarts";
import { ref, provide } from "vue";
use([
CanvasRenderer,
PieChart,
TitleComponent,
TooltipComponent,
LegendComponent
]);
provide(THEME_KEY, "dark");
const option = ref({
title: {
text: "Traffic Sources",
left: "center"
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: "vertical",
left: "left",
data: ["Direct", "Email", "Ad Networks", "Video Ads", "Search Engines"]
},
series: [
{
name: "Traffic Sources",
type: "pie",
radius: "55%",
center: ["50%", "60%"],
data: [
{ value: 335, name: "Direct" },
{ value: 310, name: "Email" },
{ value: 234, name: "Ad Networks" },
{ value: 135, name: "Video Ads" },
{ value: 1548, name: "Search Engines" }
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
}
}
]
});
</script>
<style scoped>
.chart {
height: 400px;
}
</style>
```
</details>
<details>
<summary>Vue 2 <a href="https://stackblitz.com/edit/vue-echarts-vue-2?file=src%2FApp.vue">Demo →</a></summary>
```vue
<template>
<v-chart class="chart" :option="option" />
</template>
<script>
import { use } from "echarts/core";
import { CanvasRenderer } from "echarts/renderers";
import { PieChart } from "echarts/charts";
import {
TitleComponent,
TooltipComponent,
LegendComponent
} from "echarts/components";
import VChart, { THEME_KEY } from "vue-echarts";
use([
CanvasRenderer,
PieChart,
TitleComponent,
TooltipComponent,
LegendComponent
]);
export default {
name: "HelloWorld",
components: {
VChart
},
provide: {
[THEME_KEY]: "dark"
},
data() {
return {
option: {
title: {
text: "Traffic Sources",
left: "center"
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: "vertical",
left: "left",
data: [
"Direct",
"Email",
"Ad Networks",
"Video Ads",
"Search Engines"
]
},
series: [
{
name: "Traffic Sources",
type: "pie",
radius: "55%",
center: ["50%", "60%"],
data: [
{ value: 335, name: "Direct" },
{ value: 310, name: "Email" },
{ value: 234, name: "Ad Networks" },
{ value: 135, name: "Video Ads" },
{ value: 1548, name: "Search Engines" }
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
}
}
]
}
};
}
};
</script>
<style scoped>
.chart {
height: 400px;
}
</style>
```
</details>
> [!IMPORTANT]
> We encourage manually importing components and charts from ECharts for smaller bundle size. We've built an [import code generator](https://vue-echarts.dev/#codegen) to help you with that. You can just paste in your `option` code and we'll generate the precise import code for you.
>
> [Try it →](https://vue-echarts.dev/#codegen)
But if you really want to import the whole ECharts bundle without having to import modules manually, just add this in your code:
```js
import "echarts";
```
### CDN & Global variable
Drop `<script>` inside your HTML file and access the component via `window.VueECharts`.
<details>
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-vue-3-global?file=index.html">Demo →</a></summary>
<!-- vue3Scripts:start -->
```html
<script src="https://cdn.jsdelivr.net/npm/vue@3.4.23"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
```
<!-- vue3Scripts:end -->
```js
const app = Vue.createApp(...)
// register globally (or you can do it locally)
app.component('v-chart', VueECharts)
```
</details>
<details>
<summary>Vue 2 <a href="https://stackblitz.com/edit/vue-echarts-vue-2-global?file=index.html">Demo →</a></summary>
<!-- vue2Scripts:start -->
```html
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
```
<!-- vue2Scripts:end -->
```js
// register globally (or you can do it locally)
Vue.component("v-chart", VueECharts);
```
</details>
See more examples [here](https://github.com/ecomfe/vue-echarts/tree/main/src/demo).
### Props
- `init-options: object`
Optional chart init configurations. See `echarts.init`'s `opts` parameter [here →](https://echarts.apache.org/en/api.html#echarts.init)
Injection key: `INIT_OPTIONS_KEY`.
- `theme: string | object`
Theme to be applied. See `echarts.init`'s `theme` parameter [here →](https://echarts.apache.org/en/api.html#echarts.init)
Injection key: `THEME_KEY`.
- `option: object`
ECharts' universal interface. Modifying this prop will trigger ECharts' `setOption` method. Read more [here →](https://echarts.apache.org/en/option.html)
> 💡 When `update-options` is not specified, `notMerge: false` will be specified by default when the `setOption` method is called if the `option` object is modified directly and the reference remains unchanged; otherwise, if a new reference is bound to `option`, ` notMerge: true` will be specified.
- `update-options: object`
Options for updating chart option. See `echartsInstance.setOption`'s `opts` parameter [here →](https://echarts.apache.org/en/api.html#echartsInstance.setOption)
Injection key: `UPDATE_OPTIONS_KEY`.
- `group: string`
Group name to be used in chart [connection](https://echarts.apache.org/en/api.html#echarts.connect). See `echartsInstance.group` [here →](https://echarts.apache.org/en/api.html#echartsInstance.group)
- `autoresize: boolean | { throttle?: number, onResize?: () => void }` (default: `false`)
Whether the chart should be resized automatically whenever its root is resized. Use the options object to specify a custom throttle delay (in milliseconds) and/or an extra resize callback function.
- `loading: boolean` (default: `false`)
Whether the chart is in loading state.
- `loading-options: object`
Configuration item of loading animation. See `echartsInstance.showLoading`'s `opts` parameter [here →](https://echarts.apache.org/en/api.html#echartsInstance.showLoading)
Injection key: `LOADING_OPTIONS_KEY`.
- `manual-update: boolean` (default: `false`)
For performance critical scenarios (having a large dataset) we'd better bypass Vue's reactivity system for `option` prop. By specifying `manual-update` prop with `true` and not providing `option` prop, the dataset won't be watched any more. After doing so, you need to retrieve the component instance with `ref` and manually call `setOption` method to update the chart.
### Events
You can bind events with Vue's `v-on` directive.
```vue
<template>
<v-chart :option="option" @highlight="handleHighlight" />
</template>
```
> **Note**
>
> Only the `.once` event modifier is supported as other modifiers are tightly coupled with the DOM event system.
Vue-ECharts support the following events:
- `highlight` [](https://echarts.apache.org/en/api.html#events.highlight)
- `downplay` [](https://echarts.apache.org/en/api.html#events.downplay)
- `selectchanged` [](https://echarts.apache.org/en/api.html#events.selectchanged)
- `legendselectchanged` [](https://echarts.apache.org/en/api.html#events.legendselectchanged)
- `legendselected` [](https://echarts.apache.org/en/api.html#events.legendselected)
- `legendunselected` [](https://echarts.apache.org/en/api.html#events.legendunselected)
- `legendselectall` [](https://echarts.apache.org/en/api.html#events.legendselectall)
- `legendinverseselect` [](https://echarts.apache.org/en/api.html#events.legendinverseselect)
- `legendscroll` [](https://echarts.apache.org/en/api.html#events.legendscroll)
- `datazoom` [](https://echarts.apache.org/en/api.html#events.datazoom)
- `datarangeselected` [](https://echarts.apache.org/en/api.html#events.datarangeselected)
- `timelinechanged` [](https://echarts.apache.org/en/api.html#events.timelinechanged)
- `timelineplaychanged` [](https://echarts.apache.org/en/api.html#events.timelineplaychanged)
- `restore` [](https://echarts.apache.org/en/api.html#events.restore)
- `dataviewchanged` [](https://echarts.apache.org/en/api.html#events.dataviewchanged)
- `magictypechanged` [](https://echarts.apache.org/en/api.html#events.magictypechanged)
- `geoselectchanged` [](https://echarts.apache.org/en/api.html#events.geoselectchanged)
- `geoselected` [](https://echarts.apache.org/en/api.html#events.geoselected)
- `geounselected` [](https://echarts.apache.org/en/api.html#events.geounselected)
- `axisareaselected` [](https://echarts.apache.org/en/api.html#events.axisareaselected)
- `brush` [](https://echarts.apache.org/en/api.html#events.brush)
- `brushEnd` [](https://echarts.apache.org/en/api.html#events.brushEnd)
- `brushselected` [](https://echarts.apache.org/en/api.html#events.brushselected)
- `globalcursortaken` [](https://echarts.apache.org/en/api.html#events.globalcursortaken)
- `rendered` [](https://echarts.apache.org/en/api.html#events.rendered)
- `finished` [](https://echarts.apache.org/en/api.html#events.finished)
- Mouse events
- `click` [](https://echarts.apache.org/en/api.html#events.Mouse%20events.click)
- `dblclick` [](https://echarts.apache.org/en/api.html#events.Mouse%20events.dblclick)
- `mouseover` [](https://echarts.apache.org/en/api.html#events.Mouse%20events.mouseover)
- `mouseout` [](https://echarts.apache.org/en/api.html#events.Mouse%20events.mouseout)
- `mousemove` [](https://echarts.apache.org/en/api.html#events.Mouse%20events.mousemove)
- `mousedown` [](https://echarts.apache.org/en/api.html#events.Mouse%20events.mousedown)
- `mouseup` [](https://echarts.apache.org/en/api.html#events.Mouse%20events.mouseup)
- `globalout` [](https://echarts.apache.org/en/api.html#events.Mouse%20events.globalout)
- `contextmenu` [](https://echarts.apache.org/en/api.html#events.Mouse%20events.contextmenu)
- ZRender events
- `zr:click`
- `zr:mousedown`
- `zr:mouseup`
- `zr:mousewheel`
- `zr:dblclick`
- `zr:contextmenu`
See supported events [here →](https://echarts.apache.org/en/api.html#events)
#### Native DOM Events
As Vue-ECharts binds events to the ECharts instance by default, there is some caveat when using native DOM events. You need to prefix the event name with `native:` to bind native DOM events (or you can use the `.native` modifier in Vue 2, which is dropped in Vue 3).
```vue
<template>
<v-chart @native:click="handleClick" />
</template>
```
### Provide / Inject
Vue-ECharts provides provide/inject API for `theme`, `init-options`, `update-options` and `loading-options` to help configuring contextual options. eg. for `init-options` you can use the provide API like this:
<details>
<summary>Vue 3</summary>
```js
import { THEME_KEY } from 'vue-echarts'
import { provide } from 'vue'
// composition API
provide(THEME_KEY, 'dark')
// options API
{
provide: {
[THEME_KEY]: 'dark'
}
}
```
</details>
<details>
<summary>Vue 2</summary>
```js
import { THEME_KEY } from 'vue-echarts'
// in component options
{
provide: {
[THEME_KEY]: 'dark'
}
}
```
> **Note**
>
> You need to provide an object for Vue 2 if you want to change it dynamically.
>
> ```js
> // in component options
> {
> data () {
> return {
> theme: { value: 'dark' }
> }
> },
> provide () {
> return {
> [THEME_KEY]: this.theme
> }
> }
> }
> ```
</details>
### Methods
- `setOption` [](https://echarts.apache.org/en/api.html#echartsInstance.setOption)
- `getWidth` [](https://echarts.apache.org/en/api.html#echartsInstance.getWidth)
- `getHeight` [](https://echarts.apache.org/en/api.html#echartsInstance.getHeight)
- `getDom` [](https://echarts.apache.org/en/api.html#echartsInstance.getDom)
- `getOption` [](https://echarts.apache.org/en/api.html#echartsInstance.getOption)
- `resize` [](https://echarts.apache.org/en/api.html#echartsInstance.resize)
- `dispatchAction` [](https://echarts.apache.org/en/api.html#echartsInstance.dispatchAction)
- `convertToPixel` [](https://echarts.apache.org/en/api.html#echartsInstance.convertToPixel)
- `convertFromPixel` [](https://echarts.apache.org/en/api.html#echartsInstance.convertFromPixel)
- `containPixel` [](https://echarts.apache.org/en/api.html#echartsInstance.containPixel)
- `showLoading` [](https://echarts.apache.org/en/api.html#echartsInstance.showLoading)
- `hideLoading` [](https://echarts.apache.org/en/api.html#echartsInstance.hideLoading)
- `getDataURL` [](https://echarts.apache.org/en/api.html#echartsInstance.getDataURL)
- `getConnectedDataURL` [](https://echarts.apache.org/en/api.html#echartsInstance.getConnectedDataURL)
- `clear` [](https://echarts.apache.org/en/api.html#echartsInstance.clear)
- `dispose` [](https://echarts.apache.org/en/api.html#echartsInstance.dispose)
### Static Methods
Static methods can be accessed from [`echarts` itself](https://echarts.apache.org/en/api.html#echarts).
## CSP: `style-src` or `style-src-elem`
If you are applying a CSP to prevent inline `<style>` injection, you need to use files from `dist/csp` directory and include `dist/csp/style.css` into your app manually.
## Migration to v6
> 💡 Please make sure to read the [migration guide](https://echarts.apache.org/en/tutorial.html#ECharts%205%20Upgrade%20Guide) for ECharts 5 as well.
The following breaking changes are introduced in `vue-echarts@6`:
### Vue 2 support
- If you are using version prior to `vue@2.7.0`, `@vue/composition-api` is required to be installed to use Vue-ECharts with Vue 2 (and also `@vue/runtime-core` for TypeScript support).
### Props
- `options` is renamed to **`option`** to align with ECharts itself.
- Updating `option` will respect **`update-options`** configs instead of checking reference change.
- `watch-shallow` is removed. Use **`manual-update`** for performance critical scenarios.
### Methods
- `mergeOptions` is renamed to **`setOption`** to align with ECharts itself.
- `showLoading` and `hideLoading` is removed. Use the **`loading` and `loading-options`** props instead.
- `appendData` is removed. (Due to ECharts 5's breaking change.)
- All static methods are removed from `vue-echarts`. Use those methods from `echarts` directly.
### Computed getters
- Computed getters (`width`, `height`, `isDisposed` and `computedOptions`) are removed. Use the **`getWidth`, `getHeight`, `isDisposed` and `getOption`** methods instead.
### Styles
- Now the root element of the component have **`100%×100%`** size by default, instead of `600×400`.
## Local development
```sh
pnpm i
pnpm serve
```
Open `http://localhost:8080` to see the demo.
## Notice
The Apache Software Foundation [Apache ECharts, ECharts](https://echarts.apache.org/), Apache, the Apache feather, and the Apache ECharts project logo are either registered trademarks or trademarks of the [Apache Software Foundation](https://www.apache.org/).

525
frontend/node_modules/vue-echarts/README.zh-Hans.md generated vendored Normal file
View File

@@ -0,0 +1,525 @@
<h1 align="center">Vue-ECharts</h1>
<p align="center">Apache ECharts™ <sup>(v5)</sup> 的 Vue.js <sup>(v2/v3)</sup> 组件。</p>
<p align="center"><a href="https://vue-echarts.dev/">查看 Demo →</a></p>
<p align="center"><a href="https:///pr.new/ecomfe/vue-echarts"><img alt="Open in Codeflow" src="https://developer.stackblitz.com/img/open_in_codeflow.svg" height="28"/></a> <a href="https://codesandbox.io/p/github/ecomfe/vue-echarts"><img alt="Edit in CodeSandbox" src="https://assets.codesandbox.io/github/button-edit-lime.svg" height="28"/></a></p>
> [!IMPORTANT]
> 我们新发布了一个[导入代码生成器](https://vue-echarts.dev/#codegen),只需要把`option` 代码粘贴进去,就可以得到精确的导入代码。
>
> ![](https://github.com/ecomfe/vue-echarts/assets/1726061/f9c38a06-3422-4f0e-ab8c-f242d9aea9aa)
>
> [试一试 →](https://vue-echarts.dev/#codegen)
---
## 💡 注意 💡
若您准备从 `vue-echarts` ≤ 5 的版本迁移到新版本,请在升级 v6 前阅读 _[迁移到 v6](#迁移到-v6)_ 部分文档。
没准备好的话,可以继续阅读老版本的文档。[前往 →](https://github.com/ecomfe/vue-echarts/blob/5.x/README.zh_CN.md)
## 安装 & 使用
### npm & ESM
```sh
npm i echarts vue-echarts
```
要在 _Vue 2_<2.7.0下使用 `vue-echarts`需要确保 `@vue/composition-api` 已经安装TypeScript 支持还需要 `@vue/runtime-core`
```sh
npm i @vue/composition-api
npm i @vue/runtime-core # TypeScript 支持
```
如果你在使用基于 _Vue 2_ _NuxtJS_则需要安装 `@nuxtjs/composition-api`
```sh
npm i @nuxtjs/composition-api
```
然后在 `nuxt.config.js` `buildModules` 选项中添加 `'@nuxtjs/composition-api/module'`
#### 示例
<details>
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-vue-3?file=src%2FApp.vue">Demo →</a></summary>
```vue
<template>
<v-chart class="chart" :option="option" />
</template>
<script setup>
import { use } from "echarts/core";
import { CanvasRenderer } from "echarts/renderers";
import { PieChart } from "echarts/charts";
import {
TitleComponent,
TooltipComponent,
LegendComponent
} from "echarts/components";
import VChart, { THEME_KEY } from "vue-echarts";
import { ref, provide } from "vue";
use([
CanvasRenderer,
PieChart,
TitleComponent,
TooltipComponent,
LegendComponent
]);
provide(THEME_KEY, "dark");
const option = ref({
title: {
text: "Traffic Sources",
left: "center"
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: "vertical",
left: "left",
data: ["Direct", "Email", "Ad Networks", "Video Ads", "Search Engines"]
},
series: [
{
name: "Traffic Sources",
type: "pie",
radius: "55%",
center: ["50%", "60%"],
data: [
{ value: 335, name: "Direct" },
{ value: 310, name: "Email" },
{ value: 234, name: "Ad Networks" },
{ value: 135, name: "Video Ads" },
{ value: 1548, name: "Search Engines" }
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
}
}
]
});
</script>
<style scoped>
.chart {
height: 400px;
}
</style>
```
</details>
<details>
<summary>Vue 2 <a href="https://stackblitz.com/edit/vue-echarts-vue-2?file=src%2FApp.vue">Demo →</a></summary>
```vue
<template>
<v-chart class="chart" :option="option" />
</template>
<script>
import { use } from "echarts/core";
import { CanvasRenderer } from "echarts/renderers";
import { PieChart } from "echarts/charts";
import {
TitleComponent,
TooltipComponent,
LegendComponent
} from "echarts/components";
import VChart, { THEME_KEY } from "vue-echarts";
use([
CanvasRenderer,
PieChart,
TitleComponent,
TooltipComponent,
LegendComponent
]);
export default {
name: "HelloWorld",
components: {
VChart
},
provide: {
[THEME_KEY]: "dark"
},
data() {
return {
option: {
title: {
text: "Traffic Sources",
left: "center"
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: "vertical",
left: "left",
data: [
"Direct",
"Email",
"Ad Networks",
"Video Ads",
"Search Engines"
]
},
series: [
{
name: "Traffic Sources",
type: "pie",
radius: "55%",
center: ["50%", "60%"],
data: [
{ value: 335, name: "Direct" },
{ value: 310, name: "Email" },
{ value: 234, name: "Ad Networks" },
{ value: 135, name: "Video Ads" },
{ value: 1548, name: "Search Engines" }
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
}
}
]
}
};
}
};
</script>
<style scoped>
.chart {
height: 400px;
}
</style>
```
</details>
> [!IMPORTANT]
> 我们鼓励手动从 ECharts 中引入组件和图表,以减小打包体积。我们已经为此构建了一个[导入代码生成器](https://vue-echarts.dev/#codegen)。你只需要把`option` 代码粘贴进去,就可以得到精确的导入代码。
>
> [试一试 →](https://vue-echarts.dev/#codegen)
但如果你实在需要全量引入 ECharts 从而无需手动引入模块,只需要在代码中添加:
```js
import "echarts";
```
### CDN & 全局变量
用如下方式在 HTML 中插入 `<script>` 标签,并且通过 `window.VueECharts` 来访问组件接口:
<details>
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-vue-3-global?file=index.html">Demo →</a></summary>
<!-- vue3Scripts:start -->
```html
<script src="https://cdn.jsdelivr.net/npm/vue@3.4.23"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
```
<!-- vue3Scripts:end -->
```js
const app = Vue.createApp(...)
// 全局注册组件(也可以使用局部注册)
app.component('v-chart', VueECharts)
```
</details>
<details>
<summary>Vue 2 <a href="https://stackblitz.com/edit/vue-echarts-vue-2-global?file=index.html">Demo →</a></summary>
<!-- vue2Scripts:start -->
```html
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
```
<!-- vue2Scripts:end -->
```js
// 全局注册组件(也可以使用局部注册)
Vue.component("v-chart", VueECharts);
```
</details>
可以在[这里](https://github.com/ecomfe/vue-echarts/tree/main/src/demo)查看更多例子。
### Prop
- `init-options: object`
初始化附加参数。请参考 `echarts.init``opts` 参数。[前往 →](https://echarts.apache.org/zh/api.html#echarts.init)
Inject 键名:`INIT_OPTIONS_KEY`
- `theme: string | object`
要应用的主题。请参考 `echarts.init``theme` 参数。[前往 →](https://echarts.apache.org/zh/api.html#echarts.init)
Inject 键名:`THEME_KEY`
- `option: object`
ECharts 的万能接口。修改这个 prop 会触发 ECharts 实例的 `setOption` 方法。查看[详情 →](https://echarts.apache.org/zh/option.html)
> 💡 在没有指定 `update-options` 时,如果直接修改 `option` 对象而引用保持不变,`setOption` 方法调用时将默认指定 `notMerge: false`;否则,如果为 `option` 绑定一个新的引用,将指定 `notMerge: true`。
- `update-options: object`
图表更新的配置项。请参考 `echartsInstance.setOption``opts` 参数。[前往 →](https://echarts.apache.org/zh/api.html#echartsInstance.setOption)
Inject 键名:`UPDATE_OPTIONS_KEY`
- `group: string`
图表的分组,用于[联动](https://echarts.apache.org/zh/api.html#echarts.connect)。请参考 `echartsInstance.group`。[前往 →](https://echarts.apache.org/zh/api.html#echartsInstance.group)
- `autoresize: boolean | { throttle?: number, onResize?: () => void }`(默认值`false`
图表在组件根元素尺寸变化时是否需要自动进行重绘。也可以传入一个选项对象来指定自定义的节流延迟和尺寸变化时的额外回调函数。
- `loading: boolean`(默认值:`false`
图表是否处于加载状态。
- `loading-options: object`
加载动画配置项。请参考 `echartsInstance.showLoading``opts` 参数。[前往 →](https://echarts.apache.org/zh/api.html#echartsInstance.showLoading)
Inject 键名:`LOADING_OPTIONS_KEY`
- `manual-update: boolean`(默认值`false`
在性能敏感(数据量很大)的场景下,我们最好对于 `option` prop 绕过 Vue 的响应式系统。当将 `manual-update` prop 指定为 `true` 且不传入 `option` prop 时,数据将不会被监听。然后,需要用 `ref` 获取组件实例以后手动调用 `setOption` 方法来更新图表。
### 事件
可以使用 Vue 的 `v-on` 指令绑定事件。
```vue
<template>
<v-chart :option="option" @highlight="handleHighlight" />
</template>
```
> **Note**
>
> 仅支持 `.once` 修饰符,因为其它修饰符都与 DOM 事件机制强耦合。
Vue-ECharts 支持如下事件:
- `highlight` [](https://echarts.apache.org/zh/api.html#events.highlight)
- `downplay` [](https://echarts.apache.org/zh/api.html#events.downplay)
- `selectchanged` [](https://echarts.apache.org/zh/api.html#events.selectchanged)
- `legendselectchanged` [](https://echarts.apache.org/zh/api.html#events.legendselectchanged)
- `legendselected` [](https://echarts.apache.org/zh/api.html#events.legendselected)
- `legendunselected` [](https://echarts.apache.org/zh/api.html#events.legendunselected)
- `legendselectall` [](https://echarts.apache.org/zh/api.html#events.legendselectall)
- `legendinverseselect` [](https://echarts.apache.org/zh/api.html#events.legendinverseselect)
- `legendscroll` [](https://echarts.apache.org/zh/api.html#events.legendscroll)
- `datazoom` [](https://echarts.apache.org/zh/api.html#events.datazoom)
- `datarangeselected` [](https://echarts.apache.org/zh/api.html#events.datarangeselected)
- `timelinechanged` [](https://echarts.apache.org/zh/api.html#events.timelinechanged)
- `timelineplaychanged` [](https://echarts.apache.org/zh/api.html#events.timelineplaychanged)
- `restore` [](https://echarts.apache.org/zh/api.html#events.restore)
- `dataviewchanged` [](https://echarts.apache.org/zh/api.html#events.dataviewchanged)
- `magictypechanged` [](https://echarts.apache.org/zh/api.html#events.magictypechanged)
- `geoselectchanged` [](https://echarts.apache.org/zh/api.html#events.geoselectchanged)
- `geoselected` [](https://echarts.apache.org/zh/api.html#events.geoselected)
- `geounselected` [](https://echarts.apache.org/zh/api.html#events.geounselected)
- `axisareaselected` [](https://echarts.apache.org/zh/api.html#events.axisareaselected)
- `brush` [](https://echarts.apache.org/zh/api.html#events.brush)
- `brushEnd` [](https://echarts.apache.org/zh/api.html#events.brushEnd)
- `brushselected` [](https://echarts.apache.org/zh/api.html#events.brushselected)
- `globalcursortaken` [](https://echarts.apache.org/zh/api.html#events.globalcursortaken)
- `rendered` [](https://echarts.apache.org/zh/api.html#events.rendered)
- `finished` [](https://echarts.apache.org/zh/api.html#events.finished)
- 鼠标事件
- `click` [](https://echarts.apache.org/zh/api.html#events.Mouse%20events.click)
- `dblclick` [](https://echarts.apache.org/zh/api.html#events.Mouse%20events.dblclick)
- `mouseover` [](https://echarts.apache.org/zh/api.html#events.Mouse%20events.mouseover)
- `mouseout` [](https://echarts.apache.org/zh/api.html#events.Mouse%20events.mouseout)
- `mousemove` [](https://echarts.apache.org/zh/api.html#events.Mouse%20events.mousemove)
- `mousedown` [](https://echarts.apache.org/zh/api.html#events.Mouse%20events.mousedown)
- `mouseup` [](https://echarts.apache.org/zh/api.html#events.Mouse%20events.mouseup)
- `globalout` [](https://echarts.apache.org/zh/api.html#events.Mouse%20events.globalout)
- `contextmenu` [](https://echarts.apache.org/zh/api.html#events.Mouse%20events.contextmenu)
- ZRender 事件
- `zr:click`
- `zr:mousedown`
- `zr:mouseup`
- `zr:mousewheel`
- `zr:dblclick`
- `zr:contextmenu`
请参考支持的事件列表。[前往 →](https://echarts.apache.org/zh/api.html#events)
#### 原生 DOM 事件
由于 Vue-ECharts 默认将事件绑定到 ECharts 实例,因此在使用原生 DOM 事件时需要做一些特殊处理。你需要在事件名称前加上 `native:` 前缀来绑定原生 DOM 事件(可以在 Vue 2 中也可以使用 `.native` 修饰符,但这在 Vue 3 中已被废弃)。
```vue
<template>
<v-chart @native:click="handleClick" />
</template>
```
### Provide / Inject
Vue-ECharts 为 `theme``init-options``update-options``loading-options` 提供了 provide/inject API以通过上下文配置选项。例如可以通过如下方式来使用 provide API 为 `init-options` 提供上下文配置:
<details>
<summary>Vue 3</summary>
```js
import { THEME_KEY } from 'vue-echarts'
import { provide } from 'vue'
// 组合式 API
provide(THEME_KEY, 'dark')
// 选项式 API
{
provide: {
[THEME_KEY]: 'dark'
}
}
```
</details>
<details>
<summary>Vue 2</summary>
```js
import { THEME_KEY } from 'vue-echarts'
// 组件选项中
{
provide: {
[THEME_KEY]: 'dark'
}
}
```
> **Note**
>
> 在 Vue 2 中,如果你想动态地改变这些选项,那么你需要提供一个对象。
>
> ```js
> // 组件选项中
> {
> data () {
> return {
> theme: { value: 'dark' }
> }
> },
> provide () {
> return {
> [THEME_KEY]: this.theme
> }
> }
> }
> ```
</details>
### 方法
- `setOption` [](https://echarts.apache.org/zh/api.html#echartsInstance.setOption)
- `getWidth` [](https://echarts.apache.org/zh/api.html#echartsInstance.getWidth)
- `getHeight` [](https://echarts.apache.org/zh/api.html#echartsInstance.getHeight)
- `getDom` [](https://echarts.apache.org/zh/api.html#echartsInstance.getDom)
- `getOption` [](https://echarts.apache.org/zh/api.html#echartsInstance.getOption)
- `resize` [](https://echarts.apache.org/zh/api.html#echartsInstance.resize)
- `dispatchAction` [](https://echarts.apache.org/zh/api.html#echartsInstance.dispatchAction)
- `convertToPixel` [](https://echarts.apache.org/zh/api.html#echartsInstance.convertToPixel)
- `convertFromPixel` [](https://echarts.apache.org/zh/api.html#echartsInstance.convertFromPixel)
- `containPixel` [](https://echarts.apache.org/zh/api.html#echartsInstance.containPixel)
- `showLoading` [](https://echarts.apache.org/zh/api.html#echartsInstance.showLoading)
- `hideLoading` [](https://echarts.apache.org/zh/api.html#echartsInstance.hideLoading)
- `getDataURL` [](https://echarts.apache.org/zh/api.html#echartsInstance.getDataURL)
- `getConnectedDataURL` [](https://echarts.apache.org/zh/api.html#echartsInstance.getConnectedDataURL)
- `clear` [](https://echarts.apache.org/zh/api.html#echartsInstance.clear)
- `dispose` [](https://echarts.apache.org/zh/api.html#echartsInstance.dispose)
### 静态方法
静态方法请直接通过 [`echarts` 本身](https://echarts.apache.org/zh/api.html#echarts)进行调用。
## CSP: `style-src` 或 `style-src-elem`
如果你正在应用 CSP 来防止内联 `<style>` 注入,则需要使用 `dist/csp` 目录中的文件,并手动引入 `dist/csp/style.css`
## 迁移到 v6
> 💡 请确保同时查阅 ECharts 5 的[升级指南](https://echarts.apache.org/zh/tutorial.html#ECharts%205%20%E5%8D%87%E7%BA%A7%E6%8C%87%E5%8D%97)。
`vue-echarts@6` 引入了如下破坏性变更:
### Vue 2 支持
- 要在 `vue@2.7.0` 之前的版本中使用 Vue-ECharts必须安装 `@vue/composition-api`(还需要安装 `@vue/runtime-core` 来支持 TypeScript
### Prop
- `options` 重命名为 **`option`**,以和 ECharts 本身保持一致。
- 更新 `option` 将采用 **`update-options`** 中的配置,不再检查是否发生引用变化。
- `watch-shallow` 被移除。在性能关键场景请使用 **`manual-update`**。
### 方法
- `mergeOptions` 重命名为 **`setOption`**,以和 ECharts 本身保持一致。
- `showLoading``hideLoading` 被移除。请使用 **`loading``loading-options`** prop。
- `appendData` 被移除。(由于 ECharts 5 引入的破坏性变更。)
- 所有静态方法被从 `vue-echarts` 移除。可以直接使用 `echarts` 本身的这些方法。
### 计算 Getter
- 计算 getter`width``height``isDisposed``computedOptions`)被移除。请分别使用 **`getWidth``getHeight``isDisposed``getOption`** 方法代替。
### 样式
- 现在组件根元素尺寸默认为 **`100%×100%`**,而非原来的 `600×400`
## 本地开发
```sh
pnpm i
pnpm serve
```
打开 `http://localhost:8080` 来查看 demo。
## 声明
The Apache Software Foundation [Apache ECharts, ECharts](https://echarts.apache.org/), Apache, the Apache feather, and the Apache ECharts project logo are either registered trademarks or trademarks of the [Apache Software Foundation](https://www.apache.org/).

344
frontend/node_modules/vue-echarts/dist/csp/index.cjs.js generated vendored Normal file
View File

@@ -0,0 +1,344 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vueDemi = require('vue-demi');
var core = require('echarts/core');
var resizeDetector = require('resize-detector');
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var METHOD_NAMES = [
"getWidth",
"getHeight",
"getDom",
"getOption",
"resize",
"dispatchAction",
"convertToPixel",
"convertFromPixel",
"containPixel",
"getDataURL",
"getConnectedDataURL",
"appendData",
"clear",
"isDisposed",
"dispose"
];
function usePublicAPI(chart) {
function makePublicMethod(name) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!chart.value) {
throw new Error("ECharts is not initialized yet.");
}
return chart.value[name].apply(chart.value, args);
};
}
function makePublicMethods() {
var methods = Object.create(null);
METHOD_NAMES.forEach(function (name) {
methods[name] = makePublicMethod(name);
});
return methods;
}
return makePublicMethods();
}
function useAutoresize(chart, autoresize, root) {
var resizeListener = null;
vueDemi.watch([root, chart, autoresize], function (_a, _, cleanup) {
var root = _a[0], chart = _a[1], autoresize = _a[2];
if (root && chart && autoresize) {
var autoresizeOptions = autoresize === true ? {} : autoresize;
var _b = autoresizeOptions.throttle, wait = _b === void 0 ? 100 : _b, onResize_1 = autoresizeOptions.onResize;
var callback = function () {
chart.resize();
onResize_1 === null || onResize_1 === void 0 ? void 0 : onResize_1();
};
resizeListener = wait ? core.throttle(callback, wait) : callback;
resizeDetector.addListener(root, resizeListener);
}
cleanup(function () {
if (root && resizeListener) {
resizeDetector.removeListener(root, resizeListener);
}
});
});
}
var autoresizeProps = {
autoresize: [Boolean, Object]
};
var onRE = /^on[^a-z]/;
var isOn = function (key) { return onRE.test(key); };
function omitOn(attrs) {
var result = {};
for (var key in attrs) {
if (!isOn(key)) {
result[key] = attrs[key];
}
}
return result;
}
function unwrapInjected(injection, defaultValue) {
var value = vueDemi.isRef(injection) ? vueDemi.unref(injection) : injection;
if (value && typeof value === "object" && "value" in value) {
return value.value || defaultValue;
}
return value || defaultValue;
}
var LOADING_OPTIONS_KEY = "ecLoadingOptions";
function useLoading(chart, loading, loadingOptions) {
var defaultLoadingOptions = vueDemi.inject(LOADING_OPTIONS_KEY, {});
var realLoadingOptions = vueDemi.computed(function () { return (__assign(__assign({}, unwrapInjected(defaultLoadingOptions, {})), loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.value)); });
vueDemi.watchEffect(function () {
var instance = chart.value;
if (!instance) {
return;
}
if (loading.value) {
instance.showLoading(realLoadingOptions.value);
}
else {
instance.hideLoading();
}
});
}
var loadingProps = {
loading: Boolean,
loadingOptions: Object
};
var TAG_NAME = "x-vue-echarts";
if (vueDemi.Vue2) {
vueDemi.Vue2.config.ignoredElements.push(TAG_NAME);
}
var THEME_KEY = "ecTheme";
var INIT_OPTIONS_KEY = "ecInitOptions";
var UPDATE_OPTIONS_KEY = "ecUpdateOptions";
var NATIVE_EVENT_RE = /(^&?~?!?)native:/;
var ECharts = vueDemi.defineComponent({
name: "echarts",
props: __assign(__assign({ option: Object, theme: {
type: [Object, String]
}, initOptions: Object, updateOptions: Object, group: String, manualUpdate: Boolean }, autoresizeProps), loadingProps),
emits: {},
inheritAttrs: false,
setup: function (props, _a) {
var attrs = _a.attrs;
var root = vueDemi.shallowRef();
var inner = vueDemi.shallowRef();
var chart = vueDemi.shallowRef();
var manualOption = vueDemi.shallowRef();
var defaultTheme = vueDemi.inject(THEME_KEY, null);
var defaultInitOptions = vueDemi.inject(INIT_OPTIONS_KEY, null);
var defaultUpdateOptions = vueDemi.inject(UPDATE_OPTIONS_KEY, null);
var _b = vueDemi.toRefs(props), autoresize = _b.autoresize, manualUpdate = _b.manualUpdate, loading = _b.loading, loadingOptions = _b.loadingOptions;
var realOption = vueDemi.computed(function () { return manualOption.value || props.option || null; });
var realTheme = vueDemi.computed(function () { return props.theme || unwrapInjected(defaultTheme, {}); });
var realInitOptions = vueDemi.computed(function () { return props.initOptions || unwrapInjected(defaultInitOptions, {}); });
var realUpdateOptions = vueDemi.computed(function () { return props.updateOptions || unwrapInjected(defaultUpdateOptions, {}); });
var nonEventAttrs = vueDemi.computed(function () { return omitOn(attrs); });
var nativeListeners = {};
var listeners = vueDemi.getCurrentInstance().proxy.$listeners;
var realListeners = {};
if (!listeners) {
Object.keys(attrs)
.filter(function (key) { return isOn(key); })
.forEach(function (key) {
var event = key.charAt(2).toLowerCase() + key.slice(3);
if (event.indexOf("native:") === 0) {
var nativeKey = "on".concat(event.charAt(7).toUpperCase()).concat(event.slice(8));
nativeListeners[nativeKey] = attrs[key];
return;
}
if (event.substring(event.length - 4) === "Once") {
event = "~".concat(event.substring(0, event.length - 4));
}
realListeners[event] = attrs[key];
});
}
else {
Object.keys(listeners).forEach(function (key) {
if (NATIVE_EVENT_RE.test(key)) {
nativeListeners[key.replace(NATIVE_EVENT_RE, "$1")] = listeners[key];
}
else {
realListeners[key] = listeners[key];
}
});
}
function init(option) {
if (!inner.value) {
return;
}
var instance = (chart.value = core.init(inner.value, realTheme.value, realInitOptions.value));
if (props.group) {
instance.group = props.group;
}
Object.keys(realListeners).forEach(function (key) {
var handler = realListeners[key];
if (!handler) {
return;
}
var event = key.toLowerCase();
if (event.charAt(0) === "~") {
event = event.substring(1);
handler.__once__ = true;
}
var target = instance;
if (event.indexOf("zr:") === 0) {
target = instance.getZr();
event = event.substring(3);
}
if (handler.__once__) {
delete handler.__once__;
var raw_1 = handler;
handler = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
raw_1.apply(void 0, args);
target.off(event, handler);
};
}
target.on(event, handler);
});
function resize() {
if (instance && !instance.isDisposed()) {
instance.resize();
}
}
function commit() {
var opt = option || realOption.value;
if (opt) {
instance.setOption(opt, realUpdateOptions.value);
}
}
if (autoresize.value) {
vueDemi.nextTick(function () {
resize();
commit();
});
}
else {
commit();
}
}
function setOption(option, updateOptions) {
if (props.manualUpdate) {
manualOption.value = option;
}
if (!chart.value) {
init(option);
}
else {
chart.value.setOption(option, updateOptions || {});
}
}
function cleanup() {
if (chart.value) {
chart.value.dispose();
chart.value = undefined;
}
}
var unwatchOption = null;
vueDemi.watch(manualUpdate, function (manualUpdate) {
if (typeof unwatchOption === "function") {
unwatchOption();
unwatchOption = null;
}
if (!manualUpdate) {
unwatchOption = vueDemi.watch(function () { return props.option; }, function (option, oldOption) {
if (!option) {
return;
}
if (!chart.value) {
init();
}
else {
chart.value.setOption(option, __assign({ notMerge: option !== oldOption }, realUpdateOptions.value));
}
}, { deep: true });
}
}, {
immediate: true
});
vueDemi.watch([realTheme, realInitOptions], function () {
cleanup();
init();
}, {
deep: true
});
vueDemi.watchEffect(function () {
if (props.group && chart.value) {
chart.value.group = props.group;
}
});
var publicApi = usePublicAPI(chart);
useLoading(chart, loading, loadingOptions);
useAutoresize(chart, autoresize, inner);
vueDemi.onMounted(function () {
init();
});
vueDemi.onBeforeUnmount(function () {
{
cleanup();
}
});
return __assign({ chart: chart, root: root, inner: inner, setOption: setOption, nonEventAttrs: nonEventAttrs, nativeListeners: nativeListeners }, publicApi);
},
render: function () {
var attrs = (vueDemi.Vue2
? { attrs: this.nonEventAttrs, on: this.nativeListeners }
: __assign(__assign({}, this.nonEventAttrs), this.nativeListeners));
attrs.ref = "root";
attrs["class"] = attrs["class"] ? ["echarts"].concat(attrs["class"]) : "echarts";
return vueDemi.h(TAG_NAME, attrs, [
vueDemi.h("div", { ref: "inner", "class": "vue-echarts-inner" })
]);
}
});
exports.INIT_OPTIONS_KEY = INIT_OPTIONS_KEY;
exports.LOADING_OPTIONS_KEY = LOADING_OPTIONS_KEY;
exports.THEME_KEY = THEME_KEY;
exports.UPDATE_OPTIONS_KEY = UPDATE_OPTIONS_KEY;
exports["default"] = ECharts;
//# sourceMappingURL=index.cjs.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue-demi"),t=require("echarts/core"),n=require("resize-detector"),o=function(){return o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},o.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var r=["getWidth","getHeight","getDom","getOption","resize","dispatchAction","convertToPixel","convertFromPixel","containPixel","getDataURL","getConnectedDataURL","appendData","clear","isDisposed","dispose"];function i(e){return t=Object.create(null),r.forEach((function(n){t[n]=function(t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(!e.value)throw new Error("ECharts is not initialized yet.");return e.value[t].apply(e.value,n)}}(n)})),t;var t}var a={autoresize:[Boolean,Object]},u=/^on[^a-z]/,c=function(e){return u.test(e)};function s(t,n){var o=e.isRef(t)?e.unref(t):t;return o&&"object"==typeof o&&"value"in o?o.value||n:o||n}var l="ecLoadingOptions";var f={loading:Boolean,loadingOptions:Object},v="x-vue-echarts";e.Vue2&&e.Vue2.config.ignoredElements.push(v);var p="ecTheme",d="ecInitOptions",h="ecUpdateOptions",g=/(^&?~?!?)native:/,O=e.defineComponent({name:"echarts",props:o(o({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},a),f),emits:{},inheritAttrs:!1,setup:function(r,a){var u=a.attrs,f=e.shallowRef(),v=e.shallowRef(),O=e.shallowRef(),m=e.shallowRef(),E=e.inject(p,null),_=e.inject(d,null),b=e.inject(h,null),j=e.toRefs(r),w=j.autoresize,y=j.manualUpdate,x=j.loading,L=j.loadingOptions,z=e.computed((function(){return m.value||r.option||null})),A=e.computed((function(){return r.theme||s(E,{})})),P=e.computed((function(){return r.initOptions||s(_,{})})),R=e.computed((function(){return r.updateOptions||s(b,{})})),T=e.computed((function(){return function(e){var t={};for(var n in e)c(n)||(t[n]=e[n]);return t}(u)})),U={},D=e.getCurrentInstance().proxy.$listeners,I={};function C(n){if(v.value){var o=O.value=t.init(v.value,A.value,P.value);r.group&&(o.group=r.group),Object.keys(I).forEach((function(e){var t=I[e];if(t){var n=e.toLowerCase();"~"===n.charAt(0)&&(n=n.substring(1),t.__once__=!0);var r=o;if(0===n.indexOf("zr:")&&(r=o.getZr(),n=n.substring(3)),t.__once__){delete t.__once__;var i=t;t=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];i.apply(void 0,e),r.off(n,t)}}r.on(n,t)}})),w.value?e.nextTick((function(){o&&!o.isDisposed()&&o.resize(),i()})):i()}function i(){var e=n||z.value;e&&o.setOption(e,R.value)}}function S(){O.value&&(O.value.dispose(),O.value=void 0)}D?Object.keys(D).forEach((function(e){g.test(e)?U[e.replace(g,"$1")]=D[e]:I[e]=D[e]})):Object.keys(u).filter((function(e){return c(e)})).forEach((function(e){var t=e.charAt(2).toLowerCase()+e.slice(3);if(0!==t.indexOf("native:"))"Once"===t.substring(t.length-4)&&(t="~".concat(t.substring(0,t.length-4))),I[t]=u[e];else{var n="on".concat(t.charAt(7).toUpperCase()).concat(t.slice(8));U[n]=u[e]}}));var N=null;e.watch(y,(function(t){"function"==typeof N&&(N(),N=null),t||(N=e.watch((function(){return r.option}),(function(e,t){e&&(O.value?O.value.setOption(e,o({notMerge:e!==t},R.value)):C())}),{deep:!0}))}),{immediate:!0}),e.watch([A,P],(function(){S(),C()}),{deep:!0}),e.watchEffect((function(){r.group&&O.value&&(O.value.group=r.group)}));var k=i(O);return function(t,n,r){var i=e.inject(l,{}),a=e.computed((function(){return o(o({},s(i,{})),null==r?void 0:r.value)}));e.watchEffect((function(){var e=t.value;e&&(n.value?e.showLoading(a.value):e.hideLoading())}))}(O,x,L),function(o,r,i){var a=null;e.watch([i,o,r],(function(e,o,r){var i=e[0],u=e[1],c=e[2];if(i&&u&&c){var s=!0===c?{}:c,l=s.throttle,f=void 0===l?100:l,v=s.onResize,p=function(){u.resize(),null==v||v()};a=f?t.throttle(p,f):p,n.addListener(i,a)}r((function(){i&&a&&n.removeListener(i,a)}))}))}(O,w,v),e.onMounted((function(){C()})),e.onBeforeUnmount((function(){S()})),o({chart:O,root:f,inner:v,setOption:function(e,t){r.manualUpdate&&(m.value=e),O.value?O.value.setOption(e,t||{}):C(e)},nonEventAttrs:T,nativeListeners:U},k)},render:function(){var t=e.Vue2?{attrs:this.nonEventAttrs,on:this.nativeListeners}:o(o({},this.nonEventAttrs),this.nativeListeners);return t.ref="root",t.class=t.class?["echarts"].concat(t.class):"echarts",e.h(v,t,[e.h("div",{ref:"inner",class:"vue-echarts-inner"})])}});exports.INIT_OPTIONS_KEY=d,exports.LOADING_OPTIONS_KEY=l,exports.THEME_KEY=p,exports.UPDATE_OPTIONS_KEY=h,exports.default=O;
//# sourceMappingURL=index.cjs.min.js.map

File diff suppressed because one or more lines are too long

336
frontend/node_modules/vue-echarts/dist/csp/index.esm.js generated vendored Normal file
View File

@@ -0,0 +1,336 @@
import { watch, isRef, unref, inject, computed, watchEffect, Vue2, defineComponent, shallowRef, toRefs, getCurrentInstance, onMounted, onBeforeUnmount, h, nextTick } from 'vue-demi';
import { throttle, init } from 'echarts/core';
import { addListener, removeListener } from 'resize-detector';
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var METHOD_NAMES = [
"getWidth",
"getHeight",
"getDom",
"getOption",
"resize",
"dispatchAction",
"convertToPixel",
"convertFromPixel",
"containPixel",
"getDataURL",
"getConnectedDataURL",
"appendData",
"clear",
"isDisposed",
"dispose"
];
function usePublicAPI(chart) {
function makePublicMethod(name) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!chart.value) {
throw new Error("ECharts is not initialized yet.");
}
return chart.value[name].apply(chart.value, args);
};
}
function makePublicMethods() {
var methods = Object.create(null);
METHOD_NAMES.forEach(function (name) {
methods[name] = makePublicMethod(name);
});
return methods;
}
return makePublicMethods();
}
function useAutoresize(chart, autoresize, root) {
var resizeListener = null;
watch([root, chart, autoresize], function (_a, _, cleanup) {
var root = _a[0], chart = _a[1], autoresize = _a[2];
if (root && chart && autoresize) {
var autoresizeOptions = autoresize === true ? {} : autoresize;
var _b = autoresizeOptions.throttle, wait = _b === void 0 ? 100 : _b, onResize_1 = autoresizeOptions.onResize;
var callback = function () {
chart.resize();
onResize_1 === null || onResize_1 === void 0 ? void 0 : onResize_1();
};
resizeListener = wait ? throttle(callback, wait) : callback;
addListener(root, resizeListener);
}
cleanup(function () {
if (root && resizeListener) {
removeListener(root, resizeListener);
}
});
});
}
var autoresizeProps = {
autoresize: [Boolean, Object]
};
var onRE = /^on[^a-z]/;
var isOn = function (key) { return onRE.test(key); };
function omitOn(attrs) {
var result = {};
for (var key in attrs) {
if (!isOn(key)) {
result[key] = attrs[key];
}
}
return result;
}
function unwrapInjected(injection, defaultValue) {
var value = isRef(injection) ? unref(injection) : injection;
if (value && typeof value === "object" && "value" in value) {
return value.value || defaultValue;
}
return value || defaultValue;
}
var LOADING_OPTIONS_KEY = "ecLoadingOptions";
function useLoading(chart, loading, loadingOptions) {
var defaultLoadingOptions = inject(LOADING_OPTIONS_KEY, {});
var realLoadingOptions = computed(function () { return (__assign(__assign({}, unwrapInjected(defaultLoadingOptions, {})), loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.value)); });
watchEffect(function () {
var instance = chart.value;
if (!instance) {
return;
}
if (loading.value) {
instance.showLoading(realLoadingOptions.value);
}
else {
instance.hideLoading();
}
});
}
var loadingProps = {
loading: Boolean,
loadingOptions: Object
};
var TAG_NAME = "x-vue-echarts";
if (Vue2) {
Vue2.config.ignoredElements.push(TAG_NAME);
}
var THEME_KEY = "ecTheme";
var INIT_OPTIONS_KEY = "ecInitOptions";
var UPDATE_OPTIONS_KEY = "ecUpdateOptions";
var NATIVE_EVENT_RE = /(^&?~?!?)native:/;
var ECharts = defineComponent({
name: "echarts",
props: __assign(__assign({ option: Object, theme: {
type: [Object, String]
}, initOptions: Object, updateOptions: Object, group: String, manualUpdate: Boolean }, autoresizeProps), loadingProps),
emits: {},
inheritAttrs: false,
setup: function (props, _a) {
var attrs = _a.attrs;
var root = shallowRef();
var inner = shallowRef();
var chart = shallowRef();
var manualOption = shallowRef();
var defaultTheme = inject(THEME_KEY, null);
var defaultInitOptions = inject(INIT_OPTIONS_KEY, null);
var defaultUpdateOptions = inject(UPDATE_OPTIONS_KEY, null);
var _b = toRefs(props), autoresize = _b.autoresize, manualUpdate = _b.manualUpdate, loading = _b.loading, loadingOptions = _b.loadingOptions;
var realOption = computed(function () { return manualOption.value || props.option || null; });
var realTheme = computed(function () { return props.theme || unwrapInjected(defaultTheme, {}); });
var realInitOptions = computed(function () { return props.initOptions || unwrapInjected(defaultInitOptions, {}); });
var realUpdateOptions = computed(function () { return props.updateOptions || unwrapInjected(defaultUpdateOptions, {}); });
var nonEventAttrs = computed(function () { return omitOn(attrs); });
var nativeListeners = {};
var listeners = getCurrentInstance().proxy.$listeners;
var realListeners = {};
if (!listeners) {
Object.keys(attrs)
.filter(function (key) { return isOn(key); })
.forEach(function (key) {
var event = key.charAt(2).toLowerCase() + key.slice(3);
if (event.indexOf("native:") === 0) {
var nativeKey = "on".concat(event.charAt(7).toUpperCase()).concat(event.slice(8));
nativeListeners[nativeKey] = attrs[key];
return;
}
if (event.substring(event.length - 4) === "Once") {
event = "~".concat(event.substring(0, event.length - 4));
}
realListeners[event] = attrs[key];
});
}
else {
Object.keys(listeners).forEach(function (key) {
if (NATIVE_EVENT_RE.test(key)) {
nativeListeners[key.replace(NATIVE_EVENT_RE, "$1")] = listeners[key];
}
else {
realListeners[key] = listeners[key];
}
});
}
function init$1(option) {
if (!inner.value) {
return;
}
var instance = (chart.value = init(inner.value, realTheme.value, realInitOptions.value));
if (props.group) {
instance.group = props.group;
}
Object.keys(realListeners).forEach(function (key) {
var handler = realListeners[key];
if (!handler) {
return;
}
var event = key.toLowerCase();
if (event.charAt(0) === "~") {
event = event.substring(1);
handler.__once__ = true;
}
var target = instance;
if (event.indexOf("zr:") === 0) {
target = instance.getZr();
event = event.substring(3);
}
if (handler.__once__) {
delete handler.__once__;
var raw_1 = handler;
handler = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
raw_1.apply(void 0, args);
target.off(event, handler);
};
}
target.on(event, handler);
});
function resize() {
if (instance && !instance.isDisposed()) {
instance.resize();
}
}
function commit() {
var opt = option || realOption.value;
if (opt) {
instance.setOption(opt, realUpdateOptions.value);
}
}
if (autoresize.value) {
nextTick(function () {
resize();
commit();
});
}
else {
commit();
}
}
function setOption(option, updateOptions) {
if (props.manualUpdate) {
manualOption.value = option;
}
if (!chart.value) {
init$1(option);
}
else {
chart.value.setOption(option, updateOptions || {});
}
}
function cleanup() {
if (chart.value) {
chart.value.dispose();
chart.value = undefined;
}
}
var unwatchOption = null;
watch(manualUpdate, function (manualUpdate) {
if (typeof unwatchOption === "function") {
unwatchOption();
unwatchOption = null;
}
if (!manualUpdate) {
unwatchOption = watch(function () { return props.option; }, function (option, oldOption) {
if (!option) {
return;
}
if (!chart.value) {
init$1();
}
else {
chart.value.setOption(option, __assign({ notMerge: option !== oldOption }, realUpdateOptions.value));
}
}, { deep: true });
}
}, {
immediate: true
});
watch([realTheme, realInitOptions], function () {
cleanup();
init$1();
}, {
deep: true
});
watchEffect(function () {
if (props.group && chart.value) {
chart.value.group = props.group;
}
});
var publicApi = usePublicAPI(chart);
useLoading(chart, loading, loadingOptions);
useAutoresize(chart, autoresize, inner);
onMounted(function () {
init$1();
});
onBeforeUnmount(function () {
{
cleanup();
}
});
return __assign({ chart: chart, root: root, inner: inner, setOption: setOption, nonEventAttrs: nonEventAttrs, nativeListeners: nativeListeners }, publicApi);
},
render: function () {
var attrs = (Vue2
? { attrs: this.nonEventAttrs, on: this.nativeListeners }
: __assign(__assign({}, this.nonEventAttrs), this.nativeListeners));
attrs.ref = "root";
attrs["class"] = attrs["class"] ? ["echarts"].concat(attrs["class"]) : "echarts";
return h(TAG_NAME, attrs, [
h("div", { ref: "inner", "class": "vue-echarts-inner" })
]);
}
});
export { INIT_OPTIONS_KEY, LOADING_OPTIONS_KEY, THEME_KEY, UPDATE_OPTIONS_KEY, ECharts as default };
//# sourceMappingURL=index.esm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
import{watch as e,isRef as t,unref as n,inject as r,computed as o,watchEffect as i,Vue2 as a,defineComponent as u,shallowRef as c,toRefs as s,getCurrentInstance as l,onMounted as v,onBeforeUnmount as f,h as p,nextTick as d}from"vue-demi";import{throttle as h,init as g}from"echarts/core";import{addListener as O,removeListener as m}from"resize-detector";var b=function(){return b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},b.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var y=["getWidth","getHeight","getDom","getOption","resize","dispatchAction","convertToPixel","convertFromPixel","containPixel","getDataURL","getConnectedDataURL","appendData","clear","isDisposed","dispose"];function j(e){return t=Object.create(null),y.forEach((function(n){t[n]=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(!e.value)throw new Error("ECharts is not initialized yet.");return e.value[t].apply(e.value,n)}}(n)})),t;var t}var E={autoresize:[Boolean,Object]},_=/^on[^a-z]/,z=function(e){return _.test(e)};function L(e,r){var o=t(e)?n(e):e;return o&&"object"==typeof o&&"value"in o?o.value||r:o||r}var x="ecLoadingOptions";var A={loading:Boolean,loadingOptions:Object},U="x-vue-echarts";a&&a.config.ignoredElements.push(U);var w="ecTheme",D="ecInitOptions",C="ecUpdateOptions",P=/(^&?~?!?)native:/,S=u({name:"echarts",props:b(b({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},E),A),emits:{},inheritAttrs:!1,setup:function(t,n){var a=n.attrs,u=c(),p=c(),y=c(),E=c(),_=r(w,null),A=r(D,null),U=r(C,null),S=s(t),k=S.autoresize,B=S.manualUpdate,R=S.loading,T=S.loadingOptions,$=o((function(){return E.value||t.option||null})),F=o((function(){return t.theme||L(_,{})})),H=o((function(){return t.initOptions||L(A,{})})),I=o((function(){return t.updateOptions||L(U,{})})),M=o((function(){return function(e){var t={};for(var n in e)z(n)||(t[n]=e[n]);return t}(a)})),W={},Z=l().proxy.$listeners,q={};function G(e){if(p.value){var n=y.value=g(p.value,F.value,H.value);t.group&&(n.group=t.group),Object.keys(q).forEach((function(e){var t=q[e];if(t){var r=e.toLowerCase();"~"===r.charAt(0)&&(r=r.substring(1),t.__once__=!0);var o=n;if(0===r.indexOf("zr:")&&(o=n.getZr(),r=r.substring(3)),t.__once__){delete t.__once__;var i=t;t=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i.apply(void 0,e),o.off(r,t)}}o.on(r,t)}})),k.value?d((function(){n&&!n.isDisposed()&&n.resize(),r()})):r()}function r(){var t=e||$.value;t&&n.setOption(t,I.value)}}function J(){y.value&&(y.value.dispose(),y.value=void 0)}Z?Object.keys(Z).forEach((function(e){P.test(e)?W[e.replace(P,"$1")]=Z[e]:q[e]=Z[e]})):Object.keys(a).filter((function(e){return z(e)})).forEach((function(e){var t=e.charAt(2).toLowerCase()+e.slice(3);if(0!==t.indexOf("native:"))"Once"===t.substring(t.length-4)&&(t="~".concat(t.substring(0,t.length-4))),q[t]=a[e];else{var n="on".concat(t.charAt(7).toUpperCase()).concat(t.slice(8));W[n]=a[e]}}));var K=null;e(B,(function(n){"function"==typeof K&&(K(),K=null),n||(K=e((function(){return t.option}),(function(e,t){e&&(y.value?y.value.setOption(e,b({notMerge:e!==t},I.value)):G())}),{deep:!0}))}),{immediate:!0}),e([F,H],(function(){J(),G()}),{deep:!0}),i((function(){t.group&&y.value&&(y.value.group=t.group)}));var N=j(y);return function(e,t,n){var a=r(x,{}),u=o((function(){return b(b({},L(a,{})),null==n?void 0:n.value)}));i((function(){var n=e.value;n&&(t.value?n.showLoading(u.value):n.hideLoading())}))}(y,R,T),function(t,n,r){var o=null;e([r,t,n],(function(e,t,n){var r=e[0],i=e[1],a=e[2];if(r&&i&&a){var u=!0===a?{}:a,c=u.throttle,s=void 0===c?100:c,l=u.onResize,v=function(){i.resize(),null==l||l()};o=s?h(v,s):v,O(r,o)}n((function(){r&&o&&m(r,o)}))}))}(y,k,p),v((function(){G()})),f((function(){J()})),b({chart:y,root:u,inner:p,setOption:function(e,n){t.manualUpdate&&(E.value=e),y.value?y.value.setOption(e,n||{}):G(e)},nonEventAttrs:M,nativeListeners:W},N)},render:function(){var e=a?{attrs:this.nonEventAttrs,on:this.nativeListeners}:b(b({},this.nonEventAttrs),this.nativeListeners);return e.ref="root",e.class=e.class?["echarts"].concat(e.class):"echarts",p(U,e,[p("div",{ref:"inner",class:"vue-echarts-inner"})])}});export{D as INIT_OPTIONS_KEY,x as LOADING_OPTIONS_KEY,w as THEME_KEY,C as UPDATE_OPTIONS_KEY,S as default};
//# sourceMappingURL=index.esm.min.js.map

File diff suppressed because one or more lines are too long

780
frontend/node_modules/vue-echarts/dist/csp/index.umd.js generated vendored Normal file
View File

@@ -0,0 +1,780 @@
var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
if (VueDemi.install) {
return VueDemi
}
if (!Vue) {
console.error('[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.')
return VueDemi
}
// Vue 2.7
if (Vue.version.slice(0, 4) === '2.7.') {
for (var key in Vue) {
VueDemi[key] = Vue[key]
}
VueDemi.isVue2 = true
VueDemi.isVue3 = false
VueDemi.install = function () {}
VueDemi.Vue = Vue
VueDemi.Vue2 = Vue
VueDemi.version = Vue.version
VueDemi.warn = Vue.util.warn
function createApp(rootComponent, rootProps) {
var vm
var provide = {}
var app = {
config: Vue.config,
use: Vue.use.bind(Vue),
mixin: Vue.mixin.bind(Vue),
component: Vue.component.bind(Vue),
provide: function (key, value) {
provide[key] = value
return this
},
directive: function (name, dir) {
if (dir) {
Vue.directive(name, dir)
return app
} else {
return Vue.directive(name)
}
},
mount: function (el, hydrating) {
if (!vm) {
vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
vm.$mount(el, hydrating)
return vm
} else {
return vm
}
},
unmount: function () {
if (vm) {
vm.$destroy()
vm = undefined
}
},
}
return app
}
VueDemi.createApp = createApp
}
// Vue 2.6.x
else if (Vue.version.slice(0, 2) === '2.') {
if (VueCompositionAPI) {
for (var key in VueCompositionAPI) {
VueDemi[key] = VueCompositionAPI[key]
}
VueDemi.isVue2 = true
VueDemi.isVue3 = false
VueDemi.install = function () {}
VueDemi.Vue = Vue
VueDemi.Vue2 = Vue
VueDemi.version = Vue.version
} else {
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
}
}
// Vue 3
else if (Vue.version.slice(0, 2) === '3.') {
for (var key in Vue) {
VueDemi[key] = Vue[key]
}
VueDemi.isVue2 = false
VueDemi.isVue3 = true
VueDemi.install = function () {}
VueDemi.Vue = Vue
VueDemi.Vue2 = undefined
VueDemi.version = Vue.version
VueDemi.set = function (target, key, val) {
if (Array.isArray(target)) {
target.length = Math.max(target.length, key)
target.splice(key, 1, val)
return val
}
target[key] = val
return val
}
VueDemi.del = function (target, key) {
if (Array.isArray(target)) {
target.splice(key, 1)
return
}
delete target[key]
}
} else {
console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.')
}
return VueDemi
})(
(this.VueDemi = this.VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})),
this.Vue || (typeof Vue !== 'undefined' ? Vue : undefined),
this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
);
;
;
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('echarts'), require('vue-demi'), require('echarts/core')) :
typeof define === 'function' && define.amd ? define(['echarts', 'vue-demi', 'echarts/core'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.VueECharts = factory(global.echarts, global.VueDemi, global.echarts));
})(this, (function (echarts, vueDemi, core) { 'use strict';
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var METHOD_NAMES = [
"getWidth",
"getHeight",
"getDom",
"getOption",
"resize",
"dispatchAction",
"convertToPixel",
"convertFromPixel",
"containPixel",
"getDataURL",
"getConnectedDataURL",
"appendData",
"clear",
"isDisposed",
"dispose"
];
function usePublicAPI(chart) {
function makePublicMethod(name) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!chart.value) {
throw new Error("ECharts is not initialized yet.");
}
return chart.value[name].apply(chart.value, args);
};
}
function makePublicMethods() {
var methods = Object.create(null);
METHOD_NAMES.forEach(function (name) {
methods[name] = makePublicMethod(name);
});
return methods;
}
return makePublicMethods();
}
var raf = null;
function requestAnimationFrame (callback) {
if (!raf) {
raf = (
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function (callback) {
return setTimeout(callback, 16)
}
).bind(window);
}
return raf(callback)
}
var caf = null;
function cancelAnimationFrame (id) {
if (!caf) {
caf = (
window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
function (id) {
clearTimeout(id);
}
).bind(window);
}
caf(id);
}
function createStyles (styleText) {
var style = document.createElement('style');
if (style.styleSheet) {
style.styleSheet.cssText = styleText;
} else {
style.appendChild(document.createTextNode(styleText));
}
(document.querySelector('head') || document.body).appendChild(style);
return style
}
function createElement (tagName, props) {
if ( props === void 0 ) props = {};
var elem = document.createElement(tagName);
Object.keys(props).forEach(function (key) {
elem[key] = props[key];
});
return elem
}
function getComputedStyle (elem, prop, pseudo) {
// for older versions of Firefox, `getComputedStyle` required
// the second argument and may return `null` for some elements
// when `display: none`
var computedStyle = window.getComputedStyle(elem, pseudo || null) || {
display: 'none'
};
return computedStyle[prop]
}
function getRenderInfo (elem) {
if (!document.documentElement.contains(elem)) {
return {
detached: true,
rendered: false
}
}
var current = elem;
while (current !== document) {
if (getComputedStyle(current, 'display') === 'none') {
return {
detached: false,
rendered: false
}
}
current = current.parentNode;
}
return {
detached: false,
rendered: true
}
}
var css_248z = ".resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:\"\";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}";
var total = 0;
var style = null;
function addListener (elem, callback) {
if (!elem.__resize_mutation_handler__) {
elem.__resize_mutation_handler__ = handleMutation.bind(elem);
}
var listeners = elem.__resize_listeners__;
if (!listeners) {
elem.__resize_listeners__ = [];
if (window.ResizeObserver) {
var offsetWidth = elem.offsetWidth;
var offsetHeight = elem.offsetHeight;
var ro = new ResizeObserver(function () {
if (!elem.__resize_observer_triggered__) {
elem.__resize_observer_triggered__ = true;
if (elem.offsetWidth === offsetWidth && elem.offsetHeight === offsetHeight) {
return
}
}
runCallbacks(elem);
});
// initially display none won't trigger ResizeObserver callback
var ref = getRenderInfo(elem);
var detached = ref.detached;
var rendered = ref.rendered;
elem.__resize_observer_triggered__ = detached === false && rendered === false;
elem.__resize_observer__ = ro;
ro.observe(elem);
} else if (elem.attachEvent && elem.addEventListener) {
// targeting IE9/10
elem.__resize_legacy_resize_handler__ = function handleLegacyResize () {
runCallbacks(elem);
};
elem.attachEvent('onresize', elem.__resize_legacy_resize_handler__);
document.addEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
} else {
if (!total) {
style = createStyles(css_248z);
}
initTriggers(elem);
elem.__resize_rendered__ = getRenderInfo(elem).rendered;
if (window.MutationObserver) {
var mo = new MutationObserver(elem.__resize_mutation_handler__);
mo.observe(document, {
attributes: true,
childList: true,
characterData: true,
subtree: true
});
elem.__resize_mutation_observer__ = mo;
}
}
}
elem.__resize_listeners__.push(callback);
total++;
}
function removeListener (elem, callback) {
var listeners = elem.__resize_listeners__;
if (!listeners) {
return
}
if (callback) {
listeners.splice(listeners.indexOf(callback), 1);
}
// no listeners exist, or removing all listeners
if (!listeners.length || !callback) {
// targeting IE9/10
if (elem.detachEvent && elem.removeEventListener) {
elem.detachEvent('onresize', elem.__resize_legacy_resize_handler__);
document.removeEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
return
}
if (elem.__resize_observer__) {
elem.__resize_observer__.unobserve(elem);
elem.__resize_observer__.disconnect();
elem.__resize_observer__ = null;
} else {
if (elem.__resize_mutation_observer__) {
elem.__resize_mutation_observer__.disconnect();
elem.__resize_mutation_observer__ = null;
}
elem.removeEventListener('scroll', handleScroll);
elem.removeChild(elem.__resize_triggers__.triggers);
elem.__resize_triggers__ = null;
}
elem.__resize_listeners__ = null;
}
if (!--total && style) {
style.parentNode.removeChild(style);
}
}
function getUpdatedSize (elem) {
var ref = elem.__resize_last__;
var width = ref.width;
var height = ref.height;
var offsetWidth = elem.offsetWidth;
var offsetHeight = elem.offsetHeight;
if (offsetWidth !== width || offsetHeight !== height) {
return {
width: offsetWidth,
height: offsetHeight
}
}
return null
}
function handleMutation () {
// `this` denotes the scrolling element
var ref = getRenderInfo(this);
var rendered = ref.rendered;
var detached = ref.detached;
if (rendered !== this.__resize_rendered__) {
if (!detached && this.__resize_triggers__) {
resetTriggers(this);
this.addEventListener('scroll', handleScroll, true);
}
this.__resize_rendered__ = rendered;
runCallbacks(this);
}
}
function handleScroll () {
var this$1$1 = this;
// `this` denotes the scrolling element
resetTriggers(this);
if (this.__resize_raf__) {
cancelAnimationFrame(this.__resize_raf__);
}
this.__resize_raf__ = requestAnimationFrame(function () {
var updated = getUpdatedSize(this$1$1);
if (updated) {
this$1$1.__resize_last__ = updated;
runCallbacks(this$1$1);
}
});
}
function runCallbacks (elem) {
if (!elem || !elem.__resize_listeners__) {
return
}
elem.__resize_listeners__.forEach(function (callback) {
callback.call(elem, elem);
});
}
function initTriggers (elem) {
var position = getComputedStyle(elem, 'position');
if (!position || position === 'static') {
elem.style.position = 'relative';
}
elem.__resize_old_position__ = position;
elem.__resize_last__ = {};
var triggers = createElement('div', {
className: 'resize-triggers'
});
var expand = createElement('div', {
className: 'resize-expand-trigger'
});
var expandChild = createElement('div');
var contract = createElement('div', {
className: 'resize-contract-trigger'
});
expand.appendChild(expandChild);
triggers.appendChild(expand);
triggers.appendChild(contract);
elem.appendChild(triggers);
elem.__resize_triggers__ = {
triggers: triggers,
expand: expand,
expandChild: expandChild,
contract: contract
};
resetTriggers(elem);
elem.addEventListener('scroll', handleScroll, true);
elem.__resize_last__ = {
width: elem.offsetWidth,
height: elem.offsetHeight
};
}
function resetTriggers (elem) {
var ref = elem.__resize_triggers__;
var expand = ref.expand;
var expandChild = ref.expandChild;
var contract = ref.contract;
// batch read
var csw = contract.scrollWidth;
var csh = contract.scrollHeight;
var eow = expand.offsetWidth;
var eoh = expand.offsetHeight;
var esw = expand.scrollWidth;
var esh = expand.scrollHeight;
// batch write
contract.scrollLeft = csw;
contract.scrollTop = csh;
expandChild.style.width = eow + 1 + 'px';
expandChild.style.height = eoh + 1 + 'px';
expand.scrollLeft = esw;
expand.scrollTop = esh;
}
function useAutoresize(chart, autoresize, root) {
var resizeListener = null;
vueDemi.watch([root, chart, autoresize], function (_a, _, cleanup) {
var root = _a[0], chart = _a[1], autoresize = _a[2];
if (root && chart && autoresize) {
var autoresizeOptions = autoresize === true ? {} : autoresize;
var _b = autoresizeOptions.throttle, wait = _b === void 0 ? 100 : _b, onResize_1 = autoresizeOptions.onResize;
var callback = function () {
chart.resize();
onResize_1 === null || onResize_1 === void 0 ? void 0 : onResize_1();
};
resizeListener = wait ? core.throttle(callback, wait) : callback;
addListener(root, resizeListener);
}
cleanup(function () {
if (root && resizeListener) {
removeListener(root, resizeListener);
}
});
});
}
var autoresizeProps = {
autoresize: [Boolean, Object]
};
var onRE = /^on[^a-z]/;
var isOn = function (key) { return onRE.test(key); };
function omitOn(attrs) {
var result = {};
for (var key in attrs) {
if (!isOn(key)) {
result[key] = attrs[key];
}
}
return result;
}
function unwrapInjected(injection, defaultValue) {
var value = vueDemi.isRef(injection) ? vueDemi.unref(injection) : injection;
if (value && typeof value === "object" && "value" in value) {
return value.value || defaultValue;
}
return value || defaultValue;
}
var LOADING_OPTIONS_KEY = "ecLoadingOptions";
function useLoading(chart, loading, loadingOptions) {
var defaultLoadingOptions = vueDemi.inject(LOADING_OPTIONS_KEY, {});
var realLoadingOptions = vueDemi.computed(function () { return (__assign(__assign({}, unwrapInjected(defaultLoadingOptions, {})), loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.value)); });
vueDemi.watchEffect(function () {
var instance = chart.value;
if (!instance) {
return;
}
if (loading.value) {
instance.showLoading(realLoadingOptions.value);
}
else {
instance.hideLoading();
}
});
}
var loadingProps = {
loading: Boolean,
loadingOptions: Object
};
var TAG_NAME = "x-vue-echarts";
if (vueDemi.Vue2) {
vueDemi.Vue2.config.ignoredElements.push(TAG_NAME);
}
var THEME_KEY = "ecTheme";
var INIT_OPTIONS_KEY = "ecInitOptions";
var UPDATE_OPTIONS_KEY = "ecUpdateOptions";
var NATIVE_EVENT_RE = /(^&?~?!?)native:/;
var ECharts = vueDemi.defineComponent({
name: "echarts",
props: __assign(__assign({ option: Object, theme: {
type: [Object, String]
}, initOptions: Object, updateOptions: Object, group: String, manualUpdate: Boolean }, autoresizeProps), loadingProps),
emits: {},
inheritAttrs: false,
setup: function (props, _a) {
var attrs = _a.attrs;
var root = vueDemi.shallowRef();
var inner = vueDemi.shallowRef();
var chart = vueDemi.shallowRef();
var manualOption = vueDemi.shallowRef();
var defaultTheme = vueDemi.inject(THEME_KEY, null);
var defaultInitOptions = vueDemi.inject(INIT_OPTIONS_KEY, null);
var defaultUpdateOptions = vueDemi.inject(UPDATE_OPTIONS_KEY, null);
var _b = vueDemi.toRefs(props), autoresize = _b.autoresize, manualUpdate = _b.manualUpdate, loading = _b.loading, loadingOptions = _b.loadingOptions;
var realOption = vueDemi.computed(function () { return manualOption.value || props.option || null; });
var realTheme = vueDemi.computed(function () { return props.theme || unwrapInjected(defaultTheme, {}); });
var realInitOptions = vueDemi.computed(function () { return props.initOptions || unwrapInjected(defaultInitOptions, {}); });
var realUpdateOptions = vueDemi.computed(function () { return props.updateOptions || unwrapInjected(defaultUpdateOptions, {}); });
var nonEventAttrs = vueDemi.computed(function () { return omitOn(attrs); });
var nativeListeners = {};
var listeners = vueDemi.getCurrentInstance().proxy.$listeners;
var realListeners = {};
if (!listeners) {
Object.keys(attrs)
.filter(function (key) { return isOn(key); })
.forEach(function (key) {
var event = key.charAt(2).toLowerCase() + key.slice(3);
if (event.indexOf("native:") === 0) {
var nativeKey = "on".concat(event.charAt(7).toUpperCase()).concat(event.slice(8));
nativeListeners[nativeKey] = attrs[key];
return;
}
if (event.substring(event.length - 4) === "Once") {
event = "~".concat(event.substring(0, event.length - 4));
}
realListeners[event] = attrs[key];
});
}
else {
Object.keys(listeners).forEach(function (key) {
if (NATIVE_EVENT_RE.test(key)) {
nativeListeners[key.replace(NATIVE_EVENT_RE, "$1")] = listeners[key];
}
else {
realListeners[key] = listeners[key];
}
});
}
function init(option) {
if (!inner.value) {
return;
}
var instance = (chart.value = core.init(inner.value, realTheme.value, realInitOptions.value));
if (props.group) {
instance.group = props.group;
}
Object.keys(realListeners).forEach(function (key) {
var handler = realListeners[key];
if (!handler) {
return;
}
var event = key.toLowerCase();
if (event.charAt(0) === "~") {
event = event.substring(1);
handler.__once__ = true;
}
var target = instance;
if (event.indexOf("zr:") === 0) {
target = instance.getZr();
event = event.substring(3);
}
if (handler.__once__) {
delete handler.__once__;
var raw_1 = handler;
handler = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
raw_1.apply(void 0, args);
target.off(event, handler);
};
}
target.on(event, handler);
});
function resize() {
if (instance && !instance.isDisposed()) {
instance.resize();
}
}
function commit() {
var opt = option || realOption.value;
if (opt) {
instance.setOption(opt, realUpdateOptions.value);
}
}
if (autoresize.value) {
vueDemi.nextTick(function () {
resize();
commit();
});
}
else {
commit();
}
}
function setOption(option, updateOptions) {
if (props.manualUpdate) {
manualOption.value = option;
}
if (!chart.value) {
init(option);
}
else {
chart.value.setOption(option, updateOptions || {});
}
}
function cleanup() {
if (chart.value) {
chart.value.dispose();
chart.value = undefined;
}
}
var unwatchOption = null;
vueDemi.watch(manualUpdate, function (manualUpdate) {
if (typeof unwatchOption === "function") {
unwatchOption();
unwatchOption = null;
}
if (!manualUpdate) {
unwatchOption = vueDemi.watch(function () { return props.option; }, function (option, oldOption) {
if (!option) {
return;
}
if (!chart.value) {
init();
}
else {
chart.value.setOption(option, __assign({ notMerge: option !== oldOption }, realUpdateOptions.value));
}
}, { deep: true });
}
}, {
immediate: true
});
vueDemi.watch([realTheme, realInitOptions], function () {
cleanup();
init();
}, {
deep: true
});
vueDemi.watchEffect(function () {
if (props.group && chart.value) {
chart.value.group = props.group;
}
});
var publicApi = usePublicAPI(chart);
useLoading(chart, loading, loadingOptions);
useAutoresize(chart, autoresize, inner);
vueDemi.onMounted(function () {
init();
});
vueDemi.onBeforeUnmount(function () {
{
cleanup();
}
});
return __assign({ chart: chart, root: root, inner: inner, setOption: setOption, nonEventAttrs: nonEventAttrs, nativeListeners: nativeListeners }, publicApi);
},
render: function () {
var attrs = (vueDemi.Vue2
? { attrs: this.nonEventAttrs, on: this.nativeListeners }
: __assign(__assign({}, this.nonEventAttrs), this.nativeListeners));
attrs.ref = "root";
attrs["class"] = attrs["class"] ? ["echarts"].concat(attrs["class"]) : "echarts";
return vueDemi.h(TAG_NAME, attrs, [
vueDemi.h("div", { ref: "inner", "class": "vue-echarts-inner" })
]);
}
});
var exported = /*#__PURE__*/Object.freeze({
__proto__: null,
'default': ECharts,
LOADING_OPTIONS_KEY: LOADING_OPTIONS_KEY,
THEME_KEY: THEME_KEY,
INIT_OPTIONS_KEY: INIT_OPTIONS_KEY,
UPDATE_OPTIONS_KEY: UPDATE_OPTIONS_KEY
});
var global = __assign(__assign({}, ECharts), exported);
return global;
}));
//# sourceMappingURL=index.umd.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
frontend/node_modules/vue-echarts/dist/csp/style.css generated vendored Normal file
View File

@@ -0,0 +1,2 @@
x-vue-echarts{display:flex;flex-direction:column;width:100%;height:100%;min-width:0}
.vue-echarts-inner{flex-grow:1;min-width:0;width:auto!important;height:auto!important}

371
frontend/node_modules/vue-echarts/dist/index.cjs.js generated vendored Normal file
View File

@@ -0,0 +1,371 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vueDemi = require('vue-demi');
var core = require('echarts/core');
var resizeDetector = require('resize-detector');
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var METHOD_NAMES = [
"getWidth",
"getHeight",
"getDom",
"getOption",
"resize",
"dispatchAction",
"convertToPixel",
"convertFromPixel",
"containPixel",
"getDataURL",
"getConnectedDataURL",
"appendData",
"clear",
"isDisposed",
"dispose"
];
function usePublicAPI(chart) {
function makePublicMethod(name) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!chart.value) {
throw new Error("ECharts is not initialized yet.");
}
return chart.value[name].apply(chart.value, args);
};
}
function makePublicMethods() {
var methods = Object.create(null);
METHOD_NAMES.forEach(function (name) {
methods[name] = makePublicMethod(name);
});
return methods;
}
return makePublicMethods();
}
function useAutoresize(chart, autoresize, root) {
var resizeListener = null;
vueDemi.watch([root, chart, autoresize], function (_a, _, cleanup) {
var root = _a[0], chart = _a[1], autoresize = _a[2];
if (root && chart && autoresize) {
var autoresizeOptions = autoresize === true ? {} : autoresize;
var _b = autoresizeOptions.throttle, wait = _b === void 0 ? 100 : _b, onResize_1 = autoresizeOptions.onResize;
var callback = function () {
chart.resize();
onResize_1 === null || onResize_1 === void 0 ? void 0 : onResize_1();
};
resizeListener = wait ? core.throttle(callback, wait) : callback;
resizeDetector.addListener(root, resizeListener);
}
cleanup(function () {
if (root && resizeListener) {
resizeDetector.removeListener(root, resizeListener);
}
});
});
}
var autoresizeProps = {
autoresize: [Boolean, Object]
};
var onRE = /^on[^a-z]/;
var isOn = function (key) { return onRE.test(key); };
function omitOn(attrs) {
var result = {};
for (var key in attrs) {
if (!isOn(key)) {
result[key] = attrs[key];
}
}
return result;
}
function unwrapInjected(injection, defaultValue) {
var value = vueDemi.isRef(injection) ? vueDemi.unref(injection) : injection;
if (value && typeof value === "object" && "value" in value) {
return value.value || defaultValue;
}
return value || defaultValue;
}
var LOADING_OPTIONS_KEY = "ecLoadingOptions";
function useLoading(chart, loading, loadingOptions) {
var defaultLoadingOptions = vueDemi.inject(LOADING_OPTIONS_KEY, {});
var realLoadingOptions = vueDemi.computed(function () { return (__assign(__assign({}, unwrapInjected(defaultLoadingOptions, {})), loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.value)); });
vueDemi.watchEffect(function () {
var instance = chart.value;
if (!instance) {
return;
}
if (loading.value) {
instance.showLoading(realLoadingOptions.value);
}
else {
instance.hideLoading();
}
});
}
var loadingProps = {
loading: Boolean,
loadingOptions: Object
};
var registered = null;
var TAG_NAME = "x-vue-echarts";
function register() {
if (registered != null) {
return registered;
}
if (typeof HTMLElement === "undefined" ||
typeof customElements === "undefined") {
return (registered = false);
}
try {
var reg = new Function("tag", "class EChartsElement extends HTMLElement {\n __dispose = null;\n\n disconnectedCallback() {\n if (this.__dispose) {\n this.__dispose();\n this.__dispose = null;\n }\n }\n}\n\nif (customElements.get(tag) == null) {\n customElements.define(tag, EChartsElement);\n}\n");
reg(TAG_NAME);
}
catch (e) {
return (registered = false);
}
return (registered = true);
}
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
var css = "x-vue-echarts{display:flex;flex-direction:column;width:100%;height:100%;min-width:0}\n.vue-echarts-inner{flex-grow:1;min-width:0;width:auto!important;height:auto!important}\n";
n(css,{});
var wcRegistered = register();
if (vueDemi.Vue2) {
vueDemi.Vue2.config.ignoredElements.push(TAG_NAME);
}
var THEME_KEY = "ecTheme";
var INIT_OPTIONS_KEY = "ecInitOptions";
var UPDATE_OPTIONS_KEY = "ecUpdateOptions";
var NATIVE_EVENT_RE = /(^&?~?!?)native:/;
var ECharts = vueDemi.defineComponent({
name: "echarts",
props: __assign(__assign({ option: Object, theme: {
type: [Object, String]
}, initOptions: Object, updateOptions: Object, group: String, manualUpdate: Boolean }, autoresizeProps), loadingProps),
emits: {},
inheritAttrs: false,
setup: function (props, _a) {
var attrs = _a.attrs;
var root = vueDemi.shallowRef();
var inner = vueDemi.shallowRef();
var chart = vueDemi.shallowRef();
var manualOption = vueDemi.shallowRef();
var defaultTheme = vueDemi.inject(THEME_KEY, null);
var defaultInitOptions = vueDemi.inject(INIT_OPTIONS_KEY, null);
var defaultUpdateOptions = vueDemi.inject(UPDATE_OPTIONS_KEY, null);
var _b = vueDemi.toRefs(props), autoresize = _b.autoresize, manualUpdate = _b.manualUpdate, loading = _b.loading, loadingOptions = _b.loadingOptions;
var realOption = vueDemi.computed(function () { return manualOption.value || props.option || null; });
var realTheme = vueDemi.computed(function () { return props.theme || unwrapInjected(defaultTheme, {}); });
var realInitOptions = vueDemi.computed(function () { return props.initOptions || unwrapInjected(defaultInitOptions, {}); });
var realUpdateOptions = vueDemi.computed(function () { return props.updateOptions || unwrapInjected(defaultUpdateOptions, {}); });
var nonEventAttrs = vueDemi.computed(function () { return omitOn(attrs); });
var nativeListeners = {};
var listeners = vueDemi.getCurrentInstance().proxy.$listeners;
var realListeners = {};
if (!listeners) {
Object.keys(attrs)
.filter(function (key) { return isOn(key); })
.forEach(function (key) {
var event = key.charAt(2).toLowerCase() + key.slice(3);
if (event.indexOf("native:") === 0) {
var nativeKey = "on".concat(event.charAt(7).toUpperCase()).concat(event.slice(8));
nativeListeners[nativeKey] = attrs[key];
return;
}
if (event.substring(event.length - 4) === "Once") {
event = "~".concat(event.substring(0, event.length - 4));
}
realListeners[event] = attrs[key];
});
}
else {
Object.keys(listeners).forEach(function (key) {
if (NATIVE_EVENT_RE.test(key)) {
nativeListeners[key.replace(NATIVE_EVENT_RE, "$1")] = listeners[key];
}
else {
realListeners[key] = listeners[key];
}
});
}
function init(option) {
if (!inner.value) {
return;
}
var instance = (chart.value = core.init(inner.value, realTheme.value, realInitOptions.value));
if (props.group) {
instance.group = props.group;
}
Object.keys(realListeners).forEach(function (key) {
var handler = realListeners[key];
if (!handler) {
return;
}
var event = key.toLowerCase();
if (event.charAt(0) === "~") {
event = event.substring(1);
handler.__once__ = true;
}
var target = instance;
if (event.indexOf("zr:") === 0) {
target = instance.getZr();
event = event.substring(3);
}
if (handler.__once__) {
delete handler.__once__;
var raw_1 = handler;
handler = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
raw_1.apply(void 0, args);
target.off(event, handler);
};
}
target.on(event, handler);
});
function resize() {
if (instance && !instance.isDisposed()) {
instance.resize();
}
}
function commit() {
var opt = option || realOption.value;
if (opt) {
instance.setOption(opt, realUpdateOptions.value);
}
}
if (autoresize.value) {
vueDemi.nextTick(function () {
resize();
commit();
});
}
else {
commit();
}
}
function setOption(option, updateOptions) {
if (props.manualUpdate) {
manualOption.value = option;
}
if (!chart.value) {
init(option);
}
else {
chart.value.setOption(option, updateOptions || {});
}
}
function cleanup() {
if (chart.value) {
chart.value.dispose();
chart.value = undefined;
}
}
var unwatchOption = null;
vueDemi.watch(manualUpdate, function (manualUpdate) {
if (typeof unwatchOption === "function") {
unwatchOption();
unwatchOption = null;
}
if (!manualUpdate) {
unwatchOption = vueDemi.watch(function () { return props.option; }, function (option, oldOption) {
if (!option) {
return;
}
if (!chart.value) {
init();
}
else {
chart.value.setOption(option, __assign({ notMerge: option !== oldOption }, realUpdateOptions.value));
}
}, { deep: true });
}
}, {
immediate: true
});
vueDemi.watch([realTheme, realInitOptions], function () {
cleanup();
init();
}, {
deep: true
});
vueDemi.watchEffect(function () {
if (props.group && chart.value) {
chart.value.group = props.group;
}
});
var publicApi = usePublicAPI(chart);
useLoading(chart, loading, loadingOptions);
useAutoresize(chart, autoresize, inner);
vueDemi.onMounted(function () {
init();
});
vueDemi.onBeforeUnmount(function () {
if (wcRegistered && root.value) {
root.value.__dispose = cleanup;
}
else {
cleanup();
}
});
return __assign({ chart: chart, root: root, inner: inner, setOption: setOption, nonEventAttrs: nonEventAttrs, nativeListeners: nativeListeners }, publicApi);
},
render: function () {
var attrs = (vueDemi.Vue2
? { attrs: this.nonEventAttrs, on: this.nativeListeners }
: __assign(__assign({}, this.nonEventAttrs), this.nativeListeners));
attrs.ref = "root";
attrs["class"] = attrs["class"] ? ["echarts"].concat(attrs["class"]) : "echarts";
return vueDemi.h(TAG_NAME, attrs, [
vueDemi.h("div", { ref: "inner", "class": "vue-echarts-inner" })
]);
}
});
exports.INIT_OPTIONS_KEY = INIT_OPTIONS_KEY;
exports.LOADING_OPTIONS_KEY = LOADING_OPTIONS_KEY;
exports.THEME_KEY = THEME_KEY;
exports.UPDATE_OPTIONS_KEY = UPDATE_OPTIONS_KEY;
exports["default"] = ECharts;
//# sourceMappingURL=index.cjs.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

347
frontend/node_modules/vue-echarts/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,347 @@
import { PropType, InjectionKey } from "vue-demi";
import { Ref as Ref$0 } from "vue-demi";
import { init } from "echarts/core";
import { SetOptionOpts, ECElementEvent, ElementEvent } from "echarts";
import { Ref } from "vue";
type Injection<T> = T | null | Ref<T | null> | {
value: T | null;
};
type InitType = typeof init;
type InitParameters = Parameters<InitType>;
type Theme = NonNullable<InitParameters[1]>;
type ThemeInjection = Injection<Theme>;
type InitOptions = NonNullable<InitParameters[2]>;
type InitOptionsInjection = Injection<InitOptions>;
type UpdateOptions = SetOptionOpts;
type UpdateOptionsInjection = Injection<UpdateOptions>;
type EChartsType = ReturnType<InitType>;
type SetOptionType = EChartsType["setOption"];
type Option = Parameters<SetOptionType>[0];
type LoadingOptions = {
text?: string;
textColor?: string;
fontSize?: number | string;
fontWeight?: number | string;
fontStyle?: string;
fontFamily?: string;
maskColor?: string;
showSpinner?: boolean;
color?: string;
spinnerRadius?: number;
lineWidth?: number;
zlevel?: number;
};
interface EChartsElement extends HTMLElement {
__dispose: (() => void) | null;
}
declare const THEME_KEY: InjectionKey<ThemeInjection>;
declare const INIT_OPTIONS_KEY: InjectionKey<InitOptionsInjection>;
declare const UPDATE_OPTIONS_KEY: InjectionKey<UpdateOptionsInjection>;
declare const LOADING_OPTIONS_KEY: InjectionKey<LoadingOptions | Ref$0<LoadingOptions>>;
declare const _default: import("vue-demi").DefineComponent<{
loading: BooleanConstructor;
loadingOptions: PropType<LoadingOptions>;
autoresize: PropType<boolean | {
throttle?: number | undefined;
onResize?: (() => void) | undefined;
}>;
option: PropType<import("echarts/types/dist/shared").ECBasicOption>;
theme: {
type: PropType<Theme>;
};
initOptions: PropType<import("echarts/types/dist/shared").EChartsInitOpts>;
updateOptions: PropType<import("echarts/types/dist/echarts").SetOptionOpts>;
group: StringConstructor;
manualUpdate: BooleanConstructor;
}, {
getWidth: () => number;
getHeight: () => number;
getDom: () => HTMLElement;
getOption: () => import("echarts/types/dist/shared").ECBasicOption;
resize: (opts?: import("echarts/types/dist/shared").ResizeOpts | undefined) => void;
dispatchAction: (payload: import("echarts/types/dist/shared").Payload, opt?: boolean | {
silent?: boolean | undefined;
flush?: boolean | undefined;
} | undefined) => void;
convertToPixel: {
(finder: string | {
seriesIndex?: (number | false | number[] | "all" | "none") | undefined;
seriesId?: ((string | number) | (string | number)[]) | undefined;
seriesName?: ((string | number) | (string | number)[]) | undefined;
geoIndex?: (number | false | number[] | "all" | "none") | undefined;
geoId?: ((string | number) | (string | number)[]) | undefined;
geoName?: ((string | number) | (string | number)[]) | undefined;
bmapIndex?: (number | false | number[] | "all" | "none") | undefined;
bmapId?: ((string | number) | (string | number)[]) | undefined;
bmapName?: ((string | number) | (string | number)[]) | undefined;
xAxisIndex?: (number | false | number[] | "all" | "none") | undefined;
xAxisId?: ((string | number) | (string | number)[]) | undefined;
xAxisName?: ((string | number) | (string | number)[]) | undefined;
yAxisIndex?: (number | false | number[] | "all" | "none") | undefined;
yAxisId?: ((string | number) | (string | number)[]) | undefined;
yAxisName?: ((string | number) | (string | number)[]) | undefined;
gridIndex?: (number | false | number[] | "all" | "none") | undefined;
gridId?: ((string | number) | (string | number)[]) | undefined;
gridName?: ((string | number) | (string | number)[]) | undefined;
dataIndex?: number | undefined;
dataIndexInside?: number | undefined;
}, value: (string | number) | Date): number;
(finder: string | {
seriesIndex?: (number | false | number[] | "all" | "none") | undefined;
seriesId?: ((string | number) | (string | number)[]) | undefined;
seriesName?: ((string | number) | (string | number)[]) | undefined;
geoIndex?: (number | false | number[] | "all" | "none") | undefined;
geoId?: ((string | number) | (string | number)[]) | undefined;
geoName?: ((string | number) | (string | number)[]) | undefined;
bmapIndex?: (number | false | number[] | "all" | "none") | undefined;
bmapId?: ((string | number) | (string | number)[]) | undefined;
bmapName?: ((string | number) | (string | number)[]) | undefined;
xAxisIndex?: (number | false | number[] | "all" | "none") | undefined;
xAxisId?: ((string | number) | (string | number)[]) | undefined;
xAxisName?: ((string | number) | (string | number)[]) | undefined;
yAxisIndex?: (number | false | number[] | "all" | "none") | undefined;
yAxisId?: ((string | number) | (string | number)[]) | undefined;
yAxisName?: ((string | number) | (string | number)[]) | undefined;
gridIndex?: (number | false | number[] | "all" | "none") | undefined;
gridId?: ((string | number) | (string | number)[]) | undefined;
gridName?: ((string | number) | (string | number)[]) | undefined;
dataIndex?: number | undefined;
dataIndexInside?: number | undefined;
}, value: ((string | number) | Date)[]): number[];
};
convertFromPixel: {
(finder: string | {
seriesIndex?: (number | false | number[] | "all" | "none") | undefined;
seriesId?: ((string | number) | (string | number)[]) | undefined;
seriesName?: ((string | number) | (string | number)[]) | undefined;
geoIndex?: (number | false | number[] | "all" | "none") | undefined;
geoId?: ((string | number) | (string | number)[]) | undefined;
geoName?: ((string | number) | (string | number)[]) | undefined;
bmapIndex?: (number | false | number[] | "all" | "none") | undefined;
bmapId?: ((string | number) | (string | number)[]) | undefined;
bmapName?: ((string | number) | (string | number)[]) | undefined;
xAxisIndex?: (number | false | number[] | "all" | "none") | undefined;
xAxisId?: ((string | number) | (string | number)[]) | undefined;
xAxisName?: ((string | number) | (string | number)[]) | undefined;
yAxisIndex?: (number | false | number[] | "all" | "none") | undefined;
yAxisId?: ((string | number) | (string | number)[]) | undefined;
yAxisName?: ((string | number) | (string | number)[]) | undefined;
gridIndex?: (number | false | number[] | "all" | "none") | undefined;
gridId?: ((string | number) | (string | number)[]) | undefined;
gridName?: ((string | number) | (string | number)[]) | undefined;
dataIndex?: number | undefined;
dataIndexInside?: number | undefined;
}, value: number): number;
(finder: string | {
seriesIndex?: (number | false | number[] | "all" | "none") | undefined;
seriesId?: ((string | number) | (string | number)[]) | undefined;
seriesName?: ((string | number) | (string | number)[]) | undefined;
geoIndex?: (number | false | number[] | "all" | "none") | undefined;
geoId?: ((string | number) | (string | number)[]) | undefined;
geoName?: ((string | number) | (string | number)[]) | undefined;
bmapIndex?: (number | false | number[] | "all" | "none") | undefined;
bmapId?: ((string | number) | (string | number)[]) | undefined;
bmapName?: ((string | number) | (string | number)[]) | undefined;
xAxisIndex?: (number | false | number[] | "all" | "none") | undefined;
xAxisId?: ((string | number) | (string | number)[]) | undefined;
xAxisName?: ((string | number) | (string | number)[]) | undefined;
yAxisIndex?: (number | false | number[] | "all" | "none") | undefined;
yAxisId?: ((string | number) | (string | number)[]) | undefined;
yAxisName?: ((string | number) | (string | number)[]) | undefined;
gridIndex?: (number | false | number[] | "all" | "none") | undefined;
gridId?: ((string | number) | (string | number)[]) | undefined;
gridName?: ((string | number) | (string | number)[]) | undefined;
dataIndex?: number | undefined;
dataIndexInside?: number | undefined;
}, value: number[]): number[];
};
containPixel: (finder: string | {
seriesIndex?: (number | false | number[] | "all" | "none") | undefined;
seriesId?: ((string | number) | (string | number)[]) | undefined;
seriesName?: ((string | number) | (string | number)[]) | undefined;
geoIndex?: (number | false | number[] | "all" | "none") | undefined;
geoId?: ((string | number) | (string | number)[]) | undefined;
geoName?: ((string | number) | (string | number)[]) | undefined;
bmapIndex?: (number | false | number[] | "all" | "none") | undefined;
bmapId?: ((string | number) | (string | number)[]) | undefined;
bmapName?: ((string | number) | (string | number)[]) | undefined;
xAxisIndex?: (number | false | number[] | "all" | "none") | undefined;
xAxisId?: ((string | number) | (string | number)[]) | undefined;
xAxisName?: ((string | number) | (string | number)[]) | undefined;
yAxisIndex?: (number | false | number[] | "all" | "none") | undefined;
yAxisId?: ((string | number) | (string | number)[]) | undefined;
yAxisName?: ((string | number) | (string | number)[]) | undefined;
gridIndex?: (number | false | number[] | "all" | "none") | undefined;
gridId?: ((string | number) | (string | number)[]) | undefined;
gridName?: ((string | number) | (string | number)[]) | undefined;
dataIndex?: number | undefined;
dataIndexInside?: number | undefined;
}, value: number[]) => boolean;
getDataURL: (opts?: {
type?: "svg" | "png" | "jpeg" | undefined;
pixelRatio?: number | undefined;
backgroundColor?: import("echarts/types/dist/shared").ZRColor | undefined;
excludeComponents?: string[] | undefined;
} | undefined) => string;
getConnectedDataURL: (opts?: {
type?: "svg" | "png" | "jpeg" | undefined;
pixelRatio?: number | undefined;
backgroundColor?: import("echarts/types/dist/shared").ZRColor | undefined;
connectedBackgroundColor?: import("echarts/types/dist/shared").ZRColor | undefined;
excludeComponents?: string[] | undefined;
} | undefined) => string;
appendData: (params: {
seriesIndex: number;
data: any;
}) => void;
clear: () => void;
isDisposed: () => boolean;
dispose: () => void;
chart: import("vue-demi").ShallowRef<import("echarts/types/dist/shared").EChartsType | undefined>;
root: import("vue-demi").ShallowRef<EChartsElement | undefined>;
inner: import("vue-demi").ShallowRef<HTMLElement | undefined>;
setOption: (option: Option, updateOptions?: import("echarts/types/dist/echarts").SetOptionOpts | undefined) => void;
nonEventAttrs: import("vue-demi").ComputedRef<{
[key: string]: any;
}>;
nativeListeners: Record<string, unknown>;
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {
click: (params: import("echarts/types/dist/echarts").ECElementEvent) => boolean;
dblclick: (params: import("echarts/types/dist/echarts").ECElementEvent) => boolean;
mouseout: (params: import("echarts/types/dist/echarts").ECElementEvent) => boolean;
mouseover: (params: import("echarts/types/dist/echarts").ECElementEvent) => boolean;
mouseup: (params: import("echarts/types/dist/echarts").ECElementEvent) => boolean;
mousedown: (params: import("echarts/types/dist/echarts").ECElementEvent) => boolean;
mousemove: (params: import("echarts/types/dist/echarts").ECElementEvent) => boolean;
contextmenu: (params: import("echarts/types/dist/echarts").ECElementEvent) => boolean;
globalout: (params: import("echarts/types/dist/echarts").ECElementEvent) => boolean;
} & {
highlight: null;
downplay: null;
selectchanged: null;
legendselectchanged: null;
legendselected: null;
legendunselected: null;
legendselectall: null;
legendinverseselect: null;
legendscroll: null;
datazoom: null;
datarangeselected: null;
graphroam: null;
georoam: null;
treeroam: null;
timelinechanged: null;
timelineplaychanged: null;
restore: null;
dataviewchanged: null;
magictypechanged: null;
geoselectchanged: null;
geoselected: null;
geounselected: null;
axisareaselected: null;
brush: null;
brushEnd: null;
brushselected: null;
globalcursortaken: null;
} & {
rendered: (params: {
elapsedTime: number;
}) => boolean;
finished: () => boolean;
} & {
"zr:mousewheel": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:drag": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:dragstart": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:dragend": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:dragenter": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:dragleave": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:dragover": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:drop": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:click": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:dblclick": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:mouseout": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:mouseover": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:mouseup": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:mousedown": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:mousemove": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:contextmenu": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
"zr:globalout": (params: import("echarts/types/dist/echarts").ElementEvent) => boolean;
}, string, import("vue-demi").PublicProps, Readonly<import("vue-demi").ExtractPropTypes<{
loading: BooleanConstructor;
loadingOptions: PropType<LoadingOptions>;
autoresize: PropType<boolean | {
throttle?: number | undefined;
onResize?: (() => void) | undefined;
}>;
option: PropType<import("echarts/types/dist/shared").ECBasicOption>;
theme: {
type: PropType<Theme>;
};
initOptions: PropType<import("echarts/types/dist/shared").EChartsInitOpts>;
updateOptions: PropType<import("echarts/types/dist/echarts").SetOptionOpts>;
group: StringConstructor;
manualUpdate: BooleanConstructor;
}>> & {
onClick?: ((params: import("echarts/types/dist/echarts").ECElementEvent) => any) | undefined;
onDblclick?: ((params: import("echarts/types/dist/echarts").ECElementEvent) => any) | undefined;
onMouseout?: ((params: import("echarts/types/dist/echarts").ECElementEvent) => any) | undefined;
onMouseover?: ((params: import("echarts/types/dist/echarts").ECElementEvent) => any) | undefined;
onMouseup?: ((params: import("echarts/types/dist/echarts").ECElementEvent) => any) | undefined;
onMousedown?: ((params: import("echarts/types/dist/echarts").ECElementEvent) => any) | undefined;
onMousemove?: ((params: import("echarts/types/dist/echarts").ECElementEvent) => any) | undefined;
onContextmenu?: ((params: import("echarts/types/dist/echarts").ECElementEvent) => any) | undefined;
onGlobalout?: ((params: import("echarts/types/dist/echarts").ECElementEvent) => any) | undefined;
"onZr:mousewheel"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:drag"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:dragstart"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:dragend"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:dragenter"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:dragleave"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:dragover"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:drop"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:click"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:dblclick"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:mouseout"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:mouseover"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:mouseup"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:mousedown"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:mousemove"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:contextmenu"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
"onZr:globalout"?: ((params: import("echarts/types/dist/echarts").ElementEvent) => any) | undefined;
onHighlight?: ((...args: any[]) => any) | undefined;
onDownplay?: ((...args: any[]) => any) | undefined;
onSelectchanged?: ((...args: any[]) => any) | undefined;
onLegendselectchanged?: ((...args: any[]) => any) | undefined;
onLegendselected?: ((...args: any[]) => any) | undefined;
onLegendunselected?: ((...args: any[]) => any) | undefined;
onLegendselectall?: ((...args: any[]) => any) | undefined;
onLegendinverseselect?: ((...args: any[]) => any) | undefined;
onLegendscroll?: ((...args: any[]) => any) | undefined;
onDatazoom?: ((...args: any[]) => any) | undefined;
onDatarangeselected?: ((...args: any[]) => any) | undefined;
onGraphroam?: ((...args: any[]) => any) | undefined;
onGeoroam?: ((...args: any[]) => any) | undefined;
onTreeroam?: ((...args: any[]) => any) | undefined;
onTimelinechanged?: ((...args: any[]) => any) | undefined;
onTimelineplaychanged?: ((...args: any[]) => any) | undefined;
onRestore?: ((...args: any[]) => any) | undefined;
onDataviewchanged?: ((...args: any[]) => any) | undefined;
onMagictypechanged?: ((...args: any[]) => any) | undefined;
onGeoselectchanged?: ((...args: any[]) => any) | undefined;
onGeoselected?: ((...args: any[]) => any) | undefined;
onGeounselected?: ((...args: any[]) => any) | undefined;
onAxisareaselected?: ((...args: any[]) => any) | undefined;
onBrush?: ((...args: any[]) => any) | undefined;
onBrushEnd?: ((...args: any[]) => any) | undefined;
onBrushselected?: ((...args: any[]) => any) | undefined;
onGlobalcursortaken?: ((...args: any[]) => any) | undefined;
onRendered?: ((params: {
elapsedTime: number;
}) => any) | undefined;
onFinished?: (() => any) | undefined;
}, {
manualUpdate: boolean;
loading: boolean;
}, {}>;
declare const ECharts: typeof _default;
export { ECharts as default, THEME_KEY, INIT_OPTIONS_KEY, UPDATE_OPTIONS_KEY, LOADING_OPTIONS_KEY, _default };

363
frontend/node_modules/vue-echarts/dist/index.esm.js generated vendored Normal file
View File

@@ -0,0 +1,363 @@
import { watch, isRef, unref, inject, computed, watchEffect, Vue2, defineComponent, shallowRef, toRefs, getCurrentInstance, onMounted, onBeforeUnmount, h, nextTick } from 'vue-demi';
import { throttle, init } from 'echarts/core';
import { addListener, removeListener } from 'resize-detector';
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var METHOD_NAMES = [
"getWidth",
"getHeight",
"getDom",
"getOption",
"resize",
"dispatchAction",
"convertToPixel",
"convertFromPixel",
"containPixel",
"getDataURL",
"getConnectedDataURL",
"appendData",
"clear",
"isDisposed",
"dispose"
];
function usePublicAPI(chart) {
function makePublicMethod(name) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!chart.value) {
throw new Error("ECharts is not initialized yet.");
}
return chart.value[name].apply(chart.value, args);
};
}
function makePublicMethods() {
var methods = Object.create(null);
METHOD_NAMES.forEach(function (name) {
methods[name] = makePublicMethod(name);
});
return methods;
}
return makePublicMethods();
}
function useAutoresize(chart, autoresize, root) {
var resizeListener = null;
watch([root, chart, autoresize], function (_a, _, cleanup) {
var root = _a[0], chart = _a[1], autoresize = _a[2];
if (root && chart && autoresize) {
var autoresizeOptions = autoresize === true ? {} : autoresize;
var _b = autoresizeOptions.throttle, wait = _b === void 0 ? 100 : _b, onResize_1 = autoresizeOptions.onResize;
var callback = function () {
chart.resize();
onResize_1 === null || onResize_1 === void 0 ? void 0 : onResize_1();
};
resizeListener = wait ? throttle(callback, wait) : callback;
addListener(root, resizeListener);
}
cleanup(function () {
if (root && resizeListener) {
removeListener(root, resizeListener);
}
});
});
}
var autoresizeProps = {
autoresize: [Boolean, Object]
};
var onRE = /^on[^a-z]/;
var isOn = function (key) { return onRE.test(key); };
function omitOn(attrs) {
var result = {};
for (var key in attrs) {
if (!isOn(key)) {
result[key] = attrs[key];
}
}
return result;
}
function unwrapInjected(injection, defaultValue) {
var value = isRef(injection) ? unref(injection) : injection;
if (value && typeof value === "object" && "value" in value) {
return value.value || defaultValue;
}
return value || defaultValue;
}
var LOADING_OPTIONS_KEY = "ecLoadingOptions";
function useLoading(chart, loading, loadingOptions) {
var defaultLoadingOptions = inject(LOADING_OPTIONS_KEY, {});
var realLoadingOptions = computed(function () { return (__assign(__assign({}, unwrapInjected(defaultLoadingOptions, {})), loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.value)); });
watchEffect(function () {
var instance = chart.value;
if (!instance) {
return;
}
if (loading.value) {
instance.showLoading(realLoadingOptions.value);
}
else {
instance.hideLoading();
}
});
}
var loadingProps = {
loading: Boolean,
loadingOptions: Object
};
var registered = null;
var TAG_NAME = "x-vue-echarts";
function register() {
if (registered != null) {
return registered;
}
if (typeof HTMLElement === "undefined" ||
typeof customElements === "undefined") {
return (registered = false);
}
try {
var reg = new Function("tag", "class EChartsElement extends HTMLElement {\n __dispose = null;\n\n disconnectedCallback() {\n if (this.__dispose) {\n this.__dispose();\n this.__dispose = null;\n }\n }\n}\n\nif (customElements.get(tag) == null) {\n customElements.define(tag, EChartsElement);\n}\n");
reg(TAG_NAME);
}
catch (e) {
return (registered = false);
}
return (registered = true);
}
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
var css = "x-vue-echarts{display:flex;flex-direction:column;width:100%;height:100%;min-width:0}\n.vue-echarts-inner{flex-grow:1;min-width:0;width:auto!important;height:auto!important}\n";
n(css,{});
var wcRegistered = register();
if (Vue2) {
Vue2.config.ignoredElements.push(TAG_NAME);
}
var THEME_KEY = "ecTheme";
var INIT_OPTIONS_KEY = "ecInitOptions";
var UPDATE_OPTIONS_KEY = "ecUpdateOptions";
var NATIVE_EVENT_RE = /(^&?~?!?)native:/;
var ECharts = defineComponent({
name: "echarts",
props: __assign(__assign({ option: Object, theme: {
type: [Object, String]
}, initOptions: Object, updateOptions: Object, group: String, manualUpdate: Boolean }, autoresizeProps), loadingProps),
emits: {},
inheritAttrs: false,
setup: function (props, _a) {
var attrs = _a.attrs;
var root = shallowRef();
var inner = shallowRef();
var chart = shallowRef();
var manualOption = shallowRef();
var defaultTheme = inject(THEME_KEY, null);
var defaultInitOptions = inject(INIT_OPTIONS_KEY, null);
var defaultUpdateOptions = inject(UPDATE_OPTIONS_KEY, null);
var _b = toRefs(props), autoresize = _b.autoresize, manualUpdate = _b.manualUpdate, loading = _b.loading, loadingOptions = _b.loadingOptions;
var realOption = computed(function () { return manualOption.value || props.option || null; });
var realTheme = computed(function () { return props.theme || unwrapInjected(defaultTheme, {}); });
var realInitOptions = computed(function () { return props.initOptions || unwrapInjected(defaultInitOptions, {}); });
var realUpdateOptions = computed(function () { return props.updateOptions || unwrapInjected(defaultUpdateOptions, {}); });
var nonEventAttrs = computed(function () { return omitOn(attrs); });
var nativeListeners = {};
var listeners = getCurrentInstance().proxy.$listeners;
var realListeners = {};
if (!listeners) {
Object.keys(attrs)
.filter(function (key) { return isOn(key); })
.forEach(function (key) {
var event = key.charAt(2).toLowerCase() + key.slice(3);
if (event.indexOf("native:") === 0) {
var nativeKey = "on".concat(event.charAt(7).toUpperCase()).concat(event.slice(8));
nativeListeners[nativeKey] = attrs[key];
return;
}
if (event.substring(event.length - 4) === "Once") {
event = "~".concat(event.substring(0, event.length - 4));
}
realListeners[event] = attrs[key];
});
}
else {
Object.keys(listeners).forEach(function (key) {
if (NATIVE_EVENT_RE.test(key)) {
nativeListeners[key.replace(NATIVE_EVENT_RE, "$1")] = listeners[key];
}
else {
realListeners[key] = listeners[key];
}
});
}
function init$1(option) {
if (!inner.value) {
return;
}
var instance = (chart.value = init(inner.value, realTheme.value, realInitOptions.value));
if (props.group) {
instance.group = props.group;
}
Object.keys(realListeners).forEach(function (key) {
var handler = realListeners[key];
if (!handler) {
return;
}
var event = key.toLowerCase();
if (event.charAt(0) === "~") {
event = event.substring(1);
handler.__once__ = true;
}
var target = instance;
if (event.indexOf("zr:") === 0) {
target = instance.getZr();
event = event.substring(3);
}
if (handler.__once__) {
delete handler.__once__;
var raw_1 = handler;
handler = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
raw_1.apply(void 0, args);
target.off(event, handler);
};
}
target.on(event, handler);
});
function resize() {
if (instance && !instance.isDisposed()) {
instance.resize();
}
}
function commit() {
var opt = option || realOption.value;
if (opt) {
instance.setOption(opt, realUpdateOptions.value);
}
}
if (autoresize.value) {
nextTick(function () {
resize();
commit();
});
}
else {
commit();
}
}
function setOption(option, updateOptions) {
if (props.manualUpdate) {
manualOption.value = option;
}
if (!chart.value) {
init$1(option);
}
else {
chart.value.setOption(option, updateOptions || {});
}
}
function cleanup() {
if (chart.value) {
chart.value.dispose();
chart.value = undefined;
}
}
var unwatchOption = null;
watch(manualUpdate, function (manualUpdate) {
if (typeof unwatchOption === "function") {
unwatchOption();
unwatchOption = null;
}
if (!manualUpdate) {
unwatchOption = watch(function () { return props.option; }, function (option, oldOption) {
if (!option) {
return;
}
if (!chart.value) {
init$1();
}
else {
chart.value.setOption(option, __assign({ notMerge: option !== oldOption }, realUpdateOptions.value));
}
}, { deep: true });
}
}, {
immediate: true
});
watch([realTheme, realInitOptions], function () {
cleanup();
init$1();
}, {
deep: true
});
watchEffect(function () {
if (props.group && chart.value) {
chart.value.group = props.group;
}
});
var publicApi = usePublicAPI(chart);
useLoading(chart, loading, loadingOptions);
useAutoresize(chart, autoresize, inner);
onMounted(function () {
init$1();
});
onBeforeUnmount(function () {
if (wcRegistered && root.value) {
root.value.__dispose = cleanup;
}
else {
cleanup();
}
});
return __assign({ chart: chart, root: root, inner: inner, setOption: setOption, nonEventAttrs: nonEventAttrs, nativeListeners: nativeListeners }, publicApi);
},
render: function () {
var attrs = (Vue2
? { attrs: this.nonEventAttrs, on: this.nativeListeners }
: __assign(__assign({}, this.nonEventAttrs), this.nativeListeners));
attrs.ref = "root";
attrs["class"] = attrs["class"] ? ["echarts"].concat(attrs["class"]) : "echarts";
return h(TAG_NAME, attrs, [
h("div", { ref: "inner", "class": "vue-echarts-inner" })
]);
}
});
export { INIT_OPTIONS_KEY, LOADING_OPTIONS_KEY, THEME_KEY, UPDATE_OPTIONS_KEY, ECharts as default };
//# sourceMappingURL=index.esm.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

807
frontend/node_modules/vue-echarts/dist/index.umd.js generated vendored Normal file
View File

@@ -0,0 +1,807 @@
var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
if (VueDemi.install) {
return VueDemi
}
if (!Vue) {
console.error('[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.')
return VueDemi
}
// Vue 2.7
if (Vue.version.slice(0, 4) === '2.7.') {
for (var key in Vue) {
VueDemi[key] = Vue[key]
}
VueDemi.isVue2 = true
VueDemi.isVue3 = false
VueDemi.install = function () {}
VueDemi.Vue = Vue
VueDemi.Vue2 = Vue
VueDemi.version = Vue.version
VueDemi.warn = Vue.util.warn
function createApp(rootComponent, rootProps) {
var vm
var provide = {}
var app = {
config: Vue.config,
use: Vue.use.bind(Vue),
mixin: Vue.mixin.bind(Vue),
component: Vue.component.bind(Vue),
provide: function (key, value) {
provide[key] = value
return this
},
directive: function (name, dir) {
if (dir) {
Vue.directive(name, dir)
return app
} else {
return Vue.directive(name)
}
},
mount: function (el, hydrating) {
if (!vm) {
vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
vm.$mount(el, hydrating)
return vm
} else {
return vm
}
},
unmount: function () {
if (vm) {
vm.$destroy()
vm = undefined
}
},
}
return app
}
VueDemi.createApp = createApp
}
// Vue 2.6.x
else if (Vue.version.slice(0, 2) === '2.') {
if (VueCompositionAPI) {
for (var key in VueCompositionAPI) {
VueDemi[key] = VueCompositionAPI[key]
}
VueDemi.isVue2 = true
VueDemi.isVue3 = false
VueDemi.install = function () {}
VueDemi.Vue = Vue
VueDemi.Vue2 = Vue
VueDemi.version = Vue.version
} else {
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
}
}
// Vue 3
else if (Vue.version.slice(0, 2) === '3.') {
for (var key in Vue) {
VueDemi[key] = Vue[key]
}
VueDemi.isVue2 = false
VueDemi.isVue3 = true
VueDemi.install = function () {}
VueDemi.Vue = Vue
VueDemi.Vue2 = undefined
VueDemi.version = Vue.version
VueDemi.set = function (target, key, val) {
if (Array.isArray(target)) {
target.length = Math.max(target.length, key)
target.splice(key, 1, val)
return val
}
target[key] = val
return val
}
VueDemi.del = function (target, key) {
if (Array.isArray(target)) {
target.splice(key, 1)
return
}
delete target[key]
}
} else {
console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.')
}
return VueDemi
})(
(this.VueDemi = this.VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})),
this.Vue || (typeof Vue !== 'undefined' ? Vue : undefined),
this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
);
;
;
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('echarts'), require('vue-demi'), require('echarts/core')) :
typeof define === 'function' && define.amd ? define(['echarts', 'vue-demi', 'echarts/core'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.VueECharts = factory(global.echarts, global.VueDemi, global.echarts));
})(this, (function (echarts, vueDemi, core) { 'use strict';
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var METHOD_NAMES = [
"getWidth",
"getHeight",
"getDom",
"getOption",
"resize",
"dispatchAction",
"convertToPixel",
"convertFromPixel",
"containPixel",
"getDataURL",
"getConnectedDataURL",
"appendData",
"clear",
"isDisposed",
"dispose"
];
function usePublicAPI(chart) {
function makePublicMethod(name) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!chart.value) {
throw new Error("ECharts is not initialized yet.");
}
return chart.value[name].apply(chart.value, args);
};
}
function makePublicMethods() {
var methods = Object.create(null);
METHOD_NAMES.forEach(function (name) {
methods[name] = makePublicMethod(name);
});
return methods;
}
return makePublicMethods();
}
var raf = null;
function requestAnimationFrame (callback) {
if (!raf) {
raf = (
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function (callback) {
return setTimeout(callback, 16)
}
).bind(window);
}
return raf(callback)
}
var caf = null;
function cancelAnimationFrame (id) {
if (!caf) {
caf = (
window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
function (id) {
clearTimeout(id);
}
).bind(window);
}
caf(id);
}
function createStyles (styleText) {
var style = document.createElement('style');
if (style.styleSheet) {
style.styleSheet.cssText = styleText;
} else {
style.appendChild(document.createTextNode(styleText));
}
(document.querySelector('head') || document.body).appendChild(style);
return style
}
function createElement (tagName, props) {
if ( props === void 0 ) props = {};
var elem = document.createElement(tagName);
Object.keys(props).forEach(function (key) {
elem[key] = props[key];
});
return elem
}
function getComputedStyle (elem, prop, pseudo) {
// for older versions of Firefox, `getComputedStyle` required
// the second argument and may return `null` for some elements
// when `display: none`
var computedStyle = window.getComputedStyle(elem, pseudo || null) || {
display: 'none'
};
return computedStyle[prop]
}
function getRenderInfo (elem) {
if (!document.documentElement.contains(elem)) {
return {
detached: true,
rendered: false
}
}
var current = elem;
while (current !== document) {
if (getComputedStyle(current, 'display') === 'none') {
return {
detached: false,
rendered: false
}
}
current = current.parentNode;
}
return {
detached: false,
rendered: true
}
}
var css_248z = ".resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:\"\";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}";
var total = 0;
var style = null;
function addListener (elem, callback) {
if (!elem.__resize_mutation_handler__) {
elem.__resize_mutation_handler__ = handleMutation.bind(elem);
}
var listeners = elem.__resize_listeners__;
if (!listeners) {
elem.__resize_listeners__ = [];
if (window.ResizeObserver) {
var offsetWidth = elem.offsetWidth;
var offsetHeight = elem.offsetHeight;
var ro = new ResizeObserver(function () {
if (!elem.__resize_observer_triggered__) {
elem.__resize_observer_triggered__ = true;
if (elem.offsetWidth === offsetWidth && elem.offsetHeight === offsetHeight) {
return
}
}
runCallbacks(elem);
});
// initially display none won't trigger ResizeObserver callback
var ref = getRenderInfo(elem);
var detached = ref.detached;
var rendered = ref.rendered;
elem.__resize_observer_triggered__ = detached === false && rendered === false;
elem.__resize_observer__ = ro;
ro.observe(elem);
} else if (elem.attachEvent && elem.addEventListener) {
// targeting IE9/10
elem.__resize_legacy_resize_handler__ = function handleLegacyResize () {
runCallbacks(elem);
};
elem.attachEvent('onresize', elem.__resize_legacy_resize_handler__);
document.addEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
} else {
if (!total) {
style = createStyles(css_248z);
}
initTriggers(elem);
elem.__resize_rendered__ = getRenderInfo(elem).rendered;
if (window.MutationObserver) {
var mo = new MutationObserver(elem.__resize_mutation_handler__);
mo.observe(document, {
attributes: true,
childList: true,
characterData: true,
subtree: true
});
elem.__resize_mutation_observer__ = mo;
}
}
}
elem.__resize_listeners__.push(callback);
total++;
}
function removeListener (elem, callback) {
var listeners = elem.__resize_listeners__;
if (!listeners) {
return
}
if (callback) {
listeners.splice(listeners.indexOf(callback), 1);
}
// no listeners exist, or removing all listeners
if (!listeners.length || !callback) {
// targeting IE9/10
if (elem.detachEvent && elem.removeEventListener) {
elem.detachEvent('onresize', elem.__resize_legacy_resize_handler__);
document.removeEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
return
}
if (elem.__resize_observer__) {
elem.__resize_observer__.unobserve(elem);
elem.__resize_observer__.disconnect();
elem.__resize_observer__ = null;
} else {
if (elem.__resize_mutation_observer__) {
elem.__resize_mutation_observer__.disconnect();
elem.__resize_mutation_observer__ = null;
}
elem.removeEventListener('scroll', handleScroll);
elem.removeChild(elem.__resize_triggers__.triggers);
elem.__resize_triggers__ = null;
}
elem.__resize_listeners__ = null;
}
if (!--total && style) {
style.parentNode.removeChild(style);
}
}
function getUpdatedSize (elem) {
var ref = elem.__resize_last__;
var width = ref.width;
var height = ref.height;
var offsetWidth = elem.offsetWidth;
var offsetHeight = elem.offsetHeight;
if (offsetWidth !== width || offsetHeight !== height) {
return {
width: offsetWidth,
height: offsetHeight
}
}
return null
}
function handleMutation () {
// `this` denotes the scrolling element
var ref = getRenderInfo(this);
var rendered = ref.rendered;
var detached = ref.detached;
if (rendered !== this.__resize_rendered__) {
if (!detached && this.__resize_triggers__) {
resetTriggers(this);
this.addEventListener('scroll', handleScroll, true);
}
this.__resize_rendered__ = rendered;
runCallbacks(this);
}
}
function handleScroll () {
var this$1$1 = this;
// `this` denotes the scrolling element
resetTriggers(this);
if (this.__resize_raf__) {
cancelAnimationFrame(this.__resize_raf__);
}
this.__resize_raf__ = requestAnimationFrame(function () {
var updated = getUpdatedSize(this$1$1);
if (updated) {
this$1$1.__resize_last__ = updated;
runCallbacks(this$1$1);
}
});
}
function runCallbacks (elem) {
if (!elem || !elem.__resize_listeners__) {
return
}
elem.__resize_listeners__.forEach(function (callback) {
callback.call(elem, elem);
});
}
function initTriggers (elem) {
var position = getComputedStyle(elem, 'position');
if (!position || position === 'static') {
elem.style.position = 'relative';
}
elem.__resize_old_position__ = position;
elem.__resize_last__ = {};
var triggers = createElement('div', {
className: 'resize-triggers'
});
var expand = createElement('div', {
className: 'resize-expand-trigger'
});
var expandChild = createElement('div');
var contract = createElement('div', {
className: 'resize-contract-trigger'
});
expand.appendChild(expandChild);
triggers.appendChild(expand);
triggers.appendChild(contract);
elem.appendChild(triggers);
elem.__resize_triggers__ = {
triggers: triggers,
expand: expand,
expandChild: expandChild,
contract: contract
};
resetTriggers(elem);
elem.addEventListener('scroll', handleScroll, true);
elem.__resize_last__ = {
width: elem.offsetWidth,
height: elem.offsetHeight
};
}
function resetTriggers (elem) {
var ref = elem.__resize_triggers__;
var expand = ref.expand;
var expandChild = ref.expandChild;
var contract = ref.contract;
// batch read
var csw = contract.scrollWidth;
var csh = contract.scrollHeight;
var eow = expand.offsetWidth;
var eoh = expand.offsetHeight;
var esw = expand.scrollWidth;
var esh = expand.scrollHeight;
// batch write
contract.scrollLeft = csw;
contract.scrollTop = csh;
expandChild.style.width = eow + 1 + 'px';
expandChild.style.height = eoh + 1 + 'px';
expand.scrollLeft = esw;
expand.scrollTop = esh;
}
function useAutoresize(chart, autoresize, root) {
var resizeListener = null;
vueDemi.watch([root, chart, autoresize], function (_a, _, cleanup) {
var root = _a[0], chart = _a[1], autoresize = _a[2];
if (root && chart && autoresize) {
var autoresizeOptions = autoresize === true ? {} : autoresize;
var _b = autoresizeOptions.throttle, wait = _b === void 0 ? 100 : _b, onResize_1 = autoresizeOptions.onResize;
var callback = function () {
chart.resize();
onResize_1 === null || onResize_1 === void 0 ? void 0 : onResize_1();
};
resizeListener = wait ? core.throttle(callback, wait) : callback;
addListener(root, resizeListener);
}
cleanup(function () {
if (root && resizeListener) {
removeListener(root, resizeListener);
}
});
});
}
var autoresizeProps = {
autoresize: [Boolean, Object]
};
var onRE = /^on[^a-z]/;
var isOn = function (key) { return onRE.test(key); };
function omitOn(attrs) {
var result = {};
for (var key in attrs) {
if (!isOn(key)) {
result[key] = attrs[key];
}
}
return result;
}
function unwrapInjected(injection, defaultValue) {
var value = vueDemi.isRef(injection) ? vueDemi.unref(injection) : injection;
if (value && typeof value === "object" && "value" in value) {
return value.value || defaultValue;
}
return value || defaultValue;
}
var LOADING_OPTIONS_KEY = "ecLoadingOptions";
function useLoading(chart, loading, loadingOptions) {
var defaultLoadingOptions = vueDemi.inject(LOADING_OPTIONS_KEY, {});
var realLoadingOptions = vueDemi.computed(function () { return (__assign(__assign({}, unwrapInjected(defaultLoadingOptions, {})), loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.value)); });
vueDemi.watchEffect(function () {
var instance = chart.value;
if (!instance) {
return;
}
if (loading.value) {
instance.showLoading(realLoadingOptions.value);
}
else {
instance.hideLoading();
}
});
}
var loadingProps = {
loading: Boolean,
loadingOptions: Object
};
var registered = null;
var TAG_NAME = "x-vue-echarts";
function register() {
if (registered != null) {
return registered;
}
if (typeof HTMLElement === "undefined" ||
typeof customElements === "undefined") {
return (registered = false);
}
try {
var reg = new Function("tag", "class EChartsElement extends HTMLElement {\n __dispose = null;\n\n disconnectedCallback() {\n if (this.__dispose) {\n this.__dispose();\n this.__dispose = null;\n }\n }\n}\n\nif (customElements.get(tag) == null) {\n customElements.define(tag, EChartsElement);\n}\n");
reg(TAG_NAME);
}
catch (e) {
return (registered = false);
}
return (registered = true);
}
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
var css = "x-vue-echarts{display:flex;flex-direction:column;width:100%;height:100%;min-width:0}\n.vue-echarts-inner{flex-grow:1;min-width:0;width:auto!important;height:auto!important}\n";
n(css,{});
var wcRegistered = register();
if (vueDemi.Vue2) {
vueDemi.Vue2.config.ignoredElements.push(TAG_NAME);
}
var THEME_KEY = "ecTheme";
var INIT_OPTIONS_KEY = "ecInitOptions";
var UPDATE_OPTIONS_KEY = "ecUpdateOptions";
var NATIVE_EVENT_RE = /(^&?~?!?)native:/;
var ECharts = vueDemi.defineComponent({
name: "echarts",
props: __assign(__assign({ option: Object, theme: {
type: [Object, String]
}, initOptions: Object, updateOptions: Object, group: String, manualUpdate: Boolean }, autoresizeProps), loadingProps),
emits: {},
inheritAttrs: false,
setup: function (props, _a) {
var attrs = _a.attrs;
var root = vueDemi.shallowRef();
var inner = vueDemi.shallowRef();
var chart = vueDemi.shallowRef();
var manualOption = vueDemi.shallowRef();
var defaultTheme = vueDemi.inject(THEME_KEY, null);
var defaultInitOptions = vueDemi.inject(INIT_OPTIONS_KEY, null);
var defaultUpdateOptions = vueDemi.inject(UPDATE_OPTIONS_KEY, null);
var _b = vueDemi.toRefs(props), autoresize = _b.autoresize, manualUpdate = _b.manualUpdate, loading = _b.loading, loadingOptions = _b.loadingOptions;
var realOption = vueDemi.computed(function () { return manualOption.value || props.option || null; });
var realTheme = vueDemi.computed(function () { return props.theme || unwrapInjected(defaultTheme, {}); });
var realInitOptions = vueDemi.computed(function () { return props.initOptions || unwrapInjected(defaultInitOptions, {}); });
var realUpdateOptions = vueDemi.computed(function () { return props.updateOptions || unwrapInjected(defaultUpdateOptions, {}); });
var nonEventAttrs = vueDemi.computed(function () { return omitOn(attrs); });
var nativeListeners = {};
var listeners = vueDemi.getCurrentInstance().proxy.$listeners;
var realListeners = {};
if (!listeners) {
Object.keys(attrs)
.filter(function (key) { return isOn(key); })
.forEach(function (key) {
var event = key.charAt(2).toLowerCase() + key.slice(3);
if (event.indexOf("native:") === 0) {
var nativeKey = "on".concat(event.charAt(7).toUpperCase()).concat(event.slice(8));
nativeListeners[nativeKey] = attrs[key];
return;
}
if (event.substring(event.length - 4) === "Once") {
event = "~".concat(event.substring(0, event.length - 4));
}
realListeners[event] = attrs[key];
});
}
else {
Object.keys(listeners).forEach(function (key) {
if (NATIVE_EVENT_RE.test(key)) {
nativeListeners[key.replace(NATIVE_EVENT_RE, "$1")] = listeners[key];
}
else {
realListeners[key] = listeners[key];
}
});
}
function init(option) {
if (!inner.value) {
return;
}
var instance = (chart.value = core.init(inner.value, realTheme.value, realInitOptions.value));
if (props.group) {
instance.group = props.group;
}
Object.keys(realListeners).forEach(function (key) {
var handler = realListeners[key];
if (!handler) {
return;
}
var event = key.toLowerCase();
if (event.charAt(0) === "~") {
event = event.substring(1);
handler.__once__ = true;
}
var target = instance;
if (event.indexOf("zr:") === 0) {
target = instance.getZr();
event = event.substring(3);
}
if (handler.__once__) {
delete handler.__once__;
var raw_1 = handler;
handler = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
raw_1.apply(void 0, args);
target.off(event, handler);
};
}
target.on(event, handler);
});
function resize() {
if (instance && !instance.isDisposed()) {
instance.resize();
}
}
function commit() {
var opt = option || realOption.value;
if (opt) {
instance.setOption(opt, realUpdateOptions.value);
}
}
if (autoresize.value) {
vueDemi.nextTick(function () {
resize();
commit();
});
}
else {
commit();
}
}
function setOption(option, updateOptions) {
if (props.manualUpdate) {
manualOption.value = option;
}
if (!chart.value) {
init(option);
}
else {
chart.value.setOption(option, updateOptions || {});
}
}
function cleanup() {
if (chart.value) {
chart.value.dispose();
chart.value = undefined;
}
}
var unwatchOption = null;
vueDemi.watch(manualUpdate, function (manualUpdate) {
if (typeof unwatchOption === "function") {
unwatchOption();
unwatchOption = null;
}
if (!manualUpdate) {
unwatchOption = vueDemi.watch(function () { return props.option; }, function (option, oldOption) {
if (!option) {
return;
}
if (!chart.value) {
init();
}
else {
chart.value.setOption(option, __assign({ notMerge: option !== oldOption }, realUpdateOptions.value));
}
}, { deep: true });
}
}, {
immediate: true
});
vueDemi.watch([realTheme, realInitOptions], function () {
cleanup();
init();
}, {
deep: true
});
vueDemi.watchEffect(function () {
if (props.group && chart.value) {
chart.value.group = props.group;
}
});
var publicApi = usePublicAPI(chart);
useLoading(chart, loading, loadingOptions);
useAutoresize(chart, autoresize, inner);
vueDemi.onMounted(function () {
init();
});
vueDemi.onBeforeUnmount(function () {
if (wcRegistered && root.value) {
root.value.__dispose = cleanup;
}
else {
cleanup();
}
});
return __assign({ chart: chart, root: root, inner: inner, setOption: setOption, nonEventAttrs: nonEventAttrs, nativeListeners: nativeListeners }, publicApi);
},
render: function () {
var attrs = (vueDemi.Vue2
? { attrs: this.nonEventAttrs, on: this.nativeListeners }
: __assign(__assign({}, this.nonEventAttrs), this.nativeListeners));
attrs.ref = "root";
attrs["class"] = attrs["class"] ? ["echarts"].concat(attrs["class"]) : "echarts";
return vueDemi.h(TAG_NAME, attrs, [
vueDemi.h("div", { ref: "inner", "class": "vue-echarts-inner" })
]);
}
});
var exported = /*#__PURE__*/Object.freeze({
__proto__: null,
'default': ECharts,
LOADING_OPTIONS_KEY: LOADING_OPTIONS_KEY,
THEME_KEY: THEME_KEY,
INIT_OPTIONS_KEY: INIT_OPTIONS_KEY,
UPDATE_OPTIONS_KEY: UPDATE_OPTIONS_KEY
});
var global = __assign(__assign({}, ECharts), exported);
return global;
}));
//# sourceMappingURL=index.umd.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

142
frontend/node_modules/vue-echarts/dist/index.vue2.d.ts generated vendored Normal file
View File

@@ -0,0 +1,142 @@
import { DefineComponent } from '@vue/runtime-core';
import { Ref } from 'vue-demi';
import { init } from 'echarts/core';
import { SetOptionOpts, ECElementEvent, ElementEvent } from 'echarts';
type InitType = typeof init;
type InitParameters = Parameters<InitType>;
type InitOptions = NonNullable<InitParameters[2]>;
type UpdateOptions = SetOptionOpts;
type EChartsType = ReturnType<InitType>;
type SetOptionType = EChartsType["setOption"];
type Option = Parameters<SetOptionType>[0];
type MouseEventName =
| "click"
| "dblclick"
| "mouseout"
| "mouseover"
| "mouseup"
| "mousedown"
| "mousemove"
| "contextmenu"
| "globalout";
type ElementEventName =
| MouseEventName
| "mousewheel"
| "drag"
| "dragstart"
| "dragend"
| "dragenter"
| "dragleave"
| "dragover"
| "drop";
type ZRenderEventName = `zr:${ElementEventName}`;
type OtherEventName =
| "highlight"
| "downplay"
| "selectchanged"
| "legendselectchanged"
| "legendselected"
| "legendunselected"
| "legendselectall"
| "legendinverseselect"
| "legendscroll"
| "datazoom"
| "datarangeselected"
| "graphroam"
| "georoam"
| "treeroam"
| "timelinechanged"
| "timelineplaychanged"
| "restore"
| "dataviewchanged"
| "magictypechanged"
| "geoselectchanged"
| "geoselected"
| "geounselected"
| "axisareaselected"
| "brush"
| "brushEnd"
| "brushselected"
| "globalcursortaken";
type MouseEmits = {
[key in MouseEventName]: (params: ECElementEvent) => boolean;
};
type ZRenderEmits = {
[key in ZRenderEventName]: (params: ElementEvent) => boolean;
};
type OtherEmits = {
[key in OtherEventName]: null;
};
type Emits = MouseEmits &
OtherEmits & {
rendered: (params: { elapsedTime: number }) => boolean;
finished: () => boolean;
} & ZRenderEmits;
/* eslint-disable @typescript-eslint/ban-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 { INIT_OPTIONS_KEY, LOADING_OPTIONS_KEY, THEME_KEY, UPDATE_OPTIONS_KEY, Chart as default };

View File

@@ -0,0 +1,141 @@
import { DefineComponent, Ref } from 'vue-demi';
import { init } from 'echarts/core';
import { SetOptionOpts, ECElementEvent, ElementEvent } from 'echarts';
type InitType = typeof init;
type InitParameters = Parameters<InitType>;
type InitOptions = NonNullable<InitParameters[2]>;
type UpdateOptions = SetOptionOpts;
type EChartsType = ReturnType<InitType>;
type SetOptionType = EChartsType["setOption"];
type Option = Parameters<SetOptionType>[0];
type MouseEventName =
| "click"
| "dblclick"
| "mouseout"
| "mouseover"
| "mouseup"
| "mousedown"
| "mousemove"
| "contextmenu"
| "globalout";
type ElementEventName =
| MouseEventName
| "mousewheel"
| "drag"
| "dragstart"
| "dragend"
| "dragenter"
| "dragleave"
| "dragover"
| "drop";
type ZRenderEventName = `zr:${ElementEventName}`;
type OtherEventName =
| "highlight"
| "downplay"
| "selectchanged"
| "legendselectchanged"
| "legendselected"
| "legendunselected"
| "legendselectall"
| "legendinverseselect"
| "legendscroll"
| "datazoom"
| "datarangeselected"
| "graphroam"
| "georoam"
| "treeroam"
| "timelinechanged"
| "timelineplaychanged"
| "restore"
| "dataviewchanged"
| "magictypechanged"
| "geoselectchanged"
| "geoselected"
| "geounselected"
| "axisareaselected"
| "brush"
| "brushEnd"
| "brushselected"
| "globalcursortaken";
type MouseEmits = {
[key in MouseEventName]: (params: ECElementEvent) => boolean;
};
type ZRenderEmits = {
[key in ZRenderEventName]: (params: ElementEvent) => boolean;
};
type OtherEmits = {
[key in OtherEventName]: null;
};
type Emits = MouseEmits &
OtherEmits & {
rendered: (params: { elapsedTime: number }) => boolean;
finished: () => boolean;
} & ZRenderEmits;
/* eslint-disable @typescript-eslint/ban-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 { INIT_OPTIONS_KEY, LOADING_OPTIONS_KEY, THEME_KEY, UPDATE_OPTIONS_KEY, Chart as default };

View File

@@ -0,0 +1,16 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../vue-demi/bin/vue-demi-fix.js" "$@"
else
exec node "$basedir/../vue-demi/bin/vue-demi-fix.js" "$@"
fi

View File

@@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vue-demi\bin\vue-demi-fix.js" %*

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args
} else {
& "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args
} else {
& "node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@@ -0,0 +1,16 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../vue-demi/bin/vue-demi-switch.js" "$@"
else
exec node "$basedir/../vue-demi/bin/vue-demi-switch.js" "$@"
fi

View File

@@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vue-demi\bin\vue-demi-switch.js" %*

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args
} else {
& "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args
} else {
& "node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020-present, Anthony Fu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,228 @@
<p align="center">
<img src="https://github.com/vueuse/vue-demi/blob/main/assets/banner.png?raw=true" width="600"/>
<br>
<a href='https://www.npmjs.com/package/vue-demi'><img src='https://img.shields.io/npm/v/vue-demi?color=42b883' alt='npm'></a>
</p>
<p align="center">
<b>Vue Demi</b> (<i>half</i> in French) is a developing utility<br> allows you to write <b>Universal Vue Libraries</b> for Vue 2 & 3<br>
<i>See more details in <a href='https://antfu.me/posts/make-libraries-working-with-vue-2-and-3'>this blog post</a></i>
</p>
<br>
<br>
## Strategies
- `<=2.6`: exports from `vue` + `@vue/composition-api` with plugin auto installing.
- `2.7`: exports from `vue` (Composition API is built-in in Vue 2.7).
- `>=3.0`: exports from `vue`, with polyfill of Vue 2's `set` and `del` API.
## Usage
Install this as your plugin's dependency:
```bash
npm i vue-demi
# or
yarn add vue-demi
# or
pnpm i vue-demi
```
Add `vue` and `@vue/composition-api` to your plugin's peer dependencies to specify what versions you support.
```jsonc
{
"dependencies": {
"vue-demi": "latest"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1",
"vue": "^2.0.0 || >=3.0.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
},
"devDependencies": {
"vue": "^3.0.0" // or "^2.6.0" base on your preferred working environment
},
}
```
Import everything related to Vue from it, it will redirect to `vue@2` + `@vue/composition-api` or `vue@3` based on users' environments.
```ts
import { ref, reactive, defineComponent } from 'vue-demi'
```
Publish your plugin and all is done!
> When using with [Vite](https://vitejs.dev), you will need to opt-out the pre-bundling to get `vue-demi` work properly by
> ```js
> // vite.config.js
> export default defineConfig({
> optimizeDeps: {
> exclude: ['vue-demi']
> }
> })
> ```
### Extra APIs
`Vue Demi` provides extra APIs to help distinguish users' environments and to do some version-specific logic.
### `isVue2` `isVue3`
```ts
import { isVue2, isVue3 } from 'vue-demi'
if (isVue2) {
// Vue 2 only
} else {
// Vue 3 only
}
```
### `Vue2`
To avoid bringing in all the tree-shakable modules, we provide a `Vue2` export to support access to Vue 2's global API. (See [#41](https://github.com/vueuse/vue-demi/issues/41).)
```ts
import { Vue2 } from 'vue-demi'
if (Vue2) {
Vue2.config.ignoredElements.push('x-foo')
}
```
### `install()`
Composition API in Vue 2 is provided as a plugin and needs to be installed on the Vue instance before using. Normally, `vue-demi` will try to install it automatically. For some usages where you might need to ensure the plugin gets installed correctly, the `install()` API is exposed to as a safe version of `Vue.use(CompositionAPI)`. `install()` in the Vue 3 environment will be an empty function (no-op).
```ts
import { install } from 'vue-demi'
install()
```
## CLI
### Manually Switch Versions
To explicitly switch the redirecting version, you can use these commands in your project's root.
```bash
npx vue-demi-switch 2
# or
npx vue-demi-switch 3
```
### Package Aliasing
If you would like to import `vue` under an alias, you can use the following command
```bash
npx vue-demi-switch 2 vue2
# or
npx vue-demi-switch 3 vue3
```
Then `vue-demi` will redirect APIs from the alias name you specified, for example:
```ts
import * as Vue from 'vue3'
var isVue2 = false
var isVue3 = true
var Vue2 = undefined
export * from 'vue3'
export {
Vue,
Vue2,
isVue2,
isVue3,
}
```
### Auto Fix
If the `postinstall` hook doesn't get triggered or you have updated the Vue version, try to run the following command to resolve the redirecting.
```bash
npx vue-demi-fix
```
### Isomorphic Testings
You can support testing for both versions by adding npm alias in your dev dependencies. For example:
```json
{
"scripts": {
"test:2": "vue-demi-switch 2 vue2 && jest",
"test:3": "vue-demi-switch 3 && jest",
},
"devDependencies": {
"vue": "^3.0.0",
"vue2": "npm:vue@2"
},
}
```
or
```json
{
"scripts": {
"test:2": "vue-demi-switch 2 && jest",
"test:3": "vue-demi-switch 3 vue3 && jest",
},
"devDependencies": {
"vue": "^2.6.0",
"vue3": "npm:vue@3"
},
}
```
## Examples
See [examples](./examples).
## Who is using this?
- [VueUse](https://github.com/vueuse/vueuse) - Collection of Composition API utils
- [@vue/apollo-composable](https://github.com/vuejs/vue-apollo/tree/v4/packages/vue-apollo-composable) - Apollo GraphQL functions for Vue Composition API
- [vuelidate](https://github.com/vuelidate/vuelidate) - Simple, lightweight model-based validation
- [vue-composition-test-utils](https://github.com/ariesjia/vue-composition-test-utils) - Simple vue composition api unit test utilities
- [vue-use-stripe](https://github.com/frandiox/vue-use-stripe) - Stripe Elements wrapper for Vue.js
- [@opd/g2plot-vue](https://github.com/open-data-plan/g2plot-vue) - G2plot for vue
- [vue-echarts](https://github.com/ecomfe/vue-echarts) - Vue.js component for Apache ECharts.
- [fluent-vue](https://github.com/Demivan/fluent-vue) - Vue.js integration for [Fluent.js](https://github.com/projectfluent/fluent.js) - JavaScript implementation of [Project Fluent](https://projectfluent.org)
- [vue-datatable-url-sync](https://github.com/socotecio/vue-datatable-url-sync) - Synchronize datatable options and filters with the url to keep user preference even after refresh or navigation
- [vue-insta-stories](https://github.com/UnevenSoftware/vue-insta-stories) - Instagram stories in your vue projects.
- [vue-tiny-validate](https://github.com/FrontLabsOfficial/vue-tiny-validate) - Tiny Vue Validate Composition
- [v-perfect-signature](https://github.com/wobsoriano/v-perfect-signature) - Pressure-sensitive signature drawing for Vue 2 and 3
- [vue-winbox](https://github.com/wobsoriano/vue-winbox) - A wrapper component for WinBox.js that adds the ability to mount Vue components.
- [vue-word-highlighter](https://github.com/kawamataryo/vue-word-highlighter) - The word highlighter library for Vue 2 and Vue 3
- [vue-chart-3](https://github.com/victorgarciaesgi/vue-chart-3) - Vue.js component for Chart.js
- [json-editor-vue](https://github.com/cloydlau/json-editor-vue) - JSON editor & viewer for Vue 2 and 3.
- [kidar-echarts](https://github.com/kidarjs/kidar-echarts) - A simpler echarts component for Vue 2 and 3.
- [vue3-sketch-ruler](https://github.com/kakajun/vue3-sketch-ruler) - The zoom operation used for page presentation for Vue 2 and 3( Replace render function with template )
- [vue-rough-notation](https://github.com/Leecason/vue-rough-notation) - RoughNotation wrapper component for Vue 2 and 3.
- [vue-request](https://github.com/AttoJS/vue-request) - Vue composition API for data fetching, supports SWR, polling, error retry, cache request, pagination, etc.
- [vue3-lazyload](https://github.com/murongg/vue3-lazyload) - A vue3.x image lazyload plugin.
- [vue-codemirror6](https://github.com/logue/vue-codemirror6) - CodeMirror6 component for Vue2 and 3.
> open a PR to add your library ;)
## Underhood
See [the blog post](https://antfu.me/posts/make-libraries-working-with-vue-2-and-3/#-introducing-vue-demi).
## License
MIT License © 2020 [Anthony Fu](https://github.com/antfu)

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
'use strict'
require('../scripts/postinstall')

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
'use strict'
require('../scripts/switch-cli')

View File

@@ -0,0 +1,29 @@
var Vue = require('vue')
Object.keys(Vue).forEach(function(key) {
exports[key] = Vue[key]
})
exports.set = function(target, key, val) {
if (Array.isArray(target)) {
target.length = Math.max(target.length, key)
target.splice(key, 1, val)
return val
}
target[key] = val
return val
}
exports.del = function(target, key) {
if (Array.isArray(target)) {
target.splice(key, 1)
return
}
delete target[key]
}
exports.Vue = Vue
exports.Vue2 = undefined
exports.isVue2 = false
exports.isVue3 = true
exports.install = function(){}

View File

@@ -0,0 +1,22 @@
import * as Vue from 'vue'
declare const isVue2: boolean
declare const isVue3: boolean
declare const Vue2: any
declare const install: (vue?: any) => void
/**
* @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
* Refer to https://github.com/vueuse/vue-demi/issues/41
*/
declare const V: typeof Vue
export function set<T>(target: any, key: any, val: T): T
export function del(target: any, key: any): void
export * from 'vue'
export {
V as Vue,
Vue2,
isVue2,
isVue3,
install,
}

View File

@@ -0,0 +1,113 @@
var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
if (VueDemi.install) {
return VueDemi
}
if (!Vue) {
console.error('[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.')
return VueDemi
}
// Vue 2.7
if (Vue.version.slice(0, 4) === '2.7.') {
for (var key in Vue) {
VueDemi[key] = Vue[key]
}
VueDemi.isVue2 = true
VueDemi.isVue3 = false
VueDemi.install = function () {}
VueDemi.Vue = Vue
VueDemi.Vue2 = Vue
VueDemi.version = Vue.version
VueDemi.warn = Vue.util.warn
function createApp(rootComponent, rootProps) {
var vm
var provide = {}
var app = {
config: Vue.config,
use: Vue.use.bind(Vue),
mixin: Vue.mixin.bind(Vue),
component: Vue.component.bind(Vue),
provide: function (key, value) {
provide[key] = value
return this
},
directive: function (name, dir) {
if (dir) {
Vue.directive(name, dir)
return app
} else {
return Vue.directive(name)
}
},
mount: function (el, hydrating) {
if (!vm) {
vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
vm.$mount(el, hydrating)
return vm
} else {
return vm
}
},
unmount: function () {
if (vm) {
vm.$destroy()
vm = undefined
}
},
}
return app
}
VueDemi.createApp = createApp
}
// Vue 2.6.x
else if (Vue.version.slice(0, 2) === '2.') {
if (VueCompositionAPI) {
for (var key in VueCompositionAPI) {
VueDemi[key] = VueCompositionAPI[key]
}
VueDemi.isVue2 = true
VueDemi.isVue3 = false
VueDemi.install = function () {}
VueDemi.Vue = Vue
VueDemi.Vue2 = Vue
VueDemi.version = Vue.version
} else {
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
}
}
// Vue 3
else if (Vue.version.slice(0, 2) === '3.') {
for (var key in Vue) {
VueDemi[key] = Vue[key]
}
VueDemi.isVue2 = false
VueDemi.isVue3 = true
VueDemi.install = function () {}
VueDemi.Vue = Vue
VueDemi.Vue2 = undefined
VueDemi.version = Vue.version
VueDemi.set = function (target, key, val) {
if (Array.isArray(target)) {
target.length = Math.max(target.length, key)
target.splice(key, 1, val)
return val
}
target[key] = val
return val
}
VueDemi.del = function (target, key) {
if (Array.isArray(target)) {
target.splice(key, 1)
return
}
delete target[key]
}
} else {
console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.')
}
return VueDemi
})(
(this.VueDemi = this.VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})),
this.Vue || (typeof Vue !== 'undefined' ? Vue : undefined),
this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
);

View File

@@ -0,0 +1,34 @@
import * as Vue from 'vue'
var isVue2 = false
var isVue3 = true
var Vue2 = undefined
function install() {}
export function set(target, key, val) {
if (Array.isArray(target)) {
target.length = Math.max(target.length, key)
target.splice(key, 1, val)
return val
}
target[key] = val
return val
}
export function del(target, key) {
if (Array.isArray(target)) {
target.splice(key, 1)
return
}
delete target[key]
}
export * from 'vue'
export {
Vue,
Vue2,
isVue2,
isVue3,
install,
}

View File

@@ -0,0 +1,55 @@
var VueModule = require('vue')
// get the real Vue https://github.com/vueuse/vue-demi/issues/192
var Vue = VueModule.default || VueModule
exports.Vue = Vue
exports.Vue2 = Vue
exports.isVue2 = true
exports.isVue3 = false
exports.install = function () {}
exports.warn = Vue.util.warn
// createApp polyfill
exports.createApp = function (rootComponent, rootProps) {
var vm
var provide = {}
var app = {
config: Vue.config,
use: Vue.use.bind(Vue),
mixin: Vue.mixin.bind(Vue),
component: Vue.component.bind(Vue),
provide: function (key, value) {
provide[key] = value
return this
},
directive: function (name, dir) {
if (dir) {
Vue.directive(name, dir)
return app
} else {
return Vue.directive(name)
}
},
mount: function (el, hydrating) {
if (!vm) {
vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
vm.$mount(el, hydrating)
return vm
} else {
return vm
}
},
unmount: function () {
if (vm) {
vm.$destroy()
vm = undefined
}
},
}
return app
}
Object.keys(VueModule).forEach(function (key) {
exports[key] = VueModule[key]
})

View File

@@ -0,0 +1,36 @@
import Vue from 'vue'
import type { PluginFunction, PluginObject, VueConstructor, Directive, InjectionKey, Component } from 'vue'
declare const isVue2: boolean
declare const isVue3: boolean
declare const Vue2: typeof Vue | undefined
declare const version: string
declare const install: (vue?: typeof Vue) => void
export declare function warn(msg: string, vm?: Component | null): void
/**
* @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
* Refer to https://github.com/vueuse/vue-demi/issues/41
*/
declare const V: typeof Vue
// accept no generic because Vue 3 doesn't accept any
// https://github.com/vuejs/vue-next/pull/2758/
export declare type Plugin = PluginObject<any> | PluginFunction<any>
export type { VNode } from 'vue'
export * from 'vue'
export { V as Vue, Vue2, isVue2, isVue3, version, install }
// #region createApp polyfill
export interface App<T = any> {
config: VueConstructor['config']
use: VueConstructor['use']
mixin: VueConstructor['mixin']
component: VueConstructor['component']
directive(name: string): Directive | undefined
directive(name: string, directive: Directive): this
provide<T>(key: InjectionKey<T> | string, value: T): this
mount: Vue['$mount']
unmount: Vue['$destroy']
}
export declare function createApp(rootComponent: any, rootProps?: any): App
// #endregion

View File

@@ -0,0 +1,51 @@
import Vue from 'vue'
var isVue2 = true
var isVue3 = false
var Vue2 = Vue
var warn = Vue.util.warn
function install() {}
// createApp polyfill
export function createApp(rootComponent, rootProps) {
var vm
var provide = {}
var app = {
config: Vue.config,
use: Vue.use.bind(Vue),
mixin: Vue.mixin.bind(Vue),
component: Vue.component.bind(Vue),
provide: function (key, value) {
provide[key] = value
return this
},
directive: function (name, dir) {
if (dir) {
Vue.directive(name, dir)
return app
} else {
return Vue.directive(name)
}
},
mount: function (el, hydrating) {
if (!vm) {
vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
vm.$mount(el, hydrating)
return vm
} else {
return vm
}
},
unmount: function () {
if (vm) {
vm.$destroy()
vm = undefined
}
},
}
return app
}
export { Vue, Vue2, isVue2, isVue3, install, warn }
export * from 'vue'

View File

@@ -0,0 +1,29 @@
var Vue = require('vue')
var VueCompositionAPI = require('@vue/composition-api')
function install(_vue) {
var vueLib = _vue || Vue
if (vueLib && 'default' in vueLib) {
vueLib = vueLib.default
}
if (vueLib && !vueLib['__composition_api_installed__']) {
if (VueCompositionAPI && 'default' in VueCompositionAPI)
vueLib.use(VueCompositionAPI.default)
else if (VueCompositionAPI)
vueLib.use(VueCompositionAPI)
}
}
install(Vue)
Object.keys(VueCompositionAPI).forEach(function(key) {
exports[key] = VueCompositionAPI[key]
})
exports.Vue = Vue
exports.Vue2 = Vue
exports.isVue2 = true
exports.isVue3 = false
exports.install = install
exports.version = Vue.version

View File

@@ -0,0 +1,31 @@
import Vue from 'vue'
import type { PluginFunction, PluginObject } from 'vue'
declare const isVue2: boolean
declare const isVue3: boolean
declare const Vue2: typeof Vue | undefined
declare const version: string
declare const install: (vue?: typeof Vue) => void
/**
* @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
* Refer to https://github.com/vueuse/vue-demi/issues/41
*/
declare const V: typeof Vue
/**
* DebuggerEvent is a Vue 3 development only feature. This type cannot exist in Vue 2.
*/
export declare type DebuggerEvent = never
// accept no generic because Vue 3 doesn't accept any
// https://github.com/vuejs/vue-next/pull/2758/
export declare type Plugin = PluginObject<any> | PluginFunction<any>
export type { VNode } from 'vue'
export * from '@vue/composition-api'
export {
V as Vue,
Vue2,
isVue2,
isVue3,
version,
install,
}

View File

@@ -0,0 +1,28 @@
import Vue from 'vue'
import VueCompositionAPI from '@vue/composition-api/dist/vue-composition-api.mjs'
function install(_vue) {
_vue = _vue || Vue
if (_vue && !_vue['__composition_api_installed__'])
_vue.use(VueCompositionAPI)
}
install(Vue)
var isVue2 = true
var isVue3 = false
var Vue2 = Vue
var version = Vue.version
/**VCA-EXPORTS**/
export * from '@vue/composition-api/dist/vue-composition-api.mjs'
/**VCA-EXPORTS**/
export {
Vue,
Vue2,
isVue2,
isVue3,
version,
install,
}

View File

@@ -0,0 +1,29 @@
var Vue = require('vue')
Object.keys(Vue).forEach(function(key) {
exports[key] = Vue[key]
})
exports.set = function(target, key, val) {
if (Array.isArray(target)) {
target.length = Math.max(target.length, key)
target.splice(key, 1, val)
return val
}
target[key] = val
return val
}
exports.del = function(target, key) {
if (Array.isArray(target)) {
target.splice(key, 1)
return
}
delete target[key]
}
exports.Vue = Vue
exports.Vue2 = undefined
exports.isVue2 = false
exports.isVue3 = true
exports.install = function(){}

View File

@@ -0,0 +1,22 @@
import * as Vue from 'vue'
declare const isVue2: boolean
declare const isVue3: boolean
declare const Vue2: any
declare const install: (vue?: any) => void
/**
* @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
* Refer to https://github.com/vueuse/vue-demi/issues/41
*/
declare const V: typeof Vue
export function set<T>(target: any, key: any, val: T): T
export function del(target: any, key: any): void
export * from 'vue'
export {
V as Vue,
Vue2,
isVue2,
isVue3,
install,
}

View File

@@ -0,0 +1,34 @@
import * as Vue from 'vue'
var isVue2 = false
var isVue3 = true
var Vue2 = undefined
function install() {}
export function set(target, key, val) {
if (Array.isArray(target)) {
target.length = Math.max(target.length, key)
target.splice(key, 1, val)
return val
}
target[key] = val
return val
}
export function del(target, key) {
if (Array.isArray(target)) {
target.splice(key, 1)
return
}
delete target[key]
}
export * from 'vue'
export {
Vue,
Vue2,
isVue2,
isVue3,
install,
}

View File

@@ -0,0 +1,47 @@
{
"name": "vue-demi",
"version": "0.13.11",
"engines": {
"node": ">=12"
},
"repository": "https://github.com/antfu/vue-demi.git",
"funding": "https://github.com/sponsors/antfu",
"license": "MIT",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"main": "lib/index.cjs",
"jsdelivr": "lib/index.iife.js",
"unpkg": "lib/index.iife.js",
"module": "lib/index.mjs",
"types": "lib/index.d.ts",
"exports": {
".": {
"require": "./lib/index.cjs",
"import": "./lib/index.mjs",
"browser": "./lib/index.mjs",
"types": "./lib/index.d.ts"
},
"./*": "./*"
},
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
},
"files": [
"lib",
"bin",
"scripts"
],
"scripts": {
"postinstall": "node ./scripts/postinstall.js",
"release": "npx bumpp --tag --commit --push && npm publish"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1",
"vue": "^3.0.0-0 || ^2.6.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
}
}

View File

@@ -0,0 +1,19 @@
const { switchVersion, loadModule } = require('./utils')
const Vue = loadModule('vue')
if (!Vue || typeof Vue.version !== 'string') {
console.warn('[vue-demi] Vue is not found. Please run "npm install vue" to install.')
}
else if (Vue.version.startsWith('2.7.')) {
switchVersion(2.7)
}
else if (Vue.version.startsWith('2.')) {
switchVersion(2)
}
else if (Vue.version.startsWith('3.')) {
switchVersion(3)
}
else {
console.warn(`[vue-demi] Vue version v${Vue.version} is not suppported.`)
}

View File

@@ -0,0 +1,18 @@
const { switchVersion } = require('./utils')
const version = process.argv[2]
const vueEntry = process.argv[3] || 'vue'
if (version === '2.7') {
switchVersion(2.7, vueEntry)
console.log(`[vue-demi] Switched for Vue 2.7 (entry: "${vueEntry}")`)
} else if (version === '2') {
switchVersion(2, vueEntry)
console.log(`[vue-demi] Switched for Vue 2 (entry: "${vueEntry}")`)
} else if (version === '3') {
switchVersion(3, vueEntry)
console.log(`[vue-demi] Switched for Vue 3 (entry: "${vueEntry}")`)
} else {
console.warn(`[vue-demi] expecting version "2" or "2.7" or "3" but got "${version}"`)
process.exit(1)
}

View File

@@ -0,0 +1,62 @@
const fs = require('fs')
const path = require('path')
const dir = path.resolve(__dirname, '..', 'lib')
function loadModule(name) {
try {
return require(name)
} catch (e) {
return undefined
}
}
function copy(name, version, vue) {
vue = vue || 'vue'
const src = path.join(dir, `v${version}`, name)
const dest = path.join(dir, name)
let content = fs.readFileSync(src, 'utf-8')
content = content.replace(/'vue'/g, `'${vue}'`)
// unlink for pnpm, #92
try {
fs.unlinkSync(dest)
} catch (error) { }
fs.writeFileSync(dest, content, 'utf-8')
}
function updateVue2API() {
const ignoreList = ['version', 'default']
const VCA = loadModule('@vue/composition-api')
if (!VCA) {
console.warn('[vue-demi] Composition API plugin is not found. Please run "npm install @vue/composition-api" to install.')
return
}
const exports = Object.keys(VCA).filter(i => !ignoreList.includes(i))
const esmPath = path.join(dir, 'index.mjs')
let content = fs.readFileSync(esmPath, 'utf-8')
content = content.replace(
/\/\*\*VCA-EXPORTS\*\*\/[\s\S]+\/\*\*VCA-EXPORTS\*\*\//m,
`/**VCA-EXPORTS**/
export { ${exports.join(', ')} } from '@vue/composition-api/dist/vue-composition-api.mjs'
/**VCA-EXPORTS**/`
)
fs.writeFileSync(esmPath, content, 'utf-8')
}
function switchVersion(version, vue) {
copy('index.cjs', version, vue)
copy('index.mjs', version, vue)
copy('index.d.ts', version, vue)
if (version === 2)
updateVue2API()
}
module.exports.loadModule = loadModule
module.exports.switchVersion = switchVersion

91
frontend/node_modules/vue-echarts/package.json generated vendored Normal file
View File

@@ -0,0 +1,91 @@
{
"name": "vue-echarts",
"version": "6.7.3",
"description": "Vue.js component for Apache ECharts™.",
"author": "GU Yiling <justice360@gmail.com>",
"main": "dist/index.cjs.min.js",
"module": "dist/index.esm.min.js",
"unpkg": "dist/index.umd.min.js",
"files": [
"dist",
"scripts/postinstall.js"
],
"dependencies": {
"resize-detector": "^0.3.0",
"vue-demi": "^0.13.11"
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@highlightjs/vue-plugin": "^2.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-terser": "^0.4.4",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"@vercel/analytics": "^1.2.2",
"@vue/cli-plugin-babel": "^5.0.8",
"@vue/cli-plugin-eslint": "^5.0.8",
"@vue/cli-plugin-typescript": "^5.0.8",
"@vue/cli-service": "^5.0.8",
"@vue/compiler-sfc": "^3.4.24",
"@vue/composition-api": "^1.7.2",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^10.0.0",
"@vueuse/core": "^10.9.0",
"comment-mark": "^1.1.1",
"core-js": "^3.37.0",
"echarts": "^5.5.0",
"echarts-gl": "^2.0.9",
"echarts-liquidfill": "^3.1.0",
"esbuild-wasm": "^0.19.12",
"eslint": "^7.32.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-vue": "^8.7.1",
"highlight.js": "^11.9.0",
"pinia": "^2.1.7",
"postcss": "^8.4.38",
"postcss-loader": "^5.3.0",
"postcss-nested": "^5.0.6",
"prettier": "^2.8.8",
"raw-loader": "^4.0.2",
"resize-detector": "^0.3.0",
"rimraf": "^3.0.2",
"rollup": "^2.79.1",
"rollup-plugin-dts": "^4.2.3",
"rollup-plugin-styles": "^4.0.0",
"rollup-plugin-ts": "^2.0.7",
"tslib": "^2.6.2",
"typescript": "4.6.4",
"vue": "^3.4.24",
"vue2": "npm:vue@^2.7.16",
"webpack": "^5.91.0"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.5",
"@vue/runtime-core": "^3.0.0",
"echarts": "^5.4.1",
"vue": "^2.6.12 || ^3.1.1"
},
"jsdelivr": "dist/index.umd.min.js",
"license": "MIT",
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
},
"@vue/runtime-core": {
"optional": true
}
},
"repository": "https://github.com/ecomfe/vue-echarts.git",
"types": "dist/index.d.ts",
"scripts": {
"serve": "vue-cli-service serve",
"build": "pnpm run docs && rimraf dist && pnpm run build:2 && pnpm run build:3 && vue-demi-switch 3",
"build:2": "vue-demi-switch 2 vue2 && rollup -c rollup.vue2.config.js",
"build:3": "vue-demi-switch 3 && rollup -c rollup.config.js",
"lint": "vue-cli-service lint",
"build:demo": "vue-cli-service build",
"docs": "node ./scripts/docs.js",
"postinstall": "node ./scripts/postinstall.js"
}
}

View File

@@ -0,0 +1,46 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
const fs = require("fs");
const packageFile = path.resolve(__dirname, "../package.json");
const typesPaths = {
3: "dist/index.d.ts",
2.7: "dist/index.vue2_7.d.ts",
2: "dist/index.vue2.d.ts"
};
function switchVersion(version) {
const typesPath = typesPaths[version];
const package = JSON.parse(fs.readFileSync(packageFile, "utf8"));
if (typesPath !== package.types) {
package.types = typesPath;
fs.writeFileSync(packageFile, JSON.stringify(package, null, " "), "utf8");
}
console.log(`[vue-echarts] Switched to Vue ${version} environment.`);
}
function loadVue() {
try {
return require("vue");
} catch (e) {
return null;
}
}
const Vue = loadVue();
// Align the process with vue-demi
if (!Vue || typeof Vue.version !== "string") {
console.warn(
'[vue-echarts] Vue is not found. Please run "npm install vue" to install.'
);
} else if (Vue.version.startsWith("3.")) {
switchVersion(3);
} else if (Vue.version.startsWith("2.7.")) {
switchVersion(2.7);
} else if (Vue.version.startsWith("2.")) {
switchVersion(2);
} else {
console.warn(`[vue-echarts] Vue version v${Vue.version} is not supported.`);
}