evui 3.3.36 → 3.3.39
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/LICENSE +21 -21
- package/README.md +40 -40
- package/dist/evui.common.js +1907 -1832
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +1907 -1832
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/dist/img/{EVUI.7f3588fb.svg → EVUI.b82ee81a.svg} +292 -292
- package/dist/img/{icon_mysql.7ea26d5d.svg → icon_mysql.1085fdc9.svg} +78 -78
- package/dist/img/{icon_oracle.9009b108.svg → icon_oracle.0572d3ee.svg} +13 -13
- package/dist/img/{icon_postgresql.f8fffba9.svg → icon_postgresql.ee12bde8.svg} +58 -58
- package/package.json +61 -61
- package/src/common/emitter.js +20 -20
- package/src/common/utils.debounce.js +223 -223
- package/src/common/utils.js +134 -134
- package/src/common/utils.table.js +78 -78
- package/src/common/utils.throttle.js +83 -83
- package/src/common/utils.tree.js +18 -18
- package/src/components/button/Button.vue +198 -198
- package/src/components/button/index.js +7 -7
- package/src/components/buttonGroup/ButtonGroup.vue +11 -11
- package/src/components/buttonGroup/index.js +7 -7
- package/src/components/calendar/Calendar.vue +661 -661
- package/src/components/calendar/index.js +7 -7
- package/src/components/calendar/uses.js +1272 -1272
- package/src/components/chart/Chart.vue +189 -192
- package/src/components/chart/chart.core.js +870 -870
- package/src/components/chart/element/element.bar.js +524 -524
- package/src/components/chart/element/element.bar.time.js +156 -156
- package/src/components/chart/element/element.heatmap.js +533 -533
- package/src/components/chart/element/element.line.js +339 -339
- package/src/components/chart/element/element.pie.js +197 -197
- package/src/components/chart/element/element.scatter.js +184 -184
- package/src/components/chart/element/element.tip.js +550 -542
- package/src/components/chart/helpers/helpers.canvas.js +265 -265
- package/src/components/chart/helpers/helpers.constant.js +206 -206
- package/src/components/chart/helpers/helpers.util.js +346 -338
- package/src/components/chart/index.js +9 -9
- package/src/components/chart/model/index.js +4 -4
- package/src/components/chart/model/model.series.js +93 -93
- package/src/components/chart/model/model.store.js +977 -967
- package/src/components/chart/plugins/plugins.interaction.js +769 -769
- package/src/components/chart/plugins/plugins.legend.gradient.js +602 -602
- package/src/components/chart/plugins/plugins.legend.js +1155 -1151
- package/src/components/chart/plugins/plugins.pie.js +254 -254
- package/src/components/chart/plugins/plugins.title.js +56 -56
- package/src/components/chart/plugins/plugins.tooltip.js +692 -692
- package/src/components/chart/scale/scale.js +848 -848
- package/src/components/chart/scale/scale.linear.js +38 -38
- package/src/components/chart/scale/scale.logarithmic.js +128 -128
- package/src/components/chart/scale/scale.step.js +336 -336
- package/src/components/chart/scale/scale.time.category.js +277 -277
- package/src/components/chart/scale/scale.time.js +48 -48
- package/src/components/chart/style/chart.scss +312 -312
- package/src/components/chart/uses.js +264 -252
- package/src/components/checkbox/Checkbox.vue +200 -200
- package/src/components/checkbox/index.js +7 -7
- package/src/components/checkboxGroup/CheckboxGroup.vue +44 -44
- package/src/components/checkboxGroup/index.js +7 -7
- package/src/components/contextMenu/ContextMenu.vue +80 -80
- package/src/components/contextMenu/MenuList.vue +149 -149
- package/src/components/contextMenu/index.js +7 -7
- package/src/components/contextMenu/uses.js +203 -203
- package/src/components/datePicker/DatePicker.vue +437 -437
- package/src/components/datePicker/index.js +7 -7
- package/src/components/datePicker/uses.js +419 -419
- package/src/components/grid/Grid.vue +827 -827
- package/src/components/grid/grid.filter.window.vue +493 -493
- package/src/components/grid/grid.pagination.vue +75 -75
- package/src/components/grid/grid.summary.vue +265 -265
- package/src/components/grid/grid.toolbar.vue +26 -26
- package/src/components/grid/index.js +11 -11
- package/src/components/grid/style/grid.scss +263 -263
- package/src/components/grid/uses.js +1002 -1007
- package/src/components/icon/Icon.vue +49 -49
- package/src/components/icon/index.js +8 -8
- package/src/components/inputNumber/InputNumber.vue +212 -212
- package/src/components/inputNumber/index.js +7 -7
- package/src/components/inputNumber/uses.js +217 -217
- package/src/components/loading/Loading.vue +125 -125
- package/src/components/loading/index.js +7 -7
- package/src/components/menu/Menu.vue +68 -68
- package/src/components/menu/MenuItem.vue +187 -187
- package/src/components/menu/index.js +7 -7
- package/src/components/message/Message.vue +223 -223
- package/src/components/message/index.js +31 -31
- package/src/components/messageBox/MessageBox.vue +358 -358
- package/src/components/messageBox/index.js +22 -22
- package/src/components/notification/Notification.vue +316 -316
- package/src/components/notification/index.js +49 -49
- package/src/components/pagination/Pagination.vue +271 -271
- package/src/components/pagination/index.js +7 -7
- package/src/components/pagination/pageButton.vue +30 -30
- package/src/components/progress/Progress.vue +139 -139
- package/src/components/progress/index.js +7 -7
- package/src/components/radio/Radio.vue +159 -159
- package/src/components/radio/index.js +7 -7
- package/src/components/radioGroup/RadioGroup.vue +41 -41
- package/src/components/radioGroup/index.js +7 -7
- package/src/components/scheduler/Scheduler.vue +149 -149
- package/src/components/scheduler/index.js +7 -7
- package/src/components/scheduler/uses.js +183 -183
- package/src/components/select/Select.vue +440 -440
- package/src/components/select/index.js +7 -7
- package/src/components/select/uses.js +270 -270
- package/src/components/slider/Slider.vue +505 -505
- package/src/components/slider/index.js +7 -7
- package/src/components/slider/uses.js +390 -390
- package/src/components/tabPanel/TabPanel.vue +74 -74
- package/src/components/tabPanel/index.js +7 -7
- package/src/components/tabs/Tabs.vue +517 -517
- package/src/components/tabs/index.js +7 -7
- package/src/components/textField/TextField.vue +375 -375
- package/src/components/textField/index.js +7 -7
- package/src/components/timePicker/TimePicker.vue +352 -352
- package/src/components/timePicker/index.js +7 -7
- package/src/components/toggle/Toggle.vue +115 -115
- package/src/components/toggle/index.js +7 -7
- package/src/components/tree/Tree.vue +313 -313
- package/src/components/tree/TreeNode.vue +293 -293
- package/src/components/tree/index.js +7 -7
- package/src/components/treeGrid/TreeGrid.vue +758 -758
- package/src/components/treeGrid/TreeGridNode.vue +275 -275
- package/src/components/treeGrid/index.js +9 -9
- package/src/components/treeGrid/style/treeGrid.scss +261 -261
- package/src/components/treeGrid/treeGrid.toolbar.vue +26 -26
- package/src/components/treeGrid/uses.js +867 -867
- package/src/components/window/Window.vue +329 -329
- package/src/components/window/index.js +7 -7
- package/src/components/window/uses.js +899 -899
- package/src/directives/clickoutside.js +90 -90
- package/src/main.js +116 -116
- package/src/style/components/input.scss +108 -108
- package/src/style/functions.scss +3 -3
- package/src/style/index.scss +6 -6
- package/src/style/lib/fonts/EVUI.svg +292 -292
- package/src/style/lib/icon.css +888 -888
- package/src/style/mixins.scss +94 -94
- package/src/style/themes.scss +67 -67
- package/src/style/variables.scss +22 -22
package/src/common/utils.js
CHANGED
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
const windowConsole = window.console;
|
|
2
|
-
export const Console = {
|
|
3
|
-
log(...data) {
|
|
4
|
-
windowConsole.log(...data);
|
|
5
|
-
},
|
|
6
|
-
warn(...data) {
|
|
7
|
-
windowConsole.warn(...data);
|
|
8
|
-
},
|
|
9
|
-
info(...data) {
|
|
10
|
-
windowConsole.info(...data);
|
|
11
|
-
},
|
|
12
|
-
error(...data) {
|
|
13
|
-
windowConsole.error(...data);
|
|
14
|
-
},
|
|
15
|
-
debug(...data) {
|
|
16
|
-
windowConsole.debug(...data);
|
|
17
|
-
},
|
|
18
|
-
dir(item, options) {
|
|
19
|
-
windowConsole.dir(item, options);
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export function getQuantity(input) {
|
|
24
|
-
let output = null;
|
|
25
|
-
if (typeof input === 'string' || typeof input === 'number') {
|
|
26
|
-
const match = /^(normal|(-*\d+(?:\.\d+)?)(px|%)?)$/.exec(input);
|
|
27
|
-
output = match ? { value: +match[2], unit: match[3] || undefined } : null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return output;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function getSize(size) {
|
|
34
|
-
let sizeValue = '100%';
|
|
35
|
-
if (size) {
|
|
36
|
-
sizeValue = size.unit ? size.value + size.unit : `${size.value}px`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return sizeValue;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function getMatchedComponentsDownward(context, componentName) {
|
|
43
|
-
const children = context.$children;
|
|
44
|
-
const result = [];
|
|
45
|
-
if (!children) {
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
for (let i = 0; i < children.length; i++) {
|
|
49
|
-
const v = children[i];
|
|
50
|
-
const name = v.$options.name;
|
|
51
|
-
if (name === componentName) {
|
|
52
|
-
result.push(v);
|
|
53
|
-
} else {
|
|
54
|
-
result.concat(getMatchedComponentsDownward(v, componentName));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function getMatchedComponentUpward(context, componentName) {
|
|
61
|
-
let parent = context.$parent;
|
|
62
|
-
let name = parent.$options.name;
|
|
63
|
-
|
|
64
|
-
while (parent && (!name || componentName !== name)) {
|
|
65
|
-
parent = parent.$parent;
|
|
66
|
-
if (parent) {
|
|
67
|
-
name = parent.$options.name;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return parent;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function truthyNumber(v) {
|
|
75
|
-
return typeof v === 'number' && !Number.isNaN(v);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function truthy(...args) {
|
|
79
|
-
return args.every(truthyNumber);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function convertToPercent(value, totalValue) {
|
|
83
|
-
const res = (value / totalValue) * 100;
|
|
84
|
-
if (!truthy(value, totalValue, res) || value === 0 || totalValue === 0) {
|
|
85
|
-
return 0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return res.toFixed(2);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export function convertToValue(value, totalValue) {
|
|
92
|
-
const res = (value / 100) * totalValue;
|
|
93
|
-
if (!truthy(value, totalValue, res) || value === 0 || totalValue === 0) {
|
|
94
|
-
return 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return res.toFixed(2);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function millions(v) {
|
|
101
|
-
return truthy(v) ? 1e6 * v : 0;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function billions(v) {
|
|
105
|
-
return truthy(v) ? 1e9 * v : 0;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function trillion(v) {
|
|
109
|
-
return truthy(v) ? 1e12 * v : 0;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function quadrillion(v) {
|
|
113
|
-
return truthy(v) ? 1e15 * v : 0;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export function numberWithComma(v) {
|
|
117
|
-
const reg = /\B(?=(\d{3})+(?!\d))/g;
|
|
118
|
-
|
|
119
|
-
if (truthy(v)) {
|
|
120
|
-
if (Number.isInteger(v)) {
|
|
121
|
-
return v.toString().replace(reg, ',');
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const part = v.toString().split('.');
|
|
125
|
-
return part[0].replace(reg, ',') + (part[1] ? `.${part[1]}` : '');
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export function getPrecision(v) {
|
|
132
|
-
const decimal = v?.toString().split('.')[1] || 0;
|
|
133
|
-
return decimal ? decimal.length : 0;
|
|
134
|
-
}
|
|
1
|
+
const windowConsole = window.console;
|
|
2
|
+
export const Console = {
|
|
3
|
+
log(...data) {
|
|
4
|
+
windowConsole.log(...data);
|
|
5
|
+
},
|
|
6
|
+
warn(...data) {
|
|
7
|
+
windowConsole.warn(...data);
|
|
8
|
+
},
|
|
9
|
+
info(...data) {
|
|
10
|
+
windowConsole.info(...data);
|
|
11
|
+
},
|
|
12
|
+
error(...data) {
|
|
13
|
+
windowConsole.error(...data);
|
|
14
|
+
},
|
|
15
|
+
debug(...data) {
|
|
16
|
+
windowConsole.debug(...data);
|
|
17
|
+
},
|
|
18
|
+
dir(item, options) {
|
|
19
|
+
windowConsole.dir(item, options);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export function getQuantity(input) {
|
|
24
|
+
let output = null;
|
|
25
|
+
if (typeof input === 'string' || typeof input === 'number') {
|
|
26
|
+
const match = /^(normal|(-*\d+(?:\.\d+)?)(px|%)?)$/.exec(input);
|
|
27
|
+
output = match ? { value: +match[2], unit: match[3] || undefined } : null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return output;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getSize(size) {
|
|
34
|
+
let sizeValue = '100%';
|
|
35
|
+
if (size) {
|
|
36
|
+
sizeValue = size.unit ? size.value + size.unit : `${size.value}px`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return sizeValue;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function getMatchedComponentsDownward(context, componentName) {
|
|
43
|
+
const children = context.$children;
|
|
44
|
+
const result = [];
|
|
45
|
+
if (!children) {
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
for (let i = 0; i < children.length; i++) {
|
|
49
|
+
const v = children[i];
|
|
50
|
+
const name = v.$options.name;
|
|
51
|
+
if (name === componentName) {
|
|
52
|
+
result.push(v);
|
|
53
|
+
} else {
|
|
54
|
+
result.concat(getMatchedComponentsDownward(v, componentName));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function getMatchedComponentUpward(context, componentName) {
|
|
61
|
+
let parent = context.$parent;
|
|
62
|
+
let name = parent.$options.name;
|
|
63
|
+
|
|
64
|
+
while (parent && (!name || componentName !== name)) {
|
|
65
|
+
parent = parent.$parent;
|
|
66
|
+
if (parent) {
|
|
67
|
+
name = parent.$options.name;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return parent;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function truthyNumber(v) {
|
|
75
|
+
return typeof v === 'number' && !Number.isNaN(v);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function truthy(...args) {
|
|
79
|
+
return args.every(truthyNumber);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function convertToPercent(value, totalValue) {
|
|
83
|
+
const res = (value / totalValue) * 100;
|
|
84
|
+
if (!truthy(value, totalValue, res) || value === 0 || totalValue === 0) {
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return res.toFixed(2);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function convertToValue(value, totalValue) {
|
|
92
|
+
const res = (value / 100) * totalValue;
|
|
93
|
+
if (!truthy(value, totalValue, res) || value === 0 || totalValue === 0) {
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return res.toFixed(2);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function millions(v) {
|
|
101
|
+
return truthy(v) ? 1e6 * v : 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function billions(v) {
|
|
105
|
+
return truthy(v) ? 1e9 * v : 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function trillion(v) {
|
|
109
|
+
return truthy(v) ? 1e12 * v : 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function quadrillion(v) {
|
|
113
|
+
return truthy(v) ? 1e15 * v : 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function numberWithComma(v) {
|
|
117
|
+
const reg = /\B(?=(\d{3})+(?!\d))/g;
|
|
118
|
+
|
|
119
|
+
if (truthy(v)) {
|
|
120
|
+
if (Number.isInteger(v)) {
|
|
121
|
+
return v.toString().replace(reg, ',');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const part = v.toString().split('.');
|
|
125
|
+
return part[0].replace(reg, ',') + (part[1] ? `.${part[1]}` : '');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function getPrecision(v) {
|
|
132
|
+
const decimal = v?.toString().split('.')[1] || 0;
|
|
133
|
+
return decimal ? decimal.length : 0;
|
|
134
|
+
}
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
quantity(input) {
|
|
3
|
-
let output;
|
|
4
|
-
|
|
5
|
-
if (typeof input === 'string' || typeof input === 'number') {
|
|
6
|
-
const match = (/^(normal|(\d+(?:\.\d+)?)(px|%)?)$/).exec(input);
|
|
7
|
-
output = match ? { value: +match[2], unit: match[3] || undefined } : undefined;
|
|
8
|
-
} else {
|
|
9
|
-
output = undefined;
|
|
10
|
-
}
|
|
11
|
-
return output;
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* % 는 퍼센트로 숫자 및 문자 숫자는 px로 이상한값은 0px로 반환
|
|
16
|
-
* @param input
|
|
17
|
-
* @returns px | % | undefiend
|
|
18
|
-
*/
|
|
19
|
-
numberToPixel(input) {
|
|
20
|
-
let output;
|
|
21
|
-
let result;
|
|
22
|
-
|
|
23
|
-
if (typeof input === 'string' || typeof input === 'number') {
|
|
24
|
-
const match = (/^(normal|(\d+(?:\.\d+)?)(px|%)?)$/).exec(input);
|
|
25
|
-
output = match ? { value: +match[2], unit: match[3] || undefined } : undefined;
|
|
26
|
-
} else {
|
|
27
|
-
output = undefined;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (output === null || output === undefined) {
|
|
31
|
-
result = undefined;
|
|
32
|
-
} else if (output.unit === '%') {
|
|
33
|
-
result = `${output.value}%`;
|
|
34
|
-
} else {
|
|
35
|
-
result = `${output.value}px`;
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* % 값인지 확인 하기
|
|
42
|
-
* @param val
|
|
43
|
-
* @returns true | false
|
|
44
|
-
*/
|
|
45
|
-
isPercentValue(val) {
|
|
46
|
-
let result;
|
|
47
|
-
if (typeof val !== 'string') {
|
|
48
|
-
result = false;
|
|
49
|
-
} else if (val.indexOf('%') === (val.length - 1)) {
|
|
50
|
-
result = true;
|
|
51
|
-
} else {
|
|
52
|
-
result = false;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return result;
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 컬럼 min max 체크하기
|
|
60
|
-
* @param val
|
|
61
|
-
* @param min
|
|
62
|
-
* @param max
|
|
63
|
-
* @returns {*}
|
|
64
|
-
*/
|
|
65
|
-
checkColSize(val, min, max) {
|
|
66
|
-
let result;
|
|
67
|
-
|
|
68
|
-
if (min && val < min) {
|
|
69
|
-
result = min;
|
|
70
|
-
} else if (max && val > max) {
|
|
71
|
-
result = max;
|
|
72
|
-
} else {
|
|
73
|
-
result = val;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return result;
|
|
77
|
-
},
|
|
78
|
-
};
|
|
1
|
+
export default {
|
|
2
|
+
quantity(input) {
|
|
3
|
+
let output;
|
|
4
|
+
|
|
5
|
+
if (typeof input === 'string' || typeof input === 'number') {
|
|
6
|
+
const match = (/^(normal|(\d+(?:\.\d+)?)(px|%)?)$/).exec(input);
|
|
7
|
+
output = match ? { value: +match[2], unit: match[3] || undefined } : undefined;
|
|
8
|
+
} else {
|
|
9
|
+
output = undefined;
|
|
10
|
+
}
|
|
11
|
+
return output;
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* % 는 퍼센트로 숫자 및 문자 숫자는 px로 이상한값은 0px로 반환
|
|
16
|
+
* @param input
|
|
17
|
+
* @returns px | % | undefiend
|
|
18
|
+
*/
|
|
19
|
+
numberToPixel(input) {
|
|
20
|
+
let output;
|
|
21
|
+
let result;
|
|
22
|
+
|
|
23
|
+
if (typeof input === 'string' || typeof input === 'number') {
|
|
24
|
+
const match = (/^(normal|(\d+(?:\.\d+)?)(px|%)?)$/).exec(input);
|
|
25
|
+
output = match ? { value: +match[2], unit: match[3] || undefined } : undefined;
|
|
26
|
+
} else {
|
|
27
|
+
output = undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (output === null || output === undefined) {
|
|
31
|
+
result = undefined;
|
|
32
|
+
} else if (output.unit === '%') {
|
|
33
|
+
result = `${output.value}%`;
|
|
34
|
+
} else {
|
|
35
|
+
result = `${output.value}px`;
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* % 값인지 확인 하기
|
|
42
|
+
* @param val
|
|
43
|
+
* @returns true | false
|
|
44
|
+
*/
|
|
45
|
+
isPercentValue(val) {
|
|
46
|
+
let result;
|
|
47
|
+
if (typeof val !== 'string') {
|
|
48
|
+
result = false;
|
|
49
|
+
} else if (val.indexOf('%') === (val.length - 1)) {
|
|
50
|
+
result = true;
|
|
51
|
+
} else {
|
|
52
|
+
result = false;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return result;
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 컬럼 min max 체크하기
|
|
60
|
+
* @param val
|
|
61
|
+
* @param min
|
|
62
|
+
* @param max
|
|
63
|
+
* @returns {*}
|
|
64
|
+
*/
|
|
65
|
+
checkColSize(val, min, max) {
|
|
66
|
+
let result;
|
|
67
|
+
|
|
68
|
+
if (min && val < min) {
|
|
69
|
+
result = min;
|
|
70
|
+
} else if (max && val > max) {
|
|
71
|
+
result = max;
|
|
72
|
+
} else {
|
|
73
|
+
result = val;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return result;
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import debounce from './utils.debounce';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Original Code
|
|
5
|
-
* https://github.com/lodash/lodash/blob/es/throttle.js
|
|
6
|
-
* lodash/throttle.js
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
function isObject(value) {
|
|
10
|
-
const type = typeof value;
|
|
11
|
-
return value != null && (type === 'object' || type === 'function');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** Error message constants. */
|
|
15
|
-
const FUNC_ERROR_TEXT = 'Expected a function';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Creates a throttled function that only invokes `func` at most once per
|
|
19
|
-
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
|
20
|
-
* method to cancel delayed `func` invocations and a `flush` method to
|
|
21
|
-
* immediately invoke them. Provide `options` to indicate whether `func`
|
|
22
|
-
* should be invoked on the leading and/or trailing edge of the `wait`
|
|
23
|
-
* timeout. The `func` is invoked with the last arguments provided to the
|
|
24
|
-
* throttled function. Subsequent calls to the throttled function return the
|
|
25
|
-
* result of the last `func` invocation.
|
|
26
|
-
*
|
|
27
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
28
|
-
* invoked on the trailing edge of the timeout only if the throttled function
|
|
29
|
-
* is invoked more than once during the `wait` timeout.
|
|
30
|
-
*
|
|
31
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
32
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
33
|
-
*
|
|
34
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
35
|
-
* for details over the differences between `_.throttle` and `_.debounce`.
|
|
36
|
-
*
|
|
37
|
-
* @static
|
|
38
|
-
* @memberOf _
|
|
39
|
-
* @since 0.1.0
|
|
40
|
-
* @category Function
|
|
41
|
-
* @param {Function} func The function to throttle.
|
|
42
|
-
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
|
43
|
-
* @param {Object} [options={}] The options object.
|
|
44
|
-
* @param {boolean} [options.leading=true]
|
|
45
|
-
* Specify invoking on the leading edge of the timeout.
|
|
46
|
-
* @param {boolean} [options.trailing=true]
|
|
47
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
48
|
-
* @returns {Function} Returns the new throttled function.
|
|
49
|
-
* @example
|
|
50
|
-
*
|
|
51
|
-
* // Avoid excessively updating the position while scrolling.
|
|
52
|
-
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
|
53
|
-
*
|
|
54
|
-
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
|
55
|
-
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
|
56
|
-
* jQuery(element).on('click', throttled);
|
|
57
|
-
*
|
|
58
|
-
* // Cancel the trailing throttled invocation.
|
|
59
|
-
* jQuery(window).on('popstate', throttled.cancel);
|
|
60
|
-
*/
|
|
61
|
-
/* eslint-disable */
|
|
62
|
-
function throttle(func, wait, options) {
|
|
63
|
-
let leading = true;
|
|
64
|
-
let trailing = true;
|
|
65
|
-
|
|
66
|
-
if (typeof func != 'function') {
|
|
67
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (isObject(options)) {
|
|
71
|
-
leading = 'leading' in options ? !!options.leading : leading;
|
|
72
|
-
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return debounce(func, wait, {
|
|
76
|
-
'leading': leading,
|
|
77
|
-
'maxWait': wait,
|
|
78
|
-
'trailing': trailing
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export default throttle;
|
|
83
|
-
/* eslint-enable */
|
|
1
|
+
import debounce from './utils.debounce';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Original Code
|
|
5
|
+
* https://github.com/lodash/lodash/blob/es/throttle.js
|
|
6
|
+
* lodash/throttle.js
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
function isObject(value) {
|
|
10
|
+
const type = typeof value;
|
|
11
|
+
return value != null && (type === 'object' || type === 'function');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Error message constants. */
|
|
15
|
+
const FUNC_ERROR_TEXT = 'Expected a function';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates a throttled function that only invokes `func` at most once per
|
|
19
|
+
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
|
20
|
+
* method to cancel delayed `func` invocations and a `flush` method to
|
|
21
|
+
* immediately invoke them. Provide `options` to indicate whether `func`
|
|
22
|
+
* should be invoked on the leading and/or trailing edge of the `wait`
|
|
23
|
+
* timeout. The `func` is invoked with the last arguments provided to the
|
|
24
|
+
* throttled function. Subsequent calls to the throttled function return the
|
|
25
|
+
* result of the last `func` invocation.
|
|
26
|
+
*
|
|
27
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
28
|
+
* invoked on the trailing edge of the timeout only if the throttled function
|
|
29
|
+
* is invoked more than once during the `wait` timeout.
|
|
30
|
+
*
|
|
31
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
32
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
33
|
+
*
|
|
34
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
35
|
+
* for details over the differences between `_.throttle` and `_.debounce`.
|
|
36
|
+
*
|
|
37
|
+
* @static
|
|
38
|
+
* @memberOf _
|
|
39
|
+
* @since 0.1.0
|
|
40
|
+
* @category Function
|
|
41
|
+
* @param {Function} func The function to throttle.
|
|
42
|
+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
|
43
|
+
* @param {Object} [options={}] The options object.
|
|
44
|
+
* @param {boolean} [options.leading=true]
|
|
45
|
+
* Specify invoking on the leading edge of the timeout.
|
|
46
|
+
* @param {boolean} [options.trailing=true]
|
|
47
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
48
|
+
* @returns {Function} Returns the new throttled function.
|
|
49
|
+
* @example
|
|
50
|
+
*
|
|
51
|
+
* // Avoid excessively updating the position while scrolling.
|
|
52
|
+
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
|
53
|
+
*
|
|
54
|
+
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
|
55
|
+
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
|
56
|
+
* jQuery(element).on('click', throttled);
|
|
57
|
+
*
|
|
58
|
+
* // Cancel the trailing throttled invocation.
|
|
59
|
+
* jQuery(window).on('popstate', throttled.cancel);
|
|
60
|
+
*/
|
|
61
|
+
/* eslint-disable */
|
|
62
|
+
function throttle(func, wait, options) {
|
|
63
|
+
let leading = true;
|
|
64
|
+
let trailing = true;
|
|
65
|
+
|
|
66
|
+
if (typeof func != 'function') {
|
|
67
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (isObject(options)) {
|
|
71
|
+
leading = 'leading' in options ? !!options.leading : leading;
|
|
72
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return debounce(func, wait, {
|
|
76
|
+
'leading': leading,
|
|
77
|
+
'maxWait': wait,
|
|
78
|
+
'trailing': trailing
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default throttle;
|
|
83
|
+
/* eslint-enable */
|
package/src/common/utils.tree.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
function findComponentUpward(context, componentName, componentNames) {
|
|
2
|
-
let componentNamesTemp = componentNames;
|
|
3
|
-
if (typeof componentName === 'string') {
|
|
4
|
-
componentNamesTemp = [componentName];
|
|
5
|
-
} else {
|
|
6
|
-
componentNamesTemp = componentName;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
let parent = context.$parent;
|
|
10
|
-
let name = parent.$options.name;
|
|
11
|
-
while (parent && (!name || componentNamesTemp.indexOf(name) < 0)) {
|
|
12
|
-
parent = parent.$parent;
|
|
13
|
-
if (parent) name = parent.$options.name;
|
|
14
|
-
}
|
|
15
|
-
return parent;
|
|
16
|
-
}
|
|
17
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
18
|
-
export { findComponentUpward };
|
|
1
|
+
function findComponentUpward(context, componentName, componentNames) {
|
|
2
|
+
let componentNamesTemp = componentNames;
|
|
3
|
+
if (typeof componentName === 'string') {
|
|
4
|
+
componentNamesTemp = [componentName];
|
|
5
|
+
} else {
|
|
6
|
+
componentNamesTemp = componentName;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let parent = context.$parent;
|
|
10
|
+
let name = parent.$options.name;
|
|
11
|
+
while (parent && (!name || componentNamesTemp.indexOf(name) < 0)) {
|
|
12
|
+
parent = parent.$parent;
|
|
13
|
+
if (parent) name = parent.$options.name;
|
|
14
|
+
}
|
|
15
|
+
return parent;
|
|
16
|
+
}
|
|
17
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
18
|
+
export { findComponentUpward };
|