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/lib/components/VFileInput/VFileInput.js.map
2019-08-11 20:48:02 +02:00

1 line
No EOL
11 KiB
Text

{"version":3,"sources":["../../../src/components/VFileInput/VFileInput.ts"],"names":[],"mappings":"AAAA;AACA,OAAO,oDAAP,C,CAEA;;AACA,OAAO,UAAP,MAAuB,eAAvB,C,CAEA;;AACA,SAAS,KAAT,QAAsB,UAAtB,C,CAKA;;AACA,SAAS,qBAAT,EAAgC,WAAhC,QAAmD,oBAAnD;AAEA,eAAe,UAAU,CAAC,MAAX,CAAkB;AAC/B,EAAA,IAAI,EAAE,cADyB;AAG/B,EAAA,KAAK,EAAE;AACL,IAAA,IAAI,EAAE,OADD;AAEL,IAAA,KAAK,EAAE;AAFF,GAHwB;AAQ/B,EAAA,KAAK,EAAE;AACL,IAAA,KAAK,EAAE,OADF;AAEL,IAAA,SAAS,EAAE;AACT,MAAA,IAAI,EAAE,OADG;AAET,MAAA,OAAO,EAAE;AAFA,KAFN;AAML,IAAA,iBAAiB,EAAE;AACjB,MAAA,IAAI,EAAE,MADW;AAEjB,MAAA,OAAO,EAAE;AAFQ,KANd;AAUL,IAAA,aAAa,EAAE;AACb,MAAA,IAAI,EAAE,MADO;AAEb,MAAA,OAAO,EAAE;AAFI,KAVV;AAcL,IAAA,WAAW,EAAE,MAdR;AAeL,IAAA,WAAW,EAAE;AACX,MAAA,IAAI,EAAE,MADK;AAEX,MAAA,OAAO,EAAE;AAFE,KAfR;AAmBL,IAAA,QAAQ,EAAE;AACR,MAAA,IAAI,EAAE,OADE;AAER,MAAA,OAAO,EAAE;AAFD,KAnBL;AAuBL,IAAA,QAAQ,EAAE;AACR,MAAA,IAAI,EAAE,CAAC,OAAD,EAAU,MAAV,CADE;AAER,MAAA,OAAO,EAAE,KAFD;AAGR,MAAA,SAAS,EAAG,CAAD,IAAwB;AACjC,eACE,OAAO,CAAP,KAAa,SAAb,IAC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AAA,EAAE,EAAE;AACF,UAAA,KAAK,EAAE,MAAM,KAAK,KAAL,CAAW,KAAX,CAAiB,KAAjB;AADX;AAN4B,OAA3B,EASJ,QATI,CAAP;AAUD,KAvEM;;AAwEP,IAAA,OAAO,CAAE,CAAF,EAAU;AACf,YAAM,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,MAAF,CAA8B,KAA9B,IAAuC,EAA3C,CAAD,CAAd;AAEA,WAAK,aAAL,GAAqB,KAAK,UAAL,GAAkB,KAAlB,GAA0B,KAAK,CAAC,CAAD,CAApD;AACD,KA5EM;;AA6EP,IAAA,YAAY,CAAE,GAAF,EAAa;AACvB,UAAI,GAAG,CAAC,MAAJ,GAAa,MAAM,CAAC,KAAK,cAAN,CAAvB,EAA8C,OAAO,GAAP;AAC9C,aAAO,GAAG,GAAG,CAAC,KAAJ,CAAU,CAAV,EAAa,EAAb,CAAgB,IAAI,GAAG,CAAC,KAAJ,CAAU,CAAC,EAAX,CAAc,EAA5C;AACD;;AAhFM;AAxHsB,CAAlB,CAAf","sourcesContent":["// Styles\nimport './VFileInput.sass'\n\n// Extensions\nimport VTextField from '../VTextField'\n\n// Components\nimport { VChip } from '../VChip'\n\n// Types\nimport { PropValidator } from 'vue/types/options'\n\n// Utilities\nimport { humanReadableFileSize, wrapInArray } from '../../util/helpers'\n\nexport default VTextField.extend({\n name: 'v-file-input',\n\n model: {\n prop: 'value',\n event: 'change',\n },\n\n props: {\n chips: Boolean,\n clearable: {\n type: Boolean,\n default: true,\n },\n counterSizeString: {\n type: String,\n default: '$vuetify.fileInput.counterSize',\n },\n counterString: {\n type: String,\n default: '$vuetify.fileInput.counter',\n },\n placeholder: String,\n prependIcon: {\n type: String,\n default: '$vuetify.icons.file',\n },\n readonly: {\n type: Boolean,\n default: true,\n },\n showSize: {\n type: [Boolean, Number],\n default: false,\n validator: (v: boolean | number) => {\n return (\n typeof v === 'boolean' ||\n [1000, 1024].includes(v)\n )\n },\n } as PropValidator<boolean | 1000 | 1024>,\n smallChips: Boolean,\n truncateLength: {\n type: [Number, String],\n default: 22,\n },\n type: {\n type: String,\n default: 'file',\n },\n value: {\n default: () => [],\n validator: val => {\n return typeof val === 'object' || Array.isArray(val)\n },\n } as PropValidator<File | File[]>,\n },\n\n data: () => ({\n internalFileInput: null,\n }),\n\n computed: {\n classes (): object {\n return {\n ...VTextField.options.computed.classes.call(this),\n 'v-file-input': true,\n }\n },\n counterValue (): string {\n if (!this.showSize) return this.$vuetify.lang.t(this.counterString, this.lazyValue.length)\n\n const bytes = this.internalArrayValue.reduce((size: number, file: File) => size + file.size, 0)\n\n return this.$vuetify.lang.t(\n this.counterSizeString,\n this.lazyValue.length,\n humanReadableFileSize(bytes, this.base === 1024)\n )\n },\n internalArrayValue (): File[] {\n return Array.isArray(this.internalValue)\n ? this.internalValue\n : wrapInArray(this.internalValue)\n },\n internalValue: {\n get (): File[] {\n return this.lazyValue\n },\n set (val: File | File[]) {\n this.lazyValue = val\n this.$emit('change', this.lazyValue)\n },\n },\n isDirty (): boolean {\n return this.internalArrayValue.length > 0\n },\n isLabelActive (): boolean {\n return this.isDirty\n },\n isMultiple (): boolean {\n return this.$attrs.hasOwnProperty('multiple')\n },\n text (): string[] {\n if (!this.isDirty) return [this.placeholder]\n\n return this.internalArrayValue.map((file: File) => {\n const name = this.truncateText(file.name)\n\n return !this.showSize ? name : `${name} (${humanReadableFileSize(file.size, this.base === 1024)})`\n })\n },\n base (): 1000 | 1024 | undefined {\n return typeof this.showSize !== 'boolean' ? this.showSize : undefined\n },\n hasChips (): boolean {\n return this.chips || this.smallChips\n },\n },\n\n methods: {\n clearableCallback () {\n this.internalValue = this.isMultiple ? [] : null\n this.internalFileInput = null\n },\n genChips () {\n if (!this.isDirty) return []\n\n return this.text.map((text, index) => this.$createElement(VChip, {\n props: { small: this.smallChips },\n on: {\n 'click:close': () => {\n const internalValue = this.internalValue\n internalValue.splice(index, 1)\n this.internalValue = internalValue // Trigger the watcher\n },\n },\n }, [text]))\n },\n genInput () {\n const input = VTextField.options.methods.genInput.call(this)\n\n input.data!.domProps!.value = this.internalFileInput\n\n return [this.genSelections(), input]\n },\n genPrependSlot () {\n const icon = this.genIcon('prepend', () => {\n this.$refs.input.click()\n })\n\n icon.data!.attrs = { tabindex: 0 }\n\n return this.genSlot('prepend', 'outer', [icon])\n },\n genSelectionText (): string[] {\n const length = this.text.length\n\n if (length < 2) return this.text\n if (this.showSize && !this.counter) return [this.counterValue]\n return [this.$vuetify.lang.t(this.counterString, length)]\n },\n genSelections () {\n const children = []\n\n if (this.isDirty && this.$scopedSlots.selection) {\n this.internalValue.forEach((file: File, index: number) => {\n if (!this.$scopedSlots.selection) return\n\n children.push(\n this.$scopedSlots.selection({\n text: this.text[index],\n file,\n index,\n })\n )\n })\n } else {\n children.push(this.hasChips && this.isDirty ? this.genChips() : this.genSelectionText())\n }\n\n return this.$createElement('div', {\n staticClass: 'v-file-input__text',\n class: {\n 'v-file-input__text--placeholder': this.placeholder && !this.isDirty,\n 'v-file-input__text--chips': this.hasChips && !this.$scopedSlots.selection,\n },\n on: {\n click: () => this.$refs.input.click(),\n },\n }, children)\n },\n onInput (e: Event) {\n const files = [...(e.target as HTMLInputElement).files || []]\n\n this.internalValue = this.isMultiple ? files : files[0]\n },\n truncateText (str: string) {\n if (str.length < Number(this.truncateLength)) return str\n return `${str.slice(0, 10)}…${str.slice(-10)}`\n },\n },\n})\n"],"sourceRoot":"","file":"VFileInput.js"}