/**
 * @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 { MatDialog } from '@angular/material/dialog';
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%',
            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: "16.2.2", ngImport: i0, type: AswDatepicker, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", 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}}</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\"\r\n                            [placeholder]=\"control.label\"\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}}  {{'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                        <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\"\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                        <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}}  {{'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}}</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\"\r\n                            [placeholder]=\"control.label\"\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}}  {{'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}}</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\"\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                        <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}}  {{'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]", inputs: ["disabled", "disableRipple", "color"], 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]", 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: "16.2.2", 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}}</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\"\r\n                            [placeholder]=\"control.label\"\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}}  {{'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                        <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\"\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                        <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}}  {{'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}}</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\"\r\n                            [placeholder]=\"control.label\"\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}}  {{'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}}</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\"\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                        <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}}  {{'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: function () { return [{ 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, 