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/lib/mixins/overlayable/index.js.map
2019-08-11 20:48:02 +02:00

1 line
No EOL
11 KiB
Text

{"version":3,"sources":["../../../src/mixins/overlayable/index.ts"],"names":[],"mappings":"AAAA;AACA,OAAO,QAAP,MAAqB,2BAArB,C,CAEA;;AACA,SAAS,QAAT,EAAmB,oBAAnB,EAAyC,uBAAzC,QAAwE,oBAAxE,C,CAEA;;AACA,OAAO,GAAP,MAAgB,KAAhB;AAkBA;;AACA,eAAe,GAAG,CAAC,MAAJ,GAAqD,MAArD,CAA4D;AACzE,EAAA,IAAI,EAAE,aADmE;AAGzE,EAAA,KAAK,EAAE;AACL,IAAA,WAAW,EAAE;AADR,GAHkE;;AAOzE,EAAA,IAAI,GAAA;AACF,WAAO;AACL,MAAA,OAAO,EAAE;AADJ,KAAP;AAGD,GAXwE;;AAazE,EAAA,KAAK,EAAE;AACL,IAAA,WAAW,CAAE,KAAF,EAAO;AAChB,UAAI,KAAJ,EAAW,KAAK,aAAL,GAAX,KACK,KAAK,UAAL;AACN;;AAJI,GAbkE;;AAoBzE,EAAA,aAAa,GAAA;AACX,SAAK,aAAL;AACD,GAtBwE;;AAwBzE,EAAA,OAAO,EAAE;AACP,IAAA,aAAa,GAAA;AACX,YAAM,OAAO,GAAG,IAAI,QAAJ,CAAa;AAC3B,QAAA,SAAS,EAAE;AACT,UAAA,QAAQ,EAAE,KAAK,QADN;AAET,UAAA,KAAK,EAAE;AAFE;AADgB,OAAb,CAAhB;AAOA,MAAA,OAAO,CAAC,MAAR;AAEA,YAAM,MAAM,GAAG,KAAK,QAAL,GACX,KAAK,GAAL,CAAS,UADE,GAEX,QAAQ,CAAC,aAAT,CAAuB,YAAvB,CAFJ;AAIA,MAAA,MAAM,IAAI,MAAM,CAAC,YAAP,CAAoB,OAAO,CAAC,GAA5B,EAAiC,MAAM,CAAC,UAAxC,CAAV;AAEA,WAAK,O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C,KAAK,cAAzC;AACA,MAAA,MAAM,CAAC,mBAAP,CAA2B,SAA3B,EAAsC,KAAK,cAA3C;AACD;;AAnKM;AAxBgE,CAA5D,CAAf","sourcesContent":["// Components\nimport VOverlay from '../../components/VOverlay'\n\n// Utilities\nimport { keyCodes, addOnceEventListener, addPassiveEventListener } from '../../util/helpers'\n\n// Types\nimport Vue from 'vue'\n\ninterface Toggleable extends Vue {\n isActive?: boolean\n}\n\ninterface Stackable extends Vue {\n activeZIndex: number\n}\n\ninterface options {\n absolute?: boolean\n $refs: {\n dialog?: HTMLElement\n content?: HTMLElement\n }\n}\n\n/* @vue/component */\nexport default Vue.extend<Vue & Toggleable & Stackable & options>().extend({\n name: 'overlayable',\n\n props: {\n hideOverlay: Boolean,\n },\n\n data () {\n return {\n overlay: null as InstanceType<typeof VOverlay> | null,\n }\n },\n\n watch: {\n hideOverlay (value) {\n if (value) this.removeOverlay()\n else this.genOverlay()\n },\n },\n\n beforeDestroy () {\n this.removeOverlay()\n },\n\n methods: {\n createOverlay () {\n const overlay = new VOverlay({\n propsData: {\n absolute: this.absolute,\n value: false,\n },\n })\n\n overlay.$mount()\n\n const parent = this.absolute\n ? this.$el.parentNode\n : document.querySelector('[data-app]')\n\n parent && parent.insertBefore(overlay.$el, parent.firstChild)\n\n this.overlay = overlay\n },\n genOverlay () {\n this.hideScroll()\n\n if (this.hideOverlay) return\n\n if (!this.overlay) this.createOverlay()\n\n requestAnimationFrame(() => {\n if (!this.overlay) return\n\n if (this.activeZIndex !== undefined) {\n this.overlay.zIndex = String(this.activeZIndex - 1)\n }\n\n this.overlay.value = true\n })\n\n return true\n },\n /** removeOverlay(false) will not restore the scollbar afterwards */\n removeOverlay (showScroll = true) {\n if (this.overlay) {\n addOnceEventListener(this.overlay.$el, 'transitionend', () => {\n if (\n !this.overlay ||\n !this.overlay.$el ||\n !this.overlay.$el.parentNode ||\n this.overlay.value\n ) return\n\n this.overlay.$el.parentNode.removeChild(this.overlay.$el)\n this.overlay.$destroy()\n this.overlay = null\n })\n\n this.overlay.value = false\n }\n\n showScroll && this.showScroll()\n },\n scrollListener (e: WheelEvent & KeyboardEvent) {\n if (e.type === 'keydown') {\n if (\n ['INPUT', 'TEXTAREA', 'SELECT'].includes((e.target as Element).tagName) ||\n // https://github.com/vuetifyjs/vuetify/issues/4715\n (e.target as HTMLElement).isContentEditable\n ) return\n\n const up = [keyCodes.up, keyCodes.pageup]\n const down = [keyCodes.down, keyCodes.pagedown]\n\n if (up.includes(e.keyCode)) {\n (e as any).deltaY = -1\n } else if (down.includes(e.keyCode)) {\n (e as any).deltaY = 1\n } else {\n return\n }\n }\n\n if (e.target === this.overlay ||\n (e.type !== 'keydown' && e.target === document.body) ||\n this.checkPath(e)) e.preventDefault()\n },\n hasScrollbar (el?: Element) {\n if (!el || el.nodeType !== Node.ELEMENT_NODE) return false\n\n const style = window.getComputedStyle(el)\n return ['auto', 'scroll'].includes(style.overflowY!) && el.scrollHeight > el.clientHeight\n },\n shouldScroll (el: Element, delta: number) {\n if (el.scrollTop === 0 && delta < 0) return true\n return el.scrollTop + el.clientHeight === el.scrollHeight && delta > 0\n },\n isInside (el: Element, parent: Element): boolean {\n if (el === parent) {\n return true\n } else if (el === null || el === document.body) {\n return false\n } else {\n return this.isInside(el.parentNode as Element, parent)\n }\n },\n checkPath (e: WheelEvent) {\n const path = e.path || this.composedPath(e)\n const delta = e.deltaY\n\n if (e.type === 'keydown' && path[0] === document.body) {\n const dialog = this.$refs.dialog\n // getSelection returns null in firefox in some edge cases, can be ignored\n const selected = window.getSelection()!.anchorNode as Element\n if (dialog && this.hasScrollbar(dialog) && this.isInside(selected, dialog)) {\n return this.shouldScroll(dialog, delta)\n }\n return true\n }\n\n for (let index = 0; index < path.length; index++) {\n const el = path[index]\n\n if (el === document) return true\n if (el === document.documentElement) return true\n if (el === this.$refs.content) return true\n\n if (this.hasScrollbar(el as Element)) return this.shouldScroll(el as Element, delta)\n }\n\n return true\n },\n /**\n * Polyfill for Event.prototype.composedPath\n */\n composedPath (e: WheelEvent): EventTarget[] {\n if (e.composedPath) return e.composedPath()\n\n const path = []\n let el = e.target as Element\n\n while (el) {\n path.push(el)\n\n if (el.tagName === 'HTML') {\n path.push(document)\n path.push(window)\n\n return path\n }\n\n el = el.parentElement!\n }\n return path\n },\n hideScroll () {\n if (this.$vuetify.breakpoint.smAndDown) {\n document.documentElement!.classList.add('overflow-y-hidden')\n } else {\n addPassiveEventListener(window, 'wheel', this.scrollListener as EventHandlerNonNull, { passive: false })\n window.addEventListener('keydown', this.scrollListener as EventHandlerNonNull)\n }\n },\n showScroll () {\n document.documentElement!.classList.remove('overflow-y-hidden')\n window.removeEventListener('wheel', this.scrollListener as EventHandlerNonNull)\n window.removeEventListener('keydown', this.scrollListener as EventHandlerNonNull)\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}