UNPKG

1.82 kBJavaScriptView Raw
1System.register(["./p-f2fe8549.system.js","./p-b419947f.system.js","./p-06295f6e.system.js","./p-2b68eef2.system.js","./p-465038e0.system.js"],function(t){"use strict";var i,e,s,r,n,a;return{setters:[function(t){i=t.r;e=t.h;s=t.g},function(t){r=t.A},function(t){n=t.m},function(){},function(t){a=t.i}],execute:function(){var o=function(t,i){if(t.charAt(0)=="/"&&i.charAt(i.length-1)=="/"){return i.slice(0,i.length-1)+t}return i+t};var c=function(){function t(t){i(this,t);this.unsubscribe=function(){return};this.activeClass="link-active";this.exact=false;this.strict=true;this.custom="a";this.match=null}t.prototype.componentWillLoad=function(){this.computeMatch()};t.prototype.computeMatch=function(){if(this.location){this.match=n(this.location.pathname,{path:this.urlMatch||this.url,exact:this.exact,strict:this.strict})}};t.prototype.handleClick=function(t){if(a(t)||!this.history||!this.url||!this.root){return}t.preventDefault();return this.history.push(o(this.url,this.root))};t.prototype.render=function(){var t;var i={class:(t={},t[this.activeClass]=this.match!==null,t),onClick:this.handleClick.bind(this)};if(this.anchorClass){i.class[this.anchorClass]=true}if(this.custom==="a"){i=Object.assign({},i,{href:this.url,title:this.anchorTitle,role:this.anchorRole,tabindex:this.anchorTabIndex,"aria-haspopup":this.ariaHaspopup,id:this.anchorId,"aria-posinset":this.ariaPosinset,"aria-setsize":this.ariaSetsize,"aria-label":this.ariaLabel})}return e(this.custom,Object.assign({},i),e("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:true,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{location:["computeMatch"]}},enumerable:true,configurable:true});return t}();t("stencil_route_link",c);r.injectProps(c,["history","location","root"])}}});
\No newline at end of file