This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/es5/directives/touch/index.js.map
2019-08-11 20:48:02 +02:00

1 line
No EOL
8.1 KiB
Text

{"version":3,"sources":["../../../src/directives/touch/index.ts"],"names":[],"mappings":";;;;;;;AACA;;AAoCA,IAAM,aAAa,GAAG,SAAhB,aAAgB,CAAC,OAAD,EAA0B;AAAA,MACtC,WADsC,GACa,OADb,CACtC,WADsC;AAAA,MACzB,SADyB,GACa,OADb,CACzB,SADyB;AAAA,MACd,WADc,GACa,OADb,CACd,WADc;AAAA,MACD,SADC,GACa,OADb,CACD,SADC;AAE9C,MAAM,QAAQ,GAAG,GAAjB;AACA,MAAM,WAAW,GAAG,EAApB;AACA,EAAA,OAAO,CAAC,OAAR,GAAkB,SAAS,GAAG,WAA9B;AACA,EAAA,OAAO,CAAC,OAAR,GAAkB,SAAS,GAAG,WAA9B;;AAEA,MAAI,IAAI,CAAC,GAAL,CAAS,OAAO,CAAC,OAAjB,IAA4B,QAAQ,GAAG,IAAI,CAAC,GAAL,CAAS,OAAO,CAAC,OAAjB,CAA3C,EAAsE;AACpE,IAAA,OAAO,CAAC,IAAR,IAAiB,SAAS,GAAG,WAAW,GAAG,WAA3C,IAA2D,OAAO,CAAC,IAAR,CAAa,OAAb,CAA3D;AACA,IAAA,OAAO,CAAC,KAAR,IAAkB,SAAS,GAAG,WAAW,GAAG,WAA5C,IAA4D,OAAO,CAAC,KAAR,CAAc,OAAd,CAA5D;AACD;;AAED,MAAI,IAAI,CAAC,GAAL,CAAS,OAAO,CAAC,OAAjB,IAA4B,QAAQ,GAAG,IAAI,CAAC,GAAL,CAAS,OAAO,CAAC,OAAjB,CAA3C,EAAsE;AACpE,IAAA,OAAO,CAAC,EAAR,IAAe,SAAS,GAAG,WAAW,GAAG,WAAzC,IAAyD,OAAO,CAAC,EAAR,CAAW,OAAX,CAAzD;AACA,IAAA,OAAO,CAAC,IAAR,IAAiB,SAA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AT,CAA/B;AACA,EAAA,MAAM,CAAC,cAAP,GAAwB,MAAM,CAAC,MAAM,CAAC,cAAR,CAA9B;AACA,EAAA,MAAM,CAAC,cAAP,CAAuB,KAAK,CAAC,OAAN,CAAe,IAAtC,IAA8C,QAA9C;AAEA,qBAAK,QAAL,EAAe,OAAf,CAAuB,UAAA,SAAS,EAAG;AACjC,IAAA,MAAM,CAAC,gBAAP,CAAwB,SAAxB,EAAmC,QAAQ,CAAC,SAAD,CAA3C,EAAyE,OAAzE;AACD,GAFD;AAGD;;AAED,SAAS,MAAT,CAAiB,EAAjB,EAAkC,OAAlC,EAAgE,KAAhE,EAA4E;AAC1E,MAAM,MAAM,GAAG,OAAO,CAAC,KAAR,CAAe,MAAf,GAAwB,EAAE,CAAC,aAA3B,GAA2C,EAA1D;AACA,MAAI,CAAC,MAAD,IAAW,CAAC,MAAM,CAAC,cAAvB,EAAuC;AAEvC,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAP,CAAsB,KAAK,CAAC,OAAN,CAAe,IAArC,CAAjB;AACA,qBAAK,QAAL,EAAe,OAAf,CAAuB,UAAA,SAAS,EAAG;AACjC,IAAA,MAAM,CAAC,mBAAP,CAA2B,SAA3B,EAAsC,QAAQ,CAAC,SAAD,CAA9C;AACD,GAFD;AAGA,SAAO,MAAM,CAAC,cAAP,CAAsB,KAAK,CAAC,OAAN,CAAe,IAArC,CAAP;AACD;;AAEM,IAAM,KAAK,GAAG;AACnB,EAAA,QAAQ,EAAR,QADmB;AAEnB,EAAA,MAAM,EAAN;AAFmB,CAAd;;eAKQ,K","sourcesContent":["import { VNodeDirective, VNode } from 'vue/types/vnode'\nimport { keys } from '../../util/helpers'\n\nexport interface TouchStoredHandlers {\n touchstart: (e: TouchEvent) => void\n touchend: (e: TouchEvent) => void\n touchmove: (e: TouchEvent) => void\n}\n\ninterface TouchHandlers {\n start?: (wrapperEvent: TouchEvent & TouchWrapper) => void\n end?: (wrapperEvent: TouchEvent & TouchWrapper) => void\n move?: (wrapperEvent: TouchEvent & TouchWrapper) => void\n left?: (wrapper: TouchWrapper) => void\n right?: (wrapper: TouchWrapper) => void\n up?: (wrapper: TouchWrapper) => void\n down?: (wrapper: TouchWrapper) => void\n}\n\nexport interface TouchWrapper extends TouchHandlers {\n touchstartX: number\n touchstartY: number\n touchmoveX: number\n touchmoveY: number\n touchendX: number\n touchendY: number\n offsetX: number\n offsetY: number\n}\n\ninterface TouchVNodeDirective extends VNodeDirective {\n value?: TouchHandlers & {\n parent?: boolean\n options?: AddEventListenerOptions\n }\n}\n\nconst handleGesture = (wrapper: TouchWrapper) => {\n const { touchstartX, touchendX, touchstartY, touchendY } = wrapper\n const dirRatio = 0.5\n const minDistance = 16\n wrapper.offsetX = touchendX - touchstartX\n wrapper.offsetY = touchendY - touchstartY\n\n if (Math.abs(wrapper.offsetY) < dirRatio * Math.abs(wrapper.offsetX)) {\n wrapper.left && (touchendX < touchstartX - minDistance) && wrapper.left(wrapper)\n wrapper.right && (touchendX > touchstartX + minDistance) && wrapper.right(wrapper)\n }\n\n if (Math.abs(wrapper.offsetX) < dirRatio * Math.abs(wrapper.offsetY)) {\n wrapper.up && (touchendY < touchstartY - minDistance) && wrapper.up(wrapper)\n wrapper.down && (touchendY > touchstartY + minDistance) && wrapper.down(wrapper)\n }\n}\n\nfunction touchstart (event: TouchEvent, wrapper: TouchWrapper) {\n const touch = event.changedTouches[0]\n wrapper.touchstartX = touch.clientX\n wrapper.touchstartY = touch.clientY\n\n wrapper.start &&\n wrapper.start(Object.assign(event, wrapper))\n}\n\nfunction touchend (event: TouchEvent, wrapper: TouchWrapper) {\n const touch = event.changedTouches[0]\n wrapper.touchendX = touch.clientX\n wrapper.touchendY = touch.clientY\n\n wrapper.end &&\n wrapper.end(Object.assign(event, wrapper))\n\n handleGesture(wrapper)\n}\n\nfunction touchmove (event: TouchEvent, wrapper: TouchWrapper) {\n const touch = event.changedTouches[0]\n wrapper.touchmoveX = touch.clientX\n wrapper.touchmoveY = touch.clientY\n\n wrapper.move && wrapper.move(Object.assign(event, wrapper))\n}\n\nfunction createHandlers (value: TouchHandlers): TouchStoredHandlers {\n const wrapper = {\n touchstartX: 0,\n touchstartY: 0,\n touchendX: 0,\n touchendY: 0,\n touchmoveX: 0,\n touchmoveY: 0,\n offsetX: 0,\n offsetY: 0,\n left: value.left,\n right: value.right,\n up: value.up,\n down: value.down,\n start: value.start,\n move: value.move,\n end: value.end,\n }\n\n return {\n touchstart: (e: TouchEvent) => touchstart(e, wrapper),\n touchend: (e: TouchEvent) => touchend(e, wrapper),\n touchmove: (e: TouchEvent) => touchmove(e, wrapper),\n }\n}\n\nfunction inserted (el: HTMLElement, binding: TouchVNodeDirective, vnode: VNode) {\n const value = binding.value!\n const target = value.parent ? el.parentElement : el\n const options = value.options || { passive: true }\n\n // Needed to pass unit tests\n if (!target) return\n\n const handlers = createHandlers(binding.value!)\n target._touchHandlers = Object(target._touchHandlers)\n target._touchHandlers![vnode.context!._uid] = handlers\n\n keys(handlers).forEach(eventName => {\n target.addEventListener(eventName, handlers[eventName] as EventListener, options)\n })\n}\n\nfunction unbind (el: HTMLElement, binding: TouchVNodeDirective, vnode: VNode) {\n const target = binding.value!.parent ? el.parentElement : el\n if (!target || !target._touchHandlers) return\n\n const handlers = target._touchHandlers[vnode.context!._uid]\n keys(handlers).forEach(eventName => {\n target.removeEventListener(eventName, handlers[eventName])\n })\n delete target._touchHandlers[vnode.context!._uid]\n}\n\nexport const Touch = {\n inserted,\n unbind,\n}\n\nexport default Touch\n"],"sourceRoot":"","file":"index.js"}