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D;AACD;AAjCM;AAJI,C","sourcesContent":["/**\n * Menu position\n *\n * @mixin\n *\n * Used for calculating an automatic position (used for VSelect)\n * Will position the VMenu content properly over the VSelect\n */\n/* @vue/component */\nexport default {\n data: () => ({\n calculatedTopAuto: 0\n }),\n methods: {\n calcScrollPosition () {\n const $el = this.$refs.content\n const activeTile = $el.querySelector('.v-list__tile--active')\n const maxScrollTop = $el.scrollHeight - $el.offsetHeight\n\n return activeTile\n ? Math.min(maxScrollTop, Math.max(0, activeTile.offsetTop - $el.offsetHeight / 2 + activeTile.offsetHeight / 2))\n : $el.scrollTop\n },\n calcLeftAuto () {\n if (this.isAttached) return 0\n\n return parseInt(this.dimensions.activator.left - this.defaultOffset * 2)\n },\n calcTopAuto () {\n const $el = this.$refs.content\n const activeTile = $el.querySelector('.v-list__tile--active')\n\n if (!activeTile) {\n this.selectedIndex = null\n }\n\n if (this.offsetY || !activeTile) {\n return this.computedTop\n }\n\n this.selectedIndex = Array.from(this.tiles).indexOf(activeTile)\n\n const tileDistanceFromMenuTop = activeTile.offsetTop - this.calcScrollPosition()\n const firstTileOffsetTop = $el.querySelector('.v-list__tile').offsetTop\n\n return this.computedTop - tileDistanceFromMenuTop - firstTileOffsetTop\n }\n }\n}\n"],"sourceRoot":""}