UNPKG

@extclp/vexip-ui

Version:

A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good

1 lines 2.69 kB
{"version":3,"file":"symbol.mjs","sources":["../../../components/menu/symbol.ts"],"sourcesContent":["import type { ComponentPublicInstance, InjectionKey } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport type { IconMinorProps } from '@/components/icon'\n\nexport type MenuMarkerType = 'top' | 'right' | 'bottom' | 'left' | 'none'\nexport type MenuGroupType = 'collapse' | 'dropdown'\n\nexport interface MenuOptions {\n label: string,\n icon?: Record<string, any> | (() => any),\n iconProps?: IconMinorProps,\n name?: string | (() => string),\n disabled?: boolean,\n group?: boolean,\n meta?: Record<string, any>,\n route?: RouteLocationRaw,\n children?: MenuOptions[]\n}\n\nexport interface MenuItemState {\n el: Readonly<HTMLElement | null | undefined>,\n label: Readonly<string>,\n indent: Readonly<number>,\n groupExpanded: boolean,\n showGroup: Readonly<boolean>,\n isUsePopper: Readonly<boolean>,\n parentState: MenuItemState | null,\n transfer: Readonly<boolean | string>,\n cachedExpanded: boolean,\n updateSonSelected(selected: boolean, upstream?: boolean): void,\n toggleGroupExpanded(expanded: boolean, upward?: boolean): void,\n handleMouseEnter(): void,\n handleMouseLeave(): void\n}\n\nexport interface MenuGroupState {\n indent: number\n}\n\nexport interface MenuState {\n horizontal: boolean,\n accordion: boolean,\n groupType: MenuGroupType,\n tooltipReverse: boolean,\n currentActive: string,\n isReduced: boolean,\n transfer: boolean | string,\n trigger: 'hover' | 'click',\n markerType: MenuMarkerType,\n handleSelect(label: string, meta: Record<string, any>, route?: RouteLocationRaw): void,\n handleExpand(label: string, expanded: boolean, meta: Record<string, any>): void,\n increaseItem(state: MenuItemState): void,\n decreaseItem(state: MenuItemState): void,\n doForEachItem(cb: (item: MenuItemState) => void): void\n}\n\nexport interface MenuExposed extends ComponentPublicInstance {\n expandItemByLabel: (label: string) => void\n}\n\nexport interface MenuItemExposed extends ComponentPublicInstance {\n groupExpanded: boolean,\n isGroup: boolean,\n showGroup: boolean,\n isUsePopper: boolean,\n handleSelect: () => void,\n handleMouseEnter: () => void,\n handleMouseLeave: () => void\n}\n\nexport const MENU_ITEM_STATE = '__VXP_MENU_ITEM_STATE' as unknown as InjectionKey<MenuItemState>\nexport const MENU_GROUP_STATE = '__VXP_MENU_GROUP_STATE' as unknown as InjectionKey<MenuGroupState>\nexport const MENU_STATE = '__VXP_MENU_STATE' as unknown as InjectionKey<MenuState>\n"],"names":["MENU_ITEM_STATE","MENU_GROUP_STATE","MENU_STATE"],"mappings":"AAsEO,MAAMA,IAAkB,yBAClBC,IAAmB,0BACnBC,IAAa;"}