@363045841yyt/klinechart 0.7.3-alpha.2 → 0.7.3-alpha.4
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/KLineChart.vue.d.ts +8 -8
- package/dist/index.cjs +2 -2
- package/dist/index.js +45 -44
- package/dist/klinechart.css +1 -1
- package/package.json +76 -75
- package/src/components/IndicatorSelector.vue +1 -1
- package/src/components/LeftToolbar.vue +44 -44
- package/LICENSE +0 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<nav class="left-toolbar" aria-label="
|
|
2
|
+
<nav class="left-toolbar" aria-label="图表工具栏">
|
|
3
3
|
<div class="left-toolbar__group">
|
|
4
4
|
<div v-for="tool in primaryTools" :key="tool.id" class="tool-item">
|
|
5
5
|
<button
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
class="corner-indicator"
|
|
20
20
|
:class="{ open: openGroupId === tool.id }"
|
|
21
21
|
@click.stop="toggleExpand(tool.id)"
|
|
22
|
-
aria-label="
|
|
22
|
+
aria-label="展开子菜单"
|
|
23
23
|
></span>
|
|
24
24
|
</button>
|
|
25
25
|
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
<button
|
|
55
55
|
type="button"
|
|
56
56
|
class="left-toolbar__button"
|
|
57
|
-
title="
|
|
58
|
-
aria-label="
|
|
57
|
+
title="放大"
|
|
58
|
+
aria-label="放大"
|
|
59
59
|
@click="$emit('zoomIn')"
|
|
60
60
|
@pointerdown.stop
|
|
61
61
|
@pointermove.stop
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
<button
|
|
67
67
|
type="button"
|
|
68
68
|
class="left-toolbar__button"
|
|
69
|
-
title="
|
|
70
|
-
aria-label="
|
|
69
|
+
title="缩小"
|
|
70
|
+
aria-label="缩小"
|
|
71
71
|
@click="$emit('zoomOut')"
|
|
72
72
|
@pointerdown.stop
|
|
73
73
|
@pointermove.stop
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
<button
|
|
84
84
|
type="button"
|
|
85
85
|
class="left-toolbar__button"
|
|
86
|
-
:title="isFullscreen ? '
|
|
87
|
-
:aria-label="isFullscreen ? '
|
|
86
|
+
:title="isFullscreen ? '退出全屏' : '全屏显示'"
|
|
87
|
+
:aria-label="isFullscreen ? '退出全屏' : '全屏显示'"
|
|
88
88
|
@click="$emit('toggleFullscreen')"
|
|
89
89
|
@pointerdown.stop
|
|
90
90
|
@pointermove.stop
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
<button
|
|
102
102
|
type="button"
|
|
103
103
|
class="left-toolbar__button"
|
|
104
|
-
title="
|
|
105
|
-
aria-label="
|
|
104
|
+
title="设置"
|
|
105
|
+
aria-label="设置"
|
|
106
106
|
@click="openSettings"
|
|
107
107
|
@pointerdown.stop
|
|
108
108
|
@pointermove.stop
|
|
@@ -113,17 +113,17 @@
|
|
|
113
113
|
</div>
|
|
114
114
|
</nav>
|
|
115
115
|
|
|
116
|
-
<!--
|
|
116
|
+
<!-- 设置弹窗 -->
|
|
117
117
|
<Teleport :to="teleportTarget">
|
|
118
118
|
<Transition name="overlay">
|
|
119
119
|
<div v-if="showSettings" class="settings-overlay" @click="closeSettings">
|
|
120
120
|
<Transition name="modal">
|
|
121
121
|
<div class="settings-modal" @click.stop>
|
|
122
|
-
<!--
|
|
122
|
+
<!-- 头部 -->
|
|
123
123
|
<div class="settings-header">
|
|
124
124
|
<div class="header-left">
|
|
125
|
-
<span class="settings-title"
|
|
126
|
-
<span class="settings-subtitle"
|
|
125
|
+
<span class="settings-title">图表设置</span>
|
|
126
|
+
<span class="settings-subtitle">个性化配置</span>
|
|
127
127
|
</div>
|
|
128
128
|
<div class="header-right">
|
|
129
129
|
<button class="settings-close" @click="closeSettings">
|
|
@@ -134,12 +134,12 @@
|
|
|
134
134
|
</div>
|
|
135
135
|
</div>
|
|
136
136
|
|
|
137
|
-
<!--
|
|
137
|
+
<!-- 体部 -->
|
|
138
138
|
<div class="settings-body">
|
|
139
|
-
<!--
|
|
139
|
+
<!-- 主图设置 -->
|
|
140
140
|
<template v-if="mainSettings.length > 0">
|
|
141
141
|
<div class="settings-section-divider">
|
|
142
|
-
<span class="settings-section-label"
|
|
142
|
+
<span class="settings-section-label">主图设置</span>
|
|
143
143
|
</div>
|
|
144
144
|
<template v-for="item in mainSettings" :key="item.key">
|
|
145
145
|
<div class="settings-item">
|
|
@@ -164,10 +164,10 @@
|
|
|
164
164
|
</template>
|
|
165
165
|
</template>
|
|
166
166
|
|
|
167
|
-
<!--
|
|
167
|
+
<!-- 实验性设置 -->
|
|
168
168
|
<template v-if="experimentalSettings.length > 0">
|
|
169
169
|
<div class="settings-section-divider">
|
|
170
|
-
<span class="settings-section-label"
|
|
170
|
+
<span class="settings-section-label">实验性 / 调试设置</span>
|
|
171
171
|
</div>
|
|
172
172
|
<template v-for="item in experimentalSettings" :key="item.key">
|
|
173
173
|
<div class="settings-item experimental">
|
|
@@ -193,22 +193,22 @@
|
|
|
193
193
|
</template>
|
|
194
194
|
</div>
|
|
195
195
|
|
|
196
|
-
<!--
|
|
196
|
+
<!-- 底部 -->
|
|
197
197
|
<div class="settings-footer">
|
|
198
198
|
<button class="settings-btn reset" @click="resetSettings">
|
|
199
199
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
200
200
|
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
|
|
201
201
|
<path d="M3 3v5h5" />
|
|
202
202
|
</svg>
|
|
203
|
-
|
|
203
|
+
重置
|
|
204
204
|
</button>
|
|
205
205
|
<div class="footer-right">
|
|
206
|
-
<button class="settings-btn cancel" @click="closeSettings"
|
|
206
|
+
<button class="settings-btn cancel" @click="closeSettings">取消</button>
|
|
207
207
|
<button class="settings-btn confirm" @click="confirmSettings">
|
|
208
208
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
209
209
|
<path d="M20 6L9 17l-5-5" />
|
|
210
210
|
</svg>
|
|
211
|
-
|
|
211
|
+
确定
|
|
212
212
|
</button>
|
|
213
213
|
</div>
|
|
214
214
|
</div>
|
|
@@ -254,30 +254,30 @@ export interface ToolDef {
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
const primaryTools: ToolDef[] = [
|
|
257
|
-
{ id: 'cursor', title: '
|
|
257
|
+
{ id: 'cursor', title: '光标', icon: IconTablerPointer },
|
|
258
258
|
{
|
|
259
259
|
id: 'lines',
|
|
260
|
-
title: '
|
|
260
|
+
title: '线条',
|
|
261
261
|
icon: IconTablerChartLine,
|
|
262
262
|
children: [
|
|
263
|
-
{ id: 'trend-line', title: '
|
|
264
|
-
{ id: 'ray', title: '
|
|
265
|
-
{ id: 'h-line', title: '
|
|
266
|
-
{ id: 'h-ray', title: '
|
|
267
|
-
{ id: 'v-line', title: '
|
|
268
|
-
{ id: 'crosshair-line', title: '
|
|
269
|
-
{ id: 'info-line', title: '
|
|
263
|
+
{ id: 'trend-line', title: '线段', icon: IconTablerChartLine },
|
|
264
|
+
{ id: 'ray', title: '射线', icon: IconTablerArrowUpRight },
|
|
265
|
+
{ id: 'h-line', title: '水平线', icon: IconTablerMinus },
|
|
266
|
+
{ id: 'h-ray', title: '水平射线', icon: IconTablerArrowRight },
|
|
267
|
+
{ id: 'v-line', title: '垂直线', icon: IconTablerSeparator },
|
|
268
|
+
{ id: 'crosshair-line', title: '十字线', icon: IconTablerCrosshair },
|
|
269
|
+
{ id: 'info-line', title: '信息线', icon: IconTablerInfoCircle },
|
|
270
270
|
],
|
|
271
271
|
},
|
|
272
272
|
{
|
|
273
273
|
id: 'channels',
|
|
274
|
-
title: '
|
|
274
|
+
title: '通道',
|
|
275
275
|
icon: IconTablerShape,
|
|
276
276
|
children: [
|
|
277
|
-
{ id: 'parallel-channel', title: '
|
|
278
|
-
{ id: 'regression-channel', title: '
|
|
279
|
-
{ id: 'flat-line', title: '
|
|
280
|
-
{ id: 'disjoint-channel', title: '
|
|
277
|
+
{ id: 'parallel-channel', title: '平行通道', icon: IconTablerShape },
|
|
278
|
+
{ id: 'regression-channel', title: '回归趋势', icon: IconTablerChartDots3 },
|
|
279
|
+
{ id: 'flat-line', title: '平滑顶底', icon: IconTablerCaretUpDown },
|
|
280
|
+
{ id: 'disjoint-channel', title: '不相交通道', icon: IconTablerBrackets },
|
|
281
281
|
],
|
|
282
282
|
},
|
|
283
283
|
]
|
|
@@ -448,7 +448,7 @@ onUnmounted(() => {
|
|
|
448
448
|
background: #e5e7eb;
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
-
/* ---
|
|
451
|
+
/* --- 工具按钮 --- */
|
|
452
452
|
.left-toolbar__button {
|
|
453
453
|
position: relative;
|
|
454
454
|
width: 28px;
|
|
@@ -490,7 +490,7 @@ onUnmounted(() => {
|
|
|
490
490
|
height: 16px;
|
|
491
491
|
}
|
|
492
492
|
|
|
493
|
-
/* ---
|
|
493
|
+
/* --- 角标三角(TradingView 风格) --- */
|
|
494
494
|
.corner-indicator {
|
|
495
495
|
position: absolute;
|
|
496
496
|
right: 0;
|
|
@@ -526,7 +526,7 @@ onUnmounted(() => {
|
|
|
526
526
|
opacity: 0.8;
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
/* ---
|
|
529
|
+
/* --- 下拉菜单(与工具栏同配色、同按钮样式,高度对齐工具栏宽度) --- */
|
|
530
530
|
.tool-dropdown {
|
|
531
531
|
position: absolute;
|
|
532
532
|
left: calc(100% + 13px);
|
|
@@ -548,12 +548,12 @@ onUnmounted(() => {
|
|
|
548
548
|
z-index: 100;
|
|
549
549
|
}
|
|
550
550
|
|
|
551
|
-
/* ---
|
|
551
|
+
/* --- 工具项容器 --- */
|
|
552
552
|
.tool-item {
|
|
553
553
|
position: relative;
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
/* ---
|
|
556
|
+
/* --- 下拉动画 --- */
|
|
557
557
|
.dropdown-enter-active,
|
|
558
558
|
.dropdown-leave-active {
|
|
559
559
|
transition:
|
|
@@ -567,7 +567,7 @@ onUnmounted(() => {
|
|
|
567
567
|
transform: translateY(-50%) translateX(-6px);
|
|
568
568
|
}
|
|
569
569
|
|
|
570
|
-
/* ---
|
|
570
|
+
/* --- 响应式 --- */
|
|
571
571
|
@media (max-width: 768px), (max-height: 640px) {
|
|
572
572
|
.left-toolbar {
|
|
573
573
|
flex-basis: 36px;
|
|
@@ -605,7 +605,7 @@ onUnmounted(() => {
|
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
607
|
|
|
608
|
-
/*
|
|
608
|
+
/* ═══ 设置弹窗样式(参考 IndicatorParams.vue)═══ */
|
|
609
609
|
.settings-overlay {
|
|
610
610
|
position: fixed;
|
|
611
611
|
inset: 0;
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 363045841
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|