UNPKG

and-component-library

Version:

Distribution of AND Web Components

3 lines (2 loc) 4.37 kB
function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){t.appendChild(e)}function l(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode.removeChild(t)}function a(t){return document.createElement(t)}function f(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}let u;function d(t){u=t}const h=[],p=[],$=[],g=[],m=Promise.resolve();let _=!1;function k(t){$.push(t)}let b=!1;const y=new Set;function x(){if(!b){b=!0;do{for(let t=0;t<h.length;t+=1){const e=h[t];d(e),v(e.$$)}for(d(null),h.length=0;p.length;)p.pop()();for(let t=0;t<$.length;t+=1){const e=$[t];y.has(e)||(y.add(e),e())}$.length=0}while(h.length);for(;g.length;)g.pop()();_=!1,b=!1,y.clear()}}function v(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(k)}}const w=new Set;function E(t,e){-1===t.$$.dirty[0]&&(h.push(t),_||(_=!0,m.then(x)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function C(i,s,l,a,f,h,p=[-1]){const $=u;d(i);const g=s.props||{},m=i.$$={fragment:null,ctx:null,props:h,update:t,not_equal:f,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map($?$.$$.context:[]),callbacks:n(),dirty:p,skip_bound:!1};let _=!1;if(m.ctx=l?l(i,g,(t,e,...n)=>{const o=n.length?n[0]:e;return m.ctx&&f(m.ctx[t],m.ctx[t]=o)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](o),_&&E(i,t)),e}):[],m.update(),_=!0,o(m.before_update),m.fragment=!!a&&a(m.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);m.fragment&&m.fragment.l(t),t.forEach(c)}else m.fragment&&m.fragment.c();s.intro&&((b=i.$$.fragment)&&b.i&&(w.delete(b),b.i(y))),function(t,n,i){const{fragment:s,on_mount:l,on_destroy:c,after_update:a}=t.$$;s&&s.m(n,i),k(()=>{const n=l.map(e).filter(r);c?c.push(...n):o(n),t.$$.on_mount=[]}),a.forEach(k)}(i,s.target,s.anchor),x()}var b,y;d($)}let A;function M(e){let n,o,r;return{c(){n=a("li"),o=a("a"),r=a("slot"),this.c=t,f(o,"id",e[3]),f(o,"data-testid","link_item"),f(o,"class","footer__link"),f(o,"href",e[0]),f(o,"target",e[1]),f(n,"id",e[2])},m(t,e){l(t,n,e),s(n,o),s(o,r)},p(t,[e]){8&e&&f(o,"id",t[3]),1&e&&f(o,"href",t[0]),2&e&&f(o,"target",t[1]),4&e&&f(n,"id",t[2])},i:t,o:t,d(t){t&&c(n)}}}function j(t,e,n){let{href:o="#"}=e,{target:r="_self"}=e,{listid:i="link-item"}=e,{linkid:s="link"}=e;return t.$$set=t=>{"href"in t&&n(0,o=t.href),"target"in t&&n(1,r=t.target),"listid"in t&&n(2,i=t.listid),"linkid"in t&&n(3,s=t.linkid)},[o,r,i,s]}"function"==typeof HTMLElement&&(A=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class H extends A{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import url(https://fonts.googleapis.com/css2?family=Poppins);:root{--step:50}:root{--color:currentColor}a{color:var(--color)}.footer__link{text-decoration:none;font-weight:700;font-size:1.2rem;margin-top:2rem}.footer__link:hover{text-decoration:underline}li:not(:first-child){margin-top:0.5rem}li{list-style:none}</style>",C(this,{target:this.shadowRoot},j,M,i,{href:0,target:1,listid:2,linkid:3}),t&&(t.target&&l(t.target,this,t.anchor),t.props&&(this.$set(t.props),x()))}static get observedAttributes(){return["href","target","listid","linkid"]}get href(){return this.$$.ctx[0]}set href(t){this.$set({href:t}),x()}get target(){return this.$$.ctx[1]}set target(t){this.$set({target:t}),x()}get listid(){return this.$$.ctx[2]}set listid(t){this.$set({listid:t}),x()}get linkid(){return this.$$.ctx[3]}set linkid(t){this.$set({linkid:t}),x()}}customElements.define("and-link-item",H);export default H; //# sourceMappingURL=LinkItem.js.map