/** * Kendo UI v2018.1.117 (http://www.telerik.com/kendo-ui) * Copyright 2018 Telerik AD. 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(t,define){define("kendo.scheduler.view.min",["kendo.core.min"],t)}(function(){return kendo.ui.scheduler={},function(t){function e(t,e){function n(t,o){var s,r;if(o=o[e])for(s=i[t]=i[t]||[],r=0;r'+e.join("")+"":""}function o(t,e){return t.length?"
"+i(t,e)+"
":""}function s(e,n,o){var s,r=[];if(o>0)for(s=0;s​");return n&&r.push(''+n.text+""),o<1?t():t('
'+i(r)+"
")}function r(e,n,s){var r,l,a,u,c,h,f,d,g,p,_=[];for(l=0;l'+h.text+"");_.push(u.join(""))}if(f=[],s){for(d=e[e.length-1],g=[],p=s.cellContent,r=0;r'+(p?p(r):" ")+"");f.push(g.join(""))}return t('
'+i(_)+o(f,"k-scheduler-header-all-day")+"
")}function l(e,n){var o,s,r,l,a,u=Array(n).join().split(","),c=[];for(s=0;s'+r[o].text+"";for(o=0;o'+i(c)+"")}function a(){return t('
')}function u(){return y=y?y:D.support.scrollbar()}function c(t,e,n){var i,o,s,r,l;for(i=t.length-1;i>=0;i--)o=h(t[i]),s=o.start,l=o.end,r=s<=e&&l>=e,(r||s>=e&&l<=n||e<=s&&n>=s)&&(sn&&(n=l));return f(t,e,n)}function h(t){return{start:t.start,end:t.end}}function f(t,e,n){var i,o,s=[];for(i=0;ie||o.start>=e&&o.end<=n)&&s.push(t[i]);return s}function d(t){return p(t)}function g(t){return p(t)}function p(t){var e,n,i,o,s,r,l,a=[];for(e=0;ea[s].end,i.start
',E=D.Class.extend({init:function(t,e){this._index=t,this._timeSlotCollections=[],this._daySlotCollections=[],this._isRtl=e},addTimeSlotCollection:function(t,e){return this._addCollection(t,e,this._timeSlotCollections)},addDaySlotCollection:function(t,e){return this._addCollection(t,e,this._daySlotCollections)},_addCollection:function(t,e,n){var i=new W(t,e,this._index,n.length);return n.push(i),i},timeSlotCollectionCount:function(){return this._timeSlotCollections.length},daySlotCollectionCount:function(){return this._daySlotCollections.length},daySlotByPosition:function(t,e,n){return this._slotByPosition(t,e,this._daySlotCollections,n)},timeSlotByPosition:function(t,e,n){return this._slotByPosition(t,e,this._timeSlotCollections,n)},_slotByPosition:function(t,e,n,i){var o,s,r,l,a,u,c,h,f;for(o=0;o=l.offsetLeft&&t=l.offsetTop&&e=o.slot.end&&(o=null),n=o,t=e)return[];n={inRange:!0,slot:i[o.slot.collectionIndex].last()}}return this._continuousRange(G,i,o,n)},daySlotRanges:function(t,e,n){var i,o=this._daySlotCollections,s=this._startSlot(t,o,n);if(!s.inRange&&t>=s.slot.end&&(s=null),i=s,t=s.slot.end)}if(null===i){if(s.slot.start>=e)return[];do e-=D.date.MS_PER_DAY,i=this._endSlot(e,o,n);while(!i.inRange&&e<=i.slot.start)}return this._continuousRange(B,o,s,i)},_continuousRange:function(t,e,n,i){var o,s,r,l,a,u,c=n.slot,h=i.slot,f=c.collectionIndex,d=h.collectionIndex,g=[];for(o=f;o<=d;o++)s=e[o],r=s.first(),l=s.last(),a=!1,u=!1,o==f&&(u=!n.inRange),o==d&&(a=!i.inRange),r.starth.start&&(l=h),fthis.end.offsetLeft?this.end:this.start},endSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.start:this.end}}),G=z.extend({innerHeight:function(){var t,e=this.collection,n=this.start.index,i=this.end.index,o=0;for(t=n;t<=i;t++)o+=e.at(t).offsetHeight;return o},outerRect:function(t,e,n){return this._rect("offset",t,e,n)},_rect:function(t,e,n,i){var o,s,r,l,a,u,c,h,f=this.start,d=this.end,g=D.support.isRtl(f.element);return"number"!=typeof e&&(e=D.date.toUtcTime(e)),"number"!=typeof n&&(n=D.date.toUtcTime(n)),i?(o=f.offsetTop,s=d.offsetTop+d[t+"Height"],g?(r=d.offsetLeft,l=f.offsetLeft+f[t+"Width"]):(r=f.offsetLeft,l=d.offsetLeft+d[t+"Width"])):(a=e-f.start,a<0&&(a=0),u=f.end-f.start,o=f.offsetTop+f[t+"Height"]*a/u,c=d.end-n,c<0&&(c=0),h=d.end-d.start,s=d.offsetTop+d[t+"Height"]-d[t+"Height"]*c/h,g?(r=Math.round(d.offsetLeft+d[t+"Width"]*c/h),l=Math.round(f.offsetLeft+f[t+"Width"]-f[t+"Width"]*a/u)):(r=Math.round(f.offsetLeft+f[t+"Width"]*a/u),l=Math.round(d.offsetLeft+d[t+"Width"]-d[t+"Width"]*c/h))),{top:o,bottom:s,left:0===r?r:r+1,right:l}},innerRect:function(t,e,n){return this._rect("client",t,e,n)}}),B=z.extend({innerWidth:function(){var t,e=this.collection,n=this.start.index,i=this.end.index,o=0,s=n!==i?"offsetWidth":"clientWidth";for(t=n;t<=i;t++)o+=e.at(t)[s];return o}}),W=D.Class.extend({init:function(t,e,n,i){this._slots=[],this._events=[],this._start=D.date.toUtcTime(t),this._end=D.date.toUtcTime(e),this._groupIndex=n,this._collectionIndex=i},refresh:function(){for(var t=0;t=0)return i[o]._slots[i[o]._slots.length-1]}else if(i=r._getCollections(r.daySlotCollectionCount()),o=r.daySlotCollectionCount()?0:e.collectionIndex+1,s=r.daySlotCollectionCount()?e.collectionIndex+1:0,i[o]&&i[o]._slots[s])return i[o]._slots[s]},_changeGroupContinuously:function(){return null},_changeViewPeriod:function(){return!1},_isInRange:function(t,e){return!!(t&&e&&this.options.min&&this.options.max)&&(I(t)<=I(this.options.min)||I(e)>=I(this.options.max))},_horizontalSlots:function(t,e,n,i){var o,s,r,l=i?"leftSlot":"rightSlot",a={startSlot:e[0].start,endSlot:e[e.length-1].end},u=this.groups[t.groupIndex],c=this._isVerticallyGrouped();return n||(o=this._normalizeHorizontalSelection(t,e,i),o&&(a.startSlot=a.endSlot=o)),this._isGroupedByDate()&&!n?(s=this._changeGroup(t,i),s?a.startSlot=a.endSlot=s:a=this._getNextHorizontalRange(u,l,a)):(a.startSlot=u[l](a.startSlot),a.endSlot=u[l](a.endSlot),n||c||a.startSlot&&a.endSlot||(a.startSlot=a.endSlot=this._changeGroup(t,i))),a.startSlot&&a.endSlot||this._isGroupedByDate()||(r=this._continuousSlot(t,e,i),r=this._changeGroupContinuously(t,r,n,i),r&&(a.startSlot=a.endSlot=r)),a},_getNextHorizontalRange:function(t,e,n){return this._isVerticallyGrouped()||(n.startSlot=t[e](n.startSlot),n.endSlot=t[e](n.endSlot)),n},_verticalSlots:function(t,e,n,i){var o,s,r=this.groups[t.groupIndex],l={startSlot:e[0].start,endSlot:e[e.length-1].end};return n||(o=this._normalizeVerticalSelection(t,e,i),o&&(l.startSlot=l.endSlot=o)),s=i?"upSlot":"downSlot",l=this._getNextVerticalRange(r,s,l,n),n||!this._isVerticallyGrouped()||l.startSlot&&l.endSlot||(l.startSlot=l.endSlot=this._isGroupedByDate()?this._changeDate(t,o,i):this._changeGroup(t,i)),l},_getNextVerticalRange:function(t,e,n,i){return n.startSlot=t[e](n.startSlot,i),n.endSlot=t[e](n.endSlot,i),n},_normalizeHorizontalSelection:function(){return null},_normalizeVerticalSelection:function(t,e,n){var i;return i=n?e[0].start:e[e.length-1].end},_continuousSlot:function(){return null},constrainSelection:function(t){var e,n=this.groups[0];this.inRange(t)?n.daySlotCollectionCount()?n.timeSlotCollectionCount()||(t.isAllDay=!0):t.isAllDay=!1:(e=n.firstSlot(),t.isAllDay=e.isDaySlot,t.start=e.startDate(),t.end=e.endDate()),this.groups[t.groupIndex]||(t.groupIndex=0)},move:function(t,e,n){var i,o,s,r,l,a,u=!1,c=this.groups[t.groupIndex],h=this._isGroupedByDate()&&this._isVerticallyGrouped();if(c.timeSlotCollectionCount()||(t.isAllDay=!0),i=c.ranges(t.start,t.end,t.isAllDay,!1),e===H.DOWN||e===H.UP){if(u=!0,r=e===H.UP,this._updateDirection(t,i,n,r,!0),l=this._verticalSlots(t,i,n,r),!l.startSlot&&!n&&this._changeViewPeriod(t,r,!h))return u}else if((e===H.LEFT||e===H.RIGHT)&&(u=!0,r=e===H.LEFT,this._updateDirection(t,i,n,r,!1),l=this._horizontalSlots(t,i,n,r),!l.startSlot&&!n&&this._changeViewPeriod(t,r,h)))return u;return u&&(o=l.startSlot,s=l.endSlot,n?(a=t.backward,a&&o?t.start=o.startDate():!a&&s&&(t.end=s.endDate())):o&&s&&(t.isAllDay=o.isDaySlot,t.start=o.startDate(),t.end=s.endDate()),t.events=[]),u},moveToEventInGroup:function(e,n,i,o){var s,r,l,a,u=e._continuousEvents||[],c=o?-1:1,h=u.length,f=o?h-1:0;if(i.length)for(l=i[i.length-1],a=0;a-1;){if(r=u[f],(!o&&r.start.startDate()>=n.startDate()||o&&r.start.startDate()<=n.startDate())&&r&&t.inArray(r.uid,i)===-1){s=!!r;break}f+=c}return r},moveToEvent:function(t,e){var n,i,o,s,r,l,a=t.groupIndex,u=this.groups[a],c=u.ranges(t.start,t.end,t.isAllDay,!1)[0].start,h=this.groups.length,f=e?-1:1,d=t.events;if(this._isGroupedByDate())if(i=this._getAllEvents(),o=this._getUniqueEvents(i),s=this._getSortedEvents(o),0===d.length)r=this._getNextEventIndexBySlot(c,s,a),e&&r--,n=s[r];else for(l=this._getStartIdx(d,s);l-1&&(d.length>0&&(c=this._getSelectedSlot(c,s,n,l,f,e)),c);){if((!e&&s[l].start.startDate()>=c.startDate()||e&&s[l].start.startDate()<=c.startDate())&&d[0]!=s[l].uid){n=s[l];break}l+=f}else for(;a-1&&(n=this.moveToEventInGroup(u,c,d,e),a+=f,u=this.groups[a],u&&!n);)d=[],c=e?u.lastSlot():u.firstSlot(!0);return n&&(t.events=[n.uid],t.start=n.start.startDate(),t.end=n.end.endDate(),t.isAllDay=n.start.isDaySlot,t.groupIndex=n.start.groupIndex),!!n},current:function(t){return void 0===t?this._current:(this._current=t,void(this.content.has(t)&&this._scrollTo(t,this.content[0])))},select:function(t){this.clearSelection(),this._selectEvents(t)||this._selectSlots(t)},_getNextEventIndexBySlot:function(t,e,n){var i,o,s=0,r=D.date.getDate(t.startDate());for(i=0;io)s++;else if(r.getTime()===o.getTime()&&n>e[i].start.groupIndex)s++;else{if(!(r.getTime()===o.getTime()&&n>=e[i].start.groupIndex&&t.startDate()>e[i].start.startDate()))break;s++}return s},_getSelectedSlot:function(t,e,n,i,o,s){var r,l;return e[i+o]&&e[i].start.groupIndex!==e[i+o].start.groupIndex&&(r=e[i+o].start.groupIndex,l=this.groups[r],l&&!n||(t=null),t=s?l.lastSlot():l.firstSlot(!0)),t},_getStartIdx:function(e,n){var i=0;return t.each(n,function(){return this.uid!==e[0]&&void i++}),i},_getAllEvents:function(){var t,e=[],n=this.groups;for(t=0;t-1&&(i=l[n],o=o.add(i.element),e.events.indexOf(i.uid)===-1?e.events.push(i.uid):u.indexOf(i.uid)===-1&&u.push(i.uid));return o[0]&&(o.addClass("k-state-selected").attr("aria-selected",!0),u.indexOf(o.last().attr("data-uid"))===-1&&this.current(o.last()[0]),this._selectedSlots=[],s=!0),s},inRange:function(t){var e=this.startDate(),n=D.date.addDays(this.endDate(),1),i=t.start,o=t.end;return e<=i&&i=0;n--)i=r[n],o=this._resourceValue(i,i.dataSource.view()[e%i.dataSource.total()]),i.multiple&&(o=[o]),s=D.setter(i.field),s(l,o),e=Math.floor(e/i.dataSource.total());return l},_createResizeHint:function(e,n,i,o){return t(L).css({left:e,top:n,width:i,height:o})},_removeResizeHint:function(){this._resizeHint.remove(),this._resizeHint=t()},_removeMoveHint:function(e){e?(this._moveHint.filter("[data-uid='"+e+"']").remove(),this._moveHint=this._moveHint.filter("[data-uid!='"+e+"']")):(this._moveHint.remove(),this._moveHint=t())},_scrollTo:function(t,e){var n=t.offsetTop,i=t.offsetHeight,o=e.scrollTop,s=e.clientHeight,r=n+i,l=0;l=o>n?n:r>o+s?i<=s?r-s:n:o,e.scrollTop=l},_shouldInverseResourceColor:function(t){var e=new C(t.color).isDark(),n=this.element.css("color"),i=new C(n).isDark();return e==i},_eventTmpl:function(e,n){var i,o=this.options,s=t.extend({},D.Template,o.templateSettings),r=s.paramName,l="",a=typeof e,u={storage:{},count:0};return"function"===a?(u.storage["tmpl"+u.count]=e,l+="#=this.tmpl"+u.count+"("+r+")#",u.count++):"string"===a&&(l+=e),i=D.template(D.format(n,l),s),u.count>0&&(i=t.proxy(i,u.storage)),i},eventResources:function(t){var e,n,i,o,s,r,l,a,u,c,h=[],f=this.options;if(!f.resources)return h;for(e=0;e=0&&i.rows.splice(u,1),r=this.columnLevels=e(i,"columns"),l=this.rowLevels=e(i,"rows"),this.table=t("
'),a=l[l.length-1].length,this.table.find("tbody:first").append(this._topSection(r,s,a)),this.table.find("tbody:first").append(this._bottomSection(r,l,a)),this.element.append(this.table),this._scroller()},refreshLayout:function(){var e,n,i,o,s,r,l=this,a=l.element.find(">.k-scheduler-toolbar"),u=l.element.innerHeight(),c=this._scrollbar,h=0,f=this._isRtl?"left":"right";for(e=0;eh&&(h=w(l.timesHeader)),l.datesHeader&&l.timesHeader&&(n=l.datesHeader.find("table:first tr"),l.timesHeader.find("tr").height(function(e){t(this).height(n.eq(e).height())})),h&&(u-=h),l.footer&&(u-=w(l.footer)),i=function(t){var e,n;return!!t[0].style.height||(e=t.height(),t.height("auto"),n=t.height(),e!=n?(t.height(""),!0):(t.height(""),!1))},o=l.content[0],s=D.support.kineticScrollNeeded?0:c,i(l.element)&&(l.content.height(u>2*c?u:2*c+1),l.times.height(o.clientHeight),r=l.times.find("table"),r.length&&r.height(l.content.find("table")[0].clientHeight)),o.offsetWidth-o.clientWidth>0?(l.table.addClass("k-scrollbar-v"),l.datesHeader.css("padding-"+f,s-parseInt(l.datesHeader.children().css("border-"+f+"-width"),10))):l.datesHeader.css("padding-"+f,""),o.offsetHeight-o.clientHeight>0||o.clientHeight>l.content.children(".k-scheduler-table").height()?l.table.addClass("k-scrollbar-h"):l.table.removeClass("k-scrollbar-h")},_topSection:function(e,n,i){this.timesHeader=s(e.length,n,i);var o=e[e.length-1].length;return this.datesHeader=r(e,o,n),t("").append(this.timesHeader.add(this.datesHeader).wrap("").parent())},_bottomSection:function(e,n,i){return this.times=l(n,i),this.content=a(e[e.length-1],n[n.length-1]),t("").append(this.times.add(this.content).wrap("").parent())},_scroller:function(){var e,n=this;this.content.bind("scroll"+R,function(){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(this.scrollLeft),n.times.scrollTop(this.scrollTop)}),e=D.touchScroller(this.content,{avoidScrolling:function(e){return t(e.event.target).closest(".k-event.k-event-active").length>0}}),e&&e.movable&&(this._touchScroller=e,this.content=e.scrollElement,e.movable.bind("change",function(t){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(-t.sender.x),n.times.scrollTop(-t.sender.y)}))},_resourcesForGroups:function(){var t,e,n,i,o=[],s=this.options.group,r=this.options.resources;if(s=s&&s.resources?s.resources:[],r&&s.length)for(t=0,e=r.length;t=this.groups.length-1))return this._isGroupedByDate()?r:this._isVerticallyGrouped()?s.timeSlotCollectionCount()?(o=s.daySlotCollectionCount(),i=s._collection(o?0:r.collectionIndex,o),n?i.first():i.at(r.collectionIndex)):(i=s._collection(0,!0),i.at(r.index)):s.timeSlotCollectionCount()?(i=s._collection(0,n),n?i.first():i.at(r.index)):(i=s._collection(r.collectionIndex,!0),i.first())},_eventOptionsForMove:function(){return{}},_updateEventForResize:function(){},_updateEventForSelection:function(t){return t}}),C=function(t){var e,n,i,o,s,r=this,l=C.formats;if(1===arguments.length)for(t=r.resolveColor(t),o=0;o255?255:t},percBrightness:function(){var t=this;return T.sqrt(.241*t.r*t.r+.691*t.g*t.g+.068*t.b*t.b)},isDark:function(){var t=this,e=t.percBrightness();return e<180}},C.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(t){return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],C.namedColors={aqua:"00ffff",azure:"f0ffff",beige:"f5f5dc",black:"000000",blue:"0000ff",brown:"a52a2a",coral:"ff7f50",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgray:"a9a9a9",darkgreen:"006400",darkorange:"ff8c00",darkred:"8b0000",dimgray:"696969",fuchsia:"ff00ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lightblue:"add8e6",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumblue:"0000cd",navy:"000080",olive:"808000",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",pink:"ffc0cb",plum:"dda0dd",purple:"800080",red:"ff0000",royalblue:"4169e1",salmon:"fa8072",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",steelblue:"4682b4",tan:"d2b48c",teal:"008080",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},x=/\s*k-state-selected/,t.extend(b.SchedulerView,{createColumns:d,createRows:g,rangeIndex:h,collidingEvents:c,groupEqFilter:m})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}); //# sourceMappingURL=kendo.scheduler.view.min.js.map