@ninebone/table 0.0.467 → 0.0.469

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.
@@ -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=c(()=>{const s=t(this,Y).shadowRoot.querySelector(".ng-container-body .ng-part-body");if(!s){setTimeout(e,10);return}b(this,T,{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,Bt).call(this),this.refresh()},"initWhenReady");e()}};Y=new WeakMap,lt=new WeakMap,tt=new WeakMap,T=new WeakMap,xt=new WeakMap,vt=new WeakMap,Bt=new WeakMap,c(Re,"NineTableVScrollBar");let mt=Re;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",mt);const qe=class qe{constructor(i){d(this,j);d(this,R);d(this,D,new Map);d(this,I,null);d(this,U,null);d(this,et,0);d(this,wt,40);d(this,ct,!1);d(this,zt,3);A(this,"refresh",c(()=>{var e;const i=t(this,R).querySelector(".ng-container-body .ng-part-body");i&&(t(this,St).call(this),t(this,ht).call(this,i.scrollTop),(e=t(this,R).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));A(this,"initialize",c(()=>{b(this,I,null),t(this,D).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const r=t(this,R).querySelector(n);if(!r)return;const o=r.querySelector(".ng-part-body table");if(!o)return;const a=o.querySelector("tbody.bindable-tbody");if(!a)return;const l=Array.from(a.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,D).set(n,l)});const i=t(this,R).querySelector(".ng-container-body .ng-part-body"),e=t(this,R).querySelector(".ng-container-left .ng-part-body"),s=t(this,R).querySelector(".ng-container-right .ng-part-body");if(i){t(this,Pt).call(this,i),t(this,At).call(this),t(this,St).call(this),t(this,ht).call(this,i.scrollTop);let n=!1;const r=c((o,a)=>{var h;n||(n=!0,i&&i.scrollTop!==o&&(i.scrollTop=o),e&&e.scrollTop!==o&&(e.scrollTop=o),s&&s.scrollTop!==o&&(s.scrollTop=o),t(this,ht).call(this,o),(h=t(this,R).querySelector("nine-table-vscrollbar"))==null||h.refresh(),n=!1)},"syncScroll");[i,e,s].forEach(o=>{o&&o.addEventListener("scroll",()=>{r(o.scrollTop)})})}},"initialize"));d(this,Dt,c((i,e)=>{const s=t(this,D).get(e);if(!s||s.length===0)return;const n=i.querySelector(".ng-part-body tbody.bindable-tbody");if(!n)return;n.querySelectorAll("tr:not(.nodata)").forEach(a=>a.remove());const r=n.querySelector("tr.nodata"),o=document.createDocumentFragment();for(let a=0;a<t(this,wt);a++)s.forEach(h=>{o.appendChild(h.cloneNode(!0))});r?r.before(o):n.appendChild(o)},"#renderRows"));d(this,Pt,c(i=>{if(t(this,I)!==null&&t(this,I)>0)return t(this,I);const e=t(this,D).get(".ng-container-body");if(!e||e.length===0)return 24;const s=i.querySelector("tbody.bindable-tbody");if(!s)return 24;s.querySelectorAll("tr:not(.nodata)").forEach(p=>p.remove());const n=s.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(p=>{r.appendChild(p.cloneNode(!0))}),n?n.before(r):s.appendChild(r);const o=t(this,R),a=o.style.display,h=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 f=0;const u=s.querySelectorAll("tr:not(.nodata)");return u.forEach(p=>{f+=p.offsetHeight||p.getBoundingClientRect().height}),u.forEach(p=>p.remove()),o.style.display=a,o.style.visibility=h,o.style.position=l,b(this,I,f>0?f:24),t(this,Et).call(this),t(this,I)},"#measureAndCacheHeight"));d(this,St,c(()=>{const e=(t(this,j).data.get()||[]).length,s=t(this,I)||24,n=e*s;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const o=t(this,R).querySelector(r);if(!o)return;const a=o.querySelector(".ng-part-body .ng-virtual-spacer");a&&(a.style.height=`${n}px`)})},"#updateVirtualScrollHeight"));d(this,Et,c(()=>{if(t(this,et)>0&&t(this,I)>0){const i=Math.ceil(t(this,et)/t(this,I));b(this,wt,i+t(this,zt))}},"#updateRowCount"));d(this,jt,c(()=>{var a,h,l,f,u,p;const i=t(this,R).querySelector(".ng-container-left .ng-part-body table"),e=t(this,R).querySelector(".ng-container-body .ng-part-body table"),s=t(this,R).querySelector(".ng-container-right .ng-part-body table");if(e){const g=i?Array.from(i.querySelectorAll("tbody tr")):[],m=Array.from(e.querySelectorAll("tbody tr")),v=s?Array.from(s.querySelectorAll("tbody tr")):[],q=Math.max(g.length,m.length,v.length);for(let x=0;x<q;x++){const B=[((a=g[x])==null?void 0:a.getBoundingClientRect().height)||0,((h=m[x])==null?void 0:h.getBoundingClientRect().height)||0,((l=v[x])==null?void 0:l.getBoundingClientRect().height)||0],M=Math.max(...B);M>0&&(g[x]&&(g[x].style.height=`${M}px`),m[x]&&(m[x].style.height=`${M}px`),v[x]&&(v[x].style.height=`${M}px`))}}const n=t(this,R).querySelector(".ng-container-left .ng-part-footer table"),r=t(this,R).querySelector(".ng-container-body .ng-part-footer table"),o=t(this,R).querySelector(".ng-container-right .ng-part-footer table");if(r){const g=n?Array.from(n.querySelectorAll("tfoot tr")):[],m=Array.from(r.querySelectorAll("tfoot tr")),v=o?Array.from(o.querySelectorAll("tfoot tr")):[],q=Math.max(g.length,m.length,v.length);for(let x=0;x<q;x++){const B=[((f=g[x])==null?void 0:f.getBoundingClientRect().height)||0,((u=m[x])==null?void 0:u.getBoundingClientRect().height)||0,((p=v[x])==null?void 0:p.getBoundingClientRect().height)||0],M=Math.max(...B);M>0&&(g[x]&&(g[x].style.height=`${M}px`),m[x]&&(m[x].style.height=`${M}px`),v[x]&&(v[x].style.height=`${M}px`))}}},"#syncRowHeights"));d(this,Ft,c(()=>{!t(this,R)||!(t(this,R)instanceof HTMLElement)||(b(this,U,new ResizeObserver(i=>{for(const e of i){const s=e.target;if(!s.classList.contains("active"))continue;const n=e.contentRect.height;if(n>0){let r=0;const o=s.querySelector(".ng-part-header"),a=s.querySelector(".ng-part-footer");o&&(r+=o.offsetHeight),a&&(r+=a.offsetHeight);const h=Math.max(n-r,100);t(this,et)!==h&&(b(this,et,h),t(this,Et).call(this),t(this,I)!==null&&t(this,At).call(this))}}})),t(this,U).observe(t(this,R)))},"#initResizeObserver"));d(this,At,c(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(i=>{const e=t(this,R).querySelector(i);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,Dt).call(this,e,i)}),t(this,Yt).call(this),t(this,jt).call(this)},"#renderAllContainers"));d(this,Vt,c(i=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var l;const s=t(this,R).querySelector(e);if(!s)return;const n=s.querySelector(".ng-part-body tbody.bindable-tbody");if(!n)return;const r=Array.from(n.querySelectorAll("tr:not(.nodata)")),o=((l=t(this,D).get(e))==null?void 0:l.length)||1,h=(t(this,j).data.get()||[]).length;r.forEach((f,u)=>{const p=i+Math.floor(u/o);if(p>=h){f.style.display="none";return}const g=t(this,j).data.get(p);f.style.display="",t(this,Rt).call(this,f,g,p)})})},"#adjustBufferRows"));d(this,ht,c(i=>{var h;const e=t(this,I);if(!e||e<=0)return;const n=(t(this,j).data.get()||[]).length,r=Math.max(0,Math.floor(i/e)),o=r*e,a=((h=t(this,D).get(".ng-container-body"))==null?void 0:h.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(l=>{const f=t(this,R).querySelector(l);if(!f)return;const u=f.querySelector(".ng-part-body tbody.bindable-tbody");if(!u)return;u.style.transform=`translateY(${o}px)`,Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((g,m)=>{const v=r+Math.floor(m/a);if(v>=n){g.style.display="none";return}const q=t(this,j).data.get(v);g.style.display="",t(this,Rt).call(this,g,q,v)})}),t(this,ct)||(b(this,ct,!0),setTimeout(()=>{t(this,Vt).call(this,r),b(this,ct,!1)},0))},"#handleScroll"));d(this,Rt,c((i,e,s)=>{i.dataset.row=s,i.data=e,Array.from(i.cells).forEach((n,r)=>{n.dataset.row=s,n.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');const o=Array.from(n.children).find(a=>a.tagName.toLowerCase().startsWith("cell-")||typeof a.refresh=="function");o&&typeof o.refresh=="function"&&o.refresh()})},"#bindRowData"));d(this,Yt,c(()=>{var h,l,f;const i=t(this,R).querySelector(".ng-container-left .ng-part-header table"),e=t(this,R).querySelector(".ng-container-body .ng-part-header table"),s=t(this,R).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const n=i?Array.from(i.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),o=s?Array.from(s.querySelectorAll("tr")):[],a=Math.max(n.length,r.length,o.length);for(let u=0;u<a;u++){const p=[((h=n[u])==null?void 0:h.getBoundingClientRect().height)||0,((l=r[u])==null?void 0:l.getBoundingClientRect().height)||0,((f=o[u])==null?void 0:f.getBoundingClientRect().height)||0],g=Math.max(...p);g>0&&(n[u]&&(n[u].style.height=`${g}px`),r[u]&&(r[u].style.height=`${g}px`),o[u]&&(o[u].style.height=`${g}px`))}},"#syncHeaderHeights"));A(this,"destroy",c(()=>{t(this,U)&&(t(this,U).disconnect(),b(this,U,null))},"destroy"));b(this,j,i.getRootNode().host),b(this,R,i),t(this,Ft).call(this)}getRowHeight(){return t(this,I)}templateLength(i=".ng-container-body"){var e;return((e=t(this,D).get(i))==null?void 0:e.length)||1}};j=new WeakMap,R=new WeakMap,D=new WeakMap,I=new WeakMap,U=new WeakMap,et=new WeakMap,wt=new WeakMap,ct=new WeakMap,zt=new WeakMap,Dt=new WeakMap,Pt=new WeakMap,St=new WeakMap,Et=new WeakMap,jt=new WeakMap,Ft=new WeakMap,At=new WeakMap,Vt=new WeakMap,ht=new WeakMap,Rt=new WeakMap,Yt=new WeakMap,c(qe,"RowManager");let he=qe;const Ut=class Ut{static compileAll(i){return Array.isArray(i)?i.map(e=>Ut.compile(e)):[]}static compile(i){if(!i)return null;const e=c(a=>{a.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 p=l.getAttribute("data-bind"),g=l.getAttribute("data-expr"),m=l.getAttribute("maxbyte"),v=l.getAttribute("type");let q=[];p&&q.push(`data-bind="${p}"`),g&&q.push(`data-expr="${g}"`),m&&q.push(`maxbyte="${m}"`),v&&q.push(`type="${v}"`),l.innerHTML=`<${u} ${q.join(" ")}></${u}>`})},"processCellTypes"),s=c(a=>{if(!a.querySelector("colgroup")){const h=a.querySelector("tbody tr")||a.querySelector("tr"),l=h?h.querySelectorAll("th, td").length:1,f=document.createElement("colgroup"),u=Math.max(Math.floor(a.clientWidth/l),100);for(let p=0;p<l;p++){const g=document.createElement("col");g.setAttribute("width",u),f.appendChild(g)}a.prepend(f)}if(!a.querySelector("thead")){const h=document.createElement("thead"),l=a.querySelector("colgroup");l?l.after(h):a.prepend(h)}a.classList.add("nine-table-element"),a.style.display="table"},"ensureTableStructure"),n=c((a,h)=>{const l=Array.from(a.querySelectorAll(h+" tr")),f=Array.from(a.querySelectorAll(h+" th,"+h+" td")),u=l.length;if(u===0||f.length===0)return;let p=0;f.forEach(m=>{p+=m.colSpan||1});const g=Array.from(Array(u),()=>Array(p).fill(null));l.forEach(m=>{const v=m.sectionRowIndex;let q=0;Array.from(m.querySelectorAll("th,td")).forEach(x=>{for(let P=0;P<g[v].length;P++)if(g[v][P]===null){q=P;break}const B=x.rowSpan||1,M=x.colSpan||1;for(let P=0;P<B;P++)for(let _t=0;_t<M;_t++)v+P<u&&q+_t<p&&(g[v+P][q+_t]=P===0&&_t===0?"1":"0")})}),l.forEach(m=>{const v=m.sectionRowIndex;Array.from(m.querySelectorAll("th,td")).forEach(q=>{for(let x=0;x<g[v].length;x++)if(g[v][x]==="1"){q.dataset.col=x,g[v][x]="0";break}})})},"resetColIndex"),r=i.cloneNode(!0);return s(r),e(r),n(r,"thead"),n(r,"tbody"),n(r,"tfoot"),Array.from(r.querySelectorAll("colgroup col")).forEach((a,h)=>{const l=a.getAttribute("fixed");l&&r.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach(f=>{f.setAttribute("fixed",l)})}),r}};c(Ut,"TableCompiler");let de=Ut;const qt=class qt extends HTMLElement{constructor(){super();d(this,Xt);d(this,st,null);d(this,it);A(this,"invalidate",c(()=>{var e,s;t(this,it).refresh(),(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),(s=this.querySelector("nine-table-vscrollbar"))==null||s.refresh()},"invalidate"));d(this,Kt,c(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:n})=>{const r=this.querySelector(s);if(!r)return;r.innerHTML="";const o=document.createElement("div");o.className="ng-part-header",o.appendChild(t(this,dt).call(this,t(this,st),n,"header"));const a=document.createElement("div");a.className="ng-part-body";const h=document.createElement("div");h.className="ng-scroll-content",h.style.position="relative",h.style.width="100%",h.appendChild(t(this,dt).call(this,t(this,st),n,"body"));const l=document.createElement("div");l.className="ng-virtual-spacer",l.style.width="100%",l.style.pointerEvents="none",h.appendChild(l),a.appendChild(h);const f=document.createElement("div");f.className="ng-part-footer",f.appendChild(t(this,dt).call(this,t(this,st),n,"footer")),r.appendChild(o),r.appendChild(a),r.appendChild(f)})},"#renderSplitContainers"));d(this,Zt,c(()=>{["left","right","body"].forEach(e=>{const s=this.querySelector(`.ng-container-${e}`),n=s==null?void 0:s.querySelectorAll("table");if(!s||!n||n.length===0)return;let r=0;n[0].querySelectorAll("col").forEach(o=>{const a=parseInt(o.getAttribute("width"),10);isNaN(r)||(r+=a)}),e==="body"?s.style.flex="1":(s.style.flex=`0 0 ${r}px`,s.style.width=`${r}px`)})},"#updateContainerWidths"));A(this,"generate",c(e=>{e&&(b(this,st,de.compile(e)),t(this,Kt).call(this),t(this,Zt).call(this),t(this,it).initialize(),setTimeout(()=>{var s;(s=this.querySelector("nine-table-hscrollbar"))==null||s.refresh()},0))},"generate"));d(this,dt,c((e,s,n)=>{const r=e.cloneNode(!0),o=r.querySelector("thead"),a=r.querySelector("tbody"),h=r.querySelector("tfoot");if(n==="header"){if(a&&a.remove(),h&&h.remove(),e.querySelector("tbody")){const f=document.createElement("tbody");f.className="fixed-tbody",r.appendChild(f)}}else n==="body"?(o&&o.remove(),h&&h.remove(),a&&(a.className="bindable-tbody")):n==="footer"&&(o&&o.remove(),a&&a.remove());return s==="left"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="left"&&l.remove()}):s==="right"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="right"&&l.remove()}):r.querySelectorAll("[fixed=left], [fixed=right]").forEach(l=>{l.remove()}),r},"#createSplitTable"));A(this,"getRowHeight",c(()=>t(this,it).getRowHeight(),"getRowHeight"));A(this,"scrollToX",c(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollLeft=e)},"scrollToX"));A(this,"scrollToY",c(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollTop=e)},"scrollToY"));d(this,Gt,c(()=>{t(this,Jt).call(this)},"#init"));d(this,Jt,c(()=>{const e=qt.SCROLLBAR_SIZE;this.innerHTML=`
126
+ `;const e=c(()=>{const s=t(this,Y).shadowRoot.querySelector(".ng-container-body .ng-part-body");if(!s){setTimeout(e,10);return}b(this,T,{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,Bt).call(this),this.refresh()},"initWhenReady");e()}};Y=new WeakMap,lt=new WeakMap,tt=new WeakMap,T=new WeakMap,xt=new WeakMap,vt=new WeakMap,Bt=new WeakMap,c(Re,"NineTableVScrollBar");let mt=Re;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",mt);const qe=class qe{constructor(i){d(this,j);d(this,R);d(this,D,new Map);d(this,I,null);d(this,U,null);d(this,et,0);d(this,wt,40);d(this,ct,!1);d(this,zt,3);A(this,"refresh",c(()=>{var e;const i=t(this,R).querySelector(".ng-container-body .ng-part-body");i&&(t(this,St).call(this),t(this,ht).call(this,i.scrollTop),(e=t(this,R).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));A(this,"initialize",c(()=>{b(this,I,null),t(this,D).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(n=>{const r=t(this,R).querySelector(n);if(!r)return;const o=r.querySelector(".ng-part-body table");if(!o)return;const a=o.querySelector("tbody.bindable-tbody");if(!a)return;const l=Array.from(a.querySelectorAll("tr")).map(f=>f.cloneNode(!0));t(this,D).set(n,l)});const i=t(this,R).querySelector(".ng-container-body .ng-part-body"),e=t(this,R).querySelector(".ng-container-left .ng-part-body"),s=t(this,R).querySelector(".ng-container-right .ng-part-body");if(i){t(this,Pt).call(this,i),t(this,At).call(this),t(this,St).call(this),t(this,ht).call(this,i.scrollTop);let n=!1;const r=c((o,a)=>{var h;n||(n=!0,i&&i.scrollTop!==o&&(i.scrollTop=o),e&&e.scrollTop!==o&&(e.scrollTop=o),s&&s.scrollTop!==o&&(s.scrollTop=o),t(this,ht).call(this,o),(h=t(this,R).querySelector("nine-table-vscrollbar"))==null||h.refresh(),n=!1)},"syncScroll");[i,e,s].forEach(o=>{o&&o.addEventListener("scroll",()=>{r(o.scrollTop)})})}},"initialize"));d(this,Dt,c((i,e)=>{const s=t(this,D).get(e);if(!s||s.length===0)return;const n=i.querySelector(".ng-part-body tbody.bindable-tbody");if(!n)return;n.querySelectorAll("tr:not(.nodata)").forEach(a=>a.remove());const r=n.querySelector("tr.nodata"),o=document.createDocumentFragment();for(let a=0;a<t(this,wt);a++)s.forEach(h=>{o.appendChild(h.cloneNode(!0))});r?r.before(o):n.appendChild(o)},"#renderRows"));d(this,Pt,c(i=>{if(t(this,I)!==null&&t(this,I)>0)return t(this,I);const e=t(this,D).get(".ng-container-body");if(!e||e.length===0)return 24;const s=i.querySelector("tbody.bindable-tbody");if(!s)return 24;s.querySelectorAll("tr:not(.nodata)").forEach(p=>p.remove());const n=s.querySelector("tr.nodata"),r=document.createDocumentFragment();e.forEach(p=>{r.appendChild(p.cloneNode(!0))}),n?n.before(r):s.appendChild(r);const o=t(this,R),a=o.style.display,h=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 f=0;const u=s.querySelectorAll("tr:not(.nodata)");return u.forEach(p=>{f+=p.offsetHeight||p.getBoundingClientRect().height}),u.forEach(p=>p.remove()),o.style.display=a,o.style.visibility=h,o.style.position=l,b(this,I,f>0?f:24),t(this,Et).call(this),t(this,I)},"#measureAndCacheHeight"));d(this,St,c(()=>{const e=(t(this,j).data.get()||[]).length,s=t(this,I)||24,n=e*s;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const o=t(this,R).querySelector(r);if(!o)return;const a=o.querySelector(".ng-part-body .ng-virtual-spacer");a&&(a.style.height=`${n}px`)})},"#updateVirtualScrollHeight"));d(this,Et,c(()=>{if(t(this,et)>0&&t(this,I)>0){const i=Math.ceil(t(this,et)/t(this,I));b(this,wt,i+t(this,zt))}},"#updateRowCount"));d(this,jt,c(()=>{var a,h,l,f,u,p;const i=t(this,R).querySelector(".ng-container-left .ng-part-body table"),e=t(this,R).querySelector(".ng-container-body .ng-part-body table"),s=t(this,R).querySelector(".ng-container-right .ng-part-body table");if(e){const g=i?Array.from(i.querySelectorAll("tbody tr")):[],m=Array.from(e.querySelectorAll("tbody tr")),v=s?Array.from(s.querySelectorAll("tbody tr")):[],q=Math.max(g.length,m.length,v.length);for(let x=0;x<q;x++){const B=[((a=g[x])==null?void 0:a.getBoundingClientRect().height)||0,((h=m[x])==null?void 0:h.getBoundingClientRect().height)||0,((l=v[x])==null?void 0:l.getBoundingClientRect().height)||0],M=Math.max(...B);M>0&&(g[x]&&(g[x].style.height=`${M}px`),m[x]&&(m[x].style.height=`${M}px`),v[x]&&(v[x].style.height=`${M}px`))}}const n=t(this,R).querySelector(".ng-container-left .ng-part-footer table"),r=t(this,R).querySelector(".ng-container-body .ng-part-footer table"),o=t(this,R).querySelector(".ng-container-right .ng-part-footer table");if(r){const g=n?Array.from(n.querySelectorAll("tfoot tr")):[],m=Array.from(r.querySelectorAll("tfoot tr")),v=o?Array.from(o.querySelectorAll("tfoot tr")):[],q=Math.max(g.length,m.length,v.length);for(let x=0;x<q;x++){const B=[((f=g[x])==null?void 0:f.getBoundingClientRect().height)||0,((u=m[x])==null?void 0:u.getBoundingClientRect().height)||0,((p=v[x])==null?void 0:p.getBoundingClientRect().height)||0],M=Math.max(...B);M>0&&(g[x]&&(g[x].style.height=`${M}px`),m[x]&&(m[x].style.height=`${M}px`),v[x]&&(v[x].style.height=`${M}px`))}}},"#syncRowHeights"));d(this,Ft,c(()=>{!t(this,R)||!(t(this,R)instanceof HTMLElement)||(b(this,U,new ResizeObserver(i=>{for(const e of i){const s=e.target;if(!s.classList.contains("active"))continue;const n=e.contentRect.height;if(n>0){let r=0;const o=s.querySelector(".ng-part-header"),a=s.querySelector(".ng-part-footer");o&&(r+=o.offsetHeight),a&&(r+=a.offsetHeight);const h=Math.max(n-r,100);t(this,et)!==h&&(b(this,et,h),t(this,Et).call(this),t(this,I)!==null&&t(this,At).call(this))}}})),t(this,U).observe(t(this,R)))},"#initResizeObserver"));d(this,At,c(()=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(i=>{const e=t(this,R).querySelector(i);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,Dt).call(this,e,i)}),t(this,Yt).call(this),t(this,jt).call(this)},"#renderAllContainers"));d(this,Vt,c(i=>{[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{var l;const s=t(this,R).querySelector(e);if(!s)return;const n=s.querySelector(".ng-part-body tbody.bindable-tbody");if(!n)return;const r=Array.from(n.querySelectorAll("tr:not(.nodata)")),o=((l=t(this,D).get(e))==null?void 0:l.length)||1,h=(t(this,j).data.get()||[]).length;r.forEach((f,u)=>{const p=i+Math.floor(u/o);if(p>=h){f.style.display="none";return}const g=t(this,j).data.get(p);f.style.display="",t(this,Rt).call(this,f,g,p)})})},"#adjustBufferRows"));d(this,ht,c(i=>{var h;const e=t(this,I);if(!e||e<=0)return;const n=(t(this,j).data.get()||[]).length,r=Math.max(0,Math.floor(i/e)),o=r*e,a=((h=t(this,D).get(".ng-container-body"))==null?void 0:h.length)||1;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(l=>{const f=t(this,R).querySelector(l);if(!f)return;const u=f.querySelector(".ng-part-body tbody.bindable-tbody");if(!u)return;u.style.transform=`translateY(${o}px)`,Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((g,m)=>{const v=r+Math.floor(m/a);if(v>=n){g.style.display="none";return}const q=t(this,j).data.get(v);g.style.display="",t(this,Rt).call(this,g,q,v)})}),t(this,ct)||(b(this,ct,!0),setTimeout(()=>{t(this,Vt).call(this,r),b(this,ct,!1)},0))},"#handleScroll"));d(this,Rt,c((i,e,s)=>{i.dataset.row=s,i.data=e,k.log(s),Array.from(i.cells).forEach((n,r)=>{n.dataset.row=s,n.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');const o=Array.from(n.children).find(a=>a.tagName.toLowerCase().startsWith("cell-")||typeof a.refresh=="function");o&&typeof o.refresh=="function"&&o.refresh()})},"#bindRowData"));d(this,Yt,c(()=>{var h,l,f;const i=t(this,R).querySelector(".ng-container-left .ng-part-header table"),e=t(this,R).querySelector(".ng-container-body .ng-part-header table"),s=t(this,R).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const n=i?Array.from(i.querySelectorAll("tr")):[],r=Array.from(e.querySelectorAll("tr")),o=s?Array.from(s.querySelectorAll("tr")):[],a=Math.max(n.length,r.length,o.length);for(let u=0;u<a;u++){const p=[((h=n[u])==null?void 0:h.getBoundingClientRect().height)||0,((l=r[u])==null?void 0:l.getBoundingClientRect().height)||0,((f=o[u])==null?void 0:f.getBoundingClientRect().height)||0],g=Math.max(...p);g>0&&(n[u]&&(n[u].style.height=`${g}px`),r[u]&&(r[u].style.height=`${g}px`),o[u]&&(o[u].style.height=`${g}px`))}},"#syncHeaderHeights"));A(this,"destroy",c(()=>{t(this,U)&&(t(this,U).disconnect(),b(this,U,null))},"destroy"));b(this,j,i.getRootNode().host),b(this,R,i),t(this,Ft).call(this)}getRowHeight(){return t(this,I)}templateLength(i=".ng-container-body"){var e;return((e=t(this,D).get(i))==null?void 0:e.length)||1}};j=new WeakMap,R=new WeakMap,D=new WeakMap,I=new WeakMap,U=new WeakMap,et=new WeakMap,wt=new WeakMap,ct=new WeakMap,zt=new WeakMap,Dt=new WeakMap,Pt=new WeakMap,St=new WeakMap,Et=new WeakMap,jt=new WeakMap,Ft=new WeakMap,At=new WeakMap,Vt=new WeakMap,ht=new WeakMap,Rt=new WeakMap,Yt=new WeakMap,c(qe,"RowManager");let he=qe;const Ut=class Ut{static compileAll(i){return Array.isArray(i)?i.map(e=>Ut.compile(e)):[]}static compile(i){if(!i)return null;const e=c(a=>{a.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 p=l.getAttribute("data-bind"),g=l.getAttribute("data-expr"),m=l.getAttribute("maxbyte"),v=l.getAttribute("type");let q=[];p&&q.push(`data-bind="${p}"`),g&&q.push(`data-expr="${g}"`),m&&q.push(`maxbyte="${m}"`),v&&q.push(`type="${v}"`),l.innerHTML=`<${u} ${q.join(" ")}></${u}>`})},"processCellTypes"),s=c(a=>{if(!a.querySelector("colgroup")){const h=a.querySelector("tbody tr")||a.querySelector("tr"),l=h?h.querySelectorAll("th, td").length:1,f=document.createElement("colgroup"),u=Math.max(Math.floor(a.clientWidth/l),100);for(let p=0;p<l;p++){const g=document.createElement("col");g.setAttribute("width",u),f.appendChild(g)}a.prepend(f)}if(!a.querySelector("thead")){const h=document.createElement("thead"),l=a.querySelector("colgroup");l?l.after(h):a.prepend(h)}a.classList.add("nine-table-element"),a.style.display="table"},"ensureTableStructure"),n=c((a,h)=>{const l=Array.from(a.querySelectorAll(h+" tr")),f=Array.from(a.querySelectorAll(h+" th,"+h+" td")),u=l.length;if(u===0||f.length===0)return;let p=0;f.forEach(m=>{p+=m.colSpan||1});const g=Array.from(Array(u),()=>Array(p).fill(null));l.forEach(m=>{const v=m.sectionRowIndex;let q=0;Array.from(m.querySelectorAll("th,td")).forEach(x=>{for(let P=0;P<g[v].length;P++)if(g[v][P]===null){q=P;break}const B=x.rowSpan||1,M=x.colSpan||1;for(let P=0;P<B;P++)for(let _t=0;_t<M;_t++)v+P<u&&q+_t<p&&(g[v+P][q+_t]=P===0&&_t===0?"1":"0")})}),l.forEach(m=>{const v=m.sectionRowIndex;Array.from(m.querySelectorAll("th,td")).forEach(q=>{for(let x=0;x<g[v].length;x++)if(g[v][x]==="1"){q.dataset.col=x,g[v][x]="0";break}})})},"resetColIndex"),r=i.cloneNode(!0);return s(r),e(r),n(r,"thead"),n(r,"tbody"),n(r,"tfoot"),Array.from(r.querySelectorAll("colgroup col")).forEach((a,h)=>{const l=a.getAttribute("fixed");l&&r.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach(f=>{f.setAttribute("fixed",l)})}),r}};c(Ut,"TableCompiler");let de=Ut;const qt=class qt extends HTMLElement{constructor(){super();d(this,Xt);d(this,st,null);d(this,it);A(this,"invalidate",c(()=>{var e,s;t(this,it).refresh(),(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),(s=this.querySelector("nine-table-vscrollbar"))==null||s.refresh()},"invalidate"));d(this,Kt,c(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:n})=>{const r=this.querySelector(s);if(!r)return;r.innerHTML="";const o=document.createElement("div");o.className="ng-part-header",o.appendChild(t(this,dt).call(this,t(this,st),n,"header"));const a=document.createElement("div");a.className="ng-part-body";const h=document.createElement("div");h.className="ng-scroll-content",h.style.position="relative",h.style.width="100%",h.appendChild(t(this,dt).call(this,t(this,st),n,"body"));const l=document.createElement("div");l.className="ng-virtual-spacer",l.style.width="100%",l.style.pointerEvents="none",h.appendChild(l),a.appendChild(h);const f=document.createElement("div");f.className="ng-part-footer",f.appendChild(t(this,dt).call(this,t(this,st),n,"footer")),r.appendChild(o),r.appendChild(a),r.appendChild(f)})},"#renderSplitContainers"));d(this,Zt,c(()=>{["left","right","body"].forEach(e=>{const s=this.querySelector(`.ng-container-${e}`),n=s==null?void 0:s.querySelectorAll("table");if(!s||!n||n.length===0)return;let r=0;n[0].querySelectorAll("col").forEach(o=>{const a=parseInt(o.getAttribute("width"),10);isNaN(r)||(r+=a)}),e==="body"?s.style.flex="1":(s.style.flex=`0 0 ${r}px`,s.style.width=`${r}px`)})},"#updateContainerWidths"));A(this,"generate",c(e=>{e&&(b(this,st,de.compile(e)),t(this,Kt).call(this),t(this,Zt).call(this),t(this,it).initialize(),setTimeout(()=>{var s;(s=this.querySelector("nine-table-hscrollbar"))==null||s.refresh()},0))},"generate"));d(this,dt,c((e,s,n)=>{const r=e.cloneNode(!0),o=r.querySelector("thead"),a=r.querySelector("tbody"),h=r.querySelector("tfoot");if(n==="header"){if(a&&a.remove(),h&&h.remove(),e.querySelector("tbody")){const f=document.createElement("tbody");f.className="fixed-tbody",r.appendChild(f)}}else n==="body"?(o&&o.remove(),h&&h.remove(),a&&(a.className="bindable-tbody")):n==="footer"&&(o&&o.remove(),a&&a.remove());return s==="left"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="left"&&l.remove()}):s==="right"?r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="right"&&l.remove()}):r.querySelectorAll("[fixed=left], [fixed=right]").forEach(l=>{l.remove()}),r},"#createSplitTable"));A(this,"getRowHeight",c(()=>t(this,it).getRowHeight(),"getRowHeight"));A(this,"scrollToX",c(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollLeft=e)},"scrollToX"));A(this,"scrollToY",c(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollTop=e)},"scrollToY"));d(this,Gt,c(()=>{t(this,Jt).call(this)},"#init"));d(this,Jt,c(()=>{const e=qt.SCROLLBAR_SIZE;this.innerHTML=`
127
127
  <style>
