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OAAO,CAAC,IAAR,IAAgB,EAAxB,EAA4B,OAAO,CAAC,GAApC,EAA0C;AACvD,MAAA,KAAK,sBAAK,KAAK,WAAV,EAAwB,KAAK,QAA7B;AADkD,KAA1C,CAAf;AAIA,WAAO,OAAP;AACD;AAlDgC,CAAX,CAAjB;;;;eAqDQ,qBACb,QADa,EAEb,wBAAiB,WAAjB,EAA8B,QAA9B,EAAwC,cAAxC,CAFa,EAGb,MAHa,CAGN;AACP,EAAA,IAAI,EAAE;AADC,CAHM,C","sourcesContent":["// Mixins\nimport { factory as GroupableFactory } from '../../mixins/groupable'\n\n// Utilities\nimport mixins from '../../util/mixins'\nimport { consoleWarn } from '../../util/console'\n\n// Types\nimport Vue from 'vue'\nimport { VNode, ScopedSlotChildren } from 'vue/types/vnode'\n\n/* @vue/component */\nexport const BaseItem = Vue.extend({\n props: {\n activeClass: String,\n value: {\n required: false,\n },\n },\n\n data: () => ({\n isActive: false,\n }),\n\n methods: {\n toggle () {\n this.isActive = !this.isActive\n },\n },\n\n render (): VNode {\n if (!this.$scopedSlots.default) {\n consoleWarn('v-item is missing a default scopedSlot', this)\n\n return null as any\n }\n\n let element: VNode | ScopedSlotChildren\n\n /* istanbul ignore else */\n if (this.$scopedSlots.default) {\n element = this.$scopedSlots.default({\n active: this.isActive,\n toggle: this.toggle,\n })\n }\n\n if (Array.isArray(element) && element.length === 1) {\n element = element[0]\n }\n\n if (!element || Array.isArray(element) || !element.tag) {\n consoleWarn('v-item should only contain a single element', this)\n\n return element as any\n }\n\n element.data = this._b(element.data || {}, element.tag!, {\n class: { [this.activeClass]: this.isActive },\n })\n\n return element\n },\n})\n\nexport default mixins(\n BaseItem,\n GroupableFactory('itemGroup', 'v-item', 'v-item-group')\n).extend({\n name: 'v-item',\n})\n"],"sourceRoot":"","file":"VItem.js"} |