demo20230512/Scripts/kendo/2014.2.716/kendo.calendar.min.js

16 lines
17 KiB
JavaScript
Raw Normal View History

2023-05-12 10:20:28 +08:00
/**
* Copyright 2014 Telerik AD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
!function(e,define){define(["./kendo.core.min"],e)}(function(){return function(e,t){function n(e,t,n,i){var r,o=e.getFullYear(),a=t.getFullYear(),s=n.getFullYear();return o-=o%i,r=o+(i-1),a>o&&(o=a),r>s&&(r=s),o+"-"+r}function i(e){for(var t,n=0,i=e.min,r=e.max,o=e.start,a=e.setter,l=e.build,u=e.cells||12,c=e.perRow||4,d=e.content||z,f=e.empty||O,h=e.html||'<table tabindex="0" role="grid" class="k-content k-meta-view" cellspacing="0"><tbody><tr role="row">';u>n;n++)n>0&&n%c===0&&(h+='</tr><tr role="row">'),t=l(o,n),h+=s(o,i,r)?d(t):f(t),a(o,1);return h+"</tr></tbody></table>"}function r(e,t,n){var i=e.getFullYear(),r=t.getFullYear(),o=r,a=0;return n&&(r-=r%n,o=r-r%n+n-1),i>o?a=1:r>i&&(a=-1),a}function o(){var e=new pt;return new pt(e.getFullYear(),e.getMonth(),e.getDate())}function a(e,t,n){var i=o();return e&&(i=new pt(+e)),t>i?i=new pt(+t):i>n&&(i=new pt(+n)),i}function s(e,t,n){return+e>=+t&&+n>=+e}function l(e,t){return e.slice(t).concat(e.slice(0,t))}function u(e,t,n){t=t instanceof pt?t.getFullYear():e.getFullYear()+n*t,e.setFullYear(t)}function c(t){e(this).toggleClass($,it.indexOf(t.type)>-1||t.type==tt)}function d(e){e.preventDefault()}function f(e){return D(e).calendars.standard}function h(e){var n=gt[e.start],i=gt[e.depth],r=D(e.culture);e.format=S(e.format||r.calendars.standard.patterns.d),isNaN(n)&&(n=0,e.start=W),(i===t||i>n)&&(e.depth=W),e.dates||(e.dates=[])}function p(e){A&&e.find("*").attr("unselectable","on")}function g(e,t){for(var n=0,i=t.length;i>n;n++)if(e===+t[n])return!0;return!1}function m(e,t){return e?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate():!1}function v(e,t){return e?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth():!1}var _,y=window.kendo,b=y.support,w=y.ui,x=w.Widget,k=y.keys,T=y.parseDate,C=y.date.adjustDST,S=y._extractFormat,F=y.template,D=y.getCulture,M=y.support.transitions,E=M?M.css+"transform-origin":"",z=F('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link" href="\\#" data-#=data.ns#value="#=data.dateString#">#=data.value#</a></td>',{useWithBlock:!1}),O=F('<td role="gridcell">&nbsp;</td>',{useWithBlock:!1}),P=y.support.browser,A=P.msie&&9>P.version,H=".kendoCalendar",N="click"+H,I="keydown"+H,R="id",B="min",L="left",q="slideIn",W="month",j="century",U="change",V="navigate",Y="value",$="k-state-hover",G="k-state-disabled",Q="k-state-focused",J="k-other-month",K=' class="'+J+'"',X="k-nav-today",Z="td:has(.k-link)",et="blur"+H,tt="focus",nt=tt+H,it=b.touch?"touchstart":"mouseenter",rt=b.touch?"touchstart"+H:"mouseenter"+H,ot=b.touch?"touchend"+H+" touchmove"+H:"mouseleave"+H,at=6e4,st=864e5,lt="_prevArrow",ut="_nextArrow",ct="aria-disabled",dt="aria-selected",ft=e.proxy,ht=e.extend,pt=Date,gt={month:0,year:1,decade:2,century:3},mt=x.extend({init:function(t,n){var i,r,o=this;x.fn.init.call(o,t,n),t=o.wrapper=o.element,n=o.options,n.url=window.unescape(n.url),o._templates(),o._header(),o._footer(o.footer),r=t.addClass("k-widget k-calendar").on(rt+" "+ot,Z,c).on(I,"table.k-content",ft(o._move,o)).on(N,Z,function(t){var n=t.currentTarget.firstChild;-1!=n.href.indexOf("#")&&t.preventDefault(),o._click(e(n))}).on("mouseup"+H,"table.k-content, .k-footer",function(){o._focusView(o.options.focusOnNav!==!1)}).attr(R),r&&(o._cellID=r+"_cell_selected"),h(n),i=T(n.value,n.format,n.culture),o._index=gt[n.start],o._current=new pt(+a(i,n.min,n.max)),o._addClassProxy=function(){o._active=!0,o._cell.addClass(Q)},o._removeClassProxy=function(){o._active=!1,o._cell.removeClass(Q)},o.value(i),y.notify(o)},options:{name:"Calendar",value:null,min:new pt(1900,0,1),max:new pt(2099,11,31),dates:[],url:"",culture:"",footer:"",format:"",month:{},start:W,depth:W,animation:{horizontal:{effects:q,reverse:!0,duration:500,divisor:2},vertical:{effects:"zoomIn",duration:400}}},events:[U,V],setOptions:function(e){var t=this;h(e),e.dates[0]||(e.dates=t.options.dates),x.fn.setOptions.call(t,e),t._templates(),t._footer(t.footer),t._index=gt[t.options.start],t.navigate()},destroy:function(){var e=this,t=e._today;e.element.off(H),e._title.off(H),e