@ninebone/table 0.1.13 → 0.1.15
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 +264 -266
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +2 -2
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(A,R){typeof exports=="object"&&typeof module<"u"?R(require("@ninebone/util")):typeof define=="function"&&define.amd?define(["@ninebone/util"],R):(A=typeof globalThis<"u"?globalThis:A||self,R(A.NineboneUtil))})(this,function(A){"use strict";var xs=Object.defineProperty;var ws=A=>{throw TypeError(A)};var Es=(A,R,x)=>R in A?xs(A,R,{enumerable:!0,configurable:!0,writable:!0,value:x}):A[R]=x;var d=(A,R)=>xs(A,"name",{value:R,configurable:!0});var T=(A,R,x)=>Es(A,typeof R!="symbol"?R+"":R,x),gs=(A,R,x)=>R.has(A)||ws("Cannot "+x);var t=(A,R,x)=>(gs(A,R,"read from private field"),x?x.call(A):R.get(A)),h=(A,R,x)=>R.has(A)?ws("Cannot add the same private member more than once"):R instanceof WeakSet?R.add(A):R.set(A,x),y=(A,R,x,X)=>(gs(A,R,"write to private field"),X?X.call(A,x):R.set(A,x),x),Q=(A,R,x)=>(gs(A,R,"access private method"),x);var vs=(A,R,x,X)=>({set _(Tt){y(A,R,Tt,x)},get _(){return t(A,R,X)}});var F,K,q,tt,et,st,Jt,nt,Qt,rt,ot,pt,k,Ct,kt,te,it,E,at,U,D,Z,lt,Lt,Ve,Ye,ee,Xe,se,ne,It,Mt,Ht,re,oe,$t,yt,ie,ae,N,V,Y,Zt,Ss,B,ct,Nt,ce,he,mt,Rs,_t,Dt,Ot,ht,de,
|
|
1
|
+
(function(A,R){typeof exports=="object"&&typeof module<"u"?R(require("@ninebone/util")):typeof define=="function"&&define.amd?define(["@ninebone/util"],R):(A=typeof globalThis<"u"?globalThis:A||self,R(A.NineboneUtil))})(this,function(A){"use strict";var xs=Object.defineProperty;var ws=A=>{throw TypeError(A)};var Es=(A,R,x)=>R in A?xs(A,R,{enumerable:!0,configurable:!0,writable:!0,value:x}):A[R]=x;var d=(A,R)=>xs(A,"name",{value:R,configurable:!0});var T=(A,R,x)=>Es(A,typeof R!="symbol"?R+"":R,x),gs=(A,R,x)=>R.has(A)||ws("Cannot "+x);var t=(A,R,x)=>(gs(A,R,"read from private field"),x?x.call(A):R.get(A)),h=(A,R,x)=>R.has(A)?ws("Cannot add the same private member more than once"):R instanceof WeakSet?R.add(A):R.set(A,x),y=(A,R,x,X)=>(gs(A,R,"write to private field"),X?X.call(A,x):R.set(A,x),x),Q=(A,R,x)=>(gs(A,R,"access private method"),x);var vs=(A,R,x,X)=>({set _(Tt){y(A,R,Tt,x)},get _(){return t(A,R,X)}});var F,K,q,tt,et,st,Jt,nt,Qt,rt,ot,pt,k,Ct,kt,te,it,E,at,U,D,Z,lt,Lt,Ve,Ye,ee,Xe,se,ne,It,Mt,Ht,re,oe,$t,yt,ie,ae,N,V,Y,Zt,Ss,B,ct,Nt,ce,he,mt,Rs,_t,Dt,Ot,ht,Ge,de,As,fe,dt,Wt,zt,j,ue,ge,xt,be,pe,ye,Pt,_,me,Ft,xe,jt,wt,O,L,z,vt,we,G,ve,ft,Ut,Se,Re,St,ut,Rt,H,Vt,Ae,gt,Ee,qe,I,Xt,v,os,is,as,ls,cs,Kt,bt,At,Et,Te,J,fs;const Fe=class Fe extends A.trace.constructor{constructor(){super(),this.init("nine-table","green")}};d(Fe,"Trace");let R=Fe;const x=new R,je=class je extends HTMLElement{constructor(){super();h(this,F);h(this,K,!1);h(this,q);h(this,tt);h(this,et);h(this,st);h(this,Jt,d(()=>{if(!t(this,F))return;const e=t(this,F).querySelector(".ng-container-body .ng-part-body");e&&(y(this,st,new ResizeObserver(()=>{this.refresh()})),t(this,st).observe(e))},"#observeResize"));T(this,"refresh",d(()=>{if(!t(this,F)||!t(this,q)||t(this,K))return;const e=t(this,q).container,s=e.querySelector("table");if(!s)return;const o=t(this,q).track,a=t(this,q).thumb,r=t(this,F).querySelector(".ng-container-bottom"),i=e.clientWidth,c=s.scrollWidth;if(i!==0&&c>i)r&&(r.style.display="flex");else{r&&(r.style.display="none");return}const l=o.clientWidth;if(l<=0)return;const f=Math.max(Math.min(l*(i/c),l),20);a.style.width=`${f}px`;const g=e.scrollLeft,b=c-i;let u=0;b>0&&(u=parseInt(g/b*(l-f),10)),u<0&&(u=0);const p=l-f;u>p&&(u=p),a.style.left=`${u}px`,t(this,q).left.disabled=u===0,t(this,q).right.disabled=u>=p-1},"refresh"));h(this,nt,d(e=>{if(!t(this,q))return!1;const s=t(this,q).container,o=s.querySelector("table");if(!o)return!1;const a=t(this,q).track.getBoundingClientRect(),r=t(this,q).thumb.clientWidth;let i=e;i<0&&(i=0);const c=a.width-r;i>c&&(i=c),i=parseInt(i,10),t(this,q).thumb.style.left=`${i}px`,x.log("1111=========="),t(this,q).left.disabled=i===0,t(this,q).right.disabled=i>=c-1;const l=s.clientWidth,g=o.scrollWidth-l;return c>0&&g>0&&(s.scrollLeft=i/c*g),i>0&&i<c-1},"#thumbMoveTo"));h(this,Qt,d(()=>{const e=d(o=>{clearInterval(t(this,tt)),clearInterval(t(this,et));const a=parseInt(t(this,q).thumb.style.left||0,10);t(this,nt).call(this,a+o),y(this,tt,setInterval(()=>{clearInterval(t(this,tt)),y(this,et,setInterval(()=>{const r=parseInt(t(this,q).thumb.style.left||0,10);t(this,nt).call(this,r+o)||clearInterval(t(this,et))},50))},500))},"delayScroll"),s=d(()=>{clearInterval(t(this,tt)),clearInterval(t(this,et))},"clearTimer");["mouseup","mouseleave","touchend"].forEach(o=>{t(this,q).left.addEventListener(o,s),t(this,q).right.addEventListener(o,s),t(this,q).track.addEventListener(o,s)}),t(this,q).left.addEventListener("mousedown",o=>{o.button===0&&e(-20)}),t(this,q).right.addEventListener("mousedown",o=>{o.button===0&&e(20)}),t(this,q).left.addEventListener("touchstart",()=>e(-20)),t(this,q).right.addEventListener("touchstart",()=>e(20)),t(this,q).track.addEventListener("mousedown",o=>{if(o.button!==0)return;o.preventDefault();const a=t(this,q).track.getBoundingClientRect(),r=t(this,q).thumb.clientWidth;t(this,nt).call(this,o.clientX-a.left-r/2)}),t(this,q).thumb.addEventListener("mousedown",o=>{if(o.button!==0)return;o.stopPropagation(),o.preventDefault(),y(this,K,!0),this.shiftX=o.clientX-t(this,q).thumb.getBoundingClientRect().left;const a=d(i=>{if(!t(this,K))return;const c=t(this,q).track.getBoundingClientRect();t(this,nt).call(this,i.clientX-c.left-this.shiftX)},"onMouseMove"),r=d(()=>{y(this,K,!1),s(),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",r),this.refresh()},"onMouseUp");document.addEventListener("mousemove",a),document.addEventListener("mouseup",r)})},"#init"))}connectedCallback(){if(y(this,F,this.closest("nine-table-sheet")||this.getRootNode().host),!t(this,F))return;this.innerHTML=`
|
|
2
2
|
<style>
|
|
3
3
|
nine-table-hscrollbar {
|
|
4
4
|
display: flex;
|
|
@@ -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=d(()=>{const s=t(this,ot).querySelector(".ng-container-body .ng-part-body");if(!s){setTimeout(e,10);return}y(this,k,{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,te).call(this),this.refresh()},"initWhenReady");e()}};rt=new WeakMap,ot=new WeakMap,pt=new WeakMap,k=new WeakMap,Ct=new WeakMap,kt=new WeakMap,te=new WeakMap,d(Ue,"NineTableVScrollBar");let Tt=Ue;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",Tt);const Ke=class Ke{constructor(n){h(this,it);h(this,E);h(this,at);h(this,U,new Map);h(this,D,null);h(this,Z,null);h(this,lt,0);h(this,Lt,40);h(this,Ve,!1);h(this,Ye,!1);h(this,ee,3);h(this,Xe,3);h(this,se,0);T(this,"refresh",d(()=>{var e;x.log("rowManager.refresh");const n=t(this,E).querySelector(".ng-container-body .ng-part-body");n&&(t(this,It).call(this),t(this,Mt).call(this),t(this,yt).call(this,n.scrollTop),(e=t(this,E).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));T(this,"initialize",d(()=>{x.log("rowManager.initialize"),y(this,at,{scrollTables:t(this,E).querySelectorAll(".ng-part-body table"),firstTr:t(this,E).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")}),y(this,D,null),t(this,U).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const i=t(this,E).querySelector(r);if(!i)return;const c=i.querySelector(".ng-part-body table");if(!c)return;const l=c.querySelector("tbody.bindable-tbody");if(!l)return;const g=Array.from(l.querySelectorAll("tr")).map(b=>b.cloneNode(!0));t(this,U).set(r,g)});const n=t(this,E).querySelector(".ng-container-body .ng-part-body"),e=t(this,E).querySelector(".ng-container-left .ng-part-body"),s=t(this,E).querySelector(".ng-container-right .ng-part-body"),o=t(this,E).querySelector(".ng-container-body .ng-part-header"),a=t(this,E).querySelector(".ng-container-body .ng-part-footer");if(n){t(this,It).call(this),t(this,$t).call(this),t(this,Mt).call(this),t(this,yt).call(this,n.scrollTop);let r=!1;y(this,se,n.scrollLeft);const i=d(c=>{var g;if(r)return;r=!0;const l=c.scrollTop,f=c.scrollLeft;n&&n.scrollTop!==l&&(n.scrollTop=l),e&&e.scrollTop!==l&&(e.scrollTop=l),s&&s.scrollTop!==l&&(s.scrollTop=l),o&&o.scrollLeft!==f&&(o.scrollLeft=f),a&&a.scrollLeft!==f&&(a.scrollLeft=f),t(this,yt).call(this,l),(g=t(this,E).querySelector("nine-table-vscrollbar"))==null||g.refresh(),r=!1},"handleContainerScroll");n==null||n.addEventListener("scroll",c=>{i(n)}),[e,s].forEach(c=>{c==null||c.addEventListener("scroll",l=>{if(r)return;r=!0;const f=c.scrollTop;n&&n.scrollTop!==f&&(n.scrollTop=f),r=!1})})}},"initialize"));h(this,ne,d((n,e)=>{x.log("rowManager.#renderRows");const s=t(this,U).get(e);if(!s||s.length===0)return;const o=n.querySelector(".ng-part-body tbody.bindable-tbody");if(!o)return;o.querySelectorAll("tr:not(.nodata)").forEach(i=>i.remove());const a=o.querySelector("tr.nodata"),r=document.createDocumentFragment();for(let i=0;i<t(this,Lt);i++)s.forEach(c=>{r.appendChild(c.cloneNode(!0))});a?a.before(r):o.appendChild(r),e===".ng-container-body"&&(t(this,at).firstTr=o.querySelector("tr:not(.nodata)"))},"#renderRows"));h(this,It,d(()=>{if(t(this,D)!==null&&t(this,D)>0)return t(this,D);const n=t(this,E).querySelector(".ng-container-body .ng-part-body");x.log("rowManager.#measureAndCacheHeight");const e=t(this,U).get(".ng-container-body");if(!e||e.length===0)throw new Error("invalid dom");const s=n.querySelector("tbody.bindable-tbody");if(!s)throw new Error("invalid dom");s.querySelectorAll("tr:not(.nodata)").forEach(b=>b.remove());const o=s.querySelector("tr.nodata"),a=document.createDocumentFragment();e.forEach(b=>{a.appendChild(b.cloneNode(!0))}),o?o.before(a):s.appendChild(a);const r=t(this,E),i=r.style.display,c=r.style.visibility,l=r.style.position;(i==="none"||window.getComputedStyle(r).display==="none")&&(r.style.display="block",r.style.visibility="hidden",r.style.position="absolute");let f=0;const g=s.querySelectorAll("tr");return g.forEach(b=>{let u=b.offsetHeight||b.getBoundingClientRect().height;if(u===0){const p=window.getComputedStyle(b);u=parseFloat(p.height)||parseFloat(p.minHeight)||0}f+=u}),g.forEach(b=>b.remove()),r.style.display=i,r.style.visibility=c,r.style.position=l,f<=0?-1:(y(this,D,f),t(this,Ht).call(this),t(this,D))},"#measureAndCacheHeight"));h(this,Mt,d(()=>{x.log("rowManager.#updateVirtualScrollHeight");const e=(t(this,it).data.get()||[]).length,s=t(this,D),o=e*s;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(a=>{const r=t(this,E).querySelector(a);if(!r)return;const i=r.querySelector(".ng-part-body .ng-virtual-spacer");i&&(i.style.height=`${o}px`)})},"#updateVirtualScrollHeight"));h(this,Ht,d(()=>{if(t(this,lt)>0&&t(this,D)>0){const n=Math.ceil(t(this,lt)/t(this,D));y(this,Lt,n+t(this,ee))}},"#updateRowCount"));h(this,re,d(()=>{var i,c,l,f,g,b;const n=t(this,E).querySelector(".ng-container-left .ng-part-body table"),e=t(this,E).querySelector(".ng-container-body .ng-part-body table"),s=t(this,E).querySelector(".ng-container-right .ng-part-body table");if(e){const u=n?Array.from(n.querySelectorAll("tbody tr")):[],p=Array.from(e.querySelectorAll("tbody tr")),m=s?Array.from(s.querySelectorAll("tbody tr")):[],S=Math.max(u.length,p.length,m.length);for(let w=0;w<S;w++){const M=[((i=u[w])==null?void 0:i.getBoundingClientRect().height)||0,((c=p[w])==null?void 0:c.getBoundingClientRect().height)||0,((l=m[w])==null?void 0:l.getBoundingClientRect().height)||0],C=Math.max(...M);C>0&&(u[w]&&(u[w].style.height=`${C}px`),p[w]&&(p[w].style.height=`${C}px`),m[w]&&(m[w].style.height=`${C}px`))}}const o=t(this,E).querySelector(".ng-container-left .ng-part-footer table"),a=t(this,E).querySelector(".ng-container-body .ng-part-footer table"),r=t(this,E).querySelector(".ng-container-right .ng-part-footer table");if(a){const u=o?Array.from(o.querySelectorAll("tfoot tr")):[],p=Array.from(a.querySelectorAll("tfoot tr")),m=r?Array.from(r.querySelectorAll("tfoot tr")):[],S=Math.max(u.length,p.length,m.length);for(let w=0;w<S;w++){const M=[((f=u[w])==null?void 0:f.getBoundingClientRect().height)||0,((g=p[w])==null?void 0:g.getBoundingClientRect().height)||0,((b=m[w])==null?void 0:b.getBoundingClientRect().height)||0],C=Math.max(...M);C>0&&(u[w]&&(u[w].style.height=`${C}px`),p[w]&&(p[w].style.height=`${C}px`),m[w]&&(m[w].style.height=`${C}px`))}}},"#syncRowHeights"));h(this,oe,d(()=>{!t(this,E)||!(t(this,E)instanceof HTMLElement)||(y(this,Z,new ResizeObserver(n=>{for(const e of n){const s=e.target;if(!s.classList.contains("active"))continue;const o=e.contentRect.height;if(o>0){let a=0;const r=s.querySelector(".ng-part-header"),i=s.querySelector(".ng-part-footer");r&&(a+=r.offsetHeight),i&&(a+=i.offsetHeight);const c=Math.max(o-a,100);t(this,lt)!==c&&(y(this,lt,c),t(this,Ht).call(this),t(this,D)!==null&&(t(this,$t).call(this),this.refresh()))}}})),t(this,Z).observe(t(this,E)))},"#initResizeObserver"));h(this,$t,d(()=>{x.log("rowManager.#renderAllContainers"),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const e=t(this,E).querySelector(n);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,ne).call(this,e,n)}),t(this,ae).call(this),t(this,re).call(this)},"#renderAllContainers"));h(this,yt,d(n=>{var g,b;const e=t(this,D);if(!e||e<=0)return;const s=t(this,it).data.length;if(s===0)return;const o=((g=t(this,U).get(".ng-container-body"))==null?void 0:g.length)||1,a=t(this,E).querySelector(".ng-container-body .ng-part-body"),r=Math.max(0,s-Math.floor(a.clientHeight/e)),i=Math.min(r,Math.max(0,Math.floor(n/e)));let c=Math.floor(i*e);const l=t(this,at).firstTr,f=l&&l.dataset.row!==void 0?parseInt(l.dataset.row,10):-1;(b=t(this,at))==null||b.scrollTables.forEach(u=>{u.style.transform=`translate3d(0, ${c}px, 0)`}),f!==i&&[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(u=>{const p=t(this,E).querySelector(u);if(!p)return;const m=p.querySelector(".ng-part-body tbody.bindable-tbody");if(!m)return;Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((w,M)=>{const C=i+Math.floor(M/o);if(C>=s){w.style.display="none";return}const W=t(this,it).data.get(C);w.style.display="",t(this,ie).call(this,w,W,C)})})},"#handleScroll"));h(this,ie,d((n,e,s)=>{n.dataset.row=s,n.data=e,Array.from(n.cells).forEach((o,a)=>{o.dataset.row=s;const r=Array.from(o.children).find(i=>i.tagName.toLowerCase().startsWith("cell-")||typeof i.refresh=="function");r&&typeof r.refresh=="function"&&r.refresh()})},"#bindRowData"));h(this,ae,d(()=>{var c,l,f;x.log("rowManager.#syncHeaderHeights");const n=t(this,E).querySelector(".ng-container-left .ng-part-header table"),e=t(this,E).querySelector(".ng-container-body .ng-part-header table"),s=t(this,E).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const o=n?Array.from(n.querySelectorAll("tr")):[],a=Array.from(e.querySelectorAll("tr")),r=s?Array.from(s.querySelectorAll("tr")):[],i=Math.max(o.length,a.length,r.length);for(let g=0;g<i;g++){const b=[((c=o[g])==null?void 0:c.getBoundingClientRect().height)||0,((l=a[g])==null?void 0:l.getBoundingClientRect().height)||0,((f=r[g])==null?void 0:f.getBoundingClientRect().height)||0],u=Math.max(...b);u>0&&(o[g]&&(o[g].style.height=`${u}px`),a[g]&&(a[g].style.height=`${u}px`),r[g]&&(r[g].style.height=`${u}px`))}},"#syncHeaderHeights"));T(this,"destroy",d(()=>{t(this,Z)&&(t(this,Z).disconnect(),y(this,Z,null))},"destroy"));y(this,it,n.getRootNode().host),y(this,E,n),t(this,oe).call(this)}getRowHeight(){return t(this,D)}templateLength(n=".ng-container-body"){var e;return((e=t(this,U).get(n))==null?void 0:e.length)||1}};it=new WeakMap,E=new WeakMap,at=new WeakMap,U=new WeakMap,D=new WeakMap,Z=new WeakMap,lt=new WeakMap,Lt=new WeakMap,Ve=new WeakMap,Ye=new WeakMap,ee=new WeakMap,Xe=new WeakMap,se=new WeakMap,ne=new WeakMap,It=new WeakMap,Mt=new WeakMap,Ht=new WeakMap,re=new WeakMap,oe=new WeakMap,$t=new WeakMap,yt=new WeakMap,ie=new WeakMap,ae=new WeakMap,d(Ke,"RowManager");let Ce=Ke;const le=class le{static compileAll(n){return Array.isArray(n)?n.map(e=>le.compile(e)):[]}static compile(n){if(!n)return null;const e=d(i=>{i.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 g=`cell-${f}`;const b=l.getAttribute("data-bind"),u=l.getAttribute("data-expr"),p=l.getAttribute("maxbyte"),m=l.getAttribute("type");let S=[];b&&S.push(`data-bind="${b}"`),u&&S.push(`data-expr="${u}"`),p&&S.push(`maxbyte="${p}"`),m&&S.push(`type="${m}"`),l.innerHTML=`<${g} ${S.join(" ")}></${g}>`}),i.querySelectorAll("tbody td, tfoot td").forEach(l=>{l.setAttribute("tabindex","0")})},"processCellTypes"),s=d(i=>{if(!i.querySelector("colgroup")){const c=i.querySelector("tbody tr")||i.querySelector("tr"),l=c?c.querySelectorAll("th, td").length:1,f=document.createElement("colgroup"),g=Math.max(Math.floor(i.clientWidth/l),100);for(let b=0;b<l;b++){const u=document.createElement("col");u.setAttribute("width",g),f.appendChild(u)}i.prepend(f)}if(!i.querySelector("thead")){const c=document.createElement("thead"),l=i.querySelector("colgroup");l?l.after(c):i.prepend(c)}i.classList.add("nine-table-element")},"ensureTableStructure"),o=d((i,c)=>{const l=Array.from(i.querySelectorAll(c+" tr")),f=Array.from(i.querySelectorAll(c+" th,"+c+" td")),g=l.length;if(g===0||f.length===0)return;let b=0;f.forEach(p=>{b+=p.colSpan||1});const u=Array.from(Array(g),()=>Array(b).fill(null));l.forEach(p=>{const m=p.sectionRowIndex;let S=0;p.dataset.subrow=m,Array.from(p.querySelectorAll("th,td")).forEach(w=>{for(let W=0;W<u[m].length;W++)if(u[m][W]===null){S=W;break}const M=w.rowSpan||1,C=w.colSpan||1;for(let W=0;W<M;W++)for(let qt=0;qt<C;qt++)m+W<g&&S+qt<b&&(u[m+W][S+qt]=W===0&&qt===0?"1":"0")})}),l.forEach(p=>{const m=p.sectionRowIndex;Array.from(p.querySelectorAll("th,td")).forEach(S=>{for(let w=0;w<u[m].length;w++)if(u[m][w]==="1"){S.dataset.col=w,u[m][w]="0";break}})})},"resetColIndex"),a=n.cloneNode(!0);return s(a),e(a),o(a,"thead"),o(a,"tbody"),o(a,"tfoot"),Array.from(a.querySelectorAll("colgroup col")).forEach((i,c)=>{const l=i.getAttribute("fixed");l&&a.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach(f=>{f.setAttribute("fixed",l)})}),a}};d(le,"TableCompiler");let ke=le;const Ze=class Ze{constructor(n){h(this,Y);h(this,N);h(this,V,{startRow:-1,startCol:-1,endRow:-1,endCol:-1});T(this,"render",d(()=>{const{startRow:n,startCol:e,endRow:s,endCol:o}=t(this,V);x.log("🎨 [CellSelection.render] Rendering range ->",t(this,V));const a=t(this,N).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body");if(a.forEach(i=>{i.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach(c=>{c.classList.remove("selected","selected-top","selected-bottom","selected-left","selected-right")})}),n<0||e<0){x.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");return}let r=0;a.forEach(i=>{i.querySelectorAll("tbody tr").forEach(c=>{const{matrixRow:l}=Q(this,Y,Zt).call(this,c);l<0||c.querySelectorAll("td, th").forEach(f=>{const g=parseInt(f.dataset.col,10);if(isNaN(g))return;const b=parseInt(f.rowSpan||1,10),u=parseInt(f.colSpan||1,10),p=l+b-1,m=g+u-1;p>=n&&l<=s&&m>=e&&g<=o&&(r++,f.classList.add("selected"),x.log(f,n,e,s,o),l<=n&&f.classList.add("selected-top"),p>=s&&f.classList.add("selected-bottom"),g<=e&&f.classList.add("selected-left"),m>=o&&f.classList.add("selected-right"))})})}),x.log(`✨ [CellSelection.render] Total rendered cells marked: ${r}`)},"render"));y(this,N,n),Q(this,Y,Ss).call(this),t(this,N).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body").forEach(s=>{s.addEventListener("scroll",()=>{t(this,V).startRow>=0&&t(this,V).startCol>=0&&this.render()})}),x.log("🎯 [CellSelection] Initialized")}setRange(n,e,s,o){x.log(`🔍 [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${o}`);let a=Math.min(n,s),r=Math.max(n,s),i=Math.min(e,o),c=Math.max(e,o);const l=t(this,N).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body");let f=!0,g=0;for(;f&&g<5;)f=!1,g++,l.forEach(b=>{b.querySelectorAll("tbody tr").forEach(u=>{if(u.classList.contains("nodata"))return;const{matrixRow:p}=Q(this,Y,Zt).call(this,u);p<0||u.querySelectorAll("td, th").forEach(m=>{const S=parseInt(m.dataset.col,10);if(isNaN(S))return;const w=parseInt(m.rowSpan||1,10),M=parseInt(m.colSpan||1,10),C=p+w-1,W=S+M-1;if(C>=a&&p<=r&&W>=i&&S<=c){const bs=Math.min(a,p),ps=Math.max(r,C),ys=Math.min(i,S),ms=Math.max(c,W);(bs!==a||ps!==r||ys!==i||ms!==c)&&(a=bs,r=ps,i=ys,c=ms,f=!0)}})})});y(this,V,{startRow:a,startCol:i,endRow:r,endCol:c}),x.log("📦 [CellSelection.setRange] Final Range ->",t(this,V)),this.render()}};N=new WeakMap,V=new WeakMap,Y=new WeakSet,Zt=d(function(n){if(!n||n.classList.contains("nodata"))return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const e=parseInt(n.dataset.row,10);if(isNaN(e))return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const s=n.closest("tbody"),a=Array.from(s.querySelectorAll("tr:not(.nodata)")).filter(l=>parseInt(l.dataset.row,10)===e),r=a.indexOf(n),i=a.length>0?a.length:1,c=e*i+(r>=0?r:n.sectionRowIndex%i);return{dataRow:e,subRowIndex:r,matrixRow:c}},"#getMatrixRow"),Ss=d(function(){const n=t(this,N).querySelector(".ng-container-top");if(!n){x.log("❌ [CellSelection] .ng-container-top not found!");return}n.addEventListener("mousedown",e=>{if(e.button!==0)return;const s=e.target.closest("td, th");if(!s||s.dataset.row===void 0||s.dataset.col===void 0||s.closest("tr").classList.contains("nodata"))return;t(this,N).style.userSelect="none",t(this,N).style.webkitUserSelect="none";const o=s.closest("tr"),{matrixRow:a}=Q(this,Y,Zt).call(this,o),r=parseInt(s.dataset.col,10);if(a<0){t(this,N).style.userSelect="",t(this,N).style.webkitUserSelect="";return}x.log(`🖱️ [MouseDown Success] startRow: ${a}, startCol: ${r}`),t(this,N).navigation.currentCell=s;let i=a,c=r;const l=d(g=>{const b=document.elementFromPoint(g.clientX,g.clientY);let u=b==null?void 0:b.closest("td, th");if(!u||!t(this,N).contains(u)){const w=t(this,N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");for(const M of w){const C=M.getBoundingClientRect();if(g.clientX>=C.left&&g.clientX<=C.right&&g.clientY>=C.top&&g.clientY<=C.bottom){u=M;break}}}if(!u||u.dataset.row===void 0||u.dataset.col===void 0||u.closest("tr").classList.contains("nodata"))return;const p=u.closest("tr"),{matrixRow:m}=Q(this,Y,Zt).call(this,p),S=parseInt(u.dataset.col,10);m<0||i===m&&c===S||(i=m,c=S,this.setRange(a,r,m,S))},"onMouseMove"),f=d(()=>{x.log("🖱️ [MouseUp] Drag ended."),t(this,N).style.userSelect="",t(this,N).style.webkitUserSelect="",document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",f)},"onMouseUp");document.addEventListener("mousemove",l),document.addEventListener("mouseup",f)})},"#initEvents"),d(Ze,"CellSelection");let Le=Ze;const Je=class Je{constructor(n){h(this,mt);h(this,B);h(this,ct,null);h(this,Nt,null);h(this,ce,-1);h(this,he,-1);h(this,_t,d(n=>{const e=[];return n.forEach(s=>e.push(...Array.from(s.querySelectorAll("td")))),e.length===0?null:(e.sort((s,o)=>parseInt(s.dataset.col,10)-parseInt(o.dataset.col,10)),e[e.length-1])},"#getMaxColCell"));h(this,Dt,d((n,e)=>{const s=t(this,ht).call(this,n);if(s.length===0)return e+1;let o=e+1;const a=[];s.forEach(r=>a.push(...Array.from(r.querySelectorAll("td")))),a.sort((r,i)=>parseInt(r.dataset.col,10)-parseInt(i.dataset.col,10));for(const r of a){const i=parseInt(r.dataset.col,10),c=parseInt(r.colSpan||1,10);if(e>=i&&e<i+c){o=i+c;break}}return o},"#getNextCol"));h(this,Ot,d((n,e)=>{const s=t(this,ht).call(this,n);if(s.length===0)return Math.max(0,e-1);let o=-1;const a=[];s.forEach(r=>a.push(...Array.from(r.querySelectorAll("td")))),a.sort((r,i)=>parseInt(r.dataset.col,10)-parseInt(i.dataset.col,10));for(const r of a){const i=parseInt(r.dataset.col,10);if(i<e)o=i;else break}return o},"#getPreviousCol"));h(this,ht,d(n=>{const e=t(this,B).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"),s=[];return e.forEach(o=>{const a=Array.from(o.querySelectorAll("tbody tr:not(.nodata)"));for(const r of a){const i=parseInt(r.dataset.row,10),c=a.filter(p=>parseInt(p.dataset.row,10)===i),l=c.length>0?c.length:1,f=c.indexOf(r),g=i*l+(f>=0?f:0);if(g===n){s.push(r);break}const b=Array.from(r.querySelectorAll("td"));let u=!1;for(const p of b){const m=parseInt(p.rowSpan||1,10);if(m>1&&n>=g&&n<g+m){s.push(r),u=!0;break}}if(u)break}}),s},"#findTargetTrsByMatrix"));h(this,de,d((n,e,s,o)=>{const a=t(this,B).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"),r=o!==void 0?o:n*1+e;for(const i of a){const c=Array.from(i.querySelectorAll("tbody tr"));for(const l of c){const f=parseInt(l.dataset.row,10),g=t(this,B).templateLength,b=parseInt(l.dataset.subrow,10),u=f*g+(b>=0?b:0),p=Array.from(l.querySelectorAll("td"));for(const m of p){const S=parseInt(m.dataset.col,10),w=parseInt(m.colSpan||1,10),M=parseInt(m.rowSpan||1,10);if(!isNaN(S)&&s>=S&&s<S+w&&r>=u&&r<u+M&&window.getComputedStyle(m).display!=="none")return m}}}return null},"#getNearElement"));h(this,Ge,d((n,e,s,o)=>{const a=o!==void 0?o:n*1+e,r=Array.from(t(this,B).querySelectorAll(".ng-container-left .ng-part-body tbody tr, .ng-container-body .ng-part-body tbody tr, .ng-container-right .ng-part-body tbody tr"));for(const i of r){const c=parseInt(i.dataset.row,10)||0,l=t(this,B).templateLength||1,f=parseInt(i.dataset.subrowIndex,10)||0,g=c*l+f,b=Array.from(i.querySelectorAll("td"));for(const u of b){const p=parseInt(u.dataset.col,10),m=parseInt(u.colSpan||1,10),S=parseInt(u.rowSpan||1,10);if(!isNaN(p)&&s>=p&&s<p+m&&a>=g&&a<g+S&&window.getComputedStyle(u).display!=="none")return u}}return null},"#getNearElement11"));y(this,B,n),Q(this,mt,As).call(this),x.log("🎯 [CellNavigation] Initialized")}get currentCell(){return t(this,ct)}set currentCell(n){if(!n)return;y(this,ct,n),n.focus({preventScroll:!0}),y(this,Nt,n.closest("tr"));const e=parseInt(n.dataset.row,10),s=parseInt(n.dataset.col,10);if(!isNaN(e)&&!isNaN(s)){y(this,ce,e),y(this,he,s);const o=n.closest("tr"),a=o==null?void 0:o.closest("tbody");if(a){const i=Array.from(a.querySelectorAll("tr:not(.nodata)")).filter(g=>parseInt(g.dataset.row,10)===e),c=i.length>0?i.length:1,l=i.indexOf(o),f=e*c+(l>=0?l:0);t(this,B).selection.setRange(f,s,f,s)}}}moveCell(n){if(!t(this,ct))return;const e=t(this,ct),s=parseInt(e.dataset.row,10),o=parseInt(e.dataset.col,10),a=t(this,B).templateLength,r=parseInt(t(this,Nt).dataset.subrow,10),i=s*a+(r>=0?r:0);let c=i,l=o;switch(n.code){case"Tab":if(n.preventDefault(),n.shiftKey){if(l=t(this,Ot).call(this,i,o),l<0&&i>0){c=i-1;const u=t(this,ht).call(this,c),p=t(this,_t).call(this,u);l=p?parseInt(p.dataset.col,10):0}}else{l=t(this,Dt).call(this,i,o);const u=t(this,ht).call(this,i),p=t(this,_t).call(this,u),m=p?parseInt(p.dataset.col,10)+parseInt(p.colSpan||1,10):0;l>=m&&(c=i+1,l=0)}break;case"ArrowRight":l=t(this,Dt).call(this,i,o);break;case"ArrowLeft":l=t(this,Ot).call(this,i,o);break;case"ArrowDown":n.preventDefault(),c=i+(e.rowSpan||1);break;case"ArrowUp":n.preventDefault(),c=Math.max(0,i-(e.rowSpan||1));break}const f=Math.floor(c/a),g=c%a;x.log("templateLength",a,"matrixRow:",i,"nextMatrixRow",c);let b=t(this,de).call(this,f,g,l,c);x.log(b,f,g,l,c),b&&(this.currentCell=b,Q(this,mt,Rs).call(this,b))}};B=new WeakMap,ct=new WeakMap,Nt=new WeakMap,ce=new WeakMap,he=new WeakMap,mt=new WeakSet,Rs=d(function(n){},"#ensureCellVisible"),_t=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,ht=new WeakMap,de=new WeakMap,Ge=new WeakMap,As=d(function(){t(this,B).addEventListener("keydown",n=>{["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(n.code)&&this.moveCell(n)})},"#initEvents"),d(Je,"CellNavigation");let Ie=Je;const Bt=class Bt extends HTMLElement{constructor(){super();h(this,fe);h(this,dt);h(this,Wt);h(this,zt);h(this,j,{table:null});T(this,"invalidate",d(()=>{x.log("sheet.invalidate()"),t(this,dt).refresh()},"invalidate"));T(this,"generate",d(e=>{if(x.log("sheet.generate()"),!e)return;t(this,j).table=ke.compile(e),t(this,j).tbody={tr:t(this,j).table.querySelectorAll("tbody tr")},t(this,ue).call(this),t(this,ge).call(this);const s=this.querySelector(".ng-container-body .ng-part-header"),o=this.querySelector(".ng-container-body .ng-part-footer"),a=this.querySelector(".ng-nodata-overlay");s&&a&&(a.style.top=`${s.offsetHeight}px`),o&&a&&(a.style.bottom=`${o.offsetHeight}px`),t(this,dt).initialize(),setTimeout(()=>{var r;(r=this.querySelector("nine-table-hscrollbar"))==null||r.refresh()},0)},"generate"));h(this,ue,d(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:o})=>{var a,r,i;(a=this.querySelector(`${s} .ng-part-header`))==null||a.appendChild(t(this,xt).call(this,t(this,j).table,o,"header")),(r=this.querySelector(`${s} .ng-virtual-spacer`))==null||r.before(t(this,xt).call(this,t(this,j).table,o,"body")),(i=this.querySelector(`${s} .ng-part-footer`))==null||i.appendChild(t(this,xt).call(this,t(this,j).table,o,"footer"))})},"#renderSplitContainers"));h(this,ge,d(()=>{["left","right","body"].forEach(e=>{const s=this.querySelector(`.ng-container-${e}`),o=s==null?void 0:s.querySelectorAll("table");if(!s||!o||o.length===0)return;let a=0;o[0].querySelectorAll("col").forEach(r=>{const i=parseInt(r.getAttribute("width"),10);isNaN(i)||(a+=i)}),e==="body"?(s.style.flex="1",o.forEach(r=>{r.style.width=`${a}px`,r.style.minWidth=`${a}px`})):(s.style.flex=`0 0 ${a}px`,s.style.width=`${a}px`,o.forEach(r=>{r.style.width=`${a}px`,r.style.minWidth=`${a}px`}))})},"#updateContainerWidths"));h(this,xt,d((e,s,o)=>{const a=e.cloneNode(!0),r=a.querySelector("thead"),i=a.querySelector("tbody"),c=a.querySelector("tfoot");if(o==="header"){if(i&&i.remove(),c&&c.remove(),e.querySelector("tbody")){const f=document.createElement("tbody");f.className="fixed-tbody",a.appendChild(f)}}else o==="body"?(r&&r.remove(),c&&c.remove(),i&&(i.className="bindable-tbody")):o==="footer"&&(r&&r.remove(),i&&i.remove());return s==="left"?a.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="left"&&l.remove()}):s==="right"?a.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="right"&&l.remove()}):a.querySelectorAll("[fixed=left], [fixed=right]").forEach(l=>{l.remove()}),a},"#createSplitTable"));T(this,"getRowHeight",d(()=>t(this,dt).getRowHeight(),"getRowHeight"));T(this,"scrollToX",d(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollLeft=e)},"scrollToX"));T(this,"scrollToY",d(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollTop=e)},"scrollToY"));h(this,be,d(()=>{t(this,pe).call(this),y(this,Wt,new Le(this)),y(this,zt,new Ie(this))},"#init"));h(this,pe,d(()=>{const e=Bt.SCROLLBAR_SIZE;this.innerHTML=`
|
|
126
|
+
`;const e=d(()=>{const s=t(this,ot).querySelector(".ng-container-body .ng-part-body");if(!s){setTimeout(e,10);return}y(this,k,{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,te).call(this),this.refresh()},"initWhenReady");e()}};rt=new WeakMap,ot=new WeakMap,pt=new WeakMap,k=new WeakMap,Ct=new WeakMap,kt=new WeakMap,te=new WeakMap,d(Ue,"NineTableVScrollBar");let Tt=Ue;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",Tt);const Ke=class Ke{constructor(n){h(this,it);h(this,E);h(this,at);h(this,U,new Map);h(this,D,null);h(this,Z,null);h(this,lt,0);h(this,Lt,40);h(this,Ve,!1);h(this,Ye,!1);h(this,ee,3);h(this,Xe,3);h(this,se,0);T(this,"refresh",d(()=>{var e;x.log("rowManager.refresh");const n=t(this,E).querySelector(".ng-container-body .ng-part-body");n&&(t(this,It).call(this),t(this,Mt).call(this),t(this,yt).call(this,n.scrollTop),(e=t(this,E).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));T(this,"initialize",d(()=>{x.log("rowManager.initialize"),y(this,at,{scrollTables:t(this,E).querySelectorAll(".ng-part-body table"),firstTr:t(this,E).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")}),y(this,D,null),t(this,U).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const i=t(this,E).querySelector(r);if(!i)return;const c=i.querySelector(".ng-part-body table");if(!c)return;const l=c.querySelector("tbody.bindable-tbody");if(!l)return;const g=Array.from(l.querySelectorAll("tr")).map(b=>b.cloneNode(!0));t(this,U).set(r,g)});const n=t(this,E).querySelector(".ng-container-body .ng-part-body"),e=t(this,E).querySelector(".ng-container-left .ng-part-body"),s=t(this,E).querySelector(".ng-container-right .ng-part-body"),o=t(this,E).querySelector(".ng-container-body .ng-part-header"),a=t(this,E).querySelector(".ng-container-body .ng-part-footer");if(n){t(this,It).call(this),t(this,$t).call(this),t(this,Mt).call(this),t(this,yt).call(this,n.scrollTop);let r=!1;y(this,se,n.scrollLeft);const i=d(c=>{var g;if(r)return;r=!0;const l=c.scrollTop,f=c.scrollLeft;n&&n.scrollTop!==l&&(n.scrollTop=l),e&&e.scrollTop!==l&&(e.scrollTop=l),s&&s.scrollTop!==l&&(s.scrollTop=l),o&&o.scrollLeft!==f&&(o.scrollLeft=f),a&&a.scrollLeft!==f&&(a.scrollLeft=f),t(this,yt).call(this,l),(g=t(this,E).querySelector("nine-table-vscrollbar"))==null||g.refresh(),r=!1},"handleContainerScroll");n==null||n.addEventListener("scroll",c=>{i(n)}),[e,s].forEach(c=>{c==null||c.addEventListener("scroll",l=>{if(r)return;r=!0;const f=c.scrollTop;n&&n.scrollTop!==f&&(n.scrollTop=f),r=!1})})}},"initialize"));h(this,ne,d((n,e)=>{x.log("rowManager.#renderRows");const s=t(this,U).get(e);if(!s||s.length===0)return;const o=n.querySelector(".ng-part-body tbody.bindable-tbody");if(!o)return;o.querySelectorAll("tr:not(.nodata)").forEach(i=>i.remove());const a=o.querySelector("tr.nodata"),r=document.createDocumentFragment();for(let i=0;i<t(this,Lt);i++)s.forEach(c=>{r.appendChild(c.cloneNode(!0))});a?a.before(r):o.appendChild(r),e===".ng-container-body"&&(t(this,at).firstTr=o.querySelector("tr:not(.nodata)"))},"#renderRows"));h(this,It,d(()=>{if(t(this,D)!==null&&t(this,D)>0)return t(this,D);const n=t(this,E).querySelector(".ng-container-body .ng-part-body");x.log("rowManager.#measureAndCacheHeight");const e=t(this,U).get(".ng-container-body");if(!e||e.length===0)throw new Error("invalid dom");const s=n.querySelector("tbody.bindable-tbody");if(!s)throw new Error("invalid dom");s.querySelectorAll("tr:not(.nodata)").forEach(b=>b.remove());const o=s.querySelector("tr.nodata"),a=document.createDocumentFragment();e.forEach(b=>{a.appendChild(b.cloneNode(!0))}),o?o.before(a):s.appendChild(a);const r=t(this,E),i=r.style.display,c=r.style.visibility,l=r.style.position;(i==="none"||window.getComputedStyle(r).display==="none")&&(r.style.display="block",r.style.visibility="hidden",r.style.position="absolute");let f=0;const g=s.querySelectorAll("tr");return g.forEach(b=>{let u=b.offsetHeight||b.getBoundingClientRect().height;if(u===0){const p=window.getComputedStyle(b);u=parseFloat(p.height)||parseFloat(p.minHeight)||0}f+=u}),g.forEach(b=>b.remove()),r.style.display=i,r.style.visibility=c,r.style.position=l,f<=0?-1:(y(this,D,f),t(this,Ht).call(this),t(this,D))},"#measureAndCacheHeight"));h(this,Mt,d(()=>{x.log("rowManager.#updateVirtualScrollHeight");const e=(t(this,it).data.get()||[]).length,s=t(this,D),o=e*s;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(a=>{const r=t(this,E).querySelector(a);if(!r)return;const i=r.querySelector(".ng-part-body .ng-virtual-spacer");i&&(i.style.height=`${o}px`)})},"#updateVirtualScrollHeight"));h(this,Ht,d(()=>{if(t(this,lt)>0&&t(this,D)>0){const n=Math.ceil(t(this,lt)/t(this,D));y(this,Lt,n+t(this,ee))}},"#updateRowCount"));h(this,re,d(()=>{var i,c,l,f,g,b;const n=t(this,E).querySelector(".ng-container-left .ng-part-body table"),e=t(this,E).querySelector(".ng-container-body .ng-part-body table"),s=t(this,E).querySelector(".ng-container-right .ng-part-body table");if(e){const u=n?Array.from(n.querySelectorAll("tbody tr")):[],p=Array.from(e.querySelectorAll("tbody tr")),m=s?Array.from(s.querySelectorAll("tbody tr")):[],S=Math.max(u.length,p.length,m.length);for(let w=0;w<S;w++){const M=[((i=u[w])==null?void 0:i.getBoundingClientRect().height)||0,((c=p[w])==null?void 0:c.getBoundingClientRect().height)||0,((l=m[w])==null?void 0:l.getBoundingClientRect().height)||0],C=Math.max(...M);C>0&&(u[w]&&(u[w].style.height=`${C}px`),p[w]&&(p[w].style.height=`${C}px`),m[w]&&(m[w].style.height=`${C}px`))}}const o=t(this,E).querySelector(".ng-container-left .ng-part-footer table"),a=t(this,E).querySelector(".ng-container-body .ng-part-footer table"),r=t(this,E).querySelector(".ng-container-right .ng-part-footer table");if(a){const u=o?Array.from(o.querySelectorAll("tfoot tr")):[],p=Array.from(a.querySelectorAll("tfoot tr")),m=r?Array.from(r.querySelectorAll("tfoot tr")):[],S=Math.max(u.length,p.length,m.length);for(let w=0;w<S;w++){const M=[((f=u[w])==null?void 0:f.getBoundingClientRect().height)||0,((g=p[w])==null?void 0:g.getBoundingClientRect().height)||0,((b=m[w])==null?void 0:b.getBoundingClientRect().height)||0],C=Math.max(...M);C>0&&(u[w]&&(u[w].style.height=`${C}px`),p[w]&&(p[w].style.height=`${C}px`),m[w]&&(m[w].style.height=`${C}px`))}}},"#syncRowHeights"));h(this,oe,d(()=>{!t(this,E)||!(t(this,E)instanceof HTMLElement)||(y(this,Z,new ResizeObserver(n=>{for(const e of n){const s=e.target;if(!s.classList.contains("active"))continue;const o=e.contentRect.height;if(o>0){let a=0;const r=s.querySelector(".ng-part-header"),i=s.querySelector(".ng-part-footer");r&&(a+=r.offsetHeight),i&&(a+=i.offsetHeight);const c=Math.max(o-a,100);t(this,lt)!==c&&(y(this,lt,c),t(this,Ht).call(this),t(this,D)!==null&&(t(this,$t).call(this),this.refresh()))}}})),t(this,Z).observe(t(this,E)))},"#initResizeObserver"));h(this,$t,d(()=>{x.log("rowManager.#renderAllContainers"),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const e=t(this,E).querySelector(n);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,ne).call(this,e,n)}),t(this,ae).call(this),t(this,re).call(this)},"#renderAllContainers"));h(this,yt,d(n=>{var g,b;const e=t(this,D);if(!e||e<=0)return;const s=t(this,it).data.length;if(s===0)return;const o=((g=t(this,U).get(".ng-container-body"))==null?void 0:g.length)||1,a=t(this,E).querySelector(".ng-container-body .ng-part-body"),r=Math.max(0,s-Math.floor(a.clientHeight/e)),i=Math.min(r,Math.max(0,Math.floor(n/e)));let c=Math.floor(i*e);const l=t(this,at).firstTr,f=l&&l.dataset.row!==void 0?parseInt(l.dataset.row,10):-1;(b=t(this,at))==null||b.scrollTables.forEach(u=>{u.style.transform=`translate3d(0, ${c}px, 0)`}),f!==i&&[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(u=>{const p=t(this,E).querySelector(u);if(!p)return;const m=p.querySelector(".ng-part-body tbody.bindable-tbody");if(!m)return;Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((w,M)=>{const C=i+Math.floor(M/o);if(C>=s){w.style.display="none";return}const W=t(this,it).data.get(C);w.style.display="",t(this,ie).call(this,w,W,C)})})},"#handleScroll"));h(this,ie,d((n,e,s)=>{n.dataset.row=s,n.data=e,Array.from(n.cells).forEach((o,a)=>{o.dataset.row=s;const r=Array.from(o.children).find(i=>i.tagName.toLowerCase().startsWith("cell-")||typeof i.refresh=="function");r&&typeof r.refresh=="function"&&r.refresh()})},"#bindRowData"));h(this,ae,d(()=>{var c,l,f;x.log("rowManager.#syncHeaderHeights");const n=t(this,E).querySelector(".ng-container-left .ng-part-header table"),e=t(this,E).querySelector(".ng-container-body .ng-part-header table"),s=t(this,E).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const o=n?Array.from(n.querySelectorAll("tr")):[],a=Array.from(e.querySelectorAll("tr")),r=s?Array.from(s.querySelectorAll("tr")):[],i=Math.max(o.length,a.length,r.length);for(let g=0;g<i;g++){const b=[((c=o[g])==null?void 0:c.getBoundingClientRect().height)||0,((l=a[g])==null?void 0:l.getBoundingClientRect().height)||0,((f=r[g])==null?void 0:f.getBoundingClientRect().height)||0],u=Math.max(...b);u>0&&(o[g]&&(o[g].style.height=`${u}px`),a[g]&&(a[g].style.height=`${u}px`),r[g]&&(r[g].style.height=`${u}px`))}},"#syncHeaderHeights"));T(this,"destroy",d(()=>{t(this,Z)&&(t(this,Z).disconnect(),y(this,Z,null))},"destroy"));y(this,it,n.getRootNode().host),y(this,E,n),t(this,oe).call(this)}getRowHeight(){return t(this,D)}templateLength(n=".ng-container-body"){var e;return((e=t(this,U).get(n))==null?void 0:e.length)||1}};it=new WeakMap,E=new WeakMap,at=new WeakMap,U=new WeakMap,D=new WeakMap,Z=new WeakMap,lt=new WeakMap,Lt=new WeakMap,Ve=new WeakMap,Ye=new WeakMap,ee=new WeakMap,Xe=new WeakMap,se=new WeakMap,ne=new WeakMap,It=new WeakMap,Mt=new WeakMap,Ht=new WeakMap,re=new WeakMap,oe=new WeakMap,$t=new WeakMap,yt=new WeakMap,ie=new WeakMap,ae=new WeakMap,d(Ke,"RowManager");let Ce=Ke;const le=class le{static compileAll(n){return Array.isArray(n)?n.map(e=>le.compile(e)):[]}static compile(n){if(!n)return null;const e=d(i=>{i.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 g=`cell-${f}`;const b=l.getAttribute("data-bind"),u=l.getAttribute("data-expr"),p=l.getAttribute("maxbyte"),m=l.getAttribute("type");let S=[];b&&S.push(`data-bind="${b}"`),u&&S.push(`data-expr="${u}"`),p&&S.push(`maxbyte="${p}"`),m&&S.push(`type="${m}"`),l.innerHTML=`<${g} ${S.join(" ")}></${g}>`}),i.querySelectorAll("tbody td, tfoot td").forEach(l=>{l.setAttribute("tabindex","0")})},"processCellTypes"),s=d(i=>{if(!i.querySelector("colgroup")){const c=i.querySelector("tbody tr")||i.querySelector("tr"),l=c?c.querySelectorAll("th, td").length:1,f=document.createElement("colgroup"),g=Math.max(Math.floor(i.clientWidth/l),100);for(let b=0;b<l;b++){const u=document.createElement("col");u.setAttribute("width",g),f.appendChild(u)}i.prepend(f)}if(!i.querySelector("thead")){const c=document.createElement("thead"),l=i.querySelector("colgroup");l?l.after(c):i.prepend(c)}i.classList.add("nine-table-element")},"ensureTableStructure"),o=d((i,c)=>{const l=Array.from(i.querySelectorAll(c+" tr")),f=Array.from(i.querySelectorAll(c+" th,"+c+" td")),g=l.length;if(g===0||f.length===0)return;let b=0;f.forEach(p=>{b+=p.colSpan||1});const u=Array.from(Array(g),()=>Array(b).fill(null));l.forEach(p=>{const m=p.sectionRowIndex;let S=0;p.dataset.subrow=m,Array.from(p.querySelectorAll("th,td")).forEach(w=>{for(let W=0;W<u[m].length;W++)if(u[m][W]===null){S=W;break}const M=w.rowSpan||1,C=w.colSpan||1;for(let W=0;W<M;W++)for(let qt=0;qt<C;qt++)m+W<g&&S+qt<b&&(u[m+W][S+qt]=W===0&&qt===0?"1":"0")})}),l.forEach(p=>{const m=p.sectionRowIndex;Array.from(p.querySelectorAll("th,td")).forEach(S=>{for(let w=0;w<u[m].length;w++)if(u[m][w]==="1"){S.dataset.col=w,u[m][w]="0";break}})})},"resetColIndex"),a=n.cloneNode(!0);return s(a),e(a),o(a,"thead"),o(a,"tbody"),o(a,"tfoot"),Array.from(a.querySelectorAll("colgroup col")).forEach((i,c)=>{const l=i.getAttribute("fixed");l&&a.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach(f=>{f.setAttribute("fixed",l)})}),a}};d(le,"TableCompiler");let ke=le;const Ze=class Ze{constructor(n){h(this,Y);h(this,N);h(this,V,{startRow:-1,startCol:-1,endRow:-1,endCol:-1});T(this,"render",d(()=>{const{startRow:n,startCol:e,endRow:s,endCol:o}=t(this,V);x.log("🎨 [CellSelection.render] Rendering range ->",t(this,V));const a=t(this,N).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body");if(a.forEach(i=>{i.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach(c=>{c.classList.remove("selected","selected-top","selected-bottom","selected-left","selected-right")})}),n<0||e<0){x.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");return}let r=0;a.forEach(i=>{i.querySelectorAll("tbody tr").forEach(c=>{const{matrixRow:l}=Q(this,Y,Zt).call(this,c);l<0||c.querySelectorAll("td, th").forEach(f=>{const g=parseInt(f.dataset.col,10);if(isNaN(g))return;const b=parseInt(f.rowSpan||1,10),u=parseInt(f.colSpan||1,10),p=l+b-1,m=g+u-1;p>=n&&l<=s&&m>=e&&g<=o&&(r++,f.classList.add("selected"),x.log(f,n,e,s,o),l<=n&&f.classList.add("selected-top"),p>=s&&f.classList.add("selected-bottom"),g<=e&&f.classList.add("selected-left"),m>=o&&f.classList.add("selected-right"))})})}),x.log(`✨ [CellSelection.render] Total rendered cells marked: ${r}`)},"render"));y(this,N,n),Q(this,Y,Ss).call(this),t(this,N).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body").forEach(s=>{s.addEventListener("scroll",()=>{t(this,V).startRow>=0&&t(this,V).startCol>=0&&this.render()})}),x.log("🎯 [CellSelection] Initialized")}setRange(n,e,s,o){x.log(`🔍 [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${o}`);let a=Math.min(n,s),r=Math.max(n,s),i=Math.min(e,o),c=Math.max(e,o);const l=t(this,N).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body");let f=!0,g=0;for(;f&&g<5;)f=!1,g++,l.forEach(b=>{b.querySelectorAll("tbody tr").forEach(u=>{if(u.classList.contains("nodata"))return;const{matrixRow:p}=Q(this,Y,Zt).call(this,u);p<0||u.querySelectorAll("td, th").forEach(m=>{const S=parseInt(m.dataset.col,10);if(isNaN(S))return;const w=parseInt(m.rowSpan||1,10),M=parseInt(m.colSpan||1,10),C=p+w-1,W=S+M-1;if(C>=a&&p<=r&&W>=i&&S<=c){const bs=Math.min(a,p),ps=Math.max(r,C),ys=Math.min(i,S),ms=Math.max(c,W);(bs!==a||ps!==r||ys!==i||ms!==c)&&(a=bs,r=ps,i=ys,c=ms,f=!0)}})})});y(this,V,{startRow:a,startCol:i,endRow:r,endCol:c}),x.log("📦 [CellSelection.setRange] Final Range ->",t(this,V)),this.render()}};N=new WeakMap,V=new WeakMap,Y=new WeakSet,Zt=d(function(n){if(!n||n.classList.contains("nodata"))return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const e=parseInt(n.dataset.row,10);if(isNaN(e))return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const s=n.closest("tbody"),a=Array.from(s.querySelectorAll("tr:not(.nodata)")).filter(l=>parseInt(l.dataset.row,10)===e),r=a.indexOf(n),i=a.length>0?a.length:1,c=e*i+(r>=0?r:n.sectionRowIndex%i);return{dataRow:e,subRowIndex:r,matrixRow:c}},"#getMatrixRow"),Ss=d(function(){const n=t(this,N).querySelector(".ng-container-top");if(!n){x.log("❌ [CellSelection] .ng-container-top not found!");return}n.addEventListener("mousedown",e=>{if(e.button!==0)return;const s=e.target.closest("td, th");if(!s||s.dataset.row===void 0||s.dataset.col===void 0||s.closest("tr").classList.contains("nodata"))return;t(this,N).style.userSelect="none",t(this,N).style.webkitUserSelect="none";const o=s.closest("tr"),{matrixRow:a}=Q(this,Y,Zt).call(this,o),r=parseInt(s.dataset.col,10);if(a<0){t(this,N).style.userSelect="",t(this,N).style.webkitUserSelect="";return}x.log(`🖱️ [MouseDown Success] startRow: ${a}, startCol: ${r}`),t(this,N).navigation.currentCell=s;let i=a,c=r;const l=d(g=>{const b=document.elementFromPoint(g.clientX,g.clientY);let u=b==null?void 0:b.closest("td, th");if(!u||!t(this,N).contains(u)){const w=t(this,N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");for(const M of w){const C=M.getBoundingClientRect();if(g.clientX>=C.left&&g.clientX<=C.right&&g.clientY>=C.top&&g.clientY<=C.bottom){u=M;break}}}if(!u||u.dataset.row===void 0||u.dataset.col===void 0||u.closest("tr").classList.contains("nodata"))return;const p=u.closest("tr"),{matrixRow:m}=Q(this,Y,Zt).call(this,p),S=parseInt(u.dataset.col,10);m<0||i===m&&c===S||(i=m,c=S,this.setRange(a,r,m,S))},"onMouseMove"),f=d(()=>{x.log("🖱️ [MouseUp] Drag ended."),t(this,N).style.userSelect="",t(this,N).style.webkitUserSelect="",document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",f)},"onMouseUp");document.addEventListener("mousemove",l),document.addEventListener("mouseup",f)})},"#initEvents"),d(Ze,"CellSelection");let Le=Ze;const Je=class Je{constructor(n){h(this,mt);h(this,B);h(this,ct,null);h(this,Nt,null);h(this,ce,-1);h(this,he,-1);h(this,_t,d(n=>{const e=[];return n.forEach(s=>e.push(...Array.from(s.querySelectorAll("td")))),e.length===0?null:(e.sort((s,o)=>parseInt(s.dataset.col,10)-parseInt(o.dataset.col,10)),e[e.length-1])},"#getMaxColCell"));h(this,Dt,d((n,e)=>{const s=t(this,ht).call(this,n);if(s.length===0)return e+1;let o=e+1;const a=[];s.forEach(r=>a.push(...Array.from(r.querySelectorAll("td")))),a.sort((r,i)=>parseInt(r.dataset.col,10)-parseInt(i.dataset.col,10));for(const r of a){const i=parseInt(r.dataset.col,10),c=parseInt(r.colSpan||1,10);if(e>=i&&e<i+c){o=i+c;break}}return o},"#getNextCol"));h(this,Ot,d((n,e)=>{const s=t(this,ht).call(this,n);if(s.length===0)return Math.max(0,e-1);let o=-1;const a=[];s.forEach(r=>a.push(...Array.from(r.querySelectorAll("td")))),a.sort((r,i)=>parseInt(r.dataset.col,10)-parseInt(i.dataset.col,10));for(const r of a){const i=parseInt(r.dataset.col,10);if(i<e)o=i;else break}return o},"#getPreviousCol"));h(this,ht,d(n=>{const e=t(this,B).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"),s=[];return e.forEach(o=>{const a=Array.from(o.querySelectorAll("tbody tr:not(.nodata)"));for(const r of a){const i=parseInt(r.dataset.row,10),c=a.filter(p=>parseInt(p.dataset.row,10)===i),l=c.length>0?c.length:1,f=c.indexOf(r),g=i*l+(f>=0?f:0);if(g===n){s.push(r);break}const b=Array.from(r.querySelectorAll("td"));let u=!1;for(const p of b){const m=parseInt(p.rowSpan||1,10);if(m>1&&n>=g&&n<g+m){s.push(r),u=!0;break}}if(u)break}}),s},"#findTargetTrsByMatrix"));h(this,Ge,d((n,e,s,o)=>{const a=t(this,B).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"),r=o!==void 0?o:n*1+e;for(const i of a){const c=Array.from(i.querySelectorAll("tbody tr"));for(const l of c){const f=parseInt(l.dataset.row,10),g=t(this,B).templateLength,b=parseInt(l.dataset.subrow,10),u=f*g+(b>=0?b:0),p=Array.from(l.querySelectorAll("td"));for(const m of p){const S=parseInt(m.dataset.col,10),w=parseInt(m.colSpan||1,10),M=parseInt(m.rowSpan||1,10);if(!isNaN(S)&&s>=S&&s<S+w&&r>=u&&r<u+M&&window.getComputedStyle(m).display!=="none")return m}}}return null},"#getNearElement_BAK"));h(this,de,d((n,e,s,o)=>{const a=o!==void 0?o:n*1+e,r=Array.from(t(this,B).querySelectorAll(".ng-part-body tbody tr"));for(const i of r){const c=parseInt(i.dataset.row,10),l=t(this,B).templateLength,f=parseInt(i.dataset.subrow,10),g=c*l+(f>=0?f:0),b=Array.from(i.querySelectorAll("td"));for(const u of b){const p=parseInt(u.dataset.col,10),m=parseInt(u.colSpan||1,10),S=parseInt(u.rowSpan||1,10);if(!isNaN(p)&&s>=p&&s<p+m&&a>=g&&a<g+S&&window.getComputedStyle(u).display!=="none")return u}}return null},"#getNearElement"));y(this,B,n),Q(this,mt,As).call(this),x.log("🎯 [CellNavigation] Initialized")}get currentCell(){return t(this,ct)}set currentCell(n){if(!n)return;y(this,ct,n),n.focus({preventScroll:!0}),y(this,Nt,n.closest("tr"));const e=parseInt(n.dataset.row,10),s=parseInt(n.dataset.col,10);if(!isNaN(e)&&!isNaN(s)){y(this,ce,e),y(this,he,s);const o=n.closest("tr"),a=o==null?void 0:o.closest("tbody");if(a){const i=Array.from(a.querySelectorAll("tr:not(.nodata)")).filter(g=>parseInt(g.dataset.row,10)===e),c=i.length>0?i.length:1,l=i.indexOf(o),f=e*c+(l>=0?l:0);t(this,B).selection.setRange(f,s,f,s)}}}moveCell(n){if(!t(this,ct))return;const e=t(this,ct),s=parseInt(e.dataset.row,10),o=parseInt(e.dataset.col,10),a=t(this,B).templateLength,r=parseInt(t(this,Nt).dataset.subrow,10),i=s*a+(r>=0?r:0);let c=i,l=o;switch(n.code){case"Tab":if(n.preventDefault(),n.shiftKey){if(l=t(this,Ot).call(this,i,o),l<0&&i>0){c=i-1;const u=t(this,ht).call(this,c),p=t(this,_t).call(this,u);l=p?parseInt(p.dataset.col,10):0}}else{l=t(this,Dt).call(this,i,o);const u=t(this,ht).call(this,i),p=t(this,_t).call(this,u),m=p?parseInt(p.dataset.col,10)+parseInt(p.colSpan||1,10):0;l>=m&&(c=i+1,l=0)}break;case"ArrowRight":l=t(this,Dt).call(this,i,o);break;case"ArrowLeft":l=t(this,Ot).call(this,i,o);break;case"ArrowDown":n.preventDefault(),c=i+(e.rowSpan||1);break;case"ArrowUp":n.preventDefault(),c=Math.max(0,i-(e.rowSpan||1));break}const f=Math.floor(c/a),g=c%a;x.log("templateLength",a,"matrixRow:",i,"nextMatrixRow",c);let b=t(this,de).call(this,f,g,l,c);x.log(b,f,g,l,c),b&&(this.currentCell=b,Q(this,mt,Rs).call(this,b))}};B=new WeakMap,ct=new WeakMap,Nt=new WeakMap,ce=new WeakMap,he=new WeakMap,mt=new WeakSet,Rs=d(function(n){},"#ensureCellVisible"),_t=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,ht=new WeakMap,Ge=new WeakMap,de=new WeakMap,As=d(function(){t(this,B).addEventListener("keydown",n=>{["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(n.code)&&this.moveCell(n)})},"#initEvents"),d(Je,"CellNavigation");let Ie=Je;const Bt=class Bt extends HTMLElement{constructor(){super();h(this,fe);h(this,dt);h(this,Wt);h(this,zt);h(this,j,{table:null});T(this,"invalidate",d(()=>{x.log("sheet.invalidate()"),t(this,dt).refresh()},"invalidate"));T(this,"generate",d(e=>{if(x.log("sheet.generate()"),!e)return;t(this,j).table=ke.compile(e),t(this,j).tbody={tr:t(this,j).table.querySelectorAll("tbody tr")},t(this,ue).call(this),t(this,ge).call(this);const s=this.querySelector(".ng-container-body .ng-part-header"),o=this.querySelector(".ng-container-body .ng-part-footer"),a=this.querySelector(".ng-nodata-overlay");s&&a&&(a.style.top=`${s.offsetHeight}px`),o&&a&&(a.style.bottom=`${o.offsetHeight}px`),t(this,dt).initialize(),setTimeout(()=>{var r;(r=this.querySelector("nine-table-hscrollbar"))==null||r.refresh()},0)},"generate"));h(this,ue,d(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:o})=>{var a,r,i;(a=this.querySelector(`${s} .ng-part-header`))==null||a.appendChild(t(this,xt).call(this,t(this,j).table,o,"header")),(r=this.querySelector(`${s} .ng-virtual-spacer`))==null||r.before(t(this,xt).call(this,t(this,j).table,o,"body")),(i=this.querySelector(`${s} .ng-part-footer`))==null||i.appendChild(t(this,xt).call(this,t(this,j).table,o,"footer"))})},"#renderSplitContainers"));h(this,ge,d(()=>{["left","right","body"].forEach(e=>{const s=this.querySelector(`.ng-container-${e}`),o=s==null?void 0:s.querySelectorAll("table");if(!s||!o||o.length===0)return;let a=0;o[0].querySelectorAll("col").forEach(r=>{const i=parseInt(r.getAttribute("width"),10);isNaN(i)||(a+=i)}),e==="body"?(s.style.flex="1",o.forEach(r=>{r.style.width=`${a}px`,r.style.minWidth=`${a}px`})):(s.style.flex=`0 0 ${a}px`,s.style.width=`${a}px`,o.forEach(r=>{r.style.width=`${a}px`,r.style.minWidth=`${a}px`}))})},"#updateContainerWidths"));h(this,xt,d((e,s,o)=>{const a=e.cloneNode(!0),r=a.querySelector("thead"),i=a.querySelector("tbody"),c=a.querySelector("tfoot");if(o==="header"){if(i&&i.remove(),c&&c.remove(),e.querySelector("tbody")){const f=document.createElement("tbody");f.className="fixed-tbody",a.appendChild(f)}}else o==="body"?(r&&r.remove(),c&&c.remove(),i&&(i.className="bindable-tbody")):o==="footer"&&(r&&r.remove(),i&&i.remove());return s==="left"?a.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="left"&&l.remove()}):s==="right"?a.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="right"&&l.remove()}):a.querySelectorAll("[fixed=left], [fixed=right]").forEach(l=>{l.remove()}),a},"#createSplitTable"));T(this,"getRowHeight",d(()=>t(this,dt).getRowHeight(),"getRowHeight"));T(this,"scrollToX",d(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollLeft=e)},"scrollToX"));T(this,"scrollToY",d(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollTop=e)},"scrollToY"));h(this,be,d(()=>{t(this,pe).call(this),y(this,Wt,new Le(this)),y(this,zt,new Ie(this))},"#init"));h(this,pe,d(()=>{const e=Bt.SCROLLBAR_SIZE;this.innerHTML=`
|
|
127
127
|
<style>
|
|
128
128
|
nine-table-sheet {
|
|
129
129
|
display: none;
|