@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 3.52 kB
Source Map (JSON)
{"version":3,"file":"symbol.mjs","sources":["../../../components/menu/symbol.ts"],"sourcesContent":["import type { ComponentPublicInstance, InjectionKey, VNode } from 'vue'\r\nimport type { RouteLocationRaw } from 'vue-router'\r\nimport type { IconMinorProps } from '@/components/icon'\r\n\r\nexport type MenuMarkerType = 'top' | 'right' | 'bottom' | 'left' | 'none'\r\nexport type MenuGroupType = 'collapse' | 'dropdown'\r\n\r\nexport interface MenuOptions {\r\n label: string,\r\n icon?: Record<string, any> | (() => any),\r\n iconProps?: IconMinorProps,\r\n name?: string | (() => string),\r\n disabled?: boolean,\r\n group?: boolean,\r\n meta?: Record<string, any>,\r\n route?: RouteLocationRaw,\r\n children?: MenuOptions[],\r\n}\r\n\r\nexport interface MenuItemState {\r\n el: Readonly<HTMLElement | null | undefined>,\r\n label: Readonly<string>,\r\n indent: Readonly<number>,\r\n groupExpanded: boolean,\r\n showGroup: Readonly<boolean>,\r\n isUsePopper: Readonly<boolean>,\r\n parentState: MenuItemState | null,\r\n transfer: Readonly<boolean | string>,\r\n cachedExpanded: boolean,\r\n updateSonSelected(selected: boolean, upstream?: boolean): void,\r\n toggleGroupExpanded(expanded: boolean, upward?: boolean): void,\r\n handleMouseEnter(): void,\r\n handleMouseLeave(): void,\r\n}\r\n\r\nexport interface MenuGroupState {\r\n indent: number,\r\n}\r\n\r\nexport interface MenuState {\r\n horizontal: boolean,\r\n accordion: boolean,\r\n groupType: MenuGroupType,\r\n tooltipReverse: boolean,\r\n currentActive: string,\r\n isReduced: boolean,\r\n transfer: boolean | string,\r\n trigger: 'hover' | 'click',\r\n markerType: MenuMarkerType,\r\n arrow: Record<string, any> | (() => any),\r\n handleSelect(label: string, meta: Record<string, any>, route?: RouteLocationRaw): void,\r\n handleExpand(label: string, expanded: boolean, meta: Record<string, any>): void,\r\n increaseItem(state: MenuItemState): void,\r\n decreaseItem(state: MenuItemState): void,\r\n doForEachItem(cb: (item: MenuItemState) => void): void,\r\n renderItemArrow: (params: MenuArrowSlotParams, renderDefault: () => VNode) => void,\r\n}\r\n\r\nexport interface MenuArrowSlotParams {\r\n groupExpanded: boolean,\r\n sonSelected: boolean,\r\n}\r\n\r\nexport interface MenuSlots {\r\n /**\r\n * @internal\r\n */\r\n default?: () => any,\r\n arrow?: (params: MenuArrowSlotParams) => any,\r\n}\r\n\r\nexport interface MenuItemSlots {\r\n /**\r\n * @internal\r\n */\r\n default?: () => any,\r\n /**\r\n * @internal\r\n */\r\n icon?: () => any,\r\n /**\r\n * @internal\r\n */\r\n group?: () => any,\r\n arrow?: (params: MenuArrowSlotParams) => any,\r\n}\r\n\r\nexport interface MenuExposed extends ComponentPublicInstance {\r\n expandItemByLabel: (label: string) => void,\r\n}\r\n\r\nexport interface MenuItemExposed extends ComponentPublicInstance {\r\n groupExpanded: boolean,\r\n isGroup: boolean,\r\n showGroup: boolean,\r\n isUsePopper: boolean,\r\n handleSelect: () => void,\r\n handleMouseEnter: () => void,\r\n handleMouseLeave: () => void,\r\n}\r\n\r\nexport const MENU_ITEM_STATE = '__VXP_MENU_ITEM_STATE' as unknown as InjectionKey<MenuItemState>\r\nexport const MENU_GROUP_STATE = '__VXP_MENU_GROUP_STATE' as unknown as InjectionKey<MenuGroupState>\r\nexport const MENU_STATE = '__VXP_MENU_STATE' as unknown as InjectionKey<MenuState>\r\n"],"names":["MENU_ITEM_STATE","MENU_GROUP_STATE","MENU_STATE"],"mappings":"AAqGO,MAAMA,IAAkB,yBAClBC,IAAmB,0BACnBC,IAAa;"}