🏷️ Menu bar component interface file added
This commit is contained in:
parent
0ebc29b3df
commit
e46ba8127d
91
src/components/menu/IVMenuBar.type.ts
Normal file
91
src/components/menu/IVMenuBar.type.ts
Normal file
|
@ -0,0 +1,91 @@
|
|||
import type { HTMLAttributes } from "vue"
|
||||
import type { RouteLocationRaw } from "vue-router"
|
||||
import type { MenuItem } from "primevue/menuitem"
|
||||
/**
|
||||
* Describes a link or button item in a menu bar.
|
||||
*/
|
||||
export interface IVMenuBarLinks {
|
||||
/** Whether the item should be rendered as a button */
|
||||
button?: boolean;
|
||||
|
||||
/** Name of the icon to display on the left */
|
||||
icon?: string;
|
||||
|
||||
/** Whether the icon appears on the right side */
|
||||
iconRight?: boolean;
|
||||
|
||||
/** Text label for the item */
|
||||
label?: string;
|
||||
|
||||
/** Target URL if rendered as an anchor (<a>) */
|
||||
target?: string;
|
||||
|
||||
/** Callback executed when the item is clicked */
|
||||
onClick?: ($event: MouseEvent) => void;
|
||||
|
||||
/** Navigation route */
|
||||
to?: RouteLocationRaw;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extends PrimeVue's MenuItem with optional routing capabilities.
|
||||
* Excludes 'style' and 'class' to avoid conflicts with Vue attributes.
|
||||
*/
|
||||
export interface IVMenuItem
|
||||
extends Partial<Omit<MenuItem, 'style' | 'class'>>,
|
||||
Partial<Pick<IVMenuBarLinks, 'to'>> {}
|
||||
|
||||
/**
|
||||
* Interface for configuring a customizable menu bar component.
|
||||
*/
|
||||
export default interface IVMenuBar {
|
||||
/** HTML id for the searchbar input */
|
||||
searchbarId?: string;
|
||||
|
||||
/** Title of the service or application */
|
||||
serviceTitle?: string;
|
||||
|
||||
/** Description of the service */
|
||||
serviceDescription?: string;
|
||||
|
||||
/** Text displayed beside the logo (can be multiline) */
|
||||
logoText?: string | string[];
|
||||
|
||||
/** Whether to show the logo */
|
||||
logo?: boolean;
|
||||
|
||||
/** Bound model value for the search input */
|
||||
modelValue?: string;
|
||||
|
||||
/** Placeholder text for the search input */
|
||||
placeholder?: string;
|
||||
|
||||
/** List of quick link items with additional HTML attributes */
|
||||
quickLinks?: (IVMenuItem & HTMLAttributes)[];
|
||||
|
||||
/** Label for the search input (accessibility) */
|
||||
searchLabel?: string;
|
||||
|
||||
/** ARIA label for the quick links section */
|
||||
quickLinksAriaLabel?: string;
|
||||
|
||||
/** Whether to display the search bar */
|
||||
showSearch?: boolean;
|
||||
|
||||
/** Label describing the search bar visibility */
|
||||
showSearchLabel?: string;
|
||||
|
||||
/** Label for the main menu toggle button */
|
||||
menuLabel?: string;
|
||||
|
||||
/** Label used in modal menus */
|
||||
menuModalLabel?: string;
|
||||
|
||||
/** Label for closing the modal menu */
|
||||
closeMenuModalLabel?: string;
|
||||
|
||||
/** Responsive breakpoints (e.g. Tailwind-style classes) */
|
||||
breakpoints?: string;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user