UNPKG

@asoftwareworld/form-builder-pro

Version:

ASW Form Builder Pro helps you with rapid development and designed web forms which includes several controls. The key feature of Form Builder is to make your content attractive and effective. We can customize our control at run time and preview the same b

138 lines 137 kB
/** * @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 */ import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { Component, Inject } from '@angular/core'; import { Validators } from '@angular/forms'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; import { Constants, Icons } from '@asoftwareworld/form-builder-pro/common'; import { ObjectUtils } from '@asoftwareworld/form-builder-pro/utils'; import { map, startWith } from 'rxjs'; import * as i0 from "@angular/core"; import * as i1 from "@angular/forms"; import * as i2 from "@angular/material/dialog"; import * as i3 from "@angular/common"; import * as i4 from "@angular/material/autocomplete"; import * as i5 from "@angular/material/core"; import * as i6 from "@angular/material/button"; import * as i7 from "@angular/material/input"; import * as i8 from "@angular/material/form-field"; import * as i9 from "@angular/material/select"; import * as i10 from "@angular/material/slide-toggle"; import * as i11 from "@angular/material/tabs"; import * as i12 from "@angular/material/tooltip"; import * as i13 from "@angular/material/chips"; import * as i14 from "@angular/material/icon"; import * as i15 from "@asoftwareworld/form-builder-pro/common"; import * as i16 from "@asoftwareworld/form-builder-pro/core"; export class AswTextDialog { formBuilder; dialogRef; data; decimals = 100; constants = Constants; objectUtils = ObjectUtils; icons = Icons; aswEditTextForm; status; control; filteredPatterns; separatorKeysCodes = [ENTER, COMMA]; constructor(formBuilder, dialogRef, data) { this.formBuilder = formBuilder; this.dialogRef = dialogRef; this.data = data; } ngOnInit() { this.control = this.data.control; this.validateFormBuilder(); this.filteredPatterns = this.aswEditTextForm.get('pattern')?.valueChanges.pipe(startWith(''), map((value) => this._filter(value || ''))); this.editProperty(this.control); } _filter(value) { const filterValue = value.toLowerCase(); return this.data.patterns.filter((option) => option.value.toLowerCase().includes(filterValue)); } validateFormBuilder() { this.aswEditTextForm = this.formBuilder.group({ id: ['', [Validators.required]], tooltip: ['', []], label: ['', [Validators.required, Validators.minLength(2)]], value: ['', []], style: ['', [Validators.required]], pattern: [''], customClass: [''], customErrorMsg: [''], maxlength: [''], minlength: [''], isRequired: [false], isDisabled: [false], currencySymbol: [''] }); } editProperty(control) { this.aswEditTextForm.setValue({ id: control.id, tooltip: control.tooltip, label: control.label, pattern: control.pattern ?? '', customClass: control.customClass ?? '', customErrorMsg: control.customErrorMsg ?? '', value: control.value ?? '', maxlength: control.maxlength ?? '', minlength: control.minlength ?? '', style: control.style, isRequired: control.isRequired, isDisabled: control.isDisabled, currencySymbol: control.currencySymbol ?? '' }); } onNoClick() { this.dialogRef.close(); } onSubmit() { if (this.aswEditTextForm.invalid) { return; } this.aswEditTextForm.value.controlType = this.control.controlType; this.aswEditTextForm.value.guid = this.control.guid; this.dialogRef.close(this.aswEditTextForm.value); } onStatusChange(event) { this.status = event.checked ? true : false; if (event.checked === undefined) { this.status = event.target.checked ? true : false; } } getApiData(data) { if (data?.value) { this.aswEditTextForm.patchValue({ value: data.value }); } } addTags(event) { const value = (event.value || '').trim(); // Add our fruit if (value) { this.control.value.push(value); } // Clear the input value event?.chipInput?.clear(); } removeTags(value) { const index = this.control.value.indexOf(value); if (index >= 0) { this.control.value.splice(index, 1); } } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: AswTextDialog, deps: [{ token: i1.FormBuilder }, { token: i2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.8", type: AswTextDialog, selector: "asw-text-dialog", ngImport: i0, template: "<div class=\"asw-dialog-header\">\r\n <div class=\"asw-edit-row-dialog\">\r\n <div class=\"asw-dialog-header clearfix\">\r\n <div class=\"asw-dialog-about\">\r\n <h1 mat-dialog-title class=\"asw-m-0\">{{'FormControl.Edit' | aswTranslate}} {{control.label | aswTranslate}}</h1>\r\n </div>\r\n </div>\r\n </div>\r\n <button mat-icon-button (click)=\"onNoClick()\" aria-label=\"Close dialog\" class=\"asw-mt-2 asw-me-2\">\r\n <div [innerHTML]=\"icons.close | aswSafeHtml\"></div>\r\n </button>\r\n</div>\r\n<form [formGroup]=\"aswEditTextForm\" (ngSubmit)=\"onSubmit()\">\r\n <div mat-dialog-content>\r\n <mat-tab-group dynamicHeight mat-stretch-tabs=\"false\">\r\n <mat-tab label=\"{{'FormControl.Properties' | aswTranslate}}\">\r\n <ng-container *ngIf=\"data.CSSFramework === 'material'; else bootstrap\">\r\n <div class=\"asw-row asw-px-2 asw-py-3\">\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('uniqueId')\">\r\n <div class=\"asw-col-md-12\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.UniqueId' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\"\r\n name=\"id\"\r\n placeholder=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n formControlName=\"id\" required>\r\n <mat-icon *ngIf=\"aswEditTextForm.get('id')?.invalid && (aswEditTextForm.get('id')?.dirty || aswEditTextForm.get('id')?.touched)\"\r\n class=\"asw-error\" matSuffix>error</mat-icon>\r\n <mat-error *ngFor=\"let validation of constants.accountValidationMessages.id\">\r\n <ng-container *ngIf=\"aswEditTextForm.get('id')?.hasError(validation.type) && (aswEditTextForm.get('id')?.dirty || aswEditTextForm.get('id')?.touched)\">\r\n {{validation.message | aswTranslate}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n <div class=\"asw-col-md-6\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.Label' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\"\r\n name=\"label\"\r\n placeholder=\"{{'FormControl.Label' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.Label' | aswTranslate}}\"\r\n formControlName=\"label\" required>\r\n <mat-icon *ngIf=\"aswEditTextForm.get('label')?.invalid && (aswEditTextForm.get('label')?.dirty || aswEditTextForm.get('label')?.touched)\"\r\n class=\"asw-error\" matSuffix>error</mat-icon>\r\n <mat-error *ngFor=\"let validation of constants.accountValidationMessages.label\">\r\n <ng-container *ngIf=\"aswEditTextForm.get('label')?.hasError(validation.type) && (aswEditTextForm.get('label')?.dirty || aswEditTextForm.get('label')?.touched)\">\r\n {{validation.message | aswTranslate}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"asw-col-md-6\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.Tooltip' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\"\r\n name=\"tooltip\"\r\n placeholder=\"{{'FormControl.Tooltip' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.Tooltip' | aswTranslate}}\"\r\n formControlName=\"tooltip\">\r\n </mat-form-field>\r\n </div>\r\n <ng-container *ngIf=\"control.controlType === 'currency'\">\r\n <div class=\"asw-col-md-12\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.CurrencySymbol' | aswTranslate}}</mat-label>\r\n <mat-select formControlName=\"currencySymbol\"\r\n placeholder=\"{{'FormControl.CurrencySymbol' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.CurrencySymbol' | aswTranslate}}\">\r\n <mat-option *ngFor=\"let option of constants.currencySymbol\" [value]=\"option.key\">\r\n {{ option.value }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n <div class=\"{{control.controlType === 'tags' ? 'asw-col-md-12' : control.controlType === 'currency' ? 'asw-col-md-6' : 'asw-col-md-6'}}\">\r\n <ng-container *ngIf=\"control.controlType === 'number' || control.controlType === 'currency'\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.Value' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\" aswNumbersOnly\r\n name=\"value\"\r\n placeholder=\"{{'FormControl.Value' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.Value' | aswTranslate}}\"\r\n formControlName=\"value\">\r\n </mat-form-field>\r\n </ng-container>\r\n \r\n <ng-container *ngIf=\"control.controlType === 'tags'\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.Value' | aswTranslate}}</mat-label>\r\n <mat-chip-grid #tagList aria-label=\"Fruit selection\">\r\n <mat-chip-row\r\n *ngFor=\"let v of control.value\"\r\n (removed)=\"removeTags(v)\">\r\n {{v}}\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n <input\r\n placeholder=\"{{'FormControl.Value' | aswTranslate}}\"\r\n name=\"value\"\r\n matTooltip=\"{{'FormControl.Value' | aswTranslate}}\"\r\n [matChipInputFor]=\"tagList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"addTags($event)\">\r\n </mat-chip-grid>\r\n </mat-form-field>\r\n </ng-container>\r\n <ng-container *ngIf=\"control.controlType !== 'number' && control.controlType !== 'tags' && control.controlType !== 'currency'\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.Value' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\"\r\n name=\"value\"\r\n placeholder=\"{{'FormControl.Value' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.Value' | aswTranslate}}\"\r\n formControlName=\"value\">\r\n </mat-form-field>\r\n </ng-container>\r\n </div>\r\n <div class=\"asw-col-md-6\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.Style' | aswTranslate}}</mat-label>\r\n <mat-select formControlName=\"style\" matTooltip=\"{{'FormControl.SelectStyle' | aswTranslate}}\">\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 <ng-container *ngIf=\"control.controlType !== 'tags'\">\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('inputMask') && !data.propertyPersonalization.includes('inputMaskCustomErrorMsg')\">\r\n <div class=\"asw-col-md-6\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.InputMask' | aswTranslate}}</mat-label>\r\n <input type=\"text\"\r\n name=\"pattern\"\r\n [matAutocomplete]=\"inputMaskPattern\"\r\n matInput\r\n formControlName=\"pattern\"\r\n placeholder=\"{{'FormControl.InputMask' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.InputMask' | aswTranslate}}\">\r\n <mat-autocomplete autoActiveFirstOption #inputMaskPattern=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of filteredPatterns | async\" [value]=\"option.key\">\r\n {{option.value}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"asw-col-md-6\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.InputMaskCustomErrorMsg' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\"\r\n name=\"customErrorMsg\"\r\n placeholder=\"{{'FormControl.InputMaskCustomErrorMsg' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.InputMaskCustomErrorMsg' | aswTranslate}}\"\r\n formControlName=\"customErrorMsg\">\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('customCSSClass')\">\r\n <div class=\"asw-col-md-12\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.CustomCSSClass' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\"\r\n name=\"customClass\"\r\n placeholder=\"{{'FormControl.CustomCSSClass' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.CustomCSSClass' | aswTranslate}}\"\r\n formControlName=\"customClass\">\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"control.controlType !== 'tags'\">\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('minLength')\">\r\n <div class=\"asw-col-md-6\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.MinLength' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\"\r\n name=\"minlength\"\r\n placeholder=\"{{'FormControl.MinLength' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.MinLength' | aswTranslate}}\"\r\n maxlength=\"3\"\r\n minlength=\"1\"\r\n pattern=\"^[0-9]*$\"\r\n formControlName=\"minlength\">\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('maxLength')\">\r\n <div class=\"asw-col-md-6\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.MaxLength' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\"\r\n name=\"maxlength\"\r\n placeholder=\"{{'FormControl.MaxLength' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.MaxLength' | aswTranslate}}\"\r\n formControlName=\"maxlength\">\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <div class=\"asw-col-md-2\">\r\n <mat-slide-toggle color=\"primary\"\r\n #isActive\r\n formControlName=\"isRequired\"\r\n (change)=\"onStatusChange($event)\">\r\n {{(status ? 'FormControl.Required' : 'FormControl.NotRequired') | aswTranslate}}\r\n </mat-slide-toggle>\r\n </div>\r\n <div class=\"asw-col-md-2\">\r\n <mat-slide-toggle color=\"primary\"\r\n #isDisable\r\n formControlName=\"isDisabled\">\r\n {{'FormControl.Readonly' | aswTranslate}}\r\n </mat-slide-toggle>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-template #bootstrap>\r\n <div class=\"asw-row asw-px-2 asw-py-3\">\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('uniqueId')\">\r\n <div class=\"asw-col-md-12\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label asw-invalid-label {{(aswEditTextForm.get('id')?.invalid && (aswEditTextForm.get('id')?.dirty || aswEditTextForm.get('id')?.touched)) ? 'asw-red-color' : ''}}\">{{'FormControl.UniqueId' | aswTranslate}}</label>\r\n <input type=\"text\"\r\n name=\"id\"\r\n class=\"asw-input-control\"\r\n matTooltip=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n [class.asw-is-invalid]=\"(aswEditTextForm.get('id')?.invalid && (aswEditTextForm.get('id')?.dirty || aswEditTextForm.get('id')?.touched))\"\r\n formControlName=\"id\" required>\r\n <div *ngFor=\"let validation of constants.accountValidationMessages.id\" class=\"invalid-feedback\">\r\n <ng-container *ngIf=\"aswEditTextForm.get('id')?.hasError(validation.type) && (aswEditTextForm.get('id')?.dirty || aswEditTextForm.get('id')?.touched)\">\r\n {{validation.message | aswTranslate}}\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container> \r\n <div class=\"asw-col-md-6\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label asw-invalid-label {{(aswEditTextForm.get('label')?.invalid && (aswEditTextForm.get('label')?.dirty || aswEditTextForm.get('label')?.touched)) ? 'asw-red-color' : ''}}\">{{'FormControl.Label' | aswTranslate}}</label>\r\n <input type=\"text\"\r\n name=\"label\"\r\n class=\"asw-input-control\"\r\n [class.asw-is-invalid]=\"(aswEditTextForm.get('label')?.invalid && (aswEditTextForm.get('label')?.dirty || aswEditTextForm.get('label')?.touched))\"\r\n matTooltip=\"{{'FormControl.Label' | aswTranslate}}\"\r\n formControlName=\"label\" required>\r\n <div *ngFor=\"let validation of constants.accountValidationMessages.label\" class=\"invalid-feedback\">\r\n <ng-container *ngIf=\"aswEditTextForm.get('label')?.hasError(validation.type) && (aswEditTextForm.get('label')?.dirty || aswEditTextForm.get('label')?.touched)\">\r\n {{validation.message | aswTranslate}}\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"asw-col-md-6\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label\">{{'FormControl.Tooltip' | aswTranslate}}</label>\r\n <input type=\"text\"\r\n name=\"tooltip\"\r\n class=\"asw-input-control\"\r\n matTooltip=\"{{'FormControl.Tooltip' | aswTranslate}}\"\r\n formControlName=\"tooltip\">\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"control.controlType === 'currency'\">\r\n <div class=\"asw-col-md-12\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label\">{{'FormControl.CurrencySymbol' | aswTranslate}}</label>\r\n <select formControlName=\"currencySymbol\" \r\n class=\"asw-select\"\r\n matTooltip=\"{{'FormControl.CurrencySymbol' | aswTranslate}}\">\r\n <option *ngFor=\"let option of constants.currencySymbol\" [value]=\"option.key\">\r\n {{ option.value }}\r\n </option>\r\n </select>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"{{control.controlType === 'tags' ? 'asw-col-md-12' : control.controlType === 'currency' ? 'asw-col-md-12' : 'asw-col-md-12'}}\">\r\n <ng-container *ngIf=\"control.controlType === 'number' || control.controlType === 'currency'\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label\">{{'FormControl.Value' | aswTranslate}}</label>\r\n <input type=\"text\" aswNumbersOnly\r\n name=\"value\"\r\n class=\"asw-input-control\"\r\n matTooltip=\"{{'FormControl.Value' | aswTranslate}}\"\r\n formControlName=\"value\">\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"control.controlType === 'tags'\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.Value' | aswTranslate}}</mat-label>\r\n <mat-chip-grid #tagList aria-label=\"Fruit selection\">\r\n <mat-chip-row\r\n *ngFor=\"let v of control.value\"\r\n (removed)=\"removeTags(v)\">\r\n {{v}}\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n <input\r\n placeholder=\"{{'FormControl.Value' | aswTranslate}}\"\r\n name=\"value\"\r\n matTooltip=\"{{'FormControl.Value' | aswTranslate}}\"\r\n [matChipInputFor]=\"tagList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"addTags($event)\">\r\n </mat-chip-grid>\r\n </mat-form-field>\r\n </ng-container>\r\n <ng-container *ngIf=\"control.controlType !== 'number' && control.controlType !== 'tags' && control.controlType !== 'currency'\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label\">{{'FormControl.Value' | aswTranslate}}</label>\r\n <input type=\"text\"\r\n name=\"value\"\r\n class=\"asw-input-control\"\r\n matTooltip=\"{{'FormControl.Value' | aswTranslate}}\"\r\n formControlName=\"value\">\r\n </div>\r\n </ng-container>\r\n </div>\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('customCSSClass')\">\r\n <div class=\"asw-col-md-6\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label\">{{'FormControl.CustomCSSClass' | aswTranslate}}</label>\r\n <input type=\"text\"\r\n name=\"customClass\"\r\n class=\"asw-input-control\"\r\n matTooltip=\"{{'FormControl.CustomCSSClass' | aswTranslate}}\"\r\n formControlName=\"customClass\">\r\n </div>\r\n </div>\r\n </ng-container> \r\n <ng-container *ngIf=\"control.controlType !== 'tags'\">\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('inputMask') && !data.propertyPersonalization.includes('inputMaskCustomErrorMsg')\">\r\n <div class=\"asw-col-md-6\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label\">{{'FormControl.InputMask' | aswTranslate}}</label>\r\n <input type=\"text\"\r\n name=\"pattern\"\r\n [matAutocomplete]=\"inputMaskPattern\"\r\n class=\"asw-input-control\"\r\n formControlName=\"pattern\"\r\n matTooltip=\"{{'FormControl.InputMask' | aswTranslate}}\">\r\n <mat-autocomplete autoActiveFirstOption #inputMaskPattern=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of filteredPatterns | async\" [value]=\"option.key\">\r\n {{option.value}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </div>\r\n </div>\r\n <div class=\"asw-col-md-6\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label\">{{'FormControl.InputMaskCustomErrorMsg' | aswTranslate}}</label>\r\n <input matInput type=\"text\"\r\n name=\"customErrorMsg\"\r\n class=\"asw-input-control\"\r\n matTooltip=\"{{'FormControl.InputMaskCustomErrorMsg' | aswTranslate}}\"\r\n formControlName=\"customErrorMsg\">\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"control.controlType !== 'tags'\">\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('minLength')\">\r\n <div class=\"asw-col-md-6\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label\">{{'FormControl.MinLength' | aswTranslate}}</label>\r\n <input type=\"text\"\r\n name=\"minlength\"\r\n matTooltip=\"{{'FormControl.MinLength' | aswTranslate}}\"\r\n maxlength=\"3\"\r\n class=\"asw-input-control\"\r\n minlength=\"1\"\r\n pattern=\"^[0-9]*$\"\r\n formControlName=\"minlength\">\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('maxLength')\">\r\n <div class=\"asw-col-md-6\">\r\n <div class=\"asw-mb-3\">\r\n <label class=\"asw-input-label\">{{'FormControl.MaxLength' | aswTranslate}}</label>\r\n <input type=\"text\"\r\n name=\"maxlength\"\r\n class=\"asw-input-control\"\r\n matTooltip=\"{{'FormControl.MaxLength' | aswTranslate}}\"\r\n formControlName=\"maxlength\">\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <div class=\"asw-col-md-2\">\r\n <div class=\"asw-mb-3\">\r\n <div class=\"asw-form-check asw-form-switch\">\r\n <input class=\"asw-form-check-input\" \r\n type=\"checkbox\" \r\n #isActive\r\n id=\"isActive\" \r\n formControlName=\"isRequired\"\r\n (change)=\"onStatusChange($event)\">\r\n <label class=\"asw-form-check-label\" for=\"isActive\">\r\n {{(status ? 'FormControl.Required' : 'FormControl.NotRequired') | aswTranslate}}\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"asw-col-md-2\">\r\n <div class=\"asw-mb-3\">\r\n <div class=\"asw-form-check asw-form-switch\">\r\n <input class=\"asw-form-check-input\" \r\n type=\"checkbox\"\r\n id=\"isDisable\" \r\n #isDisable\r\n formControlName=\"isDisabled\"\r\n (change)=\"onStatusChange($event)\">\r\n <label class=\"asw-form-check-label\" for=\"isDisable\">\r\n {{'FormControl.Readonly' | aswTranslate}}\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </mat-tab>\r\n <mat-tab label=\"{{'FormControl.API' | aswTranslate}}\">\r\n <asw-api-communicator (apiResponse)=\"getApiData($event)\" [CSSFramework]=\"data.CSSFramework\"></asw-api-communicator>\r\n </mat-tab>\r\n </mat-tab-group>\r\n </div>\r\n <div mat-dialog-actions align=\"end\">\r\n <button type=\"button\"\r\n class=\"asw-button asw-button-danger asw-me-2 asw-mb-1\"\r\n (click)=\"onNoClick()\">\r\n {{'FormControl.No' | aswTranslate}}\r\n </button>\r\n <button type=\"submit\"\r\n class=\"asw-button asw-button-primary asw-mb-1\"\r\n cdkFocusInitial>\r\n {{'FormControl.Yes' | aswTranslate}}\r\n </button>\r\n </div>\r\n</form>", dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", 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]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i4.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i7.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"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i8.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i8.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i9.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i10.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "component", type: i11.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i11.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "directive", type: i12.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i13.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i13.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i13.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i13.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: i14.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i15.AswCommunicatorApi, selector: "asw-api-communicator", inputs: ["CSSFramework"], outputs: ["apiResponse"] }, { kind: "directive", type: i15.AswNumberDirective, selector: "[aswNumbersOnly]" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i16.AswTranslatePipe, name: "aswTranslate" }, { kind: "pipe", type: i15.AswSafeHtmlPipe, name: "aswSafeHtml" }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: AswTextDialog, decorators: [{ type: Component, args: [{ selector: 'asw-text-dialog', template: "<div class=\"asw-dialog-header\">\r\n <div class=\"asw-edit-row-dialog\">\r\n <div class=\"asw-dialog-header clearfix\">\r\n <div class=\"asw-dialog-about\">\r\n <h1 mat-dialog-title class=\"asw-m-0\">{{'FormControl.Edit' | aswTranslate}} {{control.label | aswTranslate}}</h1>\r\n </div>\r\n </div>\r\n </div>\r\n <button mat-icon-button (click)=\"onNoClick()\" aria-label=\"Close dialog\" class=\"asw-mt-2 asw-me-2\">\r\n <div [innerHTML]=\"icons.close | aswSafeHtml\"></div>\r\n </button>\r\n</div>\r\n<form [formGroup]=\"aswEditTextForm\" (ngSubmit)=\"onSubmit()\">\r\n <div mat-dialog-content>\r\n <mat-tab-group dynamicHeight mat-stretch-tabs=\"false\">\r\n <mat-tab label=\"{{'FormControl.Properties' | aswTranslate}}\">\r\n <ng-container *ngIf=\"data.CSSFramework === 'material'; else bootstrap\">\r\n <div class=\"asw-row asw-px-2 asw-py-3\">\r\n <ng-container *ngIf=\"!data.propertyPersonalization.includes('uniqueId')\">\r\n <div class=\"asw-col-md-12\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.UniqueId' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\"\r\n name=\"id\"\r\n placeholder=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n formControlName=\"id\" required>\r\n <mat-icon *ngIf=\"aswEditTextForm.get('id')?.invalid && (aswEditTextForm.get('id')?.dirty || aswEditTextForm.get('id')?.touched)\"\r\n class=\"asw-error\" matSuffix>error</mat-icon>\r\n <mat-error *ngFor=\"let validation of constants.accountValidationMessages.id\">\r\n <ng-container *ngIf=\"aswEditTextForm.get('id')?.hasError(validation.type) && (aswEditTextForm.get('id')?.dirty || aswEditTextForm.get('id')?.touched)\">\r\n {{validation.message | aswTranslate}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n <div class=\"asw-col-md-6\">\r\n <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n <mat-label>{{'FormControl.Label' | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\"\r\n name=\"label\"\r\n placeholder=\"{{'FormControl.Label' | aswTranslate}}\"\r\n matTooltip=\"{{'FormControl.Label' | aswTranslate}}\"\r\n formControlName=\"label\" required>\r\n <mat-icon *ngIf=\"aswEditTextForm.get('label')?.invalid && (aswEditTextForm.get('label')?.dirty || aswEditTextForm.get('label')?.touched)\"\r\n