diff --git a/api-generator/components/overlaypanel.js b/api-generator/components/overlaypanel.js index 3cdf363223..f2861c06b3 100644 --- a/api-generator/components/overlaypanel.js +++ b/api-generator/components/overlaypanel.js @@ -46,6 +46,12 @@ const OverlayPanelProps = [ type: 'string', default: 'undefined', description: 'Display a custom close icon for the message.' + }, + { + name: 'pt', + type: 'any', + default: 'null', + description: 'Uses to pass attributes to DOM elements inside the component.' } ]; diff --git a/components/lib/overlaypanel/OverlayPanel.d.ts b/components/lib/overlaypanel/OverlayPanel.d.ts index 247bdf7751..4a1a4a65a7 100755 --- a/components/lib/overlaypanel/OverlayPanel.d.ts +++ b/components/lib/overlaypanel/OverlayPanel.d.ts @@ -10,6 +10,57 @@ import { VNode } from 'vue'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +export declare type OverlayPanelPassThroughOptionType = OverlayPanelPassThroughAttributes | ((options: OverlayPanelPassThroughMethodOptions) => OverlayPanelPassThroughAttributes) | null | undefined; + +/** + * Custom passthrough(pt) option method. + */ +export interface OverlayPanelPassThroughMethodOptions { + props: OverlayPanelProps; + state: OverlayPanelState; +} + +/** + * Custom passthrough(pt) options. + * @see {@link OverlayPanelProps.pt} + */ +export interface OverlayPanelPassThroughOptions { + /** + * Uses to pass attributes to the root's DOM element. + */ + root?: OverlayPanelPassThroughOptionType; + /** + * Uses to pass attributes to the content's DOM element. + */ + content?: OverlayPanelPassThroughOptionType; + /** + * Uses to pass attributes to the close button's DOM element. + */ + closeButton?: OverlayPanelPassThroughOptionType; + /** + * Uses to pass attributes to the close icon's DOM element. + */ + closeIcon?: OverlayPanelPassThroughOptionType; +} + +/** + * Custom passthrough attributes for each DOM elements + */ +export interface OverlayPanelPassThroughAttributes { + [key: string]: any; +} + +/** + * Defines current inline state in OverlayPanel component. + */ +export interface OverlayPanelState { + /** + * Current visible state as a boolean. + * @defaultValue false + */ + visible: boolean; +} + /** * OverlayPanel breakpoint metadata. */ @@ -70,6 +121,11 @@ export interface OverlayPanelProps { * @deprecated since v3.27.0. Use 'closeicon' slot. */ closeIcon?: string | undefined; + /** + * Uses to pass attributes to DOM elements inside the component. + * @type {OverlayPanelPassThroughOptions} + */ + pt?: OverlayPanelPassThroughOptions; } /** diff --git a/components/lib/overlaypanel/OverlayPanel.vue b/components/lib/overlaypanel/OverlayPanel.vue index 12cd78cf71..7bc3cf126a 100755 --- a/components/lib/overlaypanel/OverlayPanel.vue +++ b/components/lib/overlaypanel/OverlayPanel.vue @@ -1,13 +1,13 @@