@ninebone/table 0.0.361 → 0.0.363

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.
@@ -122,7 +122,7 @@
122
122
  <button class='ng-scroll-top' disabled><div class='ng-scroll-icon'></div></button>
123
123
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
124
124
  <button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
125
- `;const e=a(()=>{const i=t(this,j).querySelector(".ng-container-body");if(!i){setTimeout(e,10);return}b(this,E,{container:i,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,Rt).call(this),this.refresh()},"initWhenReady");e()}};j=new WeakMap,N=new WeakMap,E=new WeakMap,at=new WeakMap,ct=new WeakMap,Rt=new WeakMap,a(re,"NineTableVScrollBar");let lt=re;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",lt);const I=class I{static compileAll(s){return Array.isArray(s)?s.map(e=>I.compile(e)):[]}static compile(s){var o,r,n,l;if(!s)return null;const e=s.cloneNode(!0);return t(o=I,At).call(o,e),t(r=I,Q).call(r,e,"thead"),t(n=I,Q).call(n,e,"tbody"),t(l=I,Q).call(l,e,"tfoot"),Array.from(e.querySelectorAll("colgroup col")).forEach((h,d)=>{const f=h.getAttribute("fixed");f&&e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach(u=>{u.setAttribute("fixed",f)})}),e}};At=new WeakMap,Q=new WeakMap,a(I,"TableCompiler"),c(I,At,a(s=>{if(!s.querySelector("colgroup")){const e=s.querySelector("tbody tr")||s.querySelector("tr"),i=e?e.querySelectorAll("th, td").length:1,o=document.createElement("colgroup"),r=Math.max(Math.floor(s.clientWidth/i),100);for(let n=0;n<i;n++){const l=document.createElement("col");l.setAttribute("width",r),o.appendChild(l)}s.prepend(o)}if(!s.querySelector("thead")){const e=document.createElement("thead"),i=s.querySelector("colgroup");i?i.after(e):s.prepend(e)}s.classList.add("nine-table-element"),s.style.display="table"},"#ensureTableStructure")),c(I,Q,a((s,e)=>{const i=Array.from(s.querySelectorAll(e+" tr")),o=Array.from(s.querySelectorAll(e+" th,"+e+" td")),r=i.length;if(r===0||o.length===0)return;let n=0;o.forEach(h=>{n+=h.colSpan||1});const l=Array.from(Array(r),()=>Array(n).fill(null));i.forEach(h=>{const d=h.sectionRowIndex;let f=0;Array.from(h.querySelectorAll("th,td")).forEach(u=>{for(let q=0;q<l[d].length;q++)if(l[d][q]===null){f=q;break}const g=u.rowSpan||1,x=u.colSpan||1;for(let q=0;q<g;q++)for(let _=0;_<x;_++)d+q<r&&f+_<n&&(l[d+q][f+_]=q===0&&_===0?"1":"0")})}),i.forEach(h=>{const d=h.sectionRowIndex;Array.from(h.querySelectorAll("th,td")).forEach(f=>{for(let u=0;u<l[d].length;u++)if(l[d][u]==="1"){f.dataset.col=u,l[d][u]="0";break}})})},"#resetColIndex"));let Kt=I;const le=class le{constructor(s){c(this,B);c(this,S);c(this,W,new Map);c(this,T,null);c(this,D,null);c(this,F,0);c(this,ht,40);c(this,tt,!1);c(this,qt,20);w(this,"refresh",a(()=>{var e;const s=t(this,S).querySelector(".ng-container-body");s&&(t(this,dt).call(this),t(this,et).call(this,s.scrollTop),(e=t(this,S).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));w(this,"initialize",a(()=>{b(this,T,null),t(this,W).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(o=>{const r=t(this,S).querySelector(o);if(!r)return;const n=r.querySelector("table");if(!n)return;const l=n.querySelector("tbody.bindable-tbody");if(!l)return;const d=Array.from(l.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,W).set(o,d)});const s=t(this,S).querySelector(".ng-container-body"),e=t(this,S).querySelector(".ng-container-left"),i=t(this,S).querySelector(".ng-container-right");if(s){t(this,kt).call(this,s),t(this,ut).call(this),t(this,dt).call(this),t(this,et).call(this,s.scrollTop);let o=s.scrollTop;const r=a(n=>{var l;e&&e.scrollTop!==n&&(e.scrollTop=n),i&&i.scrollTop!==n&&(i.scrollTop=n),t(this,et).call(this,n),(l=t(this,S).querySelector("nine-table-vscrollbar"))==null||l.refresh()},"syncScroll");s.addEventListener("scroll",()=>{const n=s.scrollTop;o!==n&&(o=n,r(n))})}},"initialize"));c(this,Tt,a((s,e)=>{const i=t(this,W).get(e);if(!i||i.length===0)return;const o=s.querySelector("tbody.bindable-tbody");if(!o)return;o.querySelectorAll("tr:not(.nodata)").forEach(l=>l.remove());const r=o.querySelector("tr.nodata"),n=document.createDocumentFragment();for(let l=0;l<t(this,ht);l++)i.forEach(h=>{n.appendChild(h.cloneNode(!0))});r?r.before(n):o.appendChild(n)},"#renderRows"));c(this,kt,a(s=>{if(t(this,T)!==null&&t(this,T)>0)return t(this,T);const e=t(this,W).get(".ng-container-body");if(!e||e.length===0)return 24;const i=s.querySelector("tbody.bindable-tbody")||s.querySelector("tbody.bindable-tbody:last-of-type");if(!i)return 24;i.querySelectorAll("tr:not(.nodata)").forEach(g=>g.remove());const o=i.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(g=>{r.appendChild(g.cloneNode(!0))}),o?o.before(r):i.appendChild(r);const n=t(this,S),l=n.style.display,h=n.style.visibility,d=n.style.position;(l==="none"||window.getComputedStyle(n).display==="none")&&(n.style.display="block",n.style.visibility="hidden",n.style.position="absolute");let f=0;const u=i.querySelectorAll("tr:not(.nodata)");return u.forEach(g=>{f+=g.offsetHeight||g.getBoundingClientRect().height}),u.forEach(g=>g.remove()),n.style.display=l,n.style.visibility=h,n.style.position=d,b(this,T,f>0?f:24),t(this,ft).call(this),t(this,T)},"#measureAndCacheHeight"));c(this,dt,a(()=>{if(!t(this,S).querySelector(".ng-container-body"))return;const e=t(this,B).data.get()||[],i=e.length>0?e.length:100,o=t(this,T),r=i*o;v.log(":",i,r),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const l=t(this,S).querySelector(n),h=l==null?void 0:l.querySelector("table");h&&(h.style.height=`${r}px`)})},"#updateVirtualScrollHeight"));c(this,ft,a(()=>{const s=t(this,B).data.get()||[],e=s.length>0?s.length:100;if(t(this,F)>0&&t(this,T)>0){const i=Math.ceil(t(this,F)/t(this,T));b(this,ht,Math.min(e,i+t(this,qt)))}},"#updateRowCount"));c(this,Lt,a(()=>{var h,d,f;const s=t(this,S).querySelector(".ng-container-left table"),e=t(this,S).querySelector(".ng-container-body table"),i=t(this,S).querySelector(".ng-container-right table");if(!e)return;const o=s?Array.from(s.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),n=i?Array.from(i.querySelectorAll("tr")):[],l=Math.max(o.length,r.length,n.length);for(let u=0;u<l;u++){const g=[((h=o[u])==null?void 0:h.getBoundingClientRect().height)||0,((d=r[u])==null?void 0:d.getBoundingClientRect().height)||0,((f=n[u])==null?void 0:f.getBoundingClientRect().height)||0],x=Math.max(...g);x>0&&(o[u]&&(o[u].style.height=`${x}px`),r[u]&&(r[u].style.height=`${x}px`),n[u]&&(n[u].style.height=`${x}px`))}},"#syncRowHeights"));c(this,Ht,a(()=>{!t(this,S)||!(t(this,S)instanceof HTMLElement)||(b(this,D,new ResizeObserver(s=>{for(const e of s){const i=e.target;if(!i.classList.contains("active"))continue;const o=e.contentRect.height;if(o>0){let r=0;const n=i.querySelector("thead");n&&(r+=n.offsetHeight||n.getBoundingClientRect().height);const l=Math.max(o-r,100);t(this,F)!==l&&(b(this,F,l),t(this,ft).call(this),t(this,T)!==null&&t(this,ut).call(this))}}})),t(this,D).observe(t(this,S)))},"#initResizeObserver"));c(this,ut,a(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(s=>{const e=t(this,S).querySelector(s);e&&e.querySelector("tbody.bindable-tbody")&&t(this,Tt).call(this,e,s)}),t(this,Lt).call(this)},"#renderAllContainers"));c(this,Ct,a(s=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var l;const i=t(this,S).querySelector(e);if(!i)return;const o=i.querySelector("tbody.bindable-tbody");if(!o)return;const r=Array.from(o.querySelectorAll("tr:not(.nodata)")),n=((l=t(this,W).get(e))==null?void 0:l.length)||1;r.forEach((h,d)=>{const f=s+Math.floor(d/n),u=t(this,B).data.get(f);h.style.display="",t(this,bt).call(this,h,u,f)})})},"#adjustBufferRows"));c(this,et,a(s=>{var r;const e=t(this,T);if(!e||e<=0)return;const i=Math.max(0,Math.floor(s/e)),o=((r=t(this,W).get(".ng-container-body"))==null?void 0:r.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const l=t(this,S).querySelector(n);if(!l)return;const h=l.querySelector("tbody.bindable-tbody");if(!h)return;Array.from(h.querySelectorAll("tr:not(.nodata)")).forEach((f,u)=>{const g=i+Math.floor(u/o),x=t(this,B).data.get(g);f.style.display="",t(this,bt).call(this,f,x,g)})}),t(this,tt)||(b(this,tt,!0),setTimeout(()=>{t(this,Ct).call(this,i),b(this,tt,!1)},0))},"#handleScroll"));c(this,bt,a((s,e,i)=>{s.dataset.row=i,Array.from(s.cells).forEach((o,r)=>{const n=o.dataset.bind;n&&e&&e[n]!==void 0?o.textContent=e[n]:o.textContent=e?e[Object.keys(e)[r]]??`R${i}C${r}`:`행 ${i+1}`,o.dataset.row=i})},"#bindRowData"));w(this,"destroy",a(()=>{t(this,D)&&(t(this,D).disconnect(),b(this,D,null))},"destroy"));b(this,B,s.getRootNode().host),b(this,S,s),t(this,Ht).call(this)}getRowHeight(){return t(this,T)}templateLength(s=".ng-container-body"){var e;return((e=t(this,W).get(s))==null?void 0:e.length)||1}};B=new WeakMap,S=new WeakMap,W=new WeakMap,T=new WeakMap,D=new WeakMap,F=new WeakMap,ht=new WeakMap,tt=new WeakMap,qt=new WeakMap,Tt=new WeakMap,kt=new WeakMap,dt=new WeakMap,ft=new WeakMap,Lt=new WeakMap,Ht=new WeakMap,ut=new WeakMap,Ct=new WeakMap,et=new WeakMap,bt=new WeakMap,a(le,"RowManager");let Zt=le;const gt=class gt extends HTMLElement{constructor(){super();c(this,_t);c(this,it,null);c(this,K);w(this,"invalidate",a(()=>{t(this,K).refresh()},"invalidate"));c(this,Mt,a(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:i,type:o})=>{const r=this.querySelector(i);if(!r)return;const n=t(this,$t).call(this,t(this,it),o);r.innerHTML="",r.appendChild(n)})},"#renderSplitContainers"));c(this,It,a(()=>{["left","right"].forEach(e=>{const i=this.querySelector(`.ng-container-${e}`),o=i==null?void 0:i.querySelector("table");if(!i||!o)return;let r=0;o.querySelectorAll("col").forEach(n=>{const l=parseInt(n.getAttribute("width"),10);isNaN(r)||(r+=l)}),i.style.flex=`0 0 ${r}px`,i.style.width=`${r}px`})},"#updateContainerWidths"));w(this,"generate",a(e=>{e&&(b(this,it,Kt.compile(e)),t(this,it).style.display="table",t(this,Mt).call(this),t(this,It).call(this),requestAnimationFrame(()=>{var o;const i=(o=this.querySelector("thead"))==null?void 0:o.getBoundingClientRect().height;this.querySelectorAll("tbody.fixed-tbody").forEach(r=>{r.style.top=`${i}px`})}),t(this,K).initialize(),setTimeout(()=>{var i;(i=this.querySelector("nine-table-hscrollbar"))==null||i.refresh()},0))},"generate"));c(this,$t,a((e,i)=>{const o=e.cloneNode(!0),r=o.querySelector("tbody");if(r){const n=document.createElement("tbody");n.className="fixed-tbody",r.className="bindable-tbody",r.before(n)}return i==="left"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(n=>{n.getAttribute("fixed")!=="left"&&n.remove()}):i==="right"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(n=>{n.getAttribute("fixed")!=="right"&&n.remove()}):o.querySelectorAll("[fixed=left], [fixed=right]").forEach(n=>{n.remove()}),o},"#createSplitTable"));w(this,"getRowHeight",a(()=>t(this,K).getRowHeight(),"getRowHeight"));w(this,"scrollToX",a(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollLeft=e)},"scrollToX"));w(this,"scrollToY",a(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollTop=e)},"scrollToY"));c(this,Wt,a(()=>{t(this,Ot).call(this)},"#init"));c(this,Ot,a(()=>{const e=gt.SCROLLBAR_SIZE;this.innerHTML=`
125
+ `;const e=a(()=>{const i=t(this,j).querySelector(".ng-container-body");if(!i){setTimeout(e,10);return}b(this,E,{container:i,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,Rt).call(this),this.refresh()},"initWhenReady");e()}};j=new WeakMap,N=new WeakMap,E=new WeakMap,at=new WeakMap,ct=new WeakMap,Rt=new WeakMap,a(re,"NineTableVScrollBar");let lt=re;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",lt);const I=class I{static compileAll(s){return Array.isArray(s)?s.map(e=>I.compile(e)):[]}static compile(s){var o,r,n,l;if(!s)return null;const e=s.cloneNode(!0);return t(o=I,At).call(o,e),t(r=I,Q).call(r,e,"thead"),t(n=I,Q).call(n,e,"tbody"),t(l=I,Q).call(l,e,"tfoot"),Array.from(e.querySelectorAll("colgroup col")).forEach((h,d)=>{const f=h.getAttribute("fixed");f&&e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach(u=>{u.setAttribute("fixed",f)})}),e}};At=new WeakMap,Q=new WeakMap,a(I,"TableCompiler"),c(I,At,a(s=>{if(!s.querySelector("colgroup")){const e=s.querySelector("tbody tr")||s.querySelector("tr"),i=e?e.querySelectorAll("th, td").length:1,o=document.createElement("colgroup"),r=Math.max(Math.floor(s.clientWidth/i),100);for(let n=0;n<i;n++){const l=document.createElement("col");l.setAttribute("width",r),o.appendChild(l)}s.prepend(o)}if(!s.querySelector("thead")){const e=document.createElement("thead"),i=s.querySelector("colgroup");i?i.after(e):s.prepend(e)}s.classList.add("nine-table-element"),s.style.display="table"},"#ensureTableStructure")),c(I,Q,a((s,e)=>{const i=Array.from(s.querySelectorAll(e+" tr")),o=Array.from(s.querySelectorAll(e+" th,"+e+" td")),r=i.length;if(r===0||o.length===0)return;let n=0;o.forEach(h=>{n+=h.colSpan||1});const l=Array.from(Array(r),()=>Array(n).fill(null));i.forEach(h=>{const d=h.sectionRowIndex;let f=0;Array.from(h.querySelectorAll("th,td")).forEach(u=>{for(let q=0;q<l[d].length;q++)if(l[d][q]===null){f=q;break}const g=u.rowSpan||1,x=u.colSpan||1;for(let q=0;q<g;q++)for(let _=0;_<x;_++)d+q<r&&f+_<n&&(l[d+q][f+_]=q===0&&_===0?"1":"0")})}),i.forEach(h=>{const d=h.sectionRowIndex;Array.from(h.querySelectorAll("th,td")).forEach(f=>{for(let u=0;u<l[d].length;u++)if(l[d][u]==="1"){f.dataset.col=u,l[d][u]="0";break}})})},"#resetColIndex"));let Kt=I;const le=class le{constructor(s){c(this,B);c(this,S);c(this,W,new Map);c(this,T,null);c(this,D,null);c(this,F,0);c(this,ht,40);c(this,tt,!1);c(this,qt,3);w(this,"refresh",a(()=>{var e;const s=t(this,S).querySelector(".ng-container-body");s&&(t(this,dt).call(this),t(this,et).call(this,s.scrollTop),(e=t(this,S).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));w(this,"initialize",a(()=>{b(this,T,null),t(this,W).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(o=>{const r=t(this,S).querySelector(o);if(!r)return;const n=r.querySelector("table");if(!n)return;const l=n.querySelector("tbody.bindable-tbody");if(!l)return;const d=Array.from(l.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,W).set(o,d)});const s=t(this,S).querySelector(".ng-container-body"),e=t(this,S).querySelector(".ng-container-left"),i=t(this,S).querySelector(".ng-container-right");if(s){t(this,kt).call(this,s),t(this,ut).call(this),t(this,dt).call(this),t(this,et).call(this,s.scrollTop);let o=s.scrollTop;const r=a(n=>{var l;e&&e.scrollTop!==n&&(e.scrollTop=n),i&&i.scrollTop!==n&&(i.scrollTop=n),t(this,et).call(this,n),(l=t(this,S).querySelector("nine-table-vscrollbar"))==null||l.refresh()},"syncScroll");s.addEventListener("scroll",()=>{const n=s.scrollTop;o!==n&&(o=n,r(n))})}},"initialize"));c(this,Tt,a((s,e)=>{const i=t(this,W).get(e);if(!i||i.length===0)return;const o=s.querySelector("tbody.bindable-tbody");if(!o)return;o.querySelectorAll("tr:not(.nodata)").forEach(l=>l.remove());const r=o.querySelector("tr.nodata"),n=document.createDocumentFragment();for(let l=0;l<t(this,ht);l++)i.forEach(h=>{n.appendChild(h.cloneNode(!0))});r?r.before(n):o.appendChild(n)},"#renderRows"));c(this,kt,a(s=>{if(t(this,T)!==null&&t(this,T)>0)return t(this,T);const e=t(this,W).get(".ng-container-body");if(!e||e.length===0)return 24;const i=s.querySelector("tbody.bindable-tbody")||s.querySelector("tbody.bindable-tbody:last-of-type");if(!i)return 24;i.querySelectorAll("tr:not(.nodata)").forEach(g=>g.remove());const o=i.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(g=>{r.appendChild(g.cloneNode(!0))}),o?o.before(r):i.appendChild(r);const n=t(this,S),l=n.style.display,h=n.style.visibility,d=n.style.position;(l==="none"||window.getComputedStyle(n).display==="none")&&(n.style.display="block",n.style.visibility="hidden",n.style.position="absolute");let f=0;const u=i.querySelectorAll("tr:not(.nodata)");return u.forEach(g=>{f+=g.offsetHeight||g.getBoundingClientRect().height}),u.forEach(g=>g.remove()),n.style.display=l,n.style.visibility=h,n.style.position=d,b(this,T,f>0?f:24),t(this,ft).call(this),t(this,T)},"#measureAndCacheHeight"));c(this,dt,a(()=>{if(!t(this,S).querySelector(".ng-container-body"))return;const e=t(this,B).data.get()||[],i=e.length>0?e.length:100,o=t(this,T),r=i*o;v.log(":",i,r),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const l=t(this,S).querySelector(n),h=l==null?void 0:l.querySelector("table");h&&(h.style.height=`${r}px`)})},"#updateVirtualScrollHeight"));c(this,ft,a(()=>{const s=t(this,B).data.get()||[],e=s.length>0?s.length:100;if(t(this,F)>0&&t(this,T)>0){const i=Math.ceil(t(this,F)/t(this,T));b(this,ht,Math.min(e,i+t(this,qt)))}},"#updateRowCount"));c(this,Lt,a(()=>{var h,d,f;const s=t(this,S).querySelector(".ng-container-left table"),e=t(this,S).querySelector(".ng-container-body table"),i=t(this,S).querySelector(".ng-container-right table");if(!e)return;const o=s?Array.from(s.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),n=i?Array.from(i.querySelectorAll("tr")):[],l=Math.max(o.length,r.length,n.length);for(let u=0;u<l;u++){const g=[((h=o[u])==null?void 0:h.getBoundingClientRect().height)||0,((d=r[u])==null?void 0:d.getBoundingClientRect().height)||0,((f=n[u])==null?void 0:f.getBoundingClientRect().height)||0],x=Math.max(...g);x>0&&(o[u]&&(o[u].style.height=`${x}px`),r[u]&&(r[u].style.height=`${x}px`),n[u]&&(n[u].style.height=`${x}px`))}},"#syncRowHeights"));c(this,Ht,a(()=>{!t(this,S)||!(t(this,S)instanceof HTMLElement)||(b(this,D,new ResizeObserver(s=>{for(const e of s){const i=e.target;if(!i.classList.contains("active"))continue;const o=e.contentRect.height;if(o>0){let r=0;const n=i.querySelector("thead");n&&(r+=n.offsetHeight||n.getBoundingClientRect().height);const l=Math.max(o-r,100);t(this,F)!==l&&(b(this,F,l),t(this,ft).call(this),t(this,T)!==null&&t(this,ut).call(this))}}})),t(this,D).observe(t(this,S)))},"#initResizeObserver"));c(this,ut,a(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(s=>{const e=t(this,S).querySelector(s);e&&e.querySelector("tbody.bindable-tbody")&&t(this,Tt).call(this,e,s)}),t(this,Lt).call(this)},"#renderAllContainers"));c(this,Ct,a(s=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var l;const i=t(this,S).querySelector(e);if(!i)return;const o=i.querySelector("tbody.bindable-tbody");if(!o)return;const r=Array.from(o.querySelectorAll("tr:not(.nodata)")),n=((l=t(this,W).get(e))==null?void 0:l.length)||1;r.forEach((h,d)=>{const f=s+Math.floor(d/n),u=t(this,B).data.get(f);h.style.display="",t(this,bt).call(this,h,u,f)})})},"#adjustBufferRows"));c(this,et,a(s=>{var r;const e=t(this,T);if(!e||e<=0)return;const i=Math.max(0,Math.floor(s/e)),o=((r=t(this,W).get(".ng-container-body"))==null?void 0:r.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const l=t(this,S).querySelector(n);if(!l)return;const h=l.querySelector("tbody.bindable-tbody");if(!h)return;Array.from(h.querySelectorAll("tr:not(.nodata)")).forEach((f,u)=>{const g=i+Math.floor(u/o),x=t(this,B).data.get(g);f.style.display="",t(this,bt).call(this,f,x,g)})}),t(this,tt)||(b(this,tt,!0),setTimeout(()=>{t(this,Ct).call(this,i),b(this,tt,!1)},0))},"#handleScroll"));c(this,bt,a((s,e,i)=>{s.dataset.row=i,Array.from(s.cells).forEach((o,r)=>{const n=o.dataset.bind;n&&e&&e[n]!==void 0?o.textContent=e[n]:o.textContent=e?e[Object.keys(e)[r]]??`R${i}C${r}`:`행 ${i+1}`,o.dataset.row=i})},"#bindRowData"));w(this,"destroy",a(()=>{t(this,D)&&(t(this,D).disconnect(),b(this,D,null))},"destroy"));b(this,B,s.getRootNode().host),b(this,S,s),t(this,Ht).call(this)}getRowHeight(){return t(this,T)}templateLength(s=".ng-container-body"){var e;return((e=t(this,W).get(s))==null?void 0:e.length)||1}};B=new WeakMap,S=new WeakMap,W=new WeakMap,T=new WeakMap,D=new WeakMap,F=new WeakMap,ht=new WeakMap,tt=new WeakMap,qt=new WeakMap,Tt=new WeakMap,kt=new WeakMap,dt=new WeakMap,ft=new WeakMap,Lt=new WeakMap,Ht=new WeakMap,ut=new WeakMap,Ct=new WeakMap,et=new WeakMap,bt=new WeakMap,a(le,"RowManager");let Zt=le;const gt=class gt extends HTMLElement{constructor(){super();c(this,_t);c(this,it,null);c(this,K);w(this,"invalidate",a(()=>{t(this,K).refresh()},"invalidate"));c(this,Mt,a(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:i,type:o})=>{const r=this.querySelector(i);if(!r)return;const n=t(this,$t).call(this,t(this,it),o);r.innerHTML="",r.appendChild(n)})},"#renderSplitContainers"));c(this,It,a(()=>{["left","right"].forEach(e=>{const i=this.querySelector(`.ng-container-${e}`),o=i==null?void 0:i.querySelector("table");if(!i||!o)return;let r=0;o.querySelectorAll("col").forEach(n=>{const l=parseInt(n.getAttribute("width"),10);isNaN(r)||(r+=l)}),i.style.flex=`0 0 ${r}px`,i.style.width=`${r}px`})},"#updateContainerWidths"));w(this,"generate",a(e=>{e&&(b(this,it,Kt.compile(e)),t(this,it).style.display="table",t(this,Mt).call(this),t(this,It).call(this),requestAnimationFrame(()=>{var o;const i=(o=this.querySelector("thead"))==null?void 0:o.getBoundingClientRect().height;this.querySelectorAll("tbody.fixed-tbody").forEach(r=>{r.style.top=`${i}px`})}),t(this,K).initialize(),setTimeout(()=>{var i;(i=this.querySelector("nine-table-hscrollbar"))==null||i.refresh()},0))},"generate"));c(this,$t,a((e,i)=>{const o=e.cloneNode(!0),r=o.querySelector("tbody");if(r){const n=document.createElement("tbody");n.className="fixed-tbody",r.className="bindable-tbody",r.before(n)}return i==="left"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(n=>{n.getAttribute("fixed")!=="left"&&n.remove()}):i==="right"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(n=>{n.getAttribute("fixed")!=="right"&&n.remove()}):o.querySelectorAll("[fixed=left], [fixed=right]").forEach(n=>{n.remove()}),o},"#createSplitTable"));w(this,"getRowHeight",a(()=>t(this,K).getRowHeight(),"getRowHeight"));w(this,"scrollToX",a(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollLeft=e)},"scrollToX"));w(this,"scrollToY",a(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollTop=e)},"scrollToY"));c(this,Wt,a(()=>{t(this,Ot).call(this)},"#init"));c(this,Ot,a(()=>{const e=gt.SCROLLBAR_SIZE;this.innerHTML=`
126
126
  <style>
127
127
  nine-table-sheet {
128
128
  display: none;