@ninebone/table 0.0.443 β†’ 0.0.445

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(x,m){typeof exports=="object"&&typeof module<"u"?m(require("@ninebone/util")):typeof define=="function"&&define.amd?define(["@ninebone/util"],m):(x=typeof globalThis<"u"?globalThis:x||self,m(x.NineboneUtil))})(this,function(x){"use strict";var xe=Object.defineProperty;var ve=x=>{throw TypeError(x)};var Ee=(x,m,A)=>m in x?xe(x,m,{enumerable:!0,configurable:!0,writable:!0,value:A}):x[m]=A;var h=(x,m)=>xe(x,"name",{value:m,configurable:!0});var R=(x,m,A)=>Ee(x,typeof m!="symbol"?m+"":m,A),we=(x,m,A)=>m.has(x)||ve("Cannot "+A);var t=(x,m,A)=>(we(x,m,"read from private field"),A?A.call(x):m.get(x)),d=(x,m,A)=>m.has(x)?ve("Cannot add the same private member more than once"):m instanceof WeakSet?m.add(x):m.set(x,A),g=(x,m,A,P)=>(we(x,m,"write to private field"),P?P.call(x,A):m.set(x,A),A);var Se=(x,m,A,P)=>({set _(ut){g(x,m,ut,A)},get _(){return t(x,m,P)}});var I,D,v,U,X,j,kt,K,Lt,Y,it,Z,q,gt,bt,Ct,B,S,W,L,F,G,yt,ot,Ht,Mt,_t,pt,mt,$t,It,xt,Wt,st,vt,Ot,zt,rt,Bt,J,Q,Nt,Pt,lt,Dt,Yt,Ft,St,C,Vt,Et,Ut,Rt,at,H,T,M,ct,Xt,V,jt,tt,At,Kt,Zt,ht,et,dt,k,qt,Gt,nt,Jt,Qt;const ce=class ce extends x.trace.constructor{constructor(){super(),this.init("nine-table","green")}};h(ce,"Trace");let m=ce;const A=new m,he=class he extends HTMLElement{constructor(){super();d(this,I);d(this,D,!1);d(this,v);d(this,U);d(this,X);d(this,j);d(this,kt,h(()=>{if(!t(this,I))return;const e=t(this,I).querySelector(".ng-container-body .ng-part-body");e&&(g(this,j,new ResizeObserver(()=>{this.refresh()})),t(this,j).observe(e))},"#observeResize"));R(this,"refresh",h(()=>{if(!t(this,I)||!t(this,v)||t(this,D))return;const e=t(this,v).container,i=e.querySelector("table");if(!i)return;const s=t(this,v).track,r=t(this,v).thumb,o=t(this,I).querySelector(".ng-container-bottom"),l=e.clientWidth,c=i.scrollWidth;if(l!==0&&c>l)o&&(o.style.display="flex");else{o&&(o.style.display="none");return}const a=s.clientWidth;if(a<=0)return;const f=Math.max(Math.min(a*(l/c),a),20);r.style.width=`${f}px`;const u=e.scrollLeft,y=c-l;let b=0;y>0&&(b=parseInt(u/y*(a-f),10)),b<0&&(b=0);const p=a-f;b>p&&(b=p),r.style.left=`${b}px`,t(this,v).left.disabled=b===0,t(this,v).right.disabled=b>=p-1},"refresh"));d(this,K,h(e=>{if(!t(this,v))return!1;const i=t(this,v).container,s=i.querySelector("table");if(!s)return!1;const r=t(this,v).track.getBoundingClientRect(),o=t(this,v).thumb.clientWidth;let l=e;l<0&&(l=0);const c=r.width-o;l>c&&(l=c),l=parseInt(l,10),t(this,v).thumb.style.left=`${l}px`,t(this,v).left.disabled=l===0,t(this,v).right.disabled=l>=c-1;const a=i.clientWidth,u=s.scrollWidth-a;return c>0&&u>0&&(i.scrollLeft=l/c*u),l>0&&l<c-1},"#thumbMoveTo"));d(this,Lt,h(()=>{const e=h(s=>{clearInterval(t(this,U)),clearInterval(t(this,X));const r=parseInt(t(this,v).thumb.style.left||0,10);t(this,K).call(this,r+s),g(this,U,setInterval(()=>{clearInterval(t(this,U)),g(this,X,setInterval(()=>{const o=parseInt(t(this,v).thumb.style.left||0,10);t(this,K).call(this,o+s)||clearInterval(t(this,X))},50))},500))},"delayScroll"),i=h(()=>{clearInterval(t(this,U)),clearInterval(t(this,X))},"clearTimer");["mouseup","mouseleave","touchend"].forEach(s=>{t(this,v).left.addEventListener(s,i),t(this,v).right.addEventListener(s,i),t(this,v).track.addEventListener(s,i)}),t(this,v).left.addEventListener("mousedown",s=>{s.button===0&&e(-20)}),t(this,v).right.addEventListener("mousedown",s=>{s.button===0&&e(20)}),t(this,v).left.addEventListener("touchstart",()=>e(-20)),t(this,v).right.addEventListener("touchstart",()=>e(20)),t(this,v).track.addEventListener("mousedown",s=>{if(s.button!==0)return;s.preventDefault();const r=t(this,v).track.getBoundingClientRect(),o=t(this,v).thumb.clientWidth;t(this,K).call(this,s.clientX-r.left-o/2)}),t(this,v).thumb.addEventListener("mousedown",s=>{if(s.button!==0)return;s.stopPropagation(),s.preventDefault(),g(this,D,!0),this.shiftX=s.clientX-t(this,v).thumb.getBoundingClientRect().left;const r=h(l=>{if(!t(this,D))return;const c=t(this,v).track.getBoundingClientRect();t(this,K).call(this,l.clientX-c.left-this.shiftX)},"onMouseMove"),o=h(()=>{g(this,D,!1),i(),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o),this.refresh()},"onMouseUp");document.addEventListener("mousemove",r),document.addEventListener("mouseup",o)})},"#init"))}connectedCallback(){if(g(this,I,this.closest("nine-table-sheet")||this.getRootNode().host),!t(this,I))return;this.innerHTML=`
1
+ (function(w,v){typeof exports=="object"&&typeof module<"u"?v(require("@ninebone/util")):typeof define=="function"&&define.amd?define(["@ninebone/util"],v):(w=typeof globalThis<"u"?globalThis:w||self,v(w.NineboneUtil))})(this,function(w){"use strict";var xe=Object.defineProperty;var ve=w=>{throw TypeError(w)};var Ee=(w,v,A)=>v in w?xe(w,v,{enumerable:!0,configurable:!0,writable:!0,value:A}):w[v]=A;var h=(w,v)=>xe(w,"name",{value:v,configurable:!0});var R=(w,v,A)=>Ee(w,typeof v!="symbol"?v+"":v,A),we=(w,v,A)=>v.has(w)||ve("Cannot "+A);var t=(w,v,A)=>(we(w,v,"read from private field"),A?A.call(w):v.get(w)),d=(w,v,A)=>v.has(w)?ve("Cannot add the same private member more than once"):v instanceof WeakSet?v.add(w):v.set(w,A),y=(w,v,A,P)=>(we(w,v,"write to private field"),P?P.call(w,A):v.set(w,A),A);var Se=(w,v,A,P)=>({set _(ft){y(w,v,ft,A)},get _(){return t(w,v,P)}});var O,D,S,X,j,K,kt,Z,Lt,Y,ot,G,q,ut,gt,Ct,B,E,N,C,F,J,bt,st,Ht,Mt,_t,yt,pt,$t,It,mt,Wt,rt,xt,Ot,zt,Q,tt,Bt,Pt,lt,Dt,Yt,Ft,wt,H,Vt,St,Ut,Et,at,M,k,_,ct,Xt,V,jt,et,Rt,Kt,Zt,ht,nt,dt,L,At,Gt,it,Jt,Qt;const ce=class ce extends w.trace.constructor{constructor(){super(),this.init("nine-table","green")}};h(ce,"Trace");let v=ce;const A=new v,he=class he extends HTMLElement{constructor(){super();d(this,O);d(this,D,!1);d(this,S);d(this,X);d(this,j);d(this,K);d(this,kt,h(()=>{if(!t(this,O))return;const e=t(this,O).querySelector(".ng-container-body .ng-part-body");e&&(y(this,K,new ResizeObserver(()=>{this.refresh()})),t(this,K).observe(e))},"#observeResize"));R(this,"refresh",h(()=>{if(!t(this,O)||!t(this,S)||t(this,D))return;const e=t(this,S).container,n=e.querySelector("table");if(!n)return;const o=t(this,S).track,r=t(this,S).thumb,s=t(this,O).querySelector(".ng-container-bottom"),l=e.clientWidth,c=n.scrollWidth;if(l!==0&&c>l)s&&(s.style.display="flex");else{s&&(s.style.display="none");return}const a=o.clientWidth;if(a<=0)return;const f=Math.max(Math.min(a*(l/c),a),20);r.style.width=`${f}px`;const g=e.scrollLeft,b=c-l;let u=0;b>0&&(u=parseInt(g/b*(a-f),10)),u<0&&(u=0);const p=a-f;u>p&&(u=p),r.style.left=`${u}px`,t(this,S).left.disabled=u===0,t(this,S).right.disabled=u>=p-1},"refresh"));d(this,Z,h(e=>{if(!t(this,S))return!1;const n=t(this,S).container,o=n.querySelector("table");if(!o)return!1;const r=t(this,S).track.getBoundingClientRect(),s=t(this,S).thumb.clientWidth;let l=e;l<0&&(l=0);const c=r.width-s;l>c&&(l=c),l=parseInt(l,10),t(this,S).thumb.style.left=`${l}px`,t(this,S).left.disabled=l===0,t(this,S).right.disabled=l>=c-1;const a=n.clientWidth,g=o.scrollWidth-a;return c>0&&g>0&&(n.scrollLeft=l/c*g),l>0&&l<c-1},"#thumbMoveTo"));d(this,Lt,h(()=>{const e=h(o=>{clearInterval(t(this,X)),clearInterval(t(this,j));const r=parseInt(t(this,S).thumb.style.left||0,10);t(this,Z).call(this,r+o),y(this,X,setInterval(()=>{clearInterval(t(this,X)),y(this,j,setInterval(()=>{const s=parseInt(t(this,S).thumb.style.left||0,10);t(this,Z).call(this,s+o)||clearInterval(t(this,j))},50))},500))},"delayScroll"),n=h(()=>{clearInterval(t(this,X)),clearInterval(t(this,j))},"clearTimer");["mouseup","mouseleave","touchend"].forEach(o=>{t(this,S).left.addEventListener(o,n),t(this,S).right.addEventListener(o,n),t(this,S).track.addEventListener(o,n)}),t(this,S).left.addEventListener("mousedown",o=>{o.button===0&&e(-20)}),t(this,S).right.addEventListener("mousedown",o=>{o.button===0&&e(20)}),t(this,S).left.addEventListener("touchstart",()=>e(-20)),t(this,S).right.addEventListener("touchstart",()=>e(20)),t(this,S).track.addEventListener("mousedown",o=>{if(o.button!==0)return;o.preventDefault();const r=t(this,S).track.getBoundingClientRect(),s=t(this,S).thumb.clientWidth;t(this,Z).call(this,o.clientX-r.left-s/2)}),t(this,S).thumb.addEventListener("mousedown",o=>{if(o.button!==0)return;o.stopPropagation(),o.preventDefault(),y(this,D,!0),this.shiftX=o.clientX-t(this,S).thumb.getBoundingClientRect().left;const r=h(l=>{if(!t(this,D))return;const c=t(this,S).track.getBoundingClientRect();t(this,Z).call(this,l.clientX-c.left-this.shiftX)},"onMouseMove"),s=h(()=>{y(this,D,!1),n(),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s),this.refresh()},"onMouseUp");document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)})},"#init"))}connectedCallback(){if(y(this,O,this.closest("nine-table-sheet")||this.getRootNode().host),!t(this,O))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=h(()=>{const i=t(this,I).querySelector(".ng-container-body .ng-part-body");if(!i){setTimeout(e,10);return}g(this,v,{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,D)||this.refresh()}),t(this,Lt).call(this),t(this,kt).call(this),this.refresh()},"initWhenReady");e()}disconnectedCallback(){t(this,j)&&t(this,j).disconnect()}};I=new WeakMap,D=new WeakMap,v=new WeakMap,U=new WeakMap,X=new WeakMap,j=new WeakMap,kt=new WeakMap,K=new WeakMap,Lt=new WeakMap,h(he,"NineTableHScrollBar");let P=he;customElements.get("nine-table-hscrollbar")||customElements.define("nine-table-hscrollbar",P);const de=class de extends HTMLElement{constructor(){super();d(this,Y);d(this,it);d(this,Z,!1);d(this,q);d(this,gt,0);d(this,bt,0);R(this,"refresh",h(()=>{if(!t(this,Y)||!t(this,q))return;const e=t(this,q).container,i=t(this,q).track,s=t(this,q).thumb,r=e.clientHeight,l=(t(this,Y).data.get()||[]).length,c=t(this,it).getRowHeight(),a=l*c;if(a<=r){s.style.display="none",t(this,q).top.disabled=!0,t(this,q).bottom.disabled=!0;return}else s.style.display="block";const f=i.clientHeight;if(f<=0)return;const u=Math.max(Math.min(f*(r/a),f),20);s.style.height=`${u}px`;const y=e.scrollTop,b=Math.max(a-r,1);let p=0;b>0&&(p=y/b*(f-u));const E=f-u;p<0&&(p=0),p>E&&(p=E),s.style.top=`${p}px`,t(this,q).top.disabled=y<=0,t(this,q).bottom.disabled=y>=b-1},"refresh"));d(this,Ct,h(()=>{const e=t(this,q).container,i=h(()=>{const r=(t(this,Y).data.get()||[]).length,o=t(this,it).getRowHeight();return r*o},"getContentHeight");e.addEventListener("scroll",()=>{t(this,Z)||this.refresh()}),t(this,q).thumb.addEventListener("mousedown",s=>{if(s.button!==0)return;s.stopPropagation(),s.preventDefault(),g(this,Z,!0),g(this,gt,s.clientY),g(this,bt,e.scrollTop);const r=h(l=>{if(!t(this,Z))return;const c=t(this,q).track.getBoundingClientRect(),a=t(this,q).thumb.clientHeight,u=c.height-a,y=l.clientY-t(this,gt),b=e.clientHeight,p=i(),E=Math.max(p-b,1);if(u>0&&E>0){const z=y/u*E;let w=t(this,bt)+z;const ft=Math.max(0,p-b);w<0&&(w=0),w>ft&&(w=ft),e.scrollTop=w}this.refresh()},"onMouseMove"),o=h(()=>{g(this,Z,!1),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o),this.refresh()},"onMouseUp");document.addEventListener("mousemove",r),document.addEventListener("mouseup",o)}),t(this,q).track.addEventListener("mousedown",s=>{if(s.button!==0||s.target===t(this,q).thumb)return;const r=t(this,q).track.getBoundingClientRect(),o=t(this,q).thumb.clientHeight,l=s.clientY-r.top-o/2,a=r.height-o,f=e.clientHeight,u=i(),y=Math.max(u-f,1);if(a>0&&y>0){const b=Math.max(0,Math.min(1,l/a));e.scrollTop=b*y}this.refresh()}),t(this,q).top.addEventListener("click",()=>{e.scrollTop-=40}),t(this,q).bottom.addEventListener("click",()=>{e.scrollTop+=40})},"#init"))}connectedCallback(){g(this,Y,this.getRootNode().host),g(this,it,this.closest("nine-table-sheet")),this.innerHTML=`
63
+ `;const e=h(()=>{const n=t(this,O).querySelector(".ng-container-body .ng-part-body");if(!n){setTimeout(e,10);return}y(this,S,{container:n,track:this.querySelector(".ng-scroll-track"),thumb:this.querySelector(".ng-scroll-thumb"),left:this.querySelector(".ng-scroll-left"),right:this.querySelector(".ng-scroll-right")}),n.addEventListener("scroll",()=>{t(this,D)||this.refresh()}),t(this,Lt).call(this),t(this,kt).call(this),this.refresh()},"initWhenReady");e()}disconnectedCallback(){t(this,K)&&t(this,K).disconnect()}};O=new WeakMap,D=new WeakMap,S=new WeakMap,X=new WeakMap,j=new WeakMap,K=new WeakMap,kt=new WeakMap,Z=new WeakMap,Lt=new WeakMap,h(he,"NineTableHScrollBar");let P=he;customElements.get("nine-table-hscrollbar")||customElements.define("nine-table-hscrollbar",P);const de=class de extends HTMLElement{constructor(){super();d(this,Y);d(this,ot);d(this,G,!1);d(this,q);d(this,ut,0);d(this,gt,0);R(this,"refresh",h(()=>{if(!t(this,Y)||!t(this,q))return;const e=t(this,q).container,n=t(this,q).track,o=t(this,q).thumb,r=e.clientHeight,l=(t(this,Y).data.get()||[]).length,c=t(this,ot).getRowHeight(),a=l*c;if(a<=r){o.style.display="none",t(this,q).top.disabled=!0,t(this,q).bottom.disabled=!0;return}else o.style.display="block";const f=n.clientHeight;if(f<=0)return;const g=Math.max(Math.min(f*(r/a),f),20);o.style.height=`${g}px`;const b=e.scrollTop,u=Math.max(a-r,1);let p=0;u>0&&(p=b/u*(f-g));const x=f-g;p<0&&(p=0),p>x&&(p=x),o.style.top=`${p}px`,t(this,q).top.disabled=b<=0,t(this,q).bottom.disabled=b>=u-1},"refresh"));d(this,Ct,h(()=>{const e=t(this,q).container,n=h(()=>{const r=(t(this,Y).data.get()||[]).length,s=t(this,ot).getRowHeight();return r*s},"getContentHeight");e.addEventListener("scroll",()=>{t(this,G)||this.refresh()}),t(this,q).thumb.addEventListener("mousedown",o=>{if(o.button!==0)return;o.stopPropagation(),o.preventDefault(),y(this,G,!0),y(this,ut,o.clientY),y(this,gt,e.scrollTop);const r=h(l=>{if(!t(this,G))return;const c=t(this,q).track.getBoundingClientRect(),a=t(this,q).thumb.clientHeight,g=c.height-a,b=l.clientY-t(this,ut),u=e.clientHeight,p=n(),x=Math.max(p-u,1);if(g>0&&x>0){const T=b/g*x;let m=t(this,gt)+T;const U=Math.max(0,p-u);m<0&&(m=0),m>U&&(m=U),e.scrollTop=m}this.refresh()},"onMouseMove"),s=h(()=>{y(this,G,!1),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s),this.refresh()},"onMouseUp");document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}),t(this,q).track.addEventListener("mousedown",o=>{if(o.button!==0||o.target===t(this,q).thumb)return;const r=t(this,q).track.getBoundingClientRect(),s=t(this,q).thumb.clientHeight,l=o.clientY-r.top-s/2,a=r.height-s,f=e.clientHeight,g=n(),b=Math.max(g-f,1);if(a>0&&b>0){const u=Math.max(0,Math.min(1,l/a));e.scrollTop=u*b}this.refresh()}),t(this,q).top.addEventListener("click",()=>{e.scrollTop-=40}),t(this,q).bottom.addEventListener("click",()=>{e.scrollTop+=40})},"#init"))}connectedCallback(){y(this,Y,this.getRootNode().host),y(this,ot,this.closest("nine-table-sheet")),this.innerHTML=`
64
64
  <style>
65
65
  nine-table-vscrollbar {
66
66
  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=h(()=>{const i=t(this,Y).shadowRoot.querySelector(".ng-container-body .ng-part-body");if(!i){setTimeout(e,10);return}g(this,q,{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,Ct).call(this),this.refresh()},"initWhenReady");e()}};Y=new WeakMap,it=new WeakMap,Z=new WeakMap,q=new WeakMap,gt=new WeakMap,bt=new WeakMap,Ct=new WeakMap,h(de,"NineTableVScrollBar");let ut=de;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",ut);const fe=class fe{constructor(n){d(this,B);d(this,S);d(this,W,new Map);d(this,L,null);d(this,F,null);d(this,G,0);d(this,yt,40);d(this,ot,!1);d(this,Ht,3);R(this,"refresh",h(()=>{var e;const n=t(this,S).querySelector(".ng-container-body .ng-part-body");n&&(t(this,pt).call(this),t(this,st).call(this,n.scrollTop),(e=t(this,S).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));R(this,"initialize",h(()=>{g(this,L,null),t(this,W).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(s=>{const r=t(this,S).querySelector(s);if(!r)return;const o=r.querySelector(".ng-part-body table");if(!o)return;const l=o.querySelector("tbody.bindable-tbody");if(!l)return;const a=Array.from(l.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,W).set(s,a)});const n=t(this,S).querySelector(".ng-container-body .ng-part-body"),e=t(this,S).querySelector(".ng-container-left .ng-part-body"),i=t(this,S).querySelector(".ng-container-right .ng-part-body");if(n){t(this,_t).call(this,n),t(this,xt).call(this),t(this,pt).call(this),t(this,st).call(this,n.scrollTop);let s=!1;const r=h((o,l)=>{var c;s||(s=!0,n&&n.scrollTop!==o&&(n.scrollTop=o),e&&e.scrollTop!==o&&(e.scrollTop=o),i&&i.scrollTop!==o&&(i.scrollTop=o),t(this,st).call(this,o),(c=t(this,S).querySelector("nine-table-vscrollbar"))==null||c.refresh(),s=!1)},"syncScroll");[n,e,i].forEach(o=>{o&&o.addEventListener("scroll",()=>{r(o.scrollTop)})})}},"initialize"));d(this,Mt,h((n,e)=>{const i=t(this,W).get(e);if(!i||i.length===0)return;const s=n.querySelector(".ng-part-body tbody.bindable-tbody");if(!s)return;s.querySelectorAll("tr:not(.nodata)").forEach(l=>l.remove());const r=s.querySelector("tr.nodata"),o=document.createDocumentFragment();for(let l=0;l<t(this,yt);l++)i.forEach(c=>{o.appendChild(c.cloneNode(!0))});r?r.before(o):s.appendChild(o)},"#renderRows"));d(this,_t,h(n=>{if(t(this,L)!==null&&t(this,L)>0)return t(this,L);const e=t(this,W).get(".ng-container-body");if(!e||e.length===0)return 24;const i=n.querySelector("tbody.bindable-tbody");if(!i)return 24;i.querySelectorAll("tr:not(.nodata)").forEach(y=>y.remove());const s=i.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(y=>{r.appendChild(y.cloneNode(!0))}),s?s.before(r):i.appendChild(r);const o=t(this,S),l=o.style.display,c=o.style.visibility,a=o.style.position;(l==="none"||window.getComputedStyle(o).display==="none")&&(o.style.display="block",o.style.visibility="hidden",o.style.position="absolute");let f=0;const u=i.querySelectorAll("tr:not(.nodata)");return u.forEach(y=>{f+=y.offsetHeight||y.getBoundingClientRect().height}),u.forEach(y=>y.remove()),o.style.display=l,o.style.visibility=c,o.style.position=a,g(this,L,f>0?f:24),t(this,mt).call(this),t(this,L)},"#measureAndCacheHeight"));d(this,pt,h(()=>{const e=(t(this,B).data.get()||[]).length,i=t(this,L)||24,s=e*i;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const o=t(this,S).querySelector(r);if(!o)return;const l=o.querySelector(".ng-part-body .ng-virtual-spacer");l&&(l.style.height=`${s}px`)})},"#updateVirtualScrollHeight"));d(this,mt,h(()=>{if(t(this,G)>0&&t(this,L)>0){const n=Math.ceil(t(this,G)/t(this,L));g(this,yt,n+t(this,Ht))}},"#updateRowCount"));d(this,$t,h(()=>{var l,c,a,f,u,y;const n=t(this,S).querySelector(".ng-container-left .ng-part-body table"),e=t(this,S).querySelector(".ng-container-body .ng-part-body table"),i=t(this,S).querySelector(".ng-container-right .ng-part-body table");if(e){const b=n?Array.from(n.querySelectorAll("tbody tr")):[],p=Array.from(e.querySelectorAll("tbody tr")),E=i?Array.from(i.querySelectorAll("tbody tr")):[],z=Math.max(b.length,p.length,E.length);for(let w=0;w<z;w++){const ft=[((l=b[w])==null?void 0:l.getBoundingClientRect().height)||0,((c=p[w])==null?void 0:c.getBoundingClientRect().height)||0,((a=E[w])==null?void 0:a.getBoundingClientRect().height)||0],N=Math.max(...ft);N>0&&(b[w]&&(b[w].style.height=`${N}px`),p[w]&&(p[w].style.height=`${N}px`),E[w]&&(E[w].style.height=`${N}px`))}}const s=t(this,S).querySelector(".ng-container-left .ng-part-footer table"),r=t(this,S).querySelector(".ng-container-body .ng-part-footer table"),o=t(this,S).querySelector(".ng-container-right .ng-part-footer table");if(r){const b=s?Array.from(s.querySelectorAll("tfoot tr")):[],p=Array.from(r.querySelectorAll("tfoot tr")),E=o?Array.from(o.querySelectorAll("tfoot tr")):[],z=Math.max(b.length,p.length,E.length);for(let w=0;w<z;w++){const ft=[((f=b[w])==null?void 0:f.getBoundingClientRect().height)||0,((u=p[w])==null?void 0:u.getBoundingClientRect().height)||0,((y=E[w])==null?void 0:y.getBoundingClientRect().height)||0],N=Math.max(...ft);N>0&&(b[w]&&(b[w].style.height=`${N}px`),p[w]&&(p[w].style.height=`${N}px`),E[w]&&(E[w].style.height=`${N}px`))}}},"#syncRowHeights"));d(this,It,h(()=>{!t(this,S)||!(t(this,S)instanceof HTMLElement)||(g(this,F,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 r=0;const o=i.querySelector(".ng-part-header"),l=i.querySelector(".ng-part-footer");o&&(r+=o.offsetHeight),l&&(r+=l.offsetHeight);const c=Math.max(s-r,100);t(this,G)!==c&&(g(this,G,c),t(this,mt).call(this),t(this,L)!==null&&t(this,xt).call(this))}}})),t(this,F).observe(t(this,S)))},"#initResizeObserver"));d(this,xt,h(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const e=t(this,S).querySelector(n);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,Mt).call(this,e,n)}),t(this,Ot).call(this),t(this,$t).call(this)},"#renderAllContainers"));d(this,Wt,h(n=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var a;const i=t(this,S).querySelector(e);if(!i)return;const s=i.querySelector(".ng-part-body tbody.bindable-tbody");if(!s)return;const r=Array.from(s.querySelectorAll("tr:not(.nodata)")),o=((a=t(this,W).get(e))==null?void 0:a.length)||1,c=(t(this,B).data.get()||[]).length;r.forEach((f,u)=>{const y=n+Math.floor(u/o);if(y>=c){f.style.display="none";return}const b=t(this,B).data.get(y);f.style.display="",t(this,vt).call(this,f,b,y)})})},"#adjustBufferRows"));d(this,st,h(n=>{var c;const e=t(this,L);if(!e||e<=0)return;const s=(t(this,B).data.get()||[]).length,r=Math.max(0,Math.floor(n/e)),o=r*e,l=((c=t(this,W).get(".ng-container-body"))==null?void 0:c.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(a=>{const f=t(this,S).querySelector(a);if(!f)return;const u=f.querySelector(".ng-part-body tbody.bindable-tbody");if(!u)return;u.style.transform=`translateY(${o}px)`,Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((b,p)=>{const E=r+Math.floor(p/l);if(E>=s){b.style.display="none";return}const z=t(this,B).data.get(E);b.style.display="",t(this,vt).call(this,b,z,E)})}),t(this,ot)||(g(this,ot,!0),setTimeout(()=>{t(this,Wt).call(this,r),g(this,ot,!1)},0))},"#handleScroll"));d(this,vt,h((n,e,i)=>{n.dataset.row=i,Array.from(n.cells).forEach((s,r)=>{const o=s.dataset.bind;o&&e&&e[o]!==void 0?s.textContent=e[o]:s.textContent=e?e[Object.keys(e)[r]]??`R${i}C${r}`:`ν–‰ ${i+1}`,s.dataset.row=i})},"#bindRowData"));d(this,Ot,h(()=>{var c,a,f;const n=t(this,S).querySelector(".ng-container-left .ng-part-header table"),e=t(this,S).querySelector(".ng-container-body .ng-part-header table"),i=t(this,S).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const s=n?Array.from(n.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),o=i?Array.from(i.querySelectorAll("tr")):[],l=Math.max(s.length,r.length,o.length);for(let u=0;u<l;u++){const y=[((c=s[u])==null?void 0:c.getBoundingClientRect().height)||0,((a=r[u])==null?void 0:a.getBoundingClientRect().height)||0,((f=o[u])==null?void 0:f.getBoundingClientRect().height)||0],b=Math.max(...y);b>0&&(s[u]&&(s[u].style.height=`${b}px`),r[u]&&(r[u].style.height=`${b}px`),o[u]&&(o[u].style.height=`${b}px`))}},"#syncHeaderHeights"));R(this,"destroy",h(()=>{t(this,F)&&(t(this,F).disconnect(),g(this,F,null))},"destroy"));g(this,B,n.getRootNode().host),g(this,S,n),t(this,It).call(this)}getRowHeight(){return t(this,L)}templateLength(n=".ng-container-body"){var e;return((e=t(this,W).get(n))==null?void 0:e.length)||1}};B=new WeakMap,S=new WeakMap,W=new WeakMap,L=new WeakMap,F=new WeakMap,G=new WeakMap,yt=new WeakMap,ot=new WeakMap,Ht=new WeakMap,Mt=new WeakMap,_t=new WeakMap,pt=new WeakMap,mt=new WeakMap,$t=new WeakMap,It=new WeakMap,xt=new WeakMap,Wt=new WeakMap,st=new WeakMap,vt=new WeakMap,Ot=new WeakMap,h(fe,"RowManager");let te=fe;const O=class O{static compileAll(n){return Array.isArray(n)?n.map(e=>O.compile(e)):[]}static compile(n){var s,r,o,l;if(!n)return null;const e=n.cloneNode(!0);return t(s=O,zt).call(s,e),t(r=O,rt).call(r,e,"thead"),t(o=O,rt).call(o,e,"tbody"),t(l=O,rt).call(l,e,"tfoot"),Array.from(e.querySelectorAll("colgroup col")).forEach((c,a)=>{const f=c.getAttribute("fixed");f&&e.querySelectorAll(`thead [data-col="${a}"], tbody [data-col="${a}"], tfoot [data-col="${a}"]`).forEach(u=>{u.setAttribute("fixed",f)})}),e}};zt=new WeakMap,rt=new WeakMap,h(O,"TableCompiler"),d(O,zt,h(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"),r=Math.max(Math.floor(n.clientWidth/i),100);for(let o=0;o<i;o++){const l=document.createElement("col");l.setAttribute("width",r),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")),d(O,rt,h((n,e)=>{const i=Array.from(n.querySelectorAll(e+" tr")),s=Array.from(n.querySelectorAll(e+" th,"+e+" td")),r=i.length;if(r===0||s.length===0)return;let o=0;s.forEach(c=>{o+=c.colSpan||1});const l=Array.from(Array(r),()=>Array(o).fill(null));i.forEach(c=>{const a=c.sectionRowIndex;let f=0;Array.from(c.querySelectorAll("th,td")).forEach(u=>{for(let p=0;p<l[a].length;p++)if(l[a][p]===null){f=p;break}const y=u.rowSpan||1,b=u.colSpan||1;for(let p=0;p<y;p++)for(let E=0;E<b;E++)a+p<r&&f+E<o&&(l[a+p][f+E]=p===0&&E===0?"1":"0")})}),i.forEach(c=>{const a=c.sectionRowIndex;Array.from(c.querySelectorAll("th,td")).forEach(f=>{for(let u=0;u<l[a].length;u++)if(l[a][u]==="1"){f.dataset.col=u,l[a][u]="0";break}})})},"#resetColIndex"));let ee=O;const wt=class wt extends HTMLElement{constructor(){super();d(this,Bt);d(this,J,null);d(this,Q);R(this,"invalidate",h(()=>{var e,i;t(this,Q).refresh(),(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),(i=this.querySelector("nine-table-vscrollbar"))==null||i.refresh()},"invalidate"));d(this,Nt,h(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:i,type:s})=>{const r=this.querySelector(i);if(!r)return;r.innerHTML="";const o=document.createElement("div");o.className="ng-part-header",o.appendChild(t(this,lt).call(this,t(this,J),s,"header"));const l=document.createElement("div");l.className="ng-part-body";const c=document.createElement("div");c.className="ng-scroll-content",c.style.position="relative",c.style.width="100%",c.appendChild(t(this,lt).call(this,t(this,J),s,"body"));const a=document.createElement("div");a.className="ng-virtual-spacer",a.style.width="100%",a.style.pointerEvents="none",c.appendChild(a),l.appendChild(c);const f=document.createElement("div");f.className="ng-part-footer",f.appendChild(t(this,lt).call(this,t(this,J),s,"footer")),r.appendChild(o),r.appendChild(l),r.appendChild(f)})},"#renderSplitContainers"));d(this,Pt,h(()=>{["left","right","body"].forEach(e=>{const i=this.querySelector(`.ng-container-${e}`),s=i==null?void 0:i.querySelectorAll("table");if(!i||!s||s.length===0)return;let r=0;s[0].querySelectorAll("col").forEach(o=>{const l=parseInt(o.getAttribute("width"),10);isNaN(r)||(r+=l)}),e==="body"?i.style.flex="1":(i.style.flex=`0 0 ${r}px`,i.style.width=`${r}px`)})},"#updateContainerWidths"));R(this,"generate",h(e=>{e&&(g(this,J,ee.compile(e)),t(this,Nt).call(this),t(this,Pt).call(this),t(this,Q).initialize(),setTimeout(()=>{var i;(i=this.querySelector("nine-table-hscrollbar"))==null||i.refresh()},0))},"generate"));d(this,lt,h((e,i,s)=>{const r=e.cloneNode(!0),o=r.querySelector("thead"),l=r.querySelector("tbody"),c=r.querySelector("tfoot");if(s==="header"){if(l&&l.remove(),c&&c.remove(),e.querySelector("tbody")){const f=document.createElement("tbody");f.className="fixed-tbody",r.appendChild(f)}}else s==="body"?(o&&o.remove(),c&&c.remove(),l&&(l.className="bindable-tbody")):s==="footer"&&(o&&o.remove(),l&&l.remove());return i==="left"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(a=>{a.getAttribute("fixed")!=="left"&&a.remove()}):i==="right"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(a=>{a.getAttribute("fixed")!=="right"&&a.remove()}):r.querySelectorAll("[fixed=left], [fixed=right]").forEach(a=>{a.remove()}),r},"#createSplitTable"));R(this,"getRowHeight",h(()=>t(this,Q).getRowHeight(),"getRowHeight"));R(this,"scrollToX",h(e=>{const i=this.querySelector(".ng-container-body .ng-part-body");i&&(i.scrollLeft=e)},"scrollToX"));R(this,"scrollToY",h(e=>{const i=this.querySelector(".ng-container-body .ng-part-body");i&&(i.scrollTop=e)},"scrollToY"));d(this,Dt,h(()=>{t(this,Yt).call(this)},"#init"));d(this,Yt,h(()=>{const e=wt.SCROLLBAR_SIZE;this.innerHTML=`
126
+ `;const e=h(()=>{const n=t(this,Y).shadowRoot.querySelector(".ng-container-body .ng-part-body");if(!n){setTimeout(e,10);return}y(this,q,{container:n,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,Ct).call(this),this.refresh()},"initWhenReady");e()}};Y=new WeakMap,ot=new WeakMap,G=new WeakMap,q=new WeakMap,ut=new WeakMap,gt=new WeakMap,Ct=new WeakMap,h(de,"NineTableVScrollBar");let ft=de;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",ft);const fe=class fe{constructor(i){d(this,B);d(this,E);d(this,N,new Map);d(this,C,null);d(this,F,null);d(this,J,0);d(this,bt,40);d(this,st,!1);d(this,Ht,3);R(this,"refresh",h(()=>{var e;const i=t(this,E).querySelector(".ng-container-body .ng-part-body");i&&(t(this,yt).call(this),t(this,rt).call(this,i.scrollTop),(e=t(this,E).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));R(this,"initialize",h(()=>{y(this,C,null),t(this,N).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(o=>{const r=t(this,E).querySelector(o);if(!r)return;const s=r.querySelector(".ng-part-body table");if(!s)return;const l=s.querySelector("tbody.bindable-tbody");if(!l)return;const a=Array.from(l.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,N).set(o,a)});const i=t(this,E).querySelector(".ng-container-body .ng-part-body"),e=t(this,E).querySelector(".ng-container-left .ng-part-body"),n=t(this,E).querySelector(".ng-container-right .ng-part-body");if(i){t(this,_t).call(this,i),t(this,mt).call(this),t(this,yt).call(this),t(this,rt).call(this,i.scrollTop);let o=!1;const r=h((s,l)=>{var c;o||(o=!0,i&&i.scrollTop!==s&&(i.scrollTop=s),e&&e.scrollTop!==s&&(e.scrollTop=s),n&&n.scrollTop!==s&&(n.scrollTop=s),t(this,rt).call(this,s),(c=t(this,E).querySelector("nine-table-vscrollbar"))==null||c.refresh(),o=!1)},"syncScroll");[i,e,n].forEach(s=>{s&&s.addEventListener("scroll",()=>{r(s.scrollTop)})})}},"initialize"));d(this,Mt,h((i,e)=>{const n=t(this,N).get(e);if(!n||n.length===0)return;const o=i.querySelector(".ng-part-body tbody.bindable-tbody");if(!o)return;o.querySelectorAll("tr:not(.nodata)").forEach(l=>l.remove());const r=o.querySelector("tr.nodata"),s=document.createDocumentFragment();for(let l=0;l<t(this,bt);l++)n.forEach(c=>{s.appendChild(c.cloneNode(!0))});r?r.before(s):o.appendChild(s)},"#renderRows"));d(this,_t,h(i=>{if(t(this,C)!==null&&t(this,C)>0)return t(this,C);const e=t(this,N).get(".ng-container-body");if(!e||e.length===0)return 24;const n=i.querySelector("tbody.bindable-tbody");if(!n)return 24;n.querySelectorAll("tr:not(.nodata)").forEach(b=>b.remove());const o=n.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(b=>{r.appendChild(b.cloneNode(!0))}),o?o.before(r):n.appendChild(r);const s=t(this,E),l=s.style.display,c=s.style.visibility,a=s.style.position;(l==="none"||window.getComputedStyle(s).display==="none")&&(s.style.display="block",s.style.visibility="hidden",s.style.position="absolute");let f=0;const g=n.querySelectorAll("tr:not(.nodata)");return g.forEach(b=>{f+=b.offsetHeight||b.getBoundingClientRect().height}),g.forEach(b=>b.remove()),s.style.display=l,s.style.visibility=c,s.style.position=a,y(this,C,f>0?f:24),t(this,pt).call(this),t(this,C)},"#measureAndCacheHeight"));d(this,yt,h(()=>{const e=(t(this,B).data.get()||[]).length,n=t(this,C)||24,o=e*n;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const s=t(this,E).querySelector(r);if(!s)return;const l=s.querySelector(".ng-part-body .ng-virtual-spacer");l&&(l.style.height=`${o}px`)})},"#updateVirtualScrollHeight"));d(this,pt,h(()=>{if(t(this,J)>0&&t(this,C)>0){const i=Math.ceil(t(this,J)/t(this,C));y(this,bt,i+t(this,Ht))}},"#updateRowCount"));d(this,$t,h(()=>{var l,c,a,f,g,b;const i=t(this,E).querySelector(".ng-container-left .ng-part-body table"),e=t(this,E).querySelector(".ng-container-body .ng-part-body table"),n=t(this,E).querySelector(".ng-container-right .ng-part-body table");if(e){const u=i?Array.from(i.querySelectorAll("tbody tr")):[],p=Array.from(e.querySelectorAll("tbody tr")),x=n?Array.from(n.querySelectorAll("tbody tr")):[],T=Math.max(u.length,p.length,x.length);for(let m=0;m<T;m++){const U=[((l=u[m])==null?void 0:l.getBoundingClientRect().height)||0,((c=p[m])==null?void 0:c.getBoundingClientRect().height)||0,((a=x[m])==null?void 0:a.getBoundingClientRect().height)||0],W=Math.max(...U);W>0&&(u[m]&&(u[m].style.height=`${W}px`),p[m]&&(p[m].style.height=`${W}px`),x[m]&&(x[m].style.height=`${W}px`))}}const o=t(this,E).querySelector(".ng-container-left .ng-part-footer table"),r=t(this,E).querySelector(".ng-container-body .ng-part-footer table"),s=t(this,E).querySelector(".ng-container-right .ng-part-footer table");if(r){const u=o?Array.from(o.querySelectorAll("tfoot tr")):[],p=Array.from(r.querySelectorAll("tfoot tr")),x=s?Array.from(s.querySelectorAll("tfoot tr")):[],T=Math.max(u.length,p.length,x.length);for(let m=0;m<T;m++){const U=[((f=u[m])==null?void 0:f.getBoundingClientRect().height)||0,((g=p[m])==null?void 0:g.getBoundingClientRect().height)||0,((b=x[m])==null?void 0:b.getBoundingClientRect().height)||0],W=Math.max(...U);W>0&&(u[m]&&(u[m].style.height=`${W}px`),p[m]&&(p[m].style.height=`${W}px`),x[m]&&(x[m].style.height=`${W}px`))}}},"#syncRowHeights"));d(this,It,h(()=>{!t(this,E)||!(t(this,E)instanceof HTMLElement)||(y(this,F,new ResizeObserver(i=>{for(const e of i){const n=e.target;if(!n.classList.contains("active"))continue;const o=e.contentRect.height;if(o>0){let r=0;const s=n.querySelector(".ng-part-header"),l=n.querySelector(".ng-part-footer");s&&(r+=s.offsetHeight),l&&(r+=l.offsetHeight);const c=Math.max(o-r,100);t(this,J)!==c&&(y(this,J,c),t(this,pt).call(this),t(this,C)!==null&&t(this,mt).call(this))}}})),t(this,F).observe(t(this,E)))},"#initResizeObserver"));d(this,mt,h(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(i=>{const e=t(this,E).querySelector(i);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,Mt).call(this,e,i)}),t(this,Ot).call(this),t(this,$t).call(this)},"#renderAllContainers"));d(this,Wt,h(i=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var a;const n=t(this,E).querySelector(e);if(!n)return;const o=n.querySelector(".ng-part-body tbody.bindable-tbody");if(!o)return;const r=Array.from(o.querySelectorAll("tr:not(.nodata)")),s=((a=t(this,N).get(e))==null?void 0:a.length)||1,c=(t(this,B).data.get()||[]).length;r.forEach((f,g)=>{const b=i+Math.floor(g/s);if(b>=c){f.style.display="none";return}const u=t(this,B).data.get(b);f.style.display="",t(this,xt).call(this,f,u,b)})})},"#adjustBufferRows"));d(this,rt,h(i=>{var c;const e=t(this,C);if(!e||e<=0)return;const o=(t(this,B).data.get()||[]).length,r=Math.max(0,Math.floor(i/e)),s=r*e,l=((c=t(this,N).get(".ng-container-body"))==null?void 0:c.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(a=>{const f=t(this,E).querySelector(a);if(!f)return;const g=f.querySelector(".ng-part-body tbody.bindable-tbody");if(!g)return;g.style.transform=`translateY(${s}px)`,Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((u,p)=>{const x=r+Math.floor(p/l);if(x>=o){u.style.display="none";return}const T=t(this,B).data.get(x);u.style.display="",t(this,xt).call(this,u,T,x)})}),t(this,st)||(y(this,st,!0),setTimeout(()=>{t(this,Wt).call(this,r),y(this,st,!1)},0))},"#handleScroll"));d(this,xt,h((i,e,n)=>{i.dataset.row=n,i.data=e,Array.from(i.cells).forEach((o,r)=>{o.dataset.row=n;const s=o.querySelector('ng-input, ng-cell-ex, [is^="ng-"]');if(s&&typeof s.reset=="function")s.reset();else{const l=o.dataset.bind;l&&e&&e[l]!==void 0?o.textContent=e[l]:o.textContent=e?e[Object.keys(e)[r]]??`R${n}C${r}`:`ν–‰ ${n+1}`}})},"#bindRowData"));d(this,Ot,h(()=>{var c,a,f;const i=t(this,E).querySelector(".ng-container-left .ng-part-header table"),e=t(this,E).querySelector(".ng-container-body .ng-part-header table"),n=t(this,E).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const o=i?Array.from(i.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),s=n?Array.from(n.querySelectorAll("tr")):[],l=Math.max(o.length,r.length,s.length);for(let g=0;g<l;g++){const b=[((c=o[g])==null?void 0:c.getBoundingClientRect().height)||0,((a=r[g])==null?void 0:a.getBoundingClientRect().height)||0,((f=s[g])==null?void 0:f.getBoundingClientRect().height)||0],u=Math.max(...b);u>0&&(o[g]&&(o[g].style.height=`${u}px`),r[g]&&(r[g].style.height=`${u}px`),s[g]&&(s[g].style.height=`${u}px`))}},"#syncHeaderHeights"));R(this,"destroy",h(()=>{t(this,F)&&(t(this,F).disconnect(),y(this,F,null))},"destroy"));y(this,B,i.getRootNode().host),y(this,E,i),t(this,It).call(this)}getRowHeight(){return t(this,C)}templateLength(i=".ng-container-body"){var e;return((e=t(this,N).get(i))==null?void 0:e.length)||1}};B=new WeakMap,E=new WeakMap,N=new WeakMap,C=new WeakMap,F=new WeakMap,J=new WeakMap,bt=new WeakMap,st=new WeakMap,Ht=new WeakMap,Mt=new WeakMap,_t=new WeakMap,yt=new WeakMap,pt=new WeakMap,$t=new WeakMap,It=new WeakMap,mt=new WeakMap,Wt=new WeakMap,rt=new WeakMap,xt=new WeakMap,Ot=new WeakMap,h(fe,"RowManager");let te=fe;const Nt=class Nt{static compileAll(i){return Array.isArray(i)?i.map(e=>Nt.compile(e)):[]}static compile(i){if(!i)return null;const e=h(l=>{l.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach(a=>{const f=a.getAttribute("cell-type")||"renderer";if(a.children.length>0&&a.firstElementChild.tagName.includes("-"))return;let g=`cell-${f}`;const b=a.getAttribute("data-bind"),u=a.getAttribute("data-expr"),p=a.getAttribute("maxbyte"),x=a.getAttribute("type");let T=[];b&&T.push(`data-bind="${b}"`),u&&T.push(`data-expr="${u}"`),p&&T.push(`maxbyte="${p}"`),x&&T.push(`type="${x}"`),a.innerHTML=`<${g} ${T.join(" ")}></${g}>`})},"processCellTypes"),n=h(l=>{if(!l.querySelector("colgroup")){const c=l.querySelector("tbody tr")||l.querySelector("tr"),a=c?c.querySelectorAll("th, td").length:1,f=document.createElement("colgroup"),g=Math.max(Math.floor(l.clientWidth/a),100);for(let b=0;b<a;b++){const u=document.createElement("col");u.setAttribute("width",g),f.appendChild(u)}l.prepend(f)}if(!l.querySelector("thead")){const c=document.createElement("thead"),a=l.querySelector("colgroup");a?a.after(c):l.prepend(c)}l.classList.add("nine-table-element"),l.style.display="table"},"ensureTableStructure"),o=h((l,c)=>{const a=Array.from(l.querySelectorAll(c+" tr")),f=Array.from(l.querySelectorAll(c+" th,"+c+" td")),g=a.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));a.forEach(p=>{const x=p.sectionRowIndex;let T=0;Array.from(p.querySelectorAll("th,td")).forEach(m=>{for(let z=0;z<u[x].length;z++)if(u[x][z]===null){T=z;break}const U=m.rowSpan||1,W=m.colSpan||1;for(let z=0;z<U;z++)for(let qt=0;qt<W;qt++)x+z<g&&T+qt<b&&(u[x+z][T+qt]=z===0&&qt===0?"1":"0")})}),a.forEach(p=>{const x=p.sectionRowIndex;Array.from(p.querySelectorAll("th,td")).forEach(T=>{for(let m=0;m<u[x].length;m++)if(u[x][m]==="1"){T.dataset.col=m,u[x][m]="0";break}})})},"resetColIndex"),r=i.cloneNode(!0);return n(r),e(r),o(r,"thead"),o(r,"tbody"),o(r,"tfoot"),Array.from(r.querySelectorAll("colgroup col")).forEach((l,c)=>{const a=l.getAttribute("fixed");a&&r.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach(f=>{f.setAttribute("fixed",a)})}),r}};h(Nt,"TableCompiler");let ee=Nt;const vt=class vt extends HTMLElement{constructor(){super();d(this,zt);d(this,Q,null);d(this,tt);R(this,"invalidate",h(()=>{var e,n;t(this,tt).refresh(),(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),(n=this.querySelector("nine-table-vscrollbar"))==null||n.refresh()},"invalidate"));d(this,Bt,h(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:n,type:o})=>{const r=this.querySelector(n);if(!r)return;r.innerHTML="";const s=document.createElement("div");s.className="ng-part-header",s.appendChild(t(this,lt).call(this,t(this,Q),o,"header"));const l=document.createElement("div");l.className="ng-part-body";const c=document.createElement("div");c.className="ng-scroll-content",c.style.position="relative",c.style.width="100%",c.appendChild(t(this,lt).call(this,t(this,Q),o,"body"));const a=document.createElement("div");a.className="ng-virtual-spacer",a.style.width="100%",a.style.pointerEvents="none",c.appendChild(a),l.appendChild(c);const f=document.createElement("div");f.className="ng-part-footer",f.appendChild(t(this,lt).call(this,t(this,Q),o,"footer")),r.appendChild(s),r.appendChild(l),r.appendChild(f)})},"#renderSplitContainers"));d(this,Pt,h(()=>{["left","right","body"].forEach(e=>{const n=this.querySelector(`.ng-container-${e}`),o=n==null?void 0:n.querySelectorAll("table");if(!n||!o||o.length===0)return;let r=0;o[0].querySelectorAll("col").forEach(s=>{const l=parseInt(s.getAttribute("width"),10);isNaN(r)||(r+=l)}),e==="body"?n.style.flex="1":(n.style.flex=`0 0 ${r}px`,n.style.width=`${r}px`)})},"#updateContainerWidths"));R(this,"generate",h(e=>{e&&(y(this,Q,ee.compile(e)),t(this,Bt).call(this),t(this,Pt).call(this),t(this,tt).initialize(),setTimeout(()=>{var n;(n=this.querySelector("nine-table-hscrollbar"))==null||n.refresh()},0))},"generate"));d(this,lt,h((e,n,o)=>{const r=e.cloneNode(!0),s=r.querySelector("thead"),l=r.querySelector("tbody"),c=r.querySelector("tfoot");if(o==="header"){if(l&&l.remove(),c&&c.remove(),e.querySelector("tbody")){const f=document.createElement("tbody");f.className="fixed-tbody",r.appendChild(f)}}else o==="body"?(s&&s.remove(),c&&c.remove(),l&&(l.className="bindable-tbody")):o==="footer"&&(s&&s.remove(),l&&l.remove());return n==="left"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(a=>{a.getAttribute("fixed")!=="left"&&a.remove()}):n==="right"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(a=>{a.getAttribute("fixed")!=="right"&&a.remove()}):r.querySelectorAll("[fixed=left], [fixed=right]").forEach(a=>{a.remove()}),r},"#createSplitTable"));R(this,"getRowHeight",h(()=>t(this,tt).getRowHeight(),"getRowHeight"));R(this,"scrollToX",h(e=>{const n=this.querySelector(".ng-container-body .ng-part-body");n&&(n.scrollLeft=e)},"scrollToX"));R(this,"scrollToY",h(e=>{const n=this.querySelector(".ng-container-body .ng-part-body");n&&(n.scrollTop=e)},"scrollToY"));d(this,Dt,h(()=>{t(this,Yt).call(this)},"#init"));d(this,Yt,h(()=>{const e=vt.SCROLLBAR_SIZE;this.innerHTML=`
127
127
  <style>
128
128
  nine-table-sheet {
129
129
  display: none;
@@ -190,6 +190,7 @@
190
190
  overflow-x: auto;
191
191
  position: relative;
192
192
  scrollbar-width: none;
193
+ overscroll-behavior: none; /* 🎯 양끝에 λ‹Ώμ•˜μ„ λ•Œ 덜μ»₯거리며 λ°€λ¦¬λŠ” λ°”μš΄μŠ€ ν˜„μƒ 차단 */
193
194
  &::-webkit-scrollbar { display: none; height: 0px; }
194
195
  }
195
196
 
@@ -261,14 +262,14 @@
261
262
  <nine-table-hscrollbar></nine-table-hscrollbar>
262
263
  <div class='ng-scroll-edge'></div>
263
264
  </div>
264
- `},"#render"));g(this,Q,new te(this)),g(this,Bt,this.getRootNode().host)}connectedCallback(){t(this,Dt).call(this)}disconnectedCallback(){this.innerHTML="",A.log("NineTableSheet destroyed.")}};Bt=new WeakMap,J=new WeakMap,Q=new WeakMap,Nt=new WeakMap,Pt=new WeakMap,lt=new WeakMap,Dt=new WeakMap,Yt=new WeakMap,h(wt,"NineTableSheet"),R(wt,"SCROLLBAR_SIZE",16);let Tt=wt;customElements.get("nine-table-sheet")||customElements.define("nine-table-sheet",Tt);const ue=class ue extends HTMLElement{constructor(){super();d(this,Ft,h(()=>{var e;(e=this.querySelector(".nine-tab-bar"))==null||e.addEventListener("click",i=>{var o;const s=i.ctrlKey||i.metaKey||i.shiftKey,r=parseInt((o=i.target.closest(".nine-tab-item"))==null?void 0:o.dataset.index,10);t(this,St).call(this,r,s)}),t(this,St).call(this,0,!1)},"#init"));d(this,St,h((e,i=!1)=>{const s=h(()=>{const f=Array.from(this.querySelectorAll("nine-table-sheet"));Array.from(this.querySelectorAll("nine-splitter")).forEach(b=>b.style.setProperty("display","none"));const y=f.filter(b=>b.classList.contains("active"));y.length<2||y.forEach(b=>{const p=parseInt(b.getAttribute("data-index"),10),E=this.querySelector(`nine-splitter[data-split-index="${p}"]`),z=f[p+1];E&&z&&z.classList.contains("active")&&E.style.setProperty("display","flex")})},"updateSplitters"),r=this.querySelector(".nine-tab-bar"),o=this.querySelector("nine-table-sheets-body"),l=r.querySelectorAll(".nine-tab-item"),c=o.querySelectorAll("nine-table-sheet");if(!l[e])return;if(!i)l.forEach((f,u)=>{f.classList.toggle("active",u===e)}),c.forEach((f,u)=>{const y=u===e;f.classList.toggle("active",y),f.style.flex=y?"1 1 100%":""});else{const f=l[e],u=r.querySelectorAll(".nine-tab-item.active");if(f.classList.contains("active")&&u.length<=1)return;f.classList.toggle("active");const y=o.querySelector(`nine-table-sheet[data-index="${e}"]`);y&&(y.classList.toggle("active"),y.classList.contains("active")||(y.style.flex=""))}const a=o.querySelectorAll("nine-table-sheet.active");a==null||a.forEach(f=>{f.style.flex=a.length>1?"1 1 0%":"1 1 100%"}),s()},"#switchSheet"))}connectedCallback(){t(this,Ft).call(this)}};Ft=new WeakMap,St=new WeakMap,h(ue,"NineTableSheets");let ne=ue;customElements.get("nine-table-sheets")||customElements.define("nine-table-sheets",ne);const ge=class ge{constructor(n){d(this,C);d(this,Vt,h(()=>{t(this,Ut).call(this),new ResizeObserver(n=>{for(let e of n)t(this,C).getAttribute("auto-height")==="true"&&t(this,Et).call(this)}).observe(t(this,C))},"#init"));d(this,Et,h(()=>{var c,a;const n=Array.from(t(this,C).shadowRoot.querySelectorAll("nine-table-sheet.active"));if(n.length===0)return;const e=parseInt(t(this,C).getAttribute("max-display-row"),10)||10,i=Math.max(...n.map(f=>f.getRowHeight())),s=(c=t(this,C).shadowRoot.querySelector("nine-table-header"))==null?void 0:c.getBoundingClientRect().height,r=(a=t(this,C).shadowRoot.querySelector("nine-table-sheets-footer"))==null?void 0:a.getBoundingClientRect().height,o=Tt.SCROLLBAR_SIZE,l=e*i+s+r+o;t(this,C).style.height=`${l}px`},"#applyAutoHeight"));d(this,Ut,h(()=>{const e=Array.from(t(this,C).children).filter(c=>c.tagName==="TABLE"),i=t(this,C).getAttribute("auto-height")==="true",s=e.length,r=e.map((c,a)=>{const u=`<nine-table-sheet class="${a===0?"active":""}" data-index="${a}"></nine-table-sheet>`,y=a<s-1?`<nine-splitter class="h" data-split-index="${a}"></nine-splitter>`:"";return u+y}).join(""),o=e.map((c,a)=>`<div class="nine-tab-item ${a===0?"active":""}" data-index="${a}">Sheet ${a+1}</div>`).join("");t(this,C).shadowRoot.innerHTML=`
265
+ `},"#render"));y(this,tt,new te(this)),y(this,zt,this.getRootNode().host)}connectedCallback(){t(this,Dt).call(this)}disconnectedCallback(){this.innerHTML="",A.log("NineTableSheet destroyed.")}};zt=new WeakMap,Q=new WeakMap,tt=new WeakMap,Bt=new WeakMap,Pt=new WeakMap,lt=new WeakMap,Dt=new WeakMap,Yt=new WeakMap,h(vt,"NineTableSheet"),R(vt,"SCROLLBAR_SIZE",16);let Tt=vt;customElements.get("nine-table-sheet")||customElements.define("nine-table-sheet",Tt);const ue=class ue extends HTMLElement{constructor(){super();d(this,Ft,h(()=>{var e;(e=this.querySelector(".nine-tab-bar"))==null||e.addEventListener("click",n=>{var s;const o=n.ctrlKey||n.metaKey||n.shiftKey,r=parseInt((s=n.target.closest(".nine-tab-item"))==null?void 0:s.dataset.index,10);t(this,wt).call(this,r,o)}),t(this,wt).call(this,0,!1)},"#init"));d(this,wt,h((e,n=!1)=>{const o=h(()=>{const f=Array.from(this.querySelectorAll("nine-table-sheet"));Array.from(this.querySelectorAll("nine-splitter")).forEach(u=>u.style.setProperty("display","none"));const b=f.filter(u=>u.classList.contains("active"));b.length<2||b.forEach(u=>{const p=parseInt(u.getAttribute("data-index"),10),x=this.querySelector(`nine-splitter[data-split-index="${p}"]`),T=f[p+1];x&&T&&T.classList.contains("active")&&x.style.setProperty("display","flex")})},"updateSplitters"),r=this.querySelector(".nine-tab-bar"),s=this.querySelector("nine-table-sheets-body"),l=r.querySelectorAll(".nine-tab-item"),c=s.querySelectorAll("nine-table-sheet");if(!l[e])return;if(!n)l.forEach((f,g)=>{f.classList.toggle("active",g===e)}),c.forEach((f,g)=>{const b=g===e;f.classList.toggle("active",b),f.style.flex=b?"1 1 100%":""});else{const f=l[e],g=r.querySelectorAll(".nine-tab-item.active");if(f.classList.contains("active")&&g.length<=1)return;f.classList.toggle("active");const b=s.querySelector(`nine-table-sheet[data-index="${e}"]`);b&&(b.classList.toggle("active"),b.classList.contains("active")||(b.style.flex=""))}const a=s.querySelectorAll("nine-table-sheet.active");a==null||a.forEach(f=>{f.style.flex=a.length>1?"1 1 0%":"1 1 100%"}),o()},"#switchSheet"))}connectedCallback(){t(this,Ft).call(this)}};Ft=new WeakMap,wt=new WeakMap,h(ue,"NineTableSheets");let ne=ue;customElements.get("nine-table-sheets")||customElements.define("nine-table-sheets",ne);const ge=class ge{constructor(i){d(this,H);d(this,Vt,h(()=>{t(this,Ut).call(this),new ResizeObserver(i=>{for(let e of i)t(this,H).getAttribute("auto-height")==="true"&&t(this,St).call(this)}).observe(t(this,H))},"#init"));d(this,St,h(()=>{var c,a;const i=Array.from(t(this,H).shadowRoot.querySelectorAll("nine-table-sheet.active"));if(i.length===0)return;const e=parseInt(t(this,H).getAttribute("max-display-row"),10)||10,n=Math.max(...i.map(f=>f.getRowHeight())),o=(c=t(this,H).shadowRoot.querySelector("nine-table-header"))==null?void 0:c.getBoundingClientRect().height,r=(a=t(this,H).shadowRoot.querySelector("nine-table-sheets-footer"))==null?void 0:a.getBoundingClientRect().height,s=Tt.SCROLLBAR_SIZE,l=e*n+o+r+s;t(this,H).style.height=`${l}px`},"#applyAutoHeight"));d(this,Ut,h(()=>{const e=Array.from(t(this,H).children).filter(c=>c.tagName==="TABLE"),n=t(this,H).getAttribute("auto-height")==="true",o=e.length,r=e.map((c,a)=>{const g=`<nine-table-sheet class="${a===0?"active":""}" data-index="${a}"></nine-table-sheet>`,b=a<o-1?`<nine-splitter class="h" data-split-index="${a}"></nine-splitter>`:"";return g+b}).join(""),s=e.map((c,a)=>`<div class="nine-tab-item ${a===0?"active":""}" data-index="${a}">Sheet ${a+1}</div>`).join("");t(this,H).shadowRoot.innerHTML=`
265
266
  <style>
266
267
  :host {
267
268
  display: flex;
268
269
  flex-direction: column;
269
270
  position: relative;
270
271
  overflow: hidden;
271
- height: ${i?"auto":"100%"};
272
+ height: ${n?"auto":"100%"};
272
273
  background: #fff;
273
274
  }
274
275
 
@@ -344,12 +345,12 @@
344
345
  <nine-table-sheets>
345
346
  <nine-table-sheets-body>${r}</nine-table-sheets-body>
346
347
  <nine-table-sheets-footer>
347
- <div class="nine-tab-bar">${o}</div>
348
+ <div class="nine-tab-bar">${s}</div>
348
349
  <div class="sheets-counter">Total : <span id="row-count">0</span></div>
349
350
  </nine-table-sheets-footer>
350
351
  </nine-table-sheets>
351
352
  <nine-table-analysis></nine-table-analysis>
352
353
  </nine-table-body>
353
354
  <nine-table-footer></nine-table-footer>
354
- `;const l=t(this,C).shadowRoot.querySelectorAll("nine-table-sheet");l==null||l.forEach((c,a)=>{e[a]&&setTimeout(()=>{c.generate(e[a]),i&&t(this,Et).call(this)})})},"#render"));g(this,C,n),t(this,Vt).call(this)}};C=new WeakMap,Vt=new WeakMap,Et=new WeakMap,Ut=new WeakMap,h(ge,"LayoutManager");let ie=ge;const be=class be{constructor(n){d(this,Rt);d(this,at,-1);R(this,"count",h(()=>t(this,Rt).rawRecords.length,"count"));g(this,Rt,n)}get at(){return t(this,at)}set at(n){g(this,at,parseInt(n,10)),body&&!body.querySelector(`tbody.bindable tr[data-row="${t(this,at)}"]`)&&setTimeout(()=>{})}};Rt=new WeakMap,at=new WeakMap,h(be,"ngRow");let oe=be;const _=class _{constructor(n,e){d(this,H);d(this,T);d(this,M,[]);d(this,ct,[]);d(this,Xt,0);d(this,V,[]);d(this,jt,h(()=>{g(this,V,[]);const n=t(this,H).template||[];Array.from(n).forEach(e=>{var i;t(this,V).push(((i=e.getBoundingClientRect)==null?void 0:i.call(e).height)||24)}),(t(this,T).rawRecords||[]).forEach(e=>{e.__ng||(e.__ng=t(this,At).call(this)),e.__ng.height=t(this,V).slice()})},"#initialize"));d(this,tt,h(()=>{t(this,H).shadowRoot.querySelectorAll("nine-table-sheet").forEach(n=>{n.invalidate()})},"#invalidate"));R(this,"get",h((n,e)=>{var r;const i=this.getValidData();if(!i||i.length<=0)return;if(n==null)return t(this,ht).call(this,i);if(n<0||n>=i.length)return null;const s=typeof((r=t(this,H).fields)==null?void 0:r.get)=="function"?t(this,H).fields.get():[];if(e!=null){const o=s.indexOf(e);return o>=0?i[n].v[o]:null}return t(this,ht).call(this,i[n])},"get"));R(this,"set",h(n=>{this.clear(),this.add(n,!1),t(this,tt).call(this)},"set"));d(this,At,h(()=>({rowState:_.ROW_STATE.EMPTY,deleted:!1,filtered:!1,height:t(this,V).slice(),o:{},c:{},_:[0,0,0,0,_.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,t(this,V).slice(),-1,{},{}]}),"#getDefaultMeta"));R(this,"reset",h(()=>{g(this,M,[]),g(this,ct,[]),t(this,tt).call(this)},"reset"));R(this,"clear",h(()=>{var n;t(this,T).rawRecords=[],g(this,M,[]),g(this,ct,[]),(n=t(this,T).viewRecords)!=null&&n.reset&&t(this,T).viewRecords.reset()},"clear"));d(this,Kt,h(n=>{var s;Array.isArray(n)||(n=[n]);const e=typeof((s=t(this,H).fields)==null?void 0:s.get)=="function"?t(this,H).fields.get():Object.keys(n[0]||{}),i=[];return n.forEach(r=>{const o={v:[]};e.forEach(l=>{o.v.push(r[l]!==void 0&&r[l]!==null?r[l]:"")}),i.push(o)}),i},"#json2Array"));d(this,Zt,h(n=>(Array.isArray(n)||(n=[n]),n.forEach(e=>{e.__ng=t(this,At).call(this),e.__ng.rowid=this.nextId,e.__ng.rowState=_.ROW_STATE.INSERT,e.__ng._[0]=e.__ng.rowid}),n),"#defaultInsert"));R(this,"add",h((n,e=!0)=>{n===void 0&&(n={});const i=t(this,Kt).call(this,n);t(this,T).rawRecords=t(this,T).rawRecords.concat(t(this,Zt).call(this,i)),this.resetRecords();const s=this.count()-1;return e||i.forEach((r,o)=>{const l=t(this,T).rawRecords[s-o];l&&(l.__ng.rowState=_.ROW_STATE.EMPTY)}),t(this,tt).call(this),s},"add"));R(this,"delete",h(n=>{let e=[];Array.isArray(n)?e=n:typeof n>"u"?e=[t(this,T).host.row.at]:e=[parseInt(n,10)],e.sort((i,s)=>s-i).forEach(i=>{if(t(this,M)[i]){const s=t(this,M)[i].__ng.rowid;t(this,M)[i].__ng.rowState===_.ROW_STATE.INSERT?t(this,T).rawRecords=t(this,T).rawRecords.filter(r=>r.__ng.rowid!==s):t(this,T).rawRecords.forEach(r=>{r.__ng.rowid===s&&(r.__ng.deleted=!0,r.__ng.rowState=_.ROW_STATE.DELETE)})}}),this.resetRecords(),t(this,tt).call(this)},"delete"));R(this,"setValue",h((n,e,i)=>{var c;n=parseInt(n,10);const r=(typeof((c=t(this,H).fields)==null?void 0:c.get)=="function"?t(this,H).fields.get():[]).indexOf(e);if(r<0)return;const o=this.getValidData()[n];if(!o)return;const l=o.v[r];l!==i&&o.__ng.rowState!==_.ROW_STATE.INSERT&&(o.__ng.o.hasOwnProperty(e)||(o.__ng.o[e]=l),o.__ng.rowState=_.ROW_STATE.UPDATE),o.v[r]=i},"setValue"));R(this,"resetRecords",h(()=>{g(this,ct,t(this,T).rawRecords.filter(n=>!n.__ng.deleted)),g(this,M,t(this,T).rawRecords.filter(n=>!n.__ng.deleted&&!n.__ng.filtered)),t(this,T).rawRecords.forEach((n,e)=>{n.__ng.rowidx=e}),t(this,M).forEach((n,e)=>{n.__ng.i=e})},"resetRecords"));R(this,"getValidData",h(()=>(t(this,M).length===0&&t(this,T).rawRecords.length>0&&this.resetRecords(),t(this,M)),"getValidData"));d(this,ht,h(n=>{var o;if(!n)return n;const e=!Array.isArray(n),i=e?[n]:n,s=typeof((o=t(this,H).fields)==null?void 0:o.get)=="function"?t(this,H).fields.get():[],r=i.filter(l=>!l.__ng.deleted).map(l=>{const c={};return s.forEach((a,f)=>{c[a]=l.v?l.v[f]:l[a]}),c.__ng=l.__ng,c});return e?r[0]:r},"#conv"));R(this,"count",h(()=>this.getValidData().length,"count"));g(this,H,n),g(this,T,e),t(this,jt).call(this)}get source(){return t(this,ht).call(this,t(this,T).rawRecords)}set source(n){this.clear(),this.add(n,!1)}get nextId(){return++Se(this,Xt)._}get length(){return t(this,M).length}getRowCount(){return this.length}};H=new WeakMap,T=new WeakMap,M=new WeakMap,ct=new WeakMap,Xt=new WeakMap,V=new WeakMap,jt=new WeakMap,tt=new WeakMap,At=new WeakMap,Kt=new WeakMap,Zt=new WeakMap,ht=new WeakMap,h(_,"ngData"),R(_,"ROW_STATE",{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"});let se=_;const ye=class ye{constructor(n){d(this,et);g(this,et,n),this.row=new oe(this),this.data=new se(t(this,et),this),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.pageCnt=25,this.viewRecords.reset=()=>{var e;(e=t(this,et).view)!=null&&e.redraw&&t(this,et).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,r;const i=parseInt(e,10);if(!(i>=this.data.count()))return(r=(s=this.data.getValidData()[i])==null?void 0:s.__ng)==null?void 0:r.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([])}};et=new WeakMap,h(ye,"ngDataManager");let re=ye;const pe=class pe{constructor(n){d(this,dt);d(this,k,[]);R(this,"add",h((n,e="string")=>{n.forEach(i=>{t(this,k).some(s=>s.name===i)||t(this,k).push({name:i,type:e})}),t(this,qt).call(this)},"add"));d(this,qt,h(()=>{const n=new Map;t(this,k).forEach(e=>{n.set(e.name,e.type)}),g(this,k,Array.from(n,([e,i])=>({name:e,type:i}))),g(this,k,t(this,k).filter(e=>e.name!==""&&e.name!=="__ng")),t(this,k).sort((e,i)=>e.name.length<i.name.length?1:-1)},"#adjust"));d(this,Gt,h(()=>{g(this,k,[]),A.log(t(this,dt).querySelectorAll("table"));const n=Array.from(t(this,dt).querySelectorAll("table"));if(!(!n||n.length===0)){for(const e of n)A.log(e),$("[data-bind]",e).each((i,s)=>{const r=s.dataset.bind,o=s.getAttribute("data-type")||"string";r&&t(this,k).push({name:r,type:o})}),["data-expr","background-color","color","tooltip","visible","readonly","enable-button","enable-check","class-expr","icon-color","icon-src"].forEach(i=>{$(`[${i}]`,e).each((s,r)=>{var o=r.getAttribute(i);if(o.indexOf("data.")<0){const l=o.search(/[(]/g);if(l>0)try{o=String(window[o.substring(0,l).trim()])}catch{o=""}}o.split("data.").forEach(l=>{if(l.trim()!=""){const c=l.search(/[^_A-Za-z0-9]/g);let a="";c>=0?a=l.substring(0,c):o.startsWith("data.")&&(a=l.replace("data.","")),a&&t(this,k).push({name:a,type:"string"})}})})});t(this,qt).call(this)}},"#init"));g(this,dt,n),t(this,Gt).call(this)}get(){return t(this,k).map(n=>n.name)}getFields(){return t(this,k)}getType(n){const e=t(this,k).find(i=>i.name===n);return e?e.type:"string"}indexOf(n){return t(this,k).findIndex(e=>e.name===n)}includes(n){return t(this,k).some(e=>e.name===n)}};dt=new WeakMap,k=new WeakMap,qt=new WeakMap,Gt=new WeakMap,h(pe,"ngFields");let le=pe;const me=class me extends HTMLElement{constructor(){super();d(this,nt);d(this,Jt);d(this,Qt,h(()=>{this.fields=new le(this),g(this,Jt,new ie(this)),A.log("NineTable connected."),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,detail:{target:this}}))},"#init"));this.attachShadow({mode:"open"}),g(this,nt,new re(this))}connectedCallback(){t(this,Qt).call(this)}disconnectedCallback(){A.log("NineTable disconnected.")}get data(){return t(this,nt).data}get row(){return t(this,nt).row}get dataManager(){return t(this,nt)}};nt=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,h(me,"NineTable");let ae=me;customElements.get("nine-table")||customElements.define("nine-table",ae)});
355
+ `;const l=t(this,H).shadowRoot.querySelectorAll("nine-table-sheet");l==null||l.forEach((c,a)=>{e[a]&&setTimeout(()=>{c.generate(e[a]),n&&t(this,St).call(this)})})},"#render"));y(this,H,i),t(this,Vt).call(this)}};H=new WeakMap,Vt=new WeakMap,St=new WeakMap,Ut=new WeakMap,h(ge,"LayoutManager");let ie=ge;const be=class be{constructor(i){d(this,Et);d(this,at,-1);R(this,"count",h(()=>t(this,Et).rawRecords.length,"count"));y(this,Et,i)}get at(){return t(this,at)}set at(i){y(this,at,parseInt(i,10)),body&&!body.querySelector(`tbody.bindable tr[data-row="${t(this,at)}"]`)&&setTimeout(()=>{})}};Et=new WeakMap,at=new WeakMap,h(be,"ngRow");let oe=be;const I=class I{constructor(i,e){d(this,M);d(this,k);d(this,_,[]);d(this,ct,[]);d(this,Xt,0);d(this,V,[]);d(this,jt,h(()=>{y(this,V,[]);const i=t(this,M).template||[];Array.from(i).forEach(e=>{var n;t(this,V).push(((n=e.getBoundingClientRect)==null?void 0:n.call(e).height)||24)}),(t(this,k).rawRecords||[]).forEach(e=>{e.__ng||(e.__ng=t(this,Rt).call(this)),e.__ng.height=t(this,V).slice()})},"#initialize"));d(this,et,h(()=>{t(this,M).shadowRoot.querySelectorAll("nine-table-sheet").forEach(i=>{i.invalidate()})},"#invalidate"));R(this,"get",h((i,e)=>{var r;const n=this.getValidData();if(!n||n.length<=0)return;if(i==null)return t(this,ht).call(this,n);if(i<0||i>=n.length)return null;const o=typeof((r=t(this,M).fields)==null?void 0:r.get)=="function"?t(this,M).fields.get():[];if(e!=null){const s=o.indexOf(e);return s>=0?n[i].v[s]:null}return t(this,ht).call(this,n[i])},"get"));R(this,"set",h(i=>{this.clear(),this.add(i,!1),t(this,et).call(this)},"set"));d(this,Rt,h(()=>({rowState:I.ROW_STATE.EMPTY,deleted:!1,filtered:!1,height:t(this,V).slice(),o:{},c:{},_:[0,0,0,0,I.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,t(this,V).slice(),-1,{},{}]}),"#getDefaultMeta"));R(this,"reset",h(()=>{y(this,_,[]),y(this,ct,[]),t(this,et).call(this)},"reset"));R(this,"clear",h(()=>{var i;t(this,k).rawRecords=[],y(this,_,[]),y(this,ct,[]),(i=t(this,k).viewRecords)!=null&&i.reset&&t(this,k).viewRecords.reset()},"clear"));d(this,Kt,h(i=>{var o;Array.isArray(i)||(i=[i]);const e=typeof((o=t(this,M).fields)==null?void 0:o.get)=="function"?t(this,M).fields.get():Object.keys(i[0]||{}),n=[];return i.forEach(r=>{const s={v:[]};e.forEach(l=>{s.v.push(r[l]!==void 0&&r[l]!==null?r[l]:"")}),n.push(s)}),n},"#json2Array"));d(this,Zt,h(i=>(Array.isArray(i)||(i=[i]),i.forEach(e=>{e.__ng=t(this,Rt).call(this),e.__ng.rowid=this.nextId,e.__ng.rowState=I.ROW_STATE.INSERT,e.__ng._[0]=e.__ng.rowid}),i),"#defaultInsert"));R(this,"add",h((i,e=!0)=>{i===void 0&&(i={});const n=t(this,Kt).call(this,i);t(this,k).rawRecords=t(this,k).rawRecords.concat(t(this,Zt).call(this,n)),this.resetRecords();const o=this.count()-1;return e||n.forEach((r,s)=>{const l=t(this,k).rawRecords[o-s];l&&(l.__ng.rowState=I.ROW_STATE.EMPTY)}),t(this,et).call(this),o},"add"));R(this,"delete",h(i=>{let e=[];Array.isArray(i)?e=i:typeof i>"u"?e=[t(this,k).host.row.at]:e=[parseInt(i,10)],e.sort((n,o)=>o-n).forEach(n=>{if(t(this,_)[n]){const o=t(this,_)[n].__ng.rowid;t(this,_)[n].__ng.rowState===I.ROW_STATE.INSERT?t(this,k).rawRecords=t(this,k).rawRecords.filter(r=>r.__ng.rowid!==o):t(this,k).rawRecords.forEach(r=>{r.__ng.rowid===o&&(r.__ng.deleted=!0,r.__ng.rowState=I.ROW_STATE.DELETE)})}}),this.resetRecords(),t(this,et).call(this)},"delete"));R(this,"setValue",h((i,e,n)=>{var c;i=parseInt(i,10);const r=(typeof((c=t(this,M).fields)==null?void 0:c.get)=="function"?t(this,M).fields.get():[]).indexOf(e);if(r<0)return;const s=this.getValidData()[i];if(!s)return;const l=s.v[r];l!==n&&s.__ng.rowState!==I.ROW_STATE.INSERT&&(s.__ng.o.hasOwnProperty(e)||(s.__ng.o[e]=l),s.__ng.rowState=I.ROW_STATE.UPDATE),s.v[r]=n},"setValue"));R(this,"resetRecords",h(()=>{y(this,ct,t(this,k).rawRecords.filter(i=>!i.__ng.deleted)),y(this,_,t(this,k).rawRecords.filter(i=>!i.__ng.deleted&&!i.__ng.filtered)),t(this,k).rawRecords.forEach((i,e)=>{i.__ng.rowidx=e}),t(this,_).forEach((i,e)=>{i.__ng.i=e})},"resetRecords"));R(this,"getValidData",h(()=>(t(this,_).length===0&&t(this,k).rawRecords.length>0&&this.resetRecords(),t(this,_)),"getValidData"));d(this,ht,h(i=>{var s;if(!i)return i;const e=!Array.isArray(i),n=e?[i]:i,o=typeof((s=t(this,M).fields)==null?void 0:s.get)=="function"?t(this,M).fields.get():[],r=n.filter(l=>!l.__ng.deleted).map(l=>{const c={};return o.forEach((a,f)=>{c[a]=l.v?l.v[f]:l[a]}),c.__ng=l.__ng,c});return e?r[0]:r},"#conv"));R(this,"count",h(()=>this.getValidData().length,"count"));y(this,M,i),y(this,k,e),t(this,jt).call(this)}get source(){return t(this,ht).call(this,t(this,k).rawRecords)}set source(i){this.clear(),this.add(i,!1)}get nextId(){return++Se(this,Xt)._}get length(){return t(this,_).length}getRowCount(){return this.length}};M=new WeakMap,k=new WeakMap,_=new WeakMap,ct=new WeakMap,Xt=new WeakMap,V=new WeakMap,jt=new WeakMap,et=new WeakMap,Rt=new WeakMap,Kt=new WeakMap,Zt=new WeakMap,ht=new WeakMap,h(I,"ngData"),R(I,"ROW_STATE",{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"});let se=I;const ye=class ye{constructor(i){d(this,nt);y(this,nt,i),this.row=new oe(this),this.data=new se(t(this,nt),this),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.pageCnt=25,this.viewRecords.reset=()=>{var e;(e=t(this,nt).view)!=null&&e.redraw&&t(this,nt).view.redraw()},this.setDataSource=e=>{this.data&&this.data.reset(),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.data.set(e||[])},this.getRowState=e=>{var o,r;const n=parseInt(e,10);if(!(n>=this.data.count()))return(r=(o=this.data.getValidData()[n])==null?void 0:o.__ng)==null?void 0:r.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,n)=>this.data.get(e,n),this.setColumn=(e,n,o)=>{e=parseInt(e,10),this.data.setValue(e,n,o)},this.setDataSource([])}};nt=new WeakMap,h(ye,"ngDataManager");let re=ye;const pe=class pe{constructor(i){d(this,dt);d(this,L,[]);R(this,"add",h((i,e="string")=>{i.forEach(n=>{t(this,L).some(o=>o.name===n)||t(this,L).push({name:n,type:e})}),t(this,At).call(this)},"add"));d(this,At,h(()=>{const i=new Map;t(this,L).forEach(e=>{i.set(e.name,e.type)}),y(this,L,Array.from(i,([e,n])=>({name:e,type:n}))),y(this,L,t(this,L).filter(e=>e.name!==""&&e.name!=="__ng")),t(this,L).sort((e,n)=>e.name.length<n.name.length?1:-1)},"#adjust"));d(this,Gt,h(()=>{y(this,L,[]),A.log(t(this,dt).querySelectorAll("table"));const i=Array.from(t(this,dt).querySelectorAll("table"));if(!(!i||i.length===0)){for(const e of i)A.log(e),$("[data-bind]",e).each((n,o)=>{const r=o.dataset.bind,s=o.getAttribute("data-type")||"string";r&&t(this,L).push({name:r,type:s})}),["data-expr","background-color","color","tooltip","visible","readonly","enable-button","enable-check","class-expr","icon-color","icon-src"].forEach(n=>{$(`[${n}]`,e).each((o,r)=>{var s=r.getAttribute(n);if(s.indexOf("data.")<0){const l=s.search(/[(]/g);if(l>0)try{s=String(window[s.substring(0,l).trim()])}catch{s=""}}s.split("data.").forEach(l=>{if(l.trim()!=""){const c=l.search(/[^_A-Za-z0-9]/g);let a="";c>=0?a=l.substring(0,c):s.startsWith("data.")&&(a=l.replace("data.","")),a&&t(this,L).push({name:a,type:"string"})}})})});t(this,At).call(this)}},"#init"));y(this,dt,i),t(this,Gt).call(this)}get(){return t(this,L).map(i=>i.name)}getFields(){return t(this,L)}getType(i){const e=t(this,L).find(n=>n.name===i);return e?e.type:"string"}indexOf(i){return t(this,L).findIndex(e=>e.name===i)}includes(i){return t(this,L).some(e=>e.name===i)}};dt=new WeakMap,L=new WeakMap,At=new WeakMap,Gt=new WeakMap,h(pe,"ngFields");let le=pe;const me=class me extends HTMLElement{constructor(){super();d(this,it);d(this,Jt);d(this,Qt,h(()=>{this.fields=new le(this),y(this,Jt,new ie(this)),A.log("NineTable connected."),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,detail:{target:this}}))},"#init"));this.attachShadow({mode:"open"}),y(this,it,new re(this))}connectedCallback(){t(this,Qt).call(this)}disconnectedCallback(){A.log("NineTable disconnected.")}get data(){return t(this,it).data}get row(){return t(this,it).row}get dataManager(){return t(this,it)}};it=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,h(me,"NineTable");let ae=me;customElements.get("nine-table")||customElements.define("nine-table",ae)});
355
356
  //# sourceMappingURL=nine-table.umd.js.map