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;AAC9B,yBAAS,sBADqB;AAE9B,oBAAI,EAAE,OAAO,iBAAK;AAAG,8BAAK,QAAL,GAAgB,KAAhB;AAAuB,qBAAxC;AAF0B,aAAzB,EAGJ,CACD,KAAK,cAAL,CAAoB,eAApB,EAA2B;AACzB,uBAAO;AACL,2BAAO;AADF;AADkB,aAA3B,EAIG,uBAJH,CADC,CAHI,CAAP;AAUD;AAtBM,KApCyD;AA6DlE,UA7DkE,kBA6D1D,CA7D0D,EA6DzD;AACP,YAAM,WAAW,CACf,KAAK,OAAL,EADe,EAEf,EAAE,KAAF,EAAS,KAAK,MAAL,CAAY,OAArB,CAFe,EAGf,KAAK,cAAL,EAHe,CAAjB;AAKA,YAAM,WAAW,KAAK,OAAL,GAAe,KAAK,YAApB,GAAmC,KAAK,kBAAzD;AACA,YAAM,QAAQ,EAAE,KAAF,EAAS,SAAS,KAAK,aAAd,EAA6B;AAClD,yBAAa,SADqC;AAElD,qBAAS;AACP,oCAAoB,KAAK;AADlB,aAFyC;AAKlD,wBAAY,CAAC;AACX,sBAAM,MADK;AAEX,uBAAO,KAAK;AAFD,aAAD,CALsC;AASlD,gBAAI,KAAK;AATyC,SAA7B,CAAT,EAUV,QAVU,CAAd;AAYA,YAAI,CAAC,KAAK,UAAV,EAAsB,OAAO,KAAP;AAEtB,eAAO,EAAE,YAAF,EAAgB;AACrB,mBAAO;AACL,sBAAM,KAAK,UADN;AAEL,wBAAQ,KAAK,MAFR;AAGL,sBAAM,KAAK;AAHN;AADc,SAAhB,EAMJ,CAAC,KAAD,CANI,CAAP;AAOD;AAzFiE,CAArD,C;AAbf","sourcesContent":["// Styles\nimport '../../stylus/components/_alerts.styl'\n\n// Components\nimport VIcon from '../VIcon'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport Toggleable from '../../mixins/toggleable'\nimport Transitionable from '../../mixins/transitionable'\n\n// Types\nimport { VNode } from 'vue/types'\nimport mixins from '../../util/mixins'\n\n/* @vue/component */\nexport default mixins(Colorable, Toggleable, Transitionable).extend({\n name: 'v-alert',\n\n props: {\n dismissible: Boolean,\n icon: String,\n outline: 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 },\n\n computed: {\n computedColor (): string {\n return (this.type && !this.color) ? this.type : (this.color || 'error')\n },\n computedIcon (): string | void {\n if (this.icon || !this.type) return this.icon\n\n switch (this.type) {\n case 'info': return '$vuetify.icons.info'\n case 'error': return '$vuetify.icons.error'\n case 'success': return '$vuetify.icons.success'\n case 'warning': return '$vuetify.icons.warning'\n }\n }\n },\n\n methods: {\n genIcon (): VNode | null {\n if (!this.computedIcon) return null\n\n return this.$createElement(VIcon, {\n 'class': 'v-alert__icon'\n }, this.computedIcon)\n },\n\n genDismissible (): VNode | null {\n if (!this.dismissible) return null\n\n return this.$createElement('a', {\n 'class': 'v-alert__dismissible',\n on: { click: () => { this.isActive = false } }\n }, [\n this.$createElement(VIcon, {\n props: {\n right: true\n }\n }, '$vuetify.icons.cancel')\n ])\n }\n },\n\n render (h): VNode {\n const children = [\n this.genIcon(),\n h('div', this.$slots.default),\n this.genDismissible()\n ] as any\n const setColor = this.outline ? this.setTextColor : this.setBackgroundColor\n const alert = h('div', setColor(this.computedColor, {\n staticClass: 'v-alert',\n 'class': {\n 'v-alert--outline': this.outline\n },\n directives: [{\n name: 'show',\n value: this.isActive\n }],\n on: this.$listeners\n }), children)\n\n if (!this.transition) return alert\n\n return h('transition', {\n props: {\n name: this.transition,\n origin: this.origin,\n mode: this.mode\n }\n }, [alert])\n }\n})\n"],"sourceRoot":""}
|