st-comp 0.0.92 → 0.0.93

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.
Files changed (82) hide show
  1. package/components.d.ts +0 -12
  2. package/es/ChartLayout.cjs +1 -1
  3. package/es/ChartLayout.js +2 -2
  4. package/es/Dialog.cjs +5 -1
  5. package/es/Dialog.js +711 -45
  6. package/es/FactorWarning.cjs +1 -1
  7. package/es/FactorWarning.js +1 -461
  8. package/es/Kline.cjs +1 -1
  9. package/es/Kline.js +91 -92
  10. package/es/KlineNew.cjs +1 -1
  11. package/es/KlineNew.js +9 -10
  12. package/es/Pagination.cjs +1 -1
  13. package/es/Pagination.js +104 -106
  14. package/es/Table.cjs +20 -1
  15. package/es/Table.js +4254 -362
  16. package/es/VarietySearch.cjs +1 -1
  17. package/es/VarietySearch.js +1 -2015
  18. package/es/VirtualTable.cjs +2 -2
  19. package/es/VirtualTable.js +254 -249
  20. package/es/base-8aa55db5.js +725 -0
  21. package/es/base-b187e78f.cjs +9 -0
  22. package/es/{el-button-93e0ac7c.js → el-button-9476b767.js} +69 -69
  23. package/es/{el-button-ec16f484.cjs → el-button-ed961332.cjs} +1 -1
  24. package/es/{el-empty-16ceef82.cjs → el-empty-7adcc7f0.cjs} +1 -1
  25. package/es/{el-empty-0c85d9b7.js → el-empty-f4c08c01.js} +3 -3
  26. package/es/{el-scrollbar-9473fd47.cjs → el-scrollbar-586be9bd.cjs} +1 -1
  27. package/es/{el-scrollbar-e17fad47.js → el-scrollbar-ffb7b9c1.js} +43 -43
  28. package/es/el-select-a6cf0236.js +1893 -0
  29. package/es/el-select-eaa79c54.cjs +9 -0
  30. package/es/el-tag-5a8b728a.cjs +1 -0
  31. package/es/{el-tag-9493bdff.js → el-tag-7549c103.js} +119 -126
  32. package/es/{focus-trap-1b2aef75.js → focus-trap-5fc152a0.js} +34 -35
  33. package/es/focus-trap-ea1e7a19.cjs +1 -0
  34. package/es/raf-3a2b250a.js +6 -0
  35. package/es/{raf-c437ab23.cjs → raf-c4bba516.cjs} +1 -1
  36. package/es/{scroll-a80e1458.cjs → scroll-38e17abc.cjs} +1 -1
  37. package/es/{scroll-a928a93e.js → scroll-c6e51ef8.js} +5 -5
  38. package/es/style.css +1 -1
  39. package/es/use-form-item-bd4b9eeb.js +531 -0
  40. package/es/use-form-item-c25c7251.cjs +3 -0
  41. package/es/use-global-config-2d21cd56.js +110 -0
  42. package/es/use-global-config-bce8cdd8.cjs +1 -0
  43. package/es/{vnode-85a610a2.cjs → vnode-40f9df3c.cjs} +1 -1
  44. package/es/{vnode-aa872900.js → vnode-f4b846cb.js} +1 -1
  45. package/es/zh-cn-a61d484e.cjs +1 -0
  46. package/es/{zh-cn-d29347f8.js → zh-cn-e36dfbf4.js} +45 -6
  47. package/lib/bundle.js +1 -1
  48. package/lib/bundle.umd.cjs +145 -145
  49. package/lib/{index-74cdff5f.js → index-4635557b.js} +5609 -5606
  50. package/lib/{python-ed84da20.js → python-aa056c80.js} +1 -1
  51. package/lib/style.css +1 -1
  52. package/package.json +1 -1
  53. package/packages/FactorWarning/index.vue +28 -13
  54. package/src/pages/FactorWarning/index.vue +850 -8
  55. package/es/base-1bc9f12c.js +0 -762
  56. package/es/base-315cbfab.cjs +0 -9
  57. package/es/castArray-f42865a2.js +0 -10
  58. package/es/castArray-f54f6f75.cjs +0 -1
  59. package/es/config-provider-17c85684.cjs +0 -1
  60. package/es/config-provider-c8d3957d.js +0 -46
  61. package/es/el-icon-0ea8fbf8.cjs +0 -1
  62. package/es/el-icon-4ed993c7.js +0 -1
  63. package/es/el-input-29806e42.js +0 -543
  64. package/es/el-input-a8791103.cjs +0 -9
  65. package/es/el-overlay-53eb27a5.js +0 -678
  66. package/es/el-overlay-6d0c5cc3.cjs +0 -5
  67. package/es/el-popover-1d087574.cjs +0 -1
  68. package/es/el-popover-dd66e2c8.js +0 -133
  69. package/es/el-radio-group-46e8f574.cjs +0 -12
  70. package/es/el-radio-group-caebab9d.js +0 -1743
  71. package/es/el-select-64511731.cjs +0 -1
  72. package/es/el-select-ac302f3c.js +0 -1360
  73. package/es/el-table-column-773986c7.cjs +0 -20
  74. package/es/el-table-column-b8e2141b.js +0 -3795
  75. package/es/el-tag-a6a4d4ef.cjs +0 -1
  76. package/es/focus-trap-ea177336.cjs +0 -1
  77. package/es/raf-6d7e80f4.js +0 -6
  78. package/es/use-form-item-7924b6c1.cjs +0 -3
  79. package/es/use-form-item-aeec8499.js +0 -669
  80. package/es/use-global-config-b07c467a.js +0 -110
  81. package/es/use-global-config-d02be80b.cjs +0 -1
  82. package/es/zh-cn-0024c96d.cjs +0 -1
package/es/Kline.js CHANGED
@@ -1,21 +1,20 @@
1
- import { u as q, _ as me, a as de, r as ve, h as Mt, b as Se, t as pe, i as ae, c as Ve, d as Oe, e as ct, w as dt, f as _e } from "./base-1bc9f12c.js";
1
+ import { u as q, _ as me, P as de, Q as ve, M as Mt, b as Se, L as pe, g as ae, S as Ve, d as Oe, U as ct, w as dt, D as _e } from "./base-8aa55db5.js";
2
2
  import "./el-tooltip-4ed993c7.js";
3
- import { E as Xe } from "./el-tag-9493bdff.js";
3
+ import { a as Xe } from "./el-tag-7549c103.js";
4
4
  import { defineComponent as G, openBlock as _, createBlock as ue, Transition as qe, mergeProps as Ke, unref as Nt, toHandlers as yt, withCtx as ee, renderSlot as X, computed as O, getCurrentInstance as Fe, inject as fe, ref as S, reactive as Qe, watch as H, provide as ke, onMounted as le, onBeforeUnmount as et, h as U, Fragment as ne, withDirectives as zt, vShow as jt, watchEffect as gt, nextTick as Be, toRef as pt, resolveComponent as ft, createElementBlock as R, normalizeClass as re, createElementVNode as te, createTextVNode as tt, toDisplayString as ie, renderList as De, normalizeStyle as Pe, createCommentVNode as nt, onUnmounted as Re, createVNode as K } from "vue";
5
5
  import * as Te from "echarts";
6
6
  import { _ as oe } from "./_plugin-vue_export-helper-dad06003.js";
7
7
  import { b as Le } from "./bundle.umd-4967d574.js";
8
8
  import { i as Tt, t as It } from "./index.esm-8d9a2abe.js";
9
- import { u as mt } from "./el-scrollbar-e17fad47.js";
10
- import { u as Dt, a as Lt, b as vt, E as ot, i as Ne, m as ht } from "./use-form-item-aeec8499.js";
11
- import { E as J, i as We } from "./focus-trap-1b2aef75.js";
12
- import { T as xt } from "./index-657047bb.js";
9
+ import { a as mt } from "./el-scrollbar-ffb7b9c1.js";
10
+ import { b as Dt, w as Lt, o as vt, E as ot, g as Ne, x as xt } from "./use-form-item-bd4b9eeb.js";
11
+ import { a as J, i as We } from "./focus-trap-5fc152a0.js";
12
+ import { T as ht } from "./index-657047bb.js";
13
13
  import { m as At } from "./typescript-7ae59c4c.js";
14
- import { f as Yt } from "./vnode-aa872900.js";
15
- import "./el-input-29806e42.js";
16
- import { E as Ct, a as bt } from "./el-select-ac302f3c.js";
14
+ import { f as Yt } from "./vnode-f4b846cb.js";
15
+ import { E as Ct, a as bt } from "./el-select-a6cf0236.js";
17
16
  import "./_commonjsHelpers-10dfc225.js";
