From 1f5e16ed715d404acf1e6a1bf212e8b83a4c2ac7 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 1 Dec 2021 17:00:19 +0300 Subject: [PATCH] Fixed #1836 - For Panel --- src/components/panel/Panel.d.ts | 73 +++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 9 deletions(-) diff --git a/src/components/panel/Panel.d.ts b/src/components/panel/Panel.d.ts index 1f3945695..34120c6dd 100755 --- a/src/components/panel/Panel.d.ts +++ b/src/components/panel/Panel.d.ts @@ -1,20 +1,75 @@ import { VNode } from 'vue'; +import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; -interface PanelProps { +export interface PanelToggleEvent { + /** + * Browser event. + */ + originalEvent: Event; + /** + * Collapsed state as a boolean + */ + value: boolean; +} + +export interface PanelProps { + /** + * Header text of the panel. + */ header?: string; + /** + * Defines if content of panel can be expanded and collapsed. + */ toggleable?: boolean; + /** + * Defines the initial state of panel content. + */ collapsed?: boolean; } -declare class Panel { - $props: PanelProps; - $emit(eventName: 'update:collapsed', value: boolean): this; - $emit(eventName: 'toggle', e: { originalEvent: Event, value: boolean; }): this; - $slots: { - '': VNode[]; - header: VNode[]; - icons: VNode[]; +export interface PanelSlots { + /** + * Custom content template. + */ + default: () => VNode[]; + /** + * Custom header template. + */ + header: () => VNode[]; + /** + * Custom icons template. + */ + icons: () => VNode[]; +} + +export declare type PanelEmits = { + /** + * Emitted when the collapsed changes. + * @param {boolean} value - New value. + */ + 'update:collapsed': (value: boolean) => void; + /** + * Callback to invoke when a tab toggle. + * @param {PanelToggleEvent} event - Custom toggle event. + */ + 'toggle': (event: PanelToggleEvent) => void; +} + +declare class Panel extends ClassComponent { } + +declare module '@vue/runtime-core' { + interface GlobalComponents { + Panel: GlobalComponentConstructor } } +/** + * + * Panel is a container with the optional content toggle feature. + * + * Demos: + * + * - [Panel](https://www.primefaces.org/primevue/showcase/#/panel) + * + */ export default Panel;