@modelmenu/navigation 2.2.0 → 2.2.1
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/dist/index.es.js +326 -315
- package/dist/index.umd.js +9 -9
- package/menu/MenuPlate.vue +21 -12
- package/menu/components/menu-item.vue +0 -3
- package/menu/components/sub-menu-items.vue +1 -4
- package/menu/components/top-menu-items/top-menu-item.vue +17 -6
- package/menu/components/top-menu-items/top-sub-menu-items.vue +32 -12
- package/package.json +1 -1
package/menu/MenuPlate.vue
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<div class="item" :class="{'menu-item-opened': menuBar.opened, }">
|
|
15
15
|
<MenuItem :item="item" :menuBar="menuBar" :left-items="leftMenuItems"></MenuItem>
|
|
16
16
|
<SubMenuItems @openmenu="handleOpenMenu($event)" @changeMenuItem="handleMenuItem($event)" v-show="menuBar.opened" :left-menu-items="leftMenuItems" :item="item" :menuBar="menuBar"></SubMenuItems>
|
|
17
|
-
<div class="active-tooltip" v-if="tooltip && item.items?.length && !menuBar.opened" @mouseleave="hideTooltipItems($event)">
|
|
17
|
+
<div :class="['active-tooltip', { 'tooltip-opened': tooltip && item.items?.length && !menuBar.opened } ]" v-if="tooltip && item.items?.length && !menuBar.opened" @mouseleave="hideTooltipItems($event)">
|
|
18
18
|
<div v-for="value in item.items" :key="value.name" class="tooltip-item" @click="openTooltipItem($event, value, item)">
|
|
19
19
|
{{ value.name }}
|
|
20
20
|
|
|
@@ -246,10 +246,6 @@
|
|
|
246
246
|
z-index: 99999;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
.svg-inline--fa {
|
|
250
|
-
color: rgba(60, 60, 60, 0.8) !important;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
249
|
.item-active{
|
|
254
250
|
background-color: #f2f2f2;
|
|
255
251
|
}
|
|
@@ -289,6 +285,19 @@
|
|
|
289
285
|
}
|
|
290
286
|
}
|
|
291
287
|
|
|
288
|
+
@keyframes menuTooltipOpened {
|
|
289
|
+
from{
|
|
290
|
+
opacity: 0;
|
|
291
|
+
}
|
|
292
|
+
to{
|
|
293
|
+
opacity: 1;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.tooltip-opened{
|
|
298
|
+
animation: menuTooltipOpened 1s ease forwards;
|
|
299
|
+
}
|
|
300
|
+
|
|
292
301
|
.loader-track,
|
|
293
302
|
.loader-ring {
|
|
294
303
|
fill: none;
|
|
@@ -340,7 +349,7 @@
|
|
|
340
349
|
|
|
341
350
|
.horizontal-menu {
|
|
342
351
|
position: absolute;
|
|
343
|
-
border-bottom:
|
|
352
|
+
border-bottom: 2px solid rgba(70, 70, 70, 0.4);
|
|
344
353
|
top: 0;
|
|
345
354
|
left: 0;
|
|
346
355
|
width: 100%;
|
|
@@ -360,7 +369,7 @@
|
|
|
360
369
|
animation: closeMenu 0.3s ease-out forwards;
|
|
361
370
|
height: 100dvh;
|
|
362
371
|
background-color: white;
|
|
363
|
-
border-right:
|
|
372
|
+
border-right: 2px solid rgba(70, 70, 70, 0.4);
|
|
364
373
|
}
|
|
365
374
|
|
|
366
375
|
.menu-item {
|
|
@@ -406,13 +415,13 @@
|
|
|
406
415
|
justify-content: center;
|
|
407
416
|
cursor: pointer;
|
|
408
417
|
align-items: center;
|
|
409
|
-
border-right:
|
|
418
|
+
border-right: 2px solid rgba(70, 70, 70, 0.4);
|
|
410
419
|
}
|
|
411
420
|
|
|
412
421
|
.menu-icon{
|
|
413
422
|
width: 30px;
|
|
414
423
|
height: 30px;
|
|
415
|
-
border:
|
|
424
|
+
border: 2px solid rgba(70, 70, 70, 0.4);
|
|
416
425
|
display: flex;
|
|
417
426
|
justify-content: center;
|
|
418
427
|
align-items: center;
|
|
@@ -421,7 +430,7 @@
|
|
|
421
430
|
|
|
422
431
|
.menu-icon:hover {
|
|
423
432
|
cursor: pointer;
|
|
424
|
-
background-color:
|
|
433
|
+
background-color: rgba(133, 133, 133, 0.1);
|
|
425
434
|
}
|
|
426
435
|
|
|
427
436
|
@keyframes flipAnimation {
|
|
@@ -481,10 +490,10 @@
|
|
|
481
490
|
position: fixed;
|
|
482
491
|
left: 80px;
|
|
483
492
|
width: 240px;
|
|
484
|
-
|
|
493
|
+
border-radius: 4px;
|
|
485
494
|
background-color: white;
|
|
486
495
|
z-index: 9999999;
|
|
487
|
-
border:
|
|
496
|
+
border: 2px solid rgba(70, 70, 70, 0.4);
|
|
488
497
|
}
|
|
489
498
|
|
|
490
499
|
.main{
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
width: 240px;
|
|
95
95
|
height: 80px;
|
|
96
96
|
border-radius: 4px;
|
|
97
|
-
border: 1px solid
|
|
97
|
+
border: 1px solid rgba(70, 70, 70, 0.4);
|
|
98
98
|
background-color: white !important;
|
|
99
99
|
z-index: 999999999;
|
|
100
100
|
}
|
|
@@ -112,9 +112,6 @@
|
|
|
112
112
|
.sub-menu-button{
|
|
113
113
|
cursor: pointer;
|
|
114
114
|
}
|
|
115
|
-
.svg-inline--fa {
|
|
116
|
-
color: rgba(60, 60, 60, 0.8) !important;
|
|
117
|
-
}
|
|
118
115
|
|
|
119
116
|
.sub-menu-items .menu-item{
|
|
120
117
|
margin-left: 60px;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
<script lang="ts">
|
|
17
|
-
import {
|
|
17
|
+
import { faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
18
18
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
19
19
|
import TopSubMenuItems from './../top-menu-items/top-sub-menu-items.vue';
|
|
20
20
|
import { toTop } from '../../routing/routing';
|
|
@@ -45,6 +45,11 @@ import { toTop } from '../../routing/routing';
|
|
|
45
45
|
toTop: toTop
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
watch: {
|
|
49
|
+
topMenuItems(newVal){
|
|
50
|
+
this.topMenuItems = newVal;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
48
53
|
methods: {
|
|
49
54
|
openTopMenuItem(event: MouseEvent, item: any) {
|
|
50
55
|
console.log(item)
|
|
@@ -58,10 +63,16 @@ import { toTop } from '../../routing/routing';
|
|
|
58
63
|
document.querySelector<Element>(`.horizontal-top-menu-item-${item.id}`)?.classList.add('menu-hover');
|
|
59
64
|
this.closeMenuTabs(this.topMenuItems);
|
|
60
65
|
|
|
66
|
+
let timeout = 200
|
|
67
|
+
|
|
68
|
+
for(let item of document.querySelectorAll('.top-sub-menu-items')){
|
|
69
|
+
item.classList.remove('tooltip-opened')
|
|
70
|
+
}
|
|
71
|
+
|
|
61
72
|
setTimeout(() => {
|
|
62
73
|
item.opened = true;
|
|
63
74
|
this.closeSubItems(item);
|
|
64
|
-
},
|
|
75
|
+
}, timeout)
|
|
65
76
|
},
|
|
66
77
|
closeTopMenuItem(event: MouseEvent, item: any) {
|
|
67
78
|
document.querySelector<Element>(`.horizontal-top-menu-item-${item.id}`)?.classList.remove('menu-hover');
|
|
@@ -124,6 +135,7 @@ import { toTop } from '../../routing/routing';
|
|
|
124
135
|
cursor: pointer;
|
|
125
136
|
column-gap: 4px;
|
|
126
137
|
border-bottom: 1px solid transparent;
|
|
138
|
+
margin: 4px;
|
|
127
139
|
box-sizing: border-box;
|
|
128
140
|
}
|
|
129
141
|
|
|
@@ -151,17 +163,16 @@ import { toTop } from '../../routing/routing';
|
|
|
151
163
|
border-bottom: 2px solid transparent;
|
|
152
164
|
padding: 4px 12px;
|
|
153
165
|
}
|
|
154
|
-
|
|
155
166
|
@keyframes openMenu {
|
|
156
167
|
from {
|
|
157
|
-
transform:
|
|
168
|
+
transform: rotateZ(0deg);
|
|
158
169
|
}
|
|
159
170
|
to {
|
|
160
|
-
transform:
|
|
171
|
+
transform: rotateZ(180deg);
|
|
161
172
|
}
|
|
162
173
|
}
|
|
163
174
|
|
|
164
175
|
.icon-opened{
|
|
165
|
-
animation: openMenu 0.
|
|
176
|
+
animation: openMenu 0.2s ease forwards;
|
|
166
177
|
}
|
|
167
178
|
</style>
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="top-sub-menu-items" v-if="item.opened">
|
|
3
|
-
<div
|
|
4
|
-
|
|
5
|
-
<div
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<div :class="['top-sub-menu-items', {'tooltip-opened': item.opened }]" v-if="item.opened">
|
|
3
|
+
<div class="content">
|
|
4
|
+
<div v-for="(subSubItem, index) in item.items" :key="subSubItem.id" class="item">
|
|
5
|
+
<div class="top-menu-item" @click.stop="openTopMenuItem($event, subSubItem)" @mouseenter="openHoverTopMenuItem($event, subSubItem)">
|
|
6
|
+
<div>{{ subSubItem.name }}</div> <div v-if="subSubItem.items?.length"><FontAwesomeIcon :size="'sm'" :class="{'icon-opened': item.opened}" :icon="subSubItem.openIcon"></FontAwesomeIcon></div>
|
|
7
|
+
</div>
|
|
8
|
+
<TopSubMenuItems @mouseleave="closeTopMenuItem($event, subSubItem)" :style="{top: `${(Number(index)) * 70}px`, right: `${2 * 10 + 40}px`}" v-if="subSubItem.items?.length" :key="subSubItem.id" :item="subSubItem" :topMenuItems="topMenuItems" :menuBar="menuBar"></TopSubMenuItems>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
8
11
|
</div>
|
|
9
12
|
</div>
|
|
10
13
|
</template>
|
|
11
14
|
|
|
12
15
|
<script lang="ts">
|
|
13
|
-
import { faChevronDown, faChevronRight } from '@fortawesome/free-solid-svg-icons';
|
|
14
16
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
15
17
|
import { toTop } from '../../routing/routing';
|
|
16
18
|
import { TopMenuItems } from '../../models/menu-models';
|
|
@@ -74,17 +76,21 @@ import { TopMenuItems } from '../../models/menu-models';
|
|
|
74
76
|
position: absolute;
|
|
75
77
|
top: 48px;
|
|
76
78
|
right: 0px;
|
|
77
|
-
|
|
78
|
-
padding: 10px;
|
|
79
|
+
padding: 8px 0px;
|
|
79
80
|
margin-top: 1px;
|
|
80
81
|
width: 200px;
|
|
81
82
|
z-index: 999999999;
|
|
82
|
-
background-color:
|
|
83
|
+
background-color: transparent;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
.
|
|
86
|
-
|
|
86
|
+
.content{
|
|
87
|
+
border: 2px solid rgba(70, 70, 70, 0.4);
|
|
88
|
+
border-radius: 4px;
|
|
89
|
+
padding: 10px;
|
|
90
|
+
background-color: white;
|
|
87
91
|
}
|
|
92
|
+
|
|
93
|
+
|
|
88
94
|
.top-menu-item{
|
|
89
95
|
display: flex;
|
|
90
96
|
justify-content: space-between;
|
|
@@ -108,6 +114,20 @@ import { TopMenuItems } from '../../models/menu-models';
|
|
|
108
114
|
}
|
|
109
115
|
}
|
|
110
116
|
|
|
117
|
+
|
|
118
|
+
@keyframes menuTooltipOpened {
|
|
119
|
+
from{
|
|
120
|
+
transform: translateY(-1px);
|
|
121
|
+
}
|
|
122
|
+
to{
|
|
123
|
+
transform: translateY(0px);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.tooltip-opened {
|
|
128
|
+
animation: menuTooltipOpened 0.09s ease forwards;
|
|
129
|
+
}
|
|
130
|
+
|
|
111
131
|
.icon-opened{
|
|
112
132
|
animation: openMenu 0.02s ease forwards;
|
|
113
133
|
}
|