2022-09-06 12:03:37 +00:00
|
|
|
import { VNode } from 'vue';
|
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
|
|
|
|
|
type OverlayPanelAppendToType = 'body' | 'self' | string | undefined | HTMLElement;
|
|
|
|
|
|
|
|
export interface OverlayPanelBreakpoints {
|
|
|
|
/**
|
|
|
|
* Breakpoint for responsive mode.
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
*
|
|
|
|
* <OverlayPanel :breakpoints="{'960px': '75vw', '640px': '100vw'}" ... />
|
|
|
|
*
|
|
|
|
* Result:
|
|
|
|
*
|
|
|
|
* @media screen and (max-width: ${breakpoint[key]}) {
|
|
|
|
* .p-overlaypanel[attributeSelector] {
|
|
|
|
* width: ${breakpoint[value]} !important;
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*/
|
|
|
|
[key: string]: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface OverlayPanelProps {
|
|
|
|
/**
|
|
|
|
* Enables to hide the overlay when outside is clicked.
|
|
|
|
* Default value is true.
|
|
|
|
*/
|
|
|
|
dismissable?: boolean;
|
|
|
|
/**
|
|
|
|
* When enabled, displays a close icon at top right corner.
|
|
|
|
*/
|
|
|
|
showCloseIcon?: boolean;
|
|
|
|
/**
|
|
|
|
* A valid query selector or an HTMLElement to specify where the overlay gets attached.
|
|
|
|
* @see OverlayPanelAppendToType
|
|
|
|
* Default value is 'body'.
|
|
|
|
*/
|
|
|
|
appendTo?: OverlayPanelAppendToType;
|
|
|
|
/**
|
|
|
|
* Base zIndex value to use in layering.
|
|
|
|
* Default value is 0.
|
|
|
|
*/
|
|
|
|
baseZIndex?: number;
|
|
|
|
/**
|
|
|
|
* Whether to automatically manage layering.
|
|
|
|
* Default value is true.
|
|
|
|
*/
|
|
|
|
autoZIndex?: boolean;
|
|
|
|
/**
|
|
|
|
* Object literal to define widths per screen size.
|
|
|
|
* @see OverlayPanelBreakpoints
|
|
|
|
*/
|
|
|
|
breakpoints?: OverlayPanelBreakpoints;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface OverlayPanelSlots {
|
|
|
|
/**
|
|
|
|
* Custom content template.
|
|
|
|
*/
|
|
|
|
default: () => VNode[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare type OverlayPanelEmits = {
|
|
|
|
/**
|
|
|
|
* Callback to invoke when the overlay is shown.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
show: () => void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when the overlay is hidden.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
hide: () => void;
|
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare class OverlayPanel extends ClassComponent<OverlayPanelProps, OverlayPanelSlots, OverlayPanelEmits> {
|
|
|
|
/**
|
|
|
|
* Toggles the visibility of the overlay.
|
|
|
|
* @param {Event} event - Browser event.
|
2022-12-08 11:04:25 +00:00
|
|
|
* @param {*} [target] - Optional target if event.currentTarget should not be used.
|
2022-09-06 12:03:37 +00:00
|
|
|
*
|
|
|
|
* @memberof OverlayPanel
|
|
|
|
*/
|
2022-12-08 11:04:25 +00:00
|
|
|
toggle: (event: Event, target?: any) => void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Shows the overlay.
|
|
|
|
* @param {Event} event - Browser event.
|
|
|
|
* @param {*} [target] - Optional target if event.currentTarget should not be used.
|
|
|
|
*
|
|
|
|
* @memberof OverlayPanel
|
|
|
|
*/
|
|
|
|
show: (event: Event, target?: any) => void;
|
|
|
|
/**
|
|
|
|
* Hides the overlay.
|
|
|
|
*
|
|
|
|
* @memberof OverlayPanel
|
|
|
|
*/
|
|
|
|
hide: () => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
OverlayPanel: GlobalComponentConstructor<OverlayPanel>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* OverlayPanel is a container component positioned as connected to its target.
|
|
|
|
*
|
|
|
|
* Demos:
|
|
|
|
*
|
2022-09-14 11:26:01 +00:00
|
|
|
* - [OverlayPanel](https://www.primefaces.org/primevue/overlaypanel)
|
2022-09-06 12:03:37 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
export default OverlayPanel;
|