twcpt 0.0.2
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 +22 -0
- package/README.md +189 -0
- package/dist/charts-CKv8I1ye.js +879 -0
- package/dist/charts-DIdINgA4.cjs +1 -0
- package/dist/charts.cjs.js +1 -0
- package/dist/charts.css +1 -0
- package/dist/charts.d.ts +7 -0
- package/dist/charts.es.js +9 -0
- package/dist/components/j-ch-bar/index.d.ts +50 -0
- package/dist/components/j-ch-bar/types.d.ts +42 -0
- package/dist/components/j-ch-bar-line/index.d.ts +49 -0
- package/dist/components/j-ch-bar-line/types.d.ts +42 -0
- package/dist/components/j-ch-bubble/index.d.ts +54 -0
- package/dist/components/j-ch-bubble/types.d.ts +51 -0
- package/dist/components/j-ch-line/index.d.ts +57 -0
- package/dist/components/j-ch-line/types.d.ts +42 -0
- package/dist/components/j-ch-pie-doughnut/index.d.ts +60 -0
- package/dist/components/j-ch-pie-doughnut/types.d.ts +55 -0
- package/dist/components/j-ch-radar/index.d.ts +49 -0
- package/dist/components/j-ch-radar/types.d.ts +42 -0
- package/dist/components/j-tw-btn/index.d.ts +606 -0
- package/dist/components/j-tw-btn/types.d.ts +104 -0
- package/dist/composables/useI18n.d.ts +12 -0
- package/dist/global.d.ts +75 -0
- package/dist/i18n/en-US/index.d.ts +90 -0
- package/dist/i18n/index.d.ts +10 -0
- package/dist/i18n/zh-CN/index.d.ts +90 -0
- package/dist/index-BrYPwI7i.cjs +1 -0
- package/dist/index-C5mRo5Yi.cjs +1 -0
- package/dist/index-DsQ7r9Ci.js +76 -0
- package/dist/index-s5XCGtM9.js +76 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +68 -0
- package/dist/resolver.cjs +1 -0
- package/dist/resolver.d.ts +2 -0
- package/dist/resolver.mjs +36 -0
- package/dist/twcpt-styles.css +1 -0
- package/dist/twcpt-styles.d.ts +1 -0
- package/dist/twcpt-styles.js +1 -0
- package/dist/twcpt.cjs.js +1 -0
- package/dist/twcpt.es.js +2003 -0
- package/dist/types.d.ts +27 -0
- package/dist/utils/chart.d.ts +28 -0
- package/dist/utils/custom-svg.d.ts +3 -0
- package/dist/utils/helper/array.d.ts +289 -0
- package/dist/utils/helper/dom.d.ts +281 -0
- package/dist/utils/helper/index.d.ts +11 -0
- package/dist/utils/helper/number.d.ts +250 -0
- package/dist/utils/helper/object.d.ts +240 -0
- package/dist/utils/helper/perf.d.ts +231 -0
- package/dist/utils/helper/regex.d.ts +265 -0
- package/dist/utils/helper/string.d.ts +248 -0
- package/dist/utils/helper/url.d.ts +259 -0
- package/dist/utils/icon-map.d.ts +19 -0
- package/dist/utils/init.d.ts +35 -0
- package/dist/utils/resolver.d.ts +34 -0
- package/dist/utils/storage.d.ts +3 -0
- package/dist/utils/storageSync.d.ts +20 -0
- package/dist/utils/tool.d.ts +103 -0
- package/dist/utils/website-config.d.ts +15 -0
- package/package.json +90 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("vue"),g=require("chart.js/auto");function k(e){return Object.prototype.toString.call(e)==="[object Object]"}function y(e,i){if(!i)return{...e};const n={...e};for(const o of Object.keys(i)){const s=i[o],u=e[o];if(s!==void 0){if(s===null){n[o]=null;continue}k(u)&&k(s)?n[o]=y(u,s):n[o]=s}}return n}const $=a.defineComponent({name:"JChBar",props:{labels:{type:Array,default:()=>[],required:!0},datasets:{type:Array,required:!0},options:{type:Object,default:()=>({}),required:!1},height:{type:Number,default:300}},setup(e){const i=a.ref(null),n=a.ref(null);let o=null;const s=d=>{let t=d.querySelector("div.chartjs-tooltip");return t||(t=document.createElement("div"),t.className="chartjs-tooltip",t.style.background="#ffffff",t.style.borderRadius="8px",t.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)",t.style.color="#323232",t.style.opacity="0",t.style.pointerEvents="none",t.style.position="absolute",t.style.transform="translate(-50%, 0)",t.style.transition="all .1s ease",t.style.padding="8px 10px",t.style.font="12px Open Sans, sans-serif",d.appendChild(t)),t},u=d=>{const{chart:t,tooltip:l}=d,c=n.value;if(!c)return;const r=s(c);if(l.opacity===0){r.style.opacity="0";return}if(l.body){const m=l.title||[],v=l.body.map(p=>p.lines);if(r.innerHTML="",m.length){const p=document.createElement("div");p.style.fontWeight="600",p.style.marginBottom="4px",p.textContent=m.join(" "),r.appendChild(p)}v.forEach(p=>{const C=document.createElement("div");C.textContent=p.join(" "),r.appendChild(C)})}const{offsetLeft:b,offsetTop:x}=t.canvas;r.style.opacity="1",r.style.left=`${b+l.caretX}px`,r.style.top=`${x+l.caretY}px`},f=()=>{var c;o&&o.destroy();const d=(c=i.value)==null?void 0:c.getContext("2d");if(!d)return;const t={labels:e.labels,datasets:e.datasets.map(r=>({...r,type:"bar",borderWidth:r.borderWidth??0,borderRadius:r.borderRadius??4,maxBarThickness:r.maxBarThickness??34,backgroundColor:r.backgroundColor||"#3A416F"}))},l={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!0,position:"bottom",labels:{color:"#969799",pointStyle:"rect",padding:20,usePointStyle:!0,font:{size:11,family:"Open Sans",style:"normal",lineHeight:1}}},tooltip:{enabled:!1,external:u}},scales:{y:{border:{display:!1},grid:{display:!0,drawOnChartArea:!0,drawTicks:!1,color:"#f5f6fa"},ticks:{display:!0,padding:10,color:"#969799"}},x:{border:{display:!1},grid:{display:!1,drawOnChartArea:!0,drawTicks:!0},ticks:{display:!0,color:"#969799",padding:10}}}};o=new g.Chart(d,{type:"bar",data:t,options:y(l,e.options)})};return a.onMounted(()=>{f()}),a.watch([()=>e.labels,()=>e.datasets,()=>e.height],()=>{f()},{deep:!0}),{barChartCanvas:i,chartContainer:n}}}),h=(e,i)=>{const n=e.__vccOpts||e;for(const[o,s]of i)n[o]=s;return n},O={ref:"chartContainer",style:{position:"relative"}};function S(e,i,n,o,s,u){return a.openBlock(),a.createElementBlock("div",O,[a.createElementVNode("div",null,[a.createElementVNode("canvas",{ref:"barChartCanvas",style:a.normalizeStyle([{width:"100%"},{height:e.height+"px",maxHeight:e.height+"px"}])},null,4)])],512)}const w=h($,[["render",S],["__scopeId","data-v-e2691574"]]),_=a.defineComponent({name:"JChBarLine",props:{labels:{type:Array,default:()=>[],required:!0},datasets:{type:Array,required:!0},options:{type:Object,default:()=>({}),required:!1},height:{type:Number,default:300}},setup(e){const i=a.ref(null);let n=null;const o=()=>{var t;n&&n.destroy();const s=(t=i.value)==null?void 0:t.getContext("2d");if(!s)return;const u=e.datasets.map(l=>{let c={};const r=l.type==="line"?"line":"bar";return l.type==="line"?c={type:"line",tension:.4,pointRadius:0,borderWidth:3,fill:!1,backgroundColor:"transparent",maxBarThickness:void 0}:l.type==="bar"&&(c={type:"bar",borderWidth:0,borderRadius:4,borderSkipped:!1,fill:void 0,maxBarThickness:34,backgroundColor:l.backgroundColor}),{type:r,...l,...c}}),f={labels:e.labels,datasets:u},d={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!0,position:"bottom",labels:{color:"#969799",pointStyle:"rect",padding:20,usePointStyle:!0,font:{size:11,family:"Open Sans",style:"normal",lineHeight:1}}},tooltip:{borderWidth:1,backgroundColor:"white",titleColor:"black",bodyColor:"black",borderColor:"#eeeeee",padding:12,callbacks:{label:l=>`${l.dataset.label||""}: ${l.formattedValue}`}}},interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,border:{display:!1},grid:{display:!0,drawOnChartArea:!0,drawTicks:!1,color:"#f5f6fa"},ticks:{display:!0,padding:10,color:"#969799",font:{size:11,family:"Open Sans",style:"normal",lineHeight:2}}},x:{border:{display:!1},grid:{display:!1,drawOnChartArea:!0,drawTicks:!0},ticks:{display:!0,color:"#969799",padding:10,font:{size:11,family:"Open Sans",style:"normal",lineHeight:2},callback:(l,c)=>{const r=e.labels[c];return r&&r.length>13?`${r.slice(0,13)}...`:r}}}}};n=new g.Chart(s,{data:f,options:y(d,e.options)})};return a.onMounted(()=>{o()}),a.watch([()=>e.labels,()=>e.datasets,()=>e.height],()=>{o()},{deep:!0}),{mixedChartCanvas:i}}});function A(e,i,n,o,s,u){return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("canvas",{ref:"mixedChartCanvas",style:a.normalizeStyle([{width:"100%"},{height:e.height+"px",maxHeight:e.height+"px"}])},null,4)])}const E=h(_,[["render",A]]),q=a.defineComponent({name:"JChBubble",props:{labels:{type:Array,default:()=>[],required:!1},datasets:{type:Array,required:!0},options:{type:Object,default:()=>({}),required:!1},height:{type:Number,default:300}},setup(e){const i=a.ref(null);let n=null;const o=()=>{var d;n&&n.destroy();const s=(d=i.value)==null?void 0:d.getContext("2d");if(!s)return;const u={labels:e.labels,datasets:e.datasets.map(t=>({...t,backgroundColor:t.backgroundColor||"rgba(54, 162, 235, 0.6)"}))},f={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!0,position:"bottom",labels:{color:"#969799",pointStyle:"rect",padding:20,usePointStyle:!0,font:{size:11,family:"Open Sans",style:"normal",lineHeight:1}}},tooltip:{borderWidth:1,backgroundColor:"white",titleColor:"black",bodyColor:"black",borderColor:"#eeeeee",padding:12,callbacks:{label:t=>`${t.dataset.label||""}: ${t.formattedValue}`}}},interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,border:{display:!1},grid:{display:!0,drawOnChartArea:!0,drawTicks:!1,color:"#f5f6fa"},ticks:{display:!0,padding:10,color:"#969799",font:{size:11,family:"Open Sans",style:"normal",lineHeight:2}}},x:{border:{display:!1},grid:{display:!0,drawOnChartArea:!0,drawTicks:!0,color:"#f5f6fa"},ticks:{display:!0,color:"#969799",padding:10,font:{size:11,family:"Open Sans",style:"normal",lineHeight:2},callback:(t,l)=>{const c=e.labels[l];return c?typeof c=="string"&&c.length>13?`${c.slice(0,13)}...`:c:t}}}}};n=new g.Chart(s,{type:"bubble",data:u,options:y(f,e.options)})};return a.onMounted(()=>{o()}),a.watch([()=>e.labels,()=>e.datasets,()=>e.height],()=>{o()},{deep:!0}),{bubbleChartCanvas:i}}});function T(e,i,n,o,s,u){return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("canvas",{ref:"bubbleChartCanvas",style:a.normalizeStyle([{width:"100%"},{height:e.height+"px",maxHeight:e.height+"px"}])},null,4)])}const B=h(q,[["render",T]]),H=a.defineComponent({name:"JChLine",props:{labels:{type:Array,default:()=>[],required:!0},datasets:{type:Array,required:!0},options:{type:Object,default:()=>({}),required:!1},height:{type:Number,default:300},unitName:{type:String,default:""}},setup(e){const i=a.ref(null);let n=null;const o=()=>{var d;n&&n.destroy();const s=(d=i.value)==null?void 0:d.getContext("2d");if(!s)return;const u={labels:e.labels,datasets:e.datasets.map(t=>({...t,tension:.4,pointRadius:2,borderWidth:3,fill:!1,backgroundColor:"transparent",type:"line"}))},f={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!0,position:"bottom",labels:{color:"#969799",pointStyle:"line",padding:20,usePointStyle:!0,font:{size:11,family:"Open Sans",style:"normal",lineHeight:1}}},tooltip:{borderWidth:1,backgroundColor:"white",titleColor:"black",bodyColor:"black",borderColor:"#eeeeee",padding:12,callbacks:{label:t=>`${t.dataset.label||""}: ${t.formattedValue} ${e.unitName}`}}},interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,border:{display:!1},grid:{display:!0,drawOnChartArea:!0,drawTicks:!1,color:"#f5f6fa"},ticks:{display:!0,padding:10,color:"#969799",font:{size:11,family:"Open Sans",style:"normal",lineHeight:2}}},x:{border:{display:!1,dash:[5,5]},grid:{display:!1,drawOnChartArea:!1,drawTicks:!1},ticks:{display:!0,color:"#969799",padding:20,font:{size:10,family:"Open Sans",style:"normal"},callback:(t,l,c)=>{const r=e.labels[l];return r.length>13?`${r.slice(0,13)}...`:r}}}}};n=new g.Chart(s,{type:"line",data:u,options:y(f,e.options)})};return a.onMounted(()=>{o()}),a.watch([()=>e.labels,()=>e.datasets],()=>{o()},{deep:!0}),{lineChartCanvas:i}}}),j={ref:"chartContainer"};function z(e,i,n,o,s,u){return a.openBlock(),a.createElementBlock("div",j,[a.createElementVNode("canvas",{ref:"lineChartCanvas",style:a.normalizeStyle([{width:"100%"},{height:e.height+"px",maxHeight:e.height+"px"}])},null,4)],512)}const N=h(H,[["render",z],["__scopeId","data-v-1a079ae0"]]),W=a.defineComponent({name:"JChPieDoughnut",props:{type:{type:String,required:!0,validator:e=>["pie","doughnut"].includes(e)},labels:{type:Array,default:()=>[],required:!0},datasets:{type:Array,required:!0},options:{type:Object,default:()=>({}),required:!1},height:{type:Number,default:300}},setup(e){const i=a.ref(null),n=a.ref(null);let o=null;const s=d=>{let t=d.querySelector("div.chartjs-tooltip");return t||(t=document.createElement("div"),t.className="chartjs-tooltip",t.style.background="#ffffff",t.style.borderRadius="8px",t.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)",t.style.color="#323232",t.style.opacity="0",t.style.pointerEvents="none",t.style.position="absolute",t.style.transform="translate(-50%, 0)",t.style.transition="all .1s ease",t.style.padding="8px 10px",t.style.font="12px Open Sans, sans-serif",d.appendChild(t)),t},u=d=>{const{chart:t,tooltip:l}=d,c=n.value;if(!c)return;const r=s(c);if(l.opacity===0){r.style.opacity="0";return}if(l.body){const m=l.title||[],v=l.body.map(p=>p.lines);if(r.innerHTML="",m.length){const p=document.createElement("div");p.style.fontWeight="600",p.style.marginBottom="4px",p.textContent=m.join(" "),r.appendChild(p)}v.forEach(p=>{const C=document.createElement("div");C.textContent=p.join(" "),r.appendChild(C)})}const{offsetLeft:b,offsetTop:x}=t.canvas;r.style.opacity="1",r.style.left=`${b+l.caretX}px`,r.style.top=`${x+l.caretY}px`},f=()=>{var r;o&&o.destroy();const d=(r=i.value)==null?void 0:r.getContext("2d");if(!d)return;const t=e.type,l={labels:e.labels,datasets:e.datasets.map(b=>({...b,type:t,borderWidth:b.borderWidth??2}))},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!0,position:"bottom",labels:{color:"#969799",pointStyle:"rect",padding:20,usePointStyle:!0,font:{size:11,family:"Open Sans",style:"normal",lineHeight:1}}},tooltip:{enabled:!1,external:u}},interaction:{intersect:!0,mode:"index"}};o=new g.Chart(d,{type:t,data:l,options:y(c,e.options)})};return a.onMounted(()=>{f()}),a.watch([()=>e.labels,()=>e.datasets,()=>e.type],()=>{f()},{deep:!0}),{chartCanvas:i,chartContainer:n}}}),R={ref:"chartContainer",style:{position:"relative"}};function V(e,i,n,o,s,u){return a.openBlock(),a.createElementBlock("div",R,[a.createElementVNode("canvas",{ref:"chartCanvas",style:a.normalizeStyle([{width:"100%"},{height:e.height+"px",maxHeight:e.height+"px"}])},null,4)],512)}const L=h(W,[["render",V]]),P=a.defineComponent({name:"JChRadar",props:{labels:{type:Array,default:()=>[],required:!0},datasets:{type:Array,required:!0},options:{type:Object,default:()=>({}),required:!1},height:{type:Number,default:300}},setup(e){const i=a.ref(null);let n=null;const o=()=>{var d;n&&n.destroy();const s=(d=i.value)==null?void 0:d.getContext("2d");if(!s)return;const u={labels:e.labels,datasets:e.datasets.map(t=>({...t,type:"radar",fill:t.fill??!0,backgroundColor:t.backgroundColor||"rgba(58,65,111,0.2)",borderColor:t.borderColor||"rgba(58,65,111,1)",borderWidth:t.borderWidth??2}))},f={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!0,position:"bottom",labels:{color:"#969799",pointStyle:"rect",padding:20,usePointStyle:!0,font:{size:11,family:"Open Sans",style:"normal",lineHeight:1}}},tooltip:{borderWidth:1,backgroundColor:"white",titleColor:"black",bodyColor:"black",borderColor:"#eeeeee",padding:12,callbacks:{label:t=>`${t.dataset.label||""}: ${t.formattedValue}`}}},interaction:{intersect:!1,mode:"index"},scales:{r:{beginAtZero:!0,angleLines:{color:"#f5f6fa"},grid:{color:"#f5f6fa"},pointLabels:{color:"#969799",font:{size:11,family:"Open Sans"}},ticks:{display:!1}}}};n=new g.Chart(s,{type:"radar",data:u,options:y(f,e.options)})};return a.onMounted(()=>{o()}),a.watch([()=>e.labels,()=>e.datasets,()=>e.height],()=>{o()},{deep:!0}),{radarChartCanvas:i}}});function D(e,i,n,o,s,u){return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("canvas",{ref:"radarChartCanvas",style:a.normalizeStyle([{width:"100%"},{height:e.height+"px",maxHeight:e.height+"px"}])},null,4)])}const I=h(P,[["render",D]]);exports._export_sfc=h;exports.index=w;exports.index$1=E;exports.index$2=B;exports.index$3=N;exports.index$4=L;exports.index$5=I;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./charts-DIdINgA4.cjs");exports.JChBar=e.index;exports.JChBarLine=e.index$1;exports.JChBubble=e.index$2;exports.JChLine=e.index$3;exports.JChPieDoughnut=e.index$4;exports.JChRadar=e.index$5;
|
package/dist/charts.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";
|
package/dist/charts.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as JChBar } from './components/j-ch-bar/index';
|
|
2
|
+
import { default as JChBarLine } from './components/j-ch-bar-line/index';
|
|
3
|
+
import { default as JChBubble } from './components/j-ch-bubble/index';
|
|
4
|
+
import { default as JChLine } from './components/j-ch-line/index';
|
|
5
|
+
import { default as JChPieDoughnut } from './components/j-ch-pie-doughnut/index';
|
|
6
|
+
import { default as JChRadar } from './components/j-ch-radar/index';
|
|
7
|
+
export { JChBar, JChBarLine, JChBubble, JChLine, JChPieDoughnut, JChRadar, };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Ref, DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { ChartDataset } from 'chart.js/auto';
|
|
3
|
+
type BarDataset = ChartDataset<'bar'>;
|
|
4
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
5
|
+
labels: {
|
|
6
|
+
type: ArrayConstructor;
|
|
7
|
+
default: () => never[];
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
datasets: {
|
|
11
|
+
type: () => BarDataset[];
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
options: {
|
|
15
|
+
type: () => {};
|
|
16
|
+
default: () => {};
|
|
17
|
+
required: false;
|
|
18
|
+
};
|
|
19
|
+
height: {
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
default: number;
|
|
22
|
+
};
|
|
23
|
+
}>, {
|
|
24
|
+
barChartCanvas: Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
25
|
+
chartContainer: Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
26
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
27
|
+
labels: {
|
|
28
|
+
type: ArrayConstructor;
|
|
29
|
+
default: () => never[];
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
datasets: {
|
|
33
|
+
type: () => BarDataset[];
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
options: {
|
|
37
|
+
type: () => {};
|
|
38
|
+
default: () => {};
|
|
39
|
+
required: false;
|
|
40
|
+
};
|
|
41
|
+
height: {
|
|
42
|
+
type: NumberConstructor;
|
|
43
|
+
default: number;
|
|
44
|
+
};
|
|
45
|
+
}>> & Readonly<{}>, {
|
|
46
|
+
labels: unknown[];
|
|
47
|
+
options: {};
|
|
48
|
+
height: number;
|
|
49
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ChartDataset, ChartOptions } from 'chart.js/auto';
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
/** 柱状图数据集类型 */
|
|
4
|
+
export type JChBarDataset = ChartDataset<'bar'>;
|
|
5
|
+
/** JChBar Props 接口 */
|
|
6
|
+
export interface JChBarProps {
|
|
7
|
+
/**
|
|
8
|
+
* X 轴标签数组
|
|
9
|
+
* @required
|
|
10
|
+
*/
|
|
11
|
+
labels: string[];
|
|
12
|
+
/**
|
|
13
|
+
* 数据集数组
|
|
14
|
+
* @required
|
|
15
|
+
* @description Chart.js 柱状图数据集配置
|
|
16
|
+
*/
|
|
17
|
+
datasets: JChBarDataset[];
|
|
18
|
+
/**
|
|
19
|
+
* Chart.js 配置选项(用于覆写默认配置)
|
|
20
|
+
* @default {}
|
|
21
|
+
*/
|
|
22
|
+
options?: Partial<ChartOptions<'bar'>>;
|
|
23
|
+
/**
|
|
24
|
+
* 图表高度 (px)
|
|
25
|
+
* @default 300
|
|
26
|
+
*/
|
|
27
|
+
height?: number;
|
|
28
|
+
}
|
|
29
|
+
/** JChBar Slots 接口 */
|
|
30
|
+
export interface JChBarSlots {
|
|
31
|
+
/** 默认插槽 */
|
|
32
|
+
default?: () => any;
|
|
33
|
+
}
|
|
34
|
+
/** JChBar 暴露的方法和属性 */
|
|
35
|
+
export interface JChBarExpose {
|
|
36
|
+
/** 获取图表容器 DOM 元素 */
|
|
37
|
+
$el: HTMLDivElement | undefined;
|
|
38
|
+
}
|
|
39
|
+
/** JChBar 组件类型定义 */
|
|
40
|
+
export type JChBarComponent = DefineComponent<JChBarProps, JChBarExpose, {}, {}, {}, {}, {}, {}>;
|
|
41
|
+
/** JChBar 实例类型 - 用于 ref 类型定义 */
|
|
42
|
+
export type JChBarInstance = InstanceType<JChBarComponent> & JChBarExpose;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Ref, DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { ChartDataset } from 'chart.js/auto';
|
|
3
|
+
type MixedDataset = ChartDataset<any>;
|
|
4
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
5
|
+
labels: {
|
|
6
|
+
type: ArrayConstructor;
|
|
7
|
+
default: () => never[];
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
datasets: {
|
|
11
|
+
type: () => MixedDataset[];
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
options: {
|
|
15
|
+
type: () => {};
|
|
16
|
+
default: () => {};
|
|
17
|
+
required: false;
|
|
18
|
+
};
|
|
19
|
+
height: {
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
default: number;
|
|
22
|
+
};
|
|
23
|
+
}>, {
|
|
24
|
+
mixedChartCanvas: Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
25
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
26
|
+
labels: {
|
|
27
|
+
type: ArrayConstructor;
|
|
28
|
+
default: () => never[];
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
datasets: {
|
|
32
|
+
type: () => MixedDataset[];
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
options: {
|
|
36
|
+
type: () => {};
|
|
37
|
+
default: () => {};
|
|
38
|
+
required: false;
|
|
39
|
+
};
|
|
40
|
+
height: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
default: number;
|
|
43
|
+
};
|
|
44
|
+
}>> & Readonly<{}>, {
|
|
45
|
+
labels: unknown[];
|
|
46
|
+
options: {};
|
|
47
|
+
height: number;
|
|
48
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ChartDataset, ChartOptions } from 'chart.js/auto';
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
/** 混合图数据集类型(支持 bar 和 line) */
|
|
4
|
+
export type JChBarLineDataset = ChartDataset<'bar'> | ChartDataset<'line'>;
|
|
5
|
+
/** JChBarLine Props 接口 */
|
|
6
|
+
export interface JChBarLineProps {
|
|
7
|
+
/**
|
|
8
|
+
* X 轴标签数组
|
|
9
|
+
* @required
|
|
10
|
+
*/
|
|
11
|
+
labels: string[];
|
|
12
|
+
/**
|
|
13
|
+
* 数据集数组
|
|
14
|
+
* @required
|
|
15
|
+
* @description Chart.js 混合图数据集配置,支持 bar 和 line 类型
|
|
16
|
+
*/
|
|
17
|
+
datasets: JChBarLineDataset[];
|
|
18
|
+
/**
|
|
19
|
+
* Chart.js 配置选项(用于覆写默认配置)
|
|
20
|
+
* @default {}
|
|
21
|
+
*/
|
|
22
|
+
options?: Partial<ChartOptions<'bar' | 'line'>>;
|
|
23
|
+
/**
|
|
24
|
+
* 图表高度 (px)
|
|
25
|
+
* @default 300
|
|
26
|
+
*/
|
|
27
|
+
height?: number;
|
|
28
|
+
}
|
|
29
|
+
/** JChBarLine Slots 接口 */
|
|
30
|
+
export interface JChBarLineSlots {
|
|
31
|
+
/** 默认插槽 */
|
|
32
|
+
default?: () => any;
|
|
33
|
+
}
|
|
34
|
+
/** JChBarLine 暴露的方法和属性 */
|
|
35
|
+
export interface JChBarLineExpose {
|
|
36
|
+
/** 获取图表容器 DOM 元素 */
|
|
37
|
+
$el: HTMLDivElement | undefined;
|
|
38
|
+
}
|
|
39
|
+
/** JChBarLine 组件类型定义 */
|
|
40
|
+
export type JChBarLineComponent = DefineComponent<JChBarLineProps, JChBarLineExpose, {}, {}, {}, {}, {}, {}>;
|
|
41
|
+
/** JChBarLine 实例类型 - 用于 ref 类型定义 */
|
|
42
|
+
export type JChBarLineInstance = InstanceType<JChBarLineComponent> & JChBarLineExpose;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Ref, DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { ChartDataset } from 'chart.js/auto';
|
|
3
|
+
type BubbleDataPoint = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
r: number;
|
|
7
|
+
};
|
|
8
|
+
type BubbleDataset = ChartDataset<'bubble', BubbleDataPoint[]>;
|
|
9
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
10
|
+
labels: {
|
|
11
|
+
type: ArrayConstructor;
|
|
12
|
+
default: () => never[];
|
|
13
|
+
required: false;
|
|
14
|
+
};
|
|
15
|
+
datasets: {
|
|
16
|
+
type: () => BubbleDataset[];
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
options: {
|
|
20
|
+
type: () => {};
|
|
21
|
+
default: () => {};
|
|
22
|
+
required: false;
|
|
23
|
+
};
|
|
24
|
+
height: {
|
|
25
|
+
type: NumberConstructor;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
}>, {
|
|
29
|
+
bubbleChartCanvas: Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
30
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
31
|
+
labels: {
|
|
32
|
+
type: ArrayConstructor;
|
|
33
|
+
default: () => never[];
|
|
34
|
+
required: false;
|
|
35
|
+
};
|
|
36
|
+
datasets: {
|
|
37
|
+
type: () => BubbleDataset[];
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
options: {
|
|
41
|
+
type: () => {};
|
|
42
|
+
default: () => {};
|
|
43
|
+
required: false;
|
|
44
|
+
};
|
|
45
|
+
height: {
|
|
46
|
+
type: NumberConstructor;
|
|
47
|
+
default: number;
|
|
48
|
+
};
|
|
49
|
+
}>> & Readonly<{}>, {
|
|
50
|
+
labels: unknown[];
|
|
51
|
+
options: {};
|
|
52
|
+
height: number;
|
|
53
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
54
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ChartDataset, ChartOptions } from 'chart.js/auto';
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
/** 气泡图数据点类型 */
|
|
4
|
+
export interface JChBubbleDataPoint {
|
|
5
|
+
/** X 轴坐标值 */
|
|
6
|
+
x: number;
|
|
7
|
+
/** Y 轴坐标值 */
|
|
8
|
+
y: number;
|
|
9
|
+
/** 气泡半径 */
|
|
10
|
+
r: number;
|
|
11
|
+
}
|
|
12
|
+
/** 气泡图数据集类型 */
|
|
13
|
+
export type JChBubbleDataset = ChartDataset<'bubble', JChBubbleDataPoint[]>;
|
|
14
|
+
/** JChBubble Props 接口 */
|
|
15
|
+
export interface JChBubbleProps {
|
|
16
|
+
/**
|
|
17
|
+
* X 轴标签数组
|
|
18
|
+
* @default []
|
|
19
|
+
*/
|
|
20
|
+
labels?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* 数据集数组
|
|
23
|
+
* @required
|
|
24
|
+
* @description Chart.js 气泡图数据集配置
|
|
25
|
+
*/
|
|
26
|
+
datasets: JChBubbleDataset[];
|
|
27
|
+
/**
|
|
28
|
+
* Chart.js 配置选项(用于覆写默认配置)
|
|
29
|
+
* @default {}
|
|
30
|
+
*/
|
|
31
|
+
options?: Partial<ChartOptions<'bubble'>>;
|
|
32
|
+
/**
|
|
33
|
+
* 图表高度 (px)
|
|
34
|
+
* @default 300
|
|
35
|
+
*/
|
|
36
|
+
height?: number;
|
|
37
|
+
}
|
|
38
|
+
/** JChBubble Slots 接口 */
|
|
39
|
+
export interface JChBubbleSlots {
|
|
40
|
+
/** 默认插槽 */
|
|
41
|
+
default?: () => any;
|
|
42
|
+
}
|
|
43
|
+
/** JChBubble 暴露的方法和属性 */
|
|
44
|
+
export interface JChBubbleExpose {
|
|
45
|
+
/** 获取图表容器 DOM 元素 */
|
|
46
|
+
$el: HTMLDivElement | undefined;
|
|
47
|
+
}
|
|
48
|
+
/** JChBubble 组件类型定义 */
|
|
49
|
+
export type JChBubbleComponent = DefineComponent<JChBubbleProps, JChBubbleExpose, {}, {}, {}, {}, {}, {}>;
|
|
50
|
+
/** JChBubble 实例类型 - 用于 ref 类型定义 */
|
|
51
|
+
export type JChBubbleInstance = InstanceType<JChBubbleComponent> & JChBubbleExpose;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Ref, DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { ChartDataset } from 'chart.js/auto';
|
|
3
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
4
|
+
labels: {
|
|
5
|
+
type: ArrayConstructor;
|
|
6
|
+
default: () => never[];
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
datasets: {
|
|
10
|
+
type: () => ChartDataset<"line">[];
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
options: {
|
|
14
|
+
type: () => {};
|
|
15
|
+
default: () => {};
|
|
16
|
+
required: false;
|
|
17
|
+
};
|
|
18
|
+
height: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
default: number;
|
|
21
|
+
};
|
|
22
|
+
unitName: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
}>, {
|
|
27
|
+
lineChartCanvas: Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
28
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
29
|
+
labels: {
|
|
30
|
+
type: ArrayConstructor;
|
|
31
|
+
default: () => never[];
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
datasets: {
|
|
35
|
+
type: () => ChartDataset<"line">[];
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
options: {
|
|
39
|
+
type: () => {};
|
|
40
|
+
default: () => {};
|
|
41
|
+
required: false;
|
|
42
|
+
};
|
|
43
|
+
height: {
|
|
44
|
+
type: NumberConstructor;
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
unitName: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
}>> & Readonly<{}>, {
|
|
52
|
+
labels: unknown[];
|
|
53
|
+
options: {};
|
|
54
|
+
height: number;
|
|
55
|
+
unitName: string;
|
|
56
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
57
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ChartDataset, ChartOptions } from 'chart.js/auto';
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
/** 折线图数据集类型 */
|
|
4
|
+
export type JChLineDataset = ChartDataset<'line'>;
|
|
5
|
+
/** JChLine Props 接口 */
|
|
6
|
+
export interface JChLineProps {
|
|
7
|
+
/**
|
|
8
|
+
* X 轴标签数组
|
|
9
|
+
* @required
|
|
10
|
+
*/
|
|
11
|
+
labels: string[];
|
|
12
|
+
/**
|
|
13
|
+
* 数据集数组
|
|
14
|
+
* @required
|
|
15
|
+
* @description Chart.js 折线图数据集配置
|
|
16
|
+
*/
|
|
17
|
+
datasets: JChLineDataset[];
|
|
18
|
+
/**
|
|
19
|
+
* Chart.js 配置选项(用于覆写默认配置)
|
|
20
|
+
* @default {}
|
|
21
|
+
*/
|
|
22
|
+
options?: Partial<ChartOptions<'line'>>;
|
|
23
|
+
/**
|
|
24
|
+
* 图表高度 (px)
|
|
25
|
+
* @default 300
|
|
26
|
+
*/
|
|
27
|
+
height?: number;
|
|
28
|
+
}
|
|
29
|
+
/** JChLine Slots 接口 */
|
|
30
|
+
export interface JChLineSlots {
|
|
31
|
+
/** 默认插槽 */
|
|
32
|
+
default?: () => any;
|
|
33
|
+
}
|
|
34
|
+
/** JChLine 暴露的方法和属性 */
|
|
35
|
+
export interface JChLineExpose {
|
|
36
|
+
/** 获取图表容器 DOM 元素 */
|
|
37
|
+
$el: HTMLDivElement | undefined;
|
|
38
|
+
}
|
|
39
|
+
/** JChLine 组件类型定义 */
|
|
40
|
+
export type JChLineComponent = DefineComponent<JChLineProps, JChLineExpose, {}, {}, {}, {}, {}, {}>;
|
|
41
|
+
/** JChLine 实例类型 - 用于 ref 类型定义 */
|
|
42
|
+
export type JChLineInstance = InstanceType<JChLineComponent> & JChLineExpose;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Ref, DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { ChartDataset } from 'chart.js/auto';
|
|
3
|
+
type ChartType = 'pie' | 'doughnut';
|
|
4
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
5
|
+
type: {
|
|
6
|
+
type: () => ChartType;
|
|
7
|
+
required: true;
|
|
8
|
+
validator: (value: string) => boolean;
|
|
9
|
+
};
|
|
10
|
+
labels: {
|
|
11
|
+
type: ArrayConstructor;
|
|
12
|
+
default: () => never[];
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
datasets: {
|
|
16
|
+
type: () => ChartDataset<ChartType>[];
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
options: {
|
|
20
|
+
type: () => {};
|
|
21
|
+
default: () => {};
|
|
22
|
+
required: false;
|
|
23
|
+
};
|
|
24
|
+
height: {
|
|
25
|
+
type: NumberConstructor;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
}>, {
|
|
29
|
+
chartCanvas: Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
30
|
+
chartContainer: Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
31
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
32
|
+
type: {
|
|
33
|
+
type: () => ChartType;
|
|
34
|
+
required: true;
|
|
35
|
+
validator: (value: string) => boolean;
|
|
36
|
+
};
|
|
37
|
+
labels: {
|
|
38
|
+
type: ArrayConstructor;
|
|
39
|
+
default: () => never[];
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
datasets: {
|
|
43
|
+
type: () => ChartDataset<ChartType>[];
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
options: {
|
|
47
|
+
type: () => {};
|
|
48
|
+
default: () => {};
|
|
49
|
+
required: false;
|
|
50
|
+
};
|
|
51
|
+
height: {
|
|
52
|
+
type: NumberConstructor;
|
|
53
|
+
default: number;
|
|
54
|
+
};
|
|
55
|
+
}>> & Readonly<{}>, {
|
|
56
|
+
labels: unknown[];
|
|
57
|
+
options: {};
|
|
58
|
+
height: number;
|
|
59
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
60
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ChartDataset, ChartOptions } from 'chart.js/auto';
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
/** 饼图/环形图类型常量 */
|
|
4
|
+
export declare const JChPieDoughnutType: {
|
|
5
|
+
readonly PIE: "pie";
|
|
6
|
+
readonly DOUGHNUT: "doughnut";
|
|
7
|
+
};
|
|
8
|
+
/** 图表类型 */
|
|
9
|
+
export type JChPieDoughnutTypeType = (typeof JChPieDoughnutType)[keyof typeof JChPieDoughnutType];
|
|
10
|
+
/** 饼图/环形图数据集类型 */
|
|
11
|
+
export type JChPieDoughnutDataset = ChartDataset<'pie'> | ChartDataset<'doughnut'>;
|
|
12
|
+
/** JChPieDoughnut Props 接口 */
|
|
13
|
+
export interface JChPieDoughnutProps {
|
|
14
|
+
/**
|
|
15
|
+
* 图表类型
|
|
16
|
+
* @required
|
|
17
|
+
* @values 'pie' | 'doughnut'
|
|
18
|
+
*/
|
|
19
|
+
type: JChPieDoughnutTypeType;
|
|
20
|
+
/**
|
|
21
|
+
* 数据标签数组
|
|
22
|
+
* @required
|
|
23
|
+
*/
|
|
24
|
+
labels: string[];
|
|
25
|
+
/**
|
|
26
|
+
* 数据集数组
|
|
27
|
+
* @required
|
|
28
|
+
* @description Chart.js 饼图/环形图数据集配置
|
|
29
|
+
*/
|
|
30
|
+
datasets: JChPieDoughnutDataset[];
|
|
31
|
+
/**
|
|
32
|
+
* Chart.js 配置选项(用于覆写默认配置)
|
|
33
|
+
* @default {}
|
|
34
|
+
*/
|
|
35
|
+
options?: Partial<ChartOptions<'pie' | 'doughnut'>>;
|
|
36
|
+
/**
|
|
37
|
+
* 图表高度 (px)
|
|
38
|
+
* @default 300
|
|
39
|
+
*/
|
|
40
|
+
height?: number;
|
|
41
|
+
}
|
|
42
|
+
/** JChPieDoughnut Slots 接口 */
|
|
43
|
+
export interface JChPieDoughnutSlots {
|
|
44
|
+
/** 默认插槽 */
|
|
45
|
+
default?: () => any;
|
|
46
|
+
}
|
|
47
|
+
/** JChPieDoughnut 暴露的方法和属性 */
|
|
48
|
+
export interface JChPieDoughnutExpose {
|
|
49
|
+
/** 获取图表容器 DOM 元素 */
|
|
50
|
+
$el: HTMLDivElement | undefined;
|
|
51
|
+
}
|
|
52
|
+
/** JChPieDoughnut 组件类型定义 */
|
|
53
|
+
export type JChPieDoughnutComponent = DefineComponent<JChPieDoughnutProps, JChPieDoughnutExpose, {}, {}, {}, {}, {}, {}>;
|
|
54
|
+
/** JChPieDoughnut 实例类型 - 用于 ref 类型定义 */
|
|
55
|
+
export type JChPieDoughnutInstance = InstanceType<JChPieDoughnutComponent> & JChPieDoughnutExpose;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Ref, DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { ChartDataset } from 'chart.js/auto';
|
|
3
|
+
type RadarDataset = ChartDataset<'radar'>;
|
|
4
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
5
|
+
labels: {
|
|
6
|
+
type: ArrayConstructor;
|
|
7
|
+
default: () => never[];
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
datasets: {
|
|
11
|
+
type: () => RadarDataset[];
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
options: {
|
|
15
|
+
type: () => {};
|
|
16
|
+
default: () => {};
|
|
17
|
+
required: false;
|
|
18
|
+
};
|
|
19
|
+
height: {
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
default: number;
|
|
22
|
+
};
|
|
23
|
+
}>, {
|
|
24
|
+
radarChartCanvas: Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
25
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
26
|
+
labels: {
|
|
27
|
+
type: ArrayConstructor;
|
|
28
|
+
default: () => never[];
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
datasets: {
|
|
32
|
+
type: () => RadarDataset[];
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
options: {
|
|
36
|
+
type: () => {};
|
|
37
|
+
default: () => {};
|
|
38
|
+
required: false;
|
|
39
|
+
};
|
|
40
|
+
height: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
default: number;
|
|
43
|
+
};
|
|
44
|
+
}>> & Readonly<{}>, {
|
|
45
|
+
labels: unknown[];
|
|
46
|
+
options: {};
|
|
47
|
+
height: number;
|
|
48
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ChartDataset, ChartOptions } from 'chart.js/auto';
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
/** 雷达图数据集类型 */
|
|
4
|
+
export type JChRadarDataset = ChartDataset<'radar'>;
|
|
5
|
+
/** JChRadar Props 接口 */
|
|
6
|
+
export interface JChRadarProps {
|
|
7
|
+
/**
|
|
8
|
+
* 轴标签数组
|
|
9
|
+
* @required
|
|
10
|
+
*/
|
|
11
|
+
labels: string[];
|
|
12
|
+
/**
|
|
13
|
+
* 数据集数组
|
|
14
|
+
* @required
|
|
15
|
+
* @description Chart.js 雷达图数据集配置
|
|
16
|
+
*/
|
|
17
|
+
datasets: JChRadarDataset[];
|
|
18
|
+
/**
|
|
19
|
+
* Chart.js 配置选项(用于覆写默认配置)
|
|
20
|
+
* @default {}
|
|
21
|
+
*/
|
|
22
|
+
options?: Partial<ChartOptions<'radar'>>;
|
|
23
|
+
/**
|
|
24
|
+
* 图表高度 (px)
|
|
25
|
+
* @default 300
|
|
26
|
+
*/
|
|
27
|
+
height?: number;
|
|
28
|
+
}
|
|
29
|
+
/** JChRadar Slots 接口 */
|
|
30
|
+
export interface JChRadarSlots {
|
|
31
|
+
/** 默认插槽 */
|
|
32
|
+
default?: () => any;
|
|
33
|
+
}
|
|
34
|
+
/** JChRadar 暴露的方法和属性 */
|
|
35
|
+
export interface JChRadarExpose {
|
|
36
|
+
/** 获取图表容器 DOM 元素 */
|
|
37
|
+
$el: HTMLDivElement | undefined;
|
|
38
|
+
}
|
|
39
|
+
/** JChRadar 组件类型定义 */
|
|
40
|
+
export type JChRadarComponent = DefineComponent<JChRadarProps, JChRadarExpose, {}, {}, {}, {}, {}, {}>;
|
|
41
|
+
/** JChRadar 实例类型 - 用于 ref 类型定义 */
|
|
42
|
+
export type JChRadarInstance = InstanceType<JChRadarComponent> & JChRadarExpose;
|