@trintel/zooy 1.6.0 → 1.7.1
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/chunks/register-BhhZmqdG.js +1 -0
- package/dist/chunks/register-DhnyuYDK.js +1486 -0
- package/dist/chunks/zoo-CaW98OQn.js +393 -0
- package/dist/chunks/zoo-Cpc0eKfk.js +52 -0
- package/dist/zooy.cjs.js +2 -2
- package/dist/zooy.es.js +29 -33
- package/package.json +1 -1
- package/dist/chunks/register-BW7XFFn2.js +0 -1418
- package/dist/chunks/register-Cdc1Dawc.js +0 -1
- package/dist/chunks/zoo-B8_zFikt.js +0 -52
- package/dist/chunks/zoo-Cztpe9qH.js +0 -391
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var It=Object.create;var Q=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var kt=Object.getOwnPropertyNames;var yt=Object.getPrototypeOf,_t=Object.prototype.hasOwnProperty;var Ct=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of kt(e))!_t.call(t,o)&&o!==s&&Q(t,o,{get:()=>e[o],enumerable:!(n=Pt(e,o))||n.enumerable});return t};var d=(t,e,s)=>(s=t!=null?It(yt(t)):{},Ct(e||!t||!t.__esModule?Q(s,"default",{value:t,enumerable:!0}):s,t));const m=require("./component-library-registry-BBQV6Kpv.js"),i=require("./zoo-Cpc0eKfk.js");let at=require("badu"),B=require("ramda");B=m.__toESM(B);let xt=require("@carbon/web-components/lib/components/data-table/defs.js");var wt=m.__exportAll({cdsTableWrap:()=>Mt}),X=(t,e,s)=>{const n=customElements.get("cds-table"),o=customElements.get("cds-pagination"),a=customElements.get(n.selectorTableBatchActions);customElements.get("cds-popover");const r=e.dataBinder,c=e.pagination,p=e.skeleton,S=e.querySelector(n.selectorTableToolbarSearch),W=e.querySelector(n.selectorTableBatchActions),x=e.querySelector(n.selectorTableBody),O=["button","a","input","select","textarea",'[role="button"]',".cds--table-expand",".cds--table-column-checkbox"].join(","),Z=e.querySelectorAll(n.selectorHeaderCell+"[is-sortable]"),ct=e.isSortable||Z.length>0,z=Symbol(),L=Symbol(),w=new Map,lt=l=>{t.listen(e,"click",u=>{const v=u.target.closest(n.selectorTableRow);if(!v||u.composedPath().some(h=>h.matches&&h.matches(O)))return;u.stopPropagation();const g=i.getSemanticAttributes(v);t.dispatchPanelEvent(l,{...g})})},dt=l=>{t.listen(e,n.eventExpandoToggle,u=>{const v=u.target,g=v.tagName==="CDS-TABLE-HEADER-ROW",h=u.detail.expanded,E={tableAttrs:s,...i.getSemanticAttributes(v),target:v,allRows:g,didExpand:h};t.dispatchPanelEvent(l,E)})},pt=l=>{w.set(z,u=>{t.dispatchPanelEvent(l,u)})},ut=l=>{w.set(L,u=>{const v=u.detail.selectedRows,g=Math.min(v.length,W.totalRowsCount),h=u.target,E=i.getSemanticAttributes(h),I=v.map(i.getSemanticAttributes),y={tableAttrs:s,...E,target:h,selectCount:g,selection:I};t.dispatchPanelEvent(l,y)})},vt=l=>{t.listen(e,n.eventTableRowSelect,u=>{const v=u.target,g=u.detail.selectedRows||[],h=g.length,E=g.map(i.getSemanticAttributes),I={tableAttrs:s,...i.getSemanticAttributes(v),selectCount:h,selection:E,target:v};t.dispatchPanelEvent(l,I)})},mt=()=>{t.listen(e,n.eventBeforeSort,l=>{const u=l.target,v=l.detail.oldSortDirection,g=l.detail.sortDirection,h=i.getSemanticAttributes(u),E=h.sortField,I=g===xt.TABLE_SORT_DIRECTION.DESCENDING?`-${E}`:E;l.cancelBubble=!0,l.stopPropagation(),l.preventDefault(),x.innerHTML="",p&&p.show(),Z.forEach((_,b)=>{_===u?(_.setAttribute("sort-active","true"),_.setAttribute("sort-direction",g)):(_.removeAttribute("sort-active"),_.setAttribute("sort-direction","none"))});const y={ordering:I};r.fetchData(y).then(()=>{c.setData(r),p&&p.hide()}),w.has(z)&&w.get(z)({tableAttrs:s,...h,sortNow:g,sortWas:v,sortField:E,ordering:I,target:u})})},gt=()=>{t.listen(e,n.eventTableRowSelectAll,l=>{l.detail.selectedRows.length===0&&e.querySelectorAll(n.selectorTableRow).forEach(u=>{u.disabled=!1,u.selected=!1}),w.has(L)&&w.get(L)(l)})},ft=()=>{t.listen(e,n.eventBeforeChangeSelectionAll,l=>{l.stopPropagation(),l.detail.callback&&l.detail.callback()})},ht=l=>{const u=e.querySelector("cds-table-header-row");t.listen(l,a.eventClickSelectAll,v=>{v.stopPropagation(),u.dispatchEvent(new CustomEvent(n.eventBeforeChangeSelectionAll,{bubbles:!0,cancelable:!0,composed:!0,detail:{selected:!0,callback:()=>{l.selectedRowsCount=l.totalRowsCount,e.querySelectorAll(n.selectorTableRow).forEach(g=>{g.disabled=!0})}}}))})},bt=l=>{t.listen(l,"keydown",u=>{if(u.key==="Enter"){p&&p.show(),c.totalItems=0,e.querySelector("cds-table-body").replaceChildren();const v={search:l.value||"",offset:0};r.fetchData(v).then(()=>{c.setData(r),p&&p.hide()})}})},Et=l=>{t.listen(l,n.eventSearchInput,u=>{if((u.detail.value||"")===""){const v={search:"",offset:0};p&&p.show(),r.fetchData(v).then(()=>{p&&p.hide(),c.setData(r)})}})},At=l=>{l.caret=!1;const u=l.querySelector("cds-icon-button, button:not([slot])"),v=l.querySelectorAll("cds-checkbox"),g=l.querySelectorAll("cds-modal-footer-button"),h=[...l.querySelectorAll("cds-checkbox-group")].map(i.getSemanticAttributes).map(B.pathOr("noop",["zoo","filter","field"])).reduce((b,A)=>(b[A]=null,b),{offset:0});if(!u||!g){console.error("Improperly configured Batch Filter popover");return}new MutationObserver(()=>{l.classList.toggle("cds--overflow-menu--open",l.open)}).observe(l,{attributes:!0,attributeFilter:["open"]});const E=Symbol(),I=Symbol(),y=[...g].reduce((b,A,C)=>(A.hasAttribute("reset-filter")&&b.set(E,A),A.hasAttribute("apply-filter")&&b.set(I,A),b),new Map),_=()=>{const b=new Map;return v.forEach(A=>{const C=A.getAttribute("id");if(!C||!C.includes(":"))return;const[N,M]=C.split(":");b.has(N)||b.set(N,[]),A.checked&&b.get(N).push(M)}),b};if(y.has(E)){const b=A=>A.checked=!1;t.listen(y.get(E),"click",A=>{A.stopPropagation(),v.forEach(b),p&&p.show(),r.fetchData(h).then(()=>{c&&c.setData(r),p&&p.hide(),l.open=!1})})}y.has(I)&&t.listen(y.get(I),"click",b=>{b.stopPropagation();const A=[..._()].reduce((C,[N,M])=>(C[N]=Array.isArray(M)&&M.length===0?null:M,C),{offset:0});p&&p.show(),r.fetchData(A).then(()=>{c&&c.setData(r),p&&p.hide(),l.open=!1})}),t.listen(u,"click",b=>{b.stopPropagation(),l.open=!l.open,l.classList.toggle("cds--overflow-menu--open",l.open)})},St=()=>{t.listen(c,o.eventPageSizeChanged,l=>{const u={limit:c.pageSize,offset:0};r.fetchData(u).then(()=>{c.setData(r)})})},Wt=()=>{let l=null;t.listen(c,o.eventChangeCurrent,u=>{const{page:v}=u.detail,g=c.pageSize,h=(v-1)*g;if(h!==l){l=h;const E={limit:g,offset:h};r.fetchData(E).then(()=>{c.setData(r),p&&p.hide()})}})};r&&c&&(St(),Wt()),r&&S&&(bt(S),Et(S));const J=e.querySelector(n.selectorTableToolbarContent);if(J){const l=J.querySelectorAll("cds-popover[data-batch-filter]");r&&l&&l.forEach(At)}e.isSelectable&&(gt(),ft(),W&&ht(W)),r&&ct&&mt();const K={zoo:{event:{row:{click:lt,expand:dt,check:{one:vt,all:ut}},column:{sort:pt}}}};(0,at.objToPaths)(s).forEach(([l,u])=>{B.hasPath(l,K)&&B.path(l,K)(u)})},Dt=t=>{const e=document.createElement("cds-pagination");return e.backwardText="Previous page",e.forwardText="Next page",e.itemsPerPageText="Items per page:",e.pageSize=t.limit,e.size="lg",[10,25,50,100,500].forEach(s=>{const n=document.createElement("cds-select-item");n.value=s.toString(),n.textContent=s.toString(),e.appendChild(n)}),e.setData=s=>{if(s.isPaginated){const{count:n}=B.pick(["count"],s.data);e.pagesUnknown=Math.ceil(n/s.limit)>100,e.totalItems=n,e.pagesUnknown?e.formatStatusWithIndeterminateTotal=({start:o,end:a})=>`${o}–${a} of ${n} item${n<=1?"":"s"}`:delete e.formatStatusWithIndeterminateTotal}},e},Bt=t=>{if(!t.parentNode){console.error("[Carbon Table] Cannot create skeleton: table has no parent node");return}const e=!!t.querySelector("cds-table-header-title"),s=!!t.querySelector("cds-table-header-description"),n=!!t.querySelector("cds-table-toolbar"),o=[...t.querySelectorAll("cds-table-header-cell")].length,a=t.hasAttribute("zebra"),r=t.getAttribute("size"),c=document.createElement("cds-table-skeleton");c.showHeader=e||s,c.showToolbar=n,c.zebra=a,c.columnCount=o,c.size=r,c.show=()=>c.classList.remove("hidden"),c.hide=()=>c.classList.add("hidden");const p=document.createElement("div");return p.classList.add("zoo-datatable-skeleton-wrapper"),t.parentNode.insertBefore(p,t),p.appendChild(c),p.appendChild(t),c},Nt=(t,e)=>{const s=e.getAttribute("zoo-url-api"),n=parseInt(e.getAttribute("data-page-size")||25,10);if(s)return new i.Binder(t,s,e,{urlParams:{limit:n}})},Mt={selector:"cds-table",init:function(t){const e=i.getSemanticAttributes(t),s=this,n=Nt(s,t);if((0,at.isDefAndNotNull)(n)){t.dataBinder=n;const o=Bt(t);t.skeleton=o;const a=Dt(n);t.pagination=a,t.after(a),n.fetchData().then(r=>{o.hide(),a.setData(n),X(s,t,e)})}else X(s,t,e)}},Tt=m.__exportAll({cdsPaginationWrap:()=>Ft}),Ft={selector:"cds-pagination",init:function(t){const e=this,s=customElements.get("cds-pagination");let n=null;e.listen(t,s.eventChangeCurrent,o=>{const a=o.detail.page,r=t.pageSize,c=(a-1)*r;c!==n&&(n=c,e.dispatchPanelEvent("pagination-changed-current",{detail:{page:a,pageSize:r,action:"page-change"}}))}),e.listen(t,s.eventPageSizeChanged,o=>{const a=t.pageSize;n=null,e.dispatchPanelEvent("pagination-changed-page-size",{detail:{page:1,pageSize:a,action:"page-size-change"}})})}},qt=m.__exportAll({cdsModalBodyContentWrap:()=>$t,cdsModalBodyWrap:()=>Ht,cdsModalCloseButWrap:()=>Ut,cdsModalFooterButWrap:()=>Gt,cdsModalFooterWrap:()=>jt,cdsModalHeaderWrap:()=>zt,cdsModalHeadingWrap:()=>Lt,cdsModalLabelWrap:()=>Rt,cdsModalWrap:()=>Ot}),Ot={selector:"cds-modal",init:function(t){const e=customElements.get("cds-modal"),s=i.getSemanticAttributes(t),n=i.getEventAttribute(t,"open-event","event");n&&this.listen(t,"cds-modal-beingopened",r=>{this.dispatchPanelEvent(n,{...s,action:"opened"})});const o=t.getAttribute("before-close-event");o&&this.listen(t,e.eventBeforeClose,r=>{this.dispatchPanelEvent(o,{...s,action:"closing",cancelable:!0})}),this.listen(t,e.eventClose,r=>{this.dispatchPanelEvent("destroy_me",{...s,action:"closed",triggeredBy:r.detail?.triggeredBy})});const a=i.getEventAttribute(t,"primary-event","event");a&&this.listen(t,"cds-modal-primary-focus",r=>{this.dispatchPanelEvent(a,{...s,action:"primary"})})}},zt={selector:"cds-modal-header"},Lt={selector:"cds-modal-heading"},Rt={selector:"cds-modal-label"},Ut={selector:"cds-modal-close-button"},Ht={selector:"cds-modal-body"},$t={selector:"cds-modal-body-content"},jt={selector:"cds-modal-footer"},Gt={selector:"cds-modal-footer-button",init:function(t){const e=i.getSemanticAttributes(t);if(t.getAttribute("type")==="submit"){this.listen(t,"click",n=>{let o=t.closest("form");if(!o){const a=t.getAttribute("form");a&&(o=document.getElementById(a))}o&&o.requestSubmit()});return}const s=e.event;s&&this.listen(t,"click",n=>{n.stopPropagation(),this.dispatchPanelEvent(s,e)})}},Vt=m.__exportAll({cdsMenuButtonWrap:()=>Jt,cdsMenuWrap:()=>Zt}),Zt={selector:"cds-menu",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"open-event");s&&this.listen(t,"cds-menu-opened",o=>{this.dispatchPanelEvent(s,{...e,action:"opened"})});const n=i.getEventAttribute(t,"close-event");n&&this.listen(t,"cds-menu-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})}),this.listen(t,"click",o=>{if(o.target.tagName==="CDS-MENU-ITEM"){const a=i.getSemanticAttributes(o.target),r=a.event||e.event;r&&(o.stopPropagation(),this.dispatchPanelEvent(r,{...e,...a}))}}),this.listen(t,"cds-item-changed",o=>{const a=o.detail.triggeredBy,r=i.getSemanticAttributes(a),c=r.event||e.event;c&&this.dispatchPanelEvent(c,{...e,...r,action:"selection-changed"})})}},Jt={selector:"cds-menu-button",init:function(t){const e=i.getSemanticAttributes(t),s=t.querySelector("cds-menu");s&&this.listen(s,"click",n=>{if(n.target.tagName==="CDS-MENU-ITEM"){const o=i.getSemanticAttributes(n.target),a=o.event||e.event;a&&(n.stopPropagation(),this.dispatchPanelEvent(a,{...e,...o}))}})}},Kt=m.__exportAll({cdsButFabWrap:()=>te,cdsButtonWrap:()=>Qt,cdsComboButWrap:()=>se,cdsCopyButWrap:()=>ee,cdsIconButToggleWrap:()=>Yt,cdsIconButWrap:()=>Xt}),Qt={selector:"cds-button",init:function(t){const e=i.getSemanticAttributes(t);if(t.getAttribute("type")==="submit"){this.listen(t,"click",n=>{let o=t.closest("form");if(!o){const a=t.getAttribute("form");a&&(o=document.getElementById(a))}o&&o.requestSubmit()});return}const s=e.event;s&&this.listen(t,"click",n=>{n.stopPropagation(),this.dispatchPanelEvent(s,i.getSemanticAttributes(t))})}},Xt={selector:"cds-icon-button:not([data-toggle])",event:"click",getData:(t,e)=>e},Yt={selector:"cds-icon-button[data-toggle]",init:function(t){const e=i.getSemanticAttributes(t);e.event&&this.listen(t,"click",s=>{s.stopPropagation(),t.isSelected=!t.isSelected,this.dispatchPanelEvent(e.event,{...e,isOn:t.isSelected})})}},te={selector:"cds-button[data-fab]",event:"click",getData:(t,e)=>e},ee={selector:"cds-copy-button",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&this.listen(t,"click",o=>{o.stopPropagation(),this.dispatchPanelEvent(s,{...e,action:"copy"})});const n=t.getAttribute("success-event");if(n){const o=new MutationObserver(()=>{t.hasAttribute("feedback-shown")&&this.dispatchPanelEvent(n,{...e,action:"copied"})});o.observe(t,{attributes:!0,attributeFilter:["feedback-shown"]}),t._copyObserver=o}}},se={selector:"cds-combo-button",init:function(t){const e=i.getSemanticAttributes(t);e.event&&this.listen(t,"click",n=>{const o=n.composedPath(),a=o.some(c=>c.tagName==="CDS-MENU-ITEM"),r=o.some(c=>c.tagName==="CDS-ICON-BUTTON");!a&&!r&&(n.stopPropagation(),this.dispatchPanelEvent(e.event,{...e,action:"primary"}))});const s=t.querySelector("cds-menu");s&&this.listen(s,"click",n=>{if(n.target.tagName==="CDS-MENU-ITEM"){const o=i.getSemanticAttributes(n.target),a=o.event||i.getEventAttribute(t,"menu-event","event");a&&this.dispatchPanelEvent(a,{...e,...o,action:"menu-item"})}})}},ne=m.__exportAll({cdsComboBoxWrap:()=>ae,cdsDropdownWrap:()=>oe,cdsMultiSelectWrap:()=>re}),oe={selector:"cds-dropdown",init:function(t){const e=customElements.get("cds-dropdown"),s=i.getSemanticAttributes(t),n=s.event;n&&this.listen(t,e.eventSelect,a=>{this.dispatchPanelEvent(n,{...s,value:t.value,selectedValue:a.detail?.item?.value,selectedText:a.detail?.item?.textContent?.trim()})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...s,open:t.hasAttribute("open")})})}},ae={selector:"cds-combo-box",init:function(t){const e=customElements.get("cds-combo-box"),s=i.getSemanticAttributes(t),n=s.event;n&&this.listen(t,e.eventSelect,a=>{const r=a.detail?.item;this.dispatchPanelEvent(n,{...s,value:t.value,selectedValue:r?.value,selectedText:r?.textContent?.trim()})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...s,open:t.hasAttribute("open")})})}},re={selector:"cds-multi-select",init:function(t){const e=customElements.get("cds-multi-select"),s=i.getSemanticAttributes(t),n=s.event;n&&this.listen(t,e.eventSelect,a=>{const r=t.value?t.value.split(","):[];this.dispatchPanelEvent(n,{...s,selectedItems:r})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...s,open:t.hasAttribute("open")})})}},ie=m.__exportAll({cdsDatePickerWrap:()=>ce,cdsTimePickerWrap:()=>le}),ce={selector:"cds-date-picker",init:function(t){const e=customElements.get("cds-date-picker"),s=i.getSemanticAttributes(t),n=t.querySelector('cds-date-picker-input[kind="from"]'),o=t.querySelector('cds-date-picker-input[kind="to"]'),a=n&&o,r=s.event;r&&this.listen(t,e.eventChange,p=>{let S;a?S={from:n.value||"",to:o.value||""}:S=t.value,this.dispatchPanelEvent(r,{...s,value:S})});const c=t.getAttribute("error-event");c&&this.listen(t,e.eventFlatpickrError,p=>{this.dispatchPanelEvent(c,{...s,error:p.detail})})}},le={selector:"cds-time-picker",event:"cds-time-picker-changed",getData:(t,e,s)=>({...e,value:s.value})},de=m.__exportAll({cdsFileUploaderButtonWrap:()=>ue,cdsFileUploaderDropContainerWrap:()=>ge,cdsFileUploaderWrap:()=>pe}),pe={selector:"cds-file-uploader",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;if(s){const o=t.querySelector('input[type="file"]');o&&this.listen(o,"change",a=>{this.dispatchPanelEvent(s,{...e,files:Array.from(a.target.files||[])})})}const n=t.getAttribute("delete-event");n&&this.listen(t,"cds-file-uploader-item-deleted",o=>{this.dispatchPanelEvent(n,{...e,fileName:o.detail?.fileName,fileId:o.detail?.fileId})})}};function rt(t,e){const s=new DataTransfer;for(const n of e)s.items.add(n);t.files=s.files,t.dispatchEvent(new Event("change",{bubbles:!0}))}function it(t){const e=t.getAttribute("for");if(!e)return console.warn(`[Zooy] ${t.tagName.toLowerCase()} missing 'for' attribute; cannot bind to a form input.`,t),null;const s=t.ownerDocument.getElementById(e);return!s||s.tagName!=="INPUT"||s.type!=="file"?(console.warn(`[Zooy] 'for=${e}' did not resolve to an <input type="file">.`,t),null):s}var ue={selector:"cds-file-uploader-button",init:function(t){const e=it(t),s=i.getSemanticAttributes(t),n=s.event;this.listen(t,"cds-file-uploader-button-changed",o=>{const a=o.detail?.addedFiles||[];e&&rt(e,a),n&&this.dispatchPanelEvent(n,{...s,files:Array.from(a)})})}};function ve(t,e,s,n){const o=t.querySelector(`[data-file-list-for="${e}"]`);if(o){o.replaceChildren();for(const a of s){const r=t.createElement("cds-file-uploader-item");r.setAttribute("state","edit"),r.textContent=a.name,r.addEventListener("cds-file-uploader-item-deleted",()=>{n(a.name)}),o.appendChild(r)}}}function me(t,e){const s=new DataTransfer;for(const n of t.files)n.name!==e&&s.items.add(n);t.files=s.files,t.dispatchEvent(new Event("change",{bubbles:!0}))}var ge={selector:"cds-file-uploader-drop-container",init:function(t){const e=it(t),s=i.getSemanticAttributes(t),n=s.event,o=t.getAttribute("for"),a=()=>{if(!o||!e)return;const r=Array.from(e.files);ve(t.ownerDocument,o,r,c=>{me(e,c),a()}),t.multiple||(t.style.display=r.length>0?"none":"")};this.listen(t,"cds-file-uploader-drop-container-changed",r=>{const c=r.detail?.addedFiles||[],p=t.multiple?c:c.slice(0,1);e&&rt(e,p),a(),n&&this.dispatchPanelEvent(n,{...s,files:Array.from(p)})})}},fe=m.__exportAll({cdsAccordionWrap:()=>be,cdsContentSwitcherWrap:()=>Ee,cdsTabsWrap:()=>he}),he={selector:"cds-tabs",init:function(t){const e=customElements.get("cds-tabs"),s=i.getSemanticAttributes(t),n=t.getAttribute("before-select-event");n&&this.listen(t,e.eventBeforeSelect,a=>{this.dispatchPanelEvent(n,{...s,tabValue:a.detail.value,cancelable:!0})});const o=s.event;o&&this.listen(t,e.eventSelect,a=>{const r=a.detail.item,c=i.getSemanticAttributes(r);this.dispatchPanelEvent(o,{...s,...c,tabValue:a.detail.value})})}},be={selector:"cds-accordion",init:function(t){const e=customElements.get("cds-accordion-item"),s=i.getSemanticAttributes(t);[...t.querySelectorAll("cds-accordion-item")].forEach(n=>{const o=i.getSemanticAttributes(n),a=o.event||s.event;a&&this.listen(n,e.eventToggle,r=>{this.dispatchPanelEvent(a,{...s,...o,open:r.detail.open})})})}},Ee={selector:"cds-content-switcher",init:function(t){const e=customElements.get("cds-content-switcher"),s=i.getSemanticAttributes(t),n=t.getAttribute("before-select-event");n&&this.listen(t,e.eventBeforeSelect,a=>{this.dispatchPanelEvent(n,{...s,value:a.detail.value,cancelable:!0})});const o=s.event;o&&this.listen(t,e.eventSelect,a=>{const r=a.detail.item,c=i.getSemanticAttributes(r);this.dispatchPanelEvent(o,{...s,...c,value:r.getAttribute("value")})})}},Ae=m.__exportAll({cdsBreadCrumbWrap:()=>Ie,cdsBreadcrumbItemWrap:()=>Se,cdsBreadcrumbLinkWrap:()=>We}),Se={selector:"cds-breadcrumb-item"},We={selector:"cds-breadcrumb-link",event:"click",getData:(t,e,s)=>(t.preventDefault(),{...e,href:s.getAttribute("href")})},Ie={selector:"cds-breadcrumb",init:function(t){const e=this,s=i.getSemanticAttributes(t),n=s.event;if(n){const o=r=>{e.dispatchPanelEvent(n,{...s,...r})};e.listen(t,"click",r=>{const c=r.target.closest("cds-breadcrumb-link");c&&(r.preventDefault(),r.stopPropagation(),o(i.getSemanticAttributes(c)))});const a=t.querySelector("cds-overflow-menu-body");a&&e.listen(a,"cds-overflow-menu-item-clicked",r=>{r.stopPropagation(),o(i.getSemanticAttributes(r.target))})}}},Pe=m.__exportAll({cdsNumberInputWrap:()=>_e,cdsPasswordInputWrap:()=>Ce,cdsSearchWrap:()=>xe,cdsTextAreaWrap:()=>ye,cdsTextInputWrap:()=>ke}),ke={selector:"cds-text-input",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},ye={selector:"cds-textarea",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},_e={selector:"cds-number-input",event:"cds-number-input",getData:(t,e,s)=>({...e,value:t.detail.value,direction:t.detail.direction})},Ce={selector:"cds-password-input",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},xe={selector:"cds-search",event:"cds-search-input",getData:(t,e,s)=>({...e,value:s.value})},we=m.__exportAll({cdsCheckboxWrap:()=>De,cdsRadioButGroupWrap:()=>Be,cdsSelectWrap:()=>Me,cdsSliderWrap:()=>Te,cdsToggleWrap:()=>Ne}),De={selector:"cds-checkbox",event:"cds-checkbox-changed",getData:(t,e,s)=>({...e,checked:t.detail.checked,value:s.value})},Be={selector:"cds-radio-button-group",event:"cds-radio-button-group-changed",getData:(t,e)=>({...e,value:t.detail?.value})},Ne={selector:"cds-toggle",event:"cds-toggle-changed",getData:(t,e)=>({...e,isOn:t.detail.checked,value:t.detail.checked})},Me={selector:"cds-select",event:"cds-select-selected",getData:(t,e)=>({...e,value:t.detail.value})},Te={selector:"cds-slider",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&this.listen(t,"cds-slider-changed",o=>{this.dispatchPanelEvent(s,{...e,value:o.detail.value})});const n=t.getAttribute("input-event");n&&this.listen(t,"cds-slider-input-changed",o=>{this.dispatchPanelEvent(n,{...e,value:o.detail.value})})}},Fe=m.__exportAll({cdsFilterTagWrap:()=>ze,cdsSDismissibleTagWrap:()=>Oe,cdsTagsWrap:()=>qe}),qe={selector:"cds-tag",event:"click",getData:(t,e)=>e},Oe={selector:"cds-dismissible-tag",init:function(t){const e=i.getSemanticAttributes(t),s=t.getAttribute("click-event");s&&this.listen(t,"click",o=>{o.target.closest("button")||this.dispatchPanelEvent(s,{...e})});const n=e.event;n&&this.listen(t,"cds-dismissible-tag-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})})}},ze={selector:"cds-filter-tag",event:"cds-filter-tag-closed",getData:(t,e)=>({...e,action:"remove"})},Le=m.__exportAll({cdsContainedListDescriptionWrap:()=>$e,cdsContainedListItemWrap:()=>je,cdsContainedListWrap:()=>He,cdsOverflowMenuWrap:()=>Re,cdsStructuredListWrap:()=>Ue,cdsTreeViewWrap:()=>Ge}),Re={selector:"cds-overflow-menu",init:function(t){const e=i.getSemanticAttributes(t),s=e.event,n=t.querySelector("cds-overflow-menu-body");s&&n&&this.listen(n,"cds-overflow-menu-item-clicked",o=>{o.stopPropagation();const a=i.getSemanticAttributes(o.target);this.dispatchPanelEvent(s,{...e,...a})})}},Ue={selector:"cds-structured-list",init:function(t){const e=i.getSemanticAttributes(t);[...t.querySelectorAll("cds-structured-list-row")].forEach(s=>{const n=i.getSemanticAttributes(s),o=n.event||e.event;o&&this.listen(s,"click",a=>{a.stopPropagation(),this.dispatchPanelEvent(o,{...e,...n})})}),t.hasAttribute("selection")&&this.listen(t,"cds-structured-list-selected",s=>{const n=s.detail.row,o=i.getSemanticAttributes(n),a=e.event;a&&this.dispatchPanelEvent(a,{...e,...o})})}},He={selector:"cds-contained-list"},$e={selector:"cds-contained-list-description"},je={selector:"cds-contained-list-item",event:"cds-contained-list-item-click",getData:(t,e)=>e},Ge={selector:"cds-tree-view",init:function(t){const e=i.getSemanticAttributes(t);this.listen(t,"cds-tree-node-selected",n=>{const o=n.detail.node,a=i.getSemanticAttributes(o),r=a.event||e.event;r&&this.dispatchPanelEvent(r,{...e,...a,nodeId:o.id,label:o.getAttribute("label")})});const s=i.getEventAttribute(t,"expand-event");s&&this.listen(t,"cds-tree-node-expanded",n=>{this.dispatchPanelEvent(s,{...e,nodeId:n.detail.node.id,expanded:n.detail.expanded})})}},Ve=m.__exportAll({cdsActionableNotificationWrap:()=>Ke,cdsInlineNotificationWrap:()=>Je,cdsToastNotificationWrap:()=>Ze}),Ze={selector:"cds-toast-notification",event:"cds-notification-closed",getData:(t,e)=>({...e,action:"closed"})},Je={selector:"cds-inline-notification",event:"cds-notification-closed",getData:(t,e)=>({...e,action:"closed"})},Ke={selector:"cds-actionable-notification",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"close-event","event");s&&this.listen(t,"cds-notification-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})});const n=i.getEventAttribute(t,"action-event");n&&this.listen(t,"cds-notification-actioned",o=>{this.dispatchPanelEvent(n,{...e,action:"actioned"})})}},Qe=m.__exportAll({cdsClickableTileWrap:()=>Ye,cdsExpandableTileWrap:()=>ts,cdsRadioTileWrap:()=>ss,cdsSelectableTileWrap:()=>es,cdsTileGroupWrap:()=>ns,cdsTileWrap:()=>Xe}),Xe={selector:"cds-tile"},Ye={selector:"cds-clickable-tile",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;if(s){const n=e.href||t.getAttribute("href")||"";t.removeAttribute("href"),t.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),this.dispatchPanelEvent(s,{...e,href:n})},!0)}}},ts={selector:"cds-expandable-tile",init:function(t){const e=i.getSemanticAttributes(t),s=t.getAttribute("before-toggle-event");s&&this.listen(t,"cds-expandable-tile-beingtoggled",o=>{this.dispatchPanelEvent(s,{...e,expanded:o.detail.expanded,cancelable:!0})});const n=e.event;n&&this.listen(t,"cds-expandable-tile-toggled",o=>{this.dispatchPanelEvent(n,{...e,expanded:o.detail.expanded})})}},es={selector:"cds-selectable-tile",event:"cds-selectable-tile-changed",getData:(t,e,s)=>({...e,selected:t.detail.selected,value:s.value})},ss={selector:"cds-radio-tile",event:"cds-radio-tile-selected",getData:(t,e,s)=>({...e,selected:t.detail.selected,name:t.detail.name,value:s.value})},ns={selector:"cds-tile-group",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&(this.listen(t,"cds-current-radio-tile-selection",n=>{const o=n.detail.target;this.dispatchPanelEvent(s,{...e,value:o?.value,name:o?.name,selected:o?.selected})}),this.listen(t,"cds-current-selectable-tile-selections",n=>{const o=n.detail.currentSelections||[];this.dispatchPanelEvent(s,{...e,values:o.map(a=>a.value),names:o.map(a=>a.name),count:o.length})}))}},os=m.__exportAll({cdsInlineLoadingWrap:()=>is,cdsProgressBarWrap:()=>as,cdsProgressIndicatorWrap:()=>rs}),as={selector:"cds-progress-bar",init:function(t){const e=i.getSemanticAttributes(t);if(e.event){const s=new MutationObserver(()=>{const n=parseFloat(t.getAttribute("value")||"0");n>=parseFloat(t.getAttribute("max")||"100")&&this.dispatchPanelEvent(e.event,{...e,value:n,status:"complete"})});s.observe(t,{attributes:!0,attributeFilter:["value"]}),t._progressObserver=s}}},rs={selector:"cds-progress-indicator",init:function(t){const e=i.getSemanticAttributes(t);this.listen(t,"cds-progress-step-click",s=>{const n=s.target,o=i.getSemanticAttributes(n),a=o.event||e.event;a&&this.dispatchPanelEvent(a,{...e,...o,stepIndex:n.getAttribute("data-index"),stepLabel:n.getAttribute("label")})})}},is={selector:"cds-inline-loading",init:function(t){const e=i.getSemanticAttributes(t),s=e.event;s&&this.listen(t,"cds-inline-loading-onsuccess",o=>{this.dispatchPanelEvent(s,{...e,status:"finished"})});const n=t.getAttribute("status-event");if(n){const o=new MutationObserver(a=>{a.forEach(r=>{if(r.attributeName==="status"){const c=t.getAttribute("status");this.dispatchPanelEvent(n,{...e,status:c})}})});o.observe(t,{attributes:!0,attributeFilter:["status"]}),t._statusObserver=o}}},cs=m.__exportAll({cdsPopoverWrap:()=>ds,cdsToggletipWrap:()=>ps,cdsTooltipWrap:()=>ls}),ls={selector:"cds-tooltip",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"open-event");s&&this.listen(t,"cds-tooltip-beingopened",o=>{this.dispatchPanelEvent(s,{...e,action:"opened"})});const n=i.getEventAttribute(t,"close-event");n&&this.listen(t,"cds-tooltip-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})})}},ds={selector:"cds-popover",init:function(t){const e=i.getSemanticAttributes(t),s=i.getEventAttribute(t,"open-event");s&&this.listen(t,"cds-popover-beingopened",o=>{this.dispatchPanelEvent(s,{...e,action:"opened"})});const n=i.getEventAttribute(t,"close-event");n&&this.listen(t,"cds-popover-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})})}},ps={selector:"cds-toggletip",init:function(t){const e=i.getSemanticAttributes(t);if(e.event){const s=new MutationObserver(n=>{n.forEach(o=>{if(o.attributeName==="open"){const a=t.hasAttribute("open");this.dispatchPanelEvent(e.event,{...e,action:a?"opened":"closed",open:a})}})});s.observe(t,{attributes:!0,attributeFilter:["open"]}),t._toggletipObserver=s}}},us=m.__exportAll({cdsCodeSnipWrap:()=>ms,cdsLinkWrap:()=>vs}),vs={selector:"cds-link",event:"click",getData:(t,e,s)=>({...e,href:s.getAttribute("href")})},ms={selector:"cds-code-snippet",event:"cds-copy-button-clicked",getData:(t,e)=>({...e,action:"copied"})},gs=m.__exportAll({cdsBadgeIndicatorWrap:()=>Ps,cdsFormGroupWrap:()=>bs,cdsFormItemWrap:()=>hs,cdsFormWrap:()=>fs,cdsHeadingWrap:()=>As,cdsIconIndicatorWrap:()=>Is,cdsIconWrap:()=>Ws,cdsLoadingWrap:()=>ks,cdsSectionWrap:()=>Ss,cdsSkeletonPlaceholderWrap:()=>_s,cdsSkeletonTextWrap:()=>ys,cdsStackWrap:()=>Es}),fs={selector:"cds-form"},hs={selector:"cds-form-item"},bs={selector:"cds-form-group"},Es={selector:"cds-stack"},As={selector:"cds-heading"},Ss={selector:"cds-section"},Ws={selector:"cds-icon"},Is={selector:"cds-icon-indicator"},Ps={selector:"cds-badge-indicator"},ks={selector:"cds-loading"},ys={selector:"cds-skeleton-text"},_s={selector:"cds-skeleton-placeholder"};function f(t){return Object.values(t).filter(e=>typeof e=="object"&&e!==null&&e.selector)}var Cs=[...f(Tt),...f(wt),...f(qt),...f(Vt),...f(Kt),...f(ne),...f(ie),...f(de),...f(fe),...f(Ae),...f(Pe),...f(we),...f(Fe),...f(Le),...f(Ve),...f(Qe),...f(os),...f(cs),...f(us),...f(gs)];function xs(){const t=new Map;return Cs.forEach(e=>{t.set(e.selector,e)}),t}var ws=()=>import("@carbon/web-components/es/components/accordion/index.js"),R=()=>import("@carbon/web-components/es/components/breadcrumb/index.js"),Ds=()=>import("@carbon/web-components/es/components/stack/index.js"),Bs=()=>import("@carbon/web-components/es/components/structured-list/index.js"),U=()=>import("@carbon/web-components/es/components/contained-list/index.js"),D=()=>import("@carbon/web-components/es/components/tile/index.js"),Ns=()=>import("@carbon/web-components/es/components/tree-view/index.js"),Ms=()=>import("@carbon/web-components/es/components/link/index.js"),Ts=()=>import("@carbon/web-components/es/components/tabs/index.js"),Fs=()=>import("@carbon/web-components/es/components/content-switcher/index.js"),Y=()=>import("@carbon/web-components/es/components/menu/index.js"),qs=()=>import("@carbon/web-components/es/components/overflow-menu/index.js"),H=()=>import("@carbon/web-components/es/components/button/index.js"),tt=()=>import("@carbon/web-components/es/components/icon-button/index.js"),Os=()=>import("@carbon/web-components/es/components/combo-button/index.js"),zs=()=>import("@carbon/web-components/es/components/copy-button/index.js"),Ls=()=>import("@carbon/web-components/es/components/checkbox/index.js"),Rs=()=>import("@carbon/web-components/es/components/radio-button/index.js"),Us=()=>import("@carbon/web-components/es/components/toggle/index.js"),$=()=>import("@carbon/web-components/es/components/select/index.js"),Hs=()=>import("@carbon/web-components/es/components/slider/index.js"),j=()=>import("@carbon/web-components/es/components/text-input/index.js"),$s=()=>import("@carbon/web-components/es/components/textarea/index.js"),js=()=>import("@carbon/web-components/es/components/number-input/index.js"),Gs=()=>import("@carbon/web-components/es/components/password-input/index.js"),et=()=>import("@carbon/web-components/es/components/search/index.js"),Vs=()=>import("@carbon/web-components/es/components/combo-box/index.js"),Zs=()=>import("@carbon/web-components/es/components/dropdown/index.js"),Js=()=>import("@carbon/web-components/es/components/multi-select/index.js"),Ks=()=>import("@carbon/web-components/es/components/date-picker/index.js"),Qs=()=>import("@carbon/web-components/es/components/time-picker/index.js"),T=()=>import("@carbon/web-components/es/components/file-uploader/index.js"),st=()=>import("@carbon/web-components/es/components/form/index.js"),Xs=()=>import("@carbon/web-components/es/components/form-group/index.js"),Ys=()=>import("@carbon/web-components/es/components/data-table/index.js"),nt=()=>import("@carbon/web-components/es/components/pagination/index.js"),tn=()=>import("@carbon/web-components/es/components/code-snippet/index.js"),G=()=>import("@carbon/web-components/es/components/tag/index.js"),en=()=>import("@carbon/web-components/es/components/badge-indicator/index.js"),V=()=>import("@carbon/web-components/es/components/notification/index.js"),sn=()=>import("@carbon/web-components/es/components/loading/index.js"),nn=()=>import("@carbon/web-components/es/components/inline-loading/index.js"),on=()=>import("@carbon/web-components/es/components/progress-bar/index.js"),an=()=>import("@carbon/web-components/es/components/progress-indicator/index.js"),rn=()=>import("@carbon/web-components/es/components/skeleton-placeholder/index.js"),cn=()=>import("@carbon/web-components/es/components/skeleton-text/index.js"),P=()=>import("@carbon/web-components/es/components/modal/index.js"),k=()=>import("@carbon/web-components/es/components/tooltip/index.js"),ln=()=>import("@carbon/web-components/es/components/popover/index.js"),dn=()=>import("@carbon/web-components/es/components/toggle-tip/index.js"),ot=()=>import("@carbon/web-components/es/components/heading/index.js"),pn=()=>import("@carbon/web-components/es/components/icon/index.js"),un=()=>import("@carbon/web-components/es/components/icon-indicator/index.js"),q={"cds-table":[k,H,j,et,$,nt,Ys],"cds-pagination":[$,j,nt],"cds-button":[k,H],"cds-icon-button:not([data-toggle])":[k,tt],"cds-icon-button[data-toggle]":[k,tt],"cds-button[data-fab]":[k,H],"cds-copy-button":[k,zs],"cds-combo-button":[k,Os],"cds-checkbox":[Ls],"cds-radio-button-group":[Rs],"cds-toggle":[Us],"cds-select":[$],"cds-slider":[Hs],"cds-text-input":[j],"cds-textarea":[$s],"cds-number-input":[js],"cds-password-input":[k,Gs],"cds-search":[et],"cds-dropdown":[Zs],"cds-combo-box":[Vs],"cds-multi-select":[Js],"cds-date-picker":[Ks],"cds-time-picker":[Qs],"cds-file-uploader":[T],"cds-file-uploader-button":[T],"cds-file-uploader-drop-container":[T],"cds-file-uploader-item":[T],"cds-tabs":[Ts],"cds-accordion":[ws],"cds-content-switcher":[Fs],"cds-breadcrumb":[R],"cds-breadcrumb-item":[R],"cds-breadcrumb-link":[R],"cds-menu":[Y],"cds-menu-button":[Y],"cds-overflow-menu":[qs],"cds-structured-list":[Bs],"cds-contained-list":[U],"cds-contained-list-item":[U],"cds-contained-list-description":[U],"cds-tree-view":[Ns],"cds-modal":[P],"cds-modal-header":[P],"cds-modal-heading":[P],"cds-modal-label":[P],"cds-modal-close-button":[P],"cds-modal-body":[P],"cds-modal-body-content":[P],"cds-modal-footer":[P],"cds-modal-footer-button":[P],"cds-toast-notification":[V],"cds-inline-notification":[V],"cds-actionable-notification":[V],"cds-tile":[D],"cds-tile-group":[D],"cds-clickable-tile":[D],"cds-expandable-tile":[D],"cds-selectable-tile":[D],"cds-radio-tile":[D],"cds-progress-bar":[on],"cds-progress-indicator":[an],"cds-inline-loading":[nn],"cds-tooltip":[k],"cds-popover":[ln],"cds-toggletip":[dn],"cds-tag":[G],"cds-dismissible-tag":[G],"cds-filter-tag":[G],"cds-link":[Ms],"cds-code-snippet":[tn],"cds-form":[st],"cds-form-item":[st],"cds-form-group":[Xs],"cds-stack":[Ds],"cds-heading":[ot],"cds-section":[ot],"cds-icon":[pn],"cds-icon-indicator":[un],"cds-badge-indicator":[en],"cds-loading":[sn],"cds-skeleton-text":[cn],"cds-skeleton-placeholder":[rn]};function vn(t){const e=new Map;if(!t||!(t instanceof Element))return e;for(const n of Object.keys(F))e.set(n,[]);for(const[n]of Object.entries(F))t.matches(n)&&e.get(n).push(t);const s=t.querySelectorAll("*");for(const n of s)for(const[o]of Object.entries(F))n.matches(o)&&e.get(o).push(n);for(const[n,o]of e.entries())o.length===0&&e.delete(n);return e}function mn(t){const e=new Set;for(const[s,n]of t.entries())n.length>0&&q[s]&&q[s].forEach(o=>e.add(o));return e}async function gn(t,e){if(t.size===0)return;const s=Array.from(t).map(async n=>(e.has(n)||e.set(n,n()),e.get(n)));await Promise.all(s)}function fn(t,e){let s=0;for(const[n,o]of t.entries()){const a=F[n];o.forEach(r=>{if(a.init){a.init.call(e,r);return}if(a.multiEvent){const S=i.getSemanticAttributes(r);a.events.forEach(W=>{const x=i.getEventAttribute(r,W.attrName,"event");x&&e.listen(r,W.type,O=>{e.dispatchPanelEvent(x,W.getData(O,S,r))})});return}const c=i.getSemanticAttributes(r),p=c.event;p&&e.listen(r,a.event,S=>{S.stopPropagation();const W=a.getData(S,c,r),x=W._eventOverride||p;delete W._eventOverride,e.dispatchPanelEvent(x,W)})}),s+=o.length}return s}var F=Object.fromEntries(xs()),hn=async function(t,e){const s=vn(t);if(s.size===0){this.debugMe("[Carbon] No Carbon components found in panel");return}this.carbonComponents||(this.carbonComponents=new Map);for(const[a,r]of s.entries())this.carbonComponents.set(a,r);const n=mn(s);if(n.size>0)try{await gn(n,e)}catch(a){console.error("[Carbon] Failed to load some component modules:",a)}const o=fn(s,this);o>0&&this.debugMe(`[Carbon] Total components initialized: ${o}`)},bn=(t={})=>{const{preload:e=[]}=t,s=new Map;if(e.length>0){const n=e.filter(a=>q[a]?!0:(console.warn(`[Carbon] No import found for selector: ${a}`),!1)),o=n.flatMap(a=>q[a].map(r=>(s.has(r)||s.set(r,r()),s.get(r))));Promise.all(o).then(()=>console.debug(`[Carbon] Preloaded: ${n.join(", ")}`)).catch(a=>console.warn("[Carbon] Preload error:",a))}m.ComponentLibraryRegistry.register("carbon",{cache:s,render:async function(n,o){try{await hn.call(this,n,o)}catch(a){console.error("[Carbon] Initialization error:",a)}},dispose:function(n){},config:{version:"2.0",description:"IBM Carbon Design System Web Components"}}),console.debug("[Zooy] Carbon Design System library registered")};exports.registerCarbonLibrary=bn;
|