From d75cda39c677a3fee23cd3f1fe74ae4ee5fdc543 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 1 Dec 2021 17:01:11 +0300 Subject: [PATCH] Fixed #1836 - For PanelMenu --- src/components/panelmenu/PanelMenu.d.ts | 70 +++++++++++++++++++++---- 1 file changed, 59 insertions(+), 11 deletions(-) diff --git a/src/components/panelmenu/PanelMenu.d.ts b/src/components/panelmenu/PanelMenu.d.ts index f8f6ed3cc..3f8be111f 100755 --- a/src/components/panelmenu/PanelMenu.d.ts +++ b/src/components/panelmenu/PanelMenu.d.ts @@ -1,19 +1,67 @@ -interface PanelMenuProps { - model?: any[]; - expandedKeys?: any; - exact?: boolean; +import { VNode } from 'vue'; +import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +import { MenuItem } from '../menuitem'; + +export interface PanelMenuExpandedKeys { + [key: string]: any; } -interface PanelMenuItemSlotInterface { - item: any; +export interface PanelMenuProps { + /** + * An array of menuitems. + */ + model?: MenuItem[] | undefined; + /** + * A map of keys to represent the expansion state in controlled mode. + * @see PanelMenuExpandedKeys + */ + expandedKeys?: PanelMenuExpandedKeys; + /** + * Whether to apply 'router-link-active-exact' class if route exactly matches the item path. + */ + exact?: boolean | undefined; } -declare class PanelMenu { - $props: PanelMenuProps; - $emit(eventName: 'update:expandedKeys', value: any): this; - $slots: { - item: PanelMenuItemSlotInterface; +export interface PanelMenuSlots { + /** + * Custom content for each item. + * @param {Object} scope - item slot's params. + */ + item: (scope: { + /** + * Menuitem instance + */ + item: MenuItem; + }) => VNode[]; +} + +export declare type PanelMenuEmits = { + /** + * Emitted when the expandedKeys changes. + * @param {*} value - New value. + */ + 'update:expandedKeys': (value: any) => void; +} + +declare class PanelMenu extends ClassComponent { } + +declare module '@vue/runtime-core' { + interface GlobalComponents { + PanelMenu: GlobalComponentConstructor } } +/** + * + * PanelMenu is a hybrid of Accordion and Tree components. + * + * Helper API: + * + * - [MenuItem](https://www.primefaces.org/primevue/showcase/#/menumodel) + * + * Demos: + * + * - [PanelMenu](https://www.primefaces.org/primevue/showcase/#/panelmenu) + * + */ export default PanelMenu;