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/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":";;;;;;;AACA;;AAGA;;AAGA;;;;AAPA;AAGA;AAGA;;AAmBA;eACe,aAAI,MAAJ,GAAqD,MAArD,CAA4D;AACzE,EAAA,IAAI,EAAE,aADmE;AAGzE,EAAA,KAAK,EAAE;AACL,IAAA,WAAW,EAAE;AADR,GAHkE;AAOzE,EAAA,IAPyE,kBAOrE;AACF,WAAO;AACL,MAAA,OAAO,EAAE;AADJ,KAAP;AAGD,GAXwE;AAazE,EAAA,KAAK,EAAE;AACL,IAAA,WADK,uBACQ,KADR,EACa;AAChB,UAAI,KAAJ,EAAW,KAAK,aAAL,GAAX,KACK,KAAK,UAAL;AACN;AAJI,GAbkE;AAoBzE,EAAA,aApByE,2BAoB5D;AACX,SAAK,aAAL;AACD,GAtBwE;AAwBzE,EAAA,OAAO,EAAE;AACP,IAAA,aADO,2BACM;AACX,UAAM,OAAO,GAAG,IAAI,iBAAJ,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,UAAM,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,OAAL,GAAe,OAAf;AACD,KAlBM;AAmBP,IAAA,UAnBO,wBAmBG;AAAA;;AACR,WAAK,UAAL;AAEA,UAAI,KAAK,WAAT,EAAsB;AAE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A2B,OAA3B,EAAoC,KAAK,cAAzC;AACA,MAAA,MAAM,CAAC,mBAAP,CAA2B,SAA3B,EAAsC,KAAK,cAA3C;AACD;AAnKM;AAxBgE,CAA5D,C","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"}