st-comp 0.0.75 → 0.0.76

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 (77) hide show
  1. package/components.d.ts +3 -0
  2. package/es/ChartLayout.cjs +1 -1
  3. package/es/ChartLayout.js +25 -223
  4. package/es/Dialog.cjs +1 -1
  5. package/es/Dialog.js +15 -13
  6. package/es/Kline.cjs +1 -1
  7. package/es/Kline.js +105 -102
  8. package/es/KlineNew.cjs +1 -1
  9. package/es/KlineNew.js +45 -42
  10. package/es/MonacoEditor.cjs +1 -1
  11. package/es/MonacoEditor.js +1 -1
  12. package/es/Pagination.cjs +1 -1
  13. package/es/Pagination.js +121 -117
  14. package/es/Table.cjs +3 -3
  15. package/es/Table.js +275 -271
  16. package/es/VarietySearch.cjs +2 -2
  17. package/es/VarietySearch.js +476 -477
  18. package/es/VirtualTable.cjs +13 -1
  19. package/es/VirtualTable.js +2724 -1
  20. package/es/{base-dbd10dcf.cjs → base-4865d432.cjs} +3 -3
  21. package/es/{base-00f6b0ab.js → base-6faccb01.js} +66 -65
  22. package/es/castArray-3341cbb4.cjs +1 -0
  23. package/es/castArray-bdee0d50.js +10 -0
  24. package/es/config-provider-465c8253.cjs +1 -0
  25. package/es/config-provider-be0e9c36.js +46 -0
  26. package/es/{el-button-12e38f0b.js → el-button-1b9c4fd6.js} +31 -31
  27. package/es/el-button-aad5268b.cjs +1 -0
  28. package/es/el-empty-348c46f7.js +204 -0
  29. package/es/el-empty-608948d9.cjs +1 -0
  30. package/es/el-icon-158ddc19.cjs +1 -0
  31. package/es/{el-icon-bacbcecf.js → el-icon-d385d377.js} +58 -57
  32. package/es/{el-overlay-ea0f5492.js → el-overlay-400ac6ce.js} +58 -57
  33. package/es/el-overlay-4713107e.cjs +5 -0
  34. package/es/el-scrollbar-83abe3de.js +248 -0
  35. package/es/el-scrollbar-bc381e35.cjs +1 -0
  36. package/es/el-select-7116533b.cjs +9 -0
  37. package/es/{el-select-f84b87d9.js → el-select-895360ba.js} +282 -280
  38. package/es/el-tag-2c7e5d4a.cjs +1 -0
  39. package/es/el-tag-30cecca3.js +2417 -0
  40. package/es/focus-trap-5ac78614.js +259 -0
  41. package/es/focus-trap-a169f160.cjs +1 -0
  42. package/es/{index-2cc1c02e.cjs → index-a091492d.cjs} +1 -1
  43. package/es/{index-16dfa199.js → index-caa490bf.js} +17 -14
  44. package/es/{python-336a8c96.js → python-0b8dfd75.js} +1 -1
  45. package/es/{python-044eec0c.cjs → python-bd86111b.cjs} +1 -1
  46. package/es/raf-5e5c53db.cjs +1 -0
  47. package/es/raf-92c5ed6d.js +6 -0
  48. package/es/{scroll-c6489061.js → scroll-264c50f3.js} +5 -5
  49. package/es/{scroll-891e3e9f.cjs → scroll-bb8039ba.cjs} +1 -1
  50. package/es/style.css +1 -1
  51. package/es/typescript-7ae59c4c.js +4 -0
  52. package/es/typescript-b63f8e83.cjs +1 -0
  53. package/es/use-form-item-0e9cae13.js +668 -0
  54. package/es/use-form-item-6cef6b15.cjs +3 -0
  55. package/es/use-global-config-17f3d7c7.cjs +1 -0
  56. package/es/use-global-config-8c9c775f.js +110 -0
  57. package/es/{vnode-b44a499a.cjs → vnode-abafec9e.cjs} +1 -1
  58. package/es/{vnode-229e6729.js → vnode-b78096e3.js} +4 -4
  59. package/es/{zh-cn-e0c3b8df.js → zh-cn-8aaa7dd2.js} +2 -2
  60. package/es/{zh-cn-5c01bb26.cjs → zh-cn-e4d38144.cjs} +1 -1
  61. package/lib/bundle.js +1 -1
  62. package/lib/bundle.umd.cjs +1 -1
  63. package/lib/{index-d7f5d65b.js → index-bdeb684f.js} +17 -14
  64. package/lib/{python-31d7356c.js → python-c9833067.js} +1 -1
  65. package/package.json +1 -1
  66. package/packages/MonacoEditor/index.vue +5 -0
  67. package/src/pages/MonacoEditor/index.vue +5 -0
  68. package/es/config-provider-33068fb6.cjs +0 -1
  69. package/es/config-provider-c98bd563.js +0 -148
  70. package/es/el-button-fc645d0f.cjs +0 -1
  71. package/es/el-icon-99876220.cjs +0 -1
  72. package/es/el-overlay-dcbc4437.cjs +0 -5
  73. package/es/el-scrollbar-6800cb98.js +0 -2653
  74. package/es/el-scrollbar-9da140ab.cjs +0 -1
  75. package/es/el-select-d22b5aa3.cjs +0 -9
  76. package/es/focus-trap-9f4b1039.js +0 -880
  77. package/es/focus-trap-fae33d9d.cjs +0 -3
