@363045841yyt/klinechart 0.7.5 → 0.7.6
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/dist/components/DrawingStyleToolbar.vue.d.ts +1 -15
- package/dist/components/DrawingStyleToolbar.vue.d.ts.map +1 -1
- package/dist/components/IndicatorParams.vue.d.ts.map +1 -1
- package/dist/components/IndicatorSelector.vue.d.ts.map +1 -1
- package/dist/components/KLineChart.vue.d.ts +5 -6
- package/dist/components/KLineChart.vue.d.ts.map +1 -1
- package/dist/components/KLineTooltip.vue.d.ts +1 -1
- package/dist/components/KLineTooltip.vue.d.ts.map +1 -1
- package/dist/components/MarkerTooltip.vue.d.ts +1 -12
- package/dist/components/MarkerTooltip.vue.d.ts.map +1 -1
- package/dist/composables/useFullscreenTeleportTarget.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/{klinechart.css → index.css} +1 -2
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +544 -617
- package/dist/version.d.ts +1 -1
- package/dist/web-component.d.ts +18 -0
- package/dist/web-component.d.ts.map +1 -0
- package/package.json +10 -2
- package/src/__tests__/_mockController.ts +11 -1
- package/src/components/DrawingStyleToolbar.vue +1 -14
- package/src/components/IndicatorParams.vue +2 -1
- package/src/components/IndicatorSelector.vue +3 -5
- package/src/components/KLineChart.vue +198 -428
- package/src/components/KLineTooltip.vue +2 -2
- package/src/components/MarkerTooltip.vue +1 -12
- package/src/composables/useFullscreenTeleportTarget.ts +0 -2
- package/src/web-component.ts +14 -0
package/dist/index.js
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, effectScope as d, h as f, inject as p, markRaw as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as
|
|
1
|
+
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, effectScope as d, h as f, inject as p, markRaw as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as ee, onScopeDispose as y, onUnmounted as b, openBlock as x, provide as S, ref as C, renderList as w, resolveDynamicComponent as T, shallowRef as E, toDisplayString as D, unref as O, vModelCheckbox as k, vModelSelect as A, watch as j, withCtx as M, withDirectives as N, withModifiers as P } from "vue";
|
|
2
2
|
import { VERSION as F, createChartController as I, createIndicatorSelectorController as L } from "@363045841yyt/klinechart-core";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Chart as H } from "@363045841yyt/klinechart-core/engine/chart";
|
|
7
|
-
import { createChartStore as ne } from "@363045841yyt/klinechart-core/engine/chart-store";
|
|
8
|
-
import { kGapFromKWidth as U, zoomLevelToKWidth as re } from "@363045841yyt/klinechart-core/engine/utils/zoom";
|
|
9
|
-
import { getPhysicalKLineConfig as W } from "@363045841yyt/klinechart-core/engine/utils/klineConfig";
|
|
10
|
-
import { SUB_PANE_INDICATORS as ie, SUB_PANE_INDICATOR_CONFIGS as ae } from "@363045841yyt/klinechart-core/engine/renderers/Indicator/subPaneConfig";
|
|
11
|
-
import { createPaneTitleRendererPlugin as oe } from "@363045841yyt/klinechart-core/engine/renderers/paneTitle";
|
|
12
|
-
import { DEFAULT_SETTINGS as G, SETTINGS_STORAGE_KEY as se } from "@363045841yyt/klinechart-core/config";
|
|
13
|
-
import { DrawingInteractionController as ce } from "@363045841yyt/klinechart-core/engine/drawing";
|
|
3
|
+
import { DrawingInteractionController as te, SUB_PANE_INDICATORS as R, SUB_PANE_INDICATOR_CONFIGS as ne, allIndicators as re, createChartController as z, createIndicatorSelectorController as B, findIndicator as ie, getPhysicalKLineConfig as ae, isSubIndicatorId as V, kGapFromKWidth as H, zoomLevelToKWidth as oe } from "@363045841yyt/klinechart-core/controllers";
|
|
4
|
+
import { SemanticChartController as se, __setDataFetcher as ce } from "@363045841yyt/klinechart-core/semantic";
|
|
5
|
+
import { DEFAULT_SETTINGS as U, SETTINGS_STORAGE_KEY as le } from "@363045841yyt/klinechart-core/config";
|
|
14
6
|
//#region src/components/DrawingStyleToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
15
|
-
var
|
|
7
|
+
var ue = {
|
|
16
8
|
class: "toolbar-item color-item",
|
|
17
9
|
title: "颜色"
|
|
18
|
-
},
|
|
10
|
+
}, de = ["value"], W = ["value"], G = ["value"], K = /* @__PURE__ */ u({
|
|
19
11
|
__name: "DrawingStyleToolbar",
|
|
20
12
|
props: { drawing: {} },
|
|
21
13
|
emits: ["updateStyle", "delete"],
|
|
@@ -24,7 +16,7 @@ var le = {
|
|
|
24
16
|
function r(e) {
|
|
25
17
|
e.key === "Delete" && (e.preventDefault(), n("delete"));
|
|
26
18
|
}
|
|
27
|
-
|
|
19
|
+
ee(() => document.addEventListener("keydown", r)), b(() => document.removeEventListener("keydown", r));
|
|
28
20
|
function i(e) {
|
|
29
21
|
n("updateStyle", { stroke: e });
|
|
30
22
|
}
|
|
@@ -34,13 +26,13 @@ var le = {
|
|
|
34
26
|
function c(e) {
|
|
35
27
|
n("updateStyle", { strokeStyle: e });
|
|
36
28
|
}
|
|
37
|
-
return (t, n) => (
|
|
29
|
+
return (t, n) => (x(), o("div", {
|
|
38
30
|
class: "drawing-style-toolbar",
|
|
39
31
|
onPointerdown: n[4] ||= P(() => {}, ["stop"]),
|
|
40
32
|
onPointermove: n[5] ||= P(() => {}, ["stop"]),
|
|
41
33
|
onPointerup: n[6] ||= P(() => {}, ["stop"])
|
|
42
34
|
}, [
|
|
43
|
-
s("div",
|
|
35
|
+
s("div", ue, [s("span", {
|
|
44
36
|
class: "color-swatch",
|
|
45
37
|
style: _({ background: e.drawing.style.stroke ?? "#2962ff" })
|
|
46
38
|
}, null, 4), s("input", {
|
|
@@ -48,7 +40,7 @@ var le = {
|
|
|
48
40
|
class: "color-input",
|
|
49
41
|
value: e.drawing.style.stroke ?? "#2962ff",
|
|
50
42
|
onInput: n[0] ||= (e) => i(e.target.value)
|
|
51
|
-
}, null, 40,
|
|
43
|
+
}, null, 40, de)]),
|
|
52
44
|
s("select", {
|
|
53
45
|
class: "toolbar-select",
|
|
54
46
|
value: e.drawing.style.strokeWidth ?? 1,
|
|
@@ -59,7 +51,7 @@ var le = {
|
|
|
59
51
|
s("option", { value: 2 }, "2px", -1),
|
|
60
52
|
s("option", { value: 3 }, "3px", -1),
|
|
61
53
|
s("option", { value: 4 }, "4px", -1)
|
|
62
|
-
]], 40,
|
|
54
|
+
]], 40, W),
|
|
63
55
|
s("select", {
|
|
64
56
|
class: "toolbar-select",
|
|
65
57
|
value: e.drawing.style.strokeStyle ?? "solid",
|
|
@@ -69,7 +61,7 @@ var le = {
|
|
|
69
61
|
s("option", { value: "solid" }, "实线", -1),
|
|
70
62
|
s("option", { value: "dashed" }, "虚线", -1),
|
|
71
63
|
s("option", { value: "dotted" }, "点线", -1)
|
|
72
|
-
]], 40,
|
|
64
|
+
]], 40, G),
|
|
73
65
|
s("button", {
|
|
74
66
|
type: "button",
|
|
75
67
|
class: "toolbar-btn delete-btn",
|
|
@@ -95,22 +87,32 @@ var le = {
|
|
|
95
87
|
let n = e.__vccOpts || e;
|
|
96
88
|
for (let [e, r] of t) n[e] = r;
|
|
97
89
|
return n;
|
|
98
|
-
},
|
|
90
|
+
}, fe = /* @__PURE__ */ q(K, [["__scopeId", "data-v-a2cb0547"]]), pe = Symbol("fullscreen-teleport-target");
|
|
91
|
+
function me(e) {
|
|
92
|
+
S(pe, e);
|
|
93
|
+
}
|
|
94
|
+
function J() {
|
|
95
|
+
let e = p(pe, null);
|
|
96
|
+
return r(() => e?.value ?? "body");
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/IndicatorParams.vue?vue&type=script&setup=true&lang.ts
|
|
100
|
+
var Y = { class: "params-header" }, he = { class: "header-left" }, ge = { class: "params-title" }, _e = { class: "header-right" }, ve = {
|
|
99
101
|
key: 0,
|
|
100
102
|
class: "indicator-description"
|
|
101
|
-
},
|
|
103
|
+
}, ye = { class: "params-body" }, be = { class: "param-header" }, xe = { class: "param-label" }, Se = { class: "param-label-text" }, Ce = {
|
|
102
104
|
key: 0,
|
|
103
105
|
class: "param-range"
|
|
104
|
-
},
|
|
106
|
+
}, we = { class: "input-wrapper" }, Te = ["disabled", "onClick"], Ee = [
|
|
105
107
|
"value",
|
|
106
108
|
"min",
|
|
107
109
|
"max",
|
|
108
110
|
"step",
|
|
109
111
|
"onInput"
|
|
110
|
-
],
|
|
112
|
+
], De = ["disabled", "onClick"], Oe = {
|
|
111
113
|
key: 0,
|
|
112
114
|
class: "param-description"
|
|
113
|
-
},
|
|
115
|
+
}, ke = { class: "params-footer" }, Ae = { class: "footer-right" }, je = /* @__PURE__ */ q(/* @__PURE__ */ u({
|
|
114
116
|
__name: "IndicatorParams",
|
|
115
117
|
props: {
|
|
116
118
|
visible: { type: Boolean },
|
|
@@ -121,53 +123,53 @@ var le = {
|
|
|
121
123
|
values: {}
|
|
122
124
|
},
|
|
123
125
|
emits: ["close", "confirm"],
|
|
124
|
-
setup(
|
|
125
|
-
let
|
|
126
|
-
j(() =>
|
|
127
|
-
|
|
126
|
+
setup(r, { emit: u }) {
|
|
127
|
+
let d = r, f = u, p = C({ ...d.values }), m = C(!0), h = J();
|
|
128
|
+
j(() => d.values, (e) => {
|
|
129
|
+
p.value = { ...e };
|
|
128
130
|
}, {
|
|
129
131
|
deep: !0,
|
|
130
132
|
immediate: !0
|
|
131
|
-
}), j(() =>
|
|
132
|
-
e && (
|
|
133
|
+
}), j(() => d.visible, (e) => {
|
|
134
|
+
e && (p.value = { ...d.values });
|
|
133
135
|
});
|
|
134
|
-
function
|
|
136
|
+
function _(e, t) {
|
|
135
137
|
let n = t.target, r = parseFloat(n.value);
|
|
136
|
-
isNaN(r) || (
|
|
138
|
+
isNaN(r) || (p.value[e] = r);
|
|
137
139
|
}
|
|
138
|
-
function
|
|
139
|
-
let n = e.step || 1, r = (
|
|
140
|
-
e.min !== void 0 && (r = Math.max(e.min, r)), e.max !== void 0 && (r = Math.min(e.max, r)),
|
|
140
|
+
function v(e, t) {
|
|
141
|
+
let n = e.step || 1, r = (p.value[e.key] || 0) + t * n;
|
|
142
|
+
e.min !== void 0 && (r = Math.max(e.min, r)), e.max !== void 0 && (r = Math.min(e.max, r)), p.value[e.key] = parseFloat(r.toFixed(10));
|
|
141
143
|
}
|
|
142
|
-
function
|
|
144
|
+
function ee() {
|
|
143
145
|
let e = {};
|
|
144
|
-
|
|
145
|
-
e[t.key] = t.default ??
|
|
146
|
-
}),
|
|
146
|
+
d.params.forEach((t) => {
|
|
147
|
+
e[t.key] = t.default ?? d.values[t.key] ?? 0;
|
|
148
|
+
}), p.value = e;
|
|
147
149
|
}
|
|
148
|
-
function
|
|
149
|
-
|
|
150
|
+
function y() {
|
|
151
|
+
f("confirm", { ...p.value });
|
|
150
152
|
}
|
|
151
|
-
return (
|
|
152
|
-
default: M(() => [
|
|
153
|
+
return (u, d) => (x(), i(t, { to: O(h) }, [l(n, { name: "overlay" }, {
|
|
154
|
+
default: M(() => [r.visible ? (x(), o("div", {
|
|
153
155
|
key: 0,
|
|
154
156
|
class: "params-overlay",
|
|
155
|
-
onClick: d[4] ||= (e) =>
|
|
157
|
+
onClick: d[4] ||= (e) => u.$emit("close")
|
|
156
158
|
}, [l(n, { name: "modal" }, {
|
|
157
159
|
default: M(() => [s("div", {
|
|
158
160
|
class: "indicator-params",
|
|
159
161
|
onClick: d[3] ||= P(() => {}, ["stop"])
|
|
160
162
|
}, [
|
|
161
|
-
s("div",
|
|
162
|
-
class: g(["toggle-desc-btn", { active:
|
|
163
|
-
onClick: d[0] ||= (e) =>
|
|
163
|
+
s("div", Y, [s("div", he, [s("span", ge, D(r.indicatorName), 1), d[5] ||= s("span", { class: "params-subtitle" }, "参数设置", -1)]), s("div", _e, [s("button", {
|
|
164
|
+
class: g(["toggle-desc-btn", { active: m.value }]),
|
|
165
|
+
onClick: d[0] ||= (e) => m.value = !m.value,
|
|
164
166
|
title: "显示/隐藏说明"
|
|
165
167
|
}, [...d[6] ||= [s("svg", { viewBox: "0 0 1024 1024" }, [s("path", {
|
|
166
168
|
d: "M512 97.52381c228.912762 0 414.47619 185.563429 414.47619 414.47619s-185.563429 414.47619-414.47619 414.47619S97.52381 740.912762 97.52381 512 283.087238 97.52381 512 97.52381z m0 73.142857C323.486476 170.666667 170.666667 323.486476 170.666667 512s152.81981 341.333333 341.333333 341.333333 341.333333-152.81981 341.333333-341.333333S700.513524 170.666667 512 170.666667z m36.571429 268.190476v292.571428h-73.142858V438.857143h73.142858z m0-121.904762v73.142857h-73.142858v-73.142857h73.142858z",
|
|
167
169
|
fill: "currentColor"
|
|
168
170
|
})], -1)]], 2), s("button", {
|
|
169
171
|
class: "params-close",
|
|
170
|
-
onClick: d[1] ||= (e) =>
|
|
172
|
+
onClick: d[1] ||= (e) => u.$emit("close")
|
|
171
173
|
}, [...d[7] ||= [s("svg", {
|
|
172
174
|
viewBox: "0 0 24 24",
|
|
173
175
|
fill: "none",
|
|
@@ -175,51 +177,51 @@ var le = {
|
|
|
175
177
|
"stroke-width": "2"
|
|
176
178
|
}, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
|
|
177
179
|
l(n, { name: "slide" }, {
|
|
178
|
-
default: M(() => [
|
|
180
|
+
default: M(() => [m.value && r.indicatorDescription ? (x(), o("div", ve, [s("p", null, D(r.indicatorDescription), 1)])) : a("", !0)]),
|
|
179
181
|
_: 1
|
|
180
182
|
}),
|
|
181
|
-
s("div",
|
|
183
|
+
s("div", ye, [(x(!0), o(e, null, w(r.params, (e) => (x(), o("div", {
|
|
182
184
|
key: e.key,
|
|
183
|
-
class: g(["param-item", { "has-desc":
|
|
184
|
-
}, [s("div",
|
|
185
|
+
class: g(["param-item", { "has-desc": m.value && e.description }])
|
|
186
|
+
}, [s("div", be, [s("label", xe, [s("span", Se, D(e.label), 1), e.min !== void 0 || e.max !== void 0 ? (x(), o("span", Ce, D(e.min ?? "-∞") + " ~ " + D(e.max ?? "+∞"), 1)) : a("", !0)]), s("div", we, [
|
|
185
187
|
s("button", {
|
|
186
188
|
class: "stepper-btn",
|
|
187
|
-
disabled: e.min !== void 0 && (
|
|
188
|
-
onClick: (t) =>
|
|
189
|
-
}, " − ", 8,
|
|
190
|
-
e.type === "number" ? (
|
|
189
|
+
disabled: e.min !== void 0 && (p.value[e.key] ?? 0) <= e.min,
|
|
190
|
+
onClick: (t) => v(e, -1)
|
|
191
|
+
}, " − ", 8, Te),
|
|
192
|
+
e.type === "number" ? (x(), o("input", {
|
|
191
193
|
key: 0,
|
|
192
194
|
type: "number",
|
|
193
195
|
class: "param-input",
|
|
194
|
-
value:
|
|
196
|
+
value: p.value[e.key],
|
|
195
197
|
min: e.min,
|
|
196
198
|
max: e.max,
|
|
197
199
|
step: e.step || 1,
|
|
198
|
-
onInput: (t) =>
|
|
199
|
-
}, null, 40,
|
|
200
|
+
onInput: (t) => _(e.key, t)
|
|
201
|
+
}, null, 40, Ee)) : a("", !0),
|
|
200
202
|
s("button", {
|
|
201
203
|
class: "stepper-btn",
|
|
202
|
-
disabled: e.max !== void 0 && (
|
|
203
|
-
onClick: (t) =>
|
|
204
|
-
}, " + ", 8,
|
|
204
|
+
disabled: e.max !== void 0 && (p.value[e.key] ?? 0) >= e.max,
|
|
205
|
+
onClick: (t) => v(e, 1)
|
|
206
|
+
}, " + ", 8, De)
|
|
205
207
|
])]), l(n, { name: "slide" }, {
|
|
206
|
-
default: M(() => [
|
|
208
|
+
default: M(() => [m.value && e.description ? (x(), o("div", Oe, D(e.description), 1)) : a("", !0)]),
|
|
207
209
|
_: 2
|
|
208
210
|
}, 1024)], 2))), 128))]),
|
|
209
|
-
s("div",
|
|
211
|
+
s("div", ke, [s("button", {
|
|
210
212
|
class: "params-btn reset",
|
|
211
|
-
onClick:
|
|
213
|
+
onClick: ee
|
|
212
214
|
}, [...d[8] ||= [s("svg", {
|
|
213
215
|
viewBox: "0 0 24 24",
|
|
214
216
|
fill: "none",
|
|
215
217
|
stroke: "currentColor",
|
|
216
218
|
"stroke-width": "2"
|
|
217
|
-
}, [s("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), s("path", { d: "M3 3v5h5" })], -1), c(" 重置 ", -1)]]), s("div",
|
|
219
|
+
}, [s("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), s("path", { d: "M3 3v5h5" })], -1), c(" 重置 ", -1)]]), s("div", Ae, [s("button", {
|
|
218
220
|
class: "params-btn cancel",
|
|
219
|
-
onClick: d[2] ||= (e) =>
|
|
221
|
+
onClick: d[2] ||= (e) => u.$emit("close")
|
|
220
222
|
}, "取消"), s("button", {
|
|
221
223
|
class: "params-btn confirm",
|
|
222
|
-
onClick:
|
|
224
|
+
onClick: y
|
|
223
225
|
}, [...d[9] ||= [s("svg", {
|
|
224
226
|
viewBox: "0 0 24 24",
|
|
225
227
|
fill: "none",
|
|
@@ -232,14 +234,7 @@ var le = {
|
|
|
232
234
|
_: 1
|
|
233
235
|
})], 8, ["to"]));
|
|
234
236
|
}
|
|
235
|
-
}), [["__scopeId", "data-v-
|
|
236
|
-
function je() {
|
|
237
|
-
let e = p(Ae, null);
|
|
238
|
-
return r(() => e?.value ?? "body");
|
|
239
|
-
}
|
|
240
|
-
//#endregion
|
|
241
|
-
//#region src/components/IndicatorSelector.vue?vue&type=script&setup=true&lang.ts
|
|
242
|
-
var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-container" }, Pe = { class: "indicator-list" }, Fe = {
|
|
237
|
+
}), [["__scopeId", "data-v-ea905f9b"]]), Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-container" }, Pe = { class: "indicator-list" }, Fe = {
|
|
243
238
|
key: 0,
|
|
244
239
|
class: "indicator-divider",
|
|
245
240
|
"aria-hidden": "true"
|
|
@@ -269,10 +264,10 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
269
264
|
width: "16",
|
|
270
265
|
height: "16",
|
|
271
266
|
fill: "currentColor"
|
|
272
|
-
}, Ze = { class: "modal-body" }, Qe = { class: "search-box" },
|
|
267
|
+
}, Ze = { class: "modal-body" }, Qe = { class: "search-box" }, X = ["value"], Z = {
|
|
273
268
|
key: 0,
|
|
274
269
|
class: "indicator-section"
|
|
275
|
-
},
|
|
270
|
+
}, $e = { class: "section-header" }, et = { class: "section-count" }, tt = ["onClick"], nt = { class: "card-label" }, rt = { class: "card-tooltip" }, it = { class: "card-header" }, at = { class: "card-label" }, ot = { class: "card-header-actions" }, st = ["onClick"], ct = { class: "card-name" }, lt = {
|
|
276
271
|
key: 1,
|
|
277
272
|
class: "section-divider"
|
|
278
273
|
}, ut = {
|
|
@@ -312,23 +307,23 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
312
307
|
}))
|
|
313
308
|
}));
|
|
314
309
|
}
|
|
315
|
-
let h =
|
|
316
|
-
function
|
|
310
|
+
let h = B({ catalog: m(re) }), _ = $(h.menuOpen), v = $(h.searchQuery), y = $(h.filteredMain), S = $(h.filteredSub), T = r(() => y.value.length > 0 || S.value.length > 0), E = h.catalog.peek().length, k = C(null), A = C(!1), j = C(null), N = C(null), F = C(null), I = C(null), L = C(!1), te = J(), R = r(() => f.activeIndicators?.length ? f.activeIndicators.map((e) => ie(e)).filter((e) => e !== void 0).sort((e, t) => e.pane === t.pane ? 0 : e.pane === "main" ? -1 : 1) : []), ne = r(() => R.value.some((e) => e.pane === "main") ? R.value.find((e) => e.pane === "sub")?.id ?? null : null), z = r(() => j.value ? ie(j.value) : null), ae = r(() => f.activeIndicators?.length ?? 0);
|
|
311
|
+
function H(e) {
|
|
317
312
|
return f.activeIndicators?.includes(e) ?? !1;
|
|
318
313
|
}
|
|
319
|
-
function
|
|
320
|
-
if (
|
|
321
|
-
let t =
|
|
322
|
-
t && (t.pane === "main" &&
|
|
314
|
+
function oe(e) {
|
|
315
|
+
if (H(e)) return;
|
|
316
|
+
let t = ie(e);
|
|
317
|
+
t && (t.pane === "main" && re.filter((t) => t.id !== e && H(t.id) && t.pane === "main").forEach((e) => p("toggle", e.id, !1)), p("toggle", e, !0));
|
|
323
318
|
}
|
|
324
|
-
function
|
|
319
|
+
function se(e) {
|
|
325
320
|
p("toggle", e, !1);
|
|
326
321
|
}
|
|
327
|
-
function
|
|
328
|
-
|
|
322
|
+
function ce(e) {
|
|
323
|
+
j.value = e, A.value = !0;
|
|
329
324
|
}
|
|
330
|
-
function
|
|
331
|
-
let t =
|
|
325
|
+
function U(e) {
|
|
326
|
+
let t = ie(e);
|
|
332
327
|
if (!t?.params) return {};
|
|
333
328
|
let n = {};
|
|
334
329
|
for (let e of t.params) n[e.key] = e.default ?? e.min ?? 1;
|
|
@@ -336,80 +331,80 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
336
331
|
for (let [e, t] of Object.entries(r)) typeof t == "number" && (i[e] = t);
|
|
337
332
|
return i;
|
|
338
333
|
}
|
|
339
|
-
function
|
|
340
|
-
let t =
|
|
334
|
+
function le(e) {
|
|
335
|
+
let t = U(e.id);
|
|
341
336
|
return e.params ? e.params.map((e) => t[e.key] ?? "").join(",") : "";
|
|
342
337
|
}
|
|
343
|
-
function
|
|
344
|
-
|
|
338
|
+
function ue(e) {
|
|
339
|
+
j.value && p("updateParams", j.value, e), A.value = !1;
|
|
345
340
|
}
|
|
346
|
-
function
|
|
347
|
-
if (!
|
|
341
|
+
function de(e, t) {
|
|
342
|
+
if (!V(t)) {
|
|
348
343
|
e.preventDefault();
|
|
349
344
|
return;
|
|
350
345
|
}
|
|
351
|
-
|
|
346
|
+
I.value = t, F.value = null, e.dataTransfer?.setData("text/plain", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
|
|
352
347
|
}
|
|
353
|
-
function
|
|
354
|
-
!
|
|
348
|
+
function W(e, t) {
|
|
349
|
+
!I.value || !V(t) || I.value === t || (F.value = t, e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
|
|
355
350
|
}
|
|
356
|
-
function
|
|
357
|
-
let n =
|
|
351
|
+
function G(e, t) {
|
|
352
|
+
let n = I.value || e.dataTransfer?.getData("text/plain") || "";
|
|
358
353
|
if (!n || n === t) {
|
|
359
354
|
K();
|
|
360
355
|
return;
|
|
361
356
|
}
|
|
362
|
-
if (!
|
|
357
|
+
if (!V(n) || !V(t)) {
|
|
363
358
|
K();
|
|
364
359
|
return;
|
|
365
360
|
}
|
|
366
|
-
let r =
|
|
361
|
+
let r = R.value.findIndex((e) => e.id === n), i = R.value.findIndex((e) => e.id === t);
|
|
367
362
|
if (r < 0 || i < 0) {
|
|
368
363
|
K();
|
|
369
364
|
return;
|
|
370
365
|
}
|
|
371
|
-
let a = [...
|
|
366
|
+
let a = [...R.value.map((e) => e.id)], [o] = a.splice(r, 1);
|
|
372
367
|
if (!o) {
|
|
373
368
|
K();
|
|
374
369
|
return;
|
|
375
370
|
}
|
|
376
|
-
a.splice(i, 0, o), p("reorderSubIndicators", a.filter((e) =>
|
|
371
|
+
a.splice(i, 0, o), p("reorderSubIndicators", a.filter((e) => V(e))), K();
|
|
377
372
|
}
|
|
378
373
|
function K() {
|
|
379
|
-
|
|
374
|
+
F.value = null, I.value = null;
|
|
380
375
|
}
|
|
381
|
-
function
|
|
376
|
+
function q(e) {
|
|
382
377
|
e.key === "Escape" && h.menuOpen.peek() && h.closeMenu();
|
|
383
378
|
}
|
|
384
|
-
return
|
|
385
|
-
document.addEventListener("keydown",
|
|
386
|
-
}),
|
|
387
|
-
document.removeEventListener("keydown",
|
|
388
|
-
}), (r, u) => (
|
|
389
|
-
s("div", Ne, [s("div", Pe, [(
|
|
379
|
+
return ee(() => {
|
|
380
|
+
document.addEventListener("keydown", q);
|
|
381
|
+
}), b(() => {
|
|
382
|
+
document.removeEventListener("keydown", q);
|
|
383
|
+
}), (r, u) => (x(), o("div", Me, [
|
|
384
|
+
s("div", Ne, [s("div", Pe, [(x(!0), o(e, null, w(R.value, (t) => (x(), o(e, { key: t.id }, [t.id === ne.value ? (x(), o("div", Fe)) : a("", !0), s("div", {
|
|
390
385
|
class: g(["indicator-item", {
|
|
391
|
-
draggable: O(
|
|
392
|
-
"drag-over":
|
|
393
|
-
"is-dragging":
|
|
386
|
+
draggable: O(V)(t.id),
|
|
387
|
+
"drag-over": F.value === t.id,
|
|
388
|
+
"is-dragging": I.value === t.id
|
|
394
389
|
}]),
|
|
395
|
-
draggable: O(
|
|
396
|
-
onDragstart: (e) =>
|
|
397
|
-
onDragover: P((e) =>
|
|
398
|
-
onDrop: P((e) =>
|
|
390
|
+
draggable: O(V)(t.id),
|
|
391
|
+
onDragstart: (e) => de(e, t.id),
|
|
392
|
+
onDragover: P((e) => W(e, t.id), ["prevent"]),
|
|
393
|
+
onDrop: P((e) => G(e, t.id), ["prevent"]),
|
|
399
394
|
onDragend: K
|
|
400
395
|
}, [s("div", {
|
|
401
396
|
class: "indicator-btn-wrapper",
|
|
402
|
-
onMouseenter: (e) =>
|
|
403
|
-
onMouseleave: u[0] ||= (e) =>
|
|
397
|
+
onMouseenter: (e) => N.value = t.id,
|
|
398
|
+
onMouseleave: u[0] ||= (e) => N.value = null
|
|
404
399
|
}, [s("button", { class: g(["indicator-btn", {
|
|
405
400
|
active: !0,
|
|
406
|
-
hovering:
|
|
407
|
-
}]) }, [s("span", Re, [c(D(t.label) + " ", 1), t.params?.length ? (
|
|
408
|
-
default: M(() => [
|
|
409
|
-
t.params?.length ? (
|
|
401
|
+
hovering: N.value === t.id
|
|
402
|
+
}]) }, [s("span", Re, [c(D(t.label) + " ", 1), t.params?.length ? (x(), o("span", ze, " (" + D(le(t)) + ") ", 1)) : a("", !0)]), l(n, { name: "fade" }, {
|
|
403
|
+
default: M(() => [N.value === t.id ? (x(), o("div", Be, [
|
|
404
|
+
t.params?.length ? (x(), o("button", {
|
|
410
405
|
key: 0,
|
|
411
406
|
class: "action-btn settings-btn",
|
|
412
|
-
onClick: P((e) =>
|
|
407
|
+
onClick: P((e) => ce(t.id), ["stop"]),
|
|
413
408
|
title: "编辑参数"
|
|
414
409
|
}, [...u[9] ||= [s("svg", {
|
|
415
410
|
viewBox: "0 0 24 24",
|
|
@@ -417,10 +412,10 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
417
412
|
height: "14",
|
|
418
413
|
fill: "currentColor"
|
|
419
414
|
}, [s("path", { d: "M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" })], -1)]], 8, Ve)) : a("", !0),
|
|
420
|
-
t.params?.length ? (
|
|
415
|
+
t.params?.length ? (x(), o("span", He)) : a("", !0),
|
|
421
416
|
s("button", {
|
|
422
417
|
class: "action-btn remove-btn",
|
|
423
|
-
onClick: P((e) =>
|
|
418
|
+
onClick: P((e) => se(t.id), ["stop"]),
|
|
424
419
|
title: "移除指标"
|
|
425
420
|
}, [...u[10] ||= [s("svg", {
|
|
426
421
|
viewBox: "0 0 24 24",
|
|
@@ -432,7 +427,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
432
427
|
_: 2
|
|
433
428
|
}, 1024)], 2)], 40, Le)], 42, Ie)], 64))), 128)), s("div", We, [s("button", {
|
|
434
429
|
ref_key: "addBtnRef",
|
|
435
|
-
ref:
|
|
430
|
+
ref: k,
|
|
436
431
|
class: "add-btn",
|
|
437
432
|
onClick: u[1] ||= P((e) => O(h).toggleMenu(), ["stop"]),
|
|
438
433
|
title: "添加指标"
|
|
@@ -442,22 +437,22 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
442
437
|
height: "16",
|
|
443
438
|
fill: "currentColor"
|
|
444
439
|
}, [s("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })], -1)]], 512)])])]),
|
|
445
|
-
(
|
|
446
|
-
default: M(() => [O(_) ? (
|
|
440
|
+
(x(), i(t, { to: O(te) }, [l(n, { name: "overlay" }, {
|
|
441
|
+
default: M(() => [O(_) ? (x(), o("div", {
|
|
447
442
|
key: 0,
|
|
448
443
|
class: "selector-overlay",
|
|
449
444
|
onClick: u[7] ||= (e) => O(h).closeMenu()
|
|
450
445
|
}, [l(n, { name: "modal" }, {
|
|
451
|
-
default: M(() => [O(_) ? (
|
|
446
|
+
default: M(() => [O(_) ? (x(), o("div", {
|
|
452
447
|
key: 0,
|
|
453
448
|
class: "selector-modal",
|
|
454
449
|
onClick: u[6] ||= P(() => {}, ["stop"])
|
|
455
450
|
}, [
|
|
456
|
-
s("div", Ge, [s("div", Ke, [u[12] ||= s("span", { class: "title-text" }, "添加指标", -1), s("span", qe, D(O(
|
|
457
|
-
class: g(["view-toggle-btn", { active:
|
|
458
|
-
onClick: u[2] ||= (e) =>
|
|
451
|
+
s("div", Ge, [s("div", Ke, [u[12] ||= s("span", { class: "title-text" }, "添加指标", -1), s("span", qe, D(O(E)) + " 个可用指标", 1)]), s("div", Je, [s("button", {
|
|
452
|
+
class: g(["view-toggle-btn", { active: L.value }]),
|
|
453
|
+
onClick: u[2] ||= (e) => L.value = !L.value,
|
|
459
454
|
title: "简洁模式"
|
|
460
|
-
}, [
|
|
455
|
+
}, [L.value ? (x(), o("svg", Xe, [...u[14] ||= [s("path", { d: "M3 3h18v18H3V3zm16 16V5H5v14h14zM7 7h4v4H7V7zm0 6h4v4H7v-4zm6-6h4v4h-4V7zm0 6h4v4h-4v-4z" }, null, -1)]])) : (x(), o("svg", Ye, [...u[13] ||= [s("path", { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, null, -1)]]))], 2), s("button", {
|
|
461
456
|
class: "modal-close",
|
|
462
457
|
onClick: u[3] ||= (e) => O(h).closeMenu(),
|
|
463
458
|
title: "关闭"
|
|
@@ -480,18 +475,18 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
480
475
|
type: "text",
|
|
481
476
|
class: "search-input",
|
|
482
477
|
placeholder: "搜索指标名称..."
|
|
483
|
-
}, null, 40,
|
|
484
|
-
O(
|
|
478
|
+
}, null, 40, X)]),
|
|
479
|
+
O(y).length > 0 ? (x(), o("div", Z, [s("div", $e, [u[17] ||= s("span", { class: "section-title" }, "主图指标", -1), s("span", et, D(O(y).length), 1)]), s("div", { class: g(["indicator-grid", { compact: L.value }]) }, [(x(!0), o(e, null, w(O(y), (t) => (x(), o("button", {
|
|
485
480
|
key: t.id,
|
|
486
481
|
class: g(["indicator-card", {
|
|
487
|
-
active:
|
|
488
|
-
compact:
|
|
482
|
+
active: H(t.id),
|
|
483
|
+
compact: L.value
|
|
489
484
|
}]),
|
|
490
|
-
onClick: (e) =>
|
|
491
|
-
}, [
|
|
485
|
+
onClick: (e) => H(t.id) ? se(t.id) : oe(t.id)
|
|
486
|
+
}, [L.value ? (x(), o(e, { key: 0 }, [s("span", nt, D(t.label), 1), s("span", rt, D(t.name), 1)], 64)) : (x(), o(e, { key: 1 }, [s("div", it, [s("span", at, D(t.label), 1), s("div", ot, [t.params?.length ? (x(), o("button", {
|
|
492
487
|
key: 0,
|
|
493
488
|
class: "card-settings-btn",
|
|
494
|
-
onClick: P((e) =>
|
|
489
|
+
onClick: P((e) => ce(t.id), ["stop"]),
|
|
495
490
|
title: "编辑参数"
|
|
496
491
|
}, [...u[18] ||= [s("svg", {
|
|
497
492
|
viewBox: "0 0 24 24",
|
|
@@ -499,8 +494,8 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
499
494
|
height: "14",
|
|
500
495
|
fill: "currentColor"
|
|
501
496
|
}, [s("path", { d: "M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" })], -1)]], 8, st)) : a("", !0)])]), s("div", ct, D(t.name), 1)], 64))], 10, tt))), 128))], 2)])) : a("", !0),
|
|
502
|
-
O(
|
|
503
|
-
!
|
|
497
|
+
O(y).length > 0 && O(S).length > 0 ? (x(), o("div", lt)) : a("", !0),
|
|
498
|
+
!T.value && O(v).trim() ? (x(), o("div", ut, [...u[19] ||= [
|
|
504
499
|
s("svg", {
|
|
505
500
|
viewBox: "0 0 24 24",
|
|
506
501
|
width: "48",
|
|
@@ -510,17 +505,17 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
510
505
|
s("p", null, "未找到匹配的指标", -1),
|
|
511
506
|
s("span", { class: "no-results-hint" }, "请尝试其他关键词", -1)
|
|
512
507
|
]])) : a("", !0),
|
|
513
|
-
O(
|
|
508
|
+
O(S).length > 0 ? (x(), o("div", dt, [s("div", ft, [u[20] ||= s("span", { class: "section-title" }, "副图指标", -1), s("span", pt, D(O(S).length), 1)]), s("div", { class: g(["indicator-grid", { compact: L.value }]) }, [(x(!0), o(e, null, w(O(S), (t) => (x(), o("button", {
|
|
514
509
|
key: t.id,
|
|
515
510
|
class: g(["indicator-card", {
|
|
516
|
-
active:
|
|
517
|
-
compact:
|
|
511
|
+
active: H(t.id),
|
|
512
|
+
compact: L.value
|
|
518
513
|
}]),
|
|
519
|
-
onClick: (e) =>
|
|
520
|
-
}, [
|
|
514
|
+
onClick: (e) => H(t.id) ? se(t.id) : oe(t.id)
|
|
515
|
+
}, [L.value ? (x(), o(e, { key: 0 }, [s("span", ht, D(t.label), 1), s("span", gt, D(t.name), 1)], 64)) : (x(), o(e, { key: 1 }, [s("div", _t, [s("span", vt, D(t.label), 1), s("div", yt, [t.params?.length ? (x(), o("button", {
|
|
521
516
|
key: 0,
|
|
522
517
|
class: "card-settings-btn",
|
|
523
|
-
onClick: P((e) =>
|
|
518
|
+
onClick: P((e) => ce(t.id), ["stop"]),
|
|
524
519
|
title: "编辑参数"
|
|
525
520
|
}, [...u[21] ||= [s("svg", {
|
|
526
521
|
viewBox: "0 0 24 24",
|
|
@@ -529,7 +524,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
529
524
|
fill: "currentColor"
|
|
530
525
|
}, [s("path", { d: "M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" })], -1)]], 8, bt)) : a("", !0)])]), s("div", xt, D(t.name), 1)], 64))], 10, mt))), 128))], 2)])) : a("", !0)
|
|
531
526
|
]),
|
|
532
|
-
s("div", St, [s("div", Ct, [s("span", wt, "已激活 " + D(
|
|
527
|
+
s("div", St, [s("div", Ct, [s("span", wt, "已激活 " + D(ae.value) + " 个指标", 1)]), s("button", {
|
|
533
528
|
class: "btn btn-confirm",
|
|
534
529
|
onClick: u[5] ||= (e) => O(h).closeMenu()
|
|
535
530
|
}, "确认")])
|
|
@@ -538,16 +533,16 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
538
533
|
})])) : a("", !0)]),
|
|
539
534
|
_: 1
|
|
540
535
|
})], 8, ["to"])),
|
|
541
|
-
|
|
536
|
+
z.value ? (x(), i(je, {
|
|
542
537
|
key: 0,
|
|
543
|
-
visible:
|
|
544
|
-
"indicator-id":
|
|
545
|
-
"indicator-name":
|
|
546
|
-
"indicator-description":
|
|
547
|
-
params:
|
|
548
|
-
values:
|
|
549
|
-
onClose: u[8] ||= (e) =>
|
|
550
|
-
onConfirm:
|
|
538
|
+
visible: A.value,
|
|
539
|
+
"indicator-id": z.value.id,
|
|
540
|
+
"indicator-name": z.value.name,
|
|
541
|
+
"indicator-description": z.value.description,
|
|
542
|
+
params: z.value.params || [],
|
|
543
|
+
values: U(z.value.id),
|
|
544
|
+
onClose: u[8] ||= (e) => A.value = !1,
|
|
545
|
+
onConfirm: ue
|
|
551
546
|
}, null, 8, [
|
|
552
547
|
"visible",
|
|
553
548
|
"indicator-id",
|
|
@@ -558,7 +553,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
558
553
|
])) : a("", !0)
|
|
559
554
|
]));
|
|
560
555
|
}
|
|
561
|
-
}), [["__scopeId", "data-v-
|
|
556
|
+
}), [["__scopeId", "data-v-7a4dfe73"]]), Et = { class: "kline-tooltip__title" }, Dt = { key: 0 }, Ot = { class: "kline-tooltip__grid" }, kt = { class: "row" }, At = { class: "row" }, jt = { class: "row" }, Mt = { class: "row" }, Nt = {
|
|
562
557
|
key: 0,
|
|
563
558
|
class: "row"
|
|
564
559
|
}, Pt = {
|
|
@@ -623,7 +618,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
623
618
|
let n = e.changePercent ?? (e.close - e.open) / e.open * 100;
|
|
624
619
|
return n > 0 ? zt : n < 0 ? Bt : Vt;
|
|
625
620
|
});
|
|
626
|
-
return (t, r) => e.k ? (
|
|
621
|
+
return (t, r) => e.k ? (x(), o("div", {
|
|
627
622
|
key: 0,
|
|
628
623
|
ref: c,
|
|
629
624
|
class: g(["kline-tooltip", [{ "use-anchor": n.value }, i.value]]),
|
|
@@ -631,20 +626,20 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
631
626
|
left: `${e.pos.x}px`,
|
|
632
627
|
top: `${e.pos.y}px`
|
|
633
628
|
})
|
|
634
|
-
}, [s("div", Et, [e.k.stockCode ? (
|
|
629
|
+
}, [s("div", Et, [e.k.stockCode ? (x(), o("span", Dt, D(e.k.stockCode), 1)) : a("", !0), s("span", null, D(l(e.k.timestamp)), 1)]), s("div", Ot, [
|
|
635
630
|
s("div", kt, [r[0] ||= s("span", null, "开", -1), s("span", { style: _({ color: p.value }) }, D(e.k.open.toFixed(2)), 5)]),
|
|
636
631
|
s("div", At, [r[1] ||= s("span", null, "高", -1), s("span", null, D(e.k.high.toFixed(2)), 1)]),
|
|
637
632
|
s("div", jt, [r[2] ||= s("span", null, "低", -1), s("span", null, D(e.k.low.toFixed(2)), 1)]),
|
|
638
633
|
s("div", Mt, [r[3] ||= s("span", null, "收", -1), s("span", { style: _({ color: m.value }) }, D(e.k.close.toFixed(2)), 5)]),
|
|
639
|
-
typeof e.k.volume == "number" ? (
|
|
640
|
-
typeof e.k.turnover == "number" ? (
|
|
641
|
-
typeof e.k.amplitude == "number" ? (
|
|
642
|
-
typeof e.k.changePercent == "number" ? (
|
|
643
|
-
typeof e.k.changeAmount == "number" ? (
|
|
644
|
-
typeof e.k.turnoverRate == "number" ? (
|
|
634
|
+
typeof e.k.volume == "number" ? (x(), o("div", Nt, [r[4] ||= s("span", null, "成交量", -1), s("span", null, D(u(e.k.volume)), 1)])) : a("", !0),
|
|
635
|
+
typeof e.k.turnover == "number" ? (x(), o("div", Pt, [r[5] ||= s("span", null, "成交额", -1), s("span", null, D(u(e.k.turnover)), 1)])) : a("", !0),
|
|
636
|
+
typeof e.k.amplitude == "number" ? (x(), o("div", Ft, [r[6] ||= s("span", null, "振幅", -1), s("span", null, D(e.k.amplitude) + "%", 1)])) : a("", !0),
|
|
637
|
+
typeof e.k.changePercent == "number" ? (x(), o("div", It, [r[7] ||= s("span", null, "涨跌幅", -1), s("span", { style: _({ color: h.value }) }, D(d(e.k.changePercent, "%")), 5)])) : a("", !0),
|
|
638
|
+
typeof e.k.changeAmount == "number" ? (x(), o("div", Lt, [r[8] ||= s("span", null, "涨跌额", -1), s("span", { style: _({ color: h.value }) }, D(d(e.k.changeAmount, "")), 5)])) : a("", !0),
|
|
639
|
+
typeof e.k.turnoverRate == "number" ? (x(), o("div", Rt, [r[9] ||= s("span", null, "换手率", -1), s("span", null, D(e.k.turnoverRate.toFixed(2)) + "%", 1)])) : a("", !0)
|
|
645
640
|
])], 6)) : a("", !0);
|
|
646
641
|
}
|
|
647
|
-
}), [["__scopeId", "data-v-
|
|
642
|
+
}), [["__scopeId", "data-v-61c103af"]]), Ut = { class: "marker-tooltip__title" }, Wt = {
|
|
648
643
|
key: 0,
|
|
649
644
|
class: "marker-tooltip__content"
|
|
650
645
|
}, Gt = /* @__PURE__ */ q(/* @__PURE__ */ u({
|
|
@@ -688,7 +683,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
688
683
|
function h(e) {
|
|
689
684
|
return typeof e == "number" ? e.toFixed(2) : String(e);
|
|
690
685
|
}
|
|
691
|
-
return (n, r) => t.marker ? (
|
|
686
|
+
return (n, r) => t.marker ? (x(), o("div", {
|
|
692
687
|
key: 0,
|
|
693
688
|
ref: u,
|
|
694
689
|
class: g(["marker-tooltip", [{ "use-anchor": c.value }, l.value]]),
|
|
@@ -696,18 +691,18 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
696
691
|
left: `${t.pos.x + 12}px`,
|
|
697
692
|
top: `${t.pos.y + 12}px`
|
|
698
693
|
})
|
|
699
|
-
}, [s("div", Ut, D(f.value), 1), m.value ? (
|
|
694
|
+
}, [s("div", Ut, D(f.value), 1), m.value ? (x(), o("div", Wt, [(x(!0), o(e, null, w(p.value, (e, t) => (x(), o("div", {
|
|
700
695
|
key: t,
|
|
701
696
|
class: "row"
|
|
702
697
|
}, [s("span", null, D(t), 1), s("span", null, D(h(e)), 1)]))), 128))])) : a("", !0)], 6)) : a("", !0);
|
|
703
698
|
}
|
|
704
|
-
}), [["__scopeId", "data-v-
|
|
699
|
+
}), [["__scopeId", "data-v-dc844eda"]]), Kt = {
|
|
705
700
|
viewBox: "0 0 24 24",
|
|
706
701
|
width: "1.2em",
|
|
707
702
|
height: "1.2em"
|
|
708
703
|
};
|
|
709
704
|
function qt(e, t) {
|
|
710
|
-
return
|
|
705
|
+
return x(), o("svg", Kt, [...t[0] ||= [s("path", {
|
|
711
706
|
fill: "none",
|
|
712
707
|
stroke: "currentColor",
|
|
713
708
|
"stroke-linecap": "round",
|
|
@@ -725,7 +720,7 @@ var Jt = m({
|
|
|
725
720
|
height: "1.2em"
|
|
726
721
|
};
|
|
727
722
|
function Xt(e, t) {
|
|
728
|
-
return
|
|
723
|
+
return x(), o("svg", Yt, [...t[0] ||= [s("path", {
|
|
729
724
|
fill: "none",
|
|
730
725
|
stroke: "currentColor",
|
|
731
726
|
"stroke-linecap": "round",
|
|
@@ -743,7 +738,7 @@ var Zt = m({
|
|
|
743
738
|
height: "1.2em"
|
|
744
739
|
};
|
|
745
740
|
function $t(e, t) {
|
|
746
|
-
return
|
|
741
|
+
return x(), o("svg", Qt, [...t[0] ||= [s("path", {
|
|
747
742
|
fill: "none",
|
|
748
743
|
stroke: "currentColor",
|
|
749
744
|
"stroke-linecap": "round",
|
|
@@ -761,7 +756,7 @@ var en = m({
|
|
|
761
756
|
height: "1.2em"
|
|
762
757
|
};
|
|
763
758
|
function nn(e, t) {
|
|
764
|
-
return
|
|
759
|
+
return x(), o("svg", tn, [...t[0] ||= [s("path", {
|
|
765
760
|
fill: "none",
|
|
766
761
|
stroke: "currentColor",
|
|
767
762
|
"stroke-linecap": "round",
|
|
@@ -779,7 +774,7 @@ var rn = m({
|
|
|
779
774
|
height: "1.2em"
|
|
780
775
|
};
|
|
781
776
|
function on(e, t) {
|
|
782
|
-
return
|
|
777
|
+
return x(), o("svg", an, [...t[0] ||= [s("path", {
|
|
783
778
|
fill: "none",
|
|
784
779
|
stroke: "currentColor",
|
|
785
780
|
"stroke-linecap": "round",
|
|
@@ -797,7 +792,7 @@ var sn = m({
|
|
|
797
792
|
height: "1.2em"
|
|
798
793
|
};
|
|
799
794
|
function ln(e, t) {
|
|
800
|
-
return
|
|
795
|
+
return x(), o("svg", cn, [...t[0] ||= [s("path", {
|
|
801
796
|
fill: "none",
|
|
802
797
|
stroke: "currentColor",
|
|
803
798
|
"stroke-linecap": "round",
|
|
@@ -815,7 +810,7 @@ var un = m({
|
|
|
815
810
|
height: "1.2em"
|
|
816
811
|
};
|
|
817
812
|
function fn(e, t) {
|
|
818
|
-
return
|
|
813
|
+
return x(), o("svg", dn, [...t[0] ||= [s("path", {
|
|
819
814
|
fill: "none",
|
|
820
815
|
stroke: "currentColor",
|
|
821
816
|
"stroke-linecap": "round",
|
|
@@ -833,7 +828,7 @@ var pn = m({
|
|
|
833
828
|
height: "1.2em"
|
|
834
829
|
};
|
|
835
830
|
function hn(e, t) {
|
|
836
|
-
return
|
|
831
|
+
return x(), o("svg", mn, [...t[0] ||= [s("g", {
|
|
837
832
|
fill: "none",
|
|
838
833
|
stroke: "currentColor",
|
|
839
834
|
"stroke-linecap": "round",
|
|
@@ -850,7 +845,7 @@ var gn = m({
|
|
|
850
845
|
height: "1.2em"
|
|
851
846
|
};
|
|
852
847
|
function vn(e, t) {
|
|
853
|
-
return
|
|
848
|
+
return x(), o("svg", _n, [...t[0] ||= [s("path", {
|
|
854
849
|
fill: "none",
|
|
855
850
|
stroke: "currentColor",
|
|
856
851
|
"stroke-linecap": "round",
|
|
@@ -868,7 +863,7 @@ var yn = m({
|
|
|
868
863
|
height: "1.2em"
|
|
869
864
|
};
|
|
870
865
|
function xn(e, t) {
|
|
871
|
-
return
|
|
866
|
+
return x(), o("svg", bn, [...t[0] ||= [s("path", {
|
|
872
867
|
fill: "none",
|
|
873
868
|
stroke: "currentColor",
|
|
874
869
|
"stroke-linecap": "round",
|
|
@@ -886,7 +881,7 @@ var Sn = m({
|
|
|
886
881
|
height: "1.2em"
|
|
887
882
|
};
|
|
888
883
|
function wn(e, t) {
|
|
889
|
-
return
|
|
884
|
+
return x(), o("svg", Cn, [...t[0] ||= [s("path", {
|
|
890
885
|
fill: "none",
|
|
891
886
|
stroke: "currentColor",
|
|
892
887
|
"stroke-linecap": "round",
|
|
@@ -904,7 +899,7 @@ var Tn = m({
|
|
|
904
899
|
height: "1.2em"
|
|
905
900
|
};
|
|
906
901
|
function Dn(e, t) {
|
|
907
|
-
return
|
|
902
|
+
return x(), o("svg", En, [...t[0] ||= [s("path", {
|
|
908
903
|
fill: "none",
|
|
909
904
|
stroke: "currentColor",
|
|
910
905
|
"stroke-linecap": "round",
|
|
@@ -922,7 +917,7 @@ var On = m({
|
|
|
922
917
|
height: "1.2em"
|
|
923
918
|
};
|
|
924
919
|
function An(e, t) {
|
|
925
|
-
return
|
|
920
|
+
return x(), o("svg", kn, [...t[0] ||= [s("g", {
|
|
926
921
|
fill: "none",
|
|
927
922
|
stroke: "currentColor",
|
|
928
923
|
"stroke-linecap": "round",
|
|
@@ -939,7 +934,7 @@ var jn = m({
|
|
|
939
934
|
height: "1.2em"
|
|
940
935
|
};
|
|
941
936
|
function Nn(e, t) {
|
|
942
|
-
return
|
|
937
|
+
return x(), o("svg", Mn, [...t[0] ||= [s("path", {
|
|
943
938
|
fill: "none",
|
|
944
939
|
stroke: "currentColor",
|
|
945
940
|
"stroke-linecap": "round",
|
|
@@ -957,7 +952,7 @@ var Pn = m({
|
|
|
957
952
|
height: "1.2em"
|
|
958
953
|
};
|
|
959
954
|
function In(e, t) {
|
|
960
|
-
return
|
|
955
|
+
return x(), o("svg", Fn, [...t[0] ||= [s("path", {
|
|
961
956
|
fill: "none",
|
|
962
957
|
stroke: "currentColor",
|
|
963
958
|
"stroke-linecap": "round",
|
|
@@ -975,7 +970,7 @@ var Ln = m({
|
|
|
975
970
|
height: "1.2em"
|
|
976
971
|
};
|
|
977
972
|
function zn(e, t) {
|
|
978
|
-
return
|
|
973
|
+
return x(), o("svg", Rn, [...t[0] ||= [s("path", {
|
|
979
974
|
fill: "none",
|
|
980
975
|
stroke: "currentColor",
|
|
981
976
|
"stroke-linecap": "round",
|
|
@@ -993,7 +988,7 @@ var Bn = m({
|
|
|
993
988
|
height: "1.2em"
|
|
994
989
|
};
|
|
995
990
|
function Hn(e, t) {
|
|
996
|
-
return
|
|
991
|
+
return x(), o("svg", Vn, [...t[0] ||= [s("path", {
|
|
997
992
|
fill: "none",
|
|
998
993
|
stroke: "currentColor",
|
|
999
994
|
"stroke-linecap": "round",
|
|
@@ -1216,110 +1211,110 @@ var rr = {
|
|
|
1216
1211
|
}
|
|
1217
1212
|
]
|
|
1218
1213
|
}
|
|
1219
|
-
], m = f, h = C("cursor"), _ = C(null), v = C(!1),
|
|
1220
|
-
function
|
|
1214
|
+
], m = f, h = C("cursor"), _ = C(null), v = C(!1), y = J(), S = r(() => U.filter((e) => e.group === "main")), E = r(() => U.filter((e) => e.group === "experimental"));
|
|
1215
|
+
function j() {
|
|
1221
1216
|
try {
|
|
1222
|
-
let e = localStorage.getItem(
|
|
1217
|
+
let e = localStorage.getItem(le);
|
|
1223
1218
|
if (e) {
|
|
1224
1219
|
let t = JSON.parse(e), n = {};
|
|
1225
|
-
return
|
|
1220
|
+
return U.forEach((e) => {
|
|
1226
1221
|
n[e.key] = t[e.key] ?? e.default;
|
|
1227
1222
|
}), n;
|
|
1228
1223
|
}
|
|
1229
1224
|
} catch {}
|
|
1230
1225
|
let e = {};
|
|
1231
|
-
return
|
|
1226
|
+
return U.forEach((t) => {
|
|
1232
1227
|
e[t.key] = t.default;
|
|
1233
1228
|
}), e;
|
|
1234
1229
|
}
|
|
1235
|
-
function
|
|
1230
|
+
function F(e) {
|
|
1236
1231
|
try {
|
|
1237
|
-
localStorage.setItem(
|
|
1232
|
+
localStorage.setItem(le, JSON.stringify(e));
|
|
1238
1233
|
} catch {}
|
|
1239
1234
|
}
|
|
1240
|
-
let
|
|
1241
|
-
function
|
|
1235
|
+
let I = C(j()), L = C({ ...I.value });
|
|
1236
|
+
function te(e) {
|
|
1242
1237
|
return h.value === e.id ? !0 : e.children ? e.children.some((e) => e.id === h.value) : !1;
|
|
1243
1238
|
}
|
|
1244
|
-
function
|
|
1239
|
+
function R(e) {
|
|
1245
1240
|
if (e.children?.length) {
|
|
1246
1241
|
if (!e.children.some((e) => e.id === h.value)) {
|
|
1247
1242
|
let t = e.children[0];
|
|
1248
1243
|
h.value = t.id, m("selectTool", t.id);
|
|
1249
1244
|
}
|
|
1250
|
-
|
|
1245
|
+
re(e.id);
|
|
1251
1246
|
return;
|
|
1252
1247
|
}
|
|
1253
1248
|
h.value = e.id, m("selectTool", e.id), _.value = null;
|
|
1254
1249
|
}
|
|
1255
|
-
function
|
|
1250
|
+
function ne(e) {
|
|
1256
1251
|
h.value = e.id, m("selectTool", e.id), _.value = null;
|
|
1257
1252
|
}
|
|
1258
|
-
function
|
|
1253
|
+
function re(e) {
|
|
1259
1254
|
_.value = _.value === e ? null : e;
|
|
1260
1255
|
}
|
|
1261
|
-
function
|
|
1262
|
-
|
|
1256
|
+
function z() {
|
|
1257
|
+
L.value = { ...I.value }, v.value = !0;
|
|
1263
1258
|
}
|
|
1264
|
-
function
|
|
1259
|
+
function B() {
|
|
1265
1260
|
v.value = !1;
|
|
1266
1261
|
}
|
|
1267
|
-
function
|
|
1262
|
+
function ie() {
|
|
1268
1263
|
let e = {};
|
|
1269
|
-
|
|
1264
|
+
U.forEach((t) => {
|
|
1270
1265
|
e[t.key] = t.default;
|
|
1271
|
-
}),
|
|
1266
|
+
}), L.value = e;
|
|
1272
1267
|
}
|
|
1273
|
-
function
|
|
1274
|
-
|
|
1268
|
+
function ae() {
|
|
1269
|
+
I.value = { ...L.value }, F(I.value), Qn(!!I.value.enableCanvasProfiler), m("settingsChange", { ...I.value }), B();
|
|
1275
1270
|
}
|
|
1276
|
-
function
|
|
1277
|
-
return { ...
|
|
1271
|
+
function V() {
|
|
1272
|
+
return { ...I.value };
|
|
1278
1273
|
}
|
|
1279
|
-
d({ getSettings:
|
|
1280
|
-
function
|
|
1274
|
+
d({ getSettings: V });
|
|
1275
|
+
function H(e) {
|
|
1281
1276
|
e.target.closest(".tool-item") || (_.value = null);
|
|
1282
1277
|
}
|
|
1283
|
-
return
|
|
1284
|
-
document.addEventListener("click",
|
|
1285
|
-
}),
|
|
1286
|
-
document.removeEventListener("click",
|
|
1287
|
-
}), (r, d) => (
|
|
1288
|
-
s("div", ir, [(
|
|
1278
|
+
return ee(() => {
|
|
1279
|
+
document.addEventListener("click", H, !0), m("settingsChange", { ...I.value }), Qn(!!I.value.enableCanvasProfiler);
|
|
1280
|
+
}), b(() => {
|
|
1281
|
+
document.removeEventListener("click", H, !0);
|
|
1282
|
+
}), (r, d) => (x(), o(e, null, [s("nav", rr, [
|
|
1283
|
+
s("div", ir, [(x(), o(e, null, w(p, (t) => s("div", {
|
|
1289
1284
|
key: t.id,
|
|
1290
1285
|
class: "tool-item"
|
|
1291
1286
|
}, [s("button", {
|
|
1292
1287
|
type: "button",
|
|
1293
|
-
class: g(["left-toolbar__button", { active:
|
|
1288
|
+
class: g(["left-toolbar__button", { active: te(t) }]),
|
|
1294
1289
|
title: t.title,
|
|
1295
1290
|
"aria-label": t.title,
|
|
1296
|
-
onClick: (e) =>
|
|
1291
|
+
onClick: (e) => R(t),
|
|
1297
1292
|
onPointerdown: d[0] ||= P(() => {}, ["stop"]),
|
|
1298
1293
|
onPointermove: d[1] ||= P(() => {}, ["stop"]),
|
|
1299
1294
|
onPointerup: d[2] ||= P(() => {}, ["stop"])
|
|
1300
|
-
}, [(
|
|
1295
|
+
}, [(x(), i(T(t.icon), {
|
|
1301
1296
|
class: "tool-icon",
|
|
1302
1297
|
"aria-hidden": "true"
|
|
1303
|
-
})), t.children && t.children.length ? (
|
|
1298
|
+
})), t.children && t.children.length ? (x(), o("span", {
|
|
1304
1299
|
key: 0,
|
|
1305
1300
|
class: g(["corner-indicator", { open: _.value === t.id }]),
|
|
1306
|
-
onClick: P((e) =>
|
|
1301
|
+
onClick: P((e) => re(t.id), ["stop"]),
|
|
1307
1302
|
"aria-label": "展开子菜单"
|
|
1308
1303
|
}, null, 10, or)) : a("", !0)], 42, ar), l(n, { name: "dropdown" }, {
|
|
1309
|
-
default: M(() => [_.value === t.id && t.children && t.children.length ? (
|
|
1304
|
+
default: M(() => [_.value === t.id && t.children && t.children.length ? (x(), o("div", {
|
|
1310
1305
|
key: 0,
|
|
1311
1306
|
class: "tool-dropdown",
|
|
1312
1307
|
onPointerdown: d[3] ||= P(() => {}, ["stop"]),
|
|
1313
1308
|
onPointermove: d[4] ||= P(() => {}, ["stop"]),
|
|
1314
1309
|
onPointerup: d[5] ||= P(() => {}, ["stop"])
|
|
1315
|
-
}, [(
|
|
1310
|
+
}, [(x(!0), o(e, null, w(t.children, (e) => (x(), o("button", {
|
|
1316
1311
|
key: e.id,
|
|
1317
1312
|
type: "button",
|
|
1318
1313
|
class: g(["left-toolbar__button", { active: h.value === e.id }]),
|
|
1319
1314
|
title: e.title,
|
|
1320
1315
|
"aria-label": e.title,
|
|
1321
|
-
onClick: (t) =>
|
|
1322
|
-
}, [(
|
|
1316
|
+
onClick: (t) => ne(e)
|
|
1317
|
+
}, [(x(), i(T(e.icon), {
|
|
1323
1318
|
class: "tool-icon",
|
|
1324
1319
|
"aria-hidden": "true"
|
|
1325
1320
|
}))], 10, sr))), 128))], 32)) : a("", !0)]),
|
|
@@ -1361,11 +1356,11 @@ var rr = {
|
|
|
1361
1356
|
onPointerdown: d[15] ||= P(() => {}, ["stop"]),
|
|
1362
1357
|
onPointermove: d[16] ||= P(() => {}, ["stop"]),
|
|
1363
1358
|
onPointerup: d[17] ||= P(() => {}, ["stop"])
|
|
1364
|
-
}, [u.isFullscreen ? (
|
|
1359
|
+
}, [u.isFullscreen ? (x(), i(O(On), {
|
|
1365
1360
|
key: 0,
|
|
1366
1361
|
class: "tool-icon",
|
|
1367
1362
|
"aria-hidden": "true"
|
|
1368
|
-
})) : (
|
|
1363
|
+
})) : (x(), i(O(Tn), {
|
|
1369
1364
|
key: 1,
|
|
1370
1365
|
class: "tool-icon",
|
|
1371
1366
|
"aria-hidden": "true"
|
|
@@ -1376,7 +1371,7 @@ var rr = {
|
|
|
1376
1371
|
class: "left-toolbar__button",
|
|
1377
1372
|
title: "设置",
|
|
1378
1373
|
"aria-label": "设置",
|
|
1379
|
-
onClick:
|
|
1374
|
+
onClick: z,
|
|
1380
1375
|
onPointerdown: d[18] ||= P(() => {}, ["stop"]),
|
|
1381
1376
|
onPointermove: d[19] ||= P(() => {}, ["stop"]),
|
|
1382
1377
|
onPointerup: d[20] ||= P(() => {}, ["stop"])
|
|
@@ -1384,11 +1379,11 @@ var rr = {
|
|
|
1384
1379
|
class: "tool-icon",
|
|
1385
1380
|
"aria-hidden": "true"
|
|
1386
1381
|
})], 32)])
|
|
1387
|
-
]), (
|
|
1388
|
-
default: M(() => [v.value ? (
|
|
1382
|
+
]), (x(), i(t, { to: O(y) }, [l(n, { name: "overlay" }, {
|
|
1383
|
+
default: M(() => [v.value ? (x(), o("div", {
|
|
1389
1384
|
key: 0,
|
|
1390
1385
|
class: "settings-overlay",
|
|
1391
|
-
onClick:
|
|
1386
|
+
onClick: B
|
|
1392
1387
|
}, [l(n, { name: "modal" }, {
|
|
1393
1388
|
default: M(() => [s("div", {
|
|
1394
1389
|
class: "settings-modal",
|
|
@@ -1396,47 +1391,47 @@ var rr = {
|
|
|
1396
1391
|
}, [
|
|
1397
1392
|
s("div", { class: "settings-header" }, [d[26] ||= s("div", { class: "header-left" }, [s("span", { class: "settings-title" }, "图表设置"), s("span", { class: "settings-subtitle" }, "个性化配置")], -1), s("div", { class: "header-right" }, [s("button", {
|
|
1398
1393
|
class: "settings-close",
|
|
1399
|
-
onClick:
|
|
1394
|
+
onClick: B
|
|
1400
1395
|
}, [...d[25] ||= [s("svg", {
|
|
1401
1396
|
viewBox: "0 0 24 24",
|
|
1402
1397
|
fill: "none",
|
|
1403
1398
|
stroke: "currentColor",
|
|
1404
1399
|
"stroke-width": "2"
|
|
1405
1400
|
}, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
|
|
1406
|
-
s("div", fr, [
|
|
1401
|
+
s("div", fr, [S.value.length > 0 ? (x(), o(e, { key: 0 }, [d[27] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "主图设置")], -1), (x(!0), o(e, null, w(S.value, (t) => (x(), o("div", {
|
|
1407
1402
|
key: t.key,
|
|
1408
1403
|
class: "settings-item"
|
|
1409
|
-
}, [s("label", pr, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((
|
|
1404
|
+
}, [s("label", pr, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((x(), o("input", {
|
|
1410
1405
|
key: 0,
|
|
1411
1406
|
type: "checkbox",
|
|
1412
1407
|
class: "settings-checkbox",
|
|
1413
|
-
"onUpdate:modelValue": (e) =>
|
|
1414
|
-
}, null, 8, mr)), [[k,
|
|
1408
|
+
"onUpdate:modelValue": (e) => L.value[t.key] = e
|
|
1409
|
+
}, null, 8, mr)), [[k, L.value[t.key]]]) : t.type === "select" && t.options ? N((x(), o("select", {
|
|
1415
1410
|
key: 1,
|
|
1416
1411
|
class: "settings-select",
|
|
1417
|
-
"onUpdate:modelValue": (e) =>
|
|
1418
|
-
}, [(
|
|
1412
|
+
"onUpdate:modelValue": (e) => L.value[t.key] = e
|
|
1413
|
+
}, [(x(!0), o(e, null, w(t.options, (e) => (x(), o("option", {
|
|
1419
1414
|
key: e.value,
|
|
1420
1415
|
value: e.value
|
|
1421
|
-
}, D(e.label), 9, gr))), 128))], 8, hr)), [[A,
|
|
1416
|
+
}, D(e.label), 9, gr))), 128))], 8, hr)), [[A, L.value[t.key]]]) : a("", !0)])]))), 128))], 64)) : a("", !0), E.value.length > 0 ? (x(), o(e, { key: 1 }, [d[28] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "实验性 / 调试设置")], -1), (x(!0), o(e, null, w(E.value, (t) => (x(), o("div", {
|
|
1422
1417
|
key: t.key,
|
|
1423
1418
|
class: "settings-item experimental"
|
|
1424
|
-
}, [s("label", _r, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((
|
|
1419
|
+
}, [s("label", _r, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((x(), o("input", {
|
|
1425
1420
|
key: 0,
|
|
1426
1421
|
type: "checkbox",
|
|
1427
1422
|
class: "settings-checkbox",
|
|
1428
|
-
"onUpdate:modelValue": (e) =>
|
|
1429
|
-
}, null, 8, vr)), [[k,
|
|
1423
|
+
"onUpdate:modelValue": (e) => L.value[t.key] = e
|
|
1424
|
+
}, null, 8, vr)), [[k, L.value[t.key]]]) : t.type === "select" && t.options ? N((x(), o("select", {
|
|
1430
1425
|
key: 1,
|
|
1431
1426
|
class: "settings-select",
|
|
1432
|
-
"onUpdate:modelValue": (e) =>
|
|
1433
|
-
}, [(
|
|
1427
|
+
"onUpdate:modelValue": (e) => L.value[t.key] = e
|
|
1428
|
+
}, [(x(!0), o(e, null, w(t.options, (e) => (x(), o("option", {
|
|
1434
1429
|
key: e.value,
|
|
1435
1430
|
value: e.value
|
|
1436
|
-
}, D(e.label), 9, br))), 128))], 8, yr)), [[A,
|
|
1431
|
+
}, D(e.label), 9, br))), 128))], 8, yr)), [[A, L.value[t.key]]]) : a("", !0)])]))), 128))], 64)) : a("", !0)]),
|
|
1437
1432
|
s("div", { class: "settings-footer" }, [s("button", {
|
|
1438
1433
|
class: "settings-btn reset",
|
|
1439
|
-
onClick:
|
|
1434
|
+
onClick: ie
|
|
1440
1435
|
}, [...d[29] ||= [s("svg", {
|
|
1441
1436
|
viewBox: "0 0 24 24",
|
|
1442
1437
|
fill: "none",
|
|
@@ -1444,10 +1439,10 @@ var rr = {
|
|
|
1444
1439
|
"stroke-width": "2"
|
|
1445
1440
|
}, [s("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), s("path", { d: "M3 3v5h5" })], -1), c(" 重置 ", -1)]]), s("div", { class: "footer-right" }, [s("button", {
|
|
1446
1441
|
class: "settings-btn cancel",
|
|
1447
|
-
onClick:
|
|
1442
|
+
onClick: B
|
|
1448
1443
|
}, "取消"), s("button", {
|
|
1449
1444
|
class: "settings-btn confirm",
|
|
1450
|
-
onClick:
|
|
1445
|
+
onClick: ae
|
|
1451
1446
|
}, [...d[30] ||= [s("svg", {
|
|
1452
1447
|
viewBox: "0 0 24 24",
|
|
1453
1448
|
fill: "none",
|
|
@@ -1463,7 +1458,13 @@ var rr = {
|
|
|
1463
1458
|
}), [["__scopeId", "data-v-3e3ffb4f"]]), Sr = ["data-theme"], Cr = {
|
|
1464
1459
|
class: "pane-separator-layer",
|
|
1465
1460
|
"aria-hidden": "true"
|
|
1466
|
-
}, wr =
|
|
1461
|
+
}, wr = {
|
|
1462
|
+
class: "canvas-layer",
|
|
1463
|
+
ref: "canvasLayerRef"
|
|
1464
|
+
}, Tr = {
|
|
1465
|
+
class: "x-axis-canvas",
|
|
1466
|
+
ref: "xAxisCanvasRef"
|
|
1467
|
+
}, Er = 4, Dr = /* @__PURE__ */ q(/* @__PURE__ */ u({
|
|
1467
1468
|
__name: "KLineChart",
|
|
1468
1469
|
props: {
|
|
1469
1470
|
semanticConfig: {},
|
|
@@ -1483,36 +1484,24 @@ var rr = {
|
|
|
1483
1484
|
},
|
|
1484
1485
|
emits: ["zoomLevelChange", "toggleFullscreen"],
|
|
1485
1486
|
setup(n, { expose: c, emit: u }) {
|
|
1486
|
-
let d = n, f = C(null), p = C(null), m = C(null), v = C(null),
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
zoomLevels: d.zoomLevels,
|
|
1491
|
-
rightAxisWidth: d.rightAxisWidth,
|
|
1492
|
-
priceLabelWidth: d.priceLabelWidth
|
|
1493
|
-
}), N = C("light");
|
|
1494
|
-
M.actions.setZoomState(M.state.zoomLevel, re(M.state.zoomLevel, {
|
|
1495
|
-
minKWidth: d.minKWidth,
|
|
1496
|
-
maxKWidth: d.maxKWidth,
|
|
1497
|
-
zoomLevelCount: d.zoomLevels,
|
|
1498
|
-
dpr: M.state.viewportDpr
|
|
1499
|
-
}), U(re(M.state.zoomLevel, {
|
|
1487
|
+
let d = n, f = C(null), p = C(null), m = C(null), v = C(null), y = C(null);
|
|
1488
|
+
me(m);
|
|
1489
|
+
let S = E(null), T = E(null), D = C(0), O = C(0), k = C(1), A = C(d.initialZoomLevel ?? 1), M = C(0), N = C(1), P = C(0), F = C({}), I = C(null), L = C([]), re = A.value;
|
|
1490
|
+
M.value = oe(re, {
|
|
1500
1491
|
minKWidth: d.minKWidth,
|
|
1501
1492
|
maxKWidth: d.maxKWidth,
|
|
1502
1493
|
zoomLevelCount: d.zoomLevels,
|
|
1503
|
-
dpr:
|
|
1504
|
-
}),
|
|
1505
|
-
let
|
|
1506
|
-
function
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
console.time("updateData-10k"), k.value?.updateData(e), console.timeEnd("updateData-10k"), M.actions.setDataLength(e.length), M.actions.bumpDataVersion();
|
|
1513
|
-
} else A.value && k.value?.getData()?.length === 1e4 && A.value.applyConfig(d.semanticConfig);
|
|
1494
|
+
dpr: k.value
|
|
1495
|
+
}), N.value = H(M.value, k.value);
|
|
1496
|
+
let B = C("light");
|
|
1497
|
+
function ie() {}
|
|
1498
|
+
function V(e) {
|
|
1499
|
+
if (S.value?.updateSettingsFacade(e), e.performanceTest10kKlines) {
|
|
1500
|
+
let e = U();
|
|
1501
|
+
console.time("updateData-10k"), S.value?.updateData(e), console.timeEnd("updateData-10k"), D.value = e.length, O.value++;
|
|
1502
|
+
} else T.value && S.value?.getData()?.length === 1e4 && T.value.applyConfig(d.semanticConfig);
|
|
1514
1503
|
}
|
|
1515
|
-
function
|
|
1504
|
+
function U() {
|
|
1516
1505
|
let e = [], t = (/* @__PURE__ */ new Date("2020-01-01")).getTime(), n = 3e3;
|
|
1517
1506
|
for (let r = 0; r < 1e4; r++) {
|
|
1518
1507
|
let i = t + r * 864e5, a = (Math.random() - .5) * 2 * .02 + 1e-4, o = n, s = o * (1 + a), c = Math.max(o, s) * (1 + Math.random() * .01), l = Math.min(o, s) * (1 - Math.random() * .01), u = Math.floor(1e6 + Math.random() * 5e6);
|
|
@@ -1527,34 +1516,34 @@ var rr = {
|
|
|
1527
1516
|
}
|
|
1528
1517
|
return e;
|
|
1529
1518
|
}
|
|
1530
|
-
function
|
|
1519
|
+
function le(e, t, n) {
|
|
1531
1520
|
let r = e.getBoundingClientRect();
|
|
1532
1521
|
return {
|
|
1533
1522
|
width: Math.max(t, Math.round(r.width)),
|
|
1534
1523
|
height: Math.max(n, Math.round(r.height))
|
|
1535
1524
|
};
|
|
1536
1525
|
}
|
|
1537
|
-
function
|
|
1526
|
+
function ue(e) {
|
|
1538
1527
|
e && h(() => {
|
|
1539
1528
|
if (!e.isConnected) return;
|
|
1540
|
-
let t =
|
|
1541
|
-
|
|
1529
|
+
let t = le(e, 180, 80);
|
|
1530
|
+
S.value?.setTooltipSize(t);
|
|
1542
1531
|
});
|
|
1543
1532
|
}
|
|
1544
|
-
function
|
|
1533
|
+
function de(e) {
|
|
1545
1534
|
e && h(() => {
|
|
1546
|
-
e.isConnected && (_e.value =
|
|
1535
|
+
e.isConnected && (_e.value = le(e, 120, 60));
|
|
1547
1536
|
});
|
|
1548
1537
|
}
|
|
1549
|
-
let
|
|
1538
|
+
let W = C({
|
|
1550
1539
|
x: 0,
|
|
1551
1540
|
y: 0
|
|
1552
|
-
}),
|
|
1541
|
+
}), G = C(!1), K = null;
|
|
1553
1542
|
function q() {
|
|
1554
|
-
|
|
1543
|
+
K = null;
|
|
1555
1544
|
}
|
|
1556
|
-
function
|
|
1557
|
-
return
|
|
1545
|
+
function pe(e) {
|
|
1546
|
+
return K ||= e.getBoundingClientRect(), K;
|
|
1558
1547
|
}
|
|
1559
1548
|
let J = E({
|
|
1560
1549
|
crosshairPos: null,
|
|
@@ -1575,13 +1564,13 @@ var rr = {
|
|
|
1575
1564
|
hoveredPaneBoundaryId: null,
|
|
1576
1565
|
isHoveringRightAxis: !1
|
|
1577
1566
|
}), Y = E(null), he = r(() => {
|
|
1578
|
-
let e =
|
|
1579
|
-
return e ?
|
|
1567
|
+
let e = I.value;
|
|
1568
|
+
return e ? L.value.find((t) => t.id === e) ?? null : null;
|
|
1580
1569
|
}), ge = C([]), _e = C({
|
|
1581
1570
|
width: 220,
|
|
1582
1571
|
height: 120
|
|
1583
1572
|
}), ve = r(() => {
|
|
1584
|
-
let e =
|
|
1573
|
+
let e = f.value, t = p.value;
|
|
1585
1574
|
return !e || !t ? {
|
|
1586
1575
|
x: 0,
|
|
1587
1576
|
y: 0
|
|
@@ -1589,81 +1578,83 @@ var rr = {
|
|
|
1589
1578
|
x: e.offsetLeft,
|
|
1590
1579
|
y: e.offsetTop
|
|
1591
1580
|
};
|
|
1592
|
-
}), ye = r(() => J.value.hoveredMarkerData), be = r(() => J.value.hoveredCustomMarker), xe = r(() => J.value.isDragging), Se = r(() => J.value.isResizingPaneBoundary), Ce = r(() => J.value.isHoveringPaneBoundary), we = r(() => J.value.hoveredPaneBoundaryId), Te = r(() => J.value.isHoveringRightAxis), Ee = r(() => J.value.hoveredIndex)
|
|
1581
|
+
}), ye = r(() => J.value.hoveredMarkerData), be = r(() => J.value.hoveredCustomMarker), xe = r(() => J.value.isDragging), Se = r(() => J.value.isResizingPaneBoundary), Ce = r(() => J.value.isHoveringPaneBoundary), we = r(() => J.value.hoveredPaneBoundaryId), Te = r(() => J.value.isHoveringRightAxis), Ee = r(() => J.value.hoveredIndex);
|
|
1582
|
+
r(() => J.value.crosshairIndex);
|
|
1583
|
+
let De = r(() => xe.value ? "grabbing" : Se.value || Ce.value ? "ns-resize" : Ee.value === null ? "crosshair" : "pointer"), Oe = r(() => {
|
|
1593
1584
|
let e = J.value.hoveredIndex;
|
|
1594
1585
|
if (typeof e != "number") return null;
|
|
1595
|
-
|
|
1596
|
-
let t =
|
|
1586
|
+
O.value;
|
|
1587
|
+
let t = S.value?.getData();
|
|
1597
1588
|
return t && e >= 0 && e < t.length ? t[e] : null;
|
|
1598
|
-
}),
|
|
1599
|
-
x:
|
|
1600
|
-
y:
|
|
1589
|
+
}), ke = r(() => J.value.hoveredIndex), Ae = r(() => J.value.tooltipPos), je = r(() => ({
|
|
1590
|
+
x: Ae.value.x + ve.value.x,
|
|
1591
|
+
y: Ae.value.y + ve.value.y
|
|
1592
|
+
})), Me = r(() => ({
|
|
1593
|
+
left: `${je.value.x}px`,
|
|
1594
|
+
top: `${je.value.y}px`
|
|
1601
1595
|
})), Ne = r(() => ({
|
|
1602
|
-
|
|
1603
|
-
|
|
1596
|
+
x: W.value.x + ve.value.x,
|
|
1597
|
+
y: W.value.y + ve.value.y
|
|
1604
1598
|
})), Pe = r(() => ({
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
})), Fe = r(() => ({
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
})
|
|
1611
|
-
|
|
1612
|
-
return de.value.x + 12 + _e.value.width + 12 > n ? "left-bottom" : "right-bottom";
|
|
1613
|
-
}), Re = r(() => (z.value, k.value?.getData() ?? []));
|
|
1614
|
-
function ze(e) {
|
|
1599
|
+
left: `${Ne.value.x}px`,
|
|
1600
|
+
top: `${Ne.value.y}px`
|
|
1601
|
+
})), Fe = r(() => J.value.tooltipAnchorPlacement), Ie = r(() => {
|
|
1602
|
+
let e = S.value?.viewport.peek(), t = f.value, n = e?.plotWidth ?? (t ? t.clientWidth : 0);
|
|
1603
|
+
return W.value.x + 12 + _e.value.width + 12 > n ? "left-bottom" : "right-bottom";
|
|
1604
|
+
}), Le = r(() => (O.value, S.value?.getData() ?? []));
|
|
1605
|
+
function Re(e) {
|
|
1615
1606
|
Y.value?.setTool(e);
|
|
1616
1607
|
}
|
|
1617
|
-
function
|
|
1608
|
+
function ze(e) {
|
|
1618
1609
|
let t = he.value;
|
|
1619
|
-
!t || !Y.value ||
|
|
1610
|
+
!t || !Y.value || Y.value.updateDrawingStyle(t.id, e);
|
|
1620
1611
|
}
|
|
1621
|
-
function
|
|
1612
|
+
function Be() {
|
|
1622
1613
|
let e = he.value;
|
|
1623
|
-
!e || !Y.value || (Y.value.removeDrawing(e.id),
|
|
1614
|
+
!e || !Y.value || (Y.value.removeDrawing(e.id), I.value = null, L.value = Y.value.getDrawings());
|
|
1624
1615
|
}
|
|
1625
|
-
function
|
|
1626
|
-
|
|
1616
|
+
function Ve(e) {
|
|
1617
|
+
S.value?.handlePointerEvent(e, { onPointerDown: (e, t) => Y.value?.onPointerDown(e, t) ? (L.value = Y.value.getDrawings(), !0) : !1 });
|
|
1627
1618
|
}
|
|
1628
|
-
function
|
|
1629
|
-
let t =
|
|
1619
|
+
function He(e) {
|
|
1620
|
+
let t = f.value;
|
|
1630
1621
|
if (t) {
|
|
1631
|
-
let n =
|
|
1632
|
-
|
|
1622
|
+
let n = pe(t);
|
|
1623
|
+
W.value = {
|
|
1633
1624
|
x: e.clientX - n.left,
|
|
1634
1625
|
y: e.clientY - n.top
|
|
1635
1626
|
};
|
|
1636
1627
|
}
|
|
1637
|
-
|
|
1628
|
+
S.value?.handlePointerEvent(e, { onPointerMove: (e, t) => Y.value?.onPointerMove(e, t) ? (L.value = Y.value.getDrawings(), !0) : !1 });
|
|
1629
|
+
}
|
|
1630
|
+
function Ue(e) {
|
|
1631
|
+
S.value?.handlePointerEvent(e, { onPointerUp: (e, t) => Y.value?.onPointerUp(e, t) ? (L.value = Y.value.getDrawings(), !0) : !1 });
|
|
1638
1632
|
}
|
|
1639
1633
|
function We(e) {
|
|
1640
|
-
|
|
1634
|
+
S.value?.handlePointerEvent(e);
|
|
1641
1635
|
}
|
|
1642
1636
|
function Ge(e) {
|
|
1643
|
-
|
|
1637
|
+
S.value?.handlePointerEvent(e);
|
|
1644
1638
|
}
|
|
1645
1639
|
function Ke(e) {
|
|
1646
|
-
|
|
1640
|
+
S.value?.handlePointerEvent(e);
|
|
1647
1641
|
}
|
|
1648
1642
|
function qe(e) {
|
|
1649
|
-
|
|
1643
|
+
S.value?.handlePointerEvent(e);
|
|
1650
1644
|
}
|
|
1651
1645
|
function Je(e) {
|
|
1652
|
-
|
|
1646
|
+
S.value?.handlePointerEvent(e);
|
|
1653
1647
|
}
|
|
1654
|
-
function Ye(
|
|
1655
|
-
|
|
1648
|
+
function Ye() {
|
|
1649
|
+
S.value?.handleScrollEvent();
|
|
1656
1650
|
}
|
|
1657
|
-
|
|
1658
|
-
k.value?.handleScrollEvent();
|
|
1659
|
-
}
|
|
1660
|
-
let Ze = C([]), Qe = r(() => {
|
|
1651
|
+
let Xe = C([]), Ze = r(() => {
|
|
1661
1652
|
let e = [], t = /* @__PURE__ */ new Set();
|
|
1662
1653
|
for (let n of Z.value) t.has(n.indicatorId) || (t.add(n.indicatorId), e.push(n.indicatorId));
|
|
1663
1654
|
return e;
|
|
1664
|
-
}),
|
|
1665
|
-
function
|
|
1666
|
-
let e =
|
|
1655
|
+
}), Qe = r(() => [...Xe.value, ...Ze.value]), X = C({}), Z = C([]);
|
|
1656
|
+
function $e() {
|
|
1657
|
+
let e = F.value.main ?? 3;
|
|
1667
1658
|
return Z.value.length === 0 ? [{
|
|
1668
1659
|
id: "main",
|
|
1669
1660
|
ratio: e,
|
|
@@ -1676,78 +1667,49 @@ var rr = {
|
|
|
1676
1667
|
role: "price"
|
|
1677
1668
|
}, ...Z.value.map((e) => ({
|
|
1678
1669
|
id: e.id,
|
|
1679
|
-
ratio:
|
|
1670
|
+
ratio: F.value[e.id] ?? 1,
|
|
1680
1671
|
visible: !0,
|
|
1681
1672
|
role: "indicator"
|
|
1682
1673
|
}))];
|
|
1683
1674
|
}
|
|
1684
|
-
function
|
|
1685
|
-
return { ...
|
|
1686
|
-
}
|
|
1687
|
-
let nt = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Map();
|
|
1688
|
-
function it(e, t) {
|
|
1689
|
-
let n = oe({
|
|
1690
|
-
paneId: e,
|
|
1691
|
-
title: t,
|
|
1692
|
-
getTitleInfo: () => pt(e)
|
|
1693
|
-
});
|
|
1694
|
-
k.value?.useRenderer(n), rt.set(e, n.name);
|
|
1675
|
+
function et(e) {
|
|
1676
|
+
return { ...ne[e].defaultParams };
|
|
1695
1677
|
}
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1678
|
+
let tt = /* @__PURE__ */ new Map();
|
|
1679
|
+
function nt(e = "VOLUME", t) {
|
|
1680
|
+
if (Z.value.length >= Er) return !1;
|
|
1681
|
+
let n = t ?? et(e);
|
|
1682
|
+
return !!S.value?.addIndicator(e, "sub", n);
|
|
1699
1683
|
}
|
|
1700
|
-
function
|
|
1701
|
-
|
|
1702
|
-
let n = t ?? tt(e), r = k.value?.addIndicator(e, "sub", n);
|
|
1703
|
-
return r ? (it(r, e), !0) : !1;
|
|
1684
|
+
function rt(e) {
|
|
1685
|
+
S.value?.removeIndicator(e);
|
|
1704
1686
|
}
|
|
1705
|
-
function
|
|
1706
|
-
|
|
1687
|
+
function it() {
|
|
1688
|
+
for (let e of Z.value) S.value?.removeIndicator(e.id);
|
|
1689
|
+
tt.clear();
|
|
1707
1690
|
}
|
|
1708
|
-
function
|
|
1709
|
-
|
|
1710
|
-
nt.clear(), rt.clear();
|
|
1711
|
-
}
|
|
1712
|
-
function lt() {
|
|
1713
|
-
let e = d.semanticConfig, t = k.value;
|
|
1691
|
+
function at() {
|
|
1692
|
+
let e = d.semanticConfig, t = S.value;
|
|
1714
1693
|
if (!t) return;
|
|
1715
1694
|
let n = e.indicators?.main;
|
|
1716
|
-
if (n) for (let e of n) e.enabled && t.
|
|
1695
|
+
if (n) for (let e of n) e.enabled && t.addIndicator(e.type, "main", e.params);
|
|
1717
1696
|
}
|
|
1718
|
-
function
|
|
1719
|
-
let e =
|
|
1720
|
-
rt.clear();
|
|
1697
|
+
function ot() {
|
|
1698
|
+
let e = S.value?.subPanes.peek() ?? [];
|
|
1721
1699
|
for (let t of e) {
|
|
1722
1700
|
let { paneId: e, indicatorId: n, params: r } = t, i = e.match(/^(.+)_(\d+)$/);
|
|
1723
1701
|
if (i) {
|
|
1724
1702
|
let [, e, t] = i, n = parseInt(t, 10);
|
|
1725
|
-
n >= (
|
|
1703
|
+
n >= (tt.get(e) ?? 0) && tt.set(e, n + 1);
|
|
1726
1704
|
}
|
|
1727
|
-
it(e, n);
|
|
1728
1705
|
}
|
|
1729
1706
|
}
|
|
1730
|
-
function
|
|
1731
|
-
let n =
|
|
1732
|
-
|
|
1733
|
-
}
|
|
1734
|
-
let ft = /* @__PURE__ */ new Map();
|
|
1735
|
-
function pt(e) {
|
|
1736
|
-
let t = Z.value.find((t) => t.id === e);
|
|
1737
|
-
if (!t) return null;
|
|
1738
|
-
let n = k.value?.getData();
|
|
1739
|
-
if (!n || n.length === 0) return null;
|
|
1740
|
-
let r = De.value, i = n.length, a = ft.get(e);
|
|
1741
|
-
if (a && a.idx === r && a.dataLen === i) return a.result;
|
|
1742
|
-
let o = ae[t.indicatorId], s = t.params, c = k.value?.plugin, l = c ? o.getTitleInfo(n, r, s, c, e) : null;
|
|
1743
|
-
return ft.set(e, {
|
|
1744
|
-
idx: r,
|
|
1745
|
-
dataLen: i,
|
|
1746
|
-
result: l
|
|
1747
|
-
}), l;
|
|
1707
|
+
function st(e, t) {
|
|
1708
|
+
let n = et(t);
|
|
1709
|
+
S.value?.replaceSubPaneIndicator(e, t, n);
|
|
1748
1710
|
}
|
|
1749
|
-
function
|
|
1750
|
-
let n =
|
|
1711
|
+
function ct(e, t) {
|
|
1712
|
+
let n = S.value;
|
|
1751
1713
|
if (n) {
|
|
1752
1714
|
if ([
|
|
1753
1715
|
"MA",
|
|
@@ -1769,42 +1731,33 @@ var rr = {
|
|
|
1769
1731
|
"STRUCTURE",
|
|
1770
1732
|
"ZONES"
|
|
1771
1733
|
].includes(e)) {
|
|
1772
|
-
let r =
|
|
1773
|
-
|
|
1774
|
-
else if (!t && r) {
|
|
1775
|
-
let t = e.toUpperCase();
|
|
1776
|
-
n.removeIndicator(t);
|
|
1777
|
-
}
|
|
1734
|
+
let r = Xe.value.find((t) => t === e);
|
|
1735
|
+
t && !r ? n.addIndicator(e, "main", X.value[e]) : !t && r && n.removeIndicator(e.toUpperCase());
|
|
1778
1736
|
return;
|
|
1779
1737
|
}
|
|
1780
|
-
if (
|
|
1781
|
-
if (Z.value.find((t) => t.indicatorId === e) || Z.value.length >=
|
|
1782
|
-
|
|
1783
|
-
if (t) it(t, e);
|
|
1784
|
-
else if (Z.value.length > 0) {
|
|
1738
|
+
if (R.includes(e)) if (t) {
|
|
1739
|
+
if (Z.value.find((t) => t.indicatorId === e) || Z.value.length >= Er) return;
|
|
1740
|
+
if (!n.addIndicator(e, "sub", X.value[e]) && Z.value.length > 0) {
|
|
1785
1741
|
let t = Z.value[Z.value.length - 1];
|
|
1786
|
-
|
|
1742
|
+
st(t.id, e);
|
|
1787
1743
|
}
|
|
1788
1744
|
} else Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
|
|
1789
|
-
n.removeIndicator(e.id)
|
|
1745
|
+
n.removeIndicator(e.id);
|
|
1790
1746
|
});
|
|
1791
1747
|
}
|
|
1792
1748
|
}
|
|
1793
|
-
function
|
|
1749
|
+
function lt(e, t) {
|
|
1794
1750
|
if (e === "MA" || e === "BOLL" || e === "EXPMA" || e === "ENE") {
|
|
1795
|
-
|
|
1796
|
-
return;
|
|
1797
|
-
}
|
|
1798
|
-
if (ie.includes(e)) {
|
|
1799
|
-
Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
|
|
1800
|
-
k.value?.updateSubPaneParams(e.id, t);
|
|
1801
|
-
});
|
|
1751
|
+
S.value?.updateIndicatorParams(e, t);
|
|
1802
1752
|
return;
|
|
1803
1753
|
}
|
|
1754
|
+
R.includes(e) && Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
|
|
1755
|
+
S.value?.updateIndicatorParams(e.id, t);
|
|
1756
|
+
});
|
|
1804
1757
|
}
|
|
1805
|
-
function
|
|
1758
|
+
function ut(e) {
|
|
1806
1759
|
if (!e.length || Z.value.length <= 1) return;
|
|
1807
|
-
let t = e.filter((e) =>
|
|
1760
|
+
let t = e.filter((e) => R.includes(e));
|
|
1808
1761
|
if (!t.length) return;
|
|
1809
1762
|
let n = new Map(Z.value.map((e) => [e.indicatorId, e])), r = [];
|
|
1810
1763
|
for (let e of t) {
|
|
@@ -1816,101 +1769,86 @@ var rr = {
|
|
|
1816
1769
|
let i = Z.value.map((e) => e.id), a = r.map((e) => e.id);
|
|
1817
1770
|
if (i.join("|") === a.join("|")) return;
|
|
1818
1771
|
Z.value = r;
|
|
1819
|
-
let o =
|
|
1820
|
-
o && o.updatePaneLayout(
|
|
1772
|
+
let o = S.value;
|
|
1773
|
+
o && o.updatePaneLayout($e());
|
|
1821
1774
|
}
|
|
1822
|
-
let
|
|
1823
|
-
function
|
|
1824
|
-
let e =
|
|
1775
|
+
let dt = r(() => d.rightAxisWidth + d.priceLabelWidth), ft = r(() => S.value?.getContentWidth() ?? 0);
|
|
1776
|
+
function pt() {
|
|
1777
|
+
let e = f.value, t = S.value;
|
|
1825
1778
|
if (!e || !t) return;
|
|
1826
1779
|
let n = t.getData()?.length ?? 0;
|
|
1827
1780
|
if (n === 0) return;
|
|
1828
|
-
let r = t.
|
|
1829
|
-
e.scrollLeft = Math.round(c * r) / r
|
|
1781
|
+
let r = t.viewport.peek().dpr, { unitPx: i, startXPx: a } = ae(M.value, N.value, r), o = (a + n * i) / r, s = Math.max(0, e.scrollWidth - e.clientWidth), c = Math.min(s, Math.max(0, o - e.clientWidth));
|
|
1782
|
+
e.scrollLeft = Math.round(c * r) / r;
|
|
1830
1783
|
}
|
|
1831
|
-
function
|
|
1832
|
-
|
|
1833
|
-
n && n.zoomToLevel(e, t);
|
|
1784
|
+
function mt(e, t) {
|
|
1785
|
+
S.value?.zoomToLevel(e, t);
|
|
1834
1786
|
}
|
|
1835
1787
|
c({
|
|
1836
|
-
scheduleRender:
|
|
1837
|
-
scrollToRight:
|
|
1838
|
-
addSubPane:
|
|
1839
|
-
removeSubPane:
|
|
1840
|
-
switchSubIndicator:
|
|
1841
|
-
clearAllSubPanes:
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
zoomOut: (e) => bt(P.value - 1, e),
|
|
1848
|
-
getZoomLevel: () => P.value,
|
|
1849
|
-
getZoomLevelCount: () => k.value?.getZoomLevelCount() ?? 10
|
|
1788
|
+
scheduleRender: ie,
|
|
1789
|
+
scrollToRight: pt,
|
|
1790
|
+
addSubPane: nt,
|
|
1791
|
+
removeSubPane: rt,
|
|
1792
|
+
switchSubIndicator: st,
|
|
1793
|
+
clearAllSubPanes: it,
|
|
1794
|
+
zoomToLevel: mt,
|
|
1795
|
+
zoomIn: (e) => mt(A.value + 1, e),
|
|
1796
|
+
zoomOut: (e) => mt(A.value - 1, e),
|
|
1797
|
+
getZoomLevel: () => A.value,
|
|
1798
|
+
getZoomLevelCount: () => S.value?.getZoomLevelCount() ?? 10
|
|
1850
1799
|
});
|
|
1851
|
-
function
|
|
1852
|
-
|
|
1853
|
-
e.preventDefault();
|
|
1854
|
-
let t = k.value;
|
|
1855
|
-
t && t.handleWheelEvent(e);
|
|
1800
|
+
function ht() {
|
|
1801
|
+
return (e) => {
|
|
1802
|
+
e.preventDefault(), S.value?.handleWheelEvent(e);
|
|
1856
1803
|
};
|
|
1857
|
-
return e.addEventListener("wheel", t, { passive: !1 }), t;
|
|
1858
1804
|
}
|
|
1859
|
-
function
|
|
1860
|
-
return
|
|
1805
|
+
function gt(e, t, n, r) {
|
|
1806
|
+
return z({
|
|
1861
1807
|
container: e,
|
|
1808
|
+
data: [],
|
|
1862
1809
|
canvasLayer: t,
|
|
1863
1810
|
rightAxisLayer: n,
|
|
1864
|
-
xAxisCanvas: r
|
|
1865
|
-
|
|
1811
|
+
xAxisCanvas: r,
|
|
1812
|
+
initialZoomLevel: d.initialZoomLevel,
|
|
1813
|
+
zoomLevels: d.zoomLevels,
|
|
1866
1814
|
yPaddingPx: d.yPaddingPx,
|
|
1867
1815
|
rightAxisWidth: d.rightAxisWidth,
|
|
1868
1816
|
bottomAxisHeight: d.bottomAxisHeight,
|
|
1869
1817
|
priceLabelWidth: d.priceLabelWidth,
|
|
1870
1818
|
minKWidth: d.minKWidth,
|
|
1871
|
-
maxKWidth: d.maxKWidth
|
|
1872
|
-
panes: [{
|
|
1873
|
-
id: "main",
|
|
1874
|
-
ratio: 1
|
|
1875
|
-
}],
|
|
1876
|
-
paneGap: 0,
|
|
1877
|
-
zoomLevels: d.zoomLevels,
|
|
1878
|
-
initialZoomLevel: d.initialZoomLevel
|
|
1819
|
+
maxKWidth: d.maxKWidth
|
|
1879
1820
|
});
|
|
1880
1821
|
}
|
|
1881
|
-
function
|
|
1882
|
-
e.
|
|
1822
|
+
function _t(e) {
|
|
1823
|
+
let t = e.paneLayout.subscribe(() => {
|
|
1883
1824
|
q();
|
|
1884
|
-
let t =
|
|
1885
|
-
ge.value =
|
|
1886
|
-
let
|
|
1825
|
+
let t = f.value && parseInt(getComputedStyle(f.value).borderTopWidth) || 0;
|
|
1826
|
+
ge.value = e.paneLayout.peek().slice(0, -1).map((n) => {
|
|
1827
|
+
let r = e.getPaneInfo(n.id), i = (r?.top ?? 0) + (r?.height ?? 0);
|
|
1887
1828
|
return {
|
|
1888
|
-
id:
|
|
1889
|
-
top:
|
|
1829
|
+
id: n.id,
|
|
1830
|
+
top: i + t
|
|
1890
1831
|
};
|
|
1891
1832
|
});
|
|
1892
|
-
})
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
M.actions.setPaneRatios({ ...t });
|
|
1896
|
-
}), n = e.viewport.subscribe(() => {
|
|
1833
|
+
}), n = e.paneRatios.subscribe(() => {
|
|
1834
|
+
F.value = { ...e.paneRatios.peek() };
|
|
1835
|
+
}), r = e.viewport.subscribe(() => {
|
|
1897
1836
|
let t = e.viewport.peek();
|
|
1898
|
-
|
|
1837
|
+
k.value !== t.dpr && (k.value = t.dpr), P.value !== t.plotWidth && (P.value = t.plotWidth), (A.value !== t.zoomLevel || M.value !== t.kWidth || N.value !== t.kGap) && (A.value = t.zoomLevel, M.value = t.kWidth, N.value = t.kGap);
|
|
1899
1838
|
let n = t.desiredScrollLeft;
|
|
1900
|
-
n !== void 0 && n !==
|
|
1901
|
-
let
|
|
1902
|
-
if (!
|
|
1903
|
-
let r = Math.max(0,
|
|
1904
|
-
|
|
1839
|
+
n !== void 0 && n !== f.value?.scrollLeft && (q(), h(() => {
|
|
1840
|
+
let e = f.value;
|
|
1841
|
+
if (!e) return;
|
|
1842
|
+
let r = Math.max(0, e.scrollWidth - e.clientWidth), i = Math.min(Math.max(0, n), r), a = t.dpr;
|
|
1843
|
+
e.scrollLeft = Math.round(i * a) / a;
|
|
1905
1844
|
}));
|
|
1906
|
-
}),
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
}), a = e.indicators.subscribe(() => {
|
|
1845
|
+
}), i = e.data.subscribe(() => {
|
|
1846
|
+
D.value = e.data.peek().length, O.value++;
|
|
1847
|
+
}), a = e.theme.subscribe(() => {
|
|
1848
|
+
B.value = e.theme.peek();
|
|
1849
|
+
}), o = e.indicators.subscribe(() => {
|
|
1912
1850
|
let t = e.indicators.peek(), n = t.filter((e) => e.role === "main").map((e) => e.definitionId);
|
|
1913
|
-
|
|
1851
|
+
Xe.value = n;
|
|
1914
1852
|
let r = { ...X.value };
|
|
1915
1853
|
for (let e of t) e.role === "main" && e.params && Object.keys(e.params).length > 0 && (r[e.definitionId] = { ...e.params });
|
|
1916
1854
|
e.updateRendererConfig("mainIndicatorLegend", { indicators: {
|
|
@@ -1931,7 +1869,7 @@ var rr = {
|
|
|
1931
1869
|
params: r.ENE || {}
|
|
1932
1870
|
}
|
|
1933
1871
|
} }), X.value = r;
|
|
1934
|
-
}),
|
|
1872
|
+
}), s = e.subPanes.subscribe(() => {
|
|
1935
1873
|
let t = e.subPanes.peek(), n = new Set(t.map((e) => e.paneId)), r = Z.value.filter((e) => n.has(e.id)), i = new Set(r.map((e) => e.id));
|
|
1936
1874
|
for (let e of t) i.has(e.paneId) || r.push({
|
|
1937
1875
|
id: e.paneId,
|
|
@@ -1943,71 +1881,65 @@ var rr = {
|
|
|
1943
1881
|
for (let e of t) e.params && Object.keys(e.params).length > 0 && (a[e.indicatorId] = { ...e.params });
|
|
1944
1882
|
X.value = a;
|
|
1945
1883
|
});
|
|
1946
|
-
|
|
1947
|
-
|
|
1884
|
+
b(() => {
|
|
1885
|
+
r(), i(), n(), t(), a(), o(), s();
|
|
1948
1886
|
});
|
|
1949
1887
|
}
|
|
1950
|
-
function
|
|
1951
|
-
let t =
|
|
1952
|
-
if (e.
|
|
1953
|
-
let t =
|
|
1888
|
+
function vt(e) {
|
|
1889
|
+
let t = y.value?.getSettings() ?? { showVolumePriceMarkers: !0 };
|
|
1890
|
+
if (e.updateSettingsFacade(t), t.performanceTest10kKlines) {
|
|
1891
|
+
let t = U();
|
|
1954
1892
|
console.time("updateData-10k"), e.updateData(t), console.timeEnd("updateData-10k");
|
|
1955
1893
|
}
|
|
1956
1894
|
}
|
|
1957
|
-
function
|
|
1958
|
-
Y.value = new
|
|
1895
|
+
function yt(e) {
|
|
1896
|
+
Y.value = new te(e), Y.value.setCallbacks({
|
|
1959
1897
|
onDrawingCreated: (e) => {
|
|
1960
|
-
|
|
1898
|
+
L.value = [...L.value, e], I.value = e.id;
|
|
1961
1899
|
},
|
|
1962
1900
|
onToolChange: () => {},
|
|
1963
1901
|
onDrawingSelected: (e) => {
|
|
1964
|
-
|
|
1902
|
+
I.value = e?.id ?? null;
|
|
1965
1903
|
}
|
|
1966
1904
|
});
|
|
1967
1905
|
}
|
|
1968
|
-
function
|
|
1969
|
-
e.
|
|
1970
|
-
J.value = e;
|
|
1971
|
-
}), e.
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
let i = n - r.getBoundingClientRect().left;
|
|
1976
|
-
e.handlePinchZoom(t, i);
|
|
1977
|
-
}), J.value = e.interaction.getInteractionSnapshot(), M.actions.setViewportDpr(e.getCurrentDpr()), e.resize();
|
|
1978
|
-
}
|
|
1979
|
-
function Ot(e) {
|
|
1980
|
-
te(d.dataFetcher), A.value = new V(e), A.value.on("config:error", (e) => {
|
|
1906
|
+
function bt(e) {
|
|
1907
|
+
e.setTooltipAnchorPositioning(G.value), e.interactionState.subscribe(() => {
|
|
1908
|
+
J.value = e.interactionState.peek();
|
|
1909
|
+
}), J.value = e.interactionState.peek(), k.value = e.viewport.peek().dpr;
|
|
1910
|
+
}
|
|
1911
|
+
function xt(e) {
|
|
1912
|
+
ce(d.dataFetcher), T.value = new se(e), T.value.on("config:error", (e) => {
|
|
1981
1913
|
console.error("Semantic config error:", e);
|
|
1982
|
-
}),
|
|
1983
|
-
|
|
1984
|
-
}),
|
|
1914
|
+
}), T.value.on("config:ready", () => {
|
|
1915
|
+
at(), ot(), h(() => pt());
|
|
1916
|
+
}), T.value.applyConfig(d.semanticConfig).then((e) => {
|
|
1985
1917
|
e && !e.success && console.error("Semantic config apply failed:", e.errors);
|
|
1986
1918
|
});
|
|
1987
1919
|
}
|
|
1988
|
-
return
|
|
1989
|
-
|
|
1990
|
-
let e =
|
|
1991
|
-
if (!e || !t
|
|
1992
|
-
let
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
}
|
|
2000
|
-
k.value = null, Y.value = null;
|
|
1920
|
+
return ee(() => {
|
|
1921
|
+
G.value = !1;
|
|
1922
|
+
let e = f.value, t = p.value;
|
|
1923
|
+
if (!e || !t) return;
|
|
1924
|
+
let n = ht();
|
|
1925
|
+
e.addEventListener("wheel", n, { passive: !1 });
|
|
1926
|
+
let r = e.querySelector(".canvas-layer"), i = e.querySelector(".x-axis-canvas"), a = gt(e, r, t.querySelector(".right-axis-host"), i);
|
|
1927
|
+
S.value = a, _t(a), vt(a), yt(a), bt(a), xt(a);
|
|
1928
|
+
}), b(() => {
|
|
1929
|
+
let e = S.value;
|
|
1930
|
+
e && (S.value = null, e.dispose()), Y.value = null;
|
|
2001
1931
|
}), j(() => d.yPaddingPx, (e) => {
|
|
2002
|
-
|
|
1932
|
+
S.value?.updateOptionsFacade({ yPaddingPx: e });
|
|
2003
1933
|
}), j(() => d.semanticConfig, async (e, t) => {
|
|
2004
1934
|
if (e && e !== t) {
|
|
2005
|
-
let t = await
|
|
1935
|
+
let t = await T.value?.applyConfig(e);
|
|
2006
1936
|
t && !t.success && console.error("Semantic config apply failed:", t.errors);
|
|
2007
1937
|
}
|
|
2008
|
-
}, { deep: !0 }), (r, c) => (
|
|
1938
|
+
}, { deep: !0 }), (r, c) => (x(), o("div", {
|
|
1939
|
+
ref_key: "chartWrapperRef",
|
|
1940
|
+
ref: m,
|
|
2009
1941
|
class: "chart-wrapper",
|
|
2010
|
-
"data-theme":
|
|
1942
|
+
"data-theme": B.value
|
|
2011
1943
|
}, [s("div", { class: g(["chart-stage", {
|
|
2012
1944
|
"is-dragging": xe.value,
|
|
2013
1945
|
"is-resizing-pane": Se.value,
|
|
@@ -2016,78 +1948,70 @@ var rr = {
|
|
|
2016
1948
|
"is-hovering-kline": Ee.value !== null
|
|
2017
1949
|
}]) }, [l(xr, {
|
|
2018
1950
|
ref_key: "toolbarRef",
|
|
2019
|
-
ref:
|
|
1951
|
+
ref: y,
|
|
2020
1952
|
"is-fullscreen": n.isFullscreen,
|
|
2021
|
-
onSelectTool:
|
|
1953
|
+
onSelectTool: Re,
|
|
2022
1954
|
onToggleFullscreen: c[0] ||= (e) => r.$emit("toggleFullscreen"),
|
|
2023
|
-
onZoomIn: c[1] ||= (e) =>
|
|
2024
|
-
onZoomOut: c[2] ||= (e) =>
|
|
2025
|
-
onSettingsChange:
|
|
1955
|
+
onZoomIn: c[1] ||= (e) => mt(A.value + 1),
|
|
1956
|
+
onZoomOut: c[2] ||= (e) => mt(A.value - 1),
|
|
1957
|
+
onSettingsChange: V
|
|
2026
1958
|
}, null, 8, ["is-fullscreen"]), s("div", {
|
|
2027
1959
|
class: "chart-main",
|
|
2028
1960
|
ref_key: "chartMainRef",
|
|
2029
|
-
ref:
|
|
1961
|
+
ref: p
|
|
2030
1962
|
}, [
|
|
2031
|
-
s("div", Cr, [(
|
|
1963
|
+
s("div", Cr, [(x(!0), o(e, null, w(ge.value, (e) => (x(), o("div", {
|
|
2032
1964
|
key: e.id,
|
|
2033
1965
|
class: g(["pane-separator-line", { "is-active": we.value === e.id }]),
|
|
2034
1966
|
style: _({ top: `${e.top}px` })
|
|
2035
1967
|
}, null, 6))), 128))]),
|
|
2036
1968
|
s("div", {
|
|
2037
1969
|
ref_key: "tooltipLayerRef",
|
|
2038
|
-
ref:
|
|
1970
|
+
ref: v,
|
|
2039
1971
|
class: "tooltip-layer"
|
|
2040
1972
|
}, null, 512),
|
|
2041
1973
|
s("div", {
|
|
2042
1974
|
class: "chart-container",
|
|
2043
|
-
style: _({ cursor:
|
|
1975
|
+
style: _({ cursor: De.value }),
|
|
2044
1976
|
ref_key: "containerRef",
|
|
2045
|
-
ref:
|
|
2046
|
-
onScrollPassive:
|
|
2047
|
-
onPointerdown:
|
|
2048
|
-
onPointermove:
|
|
2049
|
-
onPointerup:
|
|
2050
|
-
onPointerleave:
|
|
1977
|
+
ref: f,
|
|
1978
|
+
onScrollPassive: Ye,
|
|
1979
|
+
onPointerdown: Ve,
|
|
1980
|
+
onPointermove: He,
|
|
1981
|
+
onPointerup: Ue,
|
|
1982
|
+
onPointerleave: We
|
|
2051
1983
|
}, [s("div", {
|
|
2052
1984
|
class: "scroll-content",
|
|
2053
|
-
style: _({ width:
|
|
2054
|
-
}, [s("div", {
|
|
2055
|
-
class: "canvas-layer",
|
|
2056
|
-
ref_key: "canvasLayerRef",
|
|
2057
|
-
ref: p
|
|
2058
|
-
}, [s("canvas", {
|
|
2059
|
-
class: "x-axis-canvas",
|
|
2060
|
-
ref_key: "xAxisCanvasRef",
|
|
2061
|
-
ref: f
|
|
2062
|
-
}, null, 512), he.value ? (S(), i(pe, {
|
|
1985
|
+
style: _({ width: ft.value + "px" })
|
|
1986
|
+
}, [s("div", wr, [s("canvas", Tr, null, 512), he.value ? (x(), i(fe, {
|
|
2063
1987
|
key: 0,
|
|
2064
1988
|
drawing: he.value,
|
|
2065
|
-
onUpdateStyle:
|
|
2066
|
-
onDelete:
|
|
1989
|
+
onUpdateStyle: ze,
|
|
1990
|
+
onDelete: Be
|
|
2067
1991
|
}, null, 8, ["drawing"])) : a("", !0)], 512)], 4)], 36),
|
|
2068
|
-
|
|
1992
|
+
v.value ? (x(), i(t, {
|
|
2069
1993
|
key: 0,
|
|
2070
|
-
to:
|
|
1994
|
+
to: v.value
|
|
2071
1995
|
}, [
|
|
2072
|
-
|
|
1996
|
+
Oe.value ? (x(), o("div", {
|
|
2073
1997
|
key: 0,
|
|
2074
|
-
class: g(["tooltip-anchor kline-tooltip-anchor", { "use-anchor":
|
|
2075
|
-
style: _(
|
|
1998
|
+
class: g(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": G.value }]),
|
|
1999
|
+
style: _(Me.value)
|
|
2076
2000
|
}, null, 6)) : a("", !0),
|
|
2077
|
-
ye.value || be.value ? (
|
|
2001
|
+
ye.value || be.value ? (x(), o("div", {
|
|
2078
2002
|
key: 1,
|
|
2079
|
-
class: g(["tooltip-anchor marker-tooltip-anchor", { "use-anchor":
|
|
2080
|
-
style: _(
|
|
2003
|
+
class: g(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": G.value }]),
|
|
2004
|
+
style: _(Pe.value)
|
|
2081
2005
|
}, null, 6)) : a("", !0),
|
|
2082
|
-
|
|
2006
|
+
Oe.value ? (x(), i(Ht, {
|
|
2083
2007
|
key: 2,
|
|
2084
|
-
k:
|
|
2085
|
-
index:
|
|
2086
|
-
data:
|
|
2087
|
-
pos:
|
|
2088
|
-
"set-el":
|
|
2089
|
-
"use-anchor":
|
|
2090
|
-
"anchor-placement":
|
|
2008
|
+
k: Oe.value,
|
|
2009
|
+
index: ke.value,
|
|
2010
|
+
data: Le.value,
|
|
2011
|
+
pos: je.value,
|
|
2012
|
+
"set-el": ue,
|
|
2013
|
+
"use-anchor": G.value,
|
|
2014
|
+
"anchor-placement": Fe.value
|
|
2091
2015
|
}, null, 8, [
|
|
2092
2016
|
"k",
|
|
2093
2017
|
"index",
|
|
@@ -2096,13 +2020,13 @@ var rr = {
|
|
|
2096
2020
|
"use-anchor",
|
|
2097
2021
|
"anchor-placement"
|
|
2098
2022
|
])) : a("", !0),
|
|
2099
|
-
ye.value || be.value ? (
|
|
2023
|
+
ye.value || be.value ? (x(), i(Gt, {
|
|
2100
2024
|
key: 3,
|
|
2101
2025
|
marker: ye.value || be.value,
|
|
2102
|
-
pos:
|
|
2103
|
-
"use-anchor":
|
|
2104
|
-
"anchor-placement":
|
|
2105
|
-
"set-el":
|
|
2026
|
+
pos: Ne.value,
|
|
2027
|
+
"use-anchor": G.value,
|
|
2028
|
+
"anchor-placement": Ie.value,
|
|
2029
|
+
"set-el": de
|
|
2106
2030
|
}, null, 8, [
|
|
2107
2031
|
"marker",
|
|
2108
2032
|
"pos",
|
|
@@ -2112,25 +2036,24 @@ var rr = {
|
|
|
2112
2036
|
], 8, ["to"])) : a("", !0),
|
|
2113
2037
|
s("div", {
|
|
2114
2038
|
class: "right-axis-host",
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
onPointerleave: Ye
|
|
2039
|
+
ref: "rightAxisLayerRef",
|
|
2040
|
+
style: _({ width: dt.value + "px" }),
|
|
2041
|
+
onPointerdown: Ge,
|
|
2042
|
+
onPointermove: Ke,
|
|
2043
|
+
onPointerup: qe,
|
|
2044
|
+
onPointerleave: Je
|
|
2122
2045
|
}, null, 36)
|
|
2123
2046
|
], 512)], 2), l(Tt, {
|
|
2124
|
-
"active-indicators":
|
|
2047
|
+
"active-indicators": Qe.value,
|
|
2125
2048
|
"indicator-params": X.value,
|
|
2126
|
-
onToggle:
|
|
2127
|
-
onUpdateParams:
|
|
2128
|
-
onReorderSubIndicators:
|
|
2049
|
+
onToggle: ct,
|
|
2050
|
+
onUpdateParams: lt,
|
|
2051
|
+
onReorderSubIndicators: ut
|
|
2129
2052
|
}, null, 8, ["active-indicators", "indicator-params"])], 8, Sr));
|
|
2130
2053
|
}
|
|
2131
|
-
}), [["__scopeId", "data-v-
|
|
2054
|
+
}), [["__scopeId", "data-v-4ea7c1af"]]), Or = {
|
|
2132
2055
|
name: "@363045841yyt/klinechart",
|
|
2133
|
-
version: "0.7.
|
|
2056
|
+
version: "0.7.6",
|
|
2134
2057
|
description: "Vue 3 bindings for @363045841yyt/klinechart-core. Idiomatic composables, SFC components.",
|
|
2135
2058
|
license: "MIT",
|
|
2136
2059
|
repository: {
|
|
@@ -2156,13 +2079,15 @@ var rr = {
|
|
|
2156
2079
|
default: "./dist/index.cjs"
|
|
2157
2080
|
}
|
|
2158
2081
|
},
|
|
2082
|
+
"./web-component": { import: { default: "./dist/kline-chart.js" } },
|
|
2159
2083
|
"./style.css": "./dist/klinechart.css"
|
|
2160
2084
|
},
|
|
2161
2085
|
files: ["dist", "src"],
|
|
2162
2086
|
publishConfig: { access: "public" },
|
|
2163
2087
|
scripts: {
|
|
2164
2088
|
dev: "vite --config preview/vite.config.ts",
|
|
2165
|
-
build: "vite build
|
|
2089
|
+
build: "vite build",
|
|
2090
|
+
"build:wc": "cross-env BUILD_TARGET=web-component vite build",
|
|
2166
2091
|
postbuild: "node -e \"require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')\"",
|
|
2167
2092
|
test: "vitest run",
|
|
2168
2093
|
"test:watch": "vitest",
|
|
@@ -2187,6 +2112,7 @@ var rr = {
|
|
|
2187
2112
|
"@size-limit/preset-small-lib": "^12.1.0",
|
|
2188
2113
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
2189
2114
|
"@vue/test-utils": "^2.4.10",
|
|
2115
|
+
"cross-env": "^7.0.3",
|
|
2190
2116
|
jsdom: "^29.1.1",
|
|
2191
2117
|
publint: "^0.3.0",
|
|
2192
2118
|
"size-limit": "^12.1.0",
|
|
@@ -2194,28 +2120,29 @@ var rr = {
|
|
|
2194
2120
|
"unplugin-icons": "^23.0.1",
|
|
2195
2121
|
vite: "^8.0.14",
|
|
2196
2122
|
"vite-plugin-babel": "^1.3.2",
|
|
2123
|
+
"vite-plugin-css-injected-by-js": "^5.0.1",
|
|
2197
2124
|
"vite-plugin-dts": "^5.0.1",
|
|
2198
2125
|
vitest: "^4.1.5",
|
|
2199
2126
|
vue: "^3.5.0"
|
|
2200
2127
|
}
|
|
2201
|
-
}.version,
|
|
2202
|
-
function
|
|
2203
|
-
|
|
2128
|
+
}.version, kr = null;
|
|
2129
|
+
function Ar(e) {
|
|
2130
|
+
kr = e;
|
|
2204
2131
|
}
|
|
2205
|
-
function
|
|
2132
|
+
function jr(e) {
|
|
2206
2133
|
if (e.container == null) throw Error("[@363045841yyt/klinechart] createChart: `container` is required and must be a non-null HTMLElement");
|
|
2207
|
-
if (
|
|
2208
|
-
return
|
|
2134
|
+
if (kr === null) throw Error("[@363045841yyt/klinechart] createChart: no ChartController factory registered. Call __setControllerFactory(...) before mounting (the core package wires this in production).");
|
|
2135
|
+
return kr(e);
|
|
2209
2136
|
}
|
|
2210
2137
|
function $(e) {
|
|
2211
2138
|
let t = E(e.peek());
|
|
2212
|
-
return
|
|
2139
|
+
return y(e.subscribe(() => {
|
|
2213
2140
|
t.value = e.peek();
|
|
2214
2141
|
})), t;
|
|
2215
2142
|
}
|
|
2216
|
-
function
|
|
2143
|
+
function Mr(e, t) {
|
|
2217
2144
|
let n = E(null), r = (e) => {
|
|
2218
|
-
e == null || n.value != null || (n.value =
|
|
2145
|
+
e == null || n.value != null || (n.value = jr({
|
|
2219
2146
|
...t,
|
|
2220
2147
|
container: e
|
|
2221
2148
|
}));
|
|
@@ -2231,11 +2158,11 @@ function Ar(e, t) {
|
|
|
2231
2158
|
let e = n.value;
|
|
2232
2159
|
e != null && (e.dispose(), n.value = null);
|
|
2233
2160
|
};
|
|
2234
|
-
return
|
|
2161
|
+
return y(a), v(a), { chart: n };
|
|
2235
2162
|
}
|
|
2236
|
-
function
|
|
2163
|
+
function Nr(e) {
|
|
2237
2164
|
let t = E(e.indicators.peek());
|
|
2238
|
-
return
|
|
2165
|
+
return y(e.indicators.subscribe(() => {
|
|
2239
2166
|
t.value = e.indicators.peek();
|
|
2240
2167
|
})), {
|
|
2241
2168
|
indicators: t,
|
|
@@ -2244,27 +2171,27 @@ function jr(e) {
|
|
|
2244
2171
|
updateParams: e.updateIndicatorParams.bind(e)
|
|
2245
2172
|
};
|
|
2246
2173
|
}
|
|
2247
|
-
function
|
|
2174
|
+
function Pr(e) {
|
|
2248
2175
|
let t = E(e.interactionState.peek());
|
|
2249
|
-
return
|
|
2176
|
+
return y(e.interactionState.subscribe(() => {
|
|
2250
2177
|
t.value = e.interactionState.peek();
|
|
2251
2178
|
})), t;
|
|
2252
2179
|
}
|
|
2253
|
-
function
|
|
2180
|
+
function Fr(e) {
|
|
2254
2181
|
let t = E(e.paneRatios.peek());
|
|
2255
|
-
return
|
|
2182
|
+
return y(e.paneRatios.subscribe(() => {
|
|
2256
2183
|
t.value = e.paneRatios.peek();
|
|
2257
2184
|
})), t;
|
|
2258
2185
|
}
|
|
2259
|
-
function
|
|
2186
|
+
function Ir(e) {
|
|
2260
2187
|
let t = E(e.viewport.peek());
|
|
2261
|
-
return
|
|
2188
|
+
return y(e.viewport.subscribe(() => {
|
|
2262
2189
|
t.value = e.viewport.peek();
|
|
2263
2190
|
})), t;
|
|
2264
2191
|
}
|
|
2265
|
-
function
|
|
2192
|
+
function Lr(e) {
|
|
2266
2193
|
let t = L({ catalog: e.catalog });
|
|
2267
|
-
|
|
2194
|
+
y(() => t.dispose());
|
|
2268
2195
|
let n = $(t.filteredMain), r = $(t.filteredSub), i = $(t.menuOpen), a = $(t.searchQuery);
|
|
2269
2196
|
function o(t) {
|
|
2270
2197
|
let n = e.catalog.find((e) => e.id === t);
|
|
@@ -2291,7 +2218,7 @@ function Fr(e) {
|
|
|
2291
2218
|
isActive: c
|
|
2292
2219
|
};
|
|
2293
2220
|
}
|
|
2294
|
-
var
|
|
2221
|
+
var Rr = u({
|
|
2295
2222
|
name: "KLineChart",
|
|
2296
2223
|
props: {
|
|
2297
2224
|
data: {
|
|
@@ -2321,10 +2248,10 @@ var Ir = u({
|
|
|
2321
2248
|
},
|
|
2322
2249
|
setup(e, { emit: t, expose: n }) {
|
|
2323
2250
|
let r = E(null), i = d(), a = E(null);
|
|
2324
|
-
|
|
2251
|
+
ee(() => {
|
|
2325
2252
|
let n = r.value;
|
|
2326
2253
|
n != null && (i.run(() => {
|
|
2327
|
-
if (a.value =
|
|
2254
|
+
if (a.value = jr({
|
|
2328
2255
|
container: n,
|
|
2329
2256
|
data: e.data,
|
|
2330
2257
|
initialZoomLevel: e.initialZoomLevel,
|
|
@@ -2336,14 +2263,14 @@ var Ir = u({
|
|
|
2336
2263
|
let n = e.viewport.peek();
|
|
2337
2264
|
t("zoomLevelChange", n.zoomLevel, n.kWidth);
|
|
2338
2265
|
};
|
|
2339
|
-
n(),
|
|
2266
|
+
n(), y(e.viewport.subscribe(n));
|
|
2340
2267
|
}
|
|
2341
2268
|
}), j(() => e.data, (e) => {
|
|
2342
2269
|
a.value?.setData(e);
|
|
2343
2270
|
}), j(() => e.theme, (e) => {
|
|
2344
2271
|
a.value?.setTheme(e);
|
|
2345
2272
|
}));
|
|
2346
|
-
}),
|
|
2273
|
+
}), b(() => {
|
|
2347
2274
|
a.value?.dispose(), a.value = null, i.stop();
|
|
2348
2275
|
}), n({
|
|
2349
2276
|
getController: () => a.value,
|
|
@@ -2370,9 +2297,9 @@ var Ir = u({
|
|
|
2370
2297
|
}
|
|
2371
2298
|
});
|
|
2372
2299
|
}
|
|
2373
|
-
}),
|
|
2374
|
-
e.component("KLineChart",
|
|
2300
|
+
}), zr = { install(e) {
|
|
2301
|
+
e.component("KLineChart", Rr);
|
|
2375
2302
|
} };
|
|
2376
|
-
|
|
2303
|
+
Ar(I);
|
|
2377
2304
|
//#endregion
|
|
2378
|
-
export { F as CORE_VERSION,
|
|
2305
|
+
export { F as CORE_VERSION, fe as DrawingStyleToolbar, je as IndicatorParams, Tt as IndicatorSelector, Rr as KLineChart, Dr as KLineChartVue, Ht as KLineTooltip, zr as KMapPlugin, xr as LeftToolbar, Gt as MarkerTooltip, Or as VERSION, Ar as __setControllerFactory, $ as coreSignalToVueRef, jr as createChart, Mr as useChart, Lr as useIndicatorSelector, Nr as useIndicators, Pr as useInteractionState, Fr as usePaneRatios, Ir as useViewport };
|