1 line
16 KiB
Plaintext
1 line
16 KiB
Plaintext
|
|
{"version":3,"file":"index.mjs","sources":["../../src/breadcrumb/BaseBreadcrumb.vue","../../src/breadcrumb/BreadcrumbItem.vue","../../src/breadcrumb/BreadcrumbItem.vue?vue&type=template&id=0beececf&lang.js","../../src/breadcrumb/Breadcrumb.vue","../../src/breadcrumb/Breadcrumb.vue?vue&type=template&id=15da4abe&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport BreadcrumbStyle from 'primevue/breadcrumb/style';\n\nexport default {\n name: 'BaseBreadcrumb',\n extends: BaseComponent,\n props: {\n model: {\n type: Array,\n default: null\n },\n home: {\n type: null,\n default: null\n }\n },\n style: BreadcrumbStyle,\n provide() {\n return {\n $pcBreadcrumb: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <li v-if=\"visible()\" :class=\"[cx('item'), item.class]\" v-bind=\"ptm('item', ptmOptions)\">\n <template v-if=\"!templates.item\">\n <a :href=\"item.url || '#'\" :class=\"cx('itemLink')\" :target=\"item.target\" :aria-current=\"isCurrentUrl()\" @click=\"onClick\" v-bind=\"ptm('itemLink', ptmOptions)\">\n <component v-if=\"templates && templates.itemicon\" :is=\"templates.itemicon\" :item=\"item\" :class=\"cx('itemIcon', ptmOptions)\" />\n <span v-else-if=\"item.icon\" :class=\"[cx('itemIcon'), item.icon]\" v-bind=\"ptm('itemIcon', ptmOptions)\" />\n <span v-if=\"item.label\" :class=\"cx('itemLabel')\" v-bind=\"ptm('itemLabel', ptmOptions)\">{{ label() }}</span>\n </a>\n </template>\n <component v-else :is=\"templates.item\" :item=\"item\" :label=\"label()\" :props=\"getMenuItemProps\"></component>\n </li>\n</template>\n\n<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport { mergeProps } from 'vue';\n\nexport default {\n name: 'BreadcrumbItem',\n hostName: 'Breadcrumb',\n extends: BaseComponent,\n props: {\n item: null,\n templates: null,\n index: null\n },\n methods: {\n onClick(event) {\n if (this.item.command) {\n this.item.command({\n originalEvent: event,\n item: this.item\n });\n }\n },\n visible() {\n return typeof this.item.visible === 'function' ? this.item.visible() : this.item.visible !== false;\n },\n disabled() {\n return typeof this.item.disabled === 'function' ? this.item.disabled() : this.item.disabled;\n },\n label() {\n return typeof this.item.label === 'function' ? this.item.label() : this.item.label;\n },\n isCurrentUrl() {\n const { to, url } = this.item;\n const lastPath = typeof window !== 'undefined' ? window.location.pathname : '';\n\n return to === lastPath || url === lastPath ? 'page' : undefined;\n }\n },\n computed: {\n ptmOptions() {\n return {\n context: {\n item: this.item,\n index: this.index\n }\n };\n },\n getMenuItemProps() {\n return {\n action: mergeProps(\n {\n class: this.cx('itemLink'),\n 'aria-current': this.isCurrentUrl(),\n onClick: ($event) => this.onClick($event)\n },\n this.ptm('itemLink', this.ptmOptions)\n ),\n icon: mergeProps(\n {\n class: [this.cx('icon'), this.item.icon]\n },\n this.ptm('icon', this.ptmOptions)\n ),\n label: mergeProps(\n {\n class: this.cx('label')\n },\n this.ptm('label', this.ptmOptions)\n
|