evui 3.4.214 → 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/package.json +11 -5
- package/dist/index.js +0 -22966
- package/dist/index.umd.cjs +0 -28
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { throttle as E, debounce as X } from "lodash-es";
|
|
2
|
+
const n = {
|
|
3
|
+
WHEEL: {
|
|
4
|
+
UP: "MOVEUP_WHEEL",
|
|
5
|
+
DOWN: "MOVEDOWN_WHEEL"
|
|
6
|
+
},
|
|
7
|
+
GRAB: {
|
|
8
|
+
UP: "MOVEUP_GRAB",
|
|
9
|
+
DOWN: "MOVEDOWN_GRAB"
|
|
10
|
+
},
|
|
11
|
+
BUTTON: {
|
|
12
|
+
INCREASE: "INCREASE",
|
|
13
|
+
DECREASE: "DECREASE"
|
|
14
|
+
}
|
|
15
|
+
}, a = {
|
|
16
|
+
LEFT: "leftX",
|
|
17
|
+
RIGHT: "rightX"
|
|
18
|
+
};
|
|
19
|
+
class T {
|
|
20
|
+
constructor(s, e, i, t, h) {
|
|
21
|
+
this.evChart = s, this.evChartBrushOptions = i, this.evChartBrushRef = h, this.evChartData = e, this.brushIdx = t, i.value.useDebounce && (this.debounceBrushIdx = { start: t.start, end: t.end });
|
|
22
|
+
}
|
|
23
|
+
init(s) {
|
|
24
|
+
var e;
|
|
25
|
+
if (this.brushIdx.start > this.brushIdx.end) {
|
|
26
|
+
this.removeBrushCanvas();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if ((e = this.evChartBrushRef) != null && e.value) {
|
|
30
|
+
const i = this.evChartBrushRef.value.querySelector(".brush-canvas");
|
|
31
|
+
if (i)
|
|
32
|
+
this.drawBrushRect({ brushCanvas: i, isResize: s });
|
|
33
|
+
else {
|
|
34
|
+
const t = document.createElement("canvas");
|
|
35
|
+
t.setAttribute("class", "brush-canvas"), t.setAttribute("style", "display: block; z-index: 1;");
|
|
36
|
+
const h = this.evChartBrushRef.value.querySelector(
|
|
37
|
+
".ev-chart-brush-container"
|
|
38
|
+
);
|
|
39
|
+
h && (this.brushCanvas = t, h.appendChild(t), this.evChartBrushContainer = h, this.drawBrushRect({ brushCanvas: t }), this.addEvent(t));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
drawBrushRect({ brushCanvas: s, isResize: e, isDebounce: i, mode: t, offsetX: h }) {
|
|
44
|
+
const { chartRect: r, labelOffset: o } = this.evChart;
|
|
45
|
+
if (!r && !o)
|
|
46
|
+
return;
|
|
47
|
+
const d = this.evChartData.value.labels.length - 1;
|
|
48
|
+
this.labelEndIdx = d;
|
|
49
|
+
const u = {
|
|
50
|
+
x1: r.x1 + o.left,
|
|
51
|
+
x2: r.x2 - o.right,
|
|
52
|
+
y1: r.y1 + o.top,
|
|
53
|
+
y2: r.y2 - o.bottom
|
|
54
|
+
}, c = this.setCanvasWidthHeight(u, s);
|
|
55
|
+
if (!(e && this.isEqualWidth) && d >= 0) {
|
|
56
|
+
const b = this.setBrushXAndWidth(c, h, i, t);
|
|
57
|
+
c && b && this.drawBrush(c, b, u, s);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
setCanvasWidthHeight(s, e) {
|
|
61
|
+
const t = s.x2 - s.x1 + 6, h = s.y2 - s.y1, r = (s.x2 - s.x1) / this.labelEndIdx, o = window.devicePixelRatio || 1;
|
|
62
|
+
return this.isEqualWidth = e.width === Math.floor(t * o), {
|
|
63
|
+
brushButtonWidth: 6,
|
|
64
|
+
brushCanvasHeight: h,
|
|
65
|
+
brushCanvasWidth: t,
|
|
66
|
+
axesXInterval: r,
|
|
67
|
+
pixelRatio: o
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
setBrushXAndWidth(s, e = 0, i, t) {
|
|
71
|
+
const { brushButtonWidth: h, brushCanvasWidth: r, axesXInterval: o, pixelRatio: d } = s;
|
|
72
|
+
!i && this.debounceBrushIdx && (this.debounceBrushIdx.start = this.brushIdx.start, this.debounceBrushIdx.end = this.brushIdx.end);
|
|
73
|
+
const u = this.debounceBrushIdx ?? this.brushIdx;
|
|
74
|
+
switch (t) {
|
|
75
|
+
case n.BUTTON.INCREASE:
|
|
76
|
+
case n.BUTTON.DECREASE:
|
|
77
|
+
this.brushRectWidth = r * d, this.curBrushButtonType === a.LEFT ? (this.brushRectWidth = this.beforeBrushRectWidth ? this.beforeBrushRectWidth - e : this.brushRectWidth - e, this.brushRectWidth <= h ? this.brushRectWidth = h : (this.brushRectX = e * d, this.beforeBrushRectX = this.brushRectX)) : this.curBrushButtonType === a.RIGHT && (this.brushRectWidth = e - this.beforeBrushRectX, this.brushRectWidth <= h ? this.brushRectWidth = h : (this.brushRectX = this.beforeBrushRectX, this.beforeBrushRectWidth = this.brushRectWidth + this.brushRectX));
|
|
78
|
+
break;
|
|
79
|
+
case n.GRAB.UP:
|
|
80
|
+
case n.GRAB.DOWN:
|
|
81
|
+
this.brushRectX <= 0 && t === n.GRAB.DOWN || this.brushRectX + this.brushRectWidth >= r && t === n.GRAB.UP ? this.offsetXAndRectXInterval = null : (this.offsetXAndRectXInterval || (this.offsetXAndRectXInterval = e - this.brushRectX), this.brushRectX = e - this.offsetXAndRectXInterval);
|
|
82
|
+
break;
|
|
83
|
+
default:
|
|
84
|
+
e || (this.brushRectX = u.start * o * d, this.brushRectWidth = (r - (this.labelEndIdx - (u.end - u.start)) * o) * d, this.beforeBrushRectX = this.brushRectX, this.beforeBrushRectWidth = this.brushRectWidth + this.brushRectX);
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
brushRectX: this.brushRectX,
|
|
89
|
+
brushRectWidth: this.brushRectWidth
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
drawBrush(s, e, i, t) {
|
|
93
|
+
const { brushButtonWidth: h, brushCanvasHeight: r, brushCanvasWidth: o, axesXInterval: d, pixelRatio: u } = s, { brushRectX: c, brushRectWidth: b } = e, {
|
|
94
|
+
height: v,
|
|
95
|
+
selection: { fillColor: x, opacity: R }
|
|
96
|
+
} = this.evChartBrushOptions.value, f = v - i.y1, B = c, I = c + b;
|
|
97
|
+
t.style.position || (t.style.position = "absolute", t.style.top = `${i.y1}px`, t.style.left = `${i.x1 - h / 2}px`), this.isEqualWidth || (t.width = o * u, t.style.width = `${o}px`, t.height = r * u, t.style.height = `${r}px`);
|
|
98
|
+
const l = t.getContext("2d");
|
|
99
|
+
l.clearRect(0, 0, o * u, r * u), l.fillStyle = x, l.globalAlpha = R, l.fillRect(c, 0, b, f), l.fillRect(B, 0, h, f), l.fillRect(I - h, 0, h, f), this.brushPosInfo = {
|
|
100
|
+
leftX: B / u,
|
|
101
|
+
rightX: I / u,
|
|
102
|
+
buttonWidth: h,
|
|
103
|
+
axesXInterval: d,
|
|
104
|
+
...s,
|
|
105
|
+
...e
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
addEvent() {
|
|
109
|
+
let s;
|
|
110
|
+
this.onMouseDown = (t) => {
|
|
111
|
+
t.preventDefault(), s.isInsideButton ? this.clickBrushInsideX = -1 : s.isInsideBrush ? this.clickBrushInsideX = t.offsetX : s.isOutsideBrush && this.teleportBrush(t);
|
|
112
|
+
};
|
|
113
|
+
const e = (t) => {
|
|
114
|
+
this.clickBrushInsideX ? this.mouseDownAndMove(t) : (s = this.getMousePosition(t), this.changeCursor(s));
|
|
115
|
+
};
|
|
116
|
+
this.onMouseMove = E(e, 5), this.onWheel = (t) => {
|
|
117
|
+
t.preventDefault();
|
|
118
|
+
const h = t.deltaY > 0 ? n.WHEEL.DOWN : n.WHEEL.UP;
|
|
119
|
+
this.updateBrushIdx(h), this.debounceBrushIdx && this.drawBrushRect({
|
|
120
|
+
brushCanvas: this.brushCanvas,
|
|
121
|
+
isDebounce: !0,
|
|
122
|
+
mode: h
|
|
123
|
+
}), this.brushIdx.isUseScroll = !0;
|
|
124
|
+
}, this.onMouseUp = () => {
|
|
125
|
+
this.initEventState();
|
|
126
|
+
}, this.onMouseLeave = () => {
|
|
127
|
+
this.clickBrushInsideX && this.initEventState();
|
|
128
|
+
};
|
|
129
|
+
const i = () => {
|
|
130
|
+
this.initEventState();
|
|
131
|
+
};
|
|
132
|
+
this.onWheelDebounce = X(i, 100), this.setEventListener("addEventListener");
|
|
133
|
+
}
|
|
134
|
+
getMousePosition(s) {
|
|
135
|
+
const e = (u) => Math.abs(this.brushPosInfo[u] - s.offsetX), i = e(a.RIGHT) > e(a.LEFT) ? a.LEFT : a.RIGHT, t = (u) => s.offsetX > this.brushPosInfo[u], h = (u) => s.offsetX < this.brushPosInfo[u], r = h(a.LEFT) || t(a.RIGHT), o = t(a.LEFT) && h(a.RIGHT), d = s.offsetX + this.brushPosInfo.buttonWidth >= this.brushPosInfo[i] && s.offsetX - this.brushPosInfo.buttonWidth <= this.brushPosInfo[i];
|
|
136
|
+
return this.curBrushButtonType = d && i, {
|
|
137
|
+
isInsideButton: d,
|
|
138
|
+
isInsideBrush: o,
|
|
139
|
+
isOutsideBrush: r
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
destroy() {
|
|
143
|
+
if (this.brushCanvas && (this.setEventListener("removeEventListener"), this.brushCanvas = null), this.evChartBrushContainer) {
|
|
144
|
+
const s = this.evChartBrushContainer;
|
|
145
|
+
for (; s.hasChildNodes(); )
|
|
146
|
+
s.removeChild(s.firstChild);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* @param {string} type eventListener setting type.
|
|
151
|
+
*
|
|
152
|
+
* @returns {undefined}
|
|
153
|
+
*/
|
|
154
|
+
setEventListener(s) {
|
|
155
|
+
this.brushCanvas[s]("mousemove", this.onMouseMove), this.brushCanvas[s]("mousedown", this.onMouseDown), this.brushCanvas[s]("mouseup", this.onMouseUp), this.brushCanvas[s]("mouseleave", this.onMouseLeave), this.evChartBrushOptions.value.useWheelMove && (this.brushCanvas[s]("wheel", this.onWheel), this.brushCanvas[s]("wheel", this.onWheelDebounce));
|
|
156
|
+
}
|
|
157
|
+
removeBrushWrapper() {
|
|
158
|
+
if (this.evChartBrushRef.value) {
|
|
159
|
+
const s = this.evChartBrushRef.value.querySelector(".ev-chart-brush-wrapper");
|
|
160
|
+
s && this.evChartBrushRef.value.removeChild(s);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
removeBrushCanvas() {
|
|
164
|
+
if (this.evChartBrushContainer) {
|
|
165
|
+
const s = this.evChartBrushContainer.querySelector(".brush-canvas");
|
|
166
|
+
s && this.evChartBrushContainer.removeChild(s);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
teleportBrush(s) {
|
|
170
|
+
const e = this.debounceBrushIdx ?? this.brushIdx, i = (e.end - e.start) / 2;
|
|
171
|
+
let t, h, r;
|
|
172
|
+
i > 0.5 ? (e.end - e.start) % 2 === 0 ? (r = Math.round(s.offsetX / this.brushPosInfo.axesXInterval), t = Math.ceil(i), h = Math.floor(i)) : (r = Math.ceil(s.offsetX / this.brushPosInfo.axesXInterval), t = Math.ceil(i), h = Math.floor(i)) : (r = Math.floor(s.offsetX / this.brushPosInfo.axesXInterval), s.offsetX - r * this.brushPosInfo.axesXInterval > this.brushPosInfo.axesXInterval / 2 ? (t = Math.floor(i), h = Math.ceil(i)) : (t = Math.ceil(i), h = Math.floor(i), i < 1 && (r += 1))), r - t <= 0 ? (e.start = 0, e.end = h + t) : r + h >= this.labelEndIdx ? (e.start = this.labelEndIdx - h - t, e.end = this.labelEndIdx) : (e.start = r - t, e.end = r + h), this.brushIdx.isUseScroll = !0;
|
|
173
|
+
}
|
|
174
|
+
changeCursor(s) {
|
|
175
|
+
s.isOutsideBrush ? this.brushCanvas.style.cursor = "pointer" : s.isInsideBrush && (s.isInsideButton ? this.brushCanvas.style.cursor = "ew-resize" : this.brushCanvas.style.cursor = "grab");
|
|
176
|
+
}
|
|
177
|
+
mouseDownAndMove(s) {
|
|
178
|
+
const e = this.debounceBrushIdx ? 0 : this.brushPosInfo.axesXInterval / 3;
|
|
179
|
+
let i;
|
|
180
|
+
s.offsetX > this.beforeMouseXPos ? this.clickBrushInsideX > 0 ? this.clickBrushInsideX < s.offsetX - e && (i = n.GRAB.UP, this.isUseBrushGrab = !0, this.brushIdx.isUseScroll = !0, this.clickBrushInsideX = s.offsetX + e) : s.offsetX - this.brushPosInfo[this.curBrushButtonType] > e && (i = this.curBrushButtonType === a.LEFT ? n.BUTTON.DECREASE : n.BUTTON.INCREASE, this.brushIdx.isUseButton = !0) : s.offsetX < this.beforeMouseXPos && (this.clickBrushInsideX > 0 ? this.clickBrushInsideX > s.offsetX + e && (i = n.GRAB.DOWN, this.isUseBrushGrab = !0, this.brushIdx.isUseScroll = !0, this.clickBrushInsideX = s.offsetX - e) : this.brushPosInfo[this.curBrushButtonType] - s.offsetX > e && (i = this.curBrushButtonType === a.LEFT ? n.BUTTON.INCREASE : n.BUTTON.DECREASE, this.brushIdx.isUseButton = !0)), this.debounceBrushIdx ? this.drawBrushRect({
|
|
181
|
+
brushCanvas: this.brushCanvas,
|
|
182
|
+
isDebounce: !0,
|
|
183
|
+
mode: i,
|
|
184
|
+
offsetX: s.offsetX
|
|
185
|
+
}) : this.updateBrushIdx(i), this.beforeMouseXPos = s.offsetX;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* @param {string} mode determines how to update the brush index value.
|
|
189
|
+
*
|
|
190
|
+
* @returns {undefined}
|
|
191
|
+
*/
|
|
192
|
+
updateBrushIdx(s) {
|
|
193
|
+
const e = this.debounceBrushIdx ?? this.brushIdx;
|
|
194
|
+
switch (s) {
|
|
195
|
+
case n.WHEEL.UP:
|
|
196
|
+
case n.GRAB.UP:
|
|
197
|
+
if (e.end >= this.labelEndIdx)
|
|
198
|
+
return;
|
|
199
|
+
e.start += 1, e.end += 1;
|
|
200
|
+
break;
|
|
201
|
+
case n.WHEEL.DOWN:
|
|
202
|
+
case n.GRAB.DOWN:
|
|
203
|
+
if (e.start <= 0)
|
|
204
|
+
return;
|
|
205
|
+
e.start -= 1, e.end -= 1;
|
|
206
|
+
break;
|
|
207
|
+
case n.BUTTON.INCREASE:
|
|
208
|
+
if (this.curBrushButtonType === a.LEFT) {
|
|
209
|
+
if (!e.start)
|
|
210
|
+
return;
|
|
211
|
+
e.start -= 1;
|
|
212
|
+
} else {
|
|
213
|
+
if (e.end === this.labelEndIdx)
|
|
214
|
+
return;
|
|
215
|
+
e.end += 1;
|
|
216
|
+
}
|
|
217
|
+
break;
|
|
218
|
+
case n.BUTTON.DECREASE:
|
|
219
|
+
if (e.start === e.end - 1)
|
|
220
|
+
return;
|
|
221
|
+
this.curBrushButtonType === a.LEFT ? e.start += 1 : e.end -= 1;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
updateBrushIdxUseXPos() {
|
|
226
|
+
if (!this.debounceBrushIdx)
|
|
227
|
+
return;
|
|
228
|
+
const s = () => {
|
|
229
|
+
let t, h;
|
|
230
|
+
if (this.brushPosInfo) {
|
|
231
|
+
const { brushRectX: r, brushRectWidth: o, brushCanvasWidth: d, axesXInterval: u } = this.brushPosInfo;
|
|
232
|
+
if (this.brushIdx.isUseButton || this.isUseBrushGrab) {
|
|
233
|
+
if (t = r / u, h = this.labelEndIdx - (d - (r + o)) / u, this.curBrushButtonType === a.LEFT ? (t = Math.round(t), h = this.brushIdx.end, t === h && (t -= 1)) : this.curBrushButtonType === a.RIGHT ? (t = this.brushIdx.start, h = Math.round(h), t === h && (h += 1)) : (t = Math.round(t), h = Math.round(h)), h > this.labelEndIdx) {
|
|
234
|
+
const c = h - this.labelEndIdx;
|
|
235
|
+
t -= c, h -= c;
|
|
236
|
+
}
|
|
237
|
+
if (t < 0) {
|
|
238
|
+
const c = Math.abs(t);
|
|
239
|
+
t = 0, h += c;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
brushStartIdx: t,
|
|
245
|
+
brushEndIdx: h
|
|
246
|
+
};
|
|
247
|
+
}, { brushStartIdx: e, brushEndIdx: i } = s();
|
|
248
|
+
this.brushIdx.start === e && this.brushIdx.end === i && this.drawBrushRect({ brushCanvas: this.brushCanvas }), this.brushIdx.start = e ?? this.debounceBrushIdx.start, this.brushIdx.end = i ?? this.debounceBrushIdx.end;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* @param {boolean} updateBrushIdxUseXPos to initialize state after update brush index value
|
|
252
|
+
*
|
|
253
|
+
* @returns {undefined}
|
|
254
|
+
*/
|
|
255
|
+
initEventState() {
|
|
256
|
+
new Promise((e) => {
|
|
257
|
+
this.updateBrushIdxUseXPos(), e(!0);
|
|
258
|
+
}).then((e) => {
|
|
259
|
+
e && (this.clickBrushInsideX = null, this.beforeMouseXPos = null, this.curBrushButtonType = null, this.isUseBrushGrab = !1, this.offsetXAndRectXInterval = null, this.brushIdx.isUseButton = !1, this.brushIdx.isUseScroll = !1);
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
export {
|
|
264
|
+
T as default
|
|
265
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defaultsDeep as o } from "lodash-es";
|
|
2
|
+
const t = {
|
|
3
|
+
show: !0,
|
|
4
|
+
useDebounce: !0,
|
|
5
|
+
chartIdx: 0,
|
|
6
|
+
height: 100,
|
|
7
|
+
showLabel: !1,
|
|
8
|
+
selection: {
|
|
9
|
+
fillColor: "#38ACEC",
|
|
10
|
+
opacity: 0.65
|
|
11
|
+
},
|
|
12
|
+
useWheelMove: !0
|
|
13
|
+
}, u = () => ({
|
|
14
|
+
getNormalizedBrushOptions: (e) => o({}, e, t)
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
u as useBrushModel
|
|
18
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { resolveComponent as E, openBlock as f, createElementBlock as h, Fragment as L, createVNode as G, createCommentVNode as Z, createElementVNode as k, renderSlot as T, provide as e, computed as y, ref as N, watch as n, onMounted as w, toRef as R } from "vue";
|
|
2
|
+
import H from "../chart/ChartToolbar.vue.js";
|
|
3
|
+
import { useGroupModel as U } from "./uses.js";
|
|
4
|
+
import { useZoomModel as B } from "../chart/uses.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import F from "../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const M = {
|
|
8
|
+
name: "EvChartGroup",
|
|
9
|
+
components: {
|
|
10
|
+
evChartToolbar: H
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
options: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: () => ({})
|
|
16
|
+
},
|
|
17
|
+
zoomStartIdx: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 0
|
|
20
|
+
},
|
|
21
|
+
zoomEndIdx: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 0
|
|
24
|
+
},
|
|
25
|
+
groupSelectedLabel: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: null
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
emits: [
|
|
31
|
+
"update:groupSelectedLabel",
|
|
32
|
+
"update:zoomStartIdx",
|
|
33
|
+
"update:zoomEndIdx",
|
|
34
|
+
"update:groupHoveredLabel"
|
|
35
|
+
],
|
|
36
|
+
setup(t, { emit: c }) {
|
|
37
|
+
const {
|
|
38
|
+
getNormalizedOptions: l,
|
|
39
|
+
isExecuteZoom: r,
|
|
40
|
+
brushSeries: m,
|
|
41
|
+
evChartGroupRef: s,
|
|
42
|
+
evChartPropsInGroup: a
|
|
43
|
+
} = U(), v = l(t.options);
|
|
44
|
+
e("isExecuteZoom", r), e("isChartGroup", !0), e("brushSeries", m), e("evChartPropsInGroup", a);
|
|
45
|
+
const i = y({
|
|
46
|
+
get: () => t.groupSelectedLabel,
|
|
47
|
+
set: (o) => c("update:groupSelectedLabel", o)
|
|
48
|
+
});
|
|
49
|
+
e("groupSelectedLabel", i);
|
|
50
|
+
const u = N(null);
|
|
51
|
+
e("groupHoveredLabel", u), n(
|
|
52
|
+
() => t.options.syncHover,
|
|
53
|
+
(o) => {
|
|
54
|
+
o ? u.value = { label: "", horizontal: !1 } : u.value = null;
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
immediate: !0
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
const {
|
|
61
|
+
evChartZoomOptions: C,
|
|
62
|
+
evChartInfo: b,
|
|
63
|
+
evChartToolbarRef: _,
|
|
64
|
+
evChartClone: I,
|
|
65
|
+
brushIdx: d,
|
|
66
|
+
createEvChartZoom: g,
|
|
67
|
+
setOptionsForUseZoom: x,
|
|
68
|
+
setDataForUseZoom: z,
|
|
69
|
+
controlZoomIdx: S,
|
|
70
|
+
onClickToolbar: O
|
|
71
|
+
} = B(
|
|
72
|
+
v,
|
|
73
|
+
{ wrapper: null, evChartGroupRef: s },
|
|
74
|
+
i,
|
|
75
|
+
a
|
|
76
|
+
);
|
|
77
|
+
return e("evChartClone", I), e("evChartInfo", b), e("brushIdx", d), w(() => {
|
|
78
|
+
g();
|
|
79
|
+
}), n(
|
|
80
|
+
() => b.props.data,
|
|
81
|
+
(o) => {
|
|
82
|
+
z(o);
|
|
83
|
+
},
|
|
84
|
+
{ deep: !0 }
|
|
85
|
+
), n(
|
|
86
|
+
() => t.options,
|
|
87
|
+
(o) => {
|
|
88
|
+
const p = l(o);
|
|
89
|
+
x(p);
|
|
90
|
+
},
|
|
91
|
+
{ deep: !0 }
|
|
92
|
+
), n(
|
|
93
|
+
() => [t.zoomStartIdx, t.zoomEndIdx],
|
|
94
|
+
([o, p]) => {
|
|
95
|
+
d.isUseButton || d.isUseScroll || S(o, p);
|
|
96
|
+
}
|
|
97
|
+
), {
|
|
98
|
+
evChartGroupRef: s,
|
|
99
|
+
evChartToolbarRef: _,
|
|
100
|
+
zoomOptions: R(C, "zoom"),
|
|
101
|
+
onClickToolbar: O
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}, V = {
|
|
105
|
+
key: 0,
|
|
106
|
+
ref: "evChartToolbarRef"
|
|
107
|
+
}, j = {
|
|
108
|
+
ref: "evChartGroupRef",
|
|
109
|
+
class: "ev-chart-group__wrapper"
|
|
110
|
+
};
|
|
111
|
+
function P(t, c, l, r, m, s) {
|
|
112
|
+
const a = E("ev-chart-toolbar");
|
|
113
|
+
return f(), h(L, null, [
|
|
114
|
+
r.zoomOptions.toolbar.show ? (f(), h("div", V, [
|
|
115
|
+
G(a, {
|
|
116
|
+
toolbar: r.zoomOptions.toolbar,
|
|
117
|
+
onOnClickToolbar: r.onClickToolbar
|
|
118
|
+
}, null, 8, ["toolbar", "onOnClickToolbar"])
|
|
119
|
+
], 512)) : Z("", !0),
|
|
120
|
+
k("div", j, [
|
|
121
|
+
T(t.$slots, "default", {}, void 0, !0)
|
|
122
|
+
], 512)
|
|
123
|
+
], 64);
|
|
124
|
+
}
|
|
125
|
+
const Q = /* @__PURE__ */ F(M, [["render", P], ["__scopeId", "data-v-b1c0c322"]]);
|
|
126
|
+
export {
|
|
127
|
+
Q as default
|
|
128
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ref as e, reactive as n } from "vue";
|
|
2
|
+
import { defaultsDeep as m } from "lodash-es";
|
|
3
|
+
const l = {
|
|
4
|
+
zoom: {
|
|
5
|
+
bufferMemoryCnt: 100,
|
|
6
|
+
keepZoomStatus: !1,
|
|
7
|
+
useAnimation: !0,
|
|
8
|
+
useWheelMove: !0,
|
|
9
|
+
toolbar: {
|
|
10
|
+
show: !1,
|
|
11
|
+
items: {
|
|
12
|
+
previous: {
|
|
13
|
+
icon: "ev-icon-allow2-left",
|
|
14
|
+
size: "medium",
|
|
15
|
+
title: "Previous"
|
|
16
|
+
},
|
|
17
|
+
latest: {
|
|
18
|
+
icon: "ev-icon-allow2-right",
|
|
19
|
+
size: "medium",
|
|
20
|
+
title: "Latest"
|
|
21
|
+
},
|
|
22
|
+
reset: {
|
|
23
|
+
icon: "ev-icon-redo",
|
|
24
|
+
size: "medium",
|
|
25
|
+
title: "Reset"
|
|
26
|
+
},
|
|
27
|
+
dragZoom: {
|
|
28
|
+
icon: "ev-icon-zoomin",
|
|
29
|
+
size: "medium",
|
|
30
|
+
title: "Drag Zoom"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, p = () => {
|
|
36
|
+
const o = e(!1), t = e(), i = e([]), s = n({ list: [], chartIdx: null });
|
|
37
|
+
return {
|
|
38
|
+
getNormalizedOptions: (r) => m({}, r, l),
|
|
39
|
+
isExecuteZoom: o,
|
|
40
|
+
brushSeries: s,
|
|
41
|
+
evChartGroupRef: t,
|
|
42
|
+
evChartPropsInGroup: i
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
p as useGroupModel
|
|
47
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { openBlock as r, createElementBlock as u, normalizeClass as h, withDirectives as k, createElementVNode as s, vModelCheckbox as y, renderSlot as x, Fragment as g, createTextVNode as p, toDisplayString as B, ref as b, onMounted as C, inject as m, computed as c, nextTick as f, watch as S } from "vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import V from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const E = {
|
|
5
|
+
name: "EvCheckbox",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: [String, Number, Boolean, Symbol, Array],
|
|
9
|
+
default: !1
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
type: [String, Number, Boolean, Symbol, Object],
|
|
13
|
+
default: null
|
|
14
|
+
},
|
|
15
|
+
tooltipTitle: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !1
|
|
22
|
+
},
|
|
23
|
+
readonly: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
indeterminate: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: {
|
|
33
|
+
"update:modelValue": null,
|
|
34
|
+
"update:indeterminate": [Boolean],
|
|
35
|
+
change: null
|
|
36
|
+
},
|
|
37
|
+
setup(a, { emit: t }) {
|
|
38
|
+
const l = b();
|
|
39
|
+
C(() => {
|
|
40
|
+
l.value && a.tooltipTitle && (l.value.title = a.tooltipTitle);
|
|
41
|
+
});
|
|
42
|
+
const e = b(null), n = m(
|
|
43
|
+
"EvCheckboxGroupMv",
|
|
44
|
+
c({
|
|
45
|
+
get: () => a.modelValue,
|
|
46
|
+
set: (o) => {
|
|
47
|
+
o && !e.value.indeterminate && t("update:indeterminate", !1), t("update:modelValue", o);
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
), i = c(() => a.label), d = c(() => Array.isArray(n.value) ? n.value.includes(i.value) : n.value), v = m("EvCheckboxGroupChange", async (o) => {
|
|
51
|
+
await f(), t("change", n.value, o);
|
|
52
|
+
});
|
|
53
|
+
return S(
|
|
54
|
+
() => a.indeterminate,
|
|
55
|
+
(o) => {
|
|
56
|
+
f(() => {
|
|
57
|
+
e.value && (e.value.indeterminate = o);
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
{ immediate: !0 }
|
|
61
|
+
), {
|
|
62
|
+
mv: n,
|
|
63
|
+
checkboxLabel: l,
|
|
64
|
+
checkbox: e,
|
|
65
|
+
checked: d,
|
|
66
|
+
changeMv: v
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}, M = ["disabled", "value", "readonly"], _ = {
|
|
70
|
+
ref: "checkboxLabel",
|
|
71
|
+
class: "ev-checkbox-label"
|
|
72
|
+
};
|
|
73
|
+
function T(a, t, l, e, n, i) {
|
|
74
|
+
return r(), u("label", {
|
|
75
|
+
class: h(["ev-checkbox", [{ disabled: l.disabled }, { checked: e.checked }]])
|
|
76
|
+
}, [
|
|
77
|
+
k(s("input", {
|
|
78
|
+
ref: "checkbox",
|
|
79
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => e.mv = d),
|
|
80
|
+
type: "checkbox",
|
|
81
|
+
class: "ev-checkbox-input",
|
|
82
|
+
disabled: l.disabled,
|
|
83
|
+
value: l.label,
|
|
84
|
+
readonly: l.readonly,
|
|
85
|
+
onChange: t[1] || (t[1] = (...d) => e.changeMv && e.changeMv(...d))
|
|
86
|
+
}, null, 40, M), [
|
|
87
|
+
[y, e.mv]
|
|
88
|
+
]),
|
|
89
|
+
s("span", _, [
|
|
90
|
+
a.$slots.default ? x(a.$slots, "default", { key: 0 }) : (r(), u(g, { key: 1 }, [
|
|
91
|
+
p(B(l.label), 1)
|
|
92
|
+
], 64))
|
|
93
|
+
], 512)
|
|
94
|
+
], 2);
|
|
95
|
+
}
|
|
96
|
+
const L = /* @__PURE__ */ V(E, [["render", T]]);
|
|
97
|
+
export {
|
|
98
|
+
L as default
|
|
99
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { openBlock as r, createElementBlock as l, normalizeClass as u, renderSlot as p, computed as s, provide as c, nextTick as d } from "vue";
|
|
2
|
+
import m from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const h = {
|
|
4
|
+
name: "EvCheckboxGroup",
|
|
5
|
+
props: {
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Array,
|
|
8
|
+
default: () => []
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "checkbox"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
emits: {
|
|
16
|
+
"update:modelValue": null,
|
|
17
|
+
change: null
|
|
18
|
+
},
|
|
19
|
+
setup(t, { emit: a }) {
|
|
20
|
+
const e = s({
|
|
21
|
+
get: () => t.modelValue,
|
|
22
|
+
set: (o) => a("update:modelValue", o)
|
|
23
|
+
});
|
|
24
|
+
c("EvCheckboxGroupMv", e), c("EvCheckboxGroupChange", async (o) => {
|
|
25
|
+
await d(), a("change", e.value, o);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function i(t, a, e, n, o, f) {
|
|
30
|
+
return r(), l("div", {
|
|
31
|
+
class: u(["ev-checkbox-group", { "type-button": e.type === "button" }]),
|
|
32
|
+
role: "group"
|
|
33
|
+
}, [
|
|
34
|
+
p(t.$slots, "default")
|
|
35
|
+
], 2);
|
|
36
|
+
}
|
|
37
|
+
const k = /* @__PURE__ */ m(h, [["render", i]]);
|
|
38
|
+
export {
|
|
39
|
+
k as default
|
|
40
|
+
};
|