This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/es5/components/VImg/VImg.js.map
2019-08-11 20:48:02 +02:00

1 line
No EOL
12 KiB
Text

{"version":3,"sources":["../../../src/components/VImg/VImg.ts"],"names":[],"mappings":";;;;;;;AAAA;;AAOA;;AAGA;;;;AAJA;AAGA;;AAWA;eACe,qBAAY,MAAZ,CAAmB;AAChC,EAAA,IAAI,EAAE,OAD0B;AAGhC,EAAA,KAAK,EAAE;AACL,IAAA,GAAG,EAAE,MADA;AAEL,IAAA,OAAO,EAAE,OAFJ;AAGL,IAAA,QAAQ,EAAE,MAHL;AAIL,IAAA,OAAO,EAAE,MAJJ;AAKL,IAAA,QAAQ,EAAE;AACR,MAAA,IAAI,EAAE,MADE;AAER,MAAA,OAAO,EAAE;AAFD,KALL;AASL,IAAA,KAAK,EAAE,MATF;AAUL,IAAA,GAAG,EAAE;AACH,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADH;AAEH,MAAA,OAAO,EAAE;AAFN,KAVA;AAcL,IAAA,MAAM,EAAE,MAdH;AAeL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,CAAC,OAAD,EAAU,MAAV,CADI;AAEV,MAAA,OAAO,EAAE;AAFC;AAfP,GAHyB;AAwBhC,EAAA,IAxBgC,kBAwB5B;AACF,WAAO;AACL,MAAA,UAAU,EAAE,EADP;AAEL,MAAA,KAAK,EAAE,IAFF;AAGL,MAAA,SAAS,EAAE,IAHN;AAIL,MAAA,qBAAqB,EAAE,SAJlB;AAKL,MAAA,YAAY,EAAE;AALT,KAAP;AAOD,GAhC+B;AAkChC,EAAA,QAAQ,EAAE;AACR,IAAA,mBADQ,iCACW;AACjB,aAAO,MAAM,CAAC,KAAK,aAAL,CAAmB,MAAnB,IAA6B,KAAK,qBAAnC,CAAb;AACD,KAHO;AAIR,IAAA,aAJQ,2BAIK;AACX,aAAO,OAAO,KAAK,GAAZ,K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AAI,EAAE,KAAK,GAAL,GAAW,KAAX,GAAmB,SADR;AAEjB,oBAAc,KAAK;AAFF,KAAnB;AAKA,IAAA,IAAI,CAAC,QAAL,GAAgB,CACd,KAAK,aADS,EAEd,KAAK,aAFS,EAGd,KAAK,gBAAL,EAHc,EAId,KAAK,UAAL,EAJc,CAAhB;AAOA,WAAO,CAAC,CAAC,IAAI,CAAC,GAAN,EAAW,IAAI,CAAC,IAAhB,EAAsB,IAAI,CAAC,QAA3B,CAAR;AACD;AApN+B,CAAnB,C","sourcesContent":["import './VImg.sass'\n\n// Types\nimport { VNode } from 'vue'\nimport { PropValidator } from 'vue/types/options'\n\n// Components\nimport VResponsive from '../VResponsive'\n\n// Utils\nimport { consoleError, consoleWarn } from '../../util/console'\n\n// not intended for public use, this is passed in by vuetify-loader\nexport interface srcObject {\n src: string\n srcset?: string\n lazySrc: string\n aspect: number\n}\n\n/* @vue/component */\nexport default VResponsive.extend({\n name: 'v-img',\n\n props: {\n alt: String,\n contain: Boolean,\n gradient: String,\n lazySrc: String,\n position: {\n type: String,\n default: 'center center',\n },\n sizes: String,\n src: {\n type: [String, Object],\n default: '',\n } as PropValidator<string | srcObject>,\n srcset: String,\n transition: {\n type: [Boolean, String],\n default: 'fade-transition',\n },\n },\n\n data () {\n return {\n currentSrc: '', // Set from srcset\n image: null as HTMLImageElement | null,\n isLoading: true,\n calculatedAspectRatio: undefined as number | undefined,\n naturalWidth: undefined as number | undefined,\n }\n },\n\n computed: {\n computedAspectRatio (): number {\n return Number(this.normalisedSrc.aspect || this.calculatedAspectRatio)\n },\n normalisedSrc (): srcObject {\n return typeof this.src === 'string'\n ? {\n src: this.src,\n srcset: this.srcset,\n lazySrc: this.lazySrc,\n aspect: Number(this.aspectRatio),\n } : {\n src: this.src.src,\n srcset: this.srcset || this.src.srcset,\n lazySrc: this.lazySrc || this.src.lazySrc,\n aspect: Number(this.aspectRatio || this.src.aspect),\n }\n },\n __cachedImage (): VNode | [] {\n if (!(this.normalisedSrc.src || this.normalisedSrc.lazySrc)) return []\n\n const backgroundImage: string[] = []\n const src = this.isLoading ? this.normalisedSrc.lazySrc : this.currentSrc\n\n if (this.gradient) backgroundImage.push(`linear-gradient(${this.gradient})`)\n if (src) backgroundImage.push(`url(\"${src}\")`)\n\n const image = this.$createElement('div', {\n staticClass: 'v-image__image',\n class: {\n 'v-image__image--preload': this.isLoading,\n 'v-image__image--contain': this.contain,\n 'v-image__image--cover': !this.contain,\n },\n style: {\n backgroundImage: backgroundImage.join(', '),\n backgroundPosition: this.position,\n },\n key: +this.isLoading,\n })\n\n if (!this.transition) return image\n\n return this.$createElement('transition', {\n attrs: {\n name: this.transition,\n mode: 'in-out',\n },\n }, [image])\n },\n },\n\n watch: {\n src () {\n if (!this.isLoading) this.init()\n else this.loadImage()\n },\n '$vuetify.breakpoint.width': 'getSrc',\n },\n\n mounted () {\n this.init()\n },\n\n methods: {\n init () {\n if (this.normalisedSrc.lazySrc) {\n const lazyImg = new Image()\n lazyImg.src = this.normalisedSrc.lazySrc\n this.pollForSize(lazyImg, null)\n }\n /* istanbul ignore else */\n if (this.normalisedSrc.src) this.loadImage()\n },\n onLoad () {\n this.getSrc()\n this.isLoading = false\n this.$emit('load', this.src)\n },\n onError () {\n consoleError(\n `Image load failed\\n\\n` +\n `src: ${this.normalisedSrc.src}`,\n this\n )\n this.$emit('error', this.src)\n },\n getSrc () {\n /* istanbul ignore else */\n if (this.image) this.currentSrc = this.image.currentSrc || this.image.src\n },\n loadImage () {\n const image = new Image()\n this.image = image\n\n image.onload = () => {\n /* istanbul ignore if */\n if (image.decode) {\n image.decode().catch((err: DOMException) => {\n consoleWarn(\n `Failed to decode image, trying to render anyway\\n\\n` +\n `src: ${this.normalisedSrc.src}` +\n (err.message ? `\\nOriginal error: ${err.message}` : ''),\n this\n )\n }).then(this.onLoad)\n } else {\n this.onLoad()\n }\n }\n image.onerror = this.onError\n\n image.src = this.normalisedSrc.src\n this.sizes && (image.sizes = this.sizes)\n this.normalisedSrc.srcset && (image.srcset = this.normalisedSrc.srcset)\n\n this.aspectRatio || this.pollForSize(image)\n this.getSrc()\n },\n pollForSize (img: HTMLImageElement, timeout: number | null = 100) {\n const poll = () => {\n const { naturalHeight, naturalWidth } = img\n\n if (naturalHeight || naturalWidth) {\n this.naturalWidth = naturalWidth\n this.calculatedAspectRatio = naturalWidth / naturalHeight\n } else {\n timeout != null && setTimeout(poll, timeout)\n }\n }\n\n poll()\n },\n genContent () {\n const content: VNode = VResponsive.options.methods.genContent.call(this)\n if (this.naturalWidth) {\n this._b(content.data!, 'div', {\n style: { width: `${this.naturalWidth}px` },\n })\n }\n\n return content\n },\n __genPlaceholder (): VNode | void {\n if (this.$slots.placeholder) {\n const placeholder = this.isLoading\n ? [this.$createElement('div', {\n staticClass: 'v-image__placeholder',\n }, this.$slots.placeholder)]\n : []\n\n if (!this.transition) return placeholder[0]\n\n return this.$createElement('transition', {\n attrs: { name: this.transition },\n }, placeholder)\n }\n },\n },\n\n render (h): VNode {\n const node = VResponsive.options.render.call(this, h)\n\n node.data!.staticClass += ' v-image'\n\n node.data!.attrs = {\n role: this.alt ? 'img' : undefined,\n 'aria-label': this.alt,\n }\n\n node.children = [\n this.__cachedSizer,\n this.__cachedImage,\n this.__genPlaceholder(),\n this.genContent(),\n ] as VNode[]\n\n return h(node.tag, node.data, node.children)\n },\n})\n"],"sourceRoot":"","file":"VImg.js"}