import * as i0 from '@angular/core';
import { Component, Inject, EventEmitter, Input, Output, NgModule } from '@angular/core';
import { AswConfirmDialog, AswConfirmDialogModule } from '@asoftwareworld/form-builder/form-control/confirm-dialog';
import { Constants } from '@asoftwareworld/form-builder/form-control/core';
import * as i1 from '@angular/forms';
import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
import * as i2 from '@angular/material/dialog';
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
import * as i3 from '@angular/material/divider';
import { MatDividerModule } from '@angular/material/divider';
import * as i4 from '@angular/material/form-field';
import * as i5 from '@angular/material/icon';
import { MatIconModule } from '@angular/material/icon';
import * as i6 from '@angular/material/select';
import { MatSelectModule } from '@angular/material/select';
import * as i7 from '@angular/material/core';
import * as i8 from '@angular/material/slide-toggle';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import * as i9 from '@angular/material/button';
import { MatButtonModule } from '@angular/material/button';
import * as i10 from '@angular/material/input';
import { MatInputModule } from '@angular/material/input';
import * as i11 from '@angular/material/tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import * as i3$1 from '@angular/common';
import { CommonModule } from '@angular/common';

/**
 * @license
 * Copyright ASW (A Software World) All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file
 */
class AswButtonDialog {
    constructor(formBuilder, dialogRef, control) {
        this.formBuilder = formBuilder;
        this.dialogRef = dialogRef;
        this.control = control;
        this.constants = Constants;
    }
    ngOnInit() {
        this.validateFormBuilder();
        this.editProperty(this.control);
    }
    validateFormBuilder() {
        this.aswEditButtonForm = this.formBuilder.group({
            tooltip: ['', [Validators.required]],
            label: ['', [Validators.required, Validators.minLength(4), Validators.maxLength(25)]],
            name: ['', [Validators.required, Validators.minLength(4), Validators.maxLength(25)]],
            type: ['', [Validators.required]],
            color: [],
            style: ['', [Validators.required]],
            isRequired: [false]
        });
    }
    editProperty(control) {
        this.aswEditButtonForm.setValue({
            tooltip: control.tooltip,
            label: control.label,
            name: control.name,
            type: control.type,
            color: control.color,
            style: control.style,
            isRequired: control.isRequired
        });
    }
    onNoClick() {
        this.dialogRef.close();
    }
    onSubmit() {
        if (this.aswEditButtonForm.invalid) {
            return;
        }
        this.aswEditButtonForm.value.controlType = this.control.controlType;
        this.dialogRef.close(this.aswEditButtonForm.value);
    }
    onChange(event) {
        if (event.checked) {
            this.status = true;
        }
        else {
            this.status = false;
        }
    }
}
AswButtonDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: AswButtonDialog, deps: [{ token: i1.FormBuilder }, { token: i2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
AswButtonDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: AswButtonDialog, selector: "asw-button-dialog", ngImport: i0, template: "<h4 mat-dialog-title>Edit Property</h4>\r\n<mat-divider></mat-divider>\r\n<form [formGroup]=\"aswEditButtonForm\" (ngSubmit)=\"onSubmit()\">\r\n    <mat-dialog-content class=\"mat-typography\">        \r\n        <div class=\"asw-full-width\"><br>\r\n            <div class=\"row\">\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\">\r\n                        <mat-label>Label</mat-label>\r\n                        <input matInput type=\"text\"\r\n                                        name=\"label\"\r\n                                        placeholder=\"Enter label\"\r\n                                        matTooltip=\"Enter label\"\r\n                                        formControlName=\"label\" required>\r\n                        <mat-error *ngFor=\"let validation of constants.accountValidationMessages.label\">\r\n                            <mat-error *ngIf=\"aswEditButtonForm.get('label')?.hasError(validation.type) && (aswEditButtonForm.get('label')?.dirty || aswEditButtonForm.get('label')?.touched)\">\r\n                                <mat-icon aria-hidden=\"false\">error</mat-icon> {{validation.message}}\r\n                            </mat-error>\r\n                        </mat-error>\r\n                    </mat-form-field>\r\n                </div>\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\">\r\n                        <mat-label>Tooltip</mat-label>\r\n                        <input matInput type=\"text\"\r\n                                        name=\"tooltip\"\r\n                                        placeholder=\"Enter tooltip\"\r\n                                        matTooltip=\"Enter tooltip\"\r\n                                        formControlName=\"tooltip\">\r\n                    </mat-form-field>\r\n                </div>\r\n            </div>\r\n            <mat-form-field appearance=\"outline\">\r\n                <mat-label>Name</mat-label>\r\n                <input matInput type=\"text\"\r\n                                name=\"name\"\r\n                                placeholder=\"Enter name\"\r\n                                matTooltip=\"Enter name\"\r\n                                formControlName=\"name\" required>\r\n                <mat-error *ngFor=\"let validation of constants.accountValidationMessages.name\">\r\n                    <mat-error *ngIf=\"aswEditButtonForm.get('name')?.hasError(validation.type) && (aswEditButtonForm.get('name')?.dirty || aswEditButtonForm.get('name')?.touched)\">\r\n                        <mat-icon aria-hidden=\"false\">error</mat-icon> {{validation.message}}\r\n                    </mat-error>\r\n                </mat-error>\r\n            </mat-form-field>\r\n            <mat-form-field appearance=\"outline\">\r\n                <mat-label>Type</mat-label>\r\n                <mat-select formControlName=\"type\" matTooltip=\"Select button type\">\r\n                    <mat-option value=\"button\">Button</mat-option>\r\n                    <mat-option value=\"submit\">Submit</mat-option>\r\n                    <mat-option value=\"reset\">Reset</mat-option>\r\n                </mat-select>\r\n            </mat-form-field>\r\n            <div class=\"row\">\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\">\r\n                        <mat-label>Button Style</mat-label>\r\n                        <mat-select formControlName=\"style\" matTooltip=\"Select button style\">\r\n                            <mat-option value=\"mat-button\">Basic</mat-option>\r\n                            <mat-option value=\"mat-raised-button\">Raised</mat-option>\r\n                            <mat-option value=\"mat-stroked-button\">Stroked</mat-option>\r\n                            <mat-option value=\"mat-flat-button\">Flat</mat-option>\r\n                        </mat-select>\r\n                    </mat-form-field>\r\n                </div>\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\">\r\n                        <mat-label>Color</mat-label>\r\n                        <mat-select formControlName=\"color\" matTooltip=\"Select button color\">\r\n                            <mat-option value=\"\">Basic</mat-option>\r\n                            <mat-option value=\"primary\">Primary</mat-option>\r\n                            <mat-option value=\"accent\">Rose</mat-option>\r\n                            <mat-option value=\"warn\">Danger</mat-option>\r\n                        </mat-select>\r\n                    </mat-form-field>\r\n                </div>\r\n            </div>\r\n            <div class=\"row\">\r\n                <div class=\"col-md-12\">\r\n                    <mat-slide-toggle color=\"primary\"\r\n                          #isActive\r\n                          formControlName=\"isRequired\"\r\n                          (change)=\"onChange($event)\">{{status? 'Required':'Not Required'}}\r\n                    </mat-slide-toggle>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </mat-dialog-content>\r\n    <mat-dialog-actions align=\"end\">\r\n        <button mat-raised-button\r\n                type=\"button\"\r\n                class=\"btn btn-danger mr-2 mb-1\"\r\n                (click)=\"onNoClick()\">\r\n            No\r\n        </button>\r\n        <button mat-raised-button type=\"submit\"\r\n                class=\"btn btn-primary mb-1\"\r\n                cdkFocusInitial>\r\n            Yes\r\n        </button>\r\n    </mat-dialog-actions>\r\n</form>\r\n\r\n", components: [{ type: i3.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i8.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex", "name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "checked"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { type: i9.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button],             button[mat-fab], button[mat-mini-fab], button[mat-stroked-button],             button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4.MatLabel, selector: "mat-label" }, { type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl],      input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.MatError, selector: "mat-error", inputs: ["id"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: AswButtonDialog, decorators: [{
            type: Component,
            args: [{ selector: 'asw-button-dialog', template: "<h4 mat-dialog-title>Edit Property</h4>\r\n<mat-divider></mat-divider>\r\n<form [formGroup]=\"aswEditButtonForm\" (ngSubmit)=\"onSubmit()\">\r\n    <mat-dialog-content class=\"mat-typography\">        \r\n        <div class=\"asw-full-width\"><br>\r\n            <div class=\"row\">\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\">\r\n                        <mat-label>Label</mat-label>\r\n                        <input matInput type=\"text\"\r\n                                        name=\"label\"\r\n                                        placeholder=\"Enter label\"\r\n                                        matTooltip=\"Enter label\"\r\n                                        formControlName=\"label\" required>\r\n                        <mat-error *ngFor=\"let validation of constants.accountValidationMessages.label\">\r\n                            <mat-error *ngIf=\"aswEditButtonForm.get('label')?.hasError(validation.type) && (aswEditButtonForm.get('label')?.dirty || aswEditButtonForm.get('label')?.touched)\">\r\n                                <mat-icon aria-hidden=\"false\">error</mat-icon> {{validation.message}}\r\n                            </mat-error>\r\n                        </mat-error>\r\n                    </mat-form-field>\r\n                </div>\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\">\r\n                        <mat-label>Tooltip</mat-label>\r\n                        <input matInput type=\"text\"\r\n                                        name=\"tooltip\"\r\n                                        placeholder=\"Enter tooltip\"\r\n                                        matTooltip=\"Enter tooltip\"\r\n                                        formControlName=\"tooltip\">\r\n                    </mat-form-field>\r\n                </div>\r\n            </div>\r\n            <mat-form-field appearance=\"outline\">\r\n                <mat-label>Name</mat-label>\r\n                <input matInput type=\"text\"\r\n                                name=\"name\"\r\n                                placeholder=\"Enter name\"\r\n                                matTooltip=\"Enter name\"\r\n                                formControlName=\"name\" required>\r\n                <mat-error *ngFor=\"let validation of constants.accountValidationMessages.name\">\r\n                    <mat-error *ngIf=\"aswEditButtonForm.get('name')?.hasError(validation.type) && (aswEditButtonForm.get('name')?.dirty || aswEditButtonForm.get('name')?.touched)\">\r\n                        <mat-icon aria-hidden=\"false\">error</mat-icon> {{validation.message}}\r\n                    </mat-error>\r\n                </mat-error>\r\n            </mat-form-field>\r\n            <mat-form-field appearance=\"outline\">\r\n                <mat-label>Type</mat-label>\r\n                <mat-select formControlName=\"type\" matTooltip=\"Select button type\">\r\n                    <mat-option value=\"button\">Button</mat-option>\r\n                    <mat-option value=\"submit\">Submit</mat-option>\r\n                    <mat-option value=\"reset\">Reset</mat-option>\r\n                </mat-select>\r\n            </mat-form-field>\r\n            <div class=\"row\">\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\">\r\n                        <mat-label>Button Style</mat-label>\r\n                        <mat-select formControlName=\"style\" matTooltip=\"Select button style\">\r\n                            <mat-option value=\"mat-button\">Basic</mat-option>\r\n                            <mat-option value=\"mat-raised-button\">Raised</mat-option>\r\n                            <mat-option value=\"mat-stroked-button\">Stroked</mat-option>\r\n                            <mat-option value=\"mat-flat-button\">Flat</mat-option>\r\n                        </mat-select>\r\n                    </mat-form-field>\r\n                </div>\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\">\r\n                        <mat-label>Color</mat-label>\r\n                        <mat-select formControlName=\"color\" matTooltip=\"Select button color\">\r\n                            <mat-option value=\"\">Basic</mat-option>\r\n                            <mat-option value=\"primary\">Primary</mat-option>\r\n                            <mat-option value=\"accent\">Rose</mat-option>\r\n                            <mat-option value=\"warn\">Danger</mat-option>\r\n                        </mat-select>\r\n                    </mat-form-field>\r\n                </div>\r\n            </div>\r\n            <div class=\"row\">\r\n                <div class=\"col-md-12\">\r\n                    <mat-slide-toggle color=\"primary\"\r\n                          #isActive\r\n                          formControlName=\"isRequired\"\r\n                          (change)=\"onChange($event)\">{{status? 'Required':'Not Required'}}\r\n                    </mat-slide-toggle>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </mat-dialog-content>\r\n    <mat-dialog-actions align=\"end\">\r\n        <button mat-raised-button\r\n                type=\"button\"\r\n                class=\"btn btn-danger mr-2 mb-1\"\r\n                (click)=\"onNoClick()\">\r\n            No\r\n        </button>\r\n        <button mat-raised-button type=\"submit\"\r\n                class=\"btn btn-primary mb-1\"\r\n                cdkFocusInitial>\r\n            Yes\r\n        </button>\r\n    </mat-dialog-actions>\r\n</form>\r\n\r\n" }]
        }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.MatDialogRef }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }]; } });

