st-comp 0.0.207 → 0.0.209
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +71 -71
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +56 -56
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +96 -96
- package/es/KlinePlus.cjs +2 -2
- package/es/KlinePlus.js +163 -163
- package/es/VarietyTextCopy.cjs +3 -3
- package/es/VarietyTextCopy.js +4 -4
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +105 -105
- package/lib/{index-f27d8c7a.js → index-e158c3d6.js} +1531 -1531
- package/lib/{python-c345f0e2.js → python-57033756.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/Kline/componentsNew/KlineTips/index.vue +4 -4
- package/packages/Kline/index.vue +4 -4
- package/packages/KlineBasic/components/KlineTips/index.vue +1 -1
- package/packages/KlineNew/components/KlineTips/index.vue +8 -8
- package/packages/KlinePlus/index.vue +4 -4
- package/src/pages/KlineBasic/api.js +1 -1
package/es/KlineNew.js
CHANGED
|
@@ -22,19 +22,19 @@ import "./debounce-8d53f4dd.js";
|
|
|
22
22
|
import "./vnode-5ddb7ed1.js";
|
|
23
23
|
const oe = /* @__PURE__ */ R({
|
|
24
24
|
__name: "index",
|
|
25
|
-
setup(
|
|
26
|
-
let S = !1, h = !0,
|
|
27
|
-
const
|
|
28
|
-
return
|
|
25
|
+
setup(w, { expose: A }) {
|
|
26
|
+
let S = !1, h = !0, D = [];
|
|
27
|
+
const b = (f, c) => f.length > c ? f.slice(f.length - c) : f;
|
|
28
|
+
return A({
|
|
29
29
|
// 注册计算指标线方法
|
|
30
30
|
initTalib: async () => {
|
|
31
31
|
if (!S)
|
|
32
|
-
S = !0, await te("./talib.wasm"), h = !1,
|
|
32
|
+
S = !0, await te("./talib.wasm"), h = !1, D.forEach((f) => {
|
|
33
33
|
f();
|
|
34
34
|
});
|
|
35
35
|
else if (h)
|
|
36
36
|
return new Promise((f) => {
|
|
37
|
-
|
|
37
|
+
D.push(f);
|
|
38
38
|
});
|
|
39
39
|
},
|
|
40
40
|
// 键盘事件处理
|
|
@@ -89,42 +89,42 @@ const oe = /* @__PURE__ */ R({
|
|
|
89
89
|
* }
|
|
90
90
|
*/
|
|
91
91
|
formatDataBySlide: (f) => {
|
|
92
|
-
const { originDrawData: c, addData: o, startTime: u, endTime: p } = f, { mainIndicator: d, mainIndicatorList: e, subIndicator: i, subIndicatorList: t, config: a, timeRange: r } = f, { loadAddCount: x, preLoadCount:
|
|
93
|
-
let g = [], _ = [], F = [],
|
|
94
|
-
u && p ? (g = o.filter((l) => new Date(l[0]) >= new Date(u) && new Date(l[0]) <= new Date(p)),
|
|
92
|
+
const { originDrawData: c, addData: o, startTime: u, endTime: p } = f, { mainIndicator: d, mainIndicatorList: e, subIndicator: i, subIndicatorList: t, config: a, timeRange: r } = f, { loadAddCount: x, preLoadCount: k } = a;
|
|
93
|
+
let g = [], _ = [], F = [], y = [];
|
|
94
|
+
u && p ? (g = o.filter((l) => new Date(l[0]) >= new Date(u) && new Date(l[0]) <= new Date(p)), y = [...o]) : p ? (g = [
|
|
95
95
|
...o.filter((l, n) => n >= o.length - x && new Date(r[0]) <= new Date(l[0]) && new Date(l[0]) <= new Date(r[1])),
|
|
96
96
|
...c.originData
|
|
97
|
-
],
|
|
97
|
+
], y = [...o, ...c.originData]) : u && (g = [
|
|
98
98
|
...c.originData,
|
|
99
|
-
...o.filter((l, n) => n >=
|
|
100
|
-
],
|
|
99
|
+
...o.filter((l, n) => n >= k && new Date(r[0]) <= new Date(l[0]) && new Date(l[0]) <= new Date(r[1]))
|
|
100
|
+
], y = g), g.forEach((l, n) => {
|
|
101
101
|
_.push([l[1], l[4], l[3], l[2], n === 0 ? 0 : g[n - 1][4], l[6]]), F.push(l[0]);
|
|
102
102
|
});
|
|
103
103
|
let s = [], m = [];
|
|
104
|
-
const
|
|
104
|
+
const v = {
|
|
105
105
|
time: [],
|
|
106
106
|
open: [],
|
|
107
107
|
close: [],
|
|
108
108
|
high: [],
|
|
109
109
|
low: [],
|
|
110
|
-
originData:
|
|
110
|
+
originData: y
|
|
111
111
|
};
|
|
112
112
|
let E = null, C = null;
|
|
113
|
-
return
|
|
114
|
-
|
|
113
|
+
return y.forEach((l, n) => {
|
|
114
|
+
v.time.push(l[0]), v.open.push(l[1]), v.close.push(l[4]), v.high.push(l[2]), v.low.push(l[3]), l[0] === g[0][0] && (E = n), l[0] === g[g.length - 1][0] && (C = n + 1);
|
|
115
115
|
}), s = e.find(({ value: l }) => l === d).config.map((l) => {
|
|
116
116
|
const { calculationFn: n } = l;
|
|
117
117
|
return {
|
|
118
118
|
...l,
|
|
119
|
-
data: n ? n(z,
|
|
119
|
+
data: n ? n(z, v, { time: [], open: [], close: [], high: [], low: [], originData: [] }).slice(E, C) : []
|
|
120
120
|
};
|
|
121
121
|
}), m = t.find(({ value: l }) => l === i).config.reduce((l, n) => {
|
|
122
|
-
const { source:
|
|
123
|
-
return
|
|
122
|
+
const { source: I, calculationFn: V } = n;
|
|
123
|
+
return I === "calculation" ? [
|
|
124
124
|
...l,
|
|
125
125
|
{
|
|
126
126
|
...n,
|
|
127
|
-
data: V ? V(z,
|
|
127
|
+
data: V ? V(z, v).slice(E, C) : []
|
|
128
128
|
}
|
|
129
129
|
] : l;
|
|
130
130
|
}, []), {
|
|
@@ -142,14 +142,14 @@ const oe = /* @__PURE__ */ R({
|
|
|
142
142
|
formatDataByCount: (f) => {
|
|
143
143
|
const { originDrawData: c, addData: o, mainIndicator: u, mainIndicatorList: p, subIndicator: d, subIndicatorList: e, config: i } = f;
|
|
144
144
|
let t = {};
|
|
145
|
-
const { addCount: a, preLoadCount: r } = i, x = [],
|
|
146
|
-
let
|
|
147
|
-
const m = o.filter((n,
|
|
148
|
-
|
|
149
|
-
const
|
|
145
|
+
const { addCount: a, preLoadCount: r } = i, x = [], k = [], g = [], _ = [], F = [];
|
|
146
|
+
let y = [], s = [];
|
|
147
|
+
const m = o.filter((n, I) => (x.push(n[0]), k.push(n[1]), g.push(n[4]), _.push(n[2]), F.push(n[3]), y.push(n[0]), s.push([n[1], n[4], n[3], n[2], I === 0 ? 0 : o[I - 1][4], n[6]]), o.length >= a + r - 1 ? I >= r : !0));
|
|
148
|
+
y = b(y, m.length), s = b(s, m.length);
|
|
149
|
+
const v = { time: x, open: k, close: g, high: _, low: F, originData: o }, C = p.find((n) => n.value === u).config.map((n) => ({
|
|
150
150
|
...n,
|
|
151
|
-
data:
|
|
152
|
-
n.calculationFn ? n.calculationFn(z,
|
|
151
|
+
data: b(
|
|
152
|
+
n.calculationFn ? n.calculationFn(z, v, {
|
|
153
153
|
time: [],
|
|
154
154
|
open: [],
|
|
155
155
|
close: [],
|
|
@@ -157,40 +157,40 @@ const oe = /* @__PURE__ */ R({
|
|
|
157
157
|
low: [],
|
|
158
158
|
originData: []
|
|
159
159
|
}) : [],
|
|
160
|
-
|
|
160
|
+
y.length
|
|
161
161
|
)
|
|
162
162
|
}));
|
|
163
163
|
let l = [];
|
|
164
|
-
return d && e && (l = e.find((
|
|
165
|
-
...
|
|
164
|
+
return d && e && (l = e.find((I) => I.value === d).config.reduce((I, V) => V.source === "calculation" ? [
|
|
165
|
+
...I,
|
|
166
166
|
{
|
|
167
167
|
...V,
|
|
168
|
-
data:
|
|
169
|
-
V.calculationFn ? V.calculationFn(z,
|
|
170
|
-
|
|
168
|
+
data: b(
|
|
169
|
+
V.calculationFn ? V.calculationFn(z, v) : [],
|
|
170
|
+
y.length
|
|
171
171
|
)
|
|
172
172
|
}
|
|
173
|
-
] :
|
|
173
|
+
] : I, [])), c.length ? t = {
|
|
174
174
|
originData: [...m, ...c.originData],
|
|
175
175
|
// 原数据
|
|
176
|
-
xAxisData: [...
|
|
176
|
+
xAxisData: [...y, ...c.xAxisData],
|
|
177
177
|
// 时间数据
|
|
178
178
|
candlestickData: [...s, ...c.candlestickData],
|
|
179
179
|
// k线数据
|
|
180
|
-
mainIndicatorData: c.mainIndicatorData.map((n,
|
|
180
|
+
mainIndicatorData: c.mainIndicatorData.map((n, I) => ({
|
|
181
181
|
...n,
|
|
182
|
-
data: [...C[
|
|
182
|
+
data: [...C[I].data, ...n.data]
|
|
183
183
|
})),
|
|
184
184
|
// 主图指标线数据
|
|
185
|
-
subIndicatorData: c.subIndicatorData.map((n,
|
|
185
|
+
subIndicatorData: c.subIndicatorData.map((n, I) => ({
|
|
186
186
|
...n,
|
|
187
|
-
data: [...l[
|
|
187
|
+
data: [...l[I].data, ...n.data]
|
|
188
188
|
}))
|
|
189
189
|
// 副图数据
|
|
190
190
|
} : t = {
|
|
191
191
|
originData: m,
|
|
192
192
|
// 原数据
|
|
193
|
-
xAxisData:
|
|
193
|
+
xAxisData: y,
|
|
194
194
|
// 时间数据
|
|
195
195
|
candlestickData: s,
|
|
196
196
|
// k线数据
|
|
@@ -213,10 +213,10 @@ const oe = /* @__PURE__ */ R({
|
|
|
213
213
|
require: !0
|
|
214
214
|
}
|
|
215
215
|
},
|
|
216
|
-
setup(
|
|
217
|
-
return (
|
|
218
|
-
(T(!0), L(K, null, Z(
|
|
219
|
-
key:
|
|
216
|
+
setup(w) {
|
|
217
|
+
return (A, S) => (T(), L("div", re, [
|
|
218
|
+
(T(!0), L(K, null, Z(w.data, (h, D) => (T(), L("div", {
|
|
219
|
+
key: D,
|
|
220
220
|
class: "kline-tips-item",
|
|
221
221
|
style: H({ color: h.color })
|
|
222
222
|
}, N(h.label) + " " + N(h.value), 5))), 128))
|
|
@@ -248,28 +248,28 @@ const M = /* @__PURE__ */ q(ie, [["__scopeId", "data-v-2a02e841"]]), le = { clas
|
|
|
248
248
|
require: !0
|
|
249
249
|
}
|
|
250
250
|
},
|
|
251
|
-
setup(
|
|
252
|
-
const { round:
|
|
251
|
+
setup(w) {
|
|
252
|
+
const { round: A, multiply: S, divide: h, subtract: D, formatValue: b } = G, f = w, c = $(() => {
|
|
253
253
|
const { drawData: u, activeIndex: p, candlestickData: d } = f;
|
|
254
254
|
if (d != null && d.length && d[p]) {
|
|
255
255
|
let e;
|
|
256
256
|
return d[p][6] > 0 ? e = "red" : d[p][6] < 0 && (e = "green"), [
|
|
257
|
-
{ label: "开", value:
|
|
258
|
-
{ label: "高", value:
|
|
259
|
-
{ label: "低", value:
|
|
260
|
-
{ label: "收", value:
|
|
261
|
-
{ label: "额", value:
|
|
262
|
-
{ label: "涨跌", value: `${
|
|
257
|
+
{ label: "开", value: d[p][0] },
|
|
258
|
+
{ label: "高", value: d[p][3] },
|
|
259
|
+
{ label: "低", value: d[p][2] },
|
|
260
|
+
{ label: "收", value: d[p][1] },
|
|
261
|
+
{ label: "额", value: b(d[p][4]) },
|
|
262
|
+
{ label: "涨跌", value: `${A(d[p][6])}%`, color: e }
|
|
263
263
|
];
|
|
264
264
|
} else if (u.candlestickData && u.candlestickData[p]) {
|
|
265
265
|
const e = u.candlestickData[p], i = [
|
|
266
|
-
{ label: "开", value:
|
|
267
|
-
{ label: "高", value:
|
|
268
|
-
{ label: "低", value:
|
|
269
|
-
{ label: "收", value:
|
|
266
|
+
{ label: "开", value: e[0] },
|
|
267
|
+
{ label: "高", value: e[3] },
|
|
268
|
+
{ label: "低", value: e[2] },
|
|
269
|
+
{ label: "收", value: e[1] }
|
|
270
270
|
];
|
|
271
|
-
e[5] !== void 0 && i.push({ label: "额", value:
|
|
272
|
-
const t =
|
|
271
|
+
e[5] !== void 0 && i.push({ label: "额", value: b(e[5]) });
|
|
272
|
+
const t = A(S(h(D(e[1], e[4]), Math.abs(e[4])), 100));
|
|
273
273
|
let a;
|
|
274
274
|
return t > 0 ? a = "red" : t < 0 && (a = "green"), i.push({ label: "涨跌", value: `${t}%`, color: a }), i;
|
|
275
275
|
}
|
|
@@ -277,7 +277,7 @@ const M = /* @__PURE__ */ q(ie, [["__scopeId", "data-v-2a02e841"]]), le = { clas
|
|
|
277
277
|
}), o = $(() => {
|
|
278
278
|
var d;
|
|
279
279
|
const { drawData: u, activeIndex: p } = f;
|
|
280
|
-
return ((d = u == null ? void 0 : u.mainIndicatorData) == null ? void 0 : d.map((e) => ({ label: e.key, value:
|
|
280
|
+
return ((d = u == null ? void 0 : u.mainIndicatorData) == null ? void 0 : d.map((e) => ({ label: e.key, value: A(e.data[p]), color: e.color }))) || [];
|
|
281
281
|
});
|
|
282
282
|
return (u, p) => (T(), L("div", le, [
|
|
283
283
|
O(M, { data: c.value }, null, 8, ["data"]),
|
|
@@ -285,7 +285,7 @@ const M = /* @__PURE__ */ q(ie, [["__scopeId", "data-v-2a02e841"]]), le = { clas
|
|
|
285
285
|
]));
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
|
-
const ce = /* @__PURE__ */ q(se, [["__scopeId", "data-v-
|
|
288
|
+
const ce = /* @__PURE__ */ q(se, [["__scopeId", "data-v-e75a1234"]]), ue = { class: "klineSub" }, de = { class: "klineSub-tips" }, pe = {
|
|
289
289
|
key: 0,
|
|
290
290
|
class: "klineSub-tips-select"
|
|
291
291
|
}, fe = /* @__PURE__ */ R({
|
|
@@ -301,10 +301,10 @@ const ce = /* @__PURE__ */ q(se, [["__scopeId", "data-v-234f3f41"]]), ue = { cla
|
|
|
301
301
|
// 配置
|
|
302
302
|
},
|
|
303
303
|
emits: ["update:modelValue"],
|
|
304
|
-
setup(
|
|
304
|
+
setup(w, { expose: A, emit: S }) {
|
|
305
305
|
const { round: h } = G;
|
|
306
|
-
let
|
|
307
|
-
const f = S, c =
|
|
306
|
+
let D, b;
|
|
307
|
+
const f = S, c = w, o = j(), u = $({
|
|
308
308
|
get() {
|
|
309
309
|
return c.modelValue;
|
|
310
310
|
},
|
|
@@ -314,9 +314,9 @@ const ce = /* @__PURE__ */ q(se, [["__scopeId", "data-v-234f3f41"]]), ue = { cla
|
|
|
314
314
|
}), p = $(() => {
|
|
315
315
|
const { drawData: e, activeIndex: i } = c, t = c.subIndicatorList.find((a) => a.value === u.value);
|
|
316
316
|
return e.originData && e.originData[i] ? t.config.map((a) => {
|
|
317
|
-
var x,
|
|
317
|
+
var x, k;
|
|
318
318
|
let r = "-";
|
|
319
|
-
return a.source === "origin" ? r = e.originData[i][a.dataIndex] || "-" : a.source === "calculation" && (r = (((
|
|
319
|
+
return a.source === "origin" ? r = e.originData[i][a.dataIndex] || "-" : a.source === "calculation" && (r = (((k = (x = e.subIndicatorData) == null ? void 0 : x.find((_) => _.key === a.key)) == null ? void 0 : k.data) || [])[i]), {
|
|
320
320
|
label: a.key,
|
|
321
321
|
color: a.color,
|
|
322
322
|
value: r === "-" ? r : h(r)
|
|
@@ -324,17 +324,17 @@ const ce = /* @__PURE__ */ q(se, [["__scopeId", "data-v-234f3f41"]]), ue = { cla
|
|
|
324
324
|
}) : [];
|
|
325
325
|
});
|
|
326
326
|
U(() => {
|
|
327
|
-
|
|
327
|
+
D = B.init(o.value);
|
|
328
328
|
let e = !0;
|
|
329
|
-
|
|
329
|
+
b = new ResizeObserver(() => {
|
|
330
330
|
if (e) {
|
|
331
331
|
e = null;
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
|
-
|
|
335
|
-
}),
|
|
334
|
+
D.resize();
|
|
335
|
+
}), b.observe(o.value);
|
|
336
336
|
}), Y(() => {
|
|
337
|
-
|
|
337
|
+
D.dispose(), b.disconnect(), b = null;
|
|
338
338
|
});
|
|
339
339
|
const d = (e, i) => {
|
|
340
340
|
const t = e[i], a = i === 0 ? e[i] : e[i - 1];
|
|
@@ -350,27 +350,27 @@ const ce = /* @__PURE__ */ q(se, [["__scopeId", "data-v-234f3f41"]]), ue = { cla
|
|
|
350
350
|
color: "#00FFFF"
|
|
351
351
|
};
|
|
352
352
|
};
|
|
353
|
-
return
|
|
353
|
+
return A({
|
|
354
354
|
connect: (e) => {
|
|
355
|
-
B.connect([e,
|
|
355
|
+
B.connect([e, D]);
|
|
356
356
|
},
|
|
357
357
|
// 联动
|
|
358
358
|
draw: (e) => {
|
|
359
359
|
J(() => {
|
|
360
|
-
var
|
|
361
|
-
const { startValue: i, endValue: t, maxValueSpan: a } = e, { xAxisData: r, subIndicatorData: x, candlestickData:
|
|
360
|
+
var y;
|
|
361
|
+
const { startValue: i, endValue: t, maxValueSpan: a } = e, { xAxisData: r, subIndicatorData: x, candlestickData: k, originData: g } = c.drawData, _ = c.subIndicatorList.find((s) => s.value === u.value), F = [];
|
|
362
362
|
if (_.series === "bar") {
|
|
363
363
|
let s = [];
|
|
364
|
-
_.source === "origin" ? s = g.map((m) => m[_.dataIndex]) : s = ((
|
|
364
|
+
_.source === "origin" ? s = g.map((m) => m[_.dataIndex]) : s = ((y = x == null ? void 0 : x.find((m) => m.key === _.dataIndex)) == null ? void 0 : y.data) || [], F.push({
|
|
365
365
|
name: "subMain",
|
|
366
366
|
xAxisIndex: 0,
|
|
367
367
|
yAxisIndex: 1,
|
|
368
368
|
type: "bar",
|
|
369
369
|
silent: !0,
|
|
370
370
|
symbol: "none",
|
|
371
|
-
data: s.map((m,
|
|
371
|
+
data: s.map((m, v) => _.color === "kline" ? {
|
|
372
372
|
value: m,
|
|
373
|
-
itemStyle: d(
|
|
373
|
+
itemStyle: d(k, v)
|
|
374
374
|
} : _.color === "value" ? {
|
|
375
375
|
value: m,
|
|
376
376
|
itemStyle: {
|
|
@@ -387,7 +387,7 @@ const ce = /* @__PURE__ */ q(se, [["__scopeId", "data-v-234f3f41"]]), ue = { cla
|
|
|
387
387
|
x.forEach((s) => {
|
|
388
388
|
if (s.series === "line") {
|
|
389
389
|
let m = [];
|
|
390
|
-
s.source === "origin" ? m = g.map((
|
|
390
|
+
s.source === "origin" ? m = g.map((v) => v[s.dataIndex]) : s.source === "calculation" && (m = s.data), F.push({
|
|
391
391
|
xAxisIndex: 0,
|
|
392
392
|
yAxisIndex: s.yAxis === "right" ? 2 : 1,
|
|
393
393
|
name: s.key,
|
|
@@ -403,7 +403,7 @@ const ce = /* @__PURE__ */ q(se, [["__scopeId", "data-v-234f3f41"]]), ue = { cla
|
|
|
403
403
|
}
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
|
-
}),
|
|
406
|
+
}), D.setOption(
|
|
407
407
|
{
|
|
408
408
|
animation: !1,
|
|
409
409
|
grid: {
|
|
@@ -429,11 +429,11 @@ const ce = /* @__PURE__ */ q(se, [["__scopeId", "data-v-234f3f41"]]), ue = { cla
|
|
|
429
429
|
label: {
|
|
430
430
|
rich: {},
|
|
431
431
|
formatter: (s) => {
|
|
432
|
-
const { axisDimension: m, value:
|
|
432
|
+
const { axisDimension: m, value: v } = s;
|
|
433
433
|
if (m === "x")
|
|
434
|
-
return
|
|
434
|
+
return v;
|
|
435
435
|
if (s.axisIndex === 1)
|
|
436
|
-
return String(h(
|
|
436
|
+
return String(h(v));
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
},
|
|
@@ -509,7 +509,7 @@ const ce = /* @__PURE__ */ q(se, [["__scopeId", "data-v-234f3f41"]]), ue = { cla
|
|
|
509
509
|
class: "element-dark subIndicator"
|
|
510
510
|
}, {
|
|
511
511
|
default: Q(() => [
|
|
512
|
-
(T(!0), L(K, null, Z(
|
|
512
|
+
(T(!0), L(K, null, Z(w.subIndicatorList, (r) => (T(), W(t, {
|
|
513
513
|
key: r.value,
|
|
514
514
|
label: r.label,
|
|
515
515
|
value: r.value
|
|
@@ -536,9 +536,9 @@ const he = /* @__PURE__ */ q(fe, [["__scopeId", "data-v-0a2f256e"]]), me = /* @_
|
|
|
536
536
|
// 时间数据
|
|
537
537
|
},
|
|
538
538
|
emits: ["change"],
|
|
539
|
-
setup(
|
|
540
|
-
let h,
|
|
541
|
-
const f = S, c =
|
|
539
|
+
setup(w, { expose: A, emit: S }) {
|
|
540
|
+
let h, D, b = null;
|
|
541
|
+
const f = S, c = w, o = j();
|
|
542
542
|
ee(
|
|
543
543
|
() => c.data,
|
|
544
544
|
() => {
|
|
@@ -548,21 +548,21 @@ const he = /* @__PURE__ */ q(fe, [["__scopeId", "data-v-0a2f256e"]]), me = /* @_
|
|
|
548
548
|
), U(() => {
|
|
549
549
|
h = B.init(o.value), u(), d();
|
|
550
550
|
let e = !0;
|
|
551
|
-
|
|
551
|
+
D = new ResizeObserver(() => {
|
|
552
552
|
if (e) {
|
|
553
553
|
e = null;
|
|
554
554
|
return;
|
|
555
555
|
}
|
|
556
556
|
h.resize();
|
|
557
|
-
}),
|
|
557
|
+
}), D.observe(o.value);
|
|
558
558
|
}), Y(() => {
|
|
559
|
-
h.off("datazoom"), h.dispose(),
|
|
559
|
+
h.off("datazoom"), h.dispose(), D.disconnect(), D = null;
|
|
560
560
|
});
|
|
561
561
|
const u = () => {
|
|
562
562
|
h.on("datazoom", (e) => {
|
|
563
|
-
e.dataZoomId && (clearTimeout(
|
|
563
|
+
e.dataZoomId && (clearTimeout(b), b = setTimeout(() => {
|
|
564
564
|
const { data: i } = c, { start: t, end: a } = e, r = Math.floor(t * i.length / 100), x = a === 100 ? i.length - 1 : Math.floor(a * i.length / 100);
|
|
565
|
-
p(r, x), clearTimeout(
|
|
565
|
+
p(r, x), clearTimeout(b);
|
|
566
566
|
}, 100));
|
|
567
567
|
});
|
|
568
568
|
}, p = (e, i) => {
|
|
@@ -601,11 +601,11 @@ const he = /* @__PURE__ */ q(fe, [["__scopeId", "data-v-0a2f256e"]]), me = /* @_
|
|
|
601
601
|
]
|
|
602
602
|
}, !0);
|
|
603
603
|
};
|
|
604
|
-
return
|
|
604
|
+
return A({
|
|
605
605
|
resetSlide: (e, i, t) => {
|
|
606
606
|
let a = -1, r = -1;
|
|
607
|
-
c.data.forEach((x,
|
|
608
|
-
a === -1 && x[0] === e ? a =
|
|
607
|
+
c.data.forEach((x, k) => {
|
|
608
|
+
a === -1 && x[0] === e ? a = k : a === -1 && new Date(x[0]) > new Date(e) && (a = k - 1), (r === -1 && x[0] === i || r === -1 && new Date(x[0]) > new Date(i)) && (r = k);
|
|
609
609
|
}), r = r === -1 ? c.data.length - 1 : r, h.setOption({
|
|
610
610
|
dataZoom: [
|
|
611
611
|
{
|
|
@@ -638,8 +638,8 @@ const he = /* @__PURE__ */ q(fe, [["__scopeId", "data-v-0a2f256e"]]), me = /* @_
|
|
|
638
638
|
}
|
|
639
639
|
});
|
|
640
640
|
const ge = /* @__PURE__ */ q(me, [["__scopeId", "data-v-5008746a"]]), qe = {
|
|
641
|
-
install(
|
|
642
|
-
|
|
641
|
+
install(w) {
|
|
642
|
+
w.component("st-klineUtils", oe), w.component("st-klineSub", he), w.component("st-klineTips", ce), w.component("st-klineSlide", ge);
|
|
643
643
|
}
|
|
644
644
|
};
|
|
645
645
|
export {
|