@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.
@@ -1,133 +1,156 @@
1
- <template>
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
-
11
- </div>
12
- </div>
13
- </template>
14
-
15
- <script lang="ts">
16
- import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
17
- import { toTop } from '../../routing/routing';
18
- import { TopMenuItems } from '../../models/menu-models';
19
-
20
- export default {
21
- name: 'TopSubMenuItems',
22
- components: {
23
- FontAwesomeIcon: FontAwesomeIcon
24
- },
25
- props: {
26
- item: {
27
- type: Object,
28
- required: true
29
- },
30
- menuBar: {
31
- type: Object,
32
- required: true
33
- },
34
- topMenuItems: {
35
- type: Array as () => TopMenuItems[],
36
- default: () => []
37
- }
38
- },
39
- data() {
40
- return {
41
- tooltip: false,
42
- topMenuItems: this.topMenuItems,
43
- item: this.item,
44
- menuBar: this.menuBar,
45
- toTop: toTop
46
- }
47
- },
48
- watch: {
49
- item(newVal: any) {
50
- this.item = newVal;
51
- },
52
- menuBar(newVal: any) {
53
- this.menuBar = newVal;
54
- }
55
- },
56
- methods: {
57
- openHoverTopMenuItem(event: MouseEvent, item: any) {
58
- item.opened = true;
59
- },
60
- closeTopMenuItem(event: MouseEvent, item: any) {
61
- item.opened = false;
62
- },
63
- openTopMenuItem(event: MouseEvent, item: any) {
64
- if(!item.items?.length){
65
- toTop(item.route);
66
- return;
67
- }
68
- },
69
- }
70
- };
71
- </script>
72
-
73
-
74
- <style>
75
- .top-sub-menu-items {
76
- position: absolute;
77
- top: 48px;
78
- right: 0px;
79
- padding: 8px 0px;
80
- margin-top: 1px;
81
- width: 200px;
82
- z-index: 999999999;
83
- background-color: transparent;
84
- }
85
-
86
- .content{
87
- border: 2px solid rgba(70, 70, 70, 0.4);
88
- border-radius: 4px;
89
- padding: 10px;
90
- background-color: white;
91
- }
92
-
93
-
94
- .top-menu-item{
95
- display: flex;
96
- justify-content: space-between;
97
- column-gap: 4px;
98
- cursor: pointer;
99
- }
100
-
101
- .item{
102
- display: flex;
103
- flex-direction: row;
104
- width: 200px;
105
- padding: 3px 7px;
106
- cursor: pointer;
107
- }
108
- @keyframes openMenu {
109
- from {
110
- transform: rotate(0deg);
111
- }
112
- to {
113
- transform: rotate(180deg);
114
- }
115
- }
116
-
117
- @keyframes menuTooltipOpened {
118
- from{
119
- transform: translateY(-1px);
120
- }
121
- to{
122
- transform: translateY(0px);
123
- }
124
- }
125
-
126
- .tooltip-opened {
127
- animation: menuTooltipOpened 0.09s ease forwards;
128
- }
129
-
130
- .icon-opened{
131
- animation: openMenu 0.02s ease forwards;
132
- }
133
- </style>
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 './MenuPlate.vue';
2
- export { LeftMenuModel, MenuItemModel, ThemeModel, MenuBarModel } from './models/menu-models';
3
-
4
- /*
5
- * Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com
6
- * License - https://fontawesome.com/license/free - MIT License
7
- * Copyright 2025 Fonticons, Inc.
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 './MenuPlate.vue';
2
- export { LeftMenuModel, MenuItemModel, ThemeModel, MenuBarModel } from './models/menu-models';
3
-
4
- /*
5
- * Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com
6
- * License - https://fontawesome.com/license/free - MIT License
7
- * Copyright 2025 Fonticons, Inc.
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 { faChevronDown, faChevronRight, faChevronUp } from "@fortawesome/free-solid-svg-icons";
2
-
3
- export class LeftMenuModel{
4
- name: string = '';
5
- icon: any;
6
- route: string = '';
7
- items: MenuItemModel[] = [];
8
- }
9
-
10
- export class MenuItemModel{
11
- name: string = '';
12
- route: string = "";
13
- items: MenuItemModel[] = [];
14
- }
15
-
16
- export class MenuBarModel{
17
- icon: any = faChevronDown; //angle-arrow, bars, ellipsis
18
- name: string = '';
19
- loading: boolean = false;
20
- opened: boolean = false;
21
- changeIcon: 'flip' | 'rotate' | 'hover' | 'none' = 'none';
22
- }
23
-
24
- export class LeftMenuItems{
25
- id: number = 0;
26
- name: string = '';
27
- icon: any;
28
- route: string = '';
29
- opened: boolean = false;
30
- openIcon: any = faChevronDown;
31
- items: TopMenuItems[] = [] as TopMenuItems[];
32
- active: boolean = false;
33
- }
34
-
35
- export class TopMenuItems{
36
- id: number = 0;
37
- name: string = '';
38
- route: string = '';
39
- opened: boolean = false;
40
- active: boolean = false;
41
- openIcon: any = faChevronDown;
42
- items: TopMenuItems[] = [] as TopMenuItems[];
43
- }
44
-
45
- export class ThemeModel{
46
- name: string = '';
47
- value: string = '';
48
- type: 'primary' | 'secondary' | 'dark' | 'light' | 'basic' = 'primary';
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
+ }
@@ -1,42 +1,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
- ]
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
+ ];
@@ -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
- 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
- }
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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelmenu/navigation",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "",
5
5
  "main": "./menu/index.d.ts",
6
6
  "type": "module",