st-comp 0.0.72 → 0.0.73

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/es/Pie.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("vue"),h=require("echarts"),C=require("./bundle.umd-c5698c50.cjs"),b=require("./_plugin-vue_export-helper-f246444f.cjs");require("./_commonjsHelpers-87b0abe8.cjs");function F(o){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const l in o)if(l!=="default"){const i=Object.getOwnPropertyDescriptor(o,l);Object.defineProperty(a,l,i.get?i:{enumerable:!0,get:()=>o[l]})}}return a.default=o,Object.freeze(a)}const B=F(h),D=r.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},style:{type:Object,default:()=>[]}},setup(o){const{add:a,multiply:l,divide:i,round:_}=C.bundle_umdExports.stMath,v={colorList:["#FAF277","#FFC467","#FFA872","#FB962E","#FF772C","#FF577C","#F679D7","#9B4A9B","#9169D7","#9192D0","#655AC7","#4084DE","#0074DA","#0098DF","#00BBE9","#00D2DE","#73E2E6","#00CBB1","#00B488","#48D09A","#93D984","#C9EC7C","#D4E300","#E2BA2B","#A18300","#BC6F3F","#A84E12","#7C462E","#713532","#962B23"],legendColor:"#000",inactiveColor:"#ccc"},g={tooltipFormatter:null};let s,u;const n=o,p=r.ref(),f=r.computed(()=>({...v,...n.style})),y=r.computed(()=>({...g,...n.config}));r.watch(()=>[n.data,n.style],()=>{m()},{deep:!0}),r.onMounted(()=>{s=B.init(p.value),m();let c=!0;u=new ResizeObserver(()=>{if(c){c=null;return}s.resize()}),u.observe(p.value)}),r.onUnmounted(()=>{s.dispose(),u.disconnect(),u=null});const m=()=>{const c=n.data.reduce((e,t)=>a(e,t.value),0);s.setOption({color:f.value.colorList,tooltip:{trigger:"item",confine:!0,formatter:y.value.tooltipFormatter},legend:{orient:"vertical",right:0,bottom:0,itemWidth:28,itemHeight:18,textStyle:{fontSize:12,color:f.value.legendColor},inactiveColor:f.value.inactiveColor,formatter:e=>{const t=n.data.find(d=>d.name===e);return`${e}
2
- ${t.label||t.value}(${typeof t.percent=="number"?t.percent:_(l(i(t.value,c),100))}%)`}},series:[{type:"pie",width:"150%",height:"150%",center:[`${100/3}%`,`${100/3}%`],radius:"50%",data:n.data.map(e=>({...e,itemStyle:{color:e.color}})),label:{show:!0,position:"inside",formatter:e=>{var d;const t=((d=e==null?void 0:e.data)==null?void 0:d.label)||e.value;return t===0?"":t},fontSize:14,color:"#000"},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]})};return(c,e)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"chartRef",ref:p,class:"chart"},null,512))}});const E=b._export_sfc(D,[["__scopeId","data-v-964eca86"]]),x={install(o){o.component("st-pie",E)}};module.exports=x;
1
+ "use strict";const r=require("vue"),C=require("echarts"),b=require("./bundle.umd-c5698c50.cjs"),F=require("./_plugin-vue_export-helper-f246444f.cjs");require("./_commonjsHelpers-87b0abe8.cjs");function B(o){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const l in o)if(l!=="default"){const i=Object.getOwnPropertyDescriptor(o,l);Object.defineProperty(a,l,i.get?i:{enumerable:!0,get:()=>o[l]})}}return a.default=o,Object.freeze(a)}const D=B(C),E=r.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},style:{type:Object,default:()=>[]}},setup(o){const{add:a,multiply:l,divide:i,round:v}=b.bundle_umdExports.stMath,g={colorList:["#FAF277","#FFC467","#FFA872","#FB962E","#FF772C","#FF577C","#F679D7","#9B4A9B","#9169D7","#9192D0","#655AC7","#4084DE","#0074DA","#0098DF","#00BBE9","#00D2DE","#73E2E6","#00CBB1","#00B488","#48D09A","#93D984","#C9EC7C","#D4E300","#E2BA2B","#A18300","#BC6F3F","#A84E12","#7C462E","#713532","#962B23"],legendColor:"#000",inactiveColor:"#ccc"},y={tooltipFormatter:null};let s,u;const n=o,p=r.ref(),m=r.computed(()=>({...g,...n.style})),h=r.computed(()=>({...y,...n.config}));r.watch(()=>[n.data,n.style],()=>{f()},{deep:!0}),r.onMounted(()=>{s=D.init(p.value),f();let c=!0;u=new ResizeObserver(()=>{if(c){c=null;return}s.resize()}),u.observe(p.value)}),r.onUnmounted(()=>{s.dispose(),u.disconnect(),u=null});const f=()=>{const c=n.data.reduce((e,t)=>a(e,t.value),0);s.setOption({color:m.value.colorList,tooltip:{trigger:"item",confine:!0,formatter:h.value.tooltipFormatter},legend:{orient:"vertical",right:0,bottom:0,itemWidth:28,itemHeight:18,textStyle:{fontSize:12,color:m.value.legendColor},inactiveColor:m.value.inactiveColor,formatter:e=>{const t=n.data.find(d=>d.name===e);return`${e}
2
+ ${t.label||t.value}(${typeof t.percent=="number"?t.percent:v(l(i(t.value,c),100))}%)`}},series:[{type:"pie",width:"150%",height:"150%",center:[`${100/3}%`,`${100/3}%`],radius:"50%",data:n.data.map(e=>({...e,itemStyle:{color:e.color}})),label:{show:!0,position:"inside",formatter:e=>{var d;const t=((d=e==null?void 0:e.data)==null?void 0:d.label)||e.value;return t===0?"":t},fontSize:14,color:"#000"},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]})};return(c,e)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"chartRef",ref:p,class:"chart"},null,512))}});const _=F._export_sfc(E,[["__scopeId","data-v-964eca86"]]),x={install(o){o.component("st-pie",_)},componentName:"st-pie",component:_};module.exports=x;
package/es/Pie.js CHANGED
@@ -1,9 +1,9 @@
1
- import { defineComponent as y, ref as F, computed as u, watch as g, onMounted as B, onUnmounted as E, openBlock as b, createElementBlock as D } from "vue";
2
- import * as A from "echarts";
3
- import { b as x } from "./bundle.umd-4967d574.js";
4
- import { _ as w } from "./_plugin-vue_export-helper-dad06003.js";
1
+ import { defineComponent as F, ref as g, computed as u, watch as B, onMounted as E, onUnmounted as b, openBlock as D, createElementBlock as A } from "vue";
2
+ import * as x from "echarts";
3
+ import { b as w } from "./bundle.umd-4967d574.js";
4
+ import { _ as S } from "./_plugin-vue_export-helper-dad06003.js";
5
5
  import "./_commonjsHelpers-10dfc225.js";
