evui 2.0.8 → 2.0.10
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/README.md +27 -27
- package/{src/webfonts/fa-regular-400.svg → dist/82f60bd0b94a1ed68b1e6e309ce2e8c3.svg} +366 -366
- package/{src/webfonts/EVUI.svg → dist/91c6092c0a9164541a69045d746b9e78.svg} +183 -183
- package/dist/{448f2aaa315fa9dce7b2cf6ce31caed6.svg → 962a1bf31c081691065fe333d9fa8105.svg} +1518 -1518
- package/dist/{65363c4d55617bbeb57d8ce6dcd46099.svg → a1a749e89f578a49306ec2b055c073da.svg} +1008 -1008
- package/dist/evui.min.js +178 -59366
- package/dist/evui.min.js.gz +0 -0
- package/dist/evui.min.js.map +1 -1
- package/dist/main.css +5161 -0
- package/dist/main.css.gz +0 -0
- package/dist/main.css.map +1 -0
- package/package.json +125 -136
- package/dist/8634884f932627fc43782e6963b64ccd.svg +0 -183
- package/dist/b551b554a67e86a840bc80cbb8066c30.svg +0 -366
- package/src/code/checkbox.js +0 -12
- package/src/common/utils.js +0 -95
- package/src/common/utils.table.js +0 -78
- package/src/components/button/button.vue +0 -318
- package/src/components/button/index.js +0 -3
- package/src/components/chart/chart.vue +0 -354
- 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 -91
- 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/chart/index.js +0 -4
- package/src/components/checkbox/checkbox-group.vue +0 -57
- package/src/components/checkbox/checkbox.vue +0 -98
- package/src/components/checkbox/index.js +0 -3
- package/src/components/checkbox-group/index.js +0 -3
- package/src/components/codeview/code.vue +0 -242
- package/src/components/datepicker/calendar.core.js +0 -1829
- package/src/components/datepicker/calendar.vue +0 -86
- package/src/components/datepicker/datepicker.vue +0 -599
- package/src/components/datepicker/index.js +0 -3
- package/src/components/icon/icon.vue +0 -31
- package/src/components/icon/index.js +0 -3
- package/src/components/input/index.js +0 -3
- package/src/components/input/input.number.vue +0 -440
- package/src/components/label/index.js +0 -3
- package/src/components/label/label.vue +0 -86
- package/src/components/loadingmask/index.js +0 -3
- package/src/components/loadingmask/loadingmask.vue +0 -142
- package/src/components/menu/index.js +0 -5
- package/src/components/menu/menu.context.children.vue +0 -201
- package/src/components/menu/menu.context.vue +0 -144
- package/src/components/menu/menu.nav.vue +0 -123
- package/src/components/radio/index.js +0 -3
- package/src/components/radio/radio-group.vue +0 -48
- package/src/components/radio/radio.vue +0 -95
- package/src/components/radio-group/index.js +0 -3
- package/src/components/selectbox/dropdown.vue +0 -174
- package/src/components/selectbox/index.js +0 -3
- package/src/components/selectbox/listbox.vue +0 -106
- package/src/components/selectbox/option.vue +0 -11
- package/src/components/selectbox/selectbox.vue +0 -465
- package/src/components/slider/index.js +0 -3
- package/src/components/slider/slider-tooltip.vue +0 -119
- package/src/components/slider/slider.vue +0 -483
- package/src/components/summary/index.js +0 -3
- package/src/components/summary/summary.vue +0 -138
- package/src/components/table/data.json +0 -1000
- package/src/components/table/data2.json +0 -1000
- package/src/components/table/index.js +0 -3
- package/src/components/table/table.black.css +0 -547
- package/src/components/table/table.filter.lite.vue +0 -170
- package/src/components/table/table.filter.vue +0 -112
- package/src/components/table/table.grey.css +0 -539
- package/src/components/table/table.navy.css +0 -536
- package/src/components/table/table.vue +0 -1382
- package/src/components/tabs/index.js +0 -14
- package/src/components/tabs/jun/tab.vue +0 -123
- package/src/components/tabs/jun/tabs.vue +0 -484
- package/src/components/tabs/tab-panel.vue +0 -39
- package/src/components/tabs/tabs.vue +0 -446
- package/src/components/textfield/index.js +0 -3
- package/src/components/textfield/textfield.vue +0 -381
- package/src/components/timepicker/index.js +0 -3
- package/src/components/timepicker/spinner.vue +0 -205
- package/src/components/timepicker/timepicker.vue +0 -492
- package/src/components/toggle/index.js +0 -3
- package/src/components/toggle/toggle.vue +0 -355
- package/src/components/tree/index.js +0 -7
- package/src/components/tree/tree.table.black.css +0 -680
- package/src/components/tree/tree.table.grey.css +0 -675
- package/src/components/tree/tree.table.vue +0 -734
- package/src/components/tree/tree.util.js +0 -39
- package/src/components/window/index.js +0 -3
- package/src/components/window/window.vue +0 -606
- package/src/images/evui_icon.png +0 -0
- package/src/index.js +0 -78
- package/src/styles/all.css +0 -5
- package/src/styles/codemirror.css +0 -346
- package/src/styles/evui.css +0 -386
- package/src/styles/icon.css +0 -557
- package/src/webfonts/EVUI.eot +0 -0
- package/src/webfonts/EVUI.ttf +0 -0
- package/src/webfonts/EVUI.woff +0 -0
- package/src/webfonts/NanumGothic.ttf +0 -0
- package/src/webfonts/NanumGothicBold.ttf +0 -0
- package/src/webfonts/fa-brands-400.eot +0 -0
- package/src/webfonts/fa-brands-400.svg +0 -1008
- package/src/webfonts/fa-brands-400.ttf +0 -0
- package/src/webfonts/fa-brands-400.woff +0 -0
- package/src/webfonts/fa-brands-400.woff2 +0 -0
- package/src/webfonts/fa-regular-400.eot +0 -0
- package/src/webfonts/fa-regular-400.ttf +0 -0
- package/src/webfonts/fa-regular-400.woff +0 -0
- package/src/webfonts/fa-regular-400.woff2 +0 -0
- package/src/webfonts/fa-solid-900.eot +0 -0
- package/src/webfonts/fa-solid-900.svg +0 -1518
- package/src/webfonts/fa-solid-900.ttf +0 -0
- package/src/webfonts/fa-solid-900.woff +0 -0
- package/src/webfonts/fa-solid-900.woff2 +0 -0
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
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,57 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<slot/>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
export default {
|
|
9
|
-
props: {
|
|
10
|
-
value: {
|
|
11
|
-
type: Array,
|
|
12
|
-
default() {
|
|
13
|
-
return [];
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
data() {
|
|
18
|
-
return {
|
|
19
|
-
bindValue: this.value,
|
|
20
|
-
};
|
|
21
|
-
},
|
|
22
|
-
componentName: 'CheckboxGroup',
|
|
23
|
-
computed: {
|
|
24
|
-
},
|
|
25
|
-
watch: {
|
|
26
|
-
value(array) {
|
|
27
|
-
this.initValue(array);
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
mounted() {
|
|
31
|
-
this.initValue();
|
|
32
|
-
const bindValue = this.bindValue;
|
|
33
|
-
this.$on('change-event', (e) => {
|
|
34
|
-
const targetValue = e.target.value;
|
|
35
|
-
if (e.currentTarget.checked && bindValue.indexOf(targetValue) === -1) {
|
|
36
|
-
bindValue.push(targetValue);
|
|
37
|
-
} else if (!e.currentTarget.checked && bindValue.indexOf(targetValue) > -1) {
|
|
38
|
-
bindValue.splice(bindValue.indexOf(targetValue), 1);
|
|
39
|
-
}
|
|
40
|
-
this.$parent.$emit('input', bindValue);
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
methods: {
|
|
44
|
-
initValue(array) {
|
|
45
|
-
if (this.$children && this.$children instanceof Array) {
|
|
46
|
-
this.$children.forEach((c) => {
|
|
47
|
-
const child = c;
|
|
48
|
-
child.bindValue = array || this.value;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<style scoped>
|
|
57
|
-
</style>
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<label
|
|
3
|
-
:for="`${checkboxId}_${value}`"
|
|
4
|
-
:class="{ disabled: disabled }"
|
|
5
|
-
class="ev-checkbox-label"
|
|
6
|
-
>
|
|
7
|
-
<input
|
|
8
|
-
v-if="!isGroup"
|
|
9
|
-
:id="`${checkboxId}_${value}`"
|
|
10
|
-
:value="value"
|
|
11
|
-
:disabled="disabled"
|
|
12
|
-
v-model="bindValue"
|
|
13
|
-
type="checkbox"
|
|
14
|
-
class="ev-checkbox-input"
|
|
15
|
-
@change="change"
|
|
16
|
-
>
|
|
17
|
-
<input
|
|
18
|
-
v-else
|
|
19
|
-
:id="`${checkboxId}_${value}`"
|
|
20
|
-
:value="value"
|
|
21
|
-
:disabled="disabled"
|
|
22
|
-
v-model="groupBindValue"
|
|
23
|
-
type="checkbox"
|
|
24
|
-
class="ev-checkbox-input group"
|
|
25
|
-
@change="change"
|
|
26
|
-
>
|
|
27
|
-
<slot/>
|
|
28
|
-
</label>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<script>
|
|
32
|
-
export default {
|
|
33
|
-
model: {
|
|
34
|
-
prop: 'customValue',
|
|
35
|
-
},
|
|
36
|
-
props: {
|
|
37
|
-
value: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: '',
|
|
40
|
-
},
|
|
41
|
-
disabled: {
|
|
42
|
-
type: Boolean,
|
|
43
|
-
default: false,
|
|
44
|
-
},
|
|
45
|
-
customValue: {
|
|
46
|
-
type: [Boolean, Array],
|
|
47
|
-
default: null,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
data() {
|
|
51
|
-
return {
|
|
52
|
-
checkboxId: this._uid,
|
|
53
|
-
isGroup: false, // group태그가 존재하는 경우 true
|
|
54
|
-
groupBindValue: [],
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
computed: {
|
|
58
|
-
bindValue: {
|
|
59
|
-
get() {
|
|
60
|
-
return this.customValue;
|
|
61
|
-
},
|
|
62
|
-
set(list) {
|
|
63
|
-
this.groupBindValue = list;
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
created() {
|
|
68
|
-
this.isGroup = this.$parent.$options.componentName === 'CheckboxGroup';
|
|
69
|
-
},
|
|
70
|
-
methods: {
|
|
71
|
-
change(e) {
|
|
72
|
-
if (this.isGroup) {
|
|
73
|
-
this.$parent.$emit('change-event', e);
|
|
74
|
-
} else {
|
|
75
|
-
this.$emit('change-event', e);
|
|
76
|
-
this.$emit('input', e.target.checked);
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
</script>
|
|
82
|
-
|
|
83
|
-
<style scoped>
|
|
84
|
-
.ev-checkbox-label {
|
|
85
|
-
vertical-align: middle;
|
|
86
|
-
float: left;
|
|
87
|
-
user-select: none;
|
|
88
|
-
cursor: pointer;
|
|
89
|
-
}
|
|
90
|
-
.ev-checkbox-label.disabled {
|
|
91
|
-
color: #C0C4CC;
|
|
92
|
-
cursor: not-allowed;
|
|
93
|
-
}
|
|
94
|
-
.ev-checkbox-input {
|
|
95
|
-
vertical-align: middle;
|
|
96
|
-
cursor: inherit;
|
|
97
|
-
}
|
|
98
|
-
</style>
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:style="{ height: boxHeight+'px' }"
|
|
4
|
-
:class="isActive"
|
|
5
|
-
class="evui-codeview"
|
|
6
|
-
>
|
|
7
|
-
<div
|
|
8
|
-
v-if="description && !isBottom"
|
|
9
|
-
ref="descriptionLayer"
|
|
10
|
-
class="evui-codeview-description"
|
|
11
|
-
>
|
|
12
|
-
<span>{{ description }}</span>
|
|
13
|
-
</div>
|
|
14
|
-
<div
|
|
15
|
-
ref="exampleLayer"
|
|
16
|
-
class="evui-codeview-example-layer"
|
|
17
|
-
>
|
|
18
|
-
<slot/>
|
|
19
|
-
<div
|
|
20
|
-
v-if="description && isBottom"
|
|
21
|
-
ref="descriptionLayer"
|
|
22
|
-
class="evui-codeview-description"
|
|
23
|
-
>
|
|
24
|
-
<span>{{ description }}</span>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
<div>
|
|
28
|
-
<div class="evui-codeview-split-layer"/>
|
|
29
|
-
<div
|
|
30
|
-
ref="codeLayer"
|
|
31
|
-
class="evui-codeview-code-layer"
|
|
32
|
-
>
|
|
33
|
-
<codemirror
|
|
34
|
-
:value="rawCode"
|
|
35
|
-
:options="codeOption"
|
|
36
|
-
/>
|
|
37
|
-
</div>
|
|
38
|
-
<div
|
|
39
|
-
class="evui-codeview-example-bar"
|
|
40
|
-
@click.stop="onBottomClick"
|
|
41
|
-
>
|
|
42
|
-
<div
|
|
43
|
-
:class="selectIconClasses"
|
|
44
|
-
class="evui-codeview-example-bar-icon"
|
|
45
|
-
>
|
|
46
|
-
<icon class="fa-sort-down"/>
|
|
47
|
-
<span
|
|
48
|
-
class="evui-codeview-example-bar-span"
|
|
49
|
-
>{{ txtBottomBar }}</span>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</template>
|
|
55
|
-
|
|
56
|
-
<script>
|
|
57
|
-
import { codemirror } from 'vue-codemirror-lite';
|
|
58
|
-
import icon from '@/components/icon/icon';
|
|
59
|
-
|
|
60
|
-
export default {
|
|
61
|
-
components: {
|
|
62
|
-
icon,
|
|
63
|
-
codemirror,
|
|
64
|
-
},
|
|
65
|
-
props: {
|
|
66
|
-
codeUrl: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: '',
|
|
69
|
-
},
|
|
70
|
-
height: {
|
|
71
|
-
type: Number,
|
|
72
|
-
default: 0,
|
|
73
|
-
},
|
|
74
|
-
description: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: '',
|
|
77
|
-
},
|
|
78
|
-
isBottom: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
default: false,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
data() {
|
|
84
|
-
return {
|
|
85
|
-
resource: {},
|
|
86
|
-
rawCode: '',
|
|
87
|
-
boxHeight: this.height,
|
|
88
|
-
txtBottomBar: 'Expand',
|
|
89
|
-
isExpand: false,
|
|
90
|
-
codeOption: {
|
|
91
|
-
mode: 'vue',
|
|
92
|
-
tabSize: 4,
|
|
93
|
-
lineNumbers: false,
|
|
94
|
-
lineWrapping: true,
|
|
95
|
-
scrollbarStyle: null,
|
|
96
|
-
readOnly: true,
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
},
|
|
100
|
-
computed: {
|
|
101
|
-
isActive() {
|
|
102
|
-
return [
|
|
103
|
-
{
|
|
104
|
-
expand: this.isExpand,
|
|
105
|
-
},
|
|
106
|
-
];
|
|
107
|
-
},
|
|
108
|
-
selectIconClasses() {
|
|
109
|
-
return [
|
|
110
|
-
{
|
|
111
|
-
'select-down': this.txtBottomBar !== 'Expand',
|
|
112
|
-
},
|
|
113
|
-
];
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
mounted() {
|
|
117
|
-
const descriptionLayerHeight = this.$refs.descriptionLayer ?
|
|
118
|
-
this.$refs.descriptionLayer.getBoundingClientRect().height + 14.5 : 0;
|
|
119
|
-
const exampleLayerHeight = this.$refs.exampleLayer.getBoundingClientRect().height;
|
|
120
|
-
|
|
121
|
-
this.boxHeight = exampleLayerHeight + descriptionLayerHeight + 50;
|
|
122
|
-
},
|
|
123
|
-
created() {
|
|
124
|
-
this.$http.get(this.codeUrl)
|
|
125
|
-
.then((result) => {
|
|
126
|
-
setTimeout(() => {
|
|
127
|
-
this.rawCode = result.data;
|
|
128
|
-
}, 600);
|
|
129
|
-
}, (error) => {
|
|
130
|
-
throw new Error(error);
|
|
131
|
-
});
|
|
132
|
-
},
|
|
133
|
-
methods: {
|
|
134
|
-
onBottomClick: function onBottomClick() {
|
|
135
|
-
const codeLayerHeight = this.$refs.codeLayer.getBoundingClientRect().height;
|
|
136
|
-
const exampleLayerHeight = this.$refs.exampleLayer.getBoundingClientRect().height;
|
|
137
|
-
const descriptionLayerHeight = this.$refs.descriptionLayer ?
|
|
138
|
-
this.$refs.descriptionLayer.getBoundingClientRect().height + 14.5 : 0;
|
|
139
|
-
if (this.txtBottomBar === 'Expand') {
|
|
140
|
-
this.txtBottomBar = 'Hide';
|
|
141
|
-
this.boxHeight = codeLayerHeight + exampleLayerHeight + descriptionLayerHeight + 33;
|
|
142
|
-
} else {
|
|
143
|
-
this.txtBottomBar = 'Expand';
|
|
144
|
-
this.boxHeight = exampleLayerHeight + descriptionLayerHeight + 50;
|
|
145
|
-
}
|
|
146
|
-
this.isExpand = !this.isExpand;
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
</script>
|
|
151
|
-
<style scoped>
|
|
152
|
-
.evui-codeview{
|
|
153
|
-
position: relative;
|
|
154
|
-
width: 100%;
|
|
155
|
-
border: 1px solid #dfe6e9;
|
|
156
|
-
margin: 5px;
|
|
157
|
-
padding: 10px 10px 20px 10px;
|
|
158
|
-
border-radius: 6px;
|
|
159
|
-
overflow: hidden;
|
|
160
|
-
z-index: 1;
|
|
161
|
-
transition: height .3s ease-in-out;
|
|
162
|
-
}
|
|
163
|
-
.evui-codeview.expand{
|
|
164
|
-
transition: height .3s ease-in-out;
|
|
165
|
-
}
|
|
166
|
-
.evui-codeview-example-layer{
|
|
167
|
-
position: relative;
|
|
168
|
-
padding: 0px 0px 8px 0px;
|
|
169
|
-
}
|
|
170
|
-
.evui-codeview-split-layer{
|
|
171
|
-
position: relative;
|
|
172
|
-
border-bottom: 1px solid #dfe6e9;
|
|
173
|
-
}
|
|
174
|
-
.evui-codeview-code-layer{
|
|
175
|
-
position: relative;
|
|
176
|
-
width: 100%;
|
|
177
|
-
font-size: 8px;
|
|
178
|
-
}
|
|
179
|
-
.evui-codeview-example-bar{
|
|
180
|
-
position: absolute;
|
|
181
|
-
left: 0px;
|
|
182
|
-
bottom: 0px;
|
|
183
|
-
width: 100%;
|
|
184
|
-
height: 37px;
|
|
185
|
-
z-index: 10;
|
|
186
|
-
background-color: #ffffff;
|
|
187
|
-
transition: background-color .2s ease-in-out;
|
|
188
|
-
}
|
|
189
|
-
.evui-codeview-example-bar:hover{
|
|
190
|
-
cursor: pointer;
|
|
191
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
192
|
-
}
|
|
193
|
-
.evui-codeview-example:hover{
|
|
194
|
-
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
|
|
195
|
-
}
|
|
196
|
-
.evui-codeview-example-bar-icon{
|
|
197
|
-
width: 100%;
|
|
198
|
-
height: 100%;
|
|
199
|
-
line-height: 25px;
|
|
200
|
-
text-align: center;
|
|
201
|
-
}
|
|
202
|
-
.evui-codeview-example-bar-icon i{
|
|
203
|
-
height: 100%;
|
|
204
|
-
line-height: 30px;
|
|
205
|
-
font-size: 16px;
|
|
206
|
-
color: rgba(30, 101, 188, 0.5);
|
|
207
|
-
transition: all .3s ease-in-out;
|
|
208
|
-
}
|
|
209
|
-
.evui-codeview-example-bar-icon span{
|
|
210
|
-
line-height: 30px;
|
|
211
|
-
font-size: 13px;
|
|
212
|
-
font-weight: bold;
|
|
213
|
-
opacity: 0;
|
|
214
|
-
transition: all .3s ease-in-out;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.evui-codeview-example-bar-icon:hover i, .evui-codeview-example-bar-icon:hover span{
|
|
218
|
-
color: rgb(30, 101, 188);
|
|
219
|
-
opacity: 1;
|
|
220
|
-
transform: translateX(-6px);
|
|
221
|
-
transition: all .3s ease-out;
|
|
222
|
-
}
|
|
223
|
-
.evui-codeview-example-bar-icon.select-down i{
|
|
224
|
-
transform: rotate(180deg);
|
|
225
|
-
transition: transform .4s ease-out;
|
|
226
|
-
}
|
|
227
|
-
.evui-codeview-example-bar-icon, .evui-codeview-example-bar-icon-span {
|
|
228
|
-
user-select: none;
|
|
229
|
-
}
|
|
230
|
-
.evui-codeview-description {
|
|
231
|
-
border: 1px solid #dfe6e9;
|
|
232
|
-
border-radius: 2px;
|
|
233
|
-
padding: 5px 10px 8px 10px;
|
|
234
|
-
margin: 5px 3px 5px 3px;
|
|
235
|
-
background-color: #FAFAFA;
|
|
236
|
-
text-align: left;
|
|
237
|
-
line-height: 1.5;
|
|
238
|
-
}
|
|
239
|
-
.evui-codeview-description span{
|
|
240
|
-
font-size: 13px;
|
|
241
|
-
}
|
|
242
|
-
</style>
|