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,sBAAT,CAAgC,2BAAhC,CAFkB,CAAvB,CARmC,CAanC;;AACA,WAAK,IAAI,KAAK,GAAG,CAAjB,EAAoB,KAAK,GAAG,cAAc,CAAC,MAA3C,EAAmD,KAAK,EAAxD,EAA4D;AAC1D,YAAI,CAAC,OAAO,CAAC,QAAR,CAAiB,cAAc,CAAC,KAAD,CAA/B,CAAL,EAA8C;AAC5C,UAAA,GAAG,CAAC,IAAJ,CAAS,SAAS,CAAC,cAAc,CAAC,KAAD,CAAf,CAAlB;AACD;AACF;;AAED,aAAO,IAAI,CAAC,GAAL,CAAS,GAAG,GAAZ,CAAP;AACD;;AAtBM;AA7BiC,CAA7B,CAAf","sourcesContent":["import Vue from 'vue'\n\nimport { getZIndex } from '../../util/helpers'\n\ninterface options extends Vue {\n $refs: {\n content: Element\n }\n}\n\n/* @vue/component */\nexport default Vue.extend<options>().extend({\n name: 'stackable',\n\n data () {\n return {\n stackElement: null as Element | null,\n stackExclude: null as Element[] | null,\n stackMinZIndex: 0,\n isActive: false,\n }\n },\n computed: {\n activeZIndex (): number {\n if (typeof window === 'undefined') return 0\n\n const content = this.stackElement || this.$refs.content\n // Return current zindex if not active\n\n const index = !this.isActive\n ? getZIndex(content)\n : this.getMaxZIndex(this.stackExclude || [content]) + 2\n\n if (index == null) return index\n\n // Return max current z-index (excluding self) + 2\n // (2 to leave room for an overlay below, if needed)\n return parseInt(index)\n },\n },\n methods: {\n getMaxZIndex (exclude: Element[] = []) {\n const base = this.$el\n // Start with lowest allowed z-index or z-index of\n // base component's element, whichever is greater\n const zis = [this.stackMinZIndex, getZIndex(base)]\n // Convert the NodeList to an array to\n // prevent an Edge bug with Symbol.iterator\n // https://github.com/vuetifyjs/vuetify/issues/2146\n const activeElements = [\n ...document.getElementsByClassName('v-menu__content--active'),\n ...document.getElementsByClassName('v-dialog__content--active'),\n ]\n\n // Get z-index for all active dialogs\n for (let index = 0; index < activeElements.length; index++) {\n if (!exclude.includes(activeElements[index])) {\n zis.push(getZIndex(activeElements[index]))\n }\n }\n\n return Math.max(...zis)\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"} |