@luizleon/sf.prefeiturasp.vuecomponents 0.0.49 → 0.0.51
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/components/panelmenu/PanelMenu.d.ts +0 -1
- package/dist/index.d.ts +2 -1
- package/dist/sf.prefeiturasp.vuecomponents.es.js +444 -443
- package/dist/sf.prefeiturasp.vuecomponents.es.js.map +1 -1
- package/dist/sf.prefeiturasp.vuecomponents.umd.js +32 -32
- package/dist/sf.prefeiturasp.vuecomponents.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/panelmenu/PanelMenu.vue +13 -6
- package/src/index.ts +2 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useRoute } from "vue-router";
|
|
3
3
|
import PanelMenu, { PanelMenuExpandedKeys } from "primevue/panelmenu";
|
|
4
4
|
import Icon from "./../icon/Icon.vue";
|
|
5
|
-
import { ref, watch } from "vue";
|
|
5
|
+
import { Ref, computed, ref, watch } from "vue";
|
|
6
6
|
|
|
7
7
|
export interface SfPanelMenuItem {
|
|
8
8
|
label: string;
|
|
@@ -11,6 +11,9 @@ export interface SfPanelMenuItem {
|
|
|
11
11
|
icon?: string;
|
|
12
12
|
items?: SfPanelMenuItem[];
|
|
13
13
|
key?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface Menu extends SfPanelMenuItem {
|
|
14
17
|
parentKey?: string;
|
|
15
18
|
}
|
|
16
19
|
|
|
@@ -20,10 +23,14 @@ const props = defineProps<{
|
|
|
20
23
|
|
|
21
24
|
const route = useRoute();
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
const menu: Ref<Menu[]> = computed(() => {
|
|
27
|
+
return props.items;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
AdicionarSourceKeys(menu.value);
|
|
24
31
|
|
|
25
32
|
function AdicionarSourceKeys(
|
|
26
|
-
items:
|
|
33
|
+
items: Menu[],
|
|
27
34
|
key: string | undefined = undefined
|
|
28
35
|
) {
|
|
29
36
|
items.forEach((item) => {
|
|
@@ -39,7 +46,7 @@ function AdicionarSourceKeys(
|
|
|
39
46
|
const expandedKeys = ref<PanelMenuExpandedKeys>({});
|
|
40
47
|
|
|
41
48
|
function MudancaDeRota(
|
|
42
|
-
items:
|
|
49
|
+
items: Menu[],
|
|
43
50
|
route: string,
|
|
44
51
|
key: string | undefined = undefined
|
|
45
52
|
) {
|
|
@@ -57,14 +64,14 @@ watch(
|
|
|
57
64
|
() => route.name,
|
|
58
65
|
(v) => {
|
|
59
66
|
if (!v) return;
|
|
60
|
-
MudancaDeRota(
|
|
67
|
+
MudancaDeRota(menu.value, v.toString());
|
|
61
68
|
}
|
|
62
69
|
);
|
|
63
70
|
</script>
|
|
64
71
|
|
|
65
72
|
<template>
|
|
66
73
|
<PanelMenu
|
|
67
|
-
:model="
|
|
74
|
+
:model="menu"
|
|
68
75
|
v-model:expandedKeys="expandedKeys"
|
|
69
76
|
:multiple="true"
|
|
70
77
|
:class="'sf-p-2'"
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ import SfDrawer from "./components/drawer/Drawer.vue";
|
|
|
8
8
|
import SfMessage from "./components/message/Message.vue";
|
|
9
9
|
import SfTooltip from "./components/tooltip/Tooltip.vue";
|
|
10
10
|
import SfPanelMenu from "./components/panelmenu/PanelMenu.vue";
|
|
11
|
+
import SfPanelMenuItem from "./components/panelmenu/PanelMenu.vue";
|
|
11
12
|
import { ThemeToggleBase } from "./components/internal/ThemeToggle";
|
|
12
13
|
|
|
13
14
|
import { UseNavMenuService } from "./services/navMenuService";
|
|
@@ -39,6 +40,7 @@ export {
|
|
|
39
40
|
UseAxiosClient,
|
|
40
41
|
AppResult,
|
|
41
42
|
AxiosClient,
|
|
43
|
+
SfPanelMenuItem,
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
/**
|