st-comp 0.0.70 → 0.0.71

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/lib/Pie.es.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 S } 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 w from "echarts";
3
+ import { b as x } from "./bundle.umd-4967d574.js";
4
+ import { _ as S } from "./_plugin-vue_export-helper-dad06003.js";
5
5
  import "./_commonjsHelpers-10dfc225.js";
6
- const x = /* @__PURE__ */ y({
6
+ const z = /* @__PURE__ */ F({
7
7
  __name: "index",
8
8
  props: {
9
9
  data: {
@@ -22,7 +22,7 @@ const x = /* @__PURE__ */ y({
22
22
  }
23
23
  },
24
24
  setup(i) {
25
- const { add: p, multiply: m, divide: f, round: _ } = S.stMath, v = {
25
+ const { add: m, multiply: f, divide: _, round: v } = x.stMath, h = {
26
26
  colorList: [
27
27
  "#FAF277",
28
28
  "#FFC467",
@@ -58,19 +58,19 @@ const x = /* @__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 = w.init(s.value), d();
74
74
  let r = !0;
75
75
  l = new ResizeObserver(() => {
76
76
  if (r) {
@@ -79,17 +79,17 @@ const x = /* @__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 x = /* @__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,18 +143,17 @@ ${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 $ = /* @__PURE__ */ w(x, [["__scopeId", "data-v-964eca86"]]), j = {
154
- install(i) {
155
- i.component("st-pie", $);
156
- }
153
+ const p = /* @__PURE__ */ S(z, [["__scopeId", "data-v-964eca86"]]);
154
+ p.install = (i) => {
155
+ i.component("st-pie", p);
157
156
  };
158
157
  export {
159
- j as default
158
+ p as default
160
159
  };