UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

1 lines 3.2 kB
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(1549),t.exports=n(1549)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},19:function(t,e){t.exports=require("../kendo.core")},1549:function(t,e,n){var o,r,i;!function(u,define){r=[n(19)],o=u,i="function"==typeof o?o.apply(e,r):o,!(void 0!==i&&(t.exports=i))}(function(){!function(){var t,e,n,o,r,i,u,c;this.kendo.util=this.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,u){return function(c){var a,s,p,l,d,f,h,v,m,y,w,g,x,b,k,E,L=c.target,C=L.document||L.ownerDocument;if(a=u.container?u.container(L):t(L,o),a&&(s=/focus/i.test(c.type)&&a.classList.contains("k-ripple-target"),!s)){if(a.classList.add("k-ripple-target"),p=e(C),l=p[0],d=p[1],f={animated:!1,released:!1,blob:d,container:a,ripple:l},h={focusin:"focusout",keydown:"keyup",mousedown:"mouseup",pointerdown:"pointerup",touchdown:"touchup"}[c.type],n(c.currentTarget,h,function(){return i(f)}),a.appendChild(l),window.getComputedStyle(l).getPropertyValue("opacity"),v=a.getBoundingClientRect(),m=0,y=0,/mouse|pointer|touch/.test(c.type)?(m=c.clientX-v.left,y=c.clientY-v.top):(m=v.width/2,y=v.height/2),w=m<v.width/2?v.width:0,g=y<v.height/2?v.height:0,x=m-w,b=y-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: "+y+"px;\n ",setTimeout(function(){return r(f)},E)}}},r=function(t){t.animated=!0,u(t)},i=function(t){t.released=!0,u(t)},u=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,u=void 0===i?n:i,c=o(r,u),a=u.events||n.events,s=u.global?document.body:t;return a.forEach(function(t){return s.addEventListener(t,c,!1)}),{events:a,options:u,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))}});