primevue-mirror/components/lib/confirmpopup/ConfirmPopup.d.ts

162 lines
4.1 KiB
TypeScript
Raw Normal View History

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
*
*/
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 10:18:17 +00:00
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
2022-09-06 12:03:37 +00:00
2023-04-24 11:22:01 +00:00
export declare type ConfirmPopupPassThroughOptionType = ConfirmPopupPassThroughAttributes | ((options: ConfirmPopupPassThroughMethodOptions) => ConfirmPopupPassThroughAttributes) | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface ConfirmPopupPassThroughMethodOptions {
props: ConfirmPopupProps;
state: ConfirmPopupState;
}
/**
* Custom passthrough(pt) options.
* @see {@link ConfirmPopupProps.pt}
*/
export interface ConfirmPopupPassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: ConfirmPopupPassThroughOptionType;
/**
* Uses to pass attributes to the content's DOM element.
*/
content?: ConfirmPopupPassThroughOptionType;
/**
* Uses to pass attributes to the icon's DOM element.
*/
icon?: ConfirmPopupPassThroughOptionType;
/**
* Uses to pass attributes to the message's DOM element.
*/
message?: ConfirmPopupPassThroughOptionType;
/**
* Uses to pass attributes to the footer's DOM element.
*/
footer?: ConfirmPopupPassThroughOptionType;
/**
2023-05-02 11:28:07 +00:00
* Uses 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
*/
2023-05-02 08:01:27 +00:00
rejectButton?: ButtonPassThroughOptions;
2023-04-24 11:22:01 +00:00
/**
2023-05-02 11:28:07 +00:00
* Uses 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
*/
2023-05-02 08:01:27 +00:00
acceptButton?: ButtonPassThroughOptions;
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;
2023-04-24 11:22:01 +00:00
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {ConfirmPopupPassThroughOptions}
*/
pt?: ConfirmPopupPassThroughOptions;
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.
*/
message(scope: {
/**
* Message of the component
*/
message: ConfirmationOptions;
}): VNode[];
/**
* Custom icon template.
*/
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 10:18:17 +00:00
/**
* Defines valid emits in ConfirmPopup component.
*/
export interface ConfirmPopupEmits {}
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
*/
2023-03-01 14:48:23 +00:00
declare class ConfirmPopup extends ClassComponent<ConfirmPopupProps, ConfirmPopupSlots, ConfirmPopupEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
ConfirmPopup: GlobalComponentConstructor<ConfirmPopup>;
2022-09-06 12:03:37 +00:00
}
}
export default ConfirmPopup;