primeng
Version:
PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB
815 lines (807 loc) • 34.4 kB
JavaScript
import { animation, style, animate, trigger, transition, useAnimation } from '@angular/animations';
import * as i2 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { Injectable, EventEmitter, inject, booleanAttribute, numberAttribute, ContentChildren, ContentChild, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
import { uuid, findSingle, setAttribute } from '@primeuix/utils';
import * as i1 from 'primeng/api';
import { ConfirmEventType, TranslationKeys, SharedModule, Footer, PrimeTemplate } from 'primeng/api';
import { BaseComponent } from 'primeng/basecomponent';
import { Button } from 'primeng/button';
import { Dialog } from 'primeng/dialog';
import { BaseStyle } from 'primeng/base';
const theme = ({ dt }) => `
.p-confirmdialog .p-dialog-content {
display: flex;
align-items: center;
gap: ${dt('confirmdialog.content.gap')};
}
.p-confirmdialog .p-confirmdialog-icon {
color: ${dt('confirmdialog.icon.color')};
font-size: ${dt('confirmdialog.icon.size')};
width: ${dt('confirmdialog.icon.size')};
height: ${dt('confirmdialog.icon.size')};
}
`;
const classes = {
root: 'p-confirmdialog',
icon: 'p-confirmdialog-icon',
message: 'p-confirmdialog-message',
pcRejectButton: 'p-confirmdialog-reject-button',
pcAcceptButton: 'p-confirmdialog-accept-button'
};
class ConfirmDialogStyle extends BaseStyle {
name = 'confirmdialog';
theme = theme;
classes = classes;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ConfirmDialogStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ConfirmDialogStyle });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ConfirmDialogStyle, decorators: [{
type: Injectable
}] });
/**
*
* ConfirmDialog uses a Dialog UI with confirmDialog method or <ConfirmDialog> tag.
*
* [Live Demo](https://www.primeng.org/confirmdialog)
*
* @module confirmdialogstyle
*
*/
var ConfirmDialogClasses;
(function (ConfirmDialogClasses) {
/**
* Class name of the root element
*/
ConfirmDialogClasses["root"] = "p-confirmdialog";
/**
* Class name of the icon element
*/
ConfirmDialogClasses["icon"] = "p-confirmdialog-icon";
/**
* Class name of the message element
*/
ConfirmDialogClasses["message"] = "p-confirmdialog-message";
/**
* Class name of the reject button element
*/
ConfirmDialogClasses["pcRejectButton"] = "p-confirmdialog-reject-button";
/**
* Class name of the accept button element
*/
ConfirmDialogClasses["pcAcceptButton"] = "p-confirmdialog-accept-button";
})(ConfirmDialogClasses || (ConfirmDialogClasses = {}));
const showAnimation = animation([style({ transform: '{{transform}}', opacity: 0 }), animate('{{transition}}', style({ transform: 'none', opacity: 1 }))]);
const hideAnimation = animation([animate('{{transition}}', style({ transform: '{{transform}}', opacity: 0 }))]);
/**
* ConfirmDialog uses a Dialog UI that is integrated with the Confirmation API.
* @group Components
*/
class ConfirmDialog extends BaseComponent {
confirmationService;
zone;
/**
* Title text of the dialog.
* @group Props
*/
header;
/**
* Icon to display next to message.
* @group Props
*/
icon;
/**
* Message of the confirmation.
* @group Props
*/
message;
/**
* Inline style of the element.
* @group Props
*/
get style() {
return this._style;
}
set style(value) {
this._style = value;
this.cd.markForCheck();
}
/**
* Class of the element.
* @group Props
*/
styleClass;
/**
* Specify the CSS class(es) for styling the mask element
* @group Props
*/
maskStyleClass;
/**
* Icon of the accept button.
* @group Props
*/
acceptIcon;
/**
* Label of the accept button.
* @group Props
*/
acceptLabel;
/**
* Defines a string that labels the close button for accessibility.
* @group Props
*/
closeAriaLabel;
/**
* Defines a string that labels the accept button for accessibility.
* @group Props
*/
acceptAriaLabel;
/**
* Visibility of the accept button.
* @group Props
*/
acceptVisible = true;
/**
* Icon of the reject button.
* @group Props
*/
rejectIcon;
/**
* Label of the reject button.
* @group Props
*/
rejectLabel;
/**
* Defines a string that labels the reject button for accessibility.
* @group Props
*/
rejectAriaLabel;
/**
* Visibility of the reject button.
* @group Props
*/
rejectVisible = true;
/**
* Style class of the accept button.
* @group Props
*/
acceptButtonStyleClass;
/**
* Style class of the reject button.
* @group Props
*/
rejectButtonStyleClass;
/**
* Specifies if pressing escape key should hide the dialog.
* @group Props
*/
closeOnEscape = true;
/**
* Specifies if clicking the modal background should hide the dialog.
* @group Props
*/
dismissableMask;
/**
* Determines whether scrolling behavior should be blocked within the component.
* @group Props
*/
blockScroll = true;
/**
* When enabled dialog is displayed in RTL direction.
* @group Props
*/
rtl = false;
/**
* Adds a close icon to the header to hide the dialog.
* @group Props
*/
closable = true;
/**
* Target element to attach the dialog, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name).
* @group Props
*/
appendTo = 'body';
/**
* Optional key to match the key of confirm object, necessary to use when component tree has multiple confirm dialogs.
* @group Props
*/
key;
/**
* Whether to automatically manage layering.
* @group Props
*/
autoZIndex = true;
/**
* Base zIndex value to use in layering.
* @group Props
*/
baseZIndex = 0;
/**
* Transition options of the animation.
* @group Props
*/
transitionOptions = '150ms cubic-bezier(0, 0, 0.2, 1)';
/**
* When enabled, can only focus on elements inside the confirm dialog.
* @group Props
*/
focusTrap = true;
/**
* Element to receive the focus when the dialog gets visible.
* @group Props
*/
defaultFocus = 'accept';
/**
* Object literal to define widths per screen size.
* @group Props
*/
breakpoints;
/**
* Current visible state as a boolean.
* @group Props
*/
get visible() {
return this._visible;
}
set visible(value) {
this._visible = value;
if (this._visible && !this.maskVisible) {
this.maskVisible = true;
}
this.cd.markForCheck();
}
/**
* Allows getting the position of the component.
* @group Props
*/
get position() {
return this._position;
}
set position(value) {
this._position = value;
switch (value) {
case 'topleft':
case 'bottomleft':
case 'left':
this.transformOptions = 'translate3d(-100%, 0px, 0px)';
break;
case 'topright':
case 'bottomright':
case 'right':
this.transformOptions = 'translate3d(100%, 0px, 0px)';
break;
case 'bottom':
this.transformOptions = 'translate3d(0px, 100%, 0px)';
break;
case 'top':
this.transformOptions = 'translate3d(0px, -100%, 0px)';
break;
default:
this.transformOptions = 'scale(0.7)';
break;
}
}
/**
* Callback to invoke when dialog is hidden.
* @param {ConfirmEventType} enum - Custom confirm event.
* @group Emits
*/
onHide = new EventEmitter();
footer;
_componentStyle = inject(ConfirmDialogStyle);
headerTemplate;
footerTemplate;
rejectIconTemplate;
acceptIconTemplate;
messageTemplate;
iconTemplate;
headlessTemplate;
templates;
_headerTemplate;
_footerTemplate;
_rejectIconTemplate;
_acceptIconTemplate;
_messageTemplate;
_iconTemplate;
_headlessTemplate;
confirmation;
_visible;
_style;
maskVisible;
dialog;
wrapper;
contentContainer;
subscription;
preWidth;
_position = 'center';
transformOptions = 'scale(0.7)';
styleElement;
id = uuid('pn_id_');
ariaLabelledBy = this.getAriaLabelledBy();
translationSubscription;
get containerClass() {
return this.cx('root') + ' ' + this.styleClass || ' ';
}
constructor(confirmationService, zone) {
super();
this.confirmationService = confirmationService;
this.zone = zone;
this.subscription = this.confirmationService.requireConfirmation$.subscribe((confirmation) => {
if (!confirmation) {
this.hide();
return;
}
if (confirmation.key === this.key) {
this.confirmation = confirmation;
const keys = Object.keys(confirmation);
keys.forEach((key) => {
this[key] = confirmation[key];
});
if (this.confirmation.accept) {
this.confirmation.acceptEvent = new EventEmitter();
this.confirmation.acceptEvent.subscribe(this.confirmation.accept);
}
if (this.confirmation.reject) {
this.confirmation.rejectEvent = new EventEmitter();
this.confirmation.rejectEvent.subscribe(this.confirmation.reject);
}
this.visible = true;
}
});
}
ngOnInit() {
super.ngOnInit();
if (this.breakpoints) {
this.createStyle();
}
this.translationSubscription = this.config.translationObserver.subscribe(() => {
if (this.visible) {
this.cd.markForCheck();
}
});
}
ngAfterContentInit() {
this.templates?.forEach((item) => {
switch (item.getType()) {
case 'header':
this._headerTemplate = item.template;
break;
case 'footer':
this._footerTemplate = item.template;
break;
case 'message':
this._messageTemplate = item.template;
break;
case 'icon':
this._iconTemplate = item.template;
break;
case 'rejecticon':
this._rejectIconTemplate = item.template;
break;
case 'accepticon':
this._acceptIconTemplate = item.template;
break;
case 'headless':
this._headlessTemplate = item.template;
break;
}
});
}
getAriaLabelledBy() {
return this.header !== null ? uuid('pn_id_') + '_header' : null;
}
option(name, k) {
const source = this || this;
if (source.hasOwnProperty(name)) {
if (k) {
return source[k];
}
return source[name];
}
return undefined;
}
getButtonStyleClass(cx, opt) {
const cxClass = this.cx(cx);
const optionClass = this.option(opt);
return [cxClass, optionClass].filter(Boolean).join(' ');
}
getElementToFocus() {
switch (this.option('defaultFocus')) {
case 'accept':
return findSingle(this.dialog.el.nativeElement, '.p-confirm-dialog-accept');
case 'reject':
return findSingle(this.dialog.el.nativeElement, '.p-confirm-dialog-reject');
case 'close':
return findSingle(this.dialog.el.nativeElement, '.p-dialog-header-close');
case 'none':
return null;
//backward compatibility
default:
return findSingle(this.dialog.el.nativeElement, '.p-confirm-dialog-accept');
}
}
createStyle() {
if (!this.styleElement) {
this.styleElement = this.document.createElement('style');
this.styleElement.type = 'text/css';
this.document.head.appendChild(this.styleElement);
let innerHTML = '';
for (let breakpoint in this.breakpoints) {
innerHTML += `
@media screen and (max-width: ${breakpoint}) {
.p-dialog[${this.id}] {
width: ${this.breakpoints[breakpoint]} !important;
}
}
`;
}
this.styleElement.innerHTML = innerHTML;
setAttribute(this.styleElement, 'nonce', this.config?.csp()?.nonce);
}
}
close() {
if (this.confirmation?.rejectEvent) {
this.confirmation.rejectEvent.emit(ConfirmEventType.CANCEL);
}
this.hide(ConfirmEventType.CANCEL);
}
hide(type) {
this.onHide.emit(type);
this.visible = false;
this.confirmation = null;
}
destroyStyle() {
if (this.styleElement) {
this.document.head.removeChild(this.styleElement);
this.styleElement = null;
}
}
ngOnDestroy() {
this.subscription.unsubscribe();
if (this.translationSubscription) {
this.translationSubscription.unsubscribe();
}
this.destroyStyle();
super.ngOnDestroy();
}
onVisibleChange(value) {
if (!value) {
this.close();
}
else {
this.visible = value;
}
}
onAccept() {
if (this.confirmation && this.confirmation.acceptEvent) {
this.confirmation.acceptEvent.emit();
}
this.hide(ConfirmEventType.ACCEPT);
}
onReject() {
if (this.confirmation && this.confirmation.rejectEvent) {
this.confirmation.rejectEvent.emit(ConfirmEventType.REJECT);
}
this.hide(ConfirmEventType.REJECT);
}
get acceptButtonLabel() {
return this.option('acceptLabel') || this.config.getTranslation(TranslationKeys.ACCEPT);
}
get rejectButtonLabel() {
return this.option('rejectLabel') || this.config.getTranslation(TranslationKeys.REJECT);
}
getAcceptButtonProps() {
return this.option('acceptButtonProps');
}
getRejectButtonProps() {
return this.option('rejectButtonProps');
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ConfirmDialog, deps: [{ token: i1.ConfirmationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: ConfirmDialog, isStandalone: true, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: { header: "header", icon: "icon", message: "message", style: "style", styleClass: "styleClass", maskStyleClass: "maskStyleClass", acceptIcon: "acceptIcon", acceptLabel: "acceptLabel", closeAriaLabel: "closeAriaLabel", acceptAriaLabel: "acceptAriaLabel", acceptVisible: ["acceptVisible", "acceptVisible", booleanAttribute], rejectIcon: "rejectIcon", rejectLabel: "rejectLabel", rejectAriaLabel: "rejectAriaLabel", rejectVisible: ["rejectVisible", "rejectVisible", booleanAttribute], acceptButtonStyleClass: "acceptButtonStyleClass", rejectButtonStyleClass: "rejectButtonStyleClass", closeOnEscape: ["closeOnEscape", "closeOnEscape", booleanAttribute], dismissableMask: ["dismissableMask", "dismissableMask", booleanAttribute], blockScroll: ["blockScroll", "blockScroll", booleanAttribute], rtl: ["rtl", "rtl", booleanAttribute], closable: ["closable", "closable", booleanAttribute], appendTo: "appendTo", key: "key", autoZIndex: ["autoZIndex", "autoZIndex", booleanAttribute], baseZIndex: ["baseZIndex", "baseZIndex", numberAttribute], transitionOptions: "transitionOptions", focusTrap: ["focusTrap", "focusTrap", booleanAttribute], defaultFocus: "defaultFocus", breakpoints: "breakpoints", visible: "visible", position: "position" }, outputs: { onHide: "onHide" }, providers: [ConfirmDialogStyle], queries: [{ propertyName: "footer", first: true, predicate: Footer, descendants: true }, { propertyName: "headerTemplate", first: true, predicate: ["header"] }, { propertyName: "footerTemplate", first: true, predicate: ["footer"] }, { propertyName: "rejectIconTemplate", first: true, predicate: ["rejecticon"] }, { propertyName: "acceptIconTemplate", first: true, predicate: ["accepticon"] }, { propertyName: "messageTemplate", first: true, predicate: ["message"] }, { propertyName: "iconTemplate", first: true, predicate: ["icon"] }, { propertyName: "headlessTemplate", first: true, predicate: ["headless"] }, { propertyName: "templates", predicate: PrimeTemplate }], usesInheritance: true, ngImport: i0, template: `
<p-dialog
#dialog
[visible]="visible"
(visibleChange)="onVisibleChange($event)"
role="alertdialog"
[closable]="option('closable')"
[styleClass]="containerClass"
[modal]="true"
[header]="option('header')"
[closeOnEscape]="option('closeOnEscape')"
[blockScroll]="option('blockScroll')"
[appendTo]="option('appendTo')"
[position]="position"
[style]="style"
[dismissableMask]="dismissableMask"
>
@if (headlessTemplate || _headlessTemplate) {
<ng-template #headless>
<ng-container
*ngTemplateOutlet="
headlessTemplate || _headlessTemplate;
context: {
$implicit: confirmation,
onAccept: onAccept.bind(this),
onReject: onReject.bind(this)
}
"
></ng-container>
</ng-template>
} @else {
@if (headerTemplate || _headerTemplate) {
<ng-template #header>
<div [ngClass]="cx('header')">
<ng-container *ngTemplateOutlet="headerTemplate || _headerTemplate"></ng-container>
</div>
</ng-template>
}
<ng-template #content>
@if (iconTemplate || _iconTemplate) {
<ng-template *ngTemplateOutlet="iconTemplate || _iconTemplate"></ng-template>
} @else if (!iconTemplate && !_iconTemplate && !_messageTemplate && !messageTemplate) {
<i [ngClass]="cx('icon')" [class]="option('icon')" *ngIf="option('icon')"></i>
}
@if (messageTemplate || _messageTemplate) {
<ng-template *ngTemplateOutlet="messageTemplate || _messageTemplate; context: { $implicit: confirmation }"></ng-template>
} @else {
<span [ngClass]="cx('message')" [innerHTML]="option('message')"> </span>
}
</ng-template>
}
<ng-template #footer>
@if (footerTemplate || _footerTemplate) {
<ng-content select="p-footer"></ng-content>
<ng-container *ngTemplateOutlet="footerTemplate || _footerTemplate"></ng-container>
}
@if (!footerTemplate && !_footerTemplate) {
<p-button
*ngIf="option('rejectVisible')"
[label]="rejectButtonLabel"
(onClick)="onReject()"
[styleClass]="getButtonStyleClass('pcRejectButton', 'rejectButtonStyleClass')"
[ariaLabel]="option('rejectButtonProps', 'ariaLabel')"
[buttonProps]="getRejectButtonProps()"
>
@if (rejectIcon && !rejectIconTemplate && !_rejectIconTemplate) {
<i *ngIf="option('rejectIcon')" [class]="option('rejectIcon')"></i>
}
<ng-template *ngTemplateOutlet="rejectIconTemplate || _rejectIconTemplate"></ng-template>
</p-button>
<p-button
[label]="acceptButtonLabel"
(onClick)="onAccept()"
[styleClass]="getButtonStyleClass('pcAcceptButton', 'acceptButtonStyleClass')"
*ngIf="option('acceptVisible')"
[ariaLabel]="option('acceptButtonProps', 'ariaLabel')"
[buttonProps]="getAcceptButtonProps()"
>
@if (acceptIcon && !_acceptIconTemplate && !acceptIconTemplate) {
<i *ngIf="option('acceptIcon')" [class]="option('acceptIcon')"></i>
}
<ng-template *ngTemplateOutlet="acceptIconTemplate || _acceptIconTemplate"></ng-template>
</p-button>
}
</ng-template>
</p-dialog>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: SharedModule }], animations: [trigger('animation', [transition('void => visible', [useAnimation(showAnimation)]), transition('visible => void', [useAnimation(hideAnimation)])])], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ConfirmDialog, decorators: [{
type: Component,
args: [{
selector: 'p-confirmDialog, p-confirmdialog, p-confirm-dialog',
standalone: true,
imports: [CommonModule, Button, Dialog, SharedModule],
template: `
<p-dialog
#dialog
[visible]="visible"
(visibleChange)="onVisibleChange($event)"
role="alertdialog"
[closable]="option('closable')"
[styleClass]="containerClass"
[modal]="true"
[header]="option('header')"
[closeOnEscape]="option('closeOnEscape')"
[blockScroll]="option('blockScroll')"
[appendTo]="option('appendTo')"
[position]="position"
[style]="style"
[dismissableMask]="dismissableMask"
>
@if (headlessTemplate || _headlessTemplate) {
<ng-template #headless>
<ng-container
*ngTemplateOutlet="
headlessTemplate || _headlessTemplate;
context: {
$implicit: confirmation,
onAccept: onAccept.bind(this),
onReject: onReject.bind(this)
}
"
></ng-container>
</ng-template>
} @else {
@if (headerTemplate || _headerTemplate) {
<ng-template #header>
<div [ngClass]="cx('header')">
<ng-container *ngTemplateOutlet="headerTemplate || _headerTemplate"></ng-container>
</div>
</ng-template>
}
<ng-template #content>
@if (iconTemplate || _iconTemplate) {
<ng-template *ngTemplateOutlet="iconTemplate || _iconTemplate"></ng-template>
} @else if (!iconTemplate && !_iconTemplate && !_messageTemplate && !messageTemplate) {
<i [ngClass]="cx('icon')" [class]="option('icon')" *ngIf="option('icon')"></i>
}
@if (messageTemplate || _messageTemplate) {
<ng-template *ngTemplateOutlet="messageTemplate || _messageTemplate; context: { $implicit: confirmation }"></ng-template>
} @else {
<span [ngClass]="cx('message')" [innerHTML]="option('message')"> </span>
}
</ng-template>
}
<ng-template #footer>
@if (footerTemplate || _footerTemplate) {
<ng-content select="p-footer"></ng-content>
<ng-container *ngTemplateOutlet="footerTemplate || _footerTemplate"></ng-container>
}
@if (!footerTemplate && !_footerTemplate) {
<p-button
*ngIf="option('rejectVisible')"
[label]="rejectButtonLabel"
(onClick)="onReject()"
[styleClass]="getButtonStyleClass('pcRejectButton', 'rejectButtonStyleClass')"
[ariaLabel]="option('rejectButtonProps', 'ariaLabel')"
[buttonProps]="getRejectButtonProps()"
>
@if (rejectIcon && !rejectIconTemplate && !_rejectIconTemplate) {
<i *ngIf="option('rejectIcon')" [class]="option('rejectIcon')"></i>
}
<ng-template *ngTemplateOutlet="rejectIconTemplate || _rejectIconTemplate"></ng-template>
</p-button>
<p-button
[label]="acceptButtonLabel"
(onClick)="onAccept()"
[styleClass]="getButtonStyleClass('pcAcceptButton', 'acceptButtonStyleClass')"
*ngIf="option('acceptVisible')"
[ariaLabel]="option('acceptButtonProps', 'ariaLabel')"
[buttonProps]="getAcceptButtonProps()"
>
@if (acceptIcon && !_acceptIconTemplate && !acceptIconTemplate) {
<i *ngIf="option('acceptIcon')" [class]="option('acceptIcon')"></i>
}
<ng-template *ngTemplateOutlet="acceptIconTemplate || _acceptIconTemplate"></ng-template>
</p-button>
}
</ng-template>
</p-dialog>
`,
animations: [trigger('animation', [transition('void => visible', [useAnimation(showAnimation)]), transition('visible => void', [useAnimation(hideAnimation)])])],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
providers: [ConfirmDialogStyle]
}]
}], ctorParameters: () => [{ type: i1.ConfirmationService }, { type: i0.NgZone }], propDecorators: { header: [{
type: Input
}], icon: [{
type: Input
}], message: [{
type: Input
}], style: [{
type: Input
}], styleClass: [{
type: Input
}], maskStyleClass: [{
type: Input
}], acceptIcon: [{
type: Input
}], acceptLabel: [{
type: Input
}], closeAriaLabel: [{
type: Input
}], acceptAriaLabel: [{
type: Input
}], acceptVisible: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], rejectIcon: [{
type: Input
}], rejectLabel: [{
type: Input
}], rejectAriaLabel: [{
type: Input
}], rejectVisible: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], acceptButtonStyleClass: [{
type: Input
}], rejectButtonStyleClass: [{
type: Input
}], closeOnEscape: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], dismissableMask: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], blockScroll: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], rtl: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], closable: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], appendTo: [{
type: Input
}], key: [{
type: Input
}], autoZIndex: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], baseZIndex: [{
type: Input,
args: [{ transform: numberAttribute }]
}], transitionOptions: [{
type: Input
}], focusTrap: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], defaultFocus: [{
type: Input
}], breakpoints: [{
type: Input
}], visible: [{
type: Input
}], position: [{
type: Input
}], onHide: [{
type: Output
}], footer: [{
type: ContentChild,
args: [Footer]
}], headerTemplate: [{
type: ContentChild,
args: ['header', { descendants: false }]
}], footerTemplate: [{
type: ContentChild,
args: ['footer', { descendants: false }]
}], rejectIconTemplate: [{
type: ContentChild,
args: ['rejecticon', { descendants: false }]
}], acceptIconTemplate: [{
type: ContentChild,
args: ['accepticon', { descendants: false }]
}], messageTemplate: [{
type: ContentChild,
args: ['message', { descendants: false }]
}], iconTemplate: [{
type: ContentChild,
args: ['icon', { descendants: false }]
}], headlessTemplate: [{
type: ContentChild,
args: ['headless', { descendants: false }]
}], templates: [{
type: ContentChildren,
args: [PrimeTemplate]
}] } });
class ConfirmDialogModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ConfirmDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.2", ngImport: i0, type: ConfirmDialogModule, imports: [ConfirmDialog, SharedModule], exports: [ConfirmDialog, SharedModule] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ConfirmDialogModule, imports: [ConfirmDialog, SharedModule, SharedModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ConfirmDialogModule, decorators: [{
type: NgModule,
args: [{
imports: [ConfirmDialog, SharedModule],
exports: [ConfirmDialog, SharedModule]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { ConfirmDialog, ConfirmDialogClasses, ConfirmDialogModule, ConfirmDialogStyle };
//# sourceMappingURL=primeng-confirmdialog.mjs.map