st-comp 0.0.16 → 0.0.17

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/bundle.js CHANGED
@@ -14871,10 +14871,7 @@ function Zs(e) {
14871
14871
  let Js = !1, eu = !0, tu = [];
14872
14872
  function Mo(e, n) {
14873
14873
  let t = e.length;
14874
- return n <= 1 || n > t ? new Array(t).fill(null) : [
14875
- ...new Array(n - 1).fill(null),
14876
- ...e.slice(0, t - n + 1)
14877
- ];
14874
+ return n <= 1 || n > t ? new Array(t).fill(null) : [...new Array(n - 1).fill(null), ...e.slice(0, t - n + 1)];
14878
14875
  }
14879
14876
  const lt = {
14880
14877
  // 多空线
@@ -14938,8 +14935,8 @@ const lt = {
14938
14935
  }
14939
14936
  }, L1 = (e, n) => lt[e] ? lt[e](n) : new Array(n.time.length).fill(null), O1 = (e) => {
14940
14937
  const n = [], t = [], o = [], a = [], r = [], l = [];
14941
- return e.forEach((i) => {
14942
- n.push(i[0]), t.push(i[1]), o.push(i[4]), a.push(i[2]), r.push(i[3]), l.push([i[1], i[4], i[3], i[2]]);
14938
+ return e.forEach((i, s) => {
14939
+ n.push(i[0]), t.push(i[1]), o.push(i[4]), a.push(i[2]), r.push(i[3]), l.push([i[1], i[4], i[3], i[2], i[6], s === 0 ? i[4] : e[s - 1][4]]);
14943
14940
  }), { time: n, open: t, close: o, high: a, low: r, kLineData: l };
14944
14941
  }, La = (e, n) => e.length > n ? e.slice(e.length - n) : e, z1 = async () => {
14945
14942
  if (!Js)
@@ -15382,7 +15379,7 @@ const lt = {
15382
15379
  dataset: {
15383
15380
  id: "data",
15384
15381
  source: {
15385
- klineData: v,
15382
+ klineData: d,
15386
15383
  indicatorData: g
15387
15384
  }
15388
15385
  },
@@ -15626,26 +15623,37 @@ const lt = {
15626
15623
  var _, P;
15627
15624
  if (a.value && ((P = (_ = a.value.dataset[0]) == null ? void 0 : _.source) != null && P.klineData[r.value])) {
15628
15625
  const R = a.value.dataset[0].source.klineData[r.value];
15626
+ let E = ((R[1] - R[5]) / R[1] * 100).toFixed(2), L = +E == 0 ? "white" : +E > 0 ? "red" : "#00ff00";
15629
15627
  return [
15630
15628
  {
15631
15629
  label: "开",
15632
- value: R[1],
15630
+ value: R[0],
15633
15631
  color: "rgb(153, 153, 153)"
15634
15632
  },
15635
15633
  {
15636
15634
  label: "高",
15637
- value: R[2],
15635
+ value: R[3],
15638
15636
  color: "rgb(153, 153, 153)"
15639
15637
  },
15640
15638
  {
15641
15639
  label: "低",
15642
- value: R[3],
15640
+ value: R[2],
15643
15641
  color: "rgb(153, 153, 153)"
15644
15642
  },
15645
15643
  {
15646
15644
  label: "收",
15647
- value: R[4],
15645
+ value: R[1],
15646
+ color: "rgb(153, 153, 153)"
15647
+ },
15648
+ {
15649
+ label: "额",
15650
+ value: k1(R[4]),
15648
15651
  color: "rgb(153, 153, 153)"
15652
+ },
15653
+ {
15654
+ label: "涨跌",
15655
+ value: `${E}%`,
15656
+ color: L
15649
15657
  }
15650
15658
  ];
15651
15659
  }
@@ -15654,7 +15662,7 @@ const lt = {
15654
15662
  var _, P;
15655
15663
  return a.value && ((P = (_ = a.value.dataset[0]) == null ? void 0 : _.source) != null && P.indicatorData) ? a.value.dataset[0].source.indicatorData.reduce((R, E) => (E.data[r.value] && R.push({
15656
15664
  label: E.key,
15657
- value: k1(E.data[r.value]),
15665
+ value: E.data[r.value].toFixed(2),
15658
15666
  color: E.color
15659
15667
  }), R), []) : [];
15660
15668
  });
@@ -15838,7 +15846,7 @@ const lt = {
15838
15846
  };
15839
15847
  }
15840
15848
  });
15841
- const q1 = /* @__PURE__ */ ga(X1, [["__scopeId", "data-v-9852f99f"]]), Z1 = {
15849
+ const q1 = /* @__PURE__ */ ga(X1, [["__scopeId", "data-v-705b4f3e"]]), Z1 = {
15842
15850
  install(e) {
15843
15851
  e.component("st-kline", q1);
15844
15852
  }