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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"} |