@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 3.21 kB
JavaScript
module.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}({0:function(e,t,n){n(1650),e.exports=n(1650)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},20:function(e,t){e.exports=require("../kendo.core")},1650:function(e,t,n){var o,r,i;!function(u,define){r=[n(20)],o=u,i="function"==typeof o?o.apply(t,r):o,!(void 0!==i&&(e.exports=i))}(function(){!function(){var e,t,n,o,r,i,u,c;window.kendo.util=window.kendo.util||{},window.kendo.util.ripple=window.kendo.util.ripple||{},e=function(e,t){var n,o;if(e.closest)return e.closest(t);for(n=Element.prototype.matches?function(e,t){return e.matches(t)}:function(e,t){return e.msMatchesSelector(t)},o=e;o;){if(n(o,t))return o;o=o.parentElement}},t=function(e){var t,n=e.createElement("div");return n.className="k-ripple",t=e.createElement("div"),t.className="k-ripple-blob",n.appendChild(t),[n,t]},n=function(e,t,n){var o=function(){n(),e.removeEventListener(t,o,!1)},r=function(){return e.addEventListener(t,o,!1)};return r(),{remove:r}},o=function(o,u){return function(c){var a,s,p,l,d,f,v,h,m,w,y,g,x,b,k,E,L=c.target,C=L.document||L.ownerDocument;if(a=u.container?u.container(L):e(L,o),a&&(s=/focus/i.test(c.type)&&a.classList.contains("k-ripple-target"),!s)){if(a.classList.add("k-ripple-target"),p=t(C),l=p[0],d=p[1],f={animated:!1,released:!1,blob:d,container:a,ripple:l},v={focusin:"focusout",keydown:"keyup",mousedown:"mouseup",pointerdown:"pointerup",touchdown:"touchup"}[c.type],n(c.currentTarget,v,function(){return i(f)}),a.appendChild(l),window.getComputedStyle(l).getPropertyValue("opacity"),h=a.getBoundingClientRect(),m=0,w=0,/mouse|pointer|touch/.test(c.type)?(m=c.clientX-h.left,w=c.clientY-h.top):(m=h.width/2,w=h.height/2),y=m<h.width/2?h.width:0,g=w<h.height/2?h.height:0,x=m-y,b=w-g,k=2*Math.sqrt(x*x+b*b),E=500,d.style.width=d.style.height=k+"px",d.offsetWidth<0)throw Error("Inconceivable!");d.style.cssText="\n width: "+k+"px;\n height: "+k+"px;\n transform: translate(-50%, -50%) scale(1);\n left: "+m+"px;\n top: "+w+"px;\n ",setTimeout(function(){return r(f)},E)}}},r=function(e){e.animated=!0,u(e)},i=function(e){e.released=!0,u(e)},u=function(e){if(e.released&&e.animated){var t=e.blob,o=e.ripple,r=e.container;r&&n(r,"blur",function(){return r.classList.remove("k-ripple-target")}),t&&(n(t,"transitionend",function(){o&&o.parentNode&&o.parentNode.removeChild(o)}),t.style.transition="opacity 200ms linear",t.style.opacity="0")}},c=function(e,t){var n=function(e){return[].concat.apply([],e)},r=n(t.map(function(t){var n={events:["mousedown","touchdown"],global:!1},r=t.selector,i=t.options,u=void 0===i?n:i,c=o(r,u),a=u.events||n.events,s=u.global?document.body:e;return a.forEach(function(e){return s.addEventListener(e,c,!1)}),{events:a,options:u,activator:c}}));return function(){if(e){var t=function(t){var n=t.events,o=t.options,r=t.activator,i=o.global?document.body:e;n.forEach(function(e){return i.removeEventListener(e,r,!1)})};r.forEach(t),e=null}}},kendo.deepExtend(kendo.util.ripple,{register:c})}()},n(3))}});