evui 2.0.9 → 2.1.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.
- package/dist/0b8d1200e71cae8d747dce4e69c4efb6.png +0 -0
- package/dist/1.css +4 -0
- package/dist/1.css.map +1 -0
- package/dist/1.evui.min.js +2 -0
- package/dist/1.evui.min.js.map +1 -0
- package/dist/1ba679c05036b34bf359aa2e6c450faa.ttf +0 -0
- package/dist/2.css +4 -0
- package/dist/2.css.map +1 -0
- package/dist/2.evui.min.js +2 -0
- package/dist/2.evui.min.js.map +1 -0
- package/dist/278156e41e0ad908cf7f841b17130502.woff2 +0 -0
- package/dist/3.evui.min.js +2 -0
- package/dist/3.evui.min.js.map +1 -0
- package/dist/32be89b11725274cd3e801192ba88361.ttf +0 -0
- package/dist/38c6d8bab26db77d8c806813e1497763.woff2 +0 -0
- package/dist/4.evui.min.js +2 -0
- package/dist/4.evui.min.js.map +1 -0
- package/dist/425399f81e4ce7cbd967685402ba0260.woff +0 -0
- package/dist/4730076470a665bbc7b783c56d29a72e.svg +261 -0
- package/dist/52e9a7f6ff3af5ad261e5292d07ebdca.eot +0 -0
- package/dist/5367103510b27b78482794590e1ce3b0.ttf +0 -0
- package/dist/57e963e3d6dd0a9cf05150b40eebf69b.svg +1008 -0
- package/dist/65a2fb6d9aaa164b41a039302093995b.ttf +0 -0
- package/dist/687a4990ea22bb1a49d469a5d9319790.woff2 +0 -0
- package/dist/6c1d906bf5ba48676f65b2d65e935e1a.ttf +0 -0
- package/dist/6dafca5a4f1e31f2bdf11939b24ff422.ttf +0 -0
- package/dist/752905fa5edf21fc52a10a0c1ca9c7a4.eot +0 -0
- package/dist/76c05d80dda67cdc5d03f345b7bd063f.ttf +0 -0
- package/dist/7d62eb50e7bb05eedb2a4656f7fe8f3b.svg +366 -0
- package/dist/a01e3f2d6c83dc3aee175e2482b3f777.eot +0 -0
- package/dist/b30fd8419d7e6d5918856c7531d33482.svg +1518 -0
- package/dist/c57dd55fa982e8940f69ca1d69a8a999.woff +0 -0
- package/dist/c656b8caa454ed19b9a2ef7f4f5b8fea.ttf +0 -0
- package/dist/cac87dc00c87a5d74711d0276713808a.woff +0 -0
- package/dist/d68fa3e67dbb653a13cec44b1bcabcfe.eot +0 -0
- package/dist/ddae9b1ba9b0b42f58809904b0b21349.woff +0 -0
- package/dist/evui.min.js +19 -0
- package/dist/evui.min.js.gz +0 -0
- package/dist/evui.min.js.map +1 -0
- package/dist/main.css +85 -0
- package/dist/main.css.gz +0 -0
- package/dist/main.css.map +1 -0
- package/package.json +56 -76
- package/src/common/emitter.js +20 -0
- package/src/common/utils.debounce.js +223 -0
- package/src/common/utils.js +51 -17
- package/src/common/utils.throttle.js +83 -0
- package/src/common/utils.tree.js +18 -0
- package/src/components/button/button.vue +317 -241
- package/src/components/chart/chart.core.js +378 -85
- package/src/components/chart/chart.vue +133 -115
- package/src/components/chart/element/element.bar.js +219 -25
- package/src/components/chart/element/element.bar.time.js +115 -0
- package/src/components/chart/element/element.line.js +172 -21
- package/src/components/chart/element/element.pie.js +86 -0
- package/src/components/chart/element/element.scatter.js +9 -2
- package/src/components/chart/element/element.tip.js +356 -0
- package/src/components/chart/helpers/helpers.canvas.js +94 -0
- package/src/components/chart/helpers/helpers.constant.js +25 -6
- package/src/components/chart/helpers/helpers.util.js +83 -38
- package/src/components/chart/index.js +0 -1
- package/src/components/chart/model/model.series.js +43 -14
- package/src/components/chart/model/model.store.js +440 -46
- package/src/components/chart/plugins/plugins.interaction.js +324 -0
- package/src/components/chart/plugins/plugins.legend.js +233 -91
- package/src/components/chart/plugins/plugins.pie.js +179 -0
- package/src/components/chart/plugins/plugins.title.js +25 -2
- package/src/components/chart/plugins/plugins.tooltip.js +384 -0
- package/src/components/chart/scale/scale.js +91 -29
- package/src/components/chart/scale/scale.linear.js +12 -0
- package/src/components/chart/scale/scale.logarithmic.js +25 -0
- package/src/components/chart/scale/scale.step.js +89 -52
- package/src/components/chart/scale/scale.time.category.js +204 -0
- package/src/components/chart/scale/scale.time.js +19 -1
- package/src/components/checkbox/checkbox-group.vue +15 -11
- package/src/components/checkbox/checkbox.vue +210 -138
- package/src/components/codeview/code.vue +42 -29
- package/src/components/contextmenu/contextmenu.child.vue +79 -0
- package/src/components/contextmenu/contextmenu.vue +276 -0
- package/src/components/contextmenu/contextmenu.wrap.vue +189 -0
- package/src/components/contextmenu/index.js +3 -0
- package/src/components/datepicker/calendar.core.js +588 -492
- package/src/components/datepicker/calendar.vue +0 -3
- package/src/components/datepicker/datepicker.vue +43 -15
- package/src/components/datepicker/index.js +5 -1
- package/src/components/grid/grid.filter.vue +290 -0
- package/src/components/grid/grid.filter.window.vue +411 -0
- package/src/components/grid/grid.render.vue +45 -0
- package/src/components/grid/grid.vue +1338 -0
- package/src/components/icon/icon.vue +23 -7
- package/src/components/input/input.number.vue +309 -277
- package/src/components/label/label.vue +2 -2
- package/src/components/loadingmask/loadingmask.vue +6 -13
- package/src/components/loginfield/loginfield.vue +46 -37
- package/src/components/markdown/index.js +3 -0
- package/src/components/markdown/markdown.vue +1001 -0
- package/src/components/menu/index.js +1 -3
- package/src/components/menu/menu.nav.item.vue +115 -0
- package/src/components/menu/menu.nav.sub.vue +42 -0
- package/src/components/menu/menu.nav.vue +71 -98
- package/src/components/message/index.js +3 -0
- package/src/components/message/message.js +63 -0
- package/src/components/message/message.vue +191 -0
- package/src/components/message-box/index.js +3 -0
- package/src/components/message-box/message-box.js +31 -0
- package/src/components/message-box/message-box.vue +299 -0
- package/src/components/notification/index.js +3 -0
- package/src/components/notification/notification.js +75 -0
- package/src/components/notification/notification.vue +242 -0
- package/src/components/radio/radio-group.vue +6 -2
- package/src/components/radio/radio.vue +156 -76
- package/src/components/selectbox/dropdown.vue +86 -40
- package/src/components/selectbox/listbox.vue +47 -18
- package/src/components/selectbox/option.vue +1 -1
- package/src/components/selectbox/selectbox.vue +304 -316
- package/src/components/slider/slider-tooltip.vue +7 -7
- package/src/components/slider/slider.vue +20 -25
- package/src/components/splitter/splitter.vue +104 -94
- package/src/components/table/table.black.css +1 -1
- package/src/components/table/table.filter.lite.vue +7 -7
- package/src/components/table/table.filter.vue +1 -1
- package/src/components/table/table.grey.css +5 -6
- package/src/components/table/table.navy.css +1 -1
- package/src/components/table/table.vue +55 -48
- package/src/components/tabs/tab-panel.vue +19 -5
- package/src/components/tabs/tabs.vue +182 -87
- package/src/components/textfield/textfield.vue +110 -87
- package/src/components/timepicker/index.js +2 -2
- package/src/components/timepicker/spinner.vue +15 -17
- package/src/components/timepicker/timepicker.vue +98 -53
- package/src/components/toggle/toggle.vue +148 -109
- package/src/components/tree/index.js +2 -6
- package/src/components/tree/render.js +17 -0
- package/src/components/tree/tree-node.vue +214 -0
- package/src/components/tree/tree.vue +296 -0
- package/src/components/tree-table/index.js +7 -0
- package/src/components/{tree → tree-table}/tree.table.black.css +0 -0
- package/src/components/{tree → tree-table}/tree.table.grey.css +0 -0
- package/src/components/{tree → tree-table}/tree.table.vue +36 -41
- package/src/components/{tree → tree-table}/tree.util.js +0 -0
- package/src/components/window/window.vue +238 -191
- package/src/index.js +25 -12
- package/src/styles/base/base.scss +50 -0
- package/src/styles/base/index.scss +1 -0
- package/src/styles/default.scss +5 -0
- package/src/styles/{codemirror.css → lib/codemirror.css} +0 -0
- package/src/styles/{all.css → lib/fontawesome.css} +1 -1
- package/src/styles/lib/icon.css +792 -0
- package/src/styles/themes/index.scss +2 -0
- package/src/styles/themes/mixin.scss +33 -0
- package/src/styles/themes/variables.scss +206 -0
- package/src/styles/utils/colors.scss +222 -0
- package/src/styles/utils/index.scss +2 -0
- package/src/styles/utils/mixins.scss +34 -0
- package/src/styles/utils/variables.scss +27 -0
- package/src/webfonts/EVUI.eot +0 -0
- package/src/webfonts/EVUI.svg +251 -173
- package/src/webfonts/EVUI.ttf +0 -0
- package/src/webfonts/EVUI.woff +0 -0
- package/src/webfonts/Roboto-Bold.ttf +0 -0
- package/src/webfonts/Roboto-Medium.ttf +0 -0
- package/src/webfonts/Roboto-Regular.ttf +0 -0
- package/src/components/chart/charts/chart.bar.js +0 -334
- package/src/components/chart/charts/chart.base.js +0 -1075
- package/src/components/chart/charts/chart.line.js +0 -262
- package/src/components/chart/charts/chart.pie.js +0 -383
- package/src/components/chart/charts/chart.scatter.js +0 -349
- package/src/components/chart/charts/chart.sunburst.js +0 -193
- package/src/components/chart/core/axis/axis.js +0 -217
- package/src/components/chart/core/axis/axis.scale.auto.js +0 -69
- package/src/components/chart/core/axis/axis.scale.fixed.js +0 -65
- package/src/components/chart/core/axis/axis.scale.steps.js +0 -149
- package/src/components/chart/core/core.constant.js +0 -116
- package/src/components/chart/core/core.legend.js +0 -473
- package/src/components/chart/core/core.util.js +0 -66
- package/src/components/chart/core/data/data.js +0 -412
- package/src/components/chart/core/data/data.pie.js +0 -70
- package/src/components/chart/core/data/data.stack.js +0 -222
- package/src/components/chart/core/data/data.sunburst.js +0 -172
- package/src/components/menu/menu.context.children.vue +0 -201
- package/src/components/menu/menu.context.vue +0 -144
- package/src/components/tabs/jun/tab.vue +0 -123
- package/src/components/tabs/jun/tabs.vue +0 -484
- package/src/styles/evui.css +0 -386
- package/src/styles/icon.css +0 -557
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash-es';
|
|
2
|
-
import DataStore from './data';
|
|
3
|
-
|
|
4
|
-
export default class SunburstDataStore extends DataStore {
|
|
5
|
-
init() {
|
|
6
|
-
this.initTreeData();
|
|
7
|
-
this.createTreeDummy();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
getSeriesExtends(defaultSeries, param) { // eslint-disable-line class-methods-use-this
|
|
11
|
-
const extSeries = {
|
|
12
|
-
oData: param.data || null,
|
|
13
|
-
cData: null,
|
|
14
|
-
children: param.children === undefined ? [] : param.children,
|
|
15
|
-
parentIndex: null,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return _.merge(defaultSeries, extSeries);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
initTreeData() {
|
|
22
|
-
const series = this.chartData.series;
|
|
23
|
-
const lvl = 0;
|
|
24
|
-
|
|
25
|
-
for (let ix = 0, ixLen = series.length; ix < ixLen; ix++) {
|
|
26
|
-
this.addSeries(series[ix]);
|
|
27
|
-
|
|
28
|
-
const seriesNode = this.seriesList[this.seriesList.length - 1];
|
|
29
|
-
seriesNode.lvl = lvl;
|
|
30
|
-
seriesNode.parentIndex = -1;
|
|
31
|
-
seriesNode.data = seriesNode.oData;
|
|
32
|
-
|
|
33
|
-
const pIndex = seriesNode.parentIndex;
|
|
34
|
-
|
|
35
|
-
if (!this.seriesGroupList[lvl]) {
|
|
36
|
-
this.seriesGroupList[lvl] = {};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (!this.seriesGroupList[lvl][pIndex]) {
|
|
40
|
-
this.seriesGroupList[lvl][pIndex] = { totalValue: 0, node: [] };
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
this.seriesGroupList[lvl][pIndex].totalValue += seriesNode.data;
|
|
44
|
-
this.seriesGroupList[lvl][pIndex].node.push({
|
|
45
|
-
parentIndex: seriesNode.parentIndex,
|
|
46
|
-
seriesIndex: seriesNode.seriesIndex,
|
|
47
|
-
data: seriesNode.data,
|
|
48
|
-
hasChild: !!seriesNode.children.length,
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
for (let jx = 0, jxLen = seriesNode.children.length; jx < jxLen; jx++) {
|
|
52
|
-
this.traversalDFS(seriesNode.children[jx], seriesNode.seriesIndex);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
traversalDFS(item, parentIndex) {
|
|
58
|
-
this.addSeries(item);
|
|
59
|
-
const seriesNode = this.seriesList[this.seriesList.length - 1];
|
|
60
|
-
const lvl = this.seriesList[parentIndex].lvl + 1;
|
|
61
|
-
|
|
62
|
-
seriesNode.lvl = lvl;
|
|
63
|
-
seriesNode.parentIndex = parentIndex;
|
|
64
|
-
seriesNode.data = item.data;
|
|
65
|
-
|
|
66
|
-
if (!this.seriesGroupList[lvl]) {
|
|
67
|
-
this.seriesGroupList[lvl] = {};
|
|
68
|
-
}
|
|
69
|
-
if (!this.seriesGroupList[lvl][parentIndex]) {
|
|
70
|
-
this.seriesGroupList[lvl][parentIndex] = { totalValue: 0, node: [] };
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
this.seriesGroupList[lvl][parentIndex].totalValue += seriesNode.data;
|
|
74
|
-
this.seriesGroupList[lvl][parentIndex].node.push({
|
|
75
|
-
parentIndex: seriesNode.parentIndex,
|
|
76
|
-
seriesIndex: seriesNode.seriesIndex,
|
|
77
|
-
data: seriesNode.data,
|
|
78
|
-
hasChild: !!seriesNode.children.length,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
for (let ix = 0, ixLen = seriesNode.children.length; ix < ixLen; ix++) {
|
|
82
|
-
this.traversalDFS(seriesNode.children[ix], seriesNode.seriesIndex);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
createTreeDummy() {
|
|
87
|
-
let node;
|
|
88
|
-
let keys;
|
|
89
|
-
|
|
90
|
-
for (let ix = 0, ixLen = this.seriesGroupList.length - 1; ix < ixLen; ix++) {
|
|
91
|
-
keys = Object.keys(this.seriesGroupList[ix]);
|
|
92
|
-
for (let jx = 0, jxLen = keys.length; jx < jxLen; jx++) {
|
|
93
|
-
node = this.seriesGroupList[ix][keys[jx]].node;
|
|
94
|
-
|
|
95
|
-
for (let kx = 0, kxLen = node.length; kx < kxLen; kx++) {
|
|
96
|
-
if (!node[kx].hasChild) {
|
|
97
|
-
this.seriesGroupList[ix + 1][node[kx].seriesIndex] = {
|
|
98
|
-
totalValue: node[kx].data,
|
|
99
|
-
node: [{
|
|
100
|
-
parentIndex: node[kx].seriesIndex,
|
|
101
|
-
seriesIndex: this.seriesList.length,
|
|
102
|
-
data: node[kx].data,
|
|
103
|
-
hasChild: false,
|
|
104
|
-
isDummy: true,
|
|
105
|
-
}],
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
addValue(seriesIndex, value, dataIndex) {
|
|
114
|
-
if (this.seriesList === undefined) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
// category 형태의 데이터냐 아니냐에 따라 x,y 처리
|
|
118
|
-
const series = this.seriesList[seriesIndex];
|
|
119
|
-
const tempValue = {};
|
|
120
|
-
let dataIdx = dataIndex;
|
|
121
|
-
|
|
122
|
-
if (!series) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (dataIndex === null || dataIndex === undefined) {
|
|
127
|
-
dataIdx = series.data.length;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (!this.seriesGroupList[dataIdx]) {
|
|
131
|
-
this.seriesGroupList[dataIdx] = [];
|
|
132
|
-
}
|
|
133
|
-
this.seriesGroupList[dataIdx].push({ seriesIndex, data: value, show: series.show });
|
|
134
|
-
|
|
135
|
-
series.cData[dataIdx] = value;
|
|
136
|
-
series.oData[dataIdx] = value;
|
|
137
|
-
|
|
138
|
-
if (series.show) {
|
|
139
|
-
this.setMinMaxValue(series, tempValue, dataIdx);
|
|
140
|
-
this.setMaxLabelWidth(tempValue);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
getSeriesGroupList() {
|
|
145
|
-
return this.seriesGroupList;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
updateData() {
|
|
149
|
-
this.maxValueInfo = {
|
|
150
|
-
x: null,
|
|
151
|
-
y: null,
|
|
152
|
-
index: null,
|
|
153
|
-
seriesIndex: null,
|
|
154
|
-
};
|
|
155
|
-
this.minValueInfo = {
|
|
156
|
-
x: null,
|
|
157
|
-
y: null,
|
|
158
|
-
index: null,
|
|
159
|
-
seriesIndex: null,
|
|
160
|
-
};
|
|
161
|
-
this.labelTextMaxInfo = {
|
|
162
|
-
xLen: 0,
|
|
163
|
-
xText: '',
|
|
164
|
-
yLen: 0,
|
|
165
|
-
yText: '',
|
|
166
|
-
};
|
|
167
|
-
this.seriesGroupList.length = 0;
|
|
168
|
-
this.seriesList.length = 0;
|
|
169
|
-
this.initTreeData();
|
|
170
|
-
this.createTreeDummy();
|
|
171
|
-
}
|
|
172
|
-
}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:style="contextChildrenStyle"
|
|
4
|
-
:class="prefixEvui"
|
|
5
|
-
>
|
|
6
|
-
<div
|
|
7
|
-
:class="bodyCls"
|
|
8
|
-
@mouseout="onMouseOut"
|
|
9
|
-
>
|
|
10
|
-
<div :class="`${prefixEvui}-separator`"/>
|
|
11
|
-
<div
|
|
12
|
-
v-for="(item, rowIdx) in items"
|
|
13
|
-
:key="`${item.text}_${depth}_${rowIdx}`"
|
|
14
|
-
:class="`${prefixEvui}-row`"
|
|
15
|
-
@click="onRowClick(item, depth, rowIdx)"
|
|
16
|
-
@mouseover="onMouseOver(item.text, depth, rowIdx)"
|
|
17
|
-
>
|
|
18
|
-
{{ item.text }}
|
|
19
|
-
<i
|
|
20
|
-
v-if="item.items"
|
|
21
|
-
:class="`${prefixEvui}-right-arrow`"
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
<ev-context-menu-children
|
|
26
|
-
v-for="(item, rowIdx) in items"
|
|
27
|
-
v-if="item.items"
|
|
28
|
-
v-show="getSubMenuKey(item.text, depth, rowIdx) === subMenuKey"
|
|
29
|
-
:key="getSubMenuKey(item.text, depth, rowIdx)"
|
|
30
|
-
:parent-row-idx="rowIdx"
|
|
31
|
-
:depth="depth + 1"
|
|
32
|
-
:items="item.items"
|
|
33
|
-
@click="onClick"
|
|
34
|
-
/>
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<script>
|
|
39
|
-
import '@/styles/all.css';
|
|
40
|
-
import '@/styles/evui.css';
|
|
41
|
-
|
|
42
|
-
const prefixEvui = 'ev-contextmenu-children';
|
|
43
|
-
|
|
44
|
-
export default {
|
|
45
|
-
props: {
|
|
46
|
-
depth: {
|
|
47
|
-
type: Number,
|
|
48
|
-
default: 0,
|
|
49
|
-
},
|
|
50
|
-
parentRowIdx: {
|
|
51
|
-
type: Number,
|
|
52
|
-
default: 0,
|
|
53
|
-
},
|
|
54
|
-
items: {
|
|
55
|
-
type: Array,
|
|
56
|
-
default() {
|
|
57
|
-
return [];
|
|
58
|
-
},
|
|
59
|
-
validator(value) {
|
|
60
|
-
return value != null && value.constructor === Array;
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
click: {
|
|
64
|
-
type: Function,
|
|
65
|
-
default: () => {},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
data() {
|
|
69
|
-
return {
|
|
70
|
-
prefixEvui,
|
|
71
|
-
contextChildrenStyle: '',
|
|
72
|
-
bodyCls: '',
|
|
73
|
-
subMenuKey: '',
|
|
74
|
-
nextDepth: 1,
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
|
-
created() {
|
|
78
|
-
this.contextChildrenStyle = this.getContextChildrenStyle();
|
|
79
|
-
this.bodyCls = this.getBodyClasses();
|
|
80
|
-
this.nextDepth = this.depth + 1;
|
|
81
|
-
},
|
|
82
|
-
methods: {
|
|
83
|
-
onRowClick(item, depth, rowIdx) {
|
|
84
|
-
this.$emit('click', { ...item, depth, rowIdx, parentRowIdx: this.parentRowIdx });
|
|
85
|
-
},
|
|
86
|
-
onClick(item) {
|
|
87
|
-
this.$emit('click', item);
|
|
88
|
-
},
|
|
89
|
-
onMouseOver(text, depth, rowIdx) {
|
|
90
|
-
this.subMenuKey = this.getSubMenuKey(text, depth, rowIdx);
|
|
91
|
-
},
|
|
92
|
-
onMouseOut() {
|
|
93
|
-
event.stopPropagation();
|
|
94
|
-
this.clearSubMenuKey(this.$children);
|
|
95
|
-
},
|
|
96
|
-
getSubMenuKey(text, depth, rowIdx) {
|
|
97
|
-
return `menu_sub_${text}_${depth}_${rowIdx}`;
|
|
98
|
-
},
|
|
99
|
-
getContextChildrenStyle() {
|
|
100
|
-
return this.depth === 0 ? '' : `margin-top: ${26 * this.parentRowIdx}px; left: -2px;`;
|
|
101
|
-
},
|
|
102
|
-
getBodyClasses() {
|
|
103
|
-
return [
|
|
104
|
-
`${prefixEvui}-body`,
|
|
105
|
-
{
|
|
106
|
-
[`${prefixEvui}-box-style`]: this.depth !== 0,
|
|
107
|
-
},
|
|
108
|
-
];
|
|
109
|
-
},
|
|
110
|
-
clearSubMenuKey(children) {
|
|
111
|
-
if (!children || children.constructor !== Array) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
let cmp;
|
|
116
|
-
|
|
117
|
-
for (let ix = 0, ixLen = children.length; ix < ixLen; ix++) {
|
|
118
|
-
cmp = children[ix];
|
|
119
|
-
|
|
120
|
-
if (cmp.subMenuKey) {
|
|
121
|
-
cmp.subMenuKey = '';
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
this.clearSubMenuKey(cmp.$children);
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
</script>
|
|
130
|
-
|
|
131
|
-
<style>
|
|
132
|
-
.ev-contextmenu-children{
|
|
133
|
-
position: relative;
|
|
134
|
-
float: left;
|
|
135
|
-
z-index: 9999;
|
|
136
|
-
}
|
|
137
|
-
.ev-contextmenu-children-body{
|
|
138
|
-
float: left;
|
|
139
|
-
position: relative;
|
|
140
|
-
border: 1px solid #d0d0d0;
|
|
141
|
-
font-size: 12px;
|
|
142
|
-
background: #f0f0f0;
|
|
143
|
-
color: #222222;
|
|
144
|
-
}
|
|
145
|
-
.ev-contextmenu-children-box-style{
|
|
146
|
-
border-radius: 3px 0 0 3px;
|
|
147
|
-
box-shadow: 2px 2px #9c9c9c;
|
|
148
|
-
}
|
|
149
|
-
.ev-contextmenu-children-separator {
|
|
150
|
-
position: absolute;
|
|
151
|
-
top: 0;
|
|
152
|
-
left: 20px;
|
|
153
|
-
width: 2px;
|
|
154
|
-
height: 100%;
|
|
155
|
-
background-color: white;
|
|
156
|
-
border-left: solid 1px #e0e0e0;
|
|
157
|
-
overflow: hidden;
|
|
158
|
-
}
|
|
159
|
-
.ev-contextmenu-children-row{
|
|
160
|
-
position: relative;
|
|
161
|
-
padding: 2px 22px 2px 30px;
|
|
162
|
-
line-height: 22px;
|
|
163
|
-
white-space: nowrap;
|
|
164
|
-
overflow: hidden;
|
|
165
|
-
cursor: pointer;
|
|
166
|
-
}
|
|
167
|
-
.ev-contextmenu-children-row:hover{
|
|
168
|
-
margin: 0 2px 0 2px;
|
|
169
|
-
padding: 1px 19px 1px 27px;
|
|
170
|
-
background-color: #e6e6e6;
|
|
171
|
-
border: 1px solid #9d9d9d;
|
|
172
|
-
border-radius: 3px;
|
|
173
|
-
}
|
|
174
|
-
.ev-contextmenu-children-right-arrow{
|
|
175
|
-
position: absolute;
|
|
176
|
-
}
|
|
177
|
-
.ev-contextmenu-children-right-arrow:after{
|
|
178
|
-
padding-left: 8px;
|
|
179
|
-
vertical-align: middle;
|
|
180
|
-
font: bold 16px "Font Awesome\ 5 Free";
|
|
181
|
-
color: #9c9c9c;
|
|
182
|
-
background: -webkit-linear-gradient(#eee, #333);
|
|
183
|
-
-webkit-background-clip: text;
|
|
184
|
-
-webkit-text-fill-color: transparent;
|
|
185
|
-
content: "\f0da";
|
|
186
|
-
}
|
|
187
|
-
.ev-contextmenu-children-sub-row{
|
|
188
|
-
position: relative;
|
|
189
|
-
padding: 2px 24px 2px 34px;
|
|
190
|
-
line-height: 22px;
|
|
191
|
-
white-space: nowrap;
|
|
192
|
-
overflow: hidden;
|
|
193
|
-
cursor: pointer;
|
|
194
|
-
}
|
|
195
|
-
.ev-contextmenu-children-sub-row:hover{
|
|
196
|
-
padding: 1px 11px 1px 33px;
|
|
197
|
-
background-color: #e6e6e6;
|
|
198
|
-
border: 1px solid #9d9d9d;
|
|
199
|
-
border-radius: 3px;
|
|
200
|
-
}
|
|
201
|
-
</style>
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-click-outside="hide"
|
|
4
|
-
v-show="isShow"
|
|
5
|
-
:style="ctxMenuStyle"
|
|
6
|
-
:class="prefixEvui"
|
|
7
|
-
>
|
|
8
|
-
<ev-context-menu-children
|
|
9
|
-
ref="ctxChildren"
|
|
10
|
-
:depth="0"
|
|
11
|
-
:items="items"
|
|
12
|
-
@click="onClick"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
import '@/styles/evui.css';
|
|
19
|
-
import { getQuantity } from '../../common/utils';
|
|
20
|
-
|
|
21
|
-
const prefixEvui = 'ev-contextmenu';
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
directives: {
|
|
25
|
-
'click-outside': {
|
|
26
|
-
bind(el, binding) {
|
|
27
|
-
const contextMenuEl = el;
|
|
28
|
-
const bubble = binding.modifiers.bubble;
|
|
29
|
-
const handler = (e) => {
|
|
30
|
-
if (bubble || (contextMenuEl !== e.target && !contextMenuEl.contains(e.target))) {
|
|
31
|
-
binding.value(e);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
contextMenuEl.vueClickOutside = handler;
|
|
35
|
-
|
|
36
|
-
document.addEventListener('mousedown', handler);
|
|
37
|
-
},
|
|
38
|
-
unbind(el) {
|
|
39
|
-
const contextMenuEl = el;
|
|
40
|
-
document.removeEventListener('mousedown', contextMenuEl.vueClickOutside);
|
|
41
|
-
contextMenuEl.vueClickOutside = null;
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
props: {
|
|
46
|
-
isUse: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: true,
|
|
49
|
-
},
|
|
50
|
-
x: {
|
|
51
|
-
type: Number,
|
|
52
|
-
default: 0,
|
|
53
|
-
},
|
|
54
|
-
y: {
|
|
55
|
-
type: Number,
|
|
56
|
-
default: 0,
|
|
57
|
-
},
|
|
58
|
-
items: {
|
|
59
|
-
type: Array,
|
|
60
|
-
default() {
|
|
61
|
-
return [];
|
|
62
|
-
},
|
|
63
|
-
validator(value) {
|
|
64
|
-
return value != null && value.constructor === Array;
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
data() {
|
|
69
|
-
return {
|
|
70
|
-
prefixEvui,
|
|
71
|
-
top: 0,
|
|
72
|
-
left: 0,
|
|
73
|
-
isShow: false,
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
computed: {
|
|
77
|
-
ctxMenuStyle() {
|
|
78
|
-
return `top: ${this.top}px; left: ${this.left}px;`;
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
created() {
|
|
82
|
-
this.setPosition(this.x, this.y);
|
|
83
|
-
},
|
|
84
|
-
mounted() {
|
|
85
|
-
this.parentAddListener();
|
|
86
|
-
this.moveElToBody();
|
|
87
|
-
},
|
|
88
|
-
beforeDestroy() {
|
|
89
|
-
if (this.$el) {
|
|
90
|
-
this.$el.remove();
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
methods: {
|
|
94
|
-
parentAddListener() {
|
|
95
|
-
const parentEl = this.$el.parentElement;
|
|
96
|
-
|
|
97
|
-
if (parentEl) {
|
|
98
|
-
parentEl.addEventListener('contextmenu', this.onContextMenu);
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
moveElToBody() {
|
|
102
|
-
document.body.appendChild(this.$el);
|
|
103
|
-
},
|
|
104
|
-
onContextMenu(e) {
|
|
105
|
-
this.setPosition(e.clientX, e.clientY);
|
|
106
|
-
this.show();
|
|
107
|
-
e.preventDefault();
|
|
108
|
-
},
|
|
109
|
-
onClick(item) {
|
|
110
|
-
if (!item.items) {
|
|
111
|
-
this.hide();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
this.$emit('click', item);
|
|
115
|
-
},
|
|
116
|
-
setPosition(x, y) {
|
|
117
|
-
const posX = getQuantity(x) || { value: 0 };
|
|
118
|
-
const posY = getQuantity(y) || { value: 0 };
|
|
119
|
-
this.top = posY.value;
|
|
120
|
-
this.left = posX.value;
|
|
121
|
-
},
|
|
122
|
-
show() {
|
|
123
|
-
if (this.isUse) {
|
|
124
|
-
this.isShow = true;
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
hide() {
|
|
128
|
-
this.isShow = false;
|
|
129
|
-
const ctxChildren = this.$refs.ctxChildren;
|
|
130
|
-
|
|
131
|
-
if (ctxChildren && ctxChildren.clearSubMenuKey) {
|
|
132
|
-
ctxChildren.clearSubMenuKey(this.$children);
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
</script>
|
|
138
|
-
|
|
139
|
-
<style>
|
|
140
|
-
.ev-contextmenu{
|
|
141
|
-
position: absolute;
|
|
142
|
-
z-index: 9999;
|
|
143
|
-
}
|
|
144
|
-
</style>
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="activeClass"
|
|
4
|
-
@click="setActive"
|
|
5
|
-
@dragend="onDragEnd"
|
|
6
|
-
>
|
|
7
|
-
{{ tabProp.title }}
|
|
8
|
-
<span
|
|
9
|
-
class="ev-btn-close"
|
|
10
|
-
@click.stop="close"
|
|
11
|
-
> ×
|
|
12
|
-
</span>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
const prefixCls = 'ev-tab-title';
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
props: {
|
|
21
|
-
tabProp: {
|
|
22
|
-
type: Object,
|
|
23
|
-
default() {
|
|
24
|
-
return {};
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
minWidth: {
|
|
28
|
-
type: Number,
|
|
29
|
-
default: 100,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
data() {
|
|
33
|
-
return {
|
|
34
|
-
isActive: this.tabProp.isActive,
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
computed: {
|
|
38
|
-
activeClass() {
|
|
39
|
-
return [
|
|
40
|
-
`${prefixCls}`,
|
|
41
|
-
{
|
|
42
|
-
active: this.tabProp.isActive,
|
|
43
|
-
},
|
|
44
|
-
];
|
|
45
|
-
},
|
|
46
|
-
currentWidth() {
|
|
47
|
-
return {
|
|
48
|
-
width: `${this.width}px`,
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
methods: {
|
|
53
|
-
computedTitle() {
|
|
54
|
-
const result = this.tabProp.title.split('');
|
|
55
|
-
let isShrink = false;
|
|
56
|
-
const minWidth = this.tabProp.width || this.minWidth;
|
|
57
|
-
|
|
58
|
-
while (result.length * 7 > (minWidth - 50)) {
|
|
59
|
-
result.pop();
|
|
60
|
-
isShrink = true;
|
|
61
|
-
}
|
|
62
|
-
if (isShrink) {
|
|
63
|
-
result.push('...');
|
|
64
|
-
}
|
|
65
|
-
return result.join('');
|
|
66
|
-
},
|
|
67
|
-
close() {
|
|
68
|
-
this.$emit('close', this.tabProp);
|
|
69
|
-
},
|
|
70
|
-
setActive() {
|
|
71
|
-
this.$emit('set-active', this.tabProp);
|
|
72
|
-
},
|
|
73
|
-
onDragEnd(e) {
|
|
74
|
-
this.$emit('drag-end', this.tabProp, e);
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
</script>
|
|
79
|
-
|
|
80
|
-
<style scoped>
|
|
81
|
-
.ev-tab-title {
|
|
82
|
-
margin: 0;
|
|
83
|
-
margin-right: 4px;
|
|
84
|
-
height: 31px;
|
|
85
|
-
padding: 5px 16px 4px;
|
|
86
|
-
border: 1px solid #dddee1;
|
|
87
|
-
border-bottom: 0;
|
|
88
|
-
border-radius: 4px 4px 0 0;
|
|
89
|
-
transition: all 0.3s ease-in-out;
|
|
90
|
-
background: #f8f8f9;
|
|
91
|
-
display: inline-block;
|
|
92
|
-
user-select: none;
|
|
93
|
-
}
|
|
94
|
-
.ev-tab-title.active {
|
|
95
|
-
height: 32px;
|
|
96
|
-
padding-bottom: 5px;
|
|
97
|
-
background: #fff;
|
|
98
|
-
transform: translateZ(0);
|
|
99
|
-
border-color: #dddee1;
|
|
100
|
-
color: #2d8cf0;
|
|
101
|
-
}
|
|
102
|
-
.ev-tab-title:hover {
|
|
103
|
-
color: #2589E9;
|
|
104
|
-
font-weight: bold;
|
|
105
|
-
cursor: pointer;
|
|
106
|
-
}
|
|
107
|
-
.ev-btn-close {
|
|
108
|
-
position: relative;
|
|
109
|
-
float: right;
|
|
110
|
-
left: 8px;
|
|
111
|
-
line-height: 4px;
|
|
112
|
-
visibility: hidden;
|
|
113
|
-
}
|
|
114
|
-
.ev-tab-title:hover .ev-btn-close {
|
|
115
|
-
visibility: visible;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.ev-tab-title:hover .ev-btn-close:hover {
|
|
119
|
-
color: red;
|
|
120
|
-
font-weight: bold;
|
|
121
|
-
cursor: pointer;
|
|
122
|
-
}
|
|
123
|
-
</style>
|