UNPKG

@diondre27/smart-components

Version:

Smart Web Components

1 lines 1.32 kB
System.register(["./p-ed1d2ced.system.js"],(function(t){"use strict";var n,e,r,o;return{setters:[function(t){n=t.r;e=t.h;r=t.g;o=t.H}],execute:function(){var i=t("smart_button",function(){function t(t){n(this,t)}t.prototype.render=function(){return e("div",{class:"container"},e("div",{class:"row"},e("button",{type:"button",class:"btn btn-primary"},this.buttonText)))};return t}());var u=new Map;var s=function(t){var n=u.get(t);if(!n){n=fetch(t).then((function(t){if(t.status<=299){return t.text()}console.warn("Icon not found");return Promise.resolve(null)}));u.set(t,n)}return n};var c=t("smart_icon",function(){function t(t){n(this,t)}t.prototype.connectedCallback=function(){this.loadIcon()};t.prototype.loadIcon=function(){var t=this;var n="svg/smart-"+this.icon+".svg";var e=r(n);if(this.icon){s(e).then((function(n){return t.svgContent=n}))}};t.prototype.render=function(){return e(o,{role:"img"},this.svgContent?e("div",{innerHTML:this.svgContent}):e("div",null))};Object.defineProperty(t,"assetsDirs",{get:function(){return["svg"]},enumerable:true,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{icon:["loadIcon"]}},enumerable:true,configurable:true});Object.defineProperty(t,"style",{get:function(){return":host{display:block}"},enumerable:true,configurable:true});return t}())}}}));