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

156 lines 59.4 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 { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; import { CSSFrameworkEnum } from '@asoftwareworld/form-builder-pro/api'; import { Constants, Icons } from '@asoftwareworld/form-builder-pro/common'; import { AswConfirmDialog } from '@asoftwareworld/form-builder-pro/form-control/confirm-dialog'; import { AswTextDialog } from '@asoftwareworld/form-builder-pro/form-control/shared'; import { ObjectUtils } from '@asoftwareworld/form-builder-pro/utils'; import * as i0 from "@angular/core"; import * as i1 from "@angular/material/dialog"; import * as i2 from "@angular/common"; import * as i3 from "@angular/forms"; import * as i4 from "@angular/material/button"; import * as i5 from "@angular/material/input"; import * as i6 from "@angular/material/form-field"; import * as i7 from "@angular/material/tooltip"; import * as i8 from "@angular/material/icon"; import * as i9 from "@asoftwareworld/form-builder-pro/common"; import * as i10 from "@asoftwareworld/form-builder-pro/core"; export class AswNumber { dialog; decimals = 100; constants = Constants; objectUtils = ObjectUtils; icons = Icons; /** * Number control */ control = null; formControls = []; CSSFramework = CSSFrameworkEnum.Material; isPreviewTemplate = false; propertyPersonalization = []; patterns = []; numberUpdateEvent = new EventEmitter(); numberDeleteEvent = new EventEmitter(); aswModelChange = new EventEmitter(); duplicateControl = new EventEmitter(); numberInput; currencyInput; constructor(dialog) { this.dialog = dialog; } ngAfterViewInit() { switch (this.control?.controlType) { case 'number': { this.numberInput.valueChanges.subscribe(() => { this.onChange(this.control ? this.control : null); }); break; } case 'currency': { this.currencyInput.valueChanges.subscribe(() => { this.onChange(this.control ? this.control : null); }); break; } } } deleteNumberDialog(control) { const dialogRef = this.dialog.open(AswConfirmDialog, { width: '350px', data: { name: control.controlType, message: this.constants.messages.waringMessage } }); dialogRef.afterClosed().subscribe((result) => { if (result !== undefined) { this.numberDeleteEvent.emit(control); } }); } editNumberDialog(control) { const dialogRef = this.dialog.open(AswTextDialog, { width: '80%', minWidth: '70vw', disableClose: true, data: { control, CSSFramework: this.CSSFramework, propertyPersonalization: this.propertyPersonalization, patterns: this.patterns } }); dialogRef.afterClosed().subscribe((result) => { if (result !== undefined) { this.numberUpdateEvent.emit(result); } }); } onChange(control) { this.setParentCalculations(control, this.formControls); this.setChildCalculations(control, this.formControls); this.aswModelChange.emit(control); } setParentCalculations(control, formControls) { const calculationControls = formControls.filter((x) => x.controlType === 'calculation'); calculationControls.forEach((calculation) => { const updateControls = calculation.operations.filter((x) => x.id === control.guid); updateControls.forEach((y) => { y.label = control.label; y.value = control.value; }); calculation.value = this.objectUtils.calculateValue(calculation.operations); }); } setChildCalculations(control, formControls) { const columnControls = formControls.filter((x) => x.controlType === 'columns'); columnControls.forEach((columnControl) => { columnControl.columns.forEach((column) => { const calculationItems = column.components.filter((component) => component.controlType === 'calculation'); if (calculationItems.length) { this.setParentCalculations(control, column.components); } const columnItems = column.components.filter((component) => component.controlType === 'columns'); if (columnItems.length) { this.setChildCalculations(control, column.components); } }); }); } duplicateNumberControl(control) { this.duplicateControl.emit(control); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: AswNumber, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.8", type: AswNumber, selector: "asw-number", inputs: { control: "control", formControls: "formControls", CSSFramework: "CSSFramework", isPreviewTemplate: "isPreviewTemplate", propertyPersonalization: "propertyPersonalization", patterns: "patterns" }, outputs: { numberUpdateEvent: "numberUpdateEvent", numberDeleteEvent: "numberDeleteEvent", aswModelChange: "aswModelChange", duplicateControl: "duplicateControl" }, viewQueries: [{ propertyName: "numberInput", first: true, predicate: ["numberInput"], descendants: true }, { propertyName: "currencyInput", first: true, predicate: ["currencyInput"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"control as control\">\r\n <ng-container *ngIf=\"CSSFramework === 'material'; else bootstrap\">\r\n <ng-container [ngSwitch]=\"control.controlType\">\r\n <ng-container *ngSwitchCase=\"'number'\">\r\n <mat-form-field [appearance]=\"control.style\" class=\"asw-width-100 {{control.customClass}}\">\r\n <mat-label>{{control.label | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\" aswNumbersOnly\r\n [id]=\"control.id\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n pattern=\"{{control.pattern}}\"\r\n [(ngModel)]=\"control.value\"\r\n #numberInput=\"ngModel\"\r\n (ngModelChange)=\"onChange(control)\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [maxlength]=\"control.maxlength\"\r\n [minlength]=\"control.minlength\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <mat-icon *ngIf=\"numberInput.invalid && (numberInput.dirty || numberInput.touched)\"\r\n class=\"asw-error\" matSuffix>error\r\n </mat-icon>\r\n <mat-error *ngIf=\"numberInput.invalid && (numberInput.dirty || numberInput.touched)\">\r\n <ng-container *ngIf=\"numberInput?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n <ng-container *ngIf=\"numberInput?.errors?.minlength\">\r\n Sorry, {{control.label | aswTranslate}} must be at least {{control.minlength}} characters long.\r\n </ng-container>\r\n <ng-container *ngIf=\"numberInput?.errors?.pattern\">\r\n {{control.customErrorMsg}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'currency'\">\r\n <mat-form-field [appearance]=\"control.style\" class=\"asw-width-100 {{control.customClass}}\">\r\n <mat-label>{{control.label | aswTranslate}}</mat-label>\r\n <span matTextPrefix>{{control.currencySymbol}} </span>\r\n <input matInput type=\"text\" aswNumbersOnly\r\n [id]=\"control.id\"\r\n pattern=\"{{control.pattern}}\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n [(ngModel)]=\"control.value\"\r\n #currencyInput=\"ngModel\"\r\n (ngModelChange)=\"onChange(control)\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [maxlength]=\"control.maxlength\"\r\n [minlength]=\"control.minlength\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <mat-icon *ngIf=\"currencyInput.invalid && (currencyInput.dirty || currencyInput.touched)\"\r\n class=\"asw-error\" matSuffix>error\r\n </mat-icon>\r\n <mat-error *ngIf=\"currencyInput.invalid && (currencyInput.dirty || currencyInput.touched)\">\r\n <ng-container *ngIf=\"currencyInput?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n <ng-container *ngIf=\"currencyInput?.errors?.minlength\">\r\n Sorry, {{control.label | aswTranslate}} must be at least {{control.minlength}} characters long.\r\n </ng-container>\r\n <ng-container *ngIf=\"currencyInput?.errors?.pattern\">\r\n {{control.customErrorMsg}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #bootstrap>\r\n <ng-container [ngSwitch]=\"control.controlType\">\r\n <ng-container *ngSwitchCase=\"'number'\">\r\n <div class=\"asw-mb-3\">\r\n <label for=\"{{control.id}}\" \r\n class=\"asw-input-label {{(numberInput.invalid && (numberInput.dirty || numberInput.touched)) ? 'asw-red-color' : ''}}\"\r\n [class.asw-invalid-label]=\"control.isRequired\">{{control.label | aswTranslate}}</label>\r\n <input type=\"text\" aswNumbersOnly\r\n [id]=\"control.id\"\r\n class=\"asw-input-control {{control.customClass}}\" \r\n [placeholder]=\"control.label | aswTranslate\"\r\n pattern=\"{{control.pattern}}\"\r\n [(ngModel)]=\"control.value\"\r\n #numberInput=\"ngModel\"\r\n (ngModelChange)=\"onChange(control)\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [maxlength]=\"control.maxlength\"\r\n [minlength]=\"control.minlength\"\r\n [required]=\"control.isRequired\"\r\n [class.asw-is-invalid]=\"numberInput.invalid && (numberInput.dirty || numberInput.touched)\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <div *ngIf=\"numberInput.invalid && (numberInput.dirty || numberInput.touched)\" class=\"invalid-feedback\">\r\n <ng-container *ngIf=\"numberInput?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n <ng-container *ngIf=\"numberInput?.errors?.minlength\">\r\n Sorry, {{control.label | aswTranslate}} must be at least {{control.minlength}} characters long.\r\n </ng-container>\r\n <ng-container *ngIf=\"numberInput?.errors?.pattern\">\r\n {{control.customErrorMsg}}\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'currency'\">\r\n <div class=\"asw-mb-3\">\r\n <label for=\"{{control.id}}\" \r\n class=\"asw-input-label {{(currencyInput.invalid && (currencyInput.dirty || currencyInput.touched)) ? 'asw-red-color' : ''}}\"\r\n [class.asw-invalid-label]=\"control.isRequired\">{{control.label | aswTranslate}}</label>\r\n <div class=\"input-group\">\r\n <span class=\"input-group-text\" matTextPrefix>{{control.currencySymbol}} </span>\r\n <input type=\"text\" aswNumbersOnly\r\n [id]=\"control.id\"\r\n class=\"asw-input-control {{control.customClass}}\"\r\n pattern=\"{{control.pattern}}\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n [(ngModel)]=\"control.value\"\r\n #currencyInput=\"ngModel\"\r\n (ngModelChange)=\"onChange(control)\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [maxlength]=\"control.maxlength\"\r\n [minlength]=\"control.minlength\"\r\n [class.asw-is-invalid]=\"currencyInput.invalid && (currencyInput.dirty || currencyInput.touched)\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <div *ngIf=\"currencyInput.invalid && (currencyInput.dirty || currencyInput.touched)\" class=\"invalid-feedback\">\r\n <ng-container *ngIf=\"currencyInput?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n <ng-container *ngIf=\"currencyInput?.errors?.minlength\">\r\n Sorry, {{control.label | aswTranslate}} must be at least {{control.minlength}} characters long.\r\n </ng-container>\r\n <ng-container *ngIf=\"currencyInput?.errors?.pattern\">\r\n {{control.customErrorMsg}}\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-template> \r\n <div class=\"asw-row\" *ngIf=\"isPreviewTemplate\">\r\n <div class=\"asw-col-md-12\" align=\"right\">\r\n <button mat-icon-button \r\n type=\"button\" \r\n matTooltip=\"{{'FormControl.Duplicate' | aswTranslate}}\" \r\n [matTooltipPosition]=\"'below'\" \r\n (click)=\"duplicateNumberControl(control)\">\r\n <div [innerHTML]=\"icons.contentCopy | aswSafeHtml\"></div>\r\n </button>\r\n <button mat-icon-button \r\n type=\"button\" \r\n matTooltip=\"{{'FormControl.Edit' | aswTranslate}}\" \r\n [matTooltipPosition]=\"'below'\" \r\n (click)=\"editNumberDialog(control)\">\r\n <div [innerHTML]=\"icons.edit | aswSafeHtml\"></div>\r\n </button>\r\n <button mat-icon-button \r\n type=\"button\" \r\n matTooltip=\"{{'FormControl.Delete' | aswTranslate}}\" \r\n [matTooltipPosition]=\"'below'\" \r\n (click)=\"deleteNumberDialog(control)\">\r\n <div [innerHTML]=\"icons.delete2 | aswSafeHtml\"></div>\r\n </button>\r\n </div>\r\n </div>\r\n</ng-container>", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: i5.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: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i6.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.AswNumberDirective, selector: "[aswNumbersOnly]" }, { kind: "pipe", type: i10.AswTranslatePipe, name: "aswTranslate" }, { kind: "pipe", type: i9.AswSafeHtmlPipe, name: "aswSafeHtml" }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: AswNumber, decorators: [{ type: Component, args: [{ selector: 'asw-number', template: "<ng-container *ngIf=\"control as control\">\r\n <ng-container *ngIf=\"CSSFramework === 'material'; else bootstrap\">\r\n <ng-container [ngSwitch]=\"control.controlType\">\r\n <ng-container *ngSwitchCase=\"'number'\">\r\n <mat-form-field [appearance]=\"control.style\" class=\"asw-width-100 {{control.customClass}}\">\r\n <mat-label>{{control.label | aswTranslate}}</mat-label>\r\n <input matInput type=\"text\" aswNumbersOnly\r\n [id]=\"control.id\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n pattern=\"{{control.pattern}}\"\r\n [(ngModel)]=\"control.value\"\r\n #numberInput=\"ngModel\"\r\n (ngModelChange)=\"onChange(control)\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [maxlength]=\"control.maxlength\"\r\n [minlength]=\"control.minlength\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <mat-icon *ngIf=\"numberInput.invalid && (numberInput.dirty || numberInput.touched)\"\r\n class=\"asw-error\" matSuffix>error\r\n </mat-icon>\r\n <mat-error *ngIf=\"numberInput.invalid && (numberInput.dirty || numberInput.touched)\">\r\n <ng-container *ngIf=\"numberInput?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n <ng-container *ngIf=\"numberInput?.errors?.minlength\">\r\n Sorry, {{control.label | aswTranslate}} must be at least {{control.minlength}} characters long.\r\n </ng-container>\r\n <ng-container *ngIf=\"numberInput?.errors?.pattern\">\r\n {{control.customErrorMsg}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'currency'\">\r\n <mat-form-field [appearance]=\"control.style\" class=\"asw-width-100 {{control.customClass}}\">\r\n <mat-label>{{control.label | aswTranslate}}</mat-label>\r\n <span matTextPrefix>{{control.currencySymbol}} </span>\r\n <input matInput type=\"text\" aswNumbersOnly\r\n [id]=\"control.id\"\r\n pattern=\"{{control.pattern}}\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n [(ngModel)]=\"control.value\"\r\n #currencyInput=\"ngModel\"\r\n (ngModelChange)=\"onChange(control)\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [maxlength]=\"control.maxlength\"\r\n [minlength]=\"control.minlength\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <mat-icon *ngIf=\"currencyInput.invalid && (currencyInput.dirty || currencyInput.touched)\"\r\n class=\"asw-error\" matSuffix>error\r\n </mat-icon>\r\n <mat-error *ngIf=\"currencyInput.invalid && (currencyInput.dirty || currencyInput.touched)\">\r\n <ng-container *ngIf=\"currencyInput?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n <ng-container *ngIf=\"currencyInput?.errors?.minlength\">\r\n Sorry, {{control.label | aswTranslate}} must be at least {{control.minlength}} characters long.\r\n </ng-container>\r\n <ng-container *ngIf=\"currencyInput?.errors?.pattern\">\r\n {{control.customErrorMsg}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #bootstrap>\r\n <ng-container [ngSwitch]=\"control.controlType\">\r\n <ng-container *ngSwitchCase=\"'number'\">\r\n <div class=\"asw-mb-3\">\r\n <label for=\"{{control.id}}\" \r\n class=\"asw-input-label {{(numberInput.invalid && (numberInput.dirty || numberInput.touched)) ? 'asw-red-color' : ''}}\"\r\n [class.asw-invalid-label]=\"control.isRequired\">{{control.label | aswTranslate}}</label>\r\n <input type=\"text\" aswNumbersOnly\r\n [id]=\"control.id\"\r\n class=\"asw-input-control {{control.customClass}}\" \r\n [placeholder]=\"control.label | aswTranslate\"\r\n pattern=\"{{control.pattern}}\"\r\n [(ngModel)]=\"control.value\"\r\n #numberInput=\"ngModel\"\r\n (ngModelChange)=\"onChange(control)\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [maxlength]=\"control.maxlength\"\r\n [minlength]=\"control.minlength\"\r\n [required]=\"control.isRequired\"\r\n [class.asw-is-invalid]=\"numberInput.invalid && (numberInput.dirty || numberInput.touched)\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <div *ngIf=\"numberInput.invalid && (numberInput.dirty || numberInput.touched)\" class=\"invalid-feedback\">\r\n <ng-container *ngIf=\"numberInput?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n <ng-container *ngIf=\"numberInput?.errors?.minlength\">\r\n Sorry, {{control.label | aswTranslate}} must be at least {{control.minlength}} characters long.\r\n </ng-container>\r\n <ng-container *ngIf=\"numberInput?.errors?.pattern\">\r\n {{control.customErrorMsg}}\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'currency'\">\r\n <div class=\"asw-mb-3\">\r\n <label for=\"{{control.id}}\" \r\n class=\"asw-input-label {{(currencyInput.invalid && (currencyInput.dirty || currencyInput.touched)) ? 'asw-red-color' : ''}}\"\r\n [class.asw-invalid-label]=\"control.isRequired\">{{control.label | aswTranslate}}</label>\r\n <div class=\"input-group\">\r\n <span class=\"input-group-text\" matTextPrefix>{{control.currencySymbol}} </span>\r\n <input type=\"text\" aswNumbersOnly\r\n [id]=\"control.id\"\r\n class=\"asw-input-control {{control.customClass}}\"\r\n pattern=\"{{control.pattern}}\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n [(ngModel)]=\"control.value\"\r\n #currencyInput=\"ngModel\"\r\n (ngModelChange)=\"onChange(control)\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [maxlength]=\"control.maxlength\"\r\n [minlength]=\"control.minlength\"\r\n [class.asw-is-invalid]=\"currencyInput.invalid && (currencyInput.dirty || currencyInput.touched)\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <div *ngIf=\"currencyInput.invalid && (currencyInput.dirty || currencyInput.touched)\" class=\"invalid-feedback\">\r\n <ng-container *ngIf=\"currencyInput?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n <ng-container *ngIf=\"currencyInput?.errors?.minlength\">\r\n Sorry, {{control.label | aswTranslate}} must be at least {{control.minlength}} characters long.\r\n </ng-container>\r\n <ng-container *ngIf=\"currencyInput?.errors?.pattern\">\r\n {{control.customErrorMsg}}\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-template> \r\n <div class=\"asw-row\" *ngIf=\"isPreviewTemplate\">\r\n <div class=\"asw-col-md-12\" align=\"right\">\r\n <button mat-icon-button \r\n type=\"button\" \r\n matTooltip=\"{{'FormControl.Duplicate' | aswTranslate}}\" \r\n [matTooltipPosition]=\"'below'\" \r\n (click)=\"duplicateNumberControl(control)\">\r\n <div [innerHTML]=\"icons.contentCopy | aswSafeHtml\"></div>\r\n </button>\r\n <button mat-icon-button \r\n type=\"button\" \r\n matTooltip=\"{{'FormControl.Edit' | aswTranslate}}\" \r\n [matTooltipPosition]=\"'below'\" \r\n (click)=\"editNumberDialog(control)\">\r\n <div [innerHTML]=\"icons.edit | aswSafeHtml\"></div>\r\n </button>\r\n <button mat-icon-button \r\n type=\"button\" \r\n matTooltip=\"{{'FormControl.Delete' | aswTranslate}}\" \r\n [matTooltipPosition]=\"'below'\" \r\n (click)=\"deleteNumberDialog(control)\">\r\n <div [innerHTML]=\"icons.delete2 | aswSafeHtml\"></div>\r\n </button>\r\n </div>\r\n </div>\r\n</ng-container>" }] }], ctorParameters: () => [{ type: i1.MatDialog }], propDecorators: { control: [{ type: Input }], formControls: [{ type: Input }], CSSFramework: [{ type: Input }], isPreviewTemplate: [{ type: Input }], propertyPersonalization: [{ type: Input }], patterns: [{ type: Input }], numberUpdateEvent: [{ type: Output }], numberDeleteEvent: [{ type: Output }], aswModelChange: [{ type: Output }], duplicateControl: [{ type: Output }], numberInput: [{ type: ViewChild, args: ['numberInput'] }], currencyInput: [{ type: ViewChild, args: ['currencyInput'] }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVtYmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvZm9ybS1jb250cm9sL251bWJlci9udW1iZXIudHMiLCIuLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9mb3JtLWNvbnRyb2wvbnVtYmVyL251bWJlci5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBaUIsU0FBUyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUVqRyxPQUFPLEVBQWlCLGdCQUFnQixFQUFFLE1BQU0sc0NBQXNDLENBQUM7QUFDdkYsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUs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cnJlbmN5Jzoge1xuICAgICAgICAgICAgICAgIHRoaXMuY3VycmVuY3lJbnB1dC52YWx1ZUNoYW5nZXMuc3Vic2NyaWJlKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vbkNoYW5nZSh0aGlzLmNvbnRyb2wgPyB0aGlzLmNvbnRyb2wgOiAobnVsbCBhcyBhbnkpKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGRlbGV0ZU51bWJlckRpYWxvZyhjb250cm9sOiBOdW1iZXJDb250cm9sKTogdm9pZCB7XG4gICAgICAgIGNvbnN0IGRpYWxvZ1JlZiA9IHRoaXMuZGlhbG9nLm9wZW4oQXN3Q29uZmlybURpYWxvZywge1xuICAgICAgICAgICAgd2lkdGg6ICczNTBweCcsXG4gICAgICAgICAgICBkYXRhOiB7IG5hbWU6IGNvbnRyb2wuY29udHJvbFR5cGUsIG1lc3NhZ2U6IHRoaXMuY29uc3RhbnRzLm1lc3NhZ2VzLndhcmluZ01lc3NhZ2UgfVxuICAgICAgICB9KTtcbiAgICAgICAgZGlhbG9nUmVmLmFmdGVyQ2xvc2VkKCkuc3Vic2NyaWJlKChyZXN1bHQpID0+IHtcbiAgICAgICAgICAgIGlmIChyZXN1bHQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHRoaXMubnVtYmVyRGVsZXRlRXZlbnQuZW1pdChjb250cm9sKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZWRpdE51bWJlckRpYWxvZyhjb250cm9sOiBOdW1iZXJDb250cm9sKTogdm9pZCB7XG4gICAgICAgIGNvbnN0IGRpYWxvZ1JlZiA9IHRoaXMuZGlhbG9nLm9wZW4oQXN3VGV4dERpYWxvZywge1xuICAgICAgICAgICAgd2lkdGg6ICc4MCUnLFxuICAgICAgICAgICAgbWluV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dWxhdGlvbkl0ZW1zLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFBhcmVudENhbGN1bGF0aW9ucyhjb250cm9sLCBjb2x1bW4uY29tcG9uZW50cyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IGNvbHVtbkl0ZW1zID0gY29sdW1uLmNvbXBvbmVudHMuZmlsdGVyKChjb21wb25lbnQ6IGFueSkgPT4gY29tcG9uZW50LmNvbnRyb2xUeXBlID09PSAnY29sdW1ucycpO1xuICAgICAgICAgICAgICAgIGlmIChjb2x1bW5JdGVtcy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRDaGlsZENhbGN1bGF0aW9ucyhjb250cm9sLCBjb2x1bW4uY29tcG9uZW50cyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGR1cGxpY2F0ZU51bWJlckNvbnRyb2woY29udHJvbDogTnVtYmVyQ29udHJvbCk6IHZvaWQge1xuICAgICAgICB0aGlzLmR1cGxpY2F0ZUNvbnRyb2wuZW1pdChjb250cm9sKTtcbiAgICB9XG59XG4iLCI8bmctY29udGFpbmVyICpuZ0lmPVwiY29udHJvbCBhcyBjb250cm9sXCI+XHJcbiAgICA8bmctY29udGFpbmVyICpuZ0lmPVwiQ1NTRnJhbWV3b3JrID09PSAnbWF0ZXJpYWwnOyBlbHNlIGJvb3RzdHJhcFwiPlxyXG4gICAgICAgIDxuZy1jb250YWluZXIgW25nU3dpdGNoXT1cImNvbnRyb2wuY29udHJvbFR5cGVcIj5cclxuICAgICAgICAgICAgPG5nLWNvbnRhaW5lciAqbmdTd2l0Y2hDYXNlPVwiJ251bWJlcidcIj5cclxuICAgICAgICAgICAgICAgIDxtYXQtZm9ybS1maWVsZCBbYXBwZWFyYW5jZV09XCJjb250cm9sLnN0eWxlXCIgY2xhc3M9XCJhc3ctd2lkdGgtMTAwIHt7Y29udHJvbC5jdXN0b21DbGFzc319XCI+XHJcbiAgICAgICAgICAgICAgICAgICAgPG1hdC1sYWJlbD57e2NvbnRyb2wubGFiZWwgfCBhc3dUcmFuc2xhdGV9fTwvbWF0LWxhYmVsPlxyXG4gICAgICAgICAgICAgICAgICAgIDxpbnB1dCBtYXRJbnB1dCB0eXBlPVwidGV4dFwiIGFzd051bWJlcnNPbmx5XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFtpZF09XCJjb250cm9sLmlkXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgW3BsYWNlaG9sZGVyXT1cImNvbnRyb2wubGFiZWwgfCBhc3dUcmFuc2xhdGVcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuPVwie3tjb250cm9sLnBhdHRlcm59fVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFsobmdNb2RlbCldPVwiY29udHJvbC52YWx1ZVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICNudW1iZXJJbnB1dD1cIm5nTW9kZWxcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAobmdNb2RlbENoYW5nZSk9XCJvbkNoYW5nZShjb250cm9sKVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFttYXRUb29sdGlwXT1cImNvbnRyb2wudG9vbHRpcCB8IGFzd1RyYW5zbGF0ZVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFttYXhsZW5ndGhdPVwiY29udHJvbC5tYXhsZW5ndGhcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBbbWlubGVuZ3RoXT1cImNvbnRyb2wubWlubGVuZ3RoXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgW3JlcXVpcmVkXT1cImNvbnRyb2wuaXNSZXF1aXJlZFwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFtkaXNhYmxlZF09XCJjb250cm9sLmlzRGlzYWJsZWQgPyB0cnVlIDogZmFsc2VcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1pY29uICpuZ0lmPVwibnVtYmVySW5wdXQuaW52YWxpZCAmJiAobnVtYmVySW5wdXQuZGlydHkgfHwgbnVtYmVySW5wdXQudG91Y2hlZClcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M9XCJhc3ctZXJyb3JcIiBtYXRTdWZmaXg+ZXJyb3JcclxuICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtaWNvbj5cclxuICAgICAgICAgICAgICAgICAgICA8bWF0LWVycm9yICpuZ0lmPVwibnVtYmVySW5wdXQuaW52YWxpZCAmJiAobnVtYmVySW5wdXQuZGlydHkgfHwgbnVtYmVySW5wdXQudG91Y2hlZClcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPG5nLWNvbnRhaW5lciAqbmdJZj1cIm51bWJlcklucHV0Py5lcnJvcnM/LnJlcXVpcmVkXCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7e2NvbnRyb2wubGFiZWwgfCBhc3dUcmFuc2xhdGV9fSB7eydGb3JtQ29udHJvbC5Jc1JlcXVpcmVkJyB8IGFzd1RyYW5zbGF0ZX19XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvbmctY29udGFpbmVyPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8bmctY29udGFpbmVyICpuZ0lmPVwibnVtYmVySW5wdXQ/LmVycm9ycz8ubWlubGVuZ3RoXCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTb3JyeSwge3tjb250cm9sLmxhYmVsIHwgYXN3VHJhbnNsYXRlfX0gbXVzdCBiZSBhdCBsZWFzdCB7e2NvbnRyb2wubWlubGVuZ3RofX0gY2hhcmFjdGVycyBsb25nLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8L25nLWNvbnRhaW5lcj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPG5nLWNvbnRhaW5lciAqbmdJZj1cIm51bWJlcklucHV0Py5lcnJvcnM/LnBhdHRlcm5cIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7Y29udHJvbC5jdXN0b21FcnJvck1zZ319XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvbmctY29udGFpbmVyPlxyXG4gICAgICAgICAgICAgICAgICAgIDwvbWF0LWVycm9yPlxyXG4gICAgICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cclxuICAgICAgICAgICAgPC9uZy1jb250YWluZXI+XHJcbiAgICAgICAgICAgIDxuZy1jb250YWluZXIgKm5nU3dpdGNoQ2FzZT1cIidjdXJyZW5jeSdcIj5cclxuICAgICAgICAgICAgICAgIDxtYXQtZm9ybS1maWVsZCBbYXBwZWFyYW5jZV09XCJjb250cm9sLnN0eWxlXCIgY2xhc3M9XCJhc3ctd2lkdGgtMTAwIHt7Y29udHJvbC5jdXN0b21DbGFzc319XCI+XHJcbiAgICAgICAgICAgICAgICAgICAgPG1hdC1sYWJlbD57e2NvbnRyb2wubGFiZWwgfCBhc3dUcmFuc2xhdGV9fTwvbWF0LWxhYmVsPlxyXG4gICAgICAgICAgICAgICAgICAgIDxzcGFuIG1hdFRleHRQcmVmaXg+e3tjb250cm9sLmN1cnJlbmN5U3ltYm9sfX0gPC9zcGFuPlxyXG4gICAgICAgICAgICAgICAgICAgIDxpbnB1dCBtYXRJbnB1dCB0eXBlPVwidGV4dFwiIGFzd051bWJlcnNPbmx5XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFtpZF09XCJjb250cm9sLmlkXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0dGVybj1cInt7Y29udHJvbC5wYXR0ZXJufX1cIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBbcGxhY2Vob2xkZXJdPVwiY29udHJvbC5sYWJlbCB8IGFzd1RyYW5zbGF0ZVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFsobmdNb2RlbCldPVwiY29udHJvbC52YWx1ZVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICNjdXJyZW5jeUlucHV0PVwibmdNb2RlbFwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIChuZ01vZGVsQ2hhbmdlKT1cIm9uQ2hhbmdlKGNvbnRyb2wpXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgW21hdFRvb2x0aXBdPVwiY29udHJvbC50b29sdGlwIHwgYXN3VHJhbnNsYXRlXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgW21heGxlbmd0aF09XCJjb250cm9sLm1heGxlbmd0aFwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFttaW5sZW5ndGhdPVwiY29udHJvbC5taW5sZW5ndGhcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBbcmVxdWlyZWRdPVwiY29udHJvbC5pc1JlcXVpcmVkXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgW2Rpc2FibGVkXT1cImNvbnRyb2wuaXNEaXNhYmxlZCA/IHRydWUgOiBmYWxzZVwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8bWF0LWljb24gKm5nSWY9XCJjdXJyZW5jeUlucHV0LmludmFsaWQgJiYgKGN1cnJlbmN5SW5wdXQuZGlydHkgfHwgY3VycmVuY3lJbnB1dC50b3VjaGVkKVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImFzdy1lcnJvclwiIG1hdFN1ZmZpeD5lcnJvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8L21hdC1pY29uPlxyXG4gICAgICAgICAgICAgICAgICAgIDxtYXQtZXJyb3IgKm5nSWY9XCJjdXJyZW5jeUlucHV0LmludmFsaWQgJiYgKGN1cnJlbmN5SW5wdXQuZGlydHkgfHwgY3VycmVuY3lJbnB1dC50b3VjaGVkKVwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8bmctY29udGF