@modelmenu/navigation 2.5.0 → 2.6.0
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 +579 -565
- package/dist/index.umd.js +12 -12
- package/menu/MenuPlate.vue +544 -504
- package/menu/components/menu-item.vue +256 -238
- package/menu/components/sub-menu-items.vue +146 -125
- package/menu/components/top-menu-items/top-menu-item.vue +224 -194
- package/menu/components/top-menu-items/top-sub-menu-items.vue +156 -133
- package/menu/index.d.ts +13 -8
- package/menu/index.ts +13 -8
- package/menu/models/menu-models.ts +53 -49
- package/menu/resources/theme.ts +42 -42
- package/menu/routing/routing.ts +41 -41
- package/package.json +1 -1
|
@@ -1,133 +1,156 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="['top-sub-menu-items', { 'tooltip-opened': item.opened }]"
|
|
4
|
+
v-if="item.opened"
|
|
5
|
+
>
|
|
6
|
+
<div class="content">
|
|
7
|
+
<div
|
|
8
|
+
v-for="(subSubItem, index) in item.items"
|
|
9
|
+
:key="subSubItem.id"
|
|
10
|
+
class="item"
|
|
11
|
+
>
|
|
12
|
+
<div
|
|
13
|
+
class="top-menu-item"
|
|
14
|
+
@click.stop="openTopMenuItem($event, subSubItem)"
|
|
15
|
+
@mouseenter="openHoverTopMenuItem($event, subSubItem)"
|
|
16
|
+
>
|
|
17
|
+
<div>{{ subSubItem.name }}</div>
|
|
18
|
+
<div v-if="subSubItem.items?.length">
|
|
19
|
+
<FontAwesomeIcon
|
|
20
|
+
:size="'sm'"
|
|
21
|
+
:class="{ 'icon-opened': item.opened }"
|
|
22
|
+
:icon="subSubItem.openIcon"
|
|
23
|
+
></FontAwesomeIcon>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<TopSubMenuItems
|
|
27
|
+
@mouseleave="closeTopMenuItem($event, subSubItem)"
|
|
28
|
+
:style="{ top: `${Number(index) * 70}px`, right: `${2 * 10 + 40}px` }"
|
|
29
|
+
v-if="subSubItem.items?.length"
|
|
30
|
+
:key="subSubItem.id"
|
|
31
|
+
:item="subSubItem"
|
|
32
|
+
:topMenuItems="topMenuItems"
|
|
33
|
+
:menuBar="menuBar"
|
|
34
|
+
></TopSubMenuItems>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script lang="ts">
|
|
41
|
+
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
|
42
|
+
import { toTop } from "../../routing/routing";
|
|
43
|
+
import { TopMenuItems } from "../../models/menu-models";
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
name: "TopSubMenuItems",
|
|
47
|
+
components: {
|
|
48
|
+
FontAwesomeIcon: FontAwesomeIcon,
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
item: {
|
|
52
|
+
type: Object,
|
|
53
|
+
required: true,
|
|
54
|
+
},
|
|
55
|
+
menuBar: {
|
|
56
|
+
type: Object,
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
topMenuItems: {
|
|
60
|
+
type: Array as () => TopMenuItems[],
|
|
61
|
+
default: () => [],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
tooltip: false,
|
|
67
|
+
topMenuItems: this.topMenuItems,
|
|
68
|
+
item: this.item,
|
|
69
|
+
menuBar: this.menuBar,
|
|
70
|
+
toTop: toTop,
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
watch: {
|
|
74
|
+
item(newVal: any) {
|
|
75
|
+
this.item = newVal;
|
|
76
|
+
},
|
|
77
|
+
menuBar(newVal: any) {
|
|
78
|
+
this.menuBar = newVal;
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
openHoverTopMenuItem(event: MouseEvent, item: any) {
|
|
83
|
+
item.opened = true;
|
|
84
|
+
},
|
|
85
|
+
closeTopMenuItem(event: MouseEvent, item: any) {
|
|
86
|
+
item.opened = false;
|
|
87
|
+
},
|
|
88
|
+
openTopMenuItem(event: MouseEvent, item: any) {
|
|
89
|
+
if (!item.items?.length) {
|
|
90
|
+
toTop(item.route);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style>
|
|
99
|
+
.top-sub-menu-items {
|
|
100
|
+
position: absolute;
|
|
101
|
+
top: 48px;
|
|
102
|
+
right: 0px;
|
|
103
|
+
padding: 8px 0px;
|
|
104
|
+
margin-top: 1px;
|
|
105
|
+
width: 200px;
|
|
106
|
+
z-index: 999999999;
|
|
107
|
+
background-color: transparent;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.content {
|
|
111
|
+
border: 2px solid rgba(70, 70, 70, 0.4);
|
|
112
|
+
border-radius: 4px;
|
|
113
|
+
padding: 10px;
|
|
114
|
+
background-color: white;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.top-menu-item {
|
|
118
|
+
display: flex;
|
|
119
|
+
justify-content: space-between;
|
|
120
|
+
column-gap: 4px;
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.item {
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-direction: row;
|
|
127
|
+
width: 200px;
|
|
128
|
+
padding: 3px 7px;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
}
|
|
131
|
+
@keyframes openMenu {
|
|
132
|
+
from {
|
|
133
|
+
transform: rotate(0deg);
|
|
134
|
+
}
|
|
135
|
+
to {
|
|
136
|
+
transform: rotate(180deg);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@keyframes menuTooltipOpened {
|
|
141
|
+
from {
|
|
142
|
+
transform: translateY(-1px);
|
|
143
|
+
}
|
|
144
|
+
to {
|
|
145
|
+
transform: translateY(0px);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.tooltip-opened {
|
|
150
|
+
animation: menuTooltipOpened 0.09s ease forwards;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.icon-opened {
|
|
154
|
+
animation: openMenu 0.02s ease forwards;
|
|
155
|
+
}
|
|
156
|
+
</style>
|
package/menu/index.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
export { default as MenuPlate } from
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export { default as MenuPlate } from "./MenuPlate.vue";
|
|
2
|
+
export {
|
|
3
|
+
LeftMenuModel,
|
|
4
|
+
MenuItemModel,
|
|
5
|
+
ThemeModel,
|
|
6
|
+
MenuBarModel,
|
|
7
|
+
} from "./models/menu-models";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com
|
|
11
|
+
* License - https://fontawesome.com/license/free - MIT License
|
|
12
|
+
* Copyright 2025 Fonticons, Inc.
|
|
13
|
+
*/
|
package/menu/index.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
export { default as MenuPlate } from
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export { default as MenuPlate } from "./MenuPlate.vue";
|
|
2
|
+
export {
|
|
3
|
+
LeftMenuModel,
|
|
4
|
+
MenuItemModel,
|
|
5
|
+
ThemeModel,
|
|
6
|
+
MenuBarModel,
|
|
7
|
+
} from "./models/menu-models";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com
|
|
11
|
+
* License - https://fontawesome.com/license/free - MIT License
|
|
12
|
+
* Copyright 2025 Fonticons, Inc.
|
|
13
|
+
*/
|
|
@@ -1,49 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
import {
|
|
2
|
+
faChevronDown,
|
|
3
|
+
faChevronRight,
|
|
4
|
+
faChevronUp,
|
|
5
|
+
} from "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
|
|
7
|
+
export class LeftMenuModel {
|
|
8
|
+
name = "";
|
|
9
|
+
icon: any;
|
|
10
|
+
route = "";
|
|
11
|
+
items: MenuItemModel[] = [];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class MenuItemModel {
|
|
15
|
+
name = "";
|
|
16
|
+
route = "";
|
|
17
|
+
items: MenuItemModel[] = [];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class MenuBarModel {
|
|
21
|
+
icon: any = faChevronRight; //angle-arrow, bars, ellipsis
|
|
22
|
+
name = "";
|
|
23
|
+
loading = false;
|
|
24
|
+
opened = false;
|
|
25
|
+
changeIcon: "flip" | "rotate" | "hover" | "none" = "none";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class LeftMenuItems {
|
|
29
|
+
id = 0;
|
|
30
|
+
name = "";
|
|
31
|
+
icon: any;
|
|
32
|
+
route = "";
|
|
33
|
+
opened = false;
|
|
34
|
+
openIcon: any = faChevronDown;
|
|
35
|
+
items: TopMenuItems[] = [] as TopMenuItems[];
|
|
36
|
+
active = false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class TopMenuItems {
|
|
40
|
+
id = 0;
|
|
41
|
+
name = "";
|
|
42
|
+
route = "";
|
|
43
|
+
opened = false;
|
|
44
|
+
active = false;
|
|
45
|
+
openIcon: any = faChevronDown;
|
|
46
|
+
items: TopMenuItems[] = [] as TopMenuItems[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class ThemeModel {
|
|
50
|
+
name = "";
|
|
51
|
+
value = "";
|
|
52
|
+
type: "primary" | "secondary" | "dark" | "light" | "basic" = "primary";
|
|
53
|
+
}
|
package/menu/resources/theme.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
export const themes = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]
|
|
1
|
+
export const themes = [
|
|
2
|
+
{
|
|
3
|
+
name: "Light",
|
|
4
|
+
value: "light",
|
|
5
|
+
type: "light",
|
|
6
|
+
background: "#ffffff",
|
|
7
|
+
text: "#000000",
|
|
8
|
+
iconColor: "#000000",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "Dark",
|
|
12
|
+
value: "dark",
|
|
13
|
+
type: "dark",
|
|
14
|
+
background: "rgba(60, 60, 60, 1)",
|
|
15
|
+
text: "#ffffff",
|
|
16
|
+
iconColor: "orange",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "Primary",
|
|
20
|
+
value: "primary",
|
|
21
|
+
type: "primary",
|
|
22
|
+
background: "#007bff",
|
|
23
|
+
text: "#ffffff",
|
|
24
|
+
iconColor: "#ffffff",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "Secondary",
|
|
28
|
+
value: "secondary",
|
|
29
|
+
type: "secondary",
|
|
30
|
+
background: "#6c757d",
|
|
31
|
+
text: "#ffffff",
|
|
32
|
+
iconColor: "#ffffff",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "basic",
|
|
36
|
+
value: "basic",
|
|
37
|
+
type: "light",
|
|
38
|
+
background: "#9dffac",
|
|
39
|
+
text: "#000000",
|
|
40
|
+
iconColor: "#000000",
|
|
41
|
+
},
|
|
42
|
+
];
|
package/menu/routing/routing.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
let Router: any;
|
|
2
|
-
let MenuBar: any;
|
|
3
|
-
export let Loading: any;
|
|
4
|
-
|
|
5
|
-
export const router = (router: any) => {
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const menubar = (menubar: any) => {
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const load = (loading: any) => {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
1
|
+
let Router: any;
|
|
2
|
+
let MenuBar: any;
|
|
3
|
+
export let Loading: any;
|
|
4
|
+
|
|
5
|
+
export const router = (router: any) => {
|
|
6
|
+
Router = router;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const menubar = (menubar: any) => {
|
|
10
|
+
MenuBar = menubar;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const load = (loading: any) => {
|
|
14
|
+
Loading = loading;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const to = (path: string) => {
|
|
18
|
+
if (Router != null) {
|
|
19
|
+
Loading = true;
|
|
20
|
+
MenuBar.loading = Loading;
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
Router.push({ path: `${path}` }).finally(() => {
|
|
23
|
+
Loading = false;
|
|
24
|
+
MenuBar.loading = Loading;
|
|
25
|
+
});
|
|
26
|
+
}, 400);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const toTop = (path: string) => {
|
|
31
|
+
if (Router != null) {
|
|
32
|
+
Loading = true;
|
|
33
|
+
MenuBar.loading = Loading;
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
Router.push({ path: `${path}` }).finally(() => {
|
|
36
|
+
Loading = false;
|
|
37
|
+
MenuBar.loading = Loading;
|
|
38
|
+
});
|
|
39
|
+
}, 400);
|
|
40
|
+
}
|
|
41
|
+
};
|