2023-03-01 08:50:24 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* ConfirmDialog uses a Dialog UI with confirmDialog method or <ConfirmDialog> tag.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/confirmdialog)
|
|
|
|
*
|
|
|
|
* @module confirmdialog
|
|
|
|
*
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
import { VNode } from 'vue';
|
2023-05-02 08:01:27 +00:00
|
|
|
import { ButtonPassThroughOptions } from '../button';
|
2022-09-06 12:03:37 +00:00
|
|
|
import { ConfirmationOptions } from '../confirmationoptions';
|
2023-03-01 08:50:24 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-04-25 09:58:01 +00:00
|
|
|
export declare type ConfirmDialogPassThroughOptionType = ConfirmDialogPassThroughAttributes | ((options: ConfirmDialogPassThroughMethodOptions) => ConfirmDialogPassThroughAttributes) | null | undefined;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface ConfirmDialogPassThroughMethodOptions {
|
|
|
|
props: ConfirmDialogProps;
|
|
|
|
state: ConfirmDialogState;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
|
|
|
* @see {@link ConfirmDialogProps.pt}
|
|
|
|
*/
|
|
|
|
export interface ConfirmDialogPassThroughOptions {
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the root's DOM element.
|
|
|
|
*/
|
|
|
|
root?: ConfirmDialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the header's DOM element.
|
|
|
|
*/
|
|
|
|
header?: ConfirmDialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the header title's DOM element.
|
|
|
|
*/
|
|
|
|
headerTitle?: ConfirmDialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the close button's DOM element.
|
2023-05-02 08:01:27 +00:00
|
|
|
* @see {@link ButtonPassThroughOptions}
|
2023-04-25 09:58:01 +00:00
|
|
|
*/
|
2023-05-02 08:01:27 +00:00
|
|
|
closeButton?: ButtonPassThroughOptions;
|
2023-04-25 09:58:01 +00:00
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the content's DOM element.
|
|
|
|
*/
|
|
|
|
content?: ConfirmDialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the footer's DOM element.
|
|
|
|
*/
|
|
|
|
footer?: ConfirmDialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the icon's DOM element.
|
|
|
|
*/
|
|
|
|
icon?: ConfirmDialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the message's DOM element.
|
|
|
|
*/
|
|
|
|
message?: ConfirmDialogPassThroughOptionType;
|
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the reject button's DOM element.
|
2023-05-02 08:01:27 +00:00
|
|
|
* @see {@link ButtonPassThroughOptions}
|
2023-04-25 09:58:01 +00:00
|
|
|
*/
|
2023-05-02 08:01:27 +00:00
|
|
|
rejectButton?: ButtonPassThroughOptions;
|
2023-04-25 09:58:01 +00:00
|
|
|
/**
|
|
|
|
* Uses to pass attributes to the accept button's DOM element.
|
2023-05-02 08:01:27 +00:00
|
|
|
* @see {@link ButtonPassThroughOptions}
|
2023-04-25 09:58:01 +00:00
|
|
|
*/
|
2023-05-02 08:01:27 +00:00
|
|
|
acceptButton?: ButtonPassThroughOptions;
|
2023-04-25 09:58:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough attributes for each DOM elements
|
|
|
|
*/
|
|
|
|
export interface ConfirmDialogPassThroughAttributes {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines current inline state in ConfirmDialog component.
|
|
|
|
*/
|
|
|
|
export interface ConfirmDialogState {
|
|
|
|
/**
|
|
|
|
* Current visible state as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
visible: boolean;
|
|
|
|
/**
|
|
|
|
* Current confirmation message.
|
|
|
|
*/
|
|
|
|
confirmation: any;
|
|
|
|
}
|
|
|
|
|
2023-03-01 08:50:24 +00:00
|
|
|
/**
|
|
|
|
* Breakpoint metadata.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface ConfirmDialogBreakpoints {
|
|
|
|
/**
|
|
|
|
* Breakpoint for responsive mode.
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
*
|
|
|
|
* <ConfirmDialog :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 08:50:24 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in ConfirmDialog component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface ConfirmDialogProps {
|
|
|
|
/**
|
|
|
|
* Optional key to match the key of the confirmation, useful to target a specific confirm dialog instance.
|
|
|
|
*/
|
|
|
|
group?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Object literal to define widths per screen size.
|
|
|
|
* @see ConfirmDialogBreakpoints
|
|
|
|
*/
|
|
|
|
breakpoints?: ConfirmDialogBreakpoints;
|
2023-03-16 14:37:09 +00:00
|
|
|
/**
|
|
|
|
* Enables dragging to change the position using header.
|
|
|
|
* @defaultValue true
|
|
|
|
*/
|
|
|
|
draggable?: boolean | undefined;
|
2023-04-25 09:58:01 +00:00
|
|
|
/**
|
|
|
|
* Uses to pass attributes to DOM elements inside the component.
|
|
|
|
* @type {ConfirmDialogPassThroughOptions}
|
|
|
|
*/
|
|
|
|
pt?: ConfirmDialogPassThroughOptions;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 08:50:24 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in ConfirmDialog component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface ConfirmDialogSlots {
|
|
|
|
/**
|
|
|
|
* Custom message template.
|
|
|
|
* @param {Object} scope - message slot's params.
|
|
|
|
*/
|
2023-04-19 06:49:03 +00:00
|
|
|
message(scope: {
|
|
|
|
/**
|
|
|
|
* Message of the component
|
|
|
|
*/
|
|
|
|
message: ConfirmationOptions;
|
|
|
|
}): VNode[];
|
2023-04-18 11:50:19 +00:00
|
|
|
/**
|
|
|
|
* Custom icon template.
|
|
|
|
*/
|
2023-04-19 06:49:03 +00:00
|
|
|
icon(scope: {
|
|
|
|
/**
|
|
|
|
* Style class of the icon template
|
|
|
|
*/
|
|
|
|
class: any;
|
|
|
|
}): VNode[];
|
2023-04-18 11:50:19 +00:00
|
|
|
/**
|
|
|
|
* Custom icon template.
|
|
|
|
*/
|
|
|
|
accepticon(): VNode[];
|
|
|
|
/**
|
|
|
|
* Custom icon template.
|
|
|
|
*/
|
|
|
|
rejecticon(): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 08:50:24 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in ConfirmDialog component.
|
|
|
|
*/
|
|
|
|
export interface ConfirmDialogEmits {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 08:50:24 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - ConfirmDialog**
|
|
|
|
*
|
|
|
|
* _ConfirmDialog uses a Dialog UI with confirmDialog method or <ConfirmDialog> tag._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/confirmdialog/)
|
|
|
|
* --- ---
|
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*/
|
2023-03-01 14:48:23 +00:00
|
|
|
declare class ConfirmDialog extends ClassComponent<ConfirmDialogProps, ConfirmDialogSlots, ConfirmDialogEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
ConfirmDialog: GlobalComponentConstructor<ConfirmDialog>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ConfirmDialog;
|