primevue-mirror/components/lib/confirmdialog/ConfirmDialog.d.ts

222 lines
5.8 KiB
TypeScript
Raw Normal View History

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-07-06 11:17:08 +00:00
import { ComponentHooks } from '../basecomponent';
2023-05-02 08:01:27 +00:00
import { ButtonPassThroughOptions } from '../button';
2022-09-06 12:03:37 +00:00
import { ConfirmationOptions } from '../confirmationoptions';
import { ClassComponent, GlobalComponentConstructor, PTOptions } from '../ts-helpers';
2022-09-06 12:03:37 +00:00
export declare type ConfirmDialogPassThroughOptionType = ConfirmDialogPassThroughAttributes | ((options: ConfirmDialogPassThroughMethodOptions) => ConfirmDialogPassThroughAttributes | string) | string | null | undefined;
2023-04-25 09:58:01 +00:00
/**
* Custom passthrough(pt) option method.
*/
export interface ConfirmDialogPassThroughMethodOptions {
2023-07-06 12:01:33 +00:00
instance: any;
2023-04-25 09:58:01 +00:00
props: ConfirmDialogProps;
state: ConfirmDialogState;
}
/**
* Custom passthrough(pt) options.
* @see {@link ConfirmDialogProps.pt}
*/
export interface ConfirmDialogPassThroughOptions {
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the root's DOM element.
2023-04-25 09:58:01 +00:00
*/
root?: ConfirmDialogPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the header's DOM element.
2023-04-25 09:58:01 +00:00
*/
header?: ConfirmDialogPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the header title's DOM element.
2023-04-25 09:58:01 +00:00
*/
headerTitle?: ConfirmDialogPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the header icons' DOM element.
2023-04-25 09:58:01 +00:00
*/
2023-05-03 14:16:11 +00:00
headerIcons?: ConfirmDialogPassThroughOptionType;
2023-04-25 09:58:01 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the close button's component.
2023-04-25 09:58:01 +00:00
*/
2023-05-03 14:16:11 +00:00
closeButton?: ConfirmDialogPassThroughOptionType;
2023-04-25 09:58:01 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the close button icon's component.
2023-04-25 09:58:01 +00:00
*/
2023-05-03 14:16:11 +00:00
closeButtonIcon?: ConfirmDialogPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the content's DOM element.
2023-05-03 14:16:11 +00:00
*/
content?: ConfirmDialogPassThroughOptionType;
2023-04-25 09:58:01 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the icon's DOM element.
2023-04-25 09:58:01 +00:00
*/
icon?: ConfirmDialogPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the message's DOM element.
2023-04-25 09:58:01 +00:00
*/
message?: ConfirmDialogPassThroughOptionType;
2023-05-03 14:16:11 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the footer's DOM element.
2023-05-03 14:16:11 +00:00
*/
footer?: ConfirmDialogPassThroughOptionType;
2023-04-25 09:58:01 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the Button component.
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
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the Button component.
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-07-06 11:09:01 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to manage all lifecycle hooks
2023-07-06 11:09:01 +00:00
* @see {@link BaseComponent.ComponentHooks}
*/
hooks?: ComponentHooks;
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;
/**
* Enables dragging to change the position using header.
* @defaultValue true
*/
draggable?: boolean | undefined;
2023-04-25 09:58:01 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to DOM elements inside the component.
2023-04-25 09:58:01 +00:00
* @type {ConfirmDialogPassThroughOptions}
*/
pt?: PTOptions<ConfirmDialogPassThroughOptions>;
2023-05-29 17:44:31 +00:00
/**
* When enabled, it removes component related styles in the core.
* @defaultValue false
*/
unstyled?: boolean;
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.
*/
message(scope: {
/**
* Message of the component
*/
message: ConfirmationOptions;
}): VNode[];
/**
* Custom icon template.
2023-08-17 07:16:25 +00:00
* @param {Object} scope - icon slot's params.
*/
icon(scope: {
/**
* Style class of the icon template
*/
class: any;
}): VNode[];
/**
* 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;