import * as i0 from '@angular/core';
import { EventEmitter, Output, Input, Component } from '@angular/core';
import * as i2 from 'primeng/dialog';
import { DialogModule } from 'primeng/dialog';
import { d as ParametricDialogComponent } from './wuic-framework-lib-wuic-framework-lib-DJZAYFw8.mjs';

class PromptDialogFallbackHostComponent {
    datasource;
    header = '';
    width = '400px';
    height = '250px';
    styleClass = 'edit-form-content';
    position = 'center';
    closable = true;
    closed = new EventEmitter();
    visible = true;
    isClosed = false;
    get dialogStyle() {
        const style = {};
        if (this.width) {
            style['width'] = this.width;
        }
        if (this.height) {
            style['height'] = this.height;
        }
        return style;
    }
    closeWithResult(result) {
        if (this.isClosed) {
            return;
        }
        this.isClosed = true;
        this.visible = false;
        this.closed.emit(result);
    }
    onVisibleChange(visible) {
        this.visible = visible;
        if (!visible && !this.isClosed) {
            this.isClosed = true;
            this.closed.emit(null);
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PromptDialogFallbackHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: PromptDialogFallbackHostComponent, isStandalone: true, selector: "wuic-prompt-dialog-fallback-host", inputs: { datasource: "datasource", header: "header", width: "width", height: "height", styleClass: "styleClass", position: "position", closable: "closable" }, outputs: { closed: "closed" }, ngImport: i0, template: `
    <p-dialog
      [header]="header"
      [visible]="visible"
      (visibleChange)="onVisibleChange($event)"
      [modal]="true"
      [closable]="closable"
      [style]="dialogStyle"
      [styleClass]="styleClass"
      [position]="position"
    >
      <wuic-parametric-dialog [datasource]="datasource"></wuic-parametric-dialog>
    </p-dialog>
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i2.Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "maskMotionOptions", "motionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: ParametricDialogComponent, selector: "wuic-parametric-dialog", inputs: ["datasource", "hardcodedDatasource", "hideToolbar", "isWizard", "isEditForm", "readOnly"], outputs: ["onDialogDataBound", "onDialogTabChange", "onWizardStepChange", "onDialogCustomAction", "onDialogSubmit", "onDialogRollback", "onDialogCloseRequested", "onCustomAttributesSave"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PromptDialogFallbackHostComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'wuic-prompt-dialog-fallback-host',
                    standalone: true,
                    imports: [DialogModule, ParametricDialogComponent],
                    template: `
    <p-dialog
      [header]="header"
      [visible]="visible"
      (visibleChange)="onVisibleChange($event)"
      [modal]="true"
      [closable]="closable"
      [style]="dialogStyle"
      [styleClass]="styleClass"
      [position]="position"
    >
      <wuic-parametric-dialog [datasource]="datasource"></wuic-parametric-dialog>
    </p-dialog>
  `
                }]
        }], propDecorators: { datasource: [{
                type: Input
            }], header: [{
                type: Input
            }], width: [{
                type: Input
            }], height: [{
                type: Input
            }], styleClass: [{
                type: Input
            }], position: [{
                type: Input
            }], closable: [{
                type: Input
            }], closed: [{
                type: Output
            }] } });

export { PromptDialogFallbackHostComponent };
//# sourceMappingURL=wuic-framework-lib-prompt-dialog-fallback-host.component-DPZCgxOB.mjs.map
