evui 3.4.207 → 3.4.208
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 +18 -33
- package/dist/404.html +44 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.js +22645 -0
- package/dist/index.umd.cjs +28 -0
- package/dist/style.css +1 -0
- package/package.json +46 -43
- package/dist/evui.common.js +0 -63681
- package/dist/evui.common.js.map +0 -1
- package/dist/evui.umd.js +0 -63691
- package/dist/evui.umd.js.map +0 -1
- package/dist/evui.umd.min.js +0 -2
- package/dist/evui.umd.min.js.map +0 -1
- package/dist/img/EVUI.b82ee81a.svg +0 -293
- package/src/assets/logo.png +0 -0
- package/src/common/emitter.js +0 -20
- package/src/common/utils.bignumber.js +0 -67
- package/src/common/utils.debounce.js +0 -223
- package/src/common/utils.js +0 -151
- package/src/common/utils.table.js +0 -78
- package/src/common/utils.throttle.js +0 -83
- package/src/common/utils.tree.js +0 -18
- package/src/components/button/Button.vue +0 -195
- package/src/components/button/index.js +0 -7
- package/src/components/buttonGroup/ButtonGroup.vue +0 -11
- package/src/components/buttonGroup/index.js +0 -7
- package/src/components/calendar/Calendar.vue +0 -725
- package/src/components/calendar/index.js +0 -7
- package/src/components/calendar/uses.js +0 -1410
- package/src/components/chart/Chart.vue +0 -363
- package/src/components/chart/ChartToolbar.vue +0 -52
- package/src/components/chart/chart.core.js +0 -1170
- package/src/components/chart/chartZoom.core.js +0 -540
- package/src/components/chart/element/element.bar.js +0 -672
- package/src/components/chart/element/element.bar.time.js +0 -166
- package/src/components/chart/element/element.heatmap.js +0 -743
- package/src/components/chart/element/element.line.js +0 -611
- package/src/components/chart/element/element.pie.js +0 -197
- package/src/components/chart/element/element.scatter.js +0 -320
- package/src/components/chart/element/element.tip.js +0 -717
- package/src/components/chart/helpers/helpers.canvas.js +0 -265
- package/src/components/chart/helpers/helpers.constant.js +0 -235
- package/src/components/chart/helpers/helpers.util.js +0 -400
- package/src/components/chart/index.js +0 -9
- package/src/components/chart/model/index.js +0 -50
- package/src/components/chart/model/model.series.js +0 -125
- package/src/components/chart/model/model.store.js +0 -1427
- package/src/components/chart/plugins/plugins.interaction.js +0 -1659
- package/src/components/chart/plugins/plugins.legend.gradient.js +0 -606
- package/src/components/chart/plugins/plugins.legend.js +0 -1543
- package/src/components/chart/plugins/plugins.pie.js +0 -254
- package/src/components/chart/plugins/plugins.scrollbar.js +0 -732
- package/src/components/chart/plugins/plugins.title.js +0 -61
- package/src/components/chart/plugins/plugins.tooltip.js +0 -1041
- package/src/components/chart/scale/scale.js +0 -951
- package/src/components/chart/scale/scale.linear.js +0 -268
- package/src/components/chart/scale/scale.logarithmic.js +0 -135
- package/src/components/chart/scale/scale.step.js +0 -430
- package/src/components/chart/scale/scale.time.category.js +0 -338
- package/src/components/chart/scale/scale.time.js +0 -49
- package/src/components/chart/style/chart.scss +0 -405
- package/src/components/chart/uses.js +0 -721
- package/src/components/chartBrush/ChartBrush.vue +0 -323
- package/src/components/chartBrush/chartBrush.core.js +0 -691
- package/src/components/chartBrush/index.js +0 -9
- package/src/components/chartBrush/uses.js +0 -23
- package/src/components/chartGroup/ChartGroup.vue +0 -144
- package/src/components/chartGroup/index.js +0 -9
- package/src/components/chartGroup/style/chartGroup.scss +0 -5
- package/src/components/chartGroup/uses.js +0 -53
- package/src/components/checkbox/Checkbox.vue +0 -229
- package/src/components/checkbox/index.js +0 -7
- package/src/components/checkboxGroup/CheckboxGroup.vue +0 -44
- package/src/components/checkboxGroup/index.js +0 -7
- package/src/components/contextMenu/ContextMenu.vue +0 -95
- package/src/components/contextMenu/MenuList.vue +0 -182
- package/src/components/contextMenu/index.js +0 -7
- package/src/components/contextMenu/uses.js +0 -223
- package/src/components/datePicker/DatePicker.vue +0 -504
- package/src/components/datePicker/index.js +0 -7
- package/src/components/datePicker/uses.js +0 -460
- package/src/components/grid/Grid.vue +0 -1535
- package/src/components/grid/GridColumnSetting.vue +0 -358
- package/src/components/grid/GridFilterSetting.vue +0 -323
- package/src/components/grid/GridPagination.vue +0 -75
- package/src/components/grid/GridSummary.vue +0 -314
- package/src/components/grid/GridToolbar.vue +0 -35
- package/src/components/grid/icon/icon-option-button.vue +0 -17
- package/src/components/grid/icon/icon-sort-button.vue +0 -67
- package/src/components/grid/index.js +0 -11
- package/src/components/grid/style/grid.scss +0 -417
- package/src/components/grid/uses.js +0 -1629
- package/src/components/icon/Icon.vue +0 -53
- package/src/components/icon/index.js +0 -8
- package/src/components/inputNumber/InputNumber.vue +0 -212
- package/src/components/inputNumber/index.js +0 -7
- package/src/components/inputNumber/uses.js +0 -217
- package/src/components/loading/Loading.vue +0 -125
- package/src/components/loading/index.js +0 -7
- package/src/components/menu/Menu.vue +0 -79
- package/src/components/menu/MenuItem.vue +0 -201
- package/src/components/menu/index.js +0 -7
- package/src/components/message/Message.vue +0 -229
- package/src/components/message/index.js +0 -34
- package/src/components/messageBox/MessageBox.vue +0 -358
- package/src/components/messageBox/index.js +0 -22
- package/src/components/notification/Notification.vue +0 -316
- package/src/components/notification/index.js +0 -49
- package/src/components/pagination/Pagination.vue +0 -317
- package/src/components/pagination/index.js +0 -7
- package/src/components/pagination/pageButton.vue +0 -31
- package/src/components/progress/Progress.vue +0 -139
- package/src/components/progress/index.js +0 -7
- package/src/components/radio/Radio.vue +0 -159
- package/src/components/radio/index.js +0 -7
- package/src/components/radioGroup/RadioGroup.vue +0 -41
- package/src/components/radioGroup/index.js +0 -7
- package/src/components/scheduler/Scheduler.vue +0 -149
- package/src/components/scheduler/index.js +0 -7
- package/src/components/scheduler/uses.js +0 -183
- package/src/components/select/Select.vue +0 -556
- package/src/components/select/index.js +0 -7
- package/src/components/select/uses.js +0 -379
- package/src/components/slider/Slider.vue +0 -505
- package/src/components/slider/index.js +0 -7
- package/src/components/slider/uses.js +0 -391
- package/src/components/tabPanel/TabPanel.vue +0 -74
- package/src/components/tabPanel/index.js +0 -7
- package/src/components/tabs/Tabs.vue +0 -517
- package/src/components/tabs/index.js +0 -7
- package/src/components/textField/TextField.vue +0 -399
- package/src/components/textField/index.js +0 -7
- package/src/components/timePicker/TimePicker.vue +0 -364
- package/src/components/timePicker/index.js +0 -7
- package/src/components/toggle/Toggle.vue +0 -115
- package/src/components/toggle/index.js +0 -7
- package/src/components/tree/Tree.vue +0 -338
- package/src/components/tree/TreeNode.vue +0 -293
- package/src/components/tree/index.js +0 -7
- package/src/components/treeGrid/TreeGrid.vue +0 -1074
- package/src/components/treeGrid/TreeGridNode.vue +0 -349
- package/src/components/treeGrid/TreeGridToolbar.vue +0 -35
- package/src/components/treeGrid/icon/icon-tree.png +0 -0
- package/src/components/treeGrid/index.js +0 -9
- package/src/components/treeGrid/style/treeGrid.scss +0 -277
- package/src/components/treeGrid/uses.js +0 -1178
- package/src/components/window/Window.vue +0 -329
- package/src/components/window/index.js +0 -7
- package/src/components/window/uses.js +0 -908
- package/src/directives/clickoutside.js +0 -90
- package/src/main.js +0 -120
- package/src/style/components/input.scss +0 -108
- package/src/style/functions.scss +0 -3
- package/src/style/index.scss +0 -6
- package/src/style/lib/fonts/EVUI.eot +0 -0
- package/src/style/lib/fonts/EVUI.svg +0 -293
- package/src/style/lib/fonts/EVUI.ttf +0 -0
- package/src/style/lib/fonts/EVUI.woff +0 -0
- package/src/style/lib/icon.css +0 -888
- package/src/style/mixins.scss +0 -94
- package/src/style/themes.scss +0 -69
- package/src/style/variables.scss +0 -22
package/src/assets/logo.png
DELETED
|
Binary file
|
package/src/common/emitter.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
methods: {
|
|
3
|
-
dispatch(componentName, eventName, params) {
|
|
4
|
-
let parent = this.$parent || this.$root;
|
|
5
|
-
let name = parent.$options.name;
|
|
6
|
-
|
|
7
|
-
while (parent && (!name || name !== componentName)) {
|
|
8
|
-
parent = parent.$parent;
|
|
9
|
-
|
|
10
|
-
if (parent) {
|
|
11
|
-
name = parent.$options.name;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
if (parent) {
|
|
15
|
-
// eslint-disable-next-line prefer-spread
|
|
16
|
-
parent.$emit.apply(parent, [eventName].concat(params));
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import BigNumber from 'bignumber.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Convert Number to BigNumber
|
|
5
|
-
* @param {Number} value
|
|
6
|
-
* @return {BigNumber}
|
|
7
|
-
*/
|
|
8
|
-
function toBigNumber(value) { return new BigNumber(value); }
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* plus(+)
|
|
12
|
-
* @param {Number} num1
|
|
13
|
-
* @param {Number} num2
|
|
14
|
-
* @return {Number}
|
|
15
|
-
*/
|
|
16
|
-
function bnPlus(num1, num2) {
|
|
17
|
-
return toBigNumber(num1).plus(toBigNumber(num2)).toNumber();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* minus(-)
|
|
22
|
-
* @param {Number} num1
|
|
23
|
-
* @param {Number} num2
|
|
24
|
-
* @return {Number}
|
|
25
|
-
*/
|
|
26
|
-
function bnMinus(num1, num2) {
|
|
27
|
-
return toBigNumber(num1).minus(toBigNumber(num2)).toNumber();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* multiply(*)
|
|
32
|
-
* @param {Number} num1
|
|
33
|
-
* @param {Number} num2
|
|
34
|
-
* @return {Number}
|
|
35
|
-
*/
|
|
36
|
-
function bnMultiply(num1, num2) {
|
|
37
|
-
return toBigNumber(num1).multipliedBy(toBigNumber(num2)).toNumber();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* divide(/)
|
|
42
|
-
* @param {Number} dividend
|
|
43
|
-
* @param {Number} divisor
|
|
44
|
-
* @return {Number}
|
|
45
|
-
*/
|
|
46
|
-
function bnDivide(dividend, divisor) {
|
|
47
|
-
return toBigNumber(dividend).dividedBy(toBigNumber((divisor))).toNumber();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* floor
|
|
52
|
-
* @param {Number} num
|
|
53
|
-
* @param {Number} decimal
|
|
54
|
-
* @return {Number}
|
|
55
|
-
*/
|
|
56
|
-
function bnFloor(num, decimal) {
|
|
57
|
-
return toBigNumber(num).decimalPlaces(decimal, BigNumber.ROUND_DOWN).toNumber();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export {
|
|
61
|
-
toBigNumber,
|
|
62
|
-
bnPlus,
|
|
63
|
-
bnMinus,
|
|
64
|
-
bnMultiply,
|
|
65
|
-
bnDivide,
|
|
66
|
-
bnFloor,
|
|
67
|
-
};
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Original Code
|
|
3
|
-
* https://github.com/lodash/lodash/blob/es/debounce.js
|
|
4
|
-
* lodash/debounce.js
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
function isObject(value) {
|
|
8
|
-
const type = typeof value;
|
|
9
|
-
return value != null && (type === 'object' || type === 'function');
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Creates a debounced function that delays invoking `func` until after `wait`
|
|
14
|
-
* milliseconds have elapsed since the last time the debounced function was
|
|
15
|
-
* invoked, or until the next browser frame is drawn. The debounced function
|
|
16
|
-
* comes with a `cancel` method to cancel delayed `func` invocations and a
|
|
17
|
-
* `flush` method to immediately invoke them. Provide `options` to indicate
|
|
18
|
-
* whether `func` should be invoked on the leading and/or trailing edge of the
|
|
19
|
-
* `wait` timeout. The `func` is invoked with the last arguments provided to the
|
|
20
|
-
* debounced function. Subsequent calls to the debounced function return the
|
|
21
|
-
* result of the last `func` invocation.
|
|
22
|
-
*
|
|
23
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
24
|
-
* invoked on the trailing edge of the timeout only if the debounced function
|
|
25
|
-
* is invoked more than once during the `wait` timeout.
|
|
26
|
-
*
|
|
27
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
28
|
-
* until the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
29
|
-
*
|
|
30
|
-
* If `wait` is omitted in an environment with `requestAnimationFrame`, `func`
|
|
31
|
-
* invocation will be deferred until the next frame is drawn (typically about
|
|
32
|
-
* 16ms).
|
|
33
|
-
*
|
|
34
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
35
|
-
* for details over the differences between `debounce` and `throttle`.
|
|
36
|
-
*
|
|
37
|
-
* @since 0.1.0
|
|
38
|
-
* @category Function
|
|
39
|
-
* @param {Function} func The function to debounce.
|
|
40
|
-
* @param {number} [wait=0]
|
|
41
|
-
* The number of milliseconds to delay; if omitted, `requestAnimationFrame` is
|
|
42
|
-
* used (if available).
|
|
43
|
-
* @param {Object} [options={}] The options object.
|
|
44
|
-
* @param {boolean} [options.leading=false]
|
|
45
|
-
* Specify invoking on the leading edge of the timeout.
|
|
46
|
-
* @param {number} [options.maxWait]
|
|
47
|
-
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
48
|
-
* @param {boolean} [options.trailing=true]
|
|
49
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
50
|
-
* @returns {Function} Returns the new debounced function.
|
|
51
|
-
* @example
|
|
52
|
-
*
|
|
53
|
-
* // Avoid costly calculations while the window size is in flux.
|
|
54
|
-
* jQuery(window).on('resize', debounce(calculateLayout, 150))
|
|
55
|
-
*
|
|
56
|
-
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
57
|
-
* jQuery(element).on('click', debounce(sendMail, 300, {
|
|
58
|
-
* 'leading': true,
|
|
59
|
-
* 'trailing': false
|
|
60
|
-
* }))
|
|
61
|
-
*
|
|
62
|
-
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
63
|
-
* const debounced = debounce(batchLog, 250, { 'maxWait': 1000 })
|
|
64
|
-
* const source = new EventSource('/stream')
|
|
65
|
-
* jQuery(source).on('message', debounced)
|
|
66
|
-
*
|
|
67
|
-
* // Cancel the trailing debounced invocation.
|
|
68
|
-
* jQuery(window).on('popstate', debounced.cancel)
|
|
69
|
-
*
|
|
70
|
-
* // Check for pending invocations.
|
|
71
|
-
* const status = debounced.pending() ? "Pending..." : "Ready"
|
|
72
|
-
*/
|
|
73
|
-
/* eslint-disable */
|
|
74
|
-
function debounce(func, wait, options) {
|
|
75
|
-
let lastArgs,
|
|
76
|
-
lastThis,
|
|
77
|
-
maxWait,
|
|
78
|
-
result,
|
|
79
|
-
timerId,
|
|
80
|
-
lastCallTime
|
|
81
|
-
|
|
82
|
-
let lastInvokeTime = 0
|
|
83
|
-
let leading = false
|
|
84
|
-
let maxing = false
|
|
85
|
-
let trailing = true
|
|
86
|
-
|
|
87
|
-
// Bypass `requestAnimationFrame` by explicitly setting `wait=0`.
|
|
88
|
-
const useRAF = (!wait && wait !== 0 && typeof root.requestAnimationFrame === 'function')
|
|
89
|
-
|
|
90
|
-
if (typeof func !== 'function') {
|
|
91
|
-
throw new TypeError('Expected a function')
|
|
92
|
-
}
|
|
93
|
-
wait = +wait || 0
|
|
94
|
-
if (isObject(options)) {
|
|
95
|
-
leading = !!options.leading
|
|
96
|
-
maxing = 'maxWait' in options
|
|
97
|
-
maxWait = maxing ? Math.max(+options.maxWait || 0, wait) : maxWait
|
|
98
|
-
trailing = 'trailing' in options ? !!options.trailing : trailing
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function invokeFunc(time) {
|
|
102
|
-
const args = lastArgs
|
|
103
|
-
const thisArg = lastThis
|
|
104
|
-
|
|
105
|
-
lastArgs = lastThis = undefined
|
|
106
|
-
lastInvokeTime = time
|
|
107
|
-
result = func.apply(thisArg, args)
|
|
108
|
-
return result
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function startTimer(pendingFunc, wait) {
|
|
112
|
-
if (useRAF) {
|
|
113
|
-
window.cancelAnimationFrame(timerId)
|
|
114
|
-
return window.requestAnimationFrame(pendingFunc)
|
|
115
|
-
}
|
|
116
|
-
return setTimeout(pendingFunc, wait)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function cancelTimer(id) {
|
|
120
|
-
if (useRAF) {
|
|
121
|
-
return window.cancelAnimationFrame(id)
|
|
122
|
-
}
|
|
123
|
-
clearTimeout(id)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function leadingEdge(time) {
|
|
127
|
-
// Reset any `maxWait` timer.
|
|
128
|
-
lastInvokeTime = time
|
|
129
|
-
// Start the timer for the trailing edge.
|
|
130
|
-
timerId = startTimer(timerExpired, wait)
|
|
131
|
-
// Invoke the leading edge.
|
|
132
|
-
return leading ? invokeFunc(time) : result
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function remainingWait(time) {
|
|
136
|
-
const timeSinceLastCall = time - lastCallTime
|
|
137
|
-
const timeSinceLastInvoke = time - lastInvokeTime
|
|
138
|
-
const timeWaiting = wait - timeSinceLastCall
|
|
139
|
-
|
|
140
|
-
return maxing
|
|
141
|
-
? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)
|
|
142
|
-
: timeWaiting
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function shouldInvoke(time) {
|
|
146
|
-
const timeSinceLastCall = time - lastCallTime
|
|
147
|
-
const timeSinceLastInvoke = time - lastInvokeTime
|
|
148
|
-
|
|
149
|
-
// Either this is the first call, activity has stopped and we're at the
|
|
150
|
-
// trailing edge, the system time has gone backwards and we're treating
|
|
151
|
-
// it as the trailing edge, or we've hit the `maxWait` limit.
|
|
152
|
-
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
|
153
|
-
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait))
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function timerExpired() {
|
|
157
|
-
const time = Date.now()
|
|
158
|
-
if (shouldInvoke(time)) {
|
|
159
|
-
return trailingEdge(time)
|
|
160
|
-
}
|
|
161
|
-
// Restart the timer.
|
|
162
|
-
timerId = startTimer(timerExpired, remainingWait(time))
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function trailingEdge(time) {
|
|
166
|
-
timerId = undefined
|
|
167
|
-
|
|
168
|
-
// Only invoke if we have `lastArgs` which means `func` has been
|
|
169
|
-
// debounced at least once.
|
|
170
|
-
if (trailing && lastArgs) {
|
|
171
|
-
return invokeFunc(time)
|
|
172
|
-
}
|
|
173
|
-
lastArgs = lastThis = undefined
|
|
174
|
-
return result
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function cancel() {
|
|
178
|
-
if (timerId !== undefined) {
|
|
179
|
-
cancelTimer(timerId)
|
|
180
|
-
}
|
|
181
|
-
lastInvokeTime = 0
|
|
182
|
-
lastArgs = lastCallTime = lastThis = timerId = undefined
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function flush() {
|
|
186
|
-
return timerId === undefined ? result : trailingEdge(Date.now())
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function pending() {
|
|
190
|
-
return timerId !== undefined
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
function debounced(...args) {
|
|
194
|
-
const time = Date.now()
|
|
195
|
-
const isInvoking = shouldInvoke(time)
|
|
196
|
-
|
|
197
|
-
lastArgs = args
|
|
198
|
-
lastThis = this
|
|
199
|
-
lastCallTime = time
|
|
200
|
-
|
|
201
|
-
if (isInvoking) {
|
|
202
|
-
if (timerId === undefined) {
|
|
203
|
-
return leadingEdge(lastCallTime)
|
|
204
|
-
}
|
|
205
|
-
if (maxing) {
|
|
206
|
-
// Handle invocations in a tight loop.
|
|
207
|
-
timerId = startTimer(timerExpired, wait)
|
|
208
|
-
return invokeFunc(lastCallTime)
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
if (timerId === undefined) {
|
|
212
|
-
timerId = startTimer(timerExpired, wait)
|
|
213
|
-
}
|
|
214
|
-
return result
|
|
215
|
-
}
|
|
216
|
-
debounced.cancel = cancel
|
|
217
|
-
debounced.flush = flush
|
|
218
|
-
debounced.pending = pending
|
|
219
|
-
return debounced
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export default debounce
|
|
223
|
-
/* eslint-enable */
|
package/src/common/utils.js
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
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
|
-
}
|
|
135
|
-
|
|
136
|
-
export function checkNullAndUndefined(value) {
|
|
137
|
-
return value === null || value === undefined;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Check if the device is mobile
|
|
142
|
-
* @returns {boolean}
|
|
143
|
-
*/
|
|
144
|
-
export function mobileCheck() {
|
|
145
|
-
return (
|
|
146
|
-
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
147
|
-
navigator.userAgent,
|
|
148
|
-
)
|
|
149
|
-
|| 'ontouchstart' in window
|
|
150
|
-
);
|
|
151
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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 };
|