evui 3.5.0 → 3.5.2

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.
Files changed (134) hide show
  1. package/dist/index.js +23148 -0
  2. package/dist/index.umd.cjs +28 -0
  3. package/package.json +5 -11
  4. package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
  5. package/dist/common/utils.bignumber.js +0 -23
  6. package/dist/common/utils.debounce.js +0 -66
  7. package/dist/common/utils.js +0 -64
  8. package/dist/common/utils.throttle.js +0 -15
  9. package/dist/components/button/Button.vue.js +0 -65
  10. package/dist/components/button/index.js +0 -7
  11. package/dist/components/buttonGroup/ButtonGroup.vue.js +0 -14
  12. package/dist/components/buttonGroup/index.js +0 -7
  13. package/dist/components/calendar/Calendar.vue.js +0 -299
  14. package/dist/components/calendar/index.js +0 -7
  15. package/dist/components/calendar/uses.js +0 -579
  16. package/dist/components/chart/Chart.vue.js +0 -261
  17. package/dist/components/chart/ChartToolbar.vue.js +0 -32
  18. package/dist/components/chart/chart.core.js +0 -738
  19. package/dist/components/chart/chartZoom.core.js +0 -221
  20. package/dist/components/chart/element/element.bar.js +0 -358
  21. package/dist/components/chart/element/element.bar.time.js +0 -55
  22. package/dist/components/chart/element/element.heatmap.js +0 -403
  23. package/dist/components/chart/element/element.line.js +0 -292
  24. package/dist/components/chart/element/element.pie.js +0 -73
  25. package/dist/components/chart/element/element.scatter.js +0 -209
  26. package/dist/components/chart/element/element.tip.js +0 -312
  27. package/dist/components/chart/helpers/helpers.canvas.js +0 -141
  28. package/dist/components/chart/helpers/helpers.constant.js +0 -253
  29. package/dist/components/chart/helpers/helpers.util.js +0 -265
  30. package/dist/components/chart/index.js +0 -7
  31. package/dist/components/chart/model/index.js +0 -6
  32. package/dist/components/chart/model/model.series.js +0 -82
  33. package/dist/components/chart/model/model.store.js +0 -650
  34. package/dist/components/chart/plugins/plugins.interaction.js +0 -823
  35. package/dist/components/chart/plugins/plugins.legend.gradient.js +0 -281
  36. package/dist/components/chart/plugins/plugins.legend.js +0 -665
  37. package/dist/components/chart/plugins/plugins.pie.js +0 -86
  38. package/dist/components/chart/plugins/plugins.scrollbar.js +0 -345
  39. package/dist/components/chart/plugins/plugins.title.js +0 -43
  40. package/dist/components/chart/plugins/plugins.tooltip.js +0 -508
  41. package/dist/components/chart/scale/scale.js +0 -492
  42. package/dist/components/chart/scale/scale.linear.js +0 -248
  43. package/dist/components/chart/scale/scale.logarithmic.js +0 -82
  44. package/dist/components/chart/scale/scale.step.js +0 -227
  45. package/dist/components/chart/scale/scale.time.category.js +0 -148
  46. package/dist/components/chart/scale/scale.time.js +0 -95
  47. package/dist/components/chart/uses.js +0 -479
  48. package/dist/components/chartBrush/ChartBrush.vue.js +0 -198
  49. package/dist/components/chartBrush/chartBrush.core.js +0 -265
  50. package/dist/components/chartBrush/index.js +0 -7
  51. package/dist/components/chartBrush/uses.js +0 -18
  52. package/dist/components/chartGroup/ChartGroup.vue.js +0 -128
  53. package/dist/components/chartGroup/index.js +0 -7
  54. package/dist/components/chartGroup/uses.js +0 -47
  55. package/dist/components/checkbox/Checkbox.vue.js +0 -99
  56. package/dist/components/checkbox/index.js +0 -7
  57. package/dist/components/checkboxGroup/CheckboxGroup.vue.js +0 -40
  58. package/dist/components/checkboxGroup/index.js +0 -7
  59. package/dist/components/contextMenu/ContextMenu.vue.js +0 -70
  60. package/dist/components/contextMenu/MenuList.vue.js +0 -105
  61. package/dist/components/contextMenu/index.js +0 -7
  62. package/dist/components/contextMenu/uses.js +0 -79
  63. package/dist/components/datePicker/DatePicker.vue.js +0 -310
  64. package/dist/components/datePicker/index.js +0 -7
  65. package/dist/components/datePicker/uses.js +0 -190
  66. package/dist/components/grid/Grid.vue.js +0 -1261
  67. package/dist/components/grid/GridColumnSetting.vue.js +0 -212
  68. package/dist/components/grid/GridFilterSetting.vue.js +0 -222
  69. package/dist/components/grid/GridPagination.vue.js +0 -69
  70. package/dist/components/grid/GridSummary.vue.js +0 -186
  71. package/dist/components/grid/GridToolbar.vue.js +0 -15
  72. package/dist/components/grid/icon/icon-option-button.vue.js +0 -39
  73. package/dist/components/grid/icon/icon-sort-button.vue.js +0 -56
  74. package/dist/components/grid/index.js +0 -7
  75. package/dist/components/grid/uses.js +0 -697
  76. package/dist/components/icon/Icon.vue.js +0 -50
  77. package/dist/components/icon/index.js +0 -8
  78. package/dist/components/inputNumber/InputNumber.vue.js +0 -112
  79. package/dist/components/inputNumber/index.js +0 -7
  80. package/dist/components/inputNumber/uses.js +0 -76
  81. package/dist/components/loading/Loading.vue.js +0 -78
  82. package/dist/components/loading/index.js +0 -7
  83. package/dist/components/menu/Menu.vue.js +0 -66
  84. package/dist/components/menu/MenuItem.vue.js +0 -125
  85. package/dist/components/menu/index.js +0 -7
  86. package/dist/components/message/Message.vue.js +0 -122
  87. package/dist/components/message/index.js +0 -16
  88. package/dist/components/messageBox/MessageBox.vue.js +0 -216
  89. package/dist/components/messageBox/index.js +0 -13
  90. package/dist/components/notification/Notification.vue.js +0 -140
  91. package/dist/components/notification/index.js +0 -23
  92. package/dist/components/pagination/Pagination.vue.js +0 -215
  93. package/dist/components/pagination/index.js +0 -7
  94. package/dist/components/pagination/pageButton.vue.js +0 -35
  95. package/dist/components/progress/Progress.vue.js +0 -88
  96. package/dist/components/progress/index.js +0 -7
  97. package/dist/components/radio/Radio.vue.js +0 -75
  98. package/dist/components/radio/index.js +0 -7
  99. package/dist/components/radioGroup/RadioGroup.vue.js +0 -37
  100. package/dist/components/radioGroup/index.js +0 -7
  101. package/dist/components/scheduler/Scheduler.vue.js +0 -128
  102. package/dist/components/scheduler/index.js +0 -7
  103. package/dist/components/scheduler/uses.js +0 -73
  104. package/dist/components/select/Select.vue.js +0 -381
  105. package/dist/components/select/index.js +0 -7
  106. package/dist/components/select/uses.js +0 -147
  107. package/dist/components/slider/Slider.vue.js +0 -243
  108. package/dist/components/slider/index.js +0 -7
  109. package/dist/components/slider/uses.js +0 -188
  110. package/dist/components/tabPanel/TabPanel.vue.js +0 -39
  111. package/dist/components/tabPanel/index.js +0 -7
  112. package/dist/components/tabs/Tabs.vue.js +0 -220
  113. package/dist/components/tabs/index.js +0 -7
  114. package/dist/components/textField/TextField.vue.js +0 -209
  115. package/dist/components/textField/index.js +0 -7
  116. package/dist/components/timePicker/TimePicker.vue.js +0 -227
  117. package/dist/components/timePicker/index.js +0 -7
  118. package/dist/components/toggle/Toggle.vue.js +0 -66
  119. package/dist/components/toggle/index.js +0 -7
  120. package/dist/components/tree/Tree.vue.js +0 -220
  121. package/dist/components/tree/TreeNode.vue.js +0 -146
  122. package/dist/components/tree/index.js +0 -7
  123. package/dist/components/treeGrid/TreeGrid.vue.js +0 -898
  124. package/dist/components/treeGrid/TreeGridNode.vue.js +0 -274
  125. package/dist/components/treeGrid/TreeGridToolbar.vue.js +0 -15
  126. package/dist/components/treeGrid/index.js +0 -7
  127. package/dist/components/treeGrid/uses.js +0 -497
  128. package/dist/components/window/Window.vue.js +0 -211
  129. package/dist/components/window/index.js +0 -7
  130. package/dist/components/window/uses.js +0 -345
  131. package/dist/directives/clickoutside.js +0 -47
  132. package/dist/main.js +0 -142
  133. package/dist/package.json.js +0 -4
  134. package/dist/resolver.js +0 -17
