27 lines
15 KiB
JavaScript
27 lines
15 KiB
JavaScript
/**
|
|
* 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(e,define){define("kendo.timepicker.min",["kendo.popup.min","kendo.dateinput.min"],e)}(function(){return function(e,t){function n(e,t,n){var i,o=e.getTimezoneOffset();e.setTime(e.getTime()+t),n||(i=e.getTimezoneOffset()-o,e.setTime(e.getTime()+i*W))}function i(){var e=new Q,t=new Q(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),n=new Q(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);return-1*(t.getTimezoneOffset()-n.getTimezoneOffset())}function o(e){return 60*e.getHours()*W+e.getMinutes()*W+1e3*e.getSeconds()+e.getMilliseconds()}function a(e,t,n){var i,a=o(t),r=o(n);return!e||a==r||(i=o(e),a>i&&(i+=O),r<a&&(r+=O),i>=a&&i<=r)}function r(e){var t=e.parseFormats;e.format=m(e.format||c.getCulture(e.culture).calendars.standard.patterns.t),t=L(t)?t:[t],t.splice(0,0,e.format),e.parseFormats=t}function s(e){e.preventDefault()}var l,u,c=window.kendo,d=c.keys,p=c.parseDate,f=c._activeElement,m=c._extractFormat,h=c.support,g=h.browser,_=c.ui,v=_.Widget,w="open",k="close",x="change",y=".kendoTimePicker",b="click"+y,D="k-state-default",T="disabled",C="readonly",V="li",F="<span/>",M="k-state-focused",S="k-state-hover",I="mouseenter"+y+" mouseleave"+y,H="mousedown"+y,W=6e4,O=864e5,A="k-state-selected",Y="k-state-disabled",P="aria-selected",B="aria-expanded",E="aria-hidden",N="aria-disabled",R="aria-activedescendant",z="id",L=e.isArray,j=e.extend,K=e.proxy,Q=Date,U=new Q;U=new Q(U.getFullYear(),U.getMonth(),U.getDate(),0,0,0),l=function(t){var n=this,i=t.id;n.options=t,n._dates=[],n.ul=e('<ul tabindex="-1" role="listbox" aria-hidden="true" unselectable="on" class="k-list k-reset"/>').css({overflow:h.kineticScrollNeeded?"":"auto"}).on(b,V,K(n._click,n)).on("mouseenter"+y,V,function(){e(this).addClass(S)}).on("mouseleave"+y,V,function(){e(this).removeClass(S)}),n.list=e("<div class='k-list-container k-list-scroller' unselectable='on'/>").append(n.ul).on(H,s),i&&(n._timeViewID=i+"_timeview",n._optionID=i+"_option_selected",n.ul.attr(z,n._timeViewID)),n._popup(),n._heightHandler=K(n._height,n),n.template=c.template('<li tabindex="-1" role="option" class="k-item" unselectable="on">#=data#</li>',{useWithBlock:!1})},l.prototype={current:function(n){var i=this,o=i.options.active;return n===t?i._current:(i._current&&i._current.removeClass(A).removeAttr(P).removeAttr(z),n&&(n=e(n).addClass(A).attr(z,i._optionID).attr(P,!0),i.scroll(n[0])),i._current=n,o&&o(n),t)},close:function(){this.popup.close()},destroy:function(){var e=this;e.ul.off(y),e.list.off(y),e.popup.destroy()},open:function(){var e=this;e.ul[0].firstChild||e.bind(),e.popup.open(),e._current&&e.scroll(e._current[0])},dataBind:function(e){for(var t,n=this,i=n.options,o=i.format,r=c.toString,s=n.template,l=e.length,u=0,d="";u<l;u++)t=e[u],a(t,i.min,i.max)&&(d+=s(r(t,o,i.culture)));n._html(d)},refresh:function(){var e,t,a,r=this,s=r.options,l=s.format,u=i(),d=u<0,p=s.min,f=s.max,m=o(p),h=o(f),g=s.interval*W,_=c.toString,v=r.template,w=new Q((+p)),k=w.getDate(),x=0,y="";for(a=d?(O+u*W)/g:O/g,m!=h&&(m>h&&(h+=O),a=(h-m)/g+1),t=parseInt(a,10);x<a;x++)x&&n(w,g,d),h&&t==x&&(e=o(w),k<w.getDate()&&(e+=O),e>h&&(w=new Q((+f)))),r._dates.push(o(w)),y+=v(_(w,l,s.culture));r._html(y)},bind:function(){var e=this,t=e.options.dates;t&&t[0]?e.dataBind(t):e.refresh()},_html:function(e){var t=this;t.ul[0].innerHTML=e,t.popup.unbind(w,t._heightHandler),t.popup.one(w,t._heightHandler),t.current(null),t.select(t._value)},scroll:function(e){if(e){var t=this.list[0],n=e.offsetTop,i=e.offsetHeight,o=t.scrollTop,a=t.clientHeight,r=n+i;o>n?o=n:r>o+a&&(o=r-a),t.scrollTop=o}},select:function(t){var n,i=this,o=i.options,a=i._current;t instanceof Date&&(t=c.toString(t,o.format,o.culture)),"string"==typeof t&&(a&&a.text()===t?t=a:(t=e.grep(i.ul[0].childNodes,function(e){return(e.textContent||e.innerText)==t}),t=t[0]?t:null)),n=i._distinctSelection(t),i.current(n)},_distinctSelection:function(t){var n,i,a=this;return t&&t.length>1&&(n=o(a._value),i=e.inArray(n,a._dates),t=a.ul.children()[i]),t},setOptions:function(e){var t=this.options;e.min=p(e.min),e.max=p(e.max),this.options=j(t,e,{active:t.active,change:t.change,close:t.close,open:t.open}),this.bind()},toggle:function(){var e=this;e.popup.visible()?e.close():e.open()},value:function(e){var t=this;t._value=e,t.ul[0].firstChild&&t.select(e)},_click:function(t){var n=this,i=e(t.currentTarget),o=i.text(),a=n.options.dates;a&&a.length>0&&(o=a[i.index()]),t.isDefaultPrevented()||(n.select(i),n.options.change(o,!0),n.close())},_height:function(){var e=this,t=e.list,n=t.parent(".k-animation-container"),i=e.options.height;e.ul[0].children.length&&t.add(n).show().height(e.ul[0].scrollHeight>i?i:"auto").hide()},_parse:function(e){var t=this,n=t.options,i=t._value||U;return e instanceof Q?e:(e=p(e,n.parseFormats,n.culture),e&&(e=new Q(i.getFullYear(),i.getMonth(),i.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())),e)},_adjustListWidth:function(){var e,t,n=this.list,i=n[0].style.width,o=this.options.anchor,a=c._outerWidth;!n.data("width")&&i||(e=window.getComputedStyle?window.getComputedStyle(o[0],null):0,t=e?parseFloat(e.width):a(o),e&&(g.mozilla||g.msie)&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),i=t-(a(n)-n.width()),n.css({fontFamily:o.css("font-family"),width:i}).data("width",i))},_popup:function(){var e=this,t=e.list,n=e.options,i=n.anchor;e.popup=new _.Popup(t,j(n.popup,{anchor:i,open:n.open,close:n.close,animation:n.animation,isRtl:h.isRtl(n.anchor)}))},move:function(e){var n=this,i=e.keyCode,o=n.ul[0],a=n._current,r=i===d.DOWN;if(i===d.UP||r){if(e.altKey)return n.toggle(r),t;a=r?a?a[0].nextSibling:o.firstChild:a?a[0].previousSibling:o.lastChild,a&&n.select(a),n.options.change(n._current.text()),e.preventDefault()}else i!==d.ENTER&&i!==d.TAB&&i!==d.ESC||(e.preventDefault(),a&&n.options.change(a.text(),!0),n.close())}},l.getMilliseconds=o,c.TimeView=l,u=v.extend({init:function(t,n){var i,a,s,u,d,f,m=this;v.fn.init.call(m,t,n),t=m.element,n=m.options,n.min=p(t.attr("min"))||p(n.min),n.max=p(t.attr("max"))||p(n.max),r(n),m._initialOptions=j({},n),m._wrapper(),m.timeView=a=new l(j({},n,{id:t.attr(z),anchor:m.wrapper,format:n.format,change:function(e,n){n?m._change(e):t.val(e)},open:function(e){m.timeView._adjustListWidth(),m.trigger(w)?e.preventDefault():(t.attr(B,!0),i.attr(E,!1))},close:function(e){m.trigger(k)?e.preventDefault():(t.attr(B,!1),i.attr(E,!0))},active:function(e){t.removeAttr(R),e&&t.attr(R,a._optionID)}})),i=a.ul,m._icon(),m._reset();try{t[0].setAttribute("type","text")}catch(h){t[0].type="text"}t.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":a._timeViewID}),s=t.is("[disabled]")||e(m.element).parents("fieldset").is(":disabled"),s?m.enable(!1):m.readonly(t.is("[readonly]")),n.dateInput&&(u=n.min,d=n.max,f=new Q,o(u)==o(d)?(u=new Q(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0),d=new Q(f.getFullYear(),f.getMonth(),f.getDate(),24,0,0)):(u=new Q(f.getFullYear(),f.getMonth(),f.getDate(),u.getHours(),u.getMinutes(),u.getSeconds(),u.getMilliseconds()),d=new Q(f.getFullYear(),f.getMonth(),f.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds())),m._dateInput=new _.DateInput(t,{culture:n.culture,format:n.format,min:u,max:d,value:n.value})),m._old=m._update(n.value||m.element.val()),m._oldText=t.val(),c.notify(m)},options:{name:"TimePicker",min:U,max:U,format:"",dates:[],parseFormats:[],value:null,interval:30,height:200,animation:{},dateInput:!1},events:[w,k,x],setOptions:function(e){var t=this,n=t._value;v.fn.setOptions.call(t,e),e=t.options,r(e),t.timeView.setOptions(e),n&&t.element.val(c.toString(n,e.format,e.culture))},dataBind:function(e){L(e)&&this.timeView.dataBind(e)},_editable:function(e){var t=this,n=e.disable,i=e.readonly,o=t._arrow.off(y),a=t.element.off(y),r=t._inputWrapper.off(y);i||n?(r.addClass(n?Y:D).removeClass(n?D:Y),a.attr(T,n).attr(C,i).attr(N,n)):(r.addClass(D).removeClass(Y).on(I,t._toggleHover),a.removeAttr(T).removeAttr(C).attr(N,!1).on("keydown"+y,K(t._keydown,t)).on("focusout"+y,K(t._blur,t)).on("focus"+y,function(){t._inputWrapper.addClass(M)}),o.on(b,K(t._click,t)).on(H,s))},readonly:function(e){this._editable({readonly:e===t||e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t||e)})},destroy:function(){var e=this;v.fn.destroy.call(e),e.timeView.destroy(),e.element.off(y),e._arrow.off(y),e._inputWrapper.off(y),e._form&&e._form.off("reset",e._resetHandler)},close:function(){this.timeView.close()},open:function(){this.timeView.open()},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_blur:function(){var e=this,t=e.element.val();e.close(),t!==e._oldText&&e._change(t),e._inputWrapper.removeClass(M)},_click:function(){var e=this,t=e.element;e.timeView.toggle(),h.touch||t[0]===f()||t.focus()},_change:function(e){var t=this;e=t._update(e),+t._old!=+e&&(t._old=e,t._oldText=t.element.val(),t._typing||t.element.trigger(x),t.trigger(x)),t._typing=!1},_icon:function(){var t,n=this,i=n.element;t=i.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-clock"></span></span>').insertAfter(i)),n._arrow=t.attr({role:"button","aria-controls":n.timeView._timeViewID})},_keydown:function(e){var t=this,n=e.keyCode,i=t.timeView,o=t.element.val();i.popup.visible()||e.altKey?(i.move(e),t._dateInput&&e.stopImmediatePropagation&&e.stopImmediatePropagation()):n===d.ENTER&&o!==t._oldText?t._change(o):t._typing=!0},_option:function(e,n){var i=this,o=i.options;return n===t?o[e]:(n=i.timeView._parse(n),n&&(n=new Q((+n)),o[e]=n,i.timeView.options[e]=n,i.timeView.bind()),t)},_toggleHover:function(t){e(t.currentTarget).toggleClass(S,"mouseenter"===t.type)},_update:function(e){var t,n=this,i=n.options,o=n.timeView,r=o._parse(e),s=n._value,l=null===r&&null===s||r instanceof Date&&s instanceof Date;return a(r,i.min,i.max)||(r=null),+r===+s&&l?(t=c.toString(r,i.format,i.culture),t!==e&&n.element.val(null===r?e:t),r):(n._value=r,n._dateInput&&r?n._dateInput.value(r||e):n.element.val(c.toString(r||e,i.format,i.culture)),o.value(r),r)},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-timepicker"),t[0]||(t=i.wrap(F).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(F).parent()),t[0].style.cssText=i[0].style.cssText,n.wrapper=t.addClass("k-widget k-timepicker k-header").addClass(i[0].className),i.css({width:"100%",height:i[0].style.height}),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),o=i?e("#"+i):n.closest("form");o[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue),t.max(t._initialOptions.max),t.min(t._initialOptions.min)},t._form=o.on("reset",t._resetHandler))}}),_.plugin(u)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
|
|
//# sourceMappingURL=kendo.timepicker.min.js.map
|