package/es/Kline.js CHANGED
@@ -1,17 +1,20 @@
1
- import { u as q, _ as me, B as de, C as ve, z as Mt, c as Se, y as pe, I as ae, E as Ve, f as Oe, K as ct, w as dt, g as _e } from "./base-00f6b0ab.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-6faccb01.js";
2
2
  import "./el-tooltip-4ed993c7.js";
3
- import { c as Xe, a as Nt } from "./el-scrollbar-6800cb98.js";
4
- import { defineComponent as G, openBlock as _, createBlock as ue, Transition as qe, mergeProps as Ke, unref as yt, toHandlers as zt, 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 jt, vShow as gt, watchEffect as pt, nextTick as Be, toRef as ft, resolveComponent as Tt, 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";
3
+ import { E as Xe } from "./el-tag-30cecca3.js";
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
- import { i as It, t as mt } from "./index.esm-8d9a2abe.js";
9
- import { y as J, u as Dt, B as Lt, p as vt, E as ot, i as Ne, D as xt, t as We } from "./focus-trap-9f4b1039.js";
10
- import { T as ht } from "./index-657047bb.js";
11
- import { m as At, E as Yt, a as Ct } from "./el-select-f84b87d9.js";
12
- import { f as bt } from "./vnode-229e6729.js";
8
+ import { i as Tt, t as It } from "./index.esm-8d9a2abe.js";
9
+ import { u as mt } from "./el-scrollbar-83abe3de.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-0e9cae13.js";
11
+ import { E as J, i as We } from "./focus-trap-5ac78614.js";
12
+ import { T as xt } from "./index-657047bb.js";
13
+ import { m as At } from "./typescript-7ae59c4c.js";
14
+ import { f as Yt } from "./vnode-b78096e3.js";
15
+ import { E as Ct, a as bt } from "./el-select-895360ba.js";
13
16
  import "./_commonjsHelpers-10dfc225.js";
14
- import "./scroll-c6489061.js";
17
+ import "./scroll-264c50f3.js";
15
18
  const je = function(e, n, ...a) {
16
19
  let o;
17
20
  n.includes("mouse") || n.includes("click") ? o = "MouseEvents" : n.includes("key") ? o = "KeyboardEvent" : o = "HTMLEvents";
@@ -51,8 +54,8 @@ const je = function(e, n, ...a) {
51
54
  }
52
55
  };
53
56
  return (t, l) => (_(), ue(qe, Ke({
54
- name: yt(n).b()
55
- }, zt(o)), {
57
+ name: Nt(n).b()
58
+ }, yt(o)), {
56
59
  default: ee(() => [
57
60
  X(t.$slots, "default")
58
61
  ]),
@@ -201,7 +204,7 @@ function at(e, n) {
201
204
  function Pt(e) {
202
205
  return O(() => {
203
206
  const a = e.backgroundColor;
204
- return a ? new ht(a).shade(20).toString() : "";
207
+ return a ? new xt(a).shade(20).toString() : "";
205
208
  });
206
209
  }
207
210
  const it = (e, n) => {
@@ -302,7 +305,7 @@ var Ue = G({
302
305
  index: e.index,
303
306
  indexPath: t,
304
307
  active: A
305
- }), x = it(i.props, s.level + 1), y = O(() => T.value !== "horizontal" ? {
308
+ }), h = it(i.props, s.level + 1), y = O(() => T.value !== "horizontal" ? {
306
309
  color: P.value
307
310
  } : {
308
311
  borderBottomColor: A.value ? i.props.activeTextColor ? Q.value : "" : "transparent",
@@ -318,7 +321,7 @@ var Ue = G({
318
321
  indexPath: t.value,
319
322
  active: A.value
320
323
  });
321
- }, h = (Y, w = e.showTimeout) => {
324
+ }, x = (Y, w = e.showTimeout) => {
322
325
  var F;
323
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(() => {
324
327
  i.openMenu(e.index, t.value);
@@ -383,9 +386,9 @@ var Ue = G({
383
386
  u.m("popup-container"),
384
387
  e.popperClass
385
388
  ],
386
- onMouseenter: (W) => h(W, 100),
389
+ onMouseenter: (W) => x(W, 100),
387
390
  onMouseleave: () => E(!0),
388
- onFocus: (W) => h(W, 100)
391
+ onFocus: (W) => x(W, 100)
389
392
  }, [
390
393
  U("ul", {
391
394
  class: [
@@ -393,7 +396,7 @@ var Ue = G({
393
396
  u.m("popup"),
394
397
  u.m(`popup-${v.value}`)
395
398
  ],
396
- style: x.value
399
+ style: h.value
397
400
  }, [(V = n.default) == null ? void 0 : V.call(n)])
398
401
  ]);
399
402
  },
@@ -418,11 +421,11 @@ var Ue = G({
418
421
  U(kt, {}, {
419
422
  default: () => {
420
423
  var V;
421
- return jt(U("ul", {
424
+ return zt(U("ul", {
422
425
  role: "menu",
423
426
  class: [u.b(), u.m("inline")],
424
- style: x.value
425
- }, [(V = n.default) == null ? void 0 : V.call(n)]), [[gt, f.value]]);
427
+ style: h.value
428
+ }, [(V = n.default) == null ? void 0 : V.call(n)]), [[jt, f.value]]);
426
429
  }
427
430
  })
428
431
  ]);
@@ -436,9 +439,9 @@ var Ue = G({
436
439
  role: "menuitem",
437
440
  ariaHaspopup: !0,
438
441
  ariaExpanded: f.value,
439
- onMouseenter: h,
442
+ onMouseenter: x,
440
443
  onMouseleave: () => E(!0),
441
- onFocus: h
444
+ onFocus: x
442
445
  }, [F]);
443
446
  };
444
447
  }
@@ -481,10 +484,10 @@ const Ut = Se({
481
484
  values: ["dark", "light"],
482
485
  default: "dark"
483
486
  }
484
- }), xe = (e) => Array.isArray(e) && e.every((n) => ae(n)), $t = {
485
- close: (e, n) => ae(e) && xe(n),
486
- open: (e, n) => ae(e) && xe(n),
487
- select: (e, n, a, o) => ae(e) && xe(n) && ct(a) && (o === void 0 || o instanceof Promise)
487
+ }), he = (e) => Array.isArray(e) && e.every((n) => ae(n)), $t = {
488
+ close: (e, n) => ae(e) && he(n),
489
+ open: (e, n) => ae(e) && he(n),
490
+ select: (e, n, a, o) => ae(e) && he(n) && ct(a) && (o === void 0 || o instanceof Promise)
488
491
  };
489
492
  var Vt = G({
490
493
  name: "ElMenu",
@@ -495,12 +498,12 @@ var Vt = G({
495
498
  const T = g.value && M.value[g.value];
496
499
  if (!T || e.mode === "horizontal" || e.collapse)
497
500
  return;
498
- T.indexPath.forEach((x) => {
499
- const y = N.value[x];
500
- y && v(x, y.indexPath);
501
+ T.indexPath.forEach((h) => {
502
+ const y = N.value[h];
503
+ y && v(h, y.indexPath);
501
504
  });
502
505
  }, v = (T, D) => {
503
- d.value.includes(T) || (e.uniqueOpened && (d.value = d.value.filter((x) => D.includes(x))), d.value.push(T), n("open", T, D));
506
+ d.value.includes(T) || (e.uniqueOpened && (d.value = d.value.filter((h) => D.includes(h))), d.value.push(T), n("open", T, D));
504
507
  }, b = (T) => {
505
508
  const D = d.value.indexOf(T);
506
509
  D !== -1 && d.value.splice(D, 1);
@@ -513,29 +516,29 @@ var Vt = G({
513
516
  d.value.includes(T) ? k(T, D) : v(T, D);
514
517
  }, z = (T) => {
515
518
  (e.mode === "horizontal" || e.collapse) && (d.value = []);
516
- const { index: D, indexPath: x } = T;
517
- if (!(We(D) || We(x)))
519
+ const { index: D, indexPath: h } = T;
520
+ if (!(We(D) || We(h)))
518
521
  if (e.router && l) {
519
522
  const y = T.route || D, L = l.push(y).then((m) => (m || (g.value = D), m));
520
- n("select", D, x, { index: D, indexPath: x, route: y }, L);
523
+ n("select", D, h, { index: D, indexPath: h, route: y }, L);
521
524
  } else
522
- g.value = D, n("select", D, x, { index: D, indexPath: x });
525
+ g.value = D, n("select", D, h, { index: D, indexPath: h });
523
526
  }, p = (T) => {
524
- const D = M.value, x = D[T] || g.value && D[g.value] || D[e.defaultActive];
525
- x ? g.value = x.index : g.value = T;
527
+ const D = M.value, h = D[T] || g.value && D[g.value] || D[e.defaultActive];
528
+ h ? g.value = h.index : g.value = T;
526
529
  }, f = () => {
527
530
  var T, D;
528
531
  if (!u.value)
529
532
  return -1;
530
- 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;
531
- let h = 0, E = 0;
532
- return x.forEach((Y, w) => {
533
- h += Y.offsetWidth || 0, h <= j - y && (E = w + 1);
534
- }), E === x.length ? -1 : E;
533
+ 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;
534
+ let x = 0, E = 0;
535
+ return h.forEach((Y, w) => {
536
+ x += Y.offsetWidth || 0, x <= j - y && (E = w + 1);
537
+ }), E === h.length ? -1 : E;
535
538
  }, A = (T, D = 33.34) => {
536
- let x;
539
+ let h;
537
540
  return () => {
538
- x && clearTimeout(x), x = setTimeout(() => {
541
+ h && clearTimeout(h), h = setTimeout(() => {
539
542
  T();
540
543
  }, D);
541
544
  };
@@ -555,8 +558,8 @@ var Vt = G({
555
558
  T && (d.value = []);
556
559
  }), H(M.value, c);
557
560
  let P;
558
- pt(() => {
559
- e.mode === "horizontal" && e.ellipsis ? P = Nt(u, Q).stop : P == null || P();
561
+ gt(() => {
562
+ e.mode === "horizontal" && e.ellipsis ? P = mt(u, Q).stop : P == null || P();
560
563
  });
561
564
  {
562
565
  const T = (L) => {
@@ -594,24 +597,24 @@ var Vt = G({
594
597
  e.mode === "horizontal" && new _t(t.vnode.el, r.namespace.value);
595
598
  }), o({
596
599
  open: (D) => {
597
- const { indexPath: x } = N.value[D];
598
- x.forEach((y) => v(y, x));
600
+ const { indexPath: h } = N.value[D];
601
+ h.forEach((y) => v(y, h));
599
602
  },
600
603
  close: b,
601
604
  handleResize: Q
602
605
  }), () => {
603
606
  var T, D;
604
- let x = (D = (T = a.default) == null ? void 0 : T.call(a)) != null ? D : [];
607
+ let h = (D = (T = a.default) == null ? void 0 : T.call(a)) != null ? D : [];
605
608
  const y = [];
606
609
  if (e.mode === "horizontal" && u.value) {
607
- const j = bt(x), h = s.value === -1 ? j : j.slice(0, s.value), E = s.value === -1 ? [] : j.slice(s.value);
608
- E != null && E.length && e.ellipsis && (x = h, y.push(U(Ue, {
610
+ const j = Yt(h), x = s.value === -1 ? j : j.slice(0, s.value), E = s.value === -1 ? [] : j.slice(s.value);
611
+ E != null && E.length && e.ellipsis && (h = x, y.push(U(Ue, {
609
612
  index: "sub-menu-more",
610
613
  class: i.e("hide-arrow")
611
614
  }, {
612
615
  title: () => U(ot, {
613
616
  class: i.e("icon-more")
614
- }, { default: () => U(xt) }),
617
+ }, { default: () => U(ht) }),
615
618
  default: () => E
616
619
  })));
617
620
  }
@@ -625,7 +628,7 @@ var Vt = G({
625
628
  [r.m(e.mode)]: !0,
626
629
  [r.m("collapse")]: e.collapse
627
630
  }
628
- }, [...x, ...y]);
631
+ }, [...h, ...y]);
629
632
  return e.collapseTransition && e.mode === "vertical" ? U(Bt, () => m) : m;
630
633
  };
631
634
  }
@@ -641,8 +644,8 @@ const Wt = Se({
641
644
  disabled: Boolean
642
645
  }), Zt = {
643
646
  click: (e) => ae(e.index) && Array.isArray(e.indexPath)
644
- }, he = "ElMenuItem", Gt = G({
645
- name: he,
647
+ }, xe = "ElMenuItem", Gt = G({
648
+ name: xe,
646
649
  components: {
647
650
  ElTooltip: Xe
648
651
  },
@@ -650,9 +653,9 @@ const Wt = Se({
650
653
  emits: Zt,
651
654
  setup(e, { emit: n }) {
652
655
  const a = Fe(), o = fe("rootMenu"), t = q("menu"), l = q("menu-item");
653
- o || pe(he, "can not inject root menu");
654
- const { parentMenu: u, indexPath: r } = at(a, ft(e, "index")), i = fe(`subMenu:${u.value.uid}`);
655
- i || pe(he, "can not inject sub menu");
656
+ o || pe(xe, "can not inject root menu");
657
+ const { parentMenu: u, indexPath: r } = at(a, pt(e, "index")), i = fe(`subMenu:${u.value.uid}`);
658
+ i || pe(xe, "can not inject sub menu");
656
659
  const s = O(() => e.index === o.activeIndex), d = Qe({
657
660
  index: e.index,
658
661
  indexPath: r,
@@ -679,7 +682,7 @@ const Wt = Se({
679
682
  }
680
683
  });
681
684
  function Ht(e, n, a, o, t, l) {
682
- const u = Tt("el-tooltip");
685
+ const u = ft("el-tooltip");
683
686
  return _(), R("li", {
684
687
  class: re([
685
688
  e.nsMenuItem.b(),
@@ -832,14 +835,14 @@ const Je = (e) => {
832
835
  }), { time: n, open: a, close: o, high: t, low: l, kLineData: u };
833
836
  }, rn = async () => {
834
837
  if (!Ze)
835
- Ze = !0, await It("./talib.wasm"), Ge = !1, He.forEach((e) => {
838
+ Ze = !0, await Tt("./talib.wasm"), Ge = !1, He.forEach((e) => {
836
839
  e();
837
840
  });
838
841
  else if (Ge)
839
842
  return new Promise((e) => {
840
843
  He.push(e);
841
844
  });
842
- }, ze = (e, n) => e.length > n ? e.slice(e.length - n) : e, un = (e, n, a) => e.calculationFn ? e.calculationFn(mt, n, a) : new Array(n.time.length).fill(null), Mn = async (e, n, a) => {
845
+ }, ze = (e, n) => e.length > n ? e.slice(e.length - n) : e, un = (e, n, a) => e.calculationFn ? e.calculationFn(It, n, a) : new Array(n.time.length).fill(null), Mn = async (e, n, a) => {
843
846
  const o = Je(e);
844
847
  let t = [];
845
848
  return t = Je(t), await rn(), {
@@ -1323,10 +1326,10 @@ const Je = (e) => {
1323
1326
  const { key: P, data: T } = Q;
1324
1327
  if (P === "sellBuy") {
1325
1328
  const D = T.filter((L) => L.time === C.axisValue);
1326
- let x = 0, y = 0;
1329
+ let h = 0, y = 0;
1327
1330
  D.forEach((L) => {
1328
- L.tradeType === "开多" || L.tradeType === "平空" ? x += L.amount : y += L.amount;
1329
- }), x && (A += `<div>买: ${x}</div>`), y && (A += `<div>卖: ${y}</div>`);
1331
+ L.tradeType === "开多" || L.tradeType === "平空" ? h += L.amount : y += L.amount;
1332
+ }), h && (A += `<div>买: ${h}</div>`), y && (A += `<div>卖: ${y}</div>`);
1330
1333
  }
1331
1334
  P === "openClose" && T.forEach((D) => {
1332
1335
  D.time === C.axisValue && (A += D.tooltip);
@@ -1519,7 +1522,7 @@ const Je = (e) => {
1519
1522
  };
1520
1523
  return [...z, Nn(P)];
1521
1524
  }, d)), k.length > 0 && (d = k.reduce((z, p) => {
1522
- const { value: f, text: A, profitValue: C, profitText: Q, lossValue: P, lossText: T, info: D, config: x } = p;
1525
+ const { value: f, text: A, profitValue: C, profitText: Q, lossValue: P, lossText: T, info: D, config: h } = p;
1523
1526
  if (f > N || f < M)
1524
1527
  return z;
1525
1528
  const y = {
@@ -1529,7 +1532,7 @@ const Je = (e) => {
1529
1532
  profitText: Q,
1530
1533
  lossY: a.convertToPixel({ yAxisIndex: 0 }, P),
1531
1534
  lossText: T,
1532
- info: { info: D, config: { ...i, ...x }, event: { ...B } },
1535
+ info: { info: D, config: { ...i, ...h }, event: { ...B } },
1533
1536
  gridLeft: o,
1534
1537
  gridRight: t,
1535
1538
  echartsWidth: a.getWidth(),
@@ -1544,7 +1547,7 @@ const Je = (e) => {
1544
1547
  p.forEach((y) => {
1545
1548
  f[y[1]] ? f[y[1]] += 1 : f[y[1]] = 1;
1546
1549
  });
1547
- 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);
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, h = fn(p, 1, A);
1548
1551
  d = [
1549
1552
  ...d,
1550
1553
  {
@@ -1576,7 +1579,7 @@ const Je = (e) => {
1576
1579
  )}    中值: ${$(P)}    标准差: ${$(
1577
1580
  T
1578
1581
  )}    距均值/标准差: ${$(D)}    百分位: ${$(
1579
- x
1582
+ h
1580
1583
  )}%`,
1581
1584
  lineWidth: 1,
1582
1585
  opacity: 1
@@ -1731,8 +1734,8 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1731
1734
  }, o = O(() => ({ ...a, ...n.config })), t = S(null), l = S(-1), u = O(() => {
1732
1735
  var y, L;
1733
1736
  if (t.value && ((L = (y = t.value.dataset[0]) == null ? void 0 : y.source) != null && L.klineData[l.value])) {
1734
- 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;
1735
- 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) {
1737
+ 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;
1738
+ 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) {
1736
1739
  let W = ((m[1] - m[5]) / m[1] * 100).toFixed(2), Z = +W == 0 ? "white" : +W > 0 ? "red" : "#00ff00";
1737
1740
  j.push({ label: "涨跌", value: `${W}%`, color: Z });
1738
1741
  }
@@ -1772,12 +1775,12 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1772
1775
  }
1773
1776
  if (n.priceTrendPercentData.length > 0) {
1774
1777
  const L = [];
1775
- return c.getOption().series.filter((j) => j.name.includes("二腿价格走势百分比图")).forEach((j, h) => {
1778
+ return c.getOption().series.filter((j) => j.name.includes("二腿价格走势百分比图")).forEach((j, x) => {
1776
1779
  var Y;
1777
1780
  (j.data[l.value] ? $(j.data[l.value][1]) : null) !== null && L.push({
1778
1781
  label: j.name.split("-")[1],
1779
1782
  value: `${$((Y = j.data[l.value]) == null ? void 0 : Y[1])}%`,
1780
- color: y[h]
1783
+ color: y[x]
1781
1784
  });
1782
1785
  }), L;
1783
1786
  }
@@ -1841,16 +1844,16 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1841
1844
  o.value,
1842
1845
  n.netPositionData,
1843
1846
  n.relevanceData
1844
- ), { graphic: h } = c.getOption() ?? { graphic: [] };
1845
- t.value = { ...j, graphic: h }, c.setOption(t.value, !0), se("st-kline组件消息:K线绘制完毕-draw", { color: "green" });
1847
+ ), { graphic: x } = c.getOption() ?? { graphic: [] };
1848
+ t.value = { ...j, graphic: x }, c.setOption(t.value, !0), se("st-kline组件消息:K线绘制完毕-draw", { color: "green" });
1846
1849
  }
1847
1850
  ],
1848
1851
  // line-额外线条绘制
1849
1852
  [
1850
1853
  "line",
1851
1854
  () => {
1852
- const j = c.getOption(), h = pn(n.lineData, o.value, c);
1853
- t.value = { ...j, graphic: h }, c.setOption(t.value, {
1855
+ const j = c.getOption(), x = pn(n.lineData, o.value, c);
1856
+ t.value = { ...j, graphic: x }, c.setOption(t.value, {
1854
1857
  replaceMerge: ["graphic"]
1855
1858
  }), se("st-kline组件消息:额外画线绘制完毕-draw", { color: "green" });
1856
1859
  }
@@ -1883,17 +1886,17 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1883
1886
  [
1884
1887
  "history",
1885
1888
  async () => {
1886
- const j = c.getOption(), h = await we(
1889
+ const j = c.getOption(), x = await we(
1887
1890
  n.klineData,
1888
1891
  n.markData,
1889
1892
  n.indicator,
1890
1893
  o.value,
1891
1894
  n.netPositionData,
1892
1895
  n.relevanceData
1893
- ), E = h.dataset.source.klineData.length - j.dataset[0].source.klineData.length;
1896
+ ), E = x.dataset.source.klineData.length - j.dataset[0].source.klineData.length;
1894
1897
  c.setOption(
1895
1898
  {
1896
- ...h,
1899
+ ...x,
1897
1900
  dataZoom: [
1898
1901
  {
1899
1902
  type: "inside",
@@ -1913,7 +1916,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1913
1916
  [
1914
1917
  "future",
1915
1918
  async () => {
1916
- const j = c.getOption(), h = await we(
1919
+ const j = c.getOption(), x = await we(
1917
1920
  n.klineData,
1918
1921
  n.markData,
1919
1922
  n.indicator,
@@ -1921,7 +1924,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1921
1924
  n.netPositionData,
1922
1925
  n.relevanceData
1923
1926
  );
1924
- 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");
1927
+ 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");
1925
1928
  }
1926
1929
  ],
1927
1930
  // priceTrend-二腿价格趋势绘制
@@ -1930,7 +1933,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1930
1933
  () => {
1931
1934
  if (n.priceTrendData.length === 0)
1932
1935
  return;
1933
- const j = c.getOption(), h = [
1936
+ const j = c.getOption(), x = [
1934
1937
  "#FFFFFF",
1935
1938
  "#FFDD00",
1936
1939
  "#FF00FF",
@@ -1950,7 +1953,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1950
1953
  yAxisIndex: 1,
1951
1954
  connectNulls: !0,
1952
1955
  itemStyle: {
1953
- color: h[F]
1956
+ color: x[F]
1954
1957
  },
1955
1958
  lineStyle: {
1956
1959
  type: "dashed",
@@ -1971,7 +1974,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1971
1974
  async () => {
1972
1975
  if (n.priceTrendPercentData.length === 0)
1973
1976
  return;
1974
- const j = c.getOption(), h = [
1977
+ const j = c.getOption(), x = [
1975
1978
  "#FFFFFF",
1976
1979
  "#FFDD00",
1977
1980
  "#FF00FF",
@@ -1991,7 +1994,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
1991
1994
  yAxisIndex: 1,
1992
1995
  connectNulls: !0,
1993
1996
  itemStyle: {
1994
- color: h[V]
1997
+ color: x[V]
1995
1998
  },
1996
1999
  lineStyle: {
1997
2000
  type: "dashed",
@@ -2018,8 +2021,8 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2018
2021
  if (y)
2019
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;
2020
2023
  else {
2021
- const h = L.getOption();
2022
- h.dataZoom instanceof Array && (l.value = h.dataZoom[0].endValue);
2024
+ const x = L.getOption();
2025
+ x.dataZoom instanceof Array && (l.value = x.dataZoom[0].endValue);
2023
2026
  }
2024
2027
  };
2025
2028
  let k = null, B = !1, z = S(!1), p = !1, f = S(!1);
@@ -2057,7 +2060,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2057
2060
  if (!c || !(y.ctrlKey || n.isSelect))
2058
2061
  return;
2059
2062
  const L = c.getOption();
2060
- let { startValue: m, endValue: j, start: h, end: E } = L.dataZoom[0];
2063
+ let { startValue: m, endValue: j, start: x, end: E } = L.dataZoom[0];
2061
2064
  const Y = () => {
2062
2065
  m !== 0 && (m = m - 1, j = j - 1, c.dispatchAction({
2063
2066
  type: "dataZoom",
@@ -2096,9 +2099,9 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2096
2099
  maxValueSpan: o.value.maxValueSpan
2097
2100
  });
2098
2101
  }, V = () => {
2099
- h = h - (E - h) / 4, c.dispatchAction({
2102
+ x = x - (E - x) / 4, c.dispatchAction({
2100
2103
  type: "dataZoom",
2101
- start: h,
2104
+ start: x,
2102
2105
  end: E,
2103
2106
  actionIsWheel: !0,
2104
2107
  // 标记为缩放
@@ -2111,7 +2114,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2111
2114
  ["ArrowDown", V]
2112
2115
  ])).get(y.code);
2113
2116
  Z instanceof Function && Z();
2114
- }, x = async () => {
2117
+ }, h = async () => {
2115
2118
  let y = !0;
2116
2119
  c = Te.init(I.value), await s(), g.value = n.defaultMenuData, l.value = c.getOption().dataZoom[0].endValue ?? -1, P(), v = new ResizeObserver(() => {
2117
2120
  if (y) {
@@ -2122,7 +2125,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2122
2125
  }), v.observe(I.value), window.addEventListener("keydown", D);
2123
2126
  };
2124
2127
  return le(() => {
2125
- x();
2128
+ h();
2126
2129
  }), Re(() => {
2127
2130
  T(), window.removeEventListener("keydown", D), c.dispose(), v.disconnect(), v = null;
2128
2131
  }), (y, L) => {
@@ -2140,14 +2143,14 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2140
2143
  popover: ee(() => [
2141
2144
  K(j, { class: "menu" }, {
2142
2145
  default: ee(() => [
2143
- (_(!0), R(ne, null, De(g.value, (h) => (_(), ue(m, {
2144
- key: h.label,
2145
- index: h.label,
2146
+ (_(!0), R(ne, null, De(g.value, (x) => (_(), ue(m, {
2147
+ key: x.label,
2148
+ index: x.label,
2146
2149
  class: "menuItem",
2147
- onClick: (E) => M(h)
2150
+ onClick: (E) => M(x)
2148
2151
  }, {
2149
2152
  default: ee(() => [
2150
- tt(ie(h.label), 1)
2153
+ tt(ie(x.label), 1)
2151
2154
  ]),
2152
2155
  _: 2
2153
2156
  }, 1032, ["index", "onClick"]))), 128))
@@ -2168,7 +2171,7 @@ const mn = { class: "st-kline" }, Dn = { class: "st-kline-header" }, Ln = 300, v
2168
2171
  };
2169
2172
  }
2170
2173
  });
2171
- const xn = /* @__PURE__ */ oe(vn, [["__scopeId", "data-v-7f014d0e"]]), hn = { class: "kline-tips" }, An = /* @__PURE__ */ G({
2174
+ const hn = /* @__PURE__ */ oe(vn, [["__scopeId", "data-v-7f014d0e"]]), xn = { class: "kline-tips" }, An = /* @__PURE__ */ G({
2172
2175
  __name: "index",
2173
2176
  props: {
2174
2177
  // 提示数据
@@ -2178,7 +2181,7 @@ const xn = /* @__PURE__ */ oe(vn, [["__scopeId", "data-v-7f014d0e"]]), hn = { cl
2178
2181
  }
2179
2182
  },
2180
2183
  setup(e) {
2181
- return (n, a) => (_(), R("div", hn, [
2184
+ return (n, a) => (_(), R("div", xn, [
2182
2185
  (_(!0), R(ne, null, De(e.data, (o, t) => (_(), R("div", {
2183
2186
  key: t,
2184
2187
  class: "kline-tips-item",
@@ -2383,7 +2386,7 @@ const Yn = { class: "klineSub" }, Cn = { class: "klineSub-tips" }, bn = {
2383
2386
  }
2384
2387
  // 重置
2385
2388
  }), (M, N) => {
2386
- const I = Yt, c = Ct;
2389
+ const I = Ct, c = bt;
2387
2390
  return _(), R("div", Yn, [
2388
2391
  te("div", Cn, [
2389
2392
  d.value.length ? (_(), R("div", bn, [
@@ -2618,11 +2621,11 @@ const Fn = {
2618
2621
  ref: i
2619
2622
  }, null, 512));
2620
2623
  }
2621
- }, Qn = /* @__PURE__ */ oe(Fn, [["__scopeId", "data-v-7a2f3dd0"]]), no = {
2624
+ }, Qn = /* @__PURE__ */ oe(Fn, [["__scopeId", "data-v-7a2f3dd0"]]), io = {
2622
2625
  install(e) {
2623
- 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);
2626
+ 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);
2624
2627
  }
2625
2628
  };
2626
2629
  export {
2627
- no as default
2630
+ io as default
2628
2631
  };
package/es/KlineNew.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const t=require("vue"),C=require("./index.esm-94a95a2a.cjs"),L=require("./_plugin-vue_export-helper-f246444f.cjs"),z=require("./bundle.umd-c5698c50.cjs");require("./base-dbd10dcf.cjs");const R=require("./el-select-d22b5aa3.cjs");require("./el-scrollbar-9da140ab.cjs");const M=require("echarts");require("./_commonjsHelpers-87b0abe8.cjs");require("./focus-trap-fae33d9d.cjs");require("./scroll-891e3e9f.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 q=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 C.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 E=null,B=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]&&(E=n),s[0]===_[_.length-1][0]&&(B=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(C.talib,I,k).slice(E,B):[]}}),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(C.talib,I).slice(E,B):[]}]: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},B=x.find(n=>n.value===d).config.map(n=>({...n,data:S(n.calculationFn?n.calculationFn(C.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(C.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:[...B[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:B,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=L._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=L._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=q.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=>{q.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=L._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=q.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=L._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-4865d432.cjs");const R=require("./el-select-7116533b.cjs");require("./el-tag-2c7e5d4a.cjs");require("./el-scrollbar-bc381e35.cjs");const M=require("echarts");require("./_commonjsHelpers-87b0abe8.cjs");require("./use-form-item-6cef6b15.cjs");require("./typescript-b63f8e83.cjs");require("./focus-trap-a169f160.cjs");require("./scroll-bb8039ba.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;