@363045841yyt/klinechart 0.7.12 → 0.8.0
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/ChartSettingsDialog.vue.d.ts.map +1 -1
- package/dist/components/DrawingStyleToolbar.vue.d.ts.map +1 -1
- package/dist/components/Dropdown.vue.d.ts +29 -0
- package/dist/components/Dropdown.vue.d.ts.map +1 -0
- package/dist/components/IndicatorSelector.vue.d.ts +5 -1
- package/dist/components/IndicatorSelector.vue.d.ts.map +1 -1
- package/dist/components/KLineChart.vue.d.ts +4 -0
- package/dist/components/KLineChart.vue.d.ts.map +1 -1
- package/dist/components/KLineLevelDropdown.vue.d.ts +12 -0
- package/dist/components/KLineLevelDropdown.vue.d.ts.map +1 -0
- package/dist/components/TopToolbar.vue.d.ts +17 -0
- package/dist/components/TopToolbar.vue.d.ts.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +1017 -888
- package/package.json +9 -9
- package/src/components/ChartSettingsDialog.vue +15 -39
- package/src/components/DrawingStyleToolbar.vue +27 -36
- package/src/components/Dropdown.vue +291 -0
- package/src/components/IndicatorSelector.vue +21 -357
- package/src/components/KLineChart.vue +59 -14
- package/src/components/KLineLevelDropdown.vue +45 -0
- package/src/components/LeftToolbar.vue +4 -4
- package/src/components/TopToolbar.vue +232 -0
|
@@ -307,7 +307,7 @@ onUnmounted(() => {
|
|
|
307
307
|
gap: 6px;
|
|
308
308
|
padding: 8px 5px;
|
|
309
309
|
border: 1px solid var(--klc-color-border-chart);
|
|
310
|
-
border-radius:
|
|
310
|
+
border-radius: 3px;
|
|
311
311
|
background: var(--klc-color-background);
|
|
312
312
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
|
313
313
|
box-sizing: border-box;
|
|
@@ -333,7 +333,7 @@ onUnmounted(() => {
|
|
|
333
333
|
height: 28px;
|
|
334
334
|
padding: 0;
|
|
335
335
|
border: 1px solid transparent;
|
|
336
|
-
border-radius:
|
|
336
|
+
border-radius: 3px;
|
|
337
337
|
background: transparent;
|
|
338
338
|
color: var(--klc-color-axis-text);
|
|
339
339
|
cursor: pointer;
|
|
@@ -420,7 +420,7 @@ onUnmounted(() => {
|
|
|
420
420
|
backdrop-filter: blur(8px);
|
|
421
421
|
-webkit-backdrop-filter: blur(8px);
|
|
422
422
|
border: 1px solid var(--klc-color-border-chart);
|
|
423
|
-
border-radius:
|
|
423
|
+
border-radius: 3px;
|
|
424
424
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
|
425
425
|
box-sizing: border-box;
|
|
426
426
|
z-index: 100;
|
|
@@ -451,7 +451,7 @@ onUnmounted(() => {
|
|
|
451
451
|
flex-basis: 36px;
|
|
452
452
|
padding: 6px 4px;
|
|
453
453
|
gap: 5px;
|
|
454
|
-
border-radius:
|
|
454
|
+
border-radius: 3px;
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
.left-toolbar__group {
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="top-toolbar">
|
|
3
|
+
<button v-if="displaySymbol" type="button" class="symbol-chip" :title="displaySymbol">
|
|
4
|
+
<span class="symbol-chip__code">{{ displaySymbol }}</span>
|
|
5
|
+
</button>
|
|
6
|
+
<button
|
|
7
|
+
type="button"
|
|
8
|
+
class="overlay-symbol-button"
|
|
9
|
+
title="添加叠加商品"
|
|
10
|
+
aria-label="添加叠加商品"
|
|
11
|
+
@click="emit('addOverlaySymbol')"
|
|
12
|
+
>
|
|
13
|
+
<span class="overlay-symbol-button__icon" aria-hidden="true">+</span>
|
|
14
|
+
<span class="overlay-symbol-button__text">添加叠加商品</span>
|
|
15
|
+
</button>
|
|
16
|
+
<KLineLevelDropdown :model-value="kLineLevel" @update:model-value="emit('kLineLevelChange', $event)" />
|
|
17
|
+
<button
|
|
18
|
+
type="button"
|
|
19
|
+
class="indicator-button"
|
|
20
|
+
title="指标"
|
|
21
|
+
aria-label="指标"
|
|
22
|
+
@click="emit('toggleIndicator')"
|
|
23
|
+
>
|
|
24
|
+
<span class="indicator-button__icon" aria-hidden="true">fx</span>
|
|
25
|
+
<span class="indicator-button__text">指标</span>
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
import { computed } from 'vue'
|
|
32
|
+
import KLineLevelDropdown, { type KLineLevel } from './KLineLevelDropdown.vue'
|
|
33
|
+
|
|
34
|
+
const props = defineProps<{
|
|
35
|
+
symbol?: string
|
|
36
|
+
kLineLevel?: string
|
|
37
|
+
}>()
|
|
38
|
+
|
|
39
|
+
const emit = defineEmits<{
|
|
40
|
+
(e: 'addOverlaySymbol'): void
|
|
41
|
+
(e: 'kLineLevelChange', level: KLineLevel): void
|
|
42
|
+
(e: 'toggleIndicator'): void
|
|
43
|
+
}>()
|
|
44
|
+
|
|
45
|
+
const displaySymbol = computed(() => props.symbol?.trim() ?? '')
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<style scoped>
|
|
49
|
+
.top-toolbar {
|
|
50
|
+
width: 95%;
|
|
51
|
+
height: 40px;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 6px;
|
|
56
|
+
padding: 0 8px;
|
|
57
|
+
border: 1px solid var(--klc-color-border-chart);
|
|
58
|
+
border-radius: 3px;
|
|
59
|
+
background: var(--klc-color-background);
|
|
60
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
user-select: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.symbol-chip {
|
|
66
|
+
height: 28px;
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
max-width: 160px;
|
|
71
|
+
padding: 0 10px;
|
|
72
|
+
border: 1px solid transparent;
|
|
73
|
+
border-radius: 4px;
|
|
74
|
+
background: transparent;
|
|
75
|
+
color: var(--klc-color-foreground);
|
|
76
|
+
font: inherit;
|
|
77
|
+
cursor: default;
|
|
78
|
+
transition: background 0.15s ease, border-color 0.15s ease;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.symbol-chip:hover {
|
|
82
|
+
border-color: var(--klc-color-border-button);
|
|
83
|
+
background: var(--klc-color-grid-minor);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.symbol-chip__code {
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
text-overflow: ellipsis;
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
font-size: 14px;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
line-height: 1;
|
|
93
|
+
letter-spacing: 0.01em;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.overlay-symbol-button {
|
|
97
|
+
height: 28px;
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
flex: 0 0 auto;
|
|
102
|
+
gap: 6px;
|
|
103
|
+
padding: 0 10px;
|
|
104
|
+
border: 1px solid var(--klc-color-border-button);
|
|
105
|
+
border-radius: 4px;
|
|
106
|
+
background: var(--klc-color-background);
|
|
107
|
+
color: var(--klc-color-foreground);
|
|
108
|
+
font: inherit;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.overlay-symbol-button:hover {
|
|
114
|
+
border-color: var(--klc-color-axis-text);
|
|
115
|
+
background: var(--klc-color-grid-minor);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.overlay-symbol-button__icon {
|
|
119
|
+
display: inline-flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
width: 16px;
|
|
123
|
+
height: 16px;
|
|
124
|
+
border-radius: 50%;
|
|
125
|
+
background: var(--klc-color-foreground);
|
|
126
|
+
color: var(--klc-color-background);
|
|
127
|
+
font-size: 13px;
|
|
128
|
+
font-weight: 700;
|
|
129
|
+
line-height: 1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.overlay-symbol-button__text {
|
|
133
|
+
font-size: 13px;
|
|
134
|
+
font-weight: 500;
|
|
135
|
+
line-height: 1;
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.indicator-button {
|
|
140
|
+
height: 28px;
|
|
141
|
+
display: inline-flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
flex: 0 0 auto;
|
|
145
|
+
gap: 6px;
|
|
146
|
+
padding: 0 10px;
|
|
147
|
+
border: 1px solid var(--klc-color-border-button);
|
|
148
|
+
border-radius: 4px;
|
|
149
|
+
background: var(--klc-color-background);
|
|
150
|
+
color: var(--klc-color-foreground);
|
|
151
|
+
font: inherit;
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.indicator-button:hover {
|
|
157
|
+
border-color: var(--klc-color-axis-text);
|
|
158
|
+
background: var(--klc-color-grid-minor);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.indicator-button__icon {
|
|
162
|
+
display: inline-flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
width: 16px;
|
|
166
|
+
height: 16px;
|
|
167
|
+
border-radius: 3px;
|
|
168
|
+
background: var(--klc-color-foreground);
|
|
169
|
+
color: var(--klc-color-background);
|
|
170
|
+
font-size: 10px;
|
|
171
|
+
font-weight: 800;
|
|
172
|
+
line-height: 1;
|
|
173
|
+
letter-spacing: -0.5px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.indicator-button__text {
|
|
177
|
+
font-size: 13px;
|
|
178
|
+
font-weight: 500;
|
|
179
|
+
line-height: 1;
|
|
180
|
+
white-space: nowrap;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@media (max-width: 768px), (max-height: 640px) {
|
|
184
|
+
.top-toolbar {
|
|
185
|
+
height: 36px;
|
|
186
|
+
padding: 0 6px;
|
|
187
|
+
border-radius: 3px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.symbol-chip {
|
|
191
|
+
height: 26px;
|
|
192
|
+
max-width: 120px;
|
|
193
|
+
padding: 0 8px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.symbol-chip__code {
|
|
197
|
+
font-size: 13px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.overlay-symbol-button {
|
|
201
|
+
height: 26px;
|
|
202
|
+
gap: 4px;
|
|
203
|
+
padding: 0 8px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.overlay-symbol-button__icon {
|
|
207
|
+
width: 15px;
|
|
208
|
+
height: 15px;
|
|
209
|
+
font-size: 12px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.overlay-symbol-button__text {
|
|
213
|
+
display: none;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.indicator-button {
|
|
217
|
+
height: 26px;
|
|
218
|
+
gap: 4px;
|
|
219
|
+
padding: 0 8px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.indicator-button__icon {
|
|
223
|
+
width: 15px;
|
|
224
|
+
height: 15px;
|
|
225
|
+
font-size: 9px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.indicator-button__text {
|
|
229
|
+
display: none;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
</style>
|