evui 3.5.0-rc.1 → 3.5.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.
Files changed (135) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/common/utils.bignumber.js +23 -0
  3. package/dist/common/utils.debounce.js +66 -0
  4. package/dist/common/utils.js +64 -0
  5. package/dist/common/utils.throttle.js +15 -0
  6. package/dist/components/button/Button.vue.js +65 -0
  7. package/dist/components/button/index.js +7 -0
  8. package/dist/components/buttonGroup/ButtonGroup.vue.js +14 -0
  9. package/dist/components/buttonGroup/index.js +7 -0
  10. package/dist/components/calendar/Calendar.vue.js +299 -0
  11. package/dist/components/calendar/index.js +7 -0
  12. package/dist/components/calendar/uses.js +579 -0
  13. package/dist/components/chart/Chart.vue.js +261 -0
  14. package/dist/components/chart/ChartToolbar.vue.js +32 -0
  15. package/dist/components/chart/chart.core.js +738 -0
  16. package/dist/components/chart/chartZoom.core.js +221 -0
  17. package/dist/components/chart/element/element.bar.js +358 -0
  18. package/dist/components/chart/element/element.bar.time.js +55 -0
  19. package/dist/components/chart/element/element.heatmap.js +403 -0
  20. package/dist/components/chart/element/element.line.js +292 -0
  21. package/dist/components/chart/element/element.pie.js +73 -0
  22. package/dist/components/chart/element/element.scatter.js +209 -0
  23. package/dist/components/chart/element/element.tip.js +312 -0
  24. package/dist/components/chart/helpers/helpers.canvas.js +141 -0
  25. package/dist/components/chart/helpers/helpers.constant.js +253 -0
  26. package/dist/components/chart/helpers/helpers.util.js +265 -0
  27. package/dist/components/chart/index.js +7 -0
  28. package/dist/components/chart/model/index.js +6 -0
  29. package/dist/components/chart/model/model.series.js +82 -0
  30. package/dist/components/chart/model/model.store.js +650 -0
  31. package/dist/components/chart/plugins/plugins.interaction.js +823 -0
  32. package/dist/components/chart/plugins/plugins.legend.gradient.js +281 -0
  33. package/dist/components/chart/plugins/plugins.legend.js +665 -0
  34. package/dist/components/chart/plugins/plugins.pie.js +86 -0
  35. package/dist/components/chart/plugins/plugins.scrollbar.js +345 -0
  36. package/dist/components/chart/plugins/plugins.title.js +43 -0
  37. package/dist/components/chart/plugins/plugins.tooltip.js +508 -0
  38. package/dist/components/chart/scale/scale.js +492 -0
  39. package/dist/components/chart/scale/scale.linear.js +248 -0
  40. package/dist/components/chart/scale/scale.logarithmic.js +82 -0
  41. package/dist/components/chart/scale/scale.step.js +227 -0
  42. package/dist/components/chart/scale/scale.time.category.js +148 -0
  43. package/dist/components/chart/scale/scale.time.js +95 -0
  44. package/dist/components/chart/uses.js +479 -0
  45. package/dist/components/chartBrush/ChartBrush.vue.js +198 -0
  46. package/dist/components/chartBrush/chartBrush.core.js +265 -0
  47. package/dist/components/chartBrush/index.js +7 -0
  48. package/dist/components/chartBrush/uses.js +18 -0
  49. package/dist/components/chartGroup/ChartGroup.vue.js +128 -0
  50. package/dist/components/chartGroup/index.js +7 -0
  51. package/dist/components/chartGroup/uses.js +47 -0
  52. package/dist/components/checkbox/Checkbox.vue.js +99 -0
  53. package/dist/components/checkbox/index.js +7 -0
  54. package/dist/components/checkboxGroup/CheckboxGroup.vue.js +40 -0
  55. package/dist/components/checkboxGroup/index.js +7 -0
  56. package/dist/components/contextMenu/ContextMenu.vue.js +70 -0
  57. package/dist/components/contextMenu/MenuList.vue.js +105 -0
  58. package/dist/components/contextMenu/index.js +7 -0
  59. package/dist/components/contextMenu/uses.js +79 -0
  60. package/dist/components/datePicker/DatePicker.vue.js +310 -0
  61. package/dist/components/datePicker/index.js +7 -0
  62. package/dist/components/datePicker/uses.js +190 -0
  63. package/dist/components/grid/Grid.vue.js +1261 -0
  64. package/dist/components/grid/GridColumnSetting.vue.js +212 -0
  65. package/dist/components/grid/GridFilterSetting.vue.js +222 -0
  66. package/dist/components/grid/GridPagination.vue.js +69 -0
  67. package/dist/components/grid/GridSummary.vue.js +186 -0
  68. package/dist/components/grid/GridToolbar.vue.js +15 -0
  69. package/dist/components/grid/icon/icon-option-button.vue.js +39 -0
  70. package/dist/components/grid/icon/icon-sort-button.vue.js +56 -0
  71. package/dist/components/grid/index.js +7 -0
  72. package/dist/components/grid/uses.js +697 -0
  73. package/dist/components/icon/Icon.vue.js +50 -0
  74. package/dist/components/icon/index.js +8 -0
  75. package/dist/components/inputNumber/InputNumber.vue.js +112 -0
  76. package/dist/components/inputNumber/index.js +7 -0
  77. package/dist/components/inputNumber/uses.js +76 -0
  78. package/dist/components/loading/Loading.vue.js +78 -0
  79. package/dist/components/loading/index.js +7 -0
  80. package/dist/components/menu/Menu.vue.js +66 -0
  81. package/dist/components/menu/MenuItem.vue.js +125 -0
  82. package/dist/components/menu/index.js +7 -0
  83. package/dist/components/message/Message.vue.js +122 -0
  84. package/dist/components/message/index.js +16 -0
  85. package/dist/components/messageBox/MessageBox.vue.js +216 -0
  86. package/dist/components/messageBox/index.js +13 -0
  87. package/dist/components/notification/Notification.vue.js +140 -0
  88. package/dist/components/notification/index.js +23 -0
  89. package/dist/components/pagination/Pagination.vue.js +215 -0
  90. package/dist/components/pagination/index.js +7 -0
  91. package/dist/components/pagination/pageButton.vue.js +35 -0
  92. package/dist/components/progress/Progress.vue.js +88 -0
  93. package/dist/components/progress/index.js +7 -0
  94. package/dist/components/radio/Radio.vue.js +75 -0
  95. package/dist/components/radio/index.js +7 -0
  96. package/dist/components/radioGroup/RadioGroup.vue.js +37 -0
  97. package/dist/components/radioGroup/index.js +7 -0
  98. package/dist/components/scheduler/Scheduler.vue.js +128 -0
  99. package/dist/components/scheduler/index.js +7 -0
  100. package/dist/components/scheduler/uses.js +73 -0
  101. package/dist/components/select/Select.vue.js +381 -0
  102. package/dist/components/select/index.js +7 -0
  103. package/dist/components/select/uses.js +147 -0
  104. package/dist/components/slider/Slider.vue.js +243 -0
  105. package/dist/components/slider/index.js +7 -0
  106. package/dist/components/slider/uses.js +188 -0
  107. package/dist/components/tabPanel/TabPanel.vue.js +39 -0
  108. package/dist/components/tabPanel/index.js +7 -0
  109. package/dist/components/tabs/Tabs.vue.js +220 -0
  110. package/dist/components/tabs/index.js +7 -0
  111. package/dist/components/textField/TextField.vue.js +209 -0
  112. package/dist/components/textField/index.js +7 -0
  113. package/dist/components/timePicker/TimePicker.vue.js +227 -0
  114. package/dist/components/timePicker/index.js +7 -0
  115. package/dist/components/toggle/Toggle.vue.js +66 -0
  116. package/dist/components/toggle/index.js +7 -0
  117. package/dist/components/tree/Tree.vue.js +220 -0
  118. package/dist/components/tree/TreeNode.vue.js +146 -0
  119. package/dist/components/tree/index.js +7 -0
  120. package/dist/components/treeGrid/TreeGrid.vue.js +898 -0
  121. package/dist/components/treeGrid/TreeGridNode.vue.js +274 -0
  122. package/dist/components/treeGrid/TreeGridToolbar.vue.js +15 -0
  123. package/dist/components/treeGrid/index.js +7 -0
  124. package/dist/components/treeGrid/uses.js +497 -0
  125. package/dist/components/window/Window.vue.js +211 -0
  126. package/dist/components/window/index.js +7 -0
  127. package/dist/components/window/uses.js +345 -0
  128. package/dist/directives/clickoutside.js +47 -0
  129. package/dist/main.js +142 -0
  130. package/dist/package.json.js +4 -0
  131. package/dist/resolver.js +17 -0
  132. package/dist/style.css +1 -1
  133. package/package.json +56 -23
  134. package/dist/index.js +0 -21754
  135. package/dist/index.umd.cjs +0 -28
@@ -0,0 +1,86 @@
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
+ };
@@ -0,0 +1,345 @@
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
+ };
@@ -0,0 +1,43 @@
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
+ };