Breadcrumb.js 783 B

1
  1. import React from'react';import Module from'../Module';import Link from'./Link.js';class Breadcrumb extends Module{constructor(a){super(a)}render(){let a=this.RoutingSystem.getRoutesRegs(),b=this.RoutingSystem.getRoute(),c=b.url||'',d=[];for(var e in a)a[e].reg.test(c)&&d.push(a[e]);let f=d.sort((c,a)=>c.url.length-a.url.length),g=f.map((a,b)=>React.createElement('li',{key:b,className:'breadcrumb-item'},React.createElement(Link,{link:a.id},this.RoutingSystem.getRouteName(a.id))));return React.createElement('div',{className:this.props.className+' Breadcrumb '},React.createElement('nav',{"aria-label":'breadcrumb'},React.createElement('ol',{className:'breadcrumb'},g)),super.render())}}Breadcrumb.EditPosition='top-center',Breadcrumb.Category='Layout';export default Breadcrumb;