@lumal/charts 0.0.1-beta → 0.0.2-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +24 -24
- package/dist/charts.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +28 -10
- package/dist/src/useChartResize.d.ts +2 -1
- package/dist/src/useChartResize.d.ts.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Lumal contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lumal contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
# @lumal/charts
|
|
2
|
-
|
|
3
|
-
Lumal 可选图表包,基于 ECharts 与 vue-echarts 封装轻量图表组件。ECharts 作为 peer dependency,不进入 `@lumal/core` 默认依赖。
|
|
4
|
-
|
|
5
|
-
## 安装
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm add @lumal/charts echarts vue-echarts vue
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 用法
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { LumalChart, LumalChartPanel, useChartResize } from '@lumal/charts'
|
|
15
|
-
import '@lumal/charts/style.css'
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
```vue
|
|
1
|
+
# @lumal/charts
|
|
2
|
+
|
|
3
|
+
Lumal 可选图表包,基于 ECharts 与 vue-echarts 封装轻量图表组件。ECharts 作为 peer dependency,不进入 `@lumal/core` 默认依赖。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @lumal/charts echarts vue-echarts vue
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 用法
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { LumalChart, LumalChartPanel, useChartResize } from '@lumal/charts'
|
|
15
|
+
import '@lumal/charts/style.css'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
19
|
<LumalChartPanel
|
|
20
20
|
v-model:view="view"
|
|
21
21
|
title="访问趋势"
|
|
@@ -31,11 +31,11 @@ import '@lumal/charts/style.css'
|
|
|
31
31
|
<template #query>查询条件</template>
|
|
32
32
|
<template #table>可访问的数据表格</template>
|
|
33
33
|
</LumalChartPanel>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## 导出
|
|
37
|
-
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 导出
|
|
37
|
+
|
|
38
38
|
- `LumalChart`:基础图表组件,透传 ECharts `options`,容器自适应,并默认响应 reduced-motion。
|
|
39
39
|
- `LumalChartPanel`:支持查询区、图表/表格切换、导出、重试、loading/empty/error 和无障碍摘要的工作流面板。
|
|
40
|
-
- `useChartResize`:监听容器尺寸变化并触发图表 resize。
|
|
41
|
-
- `resolveChartPanelStyle`:图表区/表格区宽度到 CSS 变量的映射。
|
|
40
|
+
- `useChartResize`:监听容器尺寸变化并触发图表 resize。
|
|
41
|
+
- `resolveChartPanelStyle`:图表区/表格区宽度到 CSS 变量的映射。
|
package/dist/charts.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.lumal-chart[data-v-
|
|
1
|
+
.lumal-chart[data-v-a4739ea4],.lumal-chart__canvas[data-v-a4739ea4]{width:100%;height:100%}.lumal-chart-panel[data-v-2c864110]{flex-direction:column;gap:12px;display:flex}.lumal-chart-panel__header[data-v-2c864110]{justify-content:space-between;align-items:center;gap:16px;display:flex}.lumal-chart-panel__query[data-v-2c864110]{border-radius:var(--lumal-radius-base,8px);background:var(--el-fill-color-light,Canvas);padding:12px}.lumal-chart-panel__title[data-v-2c864110]{margin:0;font-size:15px;font-weight:600}.lumal-chart-panel__body[data-v-2c864110]{width:100%;min-height:160px;position:relative;overflow:hidden}.lumal-chart-panel__body.is-table[data-v-2c864110]{overflow:auto}.lumal-chart-panel__status[data-v-2c864110]{height:100%;color:var(--el-text-color-secondary,CanvasText);text-align:center;flex-direction:column;justify-content:center;align-items:center;gap:12px;display:flex}.lumal-chart-panel__status button[data-v-2c864110],.lumal-chart-panel__actions button[data-v-2c864110]{border:1px solid var(--el-border-color,currentColor);border-radius:var(--lumal-radius-base,8px);min-width:44px;min-height:44px;color:var(--el-text-color-primary,CanvasText);background:var(--el-bg-color,Canvas);cursor:pointer;padding:0 14px}.lumal-chart-panel__actions[data-v-2c864110]{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.lumal-chart-panel__view-toggle[data-v-2c864110]{display:inline-flex}.lumal-chart-panel__view-toggle button[aria-pressed=true][data-v-2c864110]{border-color:var(--el-color-primary,Highlight);color:var(--el-color-primary,Highlight);background:var(--el-color-primary-light-9,Canvas)}.lumal-chart-panel__summary[data-v-2c864110]{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.lumal-chart-panel button[data-v-2c864110]:focus-visible{outline:2px solid var(--el-color-primary,Highlight);outline-offset:2px}@media (width<=640px){.lumal-chart-panel__header[data-v-2c864110]{flex-direction:column;align-items:flex-start}.lumal-chart-panel__actions[data-v-2c864110]{justify-content:flex-start;width:100%}}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require("vue"),l=require("vue-echarts");l=s(l,1);function u(e,t,n={}){if(n.enabled===!1)return;let r;function i(){e.value?.resize()}function
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require("vue"),l=require("vue-echarts");l=s(l,1);function u(e,t,n={}){if(n.enabled===!1)return;let r,i=0,a=!1;function o(){let e=t?.value;return!e||e.clientWidth>0&&e.clientHeight>0}function s(){i&&=(typeof cancelAnimationFrame==`function`?cancelAnimationFrame(i):clearTimeout(i),0)}function l(){if(!o())return;s();let t=()=>{i=0,o()&&e.value?.resize()};i=typeof requestAnimationFrame==`function`?requestAnimationFrame(t):setTimeout(t,16)}function u(e){r?.disconnect(),r=void 0,e&&typeof ResizeObserver<`u`&&(r=new ResizeObserver(l),r.observe(e)),l()}function d(){a||typeof window>`u`||(window.addEventListener(`resize`,l,{passive:!0}),a=!0)}function f(){!a||typeof window>`u`||(window.removeEventListener(`resize`,l),a=!1)}(0,c.watch)(e,l,{flush:`post`}),(0,c.onMounted)(()=>{t&&typeof ResizeObserver<`u`?(u(t.value),(0,c.watch)(t,u)):(d(),l())}),(0,c.onBeforeUnmount)(()=>{s(),r?.disconnect(),f()})}var d=[`aria-label`],f=(0,c.defineComponent)({__name:`LumalChart`,props:{options:{},updateOptions:{default:void 0},autoResize:{type:Boolean,default:!0},animation:{type:Boolean,default:void 0},ariaLabel:{default:`数据图表`},width:{default:`100%`},height:{default:`100%`}},setup(e,{expose:t}){let n=e,r=(0,c.shallowRef)(!1),i=(0,c.shallowRef)(!1),a=(0,c.computed)(()=>({...n.options,animation:n.animation??!i.value})),o;function s(e){i.value=e.matches}let f=(0,c.useTemplateRef)(`chartRef`);return(0,c.onMounted)(()=>{typeof window<`u`&&typeof window.matchMedia==`function`&&(o=window.matchMedia(`(prefers-reduced-motion: reduce)`),s(o),o.addEventListener?.(`change`,s)),(0,c.nextTick)(()=>{r.value=!0})}),(0,c.onBeforeUnmount)(()=>{o?.removeEventListener?.(`change`,s)}),u(f),t({resize:()=>f.value?.resize()}),(t,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{class:`lumal-chart`,role:`img`,"aria-label":e.ariaLabel,style:(0,c.normalizeStyle)({height:e.height,width:e.width})},[r.value?((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(l.default),{key:0,ref_key:`chartRef`,ref:f,class:`lumal-chart__canvas`,option:a.value,"update-options":e.updateOptions,autoresize:e.autoResize},null,8,[`option`,`update-options`,`autoresize`])):(0,c.createCommentVNode)(``,!0)],12,d))}}),p=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},m=p(f,[[`__scopeId`,`data-v-a4739ea4`]]);function h(e){if(typeof e==`number`)return Number.isFinite(e)?`${e}px`:void 0;if(typeof e==`string`&&e.trim())return e}function g(e){let t=h(e.chartWidth),n=h(e.tableWidth),r={};return t&&(r[`--lumal-chart-panel-chart-width`]=t),n&&(r[`--lumal-chart-panel-table-width`]=n),Object.keys(r).length>0?r:void 0}var _={key:0,class:`lumal-chart-panel__query`},v={key:1,class:`lumal-chart-panel__header`},y={key:0,class:`lumal-chart-panel__title`},b={class:`lumal-chart-panel__actions`},x={key:0,class:`lumal-chart-panel__view-toggle`,"aria-label":`图表展示方式`},S=[`aria-pressed`],C=[`aria-pressed`],w=[`aria-busy`,`aria-describedby`],T={key:0,class:`lumal-chart-panel__status`,role:`status`},E={key:1,class:`lumal-chart-panel__status is-error`,role:`alert`},D={key:2,class:`lumal-chart-panel__status`,role:`status`},O=p((0,c.defineComponent)({__name:`LumalChartPanel`,props:(0,c.mergeModels)({title:{default:``},options:{default:void 0},loading:{type:Boolean,default:!1},noData:{type:Boolean,default:!1},emptyText:{default:`暂无数据`},height:{default:`320px`},chartWidth:{default:void 0},tableWidth:{default:void 0},error:{type:[Boolean,Error,String],default:!1},errorText:{default:`数据加载失败`},retryText:{default:`重新加载`},summary:{default:``},showExport:{type:Boolean,default:!1},showViewToggle:{type:Boolean,default:!1},animation:{type:Boolean,default:void 0}},{view:{default:`chart`},viewModifiers:{}}),emits:(0,c.mergeModels)([`export`,`retry`],[`update:view`]),setup(e,{expose:t,emit:n}){let r=e,i=n,a=(0,c.useModel)(e,`view`),o=(0,c.useTemplateRef)(`chartRef`),s=`lumal-chart-summary-${(0,c.useId)()}`,l=(0,c.computed)(()=>r.error instanceof Error?r.error.message||r.errorText:typeof r.error==`string`?r.error:r.errorText),u=(0,c.computed)(()=>g({chartWidth:r.chartWidth,tableWidth:r.tableWidth}));return t({resize:()=>o.value?.resize()}),(t,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(`section`,{class:`lumal-chart-panel`,style:(0,c.normalizeStyle)(u.value)},[t.$slots.query?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,_,[(0,c.renderSlot)(t.$slots,`query`,{},void 0,!0)])):(0,c.createCommentVNode)(``,!0),e.title||t.$slots.actions||e.showExport||e.showViewToggle?((0,c.openBlock)(),(0,c.createElementBlock)(`header`,v,[e.title?((0,c.openBlock)(),(0,c.createElementBlock)(`h4`,y,(0,c.toDisplayString)(e.title),1)):(0,c.createCommentVNode)(``,!0),(0,c.createElementVNode)(`div`,b,[(0,c.renderSlot)(t.$slots,`actions`,{},void 0,!0),e.showViewToggle?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,x,[(0,c.createElementVNode)(`button`,{type:`button`,"aria-pressed":a.value===`chart`,onClick:n[0]||=e=>a.value=`chart`},` 图表 `,8,S),(0,c.createElementVNode)(`button`,{type:`button`,"aria-pressed":a.value===`table`,onClick:n[1]||=e=>a.value=`table`},` 表格 `,8,C)])):(0,c.createCommentVNode)(``,!0),e.showExport?((0,c.openBlock)(),(0,c.createElementBlock)(`button`,{key:1,type:`button`,onClick:n[2]||=e=>i(`export`,a.value)},` 导出 `)):(0,c.createCommentVNode)(``,!0)])])):(0,c.createCommentVNode)(``,!0),e.summary?((0,c.openBlock)(),(0,c.createElementBlock)(`p`,{key:2,id:s,class:`lumal-chart-panel__summary`},(0,c.toDisplayString)(e.summary),1)):(0,c.createCommentVNode)(``,!0),(0,c.createElementVNode)(`div`,{class:(0,c.normalizeClass)([`lumal-chart-panel__body`,`is-${a.value}`]),style:(0,c.normalizeStyle)({height:e.height}),"aria-busy":e.loading,"aria-describedby":e.summary?s:void 0},[e.loading?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,T,[(0,c.renderSlot)(t.$slots,`loading`,{},()=>[n[4]||=(0,c.createTextVNode)(` 加载中… `,-1)],!0)])):e.error?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,E,[(0,c.renderSlot)(t.$slots,`error`,{message:l.value,retry:()=>i(`retry`)},()=>[(0,c.createElementVNode)(`span`,null,(0,c.toDisplayString)(l.value),1),(0,c.createElementVNode)(`button`,{type:`button`,onClick:n[3]||=e=>i(`retry`)},(0,c.toDisplayString)(e.retryText),1)],!0)])):e.noData?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,D,[(0,c.renderSlot)(t.$slots,`empty`,{},()=>[(0,c.createTextVNode)((0,c.toDisplayString)(e.emptyText),1)],!0)])):a.value===`table`?(0,c.renderSlot)(t.$slots,`table`,{key:3},void 0,!0):e.options?((0,c.openBlock)(),(0,c.createBlock)(m,{key:4,ref_key:`chartRef`,ref:o,options:e.options,height:e.height,animation:e.animation,"aria-label":e.title||`数据图表`},null,8,[`options`,`height`,`animation`,`aria-label`])):(0,c.renderSlot)(t.$slots,`chart`,{key:5},void 0,!0)],14,w)],4))}}),[[`__scopeId`,`data-v-2c864110`]]);function k(e,t){let n=e;return n.install=function(n){n.component(t,e)},n}var A=k(m,`LumalChart`),j=k(O,`LumalChartPanel`);exports.LumalChart=A,exports.LumalChartPanel=j,exports.resolveChartPanelStyle=g,exports.useChartResize=u;
|
package/dist/index.js
CHANGED
|
@@ -3,17 +3,35 @@ import S from "vue-echarts";
|
|
|
3
3
|
//#region src/useChartResize.ts
|
|
4
4
|
function C(e, t, n = {}) {
|
|
5
5
|
if (n.enabled === !1) return;
|
|
6
|
-
let r;
|
|
7
|
-
function
|
|
8
|
-
e
|
|
6
|
+
let r, i = 0, a = !1;
|
|
7
|
+
function o() {
|
|
8
|
+
let e = t?.value;
|
|
9
|
+
return !e || e.clientWidth > 0 && e.clientHeight > 0;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
11
|
+
function s() {
|
|
12
|
+
i &&= (typeof cancelAnimationFrame == "function" ? cancelAnimationFrame(i) : clearTimeout(i), 0);
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
function c() {
|
|
15
|
+
if (!o()) return;
|
|
16
|
+
s();
|
|
17
|
+
let t = () => {
|
|
18
|
+
i = 0, o() && e.value?.resize();
|
|
19
|
+
};
|
|
20
|
+
i = typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 16);
|
|
21
|
+
}
|
|
22
|
+
function l(e) {
|
|
23
|
+
r?.disconnect(), r = void 0, e && typeof ResizeObserver < "u" && (r = new ResizeObserver(c), r.observe(e)), c();
|
|
24
|
+
}
|
|
25
|
+
function u() {
|
|
26
|
+
a || typeof window > "u" || (window.addEventListener("resize", c, { passive: !0 }), a = !0);
|
|
27
|
+
}
|
|
28
|
+
function p() {
|
|
29
|
+
!a || typeof window > "u" || (window.removeEventListener("resize", c), a = !1);
|
|
30
|
+
}
|
|
31
|
+
x(e, c, { flush: "post" }), f(() => {
|
|
32
|
+
t && typeof ResizeObserver < "u" ? (l(t.value), x(t, l)) : (u(), c());
|
|
15
33
|
}), d(() => {
|
|
16
|
-
r?.disconnect(),
|
|
34
|
+
s(), r?.disconnect(), p();
|
|
17
35
|
});
|
|
18
36
|
}
|
|
19
37
|
//#endregion
|
|
@@ -76,7 +94,7 @@ var w = ["aria-label"], T = /*@__PURE__*/ o({
|
|
|
76
94
|
let n = e.__vccOpts || e;
|
|
77
95
|
for (let [e, r] of t) n[e] = r;
|
|
78
96
|
return n;
|
|
79
|
-
}, D = /*#__PURE__*/ E(T, [["__scopeId", "data-v-
|
|
97
|
+
}, D = /*#__PURE__*/ E(T, [["__scopeId", "data-v-a4739ea4"]]);
|
|
80
98
|
//#endregion
|
|
81
99
|
//#region src/panel-style.ts
|
|
82
100
|
function O(e) {
|
|
@@ -218,7 +236,7 @@ var A = {
|
|
|
218
236
|
])) : m(e.$slots, "chart", { key: 5 }, void 0, !0)], 14, L)
|
|
219
237
|
], 4));
|
|
220
238
|
}
|
|
221
|
-
}), [["__scopeId", "data-v-
|
|
239
|
+
}), [["__scopeId", "data-v-2c864110"]]);
|
|
222
240
|
//#endregion
|
|
223
241
|
//#region src/index.ts
|
|
224
242
|
function H(e, t) {
|
|
@@ -9,7 +9,8 @@ export interface UseChartResizeOptions {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* 监听容器尺寸变化并触发图表实例 resize。
|
|
12
|
-
* 优先使用 ResizeObserver
|
|
12
|
+
* 优先使用 ResizeObserver 观察容器元素;浏览器不支持或未提供容器时,
|
|
13
|
+
* 回退到 window resize。隐藏 Tab、折叠区域和过渡中的 0×0 容器不会触发 resize。
|
|
13
14
|
*/
|
|
14
15
|
export declare function useChartResize(chartRef: Ref<ChartResizeTarget | null | undefined>, containerRef?: Ref<HTMLElement | null | undefined>, options?: UseChartResizeOptions): void;
|
|
15
16
|
//# sourceMappingURL=useChartResize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChartResize.d.ts","sourceRoot":"","sources":["../../src/useChartResize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B,qDAAqD;AACrD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,sBAAsB;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED
|
|
1
|
+
{"version":3,"file":"useChartResize.d.ts","sourceRoot":"","sources":["../../src/useChartResize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B,qDAAqD;AACrD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,sBAAsB;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,GAAG,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,EACnD,YAAY,CAAC,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC,EAClD,OAAO,GAAE,qBAA0B,GAClC,IAAI,CAgFN"}
|