@ninebone/table 0.1.23 โ 0.1.31
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/css/layout.css +241 -0
- package/dist/nine-table.js +5774 -1593
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +1482 -222
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/nine-table.umd.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(T,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("@ninebone/util")):typeof define=="function"&&define.amd?define(["exports","@ninebone/util"],H):(T=typeof globalThis<"u"?globalThis:T||self,H(T.NineTable={},T.nine))})(this,function(T,H){"use strict";var vl=Object.defineProperty;var Sl=T=>{throw TypeError(T)};var ia=(T,H,B)=>H in T?vl(T,H,{enumerable:!0,configurable:!0,writable:!0,value:B}):T[H]=B;var h=(T,H)=>vl(T,"name",{value:H,configurable:!0});var E=(T,H,B)=>ia(T,typeof H!="symbol"?H+"":H,B),rl=(T,H,B)=>H.has(T)||Sl("Cannot "+B);var t=(T,H,B)=>(rl(T,H,"read from private field"),B?B.call(T):H.get(T)),d=(T,H,B)=>H.has(T)?Sl("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(T):H.set(T,B),g=(T,H,B,de)=>(rl(T,H,"write to private field"),de?de.call(T,B):H.set(T,B),B),A=(T,H,B)=>(rl(T,H,"access private method"),B);var Al=(T,H,B,de)=>({set _(v){g(T,H,v,B)},get _(){return t(T,H,de)}});var zs,Fs,At,G,Ws,pe,Qt,Gi,ge,Os,Ui,ji,ds,Ie,us,Z,Bs,Ki,Yi,Pt,Zi,Vs,Ji,El,Et,fs,be,Ll,Rl,Cl,Lt,qe,N,Me,He,Ne,Qi,De,tn,en,M,$e,z,Ps,mo,Xs,ze,sn,nn,$t,_s,Fe,We,Oe,ft,ol,ll,al,cl,rn,Gs,L,Be,Us,te,U,me,ee,ps,gs,Ve,Pe,on,ln,js,Ks,Ys,bs,an,cn,hn,Zs,hl,J,Js,se,Oi,kl,$,Qs,ye,Xt,So,Ao,gt,cs,dl,ti,ei,si,ii,ni,ms,ri,Tl,X,Xe,Ct,_e,_t,kt,Gt,Ut,ys,jt,xe,oi,li,Tt,yr,ul,ai,ci,fl,hi,dn,di,K,V,et,we,ie,ne,zt,ui,Ge,st,Il,ql,xr,Ml,fi,Hl,pi,pl,un,ve,Ft,re,bt,oe,Kt,fn,pn,gn,bn,Nl,mn,yn,xn,ko,Ue,je,gi,It,Se,Ke,wn,Yt,vn,Sn,bi,gl,ct,mi,ht,Wt,Dl,$l,zl,bl,Ye,yt,Ae,Ho,yi,le,xi,An,W,Fl,Wl,Ol,Bl,Vl,Pl,Xl,_l,Gl,Ul,jl,Kl,wi,ae,Ot,vi,Si,Ee,xs,Ai,En,Ei,ws,Ze,qt,Je,Ln,Yl,Rn,Cn,Qe,Li,kn,Tn,In,qn,Ri,Mn,it,Hn,ki,Nn,Ti,vs,Ii,qi,Le,Mi,Ss,Dn,$n,Zl,I,Ni,dt,q,ts,es,zn,Fn,Mt,Wn,On,Bn,xt,As,Vn,Es,Pn,wt,ce,Xn,Ls,_n,he,Rs,ss,Cs,ks,Gn,Un,jn,is,Bt,ns,Ts,_o,Go,Uo,jo,Kn,Di,Yn,Zn,ot,Jn,Qn,Is,tr,er,sr,ir,nr,rr,or,qs,Vt,Re,rs,os,Ce,Ht,$i,lr,zi,ar,cr,hr,Ms,dr,ls,Fi,ur,Hs,Ns,fr,pr,ut,Y,Ds,Q,vt,gr,j,wr,ml,Jl,yl,Ql,ta,ea,Wi,Zt,as,xl,sa;Array.prototype.nineBinarySearch=function(Nt){let r=0,e=this.length-1,s;for(;r<=e;){if(s=parseInt((r+e)/2),Nt===this[s])return s;Nt<this[s]?e=s-1:r=s+1}return-1};const B=new WeakMap;HTMLElement.prototype.addDebounseEventListener=function(Nt,r,e,s,i=500){const n=this;B.has(n)||B.set(n,{timer:null,cancelFn:null});const o=B.get(n);n.addEventListener(e,l=>{l.actualTarget=l.target,o.timer&&(clearTimeout(o.timer),o.timer=null),o.timer=setTimeout(()=>{o.timer=null,o.cancelFn=s.call(n,l)},i)}),n.addEventListener(Nt,l=>{o.timer&&(clearTimeout(o.timer),o.timer=null),o.cancelFn&&(o.cancelFn(),o.cancelFn=null),r.call(n,l)})},nine.measureTextSize=(Nt,r="12px sans-serif")=>{if(typeof Nt=="number"&&(Nt=Nt+""),!Nt)return{width:null,height:null};const e=h(l=>{const a=document.createElement("DIV");return a.innerHTML=l,a.textContent||a.innerText||""},"stripHtml");Nt=Nt.replaceAll(`
|
|
2
|
+
`,"<br>");let s=document.body.querySelector("canvas#_nine_measure_canvas_");s||(s=document.createElement("canvas"),s.id="_nine_measure_canvas_",s.style.cssText="position: absolute; visibility: hidden; pointer-events: none; left: -9999px;",document.body.appendChild(s));const i=s.getContext("2d");i.font=r;let n=0,o=0;for(let l of Nt.split("<br>")){const a=e(l),c=i.measureText(a);n=Math.max(n,c.width);const u=c.fontBoundingBoxAscent||10,p=c.fontBoundingBoxDescent||3;o+=u+p}return{width:n,height:o}};const lo=class lo extends H.trace.constructor{constructor(){super(),this.init("nine-table","green")}};h(lo,"Trace");let de=lo;const v=new de,Dt={META:{INDEX:{ROWID:0,FILTER:1,GROUP:2}},ROW_STATE:{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"},EVENT:{LOAD:"load",CELL_BUTTON_CLICK:"cell-button-click"}},ao=class ao{constructor(r){d(this,zs);d(this,Fs,-1);E(this,"count",h(()=>t(this,zs).rawRecords.length,"count"));g(this,zs,r)}get at(){return t(this,Fs)}set at(r){g(this,Fs,parseInt(r,10))}};zs=new WeakMap,Fs=new WeakMap,h(ao,"ngRow");let vr=ao;const at=class at{constructor(r,e){d(this,At);d(this,G);d(this,Ws,0);d(this,pe,[]);d(this,Qt,h(()=>(t(this,G).rawRecords||[]).filter(e=>{var s;return!((s=e.__ng)!=null&&s.deleted)}),"#getValidRecords"));E(this,"count",h(()=>this.length,"count"));E(this,"getArray",h((r,e)=>{const s=t(this,Qt).call(this);if(r==null)return s;if(r<0||r>=s.length)return null;const i=s[r];if(e!=null){const o=this.getHostFields().indexOf(e);return o>=0?i.v[o]:null}return i},"getArray"));E(this,"setArray",h((r,e,s)=>{const n=t(this,Qt).call(this)[r];n.v[e]!==s&&n.__ng.rowState!==at.ROW_STATE.INSERT&&(n.__ng.rowState=at.ROW_STATE.UPDATE),n.v[e]=s},"setArray"));E(this,"get",h((r,e)=>{const s=t(this,Qt).call(this);if(r==null)return t(this,ds).call(this,s);if(r<0||r>=s.length)return null;const i=s[r],n=this.getHostFields();if(e!=null){const o=n.indexOf(e);return o>=0?i.v[o]:null}return t(this,ds).call(this,i)},"get"));E(this,"getAll",h(()=>t(this,G).rawRecords||[],"getAll"));E(this,"getHostFields",h(()=>{var r;return typeof((r=t(this,At).fields)==null?void 0:r.get)=="function"?t(this,At).fields.get():[]},"getHostFields"));d(this,Gi,h(()=>{g(this,pe,[]);const r=t(this,At).template||[];Array.from(r).forEach(e=>{var s;t(this,pe).push(((s=e.getBoundingClientRect)==null?void 0:s.call(e).height)||24)}),(t(this,G).rawRecords||[]).forEach(e=>{e.__ng||(e.__ng=t(this,Os).call(this)),e.__ng.height=t(this,pe).slice()})},"#initialize"));d(this,ge,h(()=>{var e;const r=t(this,At).shadowRoot.querySelector("nine-table-sheets");r==null||r.classList.toggle("nodata",this.length===0),t(this,At).shadowRoot.querySelectorAll("nine-table-sheet").forEach(s=>{s.invalidate()}),(e=t(this,At).shadowRoot.querySelector("nine-table-sheets-footer"))==null||e.refresh()},"#invalidate"));E(this,"set",h(r=>{const e=h(()=>{this.clear(),this.add(r,!1),t(this,ge).call(this)},"loadData");t(this,At).loaded?e():t(this,At).addEventListener(Dt.EVENT.LOAD,s=>{e()},{once:!0})},"set"));d(this,Os,h((r=0)=>({rowState:at.ROW_STATE.EMPTY,deleted:!1,filtered:!1,height:t(this,pe).slice(),o:{},c:{},__:[0,0,0,0,at.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,t(this,pe).slice(),-1,{},{}],_:[r,[]]}),"#getDefaultMeta"));E(this,"reset",h(()=>{t(this,G).rawRecords=[],t(this,ge).call(this)},"reset"));E(this,"clear",h(()=>{var r;t(this,G).rawRecords=[],(r=t(this,G).viewRecords)!=null&&r.reset&&t(this,G).viewRecords.reset(),g(this,Ws,0),t(this,ge).call(this)},"clear"));d(this,Ui,h(r=>{Array.isArray(r)||(r=[r]);const e=this.getHostFields().length>0?this.getHostFields():Object.keys(r[0]||{}),s=[];return r.forEach(i=>{const n={v:[]};e.forEach(o=>{n.v.push(i[o]!==void 0&&i[o]!==null?i[o]:"")}),s.push(n)}),s},"#json2Array"));d(this,ji,h(r=>(Array.isArray(r)||(r=[r]),r.forEach(e=>{const s=this.nextId;e.m=t(this,Os).call(this,s),e.__ng=e.m,e.__ng.rowid=s,e.__ng.rowState=at.ROW_STATE.INSERT,e.__ng._[0]=s}),r),"#defaultInsert"));E(this,"add",h((r,e=!0)=>{r===void 0&&(r={});const s=t(this,Ui).call(this,r);t(this,G).rawRecords=t(this,G).rawRecords.concat(t(this,ji).call(this,s));const i=this.count()-1;return e||s.forEach((n,o)=>{const l=t(this,G).rawRecords[t(this,G).rawRecords.length-1-o];l&&(l.__ng.rowState=at.ROW_STATE.EMPTY)}),t(this,ge).call(this),i},"add"));E(this,"delete",h(r=>{let e=[];Array.isArray(r)?e=r:typeof r>"u"?e=[t(this,G).host.row.at]:e=[parseInt(r,10)];const s=t(this,Qt).call(this);e.sort((i,n)=>n-i).forEach(i=>{if(s[i]){const n=s[i].__ng.rowid;s[i].__ng.rowState===at.ROW_STATE.INSERT?t(this,G).rawRecords=t(this,G).rawRecords.filter(o=>o.__ng.rowid!==n):t(this,G).rawRecords.forEach(o=>{o.__ng.rowid===n&&(o.__ng.deleted=!0,o.__ng.rowState=at.ROW_STATE.DELETE)})}}),t(this,ge).call(this)},"delete"));E(this,"setValue",h((r,e,s)=>{r=parseInt(r,10);const n=this.getHostFields().indexOf(e);if(n<0)return;const l=t(this,Qt).call(this)[r];if(!l)return;const a=l.v[n];a!==s&&l.__ng.rowState!==at.ROW_STATE.INSERT&&(l.__ng.o.hasOwnProperty(e)||(l.__ng.o[e]=a),l.__ng.rowState=at.ROW_STATE.UPDATE),l.v[n]=s},"setValue"));d(this,ds,h(r=>{if(!r)return r;const e=!Array.isArray(r),s=e?[r]:r,i=this.getHostFields(),n=s.filter(o=>{var l;return!((l=o.__ng)!=null&&l.deleted)}).map(o=>{const l={};return i.forEach((a,c)=>{l[a]=o.v?o.v[c]:o[a]}),l.__ng=o.__ng,l});return e?n[0]:n},"#conv"));g(this,At,r),g(this,G,e),t(this,Gi).call(this)}get count(){return this.length}get source(){return t(this,ds).call(this,t(this,G).rawRecords)}set source(r){this.set(r)}get nextId(){return Al(this,Ws)._++}get length(){return t(this,Qt).call(this).length}get count(){return this.length}getRowCount(){return this.length}};At=new WeakMap,G=new WeakMap,Ws=new WeakMap,pe=new WeakMap,Qt=new WeakMap,Gi=new WeakMap,ge=new WeakMap,Os=new WeakMap,Ui=new WeakMap,ji=new WeakMap,ds=new WeakMap,h(at,"ngData"),E(at,"META_INDEX",{FILTER:0}),E(at,"ROW_STATE",{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"});let Sr=at;const co=class co{constructor(r){d(this,Ie);g(this,Ie,r),this.row=new vr(this),this.data=new Sr(t(this,Ie),this),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.pageCnt=25,this.viewRecords.reset=()=>{var e;(e=t(this,Ie).view)!=null&&e.redraw&&t(this,Ie).view.redraw()},this.setDataSource=e=>{this.data&&this.data.reset(),this.rawRecords=[],this.viewRecords=[],this.delRecords=[],this.data.set(e||[])},this.getRowState=e=>{var i,n;const s=parseInt(e,10);if(!(s>=this.data.count()))return(n=(i=this.data.getValidData()[s])==null?void 0:i.__ng)==null?void 0:n.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,i)=>{e=parseInt(e,10),this.data.setValue(e,s,i)},this.setDataSource([])}};Ie=new WeakMap,h(co,"ngDataManager");let Ar=co;const ho=class ho{constructor(r){d(this,us);d(this,Z,[]);E(this,"add",h((r,e="string")=>{r.forEach(s=>{t(this,Z).some(i=>i.name===s)||t(this,Z).push({name:s,type:e})}),t(this,Bs).call(this)},"add"));d(this,Bs,h(()=>{const r=new Map;t(this,Z).forEach(e=>{r.set(e.name,e.type)}),g(this,Z,Array.from(r,([e,s])=>({name:e,type:s}))),g(this,Z,t(this,Z).filter(e=>e.name!==""&&e.name!=="__ng")),t(this,Z).sort((e,s)=>e.name.length<s.name.length?1:-1)},"#adjust"));d(this,Ki,h(()=>{g(this,Z,[]),v.log(t(this,us).querySelectorAll("table"));const r=Array.from(t(this,us).querySelectorAll("table"));if(!(!r||r.length===0)){for(const e of r)v.log(e),e.querySelectorAll("[data-bind]").forEach(i=>{const n=i.dataset.bind,o=i.getAttribute("data-type")||"string";n&&t(this,Z).push({name:n,type:o})}),["data-expr","background-color","color","tooltip","visible","readonly","enable-button","enable-check","class-expr","icon-color","icon-src"].forEach(i=>{e.querySelectorAll(`[${i}]`).forEach(n=>{let o=n.getAttribute(i);if(o){if(o.indexOf("data.")<0){const l=o.search(/[(]/g);if(l>0)try{o=String(window[o.substring(0,l).trim()])}catch{o=""}}o.split("data.").forEach(l=>{if(l.trim()!=""){const a=l.search(/[^_A-Za-z0-9]/g);let c="";a>=0?c=l.substring(0,a):o.startsWith("data.")&&(c=l.replace("data.","")),c&&t(this,Z).push({name:c,type:"string"})}})}})});t(this,Bs).call(this)}},"#init"));g(this,us,r),t(this,Ki).call(this)}get(){return t(this,Z).map(r=>r.name)}getFields(){return t(this,Z)}getType(r){const e=t(this,Z).find(s=>s.name===r);return e?e.type:"string"}indexOf(r){return t(this,Z).findIndex(e=>e.name===r)}includes(r){return t(this,Z).some(e=>e.name===r)}};us=new WeakMap,Z=new WeakMap,Bs=new WeakMap,Ki=new WeakMap,h(ho,"fields");let Er=ho;const uo=class uo extends HTMLElement{constructor(){super();d(this,Yi,h(()=>{},"#init"))}connectedCallback(){t(this,Yi).call(this)}};Yi=new WeakMap,h(uo,"NineTableSheets");let Lr=uo;customElements.get("nine-table-sheets")||customElements.define("nine-table-sheets",Lr);const fo=class fo extends HTMLElement{constructor(){super();d(this,Ji);d(this,Pt);E(this,"refresh",h(()=>{this.querySelector("#row-count").innerHTML=t(this,Pt).data.count().toLocaleString()},"refresh"));d(this,Zi,h(()=>{var e;g(this,Pt,this.getRootNode().host),A(this,Ji,El).call(this),(e=this.querySelector(".nine-tab-bar"))==null||e.addEventListener("click",s=>{const i=s.ctrlKey||s.metaKey||s.shiftKey,n=s.target.closest("nt-sheets-tab-item");if(!n)return;const o=parseInt(n.dataset.index,10);t(this,Vs).call(this,o,i)}),t(this,Vs).call(this,0,!1)},"#init"));d(this,Vs,h((e,s=!1)=>{const i=h(()=>{const u=Array.from(t(this,Pt).shadowRoot.querySelectorAll("nine-table-sheet"));Array.from(t(this,Pt).shadowRoot.querySelectorAll("nine-splitter")).forEach(b=>b.style.setProperty("display","none"));const f=u.map((b,m)=>({sheet:b,idx:m})).filter(({sheet:b})=>b.classList.contains("active"));if(!(f.length<2))for(let b=0;b<f.length-1;b++){const m=f[b].idx,y=t(this,Pt).shadowRoot.querySelector(`nine-splitter[data-split-index="${m}"]`);y&&y.style.setProperty("display","")}},"updateSplitters"),n=this.querySelector(".nine-tab-bar"),o=t(this,Pt).shadowRoot.querySelector("nine-table-sheets-body"),l=n.querySelectorAll("nt-sheets-tab-item"),a=o.querySelectorAll("nine-table-sheet");if(!l[e])return;if(!s)l.forEach((u,p)=>{u.setActive(p===e)}),a.forEach((u,p)=>{const f=p===e;u.classList.toggle("active",f),u.style.flex=f?"1 1 100%":""});else{const u=l[e],p=n.querySelectorAll("nt-sheets-tab-item.active");if(u.classList.contains("active")&&p.length<=1)return;u.classList.toggle("active");const f=o.querySelector(`nine-table-sheet[data-index="${e}"]`);f&&(f.classList.toggle("active"),f.classList.contains("active")||(f.style.flex=""))}const c=o.querySelectorAll("nine-table-sheet.active");c==null||c.forEach(u=>{var p;u.style.flex=c.length>1?"1 1 0%":"1 1 100%",typeof u.refreshLayout=="function"?u.refreshLayout():(p=u.invalidate)==null||p.call(u)}),i()},"#switchSheet"))}connectedCallback(){t(this,Zi).call(this)}};Pt=new WeakMap,Zi=new WeakMap,Vs=new WeakMap,Ji=new WeakSet,El=h(function(){const i=Array.from(t(this,Pt).children).filter(n=>n.tagName.toUpperCase()==="TABLE").map((n,o)=>{const l=o===0?"active":"",a=n.getAttribute("caption")||`Sheet ${o+1}`;return`<nt-sheets-tab-item class="${l}" data-index="${o}">${a}</nt-sheets-tab-item>`}).join("");this.innerHTML=`
|
|
3
|
+
<div class="nine-tab-bar">${i}</div>
|
|
4
|
+
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
5
|
+
`},"#render"),h(fo,"NineTableSheetsFooter");let Rr=fo;const po=class po extends HTMLElement{constructor(){super()}connectedCallback(){}setActive(r){this.classList.toggle("active",r)}};h(po,"SheetTabItem");let Cr=po;customElements.get("nt-sheets-tab-item")||customElements.define("nt-sheets-tab-item",Cr),customElements.get("nine-table-sheets-footer")||customElements.define("nine-table-sheets-footer",Rr);const go=class go extends HTMLElement{constructor(){super(...arguments);d(this,be);d(this,Et);d(this,fs)}connectedCallback(){g(this,Et,this.getRootNode().host),A(this,be,Ll).call(this),A(this,be,Cl).call(this)}addCustomElement(e){t(this,fs)&&t(this,fs).append(e)}updateCaption(e){const s=this.querySelector(".ng-toolbar-title");s&&(s.textContent=e)}};Et=new WeakMap,fs=new WeakMap,be=new WeakSet,Ll=h(function(){this.innerHTML=`
|
|
6
|
+
<div class="ng-toolbar-left">
|
|
7
|
+
<button type="button" class="ng-toolbar-menu-btn" title="Menu">
|
|
8
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#374151" stroke-width="2">
|
|
9
|
+
<line x1="3" y1="12" x2="21" y2="12"></line>
|
|
10
|
+
<line x1="3" y1="6" x2="21" y2="6"></line>
|
|
11
|
+
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|
12
|
+
</svg>
|
|
13
|
+
</button>
|
|
14
|
+
<span class="ng-toolbar-title"></span>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div class="ng-toolbar-custom" id="custom-container"></div>
|
|
18
|
+
`,g(this,fs,this.querySelector("#custom-container")),A(this,be,Rl).call(this)},"#render"),Rl=h(function(){const e=t(this,Et).getAttribute("theme")==="simple"||t(this,Et).classList.contains("simple"),s=t(this,Et).getAttribute("show-toolbar")!=="false",i=t(this,Et).getAttribute("show-menu")!=="false",n=t(this,Et).getAttribute("caption")||"";e||!s?this.setAttribute("hidden",""):this.removeAttribute("hidden"),this.setAttribute("show-menu",i?"true":"false"),this.updateCaption(n)},"#syncStateFromHost"),Cl=h(function(){const e=this.querySelector(".ng-toolbar-title");e&&e.addEventListener("dblclick",()=>{const i='<font color="green">https://www.ninegrid.net</font>',n=t(this,Et).getAttribute("caption")||"";e.innerHTML=e.innerHTML===i?n:i});const s=this.querySelector(".ng-toolbar-menu-btn");s&&s.addEventListener("click",()=>{t(this,Et).dispatchEvent(new CustomEvent("toolbar-menu-click",{bubbles:!0,composed:!0,detail:{targetTable:t(this,Et)}}))})},"#bindEvents"),h(go,"Toolbar");let kr=go;customElements.get("nine-table-toolbar")||customElements.define("nine-table-toolbar",kr);const bo=class bo extends HTMLElement{constructor(){super();d(this,Lt);d(this,qe,!1);d(this,N);d(this,Me);d(this,He);d(this,Ne);d(this,Qi,h(()=>{if(!t(this,Lt))return;const e=t(this,Lt).querySelector(".ng-sheet-body .ng-container-body");e&&(g(this,Ne,new ResizeObserver(()=>{this.refresh()})),t(this,Ne).observe(e))},"#observeResize"));E(this,"refresh",h(()=>{if(!t(this,Lt)||!t(this,N)||t(this,qe))return;const e=t(this,N).container,s=e.querySelector("table");if(!s)return;const i=t(this,N).track,n=t(this,N).thumb,o=e.clientWidth,l=s.scrollWidth,a=o!==0&&l>o;if(t(this,Lt).classList.toggle("hscroll-visible",a),!a)return;const c=i.clientWidth;if(c<=0)return;const u=Math.max(Math.min(c*(o/l),c),20);n.style.width=`${u}px`;const p=e.scrollLeft,f=l-o;let b=0;f>0&&(b=parseInt(p/f*(c-u),10)),b<0&&(b=0);const m=c-u;b>m&&(b=m),n.style.left=`${b}px`,t(this,N).left.disabled=b===0,t(this,N).right.disabled=b>=m-1},"refresh"));d(this,De,h(e=>{if(!t(this,N))return!1;const s=t(this,N).container,i=s.querySelector("table");if(!i)return!1;const n=t(this,N).track.getBoundingClientRect(),o=t(this,N).thumb.clientWidth;let l=e;l<0&&(l=0);const a=n.width-o;l>a&&(l=a),l=parseInt(l,10),t(this,N).thumb.style.left=`${l}px`,t(this,N).left.disabled=l===0,t(this,N).right.disabled=l>=a-1;const c=s.clientWidth,p=i.scrollWidth-c;if(a>0&&p>0){const f=l/a*p;s.scrollLeft=f;const b=t(this,Lt).querySelector(".ng-sheet-header .ng-container-body"),m=t(this,Lt).querySelector(".ng-sheet-footer .ng-container-body");b&&(b.scrollLeft=f),m&&(m.scrollLeft=f)}return l>0&&l<a-1},"#thumbMoveTo"));d(this,tn,h(()=>{const e=h(i=>{clearInterval(t(this,Me)),clearInterval(t(this,He));const n=parseInt(t(this,N).thumb.style.left||0,10);t(this,De).call(this,n+i),g(this,Me,setInterval(()=>{clearInterval(t(this,Me)),g(this,He,setInterval(()=>{const o=parseInt(t(this,N).thumb.style.left||0,10);t(this,De).call(this,o+i)||clearInterval(t(this,He))},50))},500))},"delayScroll"),s=h(()=>{clearInterval(t(this,Me)),clearInterval(t(this,He))},"clearTimer");["mouseup","mouseleave","touchend"].forEach(i=>{t(this,N).left.addEventListener(i,s),t(this,N).right.addEventListener(i,s),t(this,N).track.addEventListener(i,s)}),t(this,N).left.addEventListener("mousedown",i=>{i.button===0&&e(-20)}),t(this,N).right.addEventListener("mousedown",i=>{i.button===0&&e(20)}),t(this,N).left.addEventListener("touchstart",()=>e(-20)),t(this,N).right.addEventListener("touchstart",()=>e(20)),t(this,N).track.addEventListener("mousedown",i=>{if(i.button!==0)return;i.preventDefault();const n=t(this,N).track.getBoundingClientRect(),o=t(this,N).thumb.clientWidth;t(this,De).call(this,i.clientX-n.left-o/2)}),t(this,N).thumb.addEventListener("mousedown",i=>{if(i.button!==0)return;i.stopPropagation(),i.preventDefault(),g(this,qe,!0),this.shiftX=i.clientX-t(this,N).thumb.getBoundingClientRect().left;const n=h(l=>{if(!t(this,qe))return;const a=t(this,N).track.getBoundingClientRect();t(this,De).call(this,l.clientX-a.left-this.shiftX)},"onMouseMove"),o=h(()=>{g(this,qe,!1),s(),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o),this.refresh()},"onMouseUp");document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)})},"#init"))}connectedCallback(){if(g(this,Lt,this.closest("nine-table-sheet")||this.getRootNode().host),!t(this,Lt))return;this.innerHTML=`
|
|
2
19
|
<style>
|
|
3
20
|
nine-table-hscrollbar {
|
|
4
21
|
display: flex;
|
|
@@ -60,7 +77,7 @@
|
|
|
60
77
|
<button class='ng-scroll-left' disabled><div class='ng-scroll-icon'></div></button>
|
|
61
78
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
62
79
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
63
|
-
`;const e=
|
|
80
|
+
`;const e=h(()=>{const s=t(this,Lt).querySelector(".ng-sheet-body .ng-container-body");if(!s){setTimeout(e,10);return}g(this,N,{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")}),t(this,tn).call(this),t(this,Qi).call(this),this.refresh()},"initWhenReady");e()}disconnectedCallback(){t(this,Ne)&&t(this,Ne).disconnect()}};Lt=new WeakMap,qe=new WeakMap,N=new WeakMap,Me=new WeakMap,He=new WeakMap,Ne=new WeakMap,Qi=new WeakMap,De=new WeakMap,tn=new WeakMap,h(bo,"NineTableHScrollBar");let Tr=bo;customElements.get("nine-table-hscrollbar")||customElements.define("nine-table-hscrollbar",Tr);const yo=class yo extends HTMLElement{constructor(){super();d(this,en);d(this,M);d(this,$e,!1);d(this,z);d(this,Ps,0);d(this,mo,0);d(this,Xs,0);d(this,ze,h(()=>{var u,p;const e=t(this,M).view.getArray(),s=e?e.length:0,i=(u=t(this,M).elements)==null?void 0:u.scrollHolder;let n=i&&parseFloat(i.style.height)||0;if(!n||n<=0)if(!!((p=t(this,M).sourceTable)!=null&&p.querySelector("tbody tr[grouping='true']"))&&t(this,M).rowManager)n=body.scrollHeight>body.clientHeight?body.scrollHeight:s*30;else{const b=t(this,M).getRowHeight()||1;n=s*b}const o=15e6,l=n>o;let a=1,c=n;return l&&(a=o/n,c=o),{rawContentHeight:n,contentHeight:c,scaleFactor:a,useScaling:l,totalCount:s}},"#getScaleInfo"));d(this,sn,h(()=>{var l,a,c,u,p,f,b,m,y,x;const e=t(this,z).container;if(!e)return 0;const s=((c=(a=(l=t(this,M).elements)==null?void 0:l.body)==null?void 0:a.thead)==null?void 0:c.offsetHeight)||0,i=((f=(p=(u=t(this,M).elements)==null?void 0:u.body)==null?void 0:p.tfoot)==null?void 0:f.offsetHeight)||0,n=((x=(y=(m=(b=t(this,M).elements)==null?void 0:b.body)==null?void 0:m.tbody)==null?void 0:y.head)==null?void 0:x.offsetHeight)||0,o=s+i+n;return e.clientHeight-o},"#getViewHeight"));E(this,"refresh",h(()=>{if(v.log("=================","vscrollbar.refresh"),t(this,$e)||!t(this,M)||!t(this,M).elements||!t(this,z))return;const e=t(this,z).container,s=t(this,z).track,i=t(this,z).thumb,n=t(this,sn).call(this),{rawContentHeight:o,contentHeight:l}=t(this,ze).call(this),a=o>n&&o>0&&n>0;if(t(this,M).classList.toggle("vscroll-visible",a),!a)return;const c=s.clientHeight;if(c<=0)return;const u=Math.max(Math.min(c*(n/l),c),20);i.style.height=`${u}px`;const p=e.scrollTop,f=Math.max(l-t(this,M).rowManager.getRowHeight(),1);let b=0;f>0&&(b=p/f*(c-u));const m=c-u;b<0&&(b=0),b>m&&(b=m),i.style.top=`${b}px`,t(this,z).top.disabled=p<=0,t(this,z).bottom.disabled=p>=f-1},"refresh"));d(this,nn,h(()=>{v.log("nine-table-vscrollbar.#init");const e=t(this,z).container;t(this,z).thumb.addEventListener("mousedown",s=>{if(s.button!==0)return;s.stopPropagation(),s.preventDefault(),g(this,$e,!0),g(this,Ps,s.clientY),g(this,Xs,parseFloat(t(this,z).thumb.style.top)||0);const n=t(this,z).track.getBoundingClientRect().height,o=t(this,z).thumb.clientHeight,l=n-o,a=h(u=>{var D,_;if(!t(this,$e)||l<=0)return;const p=u.clientY-t(this,Ps);let f=t(this,Xs)+p;f<0&&(f=0),f>l&&(f=l),t(this,z).thumb.style.top=`${f}px`;const b=f/l,m=t(this,M).getRowHeight(),y=(t(this,M).querySelector(".ng-sheet-body").offsetHeight||0)-(((D=t(this,M).elements.body.thead)==null?void 0:D.offsetHeight)||0)-(((_=t(this,M).elements.body.tfoot)==null?void 0:_.offsetHeight)||0)-(t(this,M).elements.body.tbody.head.offsetHeight||0),x=Math.floor(y/m),{totalCount:w}=t(this,ze).call(this),S=Math.floor(b*(w-x+1));t(this,M).rowManager.scrollToDataRow(S);const{rawContentHeight:R,contentHeight:C}=t(this,ze).call(this),F=t(this,z).container.scrollTop,k=Math.max(C-t(this,M).rowManager.getRowHeight(),0);t(this,z).top.disabled=F<=0,t(this,z).bottom.disabled=F>=k-1},"onMouseMove"),c=h(()=>{g(this,$e,!1),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",c)},"onMouseUp");document.addEventListener("mousemove",a),document.addEventListener("mouseup",c)}),t(this,z).track.addEventListener("mousedown",s=>{if(s.button!==0||s.target===t(this,z).thumb)return;const i=t(this,z).track.getBoundingClientRect(),n=t(this,z).thumb.clientHeight,l=t(this,z).track.clientHeight-n;if(l>0){const a=s.clientY-i.top-n/2,c=Math.max(0,Math.min(1,a/l)),{totalCount:u}=t(this,ze).call(this),p=Math.max(0,Math.min(Math.floor(c*(u-1)),u-1));v.log("๐ฏ [VScroll Track Click]",{ratio:c,clickY:a,totalCount:u,targetRow:p}),p>=0&&t(this,M).rowManager&&typeof t(this,M).rowManager.scrollToDataRow=="function"&&t(this,M).rowManager.scrollToDataRow(p,"top")}this.refresh()}),t(this,z).top.addEventListener("click",()=>{const s=Math.floor(e.scrollTop/t(this,M).getRowHeight()),i=Math.max(0,s-1);t(this,M).rowManager&&typeof t(this,M).rowManager.scrollToDataRow=="function"&&t(this,M).rowManager.scrollToDataRow(i,"top")}),t(this,z).bottom.addEventListener("click",()=>{const i=Math.floor(e.scrollTop/t(this,M).getRowHeight())+1;t(this,M).rowManager&&typeof t(this,M).rowManager.scrollToDataRow=="function"&&t(this,M).rowManager.scrollToDataRow(i,"top")})},"#init"))}connectedCallback(){g(this,en,this.getRootNode().host),g(this,M,this.closest("nine-table-sheet")),this.innerHTML=`
|
|
64
81
|
<style>
|
|
65
82
|
nine-table-vscrollbar {
|
|
66
83
|
display: flex;
|
|
@@ -123,11 +140,115 @@
|
|
|
123
140
|
<button class='ng-scroll-top' disabled><div class='ng-scroll-icon'></div></button>
|
|
124
141
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
125
142
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
126
|
-
`;const e=d(()=>{const s=t(this,lt).querySelector(".ng-container-body .ng-part-body");if(!s){setTimeout(e,10);return}p(this,k,{container:s,track:this.querySelector(".ng-scroll-track"),thumb:this.querySelector(".ng-scroll-thumb"),top:this.querySelector(".ng-scroll-top"),bottom:this.querySelector(".ng-scroll-bottom")}),t(this,se).call(this),this.refresh()},"initWhenReady");e()}};at=new WeakMap,lt=new WeakMap,yt=new WeakMap,k=new WeakMap,kt=new WeakMap,Lt=new WeakMap,se=new WeakMap,d(Ue,"NineTableVScrollBar");let Ct=Ue;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",Ct);const Ze=class Ze{constructor(r){h(this,G);h(this,A);h(this,ct);h(this,U,new Map);h(this,D,null);h(this,J,null);h(this,ht,0);h(this,It,40);h(this,Ye,!1);h(this,Xe,!1);h(this,re,3);h(this,Ke,3);h(this,ne,0);T(this,"refresh",d(()=>{var e;x.log("rowManager.refresh");const r=t(this,A).querySelector(".ng-container-body .ng-part-body");r&&(t(this,Mt).call(this),t(this,Ht).call(this),t(this,dt).call(this,r.scrollTop),(e=t(this,A).querySelector("nine-table-vscrollbar"))==null||e.refresh())},"refresh"));T(this,"initialize",d(()=>{x.log("rowManager.initialize"),p(this,ct,{scrollTables:t(this,A).querySelectorAll(".ng-part-body table"),firstTr:t(this,A).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")}),p(this,D,null),t(this,U).clear(),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(i=>{const a=t(this,A).querySelector(i);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 g=Array.from(l.querySelectorAll("tr")).map(b=>b.cloneNode(!0));t(this,U).set(i,g)});const r=t(this,A).querySelector(".ng-container-body .ng-part-body"),e=t(this,A).querySelector(".ng-container-left .ng-part-body"),s=t(this,A).querySelector(".ng-container-right .ng-part-body"),n=t(this,A).querySelector(".ng-container-body .ng-part-header"),o=t(this,A).querySelector(".ng-container-body .ng-part-footer");if(r){t(this,Mt).call(this),t(this,Nt).call(this),t(this,Ht).call(this),t(this,dt).call(this,r.scrollTop);let i=!1;p(this,ne,r.scrollLeft);const a=d(c=>{var g;if(i)return;i=!0;const l=c.scrollTop,u=c.scrollLeft;r&&r.scrollTop!==l&&(r.scrollTop=l),e&&e.scrollTop!==l&&(e.scrollTop=l),s&&s.scrollTop!==l&&(s.scrollTop=l),n&&n.scrollLeft!==u&&(n.scrollLeft=u),o&&o.scrollLeft!==u&&(o.scrollLeft=u),t(this,dt).call(this,l),(g=t(this,A).querySelector("nine-table-vscrollbar"))==null||g.refresh(),i=!1},"handleContainerScroll");r==null||r.addEventListener("scroll",c=>{a(r)}),[e,s].forEach(c=>{c==null||c.addEventListener("scroll",l=>{if(i)return;i=!0;const u=c.scrollTop;r&&r.scrollTop!==u&&(r.scrollTop=u),i=!1})})}},"initialize"));h(this,oe,d((r,e)=>{x.log("rowManager.#renderRows");const s=t(this,U).get(e);if(!s||s.length===0)return;const n=r.querySelector(".ng-part-body tbody.bindable-tbody");if(!n)return;n.querySelectorAll("tr:not(.nodata)").forEach(a=>a.remove());const o=n.querySelector("tr.nodata"),i=document.createDocumentFragment();for(let a=0;a<t(this,It);a++)s.forEach(c=>{i.appendChild(c.cloneNode(!0))});o?o.before(i):n.appendChild(i),e===".ng-container-body"&&(t(this,ct).firstTr=n.querySelector("tr:not(.nodata)"))},"#renderRows"));h(this,Mt,d(()=>{if(t(this,D)!==null&&t(this,D)>0)return t(this,D);const r=t(this,A).querySelector(".ng-container-body .ng-part-body");x.log("rowManager.#measureAndCacheHeight");const e=t(this,U).get(".ng-container-body");if(!e||e.length===0)throw new Error("invalid dom");const s=r.querySelector("tbody.bindable-tbody");if(!s)throw new Error("invalid dom");s.querySelectorAll("tr:not(.nodata)").forEach(b=>b.remove());const n=s.querySelector("tr.nodata"),o=document.createDocumentFragment();e.forEach(b=>{o.appendChild(b.cloneNode(!0))}),n?n.before(o):s.appendChild(o);const i=t(this,A),a=i.style.display,c=i.style.visibility,l=i.style.position;(a==="none"||window.getComputedStyle(i).display==="none")&&(i.style.display="block",i.style.visibility="hidden",i.style.position="absolute");let u=0;const g=s.querySelectorAll("tr");return g.forEach(b=>{let f=b.offsetHeight||b.getBoundingClientRect().height;if(f===0){const y=window.getComputedStyle(b);f=parseFloat(y.height)||parseFloat(y.minHeight)||0}u+=f}),g.forEach(b=>b.remove()),i.style.display=a,i.style.visibility=c,i.style.position=l,u<=0?-1:(p(this,D,u),t(this,$t).call(this),t(this,D))},"#measureAndCacheHeight"));h(this,Ht,d(()=>{x.log("rowManager.#updateVirtualScrollHeight");const e=(t(this,G).data.get()||[]).length,s=t(this,D),n=e*s;[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(o=>{const i=t(this,A).querySelector(o);if(!i)return;const a=i.querySelector(".ng-part-body .ng-virtual-spacer");a&&(a.style.height=`${n}px`)})},"#updateVirtualScrollHeight"));h(this,$t,d(()=>{if(t(this,ht)>0&&t(this,D)>0){const r=Math.ceil(t(this,ht)/t(this,D));p(this,It,r+t(this,re))}},"#updateRowCount"));h(this,ie,d(()=>{var a,c,l,u,g,b;const r=t(this,A).querySelector(".ng-container-left .ng-part-body table"),e=t(this,A).querySelector(".ng-container-body .ng-part-body table"),s=t(this,A).querySelector(".ng-container-right .ng-part-body table");if(e){const f=r?Array.from(r.querySelectorAll("tbody tr")):[],y=Array.from(e.querySelectorAll("tbody tr")),v=s?Array.from(s.querySelectorAll("tbody tr")):[],S=Math.max(f.length,y.length,v.length);for(let m=0;m<S;m++){const _=[((a=f[m])==null?void 0:a.getBoundingClientRect().height)||0,((c=y[m])==null?void 0:c.getBoundingClientRect().height)||0,((l=v[m])==null?void 0:l.getBoundingClientRect().height)||0],C=Math.max(..._);C>0&&(f[m]&&(f[m].style.height=`${C}px`),y[m]&&(y[m].style.height=`${C}px`),v[m]&&(v[m].style.height=`${C}px`))}}const n=t(this,A).querySelector(".ng-container-left .ng-part-footer table"),o=t(this,A).querySelector(".ng-container-body .ng-part-footer table"),i=t(this,A).querySelector(".ng-container-right .ng-part-footer table");if(o){const f=n?Array.from(n.querySelectorAll("tfoot tr")):[],y=Array.from(o.querySelectorAll("tfoot tr")),v=i?Array.from(i.querySelectorAll("tfoot tr")):[],S=Math.max(f.length,y.length,v.length);for(let m=0;m<S;m++){const _=[((u=f[m])==null?void 0:u.getBoundingClientRect().height)||0,((g=y[m])==null?void 0:g.getBoundingClientRect().height)||0,((b=v[m])==null?void 0:b.getBoundingClientRect().height)||0],C=Math.max(..._);C>0&&(f[m]&&(f[m].style.height=`${C}px`),y[m]&&(y[m].style.height=`${C}px`),v[m]&&(v[m].style.height=`${C}px`))}}},"#syncRowHeights"));h(this,ae,d(()=>{!t(this,A)||!(t(this,A)instanceof HTMLElement)||(p(this,J,new ResizeObserver(r=>{for(const e of r){const s=e.target;if(!s.classList.contains("active"))continue;const n=e.contentRect.height;if(n>0){let o=0;const i=s.querySelector(".ng-part-header"),a=s.querySelector(".ng-part-footer");i&&(o+=i.offsetHeight),a&&(o+=a.offsetHeight);const c=Math.max(n-o,100);t(this,ht)!==c&&(p(this,ht,c),t(this,$t).call(this),t(this,D)!==null&&(t(this,Nt).call(this),this.refresh()))}}})),t(this,J).observe(t(this,A)))},"#initResizeObserver"));h(this,Nt,d(()=>{x.log("rowManager.#renderAllContainers"),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const e=t(this,A).querySelector(r);e&&e.querySelector(".ng-part-body tbody.bindable-tbody")&&t(this,oe).call(this,e,r)}),t(this,ce).call(this),t(this,ie).call(this)},"#renderAllContainers"));h(this,dt,d(r=>{var g,b;x.log("rowManager.#handleScroll()",t(this,D));const e=t(this,D);if(!e||e<=0)return;const s=t(this,G).data.length;if(s===0)return;const n=((g=t(this,U).get(".ng-container-body"))==null?void 0:g.length)||1,o=t(this,A).querySelector(".ng-container-body .ng-part-body"),i=Math.max(0,s-Math.floor(o.clientHeight/e)),a=Math.min(i,Math.max(0,Math.floor(r/e)));let c=Math.floor(a*e);const l=t(this,ct).firstTr,u=l&&l.dataset.row!==void 0?parseInt(l.dataset.row,10):-1;(b=t(this,ct))==null||b.scrollTables.forEach(f=>{f.style.transform=`translate3d(0, ${c}px, 0)`}),u!==a&&[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(f=>{const y=t(this,A).querySelector(f);if(!y)return;const v=y.querySelector(".ng-part-body tbody.bindable-tbody");if(!v)return;Array.from(v.querySelectorAll("tr:not(.nodata)")).forEach((m,_)=>{const C=a+Math.floor(_/n);if(C>=s){m.style.display="none",m.dataset.matrixRow=null,m.dataset.row=null;return}const z=t(this,G).data.get(C);m.style.display="",t(this,le).call(this,m,z,C)})})},"#handleScroll"));h(this,le,d((r,e,s)=>{const n=t(this,A).templateLength||1,o=parseInt(r.dataset.subrow,10)||0,i=s*n+o;r.dataset.row=s,r.dataset.matrixRow=i,r.data=e,Array.from(r.cells).forEach((a,c)=>{a.dataset.row=s;const l=Array.from(a.children).find(u=>u.tagName.toLowerCase().startsWith("cell-")||typeof u.refresh=="function");l&&typeof l.refresh=="function"&&l.refresh()})},"#bindRowData"));h(this,ce,d(()=>{var c,l,u;x.log("rowManager.#syncHeaderHeights");const r=t(this,A).querySelector(".ng-container-left .ng-part-header table"),e=t(this,A).querySelector(".ng-container-body .ng-part-header table"),s=t(this,A).querySelector(".ng-container-right .ng-part-header table");if(!e)return;const n=r?Array.from(r.querySelectorAll("tr")):[],o=Array.from(e.querySelectorAll("tr")),i=s?Array.from(s.querySelectorAll("tr")):[],a=Math.max(n.length,o.length,i.length);for(let g=0;g<a;g++){const b=[((c=n[g])==null?void 0:c.getBoundingClientRect().height)||0,((l=o[g])==null?void 0:l.getBoundingClientRect().height)||0,((u=i[g])==null?void 0:u.getBoundingClientRect().height)||0],f=Math.max(...b);f>0&&(n[g]&&(n[g].style.height=`${f}px`),o[g]&&(o[g].style.height=`${f}px`),i[g]&&(i[g].style.height=`${f}px`))}},"#syncHeaderHeights"));T(this,"destroy",d(()=>{t(this,J)&&(t(this,J).disconnect(),p(this,J,null))},"destroy"));p(this,G,r.getRootNode().host),p(this,A,r),t(this,ae).call(this)}getRowHeight(){return t(this,D)}templateLength(r=".ng-container-body"){var e;return((e=t(this,U).get(r))==null?void 0:e.length)||1}scrollToDataRow(r,e){const s=t(this,D);if(!s||s<=0){typeof e=="function"&&e();return}const n=t(this,A).querySelector(".ng-container-body .ng-part-body");if(!n){typeof e=="function"&&e();return}const o=t(this,G).data.length,i=Math.max(0,Math.min(r,o-1)),a=i*s,c=n.scrollTop,l=n.clientHeight,u=i*s,g=u+s;u>=c&&g<=c+l?typeof e=="function"&&e():(n.scrollTop=a,t(this,dt).call(this,a),requestAnimationFrame(()=>{typeof e=="function"&&e()}))}};G=new WeakMap,A=new WeakMap,ct=new WeakMap,U=new WeakMap,D=new WeakMap,J=new WeakMap,ht=new WeakMap,It=new WeakMap,Ye=new WeakMap,Xe=new WeakMap,re=new WeakMap,Ke=new WeakMap,ne=new WeakMap,oe=new WeakMap,Mt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,ie=new WeakMap,ae=new WeakMap,Nt=new WeakMap,dt=new WeakMap,le=new WeakMap,ce=new WeakMap,d(Ze,"RowManager");let ke=Ze;const he=class he{static compileAll(r){return Array.isArray(r)?r.map(e=>he.compile(e)):[]}static compile(r){if(!r)return null;const e=d(a=>{a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach(l=>{const u=l.getAttribute("cell-type")||"renderer";if(l.children.length>0&&l.firstElementChild.tagName.includes("-"))return;let g=`cell-${u}`;const b=l.getAttribute("data-bind"),f=l.getAttribute("data-expr"),y=l.getAttribute("maxbyte"),v=l.getAttribute("type");let S=[];b&&S.push(`data-bind="${b}"`),f&&S.push(`data-expr="${f}"`),y&&S.push(`maxbyte="${y}"`),v&&S.push(`type="${v}"`),l.innerHTML=`<${g} ${S.join(" ")}></${g}>`}),a.querySelectorAll("tbody td, tfoot td").forEach(l=>{l.setAttribute("tabindex","0")})},"processCellTypes"),s=d(a=>{if(!a.querySelector("colgroup")){const c=a.querySelector("tbody tr")||a.querySelector("tr"),l=c?c.querySelectorAll("th, td").length:1,u=document.createElement("colgroup"),g=Math.max(Math.floor(a.clientWidth/l),100);for(let b=0;b<l;b++){const f=document.createElement("col");f.setAttribute("width",g),u.appendChild(f)}a.prepend(u)}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"),n=d((a,c)=>{const l=Array.from(a.querySelectorAll(c+" tr")),u=Array.from(a.querySelectorAll(c+" th,"+c+" td")),g=l.length;if(g===0||u.length===0)return;let b=0;u.forEach(y=>{b+=y.colSpan||1});const f=Array.from(Array(g),()=>Array(b).fill(null));l.forEach(y=>{const v=y.sectionRowIndex;let S=0;y.dataset.subrow=v,Array.from(y.querySelectorAll("th,td")).forEach(m=>{for(let z=0;z<f[v].length;z++)if(f[v][z]===null){S=z;break}const _=m.rowSpan||1,C=m.colSpan||1;for(let z=0;z<_;z++)for(let Tt=0;Tt<C;Tt++)v+z<g&&S+Tt<b&&(f[v+z][S+Tt]=z===0&&Tt===0?"1":"0")})}),l.forEach(y=>{const v=y.sectionRowIndex;Array.from(y.querySelectorAll("th,td")).forEach(S=>{for(let m=0;m<f[v].length;m++)if(f[v][m]==="1"){S.dataset.col=m,f[v][m]="0";break}})})},"resetColIndex"),o=r.cloneNode(!0);return s(o),e(o),n(o,"thead"),n(o,"tbody"),n(o,"tfoot"),Array.from(o.querySelectorAll("colgroup col")).forEach((a,c)=>{const l=a.getAttribute("fixed");l&&o.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach(u=>{u.setAttribute("fixed",l)})}),o}};d(he,"TableCompiler");let Le=he;const Ge=class Ge{constructor(r){h(this,Y);h(this,M);h(this,ft,{startRow:-1,startCol:-1,endRow:-1,endCol:-1});T(this,"render",d(()=>{const{startRow:r,startCol:e,endRow:s,endCol:n}=t(this,ft),o=t(this,M).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body");if(o.forEach(i=>{i.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach(a=>{a.classList.remove("selected","selected-top","selected-bottom","selected-left","selected-right")})}),this.setFocus(r,e),r<0||e<0){x.log("โ ๏ธ [CellSelection.render] Range is invalid (< 0), skipping render.");return}o.forEach(i=>{i.querySelectorAll("tbody tr").forEach(a=>{const{matrixRow:c}=st(this,Y,Jt).call(this,a);c<0||a.querySelectorAll("td, th").forEach(l=>{const u=parseInt(l.dataset.col,10);if(isNaN(u))return;const g=parseInt(l.rowSpan||1,10),b=parseInt(l.colSpan||1,10),f=c+g-1,y=u+b-1;f>=r&&c<=s&&y>=e&&u<=n&&(l.classList.add("selected"),c<=r&&l.classList.add("selected-top"),f>=s&&l.classList.add("selected-bottom"),u<=e&&l.classList.add("selected-left"),y>=n&&l.classList.add("selected-right"))})})})},"render"));p(this,M,r),st(this,Y,As).call(this),t(this,M).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,ft).startRow>=0&&t(this,ft).startCol>=0&&this.render()})}),x.log("๐ฏ [CellSelection] Initialized")}setFocus(r,e){t(this,M).querySelectorAll(".ng-part-body tr.selected-start").forEach(n=>{n.classList.remove("selected-start"),n.querySelectorAll("td.selected-start").forEach(o=>{o.classList.remove("selected-start")})});const s=t(this,M).querySelector(`.ng-part-body tr[data-matrix-row="${r}"] td[data-col="${e}"]`);s&&(s==null||s.classList.add("selected-start"),t(this,M).querySelectorAll(`.ng-part-body tr[data-row="${s==null?void 0:s.dataset.row}"]`).forEach(n=>{n==null||n.classList.add("selected-start")}))}setRange(r,e,s,n){x.log(`๐ [CellSelection.setRange] Input -> startRow: ${r}, startCol: ${e}, endRow: ${s}, endCol: ${n}`);let o=Math.min(r,s),i=Math.max(r,s),a=Math.min(e,n),c=Math.max(e,n);const l=t(this,M).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body");let u=!0,g=0;for(;u&&g<5;)u=!1,g++,l.forEach(b=>{b.querySelectorAll("tbody tr").forEach(f=>{if(f.classList.contains("nodata"))return;const{matrixRow:y}=st(this,Y,Jt).call(this,f);y<0||f.querySelectorAll("td, th").forEach(v=>{const S=parseInt(v.dataset.col,10);if(isNaN(S))return;const m=parseInt(v.rowSpan||1,10),_=parseInt(v.colSpan||1,10),C=y+m-1,z=S+_-1;if(C>=o&&y<=i&&z>=a&&S<=c){const ys=Math.min(o,y),ms=Math.max(i,C),ws=Math.min(a,S),xs=Math.max(c,z);(ys!==o||ms!==i||ws!==a||xs!==c)&&(o=ys,i=ms,a=ws,c=xs,u=!0)}})})});p(this,ft,{startRow:o,startCol:a,endRow:i,endCol:c}),this.render()}};M=new WeakMap,ft=new WeakMap,Y=new WeakSet,Jt=d(function(r){if(!r)return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const e=parseInt(r.dataset.row,10);if(isNaN(e))return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const s=r.closest("tbody"),o=Array.from(s.querySelectorAll("tr:not(.nodata)")).filter(l=>parseInt(l.dataset.row,10)===e),i=o.indexOf(r),a=o.length>0?o.length:1,c=e*a+(i>=0?i:r.sectionRowIndex%a);return{dataRow:e,subRowIndex:i,matrixRow:c}},"#getMatrixRow"),As=d(function(){const r=t(this,M).querySelector(".ng-container-top");if(!r){x.log("โ [CellSelection] .ng-container-top not found!");return}r.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,M).style.userSelect="none",t(this,M).style.webkitUserSelect="none";const n=s.closest("tr"),{matrixRow:o}=st(this,Y,Jt).call(this,n),i=parseInt(s.dataset.col,10);if(o<0){t(this,M).style.userSelect="",t(this,M).style.webkitUserSelect="";return}this.setFocus(o,i),this.setRange(o,i,o,i);let a=o,c=i;const l=d(g=>{const b=document.elementFromPoint(g.clientX,g.clientY);let f=b==null?void 0:b.closest("td, th");if(!f||!t(this,M).contains(f)){const m=t(this,M).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");for(const _ of m){const C=_.getBoundingClientRect();if(g.clientX>=C.left&&g.clientX<=C.right&&g.clientY>=C.top&&g.clientY<=C.bottom){f=_;break}}}if(!f||f.dataset.row===void 0||f.dataset.col===void 0||f.closest("tr").classList.contains("nodata"))return;const y=f.closest("tr"),{matrixRow:v}=st(this,Y,Jt).call(this,y),S=parseInt(f.dataset.col,10);v<0||a===v&&c===S||(a=v,c=S,this.setRange(o,i,v,S))},"onMouseMove"),u=d(()=>{x.log("๐ฑ๏ธ [MouseUp] Drag ended."),t(this,M).style.userSelect="",t(this,M).style.webkitUserSelect="",document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",u)},"onMouseUp");document.addEventListener("mousemove",l),document.addEventListener("mouseup",u)})},"#initEvents"),d(Ge,"CellSelection");let Ie=Ge;const ts=class ts{constructor(r){h(this,mt);h(this,H);h(this,_t);h(this,X,null);h(this,j,null);h(this,Je,-1);h(this,Qe,-1);h(this,de,d(r=>{const e=t(this,H).querySelectorAll(`.ng-part-body td[data-row="${r}"]`);if(!e||e.length===0)return 0;let s=1/0;return e.forEach(n=>{const o=parseInt(n.dataset.col,10);!isNaN(o)&&window.getComputedStyle(n).display!=="none"&&(s=Math.min(s,o))}),s===1/0?0:s},"#getMinCol"));h(this,Dt,d(r=>{const e=t(this,H).querySelectorAll(`.ng-part-body td[data-row="${r}"]`);if(!e||e.length===0)return 0;let s=0;return e.forEach(n=>{const o=parseInt(n.dataset.col,10);!isNaN(o)&&window.getComputedStyle(n).display!=="none"&&(s=Math.max(s,o))}),s},"#getMaxCol"));h(this,Ot,d(r=>{const e=[];return r.forEach(s=>e.push(...Array.from(s.querySelectorAll("td")))),e.length===0?null:(e.sort((s,n)=>parseInt(s.dataset.col,10)-parseInt(n.dataset.col,10)),e[e.length-1])},"#getMaxColCell"));h(this,Wt,d((r,e)=>{const s=t(this,H).querySelector(`.ng-part-body tr[data-matrix-row="${r}"] td[data-col="${e}"]`);return e+(s.colSpan||1)},"#getNextCol"));h(this,zt,d((r,e)=>{if(e<=0)return 0;const s=t(this,j)?Array.from(t(this,j).querySelectorAll("td, th")):[],n=new Set;s.forEach(i=>{const a=parseInt(i.dataset.col,10);!isNaN(a)&&window.getComputedStyle(i).display!=="none"&&n.add(a)}),n.size===0&&t(this,wt).call(this,r).forEach(a=>{Array.from(a.querySelectorAll("td, th")).forEach(c=>{const l=parseInt(c.dataset.col,10);!isNaN(l)&&window.getComputedStyle(c).display!=="none"&&n.add(l)})});const o=Array.from(n).filter(i=>i<e);return o.length===0?Math.max(0,e-1):Math.max(...o)},"#getPreviousCol"));h(this,wt,d(r=>{const e=t(this,H).querySelectorAll(".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"),s=[];return e.forEach(n=>{const o=Array.from(n.querySelectorAll("tbody tr"));for(const i of o){const a=parseInt(i.dataset.row,10),c=o.filter(y=>parseInt(y.dataset.row,10)===a),l=c.length>0?c.length:1,u=c.indexOf(i),g=a*l+(u>=0?u:0);if(g===r){s.push(i);break}const b=Array.from(i.querySelectorAll("td"));let f=!1;for(const y of b){const v=parseInt(y.rowSpan||1,10);if(v>1&&r>=g&&r<g+v){s.push(i),f=!0;break}}if(f)break}}),s},"#findTargetTrsByMatrix"));h(this,fe,d((r,e,s,n)=>{const o=n!==void 0?n:r*1+e;for(const i of Array.from(t(this,H).querySelectorAll(".ng-part-body tbody tr"))){const a=parseInt(i.dataset.row,10),c=t(this,H).templateLength,l=parseInt(i.dataset.subrow,10),u=a*c+(l>=0?l:0);for(const g of Array.from(i.querySelectorAll("td"))){const b=parseInt(g.dataset.col,10),f=parseInt(g.colSpan||1,10),y=parseInt(g.rowSpan||1,10);if(!isNaN(b)&&s>=b&&s<b+f&&o>=u&&o<u+y&&window.getComputedStyle(g).display!=="none")return g}}return null},"#getNearElement"));p(this,H,r),p(this,_t,r.getRootNode().host),st(this,mt,qs).call(this),x.log("๐ฏ [CellNavigation] Initialized")}get currentCell(){return t(this,X)}set currentCell(r){r&&(p(this,X,r),r.focus({preventScroll:!0}),p(this,j,r.closest("tr")),t(this,H).selection.setFocus(t(this,j).dataset.matrixRow,t(this,X).dataset.col))}moveCell(r){if(x.log(t(this,X)),!t(this,X))return;const e=t(this,X),s=parseInt(e.dataset.row,10),n=parseInt(e.dataset.col,10),o=t(this,H).templateLength,i=parseInt(t(this,j).dataset.subrow,10),a=s*o+(i>=0?i:0);let c=a,l=n;switch(r.code){case"Tab":if(r.preventDefault(),r.shiftKey){if(l=t(this,zt).call(this,a,n),l<0&&a>0){c=a-1;const b=t(this,wt).call(this,c),f=t(this,Ot).call(this,b);l=f?parseInt(f.dataset.col,10):0}}else{l=t(this,Wt).call(this,a,n);const b=t(this,wt).call(this,a),f=t(this,Ot).call(this,b),y=f?parseInt(f.dataset.col,10)+parseInt(f.colSpan||1,10):0;l>=y&&(c=a+1,l=0)}break;case"ArrowRight":l=t(this,Wt).call(this,a,n);break;case"ArrowLeft":l=t(this,zt).call(this,a,n);break;case"ArrowDown":r.preventDefault(),c=a+(e.rowSpan||1),x.log("templateLength",o,"matrixRow:",a,"nextMatrixRow",c);break;case"ArrowUp":r.preventDefault(),c=Math.max(0,a-(e.rowSpan||1));break}switch(r.code){case"Tab":break;case"ArrowRight":if(x.log(l,t(this,Dt).call(this,s)),l>t(this,Dt).call(this,s))return;break;case"ArrowLeft":if(n<=t(this,de).call(this,s))return;break;case"ArrowDown":const f=t(this,_t).data.length*o-1;if(a+(e.rowSpan||1)>f)return;break;case"ArrowUp":if(a<=0)return;break}const u=Math.floor(c/o),g=c%o;t(this,H).rowManager.scrollToDataRow(u,()=>{let b=t(this,fe).call(this,u,g,l,c);this.currentCell=b,t(this,H).selection.setRange(t(this,j).dataset.matrixRow,b.dataset.col,t(this,j).dataset.matrixRow,b.dataset.col),st(this,mt,Es).call(this,b)})}};H=new WeakMap,_t=new WeakMap,X=new WeakMap,j=new WeakMap,Je=new WeakMap,Qe=new WeakMap,mt=new WeakSet,Es=d(function(r){const e=t(this,H).querySelector(".ng-container-body .ng-part-body");if(!e)return;const s=r.getBoundingClientRect(),n=e.getBoundingClientRect();s.top<n.top?e.scrollTop-=n.top-s.top:s.bottom>n.bottom&&(e.scrollTop+=s.bottom-n.bottom),s.left<n.left?e.scrollLeft-=n.left-s.left:s.right>n.right&&(e.scrollLeft+=s.right-n.right)},"#ensureCellVisible"),de=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,Wt=new WeakMap,zt=new WeakMap,wt=new WeakMap,fe=new WeakMap,qs=d(function(){if(!t(this,H).querySelector(".ng-container-top")){x.log("โ [CellSelection] .ng-container-top not found!");return}t(this,H).addEventListener("mousedown",e=>{if(e.button!==0)return;const s=e.target.closest("td, th");s&&(s.dataset.row===void 0||s.dataset.col===void 0||(this.currentCell=s))}),t(this,H).addEventListener("keydown",e=>{["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.code)&&this.moveCell(e)})},"#initEvents"),d(ts,"CellNavigation");let Me=ts;const Ft=class Ft extends HTMLElement{constructor(){super();h(this,ue);h(this,Q);h(this,Bt);h(this,Pt);h(this,V,{table:null});T(this,"invalidate",d(()=>{x.log("sheet.invalidate()"),t(this,Q).refresh()},"invalidate"));T(this,"generate",d(e=>{if(x.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,ge).call(this),t(this,be).call(this);const s=this.querySelector(".ng-container-body .ng-part-header"),n=this.querySelector(".ng-container-body .ng-part-footer"),o=this.querySelector(".ng-nodata-overlay");s&&o&&(o.style.top=`${s.offsetHeight}px`),n&&o&&(o.style.bottom=`${n.offsetHeight}px`),t(this,Q).initialize(),setTimeout(()=>{var i;(i=this.querySelector("nine-table-hscrollbar"))==null||i.refresh()},0)},"generate"));h(this,ge,d(()=>{[{selector:".ng-container-body",type:null},{selector:".ng-container-left",type:"left"},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:n})=>{var o,i,a;(o=this.querySelector(`${s} .ng-part-header`))==null||o.appendChild(t(this,xt).call(this,t(this,V).table,n,"header")),(i=this.querySelector(`${s} .ng-virtual-spacer`))==null||i.before(t(this,xt).call(this,t(this,V).table,n,"body")),(a=this.querySelector(`${s} .ng-part-footer`))==null||a.appendChild(t(this,xt).call(this,t(this,V).table,n,"footer"))})},"#renderSplitContainers"));h(this,be,d(()=>{["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 o=0;n[0].querySelectorAll("col").forEach(i=>{const a=parseInt(i.getAttribute("width"),10);isNaN(a)||(o+=a)}),e==="body"?(s.style.flex="1",n.forEach(i=>{i.style.width=`${o}px`,i.style.minWidth=`${o}px`})):(s.style.flex=`0 0 ${o}px`,s.style.width=`${o}px`,n.forEach(i=>{i.style.width=`${o}px`,i.style.minWidth=`${o}px`}))})},"#updateContainerWidths"));h(this,xt,d((e,s,n)=>{const o=e.cloneNode(!0),i=o.querySelector("thead"),a=o.querySelector("tbody"),c=o.querySelector("tfoot");if(n==="header"){if(a&&a.remove(),c&&c.remove(),e.querySelector("tbody")){const u=document.createElement("tbody");u.className="fixed-tbody",o.appendChild(u)}}else n==="body"?(i&&i.remove(),c&&c.remove(),a&&(a.className="bindable-tbody")):n==="footer"&&(i&&i.remove(),a&&a.remove());return s==="left"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="left"&&l.remove()}):s==="right"?o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach(l=>{l.getAttribute("fixed")!=="right"&&l.remove()}):o.querySelectorAll("[fixed=left], [fixed=right]").forEach(l=>{l.remove()}),o},"#createSplitTable"));T(this,"getRowHeight",d(()=>t(this,Q).getRowHeight(),"getRowHeight"));T(this,"scrollToX",d(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollLeft=e)},"scrollToX"));T(this,"scrollToY",d(e=>{const s=this.querySelector(".ng-container-body .ng-part-body");s&&(s.scrollTop=e)},"scrollToY"));h(this,pe,d(()=>{t(this,ye).call(this),p(this,Bt,new Ie(this)),p(this,Pt,new Me(this))},"#init"));h(this,ye,d(()=>{const e=Ft.SCROLLBAR_SIZE;this.innerHTML=`
|
|
143
|
+
`;const e=h(()=>{const s=t(this,M).querySelector(".ng-sheet-body");if(!s){setTimeout(e,10);return}g(this,z,{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,nn).call(this),this.refresh()},"initWhenReady");e()}};en=new WeakMap,M=new WeakMap,$e=new WeakMap,z=new WeakMap,Ps=new WeakMap,mo=new WeakMap,Xs=new WeakMap,ze=new WeakMap,sn=new WeakMap,nn=new WeakMap,h(yo,"NineTableVScrollBar");let Ir=yo;customElements.get("nine-table-vscrollbar")||customElements.define("nine-table-vscrollbar",Ir);const ue={ID:0,DEPTH:1,NAME:2,CHILDREN:3},xo=class xo{constructor(r){d(this,$t);d(this,_s);d(this,Fe,[]);d(this,We,new Map);d(this,Oe,!1);E(this,"initialize",h(()=>{let r=[];const e=t(this,$t).sourceTable;e&&e.querySelectorAll('tbody tr[grouping="true"]').forEach(s=>{const i=s.querySelector('[cell-type="tree"]');i&&i.dataset.bind&&r.push(i.dataset.bind)}),g(this,Fe,r)},"initialize"));g(this,$t,r),g(this,_s,t(this,$t).getRootNode().host)}get columns(){return t(this,Fe)}get groupMap(){return t(this,We)}apply(){if(v.log("==================","Grouping.Apply"),t(this,Oe))return;g(this,Oe,!0);let r=[];const e=t(this,$t).sourceTable;e&&e.querySelectorAll('tbody tr[grouping="true"]').forEach(s=>{const i=s.querySelector('[cell-type="tree"]');i&&i.dataset.bind&&r.push(i.dataset.bind)}),g(this,Fe,r),g(this,Oe,!1),t(this,$t).scrollToY(0),t(this,$t).view.refresh()}clear(){g(this,Fe,[]),t(this,We).clear(),g(this,Oe,!1),t(this,$t).scrollToY(0),t(this,$t).view.refresh()}setGroupMap(r){g(this,We,r)}getChildrenRowIds(r){return t(this,We).get(r)||[]}getChildrenRecords(r){const e=this.getChildrenRowIds(r),s=t(this,_s).data;return e.map(i=>s.getArray(i)).filter(Boolean)}};$t=new WeakMap,_s=new WeakMap,Fe=new WeakMap,We=new WeakMap,Oe=new WeakMap,h(xo,"GroupingManager");let qr=xo;const Rt=class Rt{static apply(r,e=[],s=[]){var c,u;if(!e||e.length===0)return{headers:[],renderItems:[],groupMap:new Map};const i=r.filter(p=>{var f;return!((f=p.__ng)!=null&&f.deleted)}),n=new Map,o=A(c=Rt,ft,ll).call(c,i,e,s),l=[],a=[];return A(u=Rt,ft,ol).call(u,o,0,e,l,a,n,""),{headers:l,renderItems:a,groupMap:n}}};ft=new WeakSet,ol=h(function(r,e,s,i,n,o,l){var u,p,f;let a=0;const c=e===s.length-1;for(let[b,m]of r.entries()){const y=l?`${l}_${a++}`:`g_${a++}`,x=A(u=Rt,ft,al).call(u,m);o.set(y,x);const w=[];w[ue.ID]=y,w[ue.DEPTH]=e,w[ue.NAME]=b,w[ue.CHILDREN]=x,w.__isGroupHeader=!0,w.__groupId=y,i.push(w),n.push({type:"group",record:w,groupId:y}),!c&&m instanceof Map?A(p=Rt,ft,ol).call(p,m,e+1,s,i,n,o,y):A(f=Rt,ft,cl).call(f,m).forEach(R=>{R.__isGroupHeader=!1,R.__groupId=y,i.push(R),n.push({type:"data",record:R,groupId:y})})}},"#flattenTree"),ll=h(function(r,e,s){var l;const i=s.indexOf(e[0]),n=e.slice(1),o=new Map;if(r.forEach(a=>{const c=i>=0?a.v[i]:"(Unknown)";o.has(c)||o.set(c,[]),o.get(c).push(a)}),n.length>0){const a=new Map;for(let[c,u]of o.entries())a.set(c,A(l=Rt,ft,ll).call(l,u,n,s));return a}return o},"#buildNestedMap"),al=h(function(r){var s;let e=[];if(r instanceof Map)for(let i of r.values())e=e.concat(A(s=Rt,ft,al).call(s,i));else Array.isArray(r)&&(e=e.concat(r.map(i=>{var n,o,l;return((n=i.__ng)==null?void 0:n.rowid)??((l=(o=i.m)==null?void 0:o._)==null?void 0:l[0])})));return e},"#collectLeafRowIds"),cl=h(function(r){var s;let e=[];if(r instanceof Map)for(let i of r.values())e=e.concat(A(s=Rt,ft,cl).call(s,i));else Array.isArray(r)&&(e=e.concat(r));return e},"#collectLeafRecords"),d(Rt,ft),h(Rt,"Grouping");let Mr=Rt;const wo=class wo{constructor(r){d(this,rn,3);d(this,Gs);d(this,L);d(this,Be);d(this,Us,new Map);d(this,te,[]);d(this,U,null);d(this,me,null);d(this,ee,0);d(this,ps);d(this,gs,!1);d(this,Ve,!1);E(this,"refresh",h((r=!1)=>{var i;if(!t(this,L).classList.contains("active"))return;const e=t(this,L).querySelector(".ng-sheet-body");if(!e)return;(!t(this,U)||t(this,U)<=0)&&(t(this,Ks).call(this),t(this,U)&&t(this,U)>0&&t(this,bs).call(this)),t(this,Pe).call(this,e.scrollTop,r),(i=t(this,L).querySelector("nine-table-vscrollbar"))==null||i.refresh()},"refresh"));d(this,Pe,h((r,e=!1)=>{var F,k;if(t(this,Ve)){t(this,on).call(this,r,e);return}const s=t(this,U);if(!s||s<=0)return;const i=t(this,L).view.getArray(),n=i.length;if(n===0){t(this,L).elements.scrollHolder.style.height="0px";return}const o=t(this,L).templateLength,l=(((F=t(this,L).elements.body.thead)==null?void 0:F.offsetHeight)||0)+(((k=t(this,L).elements.body.tfoot)==null?void 0:k.offsetHeight)||0)+t(this,L).elements.body.tbody.head.offsetHeight,a=t(this,L).querySelector(".ng-sheet-body").offsetHeight||0,c=Math.max(n*s+s*2+l-a,0),u=15e6,p=c>u;let f=1,b=c;p&&(f=u/c,b=u),t(this,L).elements.scrollHolder.style.height=`${b}px`;const m=p?r/f:r,y=Math.max(0,n-1),x=Math.min(m,c),w=Math.max(0,Math.min(Math.floor(x/s)-1,y)),S=x%s;t(this,L).elements.left.tbody.body.style.top=t(this,L).elements.body.tbody.body.style.top=t(this,L).elements.right.tbody.body.style.top=`-${S}px`;const R=t(this,Be).firstTr,C=R&&R.dataset.row!==void 0?parseInt(R.dataset.row,10):-1;!e&&C===w||([t(this,L).elements.left.tbody.body,t(this,L).elements.body.tbody.body,t(this,L).elements.right.tbody.body].forEach((D,_)=>{if(!D)return;D.querySelectorAll("tbody.body tr").forEach((lt,O)=>{const tt=w+Math.floor(O/o);if(tt>=n){lt.style.display="none",lt.dataset.matrixRow=null,lt.dataset.row=null;return}const St=i[tt];if(!St){lt.style.display="none";return}const P=St.m._[Dt.META.INDEX.ROWID];lt.style.display="",t(this,js).call(this,lt,St,P,tt)})}),t(this,L).selection.refresh())},"#handleScroll"));d(this,on,h((r,e=!1)=>{var F;v.log("handleGroupdScroll() start");const s=t(this,L).view.getArray()||[],i=s.length;if(i===0){t(this,L).elements.scrollHolder.style.height="0px";return}const n=t(this,L).querySelector(".ng-sheet-body .ng-sheet-body-content"),o=t(this,L).templateLength||1,l=h(k=>{if(k.type==="group"){const D=k.record[ue.DEPTH]||0;return t(this,te)[D]||t(this,U)/o}else{let D=0;const _=t(this,L).templateLength||1;let nt=0;for(let lt=0;lt<_-1;lt++)nt+=t(this,te)[lt]||0;return D=t(this,U)-nt,D>0?D:t(this,U)}},"getItemHeight");let a=0;const c=new Array(i);for(let k=0;k<i;k++){const D=l(s[k]);c[k]=D,a+=D}t(this,L).elements.scrollHolder.style.height=`${a}px`,v.log("*************",a);const u=t(this,L).clientHeight;let p=0,f=0;for(let k=0;k<i;k++){const D=c[k];if(p+D>r){f=k;break}p+=D,f=k}const b=r-p;n&&n.querySelectorAll("tbody").forEach(k=>{k.style.top=`-${Math.max(0,b)}px`});const m=t(this,Be).firstTr,y=m&&m.dataset.virtualIndex!==void 0?parseInt(m.dataset.virtualIndex,10):-1;if(!e&&y===f)return;const x=Math.ceil(u/(t(this,U)/o)),w=(((F=t(this,L).grouping.columns)==null?void 0:F.length)||1)*15,S=f,R=Math.min(i,f+x+w),C=s.slice(S,R);[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(k=>{const D=t(this,L).querySelector(`.ng-sheet-body ${k}`);if(!D)return;const _=Array.from(D.querySelectorAll("tbody.body tr"));for(let nt=0;nt<_.length;nt+=o){const lt=Math.floor(nt/o),O=C[lt],tt=_.slice(nt,nt+o);if(!O||lt>=C.length){tt.forEach(P=>{P.dataset.matrixRow=null,P.dataset.row=null,P.style.display="none"});continue}const St=f+lt;tt.forEach((P,$s)=>{var mr;const br=f+lt;P.dataset.virtualIndex=br,P.dataset.row=O.type==="data"?St:"";const ke=P.getAttribute("grouping")==="true";if(O.type==="group")if(ke){const Te=O.record[ue.DEPTH];$s===Te?(P.style.display="",t(this,ln).call(this,P,s,O.record,br)):P.style.display="none"}else P.style.display="none";else if(ke)P.style.display="none";else{P.style.display="";const Te=((mr=O.record.m)==null?void 0:mr.rowid)??0;t(this,js).call(this,P,O.record,Te,br)}})}}),t(this,L).selection.refresh(),v.log("handleGroupdScroll() end")},"#handleGroupedScroll"));d(this,ln,h((r,e,s,i)=>{const n=t(this,L).templateLength||1,o=parseInt(r.dataset.subrow,10)||0,l=i*n+o,a=s[ue.CHILDREN],c=t(this,Gs).data.getArray(),u=a?a.map(p=>c[p]).filter(Boolean):[];r.dataset.virtualIndex=i,r.dataset.row="",r.dataset.matrixRow=l,r.data=u,r.dataset.groupId=s[ue.ID],Array.from(r.cells).forEach(p=>{p.dataset.row=i;const f=Array.from(p.children).find(b=>b.tagName.toLowerCase().startsWith("cell-")||typeof b.refresh=="function");f!==void 0&&typeof f.refresh=="function"&&(f==null||f.refresh())})},"#bindGroupRowData"));d(this,js,h((r,e,s,i)=>{const n=t(this,L).templateLength||1,o=parseInt(r.dataset.subrow,10)||0,l=i*n+o;r.dataset.index=i,r.dataset.row=s,r.dataset.matrixRow=l,r.data=e,Array.from(r.cells).forEach(a=>{a.dataset.index=i,a.dataset.row=s;const c=Array.from(a.children).find(u=>u.tagName.toLowerCase().startsWith("cell-")&&typeof u.refresh=="function");c==null||c.refresh()})},"#bindRowData"));E(this,"initialize",h(()=>{g(this,Ve,!!t(this,L).sourceTable.querySelector("tbody tr[grouping='true']")),g(this,U,null),t(this,Us).clear(),g(this,Be,{scrollTables:t(this,L).querySelectorAll(".ng-sheet-body table"),firstTr:t(this,L).querySelector(".ng-sheet-body .ng-container-body tbody.body tr")}),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(e=>{const s=t(this,L).querySelector(`.ng-sheet-body ${e}`);if(!s)return;const i=s.querySelector("table");if(!i)return;const n=i.querySelector("tbody.body");if(!n)return;const l=Array.from(n.querySelectorAll("tr")).map(a=>a.cloneNode(!0));t(this,Us).set(e,l)});const r=t(this,L).querySelector(".ng-sheet-body");r&&(g(this,ee,r.clientHeight),t(this,Ks).call(this),t(this,bs).call(this),t(this,Pe).call(this,r.scrollTop,!0),r.addEventListener("scroll",()=>{var n;if(t(this,gs))return;const e=t(this,U)||0;(((n=t(this,L).view.getArray())==null?void 0:n.length)||0)*e<=r.clientHeight||(t(this,Pe).call(this,r.scrollTop),t(this,L).querySelector("nine-table-vscrollbar").refresh())},{passive:!0}))},"initialize"));E(this,"destroy",h(()=>{t(this,me)&&(t(this,me).disconnect(),g(this,me,null))},"destroy"));d(this,Ks,h(()=>{var n;if(!t(this,L).classList.contains("active")||!t(this,L).sourceTable)return;const r=(n=t(this,L).sourceTable)==null?void 0:n.querySelectorAll("tbody.body tr"),e=t(this,L).querySelector(".ng-sheet-body .ng-container-body tbody.body");e.querySelectorAll("tr").forEach(o=>o.remove());const s=document.createDocumentFragment();r.forEach(o=>s.appendChild(o.cloneNode(!0))),e.appendChild(s);const i=e.querySelectorAll("tr");g(this,te,[]),i.forEach(o=>{t(this,te).push(o.offsetHeight)}),i.forEach(o=>o.remove()),g(this,U,t(this,te).reduce((o,l)=>o+l,0)),t(this,Ys).call(this)},"#measureAndCacheHeight"));d(this,Ys,h(()=>{var r;if(v.log("[DEBUG #updateRowCount] sheetHeight:",t(this,ee),"cachedTemplateHeight:",t(this,U)),t(this,ee)>0&&t(this,U)>0){const e=Math.ceil(t(this,ee)/t(this,U));let s=t(this,rn);if(t(this,Ve)&&t(this,L).grouping){const i=((r=t(this,L).grouping.columns)==null?void 0:r.length)||1;s+=i*15}g(this,ps,e+s),v.log("[DEBUG #updateRowCount] calculated cachedRowCount:",t(this,ps))}},"#updateRowCount"));d(this,bs,h(()=>{v.log("rowManager.#renderAllContainers"),[".ng-container-body",".ng-container-left",".ng-container-right"].forEach(r=>{const e=t(this,L).querySelector(`.ng-sheet-body ${r}`);e&&e.querySelector("tbody")&&t(this,an).call(this,e)}),t(this,cn).call(this)},"#renderAllContainers"));d(this,an,h(r=>{let e=null;r.classList.contains("ng-container-left")?e="left":r.classList.contains("ng-container-right")&&(e="right");const s=Array.from(t(this,L).sourceTable.querySelectorAll("tbody.body tr")).map(o=>{const l=o.cloneNode(!0);return e==="left"?l.querySelectorAll("th,td").forEach(a=>{a.getAttribute("fixed")!=="left"&&a.remove()}):e==="right"?l.querySelectorAll("th,td").forEach(a=>{a.getAttribute("fixed")!=="right"&&a.remove()}):l.querySelectorAll("[fixed=left], [fixed=right]").forEach(a=>{a.remove()}),l});if(s.length===0)return;const i=r.querySelector("tbody.body");if(!i)return;i.querySelectorAll("tr").forEach(o=>o.remove());const n=document.createDocumentFragment();for(let o=0;o<t(this,ps);o++)s.forEach(l=>n.appendChild(l.cloneNode(!0)));i.appendChild(n),r.classList.contains("ng-container-body")&&(t(this,Be).firstTr=i.querySelector("tr"))},"#renderRows"));d(this,cn,h(()=>{var i,n,o;const r=t(this,L).querySelector(".ng-sheet-body .ng-container-left table"),e=t(this,L).querySelector(".ng-sheet-body .ng-container-body table"),s=t(this,L).querySelector(".ng-sheet-body .ng-container-right table");if(e){const l=r?Array.from(r.querySelectorAll("tbody tr")):[],a=Array.from(e.querySelectorAll("tbody tr")),c=s?Array.from(s.querySelectorAll("tbody tr")):[],u=Math.max(l.length,a.length,c.length);for(let p=0;p<u;p++){const f=[((i=l[p])==null?void 0:i.getBoundingClientRect().height)||0,((n=a[p])==null?void 0:n.getBoundingClientRect().height)||0,((o=c[p])==null?void 0:o.getBoundingClientRect().height)||0],b=Math.max(...f);b>0&&(l[p]&&(l[p].style.height=`${b}px`),a[p]&&(a[p].style.height=`${b}px`),c[p]&&(c[p].style.height=`${b}px`))}}},"#syncRowHeights"));d(this,hn,h(()=>{!t(this,L)||!(t(this,L)instanceof HTMLElement)||(g(this,me,new ResizeObserver(r=>{for(const e of r){if(!e.target.classList.contains("active"))continue;const i=e.contentRect.height;e.contentRect.width>0&&t(this,L).isAutoFitCol&&t(this,L).autoFit(!0),i>0&&t(this,ee)!==i&&(g(this,ee,i),t(this,Ys).call(this),t(this,U)!==null&&(t(this,bs).call(this),this.refresh()))}})),t(this,me).observe(t(this,L)))},"#initResizeObserver"));g(this,Gs,r.getRootNode().host),g(this,L,r),t(this,hn).call(this)}getRowHeight(){return t(this,te).reduce((r,e)=>r+e,0)}scrollToDataRow(r,e="top",s){var c,u;const i=t(this,L).querySelector(".ng-sheet-body");if(!i){typeof s=="function"&&s();return}const n=t(this,L).view.getArray(),o=(n==null?void 0:n.length)||0;if(o===0){typeof s=="function"&&s();return}const l=Math.max(0,Math.min(r,o-1));let a=0;if(t(this,Ve)){const p=Math.max(i.scrollHeight-i.clientHeight,1);a=l/Math.max(o-1,1)*p}else{const p=t(this,U);if(!p||p<=0){typeof s=="function"&&s();return}let f=l*p;t(this,L).templateLength;const b=(((c=t(this,L).elements.body.thead)==null?void 0:c.offsetHeight)||0)+(((u=t(this,L).elements.body.tfoot)==null?void 0:u.offsetHeight)||0)+t(this,L).elements.body.tbody.head.offsetHeight,m=t(this,L).querySelector(".ng-sheet-body").offsetHeight||0,y=Math.max(o*p+p*2+b-m,0),x=15e6,w=y>x;let S=1;w&&(S=x/y),a=f*S}g(this,gs,!0),i.scrollTop=a,t(this,Pe).call(this,a),requestAnimationFrame(()=>{requestAnimationFrame(()=>{g(this,gs,!1),typeof s=="function"&&s()})})}};rn=new WeakMap,Gs=new WeakMap,L=new WeakMap,Be=new WeakMap,Us=new WeakMap,te=new WeakMap,U=new WeakMap,me=new WeakMap,ee=new WeakMap,ps=new WeakMap,gs=new WeakMap,Ve=new WeakMap,Pe=new WeakMap,on=new WeakMap,ln=new WeakMap,js=new WeakMap,Ks=new WeakMap,Ys=new WeakMap,bs=new WeakMap,an=new WeakMap,cn=new WeakMap,hn=new WeakMap,h(wo,"RowManager");let Hr=wo;const mt=16,pt=class pt{static compile(r){var s;const e=r.cloneNode(!0);return pt.resetColIndex(e,e.querySelectorAll("thead tr")),pt.resetColIndex(e,e.querySelectorAll('tbody.body tr[grouping="true"]')),pt.resetColIndex(e,e.querySelectorAll('tbody.body tr:not([grouping="true"])')),pt.resetColIndex(e,e.querySelectorAll("tfoot tr")),A(s=pt,Zs,hl).call(s,e),e}static recompile(r){var e;return pt.resetColIndex(r,r.querySelectorAll("thead tr")),pt.resetColIndex(r,r.querySelectorAll('tbody.body tr[grouping="true"]')),pt.resetColIndex(r,r.querySelectorAll('tbody.body tr:not([grouping="true"])')),pt.resetColIndex(r,r.querySelectorAll("tfoot tr")),A(e=pt,Zs,hl).call(e,r),r}static resetColIndex(r,e){const s=r.querySelectorAll("colgroup col"),i=Array.from({length:e.length},()=>Array(s.length).fill(null));e.forEach((n,o)=>{n.dataset.subrow=o;let l=0;n.querySelectorAll("th, td").forEach(a=>{for(;l<s.length&&i[o][l]!==null;)l++;a.dataset.col=l;const c=a.rowSpan||1,u=a.colSpan||1;for(let p=0;p<c;p++)for(let f=0;f<u;f++)o+p<e.length&&l+f<s.length&&(i[o+p][l+f]=a);l+=u})})}};Zs=new WeakSet,hl=h(function(r){r.querySelectorAll("colgroup col").forEach((e,s)=>{e.setAttribute("data-col",s);const i=e.getAttribute("fixed");r.querySelectorAll(`[data-col="${s}"]`).forEach(n=>{i?n.setAttribute("fixed",i):n.removeAttribute("fixed")})})},"#syncColAttributes"),d(pt,Zs),h(pt,"TableCompiler");let fe=pt;const vo=class vo{constructor(r){d(this,se);d(this,J);d(this,Js,{startRow:-1,startCol:-1,endRow:-1,endCol:-1});E(this,"refresh",h(()=>{this.render()},"refresh"));E(this,"render",h(()=>{var l;const{startRow:r,startCol:e,endRow:s,endCol:i}=t(this,Js),n=t(this,J).querySelectorAll(".ng-sheet-body-content .ng-container-left, .ng-sheet-body-content .ng-container-body, .ng-sheet-body-content .ng-container-right");if(n.forEach(a=>{a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right, .selected-start").forEach(c=>{c.classList.remove("selected","selected-top","selected-bottom","selected-left","selected-right","selected-start")}),a.querySelectorAll("tr.selected-start").forEach(c=>{c.classList.remove("selected-start")})}),r<0||e<0)return;n.forEach(a=>{a.querySelectorAll("tbody tr").forEach(c=>{const{matrixRow:u}=A(this,se,Oi).call(this,c);u<0||c.querySelectorAll("td, th").forEach(p=>{const f=parseInt(p.dataset.col,10);if(isNaN(f))return;const b=parseInt(p.rowSpan||1,10),m=parseInt(p.colSpan||1,10),y=u+b-1,x=f+m-1;y>=r&&u<=s&&x>=e&&f<=i&&(p.classList.add("selected"),u<=r&&p.classList.add("selected-top"),y>=s&&p.classList.add("selected-bottom"),f<=e&&p.classList.add("selected-left"),x>=i&&p.classList.add("selected-right"))})})});const o=t(this,J).querySelector(`.ng-sheet-body-content tr[data-matrix-row="${r}"] td[data-col="${e}"]`);o&&(o.classList.add("selected-start"),(l=o.closest("tr"))==null||l.classList.add("selected-start"))},"render"));g(this,J,r),A(this,se,kl).call(this),v.log("๐ฏ [CellSelection] Initialized (New Structure Compatible)")}setFocus(r,e){var i;t(this,J).querySelectorAll("tr.selected-start").forEach(n=>{n.classList.remove("selected-start"),n.querySelectorAll("td.selected-start").forEach(o=>{o.classList.remove("selected-start")})});const s=t(this,J).querySelector(`.ng-sheet-body-content tr[data-matrix-row="${r}"] td[data-col="${e}"]`);s&&(s.classList.add("selected-start"),(i=s.closest("tr"))==null||i.classList.add("selected-start"))}setRange(r,e,s,i){let n=Math.min(r,s),o=Math.max(r,s),l=Math.min(e,i),a=Math.max(e,i);const c=t(this,J).querySelectorAll(".ng-sheet-body-content .ng-container-left, .ng-sheet-body-content .ng-container-body, .ng-sheet-body-content .ng-container-right");let u=!0,p=0;for(;u&&p<5;)u=!1,p++,c.forEach(f=>{f.querySelectorAll("tbody tr").forEach(b=>{if(b.classList.contains("nodata"))return;const{matrixRow:m}=A(this,se,Oi).call(this,b);m<0||b.querySelectorAll("td, th").forEach(y=>{const x=parseInt(y.dataset.col,10);if(isNaN(x))return;const w=parseInt(y.rowSpan||1,10),S=parseInt(y.colSpan||1,10),R=m+w-1,C=x+S-1;if(R>=n&&m<=o&&C>=l&&x<=a){const k=Math.min(n,m),D=Math.max(o,R),_=Math.min(l,x),nt=Math.max(a,C);(k!==n||D!==o||_!==l||nt!==a)&&(n=k,o=D,l=_,a=nt,u=!0)}})})});g(this,Js,{startRow:n,startCol:l,endRow:o,endCol:a}),this.render()}};J=new WeakMap,Js=new WeakMap,se=new WeakSet,Oi=h(function(r){if(!r)return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const e=parseInt(r.dataset.row,10);if(isNaN(e))return{dataRow:-1,subRowIndex:-1,matrixRow:-1};const s=r.closest("tbody"),n=Array.from(s.querySelectorAll("tr:not(.nodata)")).filter(c=>parseInt(c.dataset.row,10)===e),o=n.indexOf(r),l=n.length>0?n.length:1,a=e*l+(o>=0?o:r.sectionRowIndex%l);return{dataRow:e,subRowIndex:o,matrixRow:a}},"#getMatrixRow"),kl=h(function(){const r=t(this,J).querySelector(".ng-sheet-body");if(!r){v.log("โ [CellSelection] .ng-sheet-body not found!");return}r.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,J).style.userSelect="none",t(this,J).style.webkitUserSelect="none";const i=s.closest("tr"),{matrixRow:n}=A(this,se,Oi).call(this,i),o=parseInt(s.dataset.col,10);if(n<0){t(this,J).style.userSelect="",t(this,J).style.webkitUserSelect="";return}this.setFocus(n,o),this.setRange(n,o,n,o);let l=n,a=o;const c=h(p=>{const f=document.elementFromPoint(p.clientX,p.clientY);let b=f==null?void 0:f.closest("td, th");if(!b||!t(this,J).contains(b)){const w=t(this,J).querySelectorAll(".ng-sheet-body-content tbody tr:not(.nodata) td, .ng-sheet-body-content tbody tr:not(.nodata) th");for(const S of w){const R=S.getBoundingClientRect();if(p.clientX>=R.left&&p.clientX<=R.right&&p.clientY>=R.top&&p.clientY<=R.bottom){b=S;break}}}if(!b||b.dataset.row===void 0||b.dataset.col===void 0||b.closest("tr").classList.contains("nodata"))return;const m=b.closest("tr"),{matrixRow:y}=A(this,se,Oi).call(this,m),x=parseInt(b.dataset.col,10);y<0||l===y&&a===x||(l=y,a=x,this.setRange(n,o,y,x))},"onMouseMove"),u=h(()=>{t(this,J).style.userSelect="",t(this,J).style.webkitUserSelect="",document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)},"onMouseUp");document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)})},"#initEvents"),h(vo,"CellSelection");let Nr=vo;const Eo=class Eo{constructor(r){d(this,gt);d(this,$);d(this,Qs);d(this,ye,null);d(this,Xt,null);d(this,So,-1);d(this,Ao,-1);d(this,ti,h(r=>{const e=t(this,$).querySelectorAll(`.ng-sheet-body td[data-row="${r}"]`);if(!e||e.length===0)return 0;let s=1/0;return e.forEach(i=>{const n=parseInt(i.dataset.col,10);!isNaN(n)&&window.getComputedStyle(i).display!=="none"&&(s=Math.min(s,n))}),s===1/0?0:s},"#getMinCol"));d(this,ei,h(r=>{const e=t(this,$).querySelectorAll(`.ng-sheet-body td[data-row="${r}"]`);if(!e||e.length===0)return 0;let s=0;return e.forEach(i=>{const n=parseInt(i.dataset.col,10);!isNaN(n)&&window.getComputedStyle(i).display!=="none"&&(s=Math.max(s,n))}),s},"#getMaxCol"));d(this,si,h(r=>{const e=[];return r.forEach(s=>e.push(...Array.from(s.querySelectorAll("td")))),e.length===0?null:(e.sort((s,i)=>parseInt(s.dataset.col,10)-parseInt(i.dataset.col,10)),e[e.length-1])},"#getMaxColCell"));d(this,ii,h((r,e)=>{const s=t(this,$).querySelector(`.ng-sheet-body tr[data-matrix-row="${r}"] td[data-col="${e}"]`)||t(this,$).querySelector(`.ng-sheet-body td[data-col="${e}"]`),i=(s==null?void 0:s.colSpan)||1,n=e+i;return v.log(`๐ [#getNextCol] current col: ${e}, found td colSpan: ${i}, calculated next col: ${n}`),n},"#getNextCol"));d(this,ni,h((r,e)=>{if(e<=0)return 0;const s=t(this,Xt)?Array.from(t(this,Xt).querySelectorAll("td, th")):[],i=new Set;s.forEach(o=>{const l=parseInt(o.dataset.col,10);!isNaN(l)&&window.getComputedStyle(o).display!=="none"&&i.add(l)}),i.size===0&&t(this,ms).call(this,r).forEach(l=>{Array.from(l.querySelectorAll("td, th")).forEach(a=>{const c=parseInt(a.dataset.col,10);!isNaN(c)&&window.getComputedStyle(a).display!=="none"&&i.add(c)})});const n=Array.from(i).filter(o=>o<e);return n.length===0?Math.max(0,e-1):Math.max(...n)},"#getPreviousCol"));d(this,ms,h(r=>{const e=t(this,$).querySelectorAll(".ng-sheet-body .ng-container-left, .ng-sheet-body .ng-container-body, .ng-sheet-body .ng-container-right"),s=[];return e.forEach(i=>{const n=Array.from(i.querySelectorAll("tbody tr"));for(const o of n){const l=A(this,gt,cs).call(this,o);if(l===r){s.push(o);break}const a=Array.from(o.querySelectorAll("td"));let c=!1;for(const u of a){const p=parseInt(u.rowSpan||1,10);if(p>1&&r>=l&&r<l+p){s.push(o),c=!0;break}}if(c)break}}),s},"#findTargetTrsByMatrix"));d(this,ri,h((r,e,s,i)=>{const n=i!==void 0?i:r*(t(this,$).templateLength||1)+e,o=t(this,$).templateLength||1,l=t(this,$).querySelectorAll(".ng-sheet-body, .ng-container-left, .ng-container-body, .ng-container-right, .ng-part-body"),a=new Set;l.forEach(c=>{c.querySelectorAll("tbody tr").forEach(u=>a.add(u))});for(const c of Array.from(a)){const u=parseInt(c.dataset.row,10);if(isNaN(u))continue;const p=c.closest("tbody"),b=(p?Array.from(p.querySelectorAll(`tr[data-row="${u}"]`)):[c]).indexOf(c);for(const m of Array.from(c.querySelectorAll("td"))){const y=parseInt(m.dataset.col,10),x=parseInt(m.colSpan||1,10),w=parseInt(m.rowSpan||1,10);if(isNaN(y)||window.getComputedStyle(m).display==="none")continue;const S=u,R=b,C=S*o+R,F=C+w-1;if(n>=C&&n<=F&&s>=y&&s<y+x)return m}}return null},"#getNearElement"));g(this,$,r),g(this,Qs,r.getRootNode().host),A(this,gt,Tl).call(this),v.log("๐ฏ [CellNavigation] Initialized (Diagnostic Logging Restored)")}get currentCell(){return t(this,ye)}set currentCell(r){var s;if(!r)return;g(this,ye,r),r.focus({preventScroll:!0}),g(this,Xt,r.closest("tr"));const e=A(this,gt,cs).call(this,t(this,Xt));v.log(`๐ [setCurCell] Active set -> dataRow: ${r.dataset.row}, subrow: ${(s=r.closest("tr"))==null?void 0:s.dataset.subrow}, matrixRow: ${e}, col: ${r.dataset.col}`),t(this,$).selection.setFocus(e,t(this,ye).dataset.col)}moveCell(r){var m;if(!["TH","TD"].includes(r.target.tagName))return;if(!t(this,ye)||!t(this,Xt)){v.log("โ ๏ธ [moveCell] currentCell or currentTr is missing!");return}const e=t(this,ye),s=parseInt(e.dataset.row,10),i=parseInt(e.dataset.col,10),n=t(this,$).templateLength||1,o=A(this,gt,cs).call(this,t(this,Xt));let l=o,a=i;switch(r.code){case"ArrowDown":r.preventDefault(),l=o+(e.rowSpan||1);break;case"ArrowUp":r.preventDefault(),l=Math.max(0,o-(e.rowSpan||1));break;case"ArrowRight":a=t(this,ii).call(this,o,i);break;case"ArrowLeft":a=t(this,ni).call(this,o,i);break;case"Tab":if(r.preventDefault(),r.shiftKey){if(a=t(this,ni).call(this,o,i),a<0&&o>0){l=o-1;const y=t(this,ms).call(this,l),x=t(this,si).call(this,y);a=x?parseInt(x.dataset.col,10):0}}else{a=t(this,ii).call(this,o,i);const y=t(this,ms).call(this,o),x=t(this,si).call(this,y),w=x?parseInt(x.dataset.col,10)+parseInt(x.colSpan||1,10):0;a>=w&&(l=o+1,a=0)}break}switch(r.code){case"ArrowDown":const x=t(this,Qs).data.length*n-1;if(o+(e.rowSpan||1)>x)return;break;case"ArrowUp":if(o<=0)return;break;case"ArrowRight":if(i===a||a>t(this,ei).call(this,s,i))return;break;case"ArrowLeft":if(i===a||a<t(this,ti).call(this,s,i))return;break;case"Tab":if(r.shiftKey){if(i===a||a<t(this,ti).call(this,s,i))return}else if(i===a||a>t(this,ei).call(this,s,i))return;break}v.log("========");const u=(((m=t(this,$).view.getArray())==null?void 0:m.length)||0)*n-1;l=Math.max(0,Math.min(l,u)),v.log(`โจ๏ธ [Key: ${r.code}] Current matrixRow: ${o} -> Target nextMatrixRow: ${l}, nextCol: ${a}`);const p=Math.floor(l/n),f=l%n;h((y=0)=>{let x=t(this,ri).call(this,p,f,a,l);if(x){v.log(`โ
[Found Cell] Attempt ${y} -> dataRow: ${x.dataset.row}, col: ${x.dataset.col}`),this.currentCell=x;const w=A(this,gt,cs).call(this,t(this,Xt));t(this,$).selection.setRange(w,x.dataset.col,w,x.dataset.col),A(this,gt,dl).call(this,x)}else v.log(`๐ [Scroll Trigger] Cell not found in DOM, invoking rowManager.scrollToDataRow(${p})`),t(this,$).rowManager.scrollToDataRow(p,"bottom",()=>{v.log("nextDataRow",p),h(()=>{let S=t(this,ri).call(this,p,f,a,l);if(S){v.log(`โ
[Found After Scroll] RetryLoop success -> dataRow: ${S.dataset.row}`),this.currentCell=S;const R=S.closest("tr"),C=A(this,gt,cs).call(this,R);t(this,$).selection.setRange(C,S.dataset.col,C,S.dataset.col),A(this,gt,dl).call(this,S)}},"retryLoop")()})},"attemptFindAndMove")()}};$=new WeakMap,Qs=new WeakMap,ye=new WeakMap,Xt=new WeakMap,So=new WeakMap,Ao=new WeakMap,gt=new WeakSet,cs=h(function(r){if(!r)return 0;const e=parseInt(r.dataset.row,10)||0,s=t(this,$).templateLength||1,i=parseInt(r.dataset.matrixRow,10);if(!isNaN(i))return i;const n=r.closest("tbody");if(n){const a=Array.from(n.querySelectorAll(`tr[data-row="${e}"]`)).indexOf(r);if(a>=0)return e*s+a}const o=parseInt(r.dataset.subrow,10)||0;return e*s+o},"#getMatrixRowFromTr"),dl=h(function(r){const e=t(this,$).querySelector(".ng-sheet-body"),s=t(this,$).querySelector(".ng-sheet-body .ng-container-body"),i=t(this,$).querySelector(".ng-sheet-header .ng-container-body");if(!e||!s)return;const n=r.getBoundingClientRect(),o=e.getBoundingClientRect(),l=s.getBoundingClientRect(),a=i?i.getBoundingClientRect():null;v.log(`๐ [DIAGNOSTIC VISIBILITY]
|
|
144
|
+
- cell.dataset.col: ${r.dataset.col}
|
|
145
|
+
- cellRect (left: ${n.left}, right: ${n.right})
|
|
146
|
+
- containerRect (left: ${l.left}, right: ${l.right}, width: ${l.width}, scrollLeft: ${s.scrollLeft}, scrollWidth: ${s.scrollWidth}, clientWidth: ${s.clientWidth})
|
|
147
|
+
- viewportRect (width: ${o.width})
|
|
148
|
+
- headerBody (scrollLeft: ${i==null?void 0:i.scrollLeft}, width: ${a==null?void 0:a.width})
|
|
149
|
+
`);const c=n.top<o.top,u=n.bottom>o.bottom;if(c||u){const p=parseInt(r.dataset.row,10),f=r.dataset.col,b=r.closest("tr"),m=(b==null?void 0:b.dataset.subrow)||0;!isNaN(p)&&t(this,$).rowManager&&(v.log("11111111111"),t(this,$).rowManager.scrollToDataRow(p,"top",()=>{const y=t(this,$).querySelector(`.ng-sheet-body tr[data-row="${p}"][data-subrow="${m}"] td[data-col="${f}"]`);if(y){this.currentCell=y;const x=y.closest("tr"),w=A(this,gt,cs).call(this,x);t(this,$).selection.setRange(w,f,w,f)}}))}n.left<l.left?(v.log("โ๏ธ [Scroll X Left] cell out of left bound"),s.scrollLeft-=l.left-n.left+10,t(this,$).scrollToX(s.scrollLeft)):n.right>l.right&&(v.log(`โ๏ธ [Scroll X Right] cell out of right bound. cellRect.right: ${n.right} > containerRect.right: ${l.right}`),s.scrollLeft+=n.right-l.right+10,t(this,$).scrollToX(s.scrollLeft))},"#ensureCellVisible"),ti=new WeakMap,ei=new WeakMap,si=new WeakMap,ii=new WeakMap,ni=new WeakMap,ms=new WeakMap,ri=new WeakMap,Tl=h(function(){t(this,$).addEventListener("mousedown",r=>{if(r.button!==0)return;const e=r.target.closest("td, th");e&&(e.dataset.row===void 0||e.dataset.col===void 0||(this.currentCell=e))}),t(this,$).addEventListener("keydown",r=>{["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(r.code)&&this.moveCell(r)})},"#initEvents"),h(Eo,"CellNavigation");let Dr=Eo;const Bi=2,Lo=class Lo{constructor(r){d(this,Tt);d(this,X);d(this,Xe);d(this,Ct);d(this,_e);d(this,_t,null);d(this,kt,null);d(this,Gt,null);d(this,Ut,null);d(this,ys,0);d(this,jt,0);d(this,xe,0);d(this,oi,0);d(this,li,0);d(this,ai,h(r=>{const e=r.target.closest("thead");if(!e)return;const s=r.target.closest("th, td");if(e.querySelectorAll(".resizable-edge").forEach(a=>{a!==s&&a.classList.remove("resizable-edge")}),!s||s.dataset.col===void 0||s.getAttribute("collapsed")==="true")return;const i=s.getBoundingClientRect(),n=r.clientX-i.left,o=n<=Bi,l=i.width-n<=Bi;if(o){const a=s.previousElementSibling;if(!a||a.getAttribute("collapsed")==="true"){s.classList.remove("resizable-edge");return}}o||l?s.classList.add("resizable-edge"):s.classList.remove("resizable-edge")},"#onPointerMove"));d(this,ci,h(r=>{if(v.log(r.actualTarget,r.target),!r.actualTarget.closest("thead"))return;const s=r.actualTarget.closest("th, td");if(v.log(s,r.actualTarget),!s||!s.classList.contains("resizable-edge"))return;r.preventDefault();const i=s.getBoundingClientRect(),n=r.clientX-i.left;let o=s;if(n<=Bi){const y=s.previousElementSibling;if(y&&y.dataset.col!==void 0&&y.getAttribute("collapsed")!=="true")o=y;else if(!s.previousElementSibling)return}g(this,Ut,o),g(this,Gt,A(this,Tt,ul).call(this,o));const l=t(this,X).querySelector(`.ng-container-${t(this,Gt)}`);if(!l)return;const a=parseInt(o.dataset.col,10),c=o.colSpan||1;if(g(this,_t,a+c-1),A(this,Tt,yr).call(this,o)){g(this,kt,t(this,_t)+1);const y=l.querySelector(`col[data-col="${t(this,kt)}"]`);y?g(this,xe,parseInt(y.getAttribute("width"),10)||100):g(this,kt,null)}else g(this,kt,null);const p=o.getBoundingClientRect(),f=t(this,X).getBoundingClientRect();g(this,oi,p.width),g(this,li,p.left-f.left);const b=l.querySelector(`col[data-col="${t(this,_t)}"]`),m=b==null?void 0:b.getAttribute("width");g(this,jt,m&&!isNaN(parseInt(m,10))?parseInt(m,10):p.width/c),g(this,ys,r.clientX),t(this,Ct)&&(t(this,Ct).classList.add("active"),A(this,Tt,fl).call(this,r.clientX)),window.addEventListener("pointermove",t(this,hi)),window.addEventListener("pointerup",t(this,dn),{once:!0})},"#onPointerDown"));d(this,hi,h(r=>{v.log(r),A(this,Tt,fl).call(this,r.clientX)},"#onDragMove"));d(this,dn,h(r=>{var n;window.removeEventListener("pointermove",t(this,hi));const e=r.clientX-t(this,ys),s=A(this,Tt,yr).call(this,t(this,Ut));let i=0;if(s&&t(this,kt)!==null){let o=Math.max(mt,t(this,jt)+e),l=t(this,jt)+t(this,xe)-o;l<mt&&(l=mt,o=t(this,jt)+t(this,xe)-mt),this.setColumnWidth(t(this,_t),o,t(this,Gt)),this.setColumnWidth(t(this,kt),l,t(this,Gt)),i=o}else{const o=Math.max(mt,t(this,jt)+e);t(this,_t)!==null&&t(this,Gt)&&(this.setColumnWidth(t(this,_t),o,t(this,Gt)),i=o)}if(t(this,Ut)){const o=t(this,Ut);o.getAttribute("collapsed")!=="true"&&i>20&&(o.dataset.expandWidth=String(i))}t(this,Ct)&&((n=t(this,_e))==null||n.classList.add("fade-out"),setTimeout(()=>{var o;t(this,Ct).classList.remove("active"),(o=t(this,_e))==null||o.classList.remove("fade-out")},150)),g(this,_t,null),g(this,kt,null),g(this,Gt,null),g(this,Ut,null)},"#onDragEnd"));d(this,di,h(r=>{let s=r.target.closest("th, td");if(!s||!s.classList.contains("resizable-edge"))return;const i=s.getBoundingClientRect();r.clientX-i.left<=Bi&&(s=s.previousElementSibling);const o=parseInt(s.dataset.col,10),l=t(this,X).querySelector(`tbody.body [data-col="${o}"]`);if(!l||!l.dataset.bind||l.classList.contains("CELL-RADIO"))return;let a=0;Array.from(l.firstElementChild.children).forEach(y=>{switch(y.tagName){case"SPAN":a+=8;break;case"DIV":a+=8;break;case"BUTTON":a+=32;break;case"SELECT":a+=32;break;case"INPUT":switch((y.type||"text").toLowerCase()){case"checkbox":case"radio":a+=12;break;case"button":case"submit":case"reset":case"image":a+=16;break;case"color":case"file":case"range":a+=24;break;case"hidden":a+=0;break;case"text":case"search":case"tel":case"url":case"email":case"password":case"number":case"date":case"time":case"datetime-local":case"month":case"week":default:a+=16;break}break}}),v.log(a);const c=t(this,Xe).fields.get().indexOf(l.dataset.bind),p=window.getComputedStyle(l).font||"12px sans-serif",f=s.innerText||"";let m=(nine.measureTextSize(f,p).width||0)+16;t(this,Xe).execute(()=>{t(this,X).view.getArray().forEach((x,w)=>{const S=String(l.dataset.expr?t(this,Xe).exprEngine.evaluate(l.dataset.expr,x,w):x.v[c]??"").trim(),R=nine.measureTextSize(S,p);R.width&&R.width>m&&(m=R.width)});const y=Math.max(32,Math.min(400,Math.ceil(m)+a));this.setColumnWidth(l.dataset.col,y,A(this,Tt,ul).call(this,s))})},"#onDblClick"));var e;g(this,X,r),g(this,Xe,r.getRootNode().host),g(this,Ct,t(this,X).querySelector(".ng-col-resizer-panel")),g(this,_e,(e=t(this,Ct))==null?void 0:e.querySelector(".resizer-overlay")),this.bindEvents()}destroy(){t(this,X).removeEventListener("pointermove",t(this,ai)),t(this,X).removeEventListener("pointerdown",t(this,ci)),t(this,X).removeEventListener("dblclick",t(this,di))}refreshLayout(r="body"){var n,o;const e=Array.from(t(this,X).querySelectorAll(`.ng-container-${r}`));if(e.length===0)return;if(!(r==="left"||r==="right")&&(t(this,X).isAutoFitCol||((n=e[0].querySelector("table"))==null?void 0:n.getAttribute("auto-fit-col"))==="true"))e.forEach(l=>{l.querySelectorAll("table").forEach(c=>{})});else{const l=e[0].querySelector("table colgroup");if(!l)return;let a=0;const c={};Array.from(l.querySelectorAll("col")).forEach(u=>{const p=u.getAttribute("data-col"),f=parseInt(u.getAttribute("width"),10);isNaN(f)||(c[p]=f,a+=f)}),e.forEach(u=>{const p=u.querySelectorAll("table");v.log("====================",e,r),r==="body"?p.forEach(f=>{f.style.width=`${a}px`}):(u.style.flex=`0 0 ${a}px`,u.style.width=`${a}px`,u.style.minWidth=`${a}px`,u.style.maxWidth=`${a}px`,p.forEach(f=>{f.style.width=`${a}px`,f.style.minWidth=`${a}px`,f.style.maxWidth=`${a}px`,Object.entries(c).forEach(([b,m])=>{f.querySelectorAll(`th[data-col="${b}"], td[data-col="${b}"]`).forEach(y=>{y.style.width=`${m}px`,y.style.minWidth=`${m}px`,y.style.maxWidth=`${m}px`})})}))})}(o=t(this,X).querySelector("nine-table-hscrollbar"))==null||o.refresh()}setColumnWidth(r,e,s=null){var a,c;v.log("setColumnWidth");let i=[];if(i=Array.from(t(this,X).querySelectorAll(`table colgroup col[data-col="${r}"]`)),i.length===0)return;const n=i[0].closest(".ng-container-left, .ng-container-body, .ng-container-right"),o=s||(n!=null&&n.classList.contains("ng-container-left")?"left":n!=null&&n.classList.contains("ng-container-right")?"right":"body");i.forEach(u=>{u.setAttribute("width",e),u.style.width=`${e}px`,v.log(u,e)});const l=(a=t(this,X).sourceTable)==null?void 0:a.querySelector(`colgroup col[data-col="${r}"]`);l&&(l.setAttribute("width",e),l.style.width=`${e}px`),this.refreshLayout(o),(o==="left"||o==="right")&&this.refreshLayout("body"),(c=t(this,X).rowManager)==null||c.refresh()}bindEvents(){t(this,X).addEventListener("pointermove",t(this,ai)),t(this,X).addDebounseEventListener("dblclick",t(this,di),"pointerdown",t(this,ci))}};X=new WeakMap,Xe=new WeakMap,Ct=new WeakMap,_e=new WeakMap,_t=new WeakMap,kt=new WeakMap,Gt=new WeakMap,Ut=new WeakMap,ys=new WeakMap,jt=new WeakMap,xe=new WeakMap,oi=new WeakMap,li=new WeakMap,Tt=new WeakSet,yr=h(function(r){if(t(this,X).isAutoFitCol)return!0;const e=r==null?void 0:r.closest("table");return!!(e&&e.getAttribute("auto-fit-col")==="true")},"#checkIsAutoFit"),ul=h(function(r){const e=r.closest(".ng-container-left, .ng-container-body, .ng-container-right");return e?e.classList.contains("ng-container-left")?"left":e.classList.contains("ng-container-right")?"right":"body":null},"#getContainerType"),ai=new WeakMap,ci=new WeakMap,fl=h(function(r){var c;let e=r-t(this,ys);const s=A(this,Tt,yr).call(this,t(this,Ut));if(s&&t(this,kt)!==null){const u=t(this,xe)-mt,p=-(t(this,jt)-mt);e=Math.max(p,Math.min(e,u))}const i=Math.max(mt,t(this,jt)+e),n=t(this,Ut).getBoundingClientRect();let o=r-n.left;if(s&&t(this,kt)!==null){const u=t(this,oi)+(t(this,xe)-mt);o=Math.min(o,u)}const l=Math.max(mt,o);t(this,Ct)&&(t(this,Ct).style.setProperty("--tooltip-left",`${t(this,li)}px`),t(this,Ct).style.setProperty("--tooltip-width",`${l}px`));const a=(c=t(this,_e))==null?void 0:c.querySelector(".size-badge");a&&(a.textContent=`${Math.round(i)}px`)},"#updatePositions"),hi=new WeakMap,dn=new WeakMap,di=new WeakMap,h(Lo,"ColResizer");let $r=Lo;const Ro=class Ro{constructor(r){d(this,st);d(this,K);d(this,V);d(this,et);d(this,we,!1);d(this,ie,null);d(this,ne,null);d(this,zt,null);d(this,ui,0);d(this,Ge,null);d(this,fi,h(r=>{if(!A(this,st,Il).call(this)||!r.target.closest(".ng-sheet-header"))return;const s=r.target.closest("th, td");if(!s||s.classList.contains("resizable-edge")||["INPUT","BUTTON"].includes(r.target.tagName)||s.dataset.col===void 0)return;r.preventDefault();const i=r.clientX,n=r.clientY,o=h(()=>{t(this,Ge)&&(clearTimeout(t(this,Ge)),g(this,Ge,null)),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o)},"cancelTimer"),l=h(a=>{Math.hypot(a.clientX-i,a.clientY-n)>5&&o()},"onPointerMovePending");g(this,Ge,setTimeout(()=>{o(),A(this,st,Hl).call(this,r,s)},500)),window.addEventListener("pointermove",l),window.addEventListener("pointerup",o,{once:!0}),window.addEventListener("pointercancel",o,{once:!0})},"#onPointerDown"));d(this,pi,h(r=>{var i,n;if(!t(this,we))return;A(this,st,pl).call(this,r.clientX),t(this,V)&&(t(this,V).style.pointerEvents="none"),t(this,et)&&(t(this,et).style.pointerEvents="none");const e=A(this,st,ql).call(this,r.clientX,r.clientY),s=e==null?void 0:e.closest(".ng-sheet-header th, .ng-sheet-header td");if(s&&s.dataset.col!==void 0){const o=parseInt(s.dataset.col,10),l=t(this,K).getBoundingClientRect(),a=s.closest("table");let c=1/0,u=-1/0;if(a&&a.querySelectorAll("thead th, thead td").forEach(O=>{if(O.dataset.col===void 0)return;const tt=parseInt(O.dataset.col,10),St=O.colSpan||1,P=tt+St-1;if(tt<=o&&P>=o){const $s=O.getBoundingClientRect();c=Math.min(c,$s.left),u=Math.max(u,$s.right)}}),c===1/0){const O=s.getBoundingClientRect();c=O.left,u=O.right}const p=c+(u-c)/2;let f=0,b=0;if(r.clientX<p)f=o,b=c-l.left;else{const O=s.colSpan||1;f=o+O,b=u-l.left}const m=A(this,st,xr).call(this,t(this,ie)),y=m.colSpan,x=m.rowIndex,w=t(this,ie).rowSpan||1,S=x+w-1,R=((i=s.closest("tr"))==null?void 0:i.sectionRowIndex)??0,C=s.rowSpan||1,F=R+C-1,k=!(S<R||x>F);let D=!1;if(m.parentGroupRange){const{startCol:O,endCol:tt}=m.parentGroupRange;(f<O||f+y-1>tt)&&(D=!0)}let _=!1;if(a){const O=a.querySelectorAll("thead th[colspan], thead td[colspan]");for(const tt of O){if(tt===t(this,ie))continue;const St=((n=tt.closest("tr"))==null?void 0:n.sectionRowIndex)??0,P=tt.rowSpan||1,$s=St+P-1;if(!!(S<St||x>$s))continue;const ke=parseInt(tt.dataset.col,10),mr=tt.colSpan||1,Te=ke+mr-1;if(f>ke&&f<Te+1){_=!0;break}const nl=f+y-1;if(f>ke&&f<=Te&&nl>Te||f<ke&&nl>=ke&&nl<Te){_=!0;break}}}const nt=f>=m.startCol&&f<=m.endCol+1;if(!k||nt||D||_||!m.isValidGroup)g(this,zt,null),t(this,et)&&(t(this,et).style.display="none"),t(this,V)&&t(this,V).classList.add("invalid");else if(g(this,zt,f),t(this,V)&&t(this,V).classList.remove("invalid"),t(this,et)){const St=s.closest(".ng-sheet-header").getBoundingClientRect().top-l.top,P=l.height-St;t(this,et).style.top=`${St}px`,t(this,et).style.height=`${P}px`,t(this,et).style.left=`${b-1}px`,t(this,et).style.display="block"}}else t(this,et)&&(t(this,et).style.display="none"),t(this,V)&&t(this,V).classList.add("invalid"),g(this,zt,null)},"#onPointerMove"));d(this,un,h(r=>{t(this,we)&&(window.removeEventListener("pointermove",t(this,pi)),document.body.style.cursor="",t(this,V)&&(t(this,V).style.display="none",t(this,V).replaceChildren()),t(this,et)&&(t(this,et).style.display="none"),t(this,zt)!==null&&t(this,ne)!==null&&t(this,zt)!==t(this,ne)&&t(this,zt)!==t(this,ne)+1&&this.moveColumn(t(this,ne),t(this,zt)),g(this,we,!1),g(this,ie,null),g(this,ne,null),g(this,zt,null))},"#onPointerUp"));g(this,K,r),g(this,V,t(this,K).querySelector(".ng-col-mover-grip")),g(this,et,t(this,K).querySelector(".ng-col-mover-indi")),this.bindEvents()}bindEvents(){t(this,K).addEventListener("pointerdown",t(this,fi))}moveColumn(r,e){v.log(t(this,K).sourceTable.cloneNode(!0));const s=t(this,K).sourceTable.querySelector("colgroup"),i=s.querySelector(`col[data-col="${e}"]`),n=A(this,st,xr).call(this,t(this,ie));if(!n||!n.isValidGroup)return;const o=n.colSpan,l=h(u=>u>=r&&u<r+o,"isInRange"),a=t(this,K).querySelector(`.ng-sheet-body-content col[data-col="${e}"]`),c=a!=null&&a.closest(".ng-container-left")?"left":a!=null&&a.closest(".ng-container-right")?"right":null;s.querySelectorAll("col").forEach(u=>{l(parseInt(u.getAttribute("data-col"),10))&&(c?u.setAttribute("fixed",c):u.removeAttribute("fixed"),s.insertBefore(u,i))}),["thead","tbody","tfoot"].forEach(u=>{t(this,K).sourceTable.querySelectorAll(`${u} tr`).forEach(p=>{const f=Array.from(p.children),b=f.find(m=>parseInt(m.dataset.col,10)>=e);f.forEach(m=>{l(parseInt(m.dataset.col,10))&&p.insertBefore(m,b||null)})})}),t(this,K).recompileAndRefresh()}destroy(){t(this,K).removeEventListener("pointerdown",t(this,fi))}};K=new WeakMap,V=new WeakMap,et=new WeakMap,we=new WeakMap,ie=new WeakMap,ne=new WeakMap,zt=new WeakMap,ui=new WeakMap,Ge=new WeakMap,st=new WeakSet,Il=h(function(){var e;const r=(e=t(this,K).getRootNode())==null?void 0:e.host;return t(this,K).getAttribute("col-movable")==="true"||(r==null?void 0:r.getAttribute("col-movable"))==="true"},"#checkIsMovable"),ql=h(function(r,e){const s=t(this,K).getRootNode();let i=s.elementFromPoint?s.elementFromPoint(r,e):document.elementFromPoint(r,e);for(;i&&i.shadowRoot&&i.shadowRoot.elementFromPoint;){const n=i.shadowRoot.elementFromPoint(r,e);if(!n||n===i)break;i=n}return i},"#getDeepElementFromPoint"),xr=h(function(r){var f,b;if(!r||r.dataset.col===void 0)return null;const e=parseInt(r.dataset.col,10),s=r.colSpan||1,i=e+s-1,n=((f=r.closest("tr"))==null?void 0:f.sectionRowIndex)??0,o=r.closest("table");if(!o)return{startCol:e,colSpan:s,endCol:i,rowIndex:n,isGroup:!1,parentGroupRange:null,isValidGroup:!0};const l=o.querySelectorAll("thead th, thead td");let a=!1,c=!0,u=null;for(const m of l){if(m===r||m.dataset.col===void 0)continue;const y=parseInt(m.dataset.col,10),x=m.colSpan||1,w=y+x-1;(((b=m.closest("tr"))==null?void 0:b.sectionRowIndex)??0)<n&&y<=e&&w>=i&&x>s&&(u?(u.startCol=Math.max(u.startCol,y),u.endCol=Math.min(u.endCol,w)):u={startCol:y,endCol:w}),!(w<e||y>i)&&(y>=e&&w<=i?x<s&&(a=!0):(y<e||w>i)&&(y<=e&&w>=i||(c=!1)))}const p=a&&c;return{startCol:e,colSpan:p?s:1,endCol:p?i:e,rowIndex:n,isGroup:p,parentGroupRange:u,isValidGroup:c}},"#getColGroupRange"),Ml=h(function(r){const e=A(this,st,xr).call(this,r);if(!e)return null;const{startCol:s,endCol:i,isGroup:n}=e,o=r.closest("table");if(!o)return null;let l=1/0,a=-1/0,c=1/0,u=-1/0;const p=[];if(o.querySelectorAll("thead th, thead td").forEach(y=>{if(y.dataset.col===void 0)return;const x=parseInt(y.dataset.col,10),w=y.colSpan||1,S=x+w-1;if(n?x>=s&&S<=i:y===r){const C=y.getBoundingClientRect();l=Math.min(l,C.left),a=Math.max(a,C.right),c=Math.min(c,C.top),u=Math.max(u,C.bottom);const F=window.getComputedStyle(y);p.push({el:y,rect:C,style:F})}}),p.length===0)return null;const f=a-l,b=u-c,m=document.createElement("div");return m.className="grip-header-content",m.style.position="relative",m.style.width=`${f}px`,m.style.height=`${b}px`,p.forEach(({el:y,rect:x,style:w})=>{const S=y.cloneNode(!0);S.style.position="absolute",S.style.left=`${x.left-l}px`,S.style.top=`${x.top-c}px`,S.style.width=`${x.width}px`,S.style.minWidth=`${x.width}px`,S.style.maxWidth="none",S.style.height=`${x.height}px`,S.style.boxSizing="border-box",S.style.margin="0",S.style.backgroundColor=w.backgroundColor!=="transparent"&&w.backgroundColor!=="rgba(0, 0, 0, 0)"?w.backgroundColor:"#f9fafb",S.style.color=w.color,S.style.font=w.font,S.style.fontWeight=w.fontWeight,S.style.fontSize=w.fontSize,S.style.textAlign=w.textAlign,S.style.padding=w.padding,S.style.border=w.border,S.style.borderRight=w.borderRight,S.style.borderBottom=w.borderBottom,S.style.display="flex",S.style.alignItems="center",S.style.justifyContent=w.textAlign==="center"?"center":w.textAlign==="right"?"flex-end":"flex-start",m.appendChild(S)}),{element:m,bounds:{left:l,right:a,top:c,bottom:u,width:f,height:b}}},"#createGroupHeaderPreview"),fi=new WeakMap,Hl=h(function(r,e){if(t(this,we))return;const s=A(this,st,Ml).call(this,e);if(!s)return;g(this,we,!0),g(this,ie,e),g(this,ne,parseInt(e.dataset.col,10));const i=t(this,K).getBoundingClientRect(),{bounds:n,element:o}=s;if(g(this,ui,r.clientX-n.left),t(this,V)){t(this,V).replaceChildren(o);const l=n.top-i.top,a=i.height-l;t(this,V).style.width=`${n.width}px`,t(this,V).style.height=`${a}px`,t(this,V).style.top=`${l}px`,t(this,V).style.display="block",A(this,st,pl).call(this,r.clientX)}document.body.style.cursor="move",window.addEventListener("pointermove",t(this,pi)),window.addEventListener("pointerup",t(this,un),{once:!0})},"#startDrag"),pi=new WeakMap,pl=h(function(r){if(!t(this,V))return;const e=t(this,K).getBoundingClientRect(),s=r-e.left-t(this,ui);t(this,V).style.left=`${s}px`},"#updateGripPosition"),un=new WeakMap,h(Ro,"ColMover");let zr=Ro;const Co=class Co{constructor(r){d(this,ve);g(this,ve,r)}getFixState(r,e){if(!r||!e)return"none";const s=r.closest(".ng-container-left, .ng-container-right, .ng-container-body");if(s!=null&&s.classList.contains("ng-container-left"))return"left";if(s!=null&&s.classList.contains("ng-container-right"))return"right";const i=parseInt(r.dataset.col,10);if(!isNaN(i)){const n=e.querySelector(`colgroup col[data-col="${i}"]`),o=n==null?void 0:n.getAttribute("fixed");if(o)return o}return"none"}canFixColumn(r,e){if(!r||r.tagName!=="TH"||!e)return!1;const s=parseInt(r.dataset.col,10),i=r.colSpan||1;if(isNaN(s))return!1;const n=s+i-1,o=Array.from(e.querySelectorAll("thead tr"));if(o.length<=1)return!0;for(const l of o){const a=Array.from(l.querySelectorAll("th, td"));let c=!1;for(const u of a){const p=parseInt(u.dataset.col,10),f=u.colSpan||1,b=p+f-1;if(p<=n&&n<b)return!1;if(b===n){c=!0;break}}if(!c)return!1}return!0}executeFixToggle(r,e,s="left"){var u,p;if(!t(this,ve)||!e)return;const i=t(this,ve).sourceTable;if(!i)return;const n=parseInt(e.dataset.col,10),o=e.colSpan||1,l=n+o-1;if(isNaN(l))return;const a=i.querySelector("colgroup");if(!a)return;const c=Array.from(a.querySelectorAll("col"));if(r==="fix-column")c.forEach(f=>{parseInt(f.getAttribute("data-col"),10)<=l&&f.setAttribute("fixed",s)}),["thead","tbody","tfoot"].forEach(f=>{i.querySelectorAll(`${f} tr`).forEach(b=>{Array.from(b.children).forEach(m=>{const y=parseInt(m.dataset.col,10);!isNaN(y)&&y<=l&&m.setAttribute("fixed",s)})})});else if(r==="unfix-column"){let f=n;["thead","tbody","tfoot"].forEach(m=>{i.querySelectorAll(`${m} tr`).forEach((y,x)=>{Array.from(y.children).forEach(w=>{const S=parseInt(w.dataset.col,10),R=w.colSpan||1,C=S+R-1,F=w.rowSpan||1,k=y.sectionRowIndex??x;k+F-1<w.closest("tr").sectionRowIndex||k>w.closest("tr").sectionRowIndex+F-1,!(C<n||S>l)&&(f=Math.min(f,S))})})}),c.forEach(m=>{parseInt(m.getAttribute("data-col"),10)>=f&&m.removeAttribute("fixed")});let b=!1;c.forEach(m=>{b?m.removeAttribute("fixed"):m.getAttribute("fixed")||(b=!0)}),["thead","tbody","tfoot"].forEach(m=>{i.querySelectorAll(`${m} tr`).forEach(y=>{Array.from(y.children).forEach(x=>{const w=parseInt(x.dataset.col,10);if(isNaN(w))return;const S=c.find(C=>parseInt(C.getAttribute("data-col"),10)===w),R=S==null?void 0:S.getAttribute("fixed");R?x.setAttribute("fixed",R):x.removeAttribute("fixed")})})})}v.log(t(this,ve).sourceTable),(p=(u=t(this,ve)).recompileAndRefresh)==null||p.call(u)}};ve=new WeakMap,h(Co,"ColFixManager");let Vi=Co;const To=class To extends HTMLElement{constructor(){super(...arguments);d(this,bn);d(this,Ft);d(this,re);d(this,bt);d(this,oe);d(this,Kt);E(this,"currentCol",null);d(this,fn,h(()=>{t(this,pn).call(this),g(this,Ft,this.closest("nine-table-sheet")),g(this,re,this.getRootNode().host),g(this,bt,this.querySelector("nine-table-simple")),v.log("1***********************",t(this,bt)),setTimeout(()=>{g(this,oe,t(this,bt).shadowRoot.querySelector("nine-table-sheet")),v.log("2***********************",t(this,oe))}),this.querySelector(".search-box").addEventListener("focusin",e=>{e.stopPropagation()}),this.querySelector(".search-box").addEventListener("input",t(this,yn)),this.querySelector("#chkSelectAll").addEventListener("change",t(this,xn)),this.querySelector("#btnOk").addEventListener("click",t(this,mn))},"#init"));d(this,pn,h(()=>{this.innerHTML=`
|
|
150
|
+
<style>
|
|
151
|
+
nine-table-filter-panel nine-table-simple {
|
|
152
|
+
width: 100%;
|
|
153
|
+
flex: 1;
|
|
154
|
+
border: none;
|
|
155
|
+
}
|
|
156
|
+
nine-table-filter-panel.active {
|
|
157
|
+
display: flex;
|
|
158
|
+
}
|
|
159
|
+
nine-table-filter-panel .search-box {
|
|
160
|
+
width: 100%;
|
|
161
|
+
height: 28px;
|
|
162
|
+
box-sizing: border-box;
|
|
163
|
+
padding: 0px 8px;
|
|
164
|
+
border: none;
|
|
165
|
+
border-bottom: 1px solid #e5e7eb;
|
|
166
|
+
border-radius: 0px;
|
|
167
|
+
outline: none;
|
|
168
|
+
font-size: 12px;
|
|
169
|
+
background: #fafafa;
|
|
170
|
+
color: #333;
|
|
171
|
+
}
|
|
172
|
+
nine-table-filter-panel .search-box:focus {
|
|
173
|
+
background: #ffffff;
|
|
174
|
+
}
|
|
175
|
+
nine-table-filter-panel .footer-section {
|
|
176
|
+
display: flex;
|
|
177
|
+
flex-direction: column;
|
|
178
|
+
padding: 4px 6px;
|
|
179
|
+
gap: 8px;
|
|
180
|
+
border-top: 1px solid #e5e7eb;
|
|
181
|
+
background: #f9fafb;
|
|
182
|
+
flex-shrink: 0;
|
|
183
|
+
}
|
|
184
|
+
nine-table-filter-panel .footer-btns {
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
justify-content: space-between;
|
|
188
|
+
gap: 6px;
|
|
189
|
+
}
|
|
190
|
+
nine-table-filter-panel .footer-btns label {
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
gap: 4px;
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
user-select: none;
|
|
196
|
+
}
|
|
197
|
+
nine-table-filter-panel .btn-group {
|
|
198
|
+
display: flex;
|
|
199
|
+
gap: 4px;
|
|
200
|
+
}
|
|
201
|
+
nine-table-filter-panel button {
|
|
202
|
+
padding: 4px 14px;
|
|
203
|
+
border-radius: 4px;
|
|
204
|
+
border: 1px solid #d1d5db;
|
|
205
|
+
background: #ffffff;
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
font-size: 11px;
|
|
208
|
+
}
|
|
209
|
+
nine-table-filter-panel button:hover {
|
|
210
|
+
background: #f3f4f6;
|
|
211
|
+
}
|
|
212
|
+
nine-table-filter-panel button#btnOk {
|
|
213
|
+
background: #2563eb;
|
|
214
|
+
color: white;
|
|
215
|
+
border: none;
|
|
216
|
+
}
|
|
217
|
+
</style>
|
|
218
|
+
|
|
219
|
+
<input type="text" class="search-box" placeholder="Search...">
|
|
220
|
+
|
|
221
|
+
<nine-table-simple class="filter-list" theme="simple">
|
|
222
|
+
<table auto-fit-col="true">
|
|
223
|
+
<colgroup>
|
|
224
|
+
<col width="32" fixed="left" />
|
|
225
|
+
<col width="180" />
|
|
226
|
+
<col width="0" fixed="right"/>
|
|
227
|
+
</colgroup>
|
|
228
|
+
<tbody>
|
|
229
|
+
<tr>
|
|
230
|
+
<td cell-type="checkbox" data-bind="CHK"></td>
|
|
231
|
+
<td data-bind="DATA2" html="true"></td>
|
|
232
|
+
<td data-bind="DATA"></td>
|
|
233
|
+
</tr>
|
|
234
|
+
</tbody>
|
|
235
|
+
</table>
|
|
236
|
+
</nine-table-simple>
|
|
237
|
+
|
|
238
|
+
<div class="footer-section">
|
|
239
|
+
<div class="footer-btns">
|
|
240
|
+
<label><input type="checkbox" id="chkSelectAll" checked> Select All</label>
|
|
241
|
+
<div class="btn-group">
|
|
242
|
+
<button id="btnOk">Apply</button>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
`},"#renderer"));d(this,gn,h(e=>{const s=e.composedPath?e.composedPath():[];s.includes(this)||t(this,Kt)&&s.includes(t(this,Kt))||this.close()},"#closeHandler"));d(this,mn,h(()=>{var l;t(this,re).loading=!0;const e=t(this,oe).view.getArray(),s=t(this,bt).data.getHostFields(),i=e.filter(a=>{const c=a.v[s.indexOf("CHK")];return c==="Y"||c===!0}),n={...((l=t(this,Ft).filtering)==null?void 0:l.filters)||{}};t(this,Kt).columns.forEach(a=>{const c=a.expr||a.bind,u=a.expr?s.indexOf("DATA2"):s.indexOf("DATA"),p=i.map(f=>f.v[u]);p.length>0?n[c]=p:delete n[c]});const o=t(this,bt).data.count();setTimeout(()=>{try{o===i.length?t(this,Kt).columns.forEach(a=>{const c=a.expr||a.bind;c&&t(this,Ft).filtering.clear(c)}):t(this,Ft).filtering.set(n),t(this,Ft).querySelectorAll("nine-table-filter-button").forEach(a=>{a.updateFilteredState()}),t(this,Ft).invalidate(),this.close()}finally{t(this,re).loading=!1}})},"#onOk"));d(this,yn,h(e=>{const s=e.target.value.toLowerCase().trim();if(!s)t(this,oe).filtering.clear();else{const i=t(this,bt).data.getArray(),o=t(this,bt).data.getHostFields().indexOf("DATA2"),l=[];i.forEach(a=>{const c=o>=0&&a.v?a.v[o]:"";String(c).replace(/<[^>]*>?/gm,"").toLowerCase().includes(s)&&l.push(c)}),v.log(l),t(this,oe).filtering.set({DATA2:[...new Set(l)]})}},"#onInput"));d(this,xn,h(e=>{var l,a;const s=e.target.checked,i=((a=(l=t(this,bt))==null?void 0:l.data)==null?void 0:a.getArray())||[],o=t(this,bt).data.getHostFields().indexOf("CHK");o>=0&&i.forEach(c=>{c.v[o]=s?"Y":"N"}),t(this,bt).refresh()},"#onSelectAll"));d(this,ko,h(()=>{this.close()},"#onCancel"))}connectedCallback(){t(this,fn).call(this),document.addEventListener("mousedown",t(this,gn))}open(e){g(this,Kt,e);const s=e.closest("th, td");this.currentCol=s==null?void 0:s.dataset.col;const i=s.getBoundingClientRect(),n=t(this,Ft).getBoundingClientRect(),o=this.offsetWidth||240;let l=i.right-n.left-o,a=i.bottom-n.top;l<0&&(l=Math.max(0,i.left-n.left)),this.style.left=`${l}px`,this.style.top=`${a}px`;const c=this.querySelector(".search-box");c.value="",this.classList.add("active"),this.classList.add("loading"),setTimeout(()=>{try{A(this,bn,Nl).call(this),t(this,oe).rowManager.scrollToDataRow(0)}finally{this.classList.remove("loading")}})}close(){this.currentCol=null,this.classList.remove("active"),g(this,Kt,null)}};Ft=new WeakMap,re=new WeakMap,bt=new WeakMap,oe=new WeakMap,Kt=new WeakMap,fn=new WeakMap,pn=new WeakMap,gn=new WeakMap,bn=new WeakSet,Nl=h(function(){var c,u;const e=t(this,re).data.getArray(),s=((c=t(this,Kt))==null?void 0:c.columns)||[],i=t(this,re).fields.get()||[],n=((u=t(this,Ft).filtering)==null?void 0:u.filters)||{},o=t(this,re).exprEngine,l=s.flatMap(p=>{const f=p.bind,b=p.expr,m=f||b,y=f?i.indexOf(f):-1,x=n[m]||[],w=new Map;for(let R=0;R<e.length;R++){const C=e[R];if(!C)continue;let F;y>=0&&C.v?F=C.v[y]:f&&f.includes("data.")?F=o?o.evaluate(f,C,R):void 0:b&&o&&(F=o.evaluate(b,C,R));let k=F;b&&o&&(k=o.evaluate(b,C,R)),k!=null&&!w.has(k)&&w.set(k,{v:F,v2:k})}const S=[...w.values()];return S.sort((R,C)=>String(R.v2||"").localeCompare(String(C.v2||""))),x.sort((R,C)=>R>C?1:-1),S.map(R=>({LVL:2,DATA:R.v,DATA2:R.v2===""||R.v2===null||R.v2===void 0?'<span class="empty-value">(empty)</span>':R.v2,COLNM:m,CHK:x.length===0||x.nineBinarySearch(R.v||"")>=0?"Y":"N"}))});t(this,bt).data.set(l);const a=this.querySelector("#chkSelectAll");a&&(a.checked=l.length>0&&l.every(p=>p.CHK==="Y"))},"#loadVirtualFilterItems"),mn=new WeakMap,yn=new WeakMap,xn=new WeakMap,ko=new WeakMap,h(To,"NineTableFilterPanel");let Fr=To;const Io=class Io extends HTMLElement{constructor(){super(...arguments);d(this,Ue);d(this,je,null);E(this,"updateFilteredState",h(()=>{var i;const e=((i=t(this,Ue).filtering)==null?void 0:i.filters)||{},s=this.columns.some(n=>{const o=n.expr||n.bind;return o&&e[o]&&e[o].length>0});this.classList.toggle("filtered",s)},"updateFilteredState"));d(this,gi,h(e=>{e.preventDefault(),e.stopPropagation();const s=t(this,Ue).querySelector("nine-table-filter-panel"),i=this.closest("th, td"),n=i==null?void 0:i.dataset.col;s&&s.currentCol===n&&s.classList.contains("active")?s.close():s&&s.open(this)},"#onClick"))}connectedCallback(){g(this,Ue,this.closest("nine-table-sheet")||this.getRootNode().host),this.removeEventListener("click",t(this,gi)),this.addEventListener("click",t(this,gi))}get columns(){if(t(this,je))return t(this,je);const e=this.closest("th, td"),s=e==null?void 0:e.dataset.col,i=t(this,Ue).sourceTable,n=[],o=new Set;return i&&s!==void 0&&i.querySelectorAll(`tbody [data-col="${s}"]`).forEach(l=>{const a=l.dataset.bind,c=l.dataset.expr;if(a||c){const u=`${a||""}_${c||""}`;o.has(u)||(o.add(u),n.push({bind:a,expr:c}))}}),g(this,je,n),t(this,je)}};Ue=new WeakMap,je=new WeakMap,gi=new WeakMap,h(Io,"NineTableFilterButton");let Wr=Io;const qo=class qo{constructor(r){d(this,bi);d(this,It);d(this,Se);d(this,Ke,!1);d(this,wn,null);d(this,Yt,{});d(this,vn,h(()=>{t(this,Sn).call(this)},"#init"));d(this,Sn,h(()=>{if(t(this,Se).tagName.toLowerCase()==="nine-table-simple")return;let r=t(this,It).querySelector("nine-table-filter-panel");r||(r=document.createElement("nine-table-filter-panel"),t(this,It).appendChild(r)),g(this,wn,r)},"#initFilterPanel"));E(this,"clear",h(r=>{r?delete t(this,Yt)[r]:g(this,Yt,{}),g(this,Ke,Object.keys(t(this,Yt)).length>0),A(this,bi,gl).call(this),t(this,It).querySelectorAll("nine-table-filter-button").forEach(e=>{e.updateFilteredState()}),v.log(`๐ [NineTableFiltering] Filter cleared for ${r||"all"}`)},"clear"));E(this,"set",h(r=>{v.log(r);let e=Array.isArray(r)?Object.fromEntries(Object.keys(r[0]).map(s=>[s,[...new Set(r.map(i=>i[s]))]])):r;g(this,Yt,e),g(this,Ke,Object.keys(e).length>0),t(this,It).toggleAttribute("filtering",t(this,Ke)),A(this,bi,gl).call(this)},"set"));g(this,It,r),g(this,Se,t(this,It).getRootNode().host),t(this,vn).call(this)}get filters(){return t(this,Yt)}isFiltering(){return t(this,Ke)}};It=new WeakMap,Se=new WeakMap,Ke=new WeakMap,wn=new WeakMap,Yt=new WeakMap,vn=new WeakMap,Sn=new WeakMap,bi=new WeakSet,gl=h(function(){const e=t(this,Se).data.getArray(),s=t(this,Se).data.getHostFields(),i=t(this,It).index,n=t(this,Se).exprEngine;if(!(Object.keys(t(this,Yt)).length>0)){e.forEach(a=>{var c,u;(u=(c=a==null?void 0:a.m)==null?void 0:c._)!=null&&u[Dt.META.INDEX.FILTER]&&(a.m._[Dt.META.INDEX.FILTER][i]=!0)}),t(this,It).invalidate();return}const l=Object.entries(t(this,Yt)).map(([a,c])=>{const u=a.includes("data.")||a.includes("host.")||a.includes("rowItem.v");return{targetKey:a,isExpr:u,fieldIdx:u?-1:s.indexOf(a),allowedSet:new Set(c)}});e.forEach((a,c)=>{if(!a)return;a.m._[Dt.META.INDEX.FILTER]||(a.m._[Dt.META.INDEX.FILTER]=[]);let u=!0;for(let p=0;p<l.length;p++){const{targetKey:f,isExpr:b,fieldIdx:m,allowedSet:y}=l[p];let x;if(b&&n?x=n.evaluate(f,a,c):m>=0&&a.v&&(x=a.v[m]),!y.has(x)){u=!1;break}}a.m._[Dt.META.INDEX.FILTER][i]=u}),t(this,It).invalidate()},"#applyFiltering"),h(qo,"Filtering");let Or=qo;customElements.get("nine-table-filter-panel")||customElements.define("nine-table-filter-panel",Fr),customElements.get("nine-table-filter-button")||customElements.define("nine-table-filter-button",Wr);const Mo=class Mo{constructor(r){d(this,Wt);d(this,ct);d(this,mi);d(this,ht,[]);g(this,ct,r),g(this,mi,r.getRootNode().host),setTimeout(()=>{A(this,Wt,Dl).call(this)},300)}restore(){var r;g(this,ht,[]),t(this,ct).view&&t(this,ct).view.resetSorting(),A(this,Wt,bl).call(this),(r=t(this,ct).rowManager)==null||r.refresh(!0)}};ct=new WeakMap,mi=new WeakMap,ht=new WeakMap,Wt=new WeakSet,Dl=h(function(){t(this,ct).querySelectorAll("thead").forEach(r=>{r.addEventListener("dblclick",e=>{const s=e.target.closest("th, td");if(!s||s.classList.contains("resizable-edge")||["INPUT","CELL-CHECKBOX"].includes(e.target.tagName)||e.offsetX<=2||e.offsetX>=s.offsetWidth-2)return;const i=t(this,ct).getRootNode().host;i.loading=!0,setTimeout(()=>{try{A(this,Wt,$l).call(this,e,s)}finally{i.loading=!1}})})}),v.log("๐ฏ [NineTableSorting] Initialized")},"#initEvents"),$l=h(function(r,e){const s=e.dataset.col,i=e.closest("tr"),n=i?i.dataset.subrow||String(i.sectionRowIndex):"0";if(s===void 0)return;const o=t(this,ct).sourceTable;if(!o)return;let l=null,a=null;if(o.querySelectorAll(`tbody [data-col="${s}"]`).forEach(b=>{b.dataset.bind&&(l=b.dataset.bind),b.dataset.expr&&(a=b.dataset.expr)}),!l&&!a)return;const c=e.classList.contains("asc"),u=e.classList.contains("desc");!r.ctrlKey&&!r.shiftKey&&g(this,ht,[]);const p=t(this,ht).findIndex(b=>b.colIndex===s&&b.subRowIndex===n||b.colName===l),f={colIndex:s,subRowIndex:n,colname:l||a,colName:l||a,expr:a,asc:!0,"expr-func":a?(b,m)=>t(this,mi).exprEngine(a,b,m):null};!c&&!u?p>=0?t(this,ht)[p].asc=!0:t(this,ht).push({...f,asc:!0}):c?p>=0?t(this,ht)[p].asc=!1:t(this,ht).push({...f,asc:!1}):g(this,ht,t(this,ht).filter(b=>!(b.colIndex===s&&b.subRowIndex===n||b.colName===l))),A(this,Wt,zl).call(this)},"#handleSort"),zl=h(function(){if(!t(this,ct).view){console.warn("โ ๏ธ [NineTableSorting] Sheet view (SheetView) is not initialized.");return}t(this,ct).view.setSorting(t(this,ht)),A(this,Wt,bl).call(this),t(this,ct).invalidate(),v.log("๐ [NineTableSorting] Sorting applied via RowManager.refresh(true)")},"#applySorting"),bl=h(function(){t(this,ct).querySelectorAll("thead th, thead td").forEach(r=>{r.classList.remove("asc","desc")}),t(this,ht).length!==0&&t(this,ht).forEach(r=>{const{colIndex:e,subRowIndex:s,asc:i}=r;if(e!==void 0){let n=`thead [data-col="${e}"]`;s!==void 0&&(n=`thead tr[data-subrow="${s}"] [data-col="${e}"]`),t(this,ct).querySelectorAll(n).forEach(l=>{l.classList.add(i?"asc":"desc")})}})},"#syncHeaderUI"),h(Mo,"Sorting");let Br=Mo;const No=class No{constructor(r){d(this,Ye);d(this,yt);d(this,Ae,[]);d(this,Ho,[]);d(this,yi,[]);d(this,le,null);E(this,"getArray",h((r,e)=>{if(!t(this,le)){const n=t(this,yt).data.getArray();g(this,le,t(this,yi).map(o=>n[o]))}const s=t(this,le);if(r==null)return s;if(r<0||r>=s.length)return null;const i=s[r];if(e!=null){const o=t(this,yt).data.getHostFields().indexOf(e);return o>=0&&i.v?i.v[o]:null}return i},"getArray"));E(this,"get",h((r,e)=>{var o,l;const s=this.getArray(),i=((l=(o=t(this,yt).data).getHostFields)==null?void 0:l.call(o))||[];if(r==null)return s.map(a=>t(this,xi).call(this,a,i));if(r<0||r>=s.length)return null;const n=s[r];if(!n)return null;if(e!=null){const a=i.indexOf(e);return a>=0&&n.v?n.v[a]:null}return t(this,xi).call(this,n,i)},"get"));d(this,xi,h((r,e)=>{if(!r)return null;const s={};return e.forEach((i,n)=>{s[i]=r.v?r.v[n]:r[i]}),r.m&&(s.m=r.m),r._&&(s._=r._),s},"#convSingle"));E(this,"refresh",h(()=>{var n;g(this,le,null);const r=t(this,yt).data.getArray();let e=[];r.forEach((o,l)=>{var c,u;if(!o)return;const a=(u=(c=o.m)==null?void 0:c._)==null?void 0:u[Dt.META.INDEX.FILTER];a&&a[t(this,Ye).index]===!1||e.push(l)}),v.log(e),t(this,Ae).length>0&&(e=t(this,An).call(this,e,r)),g(this,yi,e);const s=e.map(o=>r[o]),i=((n=t(this,Ye).grouping)==null?void 0:n.columns)||[];if(i.length>0){const o=Mr.apply(s,i,t(this,yt).data.getHostFields());g(this,le,o.renderItems),t(this,Ye).grouping.setGroupMap(o.groupMap)}else g(this,le,s)},"refresh"));E(this,"setSorting",h(r=>{g(this,Ae,r||[]),this.refresh()},"setSorting"));E(this,"getSorting",h(()=>t(this,Ae),"getSorting"));E(this,"resetSorting",h(()=>{g(this,Ae,[]),this.refresh()},"resetSorting"));d(this,An,h((r,e)=>{v.log(new Date);const s=typeof t(this,yt).data.getHostFields=="function"?t(this,yt).data.getHostFields():[],i=t(this,Ae).map(n=>({...n,colIndex:s.indexOf(n.colname||n.colName)}));return r.sort((n,o)=>{const l=e[n],a=e[o];for(const c of i){const u=c.asc,p=c.expr;let f,b;p?(f=t(this,yt).exprEngine.evaluate(p,l,n),b=t(this,yt).exprEngine.evaluate(p,a,o)):c.colIndex>=0&&l.v&&a.v&&(f=l.v[c.colIndex],b=a.v[c.colIndex]);const m=f==null||f==="",y=b==null||b==="";if(!(m&&y)){if(m)return 1;if(y)return-1;if(f!==b){let x=0;if(typeof f=="number"&&typeof b=="number")x=f-b;else{const w=String(f),S=String(b);x=w>S?1:w<S?-1:0}if(x!==0)return u?x:-x}}}return n-o})},"#applySorting"));g(this,Ye,r),g(this,yt,r.getRootNode().host),this.refresh()}};Ye=new WeakMap,yt=new WeakMap,Ae=new WeakMap,Ho=new WeakMap,yi=new WeakMap,le=new WeakMap,xi=new WeakMap,An=new WeakMap,h(No,"SheetView");let Pi=No;const Vr=16,rt=class rt{static initializeTable(r,e){var s,i,n,o,l,a,c,u,p,f,b;return!r||!e?null:(A(s=rt,W,Bl).call(s,e),A(i=rt,W,Pl).call(i,e),A(n=rt,W,Ol).call(n,e),A(o=rt,W,jl).call(o,e),A(l=rt,W,Vl).call(l,e),fe.resetColIndex(e,e.querySelectorAll("thead tr")),fe.resetColIndex(e,e.querySelectorAll('tbody.body tr[grouping="true"]')),fe.resetColIndex(e,e.querySelectorAll('tbody.body tr:not([grouping="true"])')),fe.resetColIndex(e,e.querySelectorAll("tfoot tr")),A(a=rt,W,Fl).call(a,e),A(c=rt,W,Xl).call(c,e),A(u=rt,W,_l).call(u,r,e),A(p=rt,W,Ul).call(p,e),A(f=rt,W,Gl).call(f,r,e),A(b=rt,W,Kl).call(b,e),e)}};W=new WeakSet,Fl=h(function(r){const e=r.querySelector("thead");if(!e||e.querySelector(".col-indicator-rowgroup"))return;const s='<th data-col="@col" class="col-indicator" scope="col"></th>',i=e.insertRow(0);i.setAttribute("role","row"),i.classList.add("col-indicator-rowgroup"),i.classList.add("collapse");const n=r.querySelector("tbody tr");if(!n)return;let o=0;n.querySelectorAll("th, td").forEach(a=>{var c;if(!a.classList.contains("dummy")){const u=a.colSpan||1;for(let p=0;p<u;p++){const f=s.replace("@col",o).replace("@text",A(c=rt,W,Wl).call(c,o++));i.insertAdjacentHTML("beforeend",f)}}});const l=Array.from(r.querySelectorAll("colgroup col"));i.querySelectorAll(".col-indicator").forEach((a,c)=>{const u=l[c].getAttribute("background");u&&(a.style.background=u)})},"#createColIndicator"),Wl=h(function(r){let e="";for(let s=r;s>=0;s=Math.floor(s/26)-1)e=String.fromCharCode(65+s%26)+e;return e},"#numToExcelCol"),Ol=h(function(r){let e=r.querySelector("tbody:not(.head):not(.foot)");if(e){if(e.classList.add("body"),!r.querySelector("tbody.head")){const s=document.createElement("tbody");s.classList.add("head"),e.before(s)}if(!r.querySelector("tbody.foot")){const s=document.createElement("tbody");s.classList.add("foot"),e.after(s)}}},"#ensureSectionTbodys"),Bl=h(function(r){let e=r.querySelector("colgroup");if(e||(e=document.createElement("colgroup"),r.prepend(e)),e.querySelectorAll("col").length===0){const s=r.querySelector("tbody tr");let i=1;s&&(i=Array.from(s.querySelectorAll("th, td")).reduce((n,o)=>n+(parseInt(o.getAttribute("colspan")||o.colSpan,10)||1),0)),i=Math.max(i,1);for(let n=0;n<i;n++){const o=document.createElement("col");e.appendChild(o)}}},"#ensureColgroup"),Vl=h(function(r){const e=Array.from(r.querySelectorAll("colgroup col"));if(e.length===0)return;const s=r.clientWidth||0,i=Math.max(Math.floor(s/e.length),100);e.forEach((n,o)=>{n.hasAttribute("data-col")||n.setAttribute("data-col",o);const l=n.getAttribute("width")||parseInt(n.style.width,10)||i;n.setAttribute("width",l);const a=String(l).includes("px")?l:`${l}px`;n.style.width=a})},"#normalizeColAttributes"),Pl=h(function(r){if(r.querySelector("thead"))return;const e=document.createElement("thead"),s=r.querySelector("colgroup");s?s.after(e):r.prepend(e)},"#ensureThead"),Xl=h(function(r){r.querySelectorAll("thead th, thead td").forEach(s=>{s.getAttribute("collapsed")==="true"&&s.getAttribute("collapsible")!=="true"&&s.setAttribute("collapsible","true")})},"#normalizeCollapsibleAttributes"),_l=h(function(r,e){const s=["data-bind","data-expr","type"];let i=0;e.querySelectorAll("tbody th, tbody td").forEach(n=>{const l=`cell-${n.getAttribute("cell-type")||"renderer"}`,a=n.querySelector("datalist");if(a){let p=[];a.querySelectorAll("option").forEach(b=>{p.push({k:b.getAttribute("k"),v:b.getAttribute("v")})});const f=`__ds_${Date.now()}_${++i}`;r&&(r[f]=()=>p),n.setAttribute("data-source",`host.${f}()`),a.remove()}const c=n.dataset.expr;c&&n.setAttribute("data-expr",r.exprEngine.precompile(c)),Array.from(n.attributes).forEach(p=>{["data-bind","data-expr","cell-type"].includes(p.name)||(p.value.includes("data.")||p.value.includes("host."))&&n.setAttribute(p.name,r.exprEngine.precompile(p.value))});const u=s.filter(p=>n.hasAttribute(p)).map(p=>`${p}="${n.getAttribute(p)}"`);n.innerHTML=`<${l} ${u.join(" ")}></${l}>`,n.setAttribute("tabindex","0")}),e.querySelectorAll("thead th, thead td, tfoot th, tfoot td").forEach(n=>{const o=n.getAttribute("cell-type");if(o){const l=n.innerHTML,a=`cell-${o}`,c=s.filter(u=>n.hasAttribute(u)).map(u=>`${u}="${n.getAttribute(u)}"`);n.innerHTML=`<${a} ${c.join(" ")} content="${l}"></${a}>`}})},"#generateCell"),Gl=h(function(r,e){const s=r.getAttribute("filtering")==="true",i=e.getAttribute("filtering")==="true";e.querySelectorAll("thead tr:not(.col-indicator-rowgroup) th, thead tr:not(.col-indicator-rowgroup) td").forEach(n=>{const o=n.getAttribute("filtering")==="true"||i||s;n.setAttribute("filtering",o?"true":"false"),o&&n.appendChild(document.createElement("nine-table-filter-button"))})},"#initFilterButtons"),Ul=h(function(r){r.querySelectorAll("thead th, thead td").forEach(e=>{if(!(e.getAttribute("collapsible")==="true"||e.getAttribute("expandable")==="true"))return;v.log("11.*******************************",e.dataset.col);const i=parseInt(e.dataset.col,10),n=e.colSpan||1,o=r.querySelector(`colgroup col[data-col="${i}"]`);v.log("11.*******************************",o);const l=o&&parseInt(o.getAttribute("width"),10)||100;(!e.dataset.expandWidth||parseInt(e.dataset.expandWidth,10)<=Vr)&&(e.dataset.expandWidth=String(l>Vr?l:100));let a=e.querySelector("nine-table-col-expand");if(a||(a=document.createElement("nine-table-col-expand"),e.insertBefore(a,e.firstChild)),e.getAttribute("collapsed")==="true"){a.classList.add("collapsed"),a.classList.remove("expand"),a.setAttribute("collapsed","true"),e.style.color="transparent";const u=Math.max(10,Math.floor(Vr/n));if(!isNaN(i))for(let p=0;p<n;p++){const f=r.querySelector(`colgroup col[data-col="${i+p}"]`);f&&(f.setAttribute("width",u),f.style.width=`${u}px`)}}else a.classList.remove("collapsed"),a.classList.add("expand"),a.setAttribute("collapsed","false"),e.style.color=""})},"#initColExpanders"),jl=h(function(r,e){const s=r.getAttribute("row-indicator")==="true"?48:0,i=r.querySelector("colgroup"),n=document.createElement("col");n.setAttribute("fixed","left"),n.setAttribute("width",s),n.style.width=`${s}px`,i.prepend(n),r.querySelectorAll("thead, tbody, tfoot").forEach(o=>{const l=Array.from(o.querySelectorAll("tr"));if(l.length===0)return;const a=l[0],c=document.createElement("th");c.className="row-indicator",c.setAttribute("cell-type","row-indicator"),l.length>1&&(c.rowSpan=l.length),a.insertBefore(c,a.firstElementChild)})},"#ensureRowIndicator"),Kl=h(function(r){r.querySelectorAll("th[data-col], td[data-col]").forEach(e=>{v.log(e);const s=parseInt(e.getAttribute("data-col"),10);if(isNaN(s))return;const i=parseInt(e.getAttribute("colspan")||e.colSpan,10)||1;let n=0;for(let o=0;o<i;o++){const l=s+o,a=r.querySelector(`colgroup col[data-col="${l}"]`);a&&(n+=parseInt(a.getAttribute("width"),10)||100)}if(n>0){const o=`${n}px`;e.style.width=o,e.style.minWidth=o,e.style.maxWidth=o}})},"#applyInitialCellWidths"),d(rt,W),h(rt,"PreCompiler");let Pr=rt;const Ci=class Ci extends HTMLElement{constructor(){super();d(this,Ln);d(this,wi);d(this,ae);d(this,Ot);d(this,vi);d(this,Si);d(this,Ee);d(this,xs);d(this,Ai);d(this,En);d(this,Ei);d(this,ws);d(this,Ze);d(this,qt,{table:null});d(this,Je);d(this,Rn,h(()=>{const e=this.querySelector(".ng-container-body thead"),s=this.querySelector(".ng-nodata-overlay");s.style.top=`${e.offsetHeight}px`},"#adjustOverlay"));E(this,"invalidate",h(()=>{this.view.refresh(),t(this,Ot).refresh(!0),this.isAutoFitCol&&this.autoFit(!0)},"invalidate"));E(this,"autoFit",h((e=!0)=>{requestAnimationFrame(()=>{var s;(s=t(this,Cn))==null||s.call(this,e)})},"autoFit"));d(this,Cn,h((e=!0)=>{var n;v.log("autoFit",this);const s=this.querySelector(".ng-sheet-body .ng-container-body");if(!s)return;s.querySelectorAll("table");const i=this.querySelector(".ng-sheet-header .ng-container-body table colgroup");if(i){if(e){this.setAttribute("auto-fit-col","true");const o=s.clientWidth;if(o<=0)return;let l=0;const a=[];i.querySelectorAll("col").forEach(p=>{const f=p.getAttribute("data-col"),b=this.querySelector(`.ng-sheet-header th[data-col="${f}"]`);if((b==null?void 0:b.getAttribute("collapsed"))==="true")a.unshift({globalColIndex:f,width:16,isCollapsed:!0}),v.log(`[AutoFit Col] Index ${f}: COLLAPSED (forced 16px)`);else{const y=parseInt(p.getAttribute("width"),10)||100;a.push({globalColIndex:f,width:y,isCollapsed:!1}),l+=y,v.log(`[AutoFit Col] Index ${f}: NORMAL (original width: ${y}px)`)}}),v.log(`[AutoFit] Total Original Width of Normal Cols: ${l}px`);const c=a.filter(p=>p.isCollapsed).reduce((p,f)=>p+f.width,0),u=Math.max(0,o-c);if(v.log(`[AutoFit] Collapsed Total Width: ${c}px | Available Width for Normal Cols: ${u}px`),l>0&&a.length>0){let p=0;const f=a.map(x=>{if(x.isCollapsed)return{globalColIndex:x.globalColIndex,remainder:0,width:16};const w=x.width*u/l,S=Math.max(30,Math.floor(w));return p+=S,{globalColIndex:x.globalColIndex,remainder:w-Math.floor(w),width:S}});let b=u-p;v.log(`[AutoFit] Initial Allocated Total: ${p}px | Remainder Pixels to distribute: ${b}`);const m=f.filter(x=>{var w;return!((w=a.find(S=>S.globalColIndex===x.globalColIndex))!=null&&w.isCollapsed)});if(b>0&&m.length>0){m.sort((x,w)=>w.remainder-x.remainder);for(let x=0;x<b;x++)m[x%m.length].width+=1}else if(b<0&&m.length>0){m.sort((x,w)=>x.remainder-w.remainder);for(let x=0;x<Math.abs(b);x++){const w=m[x%m.length];w.width>30&&(w.width-=1)}}const y=f.reduce((x,w)=>x+w.width,0);v.log(`[AutoFit Verification] Target Container Width: ${o}px | Sum of All Calculated Cols: ${y}px`),o!==y?v.log(`โ ๏ธ [AutoFit Mismatch Warning!] ์ค์ฐจ ๋ฐ์: ${o-y}px ์ฐจ์ด๊ฐ ๋ฉ๋๋ค.`):v.log("โ
[AutoFit Success] ์๋ฒฝํ๊ฒ ์ผ์นํฉ๋๋ค!"),f.forEach(({globalColIndex:x,width:w})=>{var S;v.log(`[AutoFit Apply] Col Index ${x} -> ${w}px`),(S=t(this,Ee))==null||S.setColumnWidth(x,w,"body")})}}else this.removeAttribute("auto-fit-col");(n=this.querySelector("nine-table-hscrollbar"))==null||n.refresh()}},"#autoFit"));E(this,"generate",h((e,s)=>{g(this,wi,s),Pr.initializeTable(t(this,ae),e),v.log("=======",e),g(this,qt,{table:fe.compile(e),tbody:{tr:e.querySelectorAll("tbody tr")}}),t(this,Li).call(this),t(this,Qe).call(this),t(this,qn).call(this),t(this,Mn).call(this),["left","body","right"].forEach(i=>{const n=`.ng-container-${i}`;t(this,Je)[i]={thead:this.querySelector(`${n} thead`),tbody:{head:this.querySelector(`${n} tbody.head`),body:this.querySelector(`${n} tbody.body`),foot:this.querySelector(`${n} tbody.foot`)},tfoot:this.querySelector(`${n} tfoot`)}}),t(this,Ot).initialize(),this.isAutoFitCol?this.autoFit(!0):this.querySelector("nine-table-hscrollbar").refresh(),t(this,ws).initialize(),this.loaded=!0},"generate"));d(this,Qe,h(()=>{this.isAutoFitCol,["left","right","body"].forEach(e=>{const s=this.querySelectorAll(`.ng-container-${e}`);if(s.length===0)return;const i=s[0].querySelector("table");if(!i)return;let n=0;i.querySelectorAll("col").forEach(o=>{const l=parseInt(o.getAttribute("width"),10);isNaN(l)||(n+=l)}),s.forEach(o=>{const l=o.querySelectorAll("table");e==="body"?(o.style.flex="1",l.forEach(a=>{})):(o.style.flex=`0 0 ${n}px`,o.style.width=`${n}px`,o.style.minWidth=`${n}px`,o.style.maxWidth=`${n}px`,l.forEach(a=>{}))})})},"#updateContainerWidths"));d(this,Li,h(()=>{[{selector:".ng-container-left",type:"left"},{selector:".ng-container-body",type:null},{selector:".ng-container-right",type:"right"}].forEach(({selector:s,type:i})=>{this.querySelector(`.ng-sheet-body ${s}`).appendChild(t(this,kn).call(this,i))})},"#renderSplitContainers"));d(this,kn,h(e=>{const s=t(this,qt).table.cloneNode(!0);return e==="left"?s.querySelectorAll("col, th, td").forEach(i=>{i.getAttribute("fixed")!=="left"&&i.remove()}):e==="right"?s.querySelectorAll("col, th, td").forEach(i=>{i.getAttribute("fixed")!=="right"&&i.remove()}):s.querySelectorAll("[fixed=left], [fixed=right]").forEach(i=>{i.remove()}),s},"#createSplitTable"));E(this,"getRowHeight",h(()=>t(this,Ot).getRowHeight(),"getRowHeight"));E(this,"scrollToX",h(e=>{const s=this.querySelector(".ng-sheet-body .ng-container-body");s&&(s.scrollLeft=e)},"scrollToX"));E(this,"scrollToY",h(e=>{const s=this.querySelector(".ng-sheet-body");s&&(s.scrollTop=e)},"scrollToY"));d(this,Tn,h(()=>{v.log("11111*****************"),t(this,In).call(this),g(this,vi,new Nr(this)),g(this,Si,new Dr(this)),g(this,Ee,new $r(this)),g(this,xs,new zr(this)),g(this,Ai,new Vi(this)),g(this,Ze,new Pi(this)),g(this,Ei,new Or(this)),g(this,ws,new qr(this)),t(this,Ln,Yl)||g(this,En,new Br(this)),t(this,Je).mainBody.addEventListener("scroll",()=>{this.querySelector("nine-table-hscrollbar").refresh()})},"#init"));d(this,In,h(()=>{v.log("11111*****************");const e=Ci.SCROLLBAR_SIZE;v.log("2222*****************"),this.innerHTML=`
|
|
127
247
|
<style>
|
|
128
248
|
nine-table-sheet {
|
|
129
249
|
display: none;
|
|
130
|
-
|
|
250
|
+
grid-template-columns: 1fr 0px;
|
|
251
|
+
grid-template-rows: 1fr 0px;
|
|
131
252
|
width: 100%;
|
|
132
253
|
height: 100%;
|
|
133
254
|
position: relative;
|
|
@@ -136,325 +257,1464 @@
|
|
|
136
257
|
overflow: hidden;
|
|
137
258
|
}
|
|
138
259
|
|
|
260
|
+
|
|
261
|
+
nine-table-sheet .ng-sheet-body thead {
|
|
262
|
+
display: table-header-group;
|
|
263
|
+
position: sticky;
|
|
264
|
+
top: 0;
|
|
265
|
+
z-index: 10;
|
|
266
|
+
}
|
|
267
|
+
nine-table-sheet .ng-sheet-body tfoot {
|
|
268
|
+
display: table-footer-group;
|
|
269
|
+
position: sticky;
|
|
270
|
+
bottom: 0;
|
|
271
|
+
z-index: 10;
|
|
272
|
+
background: red;
|
|
273
|
+
}
|
|
274
|
+
|
|
139
275
|
nine-table-sheet.active {
|
|
276
|
+
display: grid;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* --- ์ธ๋ก ์คํฌ๋กค๋ฐ๊ฐ ํ์ฑํ๋์์ ๋๋ง CSS๋ก 2์ด ๋๋น ํ์ฅ ๋ฐ ์์ ํ์ --- */
|
|
280
|
+
nine-table-sheet.vscroll-visible {
|
|
281
|
+
grid-template-columns: 1fr ${e}px;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
nine-table-sheet.vscroll-visible nine-table-vscrollbar {
|
|
285
|
+
display: flex;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
nine-table-vscrollbar {
|
|
289
|
+
display: none; /* ํ์์๋ ๊ธฐ๋ณธ ์จ๊น */
|
|
290
|
+
border-top: 2px solid #333;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* --- ๊ฐ๋ก ์คํฌ๋กค๋ฐ๊ฐ ํ์ฑํ๋์์ ๋๋ง CSS๋ก ํ ๋์ด ํ์ฅ ๋ฐ ์์ ํ์ --- */
|
|
294
|
+
nine-table-sheet.hscroll-visible {
|
|
295
|
+
grid-template-rows: 1fr ${e}px;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
nine-table-sheet.hscroll-visible nine-table-hscrollbar,
|
|
299
|
+
nine-table-sheet.hscroll-visible .ng-scroll-edge {
|
|
140
300
|
display: flex;
|
|
141
301
|
}
|
|
142
|
-
|
|
143
|
-
nine-table-
|
|
302
|
+
|
|
303
|
+
nine-table-hscrollbar,
|
|
304
|
+
nine-table-sheet .ng-scroll-edge {
|
|
305
|
+
display: none; /* ํ์์๋ ๊ธฐ๋ณธ ์จ๊น */
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
nine-table-sheet .ng-main-content-wrapper {
|
|
309
|
+
grid-row: 1;
|
|
310
|
+
grid-column: 1;
|
|
144
311
|
display: flex;
|
|
145
|
-
flex-direction:
|
|
146
|
-
flex: 1 1 auto;
|
|
312
|
+
flex-direction: column;
|
|
147
313
|
width: 100%;
|
|
148
|
-
height:
|
|
314
|
+
height: 100%;
|
|
149
315
|
overflow: hidden;
|
|
150
316
|
position: relative;
|
|
151
317
|
}
|
|
318
|
+
|
|
319
|
+
nine-table-sheet .ng-sheet-header,
|
|
320
|
+
nine-table-sheet .ng-sheet-footer {
|
|
321
|
+
display: flex;
|
|
322
|
+
flex-direction: row;
|
|
323
|
+
flex-shrink: 0;
|
|
324
|
+
width: 100%;
|
|
325
|
+
background: #f9fafb;
|
|
326
|
+
z-index: 3;
|
|
327
|
+
overflow: hidden;
|
|
328
|
+
box-sizing: border-box;
|
|
329
|
+
}
|
|
152
330
|
|
|
153
|
-
nine-table-sheet .ng-
|
|
154
|
-
|
|
331
|
+
nine-table-sheet .ng-virtual-height-holder {
|
|
332
|
+
width: 100%;
|
|
333
|
+
pointer-events: none;
|
|
334
|
+
visibility: hidden;
|
|
155
335
|
}
|
|
156
336
|
|
|
157
|
-
|
|
337
|
+
nine-table-sheet .ng-sheet-body {
|
|
338
|
+
display: block;
|
|
339
|
+
flex: 1 1 auto;
|
|
340
|
+
width: 100%;
|
|
341
|
+
height: 100%;
|
|
342
|
+
overflow-y: auto;
|
|
343
|
+
overflow-x: hidden;
|
|
344
|
+
position: relative;
|
|
345
|
+
scrollbar-width: none;
|
|
346
|
+
&::-webkit-scrollbar { display: none; height: 0px; width: 0px; }
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
nine-table-sheet tbody {
|
|
350
|
+
position: relative;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
nine-table-sheet .ng-sheet-body-content {
|
|
354
|
+
display: flex;
|
|
355
|
+
flex-direction: row;
|
|
356
|
+
width: 100%;
|
|
357
|
+
height: 100%;
|
|
358
|
+
left: 0;
|
|
359
|
+
top: 0;
|
|
360
|
+
position: sticky;
|
|
361
|
+
}
|
|
362
|
+
|
|
158
363
|
nine-table-sheet .ng-container-left,
|
|
159
364
|
nine-table-sheet .ng-container-body,
|
|
160
365
|
nine-table-sheet .ng-container-right {
|
|
161
366
|
display: flex;
|
|
162
367
|
flex-direction: column;
|
|
163
|
-
height: 100%;
|
|
164
|
-
background: #ffffff;
|
|
165
368
|
position: relative;
|
|
166
|
-
|
|
369
|
+
background: #ffffff;
|
|
167
370
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
371
|
+
|
|
372
|
+
/* 3. ์ข์ฐ ๊ณ ์ ์์ญ ๊ตฌ๋ถ์ ์ ๊ฑฐ */
|
|
373
|
+
.ng-container-left,
|
|
374
|
+
.ng-container-right {
|
|
375
|
+
border: none;
|
|
172
376
|
}
|
|
173
377
|
|
|
174
|
-
|
|
175
|
-
|
|
378
|
+
.ng-container-left, .ng-container-body, .ng-container-right {
|
|
379
|
+
--border-right: none;
|
|
176
380
|
}
|
|
177
|
-
|
|
178
|
-
nine-table-sheet .
|
|
179
|
-
|
|
180
|
-
flex-shrink: 0;
|
|
381
|
+
|
|
382
|
+
nine-table-sheet tbody.foot {
|
|
383
|
+
height: 100vh;
|
|
181
384
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
385
|
+
|
|
386
|
+
nine-table-sheet .ng-container-left {
|
|
387
|
+
--border-right: 1px solid #e5e7eb;
|
|
185
388
|
flex-shrink: 0;
|
|
186
|
-
overflow: hidden;
|
|
187
|
-
background: #f9fafb;
|
|
188
|
-
z-index: 3;
|
|
389
|
+
overflow: hidden !important;
|
|
189
390
|
}
|
|
190
391
|
|
|
191
|
-
nine-table-sheet .ng-
|
|
392
|
+
nine-table-sheet .ng-container-body {
|
|
192
393
|
flex: 1;
|
|
193
|
-
overflow-y: auto;
|
|
194
394
|
overflow-x: auto;
|
|
195
|
-
|
|
395
|
+
overflow-y: hidden;
|
|
196
396
|
scrollbar-width: none;
|
|
197
|
-
|
|
198
|
-
&::-webkit-scrollbar { display: none; height: 0px; }
|
|
397
|
+
&::-webkit-scrollbar { display: none; height: 0px; width: 0px; }
|
|
199
398
|
}
|
|
200
399
|
|
|
201
|
-
nine-table-sheet .ng-
|
|
400
|
+
nine-table-sheet .ng-container-right {
|
|
202
401
|
flex-shrink: 0;
|
|
203
402
|
overflow: hidden;
|
|
204
|
-
background: #f9fafb;
|
|
205
|
-
border-top: 2px solid #d1d5db;
|
|
206
|
-
z-index: 2;
|
|
207
403
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
404
|
+
nine-table-sheet .ng-container-left, nine-table-sheet .ng-container-right {
|
|
405
|
+
filter: brightness(99%);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
/* --- ์ธ๋ก ์คํฌ๋กค๋ฐ (Grid Row 1, Col 2) --- */
|
|
411
|
+
nine-table-vscrollbar {
|
|
412
|
+
grid-row: 1;
|
|
413
|
+
grid-column: 2;
|
|
414
|
+
width: ${e}px;
|
|
415
|
+
height: 100%;
|
|
416
|
+
z-index: 50;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/* --- ๊ฐ๋ก ์คํฌ๋กค๋ฐ (Grid Row 2, Col 1 ์ง์ ์์ฐฉ) --- */
|
|
420
|
+
nine-table-hscrollbar {
|
|
421
|
+
grid-row: 2;
|
|
422
|
+
grid-column: 1;
|
|
211
423
|
flex-direction: row;
|
|
212
424
|
height: ${e}px;
|
|
213
425
|
min-height: ${e}px;
|
|
214
|
-
flex-shrink: 0;
|
|
215
426
|
background: #f9fafb;
|
|
216
427
|
border-top: 1px solid #e5e7eb;
|
|
428
|
+
z-index: 10;
|
|
429
|
+
overflow: hidden;
|
|
430
|
+
width: 100%;
|
|
217
431
|
}
|
|
218
|
-
|
|
432
|
+
|
|
433
|
+
/* --- ์ฐํ๋จ ์ฃ์ง (Grid Row 2, Col 2) --- */
|
|
219
434
|
nine-table-sheet .ng-scroll-edge {
|
|
435
|
+
grid-row: 2;
|
|
436
|
+
grid-column: 2;
|
|
220
437
|
width: ${e}px;
|
|
221
|
-
|
|
222
|
-
height: 100%;
|
|
223
|
-
flex-shrink: 0;
|
|
438
|
+
height: ${e}px;
|
|
224
439
|
background: #f3f4f6;
|
|
440
|
+
border-top: 1px solid #e5e7eb;
|
|
441
|
+
z-index: 10;
|
|
225
442
|
}
|
|
226
443
|
|
|
444
|
+
nine-table-sheet col {
|
|
445
|
+
width: attr(width px); /* ๋ธ๋ผ์ฐ์ ๊ฐ ์ง์ํ๋ ๊ฒฝ์ฐ ๋๋ ์๋ ์ฒ๋ผ ๊ณ ์ ์
๋ ํฐ ํ์ฉ */
|
|
446
|
+
}
|
|
447
|
+
|
|
227
448
|
nine-table-sheet table {
|
|
228
|
-
border-collapse:
|
|
229
|
-
|
|
449
|
+
border-collapse: separate;
|
|
450
|
+
border-spacing: 0;
|
|
451
|
+
width: auto;
|
|
452
|
+
min-width: 100%;
|
|
230
453
|
table-layout: fixed;
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
454
|
+
box-sizing: border-box;
|
|
455
|
+
}
|
|
456
|
+
nine-table-sheet[auto-fit-col="true"] table {
|
|
457
|
+
width: 100%;
|
|
458
|
+
min-width: 100%;
|
|
234
459
|
}
|
|
235
|
-
|
|
460
|
+
|
|
236
461
|
nine-table-sheet th, nine-table-sheet td {
|
|
237
462
|
box-sizing: border-box;
|
|
238
463
|
overflow: hidden;
|
|
239
464
|
white-space: nowrap;
|
|
240
465
|
text-overflow: ellipsis;
|
|
241
|
-
padding:
|
|
242
|
-
|
|
466
|
+
padding: 0px 4px;
|
|
467
|
+
/* ๐ก ์ํ์ข์ฐ ํ
๋๋ฆฌ ๊ณต๊ฐ์ 1px ๊ณ ์ ์ผ๋ก 4๋ฐฉํฅ ๋ชจ๋ ์ก์์ค๋๋ค */
|
|
468
|
+
border-top: 1px solid transparent;
|
|
469
|
+
border-left: 1px solid transparent;
|
|
470
|
+
border-right: 1px solid #e5e7eb;
|
|
471
|
+
border-bottom: 1px solid #e5e7eb;
|
|
243
472
|
font-size: 12px;
|
|
244
473
|
color: #111827;
|
|
474
|
+
position: relative;
|
|
475
|
+
outline: none;
|
|
245
476
|
}
|
|
246
|
-
|
|
477
|
+
|
|
247
478
|
nine-table-sheet th {
|
|
248
479
|
background-color: #f9fafb;
|
|
249
480
|
font-weight: 600;
|
|
250
481
|
text-align: left;
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
nine-table-sheet tfoot td, nine-table-sheet tfoot th {
|
|
254
|
-
font-weight: 600;
|
|
482
|
+
user-select: none;
|
|
255
483
|
}
|
|
256
484
|
|
|
257
|
-
nine-splitter {
|
|
258
|
-
display: none;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.ng-scroll-content {
|
|
262
|
-
position: relative;
|
|
263
|
-
width: 100%;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.ng-virtual-spacer {
|
|
267
|
-
width: 100%;
|
|
268
|
-
pointer-events: none;
|
|
269
|
-
--display: none;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
nine-table-sheet td,
|
|
273
|
-
nine-table-sheet th {
|
|
274
|
-
outline: none;
|
|
275
|
-
}
|
|
276
485
|
|
|
486
|
+
|
|
487
|
+
/* ๐ฏ ์
์ ํ ์์ญ ์คํ์ผ (selected ๋ฐ ํ
๋๋ฆฌ์ ๋ค) */
|
|
488
|
+
/* --- ๐ฏ ์
์ ํ ๋ฐ ํฌ์ปค์ค(์์์ ) ๊ด๋ จ ์คํ์ผ (ํ์ ์ถ๊ฐ) --- */
|
|
277
489
|
nine-table-sheet td.selected,
|
|
278
490
|
nine-table-sheet th.selected {
|
|
279
491
|
background-color: rgba(37, 99, 235, 0.08);
|
|
280
|
-
--position: relative; /* z-index์ ๊ฐ์ ์์ ๊ธฐ์ค์ */
|
|
281
492
|
}
|
|
282
493
|
|
|
283
494
|
nine-table-sheet td.selected-start,
|
|
284
495
|
nine-table-sheet th.selected-start {
|
|
285
496
|
background-color: transparent;
|
|
286
497
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
nine-table-sheet td.selected-
|
|
290
|
-
nine-table-sheet td.selected-
|
|
291
|
-
nine-table-sheet td.selected-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
<div class="ng-virtual-spacer"></div>
|
|
310
|
-
</div>
|
|
311
|
-
</div>
|
|
312
|
-
<div class="ng-part-footer"></div>
|
|
313
|
-
</div>
|
|
314
|
-
<div class='ng-container-right'>
|
|
315
|
-
<div class="ng-part-header"></div>
|
|
316
|
-
<div class="ng-part-body">
|
|
317
|
-
<div class="ng-scroll-content">
|
|
318
|
-
<div class="ng-virtual-spacer"></div>
|
|
319
|
-
</div>
|
|
320
|
-
</div>
|
|
321
|
-
<div class="ng-part-footer"></div>
|
|
322
|
-
</div>
|
|
323
|
-
|
|
324
|
-
<div class="ng-nodata-overlay">
|
|
325
|
-
Data Not Found
|
|
326
|
-
</div>
|
|
327
|
-
|
|
328
|
-
<nine-table-vscrollbar></nine-table-vscrollbar>
|
|
329
|
-
</div>
|
|
330
|
-
<div class='ng-container-bottom'>
|
|
331
|
-
<nine-table-hscrollbar></nine-table-hscrollbar>
|
|
332
|
-
<div class='ng-scroll-edge'></div>
|
|
333
|
-
</div>
|
|
334
|
-
`},"#render"));p(this,Q,new ke(this)),p(this,ue,this.getRootNode().host)}connectedCallback(){t(this,pe).call(this)}get rowManager(){return t(this,Q)}get selection(){return t(this,Bt)}get templateLength(){return t(this,V).tbody.tr.length}get navigation(){return t(this,Pt)}disconnectedCallback(){this.innerHTML="",x.log("NineTableSheet destroyed.")}};ue=new WeakMap,Q=new WeakMap,Bt=new WeakMap,Pt=new WeakMap,V=new WeakMap,ge=new WeakMap,be=new WeakMap,xt=new WeakMap,pe=new WeakMap,ye=new WeakMap,d(Ft,"NineTableSheet"),T(Ft,"SCROLLBAR_SIZE",16);let Qt=Ft;customElements.get("nine-table-sheet")||customElements.define("nine-table-sheet",Qt);const es=class es extends HTMLElement{constructor(){super();h(this,me,d(()=>{var e;(e=this.querySelector(".nine-tab-bar"))==null||e.addEventListener("click",s=>{var i;const n=s.ctrlKey||s.metaKey||s.shiftKey,o=parseInt((i=s.target.closest(".nine-tab-item"))==null?void 0:i.dataset.index,10);t(this,jt).call(this,o,n)}),t(this,jt).call(this,0,!1)},"#init"));h(this,jt,d((e,s=!1)=>{const n=d(()=>{const u=Array.from(this.querySelectorAll("nine-table-sheet"));Array.from(this.querySelectorAll("nine-splitter")).forEach(f=>f.style.setProperty("display","none"));const b=u.filter(f=>f.classList.contains("active"));b.length<2||b.forEach(f=>{const y=parseInt(f.getAttribute("data-index"),10),v=this.querySelector(`nine-splitter[data-split-index="${y}"]`),S=u[y+1];v&&S&&S.classList.contains("active")&&v.style.setProperty("display","flex")})},"updateSplitters"),o=this.querySelector(".nine-tab-bar"),i=this.querySelector("nine-table-sheets-body"),a=o.querySelectorAll(".nine-tab-item"),c=i.querySelectorAll("nine-table-sheet");if(!a[e])return;if(!s)a.forEach((u,g)=>{u.classList.toggle("active",g===e)}),c.forEach((u,g)=>{const b=g===e;u.classList.toggle("active",b),u.style.flex=b?"1 1 100%":""});else{const u=a[e],g=o.querySelectorAll(".nine-tab-item.active");if(u.classList.contains("active")&&g.length<=1)return;u.classList.toggle("active");const b=i.querySelector(`nine-table-sheet[data-index="${e}"]`);b&&(b.classList.toggle("active"),b.classList.contains("active")||(b.style.flex=""))}const l=i.querySelectorAll("nine-table-sheet.active");l==null||l.forEach(u=>{u.style.flex=l.length>1?"1 1 0%":"1 1 100%"}),n()},"#switchSheet"))}connectedCallback(){t(this,me).call(this)}};me=new WeakMap,jt=new WeakMap,d(es,"NineTableSheets");let He=es;customElements.get("nine-table-sheets")||customElements.define("nine-table-sheets",He);const ss=class ss{constructor(r){h(this,O);h(this,we,d(()=>{t(this,xe).call(this),new ResizeObserver(r=>{for(let e of r)t(this,O).getAttribute("auto-height")==="true"&&t(this,Vt).call(this)}).observe(t(this,O))},"#init"));h(this,Vt,d(()=>{var c,l;const r=Array.from(t(this,O).shadowRoot.querySelectorAll("nine-table-sheet.active"));if(r.length===0)return;const e=parseInt(t(this,O).getAttribute("max-display-row"),10)||10,s=Math.max(...r.map(u=>u.getRowHeight())),n=(c=t(this,O).shadowRoot.querySelector("nine-table-header"))==null?void 0:c.getBoundingClientRect().height,o=(l=t(this,O).shadowRoot.querySelector("nine-table-sheets-footer"))==null?void 0:l.getBoundingClientRect().height,i=Qt.SCROLLBAR_SIZE,a=e*s+n+o+i;t(this,O).style.height=`${a}px`},"#applyAutoHeight"));h(this,xe,d(()=>{const e=Array.from(t(this,O).children).filter(c=>c.tagName==="TABLE"),s=t(this,O).getAttribute("auto-height")==="true",n=e.length,o=e.map((c,l)=>{const g=`<nine-table-sheet class="${l===0?"active":""}" data-index="${l}"></nine-table-sheet>`,b=l<n-1?`<nine-splitter class="h" data-split-index="${l}"></nine-splitter>`:"";return g+b}).join(""),i=e.map((c,l)=>`<div class="nine-tab-item ${l===0?"active":""}" data-index="${l}">Sheet ${l+1}</div>`).join("");t(this,O).shadowRoot.innerHTML=`
|
|
335
|
-
<style>
|
|
336
|
-
:host {
|
|
337
|
-
display: flex;
|
|
338
|
-
flex-direction: column;
|
|
339
|
-
position: relative;
|
|
340
|
-
overflow: hidden;
|
|
341
|
-
height: ${s?"auto":"100%"};
|
|
342
|
-
background: #fff;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
nine-table-header { height: 40px; display: block; flex-shrink: 0; border-bottom: 1px solid #e5e7eb; background: #fff; }
|
|
346
|
-
nine-table-body { display: flex; flex-direction: row; flex: 1; overflow: hidden; position: relative; }
|
|
347
|
-
nine-table-summary { display: none; width: 250px; flex-shrink: 0; border-right: 1px solid #e5e7eb; }
|
|
348
|
-
--nine-splitter:not([data-split-index]) { width: 4px; background: #e5e7eb; cursor: col-resize; flex-shrink: 0; }
|
|
349
|
-
nine-table-analysis { display: none; }
|
|
350
|
-
nine-table-footer { display: none; }
|
|
351
|
-
|
|
352
|
-
nine-table-sheets {
|
|
353
|
-
flex: 1;
|
|
354
|
-
display: flex;
|
|
355
|
-
flex-direction: column;
|
|
356
|
-
overflow: hidden;
|
|
357
|
-
position: relative;
|
|
358
|
-
background: #fff;
|
|
498
|
+
|
|
499
|
+
nine-table-sheet tr td.selected-top { border-top: 2px solid #2563eb; }
|
|
500
|
+
nine-table-sheet tr td.selected-bottom { border-bottom: 2px solid #2563eb; }
|
|
501
|
+
nine-table-sheet tr td.selected-left { border-left: 2px solid #2563eb; }
|
|
502
|
+
nine-table-sheet tr td.selected-right { border-right: 2px solid #2563eb; }
|
|
503
|
+
|
|
504
|
+
/* ๐ฏ [๋ณต์] ์ปฌ๋ผ ์ ๊ธฐ/ํผ์น๊ธฐ ์์ด์ฝ ์ปดํฌ๋ํธ ์คํ์ผ */
|
|
505
|
+
nine-table-col-expand {
|
|
506
|
+
position: absolute;
|
|
507
|
+
--top: 50%;
|
|
508
|
+
right: 2px;
|
|
509
|
+
top: 2px;
|
|
510
|
+
--transform: translateY(-50%);
|
|
511
|
+
width: 12px;
|
|
512
|
+
height: 12px;
|
|
513
|
+
cursor: pointer;
|
|
514
|
+
background-repeat: no-repeat;
|
|
515
|
+
background-position: center;
|
|
516
|
+
background-size: contain;
|
|
517
|
+
z-index: 2;
|
|
518
|
+
pointer-events: auto;
|
|
519
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%234b5563" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M6 8a.5.5 0 0 0 .5.5h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L12.293 7.5H6.5A.5.5 0 0 0 6 8m-2.5 7a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 1 0v13a.5.5 0 0 1-.5.5"/></svg>');
|
|
359
520
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
521
|
+
|
|
522
|
+
nine-table-col-expand.expand {
|
|
523
|
+
right: 2px;
|
|
524
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%234b5563" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M12.5 15a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 1 0v13a.5.5 0 0 1-.5.5M10 8a.5.5 0 0 1-.5.5H3.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L3.707 7.5H9.5a.5.5 0 0 1 .5.5"/></svg>');
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
nine-table-col-expand.collapsed {
|
|
528
|
+
left: 50%;
|
|
529
|
+
right: auto;
|
|
530
|
+
transform: translate(-50%, 0);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
nine-table-sheet th:has(nine-table-col-expand),
|
|
534
|
+
nine-table-sheet td:has(nine-table-col-expand) {
|
|
363
535
|
position: relative;
|
|
364
|
-
display: flex;
|
|
365
|
-
flex-direction: row;
|
|
366
536
|
}
|
|
367
537
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
538
|
+
/* ์ ๋ ฌ ์์ด์ฝ ์ฌ๋ฐฑ */
|
|
539
|
+
nine-table-sheet thead th.asc::after,
|
|
540
|
+
nine-table-sheet thead td.asc::after,
|
|
541
|
+
nine-table-sheet thead th.desc::after,
|
|
542
|
+
nine-table-sheet thead td.desc::after {
|
|
543
|
+
content: "";
|
|
544
|
+
display: inline-block;
|
|
545
|
+
width: 0;
|
|
546
|
+
height: 0;
|
|
376
547
|
flex-shrink: 0;
|
|
548
|
+
margin-left: 4px;
|
|
549
|
+
vertical-align: middle;
|
|
377
550
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
height: 100%;
|
|
551
|
+
|
|
552
|
+
nine-table-sheet thead th.asc::after,
|
|
553
|
+
nine-table-sheet thead td.asc::after {
|
|
554
|
+
border-left: 4px solid transparent;
|
|
555
|
+
border-right: 4px solid transparent;
|
|
556
|
+
border-bottom: 6px solid #2563eb;
|
|
385
557
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
border: 1px solid #d1d5db;
|
|
393
|
-
border-top: none;
|
|
394
|
-
border-radius: 0 0 3px 3px;
|
|
395
|
-
user-select: none;
|
|
558
|
+
|
|
559
|
+
nine-table-sheet thead th.desc::after,
|
|
560
|
+
nine-table-sheet thead td.desc::after {
|
|
561
|
+
border-left: 4px solid transparent;
|
|
562
|
+
border-right: 4px solid transparent;
|
|
563
|
+
border-top: 6px solid #dc2626;
|
|
396
564
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
border-bottom: 2px solid #2563eb;
|
|
565
|
+
|
|
566
|
+
nine-table-sheet[filtering="true"] .ng-sheet-header th,
|
|
567
|
+
nine-table-sheet[filtering="true"] .ng-sheet-header td {
|
|
568
|
+
padding-right: 22px !important;
|
|
402
569
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
570
|
+
|
|
571
|
+
/* ํํฐ ๋ฒํผ ์์ด์ฝ */
|
|
572
|
+
nine-table-filter-button {
|
|
573
|
+
position: absolute;
|
|
574
|
+
bottom: 2px;
|
|
575
|
+
right: 2px;
|
|
576
|
+
width: 12px;
|
|
577
|
+
height: 12px;
|
|
578
|
+
cursor: pointer;
|
|
579
|
+
z-index: 2;
|
|
580
|
+
background-repeat: no-repeat;
|
|
581
|
+
background-position: center;
|
|
582
|
+
background-size: contain;
|
|
583
|
+
display: inline-block;
|
|
584
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 16 16"><path fill="%239ca3af" d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5zm1 .5v1.308l4.372 4.858A.5.5 0 0 1 7 8.5v5.306l2-.666V8.5a.5.5 0 0 1 .128-.334L13.5 3.308V2z"/></svg>');
|
|
408
585
|
}
|
|
409
|
-
|
|
586
|
+
|
|
587
|
+
nine-table-filter-button.filtered {
|
|
588
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 16 16"><path fill="%232563eb" d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5z"/></svg>');
|
|
589
|
+
}
|
|
590
|
+
|
|
410
591
|
nine-table-sheet .ng-nodata-overlay {
|
|
411
592
|
display: none;
|
|
412
593
|
position: absolute;
|
|
413
|
-
|
|
414
|
-
|
|
594
|
+
top: 0; /* ๐ ์๋จ๋ถํฐ */
|
|
595
|
+
left: 0; /* ๐ ์ข์ธก๋ถํฐ */
|
|
596
|
+
right: 0; /* ๐ ์ฐ์ธก๊น์ง ๊ฝ ์ฑ์ */
|
|
597
|
+
bottom: 0; /* ๐ ํ๋จ๊น์ง ๊ฝ ์ฑ์ (absolute๋ก ์ ์ฒด ์์ญ ์ปค๋ฒ) */
|
|
415
598
|
background: #ffffff;
|
|
416
|
-
z-index:
|
|
599
|
+
z-index: 20;
|
|
417
600
|
align-items: center;
|
|
418
601
|
justify-content: center;
|
|
419
602
|
font-size: 12px;
|
|
420
603
|
color: #9ca3af;
|
|
421
604
|
}
|
|
605
|
+
|
|
422
606
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
607
|
+
|
|
608
|
+
nine-table-sheet .ng-col-mover-indi {
|
|
609
|
+
position: absolute;
|
|
610
|
+
width: 2px;
|
|
611
|
+
background-color: #2563eb;
|
|
612
|
+
display: none;
|
|
613
|
+
pointer-events: none;
|
|
614
|
+
z-index: 10020;
|
|
615
|
+
box-sizing: border-box;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
nine-table-sheet .ng-col-mover-indi::before {
|
|
619
|
+
content: '';
|
|
620
|
+
position: absolute;
|
|
621
|
+
top: -6px;
|
|
622
|
+
left: -4px;
|
|
623
|
+
width: 0;
|
|
624
|
+
height: 0;
|
|
625
|
+
border-top: 6px solid #2563eb;
|
|
626
|
+
border-left: 5px solid transparent;
|
|
627
|
+
border-right: 5px solid transparent;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
nine-table-sheet .ng-col-mover-indi::after {
|
|
631
|
+
content: '';
|
|
632
|
+
position: absolute;
|
|
633
|
+
bottom: -6px;
|
|
634
|
+
left: -4px;
|
|
635
|
+
width: 0;
|
|
636
|
+
height: 0;
|
|
637
|
+
border-bottom: 6px solid #2563eb;
|
|
638
|
+
border-left: 5px solid transparent;
|
|
639
|
+
border-right: 5px solid transparent;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
nine-table-sheet .ng-col-mover-grip {
|
|
643
|
+
position: absolute;
|
|
644
|
+
box-sizing: border-box;
|
|
645
|
+
display: none;
|
|
646
|
+
pointer-events: none;
|
|
647
|
+
z-index: 10010;
|
|
648
|
+
background-color: rgba(37, 99, 235, 0.12);
|
|
649
|
+
border: none;
|
|
650
|
+
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
|
|
651
|
+
overflow: hidden;
|
|
652
|
+
backdrop-filter: blur(1px);
|
|
653
|
+
transition: background-color 0.15s ease, border-color 0.15s ease;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
nine-table-sheet .ng-col-mover-grip .grip-header-content {
|
|
657
|
+
position: absolute;
|
|
658
|
+
top: 0;
|
|
659
|
+
left: 0;
|
|
660
|
+
width: 100%;
|
|
661
|
+
box-sizing: border-box;
|
|
662
|
+
z-index: 2;
|
|
663
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
nine-table-sheet .ng-col-mover-grip.invalid {
|
|
667
|
+
background-color: rgba(239, 68, 68, 0.12);
|
|
668
|
+
box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
nine-table-sheet .ng-col-mover-grip.invalid .grip-header-content {
|
|
672
|
+
border-bottom: 2px solid #ef4444;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
nine-table-sheet .ng-col-mover-grip th,
|
|
676
|
+
nine-table-sheet .ng-col-mover-grip td {
|
|
677
|
+
box-sizing: border-box;
|
|
678
|
+
user-select: none;
|
|
679
|
+
pointer-events: none;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/* ๐ฏ ์ ๋ ฌ ์์ด์ฝ ๊ณตํต (๊ฐ์ ์์ - ํค๋ ๋ฐ ๋๋๊ทธ ๊ทธ๋ฆฝ ํจ๋ ๊ณตํต ์ ์ฉ) */
|
|
683
|
+
nine-table-sheet .ng-sheet-header th.asc::after,
|
|
684
|
+
nine-table-sheet .ng-sheet-header td.asc::after,
|
|
685
|
+
nine-table-sheet .ng-sheet-header th.desc::after,
|
|
686
|
+
nine-table-sheet .ng-sheet-header td.desc::after,
|
|
687
|
+
nine-table-sheet .ng-col-mover-grip th.asc::after, /* ๐ ๊ทธ๋ฆฝ ํจ๋ ํ๊ฒ ์ถ๊ฐ */
|
|
688
|
+
nine-table-sheet .ng-col-mover-grip td.asc::after,
|
|
689
|
+
nine-table-sheet .ng-col-mover-grip th.desc::after, /* ๐ ๊ทธ๋ฆฝ ํจ๋ ํ๊ฒ ์ถ๊ฐ */
|
|
690
|
+
nine-table-sheet .ng-col-mover-grip td.desc::after {
|
|
691
|
+
content: "";
|
|
692
|
+
display: inline-block;
|
|
693
|
+
width: 0;
|
|
694
|
+
height: 0;
|
|
695
|
+
flex-shrink: 0;
|
|
696
|
+
margin-left: 4px;
|
|
697
|
+
vertical-align: middle;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/* ์ค๋ฆ์ฐจ์ (โฒ): ์์ชฝ์ ๊ฐ๋ฆฌํค๋ ์ผ๊ฐํ */
|
|
701
|
+
nine-table-sheet .ng-sheet-header th.asc::after,
|
|
702
|
+
nine-table-sheet .ng-sheet-header td.asc::after,
|
|
703
|
+
nine-table-sheet .ng-col-mover-grip th.asc::after, /* ๐ ์ถ๊ฐ */
|
|
704
|
+
nine-table-sheet .ng-col-mover-grip td.asc::after {
|
|
705
|
+
border-left: 4px solid transparent;
|
|
706
|
+
border-right: 4px solid transparent;
|
|
707
|
+
border-bottom: 6px solid #2563eb; /* ๋ธ๋ฃจ ํฌ์ธํธ */
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/* ๋ด๋ฆผ์ฐจ์ (โผ): ์๋์ชฝ์ ๊ฐ๋ฆฌํค๋ ์ผ๊ฐํ */
|
|
711
|
+
nine-table-sheet .ng-sheet-header th.desc::after,
|
|
712
|
+
nine-table-sheet .ng-sheet-header td.desc::after,
|
|
713
|
+
nine-table-sheet .ng-col-mover-grip th.desc::after, /* ๐ ์ถ๊ฐ */
|
|
714
|
+
nine-table-sheet .ng-col-mover-grip td.desc::after {
|
|
715
|
+
border-left: 4px solid transparent;
|
|
716
|
+
border-right: 4px solid transparent;
|
|
717
|
+
border-top: 6px solid #dc2626; /* ๋ ๋ ํฌ์ธํธ */
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
nine-table-sheet th.resizable-edge,
|
|
721
|
+
nine-table-sheet td.resizable-edge {
|
|
722
|
+
cursor: col-resize;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
nine-table-sheet .ng-col-resizer-panel {
|
|
726
|
+
position: absolute;
|
|
727
|
+
top: 0;
|
|
728
|
+
left: 0;
|
|
729
|
+
width: 100%;
|
|
730
|
+
height: 100%;
|
|
731
|
+
pointer-events: none;
|
|
732
|
+
display: none;
|
|
733
|
+
z-index: 9999;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
nine-table-sheet .ng-col-resizer-panel.active {
|
|
737
|
+
display: block;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
nine-table-sheet .ng-col-resizer-panel .grip {
|
|
741
|
+
position: absolute;
|
|
742
|
+
top: 0;
|
|
743
|
+
width: 1px;
|
|
744
|
+
height: 100%;
|
|
745
|
+
background-color: #2563eb;
|
|
746
|
+
left: var(--resizer-left, 0px);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
nine-table-sheet .ng-col-resizer-panel .tooltip {
|
|
750
|
+
position: absolute;
|
|
751
|
+
top: 0px;
|
|
752
|
+
left: var(--tooltip-left, 0px);
|
|
753
|
+
width: var(--tooltip-width, 0px);
|
|
754
|
+
height: 24px;
|
|
755
|
+
display: flex;
|
|
756
|
+
flex-direction: column;
|
|
757
|
+
align-items: center;
|
|
758
|
+
pointer-events: none;
|
|
759
|
+
z-index: 10000;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
nine-table-sheet .ng-col-resizer-panel .tooltip .line-wrapper {
|
|
763
|
+
width: 100%;
|
|
764
|
+
height: 1px;
|
|
765
|
+
background-color: #2563eb;
|
|
766
|
+
position: relative;
|
|
767
|
+
display: flex;
|
|
768
|
+
align-items: center;
|
|
769
|
+
justify-content: space-between;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
nine-table-sheet .ng-col-resizer-panel .resizer-overlay {
|
|
773
|
+
position: absolute;
|
|
774
|
+
top: 0;
|
|
775
|
+
left: var(--tooltip-left, 0px);
|
|
776
|
+
width: var(--tooltip-width, 0px);
|
|
777
|
+
height: 100%;
|
|
778
|
+
background-color: rgba(37, 99, 235, 0.12);
|
|
779
|
+
border-left: 1px dashed #2563eb;
|
|
780
|
+
border-right: 2px solid #2563eb;
|
|
781
|
+
box-sizing: border-box;
|
|
782
|
+
display: flex;
|
|
783
|
+
align-items: flex-start;
|
|
784
|
+
justify-content: center;
|
|
785
|
+
padding-top: 8px;
|
|
786
|
+
pointer-events: none;
|
|
787
|
+
opacity: 1;
|
|
788
|
+
transition: opacity 0.15s ease-out;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
nine-table-sheet .ng-col-resizer-panel .resizer-overlay.fade-out {
|
|
792
|
+
opacity: 0;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
nine-table-sheet th.resize-flash {
|
|
796
|
+
transition: background-color 0.3s ease;
|
|
797
|
+
background-color: rgba(37, 99, 235, 0.15);
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
nine-table-sheet .ng-col-resizer-panel .resizer-overlay .size-badge {
|
|
801
|
+
padding: 2px 8px;
|
|
802
|
+
font-size: 11px;
|
|
803
|
+
font-weight: 700;
|
|
804
|
+
color: #ffffff;
|
|
805
|
+
background-color: #1e40af;
|
|
806
|
+
border-radius: 4px;
|
|
807
|
+
line-height: 14px;
|
|
808
|
+
white-space: nowrap;
|
|
809
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
nine-table-sheet tr.ng-sticky-header {
|
|
813
|
+
background-color: #f3f4f6 !important; /* ์ผ๋ฐ ํ๋ณด๋ค ์ด์ง ์งํ ๋ฐฐ๊ฒฝ์ */
|
|
814
|
+
font-weight: 600;
|
|
815
|
+
z-index: 5; /* ๋ค๋ฅธ ํ๋ค๋ณด๋ค ์์ ๋ณด์ด๋๋ก ์ค์ */
|
|
816
|
+
position: relative;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/* ์คํฌ๋กค๋๋ฉด์ ๋ฐ๋ ค ๋ด๋ ค๊ฐ ๋ ์
์ฒด๊ฐ์ ์ฃผ๋ ํ๋จ ๊ทธ๋ฆผ์ ํจ๊ณผ */
|
|
820
|
+
nine-table-sheet tr.ng-sticky-header td {
|
|
821
|
+
border-bottom: 2px solid #d1d5db !important;
|
|
822
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
td.invalid::after {
|
|
827
|
+
content: "";
|
|
828
|
+
position: absolute;
|
|
829
|
+
top: 0;
|
|
830
|
+
right: 0;
|
|
831
|
+
width: 0;
|
|
832
|
+
height: 0;
|
|
833
|
+
border-top: 2px solid red;
|
|
834
|
+
border-right: 2px solid red;
|
|
835
|
+
border-bottom: 2px solid transparent; /* ์๋์ชฝ์ ํฌ๋ช
ํ๊ฒ ํ์ฌ ์ผ๊ฐํ ์์ฑ */
|
|
836
|
+
border-left: 2px solid transparent; /* ์ผ์ชฝ์ ํฌ๋ช
ํ๊ฒ ํ์ฌ ์ผ๊ฐํ ์์ฑ */
|
|
837
|
+
z-index: 1;
|
|
838
|
+
pointer-events: none;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
nine-table-sheet td[disabled="true"] {
|
|
842
|
+
input,button {
|
|
843
|
+
background: #f0f0f0;
|
|
844
|
+
opacity: 0.5;
|
|
845
|
+
pointer-events: none;
|
|
435
846
|
}
|
|
436
|
-
|
|
437
847
|
}
|
|
438
848
|
|
|
849
|
+
|
|
439
850
|
</style>
|
|
440
851
|
|
|
441
|
-
|
|
852
|
+
<!-- [Grid Row 1, Col 1] ๋ฉ์ธ ์ฝํ
์ธ ๋ํผ -->
|
|
853
|
+
|
|
854
|
+
<div class="ng-sheet-body">
|
|
855
|
+
<div class="ng-sheet-body-content">
|
|
856
|
+
<div class="ng-container-left"></div>
|
|
857
|
+
<div class="ng-container-body"></div>
|
|
858
|
+
<div class="ng-container-right"></div>
|
|
859
|
+
</div>
|
|
860
|
+
<div class="ng-virtual-height-holder"></div>
|
|
861
|
+
</div>
|
|
862
|
+
|
|
863
|
+
<div class="ng-nodata-overlay">Data Not Found</div>
|
|
864
|
+
|
|
865
|
+
<!-- [Grid Row 1, Col 2] ์ธ๋ก ์คํฌ๋กค๋ฐ -->
|
|
866
|
+
<nine-table-vscrollbar></nine-table-vscrollbar>
|
|
867
|
+
|
|
868
|
+
<!-- [Grid Row 2, Col 1] ๊ฐ๋ก ์คํฌ๋กค๋ฐ -->
|
|
869
|
+
<nine-table-hscrollbar></nine-table-hscrollbar>
|
|
870
|
+
|
|
871
|
+
<!-- [Grid Row 2, Col 2] ์ฐํ๋จ ์ฃ์ง -->
|
|
872
|
+
<div class="ng-scroll-edge"></div>
|
|
873
|
+
|
|
874
|
+
<!-- ๋ฆฌ์ฌ์ด์ ๋ฐ ๋๋๊ทธ ํจ๋๋ค -->
|
|
875
|
+
<div class="ng-col-resizer-panel">
|
|
876
|
+
<div class="resizer-overlay">
|
|
877
|
+
<span class="size-badge">0px</span>
|
|
878
|
+
</div>
|
|
879
|
+
</div>
|
|
880
|
+
|
|
881
|
+
<div class="ng-col-mover-grip"></div>
|
|
882
|
+
<div class="ng-col-mover-indi"></div>
|
|
883
|
+
`,v.log("3333*****************"),g(this,Je,{mainBody:this.querySelector(".ng-sheet-body .ng-container-body"),hscrollbar:this.querySelector("nine-table-hscrollbar"),vscrollbar:this.querySelector("nine-table-vscrollbar"),content:this.querySelector(".ng-sheet-body .ng-sheet-body-content"),scrollHolder:this.querySelector(".ng-sheet-body .ng-virtual-height-holder")}),v.log("444*****************")},"#render"));d(this,qn,h(()=>{v.log("**********************","#syncHeaderAndFooterHeights");const e=this.querySelector(".ng-container-left table"),s=this.querySelector(".ng-container-body table"),i=this.querySelector(".ng-container-right table"),n=Array.from(e.querySelectorAll("thead tr:not(.col-indicator-rowgroup)")),o=Array.from(s.querySelectorAll("thead tr:not(.col-indicator-rowgroup)")),l=Array.from(i.querySelectorAll("thead tr:not(.col-indicator-rowgroup)"));t(this,Ri).call(this,n,o,l);const a=Array.from(e.querySelectorAll("tfoot tr")),c=Array.from(s.querySelectorAll("tfoot tr")),u=Array.from(i.querySelectorAll("tfoot tr"));t(this,Ri).call(this,a,c,u)},"#syncHeaderAndFooterHeights"));d(this,Ri,h((e,s,i)=>{var o,l,a;const n=Math.max(e.length,s.length,i.length);for(let c=0;c<n;c++){const u=[((o=e[c])==null?void 0:o.getBoundingClientRect().height)||0,((l=s[c])==null?void 0:l.getBoundingClientRect().height)||0,((a=i[c])==null?void 0:a.getBoundingClientRect().height)||0],p=Math.max(...u);p>0&&(e[c]&&(e[c].style.height=`${p}px`),s[c]&&(s[c].style.height=`${p}px`),i[c]&&(i[c].style.height=`${p}px`))}},"#applyMaxHeights"));d(this,Mn,h(()=>{const e=this.querySelector(".ng-sheet-body");if(!e)return;let s=null;e.addEventListener("mouseover",i=>{const n=i.target.closest("tr");if(!n||!n.dataset.row&&n.dataset.row!=="0")return;const o=n.dataset.row;s!==o&&(s=o,e.querySelectorAll(`tr[data-row="${o}"]`).forEach(l=>{l.classList.add("hover")}))}),e.addEventListener("mouseout",i=>{const n=i.target.closest("tr");if(!n)return;const o=i.relatedTarget;n.contains(o)||(e.querySelectorAll("tr.hover").forEach(l=>{l.classList.remove("hover")}),s=null)})},"#initRowHoverEvent"));v.log("11111"),g(this,Ot,new Hr(this)),v.log("222"),g(this,ae,this.getRootNode().host),v.log("333")}connectedCallback(){t(this,Tn).call(this)}get index(){return t(this,wi)}get colResizer(){return t(this,Ee)}get filtering(){return t(this,Ei)}get grouping(){return t(this,ws)}get colMover(){return t(this,xs)}get colFix(){return t(this,Ai)}get rowManager(){return t(this,Ot)}get selection(){return t(this,vi)}get navigation(){return t(this,Si)}get templateLength(){return t(this,qt).tbody.tr.length||0}get elements(){return t(this,Je)}get isAutoFitCol(){var i,n;const e=this.getAttribute("auto-fit-col")==="true"||((i=t(this,ae))==null?void 0:i.getAttribute("auto-fit-col"))==="true",s=((n=t(this,qt).table)==null?void 0:n.getAttribute("auto-fit-col"))==="true";return e||s}get sourceTable(){return t(this,qt).table}get source(){return t(this,qt)}recompileAndRefresh(){var e;t(this,qt).table&&(fe.recompile(t(this,qt).table),["left","right","body"].forEach(s=>{["header","body","footer"].forEach(i=>{const n=this.querySelector(`.ng-sheet-${i} .ng-container-${s}`);n&&n.querySelectorAll("table").forEach(o=>o.remove())})}),t(this,Li).call(this),t(this,Qe).call(this),t(this,Ot).initialize(),this.isAutoFitCol?this.autoFit(!0):(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),requestAnimationFrame(()=>{var s;t(this,Qe).call(this),(s=t(this,Ot))==null||s.refresh()}))}refreshLayout(){!this.classList.contains("active")||!t(this,qt).table||requestAnimationFrame(()=>{var e,s,i;t(this,Qe).call(this),this.isAutoFitCol?this.autoFit(!0):(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),t(this,Rn).call(this),(s=t(this,Ee))==null||s.refreshLayout(),(i=t(this,Ot))==null||i.refresh()})}get view(){var e;return!t(this,Ze)&&((e=t(this,ae))!=null&&e.data)&&g(this,Ze,new Pi(this)),t(this,Ze)}disconnectedCallback(){var e,s;(e=t(this,Ee))==null||e.destroy(),(s=t(this,xs))==null||s.destroy(),this.innerHTML=""}};wi=new WeakMap,ae=new WeakMap,Ot=new WeakMap,vi=new WeakMap,Si=new WeakMap,Ee=new WeakMap,xs=new WeakMap,Ai=new WeakMap,En=new WeakMap,Ei=new WeakMap,ws=new WeakMap,Ze=new WeakMap,qt=new WeakMap,Je=new WeakMap,Ln=new WeakSet,Yl=h(function(){return t(this,ae).hasAttribute("simple")||t(this,ae).getAttribute("theme")==="simple"},"#isSimple"),Rn=new WeakMap,Cn=new WeakMap,Qe=new WeakMap,Li=new WeakMap,kn=new WeakMap,Tn=new WeakMap,In=new WeakMap,qn=new WeakMap,Ri=new WeakMap,Mn=new WeakMap,h(Ci,"NineTableSheet"),E(Ci,"SCROLLBAR_SIZE",16);let Xi=Ci;customElements.get("nine-table-sheet")||customElements.define("nine-table-sheet",Xi);const Do=class Do{constructor(r){d(this,it);d(this,Hn,h(()=>{t(this,Nn).call(this),new ResizeObserver(r=>{for(let e of r)t(this,it).getAttribute("auto-height")==="true"&&t(this,ki).call(this)}).observe(t(this,it))},"#init"));d(this,ki,h(()=>{const r=Array.from(t(this,it).shadowRoot.querySelectorAll("nine-table-sheet.active"));if(r.length===0)return;const e=parseInt(t(this,it).getAttribute("max-display-row"),10)||10,s=Math.max(...r.map(u=>u.getRowHeight())),i=t(this,it).shadowRoot.querySelector("nine-table-toolbar"),n=t(this,it).shadowRoot.querySelector("nine-table-sheets-footer"),o=i?i.getBoundingClientRect().height:0,l=n?n.getBoundingClientRect().height:0,a=Xi.SCROLLBAR_SIZE,c=e*s+o+l+a;t(this,it).style.height=`${c}px`},"#applyAutoHeight"));d(this,Nn,h(()=>{const e=Array.from(t(this,it).children).filter(l=>l.tagName.toUpperCase()==="TABLE"),s=t(this,it).getAttribute("auto-height")==="true",i=e.length,n=e.map((l,a)=>{const c=a===0?"active":"",u=l.id||`sheet${a+1}`,p=`<nine-table-sheet class="${c}" data-index="${a}" data-sheet-id="${u}" id="${u}"></nine-table-sheet>`,f=a<i-1?`<nine-splitter class="h" data-split-index="${a}"></nine-splitter>`:"";return p+f}).join(""),o=nine.cssPath?`@import "${nine.cssPath}/layout.css";`:"";t(this,it).shadowRoot.innerHTML=`
|
|
884
|
+
<style>
|
|
885
|
+
@import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.31/dist/css/layout.css";
|
|
886
|
+
${o}
|
|
887
|
+
</style>
|
|
888
|
+
|
|
889
|
+
<nine-table-toolbar></nine-table-toolbar>
|
|
890
|
+
|
|
442
891
|
<nine-table-body>
|
|
443
892
|
<nine-table-summary></nine-table-summary>
|
|
893
|
+
<div class="ng-loading-bar"></div>
|
|
444
894
|
<nine-table-sheets>
|
|
445
|
-
<nine-table-sheets-body
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
</nine-table-sheets-footer>
|
|
895
|
+
<nine-table-sheets-body>
|
|
896
|
+
${n}
|
|
897
|
+
</nine-table-sheets-body>
|
|
898
|
+
<nine-table-sheets-footer></nine-table-sheets-footer>
|
|
450
899
|
</nine-table-sheets>
|
|
451
900
|
<nine-table-analysis></nine-table-analysis>
|
|
452
901
|
</nine-table-body>
|
|
453
902
|
<nine-table-footer></nine-table-footer>
|
|
454
|
-
`,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,Vt).call(this)})})},"#render"));p(this,O,r),t(this,we).call(this)}};O=new WeakMap,we=new WeakMap,Vt=new WeakMap,xe=new WeakMap,d(ss,"LayoutManager");let $e=ss;const rs=class rs{constructor(r){h(this,Ut);h(this,vt,-1);T(this,"count",d(()=>t(this,Ut).rawRecords.length,"count"));p(this,Ut,r)}get at(){return t(this,vt)}set at(r){p(this,vt,parseInt(r,10)),body&&!body.querySelector(`tbody.bindable tr[data-row="${t(this,vt)}"]`)&&setTimeout(()=>{})}};Ut=new WeakMap,vt=new WeakMap,d(rs,"ngRow");let Ne=rs;const P=class P{constructor(r,e){h(this,W);h(this,L);h(this,B,[]);h(this,St,[]);h(this,ve,0);h(this,tt,[]);h(this,Se,d(()=>{p(this,tt,[]);const r=t(this,W).template||[];Array.from(r).forEach(e=>{var s;t(this,tt).push(((s=e.getBoundingClientRect)==null?void 0:s.call(e).height)||24)}),(t(this,L).rawRecords||[]).forEach(e=>{e.__ng||(e.__ng=t(this,Yt).call(this)),e.__ng.height=t(this,tt).slice()})},"#initialize"));h(this,ut,d(()=>{const r=t(this,W).shadowRoot.querySelector("nine-table-sheets");r==null||r.classList.toggle("nodata",this.length===0),t(this,W).shadowRoot.querySelectorAll("nine-table-sheet").forEach(e=>{e.invalidate()})},"#invalidate"));T(this,"get",d((r,e)=>{var o;const s=this.getValidData();if(!s||s.length<=0)return;if(r==null)return t(this,Rt).call(this,s);if(r<0||r>=s.length)return null;const n=typeof((o=t(this,W).fields)==null?void 0:o.get)=="function"?t(this,W).fields.get():[];if(e!=null){const i=n.indexOf(e);return i>=0?s[r].v[i]:null}return t(this,Rt).call(this,s[r])},"get"));T(this,"set",d(r=>{this.clear(),this.add(r,!1),t(this,ut).call(this)},"set"));h(this,Yt,d(()=>({rowState:P.ROW_STATE.EMPTY,deleted:!1,filtered:!1,height:t(this,tt).slice(),o:{},c:{},_:[0,0,0,0,P.ROW_STATE.EMPTY,!1,!1,!0,!1,!0,!0,!1,t(this,tt).slice(),-1,{},{}]}),"#getDefaultMeta"));T(this,"reset",d(()=>{p(this,B,[]),p(this,St,[]),t(this,ut).call(this)},"reset"));T(this,"clear",d(()=>{var r;t(this,L).rawRecords=[],p(this,B,[]),p(this,St,[]),(r=t(this,L).viewRecords)!=null&&r.reset&&t(this,L).viewRecords.reset()},"clear"));h(this,Re,d(r=>{var n;Array.isArray(r)||(r=[r]);const e=typeof((n=t(this,W).fields)==null?void 0:n.get)=="function"?t(this,W).fields.get():Object.keys(r[0]||{}),s=[];return r.forEach(o=>{const i={v:[]};e.forEach(a=>{i.v.push(o[a]!==void 0&&o[a]!==null?o[a]:"")}),s.push(i)}),s},"#json2Array"));h(this,Ae,d(r=>(Array.isArray(r)||(r=[r]),r.forEach(e=>{e.__ng=t(this,Yt).call(this),e.__ng.rowid=this.nextId,e.__ng.rowState=P.ROW_STATE.INSERT,e.__ng._[0]=e.__ng.rowid}),r),"#defaultInsert"));T(this,"add",d((r,e=!0)=>{r===void 0&&(r={});const s=t(this,Re).call(this,r);t(this,L).rawRecords=t(this,L).rawRecords.concat(t(this,Ae).call(this,s)),this.resetRecords();const n=this.count()-1;return e||s.forEach((o,i)=>{const a=t(this,L).rawRecords[n-i];a&&(a.__ng.rowState=P.ROW_STATE.EMPTY)}),t(this,ut).call(this),n},"add"));T(this,"delete",d(r=>{let e=[];Array.isArray(r)?e=r:typeof r>"u"?e=[t(this,L).host.row.at]:e=[parseInt(r,10)],e.sort((s,n)=>n-s).forEach(s=>{if(t(this,B)[s]){const n=t(this,B)[s].__ng.rowid;t(this,B)[s].__ng.rowState===P.ROW_STATE.INSERT?t(this,L).rawRecords=t(this,L).rawRecords.filter(o=>o.__ng.rowid!==n):t(this,L).rawRecords.forEach(o=>{o.__ng.rowid===n&&(o.__ng.deleted=!0,o.__ng.rowState=P.ROW_STATE.DELETE)})}}),this.resetRecords(),t(this,ut).call(this)},"delete"));T(this,"setValue",d((r,e,s)=>{var c;r=parseInt(r,10);const o=(typeof((c=t(this,W).fields)==null?void 0:c.get)=="function"?t(this,W).fields.get():[]).indexOf(e);if(o<0)return;const i=this.getValidData()[r];if(!i)return;const a=i.v[o];a!==s&&i.__ng.rowState!==P.ROW_STATE.INSERT&&(i.__ng.o.hasOwnProperty(e)||(i.__ng.o[e]=a),i.__ng.rowState=P.ROW_STATE.UPDATE),i.v[o]=s},"setValue"));T(this,"resetRecords",d(()=>{p(this,St,t(this,L).rawRecords.filter(r=>!r.__ng.deleted)),p(this,B,t(this,L).rawRecords.filter(r=>!r.__ng.deleted&&!r.__ng.filtered)),t(this,L).rawRecords.forEach((r,e)=>{r.__ng.rowidx=e}),t(this,B).forEach((r,e)=>{r.__ng.i=e})},"resetRecords"));T(this,"getValidData",d(()=>(t(this,B).length===0&&t(this,L).rawRecords.length>0&&this.resetRecords(),t(this,B)),"getValidData"));h(this,Rt,d(r=>{var i;if(!r)return r;const e=!Array.isArray(r),s=e?[r]:r,n=typeof((i=t(this,W).fields)==null?void 0:i.get)=="function"?t(this,W).fields.get():[],o=s.filter(a=>!a.__ng.deleted).map(a=>{const c={};return n.forEach((l,u)=>{c[l]=a.v?a.v[u]:a[l]}),c.__ng=a.__ng,c});return e?o[0]:o},"#conv"));T(this,"count",d(()=>this.getValidData().length,"count"));p(this,W,r),p(this,L,e),t(this,Se).call(this)}get source(){return t(this,Rt).call(this,t(this,L).rawRecords)}set source(r){this.clear(),this.add(r,!1)}get nextId(){return++Rs(this,ve)._}get count(){return t(this,B).length}get length(){return t(this,B).length}getRowCount(){return this.length}};W=new WeakMap,L=new WeakMap,B=new WeakMap,St=new WeakMap,ve=new WeakMap,tt=new WeakMap,Se=new WeakMap,ut=new WeakMap,Yt=new WeakMap,Re=new WeakMap,Ae=new WeakMap,Rt=new WeakMap,d(P,"ngData"),T(P,"ROW_STATE",{EMPTY:"EMPTY",NORMAL:"NORMAL",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE"});let _e=P;const ns=class ns{constructor(r){h(this,gt);p(this,gt,r),this.row=new Ne(this),this.data=new _e(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 n,o;const s=parseInt(e,10);if(!(s>=this.data.count()))return(o=(n=this.data.getValidData()[s])==null?void 0:n.__ng)==null?void 0:o.rowState},this.getRowPosition=()=>this.row.at,this.setRowPosition=e=>{this.row.at=e},this.scrollTo_V1=e=>(e<0&&(e=0),e>=this.rawRecords.length&&(e=this.rawRecords.length-1),this.viewRecords.rawIndex=e,this.viewRecords.reset&&this.viewRecords.reset(),!(e<=0||e>=this.rawRecords.length-1)),this.getColumn=(e,s)=>this.data.get(e,s),this.setColumn=(e,s,n)=>{e=parseInt(e,10),this.data.setValue(e,s,n)},this.setDataSource([])}};gt=new WeakMap,d(ns,"ngDataManager");let De=ns;const os=class os{constructor(r){h(this,At);h(this,N,[]);T(this,"add",d((r,e="string")=>{r.forEach(s=>{t(this,N).some(n=>n.name===s)||t(this,N).push({name:s,type:e})}),t(this,Xt).call(this)},"add"));h(this,Xt,d(()=>{const r=new Map;t(this,N).forEach(e=>{r.set(e.name,e.type)}),p(this,N,Array.from(r,([e,s])=>({name:e,type:s}))),p(this,N,t(this,N).filter(e=>e.name!==""&&e.name!=="__ng")),t(this,N).sort((e,s)=>e.name.length<s.name.length?1:-1)},"#adjust"));h(this,Ee,d(()=>{p(this,N,[]),x.log(t(this,At).querySelectorAll("table"));const r=Array.from(t(this,At).querySelectorAll("table"));if(!(!r||r.length===0)){for(const e of r)x.log(e),$("[data-bind]",e).each((s,n)=>{const o=n.dataset.bind,i=n.getAttribute("data-type")||"string";o&&t(this,N).push({name:o,type:i})}),["data-expr","background-color","color","tooltip","visible","readonly","enable-button","enable-check","class-expr","icon-color","icon-src"].forEach(s=>{$(`[${s}]`,e).each((n,o)=>{var i=o.getAttribute(s);if(i.indexOf("data.")<0){const a=i.search(/[(]/g);if(a>0)try{i=String(window[i.substring(0,a).trim()])}catch{i=""}}i.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):i.startsWith("data.")&&(l=a.replace("data.","")),l&&t(this,N).push({name:l,type:"string"})}})})});t(this,Xt).call(this)}},"#init"));p(this,At,r),t(this,Ee).call(this)}get(){return t(this,N).map(r=>r.name)}getFields(){return t(this,N)}getType(r){const e=t(this,N).find(s=>s.name===r);return e?e.type:"string"}indexOf(r){return t(this,N).findIndex(e=>e.name===r)}includes(r){return t(this,N).some(e=>e.name===r)}};At=new WeakMap,N=new WeakMap,Xt=new WeakMap,Ee=new WeakMap,d(os,"ngFields");let Oe=os;const is=class is extends HTMLElement{constructor(){super();h(this,bt);h(this,qe);h(this,Te,d(()=>{this.fields=new Oe(this),p(this,qe,new $e(this)),x.log("NineTable connected."),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,detail:{target:this}}))},"#init"));this.attachShadow({mode:"open"}),p(this,bt,new De(this))}connectedCallback(){t(this,Te).call(this)}disconnectedCallback(){x.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,qe=new WeakMap,Te=new WeakMap,d(is,"NineTable");let We=is;customElements.get("nine-table")||customElements.define("nine-table",We);const Kt=class Kt extends HTMLElement{constructor(){super()}applyBaseStyle(){this.constructor.name}connectedCallback(){}};d(Kt,"BasicCellElement"),T(Kt,"_styleCache",new Map),T(Kt,"_customStyleCache",new Map);let ze=Kt;const fs=class fs extends ze{constructor(){super();h(this,I);h(this,Zt);h(this,w);h(this,as);h(this,ls);h(this,cs);h(this,hs);T(this,"getDisplayText",d(e=>{if(t(this,w))if(t(this,w).closest("tbody")){const s=t(this,w).closest("tr").data,n=parseInt(t(this,w).dataset.row);if(!s)return"";if(ninegrid.isNull(t(this,w).dataset.expr)){if(!ninegrid.isNull(t(this,w).dataset.bind))return s[t(this,w).dataset.bind]||ninegrid.nvl(e,"")}else try{return this.getExprValue(t(this,w).dataset.expr,s,n,t(this,w))}catch{console.error(t(this,w).dataset.expr,s,t(this,w).dataset.row)}return ninegrid.nvl(e,"")}else try{return t(this,I).exprFunction(t(this,w).dataset.expr).call(this,null,-1,t(this,I).data)}catch{}},"getDisplayText"));h(this,ds,d(()=>{if(!(!t(this,I)||!t(this,I).template||!t(this,w).closest("tbody.bindable"))){var e=ninegrid.j.querySelectorAll(t(this,w)).attr("suppress");if(e&&(e=parseInt(e)),e&&!isNaN(e)){var s=t(this,w).closest("tr"),n=[];$("th,td",s).each((m,_)=>{var C=ninegrid.j.querySelectorAll(_).attr("suppress");C&&_.dataset.row&&(C=parseInt(C),!isNaN(C)&&C<=e&&n.push(C))}),n.sort();var o=!1;if(parseInt(s.sectionRowIndex/t(this,I).template.length)>0)for(var i of n){if(i>e)break;var a=parseInt(t(this,w).dataset.row),c=a-1,l=t(this,w).closest("tr").data,u=t(this,I).data.get(c);t(this,w).dataset.matrixRow;var g=t(this,I).body.querySelector(`tbody.bindable [suppress="${i}"][data-matrix-row="${t(this,w).dataset.matrixRow}"]`),b=g.dataset.expr?this.getExprValue(g.dataset.expr,l,a):l[g.dataset.bind],f=g.dataset.expr?this.getExprValue(g.dataset.expr,u,c):u[g.dataset.bind];if(b!=f){o=!0;break}}else o=!0;o?ninegrid.j.querySelectorAll(t(this,w)).removeClass("suppress"):ninegrid.j.querySelectorAll(t(this,w)).addClass("suppress"),ninegrid.j.querySelectorAll(t(this,w)).hasClass("hidden")||(o?ninegrid.j.querySelectorAll(t(this,w)).removeClass("hidden"):ninegrid.j.querySelectorAll(t(this,w)).addClass("hidden"));var y=parseInt(t(this,w).dataset.matrixRow),v=y-1,S=t(this,I).body.querySelector(`tbody.bindable [data-col="${t(this,w).dataset.col}"][data-matrix-row="${v}"]`);$(S).hasClass("suppress")&&!ninegrid.j.querySelectorAll(t(this,w)).hasClass("suppress")?ninegrid.j.querySelectorAll(S).removeClass("last-none-suppress").addClass("last-suppress"):!$(S).hasClass("suppress")&&ninegrid.j.querySelectorAll(t(this,w)).hasClass("suppress")?ninegrid.j.querySelectorAll(S).removeClass("last-suppress").addClass("last-none-suppress"):ninegrid.j.querySelectorAll(S).removeClass("last-none-suppress").removeClass("last-suppress")}}},"#resetSuppress"));T(this,"getExprValue",d((e,s,n,o)=>{if(typeof e<"u")try{n=parseInt(n);const i=e.replace("()","");return t(this,I)[i]?t(this,I)[i].call(this,s,n,t(this,w)):t(this,I).exprFunction(e).call(this,s,n,t(this,I).data)}catch{return["NG-COMBO"].includes(this.tagName)?"":e}else return e},"getExprValue"))}connectedCallback(){super.connectedCallback(),p(this,I,this.getRootNode().host),p(this,w,this.closest("th,td")),p(this,Zt,t(this,w).closest("tr"))}get value(){var e=!t(this,I)||!t(this,I).dataManager||!t(this,w)||!t(this,w).dataset||!t(this,w).dataset.row||!t(this,w).dataset.bind?"":t(this,w).closest("tr").data[t(this,w).dataset.bind];return e??""}set value(e){var s=parseInt(t(this,w).dataset.row);const n=this.getAttribute("update-row-state")!="false";s<0?t(this,I).data.setValueNF(parseInt(t(this,w).dataset.index),t(this,w).dataset.bind,e,n):t(this,I).data.setValue(s,t(this,w).dataset.bind,e,n)}get row(){return parseInt(t(this,w).dataset.row)}get data(){return t(this,w).closest("tr").data}refresh(){const e=t(this,w).dataset.bind;return parseInt(t(this,w).dataset.row),t(this,Zt).data[e]}};I=new WeakMap,Zt=new WeakMap,w=new WeakMap,as=new WeakMap,ls=new WeakMap,cs=new WeakMap,hs=new WeakMap,ds=new WeakMap,d(fs,"CellElement");let Be=fs;const us=class us extends Be{constructor(){super()}connectedCallback(){super.connectedCallback()}refresh(){return super.refresh()}};d(us,"EditableCellElement");let Pe=us;const bs=class bs extends Pe{constructor(){super();h(this,Gt);h(this,pt);h(this,Et);h(this,qt);h(this,Ce);h(this,et);T(this,"refresh",d(()=>{const e=super.refresh();t(this,Gt).value=e},"refresh"));h(this,gs,d(e=>{if(!["Escape","Enter","Tab","Home","End","ArrowLeft","ArrowRight","PageUp","PageDown","Backspace","Delete"].includes(e.code)){if(t(this,pt)=="number"){let o=[];if(t(this,et)&&Number(t(this,et))>0&&o.push("."),t(this,qt)&&Number(t(this,qt))>=0&&o.push("-"),!(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)&&!o.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,n=s.indexOf(".");if(n>=0){var s=s.substr(n+1,s.length);s.length>=Number(t(this,et))&&e.preventDefault()}}}t(this,Et)&&ninegrid.getByteLength(e.target.value)>=Number(t(this,Et))&&e.target.selectionStart==e.target.selectionEnd&&e.preventDefault()}},"#onKeyDown"));if(this.applyBaseStyle(),p(this,pt,this.getAttribute("type")||"text"),p(this,Et,this.getAttribute("maxbyte")),p(this,qt,this.getAttribute("min")),p(this,Ce,this.getAttribute("max")),p(this,et,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=`
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
903
|
+
`,t(this,it).shadowRoot.querySelectorAll("nine-table-sheet").forEach((l,a)=>{e[a]&&setTimeout(()=>{l.generate(e[a],a),s&&t(this,ki).call(this)})})},"#render"));g(this,it,r),t(this,Hn).call(this)}set loading(r){r?t(this,it).classList.add("loading"):t(this,it).classList.remove("loading")}};it=new WeakMap,Hn=new WeakMap,ki=new WeakMap,Nn=new WeakMap,h(Do,"LayoutManager");let Xr=Do;const $o=class $o{constructor(r){d(this,Ti);d(this,vs);d(this,Ii,new Map);g(this,Ti,r),g(this,vs,r.fields.get())}rewriteExpr(r){return!r||!t(this,vs).length?r:r.replace(/data\.([a-zA-Z_$][\w$]*)/g,(e,s)=>{const i=t(this,vs).indexOf(s);return i>=0?`rowItem.v[${i}]`:e})}precompile(r){return r&&this.rewriteExpr(r)}evaluate(r,e,s=0){if(r==null)return"";try{const i=String(r).trim(),n=this.rewriteExpr(i);if(n.includes("data.")||n.includes("rowItem.v")||n.includes("host.")||n.includes("(")){let o=t(this,Ii).get(n);return o||(o=new Function("rowItem","row","host",`
|
|
904
|
+
const data = rowItem;
|
|
905
|
+
if (!data && !host) return "";
|
|
906
|
+
return ${n};
|
|
907
|
+
`),t(this,Ii).set(n,o)),o(e,s,t(this,Ti))}return n}catch{return r}}};Ti=new WeakMap,vs=new WeakMap,Ii=new WeakMap,h($o,"ExprEngine");let _r=$o;const zo=class zo extends HTMLElement{constructor(){super();d(this,$n);d(this,qi);d(this,Le);d(this,Mi);d(this,Ss,0);d(this,Dn,h(()=>{let e=0;const s=50,i=setInterval(()=>{e++;const n=this.shadow.querySelectorAll("nine-table-sheet");if(e>=s&&clearInterval(i),n.length>=t(this,Ss)){let o=0;n.forEach(l=>{l.loaded&&o++}),o>=t(this,Ss)&&(clearInterval(i),this.loaded=!0,this.dispatchEvent(new CustomEvent(Dt.EVENT.LOAD,{bubbles:!0,detail:{target:this}})))}},100)},"#dispatchLoad"));E(this,"sheet",h(e=>{if(e===null||e<0)return this.activeSheet;const s=Array.from(this.shadow.querySelectorAll("nine-table-sheet"));return typeof e=="number"?s[e]||null:typeof e=="string"?this.shadow.querySelector(`nine-table-sheet#${e}, nine-table-sheet[data-sheet-id="${e}"]`)||null:s[0]||null},"sheet"));E(this,"execute",h(e=>{this.loading=!0,setTimeout(()=>{try{e.call(this)}finally{this.loading=!1}})},"execute"));g(this,qi,this.attachShadow({mode:"open"})),g(this,Le,new Ar(this))}connectedCallback(){setTimeout(()=>{var e;g(this,Ss,(e=this.querySelectorAll("table"))==null?void 0:e.length),this.fields=new Er(this),this.exprEngine=new _r(this),A(this,$n,Zl).call(this),g(this,Mi,new Xr(this)),t(this,Dn).call(this)})}disconnectedCallback(){v.log("NineTable disconnected.")}get shadow(){return t(this,qi)}get dataManager(){return t(this,Le)}get data(){return t(this,Le).data}get row(){return t(this,Le).row}setData(e){t(this,Le).data.set(e),this.refresh()}refresh(){var e;(e=this.activeSheet)==null||e.invalidate()}set loading(e){t(this,Mi).loading=e}rerenderer(){var e;(e=this.activeSheet)==null||e.querySelectorAll("tbody.body th,tbody.body td").forEach(s=>{const i=Array.from(s.children).find(n=>n.tagName.toLowerCase().startsWith("cell-")&&typeof n.rerenderer=="function");i==null||i.rerenderer()})}get sheets(){return Array.from(this.shadow.querySelectorAll("nine-table-sheet"))}get activeSheet(){return this.shadow.querySelector("nine-table-sheet.active")||null}};qi=new WeakMap,Le=new WeakMap,Mi=new WeakMap,Ss=new WeakMap,Dn=new WeakMap,$n=new WeakSet,Zl=h(function(){const e=new Set;this.querySelectorAll("[data-source]").forEach(s=>{const i=s.getAttribute("data-source");if(!i)return;const n=i.matchAll(/(?:host\.)?([a-zA-Z0-9_$]+)\s*\(/g);for(const o of n){const l=o[1];l&&l!=="host"&&e.add(l)}}),e.forEach(s=>{let i=null;Object.defineProperty(this,s,{set:h(n=>{i=n,this.rerenderer()},"set"),get:h(()=>i,"get"),configurable:!0,enumerable:!0})})},"#bindDynamicSetters"),h(zo,"NineTable");let _i=zo;customElements.get("nine-table")||customElements.define("nine-table",_i),customElements.get("nine-table-simple")||customElements.define("nine-table-simple",class extends _i{connectedCallback(){this.setAttribute("theme","simple"),super.connectedCallback()}});const Hi=class Hi extends HTMLElement{constructor(){super()}applyBaseStyle(){this.constructor.name}connectedCallback(){}};h(Hi,"BasicCellElement"),E(Hi,"_styleCache",new Map),E(Hi,"_customStyleCache",new Map);let Gr=Hi;const wl=new Map,Fo=class Fo extends Gr{constructor(){super();d(this,I);d(this,Ni);d(this,dt);d(this,q);d(this,ts);E(this,"getDisplayText",h((e="")=>{if(v.log("================================="),!t(this,q)||!t(this,q).closest("tbody"))return e;const s=t(this,dt).data;if(v.log("==============================",s),!s)return e;const i=t(this,q).dataset.expr,n=t(this,q).dataset.bind,o=parseInt(t(this,q).dataset.row,10);if(i)try{return t(this,dt).getAttribute("grouping")==="true"?this.getGroupExprValue(i,t(this,dt).data,o,t(this,q)):t(this,I).exprEngine.evaluate(i,t(this,dt).data,o)}catch(l){return console.trace(l),e}if(v.log("==============================",n,this.value),n){const l=this.value;return l??e}return e},"getDisplayText"));E(this,"getGroupExprValue",h((e,s,i,n)=>{var o,l,a,c,u,p;if(!e)return"";try{i=parseInt(i,10);const f=e.replace("()","").trim();if(t(this,I)&&typeof t(this,I)[f]=="function")return t(this,I)[f].call(this,s,i,n);const b=f.match(/^(\w+)\s*\(\s*([\w\-]*)\s*\)/);if(b){const m=s[GROUP_IDX.CHILDREN],y=(l=(o=t(this,I))==null?void 0:o.data)!=null&&l.getArray?t(this,I).data.getArray():[],x=m?m.map(C=>y[C]).filter(Boolean):[],[,w,S]=b,R=t(this,I);switch(w.toLowerCase()){case"count":return x.length;case"sum":{const C=((c=(a=R==null?void 0:R.fields)==null?void 0:a.indexOf)==null?void 0:c.call(a,S))??-1;return x.reduce((F,k)=>{var _;const D=C>=0?(_=k.v)==null?void 0:_[C]:k[S];return F+(Number(D)||0)},0)}case"avg":{if(x.length===0)return 0;const C=((p=(u=R==null?void 0:R.fields)==null?void 0:u.indexOf)==null?void 0:p.call(u,S))??-1;return x.reduce((k,D)=>{var nt;const _=C>=0?(nt=D.v)==null?void 0:nt[C]:D[S];return k+(Number(_)||0)},0)/x.length}}}if(t(this,I)&&typeof t(this,I).exprFunction=="function")return t(this,I).exprFunction(e).call(this,s,i,t(this,I).data);if(e.includes("data.")||e.includes("childRecords")||e.includes("groupRecord")){let m=wl.get("grp_"+e);return m||(m=new Function("groupRecord","row","cell","host",`
|
|
908
|
+
const indices = groupRecord[3]; // GROUP_IDX.CHILDREN = 3
|
|
909
|
+
const allRecords = host?.data?.getArray ? host.data.getArray() : [];
|
|
910
|
+
|
|
911
|
+
let childRecords = [];
|
|
912
|
+
if (Array.isArray(indices)) {
|
|
913
|
+
// indices๊ฐ ์ซ์ ์ธ๋ฑ์ค ๋ฐฐ์ด์ธ์ง, rowid ๋ฌธ์์ด ๋ฐฐ์ด์ธ์ง ํ๋ณํ์ฌ ์์ ํ๊ฒ ์ถ์ถ
|
|
914
|
+
childRecords = indices.map(idx => {
|
|
915
|
+
if (typeof idx === 'number') {
|
|
916
|
+
return allRecords[idx];
|
|
917
|
+
} else {
|
|
918
|
+
// rowid ๋ฑ ๋ฌธ์์ด ์๋ณ์์ธ ๊ฒฝ์ฐ ์ ์ฒด ๋ฐฐ์ด์์ ์ฐพ๊ฑฐ๋ dataManager ํ์ฉ
|
|
919
|
+
return allRecords.find(r => r?.__ng?.rowid === idx || r?.m?._?.[0] === idx);
|
|
920
|
+
}
|
|
921
|
+
}).filter(Boolean);
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
// ๋ง์ฝ ์์์ ๋ชป ์ฐพ์๋๋ฐ host.grouping์ ์ธ ์ ์๋ค๋ฉด ๋งค๋์ ์์ ์๋
|
|
925
|
+
if (childRecords.length === 0 && host?.grouping?.getChildrenRecords && groupRecord[0]) {
|
|
926
|
+
childRecords = host.grouping.getChildrenRecords(groupRecord[0]);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
const data = childRecords; // data.length ๋ฑ์ ์ธ ์ ์๋๋ก ํธํ
|
|
930
|
+
return ${e};
|
|
931
|
+
`),wl.set("grp_"+e,m)),m(s,i,n,t(this,I))}return e}catch(f){return console.error("Group expr evaluation error:",e,f),e}},"getGroupExprValue"))}get host(){return t(this,I)}get sheet(){return t(this,Ni)}get cell(){return t(this,q)}get tr(){return t(this,dt)}get attr(){return t(this,ts)}connectedCallback(){super.connectedCallback(),g(this,I,this.getRootNode().host),g(this,q,this.closest("th,td")),g(this,dt,t(this,q).closest("tr")),g(this,Ni,t(this,dt).closest("nine-table-sheet")),t(this,q).classList.add(this.tagName),g(this,ts,{});for(let i=0;i<t(this,q).attributes.length;i++){const n=t(this,q).attributes[i].name;["text-align","class","cell-type","data-bind","data-expr","data-col","tabindex"].includes(n)||(t(this,ts)[n]=t(this,q).attributes[i].value)}if(!t(this,q))return;const e=this.shadowRoot||this;e.querySelectorAll("button, ng-expand-button").forEach(i=>{i.addEventListener("click",()=>{var a,c;let n=this.getAttribute("onbuttonclick")||this.getAttribute("onButtonClick")||((a=t(this,q))==null?void 0:a.getAttribute("onbuttonclick"))||((c=t(this,q))==null?void 0:c.getAttribute("onButtonClick"));const o=this.data,l=parseInt(t(this,q).dataset.row,10);if(n&&t(this,I)){n=n.replace("()","");const u=n.match(/^(\w+)\s*\(/),p=(u==null?void 0:u[1])||n;typeof t(this,I)[p]=="function"?t(this,I)[p].call(t(this,I),o,l,t(this,q)):typeof t(this,I).exprFunction=="function"&&t(this,I).exprFunction(n).call(this,o,l)}})});const s=e.querySelector(".renderer");s&&this.getAttribute("link")==="true"&&(s.classList.add("link"),s.addEventListener("click",()=>{var l;let i=this.getAttribute("onlinkclick")||this.getAttribute("onLinkClick");const n=this.data,o=parseInt(t(this,q).dataset.row,10);if(i&&t(this,I)){i=i.replace("()","");const a=i.match(/^(\w+)\s*\(/),c=(a==null?void 0:a[1])||i;typeof t(this,I)[c]=="function"?t(this,I)[c].call(t(this,I),n,o,t(this,q)):typeof t(this,I).exprFunction=="function"&&t(this,I).exprFunction(i).call(this,n,o)}(l=t(this,I))==null||l.dispatchEvent(new CustomEvent(ninegrid.EVENT.LINK_CLICK,{detail:{target:t(this,q),data:n,currow:o},bubbles:!0,composed:!0}))}))}get data(){var i;const e=(i=t(this,dt))==null?void 0:i.data;if(!e)return null;if(!e.v)return e;const s=t(this,I);return new Proxy(e,{get(n,o){var a,c;if(o==="__ng")return n.__ng;if(o==="v")return n.v;const l=((c=(a=s==null?void 0:s.fields)==null?void 0:a.indexOf)==null?void 0:c.call(a,o))??-1;return l>=0?n.v[l]:n[o]}})}get value(){var i,n;if(!t(this,q)||!((i=t(this,dt))!=null&&i.data))return"";const e=(n=t(this,q).dataset)==null?void 0:n.bind;if(!e)return"";const s=t(this,dt).data;if(s.v&&Array.isArray(s.v)){const o=t(this,I).fields.get().indexOf(e)??-1;return o>=0?s.v[o]??"":""}return s[e]??""}set value(e){var o;if(!t(this,q)||!((o=t(this,I))!=null&&o.data))return;const s=parseInt(t(this,q).dataset.row,10),i=t(this,q).dataset.bind;if(isNaN(s)||!i)return;const n=this.getAttribute("update-row-state")!=="false";t(this,I).data.setValue(s,i,e,n)}get row(){var e,s;return parseInt((s=(e=t(this,q))==null?void 0:e.dataset)==null?void 0:s.row,10)}get index(){var e,s;return parseInt((s=(e=t(this,q))==null?void 0:e.dataset)==null?void 0:s.index,10)}refresh(){if(!t(this,q)||!t(this,dt))return;const e=this.value;return["color","background","background-color","class","visible","enable"].forEach(s=>{const i=t(this,ts)[s];if(i){const n=t(this,I).exprEngine.evaluate(i,t(this,dt).data,parseInt(t(this,q).dataset.row,10));s==="visible"?this.style.display=n?"":"none":s==="enable"?(this.querySelectorAll("input, button, textarea, select").forEach(o=>{o.disabled=!n}),n?t(this,q).removeAttribute("disabled"):t(this,q).setAttribute("disabled","true")):t(this,q).style[s]=n}}),e}getExprValue(e,s,i){return t(this,I).exprEngine.evaluate(e,s,i)}};I=new WeakMap,Ni=new WeakMap,dt=new WeakMap,q=new WeakMap,ts=new WeakMap,h(Fo,"CellElement");let hs=Fo;const Wo=class Wo extends hs{constructor(){super();E(this,"getExprValue",h((e,s,i,n)=>super.getExprValue(e,s,i,n),"getExprValue"))}get host(){return super.host}get sheet(){return super.sheet}get cell(){return super.cell}get tr(){return super.tr}get attr(){return super.attr}getExprValue(e,s,i,n){return super.getExprValue(e,s,i,n)}connectedCallback(){super.connectedCallback()}refresh(){return super.refresh()}};h(Wo,"EditableCellElement");let Jt=Wo;const Oo=class Oo extends Jt{constructor(){super();d(this,es);E(this,"refresh",h(()=>{super.refresh(),t(this,es).value=this.value},"refresh"));d(this,zn,h(()=>{t(this,es).addEventListener("input",e=>{const s=this.cell.getAttribute("maxbyte")||this.cell.getAttribute("max-byte");if(s){const i=Number(s);nine.getByteLength(e.target.value)>i&&(e.target.value=nine.cut(e.target.value,i),this.value=e.target.value)}}),t(this,es).addEventListener("change",e=>{this.value=e.target.value,super.sheet.rowManager.refresh(!0)})},"#initEvent"));d(this,Fn,h(()=>{this.innerHTML=`
|
|
932
|
+
<style>
|
|
933
|
+
cell-input {
|
|
934
|
+
input {
|
|
935
|
+
position: relative;
|
|
936
|
+
-moz-user-select: auto;
|
|
937
|
+
-webkit-user-select: auto;
|
|
938
|
+
-ms-user-select: auto;
|
|
939
|
+
user-select: auto;
|
|
940
|
+
width: 100%;
|
|
941
|
+
height: 26px;
|
|
942
|
+
border: 1px solid #eee;
|
|
943
|
+
border-radius: 3px;
|
|
944
|
+
padding-left: 4px;
|
|
945
|
+
outline: 0;
|
|
946
|
+
font: inherit;
|
|
947
|
+
box-sizing: border-box;
|
|
948
|
+
background-color: white;
|
|
949
|
+
color: #333;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
input:read-only {
|
|
953
|
+
border-color: #fdfdfd;
|
|
954
|
+
filter: brightness(97%);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
</style>
|
|
958
|
+
|
|
959
|
+
<input type="text" ondragstart="return false;">
|
|
960
|
+
`},"#renderer"))}connectedCallback(){super.connectedCallback(),t(this,Fn).call(this),g(this,es,this.querySelector("input")),t(this,zn).call(this)}};es=new WeakMap,zn=new WeakMap,Fn=new WeakMap,h(Oo,"CellInputText");let Ur=Oo;customElements.get("cell-input")||customElements.define("cell-input",Ur);const Bo=class Bo extends Jt{constructor(){super();d(this,Mt);d(this,Wn,h(()=>{for(var e=[],s=0;s<this.attributes.length;s++)["type","maxlength","maxbyte","min","max","step","scale","text-align"].includes(this.attributes[s].name);this.innerHTML=`
|
|
961
|
+
<style>
|
|
962
|
+
cell-input-number {
|
|
963
|
+
input[type=text].border-left-none {
|
|
964
|
+
border-left: 0;
|
|
965
|
+
border-top-left-radius: 0;
|
|
966
|
+
border-bottom-left-radius: 0;
|
|
967
|
+
}
|
|
968
|
+
input[type=text].border-right-none {
|
|
969
|
+
border-right: 0;
|
|
970
|
+
border-top-right-radius: 0;
|
|
971
|
+
border-bottom-right-radius: 0;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
input[type=text] {
|
|
975
|
+
position: relative;
|
|
976
|
+
-moz-user-select: auto;
|
|
977
|
+
-webkit-user-select: auto;
|
|
978
|
+
-ms-user-select: auto;
|
|
979
|
+
user-select: auto;
|
|
980
|
+
width: 100%;
|
|
981
|
+
height: 26px;
|
|
982
|
+
border: 1px solid #eee;
|
|
983
|
+
border-radius: 3px;
|
|
984
|
+
padding-left: 4px;
|
|
985
|
+
outline: 0;
|
|
986
|
+
font: inherit;
|
|
987
|
+
box-sizing: border-box;
|
|
988
|
+
background-color: white;
|
|
989
|
+
color: #333;
|
|
990
|
+
text-align: right; /* ์ซ์๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์ฐ์ธก ์ ๋ ฌ์ด ์ด์ธ๋ฆผ */
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
input[type=text]:read-only {
|
|
994
|
+
border-color: #fdfdfd;
|
|
995
|
+
filter: brightness(97%);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
</style>
|
|
999
|
+
|
|
1000
|
+
<input type="text" ${e.join(" ")} ondragstart="return false;">
|
|
1001
|
+
`},"#renderer"));E(this,"refresh",h(()=>{const e=super.refresh();return t(this,Mt)&&(t(this,Mt).value=e??"",t(this,On).call(this,t(this,Mt).value)),e},"refresh"));d(this,On,h(e=>{if(t(this,Mt)&&(super.cell.classList.remove("invalid"),e!==""&&e!==null&&e!==void 0)){const s=Number(e);if(isNaN(s)||super.attr.max!==null&&super.attr.max!==void 0&&s>Number(super.attr.max)||super.attr.min!==null&&super.attr.min!==void 0&&s<Number(super.attr.min))super.cell.classList.add("invalid");else if(super.attr.scale!==null&&super.attr.scale!==void 0){const i=String(e),n=i.indexOf(".");n>=0&&i.substring(n+1).length>Number(super.attr.scale)&&super.cell.classList.add("invalid")}}},"#validateInput"));d(this,Bn,h(e=>{if(["Escape","Enter","Tab","Home","End","ArrowLeft","ArrowRight","PageUp","PageDown","Backspace","Delete"].includes(e.code))return;const s=e.target,i=s.value,n=s.selectionStart;s.selectionEnd;const o=e.key;if(o==="-"&&(i.includes("-")||n!==0)){e.preventDefault();return}if(o==="."){const c=Number(super.attr.scale);if(isNaN(c)||c<=0||i.includes(".")){e.preventDefault();return}}let l=[];super.attr.scale!==null&&super.attr.scale!==void 0&&Number(super.attr.scale)>0&&l.push("."),(super.attr.min===null||super.attr.min===void 0||Number(super.attr.min)>0)&&l.push("-");const a=e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105;if(!a&&!l.includes(e.key)){e.preventDefault();return}if(super.attr.scale!==null&&super.attr.scale!==void 0&&a&&e.target.selectionStart==e.target.selectionEnd){const c=e.target.value,u=c.indexOf(".");u>=0&&e.target.selectionStart>u&&c.substr(u+1).length>=Number(super.attr.scale)&&e.preventDefault()}super.attr.maxbyte&&nine.getByteLength(e.target.value)>=Number(super.attr.maxbyte)&&e.target.selectionStart==e.target.selectionEnd&&e.preventDefault()},"#onKeyDown"));this.applyBaseStyle()}connectedCallback(){t(this,Wn).call(this),super.connectedCallback(),g(this,Mt,this.querySelector("input")),t(this,Mt)&&(t(this,Mt).addEventListener("keydown",t(this,Bn)),t(this,Mt).addEventListener("input",e=>{this.value=e.target.value,super.sheet.rowManager.refresh(!0)}),t(this,Mt).addEventListener("change",e=>{this.value=e.target.value,super.sheet.rowManager.refresh(!0)}))}};Mt=new WeakMap,Wn=new WeakMap,On=new WeakMap,Bn=new WeakMap,h(Bo,"CellInputNumber");let jr=Bo;customElements.get("cell-input-number")||customElements.define("cell-input-number",jr);const Vo=class Vo extends Jt{constructor(){super();d(this,xt);d(this,As);d(this,Vn,h(()=>{for(var e=[],s=0;s<this.attributes.length;s++)["type","maxlength","maxbyte","min","max","step","scale","text-align"].includes(this.attributes[s].name);this.innerHTML=`
|
|
1002
|
+
<style>
|
|
1003
|
+
cell-input-color {
|
|
1004
|
+
--position: relative;
|
|
1005
|
+
height: 100%;
|
|
1006
|
+
width: calc(100% - 8px);
|
|
1007
|
+
display: flex;
|
|
1008
|
+
align-items: center;
|
|
1009
|
+
margin-left: 4px;
|
|
1010
|
+
margin-right: 4px;
|
|
1011
|
+
box-sizing: border-box;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
cell-input-color.invalid button {
|
|
1015
|
+
padding: 2px;
|
|
1016
|
+
}
|
|
1017
|
+
cell-input-color.invalid button:after {
|
|
1018
|
+
content: '';
|
|
1019
|
+
width: 16px;
|
|
1020
|
+
height: 16px;
|
|
1021
|
+
border: none;
|
|
1022
|
+
background-repeat: no-repeat;
|
|
1023
|
+
background-position: center;
|
|
1024
|
+
background-size: auto;
|
|
1025
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" style="fill: none; stroke-width: 2px; stroke: darkgoldenrod;" viewBox="0 0 16 16"><path d="m8 1 7 14H1L8 1z"></path><path d="M7.99 12H8v.01h-.01zM8 6v4"></path></svg>');
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
cell-input-color input[type=color] {
|
|
1029
|
+
width: 100%;
|
|
1030
|
+
height: 26px;
|
|
1031
|
+
padding: 0px;
|
|
1032
|
+
margin-left: unset;
|
|
1033
|
+
border: 1px solid #eee;
|
|
1034
|
+
border-right: none;
|
|
1035
|
+
border-top-left-radius: 3px;
|
|
1036
|
+
border-bottom-left-radius: 3px;
|
|
1037
|
+
-webkit-appearance: none;
|
|
1038
|
+
-moz-appearance: none;
|
|
1039
|
+
appearance: none;
|
|
1040
|
+
background-color: transparent;
|
|
1041
|
+
cursor: pointer;
|
|
1042
|
+
box-sizing: border-box;
|
|
1043
|
+
}
|
|
1044
|
+
cell-input-color input[type=color]::-webkit-color-swatch {
|
|
1045
|
+
border: 0;
|
|
1046
|
+
border-top-left-radius: 2px;
|
|
1047
|
+
border-bottom-left-radius: 2px;
|
|
1048
|
+
}
|
|
1049
|
+
cell-input-color input[type=color]::-webkit-color-swatch-wrapper {
|
|
1050
|
+
padding: 1px;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
cell-input-color button {
|
|
1054
|
+
display: inline-flex;
|
|
1055
|
+
width: 24px;
|
|
1056
|
+
height: 26px;
|
|
1057
|
+
margin-right: unset;
|
|
1058
|
+
border: 1px solid #eee;
|
|
1059
|
+
border-top-right-radius: 3px;
|
|
1060
|
+
border-bottom-right-radius: 3px;
|
|
1061
|
+
background-color: #f9f9f9;
|
|
1062
|
+
justify-content: center;
|
|
1063
|
+
align-items: center;
|
|
1064
|
+
cursor: pointer;
|
|
1065
|
+
box-sizing: border-box;
|
|
1066
|
+
}
|
|
1067
|
+
cell-input-color button:after {
|
|
1068
|
+
content: "";
|
|
1069
|
+
border-top: 0.3em solid #333;
|
|
1070
|
+
border-right: 0.3em solid transparent;
|
|
1071
|
+
border-bottom: 0;
|
|
1072
|
+
border-left: 0.3em solid transparent;
|
|
1073
|
+
}
|
|
1074
|
+
cell-input-color input[type=color]:hover {
|
|
1075
|
+
filter: brightness(90%);
|
|
1076
|
+
}
|
|
1077
|
+
cell-input-color button:hover {
|
|
1078
|
+
filter: brightness(95%);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
.CELL-INPUT-COLOR {
|
|
1082
|
+
|
|
1083
|
+
}
|
|
1084
|
+
</style>
|
|
1085
|
+
|
|
1086
|
+
<input type="color" ${e.join(" ")} ondragstart="return false;">
|
|
1087
|
+
<button tabindex="-1" type="button"></button>
|
|
1088
|
+
`},"#renderer"));E(this,"refresh",h(()=>{const e=super.refresh();if(t(this,xt)){const s=e!=null&&e!==""?e:"#ffffff";t(this,xt).value=s,t(this,Es).call(this,s)}return e},"refresh"));d(this,Es,h(e=>{!t(this,xt)||!super.cell||(super.cell.classList.remove("invalid"),this.classList.remove("invalid"),e!==""&&e!==null&&e!==void 0&&(t(this,Pn).call(this,e)||(super.cell.classList.add("invalid"),this.classList.add("invalid"))))},"#validateInput"));d(this,Pn,h(e=>{if(typeof e!="string"||e.length!=7||!e.startsWith("#"))return!1;var s=parseInt(e.substr(1,2),16),i=parseInt(e.substr(3,2),16),n=parseInt(e.substr(5,2),16);return!(isNaN(s)||isNaN(i)||isNaN(n)||s<0||s>255||i<0||i>255||n<0||n>255)},"#isValidColor"));this.applyBaseStyle()}connectedCallback(){t(this,Vn).call(this),super.connectedCallback(),g(this,xt,this.querySelector("input[type=color]")),g(this,As,this.querySelector("button")),t(this,xt)&&(t(this,As)&&t(this,As).addEventListener("click",()=>{t(this,xt).click()}),t(this,xt).addEventListener("input",e=>{const s=e.target.value;this.value=s,t(this,Es).call(this,s),super.sheet.rowManager.refresh(!0)}),t(this,xt).addEventListener("change",e=>{const s=e.target.value;this.value=s,t(this,Es).call(this,s),super.sheet.rowManager.refresh(!0)}),t(this,xt).addEventListener("keydown",e=>{["Enter"].includes(e.code)?t(this,xt).click():["Escape"].includes(e.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(e))}))}};xt=new WeakMap,As=new WeakMap,Vn=new WeakMap,Es=new WeakMap,Pn=new WeakMap,h(Vo,"CellInputColor");let Kr=Vo;customElements.get("cell-input-color")||customElements.define("cell-input-color",Kr);const Po=class Po extends Jt{constructor(){super();d(this,wt);d(this,ce);d(this,Xn,h(()=>{var n;const e=this.closest("th,td");parseInt(((n=this.closest("tr"))==null?void 0:n.style.height)||"26",10)-1;let s=[];for(var i=0;i<e.attributes.length;i++)["value","max","min","step"].includes(e.attributes[i].name)&&s.push(`${e.attributes[i].name}="${e.attributes[i].value}"`);this.innerHTML=`
|
|
1089
|
+
<style>
|
|
1090
|
+
cell-input-date {
|
|
1091
|
+
height: 100%;
|
|
1092
|
+
--width: calc(100% - 8px);
|
|
1093
|
+
width: 100%;
|
|
1094
|
+
display: flex;
|
|
1095
|
+
align-items: center;
|
|
1096
|
+
--margin-left: 4px;
|
|
1097
|
+
--margin-right: 4px;
|
|
1098
|
+
box-sizing: border-box;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
cell-input-date input {
|
|
1102
|
+
position: relative;
|
|
1103
|
+
height: 26px;
|
|
1104
|
+
padding: 0;
|
|
1105
|
+
margin: 0;
|
|
1106
|
+
font: inherit;
|
|
1107
|
+
width: 100%;
|
|
1108
|
+
padding-left: 4px;
|
|
1109
|
+
border: 1px solid #f0f0f0;
|
|
1110
|
+
border-radius: 3px;
|
|
1111
|
+
outline: 0;
|
|
1112
|
+
background-color: transparent;
|
|
1113
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="black" viewBox="0 0 16 16"><path d="M11 7.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z"/><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M2 2a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1z"/><path d="M2.5 4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5z"/></svg>');
|
|
1114
|
+
background-repeat: no-repeat;
|
|
1115
|
+
background-position: right 2px center;
|
|
1116
|
+
background-size: 14px auto;
|
|
1117
|
+
color: #333;
|
|
1118
|
+
box-sizing: border-box;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
cell-input-date input:hover {
|
|
1122
|
+
filter: brightness(95%);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
cell-input-date input::-webkit-calendar-picker-indicator {
|
|
1126
|
+
position: absolute;
|
|
1127
|
+
right: 0;
|
|
1128
|
+
top: 0;
|
|
1129
|
+
width: 16px;
|
|
1130
|
+
height: 100%;
|
|
1131
|
+
background: transparent;
|
|
1132
|
+
--color: transparent;
|
|
1133
|
+
cursor: pointer;
|
|
1134
|
+
--opacity: 0.3;
|
|
1135
|
+
--filter: brightness(80%);
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
cell-input-date input::before {
|
|
1141
|
+
content: attr(data-placeholder);
|
|
1142
|
+
position: absolute;
|
|
1143
|
+
display: flex;
|
|
1144
|
+
align-items: center;
|
|
1145
|
+
width: calc(100% - 22px);
|
|
1146
|
+
height: 100%;
|
|
1147
|
+
background-color: white;
|
|
1148
|
+
left: 1px;
|
|
1149
|
+
top: 1px;
|
|
1150
|
+
pointer-events: none;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
cell-input-date input.has-value::before,
|
|
1154
|
+
cell-input-date input:focus::before {
|
|
1155
|
+
display: none;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
cell-input-date input:focus {
|
|
1159
|
+
border: 1px solid #28a745;
|
|
1160
|
+
border-radius: 3px;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
</style>
|
|
1165
|
+
|
|
1166
|
+
<input
|
|
1167
|
+
type="${e.getAttribute("date-type")||"date"}"
|
|
1168
|
+
data-placeholder="${e.getAttribute("placeholder")||"Select"}"
|
|
1169
|
+
${s.join(" ")}
|
|
1170
|
+
required
|
|
1171
|
+
/>
|
|
1172
|
+
`},"#renderer"));E(this,"refresh",h(()=>{const e=super.refresh();if(!t(this,wt))return e;let s=e;if(s)switch(t(this,ce)){case"date":s=s.substr(0,10);break;case"datetime-local":s=s.substr(0,16);break;case"time":var i=new Date(e);i!="Invalid Date"&&!isNaN(i)&&(s=("00"+i.getHours()).slice(-2)+":"+("00"+i.getMinutes()).slice(-2));break;case"month":var i=new Date(e);i!="Invalid Date"&&!isNaN(i)&&(s=("0000"+i.getFullYear()).slice(-4)+"-"+("00"+(i.getMonth()+1)).slice(-2));break}return t(this,wt).value=s||"",t(this,wt).classList.toggle("has-value",!!s),t(this,Ls).call(this,s),e},"refresh"));d(this,Ls,h(e=>{if(!t(this,wt)||!super.cell)return;const s=this.closest("th,td"),i=s==null?void 0:s.getAttribute("min"),n=s==null?void 0:s.getAttribute("max");if(super.cell.classList.remove("invalid"),e!==""&&e!==null&&e!==void 0){let o=t(this,_n).call(this,e);o&&(i&&e<i&&(o=!1),n&&e>n&&(o=!1)),o||super.cell.classList.add("invalid")}},"#validateInput"));d(this,_n,h(e=>{if(typeof e!="string")return!1;let s=!0;switch(t(this,ce)){case"date":case"datetime-local":const p=Number(e.substr(0,4)),f=Number(e.substr(5,2)),b=Number(e.substr(8,2));if(isNaN(p)||isNaN(f)||isNaN(b))s=!1;else if(f<1||f>12||b<1||b>31)s=!1;else if([4,6,9,11].includes(f)&&b==31)s=!1;else if(f==2){let m=p%4==0&&(p%100!=0||p%400==0);(b>29||b==29&&!m)&&(s=!1)}break}if(s)switch(t(this,ce)){case"datetime-local":var i=e.substr(10,1),n=Number(e.substr(11,2)),o=Number(e.substr(14,2));(i!="T"||isNaN(n)||isNaN(o)||n<0||n>23||o<0||o>59)&&(s=!1);break;case"month":var a=Number(e.substr(0,4)),l=Number(e.substr(5,2));(isNaN(a)||isNaN(l)||l<1||l>12)&&(s=!1);break;case"week":var a=Number(e.substr(0,4)),c=e.substr(5,1),u=Number(e.substr(6,2));(c!="W"||isNaN(a)||isNaN(u)||u<=0||u>53)&&(s=!1);break}return s},"#isValidDate"));this.applyBaseStyle()}connectedCallback(){if(t(this,Xn).call(this),super.connectedCallback(),g(this,ce,super.attr["date-type"]||"date"),!["date","datetime-local","time","week","month"].includes(t(this,ce)))throw`invalid type : ${t(this,ce)}`;g(this,wt,this.querySelector("input")),t(this,wt)&&(t(this,wt).addEventListener("input",e=>{const s=e.target.value;this.value=s,t(this,wt).classList.toggle("has-value",!!s),t(this,Ls).call(this,s),super.sheet.rowManager.refresh(!0)}),t(this,wt).addEventListener("change",e=>{const s=e.target.value;this.value=s,t(this,Ls).call(this,s),super.sheet.rowManager.refresh(!0)}),t(this,wt).addEventListener("keydown",e=>{["Enter"].includes(e.code)||(["Escape"].includes(e.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(e)))}))}};wt=new WeakMap,ce=new WeakMap,Xn=new WeakMap,Ls=new WeakMap,_n=new WeakMap,h(Po,"CellInputDate");let Yr=Po;customElements.get("cell-input-date")||customElements.define("cell-input-date",Yr);const Xo=class Xo extends Jt{constructor(){super();d(this,he);d(this,Rs);d(this,ss);d(this,Cs);d(this,ks);d(this,Gn,h(()=>{var e;g(this,he,this.querySelector("input")),g(this,Rs,this.querySelector("span")),g(this,Cs,super.attr["true-text"]||""),g(this,ks,super.attr["false-text"]||""),this.closest("thead")&&t(this,he).addEventListener("change",s=>{var i;(i=super.sheet.querySelector(`tbody.body [data-col="${super.cell.dataset.col}"] cell-checkbox`))==null||i.selectAll(s.target.checked)}),(e=this.cell)==null||e.addEventListener("keydown",s=>{if(s.preventDefault(),s.code==="Space"||this.closest("thead")||this.cell.hasAttribute("readonly")||this.cell.classList.contains("readonly")||this.cell.getAttribute("disabled")==="true")return;const i=this.value===this.trueValue?this.falseValue:this.trueValue;t(this,ss)&&this.selectAll(!1),this.value=i,super.sheet.invalidate()}),t(this,he).addEventListener("change",s=>{this.closest("tbody")&&(t(this,ss)?(this.selectAll(!1),this.value=this.trueValue):this.value=s.target.checked?this.trueValue:this.falseValue,super.sheet.rowManager.refresh(!0))})},"#init"));d(this,Un,h(()=>{const e=this.closest("th,td");g(this,ss,(e==null?void 0:e.getAttribute("is-radio"))||!1);const s=(e==null?void 0:e.getAttribute("true-value"))||!1,i=(e==null?void 0:e.getAttribute("content"))||"",n=t(this,ss)?`<input type="radio" value="${s}" />`:`<label><input type="checkbox" /><span>${i}</span></label>`;this.innerHTML=`
|
|
1173
|
+
<style>
|
|
1174
|
+
.CELL-CHECKBOX {
|
|
1175
|
+
cell-checkbox {
|
|
1176
|
+
justify-content: center;
|
|
1177
|
+
}
|
|
1178
|
+
label {
|
|
1179
|
+
display: flex;
|
|
1180
|
+
}
|
|
1181
|
+
input {
|
|
1182
|
+
background-color: #ffffff;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
/* ๋ผ๋์ค ๋ฒํผ ์คํ์ผ */
|
|
1187
|
+
input[type="radio"] {
|
|
1188
|
+
appearance: none;
|
|
1189
|
+
-webkit-appearance: none;
|
|
1190
|
+
width: 14px;
|
|
1191
|
+
height: 14px;
|
|
1192
|
+
background-color: #ffffff;
|
|
1193
|
+
border: 1px solid #9ca3af;
|
|
1194
|
+
border-radius: 50%; /* ๋๊ทธ๋๊ฒ ์ฒ๋ฆฌ */
|
|
1195
|
+
outline: none;
|
|
1196
|
+
cursor: pointer;
|
|
1197
|
+
margin: 0;
|
|
1198
|
+
display: inline-flex;
|
|
1199
|
+
align-items: center;
|
|
1200
|
+
justify-content: center;
|
|
1201
|
+
transition: background-color 0.15s ease, border-color 0.15s ease;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
/* ์ฒดํฌ(์ ํ)๋์์ ๋์ ์คํ์ผ */
|
|
1205
|
+
input[type="radio"]:checked {
|
|
1206
|
+
background-color: #ffffff;
|
|
1207
|
+
border-color: #2563eb;
|
|
1208
|
+
/* ๋ด๋ถ์ ์์ ์ฑ์์ง ๋๊ทธ๋ ์ ์์ด์ฝ */
|
|
1209
|
+
background-image: url('data:image/svg+xml;utf8,<svg height="14" width="14" xmlns="http://www.w3.org/2000/svg"><circle r="3.5" cx="50%" cy="50%" fill="%232563eb" /></svg>');
|
|
1210
|
+
background-repeat: no-repeat;
|
|
1211
|
+
background-position: center;
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
.CELL-CHECKBOX[text-align='left'] {
|
|
1215
|
+
cell-checkbox {
|
|
1216
|
+
justify-content: flex-start;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
.CELL-CHECKBOX[text-align='center'] {
|
|
1220
|
+
cell-checkbox {
|
|
1221
|
+
justify-content: center;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
.CELL-CHECKBOX[text-align='right'] {
|
|
1225
|
+
cell-checkbox {
|
|
1226
|
+
justify-content: flex-end;
|
|
1227
|
+
}
|
|
1228
|
+
label {
|
|
1229
|
+
flex-direction: row-reverse;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
|
|
1235
|
+
cell-checkbox {
|
|
1236
|
+
display: flex;
|
|
1237
|
+
align-items: center;
|
|
1238
|
+
width: 100%;
|
|
1239
|
+
height: 100%;
|
|
1240
|
+
box-sizing: border-box;
|
|
1241
|
+
}
|
|
1242
|
+
cell-checkbox label {
|
|
1243
|
+
display: inline-flex;
|
|
1244
|
+
align-items: center;
|
|
1245
|
+
gap: 4px;
|
|
1246
|
+
cursor: pointer;
|
|
1247
|
+
user-select: none;
|
|
1248
|
+
}
|
|
1249
|
+
cell-checkbox input {
|
|
1250
|
+
outline: none;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
</style>
|
|
1254
|
+
${n}
|
|
1255
|
+
`},"#renderer"));E(this,"refresh",h(()=>{const e=super.refresh();if(!this.closest("tbody")&&!this.closest("thead"))return e;if(t(this,he)&&(t(this,he).checked=e===this.trueValue,t(this,jn).call(this,e)),t(this,Rs)){const s=e===this.trueValue?t(this,Cs):e===this.falseValue?t(this,ks):e;t(this,Rs).textContent=s}return e},"refresh"));d(this,jn,h(e=>{t(this,he)&&(super.cell.classList.remove("invalid"),e!==""&&e!==null&&e!==void 0&&e!==this.trueValue&&e!==this.falseValue&&super.cell.classList.add("invalid"))},"#validateInput"));E(this,"selectAll",h(e=>{if(this.closest("thead"))return;const s=super.host.data.getArray(),i=super.host.fields.indexOf(super.cell.dataset.bind);if(!(i<0)){for(let n=0;n<s.length;n++)super.attr.enable&&super.getExprValue(super.attr.enable,s[n],n,super.cell)===!1||super.attr.readonly&&super.getExprValue(super.attr.readonly,s[n],n,super.cell)===!0||super.attr.visible&&super.getExprValue(super.attr.visible,s[n],n,super.cell)===!1||(s[n].v[i]=e?this.trueValue:this.falseValue);super.sheet.invalidate()}},"selectAll"))}connectedCallback(){t(this,Un).call(this),super.connectedCallback(),t(this,Gn).call(this)}get trueValue(){return super.attr["true-value"]||"Y"}get falseValue(){return super.attr["false-value"]||"N"}get dataSource(){return[{value:this.trueValue,text:t(this,Cs)},{value:this.falseValue,text:t(this,ks)}]}};he=new WeakMap,Rs=new WeakMap,ss=new WeakMap,Cs=new WeakMap,ks=new WeakMap,Gn=new WeakMap,Un=new WeakMap,jn=new WeakMap,h(Xo,"CellCheckbox");let Zr=Xo;customElements.get("cell-checkbox")||customElements.define("cell-checkbox",Zr);const Ko=class Ko extends Jt{constructor(){super();d(this,is);d(this,Bt,[]);d(this,ns);d(this,Ts);d(this,_o);d(this,Go);d(this,Uo);d(this,jo);d(this,Kn,h(()=>{super.cell.addEventListener("keydown",e=>{if(e.preventDefault(),e.code!=="Space"||this.cell.hasAttribute("readonly")||this.cell.classList.contains("readonly")||this.cell.getAttribute("disabled")==="true")return;let s=-1;const i=Array.from(this.querySelectorAll("input"));i.forEach((n,o)=>{if(this.value===n.getAttribute("value"))return s=o,!1}),s=s===i.length-1?0:s>=0?s+1:0,this.value=i[s].getAttribute("value"),super.sheet.rowManager.refresh(!0)})},"#initEvent"));d(this,Di,h(()=>{var s;if(!super.sheet||!super.cell)return;const e=(s=super.cell)==null?void 0:s.getAttribute("data-source");if(e&&(g(this,Bt,super.getExprValue(e,super.tr.data,super.tr.dataset.row)),v.log("=============================================="),v.log(this.sheet,t(this,Bt)),setTimeout(()=>{v.log("1111")},300),t(this,is).replaceChildren(),t(this,Bt)&&Array.isArray(t(this,Bt)))){const i=document.createDocumentFragment();t(this,Bt).forEach(n=>{const o=n[t(this,ns)]!==void 0?n[t(this,ns)]:"",l=n[t(this,Ts)]!==void 0?n[t(this,Ts)]:"",a=document.createElement("label"),c=document.createElement("input");c.type="radio",c.value=o;const u=document.createElement("span");u.textContent=l,a.appendChild(c),a.appendChild(u),i.appendChild(a)}),t(this,is).appendChild(i),this.querySelectorAll("input").forEach(n=>{n.addEventListener("change",o=>{this.value=o.target.value,super.sheet.rowManager.refresh(!0)})})}},"#rendererRadio"));d(this,Yn,h(()=>{this.innerHTML=`
|
|
1256
|
+
<style>
|
|
1257
|
+
.CELL-RADIO {
|
|
1258
|
+
input[type="radio"] {
|
|
1259
|
+
appearance: none;
|
|
1260
|
+
-webkit-appearance: none;
|
|
1261
|
+
width: 14px;
|
|
1262
|
+
height: 14px;
|
|
1263
|
+
background-color: #ffffff;
|
|
1264
|
+
border: 1px solid #9ca3af;
|
|
1265
|
+
border-radius: 50%; /* ๋๊ทธ๋๊ฒ ์ฒ๋ฆฌ */
|
|
1266
|
+
outline: none;
|
|
1267
|
+
cursor: pointer;
|
|
1268
|
+
margin: 0;
|
|
1269
|
+
display: inline-flex;
|
|
1270
|
+
align-items: center;
|
|
1271
|
+
justify-content: center;
|
|
1272
|
+
transition: background-color 0.15s ease, border-color 0.15s ease;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/* ์ฒดํฌ(์ ํ)๋์์ ๋์ ์คํ์ผ */
|
|
1276
|
+
input[type="radio"]:checked {
|
|
1277
|
+
background-color: #ffffff;
|
|
1278
|
+
border-color: #2563eb;
|
|
1279
|
+
/* ๋ด๋ถ์ ์์ ์ฑ์์ง ๋๊ทธ๋ ์ ์์ด์ฝ */
|
|
1280
|
+
background-image: url('data:image/svg+xml;utf8,<svg height="14" width="14" xmlns="http://www.w3.org/2000/svg"><circle r="3.5" cx="50%" cy="50%" fill="%232563eb" /></svg>');
|
|
1281
|
+
background-repeat: no-repeat;
|
|
1282
|
+
background-position: center;
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
.CELL-RADIO[text-align='left'] {
|
|
1287
|
+
cell-radio {
|
|
1288
|
+
justify-content: flex-start;
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
.CELL-RADIO[text-align='center'] {
|
|
1292
|
+
cell-radio {
|
|
1293
|
+
justify-content: center;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
.CELL-RADIO[text-align='right'] {
|
|
1297
|
+
cell-radio {
|
|
1298
|
+
justify-content: flex-end;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
cell-radio {
|
|
1303
|
+
height: 100%;
|
|
1304
|
+
width: calc(100% - 8px);
|
|
1305
|
+
display: flex;
|
|
1306
|
+
align-items: center;
|
|
1307
|
+
margin-left: 4px;
|
|
1308
|
+
margin-right: 4px;
|
|
1309
|
+
box-sizing: border-box;
|
|
1310
|
+
|
|
1311
|
+
div {
|
|
1312
|
+
display: flex;
|
|
1313
|
+
flex-direction: row;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
cell-radio.invalid::after {
|
|
1318
|
+
content: '';
|
|
1319
|
+
margin-left: 4px;
|
|
1320
|
+
width: 16px;
|
|
1321
|
+
height: 16px;
|
|
1322
|
+
border: none;
|
|
1323
|
+
background-repeat: no-repeat;
|
|
1324
|
+
background-position: center;
|
|
1325
|
+
background-size: auto;
|
|
1326
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" style="fill: none; stroke-width: 2px; stroke: darkgoldenrod;" viewBox="0 0 16 16"><path d="m8 1 7 14H1L8 1z"></path><path d="M7.99 12H8v.01h-.01zM8 6v4"></path></svg>');
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
cell-radio input {
|
|
1330
|
+
flex-shrink: 0;
|
|
1331
|
+
width: 14px;
|
|
1332
|
+
height: 14px;
|
|
1333
|
+
padding: 0;
|
|
1334
|
+
margin: 0;
|
|
1335
|
+
-webkit-appearance: none;
|
|
1336
|
+
-moz-appearance: none;
|
|
1337
|
+
appearance: none;
|
|
1338
|
+
background-repeat: no-repeat;
|
|
1339
|
+
background-position: center;
|
|
1340
|
+
background-size: contain;
|
|
1341
|
+
border: 1px solid dimgray;
|
|
1342
|
+
border-radius: 50%;
|
|
1343
|
+
outline: 0;
|
|
1344
|
+
cursor: pointer;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
cell-radio input:checked {
|
|
1348
|
+
background-image: url('data:image/svg+xml;utf8,<svg height="14" width="14" xmlns="http://www.w3.org/2000/svg"><circle r="3" cx="50%" cy="50%" fill="dimgray" /></svg>');
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
cell-radio label {
|
|
1352
|
+
display: flex;
|
|
1353
|
+
align-items: center;
|
|
1354
|
+
margin-right: 8px;
|
|
1355
|
+
cursor: pointer;
|
|
1356
|
+
user-select: none;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
cell-radio label.disabled {
|
|
1360
|
+
pointer-events: none;
|
|
1361
|
+
opacity: 0.5;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
cell-radio span {
|
|
1365
|
+
margin-left: 4px;
|
|
1366
|
+
font-size: 12px;
|
|
1367
|
+
}
|
|
1368
|
+
</style>
|
|
1369
|
+
|
|
1370
|
+
<div></div>
|
|
1371
|
+
`,g(this,is,this.querySelector("div"))},"#renderer"));E(this,"rerenderer",h(()=>{t(this,Di).call(this),this.refresh()},"rerenderer"));E(this,"refresh",h(()=>{const e=super.refresh();return t(this,is)&&(this.querySelectorAll("input").forEach(s=>{s.checked=this.value==s.getAttribute("value")}),t(this,Zn).call(this)),e},"refresh"));d(this,Zn,h(()=>{if(!super.cell||(super.cell.classList.remove("invalid"),this.value===null||this.value===void 0||this.value===""||!Array.isArray(t(this,Bt))))return;t(this,Bt).findIndex(s=>this.value===s[t(this,ns)])<0&&super.cell.classList.add("invalid")},"#validateInput"));this.applyBaseStyle()}connectedCallback(){g(this,ns,this.closest("th,td").getAttribute("key-name")||"k"),g(this,Ts,this.closest("th,td").getAttribute("value-name")||"v"),t(this,Yn).call(this),super.connectedCallback(),t(this,Di).call(this),t(this,Kn).call(this)}get dataSource(){return t(this,Bt)}};is=new WeakMap,Bt=new WeakMap,ns=new WeakMap,Ts=new WeakMap,_o=new WeakMap,Go=new WeakMap,Uo=new WeakMap,jo=new WeakMap,Kn=new WeakMap,Di=new WeakMap,Yn=new WeakMap,Zn=new WeakMap,h(Ko,"CellRadio");let Jr=Ko;customElements.get("cell-radio")||customElements.define("cell-radio",Jr);const Yo=class Yo extends HTMLElement{constructor(){super();d(this,ot);d(this,Jn);d(this,Qn);d(this,Is,!1);d(this,tr,h((e,s,i,n,o)=>{const l=this.querySelector("nine-table-simple");if(!l||!e||e.length===0)return;const a=t(this,ot).getAttribute("items");let c=[];a?c=a.split(",").map(f=>f.trim()):c=[i].filter(Boolean);const u=c.length;l.shadowRoot.querySelector(".ng-container-left").style.display=n?"":"none",l.shadowRoot.querySelectorAll("table colgroup col, tbody td").forEach((f,b)=>{v.log(f);const m=parseInt(f.dataset.col,10);m>=2&&(f.style.display=m-2>=u?"none":"")});const p=e.map(f=>{const b={CHK:"N",k:s&&f[s]!==void 0?f[s]:f[0]!==void 0?f[0]:""};return c.forEach((m,y)=>{b[`tmp${y+1}`]=f[m]!==void 0?f[m]:f[y]!==void 0?f[y]:""}),b});if(l.data.set(p),n&&t(this,ot).value){const f=String(t(this,ot).value).split(o||",");l.data.getValidData().forEach(b=>{f.includes(String(b.v[1]))&&(b.v[0]="Y")}),l.refreshData()}},"#initData"));E(this,"open",h((e,s,i,n,o,l)=>{g(this,ot,e),g(this,Jn,i),g(this,Qn,n),g(this,Is,!0),v.log(new Date),this.classList.add("active");const a=this.querySelector("nine-table-simple");if(!a||!s)return;this.querySelector(".search-input").value="",this.querySelector("#chkAll").checked=!0,s.length>10?this.classList.add("expand"):this.classList.remove("expand"),o?this.classList.add("multi"):this.classList.remove("multi");const c=e.closest("nine-table-sheet"),u=e.querySelector(".btn1");if(!u||!c)return;const p=u.getBoundingClientRect(),f=c.getBoundingClientRect();let b=p.left-f.left,m=p.bottom-f.top+2;const y=this.offsetWidth||250,x=this.offsetHeight||250;if(b+y>f.width&&(b=Math.max(0,f.width-y-5)),b<0&&(b=5),m+x>f.height){const w=p.top-f.top-x-2;w>=0?m=w:m=Math.max(0,f.height-x-5)}this.style.left=`${b}px`,this.style.top=`${m}px`,v.log(new Date),setTimeout(()=>{v.log(new Date),t(this,tr).call(this,s,i,n,o,l),v.log(new Date);const w=a.shadowRoot.querySelector(".ng-container-body table tbody.body");w.__hasClickEvent||(w.addEventListener("mousedown",S=>{v.log("==========================================",S.target),S.target.closest("tr")&&(v.log("==========================================",o),o||t(this,er).call(this,S))}),w.__hasClickEvent=!0),v.log(new Date)},100)},"open"));E(this,"close",h(()=>{this.classList.remove("active"),g(this,Is,!1),t(this,ot)&&t(this,ot).cell&&t(this,ot).cell.focus()},"close"));d(this,er,h(e=>{const s=e.target.closest("nine-table-sheet"),i=e.target.closest("tr"),n=parseInt(i.dataset.row,10),o=s.view.get(n);t(this,ot).value=o.k,t(this,ot).sheet.rowManager.refresh(!0),this.close()},"#onClickRow"));d(this,sr,h(()=>{const s=this.querySelector("nine-table-simple").data.getValidData(),i=[];s.forEach(n=>{n.v[0]==="Y"&&i.push(n.v[1])}),t(this,ot).value=i.join(t(this,ot).getAttribute("multi-separator")||","),t(this,ot).sheet.rowManager.refresh(!0),this.close()},"#onOk"));d(this,ir,h(e=>{const s=this.querySelector("nine-table-simple"),i=e.target.checked?"Y":"N";s.data.getValidData().forEach(n=>{n.v[0]=i}),s.refreshData()},"#onSelectAll"));d(this,nr,h(e=>{const s=e.target.value.toLowerCase(),i=this.querySelector("nine-table-simple");i.data.getValidDataNF().forEach(n=>{const o=Object.values(n.v).some(l=>l!=null&&String(l).toLowerCase().includes(s));n.__ng.filtered=!o}),i.data.resetRecords(),i.dataManager.viewRecords.reset()},"#onInput"));d(this,rr,h(()=>{this.querySelector(".search-input").addEventListener("input",t(this,nr)),this.querySelector("#btnOk").addEventListener("click",t(this,sr)),this.querySelector("#chkAll").addEventListener("change",t(this,ir)),document.addEventListener("mousedown",e=>{(e.composedPath?e.composedPath():[]).includes(this)||this.close()})},"#initEvents"));d(this,or,h(()=>{this.innerHTML=`
|
|
1372
|
+
<style>
|
|
1373
|
+
|
|
1374
|
+
cell-combo-panel.active {
|
|
1375
|
+
display: flex;
|
|
1376
|
+
}
|
|
1377
|
+
cell-combo-panel .head {
|
|
1378
|
+
display: none;
|
|
1379
|
+
padding: 6px;
|
|
1380
|
+
background: #f8f9fa;
|
|
1381
|
+
border-bottom: 1px solid #e5e7eb;
|
|
1382
|
+
}
|
|
1383
|
+
cell-combo-panel .head input[type="text"] {
|
|
1384
|
+
width: 100%;
|
|
1385
|
+
height: 26px;
|
|
1386
|
+
padding: 0 6px;
|
|
1387
|
+
box-sizing: border-box;
|
|
1388
|
+
border: 1px solid #d1d5db;
|
|
1389
|
+
border-radius: 3px;
|
|
1390
|
+
outline: none;
|
|
1391
|
+
font-size: 12px;
|
|
1392
|
+
}
|
|
1393
|
+
cell-combo-panel.expand .head {
|
|
1394
|
+
display: flex;
|
|
1395
|
+
}
|
|
1396
|
+
cell-combo-panel nine-table-simple {
|
|
1397
|
+
width: 100%;
|
|
1398
|
+
flex: 1;
|
|
1399
|
+
border: none;
|
|
1400
|
+
}
|
|
1401
|
+
cell-combo-panel .footer {
|
|
1402
|
+
display: none;
|
|
1403
|
+
height: 32px;
|
|
1404
|
+
background: #f3f4f6;
|
|
1405
|
+
border-top: 1px solid #e5e7eb;
|
|
1406
|
+
align-items: center;
|
|
1407
|
+
padding: 0 8px;
|
|
1408
|
+
box-sizing: border-box;
|
|
1409
|
+
}
|
|
1410
|
+
cell-combo-panel.multi .footer {
|
|
1411
|
+
display: flex;
|
|
1412
|
+
justify-content: space-between;
|
|
1413
|
+
}
|
|
1414
|
+
cell-combo-panel .footer label {
|
|
1415
|
+
font-size: 12px;
|
|
1416
|
+
cursor: pointer;
|
|
1417
|
+
user-select: none;
|
|
1418
|
+
}
|
|
1419
|
+
cell-combo-panel .footer button {
|
|
1420
|
+
height: 22px;
|
|
1421
|
+
padding: 0 12px;
|
|
1422
|
+
font-size: 11px;
|
|
1423
|
+
cursor: pointer;
|
|
1424
|
+
background: #2563eb;
|
|
1425
|
+
color: white;
|
|
1426
|
+
border: none;
|
|
1427
|
+
border-radius: 3px;
|
|
1428
|
+
}
|
|
1429
|
+
cell-combo-panel .footer button:hover {
|
|
1430
|
+
background: #1d4ed8;
|
|
1431
|
+
}
|
|
1432
|
+
</style>
|
|
1433
|
+
|
|
1434
|
+
<div class="head">
|
|
1435
|
+
<input type="text" class="search-input" placeholder="Search..." />
|
|
1436
|
+
</div>
|
|
1437
|
+
|
|
1438
|
+
<nine-table-simple class="combo-list" theme="simple">
|
|
1439
|
+
<table auto-fit-col="true">
|
|
1440
|
+
<colgroup>
|
|
1441
|
+
<col width="30" fixed="left" />
|
|
1442
|
+
<col width="100" />
|
|
1443
|
+
<col width="100" />
|
|
1444
|
+
<col width="100" />
|
|
1445
|
+
<col width="100" />
|
|
1446
|
+
<col width="100" />
|
|
1447
|
+
<col width="100" />
|
|
1448
|
+
<col width="100" />
|
|
1449
|
+
<col width="100" />
|
|
1450
|
+
<col width="100" />
|
|
1451
|
+
<col width="100" />
|
|
1452
|
+
<col width="0" />
|
|
1453
|
+
</colgroup>
|
|
1454
|
+
<tbody>
|
|
1455
|
+
<tr>
|
|
1456
|
+
<td cell-type="checkbox" data-bind="CHK"></td>
|
|
1457
|
+
<td data-bind="tmp1" />
|
|
1458
|
+
<td data-bind="tmp2" />
|
|
1459
|
+
<td data-bind="tmp3" />
|
|
1460
|
+
<td data-bind="tmp4" />
|
|
1461
|
+
<td data-bind="tmp5" />
|
|
1462
|
+
<td data-bind="tmp6" />
|
|
1463
|
+
<td data-bind="tmp7" />
|
|
1464
|
+
<td data-bind="tmp8" />
|
|
1465
|
+
<td data-bind="tmp9" />
|
|
1466
|
+
<td data-bind="tmp10" />
|
|
1467
|
+
<td data-bind="k" />
|
|
1468
|
+
</tr>
|
|
1469
|
+
</tbody>
|
|
1470
|
+
</table>
|
|
1471
|
+
</nine-table-simple>
|
|
1472
|
+
|
|
1473
|
+
<div class="footer">
|
|
1474
|
+
<div>
|
|
1475
|
+
<input id="chkAll" type="checkbox" checked>
|
|
1476
|
+
<label for="chkAll">Select All</label>
|
|
1477
|
+
</div>
|
|
1478
|
+
<button id="btnOk">OK</button>
|
|
1479
|
+
</div>
|
|
1480
|
+
`},"#renderer"))}connectedCallback(){t(this,or).call(this),t(this,rr).call(this)}get isOpen(){return t(this,Is)}get targetCell(){return t(this,ot)}};ot=new WeakMap,Jn=new WeakMap,Qn=new WeakMap,Is=new WeakMap,tr=new WeakMap,er=new WeakMap,sr=new WeakMap,ir=new WeakMap,nr=new WeakMap,rr=new WeakMap,or=new WeakMap,h(Yo,"CellComboPanel");let Qr=Yo;customElements.get("cell-combo-panel")||customElements.define("cell-combo-panel",Qr);const Zo=class Zo extends Jt{constructor(){super();d(this,qs);d(this,Vt,[]);d(this,Re);d(this,rs);d(this,os);d(this,Ce);d(this,Ht);E(this,"rerenderer",h(()=>{v.log("rerenderer"),t(this,$i).call(this),this.refresh()},"rerenderer"));d(this,$i,h(()=>{var s;if(!super.sheet||!super.cell)return;const e=(s=super.cell)==null?void 0:s.getAttribute("data-source");e&&g(this,Vt,super.getExprValue(e,super.tr.data,super.tr.dataset.row))},"#initData"));d(this,lr,h(()=>{this.addEventListener("keydown",e=>{e.code==="Enter"&&(e.preventDefault(),t(this,zi).call(this))}),this.querySelectorAll("button").forEach(e=>{e.addEventListener("click",s=>{s.stopPropagation(),t(this,zi).call(this)})})},"#initEvent"));d(this,zi,h(()=>{v.log(new Date),t(this,Ht)||(g(this,Ht,super.sheet.querySelector("cell-combo-panel")),t(this,Ht)||(g(this,Ht,document.createElement("cell-combo-panel")),super.sheet.appendChild(t(this,Ht)))),v.log(new Date),t(this,Ht).isOpen&&t(this,Ht).targetCell===this?t(this,Ht).close():t(this,Ht).open(this,t(this,Vt),t(this,Re),t(this,rs),t(this,os),t(this,Ce)),v.log(new Date)},"#togglePanel"));d(this,ar,h(()=>{this.innerHTML=`
|
|
1481
|
+
<style>
|
|
1482
|
+
cell-combo {
|
|
1483
|
+
height: 100%;
|
|
1484
|
+
width: calc(100% - 8px);
|
|
1485
|
+
display: flex;
|
|
1486
|
+
align-items: center;
|
|
1487
|
+
margin-left: 4px;
|
|
1488
|
+
margin-right: 4px;
|
|
1489
|
+
box-sizing: border-box;
|
|
1490
|
+
}
|
|
1491
|
+
cell-combo.invalid .btn2::after {
|
|
1492
|
+
content: '';
|
|
1493
|
+
width: 16px;
|
|
1494
|
+
height: 16px;
|
|
1495
|
+
border: none;
|
|
1496
|
+
background-repeat: no-repeat;
|
|
1497
|
+
background-position: center;
|
|
1498
|
+
background-size: auto;
|
|
1499
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" style="fill: none; stroke-width: 2px; stroke: darkgoldenrod;" viewBox="0 0 16 16"><path d="m8 1 7 14H1L8 1z"></path><path d="M7.99 12H8v.01h-.01zM8 6v4"></path></svg>');
|
|
1500
|
+
}
|
|
1501
|
+
cell-combo button {
|
|
1502
|
+
outline: none;
|
|
1503
|
+
cursor: pointer;
|
|
1504
|
+
font: inherit;
|
|
1505
|
+
}
|
|
1506
|
+
cell-combo button.btn1 {
|
|
1507
|
+
width: calc(100% - 24px);
|
|
1508
|
+
height: 26px;
|
|
1509
|
+
border: 1px solid #eee;
|
|
1510
|
+
border-right: none;
|
|
1511
|
+
border-top-left-radius: 3px;
|
|
1512
|
+
border-bottom-left-radius: 3px;
|
|
1513
|
+
text-align: left;
|
|
1514
|
+
background-color: white;
|
|
1515
|
+
overflow: hidden;
|
|
1516
|
+
text-overflow: ellipsis;
|
|
1517
|
+
white-space: nowrap;
|
|
1518
|
+
padding: 0 4px;
|
|
1519
|
+
color: #000;
|
|
1520
|
+
}
|
|
1521
|
+
cell-combo button.btn2 {
|
|
1522
|
+
padding: 3px;
|
|
1523
|
+
width: 24px;
|
|
1524
|
+
height: 26px;
|
|
1525
|
+
border: 1px solid #eee;
|
|
1526
|
+
border-top-right-radius: 3px;
|
|
1527
|
+
border-bottom-right-radius: 3px;
|
|
1528
|
+
background-color: #f9f9f9;
|
|
1529
|
+
display: flex;
|
|
1530
|
+
align-items: center;
|
|
1531
|
+
justify-content: center;
|
|
1532
|
+
color: #333;
|
|
1533
|
+
}
|
|
1534
|
+
cell-combo button.btn2:after {
|
|
1535
|
+
content: "";
|
|
1536
|
+
border-top: 0.3em solid;
|
|
1537
|
+
border-right: 0.3em solid transparent;
|
|
1538
|
+
border-bottom: 0;
|
|
1539
|
+
border-left: 0.3em solid transparent;
|
|
1540
|
+
}
|
|
1541
|
+
</style>
|
|
1542
|
+
<button class="btn1" type="button" tabindex="-1">Select</button>
|
|
1543
|
+
<button class="btn2" type="button" tabindex="-1"></button>
|
|
1544
|
+
`,g(this,qs,this.querySelector(".btn1"))},"#renderer"));E(this,"refresh",h(()=>{const e=super.refresh();return t(this,qs)&&(t(this,qs).textContent=t(this,cr).call(this)||"Select",t(this,hr).call(this)),e},"refresh"));d(this,cr,h(()=>{if(!this.value||!Array.isArray(t(this,Vt)))return"";if(t(this,os)){const e=String(this.value).split(t(this,Ce));return t(this,Vt).filter(s=>e.includes(String(s[t(this,Re)]))).map(s=>s[t(this,rs)]).join(t(this,Ce))}else{const e=t(this,Vt).find(s=>String(s[t(this,Re)])===String(this.value));return e?e[t(this,rs)]:this.value}},"#getDisplayText"));d(this,hr,h(()=>{if(!super.cell||(super.cell.classList.remove("invalid"),this.value===null||this.value===void 0||this.value===""||!Array.isArray(t(this,Vt))))return;const e=t(this,os)?String(this.value).split(t(this,Ce)):[this.value];for(const s of e)if(t(this,Vt).findIndex(n=>String(s)===String(n[t(this,Re)]))<0){super.cell.classList.add("invalid");break}},"#validateInput"));this.applyBaseStyle()}connectedCallback(){t(this,ar).call(this),super.connectedCallback(),g(this,Re,super.cell.getAttribute("key-name")||"k"),g(this,rs,super.cell.getAttribute("value-name")||"v"),g(this,os,super.cell.getAttribute("multi")==="true"),g(this,Ce,super.cell.getAttribute("multi-separator")||","),t(this,$i).call(this),t(this,lr).call(this)}get dataSource(){return t(this,Vt)}};qs=new WeakMap,Vt=new WeakMap,Re=new WeakMap,rs=new WeakMap,os=new WeakMap,Ce=new WeakMap,Ht=new WeakMap,$i=new WeakMap,lr=new WeakMap,zi=new WeakMap,ar=new WeakMap,cr=new WeakMap,hr=new WeakMap,h(Zo,"CellCombo");let to=Zo;customElements.get("cell-combo")||customElements.define("cell-combo",to);const Jo=class Jo extends hs{constructor(){super();d(this,Ms);E(this,"refresh",h(()=>{super.refresh(),this.cell.getAttribute("html")==="true"?t(this,Ms).innerHTML=this.getDisplayText():t(this,Ms).textContent=this.getDisplayText()},"refresh"));d(this,dr,h(()=>{this.innerHTML=`
|
|
1545
|
+
<span></span>
|
|
1546
|
+
`},"#renderer"))}connectedCallback(){super.connectedCallback(),t(this,dr).call(this),g(this,Ms,this.querySelector("span"))}};Ms=new WeakMap,dr=new WeakMap,h(Jo,"CellRenderer");let eo=Jo;customElements.get("cell-renderer")||customElements.define("cell-renderer",eo);const Qo=class Qo extends hs{constructor(){super();d(this,ls);d(this,Fi,h(e=>{e.stopPropagation();const s=parseInt(this.cell.dataset.row,10),i=new CustomEvent(Dt.EVENT.CELL_BUTTON_CLICK,{bubbles:!0,composed:!0,detail:{originalEvent:e,cell:this.cell,row:s,col:parseInt(this.cell.dataset.col,10),bind:this.dataset.bind,data:this.host.data.get(s),value:this.value}});this.dispatchEvent(i)},"#cellButtonClick"));E(this,"refresh",h(()=>{const e=super.refresh?super.refresh():this.value;t(this,ls).innerHTML=this.getDisplayText(e)},"refresh"));d(this,ur,h(()=>{const e=this.closest("th,td"),s="...",i=(parseInt(e.offsetHeight,10)||32)-8;this.innerHTML=`
|
|
1547
|
+
<style>
|
|
1548
|
+
/* ์
(td, th) ๋ด๋ถ ํจ๋ฉ ์ ๊ฑฐ ๋ฐ ๊ฝ ์ฑ์ฐ๊ธฐ ์ค์ */
|
|
1549
|
+
cell-button {
|
|
1550
|
+
display: flex;
|
|
1551
|
+
align-items: stretch;
|
|
1552
|
+
justify-content: stretch;
|
|
1553
|
+
width: 100%;
|
|
1554
|
+
height: ${i}px;
|
|
1555
|
+
box-sizing: border-box;
|
|
1556
|
+
padding: 0;
|
|
1557
|
+
margin: 0;
|
|
1558
|
+
}
|
|
1559
|
+
cell-button .button {
|
|
1560
|
+
width: 100%;
|
|
1561
|
+
height: 100%;
|
|
1562
|
+
box-sizing: border-box;
|
|
1563
|
+
cursor: pointer;
|
|
1564
|
+
display: inline-flex;
|
|
1565
|
+
align-items: center;
|
|
1566
|
+
justify-content: center;
|
|
1567
|
+
font-size: 12px;
|
|
1568
|
+
border-radius: 0; /* ์
์ ๊ฝ ์ฐจ๊ฒ ๋ณด์ด๋ ค๋ฉด 0์ด ๊น๋ํ ์ ์์ */
|
|
1569
|
+
border: 1px solid #d1d5db;
|
|
1570
|
+
background-color: #f3f4f6;
|
|
1571
|
+
color: #1f2937;
|
|
1572
|
+
outline: none;
|
|
1573
|
+
text-overflow: ellipsis;
|
|
1574
|
+
white-space: nowrap;
|
|
1575
|
+
overflow: hidden;
|
|
1576
|
+
}
|
|
1577
|
+
cell-button .button:hover {
|
|
1578
|
+
background-color: #e5e7eb;
|
|
1579
|
+
}
|
|
1580
|
+
cell-button .button:active {
|
|
1581
|
+
background-color: #d1d5db;
|
|
1582
|
+
}
|
|
1583
|
+
</style>
|
|
1584
|
+
<button class="button">${s}</button>
|
|
1585
|
+
`},"#renderer"))}connectedCallback(){t(this,ur).call(this),super.connectedCallback(),g(this,ls,this.querySelector("button")),t(this,ls).removeEventListener("click",t(this,Fi)),t(this,ls).addEventListener("click",t(this,Fi))}};ls=new WeakMap,Fi=new WeakMap,ur=new WeakMap,h(Qo,"CellButton");let so=Qo;customElements.get("cell-button")||customElements.define("cell-button",so);const tl=class tl extends hs{constructor(){super();d(this,Hs);d(this,Ns);d(this,fr);d(this,pr,h(()=>{this.innerHTML=`
|
|
1586
|
+
<style>
|
|
1587
|
+
cell-row-indicator {
|
|
1588
|
+
display: block;
|
|
1589
|
+
position: absolute; /* ๐ก ์
์ ์ฒด๋ฅผ ๊ฐ์ ๋ก ๊ฝ ์ฑ์ */
|
|
1590
|
+
top: 0;
|
|
1591
|
+
left: 0;
|
|
1592
|
+
right: 0;
|
|
1593
|
+
bottom: 0;
|
|
1594
|
+
box-sizing: border-box;
|
|
1595
|
+
user-select: none;
|
|
1596
|
+
}
|
|
1597
|
+
/* ๋ฉ์ธ ํ ๋ฒํธ (์ค์ ์ ๋ ฌ์ ์ํด ํ๋ ์ค ์ ์ฉ) */
|
|
1598
|
+
.ng-row-main {
|
|
1599
|
+
display: flex;
|
|
1600
|
+
align-items: center;
|
|
1601
|
+
justify-content: center;
|
|
1602
|
+
width: 100%;
|
|
1603
|
+
height: 100%;
|
|
1604
|
+
text-align: center;
|
|
1605
|
+
overflow: hidden;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
/* ๐ฏ ์ฒ๋จ์ ์ฝค๋ง ๋ฐ ๋ถํ ์คํ์ผ๋ง */
|
|
1609
|
+
.ng-row-prefix {
|
|
1610
|
+
font-weight: normal;
|
|
1611
|
+
font-size: 0.40rem; /* ์์๋ฆฌ(์ฒ๋จ์ ์ด์)๋ ์์ฃผ ์๊ฒ */
|
|
1612
|
+
}
|
|
1613
|
+
.ng-row-suffix {
|
|
1614
|
+
font-size: 0.55rem; /* ๋ง์ง๋ง 3์๋ฆฌ ๋ฐ ์ฝค๋ง๋ ํ์ฌ ์
๊ธฐ๋ณธ ํฐํธ ํฌ๊ธฐ ์ ์ง */
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
/* ์ฐ์ธก ํ๋จ: ์๋ณธ/์ด๋นจ๋น ์ง ๋ฒํธ */
|
|
1618
|
+
.ng-row-sub {
|
|
1619
|
+
position: absolute;
|
|
1620
|
+
right: 2px;
|
|
1621
|
+
bottom: 1px;
|
|
1622
|
+
font-size: 0.40rem;
|
|
1623
|
+
line-height: 1;
|
|
1624
|
+
opacity: 0.2;
|
|
1625
|
+
pointer-events: none;
|
|
1626
|
+
}
|
|
1627
|
+
/* ์ฐ์ธก ์๋จ: ์ํ ํ์ */
|
|
1628
|
+
.ng-row-status {
|
|
1629
|
+
position: absolute;
|
|
1630
|
+
right: 2px;
|
|
1631
|
+
top: 1px;
|
|
1632
|
+
font-size: 0.55rem;
|
|
1633
|
+
line-height: 1;
|
|
1634
|
+
pointer-events: none;
|
|
1635
|
+
}
|
|
1636
|
+
</style>
|
|
1637
|
+
|
|
1638
|
+
<span class="ng-row-main"></span>
|
|
1639
|
+
<span class="ng-row-sub"></span>
|
|
1640
|
+
<span class="ng-row-status"></span>
|
|
1641
|
+
`},"#renderer"));E(this,"refresh",h(()=>{if(!this.cell||!this.tr)return;const e=this.row;if(isNaN(e))return;const s=this.tr.data;s&&s.__ng&&s.__ng.rowState;const i=this.index+1,n=i.toLocaleString();if(i>=1e4){const a=n.length-4,c=n.substring(0,a+1),u=n.substring(a+1);t(this,Hs).innerHTML=`
|
|
1642
|
+
<span class="ng-row-prefix">${c}</span>
|
|
1643
|
+
<span class="ng-row-suffix">${u}</span>
|
|
1644
|
+
`}else t(this,Hs).innerHTML=`${n}`;const o=!!this.sheet.querySelector("thead .asc,thead .desc"),l=!!this.sheet.querySelector("thead nine-table-filter-button.filtered");t(this,Ns).innerHTML=e,t(this,Ns).style.display=o||l?"":"none"},"refresh"));this.applyBaseStyle()}connectedCallback(){var e;t(this,pr).call(this),(e=super.connectedCallback)==null||e.call(this),this.cell&&(this.cell.removeAttribute("tabindex"),this.cell.dataset.bind="rowState",this.cell.dataset.expr||(this.cell.dataset.expr="data.__ng._[ninegrid.ROW.ORDER]"),this.cell.setAttribute("text-align","center")),g(this,Hs,this.querySelector(".ng-row-main")),g(this,Ns,this.querySelector(".ng-row-sub")),g(this,fr,this.querySelector(".ng-row-status"))}};Hs=new WeakMap,Ns=new WeakMap,fr=new WeakMap,pr=new WeakMap,h(tl,"CellRowIndicator");let io=tl;customElements.get("cell-row-indicator")||customElements.define("cell-row-indicator",io);const el=class el extends HTMLElement{constructor(){super();d(this,ut);d(this,Y);d(this,Ds,h(e=>{e.preventDefault(),e.stopPropagation(),this.classList.contains("expand")?this.collapse():this.expand()},"#onClick"));E(this,"expand",h(()=>{var n;if(!((n=t(this,ut))!=null&&n.colResizer)||!t(this,Y))return;const e=parseInt(t(this,Y).dataset.col,10),s=t(this,Y).colSpan||1;this.classList.remove("collapsed"),this.classList.add("expand"),t(this,Y).setAttribute("collapsed","false"),t(this,Y).style.color="";const i=parseInt(t(this,Y).dataset.expandWidth,10)||100;if(s===1)t(this,ut).colResizer.setColumnWidth(e,i);else{const o=Math.max(30,Math.floor(i/s));for(let l=0;l<s;l++)t(this,ut).colResizer.setColumnWidth(e+l,o)}requestAnimationFrame(()=>{typeof t(this,ut).refreshLayout=="function"&&t(this,ut).refreshLayout()})},"expand"));E(this,"collapse",h((e=!1)=>{var n;if(!((n=t(this,ut))!=null&&n.colResizer)||!t(this,Y))return;const s=parseInt(t(this,Y).dataset.col,10),i=t(this,Y).colSpan||1;if(this.classList.contains("expand")){const o=t(this,ut).querySelector(`colgroup col[data-col="${s}"]`),l=o?parseInt(o.getAttribute("width"),10):0;l>mt&&(t(this,Y).dataset.expandWidth=String(l*i))}if(this.classList.remove("expand"),this.classList.add("collapsed"),t(this,Y).setAttribute("collapsed","true"),t(this,Y).style.color="transparent",i===1)t(this,ut).colResizer.setColumnWidth(s,mt);else{const o=Math.max(10,Math.floor(mt/i));for(let l=0;l<i;l++)t(this,ut).colResizer.setColumnWidth(s+l,o)}requestAnimationFrame(()=>{typeof t(this,ut).refreshLayout=="function"&&t(this,ut).refreshLayout()})},"collapse"))}connectedCallback(){var s;g(this,Y,this.closest("th, td")),g(this,ut,this.closest("nine-table-sheet")),t(this,Y)&&(t(this,Y).style.position="relative"),this.getAttribute("collapsed")==="true"||((s=t(this,Y))==null?void 0:s.getAttribute("collapsed"))==="true"?requestAnimationFrame(()=>{this.collapse(!0)}):(this.classList.remove("collapsed"),this.classList.add("expand")),this.removeEventListener("click",t(this,Ds)),this.addEventListener("click",t(this,Ds))}disconnectedCallback(){this.removeEventListener("click",t(this,Ds))}};ut=new WeakMap,Y=new WeakMap,Ds=new WeakMap,h(el,"ColExpand");let no=el;customElements.get("nine-table-col-expand")||customElements.define("nine-table-col-expand",no);const sl=class sl extends HTMLElement{constructor(){super(...arguments);d(this,j);d(this,Q);d(this,vt);d(this,gr,h(e=>{const s=e.composedPath?e.composedPath():[],i=s.find(o=>o.tagName==="TH"||o.tagName==="TD");if(!i)return;const n=s.find(o=>o.tagName==="TABLE")||i.closest("table");e.preventDefault(),e.stopPropagation(),this.openMenu(e.clientX,e.clientY,i,n)},"#onContextMenu"))}connectedCallback(){var s,i;const e=this.getRootNode();g(this,Q,e instanceof ShadowRoot?e.host:this.closest("nine-table")||e.host),t(this,Q)||g(this,Q,((s=this.parentElement)==null?void 0:s.closest("nine-table"))||((i=this.assignedSlot)==null?void 0:i.closest("nine-table"))),t(this,Q)}openMenu(e,s,i,n){const o=t(this,Q).shadowRoot||t(this,Q);t(this,vt)||(g(this,vt,document.createElement("nine-table-menu-panel")),o.appendChild(t(this,vt)));const l=!!i.closest("thead"),a=A(this,j,Ql).call(this,n,l,i);t(this,vt).render(a,u=>A(this,j,ea).call(this,u,i,n));const c=A(this,j,wr).call(this,i);A(this,j,ta).call(this,c),t(this,vt).openAt(e,s)}disconnectedCallback(){var e;(e=t(this,Q))==null||e.removeEventListener("contextmenu",t(this,gr))}};Q=new WeakMap,vt=new WeakMap,gr=new WeakMap,j=new WeakSet,wr=h(function(e){return(e==null?void 0:e.closest("nine-table-sheet"))||t(this,Q).activeSheet||t(this,Q)},"#getTargetSheet"),ml=h(function(e){const s=A(this,j,wr).call(this,e);return s?(s.colFix||(s.colFix=new Vi(s)),s.colFix):null},"#getFixManager"),Jl=h(function(e,s){const i=[],n=s==null?void 0:s.id;return Array.from(e.querySelectorAll(":scope > ul")).forEach(l=>{const a=l.getAttribute("target-table");if(!a||n&&a===n){const c=A(this,j,yl).call(this,l);i.push(...c)}}),i},"#parseCustomMenuItems"),yl=h(function(e){const s=[];return Array.from(e.children).forEach(i=>{const n=i.tagName.toLowerCase();if(n==="hr"||i.classList.contains("separator")){s.push({type:"separator"});return}if(n==="li"){let o="";const l=i.querySelector(":scope > span");l?o=l.textContent.trim():o=Array.from(i.childNodes).filter(u=>u.nodeType===Node.TEXT_NODE).map(u=>u.textContent.trim()).join("");const a=i.querySelector(":scope > ul"),c={menuId:i.id||o,name:o,className:i.className||"",disabled:i.hasAttribute("disabled")||i.getAttribute("disabled")==="true",isCustom:!0};a&&(c.items=A(this,j,yl).call(this,a)),s.push(c)}}),s},"#traverseUl"),Ql=h(function(e,s,i){const n=this.getAttribute("use-default-menu")!=="false";let o=[];const l=A(this,j,Jl).call(this,this,e);l.length>0&&o.push(...l);const a=A(this,j,ml).call(this,i),c=(a==null?void 0:a.getFixState(i,e))??"none",u=s&&((a==null?void 0:a.canFixColumn(i,e))??!1);let p=null;c==="left"||c==="right"?p={menuId:"unfix-column",name:"Unfix Column",className:"ng-menu-unfix-col",disabled:!s}:p={menuId:"fix-column",name:"Fix Column",className:"ng-menu-fix-col",disabled:!u},n&&o.push({type:"separator"},{menuId:"sort",name:"Sort",className:"ng-menu-sort",disabled:!s},p,{type:"separator"},{menuId:"filtering",name:"Filtering",className:"ng-menu-filtering"},{menuId:"maximize",name:"Maximize",className:"maximize"},{menuId:"export",name:"Export",className:"export",items:[{menuId:"export-excel",name:"Excel",className:"export-excel"},{menuId:"export-pdf",name:"PDF",className:"export-pdf",disabled:!0}]},{menuId:"properties",name:"Options",className:"options",items:[{menuId:"show-title-bar",name:"Title Bar Show/Hide",className:"show-title-bar"},{menuId:"show-status-bar",name:"Status Bar Show/Hide",className:"show-status-bar"},{menuId:"auto-fit-col",name:"Auto Fit Columns",className:"auto-fit-col"}]});const f=[];return o.forEach(b=>{b.type==="separator"&&(f.length===0||f[f.length-1].type==="separator")||f.push(b)}),f.length>0&&f[f.length-1].type==="separator"&&f.pop(),f},"#buildMenuItems"),ta=h(function(e){var o,l;if(!t(this,vt)||!e)return;const s=((l=(o=e.filtering)==null?void 0:o.isFiltering)==null?void 0:l.call(o))||!1;t(this,vt).toggleItemState("filtering","on",s);const i=t(this,Q).getAttribute("auto-fit-col")==="true";t(this,vt).toggleItemState("auto-fit-col","on",i);const n=t(this,Q).getAttribute("show-title-bar")==="true";t(this,vt).toggleItemState("show-title-bar","on",n)},"#syncMenuStates"),ea=h(function(e,s,i){var c,u,p;const n=e.menuId,o=new CustomEvent("menu-click",{detail:{menuId:n,targetCell:s,targetTable:i,originalEvent:e},bubbles:!0,composed:!0});this.dispatchEvent(o);const l=parseInt(s.dataset.col,10),a=A(this,j,wr).call(this,s);switch(n){case"fix-column":case"unfix-column":const f=A(this,j,ml).call(this,s);f==null||f.executeFixToggle(n,s);break;case"sort":isNaN(l)||(u=(c=a.sorting)==null?void 0:c.handleSortFromMenu)==null||u.call(c,l,s);break;case"filtering":(p=a==null?void 0:a.filtering)==null||p.toggle();break;case"auto-fit-col":t(this,Q).setAttribute("auto-fit-col",t(this,Q).getAttribute("auto-fit-col")==="true"?"false":"true");break;case"show-title-bar":t(this,Q).setAttribute("show-title-bar",t(this,Q).getAttribute("show-title-bar")==="true"?"false":"true");break}t(this,vt).close()},"#handleMenuClick"),h(sl,"ContextMenu");let ro=sl;customElements.get("nine-table-menu")||customElements.define("nine-table-menu",ro);const il=class il extends HTMLElement{constructor(){super();d(this,as);d(this,Wi);d(this,Zt,null)}connectedCallback(){this.style.position="fixed",this.style.display="none",this.style.zIndex="99999",this.innerHTML=`
|
|
1645
|
+
<style>
|
|
1646
|
+
|
|
1647
|
+
nine-table-menu-panel .menu-wrapper {
|
|
1648
|
+
background: #ffffff;
|
|
1649
|
+
border: 1px solid #d1d5db;
|
|
1650
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
1651
|
+
border-radius: 4px;
|
|
1652
|
+
padding: 4px 0;
|
|
1653
|
+
min-width: 150px;
|
|
1654
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
1655
|
+
font-size: 12px;
|
|
1656
|
+
}
|
|
1657
|
+
nine-table-menu-panel ul {
|
|
1658
|
+
list-style: none;
|
|
1659
|
+
margin: 0;
|
|
1660
|
+
padding: 0;
|
|
1661
|
+
}
|
|
1662
|
+
nine-table-menu-panel li {
|
|
1663
|
+
position: relative;
|
|
1664
|
+
padding: 6px 16px;
|
|
1665
|
+
cursor: pointer;
|
|
1666
|
+
color: #374151;
|
|
1667
|
+
display: flex;
|
|
1668
|
+
align-items: center;
|
|
1669
|
+
justify-content: space-between;
|
|
1670
|
+
box-sizing: border-box;
|
|
1671
|
+
}
|
|
1672
|
+
nine-table-menu-panel li:hover {
|
|
1673
|
+
background-color: #f3f4f6;
|
|
1674
|
+
color: #111827;
|
|
1675
|
+
}
|
|
1676
|
+
nine-table-menu-panel li.on::before {
|
|
1677
|
+
content: 'โ';
|
|
1678
|
+
position: absolute;
|
|
1679
|
+
left: 4px;
|
|
1680
|
+
font-weight: bold;
|
|
1681
|
+
}
|
|
1682
|
+
nine-table-menu-panel li.disabled {
|
|
1683
|
+
opacity: 0.5;
|
|
1684
|
+
cursor: not-allowed;
|
|
1685
|
+
background: transparent !important;
|
|
1686
|
+
}
|
|
1687
|
+
nine-table-menu-panel li.ng-menu-separator {
|
|
1688
|
+
height: 1px;
|
|
1689
|
+
background: #e5e7eb;
|
|
1690
|
+
margin: 4px 0;
|
|
1691
|
+
padding: 0;
|
|
1692
|
+
cursor: default;
|
|
1693
|
+
}
|
|
1694
|
+
nine-table-menu-panel li.submenu::after {
|
|
1695
|
+
content: 'โถ';
|
|
1696
|
+
font-size: 9px;
|
|
1697
|
+
margin-left: 8px;
|
|
1698
|
+
color: #9ca3af;
|
|
1699
|
+
}
|
|
1700
|
+
nine-table-menu-panel .ng-menu-sublist {
|
|
1701
|
+
display: none;
|
|
1702
|
+
position: absolute;
|
|
1703
|
+
top: -4px;
|
|
1704
|
+
left: 100%;
|
|
1705
|
+
background: #ffffff;
|
|
1706
|
+
border: 1px solid #d1d5db;
|
|
1707
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
1708
|
+
border-radius: 4px;
|
|
1709
|
+
padding: 4px 0;
|
|
1710
|
+
min-width: 140px;
|
|
1711
|
+
}
|
|
1712
|
+
nine-table-menu-panel li.submenu:hover > .ng-menu-sublist {
|
|
1713
|
+
display: block;
|
|
1714
|
+
}
|
|
1715
|
+
</style>
|
|
1716
|
+
<div class="menu-wrapper">
|
|
1717
|
+
<ul class="menu-container"></ul>
|
|
1718
|
+
</div>
|
|
1719
|
+
`}render(e,s){g(this,Wi,s);const i=this.querySelector(".menu-container");i&&(i.innerHTML="",A(this,as,xl).call(this,i,e),A(this,as,sa).call(this))}openAt(e,s,i=null){if(this.style.display="block",i){const n=i.getBoundingClientRect(),o=n.right;requestAnimationFrame(()=>{const l=this.querySelector(".menu-wrapper");if(!l)return;const a=l.getBoundingClientRect().width;let c=o-a;c<0&&(c=n.left);const u=l.getBoundingClientRect().height;let p=s;s+u>window.innerHeight&&(p=s-u),this.style.left=`${c}px`,this.style.top=`${p}px`})}else this.style.left=`${e}px`,this.style.top=`${s}px`,requestAnimationFrame(()=>{const n=this.querySelector(".menu-wrapper");if(!n)return;const o=n.getBoundingClientRect();e+o.width>window.innerWidth&&(this.style.left=`${e-o.width}px`),s+o.height>window.innerHeight&&(this.style.top=`${s-o.height}px`)});t(this,Zt)&&window.removeEventListener("pointerdown",t(this,Zt)),g(this,Zt,n=>{!(n.composedPath?n.composedPath():[]).includes(this)&&!this.contains(n.target)&&this.close()}),setTimeout(()=>{window.addEventListener("pointerdown",t(this,Zt))},0)}close(){this.style.display="none",t(this,Zt)&&(window.removeEventListener("pointerdown",t(this,Zt)),g(this,Zt,null))}toggleItemState(e,s,i){const n=this.querySelector(`li[menu-id="${e}"]`);n&&(i?n.classList.add(s):n.classList.remove(s))}disconnectedCallback(){this.close()}};Wi=new WeakMap,Zt=new WeakMap,as=new WeakSet,xl=h(function(e,s){s.forEach(i=>{if(i.type==="separator"){const l=document.createElement("li");l.className="ng-menu-separator",e.appendChild(l);return}const n=document.createElement("li");n.setAttribute("menu-id",i.menuId),n.className=`${i.className||""} ${i.items?"submenu":""} ${i.disabled?"disabled":""}`.trim();const o=document.createElement("span");if(o.textContent=i.name,n.appendChild(o),i.items&&i.items.length>0){const l=document.createElement("ul");l.className="ng-menu-sublist",A(this,as,xl).call(this,l,i.items),n.appendChild(l)}e.appendChild(n)})},"#appendItems"),sa=h(function(){this.querySelectorAll("li[menu-id]").forEach(e=>{e.addEventListener("click",s=>{var n;if(s.stopPropagation(),e.classList.contains("disabled"))return;const i=e.getAttribute("menu-id");(n=t(this,Wi))==null||n.call(this,{menuId:i,target:e}),this.close()})})},"#bindClickEvents"),h(il,"MenuPanel");let oo=il;customElements.get("nine-table-menu-panel")||customElements.define("nine-table-menu-panel",oo),T.NINE_TABLE=Dt,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
460
1720
|
//# sourceMappingURL=nine-table.umd.js.map
|