@ninebone/table 0.0.434 → 0.0.436

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.
@@ -124,7 +124,7 @@
124
124
  <button class='ng-scroll-top' disabled><div class='ng-scroll-icon'></div></button>
125
125
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
126
126
  <button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
127
- `;const e=a(()=>{const s=t(this,F).shadowRoot.querySelector(".ng-container-body");if(!s){setTimeout(e,10);return}b(this,R,{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,Tt).call(this),this.refresh()},"initWhenReady");e()}};F=new WeakMap,et=new WeakMap,B=new WeakMap,R=new WeakMap,dt=new WeakMap,ft=new WeakMap,Tt=new WeakMap,a(ae,"NineTableVScrollBar");let ht=ae;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",ht);const I=class I{static compileAll(i){return Array.isArray(i)?i.map(e=>I.compile(e)):[]}static compile(i){var o,r,n,l;if(!i)return null;const e=i.cloneNode(!0);return t(o=I,kt).call(o,e),t(r=I,it).call(r,e,"thead"),t(n=I,it).call(n,e,"tbody"),t(l=I,it).call(l,e,"tfoot"),Array.from(e.querySelectorAll("colgroup col")).forEach((d,h)=>{const f=d.getAttribute("fixed");f&&e.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach(u=>{u.setAttribute("fixed",f)})}),e}};kt=new WeakMap,it=new WeakMap,a(I,"TableCompiler"),c(I,kt,a(i=>{if(!i.querySelector("colgroup")){const e=i.querySelector("tbody tr")||i.querySelector("tr"),s=e?e.querySelectorAll("th, td").length:1,o=document.createElement("colgroup"),r=Math.max(Math.floor(i.clientWidth/s),100);for(let n=0;n<s;n++){const l=document.createElement("col");l.setAttribute("width",r),o.appendChild(l)}i.prepend(o)}if(!i.querySelector("thead")){const e=document.createElement("thead"),s=i.querySelector("colgroup");s?s.after(e):i.prepend(e)}i.classList.add("nine-table-element"),i.style.display="table"},"#ensureTableStructure")),c(I,it,a((i,e)=>{const s=Array.from(i.querySelectorAll(e+" tr")),o=Array.from(i.querySelectorAll(e+" th,"+e+" td")),r=s.length;if(r===0||o.length===0)return;let n=0;o.forEach(d=>{n+=d.colSpan||1});const l=Array.from(Array(r),()=>Array(n).fill(null));s.forEach(d=>{const h=d.sectionRowIndex;let f=0;Array.from(d.querySelectorAll("th,td")).forEach(u=>{for(let y=0;y<l[h].length;y++)if(l[h][y]===null){f=y;break}const g=u.rowSpan||1,p=u.colSpan||1;for(let y=0;y<g;y++)for(let q=0;q<p;q++)h+y<r&&f+q<n&&(l[h+y][f+q]=y===0&&q===0?"1":"0")})}),s.forEach(d=>{const h=d.sectionRowIndex;Array.from(d.querySelectorAll("th,td")).forEach(f=>{for(let u=0;u<l[h].length;u++)if(l[h][u]==="1"){f.dataset.col=u,l[h][u]="0";break}})})},"#resetColIndex"));let Gt=I;const ce=class ce{constructor(i){c(this,W);c(this,E);c(this,O,new Map);c(this,k,null);c(this,D,null);c(this,K,0);c(this,ut,40);c(this,st,!1);c(this,Lt,3);S(this,"refresh",a(()=>{var e;const i=t(this,E).querySelector(".ng-container-body");i&&(t(this,bt).call(this),t(this,nt).call(this,i.scrollTop),(e=t(this,E).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));S(this,"initialize",a(()=>{b(this,k,null),t(this,O).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(o=>{const r=t(this,E).querySelector(o);if(!r)return;const n=r.querySelector("table");if(!n)return;const l=n.querySelector("tbody.bindable-tbody");if(!l)return;const h=Array.from(l.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,O).set(o,h)});const i=t(this,E).querySelector(".ng-container-body"),e=t(this,E).querySelector(".ng-container-left"),s=t(this,E).querySelector(".ng-container-right");if(i){t(this,Ht).call(this,i),t(this,yt).call(this),t(this,bt).call(this),t(this,nt).call(this,i.scrollTop);let o=i.scrollTop;const r=a(n=>{var l;e&&e.scrollTop!==n&&(e.scrollTop=n),s&&s.scrollTop!==n&&(s.scrollTop=n),t(this,nt).call(this,n),(l=t(this,E).querySelector("nine-table-vscrollbar"))==null||l.refresh()},"syncScroll");i.addEventListener("scroll",()=>{const n=i.scrollTop;o!==n&&(o=n,r(n))})}},"initialize"));c(this,Ct,a((i,e)=>{const s=t(this,O).get(e);if(!s||s.length===0)return;const o=i.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,ut);l++)s.forEach(d=>{n.appendChild(d.cloneNode(!0))});r?r.before(n):o.appendChild(n)},"#renderRows"));c(this,Ht,a(i=>{if(t(this,k)!==null&&t(this,k)>0)return t(this,k);const e=t(this,O).get(".ng-container-body");if(!e||e.length===0)return 24;const s=i.querySelector("tbody.bindable-tbody")||i.querySelector("tbody.bindable-tbody:last-of-type");if(!s)return 24;s.querySelectorAll("tr:not(.nodata)").forEach(g=>g.remove());const o=s.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(g=>{r.appendChild(g.cloneNode(!0))}),o?o.before(r):s.appendChild(r);const n=t(this,E),l=n.style.display,d=n.style.visibility,h=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=s.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=d,n.style.position=h,b(this,k,f>0?f:24),t(this,gt).call(this),t(this,k)},"#measureAndCacheHeight"));c(this,bt,a(()=>{if(!t(this,E).querySelector(".ng-container-body"))return;const s=(t(this,W).data.get()||[]).length,o=t(this,k)||24,r=s*o;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const l=t(this,E).querySelector(n);if(!l)return;const d=l.querySelector("table");d&&(d.style.height="auto");const h=l.querySelector(".ng-virtual-spacer");h&&(h.style.height=`${r}px`)})},"#updateVirtualScrollHeight"));c(this,gt,a(()=>{if((t(this,W).data.get()||[]).length,t(this,K)>0&&t(this,k)>0){const e=Math.ceil(t(this,K)/t(this,k));b(this,ut,e+t(this,Lt))}},"#updateRowCount"));c(this,Mt,a(()=>{var d,h,f;const i=t(this,E).querySelector(".ng-container-left table"),e=t(this,E).querySelector(".ng-container-body table"),s=t(this,E).querySelector(".ng-container-right table");if(!e)return;const o=i?Array.from(i.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),n=s?Array.from(s.querySelectorAll("tr")):[],l=Math.max(o.length,r.length,n.length);for(let u=0;u<l;u++){const g=[((d=o[u])==null?void 0:d.getBoundingClientRect().height)||0,((h=r[u])==null?void 0:h.getBoundingClientRect().height)||0,((f=n[u])==null?void 0:f.getBoundingClientRect().height)||0],p=Math.max(...g);p>0&&(o[u]&&(o[u].style.height=`${p}px`),r[u]&&(r[u].style.height=`${p}px`),n[u]&&(n[u].style.height=`${p}px`))}},"#syncRowHeights"));c(this,_t,a(()=>{!t(this,E)||!(t(this,E)instanceof HTMLElement)||(b(this,D,new ResizeObserver(i=>{for(const e of i){const s=e.target;if(!s.classList.contains("active"))continue;const o=e.contentRect.height;if(o>0){let r=0;const n=s.querySelector("thead");n&&(r+=n.offsetHeight||n.getBoundingClientRect().height);const l=Math.max(o-r,100);t(this,K)!==l&&(b(this,K,l),t(this,gt).call(this),t(this,k)!==null&&t(this,yt).call(this))}}})),t(this,D).observe(t(this,E)))},"#initResizeObserver"));c(this,yt,a(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(i=>{const e=t(this,E).querySelector(i);e&&e.querySelector("tbody.bindable-tbody")&&t(this,Ct).call(this,e,i)}),t(this,Mt).call(this)},"#renderAllContainers"));c(this,It,a(i=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var h;const s=t(this,E).querySelector(e);if(!s)return;const o=s.querySelector("tbody.bindable-tbody");if(!o)return;const r=Array.from(o.querySelectorAll("tr:not(.nodata)")),n=((h=t(this,O).get(e))==null?void 0:h.length)||1,d=(t(this,W).data.get()||[]).length;r.forEach((f,u)=>{const g=i+Math.floor(u/n);if(g>=d){f.style.display="none";return}const p=t(this,W).data.get(g);f.style.display="",t(this,pt).call(this,f,p,g)})})},"#adjustBufferRows"));c(this,nt,a(i=>{var d;const e=t(this,k);if(!e||e<=0)return;const o=(t(this,W).data.get()||[]).length,r=Math.max(0,Math.floor(i/e)),n=r*e,l=((d=t(this,O).get(".ng-container-body"))==null?void 0:d.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(h=>{const f=t(this,E).querySelector(h);if(!f)return;const u=f.querySelector("table");if(u){const y=u.querySelector("thead"),q=u.querySelector("tbody.fixed-tbody");y&&(y.style.transform=`translateY(${i}px)`),q&&(q.style.transform=`translateY(${i}px)`),y&&(y.style.zIndex="5"),q&&(q.style.zIndex="6")}const g=f.querySelector("tbody.bindable-tbody");if(!g)return;g.style.transform=`translateY(${n}px)`,Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((y,q)=>{const Y=r+Math.floor(q/l);if(Y>=o){y.style.display="none";return}const tt=t(this,W).data.get(Y);y.style.display="",t(this,pt).call(this,y,tt,Y)})}),t(this,st)||(b(this,st,!0),setTimeout(()=>{t(this,It).call(this,r),b(this,st,!1)},0))},"#handleScroll"));c(this,pt,a((i,e,s)=>{i.dataset.row=s,Array.from(i.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${s}C${r}`:`행 ${s+1}`,o.dataset.row=s})},"#bindRowData"));S(this,"destroy",a(()=>{t(this,D)&&(t(this,D).disconnect(),b(this,D,null))},"destroy"));b(this,W,i.getRootNode().host),b(this,E,i),t(this,_t).call(this)}getRowHeight(){return t(this,k)}templateLength(i=".ng-container-body"){var e;return((e=t(this,O).get(i))==null?void 0:e.length)||1}};W=new WeakMap,E=new WeakMap,O=new WeakMap,k=new WeakMap,D=new WeakMap,K=new WeakMap,ut=new WeakMap,st=new WeakMap,Lt=new WeakMap,Ct=new WeakMap,Ht=new WeakMap,bt=new WeakMap,gt=new WeakMap,Mt=new WeakMap,_t=new WeakMap,yt=new WeakMap,It=new WeakMap,nt=new WeakMap,pt=new WeakMap,a(ce,"RowManager");let Jt=ce;const mt=class mt extends HTMLElement{constructor(){super();c(this,$t);c(this,ot,null);c(this,Z);S(this,"invalidate",a(()=>{var e,s;t(this,Z).refresh(),(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),(s=this.querySelector("nine-table-vscrollbar"))==null||s.refresh()},"invalidate"));c(this,Wt,a(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:o})=>{const r=this.querySelector(s);if(!r)return;const n=t(this,zt).call(this,t(this,ot),o);r.innerHTML="";const l=document.createElement("div");l.className="ng-scroll-content",l.style.position="relative",l.style.width="100%",l.appendChild(n);const d=document.createElement("div");d.className="ng-virtual-spacer",d.style.width="100%",d.style.pointerEvents="none",l.appendChild(d),r.appendChild(l)})},"#renderSplitContainers"));c(this,Ot,a(()=>{["left","right"].forEach(e=>{const s=this.querySelector(`.ng-container-${e}`),o=s==null?void 0:s.querySelector("table");if(!s||!o)return;let r=0;o.querySelectorAll("col").forEach(n=>{const l=parseInt(n.getAttribute("width"),10);isNaN(r)||(r+=l)}),s.style.flex=`0 0 ${r}px`,s.style.width=`${r}px`})},"#updateContainerWidths"));S(this,"generate",a(e=>{e&&(b(this,ot,Gt.compile(e)),t(this,ot).style.display="table",t(this,Wt).call(this),t(this,Ot).call(this),requestAnimationFrame(()=>{var o;const s=(o=this.querySelector("thead"))==null?void 0:o.getBoundingClientRect().height;this.querySelectorAll("tbody.fixed-tbody").forEach(r=>{r.style.top=`${s}px`})}),t(this,Z).initialize(),setTimeout(()=>{var s;(s=this.querySelector("nine-table-hscrollbar"))==null||s.refresh()},0))},"generate"));c(this,zt,a((e,s)=>{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 s==="left"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(n=>{n.getAttribute("fixed")!=="left"&&n.remove()}):s==="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"));S(this,"getRowHeight",a(()=>t(this,Z).getRowHeight(),"getRowHeight"));S(this,"scrollToX",a(e=>{const s=this.querySelector(".ng-container-body");s&&(s.scrollLeft=e)},"scrollToX"));S(this,"scrollToY",a(e=>{const s=this.querySelector(".ng-container-body");s&&(s.scrollTop=e)},"scrollToY"));c(this,Nt,a(()=>{t(this,Bt).call(this)},"#init"));c(this,Bt,a(()=>{const e=mt.SCROLLBAR_SIZE;this.innerHTML=`
127
+ `;const e=a(()=>{const s=t(this,F).shadowRoot.querySelector(".ng-container-body");if(!s){setTimeout(e,10);return}b(this,R,{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,Tt).call(this),this.refresh()},"initWhenReady");e()}};F=new WeakMap,et=new WeakMap,B=new WeakMap,R=new WeakMap,dt=new WeakMap,ft=new WeakMap,Tt=new WeakMap,a(ae,"NineTableVScrollBar");let ht=ae;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",ht);const I=class I{static compileAll(i){return Array.isArray(i)?i.map(e=>I.compile(e)):[]}static compile(i){var o,r,n,l;if(!i)return null;const e=i.cloneNode(!0);return t(o=I,kt).call(o,e),t(r=I,it).call(r,e,"thead"),t(n=I,it).call(n,e,"tbody"),t(l=I,it).call(l,e,"tfoot"),Array.from(e.querySelectorAll("colgroup col")).forEach((d,h)=>{const f=d.getAttribute("fixed");f&&e.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach(u=>{u.setAttribute("fixed",f)})}),e}};kt=new WeakMap,it=new WeakMap,a(I,"TableCompiler"),c(I,kt,a(i=>{if(!i.querySelector("colgroup")){const e=i.querySelector("tbody tr")||i.querySelector("tr"),s=e?e.querySelectorAll("th, td").length:1,o=document.createElement("colgroup"),r=Math.max(Math.floor(i.clientWidth/s),100);for(let n=0;n<s;n++){const l=document.createElement("col");l.setAttribute("width",r),o.appendChild(l)}i.prepend(o)}if(!i.querySelector("thead")){const e=document.createElement("thead"),s=i.querySelector("colgroup");s?s.after(e):i.prepend(e)}i.classList.add("nine-table-element"),i.style.display="table"},"#ensureTableStructure")),c(I,it,a((i,e)=>{const s=Array.from(i.querySelectorAll(e+" tr")),o=Array.from(i.querySelectorAll(e+" th,"+e+" td")),r=s.length;if(r===0||o.length===0)return;let n=0;o.forEach(d=>{n+=d.colSpan||1});const l=Array.from(Array(r),()=>Array(n).fill(null));s.forEach(d=>{const h=d.sectionRowIndex;let f=0;Array.from(d.querySelectorAll("th,td")).forEach(u=>{for(let y=0;y<l[h].length;y++)if(l[h][y]===null){f=y;break}const g=u.rowSpan||1,p=u.colSpan||1;for(let y=0;y<g;y++)for(let q=0;q<p;q++)h+y<r&&f+q<n&&(l[h+y][f+q]=y===0&&q===0?"1":"0")})}),s.forEach(d=>{const h=d.sectionRowIndex;Array.from(d.querySelectorAll("th,td")).forEach(f=>{for(let u=0;u<l[h].length;u++)if(l[h][u]==="1"){f.dataset.col=u,l[h][u]="0";break}})})},"#resetColIndex"));let Gt=I;const ce=class ce{constructor(i){c(this,W);c(this,E);c(this,O,new Map);c(this,k,null);c(this,D,null);c(this,K,0);c(this,ut,40);c(this,st,!1);c(this,Lt,3);S(this,"refresh",a(()=>{var e;const i=t(this,E).querySelector(".ng-container-body");i&&(t(this,bt).call(this),t(this,nt).call(this,i.scrollTop),(e=t(this,E).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));S(this,"initialize",a(()=>{b(this,k,null),t(this,O).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(o=>{const r=t(this,E).querySelector(o);if(!r)return;const n=r.querySelector("table");if(!n)return;const l=n.querySelector("tbody.bindable-tbody");if(!l)return;const h=Array.from(l.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,O).set(o,h)});const i=t(this,E).querySelector(".ng-container-body"),e=t(this,E).querySelector(".ng-container-left"),s=t(this,E).querySelector(".ng-container-right");if(i){t(this,Ht).call(this,i),t(this,yt).call(this),t(this,bt).call(this),t(this,nt).call(this,i.scrollTop);let o=i.scrollTop;const r=a(n=>{var l;e&&e.scrollTop!==n&&(e.scrollTop=n),s&&s.scrollTop!==n&&(s.scrollTop=n),t(this,nt).call(this,n),(l=t(this,E).querySelector("nine-table-vscrollbar"))==null||l.refresh()},"syncScroll");i.addEventListener("scroll",()=>{const n=i.scrollTop;o!==n&&(o=n,r(n))})}},"initialize"));c(this,Ct,a((i,e)=>{const s=t(this,O).get(e);if(!s||s.length===0)return;const o=i.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,ut);l++)s.forEach(d=>{n.appendChild(d.cloneNode(!0))});r?r.before(n):o.appendChild(n)},"#renderRows"));c(this,Ht,a(i=>{if(t(this,k)!==null&&t(this,k)>0)return t(this,k);const e=t(this,O).get(".ng-container-body");if(!e||e.length===0)return 24;const s=i.querySelector("tbody.bindable-tbody")||i.querySelector("tbody.bindable-tbody:last-of-type");if(!s)return 24;s.querySelectorAll("tr:not(.nodata)").forEach(g=>g.remove());const o=s.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(g=>{r.appendChild(g.cloneNode(!0))}),o?o.before(r):s.appendChild(r);const n=t(this,E),l=n.style.display,d=n.style.visibility,h=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=s.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=d,n.style.position=h,b(this,k,f>0?f:24),t(this,gt).call(this),t(this,k)},"#measureAndCacheHeight"));c(this,bt,a(()=>{if(!t(this,E).querySelector(".ng-container-body"))return;const s=(t(this,W).data.get()||[]).length,o=t(this,k)||24,r=s*o;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const l=t(this,E).querySelector(n);if(!l)return;const d=l.querySelector("table");d&&(d.style.height="auto");const h=l.querySelector(".ng-virtual-spacer");h&&(h.style.height=`${r}px`)})},"#updateVirtualScrollHeight"));c(this,gt,a(()=>{if((t(this,W).data.get()||[]).length,t(this,K)>0&&t(this,k)>0){const e=Math.ceil(t(this,K)/t(this,k));b(this,ut,e+t(this,Lt))}},"#updateRowCount"));c(this,Mt,a(()=>{var d,h,f;const i=t(this,E).querySelector(".ng-container-left table"),e=t(this,E).querySelector(".ng-container-body table"),s=t(this,E).querySelector(".ng-container-right table");if(!e)return;const o=i?Array.from(i.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),n=s?Array.from(s.querySelectorAll("tr")):[],l=Math.max(o.length,r.length,n.length);for(let u=0;u<l;u++){const g=[((d=o[u])==null?void 0:d.getBoundingClientRect().height)||0,((h=r[u])==null?void 0:h.getBoundingClientRect().height)||0,((f=n[u])==null?void 0:f.getBoundingClientRect().height)||0],p=Math.max(...g);p>0&&(o[u]&&(o[u].style.height=`${p}px`),r[u]&&(r[u].style.height=`${p}px`),n[u]&&(n[u].style.height=`${p}px`))}},"#syncRowHeights"));c(this,_t,a(()=>{!t(this,E)||!(t(this,E)instanceof HTMLElement)||(b(this,D,new ResizeObserver(i=>{for(const e of i){const s=e.target;if(!s.classList.contains("active"))continue;const o=e.contentRect.height;if(o>0){let r=0;const n=s.querySelector("thead");n&&(r+=n.offsetHeight||n.getBoundingClientRect().height);const l=Math.max(o-r,100);t(this,K)!==l&&(b(this,K,l),t(this,gt).call(this),t(this,k)!==null&&t(this,yt).call(this))}}})),t(this,D).observe(t(this,E)))},"#initResizeObserver"));c(this,yt,a(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(i=>{const e=t(this,E).querySelector(i);e&&e.querySelector("tbody.bindable-tbody")&&t(this,Ct).call(this,e,i)}),t(this,Mt).call(this)},"#renderAllContainers"));c(this,It,a(i=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var h;const s=t(this,E).querySelector(e);if(!s)return;const o=s.querySelector("tbody.bindable-tbody");if(!o)return;const r=Array.from(o.querySelectorAll("tr:not(.nodata)")),n=((h=t(this,O).get(e))==null?void 0:h.length)||1,d=(t(this,W).data.get()||[]).length;r.forEach((f,u)=>{const g=i+Math.floor(u/n);if(g>=d){f.style.display="none";return}const p=t(this,W).data.get(g);f.style.display="",t(this,pt).call(this,f,p,g)})})},"#adjustBufferRows"));c(this,nt,a(i=>{var d;const e=t(this,k);if(!e||e<=0)return;const o=(t(this,W).data.get()||[]).length,r=Math.max(0,Math.floor(i/e)),n=r*e,l=((d=t(this,O).get(".ng-container-body"))==null?void 0:d.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(h=>{const f=t(this,E).querySelector(h);if(!f)return;const u=f.querySelector("table");if(u){const y=u.querySelector("thead"),q=u.querySelector("tbody.fixed-tbody");y&&(y.style.position="relative",y.style.transform=`translateY(${i}px)`,y.style.zIndex="5"),q&&(q.style.position="relative",q.style.transform=`translateY(${i}px)`,q.style.zIndex="6")}const g=f.querySelector("tbody.bindable-tbody");if(!g)return;g.style.transform=`translateY(${n}px)`,Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((y,q)=>{const Y=r+Math.floor(q/l);if(Y>=o){y.style.display="none";return}const tt=t(this,W).data.get(Y);y.style.display="",t(this,pt).call(this,y,tt,Y)})}),t(this,st)||(b(this,st,!0),setTimeout(()=>{t(this,It).call(this,r),b(this,st,!1)},0))},"#handleScroll"));c(this,pt,a((i,e,s)=>{i.dataset.row=s,Array.from(i.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${s}C${r}`:`행 ${s+1}`,o.dataset.row=s})},"#bindRowData"));S(this,"destroy",a(()=>{t(this,D)&&(t(this,D).disconnect(),b(this,D,null))},"destroy"));b(this,W,i.getRootNode().host),b(this,E,i),t(this,_t).call(this)}getRowHeight(){return t(this,k)}templateLength(i=".ng-container-body"){var e;return((e=t(this,O).get(i))==null?void 0:e.length)||1}};W=new WeakMap,E=new WeakMap,O=new WeakMap,k=new WeakMap,D=new WeakMap,K=new WeakMap,ut=new WeakMap,st=new WeakMap,Lt=new WeakMap,Ct=new WeakMap,Ht=new WeakMap,bt=new WeakMap,gt=new WeakMap,Mt=new WeakMap,_t=new WeakMap,yt=new WeakMap,It=new WeakMap,nt=new WeakMap,pt=new WeakMap,a(ce,"RowManager");let Jt=ce;const mt=class mt extends HTMLElement{constructor(){super();c(this,$t);c(this,ot,null);c(this,Z);S(this,"invalidate",a(()=>{var e,s;t(this,Z).refresh(),(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),(s=this.querySelector("nine-table-vscrollbar"))==null||s.refresh()},"invalidate"));c(this,Wt,a(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:o})=>{const r=this.querySelector(s);if(!r)return;const n=t(this,zt).call(this,t(this,ot),o);r.innerHTML="";const l=document.createElement("div");l.className="ng-scroll-content",l.style.position="relative",l.style.width="100%",l.appendChild(n);const d=document.createElement("div");d.className="ng-virtual-spacer",d.style.width="100%",d.style.pointerEvents="none",l.appendChild(d),r.appendChild(l)})},"#renderSplitContainers"));c(this,Ot,a(()=>{["left","right"].forEach(e=>{const s=this.querySelector(`.ng-container-${e}`),o=s==null?void 0:s.querySelector("table");if(!s||!o)return;let r=0;o.querySelectorAll("col").forEach(n=>{const l=parseInt(n.getAttribute("width"),10);isNaN(r)||(r+=l)}),s.style.flex=`0 0 ${r}px`,s.style.width=`${r}px`})},"#updateContainerWidths"));S(this,"generate",a(e=>{e&&(b(this,ot,Gt.compile(e)),t(this,ot).style.display="table",t(this,Wt).call(this),t(this,Ot).call(this),requestAnimationFrame(()=>{var o;const s=(o=this.querySelector("thead"))==null?void 0:o.getBoundingClientRect().height;this.querySelectorAll("tbody.fixed-tbody").forEach(r=>{r.style.top=`${s}px`})}),t(this,Z).initialize(),setTimeout(()=>{var s;(s=this.querySelector("nine-table-hscrollbar"))==null||s.refresh()},0))},"generate"));c(this,zt,a((e,s)=>{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 s==="left"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(n=>{n.getAttribute("fixed")!=="left"&&n.remove()}):s==="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"));S(this,"getRowHeight",a(()=>t(this,Z).getRowHeight(),"getRowHeight"));S(this,"scrollToX",a(e=>{const s=this.querySelector(".ng-container-body");s&&(s.scrollLeft=e)},"scrollToX"));S(this,"scrollToY",a(e=>{const s=this.querySelector(".ng-container-body");s&&(s.scrollTop=e)},"scrollToY"));c(this,Nt,a(()=>{t(this,Bt).call(this)},"#init"));c(this,Bt,a(()=>{const e=mt.SCROLLBAR_SIZE;this.innerHTML=`
128
128
  <style>
129
129
  nine-table-sheet {
130
130
  display: none;