6
- const S = /* @__PURE__ */ y({
6
+ const z = /* @__PURE__ */ F({
7
7
  __name: "index",
8
8
  props: {
9
9
  data: {
@@ -22,7 +22,7 @@ const S = /* @__PURE__ */ y({
22
22
  }
23
23
  },
24
24
  setup(i) {
25
- const { add: p, multiply: m, divide: f, round: _ } = x.stMath, v = {
25
+ const { add: m, multiply: f, divide: _, round: v } = w.stMath, h = {
26
26
  colorList: [
27
27
  "#FAF277",
28
28
  "#FFC467",
@@ -58,19 +58,19 @@ const S = /* @__PURE__ */ y({
58
58
  // 饼图颜色列表
59
59
  legendColor: "#000",
60
60
  inactiveColor: "#ccc"
61
- }, h = {
61
+ }, C = {
62
62
  tooltipFormatter: null
63
63
  };
64
64
  let a, l;
65
- const o = i, s = F(), c = u(() => ({ ...v, ...o.style })), C = u(() => ({ ...h, ...o.config }));
66
- g(
65
+ const o = i, s = g(), c = u(() => ({ ...h, ...o.style })), y = u(() => ({ ...C, ...o.config }));
66
+ B(
67
67
  () => [o.data, o.style],
68
68
  () => {
69
69
  d();
70
70
  },
71
71
  { deep: !0 }
72
- ), B(() => {
73
- a = A.init(s.value), d();
72
+ ), E(() => {
73
+ a = x.init(s.value), d();
74
74
  let r = !0;
75
75
  l = new ResizeObserver(() => {
76
76
  if (r) {
@@ -79,17 +79,17 @@ const S = /* @__PURE__ */ y({
79
79
  }
80
80
  a.resize();
81
81
  }), l.observe(s.value);
82
- }), E(() => {
82
+ }), b(() => {
83
83
  a.dispose(), l.disconnect(), l = null;
84
84
  });
85
85
  const d = () => {
86
- const r = o.data.reduce((e, t) => p(e, t.value), 0);
86
+ const r = o.data.reduce((e, t) => m(e, t.value), 0);
87
87
  a.setOption({
88
88
  color: c.value.colorList,
89
89
  tooltip: {
90
90
  trigger: "item",
91
91
  confine: !0,
92
- formatter: C.value.tooltipFormatter
92
+ formatter: y.value.tooltipFormatter
93
93
  },
94
94
  legend: {
95
95
  orient: "vertical",
@@ -105,7 +105,7 @@ const S = /* @__PURE__ */ y({
105
105
  formatter: (e) => {
106
106
  const t = o.data.find((n) => n.name === e);
107
107
  return `${e}
108
- ${t.label || t.value}(${typeof t.percent == "number" ? t.percent : _(m(f(t.value, r), 100))}%)`;
108
+ ${t.label || t.value}(${typeof t.percent == "number" ? t.percent : v(f(_(t.value, r), 100))}%)`;
109
109
  }
110
110
  },
111
111
  series: [
@@ -143,17 +143,19 @@ ${t.label || t.value}(${typeof t.percent == "number" ? t.percent : _(m(f(t.value
143
143
  ]
144
144
  });
145
145
  };
146
- return (r, e) => (b(), D("div", {
146
+ return (r, e) => (D(), A("div", {
147
147
  ref_key: "chartRef",
148
148
  ref: s,
149
149
  class: "chart"
150
150
  }, null, 512));
151
151
  }
152
152
  });
153
- const z = /* @__PURE__ */ w(S, [["__scopeId", "data-v-964eca86"]]), j = {
153
+ const p = /* @__PURE__ */ S(z, [["__scopeId", "data-v-964eca86"]]), j = {
154
154
  install(i) {
155
- i.component("st-pie", z);
156
- }
155
+ i.component("st-pie", p);
156
+ },
157
+ componentName: "st-pie",
158
+ component: p
157
159
  };
158
160
  export {
159
161
  j as default