evui 3.3.36 → 3.3.39
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/LICENSE +21 -21
- package/README.md +40 -40
- package/dist/evui.common.js +1907 -1832
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +1907 -1832
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/dist/img/{EVUI.7f3588fb.svg → EVUI.b82ee81a.svg} +292 -292
- package/dist/img/{icon_mysql.7ea26d5d.svg → icon_mysql.1085fdc9.svg} +78 -78
- package/dist/img/{icon_oracle.9009b108.svg → icon_oracle.0572d3ee.svg} +13 -13
- package/dist/img/{icon_postgresql.f8fffba9.svg → icon_postgresql.ee12bde8.svg} +58 -58
- package/package.json +61 -61
- package/src/common/emitter.js +20 -20
- package/src/common/utils.debounce.js +223 -223
- package/src/common/utils.js +134 -134
- package/src/common/utils.table.js +78 -78
- package/src/common/utils.throttle.js +83 -83
- package/src/common/utils.tree.js +18 -18
- package/src/components/button/Button.vue +198 -198
- package/src/components/button/index.js +7 -7
- package/src/components/buttonGroup/ButtonGroup.vue +11 -11
- package/src/components/buttonGroup/index.js +7 -7
- package/src/components/calendar/Calendar.vue +661 -661
- package/src/components/calendar/index.js +7 -7
- package/src/components/calendar/uses.js +1272 -1272
- package/src/components/chart/Chart.vue +189 -192
- package/src/components/chart/chart.core.js +870 -870
- package/src/components/chart/element/element.bar.js +524 -524
- package/src/components/chart/element/element.bar.time.js +156 -156
- package/src/components/chart/element/element.heatmap.js +533 -533
- package/src/components/chart/element/element.line.js +339 -339
- package/src/components/chart/element/element.pie.js +197 -197
- package/src/components/chart/element/element.scatter.js +184 -184
- package/src/components/chart/element/element.tip.js +550 -542
- package/src/components/chart/helpers/helpers.canvas.js +265 -265
- package/src/components/chart/helpers/helpers.constant.js +206 -206
- package/src/components/chart/helpers/helpers.util.js +346 -338
- package/src/components/chart/index.js +9 -9
- package/src/components/chart/model/index.js +4 -4
- package/src/components/chart/model/model.series.js +93 -93
- package/src/components/chart/model/model.store.js +977 -967
- package/src/components/chart/plugins/plugins.interaction.js +769 -769
- package/src/components/chart/plugins/plugins.legend.gradient.js +602 -602
- package/src/components/chart/plugins/plugins.legend.js +1155 -1151
- package/src/components/chart/plugins/plugins.pie.js +254 -254
- package/src/components/chart/plugins/plugins.title.js +56 -56
- package/src/components/chart/plugins/plugins.tooltip.js +692 -692
- package/src/components/chart/scale/scale.js +848 -848
- package/src/components/chart/scale/scale.linear.js +38 -38
- package/src/components/chart/scale/scale.logarithmic.js +128 -128
- package/src/components/chart/scale/scale.step.js +336 -336
- package/src/components/chart/scale/scale.time.category.js +277 -277
- package/src/components/chart/scale/scale.time.js +48 -48
- package/src/components/chart/style/chart.scss +312 -312
- package/src/components/chart/uses.js +264 -252
- package/src/components/checkbox/Checkbox.vue +200 -200
- package/src/components/checkbox/index.js +7 -7
- package/src/components/checkboxGroup/CheckboxGroup.vue +44 -44
- package/src/components/checkboxGroup/index.js +7 -7
- package/src/components/contextMenu/ContextMenu.vue +80 -80
- package/src/components/contextMenu/MenuList.vue +149 -149
- package/src/components/contextMenu/index.js +7 -7
- package/src/components/contextMenu/uses.js +203 -203
- package/src/components/datePicker/DatePicker.vue +437 -437
- package/src/components/datePicker/index.js +7 -7
- package/src/components/datePicker/uses.js +419 -419
- package/src/components/grid/Grid.vue +827 -827
- package/src/components/grid/grid.filter.window.vue +493 -493
- package/src/components/grid/grid.pagination.vue +75 -75
- package/src/components/grid/grid.summary.vue +265 -265
- package/src/components/grid/grid.toolbar.vue +26 -26
- package/src/components/grid/index.js +11 -11
- package/src/components/grid/style/grid.scss +263 -263
- package/src/components/grid/uses.js +1002 -1007
- package/src/components/icon/Icon.vue +49 -49
- package/src/components/icon/index.js +8 -8
- package/src/components/inputNumber/InputNumber.vue +212 -212
- package/src/components/inputNumber/index.js +7 -7
- package/src/components/inputNumber/uses.js +217 -217
- package/src/components/loading/Loading.vue +125 -125
- package/src/components/loading/index.js +7 -7
- package/src/components/menu/Menu.vue +68 -68
- package/src/components/menu/MenuItem.vue +187 -187
- package/src/components/menu/index.js +7 -7
- package/src/components/message/Message.vue +223 -223
- package/src/components/message/index.js +31 -31
- package/src/components/messageBox/MessageBox.vue +358 -358
- package/src/components/messageBox/index.js +22 -22
- package/src/components/notification/Notification.vue +316 -316
- package/src/components/notification/index.js +49 -49
- package/src/components/pagination/Pagination.vue +271 -271
- package/src/components/pagination/index.js +7 -7
- package/src/components/pagination/pageButton.vue +30 -30
- package/src/components/progress/Progress.vue +139 -139
- package/src/components/progress/index.js +7 -7
- package/src/components/radio/Radio.vue +159 -159
- package/src/components/radio/index.js +7 -7
- package/src/components/radioGroup/RadioGroup.vue +41 -41
- package/src/components/radioGroup/index.js +7 -7
- package/src/components/scheduler/Scheduler.vue +149 -149
- package/src/components/scheduler/index.js +7 -7
- package/src/components/scheduler/uses.js +183 -183
- package/src/components/select/Select.vue +440 -440
- package/src/components/select/index.js +7 -7
- package/src/components/select/uses.js +270 -270
- package/src/components/slider/Slider.vue +505 -505
- package/src/components/slider/index.js +7 -7
- package/src/components/slider/uses.js +390 -390
- package/src/components/tabPanel/TabPanel.vue +74 -74
- package/src/components/tabPanel/index.js +7 -7
- package/src/components/tabs/Tabs.vue +517 -517
- package/src/components/tabs/index.js +7 -7
- package/src/components/textField/TextField.vue +375 -375
- package/src/components/textField/index.js +7 -7
- package/src/components/timePicker/TimePicker.vue +352 -352
- package/src/components/timePicker/index.js +7 -7
- package/src/components/toggle/Toggle.vue +115 -115
- package/src/components/toggle/index.js +7 -7
- package/src/components/tree/Tree.vue +313 -313
- package/src/components/tree/TreeNode.vue +293 -293
- package/src/components/tree/index.js +7 -7
- package/src/components/treeGrid/TreeGrid.vue +758 -758
- package/src/components/treeGrid/TreeGridNode.vue +275 -275
- package/src/components/treeGrid/index.js +9 -9
- package/src/components/treeGrid/style/treeGrid.scss +261 -261
- package/src/components/treeGrid/treeGrid.toolbar.vue +26 -26
- package/src/components/treeGrid/uses.js +867 -867
- package/src/components/window/Window.vue +329 -329
- package/src/components/window/index.js +7 -7
- package/src/components/window/uses.js +899 -899
- package/src/directives/clickoutside.js +90 -90
- package/src/main.js +116 -116
- package/src/style/components/input.scss +108 -108
- package/src/style/functions.scss +3 -3
- package/src/style/index.scss +6 -6
- package/src/style/lib/fonts/EVUI.svg +292 -292
- package/src/style/lib/icon.css +888 -888
- package/src/style/mixins.scss +94 -94
- package/src/style/themes.scss +67 -67
- package/src/style/variables.scss +22 -22
|
@@ -1,252 +1,264 @@
|
|
|
1
|
-
import { ref, computed, getCurrentInstance, nextTick } from 'vue';
|
|
2
|
-
import { cloneDeep, defaultsDeep } from 'lodash-es';
|
|
3
|
-
import { getQuantity } from '@/common/utils';
|
|
4
|
-
|
|
5
|
-
const DEFAULT_OPTIONS = {
|
|
6
|
-
padding: {
|
|
7
|
-
top: 20,
|
|
8
|
-
right: 2,
|
|
9
|
-
left: 2,
|
|
10
|
-
bottom: 4,
|
|
11
|
-
},
|
|
12
|
-
border: 2,
|
|
13
|
-
title: {
|
|
14
|
-
show: false,
|
|
15
|
-
height: 40,
|
|
16
|
-
text: '',
|
|
17
|
-
style: {
|
|
18
|
-
fontSize: 15,
|
|
19
|
-
color: '#000',
|
|
20
|
-
fontFamily: 'Roboto',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
legend: {
|
|
24
|
-
show: true,
|
|
25
|
-
type: 'icon',
|
|
26
|
-
position: 'right',
|
|
27
|
-
color: '#353740',
|
|
28
|
-
inactive: '#aaa',
|
|
29
|
-
width: 140,
|
|
30
|
-
height: 24,
|
|
31
|
-
allowResize: false,
|
|
32
|
-
table: {
|
|
33
|
-
use: false,
|
|
34
|
-
columns: {
|
|
35
|
-
name: {
|
|
36
|
-
title: 'Name',
|
|
37
|
-
},
|
|
38
|
-
min: {
|
|
39
|
-
title: 'MIN',
|
|
40
|
-
use: false,
|
|
41
|
-
},
|
|
42
|
-
max: {
|
|
43
|
-
title: 'MAX',
|
|
44
|
-
use: false,
|
|
45
|
-
},
|
|
46
|
-
avg: {
|
|
47
|
-
title: 'AVG',
|
|
48
|
-
use: false,
|
|
49
|
-
},
|
|
50
|
-
total: {
|
|
51
|
-
title: 'TOTAL',
|
|
52
|
-
use: false,
|
|
53
|
-
},
|
|
54
|
-
last: {
|
|
55
|
-
title: 'LAST',
|
|
56
|
-
use: false,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
itemHighlight: true,
|
|
62
|
-
seriesHighlight: true,
|
|
63
|
-
useSelect: false,
|
|
64
|
-
doughnutHoleSize: 0,
|
|
65
|
-
pieStroke: {
|
|
66
|
-
use: true,
|
|
67
|
-
lineWidth: 2,
|
|
68
|
-
color: '#FFFFFF',
|
|
69
|
-
},
|
|
70
|
-
reverse: false,
|
|
71
|
-
horizontal: false,
|
|
72
|
-
width: '100%',
|
|
73
|
-
height: '100%',
|
|
74
|
-
thickness: 1,
|
|
75
|
-
cPadRatio: 0,
|
|
76
|
-
borderRadius: 0,
|
|
77
|
-
combo: false,
|
|
78
|
-
tooltip: {
|
|
79
|
-
use: true,
|
|
80
|
-
sortByValue: true,
|
|
81
|
-
backgroundColor: '#4C4C4C',
|
|
82
|
-
fontColor: '#FFFFFF',
|
|
83
|
-
borderColor: '#666666',
|
|
84
|
-
shadowOpacity: 0.25,
|
|
85
|
-
useShadow: false,
|
|
86
|
-
throttledMove: false,
|
|
87
|
-
debouncedHide: false,
|
|
88
|
-
useScrollbar: false,
|
|
89
|
-
textOverflow: 'wrap',
|
|
90
|
-
fontFamily: 'Roboto',
|
|
91
|
-
},
|
|
92
|
-
indicator: {
|
|
93
|
-
use: true,
|
|
94
|
-
color: '#EE7F44',
|
|
95
|
-
},
|
|
96
|
-
maxTip: {
|
|
97
|
-
use: false,
|
|
98
|
-
fixedPosTop: false,
|
|
99
|
-
showIndicator: false,
|
|
100
|
-
indicatorColor: '#000000',
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
use: false,
|
|
132
|
-
useClick: true,
|
|
133
|
-
limit: 1,
|
|
134
|
-
useDeselectOverflow: false,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
};
|
|
1
|
+
import { ref, computed, getCurrentInstance, nextTick } from 'vue';
|
|
2
|
+
import { cloneDeep, defaultsDeep } from 'lodash-es';
|
|
3
|
+
import { getQuantity } from '@/common/utils';
|
|
4
|
+
|
|
5
|
+
const DEFAULT_OPTIONS = {
|
|
6
|
+
padding: {
|
|
7
|
+
top: 20,
|
|
8
|
+
right: 2,
|
|
9
|
+
left: 2,
|
|
10
|
+
bottom: 4,
|
|
11
|
+
},
|
|
12
|
+
border: 2,
|
|
13
|
+
title: {
|
|
14
|
+
show: false,
|
|
15
|
+
height: 40,
|
|
16
|
+
text: '',
|
|
17
|
+
style: {
|
|
18
|
+
fontSize: 15,
|
|
19
|
+
color: '#000',
|
|
20
|
+
fontFamily: 'Roboto',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
legend: {
|
|
24
|
+
show: true,
|
|
25
|
+
type: 'icon',
|
|
26
|
+
position: 'right',
|
|
27
|
+
color: '#353740',
|
|
28
|
+
inactive: '#aaa',
|
|
29
|
+
width: 140,
|
|
30
|
+
height: 24,
|
|
31
|
+
allowResize: false,
|
|
32
|
+
table: {
|
|
33
|
+
use: false,
|
|
34
|
+
columns: {
|
|
35
|
+
name: {
|
|
36
|
+
title: 'Name',
|
|
37
|
+
},
|
|
38
|
+
min: {
|
|
39
|
+
title: 'MIN',
|
|
40
|
+
use: false,
|
|
41
|
+
},
|
|
42
|
+
max: {
|
|
43
|
+
title: 'MAX',
|
|
44
|
+
use: false,
|
|
45
|
+
},
|
|
46
|
+
avg: {
|
|
47
|
+
title: 'AVG',
|
|
48
|
+
use: false,
|
|
49
|
+
},
|
|
50
|
+
total: {
|
|
51
|
+
title: 'TOTAL',
|
|
52
|
+
use: false,
|
|
53
|
+
},
|
|
54
|
+
last: {
|
|
55
|
+
title: 'LAST',
|
|
56
|
+
use: false,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
itemHighlight: true,
|
|
62
|
+
seriesHighlight: true,
|
|
63
|
+
useSelect: false,
|
|
64
|
+
doughnutHoleSize: 0,
|
|
65
|
+
pieStroke: {
|
|
66
|
+
use: true,
|
|
67
|
+
lineWidth: 2,
|
|
68
|
+
color: '#FFFFFF',
|
|
69
|
+
},
|
|
70
|
+
reverse: false,
|
|
71
|
+
horizontal: false,
|
|
72
|
+
width: '100%',
|
|
73
|
+
height: '100%',
|
|
74
|
+
thickness: 1,
|
|
75
|
+
cPadRatio: 0,
|
|
76
|
+
borderRadius: 0,
|
|
77
|
+
combo: false,
|
|
78
|
+
tooltip: {
|
|
79
|
+
use: true,
|
|
80
|
+
sortByValue: true,
|
|
81
|
+
backgroundColor: '#4C4C4C',
|
|
82
|
+
fontColor: '#FFFFFF',
|
|
83
|
+
borderColor: '#666666',
|
|
84
|
+
shadowOpacity: 0.25,
|
|
85
|
+
useShadow: false,
|
|
86
|
+
throttledMove: false,
|
|
87
|
+
debouncedHide: false,
|
|
88
|
+
useScrollbar: false,
|
|
89
|
+
textOverflow: 'wrap',
|
|
90
|
+
fontFamily: 'Roboto',
|
|
91
|
+
},
|
|
92
|
+
indicator: {
|
|
93
|
+
use: true,
|
|
94
|
+
color: '#EE7F44',
|
|
95
|
+
},
|
|
96
|
+
maxTip: {
|
|
97
|
+
use: false,
|
|
98
|
+
fixedPosTop: false,
|
|
99
|
+
showIndicator: false,
|
|
100
|
+
indicatorColor: '#000000',
|
|
101
|
+
tipStyle: {
|
|
102
|
+
height: 20,
|
|
103
|
+
background: '#000000',
|
|
104
|
+
textColor: '#FFFFFF',
|
|
105
|
+
fontSize: 14,
|
|
106
|
+
fontFamily: 'Roboto',
|
|
107
|
+
fontWeight: 400,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
selectItem: {
|
|
111
|
+
use: false,
|
|
112
|
+
useClick: true,
|
|
113
|
+
showTextTip: false,
|
|
114
|
+
tipText: 'value',
|
|
115
|
+
showTip: false,
|
|
116
|
+
showIndicator: false,
|
|
117
|
+
fixedPosTop: false,
|
|
118
|
+
useApproximateValue: false,
|
|
119
|
+
indicatorColor: '#000000',
|
|
120
|
+
tipStyle: {
|
|
121
|
+
height: 20,
|
|
122
|
+
background: '#000000',
|
|
123
|
+
textColor: '#FFFFFF',
|
|
124
|
+
fontSize: 14,
|
|
125
|
+
fontFamily: 'Roboto',
|
|
126
|
+
fontWeight: 400,
|
|
127
|
+
},
|
|
128
|
+
useSeriesOpacity: false,
|
|
129
|
+
},
|
|
130
|
+
selectLabel: {
|
|
131
|
+
use: false,
|
|
132
|
+
useClick: true,
|
|
133
|
+
limit: 1,
|
|
134
|
+
useDeselectOverflow: false,
|
|
135
|
+
showTip: false,
|
|
136
|
+
useSeriesOpacity: true,
|
|
137
|
+
useLabelOpacity: true,
|
|
138
|
+
fixedPosTop: false,
|
|
139
|
+
useApproximateValue: false,
|
|
140
|
+
tipBackground: '#000000',
|
|
141
|
+
},
|
|
142
|
+
selectSeries: {
|
|
143
|
+
use: false,
|
|
144
|
+
useClick: true,
|
|
145
|
+
limit: 1,
|
|
146
|
+
useDeselectOverflow: false,
|
|
147
|
+
},
|
|
148
|
+
dragSelection: {
|
|
149
|
+
use: false,
|
|
150
|
+
keepDisplay: true,
|
|
151
|
+
fillColor: '#38ACEC',
|
|
152
|
+
opacity: 0.65,
|
|
153
|
+
},
|
|
154
|
+
heatMapColor: {
|
|
155
|
+
min: '#FFFFFF',
|
|
156
|
+
max: '#0052FF',
|
|
157
|
+
categoryCnt: 1,
|
|
158
|
+
stroke: {
|
|
159
|
+
show: false,
|
|
160
|
+
color: '#FFFFFF',
|
|
161
|
+
lineWidth: 1,
|
|
162
|
+
opacity: 1,
|
|
163
|
+
radius: 0,
|
|
164
|
+
},
|
|
165
|
+
error: '#FF0000',
|
|
166
|
+
decimalPoint: 0,
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const DEFAULT_DATA = {
|
|
171
|
+
series: {},
|
|
172
|
+
groups: [],
|
|
173
|
+
labels: [],
|
|
174
|
+
data: {},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const useModel = () => {
|
|
178
|
+
const { props, emit } = getCurrentInstance();
|
|
179
|
+
|
|
180
|
+
const getNormalizedOptions = (options) => {
|
|
181
|
+
const normalizedOptions = defaultsDeep({}, options, DEFAULT_OPTIONS);
|
|
182
|
+
|
|
183
|
+
if ((options.type === 'scatter' || options.type === 'heatMap') && !options?.tooltip) {
|
|
184
|
+
normalizedOptions.tooltip.use = false;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (options.type === 'pie' && !options?.padding) {
|
|
188
|
+
normalizedOptions.padding = {
|
|
189
|
+
top: 2,
|
|
190
|
+
right: 2,
|
|
191
|
+
left: 2,
|
|
192
|
+
bottom: 4,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return normalizedOptions;
|
|
197
|
+
};
|
|
198
|
+
const getNormalizedData = data => defaultsDeep(data, DEFAULT_DATA);
|
|
199
|
+
|
|
200
|
+
const selectItemInfo = cloneDeep(props.selectedItem);
|
|
201
|
+
const selectLabelInfo = cloneDeep(props.selectedLabel);
|
|
202
|
+
const selectSeriesInfo = cloneDeep(props.selectedSeries);
|
|
203
|
+
|
|
204
|
+
const eventListeners = {
|
|
205
|
+
click: async (e) => {
|
|
206
|
+
await nextTick();
|
|
207
|
+
if (e.label) {
|
|
208
|
+
emit('update:selectedItem', { seriesID: e.seriesId, dataIndex: e.dataIndex });
|
|
209
|
+
}
|
|
210
|
+
if (e.selected?.dataIndex) {
|
|
211
|
+
emit('update:selectedLabel', { dataIndex: e.selected.dataIndex });
|
|
212
|
+
}
|
|
213
|
+
if (e.selected?.seriesId) {
|
|
214
|
+
emit('update:selectedSeries', { seriesId: e.selected.seriesId });
|
|
215
|
+
}
|
|
216
|
+
emit('click', e);
|
|
217
|
+
},
|
|
218
|
+
'dbl-click': async (e) => {
|
|
219
|
+
await nextTick();
|
|
220
|
+
emit('dbl-click', e);
|
|
221
|
+
},
|
|
222
|
+
'drag-select': async (e) => {
|
|
223
|
+
await nextTick();
|
|
224
|
+
emit('drag-select', e);
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
return {
|
|
229
|
+
eventListeners,
|
|
230
|
+
selectItemInfo,
|
|
231
|
+
selectLabelInfo,
|
|
232
|
+
selectSeriesInfo,
|
|
233
|
+
getNormalizedData,
|
|
234
|
+
getNormalizedOptions,
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export const useWrapper = (options) => {
|
|
239
|
+
const wrapper = ref();
|
|
240
|
+
|
|
241
|
+
const wrapperStyle = computed(() => {
|
|
242
|
+
const getChartSize = (size) => {
|
|
243
|
+
let sizeValue;
|
|
244
|
+
|
|
245
|
+
if (size) {
|
|
246
|
+
sizeValue = size.unit ? size.value + size.unit : `${size.value}px`;
|
|
247
|
+
} else {
|
|
248
|
+
sizeValue = undefined;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return sizeValue;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
return {
|
|
255
|
+
width: getChartSize(getQuantity(options.width)),
|
|
256
|
+
height: getChartSize(getQuantity(options.height)),
|
|
257
|
+
};
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
return {
|
|
261
|
+
wrapper,
|
|
262
|
+
wrapperStyle,
|
|
263
|
+
};
|
|
264
|
+
};
|