2023-03-01 10:18:17 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* ConfirmPopup displays a confirmation overlay displayed relatively to its target.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/confirmpopup)
|
|
|
|
*
|
|
|
|
* @module confirmpopup
|
|
|
|
*
|
|
|
|
*/
|
2023-08-02 14:07:22 +00:00
|
|
|
import { TransitionProps, VNode } from 'vue';
|
2023-07-06 11:17:08 +00:00
|
|
|
import { ComponentHooks } from '../basecomponent';
|
2024-03-27 15:45:05 +00:00
|
|
|
import { ButtonPassThroughOptions } from '../button';
|
2022-09-06 12:03:37 +00:00
|
|
|
import { ConfirmationOptions } from '../confirmationoptions';
|
2023-09-05 08:50:46 +00:00
|
|
|
import { PassThroughOptions } from '../passthrough';
|
2024-05-16 10:50:43 +00:00
|
|
|
import { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-07-11 22:42:43 +00:00
|
|
|
export declare type ConfirmPopupPassThroughOptionType = ConfirmPopupPassThroughAttributes | ((options: ConfirmPopupPassThroughMethodOptions) => ConfirmPopupPassThroughAttributes | string) | string | null | undefined;
|
2023-04-24 11:22:01 +00:00
|
|
|
|
2023-08-02 14:07:22 +00:00
|
|
|
export declare type ConfirmPopupPassThroughTransitionType = TransitionProps | ((options: ConfirmPopupPassThroughMethodOptions) => TransitionProps) | undefined;
|
|
|
|
|
2023-04-24 11:22:01 +00:00
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface ConfirmPopupPassThroughMethodOptions {
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines instance.
|
|
|
|
*/
|
2023-07-06 12:01:33 +00:00
|
|
|
instance: any;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties.
|
|
|
|
*/
|
2023-04-24 11:22:01 +00:00
|
|
|
props: ConfirmPopupProps;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines current inline state.
|
|
|
|
*/
|
2023-04-24 11:22:01 +00:00
|
|
|
state: ConfirmPopupState;
|
2023-12-10 21:41:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid attributes.
|
|
|
|
*/
|
|
|
|
attrs: any;
|
2023-12-05 11:06:32 +00:00
|
|
|
/**
|
|
|
|
* Defines parent options.
|
|
|
|
*/
|
|
|
|
parent: any;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Defines passthrough(pt) options in global config.
|
|
|
|
*/
|
|
|
|
global: object | undefined;
|
2023-04-24 11:22:01 +00:00
|
|
|
}
|
|
|
|
|
2023-12-05 07:06:55 +00:00
|
|
|
/**
|
|
|
|
* Custom shared passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface ConfirmPopupSharedPassThroughMethodOptions {
|
|
|
|
/**
|
|
|
|
* Defines valid properties.
|
|
|
|
*/
|
|
|
|
props: ConfirmPopupProps;
|
|
|
|
/**
|
|
|
|
* Defines current inline state.
|
|
|
|
*/
|
|
|
|
state: ConfirmPopupState;
|
|
|
|
}
|
|
|
|
|
2023-04-24 11:22:01 +00:00
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
|
|
|
* @see {@link ConfirmPopupProps.pt}
|
|
|
|
*/
|
|
|
|
export interface ConfirmPopupPassThroughOptions {
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the root's DOM element.
|
2023-04-24 11:22:01 +00:00
|
|
|
*/
|
|
|
|
root?: ConfirmPopupPassThroughOptionType;
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the content's DOM element.
|
2023-04-24 11:22:01 +00:00
|
|
|
*/
|
|
|
|
content?: ConfirmPopupPassThroughOptionType;
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the icon's DOM element.
|
2023-04-24 11:22:01 +00:00
|
|
|
*/
|
|
|
|
icon?: ConfirmPopupPassThroughOptionType;
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the message's DOM element.
|
2023-04-24 11:22:01 +00:00
|
|
|
*/
|
|
|
|
message?: ConfirmPopupPassThroughOptionType;
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the footer's DOM element.
|
2023-04-24 11:22:01 +00:00
|
|
|
*/
|
|
|
|
footer?: ConfirmPopupPassThroughOptionType;
|
|
|
|
/**
|
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-24 11:22:01 +00:00
|
|
|
*/
|
2024-05-06 15:23:01 +00:00
|
|
|
pcRejectButton?: ButtonPassThroughOptions<ConfirmPopupSharedPassThroughMethodOptions>;
|
2023-04-24 11:22: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-24 11:22:01 +00:00
|
|
|
*/
|
2024-05-06 15:23:01 +00:00
|
|
|
pcAcceptButton?: ButtonPassThroughOptions<ConfirmPopupSharedPassThroughMethodOptions>;
|
2023-07-06 11:09:01 +00:00
|
|
|
/**
|
2023-11-07 06:16:39 +00:00
|
|
|
* Used to manage all lifecycle hooks.
|
2023-07-06 11:09:01 +00:00
|
|
|
* @see {@link BaseComponent.ComponentHooks}
|
|
|
|
*/
|
|
|
|
hooks?: ComponentHooks;
|
2023-08-02 12:00:18 +00:00
|
|
|
/**
|
|
|
|
* Used to control Vue Transition API.
|
|
|
|
*/
|
2023-08-02 14:07:22 +00:00
|
|
|
transition?: ConfirmPopupPassThroughTransitionType;
|
2023-04-24 11:22:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough attributes for each DOM elements
|
|
|
|
*/
|
|
|
|
export interface ConfirmPopupPassThroughAttributes {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines current inline state in ConfirmPopup component.
|
|
|
|
*/
|
|
|
|
export interface ConfirmPopupState {
|
|
|
|
/**
|
|
|
|
* Current visible state as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
visible: boolean;
|
|
|
|
/**
|
|
|
|
* Current confirmation message.
|
|
|
|
*/
|
|
|
|
confirmation: ConfirmationOptions;
|
|
|
|
}
|
|
|
|
|
2023-03-01 10:18:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in ConfirmPopup component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface ConfirmPopupProps {
|
|
|
|
/**
|
|
|
|
* Optional key to match the key of the confirmation, useful to target a specific confirm dialog instance.
|
|
|
|
*/
|
|
|
|
group?: string;
|
2024-04-02 08:24:31 +00:00
|
|
|
/**
|
|
|
|
* It generates scoped CSS variables using design tokens for the component.
|
|
|
|
*/
|
|
|
|
dt?: DesignToken<any>;
|
2023-04-24 11:22:01 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to DOM elements inside the component.
|
2023-04-24 11:22:01 +00:00
|
|
|
* @type {ConfirmPopupPassThroughOptions}
|
|
|
|
*/
|
2023-09-05 11:28:04 +00:00
|
|
|
pt?: PassThrough<ConfirmPopupPassThroughOptions>;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Used to configure passthrough(pt) options of the component.
|
|
|
|
* @type {PassThroughOptions}
|
|
|
|
*/
|
|
|
|
ptOptions?: PassThroughOptions;
|
2023-05-29 18:41:50 +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 10:18:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in ConfirmPopup component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface ConfirmPopupSlots {
|
|
|
|
/**
|
|
|
|
* 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-08-17 07:16:25 +00:00
|
|
|
* @param {Object} scope - icon slot's params.
|
2023-04-18 11:50:19 +00:00
|
|
|
*/
|
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[];
|
2023-09-19 11:14:41 +00:00
|
|
|
/**
|
|
|
|
* Custom container slot.
|
|
|
|
* @param {Object} scope - container slot's params.
|
|
|
|
*/
|
|
|
|
container(scope: {
|
|
|
|
/**
|
|
|
|
* Message of the component
|
|
|
|
*/
|
|
|
|
message: any;
|
2023-10-31 12:52:10 +00:00
|
|
|
/**
|
|
|
|
* Accept function of the component
|
|
|
|
*/
|
|
|
|
acceptCallback: () => void;
|
|
|
|
/**
|
|
|
|
* Reject function of the component
|
|
|
|
*/
|
|
|
|
rejectCallback: () => void;
|
2023-09-19 11:14:41 +00:00
|
|
|
}): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 10:18:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in ConfirmPopup component.
|
|
|
|
*/
|
2024-05-16 14:05:43 +00:00
|
|
|
export interface ConfirmPopupEmitsOptions {}
|
2024-05-16 10:50:43 +00:00
|
|
|
|
|
|
|
export declare type ConfirmPopupEmits = EmitFn<ConfirmPopupEmitsOptions>;
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 10:18:17 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - ConfirmPopup**
|
|
|
|
*
|
|
|
|
* _ConfirmPopup displays a confirmation overlay displayed relatively to its target._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/confirmpopup/)
|
|
|
|
* --- ---
|
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
|
|
|
*
|
|
|
|
* @group Component
|
2024-05-16 10:50:43 +00:00
|
|
|
*
|
2023-03-01 10:18:17 +00:00
|
|
|
*/
|
2024-05-16 10:50:43 +00:00
|
|
|
declare const ConfirmPopup: DefineComponent<ConfirmPopupProps, ConfirmPopupSlots, ConfirmPopupEmits>;
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-03-14 22:58:11 +00:00
|
|
|
declare module 'vue' {
|
|
|
|
export interface GlobalComponents {
|
2024-05-16 10:50:43 +00:00
|
|
|
ConfirmPopup: GlobalComponentConstructor<ConfirmPopupProps, ConfirmPopupSlots, ConfirmPopupEmits>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ConfirmPopup;
|