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.
@@ -1 +1 @@
1
- "use strict";require("./base-4865d432.cjs");const i=require("./el-empty-608948d9.cjs"),t=require("vue"),r=require("./_plugin-vue_export-helper-f246444f.cjs");const o={__name:"index",props:{data:{type:Array,default:()=>[]},spacing:{type:Number,default:()=>2},row:{type:Number,default:()=>3},col:{type:Number,default:()=>3},emptyText:{type:String,default:()=>"暂无数据"}},setup(e){return(a,s)=>{const n=i.ElEmpty;return e.data&&e.data.length?(t.openBlock(),t.createElementBlock("div",{key:0,class:"chartLayout",style:t.normalizeStyle({width:`calc(100% + ${e.spacing}px)`,height:`calc(100% + ${e.spacing}px)`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.data.slice(0,e.col*e.row),(c,l)=>(t.openBlock(),t.createElementBlock("div",{key:c.key,class:"chartLayout-item",style:t.normalizeStyle({margin:`0 ${e.spacing}px ${e.spacing}px 0`,width:`calc(100% / ${e.row} - ${e.spacing}px)`,height:`calc(100% / ${e.col} - ${e.spacing}px)`})},[t.renderSlot(a.$slots,"default",{data:c,index:l},void 0,!0)],4))),128))],4)):(t.openBlock(),t.createBlock(n,{key:1,description:e.emptyText,style:{height:"80%"}},null,8,["description"]))}}},u=r._export_sfc(o,[["__scopeId","data-v-578f611c"]]),d={install(e){e.component("st-chartLayout",u)}};module.exports=d;
1
+ "use strict";require("./base-4865d432.cjs");const r=require("./el-empty-608948d9.cjs"),t=require("vue"),o=require("./_plugin-vue_export-helper-f246444f.cjs");const u={__name:"index",props:{data:{type:Array,default:()=>[]},spacing:{type:Number,default:()=>2},row:{type:Number,default:()=>3},col:{type:Number,default:()=>3},emptyText:{type:String,default:()=>"暂无数据"}},setup(e){return(n,d)=>{const l=r.ElEmpty;return e.data&&e.data.length?(t.openBlock(),t.createElementBlock("div",{key:0,class:"chartLayout",style:t.normalizeStyle({width:`calc(100% + ${e.spacing}px)`,height:`calc(100% + ${e.spacing}px)`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.data.slice(0,e.col*e.row),(a,i)=>(t.openBlock(),t.createElementBlock("div",{key:a.key,class:"chartLayout-item",style:t.normalizeStyle({margin:`0 ${e.spacing}px ${e.spacing}px 0`,width:`calc(100% / ${e.row} - ${e.spacing}px)`,height:`calc(100% / ${e.col} - ${e.spacing}px)`})},[t.renderSlot(n.$slots,"default",{data:a,index:i},void 0,!0)],4))),128))],4)):(t.openBlock(),t.createBlock(l,{key:1,description:e.emptyText,style:{height:"80%"}},null,8,["description"]))}}},c=o._export_sfc(u,[["__scopeId","data-v-578f611c"]]);c.install=e=>{e.component("st-chartLayout",c)};module.exports=c;
@@ -1,8 +1,8 @@
1
1
  import "./base-a240bf62.js";
