{"version":3,"sources":["webpack:///../../../src/components/VFileInput/VFileInput.ts","webpack:///./src/components/shared/core/inputs/FileInput.vue","webpack:///src/components/shared/core/inputs/FileInput.vue","webpack:///./src/components/shared/core/inputs/FileInput.vue?8e56","webpack:///./src/components/shared/core/inputs/FileInput.vue?e730","webpack:///../../../src/components/VTextField/index.ts"],"names":["VTextField","extend","name","model","prop","event","props","chips","Boolean","clearable","type","default","counterSizeString","String","counterString","hideInput","multiple","placeholder","prependIcon","readonly","showSize","Number","validator","v","includes","smallChips","truncateLength","value","undefined","val","wrapInArray","every","computed","classes","options","call","this","computedCounterValue","fileCount","lazyValue","length","File","$vuetify","lang","t","bytes","internalArrayValue","reduce","size","humanReadableFileSize","base","internalValue","get","set","$emit","isDirty","isLabelActive","text","persistentPlaceholder","isFocused","hasLabel","map","file","truncatedText","truncateText","hasChips","watch","handler","consoleError","immediate","deepEqual","$refs","input","files","methods","clearableCallback","genChips","index","$createElement","VChip","small","on","click:close","splice","genControl","render","data","style","mergeStyles","display","genInput","attrs","domProps","change","onInput","genSelections","genPrependSlot","icon","genIcon","click","genSlot","genSelectionText","counter","children","$scopedSlots","selection","forEach","push","staticClass","class","genTextFieldSlot","node","e","target","nodeName","initialValue","onKeyDown","str","charsKeepOneSide","Math","floor","slice","_vm","label","progressVisible","scopedSlots","key","_t","staticRenderFns","inheritAttrs","progressHeight","progressRounded","progressValue","showFileSize","progressText","isNaN","ceil","component"],"mappings":"uNAiBeA,SAAWC,OAAO,CAC/BC,KAAM,eAENC,MAAO,CACLC,KAAM,QACNC,MAAO,UAGTC,MAAO,CACLC,MAAOC,QACPC,UAAW,CACTC,KAAMF,QACNG,SAAS,GAEXC,kBAAmB,CACjBF,KAAMG,OACNF,QAAS,kCAEXG,cAAe,CACbJ,KAAMG,OACNF,QAAS,8BAEXI,UAAWP,QACXQ,SAAUR,QACVS,YAAaJ,OACbK,YAAa,CACXR,KAAMG,OACNF,QAAS,SAEXQ,SAAU,CACRT,KAAMF,QACNG,SA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B,SAAWyD,EAAQA,EAAM,GAKnDrC,KAAK+E,aAAe/E,KAAKe,eAE3BiE,UAAWJ,GACT5E,KAAKkB,MAAM,UAAW0D,IAExBhD,aAAcqD,GACZ,GAAIA,EAAI7E,OAASnB,OAAOe,KAAKV,gBAAiB,OAAO2F,EACrD,MAAMC,EAAmBC,KAAKC,OAAOnG,OAAOe,KAAKV,gBAAkB,GAAK,GACxE,MAAO,GAAG2F,EAAII,MAAM,EAAGH,MAAqBD,EAAII,MAAMJ,EAAI7E,OAAS8E,S,YC/Rb,EAAU,W,IAAwC3B,EAAM,K,EAAC,QAAY+B,G,OAAiB,QAAYC,KAAK,W,MAAC,CAA6B,2BAAG,QAAc,MAA4DhC,QAAM,oB,eAAwCiC,aAAe,yB,MAAC,CAA8B,MAAQ,EAAI,cAAgB,OAAU,EAAC,gBAAG,0BAACC,OAAW,EAAI,eAAMC,SAAI,I,YAAwBnG,OAAM,IAAE,U,GAAC,UAAYoG,M,UAA2F,GAAQpG,0BAAO,MAAC,iDAAI,MAAS,QAE/kBqG,YAEJ,I,KC2Be,GACf9H,KAAA,YACA+H,cAAA,EACA3H,MAAA,CACAsH,gBAAA,CACAlH,KAAAF,QACAG,SAAA,GAEAuH,eAAA,CACAxH,KAAAW,OACAV,QAAA,IAEAwH,gBAAA,CACAzH,KAAAF,QACAG,SAAA,GAEAyH,cAAA,CACA1H,KAAAW,OACAV,QAAA,GAEA0H,aAAA,CACA3H,KAAAF,QACAG,SAAA,GAEAgH,MAAA,CACAjH,KAAAG,OACAF,QAAA,kBAGA+D,QAAA,CAMA4D,aAAA3G,GACA,OAAA4G,MAAA5G,GAAA,GAAA4F,KAAAiB,KAAA7G,GAAA,QCnE+X,I,YCO3X8G,EAAY,eACd,EACA,EACAT,GACA,EACA,KACA,KACA,MAIa,aAAAS,E,2CClBf,gBAGezI,e","file":"js/chunk-0d57b0e1.77b92e83.js","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 { deepEqual, humanReadableFileSize, wrapInArray } from '../../util/helpers'\nimport { consoleError } from '../../util/console'\nimport { mergeStyles } from '../../util/mergeData'\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 hideInput: Boolean,\n multiple: Boolean,\n placeholder: String,\n prependIcon: {\n type: String,\n default: '$file',\n },\n readonly: {\n type: Boolean,\n default: false,\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,\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: undefined,\n validator: val => {\n return wrapInArray(val).every(v => v != null && typeof v === 'object')\n },\n } as PropValidator,\n },\n\n computed: {\n classes (): object {\n return {\n ...VTextField.options.computed.classes.call(this),\n 'v-file-input': true,\n }\n },\n computedCounterValue (): string {\n const fileCount = (this.multiple && this.lazyValue)\n ? this.lazyValue.length\n : (this.lazyValue instanceof File) ? 1 : 0\n\n if (!this.showSize) return this.$vuetify.lang.t(this.counterString, fileCount)\n\n const bytes = this.internalArrayValue.reduce((bytes: number, { size = 0 }: File) => {\n return bytes + size\n }, 0)\n\n return this.$vuetify.lang.t(\n this.counterSizeString,\n fileCount,\n humanReadableFileSize(bytes, this.base === 1024)\n )\n },\n internalArrayValue (): File[] {\n return 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 text (): string[] {\n if (!this.isDirty && (this.persistentPlaceholder || this.isFocused || !this.hasLabel)) return [this.placeholder]\n\n return this.internalArrayValue.map((file: File) => {\n const {\n name = '',\n size = 0,\n } = file\n\n const truncatedText = this.truncateText(name)\n\n return !this.showSize\n ? truncatedText\n : `${truncatedText} (${humanReadableFileSize(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 watch: {\n readonly: {\n handler (v) {\n if (v === true) consoleError('readonly is not supported on ', this)\n },\n immediate: true,\n },\n value (v) {\n const value = this.multiple ? v : v ? [v] : []\n if (!deepEqual(value, this.$refs.input.files)) {\n // When the input value is changed programatically, clear the\n // internal input's value so that the `onInput` handler\n // can be triggered again if the user re-selects the exact\n // same file(s). Ideally, `input.files` should be\n // manipulated directly but that property is readonly.\n this.$refs.input.value = ''\n }\n },\n },\n\n methods: {\n clearableCallback () {\n this.internalValue = this.multiple ? [] : null\n this.$refs.input.value = ''\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 genControl () {\n const render = VTextField.options.methods.genControl.call(this)\n\n if (this.hideInput) {\n render.data!.style = mergeStyles(\n render.data!.style,\n { display: 'none' }\n )\n }\n\n return render\n },\n genInput () {\n const input = VTextField.options.methods.genInput.call(this)\n\n input.data!.attrs!.multiple = this.multiple\n\n // We should not be setting value\n // programmatically on the input\n // when it is using type=\"file\"\n delete input.data!.domProps!.value\n\n // This solves an issue in Safari where\n // nothing happens when adding a file\n // due to the input event not firing\n // https://github.com/vuetifyjs/vuetify/issues/7941\n delete input.data!.on!.input\n input.data!.on!.change = this.onInput\n\n return [this.genSelections(), input]\n },\n genPrependSlot () {\n if (!this.prependIcon) return null\n\n const icon = this.genIcon('prepend', () => {\n this.$refs.input.click()\n })\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.computedCounterValue]\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.internalArrayValue.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 }, children)\n },\n genTextFieldSlot () {\n const node = VTextField.options.methods.genTextFieldSlot.call(this)\n\n node.data!.on = {\n ...(node.data!.on || {}),\n click: (e: MouseEvent) => {\n // Clicking the label already delegates to input element, so we shouldn't click it twice\n if (e.target && (e.target as HTMLElement).nodeName === 'LABEL') return\n\n this.$refs.input.click()\n },\n }\n\n return node\n },\n onInput (e: Event) {\n const files = [...(e.target as HTMLInputElement).files || []]\n\n this.internalValue = this.multiple ? files : files[0]\n\n // Set initialValue here otherwise isFocused\n // watcher in VTextField will emit a change\n // event whenever the component is blurred\n this.initialValue = this.internalValue\n },\n onKeyDown (e: KeyboardEvent) {\n this.$emit('keydown', e)\n },\n truncateText (str: string) {\n if (str.length < Number(this.truncateLength)) return str\n const charsKeepOneSide = Math.floor((Number(this.truncateLength) - 1) / 2)\n return `${str.slice(0, charsKeepOneSide)}…${str.slice(str.length - charsKeepOneSide)}`\n },\n },\n})\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('v-file-input',_vm._g(_vm._b({attrs:{\"show-size\":_vm.showFileSize,\"label\":_vm.label,\"loading\":_vm.progressVisible}},'v-file-input',_vm.$attrs,false),_vm.$listeners)),_c('v-progress-linear',{attrs:{\"value\":_vm.progressValue,\"active\":_vm.progressVisible,\"rounded\":_vm.progressRounded,\"height\":_vm.progressHeight,\"reactive\":\"\"},scopedSlots:_vm._u([{key:\"default\",fn:function({ value }){return [_vm._t(\"progress\",function(){return [_c('strong',[_vm._v(_vm._s(_vm.progressText(value)))])]},{\"value\":value})]}}],null,true)})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FileInput.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FileInput.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./FileInput.vue?vue&type=template&id=2670d9f2\"\nimport script from \"./FileInput.vue?vue&type=script&lang=js\"\nexport * from \"./FileInput.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import VTextField from './VTextField'\n\nexport { VTextField }\nexport default VTextField\n"],"sourceRoot":""}