UNPKG

ngx-bootstrap

Version:
41 lines 2.55 kB
import { Component, EventEmitter, Input, Output } from '@angular/core'; import { BsNavigationDirection } from '../../models/index'; var BsMonthCalendarViewComponent = (function () { function BsMonthCalendarViewComponent() { this.onNavigate = new EventEmitter(); this.onViewMode = new EventEmitter(); this.onSelect = new EventEmitter(); this.onHover = new EventEmitter(); } BsMonthCalendarViewComponent.prototype.navigateTo = function (event) { var step = BsNavigationDirection.DOWN === event ? -1 : 1; this.onNavigate.emit({ step: { year: step } }); }; BsMonthCalendarViewComponent.prototype.viewMonth = function (month) { this.onSelect.emit(month); }; BsMonthCalendarViewComponent.prototype.hoverMonth = function (cell, isHovered) { this.onHover.emit({ cell: cell, isHovered: isHovered }); }; BsMonthCalendarViewComponent.prototype.changeViewMode = function (event) { this.onViewMode.emit(event); }; BsMonthCalendarViewComponent.decorators = [ { type: Component, args: [{ selector: 'bs-month-calendar-view', template: "\n <bs-calendar-layout>\n <bs-datepicker-navigation-view\n [calendar]=\"calendar\"\n (onNavigate)=\"navigateTo($event)\"\n (onViewMode)=\"changeViewMode($event)\"\n ></bs-datepicker-navigation-view>\n\n <table role=\"grid\" class=\"months\">\n <tbody>\n <tr *ngFor=\"let row of calendar.months\">\n <td *ngFor=\"let month of row\" role=\"gridcell\"\n (click)=\"viewMonth(month)\"\n (mouseenter)=\"hoverMonth(month, true)\"\n (mouseleave)=\"hoverMonth(month, false)\"\n [class.disabled]=\"month.isDisabled\"\n [class.is-highlighted]=\"month.isHovered\">\n <span>{{ month.label }}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </bs-calendar-layout>\n " },] }, ]; /** @nocollapse */ BsMonthCalendarViewComponent.ctorParameters = function () { return []; }; BsMonthCalendarViewComponent.propDecorators = { 'calendar': [{ type: Input },], 'onNavigate': [{ type: Output },], 'onViewMode': [{ type: Output },], 'onSelect': [{ type: Output },], 'onHover': [{ type: Output },], }; return BsMonthCalendarViewComponent; }()); export { BsMonthCalendarViewComponent }; //# sourceMappingURL=bs-months-calendar-view.component.js.map