@mgdis/stencil-helpers 2.2.0 → 2.2.2
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/index.es.js +345 -339
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/dist/tests/unit.d.ts +10 -0
- package/dist/tests/unit.d.ts.map +1 -1
- package/package.json +14 -22
package/dist/index.umd.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
(function(a,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(a=typeof globalThis<"u"?globalThis:a||self,p(a.StencilHelpersModule={}))})(this,function(a){"use strict";var vt=Object.defineProperty;var Se=a=>{throw TypeError(a)};var yt=(a,p,m)=>p in a?vt(a,p,{enumerable:!0,configurable:!0,writable:!0,value:m}):a[p]=m;var y=(a,p,m)=>yt(a,typeof p!="symbol"?p+"":p,m),ht=(a,p,m)=>p.has(a)||Se("Cannot "+m);var N=(a,p,m)=>(ht(a,p,"read from private field"),m?m.call(a):p.get(a)),Q=(a,p,m)=>p.has(a)?Se("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(a):p.set(a,m);var E,U;const p=(e="",t=10)=>{const s=new Uint8Array(t);crypto.getRandomValues(s);const r=Array.from(s).map(n=>n.toString(16).padStart(2,"0")).join("").slice(0,t);return e!==""?`${e}-${r}`:r},m=e=>Y(e)&&/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e)!==null;class Te{constructor(t=[]){y(this,"classes");y(this,"add",t=>{this.has(t)||this.classes.push(t)});y(this,"delete",t=>{const s=this.classes.indexOf(t);s>-1&&this.classes.splice(s,1)});y(this,"has",t=>this.classes.includes(t));y(this,"join",()=>this.classes.join(" "));this.classes=t}}const ke=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"),Ae=(e,t)=>t.includes(e==null?void 0:e.tagName.toLowerCase()),Ee='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',je=e=>{const t=H(e),s=Z(e);return[e,...t,...s]},H=(e,t=[])=>{if(e.self!==e.top)try{const s=e.parent;return s?(t.push(s),H(s,t)):t}catch(s){return console.error("Different hosts between iframes:",s),t}return t},Z=(e,t=[])=>{if(e.frames.length>0)for(const s of Array.from(e.frames))t.push(s),Z(s,t);return t},Y=e=>typeof e=="string"&&e.trim()!=="",Le=e=>typeof e=="object"?JSON.stringify(e):`${e}`,Oe=e=>typeof e=="number"&&!Number.isNaN(e),Re=e=>typeof e=="string"?e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):e,Me=async e=>e();var j={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,formAssociated:!1,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!0,asyncQueue:!1,transformTagName:!1,attachStyles:!0,experimentalSlotFixes:!1},Ne=Object.defineProperty,xe=(e,t)=>{for(var s in t)Ne(e,s,{get:t[s],enumerable:!0})},V=(e,t)=>t in e,ee="http://www.w3.org/1999/xlink",I=typeof window<"u"?window:{},F=I.document||{head:{}};I.HTMLElement;var L={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,s,r)=>e.addEventListener(t,s,r),rel:(e,t,s,r)=>e.removeEventListener(t,s,r),ce:(e,t)=>new CustomEvent(e,t)},te={},De="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml",_e=e=>e!=null,se=e=>(e=typeof e,e==="object"||e==="function"),Ce={};xe(Ce,{err:()=>re,map:()=>Pe,ok:()=>z,unwrap:()=>we,unwrapErr:()=>Ue});var z=e=>({isOk:!0,isErr:!1,value:e}),re=e=>({isOk:!1,isErr:!0,value:e});function Pe(e,t){if(e.isOk){const s=t(e.value);return s instanceof Promise?s.then(r=>z(r)):z(s)}if(e.isErr){const s=e.value;return re(s)}throw"should never get here"}var we=e=>{if(e.isOk)return e.value;throw e.value},Ue=e=>{if(e.isErr)return e.value;throw e.value},We=(e,t,...s)=>{let r=null,n=null,o=null,i=!1,c=!1;const f=[],g=l=>{for(let $=0;$<l.length;$++)r=l[$],Array.isArray(r)?g(r):r!=null&&typeof r!="boolean"&&((i=!se(r))&&(r=String(r)),i&&c?f[f.length-1].$text$+=r:f.push(i?B(null,r):r),c=i)};g(s);const u=B(e,null);return u.$attrs$=t,f.length>0&&(u.$children$=f),u.$key$=n,u.$name$=o,u},B=(e,t)=>{const s={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return s.$attrs$=null,s.$key$=null,s.$name$=null,s},He={},Ie=e=>e&&e.$tag$===He,ne=(e,t,s,r,n,o)=>{if(s!==r){let i=V(e,t),c=t.toLowerCase();if(t==="class"){const f=e.classList,g=oe(s),u=oe(r);f.remove(...g.filter(l=>l&&!u.includes(l))),f.add(...u.filter(l=>l&&!g.includes(l)))}else if(t==="style"){for(const f in s)(!r||r[f]==null)&&(f.includes("-")?e.style.removeProperty(f):e.style[f]="");for(const f in r)(!s||r[f]!==s[f])&&(f.includes("-")?e.style.setProperty(f,r[f]):e.style[f]=r[f])}else if(t!=="key")if(t==="ref")r&&r(e);else if(!e.__lookupSetter__(t)&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):V(I,c)?t=c.slice(2):t=c[2]+t.slice(3),s||r){const f=t.endsWith(ie);t=t.replace(Be,""),s&&L.rel(e,t,s,f),r&&L.ael(e,t,r,f)}}else{const f=se(r);if((i||f&&r!==null)&&!n)try{if(e.tagName.includes("-"))e[t]=r;else{const u=r??"";t==="list"?i=!1:(s==null||e[t]!=u)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=u:e.setAttribute(t,u))}}catch{}let g=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(t=c,g=!0),r==null||r===!1?(r!==!1||e.getAttribute(t)==="")&&(g?e.removeAttributeNS(ee,t):e.removeAttribute(t)):(!i||o&4||n)&&!f&&(r=r===!0?"":r,g?e.setAttributeNS(ee,t,r):e.setAttribute(t,r))}}},ze=/\s/,oe=e=>e?e.split(ze):[],ie="Capture",Be=new RegExp(ie+"$"),le=(e,t,s)=>{const r=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,n=e&&e.$attrs$||te,o=t.$attrs$||te;for(const i of ae(Object.keys(n)))i in o||ne(r,i,n[i],void 0,s,t.$flags$);for(const i of ae(Object.keys(o)))ne(r,i,n[i],o[i],s,t.$flags$)};function ae(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var O,q,R,_=!1,C=!1,G=!1,b=!1,P=(e,t,s,r)=>{var n;const o=t.$children$[s];let i=0,c,f,g;if(_||(G=!0,o.$tag$==="slot"&&(O&&r.classList.add(O+"-s"),o.$flags$|=o.$children$?2:1)),o.$text$!==null)c=o.$elm$=F.createTextNode(o.$text$);else if(o.$flags$&1)c=o.$elm$=F.createTextNode("");else{if(b||(b=o.$tag$==="svg"),c=o.$elm$=F.createElementNS(b?De:Fe,!_&&j.slotRelocation&&o.$flags$&2?"slot-fb":o.$tag$),b&&o.$tag$==="foreignObject"&&(b=!1),le(null,o,b),!!c.getRootNode().querySelector("body")&&j.scoped&&_e(O)&&c["s-si"]!==O&&c.classList.add(c["s-si"]=O),J(c,r),o.$children$)for(i=0;i<o.$children$.length;++i)f=P(e,o,i,c),f&&c.appendChild(f);o.$tag$==="svg"?b=!1:c.tagName==="foreignObject"&&(b=!0)}return c["s-hn"]=R,o.$flags$&3&&(c["s-sr"]=!0,c["s-cr"]=q,c["s-sn"]=o.$name$||"",c["s-rf"]=(n=o.$attrs$)==null?void 0:n.ref,g=e&&e.$children$&&e.$children$[s],g&&g.$tag$===o.$tag$&&e.$elm$&&x(e.$elm$,!1)),c},x=(e,t)=>{L.$flags$|=1;const s=Array.from(e.childNodes);if(e["s-sr"]&&j.experimentalSlotFixes){let r=e;for(;r=r.nextSibling;)r&&r["s-sn"]===e["s-sn"]&&r["s-sh"]===R&&s.push(r)}for(let r=s.length-1;r>=0;r--){const n=s[r];n["s-hn"]!==R&&n["s-ol"]&&(A(ue(n),n,X(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,G=!0),t&&x(n,t)}L.$flags$&=-2},ce=(e,t,s,r,n,o)=>{let i=e["s-cr"]&&e["s-cr"].parentNode||e,c;for(i.shadowRoot&&i.tagName===R&&(i=i.shadowRoot);n<=o;++n)r[n]&&(c=P(null,s,n,e),c&&(r[n].$elm$=c,A(i,c,X(t))))},fe=(e,t,s)=>{for(let r=t;r<=s;++r){const n=e[r];if(n){const o=n.$elm$;pe(n),o&&(C=!0,o["s-ol"]?o["s-ol"].remove():x(o,!0),o.remove())}}},qe=(e,t,s,r,n=!1)=>{let o=0,i=0,c=0,f=0,g=t.length-1,u=t[0],l=t[g],$=r.length-1,d=r[0],v=r[$],k,S;for(;o<=g&&i<=$;)if(u==null)u=t[++o];else if(l==null)l=t[--g];else if(d==null)d=r[++i];else if(v==null)v=r[--$];else if(w(u,d,n))M(u,d,n),u=t[++o],d=r[++i];else if(w(l,v,n))M(l,v,n),l=t[--g],v=r[--$];else if(w(u,v,n))(u.$tag$==="slot"||v.$tag$==="slot")&&x(u.$elm$.parentNode,!1),M(u,v,n),A(e,u.$elm$,l.$elm$.nextSibling),u=t[++o],v=r[--$];else if(w(l,d,n))(u.$tag$==="slot"||v.$tag$==="slot")&&x(l.$elm$.parentNode,!1),M(l,d,n),A(e,l.$elm$,u.$elm$),l=t[--g],d=r[++i];else{for(c=-1,f=o;f<=g;++f)if(t[f]&&t[f].$key$!==null&&t[f].$key$===d.$key$){c=f;break}c>=0?(S=t[c],S.$tag$!==d.$tag$?k=P(t&&t[i],s,c,e):(M(S,d,n),t[c]=void 0,k=S.$elm$),d=r[++i]):(k=P(t&&t[i],s,i,e),d=r[++i]),k&&A(ue(u.$elm$),k,X(u.$elm$))}o>g?ce(e,r[$+1]==null?null:r[$+1].$elm$,s,r,i,$):i>$&&fe(t,o,g)},w=(e,t,s=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?"$nodeId$"in e&&s&&e.$elm$.nodeType!==8?!1:e.$name$===t.$name$:s?!0:e.$key$===t.$key$:!1,X=e=>e&&e["s-ol"]||e,ue=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,M=(e,t,s=!1)=>{const r=t.$elm$=e.$elm$,n=e.$children$,o=t.$children$,i=t.$tag$,c=t.$text$;let f;c===null?(b=i==="svg"?!0:i==="foreignObject"?!1:b,i==="slot"&&!_||le(e,t,b),n!==null&&o!==null?qe(r,n,t,o,s):o!==null?(e.$text$!==null&&(r.textContent=""),ce(r,null,t,o,0,o.length-1)):!s&&j.updatable&&n!==null&&fe(n,0,n.length-1),b&&i==="svg"&&(b=!1)):(f=r["s-cr"])?f.parentNode.textContent=c:e.$text$!==c&&(r.data=c)},de=e=>{const t=e.childNodes;for(const s of t)if(s.nodeType===1){if(s["s-sr"]){const r=s["s-sn"];s.hidden=!1;for(const n of t)if(n!==s){if(n["s-hn"]!==s["s-hn"]||r!==""){if(n.nodeType===1&&(r===n.getAttribute("slot")||r===n["s-sn"])||n.nodeType===3&&r===n["s-sn"]){s.hidden=!0;break}}else if(n.nodeType===1||n.nodeType===3&&n.textContent.trim()!==""){s.hidden=!0;break}}}de(s)}},T=[],$e=e=>{let t,s,r;for(const n of e.childNodes){if(n["s-sr"]&&(t=n["s-cr"])&&t.parentNode){s=t.parentNode.childNodes;const o=n["s-sn"];for(r=s.length-1;r>=0;r--)if(t=s[r],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==n["s-hn"]&&!j.experimentalSlotFixes)if(ge(t,o)){let i=T.find(c=>c.$nodeToRelocate$===t);C=!0,t["s-sn"]=t["s-sn"]||o,i?(i.$nodeToRelocate$["s-sh"]=n["s-hn"],i.$slotRefNode$=n):(t["s-sh"]=n["s-hn"],T.push({$slotRefNode$:n,$nodeToRelocate$:t})),t["s-sr"]&&T.map(c=>{ge(c.$nodeToRelocate$,t["s-sn"])&&(i=T.find(f=>f.$nodeToRelocate$===t),i&&!c.$slotRefNode$&&(c.$slotRefNode$=i.$slotRefNode$))})}else T.some(i=>i.$nodeToRelocate$===t)||T.push({$nodeToRelocate$:t})}n.nodeType===1&&$e(n)}},ge=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",pe=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(pe)},A=(e,t,s)=>{const r=e==null?void 0:e.insertBefore(t,s);return J(t,e),r},ve=e=>{const t=[];return e&&t.push(...e["s-scs"]||[],e["s-si"],e["s-sc"],...ve(e.parentElement)),t},J=(e,t,s=!1)=>{var r;if(e&&t&&e.nodeType===1){const n=new Set(ve(t).filter(Boolean));if(n.size&&((r=e.classList)==null||r.add(...e["s-scs"]=[...n]),e["s-ol"]||s))for(const o of Array.from(e.childNodes))J(o,e,!0)}},Ge=(e,t,s=!1)=>{var r,n,o,i,c;const f=e.$hostElement$,g=e.$cmpMeta$,u=e.$vnode$||B(null,null),l=Ie(t)?t:We(null,null,t);if(R=f.tagName,g.$attrsToReflect$&&(l.$attrs$=l.$attrs$||{},g.$attrsToReflect$.map(([$,d])=>l.$attrs$[d]=f[$])),s&&l.$attrs$)for(const $ of Object.keys(l.$attrs$))f.hasAttribute($)&&!["key","ref","style","class"].includes($)&&(l.$attrs$[$]=f[$]);l.$tag$=null,l.$flags$|=4,e.$vnode$=l,l.$elm$=u.$elm$=f.shadowRoot||f,O=f["s-sc"],_=(g.$flags$&1)!==0,q=f["s-cr"],C=!1,M(u,l,s);{if(L.$flags$|=1,G){$e(l.$elm$);for(const $ of T){const d=$.$nodeToRelocate$;if(!d["s-ol"]){const v=F.createTextNode("");v["s-nr"]=d,A(d.parentNode,d["s-ol"]=v,d)}}for(const $ of T){const d=$.$nodeToRelocate$,v=$.$slotRefNode$;if(v){const k=v.parentNode;let S=v.nextSibling;{let W=(r=d["s-ol"])==null?void 0:r.previousSibling;for(;W;){let h=(n=W["s-nr"])!=null?n:null;if(h&&h["s-sn"]===d["s-sn"]&&k===h.parentNode){for(h=h.nextSibling;h===d||h!=null&&h["s-sr"];)h=h==null?void 0:h.nextSibling;if(!h||!h["s-nr"]){S=h;break}}W=W.previousSibling}}(!S&&k!==d.parentNode||d.nextSibling!==S)&&d!==S&&(!d["s-hn"]&&d["s-ol"]&&(d["s-hn"]=d["s-ol"].parentNode.nodeName),A(k,d,S),d.nodeType===1&&(d.hidden=(o=d["s-ih"])!=null?o:!1)),d&&typeof v["s-rf"]=="function"&&v["s-rf"](d)}else d.nodeType===1&&(s&&(d["s-ih"]=(i=d.hidden)!=null?i:!1),d.hidden=!0)}}C&&de(l.$elm$),L.$flags$&=-2,T.length=0}if(j.experimentalScopedSlotChanges&&g.$flags$&2)for(const $ of l.$elm$.childNodes)$["s-hn"]!==R&&!$["s-sh"]&&(s&&$["s-ih"]==null&&($["s-ih"]=(c=$.hidden)!=null?c:!1),$.hidden=!0);q=void 0};const Xe=(e,t,s)=>{[null,void 0,"",!1].includes(s)||["innerHTML","style"].includes(t)||e.setAttribute(t,["object","function"].includes(typeof s)?"/!\\ Object props are not rendered in the code example":s)},ye=(e,t,s,r,n)=>{if(t&&typeof t=="string"){const o=document.createElement(t);Object.keys(s||{}).forEach(i=>{Xe(o,i,s[i])}),r==null||r.forEach(i=>{ye(o,i.$tag$,i.$attrs$,i.$children$,i.$text$)}),s!=null&&s.innerHTML&&(o.innerHTML=s.innerHTML),e.appendChild(o)}n&&(e.innerHTML=n)},Je=(e,t)=>{const s={};if(typeof e!="object")throw new Error("filterArgs - args isn't an object.");for(const r in e)if(!r.startsWith("slot")){const n=e[r],o=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();(!t||!Object.keys(t).includes(r)||t[r]!==n)&&(s[o]=n)}return s},Ke=(e,t)=>{var r,n;const s=document.getElementById("storybook-root");if(s!==null)return(n=document.querySelector("[lang]"))==null||n.setAttribute("lang",((r=t.globals)==null?void 0:r.locale)||"en"),Ge({$ancestorComponent$:void 0,$flags$:0,$modeName$:void 0,$cmpMeta$:{$flags$:0,$tagName$:s.tagName},$hostElement$:s},e(t)),s.children[s.children.length-1]},Qe=({$tag$:e,$attrs$:t,$children$:s,$text$:r})=>{const n=document.createElement("div");return ye(n,e,t,s,r),n.innerHTML},D=(e,t)=>{if(!t)return;const s=t.split("/");return`${e}${s.slice(2,s.length-1).join("-")}--docs`};class Ze{constructor(t){y(this,"jsonDoc");Q(this,E,t=>this.jsonDoc.components.find(s=>s.tag===t));Q(this,U,t=>{const s=t.type.replace(/"([^"]+)"/g,"$1").replace(/\s/g,"").replace(/\(.*?\)/g,r=>r.replace(/\|/g," OR ")).split("|").map(r=>r.trim().replace(/ OR /g,"|"));return t.type==="string"?{control:{type:"text"}}:t.type==="number"?{control:{type:"number"}}:t.type==="boolean"?{control:{type:"boolean"}}:t.type.startsWith("{")&&t.type.endsWith("}")?{control:{type:"object"}}:s.length>1?s.includes("string")?{control:{type:"text"}}:s.every(r=>r==null?void 0:r.includes("[]"))?{control:{type:"object"}}:(s.unshift(void 0),{control:{type:"select"},options:s}):{control:{type:"object"}}});y(this,"extractArgTypes",t=>{const s=N(this,E).call(this,t),r=s==null?void 0:s.props.reduce((u,l)=>{const{control:$,options:d}=N(this,U).call(this,l);return{...u,[l.name]:{name:l.attr||l.name,description:l.docs,type:{required:l.required},table:{category:"props",type:{summary:l.type},defaultValue:{summary:l.default}},control:$,options:d}}},{}),n=s==null?void 0:s.events.reduce((u,l)=>({...u,[l.event]:{name:l.event,description:l.docs,table:{category:"events",type:{summary:l.detail}}}}),{}),o=s==null?void 0:s.methods.reduce((u,l)=>({...u,[l.name]:{name:l.name,description:l.docs,table:{category:"methods",type:{summary:l.signature}}}}),{}),i=s==null?void 0:s.slots.reduce((u,l)=>({...u,[l.name]:{name:l.name!==""?l.name:"default",description:l.docs,table:{category:"slots",type:{summary:void 0}}}}),{}),c=s==null?void 0:s.styles.reduce((u,l)=>({...u,[l.name]:{name:l.name,description:l.docs,table:{category:"custom properties",type:{summary:void 0}}}}),{}),f=s==null?void 0:s.dependencies.reduce((u,l)=>{const $=N(this,E).call(this,l);return{...u,[l]:{name:l,description:`<a href="./?path=/docs/${D("",$==null?void 0:$.filePath)}">View Component Documentation</a>`,table:{category:"depends on",type:{summary:void 0}}}}},{}),g=s==null?void 0:s.dependents.reduce((u,l)=>{const $=N(this,E).call(this,l);return{...u,[l]:{name:l,description:`<a href="./?path=/docs/${D("",$==null?void 0:$.filePath)}">View Component Documentation</a>`,table:{category:"used by",type:{summary:void 0}}}}},{});return{...r,...n,...o,...i,...c,...f,...g}});y(this,"extractComponentDescription",t=>{const s=N(this,E).call(this,t);return(s==null?void 0:s.readme)||(s==null?void 0:s.docs)});this.jsonDoc=t}}E=new WeakMap,U=new WeakMap;const Ye=(e,t)=>{if(t)return`${e}${t}`},he=e=>{let t=e.overview?`${e.overview}
|
|
1
|
+
(function(c,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(c=typeof globalThis<"u"?globalThis:c||self,p(c.StencilHelpersModule={}))})(this,function(c){"use strict";var ht=Object.defineProperty;var me=c=>{throw TypeError(c)};var yt=(c,p,m)=>p in c?ht(c,p,{enumerable:!0,configurable:!0,writable:!0,value:m}):c[p]=m;var y=(c,p,m)=>yt(c,typeof p!="symbol"?p+"":p,m),vt=(c,p,m)=>p.has(c)||me("Cannot "+m);var O=(c,p,m)=>(vt(c,p,"read from private field"),m?m.call(c):p.get(c)),Q=(c,p,m)=>p.has(c)?me("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(c):p.set(c,m);var E,W;const p=(e="",t=10)=>{const s=new Uint8Array(t);crypto.getRandomValues(s);const r=Array.from(s).map(n=>n.toString(16).padStart(2,"0")).join("").slice(0,t);return e!==""?`${e}-${r}`:r},m=e=>J(e)&&/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e)!==null;class be{constructor(t=[]){y(this,"classes");y(this,"add",t=>{this.has(t)||this.classes.push(t)});y(this,"delete",t=>{const s=this.classes.indexOf(t);s>-1&&this.classes.splice(s,1)});y(this,"has",t=>this.classes.includes(t));y(this,"join",()=>this.classes.join(" "));this.classes=t}}const Se=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"),Te=(e,t)=>t.includes(e==null?void 0:e.tagName.toLowerCase()),ke='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',Ae=e=>{const t=B(e),s=Z(e);return[e,...t,...s]},B=(e,t=[])=>{if(e.self!==e.top)try{const s=e.parent;return s?(t.push(s),B(s,t)):t}catch(s){return console.error("Different hosts between iframes:",s),t}return t},Z=(e,t=[])=>{if(e.frames.length>0)for(const s of Array.from(e.frames))t.push(s),Z(s,t);return t},J=e=>typeof e=="string"&&e.trim()!=="",Ee=e=>typeof e=="object"?JSON.stringify(e):`${e}`,je=e=>typeof e=="number"&&!Number.isNaN(e),Le=e=>typeof e=="string"?e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):e,Oe=async e=>e();var F={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,formAssociated:!1,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!0,asyncQueue:!1,transformTagName:!1,attachStyles:!0,experimentalSlotFixes:!1},_e=Object.defineProperty,Me=(e,t)=>{for(var s in t)_e(e,s,{get:t[s],enumerable:!0})},Re="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",Y=(e,t)=>t in e,V="http://www.w3.org/1999/xlink",z=typeof window<"u"?window:{},x=z.document||{head:{}};z.HTMLElement;var j={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,s,r)=>e.addEventListener(t,s,r),rel:(e,t,s,r)=>e.removeEventListener(t,s,r),ce:(e,t)=>new CustomEvent(e,t)},Fe=e=>e!=null&&e!==void 0,ee=e=>(e=typeof e,e==="object"||e==="function"),xe={};Me(xe,{err:()=>te,map:()=>De,ok:()=>I,unwrap:()=>Ce,unwrapErr:()=>we});var I=e=>({isOk:!0,isErr:!1,value:e}),te=e=>({isOk:!1,isErr:!0,value:e});function De(e,t){if(e.isOk){const s=t(e.value);return s instanceof Promise?s.then(r=>I(r)):I(s)}if(e.isErr){const s=e.value;return te(s)}throw"should never get here"}var Ce=e=>{if(e.isOk)return e.value;throw e.value},we=e=>{if(e.isErr)return e.value;throw e.value},se=e=>{const t=e.__childNodes||e.childNodes;e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&re(t,e.tagName).forEach(s=>{var r;s.nodeType===1&&s.tagName==="SLOT-FB"&&((r=Ue(s,s["s-sn"],!1))!=null&&r.length?s.hidden=!0:s.hidden=!1)});for(const s of t)s.nodeType===1&&(s.__childNodes||s.childNodes).length&&se(s)},re=(e,t,s)=>{let r=0,n=[],l;for(;r<e.length;r++)l=e[r],l["s-sr"]&&l["s-hn"]===t&&n.push(l),n=[...n,...re(l.childNodes,t)];return n},Ue=(e,t,s=!0)=>{const r=[];for((s&&e["s-sr"]||!e["s-sr"])&&r.push(e);(e=e.nextSibling)&&e["s-sn"]===t;)r.push(e);return r},ne=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",Pe=(e,t,...s)=>{let r=null,n=null,l=null,i=!1,d=!1;const a=[],g=o=>{for(let $=0;$<o.length;$++)r=o[$],Array.isArray(r)?g(r):r!=null&&typeof r!="boolean"&&((i=!ee(r))&&(r=String(r)),i&&d?a[a.length-1].$text$+=r:a.push(i?G(null,r):r),d=i)};g(s);const u=G(e,null);return u.$attrs$=t,a.length>0&&(u.$children$=a),u.$key$=n,u.$name$=l,u},G=(e,t)=>{const s={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return s.$attrs$=null,s.$key$=null,s.$name$=null,s},He={},We=e=>e&&e.$tag$===He,ie=(e,t,s,r,n,l)=>{if(s!==r){let i=Y(e,t),d=t.toLowerCase();if(t==="class"){const a=e.classList,g=le(s);let u=le(r);e["s-si"]?(u.push(e["s-si"]),g.forEach(o=>{o.startsWith(e["s-si"])&&u.push(o)}),u=[...new Set(u)],a.add(...u),delete e["s-si"]):(a.remove(...g.filter(o=>o&&!u.includes(o))),a.add(...u.filter(o=>o&&!g.includes(o))))}else if(t==="style"){for(const a in s)(!r||r[a]==null)&&(a.includes("-")?e.style.removeProperty(a):e.style[a]="");for(const a in r)(!s||r[a]!==s[a])&&(a.includes("-")?e.style.setProperty(a,r[a]):e.style[a]=r[a])}else if(t!=="key")if(t==="ref")r&&r(e);else if(!e.__lookupSetter__(t)&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):Y(z,d)?t=d.slice(2):t=d[2]+t.slice(3),s||r){const a=t.endsWith(oe);t=t.replace(Be,""),s&&j.rel(e,t,s,a),r&&j.ael(e,t,r,a)}}else{const a=ee(r);if((i||a&&r!==null)&&!n)try{if(e.tagName.includes("-"))e[t]=r;else{const u=r??"";t==="list"?i=!1:(s==null||e[t]!=u)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=u:e.setAttribute(t,u))}}catch{}let g=!1;d!==(d=d.replace(/^xlink\:?/,""))&&(t=d,g=!0),r==null||r===!1?(r!==!1||e.getAttribute(t)==="")&&(g?e.removeAttributeNS(V,t):e.removeAttribute(t)):(!i||l&4||n)&&!a&&(r=r===!0?"":r,g?e.setAttributeNS(V,t,r):e.setAttribute(t,r))}}},qe=/\s/,le=e=>(typeof e=="object"&&"baseVal"in e&&(e=e.baseVal),e?e.split(qe):[]),oe="Capture",Be=new RegExp(oe+"$"),ae=(e,t,s)=>{const r=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,n=e&&e.$attrs$||{},l=t.$attrs$||{};for(const i of ce(Object.keys(n)))i in l||ie(r,i,n[i],void 0,s,t.$flags$);for(const i of ce(Object.keys(l)))ie(r,i,n[i],l[i],s,t.$flags$)};function ce(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var D,C,_,w=!1,U=!1,X=!1,b=!1,P=(e,t,s)=>{var r;const n=t.$children$[s];let l=0,i,d,a;if(w||(X=!0,n.$tag$==="slot"&&(n.$flags$|=n.$children$?2:1)),n.$text$!==null)i=n.$elm$=x.createTextNode(n.$text$);else if(n.$flags$&1)i=n.$elm$=x.createTextNode("");else{if(b||(b=n.$tag$==="svg"),i=n.$elm$=x.createElementNS(b?Re:Ne,!w&&F.slotRelocation&&n.$flags$&2?"slot-fb":n.$tag$),b&&n.$tag$==="foreignObject"&&(b=!1),ae(null,n,b),Fe(D)&&i["s-si"]!==D&&i.classList.add(i["s-si"]=D),n.$children$)for(l=0;l<n.$children$.length;++l)d=P(e,n,l),d&&i.appendChild(d);n.$tag$==="svg"?b=!1:i.tagName==="foreignObject"&&(b=!0)}return i["s-hn"]=_,n.$flags$&3&&(i["s-sr"]=!0,i["s-cr"]=C,i["s-sn"]=n.$name$||"",i["s-rf"]=(r=n.$attrs$)==null?void 0:r.ref,a=e&&e.$children$&&e.$children$[s],a&&a.$tag$===n.$tag$&&e.$elm$&&M(e.$elm$,!1),ge(C,i,t.$elm$,e==null?void 0:e.$elm$)),i},M=(e,t)=>{j.$flags$|=1;const s=Array.from(e.__childNodes||e.childNodes);e["s-sr"]&&F.experimentalSlotFixes;for(let r=s.length-1;r>=0;r--){const n=s[r];n["s-hn"]!==_&&n["s-ol"]&&(A(R(n).parentNode,n,R(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,X=!0),t&&M(n,t)}j.$flags$&=-2},fe=(e,t,s,r,n,l)=>{let i=e["s-cr"]&&e["s-cr"].parentNode||e,d;for(i.shadowRoot&&i.tagName===_&&(i=i.shadowRoot);n<=l;++n)r[n]&&(d=P(null,s,n),d&&(r[n].$elm$=d,A(i,d,R(t))))},ue=(e,t,s)=>{for(let r=t;r<=s;++r){const n=e[r];if(n){const l=n.$elm$;$e(n),l&&(U=!0,l["s-ol"]?l["s-ol"].remove():M(l,!0),l.remove())}}},ze=(e,t,s,r,n=!1)=>{let l=0,i=0,d=0,a=0,g=t.length-1,u=t[0],o=t[g],$=r.length-1,f=r[0],h=r[$],k,S;for(;l<=g&&i<=$;)if(u==null)u=t[++l];else if(o==null)o=t[--g];else if(f==null)f=r[++i];else if(h==null)h=r[--$];else if(H(u,f,n))L(u,f,n),u=t[++l],f=r[++i];else if(H(o,h,n))L(o,h,n),o=t[--g],h=r[--$];else if(H(u,h,n))(u.$tag$==="slot"||h.$tag$==="slot")&&M(u.$elm$.parentNode,!1),L(u,h,n),A(e,u.$elm$,o.$elm$.nextSibling),u=t[++l],h=r[--$];else if(H(o,f,n))(u.$tag$==="slot"||h.$tag$==="slot")&&M(o.$elm$.parentNode,!1),L(o,f,n),A(e,o.$elm$,u.$elm$),o=t[--g],f=r[++i];else{for(d=-1,a=l;a<=g;++a)if(t[a]&&t[a].$key$!==null&&t[a].$key$===f.$key$){d=a;break}d>=0?(S=t[d],S.$tag$!==f.$tag$?k=P(t&&t[i],s,d):(L(S,f,n),t[d]=void 0,k=S.$elm$),f=r[++i]):(k=P(t&&t[i],s,i),f=r[++i]),k&&A(R(u.$elm$).parentNode,k,R(u.$elm$))}l>g?fe(e,r[$+1]==null?null:r[$+1].$elm$,s,r,i,$):i>$&&ue(t,l,g)},H=(e,t,s=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:s?(s&&!e.$key$&&t.$key$&&(e.$key$=t.$key$),!0):e.$key$===t.$key$:!1,R=e=>e&&e["s-ol"]||e,L=(e,t,s=!1)=>{const r=t.$elm$=e.$elm$,n=e.$children$,l=t.$children$,i=t.$tag$,d=t.$text$;let a;d===null?(b=i==="svg"?!0:i==="foreignObject"?!1:b,i==="slot"&&!w||ae(e,t,b),n!==null&&l!==null?ze(r,n,t,l,s):l!==null?(e.$text$!==null&&(r.textContent=""),fe(r,null,t,l,0,l.length-1)):!s&&F.updatable&&n!==null&&ue(n,0,n.length-1),b&&i==="svg"&&(b=!1)):(a=r["s-cr"])?a.parentNode.textContent=d:e.$text$!==d&&(r.data=d)},T=[],de=e=>{let t,s,r;const n=e.__childNodes||e.childNodes;for(const l of n){if(l["s-sr"]&&(t=l["s-cr"])&&t.parentNode){s=t.parentNode.__childNodes||t.parentNode.childNodes;const i=l["s-sn"];for(r=s.length-1;r>=0;r--)if(t=s[r],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==l["s-hn"])if(ne(t,i)){let d=T.find(a=>a.$nodeToRelocate$===t);U=!0,t["s-sn"]=t["s-sn"]||i,d?(d.$nodeToRelocate$["s-sh"]=l["s-hn"],d.$slotRefNode$=l):(t["s-sh"]=l["s-hn"],T.push({$slotRefNode$:l,$nodeToRelocate$:t})),t["s-sr"]&&T.map(a=>{ne(a.$nodeToRelocate$,t["s-sn"])&&(d=T.find(g=>g.$nodeToRelocate$===t),d&&!a.$slotRefNode$&&(a.$slotRefNode$=d.$slotRefNode$))})}else T.some(d=>d.$nodeToRelocate$===t)||T.push({$nodeToRelocate$:t})}l.nodeType===1&&de(l)}},$e=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map($e)},A=(e,t,s)=>(typeof t["s-sn"]=="string"&&t["s-sr"]&&t["s-cr"]&&ge(t["s-cr"],t,e,t.parentElement),e==null?void 0:e.insertBefore(t,s));function ge(e,t,s,r){var n;let l;if(e&&typeof t["s-sn"]=="string"&&t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(l=t["s-si"]||e.parentNode["s-sc"])){const i=t["s-sn"],d=t["s-hn"];if((n=s.classList)==null||n.add(l+"-s"),r&&r.classList.contains(l+"-s")){let a=(r.__childNodes||r.childNodes)[0],g=!1;for(;a;){if(a["s-sn"]!==i&&a["s-hn"]===d&&a["s-sr"]){g=!0;break}a=a.nextSibling}g||r.classList.remove(l+"-s")}}}var Ie=(e,t,s=!1)=>{var r,n,l,i,d;const a=e.$hostElement$,g=e.$cmpMeta$,u=e.$vnode$||G(null,null),o=We(t)?t:Pe(null,null,t);if(_=a.tagName,g.$attrsToReflect$&&(o.$attrs$=o.$attrs$||{},g.$attrsToReflect$.map(([$,f])=>o.$attrs$[f]=a[$])),s&&o.$attrs$)for(const $ of Object.keys(o.$attrs$))a.hasAttribute($)&&!["key","ref","style","class"].includes($)&&(o.$attrs$[$]=a[$]);o.$tag$=null,o.$flags$|=4,e.$vnode$=o,o.$elm$=u.$elm$=a.shadowRoot||a,D=a["s-sc"],w=(g.$flags$&1)!==0,C=a["s-cr"],U=!1,L(u,o,s);{if(j.$flags$|=1,X){de(o.$elm$);for(const $ of T){const f=$.$nodeToRelocate$;if(!f["s-ol"]){const h=x.createTextNode("");h["s-nr"]=f,A(f.parentNode,f["s-ol"]=h,f)}}for(const $ of T){const f=$.$nodeToRelocate$,h=$.$slotRefNode$;if(h){const k=h.parentNode;let S=h.nextSibling;{let q=(r=f["s-ol"])==null?void 0:r.previousSibling;for(;q;){let v=(n=q["s-nr"])!=null?n:null;if(v&&v["s-sn"]===f["s-sn"]&&k===v.parentNode){for(v=v.nextSibling;v===f||v!=null&&v["s-sr"];)v=v==null?void 0:v.nextSibling;if(!v||!v["s-nr"]){S=v;break}}q=q.previousSibling}}(!S&&k!==f.parentNode||f.nextSibling!==S)&&f!==S&&(!f["s-hn"]&&f["s-ol"]&&(f["s-hn"]=f["s-ol"].parentNode.nodeName),A(k,f,S),f.nodeType===1&&f.tagName!=="SLOT-FB"&&(f.hidden=(l=f["s-ih"])!=null?l:!1)),f&&typeof h["s-rf"]=="function"&&h["s-rf"](f)}else f.nodeType===1&&(s&&(f["s-ih"]=(i=f.hidden)!=null?i:!1),f.hidden=!0)}}U&&se(o.$elm$),j.$flags$&=-2,T.length=0}if(F.experimentalScopedSlotChanges&&g.$flags$&2){const $=o.$elm$.__childNodes||o.$elm$.childNodes;for(const f of $)f["s-hn"]!==_&&!f["s-sh"]&&(s&&f["s-ih"]==null&&(f["s-ih"]=(d=f.hidden)!=null?d:!1),f.hidden=!0)}C=void 0};const Ge=(e,t,s)=>{[null,void 0,"",!1].includes(s)||["innerHTML","style"].includes(t)||e.setAttribute(t,["object","function"].includes(typeof s)?"/!\\ Object props are not rendered in the code example":s)},pe=(e,t,s,r,n)=>{if(t&&typeof t=="string"){const l=document.createElement(t);Object.keys(s||{}).forEach(i=>{Ge(l,i,s[i])}),r==null||r.forEach(i=>{pe(l,i.$tag$,i.$attrs$,i.$children$,i.$text$)}),s!=null&&s.innerHTML&&(l.innerHTML=s.innerHTML),e.appendChild(l)}n&&(e.innerHTML=n)},Xe=(e,t)=>{const s={};if(typeof e!="object")throw new Error("filterArgs - args isn't an object.");for(const r in e)if(!r.startsWith("slot")){const n=e[r],l=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();(!t||!Object.keys(t).includes(r)||t[r]!==n)&&(s[l]=n)}return s},Ke=(e,t)=>{var r,n;const s=document.getElementById("storybook-root");if(s!==null)return(n=document.querySelector("[lang]"))==null||n.setAttribute("lang",((r=t.globals)==null?void 0:r.locale)||"en"),Ie({$ancestorComponent$:void 0,$flags$:0,$modeName$:void 0,$cmpMeta$:{$flags$:0,$tagName$:s.tagName},$hostElement$:s},e(t)),s.children[s.children.length-1]},Qe=({$tag$:e,$attrs$:t,$children$:s,$text$:r})=>{const n=document.createElement("div");return pe(n,e,t,s,r),n.innerHTML},N=(e,t)=>{if(!t)return;const s=t.split("/");return`${e}${s.slice(2,s.length-1).join("-")}--docs`};class Ze{constructor(t){y(this,"jsonDoc");Q(this,E,t=>this.jsonDoc.components.find(s=>s.tag===t));Q(this,W,t=>{const s=t.type.replace(/"([^"]+)"/g,"$1").replace(/\s/g,"").replace(/\(.*?\)/g,r=>r.replace(/\|/g," OR ")).split("|").map(r=>r.trim().replace(/ OR /g,"|"));return t.type==="string"?{control:{type:"text"}}:t.type==="number"?{control:{type:"number"}}:t.type==="boolean"?{control:{type:"boolean"}}:t.type.startsWith("{")&&t.type.endsWith("}")?{control:{type:"object"}}:s.length>1?s.includes("string")?{control:{type:"text"}}:s.every(r=>r==null?void 0:r.includes("[]"))?{control:{type:"object"}}:(s.unshift(void 0),{control:{type:"select"},options:s}):{control:{type:"object"}}});y(this,"extractArgTypes",t=>{const s=O(this,E).call(this,t),r=s==null?void 0:s.props.reduce((u,o)=>{const{control:$,options:f}=O(this,W).call(this,o);return{...u,[o.name]:{name:o.attr||o.name,description:o.docs,type:{required:o.required},table:{category:"props",type:{summary:o.type},defaultValue:{summary:o.default}},control:$,options:f}}},{}),n=s==null?void 0:s.events.reduce((u,o)=>({...u,[o.event]:{name:o.event,description:o.docs,table:{category:"events",type:{summary:o.detail}}}}),{}),l=s==null?void 0:s.methods.reduce((u,o)=>({...u,[o.name]:{name:o.name,description:o.docs,table:{category:"methods",type:{summary:o.signature}}}}),{}),i=s==null?void 0:s.slots.reduce((u,o)=>({...u,[o.name]:{name:o.name!==""?o.name:"default",description:o.docs,table:{category:"slots",type:{summary:void 0}}}}),{}),d=s==null?void 0:s.styles.reduce((u,o)=>({...u,[o.name]:{name:o.name,description:o.docs,table:{category:"custom properties",type:{summary:void 0}}}}),{}),a=s==null?void 0:s.dependencies.reduce((u,o)=>{const $=O(this,E).call(this,o);return{...u,[o]:{name:o,description:`<a href="./?path=/docs/${N("",$==null?void 0:$.filePath)}">View Component Documentation</a>`,table:{category:"depends on",type:{summary:void 0}}}}},{}),g=s==null?void 0:s.dependents.reduce((u,o)=>{const $=O(this,E).call(this,o);return{...u,[o]:{name:o,description:`<a href="./?path=/docs/${N("",$==null?void 0:$.filePath)}">View Component Documentation</a>`,table:{category:"used by",type:{summary:void 0}}}}},{});return{...r,...n,...l,...i,...d,...a,...g}});y(this,"extractComponentDescription",t=>{const s=O(this,E).call(this,t);return(s==null?void 0:s.readme)||(s==null?void 0:s.docs)});this.jsonDoc=t}}E=new WeakMap,W=new WeakMap;const Je=(e,t)=>{if(t)return`${e}${t}`},he=e=>{let t=e.overview?`${e.overview}
|
|
2
2
|
|
|
3
3
|
`:"";const s=e.props.filter(({attr:n})=>n!==void 0);s.length&&(t+=`Attributes:
|
|
4
|
-
`,t+=s.map(({attr:n,docs:
|
|
4
|
+
`,t+=s.map(({attr:n,docs:l})=>`- \`${n}\`: ${l}
|
|
5
5
|
`).join(""),t+=`
|
|
6
6
|
`);const r=e.props.filter(({attr:n})=>n===void 0);return r.length&&(t+=`Properties:
|
|
7
|
-
`,t+=r.map(({name:n,docs:
|
|
7
|
+
`,t+=r.map(({name:n,docs:l})=>`- \`${n}\`: ${l}
|
|
8
8
|
`).join(""),t+=`
|
|
9
9
|
`),e.methods.length&&(t+=`Methods:
|
|
10
|
-
`,t+=e.methods.map(({name:n,docs:
|
|
10
|
+
`,t+=e.methods.map(({name:n,docs:l})=>`- \`${n}\`: ${l}
|
|
11
11
|
`).join(""),t+=`
|
|
12
12
|
`),e.events.length&&(t+=`Events:
|
|
13
|
-
`,t+=e.events.map(({event:n,docs:
|
|
13
|
+
`,t+=e.events.map(({event:n,docs:l})=>`- \`${n}\`: ${l}
|
|
14
14
|
`).join(""),t+=`
|
|
15
15
|
`),e.listeners.length&&(t+=`Listeners:
|
|
16
16
|
`,t+=e.listeners.map(({event:n})=>`- \`${n}\`
|
|
17
17
|
`).join(""),t+=`
|
|
18
18
|
`),e.slots.length&&(t+=`Slots:
|
|
19
|
-
`,t+=e.slots.map(({name:n,docs:
|
|
19
|
+
`,t+=e.slots.map(({name:n,docs:l})=>`- \`${n}\`: ${l}
|
|
20
20
|
`).join(""),t+=`
|
|
21
21
|
`),t},K=e=>`${e.docs}
|
|
22
22
|
|
|
23
|
-
Type: \`${e.type}\``,
|
|
23
|
+
Type: \`${e.type}\``,Ye=(e,t,s,r)=>({$schema:"https://json.schemastore.org/web-types",name:e,version:t,"description-markup":"markdown",contributions:{html:{elements:s.components.map(n=>{const l=N(r,n.filePath);return{name:n.tag,description:he(n),"doc-url":l,attributes:n.props.filter(i=>i.attr).map(i=>({name:i.attr,description:K(i),"doc-url":l,value:{type:i.type,default:i.default,required:i.required}})),js:{properties:n.props.map(i=>({name:i.name,description:K(i),"doc-url":l,value:{type:i.type,default:i.default,required:i.required}})),events:n.events.map(i=>({name:i.event,description:i.docs}))},css:{properties:n.styles.map(i=>({name:i.name,description:i.docs}))}}})}}}),Ve=(e,t,s)=>[{name:"Storybook",url:N(e,s)},{name:"Sources",url:Je(t,s)}],et=e=>{if(!e.values.some(({value:t})=>t===void 0))return e.values.map(({value:t})=>({name:t}))},tt=(e,t,s)=>({version:1.1,tags:e.components.map(r=>{const n=Ve(t,s,r.filePath);return{name:r.tag,description:he(r),attributes:r.props.map(l=>({name:l.attr||l.name,description:K(l),values:et(l),references:n})),references:n}}),globalAttributes:[],valueSets:[]}),st=e=>({version:1.1,properties:e.components.flatMap(t=>t.styles.map(s=>({name:s.name,description:s.docs})))}),rt=e=>{const t={value:"2023",pattern:"yyyy"},s={value:"12",pattern:"mm"},r={value:"24",pattern:"dd"};return ve([t.value,s.value,r.value].join("-"),e,{timeZone:"UTC"}).replace(t.value,t.pattern).replace(s.value,s.pattern).replace(r.value,r.pattern)},nt=e=>e.toISOString().split("T")[0],it=(e,t,s)=>{const r=e.closest("[lang]"),n=Intl.NumberFormat.supportedLocalesOf(r==null?void 0:r.lang),l=n.length>0&&typeof n[0]=="string"?n[0]:navigator.language||s,i=l.split("-").shift();return Object.keys(t).length===0?{locale:l,messages:{lang:s}}:{locale:l,messages:t[i]||t[s]||{lang:s}}},lt=(e,t,s)=>new Intl.NumberFormat(t,{style:"currency",currency:s}).format(e),ot=(e,t,s=0)=>new Intl.NumberFormat(t,{minimumFractionDigits:s}).format(s>0?Number(e==null?void 0:e.toFixed(s)):e),at=(e,t,s=0)=>new Intl.NumberFormat(t,{style:"percent",minimumFractionDigits:s,maximumFractionDigits:s}).format(e),ct=(e,t,s,r="short",n=0)=>new Intl.NumberFormat(t,{style:"unit",unit:s,unitDisplay:r,minimumFractionDigits:n,maximumFractionDigits:n}).format(e),ye=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,ve=(e,t,s)=>typeof e!="string"||e===""||!ye.test(e)?"":new Intl.DateTimeFormat(t,s).format(new Date(e)),ft=(e,t)=>s=>it(s,e,t),ut=({disconnect:e,observe:t,takeRecords:s})=>{class r{constructor(l){y(this,"disconnect",e);y(this,"observe",t);y(this,"takeRecords",s);y(this,"cb");this.cb=l}}return[window,global].forEach(n=>{Object.defineProperty(n,"MutationObserver",{writable:!0,configurable:!0,value:r})}),r},dt=({disconnect:e,observe:t})=>{class s{constructor(n){y(this,"disconnect",e);y(this,"observe",t);y(this,"unobserve");y(this,"cb");this.cb=n}}return[window,global].forEach(r=>{Object.defineProperty(r,"ResizeObserver",{writable:!0,configurable:!0,value:s})}),s};class $t extends Event{constructor(){super(...arguments);y(this,"detail")}}const gt=()=>{class e extends $t{}return[window,global].forEach(t=>{Object.defineProperty(t,"SubmitEvent",{writable:!0,configurable:!0,value:e})}),e},pt=e=>{const t=s=>(setTimeout(s,1),e(),0);return[window,global].forEach(s=>{Object.defineProperty(s,"requestAnimationFrame",{writable:!0,configurable:!0,value:t})}),t};c.ClassList=be,c.StorybookPreview=Ze,c.allItemsAreString=Se,c.cleanString=Le,c.createID=p,c.dateRegExp=ye,c.dateToString=nt,c.defineLocales=ft,c.filterArgs=Xe,c.focusableElements=ke,c.getLocaleDatePattern=rt,c.getParentWindows=B,c.getStoryHTML=Qe,c.getStorybookUrl=N,c.getWindows=Ae,c.isTagName=Te,c.isValidNumber=je,c.isValidString=J,c.isValideID=m,c.localeCurrency=lt,c.localeDate=ve,c.localeNumber=ot,c.localePercent=at,c.localeUnit=ct,c.nextTick=Oe,c.setUpRequestAnimationFrameMock=pt,c.setupMutationObserverMock=ut,c.setupResizeObserverMock=dt,c.setupSubmitEventMock=gt,c.stencilWrapper=Ke,c.toString=Ee,c.vsCodeCssGenerator=st,c.vsCodeGenerator=tt,c.webTypesGenerator=Ye,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
24
24
|
//# sourceMappingURL=index.umd.js.map
|