@ninebone/table 0.0.316 → 0.0.317

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=c(()=>{const i=t(this,X).querySelector(".ng-container-body");if(!i){setTimeout(e,10);return}g(this,R,{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,yt).call(this),this.refresh()},"initWhenReady");e()}};X=new WeakMap,z=new WeakMap,R=new WeakMap,st=new WeakMap,ot=new WeakMap,yt=new WeakMap,c(Ut,"NineTableVScrollBar");let nt=Ut;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",nt);const M=class M{static compileAll(n){return Array.isArray(n)?n.map(e=>M.compile(e)):[]}static compile(n){var o,r,s,l;if(!n)return null;const e=n.cloneNode(!0);return t(o=M,pt).call(o,e),t(r=M,Z).call(r,e,"thead"),t(s=M,Z).call(s,e,"tbody"),t(l=M,Z).call(l,e,"tfoot"),Array.from(e.querySelectorAll("colgroup col")).forEach((a,d)=>{const f=a.getAttribute("fixed");f&&e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach(u=>{u.setAttribute("fixed",f)})}),e}};pt=new WeakMap,Z=new WeakMap,c(M,"TableCompiler"),h(M,pt,c(n=>{if(!n.querySelector("colgroup")){const e=n.querySelector("tbody tr")||n.querySelector("tr"),i=e?e.querySelectorAll("th, td").length:1,o=document.createElement("colgroup"),r=Math.max(Math.floor(n.clientWidth/i),100);for(let s=0;s<i;s++){const l=document.createElement("col");l.setAttribute("width",r),o.appendChild(l)}n.prepend(o)}if(!n.querySelector("thead")){const e=document.createElement("thead"),i=n.querySelector("colgroup");i?i.after(e):n.prepend(e)}n.classList.add("nine-table-element"),n.style.display="table"},"#ensureTableStructure")),h(M,Z,c((n,e)=>{const i=Array.from(n.querySelectorAll(e+" tr")),o=Array.from(n.querySelectorAll(e+" th,"+e+" td")),r=i.length;if(r===0||o.length===0)return;let s=0;o.forEach(a=>{s+=a.colSpan||1});const l=Array.from(Array(r),()=>Array(s).fill(null));i.forEach(a=>{const d=a.sectionRowIndex;let f=0;Array.from(a.querySelectorAll("th,td")).forEach(u=>{for(let T=0;T<l[d].length;T++)if(l[d][T]===null){f=T;break}const b=u.rowSpan||1,v=u.colSpan||1;for(let T=0;T<b;T++)for(let A=0;A<v;A++)d+T<r&&f+A<s&&(l[d+T][f+A]=T===0&&A===0?"1":"0")})}),i.forEach(a=>{const d=a.sectionRowIndex;Array.from(a.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 Wt=M;const jt=class jt{constructor(n){h(this,x);h(this,I,new Map);h(this,k,null);h(this,O,null);h(this,U,0);h(this,G,40);E(this,"refresh",c(()=>{var e;const n=t(this,x).querySelector(".ng-container-body");n&&(t(this,rt).call(this),t(this,J).call(this,n.scrollTop),(e=t(this,x).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));E(this,"initialize",c(()=>{g(this,k,null),t(this,I).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(o=>{const r=t(this,x).querySelector(o);if(!r)return;const s=r.querySelector("table");if(!s)return;const l=s.querySelector("tbody");if(!l)return;const d=Array.from(l.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,I).set(o,d)});const n=t(this,x).querySelector(".ng-container-body"),e=t(this,x).querySelector(".ng-container-left"),i=t(this,x).querySelector(".ng-container-right");if(n){t(this,xt).call(this,n),t(this,ct).call(this),t(this,rt).call(this),t(this,J).call(this,n.scrollTop);let o=n.scrollTop;const r=c(s=>{var l;e&&e.scrollTop!==s&&(e.scrollTop=s),i&&i.scrollTop!==s&&(i.scrollTop=s),t(this,J).call(this,s),(l=t(this,x).querySelector("nine-table-vscrollbar"))==null||l.refresh()},"syncScroll");n.addEventListener("scroll",()=>{const s=n.scrollTop;o!==s&&(o=s,r(s))})}},"initialize"));h(this,mt,c((n,e)=>{const i=t(this,I).get(e);if(!i||i.length===0)return;const o=n.querySelector("tbody");if(!o)return;o.querySelectorAll("tr:not(.nodata)").forEach(l=>l.remove());const r=o.querySelector("tr.nodata"),s=document.createDocumentFragment();for(let l=0;l<t(this,G);l++)i.forEach(a=>{s.appendChild(a.cloneNode(!0))});r?r.before(s):o.appendChild(s)},"#renderRows"));h(this,xt,c(n=>{if(t(this,k)!==null&&t(this,k)>0)return t(this,k);const e=t(this,I).get(".ng-container-body");if(!e||e.length===0)return 24;const i=n.querySelector("tbody");if(!i)return 24;i.querySelectorAll("tr:not(.nodata)").forEach(b=>b.remove());const o=i.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(b=>{r.appendChild(b.cloneNode(!0))}),o?o.before(r):i.appendChild(r);const s=t(this,x),l=s.style.display,a=s.style.visibility,d=s.style.position;(l==="none"||window.getComputedStyle(s).display==="none")&&(s.style.display="block",s.style.visibility="hidden",s.style.position="absolute");let f=0;const u=i.querySelectorAll("tr:not(.nodata)");return u.forEach(b=>{f+=b.offsetHeight||b.getBoundingClientRect().height}),u.forEach(b=>b.remove()),s.style.display=l,s.style.visibility=a,s.style.position=d,g(this,k,f>0?f:24),t(this,lt).call(this),t(this,k)},"#measureAndCacheHeight"));h(this,rt,c(()=>{var r,s,l,a;if(!t(this,x).querySelector(".ng-container-body"))return;const e=(typeof((r=t(this,x).data)==null?void 0:r.count)=="function"?t(this,x).data.count():null)??((l=(s=t(this,x).dataManager)==null?void 0:s.rawRecords)==null?void 0:l.length)??((a=t(this,x).data)==null?void 0:a.length)??100,i=t(this,k)||24,o=e*i;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(d=>{const f=t(this,x).querySelector(d),u=f==null?void 0:f.querySelector("table");u&&(u.style.height=`${o}px`)})},"#updateVirtualScrollHeight"));h(this,lt,c(()=>{if(t(this,U)>0&&t(this,k)>0){const n=Math.ceil(t(this,U)/t(this,k));g(this,G,n+20)}else g(this,G,40)},"#updateRowCount"));h(this,vt,c(()=>{var a,d,f;const n=t(this,x).querySelector(".ng-container-left table"),e=t(this,x).querySelector(".ng-container-body table"),i=t(this,x).querySelector(".ng-container-right table");if(!e)return;const o=n?Array.from(n.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),s=i?Array.from(i.querySelectorAll("tr")):[],l=Math.max(o.length,r.length,s.length);for(let u=0;u<l;u++){const b=[((a=o[u])==null?void 0:a.getBoundingClientRect().height)||0,((d=r[u])==null?void 0:d.getBoundingClientRect().height)||0,((f=s[u])==null?void 0:f.getBoundingClientRect().height)||0],v=Math.max(...b);v>0&&(o[u]&&(o[u].style.height=`${v}px`),r[u]&&(r[u].style.height=`${v}px`),s[u]&&(s[u].style.height=`${v}px`))}},"#syncRowHeights"));h(this,wt,c(()=>{!t(this,x)||!(t(this,x)instanceof HTMLElement)||(g(this,O,new ResizeObserver(n=>{for(const e of n){const i=e.target;if(!i.classList.contains("active"))continue;const o=e.contentRect.height;if(o>0){let r=0;const s=i.querySelector("thead");s&&(r+=s.offsetHeight||s.getBoundingClientRect().height);const l=Math.max(o-r,100);t(this,U)!==l&&(g(this,U,l),t(this,lt).call(this),t(this,k)!==null&&t(this,ct).call(this))}}})),t(this,O).observe(t(this,x)))},"#initResizeObserver"));h(this,ct,c(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const e=t(this,x).querySelector(n);e&&e.querySelector("tbody")&&t(this,mt).call(this,e,n)}),t(this,vt).call(this)},"#renderAllContainers"));h(this,J,c(n=>{var r;const e=t(this,k);if(!e||e<=0)return;const i=Math.max(0,Math.floor(n/e)),o=((r=t(this,I).get(".ng-container-body"))==null?void 0:r.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(s=>{const l=t(this,x).querySelector(s);if(!l)return;const a=l.querySelector("tbody");if(!a)return;Array.from(a.querySelectorAll("tr:not(.nodata)")).forEach((f,u)=>{var T,A,F,Qt;const b=i+Math.floor(u/o),v=(typeof t(this,x).getData=="function"?t(this,x).getData(b):null)??(typeof((T=t(this,x).data)==null?void 0:T.get)=="function"?t(this,x).data.get(b):null)??((F=(A=t(this,x).dataManager)==null?void 0:A.rawRecords)==null?void 0:F[b])??((Qt=t(this,x).data)==null?void 0:Qt[b])??{_index:b};f.style.display="",t(this,St).call(this,f,v,b)})})},"#handleScroll"));h(this,St,c((n,e,i)=>{n.dataset.row=i,Array.from(n.cells).forEach((o,r)=>{const s=o.dataset.bind;s&&e&&e[s]!==void 0?o.textContent=e[s]:o.textContent=e?e[Object.keys(e)[r]]??`R${i}C${r}`:`행 ${i+1}`,o.dataset.row=i})},"#bindRowData"));E(this,"destroy",c(()=>{t(this,O)&&(t(this,O).disconnect(),g(this,O,null))},"destroy"));g(this,x,n),t(this,wt).call(this)}getRowHeight(){return t(this,k)}templateLength(n=".ng-container-body"){var e;return((e=t(this,I).get(n))==null?void 0:e.length)||1}};x=new WeakMap,I=new WeakMap,k=new WeakMap,O=new WeakMap,U=new WeakMap,G=new WeakMap,mt=new WeakMap,xt=new WeakMap,rt=new WeakMap,lt=new WeakMap,vt=new WeakMap,wt=new WeakMap,ct=new WeakMap,J=new WeakMap,St=new WeakMap,c(jt,"RowManager");let zt=jt;const at=class at extends HTMLElement{constructor(){super();h(this,Q,null);h(this,tt);h(this,Et,c(()=>{[{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 s=t(this,Tt).call(this,t(this,Q),o);r.innerHTML="",r.appendChild(s)})},"#renderSplitContainers"));h(this,Rt,c(()=>{["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(s=>{const l=parseInt(s.getAttribute("width"),10);isNaN(r)||(r+=l)}),i.style.flex=`0 0 ${r}px`,i.style.width=`${r}px`})},"#updateContainerWidths"));E(this,"generate",c(e=>{var o;if(!e)return;g(this,Q,Wt.compile(e)),t(this,Q).style.display="table",t(this,Et).call(this),t(this,Rt).call(this);const i=((o=this.querySelector("thead"))==null?void 0:o.getBoundingClientRect().height)||30;this.querySelectorAll("tbody.fixed-tbody").forEach(r=>{r.style.top=`${i}px`}),t(this,tt).initialize(),setTimeout(()=>{var r;(r=this.querySelector("nine-table-hscrollbar"))==null||r.refresh()},0)},"generate"));h(this,Tt,c((e,i)=>{const o=e.cloneNode(!0),r=o.querySelector("tbody");if(r){const s=document.createElement("tbody");s.className="fixed-tbody",r.className="bindable-tbody",r.before(s)}return i==="left"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(s=>{s.getAttribute("fixed")!=="left"&&s.remove()}):i==="right"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(s=>{s.getAttribute("fixed")!=="right"&&s.remove()}):o.querySelectorAll("[fixed=left], [fixed=right]").forEach(s=>{s.remove()}),o},"#createSplitTable"));E(this,"getRowHeight",c(()=>t(this,tt).getRowHeight(),"getRowHeight"));E(this,"scrollToX",c(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollLeft=e)},"scrollToX"));E(this,"scrollToY",c(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollTop=e)},"scrollToY"));h(this,kt,c(()=>{t(this,qt).call(this)},"#init"));h(this,qt,c(()=>{const e=at.SCROLLBAR_SIZE;this.innerHTML=`
125
+ `;const e=c(()=>{const i=t(this,X).querySelector(".ng-container-body");if(!i){setTimeout(e,10);return}g(this,R,{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,yt).call(this),this.refresh()},"initWhenReady");e()}};X=new WeakMap,z=new WeakMap,R=new WeakMap,st=new WeakMap,ot=new WeakMap,yt=new WeakMap,c(Ut,"NineTableVScrollBar");let nt=Ut;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",nt);const M=class M{static compileAll(n){return Array.isArray(n)?n.map(e=>M.compile(e)):[]}static compile(n){var o,r,s,l;if(!n)return null;const e=n.cloneNode(!0);return t(o=M,pt).call(o,e),t(r=M,Z).call(r,e,"thead"),t(s=M,Z).call(s,e,"tbody"),t(l=M,Z).call(l,e,"tfoot"),Array.from(e.querySelectorAll("colgroup col")).forEach((a,d)=>{const f=a.getAttribute("fixed");f&&e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach(u=>{u.setAttribute("fixed",f)})}),e}};pt=new WeakMap,Z=new WeakMap,c(M,"TableCompiler"),h(M,pt,c(n=>{if(!n.querySelector("colgroup")){const e=n.querySelector("tbody tr")||n.querySelector("tr"),i=e?e.querySelectorAll("th, td").length:1,o=document.createElement("colgroup"),r=Math.max(Math.floor(n.clientWidth/i),100);for(let s=0;s<i;s++){const l=document.createElement("col");l.setAttribute("width",r),o.appendChild(l)}n.prepend(o)}if(!n.querySelector("thead")){const e=document.createElement("thead"),i=n.querySelector("colgroup");i?i.after(e):n.prepend(e)}n.classList.add("nine-table-element"),n.style.display="table"},"#ensureTableStructure")),h(M,Z,c((n,e)=>{const i=Array.from(n.querySelectorAll(e+" tr")),o=Array.from(n.querySelectorAll(e+" th,"+e+" td")),r=i.length;if(r===0||o.length===0)return;let s=0;o.forEach(a=>{s+=a.colSpan||1});const l=Array.from(Array(r),()=>Array(s).fill(null));i.forEach(a=>{const d=a.sectionRowIndex;let f=0;Array.from(a.querySelectorAll("th,td")).forEach(u=>{for(let T=0;T<l[d].length;T++)if(l[d][T]===null){f=T;break}const b=u.rowSpan||1,v=u.colSpan||1;for(let T=0;T<b;T++)for(let A=0;A<v;A++)d+T<r&&f+A<s&&(l[d+T][f+A]=T===0&&A===0?"1":"0")})}),i.forEach(a=>{const d=a.sectionRowIndex;Array.from(a.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 Wt=M;const jt=class jt{constructor(n){h(this,x);h(this,I,new Map);h(this,k,null);h(this,O,null);h(this,U,0);h(this,G,40);E(this,"refresh",c(()=>{var e;const n=t(this,x).querySelector(".ng-container-body");n&&(t(this,rt).call(this),t(this,J).call(this,n.scrollTop),(e=t(this,x).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));E(this,"initialize",c(()=>{g(this,k,null),t(this,I).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(o=>{const r=t(this,x).querySelector(o);if(!r)return;const s=r.querySelector("table");if(!s)return;const l=s.querySelector("tbody");if(!l)return;const d=Array.from(l.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,I).set(o,d)});const n=t(this,x).querySelector(".ng-container-body"),e=t(this,x).querySelector(".ng-container-left"),i=t(this,x).querySelector(".ng-container-right");if(n){t(this,xt).call(this,n),t(this,ct).call(this),t(this,rt).call(this),t(this,J).call(this,n.scrollTop);let o=n.scrollTop;const r=c(s=>{var l;e&&e.scrollTop!==s&&(e.scrollTop=s),i&&i.scrollTop!==s&&(i.scrollTop=s),t(this,J).call(this,s),(l=t(this,x).querySelector("nine-table-vscrollbar"))==null||l.refresh()},"syncScroll");n.addEventListener("scroll",()=>{const s=n.scrollTop;o!==s&&(o=s,r(s))})}},"initialize"));h(this,mt,c((n,e)=>{const i=t(this,I).get(e);if(!i||i.length===0)return;const o=n.querySelector("tbody");if(!o)return;o.querySelectorAll("tr:not(.nodata)").forEach(l=>l.remove());const r=o.querySelector("tr.nodata"),s=document.createDocumentFragment();for(let l=0;l<t(this,G);l++)i.forEach(a=>{s.appendChild(a.cloneNode(!0))});r?r.before(s):o.appendChild(s)},"#renderRows"));h(this,xt,c(n=>{if(t(this,k)!==null&&t(this,k)>0)return t(this,k);const e=t(this,I).get(".ng-container-body");if(!e||e.length===0)return 24;const i=n.querySelector("tbody.bindable-tbody")||n.querySelector("tbody:last-of-type");if(!i)return 24;i.querySelectorAll("tr:not(.nodata)").forEach(b=>b.remove());const o=i.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(b=>{r.appendChild(b.cloneNode(!0))}),o?o.before(r):i.appendChild(r);const s=t(this,x),l=s.style.display,a=s.style.visibility,d=s.style.position;(l==="none"||window.getComputedStyle(s).display==="none")&&(s.style.display="block",s.style.visibility="hidden",s.style.position="absolute");let f=0;const u=i.querySelectorAll("tr:not(.nodata)");return u.forEach(b=>{f+=b.offsetHeight||b.getBoundingClientRect().height}),u.forEach(b=>b.remove()),s.style.display=l,s.style.visibility=a,s.style.position=d,g(this,k,f>0?f:24),t(this,lt).call(this),t(this,k)},"#measureAndCacheHeight"));h(this,rt,c(()=>{var r,s,l,a;if(!t(this,x).querySelector(".ng-container-body"))return;const e=(typeof((r=t(this,x).data)==null?void 0:r.count)=="function"?t(this,x).data.count():null)??((l=(s=t(this,x).dataManager)==null?void 0:s.rawRecords)==null?void 0:l.length)??((a=t(this,x).data)==null?void 0:a.length)??100,i=t(this,k)||24,o=e*i;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(d=>{const f=t(this,x).querySelector(d),u=f==null?void 0:f.querySelector("table");u&&(u.style.height=`${o}px`)})},"#updateVirtualScrollHeight"));h(this,lt,c(()=>{if(t(this,U)>0&&t(this,k)>0){const n=Math.ceil(t(this,U)/t(this,k));g(this,G,n+20)}else g(this,G,40)},"#updateRowCount"));h(this,vt,c(()=>{var a,d,f;const n=t(this,x).querySelector(".ng-container-left table"),e=t(this,x).querySelector(".ng-container-body table"),i=t(this,x).querySelector(".ng-container-right table");if(!e)return;const o=n?Array.from(n.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),s=i?Array.from(i.querySelectorAll("tr")):[],l=Math.max(o.length,r.length,s.length);for(let u=0;u<l;u++){const b=[((a=o[u])==null?void 0:a.getBoundingClientRect().height)||0,((d=r[u])==null?void 0:d.getBoundingClientRect().height)||0,((f=s[u])==null?void 0:f.getBoundingClientRect().height)||0],v=Math.max(...b);v>0&&(o[u]&&(o[u].style.height=`${v}px`),r[u]&&(r[u].style.height=`${v}px`),s[u]&&(s[u].style.height=`${v}px`))}},"#syncRowHeights"));h(this,wt,c(()=>{!t(this,x)||!(t(this,x)instanceof HTMLElement)||(g(this,O,new ResizeObserver(n=>{for(const e of n){const i=e.target;if(!i.classList.contains("active"))continue;const o=e.contentRect.height;if(o>0){let r=0;const s=i.querySelector("thead");s&&(r+=s.offsetHeight||s.getBoundingClientRect().height);const l=Math.max(o-r,100);t(this,U)!==l&&(g(this,U,l),t(this,lt).call(this),t(this,k)!==null&&t(this,ct).call(this))}}})),t(this,O).observe(t(this,x)))},"#initResizeObserver"));h(this,ct,c(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const e=t(this,x).querySelector(n);e&&e.querySelector("tbody")&&t(this,mt).call(this,e,n)}),t(this,vt).call(this)},"#renderAllContainers"));h(this,J,c(n=>{var r;const e=t(this,k);if(!e||e<=0)return;const i=Math.max(0,Math.floor(n/e)),o=((r=t(this,I).get(".ng-container-body"))==null?void 0:r.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(s=>{const l=t(this,x).querySelector(s);if(!l)return;const a=l.querySelector("tbody.bindable-tbody");if(!a)return;Array.from(a.querySelectorAll("tr:not(.nodata)")).forEach((f,u)=>{var T,A,F,Qt;const b=i+Math.floor(u/o),v=(typeof t(this,x).getData=="function"?t(this,x).getData(b):null)??(typeof((T=t(this,x).data)==null?void 0:T.get)=="function"?t(this,x).data.get(b):null)??((F=(A=t(this,x).dataManager)==null?void 0:A.rawRecords)==null?void 0:F[b])??((Qt=t(this,x).data)==null?void 0:Qt[b])??{_index:b};f.style.display="",t(this,St).call(this,f,v,b)})})},"#handleScroll"));h(this,St,c((n,e,i)=>{n.dataset.row=i,Array.from(n.cells).forEach((o,r)=>{const s=o.dataset.bind;s&&e&&e[s]!==void 0?o.textContent=e[s]:o.textContent=e?e[Object.keys(e)[r]]??`R${i}C${r}`:`행 ${i+1}`,o.dataset.row=i})},"#bindRowData"));E(this,"destroy",c(()=>{t(this,O)&&(t(this,O).disconnect(),g(this,O,null))},"destroy"));g(this,x,n),t(this,wt).call(this)}getRowHeight(){return t(this,k)}templateLength(n=".ng-container-body"){var e;return((e=t(this,I).get(n))==null?void 0:e.length)||1}};x=new WeakMap,I=new WeakMap,k=new WeakMap,O=new WeakMap,U=new WeakMap,G=new WeakMap,mt=new WeakMap,xt=new WeakMap,rt=new WeakMap,lt=new WeakMap,vt=new WeakMap,wt=new WeakMap,ct=new WeakMap,J=new WeakMap,St=new WeakMap,c(jt,"RowManager");let zt=jt;const at=class at extends HTMLElement{constructor(){super();h(this,Q,null);h(this,tt);h(this,Et,c(()=>{[{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 s=t(this,Tt).call(this,t(this,Q),o);r.innerHTML="",r.appendChild(s)})},"#renderSplitContainers"));h(this,Rt,c(()=>{["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(s=>{const l=parseInt(s.getAttribute("width"),10);isNaN(r)||(r+=l)}),i.style.flex=`0 0 ${r}px`,i.style.width=`${r}px`})},"#updateContainerWidths"));E(this,"generate",c(e=>{var o;if(!e)return;g(this,Q,Wt.compile(e)),t(this,Q).style.display="table",t(this,Et).call(this),t(this,Rt).call(this);const i=((o=this.querySelector("thead"))==null?void 0:o.getBoundingClientRect().height)||30;this.querySelectorAll("tbody.fixed-tbody").forEach(r=>{r.style.top=`${i}px`}),t(this,tt).initialize(),setTimeout(()=>{var r;(r=this.querySelector("nine-table-hscrollbar"))==null||r.refresh()},0)},"generate"));h(this,Tt,c((e,i)=>{const o=e.cloneNode(!0),r=o.querySelector("tbody");if(r){const s=document.createElement("tbody");s.className="fixed-tbody",r.className="bindable-tbody",r.before(s)}return i==="left"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(s=>{s.getAttribute("fixed")!=="left"&&s.remove()}):i==="right"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(s=>{s.getAttribute("fixed")!=="right"&&s.remove()}):o.querySelectorAll("[fixed=left], [fixed=right]").forEach(s=>{s.remove()}),o},"#createSplitTable"));E(this,"getRowHeight",c(()=>t(this,tt).getRowHeight(),"getRowHeight"));E(this,"scrollToX",c(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollLeft=e)},"scrollToX"));E(this,"scrollToY",c(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollTop=e)},"scrollToY"));h(this,kt,c(()=>{t(this,qt).call(this)},"#init"));h(this,qt,c(()=>{const e=at.SCROLLBAR_SIZE;this.innerHTML=`
126
126
  <style>
127
127
  nine-table-sheet {
128
128
  display: none;