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,86 +0,0 @@
1
- const A = {
2
- pieDataSet: [],
3
- /**
4
- * Draw series data
5
- *
6
- * @params hitInfo
7
- *
8
- * @returns {undefined}
9
- */
10
- drawPie(n) {
11
- var W;
12
- const t = this.bufferCtx, b = this.chartRect, p = this.pieDataSet, i = this.options, s = this.options.padding, c = !!i.doughnutHoleSize;
13
- let e, o, a, l = 1.5 * Math.PI, S, r, P;
14
- const k = b.width / 2, H = b.height / 2, u = k - (s.left + s.right), d = H - (s.bottom + s.top);
15
- if (typeof u == "number" && u < 0 || typeof d == "number" && d < 0)
16
- return;
17
- const f = Math.min(u, d) * i.doughnutHoleSize, y = Math.min(u, d);
18
- for (let g = 0; g < p.length; g++) {
19
- const h = p[g];
20
- if (!h)
21
- return;
22
- let m = y - (y - f) / p.length * g;
23
- if ((W = i == null ? void 0 : i.pieStroke) != null && W.use && (m -= i.pieStroke.lineWidth), m < 0)
24
- return;
25
- if (h.or = m, g < p.length - 1 ? h.ir = y - (y - f) / p.length * (g + 1) : h.ir = 1, h.total) {
26
- for (let D = 0; D < h.data.length; D++)
27
- if (e = h.data[D], o = e.value, P = o / h.total * 100, a = 2 * Math.PI * (o / h.total), S = l + a, e.sa = l, e.ea = S, r = this.seriesList[e.id], o) {
28
- const w = { ...i.pieStroke };
29
- h.data.length === 1 && i.pieStroke.use && (w.use = !1, t.lineWidth = i.pieStroke.lineWidth, t.strokeStyle = i.pieStroke.color, t.arc(k, H, m, 0, 2 * Math.PI), t.stroke());
30
- const { selectInfo: M, legendHitInfo: I, unSelectedOpacity: z } = n;
31
- r.isSelect = (M == null ? void 0 : M.sId) === e.id, r.isDownplay = I && I.sId !== e.id, r.type = c ? "doughnut" : "pie", r.centerX = k, r.centerY = H, r.radius = m, r.doughnutHoleSize = m * (i.doughnutHoleSize ?? 0), r.startAngle = l, r.endAngle = S, r.data = { o, percentage: P }, r.draw(t, w, z), l += a;
32
- }
33
- }
34
- }
35
- },
36
- /**
37
- * Draw series data
38
- *
39
- * @params hitInfo
40
- *
41
- * @returns {undefined}
42
- */
43
- drawSunburst(n) {
44
- var H;
45
- const t = this.bufferCtx, { width: b, height: p } = this.chartRect, i = this.pieDataSet, s = this.options, c = this.options.padding;
46
- this.calculateAngle();
47
- let e, o;
48
- const a = b / 2, l = p / 2, S = a - (c.left + c.right), r = l - (c.bottom + c.top);
49
- if (typeof S == "number" && S < 0 || typeof r == "number" && r < 0)
50
- return;
51
- const P = Math.min(S, r) * s.doughnutHoleSize, k = Math.min(S, r);
52
- for (let u = 0; u < i.length; u++) {
53
- const d = i[u];
54
- if (!d)
55
- return;
56
- let f = k - (k - P) / i.length * u;
57
- if ((H = s == null ? void 0 : s.pieStroke) != null && H.use && (f -= s.pieStroke.lineWidth), f < 0)
58
- return;
59
- d.or = f, u < i.length - 1 ? d.ir = k - (k - P) / i.length * (u + 1) : d.ir = 1;
60
- for (let y = 0; y < d.data.length; y++)
61
- if (e = d.data[y], e.id === "dummy")
62
- t.save(), t.globalCompositeOperation = "destination-out", t.beginPath(), t.fillStyle = "#fff", t.lineWidth = 2, t.strokeStyle = "#fff", t.moveTo(a, l), t.arc(a, l, f, e.sa, e.ea), t.stroke(), t.fill(), t.closePath(), t.restore();
63
- else if (o = this.seriesList[e.id], e.value) {
64
- const W = { ...s.pieStroke };
65
- d.data.length === 1 && s.pieStroke.use && (W.use = !1, t.lineWidth = s.pieStroke.lineWidth, t.strokeStyle = s.pieStroke.color, t.arc(a, l, f, 0, 2 * Math.PI), t.stroke());
66
- const { selectInfo: g, legendHitInfo: h, unSelectedOpacity: m } = n;
67
- o.isSelect = (g == null ? void 0 : g.sId) === e.id, o.isDownplay = h && h.sId !== e.id, o.type = "sunburst", o.centerX = a, o.centerY = l, o.radius = f, o.doughnutHoleSize = f * (s.doughnutHoleSize ?? 0), o.startAngle = e.sa, o.endAngle = e.ea, o.data = { o: e.value }, o.draw(t, W, m);
68
- }
69
- }
70
- },
71
- /**
72
- * Draw doughnut hole
73
- * @param ctx
74
- */
75
- drawDoughnutHole(n = this.bufferCtx) {
76
- var l;
77
- const t = this.options, { width: b, height: p } = this.chartRect, i = this.options.padding, s = b / 2, c = p / 2, e = s - (i.left + i.right), o = c - (i.bottom + i.top);
78
- if (typeof e == "number" && e < 0 || typeof o == "number" && o < 0)
79
- return;
80
- const a = Math.min(e, o) * t.doughnutHoleSize;
81
- n.save(), n.globalCompositeOperation = "destination-out", n.beginPath(), n.fillStyle = "#fff", n.fillOpacity = 0, n.arc(s, c, a, 0, 2 * Math.PI), n.fill(), n.strokeStyle = "#fff", n.stroke(), n.closePath(), n.restore(), (l = t == null ? void 0 : t.pieStroke) != null && l.use && (n.beginPath(), n.strokeStyle = t.pieStroke.color, n.lineWidth = t.pieStroke.lineWidth, n.arc(s, c, a, 0, Math.PI * 2), n.stroke(), n.closePath()), this.pieDataSet[this.pieDataSet.length - 1].ir = a;
82
- }
83
- };
84
- export {
85
- A as default
86
- };
@@ -1,345 +0,0 @@
1
- import { throttle as P, isEqual as I, defaultsDeep as R } from "lodash-es";
2
- import { truthyNumber as C, checkNullAndUndefined as N } from "../../../common/utils.js";
3
- import { AXIS_OPTION as X } from "../helpers/helpers.constant.js";
4
- const z = {
5
- /**
6
- * init scrollbar information
7
- */
8
- initScrollbar() {
9
- var e, s, l, o, t, r;
10
- (l = (s = (e = this.options.axesX) == null ? void 0 : e[0]) == null ? void 0 : s.scrollbar) != null && l.use && this.initScrollbarInfo(this.options.axesX, "x"), (r = (t = (o = this.options.axesY) == null ? void 0 : o[0]) == null ? void 0 : t.scrollbar) != null && r.use && this.initScrollbarInfo(this.options.axesY, "y");
11
- },
12
- /**
13
- * init scrollbar information with axis information
14
- * @param axisOpt axis option
15
- * @param dir axis direction (x | y)
16
- */
17
- initScrollbarInfo(e, s) {
18
- var t, r, i, c, a;
19
- const l = this.scrollbar[s], o = R({}, (t = e == null ? void 0 : e[0]) == null ? void 0 : t.scrollbar, X.scrollbar);
20
- Object.keys(o).forEach((n) => {
21
- l[n] = o[n];
22
- }), l.isInit || (l.type = (r = e == null ? void 0 : e[0]) == null ? void 0 : r.type, l.range = (c = (i = e == null ? void 0 : e[0]) == null ? void 0 : i.range) != null && c.length ? [...((a = e == null ? void 0 : e[0]) == null ? void 0 : a.range) ?? []] : null, this.initScrollbarRange(s), this.createScrollbarLayout(s), this.createScrollbar(s), this.createScrollEvent(s), l.isInit = !0);
23
- },
24
- initScrollbarRange(e) {
25
- var t, r;
26
- const s = this.scrollbar[e], l = s.type, o = this.options.type === "heatMap" ? this.data.labels[e] : this.data.labels;
27
- if ((t = s.range) != null && t.length && o.length) {
28
- const [i, c] = s.range;
29
- let a, n;
30
- if (C(i) && C(c)) {
31
- if (l === "step")
32
- a = 0, n = o.length - 1;
33
- else {
34
- const u = (r = this.minMax[e]) == null ? void 0 : r[0];
35
- a = +u.min, n = +u.max;
36
- }
37
- const h = c - i, b = n - a;
38
- h >= b ? (s.range[0] = a, s.range[1] = n) : (s.range[0] = +i < a ? a : +i, s.range[1] = +c > n ? n : +c, s.range[1] - s.range[0] < h && (s.range[0] = s.range[1] - h, s.range[0] < a && (s.range[0] = a)));
39
- }
40
- }
41
- },
42
- /**
43
- * update scrollbar information
44
- */
45
- updateScrollbar(e) {
46
- this.updateScrollbarInfo("x", e), this.updateScrollbarInfo("y", e);
47
- },
48
- /**
49
- * Updated scrollbar information with updated axis information
50
- * @param dir axis direction (x | y)
51
- * @param updateData is update data
52
- */
53
- updateScrollbarInfo(e, s) {
54
- var c, a, n, h, b, u, m, d, p, g, f, y, v, S, x, M, D;
55
- const { axesX: l, axesY: o } = this.options, t = e === "x" ? l : o;
56
- if (!this.scrollbar[e].isInit && ((a = (c = t == null ? void 0 : t[0]) == null ? void 0 : c.scrollbar) != null && a.use) && ((n = t == null ? void 0 : t[0]) != null && n.range)) {
57
- this.initScrollbarInfo(t, e);
58
- return;
59
- } else if (!((h = t == null ? void 0 : t[0].scrollbar) != null && h.use) || N((b = t == null ? void 0 : t[0]) == null ? void 0 : b.range)) {
60
- this.destroyScrollbar(e);
61
- return;
62
- }
63
- const r = e === "x" ? this.axesX : this.axesY, i = !I((u = t == null ? void 0 : t[0]) == null ? void 0 : u.range, (m = r == null ? void 0 : r[0]) == null ? void 0 : m.range);
64
- if (i || s) {
65
- const E = e === "x" ? (g = (p = (d = this.options.axesX) == null ? void 0 : d[0]) == null ? void 0 : p.scrollbar) == null ? void 0 : g.resetPosition : (v = (y = (f = this.options.axesY) == null ? void 0 : f[0]) == null ? void 0 : y.scrollbar) == null ? void 0 : v.resetPosition;
66
- i || E ? (this.scrollbar[e].range = (x = (S = t == null ? void 0 : t[0]) == null ? void 0 : S.range) != null && x.length ? [...((M = t == null ? void 0 : t[0]) == null ? void 0 : M.range) ?? []] : null, delete this.scrollbar[e].savedPosition) : s && delete this.scrollbar[e].savedPosition, this.initScrollbarRange(e);
67
- }
68
- this.scrollbar[e].use = !!((D = t == null ? void 0 : t[0].scrollbar) != null && D.use);
69
- },
70
- /**
71
- * update scrollbar position
72
- */
73
- updateScrollbarPosition() {
74
- var e, s, l, o, t, r, i, c, a, n;
75
- if ((e = this.scrollbar.x) != null && e.use && ((s = this.scrollbar.x) != null && s.isInit)) {
76
- const h = !((t = (o = (l = this.options.axesX) == null ? void 0 : l[0]) == null ? void 0 : o.scrollbar) != null && t.resetPosition);
77
- this.setScrollbarPosition("x", h);
78
- }
79
- if ((r = this.scrollbar.y) != null && r.use && ((i = this.scrollbar.y) != null && i.isInit)) {
80
- const h = !((n = (a = (c = this.options.axesY) == null ? void 0 : c[0]) == null ? void 0 : a.scrollbar) != null && n.resetPosition);
81
- this.setScrollbarPosition("y", h);
82
- }
83
- },
84
- /**
85
- * create scrollbar layout
86
- * @param dir axis direction ('x' | 'y')
87
- */
88
- createScrollbarLayout(e) {
89
- const s = this.scrollbar[e];
90
- s.dom = document.createElement("div"), s.dom.className = "ev-chart-scrollbar", s.dom.dataset.type = "scrollbar";
91
- const l = document.createElement("div");
92
- l.className = "ev-chart-scrollbar-container", l.dataset.type = e, s.dom.appendChild(l), this.wrapperDOM.appendChild(s.dom);
93
- },
94
- /**
95
- * create scrollbar
96
- * @param dir axis direction ('x' | 'y')
97
- */
98
- createScrollbar(e) {
99
- const s = this.scrollbar[e], l = s.dom.children[0];
100
- this.createScrollbarTrack(l), this.createScrollbarThumb(l), s.showButton && this.createScrollbarButton(l);
101
- },
102
- /**
103
- * create scrollbar track
104
- * @param containerDOM
105
- */
106
- createScrollbarTrack(e) {
107
- const s = document.createElement("div");
108
- s.className = "ev-chart-scrollbar-track", s.dataset.type = "track", e.appendChild(s);
109
- },
110
- /**
111
- * create scrollbar thumb
112
- * @param containerDOM
113
- */
114
- createScrollbarThumb(e) {
115
- const s = document.createElement("div");
116
- s.className = "ev-chart-scrollbar-thumb", s.dataset.type = "thumb", e.appendChild(s);
117
- },
118
- /**
119
- * create scrollbar up, down button
120
- * @param containerDOM
121
- */
122
- createScrollbarButton(e) {
123
- const s = document.createElement("div");
124
- s.className = "ev-chart-scrollbar-button ev-chart-scrollbar-button-up", s.dataset.type = "button";
125
- const l = document.createElement("i");
126
- l.className = "ev-icon ev-icon-triangle-up ev-chart-scrollbar-button-icon", l.dataset.type = "button-icon", s.appendChild(l);
127
- const o = document.createElement("div");
128
- o.className = "ev-chart-scrollbar-button ev-chart-scrollbar-button-down", o.dataset.type = "button";
129
- const t = document.createElement("i");
130
- t.className = "ev-icon ev-icon-triangle-down ev-chart-scrollbar-button-icon", t.dataset.type = "button-icon", o.appendChild(t), e.appendChild(s), e.appendChild(o);
131
- },
132
- /**
133
- * set scrollbar position
134
- * @param dir axis direction ('x' | 'y')
135
- * @param preservePosition 기존 위치를 유지할지 여부
136
- */
137
- setScrollbarPosition(e, s = !1) {
138
- var D, E;
139
- const l = this.scrollbar[e];
140
- if (!l.use || !l.range)
141
- return;
142
- const o = l.dom, t = this.chartRect, r = this.labelOffset, i = {
143
- x1: t.x1 + r.left,
144
- x2: t.x2 - r.right,
145
- y1: t.y1 + r.top,
146
- y2: t.y2 - r.bottom
147
- }, c = (D = this.options.title) != null && D.show ? (E = this.options.title) == null ? void 0 : E.height : 0, a = e === "x", n = a ? l.height : l.width, h = a ? i.x2 - i.x1 : i.y2 - i.y1, b = l.showButton ? n : 0, u = h - b * 2;
148
- let m = null;
149
- s && l.savedPosition !== void 0 && (m = l.savedPosition);
150
- const d = this.getScrollbarThumbSize(e, u, m);
151
- l.savedPosition = d.position;
152
- let p = "display: block;", g, f, y, v, S = `width:${b}px;height:${b}px;`;
153
- a ? (p = `top: ${t.y2 + c + r.top}px;`, p += `left: ${i.x1}px;`, p += `width: ${h}px;`, p += ` height: ${n}px;`, g = "top: 0;", g += `left: ${b}px;`, g += `width: ${u}px;`, g += "height: 100%;", f = `width: ${d.size}px;`, f += "height: 100%;", f += `left: ${d.position + b}px`, S += "transform:rotate(90deg);top: 0;", y = `${S}right:0;`, v = `${S}left:0;`) : (p = `top: ${i.y1 + c}px;`, p += `left: ${i.x2 + 10}px;`, p += `width: ${n}px;`, p += `height: ${h}px;`, g = `top: ${b}px;`, g += "left: 0;", g += "width: 100%;", g += `height: ${u}px;`, f = "width: 100%;", f += `height: ${d.size}px;`, f += `bottom: ${d.position + b}px`, S += "left:0;", y = `${S}top: 0;`, v = `${S}bottom: 0;`), o.style.cssText = p;
154
- const x = o.getElementsByClassName("ev-chart-scrollbar-track");
155
- x[0].style.cssText = g, x[0].style.backgroundColor = l.background;
156
- const M = o.getElementsByClassName("ev-chart-scrollbar-thumb");
157
- if (M[0].style.cssText = f, M[0].style.backgroundColor = l.thumbStyle.background, M[0].style.borderRadius = `${l.thumbStyle.radius}px`, l.showButton) {
158
- const k = o.getElementsByClassName("ev-chart-scrollbar-button-up"), T = Math.floor(u - d.size), $ = Math.floor(d.position) > T ? 0.5 : 1;
159
- k[0].style.cssText = `background-color: ${l.background};${y}`, k[0].style.opacity = $, k[0].children[0].style.display = "block";
160
- const B = o.getElementsByClassName("ev-chart-scrollbar-button-down");
161
- B[0].style.cssText = `background-color: ${l.background};${v}`, B[0].style.opacity = Math.floor(d.position) < 0 ? 0.5 : 1, B[0].children[0].style.display = "block";
162
- }
163
- },
164
- /**
165
- * get scrollbar thumb size
166
- * @param dir axis direction ('x' | 'y')
167
- * @param trackSize scrollbar track size
168
- * @param savedThumbPosition 기존 위치를 보존해야 하는 경우 저장된 위치
169
- */
170
- getScrollbarThumbSize(e, s, l) {
171
- var u, m, d, p;
172
- const o = this.scrollbar[e], [t, r] = o.range, i = o.type;
173
- let c, a, n = 1, h = 0, b = 0;
174
- if (i === "step") {
175
- const g = this.options.type === "heatMap" ? this.data.labels[e] : this.data.labels, f = r - t + 1;
176
- a = g.length;
177
- const y = s / a;
178
- c = y * f, b = y * t;
179
- } else {
180
- const g = e === "x" ? this.axesX : this.axesY, f = (u = this.minMax[e]) == null ? void 0 : u[0], y = +f.max - +f.min, v = +r - +t;
181
- i === "time" && (n = (p = g == null ? void 0 : g[0]) == null ? void 0 : p.getInterval({
182
- minValue: f.min,
183
- maxValue: f.max,
184
- maxSteps: (d = (m = this.labelRange[e]) == null ? void 0 : m[0]) == null ? void 0 : d.max
185
- })), a = Math.ceil(y / n) + 1, h = +f.min;
186
- const S = s / a, x = v / n + 1, M = +t - h;
187
- c = S * x, b = S * (M / n);
188
- }
189
- return o.startValue = h, o.steps = a, o.interval = n, l !== null && (b = l), {
190
- size: c,
191
- position: b
192
- };
193
- },
194
- /**
195
- * get scrollbar containerDOM
196
- * @param targetDOM event target dom
197
- * @returns {HTMLElement|Element|*}
198
- */
199
- getScrollbarContainerDOM(e) {
200
- const s = ["track", "thumb", "button"], l = e.dataset.type;
201
- return s.includes(l) ? e.parentElement : l === "button-icon" ? e.parentElement.parentElement : l === "scrollbar" ? e.getElementsByClassName("ev-chart-scrollbar-container")[0] : e;
202
- },
203
- /**
204
- * update scrollbar option range
205
- * @param dir axis direction ('x' | 'y')
206
- * @param isUp
207
- */
208
- updateScrollbarRange(e, s) {
209
- const l = this.scrollbar[e], { startValue: o, range: t, interval: r, steps: i } = l, c = o + r * i, a = e === "x" ? this.axesX[0] : this.axesY[0], [n, h] = t ?? [];
210
- (!C(n) || !C(h)) && (l.range = (a == null ? void 0 : a.range) || null);
211
- let b, u, m = !1;
212
- s ? (b = n + r, u = h + r, m = u >= c) : (b = n - r, u = h - r, m = b < o), m || (l.range = [b, u], delete l.savedPosition, this.update({
213
- updateSeries: !1,
214
- updateSelTip: { update: !1, keepDomain: !1 },
215
- updateByScrollbar: !0,
216
- lightUpdate: b > 1
217
- }));
218
- },
219
- /**
220
- * create scroll event
221
- */
222
- createScrollEvent() {
223
- var s, l, o;
224
- this.onScrollbarClick = (t) => {
225
- t.preventDefault();
226
- const r = t.target.dataset.type, i = this.getScrollbarContainerDOM(t.target), c = ["button", "button-icon"], a = i.dataset.type;
227
- let n;
228
- if (c.includes(r)) {
229
- let h;
230
- r === "button" ? h = t.target : r === "button-icon" && (h = t.target.parentElement), n = h.className.includes("up");
231
- } else if (r === "track") {
232
- const h = i.getElementsByClassName("ev-chart-scrollbar-thumb"), { x: b, y: u } = h[0].getBoundingClientRect(), m = a === "x", d = m ? t.clientX : -t.clientY, p = m ? b : -u;
233
- n = d > p;
234
- } else
235
- return;
236
- this.updateScrollbarRange(a, n);
237
- }, this.onScrollbarDown = (t) => {
238
- if (t.preventDefault(), t.target.dataset.type !== "thumb")
239
- return;
240
- const r = this.getScrollbarContainerDOM(t.target), i = r.dataset.type, c = r.getElementsByClassName("ev-chart-scrollbar-thumb"), { x: a, y: n, height: h } = c[0].getBoundingClientRect(), b = this.scrollbar[i];
241
- b.scrolling = !0, i === "x" ? b.pointInThumb = t.clientX - a : b.pointInThumb = n + h - t.clientY;
242
- const u = b.dom;
243
- u.addEventListener("mousemove", this.onScrollbarMove), u.addEventListener("mouseup", this.onScrollbarUp);
244
- };
245
- const e = (t) => {
246
- this.scrolling(t);
247
- };
248
- if (this.onScrollbarMove = P(e, 5), this.onScrollbarUp = (t) => {
249
- t.preventDefault(), this.stopScrolling(t);
250
- }, this.onScrollbarLeave = (t) => {
251
- t.preventDefault(), this.scrolling(t), this.stopScrolling(t);
252
- }, this.onScrollbarWheel = (t) => {
253
- var h, b, u, m, d, p, g, f;
254
- const r = ((b = (h = this.tooltipDOM) == null ? void 0 : h.style) == null ? void 0 : b.display) === "block", i = this.tooltipBodyDOM || ((u = this.tooltipDOM) == null ? void 0 : u.querySelector(this.options.tooltip.htmlScrollTarget));
255
- if (r && i) {
256
- const { scrollTop: y, scrollHeight: v, clientHeight: S } = i, x = y <= 0, M = y + S >= v, D = t.deltaY < 0, E = t.deltaY > 0;
257
- if (!(x && D || M && E)) return;
258
- }
259
- t.preventDefault();
260
- const c = 1;
261
- if ((m = this.scrollbar.x) != null && m.use && t.shiftKey && Math.abs(t.deltaY) > c) {
262
- this.updateScrollbarRange("x", t.deltaY > 0);
263
- return;
264
- }
265
- const a = Math.abs(t.deltaX), n = Math.abs(t.deltaY);
266
- if (a > c && n > c) {
267
- a > n && ((d = this.scrollbar.x) != null && d.use) ? this.updateScrollbarRange("x", t.deltaX > 0) : n > a && ((p = this.scrollbar.y) != null && p.use) && this.updateScrollbarRange("y", t.deltaY < 0);
268
- return;
269
- }
270
- if ((g = this.scrollbar.x) != null && g.use && a > c) {
271
- this.updateScrollbarRange("x", t.deltaX > 0);
272
- return;
273
- }
274
- (f = this.scrollbar.y) != null && f.use && n > c && this.updateScrollbarRange("y", t.deltaY < 0);
275
- }, this.scrollbar.x.use && !this.scrollbar.x.isInit) {
276
- const t = this.scrollbar.x.dom;
277
- t.addEventListener("click", this.onScrollbarClick), t.addEventListener("mousedown", this.onScrollbarDown), t.addEventListener("mouseleave", this.onScrollbarLeave);
278
- }
279
- if (this.scrollbar.y.use && !this.scrollbar.y.isInit) {
280
- const t = this.scrollbar.y.dom;
281
- t.addEventListener("click", this.onScrollbarClick), t.addEventListener("mousedown", this.onScrollbarDown), t.addEventListener("mouseleave", this.onScrollbarLeave);
282
- }
283
- ((s = this.scrollbar.x) != null && s.use || (l = this.scrollbar.y) != null && l.use) && ((o = this.overlayCanvas) == null || o.addEventListener("wheel", this.onScrollbarWheel, { passive: !1 }));
284
- },
285
- /**
286
- * Update scroll information by move event
287
- * @param e Event
288
- */
289
- scrolling(e) {
290
- const s = this.getScrollbarContainerDOM(e.target), l = s.dataset.type;
291
- if (!this.scrollbar[l].scrolling)
292
- return;
293
- const { steps: o, range: t, pointInThumb: r, startValue: i, interval: c } = this.scrollbar[l], a = s.getElementsByClassName("ev-chart-scrollbar-track"), { x: n, y: h, width: b, height: u } = a[0].getBoundingClientRect(), m = l === "x", d = m ? n : h, p = m ? b : u, g = p / o, f = i + (o - 1) * c;
294
- let y = m ? e.clientX : e.clientY;
295
- y < d ? y = d : y > d + p && (y = d + p);
296
- let v;
297
- if (m ? v = y - d - r : v = d + p - y - r, v <= 0)
298
- return;
299
- let S, x;
300
- const M = Math.round(Math.abs(v) / g) * c, [D, E] = t;
301
- if (v > 0) {
302
- const k = i + (M - +D);
303
- S = +D + k, x = S + (+E - +D);
304
- }
305
- S < i || x > f || (this.scrollbar[l].range = [S, x], delete this.scrollbar[l].savedPosition, this.update({
306
- updateSeries: !1,
307
- updateSelTip: { update: !1, keepDomain: !1 }
308
- }));
309
- },
310
- /**
311
- * init scrolling event
312
- * @param e
313
- */
314
- stopScrolling(e) {
315
- const l = this.getScrollbarContainerDOM(e.target).dataset.type, o = this.scrollbar[l];
316
- if (o.scrolling) {
317
- o.scrolling = !1;
318
- const t = o.dom;
319
- t.removeEventListener("mousemove", this.onScrollbarMove, !1), t.removeEventListener("mouseup", this.onScrollbarUp, !1);
320
- }
321
- },
322
- /**
323
- * hide scrollbar dom
324
- * @param dir axis direction ('x' | 'y')
325
- */
326
- hideScrollbar(e) {
327
- const s = this.scrollbar[e].dom;
328
- if (!s)
329
- return;
330
- const l = s == null ? void 0 : s.style;
331
- l.display = "none", l.width = "0", l.height = "0";
332
- },
333
- /**
334
- * destroy scrollbar dom
335
- * @param dir axis direction ('x' | 'y')
336
- */
337
- destroyScrollbar(e) {
338
- var l, o, t;
339
- const s = this.scrollbar[e].dom;
340
- s && (s.remove(), this.scrollbar[e] = { isInit: !1 }, !((l = this.scrollbar.x) != null && l.use) && !((o = this.scrollbar.y) != null && o.use) && ((t = this.overlayCanvas) == null || t.removeEventListener("wheel", this.onScrollbarWheel, { passive: !1 })));
341
- }
342
- };
343
- export {
344
- z as default
345
- };
@@ -1,43 +0,0 @@
1
- const i = {
2
- /**
3
- * Create title DOM
4
- *
5
- * @returns {undefined}
6
- */
7
- createTitle() {
8
- this.titleDOM = document.createElement("div"), this.titleDOM.className = "ev-chart-title", this.wrapperDOM.appendChild(this.titleDOM);
9
- },
10
- /**
11
- * Initialize title DOM
12
- *
13
- * @returns {undefined}
14
- */
15
- initTitle() {
16
- this.isInitTitle || this.createTitle(), this.updateTitle(), this.isInitTitle = !0;
17
- },
18
- /**
19
- * show title DOM with manipulating css
20
- *
21
- * @returns {undefined}
22
- */
23
- showTitle() {
24
- this.titleDOM.style.display = "block", this.wrapperDOM.style.paddingTop = `${this.options.title.height}px`;
25
- },
26
- /**
27
- * hide title DOM with manipulating css
28
- *
29
- * @returns {undefined}
30
- */
31
- hideTitle() {
32
- this.titleDOM.style.display = "none", this.wrapperDOM.style.paddingTop = "0px";
33
- },
34
- updateTitle() {
35
- const t = this.options.title;
36
- Object.keys(t.style).forEach((e) => {
37
- this.titleDOM.style[e] = t.style[e];
38
- }), this.titleDOM.textContent = t.text, this.titleDOM.style.height = `${t.height}px`, this.titleDOM.style.lineHeight = `${t.height}px`;
39
- }
40
- };
41
- export {
42
- i as default
43
- };