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 i2$1 from '@angular/material/form-field';
import * as i5 from '@angular/material/select';
import { MatSelectModule } from '@angular/material/select';
import * as i6 from '@angular/material/core';
import * as i7 from '@angular/material/slide-toggle';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import * as i8 from '@angular/material/input';
import { MatInputModule } from '@angular/material/input';
import * as i9 from '@angular/material/tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import * as i10 from '@angular/common';
import { CommonModule } from '@angular/common';
import { MatIconModule } from '@angular/material/icon';

/**
 * @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 AswTextareaDialog {
    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.aswEditTextAreaForm = this.formBuilder.group({
            tooltip: ['', []],
            label: ['', [Validators.required, Validators.minLength(4), Validators.maxLength(25)]],
            name: ['', [Validators.required, Validators.minLength(4), Validators.maxLength(25)]],
            value: ['', []],
            style: ['', [Validators.required]],
            column: [''],
            maxlength: ['', [Validators.required,
                    Validators.minLength(1),
                    Validators.maxLength(3),
                    Validators.pattern(this.constants.matchPattern.numberPattern)]],
            minlength: ['', [Validators.required,
                    Validators.minLength(1),
                    Validators.maxLength(3),
                    Validators.pattern(this.constants.matchPattern.numberPattern)]],
            isRequired: [false]
        });
    }
    editProperty(control) {
        this.aswEditTextAreaForm.setValue({
            tooltip: control.tooltip,
            label: control.label,
            name: control.name,
            value: control.value,
            maxlength: control.maxlength,
            minlength: control.minlength,
            style: control.style,
            column: control.column,
            isRequired: control.isRequired
        });
    }
    onNoClick() {
        this.dialogRef.close();
    }
    onSubmit() {
        if (this.aswEditTextAreaForm.invalid) {
            return;
        }
        this.aswEditTextAreaForm.value.controlType = this.control.controlType;
        this.dialogRef.close(this.aswEditTextAreaForm.value);
    }
    onChange(event) {
        if (event.checked) {
            this.status = true;
        }
        else {
            this.status = false;
        }
    }
}
AswTextareaDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AswTextareaDialog, deps: [{ token: i1.FormBuilder }, { token: i2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
AswTextareaDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: AswTextareaDialog, selector: "asw-textarea-dialog", ngImport: i0, template: "<h4 mat-dialog-title>Edit Property</h4>\r\n<mat-divider></mat-divider>\r\n<form [formGroup]=\"aswEditTextAreaForm\" (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\" class=\"asw-mat-form-field\">\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 class=\"asw-mat-error\" *ngFor=\"let validation of constants.accountValidationMessages.label\">\r\n                            <mat-error class=\"asw-mat-error\" *ngIf=\"aswEditTextAreaForm.get('label')?.hasError(validation.type) && (aswEditTextAreaForm.get('label')?.dirty || aswEditTextAreaForm.get('label')?.touched)\">\r\n                                {{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\" class=\"asw-mat-form-field\">\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            <div class=\"row\">\r\n                <div class=\"col-md-12\">\r\n                    <mat-form-field appearance=\"outline\" class=\"asw-mat-form-field\">\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 class=\"asw-mat-error\" *ngFor=\"let validation of constants.accountValidationMessages.name\">\r\n                            <mat-error class=\"asw-mat-error\" *ngIf=\"aswEditTextAreaForm.get('name')?.hasError(validation.type) && (aswEditTextAreaForm.get('name')?.dirty || aswEditTextAreaForm.get('name')?.touched)\">\r\n                                {{validation.message}}\r\n                            </mat-error>\r\n                        </mat-error>\r\n                    </mat-form-field>\r\n                </div>\r\n            </div>\r\n            <div class=\"row\">\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\" class=\"asw-mat-form-field\">\r\n                        <mat-label>Value</mat-label>\r\n                        <input matInput type=\"text\"\r\n                                        name=\"value\"\r\n                                        placeholder=\"Enter value\"\r\n                                        matTooltip=\"Enter value\"\r\n                                        formControlName=\"value\">\r\n                    </mat-form-field>\r\n                </div>\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\" class=\"asw-mat-form-field\">\r\n                        <mat-label>Textarea Style</mat-label>\r\n                        <mat-select formControlName=\"style\" matTooltip=\"Select textarea style\">\r\n                            <mat-option value=\"legacy\">Legacy</mat-option>\r\n                            <mat-option value=\"standard\">Standard</mat-option>\r\n                            <mat-option value=\"fill\">Fill</mat-option>\r\n                            <mat-option value=\"outline\">Outline</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-form-field appearance=\"outline\" class=\"asw-mat-form-field\">\r\n                        <mat-label>Column Size</mat-label>\r\n                        <mat-select formControlName=\"column\" matTooltip=\"Select column size\">\r\n                            <mat-option *ngFor=\"let column of constants.columns\" [value]=\"column.value\">\r\n                                {{column.label}}\r\n                            </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-6\">\r\n                    <mat-form-field appearance=\"outline\" class=\"asw-mat-form-field\">\r\n                        <mat-label>Min Length</mat-label>\r\n                        <input matInput type=\"text\"\r\n                                        name=\"minlength\"\r\n                                        placeholder=\"Enter minlength\"\r\n                                        matTooltip=\"Enter minlength\"\r\n                                        maxlength=\"3\"\r\n                                        minlength=\"1\"\r\n                                        pattern=\"^[0-9]*$\"\r\n                                        formControlName=\"minlength\" required>\r\n                        <mat-error class=\"asw-mat-error\" *ngFor=\"let validation of constants.accountValidationMessages.minlength\">\r\n                            <mat-error class=\"asw-mat-error\" *ngIf=\"aswEditTextAreaForm.get('minlength')?.hasError(validation.type)\">\r\n                                {{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\" class=\"asw-mat-form-field\">\r\n                        <mat-label>Max Length</mat-label>\r\n                        <input matInput type=\"text\"\r\n                                        name=\"maxlength\"\r\n                                        placeholder=\"Enter maxlength\"\r\n                                        matTooltip=\"Enter maxlength\"\r\n                                        minlength=\"1\"\r\n                                        maxlength=\"3\"\r\n                                        pattern=\"^[0-9]*$\"\r\n                                        formControlName=\"maxlength\" required>\r\n                        <mat-error class=\"asw-mat-error\" *ngFor=\"let validation of constants.accountValidationMessages.maxlength\">\r\n                            <mat-error class=\"asw-mat-error\" *ngIf=\"aswEditTextAreaForm.get('maxlength')?.hasError(validation.type)\">\r\n                                {{validation.message}}\r\n                            </mat-error>\r\n                        </mat-error>\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 me-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: i2$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i7.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"] }], 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: i2$1.MatLabel, selector: "mat-label" }, { type: i8.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: i9.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: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.MatError, selector: "mat-error", inputs: ["id"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AswTextareaDialog, decorators: [{
            type: Component,
            args: [{ selector: 'asw-textarea-dialog', template: "<h4 mat-dialog-title>Edit Property</h4>\r\n<mat-divider></mat-divider>\r\n<form [formGroup]=\"aswEditTextAreaForm\" (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\" class=\"asw-mat-form-field\">\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 class=\"asw-mat-error\" *ngFor=\"let validation of constants.accountValidationMessages.label\">\r\n                            <mat-error class=\"asw-mat-error\" *ngIf=\"aswEditTextAreaForm.get('label')?.hasError(validation.type) && (aswEditTextAreaForm.get('label')?.dirty || aswEditTextAreaForm.get('label')?.touched)\">\r\n                                {{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\" class=\"asw-mat-form-field\">\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            <div class=\"row\">\r\n                <div class=\"col-md-12\">\r\n                    <mat-form-field appearance=\"outline\" class=\"asw-mat-form-field\">\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 class=\"asw-mat-error\" *ngFor=\"let validation of constants.accountValidationMessages.name\">\r\n                            <mat-error class=\"asw-mat-error\" *ngIf=\"aswEditTextAreaForm.get('name')?.hasError(validation.type) && (aswEditTextAreaForm.get('name')?.dirty || aswEditTextAreaForm.get('name')?.touched)\">\r\n                                {{validation.message}}\r\n                            </mat-error>\r\n                        </mat-error>\r\n                    </mat-form-field>\r\n                </div>\r\n            </div>\r\n            <div class=\"row\">\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\" class=\"asw-mat-form-field\">\r\n                        <mat-label>Value</mat-label>\r\n                        <input matInput type=\"text\"\r\n                                        name=\"value\"\r\n                                        placeholder=\"Enter value\"\r\n                                        matTooltip=\"Enter value\"\r\n                                        formControlName=\"value\">\r\n                    </mat-form-field>\r\n                </div>\r\n                <div class=\"col-md-6\">\r\n                    <mat-form-field appearance=\"outline\" class=\"asw-mat-form-field\">\r\n                        <mat-label>Textarea Style</mat-label>\r\n                        <mat-select formControlName=\"style\" matTooltip=\"Select textarea style\">\r\n                            <mat-option value=\"legacy\">Legacy</mat-option>\r\n                            <mat-option value=\"standard\">Standard</mat-option>\r\n                            <mat-option value=\"fill\">Fill</mat-option>\r\n                            <mat-option value=\"outline\">Outline</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-form-field appearance=\"outline\" class=\"asw-mat-form-field\">\r\n                        <mat-label>Column Size</mat-label>\r\n                        <mat-select formControlName=\"column\" matTooltip=\"Select column size\">\r\n                            <mat-option *ngFor=\"let column of constants.columns\" [value]=\"column.value\">\r\n                                {{column.label}}\r\n                            </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-6\">\r\n                    <mat-form-field appearance=\"outline\" class=\"asw-mat-form-field\">\r\n                        <mat-label>Min Length</mat-label>\r\n                        <input matInput type=\"text\"\r\n                                        name=\"minlength\"\r\n                                        placeholder=\"Enter minlength\"\r\n                                        matTooltip=\"Enter minlength\"\r\n                                        maxlength=\"3\"\r\n                                        minlength=\"1\"\r\n                                        pattern=\"^[0-9]*$\"\r\n                                        formControlName=\"minlength\" required>\r\n                        <mat-error class=\"asw-mat-error\" *ngFor=\"let validation of constants.accountValidationMessages.minlength\">\r\n                            <mat-error class=\"asw-mat-error\" *ngIf=\"aswEditTextAreaForm.get('minlength')?.hasError(validation.type)\">\r\n                                {{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\" class=\"asw-mat-form-field\">\r\n                        <mat-label>Max Length</mat-label>\r\n                        <input matInput type=\"text\"\r\n                                        name=\"maxlength\"\r\n                                        placeholder=\"Enter maxlength\"\r\n                                        matTooltip=\"Enter maxlength\"\r\n                                        minlength=\"1\"\r\n                                        maxlength=\"3\"\r\n                                        pattern=\"^[0-9]*$\"\r\n                                        formControlName=\"maxlength\" required>\r\n                        <mat-error class=\"asw-mat-error\" *ngFor=\"let validation of constants.accountValidationMessages.maxlength\">\r\n                            <mat-error class=\"asw-mat-error\" *ngIf=\"aswEditTextAreaForm.get('maxlength')?.hasError(validation.type)\">\r\n                                {{validation.message}}\r\n                            </mat-error>\r\n                        </mat-error>\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 me-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 AswTextarea {
    constructor(dialog) {
        this.dialog = dialog;
        this.constants = Constants;
        /**
         * TextArea control
         */
        this.control = null;
        this.isPreviewTemplate = false;
        this.textAreaUpdateEvent = new EventEmitter();
        this.textAreaDeleteEvent = new EventEmitter();
    }
    deleteTextAreaDialog(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.textAreaDeleteEvent.emit(controlIndex);
            }
        });
    }
    editTextAreaDialog(control, controlIndex) {
        const dialogRef = this.dialog.open(AswTextareaDialog, {
            disableClose: true,
            width: '744px',
            data: control
        });
        dialogRef.afterClosed().subscribe(result => {
            if (result !== undefined) {
                this.textAreaUpdateEvent.emit({ control: result, index: controlIndex });
            }
        });
    }
}
AswTextarea.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AswTextarea, deps: [{ token: i2.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
AswTextarea.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: AswTextarea, selector: "asw-textarea", inputs: { control: "control", controlIndex: "controlIndex", isPreviewTemplate: "isPreviewTemplate" }, outputs: { textAreaUpdateEvent: "textAreaUpdateEvent", textAreaDeleteEvent: "textAreaDeleteEvent" }, ngImport: i0, template: "<ng-container *ngIf=\"control as control\">\r\n    <mat-form-field hintLabel=\"Max {{control.maxlength}} characters\" [appearance]=\"control.style\" class=\"asw-mat-form-field\">\r\n        <mat-label>{{control.label}}</mat-label>\r\n        <textarea matInput [name]=\"control.name\"\r\n                        type=\"text\"\r\n                        [placeholder]=\"control.label\"\r\n                        [(ngModel)]=\"control.value\"\r\n                        #input=\"ngModel\"\r\n                        [matTooltip]=\"control.tooltip\"\r\n                        [maxlength]=\"control.maxlength\"\r\n                        [minlength]=\"control.minlength\"\r\n                        [required]=\"control.isRequired\"></textarea>\r\n        <mat-hint align=\"end\">{{input.value?.length || 0}}/{{control.maxlength}}</mat-hint>  \r\n        <mat-error class=\"asw-mat-error\" *ngIf=\"input.invalid && (input.dirty || input.touched)\">\r\n            <mat-error class=\"asw-mat-error\" *ngIf=\"input?.errors?.required\">\r\n                {{control.label}} is required\r\n            </mat-error>\r\n            <mat-error class=\"asw-mat-error\" *ngIf=\"input?.errors?.minlength\">\r\n                Sorry, {{control.label}} must be at least {{control.minlength}} characters long.\r\n            </mat-error>\r\n        </mat-error>\r\n    </mat-form-field>\r\n    <ng-template [ngIf]=\"isPreviewTemplate\">\r\n        <div class=\"row\">\r\n            <div class=\"col-md-12\">\r\n                <button mat-raised-button \r\n                        type=\"button\" \r\n                        matTooltip=\"Edit textarea control\" \r\n                        [matTooltipPosition]=\"'above'\" \r\n                        (click)=\"editTextAreaDialog(control, controlIndex)\"\r\n                        class=\"asw-btn btn btn-just-icon btn-sm btn-outline-success mr-2 me-2 mb-1\">\r\n                    <i class=\"material-icons asw-material-icon\">edit</i>\r\n                </button>\r\n                <button mat-raised-button \r\n                        type=\"button\" \r\n                        matTooltip=\"Remove textarea control\" \r\n                        [matTooltipPosition]=\"'above'\" \r\n                        (click)=\"deleteTextAreaDialog(control, controlIndex)\"\r\n                        class=\"asw-btn btn btn-just-icon btn-sm btn-outline-danger mb-1\">\r\n                    <i class=\"material-icons asw-material-icon\">close</i>\r\n                </button>\r\n            </div>                                            \r\n        </div>\r\n    </ng-template>    \r\n</ng-container>\r\n", components: [{ type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.MatLabel, selector: "mat-label" }, { type: i8.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i2$1.MatError, selector: "mat-error", inputs: ["id"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AswTextarea, decorators: [{
            type: Component,
            args: [{ selector: 'asw-textarea', template: "<ng-container *ngIf=\"control as control\">\r\n    <mat-form-field hintLabel=\"Max {{control.maxlength}} characters\" [appearance]=\"control.style\" class=\"asw-mat-form-field\">\r\n        <mat-label>{{control.label}}</mat-label>\r\n        <textarea matInput [name]=\"control.name\"\r\n                        type=\"text\"\r\n                        [placeholder]=\"control.label\"\r\n                        [(ngModel)]=\"control.value\"\r\n                        #input=\"ngModel\"\r\n                        [matTooltip]=\"control.tooltip\"\r\n                        [maxlength]=\"control.maxlength\"\r\n                        [minlength]=\"control.minlength\"\r\n                        [required]=\"control.isRequired\"></textarea>\r\n        <mat-hint align=\"end\">{{input.value?.length || 0}}/{{control.maxlength}}</mat-hint>  \r\n        <mat-error class=\"asw-mat-error\" *ngIf=\"input.invalid && (input.dirty || input.touched)\">\r\n            <mat-error class=\"asw-mat-error\" *ngIf=\"input?.errors?.required\">\r\n                {{control.label}} is required\r\n            </mat-error>\r\n            <mat-error class=\"asw-mat-error\" *ngIf=\"input?.errors?.minlength\">\r\n                Sorry, {{control.label}} must be at least {{control.minlength}} characters long.\r\n            </mat-error>\r\n        </mat-error>\r\n    </mat-form-field>\r\n    <ng-template [ngIf]=\"isPreviewTemplate\">\r\n        <div class=\"row\">\r\n            <div class=\"col-md-12\">\r\n                <button mat-raised-button \r\n                        type=\"button\" \r\n                        matTooltip=\"Edit textarea control\" \r\n                        [matTooltipPosition]=\"'above'\" \r\n                        (click)=\"editTextAreaDialog(control, controlIndex)\"\r\n                        class=\"asw-btn btn btn-just-icon btn-sm btn-outline-success mr-2 me-2 mb-1\">\r\n                    <i class=\"material-icons asw-material-icon\">edit</i>\r\n                </button>\r\n                <button mat-raised-button \r\n                        type=\"button\" \r\n                        matTooltip=\"Remove textarea control\" \r\n                        [matTooltipPosition]=\"'above'\" \r\n                        (click)=\"deleteTextAreaDialog(control, controlIndex)\"\r\n                        class=\"asw-btn btn btn-just-icon btn-sm btn-outline-danger mb-1\">\r\n                    <i class=\"material-icons asw-material-icon\">close</i>\r\n                </button>\r\n            </div>                                            \r\n        </div>\r\n    </ng-template>    \r\n</ng-container>\r\n" }]
        }], ctorParameters: function () { return [{ type: i2.MatDialog }]; }, propDecorators: { control: [{
                type: Input
            }], controlIndex: [{
                type: Input
            }], isPreviewTemplate: [{
                type: Input
            }], textAreaUpdateEvent: [{
                type: Output
            }], textAreaDeleteEvent: [{
                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 AswTextareaModule {
}
AswTextareaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AswTextareaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
AswTextareaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AswTextareaModule, declarations: [AswTextarea,
        AswTextareaDialog], imports: [CommonModule,
        FormsModule,
        ReactiveFormsModule,
        MatInputModule,
        MatSelectModule,
        MatDialogModule,
        MatSlideToggleModule,
        MatTooltipModule,
        MatDividerModule,
        MatIconModule,
        AswConfirmDialogModule], exports: [AswTextarea,
        AswTextareaDialog] });
AswTextareaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AswTextareaModule, imports: [[
            CommonModule,
            FormsModule,
            ReactiveFormsModule,
            MatInputModule,
            MatSelectModule,
            MatDialogModule,
            MatSlideToggleModule,
            MatTooltipModule,
            MatDividerModule,
            MatIconModule,
            AswConfirmDialogModule
        ]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AswTextareaModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        CommonModule,
                        FormsModule,
                        ReactiveFormsModule,
                        MatInputModule,
                        MatSelectModule,
                        MatDialogModule,
                        MatSlideToggleModule,
                        MatTooltipModule,
                        MatDividerModule,
                        MatIconModule,
                        AswConfirmDialogModule
                    ],
                    declarations: [
                        AswTextarea,
                        AswTextareaDialog
                    ],
                    exports: [
                        AswTextarea,
                        AswTextareaDialog
                    ]
                }]
        }] });

/**
 * @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 { AswTextarea, AswTextareaDialog, AswTextareaModule };
//# sourceMappingURL=asoftwareworld-form-builder-form-control-textarea.mjs.map
