26ff8d9b4f
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
28 lines
38 KiB
JavaScript
Executable File
28 lines
38 KiB
JavaScript
Executable File
/**
|
|
* Kendo UI v2019.2.619 (http://www.telerik.com/kendo-ui)
|
|
* Copyright 2019 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
|
|
*
|
|
* Kendo UI commercial licenses may be obtained at
|
|
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
|
|
* If you do not own a commercial license, this file shall be governed by the trial license terms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
!function(e,define){define("kendo.scheduler.timelineview.min",["kendo.scheduler.view.min"],e)}(function(){return function(e,t){function i(e){var t=new Date(1980,1,1,0,0,0);return u(t,g(e)),t}function n(e){var t=[],i=e.workWeekStart%7,n=Math.abs(e.workWeekEnd%7);for(t.push(i);n!=i;)i>6?i-=7:i++,t.push(i);return t}function o(e){var t,i=0;if(e.columns){for(t=0;t<e.columns.length;t++)i+=o(e.columns[t]);return e.colspan=i,i}return e.colspan=1,1}function r(e,t,i){var n,o,r,a;for(n=e.length-1;n>=0;n--)o=e[n].rectLeft,a=e[n].rectRight,r=o<=t&&a>=t,(r||o>=t&&a<=i||t<=o&&i>=o)&&(o<t&&(t=o),a>i&&(i=a));return s(e,t,i)}function s(e,t,i){var n,o,r=[];for(n=0;n<e.length;n++)o={rectLeft:e[n].rectLeft,rectRight:e[n].rectRight},(o.rectLeft<t&&o.rectRight>t||o.rectLeft>=t&&o.rectRight<=i)&&r.push(e[n]);return r}var a,l=window.kendo,d=l.ui,u=l.date.setTime,c=d.SchedulerView,h=l._outerWidth,f=l._outerHeight,_=e.extend,p=e.proxy,v=l.date.getDate,g=l.date.getMilliseconds,m=l.date.MS_PER_DAY,w=l.date.MS_PER_MINUTE,T="k-current-time",k="k-current-time-arrow",D="k-scheduler-header-wrap",y="k-event-inverse",S=.8666,C=".kendoTimelineView",V=l.template('<div><div class="k-event-template k-event-time">#:kendo.format("{0:t} - {1:t}", start, end)#</div><div class="k-event-template">${title}</div></div>'),R=l.template("<span class='k-link k-nav-day'>#=kendo.format('{0:m}', date)#</span>"),x='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color#; border-color: #=resources[0].color#"class="k-event" #} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail) {#<span class="k-icon k-i-arrow-60-left"></span>#}## if(data.isException()) {#<span class="k-icon k-i-non-recurrence"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-reload"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete" title="${data.messages.destroy}" aria-label="${data.messages.destroy}"><span class="k-icon k-i-close"></span></a>#}## if(data.head) {#<span class="k-icon k-i-arrow-60-right"></span>#}#</span>#if(resizable && !data.tail){#<span class="k-resize-handle k-resize-w"></span>#}##if(resizable && !data.head){#<span class="k-resize-handle k-resize-e"></span>#}#</div>',M=l.Class.extend({init:function(e){this._view=e},_getTimeSlotByPosition:function(e,t,i){var n=this._view.groups[i];return n.timeSlotByPosition(e,t)},_hideHeaders:function(){var e=this._view;e.timesHeader.find("table tr:last").hide(),e.datesHeader.find("table tr:last").hide()},_setColspan:function(e){o(e)},_createRowsLayout:function(e,t,i){var n=this._view;return n._createRowsLayout(e,t,i)},_createVerticalColumnsLayout:function(e,t,i,n){return n},_createColumnsLayout:function(e,t,i){var n=this._view;return n._createColumnsLayout(e,t,i)},_getRowCount:function(){var e=this._view;return e._groupCount()},_getGroupsCount:function(){return 1},_addContent:function(e,t,i,n,o,r,s,a){var d,u,c,h,f=this._view,_="",p=f.options,v=function(t){var i,n="",o="",r=function(e){return function(){return f._resourceBySlot({groupIndex:e})}};return l.date.isToday(e[c])&&(o+="k-today"),(l.date.getMilliseconds(t)<l.date.getMilliseconds(p.workDayStart)||l.date.getMilliseconds(t)>=l.date.getMilliseconds(p.workDayEnd)||!f._isWorkDay(e[c]))&&(o+=" k-nonwork-hour"),n+="<td"+(""!==o?' class="'+o+'"':"")+">",i=l.date.getDate(e[c]),l.date.setTime(i,l.date.getMilliseconds(t)),n+=s({date:i,resources:r(a?d:u)}),n+="</td>"};for(d=0;d<n;d++){for(_+="<tr>",u=0;u<i;u++)for(c=0,h=t;c<h;c++)_+=f._forTimeRange(o,r,v);_+="</tr>"}return _},_addTimeSlotsCollections:function(e,t,i,n,o){var r,s,a,l,d,u,c,h,f,_,p,v,m=this._view,w=i.length;for(o&&(w=Math.floor(w/e)),r=0;r<e;r++)for(s=0,a=m.groups[r],o&&(s=r),d=s*w,u=0,o||(u=r),c=i[d].children,h=c.length/(o?1:e),f=h/t,_=0;_<t;_++)for(p=_*f+h*u,l=g(new Date((+m.startTime()))),v=0;v<f;v++)m._addTimeSlotToCollection(a,c,v,p,_,l,n),l+=n},_getVerticalGroupCount:function(e){return e},_getVerticalRowCount:function(e,t,i){var n=this._view;return n._isVerticallyGrouped()?e[t].maxRowCount:i},_renderEvent:function(e,t,i,n,o,r){var s,a=this._view,l=a._createEventElement(i.occurrence,t,o.head||i.head,o.tail||i.tail);l.appendTo(r).css({top:0,height:a.options.eventHeight}),s={start:i.occurrence._startTime||i.occurrence.start,end:i.occurrence._endTime||i.occurrence.end,element:l,uid:t.uid,slotRange:o,rowIndex:0,offsetTop:0},e.events[t.uid]=s,a._inverseEventColor(l),a.addContinuousEvent(n,o,l,t.isAllDay),a._arrangeRows(s,o,e)},_verticalCountForLevel:function(e){var t=this._view;return t._rowCountForLevel(e)},_horizontalCountForLevel:function(e){var t=this._view;return t._columnCountForLevel(e)},_updateCurrentVerticalTimeMarker:function(t,i){var n=this._view,o="<div class='"+T+"'></div>",r=n.datesHeader.find("."+D),s=Math.round(t[0].innerRect(i,new Date(i.getTime()+1),!1).left),a=e(o).prependTo(r).addClass(k+"-down");a.css({left:n._adjustLeftPosition(s-h(a)*S/2),top:r.find("tr:last").prev().position().top}),e(o).prependTo(n.content).css({left:n._adjustLeftPosition(s),width:"1px",height:n.content[0].scrollHeight-1,top:0})},_changeGroup:function(){return t},_prevGroupSlot:function(e,t,i){var n,o=this._view;return o._isVerticallyGrouped()?e:(n=t._collection(0,i),n.last())},_nextGroupSlot:function(e,t,i){var n,o=this._view;return o._isVerticallyGrouped()?e:(n=t._collection(0,i),n.first())},_verticalSlots:function(e,t){var i=this._view;return i._changeGroup(e,t)},_verticalMethod:function(e){return e?"leftSlot":"rightSlot"},_normalizeVerticalSelection:function(){return t},_horizontalSlots:function(e,t,i,n,o,r,s){var a=this._view,l={};return l.startSlot=t[i](n),l.endSlot=t[i](o),r||!a._isHorizontallyGrouped()||l.startSlot&&l.endSlot||(l.startSlot=l.endSlot=a._changeGroup(e,s)),l},_changeVerticalViewPeriod:function(){return!1},_changeHorizontalViewPeriod:function(e,t,i,n){var o=this._view;return!(e.startSlot&&e.endSlot||t||!o._changeViewPeriod(i,n,!1))},_updateDirection:function(e,t,i,n){var o=this._view;o._updateDirection(e,t,i,n,!0)},_createMoveHint:function(e,t){var i,n,o,r,s=this._view,a=e.start,l=s._createEventElement(t.occurrence,t.occurrence,!1,!1);l.addClass("k-event-drag-hint"),i=e.innerRect(t.occurrence.start,t.occurrence.end,s.options.snap),n=i.right-i.left-2,n<0&&(n=0),o=s._adjustLeftPosition(i.left),r={left:o,top:a.offsetTop,height:a.offsetHeight-2,width:n},l.css(r),t.occurrence.inverseColor&&l.addClass(y),s._appendMoveHint(l)},_adjustLeftPosition:function(e){var t=this._view;return t._isRtl&&(e-=t.content[0].scrollWidth-t.content[0].clientWidth),e}}),H=l.Class.extend({init:function(e){this._view=e},_getTimeSlotByPosition:function(e,t,i){var n=this._view.groups[i];return n.timeSlotByPosition(e,t,!0)},_hideHeaders:function(){var e=this._view;e._isVerticallyGrouped()?e.times.find(".k-last").hide():(e.timesHeader.find("table tr").eq(2).hide(),e.datesHeader.find("table tr").eq(2).hide())},_setColspan:function(){},_createRowsLayout:function(e,t,i,n){var o=this._view;return o._createDateLayout(n,null,!0)},_createVerticalColumnsLayout:function(e,t,i){var n=this._view;return n._createColumnsLayout(e,null,i)},_createColumnsLayout:function(e,t,i,n){var o=this._view;return o._createColumnsLayout(e,t,i,n,!0)},_getRowCount:function(e){var t=this._view;return t._rowCountForLevel(e)},_getGroupsCount:function(){var e=this._view;return e._groupCount()},_addContent:function(e,t,i,n,o,r,s,a){var d,c,h,f,_=this._view,p="",v=_.options,g=function(t,i,n,o,r,a){var u,c="",f="",p=_._isVerticallyGrouped()?d:h,g=function(e){return function(){return _._resourceBySlot({groupIndex:e})}};return l.date.isToday(e[h])&&(f+="k-today"),(l.date.getMilliseconds(t)<l.date.getMilliseconds(v.workDayStart)||l.date.getMilliseconds(t)>=l.date.getMilliseconds(v.workDayEnd)||!_._isWorkDay(e[p]))&&(f+=" k-nonwork-hour"),c+="<td"+(""!==f?' class="'+f+'"':"")+">",u=l.date.getDate(e[h]),l.date.setTime(u,l.date.getMilliseconds(t)),c+=s({date:u,resources:g(a)}),c+="</td>"},m=new Date(o),T=_.options.minorTickCount,k=_.options.majorTick*w,D=k/T||1;for(c=0;c<n;c++){for(p+="<tr>",c%(n/_._dates.length)===0&&(d=c/(n/_._dates.length),m=new Date(_._dates[d]),l.date.setTime(m,l.date.getMilliseconds(o))),h=0,f=t;h<f;h++)if(p+=_._forTimeRange(m,r,g,a,i),a){u(m,D,!1);break}p+="</tr>"}return p},_addTimeSlotsCollections:function(e,t,i,n,o){var r,s,a,l,d,u,c,h,f,_,p,v,m=this._view,w=i.length;for(o&&(w/=t),r=0;r<t;r++)for(s=0,o&&(s=r),l=s*w,d=0,u=i[l].children,c=o?w:u.length/(t*e),h=u.length/t,a=g(new Date((+m.startTime()))),_=0;_<c;_++){for(o?(f=0,u=i[_+c*r].children):(f=r*h+e*_,d++),p=0;p<e;p++)v=m.groups[p],m._addTimeSlotToCollection(v,u,p,f,r,a,n);a+=n}},_getVerticalGroupCount:function(){var e=this._view;return e.content.find("tr").length},_getVerticalRowCount:function(e,t,i){return i},_renderEvent:function(e,t,i,n,o,r,s,a){var l,d,u,c,h,f=this._view,_=[];for(d=o.start.index;d<=o.end.index;d++)l=f._createEventElement(i.occurrence,t,d!==a,d!==s),l.appendTo(r).css({top:0,height:f.options.eventHeight}),u=n._timeSlotCollections[0]._slots[d],c=n.timeSlotRanges(u.start,u.end,!1)[0],h={start:d===s?i.occurrence._startTime||i.occurrence.start:u.start,end:d===a?i.occurrence._endTime||i.occurrence.end:u.end,element:l,uid:t.uid,slotRange:c,rowIndex:0,offsetTop:0},e.events[t.uid]=h,_.push(h),f.addContinuousEvent(n,c,l,t.isAllDay),f._arrangeRows(h,c,e);e.events[t.uid]=_},_verticalCountForLevel:function(e){var t=this._view;return t._columnCountForLevel(e)},_horizontalCountForLevel:function(e,t){var i=this._view;return i._columnCountForLevel(t)/i._columnCountForLevel(2)},_updateCurrentVerticalTimeMarker:function(t,i){var n=this._view,o=n.times.find("tr:first th:first"),r=n.times.find("tr:first th:last"),s="<div class='"+T+"'></div>",a=e(s).prependTo(n.times),l=Math.round(t[0].innerRect(i,new Date(i.getTime()+1),!1).top),d={};this._isRtl?(d.right=o.position().left+f(o)-f(r),a.addClass(k+"-left")):(d.left=r.position().left,a.addClass(k+"-right")),d.top=l-h(a)*S/2,a.css(d),e(s).prependTo(n.content).css({top:l,height:"1px",right:"1px",width:n.content[0].scrollWidth,left:0})},_changeGroup:function(e,t,i){var n=this._view;i||(e.groupIndex=t?n.groups.length-1:0)},_prevGroupSlot:function(e){return e},_nextGroupSlot:function(e){return e},_changeDate:function(e,t,i){var n,o,r=this._view,s=r.groups[e.groupIndex];if(t){if(n=s._getCollections(!1),o=i.index-1,o>=0)return n[0]._slots[o]}else if(n=s._getCollections(!1),o=i.index+1,n[0]&&n[0]._slots[o])return n[0]._slots[o]},_verticalSlots:function(e,t,i){return this._changeDate(e,t,i)},_verticalMethod:function(e,t){return t?e?"upSlot":"downSlot":e?"leftSlot":"rightSlot"},_normalizeVerticalSelection:function(e,i,n,o){var r=this._view;return o?t:r._normalizeVerticalSelection(e,i,n)},_horizontalSlots:function(e,t,i,n,o,r,s){var a=this._view,l=a._changeGroup(e,s),d={};return l?d.startSlot=d.endSlot=l:a._isVerticallyGrouped()||(d.startSlot=t[i](n),d.endSlot=t[i](o)),d},_changeVerticalViewPeriod:function(e,t,i,n){var o=this._view;return!(e.startSlot&&e.endSlot||t||!o._changeViewPeriod(i,n,o._isVerticallyGrouped()))},_changeHorizontalViewPeriod:function(e,t,i,n){var o=this._view;return!o._isVerticallyGrouped()&&!(e.startSlot&&e.endSlot||t||!o._changeViewPeriod(i,n,!1))},_updateDirection:function(e,t,i,n){var o=this._view;o._updateDirection(e,t,i,n,!o._isVerticallyGrouped())},_createMoveHint:function(e,t){var i,n,o,r,s=this._view,a=e.start,l=e.end;for(i=a.index;i<=l.index;i++)n=e.collection._slots[i],o=s._createEventElement(t.occurrence,t.occurrence,!1,!1),o.addClass("k-event-drag-hint"),r={left:n.offsetLeft+2,top:n.offsetTop,height:s.options.eventHeight,width:n.offsetWidth},o.css(r),t.occurrence.inverseColor&&o.addClass(y),s._appendMoveHint(o)},_adjustLeftPosition:function(e){var t=this._view;return t._isRtl&&!t._isVerticallyGrouped()&&(e-=t.content[0].scrollWidth-t.content[0].offsetWidth),e}});l.ui.scheduler.TimelineGroupedView=M,l.ui.scheduler.TimelineGroupedByDateView=H,a=c.extend({init:function(e,t){var i=this;c.fn.init.call(i,e,t),i._groupedView=i._getGroupedView(),i.title=i.options.title||i.options.name,i._workDays=n(i.options),i._templates(),i._editable(),i.calculateDateRange(),i._groups(),i._currentTime(!0)},name:"timeline",_getGroupedView:function(){return this._isGroupedByDate()?new l.ui.scheduler.TimelineGroupedByDateView(this):new l.ui.scheduler.TimelineGroupedView(this)},_getNextEventIndexBySlot:function(e,t,i){var n,o;if(this._isVerticallyGrouped())return l.ui.SchedulerView.fn._getNextEventIndexBySlot.call(this,e,t,i);for(n=0,o=0;o<t.length;o++)if(e.startDate()>t[o].start.startDate())n++;else{if(!(e.startDate().getTime()===t[o].start.startDate().getTime()&&i>t[o].start.groupIndex))break;n++}return n},_getSelectedSlot:function(e,t,i,n,o,r){return this._isVerticallyGrouped()?l.ui.SchedulerView.fn._getSelectedSlot.call(this,e,t,i,n,o,r):e},_getSortedEvents:function(t){return this._isVerticallyGrouped()?l.ui.SchedulerView.fn._getSortedEvents.call(this,t):t.sort(function(t,i){var n=t.start.startDate().getTime()-i.start.startDate().getTime();return 0===n&&(t.start.isDaySlot&&!i.start.isDaySlot&&(n=-1),!t.start.isDaySlot&&i.start.isDaySlot&&(n=1)),0===n&&(n=t.start.groupIndex-i.start.groupIndex),0===n&&(n=e(t.element).index()-e(i.element).index()),n})},_currentTimeMarkerUpdater:function(){this._updateCurrentTimeMarker(new Date)},_updateCurrentTimeMarker:function(t){var i,n,o,r,s,a,d,u,c,f,_,p,v,g=this.options;if(this.datesHeader.find("."+T).remove(),this.times.find("."+T).remove(),this.content.find("."+T).remove(),this._isInDateSlot({start:t,end:t}))for(g.currentTimeMarker.useLocalTimezone===!1&&(i=g.dataSource.options.schema.timezone,g.dataSource&&i&&(n=l.timezone.offset(t,i),t=l.timezone.convert(t,t.getTimezoneOffset(),n))),o=g.group&&"vertical"!=g.group.orientation?this.groups.length:1,r=0;r<o;r++){if(s=this.groups[r],!s)return;if(a=l.date.toUtcTime(t),d=s.timeSlotRanges(a,a+1),0===d.length)return;u=d[0].collection,c=u.slotByStartDate(t),c&&(this._isVerticallyGrouped()?this._groupedView._updateCurrentVerticalTimeMarker(d,t):(f="<div class='"+T+"'></div>",_=this.datesHeader.find("."+D),p=Math.round(d[0].innerRect(t,new Date(t.getTime()+1),!1).left),v=e(f).prependTo(_).addClass(k+"-down"),v.css({left:this._adjustLeftPosition(p-h(v)*S/2),top:_.find("tr:last").prev().position().top}),e(f).prependTo(this.content).css({left:this._adjustLeftPosition(p),width:"1px",height:this.content[0].scrollHeight-1,top:0})))}},_adjustLeftPosition:function(e){return this._groupedView._adjustLeftPosition(e)},_currentTime:function(e){var i=this,n=i.options.currentTimeMarker;n!==!1&&n.updateInterval!==t&&(i._currentTimeMarkerUpdater(),e&&(i._currentTimeUpdateTimer=setInterval(p(this._currentTimeMarkerUpdater,i),n.updateInterval)))},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+C,".k-event a:has(.k-i-close)",function(i){t.trigger("remove",{uid:e(this).closest(".k-event").attr(l.attr("uid"))}),i.preventDefault()}),t.options.editable.create!==!1&&t.element.on("dblclick"+C,".k-scheduler-content td",function(e){var i,n=t._slotByPosition(e.pageX,e.pageY);n&&(i=t._resourceBySlot(n),t.trigger("add",{eventInfo:_({start:n.startDate(),end:n.endDate()},i)})),e.preventDefault()}),t.options.editable.update!==!1&&t.element.on("dblclick"+C,".k-event",function(i){t.trigger("edit",{uid:e(this).closest(".k-event").attr(l.attr("uid"))}),i.preventDefault()})},_touchEditable:function(){var i=this,n=0;l.support.mobileOS.android&&(n=5),i.options.editable.create!==!1&&(i._addUserEvents=new l.UserEvents(i.element,{threshold:n,useClickAsTap:!l.support.browser.edge,filter:".k-scheduler-content td",tap:function(e){var n,o,r,s;i._scrolling||(n=e.x.location!==t?e.x.location:e.x,o=e.y.location!==t?e.y.location:e.y,r=i._slotByPosition(n,o),r&&(s=i._resourceBySlot(r),i.trigger("add",{eventInfo:_({start:r.startDate(),end:r.endDate()},s)})),e.preventDefault())}})),i.options.editable.update!==!1&&(i._editUserEvents=new l.UserEvents(i.element,{threshold:n,useClickAsTap:!l.support.browser.edge,filter:".k-event",tap:function(t){var n,o;i._scrolling||(n=e(t.target).closest(".k-event"),o=e(t.touch.initialTouch),o.hasClass("k-i-close")?i.trigger("remove",{uid:n.attr(l.attr("uid"))}):n.hasClass("k-event-active")||i.trigger("edit",{uid:n.attr(l.attr("uid"))}),t.preventDefault())}}))},_slotByPosition:function(e,t){var i,n,o,r=this.content,s=r.offset();for(e-=s.left,t-=s.top,this._isRtl?(o=l.support.browser,o.mozilla?(e+=r[0].scrollWidth-r[0].offsetWidth,e+=r[0].scrollLeft):o.msie?(e-=r.scrollLeft(),e+=r[0].scrollWidth-r[0].offsetWidth):o.webkit&&(e+=r[0].scrollLeft)):e+=r[0].scrollLeft,t+=r[0].scrollTop,e=Math.ceil(e),t=Math.ceil(t),n=0;n<this.groups.length;n++)if(i=this._groupedView._getTimeSlotByPosition(e,t,n))return i;return null},options:{name:"TimelineView",title:"Timeline",selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}",selectedMobileDateFormat:"{0:MMM dd}",date:l.date.today(),startTime:l.date.today(),endTime:l.date.today(),showWorkHours:!1,minorTickCount:2,editable:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,majorTick:60,eventHeight:25,eventMinWidth:0,columnWidth:100,groupHeaderTemplate:"#=text#",majorTimeHeaderTemplate:"#=kendo.toString(date, 't')#",slotTemplate:" ",eventTemplate:V,dateHeaderTemplate:R,footer:{command:"workDay"},currentTimeMarker:{updateInterval:1e4,useLocalTimezone:!0},messages:{defaultRowText:"All events",showFullDay:"Show full day",showWorkDay:"Show business hours"}},events:["remove","add","edit"],_templates:function(){var e=this.options,t=_({},l.Template,e.templateSettings);this.eventTemplate=this._eventTmpl(e.eventTemplate,x),this.majorTimeHeaderTemplate=l.template(e.majorTimeHeaderTemplate,t),this.dateHeaderTemplate=l.template(e.dateHeaderTemplate,t),this.slotTemplate=l.template(e.slotTemplate,t),this.groupHeaderTemplate=l.template(e.groupHeaderTemplate,t)},_render:function(t){var i=this;t=t||[],i._dates=t,i._startDate=t[0],i._endDate=t[t.length-1||0],i._calculateSlotRanges(),i.createLayout(i._layout(t)),i._content(t),i._footer(),i._setContentWidth(),i.refreshLayout(),i.datesHeader.on("click"+C,".k-nav-day",function(t){var n=e(t.currentTarget).closest("th"),o=i._slotByPosition(n.offset().left,i.content.offset().top);i.trigger("navigate",{view:"timeline",date:o.startDate()})}),i._groupedView._hideHeaders()},_setContentWidth:function(){var e=this.content,t=e.width(),i=this.content.find("table"),n=i.find("tr:first").children().length,o=100,r=n*this.options.columnWidth;t<r&&(o=Math.ceil(r/t*100)),i.add(this.datesHeader.find("table")).css("width",o+"%")},_calculateSlotRanges:function(){var e,t,i,n,o=this._dates,r=this.startTime(),s=this.endTime();for(s=g(s),r=g(r),s===r?s+=m-1:s<r&&(s+=m),e=[],t=0;t<o.length;t++)i=v(o[t]),u(i,r),n=v(o[t]),u(n,s),e.push({start:l.date.toUtcTime(i),end:l.date.toUtcTime(n)});this._slotRanges=e},_forTimeRange:function(e,t,n,o,r){var s,a,l,d,c,h,f,_,p,v,T,k,D,y,S,C;for(e=i(e),t=i(t),s=this,a=g(e),l=g(t),d=s.options.minorTickCount,c=s.options.majorTick*w,h=c/d||1,f=new Date((+e)),_=0,v="",p=m/h,a!=l&&(a>l&&(l+=m),p=(l-a)/h),p=o?1:Math.round(p),r&&(p*=r);_<p;_++)T=_%(c/h),k=0===T,D=T<d-1,y=T===d-1,S=d,p%d!==0&&(C=p-(_+1)<d,k&&C&&(S=p%d)),v+=n(f,k,D,y,S,_%r),o||(r?_%r===r-1&&u(f,h,!1):u(f,h,!1));return v},_layout:function(e){var t,i,n,o=[],r=[],s=this,a=[{text:s.options.messages.defaultRowText}],l=s._groupedView,d=[];for(t=0;t<s.options.minorTickCount;t++)d.push({text:"​",className:"k-last",minorTicks:!0});for(this._forTimeRange(s.startTime(),s.endTime(),function(e,t,i,n,r){var a,u=s.majorTimeHeaderTemplate;t&&(a={text:u({date:e}),className:n?"k-slot-cell":"",columns:d.slice(0,r)},l._setColspan(a),o.push(a))}),i=0;i<e.length;i++)r.push({text:s.dateHeaderTemplate({date:e[i]}),className:"k-slot-cell",columns:o.slice(0)});return n=this.groupedResources,n.length&&("vertical"===this._groupOrientation()?(a=l._createRowsLayout(n,null,this.groupHeaderTemplate,r),r=l._createVerticalColumnsLayout(n,null,this.groupHeaderTemplate,r)):r=l._createColumnsLayout(n,r,this.groupHeaderTemplate,r)),{columns:r,rows:a}},_footer:function(){var t,i,n,o=this.options;o.footer!==!1&&(t='<div class="k-header k-scheduler-footer">',i=o.footer.command,this._isMobile()&&(t+='<span class="k-state-default k-scheduler-today"><a href="#" class="k-link">',t+=o.messages.today+"</a></span>"),i&&"workDay"===i?this._isMobile()?(t+='<span class="k-state-default k-scheduler-fullday"><a href="#" class="k-link">',t+=(o.showWorkHours?o.messages.showFullDay:o.messages.showWorkDay)+"</a></span>"):(t+='<ul class="k-reset k-header">',t+='<li class="k-state-default k-scheduler-fullday"><a href="#" class="k-link"><span class="k-icon k-i-clock"></span>',t+=(o.showWorkHours?o.messages.showFullDay:o.messages.showWorkDay)+"</a></li>",t+="</ul>"):t+=" ",t+="</div>",this.footer=e(t).appendTo(this.element),n=this,this.footer.on("click"+C,".k-scheduler-fullday",function(e){e.preventDefault(),n.trigger("navigate",{view:n.name||o.name,date:n.startDate(),isWorkDay:!o.showWorkHours})}),this.footer.on("click"+C,".k-scheduler-today",function(e){var t,i,r,s,a;e.preventDefault(),t=n.options.timezone,i="today",r=new Date,t?(a=l.timezone.offset(r,t),s=l.timezone.convert(r,r.getTimezoneOffset(),a)):s=r,n.trigger("navigate",{view:n.name||o.name,action:i,date:s})}))},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},_isWorkDay:function(e){var t,i=e.getDay(),n=this._workDays;for(t=0;t<n.length;t++)if(n[t]===i)return!0;return!1},_content:function(e){var t=this,i=t.startTime(),n=this.endTime(),o=1,r=1,s=e.length,a="",l=this.groupedResources,d=this.slotTemplate,u=!1;l.length&&(u="vertical"===t._groupOrientation(),u?(r=t._groupedView._getRowCount(this.rowLevels.length-1),o=t._groupedView._getGroupsCount()):o=t._groupCount()),a+="<tbody>",a+=t._groupedView._addContent(e,s,o,r,i,n,d,u),a+="</tbody>",this.content.find("table").append(a)},_groups:function(){var e,t,i,n,o,r,s=this._groupCount(),a=this._dates,d=a.length;for(this.groups=[],e=0;e<s;e++)t=this._addResourceView(e),i=a[0],n=a[a.length-1||0],o=g(this.startTime()),r=g(this.endTime()),0!==o&&r<=o&&(i=v(i),u(i,o),n=v(n),u(n,r)),t.addTimeSlotCollection(i,l.date.addDays(n,1));this._timeSlotGroups(s,d)},_isHorizontallyGrouped:function(){return this.groupedResources.length&&"horizontal"===this._groupOrientation()},_timeSlotGroups:function(e,t){var i=this._timeSlotInterval(),n=this._isVerticallyGrouped(),o=this.content.find("tr");o.attr("role","row"),this._groupedView._addTimeSlotsCollections(e,t,o,i,n)},_addTimeSlotToCollection:function(e,t,i,n,o,r,s){var a=t[i+n],l=e.getTimeSlotCollection(0),d=this._dates[o],u=Date.UTC(d.getFullYear(),d.getMonth(),d.getDate()),c=u+r,h=c+s;a.setAttribute("role","gridcell"),a.setAttribute("aria-selected",!1),l.addTimeSlot(a,c,h,!0)},startDate:function(){return this._startDate},endDate:function(){return this._endDate},visibleEndDate:function(){var e=g(this.startTime()),t=g(this.endTime()),i=this.endDate();return 0!==e&&t<=e&&(i=l.date.addDays(i,1)),i},startTime:function(){var e=this.options;return e.showWorkHours?e.workDayStart:e.startTime},endTime:function(){var e=this.options;return e.showWorkHours?e.workDayEnd:e.endTime},_timeSlotInterval:function(){var e=this.options;return e.majorTick/e.minorTickCount*w},nextDate:function(){return l.date.nextDay(this.endDate())},previousDate:function(){return l.date.previousDay(this.startDate())},calculateDateRange:function(){this._render([this.options.date])},render:function(e){var t,i,n,o,r;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),e=new l.data.Query(e).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),t=[],this._eventsByResource(e,this.groupedResources,t),i=[],n=0,o=0;o<t.length;o++)r={groupIndex:o,maxRowCount:0,events:{}},i.push(r),this._renderEvents(t[o],o,r),n<r.maxRowCount&&(n=r.maxRowCount);this._setRowsHeight(i,t.length,n),this._positionEvents(i,t.length),this._currentTime(!1),this.trigger("activate")},_positionEvents:function(t,i){var n,o,r,s,a;for(n=0;n<i;n++){o=t[n].events;for(r in o)if(s=o[r],e.isArray(s))for(a=0;a<s.length;a++)this._positionEvent(s[a]);else this._positionEvent(s)}},_setRowsHeight:function(t,i,n){var o,r,s,a,l,d=this.options.eventHeight+2,u=this._getBottomRowOffset(),c=this._groupedView,h=c._getVerticalGroupCount(i);for(i=this._isVerticallyGrouped()?h:1,o=0;o<i;o++)r=c._getVerticalRowCount(t,o,n),r=r?r:1,s=(d+2)*r+u,a=e(this.times.find("tr")[o]),l=e(this.content.find("tr")[o]),a.height(s),l.height(s);this._setContentWidth(),this.refreshLayout(),this._refreshSlots()},_getBottomRowOffset:function(){var e,t,i=.5*this.options.eventHeight,n=this._isMobile();return n?(e=30,t=60):(e=15,t=30),i>t?i=t:i<e&&(i=e),i},_positionEvent:function(e){var t,i,n,o=this.options.eventHeight+2,r=e.slotRange.innerRect(e.start,e.end,!1),s=this._adjustLeftPosition(r.left),a=r.right-r.left-2;a<0&&(a=0),a<this.options.eventMinWidth&&(t=e.slotRange.collection,i=t._slots[t._slots.length-1],n=i.offsetLeft+i.offsetWidth,a=this.options.eventMinWidth,n<s+a&&(a=n-r.left-2)),e.element.css({top:e.slotRange.start.offsetTop+e.rowIndex*(o+2)+"px",left:s,width:a})},_refreshSlots:function(){for(var e=0;e<this.groups.length;e++)this.groups[e].refresh()},_eventsByResource:function(e,t,i){var n,o,r,s,a=t[0];if(a)for(n=a.dataSource.view(),o=0;o<n.length;o++)r=this._resourceValue(a,n[o]),s=new l.data.Query(e).filter({field:a.field,operator:c.groupEqFilter(r)}).toArray(),t.length>1?this._eventsByResource(s,t.slice(1),i):i.push(s);else i.push(e)},_isInDateSlot:function(e){var t=e.start,i=e.end,n=v(this._startDate),o=l.date.addDays(v(this.visibleEndDate()),1);return t<o&&n<=i},_isInTimeSlot:function(e){var t,i=e._startTime||l.date.toUtcTime(e.start),n=e._endTime||l.date.toUtcTime(e.end),o=this._slotRanges;for(i===n&&(n+=1),t=0;t<o.length;t++)if(i<o[t].end&&o[t].start<n)return!0;return!1},_adjustEvent:function(e){var t,i=e.start,n=e.end,o=e._time("start"),r=e._time("end"),s=g(this.startTime()),a=g(this.endTime()),d=null,c=null,h=!1,f=!1;return e.isAllDay&&(i=v(i),o=0,n=v(n),r=m,c=l.date.addDays(n,1)),0===a&&(a=m),a<=s?(o<s&&o>=a&&(d=v(i),u(d,s),f=!0),r>a&&r<=s&&(c=v(n),u(c,a),h=!0)):(s>o?(d=v(i),u(d,s),f=!0):a<=o&&(d=v(i),d=l.date.addDays(d,1),u(d,s),f=!0),a<r?(c=v(n),u(c,a),h=!0):s>r&&(c=v(n),c=l.date.addDays(c,-1),u(c,a),h=!0)),t=e.clone({start:d?d:i,end:c?c:n,_startTime:d?l.date.toUtcTime(d):e._startTime,_endTime:c?l.date.toUtcTime(c):e._endTime,isAllDay:!1}),{occurrence:t,head:h,tail:f}},_renderEvents:function(e,t,i){var n,o,r,s,a,l,d,u,c,h,f;for(o=0,r=e.length;o<r;o++)n=e[o],this._isInDateSlot(n)&&(s=n.isAllDay||n.duration()>=m,a=this.content,(s||this._isInTimeSlot(n))&&(l=this._adjustEvent(n),d=this.groups[t],d._continuousEvents||(d._continuousEvents=[]),this._isInTimeSlot(l.occurrence)&&(u=d.slotRanges(l.occurrence,!1),c=u[0],h=c.start.index,f=c.end.index,this._groupedView._renderEvent(i,n,l,d,c,a,h,f))))},addContinuousEvent:function(e,t,i,n){var o=e._continuousEvents;o.push({element:i,isAllDay:n,uid:i.attr(l.attr("uid")),start:t.start,end:t.end})},_createEventElement:function(t,i,n,o){var r,s,a=this.eventTemplate,d=this.options.editable,u=this._isMobile(),c=d&&d.destroy!==!1&&!u,h=d&&d.resize!==!1,f=i._time("start"),p=i._time("end"),v=i.start,g=i.end,m=this.eventResources(i);return i._startTime&&f!==l.date.getMilliseconds(i.start)&&(v=new Date(f),v=l.timezone.apply(v,"Etc/UTC")),i._endTime&&p!==l.date.getMilliseconds(i.end)&&(g=new Date(p),g=l.timezone.apply(g,"Etc/UTC")),r=_({},{ns:l.ns,resizable:h,showDelete:c,head:n,tail:o,singleDay:1==this._dates.length,resources:m,inverseColor:!1,messages:this.options.messages},i,{start:v,end:g}),s=e(a(r)),this.angular("compile",function(){return{elements:s,data:[{dataItem:r}]}}),s},_arrangeRows:function(e,t,i){var n,o,s,a,l,d,u=t.start.index,h=t.end.index,f=e.slotRange.innerRect(e.start,e.end,!1),_=f.right+this.options.eventMinWidth,p=r(t.events(),f.left,_);for(t.addEvent({slotIndex:u,start:u,end:h,rectLeft:f.left,rectRight:_,element:e.element,uid:e.uid}),p.push({start:u,end:h,uid:e.uid}),n=c.createRows(p),i.maxRowCount<n.length&&(i.maxRowCount=n.length),o=0,s=n.length;o<s;o++)for(a=n[o].events,l=0,d=a.length;l<d;l++)i.events[a[l].uid].rowIndex=o},_groupCount:function(){var e=this.groupedResources,t=this._groupedView;return e.length?"vertical"===this._groupOrientation()?t._verticalCountForLevel(e.length-1):t._horizontalCountForLevel(e.length-1,this.columnLevels.length-1):1},_updateEventForSelection:function(e){var t=this._adjustEvent(e.clone());return t.occurrence},_eventOptionsForMove:function(e){return e.isAllDay?{isAllDay:!1}:{}},_updateEventForResize:function(e){e.isAllDay&&e.set("isAllDay",!1)},_updateMoveHint:function(e,t,i){var n,o,r,s=this.groups[t],a=e.clone({start:e.start,end:e.end}),l=a.duration();if(a.start=new Date(a.start.getTime()+i),a.end=new Date(+a.start+l),this._removeMoveHint(e.uid),this._isInDateSlot(a)&&(a.isAllDay||a.duration()>=m||this._isInTimeSlot(a)))for(n=this._adjustEvent(a),o=s.slotRanges(n.occurrence,!1),r=0;r<o.length;r++)this._groupedView._createMoveHint(o[r],n)},_appendMoveHint:function(e){e.appendTo(this.content),this._moveHint=this._moveHint.add(e)},_updateResizeHint:function(e,t,i,n){var o,r,s,a,d,u,h,f,_,p,v,g=this.groups[t],m=g.ranges(i,n,!1,!1);for(this._removeResizeHint(),o=0;o<m.length;o++){if(r=m[o],s=r.startSlot(),a=r.innerRect(i,n,!1),a.top=s.offsetTop,d=a.right-a.left,d<0)for(u=0;u<r.events().length;u++)if(r.events()[u].uid===e.uid){d=r.events()[u].rectRight-a.left;break}h=r.endSlot().offsetTop+s.offsetHeight-a.top,f=this._adjustLeftPosition(a.left),_=c.fn._createResizeHint.call(this,f,a.top,d,h),this._resizeHint=this._resizeHint.add(_)}p="t",v=this.content,this._resizeHint.appendTo(v),this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(l.toString(l.timezone.toLocalDate(i),p)),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(l.toString(l.timezone.toLocalDate(n),p))},selectionByElement:function(e){var t=e.offset();return this._slotByPosition(t.left,t.top)},_updateDirection:function(e,t,i,n,o){var r=t[0].start,s=t[t.length-1].end;i&&!o&&r.index===s.index&&r.collectionIndex===s.collectionIndex&&(e.backward=n)},_changeGroup:function(e,t){var i=t?"prevGroupSlot":"nextGroupSlot",n=this[i](e.start,e.groupIndex,!1);return n&&(e.groupIndex+=t?-1:1),this._groupedView._changeGroup(e,t,n),n},prevGroupSlot:function(e,t,i){var n=this.groups[t],o=n.ranges(e,e,i,!1)[0].start;if(!(t<=0))return this._groupedView._prevGroupSlot(o,n,i)},nextGroupSlot:function(e,t,i){var n=this.groups[t],o=n.ranges(e,e,i,!1)[0].start;if(!(t>=this.groups.length-1))return this._groupedView._nextGroupSlot(o,n,i)},_verticalSlots:function(e,t,i,n){var o=this._groupedView,r=o._verticalMethod(n,i),s=t[0].start,a=t[t.length-1].end,l=this.groups[e.groupIndex],d=o._normalizeVerticalSelection(e,t,n,i);return d&&(s=a=d),s=l[r](s),a=l[r](a),i||!this._isVerticallyGrouped()||s&&a||(s=a=o._verticalSlots(e,n,d)),{startSlot:s,endSlot:a}},_horizontalSlots:function(e,t,i,n){var o=n?"upSlot":"downSlot",r=t[0].start,s=t[t.length-1].end,a=this.groups[e.groupIndex],l={};return i?(l.startSlot=a[o](r),l.endSlot=a[o](s),i||!this._isHorizontallyGrouped()||r&&s||(l.startSlot=l.endSlot=this._changeGroup(e,n))):l=this._groupedView._horizontalSlots(e,a,o,r,s,i,n),l},_changeViewPeriod:function(e,t){var i,n=t?this.previousDate():this.nextDate(),o=e.start,r=e.end,s=new Date(n),a=new Date(n);return!this._isInRange(s,a)&&(e.start=s,e.end=a,this._isHorizontallyGrouped()&&(e.groupIndex=t?this.groups.length-1:0),i=r-o,t?(r=g(this.endTime()),r=0===r?m:r,u(e.start,r-i),u(e.end,r)):(o=g(this.startTime()),
|
|
u(e.start,o),u(e.end,o+i)),e.events=[],!0)},move:function(e,t,i){var n,o,r,s,a,d=!1,u=this.groups[e.groupIndex],c=l.keys,h=this._groupedView,f=u.ranges(e.start,e.end,!1,!1);if(t===c.DOWN||t===c.UP){if(d=!0,r=t===c.UP,h._updateDirection(e,f,i,r),s=this._verticalSlots(e,f,i,r),h._changeVerticalViewPeriod(s,i,e,r))return d}else if((t===c.LEFT||t===c.RIGHT)&&(d=!0,r=t===c.LEFT,this._updateDirection(e,f,i,r,!1),s=this._horizontalSlots(e,f,i,r),h._changeHorizontalViewPeriod(s,i,e,r)))return d;return d&&(n=s.startSlot,o=s.endSlot,i?(a=e.backward,a&&n?e.start=n.startDate():!a&&o&&(e.end=o.endDate())):n&&o&&(e.start=n.startDate(),e.end=o.endDate()),e.events=[]),d},destroy:function(){var e=this;e.element&&e.element.off(C),e.footer&&e.footer.remove(),e._currentTimeUpdateTimer&&clearInterval(e._currentTimeUpdateTimer),c.fn.destroy.call(this),this._isMobile()&&e.options.editable&&(e.options.editable.create!==!1&&e._addUserEvents.destroy(),e.options.editable.update!==!1&&e._editUserEvents.destroy())}}),_(!0,d,{TimelineView:a,TimelineWeekView:a.extend({options:{name:"TimelineWeekView",title:"Timeline Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",selectedMobileDateFormat:"{0:MMM dd} - {1:dd}",majorTick:120},name:"timelineWeek",calculateDateRange:function(){var e,t,i=this.options.date,n=l.date.dayOfWeek(i,this.calendarInfo().firstDay,-1),o=[];for(e=0,t=7;e<t;e++)o.push(n),n=l.date.nextDay(n);this._render(o)}}),TimelineWorkWeekView:a.extend({options:{name:"TimelineWorkWeekView",title:"Timeline Work Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",selectedMobileDateFormat:"{0:MMM dd} - {1:dd}",majorTick:120},name:"timelineWorkWeek",nextDate:function(){var e=l.date.dayOfWeek(l.date.nextDay(this.endDate()),this.calendarInfo().firstDay,1);return l.date.addDays(e,this._workDays[0])},previousDate:function(){var e=l.date.dayOfWeek(this.startDate(),this.calendarInfo().firstDay,-1),t=this._workDays;return l.date.addDays(e,t[t.length-1]-7)},calculateDateRange:function(){for(var e=this.options.date,t=l.date.dayOfWeek(e,this.options.workWeekStart,-1),i=l.date.dayOfWeek(t,this.options.workWeekEnd,1),n=[];t<=i;)n.push(t),t=l.date.nextDay(t);this._render(n)}}),TimelineMonthView:a.extend({options:{name:"TimelineMonthView",title:"Timeline Month",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",workDayStart:new Date(1980,1,1,0,0,0),workDayEnd:new Date(1980,1,1,23,59,59),footer:!1,majorTick:1440,minorTickCount:1},name:"timelineMonth",calculateDateRange:function(){var e,t,i=this.options.date,n=l.date.firstDayOfMonth(i),o=l.date.lastDayOfMonth(i),r=[];for(e=0,t=o.getDate();e<t;e++)r.push(n),n=l.date.nextDay(n);this._render(r)}})})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});
|
|
//# sourceMappingURL=kendo.scheduler.timelineview.min.js.map
|