primevue-mirror/components/dialog/Dialog.d.ts

240 lines
5.9 KiB
TypeScript
Raw Normal View History

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-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.
* @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.
* @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-03-01 10:18:34 +00:00
* @defaultValue pi pi-times
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-03-01 10:18:34 +00:00
* @defaultValue pi pi-window-maximize
2022-12-08 11:04:25 +00:00
*/
maximizeIcon?: string | undefined;
/**
* Icon to display in the dialog maximize button when dialog is maximized.
2023-03-01 10:18:34 +00:00
* @defaultValue pi pi-window-minimize
2022-12-08 11:04:25 +00:00
*/
minimizeIcon?: string | undefined;
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[];
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;