128
128
  nine-table-sheet {
129
129
  display: none;
@@ -352,7 +352,7 @@
352
352
  <nine-table-analysis></nine-table-analysis>
353
353
  </nine-table-body>
354
354
  <nine-table-footer></nine-table-footer>
355
- `;const a=t(this,_).shadowRoot.querySelectorAll("nine-table-sheet");a==null||a.forEach((h,l)=>{e[l]&&setTimeout(()=>{h.generate(e[l]),s&&t(this,Tt).call(this)})})},"#render"));b(this,_,i),t(this,te).call(this)}};_=new WeakMap,te=new WeakMap,Tt=new WeakMap,ee=new WeakMap,c(Te,"LayoutManager");let ue=Te;const Ce=class Ce{constructor(i){d(this,Ct);d(this,ft,-1);A(this,"count",c(()=>t(this,Ct).rawRecords.length,"count"));b(this,Ct,i)}get at(){return t(this,ft)}set at(i){b(this,ft,parseInt(i,10)),body&&!body.querySelector(`tbody.bindable tr[data-row="${t(this,ft)}"]`)&&setTimeout(()=>{})}};Ct=new WeakMap,ft=new WeakMap,c(Ce,"ngRow");let ge=Ce;const O=class O{constructor(i,e){d(this,N);d(this,C);d(this,W,[]);d(this,ut,[]);d(this,se,0);d(this,X,[]);d(this,ie,c(()=>{b(this,X,[]);const i=t(this,N).template||[];Array.from(i).forEach(e=>{var s;t(this,X).push(((s=e.getBoundingClientRect)==null?void 0:s.call(e).height)||24)}),(t(this,C).rawRecords||[]).forEach(e=>{e.__ng||(e.__ng=t(this,Lt).call(this)),e.__ng.height=t(this,X).slice()})},"#initialize"));d(this,nt,c(()=>{t(this,N).shadowRoot.querySelectorAll("nine-table-sheet").forEach(i=>{i.invalidate()})},"#invalidate"));A(this,"get",c((i,e)=>{var r;const s=this.getValidData();if(!s||s.length<=0)return;if(i==null)return t(this,gt).call(this,s);if(i<0||i>=s.length)return null;const n=typeof((r=t(this,N).fields)==null?void 0:r.get)=="function"?t(this,N).fields.get():[];if(e!=null){const o=n.indexOf(e);return o>=0?s[i].v[o]:null}return t(this,gt).call(this,s[i])},"get"));A(this,"set",c(i=>{this.clear(),this.add(i,!1),t(this,nt).call(this)},"set"));d(this,Lt,c(()=>({rowState:O.ROW_STATE.EMPTY,deleted:!1,filtered:!1,height:t(this,X).slice(),o:{},c:{},_:[0,0,0,0,O.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,t(this,X).slice(),-1,{},{}]}),"#getDefaultMeta"));A(this,"reset",c(()=>{b(this,W,[]),b(this,ut,[]),t(this,nt).call(this)},"reset"));A(this,"clear",c(()=>{var i;t(this,C).rawRecords=[],b(this,W,[]),b(this,ut,[]),(i=t(this,C).viewRecords)!=null&&i.reset&&t(this,C).viewRecords.reset()},"clear"));d(this,ne,c(i=>{var n;Array.isArray(i)||(i=[i]);const e=typeof((n=t(this,N).fields)==null?void 0:n.get)=="function"?t(this,N).fields.get():Object.keys(i[0]||{}),s=[];return i.forEach(r=>{const o={v:[]};e.forEach(a=>{o.v.push(r[a]!==void 0&&r[a]!==null?r[a]:"")}),s.push(o)}),s},"#json2Array"));d(this,re,c(i=>(Array.isArray(i)||(i=[i]),i.forEach(e=>{e.__ng=t(this,Lt).call(this),e.__ng.rowid=this.nextId,e.__ng.rowState=O.ROW_STATE.INSERT,e.__ng._[0]=e.__ng.rowid}),i),"#defaultInsert"));A(this,"add",c((i,e=!0)=>{i===void 0&&(i={});const s=t(this,ne).call(this,i);t(this,C).rawRecords=t(this,C).rawRecords.concat(t(this,re).call(this,s)),this.resetRecords();const n=this.count()-1;return e||s.forEach((r,o)=>{const a=t(this,C).rawRecords[n-o];a&&(a.__ng.rowState=O.ROW_STATE.EMPTY)}),t(this,nt).call(this),n},"add"));A(this,"delete",c(i=>{let e=[];Array.isArray(i)?e=i:typeof i>"u"?e=[t(this,C).host.row.at]:e=[parseInt(i,10)],e.sort((s,n)=>n-s).forEach(s=>{if(t(this,W)[s]){const n=t(this,W)[s].__ng.rowid;t(this,W)[s].__ng.rowState===O.ROW_STATE.INSERT?t(this,C).rawRecords=t(this,C).rawRecords.filter(r=>r.__ng.rowid!==n):t(this,C).rawRecords.forEach(r=>{r.__ng.rowid===n&&(r.__ng.deleted=!0,r.__ng.rowState=O.ROW_STATE.DELETE)})}}),this.resetRecords(),t(this,nt).call(this)},"delete"));A(this,"setValue",c((i,e,s)=>{var h;i=parseInt(i,10);const r=(typeof((h=t(this,N).fields)==null?void 0:h.get)=="function"?t(this,N).fields.get():[]).indexOf(e);if(r<0)return;const o=this.getValidData()[i];if(!o)return;const a=o.v[r];a!==s&&o.__ng.rowState!==O.ROW_STATE.INSERT&&(o.__ng.o.hasOwnProperty(e)||(o.__ng.o[e]=a),o.__ng.rowState=O.ROW_STATE.UPDATE),o.v[r]=s},"setValue"));A(this,"resetRecords",c(()=>{b(this,ut,t(this,C).rawRecords.filter(i=>!i.__ng.deleted)),b(this,W,t(this,C).rawRecords.filter(i=>!i.__ng.deleted&&!i.__ng.filtered)),t(this,C).rawRecords.forEach((i,e)=>{i.__ng.rowidx=e}),t(this,W).forEach((i,e)=>{i.__ng.i=e})},"resetRecords"));A(this,"getValidData",c(()=>(t(this,W).length===0&&t(this,C).rawRecords.length>0&&this.resetRecords(),t(this,W)),"getValidData"));d(this,gt,c(i=>{var o;if(!i)return i;const e=!Array.isArray(i),s=e?[i]:i,n=typeof((o=t(this,N).fields)==null?void 0:o.get)=="function"?t(this,N).fields.get():[],r=s.filter(a=>!a.__ng.deleted).map(a=>{const h={};return n.forEach((l,f)=>{h[l]=a.v?a.v[f]:a[l]}),h.__ng=a.__ng,h});return e?r[0]:r},"#conv"));A(this,"count",c(()=>this.getValidData().length,"count"));b(this,N,i),b(this,C,e),t(this,ie).call(this)}get source(){return t(this,gt).call(this,t(this,C).rawRecords)}set source(i){this.clear(),this.add(i,!1)}get nextId(){return++Ve(this,se)._}get length(){return t(this,W).length}getRowCount(){return this.length}};N=new WeakMap,C=new WeakMap,W=new WeakMap,ut=new WeakMap,se=new WeakMap,X=new WeakMap,ie=new WeakMap,nt=new WeakMap,Lt=new WeakMap,ne=new WeakMap,re=new WeakMap,gt=new WeakMap,c(O,"ngData"),A(O,"ROW_STATE",{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"});let be=O;const Le=class Le{constructor(i){d(this,rt);b(this,rt,i),this.row=new ge(this),this.data=new be(t(this,rt),this),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.pageCnt=25,this.viewRecords.reset=()=>{var e;(e=t(this,rt).view)!=null&&e.redraw&&t(this,rt).view.redraw()},this.setDataSource=e=>{this.data&&this.data.reset(),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.data.set(e||[])},this.getRowState=e=>{var n,r;const s=parseInt(e,10);if(!(s>=this.data.count()))return(r=(n=this.data.getValidData()[s])==null?void 0:n.__ng)==null?void 0:r.rowState},this.getRowPosition=()=>this.row.at,this.setRowPosition=e=>{this.row.at=e},this.scrollTo_V1=e=>(e<0&&(e=0),e>=this.rawRecords.length&&(e=this.rawRecords.length-1),this.viewRecords.rawIndex=e,this.viewRecords.reset&&this.viewRecords.reset(),!(e<=0||e>=this.rawRecords.length-1)),this.getColumn=(e,s)=>this.data.get(e,s),this.setColumn=(e,s,n)=>{e=parseInt(e,10),this.data.setValue(e,s,n)},this.setDataSource([])}};rt=new WeakMap,c(Le,"ngDataManager");let pe=Le;const He=class He{constructor(i){d(this,bt);d(this,H,[]);A(this,"add",c((i,e="string")=>{i.forEach(s=>{t(this,H).some(n=>n.name===s)||t(this,H).push({name:s,type:e})}),t(this,Ht).call(this)},"add"));d(this,Ht,c(()=>{const i=new Map;t(this,H).forEach(e=>{i.set(e.name,e.type)}),b(this,H,Array.from(i,([e,s])=>({name:e,type:s}))),b(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,oe,c(()=>{b(this,H,[]),k.log(t(this,bt).querySelectorAll("table"));const i=Array.from(t(this,bt).querySelectorAll("table"));if(!(!i||i.length===0)){for(const e of i)k.log(e),$("[data-bind]",e).each((s,n)=>{const r=n.dataset.bind,o=n.getAttribute("data-type")||"string";r&&t(this,H).push({name:r,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((n,r)=>{var o=r.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 h=a.search(/[^_A-Za-z0-9]/g);let l="";h>=0?l=a.substring(0,h):o.startsWith("data.")&&(l=a.replace("data.","")),l&&t(this,H).push({name:l,type:"string"})}})})});t(this,Ht).call(this)}},"#init"));b(this,bt,i),t(this,oe).call(this)}get(){return t(this,H).map(i=>i.name)}getFields(){return t(this,H)}getType(i){const e=t(this,H).find(s=>s.name===i);return e?e.type:"string"}indexOf(i){return t(this,H).findIndex(e=>e.name===i)}includes(i){return t(this,H).some(e=>e.name===i)}};bt=new WeakMap,H=new WeakMap,Ht=new WeakMap,oe=new WeakMap,c(He,"ngFields");let ye=He;const Me=class Me extends HTMLElement{constructor(){super();d(this,ot);d(this,ae);d(this,le,c(()=>{this.fields=new ye(this),b(this,ae,new ue(this)),k.log("NineTable connected."),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,detail:{target:this}}))},"#init"));this.attachShadow({mode:"open"}),b(this,ot,new pe(this))}connectedCallback(){t(this,le).call(this)}disconnectedCallback(){k.log("NineTable disconnected.")}get data(){return t(this,ot).data}get row(){return t(this,ot).row}get dataManager(){return t(this,ot)}};ot=new WeakMap,ae=new WeakMap,le=new WeakMap,c(Me,"NineTable");let me=Me;customElements.get("nine-table")||customElements.define("nine-table",me);const Mt=class Mt extends HTMLElement{constructor(){super()}applyBaseStyle(){this.constructor.name}connectedCallback(){}};c(Mt,"BasicCellElement"),A(Mt,"_styleCache",new Map),A(Mt,"_customStyleCache",new Map);let xe=Mt;const Oe=class Oe extends xe{constructor(){super();d(this,L);d(this,$t);d(this,y);d(this,$e);d(this,Ie);d(this,_e);d(this,Ne);A(this,"getDisplayText",c(e=>{if(t(this,y))if(t(this,y).closest("tbody")){const s=t(this,y).closest("tr").data,n=parseInt(t(this,y).dataset.row);if(!s)return"";if(ninegrid.isNull(t(this,y).dataset.expr)){if(!ninegrid.isNull(t(this,y).dataset.bind))return s[t(this,y).dataset.bind]||ninegrid.nvl(e,"")}else try{return this.getExprValue(t(this,y).dataset.expr,s,n,t(this,y))}catch{console.error(t(this,y).dataset.expr,s,t(this,y).dataset.row)}return ninegrid.nvl(e,"")}else try{return t(this,L).exprFunction(t(this,y).dataset.expr).call(this,null,-1,t(this,L).data)}catch{}},"getDisplayText"));d(this,We,c(()=>{if(!(!t(this,L)||!t(this,L).template||!t(this,y).closest("tbody.bindable"))){var e=ninegrid.j.querySelectorAll(t(this,y)).attr("suppress");if(e&&(e=parseInt(e)),e&&!isNaN(e)){var s=t(this,y).closest("tr"),n=[];$("th,td",s).each((x,B)=>{var M=ninegrid.j.querySelectorAll(B).attr("suppress");M&&B.dataset.row&&(M=parseInt(M),!isNaN(M)&&M<=e&&n.push(M))}),n.sort();var r=!1;if(parseInt(s.sectionRowIndex/t(this,L).template.length)>0)for(var o of n){if(o>e)break;var a=parseInt(t(this,y).dataset.row),h=a-1,l=t(this,y).closest("tr").data,f=t(this,L).data.get(h);t(this,y).dataset.matrixRow;var u=t(this,L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this,y).dataset.matrixRow}"]`),p=u.dataset.expr?this.getExprValue(u.dataset.expr,l,a):l[u.dataset.bind],g=u.dataset.expr?this.getExprValue(u.dataset.expr,f,h):f[u.dataset.bind];if(p!=g){r=!0;break}}else r=!0;r?ninegrid.j.querySelectorAll(t(this,y)).removeClass("suppress"):ninegrid.j.querySelectorAll(t(this,y)).addClass("suppress"),ninegrid.j.querySelectorAll(t(this,y)).hasClass("hidden")||(r?ninegrid.j.querySelectorAll(t(this,y)).removeClass("hidden"):ninegrid.j.querySelectorAll(t(this,y)).addClass("hidden"));var m=parseInt(t(this,y).dataset.matrixRow),v=m-1,q=t(this,L).body.querySelector(`tbody.bindable [data-col="${t(this,y).dataset.col}"][data-matrix-row="${v}"]`);$(q).hasClass("suppress")&&!ninegrid.j.querySelectorAll(t(this,y)).hasClass("suppress")?ninegrid.j.querySelectorAll(q).removeClass("last-none-suppress").addClass("last-suppress"):!$(q).hasClass("suppress")&&ninegrid.j.querySelectorAll(t(this,y)).hasClass("suppress")?ninegrid.j.querySelectorAll(q).removeClass("last-suppress").addClass("last-none-suppress"):ninegrid.j.querySelectorAll(q).removeClass("last-none-suppress").removeClass("last-suppress")}}},"#resetSuppress"));A(this,"getExprValue",c((e,s,n,r)=>{if(typeof e<"u")try{n=parseInt(n);const o=e.replace("()","");return t(this,L)[o]?t(this,L)[o].call(this,s,n,t(this,y)):t(this,L).exprFunction(e).call(this,s,n,t(this,L).data)}catch{return["NG-COMBO"].includes(this.tagName)?"":e}else return e},"getExprValue"))}connectedCallback(){super.connectedCallback(),b(this,L,this.getRootNode().host),b(this,y,this.closest("th,td")),b(this,$t,t(this,y).closest("tr"))}get value(){var e=!t(this,L)||!t(this,L).dataManager||!t(this,y)||!t(this,y).dataset||!t(this,y).dataset.row||!t(this,y).dataset.bind?"":t(this,y).closest("tr").data[t(this,y).dataset.bind];return e??""}set value(e){var s=parseInt(t(this,y).dataset.row);const n=this.getAttribute("update-row-state")!="false";s<0?t(this,L).data.setValueNF(parseInt(t(this,y).dataset.index),t(this,y).dataset.bind,e,n):t(this,L).data.setValue(s,t(this,y).dataset.bind,e,n)}get row(){return parseInt(t(this,y).dataset.row)}get data(){return t(this,y).closest("tr").data}refresh(){const e=t(this,y).dataset.bind;return parseInt(t(this,y).dataset.row),t(this,$t).data[e]}};L=new WeakMap,$t=new WeakMap,y=new WeakMap,$e=new WeakMap,Ie=new WeakMap,_e=new WeakMap,Ne=new WeakMap,We=new WeakMap,c(Oe,"CellElement");let ve=Oe;const Be=class Be extends ve{constructor(){super()}connectedCallback(){super.connectedCallback()}refresh(){return super.refresh()}};c(Be,"EditableCellElement");let we=Be;const De=class De extends we{constructor(){super();d(this,It);d(this,at);d(this,pt);d(this,yt);d(this,ce);d(this,K);A(this,"refresh",c(()=>{const e=super.refresh();t(this,It).value=e},"refresh"));d(this,ze,c(e=>{if(!["Escape","Enter","Tab","Home","End","ArrowLeft","ArrowRight","PageUp","PageDown","Backspace","Delete"].includes(e.code)){if(t(this,at)=="number"){let r=[];if(t(this,K)&&Number(t(this,K))>0&&r.push("."),t(this,yt)&&Number(t(this,yt))>=0&&r.push("-"),!(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)&&!r.includes(e.key)&&e.preventDefault(),t(this,K)&&(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)&&e.target.selectionStart==e.target.selectionEnd){var s=e.target.value,n=s.indexOf(".");if(n>=0){var s=s.substr(n+1,s.length);s.length>=Number(t(this,K))&&e.preventDefault()}}}t(this,pt)&&ninegrid.getByteLength(e.target.value)>=Number(t(this,pt))&&e.target.selectionStart==e.target.selectionEnd&&e.preventDefault()}},"#onKeyDown"));if(this.applyBaseStyle(),b(this,at,this.getAttribute("type")||"text"),b(this,pt,this.getAttribute("maxbyte")),b(this,yt,this.getAttribute("min")),b(this,ce,this.getAttribute("max")),b(this,K,this.getAttribute("scale")),!["text","number"].includes(t(this,at)))throw`invalid type : ${t(this,at)}`}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=`
355
+ `;const a=t(this,_).shadowRoot.querySelectorAll("nine-table-sheet");a==null||a.forEach((h,l)=>{e[l]&&setTimeout(()=>{h.generate(e[l]),s&&t(this,Tt).call(this)})})},"#render"));b(this,_,i),t(this,te).call(this)}};_=new WeakMap,te=new WeakMap,Tt=new WeakMap,ee=new WeakMap,c(Te,"LayoutManager");let ue=Te;const Ce=class Ce{constructor(i){d(this,Ct);d(this,ft,-1);A(this,"count",c(()=>t(this,Ct).rawRecords.length,"count"));b(this,Ct,i)}get at(){return t(this,ft)}set at(i){b(this,ft,parseInt(i,10)),body&&!body.querySelector(`tbody.bindable tr[data-row="${t(this,ft)}"]`)&&setTimeout(()=>{})}};Ct=new WeakMap,ft=new WeakMap,c(Ce,"ngRow");let ge=Ce;const O=class O{constructor(i,e){d(this,N);d(this,C);d(this,W,[]);d(this,ut,[]);d(this,se,0);d(this,X,[]);d(this,ie,c(()=>{b(this,X,[]);const i=t(this,N).template||[];Array.from(i).forEach(e=>{var s;t(this,X).push(((s=e.getBoundingClientRect)==null?void 0:s.call(e).height)||24)}),(t(this,C).rawRecords||[]).forEach(e=>{e.__ng||(e.__ng=t(this,Lt).call(this)),e.__ng.height=t(this,X).slice()})},"#initialize"));d(this,nt,c(()=>{t(this,N).shadowRoot.querySelectorAll("nine-table-sheet").forEach(i=>{i.invalidate()})},"#invalidate"));A(this,"get",c((i,e)=>{var r;const s=this.getValidData();if(!s||s.length<=0)return;if(i==null)return t(this,gt).call(this,s);if(i<0||i>=s.length)return null;const n=typeof((r=t(this,N).fields)==null?void 0:r.get)=="function"?t(this,N).fields.get():[];if(e!=null){const o=n.indexOf(e);return o>=0?s[i].v[o]:null}return t(this,gt).call(this,s[i])},"get"));A(this,"set",c(i=>{this.clear(),this.add(i,!1),t(this,nt).call(this)},"set"));d(this,Lt,c(()=>({rowState:O.ROW_STATE.EMPTY,deleted:!1,filtered:!1,height:t(this,X).slice(),o:{},c:{},_:[0,0,0,0,O.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,t(this,X).slice(),-1,{},{}]}),"#getDefaultMeta"));A(this,"reset",c(()=>{b(this,W,[]),b(this,ut,[]),t(this,nt).call(this)},"reset"));A(this,"clear",c(()=>{var i;t(this,C).rawRecords=[],b(this,W,[]),b(this,ut,[]),(i=t(this,C).viewRecords)!=null&&i.reset&&t(this,C).viewRecords.reset()},"clear"));d(this,ne,c(i=>{var n;Array.isArray(i)||(i=[i]);const e=typeof((n=t(this,N).fields)==null?void 0:n.get)=="function"?t(this,N).fields.get():Object.keys(i[0]||{}),s=[];return i.forEach(r=>{const o={v:[]};e.forEach(a=>{o.v.push(r[a]!==void 0&&r[a]!==null?r[a]:"")}),s.push(o)}),s},"#json2Array"));d(this,re,c(i=>(Array.isArray(i)||(i=[i]),i.forEach(e=>{e.__ng=t(this,Lt).call(this),e.__ng.rowid=this.nextId,e.__ng.rowState=O.ROW_STATE.INSERT,e.__ng._[0]=e.__ng.rowid}),i),"#defaultInsert"));A(this,"add",c((i,e=!0)=>{i===void 0&&(i={});const s=t(this,ne).call(this,i);t(this,C).rawRecords=t(this,C).rawRecords.concat(t(this,re).call(this,s)),this.resetRecords();const n=this.count()-1;return e||s.forEach((r,o)=>{const a=t(this,C).rawRecords[n-o];a&&(a.__ng.rowState=O.ROW_STATE.EMPTY)}),t(this,nt).call(this),n},"add"));A(this,"delete",c(i=>{let e=[];Array.isArray(i)?e=i:typeof i>"u"?e=[t(this,C).host.row.at]:e=[parseInt(i,10)],e.sort((s,n)=>n-s).forEach(s=>{if(t(this,W)[s]){const n=t(this,W)[s].__ng.rowid;t(this,W)[s].__ng.rowState===O.ROW_STATE.INSERT?t(this,C).rawRecords=t(this,C).rawRecords.filter(r=>r.__ng.rowid!==n):t(this,C).rawRecords.forEach(r=>{r.__ng.rowid===n&&(r.__ng.deleted=!0,r.__ng.rowState=O.ROW_STATE.DELETE)})}}),this.resetRecords(),t(this,nt).call(this)},"delete"));A(this,"setValue",c((i,e,s)=>{var h;i=parseInt(i,10);const r=(typeof((h=t(this,N).fields)==null?void 0:h.get)=="function"?t(this,N).fields.get():[]).indexOf(e);if(r<0)return;const o=this.getValidData()[i];if(!o)return;const a=o.v[r];a!==s&&o.__ng.rowState!==O.ROW_STATE.INSERT&&(o.__ng.o.hasOwnProperty(e)||(o.__ng.o[e]=a),o.__ng.rowState=O.ROW_STATE.UPDATE),o.v[r]=s},"setValue"));A(this,"resetRecords",c(()=>{b(this,ut,t(this,C).rawRecords.filter(i=>!i.__ng.deleted)),b(this,W,t(this,C).rawRecords.filter(i=>!i.__ng.deleted&&!i.__ng.filtered)),t(this,C).rawRecords.forEach((i,e)=>{i.__ng.rowidx=e}),t(this,W).forEach((i,e)=>{i.__ng.i=e})},"resetRecords"));A(this,"getValidData",c(()=>(t(this,W).length===0&&t(this,C).rawRecords.length>0&&this.resetRecords(),t(this,W)),"getValidData"));d(this,gt,c(i=>{var o;if(!i)return i;const e=!Array.isArray(i),s=e?[i]:i,n=typeof((o=t(this,N).fields)==null?void 0:o.get)=="function"?t(this,N).fields.get():[],r=s.filter(a=>!a.__ng.deleted).map(a=>{const h={};return n.forEach((l,f)=>{h[l]=a.v?a.v[f]:a[l]}),h.__ng=a.__ng,h});return e?r[0]:r},"#conv"));A(this,"count",c(()=>this.getValidData().length,"count"));b(this,N,i),b(this,C,e),t(this,ie).call(this)}get source(){return t(this,gt).call(this,t(this,C).rawRecords)}set source(i){this.clear(),this.add(i,!1)}get nextId(){return++Ve(this,se)._}get length(){return t(this,W).length}getRowCount(){return this.length}};N=new WeakMap,C=new WeakMap,W=new WeakMap,ut=new WeakMap,se=new WeakMap,X=new WeakMap,ie=new WeakMap,nt=new WeakMap,Lt=new WeakMap,ne=new WeakMap,re=new WeakMap,gt=new WeakMap,c(O,"ngData"),A(O,"ROW_STATE",{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"});let be=O;const Le=class Le{constructor(i){d(this,rt);b(this,rt,i),this.row=new ge(this),this.data=new be(t(this,rt),this),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.pageCnt=25,this.viewRecords.reset=()=>{var e;(e=t(this,rt).view)!=null&&e.redraw&&t(this,rt).view.redraw()},this.setDataSource=e=>{this.data&&this.data.reset(),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.data.set(e||[])},this.getRowState=e=>{var n,r;const s=parseInt(e,10);if(!(s>=this.data.count()))return(r=(n=this.data.getValidData()[s])==null?void 0:n.__ng)==null?void 0:r.rowState},this.getRowPosition=()=>this.row.at,this.setRowPosition=e=>{this.row.at=e},this.scrollTo_V1=e=>(e<0&&(e=0),e>=this.rawRecords.length&&(e=this.rawRecords.length-1),this.viewRecords.rawIndex=e,this.viewRecords.reset&&this.viewRecords.reset(),!(e<=0||e>=this.rawRecords.length-1)),this.getColumn=(e,s)=>this.data.get(e,s),this.setColumn=(e,s,n)=>{e=parseInt(e,10),this.data.setValue(e,s,n)},this.setDataSource([])}};rt=new WeakMap,c(Le,"ngDataManager");let pe=Le;const He=class He{constructor(i){d(this,bt);d(this,H,[]);A(this,"add",c((i,e="string")=>{i.forEach(s=>{t(this,H).some(n=>n.name===s)||t(this,H).push({name:s,type:e})}),t(this,Ht).call(this)},"add"));d(this,Ht,c(()=>{const i=new Map;t(this,H).forEach(e=>{i.set(e.name,e.type)}),b(this,H,Array.from(i,([e,s])=>({name:e,type:s}))),b(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,oe,c(()=>{b(this,H,[]),k.log(t(this,bt).querySelectorAll("table"));const i=Array.from(t(this,bt).querySelectorAll("table"));if(!(!i||i.length===0)){for(const e of i)k.log(e),$("[data-bind]",e).each((s,n)=>{const r=n.dataset.bind,o=n.getAttribute("data-type")||"string";r&&t(this,H).push({name:r,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((n,r)=>{var o=r.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 h=a.search(/[^_A-Za-z0-9]/g);let l="";h>=0?l=a.substring(0,h):o.startsWith("data.")&&(l=a.replace("data.","")),l&&t(this,H).push({name:l,type:"string"})}})})});t(this,Ht).call(this)}},"#init"));b(this,bt,i),t(this,oe).call(this)}get(){return t(this,H).map(i=>i.name)}getFields(){return t(this,H)}getType(i){const e=t(this,H).find(s=>s.name===i);return e?e.type:"string"}indexOf(i){return t(this,H).findIndex(e=>e.name===i)}includes(i){return t(this,H).some(e=>e.name===i)}};bt=new WeakMap,H=new WeakMap,Ht=new WeakMap,oe=new WeakMap,c(He,"ngFields");let ye=He;const Me=class Me extends HTMLElement{constructor(){super();d(this,ot);d(this,ae);d(this,le,c(()=>{this.fields=new ye(this),b(this,ae,new ue(this)),k.log("NineTable connected."),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,detail:{target:this}}))},"#init"));this.attachShadow({mode:"open"}),b(this,ot,new pe(this))}connectedCallback(){t(this,le).call(this)}disconnectedCallback(){k.log("NineTable disconnected.")}get data(){return t(this,ot).data}get row(){return t(this,ot).row}get dataManager(){return t(this,ot)}};ot=new WeakMap,ae=new WeakMap,le=new WeakMap,c(Me,"NineTable");let me=Me;customElements.get("nine-table")||customElements.define("nine-table",me);const Mt=class Mt extends HTMLElement{constructor(){super()}applyBaseStyle(){this.constructor.name}connectedCallback(){}};c(Mt,"BasicCellElement"),A(Mt,"_styleCache",new Map),A(Mt,"_customStyleCache",new Map);let xe=Mt;const Oe=class Oe extends xe{constructor(){super();d(this,L);d(this,$t);d(this,y);d(this,$e);d(this,Ie);d(this,_e);d(this,Ne);A(this,"getDisplayText",c(e=>{if(t(this,y))if(t(this,y).closest("tbody")){const s=t(this,y).closest("tr").data,n=parseInt(t(this,y).dataset.row);if(!s)return"";if(ninegrid.isNull(t(this,y).dataset.expr)){if(!ninegrid.isNull(t(this,y).dataset.bind))return s[t(this,y).dataset.bind]||ninegrid.nvl(e,"")}else try{return this.getExprValue(t(this,y).dataset.expr,s,n,t(this,y))}catch{console.error(t(this,y).dataset.expr,s,t(this,y).dataset.row)}return ninegrid.nvl(e,"")}else try{return t(this,L).exprFunction(t(this,y).dataset.expr).call(this,null,-1,t(this,L).data)}catch{}},"getDisplayText"));d(this,We,c(()=>{if(!(!t(this,L)||!t(this,L).template||!t(this,y).closest("tbody.bindable"))){var e=ninegrid.j.querySelectorAll(t(this,y)).attr("suppress");if(e&&(e=parseInt(e)),e&&!isNaN(e)){var s=t(this,y).closest("tr"),n=[];$("th,td",s).each((x,B)=>{var M=ninegrid.j.querySelectorAll(B).attr("suppress");M&&B.dataset.row&&(M=parseInt(M),!isNaN(M)&&M<=e&&n.push(M))}),n.sort();var r=!1;if(parseInt(s.sectionRowIndex/t(this,L).template.length)>0)for(var o of n){if(o>e)break;var a=parseInt(t(this,y).dataset.row),h=a-1,l=t(this,y).closest("tr").data,f=t(this,L).data.get(h);t(this,y).dataset.matrixRow;var u=t(this,L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this,y).dataset.matrixRow}"]`),p=u.dataset.expr?this.getExprValue(u.dataset.expr,l,a):l[u.dataset.bind],g=u.dataset.expr?this.getExprValue(u.dataset.expr,f,h):f[u.dataset.bind];if(p!=g){r=!0;break}}else r=!0;r?ninegrid.j.querySelectorAll(t(this,y)).removeClass("suppress"):ninegrid.j.querySelectorAll(t(this,y)).addClass("suppress"),ninegrid.j.querySelectorAll(t(this,y)).hasClass("hidden")||(r?ninegrid.j.querySelectorAll(t(this,y)).removeClass("hidden"):ninegrid.j.querySelectorAll(t(this,y)).addClass("hidden"));var m=parseInt(t(this,y).dataset.matrixRow),v=m-1,q=t(this,L).body.querySelector(`tbody.bindable [data-col="${t(this,y).dataset.col}"][data-matrix-row="${v}"]`);$(q).hasClass("suppress")&&!ninegrid.j.querySelectorAll(t(this,y)).hasClass("suppress")?ninegrid.j.querySelectorAll(q).removeClass("last-none-suppress").addClass("last-suppress"):!$(q).hasClass("suppress")&&ninegrid.j.querySelectorAll(t(this,y)).hasClass("suppress")?ninegrid.j.querySelectorAll(q).removeClass("last-suppress").addClass("last-none-suppress"):ninegrid.j.querySelectorAll(q).removeClass("last-none-suppress").removeClass("last-suppress")}}},"#resetSuppress"));A(this,"getExprValue",c((e,s,n,r)=>{if(typeof e<"u")try{n=parseInt(n);const o=e.replace("()","");return t(this,L)[o]?t(this,L)[o].call(this,s,n,t(this,y)):t(this,L).exprFunction(e).call(this,s,n,t(this,L).data)}catch{return["NG-COMBO"].includes(this.tagName)?"":e}else return e},"getExprValue"))}connectedCallback(){super.connectedCallback(),b(this,L,this.getRootNode().host),b(this,y,this.closest("th,td")),b(this,$t,t(this,y).closest("tr"))}get value(){var e=!t(this,L)||!t(this,L).dataManager||!t(this,y)||!t(this,y).dataset||!t(this,y).dataset.row||!t(this,y).dataset.bind?"":t(this,y).closest("tr").data[t(this,y).dataset.bind];return e??""}set value(e){var s=parseInt(t(this,y).dataset.row);const n=this.getAttribute("update-row-state")!="false";s<0?t(this,L).data.setValueNF(parseInt(t(this,y).dataset.index),t(this,y).dataset.bind,e,n):t(this,L).data.setValue(s,t(this,y).dataset.bind,e,n)}get row(){return parseInt(t(this,y).dataset.row)}get data(){return t(this,y).closest("tr").data}refresh(){return t(this,y).dataset.bind,parseInt(t(this,y).dataset.row),t(this,$t).data,t(this,y).dataset.row}};L=new WeakMap,$t=new WeakMap,y=new WeakMap,$e=new WeakMap,Ie=new WeakMap,_e=new WeakMap,Ne=new WeakMap,We=new WeakMap,c(Oe,"CellElement");let ve=Oe;const Be=class Be extends ve{constructor(){super()}connectedCallback(){super.connectedCallback()}refresh(){return super.refresh()}};c(Be,"EditableCellElement");let we=Be;const De=class De extends we{constructor(){super();d(this,It);d(this,at);d(this,pt);d(this,yt);d(this,ce);d(this,K);A(this,"refresh",c(()=>{const e=super.refresh();t(this,It).value=e},"refresh"));d(this,ze,c(e=>{if(!["Escape","Enter","Tab","Home","End","ArrowLeft","ArrowRight","PageUp","PageDown","Backspace","Delete"].includes(e.code)){if(t(this,at)=="number"){let r=[];if(t(this,K)&&Number(t(this,K))>0&&r.push("."),t(this,yt)&&Number(t(this,yt))>=0&&r.push("-"),!(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)&&!r.includes(e.key)&&e.preventDefault(),t(this,K)&&(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)&&e.target.selectionStart==e.target.selectionEnd){var s=e.target.value,n=s.indexOf(".");if(n>=0){var s=s.substr(n+1,s.length);s.length>=Number(t(this,K))&&e.preventDefault()}}}t(this,pt)&&ninegrid.getByteLength(e.target.value)>=Number(t(this,pt))&&e.target.selectionStart==e.target.selectionEnd&&e.preventDefault()}},"#onKeyDown"));if(this.applyBaseStyle(),b(this,at,this.getAttribute("type")||"text"),b(this,pt,this.getAttribute("maxbyte")),b(this,yt,this.getAttribute("min")),b(this,ce,this.getAttribute("max")),b(this,K,this.getAttribute("scale")),!["text","number"].includes(t(this,at)))throw`invalid type : ${t(this,at)}`}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=`
356
356
  <input type="text"
357
357
  ${e.join(" ")}
358
358
  ondragstart="return false;"