evui 2.1.0 → 2.1.3
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/{adac9fa4f723f9d2cb5b6640517114a9.png → 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/{e8c322de9658cbeb8a774b6624167c2c.woff2 → 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/{0ab54153eeeca0ce03978cc463b257f7.woff2 → 38c6d8bab26db77d8c806813e1497763.woff2} +0 -0
- package/dist/4.evui.min.js +2 -0
- package/dist/4.evui.min.js.map +1 -0
- package/dist/{faff92145777a3cbaf8e7367b4807987.woff → 425399f81e4ce7cbd967685402ba0260.woff} +0 -0
- package/dist/4730076470a665bbc7b783c56d29a72e.svg +261 -0
- package/dist/52e9a7f6ff3af5ad261e5292d07ebdca.eot +0 -0
- package/dist/{ad97afd3337e8cda302d10ff5a4026b8.ttf → 5367103510b27b78482794590e1ce3b0.ttf} +0 -0
- package/dist/{65363c4d55617bbeb57d8ce6dcd46099.svg → 57e963e3d6dd0a9cf05150b40eebf69b.svg} +0 -0
- package/dist/{c5ebe0b32dc1b5cc449a76c4204d13bb.ttf → 65a2fb6d9aaa164b41a039302093995b.ttf} +0 -0
- package/dist/{cd6c777f1945164224dee082abaea03a.woff2 → 687a4990ea22bb1a49d469a5d9319790.woff2} +0 -0
- package/dist/{7583da5c07275cd5eb364507616f998f.ttf → 6c1d906bf5ba48676f65b2d65e935e1a.ttf} +0 -0
- package/dist/6dafca5a4f1e31f2bdf11939b24ff422.ttf +0 -0
- package/dist/{701ae6abd4719e9c2ada3535a497b341.eot → 752905fa5edf21fc52a10a0c1ca9c7a4.eot} +0 -0
- package/dist/76c05d80dda67cdc5d03f345b7bd063f.ttf +0 -0
- package/dist/{b551b554a67e86a840bc80cbb8066c30.svg → 7d62eb50e7bb05eedb2a4656f7fe8f3b.svg} +0 -0
- package/dist/{8e3c7f5520f5ae906c6cf6d7f3ddcd19.eot → a01e3f2d6c83dc3aee175e2482b3f777.eot} +0 -0
- package/dist/{448f2aaa315fa9dce7b2cf6ce31caed6.svg → b30fd8419d7e6d5918856c7531d33482.svg} +0 -0
- package/dist/c57dd55fa982e8940f69ca1d69a8a999.woff +0 -0
- package/dist/{b87b9ba532ace76ae9f6edfe9f72ded2.ttf → c656b8caa454ed19b9a2ef7f4f5b8fea.ttf} +0 -0
- package/dist/{a046592bac8f2fd96e994733faf3858c.woff → cac87dc00c87a5d74711d0276713808a.woff} +0 -0
- package/dist/{13db00b7a34fee4d819ab7f9838cc428.eot → d68fa3e67dbb653a13cec44b1bcabcfe.eot} +0 -0
- package/dist/{ef60a4f6c25ef7f39f2d25a748dbecfe.woff → ddae9b1ba9b0b42f58809904b0b21349.woff} +0 -0
- package/dist/evui.min.js +6 -86054
- package/dist/evui.min.js.gz +0 -0
- package/dist/evui.min.js.map +1 -1
- package/dist/main.css +43 -5541
- package/dist/main.css.gz +0 -0
- package/dist/main.css.map +1 -1
- 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 +7 -0
- package/src/components/message-box/message-box.js +32 -0
- package/src/components/message-box/message-box.vue +291 -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 +28 -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/dist/3c9453211570a4ede66a4b4954a32bbb.ttf +0 -0
- package/dist/8634884f932627fc43782e6963b64ccd.svg +0 -183
- package/dist/b9e64d9b5fa6b500eb5df6fa980d3e5b.eot +0 -0
- package/dist/f0ac0c8b3c9cd3ef9002749985ae546f.woff +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,484 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="ev-tabs ev-tabs-outer"
|
|
4
|
-
>
|
|
5
|
-
<div
|
|
6
|
-
v-if="showTabTitle"
|
|
7
|
-
class="ev-tabs-title-bar"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
10
|
-
class="ev-tabs-nav-container"
|
|
11
|
-
>
|
|
12
|
-
<div
|
|
13
|
-
:class="showScrollable"
|
|
14
|
-
class="ev-tabs-nav-wrap ev-tabs-nav-scrollable"
|
|
15
|
-
@mousewheel="wheelEvent"
|
|
16
|
-
>
|
|
17
|
-
<span
|
|
18
|
-
v-if="useTabScroll"
|
|
19
|
-
class="ev-tabs-nav-prev"
|
|
20
|
-
@click.stop="onLeftMove"
|
|
21
|
-
>
|
|
22
|
-
<icon class="fa-angle-left"/>
|
|
23
|
-
</span>
|
|
24
|
-
<span
|
|
25
|
-
v-if="useTabScroll"
|
|
26
|
-
class="ev-tabs-nav-next"
|
|
27
|
-
@click.stop="onRightMove"
|
|
28
|
-
>
|
|
29
|
-
<icon class="fa-angle-right"/>
|
|
30
|
-
</span>
|
|
31
|
-
<div
|
|
32
|
-
ref="tabListWrapperRef"
|
|
33
|
-
class="ev-tab-list-scroll"
|
|
34
|
-
>
|
|
35
|
-
<div
|
|
36
|
-
ref="tabListRef"
|
|
37
|
-
:style="moveTranslateX"
|
|
38
|
-
class="ev-tabs-nav"
|
|
39
|
-
>
|
|
40
|
-
<tab
|
|
41
|
-
v-for="(tab, index) in currentTabList"
|
|
42
|
-
ref="tabItemRef"
|
|
43
|
-
:key="index"
|
|
44
|
-
:tab-prop="tab"
|
|
45
|
-
:tab-index="tab.id"
|
|
46
|
-
:min-width="defaultTabWidth"
|
|
47
|
-
draggable="true"
|
|
48
|
-
@close="close"
|
|
49
|
-
@set-active="setActive"
|
|
50
|
-
@drag-start="onDragStart($event, tab, index)"
|
|
51
|
-
@drag-end="onDragEnd($event, tab, index)"
|
|
52
|
-
/>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
<div
|
|
59
|
-
class="ev-tab-content-container"
|
|
60
|
-
>
|
|
61
|
-
<keep-alive>
|
|
62
|
-
<component
|
|
63
|
-
:is="renderedComponent.keyName"
|
|
64
|
-
:key="renderedComponent.id"
|
|
65
|
-
v-bind="renderedComponent.parameters"
|
|
66
|
-
/>
|
|
67
|
-
</keep-alive>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
</template>
|
|
71
|
-
|
|
72
|
-
<script>
|
|
73
|
-
import Vue from 'vue';
|
|
74
|
-
import icon from '@/components/icon/icon';
|
|
75
|
-
import tab from './tab';
|
|
76
|
-
|
|
77
|
-
const unpackNode = function unpackNode(node) {
|
|
78
|
-
let data = null;
|
|
79
|
-
const tagNameRxg = new RegExp(/(EvTab)+/g);
|
|
80
|
-
if (node.tag && node.tag.match(tagNameRxg).length > 0) {
|
|
81
|
-
data = node.componentOptions.propsData.tabProp;
|
|
82
|
-
}
|
|
83
|
-
return data;
|
|
84
|
-
};
|
|
85
|
-
export default {
|
|
86
|
-
components: {
|
|
87
|
-
icon,
|
|
88
|
-
tab,
|
|
89
|
-
},
|
|
90
|
-
props: {
|
|
91
|
-
orderingSlotFirst: {
|
|
92
|
-
type: Boolean,
|
|
93
|
-
default: true,
|
|
94
|
-
},
|
|
95
|
-
showTabTitle: {
|
|
96
|
-
type: Boolean,
|
|
97
|
-
default: true,
|
|
98
|
-
},
|
|
99
|
-
tabData: {
|
|
100
|
-
type: Array,
|
|
101
|
-
default() {
|
|
102
|
-
return [];
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
scrollable: {
|
|
106
|
-
type: Boolean,
|
|
107
|
-
default: false,
|
|
108
|
-
},
|
|
109
|
-
useFlexibleScroll: {
|
|
110
|
-
type: Boolean,
|
|
111
|
-
default: false,
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
data() {
|
|
115
|
-
return {
|
|
116
|
-
idTag: 0,
|
|
117
|
-
tabCount: 0,
|
|
118
|
-
defaultTabWidth: 100,
|
|
119
|
-
currentX: 0,
|
|
120
|
-
renderedComponentList: {},
|
|
121
|
-
tabListRect: null,
|
|
122
|
-
tabWrapperRect: null,
|
|
123
|
-
currentTab: {
|
|
124
|
-
isActive: false,
|
|
125
|
-
},
|
|
126
|
-
renderedComponent: {
|
|
127
|
-
id: null,
|
|
128
|
-
keyName: null,
|
|
129
|
-
},
|
|
130
|
-
moveTranslateX: 'transform: \'\'',
|
|
131
|
-
originTabList: this.tabData,
|
|
132
|
-
useTabScroll: this.scrollable,
|
|
133
|
-
currentTabList: this.createTabData(),
|
|
134
|
-
indicator: 0,
|
|
135
|
-
currentTabIndex: 0,
|
|
136
|
-
};
|
|
137
|
-
},
|
|
138
|
-
computed: {
|
|
139
|
-
showScrollable() {
|
|
140
|
-
return [{
|
|
141
|
-
active: this.useTabScroll,
|
|
142
|
-
}];
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
watch: {
|
|
146
|
-
currentTab() {
|
|
147
|
-
// this.currentTab.isActive = true;
|
|
148
|
-
},
|
|
149
|
-
originTabList() {
|
|
150
|
-
if (this.tabCount < this.originTabList.length) {
|
|
151
|
-
const obj = {
|
|
152
|
-
id: `${this._uid}_tab_${this.idTag}`,
|
|
153
|
-
};
|
|
154
|
-
const tabItem = Object.assign({}, this.originTabList[this.originTabList.length - 1], obj);
|
|
155
|
-
this.currentTabList.push(tabItem);
|
|
156
|
-
this.setActive(tabItem);
|
|
157
|
-
this.idTag += 1;
|
|
158
|
-
this.tabCount += 1;
|
|
159
|
-
this.setScrollIcon(tabItem, 'add');
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
mounted() {
|
|
164
|
-
this.$nextTick(() => {
|
|
165
|
-
this.idTag = Number(this.currentTabList.length);
|
|
166
|
-
this.tabCount = Number(this.originTabList.length);
|
|
167
|
-
this.currentTabList.forEach((v) => {
|
|
168
|
-
const target = v.targetComponent;
|
|
169
|
-
this.installComponent(target);
|
|
170
|
-
});
|
|
171
|
-
this.setActive(this.findActiveTab());
|
|
172
|
-
this.setScrollIcon();
|
|
173
|
-
});
|
|
174
|
-
},
|
|
175
|
-
methods: {
|
|
176
|
-
findActiveTab() {
|
|
177
|
-
let firstIdx = 0;
|
|
178
|
-
let tabData = null;
|
|
179
|
-
for (let ix = 0; ix < this.currentTabList.length; ix++) {
|
|
180
|
-
tabData = this.currentTabList[ix];
|
|
181
|
-
if (tabData.isActive) {
|
|
182
|
-
firstIdx = ix;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return this.currentTabList[firstIdx];
|
|
186
|
-
},
|
|
187
|
-
renderTab(data) {
|
|
188
|
-
const target = data.targetComponent;
|
|
189
|
-
let id = data.id;
|
|
190
|
-
let keyName = target.keyName;
|
|
191
|
-
let parameters = target.parameters;
|
|
192
|
-
|
|
193
|
-
if (target.keyName && target.component) {
|
|
194
|
-
this.installComponent(target);
|
|
195
|
-
} else {
|
|
196
|
-
id = null;
|
|
197
|
-
keyName = null;
|
|
198
|
-
parameters = null;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
this.renderedComponent = {
|
|
202
|
-
id,
|
|
203
|
-
keyName,
|
|
204
|
-
parameters,
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
return data;
|
|
208
|
-
},
|
|
209
|
-
installComponent(target) {
|
|
210
|
-
let installed = false;
|
|
211
|
-
if (target) {
|
|
212
|
-
if (!this.renderedComponentList[target.keyName]) {
|
|
213
|
-
Vue.component(target.keyName, target.component);
|
|
214
|
-
this.renderedComponentList[target.keyName] = true;
|
|
215
|
-
}
|
|
216
|
-
installed = true;
|
|
217
|
-
}
|
|
218
|
-
return installed;
|
|
219
|
-
},
|
|
220
|
-
createTabData() {
|
|
221
|
-
const slotList = this.getSlotList(this.$slots.default);
|
|
222
|
-
let reduceList = [].concat(slotList, this.tabData);
|
|
223
|
-
|
|
224
|
-
if (reduceList.length > 1) {
|
|
225
|
-
reduceList = reduceList.reduce((acc, curr) => {
|
|
226
|
-
const val = this.orderingSlotFirst ? [].concat(acc, curr) : [].concat(curr, acc);
|
|
227
|
-
return val;
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
for (let i = 0, length = reduceList.length; i < length; i++) {
|
|
232
|
-
this.appendTabId(reduceList[i], i);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
return reduceList;
|
|
236
|
-
},
|
|
237
|
-
appendTabId(data, index) {
|
|
238
|
-
const obj = {};
|
|
239
|
-
const item = data;
|
|
240
|
-
|
|
241
|
-
obj.id = `${this._uid}_tab_${index}`;
|
|
242
|
-
|
|
243
|
-
if (item.targetComponent) {
|
|
244
|
-
item.targetComponent.uid = obj.id;
|
|
245
|
-
}
|
|
246
|
-
Object.assign(item, obj);
|
|
247
|
-
|
|
248
|
-
return item;
|
|
249
|
-
},
|
|
250
|
-
getSlotList(slots) {
|
|
251
|
-
const slotList = [];
|
|
252
|
-
|
|
253
|
-
if (slots && slots.length > 0) {
|
|
254
|
-
let index = 0;
|
|
255
|
-
let length = slots.length;
|
|
256
|
-
while (length--) {
|
|
257
|
-
const item = unpackNode(slots[index], 'tab');
|
|
258
|
-
if (item !== null) {
|
|
259
|
-
slotList.push(item);
|
|
260
|
-
}
|
|
261
|
-
index++;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return slotList;
|
|
266
|
-
},
|
|
267
|
-
setActive(data) {
|
|
268
|
-
for (let i = 0, length = this.currentTabList.length; i < length; i++) {
|
|
269
|
-
const obj = { isActive: false };
|
|
270
|
-
if (this.currentTabList[i].id === data.id) {
|
|
271
|
-
obj.isActive = true;
|
|
272
|
-
this.currentTab = this.currentTabList[i];
|
|
273
|
-
this.renderTab(data);
|
|
274
|
-
}
|
|
275
|
-
this.currentTabList[i].isActive = obj.isActive;
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
close(data) {
|
|
279
|
-
this.removeTabTarget(data);
|
|
280
|
-
this.setScrollIcon(data, 'removal');
|
|
281
|
-
},
|
|
282
|
-
removeTabTarget(data) {
|
|
283
|
-
if (this.currentTabList.length === 1) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
const result = this.currentTabList;
|
|
287
|
-
for (let i = 0, length = result.length; i < length; i++) {
|
|
288
|
-
if (this.currentTabList[i].id === data.id) {
|
|
289
|
-
result.splice(i, 1);
|
|
290
|
-
this.tabCount -= 1;
|
|
291
|
-
if (data.isActive) {
|
|
292
|
-
this.setActive(result[result.length - 1]);
|
|
293
|
-
}
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
onDragStart() {
|
|
299
|
-
// TODO 이벤트 추가작업 필요(MoveLeft or MoveRight)
|
|
300
|
-
},
|
|
301
|
-
onDragEnd() {
|
|
302
|
-
// TODO 이벤트 추가작업 필요(MoveLeft or MoveRight)
|
|
303
|
-
},
|
|
304
|
-
wheelEvent(e) {
|
|
305
|
-
e.preventDefault();
|
|
306
|
-
if (!this.useTabScroll) {
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
if (e.wheelDeltaY === 120) {
|
|
310
|
-
this.onLeftMove(e);
|
|
311
|
-
} else if (e.wheelDeltaY === -120) {
|
|
312
|
-
this.onRightMove(e);
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
onLeftMove(e) {
|
|
316
|
-
if (this.currentX > -100) {
|
|
317
|
-
this.currentX = 0;
|
|
318
|
-
this.moveTranslateX = `transform: translateX(${this.currentX}px);`;
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
this.onChangeTransForm(e, 'left');
|
|
322
|
-
},
|
|
323
|
-
onRightMove(e) {
|
|
324
|
-
const tabItemRef = this.$refs.tabItemRef;
|
|
325
|
-
const tabItemEl = tabItemRef[0].$el.getBoundingClientRect();
|
|
326
|
-
const tabItemX = tabItemRef[tabItemRef.length - 1].$el.getBoundingClientRect().x;
|
|
327
|
-
const wrapperWidth = this.$refs.tabListWrapperRef.getBoundingClientRect().width;
|
|
328
|
-
if (Math.abs(wrapperWidth - tabItemX) < tabItemEl.width) {
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
this.onChangeTransForm(e, 'right');
|
|
332
|
-
},
|
|
333
|
-
onChangeTransForm(e, type) {
|
|
334
|
-
const tabItemRef = this.$refs.tabItemRef;
|
|
335
|
-
const tabItemEl = tabItemRef[0].$el.getBoundingClientRect();
|
|
336
|
-
if (type === 'left') {
|
|
337
|
-
this.currentX += ((tabItemEl.width) + 4);
|
|
338
|
-
} else if (type === 'right') {
|
|
339
|
-
this.currentX -= ((tabItemEl.width) + 4);
|
|
340
|
-
}
|
|
341
|
-
this.moveTranslateX = `transform: translateX(${this.currentX}px);`;
|
|
342
|
-
},
|
|
343
|
-
setTransForm(data, type, init) {
|
|
344
|
-
const tabItemRef = this.$refs.tabItemRef;
|
|
345
|
-
const tabItemEl = tabItemRef[0].$el.getBoundingClientRect();
|
|
346
|
-
if (type === 'add') {
|
|
347
|
-
if (init) {
|
|
348
|
-
this.currentX -= 25;
|
|
349
|
-
} else {
|
|
350
|
-
this.currentX -= ((tabItemEl.width) + 4);
|
|
351
|
-
}
|
|
352
|
-
} else if (type === 'removal') {
|
|
353
|
-
this.currentX += ((tabItemEl.width) + 4);
|
|
354
|
-
} else if (type === 'deleteScroll') {
|
|
355
|
-
this.currentX = 0;
|
|
356
|
-
}
|
|
357
|
-
this.moveTranslateX = `transform: translateX(${this.currentX}px);`;
|
|
358
|
-
},
|
|
359
|
-
setScrollIcon(data, type) {
|
|
360
|
-
setTimeout(() => {
|
|
361
|
-
const sideIconWidth = 20;
|
|
362
|
-
this.tabWrapperRect = this.$refs.tabListWrapperRef.getBoundingClientRect();
|
|
363
|
-
this.tabListRect = this.$refs.tabListRef.getBoundingClientRect();
|
|
364
|
-
if (this.tabWrapperRect.width < this.tabListRect.width + sideIconWidth) {
|
|
365
|
-
this.useTabScroll = true;
|
|
366
|
-
if (!this.initScroll) {
|
|
367
|
-
this.initScroll = true;
|
|
368
|
-
this.setTransForm(data, type, this.initScroll);
|
|
369
|
-
} else {
|
|
370
|
-
this.setTransForm(data, type);
|
|
371
|
-
}
|
|
372
|
-
} else {
|
|
373
|
-
this.useTabScroll = false;
|
|
374
|
-
if (this.initScroll) {
|
|
375
|
-
this.initScroll = false;
|
|
376
|
-
this.setTransForm(data, 'deleteScroll');
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}, 1);
|
|
380
|
-
},
|
|
381
|
-
getTabItems() {
|
|
382
|
-
return this.$refs.tabItemRef;
|
|
383
|
-
},
|
|
384
|
-
},
|
|
385
|
-
};
|
|
386
|
-
</script>
|
|
387
|
-
|
|
388
|
-
<style scoped>
|
|
389
|
-
.ev-tabs {
|
|
390
|
-
position: relative;
|
|
391
|
-
overflow: hidden;
|
|
392
|
-
width: 100%;
|
|
393
|
-
height: 100%;
|
|
394
|
-
padding: 30px 0 0 0;
|
|
395
|
-
color: #495060;
|
|
396
|
-
zoom: 1;
|
|
397
|
-
}
|
|
398
|
-
.ev-tabs-outer {
|
|
399
|
-
}
|
|
400
|
-
.ev-tabs-title-bar {
|
|
401
|
-
position: absolute;
|
|
402
|
-
top: 0;
|
|
403
|
-
width: 100%;
|
|
404
|
-
height: 32px;
|
|
405
|
-
outline: none;
|
|
406
|
-
border-bottom: 1px solid #dddee1;
|
|
407
|
-
}
|
|
408
|
-
.ev-tabs-nav-container {
|
|
409
|
-
margin-bottom: -1px;
|
|
410
|
-
line-height: 1.5;
|
|
411
|
-
font-size: 14px;
|
|
412
|
-
box-sizing: border-box;
|
|
413
|
-
white-space: nowrap;
|
|
414
|
-
overflow: hidden;
|
|
415
|
-
position: relative;
|
|
416
|
-
zoom: 1;
|
|
417
|
-
}
|
|
418
|
-
.ev-tabs-nav-wrap {
|
|
419
|
-
overflow: hidden;
|
|
420
|
-
margin-bottom: 0;
|
|
421
|
-
}
|
|
422
|
-
.ev-tabs-nav-scrollable {
|
|
423
|
-
padding: 0;
|
|
424
|
-
}
|
|
425
|
-
.ev-tabs-nav-next {
|
|
426
|
-
position: absolute;
|
|
427
|
-
line-height: 32px;
|
|
428
|
-
right: 0;
|
|
429
|
-
cursor: pointer;
|
|
430
|
-
}
|
|
431
|
-
.ev-tabs-nav-prev {
|
|
432
|
-
position: absolute;
|
|
433
|
-
line-height: 32px;
|
|
434
|
-
left: 0;
|
|
435
|
-
cursor: pointer;
|
|
436
|
-
}
|
|
437
|
-
.ev-tab-list-scroll {
|
|
438
|
-
width: 100%;
|
|
439
|
-
overflow: hidden;
|
|
440
|
-
}
|
|
441
|
-
.ev-tabs-nav {
|
|
442
|
-
padding-left: 0;
|
|
443
|
-
margin: 0;
|
|
444
|
-
float: left;
|
|
445
|
-
list-style: none;
|
|
446
|
-
box-sizing: border-box;
|
|
447
|
-
position: relative;
|
|
448
|
-
transition: transform 0.5s ease-in-out;
|
|
449
|
-
display: inline-block;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.ev-tab-content-container {
|
|
453
|
-
width: 100%;
|
|
454
|
-
height: 100%;
|
|
455
|
-
border: 1px solid #dddee1;
|
|
456
|
-
border-top: 0;
|
|
457
|
-
padding: 3px;
|
|
458
|
-
display: flex;
|
|
459
|
-
flex-direction: row;
|
|
460
|
-
}
|
|
461
|
-
.ev-tabs-nav-scrollable.active {
|
|
462
|
-
padding: 0 12px;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
.ev-tabs-nav-container:before, .ev-tabs-nav-container:after {
|
|
466
|
-
content: "";
|
|
467
|
-
display: table;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
.ev-tabs:before, .ev-tabs:after {
|
|
471
|
-
content: "";
|
|
472
|
-
display: table;
|
|
473
|
-
clear: both;
|
|
474
|
-
visibility: hidden;
|
|
475
|
-
font-size: 0;
|
|
476
|
-
height: 0;
|
|
477
|
-
}
|
|
478
|
-
.ev-tabs-nav-next:hover, .ev-tabs-nav-prev:hover {
|
|
479
|
-
color: #2d8cf0;
|
|
480
|
-
}
|
|
481
|
-
.ev-indicator {
|
|
482
|
-
display: inline-block;
|
|
483
|
-
}
|
|
484
|
-
</style>
|