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

111 lines 66.1 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 } 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 { AswDatepickerDialog } from './datepicker-dialog'; 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 "@asoftwareworld/form-builder-pro/datetimepicker"; import * as i9 from "@asoftwareworld/form-builder-pro/core"; import * as i10 from "@asoftwareworld/form-builder-pro/common"; export class AswDatepicker { dialog; constants = Constants; icons = Icons; multiYearSelector = true; touchUi = false; timeInterval = 1; timeInput = true; /** * Datepicker control */ control = null; CSSFramework = CSSFrameworkEnum.Material; isPreviewTemplate = false; propertyPersonalization = []; datepickerUpdateEvent = new EventEmitter(); datepickerDeleteEvent = new EventEmitter(); dateChange = new EventEmitter(); duplicateControl = new EventEmitter(); constructor(dialog) { this.dialog = dialog; } /** * Delete datepicker control based on control index * @param control datepicker control items */ deleteDatepickerDialog(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.datepickerDeleteEvent.emit(control); } }); } editDatepickerDialog(control) { const dialogRef = this.dialog.open(AswDatepickerDialog, { width: '60%', minWidth: '60vw', disableClose: true, data: { control, CSSFramework: this.CSSFramework, propertyPersonalization: this.propertyPersonalization } }); dialogRef.afterClosed().subscribe((result) => { if (result !== undefined) { this.datepickerUpdateEvent.emit(result); } }); } onDateChange(control) { this.dateChange.emit(control); } duplicateDatepickerControl(control) { this.duplicateControl.emit(control); } weekendsDatesFilter = (date) => { if (date === null) { return true; } const day = date.day(); // Prevent Saturday and Sunday from being selected. return day !== 0 && day !== 6; }; static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: AswDatepicker, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.8", type: AswDatepicker, selector: "asw-datepicker", inputs: { control: "control", CSSFramework: "CSSFramework", isPreviewTemplate: "isPreviewTemplate", propertyPersonalization: "propertyPersonalization" }, outputs: { datepickerUpdateEvent: "datepickerUpdateEvent", datepickerDeleteEvent: "datepickerDeleteEvent", dateChange: "dateChange", duplicateControl: "duplicateControl" }, 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=\"'datepicker'\">\r\n <ng-container *ngIf=\"control.isDisableWeekendDates\">\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 <asw-datetimepicker #picker\r\n [type]=\"control.type\"\r\n [mode]=\"control.mode\"\r\n [multiYearSelector]=\"multiYearSelector\"\r\n [startView]=\"control.defaultView\"\r\n [twelvehour]=\"control.twelveHour\"\r\n [timeInterval]=\"timeInterval\"\r\n [touchUi]=\"touchUi\"\r\n [timeInput]=\"timeInput\">\r\n </asw-datetimepicker>\r\n <input matInput \r\n [aswDatetimepicker]=\"picker\" \r\n #input=\"ngModel\"\r\n [id]=\"control.id\"\r\n [(ngModel)]=\"control.value\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [aswDatetimepickerFilter]=\"weekendsDatesFilter\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <asw-datetimepicker-toggle [for]=\"picker\" matSuffix></asw-datetimepicker-toggle>\r\n <mat-error *ngIf=\"input.invalid && (input.dirty || input.touched)\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n <ng-container *ngIf=\"!control.isDisableWeekendDates\">\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 <asw-datetimepicker #datetimePicker\r\n [type]=\"control.type\"\r\n [mode]=\"control.mode\"\r\n [multiYearSelector]=\"multiYearSelector\"\r\n [startView]=\"control.defaultView\"\r\n [twelvehour]=\"control.twelveHour\"\r\n [timeInterval]=\"timeInterval\"\r\n [touchUi]=\"touchUi\"\r\n [timeInput]=\"timeInput\">\r\n </asw-datetimepicker>\r\n <input matInput \r\n #input=\"ngModel\"\r\n [aswDatetimepicker]=\"datetimePicker\"\r\n [id]=\"control.id\"\r\n [(ngModel)]=\"control.value\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <asw-datetimepicker-toggle [for]=\"datetimePicker\" matSuffix></asw-datetimepicker-toggle>\r\n <mat-error *ngIf=\"input.invalid && (input.dirty || input.touched)\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\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-container>\r\n <ng-template #bootstrap>\r\n <ng-container [ngSwitch]=\"control.controlType\">\r\n <ng-container *ngSwitchCase=\"'datepicker'\">\r\n <ng-container *ngIf=\"control.isDisableWeekendDates\">\r\n <div class=\"asw-mb-3\">\r\n <label for=\"{{control.id}}\" \r\n class=\"asw-input-label {{(input.invalid && (input.dirty || input.touched)) ? 'asw-red-color' : ''}}\"\r\n [class.asw-invalid-label]=\"control.isRequired\">{{control.label | aswTranslate}}</label>\r\n <asw-datetimepicker #picker\r\n [type]=\"control.type\"\r\n [mode]=\"control.mode\"\r\n [multiYearSelector]=\"multiYearSelector\"\r\n [startView]=\"control.defaultView\"\r\n [twelvehour]=\"control.twelveHour\"\r\n [timeInterval]=\"timeInterval\"\r\n [touchUi]=\"touchUi\"\r\n [timeInput]=\"timeInput\">\r\n </asw-datetimepicker>\r\n <input \r\n [aswDatetimepicker]=\"picker\" \r\n #input=\"ngModel\"\r\n [id]=\"control.id\"\r\n class=\"asw-input-control {{control.customClass}}\"\r\n [class.asw-is-invalid]=\"input.invalid && (input.dirty || input.touched)\"\r\n [(ngModel)]=\"control.value\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [aswDatetimepickerFilter]=\"weekendsDatesFilter\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <asw-datetimepicker-toggle [for]=\"picker\" matSuffix class=\"asw-date-picker\"></asw-datetimepicker-toggle>\r\n <div *ngIf=\"input.invalid && (input.dirty || input.touched)\" class=\"invalid-feedback\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!control.isDisableWeekendDates\">\r\n <div class=\"asw-mb-3\">\r\n <label for=\"{{control.id}}\" \r\n class=\"asw-input-label {{(input.invalid && (input.dirty || input.touched)) ? 'asw-red-color' : ''}}\"\r\n [class.asw-invalid-label]=\"control.isRequired\">{{control.label | aswTranslate}}</label>\r\n <input \r\n [aswDatetimepicker]=\"datetimePicker\" \r\n #input=\"ngModel\"\r\n class=\"asw-input-control {{control.customClass}}\"\r\n [class.asw-is-invalid]=\"input.invalid && (input.dirty || input.touched)\"\r\n [id]=\"control.id\"\r\n [(ngModel)]=\"control.value\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <asw-datetimepicker-toggle [for]=\"datetimePicker\" matSuffix class=\"asw-date-picker\"></asw-datetimepicker-toggle>\r\n <asw-datetimepicker #datetimePicker\r\n [type]=\"control.type\"\r\n [mode]=\"control.mode\"\r\n [multiYearSelector]=\"multiYearSelector\"\r\n [startView]=\"control.defaultView\"\r\n [twelvehour]=\"control.twelveHour\"\r\n [timeInterval]=\"timeInterval\"\r\n [touchUi]=\"touchUi\"\r\n [timeInput]=\"timeInput\">\r\n </asw-datetimepicker>\r\n <div *ngIf=\"input.invalid && (input.dirty || input.touched)\" class=\"invalid-feedback\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <!-- <ng-container *ngSwitchCase=\"'daterange'\">\r\n <ng-container *ngIf=\"control.isDisableWeekendDates\">\r\n <mat-form-field [appearance]=\"control.style\" class=\"asw-width-100 {{control.customClass}}\">\r\n <mat-label>{{control.label}}</mat-label>\r\n <mat-date-range-input [(ngModel)]=\"control.value\"\r\n [rangePicker]=\"picker\"\r\n #input=\"ngModel\"\r\n [id]=\"control.id\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [matTooltip]=\"control.tooltip\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [dateFilter]=\"weekendsDatesFilter\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <input matStartDate >\r\n <input matEndDate >\r\n </mat-date-range-input> \r\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n <mat-error *ngIf=\"input.invalid && (input.dirty || input.touched)\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n <ng-container *ngIf=\"!control.isDisableWeekendDates\">\r\n <mat-form-field [appearance]=\"control.style\" class=\"asw-width-100 {{control.customClass}}\">\r\n <mat-label>{{control.label}}</mat-label>\r\n <input matInput \r\n [matDatepicker]=\"picker\" \r\n #input=\"ngModel\"\r\n [id]=\"control.id\"\r\n [(ngModel)]=\"control.value\"\r\n [matTooltip]=\"control.tooltip\"\r\n [placeholder]=\"control.label\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n <mat-error *ngIf=\"input.invalid && (input.dirty || input.touched)\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label}} {{'FormControl.IsRequired' | aswTranslate}}\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>\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)=\"duplicateDatepickerControl(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)=\"editDatepickerDialog(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)=\"deleteDatepickerDialog(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.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.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.AswDatetimepicker, selector: "asw-datetimepicker", inputs: ["multiYearSelector", "twelvehour", "startView", "mode", "timeInterval", "preventSameDateTimeSelection", "panelClass", "opened", "color", "startAt", "type", "touchUi", "timeInput", "disabled", "xPosition", "yPosition", "restoreFocus"], outputs: ["selectedChanged", "opened", "closed", "viewChanged"], exportAs: ["aswDatetimepicker"] }, { kind: "component", type: i8.AswDatetimepickerToggle, selector: "asw-datetimepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["aswDatetimepickerToggle"] }, { kind: "directive", type: i8.AswDatetimepickerInput, selector: "input[aswDatetimepicker]", inputs: ["aswDatetimepicker", "aswDatetimepickerFilter", "value", "min", "max", "disabled"], outputs: ["dateChange", "dateInput"], exportAs: ["aswDatetimepickerInput"] }, { kind: "pipe", type: i9.AswTranslatePipe, name: "aswTranslate" }, { kind: "pipe", type: i10.AswSafeHtmlPipe, name: "aswSafeHtml" }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: AswDatepicker, decorators: [{ type: Component, args: [{ selector: 'asw-datepicker', 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=\"'datepicker'\">\r\n <ng-container *ngIf=\"control.isDisableWeekendDates\">\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 <asw-datetimepicker #picker\r\n [type]=\"control.type\"\r\n [mode]=\"control.mode\"\r\n [multiYearSelector]=\"multiYearSelector\"\r\n [startView]=\"control.defaultView\"\r\n [twelvehour]=\"control.twelveHour\"\r\n [timeInterval]=\"timeInterval\"\r\n [touchUi]=\"touchUi\"\r\n [timeInput]=\"timeInput\">\r\n </asw-datetimepicker>\r\n <input matInput \r\n [aswDatetimepicker]=\"picker\" \r\n #input=\"ngModel\"\r\n [id]=\"control.id\"\r\n [(ngModel)]=\"control.value\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [aswDatetimepickerFilter]=\"weekendsDatesFilter\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <asw-datetimepicker-toggle [for]=\"picker\" matSuffix></asw-datetimepicker-toggle>\r\n <mat-error *ngIf=\"input.invalid && (input.dirty || input.touched)\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n <ng-container *ngIf=\"!control.isDisableWeekendDates\">\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 <asw-datetimepicker #datetimePicker\r\n [type]=\"control.type\"\r\n [mode]=\"control.mode\"\r\n [multiYearSelector]=\"multiYearSelector\"\r\n [startView]=\"control.defaultView\"\r\n [twelvehour]=\"control.twelveHour\"\r\n [timeInterval]=\"timeInterval\"\r\n [touchUi]=\"touchUi\"\r\n [timeInput]=\"timeInput\">\r\n </asw-datetimepicker>\r\n <input matInput \r\n #input=\"ngModel\"\r\n [aswDatetimepicker]=\"datetimePicker\"\r\n [id]=\"control.id\"\r\n [(ngModel)]=\"control.value\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <asw-datetimepicker-toggle [for]=\"datetimePicker\" matSuffix></asw-datetimepicker-toggle>\r\n <mat-error *ngIf=\"input.invalid && (input.dirty || input.touched)\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\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-container>\r\n <ng-template #bootstrap>\r\n <ng-container [ngSwitch]=\"control.controlType\">\r\n <ng-container *ngSwitchCase=\"'datepicker'\">\r\n <ng-container *ngIf=\"control.isDisableWeekendDates\">\r\n <div class=\"asw-mb-3\">\r\n <label for=\"{{control.id}}\" \r\n class=\"asw-input-label {{(input.invalid && (input.dirty || input.touched)) ? 'asw-red-color' : ''}}\"\r\n [class.asw-invalid-label]=\"control.isRequired\">{{control.label | aswTranslate}}</label>\r\n <asw-datetimepicker #picker\r\n [type]=\"control.type\"\r\n [mode]=\"control.mode\"\r\n [multiYearSelector]=\"multiYearSelector\"\r\n [startView]=\"control.defaultView\"\r\n [twelvehour]=\"control.twelveHour\"\r\n [timeInterval]=\"timeInterval\"\r\n [touchUi]=\"touchUi\"\r\n [timeInput]=\"timeInput\">\r\n </asw-datetimepicker>\r\n <input \r\n [aswDatetimepicker]=\"picker\" \r\n #input=\"ngModel\"\r\n [id]=\"control.id\"\r\n class=\"asw-input-control {{control.customClass}}\"\r\n [class.asw-is-invalid]=\"input.invalid && (input.dirty || input.touched)\"\r\n [(ngModel)]=\"control.value\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [aswDatetimepickerFilter]=\"weekendsDatesFilter\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <asw-datetimepicker-toggle [for]=\"picker\" matSuffix class=\"asw-date-picker\"></asw-datetimepicker-toggle>\r\n <div *ngIf=\"input.invalid && (input.dirty || input.touched)\" class=\"invalid-feedback\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!control.isDisableWeekendDates\">\r\n <div class=\"asw-mb-3\">\r\n <label for=\"{{control.id}}\" \r\n class=\"asw-input-label {{(input.invalid && (input.dirty || input.touched)) ? 'asw-red-color' : ''}}\"\r\n [class.asw-invalid-label]=\"control.isRequired\">{{control.label | aswTranslate}}</label>\r\n <input \r\n [aswDatetimepicker]=\"datetimePicker\" \r\n #input=\"ngModel\"\r\n class=\"asw-input-control {{control.customClass}}\"\r\n [class.asw-is-invalid]=\"input.invalid && (input.dirty || input.touched)\"\r\n [id]=\"control.id\"\r\n [(ngModel)]=\"control.value\"\r\n [matTooltip]=\"control.tooltip | aswTranslate\"\r\n [placeholder]=\"control.label | aswTranslate\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <asw-datetimepicker-toggle [for]=\"datetimePicker\" matSuffix class=\"asw-date-picker\"></asw-datetimepicker-toggle>\r\n <asw-datetimepicker #datetimePicker\r\n [type]=\"control.type\"\r\n [mode]=\"control.mode\"\r\n [multiYearSelector]=\"multiYearSelector\"\r\n [startView]=\"control.defaultView\"\r\n [twelvehour]=\"control.twelveHour\"\r\n [timeInterval]=\"timeInterval\"\r\n [touchUi]=\"touchUi\"\r\n [timeInput]=\"timeInput\">\r\n </asw-datetimepicker>\r\n <div *ngIf=\"input.invalid && (input.dirty || input.touched)\" class=\"invalid-feedback\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label | aswTranslate}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <!-- <ng-container *ngSwitchCase=\"'daterange'\">\r\n <ng-container *ngIf=\"control.isDisableWeekendDates\">\r\n <mat-form-field [appearance]=\"control.style\" class=\"asw-width-100 {{control.customClass}}\">\r\n <mat-label>{{control.label}}</mat-label>\r\n <mat-date-range-input [(ngModel)]=\"control.value\"\r\n [rangePicker]=\"picker\"\r\n #input=\"ngModel\"\r\n [id]=\"control.id\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [matTooltip]=\"control.tooltip\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [dateFilter]=\"weekendsDatesFilter\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <input matStartDate >\r\n <input matEndDate >\r\n </mat-date-range-input> \r\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n <mat-error *ngIf=\"input.invalid && (input.dirty || input.touched)\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label}} {{'FormControl.IsRequired' | aswTranslate}}\r\n </ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-container>\r\n <ng-container *ngIf=\"!control.isDisableWeekendDates\">\r\n <mat-form-field [appearance]=\"control.style\" class=\"asw-width-100 {{control.customClass}}\">\r\n <mat-label>{{control.label}}</mat-label>\r\n <input matInput \r\n [matDatepicker]=\"picker\" \r\n #input=\"ngModel\"\r\n [id]=\"control.id\"\r\n [(ngModel)]=\"control.value\"\r\n [matTooltip]=\"control.tooltip\"\r\n [placeholder]=\"control.label\"\r\n (dateChange)=\"onDateChange(control)\"\r\n [min]=\"control.minDate\" \r\n [max]=\"control.maxDate\"\r\n [required]=\"control.isRequired\"\r\n [disabled]=\"control.isDisabled ? true : false\">\r\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n <mat-error *ngIf=\"input.invalid && (input.dirty || input.touched)\">\r\n <ng-container *ngIf=\"input?.errors?.required\">\r\n {{control.label}} {{'FormControl.IsRequired' | aswTranslate}}\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>\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)=\"duplicateDatepickerControl(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)=\"editDatepickerDialog(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)=\"deleteDatepickerDialog(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 }], CSSFramework: [{ type: Input }], isPreviewTemplate: [{ type: Input }], propertyPersonalization: [{ type: Input }], datepickerUpdateEvent: [{ type: Output }], datepickerDeleteEvent: [{ type: Output }], dateChange: [{ type: Output }], duplicateControl: [{ type: Output }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXBpY2tlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL2Zvcm0tY29udHJvbC9kYXRlcGlja2VyL2RhdGVwaWNrZXIudHMiLCIuLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9mb3JtLWNvbnRyb2wvZGF0ZXBpY2tlci9kYXRlcGlja2VyLmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUV2RSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQ0FBc0MsQ0FBQztBQUN4RSxPQUFPLEVBQUUsU0FBUyxFQU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nOyBlbHNlIGJvb3RzdHJhcFwiPlxyXG4gICAgICAgIDxuZy1jb250YWluZXIgW25nU3dpdGNoXT1cImNvbnRyb2wuY29udHJvbFR5cGVcIj5cclxuICAgICAgICAgICAgPG5nLWNvbnRhaW5lciAqbmdTd2l0Y2hDYXNlPVwiJ2RhdGVwaWNrZXInXCI+XHJcbiAgICAgICAgICAgICAgICA8bmctY29udGFpbmVyICpuZ0lmPVwiY29udHJvbC5pc0Rpc2FibGVXZWVrZW5kRGF0ZXNcIj5cclxuICAgICAgICAgICAgICAgICAgICA8bWF0LWZvcm0tZmllbGQgW2FwcGVhcmFuY2VdPVwiY29udHJvbC5zdHlsZVwiIGNsYXNzPVwiYXN3LXdpZHRoLTEwMCB7e2NvbnRyb2wuY3VzdG9tQ2xhc3N9fVwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8bWF0LWxhYmVsPnt7Y29udHJvbC5sYWJlbCB8IGFzd1RyYW5zbGF0ZX19PC9tYXQtbGFiZWw+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDxhc3ctZGF0ZXRpbWVwaWNrZXIgI3BpY2tlclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3R5cGVdPVwiY29udHJvbC50eXBlXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFttb2RlXT1cImNvbnRyb2wubW9kZVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbbXVsdGlZZWFyU2VsZWN0b3JdPVwibXVsdGlZZWFyU2VsZWN0b3JcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3N0YXJ0Vmlld109XCJjb250cm9sLmRlZmF1bHRWaWV3XCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt0d2VsdmVob3VyXT1cImNvbnRyb2wudHdlbHZlSG91clwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdGltZUludGVydmFsXT1cInRpbWVJbnRlcnZhbFwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdG91Y2hVaV09XCJ0b3VjaFVpXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt0aW1lSW5wdXRdPVwidGltZUlucHV0XCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvYXN3LWRhdGV0aW1lcGlja2VyPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgbWF0SW5wdXQgXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbYXN3RGF0ZXRpbWVwaWNrZXJdPVwicGlja2VyXCIgXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAjaW5wdXQ9XCJuZ01vZGVsXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtpZF09XCJjb250cm9sLmlkXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsobmdNb2RlbCldPVwiY29udHJvbC52YWx1ZVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbbWF0VG9vbHRpcF09XCJjb250cm9sLnRvb2x0aXAgfCBhc3dUcmFuc2xhdGVcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3BsYWNlaG9sZGVyXT1cImNvbnRyb2wubGFiZWwgfCBhc3dUcmFuc2xhdGVcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRhdGVDaGFuZ2UpPVwib25EYXRlQ2hhbmdlKGNvbnRyb2wpXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFttaW5dPVwiY29udHJvbC5taW5EYXRlXCIgXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbbWF4XT1cImNvbnRyb2wubWF4RGF0ZVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbYXN3RGF0ZXRpbWVwaWNrZXJGaWx0ZXJdPVwid2Vla2VuZHNEYXRlc0ZpbHRlclwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbcmVxdWlyZWRdPVwiY29udHJvbC5pc1JlcXVpcmVkXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtkaXNhYmxlZF09XCJjb250cm9sLmlzRGlzYWJsZWQgPyB0cnVlIDogZmFsc2VcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPGFzdy1kYXRldGltZXBpY2tlci10b2dnbGUgW2Zvcl09XCJwaWNrZXJcIiBtYXRTdWZmaXg+PC9hc3ctZGF0ZXRpbWVwaWNrZXItdG9nZ2xlPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8bWF0LWVycm9yICpuZ0lmPVwiaW5wdXQuaW52YWxpZCAmJiAoaW5wdXQuZGlydHkgfHwgaW5wdXQudG91Y2hlZClcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxuZy1jb250YWluZXIgKm5nSWY9XCJpbnB1dD8uZXJyb3JzPy5yZXF1aXJlZFwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7Y29udHJvbC5sYWJlbCB8IGFzd1RyYW5zbGF0ZX19ICB7eydGb3JtQ29udHJvbC5Jc1JlcXVpcmVkJyB8IGFzd1RyYW5zbGF0ZX19XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L25nLWNvbnRhaW5lcj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtZXJyb3I+XHJcbiAgICAgICAgICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cclxuICAgICAgICAgICAgICAgIDwvbmctY29udGFpbmVyPlxyXG4gICAgICAgICAgICAgICAgPG5nLWNvbnRhaW5lciAqbmdJZj1cIiFjb250cm9sLmlzRGlzYWJsZVdlZWtlbmREYXRlc1wiPlxyXG4gICAgICAgICAgICAgICAgICAgIDxtYXQtZm9ybS1maWVsZCBbYXBwZWFyYW5jZV09XCJjb250cm9sLnN0eWxlXCIgY2xhc3M9XCJhc3ctd2lkdGgtMTAwIHt7Y29udHJvbC5jdXN0b21DbGFzc319XCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtbGFiZWw+e3tjb250cm9sLmxhYmVsIHwgYXN3VHJhbnNsYXRlfX08L21hdC1sYWJlbD5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPGFzdy1kYXRldGltZXBpY2tlciAjZGF0ZXRpbWVQaWNrZXJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt0eXBlXT1cImNvbnRyb2wudHlwZVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbbW9kZV09XCJjb250cm9sLm1vZGVcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAg