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AED,mBAAO,KAAK,GAAL,aAAY,GAAZ,CAAP;AACD;AAnBM;AA9BiC,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 stackClass: 'unpecified',\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 = [...document.getElementsByClassName(this.stackClass)]\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":""}
|