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