import { EventEmitter, Input, Output, HostListener, Component, ElementRef, ViewContainerRef, ComponentFactoryResolver, ViewChildren, forwardRef, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MultiLingualData } from '@rxweb/localization';
import { OverlayViewHost, OverlayPositionHost, OffSetModel, ComponentView } from '@rxweb/angular/api';

var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let RxPickerComponent = class RxPickerComponent {
    constructor() {
        this.weekStart = 2;
        this.viewMode = "Date";
        this.selectDate = new EventEmitter();
        this.hoverEvent = new EventEmitter();
    }
    changeViewMode(mode, currentMonth, currentYear) {
        if (currentMonth !== undefined) {
            this.month = currentMonth;
            this.year = currentYear;
        }
        this.viewMode = mode;
    }
    onMouseover() {
        this.hoverEvent.emit(false);
    }
    onMouseleave() {
        this.hoverEvent.emit(true);
    }
};
__decorate([
    Input()
], RxPickerComponent.prototype, "value", void 0);
__decorate([
    Input()
], RxPickerComponent.prototype, "weekStart", void 0);
__decorate([
    Input()
], RxPickerComponent.prototype, "viewMode", void 0);
__decorate([
    Input()
], RxPickerComponent.prototype, "disableWeekDays", void 0);
__decorate([
    Input()
], RxPickerComponent.prototype, "highlightWeekDays", void 0);
__decorate([
    Input()
], RxPickerComponent.prototype, "datesDisabled", void 0);
__decorate([
    Output()
], RxPickerComponent.prototype, "selectDate", void 0);
__decorate([
    Output()
], RxPickerComponent.prototype, "hoverEvent", void 0);
__decorate([
    HostListener('mouseover')
], RxPickerComponent.prototype, "onMouseover", null);
__decorate([
    HostListener('mouseleave')
], RxPickerComponent.prototype, "onMouseleave", null);
RxPickerComponent = __decorate([
    Component({
        selector: "rx-picker",
        template: "<rx-date-picker #datePicker [value]=\"value\" [disableWeekDays]=\"disableWeekDays\" [highlightWeekDays]=\"highlightWeekDays\" [datesDisabled]=\"datesDisabled\" [style.display]=\"viewMode === 'Date' ? '' : 'none'\" [weekStart]=\"weekStart\"></rx-date-picker>\n<rx-month-picker [month]=\"month\" [year]=\"year\" [style.display]=\"viewMode === 'Month' ? '' : 'none'\" (monthClick)=\"datePicker.show($event)\"></rx-month-picker>\n"
    })
], RxPickerComponent);

class DateDisabled {
    constructor(date, title) {
        this.date = date;
        this.title = title;
    }
}
class DateCollection {
}
class Week {
}
class Day {
    constructor(date, selected, isPreviousMonthDay, year, month, day, monthDate, isDisabled, isHighlighted, dateDisabled) {
        this.date = date;
        this.selected = selected;
        this.isPreviousMonthDay = isPreviousMonthDay;
        this.year = year;
        this.month = month;
        this.day = day;
        this.monthDate = monthDate;
        this.isDisabled = isDisabled;
        this.isHighlighted = isHighlighted;
        this.dateDisabled = dateDisabled;
    }
}

const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
const daysShort = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
const daysMin = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
const monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

