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