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.
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/common/utils.bignumber.js +23 -0
- package/dist/common/utils.debounce.js +66 -0
- package/dist/common/utils.js +64 -0
- package/dist/common/utils.throttle.js +15 -0
- package/dist/components/button/Button.vue.js +65 -0
- package/dist/components/button/index.js +7 -0
- package/dist/components/buttonGroup/ButtonGroup.vue.js +14 -0
- package/dist/components/buttonGroup/index.js +7 -0
- package/dist/components/calendar/Calendar.vue.js +299 -0
- package/dist/components/calendar/index.js +7 -0
- package/dist/components/calendar/uses.js +579 -0
- package/dist/components/chart/Chart.vue.js +261 -0
- package/dist/components/chart/ChartToolbar.vue.js +32 -0
- package/dist/components/chart/chart.core.js +738 -0
- package/dist/components/chart/chartZoom.core.js +221 -0
- package/dist/components/chart/element/element.bar.js +358 -0
- package/dist/components/chart/element/element.bar.time.js +55 -0
- package/dist/components/chart/element/element.heatmap.js +403 -0
- package/dist/components/chart/element/element.line.js +292 -0
- package/dist/components/chart/element/element.pie.js +73 -0
- package/dist/components/chart/element/element.scatter.js +209 -0
- package/dist/components/chart/element/element.tip.js +312 -0
- package/dist/components/chart/helpers/helpers.canvas.js +141 -0
- package/dist/components/chart/helpers/helpers.constant.js +253 -0
- package/dist/components/chart/helpers/helpers.util.js +265 -0
- package/dist/components/chart/index.js +7 -0
- package/dist/components/chart/model/index.js +6 -0
- package/dist/components/chart/model/model.series.js +82 -0
- package/dist/components/chart/model/model.store.js +650 -0
- package/dist/components/chart/plugins/plugins.interaction.js +823 -0
- package/dist/components/chart/plugins/plugins.legend.gradient.js +281 -0
- package/dist/components/chart/plugins/plugins.legend.js +665 -0
- package/dist/components/chart/plugins/plugins.pie.js +86 -0
- package/dist/components/chart/plugins/plugins.scrollbar.js +345 -0
- package/dist/components/chart/plugins/plugins.title.js +43 -0
- package/dist/components/chart/plugins/plugins.tooltip.js +508 -0
- package/dist/components/chart/scale/scale.js +492 -0
- package/dist/components/chart/scale/scale.linear.js +248 -0
- package/dist/components/chart/scale/scale.logarithmic.js +82 -0
- package/dist/components/chart/scale/scale.step.js +227 -0
- package/dist/components/chart/scale/scale.time.category.js +148 -0
- package/dist/components/chart/scale/scale.time.js +95 -0
- package/dist/components/chart/uses.js +479 -0
- package/dist/components/chartBrush/ChartBrush.vue.js +198 -0
- package/dist/components/chartBrush/chartBrush.core.js +265 -0
- package/dist/components/chartBrush/index.js +7 -0
- package/dist/components/chartBrush/uses.js +18 -0
- package/dist/components/chartGroup/ChartGroup.vue.js +128 -0
- package/dist/components/chartGroup/index.js +7 -0
- package/dist/components/chartGroup/uses.js +47 -0
- package/dist/components/checkbox/Checkbox.vue.js +99 -0
- package/dist/components/checkbox/index.js +7 -0
- package/dist/components/checkboxGroup/CheckboxGroup.vue.js +40 -0
- package/dist/components/checkboxGroup/index.js +7 -0
- package/dist/components/contextMenu/ContextMenu.vue.js +70 -0
- package/dist/components/contextMenu/MenuList.vue.js +105 -0
- package/dist/components/contextMenu/index.js +7 -0
- package/dist/components/contextMenu/uses.js +79 -0
- package/dist/components/datePicker/DatePicker.vue.js +310 -0
- package/dist/components/datePicker/index.js +7 -0
- package/dist/components/datePicker/uses.js +190 -0
- package/dist/components/grid/Grid.vue.js +1261 -0
- package/dist/components/grid/GridColumnSetting.vue.js +212 -0
- package/dist/components/grid/GridFilterSetting.vue.js +222 -0
- package/dist/components/grid/GridPagination.vue.js +69 -0
- package/dist/components/grid/GridSummary.vue.js +186 -0
- package/dist/components/grid/GridToolbar.vue.js +15 -0
- package/dist/components/grid/icon/icon-option-button.vue.js +39 -0
- package/dist/components/grid/icon/icon-sort-button.vue.js +56 -0
- package/dist/components/grid/index.js +7 -0
- package/dist/components/grid/uses.js +697 -0
- package/dist/components/icon/Icon.vue.js +50 -0
- package/dist/components/icon/index.js +8 -0
- package/dist/components/inputNumber/InputNumber.vue.js +112 -0
- package/dist/components/inputNumber/index.js +7 -0
- package/dist/components/inputNumber/uses.js +76 -0
- package/dist/components/loading/Loading.vue.js +78 -0
- package/dist/components/loading/index.js +7 -0
- package/dist/components/menu/Menu.vue.js +66 -0
- package/dist/components/menu/MenuItem.vue.js +125 -0
- package/dist/components/menu/index.js +7 -0
- package/dist/components/message/Message.vue.js +122 -0
- package/dist/components/message/index.js +16 -0
- package/dist/components/messageBox/MessageBox.vue.js +216 -0
- package/dist/components/messageBox/index.js +13 -0
- package/dist/components/notification/Notification.vue.js +140 -0
- package/dist/components/notification/index.js +23 -0
- package/dist/components/pagination/Pagination.vue.js +215 -0
- package/dist/components/pagination/index.js +7 -0
- package/dist/components/pagination/pageButton.vue.js +35 -0
- package/dist/components/progress/Progress.vue.js +88 -0
- package/dist/components/progress/index.js +7 -0
- package/dist/components/radio/Radio.vue.js +75 -0
- package/dist/components/radio/index.js +7 -0
- package/dist/components/radioGroup/RadioGroup.vue.js +37 -0
- package/dist/components/radioGroup/index.js +7 -0
- package/dist/components/scheduler/Scheduler.vue.js +128 -0
- package/dist/components/scheduler/index.js +7 -0
- package/dist/components/scheduler/uses.js +73 -0
- package/dist/components/select/Select.vue.js +381 -0
- package/dist/components/select/index.js +7 -0
- package/dist/components/select/uses.js +147 -0
- package/dist/components/slider/Slider.vue.js +243 -0
- package/dist/components/slider/index.js +7 -0
- package/dist/components/slider/uses.js +188 -0
- package/dist/components/tabPanel/TabPanel.vue.js +39 -0
- package/dist/components/tabPanel/index.js +7 -0
- package/dist/components/tabs/Tabs.vue.js +220 -0
- package/dist/components/tabs/index.js +7 -0
- package/dist/components/textField/TextField.vue.js +209 -0
- package/dist/components/textField/index.js +7 -0
- package/dist/components/timePicker/TimePicker.vue.js +227 -0
- package/dist/components/timePicker/index.js +7 -0
- package/dist/components/toggle/Toggle.vue.js +66 -0
- package/dist/components/toggle/index.js +7 -0
- package/dist/components/tree/Tree.vue.js +220 -0
- package/dist/components/tree/TreeNode.vue.js +146 -0
- package/dist/components/tree/index.js +7 -0
- package/dist/components/treeGrid/TreeGrid.vue.js +898 -0
- package/dist/components/treeGrid/TreeGridNode.vue.js +274 -0
- package/dist/components/treeGrid/TreeGridToolbar.vue.js +15 -0
- package/dist/components/treeGrid/index.js +7 -0
- package/dist/components/treeGrid/uses.js +497 -0
- package/dist/components/window/Window.vue.js +211 -0
- package/dist/components/window/index.js +7 -0
- package/dist/components/window/uses.js +345 -0
- package/dist/directives/clickoutside.js +47 -0
- package/dist/main.js +142 -0
- package/dist/package.json.js +4 -0
- package/dist/resolver.js +17 -0
- package/dist/style.css +1 -1
- package/package.json +56 -23
- package/dist/index.js +0 -21754
- package/dist/index.umd.cjs +0 -28
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import L from "dayjs";
|
|
2
|
+
import { TIME_INTERVALS as I } from "../helpers/helpers.constant.js";
|
|
3
|
+
import it from "./scale.js";
|
|
4
|
+
import M from "../helpers/helpers.util.js";
|
|
5
|
+
class rt extends it {
|
|
6
|
+
constructor(i, e, o, c, h) {
|
|
7
|
+
super(i, e, o), this.labels = c, this.options = h;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Transforming label by designated format
|
|
11
|
+
* @param {number} value label value
|
|
12
|
+
* @param {object} data data for formatting
|
|
13
|
+
*
|
|
14
|
+
* @returns {string} formatted label
|
|
15
|
+
*/
|
|
16
|
+
getLabelFormat(i, e = {}) {
|
|
17
|
+
if (this.formatter) {
|
|
18
|
+
const o = this.formatter(i, e);
|
|
19
|
+
if (typeof o == "string")
|
|
20
|
+
return o;
|
|
21
|
+
}
|
|
22
|
+
return L(i).format(this.timeFormat);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Calculate interval
|
|
26
|
+
* @param {object} range range information
|
|
27
|
+
*
|
|
28
|
+
* @returns {number} interval
|
|
29
|
+
*/
|
|
30
|
+
getInterval(i) {
|
|
31
|
+
const e = i.maxValue, o = i.minValue, c = i.maxSteps;
|
|
32
|
+
if (this.interval) {
|
|
33
|
+
if (typeof this.interval == "string")
|
|
34
|
+
return I[this.interval].size;
|
|
35
|
+
if (typeof this.interval == "object")
|
|
36
|
+
return this.interval.time * I[this.interval.unit].size;
|
|
37
|
+
if (typeof this.interval == "number")
|
|
38
|
+
return this.interval;
|
|
39
|
+
}
|
|
40
|
+
return Math.ceil((e - o) / c);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* With range information, calculate how many labels in axis
|
|
44
|
+
* @param {object} range min/max information
|
|
45
|
+
*
|
|
46
|
+
* @returns {object} steps, interval, min/max graph value
|
|
47
|
+
*/
|
|
48
|
+
calculateSteps(i) {
|
|
49
|
+
const { maxValue: e, minValue: o, maxSteps: c } = i, h = this.getInterval(i);
|
|
50
|
+
let t = h, m = o, l;
|
|
51
|
+
for (; m < e; )
|
|
52
|
+
m += t;
|
|
53
|
+
const d = m > e ? e : m, u = o, f = d - u;
|
|
54
|
+
l = Math.round(f / t) + 1;
|
|
55
|
+
const C = l;
|
|
56
|
+
for (e === 1 && (t = 0.2, l = 5); l > c; )
|
|
57
|
+
t *= 2, l = Math.round(f / t), t = Math.ceil(f / l);
|
|
58
|
+
return d - u > l * t && (t = Math.ceil((d - u) / l)), {
|
|
59
|
+
steps: l,
|
|
60
|
+
oriSteps: C,
|
|
61
|
+
interval: t,
|
|
62
|
+
rawInterval: h,
|
|
63
|
+
graphMin: u,
|
|
64
|
+
graphMax: d
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Draw axis
|
|
69
|
+
* @param {object} chartRect min/max information
|
|
70
|
+
* @param {object} labelOffset label offset information
|
|
71
|
+
* @param {object} stepInfo label steps information
|
|
72
|
+
*
|
|
73
|
+
* @returns {undefined}
|
|
74
|
+
*/
|
|
75
|
+
draw(i, e, o, c, h) {
|
|
76
|
+
var O, B, E, j, R, _, N, H, K, U, X, q, D, J, Q, Y;
|
|
77
|
+
const t = this.ctx, m = this.labels, l = {
|
|
78
|
+
x1: i.x1 + e.left,
|
|
79
|
+
x2: i.x2 - e.right,
|
|
80
|
+
y1: i.y1 + e.top,
|
|
81
|
+
y2: i.y2 - e.bottom
|
|
82
|
+
}, d = o.steps, u = o.graphMin, f = o.graphMax, C = o.rawInterval, a = o.oriSteps;
|
|
83
|
+
let g = l[this.units.rectStart];
|
|
84
|
+
const G = l[this.units.rectEnd], s = l[this.units.rectOffset(this.position)], F = l[this.units.rectOffsetCounter(this.position)], z = 5;
|
|
85
|
+
this.drawAxisTitle(i, e), t.font = M.getLabelStyle(this.labelStyle), this.type === "x" ? (t.textAlign = "center", t.textBaseline = this.position === "top" ? "bottom" : "top") : (t.textAlign = this.position === "left" ? "right" : "left", t.textBaseline = "middle"), t.fillStyle = this.labelStyle.color, t.lineWidth = this.axisLineWidth;
|
|
86
|
+
const T = M.aliasPixel(t.lineWidth);
|
|
87
|
+
if (t.beginPath(), t.strokeStyle = this.axisLineColor, this.type === "x" ? (t.moveTo(g, s + T), t.lineTo(G, s + T)) : (t.moveTo(s + T, g), t.lineTo(s + T, G)), t.stroke(), t.closePath(), d === 0 || u === null)
|
|
88
|
+
return;
|
|
89
|
+
const V = this.labelStyle.alignToGridLine, A = (G - g) / (a || 1);
|
|
90
|
+
this.categoryMode && !V && (g += Math.ceil(A / 2) - 2);
|
|
91
|
+
const S = [];
|
|
92
|
+
let x = null, n = null;
|
|
93
|
+
t.beginPath(), t.strokeStyle = this.gridLineColor;
|
|
94
|
+
let b, y, r, k = d <= 2 ? a : Math.round(a / d);
|
|
95
|
+
const v = g > Math.ceil(l[this.units.rectStart]);
|
|
96
|
+
this.type === "x" && v && k === a && (k = 1);
|
|
97
|
+
const tt = k === a ? a : a - 1;
|
|
98
|
+
for (r = 0; r <= tt; r += k) {
|
|
99
|
+
S[r] = L(u).valueOf() + r * C, x = Math.round(g + A * r), n = x + T;
|
|
100
|
+
let P;
|
|
101
|
+
for (let p = 0; p < S.length; p++)
|
|
102
|
+
S[p] !== void 0 && p !== r && (P = S[p]);
|
|
103
|
+
b = this.getLabelFormat(Math.min(f, S[r]), { prev: P });
|
|
104
|
+
const w = ((B = (O = this.options) == null ? void 0 : O.selectLabel) == null ? void 0 : B.use) && ((j = (E = this.options) == null ? void 0 : E.selectLabel) == null ? void 0 : j.useLabelOpacity) && this.options.horizontal === (this.type === "y") && ((R = h == null ? void 0 : h.dataIndex) == null ? void 0 : R.length) && !(h != null && h.label.map(
|
|
105
|
+
(p) => this.getLabelFormat(Math.min(f, p), {
|
|
106
|
+
prev: P
|
|
107
|
+
})
|
|
108
|
+
).includes(b)), W = this.labelStyle.color;
|
|
109
|
+
let Z = 1;
|
|
110
|
+
if (M.getColorStringType(W) === "RGBA" && (Z = M.getOpacity(W)), t.fillStyle = M.colorStringToRgba(
|
|
111
|
+
W,
|
|
112
|
+
w ? (_ = this.options) == null ? void 0 : _.unSelectedOpacity : Z
|
|
113
|
+
), this.type === "x") {
|
|
114
|
+
if (y = this.position === "top" ? s - 10 : s + 10, t.fillText(this.checkFixWidth(b), x, y), !w && ((H = (N = this.options) == null ? void 0 : N.selectItem) != null && H.showLabelTip) && (c != null && c.label) && !((K = this.options) != null && K.horizontal)) {
|
|
115
|
+
const p = this.getLabelFormat(
|
|
116
|
+
Math.min(f, c.label + 0 * C)
|
|
117
|
+
);
|
|
118
|
+
if (p === b) {
|
|
119
|
+
const $ = Math.round(t.measureText((U = this.labelStyle) == null ? void 0 : U.fontSize).width);
|
|
120
|
+
M.showLabelTip({
|
|
121
|
+
ctx: this.ctx,
|
|
122
|
+
width: Math.round(t.measureText(p).width) + 10,
|
|
123
|
+
height: $,
|
|
124
|
+
x,
|
|
125
|
+
y: y + ($ - 2),
|
|
126
|
+
borderRadius: 2,
|
|
127
|
+
arrowSize: 3,
|
|
128
|
+
text: b,
|
|
129
|
+
backgroundColor: (D = (q = (X = this.options) == null ? void 0 : X.selectItem) == null ? void 0 : q.labelTipStyle) == null ? void 0 : D.backgroundColor,
|
|
130
|
+
textColor: (Y = (Q = (J = this.options) == null ? void 0 : J.selectItem) == null ? void 0 : Q.labelTipStyle) == null ? void 0 : Y.textColor
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
this.showAxisTick && (t.beginPath(), t.strokeStyle = this.axisLineColor, t.moveTo(n, s), t.lineTo(n, s + z), t.stroke(), t.closePath()), r < a && this.showGrid && (v || !v && r !== 0) && (t.beginPath(), t.strokeStyle = this.gridLineColor, t.moveTo(n, s), t.lineTo(n, F), t.stroke(), t.closePath());
|
|
135
|
+
} else
|
|
136
|
+
y = this.position === "left" ? s - 10 : s + 10, t.fillText(this.checkFixWidth(b), y, x), this.showAxisTick && (t.beginPath(), t.strokeStyle = this.axisLineColor, t.moveTo(s + (this.axisLineWidth ?? 1), n), t.lineTo(s - z, n), t.stroke(), t.closePath()), r < a && this.showGrid && (v || !v && r !== 0) && (t.beginPath(), t.strokeStyle = this.gridLineColor, t.moveTo(s, n), t.lineTo(F, n), t.stroke(), t.closePath());
|
|
137
|
+
t.stroke();
|
|
138
|
+
}
|
|
139
|
+
if (this.categoryMode && V && r * k === a) {
|
|
140
|
+
const P = L(m[1]).diff(L(m[0])), w = this.getLabelFormat(L(S[a - 1] + P));
|
|
141
|
+
x = Math.round(g + A * a), n = x + T, this.type === "x" ? (t.fillText(this.checkFixWidth(w), x, y), this.showGrid && (t.moveTo(n, s), t.lineTo(n, F))) : (t.fillText(this.checkFixWidth(w), y, x), this.showGrid && (t.moveTo(s, n), t.lineTo(F, n))), t.stroke();
|
|
142
|
+
}
|
|
143
|
+
t.closePath();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
rt as default
|
|
148
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import d from "dayjs";
|
|
2
|
+
import { TIME_INTERVALS as v } from "../helpers/helpers.constant.js";
|
|
3
|
+
import x from "./scale.js";
|
|
4
|
+
class j extends x {
|
|
5
|
+
/**
|
|
6
|
+
* Transforming label by designated format
|
|
7
|
+
* @param {number} value label value
|
|
8
|
+
* @param {object} data data for formatting
|
|
9
|
+
*
|
|
10
|
+
* @returns {string} formatted label
|
|
11
|
+
*/
|
|
12
|
+
getLabelFormat(t, l = {}) {
|
|
13
|
+
if (this.formatter) {
|
|
14
|
+
const r = this.formatter(t, l);
|
|
15
|
+
if (typeof r == "string")
|
|
16
|
+
return r;
|
|
17
|
+
}
|
|
18
|
+
return d(t).format(this.timeFormat);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Calculate interval
|
|
22
|
+
* @param {object} range range information
|
|
23
|
+
*
|
|
24
|
+
* @returns {number} interval
|
|
25
|
+
*/
|
|
26
|
+
getInterval(t) {
|
|
27
|
+
const l = t.maxValue, r = t.minValue, p = t.maxSteps;
|
|
28
|
+
if (this.interval) {
|
|
29
|
+
if (typeof this.interval == "string")
|
|
30
|
+
return v[this.interval].size;
|
|
31
|
+
if (typeof this.interval == "object")
|
|
32
|
+
return this.interval.time * v[this.interval.unit].size;
|
|
33
|
+
if (typeof this.interval == "number")
|
|
34
|
+
return this.interval;
|
|
35
|
+
}
|
|
36
|
+
return Math.ceil((l - r) / p);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* With range information, calculate how many labels in axis
|
|
40
|
+
* time axis는 interval 없이 range만 사용하는 것을 지원하지 않음
|
|
41
|
+
* @param {object} range min/max information
|
|
42
|
+
*
|
|
43
|
+
* @returns {object} steps, interval, min/max graph value
|
|
44
|
+
*/
|
|
45
|
+
calculateSteps(t) {
|
|
46
|
+
const { maxValue: l, minValue: r } = t, p = Math.max(1, t.maxSteps ?? 1), g = Array.isArray(this.range) && this.range.length === 2, c = typeof this.interval == "number" || typeof this.interval == "object" && this.interval !== null ? this.getInterval(t) : null, u = c != null && c > 0 && Number.isFinite(c), M = 1e-10, n = +r;
|
|
47
|
+
let i = +l;
|
|
48
|
+
if (g && u) {
|
|
49
|
+
const e = c, s = (i - n) / e;
|
|
50
|
+
if (Math.abs(s - Math.round(s)) < M && this.fixedSteps)
|
|
51
|
+
return {
|
|
52
|
+
steps: Math.round(s),
|
|
53
|
+
interval: e,
|
|
54
|
+
graphMin: n,
|
|
55
|
+
graphMax: i
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (u) {
|
|
59
|
+
const e = i - n;
|
|
60
|
+
let h = c, s = Math.ceil(e / h);
|
|
61
|
+
for (; s > p; )
|
|
62
|
+
h *= 2, s = Math.ceil(e / h);
|
|
63
|
+
return i = n + h * s, {
|
|
64
|
+
steps: s,
|
|
65
|
+
interval: h,
|
|
66
|
+
graphMin: n,
|
|
67
|
+
graphMax: i
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
let a = this.getInterval(t), f = r;
|
|
71
|
+
for (; f < l; )
|
|
72
|
+
f += a;
|
|
73
|
+
i = f;
|
|
74
|
+
const m = i - n;
|
|
75
|
+
let o = Math.round(m / a);
|
|
76
|
+
for (; o > p; ) {
|
|
77
|
+
a *= 2, o = Math.round(m / a);
|
|
78
|
+
const e = m / o;
|
|
79
|
+
a = this.decimalPoint ? e : Math.ceil(e);
|
|
80
|
+
}
|
|
81
|
+
if (m > o * a) {
|
|
82
|
+
const e = m / o;
|
|
83
|
+
a = this.decimalPoint ? e : Math.ceil(e);
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
steps: o,
|
|
87
|
+
interval: a,
|
|
88
|
+
graphMin: n,
|
|
89
|
+
graphMax: i
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
j as default
|
|
95
|
+
};
|