@ninebone/table 0.0.302 → 0.0.304

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.
@@ -1,4 +1,4 @@
1
- (function(y,p){typeof exports=="object"&&typeof module<"u"?p(require("@ninebone/util")):typeof define=="function"&&define.amd?define(["@ninebone/util"],p):(y=typeof globalThis<"u"?globalThis:y||self,p(y.NineboneUtil))})(this,function(y){"use strict";var Qt=Object.defineProperty;var te=y=>{throw TypeError(y)};var ne=(y,p,v)=>p in y?Qt(y,p,{enumerable:!0,configurable:!0,writable:!0,value:v}):y[p]=v;var c=(y,p)=>Qt(y,"name",{value:p,configurable:!0});var R=(y,p,v)=>ne(y,typeof p!="symbol"?p+"":p,v),ee=(y,p,v)=>p.has(y)||te("Cannot "+v);var t=(y,p,v)=>(ee(y,p,"read from private field"),v?v.call(y):p.get(y)),h=(y,p,v)=>p.has(y)?te("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(y):p.set(y,v),g=(y,p,v,I)=>(ee(y,p,"write to private field"),I?I.call(y,v):p.set(y,v),v);var ie=(y,p,v,I)=>({set _(et){g(y,p,et,v)},get _(){return t(y,p,I)}});var C,W,m,B,N,V,ft,Y,ut,X,O,T,it,nt,bt,gt,Z,w,$,k,z,U,j,pt,yt,mt,st,xt,vt,ot,rt,wt,G,J,St,Et,Rt,Tt,kt,At,ct,A,qt,at,Lt,D,K,q,S,L,Q,Ht,P,Ct,ht,Mt,_t,tt,F,$t;const Vt=class Vt extends y.trace.constructor{constructor(){super(),this.init("nine-table","green")}};c(Vt,"Trace");let p=Vt;const v=new p,Yt=class Yt extends HTMLElement{constructor(){super();h(this,C);h(this,W,!1);h(this,m);h(this,B);h(this,N);h(this,V);h(this,ft,c(()=>{if(!t(this,C))return;const e=t(this,C).querySelector(".ng-container-body");e&&(g(this,V,new ResizeObserver(()=>{this.refresh()})),t(this,V).observe(e))},"#observeResize"));R(this,"refresh",c(()=>{if(!t(this,C)||!t(this,m)||t(this,W))return;const e=t(this,m).container,i=e.querySelector("table");if(!i)return;const s=t(this,m).track,o=t(this,m).thumb,r=t(this,C).querySelector(".ng-container-bottom"),l=e.clientWidth,a=i.scrollWidth;if(l!==0&&a>l)r&&(r.style.display="flex");else{r&&(r.style.display="none");return}const d=s.clientWidth;if(d<=0)return;const u=Math.max(Math.min(d*(l/a),d),20);o.style.width=`${u}px`;const f=e.scrollLeft,b=a-l;let x=0;b>0&&(x=parseInt(f/b*(d-u),10)),x<0&&(x=0);const E=d-u;x>E&&(x=E),o.style.left=`${x}px`,v.log(x),t(this,m).left.disabled=x===0,t(this,m).right.disabled=x>=E-1},"refresh"));h(this,Y,c(e=>{if(!t(this,m))return!1;const i=t(this,m).container,s=i.querySelector("table");if(!s)return!1;const o=t(this,m).track.getBoundingClientRect(),r=t(this,m).thumb.clientWidth;let l=e;l<0&&(l=0);const a=o.width-r;l>a&&(l=a),l=parseInt(l,10),t(this,m).thumb.style.left=`${l}px`,t(this,m).left.disabled=l===0,t(this,m).right.disabled=l>=a-1;const d=i.clientWidth,f=s.scrollWidth-d;return a>0&&f>0&&(i.scrollLeft=l/a*f),l>0&&l<a-1},"#thumbMoveTo"));h(this,ut,c(()=>{const e=c(s=>{clearInterval(t(this,B)),clearInterval(t(this,N));const o=parseInt(t(this,m).thumb.style.left||0,10);t(this,Y).call(this,o+s),g(this,B,setInterval(()=>{clearInterval(t(this,B)),g(this,N,setInterval(()=>{const r=parseInt(t(this,m).thumb.style.left||0,10);t(this,Y).call(this,r+s)||clearInterval(t(this,N))},50))},500))},"delayScroll"),i=c(()=>{clearInterval(t(this,B)),clearInterval(t(this,N))},"clearTimer");["mouseup","mouseleave","touchend"].forEach(s=>{t(this,m).left.addEventListener(s,i),t(this,m).right.addEventListener(s,i),t(this,m).track.addEventListener(s,i)}),t(this,m).left.addEventListener("mousedown",s=>{s.button===0&&e(-20)}),t(this,m).right.addEventListener("mousedown",s=>{s.button===0&&e(20)}),t(this,m).left.addEventListener("touchstart",()=>e(-20)),t(this,m).right.addEventListener("touchstart",()=>e(20)),t(this,m).track.addEventListener("mousedown",s=>{if(s.button!==0)return;s.preventDefault();const o=t(this,m).track.getBoundingClientRect(),r=t(this,m).thumb.clientWidth;t(this,Y).call(this,s.clientX-o.left-r/2)}),t(this,m).thumb.addEventListener("mousedown",s=>{if(s.button!==0)return;s.stopPropagation(),s.preventDefault(),g(this,W,!0),this.shiftX=s.clientX-t(this,m).thumb.getBoundingClientRect().left;const o=c(l=>{if(!t(this,W))return;const a=t(this,m).track.getBoundingClientRect();t(this,Y).call(this,l.clientX-a.left-this.shiftX)},"onMouseMove"),r=c(()=>{g(this,W,!1),i(),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.refresh()},"onMouseUp");document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)})},"#init"))}connectedCallback(){if(g(this,C,this.closest("nine-table-sheet")||this.getRootNode().host),!t(this,C))return;this.innerHTML=`
1
+ (function(y,p){typeof exports=="object"&&typeof module<"u"?p(require("@ninebone/util")):typeof define=="function"&&define.amd?define(["@ninebone/util"],p):(y=typeof globalThis<"u"?globalThis:y||self,p(y.NineboneUtil))})(this,function(y){"use strict";var ee=Object.defineProperty;var ie=y=>{throw TypeError(y)};var oe=(y,p,w)=>p in y?ee(y,p,{enumerable:!0,configurable:!0,writable:!0,value:w}):y[p]=w;var a=(y,p)=>ee(y,"name",{value:p,configurable:!0});var R=(y,p,w)=>oe(y,typeof p!="symbol"?p+"":p,w),se=(y,p,w)=>p.has(y)||ie("Cannot "+w);var t=(y,p,w)=>(se(y,p,"read from private field"),w?w.call(y):p.get(y)),d=(y,p,w)=>p.has(y)?ie("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(y):p.set(y,w),b=(y,p,w,I)=>(se(y,p,"write to private field"),I?I.call(y,w):p.set(y,w),w);var ne=(y,p,w,I)=>({set _(it){b(y,p,it,w)},get _(){return t(y,p,I)}});var M,W,m,B,N,Y,gt,V,bt,X,O,T,st,nt,pt,yt,Z,v,$,k,z,U,j,mt,xt,ot,rt,vt,wt,lt,G,St,J,Q,Et,Rt,Tt,kt,At,qt,ct,A,Lt,ht,Ht,D,K,q,S,L,tt,Ct,P,Mt,dt,_t,$t,et,F,It;const Vt=class Vt extends y.trace.constructor{constructor(){super(),this.init("nine-table","green")}};a(Vt,"Trace");let p=Vt;const w=new p,Xt=class Xt extends HTMLElement{constructor(){super();d(this,M);d(this,W,!1);d(this,m);d(this,B);d(this,N);d(this,Y);d(this,gt,a(()=>{if(!t(this,M))return;const e=t(this,M).querySelector(".ng-container-body");e&&(b(this,Y,new ResizeObserver(()=>{this.refresh()})),t(this,Y).observe(e))},"#observeResize"));R(this,"refresh",a(()=>{if(!t(this,M)||!t(this,m)||t(this,W))return;const e=t(this,m).container,i=e.querySelector("table");if(!i)return;const n=t(this,m).track,o=t(this,m).thumb,r=t(this,M).querySelector(".ng-container-bottom"),l=e.clientWidth,c=i.scrollWidth;if(l!==0&&c>l)r&&(r.style.display="flex");else{r&&(r.style.display="none");return}const h=n.clientWidth;if(h<=0)return;const u=Math.max(Math.min(h*(l/c),h),20);o.style.width=`${u}px`;const f=e.scrollLeft,g=c-l;let x=0;g>0&&(x=parseInt(f/g*(h-u),10)),x<0&&(x=0);const E=h-u;x>E&&(x=E),o.style.left=`${x}px`,w.log(x),t(this,m).left.disabled=x===0,t(this,m).right.disabled=x>=E-1},"refresh"));d(this,V,a(e=>{if(!t(this,m))return!1;const i=t(this,m).container,n=i.querySelector("table");if(!n)return!1;const o=t(this,m).track.getBoundingClientRect(),r=t(this,m).thumb.clientWidth;let l=e;l<0&&(l=0);const c=o.width-r;l>c&&(l=c),l=parseInt(l,10),t(this,m).thumb.style.left=`${l}px`,t(this,m).left.disabled=l===0,t(this,m).right.disabled=l>=c-1;const h=i.clientWidth,f=n.scrollWidth-h;return c>0&&f>0&&(i.scrollLeft=l/c*f),l>0&&l<c-1},"#thumbMoveTo"));d(this,bt,a(()=>{const e=a(n=>{clearInterval(t(this,B)),clearInterval(t(this,N));const o=parseInt(t(this,m).thumb.style.left||0,10);t(this,V).call(this,o+n),b(this,B,setInterval(()=>{clearInterval(t(this,B)),b(this,N,setInterval(()=>{const r=parseInt(t(this,m).thumb.style.left||0,10);t(this,V).call(this,r+n)||clearInterval(t(this,N))},50))},500))},"delayScroll"),i=a(()=>{clearInterval(t(this,B)),clearInterval(t(this,N))},"clearTimer");["mouseup","mouseleave","touchend"].forEach(n=>{t(this,m).left.addEventListener(n,i),t(this,m).right.addEventListener(n,i),t(this,m).track.addEventListener(n,i)}),t(this,m).left.addEventListener("mousedown",n=>{n.button===0&&e(-20)}),t(this,m).right.addEventListener("mousedown",n=>{n.button===0&&e(20)}),t(this,m).left.addEventListener("touchstart",()=>e(-20)),t(this,m).right.addEventListener("touchstart",()=>e(20)),t(this,m).track.addEventListener("mousedown",n=>{if(n.button!==0)return;n.preventDefault();const o=t(this,m).track.getBoundingClientRect(),r=t(this,m).thumb.clientWidth;t(this,V).call(this,n.clientX-o.left-r/2)}),t(this,m).thumb.addEventListener("mousedown",n=>{if(n.button!==0)return;n.stopPropagation(),n.preventDefault(),b(this,W,!0),this.shiftX=n.clientX-t(this,m).thumb.getBoundingClientRect().left;const o=a(l=>{if(!t(this,W))return;const c=t(this,m).track.getBoundingClientRect();t(this,V).call(this,l.clientX-c.left-this.shiftX)},"onMouseMove"),r=a(()=>{b(this,W,!1),i(),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.refresh()},"onMouseUp");document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)})},"#init"))}connectedCallback(){if(b(this,M,this.closest("nine-table-sheet")||this.getRootNode().host),!t(this,M))return;this.innerHTML=`
2
2
  <style>
3
3
  nine-table-hscrollbar {
4
4
  display: flex;
@@ -60,7 +60,7 @@
60
60
  <button class='ng-scroll-left' disabled><div class='ng-scroll-icon'></div></button>
61
61
  <div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
62
62
  <button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
63
- `;const e=c(()=>{const i=t(this,C).querySelector(".ng-container-body");if(!i){setTimeout(e,10);return}g(this,m,{container:i,track:this.querySelector(".ng-scroll-track"),thumb:this.querySelector(".ng-scroll-thumb"),left:this.querySelector(".ng-scroll-left"),right:this.querySelector(".ng-scroll-right")}),i.addEventListener("scroll",()=>{t(this,W)||this.refresh()}),t(this,ut).call(this),t(this,ft).call(this),this.refresh()},"initWhenReady");e()}disconnectedCallback(){t(this,V)&&t(this,V).disconnect()}};C=new WeakMap,W=new WeakMap,m=new WeakMap,B=new WeakMap,N=new WeakMap,V=new WeakMap,ft=new WeakMap,Y=new WeakMap,ut=new WeakMap,c(Yt,"NineTableHScrollBar");let I=Yt;customElements.get("nine-table-hscrollbar")||customElements.define("nine-table-hscrollbar",I);const Xt=class Xt extends HTMLElement{constructor(){super();h(this,X);h(this,O,!1);h(this,T);h(this,it,0);h(this,nt,0);R(this,"refresh",c(()=>{if(!t(this,X)||!t(this,T)||t(this,O))return;const e=t(this,T).container,i=e.querySelector("table");if(!i)return;const s=t(this,T).track,o=t(this,T).thumb,r=e.clientHeight,l=i.scrollHeight;if(l<=r){o.style.display="none",t(this,T).top.disabled=!0,t(this,T).bottom.disabled=!0;return}else o.style.display="block";const a=s.clientHeight;if(a<=0)return;const d=Math.max(Math.min(a*(r/l),a),20);o.style.height=`${d}px`;const u=e.scrollTop,f=l-r;let b=0;f>0&&(b=u/f*(a-d));const x=a-d;b<0&&(b=0),b>x&&(b=x),o.style.top=`${b}px`,t(this,T).top.disabled=u<=0,t(this,T).bottom.disabled=u>=f-1},"refresh"));h(this,bt,c(()=>{const e=t(this,T).container;e.addEventListener("scroll",()=>{t(this,O)||this.refresh()}),t(this,T).thumb.addEventListener("mousedown",i=>{if(i.button!==0)return;i.stopPropagation(),i.preventDefault(),g(this,O,!0),g(this,it,i.clientY),g(this,nt,e.scrollTop);const s=c(r=>{if(!t(this,O))return;const l=t(this,T).track.getBoundingClientRect(),a=t(this,T).thumb.clientHeight,u=l.height-a,f=r.clientY-t(this,it),b=e.clientHeight,E=table.scrollHeight-b;if(u>0&&E>0){const _=f/u*E;e.scrollTop=t(this,nt)+_}this.refresh()},"onMouseMove"),o=c(()=>{g(this,O,!1),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",o),this.refresh()},"onMouseUp");document.addEventListener("mousemove",s),document.addEventListener("mouseup",o)}),t(this,T).track.addEventListener("mousedown",i=>{if(i.button!==0||i.target===t(this,T).thumb)return;const s=t(this,T).track.getBoundingClientRect(),o=t(this,T).thumb.clientHeight,r=i.clientY-s.top-o/2,a=s.height-o,d=e.clientHeight,f=e.querySelector("table").scrollHeight-d;if(a>0&&f>0){const b=Math.max(0,Math.min(1,r/a));e.scrollTop=b*f}this.refresh()}),t(this,T).top.addEventListener("click",()=>{e.scrollTop-=40}),t(this,T).bottom.addEventListener("click",()=>{e.scrollTop+=40})},"#init"))}connectedCallback(){if(g(this,X,this.closest("nine-table-sheet")||this.getRootNode().host),!t(this,X))return;this.innerHTML=`
63
+ `;const e=a(()=>{const i=t(this,M).querySelector(".ng-container-body");if(!i){setTimeout(e,10);return}b(this,m,{container:i,track:this.querySelector(".ng-scroll-track"),thumb:this.querySelector(".ng-scroll-thumb"),left:this.querySelector(".ng-scroll-left"),right:this.querySelector(".ng-scroll-right")}),i.addEventListener("scroll",()=>{t(this,W)||this.refresh()}),t(this,bt).call(this),t(this,gt).call(this),this.refresh()},"initWhenReady");e()}disconnectedCallback(){t(this,Y)&&t(this,Y).disconnect()}};M=new WeakMap,W=new WeakMap,m=new WeakMap,B=new WeakMap,N=new WeakMap,Y=new WeakMap,gt=new WeakMap,V=new WeakMap,bt=new WeakMap,a(Xt,"NineTableHScrollBar");let I=Xt;customElements.get("nine-table-hscrollbar")||customElements.define("nine-table-hscrollbar",I);const Ut=class Ut extends HTMLElement{constructor(){super();d(this,X);d(this,O,!1);d(this,T);d(this,st,0);d(this,nt,0);R(this,"refresh",a(()=>{if(!t(this,X)||!t(this,T)||t(this,O))return;const e=t(this,T).container,i=e.querySelector("table");if(!i)return;const n=t(this,T).track,o=t(this,T).thumb,r=e.clientHeight,l=i.scrollHeight;if(l<=r){o.style.display="none",t(this,T).top.disabled=!0,t(this,T).bottom.disabled=!0;return}else o.style.display="block";const c=n.clientHeight;if(c<=0)return;const h=Math.max(Math.min(c*(r/l),c),20);o.style.height=`${h}px`;const u=e.scrollTop,f=l-r;let g=0;f>0&&(g=u/f*(c-h));const x=c-h;g<0&&(g=0),g>x&&(g=x),o.style.top=`${g}px`,t(this,T).top.disabled=u<=0,t(this,T).bottom.disabled=u>=f-1},"refresh"));d(this,pt,a(()=>{const e=t(this,T).container;e.addEventListener("scroll",()=>{t(this,O)||this.refresh()}),t(this,T).thumb.addEventListener("mousedown",i=>{if(i.button!==0)return;i.stopPropagation(),i.preventDefault(),b(this,O,!0),b(this,st,i.clientY),b(this,nt,e.scrollTop);const n=a(r=>{if(!t(this,O))return;const l=t(this,T).track.getBoundingClientRect(),c=t(this,T).thumb.clientHeight,u=l.height-c,f=r.clientY-t(this,st),g=e.clientHeight,E=table.scrollHeight-g;if(u>0&&E>0){const H=f/u*E;e.scrollTop=t(this,nt)+H}this.refresh()},"onMouseMove"),o=a(()=>{b(this,O,!1),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o),this.refresh()},"onMouseUp");document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}),t(this,T).track.addEventListener("mousedown",i=>{if(i.button!==0||i.target===t(this,T).thumb)return;const n=t(this,T).track.getBoundingClientRect(),o=t(this,T).thumb.clientHeight,r=i.clientY-n.top-o/2,c=n.height-o,h=e.clientHeight,f=e.querySelector("table").scrollHeight-h;if(c>0&&f>0){const g=Math.max(0,Math.min(1,r/c));e.scrollTop=g*f}this.refresh()}),t(this,T).top.addEventListener("click",()=>{e.scrollTop-=40}),t(this,T).bottom.addEventListener("click",()=>{e.scrollTop+=40})},"#init"))}connectedCallback(){if(b(this,X,this.closest("nine-table-sheet")||this.getRootNode().host),!t(this,X))return;this.innerHTML=`
64
64
  <style>
65
65
  nine-table-vscrollbar {
66
66
  display: flex;
@@ -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,T,{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,bt).call(this),this.refresh()},"initWhenReady");e()}};X=new WeakMap,O=new WeakMap,T=new WeakMap,it=new WeakMap,nt=new WeakMap,bt=new WeakMap,c(Xt,"NineTableVScrollBar");let et=Xt;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",et);const M=class M{static compileAll(n){return Array.isArray(n)?n.map(e=>M.compile(e)):[]}static compile(n){var s,o,r,l;if(!n)return null;const e=n.cloneNode(!0);return t(s=M,gt).call(s,e),t(o=M,Z).call(o,e,"thead"),t(r=M,Z).call(r,e,"tbody"),t(l=M,Z).call(l,e,"tfoot"),Array.from(e.querySelectorAll("colgroup col")).forEach((a,d)=>{const u=a.getAttribute("fixed");u&&e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach(f=>{f.setAttribute("fixed",u)})}),e}};gt=new WeakMap,Z=new WeakMap,c(M,"TableCompiler"),h(M,gt,c(n=>{if(!n.querySelector("colgroup")){const e=n.querySelector("tbody tr")||n.querySelector("tr"),i=e?e.querySelectorAll("th, td").length:1,s=document.createElement("colgroup"),o=Math.max(Math.floor(n.clientWidth/i),100);for(let r=0;r<i;r++){const l=document.createElement("col");l.setAttribute("width",o),s.appendChild(l)}n.prepend(s)}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")),s=Array.from(n.querySelectorAll(e+" th,"+e+" td")),o=i.length;if(o===0||s.length===0)return;let r=0;s.forEach(a=>{r+=a.colSpan||1});const l=Array.from(Array(o),()=>Array(r).fill(null));i.forEach(a=>{const d=a.sectionRowIndex;let u=0;Array.from(a.querySelectorAll("th,td")).forEach(f=>{for(let E=0;E<l[d].length;E++)if(l[d][E]===null){u=E;break}const b=f.rowSpan||1,x=f.colSpan||1;for(let E=0;E<b;E++)for(let _=0;_<x;_++)d+E<o&&u+_<r&&(l[d+E][u+_]=E===0&&_===0?"1":"0")})}),i.forEach(a=>{const d=a.sectionRowIndex;Array.from(a.querySelectorAll("th,td")).forEach(u=>{for(let f=0;f<l[d].length;f++)if(l[d][f]==="1"){u.dataset.col=f,l[d][f]="0";break}})})},"#resetColIndex"));let It=M;const Ut=class Ut{constructor(n){h(this,w);h(this,$,new Map);h(this,k,null);h(this,z,null);h(this,U,0);h(this,j,40);R(this,"refresh",c(()=>{var e;const n=t(this,w).querySelector(".ng-container-body");n&&(t(this,mt).call(this),t(this,rt).call(this,n.scrollTop),(e=t(this,w).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));R(this,"initialize",c(()=>{g(this,k,null),t(this,$).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{const i=t(this,w).querySelector(e);if(!i)return;const s=i.querySelector("table");if(!s)return;const o=s.querySelector("tbody");if(!o)return;const l=Array.from(o.querySelectorAll("tr")).map(a=>a.cloneNode(!0));t(this,$).set(e,l)});const n=t(this,w).querySelector(".ng-container-body");if(n){t(this,yt).call(this,n),t(this,ot).call(this);let e=n.scrollTop;n.addEventListener("scroll",()=>{var s;const i=n.scrollTop;v.log(e,i),e!==i&&(e=i,t(this,rt).call(this,i)),(s=t(this,w).querySelector("nine-table-vscrollbar"))==null||s.refresh()})}},"initialize"));h(this,pt,c((n,e)=>{const i=t(this,$).get(e);if(!i||i.length===0)return;const s=n.querySelector("tbody");if(!s)return;s.querySelectorAll("tr:not(.nodata)").forEach(l=>l.remove());const o=s.querySelector("tr.nodata"),r=document.createDocumentFragment();for(let l=0;l<t(this,j);l++)i.forEach(a=>{r.appendChild(a.cloneNode(!0))});o?o.before(r):s.appendChild(r)},"#renderRows"));h(this,yt,c(n=>{if(t(this,k)!==null&&t(this,k)>0)return t(this,k);const e=t(this,$).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 s=i.querySelector("tr.nodata"),o=document.createDocumentFragment();e.forEach(b=>{o.appendChild(b.cloneNode(!0))}),s?s.before(o):i.appendChild(o);const r=t(this,w),l=r.style.display,a=r.style.visibility,d=r.style.position;(l==="none"||window.getComputedStyle(r).display==="none")&&(r.style.display="block",r.style.visibility="hidden",r.style.position="absolute");let u=0;const f=i.querySelectorAll("tr:not(.nodata)");return f.forEach(b=>{u+=b.offsetHeight||b.getBoundingClientRect().height}),f.forEach(b=>b.remove()),r.style.display=l,r.style.visibility=a,r.style.position=d,g(this,k,u>0?u:24),t(this,st).call(this),v.log(`[RowManager] Height Cached: ${t(this,k)}px | RowCount: ${t(this,j)}`),t(this,k)},"#measureAndCacheHeight"));h(this,mt,c(()=>{var o,r,l,a;if(!t(this,w).querySelector(".ng-container-body"))return;const e=(typeof((o=t(this,w).data)==null?void 0:o.count)=="function"?t(this,w).data.count():null)??((l=(r=t(this,w).dataManager)==null?void 0:r.rawRecords)==null?void 0:l.length)??((a=t(this,w).data)==null?void 0:a.length)??0,i=t(this,k)||24,s=e*i;v.log(`[RowManager] TotalCount: ${e} | RowHeight: ${i}px | TotalVirtualHeight: ${s}px`),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(d=>{const u=t(this,w).querySelector(d),f=u==null?void 0:u.querySelector("table");f?(f.style.height=`${s}px`,v.log(`[RowManager] Applied height to ${d} table:`,f.style.height)):v.log(`[RowManager] Table not found for selector: ${d}`)})},"#updateVirtualScrollHeight"));h(this,st,c(()=>{if(t(this,U)>0&&t(this,k)>0){const n=Math.ceil(t(this,U)/t(this,k));g(this,j,n+20)}else g(this,j,40)},"#updateRowCount"));h(this,xt,c(()=>{var a,d,u;const n=t(this,w).querySelector(".ng-container-left table"),e=t(this,w).querySelector(".ng-container-body table"),i=t(this,w).querySelector(".ng-container-right table");if(!e)return;const s=n?Array.from(n.querySelectorAll("tr")):[],o=Array.from(e.querySelectorAll("tr")),r=i?Array.from(i.querySelectorAll("tr")):[],l=Math.max(s.length,o.length,r.length);for(let f=0;f<l;f++){const b=[((a=s[f])==null?void 0:a.getBoundingClientRect().height)||0,((d=o[f])==null?void 0:d.getBoundingClientRect().height)||0,((u=r[f])==null?void 0:u.getBoundingClientRect().height)||0],x=Math.max(...b);x>0&&(s[f]&&(s[f].style.height=`${x}px`),o[f]&&(o[f].style.height=`${x}px`),r[f]&&(r[f].style.height=`${x}px`))}},"#syncRowHeights"));h(this,vt,c(()=>{!t(this,w)||!(t(this,w)instanceof HTMLElement)||(g(this,z,new ResizeObserver(n=>{for(const e of n){const i=e.target;if(!i.classList.contains("active"))continue;const s=e.contentRect.height;if(s>0){let o=0;const r=i.querySelector("thead");r&&(o+=r.offsetHeight||r.getBoundingClientRect().height);const l=Math.max(s-o,100);t(this,U)!==l&&(g(this,U,l),t(this,st).call(this),t(this,k)!==null&&t(this,ot).call(this))}}})),t(this,z).observe(t(this,w)))},"#initResizeObserver"));h(this,ot,c(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const e=t(this,w).querySelector(n);e&&e.querySelector("tbody")&&t(this,pt).call(this,e,n)}),t(this,xt).call(this)},"#renderAllContainers"));h(this,rt,c(n=>{var r;const e=t(this,k);if(!e||e<=0)return;const i=((r=t(this,$).get(".ng-container-body"))==null?void 0:r.length)||1,s=Math.floor(n/e),o=Math.max(0,s);[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(l=>{const a=t(this,w).querySelector(l);if(!a)return;const d=a.querySelector("tbody");if(!d)return;Array.from(d.querySelectorAll("tr:not(.nodata)")).forEach((f,b)=>{const x=o+Math.floor(b/i),E=t(this,w).getData?t(this,w).getData(x):null;E?(f.style.display="",t(this,wt).call(this,f,E,x)):f.style.display="none"})})},"#handleScroll"));h(this,wt,c((n,e,i)=>{n.dataset.row=i,Array.from(n.cells).forEach((s,o)=>{const r=s.dataset.bind;r&&e&&e[r]!==void 0?s.textContent=e[r]:s.textContent=e?e[Object.keys(e)[o]]??`R${i}C${o}`:`행 ${i+1}`,s.dataset.row=i})},"#bindRowData"));R(this,"destroy",c(()=>{t(this,z)&&(t(this,z).disconnect(),g(this,z,null))},"destroy"));g(this,w,n),t(this,vt).call(this)}getRowHeight(){return t(this,k)}templateLength(n=".ng-container-body"){var e;return((e=t(this,$).get(n))==null?void 0:e.length)||1}};w=new WeakMap,$=new WeakMap,k=new WeakMap,z=new WeakMap,U=new WeakMap,j=new WeakMap,pt=new WeakMap,yt=new WeakMap,mt=new WeakMap,st=new WeakMap,xt=new WeakMap,vt=new WeakMap,ot=new WeakMap,rt=new WeakMap,wt=new WeakMap,c(Ut,"RowManager");let Wt=Ut;const lt=class lt extends HTMLElement{constructor(){super();h(this,G,null);h(this,J);h(this,St,c(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:i,type:s})=>{const o=this.querySelector(i);if(!o)return;const r=t(this,Rt).call(this,t(this,G),s);o.innerHTML="",o.appendChild(r)})},"#renderSplitContainers"));h(this,Et,c(()=>{["left","right"].forEach(e=>{const i=this.querySelector(`.ng-container-${e}`),s=i==null?void 0:i.querySelector("table");if(!i||!s)return;let o=0;s.querySelectorAll("col").forEach(r=>{const l=parseInt(r.getAttribute("width"),10);isNaN(o)||(o+=l)}),i.style.flex=`0 0 ${o}px`,i.style.width=`${o}px`})},"#updateContainerWidths"));R(this,"generate",c(e=>{e&&(g(this,G,It.compile(e)),t(this,G).style.display="table",t(this,St).call(this),t(this,Et).call(this),t(this,J).initialize(),setTimeout(()=>{var i;(i=this.querySelector("nine-table-hscrollbar"))==null||i.refresh()},0))},"generate"));h(this,Rt,c((e,i)=>{const s=e.cloneNode(!0);return i==="left"?s.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(o=>{o.getAttribute("fixed")!=="left"&&o.remove()}):i==="right"?s.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(o=>{o.getAttribute("fixed")!=="right"&&o.remove()}):s.querySelectorAll("[fixed=left], [fixed=right]").forEach(o=>{o.remove()}),s},"#createSplitTable"));R(this,"getRowHeight",c(()=>t(this,J).getRowHeight(),"getRowHeight"));R(this,"scrollToX",c(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollLeft=e)},"scrollToX"));R(this,"scrollToY",c(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollTop=e)},"scrollToY"));h(this,Tt,c(()=>{t(this,kt).call(this)},"#init"));h(this,kt,c(()=>{const e=lt.SCROLLBAR_SIZE;this.innerHTML=`
125
+ `;const e=a(()=>{const i=t(this,X).querySelector(".ng-container-body");if(!i){setTimeout(e,10);return}b(this,T,{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,pt).call(this),this.refresh()},"initWhenReady");e()}};X=new WeakMap,O=new WeakMap,T=new WeakMap,st=new WeakMap,nt=new WeakMap,pt=new WeakMap,a(Ut,"NineTableVScrollBar");let it=Ut;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",it);const _=class _{static compileAll(s){return Array.isArray(s)?s.map(e=>_.compile(e)):[]}static compile(s){var n,o,r,l;if(!s)return null;const e=s.cloneNode(!0);return t(n=_,yt).call(n,e),t(o=_,Z).call(o,e,"thead"),t(r=_,Z).call(r,e,"tbody"),t(l=_,Z).call(l,e,"tfoot"),Array.from(e.querySelectorAll("colgroup col")).forEach((c,h)=>{const u=c.getAttribute("fixed");u&&e.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach(f=>{f.setAttribute("fixed",u)})}),e}};yt=new WeakMap,Z=new WeakMap,a(_,"TableCompiler"),d(_,yt,a(s=>{if(!s.querySelector("colgroup")){const e=s.querySelector("tbody tr")||s.querySelector("tr"),i=e?e.querySelectorAll("th, td").length:1,n=document.createElement("colgroup"),o=Math.max(Math.floor(s.clientWidth/i),100);for(let r=0;r<i;r++){const l=document.createElement("col");l.setAttribute("width",o),n.appendChild(l)}s.prepend(n)}if(!s.querySelector("thead")){const e=document.createElement("thead"),i=s.querySelector("colgroup");i?i.after(e):s.prepend(e)}s.classList.add("nine-table-element"),s.style.display="table"},"#ensureTableStructure")),d(_,Z,a((s,e)=>{const i=Array.from(s.querySelectorAll(e+" tr")),n=Array.from(s.querySelectorAll(e+" th,"+e+" td")),o=i.length;if(o===0||n.length===0)return;let r=0;n.forEach(c=>{r+=c.colSpan||1});const l=Array.from(Array(o),()=>Array(r).fill(null));i.forEach(c=>{const h=c.sectionRowIndex;let u=0;Array.from(c.querySelectorAll("th,td")).forEach(f=>{for(let E=0;E<l[h].length;E++)if(l[h][E]===null){u=E;break}const g=f.rowSpan||1,x=f.colSpan||1;for(let E=0;E<g;E++)for(let H=0;H<x;H++)h+E<o&&u+H<r&&(l[h+E][u+H]=E===0&&H===0?"1":"0")})}),i.forEach(c=>{const h=c.sectionRowIndex;Array.from(c.querySelectorAll("th,td")).forEach(u=>{for(let f=0;f<l[h].length;f++)if(l[h][f]==="1"){u.dataset.col=f,l[h][f]="0";break}})})},"#resetColIndex"));let Wt=_;const jt=class jt{constructor(s){d(this,v);d(this,$,new Map);d(this,k,null);d(this,z,null);d(this,U,0);d(this,j,40);R(this,"refresh",a(()=>{var e;const s=t(this,v).querySelector(".ng-container-body");s&&(t(this,ot).call(this),t(this,G).call(this,s.scrollTop),(e=t(this,v).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));R(this,"initialize",a(()=>{b(this,k,null),t(this,$).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{const i=t(this,v).querySelector(e);if(!i)return;const n=i.querySelector("table");if(!n)return;const o=n.querySelector("tbody");if(!o)return;const l=Array.from(o.querySelectorAll("tr")).map(c=>c.cloneNode(!0));t(this,$).set(e,l)});const s=t(this,v).querySelector(".ng-container-body");if(s){t(this,xt).call(this,s),t(this,lt).call(this),t(this,ot).call(this),t(this,G).call(this,s.scrollTop);let e=s.scrollTop;s.addEventListener("scroll",()=>{var n;const i=s.scrollTop;w.log(e,i),e!==i&&(e=i,t(this,G).call(this,i)),(n=t(this,v).querySelector("nine-table-vscrollbar"))==null||n.refresh()})}},"initialize"));d(this,mt,a((s,e)=>{const i=t(this,$).get(e);if(!i||i.length===0)return;const n=s.querySelector("tbody");if(!n)return;n.querySelectorAll("tr:not(.nodata)").forEach(l=>l.remove());const o=n.querySelector("tr.nodata"),r=document.createDocumentFragment();for(let l=0;l<t(this,j);l++)i.forEach(c=>{r.appendChild(c.cloneNode(!0))});o?o.before(r):n.appendChild(r)},"#renderRows"));d(this,xt,a(s=>{if(t(this,k)!==null&&t(this,k)>0)return t(this,k);const e=t(this,$).get(".ng-container-body");if(!e||e.length===0)return 24;const i=s.querySelector("tbody");if(!i)return 24;i.querySelectorAll("tr:not(.nodata)").forEach(g=>g.remove());const n=i.querySelector("tr.nodata"),o=document.createDocumentFragment();e.forEach(g=>{o.appendChild(g.cloneNode(!0))}),n?n.before(o):i.appendChild(o);const r=t(this,v),l=r.style.display,c=r.style.visibility,h=r.style.position;(l==="none"||window.getComputedStyle(r).display==="none")&&(r.style.display="block",r.style.visibility="hidden",r.style.position="absolute");let u=0;const f=i.querySelectorAll("tr:not(.nodata)");return f.forEach(g=>{u+=g.offsetHeight||g.getBoundingClientRect().height}),f.forEach(g=>g.remove()),r.style.display=l,r.style.visibility=c,r.style.position=h,b(this,k,u>0?u:24),t(this,rt).call(this),w.log(`[RowManager] Height Cached: ${t(this,k)}px | RowCount: ${t(this,j)}`),t(this,k)},"#measureAndCacheHeight"));d(this,ot,a(()=>{var o,r,l,c;if(!t(this,v).querySelector(".ng-container-body"))return;const e=(typeof((o=t(this,v).data)==null?void 0:o.count)=="function"?t(this,v).data.count():null)??((l=(r=t(this,v).dataManager)==null?void 0:r.rawRecords)==null?void 0:l.length)??((c=t(this,v).data)==null?void 0:c.length)??0,i=t(this,k)||24,n=e*i;w.log(`[RowManager] TotalCount: ${e} | RowHeight: ${i}px | TotalVirtualHeight: ${n}px`),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(h=>{const u=t(this,v).querySelector(h),f=u==null?void 0:u.querySelector("table");f?(f.style.height=`${n}px`,w.log(`[RowManager] Applied height to ${h} table:`,f.style.height)):w.log(`[RowManager] Table not found for selector: ${h}`)})},"#updateVirtualScrollHeight"));d(this,rt,a(()=>{if(t(this,U)>0&&t(this,k)>0){const s=Math.ceil(t(this,U)/t(this,k));b(this,j,s+20)}else b(this,j,40)},"#updateRowCount"));d(this,vt,a(()=>{var c,h,u;const s=t(this,v).querySelector(".ng-container-left table"),e=t(this,v).querySelector(".ng-container-body table"),i=t(this,v).querySelector(".ng-container-right table");if(!e)return;const n=s?Array.from(s.querySelectorAll("tr")):[],o=Array.from(e.querySelectorAll("tr")),r=i?Array.from(i.querySelectorAll("tr")):[],l=Math.max(n.length,o.length,r.length);for(let f=0;f<l;f++){const g=[((c=n[f])==null?void 0:c.getBoundingClientRect().height)||0,((h=o[f])==null?void 0:h.getBoundingClientRect().height)||0,((u=r[f])==null?void 0:u.getBoundingClientRect().height)||0],x=Math.max(...g);x>0&&(n[f]&&(n[f].style.height=`${x}px`),o[f]&&(o[f].style.height=`${x}px`),r[f]&&(r[f].style.height=`${x}px`))}},"#syncRowHeights"));d(this,wt,a(()=>{!t(this,v)||!(t(this,v)instanceof HTMLElement)||(b(this,z,new ResizeObserver(s=>{for(const e of s){const i=e.target;if(!i.classList.contains("active"))continue;const n=e.contentRect.height;if(n>0){let o=0;const r=i.querySelector("thead");r&&(o+=r.offsetHeight||r.getBoundingClientRect().height);const l=Math.max(n-o,100);t(this,U)!==l&&(b(this,U,l),t(this,rt).call(this),t(this,k)!==null&&t(this,lt).call(this))}}})),t(this,z).observe(t(this,v)))},"#initResizeObserver"));d(this,lt,a(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(s=>{const e=t(this,v).querySelector(s);e&&e.querySelector("tbody")&&t(this,mt).call(this,e,s)}),t(this,vt).call(this)},"#renderAllContainers"));d(this,G,a(s=>{var r;const e=t(this,k);if(!e||e<=0)return;const i=Math.max(0,Math.floor(s/e)),n=s%e,o=((r=t(this,$).get(".ng-container-body"))==null?void 0:r.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(l=>{const c=t(this,v).querySelector(l);if(!c)return;const h=c.querySelector("tbody");if(!h)return;h.style.transform=`translateY(-${n}px)`,h.style.willChange="transform",Array.from(h.querySelectorAll("tr:not(.nodata)")).forEach((f,g)=>{var H,ft,Qt,te;const x=i+Math.floor(g/o),E=(typeof t(this,v).getData=="function"?t(this,v).getData(x):null)??(typeof((H=t(this,v).data)==null?void 0:H.get)=="function"?t(this,v).data.get(x):null)??((Qt=(ft=t(this,v).dataManager)==null?void 0:ft.rawRecords)==null?void 0:Qt[x])??((te=t(this,v).data)==null?void 0:te[x])??null;E?(f.style.display="",t(this,St).call(this,f,E,x)):f.style.display="none"})})},"#handleScroll"));d(this,St,a((s,e,i)=>{s.dataset.row=i,Array.from(s.cells).forEach((n,o)=>{const r=n.dataset.bind;r&&e&&e[r]!==void 0?n.textContent=e[r]:n.textContent=e?e[Object.keys(e)[o]]??`R${i}C${o}`:`행 ${i+1}`,n.dataset.row=i})},"#bindRowData"));R(this,"destroy",a(()=>{t(this,z)&&(t(this,z).disconnect(),b(this,z,null))},"destroy"));b(this,v,s),t(this,wt).call(this)}getRowHeight(){return t(this,k)}templateLength(s=".ng-container-body"){var e;return((e=t(this,$).get(s))==null?void 0:e.length)||1}};v=new WeakMap,$=new WeakMap,k=new WeakMap,z=new WeakMap,U=new WeakMap,j=new WeakMap,mt=new WeakMap,xt=new WeakMap,ot=new WeakMap,rt=new WeakMap,vt=new WeakMap,wt=new WeakMap,lt=new WeakMap,G=new WeakMap,St=new WeakMap,a(jt,"RowManager");let Ot=jt;const at=class at extends HTMLElement{constructor(){super();d(this,J,null);d(this,Q);d(this,Et,a(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:i,type:n})=>{const o=this.querySelector(i);if(!o)return;const r=t(this,Tt).call(this,t(this,J),n);o.innerHTML="",o.appendChild(r)})},"#renderSplitContainers"));d(this,Rt,a(()=>{["left","right"].forEach(e=>{const i=this.querySelector(`.ng-container-${e}`),n=i==null?void 0:i.querySelector("table");if(!i||!n)return;let o=0;n.querySelectorAll("col").forEach(r=>{const l=parseInt(r.getAttribute("width"),10);isNaN(o)||(o+=l)}),i.style.flex=`0 0 ${o}px`,i.style.width=`${o}px`})},"#updateContainerWidths"));R(this,"generate",a(e=>{e&&(b(this,J,Wt.compile(e)),t(this,J).style.display="table",t(this,Et).call(this),t(this,Rt).call(this),t(this,Q).initialize(),setTimeout(()=>{var i;(i=this.querySelector("nine-table-hscrollbar"))==null||i.refresh()},0))},"generate"));d(this,Tt,a((e,i)=>{const n=e.cloneNode(!0);return i==="left"?n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(o=>{o.getAttribute("fixed")!=="left"&&o.remove()}):i==="right"?n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(o=>{o.getAttribute("fixed")!=="right"&&o.remove()}):n.querySelectorAll("[fixed=left], [fixed=right]").forEach(o=>{o.remove()}),n},"#createSplitTable"));R(this,"getRowHeight",a(()=>t(this,Q).getRowHeight(),"getRowHeight"));R(this,"scrollToX",a(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollLeft=e)},"scrollToX"));R(this,"scrollToY",a(e=>{const i=this.querySelector(".ng-container-body");i&&(i.scrollTop=e)},"scrollToY"));d(this,kt,a(()=>{t(this,At).call(this)},"#init"));d(this,At,a(()=>{const e=at.SCROLLBAR_SIZE;this.innerHTML=`
126
126
  <style>
127
127
  nine-table-sheet {
128
128
  display: none;
@@ -255,7 +255,7 @@
255
255
  <nine-table-hscrollbar></nine-table-hscrollbar>
256
256
  <div class='ng-scroll-edge'></div>
257
257
  </div>
258
- `},"#render"));g(this,J,new Wt(this))}connectedCallback(){t(this,Tt).call(this)}disconnectedCallback(){this.innerHTML="",v.log("NineTableSheet destroyed.")}};G=new WeakMap,J=new WeakMap,St=new WeakMap,Et=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,kt=new WeakMap,c(lt,"NineTableSheet"),R(lt,"SCROLLBAR_SIZE",16);let dt=lt;customElements.get("nine-table-sheet")||customElements.define("nine-table-sheet",dt);const jt=class jt extends HTMLElement{constructor(){super();h(this,At,c(()=>{var e;(e=this.querySelector(".nine-tab-bar"))==null||e.addEventListener("click",i=>{var r;const s=i.ctrlKey||i.metaKey||i.shiftKey,o=parseInt((r=i.target.closest(".nine-tab-item"))==null?void 0:r.dataset.index,10);t(this,ct).call(this,o,s)}),t(this,ct).call(this,0,!1)},"#init"));h(this,ct,c((e,i=!1)=>{const s=c(()=>{const u=Array.from(this.querySelectorAll("nine-table-sheet"));Array.from(this.querySelectorAll("nine-splitter")).forEach(x=>x.style.setProperty("display","none"));const b=u.filter(x=>x.classList.contains("active"));b.length<2||b.forEach(x=>{const E=parseInt(x.getAttribute("data-index"),10),_=this.querySelector(`nine-splitter[data-split-index="${E}"]`),Jt=u[E+1];_&&Jt&&Jt.classList.contains("active")&&_.style.setProperty("display","flex")})},"updateSplitters"),o=this.querySelector(".nine-tab-bar"),r=this.querySelector("nine-table-sheets-body"),l=o.querySelectorAll(".nine-tab-item"),a=r.querySelectorAll("nine-table-sheet");if(!l[e])return;if(!i)l.forEach((u,f)=>{u.classList.toggle("active",f===e)}),a.forEach((u,f)=>{const b=f===e;u.classList.toggle("active",b),u.style.flex=b?"1 1 100%":""});else{const u=l[e],f=o.querySelectorAll(".nine-tab-item.active");if(u.classList.contains("active")&&f.length<=1)return;u.classList.toggle("active");const b=r.querySelector(`nine-table-sheet[data-index="${e}"]`);b&&(b.classList.toggle("active"),b.classList.contains("active")||(b.style.flex=""))}const d=r.querySelectorAll("nine-table-sheet.active");d==null||d.forEach(u=>{u.style.flex=d.length>1?"1 1 0%":"1 1 100%"}),s()},"#switchSheet"))}connectedCallback(){t(this,At).call(this)}};At=new WeakMap,ct=new WeakMap,c(jt,"NineTableSheets");let Ot=jt;customElements.get("nine-table-sheets")||customElements.define("nine-table-sheets",Ot);const Kt=class Kt{constructor(n){h(this,A);h(this,qt,c(()=>{t(this,Lt).call(this),new ResizeObserver(n=>{for(let e of n)t(this,A).getAttribute("auto-height")==="true"&&t(this,at).call(this)}).observe(t(this,A))},"#init"));h(this,at,c(()=>{var a,d;const n=Array.from(t(this,A).shadowRoot.querySelectorAll("nine-table-sheet.active"));if(n.length===0)return;const e=parseInt(t(this,A).getAttribute("max-display-row"),10)||10,i=Math.max(...n.map(u=>u.getRowHeight())),s=(a=t(this,A).shadowRoot.querySelector("nine-table-header"))==null?void 0:a.getBoundingClientRect().height,o=(d=t(this,A).shadowRoot.querySelector("nine-table-sheets-footer"))==null?void 0:d.getBoundingClientRect().height,r=dt.SCROLLBAR_SIZE,l=e*i+s+o+r;t(this,A).style.height=`${l}px`},"#applyAutoHeight"));h(this,Lt,c(()=>{const e=Array.from(t(this,A).children).filter(a=>a.tagName==="TABLE"),i=t(this,A).getAttribute("auto-height")==="true",s=e.length,o=e.map((a,d)=>{const f=`<nine-table-sheet class="${d===0?"active":""}" data-index="${d}"></nine-table-sheet>`,b=d<s-1?`<nine-splitter class="h" data-split-index="${d}"></nine-splitter>`:"";return f+b}).join(""),r=e.map((a,d)=>`<div class="nine-tab-item ${d===0?"active":""}" data-index="${d}">Sheet ${d+1}</div>`).join("");t(this,A).shadowRoot.innerHTML=`
258
+ `},"#render"));b(this,Q,new Ot(this))}connectedCallback(){t(this,kt).call(this)}disconnectedCallback(){this.innerHTML="",w.log("NineTableSheet destroyed.")}};J=new WeakMap,Q=new WeakMap,Et=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,kt=new WeakMap,At=new WeakMap,a(at,"NineTableSheet"),R(at,"SCROLLBAR_SIZE",16);let ut=at;customElements.get("nine-table-sheet")||customElements.define("nine-table-sheet",ut);const Kt=class Kt extends HTMLElement{constructor(){super();d(this,qt,a(()=>{var e;(e=this.querySelector(".nine-tab-bar"))==null||e.addEventListener("click",i=>{var r;const n=i.ctrlKey||i.metaKey||i.shiftKey,o=parseInt((r=i.target.closest(".nine-tab-item"))==null?void 0:r.dataset.index,10);t(this,ct).call(this,o,n)}),t(this,ct).call(this,0,!1)},"#init"));d(this,ct,a((e,i=!1)=>{const n=a(()=>{const u=Array.from(this.querySelectorAll("nine-table-sheet"));Array.from(this.querySelectorAll("nine-splitter")).forEach(x=>x.style.setProperty("display","none"));const g=u.filter(x=>x.classList.contains("active"));g.length<2||g.forEach(x=>{const E=parseInt(x.getAttribute("data-index"),10),H=this.querySelector(`nine-splitter[data-split-index="${E}"]`),ft=u[E+1];H&&ft&&ft.classList.contains("active")&&H.style.setProperty("display","flex")})},"updateSplitters"),o=this.querySelector(".nine-tab-bar"),r=this.querySelector("nine-table-sheets-body"),l=o.querySelectorAll(".nine-tab-item"),c=r.querySelectorAll("nine-table-sheet");if(!l[e])return;if(!i)l.forEach((u,f)=>{u.classList.toggle("active",f===e)}),c.forEach((u,f)=>{const g=f===e;u.classList.toggle("active",g),u.style.flex=g?"1 1 100%":""});else{const u=l[e],f=o.querySelectorAll(".nine-tab-item.active");if(u.classList.contains("active")&&f.length<=1)return;u.classList.toggle("active");const g=r.querySelector(`nine-table-sheet[data-index="${e}"]`);g&&(g.classList.toggle("active"),g.classList.contains("active")||(g.style.flex=""))}const h=r.querySelectorAll("nine-table-sheet.active");h==null||h.forEach(u=>{u.style.flex=h.length>1?"1 1 0%":"1 1 100%"}),n()},"#switchSheet"))}connectedCallback(){t(this,qt).call(this)}};qt=new WeakMap,ct=new WeakMap,a(Kt,"NineTableSheets");let zt=Kt;customElements.get("nine-table-sheets")||customElements.define("nine-table-sheets",zt);const Ft=class Ft{constructor(s){d(this,A);d(this,Lt,a(()=>{t(this,Ht).call(this),new ResizeObserver(s=>{for(let e of s)t(this,A).getAttribute("auto-height")==="true"&&t(this,ht).call(this)}).observe(t(this,A))},"#init"));d(this,ht,a(()=>{var c,h;const s=Array.from(t(this,A).shadowRoot.querySelectorAll("nine-table-sheet.active"));if(s.length===0)return;const e=parseInt(t(this,A).getAttribute("max-display-row"),10)||10,i=Math.max(...s.map(u=>u.getRowHeight())),n=(c=t(this,A).shadowRoot.querySelector("nine-table-header"))==null?void 0:c.getBoundingClientRect().height,o=(h=t(this,A).shadowRoot.querySelector("nine-table-sheets-footer"))==null?void 0:h.getBoundingClientRect().height,r=ut.SCROLLBAR_SIZE,l=e*i+n+o+r;t(this,A).style.height=`${l}px`},"#applyAutoHeight"));d(this,Ht,a(()=>{const e=Array.from(t(this,A).children).filter(c=>c.tagName==="TABLE"),i=t(this,A).getAttribute("auto-height")==="true",n=e.length,o=e.map((c,h)=>{const f=`<nine-table-sheet class="${h===0?"active":""}" data-index="${h}"></nine-table-sheet>`,g=h<n-1?`<nine-splitter class="h" data-split-index="${h}"></nine-splitter>`:"";return f+g}).join(""),r=e.map((c,h)=>`<div class="nine-tab-item ${h===0?"active":""}" data-index="${h}">Sheet ${h+1}</div>`).join("");t(this,A).shadowRoot.innerHTML=`
259
259
  <style>
260
260
  :host {
261
261
  display: flex;
@@ -353,5 +353,5 @@
353
353
  <nine-table-analysis></nine-table-analysis>
354
354
  </nine-table-body>
355
355
  <nine-table-footer></nine-table-footer>
356
- `;const l=t(this,A).shadowRoot.querySelectorAll("nine-table-sheet");l==null||l.forEach((a,d)=>{e[d]&&setTimeout(()=>{a.generate(e[d]),i&&t(this,at).call(this)})})},"#render"));g(this,A,n),t(this,qt).call(this)}};A=new WeakMap,qt=new WeakMap,at=new WeakMap,Lt=new WeakMap,c(Kt,"LayoutManager");let zt=Kt;const Ft=class Ft{constructor(n){h(this,D);h(this,K,-1);R(this,"count",c(()=>t(this,D).rawRecords.length,"count"));g(this,D,n)}get at(){return t(this,K)}set at(n){var i,s;g(this,K,parseInt(n,10));const e=((s=(i=t(this,D).owner).querySelector)==null?void 0:s.call(i,".ng-container-body"))||t(this,D).owner.body;e&&!e.querySelector(`tbody.bindable tr[data-row="${t(this,K)}"]`)&&setTimeout(()=>{var o,r;(r=(o=t(this,D).owner).scrollTo_V1)==null||r.call(o,t(this,K))})}};D=new WeakMap,K=new WeakMap,c(Ft,"ngRow");let Dt=Ft;const H=class H{constructor(n,e){h(this,q);h(this,S);h(this,L,[]);h(this,Q,[]);h(this,Ht,0);h(this,P,[]);h(this,Ct,c(()=>{g(this,P,[]);const n=t(this,q).template||[];Array.from(n).forEach(e=>{var i;t(this,P).push(((i=e.getBoundingClientRect)==null?void 0:i.call(e).height)||24)}),(t(this,S).rawRecords||[]).forEach(e=>{e.__ng||(e.__ng=t(this,ht).call(this)),e.__ng.height=t(this,P).slice()})},"#initialize"));R(this,"set",c(n=>{this.clear(),this.add(n,!1)},"set"));h(this,ht,c(()=>({rowState:H.ROW_STATE.EMPTY,deleted:!1,filtered:!1,height:t(this,P).slice(),o:{},c:{},_:[0,0,0,0,H.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,t(this,P).slice(),-1,{},{}]}),"#getDefaultMeta"));R(this,"reset",c(()=>{g(this,L,[]),g(this,Q,[])},"reset"));R(this,"clear",c(()=>{var n;t(this,S).rawRecords=[],g(this,L,[]),g(this,Q,[]),(n=t(this,S).viewRecords)!=null&&n.reset&&t(this,S).viewRecords.reset()},"clear"));h(this,Mt,c(n=>{var s;Array.isArray(n)||(n=[n]);const e=typeof((s=t(this,q).fields)==null?void 0:s.get)=="function"?t(this,q).fields.get():Object.keys(n[0]||{}),i=[];return n.forEach(o=>{const r={v:[]};e.forEach(l=>{r.v.push(o[l]!==void 0&&o[l]!==null?o[l]:"")}),i.push(r)}),i},"#json2Array"));h(this,_t,c(n=>(Array.isArray(n)||(n=[n]),n.forEach(e=>{e.__ng=t(this,ht).call(this),e.__ng.rowid=this.nextId,e.__ng.rowState=H.ROW_STATE.INSERT,e.__ng._[0]=e.__ng.rowid}),n),"#defaultInsert"));R(this,"add",c((n,e=!0)=>{var o;n===void 0&&(n={});const i=t(this,Mt).call(this,n);t(this,S).rawRecords=t(this,S).rawRecords.concat(t(this,_t).call(this,i)),this.resetRecords();const s=this.count()-1;return e||i.forEach((r,l)=>{const a=t(this,S).rawRecords[s-l];a&&(a.__ng.rowState=H.ROW_STATE.EMPTY)}),(o=t(this,S).viewRecords)!=null&&o.reset&&t(this,S).viewRecords.reset(),s},"add"));R(this,"delete",c(n=>{var i;let e=[];Array.isArray(n)?e=n:typeof n>"u"?e=[t(this,S).owner.row.at]:e=[parseInt(n,10)],e.sort((s,o)=>o-s).forEach(s=>{if(t(this,L)[s]){const o=t(this,L)[s].__ng.rowid;t(this,L)[s].__ng.rowState===H.ROW_STATE.INSERT?t(this,S).rawRecords=t(this,S).rawRecords.filter(r=>r.__ng.rowid!==o):t(this,S).rawRecords.forEach(r=>{r.__ng.rowid===o&&(r.__ng.deleted=!0,r.__ng.rowState=H.ROW_STATE.DELETE)})}}),this.resetRecords(),(i=t(this,S).viewRecords)!=null&&i.reset&&t(this,S).viewRecords.reset()},"delete"));R(this,"setValue",c((n,e,i)=>{var a;n=parseInt(n,10);const o=(typeof((a=t(this,q).fields)==null?void 0:a.get)=="function"?t(this,q).fields.get():[]).indexOf(e);if(o<0)return;const r=this.getValidData()[n];if(!r)return;const l=r.v[o];l!==i&&r.__ng.rowState!==H.ROW_STATE.INSERT&&(r.__ng.o.hasOwnProperty(e)||(r.__ng.o[e]=l),r.__ng.rowState=H.ROW_STATE.UPDATE),r.v[o]=i,t(this,S).owner.refreshData&&t(this,S).owner.refreshData(n)},"setValue"));R(this,"resetRecords",c(()=>{g(this,Q,t(this,S).rawRecords.filter(n=>!n.__ng.deleted)),g(this,L,t(this,S).rawRecords.filter(n=>!n.__ng.deleted&&!n.__ng.filtered)),t(this,S).rawRecords.forEach((n,e)=>{n.__ng.rowidx=e}),t(this,L).forEach((n,e)=>{n.__ng.i=e})},"resetRecords"));R(this,"getValidData",c(()=>(t(this,L).length===0&&t(this,S).rawRecords.length>0&&this.resetRecords(),t(this,L)),"getValidData"));h(this,tt,c(n=>{var i;if(!n)return n;const e=typeof((i=t(this,q).fields)==null?void 0:i.get)=="function"?t(this,q).fields.get():[];return Array.isArray(n)?n.filter(s=>!s.__ng.deleted).map(s=>{const o={};return e.forEach((r,l)=>{o[r]=s.v?s.v[l]:s[r]}),o.__ng=s.__ng,o}):n},"#conv2"));R(this,"count",c(()=>this.getValidData().length,"count"));R(this,"get",c((n,e)=>{var o;const i=this.getValidData();if(!i||i.length<=0)return;if(n==null)return t(this,tt).call(this,i);if(n<0||n>=i.length)return null;const s=typeof((o=t(this,q).fields)==null?void 0:o.get)=="function"?t(this,q).fields.get():[];if(e!=null){const r=s.indexOf(e);return r>=0?i[n].v[r]:null}return t(this,tt).call(this,i[n])},"get"));g(this,q,n),g(this,S,e),t(this,Ct).call(this)}get source(){return t(this,tt).call(this,t(this,S).rawRecords)}set source(n){this.clear(),this.add(n,!1)}get nextId(){return++ie(this,Ht)._}get length(){return t(this,L).length}getRowCount(){return this.length}};q=new WeakMap,S=new WeakMap,L=new WeakMap,Q=new WeakMap,Ht=new WeakMap,P=new WeakMap,Ct=new WeakMap,ht=new WeakMap,Mt=new WeakMap,_t=new WeakMap,tt=new WeakMap,c(H,"ngData"),R(H,"ROW_STATE",{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"});let Pt=H;const Zt=class Zt{constructor(n){this.owner=n,this.row=new Dt(this),this.data=new Pt(n,this),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.pageCnt=25,this.viewRecords.reset=()=>{var e;(e=this.owner.view)!=null&&e.redraw&&this.owner.view.redraw()},this.setDataSource=e=>{this.data&&this.data.reset(),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.data.set(e||[])},this.getRowState=e=>{var s,o;const i=parseInt(e,10);if(!(i>=this.data.count()))return(o=(s=this.data.getValidData()[i])==null?void 0:s.__ng)==null?void 0:o.rowState},this.getRowPosition=()=>this.row.at,this.setRowPosition=e=>{this.row.at=e},this.scrollTo_V1=e=>(e<0&&(e=0),e>=this.rawRecords.length&&(e=this.rawRecords.length-1),this.viewRecords.rawIndex=e,this.viewRecords.reset&&this.viewRecords.reset(),!(e<=0||e>=this.rawRecords.length-1)),this.getColumn=(e,i)=>this.data.get(e,i),this.setColumn=(e,i,s)=>{e=parseInt(e,10),this.data.setValue(e,i,s)},this.setDataSource([])}};c(Zt,"ngDataManager");let Bt=Zt;const Gt=class Gt extends HTMLElement{constructor(){super();h(this,F);h(this,$t);this.attachShadow({mode:"open"}),g(this,F,new Bt(this))}connectedCallback(){g(this,$t,new zt(this)),v.log("NineTable connected."),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,detail:{target:this}}))}disconnectedCallback(){v.log("NineTable disconnected.")}get data(){return t(this,F).data}get row(){return t(this,F).row}get dataManager(){return t(this,F)}};F=new WeakMap,$t=new WeakMap,c(Gt,"NineTable");let Nt=Gt;customElements.get("nine-table")||customElements.define("nine-table",Nt)});
356
+ `;const l=t(this,A).shadowRoot.querySelectorAll("nine-table-sheet");l==null||l.forEach((c,h)=>{e[h]&&setTimeout(()=>{c.generate(e[h]),i&&t(this,ht).call(this)})})},"#render"));b(this,A,s),t(this,Lt).call(this)}};A=new WeakMap,Lt=new WeakMap,ht=new WeakMap,Ht=new WeakMap,a(Ft,"LayoutManager");let Dt=Ft;const Zt=class Zt{constructor(s){d(this,D);d(this,K,-1);R(this,"count",a(()=>t(this,D).rawRecords.length,"count"));b(this,D,s)}get at(){return t(this,K)}set at(s){var i,n;b(this,K,parseInt(s,10));const e=((n=(i=t(this,D).owner).querySelector)==null?void 0:n.call(i,".ng-container-body"))||t(this,D).owner.body;e&&!e.querySelector(`tbody.bindable tr[data-row="${t(this,K)}"]`)&&setTimeout(()=>{var o,r;(r=(o=t(this,D).owner).scrollTo_V1)==null||r.call(o,t(this,K))})}};D=new WeakMap,K=new WeakMap,a(Zt,"ngRow");let Pt=Zt;const C=class C{constructor(s,e){d(this,q);d(this,S);d(this,L,[]);d(this,tt,[]);d(this,Ct,0);d(this,P,[]);d(this,Mt,a(()=>{b(this,P,[]);const s=t(this,q).template||[];Array.from(s).forEach(e=>{var i;t(this,P).push(((i=e.getBoundingClientRect)==null?void 0:i.call(e).height)||24)}),(t(this,S).rawRecords||[]).forEach(e=>{e.__ng||(e.__ng=t(this,dt).call(this)),e.__ng.height=t(this,P).slice()})},"#initialize"));R(this,"set",a(s=>{this.clear(),this.add(s,!1)},"set"));d(this,dt,a(()=>({rowState:C.ROW_STATE.EMPTY,deleted:!1,filtered:!1,height:t(this,P).slice(),o:{},c:{},_:[0,0,0,0,C.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,t(this,P).slice(),-1,{},{}]}),"#getDefaultMeta"));R(this,"reset",a(()=>{b(this,L,[]),b(this,tt,[])},"reset"));R(this,"clear",a(()=>{var s;t(this,S).rawRecords=[],b(this,L,[]),b(this,tt,[]),(s=t(this,S).viewRecords)!=null&&s.reset&&t(this,S).viewRecords.reset()},"clear"));d(this,_t,a(s=>{var n;Array.isArray(s)||(s=[s]);const e=typeof((n=t(this,q).fields)==null?void 0:n.get)=="function"?t(this,q).fields.get():Object.keys(s[0]||{}),i=[];return s.forEach(o=>{const r={v:[]};e.forEach(l=>{r.v.push(o[l]!==void 0&&o[l]!==null?o[l]:"")}),i.push(r)}),i},"#json2Array"));d(this,$t,a(s=>(Array.isArray(s)||(s=[s]),s.forEach(e=>{e.__ng=t(this,dt).call(this),e.__ng.rowid=this.nextId,e.__ng.rowState=C.ROW_STATE.INSERT,e.__ng._[0]=e.__ng.rowid}),s),"#defaultInsert"));R(this,"add",a((s,e=!0)=>{var o;s===void 0&&(s={});const i=t(this,_t).call(this,s);t(this,S).rawRecords=t(this,S).rawRecords.concat(t(this,$t).call(this,i)),this.resetRecords();const n=this.count()-1;return e||i.forEach((r,l)=>{const c=t(this,S).rawRecords[n-l];c&&(c.__ng.rowState=C.ROW_STATE.EMPTY)}),(o=t(this,S).viewRecords)!=null&&o.reset&&t(this,S).viewRecords.reset(),n},"add"));R(this,"delete",a(s=>{var i;let e=[];Array.isArray(s)?e=s:typeof s>"u"?e=[t(this,S).owner.row.at]:e=[parseInt(s,10)],e.sort((n,o)=>o-n).forEach(n=>{if(t(this,L)[n]){const o=t(this,L)[n].__ng.rowid;t(this,L)[n].__ng.rowState===C.ROW_STATE.INSERT?t(this,S).rawRecords=t(this,S).rawRecords.filter(r=>r.__ng.rowid!==o):t(this,S).rawRecords.forEach(r=>{r.__ng.rowid===o&&(r.__ng.deleted=!0,r.__ng.rowState=C.ROW_STATE.DELETE)})}}),this.resetRecords(),(i=t(this,S).viewRecords)!=null&&i.reset&&t(this,S).viewRecords.reset()},"delete"));R(this,"setValue",a((s,e,i)=>{var c;s=parseInt(s,10);const o=(typeof((c=t(this,q).fields)==null?void 0:c.get)=="function"?t(this,q).fields.get():[]).indexOf(e);if(o<0)return;const r=this.getValidData()[s];if(!r)return;const l=r.v[o];l!==i&&r.__ng.rowState!==C.ROW_STATE.INSERT&&(r.__ng.o.hasOwnProperty(e)||(r.__ng.o[e]=l),r.__ng.rowState=C.ROW_STATE.UPDATE),r.v[o]=i,t(this,S).owner.refreshData&&t(this,S).owner.refreshData(s)},"setValue"));R(this,"resetRecords",a(()=>{b(this,tt,t(this,S).rawRecords.filter(s=>!s.__ng.deleted)),b(this,L,t(this,S).rawRecords.filter(s=>!s.__ng.deleted&&!s.__ng.filtered)),t(this,S).rawRecords.forEach((s,e)=>{s.__ng.rowidx=e}),t(this,L).forEach((s,e)=>{s.__ng.i=e})},"resetRecords"));R(this,"getValidData",a(()=>(t(this,L).length===0&&t(this,S).rawRecords.length>0&&this.resetRecords(),t(this,L)),"getValidData"));d(this,et,a(s=>{var i;if(!s)return s;const e=typeof((i=t(this,q).fields)==null?void 0:i.get)=="function"?t(this,q).fields.get():[];return Array.isArray(s)?s.filter(n=>!n.__ng.deleted).map(n=>{const o={};return e.forEach((r,l)=>{o[r]=n.v?n.v[l]:n[r]}),o.__ng=n.__ng,o}):s},"#conv2"));R(this,"count",a(()=>this.getValidData().length,"count"));R(this,"get",a((s,e)=>{var o;const i=this.getValidData();if(!i||i.length<=0)return;if(s==null)return t(this,et).call(this,i);if(s<0||s>=i.length)return null;const n=typeof((o=t(this,q).fields)==null?void 0:o.get)=="function"?t(this,q).fields.get():[];if(e!=null){const r=n.indexOf(e);return r>=0?i[s].v[r]:null}return t(this,et).call(this,i[s])},"get"));b(this,q,s),b(this,S,e),t(this,Mt).call(this)}get source(){return t(this,et).call(this,t(this,S).rawRecords)}set source(s){this.clear(),this.add(s,!1)}get nextId(){return++ne(this,Ct)._}get length(){return t(this,L).length}getRowCount(){return this.length}};q=new WeakMap,S=new WeakMap,L=new WeakMap,tt=new WeakMap,Ct=new WeakMap,P=new WeakMap,Mt=new WeakMap,dt=new WeakMap,_t=new WeakMap,$t=new WeakMap,et=new WeakMap,a(C,"ngData"),R(C,"ROW_STATE",{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"});let Bt=C;const Gt=class Gt{constructor(s){this.owner=s,this.row=new Pt(this),this.data=new Bt(s,this),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.pageCnt=25,this.viewRecords.reset=()=>{var e;(e=this.owner.view)!=null&&e.redraw&&this.owner.view.redraw()},this.setDataSource=e=>{this.data&&this.data.reset(),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.data.set(e||[])},this.getRowState=e=>{var n,o;const i=parseInt(e,10);if(!(i>=this.data.count()))return(o=(n=this.data.getValidData()[i])==null?void 0:n.__ng)==null?void 0:o.rowState},this.getRowPosition=()=>this.row.at,this.setRowPosition=e=>{this.row.at=e},this.scrollTo_V1=e=>(e<0&&(e=0),e>=this.rawRecords.length&&(e=this.rawRecords.length-1),this.viewRecords.rawIndex=e,this.viewRecords.reset&&this.viewRecords.reset(),!(e<=0||e>=this.rawRecords.length-1)),this.getColumn=(e,i)=>this.data.get(e,i),this.setColumn=(e,i,n)=>{e=parseInt(e,10),this.data.setValue(e,i,n)},this.setDataSource([])}};a(Gt,"ngDataManager");let Nt=Gt;const Jt=class Jt extends HTMLElement{constructor(){super();d(this,F);d(this,It);this.attachShadow({mode:"open"}),b(this,F,new Nt(this))}connectedCallback(){b(this,It,new Dt(this)),w.log("NineTable connected."),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,detail:{target:this}}))}disconnectedCallback(){w.log("NineTable disconnected.")}get data(){return t(this,F).data}get row(){return t(this,F).row}get dataManager(){return t(this,F)}};F=new WeakMap,It=new WeakMap,a(Jt,"NineTable");let Yt=Jt;customElements.get("nine-table")||customElements.define("nine-table",Yt)});
357
357
  //# sourceMappingURL=nine-table.umd.js.map