Fixed #1836 - For Panel
parent
3f4a7f168a
commit
1f5e16ed71
|
@ -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<PanelProps, PanelSlots, PanelEmits> { }
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
interface GlobalComponents {
|
||||
Panel: GlobalComponentConstructor<Panel>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Panel is a container with the optional content toggle feature.
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Panel](https://www.primefaces.org/primevue/showcase/#/panel)
|
||||
*
|
||||
*/
|
||||
export default Panel;
|
||||
|
|
Loading…
Reference in New Issue