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AAZ,GAAsB,KAAK,WAAL,EAAtB,GAA2C,KAAK,QAAL,EAA5D;AAEA,eAAO,EAAE,IAAF,EAAQ;AACb,yBAAa,eADA;AAEb,qBAAS,KAAK;AAFD,SAAR,EAGJ,QAHI,CAAP;AAID;AA3FM,CAHM,C","sourcesContent":["// Styles\nimport '../../stylus/components/_breadcrumbs.styl'\n\n// Types\nimport { VNode } from 'vue'\nimport { PropValidator } from 'vue/types/options'\n\n// Components\nimport { VBreadcrumbsDivider, VBreadcrumbsItem } from '.'\n\n// Mixins\nimport Themeable from '../../mixins/themeable'\n\n// Utils\nimport { deprecate } from '../../util/console'\nimport mixins from '../../util/mixins'\n\nexport default mixins(\n Themeable\n /* @vue/component */\n).extend({\n name: 'v-breadcrumbs',\n\n props: {\n divider: {\n type: String,\n default: '/'\n },\n items: {\n type: Array,\n default: () => ([])\n } as PropValidator<any[]>,\n large: Boolean,\n justifyCenter: Boolean,\n justifyEnd: Boolean\n },\n\n computed: {\n classes (): object {\n return {\n 'v-breadcrumbs--large': this.large,\n 'justify-center': this.justifyCenter,\n 'justify-end': this.justifyEnd,\n ...this.themeClasses\n }\n }\n },\n\n mounted () {\n if (this.justifyCenter) deprecate('justify-center', 'class=\"justify-center\"', this)\n if (this.justifyEnd) deprecate('justify-end', 'class=\"justify-end\"', this)\n if (this.$slots.default) deprecate('default slot', ':items and scoped slot \"item\"', this)\n },\n\n methods: {\n /* @deprecated */\n genChildren /* istanbul ignore next */ () {\n if (!this.$slots.default) return undefined\n\n const children = []\n\n let createDividers = false\n for (let i = 0; i < this.$slots.default.length; i++) {\n const elm = this.$slots.default[i]\n\n if (\n !elm.componentOptions ||\n elm.componentOptions.Ctor.options.name !== 'v-breadcrumbs-item'\n ) {\n children.push(elm)\n } else {\n if (createDividers) {\n children.push(this.genDivider())\n }\n children.push(elm)\n createDividers = true\n }\n }\n\n return children\n },\n genDivider () {\n return this.$createElement(VBreadcrumbsDivider, this.$slots.divider ? this.$slots.divider : this.divider)\n },\n genItems () {\n const items = []\n const hasSlot = !!this.$scopedSlots.item\n const keys = []\n\n for (let i = 0; i < this.items.length; i++) {\n const item = this.items[i]\n\n keys.push(item.text)\n\n if (hasSlot) items.push(this.$scopedSlots.item!({ item }))\n else items.push(this.$createElement(VBreadcrumbsItem, { key: keys.join('.'), props: item }, [item.text]))\n\n if (i < this.items.length - 1) items.push(this.genDivider())\n }\n\n return items\n }\n },\n\n render (h): VNode {\n const children = this.$slots.default ? this.genChildren() : this.genItems()\n\n return h('ul', {\n staticClass: 'v-breadcrumbs',\n 'class': this.classes\n }, children)\n }\n})\n"],"sourceRoot":""}
|