{"version":3,"sources":["webpack:///../../../src/components/VAlert/VAlert.ts","webpack:///../../../src/components/VForm/VForm.ts","webpack:///../../../src/mixins/transitionable/index.ts"],"names":["mixins","VSheet","Toggleable","Transitionable","extend","name","props","border","type","String","validator","val","includes","closeLabel","default","coloredBorder","Boolean","dense","dismissible","closeIcon","icon","outlined","prominent","text","value","computed","__cachedBorder","this","data","staticClass","class","setBackgroundColor","computedColor","$createElement","__cachedDismissible","color","iconColor","VBtn","small","attrs","$vuetify","lang","t","on","click","isActive","VIcon","__cachedIcon","computedIcon","classes","options","call","hasColoredIcon","hasText","undefined","isDark","Themeable","created","$attrs","hasOwnProperty","breaking","methods","genWrapper","children","$slots","prepend","genContent","append","$scopedSlots","close","toggle","genAlert","role","listeners$","style","styles","directives","setColor","setTextColor","render","h","transition","origin","mode","BindsAttrs","RegistrableProvide","provide","form","inheritAttrs","disabled","lazyValidation","readonly","inputs","watchers","errorBag","watch","handler","errors","Object","values","$emit","deep","immediate","watchInput","input","watcher","$watch","$set","_uid","valid","shouldValidate","validate","filter","length","reset","forEach","resetErrorBag","setTimeout","resetValidation","register","push","unregister","found","find","i","unwatch","$delete","novalidate","attrs$","submit","e","Vue"],"mappings":"kHAAA,8GAwBeA,sBACbC,OACAC,OACAC,QACAC,OAAO,CACPC,KAAM,UAENC,MAAO,CACLC,OAAQ,CACNC,KAAMC,OACNC,UAAWC,GACT,MAAO,CACL,MACA,QACA,SACA,QACAC,SAASD,KAGfE,WAAY,CACVL,KAAMC,OACNK,QAAS,kBAEXC,cAAeC,QACfC,MAAOD,QACPE,YAAaF,QACbG,UAAW,CACTX,KAAMC,OACNK,QAAS,WAEXM,KAAM,CACJN,QAAS,GACTN,KAAM,CAACQ,QAASP,QAChBC,UAAWC,GACT,MAAsB,kBAARA,IAA4B,IAARA,IAGtCU,SAAUL,QACVM,UAAWN,QACXO,KAAMP,QACNR,KAAM,CACJA,KAAMC,OACNC,UAAWC,GACT,MAAO,CACL,OACA,QACA,UACA,WACAC,S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KyF,iBAEPG,SAAUf,GACR7E,KAAKiE,OAAO4B,KAAKhB,GACjB7E,KAAKkE,SAAS2B,KAAK7F,KAAK4E,WAAWC,KAErCiB,WAAYjB,GACV,MAAMkB,EAAQ/F,KAAKiE,OAAO+B,KAAKC,GAAKA,EAAEhB,OAASJ,EAAMI,MAErD,IAAKc,EAAO,OAEZ,MAAMG,EAAUlG,KAAKkE,SAAS8B,KAAKC,GAAKA,EAAEhB,OAASc,EAAMd,MACrDiB,IACFA,EAAQhB,QACRgB,EAAQf,kBAGVnF,KAAKkE,SAAWlE,KAAKkE,SAASmB,OAAOY,GAAKA,EAAEhB,OAASc,EAAMd,MAC3DjF,KAAKiE,OAASjE,KAAKiE,OAAOoB,OAAOY,GAAKA,EAAEhB,OAASc,EAAMd,MACvDjF,KAAKmG,QAAQnG,KAAKmE,SAAU4B,EAAMd,QAItC7B,OAAQC,GACN,OAAOA,EAAE,OAAQ,CACfnD,YAAa,SACbU,MAAO,CACLwF,YAAY,KACTpG,KAAKqG,QAEVrF,GAAI,CACFsF,OAASC,GAAavG,KAAKyE,MAAM,SAAU8B,KAE5CvG,KAAKqC,OAAOlD,a,kCC7InB,gBAEeqH,oBAAI/H,OAAO,CACxBC,KAAM,iBAENC,MAAO,CACL6E,KAAM1E,OACNyE,OAAQzE,OACRwE,WAAYxE","file":"js/chunk-41825a46.ed726051.js","sourcesContent":["// Styles\nimport './VAlert.sass'\n\n// Extensions\nimport VSheet from '../VSheet'\n\n// Components\nimport VBtn from '../VBtn'\nimport VIcon from '../VIcon'\n\n// Mixins\nimport Toggleable from '../../mixins/toggleable'\nimport Themeable from '../../mixins/themeable'\nimport Transitionable from '../../mixins/transitionable'\n\n// Utilities\nimport mixins from '../../util/mixins'\nimport { breaking } from '../../util/console'\n\n// Types\nimport { VNodeData } from 'vue'\nimport { VNode } from 'vue/types'\n\n/* @vue/component */\nexport default mixins(\n VSheet,\n Toggleable,\n Transitionable\n).extend({\n name: 'v-alert',\n\n props: {\n border: {\n type: String,\n validator (val: string) {\n return [\n 'top',\n 'right',\n 'bottom',\n 'left',\n ].includes(val)\n },\n },\n closeLabel: {\n type: String,\n default: '$vuetify.close',\n },\n coloredBorder: Boolean,\n dense: Boolean,\n dismissible: Boolean,\n closeIcon: {\n type: String,\n default: '$cancel',\n },\n icon: {\n default: '',\n type: [Boolean, String],\n validator (val: boolean | string) {\n return typeof val === 'string' || val === false\n },\n },\n outlined: Boolean,\n prominent: Boolean,\n text: Boolean,\n type: {\n type: String,\n validator (val: string) {\n return [\n 'info',\n 'error',\n 'success',\n 'warning',\n ].includes(val)\n },\n },\n value: {\n type: Boolean,\n default: true,\n },\n },\n\n computed: {\n __cachedBorder (): VNode | null {\n if (!this.border) return null\n\n let data: VNodeData = {\n staticClass: 'v-alert__border',\n class: {\n [`v-alert__border--${this.border}`]: true,\n },\n }\n\n if (this.coloredBorder) {\n data = this.setBackgroundColor(this.computedColor, data)\n data.class['v-alert__border--has-color'] = true\n }\n\n return this.$createElement('div', data)\n },\n __cachedDismissible (): VNode | null {\n if (!this.dismissible) return null\n\n const color = this.iconColor\n\n return this.$createElement(VBtn, {\n staticClass: 'v-alert__dismissible',\n props: {\n color,\n icon: true,\n small: true,\n },\n attrs: {\n 'aria-label': this.$vuetify.lang.t(this.closeLabel),\n },\n on: {\n click: () => (this.isActive = false),\n },\n }, [\n this.$createElement(VIcon, {\n props: { color },\n }, this.closeIcon),\n ])\n },\n __cachedIcon (): VNode | null {\n if (!this.computedIcon) return null\n\n return this.$createElement(VIcon, {\n staticClass: 'v-alert__icon',\n props: { color: this.iconColor },\n }, this.computedIcon)\n },\n classes (): object {\n const classes: Record = {\n ...VSheet.options.computed.classes.call(this),\n 'v-alert--border': Boolean(this.border),\n 'v-alert--dense': this.dense,\n 'v-alert--outlined': this.outlined,\n 'v-alert--prominent': this.prominent,\n 'v-alert--text': this.text,\n }\n\n if (this.border) {\n classes[`v-alert--border-${this.border}`] = true\n }\n\n return classes\n },\n computedColor (): string {\n return this.color || this.type\n },\n computedIcon (): string | boolean {\n if (this.icon === false) return false\n if (typeof this.icon === 'string' && this.icon) return this.icon\n if (!['error', 'info', 'success', 'warning'].includes(this.type)) return false\n\n return `$${this.type}`\n },\n hasColoredIcon (): boolean {\n return (\n this.hasText ||\n (Boolean(this.border) && this.coloredBorder)\n )\n },\n hasText (): boolean {\n return this.text || this.outlined\n },\n iconColor (): string | undefined {\n return this.hasColoredIcon ? this.computedColor : undefined\n },\n isDark (): boolean {\n if (\n this.type &&\n !this.coloredBorder &&\n !this.outlined\n ) return true\n\n return Themeable.options.computed.isDark.call(this)\n },\n },\n\n created () {\n /* istanbul ignore next */\n if (this.$attrs.hasOwnProperty('outline')) {\n breaking('outline', 'outlined', this)\n }\n },\n\n methods: {\n genWrapper (): VNode {\n const children = [\n this.$slots.prepend || this.__cachedIcon,\n this.genContent(),\n this.__cachedBorder,\n this.$slots.append,\n this.$scopedSlots.close\n ? this.$scopedSlots.close({ toggle: this.toggle })\n : this.__cachedDismissible,\n ]\n\n const data: VNodeData = {\n staticClass: 'v-alert__wrapper',\n }\n\n return this.$createElement('div', data, children)\n },\n genContent (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-alert__content',\n }, this.$slots.default)\n },\n genAlert (): VNode {\n let data: VNodeData = {\n staticClass: 'v-alert',\n attrs: {\n role: 'alert',\n },\n on: this.listeners$,\n class: this.classes,\n style: this.styles,\n directives: [{\n name: 'show',\n value: this.isActive,\n }],\n }\n\n if (!this.coloredBorder) {\n const setColor = this.hasText ? this.setTextColor : this.setBackgroundColor\n data = setColor(this.computedColor, data)\n }\n\n return this.$createElement('div', data, [this.genWrapper()])\n },\n /** @public */\n toggle () {\n this.isActive = !this.isActive\n },\n },\n\n render (h): VNode {\n const render = this.genAlert()\n\n if (!this.transition) return render\n\n return h('transition', {\n props: {\n name: this.transition,\n origin: this.origin,\n mode: this.mode,\n },\n }, [render])\n },\n})\n","// Components\nimport VInput from '../VInput/VInput'\n\n// Mixins\nimport mixins from '../../util/mixins'\nimport BindsAttrs from '../../mixins/binds-attrs'\nimport { provide as RegistrableProvide } from '../../mixins/registrable'\n\n// Helpers\nimport { VNode } from 'vue'\n\ntype ErrorBag = Record\ntype VInputInstance = InstanceType\ntype Watchers = {\n _uid: number\n valid: () => void\n shouldValidate: () => void\n}\n\n/* @vue/component */\nexport default mixins(\n BindsAttrs,\n RegistrableProvide('form')\n /* @vue/component */\n).extend({\n name: 'v-form',\n\n provide (): object {\n return { form: this }\n },\n\n inheritAttrs: false,\n\n props: {\n disabled: Boolean,\n lazyValidation: Boolean,\n readonly: Boolean,\n value: Boolean,\n },\n\n data: () => ({\n inputs: [] as VInputInstance[],\n watchers: [] as Watchers[],\n errorBag: {} as ErrorBag,\n }),\n\n watch: {\n errorBag: {\n handler (val) {\n const errors = Object.values(val).includes(true)\n\n this.$emit('input', !errors)\n },\n deep: true,\n immediate: true,\n },\n },\n\n methods: {\n watchInput (input: any): Watchers {\n const watcher = (input: any): (() => void) => {\n return input.$watch('hasError', (val: boolean) => {\n this.$set(this.errorBag, input._uid, val)\n }, { immediate: true })\n }\n\n const watchers: Watchers = {\n _uid: input._uid,\n valid: () => {},\n shouldValidate: () => {},\n }\n\n if (this.lazyValidation) {\n // Only start watching inputs if we need to\n watchers.shouldValidate = input.$watch('shouldValidate', (val: boolean) => {\n if (!val) return\n\n // Only watch if we're not already doing it\n if (this.errorBag.hasOwnProperty(input._uid)) return\n\n watchers.valid = watcher(input)\n })\n } else {\n watchers.valid = watcher(input)\n }\n\n return watchers\n },\n /** @public */\n validate (): boolean {\n return this.inputs.filter(input => !input.validate(true)).length === 0\n },\n /** @public */\n reset (): void {\n this.inputs.forEach(input => input.reset())\n this.resetErrorBag()\n },\n resetErrorBag () {\n if (this.lazyValidation) {\n // Account for timeout in validatable\n setTimeout(() => {\n this.errorBag = {}\n }, 0)\n }\n },\n /** @public */\n resetValidation () {\n this.inputs.forEach(input => input.resetValidation())\n this.resetErrorBag()\n },\n register (input: VInputInstance) {\n this.inputs.push(input)\n this.watchers.push(this.watchInput(input))\n },\n unregister (input: VInputInstance) {\n const found = this.inputs.find(i => i._uid === input._uid)\n\n if (!found) return\n\n const unwatch = this.watchers.find(i => i._uid === found._uid)\n if (unwatch) {\n unwatch.valid()\n unwatch.shouldValidate()\n }\n\n this.watchers = this.watchers.filter(i => i._uid !== found._uid)\n this.inputs = this.inputs.filter(i => i._uid !== found._uid)\n this.$delete(this.errorBag, found._uid)\n },\n },\n\n render (h): VNode {\n return h('form', {\n staticClass: 'v-form',\n attrs: {\n novalidate: true,\n ...this.attrs$,\n },\n on: {\n submit: (e: Event) => this.$emit('submit', e),\n },\n }, this.$slots.default)\n },\n})\n","import Vue from 'vue'\n\nexport default Vue.extend({\n name: 'transitionable',\n\n props: {\n mode: String,\n origin: String,\n transition: String,\n },\n})\n"],"sourceRoot":""}