evui 2.0.9 → 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/{src/webfonts/fa-solid-900.svg → dist/962a1bf31c081691065fe333d9fa8105.svg} +1518 -1518
- package/{src/webfonts/fa-brands-400.svg → dist/a1a749e89f578a49306ec2b055c073da.svg} +1008 -1008
- package/dist/evui.min.js +304 -0
- package/dist/evui.min.js.gz +0 -0
- package/dist/evui.min.js.map +1 -0
- package/dist/main.css +5161 -0
- package/dist/main.css.gz +0 -0
- package/dist/main.css.map +1 -0
- package/package.json +125 -125
- 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.core.js +0 -406
- package/src/components/chart/chart.vue +0 -332
- 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/chart/element/element.bar.js +0 -117
- package/src/components/chart/element/element.line.js +0 -137
- package/src/components/chart/element/element.scatter.js +0 -76
- package/src/components/chart/helpers/helpers.canvas.js +0 -143
- package/src/components/chart/helpers/helpers.constant.js +0 -119
- package/src/components/chart/helpers/helpers.util.js +0 -109
- package/src/components/chart/index.js +0 -4
- package/src/components/chart/model/index.js +0 -4
- package/src/components/chart/model/model.series.js +0 -57
- package/src/components/chart/model/model.store.js +0 -165
- package/src/components/chart/plugins/plugins.legend.js +0 -447
- package/src/components/chart/plugins/plugins.title.js +0 -33
- package/src/components/chart/scale/scale.js +0 -210
- package/src/components/chart/scale/scale.linear.js +0 -18
- package/src/components/chart/scale/scale.logarithmic.js +0 -95
- package/src/components/chart/scale/scale.step.js +0 -160
- package/src/components/chart/scale/scale.time.js +0 -22
- package/src/components/checkbox/checkbox-group.vue +0 -72
- package/src/components/checkbox/checkbox.vue +0 -276
- 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 -1827
- package/src/components/datepicker/calendar.vue +0 -86
- package/src/components/datepicker/datepicker.vue +0 -630
- 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 -138
- package/src/components/loginfield/index.js +0 -3
- package/src/components/loginfield/loginfield.vue +0 -330
- 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 -54
- package/src/components/radio/radio.vue +0 -176
- package/src/components/radio-group/index.js +0 -3
- package/src/components/selectbox/dropdown.vue +0 -185
- package/src/components/selectbox/index.js +0 -3
- package/src/components/selectbox/listbox.vue +0 -116
- package/src/components/selectbox/option.vue +0 -11
- package/src/components/selectbox/selectbox.vue +0 -677
- 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/splitter/index.js +0 -3
- package/src/components/splitter/splitter.vue +0 -284
- 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 -1380
- 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 -418
- 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 -364
- 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 -795
- package/src/components/tree/tree.util.js +0 -119
- package/src/components/window/index.js +0 -3
- package/src/components/window/window.vue +0 -614
- package/src/index.js +0 -82
- 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/NanumGothicBold.ttf +0 -0
- /package/{src/webfonts/fa-solid-900.woff2 → dist/0ab54153eeeca0ce03978cc463b257f7.woff2} +0 -0
- /package/{src/webfonts/fa-brands-400.eot → dist/13db00b7a34fee4d819ab7f9838cc428.eot} +0 -0
- /package/{src/webfonts/EVUI.ttf → dist/3c9453211570a4ede66a4b4954a32bbb.ttf} +0 -0
- /package/{src/webfonts/fa-regular-400.eot → dist/701ae6abd4719e9c2ada3535a497b341.eot} +0 -0
- /package/{src/webfonts/NanumGothic.ttf → dist/7583da5c07275cd5eb364507616f998f.ttf} +0 -0
- /package/{src/webfonts/fa-solid-900.eot → dist/8e3c7f5520f5ae906c6cf6d7f3ddcd19.eot} +0 -0
- /package/{src/webfonts/fa-brands-400.woff → dist/a046592bac8f2fd96e994733faf3858c.woff} +0 -0
- /package/{src/webfonts/fa-regular-400.ttf → dist/ad97afd3337e8cda302d10ff5a4026b8.ttf} +0 -0
- /package/{src/images/evui_icon.png → dist/adac9fa4f723f9d2cb5b6640517114a9.png} +0 -0
- /package/{src/webfonts/fa-solid-900.ttf → dist/b87b9ba532ace76ae9f6edfe9f72ded2.ttf} +0 -0
- /package/{src/webfonts/EVUI.eot → dist/b9e64d9b5fa6b500eb5df6fa980d3e5b.eot} +0 -0
- /package/{src/webfonts/fa-brands-400.ttf → dist/c5ebe0b32dc1b5cc449a76c4204d13bb.ttf} +0 -0
- /package/{src/webfonts/fa-regular-400.woff2 → dist/cd6c777f1945164224dee082abaea03a.woff2} +0 -0
- /package/{src/webfonts/fa-brands-400.woff2 → dist/e8c322de9658cbeb8a774b6624167c2c.woff2} +0 -0
- /package/{src/webfonts/fa-regular-400.woff → dist/ef60a4f6c25ef7f39f2d25a748dbecfe.woff} +0 -0
- /package/{src/webfonts/EVUI.woff → dist/f0ac0c8b3c9cd3ef9002749985ae546f.woff} +0 -0
- /package/{src/webfonts/fa-solid-900.woff → dist/faff92145777a3cbaf8e7367b4807987.woff} +0 -0
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import Scale from './scale';
|
|
2
|
-
import Util from '../helpers/helpers.util';
|
|
3
|
-
|
|
4
|
-
class LogarithmicScale extends Scale {
|
|
5
|
-
calculateScaleRange(minMax) {
|
|
6
|
-
let maxValue;
|
|
7
|
-
let minValue;
|
|
8
|
-
if (this.range && this.range.length === 2) {
|
|
9
|
-
maxValue = this.range[1];
|
|
10
|
-
minValue = this.range[0];
|
|
11
|
-
} else {
|
|
12
|
-
maxValue = minMax.max;
|
|
13
|
-
minValue = minMax.min;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const rangeMagnitude = Util.calculateMagnitude(maxValue - minValue);
|
|
17
|
-
maxValue = Math.ceil(maxValue / (10 ** rangeMagnitude)) * (10 ** rangeMagnitude);
|
|
18
|
-
|
|
19
|
-
if (this.startToZero) {
|
|
20
|
-
minValue = 0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (maxValue === minValue) {
|
|
24
|
-
maxValue += 1;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const minLabel = this.getLabelFormat(minValue);
|
|
28
|
-
const maxLabel = this.getLabelFormat(maxValue);
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
min: minValue,
|
|
32
|
-
max: maxValue,
|
|
33
|
-
minLabel,
|
|
34
|
-
maxLabel,
|
|
35
|
-
size: Util.calcTextSize(maxLabel, Util.getLabelStyle(this.labelStyle)),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
calculateSteps(range, skipFitting) {
|
|
40
|
-
const maxValue = range.maxValue;
|
|
41
|
-
const minValue = range.minValue;
|
|
42
|
-
const maxSteps = range.maxSteps;
|
|
43
|
-
const rangeMagnitude = Util.calculateMagnitude(maxValue - minValue);
|
|
44
|
-
|
|
45
|
-
let interval = this.getInterval(range);
|
|
46
|
-
let numberOfSteps;
|
|
47
|
-
|
|
48
|
-
const graphMax = maxValue;
|
|
49
|
-
const graphMin = minValue;
|
|
50
|
-
const graphRange = graphMax - graphMin;
|
|
51
|
-
|
|
52
|
-
numberOfSteps = Math.round(graphRange / interval);
|
|
53
|
-
|
|
54
|
-
if (maxValue === 1) {
|
|
55
|
-
interval = 0.2;
|
|
56
|
-
numberOfSteps = 5;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
while ((numberOfSteps > maxSteps || (numberOfSteps * 2) < maxSteps) && !skipFitting) {
|
|
60
|
-
if (numberOfSteps > maxSteps) {
|
|
61
|
-
interval *= 2;
|
|
62
|
-
numberOfSteps = Math.ceil(graphRange / interval);
|
|
63
|
-
} else if (rangeMagnitude >= 0) {
|
|
64
|
-
if ((interval / 2) % 1 === 0) {
|
|
65
|
-
interval /= 2;
|
|
66
|
-
numberOfSteps = Math.ceil(graphRange / interval);
|
|
67
|
-
} else {
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
interval /= 2;
|
|
72
|
-
numberOfSteps = Math.ceil(graphRange / interval);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
steps: numberOfSteps,
|
|
78
|
-
interval,
|
|
79
|
-
graphMin,
|
|
80
|
-
graphMax: Math.ceil(graphMin + (numberOfSteps * interval)),
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
getLabelFormat(value) {
|
|
85
|
-
return Util.labelSignFormat(value, this.decimalPoint);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
getInterval(range) {
|
|
89
|
-
const max = range.maxValue;
|
|
90
|
-
const min = range.minValue;
|
|
91
|
-
return 10 ** Util.calculateMagnitude(max - min);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export default LogarithmicScale;
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import moment from 'moment';
|
|
2
|
-
import Scale from './scale';
|
|
3
|
-
import Util from '../helpers/helpers.util';
|
|
4
|
-
|
|
5
|
-
class StepScale extends Scale {
|
|
6
|
-
constructor(type, opt, ctx, labels) {
|
|
7
|
-
super(type, opt, ctx);
|
|
8
|
-
this.integratedLabels = labels;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
calculateScaleRange(minMax) {
|
|
12
|
-
const stepMinMax = this.timeMode ? minMax : Util.getStringMinMax(this.integratedLabels);
|
|
13
|
-
const maxValue = stepMinMax.max;
|
|
14
|
-
const minValue = stepMinMax.min;
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
min: minValue,
|
|
18
|
-
max: maxValue,
|
|
19
|
-
minLabel: this.getLabelFormat(minValue),
|
|
20
|
-
maxLabel: this.getLabelFormat(maxValue),
|
|
21
|
-
size: Util.calcTextSize(this.getLabelFormat(maxValue), Util.getLabelStyle(this.labelStyle)),
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
calculateSteps(range) {
|
|
26
|
-
const labels = this.integratedLabels;
|
|
27
|
-
const maxSteps = range.maxSteps;
|
|
28
|
-
|
|
29
|
-
let interval = 1;
|
|
30
|
-
let numberOfSteps;
|
|
31
|
-
|
|
32
|
-
const graphRange = labels.length;
|
|
33
|
-
|
|
34
|
-
numberOfSteps = Math.round(graphRange / interval);
|
|
35
|
-
|
|
36
|
-
while (numberOfSteps > maxSteps) {
|
|
37
|
-
interval *= 2;
|
|
38
|
-
numberOfSteps = Math.round(graphRange / interval);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
steps: numberOfSteps,
|
|
43
|
-
interval,
|
|
44
|
-
graphMin: range.minValue,
|
|
45
|
-
graphMax: range.maxValue,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
draw(chartRect, labelOffset, stepInfo) {
|
|
50
|
-
const ctx = this.ctx;
|
|
51
|
-
const labels = this.integratedLabels;
|
|
52
|
-
const aPos = {
|
|
53
|
-
x1: chartRect.x1 + labelOffset.left,
|
|
54
|
-
x2: chartRect.x2 - labelOffset.right,
|
|
55
|
-
y1: chartRect.y1 + labelOffset.top,
|
|
56
|
-
y2: chartRect.y2 - labelOffset.bottom,
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const steps = stepInfo.steps;
|
|
60
|
-
const interval = stepInfo.interval;
|
|
61
|
-
|
|
62
|
-
const startPoint = aPos[this.units.rectStart];
|
|
63
|
-
const endPoint = aPos[this.units.rectEnd];
|
|
64
|
-
const offsetPoint = aPos[this.units.rectOffset(this.position)];
|
|
65
|
-
const offsetCounterPoint = aPos[this.units.rectOffsetCounter(this.position)];
|
|
66
|
-
|
|
67
|
-
// label font 설정
|
|
68
|
-
ctx.font = Util.getLabelStyle(this.labelStyle);
|
|
69
|
-
|
|
70
|
-
if (this.type === 'x') {
|
|
71
|
-
ctx.textAlign = 'center';
|
|
72
|
-
ctx.textBaseline = this.position === 'top' ? 'bottom' : 'top';
|
|
73
|
-
} else {
|
|
74
|
-
ctx.textAlign = this.position === 'left' ? 'right' : 'left';
|
|
75
|
-
ctx.textBaseline = 'middle';
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
ctx.fillStyle = this.labelStyle.color;
|
|
79
|
-
ctx.lineWidth = 1;
|
|
80
|
-
const aliasPixel = Util.aliasPixel(ctx.lineWidth);
|
|
81
|
-
|
|
82
|
-
ctx.beginPath();
|
|
83
|
-
ctx.strokeStyle = this.axisLineColor;
|
|
84
|
-
if (this.type === 'x') {
|
|
85
|
-
ctx.moveTo(startPoint, offsetPoint + aliasPixel);
|
|
86
|
-
ctx.lineTo(endPoint, offsetPoint + aliasPixel);
|
|
87
|
-
} else {
|
|
88
|
-
ctx.moveTo(offsetPoint + aliasPixel, startPoint);
|
|
89
|
-
ctx.lineTo(offsetPoint + aliasPixel, endPoint);
|
|
90
|
-
}
|
|
91
|
-
ctx.stroke();
|
|
92
|
-
|
|
93
|
-
if (steps === 0) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const labelGap = (endPoint - startPoint) / labels.length;
|
|
98
|
-
let labelCenter = null;
|
|
99
|
-
let linePosition = null;
|
|
100
|
-
|
|
101
|
-
ctx.beginPath();
|
|
102
|
-
ctx.strokeStyle = this.gridLineColor;
|
|
103
|
-
|
|
104
|
-
let labelText;
|
|
105
|
-
let labelPoint;
|
|
106
|
-
let prevIndex = 0;
|
|
107
|
-
|
|
108
|
-
labels.reduce((prev, curr, index) => {
|
|
109
|
-
labelCenter = Math.round(startPoint + (labelGap * index));
|
|
110
|
-
linePosition = labelCenter + aliasPixel;
|
|
111
|
-
labelText = this.getLabelFormat(curr);
|
|
112
|
-
|
|
113
|
-
if (this.type === 'x') {
|
|
114
|
-
labelPoint = this.position === 'top' ? offsetPoint - 10 : offsetPoint + 10;
|
|
115
|
-
if (this.timeMode) {
|
|
116
|
-
if (prev.label !== labelText && (index === 0 || index - prev.index > interval)) {
|
|
117
|
-
prevIndex = index;
|
|
118
|
-
ctx.fillText(labelText, labelCenter + (labelGap / 2), labelPoint);
|
|
119
|
-
}
|
|
120
|
-
} else {
|
|
121
|
-
ctx.fillText(labelText, labelCenter + (labelGap / 2), labelPoint);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (index > 0 && this.showGrid) {
|
|
125
|
-
ctx.moveTo(linePosition, offsetPoint);
|
|
126
|
-
ctx.lineTo(linePosition, offsetCounterPoint);
|
|
127
|
-
}
|
|
128
|
-
} else {
|
|
129
|
-
labelPoint = this.position === 'left' ? offsetPoint - 10 : offsetPoint + 10;
|
|
130
|
-
if (this.timeMode) {
|
|
131
|
-
if (prev.label !== labelText && (index === 0 || index - prev.index > interval)) {
|
|
132
|
-
prevIndex = index;
|
|
133
|
-
ctx.fillText(labelText, labelPoint, labelCenter + (labelGap / 2));
|
|
134
|
-
}
|
|
135
|
-
} else {
|
|
136
|
-
ctx.fillText(labelText, labelPoint, labelCenter + (labelGap / 2));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (index > 0 && this.showGrid) {
|
|
140
|
-
ctx.moveTo(offsetPoint, linePosition);
|
|
141
|
-
ctx.lineTo(offsetCounterPoint, linePosition);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
ctx.stroke();
|
|
145
|
-
|
|
146
|
-
return { label: labelText, index: prevIndex };
|
|
147
|
-
}, { label: '', index: prevIndex });
|
|
148
|
-
|
|
149
|
-
ctx.closePath();
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
getLabelFormat(value) {
|
|
153
|
-
if (this.timeMode) {
|
|
154
|
-
return moment(new Date(value)).format(this.timeFormat);
|
|
155
|
-
}
|
|
156
|
-
return value;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export default StepScale;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import moment from 'moment';
|
|
2
|
-
import { TIME_INTERVALS } from '../helpers/helpers.constant';
|
|
3
|
-
import Scale from './scale';
|
|
4
|
-
|
|
5
|
-
class TimeScale extends Scale {
|
|
6
|
-
getLabelFormat(value) {
|
|
7
|
-
return moment(value).format(this.timeFormat);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
getInterval(range) {
|
|
11
|
-
const max = range.maxValue;
|
|
12
|
-
const min = range.minValue;
|
|
13
|
-
const step = range.maxSteps;
|
|
14
|
-
|
|
15
|
-
if (this.interval) {
|
|
16
|
-
return TIME_INTERVALS[this.interval].size;
|
|
17
|
-
}
|
|
18
|
-
return Math.ceil((max - min) / step);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default TimeScale;
|
|
@@ -1,72 +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
|
-
size: {
|
|
17
|
-
type: String,
|
|
18
|
-
default() {
|
|
19
|
-
return '';
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
type: {
|
|
23
|
-
type: String,
|
|
24
|
-
default() {
|
|
25
|
-
return '';
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
data() {
|
|
30
|
-
return {
|
|
31
|
-
bindValue: this.value,
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
componentName: 'CheckboxGroup',
|
|
35
|
-
computed: {
|
|
36
|
-
},
|
|
37
|
-
watch: {
|
|
38
|
-
value(array) {
|
|
39
|
-
this.initValue(array);
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
mounted() {
|
|
43
|
-
this.initValue();
|
|
44
|
-
const bindValue = this.bindValue;
|
|
45
|
-
this.$on('change-event', (e) => {
|
|
46
|
-
const targetValue = e.target.value;
|
|
47
|
-
if (e.currentTarget.checked && bindValue.indexOf(targetValue) === -1) {
|
|
48
|
-
bindValue.push(targetValue);
|
|
49
|
-
} else if (!e.currentTarget.checked && bindValue.indexOf(targetValue) > -1) {
|
|
50
|
-
bindValue.splice(bindValue.indexOf(targetValue), 1);
|
|
51
|
-
}
|
|
52
|
-
this.$parent.$emit('input', bindValue);
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
methods: {
|
|
56
|
-
initValue(array) {
|
|
57
|
-
if (this.$children && this.$children instanceof Array) {
|
|
58
|
-
const self = this;
|
|
59
|
-
this.$children.forEach((c) => {
|
|
60
|
-
const child = c;
|
|
61
|
-
child.bindValue = array || self.value;
|
|
62
|
-
child.bindSize = self.size;
|
|
63
|
-
child.bindType = self.type;
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
</script>
|
|
70
|
-
|
|
71
|
-
<style scoped>
|
|
72
|
-
</style>
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="[{ disabled: disabled }, dataSize]"
|
|
4
|
-
class="ev-checkbox-wrap"
|
|
5
|
-
>
|
|
6
|
-
<input
|
|
7
|
-
v-if="!isGroup"
|
|
8
|
-
:id="`${checkboxId}_${value}`"
|
|
9
|
-
:value="value"
|
|
10
|
-
:disabled="disabled"
|
|
11
|
-
v-model="bindValue"
|
|
12
|
-
type="checkbox"
|
|
13
|
-
class="ev-checkbox-input"
|
|
14
|
-
@change="change"
|
|
15
|
-
@click="click"
|
|
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
|
-
<label
|
|
28
|
-
:for="`${checkboxId}_${value}`"
|
|
29
|
-
:class="[dataSize, dataType, dataAfterType]"
|
|
30
|
-
class="ev-checkbox-label"
|
|
31
|
-
>
|
|
32
|
-
<slot/>
|
|
33
|
-
</label>
|
|
34
|
-
</div>
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<script>
|
|
38
|
-
export default {
|
|
39
|
-
model: {
|
|
40
|
-
prop: 'customValue',
|
|
41
|
-
},
|
|
42
|
-
props: {
|
|
43
|
-
value: {
|
|
44
|
-
type: String,
|
|
45
|
-
default: '',
|
|
46
|
-
},
|
|
47
|
-
disabled: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
default: false,
|
|
50
|
-
},
|
|
51
|
-
customValue: {
|
|
52
|
-
type: [Boolean, Array],
|
|
53
|
-
default: null,
|
|
54
|
-
},
|
|
55
|
-
size: {
|
|
56
|
-
type: String,
|
|
57
|
-
default: '',
|
|
58
|
-
},
|
|
59
|
-
type: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: '',
|
|
62
|
-
},
|
|
63
|
-
afterType: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: '',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
data() {
|
|
69
|
-
return {
|
|
70
|
-
checkboxId: this._uid,
|
|
71
|
-
isGroup: false, // group태그가 존재하는 경우 true
|
|
72
|
-
groupBindValue: [],
|
|
73
|
-
dataSize: this.size,
|
|
74
|
-
dataType: this.type,
|
|
75
|
-
// dataAfterType: this.afterType,
|
|
76
|
-
};
|
|
77
|
-
},
|
|
78
|
-
computed: {
|
|
79
|
-
bindValue: {
|
|
80
|
-
get() {
|
|
81
|
-
return this.customValue;
|
|
82
|
-
},
|
|
83
|
-
set(list) {
|
|
84
|
-
this.groupBindValue = list;
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
bindSize: {
|
|
88
|
-
get() {
|
|
89
|
-
return this.size;
|
|
90
|
-
},
|
|
91
|
-
set(size) {
|
|
92
|
-
this.dataSize = size;
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
bindType: {
|
|
96
|
-
get() {
|
|
97
|
-
return this.type;
|
|
98
|
-
},
|
|
99
|
-
set(size) {
|
|
100
|
-
this.dataType = size;
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
dataAfterType() {
|
|
104
|
-
return this.afterType;
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
created() {
|
|
108
|
-
this.isGroup = this.$parent.$options.componentName === 'CheckboxGroup';
|
|
109
|
-
},
|
|
110
|
-
methods: {
|
|
111
|
-
change(e) {
|
|
112
|
-
if (this.isGroup) {
|
|
113
|
-
this.$parent.$emit('change-event', e);
|
|
114
|
-
} else {
|
|
115
|
-
this.$emit('change-event', e);
|
|
116
|
-
this.$emit('input', e.target.checked);
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
click(e) {
|
|
120
|
-
if (this.isGroup) {
|
|
121
|
-
this.$parent.$emit('click-event', e);
|
|
122
|
-
} else {
|
|
123
|
-
this.$emit('click-event', e);
|
|
124
|
-
this.$emit('input', e.target.checked);
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
</script>
|
|
130
|
-
|
|
131
|
-
<style scoped>
|
|
132
|
-
.ev-checkbox-wrap {
|
|
133
|
-
height: 19px;
|
|
134
|
-
float: left;
|
|
135
|
-
user-select: none;
|
|
136
|
-
}
|
|
137
|
-
.ev-checkbox-wrap.small{
|
|
138
|
-
height: 16px;
|
|
139
|
-
}
|
|
140
|
-
.ev-checkbox-wrap.disabled {
|
|
141
|
-
color: #C0C4CC;
|
|
142
|
-
}
|
|
143
|
-
.ev-checkbox-label {
|
|
144
|
-
position: relative;
|
|
145
|
-
height: 100%;
|
|
146
|
-
display: inline-block;
|
|
147
|
-
padding-left: 25px;
|
|
148
|
-
line-height: 19px;
|
|
149
|
-
cursor: pointer;
|
|
150
|
-
}
|
|
151
|
-
.ev-checkbox-label.small {
|
|
152
|
-
padding-left: 23px;
|
|
153
|
-
line-height: 16px;
|
|
154
|
-
}
|
|
155
|
-
.ev-checkbox-label:before {
|
|
156
|
-
position: absolute;
|
|
157
|
-
top: 50%;
|
|
158
|
-
left: 2px;
|
|
159
|
-
width: 16px;
|
|
160
|
-
height: 16px;
|
|
161
|
-
background: transparent;
|
|
162
|
-
border: 1px solid #B0B3B7;
|
|
163
|
-
border-radius: 100%;
|
|
164
|
-
text-align: center;
|
|
165
|
-
transform: translateY(-50%);
|
|
166
|
-
content: '';
|
|
167
|
-
}
|
|
168
|
-
.ev-checkbox-label.square:before {
|
|
169
|
-
border-radius: 0;
|
|
170
|
-
}
|
|
171
|
-
.ev-checkbox-label.small:before {
|
|
172
|
-
width: 12px;
|
|
173
|
-
height: 12px;
|
|
174
|
-
}
|
|
175
|
-
.ev-checkbox-wrap.disabled .ev-checkbox-label {
|
|
176
|
-
cursor: not-allowed;
|
|
177
|
-
}
|
|
178
|
-
.ev-checkbox-wrap.disabled .ev-checkbox-label:before {
|
|
179
|
-
border: 1px solid #B01012;
|
|
180
|
-
}
|
|
181
|
-
.ev-checkbox-input {
|
|
182
|
-
position: absolute;
|
|
183
|
-
width: 1px;
|
|
184
|
-
height: 1px;
|
|
185
|
-
padding: 0;
|
|
186
|
-
border: 0;
|
|
187
|
-
vertical-align: middle;
|
|
188
|
-
overflow: hidden;
|
|
189
|
-
cursor: inherit;
|
|
190
|
-
clip: rect(0, 0, 0, 0);
|
|
191
|
-
}
|
|
192
|
-
.ev-checkbox-input:checked + .ev-checkbox-label:before {
|
|
193
|
-
border: 1px solid #41B7FD;
|
|
194
|
-
}
|
|
195
|
-
.ev-checkbox-wrap.disabled .ev-checkbox-input:checked + .ev-checkbox-label:before {
|
|
196
|
-
border: 1px solid #B01012;
|
|
197
|
-
}
|
|
198
|
-
.ev-checkbox-input:checked + .ev-checkbox-label:after {
|
|
199
|
-
position: absolute;
|
|
200
|
-
top: 50%;
|
|
201
|
-
left: 7px;
|
|
202
|
-
width: 8px;
|
|
203
|
-
height: 8px;
|
|
204
|
-
border-radius: 100%;
|
|
205
|
-
transform: translateY(-50%);
|
|
206
|
-
content: '';
|
|
207
|
-
}
|
|
208
|
-
.ev-checkbox-input:checked + .ev-checkbox-label:after {
|
|
209
|
-
background: #41B7FD;
|
|
210
|
-
}
|
|
211
|
-
.ev-checkbox-input:checked + .ev-checkbox-label.check:after {
|
|
212
|
-
border: solid #41B7FD;
|
|
213
|
-
border-radius: 0;
|
|
214
|
-
border-width: 0 2px 2px 0;
|
|
215
|
-
transform: rotate(45deg);
|
|
216
|
-
}
|
|
217
|
-
.ev-checkbox-input:checked + .ev-checkbox-label.check.small:after {
|
|
218
|
-
border: solid #41B7FD;
|
|
219
|
-
border-radius: 0;
|
|
220
|
-
border-width: 0 1.5px 1.5px 0;
|
|
221
|
-
transform: rotate(45deg);
|
|
222
|
-
}
|
|
223
|
-
.ev-checkbox-wrap.disabled .ev-checkbox-input:checked + .ev-checkbox-label:after {
|
|
224
|
-
background: #B01012;
|
|
225
|
-
}
|
|
226
|
-
.ev-checkbox-wrap.disabled .ev-checkbox-input:checked + .ev-checkbox-label.check:after {
|
|
227
|
-
border: solid #B01012;
|
|
228
|
-
border-radius: 0;
|
|
229
|
-
border-width: 0 2px 2px 0;
|
|
230
|
-
transform: rotate(45deg);
|
|
231
|
-
}
|
|
232
|
-
.ev-checkbox-wrap.disabled .ev-checkbox-input:checked + .ev-checkbox-label.check.small:after {
|
|
233
|
-
border: solid #B01012;
|
|
234
|
-
border-radius: 0;
|
|
235
|
-
border-width: 0 1.5px 1.5px 0;
|
|
236
|
-
transform: rotate(45deg);
|
|
237
|
-
}
|
|
238
|
-
.ev-checkbox-input:checked + .ev-checkbox-label.square:after {
|
|
239
|
-
border-radius: 0;
|
|
240
|
-
}
|
|
241
|
-
.ev-checkbox-input:checked + .ev-checkbox-label.check:after {
|
|
242
|
-
background: none;
|
|
243
|
-
border-radius: 0;
|
|
244
|
-
}
|
|
245
|
-
.ev-checkbox-input:checked + .ev-checkbox-label.small:after {
|
|
246
|
-
left: 6px;
|
|
247
|
-
width: 6px;
|
|
248
|
-
height: 6px;
|
|
249
|
-
}
|
|
250
|
-
.ev-checkbox-input:checked + .ev-checkbox-label.minus:after {
|
|
251
|
-
left: 5px;
|
|
252
|
-
width: 12px;
|
|
253
|
-
height: 4px;
|
|
254
|
-
border-radius: 0;
|
|
255
|
-
}
|
|
256
|
-
.ev-checkbox-input:checked + .ev-checkbox-label.minus.small:after {
|
|
257
|
-
width: 8px;
|
|
258
|
-
height: 2px;
|
|
259
|
-
}
|
|
260
|
-
.ev-checkbox-input:checked + .ev-checkbox-label.check:after {
|
|
261
|
-
display: block;
|
|
262
|
-
top: 4px;
|
|
263
|
-
left: 7px;
|
|
264
|
-
width: 5px;
|
|
265
|
-
height: 8px;
|
|
266
|
-
background: none;
|
|
267
|
-
content: '';
|
|
268
|
-
}
|
|
269
|
-
.ev-checkbox-input:checked + .ev-checkbox-label.check.small:after {
|
|
270
|
-
top: 3px;
|
|
271
|
-
left: 6px;
|
|
272
|
-
width: 4px;
|
|
273
|
-
height: 6px;
|
|
274
|
-
background: none;
|
|
275
|
-
}
|
|
276
|
-
</style>
|