1 line
8.3 KiB
Plaintext
1 line
8.3 KiB
Plaintext
{"version":3,"sources":["webpack:///node_modules/@ionic/core/dist/esm/ion-ripple-effect.entry.js"],"names":["rippleEffectCss","RippleEffect","hostRef","type","x","y","Promise","resolve","rect","el","getBoundingClientRect","width","height","hypotenuse","Math","sqrt","maxDim","max","maxRadius","unbounded","PADDING","initialSize","floor","INITIAL_ORIGIN_SCALE","finalScale","posX","left","posY","top","styleX","styleY","moveX","moveY","div","document","createElement","classList","add","style","setProperty","container","shadowRoot","appendChild","setTimeout","removeRipple","mode","role","ripple","remove"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;;AAGA,UAAMA,eAAe,GAAG,g7DAAxB;;AAEA,UAAMC,YAAY;AAChB,8BAAYC,OAAZ,EAAqB;AAAA;;AACnB,uEAAiB,IAAjB,EAAuBA,OAAvB;AACA;;;;;;;;;;AASA,eAAKC,IAAL,GAAY,SAAZ;AACD;AACD;;;;;;;;AAdgB;AAAA;AAAA;AAAA,sGAoBAC,CApBA,EAoBGC,CApBH;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,uDAqBP,IAAIC,OAAJ,CAAY,UAAAC,OAAO,EAAI;AAC5B,qFAAS,YAAM;AACb,8BAAMC,IAAI,GAAG,KAAI,CAACC,EAAL,CAAQC,qBAAR,EAAb;;AACA,8BAAMC,KAAK,GAAGH,IAAI,CAACG,KAAnB;AACA,8BAAMC,MAAM,GAAGJ,IAAI,CAACI,MAApB;AACA,8BAAMC,UAAU,GAAGC,IAAI,CAACC,IAAL,CAAUJ,KAAK,GAAGA,KAAR,GAAgBC,MAAM,GAAGA,MAAnC,CAAnB;AACA,8BAAMI,MAAM,GAAGF,IAAI,CAACG,GAAL,CAASL,MAAT,EAAiBD,KAAjB,CAAf;AACA,8BAAMO,SAAS,GAAG,KAAI,CAACC,SAAL,GAAiBH,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7C;AACA+B,qCAAS,CAACE,WAAV,CAAsBT,GAAtB;AACAU,sCAAU,CAAC,YAAM;AACfpC,qCAAO,CAAC,YAAM;AACZqC,4CAAY,CAACX,GAAD,CAAZ;AACD,+BAFM,CAAP;AAGD,6BAJS,EAIP,MAAM,GAJC,CAAV;AAKD,2BAhBD;AAiBD,yBApCD;AAqCD,uBAtCM,CArBO;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,mCAgEP;AAAA;;AACP,gBAAMY,IAAI,GAAG,oEAAW,IAAX,CAAb;AACA,mBAAQ,6DAAE,oDAAF,EAAQ;AAAEC,kBAAI,EAAE,cAAR;AAAwB,6DACnCD,IADmC,EAC5B,IAD4B,2BAEpC,WAFoC,EAEvB,KAAK1B,SAFkB;AAAxB,aAAR,CAAR;AAID;AAtEe;AAAA;AAAA,8BA6DA;AACd,mBAAO,KAAKhB,IAAL,KAAc,WAArB;AACD;AA/De;AAAA;AAAA,8BAuEP;AAAE,mBAAO,6DAAW,IAAX,CAAP;AAA0B;AAvErB;;AAAA;AAAA,SAAlB;;AAyEA,UAAMyC,YAAY,GAAG,SAAfA,YAAe,CAACG,MAAD,EAAY;AAC/BA,cAAM,CAACX,SAAP,CAAiBC,GAAjB,CAAqB,UAArB;AACAM,kBAAU,CAAC,YAAM;AACfI,gBAAM,CAACC,MAAP;AACD,SAFS,EAEP,GAFO,CAAV;AAGD,OALD;;AAMA,UAAM5B,OAAO,GAAG,EAAhB;AACA,UAAMG,oBAAoB,GAAG,GAA7B;AACAtB,kBAAY,CAACqC,KAAb,GAAqBtC,eAArB","file":"28-es5.js","sourcesContent":["import { r as registerInstance, f as readTask, c as writeTask, h, i as getElement, H as Host } from './index-e806d1f6.js';\nimport { b as getIonMode } from './ionic-global-9d5c8ee3.js';\n\nconst rippleEffectCss = \":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}}\";\n\nconst RippleEffect = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n /**\n * Sets the type of ripple-effect:\n *\n * - `bounded`: the ripple effect expands from the user's click position\n * - `unbounded`: the ripple effect expands from the center of the button and overflows the container.\n *\n * NOTE: Surfaces for bounded ripples should have the overflow property set to hidden,\n * while surfaces for unbounded ripples should have it set to visible.\n */\n this.type = 'bounded';\n }\n /**\n * Adds the ripple effect to the parent element.\n *\n * @param x The horizontal coordinate of where the ripple should start.\n * @param y The vertical coordinate of where the ripple should start.\n */\n async addRipple(x, y) {\n return new Promise(resolve => {\n readTask(() => {\n const rect = this.el.getBoundingClientRect();\n const width = rect.width;\n const height = rect.height;\n const hypotenuse = Math.sqrt(width * width + height * height);\n const maxDim = Math.max(height, width);\n const maxRadius = this.unbounded ? maxDim : hypotenuse + PADDING;\n const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);\n const finalScale = maxRadius / initialSize;\n let posX = x - rect.left;\n let posY = y - rect.top;\n if (this.unbounded) {\n posX = width * 0.5;\n posY = height * 0.5;\n }\n const styleX = posX - initialSize * 0.5;\n const styleY = posY - initialSize * 0.5;\n const moveX = width * 0.5 - posX;\n const moveY = height * 0.5 - posY;\n writeTask(() => {\n const div = document.createElement('div');\n div.classList.add('ripple-effect');\n const style = div.style;\n style.top = styleY + 'px';\n style.left = styleX + 'px';\n style.width = style.height = initialSize + 'px';\n style.setProperty('--final-scale', `${finalScale}`);\n style.setProperty('--translate-end', `${moveX}px, ${moveY}px`);\n const container = this.el.shadowRoot || this.el;\n container.appendChild(div);\n setTimeout(() => {\n resolve(() => {\n removeRipple(div);\n });\n }, 225 + 100);\n });\n });\n });\n }\n get unbounded() {\n return this.type === 'unbounded';\n }\n render() {\n const mode = getIonMode(this);\n return (h(Host, { role: \"presentation\", class: {\n [mode]: true,\n 'unbounded': this.unbounded\n } }));\n }\n get el() { return getElement(this); }\n};\nconst removeRipple = (ripple) => {\n ripple.classList.add('fade-out');\n setTimeout(() => {\n ripple.remove();\n }, 200);\n};\nconst PADDING = 10;\nconst INITIAL_ORIGIN_SCALE = 0.5;\nRippleEffect.style = rippleEffectCss;\n\nexport { RippleEffect as ion_ripple_effect };\n"]} |