@363045841yyt/klinechart 0.7.5-alpha.2 → 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 +25 -4
- package/dist/index.d.ts +25 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +792 -841
- 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 +63 -63
- package/src/components/KLineChart.vue +248 -546
- package/src/components/KLineTooltip.vue +2 -2
- package/src/components/MarkerTooltip.vue +1 -12
- package/src/composables/useFullscreenTeleportTarget.ts +0 -2
- package/src/index.ts +72 -0
- package/src/web-component.ts +14 -0
package/dist/index.js
CHANGED
|
@@ -1,20 +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
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { kGapFromKWidth as ie, zoomLevelToKWidth as B } from "@363045841yyt/klinechart-core/engine/utils/zoom";
|
|
7
|
-
import { getPhysicalKLineConfig as V } from "@363045841yyt/klinechart-core/engine/utils/klineConfig";
|
|
8
|
-
import { SUB_PANE_INDICATORS as ae, SUB_PANE_INDICATOR_CONFIGS as H } from "@363045841yyt/klinechart-core/engine/renderers/Indicator/subPaneConfig";
|
|
9
|
-
import { createPaneTitleRendererPlugin as oe } from "@363045841yyt/klinechart-core/engine/renderers/paneTitle";
|
|
10
|
-
import { DEFAULT_SETTINGS as U, SETTINGS_STORAGE_KEY as se } from "@363045841yyt/klinechart-core/config";
|
|
11
|
-
import { DrawingInteractionController as ce } from "@363045841yyt/klinechart-core/engine/drawing";
|
|
12
|
-
import { VERSION as le, createChartController as ue } from "@363045841yyt/klinechart-core";
|
|
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
|
+
import { VERSION as F, createChartController as I, createIndicatorSelectorController as L } from "@363045841yyt/klinechart-core";
|
|
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";
|
|
13
6
|
//#region src/components/DrawingStyleToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
-
var
|
|
7
|
+
var ue = {
|
|
15
8
|
class: "toolbar-item color-item",
|
|
16
9
|
title: "颜色"
|
|
17
|
-
},
|
|
10
|
+
}, de = ["value"], W = ["value"], G = ["value"], K = /* @__PURE__ */ u({
|
|
18
11
|
__name: "DrawingStyleToolbar",
|
|
19
12
|
props: { drawing: {} },
|
|
20
13
|
emits: ["updateStyle", "delete"],
|
|
@@ -23,7 +16,7 @@ var de = {
|
|
|
23
16
|
function r(e) {
|
|
24
17
|
e.key === "Delete" && (e.preventDefault(), n("delete"));
|
|
25
18
|
}
|
|
26
|
-
|
|
19
|
+
ee(() => document.addEventListener("keydown", r)), b(() => document.removeEventListener("keydown", r));
|
|
27
20
|
function i(e) {
|
|
28
21
|
n("updateStyle", { stroke: e });
|
|
29
22
|
}
|
|
@@ -33,13 +26,13 @@ var de = {
|
|
|
33
26
|
function c(e) {
|
|
34
27
|
n("updateStyle", { strokeStyle: e });
|
|
35
28
|
}
|
|
36
|
-
return (t, n) => (
|
|
29
|
+
return (t, n) => (x(), o("div", {
|
|
37
30
|
class: "drawing-style-toolbar",
|
|
38
|
-
onPointerdown: n[4] ||=
|
|
39
|
-
onPointermove: n[5] ||=
|
|
40
|
-
onPointerup: n[6] ||=
|
|
31
|
+
onPointerdown: n[4] ||= P(() => {}, ["stop"]),
|
|
32
|
+
onPointermove: n[5] ||= P(() => {}, ["stop"]),
|
|
33
|
+
onPointerup: n[6] ||= P(() => {}, ["stop"])
|
|
41
34
|
}, [
|
|
42
|
-
s("div",
|
|
35
|
+
s("div", ue, [s("span", {
|
|
43
36
|
class: "color-swatch",
|
|
44
37
|
style: _({ background: e.drawing.style.stroke ?? "#2962ff" })
|
|
45
38
|
}, null, 4), s("input", {
|
|
@@ -47,7 +40,7 @@ var de = {
|
|
|
47
40
|
class: "color-input",
|
|
48
41
|
value: e.drawing.style.stroke ?? "#2962ff",
|
|
49
42
|
onInput: n[0] ||= (e) => i(e.target.value)
|
|
50
|
-
}, null, 40,
|
|
43
|
+
}, null, 40, de)]),
|
|
51
44
|
s("select", {
|
|
52
45
|
class: "toolbar-select",
|
|
53
46
|
value: e.drawing.style.strokeWidth ?? 1,
|
|
@@ -94,22 +87,32 @@ var de = {
|
|
|
94
87
|
let n = e.__vccOpts || e;
|
|
95
88
|
for (let [e, r] of t) n[e] = r;
|
|
96
89
|
return n;
|
|
97
|
-
},
|
|
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 = {
|
|
98
101
|
key: 0,
|
|
99
102
|
class: "indicator-description"
|
|
100
|
-
},
|
|
103
|
+
}, ye = { class: "params-body" }, be = { class: "param-header" }, xe = { class: "param-label" }, Se = { class: "param-label-text" }, Ce = {
|
|
101
104
|
key: 0,
|
|
102
105
|
class: "param-range"
|
|
103
|
-
},
|
|
106
|
+
}, we = { class: "input-wrapper" }, Te = ["disabled", "onClick"], Ee = [
|
|
104
107
|
"value",
|
|
105
108
|
"min",
|
|
106
109
|
"max",
|
|
107
110
|
"step",
|
|
108
111
|
"onInput"
|
|
109
|
-
],
|
|
112
|
+
], De = ["disabled", "onClick"], Oe = {
|
|
110
113
|
key: 0,
|
|
111
114
|
class: "param-description"
|
|
112
|
-
},
|
|
115
|
+
}, ke = { class: "params-footer" }, Ae = { class: "footer-right" }, je = /* @__PURE__ */ q(/* @__PURE__ */ u({
|
|
113
116
|
__name: "IndicatorParams",
|
|
114
117
|
props: {
|
|
115
118
|
visible: { type: Boolean },
|
|
@@ -120,53 +123,53 @@ var de = {
|
|
|
120
123
|
values: {}
|
|
121
124
|
},
|
|
122
125
|
emits: ["close", "confirm"],
|
|
123
|
-
setup(
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
|
|
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 };
|
|
127
130
|
}, {
|
|
128
131
|
deep: !0,
|
|
129
132
|
immediate: !0
|
|
130
|
-
}),
|
|
131
|
-
e && (
|
|
133
|
+
}), j(() => d.visible, (e) => {
|
|
134
|
+
e && (p.value = { ...d.values });
|
|
132
135
|
});
|
|
133
|
-
function
|
|
136
|
+
function _(e, t) {
|
|
134
137
|
let n = t.target, r = parseFloat(n.value);
|
|
135
|
-
isNaN(r) || (
|
|
138
|
+
isNaN(r) || (p.value[e] = r);
|
|
136
139
|
}
|
|
137
|
-
function
|
|
138
|
-
let n = e.step || 1, r = (
|
|
139
|
-
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));
|
|
140
143
|
}
|
|
141
|
-
function
|
|
144
|
+
function ee() {
|
|
142
145
|
let e = {};
|
|
143
|
-
|
|
144
|
-
e[t.key] = t.default ??
|
|
145
|
-
}),
|
|
146
|
+
d.params.forEach((t) => {
|
|
147
|
+
e[t.key] = t.default ?? d.values[t.key] ?? 0;
|
|
148
|
+
}), p.value = e;
|
|
146
149
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
150
|
+
function y() {
|
|
151
|
+
f("confirm", { ...p.value });
|
|
149
152
|
}
|
|
150
|
-
return (
|
|
151
|
-
default:
|
|
153
|
+
return (u, d) => (x(), i(t, { to: O(h) }, [l(n, { name: "overlay" }, {
|
|
154
|
+
default: M(() => [r.visible ? (x(), o("div", {
|
|
152
155
|
key: 0,
|
|
153
156
|
class: "params-overlay",
|
|
154
|
-
onClick: d[4] ||= (e) =>
|
|
157
|
+
onClick: d[4] ||= (e) => u.$emit("close")
|
|
155
158
|
}, [l(n, { name: "modal" }, {
|
|
156
|
-
default:
|
|
159
|
+
default: M(() => [s("div", {
|
|
157
160
|
class: "indicator-params",
|
|
158
|
-
onClick: d[3] ||=
|
|
161
|
+
onClick: d[3] ||= P(() => {}, ["stop"])
|
|
159
162
|
}, [
|
|
160
|
-
s("div",
|
|
161
|
-
class: g(["toggle-desc-btn", { active:
|
|
162
|
-
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,
|
|
163
166
|
title: "显示/隐藏说明"
|
|
164
167
|
}, [...d[6] ||= [s("svg", { viewBox: "0 0 1024 1024" }, [s("path", {
|
|
165
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",
|
|
166
169
|
fill: "currentColor"
|
|
167
170
|
})], -1)]], 2), s("button", {
|
|
168
171
|
class: "params-close",
|
|
169
|
-
onClick: d[1] ||= (e) =>
|
|
172
|
+
onClick: d[1] ||= (e) => u.$emit("close")
|
|
170
173
|
}, [...d[7] ||= [s("svg", {
|
|
171
174
|
viewBox: "0 0 24 24",
|
|
172
175
|
fill: "none",
|
|
@@ -174,51 +177,51 @@ var de = {
|
|
|
174
177
|
"stroke-width": "2"
|
|
175
178
|
}, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
|
|
176
179
|
l(n, { name: "slide" }, {
|
|
177
|
-
default:
|
|
180
|
+
default: M(() => [m.value && r.indicatorDescription ? (x(), o("div", ve, [s("p", null, D(r.indicatorDescription), 1)])) : a("", !0)]),
|
|
178
181
|
_: 1
|
|
179
182
|
}),
|
|
180
|
-
s("div",
|
|
183
|
+
s("div", ye, [(x(!0), o(e, null, w(r.params, (e) => (x(), o("div", {
|
|
181
184
|
key: e.key,
|
|
182
|
-
class: g(["param-item", { "has-desc":
|
|
183
|
-
}, [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, [
|
|
184
187
|
s("button", {
|
|
185
188
|
class: "stepper-btn",
|
|
186
|
-
disabled: e.min !== void 0 && (
|
|
187
|
-
onClick: (t) =>
|
|
188
|
-
}, " − ", 8,
|
|
189
|
-
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", {
|
|
190
193
|
key: 0,
|
|
191
194
|
type: "number",
|
|
192
195
|
class: "param-input",
|
|
193
|
-
value:
|
|
196
|
+
value: p.value[e.key],
|
|
194
197
|
min: e.min,
|
|
195
198
|
max: e.max,
|
|
196
199
|
step: e.step || 1,
|
|
197
|
-
onInput: (t) =>
|
|
198
|
-
}, null, 40,
|
|
200
|
+
onInput: (t) => _(e.key, t)
|
|
201
|
+
}, null, 40, Ee)) : a("", !0),
|
|
199
202
|
s("button", {
|
|
200
203
|
class: "stepper-btn",
|
|
201
|
-
disabled: e.max !== void 0 && (
|
|
202
|
-
onClick: (t) =>
|
|
203
|
-
}, " + ", 8,
|
|
204
|
+
disabled: e.max !== void 0 && (p.value[e.key] ?? 0) >= e.max,
|
|
205
|
+
onClick: (t) => v(e, 1)
|
|
206
|
+
}, " + ", 8, De)
|
|
204
207
|
])]), l(n, { name: "slide" }, {
|
|
205
|
-
default:
|
|
208
|
+
default: M(() => [m.value && e.description ? (x(), o("div", Oe, D(e.description), 1)) : a("", !0)]),
|
|
206
209
|
_: 2
|
|
207
210
|
}, 1024)], 2))), 128))]),
|
|
208
|
-
s("div",
|
|
211
|
+
s("div", ke, [s("button", {
|
|
209
212
|
class: "params-btn reset",
|
|
210
|
-
onClick:
|
|
213
|
+
onClick: ee
|
|
211
214
|
}, [...d[8] ||= [s("svg", {
|
|
212
215
|
viewBox: "0 0 24 24",
|
|
213
216
|
fill: "none",
|
|
214
217
|
stroke: "currentColor",
|
|
215
218
|
"stroke-width": "2"
|
|
216
|
-
}, [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", {
|
|
217
220
|
class: "params-btn cancel",
|
|
218
|
-
onClick: d[2] ||= (e) =>
|
|
221
|
+
onClick: d[2] ||= (e) => u.$emit("close")
|
|
219
222
|
}, "取消"), s("button", {
|
|
220
223
|
class: "params-btn confirm",
|
|
221
|
-
onClick:
|
|
224
|
+
onClick: y
|
|
222
225
|
}, [...d[9] ||= [s("svg", {
|
|
223
226
|
viewBox: "0 0 24 24",
|
|
224
227
|
fill: "none",
|
|
@@ -231,14 +234,7 @@ var de = {
|
|
|
231
234
|
_: 1
|
|
232
235
|
})], 8, ["to"]));
|
|
233
236
|
}
|
|
234
|
-
}), [["__scopeId", "data-v-
|
|
235
|
-
function je() {
|
|
236
|
-
let e = p(Ae, null);
|
|
237
|
-
return r(() => e?.value ?? "body");
|
|
238
|
-
}
|
|
239
|
-
//#endregion
|
|
240
|
-
//#region src/components/IndicatorSelector.vue?vue&type=script&setup=true&lang.ts
|
|
241
|
-
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 = {
|
|
242
238
|
key: 0,
|
|
243
239
|
class: "indicator-divider",
|
|
244
240
|
"aria-hidden": "true"
|
|
@@ -268,19 +264,19 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
268
264
|
width: "16",
|
|
269
265
|
height: "16",
|
|
270
266
|
fill: "currentColor"
|
|
271
|
-
},
|
|
267
|
+
}, Ze = { class: "modal-body" }, Qe = { class: "search-box" }, X = ["value"], Z = {
|
|
272
268
|
key: 0,
|
|
273
269
|
class: "indicator-section"
|
|
274
|
-
},
|
|
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 = {
|
|
275
271
|
key: 1,
|
|
276
272
|
class: "section-divider"
|
|
277
|
-
},
|
|
273
|
+
}, ut = {
|
|
278
274
|
key: 2,
|
|
279
275
|
class: "no-results"
|
|
280
|
-
},
|
|
276
|
+
}, dt = {
|
|
281
277
|
key: 3,
|
|
282
278
|
class: "indicator-section"
|
|
283
|
-
},
|
|
279
|
+
}, ft = { class: "section-header" }, pt = { class: "section-count" }, mt = ["onClick"], ht = { class: "card-label" }, gt = { class: "card-tooltip" }, _t = { class: "card-header" }, vt = { class: "card-label" }, yt = { class: "card-header-actions" }, bt = ["onClick"], xt = { class: "card-name" }, St = { class: "modal-footer" }, Ct = { class: "footer-info" }, wt = { class: "info-text" }, Tt = /* @__PURE__ */ q(/* @__PURE__ */ u({
|
|
284
280
|
__name: "IndicatorSelector",
|
|
285
281
|
props: {
|
|
286
282
|
activeIndicators: {},
|
|
@@ -292,34 +288,42 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
292
288
|
"reorderSubIndicators"
|
|
293
289
|
],
|
|
294
290
|
setup(u, { emit: d }) {
|
|
295
|
-
let f = u, p = d
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
291
|
+
let f = u, p = d;
|
|
292
|
+
function m(e) {
|
|
293
|
+
return e.map((e) => ({
|
|
294
|
+
id: e.id,
|
|
295
|
+
label: e.label,
|
|
296
|
+
name: e.name,
|
|
297
|
+
description: e.description,
|
|
298
|
+
role: e.pane,
|
|
299
|
+
params: (e.params ?? []).map((e) => ({
|
|
300
|
+
key: e.key,
|
|
301
|
+
label: e.label,
|
|
302
|
+
type: e.type,
|
|
303
|
+
default: e.default ?? (e.type === "number" ? 0 : ""),
|
|
304
|
+
min: e.min,
|
|
305
|
+
max: e.max,
|
|
306
|
+
step: e.step
|
|
307
|
+
}))
|
|
308
|
+
}));
|
|
309
|
+
}
|
|
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);
|
|
304
311
|
function H(e) {
|
|
305
312
|
return f.activeIndicators?.includes(e) ?? !1;
|
|
306
313
|
}
|
|
307
314
|
function oe(e) {
|
|
308
315
|
if (H(e)) return;
|
|
309
|
-
let t =
|
|
310
|
-
t && (t.pane === "main" &&
|
|
311
|
-
}
|
|
312
|
-
function U(e) {
|
|
313
|
-
p("toggle", e, !1);
|
|
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));
|
|
314
318
|
}
|
|
315
319
|
function se(e) {
|
|
316
|
-
|
|
320
|
+
p("toggle", e, !1);
|
|
317
321
|
}
|
|
318
|
-
function ce() {
|
|
319
|
-
|
|
322
|
+
function ce(e) {
|
|
323
|
+
j.value = e, A.value = !0;
|
|
320
324
|
}
|
|
321
|
-
function
|
|
322
|
-
let t =
|
|
325
|
+
function U(e) {
|
|
326
|
+
let t = ie(e);
|
|
323
327
|
if (!t?.params) return {};
|
|
324
328
|
let n = {};
|
|
325
329
|
for (let e of t.params) n[e.key] = e.default ?? e.min ?? 1;
|
|
@@ -327,30 +331,30 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
327
331
|
for (let [e, t] of Object.entries(r)) typeof t == "number" && (i[e] = t);
|
|
328
332
|
return i;
|
|
329
333
|
}
|
|
330
|
-
function
|
|
331
|
-
let t =
|
|
334
|
+
function le(e) {
|
|
335
|
+
let t = U(e.id);
|
|
332
336
|
return e.params ? e.params.map((e) => t[e.key] ?? "").join(",") : "";
|
|
333
337
|
}
|
|
334
|
-
function
|
|
335
|
-
|
|
338
|
+
function ue(e) {
|
|
339
|
+
j.value && p("updateParams", j.value, e), A.value = !1;
|
|
336
340
|
}
|
|
337
|
-
function
|
|
338
|
-
if (!
|
|
341
|
+
function de(e, t) {
|
|
342
|
+
if (!V(t)) {
|
|
339
343
|
e.preventDefault();
|
|
340
344
|
return;
|
|
341
345
|
}
|
|
342
|
-
|
|
346
|
+
I.value = t, F.value = null, e.dataTransfer?.setData("text/plain", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
|
|
343
347
|
}
|
|
344
348
|
function W(e, t) {
|
|
345
|
-
!
|
|
349
|
+
!I.value || !V(t) || I.value === t || (F.value = t, e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
|
|
346
350
|
}
|
|
347
351
|
function G(e, t) {
|
|
348
|
-
let n =
|
|
352
|
+
let n = I.value || e.dataTransfer?.getData("text/plain") || "";
|
|
349
353
|
if (!n || n === t) {
|
|
350
354
|
K();
|
|
351
355
|
return;
|
|
352
356
|
}
|
|
353
|
-
if (!
|
|
357
|
+
if (!V(n) || !V(t)) {
|
|
354
358
|
K();
|
|
355
359
|
return;
|
|
356
360
|
}
|
|
@@ -364,59 +368,56 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
364
368
|
K();
|
|
365
369
|
return;
|
|
366
370
|
}
|
|
367
|
-
a.splice(i, 0, o), p("reorderSubIndicators", a.filter((e) =>
|
|
371
|
+
a.splice(i, 0, o), p("reorderSubIndicators", a.filter((e) => V(e))), K();
|
|
368
372
|
}
|
|
369
373
|
function K() {
|
|
370
|
-
|
|
374
|
+
F.value = null, I.value = null;
|
|
371
375
|
}
|
|
372
|
-
function q() {
|
|
373
|
-
|
|
376
|
+
function q(e) {
|
|
377
|
+
e.key === "Escape" && h.menuOpen.peek() && h.closeMenu();
|
|
374
378
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
document.removeEventListener("keydown", pe);
|
|
382
|
-
}), (r, u) => (S(), o("div", Me, [
|
|
383
|
-
s("div", Ne, [s("div", Pe, [(S(!0), o(e, null, w(R.value, (t) => (S(), o(e, { key: t.id }, [t.id === ne.value ? (S(), o("div", Fe)) : a("", !0), s("div", {
|
|
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", {
|
|
384
385
|
class: g(["indicator-item", {
|
|
385
|
-
draggable: O(
|
|
386
|
-
"drag-over":
|
|
387
|
-
"is-dragging":
|
|
386
|
+
draggable: O(V)(t.id),
|
|
387
|
+
"drag-over": F.value === t.id,
|
|
388
|
+
"is-dragging": I.value === t.id
|
|
388
389
|
}]),
|
|
389
|
-
draggable: O(
|
|
390
|
-
onDragstart: (e) =>
|
|
391
|
-
onDragover:
|
|
392
|
-
onDrop:
|
|
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"]),
|
|
393
394
|
onDragend: K
|
|
394
395
|
}, [s("div", {
|
|
395
396
|
class: "indicator-btn-wrapper",
|
|
396
|
-
onMouseenter: (e) =>
|
|
397
|
-
onMouseleave: u[0] ||= (e) =>
|
|
397
|
+
onMouseenter: (e) => N.value = t.id,
|
|
398
|
+
onMouseleave: u[0] ||= (e) => N.value = null
|
|
398
399
|
}, [s("button", { class: g(["indicator-btn", {
|
|
399
400
|
active: !0,
|
|
400
|
-
hovering:
|
|
401
|
-
}]) }, [s("span", Re, [c(D(t.label) + " ", 1), t.params?.length ? (
|
|
402
|
-
default:
|
|
403
|
-
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", {
|
|
404
405
|
key: 0,
|
|
405
406
|
class: "action-btn settings-btn",
|
|
406
|
-
onClick:
|
|
407
|
+
onClick: P((e) => ce(t.id), ["stop"]),
|
|
407
408
|
title: "编辑参数"
|
|
408
|
-
}, [...u[
|
|
409
|
+
}, [...u[9] ||= [s("svg", {
|
|
409
410
|
viewBox: "0 0 24 24",
|
|
410
411
|
width: "14",
|
|
411
412
|
height: "14",
|
|
412
413
|
fill: "currentColor"
|
|
413
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),
|
|
414
|
-
t.params?.length ? (
|
|
415
|
+
t.params?.length ? (x(), o("span", He)) : a("", !0),
|
|
415
416
|
s("button", {
|
|
416
417
|
class: "action-btn remove-btn",
|
|
417
|
-
onClick:
|
|
418
|
+
onClick: P((e) => se(t.id), ["stop"]),
|
|
418
419
|
title: "移除指标"
|
|
419
|
-
}, [...u[
|
|
420
|
+
}, [...u[10] ||= [s("svg", {
|
|
420
421
|
viewBox: "0 0 24 24",
|
|
421
422
|
width: "14",
|
|
422
423
|
height: "14",
|
|
@@ -426,74 +427,75 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
426
427
|
_: 2
|
|
427
428
|
}, 1024)], 2)], 40, Le)], 42, Ie)], 64))), 128)), s("div", We, [s("button", {
|
|
428
429
|
ref_key: "addBtnRef",
|
|
429
|
-
ref:
|
|
430
|
+
ref: k,
|
|
430
431
|
class: "add-btn",
|
|
431
|
-
onClick:
|
|
432
|
+
onClick: u[1] ||= P((e) => O(h).toggleMenu(), ["stop"]),
|
|
432
433
|
title: "添加指标"
|
|
433
|
-
}, [...u[
|
|
434
|
+
}, [...u[11] ||= [s("svg", {
|
|
434
435
|
viewBox: "0 0 24 24",
|
|
435
436
|
width: "16",
|
|
436
437
|
height: "16",
|
|
437
438
|
fill: "currentColor"
|
|
438
439
|
}, [s("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })], -1)]], 512)])])]),
|
|
439
|
-
(
|
|
440
|
-
default:
|
|
440
|
+
(x(), i(t, { to: O(te) }, [l(n, { name: "overlay" }, {
|
|
441
|
+
default: M(() => [O(_) ? (x(), o("div", {
|
|
441
442
|
key: 0,
|
|
442
443
|
class: "selector-overlay",
|
|
443
|
-
onClick:
|
|
444
|
+
onClick: u[7] ||= (e) => O(h).closeMenu()
|
|
444
445
|
}, [l(n, { name: "modal" }, {
|
|
445
|
-
default:
|
|
446
|
+
default: M(() => [O(_) ? (x(), o("div", {
|
|
446
447
|
key: 0,
|
|
447
448
|
class: "selector-modal",
|
|
448
|
-
onClick: u[
|
|
449
|
+
onClick: u[6] ||= P(() => {}, ["stop"])
|
|
449
450
|
}, [
|
|
450
|
-
s("div", Ge, [s("div", Ke, [u[
|
|
451
|
-
class: g(["view-toggle-btn", { active:
|
|
452
|
-
onClick: u[
|
|
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,
|
|
453
454
|
title: "简洁模式"
|
|
454
|
-
}, [
|
|
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", {
|
|
455
456
|
class: "modal-close",
|
|
456
|
-
onClick:
|
|
457
|
+
onClick: u[3] ||= (e) => O(h).closeMenu(),
|
|
457
458
|
title: "关闭"
|
|
458
|
-
}, [...u[
|
|
459
|
+
}, [...u[15] ||= [s("svg", {
|
|
459
460
|
viewBox: "0 0 24 24",
|
|
460
461
|
width: "14",
|
|
461
462
|
height: "14",
|
|
462
463
|
fill: "currentColor"
|
|
463
464
|
}, [s("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })], -1)]])])]),
|
|
464
|
-
s("div",
|
|
465
|
-
s("div",
|
|
465
|
+
s("div", Ze, [
|
|
466
|
+
s("div", Qe, [u[16] ||= s("svg", {
|
|
466
467
|
class: "search-icon",
|
|
467
468
|
viewBox: "0 0 24 24",
|
|
468
469
|
width: "16",
|
|
469
470
|
height: "16",
|
|
470
471
|
fill: "currentColor"
|
|
471
|
-
}, [s("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" })], -1),
|
|
472
|
-
|
|
472
|
+
}, [s("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" })], -1), s("input", {
|
|
473
|
+
value: O(v),
|
|
474
|
+
onInput: u[4] ||= (e) => O(h).setSearchQuery(e.target.value),
|
|
473
475
|
type: "text",
|
|
474
476
|
class: "search-input",
|
|
475
477
|
placeholder: "搜索指标名称..."
|
|
476
|
-
}, null,
|
|
477
|
-
|
|
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", {
|
|
478
480
|
key: t.id,
|
|
479
481
|
class: g(["indicator-card", {
|
|
480
482
|
active: H(t.id),
|
|
481
|
-
compact:
|
|
483
|
+
compact: L.value
|
|
482
484
|
}]),
|
|
483
|
-
onClick: (e) => H(t.id) ?
|
|
484
|
-
}, [
|
|
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", {
|
|
485
487
|
key: 0,
|
|
486
488
|
class: "card-settings-btn",
|
|
487
|
-
onClick:
|
|
489
|
+
onClick: P((e) => ce(t.id), ["stop"]),
|
|
488
490
|
title: "编辑参数"
|
|
489
|
-
}, [...u[
|
|
491
|
+
}, [...u[18] ||= [s("svg", {
|
|
490
492
|
viewBox: "0 0 24 24",
|
|
491
493
|
width: "14",
|
|
492
494
|
height: "14",
|
|
493
495
|
fill: "currentColor"
|
|
494
|
-
}, [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,
|
|
495
|
-
|
|
496
|
-
!
|
|
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),
|
|
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] ||= [
|
|
497
499
|
s("svg", {
|
|
498
500
|
viewBox: "0 0 24 24",
|
|
499
501
|
width: "48",
|
|
@@ -503,44 +505,44 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
503
505
|
s("p", null, "未找到匹配的指标", -1),
|
|
504
506
|
s("span", { class: "no-results-hint" }, "请尝试其他关键词", -1)
|
|
505
507
|
]])) : a("", !0),
|
|
506
|
-
|
|
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", {
|
|
507
509
|
key: t.id,
|
|
508
510
|
class: g(["indicator-card", {
|
|
509
511
|
active: H(t.id),
|
|
510
|
-
compact:
|
|
512
|
+
compact: L.value
|
|
511
513
|
}]),
|
|
512
|
-
onClick: (e) => H(t.id) ?
|
|
513
|
-
}, [
|
|
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", {
|
|
514
516
|
key: 0,
|
|
515
517
|
class: "card-settings-btn",
|
|
516
|
-
onClick:
|
|
518
|
+
onClick: P((e) => ce(t.id), ["stop"]),
|
|
517
519
|
title: "编辑参数"
|
|
518
|
-
}, [...u[
|
|
520
|
+
}, [...u[21] ||= [s("svg", {
|
|
519
521
|
viewBox: "0 0 24 24",
|
|
520
522
|
width: "14",
|
|
521
523
|
height: "14",
|
|
522
524
|
fill: "currentColor"
|
|
523
|
-
}, [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,
|
|
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)
|
|
524
526
|
]),
|
|
525
|
-
s("div",
|
|
527
|
+
s("div", St, [s("div", Ct, [s("span", wt, "已激活 " + D(ae.value) + " 个指标", 1)]), s("button", {
|
|
526
528
|
class: "btn btn-confirm",
|
|
527
|
-
onClick:
|
|
529
|
+
onClick: u[5] ||= (e) => O(h).closeMenu()
|
|
528
530
|
}, "确认")])
|
|
529
531
|
])) : a("", !0)]),
|
|
530
532
|
_: 1
|
|
531
533
|
})])) : a("", !0)]),
|
|
532
534
|
_: 1
|
|
533
535
|
})], 8, ["to"])),
|
|
534
|
-
z.value ? (
|
|
536
|
+
z.value ? (x(), i(je, {
|
|
535
537
|
key: 0,
|
|
536
|
-
visible:
|
|
538
|
+
visible: A.value,
|
|
537
539
|
"indicator-id": z.value.id,
|
|
538
540
|
"indicator-name": z.value.name,
|
|
539
541
|
"indicator-description": z.value.description,
|
|
540
542
|
params: z.value.params || [],
|
|
541
|
-
values:
|
|
542
|
-
onClose: u[
|
|
543
|
-
onConfirm:
|
|
543
|
+
values: U(z.value.id),
|
|
544
|
+
onClose: u[8] ||= (e) => A.value = !1,
|
|
545
|
+
onConfirm: ue
|
|
544
546
|
}, null, 8, [
|
|
545
547
|
"visible",
|
|
546
548
|
"indicator-id",
|
|
@@ -551,25 +553,25 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
551
553
|
])) : a("", !0)
|
|
552
554
|
]));
|
|
553
555
|
}
|
|
554
|
-
}), [["__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 = {
|
|
555
557
|
key: 0,
|
|
556
558
|
class: "row"
|
|
557
|
-
},
|
|
559
|
+
}, Pt = {
|
|
558
560
|
key: 1,
|
|
559
561
|
class: "row"
|
|
560
|
-
},
|
|
562
|
+
}, Ft = {
|
|
561
563
|
key: 2,
|
|
562
564
|
class: "row"
|
|
563
|
-
},
|
|
565
|
+
}, It = {
|
|
564
566
|
key: 3,
|
|
565
567
|
class: "row"
|
|
566
|
-
},
|
|
568
|
+
}, Lt = {
|
|
567
569
|
key: 4,
|
|
568
570
|
class: "row"
|
|
569
|
-
},
|
|
571
|
+
}, Rt = {
|
|
570
572
|
key: 5,
|
|
571
573
|
class: "row"
|
|
572
|
-
},
|
|
574
|
+
}, zt = "#ef4444", Bt = "#22c55e", Vt = "#6b7280", Ht = /* @__PURE__ */ q(/* @__PURE__ */ u({
|
|
573
575
|
__name: "KLineTooltip",
|
|
574
576
|
props: {
|
|
575
577
|
k: {},
|
|
@@ -602,21 +604,21 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
602
604
|
}
|
|
603
605
|
let p = r(() => {
|
|
604
606
|
let e = t.k;
|
|
605
|
-
if (!e) return
|
|
607
|
+
if (!e) return Vt;
|
|
606
608
|
let n = f(e, t.data, t.index);
|
|
607
|
-
return n > 0 ?
|
|
609
|
+
return n > 0 ? zt : n < 0 ? Bt : Vt;
|
|
608
610
|
}), m = r(() => {
|
|
609
611
|
let e = t.k;
|
|
610
|
-
if (!e) return
|
|
612
|
+
if (!e) return Vt;
|
|
611
613
|
let n = e.close - e.open;
|
|
612
|
-
return n > 0 ?
|
|
614
|
+
return n > 0 ? zt : n < 0 ? Bt : Vt;
|
|
613
615
|
}), h = r(() => {
|
|
614
616
|
let e = t.k;
|
|
615
|
-
if (!e) return
|
|
617
|
+
if (!e) return Vt;
|
|
616
618
|
let n = e.changePercent ?? (e.close - e.open) / e.open * 100;
|
|
617
|
-
return n > 0 ?
|
|
619
|
+
return n > 0 ? zt : n < 0 ? Bt : Vt;
|
|
618
620
|
});
|
|
619
|
-
return (t, r) => e.k ? (
|
|
621
|
+
return (t, r) => e.k ? (x(), o("div", {
|
|
620
622
|
key: 0,
|
|
621
623
|
ref: c,
|
|
622
624
|
class: g(["kline-tooltip", [{ "use-anchor": n.value }, i.value]]),
|
|
@@ -624,23 +626,23 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
624
626
|
left: `${e.pos.x}px`,
|
|
625
627
|
top: `${e.pos.y}px`
|
|
626
628
|
})
|
|
627
|
-
}, [s("div",
|
|
628
|
-
s("div",
|
|
629
|
-
s("div",
|
|
630
|
-
s("div",
|
|
631
|
-
s("div",
|
|
632
|
-
typeof e.k.volume == "number" ? (
|
|
633
|
-
typeof e.k.turnover == "number" ? (
|
|
634
|
-
typeof e.k.amplitude == "number" ? (
|
|
635
|
-
typeof e.k.changePercent == "number" ? (
|
|
636
|
-
typeof e.k.changeAmount == "number" ? (
|
|
637
|
-
typeof e.k.turnoverRate == "number" ? (
|
|
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, [
|
|
630
|
+
s("div", kt, [r[0] ||= s("span", null, "开", -1), s("span", { style: _({ color: p.value }) }, D(e.k.open.toFixed(2)), 5)]),
|
|
631
|
+
s("div", At, [r[1] ||= s("span", null, "高", -1), s("span", null, D(e.k.high.toFixed(2)), 1)]),
|
|
632
|
+
s("div", jt, [r[2] ||= s("span", null, "低", -1), s("span", null, D(e.k.low.toFixed(2)), 1)]),
|
|
633
|
+
s("div", Mt, [r[3] ||= s("span", null, "收", -1), s("span", { style: _({ color: m.value }) }, D(e.k.close.toFixed(2)), 5)]),
|
|
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)
|
|
638
640
|
])], 6)) : a("", !0);
|
|
639
641
|
}
|
|
640
|
-
}), [["__scopeId", "data-v-
|
|
642
|
+
}), [["__scopeId", "data-v-61c103af"]]), Ut = { class: "marker-tooltip__title" }, Wt = {
|
|
641
643
|
key: 0,
|
|
642
644
|
class: "marker-tooltip__content"
|
|
643
|
-
},
|
|
645
|
+
}, Gt = /* @__PURE__ */ q(/* @__PURE__ */ u({
|
|
644
646
|
__name: "MarkerTooltip",
|
|
645
647
|
props: {
|
|
646
648
|
marker: {},
|
|
@@ -681,7 +683,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
681
683
|
function h(e) {
|
|
682
684
|
return typeof e == "number" ? e.toFixed(2) : String(e);
|
|
683
685
|
}
|
|
684
|
-
return (n, r) => t.marker ? (
|
|
686
|
+
return (n, r) => t.marker ? (x(), o("div", {
|
|
685
687
|
key: 0,
|
|
686
688
|
ref: u,
|
|
687
689
|
class: g(["marker-tooltip", [{ "use-anchor": c.value }, l.value]]),
|
|
@@ -689,18 +691,18 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
|
|
|
689
691
|
left: `${t.pos.x + 12}px`,
|
|
690
692
|
top: `${t.pos.y + 12}px`
|
|
691
693
|
})
|
|
692
|
-
}, [s("div",
|
|
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", {
|
|
693
695
|
key: t,
|
|
694
696
|
class: "row"
|
|
695
697
|
}, [s("span", null, D(t), 1), s("span", null, D(h(e)), 1)]))), 128))])) : a("", !0)], 6)) : a("", !0);
|
|
696
698
|
}
|
|
697
|
-
}), [["__scopeId", "data-v-
|
|
699
|
+
}), [["__scopeId", "data-v-dc844eda"]]), Kt = {
|
|
698
700
|
viewBox: "0 0 24 24",
|
|
699
701
|
width: "1.2em",
|
|
700
702
|
height: "1.2em"
|
|
701
703
|
};
|
|
702
|
-
function
|
|
703
|
-
return
|
|
704
|
+
function qt(e, t) {
|
|
705
|
+
return x(), o("svg", Kt, [...t[0] ||= [s("path", {
|
|
704
706
|
fill: "none",
|
|
705
707
|
stroke: "currentColor",
|
|
706
708
|
"stroke-linecap": "round",
|
|
@@ -709,16 +711,16 @@ function Gt(e, t) {
|
|
|
709
711
|
d: "M7.904 17.563a1.2 1.2 0 0 0 2.228.308l2.09-3.093l4.907 4.907a1.067 1.067 0 0 0 1.509 0l1.047-1.047a1.067 1.067 0 0 0 0-1.509l-4.907-4.907l3.113-2.09a1.2 1.2 0 0 0-.309-2.228L4 4z"
|
|
710
712
|
}, null, -1)]]);
|
|
711
713
|
}
|
|
712
|
-
var
|
|
714
|
+
var Jt = m({
|
|
713
715
|
name: "tabler-pointer",
|
|
714
|
-
render:
|
|
715
|
-
}),
|
|
716
|
+
render: qt
|
|
717
|
+
}), Yt = {
|
|
716
718
|
viewBox: "0 0 24 24",
|
|
717
719
|
width: "1.2em",
|
|
718
720
|
height: "1.2em"
|
|
719
721
|
};
|
|
720
|
-
function
|
|
721
|
-
return
|
|
722
|
+
function Xt(e, t) {
|
|
723
|
+
return x(), o("svg", Yt, [...t[0] ||= [s("path", {
|
|
722
724
|
fill: "none",
|
|
723
725
|
stroke: "currentColor",
|
|
724
726
|
"stroke-linecap": "round",
|
|
@@ -727,16 +729,16 @@ function Jt(e, t) {
|
|
|
727
729
|
d: "M4 19h16M4 15l4-6l4 2l4-5l4 4"
|
|
728
730
|
}, null, -1)]]);
|
|
729
731
|
}
|
|
730
|
-
var
|
|
732
|
+
var Zt = m({
|
|
731
733
|
name: "tabler-chart-line",
|
|
732
|
-
render:
|
|
733
|
-
}),
|
|
734
|
+
render: Xt
|
|
735
|
+
}), Qt = {
|
|
734
736
|
viewBox: "0 0 24 24",
|
|
735
737
|
width: "1.2em",
|
|
736
738
|
height: "1.2em"
|
|
737
739
|
};
|
|
738
|
-
function
|
|
739
|
-
return
|
|
740
|
+
function $t(e, t) {
|
|
741
|
+
return x(), o("svg", Qt, [...t[0] ||= [s("path", {
|
|
740
742
|
fill: "none",
|
|
741
743
|
stroke: "currentColor",
|
|
742
744
|
"stroke-linecap": "round",
|
|
@@ -745,16 +747,16 @@ function Zt(e, t) {
|
|
|
745
747
|
d: "M17 7L7 17M8 7h9v9"
|
|
746
748
|
}, null, -1)]]);
|
|
747
749
|
}
|
|
748
|
-
var
|
|
750
|
+
var en = m({
|
|
749
751
|
name: "tabler-arrow-up-right",
|
|
750
|
-
render:
|
|
751
|
-
}),
|
|
752
|
+
render: $t
|
|
753
|
+
}), tn = {
|
|
752
754
|
viewBox: "0 0 24 24",
|
|
753
755
|
width: "1.2em",
|
|
754
756
|
height: "1.2em"
|
|
755
757
|
};
|
|
756
|
-
function
|
|
757
|
-
return
|
|
758
|
+
function nn(e, t) {
|
|
759
|
+
return x(), o("svg", tn, [...t[0] ||= [s("path", {
|
|
758
760
|
fill: "none",
|
|
759
761
|
stroke: "currentColor",
|
|
760
762
|
"stroke-linecap": "round",
|
|
@@ -763,16 +765,16 @@ function en(e, t) {
|
|
|
763
765
|
d: "M5 12h14m-6 6l6-6m-6-6l6 6"
|
|
764
766
|
}, null, -1)]]);
|
|
765
767
|
}
|
|
766
|
-
var
|
|
768
|
+
var rn = m({
|
|
767
769
|
name: "tabler-arrow-right",
|
|
768
|
-
render:
|
|
769
|
-
}),
|
|
770
|
+
render: nn
|
|
771
|
+
}), an = {
|
|
770
772
|
viewBox: "0 0 24 24",
|
|
771
773
|
width: "1.2em",
|
|
772
774
|
height: "1.2em"
|
|
773
775
|
};
|
|
774
|
-
function
|
|
775
|
-
return
|
|
776
|
+
function on(e, t) {
|
|
777
|
+
return x(), o("svg", an, [...t[0] ||= [s("path", {
|
|
776
778
|
fill: "none",
|
|
777
779
|
stroke: "currentColor",
|
|
778
780
|
"stroke-linecap": "round",
|
|
@@ -781,16 +783,16 @@ function rn(e, t) {
|
|
|
781
783
|
d: "M5 12h14"
|
|
782
784
|
}, null, -1)]]);
|
|
783
785
|
}
|
|
784
|
-
var
|
|
786
|
+
var sn = m({
|
|
785
787
|
name: "tabler-minus",
|
|
786
|
-
render:
|
|
787
|
-
}),
|
|
788
|
+
render: on
|
|
789
|
+
}), cn = {
|
|
788
790
|
viewBox: "0 0 24 24",
|
|
789
791
|
width: "1.2em",
|
|
790
792
|
height: "1.2em"
|
|
791
793
|
};
|
|
792
|
-
function
|
|
793
|
-
return
|
|
794
|
+
function ln(e, t) {
|
|
795
|
+
return x(), o("svg", cn, [...t[0] ||= [s("path", {
|
|
794
796
|
fill: "none",
|
|
795
797
|
stroke: "currentColor",
|
|
796
798
|
"stroke-linecap": "round",
|
|
@@ -799,16 +801,16 @@ function sn(e, t) {
|
|
|
799
801
|
d: "M3 12v.01M7 12h10m4 0v.01"
|
|
800
802
|
}, null, -1)]]);
|
|
801
803
|
}
|
|
802
|
-
var
|
|
804
|
+
var un = m({
|
|
803
805
|
name: "tabler-separator",
|
|
804
|
-
render:
|
|
805
|
-
}),
|
|
806
|
+
render: ln
|
|
807
|
+
}), dn = {
|
|
806
808
|
viewBox: "0 0 24 24",
|
|
807
809
|
width: "1.2em",
|
|
808
810
|
height: "1.2em"
|
|
809
811
|
};
|
|
810
|
-
function
|
|
811
|
-
return
|
|
812
|
+
function fn(e, t) {
|
|
813
|
+
return x(), o("svg", dn, [...t[0] ||= [s("path", {
|
|
812
814
|
fill: "none",
|
|
813
815
|
stroke: "currentColor",
|
|
814
816
|
"stroke-linecap": "round",
|
|
@@ -817,16 +819,16 @@ function un(e, t) {
|
|
|
817
819
|
d: "M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2m8-16h2a2 2 0 0 1 2 2v2m-4 12h2a2 2 0 0 0 2-2v-2M9 12h6m-3-3v6"
|
|
818
820
|
}, null, -1)]]);
|
|
819
821
|
}
|
|
820
|
-
var
|
|
822
|
+
var pn = m({
|
|
821
823
|
name: "tabler-crosshair",
|
|
822
|
-
render:
|
|
823
|
-
}),
|
|
824
|
+
render: fn
|
|
825
|
+
}), mn = {
|
|
824
826
|
viewBox: "0 0 24 24",
|
|
825
827
|
width: "1.2em",
|
|
826
828
|
height: "1.2em"
|
|
827
829
|
};
|
|
828
|
-
function
|
|
829
|
-
return
|
|
830
|
+
function hn(e, t) {
|
|
831
|
+
return x(), o("svg", mn, [...t[0] ||= [s("g", {
|
|
830
832
|
fill: "none",
|
|
831
833
|
stroke: "currentColor",
|
|
832
834
|
"stroke-linecap": "round",
|
|
@@ -834,16 +836,16 @@ function pn(e, t) {
|
|
|
834
836
|
"stroke-width": "2"
|
|
835
837
|
}, [s("path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01" }), s("path", { d: "M11 12h1v4h1" })], -1)]]);
|
|
836
838
|
}
|
|
837
|
-
var
|
|
839
|
+
var gn = m({
|
|
838
840
|
name: "tabler-info-circle",
|
|
839
|
-
render:
|
|
840
|
-
}),
|
|
841
|
+
render: hn
|
|
842
|
+
}), _n = {
|
|
841
843
|
viewBox: "0 0 24 24",
|
|
842
844
|
width: "1.2em",
|
|
843
845
|
height: "1.2em"
|
|
844
846
|
};
|
|
845
|
-
function
|
|
846
|
-
return
|
|
847
|
+
function vn(e, t) {
|
|
848
|
+
return x(), o("svg", _n, [...t[0] ||= [s("path", {
|
|
847
849
|
fill: "none",
|
|
848
850
|
stroke: "currentColor",
|
|
849
851
|
"stroke-linecap": "round",
|
|
@@ -852,16 +854,16 @@ function gn(e, t) {
|
|
|
852
854
|
d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m-3-3v6m11 8l-6-6"
|
|
853
855
|
}, null, -1)]]);
|
|
854
856
|
}
|
|
855
|
-
var
|
|
857
|
+
var yn = m({
|
|
856
858
|
name: "tabler-zoom-in",
|
|
857
|
-
render:
|
|
858
|
-
}),
|
|
859
|
+
render: vn
|
|
860
|
+
}), bn = {
|
|
859
861
|
viewBox: "0 0 24 24",
|
|
860
862
|
width: "1.2em",
|
|
861
863
|
height: "1.2em"
|
|
862
864
|
};
|
|
863
|
-
function
|
|
864
|
-
return
|
|
865
|
+
function xn(e, t) {
|
|
866
|
+
return x(), o("svg", bn, [...t[0] ||= [s("path", {
|
|
865
867
|
fill: "none",
|
|
866
868
|
stroke: "currentColor",
|
|
867
869
|
"stroke-linecap": "round",
|
|
@@ -870,16 +872,16 @@ function yn(e, t) {
|
|
|
870
872
|
d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m8 11l-6-6"
|
|
871
873
|
}, null, -1)]]);
|
|
872
874
|
}
|
|
873
|
-
var
|
|
875
|
+
var Sn = m({
|
|
874
876
|
name: "tabler-zoom-out",
|
|
875
|
-
render:
|
|
876
|
-
}),
|
|
877
|
+
render: xn
|
|
878
|
+
}), Cn = {
|
|
877
879
|
viewBox: "0 0 24 24",
|
|
878
880
|
width: "1.2em",
|
|
879
881
|
height: "1.2em"
|
|
880
882
|
};
|
|
881
|
-
function
|
|
882
|
-
return
|
|
883
|
+
function wn(e, t) {
|
|
884
|
+
return x(), o("svg", Cn, [...t[0] ||= [s("path", {
|
|
883
885
|
fill: "none",
|
|
884
886
|
stroke: "currentColor",
|
|
885
887
|
"stroke-linecap": "round",
|
|
@@ -888,16 +890,16 @@ function Sn(e, t) {
|
|
|
888
890
|
d: "M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2m8-16h2a2 2 0 0 1 2 2v2m-4 12h2a2 2 0 0 0 2-2v-2"
|
|
889
891
|
}, null, -1)]]);
|
|
890
892
|
}
|
|
891
|
-
var
|
|
893
|
+
var Tn = m({
|
|
892
894
|
name: "tabler-maximize",
|
|
893
|
-
render:
|
|
894
|
-
}),
|
|
895
|
+
render: wn
|
|
896
|
+
}), En = {
|
|
895
897
|
viewBox: "0 0 24 24",
|
|
896
898
|
width: "1.2em",
|
|
897
899
|
height: "1.2em"
|
|
898
900
|
};
|
|
899
|
-
function
|
|
900
|
-
return
|
|
901
|
+
function Dn(e, t) {
|
|
902
|
+
return x(), o("svg", En, [...t[0] ||= [s("path", {
|
|
901
903
|
fill: "none",
|
|
902
904
|
stroke: "currentColor",
|
|
903
905
|
"stroke-linecap": "round",
|
|
@@ -906,16 +908,16 @@ function Tn(e, t) {
|
|
|
906
908
|
d: "M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5"
|
|
907
909
|
}, null, -1)]]);
|
|
908
910
|
}
|
|
909
|
-
var
|
|
911
|
+
var On = m({
|
|
910
912
|
name: "tabler-minimize",
|
|
911
|
-
render:
|
|
912
|
-
}),
|
|
913
|
+
render: Dn
|
|
914
|
+
}), kn = {
|
|
913
915
|
viewBox: "0 0 24 24",
|
|
914
916
|
width: "1.2em",
|
|
915
917
|
height: "1.2em"
|
|
916
918
|
};
|
|
917
|
-
function
|
|
918
|
-
return
|
|
919
|
+
function An(e, t) {
|
|
920
|
+
return x(), o("svg", kn, [...t[0] ||= [s("g", {
|
|
919
921
|
fill: "none",
|
|
920
922
|
stroke: "currentColor",
|
|
921
923
|
"stroke-linecap": "round",
|
|
@@ -923,16 +925,16 @@ function On(e, t) {
|
|
|
923
925
|
"stroke-width": "2"
|
|
924
926
|
}, [s("path", { d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065" }), s("path", { d: "M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0" })], -1)]]);
|
|
925
927
|
}
|
|
926
|
-
var
|
|
928
|
+
var jn = m({
|
|
927
929
|
name: "tabler-settings",
|
|
928
|
-
render:
|
|
929
|
-
}),
|
|
930
|
+
render: An
|
|
931
|
+
}), Mn = {
|
|
930
932
|
viewBox: "0 0 24 24",
|
|
931
933
|
width: "1.2em",
|
|
932
934
|
height: "1.2em"
|
|
933
935
|
};
|
|
934
|
-
function
|
|
935
|
-
return
|
|
936
|
+
function Nn(e, t) {
|
|
937
|
+
return x(), o("svg", Mn, [...t[0] ||= [s("path", {
|
|
936
938
|
fill: "none",
|
|
937
939
|
stroke: "currentColor",
|
|
938
940
|
"stroke-linecap": "round",
|
|
@@ -941,16 +943,16 @@ function jn(e, t) {
|
|
|
941
943
|
d: "M3 5a2 2 0 1 0 4 0a2 2 0 1 0-4 0m14 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0M3 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m14 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0M5 7v10M7 5h10M7 19h10m2-12v10"
|
|
942
944
|
}, null, -1)]]);
|
|
943
945
|
}
|
|
944
|
-
var
|
|
946
|
+
var Pn = m({
|
|
945
947
|
name: "tabler-shape",
|
|
946
|
-
render:
|
|
947
|
-
}),
|
|
948
|
+
render: Nn
|
|
949
|
+
}), Fn = {
|
|
948
950
|
viewBox: "0 0 24 24",
|
|
949
951
|
width: "1.2em",
|
|
950
952
|
height: "1.2em"
|
|
951
953
|
};
|
|
952
|
-
function
|
|
953
|
-
return
|
|
954
|
+
function In(e, t) {
|
|
955
|
+
return x(), o("svg", Fn, [...t[0] ||= [s("path", {
|
|
954
956
|
fill: "none",
|
|
955
957
|
stroke: "currentColor",
|
|
956
958
|
"stroke-linecap": "round",
|
|
@@ -959,16 +961,16 @@ function Pn(e, t) {
|
|
|
959
961
|
d: "M3 7a2 2 0 1 0 4 0a2 2 0 1 0-4 0m11 8a2 2 0 1 0 4 0a2 2 0 1 0-4 0m1-9a3 3 0 1 0 6 0a3 3 0 1 0-6 0M3 18a3 3 0 1 0 6 0a3 3 0 1 0-6 0m6-1l5-1.5m-7.5-7l7.81 5.37M7 7l8-1"
|
|
960
962
|
}, null, -1)]]);
|
|
961
963
|
}
|
|
962
|
-
var
|
|
964
|
+
var Ln = m({
|
|
963
965
|
name: "tabler-chart-dots-3",
|
|
964
|
-
render:
|
|
965
|
-
}),
|
|
966
|
+
render: In
|
|
967
|
+
}), Rn = {
|
|
966
968
|
viewBox: "0 0 24 24",
|
|
967
969
|
width: "1.2em",
|
|
968
970
|
height: "1.2em"
|
|
969
971
|
};
|
|
970
|
-
function
|
|
971
|
-
return
|
|
972
|
+
function zn(e, t) {
|
|
973
|
+
return x(), o("svg", Rn, [...t[0] ||= [s("path", {
|
|
972
974
|
fill: "none",
|
|
973
975
|
stroke: "currentColor",
|
|
974
976
|
"stroke-linecap": "round",
|
|
@@ -977,16 +979,16 @@ function Ln(e, t) {
|
|
|
977
979
|
d: "m18 10l-6-6l-6 6zm0 4l-6 6l-6-6z"
|
|
978
980
|
}, null, -1)]]);
|
|
979
981
|
}
|
|
980
|
-
var
|
|
982
|
+
var Bn = m({
|
|
981
983
|
name: "tabler-caret-up-down",
|
|
982
|
-
render:
|
|
983
|
-
}),
|
|
984
|
+
render: zn
|
|
985
|
+
}), Vn = {
|
|
984
986
|
viewBox: "0 0 24 24",
|
|
985
987
|
width: "1.2em",
|
|
986
988
|
height: "1.2em"
|
|
987
989
|
};
|
|
988
|
-
function
|
|
989
|
-
return
|
|
990
|
+
function Hn(e, t) {
|
|
991
|
+
return x(), o("svg", Vn, [...t[0] ||= [s("path", {
|
|
990
992
|
fill: "none",
|
|
991
993
|
stroke: "currentColor",
|
|
992
994
|
"stroke-linecap": "round",
|
|
@@ -995,34 +997,34 @@ function Bn(e, t) {
|
|
|
995
997
|
d: "M8 4H5v16h3m8-16h3v16h-3"
|
|
996
998
|
}, null, -1)]]);
|
|
997
999
|
}
|
|
998
|
-
var
|
|
1000
|
+
var Un = m({
|
|
999
1001
|
name: "tabler-brackets",
|
|
1000
|
-
render:
|
|
1002
|
+
render: Hn
|
|
1001
1003
|
});
|
|
1002
1004
|
//#endregion
|
|
1003
1005
|
//#region src/debug/canvasProfiler.ts
|
|
1004
|
-
function
|
|
1006
|
+
function Wn() {
|
|
1005
1007
|
return Object.create(null);
|
|
1006
1008
|
}
|
|
1007
|
-
function
|
|
1009
|
+
function Gn() {
|
|
1008
1010
|
return {
|
|
1009
|
-
ctxMethods:
|
|
1010
|
-
ctxProps:
|
|
1011
|
-
canvasProps:
|
|
1011
|
+
ctxMethods: Wn(),
|
|
1012
|
+
ctxProps: Wn(),
|
|
1013
|
+
canvasProps: Wn(),
|
|
1012
1014
|
ctxMethodSources: Object.create(null)
|
|
1013
1015
|
};
|
|
1014
1016
|
}
|
|
1015
|
-
function
|
|
1017
|
+
function Kn(e, t, n) {
|
|
1016
1018
|
let r = e[t] ??= {
|
|
1017
1019
|
count: 0,
|
|
1018
1020
|
totalTime: 0
|
|
1019
1021
|
};
|
|
1020
1022
|
r.count += 1, r.totalTime += n;
|
|
1021
1023
|
}
|
|
1022
|
-
function
|
|
1023
|
-
|
|
1024
|
+
function qn(e, t, n, r) {
|
|
1025
|
+
Kn(e.ctxMethodSources[t] ??= Wn(), n, r);
|
|
1024
1026
|
}
|
|
1025
|
-
function
|
|
1027
|
+
function Jn(e) {
|
|
1026
1028
|
return Object.entries(e).filter(([, e]) => e.count > 0).map(([e, t]) => ({
|
|
1027
1029
|
name: e,
|
|
1028
1030
|
count: t.count,
|
|
@@ -1030,12 +1032,12 @@ function Kn(e) {
|
|
|
1030
1032
|
averageTime: (t.totalTime / t.count).toFixed(4)
|
|
1031
1033
|
})).sort((e, t) => Number(t.totalTime) - Number(e.totalTime));
|
|
1032
1034
|
}
|
|
1033
|
-
var
|
|
1034
|
-
function
|
|
1035
|
-
|
|
1035
|
+
var Yn = !1, Xn = /* @__PURE__ */ new Map(), Zn = /* @__PURE__ */ new Map();
|
|
1036
|
+
function Qn(e) {
|
|
1037
|
+
Yn = e, e ? typeof window < "u" && !window.__KMAP_CANVAS_PROFILER_INSTALLED__ && tr() : nr();
|
|
1036
1038
|
}
|
|
1037
|
-
function
|
|
1038
|
-
if (!
|
|
1039
|
+
function $n() {
|
|
1040
|
+
if (!Yn) return "disabled";
|
|
1039
1041
|
let e = (/* @__PURE__ */ Error()).stack;
|
|
1040
1042
|
if (!e) return "unknown";
|
|
1041
1043
|
let t = e.split("\n").map((e) => e.trim()).filter(Boolean);
|
|
@@ -1048,82 +1050,82 @@ function Zn() {
|
|
|
1048
1050
|
}
|
|
1049
1051
|
return "unknown";
|
|
1050
1052
|
}
|
|
1051
|
-
function
|
|
1053
|
+
function Q(e, t, n, r) {
|
|
1052
1054
|
let i = `${e.constructor?.name ?? "proto"}:${t}`;
|
|
1053
|
-
if (
|
|
1055
|
+
if (Xn.has(i)) return;
|
|
1054
1056
|
let a = Reflect.get(e, t);
|
|
1055
|
-
typeof a == "function" && (
|
|
1056
|
-
if (!
|
|
1057
|
-
let i = r?.captureSource ?
|
|
1058
|
-
return
|
|
1057
|
+
typeof a == "function" && (Xn.set(i, a), Reflect.set(e, t, function(...e) {
|
|
1058
|
+
if (!Yn) return a.apply(this, e);
|
|
1059
|
+
let i = r?.captureSource ? $n() : null, o = performance.now(), s = a.apply(this, e), c = performance.now() - o;
|
|
1060
|
+
return Kn(n.ctxMethods, t, c), i && qn(n, t, i, c), s;
|
|
1059
1061
|
}));
|
|
1060
1062
|
}
|
|
1061
|
-
function
|
|
1063
|
+
function er(e, t, n) {
|
|
1062
1064
|
let r = Object.getOwnPropertyDescriptor(e, t);
|
|
1063
1065
|
if (!r?.set || !r.configurable) return;
|
|
1064
1066
|
let i = `${e.constructor?.name ?? "proto"}:${t}`;
|
|
1065
|
-
|
|
1067
|
+
Zn.has(i) || (Zn.set(i, r), Object.defineProperty(e, t, {
|
|
1066
1068
|
configurable: !0,
|
|
1067
1069
|
enumerable: r.enumerable ?? !1,
|
|
1068
1070
|
get: r.get,
|
|
1069
1071
|
set(e) {
|
|
1070
|
-
if (!
|
|
1072
|
+
if (!Yn) {
|
|
1071
1073
|
r.set.call(this, e);
|
|
1072
1074
|
return;
|
|
1073
1075
|
}
|
|
1074
1076
|
let i = performance.now();
|
|
1075
|
-
r.set.call(this, e),
|
|
1077
|
+
r.set.call(this, e), Kn(n, t, performance.now() - i);
|
|
1076
1078
|
}
|
|
1077
1079
|
}));
|
|
1078
1080
|
}
|
|
1079
|
-
function
|
|
1081
|
+
function tr() {
|
|
1080
1082
|
if (typeof window > "u" || window.__KMAP_CANVAS_PROFILER_INSTALLED__) return;
|
|
1081
1083
|
let e = CanvasRenderingContext2D?.prototype, t = HTMLCanvasElement?.prototype;
|
|
1082
1084
|
if (!e || !t) return;
|
|
1083
|
-
let n =
|
|
1084
|
-
|
|
1085
|
+
let n = Gn();
|
|
1086
|
+
Q(e, "fillText", n, { captureSource: !0 }), Q(e, "measureText", n, { captureSource: !0 }), Q(e, "drawImage", n), Q(e, "save", n), Q(e, "restore", n), Q(e, "clip", n), Q(e, "setTransform", n), Q(e, "scale", n), er(e, "font", n.ctxProps), er(e, "filter", n.ctxProps), er(e, "shadowBlur", n.ctxProps), er(e, "lineWidth", n.ctxProps), er(t, "width", n.canvasProps), er(t, "height", n.canvasProps), window.__KMAP_CANVAS_PROFILER_METRICS__ = n, window.__KMAP_CANVAS_PROFILER_INSTALLED__ = !0, window.showCanvasReport = () => {
|
|
1085
1087
|
let e = window.__KMAP_CANVAS_PROFILER_METRICS__;
|
|
1086
1088
|
if (e) {
|
|
1087
|
-
console.group("[kmap] Canvas profiler report"), console.log("ctx methods"), console.table(
|
|
1089
|
+
console.group("[kmap] Canvas profiler report"), console.log("ctx methods"), console.table(Jn(e.ctxMethods)), console.log("ctx props"), console.table(Jn(e.ctxProps)), console.log("canvas props"), console.table(Jn(e.canvasProps));
|
|
1088
1090
|
for (let t of ["fillText", "measureText"]) {
|
|
1089
1091
|
let n = e.ctxMethodSources[t];
|
|
1090
|
-
n && (console.log(`${t} sources`), console.table(
|
|
1092
|
+
n && (console.log(`${t} sources`), console.table(Jn(n).slice(0, 20)));
|
|
1091
1093
|
}
|
|
1092
1094
|
console.groupEnd();
|
|
1093
1095
|
}
|
|
1094
1096
|
}, window.resetCanvasReport = () => {
|
|
1095
|
-
window.__KMAP_CANVAS_PROFILER_METRICS__ =
|
|
1097
|
+
window.__KMAP_CANVAS_PROFILER_METRICS__ = Gn();
|
|
1096
1098
|
}, console.info("[kmap] Canvas profiler enabled. Use window.showCanvasReport() and window.resetCanvasReport().");
|
|
1097
1099
|
}
|
|
1098
|
-
function
|
|
1100
|
+
function nr() {
|
|
1099
1101
|
if (typeof window > "u" || !window.__KMAP_CANVAS_PROFILER_INSTALLED__) return;
|
|
1100
1102
|
let e = CanvasRenderingContext2D?.prototype, t = HTMLCanvasElement?.prototype;
|
|
1101
|
-
|
|
1103
|
+
Xn.forEach((n, r) => {
|
|
1102
1104
|
let i = r.match(/^(.+):(.+)$/);
|
|
1103
1105
|
if (!i) return;
|
|
1104
1106
|
let [, a, o] = i, s = null;
|
|
1105
1107
|
a === "CanvasRenderingContext2D" ? s = e : a === "HTMLCanvasElement" && (s = t), s && Reflect.set(s, o, n);
|
|
1106
|
-
}),
|
|
1108
|
+
}), Xn.clear(), Zn.forEach((n, r) => {
|
|
1107
1109
|
let i = r.match(/^(.+):(.+)$/);
|
|
1108
1110
|
if (!i) return;
|
|
1109
1111
|
let [, a, o] = i, s = null;
|
|
1110
1112
|
a === "CanvasRenderingContext2D" ? s = e : a === "HTMLCanvasElement" && (s = t), s && n.configurable && Object.defineProperty(s, o, n);
|
|
1111
|
-
}),
|
|
1113
|
+
}), Zn.clear(), window.__KMAP_CANVAS_PROFILER_INSTALLED__ = !1, window.__KMAP_CANVAS_PROFILER_METRICS__ = void 0, window.showCanvasReport = void 0, window.resetCanvasReport = void 0, console.info("[kmap] Canvas profiler disabled.");
|
|
1112
1114
|
}
|
|
1113
1115
|
//#endregion
|
|
1114
1116
|
//#region src/components/LeftToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
1115
|
-
var
|
|
1117
|
+
var rr = {
|
|
1116
1118
|
class: "left-toolbar",
|
|
1117
1119
|
"aria-label": "图表工具栏"
|
|
1118
|
-
},
|
|
1120
|
+
}, ir = { class: "left-toolbar__group" }, ar = [
|
|
1119
1121
|
"title",
|
|
1120
1122
|
"aria-label",
|
|
1121
1123
|
"onClick"
|
|
1122
|
-
],
|
|
1124
|
+
], or = ["onClick"], sr = [
|
|
1123
1125
|
"title",
|
|
1124
1126
|
"aria-label",
|
|
1125
1127
|
"onClick"
|
|
1126
|
-
],
|
|
1128
|
+
], cr = { class: "left-toolbar__group" }, lr = { class: "left-toolbar__group" }, ur = ["title", "aria-label"], dr = { class: "left-toolbar__group" }, fr = { class: "settings-body" }, pr = { class: "settings-label" }, mr = ["onUpdate:modelValue"], hr = ["onUpdate:modelValue"], gr = ["value"], _r = { class: "settings-label" }, vr = ["onUpdate:modelValue"], yr = ["onUpdate:modelValue"], br = ["value"], xr = /* @__PURE__ */ q(/* @__PURE__ */ u({
|
|
1127
1129
|
__name: "LeftToolbar",
|
|
1128
1130
|
props: { isFullscreen: { type: Boolean } },
|
|
1129
1131
|
emits: [
|
|
@@ -1138,81 +1140,81 @@ var tr = {
|
|
|
1138
1140
|
{
|
|
1139
1141
|
id: "cursor",
|
|
1140
1142
|
title: "光标",
|
|
1141
|
-
icon:
|
|
1143
|
+
icon: Jt
|
|
1142
1144
|
},
|
|
1143
1145
|
{
|
|
1144
1146
|
id: "lines",
|
|
1145
1147
|
title: "线条",
|
|
1146
|
-
icon:
|
|
1148
|
+
icon: Zt,
|
|
1147
1149
|
children: [
|
|
1148
1150
|
{
|
|
1149
1151
|
id: "trend-line",
|
|
1150
1152
|
title: "线段",
|
|
1151
|
-
icon:
|
|
1153
|
+
icon: Zt
|
|
1152
1154
|
},
|
|
1153
1155
|
{
|
|
1154
1156
|
id: "ray",
|
|
1155
1157
|
title: "射线",
|
|
1156
|
-
icon:
|
|
1158
|
+
icon: en
|
|
1157
1159
|
},
|
|
1158
1160
|
{
|
|
1159
1161
|
id: "h-line",
|
|
1160
1162
|
title: "水平线",
|
|
1161
|
-
icon:
|
|
1163
|
+
icon: sn
|
|
1162
1164
|
},
|
|
1163
1165
|
{
|
|
1164
1166
|
id: "h-ray",
|
|
1165
1167
|
title: "水平射线",
|
|
1166
|
-
icon:
|
|
1168
|
+
icon: rn
|
|
1167
1169
|
},
|
|
1168
1170
|
{
|
|
1169
1171
|
id: "v-line",
|
|
1170
1172
|
title: "垂直线",
|
|
1171
|
-
icon:
|
|
1173
|
+
icon: un
|
|
1172
1174
|
},
|
|
1173
1175
|
{
|
|
1174
1176
|
id: "crosshair-line",
|
|
1175
1177
|
title: "十字线",
|
|
1176
|
-
icon:
|
|
1178
|
+
icon: pn
|
|
1177
1179
|
},
|
|
1178
1180
|
{
|
|
1179
1181
|
id: "info-line",
|
|
1180
1182
|
title: "信息线",
|
|
1181
|
-
icon:
|
|
1183
|
+
icon: gn
|
|
1182
1184
|
}
|
|
1183
1185
|
]
|
|
1184
1186
|
},
|
|
1185
1187
|
{
|
|
1186
1188
|
id: "channels",
|
|
1187
1189
|
title: "通道",
|
|
1188
|
-
icon:
|
|
1190
|
+
icon: Pn,
|
|
1189
1191
|
children: [
|
|
1190
1192
|
{
|
|
1191
1193
|
id: "parallel-channel",
|
|
1192
1194
|
title: "平行通道",
|
|
1193
|
-
icon:
|
|
1195
|
+
icon: Pn
|
|
1194
1196
|
},
|
|
1195
1197
|
{
|
|
1196
1198
|
id: "regression-channel",
|
|
1197
1199
|
title: "回归趋势",
|
|
1198
|
-
icon:
|
|
1200
|
+
icon: Ln
|
|
1199
1201
|
},
|
|
1200
1202
|
{
|
|
1201
1203
|
id: "flat-line",
|
|
1202
1204
|
title: "平滑顶底",
|
|
1203
|
-
icon:
|
|
1205
|
+
icon: Bn
|
|
1204
1206
|
},
|
|
1205
1207
|
{
|
|
1206
1208
|
id: "disjoint-channel",
|
|
1207
1209
|
title: "不相交通道",
|
|
1208
|
-
icon:
|
|
1210
|
+
icon: Un
|
|
1209
1211
|
}
|
|
1210
1212
|
]
|
|
1211
1213
|
}
|
|
1212
|
-
], m = f, h = C("cursor"), _ = C(null), v = C(!1),
|
|
1213
|
-
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() {
|
|
1214
1216
|
try {
|
|
1215
|
-
let e = localStorage.getItem(
|
|
1217
|
+
let e = localStorage.getItem(le);
|
|
1216
1218
|
if (e) {
|
|
1217
1219
|
let t = JSON.parse(e), n = {};
|
|
1218
1220
|
return U.forEach((e) => {
|
|
@@ -1225,12 +1227,12 @@ var tr = {
|
|
|
1225
1227
|
e[t.key] = t.default;
|
|
1226
1228
|
}), e;
|
|
1227
1229
|
}
|
|
1228
|
-
function
|
|
1230
|
+
function F(e) {
|
|
1229
1231
|
try {
|
|
1230
|
-
localStorage.setItem(
|
|
1232
|
+
localStorage.setItem(le, JSON.stringify(e));
|
|
1231
1233
|
} catch {}
|
|
1232
1234
|
}
|
|
1233
|
-
let I = C(
|
|
1235
|
+
let I = C(j()), L = C({ ...I.value });
|
|
1234
1236
|
function te(e) {
|
|
1235
1237
|
return h.value === e.id ? !0 : e.children ? e.children.some((e) => e.id === h.value) : !1;
|
|
1236
1238
|
}
|
|
@@ -1240,7 +1242,7 @@ var tr = {
|
|
|
1240
1242
|
let t = e.children[0];
|
|
1241
1243
|
h.value = t.id, m("selectTool", t.id);
|
|
1242
1244
|
}
|
|
1243
|
-
|
|
1245
|
+
re(e.id);
|
|
1244
1246
|
return;
|
|
1245
1247
|
}
|
|
1246
1248
|
h.value = e.id, m("selectTool", e.id), _.value = null;
|
|
@@ -1248,37 +1250,37 @@ var tr = {
|
|
|
1248
1250
|
function ne(e) {
|
|
1249
1251
|
h.value = e.id, m("selectTool", e.id), _.value = null;
|
|
1250
1252
|
}
|
|
1251
|
-
function
|
|
1253
|
+
function re(e) {
|
|
1252
1254
|
_.value = _.value === e ? null : e;
|
|
1253
1255
|
}
|
|
1254
|
-
function
|
|
1256
|
+
function z() {
|
|
1255
1257
|
L.value = { ...I.value }, v.value = !0;
|
|
1256
1258
|
}
|
|
1257
|
-
function
|
|
1259
|
+
function B() {
|
|
1258
1260
|
v.value = !1;
|
|
1259
1261
|
}
|
|
1260
|
-
function
|
|
1262
|
+
function ie() {
|
|
1261
1263
|
let e = {};
|
|
1262
1264
|
U.forEach((t) => {
|
|
1263
1265
|
e[t.key] = t.default;
|
|
1264
1266
|
}), L.value = e;
|
|
1265
1267
|
}
|
|
1266
|
-
function V() {
|
|
1267
|
-
I.value = { ...L.value }, ee(I.value), Xn(!!I.value.enableCanvasProfiler), m("settingsChange", { ...I.value }), ie();
|
|
1268
|
-
}
|
|
1269
1268
|
function ae() {
|
|
1269
|
+
I.value = { ...L.value }, F(I.value), Qn(!!I.value.enableCanvasProfiler), m("settingsChange", { ...I.value }), B();
|
|
1270
|
+
}
|
|
1271
|
+
function V() {
|
|
1270
1272
|
return { ...I.value };
|
|
1271
1273
|
}
|
|
1272
|
-
d({ getSettings:
|
|
1274
|
+
d({ getSettings: V });
|
|
1273
1275
|
function H(e) {
|
|
1274
1276
|
e.target.closest(".tool-item") || (_.value = null);
|
|
1275
1277
|
}
|
|
1276
|
-
return
|
|
1277
|
-
document.addEventListener("click", H, !0), m("settingsChange", { ...I.value }),
|
|
1278
|
-
}),
|
|
1278
|
+
return ee(() => {
|
|
1279
|
+
document.addEventListener("click", H, !0), m("settingsChange", { ...I.value }), Qn(!!I.value.enableCanvasProfiler);
|
|
1280
|
+
}), b(() => {
|
|
1279
1281
|
document.removeEventListener("click", H, !0);
|
|
1280
|
-
}), (r, d) => (
|
|
1281
|
-
s("div",
|
|
1282
|
+
}), (r, d) => (x(), o(e, null, [s("nav", rr, [
|
|
1283
|
+
s("div", ir, [(x(), o(e, null, w(p, (t) => s("div", {
|
|
1282
1284
|
key: t.id,
|
|
1283
1285
|
class: "tool-item"
|
|
1284
1286
|
}, [s("button", {
|
|
@@ -1287,48 +1289,48 @@ var tr = {
|
|
|
1287
1289
|
title: t.title,
|
|
1288
1290
|
"aria-label": t.title,
|
|
1289
1291
|
onClick: (e) => R(t),
|
|
1290
|
-
onPointerdown: d[0] ||=
|
|
1291
|
-
onPointermove: d[1] ||=
|
|
1292
|
-
onPointerup: d[2] ||=
|
|
1293
|
-
}, [(
|
|
1292
|
+
onPointerdown: d[0] ||= P(() => {}, ["stop"]),
|
|
1293
|
+
onPointermove: d[1] ||= P(() => {}, ["stop"]),
|
|
1294
|
+
onPointerup: d[2] ||= P(() => {}, ["stop"])
|
|
1295
|
+
}, [(x(), i(T(t.icon), {
|
|
1294
1296
|
class: "tool-icon",
|
|
1295
1297
|
"aria-hidden": "true"
|
|
1296
|
-
})), t.children && t.children.length ? (
|
|
1298
|
+
})), t.children && t.children.length ? (x(), o("span", {
|
|
1297
1299
|
key: 0,
|
|
1298
1300
|
class: g(["corner-indicator", { open: _.value === t.id }]),
|
|
1299
|
-
onClick:
|
|
1301
|
+
onClick: P((e) => re(t.id), ["stop"]),
|
|
1300
1302
|
"aria-label": "展开子菜单"
|
|
1301
|
-
}, null, 10,
|
|
1302
|
-
default:
|
|
1303
|
+
}, null, 10, or)) : a("", !0)], 42, ar), l(n, { name: "dropdown" }, {
|
|
1304
|
+
default: M(() => [_.value === t.id && t.children && t.children.length ? (x(), o("div", {
|
|
1303
1305
|
key: 0,
|
|
1304
1306
|
class: "tool-dropdown",
|
|
1305
|
-
onPointerdown: d[3] ||=
|
|
1306
|
-
onPointermove: d[4] ||=
|
|
1307
|
-
onPointerup: d[5] ||=
|
|
1308
|
-
}, [(
|
|
1307
|
+
onPointerdown: d[3] ||= P(() => {}, ["stop"]),
|
|
1308
|
+
onPointermove: d[4] ||= P(() => {}, ["stop"]),
|
|
1309
|
+
onPointerup: d[5] ||= P(() => {}, ["stop"])
|
|
1310
|
+
}, [(x(!0), o(e, null, w(t.children, (e) => (x(), o("button", {
|
|
1309
1311
|
key: e.id,
|
|
1310
1312
|
type: "button",
|
|
1311
1313
|
class: g(["left-toolbar__button", { active: h.value === e.id }]),
|
|
1312
1314
|
title: e.title,
|
|
1313
1315
|
"aria-label": e.title,
|
|
1314
1316
|
onClick: (t) => ne(e)
|
|
1315
|
-
}, [(
|
|
1317
|
+
}, [(x(), i(T(e.icon), {
|
|
1316
1318
|
class: "tool-icon",
|
|
1317
1319
|
"aria-hidden": "true"
|
|
1318
|
-
}))], 10,
|
|
1320
|
+
}))], 10, sr))), 128))], 32)) : a("", !0)]),
|
|
1319
1321
|
_: 2
|
|
1320
1322
|
}, 1024)])), 64))]),
|
|
1321
1323
|
d[22] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
|
|
1322
|
-
s("div",
|
|
1324
|
+
s("div", cr, [s("button", {
|
|
1323
1325
|
type: "button",
|
|
1324
1326
|
class: "left-toolbar__button",
|
|
1325
1327
|
title: "放大",
|
|
1326
1328
|
"aria-label": "放大",
|
|
1327
1329
|
onClick: d[6] ||= (e) => r.$emit("zoomIn"),
|
|
1328
|
-
onPointerdown: d[7] ||=
|
|
1329
|
-
onPointermove: d[8] ||=
|
|
1330
|
-
onPointerup: d[9] ||=
|
|
1331
|
-
}, [l(O(
|
|
1330
|
+
onPointerdown: d[7] ||= P(() => {}, ["stop"]),
|
|
1331
|
+
onPointermove: d[8] ||= P(() => {}, ["stop"]),
|
|
1332
|
+
onPointerup: d[9] ||= P(() => {}, ["stop"])
|
|
1333
|
+
}, [l(O(yn), {
|
|
1332
1334
|
class: "tool-icon",
|
|
1333
1335
|
"aria-hidden": "true"
|
|
1334
1336
|
})], 32), s("button", {
|
|
@@ -1337,99 +1339,99 @@ var tr = {
|
|
|
1337
1339
|
title: "缩小",
|
|
1338
1340
|
"aria-label": "缩小",
|
|
1339
1341
|
onClick: d[10] ||= (e) => r.$emit("zoomOut"),
|
|
1340
|
-
onPointerdown: d[11] ||=
|
|
1341
|
-
onPointermove: d[12] ||=
|
|
1342
|
-
onPointerup: d[13] ||=
|
|
1343
|
-
}, [l(O(
|
|
1342
|
+
onPointerdown: d[11] ||= P(() => {}, ["stop"]),
|
|
1343
|
+
onPointermove: d[12] ||= P(() => {}, ["stop"]),
|
|
1344
|
+
onPointerup: d[13] ||= P(() => {}, ["stop"])
|
|
1345
|
+
}, [l(O(Sn), {
|
|
1344
1346
|
class: "tool-icon",
|
|
1345
1347
|
"aria-hidden": "true"
|
|
1346
1348
|
})], 32)]),
|
|
1347
1349
|
d[23] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
|
|
1348
|
-
s("div",
|
|
1350
|
+
s("div", lr, [s("button", {
|
|
1349
1351
|
type: "button",
|
|
1350
1352
|
class: "left-toolbar__button",
|
|
1351
1353
|
title: u.isFullscreen ? "退出全屏" : "全屏显示",
|
|
1352
1354
|
"aria-label": u.isFullscreen ? "退出全屏" : "全屏显示",
|
|
1353
1355
|
onClick: d[14] ||= (e) => r.$emit("toggleFullscreen"),
|
|
1354
|
-
onPointerdown: d[15] ||=
|
|
1355
|
-
onPointermove: d[16] ||=
|
|
1356
|
-
onPointerup: d[17] ||=
|
|
1357
|
-
}, [u.isFullscreen ? (
|
|
1356
|
+
onPointerdown: d[15] ||= P(() => {}, ["stop"]),
|
|
1357
|
+
onPointermove: d[16] ||= P(() => {}, ["stop"]),
|
|
1358
|
+
onPointerup: d[17] ||= P(() => {}, ["stop"])
|
|
1359
|
+
}, [u.isFullscreen ? (x(), i(O(On), {
|
|
1358
1360
|
key: 0,
|
|
1359
1361
|
class: "tool-icon",
|
|
1360
1362
|
"aria-hidden": "true"
|
|
1361
|
-
})) : (
|
|
1363
|
+
})) : (x(), i(O(Tn), {
|
|
1362
1364
|
key: 1,
|
|
1363
1365
|
class: "tool-icon",
|
|
1364
1366
|
"aria-hidden": "true"
|
|
1365
|
-
}))], 40,
|
|
1367
|
+
}))], 40, ur)]),
|
|
1366
1368
|
d[24] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
|
|
1367
|
-
s("div",
|
|
1369
|
+
s("div", dr, [s("button", {
|
|
1368
1370
|
type: "button",
|
|
1369
1371
|
class: "left-toolbar__button",
|
|
1370
1372
|
title: "设置",
|
|
1371
1373
|
"aria-label": "设置",
|
|
1372
|
-
onClick:
|
|
1373
|
-
onPointerdown: d[18] ||=
|
|
1374
|
-
onPointermove: d[19] ||=
|
|
1375
|
-
onPointerup: d[20] ||=
|
|
1376
|
-
}, [l(O(
|
|
1374
|
+
onClick: z,
|
|
1375
|
+
onPointerdown: d[18] ||= P(() => {}, ["stop"]),
|
|
1376
|
+
onPointermove: d[19] ||= P(() => {}, ["stop"]),
|
|
1377
|
+
onPointerup: d[20] ||= P(() => {}, ["stop"])
|
|
1378
|
+
}, [l(O(jn), {
|
|
1377
1379
|
class: "tool-icon",
|
|
1378
1380
|
"aria-hidden": "true"
|
|
1379
1381
|
})], 32)])
|
|
1380
|
-
]), (
|
|
1381
|
-
default:
|
|
1382
|
+
]), (x(), i(t, { to: O(y) }, [l(n, { name: "overlay" }, {
|
|
1383
|
+
default: M(() => [v.value ? (x(), o("div", {
|
|
1382
1384
|
key: 0,
|
|
1383
1385
|
class: "settings-overlay",
|
|
1384
|
-
onClick:
|
|
1386
|
+
onClick: B
|
|
1385
1387
|
}, [l(n, { name: "modal" }, {
|
|
1386
|
-
default:
|
|
1388
|
+
default: M(() => [s("div", {
|
|
1387
1389
|
class: "settings-modal",
|
|
1388
|
-
onClick: d[21] ||=
|
|
1390
|
+
onClick: d[21] ||= P(() => {}, ["stop"])
|
|
1389
1391
|
}, [
|
|
1390
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", {
|
|
1391
1393
|
class: "settings-close",
|
|
1392
|
-
onClick:
|
|
1394
|
+
onClick: B
|
|
1393
1395
|
}, [...d[25] ||= [s("svg", {
|
|
1394
1396
|
viewBox: "0 0 24 24",
|
|
1395
1397
|
fill: "none",
|
|
1396
1398
|
stroke: "currentColor",
|
|
1397
1399
|
"stroke-width": "2"
|
|
1398
1400
|
}, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
|
|
1399
|
-
s("div",
|
|
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", {
|
|
1400
1402
|
key: t.key,
|
|
1401
1403
|
class: "settings-item"
|
|
1402
|
-
}, [s("label",
|
|
1404
|
+
}, [s("label", pr, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((x(), o("input", {
|
|
1403
1405
|
key: 0,
|
|
1404
1406
|
type: "checkbox",
|
|
1405
1407
|
class: "settings-checkbox",
|
|
1406
1408
|
"onUpdate:modelValue": (e) => L.value[t.key] = e
|
|
1407
|
-
}, null, 8,
|
|
1409
|
+
}, null, 8, mr)), [[k, L.value[t.key]]]) : t.type === "select" && t.options ? N((x(), o("select", {
|
|
1408
1410
|
key: 1,
|
|
1409
1411
|
class: "settings-select",
|
|
1410
1412
|
"onUpdate:modelValue": (e) => L.value[t.key] = e
|
|
1411
|
-
}, [(
|
|
1413
|
+
}, [(x(!0), o(e, null, w(t.options, (e) => (x(), o("option", {
|
|
1412
1414
|
key: e.value,
|
|
1413
1415
|
value: e.value
|
|
1414
|
-
}, D(e.label), 9,
|
|
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", {
|
|
1415
1417
|
key: t.key,
|
|
1416
1418
|
class: "settings-item experimental"
|
|
1417
|
-
}, [s("label",
|
|
1419
|
+
}, [s("label", _r, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((x(), o("input", {
|
|
1418
1420
|
key: 0,
|
|
1419
1421
|
type: "checkbox",
|
|
1420
1422
|
class: "settings-checkbox",
|
|
1421
1423
|
"onUpdate:modelValue": (e) => L.value[t.key] = e
|
|
1422
|
-
}, null, 8,
|
|
1424
|
+
}, null, 8, vr)), [[k, L.value[t.key]]]) : t.type === "select" && t.options ? N((x(), o("select", {
|
|
1423
1425
|
key: 1,
|
|
1424
1426
|
class: "settings-select",
|
|
1425
1427
|
"onUpdate:modelValue": (e) => L.value[t.key] = e
|
|
1426
|
-
}, [(
|
|
1428
|
+
}, [(x(!0), o(e, null, w(t.options, (e) => (x(), o("option", {
|
|
1427
1429
|
key: e.value,
|
|
1428
1430
|
value: e.value
|
|
1429
|
-
}, D(e.label), 9,
|
|
1431
|
+
}, D(e.label), 9, br))), 128))], 8, yr)), [[A, L.value[t.key]]]) : a("", !0)])]))), 128))], 64)) : a("", !0)]),
|
|
1430
1432
|
s("div", { class: "settings-footer" }, [s("button", {
|
|
1431
1433
|
class: "settings-btn reset",
|
|
1432
|
-
onClick:
|
|
1434
|
+
onClick: ie
|
|
1433
1435
|
}, [...d[29] ||= [s("svg", {
|
|
1434
1436
|
viewBox: "0 0 24 24",
|
|
1435
1437
|
fill: "none",
|
|
@@ -1437,10 +1439,10 @@ var tr = {
|
|
|
1437
1439
|
"stroke-width": "2"
|
|
1438
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", {
|
|
1439
1441
|
class: "settings-btn cancel",
|
|
1440
|
-
onClick:
|
|
1442
|
+
onClick: B
|
|
1441
1443
|
}, "取消"), s("button", {
|
|
1442
1444
|
class: "settings-btn confirm",
|
|
1443
|
-
onClick:
|
|
1445
|
+
onClick: ae
|
|
1444
1446
|
}, [...d[30] ||= [s("svg", {
|
|
1445
1447
|
viewBox: "0 0 24 24",
|
|
1446
1448
|
fill: "none",
|
|
@@ -1453,10 +1455,16 @@ var tr = {
|
|
|
1453
1455
|
_: 1
|
|
1454
1456
|
})], 8, ["to"]))], 64));
|
|
1455
1457
|
}
|
|
1456
|
-
}), [["__scopeId", "data-v-3e3ffb4f"]]),
|
|
1458
|
+
}), [["__scopeId", "data-v-3e3ffb4f"]]), Sr = ["data-theme"], Cr = {
|
|
1457
1459
|
class: "pane-separator-layer",
|
|
1458
1460
|
"aria-hidden": "true"
|
|
1459
|
-
},
|
|
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({
|
|
1460
1468
|
__name: "KLineChart",
|
|
1461
1469
|
props: {
|
|
1462
1470
|
semanticConfig: {},
|
|
@@ -1476,36 +1484,24 @@ var tr = {
|
|
|
1476
1484
|
},
|
|
1477
1485
|
emits: ["zoomLevelChange", "toggleFullscreen"],
|
|
1478
1486
|
setup(n, { expose: c, emit: u }) {
|
|
1479
|
-
let d = n, f = C(null), p = C(null), m = C(null), v = C(null),
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
zoomLevels: d.zoomLevels,
|
|
1484
|
-
rightAxisWidth: d.rightAxisWidth,
|
|
1485
|
-
priceLabelWidth: d.priceLabelWidth
|
|
1486
|
-
}), N = C("light");
|
|
1487
|
-
j.actions.setZoomState(j.state.zoomLevel, B(j.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, {
|
|
1488
1491
|
minKWidth: d.minKWidth,
|
|
1489
1492
|
maxKWidth: d.maxKWidth,
|
|
1490
1493
|
zoomLevelCount: d.zoomLevels,
|
|
1491
|
-
dpr:
|
|
1492
|
-
}),
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
k.value?.scheduleDraw();
|
|
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);
|
|
1501
1503
|
}
|
|
1502
|
-
function
|
|
1503
|
-
if (k.value?.updateSettings(e), e.performanceTest10kKlines) {
|
|
1504
|
-
let e = le();
|
|
1505
|
-
console.time("updateData-10k"), k.value?.updateData(e), console.timeEnd("updateData-10k"), j.actions.setDataLength(e.length), j.actions.bumpDataVersion();
|
|
1506
|
-
} else A.value && k.value?.getData()?.length === 1e4 && A.value.applyConfig(d.semanticConfig);
|
|
1507
|
-
}
|
|
1508
|
-
function le() {
|
|
1504
|
+
function U() {
|
|
1509
1505
|
let e = [], t = (/* @__PURE__ */ new Date("2020-01-01")).getTime(), n = 3e3;
|
|
1510
1506
|
for (let r = 0; r < 1e4; r++) {
|
|
1511
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);
|
|
@@ -1520,23 +1516,23 @@ var tr = {
|
|
|
1520
1516
|
}
|
|
1521
1517
|
return e;
|
|
1522
1518
|
}
|
|
1523
|
-
function
|
|
1519
|
+
function le(e, t, n) {
|
|
1524
1520
|
let r = e.getBoundingClientRect();
|
|
1525
1521
|
return {
|
|
1526
1522
|
width: Math.max(t, Math.round(r.width)),
|
|
1527
1523
|
height: Math.max(n, Math.round(r.height))
|
|
1528
1524
|
};
|
|
1529
1525
|
}
|
|
1530
|
-
function
|
|
1526
|
+
function ue(e) {
|
|
1531
1527
|
e && h(() => {
|
|
1532
1528
|
if (!e.isConnected) return;
|
|
1533
|
-
let t =
|
|
1534
|
-
|
|
1529
|
+
let t = le(e, 180, 80);
|
|
1530
|
+
S.value?.setTooltipSize(t);
|
|
1535
1531
|
});
|
|
1536
1532
|
}
|
|
1537
|
-
function
|
|
1533
|
+
function de(e) {
|
|
1538
1534
|
e && h(() => {
|
|
1539
|
-
e.isConnected && (_e.value =
|
|
1535
|
+
e.isConnected && (_e.value = le(e, 120, 60));
|
|
1540
1536
|
});
|
|
1541
1537
|
}
|
|
1542
1538
|
let W = C({
|
|
@@ -1546,7 +1542,7 @@ var tr = {
|
|
|
1546
1542
|
function q() {
|
|
1547
1543
|
K = null;
|
|
1548
1544
|
}
|
|
1549
|
-
function
|
|
1545
|
+
function pe(e) {
|
|
1550
1546
|
return K ||= e.getBoundingClientRect(), K;
|
|
1551
1547
|
}
|
|
1552
1548
|
let J = E({
|
|
@@ -1568,13 +1564,13 @@ var tr = {
|
|
|
1568
1564
|
hoveredPaneBoundaryId: null,
|
|
1569
1565
|
isHoveringRightAxis: !1
|
|
1570
1566
|
}), Y = E(null), he = r(() => {
|
|
1571
|
-
let e =
|
|
1572
|
-
return e ?
|
|
1567
|
+
let e = I.value;
|
|
1568
|
+
return e ? L.value.find((t) => t.id === e) ?? null : null;
|
|
1573
1569
|
}), ge = C([]), _e = C({
|
|
1574
1570
|
width: 220,
|
|
1575
1571
|
height: 120
|
|
1576
1572
|
}), ve = r(() => {
|
|
1577
|
-
let e =
|
|
1573
|
+
let e = f.value, t = p.value;
|
|
1578
1574
|
return !e || !t ? {
|
|
1579
1575
|
x: 0,
|
|
1580
1576
|
y: 0
|
|
@@ -1582,82 +1578,84 @@ var tr = {
|
|
|
1582
1578
|
x: e.offsetLeft,
|
|
1583
1579
|
y: e.offsetTop
|
|
1584
1580
|
};
|
|
1585
|
-
}), 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(() => {
|
|
1586
1584
|
let e = J.value.hoveredIndex;
|
|
1587
1585
|
if (typeof e != "number") return null;
|
|
1588
|
-
|
|
1589
|
-
let t =
|
|
1586
|
+
O.value;
|
|
1587
|
+
let t = S.value?.getData();
|
|
1590
1588
|
return t && e >= 0 && e < t.length ? t[e] : null;
|
|
1591
|
-
}),
|
|
1592
|
-
x:
|
|
1593
|
-
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`
|
|
1594
1595
|
})), Ne = r(() => ({
|
|
1595
|
-
left: `${Me.value.x}px`,
|
|
1596
|
-
top: `${Me.value.y}px`
|
|
1597
|
-
})), Pe = r(() => ({
|
|
1598
1596
|
x: W.value.x + ve.value.x,
|
|
1599
1597
|
y: W.value.y + ve.value.y
|
|
1600
|
-
})),
|
|
1601
|
-
left: `${
|
|
1602
|
-
top: `${
|
|
1603
|
-
})),
|
|
1604
|
-
let e =
|
|
1598
|
+
})), Pe = r(() => ({
|
|
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);
|
|
1605
1603
|
return W.value.x + 12 + _e.value.width + 12 > n ? "left-bottom" : "right-bottom";
|
|
1606
|
-
}),
|
|
1607
|
-
function
|
|
1604
|
+
}), Le = r(() => (O.value, S.value?.getData() ?? []));
|
|
1605
|
+
function Re(e) {
|
|
1608
1606
|
Y.value?.setTool(e);
|
|
1609
1607
|
}
|
|
1610
|
-
function
|
|
1608
|
+
function ze(e) {
|
|
1611
1609
|
let t = he.value;
|
|
1612
|
-
!t || !Y.value ||
|
|
1610
|
+
!t || !Y.value || Y.value.updateDrawingStyle(t.id, e);
|
|
1613
1611
|
}
|
|
1614
|
-
function
|
|
1612
|
+
function Be() {
|
|
1615
1613
|
let e = he.value;
|
|
1616
|
-
!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());
|
|
1617
1615
|
}
|
|
1618
|
-
function
|
|
1619
|
-
|
|
1616
|
+
function Ve(e) {
|
|
1617
|
+
S.value?.handlePointerEvent(e, { onPointerDown: (e, t) => Y.value?.onPointerDown(e, t) ? (L.value = Y.value.getDrawings(), !0) : !1 });
|
|
1620
1618
|
}
|
|
1621
|
-
function
|
|
1622
|
-
let t =
|
|
1619
|
+
function He(e) {
|
|
1620
|
+
let t = f.value;
|
|
1623
1621
|
if (t) {
|
|
1624
|
-
let n =
|
|
1622
|
+
let n = pe(t);
|
|
1625
1623
|
W.value = {
|
|
1626
1624
|
x: e.clientX - n.left,
|
|
1627
1625
|
y: e.clientY - n.top
|
|
1628
1626
|
};
|
|
1629
1627
|
}
|
|
1630
|
-
|
|
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 });
|
|
1631
1632
|
}
|
|
1632
1633
|
function We(e) {
|
|
1633
|
-
|
|
1634
|
+
S.value?.handlePointerEvent(e);
|
|
1634
1635
|
}
|
|
1635
1636
|
function Ge(e) {
|
|
1636
|
-
|
|
1637
|
+
S.value?.handlePointerEvent(e);
|
|
1637
1638
|
}
|
|
1638
1639
|
function Ke(e) {
|
|
1639
|
-
|
|
1640
|
+
S.value?.handlePointerEvent(e);
|
|
1640
1641
|
}
|
|
1641
1642
|
function qe(e) {
|
|
1642
|
-
|
|
1643
|
+
S.value?.handlePointerEvent(e);
|
|
1643
1644
|
}
|
|
1644
1645
|
function Je(e) {
|
|
1645
|
-
|
|
1646
|
-
}
|
|
1647
|
-
function Ye(e) {
|
|
1648
|
-
k.value?.handlePointerEvent(e);
|
|
1646
|
+
S.value?.handlePointerEvent(e);
|
|
1649
1647
|
}
|
|
1650
|
-
function
|
|
1651
|
-
|
|
1648
|
+
function Ye() {
|
|
1649
|
+
S.value?.handleScrollEvent();
|
|
1652
1650
|
}
|
|
1653
|
-
let
|
|
1651
|
+
let Xe = C([]), Ze = r(() => {
|
|
1654
1652
|
let e = [], t = /* @__PURE__ */ new Set();
|
|
1655
|
-
for (let n of
|
|
1653
|
+
for (let n of Z.value) t.has(n.indicatorId) || (t.add(n.indicatorId), e.push(n.indicatorId));
|
|
1656
1654
|
return e;
|
|
1657
|
-
}), Qe = r(() => [...
|
|
1655
|
+
}), Qe = r(() => [...Xe.value, ...Ze.value]), X = C({}), Z = C([]);
|
|
1658
1656
|
function $e() {
|
|
1659
|
-
let e =
|
|
1660
|
-
return
|
|
1657
|
+
let e = F.value.main ?? 3;
|
|
1658
|
+
return Z.value.length === 0 ? [{
|
|
1661
1659
|
id: "main",
|
|
1662
1660
|
ratio: e,
|
|
1663
1661
|
visible: !0,
|
|
@@ -1667,118 +1665,51 @@ var tr = {
|
|
|
1667
1665
|
ratio: e,
|
|
1668
1666
|
visible: !0,
|
|
1669
1667
|
role: "price"
|
|
1670
|
-
}, ...
|
|
1668
|
+
}, ...Z.value.map((e) => ({
|
|
1671
1669
|
id: e.id,
|
|
1672
|
-
ratio:
|
|
1670
|
+
ratio: F.value[e.id] ?? 1,
|
|
1673
1671
|
visible: !0,
|
|
1674
1672
|
role: "indicator"
|
|
1675
1673
|
}))];
|
|
1676
1674
|
}
|
|
1677
1675
|
function et(e) {
|
|
1678
|
-
return { ...
|
|
1679
|
-
}
|
|
1680
|
-
let tt = /* @__PURE__ */ new Map()
|
|
1681
|
-
function
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
}
|
|
1689
|
-
function it(
|
|
1690
|
-
let
|
|
1691
|
-
|
|
1692
|
-
}
|
|
1693
|
-
function at(
|
|
1694
|
-
|
|
1695
|
-
let n = t ?? et(e), r = k.value?.addIndicator(e, "sub", n);
|
|
1696
|
-
return r ? (rt(r, e), Q.value.push({
|
|
1697
|
-
id: r,
|
|
1698
|
-
indicatorId: e,
|
|
1699
|
-
params: n
|
|
1700
|
-
}), U(), !0) : !1;
|
|
1701
|
-
}
|
|
1702
|
-
function ot(e) {
|
|
1703
|
-
let t = Q.value.findIndex((t) => t.id === e);
|
|
1704
|
-
t !== -1 && Q.value[t] && (it(e), k.value?.removeIndicator(e), Q.value.splice(t, 1));
|
|
1705
|
-
}
|
|
1706
|
-
function st() {
|
|
1707
|
-
for (let e of Q.value) k.value?.removeIndicator(e.id), it(e.id);
|
|
1708
|
-
Q.value = [], tt.clear(), nt.clear();
|
|
1709
|
-
}
|
|
1710
|
-
function ct() {
|
|
1711
|
-
let e = d.semanticConfig, t = k.value;
|
|
1676
|
+
return { ...ne[e].defaultParams };
|
|
1677
|
+
}
|
|
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);
|
|
1683
|
+
}
|
|
1684
|
+
function rt(e) {
|
|
1685
|
+
S.value?.removeIndicator(e);
|
|
1686
|
+
}
|
|
1687
|
+
function it() {
|
|
1688
|
+
for (let e of Z.value) S.value?.removeIndicator(e.id);
|
|
1689
|
+
tt.clear();
|
|
1690
|
+
}
|
|
1691
|
+
function at() {
|
|
1692
|
+
let e = d.semanticConfig, t = S.value;
|
|
1712
1693
|
if (!t) return;
|
|
1713
1694
|
let n = e.indicators?.main;
|
|
1714
|
-
if (n) for (let e of n) e.enabled &&
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
let
|
|
1718
|
-
t && (t.updateRendererConfig("mainIndicatorLegend", { indicators: {
|
|
1719
|
-
MA: {
|
|
1720
|
-
enabled: e.includes("MA"),
|
|
1721
|
-
params: Z.value.MA || {}
|
|
1722
|
-
},
|
|
1723
|
-
BOLL: {
|
|
1724
|
-
enabled: e.includes("BOLL"),
|
|
1725
|
-
params: Z.value.BOLL || {}
|
|
1726
|
-
},
|
|
1727
|
-
EXPMA: {
|
|
1728
|
-
enabled: e.includes("EXPMA"),
|
|
1729
|
-
params: Z.value.EXPMA || {}
|
|
1730
|
-
},
|
|
1731
|
-
ENE: {
|
|
1732
|
-
enabled: e.includes("ENE"),
|
|
1733
|
-
params: Z.value.ENE || {}
|
|
1734
|
-
}
|
|
1735
|
-
} }), U());
|
|
1736
|
-
}, { deep: !0 });
|
|
1737
|
-
function lt() {
|
|
1738
|
-
let e = k.value?.getSubPaneEntries() ?? [];
|
|
1739
|
-
Q.value = [], nt.clear();
|
|
1695
|
+
if (n) for (let e of n) e.enabled && t.addIndicator(e.type, "main", e.params);
|
|
1696
|
+
}
|
|
1697
|
+
function ot() {
|
|
1698
|
+
let e = S.value?.subPanes.peek() ?? [];
|
|
1740
1699
|
for (let t of e) {
|
|
1741
1700
|
let { paneId: e, indicatorId: n, params: r } = t, i = e.match(/^(.+)_(\d+)$/);
|
|
1742
1701
|
if (i) {
|
|
1743
1702
|
let [, e, t] = i, n = parseInt(t, 10);
|
|
1744
1703
|
n >= (tt.get(e) ?? 0) && tt.set(e, n + 1);
|
|
1745
1704
|
}
|
|
1746
|
-
rt(e, n), Q.value.push({
|
|
1747
|
-
id: e,
|
|
1748
|
-
indicatorId: n,
|
|
1749
|
-
params: { ...r }
|
|
1750
|
-
});
|
|
1751
1705
|
}
|
|
1752
|
-
U();
|
|
1753
1706
|
}
|
|
1754
|
-
function
|
|
1755
|
-
if (!Q.value.find((t) => t.id === e)) return;
|
|
1707
|
+
function st(e, t) {
|
|
1756
1708
|
let n = et(t);
|
|
1757
|
-
|
|
1758
|
-
let r = Q.value.findIndex((t) => t.id === e);
|
|
1759
|
-
r !== -1 && (Q.value[r] = {
|
|
1760
|
-
id: e,
|
|
1761
|
-
indicatorId: t,
|
|
1762
|
-
params: n
|
|
1763
|
-
});
|
|
1709
|
+
S.value?.replaceSubPaneIndicator(e, t, n);
|
|
1764
1710
|
}
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
let t = Q.value.find((t) => t.id === e);
|
|
1768
|
-
if (!t) return null;
|
|
1769
|
-
let n = k.value?.getData();
|
|
1770
|
-
if (!n || n.length === 0) return null;
|
|
1771
|
-
let r = De.value, i = n.length, a = dt.get(e);
|
|
1772
|
-
if (a && a.idx === r && a.dataLen === i) return a.result;
|
|
1773
|
-
let o = H[t.indicatorId], s = t.params, c = k.value?.plugin, l = c ? o.getTitleInfo(n, r, s, c, e) : null;
|
|
1774
|
-
return dt.set(e, {
|
|
1775
|
-
idx: r,
|
|
1776
|
-
dataLen: i,
|
|
1777
|
-
result: l
|
|
1778
|
-
}), l;
|
|
1779
|
-
}
|
|
1780
|
-
function pt(e, t) {
|
|
1781
|
-
let n = k.value;
|
|
1711
|
+
function ct(e, t) {
|
|
1712
|
+
let n = S.value;
|
|
1782
1713
|
if (n) {
|
|
1783
1714
|
if ([
|
|
1784
1715
|
"MA",
|
|
@@ -1800,299 +1731,287 @@ var tr = {
|
|
|
1800
1731
|
"STRUCTURE",
|
|
1801
1732
|
"ZONES"
|
|
1802
1733
|
].includes(e)) {
|
|
1803
|
-
let r =
|
|
1804
|
-
|
|
1805
|
-
else if (!t && r) {
|
|
1806
|
-
let t = e.toUpperCase();
|
|
1807
|
-
n.removeIndicator(t), X.value = X.value.filter((t) => t !== e);
|
|
1808
|
-
}
|
|
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());
|
|
1809
1736
|
return;
|
|
1810
1737
|
}
|
|
1811
|
-
if (
|
|
1812
|
-
if (t)
|
|
1813
|
-
|
|
1814
|
-
let t =
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
else if (Q.value.length > 0) {
|
|
1821
|
-
let t = Q.value[Q.value.length - 1];
|
|
1822
|
-
ut(t.id, e);
|
|
1823
|
-
}
|
|
1824
|
-
} else Q.value.filter((t) => t.indicatorId === e).forEach((e) => {
|
|
1825
|
-
n.removeIndicator(e.id), it(e.id);
|
|
1826
|
-
}), Q.value = Q.value.filter((t) => t.indicatorId !== e);
|
|
1827
|
-
U();
|
|
1828
|
-
}
|
|
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) {
|
|
1741
|
+
let t = Z.value[Z.value.length - 1];
|
|
1742
|
+
st(t.id, e);
|
|
1743
|
+
}
|
|
1744
|
+
} else Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
|
|
1745
|
+
n.removeIndicator(e.id);
|
|
1746
|
+
});
|
|
1829
1747
|
}
|
|
1830
1748
|
}
|
|
1831
|
-
function
|
|
1832
|
-
if (
|
|
1833
|
-
|
|
1749
|
+
function lt(e, t) {
|
|
1750
|
+
if (e === "MA" || e === "BOLL" || e === "EXPMA" || e === "ENE") {
|
|
1751
|
+
S.value?.updateIndicatorParams(e, t);
|
|
1834
1752
|
return;
|
|
1835
1753
|
}
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
}), U();
|
|
1840
|
-
return;
|
|
1841
|
-
}
|
|
1842
|
-
U();
|
|
1754
|
+
R.includes(e) && Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
|
|
1755
|
+
S.value?.updateIndicatorParams(e.id, t);
|
|
1756
|
+
});
|
|
1843
1757
|
}
|
|
1844
|
-
function
|
|
1845
|
-
if (!e.length ||
|
|
1846
|
-
let t = e.filter((e) =>
|
|
1758
|
+
function ut(e) {
|
|
1759
|
+
if (!e.length || Z.value.length <= 1) return;
|
|
1760
|
+
let t = e.filter((e) => R.includes(e));
|
|
1847
1761
|
if (!t.length) return;
|
|
1848
|
-
let n = new Map(
|
|
1762
|
+
let n = new Map(Z.value.map((e) => [e.indicatorId, e])), r = [];
|
|
1849
1763
|
for (let e of t) {
|
|
1850
1764
|
let t = n.get(e);
|
|
1851
1765
|
t && (r.push(t), n.delete(e));
|
|
1852
1766
|
}
|
|
1853
1767
|
if (r.length === 0) return;
|
|
1854
|
-
for (let e of
|
|
1855
|
-
let i =
|
|
1768
|
+
for (let e of Z.value) n.has(e.indicatorId) && (r.push(e), n.delete(e.indicatorId));
|
|
1769
|
+
let i = Z.value.map((e) => e.id), a = r.map((e) => e.id);
|
|
1856
1770
|
if (i.join("|") === a.join("|")) return;
|
|
1857
|
-
|
|
1858
|
-
let o =
|
|
1771
|
+
Z.value = r;
|
|
1772
|
+
let o = S.value;
|
|
1859
1773
|
o && o.updatePaneLayout($e());
|
|
1860
1774
|
}
|
|
1861
|
-
let
|
|
1862
|
-
function
|
|
1863
|
-
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;
|
|
1864
1778
|
if (!e || !t) return;
|
|
1865
1779
|
let n = t.getData()?.length ?? 0;
|
|
1866
1780
|
if (n === 0) return;
|
|
1867
|
-
let r = t.
|
|
1868
|
-
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;
|
|
1869
1783
|
}
|
|
1870
|
-
function
|
|
1871
|
-
|
|
1872
|
-
n && n.zoomToLevel(e, t);
|
|
1784
|
+
function mt(e, t) {
|
|
1785
|
+
S.value?.zoomToLevel(e, t);
|
|
1873
1786
|
}
|
|
1874
1787
|
c({
|
|
1875
|
-
scheduleRender:
|
|
1876
|
-
scrollToRight:
|
|
1877
|
-
addSubPane:
|
|
1878
|
-
removeSubPane:
|
|
1879
|
-
switchSubIndicator:
|
|
1880
|
-
clearAllSubPanes:
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
zoomOut: (e) => yt(P.value - 1, e),
|
|
1887
|
-
getZoomLevel: () => P.value,
|
|
1888
|
-
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
|
|
1889
1799
|
});
|
|
1890
|
-
function
|
|
1891
|
-
|
|
1892
|
-
e.preventDefault();
|
|
1893
|
-
let t = k.value;
|
|
1894
|
-
t && t.handleWheelEvent(e);
|
|
1800
|
+
function ht() {
|
|
1801
|
+
return (e) => {
|
|
1802
|
+
e.preventDefault(), S.value?.handleWheelEvent(e);
|
|
1895
1803
|
};
|
|
1896
|
-
return e.addEventListener("wheel", t, { passive: !1 }), t;
|
|
1897
1804
|
}
|
|
1898
|
-
function
|
|
1899
|
-
return
|
|
1805
|
+
function gt(e, t, n, r) {
|
|
1806
|
+
return z({
|
|
1900
1807
|
container: e,
|
|
1808
|
+
data: [],
|
|
1901
1809
|
canvasLayer: t,
|
|
1902
1810
|
rightAxisLayer: n,
|
|
1903
|
-
xAxisCanvas: r
|
|
1904
|
-
|
|
1811
|
+
xAxisCanvas: r,
|
|
1812
|
+
initialZoomLevel: d.initialZoomLevel,
|
|
1813
|
+
zoomLevels: d.zoomLevels,
|
|
1905
1814
|
yPaddingPx: d.yPaddingPx,
|
|
1906
1815
|
rightAxisWidth: d.rightAxisWidth,
|
|
1907
1816
|
bottomAxisHeight: d.bottomAxisHeight,
|
|
1908
1817
|
priceLabelWidth: d.priceLabelWidth,
|
|
1909
1818
|
minKWidth: d.minKWidth,
|
|
1910
|
-
maxKWidth: d.maxKWidth
|
|
1911
|
-
panes: [{
|
|
1912
|
-
id: "main",
|
|
1913
|
-
ratio: 1
|
|
1914
|
-
}],
|
|
1915
|
-
paneGap: 0,
|
|
1916
|
-
zoomLevels: d.zoomLevels,
|
|
1917
|
-
initialZoomLevel: d.initialZoomLevel
|
|
1819
|
+
maxKWidth: d.maxKWidth
|
|
1918
1820
|
});
|
|
1919
1821
|
}
|
|
1920
|
-
function
|
|
1921
|
-
e.
|
|
1822
|
+
function _t(e) {
|
|
1823
|
+
let t = e.paneLayout.subscribe(() => {
|
|
1922
1824
|
q();
|
|
1923
|
-
let t =
|
|
1924
|
-
ge.value =
|
|
1925
|
-
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);
|
|
1926
1828
|
return {
|
|
1927
|
-
id:
|
|
1928
|
-
top:
|
|
1829
|
+
id: n.id,
|
|
1830
|
+
top: i + t
|
|
1929
1831
|
};
|
|
1930
1832
|
});
|
|
1931
|
-
})
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
j.actions.setPaneRatios({ ...t });
|
|
1935
|
-
}), n = e.viewport.subscribe(() => {
|
|
1833
|
+
}), n = e.paneRatios.subscribe(() => {
|
|
1834
|
+
F.value = { ...e.paneRatios.peek() };
|
|
1835
|
+
}), r = e.viewport.subscribe(() => {
|
|
1936
1836
|
let t = e.viewport.peek();
|
|
1937
|
-
|
|
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);
|
|
1938
1838
|
let n = t.desiredScrollLeft;
|
|
1939
|
-
n !== void 0 && n !==
|
|
1940
|
-
let
|
|
1941
|
-
if (!
|
|
1942
|
-
let r = Math.max(0,
|
|
1943
|
-
|
|
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;
|
|
1944
1844
|
}));
|
|
1945
|
-
}),
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
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(() => {
|
|
1850
|
+
let t = e.indicators.peek(), n = t.filter((e) => e.role === "main").map((e) => e.definitionId);
|
|
1851
|
+
Xe.value = n;
|
|
1852
|
+
let r = { ...X.value };
|
|
1853
|
+
for (let e of t) e.role === "main" && e.params && Object.keys(e.params).length > 0 && (r[e.definitionId] = { ...e.params });
|
|
1854
|
+
e.updateRendererConfig("mainIndicatorLegend", { indicators: {
|
|
1855
|
+
MA: {
|
|
1856
|
+
enabled: n.includes("MA"),
|
|
1857
|
+
params: r.MA || {}
|
|
1858
|
+
},
|
|
1859
|
+
BOLL: {
|
|
1860
|
+
enabled: n.includes("BOLL"),
|
|
1861
|
+
params: r.BOLL || {}
|
|
1862
|
+
},
|
|
1863
|
+
EXPMA: {
|
|
1864
|
+
enabled: n.includes("EXPMA"),
|
|
1865
|
+
params: r.EXPMA || {}
|
|
1866
|
+
},
|
|
1867
|
+
ENE: {
|
|
1868
|
+
enabled: n.includes("ENE"),
|
|
1869
|
+
params: r.ENE || {}
|
|
1870
|
+
}
|
|
1871
|
+
} }), X.value = r;
|
|
1872
|
+
}), s = e.subPanes.subscribe(() => {
|
|
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));
|
|
1874
|
+
for (let e of t) i.has(e.paneId) || r.push({
|
|
1875
|
+
id: e.paneId,
|
|
1876
|
+
indicatorId: e.indicatorId,
|
|
1877
|
+
params: e.params
|
|
1878
|
+
});
|
|
1879
|
+
Z.value = r;
|
|
1880
|
+
let a = { ...X.value };
|
|
1881
|
+
for (let e of t) e.params && Object.keys(e.params).length > 0 && (a[e.indicatorId] = { ...e.params });
|
|
1882
|
+
X.value = a;
|
|
1950
1883
|
});
|
|
1951
|
-
|
|
1952
|
-
|
|
1884
|
+
b(() => {
|
|
1885
|
+
r(), i(), n(), t(), a(), o(), s();
|
|
1953
1886
|
});
|
|
1954
1887
|
}
|
|
1955
|
-
function
|
|
1956
|
-
let t =
|
|
1957
|
-
if (e.
|
|
1958
|
-
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();
|
|
1959
1892
|
console.time("updateData-10k"), e.updateData(t), console.timeEnd("updateData-10k");
|
|
1960
1893
|
}
|
|
1961
1894
|
}
|
|
1962
|
-
function
|
|
1963
|
-
Y.value = new
|
|
1895
|
+
function yt(e) {
|
|
1896
|
+
Y.value = new te(e), Y.value.setCallbacks({
|
|
1964
1897
|
onDrawingCreated: (e) => {
|
|
1965
|
-
|
|
1898
|
+
L.value = [...L.value, e], I.value = e.id;
|
|
1966
1899
|
},
|
|
1967
1900
|
onToolChange: () => {},
|
|
1968
1901
|
onDrawingSelected: (e) => {
|
|
1969
|
-
|
|
1902
|
+
I.value = e?.id ?? null;
|
|
1970
1903
|
}
|
|
1971
1904
|
});
|
|
1972
1905
|
}
|
|
1973
|
-
function
|
|
1974
|
-
e.
|
|
1975
|
-
J.value = e;
|
|
1976
|
-
}), e.
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
let i = n - r.getBoundingClientRect().left;
|
|
1981
|
-
e.handlePinchZoom(t, i);
|
|
1982
|
-
}), J.value = e.interaction.getInteractionSnapshot(), j.actions.setViewportDpr(e.getCurrentDpr()), e.resize();
|
|
1983
|
-
}
|
|
1984
|
-
function Dt(e) {
|
|
1985
|
-
ne(d.dataFetcher), A.value = new R(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) => {
|
|
1986
1913
|
console.error("Semantic config error:", e);
|
|
1987
|
-
}),
|
|
1988
|
-
|
|
1989
|
-
}),
|
|
1914
|
+
}), T.value.on("config:ready", () => {
|
|
1915
|
+
at(), ot(), h(() => pt());
|
|
1916
|
+
}), T.value.applyConfig(d.semanticConfig).then((e) => {
|
|
1990
1917
|
e && !e.success && console.error("Semantic config apply failed:", e.errors);
|
|
1991
1918
|
});
|
|
1992
1919
|
}
|
|
1993
|
-
return
|
|
1920
|
+
return ee(() => {
|
|
1994
1921
|
G.value = !1;
|
|
1995
|
-
let e =
|
|
1996
|
-
if (!e || !t
|
|
1997
|
-
let
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
}),
|
|
2007
|
-
k.value?.updateOptions({ yPaddingPx: e });
|
|
2008
|
-
}), M(() => d.semanticConfig, async (e, t) => {
|
|
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;
|
|
1931
|
+
}), j(() => d.yPaddingPx, (e) => {
|
|
1932
|
+
S.value?.updateOptionsFacade({ yPaddingPx: e });
|
|
1933
|
+
}), j(() => d.semanticConfig, async (e, t) => {
|
|
2009
1934
|
if (e && e !== t) {
|
|
2010
|
-
let t = await
|
|
1935
|
+
let t = await T.value?.applyConfig(e);
|
|
2011
1936
|
t && !t.success && console.error("Semantic config apply failed:", t.errors);
|
|
2012
1937
|
}
|
|
2013
|
-
}, { deep: !0 }), (r, c) => (
|
|
1938
|
+
}, { deep: !0 }), (r, c) => (x(), o("div", {
|
|
1939
|
+
ref_key: "chartWrapperRef",
|
|
1940
|
+
ref: m,
|
|
2014
1941
|
class: "chart-wrapper",
|
|
2015
|
-
"data-theme":
|
|
1942
|
+
"data-theme": B.value
|
|
2016
1943
|
}, [s("div", { class: g(["chart-stage", {
|
|
2017
1944
|
"is-dragging": xe.value,
|
|
2018
1945
|
"is-resizing-pane": Se.value,
|
|
2019
1946
|
"is-hovering-pane-separator": Ce.value,
|
|
2020
1947
|
"is-hovering-right-axis": Te.value,
|
|
2021
1948
|
"is-hovering-kline": Ee.value !== null
|
|
2022
|
-
}]) }, [l(
|
|
1949
|
+
}]) }, [l(xr, {
|
|
2023
1950
|
ref_key: "toolbarRef",
|
|
2024
|
-
ref:
|
|
1951
|
+
ref: y,
|
|
2025
1952
|
"is-fullscreen": n.isFullscreen,
|
|
2026
|
-
onSelectTool:
|
|
1953
|
+
onSelectTool: Re,
|
|
2027
1954
|
onToggleFullscreen: c[0] ||= (e) => r.$emit("toggleFullscreen"),
|
|
2028
|
-
onZoomIn: c[1] ||= (e) =>
|
|
2029
|
-
onZoomOut: c[2] ||= (e) =>
|
|
2030
|
-
onSettingsChange:
|
|
1955
|
+
onZoomIn: c[1] ||= (e) => mt(A.value + 1),
|
|
1956
|
+
onZoomOut: c[2] ||= (e) => mt(A.value - 1),
|
|
1957
|
+
onSettingsChange: V
|
|
2031
1958
|
}, null, 8, ["is-fullscreen"]), s("div", {
|
|
2032
1959
|
class: "chart-main",
|
|
2033
1960
|
ref_key: "chartMainRef",
|
|
2034
|
-
ref:
|
|
1961
|
+
ref: p
|
|
2035
1962
|
}, [
|
|
2036
|
-
s("div",
|
|
1963
|
+
s("div", Cr, [(x(!0), o(e, null, w(ge.value, (e) => (x(), o("div", {
|
|
2037
1964
|
key: e.id,
|
|
2038
1965
|
class: g(["pane-separator-line", { "is-active": we.value === e.id }]),
|
|
2039
1966
|
style: _({ top: `${e.top}px` })
|
|
2040
1967
|
}, null, 6))), 128))]),
|
|
2041
1968
|
s("div", {
|
|
2042
1969
|
ref_key: "tooltipLayerRef",
|
|
2043
|
-
ref:
|
|
1970
|
+
ref: v,
|
|
2044
1971
|
class: "tooltip-layer"
|
|
2045
1972
|
}, null, 512),
|
|
2046
1973
|
s("div", {
|
|
2047
1974
|
class: "chart-container",
|
|
2048
|
-
style: _({ cursor:
|
|
1975
|
+
style: _({ cursor: De.value }),
|
|
2049
1976
|
ref_key: "containerRef",
|
|
2050
|
-
ref:
|
|
2051
|
-
onScrollPassive:
|
|
2052
|
-
onPointerdown:
|
|
2053
|
-
onPointermove:
|
|
2054
|
-
onPointerup:
|
|
2055
|
-
onPointerleave:
|
|
1977
|
+
ref: f,
|
|
1978
|
+
onScrollPassive: Ye,
|
|
1979
|
+
onPointerdown: Ve,
|
|
1980
|
+
onPointermove: He,
|
|
1981
|
+
onPointerup: Ue,
|
|
1982
|
+
onPointerleave: We
|
|
2056
1983
|
}, [s("div", {
|
|
2057
1984
|
class: "scroll-content",
|
|
2058
|
-
style: _({ width:
|
|
2059
|
-
}, [s("div", {
|
|
2060
|
-
class: "canvas-layer",
|
|
2061
|
-
ref_key: "canvasLayerRef",
|
|
2062
|
-
ref: p
|
|
2063
|
-
}, [s("canvas", {
|
|
2064
|
-
class: "x-axis-canvas",
|
|
2065
|
-
ref_key: "xAxisCanvasRef",
|
|
2066
|
-
ref: f
|
|
2067
|
-
}, 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, {
|
|
2068
1987
|
key: 0,
|
|
2069
1988
|
drawing: he.value,
|
|
2070
|
-
onUpdateStyle:
|
|
2071
|
-
onDelete:
|
|
1989
|
+
onUpdateStyle: ze,
|
|
1990
|
+
onDelete: Be
|
|
2072
1991
|
}, null, 8, ["drawing"])) : a("", !0)], 512)], 4)], 36),
|
|
2073
|
-
|
|
1992
|
+
v.value ? (x(), i(t, {
|
|
2074
1993
|
key: 0,
|
|
2075
|
-
to:
|
|
1994
|
+
to: v.value
|
|
2076
1995
|
}, [
|
|
2077
|
-
|
|
1996
|
+
Oe.value ? (x(), o("div", {
|
|
2078
1997
|
key: 0,
|
|
2079
1998
|
class: g(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": G.value }]),
|
|
2080
|
-
style: _(
|
|
1999
|
+
style: _(Me.value)
|
|
2081
2000
|
}, null, 6)) : a("", !0),
|
|
2082
|
-
ye.value || be.value ? (
|
|
2001
|
+
ye.value || be.value ? (x(), o("div", {
|
|
2083
2002
|
key: 1,
|
|
2084
2003
|
class: g(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": G.value }]),
|
|
2085
|
-
style: _(
|
|
2004
|
+
style: _(Pe.value)
|
|
2086
2005
|
}, null, 6)) : a("", !0),
|
|
2087
|
-
|
|
2006
|
+
Oe.value ? (x(), i(Ht, {
|
|
2088
2007
|
key: 2,
|
|
2089
|
-
k:
|
|
2090
|
-
index:
|
|
2091
|
-
data:
|
|
2092
|
-
pos:
|
|
2093
|
-
"set-el":
|
|
2008
|
+
k: Oe.value,
|
|
2009
|
+
index: ke.value,
|
|
2010
|
+
data: Le.value,
|
|
2011
|
+
pos: je.value,
|
|
2012
|
+
"set-el": ue,
|
|
2094
2013
|
"use-anchor": G.value,
|
|
2095
|
-
"anchor-placement":
|
|
2014
|
+
"anchor-placement": Fe.value
|
|
2096
2015
|
}, null, 8, [
|
|
2097
2016
|
"k",
|
|
2098
2017
|
"index",
|
|
@@ -2101,13 +2020,13 @@ var tr = {
|
|
|
2101
2020
|
"use-anchor",
|
|
2102
2021
|
"anchor-placement"
|
|
2103
2022
|
])) : a("", !0),
|
|
2104
|
-
ye.value || be.value ? (
|
|
2023
|
+
ye.value || be.value ? (x(), i(Gt, {
|
|
2105
2024
|
key: 3,
|
|
2106
2025
|
marker: ye.value || be.value,
|
|
2107
|
-
pos:
|
|
2026
|
+
pos: Ne.value,
|
|
2108
2027
|
"use-anchor": G.value,
|
|
2109
|
-
"anchor-placement":
|
|
2110
|
-
"set-el":
|
|
2028
|
+
"anchor-placement": Ie.value,
|
|
2029
|
+
"set-el": de
|
|
2111
2030
|
}, null, 8, [
|
|
2112
2031
|
"marker",
|
|
2113
2032
|
"pos",
|
|
@@ -2117,25 +2036,24 @@ var tr = {
|
|
|
2117
2036
|
], 8, ["to"])) : a("", !0),
|
|
2118
2037
|
s("div", {
|
|
2119
2038
|
class: "right-axis-host",
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
onPointerleave: Ye
|
|
2039
|
+
ref: "rightAxisLayerRef",
|
|
2040
|
+
style: _({ width: dt.value + "px" }),
|
|
2041
|
+
onPointerdown: Ge,
|
|
2042
|
+
onPointermove: Ke,
|
|
2043
|
+
onPointerup: qe,
|
|
2044
|
+
onPointerleave: Je
|
|
2127
2045
|
}, null, 36)
|
|
2128
|
-
], 512)], 2), l(
|
|
2046
|
+
], 512)], 2), l(Tt, {
|
|
2129
2047
|
"active-indicators": Qe.value,
|
|
2130
|
-
"indicator-params":
|
|
2131
|
-
onToggle:
|
|
2132
|
-
onUpdateParams:
|
|
2133
|
-
onReorderSubIndicators:
|
|
2134
|
-
}, null, 8, ["active-indicators", "indicator-params"])], 8,
|
|
2048
|
+
"indicator-params": X.value,
|
|
2049
|
+
onToggle: ct,
|
|
2050
|
+
onUpdateParams: lt,
|
|
2051
|
+
onReorderSubIndicators: ut
|
|
2052
|
+
}, null, 8, ["active-indicators", "indicator-params"])], 8, Sr));
|
|
2135
2053
|
}
|
|
2136
|
-
}), [["__scopeId", "data-v-
|
|
2054
|
+
}), [["__scopeId", "data-v-4ea7c1af"]]), Or = {
|
|
2137
2055
|
name: "@363045841yyt/klinechart",
|
|
2138
|
-
version: "0.7.
|
|
2056
|
+
version: "0.7.6",
|
|
2139
2057
|
description: "Vue 3 bindings for @363045841yyt/klinechart-core. Idiomatic composables, SFC components.",
|
|
2140
2058
|
license: "MIT",
|
|
2141
2059
|
repository: {
|
|
@@ -2161,13 +2079,15 @@ var tr = {
|
|
|
2161
2079
|
default: "./dist/index.cjs"
|
|
2162
2080
|
}
|
|
2163
2081
|
},
|
|
2082
|
+
"./web-component": { import: { default: "./dist/kline-chart.js" } },
|
|
2164
2083
|
"./style.css": "./dist/klinechart.css"
|
|
2165
2084
|
},
|
|
2166
2085
|
files: ["dist", "src"],
|
|
2167
2086
|
publishConfig: { access: "public" },
|
|
2168
2087
|
scripts: {
|
|
2169
2088
|
dev: "vite --config preview/vite.config.ts",
|
|
2170
|
-
build: "vite build
|
|
2089
|
+
build: "vite build",
|
|
2090
|
+
"build:wc": "cross-env BUILD_TARGET=web-component vite build",
|
|
2171
2091
|
postbuild: "node -e \"require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')\"",
|
|
2172
2092
|
test: "vitest run",
|
|
2173
2093
|
"test:watch": "vitest",
|
|
@@ -2192,6 +2112,7 @@ var tr = {
|
|
|
2192
2112
|
"@size-limit/preset-small-lib": "^12.1.0",
|
|
2193
2113
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
2194
2114
|
"@vue/test-utils": "^2.4.10",
|
|
2115
|
+
"cross-env": "^7.0.3",
|
|
2195
2116
|
jsdom: "^29.1.1",
|
|
2196
2117
|
publint: "^0.3.0",
|
|
2197
2118
|
"size-limit": "^12.1.0",
|
|
@@ -2199,34 +2120,35 @@ var tr = {
|
|
|
2199
2120
|
"unplugin-icons": "^23.0.1",
|
|
2200
2121
|
vite: "^8.0.14",
|
|
2201
2122
|
"vite-plugin-babel": "^1.3.2",
|
|
2123
|
+
"vite-plugin-css-injected-by-js": "^5.0.1",
|
|
2202
2124
|
"vite-plugin-dts": "^5.0.1",
|
|
2203
2125
|
vitest: "^4.1.5",
|
|
2204
2126
|
vue: "^3.5.0"
|
|
2205
2127
|
}
|
|
2206
|
-
}.version,
|
|
2207
|
-
function
|
|
2208
|
-
|
|
2128
|
+
}.version, kr = null;
|
|
2129
|
+
function Ar(e) {
|
|
2130
|
+
kr = e;
|
|
2209
2131
|
}
|
|
2210
|
-
function
|
|
2132
|
+
function jr(e) {
|
|
2211
2133
|
if (e.container == null) throw Error("[@363045841yyt/klinechart] createChart: `container` is required and must be a non-null HTMLElement");
|
|
2212
|
-
if (
|
|
2213
|
-
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);
|
|
2214
2136
|
}
|
|
2215
|
-
function
|
|
2137
|
+
function $(e) {
|
|
2216
2138
|
let t = E(e.peek());
|
|
2217
|
-
return
|
|
2139
|
+
return y(e.subscribe(() => {
|
|
2218
2140
|
t.value = e.peek();
|
|
2219
2141
|
})), t;
|
|
2220
2142
|
}
|
|
2221
|
-
function
|
|
2143
|
+
function Mr(e, t) {
|
|
2222
2144
|
let n = E(null), r = (e) => {
|
|
2223
|
-
e == null || n.value != null || (n.value =
|
|
2145
|
+
e == null || n.value != null || (n.value = jr({
|
|
2224
2146
|
...t,
|
|
2225
2147
|
container: e
|
|
2226
2148
|
}));
|
|
2227
2149
|
};
|
|
2228
2150
|
r(e.value);
|
|
2229
|
-
let i =
|
|
2151
|
+
let i = j(e, (e) => {
|
|
2230
2152
|
r(e);
|
|
2231
2153
|
}, {
|
|
2232
2154
|
immediate: !0,
|
|
@@ -2236,11 +2158,11 @@ function kr(e, t) {
|
|
|
2236
2158
|
let e = n.value;
|
|
2237
2159
|
e != null && (e.dispose(), n.value = null);
|
|
2238
2160
|
};
|
|
2239
|
-
return
|
|
2161
|
+
return y(a), v(a), { chart: n };
|
|
2240
2162
|
}
|
|
2241
|
-
function
|
|
2163
|
+
function Nr(e) {
|
|
2242
2164
|
let t = E(e.indicators.peek());
|
|
2243
|
-
return
|
|
2165
|
+
return y(e.indicators.subscribe(() => {
|
|
2244
2166
|
t.value = e.indicators.peek();
|
|
2245
2167
|
})), {
|
|
2246
2168
|
indicators: t,
|
|
@@ -2249,25 +2171,54 @@ function Ar(e) {
|
|
|
2249
2171
|
updateParams: e.updateIndicatorParams.bind(e)
|
|
2250
2172
|
};
|
|
2251
2173
|
}
|
|
2252
|
-
function
|
|
2174
|
+
function Pr(e) {
|
|
2253
2175
|
let t = E(e.interactionState.peek());
|
|
2254
|
-
return
|
|
2176
|
+
return y(e.interactionState.subscribe(() => {
|
|
2255
2177
|
t.value = e.interactionState.peek();
|
|
2256
2178
|
})), t;
|
|
2257
2179
|
}
|
|
2258
|
-
function
|
|
2180
|
+
function Fr(e) {
|
|
2259
2181
|
let t = E(e.paneRatios.peek());
|
|
2260
|
-
return
|
|
2182
|
+
return y(e.paneRatios.subscribe(() => {
|
|
2261
2183
|
t.value = e.paneRatios.peek();
|
|
2262
2184
|
})), t;
|
|
2263
2185
|
}
|
|
2264
|
-
function
|
|
2186
|
+
function Ir(e) {
|
|
2265
2187
|
let t = E(e.viewport.peek());
|
|
2266
|
-
return
|
|
2188
|
+
return y(e.viewport.subscribe(() => {
|
|
2267
2189
|
t.value = e.viewport.peek();
|
|
2268
2190
|
})), t;
|
|
2269
2191
|
}
|
|
2270
|
-
|
|
2192
|
+
function Lr(e) {
|
|
2193
|
+
let t = L({ catalog: e.catalog });
|
|
2194
|
+
y(() => t.dispose());
|
|
2195
|
+
let n = $(t.filteredMain), r = $(t.filteredSub), i = $(t.menuOpen), a = $(t.searchQuery);
|
|
2196
|
+
function o(t) {
|
|
2197
|
+
let n = e.catalog.find((e) => e.id === t);
|
|
2198
|
+
return n === void 0 ? null : e.addIndicator(t, n.role);
|
|
2199
|
+
}
|
|
2200
|
+
function s(t) {
|
|
2201
|
+
return e.removeIndicator(t);
|
|
2202
|
+
}
|
|
2203
|
+
function c(t) {
|
|
2204
|
+
return e.indicators.peek().some((e) => e.definitionId === t);
|
|
2205
|
+
}
|
|
2206
|
+
return {
|
|
2207
|
+
catalog: e.catalog,
|
|
2208
|
+
filteredMain: n,
|
|
2209
|
+
filteredSub: r,
|
|
2210
|
+
menuOpen: i,
|
|
2211
|
+
searchQuery: a,
|
|
2212
|
+
add: o,
|
|
2213
|
+
remove: s,
|
|
2214
|
+
openMenu: () => t.openMenu(),
|
|
2215
|
+
closeMenu: () => t.closeMenu(),
|
|
2216
|
+
toggleMenu: () => t.toggleMenu(),
|
|
2217
|
+
setSearchQuery: (e) => t.setSearchQuery(e),
|
|
2218
|
+
isActive: c
|
|
2219
|
+
};
|
|
2220
|
+
}
|
|
2221
|
+
var Rr = u({
|
|
2271
2222
|
name: "KLineChart",
|
|
2272
2223
|
props: {
|
|
2273
2224
|
data: {
|
|
@@ -2297,10 +2248,10 @@ var Pr = u({
|
|
|
2297
2248
|
},
|
|
2298
2249
|
setup(e, { emit: t, expose: n }) {
|
|
2299
2250
|
let r = E(null), i = d(), a = E(null);
|
|
2300
|
-
|
|
2251
|
+
ee(() => {
|
|
2301
2252
|
let n = r.value;
|
|
2302
2253
|
n != null && (i.run(() => {
|
|
2303
|
-
if (a.value =
|
|
2254
|
+
if (a.value = jr({
|
|
2304
2255
|
container: n,
|
|
2305
2256
|
data: e.data,
|
|
2306
2257
|
initialZoomLevel: e.initialZoomLevel,
|
|
@@ -2312,14 +2263,14 @@ var Pr = u({
|
|
|
2312
2263
|
let n = e.viewport.peek();
|
|
2313
2264
|
t("zoomLevelChange", n.zoomLevel, n.kWidth);
|
|
2314
2265
|
};
|
|
2315
|
-
n(),
|
|
2266
|
+
n(), y(e.viewport.subscribe(n));
|
|
2316
2267
|
}
|
|
2317
|
-
}),
|
|
2268
|
+
}), j(() => e.data, (e) => {
|
|
2318
2269
|
a.value?.setData(e);
|
|
2319
|
-
}),
|
|
2270
|
+
}), j(() => e.theme, (e) => {
|
|
2320
2271
|
a.value?.setTheme(e);
|
|
2321
2272
|
}));
|
|
2322
|
-
}),
|
|
2273
|
+
}), b(() => {
|
|
2323
2274
|
a.value?.dispose(), a.value = null, i.stop();
|
|
2324
2275
|
}), n({
|
|
2325
2276
|
getController: () => a.value,
|
|
@@ -2346,9 +2297,9 @@ var Pr = u({
|
|
|
2346
2297
|
}
|
|
2347
2298
|
});
|
|
2348
2299
|
}
|
|
2349
|
-
}),
|
|
2350
|
-
e.component("KLineChart",
|
|
2300
|
+
}), zr = { install(e) {
|
|
2301
|
+
e.component("KLineChart", Rr);
|
|
2351
2302
|
} };
|
|
2352
|
-
|
|
2303
|
+
Ar(I);
|
|
2353
2304
|
//#endregion
|
|
2354
|
-
export {
|
|
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 };
|