2
- import { E as d } from "./el-empty-282e5e93.js";
3
- import { openBlock as e, createElementBlock as a, normalizeStyle as n, Fragment as o, renderList as u, renderSlot as y, createBlock as s } from "vue";
4
- import { _ as m } from "./_plugin-vue_export-helper-dad06003.js";
5
- const f = {
2
+ import { E as o } from "./el-empty-282e5e93.js";
3
+ import { openBlock as e, createElementBlock as a, normalizeStyle as n, Fragment as u, renderList as y, renderSlot as s, createBlock as m } from "vue";
4
+ import { _ as f } from "./_plugin-vue_export-helper-dad06003.js";
5
+ const g = {
6
6
  __name: "index",
7
7
  props: {
8
8
  data: {
@@ -31,8 +31,8 @@ const f = {
31
31
  }
32
32
  },
33
33
  setup(t) {
34
- return (l, h) => {
35
- const i = d;
34
+ return (i, h) => {
35
+ const d = o;
36
36
  return t.data && t.data.length ? (e(), a("div", {
37
37
  key: 0,
38
38
  class: "chartLayout",
@@ -41,7 +41,7 @@ const f = {
41
41
  height: `calc(100% + ${t.spacing}px)`
42
42
  })
43
43
  }, [
44
- (e(!0), a(o, null, u(t.data.slice(0, t.col * t.row), (c, r) => (e(), a("div", {
44
+ (e(!0), a(u, null, y(t.data.slice(0, t.col * t.row), (c, r) => (e(), a("div", {
45
45
  key: c.key,
46
46
  class: "chartLayout-item",
47
47
  style: n({
@@ -50,23 +50,22 @@ const f = {
50
50
  height: `calc(100% / ${t.col} - ${t.spacing}px)`
51
51
  })
52
52
  }, [
53
- y(l.$slots, "default", {
53
+ s(i.$slots, "default", {
54
54
  data: c,
55
55
  index: r
56
56
  }, void 0, !0)
57
57
  ], 4))), 128))
58
- ], 4)) : (e(), s(i, {
58
+ ], 4)) : (e(), m(d, {
59
59
  key: 1,
60
60
  description: t.emptyText,
61
61
  style: { height: "80%" }
62
62
  }, null, 8, ["description"]));
63
63
  };
64
64
  }
65
- }, g = /* @__PURE__ */ m(f, [["__scopeId", "data-v-578f611c"]]), L = {
66
- install(t) {
67
- t.component("st-chartLayout", g);
68
- }
65
+ }, l = /* @__PURE__ */ f(g, [["__scopeId", "data-v-578f611c"]]);
66
+ l.install = (t) => {
67
+ t.component("st-chartLayout", l);
69
68
  };
70
69
  export {
71
- L as default
70
+ l as default
72
71
  };
package/lib/Dialog.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("./base-4865d432.cjs");const u=require("./zh-cn-d4df7172.cjs"),f=require("./el-overlay-7fceb816.cjs"),V=require("./el-button-c24606d0.cjs"),e=require("vue");require("./config-provider-cf4edc1e.cjs");require("./focus-trap-2a734f35.cjs");require("./index-48a9f60d.cjs");require("./vnode-abafec9e.cjs");require("./scroll-bb8039ba.cjs");require("./index-eea0bcb3.cjs");const C=e.createElementVNode("span",null,"This is a message",-1),_={class:"dialog-footer"},q=e.defineComponent({__name:"index",props:{modelValue:{type:Boolean,required:!0},title:{type:String,default:()=>""},style:{type:String,default:()=>""}},emits:["update:modelValue"],setup(o,{emit:s}){const i=s,d=o,l=e.computed({get(){return d.modelValue},set(n){i("update:modelValue",n)}}),c=n=>{i("update:modelValue",!1)};return(n,t)=>{const a=V.ElButton,m=f.ElDialog,p=u.ElConfigProvider;return e.openBlock(),e.createBlock(p,{locale:e.unref(u.zhCn)},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:l.value,"onUpdate:modelValue":t[2]||(t[2]=r=>l.value=r),title:o.title,width:"30%","before-close":c,style:e.normalizeStyle(o.style)},{footer:e.withCtx(()=>[e.createElementVNode("span",_,[e.createVNode(a,{onClick:t[0]||(t[0]=r=>l.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("Cancel")]),_:1}),e.createVNode(a,{type:"primary",onClick:t[1]||(t[1]=r=>l.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(" Confirm ")]),_:1})])]),default:e.withCtx(()=>[C]),_:1},8,["modelValue","title","style"])]),_:1},8,["locale"])}}}),g={install(o){o.component("st-dialog",q)}};module.exports=g;
1
+ "use strict";require("./base-4865d432.cjs");const s=require("./zh-cn-d4df7172.cjs"),V=require("./el-overlay-7fceb816.cjs"),C=require("./el-button-c24606d0.cjs"),e=require("vue");require("./config-provider-cf4edc1e.cjs");require("./focus-trap-2a734f35.cjs");require("./index-48a9f60d.cjs");require("./vnode-abafec9e.cjs");require("./scroll-bb8039ba.cjs");require("./index-eea0bcb3.cjs");const _=e.createElementVNode("span",null,"This is a message",-1),q={class:"dialog-footer"},i=e.defineComponent({__name:"index",props:{modelValue:{type:Boolean,required:!0},title:{type:String,default:()=>""},style:{type:String,default:()=>""}},emits:["update:modelValue"],setup(o,{emit:d}){const a=d,c=o,l=e.computed({get(){return c.modelValue},set(n){a("update:modelValue",n)}}),m=n=>{a("update:modelValue",!1)};return(n,t)=>{const u=C.ElButton,p=V.ElDialog,f=s.ElConfigProvider;return e.openBlock(),e.createBlock(f,{locale:e.unref(s.zhCn)},{default:e.withCtx(()=>[e.createVNode(p,{modelValue:l.value,"onUpdate:modelValue":t[2]||(t[2]=r=>l.value=r),title:o.title,width:"30%","before-close":m,style:e.normalizeStyle(o.style)},{footer:e.withCtx(()=>[e.createElementVNode("span",q,[e.createVNode(u,{onClick:t[0]||(t[0]=r=>l.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("Cancel")]),_:1}),e.createVNode(u,{type:"primary",onClick:t[1]||(t[1]=r=>l.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(" Confirm ")]),_:1})])]),default:e.withCtx(()=>[_]),_:1},8,["modelValue","title","style"])]),_:1},8,["locale"])}}});i.install=o=>{o.component("st-dialog",i)};module.exports=i;
package/lib/Dialog.es.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import "./base-a240bf62.js";
2
- import { z as g, E as V } from "./zh-cn-92978806.js";
3
- import { E as y } from "./el-overlay-9b7bdd18.js";
4
- import { E as v } from "./el-button-fa6a5742.js";
5
- import { defineComponent as C, computed as E, openBlock as x, createBlock as k, unref as B, withCtx as o, createVNode as i, normalizeStyle as S, createElementVNode as d, createTextVNode as m } from "vue";
2
+ import { z as g, E as y } from "./zh-cn-92978806.js";
3
+ import { E as v } from "./el-overlay-9b7bdd18.js";
4
+ import { E as C } from "./el-button-fa6a5742.js";
5
+ import { defineComponent as E, computed as x, openBlock as k, createBlock as B, unref as b, withCtx as o, createVNode as i, normalizeStyle as z, createElementVNode as u, createTextVNode as m } from "vue";
6
6
  import "./config-provider-3db4dac6.js";
7
7
  import "./focus-trap-6922b96b.js";
8
8
  import "./index-1508a06b.js";
9
9
  import "./vnode-a9714179.js";
10
10
  import "./scroll-cfdae01b.js";
11
11
  import "./index-657047bb.js";
12
- const b = /* @__PURE__ */ d("span", null, "This is a message", -1), z = { class: "dialog-footer" }, N = /* @__PURE__ */ C({
12
+ const N = /* @__PURE__ */ u("span", null, "This is a message", -1), S = { class: "dialog-footer" }, d = /* @__PURE__ */ E({
13
13
  __name: "index",
14
14
  props: {
15
15
  modelValue: {
@@ -26,31 +26,31 @@ const b = /* @__PURE__ */ d("span", null, "This is a message", -1), z = { class:
26
26
  }
27
27
  },
28
28
  emits: ["update:modelValue"],
29
- setup(t, { emit: u }) {
30
- const r = u, p = t, l = E({
29
+ setup(t, { emit: p }) {
30
+ const r = p, f = t, l = x({
31
31
  get() {
32
- return p.modelValue;
32
+ return f.modelValue;
33
33
  },
34
34
  set(n) {
35
35
  r("update:modelValue", n);
36
36
  }
37
- }), f = (n) => {
37
+ }), c = (n) => {
38
38
  r("update:modelValue", !1);
39
39
  };
40
40
  return (n, e) => {
41
- const s = v, c = y, _ = V;
42
- return x(), k(_, { locale: B(g) }, {
41
+ const s = C, _ = v, V = y;
42
+ return k(), B(V, { locale: b(g) }, {
43
43
  default: o(() => [
44
- i(c, {
44
+ i(_, {
45
45
  modelValue: l.value,
46
46
  "onUpdate:modelValue": e[2] || (e[2] = (a) => l.value = a),
47
47
  title: t.title,
48
48
  width: "30%",
49
- "before-close": f,
50
- style: S(t.style)
49
+ "before-close": c,
50
+ style: z(t.style)
51
51
  }, {
52
52
  footer: o(() => [
53
- d("span", z, [
53
+ u("span", S, [
54
54
  i(s, {
55
55
  onClick: e[0] || (e[0] = (a) => l.value = !1)
56
56
  }, {
@@ -71,7 +71,7 @@ const b = /* @__PURE__ */ d("span", null, "This is a message", -1), z = { class:
71
71
  ])
72
72
  ]),
73
73
  default: o(() => [
74
- b
74
+ N
75
75
  ]),
76
76
  _: 1
77
77
  }, 8, ["modelValue", "title", "style"])
@@ -80,11 +80,10 @@ const b = /* @__PURE__ */ d("span", null, "This is a message", -1), z = { class:
80
80
  }, 8, ["locale"]);
81
81
  };
82
82
  }
83
- }), G = {
84
- install(t) {
85
- t.component("st-dialog", N);
86
- }
83
+ });
84
+ d.install = (t) => {
85
+ t.component("st-dialog", d);
87
86
  };
88
87
  export {
89
- G as default
88
+ d as default
90
89
  };
@@ -1 +1 @@
1
- "use strict";const a=require("vue"),g=require("echarts"),v=require("./_plugin-vue_export-helper-f246444f.cjs");function y(e){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(c,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return c.default=e,Object.freeze(c)}const h=y(g),x=a.defineComponent({__name:"index",props:{data:{type:Object,default:()=>({})},config:{type:Object,default:()=>({})}},setup(e,{expose:c}){const n={tooltipFormatter:null,dataZoom:null,grid:{left:"60px",bottom:"20px",right:"0",top:0}};let o,l;const r=e,u=a.ref(),s=a.computed(()=>({...n,...r.config}));a.watch(()=>[r.data],()=>{i()},{deep:!0}),a.onMounted(()=>{o=h.init(u.value),i();let t=!0;l=new ResizeObserver(()=>{if(t){t=null;return}o.resize()}),l.observe(u.value)}),a.onUnmounted(()=>{o.dispose(),l.disconnect(),l=null});const i=()=>{o.setOption({tooltip:{confine:!0,formatter:s.value.tooltipFormatter?t=>s.value.tooltipFormatter(t,r.data):null},grid:s.value.grid,xAxis:{type:"category",data:r.data.date},yAxis:{type:"category",inverse:!0,data:r.data.data.map(t=>t.name)},visualMap:{type:"piecewise",show:!1,inRange:[]},dataZoom:s.value.dataZoom,series:[{name:"热力图",type:"heatmap",info:r.data,data:r.data.data.reduce((t,p,m)=>[...t,...p.data.reduce((f,d,_)=>d===null?f:[...f,{value:[_,m,d.value],itemStyle:{color:d.color}}],[])],[]),label:{show:!1}}]})};return c({reset:()=>{i()}}),(t,p)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"chartRef",ref:u,class:"chart"},null,512))}});const b=v._export_sfc(x,[["__scopeId","data-v-4c74604d"]]),O={install(e){e.component("st-heatMap",b)}};module.exports=O;
1
+ "use strict";const a=require("vue"),v=require("echarts"),y=require("./_plugin-vue_export-helper-f246444f.cjs");function h(e){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(c,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return c.default=e,Object.freeze(c)}const x=h(v),b=a.defineComponent({__name:"index",props:{data:{type:Object,default:()=>({})},config:{type:Object,default:()=>({})}},setup(e,{expose:c}){const n={tooltipFormatter:null,dataZoom:null,grid:{left:"60px",bottom:"20px",right:"0",top:0}};let o,l;const r=e,u=a.ref(),s=a.computed(()=>({...n,...r.config}));a.watch(()=>[r.data],()=>{i()},{deep:!0}),a.onMounted(()=>{o=x.init(u.value),i();let t=!0;l=new ResizeObserver(()=>{if(t){t=null;return}o.resize()}),l.observe(u.value)}),a.onUnmounted(()=>{o.dispose(),l.disconnect(),l=null});const i=()=>{o.setOption({tooltip:{confine:!0,formatter:s.value.tooltipFormatter?t=>s.value.tooltipFormatter(t,r.data):null},grid:s.value.grid,xAxis:{type:"category",data:r.data.date},yAxis:{type:"category",inverse:!0,data:r.data.data.map(t=>t.name)},visualMap:{type:"piecewise",show:!1,inRange:[]},dataZoom:s.value.dataZoom,series:[{name:"热力图",type:"heatmap",info:r.data,data:r.data.data.reduce((t,f,_)=>[...t,...f.data.reduce((m,d,g)=>d===null?m:[...m,{value:[g,_,d.value],itemStyle:{color:d.color}}],[])],[]),label:{show:!1}}]})};return c({reset:()=>{i()}}),(t,f)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"chartRef",ref:u,class:"chart"},null,512))}});const p=y._export_sfc(b,[["__scopeId","data-v-4c74604d"]]);p.install=e=>{e.component("st-heatMap",p)};module.exports=p;
package/lib/HeatMap.es.js CHANGED
@@ -1,7 +1,7 @@
1
- import { defineComponent as _, ref as v, computed as g, watch as y, onMounted as h, onUnmounted as x, openBlock as b, createElementBlock as w } from "vue";
2
- import * as M from "echarts";
3
- import { _ as R } from "./_plugin-vue_export-helper-dad06003.js";
4
- const F = /* @__PURE__ */ _({
1
+ import { defineComponent as v, ref as g, computed as y, watch as h, onMounted as x, onUnmounted as b, openBlock as w, createElementBlock as R } from "vue";
2
+ import * as F from "echarts";
3
+ import { _ as M } from "./_plugin-vue_export-helper-dad06003.js";
4
+ const O = /* @__PURE__ */ v({
5
5
  __name: "index",
6
6
  props: {
7
7
  data: {
@@ -14,8 +14,8 @@ const F = /* @__PURE__ */ _({
14
14
  default: () => ({})
15
15
  }
16
16
  },
17
- setup(n, { expose: p }) {
18
- const u = {
17
+ setup(n, { expose: u }) {
18
+ const f = {
19
19
  tooltipFormatter: null,
20
20
  dataZoom: null,
21
21
  grid: {
@@ -26,15 +26,15 @@ const F = /* @__PURE__ */ _({
26
26
  }
27
27
  };
28
28
  let a, o;
29
- const t = n, l = v(), r = g(() => ({ ...u, ...t.config }));
30
- y(
29
+ const t = n, l = g(), r = y(() => ({ ...f, ...t.config }));
30
+ h(
31
31
  () => [t.data],
32
32
  () => {
33
33
  s();
34
34
  },
35
35
  { deep: !0 }
36
- ), h(() => {
37
- a = M.init(l.value), s();
36
+ ), x(() => {
37
+ a = F.init(l.value), s();
38
38
  let e = !0;
39
39
  o = new ResizeObserver(() => {
40
40
  if (e) {
@@ -43,7 +43,7 @@ const F = /* @__PURE__ */ _({
43
43
  }
44
44
  a.resize();
45
45
  }), o.observe(l.value);
46
- }), x(() => {
46
+ }), b(() => {
47
47
  a.dispose(), o.disconnect(), o = null;
48
48
  });
49
49
  const s = () => {
@@ -75,12 +75,12 @@ const F = /* @__PURE__ */ _({
75
75
  name: "热力图",
76
76
  type: "heatmap",
77
77
  info: t.data,
78
- data: t.data.data.reduce((e, d, f) => [
78
+ data: t.data.data.reduce((e, d, m) => [
79
79
  ...e,
80
- ...d.data.reduce((i, c, m) => c === null ? i : [
80
+ ...d.data.reduce((i, c, _) => c === null ? i : [
81
81
  ...i,
82
82
  {
83
- value: [m, f, c.value],
83
+ value: [_, m, c.value],
84
84
  itemStyle: {
85
85
  color: c.color
86
86
  }
@@ -96,23 +96,22 @@ const F = /* @__PURE__ */ _({
96
96
  }
97
97
  );
98
98
  };
99
- return p({
99
+ return u({
100
100
  reset: () => {
101
101
  s();
102
102
  }
103
103
  // 重置
104
- }), (e, d) => (b(), w("div", {
104
+ }), (e, d) => (w(), R("div", {
105
105
  ref_key: "chartRef",
106
106
  ref: l,
107
107
  class: "chart"
108
108
  }, null, 512));
109
109
  }
110
110
  });
111
- const O = /* @__PURE__ */ R(F, [["__scopeId", "data-v-4c74604d"]]), C = {
112
- install(n) {
113
- n.component("st-heatMap", O);
114
- }
111
+ const p = /* @__PURE__ */ M(O, [["__scopeId", "data-v-4c74604d"]]);
112
+ p.install = (n) => {
113
+ n.component("st-heatMap", p);
115
114
  };
116
115
  export {
117
- C as default
116
+ p as default
118
117
  };
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),u=require("./_plugin-vue_export-helper-f246444f.cjs"),g={class:"linearLegend"},p={key:0,class:"linearLegend-unit"},_={class:"linearLegend-content"},h={class:"linearLegend-content-box"},v={class:"linearLegend-content-number"},f=e.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]},unit:{type:String,default:()=>null}},setup(c,{expose:i}){const r=c,d=e.computed(()=>r.data.reduce((t,n,o)=>o===r.data.length-1?t:n.type==="="?(t[t.length-1].width=2,t):n.range.length===1?[...t,{value:n.range[0],width:1}]:[...t,{value:n.range[1],width:1}],[]));return i({numberToColor:t=>{let n=1;r.unit==="亿"?n=1e8:r.unit==="万"&&(n=1e4);for(let o=0;o<r.data.length;o++){const{type:a,color:s,range:l}=r.data[o];if(a==="="&&t===l[0]*n||a===">"&&t>l[0]*n||a===">="&&t>=l[0]*n||a==="<"&&t<l[0]*n||a==="<="&&t<=l[0]*n||a==="()"&&t>l[0]*n&&t<l[1]*n||a==="(]"&&t>l[0]*n&&t<=l[1]*n||a==="[]"&&t>=l[0]*n&&t<=l[1]*n||a==="[)"&&t>=l[0]*n&&t<l[1]*n)return s}}}),(t,n)=>(e.openBlock(),e.createElementBlock("div",g,[c.unit?(e.openBlock(),e.createElementBlock("div",p,"(单位:"+e.toDisplayString(c.unit)+")",1)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[e.createElementVNode("div",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.data,o=>(e.openBlock(),e.createElementBlock("div",{class:"linearLegend-content-box-item",style:e.normalizeStyle({background:o.color})},null,4))),256))]),e.createElementVNode("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,o=>(e.openBlock(),e.createElementBlock("div",{class:"linearLegend-content-number-item",style:e.normalizeStyle({width:`${o.width*36}px`})},e.toDisplayString(o.value),5))),256))])])]))}});const k=u._export_sfc(f,[["__scopeId","data-v-88fd5500"]]),y={install(c){c.component("st-linearLegend",k)}};module.exports=y;
1
+ "use strict";const e=require("vue"),g=require("./_plugin-vue_export-helper-f246444f.cjs"),p={class:"linearLegend"},_={key:0,class:"linearLegend-unit"},h={class:"linearLegend-content"},v={class:"linearLegend-content-box"},f={class:"linearLegend-content-number"},k=e.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]},unit:{type:String,default:()=>null}},setup(c,{expose:d}){const r=c,s=e.computed(()=>r.data.reduce((t,n,o)=>o===r.data.length-1?t:n.type==="="?(t[t.length-1].width=2,t):n.range.length===1?[...t,{value:n.range[0],width:1}]:[...t,{value:n.range[1],width:1}],[]));return d({numberToColor:t=>{let n=1;r.unit==="亿"?n=1e8:r.unit==="万"&&(n=1e4);for(let o=0;o<r.data.length;o++){const{type:a,color:u,range:l}=r.data[o];if(a==="="&&t===l[0]*n||a===">"&&t>l[0]*n||a===">="&&t>=l[0]*n||a==="<"&&t<l[0]*n||a==="<="&&t<=l[0]*n||a==="()"&&t>l[0]*n&&t<l[1]*n||a==="(]"&&t>l[0]*n&&t<=l[1]*n||a==="[]"&&t>=l[0]*n&&t<=l[1]*n||a==="[)"&&t>=l[0]*n&&t<l[1]*n)return u}}}),(t,n)=>(e.openBlock(),e.createElementBlock("div",p,[c.unit?(e.openBlock(),e.createElementBlock("div",_,"(单位:"+e.toDisplayString(c.unit)+")",1)):e.createCommentVNode("",!0),e.createElementVNode("div",h,[e.createElementVNode("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.data,o=>(e.openBlock(),e.createElementBlock("div",{class:"linearLegend-content-box-item",style:e.normalizeStyle({background:o.color})},null,4))),256))]),e.createElementVNode("div",f,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,o=>(e.openBlock(),e.createElementBlock("div",{class:"linearLegend-content-number-item",style:e.normalizeStyle({width:`${o.width*36}px`})},e.toDisplayString(o.value),5))),256))])])]))}});const i=g._export_sfc(k,[["__scopeId","data-v-88fd5500"]]);i.install=c=>{c.component("st-linearLegend",i)};module.exports=i;
@@ -1,9 +1,9 @@
1
- import { defineComponent as v, computed as L, openBlock as d, createElementBlock as r, toDisplayString as c, createCommentVNode as y, createElementVNode as s, Fragment as u, renderList as _, normalizeStyle as g } from "vue";
2
- import { _ as x } from "./_plugin-vue_export-helper-dad06003.js";
3
- const m = { class: "linearLegend" }, w = {
1
+ import { defineComponent as y, computed as L, openBlock as d, createElementBlock as r, toDisplayString as c, createCommentVNode as x, createElementVNode as s, Fragment as u, renderList as _, normalizeStyle as g } from "vue";
2
+ import { _ as m } from "./_plugin-vue_export-helper-dad06003.js";
3
+ const w = { class: "linearLegend" }, k = {
4
4
  key: 0,
5
5
  class: "linearLegend-unit"
6
- }, S = { class: "linearLegend-content" }, k = { class: "linearLegend-content-box" }, C = { class: "linearLegend-content-number" }, B = /* @__PURE__ */ v({
6
+ }, S = { class: "linearLegend-content" }, C = { class: "linearLegend-content-box" }, B = { class: "linearLegend-content-number" }, D = /* @__PURE__ */ y({
7
7
  __name: "index",
8
8
  props: {
9
9
  data: {
@@ -17,23 +17,23 @@ const m = { class: "linearLegend" }, w = {
17
17
  }
18
18
  // 单位
19
19
  },
20
- setup(o, { expose: p }) {
21
- const i = o, f = L(() => i.data.reduce((e, t, a) => a === i.data.length - 1 ? e : t.type === "=" ? (e[e.length - 1].width = 2, e) : t.range.length === 1 ? [...e, { value: t.range[0], width: 1 }] : [...e, { value: t.range[1], width: 1 }], []));
22
- return p({
20
+ setup(o, { expose: f }) {
21
+ const i = o, h = L(() => i.data.reduce((e, t, a) => a === i.data.length - 1 ? e : t.type === "=" ? (e[e.length - 1].width = 2, e) : t.range.length === 1 ? [...e, { value: t.range[0], width: 1 }] : [...e, { value: t.range[1], width: 1 }], []));
22
+ return f({
23
23
  numberToColor: (e) => {
24
24
  let t = 1;
25
25
  i.unit === "亿" ? t = 1e8 : i.unit === "万" && (t = 1e4);
26
26
  for (let a = 0; a < i.data.length; a++) {
27
- const { type: l, color: h, range: n } = i.data[a];
27
+ const { type: l, color: v, range: n } = i.data[a];
28
28
  if (l === "=" && e === n[0] * t || l === ">" && e > n[0] * t || l === ">=" && e >= n[0] * t || l === "<" && e < n[0] * t || l === "<=" && e <= n[0] * t || l === "()" && e > n[0] * t && e < n[1] * t || l === "(]" && e > n[0] * t && e <= n[1] * t || l === "[]" && e >= n[0] * t && e <= n[1] * t || l === "[)" && e >= n[0] * t && e < n[1] * t)
29
- return h;
29
+ return v;
30
30
  }
31
31
  }
32
32
  // 数值转颜色
33
- }), (e, t) => (d(), r("div", m, [
34
- o.unit ? (d(), r("div", w, "(单位:" + c(o.unit) + ")", 1)) : y("", !0),
33
+ }), (e, t) => (d(), r("div", w, [
34
+ o.unit ? (d(), r("div", k, "(单位:" + c(o.unit) + ")", 1)) : x("", !0),
35
35
  s("div", S, [
36
- s("div", k, [
36
+ s("div", C, [
37
37
  (d(!0), r(u, null, _(o.data, (a) => (d(), r("div", {
38
38
  class: "linearLegend-content-box-item",
39
39
  style: g({
@@ -41,8 +41,8 @@ const m = { class: "linearLegend" }, w = {
41
41
  })
42
42
  }, null, 4))), 256))
43
43
  ]),
44
- s("div", C, [
45
- (d(!0), r(u, null, _(f.value, (a) => (d(), r("div", {
44
+ s("div", B, [
45
+ (d(!0), r(u, null, _(h.value, (a) => (d(), r("div", {
46
46
  class: "linearLegend-content-number-item",
47
47
  style: g({
48
48
  width: `${a.width * 36}px`
@@ -53,11 +53,10 @@ const m = { class: "linearLegend" }, w = {
53
53
  ]));
54
54
  }
55
55
  });
56
- const D = /* @__PURE__ */ x(B, [["__scopeId", "data-v-88fd5500"]]), V = {
57
- install(o) {
58
- o.component("st-linearLegend", D);
59
- }
56
+ const p = /* @__PURE__ */ m(D, [["__scopeId", "data-v-88fd5500"]]);
57
+ p.install = (o) => {
58
+ o.component("st-linearLegend", p);
60
59
  };
61
60
  export {
62
- V as default
61
+ p as default
63
62
  };