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,GAxFF;AAuIP,EAAA,MAvIO,kBAuIC,CAvID,EAuIE;AACP,QAAM,QAAQ,GAAG,CAAC,KAAK,UAAL,EAAD,CAAjB;;AADO,gCAEa,KAAK,iBAAL,EAFb;AAAA,QAED,GAFC,yBAED,GAFC;AAAA,QAEI,IAFJ,yBAEI,IAFJ;;AAIP,IAAA,IAAI,CAAC,KAAL,qBACK,IAAI,CAAC,KADV;AAEE,MAAA,SAAS,EAAE,KAAK,SAAL,GAAiB,MAAjB,GAA0B,SAFvC;AAGE,MAAA,QAAQ,EAAE,KAAK,SAAL,IAAkB,CAAC,KAAK,QAAxB,GAAmC,CAAnC,GAAuC,IAAI,CAAC,KAAL,CAAY;AAH/D;AAKA,IAAA,IAAI,CAAC,UAAL,CAAiB,IAAjB,CAAsB;AACpB,MAAA,IAAI,EAAE,MADc;AAEpB,MAAA,KAAK,EAAE,KAAK;AAFQ,KAAtB;AAIA,IAAA,IAAI,GAAG,KAAK,kBAAL,CAAwB,KAAK,KAA7B,EAAoC,IAApC,CAAP;AAEA,QAAM,KAAK,GAAG,KAAK,SAAL,IAAmB,KAAK,QAAL,IAAiB,KAAK,KAAvD;AAEA,WAAO,CAAC,CAAC,GAAD,EAAM,KAAK,YAAL,CAAkB,KAAlB,EAAyB,IAAzB,CAAN,EAAsC,QAAtC,CAAR;AACD;AAzJM,CAPM,C","sourcesContent":["// Styles\nimport './VChip.sass'\n\n// Types\nimport { VNode } from 'vue'\nimport mixins from '../../util/mixins'\n\n// Components\nimport { VExpandXTransition } from '../transitions'\nimport VIcon from '../VIcon'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport { factory as GroupableFactory } from '../../mixins/groupable'\nimport Themeable from '../../mixins/themeable'\nimport { factory as ToggleableFactory } from '../../mixins/toggleable'\nimport Routable from '../../mixins/routable'\nimport Sizeable from '../../mixins/sizeable'\n\n// Utilities\nimport { breaking } from '../../util/console'\n\n// Types\nimport { PropValidator } from 'vue/types/options'\n\n/* @vue/component */\nexport default mixins(\n Colorable,\n Sizeable,\n Routable,\n Themeable,\n GroupableFactory('chipGroup'),\n ToggleableFactory('inputValue')\n).extend({\n name: 'v-chip',\n\n props: {\n active: {\n type: Boolean,\n default: true,\n },\n activeClass: {\n type: String,\n default (): string | undefined {\n if (!this.chipGroup) return ''\n\n return this.chipGroup.activeClass\n },\n } as any as PropValidator<string>,\n close: Boolean,\n closeIcon: {\n type: String,\n default: '$vuetify.icons.delete',\n },\n disabled: Boolean,\n draggable: Boolean,\n filter: Boolean,\n filterIcon: {\n type: String,\n default: '$vuetify.icons.complete',\n },\n label: Boolean,\n link: Boolean,\n outlined: Boolean,\n pill: Boolean,\n tag: {\n type: String,\n default: 'span',\n },\n textColor: String,\n value: null as any as PropValidator<any>,\n },\n\n data: () => ({\n proxyClass: 'v-chip--active',\n }),\n\n computed: {\n classes (): object {\n return {\n 'v-chip': true,\n ...Routable.options.computed.classes.call(this),\n 'v-chip--clickable': this.isClickable,\n 'v-chip--disabled': this.disabled,\n 'v-chip--draggable': this.draggable,\n 'v-chip--label': this.label,\n 'v-chip--link': this.isLink,\n 'v-chip--no-color': !this.color,\n 'v-chip--outlined': this.outlined,\n 'v-chip--pill': this.pill,\n 'v-chip--removable': this.hasClose,\n ...this.themeClasses,\n ...this.sizeableClasses,\n ...this.groupClasses,\n }\n },\n hasClose (): boolean {\n return Boolean(this.close)\n },\n isClickable (): boolean {\n return Boolean(\n Routable.options.computed.isClickable.call(this) ||\n this.chipGroup\n )\n },\n },\n\n created () {\n const breakingProps = [\n ['outline', 'outlined'],\n ['selected', 'input-value'],\n ['value', 'active'],\n ['@input', '@active.sync'],\n ]\n\n /* istanbul ignore next */\n breakingProps.forEach(([original, replacement]) => {\n if (this.$attrs.hasOwnProperty(original)) breaking(original, replacement, this)\n })\n },\n\n methods: {\n click (e: MouseEvent): void {\n this.$emit('click', e)\n\n this.chipGroup && this.toggle()\n },\n genFilter (): VNode {\n const children = []\n\n if (this.isActive) {\n children.push(\n this.$createElement(VIcon, {\n staticClass: 'v-chip__filter',\n props: { left: true },\n }, this.filterIcon)\n )\n }\n\n return this.$createElement(VExpandXTransition, children)\n },\n genClose (): VNode {\n return this.$createElement(VIcon, {\n staticClass: 'v-chip__close',\n props: {\n right: true,\n },\n on: {\n click: (e: Event) => {\n e.stopPropagation()\n\n this.$emit('click:close')\n this.$emit('update:active', false)\n },\n },\n }, this.closeIcon)\n },\n genContent (): VNode {\n return this.$createElement('span', {\n staticClass: 'v-chip__content',\n }, [\n this.filter && this.genFilter(),\n this.$slots.default,\n this.hasClose && this.genClose(),\n ])\n },\n },\n\n render (h): VNode {\n const children = [this.genContent()]\n let { tag, data } = this.generateRouteLink()\n\n data.attrs = {\n ...data.attrs,\n draggable: this.draggable ? 'true' : undefined,\n tabindex: this.chipGroup && !this.disabled ? 0 : data.attrs!.tabindex,\n }\n data.directives!.push({\n name: 'show',\n value: this.active,\n })\n data = this.setBackgroundColor(this.color, data)\n\n const color = this.textColor || (this.outlined && this.color)\n\n return h(tag, this.setTextColor(color, data), children)\n },\n})\n"],"sourceRoot":"","file":"VChip.js"} |