st-comp 0.0.93 → 0.0.94

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 (83) hide show
  1. package/components.d.ts +13 -0
  2. package/es/ChartLayout.cjs +1 -1
  3. package/es/ChartLayout.js +2 -2
  4. package/es/Dialog.cjs +1 -5
  5. package/es/Dialog.js +45 -711
  6. package/es/FactorWarning.cjs +1 -1
  7. package/es/FactorWarning.js +463 -1
  8. package/es/Kline.cjs +1 -1
  9. package/es/Kline.js +92 -91
  10. package/es/KlineNew.cjs +1 -1
  11. package/es/KlineNew.js +10 -9
  12. package/es/Pagination.cjs +1 -1
  13. package/es/Pagination.js +106 -104
  14. package/es/Table.cjs +1 -20
  15. package/es/Table.js +361 -4253
  16. package/es/VarietySearch.cjs +1 -1
  17. package/es/VarietySearch.js +2522 -1
  18. package/es/VirtualTable.cjs +3 -3
  19. package/es/VirtualTable.js +249 -254
  20. package/es/base-6e64c2e6.js +762 -0
  21. package/es/base-8776b83e.cjs +9 -0
  22. package/es/castArray-59d5ae43.cjs +1 -0
  23. package/es/castArray-8ec29ca6.js +10 -0
  24. package/es/config-provider-76ef1b35.cjs +1 -0
  25. package/es/config-provider-f4278c8e.js +46 -0
  26. package/es/{el-button-9476b767.js → el-button-4c7ae9df.js} +52 -52
  27. package/es/{el-button-ed961332.cjs → el-button-65e4598f.cjs} +1 -1
  28. package/es/{el-empty-f4c08c01.js → el-empty-05e13b3c.js} +3 -3
  29. package/es/{el-empty-7adcc7f0.cjs → el-empty-dfe11c21.cjs} +1 -1
  30. package/es/el-icon-0ea8fbf8.cjs +1 -0
  31. package/es/el-icon-4ed993c7.js +1 -0
  32. package/es/el-input-11327619.cjs +9 -0
  33. package/es/el-input-f4898cfa.js +544 -0
  34. package/es/el-overlay-9d9c6ba9.cjs +5 -0
  35. package/es/el-overlay-d7af7dda.js +678 -0
  36. package/es/el-popover-4a4a4b02.cjs +1 -0
  37. package/es/el-popover-dc9c7ff7.js +133 -0
  38. package/es/el-radio-group-a31fb7c0.js +1743 -0
  39. package/es/el-radio-group-cc2d6c87.cjs +12 -0
  40. package/es/{el-scrollbar-ffb7b9c1.js → el-scrollbar-a00aca2f.js} +48 -48
  41. package/es/{el-scrollbar-586be9bd.cjs → el-scrollbar-f197b544.cjs} +1 -1
  42. package/es/el-select-5dbb0da3.cjs +1 -0
  43. package/es/el-select-b9cf452e.js +1360 -0
  44. package/es/el-table-column-1e15361e.cjs +20 -0
  45. package/es/el-table-column-675f51e6.js +3795 -0
  46. package/es/el-tag-c9d5baa7.cjs +1 -0
  47. package/es/{el-tag-7549c103.js → el-tag-f878b1f1.js} +126 -119
  48. package/es/{focus-trap-5fc152a0.js → focus-trap-2677bd39.js} +35 -34
  49. package/es/focus-trap-5f42842b.cjs +1 -0
  50. package/es/raf-32ed81f4.js +6 -0
  51. package/es/{raf-c4bba516.cjs → raf-7c366b55.cjs} +1 -1
  52. package/es/{scroll-38e17abc.cjs → scroll-22a00b05.cjs} +1 -1
  53. package/es/{scroll-c6e51ef8.js → scroll-9b9249e9.js} +5 -5
  54. package/es/style.css +1 -1
  55. package/es/use-form-item-67e7ef93.cjs +3 -0
  56. package/es/use-form-item-bfc7dddf.js +669 -0
  57. package/es/use-global-config-89daeba3.js +110 -0
  58. package/es/use-global-config-f9103903.cjs +1 -0
  59. package/es/{vnode-40f9df3c.cjs → vnode-69f3ca85.cjs} +1 -1
  60. package/es/{vnode-f4b846cb.js → vnode-aa3448ec.js} +1 -1
  61. package/es/zh-cn-720e514b.cjs +1 -0
  62. package/es/{zh-cn-e36dfbf4.js → zh-cn-e662dc89.js} +6 -45
  63. package/lib/bundle.js +1 -1
  64. package/lib/bundle.umd.cjs +174 -174
  65. package/lib/{index-4635557b.js → index-5d6aca6c.js} +27787 -27281
  66. package/lib/{python-aa056c80.js → python-dae8be67.js} +1 -1
  67. package/lib/style.css +1 -1
  68. package/package.json +1 -1
  69. package/packages/VarietySearch/components/CommonIndicator/index.vue +270 -112
  70. package/packages/VarietySearch/config.js +12 -1
  71. package/packages/VarietySearch/index.vue +8 -0
  72. package/es/base-8aa55db5.js +0 -725
  73. package/es/base-b187e78f.cjs +0 -9
  74. package/es/el-select-a6cf0236.js +0 -1893
  75. package/es/el-select-eaa79c54.cjs +0 -9
  76. package/es/el-tag-5a8b728a.cjs +0 -1
  77. package/es/focus-trap-ea1e7a19.cjs +0 -1
  78. package/es/raf-3a2b250a.js +0 -6
  79. package/es/use-form-item-bd4b9eeb.js +0 -531
  80. package/es/use-form-item-c25c7251.cjs +0 -3
  81. package/es/use-global-config-2d21cd56.js +0 -110
  82. package/es/use-global-config-bce8cdd8.cjs +0 -1
  83. package/es/zh-cn-a61d484e.cjs +0 -1
