UNPKG

and-component-library

Version:

Distribution of AND Web Components

3 lines (2 loc) 4.15 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 s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function i(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode.removeChild(t)}function l(t){return document.createElement(t)}function a(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}let u;function d(t){u=t}function f(t){(function(){if(!u)throw new Error("Function called outside component initialization");return u})().$$.on_mount.push(t)}const p=[],h=[],$=[],g=[],m=Promise.resolve();let b=!1;function y(){b||(b=!0,m.then(k))}function _(t){$.push(t)}let x=!1;const w=new Set;function k(){if(!x){x=!0;do{for(let t=0;t<p.length;t+=1){const e=p[t];d(e),E(e.$$)}for(d(null),p.length=0;h.length;)h.pop()();for(let t=0;t<$.length;t+=1){const e=$[t];w.has(e)||(w.add(e),e())}$.length=0}while(p.length);for(;g.length;)g.pop()();b=!1,x=!1,w.clear()}}function E(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(_)}}const S=new Set;function v(s,i,l,a,f,h,$=[-1]){const g=u;d(s);const m=i.props||{},b=s.$$={fragment:null,ctx:null,props:h,update:t,not_equal:f,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(g?g.$$.context:[]),callbacks:n(),dirty:$,skip_bound:!1};let x=!1;if(b.ctx=l?l(s,m,(t,e,...n)=>{const o=n.length?n[0]:e;return b.ctx&&f(b.ctx[t],b.ctx[t]=o)&&(!b.skip_bound&&b.bound[t]&&b.bound[t](o),x&&function(t,e){-1===t.$$.dirty[0]&&(p.push(t),y(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}(s,t)),e}):[],b.update(),x=!0,o(b.before_update),b.fragment=!!a&&a(b.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);b.fragment&&b.fragment.l(t),t.forEach(c)}else b.fragment&&b.fragment.c();i.intro&&((w=s.$$.fragment)&&w.i&&(S.delete(w),w.i(E))),function(t,n,s){const{fragment:i,on_mount:c,on_destroy:l,after_update:a}=t.$$;i&&i.m(n,s),_(()=>{const n=c.map(e).filter(r);l?l.push(...n):o(n),t.$$.on_mount=[]}),a.forEach(_)}(s,i.target,i.anchor),k()}var w,E;d(g)}let C;function L(e){let n,o;return{c(){n=l("ol"),o=l("slot"),o.innerHTML="<li>placeholder item</li>",this.c=t,a(n,"id",e[0]),a(n,"class","progressbar")},m(t,r){i(t,n,r),function(t,e){t.appendChild(e)}(n,o),e[2](n)},p(t,[e]){1&e&&a(n,"id",t[0])},i:t,o:t,d(t){t&&c(n),e[2](null)}}}function q(t,e,n){let{id:o="progress-bar"}=e,r="";return f(async()=>{await(y(),m),r.querySelector("slot")&&(()=>{const t=r.querySelector("slot").assignedElements()[0].shadowRoot.querySelector("li"),e=t.querySelector("a");e?e.classList.add("rmline"):t.classList.add("rmline")})()}),t.$$set=t=>{"id"in t&&n(0,o=t.id)},[o,r,function(t){h[t?"unshift":"push"](()=>{r=t,n(1,r)})}]}"function"==typeof HTMLElement&&(C=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 A extends C{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import url(https://fonts.googleapis.com/css2?family=Poppins);:root{--step:50}.progressbar{padding-inline-start:0;display:flex;justify-content:space-between}.progressbar ::slotted(*){flex-grow:1}</style>",v(this,{target:this.shadowRoot},q,L,s,{id:0}),t&&(t.target&&i(t.target,this,t.anchor),t.props&&(this.$set(t.props),k()))}static get observedAttributes(){return["id"]}get id(){return this.$$.ctx[0]}set id(t){this.$set({id:t}),k()}}customElements.define("and-step-progress-indicator",A);export default A; //# sourceMappingURL=StepProgressIndicator.js.map