evui 3.4.206 → 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 -63678
- package/dist/evui.common.js.map +0 -1
- package/dist/evui.umd.js +0 -63688
- 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 -1655
- 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
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ev-menu-list">
|
|
3
|
-
<ul class="ev-menu-ul">
|
|
4
|
-
<li
|
|
5
|
-
v-for="(item, idx) in items"
|
|
6
|
-
v-show="!item.hidden"
|
|
7
|
-
:key="`${item.value}_${idx}`"
|
|
8
|
-
class="ev-menu-li"
|
|
9
|
-
:class="{ disabled: item.disabled, [item.itemClass]: item.itemClass }"
|
|
10
|
-
@click="handleItemClick(item)"
|
|
11
|
-
@mouseenter="handleMouseEnter($event, item)"
|
|
12
|
-
>
|
|
13
|
-
<i
|
|
14
|
-
v-if="!!item.iconClass"
|
|
15
|
-
class="ev-menu-li-prefix"
|
|
16
|
-
:class="item.iconClass"
|
|
17
|
-
/>
|
|
18
|
-
<span class="ev-menu-li-text">
|
|
19
|
-
<slot
|
|
20
|
-
v-if="item.slotKey"
|
|
21
|
-
:name="item.slotKey"
|
|
22
|
-
:item="item"
|
|
23
|
-
>
|
|
24
|
-
{{ item.text }}
|
|
25
|
-
</slot>
|
|
26
|
-
<template v-else>
|
|
27
|
-
{{ item.text }}
|
|
28
|
-
</template>
|
|
29
|
-
</span>
|
|
30
|
-
<i
|
|
31
|
-
v-if="item.children || item.isShowMenu"
|
|
32
|
-
class="ev-menu-li-suffix ev-icon-arrow-right2"
|
|
33
|
-
/>
|
|
34
|
-
</li>
|
|
35
|
-
</ul>
|
|
36
|
-
<template v-if="isExistChild">
|
|
37
|
-
<component
|
|
38
|
-
:is="comp"
|
|
39
|
-
v-show="childrenItems.length && isShowChild"
|
|
40
|
-
ref="childMenu"
|
|
41
|
-
v-model:isShow="computedIsShow"
|
|
42
|
-
:comp="comp"
|
|
43
|
-
:items="childrenItems"
|
|
44
|
-
:style="menuStyle"
|
|
45
|
-
>
|
|
46
|
-
<template
|
|
47
|
-
v-for="(_, slotName) in $slots"
|
|
48
|
-
:key="slotName"
|
|
49
|
-
#[slotName]="slotProps"
|
|
50
|
-
>
|
|
51
|
-
<slot
|
|
52
|
-
:name="slotName"
|
|
53
|
-
v-bind="slotProps"
|
|
54
|
-
/>
|
|
55
|
-
</template>
|
|
56
|
-
</component>
|
|
57
|
-
</template>
|
|
58
|
-
</div>
|
|
59
|
-
</template>
|
|
60
|
-
|
|
61
|
-
<script>
|
|
62
|
-
import { useMenuList } from './uses';
|
|
63
|
-
|
|
64
|
-
export default {
|
|
65
|
-
name: 'EvMenuList',
|
|
66
|
-
props: {
|
|
67
|
-
isShow: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: false,
|
|
70
|
-
},
|
|
71
|
-
items: {
|
|
72
|
-
type: Array,
|
|
73
|
-
default: () => [],
|
|
74
|
-
validator: (list) => {
|
|
75
|
-
if (list.some(v => v.children !== undefined && !Array.isArray(v.children))) {
|
|
76
|
-
console.warn('[EVUI][ContextMenu] children attribute must be \'Array\' type.');
|
|
77
|
-
return false;
|
|
78
|
-
} else if (list.some(v => v.click !== undefined && typeof v.click !== 'function')) {
|
|
79
|
-
console.warn('[EVUI][ContextMenu] click attribute must be \'Function\' type.');
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
return true;
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
comp: {
|
|
86
|
-
type: Object,
|
|
87
|
-
default: () => {},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
emits: {
|
|
91
|
-
'update:isShow': [Boolean],
|
|
92
|
-
},
|
|
93
|
-
setup() {
|
|
94
|
-
const {
|
|
95
|
-
isExistChild,
|
|
96
|
-
computedIsShow,
|
|
97
|
-
isShowChild,
|
|
98
|
-
childMenu,
|
|
99
|
-
menuStyle,
|
|
100
|
-
childrenItems,
|
|
101
|
-
|
|
102
|
-
handleItemClick,
|
|
103
|
-
handleMouseEnter,
|
|
104
|
-
hideAll,
|
|
105
|
-
} = useMenuList();
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
isExistChild,
|
|
109
|
-
computedIsShow,
|
|
110
|
-
isShowChild,
|
|
111
|
-
childMenu,
|
|
112
|
-
menuStyle,
|
|
113
|
-
childrenItems,
|
|
114
|
-
|
|
115
|
-
handleItemClick,
|
|
116
|
-
handleMouseEnter,
|
|
117
|
-
hideAll,
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
</script>
|
|
122
|
-
|
|
123
|
-
<style lang="scss">
|
|
124
|
-
@import '../../style/index.scss';
|
|
125
|
-
|
|
126
|
-
.ev-menu-list {
|
|
127
|
-
position: absolute;
|
|
128
|
-
width: 0;
|
|
129
|
-
height: 0;
|
|
130
|
-
white-space: nowrap;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.ev-menu-ul {
|
|
134
|
-
list-style: none;
|
|
135
|
-
position: absolute;
|
|
136
|
-
border: 1px solid #D0D0D0;
|
|
137
|
-
background-color: #EEEEEE;
|
|
138
|
-
z-index: 100;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.ev-menu-li {
|
|
142
|
-
height: 30px;
|
|
143
|
-
line-height: 30px;
|
|
144
|
-
padding: 2px 25px;
|
|
145
|
-
i {
|
|
146
|
-
height: 30px;
|
|
147
|
-
line-height: 30px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
&:not(:last-child) {
|
|
151
|
-
border-bottom: 1px dotted #D0D0D0;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
&:hover {
|
|
155
|
-
background-color: #ECF5FF;
|
|
156
|
-
cursor: pointer;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
&.disabled {
|
|
160
|
-
color: #B2B2B2;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
&.disabled:hover {
|
|
164
|
-
cursor: not-allowed;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.ev-menu-li-suffix {
|
|
169
|
-
position: absolute;
|
|
170
|
-
right: 3px;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.ev-menu-li-prefix {
|
|
174
|
-
position: absolute;
|
|
175
|
-
left: 3px;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.ev-menu-li-text {
|
|
179
|
-
display: inline-block;
|
|
180
|
-
padding-left: 20px;
|
|
181
|
-
}
|
|
182
|
-
</style>
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ref, reactive, computed, nextTick,
|
|
3
|
-
getCurrentInstance, defineComponent,
|
|
4
|
-
} from 'vue';
|
|
5
|
-
import MenuList from './MenuList';
|
|
6
|
-
|
|
7
|
-
export const useModel = () => {
|
|
8
|
-
const comp = defineComponent(MenuList);
|
|
9
|
-
const childrenItems = ref([]);
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 컴포넌트 초기에 body에 wrapperDiv를 append한다.
|
|
13
|
-
*/
|
|
14
|
-
const initWrapperDiv = () => {
|
|
15
|
-
const root = document.createElement('div');
|
|
16
|
-
root.id = 'ev-context-menu-modal';
|
|
17
|
-
root.setAttribute('style', 'position: absolute; top: 0; left: 0;');
|
|
18
|
-
const hasRoot = document.getElementById('ev-context-menu-modal');
|
|
19
|
-
if (!hasRoot) {
|
|
20
|
-
document.body.appendChild(root);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
comp,
|
|
26
|
-
childrenItems,
|
|
27
|
-
initWrapperDiv,
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const usePosition = () => {
|
|
32
|
-
const { props } = getCurrentInstance();
|
|
33
|
-
const isShowMenuOnClick = computed(() => props.isShowMenuOnClick);
|
|
34
|
-
const isShow = ref(false);
|
|
35
|
-
const rootMenuList = ref(null);
|
|
36
|
-
const menuStyle = reactive({
|
|
37
|
-
top: null,
|
|
38
|
-
left: null,
|
|
39
|
-
right: null,
|
|
40
|
-
pageY: null,
|
|
41
|
-
pageX: null,
|
|
42
|
-
clientX: null,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* ContextMenu.vue 컴포넌트 생성 메소드
|
|
47
|
-
* @param e - 사용자가 우클릭한 마우스 이벤트 정보
|
|
48
|
-
* @returns null
|
|
49
|
-
*/
|
|
50
|
-
const show = async (e) => {
|
|
51
|
-
isShow.value = true;
|
|
52
|
-
await nextTick();
|
|
53
|
-
const menuListRect = rootMenuList.value?.$el?.children[0].getBoundingClientRect();
|
|
54
|
-
if (menuListRect) {
|
|
55
|
-
const menuListHeight = menuListRect.height;
|
|
56
|
-
const menuListWidth = menuListRect.width;
|
|
57
|
-
const browserHeight = document.documentElement.clientHeight;
|
|
58
|
-
const browserWidth = document.documentElement.clientWidth;
|
|
59
|
-
const RIGHT_BUFFER_PX = 20;
|
|
60
|
-
menuStyle.pageX = e.pageX;
|
|
61
|
-
menuStyle.pageY = e.pageY;
|
|
62
|
-
menuStyle.clientX = e.clientX;
|
|
63
|
-
if (browserHeight < e.clientY + menuListHeight) {
|
|
64
|
-
// dropTop
|
|
65
|
-
menuStyle.top = `${e.pageY - menuListHeight}px`;
|
|
66
|
-
} else {
|
|
67
|
-
// dropDown
|
|
68
|
-
menuStyle.top = `${e.pageY}px`;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (browserWidth < e.clientX + menuListWidth + RIGHT_BUFFER_PX) {
|
|
72
|
-
menuStyle.left = `${e.pageX - menuListWidth}px`;
|
|
73
|
-
} else {
|
|
74
|
-
menuStyle.left = `${e.pageX}px`;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* ContextMenu 컴포넌트 숨김 메소드
|
|
81
|
-
* @returns null
|
|
82
|
-
*/
|
|
83
|
-
const hide = async () => {
|
|
84
|
-
await nextTick();
|
|
85
|
-
if (isShowMenuOnClick.value) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
isShow.value = false;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
return {
|
|
92
|
-
isShow,
|
|
93
|
-
rootMenuList,
|
|
94
|
-
menuStyle,
|
|
95
|
-
show,
|
|
96
|
-
hide,
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const useMenuList = () => {
|
|
101
|
-
const { props, emit } = getCurrentInstance();
|
|
102
|
-
|
|
103
|
-
// nested구조 하위 리스트에서 최상단의 ContextMenu에 isShow를 전달할 때 사용하는 변수
|
|
104
|
-
const computedIsShow = computed({
|
|
105
|
-
get: () => props.isShow,
|
|
106
|
-
set: val => emit('update:isShow', val),
|
|
107
|
-
});
|
|
108
|
-
// 자식(.children 속성) 존재 여부
|
|
109
|
-
const isExistChild = computed(() => !!props.items.some(v => v.children));
|
|
110
|
-
// 마우스오버한 항목에 자식 리스트 정보
|
|
111
|
-
const childrenItems = ref([]);
|
|
112
|
-
// 자식 컴포넌트 보임 여부
|
|
113
|
-
const isShowChild = ref(false);
|
|
114
|
-
const childMenu = ref(null);
|
|
115
|
-
// MenuList 스타일 정보
|
|
116
|
-
const menuStyle = reactive({
|
|
117
|
-
top: null,
|
|
118
|
-
left: null,
|
|
119
|
-
right: null,
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* 모두 닫기 메소드, 주로 정상적인 항목 클릭 후 해당 메소드 실행
|
|
124
|
-
* 자식이 있는 항목은 클릭하였을 때, return 한다.
|
|
125
|
-
* @param children
|
|
126
|
-
*/
|
|
127
|
-
const hideAll = (children) => {
|
|
128
|
-
if (children) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
computedIsShow.value = false;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* 자식 메뉴의 위치를 지정하는 함수
|
|
136
|
-
* @param e - 마우스 이벤트
|
|
137
|
-
*/
|
|
138
|
-
const useChildPosition = (e) => {
|
|
139
|
-
const browserWidth = document.documentElement.clientWidth;
|
|
140
|
-
const browserHeight = document.documentElement.clientHeight;
|
|
141
|
-
const RIGHT_BUFFER_PX = 20;
|
|
142
|
-
|
|
143
|
-
const parentMenuRect = e.target.parentElement?.getBoundingClientRect();
|
|
144
|
-
const {
|
|
145
|
-
x: parentMenuX,
|
|
146
|
-
y: parentMenuY,
|
|
147
|
-
width: parentMenuWidth,
|
|
148
|
-
height: parentMenuHeight,
|
|
149
|
-
} = parentMenuRect;
|
|
150
|
-
|
|
151
|
-
const childMenuRect = childMenu.value?.$el?.children[0].getBoundingClientRect();
|
|
152
|
-
const { width: childMenuWidth, height: childMenuHeight } = childMenuRect;
|
|
153
|
-
|
|
154
|
-
// 자식 요소가 부모 요소로부터 얼마나 떨어져 있는 지 (Top)
|
|
155
|
-
const elementOffsetTop = e.target.offsetTop;
|
|
156
|
-
|
|
157
|
-
const isOverflowHeight = browserHeight < parentMenuY + elementOffsetTop + childMenuHeight;
|
|
158
|
-
const isOverflowWidth = browserWidth < parentMenuX + parentMenuWidth
|
|
159
|
-
+ childMenuWidth + RIGHT_BUFFER_PX;
|
|
160
|
-
|
|
161
|
-
if (!isOverflowHeight) {
|
|
162
|
-
// dropDown
|
|
163
|
-
menuStyle.top = `${elementOffsetTop}px`;
|
|
164
|
-
} else {
|
|
165
|
-
// dropTop
|
|
166
|
-
menuStyle.top = `${parentMenuHeight - childMenuHeight}px`;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (!isOverflowWidth) {
|
|
170
|
-
menuStyle.left = `${parentMenuWidth}px`;
|
|
171
|
-
} else {
|
|
172
|
-
menuStyle.left = `${0 - childMenuWidth}px`;
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* 항목에 마우스 엔터 시 호출되는 함수
|
|
178
|
-
* @param e - 마우스 이벤트
|
|
179
|
-
* @param item - ContextMenu > Mouse Enter 된 요소의 값
|
|
180
|
-
* - 자식 요소 없을 때: {click: Function, iconClass: String, text: String}
|
|
181
|
-
* - 자식 요소 있을 때: {children: Array, text: String}
|
|
182
|
-
* @returns null
|
|
183
|
-
*/
|
|
184
|
-
const handleMouseEnter = async (e, item) => {
|
|
185
|
-
if (!item.children || !Array.isArray(item.children) || item.disabled) {
|
|
186
|
-
isShowChild.value = false;
|
|
187
|
-
} else {
|
|
188
|
-
isShowChild.value = true;
|
|
189
|
-
childrenItems.value = item.children;
|
|
190
|
-
await nextTick();
|
|
191
|
-
useChildPosition(e);
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* 항목에 마우스 클릭 시 호출되는 함수
|
|
197
|
-
* @param item - ContextMenu > 클릭된 요소의 값
|
|
198
|
-
* - 자식 요소 없을 때: {click, iconClass, text}
|
|
199
|
-
* - 자식 요소 있을 때: {children(Array), text}
|
|
200
|
-
* @returns null
|
|
201
|
-
*/
|
|
202
|
-
const handleItemClick = (item) => {
|
|
203
|
-
if (item.click && !item.disabled) {
|
|
204
|
-
item.click(item);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
if (!item.isShowMenu) {
|
|
208
|
-
hideAll(item.children);
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
return {
|
|
213
|
-
computedIsShow,
|
|
214
|
-
isExistChild,
|
|
215
|
-
isShowChild,
|
|
216
|
-
childMenu,
|
|
217
|
-
menuStyle,
|
|
218
|
-
childrenItems,
|
|
219
|
-
handleItemClick,
|
|
220
|
-
handleMouseEnter,
|
|
221
|
-
hideAll,
|
|
222
|
-
};
|
|
223
|
-
};
|