18
- import "./scroll-a928a93e.js";
17
+ import "./scroll-c6e51ef8.js";
19
18
  const je = function(e, n, ...a) {
20
19
  let o;
21
20
  n.includes("mouse") || n.includes("click") ? o = "MouseEvents" : n.includes("key") ? o = "KeyboardEvent" : o = "HTMLEvents";
@@ -205,7 +204,7 @@ function at(e, n) {
205
204
  function Pt(e) {
206
205
  return O(() => {
207
206
  const a = e.backgroundColor;
208
- return a ? new xt(a).shade(20).toString() : "";
207
+ return a ? new ht(a).shade(20).toString() : "";
209
208
  });
210
209
  }
211
210
  const it = (e, n) => {
@@ -306,7 +305,7 @@ var Ue = G({
306
305
  index: e.index,
307
306
  indexPath: t,
308
307
  active: A
309
- }), h = it(i.props, s.level + 1), y = O(() => T.value !== "horizontal" ? {
308
+ }), x = it(i.props, s.level + 1), y = O(() => T.value !== "horizontal" ? {
310
309
  color: P.value
311
310
  } : {
312
311
  borderBottomColor: A.value ? i.props.activeTextColor ? Q.value : "" : "transparent",
@@ -322,7 +321,7 @@ var Ue = G({
322
321
  indexPath: t.value,
323
322
  active: A.value
324
323
  });
325
- }, x = (Y, w = e.showTimeout) => {
324
+ }, h = (Y, w = e.showTimeout) => {
326
325
  var F;
327
326
  Y.type !== "focus" && (i.props.menuTrigger === "click" && i.props.mode === "horizontal" || !i.props.collapse && i.props.mode === "vertical" || e.disabled || (s.mouseInChild.value = !0, M == null || M(), { stop: M } = Ve(() => {
328
327
  i.openMenu(e.index, t.value);
@@ -387,9 +386,9 @@ var Ue = G({
387
386
  u.m("popup-container"),
388
387
  e.popperClass
389
388
  ],
390
- onMouseenter: (W) => x(W, 100),
389
+ onMouseenter: (W) => h(W, 100),
391
390
  onMouseleave: () => E(!0),
392
- onFocus: (W) => x(W, 100)
391
+ onFocus: (W) => h(W, 100)
393
392
  }, [
394
393
  U("ul", {
395
394
  class: [
@@ -397,7 +396,7 @@ var Ue = G({
397
396
  u.m("popup"),
398
397
  u.m(`popup-${v.value}`)
399
398
  ],
400
- style: h.value
399
+ style: x.value
401
400
  }, [(V = n.default) == null ? void 0 : V.call(n)])
402
401
  ]);
403
402
  },
@@ -425,7 +424,7 @@ var Ue = G({
425
424
  return zt(U("ul", {
426
425
  role: "menu",
427
426
  class: [u.b(), u.m("inline")],
428
- style: h.value
427
+ style: x.value
429
428
  }, [(V = n.default) == null ? void 0 : V.call(n)]), [[jt, f.value]]);
430
429
  }
431
430
  })
@@ -440,9 +439,9 @@ var Ue = G({
440
439
  role: "menuitem",
441
440
  ariaHaspopup: !0,
442
441
  ariaExpanded: f.value,
443
- onMouseenter: x,
442
+ onMouseenter: h,
444
443
  onMouseleave: () => E(!0),
445
- onFocus: x
444
+ onFocus: h
446
445
  }, [F]);
447
446
  };
448
447
  }
@@ -485,10 +484,10 @@ const Ut = Se({
485
484
  values: ["dark", "light"],
486
485
  default: "dark"
487
486
  }
488
- }), he = (e) => Array.isArray(e) && e.every((n) => ae(n)), $t = {
489
- close: (e, n) => ae(e) && he(n),
490
- open: (e, n) => ae(e) && he(n),
491
- select: (e, n, a, o) => ae(e) && he(n) && ct(a) && (o === void 0 || o instanceof Promise)
487
+ }), xe = (e) => Array.isArray(e) && e.every((n) => ae(n)), $t = {
488
+ close: (e, n) => ae(e) && xe(n),
489
+ open: (e, n) => ae(e) && xe(n),
490
+ select: (e, n, a, o) => ae(e) && xe(n) && ct(a) && (o === void 0 || o instanceof Promise)
492
491
  };
493
492
  var Vt = G({
494
493
  name: "ElMenu",
@@ -499,12 +498,12 @@ var Vt = G({
499
498
  const T = g.value && M.value[g.value];
500
499
  if (!T || e.mode === "horizontal" || e.collapse)
501
500
  return;
502
- T.indexPath.forEach((h) => {
503
- const y = N.value[h];
504
- y && v(h, y.indexPath);
501
+ T.indexPath.forEach((x) => {
502
+ const y = N.value[x];
503
+ y && v(x, y.indexPath);
505
504
  });
506
505
  }, v = (T, D) => {
507
- d.value.includes(T) || (e.uniqueOpened && (d.value = d.value.filter((h) => D.includes(h))), d.value.push(T), n("open", T, D));
506
+ d.value.includes(T) || (e.uniqueOpened && (d.value = d.value.filter((x) => D.includes(x))), d.value.push(T), n("open", T, D));
508
507
  }, b = (T) => {
509
508
  const D = d.value.indexOf(T);
510
509
  D !== -1 && d.value.splice(D, 1);
@@ -517,29 +516,29 @@ var Vt = G({
517
516
  d.value.includes(T) ? k(T, D) : v(T, D);
518
517
  }, z = (T) => {
519
518
  (e.mode === "horizontal" || e.collapse) && (d.value = []);
520
- const { index: D, indexPath: h } = T;
521
- if (!(We(D) || We(h)))
519
+ const { index: D, indexPath: x } = T;
520
+ if (!(We(D) || We(x)))
522
521
  if (e.router && l) {
523
522
  const y = T.route || D, L = l.push(y).then((m) => (m || (g.value = D), m));
524
- n("select", D, h, { index: D, indexPath: h, route: y }, L);
523
+ n("select", D, x, { index: D, indexPath: x, route: y }, L);
525
524
  } else
526
- g.value = D, n("select", D, h, { index: D, indexPath: h });
525
+ g.value = D, n("select", D, x, { index: D, indexPath: x });
527
526
  }, p = (T) => {
528
- const D = M.value, h = D[T] || g.value && D[g.value] || D[e.defaultActive];
529
- h ? g.value = h.index : g.value = T;
527
+ const D = M.value, x = D[T] || g.value && D[g.value] || D[e.defaultActive];
528
+ x ? g.value = x.index : g.value = T;
530
529
  }, f = () => {
531
530
  var T, D;
532
531
  if (!u.value)
533
532
  return -1;
534
- const h = Array.from((D = (T = u.value) == null ? void 0 : T.childNodes) != null ? D : []).filter((Y) => Y.nodeName !== "#comment" && (Y.nodeName !== "#text" || Y.nodeValue)), y = 64, L = Number.parseInt(getComputedStyle(u.value).paddingLeft, 10), m = Number.parseInt(getComputedStyle(u.value).paddingRight, 10), j = u.value.clientWidth - L - m;
535
- let x = 0, E = 0;
536
- return h.forEach((Y, w) => {
537
- x += Y.offsetWidth || 0, x <= j - y && (E = w + 1);
538
- }), E === h.length ? -1 : E;
533
+ const x = Array.from((D = (T = u.value) == null ? void 0 : T.childNodes) != null ? D : []).filter((Y) => Y.nodeName !== "#comment" && (Y.nodeName !== "#text" || Y.nodeValue)), y = 64, L = Number.parseInt(getComputedStyle(u.value).paddingLeft, 10), m = Number.parseInt(getComputedStyle(u.value).paddingRight, 10), j = u.value.clientWidth - L - m;
534
+ let h = 0, E = 0;
535
+ return x.forEach((Y, w) => {
536
+ h += Y.offsetWidth || 0, h <= j - y && (E = w + 1);
537
+ }), E === x.length ? -1 : E;
539
538
  }, A = (T, D = 33.34) => {
540
- let h;
539
+ let x;
541
540
  return () => {
542
- h && clearTimeout(h), h = setTimeout(() => {
541
+ x && clearTimeout(x), x = setTimeout(() => {
543
542
  T();
544
543
  }, D);
545
544
  };
@@ -598,24 +597,24 @@ var Vt = G({
598
597
  e.mode === "horizontal" && new _t(t.vnode.el, r.namespace.value);
599
598
  }), o({
600
599
  open: (D) => {
601
- const { indexPath: h } = N.value[D];
602
- h.forEach((y) => v(y, h));
600
+ const { indexPath: x } = N.value[D];
601
+ x.forEach((y) => v(y, x));
603
602
  },
604
603
  close: b,
605
604
  handleResize: Q
606
605
  }), () => {
607
606
  var T, D;
608
- let h = (D = (T = a.default) == null ? void 0 : T.call(a)) != null ? D : [];
607
+ let x = (D = (T = a.default) == null ? void 0 : T.call(a)) != null ? D : [];
609
608
  const y = [];
610
609
  if (e.mode === "horizontal" && u.value) {
611
- const j = Yt(h), x = s.value === -1 ? j : j.slice(0, s.value), E = s.value === -1 ? [] : j.slice(s.value);
612
- E != null && E.length && e.ellipsis && (h = x, y.push(U(Ue, {
610
+ const j = Yt(x), h = s.value === -1 ? j : j.slice(0, s.value), E = s.value === -1 ? [] : j.slice(s.value);
611
+ E != null && E.length && e.ellipsis && (x = h, y.push(U(Ue, {
613
612
  index: "sub-menu-more",
614
613
  class: i.e("hide-arrow")
615
614
  }, {
616
615
  title: () => U(ot, {
617
616
  class: i.e("icon-more")
618
- }, { default: () => U(ht) }),
617
+ }, { default: () => U(xt) }),
619
618
  default: () => E
620
619
  })));
621
620
  }
@@ -629,7 +628,7 @@ var Vt = G({
629
628
  [r.m(e.mode)]: !0,
630
629
  [r.m("collapse")]: e.collapse
631
630
  }
632
- }, [...h, ...y]);
631
+ }, [...x, ...y]);
633
632
  return e.collapseTransition && e.mode === "vertical" ? U(Bt, () => m) : m;
634
633
  };
635
634
  }
@@ -645,8 +644,8 @@ const Wt = Se({
645
644
  disabled: Boolean
646
645
  }), Zt = {
647
646
  click: (e) => ae(e.index) && Array.isArray(e.indexPath)
648
- }, xe = "ElMenuItem", Gt = G({
649
- name: xe,
647
+ }, he = "ElMenuItem", Gt = G({
648
+ name: he,
650
649
  components: {
651
650
  ElTooltip: Xe
652
651
  },
@@ -654,9 +653,9 @@ const Wt = Se({
654
653
  emits: Zt,
655
654
  setup(e, { emit: n }) {
656
655
  const a = Fe(), o = fe("rootMenu"), t = q("menu"), l = q("menu-item");
657
- o || pe(xe, "can not inject root menu");
656
+ o || pe(he, "can not inject root menu");
658
657
  const { parentMenu: u, indexPath: r } = at(a, pt(e, "index")), i = fe(`subMenu:${u.value.uid}`);
659
- i || pe(xe, "can not inject sub menu");
658
+ i || pe(he, "can not inject sub menu");
660
659
  const s = O(() => e.index === o.activeIndex), d = Qe({
661
660
  index: e.index,
662
661
  indexPath: r,
@@ -1327,10 +1326,10 @@ const Je = (e) => {
1327
1326
  const { key: P, data: T } = Q;
1328
1327
  if (P === "sellBuy") {
1329
1328
  const D = T.filter((L) => L.time === C.axisValue);
1330
- let h = 0, y = 0;
1329
+ let x = 0, y = 0;
1331
1330
  D.forEach((L) => {
1332
- L.tradeType === "开多" || L.tradeType === "平空" ? h += L.amount : y += L.amount;
1333
- }), h && (A += `<div>买: ${h}</div>`), y && (A += `<div>卖: ${y}</div>`);
1331
+ L.tradeType === "开多" || L.tradeType === "平空" ? x += L.amount : y += L.amount;
1332
+ }), x && (A += `<div>买: ${x}</div>`), y && (A += `<div>卖: ${y}</div>`);
1334
1333
  }
1335
1334
  P === "openClose" && T.forEach((D) => {
1336
1335
  D.time === C.axisValue && (A += D.tooltip);
@@ -1523,7 +1522,7 @@ const Je = (e) => {
1523
1522
  };
1524
1523
  return [...z, Nn(P)];
1525
1524
  }, d)), k.length > 0 && (d = k.reduce((z, p) => {
1526
- const { value: f, text: A, profitValue: C, profitText: Q, lossValue: P, lossText: T, info: D, config: h } = p;
1525
+ const { value: f, text: A, profitValue: C, profitText: Q, lossValue: P, lossText: T, info: D, config: x } = p;
1527
1526
  if (f > N || f < M)
1528
1527
  return z;
1529
1528
  const y = {
@@ -1533,7 +1532,7 @@ const Je = (e) => {
1533
1532
  profitText: Q,
1534
1533
  lossY: a.convertToPixel({ yAxisIndex: 0 }, P),
1535
1534
  lossText: T,
1536
- info: { info: D, config: { ...i, ...h }, event: { ...B } },
1535
+ info: { info: D, config: { ...i, ...x }, event: { ...B } },
1537
1536
  gridLeft: o,
1538
1537
  gridRight: t,
1539
1538
  echartsWidth: a.getWidth(),
@@ -1548,7 +1547,7 @@ const Je = (e) => {
1548
1547
  p.forEach((y) => {
1549
1548
  f[y[1]] ? f[y[1]] += 1 : f[y[1]] = 1;
1550
1549
  });
1551
- const A = p[p.length - 1][1], C = p.reduce((y, L) => y + L[1], 0) / p.length, Q = A - C, P = Tn(p, 1, 50), T = In(p), D = T ? Q / T : 0, h = fn(p, 1, A);
1550
+ const A = p[p.length - 1][1], C = p.reduce((y, L) => y + L[1], 0) / p.length, Q = A - C, P = Tn(p, 1, 50), T = In(p), D = T ? Q / T : 0, x = fn(p, 1, A);
1552
1551
  d = [
1553
1552
  ...d,
1554
1553
  {
@@ -1580,7 +1579,7 @@ const Je = (e) => {
1580
1579
  )}    中值: ${$(P)}    标准差: ${$(
1581
1580
  T
1582
1581
  )}    距均值/标准差: ${$(D)}    百分位: ${$(
1583
- h
1582
+ x
1584
1583
  )}%`,
1585
1584
  lineWidth: 1,
1586
1585
  opacity: 1
@@ -1735,8 +1734,8 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1735
1734
  }, o = O(() => ({ ...a, ...n.config })), t = S(null), l = S(-1), u = O(() => {
1736
1735
  var y, L;
1737
1736
  if (t.value && ((L = (y = t.value.dataset[0]) == null ? void 0 : y.source) != null && L.klineData[l.value])) {
1738
- const m = t.value.dataset[0].source.klineData[l.value], j = [], { open: x, heigh: E, low: Y, close: w, business: F, riseAndFall: V } = o.value.tipsConfig;
1739
- if (x && j.push({ label: "开", value: $(m[0]), color: "rgb(153, 153, 153)" }), E && j.push({ label: "高", value: $(m[3]), color: "rgb(153, 153, 153)" }), Y && j.push({ label: "低", value: $(m[2]), color: "rgb(153, 153, 153)" }), w && j.push({ label: "收", value: $(m[1]), color: "rgb(153, 153, 153)" }), F && j.push({ label: "额", value: cn(m[4]), color: "rgb(153, 153, 153)" }), V) {
1737
+ const m = t.value.dataset[0].source.klineData[l.value], j = [], { open: h, heigh: E, low: Y, close: w, business: F, riseAndFall: V } = o.value.tipsConfig;
1738
+ if (h && j.push({ label: "开", value: $(m[0]), color: "rgb(153, 153, 153)" }), E && j.push({ label: "高", value: $(m[3]), color: "rgb(153, 153, 153)" }), Y && j.push({ label: "低", value: $(m[2]), color: "rgb(153, 153, 153)" }), w && j.push({ label: "收", value: $(m[1]), color: "rgb(153, 153, 153)" }), F && j.push({ label: "额", value: cn(m[4]), color: "rgb(153, 153, 153)" }), V) {
1740
1739
  let W = ((m[1] - m[5]) / m[1] * 100).toFixed(2), Z = +W == 0 ? "white" : +W > 0 ? "red" : "#00ff00";
1741
1740
  j.push({ label: "涨跌", value: `${W}%`, color: Z });
1742
1741
  }
@@ -1776,12 +1775,12 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1776
1775
  }
1777
1776
  if (n.priceTrendPercentData.length > 0) {
1778
1777
  const L = [];
1779
- return c.getOption().series.filter((j) => j.name.includes("二腿价格走势百分比图")).forEach((j, x) => {
1778
+ return c.getOption().series.filter((j) => j.name.includes("二腿价格走势百分比图")).forEach((j, h) => {
1780
1779
  var Y;
1781
1780
  (j.data[l.value] ? $(j.data[l.value][1]) : null) !== null && L.push({
1782
1781
  label: j.name.split("-")[1],
1783
1782
  value: `${$((Y = j.data[l.value]) == null ? void 0 : Y[1])}%`,
1784
- color: y[x]
1783
+ color: y[h]
1785
1784
  });
1786
1785
  }), L;
1787
1786
  }
@@ -1845,16 +1844,16 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1845
1844
  o.value,
1846
1845
  n.netPositionData,
1847
1846
  n.relevanceData
1848
- ), { graphic: x } = c.getOption() ?? { graphic: [] };
1849
- t.value = { ...j, graphic: x }, c.setOption(t.value, !0), se("st-kline组件消息:K线绘制完毕-draw", { color: "green" });
1847
+ ), { graphic: h } = c.getOption() ?? { graphic: [] };
1848
+ t.value = { ...j, graphic: h }, c.setOption(t.value, !0), se("st-kline组件消息:K线绘制完毕-draw", { color: "green" });
1850
1849
  }
1851
1850
  ],
1852
1851
  // line-额外线条绘制
1853
1852
  [
1854
1853
  "line",
1855
1854
  () => {
1856
- const j = c.getOption(), x = pn(n.lineData, o.value, c);
1857
- t.value = { ...j, graphic: x }, c.setOption(t.value, {
1855
+ const j = c.getOption(), h = pn(n.lineData, o.value, c);
1856
+ t.value = { ...j, graphic: h }, c.setOption(t.value, {
1858
1857
  replaceMerge: ["graphic"]
1859
1858
  }), se("st-kline组件消息:额外画线绘制完毕-draw", { color: "green" });
1860
1859
  }
@@ -1887,17 +1886,17 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1887
1886
  [
1888
1887
  "history",
1889
1888
  async () => {
1890
- const j = c.getOption(), x = await we(
1889
+ const j = c.getOption(), h = await we(
1891
1890
  n.klineData,
1892
1891
  n.markData,
1893
1892
  n.indicator,
1894
1893
  o.value,
1895
1894
  n.netPositionData,
1896
1895
  n.relevanceData
1897
- ), E = x.dataset.source.klineData.length - j.dataset[0].source.klineData.length;
1896
+ ), E = h.dataset.source.klineData.length - j.dataset[0].source.klineData.length;
1898
1897
  c.setOption(
1899
1898
  {
1900
- ...x,
1899
+ ...h,
1901
1900
  dataZoom: [
1902
1901
  {
1903
1902
  type: "inside",
@@ -1917,7 +1916,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1917
1916
  [
1918
1917
  "future",
1919
1918
  async () => {
1920
- const j = c.getOption(), x = await we(
1919
+ const j = c.getOption(), h = await we(
1921
1920
  n.klineData,
1922
1921
  n.markData,
1923
1922
  n.indicator,
@@ -1925,7 +1924,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1925
1924
  n.netPositionData,
1926
1925
  n.relevanceData
1927
1926
  );
1928
- x.dataZoom[0].start = (n.klineData.length - j.dataZoom[0].endValue + j.dataZoom[0].startValue) / n.klineData.length * 100, c.setOption(x, !0), await s("priceTrend");
1927
+ h.dataZoom[0].start = (n.klineData.length - j.dataZoom[0].endValue + j.dataZoom[0].startValue) / n.klineData.length * 100, c.setOption(h, !0), await s("priceTrend");
1929
1928
  }
1930
1929
  ],
1931
1930
  // priceTrend-二腿价格趋势绘制
@@ -1934,7 +1933,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1934
1933
  () => {
1935
1934
  if (n.priceTrendData.length === 0)
1936
1935
  return;
1937
- const j = c.getOption(), x = [
1936
+ const j = c.getOption(), h = [
1938
1937
  "#FFFFFF",
1939
1938
  "#FFDD00",
1940
1939
  "#FF00FF",
@@ -1954,7 +1953,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1954
1953
  yAxisIndex: 1,
1955
1954
  connectNulls: !0,
1956
1955
  itemStyle: {
1957
- color: x[F]
1956
+ color: h[F]
1958
1957
  },
1959
1958
  lineStyle: {
1960
1959
  type: "dashed",
@@ -1975,7 +1974,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1975
1974
  async () => {
1976
1975
  if (n.priceTrendPercentData.length === 0)
1977
1976
  return;
1978
- const j = c.getOption(), x = [
1977
+ const j = c.getOption(), h = [
1979
1978
  "#FFFFFF",
1980
1979
  "#FFDD00",
1981
1980
  "#FF00FF",
@@ -1995,7 +1994,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1995
1994
  yAxisIndex: 1,
1996
1995
  connectNulls: !0,
1997
1996
  itemStyle: {
1998
- color: x[V]
1997
+ color: h[V]
1999
1998
  },
2000
1999
  lineStyle: {
2001
2000
  type: "dashed",
@@ -2022,8 +2021,8 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2022
2021
  if (y)
2023
2022
  l.value = typeof ((m = y == null ? void 0 : y.batch[0]) == null ? void 0 : m.dataIndex) == "number" ? (j = y == null ? void 0 : y.batch[0]) == null ? void 0 : j.dataIndex : -1;
2024
2023
  else {
2025
- const x = L.getOption();
2026
- x.dataZoom instanceof Array && (l.value = x.dataZoom[0].endValue);
2024
+ const h = L.getOption();
2025
+ h.dataZoom instanceof Array && (l.value = h.dataZoom[0].endValue);
2027
2026
  }
2028
2027
  };
2029
2028
  let k = null, B = !1, z = S(!1), p = !1, f = S(!1);
@@ -2061,7 +2060,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2061
2060
  if (!c || !(y.ctrlKey || n.isSelect))
2062
2061
  return;
2063
2062
  const L = c.getOption();
2064
- let { startValue: m, endValue: j, start: x, end: E } = L.dataZoom[0];
2063
+ let { startValue: m, endValue: j, start: h, end: E } = L.dataZoom[0];
2065
2064
  const Y = () => {
2066
2065
  m !== 0 && (m = m - 1, j = j - 1, c.dispatchAction({
2067
2066
  type: "dataZoom",
@@ -2100,9 +2099,9 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2100
2099
  maxValueSpan: o.value.maxValueSpan
2101
2100
  });
2102
2101
  }, V = () => {
2103
- x = x - (E - x) / 4, c.dispatchAction({
2102
+ h = h - (E - h) / 4, c.dispatchAction({
2104
2103
  type: "dataZoom",
2105
- start: x,
2104
+ start: h,
2106
2105
  end: E,
2107
2106
  actionIsWheel: !0,
2108
2107
  // 标记为缩放
@@ -2115,7 +2114,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2115
2114
  ["ArrowDown", V]
2116
2115
  ])).get(y.code);
2117
2116
  Z instanceof Function && Z();
2118
- }, h = async () => {
2117
+ }, x = async () => {
2119
2118
  let y = !0;
2120
2119
  c = Te.init(I.value), await s(), g.value = n.defaultMenuData, l.value = c.getOption().dataZoom[0].endValue ?? -1, P(), v = new ResizeObserver(() => {
2121
2120
  if (y) {
@@ -2126,7 +2125,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2126
2125
  }), v.observe(I.value), window.addEventListener("keydown", D);
2127
2126
  };
2128
2127
  return le(() => {
2129
- h();
2128
+ x();
2130
2129
  }), Re(() => {
2131
2130
  T(), window.removeEventListener("keydown", D), c.dispose(), v.disconnect(), v = null;
2132
2131
  }), (y, L) => {
@@ -2144,14 +2143,14 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2144
2143
  popover: ee(() => [
2145
2144
  K(j, { class: "menu" }, {
2146
2145
  default: ee(() => [
2147
- (_(!0), R(ne, null, De(g.value, (x) => (_(), ue(m, {
2148
- key: x.label,
2149
- index: x.label,
2146
+ (_(!0), R(ne, null, De(g.value, (h) => (_(), ue(m, {
2147
+ key: h.label,
2148
+ index: h.label,
2150
2149
  class: "menuItem",
2151
- onClick: (E) => M(x)
2150
+ onClick: (E) => M(h)
2152
2151
  }, {
2153
2152
  default: ee(() => [
2154
- tt(ie(x.label), 1)
2153
+ tt(ie(h.label), 1)
2155
2154
  ]),
2156
2155
  _: 2
2157
2156
  }, 1032, ["index", "onClick"]))), 128))
@@ -2172,7 +2171,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2172
2171
  };
2173
2172
  }
2174
2173
  });
2175
- const hn = /* @__PURE__ */ oe(vn, [["__scopeId", "data-v-7f014d0e"]]), xn = { class: "kline-tips" }, An = /* @__PURE__ */ G({
2174
+ const xn = /* @__PURE__ */ oe(vn, [["__scopeId", "data-v-7f014d0e"]]), hn = { class: "kline-tips" }, An = /* @__PURE__ */ G({
2176
2175
  __name: "index",
2177
2176
  props: {
2178
2177
  // 提示数据
@@ -2182,7 +2181,7 @@ const hn = /* @__PURE__ */ oe(vn, [["__scopeId", "data-v-7f014d0e"]]), xn = { cl
2182
2181
  }
2183
2182
  },
2184
2183
  setup(e) {
2185
- return (n, a) => (_(), R("div", xn, [
2184
+ return (n, a) => (_(), R("div", hn, [
2186
2185
  (_(!0), R(ne, null, De(e.data, (o, t) => (_(), R("div", {
2187
2186
  key: t,
2188
2187
  class: "kline-tips-item",
@@ -2622,11 +2621,11 @@ const Fn = {
2622
2621
  ref: i
2623
2622
  }, null, 512));
2624
2623
  }
2625
- }, Qn = /* @__PURE__ */ oe(Fn, [["__scopeId", "data-v-7a2f3dd0"]]), lo = {
2624
+ }, Qn = /* @__PURE__ */ oe(Fn, [["__scopeId", "data-v-7a2f3dd0"]]), io = {
2626
2625
  install(e) {
2627
- e.component("st-kline", hn), e.component("st-kline-sub-new", On), e.component("st-kline-tips-new", Sn), e.component("st-kline-slide-new", Qn), e.component("st-kline-utils-new", _n);
2626
+ e.component("st-kline", xn), e.component("st-kline-sub-new", On), e.component("st-kline-tips-new", Sn), e.component("st-kline-slide-new", Qn), e.component("st-kline-utils-new", _n);
2628
2627
  }
2629
2628
  };
2630
2629
  export {
2631
- lo as default
2630
+ io as default
2632
2631
  };
package/es/KlineNew.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const t=require("vue"),B=require("./index.esm-94a95a2a.cjs"),E=require("./_plugin-vue_export-helper-f246444f.cjs"),z=require("./bundle.umd-c5698c50.cjs");require("./base-315cbfab.cjs");require("./el-input-a8791103.cjs");require("./el-tag-a6a4d4ef.cjs");const R=require("./el-select-64511731.cjs");require("./el-scrollbar-9473fd47.cjs");const M=require("echarts");require("./_commonjsHelpers-87b0abe8.cjs");require("./use-form-item-7924b6c1.cjs");require("./typescript-b63f8e83.cjs");require("./focus-trap-ea177336.cjs");require("./scroll-a80e1458.cjs");function N(m){const v=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const A in m)if(A!=="default"){const h=Object.getOwnPropertyDescriptor(m,A);Object.defineProperty(v,A,h.get?h:{enumerable:!0,get:()=>m[A]})}}return v.default=m,Object.freeze(v)}const L=N(M),$=t.defineComponent({__name:"index",setup(m,{expose:v}){let A=!1,h=!0,y=[];const S=(f,u)=>f.length>u?f.slice(f.length-u):f;return v({initTalib:async()=>{if(!A)A=!0,await B.init("./talib.wasm"),h=!1,y.forEach(f=>{f()});else if(h)return new Promise(f=>{y.push(f)})},handleKeyDown:(f,u)=>{let{startValue:o,endValue:d,maxIndex:x}=u;if(f.code==="ArrowLeft"){if(o===0)return;o=o-1,d=d-1}else if(f.code==="ArrowRight"){if(d===x)return;o=o+1,d=d+1}else if(f.code==="ArrowUp"){if(d-o<5)return;const p=Math.floor((d-o)/2)+1;o=o+p,d-o<5&&(o=d-4)}else if(f.code==="ArrowDown"){const p=Math.min(500,d-o);o=o-p-1}return{startValue:o,endValue:d}},getDataZoomInfoByTime:f=>{const{showStartTime:u,showEndTime:o,xAxisData:d,maxShowDays:x}=f;let p=-1,e=-1,i={};return d.forEach((a,l)=>{const r=a.split(" ")[0];i[r]=i[r]||0,i[r]+=1,new Date(a)>=new Date(u)&&p===-1&&(p=l),new Date(a)<=new Date(o)&&(e=l)}),{startValue:p,endValue:e,maxValueSpan:Math.max(...Object.values(i))*x}},formatDataBySlide:f=>{const{originDrawData:u,addData:o,startTime:d,endTime:x}=f,{mainIndicator:p,mainIndicatorList:e,subIndicator:i,subIndicatorList:a,config:l,timeRange:r}=f,{loadAddCount:D,preLoadCount:F}=l;let _=[],b=[],V=[],w=[];d&&x?(_=o.filter(s=>new Date(s[0])>=new Date(d)&&new Date(s[0])<=new Date(x)),w=[...o]):x?(_=[...o.filter((s,n)=>n>=o.length-D&&new Date(r[0])<=new Date(s[0])&&new Date(s[0])<=new Date(r[1])),...u.originData],w=[...o,...u.originData]):d&&(_=[...u.originData,...o.filter((s,n)=>n>=F&&new Date(r[0])<=new Date(s[0])&&new Date(s[0])<=new Date(r[1]))],w=_),_.forEach((s,n)=>{b.push([s[1],s[4],s[3],s[2],n===0?0:_[n-1][4],s[6]]),V.push(s[0])});let c=[],g=[];const I={time:[],open:[],close:[],high:[],low:[],originData:w};let C=null,q=null;return w.forEach((s,n)=>{I.time.push(s[0]),I.open.push(s[1]),I.close.push(s[4]),I.high.push(s[2]),I.low.push(s[3]),s[0]===_[0][0]&&(C=n),s[0]===_[_.length-1][0]&&(q=n+1)}),c=e.find(({value:s})=>s===p).config.map(s=>{const{calculationFn:n}=s,k={time:[],open:[],close:[],high:[],low:[],originData:[]};return{...s,data:n?n(B.talib,I,k).slice(C,q):[]}}),g=a.find(({value:s})=>s===i).config.reduce((s,n)=>{const{source:k,calculationFn:T}=n;return k==="calculation"?[...s,{...n,data:T?T(B.talib,I).slice(C,q):[]}]:s},[]),{originData:_,candlestickData:b,mainIndicatorData:c,subIndicatorData:g,xAxisData:V,startTime:_[0][0],endTime:_[_.length-1][0],length:_.length}},formatDataByCount:f=>{const{originDrawData:u,addData:o,mainIndicator:d,mainIndicatorList:x,subIndicator:p,subIndicatorList:e,config:i}=f;let a={};const{addCount:l,preLoadCount:r}=i,D=[],F=[],_=[],b=[],V=[];let w=[],c=[];const g=o.filter((n,k)=>(D.push(n[0]),F.push(n[1]),_.push(n[4]),b.push(n[2]),V.push(n[3]),w.push(n[0]),c.push([n[1],n[4],n[3],n[2],k===0?0:o[k-1][4],n[6]]),o.length>=l+r-1?k>=r:!0));w=S(w,g.length),c=S(c,g.length);const I={time:D,open:F,close:_,high:b,low:V,originData:o},q=x.find(n=>n.value===d).config.map(n=>({...n,data:S(n.calculationFn?n.calculationFn(B.talib,I,{time:[],open:[],close:[],high:[],low:[],originData:[]}):[],w.length)}));let s=[];return p&&e&&(s=e.find(k=>k.value===p).config.reduce((k,T)=>T.source==="calculation"?[...k,{...T,data:S(T.calculationFn?T.calculationFn(B.talib,I):[],w.length)}]:k,[])),u.length?a={originData:[...g,...u.originData],xAxisData:[...w,...u.xAxisData],candlestickData:[...c,...u.candlestickData],mainIndicatorData:u.mainIndicatorData.map((n,k)=>({...n,data:[...q[k].data,...n.data]})),subIndicatorData:u.subIndicatorData.map((n,k)=>({...n,data:[...s[k].data,...n.data]}))}:a={originData:g,xAxisData:w,candlestickData:c,mainIndicatorData:q,subIndicatorData:s},a.length=a.xAxisData.length,a.startTime=a.xAxisData[0],a.endTime=a.xAxisData[a.length-1],a},fn:()=>{}}),(f,u)=>null}}),j={class:"kline-tips"},P=t.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(m){return(v,A)=>(t.openBlock(),t.createElementBlock("div",j,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.data,(h,y)=>(t.openBlock(),t.createElementBlock("div",{key:y,class:"kline-tips-item",style:t.normalizeStyle({color:h.color})},t.toDisplayString(h.label)+" "+t.toDisplayString(h.value),5))),128))]))}});const O=E._export_sfc(P,[["__scopeId","data-v-2a02e841"]]),K={class:"kline-tips"},U=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},activeIndex:{type:Number,require:!0}},setup(m){const{round:v,multiply:A,divide:h,subtract:y,formatValue:S}=z.bundle_umdExports.stMath,f=m,u=t.computed(()=>{const{drawData:d,activeIndex:x}=f;if(d.candlestickData&&d.candlestickData[x]){const p=d.candlestickData[x],e=[{label:"开",value:v(p[0])},{label:"高",value:v(p[3])},{label:"低",value:v(p[2])},{label:"收",value:v(p[1])}];p[5]!==void 0&&e.push({label:"额",value:S(p[5])});const i=v(A(h(y(p[1],p[4]),Math.abs(p[4])),100));let a;return i>0?a="red":i<0&&(a="green"),e.push({label:"涨跌",value:`${i}%`,color:a}),e}return[]}),o=t.computed(()=>{var p;const{drawData:d,activeIndex:x}=f;return((p=d==null?void 0:d.mainIndicatorData)==null?void 0:p.map(e=>({label:e.key,value:v(e.data[x]),color:e.color})))||[]});return(d,x)=>(t.openBlock(),t.createElementBlock("div",K,[t.createVNode(O,{data:u.value},null,8,["data"]),t.createVNode(O,{data:o.value},null,8,["data"])]))}});const Z=E._export_sfc(U,[["__scopeId","data-v-a1302914"]]),Y={class:"klineSub"},H={class:"klineSub-tips"},G={key:0,class:"klineSub-tips-select"},J=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},activeIndex:{type:Number,require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0},config:{type:Object,require:!0}},emits:["update:modelValue"],setup(m,{expose:v,emit:A}){const{round:h}=z.bundle_umdExports.stMath;let y,S;const f=A,u=m,o=t.ref(),d=t.computed({get(){return u.modelValue},set(e){f("update:modelValue",e)}}),x=t.computed(()=>{const{drawData:e,activeIndex:i}=u,a=u.subIndicatorList.find(l=>l.value===d.value);return e.originData&&e.originData[i]?a.config.map(l=>{var D,F;let r="-";return l.source==="origin"?r=e.originData[i][l.dataIndex]||"-":l.source==="calculation"&&(r=(((F=(D=e.subIndicatorData)==null?void 0:D.find(b=>b.key===l.key))==null?void 0:F.data)||[])[i]),{label:l.key,color:l.color,value:r==="-"?r:h(r)}}):[]});t.onMounted(()=>{y=L.init(o.value);let e=!0;S=new ResizeObserver(()=>{if(e){e=null;return}y.resize()}),S.observe(o.value)}),t.onUnmounted(()=>{y.dispose(),S.disconnect(),S=null});const p=(e,i)=>{const a=e[i],l=i===0?e[i]:e[i-1];return a[0]===a[1]?a[0]>=l[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:a[1]>a[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return v({connect:e=>{L.connect([e,y])},draw:e=>{t.nextTick(()=>{var w;const{startValue:i,endValue:a,maxValueSpan:l}=e,{xAxisData:r,subIndicatorData:D,candlestickData:F,originData:_}=u.drawData,b=u.subIndicatorList.find(c=>c.value===d.value),V=[];if(b.series==="bar"){let c=[];b.source==="origin"?c=_.map(g=>g[b.dataIndex]):c=((w=D==null?void 0:D.find(g=>g.key===b.dataIndex))==null?void 0:w.data)||[],V.push({name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:c.map((g,I)=>b.color==="kline"?{value:g,itemStyle:p(F,I)}:b.color==="value"?{value:g,itemStyle:{color:g>=0?"#FF0000":"#00FFFF"}}:{value:g,itemStyle:{color:b.color}})})}D.forEach(c=>{if(c.series==="line"){let g=[];c.source==="origin"?g=_.map(I=>I[c.dataIndex]):c.source==="calculation"&&(g=c.data),V.push({xAxisIndex:0,yAxisIndex:c.yAxis==="right"?2:1,name:c.key,type:"line",silent:!0,symbol:"none",data:g,lineStyle:{width:1},itemStyle:{color:c.color}})}}),y.setOption({animation:!1,grid:{left:`${u.config.gridLeft}px`,top:"10px",right:`${u.config.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:i,endValue:a,maxValueSpan:l}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:c=>{const{axisDimension:g,value:I}=c;if(g==="x")return I;if(c.axisIndex===1)return String(h(I))}}},formatter:()=>""},xAxis:{type:"category",data:r,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{show:!0,formatter:c=>c}},yAxis:[{position:"right"},{position:"left",min:b.leftYAxisRange==="cover"?c=>c.min:null,max:b.leftYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:b.rightYAxisRange==="cover"?c=>c.min:null,max:b.rightYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:V},!0)})}}),(e,i)=>{const a=R.ElOption,l=R.ElSelect;return t.openBlock(),t.createElementBlock("div",Y,[t.createElementVNode("div",H,[x.value.length?(t.openBlock(),t.createElementBlock("div",G,[t.createVNode(l,{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=r=>d.value=r),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.subIndicatorList,r=>(t.openBlock(),t.createBlock(a,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):t.createCommentVNode("",!0),t.createVNode(O,{data:x.value},null,8,["data"])]),t.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:o},null,512)])}}});const Q=E._export_sfc(J,[["__scopeId","data-v-2ece79b3"]]),W=t.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]}},emits:["change"],setup(m,{expose:v,emit:A}){let h,y,S=null;const f=A,u=m,o=t.ref();t.watch(()=>u.data,()=>{p()},{deep:!0}),t.onMounted(()=>{h=L.init(o.value),d(),p();let e=!0;y=new ResizeObserver(()=>{if(e){e=null;return}h.resize()}),y.observe(o.value)}),t.onUnmounted(()=>{h.off("datazoom"),h.dispose(),y.disconnect(),y=null});const d=()=>{h.on("datazoom",e=>{e.dataZoomId&&(clearTimeout(S),S=setTimeout(()=>{const{data:i}=u,{start:a,end:l}=e,r=Math.floor(a*i.length/100),D=l===100?i.length-1:Math.floor(l*i.length/100);x(r,D),clearTimeout(S)},100))})},x=(e,i)=>{const a=u.data;if(a.length===0)return;const l=a[e][0].split(" ")[0],r=a[i][0].split(" ")[0];f("change",{startTime:`${l} 00:00:00`,endTime:`${r} 24:00:00`})},p=()=>{const{data:e}=u;if(e.length===0)return;const i=e.map(l=>l[0].split(" ")[0]),a=e.map(l=>l[1]);h.setOption({grid:{height:0,left:"80px",right:"80px"},xAxis:{type:"category",data:i,show:!1},yAxis:{type:"value"},series:[{data:a,type:"line"}]},!0)};return v({resetSlide:(e,i,a)=>{let l=-1,r=-1;u.data.forEach((D,F)=>{l===-1&&D[0]===e?l=F:l===-1&&new Date(D[0])>new Date(e)&&(l=F-1),(r===-1&&D[0]===i||r===-1&&new Date(D[0])>new Date(i))&&(r=F)}),r=r===-1?u.data.length-1:r,h.setOption({dataZoom:[{show:!0,startValue:l,endValue:r,maxValueSpan:a,textStyle:{color:"#ccc"}},{type:"inside",startValue:l,endValue:r,maxValueSpan:a}]})},resize:()=>{h==null||h.resize()}}),(e,i)=>(t.openBlock(),t.createElementBlock("div",{class:"klineSlide",ref_key:"slideChartRef",ref:o},null,512))}});const X=E._export_sfc(W,[["__scopeId","data-v-5008746a"]]),ee={install(m){m.component("st-klineUtils",$),m.component("st-klineSub",Q),m.component("st-klineTips",Z),m.component("st-klineSlide",X)}};module.exports=ee;
1
+ "use strict";const t=require("vue"),B=require("./index.esm-94a95a2a.cjs"),E=require("./_plugin-vue_export-helper-f246444f.cjs"),z=require("./bundle.umd-c5698c50.cjs");require("./base-b187e78f.cjs");const R=require("./el-select-eaa79c54.cjs");require("./el-tag-5a8b728a.cjs");require("./el-scrollbar-586be9bd.cjs");const M=require("echarts");require("./_commonjsHelpers-87b0abe8.cjs");require("./use-form-item-c25c7251.cjs");require("./typescript-b63f8e83.cjs");require("./focus-trap-ea1e7a19.cjs");require("./scroll-38e17abc.cjs");function N(m){const v=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const A in m)if(A!=="default"){const h=Object.getOwnPropertyDescriptor(m,A);Object.defineProperty(v,A,h.get?h:{enumerable:!0,get:()=>m[A]})}}return v.default=m,Object.freeze(v)}const L=N(M),$=t.defineComponent({__name:"index",setup(m,{expose:v}){let A=!1,h=!0,y=[];const S=(f,u)=>f.length>u?f.slice(f.length-u):f;return v({initTalib:async()=>{if(!A)A=!0,await B.init("./talib.wasm"),h=!1,y.forEach(f=>{f()});else if(h)return new Promise(f=>{y.push(f)})},handleKeyDown:(f,u)=>{let{startValue:o,endValue:d,maxIndex:x}=u;if(f.code==="ArrowLeft"){if(o===0)return;o=o-1,d=d-1}else if(f.code==="ArrowRight"){if(d===x)return;o=o+1,d=d+1}else if(f.code==="ArrowUp"){if(d-o<5)return;const p=Math.floor((d-o)/2)+1;o=o+p,d-o<5&&(o=d-4)}else if(f.code==="ArrowDown"){const p=Math.min(500,d-o);o=o-p-1}return{startValue:o,endValue:d}},getDataZoomInfoByTime:f=>{const{showStartTime:u,showEndTime:o,xAxisData:d,maxShowDays:x}=f;let p=-1,e=-1,i={};return d.forEach((a,l)=>{const r=a.split(" ")[0];i[r]=i[r]||0,i[r]+=1,new Date(a)>=new Date(u)&&p===-1&&(p=l),new Date(a)<=new Date(o)&&(e=l)}),{startValue:p,endValue:e,maxValueSpan:Math.max(...Object.values(i))*x}},formatDataBySlide:f=>{const{originDrawData:u,addData:o,startTime:d,endTime:x}=f,{mainIndicator:p,mainIndicatorList:e,subIndicator:i,subIndicatorList:a,config:l,timeRange:r}=f,{loadAddCount:D,preLoadCount:F}=l;let _=[],b=[],V=[],w=[];d&&x?(_=o.filter(s=>new Date(s[0])>=new Date(d)&&new Date(s[0])<=new Date(x)),w=[...o]):x?(_=[...o.filter((s,n)=>n>=o.length-D&&new Date(r[0])<=new Date(s[0])&&new Date(s[0])<=new Date(r[1])),...u.originData],w=[...o,...u.originData]):d&&(_=[...u.originData,...o.filter((s,n)=>n>=F&&new Date(r[0])<=new Date(s[0])&&new Date(s[0])<=new Date(r[1]))],w=_),_.forEach((s,n)=>{b.push([s[1],s[4],s[3],s[2],n===0?0:_[n-1][4],s[6]]),V.push(s[0])});let c=[],g=[];const I={time:[],open:[],close:[],high:[],low:[],originData:w};let C=null,q=null;return w.forEach((s,n)=>{I.time.push(s[0]),I.open.push(s[1]),I.close.push(s[4]),I.high.push(s[2]),I.low.push(s[3]),s[0]===_[0][0]&&(C=n),s[0]===_[_.length-1][0]&&(q=n+1)}),c=e.find(({value:s})=>s===p).config.map(s=>{const{calculationFn:n}=s,k={time:[],open:[],close:[],high:[],low:[],originData:[]};return{...s,data:n?n(B.talib,I,k).slice(C,q):[]}}),g=a.find(({value:s})=>s===i).config.reduce((s,n)=>{const{source:k,calculationFn:T}=n;return k==="calculation"?[...s,{...n,data:T?T(B.talib,I).slice(C,q):[]}]:s},[]),{originData:_,candlestickData:b,mainIndicatorData:c,subIndicatorData:g,xAxisData:V,startTime:_[0][0],endTime:_[_.length-1][0],length:_.length}},formatDataByCount:f=>{const{originDrawData:u,addData:o,mainIndicator:d,mainIndicatorList:x,subIndicator:p,subIndicatorList:e,config:i}=f;let a={};const{addCount:l,preLoadCount:r}=i,D=[],F=[],_=[],b=[],V=[];let w=[],c=[];const g=o.filter((n,k)=>(D.push(n[0]),F.push(n[1]),_.push(n[4]),b.push(n[2]),V.push(n[3]),w.push(n[0]),c.push([n[1],n[4],n[3],n[2],k===0?0:o[k-1][4],n[6]]),o.length>=l+r-1?k>=r:!0));w=S(w,g.length),c=S(c,g.length);const I={time:D,open:F,close:_,high:b,low:V,originData:o},q=x.find(n=>n.value===d).config.map(n=>({...n,data:S(n.calculationFn?n.calculationFn(B.talib,I,{time:[],open:[],close:[],high:[],low:[],originData:[]}):[],w.length)}));let s=[];return p&&e&&(s=e.find(k=>k.value===p).config.reduce((k,T)=>T.source==="calculation"?[...k,{...T,data:S(T.calculationFn?T.calculationFn(B.talib,I):[],w.length)}]:k,[])),u.length?a={originData:[...g,...u.originData],xAxisData:[...w,...u.xAxisData],candlestickData:[...c,...u.candlestickData],mainIndicatorData:u.mainIndicatorData.map((n,k)=>({...n,data:[...q[k].data,...n.data]})),subIndicatorData:u.subIndicatorData.map((n,k)=>({...n,data:[...s[k].data,...n.data]}))}:a={originData:g,xAxisData:w,candlestickData:c,mainIndicatorData:q,subIndicatorData:s},a.length=a.xAxisData.length,a.startTime=a.xAxisData[0],a.endTime=a.xAxisData[a.length-1],a},fn:()=>{}}),(f,u)=>null}}),j={class:"kline-tips"},P=t.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(m){return(v,A)=>(t.openBlock(),t.createElementBlock("div",j,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.data,(h,y)=>(t.openBlock(),t.createElementBlock("div",{key:y,class:"kline-tips-item",style:t.normalizeStyle({color:h.color})},t.toDisplayString(h.label)+" "+t.toDisplayString(h.value),5))),128))]))}});const O=E._export_sfc(P,[["__scopeId","data-v-2a02e841"]]),K={class:"kline-tips"},U=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},activeIndex:{type:Number,require:!0}},setup(m){const{round:v,multiply:A,divide:h,subtract:y,formatValue:S}=z.bundle_umdExports.stMath,f=m,u=t.computed(()=>{const{drawData:d,activeIndex:x}=f;if(d.candlestickData&&d.candlestickData[x]){const p=d.candlestickData[x],e=[{label:"开",value:v(p[0])},{label:"高",value:v(p[3])},{label:"低",value:v(p[2])},{label:"收",value:v(p[1])}];p[5]!==void 0&&e.push({label:"额",value:S(p[5])});const i=v(A(h(y(p[1],p[4]),Math.abs(p[4])),100));let a;return i>0?a="red":i<0&&(a="green"),e.push({label:"涨跌",value:`${i}%`,color:a}),e}return[]}),o=t.computed(()=>{var p;const{drawData:d,activeIndex:x}=f;return((p=d==null?void 0:d.mainIndicatorData)==null?void 0:p.map(e=>({label:e.key,value:v(e.data[x]),color:e.color})))||[]});return(d,x)=>(t.openBlock(),t.createElementBlock("div",K,[t.createVNode(O,{data:u.value},null,8,["data"]),t.createVNode(O,{data:o.value},null,8,["data"])]))}});const Z=E._export_sfc(U,[["__scopeId","data-v-a1302914"]]),Y={class:"klineSub"},H={class:"klineSub-tips"},G={key:0,class:"klineSub-tips-select"},J=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},activeIndex:{type:Number,require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0},config:{type:Object,require:!0}},emits:["update:modelValue"],setup(m,{expose:v,emit:A}){const{round:h}=z.bundle_umdExports.stMath;let y,S;const f=A,u=m,o=t.ref(),d=t.computed({get(){return u.modelValue},set(e){f("update:modelValue",e)}}),x=t.computed(()=>{const{drawData:e,activeIndex:i}=u,a=u.subIndicatorList.find(l=>l.value===d.value);return e.originData&&e.originData[i]?a.config.map(l=>{var D,F;let r="-";return l.source==="origin"?r=e.originData[i][l.dataIndex]||"-":l.source==="calculation"&&(r=(((F=(D=e.subIndicatorData)==null?void 0:D.find(b=>b.key===l.key))==null?void 0:F.data)||[])[i]),{label:l.key,color:l.color,value:r==="-"?r:h(r)}}):[]});t.onMounted(()=>{y=L.init(o.value);let e=!0;S=new ResizeObserver(()=>{if(e){e=null;return}y.resize()}),S.observe(o.value)}),t.onUnmounted(()=>{y.dispose(),S.disconnect(),S=null});const p=(e,i)=>{const a=e[i],l=i===0?e[i]:e[i-1];return a[0]===a[1]?a[0]>=l[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:a[1]>a[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return v({connect:e=>{L.connect([e,y])},draw:e=>{t.nextTick(()=>{var w;const{startValue:i,endValue:a,maxValueSpan:l}=e,{xAxisData:r,subIndicatorData:D,candlestickData:F,originData:_}=u.drawData,b=u.subIndicatorList.find(c=>c.value===d.value),V=[];if(b.series==="bar"){let c=[];b.source==="origin"?c=_.map(g=>g[b.dataIndex]):c=((w=D==null?void 0:D.find(g=>g.key===b.dataIndex))==null?void 0:w.data)||[],V.push({name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:c.map((g,I)=>b.color==="kline"?{value:g,itemStyle:p(F,I)}:b.color==="value"?{value:g,itemStyle:{color:g>=0?"#FF0000":"#00FFFF"}}:{value:g,itemStyle:{color:b.color}})})}D.forEach(c=>{if(c.series==="line"){let g=[];c.source==="origin"?g=_.map(I=>I[c.dataIndex]):c.source==="calculation"&&(g=c.data),V.push({xAxisIndex:0,yAxisIndex:c.yAxis==="right"?2:1,name:c.key,type:"line",silent:!0,symbol:"none",data:g,lineStyle:{width:1},itemStyle:{color:c.color}})}}),y.setOption({animation:!1,grid:{left:`${u.config.gridLeft}px`,top:"10px",right:`${u.config.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:i,endValue:a,maxValueSpan:l}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:c=>{const{axisDimension:g,value:I}=c;if(g==="x")return I;if(c.axisIndex===1)return String(h(I))}}},formatter:()=>""},xAxis:{type:"category",data:r,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{show:!0,formatter:c=>c}},yAxis:[{position:"right"},{position:"left",min:b.leftYAxisRange==="cover"?c=>c.min:null,max:b.leftYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:b.rightYAxisRange==="cover"?c=>c.min:null,max:b.rightYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:V},!0)})}}),(e,i)=>{const a=R.ElOption,l=R.ElSelect;return t.openBlock(),t.createElementBlock("div",Y,[t.createElementVNode("div",H,[x.value.length?(t.openBlock(),t.createElementBlock("div",G,[t.createVNode(l,{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=r=>d.value=r),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.subIndicatorList,r=>(t.openBlock(),t.createBlock(a,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):t.createCommentVNode("",!0),t.createVNode(O,{data:x.value},null,8,["data"])]),t.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:o},null,512)])}}});const Q=E._export_sfc(J,[["__scopeId","data-v-2ece79b3"]]),W=t.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]}},emits:["change"],setup(m,{expose:v,emit:A}){let h,y,S=null;const f=A,u=m,o=t.ref();t.watch(()=>u.data,()=>{p()},{deep:!0}),t.onMounted(()=>{h=L.init(o.value),d(),p();let e=!0;y=new ResizeObserver(()=>{if(e){e=null;return}h.resize()}),y.observe(o.value)}),t.onUnmounted(()=>{h.off("datazoom"),h.dispose(),y.disconnect(),y=null});const d=()=>{h.on("datazoom",e=>{e.dataZoomId&&(clearTimeout(S),S=setTimeout(()=>{const{data:i}=u,{start:a,end:l}=e,r=Math.floor(a*i.length/100),D=l===100?i.length-1:Math.floor(l*i.length/100);x(r,D),clearTimeout(S)},100))})},x=(e,i)=>{const a=u.data;if(a.length===0)return;const l=a[e][0].split(" ")[0],r=a[i][0].split(" ")[0];f("change",{startTime:`${l} 00:00:00`,endTime:`${r} 24:00:00`})},p=()=>{const{data:e}=u;if(e.length===0)return;const i=e.map(l=>l[0].split(" ")[0]),a=e.map(l=>l[1]);h.setOption({grid:{height:0,left:"80px",right:"80px"},xAxis:{type:"category",data:i,show:!1},yAxis:{type:"value"},series:[{data:a,type:"line"}]},!0)};return v({resetSlide:(e,i,a)=>{let l=-1,r=-1;u.data.forEach((D,F)=>{l===-1&&D[0]===e?l=F:l===-1&&new Date(D[0])>new Date(e)&&(l=F-1),(r===-1&&D[0]===i||r===-1&&new Date(D[0])>new Date(i))&&(r=F)}),r=r===-1?u.data.length-1:r,h.setOption({dataZoom:[{show:!0,startValue:l,endValue:r,maxValueSpan:a,textStyle:{color:"#ccc"}},{type:"inside",startValue:l,endValue:r,maxValueSpan:a}]})},resize:()=>{h==null||h.resize()}}),(e,i)=>(t.openBlock(),t.createElementBlock("div",{class:"klineSlide",ref_key:"slideChartRef",ref:o},null,512))}});const X=E._export_sfc(W,[["__scopeId","data-v-5008746a"]]),ee={install(m){m.component("st-klineUtils",$),m.component("st-klineSub",Q),m.component("st-klineTips",Z),m.component("st-klineSlide",X)}};module.exports=ee;
package/es/KlineNew.js CHANGED
@@ -2,17 +2,16 @@ import { defineComponent as E, openBlock as T, createElementBlock as L, Fragment
2
2
  import { i as te, t as z } from "./index.esm-8d9a2abe.js";
3
3
  import { _ as O } from "./_plugin-vue_export-helper-dad06003.js";
4
4
  import { b as G } from "./bundle.umd-4967d574.js";
5
- import "./base-1bc9f12c.js";
6
- import "./el-input-29806e42.js";
7
- import "./el-tag-9493bdff.js";
8
- import { E as ae, a as ne } from "./el-select-ac302f3c.js";
9
- import "./el-scrollbar-e17fad47.js";
5
+ import "./base-8aa55db5.js";
6
+ import { E as ae, a as ne } from "./el-select-a6cf0236.js";
7
+ import "./el-tag-7549c103.js";
8
+ import "./el-scrollbar-ffb7b9c1.js";
10
9
  import * as q from "echarts";
11
10
  import "./_commonjsHelpers-10dfc225.js";
12
- import "./use-form-item-aeec8499.js";
11
+ import "./use-form-item-bd4b9eeb.js";
13
12
  import "./typescript-7ae59c4c.js";
14
- import "./focus-trap-1b2aef75.js";
15
- import "./scroll-a928a93e.js";
13
+ import "./focus-trap-5fc152a0.js";
14
+ import "./scroll-c6e51ef8.js";
16
15
  const oe = /* @__PURE__ */ E({
17
16
  __name: "index",
18
17
  setup(w, { expose: A }) {
@@ -605,11 +604,11 @@ const he = /* @__PURE__ */ O(fe, [["__scopeId", "data-v-2ece79b3"]]), me = /* @_
605
604
  }, null, 512));
606
605
  }
607
606
  });
608
- const ge = /* @__PURE__ */ O(me, [["__scopeId", "data-v-5008746a"]]), Ve = {
607
+ const ge = /* @__PURE__ */ O(me, [["__scopeId", "data-v-5008746a"]]), Le = {
609
608
  install(w) {
610
609
  w.component("st-klineUtils", oe), w.component("st-klineSub", he), w.component("st-klineTips", ce), w.component("st-klineSlide", ge);
611
610
  }
612
611
  };
613
612
  export {
614
- Ve as default
613
+ Le as default
615
614
  };