@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 24.5 kB
JavaScript
module.exports=function(t){function e(n){if(i[n])return i[n].exports;var a=i[n]={exports:{},id:n,loaded:!1};return t[n].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}({0:function(t,e,i){t.exports=i(1438)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},1089:function(t,e){t.exports=require("./kendo.popup")},1171:function(t,e){t.exports=require("./kendo.dateinput")},1438:function(t,e,i){var n,a,s;!function(o,define){a=[i(1089),i(1171)],n=o,s="function"==typeof n?n.apply(e,a):n,!(void 0!==s&&(t.exports=s))}(function(){return function(t,e){function i(){var t=new at,e=new at(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),i=new at(t.getFullYear(),t.getMonth(),t.getDate(),12,0,0);return-1*(e.getTimezoneOffset()-i.getTimezoneOffset())}function n(t){return 60*t.getHours()*K+t.getMinutes()*K+1e3*t.getSeconds()+t.getMilliseconds()}function a(t){var e=new Date(2100,0,1);return e.setMinutes(-t),e}function s(t,e,i){var a,s=n(e),o=n(i);return!t||s==o||(a=n(t),s>a&&(a+=z),o<s&&(o+=z),a>=s&&a<=o)}function o(t){var e=t.parseFormats;t.format=S(t.format||x.getCulture(t.culture).calendars.standard.patterns.t),e=et(e)?e:[e],e.splice(0,0,t.format),t.parseFormats=e}function l(t){t.preventDefault()}function r(t,e){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function u(t,e){var i,n=e.calendar;return"string"==typeof t&&(i=n.patterns[t]?n.patterns[t]:t),i||(i=n.patterns.d),i}function c(t,e){var i=t[t.length-1];i&&"LITERAL"===i.type?i.pattern+=e:t.push({type:ot,pattern:e})}function d(t){return"h"===t||"K"===t}function p(t){var e;return t<=3?e="abbreviated":4===t?e="wide":5===t?e="narrow":6===t&&(e="short"),e}function h(t,e,i){return i=i||0,t.indexOf(e,i)===i}function m(t,e){var i=!1;return t.indexOf(e)!==-1&&(i=!0),i}function f(t){for(var e,i,n,a,s,o,l,r=x.culture(),m=u(t,r),f=[],_=st.lastIndex=0,g=st.exec(m);g;)l=g[0],_<g.index&&c(f,m.substring(_,g.index)),h(l,'"')||h(l,"'")?c(f,l):(e=l[0],i=pt[e],n={type:i,pattern:l},"hour"===i&&(n.hour12=d(l)),a=ht[i],a&&(s="number"==typeof a.minLength?a.minLength:a.minLength[e],o=l.length,o>=s&&(n.names={type:a.type,nameType:p(o),standAlone:a.standAlone===e})),f.push(n)),_=st.lastIndex,g=st.exec(m);return _<m.length&&c(f,m.substring(_)),f}function _(t,e){for(var i=t+"";i.length<(e||2);)i="0"+i;return i}function g(t,e){return Math.max(Math.round(t/e),0)}function v(t){return t.length&&t[0].getBoundingClientRect().height}var w,k,x=window.kendo,y=x.keys,b=x.parseDate,T=x._activeElement,S=x._extractFormat,M=x.support,D=M.browser,V=x.ui,C=V.Widget,H="open",L="close",R="change",I=".kendoTimePicker",F="click"+I,P="k-state-default",A="disabled",q="readonly",E="li",O="<span></span>",W="k-state-focused",Y="k-state-hover",B="mouseenter"+I+" mouseleave"+I,N="mousedown"+I,K=6e4,z=864e5,G="k-state-selected",j="k-state-disabled",Q="aria-selected",U="aria-expanded",X="aria-hidden",Z="aria-disabled",J="aria-readonly",$="aria-activedescendant",tt="id",et=t.isArray,it=t.extend,nt=t.proxy,at=Date,st=/d{1,2}|E{1,6}|e{1,6}|c{3,6}|c{1}|M{1,5}|L{1,5}|y{1,4}|H{1,2}|h{1,2}|k{1,2}|K{1,2}|m{1,2}|a{1,5}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|x{1,5}|X{1,5}|G{1,5}|q{1,5}|Q{1,5}|"[^"]*"|'[^']*'/g,ot="literal",lt="month",rt="hour",ut="zone",ct="weekday",dt="quarter",pt={G:"era",y:"year",q:dt,Q:dt,M:lt,L:lt,d:"day",E:ct,c:ct,e:ct,h:rt,H:rt,k:rt,K:rt,m:"minute",s:"second",a:"dayperiod",x:ut,X:ut,z:ut,Z:ut},ht={month:{type:"months",minLength:3,standAlone:"L"},quarter:{type:"quarters",minLength:3,standAlone:"q"},weekday:{type:"days",minLength:{E:0,c:3,e:3},standAlone:"c"},dayperiod:{type:"dayPeriods",minLength:0},era:{type:"eras",minLength:0}},mt=new at,ft='<div tabindex="0" class="k-timeselector"><div class="k-time-header"><span class="k-title"></span><button class="k-button k-flat k-time-now" title="Select now" aria-label="Select now">#=messages.now#</button></div><div class="k-time-list-container"><span class="k-time-highlight"></span></div></div>',_t='<div class="k-time-footer k-action-buttons"><button class="k-button k-time-cancel" title="Cancel changes" aria-label="Cancel changes">#=messages.cancel#</button><button class="k-time-accept k-button k-primary" title="Set time" aria-label="Set time">#=messages.set#</button></div>',gt='<span class="k-time-highlight"></span>';mt=new Date(mt.getFullYear(),mt.getMonth(),mt.getDate(),0,0,0),w=function(t){var e=this,i=t.id;e.options=t,e._dates=[],e._createList(t.timeView&&"scroll"===t.timeView.list),i&&(e._timeViewID=i+"_timeview",e._optionID=i+"_option_selected",e.ul.attr(tt,e._timeViewID)),e._heightHandler=nt(e._height,e),e._popup()},w.prototype={_createList:function(t){t?this._createScrollList():this._createClassicRenderingList()},_createScrollList:function(){this.list=t(x.template(ft)(this.options)).on(N,l),this.options.omitPopup||this.list.append(x.template(_t)(this.options)),this.ul=this.list.find(".k-time-list-container"),this.list.on("click"+I,".k-time-header button.k-time-now",nt(this._nowClickHandler,this)),this.list.on("click"+I,".k-time-footer button.k-time-cancel",nt(this._cancelClickHandler,this)),this.list.on("click"+I,".k-time-footer button.k-time-accept",nt(this._setClickHandler,this)),this.list.on("mouseover"+I,".k-time-list-wrapper",nt(this._mouseOverHandler,this)),this.list.on("keydown"+I,nt(this._scrollerKeyDownHandler,this))},_scrollerKeyDownHandler:function(e){var i=this,n=e.keyCode,a=t(e.currentTarget).find(".k-time-list-wrapper.k-state-focused"),s=i.list.find(".k-time-list-wrapper"),o=s.length,l=s.index(a),r=x.support.isRtl(i.wrapper),u=v(a.find(".k-item:visible:eq(0)")),c=a.find(".k-time-container.k-content.k-scrollable");a.length&&(n==y.RIGHT&&!r||n==y.LEFT&&r?l+1<o&&i._focusList(s.eq(l+1)):n==y.LEFT&&!r||n==y.RIGHT&&r?l-1>=0&&i._focusList(s.eq(l-1)):n==y.UP?(c.scrollTop(c.scrollTop()-u),e.preventDefault()):n==y.DOWN?(c.scrollTop(c.scrollTop()+u),e.preventDefault()):n===y.ENTER?i._setClickHandler():n===y.ESC&&i._cancelClickHandler())},_mouseOverHandler:function(e){this._focusList(t(e.currentTarget))},_focusList:function(t){this.list.find(".k-time-list-wrapper").removeClass(W),t.addClass(W),this.list.focus(),this._scrollTop=t.find(".k-scrollable").scrollTop()},_createClassicRenderingList:function(){var e=this;e.ul=t('<ul tabindex="-1" role="listbox" aria-hidden="true" unselectable="on" class="k-list k-reset"/>').css({overflow:M.kineticScrollNeeded?"":"auto"}).on(F,E,nt(e._click,e)).on("mouseenter"+I,E,function(){t(this).addClass(Y)}).on("mouseleave"+I,E,function(){t(this).removeClass(Y)}),e.list=t("<div class='k-list-container k-list-scroller' unselectable='on'/>").append(e.ul).on(N,l),e.template=x.template('<li tabindex="-1" role="option" class="k-item" unselectable="on">#=data#</li>',{useWithBlock:!1})},current:function(i){var n=this,a=n.options.active;return i===e?n._current:(n._current&&(n._current.removeClass(G),n._current&&n._current.length&&(n._current[0].removeAttribute(tt),n._current[0].removeAttribute(Q))),i&&(i=t(i).addClass(G).attr(tt,n._optionID).attr(Q,!0),n.scroll(i[0])),n._current=i,a&&a(i),e)},_updateTitle:function(){this.list.find(".k-time-header > .k-title").html(x.toString(this._value,this.options.format,this.options.culture))},applyValue:function(t){var e,i,n,a,s,o,l,r,u;t&&(e=m(this.options.format.toLowerCase(),"t"),i=t.getHours(),n=t.getMinutes(),a=t.getSeconds(),o=this.ul.find('[data-index="1"]'),l=this.ul.find('[data-index="2"]'),r=this.ul.find('[data-index="3"]'),u=this.ul.find('[data-index="4"]'),e&&(i>=12?(s="PM",i>12&&(i-=12)):(s="AM",0===i&&(i=12))),o.length&&this._scrollListToPosition(o,i),l.length&&this._scrollListToPosition(l,n),r.length&&this._scrollListToPosition(r,a),u.length&&this._scrollListToPosition(u,s))},_scrollListToPosition:function(t,e){var i=t.find('.k-item[data-value="'+_(e)+'"]'),n=v(i);t.scrollTop(t.find(".k-item:visible").index(i)*n)},close:function(){this.popup.close()},destroy:function(){var t=this;t.ul.off(I),t.list.off(I),this.popup&&t.popup.destroy()},open:function(){var t,e=this;(!e.ul[0].firstChild||e.ul.find("li").length<1)&&e.bind(),t=e.popup._hovered,e.popup._hovered=!0,e.popup.open(),setTimeout(function(){e.popup._hovered=t},1),e._current&&e.scroll(e._current[0])},dataBind:function(t){for(var e,i=this,n=i.options,a=n.format,o=x.toString,l=i.template,r=t.length,u=0,c="";u<r;u++)e=t[u],s(e,n.min,n.max)&&(c+=l(o(e,a,n.culture)));i._html(c)},refresh:function(){var t,e,s=this,o=s.options,l=o.format,u=i(),c=u<0,d=x.parseDate(s._value),p=d?r(d,o.min):r(new Date,o.min),h=o.min,m=o.max,_=n(h),g=n(m),v=n(a(o.interval)),w=o.interval*K,k=x.toString,y=s.template,b=o.useValueToRender?p:new Date((+o.min)),T=new at(b),S="";e=c?(z+u*K)/w:z/w,_==g&&v!==g||(_>g&&(g+=z),e=(g-_)/w+1),o.timeView&&"scroll"===o.timeView.list?S=s._createListContent(f(l)):s.getDatesInRange(t,g,T,m,w,b).forEach(function(t){S+=y(k(t,l,o.culture))}),s._html(S)},_updateListBottomOffset:function(t){var e=v(t.find(".k-item:visible:eq(0)")),i=t.outerHeight(),n=i-e;t.find(".k-scrollable-placeholder").css({height:t.find("ul").height()+n})},_updateHoursRange:function(){var e,i,n=this,a=this.ul.find('[data-index="1"]'),s=this._minHours,o=this._maxHours,l=m(this.options.format.toLowerCase(),"t"),r=this._findSelectedValue(this.ul.find('[data-index="4"]'));a.length&&(l&&r?("AM"===r?(s<12&&(i=!0),o<12&&(e=!0)):"PM"===r&&(s>12&&(i=!0,s-=12),o>12&&(e=!0,o-=12)),a.find(".k-item").each(function(a,l){l=t(l);var r=+l.attr("data-value");n._validateMin&&i&&r<s||n._validateMax&&e&&r>o?l.hide():l.show()})):a.find(".k-item").each(function(e,i){i=t(i);var a=+i.attr("data-value");n._validateMin&&a<s||n._validateMax&&a>o?i.hide():i.show()}),this._updateListBottomOffset(a))},_updateMinutesRange:function(){var e=this,i=this.ul.find('[data-index="2"]'),n=this._minHours,a=this._maxHours,s=this._minMinutes,o=this._maxMinutes,l=+this._findSelectedValue(this.ul.find('[data-index="1"]')),r=m(this.options.format.toLowerCase(),"t"),u=this._findSelectedValue(this.ul.find('[data-index="4"]'));r&&"PM"===u&&(l+=12),i.length&&(i.find(".k-item").each(function(i,r){r=t(r);var u=+r.attr("data-value");e._validateMin&&u<s&&n&&l===n||e._validateMax&&u>o&&a&&l===a?r.hide():r.show()}),this._updateListBottomOffset(i))},_updateSecondsRange:function(){var e=this,i=this.ul.find('[data-index="3"]'),n=this._minSeconds,a=this._minSeconds,s=this._minMinutes,o=this._maxMinutes,l=+this._findSelectedValue(this.ul.find('[data-index="2"]'));i.length&&(i.find(".k-item").each(function(i,r){r=t(r);var u=+r.attr("data-value");e._validateMin&&u<n&&s&&l===s||e._validateMax&&u>a&&o&&l===o?r.hide():r.show()}),this._updateListBottomOffset(i))},_updateDesignatorRange:function(){var t=this._minHours,e=this._maxHours,i=this.ul.find('[data-index="4"]');i.length&&(this._validateMin&&t>=12?i.find('.k-item[data-value="AM"]').hide():i.find('.k-item[data-value="AM"]').show(),this._validateMax&&e<12?i.find('.k-item[data-value="PM"]').hide():i.find('.k-item[data-value="PM"]').show())},_updateRanges:function(){var t,e;if(this.options.specifiedRange){if(this._currentlySelected||(this._currentlySelected=new Date),t=this.options.max,e=this.options.min,this.options.validateDate){if(this._validateMax=t.getFullYear()===this._currentlySelected.getFullYear()&&t.getMonth()===this._currentlySelected.getMonth()&&t.getDate()===this._currentlySelected.getDate(),this._validateMin=e.getFullYear()===this._currentlySelected.getFullYear()&&e.getMonth()===this._currentlySelected.getMonth()&&e.getDate()===this._currentlySelected.getDate(),!this._validateMax&&!this._validateMin)return}else this._validateMax=!0,this._validateMin=!0;this._minMinutes=e.getMinutes(),this._maxMinutes=t.getMinutes(),this._minHours=e.getHours(),this._maxHours=t.getHours(),this._minSeconds=e.getSeconds(),this._maxSeconds=t.getSeconds(),this._updateDesignatorRange(),this._updateHoursRange(),this._updateMinutesRange(),this._updateSecondsRange()}},addTranslate:function(){var t,e,i,n,a,s,o,l=this.ul.find(".k-time-container.k-content.k-scrollable"),r=l.length;for(o=0;o<r;o++)t=l.eq(o),e=v(t.find(".k-item:visible:eq(0)")),i=t.outerHeight(),n=(i-e)/2,a="translateY("+n+"px)",s=i-e,t.find("ul").css({transform:a,"-ms-transform":a}),t.find(".k-scrollable-placeholder").css({height:t.find("ul").height()+s}),t.off(I).on("click"+I,".k-item",nt(this._itemClickHandler,this)).on("scroll"+I,nt(this._listScrollHandler,this))},_nowClickHandler:function(){var t=new Date;this.value(t),this.options.change(x.toString(t,this.options.format,this.options.culture))},_cancelClickHandler:function(){this.value(this._value),this.popup.close()},_setClickHandler:function(){this._value=new Date(this._currentlySelected),this.options.change(x.toString(this._currentlySelected,this.options.format,this.options.culture),!0),this.popup.close()},_listScrollHandler:function(e){var i=this,n=v(t(e.currentTarget).find(".k-item:visible:eq(0)"));i._scrollingTimeout&&clearTimeout(i._scrollingTimeout),i._scrollingTimeout=setTimeout(function(){e.currentTarget.scrollTop%n>1&&(e.currentTarget.scrollTop+=n-e.currentTarget.scrollTop%n),i._scrollTop=e.currentTarget.scrollTop,i._updateCurrentlySelected(),i._updateRanges()},100)},_updateCurrentlySelected:function(){var t,i,n,a,s=m(this.options.format.toLowerCase(),"t"),o=this.ul.find('[data-index="1"]'),l=this.ul.find('[data-index="2"]'),r=this.ul.find('[data-index="3"]'),u=this.ul.find('[data-index="4"]');this.ul.is(":visible")&&(this._currentlySelected||(this._currentlySelected=this._value?new Date(this._value):new Date),o.length&&(t=+this._findSelectedValue(o)),l.length&&(i=+this._findSelectedValue(l)),r.length&&(n=+this._findSelectedValue(r)),u.length&&(a=this._findSelectedValue(u)),s&&("PM"==a&&(t+=12,24==t&&(t=12)),"AM"===a&&12===t&&(t=0)),t!==e&&this._currentlySelected.setHours(t),i!==e&&this._currentlySelected.setMinutes(i),n!==e&&this._currentlySelected.setSeconds(n))},_findSelectedValue:function(t){var e=g(t.scrollTop(),v(t.find(".k-item:visible:eq(0)")));return t.find(".k-item:visible").eq(e).attr("data-value")},_itemClickHandler:function(e){var i=t(e.originalEvent.currentTarget),n=i.find(".k-item:visible").index(t(e.currentTarget)),a=v(i.find(".k-item:visible:eq(0)"));i.scrollTop(n*a)},getDatesInRange:function(t,e,i,a,s,o){for(var l=[];;){if(e&&(n(o)>=e||i.getDate()!=o.getDate())){t=n(o),i<o&&(t+=z),t>e&&(o=new at((+a))),n(o)>0&&l.push(new Date(o));break}if(i.getDate()!=o.getDate())break;if(l.push(new Date(o)),o.setTime(o.getTime()+s),!e&&this.options.maxSet)break}return l},_createListContent:function(t){var e,i,n,a=t.length,s="";for(n=0;n<a;n++)e=t[n],"literal"===e.type?s+=this._literalTemplate(e):(i=this._getValues(e,!0),s+=this._itemTemplate(i.values,e,this.options.messages[e.type],i.index));return s},_itemTemplate:function(t,e,i,n){var a,s="",o=t.length;for(s+='<div class="k-time-list-wrapper" role="presentation"><span class="k-title">'+(i||e.type)+'</span><div class="k-time-list"><div class="k-time-container k-content k-scrollable" role="presentation" data-index="'+n+'"><ul class="k-reset">',a=0;a<o;a++)s+='<li class="k-item" data-value="'+t[a]+'"><span>'+t[a]+"</span></li>";return s+='</ul><div class="k-scrollable-placeholder"></div></div></div></div>'},_getValues:function(t,e){var i,n,a=[],s=0;for("hour"===t.type?(s=1,i=1,n=t.hour12?12:24):"minute"===t.type?(i=2,n=59):"second"===t.type&&(i=3,n=59);s<=n;s++)a.push(e?_(s):s);return{values:a,index:i}},_literalTemplate:function(t){var e='<div class="k-time-separator">'+(" tt"===t.pattern?":":t.pattern)+"</div>";return" tt"===t.pattern&&(e+=this._itemTemplate(["AM","PM"],t,"AM/PM",4)),e},bind:function(){var t=this,e=t.options.dates;e&&e[0]?t.dataBind(e):t.refresh()},_html:function(t){var e=this;e.options.timeView&&"scroll"===e.options.timeView.list?(t=gt+t,e.ul.html(t)):(e.ul[0].innerHTML=t,e.popup.unbind(H,e._heightHandler),e.popup.one(H,e._heightHandler),e.current(null),e.select(e._value))},scroll:function(t){if(t){var e=this.list[0],i=t.offsetTop,n=t.offsetHeight,a=e.scrollTop,s=e.clientHeight,o=i+n;a>i?a=i:o>a+s&&(a=o-s),e.scrollTop=a}},select:function(e){var i,n=this,a=n.options,s=n._current;e instanceof Date&&(e=x.toString(e,a.format,a.culture)),"string"==typeof e&&(s&&s.text()===e?e=s:(e=t.grep(n.ul[0].childNodes,function(t){return(t.textContent||t.innerText)==e}),e=e[0]?e:null)),i=n._distinctSelection(e),n.current(i)},_distinctSelection:function(e){var i,a,s=this;return e&&e.length>1&&(i=n(s._value),a=t.inArray(i,s._dates),e=s.ul.children()[a]),e},setOptions:function(t){var e=this.options;t.min=b(t.min),t.max=b(t.max),this.options=it(e,t,{active:e.active,change:e.change,close:e.close,open:e.open}),this.bind()},toggle:function(){var t=this;t.popup.visible()?t.close():t.open()},value:function(t){var e=this;e._value=t,e.ul[0].firstChild&&(e.options.timeView&&"scroll"===e.options.timeView.list?e.applyValue(t):e.select(t))},_click:function(e){var i=this,n=t(e.currentTarget),a=n.text(),s=i.options.dates;s&&s.length>0&&(a=s[n.index()]),e.isDefaultPrevented()||(i.select(n),i.options.change(a,!0),i.close())},_height:function(){var t=this,e=t.list,i=e.parent(".k-animation-container"),n=t.options.height;t.ul[0].children.length&&e.add(i).show().height(t.ul[0].scrollHeight>n?n:"auto").hide()},_parse:function(t){var e=this,i=e.options,a=n(i.min)!=n(mt)?i.min:null,s=n(i.max)!=n(mt)?i.max:null,o=e._value||a||s||mt;return t instanceof at?t:(t=b(t,i.parseFormats,i.culture),t&&(t=new at(o.getFullYear(),o.getMonth(),o.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())),t)},_adjustListWidth:function(){var t,e,i=this.list,n=i[0].style.width,a=this.options.anchor,s=x._outerWidth;!i.data("width")&&n||(t=window.getComputedStyle?window.getComputedStyle(a[0],null):0,e=t?parseFloat(t.width):s(a),t&&(D.mozilla||D.msie)&&(e+=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)+parseFloat(t.borderLeftWidth)+parseFloat(t.borderRightWidth)),n=e-(s(i)-i.width()),i.css({fontFamily:a.css("font-family"),width:n}).data("width",n))},_popup:function(){var t=this,e=t.list,i=t.options,n=i.anchor;this.options.omitPopup?e.appendTo(i.timeDiv):t.popup=new V.Popup(e,it(i.popup,{anchor:n,open:i.open,close:i.close,animation:i.animation,isRtl:M.isRtl(i.anchor),activate:function(){t.options.timeView&&"scroll"===t.options.timeView.list&&(t.addTranslate(),t._value?t.applyValue(t._value):t._updateCurrentlySelected(),t._updateRanges(),t._focusList(t.list.find(".k-time-list-wrapper:eq(0)")))}}))},move:function(t){var i=this,n=t.keyCode,a=i.ul[0],s=i._current,o=n===y.DOWN;if(n===y.UP||o){if(t.altKey)return i.toggle(o),e;s=o?s?s[0].nextSibling:a.firstChild:s?s[0].previousSibling:a.lastChild,s&&i.select(s),i.options.change(i._current.text()),t.preventDefault()}else n!==y.ENTER&&n!==y.TAB&&n!==y.ESC||(t.preventDefault(),s&&i.options.change(s.text(),!0),i.close())}},w.getMilliseconds=n,x.TimeView=w,k=C.extend({init:function(e,i){var a,s,l,r,u,c,d=this;i=i||{},i.componentType=i.componentType||"classic",C.fn.init.call(d,e,i),e=d.element,i=d.options,i.min=b(e.attr("min"))||b(i.min),i.max=b(e.attr("max"))||b(i.max),+i.max==+mt&&+i.min==+mt||(this._specifiedRange=!0),o(i),d._initialOptions=it({},i),d._wrapper(),d.options.timeView&&"scroll"===d.options.timeView.list&&(d.options.height=null),d.timeView=s=new w(it({},i,{id:e.attr(tt),anchor:d.wrapper,format:i.format,change:function(t,i){i?d._change(t):e.val(t)},open:function(t){d.options.timeView&&"scroll"!==d.options.timeView.list?d.timeView._adjustListWidth():d.timeView._updateTitle(),d.trigger(H)?t.preventDefault():(e.attr(U,!0),a.attr(X,!1))},close:function(t){d.trigger(L)?t.preventDefault():(e.attr(U,!1),a.attr(X,!0))},active:function(t){e&&e.length&&e[0].removeAttribute($),t&&e.attr($,s._optionID)},specifiedRange:d._specifiedRange,maxSet:+i.max!=+mt})),a=s.ul,d._icon(),d._reset();try{e[0].setAttribute("type","text")}catch(p){e[0].type="text"}e.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":s._timeViewID,autocomplete:"off"}),l=e.is("[disabled]")||t(d.element).parents("fieldset").is(":disabled"),l?d.enable(!1):d.readonly(e.is("[readonly]")),i.dateInput&&(r=i.min,u=i.max,c=new at,n(r)==n(u)&&(r=new at(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0),u=new at(c.getFullYear(),c.getMonth(),c.getDate(),24,0,0)),d._dateInput=new V.DateInput(e,{culture:i.culture,format:i.format,min:r,max:u,value:i.value,interval:i.interval})),d._old=d._update(i.value||d.element.val()),d._oldText=e.val(),x.notify(d)},options:{name:"TimePicker",min:mt,max:mt,format:"",dates:[],parseFormats:[],value:null,interval:30,height:200,animation:{},dateInput:!1,messages:{set:"Set",cancel:"Cancel",hour:"hour",minute:"minute",second:"second",millisecond:"millisecond",now:"Now"},componentType:"classic"},events:[H,L,R],componentTypes:{classic:{timeView:{list:"list"}},modern:{timeView:{list:"scroll"}}},setOptions:function(t){var e=this,i=e._value;C.fn.setOptions.call(e,t),t=e.options,o(t),e.timeView.setOptions(t),i&&e.element.val(x.toString(i,t.format,t.culture))},dataBind:function(t){et(t)&&this.timeView.dataBind(t)},_editable:function(t){var e=this,i=t.disable,n=t.readonly,a=e._arrow.off(I),s=e.element.off(I),o=e._inputWrapper.off(I);e._dateInput&&e._dateInput._unbindInput(),n||i?(o.addClass(i?j:P).removeClass(i?P:j),s.attr(A,i).attr(q,n).attr(Z,i).attr(J,n)):(o.addClass(P).removeClass(j).on(B,e._toggleHover),s&&s.length&&(s[0].removeAttribute(A),s[0].removeAttribute(q)),s.attr(Z,!1).attr(J,!1).on("keydown"+I,nt(e._keydown,e)).on("focusout"+I,nt(e._blur,e)).on("focus"+I,function(){e._inputWrapper.addClass(W)}),e._dateInput&&e._dateInput._bindInput(),a.on(F,nt(e._click,e)).on(N,l))},readonly:function(t){this._editable({readonly:t===e||t,disable:!1})},enable:function(t){this._editable({readonly:!1,disable:!(t=t===e||t)})},destroy:function(){var t=this;C.fn.destroy.call(t),t.timeView.destroy(),t.element.off(I),t._arrow.off(I),t._inputWrapper.off(I),t._form&&t._form.off("reset",t._resetHandler)},close:function(){this.timeView.close()},open:function(){this.timeView.open()},min:function(t){return this._option("min",t)},max:function(t){return t&&this.timeView?this.timeView.options.maxSet=!0:this.timeView&&(this.timeView.options.maxSet=!1),this._option("max",t)},value:function(t){var i=this;return t===e?i._value:(i._old=i._update(t),null===i._old&&i.element.val(""),i._oldText=i.element.val(),e)},_blur:function(){var t=this,e=t.element.val();t.options.timeView&&"scroll"===t.options.timeView.list||t.close(),e!==t._oldText&&t._change(e),t._inputWrapper.removeClass(W)},_click:function(){var t=this,e=t.element;t.timeView.toggle(),M.touch||e[0]===T()||e.trigger("focus")},_change:function(t){var e,i,n,a=this,s=a.element.val();t=a._update(t),e=!x.calendar.isEqualDate(a._old,t),i=e&&!a._typing,n=s!==a.element.val(),(i||n)&&a.element.trigger(R),e&&(a._old=t,a._oldText=a.element.val(),a.trigger(R)),a._typing=!1},_icon:function(){var e,i=this,n=i.element;e=n.next("span.k-select"),e[0]||(e=t('<span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-clock"></span></span>').insertAfter(n)),i._arrow=e.attr({role:"button","aria-controls":i.timeView._timeViewID})},_keydown:function(t){var e=this,i=t.keyCode,n=e.timeView,a=e.element.val();n.popup.visible()||t.altKey?(n.move(t),e._dateInput&&t.stopImmediatePropagation&&t.stopImmediatePropagation()):i===y.ENTER&&a!==e._oldText?e._change(a):e._typing=!0},_option:function(t,i){var n=this,a=n.options;return i===e?a[t]:(i=n.timeView._parse(i),i&&(i=new at((+i)),a[t]=i,n.timeView.options[t]=i,n.timeView.bind()),e)},_toggleHover:function(e){t(e.currentTarget).toggleClass(Y,"mouseenter"===e.type)},_update:function(t){var e=this,i=e.options,n=e.timeView,a=n._parse(t);return s(a,i.min,i.max)||(a=null),e._value=a,e._currentlySelected=a,e._dateInput&&a?e._dateInput.value(a||t):e.element.val(x.toString(a||t,i.format,i.culture)),n.value(a),a},_wrapper:function(){var e,i=this,n=i.element;e=n.parents(".k-timepicker"),e[0]||(e=n.wrap(O).parent().addClass("k-picker-wrap k-state-default"),e=e.wrap(O).parent()),e[0].style.cssText=n[0].style.cssText,i.wrapper=e.addClass("k-widget k-timepicker").addClass(n[0].className),n.css({width:"100%",height:n[0].style.height}),i._inputWrapper=t(e[0].firstChild)},_reset:function(){var e=this,i=e.element,n=i.attr("form"),a=n?t("#"+n):i.closest("form");a[0]&&(e._resetHandler=function(){e.value(i[0].defaultValue),e.max(e._initialOptions.max),e.min(e._initialOptions.min)},e._form=a.on("reset",e._resetHandler))}}),V.plugin(k)}(window.kendo.jQuery),window.kendo},i(3))}});