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FX;AAIA,iBAAK,aAAL,GAAqB,KAAK,aAAL,GAAqB,KAAK,cAA/C;AAEA,iBAAK,cAAL,GAAsB,KAAK,aAA3B;AACD,SAdM;AAeP,yBAfO,+BAeU;AACf,mBAAO,KAAK,cAAL,IAAuB,KAAK,YAA5B,GACH,CADG,GAEH,KAAK,cAFT;AAGD;AAnBM,KAvLF;AA6MP,UA7MO,kBA6MC,CA7MD,EA6ME;AACP,aAAK,UAAL,GAAkB,KAAK,QAAL,IAAiB,CAAC,CAAC,KAAK,MAAL,CAAY,SAAjD;AAEA,YAAM,WAAW,EAAjB;AACA,YAAM,OAAO,KAAK,kBAAL,CAAwB,KAAK,KAA7B,EAAoC;AAC/C,qBAAS,KAAK,OADiC;AAE/C,mBAAO,KAAK,MAFmC;AAG/C,gBAAI,KAAK;AAHsC,SAApC,CAAb;AAMA,aAAK,UAAL,GAAkB,CAAC;AACjB,iBAAK,KAAK,YADO;AAEjB,kBAAM,QAFW;AAGjB,mBAAO,KAAK;AAHK,SAAD,CAAlB;AAMA,iBAAS,IAAT,CAAc,EAAE,KAAF,EAAS;AACrB,yBAAa,oBADQ;AAErB,mBAAO,EAAE,QAAW,KAAK,qBAAhB,OAAF,EAFc;AAGrB,iBAAK;AAHgB,SAAT,EAIX,KAAK,MAAL,CAAY,OAJD,CAAd;AAMA,YAAI,KAAK,UAAT,EAAqB;AACnB,qBAAS,IAAT,CAAc,EAAE,KAAF,EAAS;AACrB,6BAAa,sBADQ;AAErB,uBAAO,EAAE,QAAW,KAAK,uBAAhB,OAAF;AAFc,aAAT,EAGX,KAAK,MAAL,CAAY,SAHD,CAAd;AAID;AAED,eAAO,EAAE,KAAF,EAAS,IAAT,EAAe,QAAf,CAAP;AACD;AA3OM,CAZM,CAAf","sourcesContent":["// Styles\nimport '../../stylus/components/_toolbar.styl'\n\n// Mixins\nimport Applicationable from '../../mixins/applicationable'\nimport Colorable from '../../mixins/colorable'\nimport Themeable from '../../mixins/themeable'\nimport SSRBootable from '../../mixins/ssr-bootable'\n\n// Directives\nimport Scroll from '../../directives/scroll'\nimport { deprecate } from '../../util/console'\n\n// Types\nimport mixins from '../../util/mixins'\nimport { VNode } from 'vue'\n\nexport default mixins(\n Applicationable('top', [\n 'clippedLeft',\n 'clippedRight',\n 'computedHeight',\n 'invertedScroll',\n 'manualScroll'\n ]),\n Colorable,\n SSRBootable,\n Themeable\n/* @vue/component */\n).extend({\n name: 'v-toolbar',\n\n directives: { Scroll },\n\n props: {\n card: Boolean,\n clippedLeft: Boolean,\n clippedRight: Boolean,\n dense: Boolean,\n extended: Boolean,\n extensionHeight: {\n type: [Number, String],\n validator: (v: any) => !isNaN(parseInt(v))\n },\n flat: Boolean,\n floating: Boolean,\n height: {\n type: [Number, String],\n validator: (v: any) => !isNaN(parseInt(v))\n },\n invertedScroll: Boolean,\n manualScroll: Boolean,\n prominent: Boolean,\n scrollOffScreen: Boolean,\n /* @deprecated */\n scrollToolbarOffScreen: Boolean,\n scrollTarget: String,\n scrollThreshold: {\n type: Number,\n default: 300\n },\n tabs: Boolean\n },\n\n data: () => ({\n activeTimeout: null,\n currentScroll: 0,\n heights: {\n mobileLandscape: 48,\n mobile: 56,\n desktop: 64,\n dense: 48\n },\n isActive: true,\n isExtended: false,\n isScrollingUp: false,\n previousScroll: 0,\n savedScroll: 0,\n target: null as Element | null\n }),\n\n computed: {\n canScroll (): boolean {\n // TODO: remove\n if (this.scrollToolbarOffScreen) {\n deprecate('scrollToolbarOffScreen', 'scrollOffScreen', this)\n\n return true\n }\n\n return this.scrollOffScreen || this.invertedScroll\n },\n computedContentHeight (): number {\n if (this.height) return parseInt(this.height)\n if (this.dense) return this.heights.dense\n\n if (this.prominent ||\n this.$vuetify.breakpoint.mdAndUp\n ) return this.heights.desktop\n\n if (this.$vuetify.breakpoint.smAndDown &&\n this.$vuetify.breakpoint.width >\n this.$vuetify.breakpoint.height\n ) return this.heights.mobileLandscape\n\n return this.heights.mobile\n },\n computedExtensionHeight (): number {\n if (this.tabs) return 48\n if (this.extensionHeight) return parseInt(this.extensionHeight)\n\n return this.computedContentHeight\n },\n computedHeight (): number {\n if (!this.isExtended) return this.computedContentHeight\n\n return this.computedContentHeight + this.computedExtensionHeight\n },\n computedMarginTop (): number {\n if (!this.app) return 0\n\n return this.$vuetify.application.bar\n },\n classes (): object {\n return {\n 'v-toolbar': true,\n 'elevation-0': this.flat || (\n !this.isActive &&\n !this.tabs &&\n this.canScroll\n ),\n 'v-toolbar--absolute': this.absolute,\n 'v-toolbar--card': this.card,\n 'v-toolbar--clipped': this.clippedLeft || this.clippedRight,\n 'v-toolbar--dense': this.dense,\n 'v-toolbar--extended': this.isExtended,\n 'v-toolbar--fixed': !this.absolute && (this.app || this.fixed),\n 'v-toolbar--floating': this.floating,\n 'v-toolbar--prominent': this.prominent,\n ...this.themeClasses\n }\n },\n computedPaddingLeft (): number {\n if (!this.app || this.clippedLeft) return 0\n\n return this.$vuetify.application.left\n },\n computedPaddingRight (): number {\n if (!this.app || this.clippedRight) return 0\n\n return this.$vuetify.application.right\n },\n computedTransform (): number {\n return !this.isActive\n ? this.canScroll\n ? -this.computedContentHeight\n : -this.computedHeight\n : 0\n },\n currentThreshold (): number {\n return Math.abs(this.currentScroll - this.savedScroll)\n },\n styles (): object {\n return {\n marginTop: `${this.computedMarginTop}px`,\n paddingRight: `${this.computedPaddingRight}px`,\n paddingLeft: `${this.computedPaddingLeft}px`,\n transform: `translateY(${this.computedTransform}px)`\n }\n }\n },\n\n watch: {\n currentThreshold (val: number) {\n if (this.invertedScroll) {\n this.isActive = this.currentScroll > this.scrollThreshold\n return\n }\n\n if (val < this.scrollThreshold ||\n !this.isBooted\n ) return\n\n this.isActive = this.isScrollingUp\n this.savedScroll = this.currentScroll\n },\n isActive () {\n this.savedScroll = 0\n },\n invertedScroll (val: boolean) {\n this.isActive = !val\n },\n manualScroll (val: boolean) {\n this.isActive = !val\n },\n isScrollingUp () {\n this.savedScroll = this.savedScroll || this.currentScroll\n }\n },\n\n created () {\n if (this.invertedScroll ||\n this.manualScroll\n ) this.isActive = false\n },\n\n mounted () {\n if (this.scrollTarget) {\n this.target = document.querySelector(this.scrollTarget)\n }\n },\n\n methods: {\n onScroll () {\n if (!this.canScroll ||\n this.manualScroll ||\n typeof window === 'undefined'\n ) return\n\n this.currentScroll = this.target\n ? this.target.scrollTop\n : window.pageYOffset\n\n this.isScrollingUp = this.currentScroll < this.previousScroll\n\n this.previousScroll = this.currentScroll\n },\n updateApplication (): number {\n return this.invertedScroll || this.manualScroll\n ? 0\n : this.computedHeight\n }\n },\n\n render (h): VNode {\n this.isExtended = this.extended || !!this.$slots.extension\n\n const children = []\n const data = this.setBackgroundColor(this.color, {\n 'class': this.classes,\n style: this.styles,\n on: this.$listeners\n })\n\n data.directives = [{\n arg: this.scrollTarget,\n name: 'scroll',\n value: this.onScroll\n }]\n\n children.push(h('div', {\n staticClass: 'v-toolbar__content',\n style: { height: `${this.computedContentHeight}px` },\n ref: 'content'\n }, this.$slots.default))\n\n if (this.isExtended) {\n children.push(h('div', {\n staticClass: 'v-toolbar__extension',\n style: { height: `${this.computedExtensionHeight}px` }\n }, this.$slots.extension))\n }\n\n return h('nav', data, children)\n }\n})\n"],"sourceRoot":""}
|