aiber-test/www/tap-click-71d2324a-js-es2015.js.map
2020-12-18 09:30:04 +00:00

1 line
5.8 KiB
Plaintext

{"version":3,"sources":["./node_modules/@ionic/core/dist/esm/tap-click-71d2324a.js"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAoE;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8DAAG;AACnB;AACA;AACA;AACA,gBAAgB,8DAAG;AACnB;AACA;AACA;AACA,cAAc,8DAAG;AACjB;AACA;AACA;AACA;AACA;AACA,cAAc,8DAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO,GAAG,8DAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEyB","file":"tap-click-71d2324a-js-es2015.js","sourcesContent":["import { n as now, p as pointerCoord } from './helpers-90f46169.js';\n\nconst startTapClick = (config) => {\n let lastTouch = -MOUSE_WAIT * 10;\n let lastActivated = 0;\n let scrollingEl;\n let activatableEle;\n let activeRipple;\n let activeDefer;\n const useRippleEffect = config.getBoolean('animated', true) && config.getBoolean('rippleEffect', true);\n const clearDefers = new WeakMap();\n const isScrolling = () => {\n return scrollingEl !== undefined && scrollingEl.parentElement !== null;\n };\n // Touch Events\n const onTouchStart = (ev) => {\n lastTouch = now(ev);\n pointerDown(ev);\n };\n const onTouchEnd = (ev) => {\n lastTouch = now(ev);\n pointerUp(ev);\n };\n const onMouseDown = (ev) => {\n const t = now(ev) - MOUSE_WAIT;\n if (lastTouch < t) {\n pointerDown(ev);\n }\n };\n const onMouseUp = (ev) => {\n const t = now(ev) - MOUSE_WAIT;\n if (lastTouch < t) {\n pointerUp(ev);\n }\n };\n const cancelActive = () => {\n clearTimeout(activeDefer);\n activeDefer = undefined;\n if (activatableEle) {\n removeActivated(false);\n activatableEle = undefined;\n }\n };\n const pointerDown = (ev) => {\n if (activatableEle || isScrolling()) {\n return;\n }\n scrollingEl = undefined;\n setActivatedElement(getActivatableTarget(ev), ev);\n };\n const pointerUp = (ev) => {\n setActivatedElement(undefined, ev);\n };\n const setActivatedElement = (el, ev) => {\n // do nothing\n if (el && el === activatableEle) {\n return;\n }\n clearTimeout(activeDefer);\n activeDefer = undefined;\n const { x, y } = pointerCoord(ev);\n // deactivate selected\n if (activatableEle) {\n if (clearDefers.has(activatableEle)) {\n throw new Error('internal error');\n }\n if (!activatableEle.classList.contains(ACTIVATED)) {\n addActivated(activatableEle, x, y);\n }\n removeActivated(true);\n }\n // activate\n if (el) {\n const deferId = clearDefers.get(el);\n if (deferId) {\n clearTimeout(deferId);\n clearDefers.delete(el);\n }\n const delay = isInstant(el) ? 0 : ADD_ACTIVATED_DEFERS;\n el.classList.remove(ACTIVATED);\n activeDefer = setTimeout(() => {\n addActivated(el, x, y);\n activeDefer = undefined;\n }, delay);\n }\n activatableEle = el;\n };\n const addActivated = (el, x, y) => {\n lastActivated = Date.now();\n el.classList.add(ACTIVATED);\n const rippleEffect = useRippleEffect && getRippleEffect(el);\n if (rippleEffect && rippleEffect.addRipple) {\n removeRipple();\n activeRipple = rippleEffect.addRipple(x, y);\n }\n };\n const removeRipple = () => {\n if (activeRipple !== undefined) {\n activeRipple.then(remove => remove());\n activeRipple = undefined;\n }\n };\n const removeActivated = (smooth) => {\n removeRipple();\n const active = activatableEle;\n if (!active) {\n return;\n }\n const time = CLEAR_STATE_DEFERS - Date.now() + lastActivated;\n if (smooth && time > 0 && !isInstant(active)) {\n const deferId = setTimeout(() => {\n active.classList.remove(ACTIVATED);\n clearDefers.delete(active);\n }, CLEAR_STATE_DEFERS);\n clearDefers.set(active, deferId);\n }\n else {\n active.classList.remove(ACTIVATED);\n }\n };\n const doc = document;\n doc.addEventListener('ionScrollStart', ev => {\n scrollingEl = ev.target;\n cancelActive();\n });\n doc.addEventListener('ionScrollEnd', () => {\n scrollingEl = undefined;\n });\n doc.addEventListener('ionGestureCaptured', cancelActive);\n doc.addEventListener('touchstart', onTouchStart, true);\n doc.addEventListener('touchcancel', onTouchEnd, true);\n doc.addEventListener('touchend', onTouchEnd, true);\n doc.addEventListener('mousedown', onMouseDown, true);\n doc.addEventListener('mouseup', onMouseUp, true);\n};\nconst getActivatableTarget = (ev) => {\n if (ev.composedPath) {\n const path = ev.composedPath();\n for (let i = 0; i < path.length - 2; i++) {\n const el = path[i];\n if (el.classList && el.classList.contains('ion-activatable')) {\n return el;\n }\n }\n }\n else {\n return ev.target.closest('.ion-activatable');\n }\n};\nconst isInstant = (el) => {\n return el.classList.contains('ion-activatable-instant');\n};\nconst getRippleEffect = (el) => {\n if (el.shadowRoot) {\n const ripple = el.shadowRoot.querySelector('ion-ripple-effect');\n if (ripple) {\n return ripple;\n }\n }\n return el.querySelector('ion-ripple-effect');\n};\nconst ACTIVATED = 'ion-activated';\nconst ADD_ACTIVATED_DEFERS = 200;\nconst CLEAR_STATE_DEFERS = 200;\nconst MOUSE_WAIT = 2500;\n\nexport { startTapClick };\n"],"sourceRoot":"webpack:///"}