var __decorate$1 = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let RxDatePickerComponent = class RxDatePickerComponent {
    constructor(dateComponent) {
        this.dateComponent = dateComponent;
        this.weekStart = 0;
        this.viewModeClick = new EventEmitter();
        this.monthsShort = monthsShort;
    }
    ngOnInit() {
        this.dayShortNames = new Array();
        var dayCount = this.weekStart;
        daysMin.forEach(t => {
            this.dayShortNames.push(daysMin[dayCount]);
            if (dayCount == 6)
                dayCount = 0;
            else
                dayCount++;
        });
    }
    ngAfterContentInit() {
        this.value = (this.value) ? this.value : new Date();
        this.currentMonth = this.value.getMonth();
        this.make(this.value);
    }
    make(date) {
        var dc = this.dateComponent;
        this.dateCollection = new DateCollection();
        var year = date.getFullYear(), month = date.getMonth();
        this.dateCollection.nextMonth = this.utcDate(year, month + 1, 28);
        this.dateCollection.previousMonth = this.utcDate(year, month - 1, 28);
        var prevMonth = this.utcDate(year, month - 1, 28), day = this.daysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
        prevMonth.setDate(day);
        prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7) % 7);
        var nextMonth = new Date(prevMonth.toString());
        nextMonth.setDate(nextMonth.getDate() + 42);
        var nextMonthValueOf = nextMonth.valueOf();
        this.dateCollection.year = year;
        this.dateCollection.monthName = months[month];
        this.dateCollection.month = month;
        var dayCount = this.weekStart;
        this.dateCollection.weeks = new Array();
        var days;
        while (prevMonth.valueOf() < nextMonthValueOf) {
            if (dayCount === this.weekStart) {
                var week = new Week();
                week.days = new Array();
            }
            var isWeekDayDisable = (this.disableWeekDays && this.disableWeekDays.length && this.disableWeekDays.filter(t => t == dayCount).length !== 0);
            var isHighlightWeekDay = (this.highlightWeekDays && this.highlightWeekDays.length && this.highlightWeekDays.filter(t => t == dayCount).length !== 0);
            let dateDisabled = (this.datesDisabled &&
                this.datesDisabled.length &&
                this.datesDisabled.filter(t => t.date.getMonth() == prevMonth.getMonth() &&
                    t.date.getFullYear() == prevMonth.getFullYear() &&
                    t.date.getDate() == prevMonth.getDate())[0]);
            week.days.push(new Day(this.utcDate(prevMonth.getFullYear(), prevMonth.getMonth(), prevMonth.getDate()), (this.value.getDate() == prevMonth.getDate() && this.value.getMonth() == prevMonth.getMonth()), prevMonth.getMonth() !== month, prevMonth.getFullYear(), prevMonth.getMonth(), prevMonth.getDay(), prevMonth.getDate(), isWeekDayDisable, isHighlightWeekDay, dateDisabled));
            prevMonth.setDate(prevMonth.getDate() + 1);
            if (dayCount == 6) {
                dayCount = 0;
                this.dateCollection.weeks.push(week);
            }
            else {
                dayCount++;
            }
        }
    }
    changeViewMode() {
        this.dateComponent.changeViewMode("Month", this.dateCollection.month, this.dateCollection.year);
    }
    nextMonth(date) {
        this.make(date);
    }
    previousMonth(date) {
        this.make(date);
    }
    show(date) {
        this.make(date);
    }
    select(day) {
        if (!day.isDisabled && !day.dateDisabled) {
            this.deSelect();
            day.selected = true;
            this.dateComponent.selectDate.emit(day.date);
        }
    }
    deSelect() {
        for (let week of this.dateCollection.weeks) {
            var selectedDay = week.days.filter(t => t.selected);
            if (selectedDay.length > 0)
                selectedDay[0].selected = false;
        }
    }
    isLeapYear(year) {
        return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
    }
    daysInMonth(year, month) {
        return [31, (this.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
    }
    utcDate(year, month, days) {
        return new Date(year, month, days, 15, 30, 0, 0);
    }
};
RxDatePickerComponent.ctorParameters = () => [
    { type: RxPickerComponent }
];
__decorate$1([
    Input()
], RxDatePickerComponent.prototype, "value", void 0);
__decorate$1([
    Input()
], RxDatePickerComponent.prototype, "weekStart", void 0);
__decorate$1([
    Input()
], RxDatePickerComponent.prototype, "disableWeekDays", void 0);
__decorate$1([
    Input()
], RxDatePickerComponent.prototype, "highlightWeekDays", void 0);
__decorate$1([
    Input()
], RxDatePickerComponent.prototype, "datesDisabled", void 0);
__decorate$1([
    Output()
], RxDatePickerComponent.prototype, "viewModeClick", void 0);
RxDatePickerComponent = __decorate$1([
    Component({
        selector: "rx-date-picker",
        template: "<div class=\"datepicker-days\" style=\"display: block;\">\n    <table class=\"table-condensed\">\n        <thead>\n          <tr>\n            <th class=\"next\" style=\"visibility: visible;\" (click)=\"previousMonth(dateCollection.previousMonth)\"><i class=\"fa fa-chevron-left\"></i></th>\n            <th colspan=\"5\" class=\"datepicker-switch\" (click)=\"changeViewMode()\">{{dateCollection.monthName }} {{dateCollection.year}}</th>\n            <th class=\"next\" style=\"visibility: visible;\" (click)=\"nextMonth(dateCollection.nextMonth)\"><i class=\"fa fa-chevron-right\"></i></th>\n          </tr>\n            <tr><th class=\"dow\" *ngFor=\"let week of dayShortNames\">{{week}}</th></tr>\n        </thead>\n        <tbody>\n            <tr *ngFor=\"let week of dateCollection.weeks\">\n                <td *ngFor=\"let day of week.days\" class=\"day\" (click)=\"select(day)\" [class.old]=\"day.isPreviousMonthDay\" [class.disabled]=\"day.isDisabled || day.dateDisabled\" [title]=\"day.dateDisabled ? day.dateDisabled.title : ''\" [class.highlighted]=\"day.isHighlighted\" [class.active]=\"day.selected\">{{day.monthDate}}</td>\n            </tr>\n        </tbody>\n        <tfoot>\n        </tfoot>\n    </table>\n</div>\n",
        exportAs: 'date-picker'
    })
], RxDatePickerComponent);

var __decorate$2 = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let RxMonthPicker = class RxMonthPicker {
    constructor(dateComponent) {
        this.dateComponent = dateComponent;
        this.isLabelYear = true;
        this.monthClick = new EventEmitter();
        this.monthsShort = monthsShort;
    }
    showDates(month) {
        this.dateComponent.changeViewMode("Date");
        var date = this.utcDate(this.year, month, 28);
        this.monthClick.emit(date);
    }
    nextYear() {
        this.year = this.year + 1;
    }
    previousYear() {
        this.year = this.year - 1;
    }
    showYearInput() {
        this.isLabelYear = !this.isLabelYear;
    }
    utcDate(year, month, days) {
        return new Date(year, month, days, 15, 30, 0, 0);
    }
};
RxMonthPicker.ctorParameters = () => [
    { type: RxPickerComponent }
];
__decorate$2([
    Input()
], RxMonthPicker.prototype, "month", void 0);
__decorate$2([
    Input()
], RxMonthPicker.prototype, "year", void 0);
__decorate$2([
    Output()
], RxMonthPicker.prototype, "monthClick", void 0);
RxMonthPicker = __decorate$2([
    Component({
        selector: "rx-month-picker",
        template: "<div class=\"datepicker-months\" style=\"display: block;\">\n    <table class=\"table-condensed\">\n        <thead>\n          <tr>\n            <th class=\"next\" style=\"visibility: visible;\" (click)=\"previousYear()\"><i class=\"fa fa-chevron-left\"></i></th>\n            <th colspan=\"5\" class=\"datepicker-switch\"><span *ngIf=\"isLabelYear\">{{year}}</span> <input *ngIf=\"!isLabelYear\" (blur)=\"showYearInput()\" type=\"number\" min=\"1900\" max=\"5000\" class=\"form-control\" [(ngModel)]=\"year\" /> </th>\n            <th class=\"next\" style=\"visibility: visible;\" (click)=\"nextYear()\"><i class=\"fa fa-chevron-right\"></i></th>\n          </tr>\n        </thead>\n        <tbody>\n            <tr>\n                <td colspan=\"7\"><span class=\"month\" (click)=\"showDates(monthIndex)\" *ngFor=\"let month of monthsShort; let monthIndex = index;\" [class.focus]=\"monthIndex == currentMonth\">{{month}} </span></td>\n            </tr>\n        </tbody>\n        <tfoot><tr><th colspan=\"7\" class=\"today\" style=\"display: none;\">Today</th></tr><tr><th colspan=\"7\" class=\"clear\" style=\"display: none;\">Clear</th></tr></tfoot>\n    </table>\n</div>\n"
    })
], RxMonthPicker);

var __decorate$3 = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var RxDateComponent_1;
let RxDateComponent = RxDateComponent_1 = class RxDateComponent {
    constructor(elementRef, viewContainerRef, componentFactoryResolver) {
        this.elementRef = elementRef;
        this.viewContainerRef = viewContainerRef;
        this.componentFactoryResolver = componentFactoryResolver;
        this.isInValid = false;
        this.isValidationSuccess = true;
        this.propagateChange = () => { };
        this.dateFormatPattern = /^(\d*)(\.|-|\/)(\d*)(\.|-|\/)(\d*)$/;
        this.validateFn = () => { };
        this.isMouseLeave = true;
        this.isPrependClick = false;
        this.onSelected = new EventEmitter();
        this.weekStart = 0;
        this.viewMode = "Date";
        this.format = MultiLingualData.get("global.internationalization.date.format");
        this.seperator = MultiLingualData.get("global.internationalization.date.separator");
        this.placeholder = this.placeholder || MultiLingualData.get("global.control.rx-date.placeholder");
        this.placeholder = this.placeholder || "";
        this.overlayViewHost = new OverlayViewHost(document);
        this.overlayPositionHost = new OverlayPositionHost();
        this.element = elementRef.nativeElement;
    }
    set formControl(value) {
        this._formControl = value;
        this.writeValue(this._formControl.value);
        this.registerOnChange(this._formControl.setValue.bind(this._formControl));
    }
    get formControl() {
        return this._formControl;
    }
    registerOnChange(fn) {
        this.propagateChange = fn;
        if (this.value) {
            this.propagateChange(this.value);
        }
    }
    ngOnInit() {
        this.element.classList.add("custom-control-style");
        this.checkValid(true);
        if (this.conditional)
            this.conditionalSubscription = this.conditional.subscribe(t => this.checkValid(t));
    }
    checkValid(isValid) {
        if (isValid)
            this.timeOutId = window.setTimeout(() => {
                for (var i = 0; i < this.element.classList.length; i++) {
                    this.isInValid = this.element.classList[i] == "ng-invalid";
                }
                window.clearTimeout(this.timeOutId);
                this.timeOutId = undefined;
            }, 500);
        else
            this.isInValid = isValid;
    }
    registerOnTouched() { }
    writeValue(value) {
        if (value) {
            if (typeof value === 'string') {
                value = new Date(value);
                value = this.utcDate(value.getFullYear(), value.getMonth(), value.getDate());
            }
            this.value = value;
            this.selectedDate = this.makeDateString(value);
        }
        else {
            this.value = value;
            this.selectedDate = value;
        }
        this.onSelected.emit(this.value);
    }
    utcDate(year, month, days) {
        return new Date(year, month, days, 15, 30, 0, 0);
    }
    makeDateString(value) {
        let dateString = '';
        for (let character of this.format) {
            switch (character) {
                case 'm':
                    dateString += dateString.length == 0 ? (value.getMonth() + 1).toString() : this.seperator + (value.getMonth() + 1);
                    break;
                case 'd':
                    dateString += dateString.length == 0 ? (value.getDate()).toString() : this.seperator + (value.getDate());
                    break;
                case 'y':
                    dateString += dateString.length == 0 ? (value.getFullYear()).toString() : this.seperator + (value.getFullYear());
                    break;
            }
        }
        return dateString;
    }
    isValidDate(value) {
        let date;
        let dateNumber;
        if (this.dateFormatPattern.test(value)) {
            var splitValue = value.split(this.seperator);
            let dateString = '';
            if (splitValue.length == 3) {
                for (let character of 'mdy') {
                    var index = this.format.indexOf(character);
                    dateString += dateString.length == 0 ? splitValue[index].toString() : "/" + splitValue[index].toString();
                    if (character == "d")
                        dateNumber = parseInt(splitValue[index]);
                    if (character === 'y') {
                        if (parseInt(splitValue[index]) > 1699 && parseInt(splitValue[index]) < 3001) {
                            date = new Date(dateString);
                            date.setHours(15, 30, 0);
                        }
                    }
                }
            }
        }
        if (date && dateNumber == date.getDate())
            return date;
        return undefined;
    }
    validate(formControl) {
        return (this.isValidationSuccess) ? null : { dateError: 'Invalid Date' };
    }
    changeViewMode(mode, currentMonth, currentYear) {
        if (currentMonth) {
            this.month = currentMonth;
            this.year = currentYear;
        }
        this.viewMode = mode;
    }
    onFocus(event) {
        if (!this.pickerDisabled)
            if (!this.componentView) {
                this.createPicker();
                this.isPrependClick = true;
            }
    }
    prependClick(event) {
        if (!this.pickerDisabled) {
            if (!this.componentView && !this.isPrependClick) {
                this.inputDate.first.nativeElement.focus();
                this.onFocus(event);
            }
            else {
                this.isPrependClick = false;
            }
        }
    }
    onKeyup(value) {
        if (value) {
            let date = this.isValidDate(value);
            this.isValidationSuccess = date && date.toString() !== "Invalid Date";
            if (this.isValidationSuccess)
                this.isInValid = false, this.propagateChange(this.utcDate(date.getFullYear(), date.getMonth(), date.getDate()));
            else
                this.isInValid = true, this.propagateChange(undefined);
        }
        else
            this.propagateChange(undefined), window.setTimeout(() => this.checkValid(true), 200);
    }
    onBlur(event, element) {
        if (this.isMouseLeave)
            this.removePicker();
        let date = this.isValidDate(element.value);
        this.isValidationSuccess = date && date.toString() !== "Invalid Date";
        if (this.isValidationSuccess)
            this.setValue(date, true);
        if (!this.isValidationSuccess) {
            element.value = '';
        }
    }
    createPicker() {
        this.setOverlay();
        if (this.timeOutId)
            window.clearTimeout(this.timeOutId);
        this.timeOutId = window.setTimeout(() => {
            this.showPicker();
        }, 2);
    }
    setOverlay() {
        var pickerElement = this.createPickerComponent();
        this.overlayViewHost.createElement(["datepicker", "datepicker-dropdown", "dropdown-menu", "datepicker-orient-left", "datepicker-orient-bottom"]);
        this.overlayViewHost.appendChild(pickerElement);
    }
    removePicker() {
        if (this.componentView) {
            this.componentView.destroy();
            this.overlayViewHost.destroy();
            this.componentView = undefined;
            this.isPrependClick = false;
        }
    }
    showPicker() {
        let offSetModel = new OffSetModel("bottom", this.overlayPositionHost.getClientRectangle(this.elementRef.nativeElement), this.overlayPositionHost.getOffset(this.elementRef.nativeElement), this.overlayPositionHost.getOffset(this.overlayViewHost.element), false);
        var calculatedOffset = this.overlayPositionHost.getCalculatedOffset(offSetModel);
        this.overlayViewHost.applyPlacement(calculatedOffset);
        this.overlayViewHost.setStyle({ 'display': 'block', 'z-index': 9999 });
    }
    createPickerComponent() {
        this.componentView = new ComponentView(RxPickerComponent, this.viewContainerRef, this.componentFactoryResolver);
        this.componentView.create({
            'value': this.value,
            'weekStart': this.weekStart,
            'viewMode': this.viewMode,
            'disableWeekDays': this.disableWeekDays,
            'highlightWeekDays': this.highlightWeekDays,
            'datesDisabled': this.datesDisabled
        });
        let componentRef = this.componentView.getComponentRef();
        this.selectDateSubscription = componentRef.instance.selectDate.subscribe(t => {
            this.setValue(t);
        });
        this.hoverSubscriber = componentRef.instance.hoverEvent.subscribe(t => this.onHover(t));
        return this.componentView.rootNode();
    }
    setValue(value, isBlur = false) {
        this.isInValid = false;
        this.propagateChange(value);
        this.writeValue(value);
        if (this.inputDate && !isBlur)
            this.inputDate.first.nativeElement.focus();
    }
    onHover(value) {
        this.isMouseLeave = value;
        if (this.isMouseLeave)
            this.removePicker();
    }
    ngOnDestroy() {
        this.removePicker();
        if (this.selectDateSubscription) {
            this.selectDateSubscription.unsubscribe();
            this.hoverSubscriber.unsubscribe();
        }
        if (this.conditionalSubscription)
            this.conditionalSubscription.unsubscribe();
    }
};
RxDateComponent.ctorParameters = () => [
    { type: ElementRef },
    { type: ViewContainerRef },
    { type: ComponentFactoryResolver }
];
__decorate$3([
    ViewChildren('inputDate')
], RxDateComponent.prototype, "inputDate", void 0);
__decorate$3([
    Output()
], RxDateComponent.prototype, "onSelected", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "placeholder", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "weekStart", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "viewMode", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "disableWeekDays", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "highlightWeekDays", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "datesDisabled", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "pickerClass", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "conditional", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "pickerDisabled", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "showAddon", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "controlTabIndex", void 0);
__decorate$3([
    Input()
], RxDateComponent.prototype, "formControl", null);
RxDateComponent = RxDateComponent_1 = __decorate$3([
    Component({
        selector: "rx-date",
        template: `<div class="input-group"><input [tabindex]="controlTabIndex" type="text" #inputDate [disabled]="pickerDisabled" [placeholder]="placeholder" [class]="pickerClass" (click)="onFocus($event)" (focus)="onFocus($event)" 
                        (blur)="onBlur($event,$event.target)" (keyup)="onKeyup($event.target.value)" [(ngModel)]="selectedDate" />
    <div *ngIf="showAddon" class="input-group-append" (click)="prependClick($event)">
                              <span class="input-group-text"><i class="fa fa-calendar" ></i></span>
                            </div></div>
`,
        providers: [
            { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => RxDateComponent_1), multi: true },
        ],
        entryComponents: [RxPickerComponent]
    })
], RxDateComponent);
let RxDatePickerModule = class RxDatePickerModule {
};
RxDatePickerModule = __decorate$3([
    NgModule({
        imports: [CommonModule, FormsModule, ReactiveFormsModule],
        exports: [RxDateComponent, RxDatePickerComponent, RxMonthPicker, RxPickerComponent],
        declarations: [RxDateComponent, RxDatePickerComponent, RxMonthPicker, RxPickerComponent]
    })
], RxDatePickerModule);

/**
 * Generated bundle index. Do not edit.
 */

export { DateCollection, DateDisabled, Day, RxDateComponent, RxDatePickerModule, Week, RxPickerComponent as ɵa, RxDatePickerComponent as ɵb, RxMonthPicker as ɵc };
//# sourceMappingURL=rxweb-angular-datepicker.js.map
