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AEF,CAAC,CAAC,8BAAD,EAAoB,CAAC,KAAK,QAAL,EAAD,CAApB,CAFC,CAHI,CAAR;AAOD;AA7KgD,CAApC,C","sourcesContent":["// Styles\nimport './VListGroup.sass'\n\n// Components\nimport VIcon from '../VIcon'\nimport VList from './VList'\nimport VListItem from './VListItem'\nimport VListItemIcon from './VListItemIcon'\n\n// Mixins\nimport Bootable from '../../mixins/bootable'\nimport Colorable from '../../mixins/colorable'\nimport Toggleable from '../../mixins/toggleable'\nimport { inject as RegistrableInject } from '../../mixins/registrable'\n\n// Directives\nimport ripple from '../../directives/ripple'\n\n// Transitions\nimport { VExpandTransition } from '../transitions'\n\n// Utils\nimport mixins, { ExtractVue } from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\nimport { Route } from 'vue-router'\n\nconst baseMixins = mixins(\n Bootable,\n Colorable,\n RegistrableInject('list'),\n Toggleable\n)\n\ntype VListInstance = InstanceType<typeof VList>\n\ninterface options extends ExtractVue<typeof baseMixins> {\n list: VListInstance\n $refs: {\n group: HTMLElement\n }\n $route: Route\n}\n\nexport default baseMixins.extend<options>().extend({\n name: 'v-list-group',\n\n directives: { ripple },\n\n props: {\n activeClass: {\n type: String,\n default: '',\n },\n appendIcon: {\n type: String,\n default: '$vuetify.icons.expand',\n },\n color: {\n type: String,\n default: 'primary',\n },\n disabled: Boolean,\n group: String,\n noAction: Boolean,\n prependIcon: String,\n ripple: {\n type: [Boolean, Object],\n default: true,\n },\n subGroup: Boolean,\n },\n\n computed: {\n classes (): object {\n return {\n 'v-list-group--active': this.isActive,\n 'v-list-group--disabled': this.disabled,\n 'v-list-group--no-action': this.noAction,\n 'v-list-group--sub-group': this.subGroup,\n }\n },\n },\n\n watch: {\n isActive (val: boolean) {\n /* istanbul ignore else */\n if (!this.subGroup && val) {\n this.list && this.list.listClick(this._uid)\n }\n },\n $route: 'onRouteChange',\n },\n\n created () {\n this.list && this.list.register(this)\n\n if (this.group &&\n this.$route &&\n this.value == null\n ) {\n this.isActive = this.matchRoute(this.$route.path)\n }\n },\n\n beforeDestroy () {\n this.list && this.list.unregister(this)\n },\n\n methods: {\n click (e: Event) {\n if (this.disabled) return\n\n this.isBooted = true\n\n this.$emit('click', e)\n this.$nextTick(() => (this.isActive = !this.isActive))\n },\n genIcon (icon: string | false): VNode {\n return this.$createElement(VIcon, icon)\n },\n genAppendIcon (): VNode | null {\n const icon = !this.subGroup ? this.appendIcon : false\n\n if (!icon && !this.$slots.appendIcon) return null\n\n return this.$createElement(VListItemIcon, {\n staticClass: 'v-list-group__header__append-icon',\n }, [\n this.$slots.appendIcon || this.genIcon(icon),\n ])\n },\n genHeader (): VNode {\n return this.$createElement(VListItem, {\n staticClass: 'v-list-group__header',\n attrs: {\n 'aria-expanded': String(this.isActive),\n role: 'button',\n },\n class: {\n [this.activeClass]: this.isActive,\n },\n props: {\n inputValue: this.isActive,\n },\n directives: [{\n name: 'ripple',\n value: this.ripple,\n }],\n on: {\n ...this.$listeners,\n click: this.click,\n },\n }, [\n this.genPrependIcon(),\n this.$slots.activator,\n this.genAppendIcon(),\n ])\n },\n genItems (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-list-group__items',\n directives: [{\n name: 'show',\n value: this.isActive,\n }],\n }, this.showLazyContent([\n this.$createElement('div', this.$slots.default),\n ]))\n },\n genPrependIcon (): VNode | null {\n const icon = this.prependIcon\n ? this.prependIcon\n : this.subGroup\n ? '$vuetify.icons.subgroup'\n : false\n\n if (!icon && !this.$slots.prependIcon) return null\n\n return this.$createElement(VListItemIcon, {\n staticClass: 'v-list-group__header__prepend-icon',\n }, [\n this.$slots.prependIcon || this.genIcon(icon),\n ])\n },\n onRouteChange (to: Route) {\n /* istanbul ignore if */\n if (!this.group) return\n\n const isActive = this.matchRoute(to.path)\n\n /* istanbul ignore else */\n if (isActive && this.isActive !== isActive) {\n this.list && this.list.listClick(this._uid)\n }\n\n this.isActive = isActive\n },\n toggle (uid: number) {\n const isActive = this._uid === uid\n\n if (isActive) this.isBooted = true\n this.$nextTick(() => (this.isActive = isActive))\n },\n matchRoute (to: string) {\n return to.match(this.group) !== null\n },\n },\n\n render (h): VNode {\n return h('div', this.setTextColor(this.isActive && this.color, {\n staticClass: 'v-list-group',\n class: this.classes,\n }), [\n this.genHeader(),\n h(VExpandTransition, [this.genItems()]),\n ])\n },\n})\n"],"sourceRoot":"","file":"VListGroup.js"} |