mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-03 01:01:41 +00:00
27 lines
19 KiB
JavaScript
Executable File
27 lines
19 KiB
JavaScript
Executable File
/**
|
|
* Kendo UI v2021.1.224 (http://www.telerik.com/kendo-ui)
|
|
* Copyright 2021 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.datetimepicker.min",["kendo.datepicker.min","kendo.timepicker.min"],e)}(function(){return function(e,t){function a(e){var t=new Date(2100,0,1);return t.setMinutes(-e),t}function i(e){e.preventDefault()}function n(t){var a,i=o.getCulture(t.culture).calendars.standard.patterns,n=!t.parseFormats.length;t.format=u(t.format||i.g),t.timeFormat=a=u(t.timeFormat||i.t),o.DateView.normalize(t),n&&t.parseFormats.unshift("yyyy-MM-ddTHH:mm:ss"),e.inArray(a,t.parseFormats)===-1&&t.parseFormats.push(a)}var o=window.kendo,s=o.TimeView,l=o.parseDate,r=o.support,p=o._activeElement,u=o._extractFormat,m=o.calendar,d=m.isInRange,c=m.restrictValue,_=m.isEqualDatePart,v=s.getMilliseconds,g=o.ui,f=g.Widget,h="open",w="close",k="change",V=".kendoDateTimePicker",b="click"+V,y=r.mouseAndTouchPresent?o.applyEventMap("up",V.slice(1)):b,x="disabled",T="readonly",D="k-state-default",I="k-state-focused",C="k-state-hover",A="k-state-disabled",P="mouseenter"+V+" mouseleave"+V,S="mousedown"+V,F="month",R="<span/>",H="aria-activedescendant",M="aria-expanded",O="aria-hidden",E="aria-owns",W="aria-disabled",B="aria-readonly",q=Date,N=new q(1800,0,1),Y=new q(2099,11,31),j={view:"date"},z={view:"time"},K=e.extend,L='<div class="k-date-tab k-datetime-wrap"><div class="k-datetime-buttongroup"><div class="k-button-group k-button-group-stretched"><button class="k-button k-state-active k-group-start">#=messages.date#</button><button class="k-button k-group-end">#=messages.time#</button></div></div><div class="k-datetime-selector"><div class="k-datetime-calendar-wrap"></div><div class="k-datetime-time-wrap"></div></div><div class="k-datetime-footer k-action-buttons"><button class="k-button k-time-cancel" title="Cancel" aria-label="Cancel">#=messages.cancel#</button><button class="k-time-accept k-button k-primary" title="Set" aria-label="Set">#=messages.set#</button></div></div>',Q="k-state-active",G=f.extend({init:function(t,a){var i,s=this;a=a||{},a.componentType=a.componentType||"classic",f.fn.init.call(s,t,a),t=s.element,a=s.options,a.disableDates=o.calendar.disabled(a.disableDates),a.min=l(t.attr("min"))||l(a.min),a.max=l(t.attr("max"))||l(a.max),+a.max==+Y&&+a.min==+N||(this._specifiedRange=!0),n(a),s._initialOptions=K({},a),s._wrapper(),a.singlePopup&&s._popup(),s._views(),s._icons(),s._reset(),s._template();try{t[0].setAttribute("type","text")}catch(r){t[0].type="text"}t.addClass("k-input").attr({role:"combobox","aria-expanded":!1,autocomplete:"off"}),s._midnight=s._calculateMidnight(a.min,a.max),i=t.is("[disabled]")||e(s.element).parents("fieldset").is(":disabled"),i?s.enable(!1):s.readonly(t.is("[readonly]")),s._createDateInput(a),s._old=s._update(a.value||s.element.val()),s._oldText=t.val(),o.notify(s)},options:{name:"DateTimePicker",value:null,format:"",timeFormat:"",culture:"",parseFormats:[],dates:[],disableDates:null,min:new q(N),max:new q(Y),interval:30,height:200,footer:"",start:F,depth:F,animation:{},month:{},ARIATemplate:'Current focused date is #=kendo.toString(data.current, "d")#',dateButtonText:"Open the date view",timeButtonText:"Open the time view",dateInput:!1,weekNumber:!1,messages:{set:"Set",cancel:"Cancel",hour:"hour",minute:"minute",second:"second",millisecond:"millisecond",now:"Now",date:"Date",time:"Time",today:"Today"},componentType:"classic"},events:[h,w,k],componentTypes:{classic:{singlePopup:!1,timeView:{list:"list"}},modern:{singlePopup:!0,timeView:{list:"scroll"}}},setOptions:function(e){var t,a,i,s=this,r=s._value;f.fn.setOptions.call(s,e),e=s.options,e.min=t=l(e.min),e.max=a=l(e.max),n(e),s._midnight=s._calculateMidnight(e.min,e.max),i=e.value||s._value||s.dateView._current,t&&!_(t,i)&&(t=new q(N)),a&&!_(a,i)&&(a=new q(Y)),s.dateView.setOptions(e),s.timeView.setOptions(K({},e,{format:e.timeFormat,min:t,max:a})),s._createDateInput(e),s._dateInput||s.element.val(o.toString(r,e.format,e.culture)),r&&s._updateARIA(r)},_editable:function(t){var a=this,n=a.element.off(V),s=a._dateIcon.off(V),l=a._timeIcon.off(V),r=a._inputWrapper.off(V),p=t.readonly,u=t.disable;p||u?(r.addClass(u?A:D).removeClass(u?D:A),n.attr(x,u).attr(T,p).attr(W,u).attr(B,p)):(r.addClass(D).removeClass(A).on(P,a._toggleHover),n&&n.length&&(n[0].removeAttribute(x),n[0].removeAttribute(T,!1),n[0].removeAttribute(W,!1),n[0].removeAttribute(B,!1)),n.on("keydown"+V,e.proxy(a._keydown,a)).on("focus"+V,function(){a._inputWrapper.addClass(I)}).on("focusout"+V,function(){a._inputWrapper.removeClass(I),n.val()!==a._oldText&&(a._change(n.val()),n.val()||a.dateView.current(o.calendar.getToday())),a.options.singlePopup||(a.close("date"),a.close("time"))}),s.on(S,i).on(y,function(e){a.toggle("date"),a._focusElement(e.type)}),l.on(S,i).on(y,function(e){a.toggle("time"),a._focusElement(e.type)}))},_focusElement:function(e){var t=this.element;r.touch&&(!r.mouseAndTouchPresent||(e||"").match(/touch/i))||t[0]===p()||t.trigger("focus")},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;f.fn.destroy.call(e),e.dateView.destroy(),e.timeView.destroy(),e.options.singlePopup&&(e.popup.element.off(V),e.popup.destroy()),e.element.off(V),e._dateIcon.off(V),e._timeIcon.off(V),e._inputWrapper.off(V),e._form&&e._form.off("reset",e._resetHandler)},close:function(e){this.options.singlePopup?this.popup.close():("time"!==e&&(e="date"),this[e+"View"].close())},open:function(e){var t,a=this;a.options.singlePopup?(a.dateView._calendar(),a.timeView.ul.find("li").length<1&&a.timeView.bind(),t=a.popup._hovered,a.popup._hovered=!0,a.popup.open(),"time"===e?a._switchToTimeView():a._switchToDateView(),this._dateIcon.toggle("time"!==e),this._timeIcon.toggle("time"===e),setTimeout(function(){a.popup._hovered=t},1)):("time"!==e&&(e="date"),this[e+"View"].open())},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},toggle:function(e){if(this.options.singlePopup)this.popup.visible()?this.close():this.open(e);else{var t="timeView";"time"!==e?e="date":t="dateView",this[e+"View"].toggle(),this[t].close()}},value:function(e){var a=this;return e===t?a._value:(a._old=a._update(e),null===a._old&&a.element.val(""),a._oldText=a.element.val(),t)},_change:function(e){var t,a,i,n=this,o=n.element.val();e=n._update(e),t=+n._old!=+e,a=t&&!n._typing,i=o!==n.element.val(),(a||i)&&n.element.trigger(k),t&&(n._old=e,n._oldText=n.element.val(),n.trigger(k)),n._typing=!1},_option:function(e,i){var n,o,s=this,r=s.options,p=s.timeView,u=p.options,m=s._value||s._old;if(i===t)return r[e];if(i=l(i,r.parseFormats,r.culture),u.maxSet=!1,i){if(r.min.getTime()===r.max.getTime()&&(u.dates=[]),r[e]=new q(i.getTime()),s.dateView[e](i),s._midnight=s._calculateMidnight(r.min,r.max),m&&(n=_(r.min,m),o=_(r.max,m)),n||o){if(u[e]=i,n&&!o&&(u.max=a(r.interval)),o){if(s._midnight)return p.dataBind([Y]),t;n||(u.min=N,u.maxSet=!0)}}else u.max=Y,u.min=N;p.bind()}},_toggleHover:function(t){e(t.currentTarget).toggleClass(C,"mouseenter"===t.type)},_update:function(t){var i,n,s,r,p,u=this,m=u.options,v=m.min,g=m.max,f=m.dates,h=u.timeView,w=u._value,V=l(t,m.parseFormats,m.culture),b=null===V&&null===w||V instanceof Date&&w instanceof Date;return m.disableDates&&m.disableDates(V)&&(V=null,u._old||u.element.val()||(t=null)),+V===+w&&b?(p=o.toString(V,m.format,m.culture),p!==t&&(u.element.val(null===V?t:p),t instanceof String&&u.element.trigger(k)),V):(null!==V&&_(V,v)?V=c(V,v,g):d(V,v,g)||(V=null),u._value=V,h.value(V),u.dateView.value(V),V&&(s=u._old,n=h.options,n.maxSet=!1,f[0]&&(f=e.grep(f,function(e){return _(V,e)}),f[0]&&(h.dataBind(f),r=!0)),r||(_(V,v)&&(n.min=v,n.max=a(m.interval),i=!0),_(V,g)&&(u._midnight?(h.dataBind([Y]),r=!0):(n.max=g,n.maxSet=!0,i||(n.min=N),i=!0))),!r&&(!s&&i||s&&!_(s,V))&&(i||(n.max=Y,n.min=N),h.bind())),u._dateInput&&V?u._dateInput.value(V||t):u.element.val(o.toString(V||t,m.format,m.culture)),u._updateARIA(V),V)},_keydown:function(e){var t=this,a=t.dateView,i=t.timeView,n=t.element.val(),s=t.options.singlePopup?t.popup.visible():a.popup.visible(),l=t._dateInput&&e.stopImmediatePropagation;e.altKey&&e.keyCode===o.keys.DOWN?t.toggle(s?"time":"date"):s?(a.move(e),t._updateARIA(a._current)):!t.options.singlePopup&&i.popup.visible()?i.move(e):e.keyCode===o.keys.ENTER&&n!==t._oldText?t._change(n):(t._typing=!0,l=!1),l&&e.stopImmediatePropagation()},_views:function(){var e,t,a,i,n,r,p,u,m,d=this,c=d.element,_=d.options,v=c.attr("id");_.singlePopup&&(_.dateDiv=d.popup.element.find(".k-datetime-calendar-wrap"),p=d.popup.element.find(".k-datetime-time-wrap"),_.omitPopup=u=!0,m=_.timeView),d.dateView=e=new o.DateView(K({},_,{id:v,anchor:d.wrapper,change:function(){var e=d._applyDateValue();_.singlePopup?(d.timeView._currentlySelected||(d.timeView._currentlySelected=new Date),d.timeView._currentlySelected.setFullYear(e.getFullYear()),d.timeView._currentlySelected.setMonth(e.getMonth()),d.timeView._currentlySelected.setDate(e.getDate()),d._switchToTimeView(),d._toggleIcons()):(d._change(e),d.close("date"))},close:function(e){d.trigger(w,j)?e.preventDefault():(c.attr(M,!1),a.attr(O,!0),d.options.singlePopup||t.popup.visible()||c&&c.length&&c[0].removeAttribute(E))},open:function(t){d.trigger(h,j)?t.preventDefault():(c.val()!==d._oldText&&(r=l(c.val(),_.parseFormats,_.culture),d.dateView[r?"current":"value"](r)),a.attr(O,!1),c.attr(M,!0).attr(E,e._dateViewID),d._updateARIA(r))}})),a=e.div,n=_.min.getTime(),d.timeView=t=new s({id:v,value:_.value,anchor:d.wrapper,animation:_.animation,format:_.timeFormat,culture:_.culture,height:"modern"===_.componentType?null:_.height,interval:_.interval,min:"modern"===_.componentType?_.min:new q(N),max:"modern"===_.componentType?_.max:new q(Y),dates:n===_.max.getTime()?[new Date(n)]:[],parseFormats:_.parseFormats,validateDate:!0,change:function(t,a){t=d._applyTimeValue(t),a?(d._timeSelected=!0,d._change(t)):(c.val(o.toString(t,_.format,_.culture)),e.value(t),d._updateARIA(t))},close:function(t){d.trigger(w,z)?t.preventDefault():(i.attr(O,!0),c.attr(M,!1),e.popup.visible()||c&&c.length&&c[0].removeAttribute(E))},open:function(e){"modern"!==d.options.componentType?t._adjustListWidth():d.timeView._updateTitle(),d.trigger(h,z)?e.preventDefault():(c.val()!==d._oldText&&(r=l(c.val(),_.parseFormats,_.culture),d.timeView.value(r)),i.attr(O,!1),c.attr(M,!0).attr(E,t._timeViewID),t.options.active(t.current()))},active:function(e){c&&c.length&&c[0].removeAttribute(H),e&&c.attr(H,t._optionID)},popup:_.popup,useValueToRender:!0,specifiedRange:d._specifiedRange,omitPopup:u,timeDiv:p,timeView:m,messages:d.options.messages}),i=t.ul},_applyDateValue:function(){var e,t,a=this,i=a.options,n=a.dateView,s=n.calendar.value(),l=+s,r=+i.min,p=+i.max;return l!==r&&l!==p||(e=l===r?r:p,e=new q(a._value||e),e.setFullYear(s.getFullYear(),s.getMonth(),s.getDate()),d(e,r,p)&&(s=e)),a._value&&(t=o.date.setHours(new Date(s),a._value),d(t,r,p)&&(s=t)),s},_applyTimeValue:function(e){var t=this.timeView,a=this.options;return e=t._parse(e),e<a.min?(e=new q((+a.min)),t.options.min=e):e>a.max&&(e=new q((+a.max)),t.options.max=e),e},_icons:function(){var t=this,a=t.element,i=t.options,n=a.next("span.k-select");n[0]||(n=e('<span unselectable="on" class="k-select"><span class="k-link k-link-date" aria-label="'+i.dateButtonText+'"><span unselectable="on" class="k-icon k-i-calendar"></span></span><span class="k-link k-link-time" aria-label="'+i.timeButtonText+'"><span unselectable="on" class="k-icon k-i-clock"></span></span></span>').insertAfter(a)),n=n.children(),t._dateIcon=n.eq(0).attr("aria-controls",t.dateView._dateViewID),t._timeIcon=n.eq(1).attr("aria-controls",t.timeView._timeViewID),i.singlePopup&&t._timeIcon.hide()},_wrapper:function(){var t,a=this,i=a.element;t=i.parents(".k-datetimepicker"),t[0]||(t=i.wrap(R).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(R).parent()),t[0].style.cssText=i[0].style.cssText,i.css({width:"100%",height:i[0].style.height}),a.wrapper=t.addClass("k-widget k-datetimepicker").addClass(i[0].className).removeClass("input-validation-error"),a._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,a=t.element,i=a.attr("form"),n=i?e("#"+i):a.closest("form"),s=t.options,l=s.disableDates,r=s.parseFormats.length?s.parseFormats:null,p=t._initialOptions.value,u=a[0].defaultValue;p&&l&&l(p)&&(p=null),u&&o.parseDate(u,r,s.culture)||!p||a.attr("value",o.toString(p,s.format,s.culture)),n[0]&&(t._resetHandler=function(){t.value(p||a[0].defaultValue),t.max(t._initialOptions.max),t.min(t._initialOptions.min)},t._form=n.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=o.template(this.options.ARIATemplate)},_createDateInput:function(e){this._dateInput&&(this._dateInput.destroy(),this._dateInput=null),e.dateInput&&(this._dateInput=new g.DateInput(this.element,{culture:e.culture,format:e.format,min:e.min,max:e.max,interval:e.interval}))},_calculateMidnight:function(e,t){return v(e)+v(t)===0},_updateARIA:function(e){var t,a=this,i=a.dateView.calendar;a.element&&a.element.length&&a.element[0].removeAttribute(H),i&&(t=i._cell,t.attr("aria-label",a._ariaTemplate({current:e||i.current()})),a.element.attr(H,t.attr("id")))},_popup:function(){var t=this,a=t.options,i=e("<div></div>").attr(O,"true").addClass("k-datetime-container k-group k-reset").appendTo(document.body);i.append(o.template(L)(t.options)),t.popup=new g.Popup(i,K(a.popup,a,{name:"Popup",isRtl:o.support.isRtl(t.wrapper),anchor:t.wrapper,activate:function(){t.options.timeView&&"scroll"===t.options.timeView.list&&(t.timeView.addTranslate(),t.timeView.applyValue(t._value),t.timeView._updateRanges())},open:function(e){t.trigger(h,{view:this.element.find(".k-date-tab").length?"date":"time",sender:t})&&e.preventDefault(),t.timeView._updateTitle()}})),i.on(b+V,".k-datetime-buttongroup .k-button",e.proxy(t._groupChangeClick,t)),i.on(b+V,".k-datetime-footer button.k-time-cancel",e.proxy(t._cancelClickHandler,t)),i.on(b+V,".k-datetime-footer button.k-time-accept",e.proxy(t._setClickHandler,t))},_groupChangeClick:function(t){var a,n;i(t),a=e(t.currentTarget),n=a.index(),n?this._switchToTimeView():this._switchToDateView(),this._toggleIcons()},_switchToDateView:function(){this.popup.element.find(".k-group-start, .k-group-end").removeClass(Q).eq(0).addClass(Q),this.popup.element.find(".k-datetime-wrap").removeClass("k-time-tab").addClass("k-date-tab")},_switchToTimeView:function(){this.timeView.addTranslate(),this.timeView.applyValue(this._value),this.timeView._updateRanges(),this.popup.element.find(".k-group-start, .k-group-end").removeClass(Q).eq(1).addClass(Q),this.popup.element.find(".k-datetime-wrap").removeClass("k-date-tab").addClass("k-time-tab")},_toggleIcons:function(){this._dateIcon.toggle(),this._timeIcon.toggle()},_cancelClickHandler:function(){this._value&&(this.value(this._value),this.dateView.value(this._value)),this.popup.close()},_setClickHandler:function(){var e,t=this._applyDateValue();t=t||new Date,e=this.timeView._currentlySelected||t,this.timeView._updateCurrentlySelected(),t.setHours(e.getHours()),t.setMinutes(e.getMinutes()),t.setSeconds(e.getSeconds()),t=this._applyTimeValue(t),this._change(t),this.popup.close()}});g.plugin(G)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,a){(a||t)()});
|
|
//# sourceMappingURL=kendo.datetimepicker.min.js.map
|