2023-03-01 10:18:34 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Dialog is a container to display content in an overlay window.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/dialog)
|
|
|
|
*
|
|
|
|
* @module dialog
|
|
|
|
*
|
|
|
|
*/
|
2022-12-08 11:04:25 +00:00
|
|
|
import { HTMLAttributes, VNode } from 'vue';
|
2022-09-06 12:03:37 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
|
|
2023-04-24 09:59:20 +00:00
|
|
|
export declare type DialogPassThroughOptionType = DialogPassThroughAttributes | ((options: DialogPassThroughMethodOptions) => DialogPassThroughAttributes) | null | undefined;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface DialogPassThroughMethodOptions {
|
|
|
|
props: DialogProps;
|
|
|
|
state: DialogState;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
|
|
|
* @see {@link DialogProps.pt}
|
|
|
|
*/
|
|
|
|
export interface DialogPassThroughOptions {
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the root's DOM element.
|
|
|
|
*/
|
|
|
|
root?: DialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the header's DOM element.
|
|
|
|
*/
|
|
|
|
header?: DialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the header title's DOM element.
|
|
|
|
*/
|
|
|
|
headerTitle?: DialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the header icons' DOM element.
|
|
|
|
*/
|
|
|
|
headerIcons?: DialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the maximizable button's DOM element.
|
|
|
|
*/
|
|
|
|
maximizableButton?: DialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the maximizable icon's DOM element.
|
|
|
|
*/
|
|
|
|
maximizableIcon?: DialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the close button's DOM element.
|
|
|
|
*/
|
|
|
|
closeButton?: DialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the close icon's DOM element.
|
|
|
|
*/
|
|
|
|
closeIcon?: DialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the content's DOM element.
|
|
|
|
*/
|
|
|
|
content?: DialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the footer's DOM element.
|
|
|
|
*/
|
|
|
|
footer?: DialogPassThroughOptionType;
|
2023-04-26 13:41:27 +00:00
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the mask's DOM element.
|
|
|
|
*/
|
|
|
|
mask?: DialogPassThroughOptionType;
|
2023-04-24 09:59:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough attributes for each DOM elements
|
|
|
|
*/
|
|
|
|
export interface DialogPassThroughAttributes {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines current inline state in Dialog component.
|
|
|
|
*/
|
|
|
|
export interface DialogState {
|
|
|
|
/**
|
|
|
|
* Current visible state of the container as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
containerVisible: boolean;
|
|
|
|
/**
|
|
|
|
* Current maximized state as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
maximized: boolean;
|
|
|
|
}
|
|
|
|
|
2023-03-01 10:18:34 +00:00
|
|
|
/**
|
|
|
|
* Custom breakpoint metadata.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface DialogBreakpoints {
|
|
|
|
/**
|
|
|
|
* Breakpoint for responsive mode.
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
*
|
|
|
|
* <Dialog :breakpoints="{'960px': '75vw', '640px': '100vw'}" ... />
|
|
|
|
*
|
|
|
|
* Result:
|
|
|
|
*
|
|
|
|
* @media screen and (max-width: ${breakpoint[key]}) {
|
|
|
|
* .p-dialog[attributeSelector] {
|
|
|
|
* width: ${breakpoint[value]} !important;
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*/
|
|
|
|
[key: string]: string;
|
|
|
|
}
|
|
|
|
|
2023-03-01 10:18:34 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in Dialog component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface DialogProps {
|
|
|
|
/**
|
|
|
|
* Title content of the dialog.
|
|
|
|
*/
|
|
|
|
header?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Footer content of the dialog.
|
|
|
|
*/
|
|
|
|
footer?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Specifies the visibility of the dialog.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
visible?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Defines if background should be blocked when dialog is displayed.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
modal?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Style of the content section.
|
|
|
|
*/
|
|
|
|
contentStyle?: any;
|
|
|
|
/**
|
|
|
|
* Style class of the content section.
|
|
|
|
*/
|
|
|
|
contentClass?: any;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Uses to pass all properties of the HTMLDivElement to the overlay panel inside the component.
|
|
|
|
*/
|
|
|
|
contentProps?: HTMLAttributes | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* When enabled dialog is displayed in RTL direction.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
rtl?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Adds a close icon to the header to hide the dialog.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
closable?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Specifies if clicking the modal background should hide the dialog.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
dismissableMask?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Specifies if pressing escape key should hide the dialog.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
closeOnEscape?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to show the header or not.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
showHeader?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Base zIndex value to use in layering.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue 0
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
baseZIndex?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to automatically manage layering.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
autoZIndex?: boolean | undefined;
|
|
|
|
/**
|
2023-03-01 10:18:34 +00:00
|
|
|
* Position of the dialog.
|
2023-03-08 10:51:52 +00:00
|
|
|
* @defaultValue center
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
position?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright' | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Whether the dialog can be displayed full screen.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
maximizable?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Object literal to define widths per screen size.
|
|
|
|
*/
|
|
|
|
breakpoints?: DialogBreakpoints;
|
|
|
|
/**
|
|
|
|
* Enables dragging to change the position using header.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
draggable?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Keeps dialog in the viewport when dragging.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
keepInViewPort?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Minimum value for the left coordinate of dialog in dragging.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue 0.
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
minX?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Minimum value for the top coordinate of dialog in dragging.
|
2023-03-01 10:18:34 +00:00
|
|
|
* @defaultValue 0
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
minY?: number | undefined;
|
|
|
|
/**
|
2023-03-01 10:18:34 +00:00
|
|
|
* A valid query selector or an HTMLElement to specify where the dialog gets attached.
|
2023-03-08 10:51:52 +00:00
|
|
|
* @defaultValue body
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
appendTo?: 'body' | 'self' | string | undefined | HTMLElement;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Style of the dynamic dialog.
|
|
|
|
*/
|
|
|
|
style?: any;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Icon to display in the dialog close button.
|
2023-04-18 10:51:10 +00:00
|
|
|
* @deprecated since v3.27.0. Use 'closeicon' slot.
|
2022-12-08 11:04:25 +00:00
|
|
|
*/
|
|
|
|
closeIcon?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Icon to display in the dialog maximize button when dialog is not maximized.
|
2023-04-18 10:51:10 +00:00
|
|
|
* @deprecated since v3.27.0. Use 'maximizeicon' slot.
|
2022-12-08 11:04:25 +00:00
|
|
|
*/
|
|
|
|
maximizeIcon?: string | undefined;
|
|
|
|
/**
|
2023-04-18 10:51:10 +00:00
|
|
|
* Icon to display in the dialog maximize button when dialog is minimized.
|
|
|
|
* @deprecated since v3.27.0. Use 'minimizeicon' slot.
|
2022-12-08 11:04:25 +00:00
|
|
|
*/
|
|
|
|
minimizeIcon?: string | undefined;
|
2023-04-24 09:59:20 +00:00
|
|
|
/**
|
|
|
|
* Uses to pass attributes to DOM elements inside the component.
|
|
|
|
* @type {DialogPassThroughOptions}
|
|
|
|
*/
|
|
|
|
pt?: DialogPassThroughOptions;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 10:18:34 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in Dialog component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface DialogSlots {
|
|
|
|
/**
|
|
|
|
* Default content slot.
|
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
default(): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Custom header template.
|
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
header(): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Custom footer template.
|
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
footer(): VNode[];
|
2023-04-11 21:00:21 +00:00
|
|
|
/**
|
|
|
|
* Custom close icon template.
|
|
|
|
*/
|
|
|
|
closeicon(): VNode[];
|
|
|
|
/**
|
2023-04-18 10:51:10 +00:00
|
|
|
* Custom maximize icon template of dialog.
|
|
|
|
* @param {Object} scope - maximize icon slot's params.
|
2023-04-11 21:00:21 +00:00
|
|
|
*/
|
|
|
|
maximizeicon(scope: {
|
|
|
|
/**
|
|
|
|
* Maximized state as a boolean
|
|
|
|
*/
|
|
|
|
maximized: boolean;
|
|
|
|
}): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 10:18:34 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in Dialog component.
|
|
|
|
*/
|
|
|
|
export interface DialogEmits {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the visible changes.
|
|
|
|
* @param {boolean} value - New value.
|
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
'update:visible'(value: boolean): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when dialog is hidden.
|
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
hide(): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke after dialog is hidden.
|
2022-09-14 11:26:01 +00:00
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
'after-hide'(): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when dialog is shown.
|
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
show(): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Fired when a dialog gets maximized.
|
|
|
|
* @param {event} event - Browser event.
|
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
maximize(event: Event): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Fired when a dialog gets unmaximized.
|
|
|
|
* @param {event} event - Browser event.
|
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
unmaximize(event: Event): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Fired when a dialog drag completes.
|
|
|
|
* @param {event} event - Browser event.
|
|
|
|
*/
|
2023-03-01 10:18:34 +00:00
|
|
|
dragend(event: Event): void;
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 10:18:34 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - Dialog**
|
|
|
|
*
|
|
|
|
* _Dialog is a container to display content in an overlay window._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/dialog/)
|
|
|
|
* --- ---
|
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*/
|
2023-03-01 14:48:23 +00:00
|
|
|
declare class Dialog extends ClassComponent<DialogProps, DialogSlots, DialogEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
Dialog: GlobalComponentConstructor<Dialog>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Dialog;
|