Skip to content

Commit e05c7e7

Browse files
committed
menu updates
1 parent aaca007 commit e05c7e7

File tree

9 files changed

+20
-19
lines changed

9 files changed

+20
-19
lines changed

resources/js/components/primevue/menu/Breadcrumb.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import { ref, useTemplateRef } from 'vue';
33
import Breadcrumb, { type BreadcrumbPassThroughOptions, type BreadcrumbProps } from 'primevue/breadcrumb';
44
import { ChevronRight } from 'lucide-vue-next';
5-
import type { ExtendedMenuItem } from '@/types';
5+
import type { MenuItem } from '@/types';
66
import { ptViewMerge } from '@/utils';
77
88
interface ExtendedBreadcrumbProps extends Omit<BreadcrumbProps, 'model'> {
9-
model: ExtendedMenuItem[];
9+
model: MenuItem[];
1010
}
1111
const componentProps = defineProps<ExtendedBreadcrumbProps>();
1212

resources/js/components/primevue/menu/ContextMenu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import { useTemplateRef } from 'vue';
33
import ContextMenu, { type ContextMenuProps } from 'primevue/contextmenu';
44
import { ChevronRight } from 'lucide-vue-next';
5-
import type { ExtendedMenuItem } from '@/types';
5+
import type { MenuItem } from '@/types';
66
import { ptViewMerge } from '@/utils';
77
88
interface ExtendedContextMenuProps extends Omit<ContextMenuProps, 'model'> {
9-
model: ExtendedMenuItem[];
9+
model: MenuItem[];
1010
}
1111
const componentProps = defineProps<ExtendedContextMenuProps>();
1212

resources/js/components/primevue/menu/Menu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<script setup lang="ts">
22
import { useTemplateRef } from 'vue';
33
import Menu, { type MenuProps } from 'primevue/menu';
4-
import type { ExtendedMenuItem } from '@/types';
4+
import type { MenuItem } from '@/types';
55
import { ptViewMerge } from '@/utils';
66
77
interface ExtendedMenuProps extends Omit<MenuProps, 'model'> {
8-
model: ExtendedMenuItem[];
8+
model: MenuItem[];
99
}
1010
const componentProps = defineProps<ExtendedMenuProps>();
1111

resources/js/components/primevue/menu/Menubar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import { useTemplateRef } from 'vue';
33
import Menubar, { type MenubarProps } from 'primevue/menubar';
44
import { ChevronDown, ChevronRight } from 'lucide-vue-next';
5-
import type { ExtendedMenuItem } from '@/types';
5+
import type { MenuItem } from '@/types';
66
import { ptViewMerge } from '@/utils';
77
88
interface ExtendedMenubarProps extends Omit<MenubarProps, 'model'> {
9-
model: ExtendedMenuItem[];
9+
model: MenuItem[];
1010
}
1111
const componentProps = withDefaults(
1212
defineProps<ExtendedMenubarProps>(),

resources/js/components/primevue/menu/PanelMenu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import { useTemplateRef } from 'vue';
33
import PanelMenu, { type PanelMenuPassThroughOptions, type PanelMenuProps } from 'primevue/panelmenu';
44
import { ChevronDown, ChevronRight } from 'lucide-vue-next';
5-
import type { ExtendedMenuItem } from '@/types';
5+
import type { MenuItem } from '@/types';
66
import { ptViewMerge } from '@/utils';
77
88
interface ExtendedPanelMenuProps extends Omit<PanelMenuProps, 'model'> {
9-
model: ExtendedMenuItem[];
9+
model: MenuItem[];
1010
}
1111
const componentProps = defineProps<ExtendedPanelMenuProps>();
1212

resources/js/components/primevue/menu/TabMenu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { route } from 'ziggy-js';
55
import Tabs from 'primevue/tabs';
66
import TabList, { type TabListProps } from 'primevue/tablist';
77
import Tab from 'primevue/tab';
8-
import type { ExtendedMenuItem } from '@/types';
8+
import type { MenuItem } from '@/types';
99
import { ptViewMerge } from '@/utils';
1010
1111
interface ExtendedTabListProps extends Omit<TabListProps, 'items'> {
12-
items: ExtendedMenuItem[];
12+
items: MenuItem[];
1313
}
1414
const componentProps = defineProps<ExtendedTabListProps>();
1515

resources/js/components/primevue/menu/TieredMenu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import { useTemplateRef } from 'vue';
33
import TieredMenu, { type TieredMenuProps } from 'primevue/tieredmenu';
44
import { ChevronRight } from 'lucide-vue-next';
5-
import type { ExtendedMenuItem } from '@/types';
5+
import type { MenuItem } from '@/types';
66
import { ptViewMerge } from '@/utils';
77
88
interface ExtendedTieredMenuProps extends Omit<TieredMenuProps, 'model'> {
9-
model: ExtendedMenuItem[];
9+
model: MenuItem[];
1010
}
1111
const componentProps = defineProps<ExtendedTieredMenuProps>();
1212

resources/js/composables/useAppLayout.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ref, computed, onMounted, onUnmounted, watchEffect } from 'vue';
22
import { usePage, useForm } from '@inertiajs/vue3';
33
import { route } from 'ziggy-js';
44
import { LayoutGrid, House, Info, Github, Code, Settings, LogOut, BookOpen } from 'lucide-vue-next';
5-
import { ExtendedMenuItem } from '@/types';
5+
import { MenuItem } from '@/types';
66

77
export function useAppLayout() {
88
const page = usePage();
@@ -15,7 +15,7 @@ export function useAppLayout() {
1515
});
1616

1717
// Menu items
18-
const menuItems = computed<ExtendedMenuItem[]>(() => [
18+
const menuItems = computed<MenuItem[]>(() => [
1919
{
2020
label: 'Home',
2121
lucideIcon: House,
@@ -56,7 +56,7 @@ export function useAppLayout() {
5656
const logout = () => {
5757
logoutForm.post(route('logout'));
5858
};
59-
const userMenuItems: ExtendedMenuItem[] = [
59+
const userMenuItems: MenuItem[] = [
6060
{
6161
label: 'Settings',
6262
route: route('profile.edit'),

resources/js/types/index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { DataTableFilterMetaData } from 'primevue';
22
import type { Page, PageProps, Errors } from '@inertiajs/core';
3-
import type { MenuItem } from 'primevue/menuitem';
3+
import type { MenuItem as PrimeVueMenuItem } from 'primevue/menuitem';
44
import type { LucideIcon } from 'lucide-vue-next';
55

66
export interface User {
@@ -18,9 +18,10 @@ export type PrimeVueDataFilters = {
1818
[key: string]: DataTableFilterMetaData;
1919
};
2020

21-
export interface ExtendedMenuItem extends MenuItem {
21+
export interface MenuItem extends PrimeVueMenuItem {
2222
route?: string;
2323
lucideIcon?: LucideIcon;
24+
active?: boolean;
2425
}
2526

2627
export interface InertiaRouterFetchCallbacks {

0 commit comments

Comments
 (0)