Fixed #1836 - For Panel
parent
3f4a7f168a
commit
1f5e16ed71
|
@ -1,20 +1,75 @@
|
||||||
import { VNode } from 'vue';
|
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;
|
header?: string;
|
||||||
|
/**
|
||||||
|
* Defines if content of panel can be expanded and collapsed.
|
||||||
|
*/
|
||||||
toggleable?: boolean;
|
toggleable?: boolean;
|
||||||
|
/**
|
||||||
|
* Defines the initial state of panel content.
|
||||||
|
*/
|
||||||
collapsed?: boolean;
|
collapsed?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare class Panel {
|
export interface PanelSlots {
|
||||||
$props: PanelProps;
|
/**
|
||||||
$emit(eventName: 'update:collapsed', value: boolean): this;
|
* Custom content template.
|
||||||
$emit(eventName: 'toggle', e: { originalEvent: Event, value: boolean; }): this;
|
*/
|
||||||
$slots: {
|
default: () => VNode[];
|
||||||
'': VNode[];
|
/**
|
||||||
header: VNode[];
|
* Custom header template.
|
||||||
icons: VNode[];
|
*/
|
||||||
|
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;
|
export default Panel;
|
||||||
|
|
Loading…
Reference in New Issue