{"version":3,"file":"kendo.scheduler.yearview.min.js","names":["global","factory","exports","module","require","define","amd","globalThis","self","kendoscheduler","yearview","js","this","$","undefined$1","kendo","window","ui","encode","htmlEncode","SchedulerView","extend","template","firstDayOfYear","date","firstDayOfMonth","lastDayOfMonth","NAVIGATE","KEYDOWN","CLICK","FOCUS","NS","YearViewStyles","layout","body","tooltip","indicator","event","hidden","calendarView","scheduler","TOOLTIP_TEMPLATE","events","messages","format","length","map","title","resources","attr","color","start","join","noData","YearView","init","element","options","that","fn","call","_yearRange","_templates","_layout","_initCalendar","_initTooltip","name","months","startDate","selectedDateFormat","selectedShortDateFormat","selectedMobileDateFormat","tooltipTemplate","tempEnd","_startDate","setFullYear","getFullYear","Date","setMonth","getMonth","_endDate","settings","Template","templateSettings","styles","content","addClass","append","calendar","calEl","calendarElement","MultiViewCalendar","views","value","showViewHeader","footer","selectable","_disableCalendarSelection","header","toggleClass","on","_calendarCellClick","bind","_calendarKeydown","_calendarNavigate","ev","target","first","preventDefault","stopPropagation","_displayTooltip","keys","keyCode","ENTER","SPACEBAR","navigationDate","sender","_firstViewValue","previousDate","nextDate","trigger","view","_focusCellOnNavigate","focusDate","find","getKendoMultiViewCalendar","lastDateInRange","_focusCell","_cellByDate","off","_move","tooltipElement","_buildTooltipTemplate","Tooltip","filter","showOn","position","width","show","setTimeout","applyStylesFromKendoAttributes","popup","_initTooltipPopup","_tooltipShow","_tooltipHide","_initPopup","_tooltipTitleClick","_tooltipKeydown","parseDate","current","data","eventsByDate","dateData","toString","items","eventResources","_inverseTooltipEventsColor","each","_inverseEventColor","refresh","focus","_navigateToDayView","shiftKey","is","TAB","firstFocusable","lastFocusable","last","grep","isPlainObject","type","removeClass","_renderEventIndicators","cell","remove","forEach","_currentView","toDateString","querySelector","appendTo","_groupEventsByDate","eventsFormatted","formattedDate","Query","sort","field","dir","group","toArray","_resourceBySlot","end","nextYear","previousYear","endDate","moveToEvent","constrainSelection","inRange","select","selection","clearSelection","selectionByElement","index","_index","toD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AAOlM,KAAKmM,SAFZnM,KAAKmM,SAAWD,CAIxB,EAEAE,OAAQ,SAAStK,GACb,IAAIgB,EAAO9C,KAEX8C,EAAKuJ,cAAgBvK,EAErBgB,EAAK6F,aAAe7F,EAAK0H,mBAAmB1I,IAAW,GAEvDgB,EAAKkH,yBAELlH,EAAK8D,QAvdE,WAwdX,EAEA0F,QAAS,WACL,IAAIxJ,EAAO9C,KAEP8C,EAAKvB,UACLuB,EAAKvB,QAAQ+K,UACbxJ,EAAKvB,QAAU,MAGfuB,EAAK8B,WACL9B,EAAK8B,SAAS0H,UACdxJ,EAAK8B,SAAW,MAGhB9B,EAAKF,UACLE,EAAK2B,QAAQyF,SACbpH,EAAKF,QAAQyE,IAAIlG,IAGrBX,EAAcuC,GAAGuJ,QAAQtJ,KAAKhD,KAClC,IAGJS,GAAO,EAAMJ,EAAI,CACbqC,SAAUA,GAGjB,CAjgBD,CAigBGtC,OAAOD,MAAMoM,QACFpM,KAIjB","sourcesContent":["(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('kendo.scheduler.view.js'), require('kendo.multiviewcalendar.js'), require('kendo.tooltip.js')) :\n    typeof define === 'function' && define.amd ? define(['kendo.scheduler.view', 'kendo.multiviewcalendar', 'kendo.tooltip'], factory) :\n    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.kendoscheduler = global.kendoscheduler || {}, global.kendoscheduler.yearview = global.kendoscheduler.yearview || {}, global.kendoscheduler.yearview.js = factory()));\n})(this, (function () {\n    var __meta__ = {\n        id: \"scheduler.yearview\",\n        name: \"Scheduler Year View\",\n        category: \"web\",\n        description: \"The Scheduler Year View\",\n        depends: [ \"scheduler.view\", \"multiviewcalendar\", \"tooltip\" ],\n        hidden: true\n    };\n\n    (function($, undefined$1) {\n        var kendo = window.kendo,\n            ui = kendo.ui,\n            encode = kendo.htmlEncode,\n            SchedulerView = ui.SchedulerView,\n            extend = $.extend,\n            template = kendo.template,\n            firstDayOfYear = kendo.date.firstDayOfYear,\n            firstDayOfMonth = kendo.date.firstDayOfMonth,\n            lastDayOfMonth = kendo.date.lastDayOfMonth,\n            DAY = \"day\",\n            NAVIGATE = \"navigate\",\n            KEYDOWN = \"keydown\",\n            ACTIVATE = \"activate\",\n            SHOW = \"show\",\n            HIDE = \"hide\",\n            CLICK = \"click\",\n            FOCUS = \"focus\",\n            DOT = \".\",\n            NS = \".kendoYearView\";\n\n        var YearViewStyles = {\n            layout: \"k-scheduler-layout k-scheduler-layout-flex k-scheduler-yearview\",\n            body: \"k-scheduler-body\",\n            tooltip: \"k-scheduler-tooltip\",\n            indicator: \"k-day-indicator\",\n            event: \"k-tooltip-event\",\n            hidden: \"k-hidden\",\n            calendarView: \"k-calendar-view\",\n            scheduler: \"k-scheduler\"\n        };\n\n        var TOOLTIP_TEMPLATE = template(({ date, events, messages }) =>\n            \"<div class='k-tooltip-title k-text-center'>\" +\n                `<div class='k-month'>${encode(kendo.format('{0:MMM}', date))}</div>` +\n                `<div tabindex='0' class='k-link k-day k-text-primary'>${encode(kendo.format('{0:dd}', date))}</div>` +\n            \"</div>\" +\n            (events.length ?\n                \"<div class='k-tooltip-events-container'>\" +\n                    \"<div class='k-tooltip-events'>\" +\n                        events.map((event) =>\n                            `<div class=\"k-tooltip-event k-event\" title=\"${encode(event.title)}\" ${event.resources[0] ? `${kendo.attr(\"style-background-color\")}=\"${encode(event.resources[0].color)}\" ${kendo.attr(\"style-border-color\")}=\"${encode(event.resources[0].color)}\"` : ''}>` +\n                                `<div class='k-event-title k-text-ellipsis'>${encode(event.title)}</div>` +\n                                \"<span class='k-spacer'></span>\" +\n                                `<span class='k-event-time'>${encode(kendo.format('{0:t}', event.start))}</span>` +\n                            \"</div>\"\n                        ).join('') +\n                    \"</div>\" +\n                \"</div>\" :\n                `<div class='k-no-data k-text-center'>${encode(messages.noData)}</div>`)\n            );\n\n        var YearView = SchedulerView.extend({\n            init: function(element, options) {\n                var that = this;\n\n                SchedulerView.fn.init.call(that, element, options);\n\n                that._yearRange();\n\n                that._templates();\n\n                that._layout();\n\n                that._initCalendar();\n\n                that._initTooltip();\n            },\n\n            options: {\n                title: \"Year\",\n                name: \"year\",\n                months: 12,\n                startDate: null,\n                messages: {\n                    noData: \"No events on this date.\"\n                },\n                selectedDateFormat: \"{0:yyyy}\",\n                selectedShortDateFormat: \"{0:yyyy}\",\n                selectedMobileDateFormat: \"{0:yyyy}\",\n                tooltipTemplate: TOOLTIP_TEMPLATE\n            },\n\n            name: \"year\",\n\n            events: [ NAVIGATE ],\n\n            _yearRange: function() {\n                var that = this,\n                    options = that.options,\n                    tempEnd;\n\n                that._startDate = options.startDate ? firstDayOfMonth(options.startDate) : firstDayOfYear(options.date);\n                that._startDate.setFullYear(options.date.getFullYear());\n\n                tempEnd = new Date(that._startDate);\n                tempEnd.setMonth(tempEnd.getMonth() + options.months);\n                that._endDate = tempEnd;\n            },\n\n            _templates: function() {\n                var options = this.options,\n                    settings = extend({}, kendo.Template, options.templateSettings);\n\n                this.tooltipTemplate = kendo.template(options.tooltipTemplate, settings);\n            },\n\n            _layout: function() {\n                var that = this,\n                    styles = YearViewStyles;\n\n                that.content = $(\"<div/>\").addClass(styles.layout);\n                that.element.append(that.content);\n\n                that.body = $(\"<div/>\").addClass(styles.body);\n                that.content.append(that.body);\n            },\n\n            _initCalendar: function() {\n                var that = this,\n                    options = that.options,\n                    calendarElement = $(\"<div/>\"),\n                    calendar, calEl;\n\n                that.body.append(calendarElement);\n\n                that.calendar = calendar = new ui.MultiViewCalendar(calendarElement, {\n                    views: options.months,\n                    value: that.startDate(),\n                    showViewHeader: true,\n                    footer: false\n                });\n\n                calEl = calendar.element;\n\n                if (!options.selectable) {\n                    that._disableCalendarSelection();\n                }\n\n                calendar.value(null);\n\n                calendar.header.toggleClass(YearViewStyles.hidden);\n\n                calEl.on(CLICK + NS, \"td[role='gridcell']\", that._calendarCellClick.bind(that));\n                calEl.on(KEYDOWN + NS, DOT + YearViewStyles.calendarView, that._calendarKeydown.bind(that));\n                calendar.bind(NAVIGATE, that._calendarNavigate.bind(that));\n            },\n\n            _calendarCellClick: function(ev) {\n                var that = this,\n                    target = that.calendar.selectable.value().first();\n\n                ev.preventDefault();\n                ev.stopPropagation();\n\n                that._displayTooltip(target);\n            },\n\n            _calendarKeydown: function(ev) {\n                var that = this,\n                    keys = kendo.keys,\n                    keyCode = ev.keyCode;\n\n                if (keyCode == keys.ENTER || keyCode == keys.SPACEBAR) {\n                    ev.preventDefault();\n\n                    that._displayTooltip(that.calendar.selectable.value().first());\n                }\n            },\n\n            _calendarNavigate: function(ev) {\n                var that = this,\n                    calendar = ev.sender,\n                    isPrevious = calendar._firstViewValue < that.startDate(),\n                    navigationDate = isPrevious ? that.previousDate() : that.nextDate();\n\n                that.trigger(NAVIGATE, { view: \"year\", date: navigationDate });\n\n                that._focusCellOnNavigate();\n            },\n\n            _focusCellOnNavigate: function() {\n                var that = this,\n                    calendar = that.calendar || that.element.find(\".k-calendar\").getKendoMultiViewCalendar(),\n                    isPrevious,\n                    focusDate;\n\n                if (!calendar) {\n                    return;\n                }\n\n                isPrevious = calendar._firstViewValue < that.startDate();\n                focusDate = isPrevious ? that.lastDateInRange() : that.nextDate();\n                calendar._focusCell(calendar._cellByDate(focusDate), true);\n            },\n\n            _disableCalendarSelection: function() {\n                var that = this;\n\n                if (!that.calendar) {\n                    return;\n                }\n\n                that.calendar.value(null);\n                that.calendar.element.off(KEYDOWN, that.calendar._move);\n            },\n\n            _initTooltip: function() {\n                var that = this,\n                    tooltipElement = that.content,\n                    tooltipTemplate = that._buildTooltipTemplate.bind(that);\n\n                that.tooltip = new ui.Tooltip(tooltipElement, {\n                    filter: \".k-calendar td[role='gridcell']\",\n                    showOn: CLICK,\n                    position: \"right\",\n                    content: tooltipTemplate,\n                    width: 220,\n                    show: () => setTimeout(() => kendo.applyStylesFromKendoAttributes(that.tooltip.popup.element, [\"background-color\", \"border-color\"]))\n                });\n\n                that._initTooltipPopup();\n\n                that.tooltip.bind(SHOW, that._tooltipShow.bind(that));\n\n                that.tooltip.bind(HIDE, that._tooltipHide.bind(that));\n            },\n\n            _initTooltipPopup: function() {\n                var that = this,\n                    tooltip = that.tooltip;\n\n                if (!that.tooltip) {\n                    return;\n                }\n\n                tooltip._initPopup();\n\n                tooltip.popup.element.addClass(YearViewStyles.tooltip);\n\n                tooltip.popup.element.on(CLICK + NS, \".k-tooltip-title > .k-day\", that._tooltipTitleClick.bind(that));\n\n                tooltip.popup.element.on(KEYDOWN + NS, that, that._tooltipKeydown.bind(that));\n            },\n\n            _buildTooltipTemplate: function() {\n                var that = this,\n                    date = kendo.parseDate(that.calendar.current()),\n                    data = that.eventsByDate || [];\n\n                data = data.filter(function(dateData) {\n                    return kendo.toString(new Date(dateData.value), \"d\") == kendo.toString(date, \"d\");\n                });\n\n                if (data && data[0]) {\n                    data[0].items.map(function(event) {\n                        event.resources = that.eventResources(event) || [];\n                    });\n                }\n\n                return that.tooltipTemplate({\n                    date: date,\n                    events: data[0] ? data[0].items : [],\n                    messages: that.options.messages\n                });\n            },\n\n            _inverseTooltipEventsColor: function() {\n                var that = this;\n\n                $.each(that.tooltip.popup.element.find(DOT + YearViewStyles.event), function() {\n                    that._inverseEventColor($(this));\n                });\n            },\n\n            _tooltipShow: function(ev) {\n                var that = this,\n                    tooltip = ev.sender;\n\n                tooltip.refresh();\n\n                that._inverseTooltipEventsColor();\n\n                tooltip.popup.element.find(\":kendoFocusable\").first().trigger(FOCUS);\n            },\n\n            _tooltipHide: function() {\n                var calendar = this.calendar;\n\n                if (!calendar) {\n                    return;\n                }\n\n                calendar.focus();\n            },\n\n            _tooltipTitleClick: function() {\n                this._navigateToDayView();\n            },\n\n            _tooltipKeydown: function(ev) {\n                var that = this,\n                    element = that.tooltip.popup.element,\n                    target = $(ev.target),\n                    keys = kendo.keys,\n                    keyCode = ev.keyCode,\n                    shiftKey = ev.shiftKey;\n\n                if (target.is(\".k-day\") && keyCode == keys.ENTER || keyCode == keys.SPACEBAR) {\n                    ev.preventDefault();\n\n                    that._navigateToDayView();\n                }\n\n                if (keyCode == keys.TAB) {\n                    var firstFocusable = element.find(\":kendoFocusable\").first();\n                    var lastFocusable = element.find(\":kendoFocusable\").last();\n\n                    if (shiftKey && target.is(firstFocusable)) {\n                        lastFocusable.trigger(FOCUS);\n                        ev.preventDefault();\n                    } else if (target.is(lastFocusable)) {\n                        firstFocusable.trigger(FOCUS);\n                        ev.preventDefault();\n                    }\n                }\n            },\n\n            _navigateToDayView: function() {\n                var dayViewEnabled = $.grep(this.options.views, function(view) {\n                    return ($.isPlainObject(view) && view.type == \"kendo.ui.DayView\") || view === DAY;\n                }).length;\n\n                if (dayViewEnabled) {\n                    this.trigger(NAVIGATE, { view: DAY, date: this.calendar.current() });\n                }\n            },\n\n            _displayTooltip: function(target) {\n                var that = this;\n\n                if (!target.length) {\n                    return;\n                }\n\n                if (!that.options.selectable) {\n                    target.removeClass(\"k-selected\");\n                }\n\n                setTimeout(function() {\n                    that.tooltip.show(target);\n                }, 50);\n            },\n\n            _renderEventIndicators: function() {\n                var that = this,\n                    calendar = that.calendar,\n                    current,\n                    cell;\n\n                calendar.element.find(\".\" + YearViewStyles.indicator).remove();\n\n                that.eventsByDate.forEach(function(date) {\n                    current = calendar._currentView.toDateString(new Date(date.value));\n                    cell = calendar.element[0].querySelector(\"[data-value='\" + current + \"']\");\n\n                    if (date.items.length) {\n                        $(\"<span/>\").addClass(YearViewStyles.indicator).appendTo(cell);\n                    }\n                });\n            },\n\n            _groupEventsByDate: function(events) {\n                var eventsByDate = [],\n                    eventsFormatted;\n\n                if (!events.length) {\n                    return [];\n                }\n\n                eventsFormatted = events.map(function(event) {\n                    event.formattedDate = event.start.toDateString();\n                    return event;\n                });\n\n                eventsByDate = new kendo.data.Query(eventsFormatted)\n                    .sort([\n                        { field: \"start\", dir: \"asc\" },\n                        { field: \"end\", dir: \"desc\" }\n                    ])\n                    .group({\n                        field: \"formattedDate\"\n                    })\n                    .toArray();\n\n                return eventsByDate;\n            },\n\n            _resourceBySlot: function() {\n                return {};\n            },\n\n            lastDateInRange: function() {\n                var end = new Date(this.previousDate());\n\n                end.setMonth((end.getMonth() - 1) + this.options.months);\n\n               return lastDayOfMonth(end);\n            },\n\n            nextDate: function() {\n                return kendo.date.nextYear(this._startDate);\n            },\n\n            previousDate: function() {\n                return kendo.date.previousYear(this._startDate);\n            },\n\n            startDate: function() {\n                return this._startDate;\n            },\n\n            endDate: function() {\n                return this._endDate;\n            },\n\n            moveToEvent: function() {\n                return false;\n            },\n\n            constrainSelection: function() {\n                return false;\n            },\n\n            inRange: function() {\n                return true;\n            },\n\n            select: function(selection) {\n                this.clearSelection();\n\n                if (selection.start >= this.startDate() && selection.start < this.endDate()) {\n                    this.calendar.value(selection.start);\n                } else {\n                    this.calendar.value(this.calendar._firstViewValue);\n                    selection.start = selection.end = this.calendar.value();\n                }\n\n                this.current(this.calendar.selectable.value()[0]);\n            },\n\n            selectionByElement: function(cell) {\n                if (!cell.length) {\n                    return;\n                }\n\n                cell = $(cell);\n\n                return {\n                    index: this.calendar._index,\n                    start: kendo.calendar.toDateObject(cell),\n                    end: kendo.calendar.toDateObject(cell),\n                    isAllDay: false,\n                    uid: 0\n                };\n            },\n\n            current: function(candidate) {\n                if (candidate !== undefined$1) {\n                    this._current = candidate;\n                } else {\n                    return this._current;\n                }\n            },\n\n            render: function(events) {\n                var that = this;\n\n                that._cachedEvents = events;\n\n                that.eventsByDate = that._groupEventsByDate(events) || [];\n\n                that._renderEventIndicators();\n\n                that.trigger(ACTIVATE);\n            },\n\n            destroy: function() {\n                var that = this;\n\n                if (that.tooltip) {\n                    that.tooltip.destroy();\n                    that.tooltip = null;\n                }\n\n                if (that.calendar) {\n                    that.calendar.destroy();\n                    that.calendar = null;\n                }\n\n                if (that.element) {\n                    that.content.remove();\n                    that.element.off(NS);\n                }\n\n                SchedulerView.fn.destroy.call(this);\n            }\n        });\n\n        extend(true, ui, {\n            YearView: YearView\n        });\n\n    })(window.kendo.jQuery);\n    var kendo$1 = kendo;\n\n    return kendo$1;\n\n}));\n"]}