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KAAK,aAArB;AACD;;AAED,WAAK,WAAL,GAAmB,KAAK,aAAxB;AACD;AA5BM,GAlLsB;AAiN/B,EAAA,MAjN+B,kBAiNvB,CAjNuB,EAiNtB;AACP,QAAM,MAAM,GAAG,kBAAS,OAAT,CAAiB,MAAjB,CAAwB,IAAxB,CAA6B,IAA7B,EAAmC,CAAnC,CAAf;;AAEA,IAAA,MAAM,CAAC,IAAP,GAAc,MAAM,CAAC,IAAP,IAAe,EAA7B;;AAEA,QAAI,KAAK,SAAT,EAAoB;AAClB,MAAA,MAAM,CAAC,IAAP,CAAY,UAAZ,GAAyB,MAAM,CAAC,IAAP,CAAY,UAAZ,IAA0B,EAAnD;AACA,MAAA,MAAM,CAAC,IAAP,CAAY,UAAZ,CAAuB,IAAvB,CAA4B;AAC1B,QAAA,GAAG,EAAE,KAAK,YADgB;AAE1B,QAAA,IAAI,EAAE,QAFoB;AAG1B,QAAA,KAAK,EAAE,KAAK;AAHc,OAA5B;AAKD;;AAED,WAAO,MAAP;AACD;AAhO8B,CAAlB,C","sourcesContent":["// Styles\nimport './VAppBar.sass'\n\n// Extensions\nimport VToolbar from '../VToolbar/VToolbar'\n\n// Directives\nimport Scroll from '../../directives/scroll'\n\n// Mixins\nimport Applicationable from '../../mixins/applicationable'\nimport Scrollable from '../../mixins/scrollable'\nimport SSRBootable from '../../mixins/ssr-bootable'\nimport Toggleable from '../../mixins/toggleable'\n\n// Utilities\nimport { convertToUnit } from '../../util/helpers'\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\n\nconst baseMixins = mixins(\n VToolbar,\n Scrollable,\n SSRBootable,\n Toggleable,\n Applicationable('top', [\n 'clippedLeft',\n 'clippedRight',\n 'computedHeight',\n 'computedTransform',\n 'invertedScroll',\n 'isExtended',\n 'isProminent',\n 'value',\n ])\n)\n\n/* @vue/component */\nexport default baseMixins.extend({\n name: 'v-app-bar',\n\n directives: { Scroll },\n\n props: {\n clippedLeft: Boolean,\n clippedRight: Boolean,\n collapseOnScroll: Boolean,\n elevateOnScroll: Boolean,\n fadeImgOnScroll: Boolean,\n hideOnScroll: Boolean,\n invertedScroll: Boolean,\n scrollOffScreen: Boolean,\n shrinkOnScroll: Boolean,\n value: {\n type: Boolean,\n default: true,\n },\n },\n\n data () {\n return {\n isActive: this.value,\n }\n },\n\n computed: {\n applicationProperty (): string {\n return !this.bottom ? 'top' : 'bottom'\n },\n canScroll (): boolean {\n return (\n Scrollable.options.computed.canScroll.call(this) &&\n (\n this.invertedScroll ||\n this.elevateOnScroll ||\n this.hideOnScroll ||\n this.collapseOnScroll ||\n this.isBooted ||\n // If falsey, user has provided an\n // explicit value which should\n // overwrite anything we do\n !this.value\n )\n )\n },\n classes (): object {\n return {\n ...VToolbar.options.computed.classes.call(this),\n 'v-toolbar--collapse': this.collapse || this.collapseOnScroll,\n 'v-app-bar': true,\n 'v-app-bar--clipped': this.clippedLeft || this.clippedRight,\n 'v-app-bar--fade-img-on-scroll': this.fadeImgOnScroll,\n 'v-app-bar--elevate-on-scroll': this.elevateOnScroll,\n 'v-app-bar--fixed': !this.absolute && (this.app || this.fixed),\n 'v-app-bar--hide-shadow': this.hideShadow,\n 'v-app-bar--is-scrolled': this.currentScroll > 0,\n 'v-app-bar--shrink-on-scroll': this.shrinkOnScroll,\n }\n },\n computedContentHeight (): number {\n if (!this.shrinkOnScroll) return VToolbar.options.computed.computedContentHeight.call(this)\n\n const height = this.computedOriginalHeight\n\n const min = this.dense ? 48 : 56\n const max = height\n const difference = max - min\n const iteration = difference / this.computedScrollThreshold\n const offset = this.currentScroll * iteration\n\n return Math.max(min, max - offset)\n },\n computedFontSize (): number | undefined {\n if (!this.isProminent) return undefined\n\n const max = this.dense ? 96 : 128\n const difference = max - this.computedContentHeight\n const increment = 0.00347\n\n // 1.5rem to a minimum of 1.25rem\n return Number((1.50 - difference * increment).toFixed(2))\n },\n computedLeft (): number {\n if (!this.app || this.clippedLeft) return 0\n\n return this.$vuetify.application.left\n },\n computedMarginTop (): number {\n if (!this.app) return 0\n\n return this.$vuetify.application.bar\n },\n computedOpacity (): number | undefined {\n if (!this.fadeImgOnScroll) return undefined\n\n const opacity = Math.max(\n (this.computedScrollThreshold - this.currentScroll) / this.computedScrollThreshold,\n 0\n )\n\n return Number(parseFloat(opacity).toFixed(2))\n },\n computedOriginalHeight (): number {\n let height = VToolbar.options.computed.computedContentHeight.call(this)\n if (this.isExtended) height += parseInt(this.extensionHeight)\n return height\n },\n computedRight (): number {\n if (!this.app || this.clippedRight) return 0\n\n return this.$vuetify.application.right\n },\n computedScrollThreshold (): number {\n if (this.scrollThreshold) return Number(this.scrollThreshold)\n\n return this.computedOriginalHeight - (this.dense ? 48 : 56)\n },\n computedTransform (): number {\n if (\n !this.canScroll ||\n (this.elevateOnScroll && this.currentScroll === 0)\n ) return 0\n\n if (this.isActive) return 0\n\n return this.scrollOffScreen\n ? -this.computedHeight\n : -this.computedContentHeight\n },\n hideShadow (): boolean {\n if (this.elevateOnScroll) {\n return this.currentScroll === 0 ||\n this.computedTransform < 0\n }\n\n return (\n !this.isExtended ||\n this.scrollOffScreen\n ) && this.computedTransform !== 0\n },\n isCollapsed (): boolean {\n if (!this.collapseOnScroll) {\n return VToolbar.options.computed.isCollapsed.call(this)\n }\n\n return this.currentScroll > 0\n },\n isProminent (): boolean {\n return (\n VToolbar.options.computed.isProminent.call(this) ||\n this.shrinkOnScroll\n )\n },\n styles (): object {\n return {\n ...VToolbar.options.computed.styles.call(this),\n fontSize: convertToUnit(this.computedFontSize, 'rem'),\n marginTop: convertToUnit(this.computedMarginTop),\n transform: `translateY(${convertToUnit(this.computedTransform)})`,\n left: convertToUnit(this.computedLeft),\n right: convertToUnit(this.computedRight),\n }\n },\n },\n\n watch: {\n canScroll: 'onScroll',\n invertedScroll (val: boolean) {\n this.isActive = !val\n },\n },\n\n created () {\n if (this.invertedScroll) this.isActive = false\n },\n\n methods: {\n genBackground () {\n const render = VToolbar.options.methods.genBackground.call(this)\n\n render.data = this._b(render.data || {}, render.tag!, {\n style: { opacity: this.computedOpacity },\n })\n\n return render\n },\n updateApplication (): number {\n return this.invertedScroll\n ? 0\n : this.computedHeight + this.computedTransform\n },\n thresholdMet () {\n if (this.invertedScroll) {\n this.isActive = this.currentScroll > this.computedScrollThreshold\n return\n }\n\n if (this.currentThreshold < this.computedScrollThreshold) return\n\n if (this.hideOnScroll) {\n this.isActive = this.isScrollingUp\n }\n\n this.savedScroll = this.currentScroll\n },\n },\n\n render (h): VNode {\n const render = VToolbar.options.render.call(this, h)\n\n render.data = render.data || {}\n\n if (this.canScroll) {\n render.data.directives = render.data.directives || []\n render.data.directives.push({\n arg: this.scrollTarget,\n name: 'scroll',\n value: this.onScroll,\n })\n }\n\n return render\n },\n})\n"],"sourceRoot":"","file":"VAppBar.js"} |