kendo-ui-core
Version:
Kendo UI is everything you need to build sites and apps with HTML5 & JavaScript. Kendo UI Core is the free and open-source version of Kendo UI that provides access to the web's best UI widgets and key framework features, essential for developing great exp
2 lines • 27.1 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./dist-AH6B3-_t.js`),require(`./core-R4j5Vh3b.js`),require(`./kendo.popup.js`),require(`./kendo.html.button.js`),require(`./kendo.label.js`),require(`./kendo.calendar.js`),require(`./kendo.dateinput.js`),(function(e,t){var n=window.kendo,r=n.keys,i=n.html,a=n.parseDate,o=n._activeElement,s=n._extractFormat,c=n.support,l=c.browser,u=n.ui,d=u.Widget,f=`open`,p=`close`,m=`change`,h=`.kendoTimePicker`,g=`click`+h,_=`disabled`,v=`readonly`,y=`li`,ee=`<span></span>`,b=`k-focus`,x=`k-hover`,te=`mouseenter`+h+` mouseleave`+h,S=`mousedown`+h,C=6e4,w=864e5,T=`k-selected`,E=`k-disabled`,D=`aria-selected`,O=`aria-expanded`,k=`aria-hidden`,A=`aria-disabled`,j=`aria-readonly`,M=`aria-activedescendant`,N=`id`,P=Array.isArray,F=e.extend,I=Date,L=/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,ne=`literal`,R=`month`,z=`hour`,B=`zone`,V=`weekday`,H=`quarter`,re={G:`era`,y:`year`,q:H,Q:H,M:R,L:R,d:`day`,E:V,c:V,e:V,h:z,H:z,k:z,K:z,m:`minute`,s:`second`,a:`dayperiod`,x:B,X:B,z:B,Z:B},ie={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}},U=new I,ae=({mainSize:e,messages:t,buttonSize:r})=>`<div><div tabindex="0" class="k-timeselector ${e}"><div class="k-time-header"><span class="k-title"></span>`+n.html.renderButton(`<button class="k-time-now" title="Select now" aria-label="Select now">${t.now}</button>`,{fillMode:`flat`,size:r})+`</div><div class="k-time-list-container"><span class="k-time-highlight"></span></div></div>`+oe(r,t)+`</div>`,oe=(e,t)=>`<div class="k-time-footer k-actions k-actions-stretched k-actions-horizontal">`+n.html.renderButton(`<button class="k-time-accept" title="Set time" aria-label="Set time">${t.set}</button>`,{size:e,themeColor:`primary`})+n.html.renderButton(`<button class="k-time-cancel" title="Cancel changes" aria-label="Cancel changes">${t.cancel}</button>`,{size:e})+`</div>`,se=`<span class="k-time-highlight"></span>`;U=new Date(U.getFullYear(),U.getMonth(),U.getDate(),0,0,0);var W=function(e){var t=this,n=e.id;t.options=e,t._dates=[],t._createList(e.timeView&&e.timeView.list===`scroll`),n&&(t._timeViewID=n+`_timeview`,t._optionID=n+`_option_selected`,t.ul.attr(N,t._timeViewID)),t._heightHandler=t._height.bind(t),t._popup()};W.prototype={_createList:function(e){e?this._createScrollList():this._createClassicRenderingList()},_createScrollList:function(){var t=e.extend({},this.options,{mainSize:n.getValidCssClass(`k-timeselector-`,`size`,this.options.size),buttonSize:this.options.size});this.popupContent=e(n.template(ae)(t)).on(S,J),this.list=this.popupContent.find(`.k-timeselector`),this.ul=this.list.find(`.k-time-list-container`),this.popupContent.on(`click`+h,`.k-time-header button.k-time-now`,this._nowClickHandler.bind(this)),this.popupContent.on(`click`+h,`.k-time-footer button.k-time-cancel`,this._cancelClickHandler.bind(this)),this.popupContent.on(`click`+h,`.k-time-footer button.k-time-accept`,this._setClickHandler.bind(this)),this.list.on(`mouseover`+h,`.k-time-list-wrapper`,this._mouseOverHandler.bind(this)),this.list.on(`keydown`+h,this._scrollerKeyDownHandler.bind(this))},_scrollerKeyDownHandler:function(t){var i=this,a=t.keyCode,o=e(t.currentTarget).find(`.k-time-list-wrapper.k-focus`),s=i.list.find(`.k-time-list-wrapper`),c=s.length,l=s.index(o),u=n.support.isRtl(i.wrapper),d=$(o.find(`.k-item:visible`).eq(0)),f=o.find(`.k-time-container.k-content.k-scrollable`);o.length&&(a==r.RIGHT&&!u||a==r.LEFT&&u?l+1<c&&i._focusList(s.eq(l+1)):a==r.LEFT&&!u||a==r.RIGHT&&u?l-1>=0&&i._focusList(s.eq(l-1)):a==r.UP?(f.scrollTop(f.scrollTop()-d),t.preventDefault()):a==r.DOWN?(f.scrollTop(f.scrollTop()+d),t.preventDefault()):a===r.ENTER?i._setClickHandler(t):a===r.ESC&&i._cancelClickHandler(t))},_mouseOverHandler:function(t){this._focusList(e(t.currentTarget))},_focusList:function(e){this.list.find(`.k-time-list-wrapper`).removeClass(b),e.addClass(b),this.list.trigger(`focus`),this._scrollTop=e.find(`.k-scrollable`).scrollTop()},_createClassicRenderingList:function(){var t=this,r=e(`<div class="k-list `+n.getValidCssClass(`k-list-`,`size`,t.options.size)+`"><ul tabindex="-1" role="listbox" aria-hidden="true" unselectable="on" class="k-list-ul"/></div>`);t.ul=r.find(`ul`).css({overflow:c.kineticScrollNeeded?``:`auto`}).on(g,y,t._click.bind(t)).on(`mouseenter`+h,y,function(){e(this).addClass(x)}).on(`mouseleave`+h,y,function(){e(this).removeClass(x)}),t.list=e(`<div class='k-list-container k-list-scroller' unselectable='on'/>`).append(r).on(S,J),t.template=e=>`<li tabindex="-1" role="option" class="k-list-item" unselectable="on"><span class="k-list-item-text">${e}</span></li>`},current:function(n){var r=this,i=r.options.active;if(n!==t)r._current&&(r._current.removeClass(T),r._current&&r._current.length&&(r._current[0].removeAttribute(N),r._current[0].removeAttribute(D))),n&&(n=e(n).addClass(T).attr(N,r._optionID).attr(D,!0),r.scroll(n[0])),r._current=n,i&&i(n);else return r._current},_updateTitle:function(){this.list.find(`.k-time-header > .k-title`).html(n.toString(this._value,this.options.format,this.options.culture))},applyValue:function(e){if(e){var t=Z(this.options.format.toLowerCase(),`t`),r=e.getHours(),i=e.getMinutes(),a=e.getSeconds(),o,s=n.attr(`index`),c=this.ul.find(`[`+s+`="1"]`),l=this.ul.find(`[`+s+`="2"]`),u=this.ul.find(`[`+s+`="3"]`),d=this.ul.find(`[`+s+`="4"]`);t&&(r>=12?(o=`PM`,r>12&&(r-=12)):(o=`AM`,r===0&&(r=12))),this._internalScroll=!0,c.length&&this._scrollListToPosition(c,r),l.length&&this._scrollListToPosition(l,i),u.length&&this._scrollListToPosition(u,a),d.length&&this._scrollListToPosition(d,o),this._internalScroll=!1}},_scrollListToPosition:function(e,t){var n=e.find(`.k-item[data-value="`+Q(t)+`"]`),r=$(n);e.scrollTop(e.find(`.k-item:visible`).index(n)*r)},close:function(){this.popup.close()},destroy:function(){var e=this;e.ul.off(h),e.list.off(h),e.popupContent&&e.popupContent.off(h),e.popup&&e.popup.destroy()},open:function(){var e=this,t;(!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(e){for(var t=this,r=t.options,i=r.format,a=n.toString,o=t.template,s=e.length,c=0,l,u=``;c<s;c++)l=e[c],K(l,r.min,r.max)&&(u+=o(a(l,i,r.culture)));t._html(u)},refresh:function(){var e=this,t=e.options,r=t.format,i=ce(),a=i<0,o=de(n.parseDate(e._value)||new Date,t.min),s=t.min,c=t.max,l=G(s),u=G(c),d=G(le(t.interval)),f=t.interval*C,p=n.toString,m=e.template,h=t.useValueToRender?o:new Date(+t.min),g=new I(h),_,v=``;a?(w+i*C)/f:w/f,(l!=u||d===u)&&(l>u&&(u+=w),(u-l)/f+1),t.timeView&&t.timeView.list===`scroll`?v=e._createListContent(he(r)):e.getDatesInRange(_,u,g,c,f,h).forEach(function(e){v+=m(p(e,r,t.culture))}),e._html(v)},_showAllHiddenItems:function(){for(var t=this.list.find(`.k-time-container`),n=t.length,r,i=0;i<n;i++)r=e(t[i]),r.find(`.k-item:hidden`).show(),this._updateListBottomOffset(r)},_updateListBottomOffset:function(e){var t=$(e.find(`.k-item:visible`).eq(0)),n=e.outerHeight()-t;e.find(`.k-scrollable-placeholder`).css({height:e.find(`ul`).height()+n})},_updateHoursRange:function(){var t=this,r=n.attr(`index`),i=this.ul.find(`[`+r+`="1"]`),a=this._minHours,o=this._maxHours,s=Z(this.options.format.toLowerCase(),`t`),c,l,u=this._findSelectedValue(this.ul.find(`[`+r+`="4"]`));i.length&&(s&&u?(u===`AM`?(a<12&&(l=!0),o<12&&(c=!0)):u===`PM`&&(a>12&&(l=!0,a-=12),o>12&&(c=!0,o-=12)),i.find(`.k-item`).each(function(n,r){r=e(r);var i=+r.attr(`data-value`);t._validateMin&&l&&i<a||t._validateMax&&c&&i>o?r.hide():r.show()})):i.find(`.k-item`).each(function(n,r){r=e(r);var i=+r.attr(`data-value`);t._validateMin&&i<a||t._validateMax&&i>o?r.hide():r.show()}),this._updateListBottomOffset(i))},_updateMinutesRange:function(){var t=this,r=n.attr(`index`),i=this.ul.find(`[`+r+`="2"]`),a=this._minHours,o=this._maxHours,s=this._minMinutes,c=this._maxMinutes,l=+this._findSelectedValue(this.ul.find(`[`+r+`="1"]`)),u=Z(this.options.format.toLowerCase(),`t`),d=this._findSelectedValue(this.ul.find(`[`+r+`="4"]`));u&&d===`PM`&&(l+=12),i.length&&(i.find(`.k-item`).each(function(n,r){r=e(r);var i=+r.attr(`data-value`);t._validateMin&&i<s&&a&&l===a||t._validateMax&&i>c&&o&&l===o?r.hide():r.show()}),this._updateListBottomOffset(i))},_updateSecondsRange:function(){var t=this,r=n.attr(`index`),i=this.ul.find(`[`+r+`="3"]`),a=this._minSeconds,o=this._minSeconds,s=this._minMinutes,c=this._maxMinutes,l=+this._findSelectedValue(this.ul.find(`[`+r+`="2"]`));i.length&&(i.find(`.k-item`).each(function(n,r){r=e(r);var i=+r.attr(`data-value`);t._validateMin&&i<a&&s&&l===s||t._validateMax&&i>o&&c&&l===c?r.hide():r.show()}),this._updateListBottomOffset(i))},_updateDesignatorRange:function(){var e=this._minHours,t=this._maxHours,r=n.attr(`index`),i=this.ul.find(`[`+r+`="4"]`);i.length&&(this._validateMin&&e>=12?i.find(`.k-item[data-value="AM"]`).hide():i.find(`.k-item[data-value="AM"]`).show(),this._validateMax&&t<12?i.find(`.k-item[data-value="PM"]`).hide():i.find(`.k-item[data-value="PM"]`).show())},_updateRanges:function(){if(this.options.specifiedRange){this._currentlySelected||=new Date;var e=this.options.endTime?this.options.endTime:this.options.max,t=this.options.startTime?this.options.startTime:this.options.min;if(this.options.validateDate){if(e.getFullYear()===this._currentlySelected.getFullYear()&&e.getMonth()===this._currentlySelected.getMonth()&&e.getDate()===this._currentlySelected.getDate()?this._validateMax=!0:this._validateMax=!1,t.getFullYear()===this._currentlySelected.getFullYear()&&t.getMonth()===this._currentlySelected.getMonth()&&t.getDate()===this._currentlySelected.getDate()?this._validateMin=!0:this._validateMin=!1,!this._validateMax&&!this._validateMin){this._showAllHiddenItems();return}}else this._validateMax=!0,this._validateMin=!0;this._minMinutes=t.getMinutes(),this._maxMinutes=e.getMinutes(),this._minHours=t.getHours(),this._maxHours=e.getHours(),this._minSeconds=t.getSeconds(),this._maxSeconds=e.getSeconds(),this._updateDesignatorRange(),this._updateHoursRange(),this._updateMinutesRange(),this._updateSecondsRange()}},addTranslate:function(){for(var e=this.ul.find(`.k-time-container.k-content.k-scrollable`),t=e.length,n,r,i,a,o,s,c=0;c<t;c++)n=e.eq(c),r=$(n.find(`.k-item:visible`).eq(0)),i=n.outerHeight(),a=(i-r)/2,o=`translateY(`+a+`px)`,s=i-r,n.find(`ul`).css({transform:o,"-ms-transform":o}),n.find(`.k-scrollable-placeholder`).css({height:n.find(`ul`).height()+s}),n.off(h).on(`click`+h,`.k-item`,this._itemClickHandler.bind(this)).on(`scroll`+h,this._listScrollHandler.bind(this))},_nowClickHandler:function(e){e.preventDefault();var t=new Date;this.value(t),this.options.change(n.toString(t,this.options.format,this.options.culture),!0)},_cancelClickHandler:function(e){e.preventDefault(),this.value(this._value),this.popup.close()},_setClickHandler:function(e){e.preventDefault(),this._value=new Date(this._currentlySelected),this.options.change(n.toString(this._currentlySelected,this.options.format,this.options.culture),!0),this.popup.close()},_listScrollHandler:function(t){var n=this,r=$(e(t.currentTarget).find(`.k-item:visible`).eq(0));n._internalScroll||(n._scrollingTimeout&&clearTimeout(n._scrollingTimeout),n._scrollingTimeout=setTimeout(function(){t.currentTarget.scrollTop%r>1&&(t.currentTarget.scrollTop+=r-t.currentTarget.scrollTop%r),n._scrollTop=t.currentTarget.scrollTop,n._updateCurrentlySelected(),n._updateRanges()},100))},_updateCurrentlySelected:function(){var e=Z(this.options.format.toLowerCase(),`t`),r=n.attr(`index`),i=this.ul.find(`[`+r+`="1"]`),a=this.ul.find(`[`+r+`="2"]`),o=this.ul.find(`[`+r+`="3"]`),s=this.ul.find(`[`+r+`="4"]`),c,l,u,d;this.ul.is(`:visible`)&&(this._currentlySelected||=this._value?new Date(this._value):new Date,i.length&&(c=+this._findSelectedValue(i)),a.length&&(l=+this._findSelectedValue(a)),o.length&&(u=+this._findSelectedValue(o)),s.length&&(d=this._findSelectedValue(s)),e&&(d==`PM`&&(c+=12,c==24&&(c=12)),d===`AM`&&c===12&&(c=0)),c!==t&&this._currentlySelected.setHours(c),l!==t&&this._currentlySelected.setMinutes(l),u!==t&&this._currentlySelected.setSeconds(u))},_findSelectedValue:function(e){var t=ge(e.scrollTop(),$(e.find(`.k-item:visible`).eq(0)));return e.find(`.k-item:visible`).eq(t).attr(`data-value`)},_itemClickHandler:function(t){var n=e(t.originalEvent.currentTarget),r=n.find(`.k-item:visible`).index(e(t.currentTarget)),i=$(n.find(`.k-item:visible`).eq(0));n.scrollTop(r*i)},getDatesInRange:function(e,t,n,r,i,a){for(var o=[];;){if(t&&(G(a)>=t||n.getDate()!=a.getDate())){e=G(a),n<a&&(e+=w),e>t&&(a=new I(+r)),G(a)>0&&o.push(new Date(a));break}if(n.getDate()!=a.getDate()||(o.push(new Date(a)),a.setTime(a.getTime()+i),!t&&this.options.maxSet))break}return o},_createListContent:function(e){for(var t=e.length,n=``,r,i,a=0;a<t;a++)r=e[a],r.type===`literal`?n+=this._literalTemplate(r):(i=this._getValues(r,!0),n+=this._itemTemplate(i.values,r,this.options.messages[r.type],i.index));return n},_itemTemplate:function(e,t,r,i){var a=``,o=e.length,s=n.attr(`index`);a+=`<div class="k-time-list-wrapper" role="presentation"><span class="k-title">`+(r||t.type)+`</span><div class="k-time-list"><div class="k-time-container k-content k-scrollable" role="presentation" `+s+`="`+i+`"><ul class="k-reset">`;for(var c=0;c<o;c++)a+=`<li class="k-item" data-value="`+e[c]+`"><span>`+e[c]+`</span></li>`;return a+=`</ul><div class="k-scrollable-placeholder"></div></div></div></div>`,a},_getValues:function(e,t){var n=[],r,i=0,a;for(e.type===`hour`?(i=e.hour12?1:0,r=1,a=e.hour12?12:23):e.type===`minute`?(r=2,a=59):e.type===`second`&&(r=3,a=59);i<=a;i++)n.push(t?Q(i):i);return{values:n,index:r}},_literalTemplate:function(e){var t=`<div class="k-time-separator">`+(e.pattern===` tt`?`:`:e.pattern)+`</div>`;return e.pattern===` tt`&&(t+=this._itemTemplate([`AM`,`PM`],e,`AM/PM`,4)),t},bind:function(){var e=this,t=e.options.dates;t&&t[0]?e.dataBind(t):e.refresh()},_html:function(e){var t=this;t.options.timeView&&t.options.timeView.list===`scroll`?(e=se+e,t.ul.html(e)):(t.ul[0].innerHTML=e,t.popup.unbind(f,t._heightHandler),t.popup.one(f,t._heightHandler),t.current(null),t.select(t._value))},scroll:function(e){e&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded():_e(e))},select:function(t){var r=this,i=r.options,a=r._current,o;t instanceof Date&&(t=n.toString(t,i.format,i.culture)),typeof t==`string`&&(!a||a.text()!==t?(t=e.grep(r.ul[0].childNodes,function(e){return(e.textContent||e.innerText)==t}),t=t[0]?t:null):t=a),o=r._distinctSelection(t),r.current(o)},_distinctSelection:function(t){var n=this,r,i;return t&&t.length>1&&(r=G(n._value),i=e.inArray(r,n._dates),t=n.ul.children()[i]),t},setOptions:function(e){var t=this.options;e.min=a(e.min),e.max=a(e.max),this.options=F(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.options.timeView&&t.options.timeView.list===`scroll`?t.applyValue(e):t.select(e))},_click:function(t){var n=this,r=e(t.currentTarget),i=r.text(),a=n.options.dates;a&&a.length>0&&(i=a[r.index()]),t.isDefaultPrevented()||(n.select(r),n.options.change(i,!0),n.close())},_height:function(){var e=this,t=e.list,n=t.closest(`.k-child-animation-container`),r=t.closest(`.k-animation-container`),i=e.options.height,a=t.add(r),o=e.ul[0];o.children.length&&(a.add(n).show(),t.add(n).height(o.scrollHeight>i?i:`auto`),a.hide())},_parse:function(e){var t=this,n=t.options,r=G(n.min)==G(U)?null:n.min,i=G(n.max)==G(U)?null:n.max,o=t._value||r||i||U;return e instanceof I?e:(e=a(e,n.parseFormats,n.culture),e&&=new I(o.getFullYear(),o.getMonth(),o.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),e)},_adjustListWidth:function(){var e=this.list,t=e[0].style.width,r=this.options.anchor,i,a,o=n._outerWidth;!e.data(`width`)&&t||(i=window.getComputedStyle?window.getComputedStyle(r[0],null):0,a=i?parseFloat(i.width):o(r),i&&(l.mozilla||l.msie)&&(a+=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth)),t=a-(o(e)-e.width()),e.css({fontFamily:r.css(`font-family`),width:t}).data(`width`,t))},_popup:function(){var e=this,t=e.list,n=e.options,r=n.anchor;this.options.omitPopup?t.appendTo(n.timeDiv):e.popup=new u.Popup(e.popupContent||t,F(n.popup,{anchor:r,open:n.open,close:n.close,animation:n.animation,isRtl:c.isRtl(n.anchor),activate:function(){e.options.timeView&&e.options.timeView.list===`scroll`&&(e.addTranslate(),e._value?e.applyValue(e._value):e._updateCurrentlySelected(),e._updateRanges(),e._focusList(e.list.find(`.k-time-list-wrapper`).eq(0)))}}))},move:function(e){var t=this,n=e.keyCode,i=t.ul[0],a=t._current,o=n===r.DOWN;if(n===r.UP||o){if(e.altKey){t.toggle(o);return}else a=o?a?a[0].nextSibling:i.firstChild:a?a[0].previousSibling:i.lastChild;a&&t.select(a),t.options.change(t._current.text()),e.preventDefault()}else (n===r.ENTER||n===r.TAB||n===r.ESC)&&(e.preventDefault(),a&&t.options.change(a.text(),!0),t.close())}};function ce(){var e=new I,t=new I(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),n=new I(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);return-1*(t.getTimezoneOffset()-n.getTimezoneOffset())}function G(e){return e.getHours()*60*C+e.getMinutes()*C+e.getSeconds()*1e3+e.getMilliseconds()}function le(e){var t=new Date(2100,0,1);return t.setMinutes(-e),t}function K(e,t,n){var r=G(t),i=G(n),a;return!e||r==i?!0:(a=G(e),r>a&&(a+=w),i<r&&(i+=w),a>=r&&a<=i)}W.getMilliseconds=G,n.TimeView=W;var ue=d.extend({init:function(t,r){var i=this,o,s,c;r||={},r.componentType=r.componentType||`classic`,d.fn.init.call(i,t,r),t=i.element,r=i.options,r.min=a(t.attr(`min`))||a(r.min),r.max=a(t.attr(`max`))||a(r.max),(+r.max!=+U||+r.min!=+U)&&(this._specifiedRange=!0),q(r),i._initialOptions=F({},r),i._wrapper(),i.options.timeView&&i.options.timeView.list===`scroll`&&(i.options.height=null),i.timeView=s=new W(F({},r,{id:t.attr(N),anchor:i.wrapper,format:r.format,change:function(e,n){n?i._change(e):t.val(e)},open:function(e){i.options.timeView&&i.options.timeView.list!==`scroll`?i.timeView._adjustListWidth():i.timeView._updateTitle(),i.trigger(f)?e.preventDefault():(t.attr(O,!0),o.attr(k,!1),s.current()&&t.attr(M,s._optionID))},close:function(e){i.trigger(p)?e.preventDefault():(t.attr(O,!1),o.attr(k,!0),t[0].removeAttribute(M))},active:function(e){t&&t.length&&t[0].removeAttribute(M),e&&t.attr(M,s._optionID)},specifiedRange:i._specifiedRange,maxSet:+r.max!=+U})),o=s.ul,i._ariaLabel(o),i._icon(),i._reset();try{t[0].setAttribute(`type`,`text`)}catch{t[0].type=`text`}if(t.addClass(`k-input-inner`).attr({role:`combobox`,"aria-expanded":!1,"aria-controls":s._timeViewID,autocomplete:`off`}),c=t.is(`[disabled]`)||e(i.element).parents(`fieldset`).is(`:disabled`),c?i.enable(!1):i.readonly(t.is(`[readonly]`)),r.dateInput){var l=r.min,m=r.max,h=new I;G(l)==G(m)&&(l=new I(h.getFullYear(),h.getMonth(),h.getDate(),0,0,0),m=new I(h.getFullYear(),h.getMonth(),h.getDate(),24,0,0)),i._dateInput=new u.DateInput(t,{culture:r.culture,format:r.format,min:l,max:m,value:r.value,interval:r.interval,size:r.size,fillMode:r.fillMode,rounded:r.rounded,messages:r.messages.dateInput})}i._old=i._update(r.value||i.element.val()),i._oldText=t.val(),i._applyCssClasses(),r.label&&i._label(),n.notify(i)},options:{name:`TimePicker`,min:U,max:U,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`,size:`medium`,fillMode:`solid`,rounded:`medium`,label:null},events:[f,p,m],componentTypes:{classic:{timeView:{list:`list`}},modern:{timeView:{list:`scroll`}}},setOptions:function(e){var t=this,r=t._value;d.fn.setOptions.call(t,e),e=t.options,(+e.max!=+U||+e.min!=+U)&&(this._specifiedRange=!0),t._arrow.off(h),t._arrow.remove(),q(e),t.timeView.setOptions(e),t._icon(),t._editable(e),r&&t.element.val(n.toString(r,e.format,e.culture)),e.label&&t._inputLabel?t.label.setOptions(e.label):e.label===!1?(t.label._unwrapFloating(),t._inputLabel.remove(),delete t._inputLabel):e.label&&t._label()},dataBind:function(e){P(e)&&this.timeView.dataBind(e)},_editable:function(e){var t=this,n=e.disable,r=e.readonly,i=t._arrow.off(h),a=t.element.off(h),o=t.wrapper.off(h);t._dateInput&&t._dateInput._unbindInput(),!r&&!n?(o.removeClass(E).on(te,t._toggleHover),a&&a.length&&(a[0].removeAttribute(_),a[0].removeAttribute(v)),a.attr(A,!1).attr(j,!1).on(`keydown`+h,t._keydown.bind(t)).on(`focusout`+h,t._blur.bind(t)).on(`focus`+h,function(){t.wrapper.addClass(b)}),t._dateInput&&t._dateInput._bindInput(),i.on(g,t._click.bind(t)).on(S,J)):(o.addClass(n?E:``).removeClass(n?``:E),a.attr(_,n).attr(v,r).attr(A,n).attr(j,r))},_label:function(){var t=this,r=t.options,i=e.isPlainObject(r.label)?r.label:{content:r.label};t._dateInput&&(i.floatCheck=()=>(t._dateInput._toggleDateMask(!0),!t.value()&&!t._dateInput._hasDateInput()&&document.activeElement!==t.element[0]?(t._dateInput._toggleDateMask(!1),!0):!1)),t.label=new n.ui.Label(null,e.extend({},i,{widget:t})),t._inputLabel=t.label.element},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1}),this.label&&this.label.floatingLabel&&this.label.floatingLabel.readonly(e===t?!0:e)},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)}),this.label&&this.label.floatingLabel&&this.label.floatingLabel.enable(e=e===t?!0:e)},destroy:function(){var e=this;d.fn.destroy.call(e),e.timeView.destroy(),e.element.off(h),e._arrow.off(h),e.wrapper.off(h),e._form&&e._form.off(`reset`,e._resetHandler),e.label&&e.label.destroy()},close:function(){this.timeView.close()},open:function(){this.timeView.open()},min:function(e){return e&&(this._specifiedRange=!0),this._option(`min`,e)},max:function(e){return e&&this.timeView?(this._specifiedRange=!0,this.timeView.options.maxSet=!0):this.timeView&&(this.timeView.options.maxSet=!1),this._option(`max`,e)},value:function(e){var n=this;if(e===t)return n._value;n._old=n._update(e),n._old===null&&n.element.val(``),n._oldText=n.element.val(),n.label&&n.label.floatingLabel&&n.label.floatingLabel.refresh()},_blur:function(){var e=this,t=e.element.val();e.options.timeView&&e.options.timeView.list===`scroll`||e.close(),t!==e._oldText&&e._change(t),e.wrapper.removeClass(b)},_click:function(){var e=this,t=e.element;e.timeView.toggle(),!c.touch&&t[0]!==o()&&t.trigger(`focus`)},_change:function(e){var t=this,r=t.element.val(),i;e=t._update(e),i=!n.calendar.isEqualDate(t._old,e);var a=i&&!t._typing,o=r!==t.element.val();(a||o)&&t.element.trigger(m),i&&(t._old=e,t._oldText=t.element.val(),t.trigger(m)),t._typing=!1},_icon:function(){var t=this,n=t.element,r=t.options,a=n.next(`button.k-input-button`);a[0]||(a=e(i.renderButton(`<button unselectable="on" tabindex="-1" class="k-input-button" aria-label="select"></button>`,{icon:`clock`,size:r.size,fillMode:r.fillMode,shape:`none`})).insertAfter(n)),t._arrow=a.attr({role:`button`})},_keydown:function(e){var t=this,n=e.keyCode,i=t.timeView,a=t.element.val();i.popup.visible()||e.altKey?(i.move(e),t._dateInput&&e.stopImmediatePropagation&&e.stopImmediatePropagation()):n===r.ENTER&&a!==t._oldText?t._change(a):t._typing=!0},_option:function(e,n){var r=this,i=r.options;if(n===t)return i[e];n=r.timeView._parse(n),n&&(n=new I(+n),i[e]=n,r.timeView.options[e]=n,r.timeView.bind())},_toggleHover:function(t){e(t.currentTarget).toggleClass(x,t.type===`mouseenter`)},_update:function(e){var t=this,r=t.options,i=t.timeView,a=i._parse(e);return K(a,r.min,r.max)||(a=null),t._value=a,t._currentlySelected=a,t._dateInput&&a?t._dateInput.value(a||e):t.element.val(n.toString(a||e,r.format,r.culture)),i.value(a),a},_wrapper:function(){var e=this,t=e.element,n=t.parents(`.k-timepicker`);n[0]||(n=t.wrap(ee).parent()),n[0].style.cssText=t[0].style.cssText,e.wrapper=n.addClass(`k-timepicker k-input`).addClass(t[0].className),t.css({height:t[0].style.height})},_reset:function(){var t=this,n=t.element,r=n.attr(`form`),i=r?e(`#`+r):n.closest(`form`);i[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue),t.max(t._initialOptions.max),t.min(t._initialOptions.min)},t._form=i.on(`reset`,t._resetHandler))}});function q(e){var t=e.parseFormats;e.format=s(e.format||n.getCulture(e.culture).calendars.standard.patterns.t),t=P(t)?t:[t],t.splice(0,0,e.format),e.parseFormats=t}function J(e){e.preventDefault()}function de(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())}function fe(e,t){var n=t.calendar,r;return typeof e==`string`&&(r=n.patterns[e]?n.patterns[e]:e),r||=n.patterns.d,r}function Y(e,t){var n=e[e.length-1];n&&n.type===`LITERAL`?n.pattern+=t:e.push({type:ne,pattern:t})}function pe(e){return e===`h`||e===`K`}function me(e){var t;return e<=3?t=`abbreviated`:e===4?t=`wide`:e===5?t=`narrow`:e===6&&(t=`short`),t}function X(e,t,n){return n||=0,e.indexOf(t,n)===n}function Z(e,t){var n=!1;return e.indexOf(t)!==-1&&(n=!0),n}function he(e){for(var t=fe(e,n.culture()),r=[],i=L.lastIndex=0,a=L.exec(t),o,s,c,l,u,d;a;){var f=a[0];i<a.index&&Y(r,t.substring(i,a.index)),X(f,`"`)||X(f,`'`)?Y(r,f):(o=f[0],s=re[o],c={type:s,pattern:f},s===`hour`&&(c.hour12=pe(f)),l=ie[s],l&&(u=typeof l.minLength==`number`?l.minLength:l.minLength[o],d=f.length,d>=u&&(c.names={type:l.type,nameType:me(d),standAlone:l.standAlone===o})),r.push(c)),i=L.lastIndex,a=L.exec(t)}return i<t.length&&Y(r,t.substring(i)),r}function Q(e,t){for(var n=String(e);n.length<(t||2);)n=`0`+n;return n}function ge(e,t){return Math.max(Math.round(e/t),0)}function $(e){return e.length&&e[0].getBoundingClientRect().height}function _e(e,t){function n(e,t){return{start:e,length:t,end:e+t}}function r(e,n){return t===!1||n.start<e.end&&e.start<n.end?Math.min(e.start,Math.max(n.start,e.end-n.length)):(e.start+e.end-n.length)/2}function i(e,t){return{x:e,y:t,translate:function(n,r){return i(e+n,t+r)}}}function a(e,t){for(;e;)t=t.translate(e.offsetLeft,e.offsetTop),e=e.offsetParent;return t}for(var o=a(e,i(0,0)),s=i(e.offsetWidth,e.offsetHeight),c=e.parentNode,l;c instanceof HTMLElement;)l=a(c,i(c.clientLeft,c.clientTop)),c.scrollLeft=r(n(o.x-l.x,s.x),n(c.scrollLeft,c.clientWidth)),c.scrollTop=r(n(o.y-l.y,s.y),n(c.scrollTop,c.clientHeight)),o=o.translate(-c.scrollLeft,-c.scrollTop),c=c.parentNode}n.cssProperties.registerPrefix(`TimePicker`,`k-input-`),n.cssProperties.registerValues(`TimePicker`,[{prop:`rounded`,values:n.cssProperties.roundedValues.concat([[`full`,`full`]])}]),u.plugin(ue)})(window.kendo.jQuery);
//# sourceMappingURL=kendo.timepicker.js.map