@trendyol/baklava
Version:
Trendyol Baklava Design System
12 lines (10 loc) • 1.64 kB
JavaScript
import{a as m}from"./chunk-GRL4DWKG.js";import{a as f,b as v,c as g}from"./chunk-IRDH7CN2.js";import{a as x}from"./chunk-3USCFSFQ.js";import{b as u}from"./chunk-7GK5LKBV.js";import{a as c,b as p,f as d}from"./chunk-4OT5AMS5.js";import{c as e}from"./chunk-VO7C5OZC.js";var o=class extends x{};o.directiveName="unsafeSVG",o.resultType=2;var y=u(o);var l="./assets";function S(s){l=s}function w(){return l}var E=import.meta.url;E&&S(new URL(l,E).toString());var $=c`:host{display:inline-block}:host div{display:flex;align-items:stretch;width:1em;height:1em;min-width:1em;min-height:1em;overflow:hidden;transform:translateZ(0)}:host svg{width:1em;height:1em}`,P=$;var h=new Map,t=class extends d{static get styles(){return[P]}get name(){return this._iconName}set name(n){n!==this._iconName&&(this._iconName=n,this.load())}async load(){let r=`${w()}/${this.name}.svg`;h.has(r)||h.set(r,fetch(r));try{let i=await h.get(r),a=i==null?void 0:i.clone();a!=null&&a.ok?(this.svg=await a.text(),this.onLoad(`${this.name} icon loaded`),this.requestUpdate()):this.onError(`${this.name} icon failed to load`)}catch(i){this.onError(`${this.name} icon failed to load [${i}]`)}}render(){return p`<div aria-hidden="true">${y(this.svg)}</div>`}};e([v()],t.prototype,"name",1),e([m("bl-load")],t.prototype,"onLoad",2),e([m("bl-error")],t.prototype,"onError",2),e([g()],t.prototype,"svg",2),t=e([f("bl-icon")],t);export{S as a,w as b,t as c};
/*! Bundled license information:
lit-html/directives/unsafe-svg.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
*/
//# sourceMappingURL=chunk-LDNUCSUE.js.map