@gov-design-system-ce/components 0.0.47 → 0.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/components/gov-icon2.js +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/critical.css +2532 -0
- package/dist/core/{p-22fe326f.entry.js → p-21d08d89.entry.js} +2 -2
- package/dist/custom-elements/index.js +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/package.json +1 -1
- /package/dist/core/{p-22fe326f.entry.js.map → p-21d08d89.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t,r as s,h as i,H as n,g as o}from"./p-4af5e4f4.js";import{i as e}from"./p-34152b51.js";import{g as a}from"./p-3f37ddb6.js";import"./p-03990da5.js";var r;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(r||(r={}));const c={root:"gov-icon",holder:"gov-icon__holder"};const h="0.0.
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{a as t,r as s,h as i,H as n,g as o}from"./p-4af5e4f4.js";import{i as e}from"./p-34152b51.js";import{g as a}from"./p-3f37ddb6.js";import"./p-03990da5.js";var r;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(r||(r={}));const c={root:"gov-icon",holder:"gov-icon__holder"};const h="0.0.48";const l=()=>h;const p={};const f={};const d=t=>t.startsWith("http://")||t.startsWith("https://");const u=(s,i,n)=>{if(d(s)){return`${s}/${n}/${i}.svg?v=${l()}`}return t(`${s}/${n}/${i}.svg`)+`?v=${l()}`};async function g({name:t,type:s}){if(p[t]){return p[t]}if(!f[t]){f[t]=fetch(u(e(),t,s)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const i=await f[t];p[t]=i;return i}const m=".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-icon{display:inline-flex}.gov-icon__holder,.gov-icon svg{display:inline-flex;width:100%;height:100%}";const y=class{constructor(t){s(this,t);this.name=null;this.type="basic";this.iconData=undefined;this.visible=false;this.error=false;this.h=a(this.host)}async loadIconPathData(){const{name:t,visible:s,type:i}=this;if(!t||!s){return}try{this.iconData=await g({name:t,type:i})}catch(t){this.error=true}}connectedCallback(){this.waitUntilVisible((async()=>{this.visible=true;await this.loadIconPathData()}))}disconnectedCallback(){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}}async componentWillLoad(){await this.loadIconPathData()}waitUntilVisible(t){if(typeof window==="undefined"||!window.IntersectionObserver){t();return}this.intersectionObserver=new IntersectionObserver((s=>{s.forEach((s=>{if(s.isIntersecting){this.intersectionObserver.disconnect();this.intersectionObserver=null;t()}}))}),{rootMargin:"50px"});this.intersectionObserver.observe(this.host)}render(){if(this.error){return null}return i(n,{class:this.h.classes(c.root)},i("span",{class:c.holder,innerHTML:this.iconData}))}static get assetsDirs(){return["assets"]}get host(){return o(this)}static get watchers(){return{name:["loadIconPathData"]}}};y.style=m;export{y as gov_icon};
|
|
2
|
+
//# sourceMappingURL=p-21d08d89.entry.js.map
|