/**
 * @license
 * Copyright ASW (A Software World) All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file
 */
class AswButton {
    constructor(dialog) {
        this.dialog = dialog;
        this.constants = Constants;
        /**
         * Button control
         */
        this.control = null;
        this.isPreviewTemplate = false;
        this.buttonUpdateEvent = new EventEmitter();
        this.buttonDeleteEvent = new EventEmitter();
    }
    /**
     * Delete button control based on control index
     * @param control button control items
     * @param controlIndex button control index
     */
    deleteButtonDialog(control, controlIndex) {
        const dialogRef = this.dialog.open(AswConfirmDialog, {
            width: '350px',
            data: { name: control.name, message: this.constants.messages.waringMessage }
        });
        dialogRef.afterClosed().subscribe(result => {
            if (result !== undefined) {
                this.buttonDeleteEvent.emit(controlIndex);
            }
        });
    }
    editButtonDialog(control, controlIndex) {
        const dialogRef = this.dialog.open(AswButtonDialog, {
            disableClose: true,
            width: '744px',
            data: control
        });
        dialogRef.afterClosed().subscribe(result => {
            if (result !== undefined) {
                this.buttonUpdateEvent.emit({ control: result, index: controlIndex });
            }
        });
    }
}
AswButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: AswButton, deps: [{ token: i2.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
AswButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: AswButton, selector: "asw-button", inputs: { control: "control", controlIndex: "controlIndex", isPreviewTemplate: "isPreviewTemplate" }, outputs: { buttonUpdateEvent: "buttonUpdateEvent", buttonDeleteEvent: "buttonDeleteEvent" }, ngImport: i0, template: "<ng-container *ngIf=\"control as control\">\r\n    <ng-container [ngSwitch]=\"control.style\">\r\n        <ng-container *ngSwitchCase=\"'mat-button'\">\r\n            <button mat-button \r\n                    [color]=\"control.color\"\r\n                    [type]=\"control.type\"\r\n                    [matTooltip]=\"control.tooltip\"\r\n                    [name]=\"control.name\"\r\n                    >{{control.label}}</button>\r\n        </ng-container>\r\n        <ng-container *ngSwitchCase=\"'mat-raised-button'\">\r\n            <button mat-raised-button \r\n                    [color]=\"control.color\"\r\n                    [type]=\"control.type\"\r\n                    [matTooltip]=\"control.tooltip\"\r\n                    [name]=\"control.name\"\r\n                    >{{control.label}}</button>\r\n        </ng-container>\r\n        <ng-container *ngSwitchCase=\"'mat-stroked-button'\">\r\n            <button mat-stroked-button \r\n                    [color]=\"control.color\"\r\n                    [type]=\"control.type\"\r\n                    [matTooltip]=\"control.tooltip\"\r\n                    [name]=\"control.name\"\r\n                    >{{control.label}}</button>\r\n        </ng-container>\r\n        <ng-container *ngSwitchCase=\"'mat-flat-button'\">\r\n            <button mat-flat-button \r\n                    [color]=\"control.color\"\r\n                    [type]=\"control.type\"\r\n                    [title]=\"control.tooltip\"\r\n                    [name]=\"control.name\"\r\n                    [title]=\"control.tooltip\"\r\n                    >{{control.label}}</button>\r\n        </ng-container>\r\n    </ng-container>\r\n    <ng-template [ngIf]=\"isPreviewTemplate\">\r\n        <div class=\"row\">\r\n            <div class=\"col-md-12\">\r\n                <button type=\"button\" \r\n                        matTooltip=\"Edit button\" \r\n                        [matTooltipPosition]=\"'above'\" \r\n                        (click)=\"editButtonDialog(control, controlIndex)\"\r\n                        class=\"btn btn-sm btn-just-icon btn-outline-success mr-2 mb-1\">\r\n                    <i class=\"material-icons\">edit</i>\r\n                </button>\r\n                <button type=\"button\" \r\n                        matTooltip=\"Remove button\" \r\n                        [matTooltipPosition]=\"'above'\" \r\n                        (click)=\"deleteButtonDialog(control, controlIndex)\"\r\n                        class=\"btn btn-sm btn-just-icon btn-outline-danger mb-1\">\r\n                    <i class=\"material-icons\">close</i>\r\n                </button>\r\n            </div>\r\n        </div>\r\n    </ng-template>    \r\n</ng-container>", components: [{ type: i9.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button],             button[mat-fab], button[mat-mini-fab], button[mat-stroked-button],             button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i11.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: AswButton, decorators: [{
            type: Component,
            args: [{ selector: 'asw-button', template: "<ng-container *ngIf=\"control as control\">\r\n    <ng-container [ngSwitch]=\"control.style\">\r\n        <ng-container *ngSwitchCase=\"'mat-button'\">\r\n            <button mat-button \r\n                    [color]=\"control.color\"\r\n                    [type]=\"control.type\"\r\n                    [matTooltip]=\"control.tooltip\"\r\n                    [name]=\"control.name\"\r\n                    >{{control.label}}</button>\r\n        </ng-container>\r\n        <ng-container *ngSwitchCase=\"'mat-raised-button'\">\r\n            <button mat-raised-button \r\n                    [color]=\"control.color\"\r\n                    [type]=\"control.type\"\r\n                    [matTooltip]=\"control.tooltip\"\r\n                    [name]=\"control.name\"\r\n                    >{{control.label}}</button>\r\n        </ng-container>\r\n        <ng-container *ngSwitchCase=\"'mat-stroked-button'\">\r\n            <button mat-stroked-button \r\n                    [color]=\"control.color\"\r\n                    [type]=\"control.type\"\r\n                    [matTooltip]=\"control.tooltip\"\r\n                    [name]=\"control.name\"\r\n                    >{{control.label}}</button>\r\n        </ng-container>\r\n        <ng-container *ngSwitchCase=\"'mat-flat-button'\">\r\n            <button mat-flat-button \r\n                    [color]=\"control.color\"\r\n                    [type]=\"control.type\"\r\n                    [title]=\"control.tooltip\"\r\n                    [name]=\"control.name\"\r\n                    [title]=\"control.tooltip\"\r\n                    >{{control.label}}</button>\r\n        </ng-container>\r\n    </ng-container>\r\n    <ng-template [ngIf]=\"isPreviewTemplate\">\r\n        <div class=\"row\">\r\n            <div class=\"col-md-12\">\r\n                <button type=\"button\" \r\n                        matTooltip=\"Edit button\" \r\n                        [matTooltipPosition]=\"'above'\" \r\n                        (click)=\"editButtonDialog(control, controlIndex)\"\r\n                        class=\"btn btn-sm btn-just-icon btn-outline-success mr-2 mb-1\">\r\n                    <i class=\"material-icons\">edit</i>\r\n                </button>\r\n                <button type=\"button\" \r\n                        matTooltip=\"Remove button\" \r\n                        [matTooltipPosition]=\"'above'\" \r\n                        (click)=\"deleteButtonDialog(control, controlIndex)\"\r\n                        class=\"btn btn-sm btn-just-icon btn-outline-danger mb-1\">\r\n                    <i class=\"material-icons\">close</i>\r\n                </button>\r\n            </div>\r\n        </div>\r\n    </ng-template>    \r\n</ng-container>" }]
        }], ctorParameters: function () { return [{ type: i2.MatDialog }]; }, propDecorators: { control: [{
                type: Input
            }], controlIndex: [{
                type: Input
            }], isPreviewTemplate: [{
                type: Input
            }], buttonUpdateEvent: [{
                type: Output
            }], buttonDeleteEvent: [{
                type: Output
            }] } });

/**
 * @license
 * Copyright ASW (A Software World) All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file
 */
class AswButtonModule {
}
AswButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: AswButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
AswButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: AswButtonModule, declarations: [AswButton,
        AswButtonDialog], imports: [CommonModule,
        FormsModule,
        ReactiveFormsModule,
        MatInputModule,
        MatSelectModule,
        MatDialogModule,
        MatSlideToggleModule,
        MatDividerModule,
        MatIconModule,
        MatTooltipModule,
        MatButtonModule,
        AswConfirmDialogModule], exports: [AswButton,
        AswButtonDialog] });
AswButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: AswButtonModule, imports: [[
            CommonModule,
            FormsModule,
            ReactiveFormsModule,
            MatInputModule,
            MatSelectModule,
            MatDialogModule,
            MatSlideToggleModule,
            MatDividerModule,
            MatIconModule,
            MatTooltipModule,
            MatButtonModule,
            AswConfirmDialogModule
        ]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: AswButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        CommonModule,
                        FormsModule,
                        ReactiveFormsModule,
                        MatInputModule,
                        MatSelectModule,
                        MatDialogModule,
                        MatSlideToggleModule,
                        MatDividerModule,
                        MatIconModule,
                        MatTooltipModule,
                        MatButtonModule,
                        AswConfirmDialogModule
                    ],
                    declarations: [
                        AswButton,
                        AswButtonDialog
                    ],
                    exports: [
                        AswButton,
                        AswButtonDialog
                    ]
                }]
        }] });

/**
 * @license
 * Copyright ASW (A Software World) All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file
 */

/**
 * Generated bundle index. Do not edit.
 */

export { AswButton, AswButtonDialog, AswButtonModule };
//# sourceMappingURL=asoftwareworld-form-builder-form-control-button.mjs.map