@@ -1,479 +0,0 @@
1
- import { getCurrentInstance as U, ref as k, computed as P, reactive as b, onUpdated as R, watch as S, nextTick as F } from "vue";
2
- import { cloneDeep as v, defaultsDeep as D, isEqual as N } from "lodash-es";
3
- import { getQuantity as A } from "../../common/utils.js";
4
- import V from "./chartZoom.core.js";
5
- const q = {
6
- padding: {
7
- top: 20,
8
- right: 2,
9
- left: 2,
10
- bottom: 4
11
- },
12
- border: 2,
13
- title: {
14
- show: !1,
15
- height: 40,
16
- text: "",
17
- style: {
18
- fontSize: 15,
19
- color: "#000",
20
- fontFamily: "Roboto"
21
- }
22
- },
23
- legend: {
24
- show: !0,
25
- type: "icon",
26
- position: "right",
27
- color: "#353740",
28
- inactive: "#aaa",
29
- width: 140,
30
- height: 24,
31
- allowResize: !1,
32
- virtualScroll: !1,
33
- clickMode: "active",
34
- external: !1,
35
- table: {
36
- use: !1,
37
- columns: {
38
- name: {
39
- title: "Name"
40
- },
41
- min: {
42
- title: "MIN",
43
- use: !1
44
- },
45
- max: {
46
- title: "MAX",
47
- use: !1
48
- },
49
- avg: {
50
- title: "AVG",
51
- use: !1
52
- },
53
- total: {
54
- title: "TOTAL",
55
- use: !1
56
- },
57
- last: {
58
- title: "LAST",
59
- use: !1
60
- }
61
- }
62
- }
63
- },
64
- itemHighlight: !0,
65
- seriesHighlight: !0,
66
- unSelectedOpacity: 0.3,
67
- useSelect: !1,
68
- doughnutHoleSize: 0,
69
- pieStroke: {
70
- use: !0,
71
- lineWidth: 2,
72
- color: "#FFFFFF"
73
- },
74
- reverse: !1,
75
- horizontal: !1,
76
- overlapping: {
77
- use: !1
78
- },
79
- width: "100%",
80
- height: "100%",
81
- thickness: 1,
82
- cPadRatio: 0,
83
- borderRadius: 0,
84
- combo: !1,
85
- tooltip: {
86
- use: !0,
87
- sortByValue: !0,
88
- backgroundColor: "#4C4C4C",
89
- fontColor: "#FFFFFF",
90
- borderColor: "#666666",
91
- shadowOpacity: 0.25,
92
- useShadow: !1,
93
- throttledMove: !1,
94
- debouncedHide: !1,
95
- useScrollbar: !1,
96
- textOverflow: "wrap",
97
- fontFamily: "Roboto",
98
- colorShape: "rect",
99
- fontSize: {
100
- title: 16,
101
- contents: 14
102
- },
103
- rowPadding: {
104
- top: 0,
105
- bottom: 3,
106
- right: 20,
107
- left: 16
108
- },
109
- showHeader: !0
110
- },
111
- indicator: {
112
- use: !0,
113
- color: "#EE7F44",
114
- segments: null
115
- },
116
- maxTip: {
117
- use: !1,
118
- fixedPosTop: !1,
119
- showIndicator: !1,
120
- indicatorColor: "#000000",
121
- tipStyle: {
122
- height: 20,
123
- background: "#000000",
124
- textColor: "#FFFFFF",
125
- fontSize: 14,
126
- fontFamily: "Roboto",
127
- fontWeight: 400
128
- }
129
- },
130
- selectItem: {
131
- use: !1,
132
- useClick: !0,
133
- showTextTip: !1,
134
- tipText: "value",
135
- showTip: !1,
136
- showIndicator: !1,
137
- fixedPosTop: !1,
138
- useApproximateValue: !1,
139
- indicatorColor: "#000000",
140
- tipStyle: {
141
- height: 20,
142
- background: "#000000",
143
- textColor: "#FFFFFF",
144
- fontSize: 14,
145
- fontFamily: "Roboto",
146
- fontWeight: 400
147
- },
148
- useSeriesOpacity: !1,
149
- useDeselectItem: !1,
150
- showBorder: !1,
151
- borderStyle: {
152
- color: "#FFFFFF",
153
- lineWidth: 1,
154
- opacity: 1,
155
- radius: 0
156
- }
157
- },
158
- selectLabel: {
159
- use: !1,
160
- useClick: !0,
161
- tipText: "value",
162
- limit: 1,
163
- useDeselectOverflow: !1,
164
- showTip: !1,
165
- useSeriesOpacity: !0,
166
- useLabelOpacity: !0,
167
- fixedPosTop: !1,
168
- useApproximateValue: !1,
169
- tipBackground: "#000000",
170
- indicatorColor: "#000000",
171
- tipStyle: {
172
- height: 20,
173
- background: "#000000",
174
- textColor: "#FFFFFF",
175
- fontSize: 14,
176
- fontFamily: "Roboto",
177
- fontWeight: 400
178
- },
179
- showTextTip: !1,
180
- showIndicator: !1,
181
- useBothAxis: !1
182
- },
183
- selectSeries: {
184
- use: !1,
185
- useClick: !0,
186
- limit: 1,
187
- useDeselectOverflow: !1
188
- },
189
- dragSelection: {
190
- use: !1,
191
- keepDisplay: !0,
192
- size: 50,
193
- fillColor: "#38ACEC",
194
- opacity: 0.65
195
- },
196
- zoom: {
197
- bufferMemoryCnt: 100,
198
- keepZoomStatus: !1,
199
- useAnimation: !0,
200
- useWheelMove: !0,
201
- toolbar: {
202
- show: !1,
203
- items: {
204
- previous: {
205
- icon: "ev-icon-allow2-left",
206
- size: "medium",
207
- title: "Previous"
208
- },
209
- latest: {
210
- icon: "ev-icon-allow2-right",
211
- size: "medium",
212
- title: "Latest"
213
- },
214
- reset: {
215
- icon: "ev-icon-redo",
216
- size: "medium",
217
- title: "Reset"
218
- },
219
- dragZoom: {
220
- icon: "ev-icon-zoomin",
221
- size: "medium",
222
- title: "Drag Zoom"
223
- }
224
- }
225
- }
226
- },
227
- heatMapColor: {
228
- min: "#FFFFFF",
229
- max: "#0052FF",
230
- rangeCount: 1,
231
- colorsByRange: [],
232
- stroke: {
233
- show: !1,
234
- color: "#FFFFFF",
235
- lineWidth: 1,
236
- opacity: 1,
237
- radius: 0
238
- },
239
- error: "#FF0000",
240
- decimalPoint: 0
241
- },
242
- seriesReverse: !1,
243
- coordinateDedupe: !0,
244
- eventBehavior: {
245
- legendClick: "update"
246
- }
247
- }, _ = {
248
- series: {},
249
- groups: [],
250
- labels: [],
251
- data: {}
252
- }, K = () => {
253
- let i = null, l = 0;
254
- const r = 200;
255
- return {
256
- clickEventCallback: (d) => {
257
- l++, l === 1 && (i = setTimeout(() => {
258
- l === 1 && d(), l = 0;
259
- }, r));
260
- },
261
- dblClickEventCallback: (d) => {
262
- i && (clearTimeout(i), i = null), d(), l = 0;
263
- }
264
- };
265
- }, Y = (i, l) => {
266
- const { props: r, emit: s } = U(), f = (e) => {
267
- const o = D({}, e, q);
268
- return (e.type === "scatter" || e.type === "heatMap") && !(e != null && e.tooltip) && (o.tooltip.use = !1), e.type === "pie" && !(e != null && e.padding) && (o.padding = {
269
- top: 2,
270
- right: 2,
271
- left: 2,
272
- bottom: 4
273
- }), o;
274
- }, d = (e) => D(e, _), w = v(r.selectedItem), y = v(r.selectedLabel ?? (i == null ? void 0 : i.value)), c = v(r.selectedSeries), { clickEventCallback: C, dblClickEventCallback: h } = K();
275
- return {
276
- eventListeners: {
277
- click: async (e) => {
278
- await F(), C(() => {
279
- const { seriesId: o, dataIndex: n, eventTarget: p, targetAxis: Z } = (e == null ? void 0 : e.selected) ?? {}, { eventTarget: x } = (e == null ? void 0 : e.deselected) ?? {};
280
- switch (p) {
281
- case "item": {
282
- o !== null ? (s("update:selectedItem", {
283
- seriesID: o,
284
- dataIndex: n
285
- }), x === "label" && s("update:selectedLabel", { dataIndex: [] })) : s("update:selectedItem", null);
286
- break;
287
- }
288
- case "label": {
289
- i != null && i.value ? i.value.dataIndex = n : (s("update:selectedLabel", {
290
- dataIndex: n,
291
- targetAxis: Z
292
- }), x === "item" && s("update:selectedItem", null));
293
- break;
294
- }
295
- case "series": {
296
- s("update:selectedSeries", { seriesId: o });
297
- break;
298
- }
299
- }
300
- s("click", e);
301
- });
302
- },
303
- "dbl-click": async (e) => {
304
- await F(), h(() => {
305
- const { eventTarget: o } = e;
306
- switch (o) {
307
- case "series": {
308
- s("update:selectedSeries", { seriesId: e.seriesId ? [e.seriesId] : [] });
309
- break;
310
- }
311
- }
312
- s("dbl-click", e);
313
- });
314
- },
315
- "drag-select": async (e) => {
316
- await F(), s("drag-select", e);
317
- },
318
- "mouse-move": async (e) => {
319
- l != null && l.value && (l.value = e.hoveredLabel), await F(), s("mouse-move", e);
320
- },
321
- "mouse-leave": () => {
322
- l != null && l.value && (l.value.label = null);
323
- },
324
- "click-legend": async (e) => {
325
- await F(), s("click-legend", e);
326
- },
327
- "update:legendData": async (e) => {
328
- await F(), s("update:legendData", e);
329
- },
330
- "axes-scale-change": (e) => {
331
- s("axes-scale-change", e);
332
- }
333
- },
334
- selectItemInfo: w,
335
- selectLabelInfo: y,
336
- selectSeriesInfo: c,
337
- getNormalizedData: d,
338
- getNormalizedOptions: f
339
- };
340
- }, B = (i) => {
341
- const l = k(), r = P(() => {
342
- const s = (f) => {
343
- let d;
344
- return f ? d = f.unit ? f.value + f.unit : `${f.value}px` : d = void 0, d;
345
- };
346
- return {
347
- width: s(A(i.width)),
348
- height: s(A(i.height))
349
- };
350
- });
351
- return {
352
- wrapper: l,
353
- wrapperStyle: r
354
- };
355
- }, H = (i, { wrapper: l, evChartGroupRef: r }, s, f) => {
356
- const { props: d, emit: w } = U(), y = k(!1), c = k(!1), C = k(!0), h = k(), m = b({ zoom: i.zoom }), e = b({
357
- start: 0,
358
- end: -1,
359
- isUseButton: !1,
360
- isUseScroll: !1
361
- });
362
- let o = null;
363
- const n = b({
364
- dom: [],
365
- props: {
366
- data: [],
367
- options: []
368
- }
369
- }), p = b({ data: null, options: null }), Z = k([]), x = (t) => {
370
- t.data.length && t.range && c.value && o.dragZoom(t);
371
- }, T = () => {
372
- n.props.options.forEach((t, a) => {
373
- if (t.zoom = {
374
- ...t.zoom,
375
- use: c.value,
376
- getRangeInfo: x
377
- }, c.value)
378
- t.dragSelection = {
379
- ...t.dragSelection,
380
- use: !0,
381
- keepDisplay: !1
382
- };
383
- else {
384
- const { use: u, keepDisplay: g } = p.options[a].dragSelection ?? {};
385
- t.dragSelection = {
386
- use: !!u,
387
- keepDisplay: !!g
388
- };
389
- }
390
- });
391
- }, z = () => {
392
- if (r != null && r.value ? (n.dom = r.value.querySelectorAll(".ev-chart-container"), n.dom.length && f.value.forEach(({ data: t, options: a }, u) => {
393
- t.chartIdx = u, n.props.data.push(t), n.props.options.push(a), Z.value.push(u);
394
- })) : (n.dom = [l.value.querySelector(".ev-chart-container")], n.props.data.push(d.data), n.props.options.push(d.options)), n.props.data.length) {
395
- p.data = v(n.props.data), p.options = v(n.props.options);
396
- const t = {
397
- updateZoomStartIdx: (a) => w("update:zoomStartIdx", a),
398
- updateZoomEndIdx: (a) => w("update:zoomEndIdx", a)
399
- };
400
- o = new V(
401
- n,
402
- p,
403
- m,
404
- h.value,
405
- y,
406
- e,
407
- t
408
- );
409
- }
410
- }, E = (t) => {
411
- p.data[0].labels.length <= 1 || (c.value = !c.value, t ? t.classList.toggle("active") : h.value.querySelector(".dragZoom").classList.toggle("active"), T(), o.setIconStyle(c.value), o.setEventListener(c.value));
412
- }, I = (t, a) => {
413
- if (o.isAnimationFinish)
414
- switch (a) {
415
- case "dragZoom":
416
- E(t.target);
417
- break;
418
- case "reset":
419
- o.initZoom();
420
- break;
421
- case "previous":
422
- case "latest":
423
- o.clickMoveZoomArea(a);
424
- break;
425
- }
426
- };
427
- R(() => {
428
- o && h.value && o.setIcon(h.value);
429
- });
430
- const M = (t) => {
431
- !N(t.zoom, m.zoom) && (m.zoom = t.zoom, o ? (!m.zoom.toolbar.show && c.value && E(), o.setEvChartZoomOptions(m.zoom)) : m.zoom.toolbar.show && !r && z());
432
- }, O = (t) => {
433
- C.value ? (y.value || (p.data = r ? v(t) : [v(t)], m.zoom.keepZoomStatus ? C.value = !1 : (c.value = !1, T()), o && o.updateEvChartCloneData(
434
- p,
435
- Z,
436
- c.value,
437
- m.zoom.keepZoomStatus
438
- )), y.value = !1) : C.value = !0;
439
- }, W = (t, a) => {
440
- if (o.isUseToolbar) {
441
- o.isUseToolbar = !1;
442
- return;
443
- }
444
- c.value && (o.executeZoom(t, a), o.setZoomAreaMemory(t, a));
445
- };
446
- return S(
447
- () => [e.start, e.end],
448
- ([t, a], [u]) => {
449
- if (s != null && s.value)
450
- if (typeof s.value.dataIndex == "number")
451
- t >= (u ?? 0) ? s.value.dataIndex -= t - (u ?? 0) : s.value.dataIndex += u - t;
452
- else
453
- for (let g = 0; g < s.value.dataIndex.length; g++)
454
- t >= (u ?? 0) ? s.value.dataIndex[g] -= t - (u ?? 0) : s.value.dataIndex[g] += u - t;
455
- (e.isUseButton || e.isUseScroll) && o.executeZoom(t, a);
456
- }
457
- ), S(
458
- () => [e.isUseButton, e.isUseScroll],
459
- ([t, a], [u, g]) => {
460
- u && !t ? o.setZoomAreaMemory(e.start, e.end) : g && !a && (o.zoomAreaMemory.current[0] = [e.start, e.end]);
461
- }
462
- ), {
463
- evChartZoomOptions: m,
464
- evChartInfo: n,
465
- evChartToolbarRef: h,
466
- evChartClone: p,
467
- brushIdx: e,
468
- createEvChartZoom: z,
469
- setOptionsForUseZoom: M,
470
- setDataForUseZoom: O,
471
- controlZoomIdx: W,
472
- onClickToolbar: I
473
- };
474
- };
475
- export {
476
- Y as useModel,
477
- B as useWrapper,
478
- H as useZoomModel
479
- };
@@ -1,198 +0,0 @@
1
- import { resolveDirective as N, withDirectives as O, openBlock as R, createElementBlock as W, normalizeStyle as X, createCommentVNode as Y, ref as $, inject as v, computed as B, watch as m, onMounted as q, onUpdated as A, onBeforeUnmount as P, onDeactivated as V, onActivated as F } from "vue";
2
- import { cloneDeep as w, debounce as G, isEqual as x } from "lodash-es";
3
- import H from "vue-resize-observer";
4
- import J from "../chart/chart.core.js";
5
- import { useModel as K, useWrapper as Q } from "../chart/uses.js";
6
- import Z from "./chartBrush.core.js";
7
- import { useBrushModel as ee } from "./uses.js";
8
- import te from "../../_virtual/_plugin-vue_export-helper.js";
9
- const se = {
10
- name: "EvChartBrush",
11
- directives: {
12
- resize: H
13
- },
14
- props: {
15
- options: {
16
- type: Object,
17
- default: () => ({})
18
- }
19
- },
20
- setup(I) {
21
- let t = null, i = null;
22
- const l = $(!1), u = v("evChartClone", { data: [] }), S = v("evChartInfo", { props: { options: [] } }), c = v("brushIdx", {
23
- start: 0,
24
- end: -1,
25
- isUseButton: !1,
26
- isUseScroll: !1
27
- }), h = v("brushSeries", { list: [], chartIdx: null }), { getNormalizedBrushOptions: k } = ee(), a = B(() => k(I.options)), {
28
- eventListeners: D,
29
- selectItemInfo: E,
30
- selectLabelInfo: _,
31
- selectSeriesInfo: L,
32
- getNormalizedData: T,
33
- getNormalizedOptions: U
34
- } = K(), n = B(
35
- () => T((u.data ?? [])[a.value.chartIdx])
36
- ), d = B(() => {
37
- var r, o;
38
- const e = S.props.options[a.value.chartIdx], s = {
39
- ...e,
40
- brush: {
41
- use: !0,
42
- ...a.value
43
- },
44
- height: a.value.height,
45
- zoom: {
46
- use: !1
47
- },
48
- dragSelection: {
49
- use: !1
50
- },
51
- title: {
52
- show: !1
53
- },
54
- tooltip: {
55
- use: !1
56
- },
57
- legend: {
58
- show: !1
59
- },
60
- selectLabel: {
61
- use: !1
62
- },
63
- selectSeries: {
64
- use: !1
65
- },
66
- axesX: [
67
- {
68
- ...(r = e == null ? void 0 : e.axesX) == null ? void 0 : r[0],
69
- title: {
70
- use: !1
71
- }
72
- }
73
- ],
74
- axesY: [
75
- {
76
- ...(o = e == null ? void 0 : e.axesY) == null ? void 0 : o[0],
77
- title: {
78
- use: !1
79
- }
80
- }
81
- ]
82
- };
83
- return U(s);
84
- }), { wrapper: f, wrapperStyle: M } = Q(
85
- d.value
86
- );
87
- m(
88
- () => h.list,
89
- () => {
90
- f.value && h.chartIdx === a.value.chartIdx && (t.seriesList = h.list[a.value.chartIdx], t.update({
91
- updateSeries: !1,
92
- updateSelTip: { update: !1, keepDomain: !1 }
93
- }));
94
- }
95
- ), m(d, (e, s) => {
96
- var r;
97
- e.brush.chartIdx <= ((r = u.data) == null ? void 0 : r.length) - 1 ? i && !x(s.brush, e.brush) ? i.removeBrushWrapper() : t && !x(e, s) && (t.options = w(e), t.update({
98
- updateSeries: !1,
99
- updateSelTip: { update: !1, keepDomain: !1 }
100
- })) : (t.data = w(n.value), t.update({
101
- updateSeries: !0,
102
- updateSelTip: { update: !1, keepDomain: !1 },
103
- updateData: !1
104
- }), i.removeBrushCanvas());
105
- }), m(
106
- () => u.data,
107
- (e) => {
108
- if (t) {
109
- const s = e[a.value.chartIdx];
110
- if (s) {
111
- const r = !x(s.series, t.data.series), o = h.list[a.value.chartIdx];
112
- typeof o == "object" && Object.keys(o).length && Object.keys(s.series).forEach((C) => {
113
- var j;
114
- "show" in s.series[C] || (s.series[C].show = ((j = o[C]) == null ? void 0 : j.show) ?? !0);
115
- }), t.data = w(s), t.update({
116
- updateSeries: r,
117
- updateSelTip: { update: !1, keepDomain: !1 },
118
- updateData: !1
119
- });
120
- }
121
- }
122
- }
123
- );
124
- const b = () => {
125
- let e;
126
- d.value.selectLabel.use ? e = _ : d.value.selectSeries.use && (e = L), t = new J(
127
- f.value,
128
- n.value,
129
- d.value,
130
- D,
131
- E,
132
- e
133
- );
134
- }, y = () => {
135
- i = new Z(
136
- t,
137
- n,
138
- a,
139
- c,
140
- f
141
- );
142
- }, z = () => {
143
- t && t.init();
144
- }, p = (e) => {
145
- i && i.init(e);
146
- };
147
- m(
148
- () => [c.start, c.end],
149
- () => {
150
- var e;
151
- f.value && a.value.chartIdx <= ((e = u.data) == null ? void 0 : e.length) - 1 && p();
152
- }
153
- ), q(async () => {
154
- a.value.show && (await b(), await z(), y(), p()), l.value = !0;
155
- }), A(async () => {
156
- var e;
157
- if (a.value.show && a.value.chartIdx <= ((e = u.data) == null ? void 0 : e.length) - 1) {
158
- const s = h.list[a.value.chartIdx];
159
- typeof s == "object" && Object.keys(s).length && Object.keys(n.value.series).forEach((r) => {
160
- var o;
161
- "show" in n.value.series[r] || (n.value.series[r].show = ((o = s[r]) == null ? void 0 : o.show) ?? !0);
162
- }), await b(), await z(), y(), p();
163
- }
164
- }), P(() => {
165
- t && "destroy" in t && t.destroy(), i && i.destroy(), l.value = !1;
166
- }), V(() => {
167
- t && "hideTooltip" in t && t.hideTooltip();
168
- });
169
- const g = G(() => {
170
- t && "resize" in t && new Promise((s) => t.resize(s)).then((s) => {
171
- s && p(s);
172
- });
173
- }, 0);
174
- return F(() => {
175
- l.value && g();
176
- }), {
177
- evChartBrushOptions: a,
178
- evChartBrushRef: f,
179
- evChartBrushStyle: M,
180
- onResize: g
181
- };
182
- }
183
- };
184
- function ae(I, t, i, l, u, S) {
185
- const c = N("resize");
186
- return l.evChartBrushOptions.show ? O((R(), W("div", {
187
- key: 0,
188
- ref: "evChartBrushRef",
189
- style: X(l.evChartBrushStyle),
190
- class: "ev-chart-brush"
191
- }, null, 4)), [
192
- [c, l.onResize]
193
- ]) : Y("", !0);
194
- }
195
- const de = /* @__PURE__ */ te(se, [["render", ae]]);
196
- export {
197
- de as default
198
- };