src/main/resources/static/assets/lib/kendo/js/kendo.popup.min.js
(完整代码) 13KB/**
* Kendo UI v2017.2.621 (http://www.telerik.com/kendo-ui)
* Copyright 2017 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.popup.min",["kendo.core.min"],e)}(function(){return function(e,t){function o(t,o){return!(!t||!o)&&(t===o||e.contains(t,o))}var n,i,s,r=window.kendo,a=r.ui,l=a.Widget,p=r.Class,d=r.support,c=r.getOffset,f=r._outerWidth,u=r._outerHeight,h="open",m="close",g="deactivate",w="activate",v="center",_="left",b="right",y="top",k="bottom",z="absolute",T="hidden",x="body",C="location",P="position",S="visible",E="effects",I="k-state-active",O="k-state-border",R=/k-state-border-(\w+)/,A=".k-picker-wrap, .k-dropdown-wrap, .k-link",D="down",H=e(document.documentElement),W=e.proxy,j=e(window),L="scroll",K=d.transitions.css,M=K+"transform",N=e.extend,F=".kendoPopup",U=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],Q=l.extend({init:function(t,o){var n,i=this;o=o||{},o.isRtl&&(o.origin=o.origin||k+" "+b,o.position=o.position||y+" "+b),l.fn.init.call(i,t,o),t=i.element,o=i.options,i.collisions=o.collision?o.collision.split(" "):[],i.downEvent=r.applyEventMap(D,r.guid()),1===i.collisions.length&&i.collisions.push(i.collisions[0]),n=e(i.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])"),o.appendTo=e(e(o.appendTo)[0]||n[0]||document.body),i.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!o.isRtl).css({position:z}).appendTo(o.appendTo).on("mouseenter"+F,function(){i._hovered=!0}).on("mouseleave"+F,function(){i._hovered=!1}),i.wrapper=e(),o.animation===!1&&(o.animation={open:{effects:{}},close:{hide:!0,effects:{}}}),N(o.animation.open,{complete:function(){i.wrapper.css({overflow:S}),i._activated=!0,i._trigger(w)}}),N(o.animation.close,{complete:function(){i._animationClose()}}),i._mousedownProxy=function(e){i._mousedown(e)},i._resizeProxy=d.mobileOS.android?function(e){setTimeout(function(){i._resize(e)},600)}:function(e){i._resize(e)},o.toggleTarget&&e(o.toggleTarget).on(o.toggleEvent+F,e.proxy(i.toggle,i))},events:[h,w,m,g],options:{name:"Popup",toggleEvent:"click",origin:k+" "+_,position:y+" "+_,anchor:x,appendTo:null,collision:"flip fit",viewport:window,copyAnchorStyles:!0,autosize:!1,modal:!1,adjustSize:{width:0,height:0},animation:{open:{effects:"slideIn:down",transition:!0,duration:200},close:{duration:100,hide:!0}}},_animationClose:function(){var e=this,t=e.wrapper.data(C);e.wrapper.hide(),t&&e.wrapper.css(t),e.options.anchor!=x&&e._hideDirClass(),e._closing=!1,e._trigger(g)},destroy:function(){var t,o=this,n=o.options,i=o.element.off(F);l.fn.destroy.call(o),n.toggleTarget&&e(n.toggleTarget).off(F),n.modal||(H.unbind(o.downEvent,o._mousedownProxy),o._toggleResize(!1)),r.destroy(o.element.children()),i.removeData(),n.appendTo[0]===document.body&&(t=i.parent(".k-animation-container"),t[0]?t.remove():i.remove())},open:function(t,o){var n,i,s=this,a={isFixed:!isNaN(parseInt(o,10)),x:t,y:o},l=s.element,p=s.options,c=e(p.anchor),f=l[0]&&l.hasClass("km-widget");if(!s.visible()){if(p.copyAnchorStyles&&(f&&"font-size"==U[0]&&U.shift(),l.css(r.getComputedStyles(c[0],U))),l.data("animating")||s._trigger(h))return;s._activated=!1,p.modal||(H.unbind(s.downEvent,s._mousedownProxy).bind(s.downEvent,s._mousedownProxy),s._toggleResize(!1),s._toggleResize(!0)),s.wrapper=i=r.wrap(l,p.autosize).css({overflow:T,display:"block",position:z}),d.mobileOS.android&&i.css(M,"translatez(0)"),i.css(P),e(p.appendTo)[0]==document.body&&i.css(y,"-10000px"),s.flipped=s._position(a),n=s._openAnimation(),p.anchor!=x&&s._showDirClass(n),l.data(E,n.effects).kendoStop(!0).kendoAnimate(n)}},_location:function(t){var o,n,i=this,s=i.element,a=i.options,l=e(a.anchor),p=s[0]&&s.hasClass("km-widget");return a.copyAnchorStyles&&(p&&"font-size"==U[0]&&U.shift(),s.css(r.getComputedStyles(l[0],U))),i.wrapper=o=r.wrap(s,a.autosize).css({overflow:T,display:"block",position:z}),d.mobileOS.android&&o.css(M,"translatez(0)"),o.css(P),e(a.appendTo)[0]==document.body&&o.css(y,"-10000px"),i._position(t||{}),n=o.offset(),{width:r._outerWidth(o),height:r._outerHeight(o),left:n.left,top:n.top}},_openAnimation:function(){var e=N(!0,{},this.options.animation.open);return e.effects=r.parseEffects(e.effects,this.flipped),e},_hideDirClass:function(){var t=e(this.options.anchor),o=((t.attr("class")||"").match(R)||["","down"])[1],n=O+"-"+o;t.removeClass(n).children(A).removeClass(I).removeClass(n),this.element.removeClass(O+"-"+r.directions[o].reverse)},_showDirClass:function(t){var o=t.effects.slideIn?t.effects.slideIn.direction:"down",n=O+"-"+o;e(this.options.anchor).addClass(n).children(A).addClass(I).addClass(n),this.element.addClass(O+"-"+r.directions[o].reverse)},position:function(){this.visible()&&(this.flipped=this._position())},toggle:function(){var e=this;e[e.visible()?m:h]()},visible:function(){return this.element.is(":"+S)},close:function(o){var n,i,s,a,l=this,p=l.options;if(l.visible()){if(n=l.wrapper[0]?l.wrapper:r.wrap(l.element).hide(),l._toggleResize(!1),l._closing||l._trigger(m))return l._toggleResize(!0),t;l.element.find(".k-popup").each(function(){var t=e(this),n=t.data("kendoPopup");n&&n.close(o)}),H.unbind(l.downEvent,l._mousedownProxy),o?i={hide:!0,effects:{}}:(i=N(!0,{},p.animation.close),s=l.element.data(E),a=i.effects,!a&&!r.size(a)&&s&&r.size(s)&&(i.effects=s,i.reverse=!0),l._closing=!0),l.element.kendoStop(!0),n.css({overflow:T}),l.element.kendoAnimate(i),o&&l._animationClose()}},_trigger:function(e){return this.trigger(e,{type:e})},_resize:function(e){var t=this;d.resize.indexOf(e.type)!==-1?(clearTimeout(t._resizeTimeout),t._resizeTimeout=setTimeout(function(){t._position(),t._resizeTimeout=null},50)):(!t._hovered||t._activated&&t.element.hasClass("k-list-container"))&&t.close()},_toggleResize:function(e){var t=e?"on":"off",o=d.resize;d.mobileOS.ios||d.mobileOS.android||(o+=" "+L),this._scrollableParents()[t](L,this._resizeProxy),j[t](o,this._resizeProxy)},_mousedown:function(t){var n=this,i=n.element[0],s=n.options,a=e(s.anchor)[0],l=s.toggleTarget,p=r.eventTarget(t),d=e(p).closest(".k-popup"),c=d.parent().parent(".km-shim").length;d=d[0],!c&&d&&d!==n.element[0]||"popover"!==e(t.target).closest("a").data("rel")&&(o(i,p)||o(a,p)||l&&o(e(l)[0],p)||n.close())},_fit:function(e,t,o){var n=0;return e+t>o&&(n=o-(e+t)),e<0&&(n=-e),n},_flip:function(e,t,o,n,i,s,r){var a=0;return r=r||t,s!==i&&s!==v&&i!==v&&(e+r>n&&(a+=-(o+t)),e+a<0&&(a+=o+t)),a},_scrollableParents:function(){return e(this.options.anchor).parentsUntil("body").filter(function(e,t){return r.isScrollable(t)})},_position:function(t){var o,n,i,s,a,l,p,h,m,g,w,v,_,b,y,k,T,x=this,S=x.element,E=x.wrapper,I=x.options,O=e(I.viewport),R=d.zoomLevel(),A=!!(O[0]==window&&window.innerWidth&&R<=1.02),D=e(I.anchor),H=I.origin.toLowerCase().split(" "),W=I.position.toLowerCase().split(" "),j=x.collisions,L=10002,K=0,M=document.documentElement;if(a=I.viewport===window?{top:window.pageYOffset||document.documentElement.scrollTop||0,left:window.pageXOffset||document.documentElement.scrollLeft||0}:O.offset(),A?(l=window.innerWidth,p=window.innerHeight):(l=O.width(),p=O.height()),A&&M.scrollHeight-M.clientHeight>0&&(h=I.isRtl?-1:1,l-=h*r.support.scrollbar()),o=D.parents().filter(E.siblings()),o[0])if(i=Math.max(+o.css("zIndex"),0))L=i+10;else for(n=D.parentsUntil(o),s=n.length;K<s;K++)i=+e(n[K]).css("zIndex"),i&&L<i&&(L=i+10);return E.css("zIndex",L),E.css(t&&t.isFixed?{left:t.x,top:t.y}:x._align(H,W)),m=c(E,P,D[0]===E.offsetParent()[0]),g=c(E),w=D.offsetParent().parent(".k-animation-container,.k-popup,.k-group"),w.length&&(m=c(E,P,!0),g=c(E)),g.top-=a.top,g.left-=a.left,x.wrapper.data(C)||E.data(C,N({},m)),v=N({},g),_=N({},m),b=I.adjustSize,"fit"===j[0]&&(_.top+=x._fit(v.top,u(E)+b.height,p/R)),"fit"===j[1]&&(_.left+=x._fit(v.left,f(E)+b.width,l/R)),y=N({},_),k=u(S),T=u(E),!E.height()&&k&&(T+=k),"flip"===j[0]&&(_.top+=x._flip(v.top,k,u(D),p/R,H[0],W[0],T)),"flip"===j[1]&&(_.left+=x._flip(v.left,f(S),f(D),l/R,H[1],W[1],f(E))),S.css(P,z),E.css(_),_.left!=y.left||_.top!=y.top},_align:function(t,o){var n,i=this,s=i.wrapper,r=e(i.options.anchor),a=t[0],l=t[1],p=o[0],d=o[1],h=c(r),m=e(i.options.appendTo),g=f(s),w=u(s),_=f(r),y=u(r),z=h.top,T=h.left,x=Math.round;return m[0]!=document.body&&(n=c(m),z-=n.top,T-=n.left),a===k&&(z+=y),a===v&&(z+=x(y/2)),p===k&&(z-=w),p===v&&(z-=x(w/2)),l===b&&(T+=_),l===v&&(T+=x(_/2)),d===b&&(T-=g),d===v&&(T-=x(g/2)),{top:z,left:T}}});a.plugin(Q),n="kendoTabKeyTrap",i="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], *[contenteditable]",s=p.extend({init:function(t){this.element=e(t),this.element.autoApplyNS(n)},trap:function(){this.element.on("keydown",W(this._keepInTrap,this))},removeTrap:function(){this.element.kendoDestroy(n)},destroy:function(){this.element.kendoDestroy(n),this.element=t},shouldTrap:function(){return!0},_keepInTrap:function(e){var t,o,n,s,r,a;9===e.which&&this.shouldTrap()&&(t=e.target,o=this.element.find(i).filter(":visible[tabindex!=-1]"),n=o.sort(function(e,t){return e.tabIndex-t.tabIndex}),s=n.length,r=s-1,a=n.index(t),e.shiftKey?0===a?n.get(r).focus():n.get(a-1).focus():a===r?n.get(0).focus():n.get(a+1).focus(),e.preventDefault())}}),a.Popup.TabKeyTrap=s}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,o){(o||t)()});
//# sourceMappingURL=kendo.popup.min.js.map
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
