UNPKG

primevue

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) [![Discord Chat](https://img.shields.io/discord/55794023

2 lines (1 loc) 4.09 kB
"use strict";var e=require("vue"),t={name:"BreadcrumbItem",props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.item.command&&this.item.command({originalEvent:e,item:this.item}),this.item.to&&t&&t(e)},containerClass(e){return[{"p-disabled":this.disabled(e)},this.item.class]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},computed:{iconClass(){return["p-menuitem-icon",this.item.icon]}}};const l=["href","onClick"],n={key:1,class:"p-menuitem-text"},a=["href","target"],i={key:1,class:"p-menuitem-text"};t.render=function(t,o,c,m,r,s){const p=e.resolveComponent("router-link");return s.visible()?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass(s.containerClass(c.item))},[c.template?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.template),{key:1,item:c.item},null,8,["item"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.item.to?(e.openBlock(),e.createBlock(p,{key:0,to:c.item.to,custom:""},{default:e.withCtx((({navigate:t,href:a,isActive:i,isExactActive:o})=>[e.createElementVNode("a",{href:a,class:e.normalizeClass(s.linkClass({isActive:i,isExactActive:o})),onClick:e=>s.onClick(e,t)},[c.item.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(s.iconClass)},null,2)):e.createCommentVNode("",!0),c.item.label?(e.openBlock(),e.createElementBlock("span",n,e.toDisplayString(s.label()),1)):e.createCommentVNode("",!0)],10,l)])),_:1},8,["to"])):(e.openBlock(),e.createElementBlock("a",{key:1,href:c.item.url||"#",class:e.normalizeClass(s.linkClass()),onClick:o[0]||(o[0]=(...e)=>s.onClick&&s.onClick(...e)),target:c.item.target},[c.item.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(s.iconClass)},null,2)):e.createCommentVNode("",!0),c.item.label?(e.openBlock(),e.createElementBlock("span",i,e.toDisplayString(s.label()),1)):e.createCommentVNode("",!0)],10,a))],64))],2)):e.createCommentVNode("",!0)};var o={name:"Breadcrumb",props:{model:{type:Array,default:null},home:{type:null,default:null},exact:{type:Boolean,default:!0}},components:{BreadcrumbItem:t}};const c={class:"p-breadcrumb p-component","aria-label":"Breadcrumb"},m=e.createElementVNode("li",{class:"p-breadcrumb-chevron pi pi-chevron-right"},null,-1);!function(e,t){void 0===t&&(t={});var l=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===l&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("\n.p-breadcrumb {\n overflow-x: auto;\n}\n.p-breadcrumb ul {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n}\n.p-breadcrumb .p-menuitem-text {\n line-height: 1;\n}\n.p-breadcrumb .p-menuitem-link {\n text-decoration: none;\n}\n.p-breadcrumb::-webkit-scrollbar {\n display: none;\n}\n"),o.render=function(t,l,n,a,i,o){const r=e.resolveComponent("BreadcrumbItem");return e.openBlock(),e.createElementBlock("nav",c,[e.createElementVNode("ul",null,[n.home?(e.openBlock(),e.createBlock(r,{key:0,item:n.home,class:"p-breadcrumb-home",template:t.$slots.item,exact:n.exact},null,8,["item","template","exact"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.model,(l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.label},[m,e.createVNode(r,{item:l,template:t.$slots.item,exact:n.exact},null,8,["item","template","exact"])],64)))),128))])])},module.exports=o;