aiber-martin/www/swipe-back-0a6a44c8-js-es2015.js.map
Martin Donnelly a4b8625d0f init
2020-12-17 16:23:12 +00:00

1 line
2.3 KiB
Plaintext

{"version":3,"sources":["./node_modules/@ionic/core/dist/esm/swipe-back-0a6a44c8.js"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmD;AACT;AACU;;AAEpD;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;AACA;AACA,+DAA+D,8DAAK;AACpE;AACA,WAAW,wEAAa;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEkC","file":"swipe-back-0a6a44c8-js-es2015.js","sourcesContent":["import { c as clamp } from './helpers-5c745fbd.js';\nimport './gesture-controller-89173521.js';\nimport { createGesture } from './index-eea61379.js';\n\nconst createSwipeBackGesture = (el, canStartHandler, onStartHandler, onMoveHandler, onEndHandler) => {\n const win = el.ownerDocument.defaultView;\n const canStart = (detail) => {\n return detail.startX <= 50 && canStartHandler();\n };\n const onMove = (detail) => {\n // set the transition animation's progress\n const delta = detail.deltaX;\n const stepValue = delta / win.innerWidth;\n onMoveHandler(stepValue);\n };\n const onEnd = (detail) => {\n // the swipe back gesture has ended\n const delta = detail.deltaX;\n const width = win.innerWidth;\n const stepValue = delta / width;\n const velocity = detail.velocityX;\n const z = width / 2.0;\n const shouldComplete = velocity >= 0 && (velocity > 0.2 || detail.deltaX > z);\n const missing = shouldComplete ? 1 - stepValue : stepValue;\n const missingDistance = missing * width;\n let realDur = 0;\n if (missingDistance > 5) {\n const dur = missingDistance / Math.abs(velocity);\n realDur = Math.min(dur, 540);\n }\n /**\n * TODO: stepValue can sometimes return negative values\n * or values greater than 1 which should not be possible.\n * Need to investigate more to find where the issue is.\n */\n onEndHandler(shouldComplete, (stepValue <= 0) ? 0.01 : clamp(0, stepValue, 0.9999), realDur);\n };\n return createGesture({\n el,\n gestureName: 'goback-swipe',\n gesturePriority: 40,\n threshold: 10,\n canStart,\n onStart: onStartHandler,\n onMove,\n onEnd\n });\n};\n\nexport { createSwipeBackGesture };\n"],"sourceRoot":"webpack:///"}