@ninebone/table 0.0.467 → 0.0.468
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/nine-table.js +16 -16
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +1 -1
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.umd.js
CHANGED
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
<button class='ng-scroll-top' disabled><div class='ng-scroll-icon'></div></button>
|
|
124
124
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
125
125
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
126
|
-
`;const e=c(()=>{const s=t(this,Y).shadowRoot.querySelector(".ng-container-body .ng-part-body");if(!s){setTimeout(e,10);return}b(this,T,{container:s,track:this.querySelector(".ng-scroll-track"),thumb:this.querySelector(".ng-scroll-thumb"),top:this.querySelector(".ng-scroll-top"),bottom:this.querySelector(".ng-scroll-bottom")}),t(this,Bt).call(this),this.refresh()},"initWhenReady");e()}};Y=new WeakMap,lt=new WeakMap,tt=new WeakMap,T=new WeakMap,xt=new WeakMap,vt=new WeakMap,Bt=new WeakMap,c(Re,"NineTableVScrollBar");let mt=Re;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",mt);const qe=class qe{constructor(i){d(this,j);d(this,R);d(this,D,new Map);d(this,I,null);d(this,U,null);d(this,et,0);d(this,wt,40);d(this,ct,!1);d(this,zt,3);A(this,"refresh",c(()=>{var e;const i=t(this,R).querySelector(".ng-container-body .ng-part-body");i&&(t(this,St).call(this),t(this,ht).call(this,i.scrollTop),(e=t(this,R).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));A(this,"initialize",c(()=>{b(this,I,null),t(this,D).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const r=t(this,R).querySelector(n);if(!r)return;const o=r.querySelector(".ng-part-body table");if(!o)return;const a=o.querySelector("tbody.bindable-tbody");if(!a)return;const l=Array.from(a.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,D).set(n,l)});const i=t(this,R).querySelector(".ng-container-body .ng-part-body"),e=t(this,R).querySelector(".ng-container-left .ng-part-body"),s=t(this,R).querySelector(".ng-container-right .ng-part-body");if(i){t(this,Pt).call(this,i),t(this,At).call(this),t(this,St).call(this),t(this,ht).call(this,i.scrollTop);let n=!1;const r=c((o,a)=>{var h;n||(n=!0,i&&i.scrollTop!==o&&(i.scrollTop=o),e&&e.scrollTop!==o&&(e.scrollTop=o),s&&s.scrollTop!==o&&(s.scrollTop=o),t(this,ht).call(this,o),(h=t(this,R).querySelector("nine-table-vscrollbar"))==null||h.refresh(),n=!1)},"syncScroll");[i,e,s].forEach(o=>{o&&o.addEventListener("scroll",()=>{r(o.scrollTop)})})}},"initialize"));d(this,Dt,c((i,e)=>{const s=t(this,D).get(e);if(!s||s.length===0)return;const n=i.querySelector(".ng-part-body tbody.bindable-tbody");if(!n)return;n.querySelectorAll("tr:not(.nodata)").forEach(a=>a.remove());const r=n.querySelector("tr.nodata"),o=document.createDocumentFragment();for(let a=0;a<t(this,wt);a++)s.forEach(h=>{o.appendChild(h.cloneNode(!0))});r?r.before(o):n.appendChild(o)},"#renderRows"));d(this,Pt,c(i=>{if(t(this,I)!==null&&t(this,I)>0)return t(this,I);const e=t(this,D).get(".ng-container-body");if(!e||e.length===0)return 24;const s=i.querySelector("tbody.bindable-tbody");if(!s)return 24;s.querySelectorAll("tr:not(.nodata)").forEach(p=>p.remove());const n=s.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(p=>{r.appendChild(p.cloneNode(!0))}),n?n.before(r):s.appendChild(r);const o=t(this,R),a=o.style.display,h=o.style.visibility,l=o.style.position;(a==="none"||window.getComputedStyle(o).display==="none")&&(o.style.display="block",o.style.visibility="hidden",o.style.position="absolute");let f=0;const u=s.querySelectorAll("tr:not(.nodata)");return u.forEach(p=>{f+=p.offsetHeight||p.getBoundingClientRect().height}),u.forEach(p=>p.remove()),o.style.display=a,o.style.visibility=h,o.style.position=l,b(this,I,f>0?f:24),t(this,Et).call(this),t(this,I)},"#measureAndCacheHeight"));d(this,St,c(()=>{const e=(t(this,j).data.get()||[]).length,s=t(this,I)||24,n=e*s;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const o=t(this,R).querySelector(r);if(!o)return;const a=o.querySelector(".ng-part-body .ng-virtual-spacer");a&&(a.style.height=`${n}px`)})},"#updateVirtualScrollHeight"));d(this,Et,c(()=>{if(t(this,et)>0&&t(this,I)>0){const i=Math.ceil(t(this,et)/t(this,I));b(this,wt,i+t(this,zt))}},"#updateRowCount"));d(this,jt,c(()=>{var a,h,l,f,u,p;const i=t(this,R).querySelector(".ng-container-left .ng-part-body table"),e=t(this,R).querySelector(".ng-container-body .ng-part-body table"),s=t(this,R).querySelector(".ng-container-right .ng-part-body table");if(e){const g=i?Array.from(i.querySelectorAll("tbody tr")):[],m=Array.from(e.querySelectorAll("tbody tr")),v=s?Array.from(s.querySelectorAll("tbody tr")):[],q=Math.max(g.length,m.length,v.length);for(let x=0;x<q;x++){const B=[((a=g[x])==null?void 0:a.getBoundingClientRect().height)||0,((h=m[x])==null?void 0:h.getBoundingClientRect().height)||0,((l=v[x])==null?void 0:l.getBoundingClientRect().height)||0],M=Math.max(...B);M>0&&(g[x]&&(g[x].style.height=`${M}px`),m[x]&&(m[x].style.height=`${M}px`),v[x]&&(v[x].style.height=`${M}px`))}}const n=t(this,R).querySelector(".ng-container-left .ng-part-footer table"),r=t(this,R).querySelector(".ng-container-body .ng-part-footer table"),o=t(this,R).querySelector(".ng-container-right .ng-part-footer table");if(r){const g=n?Array.from(n.querySelectorAll("tfoot tr")):[],m=Array.from(r.querySelectorAll("tfoot tr")),v=o?Array.from(o.querySelectorAll("tfoot tr")):[],q=Math.max(g.length,m.length,v.length);for(let x=0;x<q;x++){const B=[((f=g[x])==null?void 0:f.getBoundingClientRect().height)||0,((u=m[x])==null?void 0:u.getBoundingClientRect().height)||0,((p=v[x])==null?void 0:p.getBoundingClientRect().height)||0],M=Math.max(...B);M>0&&(g[x]&&(g[x].style.height=`${M}px`),m[x]&&(m[x].style.height=`${M}px`),v[x]&&(v[x].style.height=`${M}px`))}}},"#syncRowHeights"));d(this,Ft,c(()=>{!t(this,R)||!(t(this,R)instanceof HTMLElement)||(b(this,U,new ResizeObserver(i=>{for(const e of i){const s=e.target;if(!s.classList.contains("active"))continue;const n=e.contentRect.height;if(n>0){let r=0;const o=s.querySelector(".ng-part-header"),a=s.querySelector(".ng-part-footer");o&&(r+=o.offsetHeight),a&&(r+=a.offsetHeight);const h=Math.max(n-r,100);t(this,et)!==h&&(b(this,et,h),t(this,Et).call(this),t(this,I)!==null&&t(this,At).call(this))}}})),t(this,U).observe(t(this,R)))},"#initResizeObserver"));d(this,At,c(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(i=>{const e=t(this,R).querySelector(i);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,Dt).call(this,e,i)}),t(this,Yt).call(this),t(this,jt).call(this)},"#renderAllContainers"));d(this,Vt,c(i=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var l;const s=t(this,R).querySelector(e);if(!s)return;const n=s.querySelector(".ng-part-body tbody.bindable-tbody");if(!n)return;const r=Array.from(n.querySelectorAll("tr:not(.nodata)")),o=((l=t(this,D).get(e))==null?void 0:l.length)||1,h=(t(this,j).data.get()||[]).length;r.forEach((f,u)=>{const p=i+Math.floor(u/o);if(p>=h){f.style.display="none";return}const g=t(this,j).data.get(p);f.style.display="",t(this,Rt).call(this,f,g,p)})})},"#adjustBufferRows"));d(this,ht,c(i=>{var h;const e=t(this,I);if(!e||e<=0)return;const n=(t(this,j).data.get()||[]).length,r=Math.max(0,Math.floor(i/e)),o=r*e,a=((h=t(this,D).get(".ng-container-body"))==null?void 0:h.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(l=>{const f=t(this,R).querySelector(l);if(!f)return;const u=f.querySelector(".ng-part-body tbody.bindable-tbody");if(!u)return;u.style.transform=`translateY(${o}px)`,Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((g,m)=>{const v=r+Math.floor(m/a);if(v>=n){g.style.display="none";return}const q=t(this,j).data.get(v);g.style.display="",t(this,Rt).call(this,g,q,v)})}),t(this,ct)||(b(this,ct,!0),setTimeout(()=>{t(this,Vt).call(this,r),b(this,ct,!1)},0))},"#handleScroll"));d(this,Rt,c((i,e,s)=>{i.dataset.row=s,i.data=e,Array.from(i.cells).forEach((n,r)=>{n.dataset.row=s,n.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');const o=Array.from(n.children).find(a=>a.tagName.toLowerCase().startsWith("cell-")||typeof a.refresh=="function");o&&typeof o.refresh=="function"&&o.refresh()})},"#bindRowData"));d(this,Yt,c(()=>{var h,l,f;const i=t(this,R).querySelector(".ng-container-left .ng-part-header table"),e=t(this,R).querySelector(".ng-container-body .ng-part-header table"),s=t(this,R).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const n=i?Array.from(i.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),o=s?Array.from(s.querySelectorAll("tr")):[],a=Math.max(n.length,r.length,o.length);for(let u=0;u<a;u++){const p=[((h=n[u])==null?void 0:h.getBoundingClientRect().height)||0,((l=r[u])==null?void 0:l.getBoundingClientRect().height)||0,((f=o[u])==null?void 0:f.getBoundingClientRect().height)||0],g=Math.max(...p);g>0&&(n[u]&&(n[u].style.height=`${g}px`),r[u]&&(r[u].style.height=`${g}px`),o[u]&&(o[u].style.height=`${g}px`))}},"#syncHeaderHeights"));A(this,"destroy",c(()=>{t(this,U)&&(t(this,U).disconnect(),b(this,U,null))},"destroy"));b(this,j,i.getRootNode().host),b(this,R,i),t(this,Ft).call(this)}getRowHeight(){return t(this,I)}templateLength(i=".ng-container-body"){var e;return((e=t(this,D).get(i))==null?void 0:e.length)||1}};j=new WeakMap,R=new WeakMap,D=new WeakMap,I=new WeakMap,U=new WeakMap,et=new WeakMap,wt=new WeakMap,ct=new WeakMap,zt=new WeakMap,Dt=new WeakMap,Pt=new WeakMap,St=new WeakMap,Et=new WeakMap,jt=new WeakMap,Ft=new WeakMap,At=new WeakMap,Vt=new WeakMap,ht=new WeakMap,Rt=new WeakMap,Yt=new WeakMap,c(qe,"RowManager");let he=qe;const Ut=class Ut{static compileAll(i){return Array.isArray(i)?i.map(e=>Ut.compile(e)):[]}static compile(i){if(!i)return null;const e=c(a=>{a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach(l=>{const f=l.getAttribute("cell-type")||"renderer";if(l.children.length>0&&l.firstElementChild.tagName.includes("-"))return;let u=`cell-${f}`;const p=l.getAttribute("data-bind"),g=l.getAttribute("data-expr"),m=l.getAttribute("maxbyte"),v=l.getAttribute("type");let q=[];p&&q.push(`data-bind="${p}"`),g&&q.push(`data-expr="${g}"`),m&&q.push(`maxbyte="${m}"`),v&&q.push(`type="${v}"`),l.innerHTML=`<${u} ${q.join(" ")}></${u}>`})},"processCellTypes"),s=c(a=>{if(!a.querySelector("colgroup")){const h=a.querySelector("tbody tr")||a.querySelector("tr"),l=h?h.querySelectorAll("th, td").length:1,f=document.createElement("colgroup"),u=Math.max(Math.floor(a.clientWidth/l),100);for(let p=0;p<l;p++){const g=document.createElement("col");g.setAttribute("width",u),f.appendChild(g)}a.prepend(f)}if(!a.querySelector("thead")){const h=document.createElement("thead"),l=a.querySelector("colgroup");l?l.after(h):a.prepend(h)}a.classList.add("nine-table-element"),a.style.display="table"},"ensureTableStructure"),n=c((a,h)=>{const l=Array.from(a.querySelectorAll(h+" tr")),f=Array.from(a.querySelectorAll(h+" th,"+h+" td")),u=l.length;if(u===0||f.length===0)return;let p=0;f.forEach(m=>{p+=m.colSpan||1});const g=Array.from(Array(u),()=>Array(p).fill(null));l.forEach(m=>{const v=m.sectionRowIndex;let q=0;Array.from(m.querySelectorAll("th,td")).forEach(x=>{for(let P=0;P<g[v].length;P++)if(g[v][P]===null){q=P;break}const B=x.rowSpan||1,M=x.colSpan||1;for(let P=0;P<B;P++)for(let _t=0;_t<M;_t++)v+P<u&&q+_t<p&&(g[v+P][q+_t]=P===0&&_t===0?"1":"0")})}),l.forEach(m=>{const v=m.sectionRowIndex;Array.from(m.querySelectorAll("th,td")).forEach(q=>{for(let x=0;x<g[v].length;x++)if(g[v][x]==="1"){q.dataset.col=x,g[v][x]="0";break}})})},"resetColIndex"),r=i.cloneNode(!0);return s(r),e(r),n(r,"thead"),n(r,"tbody"),n(r,"tfoot"),Array.from(r.querySelectorAll("colgroup col")).forEach((a,h)=>{const l=a.getAttribute("fixed");l&&r.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach(f=>{f.setAttribute("fixed",l)})}),r}};c(Ut,"TableCompiler");let de=Ut;const qt=class qt extends HTMLElement{constructor(){super();d(this,Xt);d(this,st,null);d(this,it);A(this,"invalidate",c(()=>{var e,s;t(this,it).refresh(),(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),(s=this.querySelector("nine-table-vscrollbar"))==null||s.refresh()},"invalidate"));d(this,Kt,c(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:n})=>{const r=this.querySelector(s);if(!r)return;r.innerHTML="";const o=document.createElement("div");o.className="ng-part-header",o.appendChild(t(this,dt).call(this,t(this,st),n,"header"));const a=document.createElement("div");a.className="ng-part-body";const h=document.createElement("div");h.className="ng-scroll-content",h.style.position="relative",h.style.width="100%",h.appendChild(t(this,dt).call(this,t(this,st),n,"body"));const l=document.createElement("div");l.className="ng-virtual-spacer",l.style.width="100%",l.style.pointerEvents="none",h.appendChild(l),a.appendChild(h);const f=document.createElement("div");f.className="ng-part-footer",f.appendChild(t(this,dt).call(this,t(this,st),n,"footer")),r.appendChild(o),r.appendChild(a),r.appendChild(f)})},"#renderSplitContainers"));d(this,Zt,c(()=>{["left","right","body"].forEach(e=>{const s=this.querySelector(`.ng-container-${e}`),n=s==null?void 0:s.querySelectorAll("table");if(!s||!n||n.length===0)return;let r=0;n[0].querySelectorAll("col").forEach(o=>{const a=parseInt(o.getAttribute("width"),10);isNaN(r)||(r+=a)}),e==="body"?s.style.flex="1":(s.style.flex=`0 0 ${r}px`,s.style.width=`${r}px`)})},"#updateContainerWidths"));A(this,"generate",c(e=>{e&&(b(this,st,de.compile(e)),t(this,Kt).call(this),t(this,Zt).call(this),t(this,it).initialize(),setTimeout(()=>{var s;(s=this.querySelector("nine-table-hscrollbar"))==null||s.refresh()},0))},"generate"));d(this,dt,c((e,s,n)=>{const r=e.cloneNode(!0),o=r.querySelector("thead"),a=r.querySelector("tbody"),h=r.querySelector("tfoot");if(n==="header"){if(a&&a.remove(),h&&h.remove(),e.querySelector("tbody")){const f=document.createElement("tbody");f.className="fixed-tbody",r.appendChild(f)}}else n==="body"?(o&&o.remove(),h&&h.remove(),a&&(a.className="bindable-tbody")):n==="footer"&&(o&&o.remove(),a&&a.remove());return s==="left"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="left"&&l.remove()}):s==="right"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="right"&&l.remove()}):r.querySelectorAll("[fixed=left], [fixed=right]").forEach(l=>{l.remove()}),r},"#createSplitTable"));A(this,"getRowHeight",c(()=>t(this,it).getRowHeight(),"getRowHeight"));A(this,"scrollToX",c(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollLeft=e)},"scrollToX"));A(this,"scrollToY",c(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollTop=e)},"scrollToY"));d(this,Gt,c(()=>{t(this,Jt).call(this)},"#init"));d(this,Jt,c(()=>{const e=qt.SCROLLBAR_SIZE;this.innerHTML=`
|
|
126
|
+
`;const e=c(()=>{const s=t(this,Y).shadowRoot.querySelector(".ng-container-body .ng-part-body");if(!s){setTimeout(e,10);return}b(this,T,{container:s,track:this.querySelector(".ng-scroll-track"),thumb:this.querySelector(".ng-scroll-thumb"),top:this.querySelector(".ng-scroll-top"),bottom:this.querySelector(".ng-scroll-bottom")}),t(this,Bt).call(this),this.refresh()},"initWhenReady");e()}};Y=new WeakMap,lt=new WeakMap,tt=new WeakMap,T=new WeakMap,xt=new WeakMap,vt=new WeakMap,Bt=new WeakMap,c(Re,"NineTableVScrollBar");let mt=Re;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",mt);const qe=class qe{constructor(i){d(this,j);d(this,R);d(this,D,new Map);d(this,I,null);d(this,U,null);d(this,et,0);d(this,wt,40);d(this,ct,!1);d(this,zt,3);A(this,"refresh",c(()=>{var e;const i=t(this,R).querySelector(".ng-container-body .ng-part-body");i&&(t(this,St).call(this),t(this,ht).call(this,i.scrollTop),(e=t(this,R).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));A(this,"initialize",c(()=>{b(this,I,null),t(this,D).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const r=t(this,R).querySelector(n);if(!r)return;const o=r.querySelector(".ng-part-body table");if(!o)return;const a=o.querySelector("tbody.bindable-tbody");if(!a)return;const l=Array.from(a.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,D).set(n,l)});const i=t(this,R).querySelector(".ng-container-body .ng-part-body"),e=t(this,R).querySelector(".ng-container-left .ng-part-body"),s=t(this,R).querySelector(".ng-container-right .ng-part-body");if(i){t(this,Pt).call(this,i),t(this,At).call(this),t(this,St).call(this),t(this,ht).call(this,i.scrollTop);let n=!1;const r=c((o,a)=>{var h;n||(n=!0,i&&i.scrollTop!==o&&(i.scrollTop=o),e&&e.scrollTop!==o&&(e.scrollTop=o),s&&s.scrollTop!==o&&(s.scrollTop=o),t(this,ht).call(this,o),(h=t(this,R).querySelector("nine-table-vscrollbar"))==null||h.refresh(),n=!1)},"syncScroll");[i,e,s].forEach(o=>{o&&o.addEventListener("scroll",()=>{r(o.scrollTop)})})}},"initialize"));d(this,Dt,c((i,e)=>{const s=t(this,D).get(e);if(!s||s.length===0)return;const n=i.querySelector(".ng-part-body tbody.bindable-tbody");if(!n)return;n.querySelectorAll("tr:not(.nodata)").forEach(a=>a.remove());const r=n.querySelector("tr.nodata"),o=document.createDocumentFragment();for(let a=0;a<t(this,wt);a++)s.forEach(h=>{o.appendChild(h.cloneNode(!0))});r?r.before(o):n.appendChild(o)},"#renderRows"));d(this,Pt,c(i=>{if(t(this,I)!==null&&t(this,I)>0)return t(this,I);const e=t(this,D).get(".ng-container-body");if(!e||e.length===0)return 24;const s=i.querySelector("tbody.bindable-tbody");if(!s)return 24;s.querySelectorAll("tr:not(.nodata)").forEach(p=>p.remove());const n=s.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(p=>{r.appendChild(p.cloneNode(!0))}),n?n.before(r):s.appendChild(r);const o=t(this,R),a=o.style.display,h=o.style.visibility,l=o.style.position;(a==="none"||window.getComputedStyle(o).display==="none")&&(o.style.display="block",o.style.visibility="hidden",o.style.position="absolute");let f=0;const u=s.querySelectorAll("tr:not(.nodata)");return u.forEach(p=>{f+=p.offsetHeight||p.getBoundingClientRect().height}),u.forEach(p=>p.remove()),o.style.display=a,o.style.visibility=h,o.style.position=l,b(this,I,f>0?f:24),t(this,Et).call(this),t(this,I)},"#measureAndCacheHeight"));d(this,St,c(()=>{const e=(t(this,j).data.get()||[]).length,s=t(this,I)||24,n=e*s;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const o=t(this,R).querySelector(r);if(!o)return;const a=o.querySelector(".ng-part-body .ng-virtual-spacer");a&&(a.style.height=`${n}px`)})},"#updateVirtualScrollHeight"));d(this,Et,c(()=>{if(t(this,et)>0&&t(this,I)>0){const i=Math.ceil(t(this,et)/t(this,I));b(this,wt,i+t(this,zt))}},"#updateRowCount"));d(this,jt,c(()=>{var a,h,l,f,u,p;const i=t(this,R).querySelector(".ng-container-left .ng-part-body table"),e=t(this,R).querySelector(".ng-container-body .ng-part-body table"),s=t(this,R).querySelector(".ng-container-right .ng-part-body table");if(e){const g=i?Array.from(i.querySelectorAll("tbody tr")):[],m=Array.from(e.querySelectorAll("tbody tr")),v=s?Array.from(s.querySelectorAll("tbody tr")):[],q=Math.max(g.length,m.length,v.length);for(let x=0;x<q;x++){const B=[((a=g[x])==null?void 0:a.getBoundingClientRect().height)||0,((h=m[x])==null?void 0:h.getBoundingClientRect().height)||0,((l=v[x])==null?void 0:l.getBoundingClientRect().height)||0],M=Math.max(...B);M>0&&(g[x]&&(g[x].style.height=`${M}px`),m[x]&&(m[x].style.height=`${M}px`),v[x]&&(v[x].style.height=`${M}px`))}}const n=t(this,R).querySelector(".ng-container-left .ng-part-footer table"),r=t(this,R).querySelector(".ng-container-body .ng-part-footer table"),o=t(this,R).querySelector(".ng-container-right .ng-part-footer table");if(r){const g=n?Array.from(n.querySelectorAll("tfoot tr")):[],m=Array.from(r.querySelectorAll("tfoot tr")),v=o?Array.from(o.querySelectorAll("tfoot tr")):[],q=Math.max(g.length,m.length,v.length);for(let x=0;x<q;x++){const B=[((f=g[x])==null?void 0:f.getBoundingClientRect().height)||0,((u=m[x])==null?void 0:u.getBoundingClientRect().height)||0,((p=v[x])==null?void 0:p.getBoundingClientRect().height)||0],M=Math.max(...B);M>0&&(g[x]&&(g[x].style.height=`${M}px`),m[x]&&(m[x].style.height=`${M}px`),v[x]&&(v[x].style.height=`${M}px`))}}},"#syncRowHeights"));d(this,Ft,c(()=>{!t(this,R)||!(t(this,R)instanceof HTMLElement)||(b(this,U,new ResizeObserver(i=>{for(const e of i){const s=e.target;if(!s.classList.contains("active"))continue;const n=e.contentRect.height;if(n>0){let r=0;const o=s.querySelector(".ng-part-header"),a=s.querySelector(".ng-part-footer");o&&(r+=o.offsetHeight),a&&(r+=a.offsetHeight);const h=Math.max(n-r,100);t(this,et)!==h&&(b(this,et,h),t(this,Et).call(this),t(this,I)!==null&&t(this,At).call(this))}}})),t(this,U).observe(t(this,R)))},"#initResizeObserver"));d(this,At,c(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(i=>{const e=t(this,R).querySelector(i);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,Dt).call(this,e,i)}),t(this,Yt).call(this),t(this,jt).call(this)},"#renderAllContainers"));d(this,Vt,c(i=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var l;const s=t(this,R).querySelector(e);if(!s)return;const n=s.querySelector(".ng-part-body tbody.bindable-tbody");if(!n)return;const r=Array.from(n.querySelectorAll("tr:not(.nodata)")),o=((l=t(this,D).get(e))==null?void 0:l.length)||1,h=(t(this,j).data.get()||[]).length;r.forEach((f,u)=>{const p=i+Math.floor(u/o);if(p>=h){f.style.display="none";return}const g=t(this,j).data.get(p);f.style.display="",t(this,Rt).call(this,f,g,p)})})},"#adjustBufferRows"));d(this,ht,c(i=>{var h;const e=t(this,I);if(!e||e<=0)return;const n=(t(this,j).data.get()||[]).length,r=Math.max(0,Math.floor(i/e)),o=r*e,a=((h=t(this,D).get(".ng-container-body"))==null?void 0:h.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(l=>{const f=t(this,R).querySelector(l);if(!f)return;const u=f.querySelector(".ng-part-body tbody.bindable-tbody");if(!u)return;u.style.transform=`translateY(${o}px)`,Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((g,m)=>{const v=r+Math.floor(m/a);if(v>=n){g.style.display="none";return}const q=t(this,j).data.get(v);g.style.display="",t(this,Rt).call(this,g,q,v)})}),t(this,ct)||(b(this,ct,!0),setTimeout(()=>{t(this,Vt).call(this,r),b(this,ct,!1)},0))},"#handleScroll"));d(this,Rt,c((i,e,s)=>{i.dataset.row=s,i.data=e,k.log(s),Array.from(i.cells).forEach((n,r)=>{n.dataset.row=s,n.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');const o=Array.from(n.children).find(a=>a.tagName.toLowerCase().startsWith("cell-")||typeof a.refresh=="function");o&&typeof o.refresh=="function"&&o.refresh()})},"#bindRowData"));d(this,Yt,c(()=>{var h,l,f;const i=t(this,R).querySelector(".ng-container-left .ng-part-header table"),e=t(this,R).querySelector(".ng-container-body .ng-part-header table"),s=t(this,R).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const n=i?Array.from(i.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),o=s?Array.from(s.querySelectorAll("tr")):[],a=Math.max(n.length,r.length,o.length);for(let u=0;u<a;u++){const p=[((h=n[u])==null?void 0:h.getBoundingClientRect().height)||0,((l=r[u])==null?void 0:l.getBoundingClientRect().height)||0,((f=o[u])==null?void 0:f.getBoundingClientRect().height)||0],g=Math.max(...p);g>0&&(n[u]&&(n[u].style.height=`${g}px`),r[u]&&(r[u].style.height=`${g}px`),o[u]&&(o[u].style.height=`${g}px`))}},"#syncHeaderHeights"));A(this,"destroy",c(()=>{t(this,U)&&(t(this,U).disconnect(),b(this,U,null))},"destroy"));b(this,j,i.getRootNode().host),b(this,R,i),t(this,Ft).call(this)}getRowHeight(){return t(this,I)}templateLength(i=".ng-container-body"){var e;return((e=t(this,D).get(i))==null?void 0:e.length)||1}};j=new WeakMap,R=new WeakMap,D=new WeakMap,I=new WeakMap,U=new WeakMap,et=new WeakMap,wt=new WeakMap,ct=new WeakMap,zt=new WeakMap,Dt=new WeakMap,Pt=new WeakMap,St=new WeakMap,Et=new WeakMap,jt=new WeakMap,Ft=new WeakMap,At=new WeakMap,Vt=new WeakMap,ht=new WeakMap,Rt=new WeakMap,Yt=new WeakMap,c(qe,"RowManager");let he=qe;const Ut=class Ut{static compileAll(i){return Array.isArray(i)?i.map(e=>Ut.compile(e)):[]}static compile(i){if(!i)return null;const e=c(a=>{a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach(l=>{const f=l.getAttribute("cell-type")||"renderer";if(l.children.length>0&&l.firstElementChild.tagName.includes("-"))return;let u=`cell-${f}`;const p=l.getAttribute("data-bind"),g=l.getAttribute("data-expr"),m=l.getAttribute("maxbyte"),v=l.getAttribute("type");let q=[];p&&q.push(`data-bind="${p}"`),g&&q.push(`data-expr="${g}"`),m&&q.push(`maxbyte="${m}"`),v&&q.push(`type="${v}"`),l.innerHTML=`<${u} ${q.join(" ")}></${u}>`})},"processCellTypes"),s=c(a=>{if(!a.querySelector("colgroup")){const h=a.querySelector("tbody tr")||a.querySelector("tr"),l=h?h.querySelectorAll("th, td").length:1,f=document.createElement("colgroup"),u=Math.max(Math.floor(a.clientWidth/l),100);for(let p=0;p<l;p++){const g=document.createElement("col");g.setAttribute("width",u),f.appendChild(g)}a.prepend(f)}if(!a.querySelector("thead")){const h=document.createElement("thead"),l=a.querySelector("colgroup");l?l.after(h):a.prepend(h)}a.classList.add("nine-table-element"),a.style.display="table"},"ensureTableStructure"),n=c((a,h)=>{const l=Array.from(a.querySelectorAll(h+" tr")),f=Array.from(a.querySelectorAll(h+" th,"+h+" td")),u=l.length;if(u===0||f.length===0)return;let p=0;f.forEach(m=>{p+=m.colSpan||1});const g=Array.from(Array(u),()=>Array(p).fill(null));l.forEach(m=>{const v=m.sectionRowIndex;let q=0;Array.from(m.querySelectorAll("th,td")).forEach(x=>{for(let P=0;P<g[v].length;P++)if(g[v][P]===null){q=P;break}const B=x.rowSpan||1,M=x.colSpan||1;for(let P=0;P<B;P++)for(let _t=0;_t<M;_t++)v+P<u&&q+_t<p&&(g[v+P][q+_t]=P===0&&_t===0?"1":"0")})}),l.forEach(m=>{const v=m.sectionRowIndex;Array.from(m.querySelectorAll("th,td")).forEach(q=>{for(let x=0;x<g[v].length;x++)if(g[v][x]==="1"){q.dataset.col=x,g[v][x]="0";break}})})},"resetColIndex"),r=i.cloneNode(!0);return s(r),e(r),n(r,"thead"),n(r,"tbody"),n(r,"tfoot"),Array.from(r.querySelectorAll("colgroup col")).forEach((a,h)=>{const l=a.getAttribute("fixed");l&&r.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach(f=>{f.setAttribute("fixed",l)})}),r}};c(Ut,"TableCompiler");let de=Ut;const qt=class qt extends HTMLElement{constructor(){super();d(this,Xt);d(this,st,null);d(this,it);A(this,"invalidate",c(()=>{var e,s;t(this,it).refresh(),(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),(s=this.querySelector("nine-table-vscrollbar"))==null||s.refresh()},"invalidate"));d(this,Kt,c(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:n})=>{const r=this.querySelector(s);if(!r)return;r.innerHTML="";const o=document.createElement("div");o.className="ng-part-header",o.appendChild(t(this,dt).call(this,t(this,st),n,"header"));const a=document.createElement("div");a.className="ng-part-body";const h=document.createElement("div");h.className="ng-scroll-content",h.style.position="relative",h.style.width="100%",h.appendChild(t(this,dt).call(this,t(this,st),n,"body"));const l=document.createElement("div");l.className="ng-virtual-spacer",l.style.width="100%",l.style.pointerEvents="none",h.appendChild(l),a.appendChild(h);const f=document.createElement("div");f.className="ng-part-footer",f.appendChild(t(this,dt).call(this,t(this,st),n,"footer")),r.appendChild(o),r.appendChild(a),r.appendChild(f)})},"#renderSplitContainers"));d(this,Zt,c(()=>{["left","right","body"].forEach(e=>{const s=this.querySelector(`.ng-container-${e}`),n=s==null?void 0:s.querySelectorAll("table");if(!s||!n||n.length===0)return;let r=0;n[0].querySelectorAll("col").forEach(o=>{const a=parseInt(o.getAttribute("width"),10);isNaN(r)||(r+=a)}),e==="body"?s.style.flex="1":(s.style.flex=`0 0 ${r}px`,s.style.width=`${r}px`)})},"#updateContainerWidths"));A(this,"generate",c(e=>{e&&(b(this,st,de.compile(e)),t(this,Kt).call(this),t(this,Zt).call(this),t(this,it).initialize(),setTimeout(()=>{var s;(s=this.querySelector("nine-table-hscrollbar"))==null||s.refresh()},0))},"generate"));d(this,dt,c((e,s,n)=>{const r=e.cloneNode(!0),o=r.querySelector("thead"),a=r.querySelector("tbody"),h=r.querySelector("tfoot");if(n==="header"){if(a&&a.remove(),h&&h.remove(),e.querySelector("tbody")){const f=document.createElement("tbody");f.className="fixed-tbody",r.appendChild(f)}}else n==="body"?(o&&o.remove(),h&&h.remove(),a&&(a.className="bindable-tbody")):n==="footer"&&(o&&o.remove(),a&&a.remove());return s==="left"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="left"&&l.remove()}):s==="right"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="right"&&l.remove()}):r.querySelectorAll("[fixed=left], [fixed=right]").forEach(l=>{l.remove()}),r},"#createSplitTable"));A(this,"getRowHeight",c(()=>t(this,it).getRowHeight(),"getRowHeight"));A(this,"scrollToX",c(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollLeft=e)},"scrollToX"));A(this,"scrollToY",c(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollTop=e)},"scrollToY"));d(this,Gt,c(()=>{t(this,Jt).call(this)},"#init"));d(this,Jt,c(()=>{const e=qt.SCROLLBAR_SIZE;this.innerHTML=`
|
|
127
127
|
<style>
|
|
128
128
|
nine-table-sheet {
|
|
129
129
|
display: none;
|