@ionic/core
Version:
Base components for Ionic
4 lines • 5.22 kB
JavaScript
var __awaiter=this&&this.__awaiter||function(n,t,i,a){function e(n){return n instanceof i?n:new i((function(t){t(n)}))}return new(i||(i=Promise))((function(i,r){function o(n){try{c(a.next(n))}catch(n){r(n)}}function f(n){try{c(a["throw"](n))}catch(n){r(n)}}function c(n){n.done?i(n.value):e(n.value).then(o,f)}c((a=a.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},a,e,r,o;return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(n){return function(t){return c([n,t])}}function c(f){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,f[0]&&(i=0)),i)try{if(a=1,e&&(r=f[0]&2?e["return"]:f[0]?e["throw"]||((r=e["return"])&&r.call(e),0):e.next)&&!(r=r.call(e,f[1])).done)return r;if(e=0,r)f=[f[0]&2,r.value];switch(f[0]){case 0:case 1:r=f;break;case 4:i.label++;return{value:f[1],done:false};case 5:i.label++;e=f[1];f=[0];continue;case 7:f=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(f[0]===6||f[0]===2)){i=0;continue}if(f[0]===3&&(!r||f[1]>r[0]&&f[1]<r[3])){i.label=f[1];break}if(f[0]===6&&i.label<r[1]){i.label=r[1];r=f;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(f);break}if(r[2])i.ops.pop();i.trys.pop();continue}f=t.call(n,i)}catch(n){f=[6,n];e=0}finally{a=r=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:true}}};
/*!
* (C) Ionic http://ionicframework.com - MIT License
*/System.register(["./p-f11a9436.system.js","./p-f201b53a.system.js"],(function(n){"use strict";var t,i,a,e,r,o,f;return{setters:[function(n){t=n.r;i=n.d;a=n.w;e=n.h;r=n.f;o=n.e},function(n){f=n.b}],execute:function(){var c=":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}:host(.unbounded){contain:layout size style}.ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;-webkit-animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;will-change:transform, opacity;pointer-events:none}.fade-out{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1));-webkit-animation:150ms fadeOutAnimation forwards;animation:150ms fadeOutAnimation forwards}@-webkit-keyframes rippleAnimation{from{-webkit-animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@keyframes rippleAnimation{from{-webkit-animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@-webkit-keyframes fadeInAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:0.16}}@keyframes fadeInAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:0.16}}@-webkit-keyframes fadeOutAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0.16}to{opacity:0}}@keyframes fadeOutAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0.16}to{opacity:0}}";var s=c;var u=n("ion_ripple_effect",function(){function n(n){t(this,n);this.type="bounded"}n.prototype.addRipple=function(n,t){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){return[2,new Promise((function(r){i((function(){var i=e.el.getBoundingClientRect();var o=i.width;var f=i.height;var c=Math.sqrt(o*o+f*f);var s=Math.max(f,o);var u=e.unbounded?s:c+m;var b=Math.floor(s*v);var d=u/b;var p=n-i.left;var w=t-i.top;if(e.unbounded){p=o*.5;w=f*.5}var y=p-b*.5;var h=w-b*.5;var k=o*.5-p;var g=f*.5-w;a((function(){var n=document.createElement("div");n.classList.add("ripple-effect");var t=n.style;t.top=h+"px";t.left=y+"px";t.width=t.height=b+"px";t.setProperty("--final-scale","".concat(d));t.setProperty("--translate-end","".concat(k,"px, ").concat(g,"px"));var i=e.el.shadowRoot||e.el;i.appendChild(n);setTimeout((function(){r((function(){l(n)}))}),225+100)}))}))}))]}))}))};Object.defineProperty(n.prototype,"unbounded",{get:function(){return this.type==="unbounded"},enumerable:false,configurable:true});n.prototype.render=function(){var n;var t=f(this);return e(o,{key:"40c7f73e7f5f67e29f83e1236a61c6e1c9943c42",role:"presentation",class:(n={},n[t]=true,n.unbounded=this.unbounded,n)})};Object.defineProperty(n.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return n}());var l=function(n){n.classList.add("fade-out");setTimeout((function(){n.remove()}),200)};var m=10;var v=.5;u.style=s}}}));