@ninebone/table 0.0.775 → 0.0.777
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nine-table.js +643 -637
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +7 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(E,
|
|
1
|
+
(function(E,R){typeof exports=="object"&&typeof module<"u"?R(require("@ninebone/util")):typeof define=="function"&&define.amd?define(["@ninebone/util"],R):(E=typeof globalThis<"u"?globalThis:E||self,R(E.NineboneUtil))})(this,function(E){"use strict";var ys=Object.defineProperty;var ms=E=>{throw TypeError(E)};var Ss=(E,R,m)=>R in E?ys(E,R,{enumerable:!0,configurable:!0,writable:!0,value:m}):E[R]=m;var h=(E,R)=>ys(E,"name",{value:R,configurable:!0});var T=(E,R,m)=>Ss(E,typeof R!="symbol"?R+"":R,m),us=(E,R,m)=>R.has(E)||ms("Cannot "+m);var t=(E,R,m)=>(us(E,R,"read from private field"),m?m.call(E):R.get(E)),d=(E,R,m)=>R.has(E)?ms("Cannot add the same private member more than once"):R instanceof WeakSet?R.add(E):R.set(E,m),y=(E,R,m,Z)=>(us(E,R,"write to private field"),Z?Z.call(E,m):R.set(E,m),m),G=(E,R,m)=>(us(E,R,"access private method"),m);var xs=(E,R,m,Z)=>({set _(Tt){y(E,R,Tt,m)},get _(){return t(E,R,Z)}});var Y,J,C,st,nt,rt,te,ot,ee,it,at,xt,I,kt,It,se,U,q,lt,V,D,Q,ct,Lt,Ve,Ue,ne,re,Mt,Ht,$t,oe,ie,Nt,Xe,wt,_t,ae,_,X,K,Jt,ws,j,ht,ce,he,dt,gs,Ot,Dt,Bt,ft,Wt,vs,de,ut,gt,zt,Pt,fe,ue,vt,ge,be,pe,jt,O,ye,Yt,me,Vt,St,B,L,W,Rt,xe,tt,we,bt,Ut,ve,Se,At,pt,Et,H,Xt,Re,yt,Ae,Ee,M,Gt,S,rs,os,is,as,ls,Zt,mt,qt,Ct,qe,et,ds;const Fe=class Fe extends E.trace.constructor{constructor(){super(),this.init("nine-table","green")}};h(Fe,"Trace");let R=Fe;const m=new R,je=class je extends HTMLElement{constructor(){super();d(this,Y);d(this,J,!1);d(this,C);d(this,st);d(this,nt);d(this,rt);d(this,te,h(()=>{if(!t(this,Y))return;const e=t(this,Y).querySelector(".ng-container-body .ng-part-body");e&&(y(this,rt,new ResizeObserver(()=>{this.refresh()})),t(this,rt).observe(e))},"#observeResize"));T(this,"refresh",h(()=>{if(!t(this,Y)||!t(this,C)||t(this,J))return;const e=t(this,C).container,s=e.querySelector("table");if(!s)return;const r=t(this,C).track,i=t(this,C).thumb,o=t(this,Y).querySelector(".ng-container-bottom"),a=e.clientWidth,c=s.scrollWidth;if(a!==0&&c>a)o&&(o.style.display="flex");else{o&&(o.style.display="none");return}const l=r.clientWidth;if(l<=0)return;const g=Math.max(Math.min(l*(a/c),l),20);i.style.width=`${g}px`;const f=e.scrollLeft,b=c-a;let u=0;b>0&&(u=parseInt(f/b*(l-g),10)),u<0&&(u=0);const p=l-g;u>p&&(u=p),i.style.left=`${u}px`,t(this,C).left.disabled=u===0,t(this,C).right.disabled=u>=p-1},"refresh"));d(this,ot,h(e=>{if(!t(this,C))return!1;const s=t(this,C).container,r=s.querySelector("table");if(!r)return!1;const i=t(this,C).track.getBoundingClientRect(),o=t(this,C).thumb.clientWidth;let a=e;a<0&&(a=0);const c=i.width-o;a>c&&(a=c),a=parseInt(a,10),t(this,C).thumb.style.left=`${a}px`,t(this,C).left.disabled=a===0,t(this,C).right.disabled=a>=c-1;const l=s.clientWidth,f=r.scrollWidth-l;return c>0&&f>0&&(s.scrollLeft=a/c*f),a>0&&a<c-1},"#thumbMoveTo"));d(this,ee,h(()=>{const e=h(r=>{clearInterval(t(this,st)),clearInterval(t(this,nt));const i=parseInt(t(this,C).thumb.style.left||0,10);t(this,ot).call(this,i+r),y(this,st,setInterval(()=>{clearInterval(t(this,st)),y(this,nt,setInterval(()=>{const o=parseInt(t(this,C).thumb.style.left||0,10);t(this,ot).call(this,o+r)||clearInterval(t(this,nt))},50))},500))},"delayScroll"),s=h(()=>{clearInterval(t(this,st)),clearInterval(t(this,nt))},"clearTimer");["mouseup","mouseleave","touchend"].forEach(r=>{t(this,C).left.addEventListener(r,s),t(this,C).right.addEventListener(r,s),t(this,C).track.addEventListener(r,s)}),t(this,C).left.addEventListener("mousedown",r=>{r.button===0&&e(-20)}),t(this,C).right.addEventListener("mousedown",r=>{r.button===0&&e(20)}),t(this,C).left.addEventListener("touchstart",()=>e(-20)),t(this,C).right.addEventListener("touchstart",()=>e(20)),t(this,C).track.addEventListener("mousedown",r=>{if(r.button!==0)return;r.preventDefault();const i=t(this,C).track.getBoundingClientRect(),o=t(this,C).thumb.clientWidth;t(this,ot).call(this,r.clientX-i.left-o/2)}),t(this,C).thumb.addEventListener("mousedown",r=>{if(r.button!==0)return;r.stopPropagation(),r.preventDefault(),y(this,J,!0),this.shiftX=r.clientX-t(this,C).thumb.getBoundingClientRect().left;const i=h(a=>{if(!t(this,J))return;const c=t(this,C).track.getBoundingClientRect();t(this,ot).call(this,a.clientX-c.left-this.shiftX)},"onMouseMove"),o=h(()=>{y(this,J,!1),s(),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",o),this.refresh()},"onMouseUp");document.addEventListener("mousemove",i),document.addEventListener("mouseup",o)})},"#init"))}connectedCallback(){if(y(this,Y,this.closest("nine-table-sheet")||this.getRootNode().host),!t(this,Y))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 s=t(this,
|
|
63
|
+
`;const e=h(()=>{const s=t(this,Y).querySelector(".ng-container-body .ng-part-body");if(!s){setTimeout(e,10);return}y(this,C,{container:s,track:this.querySelector(".ng-scroll-track"),thumb:this.querySelector(".ng-scroll-thumb"),left:this.querySelector(".ng-scroll-left"),right:this.querySelector(".ng-scroll-right")}),s.addEventListener("scroll",()=>{t(this,J)||this.refresh()}),t(this,ee).call(this),t(this,te).call(this),this.refresh()},"initWhenReady");e()}disconnectedCallback(){t(this,rt)&&t(this,rt).disconnect()}};Y=new WeakMap,J=new WeakMap,C=new WeakMap,st=new WeakMap,nt=new WeakMap,rt=new WeakMap,te=new WeakMap,ot=new WeakMap,ee=new WeakMap,h(je,"NineTableHScrollBar");let Z=je;customElements.get("nine-table-hscrollbar")||customElements.define("nine-table-hscrollbar",Z);const Ye=class Ye extends HTMLElement{constructor(){super();d(this,it);d(this,at);d(this,xt,!1);d(this,I);d(this,kt,0);d(this,It,0);T(this,"refresh",h(()=>{if(m.log("vscrollbar.refresh"),!t(this,it)||!t(this,I))return;const e=t(this,I).container,s=t(this,I).track,r=t(this,I).thumb,i=e.clientHeight,o=t(this,it).data.length,a=t(this,at).getRowHeight(),c=o*a;if(c<=i||o===0){this.style.display="none";return}else this.style.display="flex";const l=s.clientHeight;if(l<=0)return;const g=Math.max(Math.min(l*(i/c),l),20);r.style.height=`${g}px`;const f=e.scrollTop,b=Math.max(c-i,1);m.log(e,f,b);let u=0;b>0&&(u=f/b*(l-g));const p=l-g;u<0&&(u=0),u>p&&(u=p),r.style.top=`${u}px`,t(this,I).top.disabled=f<=0,t(this,I).bottom.disabled=f>=b-1},"refresh"));d(this,se,h(()=>{m.log("nine-table-vscrollbar.#init");const e=t(this,I).container,s=h(()=>{const i=(t(this,it).data.get()||[]).length,o=t(this,at).getRowHeight();return i*o},"getContentHeight");t(this,I).thumb.addEventListener("mousedown",r=>{if(r.button!==0)return;r.stopPropagation(),r.preventDefault(),y(this,xt,!0),y(this,kt,r.clientY),y(this,It,e.scrollTop);const i=h(a=>{if(!t(this,xt))return;const c=t(this,I).track.getBoundingClientRect(),l=t(this,I).thumb.clientHeight,f=c.height-l,b=a.clientY-t(this,kt),u=e.clientHeight,p=s(),w=Math.max(p-u,1);if(f>0&&w>0){const v=b/f*w;let x=t(this,It)+v;const k=Math.max(0,p-u);x<0&&(x=0),x>k&&(x=k),e.scrollTop=x}this.refresh()},"onMouseMove"),o=h(()=>{y(this,xt,!1),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",o),this.refresh()},"onMouseUp");document.addEventListener("mousemove",i),document.addEventListener("mouseup",o)}),t(this,I).track.addEventListener("mousedown",r=>{if(r.button!==0||r.target===t(this,I).thumb)return;const i=t(this,I).track.getBoundingClientRect(),o=t(this,I).thumb.clientHeight,a=r.clientY-i.top-o/2,l=i.height-o,g=e.clientHeight,f=s(),b=Math.max(f-g,1);if(l>0&&b>0){const u=Math.max(0,Math.min(1,a/l));e.scrollTop=u*b}this.refresh()}),t(this,I).top.addEventListener("click",()=>{e.scrollTop-=40}),t(this,I).bottom.addEventListener("click",()=>{e.scrollTop+=40})},"#init"))}connectedCallback(){y(this,it,this.getRootNode().host),y(this,at,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 s=t(this,it).querySelector(".ng-container-body .ng-part-body");if(!s){setTimeout(e,10);return}y(this,I,{container:s,track:this.querySelector(".ng-scroll-track"),thumb:this.querySelector(".ng-scroll-thumb"),top:this.querySelector(".ng-scroll-top"),bottom:this.querySelector(".ng-scroll-bottom")}),t(this,ee).call(this),this.refresh()},"initWhenReady");e()}};ot=new WeakMap,it=new WeakMap,mt=new WeakMap,I=new WeakMap,Tt=new WeakMap,kt=new WeakMap,ee=new WeakMap,h(Ye,"NineTableVScrollBar");let Ct=Ye;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",Ct);const Ke=class Ke{constructor(n){d(this,V);d(this,q);d(this,at);d(this,Y,new Map);d(this,D,null);d(this,J,null);d(this,lt,0);d(this,It,40);d(this,Ue,!1);d(this,Ve,!1);d(this,se,3);T(this,"refresh",h(()=>{var e;m.log("rowManager.refresh");const n=t(this,q).querySelector(".ng-container-body .ng-part-body");n&&(t(this,Lt).call(this),t(this,Mt).call(this),t(this,xt).call(this,n.scrollTop),(e=t(this,q).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));T(this,"initialize",h(()=>{m.log("rowManager.initialize"),y(this,at,{scrollTables:t(this,q).querySelectorAll(".ng-part-body table"),firstTr:t(this,q).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")}),y(this,D,null),t(this,Y).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const a=t(this,q).querySelector(r);if(!a)return;const c=a.querySelector(".ng-part-body table");if(!c)return;const l=c.querySelector("tbody.bindable-tbody");if(!l)return;const f=Array.from(l.querySelectorAll("tr")).map(b=>b.cloneNode(!0));t(this,Y).set(r,f)});const n=t(this,q).querySelector(".ng-container-body .ng-part-body"),e=t(this,q).querySelector(".ng-container-left .ng-part-body"),s=t(this,q).querySelector(".ng-container-right .ng-part-body"),o=t(this,q).querySelector(".ng-container-body .ng-part-header"),i=t(this,q).querySelector(".ng-container-body .ng-part-footer");if(n){t(this,Lt).call(this),t(this,$t).call(this),t(this,Mt).call(this),t(this,xt).call(this,n.scrollTop);let r=!1;const a=h(c=>{var f;if(r)return;r=!0;const l=c.scrollTop,g=c.scrollLeft;n&&n.scrollTop!==l&&(n.scrollTop=l),e&&e.scrollTop!==l&&(e.scrollTop=l),s&&s.scrollTop!==l&&(s.scrollTop=l),o&&o.scrollLeft!==g&&(o.scrollLeft=g),i&&i.scrollLeft!==g&&(i.scrollLeft=g),t(this,xt).call(this,l),(f=t(this,q).querySelector("nine-table-vscrollbar"))==null||f.refresh(),r=!1},"handleContainerScroll");[n,e,s].forEach(c=>{c==null||c.addEventListener("scroll",l=>{m.log(l),m.log("rowManager.scroll event"),a(c)})})}},"initialize"));d(this,ne,h((n,e)=>{m.log("rowManager.#renderRows");const s=t(this,Y).get(e);if(!s||s.length===0)return;const o=n.querySelector(".ng-part-body tbody.bindable-tbody");if(!o)return;o.querySelectorAll("tr:not(.nodata)").forEach(a=>a.remove());const i=o.querySelector("tr.nodata"),r=document.createDocumentFragment();for(let a=0;a<t(this,It);a++)s.forEach(c=>{r.appendChild(c.cloneNode(!0))});i?i.before(r):o.appendChild(r),e===".ng-container-body"&&(t(this,at).firstTr=o.querySelector("tr:not(.nodata)"))},"#renderRows"));d(this,Lt,h(()=>{if(t(this,D)!==null&&t(this,D)>0)return t(this,D);const n=t(this,q).querySelector(".ng-container-body .ng-part-body");m.log("rowManager.#measureAndCacheHeight");const e=t(this,Y).get(".ng-container-body");if(!e||e.length===0)throw new Error("invalid dom");const s=n.querySelector("tbody.bindable-tbody");if(m.log(s),!s)throw new Error("invalid dom");s.querySelectorAll("tr:not(.nodata)").forEach(b=>b.remove());const o=s.querySelector("tr.nodata"),i=document.createDocumentFragment();e.forEach(b=>{i.appendChild(b.cloneNode(!0))}),o?o.before(i):s.appendChild(i);const r=t(this,q),a=r.style.display,c=r.style.visibility,l=r.style.position;(a==="none"||window.getComputedStyle(r).display==="none")&&(r.style.display="block",r.style.visibility="hidden",r.style.position="absolute");let g=0;const f=s.querySelectorAll("tr");return f.forEach(b=>{let u=b.offsetHeight||b.getBoundingClientRect().height;if(u===0){const p=window.getComputedStyle(b);u=parseFloat(p.height)||parseFloat(p.minHeight)||0}g+=u}),f.forEach(b=>b.remove()),r.style.display=a,r.style.visibility=c,r.style.position=l,g<=0?-1:(y(this,D,g),t(this,Ht).call(this),t(this,D))},"#measureAndCacheHeight"));d(this,Mt,h(()=>{m.log("rowManager.#updateVirtualScrollHeight");const e=(t(this,V).data.get()||[]).length,s=t(this,D),o=e*s;m.log("🔍 [VirtualHeight]",{totalCount:e,rowHeight:s,totalVirtualHeight:o}),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(i=>{const r=t(this,q).querySelector(i);if(!r)return;const a=r.querySelector(".ng-part-body .ng-virtual-spacer");a&&(a.style.height=`${o}px`)})},"#updateVirtualScrollHeight"));d(this,Ht,h(()=>{if(t(this,lt)>0&&t(this,D)>0){const n=Math.ceil(t(this,lt)/t(this,D));y(this,It,n+t(this,se))}},"#updateRowCount"));d(this,re,h(()=>{var a,c,l,g,f,b;const n=t(this,q).querySelector(".ng-container-left .ng-part-body table"),e=t(this,q).querySelector(".ng-container-body .ng-part-body table"),s=t(this,q).querySelector(".ng-container-right .ng-part-body table");if(e){const u=n?Array.from(n.querySelectorAll("tbody tr")):[],p=Array.from(e.querySelectorAll("tbody tr")),w=s?Array.from(s.querySelectorAll("tbody tr")):[],S=Math.max(u.length,p.length,w.length);for(let x=0;x<S;x++){const k=[((a=u[x])==null?void 0:a.getBoundingClientRect().height)||0,((c=p[x])==null?void 0:c.getBoundingClientRect().height)||0,((l=w[x])==null?void 0:l.getBoundingClientRect().height)||0],R=Math.max(...k);R>0&&(u[x]&&(u[x].style.height=`${R}px`),p[x]&&(p[x].style.height=`${R}px`),w[x]&&(w[x].style.height=`${R}px`))}}const o=t(this,q).querySelector(".ng-container-left .ng-part-footer table"),i=t(this,q).querySelector(".ng-container-body .ng-part-footer table"),r=t(this,q).querySelector(".ng-container-right .ng-part-footer table");if(i){const u=o?Array.from(o.querySelectorAll("tfoot tr")):[],p=Array.from(i.querySelectorAll("tfoot tr")),w=r?Array.from(r.querySelectorAll("tfoot tr")):[],S=Math.max(u.length,p.length,w.length);for(let x=0;x<S;x++){const k=[((g=u[x])==null?void 0:g.getBoundingClientRect().height)||0,((f=p[x])==null?void 0:f.getBoundingClientRect().height)||0,((b=w[x])==null?void 0:b.getBoundingClientRect().height)||0],R=Math.max(...k);R>0&&(u[x]&&(u[x].style.height=`${R}px`),p[x]&&(p[x].style.height=`${R}px`),w[x]&&(w[x].style.height=`${R}px`))}}},"#syncRowHeights"));d(this,oe,h(()=>{!t(this,q)||!(t(this,q)instanceof HTMLElement)||(y(this,J,new ResizeObserver(n=>{for(const e of n){const s=e.target;if(!s.classList.contains("active"))continue;const o=e.contentRect.height;if(o>0){let i=0;const r=s.querySelector(".ng-part-header"),a=s.querySelector(".ng-part-footer");r&&(i+=r.offsetHeight),a&&(i+=a.offsetHeight);const c=Math.max(o-i,100);t(this,lt)!==c&&(y(this,lt,c),t(this,Ht).call(this),t(this,D)!==null&&(t(this,$t).call(this),this.refresh()))}}})),t(this,J).observe(t(this,q)))},"#initResizeObserver"));d(this,$t,h(()=>{m.log("rowManager.#renderAllContainers"),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const e=t(this,q).querySelector(n);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,ne).call(this,e,n)}),t(this,ie).call(this),t(this,re).call(this)},"#renderAllContainers"));d(this,Xe,h(n=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var l;const s=t(this,q).querySelector(e);if(!s)return;const o=s.querySelector(".ng-part-body tbody.bindable-tbody");if(!o)return;const i=Array.from(o.querySelectorAll("tr:not(.nodata)")),r=((l=t(this,Y).get(e))==null?void 0:l.length)||1,c=(t(this,V).data.get()||[]).length;i.forEach((g,f)=>{const b=n+Math.floor(f/r);if(b>=c){g.style.visibility="hidden";return}const u=t(this,V).data.get(b);g.style.display="",t(this,Nt).call(this,g,u,b)})})},"#adjustBufferRows"));d(this,xt,h(n=>{var f,b;const e=t(this,D);if(!e||e<=0)return;const s=t(this,V).data.length;if(s===0)return;const o=((f=t(this,Y).get(".ng-container-body"))==null?void 0:f.length)||1,i=t(this,q).querySelector(".ng-container-body .ng-part-body");m.log("bodyContainer.clientHeight",i.clientHeight);const r=Math.max(0,s-Math.floor(i.clientHeight/e)),a=Math.min(r,Math.max(0,Math.floor(n/e)));let c=Math.floor(a*e);m.log(`📜 [Scroll Calc] maxStartIndex: ${r}, startIndex: ${a}, offsetY: ${c}`),a===r&&m.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${r}, startIndex: ${a}, offsetY: ${c}`);const l=t(this,at).firstTr,g=l&&l.dataset.row!==void 0?parseInt(l.dataset.row,10):-1;(b=t(this,at))==null||b.scrollTables.forEach(u=>{u.style.transform=`translate3d(0, ${c}px, 0)`}),g!==a&&(m.log(`🔄 [Row Bind Trigger] currentStartIndex(${g}) !== startIndex(${a})`),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(u=>{const p=t(this,q).querySelector(u);if(!p)return;const w=p.querySelector(".ng-part-body tbody.bindable-tbody");if(!w)return;Array.from(w.querySelectorAll("tr:not(.nodata)")).forEach((x,k)=>{const R=a+Math.floor(k/o);if(R>=s){x.style.display="none";return}const N=t(this,V).data.get(R);x.style.display="",t(this,Nt).call(this,x,N,R)})}))},"#handleScroll"));d(this,Nt,h((n,e,s)=>{n.dataset.row=s,n.data=e,Array.from(n.cells).forEach((o,i)=>{o.dataset.row=s;const r=Array.from(o.children).find(a=>a.tagName.toLowerCase().startsWith("cell-")||typeof a.refresh=="function");r&&typeof r.refresh=="function"&&r.refresh()})},"#bindRowData"));d(this,ie,h(()=>{var c,l,g;m.log("rowManager.#syncHeaderHeights");const n=t(this,q).querySelector(".ng-container-left .ng-part-header table"),e=t(this,q).querySelector(".ng-container-body .ng-part-header table"),s=t(this,q).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const o=n?Array.from(n.querySelectorAll("tr")):[],i=Array.from(e.querySelectorAll("tr")),r=s?Array.from(s.querySelectorAll("tr")):[],a=Math.max(o.length,i.length,r.length);for(let f=0;f<a;f++){const b=[((c=o[f])==null?void 0:c.getBoundingClientRect().height)||0,((l=i[f])==null?void 0:l.getBoundingClientRect().height)||0,((g=r[f])==null?void 0:g.getBoundingClientRect().height)||0],u=Math.max(...b);u>0&&(o[f]&&(o[f].style.height=`${u}px`),i[f]&&(i[f].style.height=`${u}px`),r[f]&&(r[f].style.height=`${u}px`))}},"#syncHeaderHeights"));T(this,"destroy",h(()=>{t(this,J)&&(t(this,J).disconnect(),y(this,J,null))},"destroy"));y(this,V,n.getRootNode().host),y(this,q,n),t(this,oe).call(this)}getRowHeight(){return t(this,D)}templateLength(n=".ng-container-body"){var e;return((e=t(this,Y).get(n))==null?void 0:e.length)||1}};V=new WeakMap,q=new WeakMap,at=new WeakMap,Y=new WeakMap,D=new WeakMap,J=new WeakMap,lt=new WeakMap,It=new WeakMap,Ue=new WeakMap,Ve=new WeakMap,se=new WeakMap,ne=new WeakMap,Lt=new WeakMap,Mt=new WeakMap,Ht=new WeakMap,re=new WeakMap,oe=new WeakMap,$t=new WeakMap,Xe=new WeakMap,xt=new WeakMap,Nt=new WeakMap,ie=new WeakMap,h(Ke,"RowManager");let Te=Ke;const ae=class ae{static compileAll(n){return Array.isArray(n)?n.map(e=>ae.compile(e)):[]}static compile(n){if(!n)return null;const e=h(a=>{a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach(l=>{const g=l.getAttribute("cell-type")||"renderer";if(l.children.length>0&&l.firstElementChild.tagName.includes("-"))return;let f=`cell-${g}`;const b=l.getAttribute("data-bind"),u=l.getAttribute("data-expr"),p=l.getAttribute("maxbyte"),w=l.getAttribute("type");let S=[];b&&S.push(`data-bind="${b}"`),u&&S.push(`data-expr="${u}"`),p&&S.push(`maxbyte="${p}"`),w&&S.push(`type="${w}"`),l.innerHTML=`<${f} ${S.join(" ")}></${f}>`}),a.querySelectorAll("tbody td, tfoot td").forEach(l=>{l.setAttribute("tabindex","0")})},"processCellTypes"),s=h(a=>{if(!a.querySelector("colgroup")){const c=a.querySelector("tbody tr")||a.querySelector("tr"),l=c?c.querySelectorAll("th, td").length:1,g=document.createElement("colgroup"),f=Math.max(Math.floor(a.clientWidth/l),100);for(let b=0;b<l;b++){const u=document.createElement("col");u.setAttribute("width",f),g.appendChild(u)}a.prepend(g)}if(!a.querySelector("thead")){const c=document.createElement("thead"),l=a.querySelector("colgroup");l?l.after(c):a.prepend(c)}a.classList.add("nine-table-element")},"ensureTableStructure"),o=h((a,c)=>{const l=Array.from(a.querySelectorAll(c+" tr")),g=Array.from(a.querySelectorAll(c+" th,"+c+" td")),f=l.length;if(f===0||g.length===0)return;let b=0;g.forEach(p=>{b+=p.colSpan||1});const u=Array.from(Array(f),()=>Array(b).fill(null));l.forEach(p=>{const w=p.sectionRowIndex;let S=0;Array.from(p.querySelectorAll("th,td")).forEach(x=>{for(let N=0;N<u[w].length;N++)if(u[w][N]===null){S=N;break}const k=x.rowSpan||1,R=x.colSpan||1;for(let N=0;N<k;N++)for(let B=0;B<R;B++)w+N<f&&S+B<b&&(u[w+N][S+B]=N===0&&B===0?"1":"0")})}),l.forEach(p=>{const w=p.sectionRowIndex;Array.from(p.querySelectorAll("th,td")).forEach(S=>{for(let x=0;x<u[w].length;x++)if(u[w][x]==="1"){S.dataset.col=x,u[w][x]="0";break}})})},"resetColIndex"),i=n.cloneNode(!0);return s(i),e(i),o(i,"thead"),o(i,"tbody"),o(i,"tfoot"),Array.from(i.querySelectorAll("colgroup col")).forEach((a,c)=>{const l=a.getAttribute("fixed");l&&i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach(g=>{g.setAttribute("fixed",l)})}),i}};h(ae,"TableCompiler");let ke=ae;const Ge=class Ge{constructor(n){d(this,K);d(this,_);d(this,X,{startRow:-1,startCol:-1,endRow:-1,endCol:-1});T(this,"render",h(()=>{const{startRow:n,startCol:e,endRow:s,endCol:o}=t(this,X);m.log("🎨 [CellSelection.render] Rendering range ->",t(this,X));const i=t(this,_).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body");if(i.forEach(a=>{a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach(c=>{c.classList.remove("selected","selected-top","selected-bottom","selected-left","selected-right")})}),n<0||e<0){m.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");return}let r=0;i.forEach(a=>{a.querySelectorAll("tbody tr").forEach(c=>{const{matrixRow:l}=yt(this,K,Zt).call(this,c);l<0||c.querySelectorAll("td, th").forEach(g=>{const f=parseInt(g.dataset.col,10);if(isNaN(f))return;const b=parseInt(g.rowSpan||1,10),u=parseInt(g.colSpan||1,10),p=l+b-1,w=f+u-1;p>=n&&l<=s&&w>=e&&f<=o&&(r++,g.classList.add("selected"),m.log(g,n,e,s,o),l<=n&&g.classList.add("selected-top"),p>=s&&g.classList.add("selected-bottom"),f<=e&&g.classList.add("selected-left"),w>=o&&g.classList.add("selected-right"))})})}),m.log(`✨ [CellSelection.render] Total rendered cells marked: ${r}`)},"render"));y(this,_,n),yt(this,K,xs).call(this),t(this,_).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body").forEach(s=>{s.addEventListener("scroll",()=>{t(this,X).startRow>=0&&t(this,X).startCol>=0&&this.render()})}),m.log("🎯 [CellSelection] Initialized")}setRange(n,e,s,o){m.log(`🔍 [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${o}`);let i=Math.min(n,s),r=Math.max(n,s),a=Math.min(e,o),c=Math.max(e,o);const l=t(this,_).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body");let g=!0,f=0;for(;g&&f<5;)g=!1,f++,l.forEach(b=>{b.querySelectorAll("tbody tr").forEach(u=>{if(u.classList.contains("nodata"))return;const{matrixRow:p}=yt(this,K,Zt).call(this,u);p<0||u.querySelectorAll("td, th").forEach(w=>{const S=parseInt(w.dataset.col,10);if(isNaN(S))return;const x=parseInt(w.rowSpan||1,10),k=parseInt(w.colSpan||1,10),R=p+x-1,N=S+k-1;if(R>=i&&p<=r&&N>=a&&S<=c){const F=Math.min(i,p),Ce=Math.max(r,R),gs=Math.min(a,S),bs=Math.max(c,N);(F!==i||Ce!==r||gs!==a||bs!==c)&&(i=F,r=Ce,a=gs,c=bs,g=!0)}})})});y(this,X,{startRow:i,startCol:a,endRow:r,endCol:c}),m.log("📦 [CellSelection.setRange] Final Range ->",t(this,X)),this.render()}};_=new WeakMap,X=new WeakMap,K=new WeakSet,Zt=h(function(n){if(!n||n.classList.contains("nodata"))return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const e=parseInt(n.dataset.row,10);if(isNaN(e))return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const s=n.closest("tbody"),i=Array.from(s.querySelectorAll("tr:not(.nodata)")).filter(l=>parseInt(l.dataset.row,10)===e),r=i.indexOf(n),a=i.length>0?i.length:1,c=e*a+(r>=0?r:n.sectionRowIndex%a);return{dataRow:e,subRowIndex:r,matrixRow:c}},"#getMatrixRow"),xs=h(function(){const n=t(this,_).querySelector(".ng-container-top");if(!n){m.log("❌ [CellSelection] .ng-container-top not found!");return}n.addEventListener("mousedown",e=>{if(e.button!==0)return;const s=e.target.closest("td, th");if(!s||s.dataset.row===void 0||s.dataset.col===void 0||s.closest("tr").classList.contains("nodata"))return;t(this,_).style.userSelect="none",t(this,_).style.webkitUserSelect="none";const o=s.closest("tr"),{matrixRow:i}=yt(this,K,Zt).call(this,o),r=parseInt(s.dataset.col,10);if(i<0){t(this,_).style.userSelect="",t(this,_).style.webkitUserSelect="";return}m.log(`🖱️ [MouseDown Success] startRow: ${i}, startCol: ${r}`),t(this,_).navigation.currentCell=s;let a=i,c=r;const l=h(f=>{const b=document.elementFromPoint(f.clientX,f.clientY);let u=b==null?void 0:b.closest("td, th");if(!u||!t(this,_).contains(u)){const x=t(this,_).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");for(const k of x){const R=k.getBoundingClientRect();if(f.clientX>=R.left&&f.clientX<=R.right&&f.clientY>=R.top&&f.clientY<=R.bottom){u=k;break}}}if(!u||u.dataset.row===void 0||u.dataset.col===void 0||u.closest("tr").classList.contains("nodata"))return;const p=u.closest("tr"),{matrixRow:w}=yt(this,K,Zt).call(this,p),S=parseInt(u.dataset.col,10);w<0||a===w&&c===S||(a=w,c=S,this.setRange(i,r,w,S))},"onMouseMove"),g=h(()=>{m.log("🖱️ [MouseUp] Drag ended."),t(this,_).style.userSelect="",t(this,_).style.webkitUserSelect="",document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",g)},"onMouseUp");document.addEventListener("mousemove",l),document.addEventListener("mouseup",g)})},"#initEvents"),h(Ge,"CellSelection");let Ie=Ge;const Ze=class Ze{constructor(n){d(this,he);d(this,U);d(this,ct,null);d(this,le,-1);d(this,ce,-1);d(this,_t,h(n=>{const e=[];return n.forEach(s=>e.push(...Array.from(s.querySelectorAll("td")))),e.length===0?null:(e.sort((s,o)=>parseInt(s.dataset.col,10)-parseInt(o.dataset.col,10)),e[e.length-1])},"#getMaxColCell"));d(this,Ot,h((n,e)=>{const s=t(this,ht).call(this,n);if(s.length===0)return e+1;let o=e+1;const i=[];s.forEach(r=>i.push(...Array.from(r.querySelectorAll("td")))),i.sort((r,a)=>parseInt(r.dataset.col,10)-parseInt(a.dataset.col,10));for(const r of i){const a=parseInt(r.dataset.col,10),c=parseInt(r.colSpan||1,10);if(e>=a&&e<a+c){o=a+c;break}}return o},"#getNextCol"));d(this,Dt,h((n,e)=>{const s=t(this,ht).call(this,n);if(s.length===0)return Math.max(0,e-1);let o=-1;const i=[];s.forEach(r=>i.push(...Array.from(r.querySelectorAll("td")))),i.sort((r,a)=>parseInt(r.dataset.col,10)-parseInt(a.dataset.col,10));for(const r of i){const a=parseInt(r.dataset.col,10);if(a<e)o=a;else break}return o},"#getPreviousCol"));d(this,ht,h(n=>{const e=t(this,U).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"),s=[];return e.forEach(o=>{const i=Array.from(o.querySelectorAll("tbody tr:not(.nodata)"));for(const r of i){const a=parseInt(r.dataset.row,10),c=i.filter(p=>parseInt(p.dataset.row,10)===a),l=c.length>0?c.length:1,g=c.indexOf(r),f=a*l+(g>=0?g:0);if(f===n){s.push(r);break}const b=Array.from(r.querySelectorAll("td"));let u=!1;for(const p of b){const w=parseInt(p.rowSpan||1,10);if(w>1&&n>=f&&n<f+w){s.push(r),u=!0;break}}if(u)break}}),s},"#findTargetTrsByMatrix"));d(this,Wt,h((n,e,s,o)=>{const i=t(this,U).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"),r=o!==void 0?o:n*1+e;for(const a of i){const c=Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));for(const l of c){const g=parseInt(l.dataset.row,10),f=c.filter(S=>parseInt(S.dataset.row,10)===g),b=f.length>0?f.length:1,u=f.indexOf(l),p=g*b+(u>=0?u:0),w=Array.from(l.querySelectorAll("td"));for(const S of w){const x=parseInt(S.dataset.col,10),k=parseInt(S.colSpan||1,10),R=parseInt(S.rowSpan||1,10);if(!isNaN(x)&&s>=x&&s<x+k&&r>=p&&r<p+R&&window.getComputedStyle(S).display!=="none")return S}}}return null},"#getNearElement"));y(this,U,n),yt(this,he,ws).call(this),m.log("🎯 [CellNavigation] Initialized")}get currentCell(){return t(this,ct)}set currentCell(n){if(!n)return;y(this,ct,n),n.focus({preventScroll:!0});const e=parseInt(n.dataset.row,10),s=parseInt(n.dataset.col,10);if(!isNaN(e)&&!isNaN(s)){y(this,le,e),y(this,ce,s);const o=n.closest("tr"),i=o==null?void 0:o.closest("tbody");if(i){const a=Array.from(i.querySelectorAll("tr:not(.nodata)")).filter(f=>parseInt(f.dataset.row,10)===e),c=a.length>0?a.length:1,l=a.indexOf(o),g=e*c+(l>=0?l:0);t(this,U).selection.setRange(g,s,g,s)}}}moveCell(n){var x,k,R,N;if(!t(this,ct))return;const e=t(this,ct),s=e.closest("tr"),o=parseInt(e.dataset.row,10),i=parseInt(e.dataset.col,10),r=s==null?void 0:s.closest("tbody");if(!r)return;const c=Array.from(r.querySelectorAll("tr:not(.nodata)")).filter(B=>parseInt(B.dataset.row,10)===o),l=c.length>0?c.length:1,g=c.indexOf(s),f=o*l+(g>=0?g:0);let b=f,u=i;switch(n.code){case"Tab":if(n.preventDefault(),n.shiftKey){if(u=t(this,Dt).call(this,f,i),u<0&&f>0){b=f-1;const B=t(this,ht).call(this,b),F=t(this,_t).call(this,B);u=F?parseInt(F.dataset.col,10):0}}else{u=t(this,Ot).call(this,f,i);const B=t(this,ht).call(this,f),F=t(this,_t).call(this,B),Ce=F?parseInt(F.dataset.col,10)+parseInt(F.colSpan||1,10):0;u>=Ce&&(b=f+1,u=0)}break;case"ArrowRight":u=t(this,Ot).call(this,f,i);break;case"ArrowLeft":u=t(this,Dt).call(this,f,i);break;case"ArrowDown":n.preventDefault(),b=f+(e.rowSpan||1);break;case"ArrowUp":n.preventDefault(),b=Math.max(0,f-(e.rowSpan||1));break}const p=Math.floor(b/l),w=b%l;let S=t(this,Wt).call(this,p,w,u,b);if(S)this.currentCell=S;else if(p!==o&&p>=0){const B=((k=(x=t(this,U)).getRowHeight)==null?void 0:k.call(x))||40;(N=(R=t(this,U)).scrollToY)==null||N.call(R,p*B),setTimeout(()=>{const F=t(this,Wt).call(this,p,w,u,b);F&&(this.currentCell=F)},0)}}};U=new WeakMap,ct=new WeakMap,le=new WeakMap,ce=new WeakMap,_t=new WeakMap,Ot=new WeakMap,Dt=new WeakMap,ht=new WeakMap,Wt=new WeakMap,he=new WeakSet,ws=h(function(){t(this,U).addEventListener("keydown",n=>{["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(n.code)&&this.moveCell(n)})},"#initEvents"),h(Ze,"CellNavigation");let Le=Ze;const Pt=class Pt extends HTMLElement{constructor(){super();d(this,de);d(this,dt,null);d(this,ft);d(this,zt);d(this,Bt);T(this,"invalidate",h(()=>{m.log("sheet.invalidate()"),t(this,ft).refresh()},"invalidate"));T(this,"generate",h(e=>{if(m.log("sheet.generate()"),!e)return;y(this,dt,ke.compile(e)),t(this,fe).call(this),t(this,ue).call(this);const s=this.querySelector(".ng-container-body .ng-part-header"),o=this.querySelector(".ng-container-body .ng-part-footer"),i=this.querySelector(".ng-nodata-overlay");s&&i&&(i.style.top=`${s.offsetHeight}px`),o&&i&&(i.style.bottom=`${o.offsetHeight}px`),t(this,ft).initialize(),setTimeout(()=>{var r;(r=this.querySelector("nine-table-hscrollbar"))==null||r.refresh()},0)},"generate"));d(this,fe,h(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:o})=>{var i,r,a;(i=this.querySelector(`${s} .ng-part-header`))==null||i.appendChild(t(this,wt).call(this,t(this,dt),o,"header")),(r=this.querySelector(`${s} .ng-virtual-spacer`))==null||r.before(t(this,wt).call(this,t(this,dt),o,"body")),(a=this.querySelector(`${s} .ng-part-footer`))==null||a.appendChild(t(this,wt).call(this,t(this,dt),o,"footer"))})},"#renderSplitContainers"));d(this,ue,h(()=>{["left","right","body"].forEach(e=>{const s=this.querySelector(`.ng-container-${e}`),o=s==null?void 0:s.querySelectorAll("table");if(!s||!o||o.length===0)return;let i=0;o[0].querySelectorAll("col").forEach(r=>{const a=parseInt(r.getAttribute("width"),10);isNaN(a)||(i+=a)}),e==="body"?(s.style.flex="1",o.forEach(r=>{r.style.width=`${i}px`,r.style.minWidth=`${i}px`})):(s.style.flex=`0 0 ${i}px`,s.style.width=`${i}px`,o.forEach(r=>{r.style.width=`${i}px`,r.style.minWidth=`${i}px`}))})},"#updateContainerWidths"));d(this,wt,h((e,s,o)=>{const i=e.cloneNode(!0),r=i.querySelector("thead"),a=i.querySelector("tbody"),c=i.querySelector("tfoot");if(o==="header"){if(a&&a.remove(),c&&c.remove(),e.querySelector("tbody")){const g=document.createElement("tbody");g.className="fixed-tbody",i.appendChild(g)}}else o==="body"?(r&&r.remove(),c&&c.remove(),a&&(a.className="bindable-tbody")):o==="footer"&&(r&&r.remove(),a&&a.remove());return s==="left"?i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="left"&&l.remove()}):s==="right"?i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="right"&&l.remove()}):i.querySelectorAll("[fixed=left], [fixed=right]").forEach(l=>{l.remove()}),i},"#createSplitTable"));T(this,"getRowHeight",h(()=>t(this,ft).getRowHeight(),"getRowHeight"));T(this,"scrollToX",h(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollLeft=e)},"scrollToX"));T(this,"scrollToY",h(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollTop=e)},"scrollToY"));d(this,ge,h(()=>{t(this,be).call(this),y(this,zt,new Ie(this)),y(this,Bt,new Le(this))},"#init"));d(this,be,h(()=>{const e=Pt.SCROLLBAR_SIZE;this.innerHTML=`
|
|
126
|
+
`;const e=h(()=>{const s=t(this,at).querySelector(".ng-container-body .ng-part-body");if(!s){setTimeout(e,10);return}y(this,I,{container:s,track:this.querySelector(".ng-scroll-track"),thumb:this.querySelector(".ng-scroll-thumb"),top:this.querySelector(".ng-scroll-top"),bottom:this.querySelector(".ng-scroll-bottom")}),t(this,se).call(this),this.refresh()},"initWhenReady");e()}};it=new WeakMap,at=new WeakMap,xt=new WeakMap,I=new WeakMap,kt=new WeakMap,It=new WeakMap,se=new WeakMap,h(Ye,"NineTableVScrollBar");let Tt=Ye;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",Tt);const Ke=class Ke{constructor(n){d(this,U);d(this,q);d(this,lt);d(this,V,new Map);d(this,D,null);d(this,Q,null);d(this,ct,0);d(this,Lt,40);d(this,Ve,!1);d(this,Ue,!1);d(this,ne,3);T(this,"refresh",h(()=>{var e;m.log("rowManager.refresh");const n=t(this,q).querySelector(".ng-container-body .ng-part-body");n&&(t(this,Mt).call(this),t(this,Ht).call(this),t(this,wt).call(this,n.scrollTop),(e=t(this,q).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));T(this,"initialize",h(()=>{m.log("rowManager.initialize"),y(this,lt,{scrollTables:t(this,q).querySelectorAll(".ng-part-body table"),firstTr:t(this,q).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")}),y(this,D,null),t(this,V).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(o=>{const a=t(this,q).querySelector(o);if(!a)return;const c=a.querySelector(".ng-part-body table");if(!c)return;const l=c.querySelector("tbody.bindable-tbody");if(!l)return;const f=Array.from(l.querySelectorAll("tr")).map(b=>b.cloneNode(!0));t(this,V).set(o,f)});const n=t(this,q).querySelector(".ng-container-body .ng-part-body"),e=t(this,q).querySelector(".ng-container-left .ng-part-body"),s=t(this,q).querySelector(".ng-container-right .ng-part-body"),r=t(this,q).querySelector(".ng-container-body .ng-part-header"),i=t(this,q).querySelector(".ng-container-body .ng-part-footer");if(n){t(this,Mt).call(this),t(this,Nt).call(this),t(this,Ht).call(this),t(this,wt).call(this,n.scrollTop);let o=!1;const a=h(c=>{var f;if(o)return;o=!0;const l=c.scrollTop,g=c.scrollLeft;n&&n.scrollTop!==l&&(n.scrollTop=l),e&&e.scrollTop!==l&&(e.scrollTop=l),s&&s.scrollTop!==l&&(s.scrollTop=l),r&&r.scrollLeft!==g&&(r.scrollLeft=g),i&&i.scrollLeft!==g&&(i.scrollLeft=g),t(this,wt).call(this,l),(f=t(this,q).querySelector("nine-table-vscrollbar"))==null||f.refresh(),o=!1},"handleContainerScroll");[n,e,s].forEach(c=>{c==null||c.addEventListener("scroll",l=>{m.log(l),m.log("rowManager.scroll event"),a(c)})})}},"initialize"));d(this,re,h((n,e)=>{m.log("rowManager.#renderRows");const s=t(this,V).get(e);if(!s||s.length===0)return;const r=n.querySelector(".ng-part-body tbody.bindable-tbody");if(!r)return;r.querySelectorAll("tr:not(.nodata)").forEach(a=>a.remove());const i=r.querySelector("tr.nodata"),o=document.createDocumentFragment();for(let a=0;a<t(this,Lt);a++)s.forEach(c=>{o.appendChild(c.cloneNode(!0))});i?i.before(o):r.appendChild(o),e===".ng-container-body"&&(t(this,lt).firstTr=r.querySelector("tr:not(.nodata)"))},"#renderRows"));d(this,Mt,h(()=>{if(t(this,D)!==null&&t(this,D)>0)return t(this,D);const n=t(this,q).querySelector(".ng-container-body .ng-part-body");m.log("rowManager.#measureAndCacheHeight");const e=t(this,V).get(".ng-container-body");if(!e||e.length===0)throw new Error("invalid dom");const s=n.querySelector("tbody.bindable-tbody");if(m.log(s),!s)throw new Error("invalid dom");s.querySelectorAll("tr:not(.nodata)").forEach(b=>b.remove());const r=s.querySelector("tr.nodata"),i=document.createDocumentFragment();e.forEach(b=>{i.appendChild(b.cloneNode(!0))}),r?r.before(i):s.appendChild(i);const o=t(this,q),a=o.style.display,c=o.style.visibility,l=o.style.position;(a==="none"||window.getComputedStyle(o).display==="none")&&(o.style.display="block",o.style.visibility="hidden",o.style.position="absolute");let g=0;const f=s.querySelectorAll("tr");return f.forEach(b=>{let u=b.offsetHeight||b.getBoundingClientRect().height;if(u===0){const p=window.getComputedStyle(b);u=parseFloat(p.height)||parseFloat(p.minHeight)||0}g+=u}),f.forEach(b=>b.remove()),o.style.display=a,o.style.visibility=c,o.style.position=l,g<=0?-1:(y(this,D,g),t(this,$t).call(this),t(this,D))},"#measureAndCacheHeight"));d(this,Ht,h(()=>{m.log("rowManager.#updateVirtualScrollHeight");const e=(t(this,U).data.get()||[]).length,s=t(this,D),r=e*s;m.log("🔍 [VirtualHeight]",{totalCount:e,rowHeight:s,totalVirtualHeight:r}),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(i=>{const o=t(this,q).querySelector(i);if(!o)return;const a=o.querySelector(".ng-part-body .ng-virtual-spacer");a&&(a.style.height=`${r}px`)})},"#updateVirtualScrollHeight"));d(this,$t,h(()=>{if(t(this,ct)>0&&t(this,D)>0){const n=Math.ceil(t(this,ct)/t(this,D));y(this,Lt,n+t(this,ne))}},"#updateRowCount"));d(this,oe,h(()=>{var a,c,l,g,f,b;const n=t(this,q).querySelector(".ng-container-left .ng-part-body table"),e=t(this,q).querySelector(".ng-container-body .ng-part-body table"),s=t(this,q).querySelector(".ng-container-right .ng-part-body table");if(e){const u=n?Array.from(n.querySelectorAll("tbody tr")):[],p=Array.from(e.querySelectorAll("tbody tr")),w=s?Array.from(s.querySelectorAll("tbody tr")):[],v=Math.max(u.length,p.length,w.length);for(let x=0;x<v;x++){const k=[((a=u[x])==null?void 0:a.getBoundingClientRect().height)||0,((c=p[x])==null?void 0:c.getBoundingClientRect().height)||0,((l=w[x])==null?void 0:l.getBoundingClientRect().height)||0],A=Math.max(...k);A>0&&(u[x]&&(u[x].style.height=`${A}px`),p[x]&&(p[x].style.height=`${A}px`),w[x]&&(w[x].style.height=`${A}px`))}}const r=t(this,q).querySelector(".ng-container-left .ng-part-footer table"),i=t(this,q).querySelector(".ng-container-body .ng-part-footer table"),o=t(this,q).querySelector(".ng-container-right .ng-part-footer table");if(i){const u=r?Array.from(r.querySelectorAll("tfoot tr")):[],p=Array.from(i.querySelectorAll("tfoot tr")),w=o?Array.from(o.querySelectorAll("tfoot tr")):[],v=Math.max(u.length,p.length,w.length);for(let x=0;x<v;x++){const k=[((g=u[x])==null?void 0:g.getBoundingClientRect().height)||0,((f=p[x])==null?void 0:f.getBoundingClientRect().height)||0,((b=w[x])==null?void 0:b.getBoundingClientRect().height)||0],A=Math.max(...k);A>0&&(u[x]&&(u[x].style.height=`${A}px`),p[x]&&(p[x].style.height=`${A}px`),w[x]&&(w[x].style.height=`${A}px`))}}},"#syncRowHeights"));d(this,ie,h(()=>{!t(this,q)||!(t(this,q)instanceof HTMLElement)||(y(this,Q,new ResizeObserver(n=>{for(const e of n){const s=e.target;if(!s.classList.contains("active"))continue;const r=e.contentRect.height;if(r>0){let i=0;const o=s.querySelector(".ng-part-header"),a=s.querySelector(".ng-part-footer");o&&(i+=o.offsetHeight),a&&(i+=a.offsetHeight);const c=Math.max(r-i,100);t(this,ct)!==c&&(y(this,ct,c),t(this,$t).call(this),t(this,D)!==null&&(t(this,Nt).call(this),this.refresh()))}}})),t(this,Q).observe(t(this,q)))},"#initResizeObserver"));d(this,Nt,h(()=>{m.log("rowManager.#renderAllContainers"),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const e=t(this,q).querySelector(n);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,re).call(this,e,n)}),t(this,ae).call(this),t(this,oe).call(this)},"#renderAllContainers"));d(this,Xe,h(n=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var l;const s=t(this,q).querySelector(e);if(!s)return;const r=s.querySelector(".ng-part-body tbody.bindable-tbody");if(!r)return;const i=Array.from(r.querySelectorAll("tr:not(.nodata)")),o=((l=t(this,V).get(e))==null?void 0:l.length)||1,c=(t(this,U).data.get()||[]).length;i.forEach((g,f)=>{const b=n+Math.floor(f/o);if(b>=c){g.style.visibility="hidden";return}const u=t(this,U).data.get(b);g.style.display="",t(this,_t).call(this,g,u,b)})})},"#adjustBufferRows"));d(this,wt,h(n=>{var f,b;const e=t(this,D);if(!e||e<=0)return;const s=t(this,U).data.length;if(s===0)return;const r=((f=t(this,V).get(".ng-container-body"))==null?void 0:f.length)||1,i=t(this,q).querySelector(".ng-container-body .ng-part-body");m.log("bodyContainer.clientHeight",i.clientHeight);const o=Math.max(0,s-Math.floor(i.clientHeight/e)),a=Math.min(o,Math.max(0,Math.floor(n/e)));let c=Math.floor(a*e);m.log(`📜 [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`),a===o&&m.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);const l=t(this,lt).firstTr,g=l&&l.dataset.row!==void 0?parseInt(l.dataset.row,10):-1;(b=t(this,lt))==null||b.scrollTables.forEach(u=>{u.style.transform=`translate3d(0, ${c}px, 0)`}),g!==a&&(m.log(`🔄 [Row Bind Trigger] currentStartIndex(${g}) !== startIndex(${a})`),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(u=>{const p=t(this,q).querySelector(u);if(!p)return;const w=p.querySelector(".ng-part-body tbody.bindable-tbody");if(!w)return;Array.from(w.querySelectorAll("tr:not(.nodata)")).forEach((x,k)=>{const A=a+Math.floor(k/r);if(A>=s){x.style.display="none";return}const N=t(this,U).data.get(A);x.style.display="",t(this,_t).call(this,x,N,A)})}))},"#handleScroll"));d(this,_t,h((n,e,s)=>{n.dataset.row=s,n.data=e,Array.from(n.cells).forEach((r,i)=>{r.dataset.row=s;const o=Array.from(r.children).find(a=>a.tagName.toLowerCase().startsWith("cell-")||typeof a.refresh=="function");o&&typeof o.refresh=="function"&&o.refresh()})},"#bindRowData"));d(this,ae,h(()=>{var c,l,g;m.log("rowManager.#syncHeaderHeights");const n=t(this,q).querySelector(".ng-container-left .ng-part-header table"),e=t(this,q).querySelector(".ng-container-body .ng-part-header table"),s=t(this,q).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const r=n?Array.from(n.querySelectorAll("tr")):[],i=Array.from(e.querySelectorAll("tr")),o=s?Array.from(s.querySelectorAll("tr")):[],a=Math.max(r.length,i.length,o.length);for(let f=0;f<a;f++){const b=[((c=r[f])==null?void 0:c.getBoundingClientRect().height)||0,((l=i[f])==null?void 0:l.getBoundingClientRect().height)||0,((g=o[f])==null?void 0:g.getBoundingClientRect().height)||0],u=Math.max(...b);u>0&&(r[f]&&(r[f].style.height=`${u}px`),i[f]&&(i[f].style.height=`${u}px`),o[f]&&(o[f].style.height=`${u}px`))}},"#syncHeaderHeights"));T(this,"destroy",h(()=>{t(this,Q)&&(t(this,Q).disconnect(),y(this,Q,null))},"destroy"));y(this,U,n.getRootNode().host),y(this,q,n),t(this,ie).call(this)}getRowHeight(){return t(this,D)}templateLength(n=".ng-container-body"){var e;return((e=t(this,V).get(n))==null?void 0:e.length)||1}};U=new WeakMap,q=new WeakMap,lt=new WeakMap,V=new WeakMap,D=new WeakMap,Q=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Ve=new WeakMap,Ue=new WeakMap,ne=new WeakMap,re=new WeakMap,Mt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,oe=new WeakMap,ie=new WeakMap,Nt=new WeakMap,Xe=new WeakMap,wt=new WeakMap,_t=new WeakMap,ae=new WeakMap,h(Ke,"RowManager");let Te=Ke;const le=class le{static compileAll(n){return Array.isArray(n)?n.map(e=>le.compile(e)):[]}static compile(n){if(!n)return null;const e=h(a=>{a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach(l=>{const g=l.getAttribute("cell-type")||"renderer";if(l.children.length>0&&l.firstElementChild.tagName.includes("-"))return;let f=`cell-${g}`;const b=l.getAttribute("data-bind"),u=l.getAttribute("data-expr"),p=l.getAttribute("maxbyte"),w=l.getAttribute("type");let v=[];b&&v.push(`data-bind="${b}"`),u&&v.push(`data-expr="${u}"`),p&&v.push(`maxbyte="${p}"`),w&&v.push(`type="${w}"`),l.innerHTML=`<${f} ${v.join(" ")}></${f}>`}),a.querySelectorAll("tbody td, tfoot td").forEach(l=>{l.setAttribute("tabindex","0")})},"processCellTypes"),s=h(a=>{if(!a.querySelector("colgroup")){const c=a.querySelector("tbody tr")||a.querySelector("tr"),l=c?c.querySelectorAll("th, td").length:1,g=document.createElement("colgroup"),f=Math.max(Math.floor(a.clientWidth/l),100);for(let b=0;b<l;b++){const u=document.createElement("col");u.setAttribute("width",f),g.appendChild(u)}a.prepend(g)}if(!a.querySelector("thead")){const c=document.createElement("thead"),l=a.querySelector("colgroup");l?l.after(c):a.prepend(c)}a.classList.add("nine-table-element")},"ensureTableStructure"),r=h((a,c)=>{const l=Array.from(a.querySelectorAll(c+" tr")),g=Array.from(a.querySelectorAll(c+" th,"+c+" td")),f=l.length;if(f===0||g.length===0)return;let b=0;g.forEach(p=>{b+=p.colSpan||1});const u=Array.from(Array(f),()=>Array(b).fill(null));l.forEach(p=>{const w=p.sectionRowIndex;let v=0;Array.from(p.querySelectorAll("th,td")).forEach(x=>{for(let N=0;N<u[w].length;N++)if(u[w][N]===null){v=N;break}const k=x.rowSpan||1,A=x.colSpan||1;for(let N=0;N<k;N++)for(let z=0;z<A;z++)w+N<f&&v+z<b&&(u[w+N][v+z]=N===0&&z===0?"1":"0")})}),l.forEach(p=>{const w=p.sectionRowIndex;Array.from(p.querySelectorAll("th,td")).forEach(v=>{for(let x=0;x<u[w].length;x++)if(u[w][x]==="1"){v.dataset.col=x,u[w][x]="0";break}})})},"resetColIndex"),i=n.cloneNode(!0);return s(i),e(i),r(i,"thead"),r(i,"tbody"),r(i,"tfoot"),Array.from(i.querySelectorAll("colgroup col")).forEach((a,c)=>{const l=a.getAttribute("fixed");l&&i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach(g=>{g.setAttribute("fixed",l)})}),i}};h(le,"TableCompiler");let ke=le;const Ge=class Ge{constructor(n){d(this,K);d(this,_);d(this,X,{startRow:-1,startCol:-1,endRow:-1,endCol:-1});T(this,"render",h(()=>{const{startRow:n,startCol:e,endRow:s,endCol:r}=t(this,X);m.log("🎨 [CellSelection.render] Rendering range ->",t(this,X));const i=t(this,_).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body");if(i.forEach(a=>{a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach(c=>{c.classList.remove("selected","selected-top","selected-bottom","selected-left","selected-right")})}),n<0||e<0){m.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");return}let o=0;i.forEach(a=>{a.querySelectorAll("tbody tr").forEach(c=>{const{matrixRow:l}=G(this,K,Jt).call(this,c);l<0||c.querySelectorAll("td, th").forEach(g=>{const f=parseInt(g.dataset.col,10);if(isNaN(f))return;const b=parseInt(g.rowSpan||1,10),u=parseInt(g.colSpan||1,10),p=l+b-1,w=f+u-1;p>=n&&l<=s&&w>=e&&f<=r&&(o++,g.classList.add("selected"),m.log(g,n,e,s,r),l<=n&&g.classList.add("selected-top"),p>=s&&g.classList.add("selected-bottom"),f<=e&&g.classList.add("selected-left"),w>=r&&g.classList.add("selected-right"))})})}),m.log(`✨ [CellSelection.render] Total rendered cells marked: ${o}`)},"render"));y(this,_,n),G(this,K,ws).call(this),t(this,_).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body").forEach(s=>{s.addEventListener("scroll",()=>{t(this,X).startRow>=0&&t(this,X).startCol>=0&&this.render()})}),m.log("🎯 [CellSelection] Initialized")}setRange(n,e,s,r){m.log(`🔍 [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${r}`);let i=Math.min(n,s),o=Math.max(n,s),a=Math.min(e,r),c=Math.max(e,r);const l=t(this,_).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body");let g=!0,f=0;for(;g&&f<5;)g=!1,f++,l.forEach(b=>{b.querySelectorAll("tbody tr").forEach(u=>{if(u.classList.contains("nodata"))return;const{matrixRow:p}=G(this,K,Jt).call(this,u);p<0||u.querySelectorAll("td, th").forEach(w=>{const v=parseInt(w.dataset.col,10);if(isNaN(v))return;const x=parseInt(w.rowSpan||1,10),k=parseInt(w.colSpan||1,10),A=p+x-1,N=v+k-1;if(A>=i&&p<=o&&N>=a&&v<=c){const P=Math.min(i,p),Ce=Math.max(o,A),bs=Math.min(a,v),ps=Math.max(c,N);(P!==i||Ce!==o||bs!==a||ps!==c)&&(i=P,o=Ce,a=bs,c=ps,g=!0)}})})});y(this,X,{startRow:i,startCol:a,endRow:o,endCol:c}),m.log("📦 [CellSelection.setRange] Final Range ->",t(this,X)),this.render()}};_=new WeakMap,X=new WeakMap,K=new WeakSet,Jt=h(function(n){if(!n||n.classList.contains("nodata"))return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const e=parseInt(n.dataset.row,10);if(isNaN(e))return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const s=n.closest("tbody"),i=Array.from(s.querySelectorAll("tr:not(.nodata)")).filter(l=>parseInt(l.dataset.row,10)===e),o=i.indexOf(n),a=i.length>0?i.length:1,c=e*a+(o>=0?o:n.sectionRowIndex%a);return{dataRow:e,subRowIndex:o,matrixRow:c}},"#getMatrixRow"),ws=h(function(){const n=t(this,_).querySelector(".ng-container-top");if(!n){m.log("❌ [CellSelection] .ng-container-top not found!");return}n.addEventListener("mousedown",e=>{if(e.button!==0)return;const s=e.target.closest("td, th");if(!s||s.dataset.row===void 0||s.dataset.col===void 0||s.closest("tr").classList.contains("nodata"))return;t(this,_).style.userSelect="none",t(this,_).style.webkitUserSelect="none";const r=s.closest("tr"),{matrixRow:i}=G(this,K,Jt).call(this,r),o=parseInt(s.dataset.col,10);if(i<0){t(this,_).style.userSelect="",t(this,_).style.webkitUserSelect="";return}m.log(`🖱️ [MouseDown Success] startRow: ${i}, startCol: ${o}`),t(this,_).navigation.currentCell=s;let a=i,c=o;const l=h(f=>{const b=document.elementFromPoint(f.clientX,f.clientY);let u=b==null?void 0:b.closest("td, th");if(!u||!t(this,_).contains(u)){const x=t(this,_).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");for(const k of x){const A=k.getBoundingClientRect();if(f.clientX>=A.left&&f.clientX<=A.right&&f.clientY>=A.top&&f.clientY<=A.bottom){u=k;break}}}if(!u||u.dataset.row===void 0||u.dataset.col===void 0||u.closest("tr").classList.contains("nodata"))return;const p=u.closest("tr"),{matrixRow:w}=G(this,K,Jt).call(this,p),v=parseInt(u.dataset.col,10);w<0||a===w&&c===v||(a=w,c=v,this.setRange(i,o,w,v))},"onMouseMove"),g=h(()=>{m.log("🖱️ [MouseUp] Drag ended."),t(this,_).style.userSelect="",t(this,_).style.webkitUserSelect="",document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",g)},"onMouseUp");document.addEventListener("mousemove",l),document.addEventListener("mouseup",g)})},"#initEvents"),h(Ge,"CellSelection");let Ie=Ge;const Ze=class Ze{constructor(n){d(this,dt);d(this,j);d(this,ht,null);d(this,ce,-1);d(this,he,-1);d(this,Ot,h(n=>{const e=[];return n.forEach(s=>e.push(...Array.from(s.querySelectorAll("td")))),e.length===0?null:(e.sort((s,r)=>parseInt(s.dataset.col,10)-parseInt(r.dataset.col,10)),e[e.length-1])},"#getMaxColCell"));d(this,Dt,h((n,e)=>{const s=t(this,ft).call(this,n);if(s.length===0)return e+1;let r=e+1;const i=[];s.forEach(o=>i.push(...Array.from(o.querySelectorAll("td")))),i.sort((o,a)=>parseInt(o.dataset.col,10)-parseInt(a.dataset.col,10));for(const o of i){const a=parseInt(o.dataset.col,10),c=parseInt(o.colSpan||1,10);if(e>=a&&e<a+c){r=a+c;break}}return r},"#getNextCol"));d(this,Bt,h((n,e)=>{const s=t(this,ft).call(this,n);if(s.length===0)return Math.max(0,e-1);let r=-1;const i=[];s.forEach(o=>i.push(...Array.from(o.querySelectorAll("td")))),i.sort((o,a)=>parseInt(o.dataset.col,10)-parseInt(a.dataset.col,10));for(const o of i){const a=parseInt(o.dataset.col,10);if(a<e)r=a;else break}return r},"#getPreviousCol"));d(this,ft,h(n=>{const e=t(this,j).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"),s=[];return e.forEach(r=>{const i=Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));for(const o of i){const a=parseInt(o.dataset.row,10),c=i.filter(p=>parseInt(p.dataset.row,10)===a),l=c.length>0?c.length:1,g=c.indexOf(o),f=a*l+(g>=0?g:0);if(f===n){s.push(o);break}const b=Array.from(o.querySelectorAll("td"));let u=!1;for(const p of b){const w=parseInt(p.rowSpan||1,10);if(w>1&&n>=f&&n<f+w){s.push(o),u=!0;break}}if(u)break}}),s},"#findTargetTrsByMatrix"));d(this,Wt,h((n,e,s,r)=>{const i=t(this,j).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"),o=r!==void 0?r:n*1+e;for(const a of i){const c=Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));for(const l of c){const g=parseInt(l.dataset.row,10),f=c.filter(v=>parseInt(v.dataset.row,10)===g),b=f.length>0?f.length:1,u=f.indexOf(l),p=g*b+(u>=0?u:0),w=Array.from(l.querySelectorAll("td"));for(const v of w){const x=parseInt(v.dataset.col,10),k=parseInt(v.colSpan||1,10),A=parseInt(v.rowSpan||1,10);if(!isNaN(x)&&s>=x&&s<x+k&&o>=p&&o<p+A&&window.getComputedStyle(v).display!=="none")return v}}}return null},"#getNearElement"));y(this,j,n),G(this,dt,vs).call(this),m.log("🎯 [CellNavigation] Initialized")}get currentCell(){return t(this,ht)}set currentCell(n){if(!n)return;y(this,ht,n),n.focus({preventScroll:!0});const e=parseInt(n.dataset.row,10),s=parseInt(n.dataset.col,10);if(!isNaN(e)&&!isNaN(s)){y(this,ce,e),y(this,he,s);const r=n.closest("tr"),i=r==null?void 0:r.closest("tbody");if(i){const a=Array.from(i.querySelectorAll("tr:not(.nodata)")).filter(f=>parseInt(f.dataset.row,10)===e),c=a.length>0?a.length:1,l=a.indexOf(r),g=e*c+(l>=0?l:0);t(this,j).selection.setRange(g,s,g,s)}}}moveCell(n){var x,k,A,N;if(!t(this,ht))return;const e=t(this,ht),s=e.closest("tr"),r=parseInt(e.dataset.row,10),i=parseInt(e.dataset.col,10),o=s==null?void 0:s.closest("tbody");if(!o)return;const c=Array.from(o.querySelectorAll("tr:not(.nodata)")).filter(z=>parseInt(z.dataset.row,10)===r),l=c.length>0?c.length:1,g=c.indexOf(s),f=r*l+(g>=0?g:0);let b=f,u=i;switch(n.code){case"Tab":if(n.preventDefault(),n.shiftKey){if(u=t(this,Bt).call(this,f,i),u<0&&f>0){b=f-1;const z=t(this,ft).call(this,b),P=t(this,Ot).call(this,z);u=P?parseInt(P.dataset.col,10):0}}else{u=t(this,Dt).call(this,f,i);const z=t(this,ft).call(this,f),P=t(this,Ot).call(this,z),Ce=P?parseInt(P.dataset.col,10)+parseInt(P.colSpan||1,10):0;u>=Ce&&(b=f+1,u=0)}break;case"ArrowRight":u=t(this,Dt).call(this,f,i);break;case"ArrowLeft":u=t(this,Bt).call(this,f,i);break;case"ArrowDown":n.preventDefault(),b=f+(e.rowSpan||1);break;case"ArrowUp":n.preventDefault(),b=Math.max(0,f-(e.rowSpan||1));break}const p=Math.floor(b/l),w=b%l;let v=t(this,Wt).call(this,p,w,u,b);if(v)this.currentCell=v,G(this,dt,gs).call(this,v);else if(p!==r&&p>=0){const z=((k=(x=t(this,j)).getRowHeight)==null?void 0:k.call(x))||40;(N=(A=t(this,j)).scrollToY)==null||N.call(A,p*z),setTimeout(()=>{const P=t(this,Wt).call(this,p,w,u,b);P&&(this.currentCell=P,G(this,dt,gs).call(this,P))},0)}}};j=new WeakMap,ht=new WeakMap,ce=new WeakMap,he=new WeakMap,dt=new WeakSet,gs=h(function(n){const e=t(this,j).querySelector(".ng-container-body .ng-part-body");if(!e)return;const s=n.getBoundingClientRect(),r=e.getBoundingClientRect();s.top<r.top?e.scrollTop-=r.top-s.top:s.bottom>r.bottom&&(e.scrollTop+=s.bottom-r.bottom),s.left<r.left?e.scrollLeft-=r.left-s.left:s.right>r.right&&(e.scrollLeft+=s.right-r.right)},"#ensureCellVisible"),Ot=new WeakMap,Dt=new WeakMap,Bt=new WeakMap,ft=new WeakMap,Wt=new WeakMap,vs=h(function(){t(this,j).addEventListener("keydown",n=>{["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(n.code)&&this.moveCell(n)})},"#initEvents"),h(Ze,"CellNavigation");let Le=Ze;const Ft=class Ft extends HTMLElement{constructor(){super();d(this,de);d(this,ut,null);d(this,gt);d(this,zt);d(this,Pt);T(this,"invalidate",h(()=>{m.log("sheet.invalidate()"),t(this,gt).refresh()},"invalidate"));T(this,"generate",h(e=>{if(m.log("sheet.generate()"),!e)return;y(this,ut,ke.compile(e)),t(this,fe).call(this),t(this,ue).call(this);const s=this.querySelector(".ng-container-body .ng-part-header"),r=this.querySelector(".ng-container-body .ng-part-footer"),i=this.querySelector(".ng-nodata-overlay");s&&i&&(i.style.top=`${s.offsetHeight}px`),r&&i&&(i.style.bottom=`${r.offsetHeight}px`),t(this,gt).initialize(),setTimeout(()=>{var o;(o=this.querySelector("nine-table-hscrollbar"))==null||o.refresh()},0)},"generate"));d(this,fe,h(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:r})=>{var i,o,a;(i=this.querySelector(`${s} .ng-part-header`))==null||i.appendChild(t(this,vt).call(this,t(this,ut),r,"header")),(o=this.querySelector(`${s} .ng-virtual-spacer`))==null||o.before(t(this,vt).call(this,t(this,ut),r,"body")),(a=this.querySelector(`${s} .ng-part-footer`))==null||a.appendChild(t(this,vt).call(this,t(this,ut),r,"footer"))})},"#renderSplitContainers"));d(this,ue,h(()=>{["left","right","body"].forEach(e=>{const s=this.querySelector(`.ng-container-${e}`),r=s==null?void 0:s.querySelectorAll("table");if(!s||!r||r.length===0)return;let i=0;r[0].querySelectorAll("col").forEach(o=>{const a=parseInt(o.getAttribute("width"),10);isNaN(a)||(i+=a)}),e==="body"?(s.style.flex="1",r.forEach(o=>{o.style.width=`${i}px`,o.style.minWidth=`${i}px`})):(s.style.flex=`0 0 ${i}px`,s.style.width=`${i}px`,r.forEach(o=>{o.style.width=`${i}px`,o.style.minWidth=`${i}px`}))})},"#updateContainerWidths"));d(this,vt,h((e,s,r)=>{const i=e.cloneNode(!0),o=i.querySelector("thead"),a=i.querySelector("tbody"),c=i.querySelector("tfoot");if(r==="header"){if(a&&a.remove(),c&&c.remove(),e.querySelector("tbody")){const g=document.createElement("tbody");g.className="fixed-tbody",i.appendChild(g)}}else r==="body"?(o&&o.remove(),c&&c.remove(),a&&(a.className="bindable-tbody")):r==="footer"&&(o&&o.remove(),a&&a.remove());return s==="left"?i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="left"&&l.remove()}):s==="right"?i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="right"&&l.remove()}):i.querySelectorAll("[fixed=left], [fixed=right]").forEach(l=>{l.remove()}),i},"#createSplitTable"));T(this,"getRowHeight",h(()=>t(this,gt).getRowHeight(),"getRowHeight"));T(this,"scrollToX",h(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollLeft=e)},"scrollToX"));T(this,"scrollToY",h(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollTop=e)},"scrollToY"));d(this,ge,h(()=>{t(this,be).call(this),y(this,zt,new Ie(this)),y(this,Pt,new Le(this))},"#init"));d(this,be,h(()=>{const e=Ft.SCROLLBAR_SIZE;this.innerHTML=`
|
|
127
127
|
<style>
|
|
128
128
|
nine-table-sheet {
|
|
129
129
|
display: none;
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
<nine-table-hscrollbar></nine-table-hscrollbar>
|
|
322
322
|
<div class='ng-scroll-edge'></div>
|
|
323
323
|
</div>
|
|
324
|
-
`},"#render"));y(this,
|
|
324
|
+
`},"#render"));y(this,gt,new Te(this)),y(this,de,this.getRootNode().host)}connectedCallback(){t(this,ge).call(this)}get selection(){return t(this,zt)}get navigation(){return t(this,Pt)}disconnectedCallback(){this.innerHTML="",m.log("NineTableSheet destroyed.")}};de=new WeakMap,ut=new WeakMap,gt=new WeakMap,zt=new WeakMap,Pt=new WeakMap,fe=new WeakMap,ue=new WeakMap,vt=new WeakMap,ge=new WeakMap,be=new WeakMap,h(Ft,"NineTableSheet"),T(Ft,"SCROLLBAR_SIZE",16);let Qt=Ft;customElements.get("nine-table-sheet")||customElements.define("nine-table-sheet",Qt);const Je=class Je extends HTMLElement{constructor(){super();d(this,pe,h(()=>{var e;(e=this.querySelector(".nine-tab-bar"))==null||e.addEventListener("click",s=>{var o;const r=s.ctrlKey||s.metaKey||s.shiftKey,i=parseInt((o=s.target.closest(".nine-tab-item"))==null?void 0:o.dataset.index,10);t(this,jt).call(this,i,r)}),t(this,jt).call(this,0,!1)},"#init"));d(this,jt,h((e,s=!1)=>{const r=h(()=>{const g=Array.from(this.querySelectorAll("nine-table-sheet"));Array.from(this.querySelectorAll("nine-splitter")).forEach(u=>u.style.setProperty("display","none"));const b=g.filter(u=>u.classList.contains("active"));b.length<2||b.forEach(u=>{const p=parseInt(u.getAttribute("data-index"),10),w=this.querySelector(`nine-splitter[data-split-index="${p}"]`),v=g[p+1];w&&v&&v.classList.contains("active")&&w.style.setProperty("display","flex")})},"updateSplitters"),i=this.querySelector(".nine-tab-bar"),o=this.querySelector("nine-table-sheets-body"),a=i.querySelectorAll(".nine-tab-item"),c=o.querySelectorAll("nine-table-sheet");if(!a[e])return;if(!s)a.forEach((g,f)=>{g.classList.toggle("active",f===e)}),c.forEach((g,f)=>{const b=f===e;g.classList.toggle("active",b),g.style.flex=b?"1 1 100%":""});else{const g=a[e],f=i.querySelectorAll(".nine-tab-item.active");if(g.classList.contains("active")&&f.length<=1)return;g.classList.toggle("active");const b=o.querySelector(`nine-table-sheet[data-index="${e}"]`);b&&(b.classList.toggle("active"),b.classList.contains("active")||(b.style.flex=""))}const l=o.querySelectorAll("nine-table-sheet.active");l==null||l.forEach(g=>{g.style.flex=l.length>1?"1 1 0%":"1 1 100%"}),r()},"#switchSheet"))}connectedCallback(){t(this,pe).call(this)}};pe=new WeakMap,jt=new WeakMap,h(Je,"NineTableSheets");let Me=Je;customElements.get("nine-table-sheets")||customElements.define("nine-table-sheets",Me);const Qe=class Qe{constructor(n){d(this,O);d(this,ye,h(()=>{t(this,me).call(this),new ResizeObserver(n=>{for(let e of n)t(this,O).getAttribute("auto-height")==="true"&&t(this,Yt).call(this)}).observe(t(this,O))},"#init"));d(this,Yt,h(()=>{var c,l;const n=Array.from(t(this,O).shadowRoot.querySelectorAll("nine-table-sheet.active"));if(n.length===0)return;const e=parseInt(t(this,O).getAttribute("max-display-row"),10)||10,s=Math.max(...n.map(g=>g.getRowHeight())),r=(c=t(this,O).shadowRoot.querySelector("nine-table-header"))==null?void 0:c.getBoundingClientRect().height,i=(l=t(this,O).shadowRoot.querySelector("nine-table-sheets-footer"))==null?void 0:l.getBoundingClientRect().height,o=Qt.SCROLLBAR_SIZE,a=e*s+r+i+o;t(this,O).style.height=`${a}px`},"#applyAutoHeight"));d(this,me,h(()=>{const e=Array.from(t(this,O).children).filter(c=>c.tagName==="TABLE"),s=t(this,O).getAttribute("auto-height")==="true",r=e.length,i=e.map((c,l)=>{const f=`<nine-table-sheet class="${l===0?"active":""}" data-index="${l}"></nine-table-sheet>`,b=l<r-1?`<nine-splitter class="h" data-split-index="${l}"></nine-splitter>`:"";return f+b}).join(""),o=e.map((c,l)=>`<div class="nine-tab-item ${l===0?"active":""}" data-index="${l}">Sheet ${l+1}</div>`).join("");t(this,O).shadowRoot.innerHTML=`
|
|
325
325
|
<style>
|
|
326
326
|
:host {
|
|
327
327
|
display: flex;
|
|
@@ -434,17 +434,17 @@
|
|
|
434
434
|
<nine-table-sheets>
|
|
435
435
|
<nine-table-sheets-body>${i}</nine-table-sheets-body>
|
|
436
436
|
<nine-table-sheets-footer>
|
|
437
|
-
<div class="nine-tab-bar">${
|
|
437
|
+
<div class="nine-tab-bar">${o}</div>
|
|
438
438
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
439
439
|
</nine-table-sheets-footer>
|
|
440
440
|
</nine-table-sheets>
|
|
441
441
|
<nine-table-analysis></nine-table-analysis>
|
|
442
442
|
</nine-table-body>
|
|
443
443
|
<nine-table-footer></nine-table-footer>
|
|
444
|
-
`,t(this,O).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");const a=t(this,O).shadowRoot.querySelectorAll("nine-table-sheet");a==null||a.forEach((c,l)=>{e[l]&&setTimeout(()=>{c.generate(e[l]),s&&t(this,jt).call(this)})})},"#render"));y(this,O,n),t(this,ye).call(this)}};O=new WeakMap,ye=new WeakMap,jt=new WeakMap,me=new WeakMap,h(Qe,"LayoutManager");let He=Qe;const ts=class ts{constructor(n){d(this,Yt);d(this,vt,-1);T(this,"count",h(()=>t(this,Yt).rawRecords.length,"count"));y(this,Yt,n)}get at(){return t(this,vt)}set at(n){y(this,vt,parseInt(n,10)),body&&!body.querySelector(`tbody.bindable tr[data-row="${t(this,vt)}"]`)&&setTimeout(()=>{})}};Yt=new WeakMap,vt=new WeakMap,h(ts,"ngRow");let $e=ts;const P=class P{constructor(n,e){d(this,W);d(this,L);d(this,z,[]);d(this,St,[]);d(this,xe,0);d(this,Q,[]);d(this,we,h(()=>{y(this,Q,[]);const n=t(this,W).template||[];Array.from(n).forEach(e=>{var s;t(this,Q).push(((s=e.getBoundingClientRect)==null?void 0:s.call(e).height)||24)}),(t(this,L).rawRecords||[]).forEach(e=>{e.__ng||(e.__ng=t(this,Ut).call(this)),e.__ng.height=t(this,Q).slice()})},"#initialize"));d(this,ut,h(()=>{const n=t(this,W).shadowRoot.querySelector("nine-table-sheets");n==null||n.classList.toggle("nodata",this.length===0),t(this,W).shadowRoot.querySelectorAll("nine-table-sheet").forEach(e=>{e.invalidate()})},"#invalidate"));T(this,"get",h((n,e)=>{var i;const s=this.getValidData();if(!s||s.length<=0)return;if(n==null)return t(this,At).call(this,s);if(n<0||n>=s.length)return null;const o=typeof((i=t(this,W).fields)==null?void 0:i.get)=="function"?t(this,W).fields.get():[];if(e!=null){const r=o.indexOf(e);return r>=0?s[n].v[r]:null}return t(this,At).call(this,s[n])},"get"));T(this,"set",h(n=>{this.clear(),this.add(n,!1),t(this,ut).call(this)},"set"));d(this,Ut,h(()=>({rowState:P.ROW_STATE.EMPTY,deleted:!1,filtered:!1,height:t(this,Q).slice(),o:{},c:{},_:[0,0,0,0,P.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,t(this,Q).slice(),-1,{},{}]}),"#getDefaultMeta"));T(this,"reset",h(()=>{y(this,z,[]),y(this,St,[]),t(this,ut).call(this)},"reset"));T(this,"clear",h(()=>{var n;t(this,L).rawRecords=[],y(this,z,[]),y(this,St,[]),(n=t(this,L).viewRecords)!=null&&n.reset&&t(this,L).viewRecords.reset()},"clear"));d(this,ve,h(n=>{var o;Array.isArray(n)||(n=[n]);const e=typeof((o=t(this,W).fields)==null?void 0:o.get)=="function"?t(this,W).fields.get():Object.keys(n[0]||{}),s=[];return n.forEach(i=>{const r={v:[]};e.forEach(a=>{r.v.push(i[a]!==void 0&&i[a]!==null?i[a]:"")}),s.push(r)}),s},"#json2Array"));d(this,Se,h(n=>(Array.isArray(n)||(n=[n]),n.forEach(e=>{e.__ng=t(this,Ut).call(this),e.__ng.rowid=this.nextId,e.__ng.rowState=P.ROW_STATE.INSERT,e.__ng._[0]=e.__ng.rowid}),n),"#defaultInsert"));T(this,"add",h((n,e=!0)=>{n===void 0&&(n={});const s=t(this,ve).call(this,n);t(this,L).rawRecords=t(this,L).rawRecords.concat(t(this,Se).call(this,s)),this.resetRecords();const o=this.count()-1;return e||s.forEach((i,r)=>{const a=t(this,L).rawRecords[o-r];a&&(a.__ng.rowState=P.ROW_STATE.EMPTY)}),t(this,ut).call(this),o},"add"));T(this,"delete",h(n=>{let e=[];Array.isArray(n)?e=n:typeof n>"u"?e=[t(this,L).host.row.at]:e=[parseInt(n,10)],e.sort((s,o)=>o-s).forEach(s=>{if(t(this,z)[s]){const o=t(this,z)[s].__ng.rowid;t(this,z)[s].__ng.rowState===P.ROW_STATE.INSERT?t(this,L).rawRecords=t(this,L).rawRecords.filter(i=>i.__ng.rowid!==o):t(this,L).rawRecords.forEach(i=>{i.__ng.rowid===o&&(i.__ng.deleted=!0,i.__ng.rowState=P.ROW_STATE.DELETE)})}}),this.resetRecords(),t(this,ut).call(this)},"delete"));T(this,"setValue",h((n,e,s)=>{var c;n=parseInt(n,10);const i=(typeof((c=t(this,W).fields)==null?void 0:c.get)=="function"?t(this,W).fields.get():[]).indexOf(e);if(i<0)return;const r=this.getValidData()[n];if(!r)return;const a=r.v[i];a!==s&&r.__ng.rowState!==P.ROW_STATE.INSERT&&(r.__ng.o.hasOwnProperty(e)||(r.__ng.o[e]=a),r.__ng.rowState=P.ROW_STATE.UPDATE),r.v[i]=s},"setValue"));T(this,"resetRecords",h(()=>{y(this,St,t(this,L).rawRecords.filter(n=>!n.__ng.deleted)),y(this,z,t(this,L).rawRecords.filter(n=>!n.__ng.deleted&&!n.__ng.filtered)),t(this,L).rawRecords.forEach((n,e)=>{n.__ng.rowidx=e}),t(this,z).forEach((n,e)=>{n.__ng.i=e})},"resetRecords"));T(this,"getValidData",h(()=>(t(this,z).length===0&&t(this,L).rawRecords.length>0&&this.resetRecords(),t(this,z)),"getValidData"));d(this,At,h(n=>{var r;if(!n)return n;const e=!Array.isArray(n),s=e?[n]:n,o=typeof((r=t(this,W).fields)==null?void 0:r.get)=="function"?t(this,W).fields.get():[],i=s.filter(a=>!a.__ng.deleted).map(a=>{const c={};return o.forEach((l,g)=>{c[l]=a.v?a.v[g]:a[l]}),c.__ng=a.__ng,c});return e?i[0]:i},"#conv"));T(this,"count",h(()=>this.getValidData().length,"count"));y(this,W,n),y(this,L,e),t(this,we).call(this)}get source(){return t(this,At).call(this,t(this,L).rawRecords)}set source(n){this.clear(),this.add(n,!1)}get nextId(){return++ms(this,xe)._}get count(){return t(this,z).length}get length(){return t(this,z).length}getRowCount(){return this.length}};W=new WeakMap,L=new WeakMap,z=new WeakMap,St=new WeakMap,xe=new WeakMap,Q=new WeakMap,we=new WeakMap,ut=new WeakMap,Ut=new WeakMap,ve=new WeakMap,Se=new WeakMap,At=new WeakMap,h(P,"ngData"),T(P,"ROW_STATE",{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"});let Ne=P;const es=class es{constructor(n){d(this,gt);y(this,gt,n),this.row=new $e(this),this.data=new Ne(t(this,gt),this),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.pageCnt=25,this.viewRecords.reset=()=>{var e;(e=t(this,gt).view)!=null&&e.redraw&&t(this,gt).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,i;const s=parseInt(e,10);if(!(s>=this.data.count()))return(i=(o=this.data.getValidData()[s])==null?void 0:o.__ng)==null?void 0:i.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,s)=>this.data.get(e,s),this.setColumn=(e,s,o)=>{e=parseInt(e,10),this.data.setValue(e,s,o)},this.setDataSource([])}};gt=new WeakMap,h(es,"ngDataManager");let _e=es;const ss=class ss{constructor(n){d(this,Rt);d(this,H,[]);T(this,"add",h((n,e="string")=>{n.forEach(s=>{t(this,H).some(o=>o.name===s)||t(this,H).push({name:s,type:e})}),t(this,Vt).call(this)},"add"));d(this,Vt,h(()=>{const n=new Map;t(this,H).forEach(e=>{n.set(e.name,e.type)}),y(this,H,Array.from(n,([e,s])=>({name:e,type:s}))),y(this,H,t(this,H).filter(e=>e.name!==""&&e.name!=="__ng")),t(this,H).sort((e,s)=>e.name.length<s.name.length?1:-1)},"#adjust"));d(this,Ae,h(()=>{y(this,H,[]),m.log(t(this,Rt).querySelectorAll("table"));const n=Array.from(t(this,Rt).querySelectorAll("table"));if(!(!n||n.length===0)){for(const e of n)m.log(e),$("[data-bind]",e).each((s,o)=>{const i=o.dataset.bind,r=o.getAttribute("data-type")||"string";i&&t(this,H).push({name:i,type:r})}),["data-expr","background-color","color","tooltip","visible","readonly","enable-button","enable-check","class-expr","icon-color","icon-src"].forEach(s=>{$(`[${s}]`,e).each((o,i)=>{var r=i.getAttribute(s);if(r.indexOf("data.")<0){const a=r.search(/[(]/g);if(a>0)try{r=String(window[r.substring(0,a).trim()])}catch{r=""}}r.split("data.").forEach(a=>{if(a.trim()!=""){const c=a.search(/[^_A-Za-z0-9]/g);let l="";c>=0?l=a.substring(0,c):r.startsWith("data.")&&(l=a.replace("data.","")),l&&t(this,H).push({name:l,type:"string"})}})})});t(this,Vt).call(this)}},"#init"));y(this,Rt,n),t(this,Ae).call(this)}get(){return t(this,H).map(n=>n.name)}getFields(){return t(this,H)}getType(n){const e=t(this,H).find(s=>s.name===n);return e?e.type:"string"}indexOf(n){return t(this,H).findIndex(e=>e.name===n)}includes(n){return t(this,H).some(e=>e.name===n)}};Rt=new WeakMap,H=new WeakMap,Vt=new WeakMap,Ae=new WeakMap,h(ss,"ngFields");let Oe=ss;const ns=class ns extends HTMLElement{constructor(){super();d(this,bt);d(this,Re);d(this,Ee,h(()=>{this.fields=new Oe(this),y(this,Re,new He(this)),m.log("NineTable connected."),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,detail:{target:this}}))},"#init"));this.attachShadow({mode:"open"}),y(this,bt,new _e(this))}connectedCallback(){t(this,Ee).call(this)}disconnectedCallback(){m.log("NineTable disconnected.")}get data(){return t(this,bt).data}get row(){return t(this,bt).row}get dataManager(){return t(this,bt)}};bt=new WeakMap,Re=new WeakMap,Ee=new WeakMap,h(ns,"NineTable");let De=ns;customElements.get("nine-table")||customElements.define("nine-table",De);const Xt=class Xt extends HTMLElement{constructor(){super()}applyBaseStyle(){this.constructor.name}connectedCallback(){}};h(Xt,"BasicCellElement"),T(Xt,"_styleCache",new Map),T(Xt,"_customStyleCache",new Map);let We=Xt;const cs=class cs extends We{constructor(){super();d(this,M);d(this,Kt);d(this,v);d(this,rs);d(this,os);d(this,is);d(this,as);T(this,"getDisplayText",h(e=>{if(t(this,v))if(t(this,v).closest("tbody")){const s=t(this,v).closest("tr").data,o=parseInt(t(this,v).dataset.row);if(!s)return"";if(ninegrid.isNull(t(this,v).dataset.expr)){if(!ninegrid.isNull(t(this,v).dataset.bind))return s[t(this,v).dataset.bind]||ninegrid.nvl(e,"")}else try{return this.getExprValue(t(this,v).dataset.expr,s,o,t(this,v))}catch{console.error(t(this,v).dataset.expr,s,t(this,v).dataset.row)}return ninegrid.nvl(e,"")}else try{return t(this,M).exprFunction(t(this,v).dataset.expr).call(this,null,-1,t(this,M).data)}catch{}},"getDisplayText"));d(this,ls,h(()=>{if(!(!t(this,M)||!t(this,M).template||!t(this,v).closest("tbody.bindable"))){var e=ninegrid.j.querySelectorAll(t(this,v)).attr("suppress");if(e&&(e=parseInt(e)),e&&!isNaN(e)){var s=t(this,v).closest("tr"),o=[];$("th,td",s).each((x,k)=>{var R=ninegrid.j.querySelectorAll(k).attr("suppress");R&&k.dataset.row&&(R=parseInt(R),!isNaN(R)&&R<=e&&o.push(R))}),o.sort();var i=!1;if(parseInt(s.sectionRowIndex/t(this,M).template.length)>0)for(var r of o){if(r>e)break;var a=parseInt(t(this,v).dataset.row),c=a-1,l=t(this,v).closest("tr").data,g=t(this,M).data.get(c);t(this,v).dataset.matrixRow;var f=t(this,M).body.querySelector(`tbody.bindable [suppress="${r}"][data-matrix-row="${t(this,v).dataset.matrixRow}"]`),b=f.dataset.expr?this.getExprValue(f.dataset.expr,l,a):l[f.dataset.bind],u=f.dataset.expr?this.getExprValue(f.dataset.expr,g,c):g[f.dataset.bind];if(b!=u){i=!0;break}}else i=!0;i?ninegrid.j.querySelectorAll(t(this,v)).removeClass("suppress"):ninegrid.j.querySelectorAll(t(this,v)).addClass("suppress"),ninegrid.j.querySelectorAll(t(this,v)).hasClass("hidden")||(i?ninegrid.j.querySelectorAll(t(this,v)).removeClass("hidden"):ninegrid.j.querySelectorAll(t(this,v)).addClass("hidden"));var p=parseInt(t(this,v).dataset.matrixRow),w=p-1,S=t(this,M).body.querySelector(`tbody.bindable [data-col="${t(this,v).dataset.col}"][data-matrix-row="${w}"]`);$(S).hasClass("suppress")&&!ninegrid.j.querySelectorAll(t(this,v)).hasClass("suppress")?ninegrid.j.querySelectorAll(S).removeClass("last-none-suppress").addClass("last-suppress"):!$(S).hasClass("suppress")&&ninegrid.j.querySelectorAll(t(this,v)).hasClass("suppress")?ninegrid.j.querySelectorAll(S).removeClass("last-suppress").addClass("last-none-suppress"):ninegrid.j.querySelectorAll(S).removeClass("last-none-suppress").removeClass("last-suppress")}}},"#resetSuppress"));T(this,"getExprValue",h((e,s,o,i)=>{if(typeof e<"u")try{o=parseInt(o);const r=e.replace("()","");return t(this,M)[r]?t(this,M)[r].call(this,s,o,t(this,v)):t(this,M).exprFunction(e).call(this,s,o,t(this,M).data)}catch{return["NG-COMBO"].includes(this.tagName)?"":e}else return e},"getExprValue"))}connectedCallback(){super.connectedCallback(),y(this,M,this.getRootNode().host),y(this,v,this.closest("th,td")),y(this,Kt,t(this,v).closest("tr"))}get value(){var e=!t(this,M)||!t(this,M).dataManager||!t(this,v)||!t(this,v).dataset||!t(this,v).dataset.row||!t(this,v).dataset.bind?"":t(this,v).closest("tr").data[t(this,v).dataset.bind];return e??""}set value(e){var s=parseInt(t(this,v).dataset.row);const o=this.getAttribute("update-row-state")!="false";s<0?t(this,M).data.setValueNF(parseInt(t(this,v).dataset.index),t(this,v).dataset.bind,e,o):t(this,M).data.setValue(s,t(this,v).dataset.bind,e,o)}get row(){return parseInt(t(this,v).dataset.row)}get data(){return t(this,v).closest("tr").data}refresh(){const e=t(this,v).dataset.bind;return parseInt(t(this,v).dataset.row),t(this,Kt).data[e]}};M=new WeakMap,Kt=new WeakMap,v=new WeakMap,rs=new WeakMap,os=new WeakMap,is=new WeakMap,as=new WeakMap,ls=new WeakMap,h(cs,"CellElement");let ze=cs;const hs=class hs extends ze{constructor(){super()}connectedCallback(){super.connectedCallback()}refresh(){return super.refresh()}};h(hs,"EditableCellElement");let Be=hs;const fs=class fs extends Be{constructor(){super();d(this,Gt);d(this,pt);d(this,Et);d(this,qt);d(this,qe);d(this,tt);T(this,"refresh",h(()=>{const e=super.refresh();t(this,Gt).value=e},"refresh"));d(this,ds,h(e=>{if(!["Escape","Enter","Tab","Home","End","ArrowLeft","ArrowRight","PageUp","PageDown","Backspace","Delete"].includes(e.code)){if(t(this,pt)=="number"){let i=[];if(t(this,tt)&&Number(t(this,tt))>0&&i.push("."),t(this,qt)&&Number(t(this,qt))>=0&&i.push("-"),!(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)&&!i.includes(e.key)&&e.preventDefault(),t(this,tt)&&(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)&&e.target.selectionStart==e.target.selectionEnd){var s=e.target.value,o=s.indexOf(".");if(o>=0){var s=s.substr(o+1,s.length);s.length>=Number(t(this,tt))&&e.preventDefault()}}}t(this,Et)&&ninegrid.getByteLength(e.target.value)>=Number(t(this,Et))&&e.target.selectionStart==e.target.selectionEnd&&e.preventDefault()}},"#onKeyDown"));if(this.applyBaseStyle(),y(this,pt,this.getAttribute("type")||"text"),y(this,Et,this.getAttribute("maxbyte")),y(this,qt,this.getAttribute("min")),y(this,qe,this.getAttribute("max")),y(this,tt,this.getAttribute("scale")),!["text","number"].includes(t(this,pt)))throw`invalid type : ${t(this,pt)}`}connectedCallback(){for(var e=[],s=0;s<this.attributes.length;s++)["type","maxlength","maxbyte","min","max","step","scale","text-align"].includes(this.attributes[s].name)&&e.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);this.innerHTML=`
|
|
444
|
+
`,t(this,O).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");const a=t(this,O).shadowRoot.querySelectorAll("nine-table-sheet");a==null||a.forEach((c,l)=>{e[l]&&setTimeout(()=>{c.generate(e[l]),s&&t(this,Yt).call(this)})})},"#render"));y(this,O,n),t(this,ye).call(this)}};O=new WeakMap,ye=new WeakMap,Yt=new WeakMap,me=new WeakMap,h(Qe,"LayoutManager");let He=Qe;const ts=class ts{constructor(n){d(this,Vt);d(this,St,-1);T(this,"count",h(()=>t(this,Vt).rawRecords.length,"count"));y(this,Vt,n)}get at(){return t(this,St)}set at(n){y(this,St,parseInt(n,10)),body&&!body.querySelector(`tbody.bindable tr[data-row="${t(this,St)}"]`)&&setTimeout(()=>{})}};Vt=new WeakMap,St=new WeakMap,h(ts,"ngRow");let $e=ts;const F=class F{constructor(n,e){d(this,B);d(this,L);d(this,W,[]);d(this,Rt,[]);d(this,xe,0);d(this,tt,[]);d(this,we,h(()=>{y(this,tt,[]);const n=t(this,B).template||[];Array.from(n).forEach(e=>{var s;t(this,tt).push(((s=e.getBoundingClientRect)==null?void 0:s.call(e).height)||24)}),(t(this,L).rawRecords||[]).forEach(e=>{e.__ng||(e.__ng=t(this,Ut).call(this)),e.__ng.height=t(this,tt).slice()})},"#initialize"));d(this,bt,h(()=>{const n=t(this,B).shadowRoot.querySelector("nine-table-sheets");n==null||n.classList.toggle("nodata",this.length===0),t(this,B).shadowRoot.querySelectorAll("nine-table-sheet").forEach(e=>{e.invalidate()})},"#invalidate"));T(this,"get",h((n,e)=>{var i;const s=this.getValidData();if(!s||s.length<=0)return;if(n==null)return t(this,At).call(this,s);if(n<0||n>=s.length)return null;const r=typeof((i=t(this,B).fields)==null?void 0:i.get)=="function"?t(this,B).fields.get():[];if(e!=null){const o=r.indexOf(e);return o>=0?s[n].v[o]:null}return t(this,At).call(this,s[n])},"get"));T(this,"set",h(n=>{this.clear(),this.add(n,!1),t(this,bt).call(this)},"set"));d(this,Ut,h(()=>({rowState:F.ROW_STATE.EMPTY,deleted:!1,filtered:!1,height:t(this,tt).slice(),o:{},c:{},_:[0,0,0,0,F.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,t(this,tt).slice(),-1,{},{}]}),"#getDefaultMeta"));T(this,"reset",h(()=>{y(this,W,[]),y(this,Rt,[]),t(this,bt).call(this)},"reset"));T(this,"clear",h(()=>{var n;t(this,L).rawRecords=[],y(this,W,[]),y(this,Rt,[]),(n=t(this,L).viewRecords)!=null&&n.reset&&t(this,L).viewRecords.reset()},"clear"));d(this,ve,h(n=>{var r;Array.isArray(n)||(n=[n]);const e=typeof((r=t(this,B).fields)==null?void 0:r.get)=="function"?t(this,B).fields.get():Object.keys(n[0]||{}),s=[];return n.forEach(i=>{const o={v:[]};e.forEach(a=>{o.v.push(i[a]!==void 0&&i[a]!==null?i[a]:"")}),s.push(o)}),s},"#json2Array"));d(this,Se,h(n=>(Array.isArray(n)||(n=[n]),n.forEach(e=>{e.__ng=t(this,Ut).call(this),e.__ng.rowid=this.nextId,e.__ng.rowState=F.ROW_STATE.INSERT,e.__ng._[0]=e.__ng.rowid}),n),"#defaultInsert"));T(this,"add",h((n,e=!0)=>{n===void 0&&(n={});const s=t(this,ve).call(this,n);t(this,L).rawRecords=t(this,L).rawRecords.concat(t(this,Se).call(this,s)),this.resetRecords();const r=this.count()-1;return e||s.forEach((i,o)=>{const a=t(this,L).rawRecords[r-o];a&&(a.__ng.rowState=F.ROW_STATE.EMPTY)}),t(this,bt).call(this),r},"add"));T(this,"delete",h(n=>{let e=[];Array.isArray(n)?e=n:typeof n>"u"?e=[t(this,L).host.row.at]:e=[parseInt(n,10)],e.sort((s,r)=>r-s).forEach(s=>{if(t(this,W)[s]){const r=t(this,W)[s].__ng.rowid;t(this,W)[s].__ng.rowState===F.ROW_STATE.INSERT?t(this,L).rawRecords=t(this,L).rawRecords.filter(i=>i.__ng.rowid!==r):t(this,L).rawRecords.forEach(i=>{i.__ng.rowid===r&&(i.__ng.deleted=!0,i.__ng.rowState=F.ROW_STATE.DELETE)})}}),this.resetRecords(),t(this,bt).call(this)},"delete"));T(this,"setValue",h((n,e,s)=>{var c;n=parseInt(n,10);const i=(typeof((c=t(this,B).fields)==null?void 0:c.get)=="function"?t(this,B).fields.get():[]).indexOf(e);if(i<0)return;const o=this.getValidData()[n];if(!o)return;const a=o.v[i];a!==s&&o.__ng.rowState!==F.ROW_STATE.INSERT&&(o.__ng.o.hasOwnProperty(e)||(o.__ng.o[e]=a),o.__ng.rowState=F.ROW_STATE.UPDATE),o.v[i]=s},"setValue"));T(this,"resetRecords",h(()=>{y(this,Rt,t(this,L).rawRecords.filter(n=>!n.__ng.deleted)),y(this,W,t(this,L).rawRecords.filter(n=>!n.__ng.deleted&&!n.__ng.filtered)),t(this,L).rawRecords.forEach((n,e)=>{n.__ng.rowidx=e}),t(this,W).forEach((n,e)=>{n.__ng.i=e})},"resetRecords"));T(this,"getValidData",h(()=>(t(this,W).length===0&&t(this,L).rawRecords.length>0&&this.resetRecords(),t(this,W)),"getValidData"));d(this,At,h(n=>{var o;if(!n)return n;const e=!Array.isArray(n),s=e?[n]:n,r=typeof((o=t(this,B).fields)==null?void 0:o.get)=="function"?t(this,B).fields.get():[],i=s.filter(a=>!a.__ng.deleted).map(a=>{const c={};return r.forEach((l,g)=>{c[l]=a.v?a.v[g]:a[l]}),c.__ng=a.__ng,c});return e?i[0]:i},"#conv"));T(this,"count",h(()=>this.getValidData().length,"count"));y(this,B,n),y(this,L,e),t(this,we).call(this)}get source(){return t(this,At).call(this,t(this,L).rawRecords)}set source(n){this.clear(),this.add(n,!1)}get nextId(){return++xs(this,xe)._}get count(){return t(this,W).length}get length(){return t(this,W).length}getRowCount(){return this.length}};B=new WeakMap,L=new WeakMap,W=new WeakMap,Rt=new WeakMap,xe=new WeakMap,tt=new WeakMap,we=new WeakMap,bt=new WeakMap,Ut=new WeakMap,ve=new WeakMap,Se=new WeakMap,At=new WeakMap,h(F,"ngData"),T(F,"ROW_STATE",{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"});let Ne=F;const es=class es{constructor(n){d(this,pt);y(this,pt,n),this.row=new $e(this),this.data=new Ne(t(this,pt),this),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.pageCnt=25,this.viewRecords.reset=()=>{var e;(e=t(this,pt).view)!=null&&e.redraw&&t(this,pt).view.redraw()},this.setDataSource=e=>{this.data&&this.data.reset(),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.data.set(e||[])},this.getRowState=e=>{var r,i;const s=parseInt(e,10);if(!(s>=this.data.count()))return(i=(r=this.data.getValidData()[s])==null?void 0:r.__ng)==null?void 0:i.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,s)=>this.data.get(e,s),this.setColumn=(e,s,r)=>{e=parseInt(e,10),this.data.setValue(e,s,r)},this.setDataSource([])}};pt=new WeakMap,h(es,"ngDataManager");let _e=es;const ss=class ss{constructor(n){d(this,Et);d(this,H,[]);T(this,"add",h((n,e="string")=>{n.forEach(s=>{t(this,H).some(r=>r.name===s)||t(this,H).push({name:s,type:e})}),t(this,Xt).call(this)},"add"));d(this,Xt,h(()=>{const n=new Map;t(this,H).forEach(e=>{n.set(e.name,e.type)}),y(this,H,Array.from(n,([e,s])=>({name:e,type:s}))),y(this,H,t(this,H).filter(e=>e.name!==""&&e.name!=="__ng")),t(this,H).sort((e,s)=>e.name.length<s.name.length?1:-1)},"#adjust"));d(this,Re,h(()=>{y(this,H,[]),m.log(t(this,Et).querySelectorAll("table"));const n=Array.from(t(this,Et).querySelectorAll("table"));if(!(!n||n.length===0)){for(const e of n)m.log(e),$("[data-bind]",e).each((s,r)=>{const i=r.dataset.bind,o=r.getAttribute("data-type")||"string";i&&t(this,H).push({name:i,type:o})}),["data-expr","background-color","color","tooltip","visible","readonly","enable-button","enable-check","class-expr","icon-color","icon-src"].forEach(s=>{$(`[${s}]`,e).each((r,i)=>{var o=i.getAttribute(s);if(o.indexOf("data.")<0){const a=o.search(/[(]/g);if(a>0)try{o=String(window[o.substring(0,a).trim()])}catch{o=""}}o.split("data.").forEach(a=>{if(a.trim()!=""){const c=a.search(/[^_A-Za-z0-9]/g);let l="";c>=0?l=a.substring(0,c):o.startsWith("data.")&&(l=a.replace("data.","")),l&&t(this,H).push({name:l,type:"string"})}})})});t(this,Xt).call(this)}},"#init"));y(this,Et,n),t(this,Re).call(this)}get(){return t(this,H).map(n=>n.name)}getFields(){return t(this,H)}getType(n){const e=t(this,H).find(s=>s.name===n);return e?e.type:"string"}indexOf(n){return t(this,H).findIndex(e=>e.name===n)}includes(n){return t(this,H).some(e=>e.name===n)}};Et=new WeakMap,H=new WeakMap,Xt=new WeakMap,Re=new WeakMap,h(ss,"ngFields");let Oe=ss;const ns=class ns extends HTMLElement{constructor(){super();d(this,yt);d(this,Ae);d(this,Ee,h(()=>{this.fields=new Oe(this),y(this,Ae,new He(this)),m.log("NineTable connected."),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,detail:{target:this}}))},"#init"));this.attachShadow({mode:"open"}),y(this,yt,new _e(this))}connectedCallback(){t(this,Ee).call(this)}disconnectedCallback(){m.log("NineTable disconnected.")}get data(){return t(this,yt).data}get row(){return t(this,yt).row}get dataManager(){return t(this,yt)}};yt=new WeakMap,Ae=new WeakMap,Ee=new WeakMap,h(ns,"NineTable");let De=ns;customElements.get("nine-table")||customElements.define("nine-table",De);const Kt=class Kt extends HTMLElement{constructor(){super()}applyBaseStyle(){this.constructor.name}connectedCallback(){}};h(Kt,"BasicCellElement"),T(Kt,"_styleCache",new Map),T(Kt,"_customStyleCache",new Map);let Be=Kt;const cs=class cs extends Be{constructor(){super();d(this,M);d(this,Gt);d(this,S);d(this,rs);d(this,os);d(this,is);d(this,as);T(this,"getDisplayText",h(e=>{if(t(this,S))if(t(this,S).closest("tbody")){const s=t(this,S).closest("tr").data,r=parseInt(t(this,S).dataset.row);if(!s)return"";if(ninegrid.isNull(t(this,S).dataset.expr)){if(!ninegrid.isNull(t(this,S).dataset.bind))return s[t(this,S).dataset.bind]||ninegrid.nvl(e,"")}else try{return this.getExprValue(t(this,S).dataset.expr,s,r,t(this,S))}catch{console.error(t(this,S).dataset.expr,s,t(this,S).dataset.row)}return ninegrid.nvl(e,"")}else try{return t(this,M).exprFunction(t(this,S).dataset.expr).call(this,null,-1,t(this,M).data)}catch{}},"getDisplayText"));d(this,ls,h(()=>{if(!(!t(this,M)||!t(this,M).template||!t(this,S).closest("tbody.bindable"))){var e=ninegrid.j.querySelectorAll(t(this,S)).attr("suppress");if(e&&(e=parseInt(e)),e&&!isNaN(e)){var s=t(this,S).closest("tr"),r=[];$("th,td",s).each((x,k)=>{var A=ninegrid.j.querySelectorAll(k).attr("suppress");A&&k.dataset.row&&(A=parseInt(A),!isNaN(A)&&A<=e&&r.push(A))}),r.sort();var i=!1;if(parseInt(s.sectionRowIndex/t(this,M).template.length)>0)for(var o of r){if(o>e)break;var a=parseInt(t(this,S).dataset.row),c=a-1,l=t(this,S).closest("tr").data,g=t(this,M).data.get(c);t(this,S).dataset.matrixRow;var f=t(this,M).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this,S).dataset.matrixRow}"]`),b=f.dataset.expr?this.getExprValue(f.dataset.expr,l,a):l[f.dataset.bind],u=f.dataset.expr?this.getExprValue(f.dataset.expr,g,c):g[f.dataset.bind];if(b!=u){i=!0;break}}else i=!0;i?ninegrid.j.querySelectorAll(t(this,S)).removeClass("suppress"):ninegrid.j.querySelectorAll(t(this,S)).addClass("suppress"),ninegrid.j.querySelectorAll(t(this,S)).hasClass("hidden")||(i?ninegrid.j.querySelectorAll(t(this,S)).removeClass("hidden"):ninegrid.j.querySelectorAll(t(this,S)).addClass("hidden"));var p=parseInt(t(this,S).dataset.matrixRow),w=p-1,v=t(this,M).body.querySelector(`tbody.bindable [data-col="${t(this,S).dataset.col}"][data-matrix-row="${w}"]`);$(v).hasClass("suppress")&&!ninegrid.j.querySelectorAll(t(this,S)).hasClass("suppress")?ninegrid.j.querySelectorAll(v).removeClass("last-none-suppress").addClass("last-suppress"):!$(v).hasClass("suppress")&&ninegrid.j.querySelectorAll(t(this,S)).hasClass("suppress")?ninegrid.j.querySelectorAll(v).removeClass("last-suppress").addClass("last-none-suppress"):ninegrid.j.querySelectorAll(v).removeClass("last-none-suppress").removeClass("last-suppress")}}},"#resetSuppress"));T(this,"getExprValue",h((e,s,r,i)=>{if(typeof e<"u")try{r=parseInt(r);const o=e.replace("()","");return t(this,M)[o]?t(this,M)[o].call(this,s,r,t(this,S)):t(this,M).exprFunction(e).call(this,s,r,t(this,M).data)}catch{return["NG-COMBO"].includes(this.tagName)?"":e}else return e},"getExprValue"))}connectedCallback(){super.connectedCallback(),y(this,M,this.getRootNode().host),y(this,S,this.closest("th,td")),y(this,Gt,t(this,S).closest("tr"))}get value(){var e=!t(this,M)||!t(this,M).dataManager||!t(this,S)||!t(this,S).dataset||!t(this,S).dataset.row||!t(this,S).dataset.bind?"":t(this,S).closest("tr").data[t(this,S).dataset.bind];return e??""}set value(e){var s=parseInt(t(this,S).dataset.row);const r=this.getAttribute("update-row-state")!="false";s<0?t(this,M).data.setValueNF(parseInt(t(this,S).dataset.index),t(this,S).dataset.bind,e,r):t(this,M).data.setValue(s,t(this,S).dataset.bind,e,r)}get row(){return parseInt(t(this,S).dataset.row)}get data(){return t(this,S).closest("tr").data}refresh(){const e=t(this,S).dataset.bind;return parseInt(t(this,S).dataset.row),t(this,Gt).data[e]}};M=new WeakMap,Gt=new WeakMap,S=new WeakMap,rs=new WeakMap,os=new WeakMap,is=new WeakMap,as=new WeakMap,ls=new WeakMap,h(cs,"CellElement");let We=cs;const hs=class hs extends We{constructor(){super()}connectedCallback(){super.connectedCallback()}refresh(){return super.refresh()}};h(hs,"EditableCellElement");let ze=hs;const fs=class fs extends ze{constructor(){super();d(this,Zt);d(this,mt);d(this,qt);d(this,Ct);d(this,qe);d(this,et);T(this,"refresh",h(()=>{const e=super.refresh();t(this,Zt).value=e},"refresh"));d(this,ds,h(e=>{if(!["Escape","Enter","Tab","Home","End","ArrowLeft","ArrowRight","PageUp","PageDown","Backspace","Delete"].includes(e.code)){if(t(this,mt)=="number"){let i=[];if(t(this,et)&&Number(t(this,et))>0&&i.push("."),t(this,Ct)&&Number(t(this,Ct))>=0&&i.push("-"),!(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)&&!i.includes(e.key)&&e.preventDefault(),t(this,et)&&(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)&&e.target.selectionStart==e.target.selectionEnd){var s=e.target.value,r=s.indexOf(".");if(r>=0){var s=s.substr(r+1,s.length);s.length>=Number(t(this,et))&&e.preventDefault()}}}t(this,qt)&&ninegrid.getByteLength(e.target.value)>=Number(t(this,qt))&&e.target.selectionStart==e.target.selectionEnd&&e.preventDefault()}},"#onKeyDown"));if(this.applyBaseStyle(),y(this,mt,this.getAttribute("type")||"text"),y(this,qt,this.getAttribute("maxbyte")),y(this,Ct,this.getAttribute("min")),y(this,qe,this.getAttribute("max")),y(this,et,this.getAttribute("scale")),!["text","number"].includes(t(this,mt)))throw`invalid type : ${t(this,mt)}`}connectedCallback(){for(var e=[],s=0;s<this.attributes.length;s++)["type","maxlength","maxbyte","min","max","step","scale","text-align"].includes(this.attributes[s].name)&&e.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);this.innerHTML=`
|
|
445
445
|
<input type="text"
|
|
446
446
|
${e.join(" ")}
|
|
447
447
|
ondragstart="return false;"
|
|
448
448
|
>
|
|
449
|
-
`,super.connectedCallback(),y(this,
|
|
449
|
+
`,super.connectedCallback(),y(this,Zt,this.querySelector("input"))}};Zt=new WeakMap,mt=new WeakMap,qt=new WeakMap,Ct=new WeakMap,qe=new WeakMap,et=new WeakMap,ds=new WeakMap,h(fs,"CellInputText");let Pe=fs;customElements.get("cell-input-text"),customElements.get("cell-input")||customElements.define("cell-input",Pe)});
|
|
450
450
|
//# sourceMappingURL=nine-table.umd.js.map
|