primevue-mirror/components/panel/Panel.d.ts

80 lines
1.7 KiB
TypeScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
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;
2022-09-14 11:26:01 +00:00
/**
* Uses to pass the custom value to read for the button inside the component.
*/
toggleButtonProps?: string | undefined;
2022-09-06 12:03:37 +00:00
}
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.
*/
2022-09-14 11:26:01 +00:00
toggle: (event: PanelToggleEvent) => void;
};
2022-09-06 12:03:37 +00:00
2022-09-14 11:26:01 +00:00
declare class Panel extends ClassComponent<PanelProps, PanelSlots, PanelEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Panel: GlobalComponentConstructor<Panel>;
2022-09-06 12:03:37 +00:00
}
}
/**
*
* Panel is a container with the optional content toggle feature.
*
* Demos:
*
2022-09-14 11:26:01 +00:00
* - [Panel](https://www.primefaces.org/primevue/panel)
2022-09-06 12:03:37 +00:00
*
*/
export default Panel;