package/es/Kline.js CHANGED
@@ -1,20 +1,21 @@
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";
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-6e64c2e6.js";
2
2
  import "./el-tooltip-4ed993c7.js";
3
- import { a as Xe } from "./el-tag-7549c103.js";
3
+ import { E as Xe } from "./el-tag-f878b1f1.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 { 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";
9
+ import { u as mt } from "./el-scrollbar-a00aca2f.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-bfc7dddf.js";
11
+ import { E as J, i as We } from "./focus-trap-2677bd39.js";
12
+ import { T as xt } from "./index-657047bb.js";
13
13
  import { m as At } from "./typescript-7ae59c4c.js";
14
- import { f as Yt } from "./vnode-f4b846cb.js";
15
- import { E as Ct, a as bt } from "./el-select-a6cf0236.js";
14
+ import { f as Yt } from "./vnode-aa3448ec.js";
15
+ import "./el-input-f4898cfa.js";
16
+ import { E as Ct, a as bt } from "./el-select-b9cf452e.js";
16
17
  import "./_commonjsHelpers-10dfc225.js";
17
- import "./scroll-c6e51ef8.js";
18
+ import "./scroll-9b9249e9.js";
18
19
  const je = function(e, n, ...a) {
19
20
  let o;
20
21
  n.includes("mouse") || n.includes("click") ? o = "MouseEvents" : n.includes("key") ? o = "KeyboardEvent" : o = "HTMLEvents";
@@ -204,7 +205,7 @@ function at(e, n) {
204
205
  function Pt(e) {
205
206
  return O(() => {
206
207
  const a = e.backgroundColor;
207
- return a ? new ht(a).shade(20).toString() : "";
208
+ return a ? new xt(a).shade(20).toString() : "";
208
209
  });
209
210
  }
210
211
  const it = (e, n) => {
@@ -305,7 +306,7 @@ var Ue = G({
305
306
  index: e.index,
306
307
  indexPath: t,
307
308
  active: A
308
- }), x = it(i.props, s.level + 1), y = O(() => T.value !== "horizontal" ? {
309
+ }), h = it(i.props, s.level + 1), y = O(() => T.value !== "horizontal" ? {
309
310
  color: P.value
310
311
  } : {
311
312
  borderBottomColor: A.value ? i.props.activeTextColor ? Q.value : "" : "transparent",
@@ -321,7 +322,7 @@ var Ue = G({
321
322
  indexPath: t.value,
322
323
  active: A.value
323
324
  });
324
- }, h = (Y, w = e.showTimeout) => {
325
+ }, x = (Y, w = e.showTimeout) => {
325
326
  var F;
326
327
  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(() => {
327
328
  i.openMenu(e.index, t.value);
@@ -386,9 +387,9 @@ var Ue = G({
386
387
  u.m("popup-container"),
387
388
  e.popperClass
388
389
  ],
389
- onMouseenter: (W) => h(W, 100),
390
+ onMouseenter: (W) => x(W, 100),
390
391
  onMouseleave: () => E(!0),
391
- onFocus: (W) => h(W, 100)
392
+ onFocus: (W) => x(W, 100)
392
393
  }, [
393
394
  U("ul", {
394
395
  class: [
@@ -396,7 +397,7 @@ var Ue = G({
396
397
  u.m("popup"),
397
398
  u.m(`popup-${v.value}`)
398
399
  ],
399
- style: x.value
400
+ style: h.value
400
401
  }, [(V = n.default) == null ? void 0 : V.call(n)])
401
402
  ]);
402
403
  },
@@ -424,7 +425,7 @@ var Ue = G({
424
425
  return zt(U("ul", {
425
426
  role: "menu",
426
427
  class: [u.b(), u.m("inline")],
427
- style: x.value
428
+ style: h.value
428
429
  }, [(V = n.default) == null ? void 0 : V.call(n)]), [[jt, f.value]]);
429
430
  }
430
431
  })
@@ -439,9 +440,9 @@ var Ue = G({
439
440
  role: "menuitem",
440
441
  ariaHaspopup: !0,
441
442
  ariaExpanded: f.value,
442
- onMouseenter: h,
443
+ onMouseenter: x,
443
444
  onMouseleave: () => E(!0),
444
- onFocus: h
445
+ onFocus: x
445
446
  }, [F]);
446
447
  };
447
448
  }
@@ -484,10 +485,10 @@ const Ut = Se({
484
485
  values: ["dark", "light"],
485
486
  default: "dark"
486
487
  }
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)
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)
491
492
  };
492
493
  var Vt = G({
493
494
  name: "ElMenu",
@@ -498,12 +499,12 @@ var Vt = G({
498
499
  const T = g.value && M.value[g.value];
499
500
  if (!T || e.mode === "horizontal" || e.collapse)
500
501
  return;
501
- T.indexPath.forEach((x) => {
502
- const y = N.value[x];
503
- y && v(x, y.indexPath);
502
+ T.indexPath.forEach((h) => {
503
+ const y = N.value[h];
504
+ y && v(h, y.indexPath);
504
505
  });
505
506
  }, v = (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));
507
+ d.value.includes(T) || (e.uniqueOpened && (d.value = d.value.filter((h) => D.includes(h))), d.value.push(T), n("open", T, D));
507
508
  }, b = (T) => {
508
509
  const D = d.value.indexOf(T);
509
510
  D !== -1 && d.value.splice(D, 1);
@@ -516,29 +517,29 @@ var Vt = G({
516
517
  d.value.includes(T) ? k(T, D) : v(T, D);
517
518
  }, z = (T) => {
518
519
  (e.mode === "horizontal" || e.collapse) && (d.value = []);
519
- const { index: D, indexPath: x } = T;
520
- if (!(We(D) || We(x)))
520
+ const { index: D, indexPath: h } = T;
521
+ if (!(We(D) || We(h)))
521
522
  if (e.router && l) {
522
523
  const y = T.route || D, L = l.push(y).then((m) => (m || (g.value = D), m));
523
- n("select", D, x, { index: D, indexPath: x, route: y }, L);
524
+ n("select", D, h, { index: D, indexPath: h, route: y }, L);
524
525
  } else
525
- g.value = D, n("select", D, x, { index: D, indexPath: x });
526
+ g.value = D, n("select", D, h, { index: D, indexPath: h });
526
527
  }, p = (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;
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;
529
530
  }, f = () => {
530
531
  var T, D;
531
532
  if (!u.value)
532
533
  return -1;
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;
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;
538
539
  }, A = (T, D = 33.34) => {
539
- let x;
540
+ let h;
540
541
  return () => {
541
- x && clearTimeout(x), x = setTimeout(() => {
542
+ h && clearTimeout(h), h = setTimeout(() => {
542
543
  T();
543
544
  }, D);
544
545
  };
@@ -597,24 +598,24 @@ var Vt = G({
597
598
  e.mode === "horizontal" && new _t(t.vnode.el, r.namespace.value);
598
599
  }), o({
599
600
  open: (D) => {
600
- const { indexPath: x } = N.value[D];
601
- x.forEach((y) => v(y, x));
601
+ const { indexPath: h } = N.value[D];
602
+ h.forEach((y) => v(y, h));
602
603
  },
603
604
  close: b,
604
605
  handleResize: Q
605
606
  }), () => {
606
607
  var T, D;
607
- let x = (D = (T = a.default) == null ? void 0 : T.call(a)) != null ? D : [];
608
+ let h = (D = (T = a.default) == null ? void 0 : T.call(a)) != null ? D : [];
608
609
  const y = [];
609
610
  if (e.mode === "horizontal" && u.value) {
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, {
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, {
612
613
  index: "sub-menu-more",
613
614
  class: i.e("hide-arrow")
614
615
  }, {
615
616
  title: () => U(ot, {
616
617
  class: i.e("icon-more")
617
- }, { default: () => U(xt) }),
618
+ }, { default: () => U(ht) }),
618
619
  default: () => E
619
620
  })));
620
621
  }
@@ -628,7 +629,7 @@ var Vt = G({
628
629
  [r.m(e.mode)]: !0,
629
630
  [r.m("collapse")]: e.collapse
630
631
  }
631
- }, [...x, ...y]);
632
+ }, [...h, ...y]);
632
633
  return e.collapseTransition && e.mode === "vertical" ? U(Bt, () => m) : m;
633
634
  };
634
635
  }
@@ -644,8 +645,8 @@ const Wt = Se({
644
645
  disabled: Boolean
645
646
  }), Zt = {
646
647
  click: (e) => ae(e.index) && Array.isArray(e.indexPath)
647
- }, he = "ElMenuItem", Gt = G({
648
- name: he,
648
+ }, xe = "ElMenuItem", Gt = G({
649
+ name: xe,
649
650
  components: {
650
651
  ElTooltip: Xe
651
652
  },
@@ -653,9 +654,9 @@ const Wt = Se({
653
654
  emits: Zt,
654
655
  setup(e, { emit: n }) {
655
656
  const a = Fe(), o = fe("rootMenu"), t = q("menu"), l = q("menu-item");
656
- o || pe(he, "can not inject root menu");
657
+ o || pe(xe, "can not inject root menu");
657
658
  const { parentMenu: u, indexPath: r } = at(a, pt(e, "index")), i = fe(`subMenu:${u.value.uid}`);
658
- i || pe(he, "can not inject sub menu");
659
+ i || pe(xe, "can not inject sub menu");
659
660
  const s = O(() => e.index === o.activeIndex), d = Qe({
660
661
  index: e.index,
661
662
  indexPath: r,
@@ -1326,10 +1327,10 @@ const Je = (e) => {
1326
1327
  const { key: P, data: T } = Q;
1327
1328
  if (P === "sellBuy") {
1328
1329
  const D = T.filter((L) => L.time === C.axisValue);
1329
- let x = 0, y = 0;
1330
+ let h = 0, y = 0;
1330
1331
  D.forEach((L) => {
1331
- L.tradeType === "开多" || L.tradeType === "平空" ? x += L.amount : y += L.amount;
1332
- }), x && (A += `<div>买: ${x}</div>`), y && (A += `<div>卖: ${y}</div>`);
1332
+ L.tradeType === "开多" || L.tradeType === "平空" ? h += L.amount : y += L.amount;
1333
+ }), h && (A += `<div>买: ${h}</div>`), y && (A += `<div>卖: ${y}</div>`);
1333
1334
  }
1334
1335
  P === "openClose" && T.forEach((D) => {
1335
1336
  D.time === C.axisValue && (A += D.tooltip);
@@ -1522,7 +1523,7 @@ const Je = (e) => {
1522
1523
  };
1523
1524
  return [...z, Nn(P)];
1524
1525
  }, d)), k.length > 0 && (d = k.reduce((z, p) => {
1525
- const { value: f, text: A, profitValue: C, profitText: Q, lossValue: P, lossText: T, info: D, config: x } = p;
1526
+ const { value: f, text: A, profitValue: C, profitText: Q, lossValue: P, lossText: T, info: D, config: h } = p;
1526
1527
  if (f > N || f < M)
1527
1528
  return z;
1528
1529
  const y = {
@@ -1532,7 +1533,7 @@ const Je = (e) => {
1532
1533
  profitText: Q,
1533
1534
  lossY: a.convertToPixel({ yAxisIndex: 0 }, P),
1534
1535
  lossText: T,
1535
- info: { info: D, config: { ...i, ...x }, event: { ...B } },
1536
+ info: { info: D, config: { ...i, ...h }, event: { ...B } },
1536
1537
  gridLeft: o,
1537
1538
  gridRight: t,
1538
1539
  echartsWidth: a.getWidth(),
@@ -1547,7 +1548,7 @@ const Je = (e) => {
1547
1548
  p.forEach((y) => {
1548
1549
  f[y[1]] ? f[y[1]] += 1 : f[y[1]] = 1;
1549
1550
  });
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);
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);
1551
1552
  d = [
1552
1553
  ...d,
1553
1554
  {
@@ -1579,7 +1580,7 @@ const Je = (e) => {
1579
1580
  )}    中值: ${$(P)}    标准差: ${$(
1580
1581
  T
1581
1582
  )}    距均值/标准差: ${$(D)}    百分位: ${$(
1582
- x
1583
+ h
1583
1584
  )}%`,
1584
1585
  lineWidth: 1,
1585
1586
  opacity: 1
@@ -1734,8 +1735,8 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1734
1735
  }, o = O(() => ({ ...a, ...n.config })), t = S(null), l = S(-1), u = O(() => {
1735
1736
  var y, L;
1736
1737
  if (t.value && ((L = (y = t.value.dataset[0]) == null ? void 0 : y.source) != null && L.klineData[l.value])) {
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) {
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) {
1739
1740
  let W = ((m[1] - m[5]) / m[1] * 100).toFixed(2), Z = +W == 0 ? "white" : +W > 0 ? "red" : "#00ff00";
1740
1741
  j.push({ label: "涨跌", value: `${W}%`, color: Z });
1741
1742
  }
@@ -1775,12 +1776,12 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1775
1776
  }
1776
1777
  if (n.priceTrendPercentData.length > 0) {
1777
1778
  const L = [];
1778
- return c.getOption().series.filter((j) => j.name.includes("二腿价格走势百分比图")).forEach((j, h) => {
1779
+ return c.getOption().series.filter((j) => j.name.includes("二腿价格走势百分比图")).forEach((j, x) => {
1779
1780
  var Y;
1780
1781
  (j.data[l.value] ? $(j.data[l.value][1]) : null) !== null && L.push({
1781
1782
  label: j.name.split("-")[1],
1782
1783
  value: `${$((Y = j.data[l.value]) == null ? void 0 : Y[1])}%`,
1783
- color: y[h]
1784
+ color: y[x]
1784
1785
  });
1785
1786
  }), L;
1786
1787
  }
@@ -1844,16 +1845,16 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1844
1845
  o.value,
1845
1846
  n.netPositionData,
1846
1847
  n.relevanceData
1847
- ), { graphic: h } = c.getOption() ?? { graphic: [] };
1848
- t.value = { ...j, graphic: h }, c.setOption(t.value, !0), se("st-kline组件消息:K线绘制完毕-draw", { color: "green" });
1848
+ ), { graphic: x } = c.getOption() ?? { graphic: [] };
1849
+ t.value = { ...j, graphic: x }, c.setOption(t.value, !0), se("st-kline组件消息:K线绘制完毕-draw", { color: "green" });
1849
1850
  }
1850
1851
  ],
1851
1852
  // line-额外线条绘制
1852
1853
  [
1853
1854
  "line",
1854
1855
  () => {
1855
- const j = c.getOption(), h = pn(n.lineData, o.value, c);
1856
- t.value = { ...j, graphic: h }, c.setOption(t.value, {
1856
+ const j = c.getOption(), x = pn(n.lineData, o.value, c);
1857
+ t.value = { ...j, graphic: x }, c.setOption(t.value, {
1857
1858
  replaceMerge: ["graphic"]
1858
1859
  }), se("st-kline组件消息:额外画线绘制完毕-draw", { color: "green" });
1859
1860
  }
@@ -1886,17 +1887,17 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1886
1887
  [
1887
1888
  "history",
1888
1889
  async () => {
1889
- const j = c.getOption(), h = await we(
1890
+ const j = c.getOption(), x = await we(
1890
1891
  n.klineData,
1891
1892
  n.markData,
1892
1893
  n.indicator,
1893
1894
  o.value,
1894
1895
  n.netPositionData,
1895
1896
  n.relevanceData
1896
- ), E = h.dataset.source.klineData.length - j.dataset[0].source.klineData.length;
1897
+ ), E = x.dataset.source.klineData.length - j.dataset[0].source.klineData.length;
1897
1898
  c.setOption(
1898
1899
  {
1899
- ...h,
1900
+ ...x,
1900
1901
  dataZoom: [
1901
1902
  {
1902
1903
  type: "inside",
@@ -1916,7 +1917,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1916
1917
  [
1917
1918
  "future",
1918
1919
  async () => {
1919
- const j = c.getOption(), h = await we(
1920
+ const j = c.getOption(), x = await we(
1920
1921
  n.klineData,
1921
1922
  n.markData,
1922
1923
  n.indicator,
@@ -1924,7 +1925,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1924
1925
  n.netPositionData,
1925
1926
  n.relevanceData
1926
1927
  );
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");
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");
1928
1929
  }
1929
1930
  ],
1930
1931
  // priceTrend-二腿价格趋势绘制
@@ -1933,7 +1934,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1933
1934
  () => {
1934
1935
  if (n.priceTrendData.length === 0)
1935
1936
  return;
1936
- const j = c.getOption(), h = [
1937
+ const j = c.getOption(), x = [
1937
1938
  "#FFFFFF",
1938
1939
  "#FFDD00",
1939
1940
  "#FF00FF",
@@ -1953,7 +1954,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1953
1954
  yAxisIndex: 1,
1954
1955
  connectNulls: !0,
1955
1956
  itemStyle: {
1956
- color: h[F]
1957
+ color: x[F]
1957
1958
  },
1958
1959
  lineStyle: {
1959
1960
  type: "dashed",
@@ -1974,7 +1975,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1974
1975
  async () => {
1975
1976
  if (n.priceTrendPercentData.length === 0)
1976
1977
  return;
1977
- const j = c.getOption(), h = [
1978
+ const j = c.getOption(), x = [
1978
1979
  "#FFFFFF",
1979
1980
  "#FFDD00",
1980
1981
  "#FF00FF",
@@ -1994,7 +1995,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1994
1995
  yAxisIndex: 1,
1995
1996
  connectNulls: !0,
1996
1997
  itemStyle: {
1997
- color: h[V]
1998
+ color: x[V]
1998
1999
  },
1999
2000
  lineStyle: {
2000
2001
  type: "dashed",
@@ -2021,8 +2022,8 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2021
2022
  if (y)
2022
2023
  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;
2023
2024
  else {
2024
- const h = L.getOption();
2025
- h.dataZoom instanceof Array && (l.value = h.dataZoom[0].endValue);
2025
+ const x = L.getOption();
2026
+ x.dataZoom instanceof Array && (l.value = x.dataZoom[0].endValue);
2026
2027
  }
2027
2028
  };
2028
2029
  let k = null, B = !1, z = S(!1), p = !1, f = S(!1);
@@ -2060,7 +2061,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2060
2061
  if (!c || !(y.ctrlKey || n.isSelect))
2061
2062
  return;
2062
2063
  const L = c.getOption();
2063
- let { startValue: m, endValue: j, start: h, end: E } = L.dataZoom[0];
2064
+ let { startValue: m, endValue: j, start: x, end: E } = L.dataZoom[0];
2064
2065
  const Y = () => {
2065
2066
  m !== 0 && (m = m - 1, j = j - 1, c.dispatchAction({
2066
2067
  type: "dataZoom",
@@ -2099,9 +2100,9 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2099
2100
  maxValueSpan: o.value.maxValueSpan
2100
2101
  });
2101
2102
  }, V = () => {
2102
- h = h - (E - h) / 4, c.dispatchAction({
2103
+ x = x - (E - x) / 4, c.dispatchAction({
2103
2104
  type: "dataZoom",
2104
- start: h,
2105
+ start: x,
2105
2106
  end: E,
2106
2107
  actionIsWheel: !0,
2107
2108
  // 标记为缩放
@@ -2114,7 +2115,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2114
2115
  ["ArrowDown", V]
2115
2116
  ])).get(y.code);
2116
2117
  Z instanceof Function && Z();
2117
- }, x = async () => {
2118
+ }, h = async () => {
2118
2119
  let y = !0;
2119
2120
  c = Te.init(I.value), await s(), g.value = n.defaultMenuData, l.value = c.getOption().dataZoom[0].endValue ?? -1, P(), v = new ResizeObserver(() => {
2120
2121
  if (y) {
@@ -2125,7 +2126,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2125
2126
  }), v.observe(I.value), window.addEventListener("keydown", D);
2126
2127
  };
2127
2128
  return le(() => {
2128
- x();
2129
+ h();
2129
2130
  }), Re(() => {
2130
2131
  T(), window.removeEventListener("keydown", D), c.dispose(), v.disconnect(), v = null;
2131
2132
  }), (y, L) => {
@@ -2143,14 +2144,14 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2143
2144
  popover: ee(() => [
2144
2145
  K(j, { class: "menu" }, {
2145
2146
  default: ee(() => [
2146
- (_(!0), R(ne, null, De(g.value, (h) => (_(), ue(m, {
2147
- key: h.label,
2148
- index: h.label,
2147
+ (_(!0), R(ne, null, De(g.value, (x) => (_(), ue(m, {
2148
+ key: x.label,
2149
+ index: x.label,
2149
2150
  class: "menuItem",
2150
- onClick: (E) => M(h)
2151
+ onClick: (E) => M(x)
2151
2152
  }, {
2152
2153
  default: ee(() => [
2153
- tt(ie(h.label), 1)
2154
+ tt(ie(x.label), 1)
2154
2155
  ]),
2155
2156
  _: 2
2156
2157
  }, 1032, ["index", "onClick"]))), 128))
@@ -2171,7 +2172,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2171
2172
  };
2172
2173
  }
2173
2174
  });
2174
- const xn = /* @__PURE__ */ oe(vn, [["__scopeId", "data-v-7f014d0e"]]), hn = { class: "kline-tips" }, An = /* @__PURE__ */ G({
2175
+ const hn = /* @__PURE__ */ oe(vn, [["__scopeId", "data-v-7f014d0e"]]), xn = { class: "kline-tips" }, An = /* @__PURE__ */ G({
2175
2176
  __name: "index",
2176
2177
  props: {
2177
2178
  // 提示数据
@@ -2181,7 +2182,7 @@ const xn = /* @__PURE__ */ oe(vn, [["__scopeId", "data-v-7f014d0e"]]), hn = { cl
2181
2182
  }
2182
2183
  },
2183
2184
  setup(e) {
2184
- return (n, a) => (_(), R("div", hn, [
2185
+ return (n, a) => (_(), R("div", xn, [
2185
2186
  (_(!0), R(ne, null, De(e.data, (o, t) => (_(), R("div", {
2186
2187
  key: t,
2187
2188
  class: "kline-tips-item",
@@ -2621,11 +2622,11 @@ const Fn = {
2621
2622
  ref: i
2622
2623
  }, null, 512));
2623
2624
  }
2624
- }, Qn = /* @__PURE__ */ oe(Fn, [["__scopeId", "data-v-7a2f3dd0"]]), io = {
2625
+ }, Qn = /* @__PURE__ */ oe(Fn, [["__scopeId", "data-v-7a2f3dd0"]]), lo = {
2625
2626
  install(e) {
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);
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);
2627
2628
  }
2628
2629
  };
2629
2630
  export {
2630
- io as default
2631
+ lo as default
2631
2632
  };
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-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;
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-8776b83e.cjs");require("./el-input-11327619.cjs");require("./el-tag-c9d5baa7.cjs");const R=require("./el-select-5dbb0da3.cjs");require("./el-scrollbar-f197b544.cjs");const M=require("echarts");require("./_commonjsHelpers-87b0abe8.cjs");require("./use-form-item-67e7ef93.cjs");require("./typescript-b63f8e83.cjs");require("./focus-trap-5f42842b.cjs");require("./scroll-22a00b05.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,16 +2,17 @@ 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-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";
5
+ import "./base-6e64c2e6.js";
6
+ import "./el-input-f4898cfa.js";
7
+ import "./el-tag-f878b1f1.js";
8
+ import { E as ae, a as ne } from "./el-select-b9cf452e.js";
9
+ import "./el-scrollbar-a00aca2f.js";
9
10
  import * as q from "echarts";
10
11
  import "./_commonjsHelpers-10dfc225.js";
11
- import "./use-form-item-bd4b9eeb.js";
12
+ import "./use-form-item-bfc7dddf.js";
12
13
  import "./typescript-7ae59c4c.js";
13
- import "./focus-trap-5fc152a0.js";
14
- import "./scroll-c6e51ef8.js";
14
+ import "./focus-trap-2677bd39.js";
15
+ import "./scroll-9b9249e9.js";
15
16
  const oe = /* @__PURE__ */ E({
16
17
  __name: "index",
17
18
  setup(w, { expose: A }) {
@@ -604,11 +605,11 @@ const he = /* @__PURE__ */ O(fe, [["__scopeId", "data-v-2ece79b3"]]), me = /* @_
604
605
  }, null, 512));
605
606
  }
606
607
  });
607
- const ge = /* @__PURE__ */ O(me, [["__scopeId", "data-v-5008746a"]]), Le = {
608
+ const ge = /* @__PURE__ */ O(me, [["__scopeId", "data-v-5008746a"]]), Ve = {
608
609
  install(w) {
609
610
  w.component("st-klineUtils", oe), w.component("st-klineSub", he), w.component("st-klineTips", ce), w.component("st-klineSlide", ge);
610
611
  }
611
612
  };
612
613
  export {
613
- Le as default
614
+ Ve as default
614
615
  };