2023-02-28 17:39:21 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Panel is a container with the optional content toggle feature.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/panel/)
|
|
|
|
*
|
|
|
|
* @module panel
|
|
|
|
*
|
|
|
|
*/
|
2024-04-15 08:08:42 +00:00
|
|
|
import { TransitionProps, VNode } from 'vue';
|
2023-07-06 11:17:08 +00:00
|
|
|
import { ComponentHooks } from '../basecomponent';
|
2024-04-15 08:08:42 +00:00
|
|
|
import { ButtonPassThroughOptions } from '../button';
|
2023-09-05 08:50:46 +00:00
|
|
|
import { PassThroughOptions } from '../passthrough';
|
2024-04-02 08:24:31 +00:00
|
|
|
import { ClassComponent, DesignToken, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-07-11 22:42:43 +00:00
|
|
|
export declare type PanelPassThroughOptionType = PanelPassThroughAttributes | ((options: PanelPassThroughMethodOptions) => PanelPassThroughAttributes | string) | string | null | undefined;
|
2023-03-23 14:42:14 +00:00
|
|
|
|
2023-08-02 14:07:22 +00:00
|
|
|
export declare type PanelPassThroughTransitionType = TransitionProps | ((options: PanelPassThroughMethodOptions) => TransitionProps) | undefined;
|
|
|
|
|
2023-03-23 14:42:14 +00:00
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface PanelPassThroughMethodOptions {
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines instance.
|
|
|
|
*/
|
2023-07-06 12:01:33 +00:00
|
|
|
instance: any;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties.
|
|
|
|
*/
|
2023-03-23 14:42:14 +00:00
|
|
|
props: PanelProps;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines current inline state.
|
|
|
|
*/
|
2023-03-23 14:42:14 +00:00
|
|
|
state: PanelState;
|
2023-12-10 21:41:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid attributes.
|
|
|
|
*/
|
|
|
|
attrs: any;
|
2023-12-05 11:06:32 +00:00
|
|
|
/**
|
|
|
|
* Defines parent options.
|
|
|
|
*/
|
|
|
|
parent: any;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Defines passthrough(pt) options in global config.
|
|
|
|
*/
|
|
|
|
global: object | undefined;
|
2023-03-23 14:42:14 +00:00
|
|
|
}
|
2023-03-21 15:53:39 +00:00
|
|
|
|
2024-04-15 08:08:42 +00:00
|
|
|
/**
|
|
|
|
* Custom shared passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface PanelSharedPassThroughMethodOptions {
|
|
|
|
/**
|
|
|
|
* Defines valid properties.
|
|
|
|
*/
|
|
|
|
props: PanelProps;
|
|
|
|
/**
|
|
|
|
* Defines current inline state.
|
|
|
|
*/
|
|
|
|
state: PanelState;
|
|
|
|
}
|
|
|
|
|
2023-02-28 17:39:21 +00:00
|
|
|
/**
|
|
|
|
* Custom toggle event.
|
2023-03-06 20:35:39 +00:00
|
|
|
* @see {@link PanelEmits.toggle}
|
2023-02-28 17:39:21 +00:00
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface PanelToggleEvent {
|
|
|
|
/**
|
|
|
|
* Browser event.
|
|
|
|
*/
|
|
|
|
originalEvent: Event;
|
|
|
|
/**
|
|
|
|
* Collapsed state as a boolean
|
|
|
|
*/
|
|
|
|
value: boolean;
|
|
|
|
}
|
|
|
|
|
2023-03-21 15:53:39 +00:00
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
|
|
|
* @see {@link PanelProps.pt}
|
|
|
|
*/
|
|
|
|
export interface PanelPassThroughOptions {
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the root's DOM element.
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
|
|
|
root?: PanelPassThroughOptionType;
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the header's DOM element.
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
|
|
|
header?: PanelPassThroughOptionType;
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the title's DOM element.
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
|
|
|
title?: PanelPassThroughOptionType;
|
|
|
|
/**
|
2024-04-30 14:09:06 +00:00
|
|
|
* Used to pass attributes to the header actions' DOM element.
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
2024-04-30 14:09:06 +00:00
|
|
|
headerActions?: PanelPassThroughOptionType;
|
2023-03-21 15:53:39 +00:00
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the toggle button button's DOM element.
|
2024-04-15 08:08:42 +00:00
|
|
|
* @see {@link ButtonPassThroughOptions}
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
2024-05-06 15:23:01 +00:00
|
|
|
pcToggleButton?: ButtonPassThroughOptions<PanelSharedPassThroughMethodOptions>;
|
2023-03-21 15:53:39 +00:00
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the content container's DOM element.
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
2024-04-30 14:09:06 +00:00
|
|
|
contentContainer?: PanelPassThroughOptionType;
|
2023-03-21 15:53:39 +00:00
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the content's DOM element.
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
|
|
|
content?: PanelPassThroughOptionType;
|
2023-03-31 13:42:19 +00:00
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the footer's DOM element.
|
2023-03-31 13:42:19 +00:00
|
|
|
*/
|
|
|
|
footer?: PanelPassThroughOptionType;
|
2023-08-02 14:07:22 +00:00
|
|
|
/**
|
|
|
|
* Used to control Vue Transition API.
|
|
|
|
*/
|
|
|
|
transition?: PanelPassThroughTransitionType;
|
2023-07-06 11:09:01 +00:00
|
|
|
/**
|
2023-11-07 06:16:39 +00:00
|
|
|
* Used to manage all lifecycle hooks.
|
2023-07-06 11:09:01 +00:00
|
|
|
* @see {@link BaseComponent.ComponentHooks}
|
|
|
|
*/
|
|
|
|
hooks?: ComponentHooks;
|
2023-03-21 15:53:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough attributes for each DOM elements
|
|
|
|
*/
|
|
|
|
export interface PanelPassThroughAttributes {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-03-21 15:54:36 +00:00
|
|
|
* Defines current inline state in Panel component.
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
|
|
|
export interface PanelState {
|
|
|
|
/**
|
2023-03-24 15:06:26 +00:00
|
|
|
* Current collapsed state as a boolean.
|
|
|
|
* @defaultValue false
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
|
|
|
d_collapsed: boolean;
|
|
|
|
}
|
|
|
|
|
2023-02-28 17:39:21 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in Panel component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface PanelProps {
|
|
|
|
/**
|
|
|
|
* Header text of the panel.
|
|
|
|
*/
|
|
|
|
header?: string;
|
|
|
|
/**
|
|
|
|
* Defines if content of panel can be expanded and collapsed.
|
2023-03-10 14:00:58 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
toggleable?: boolean;
|
|
|
|
/**
|
|
|
|
* Defines the initial state of panel content.
|
2023-03-10 14:00:58 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
collapsed?: boolean;
|
2022-09-14 11:26:01 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass the custom value to read for the button inside the component.
|
2024-04-15 08:08:42 +00:00
|
|
|
* @defaultValue { severity: 'secondary', text: true, rounded: true }
|
2022-09-14 11:26:01 +00:00
|
|
|
*/
|
2024-04-15 08:08:42 +00:00
|
|
|
toggleButtonProps?: object | undefined;
|
2024-04-02 08:24:31 +00:00
|
|
|
/**
|
|
|
|
* It generates scoped CSS variables using design tokens for the component.
|
|
|
|
*/
|
|
|
|
dt?: DesignToken<any>;
|
2023-03-21 15:53:39 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to DOM elements inside the component.
|
2023-03-21 15:53:39 +00:00
|
|
|
* @type {PanelPassThroughOptions}
|
|
|
|
*/
|
2023-09-05 11:28:04 +00:00
|
|
|
pt?: PassThrough<PanelPassThroughOptions>;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Used to configure passthrough(pt) options of the component.
|
|
|
|
* @type {PassThroughOptions}
|
|
|
|
*/
|
|
|
|
ptOptions?: PassThroughOptions;
|
2023-05-16 10:43:21 +00:00
|
|
|
/**
|
|
|
|
* When enabled, it removes component related styles in the core.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
unstyled?: boolean;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-02-28 17:39:21 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in Panel slots.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface PanelSlots {
|
|
|
|
/**
|
|
|
|
* Custom content template.
|
|
|
|
*/
|
2023-02-28 17:39:21 +00:00
|
|
|
default(): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Custom header template.
|
2023-08-17 07:16:25 +00:00
|
|
|
* @param {Object} scope - header slot's params.
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-04-26 11:18:19 +00:00
|
|
|
header(scope: {
|
|
|
|
/**
|
|
|
|
* Current id state as a string
|
|
|
|
*/
|
2023-06-26 15:04:31 +00:00
|
|
|
id: string;
|
2023-04-26 11:18:19 +00:00
|
|
|
/**
|
|
|
|
* Style class of the icon
|
|
|
|
*/
|
|
|
|
class: string;
|
|
|
|
}): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Custom icons template.
|
|
|
|
*/
|
2023-02-28 17:39:21 +00:00
|
|
|
icons(): VNode[];
|
2023-03-21 15:53:39 +00:00
|
|
|
/**
|
2024-04-30 14:09:06 +00:00
|
|
|
* @deprecated since v4.0. Use the 'toggleicon' slot instead.
|
2023-04-05 08:07:25 +00:00
|
|
|
* Custom toggler icon template of panel.
|
|
|
|
* @param {Object} scope - toggler icon slot's params.
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
2023-04-05 08:07:25 +00:00
|
|
|
togglericon(scope: {
|
2023-03-21 15:53:39 +00:00
|
|
|
/**
|
|
|
|
* Collapsed state as a boolean
|
2024-04-30 14:09:06 +00:00
|
|
|
*/
|
|
|
|
collapsed: boolean;
|
|
|
|
}): VNode[];
|
|
|
|
/**
|
|
|
|
* Custom toggler icon template of panel.
|
|
|
|
* @param {Object} scope - toggler icon slot's params.
|
|
|
|
*/
|
|
|
|
toggleicon(scope: {
|
|
|
|
/**
|
|
|
|
* Collapsed state as a boolean
|
2023-03-21 15:53:39 +00:00
|
|
|
*/
|
|
|
|
collapsed: boolean;
|
|
|
|
}): VNode[];
|
2023-03-31 13:43:48 +00:00
|
|
|
/**
|
2023-03-31 13:42:19 +00:00
|
|
|
* Custom footer template.
|
|
|
|
*/
|
2023-03-31 13:43:48 +00:00
|
|
|
footer(): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-02-28 17:39:21 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in Panel component.
|
|
|
|
*/
|
|
|
|
export interface PanelEmits {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the collapsed changes.
|
|
|
|
* @param {boolean} value - New value.
|
|
|
|
*/
|
2023-03-17 13:42:11 +00:00
|
|
|
'update:collapsed'(value: boolean): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when a tab toggle.
|
|
|
|
* @param {PanelToggleEvent} event - Custom toggle event.
|
|
|
|
*/
|
2023-03-17 13:42:11 +00:00
|
|
|
toggle(event: PanelToggleEvent): void;
|
2023-02-28 17:39:21 +00:00
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-02-28 17:39:21 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - Panel**
|
|
|
|
*
|
|
|
|
* _Panel is a container with the optional content toggle feature._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/panel/)
|
|
|
|
* --- ---
|
2023-03-03 10:55:20 +00:00
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
2023-02-28 17:39:21 +00:00
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*
|
|
|
|
*/
|
2023-03-01 12:30:54 +00:00
|
|
|
declare class Panel extends ClassComponent<PanelProps, PanelSlots, PanelEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-03-14 22:58:11 +00:00
|
|
|
declare module 'vue' {
|
|
|
|
export interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
Panel: GlobalComponentConstructor<Panel>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Panel;
|