Files
doneit-web/.angular/cache/14.2.12/babel-webpack/4c9d3b35f04e556cc6bf370c320273b6.json
T

1 line
7.0 KiB
JSON
Raw Normal View History

2023-06-30 09:54:21 +01:00
{"ast":null,"code":"import { c as writeTask } from './index-7a8b7a1c.js';\nimport { h as hapticSelectionEnd, a as hapticSelectionStart, b as hapticSelectionChanged } from './haptic-27b3f981.js';\nimport { createGesture } from './index-34cb2743.js';\nconst createButtonActiveGesture = (el, isButton) => {\n let currentTouchedButton;\n let initialTouchedButton;\n const activateButtonAtPoint = (x, y, hapticFeedbackFn) => {\n if (typeof document === 'undefined') {\n return;\n }\n const target = document.elementFromPoint(x, y);\n if (!target || !isButton(target)) {\n clearActiveButton();\n return;\n }\n if (target !== currentTouchedButton) {\n clearActiveButton();\n setActiveButton(target, hapticFeedbackFn);\n }\n };\n const setActiveButton = (button, hapticFeedbackFn) => {\n currentTouchedButton = button;\n if (!initialTouchedButton) {\n initialTouchedButton = currentTouchedButton;\n }\n const buttonToModify = currentTouchedButton;\n writeTask(() => buttonToModify.classList.add('ion-activated'));\n hapticFeedbackFn();\n };\n const clearActiveButton = (dispatchClick = false) => {\n if (!currentTouchedButton) {\n return;\n }\n const buttonToModify = currentTouchedButton;\n writeTask(() => buttonToModify.classList.remove('ion-activated'));\n /**\n * Clicking on one button, but releasing on another button\n * does not dispatch a click event in browsers, so we\n * need to do it manually here. Some browsers will\n * dispatch a click if clicking on one button, dragging over\n * another button, and releasing on the original button. In that\n * case, we need to make sure we do not cause a double click there.\n */\n if (dispatchClick && initialTouchedButton !== currentTouchedButton) {\n currentTouchedButton.click();\n }\n currentTouchedButton = undefined;\n };\n return createGesture({\n el,\n gestureName: 'buttonActiveDrag',\n threshold: 0,\n onStart: ev => activateButtonAtPoint(ev.currentX, ev.currentY, hapticSelectionStart),\n onMove: ev => activateButtonAtPoint(ev.currentX, ev.currentY, hapticSelectionChanged),\n onEnd: () => {\n clearActiveButton(true);\n hapticSelectionEnd();\n initialTouchedButton = undefined;\n }\n });\n};\nexport { createButtonActiveGesture as c };","map":{"version":3,"names":["c","writeTask","h","hapticSelectionEnd","a","hapticSelectionStart","b","hapticSelectionChanged","createGesture","createButtonActiveGesture","el","isButton","currentTouchedButton","initialTouchedButton","activateButtonAtPoint","x","y","hapticFeedbackFn","document","target","elementFromPoint","clearActiveButton","setActiveButton","button","buttonToModify","classList","add","dispatchClick","remove","click","undefined","gestureName","threshold","onStart","ev","currentX","currentY","onMove","onEnd"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@ionic/core/dist/esm/button-active-d4bd4f74.js"],"sourcesContent":["import { c as writeTask } from './index-7a8b7a1c.js';\nimport { h as hapticSelectionEnd, a as hapticSelectionStart, b as hapticSelectionChanged } from './haptic-27b3f981.js';\nimport { createGesture } from './index-34cb2743.js';\n\nconst createButtonActiveGesture = (el, isButton) => {\n let currentTouchedButton;\n let initialTouchedButton;\n const activateButtonAtPoint = (x, y, hapticFeedbackFn) => {\n if (typeof document === 'undefined') {\n return;\n }\n const target = document.elementFromPoint(x, y);\n if (!target || !isButton(target)) {\n clearActiveButton();\n return;\n }\n if (target !== currentTouchedButton) {\n clearActiveButton();\n setActiveButton(target, hapticFeedbackFn);\n }\n };\n const setActiveButton = (button, hapticFeedbackFn) => {\n currentTouchedButton = button;\n if (!initialTouchedButton) {\n initialTouchedButton = currentTouchedButton;\n }\n const buttonToModify = currentTouchedButton;\n writeTask(() => buttonToModify.classList.add('