@guiexpert/solid-table 1.1.62 → 1.1.64

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.
Files changed (3) hide show
  1. package/index.cjs +4 -4
  2. package/index.js +51 -40
  3. package/package.json +2 -2
package/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=(l,e)=>l===e,se=Symbol("solid-proxy"),Fe=typeof Proxy=="function",ge={equals:ke};let ye=we;const L=1,G=2,xe={owned:null,cleanups:null,context:null,owner:null};var R=null;let ee=null,Ie=null,w=null,M=null,O=null,q=0;function Oe(l,e){const t=w,s=R,o=l.length===0,i=e===void 0?s:e,r=o?xe:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?l:()=>l(()=>Z(()=>H(r)));R=r,w=null;try{return V(a,!0)}finally{w=t,R=s}}function oe(l,e,t){const s=le(l,e,!1,L);$(s)}function Le(l,e,t){ye=_e;const s=le(l,e,!1,L);s.user=!0,O?O.push(s):$(s)}function Be(l,e,t){t=t?Object.assign({},ge,t):ge;const s=le(l,e,!0,0);return s.observers=null,s.observerSlots=null,s.comparator=t.equals||void 0,$(s),We.bind(s)}function Z(l){if(w===null)return l();const e=w;w=null;try{return l()}finally{w=e}}function Pe(l){Le(()=>Z(l))}function We(){if(this.sources&&this.state)if(this.state===L)$(this);else{const l=M;M=null,V(()=>U(this),!1),M=l}if(w){const l=this.observers?this.observers.length:0;w.sources?(w.sources.push(this),w.sourceSlots.push(l)):(w.sources=[this],w.sourceSlots=[l]),this.observers?(this.observers.push(w),this.observerSlots.push(w.sources.length-1)):(this.observers=[w],this.observerSlots=[w.sources.length-1])}return this.value}function He(l,e,t){let s=l.value;return(!l.comparator||!l.comparator(s,e))&&(l.value=e,l.observers&&l.observers.length&&V(()=>{for(let o=0;o<l.observers.length;o+=1){const i=l.observers[o],r=ee&&ee.running;r&&ee.disposed.has(i),(r?!i.tState:!i.state)&&(i.pure?M.push(i):O.push(i),i.observers&&ve(i)),r||(i.state=L)}if(M.length>1e6)throw M=[],new Error},!1)),e}function $(l){if(!l.fn)return;H(l);const e=q;$e(l,l.value,e)}function $e(l,e,t){let s;const o=R,i=w;w=R=l;try{s=l.fn(e)}catch(r){return l.pure&&(l.state=L,l.owned&&l.owned.forEach(H),l.owned=null),l.updatedAt=t+1,Ce(r)}finally{w=i,R=o}(!l.updatedAt||l.updatedAt<=t)&&(l.updatedAt!=null&&"observers"in l?He(l,s):l.value=s,l.updatedAt=t)}function le(l,e,t,s=L,o){const i={fn:l,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:R,context:R?R.context:null,pure:t};return R===null||R!==xe&&(R.owned?R.owned.push(i):R.owned=[i]),i}function z(l){if(l.state===0)return;if(l.state===G)return U(l);if(l.suspense&&Z(l.suspense.inFallback))return l.suspense.effects.push(l);const e=[l];for(;(l=l.owner)&&(!l.updatedAt||l.updatedAt<q);)l.state&&e.push(l);for(let t=e.length-1;t>=0;t--)if(l=e[t],l.state===L)$(l);else if(l.state===G){const s=M;M=null,V(()=>U(l,e[0]),!1),M=s}}function V(l,e){if(M)return l();let t=!1;e||(M=[]),O?t=!0:O=[],q++;try{const s=l();return Ve(t),s}catch(s){t||(O=null),M=null,Ce(s)}}function Ve(l){if(M&&(we(M),M=null),l)return;const e=O;O=null,e.length&&V(()=>ye(e),!1)}function we(l){for(let e=0;e<l.length;e++)z(l[e])}function _e(l){let e,t=0;for(e=0;e<l.length;e++){const s=l[e];s.user?l[t++]=s:z(s)}for(e=0;e<t;e++)z(l[e])}function U(l,e){l.state=0;for(let t=0;t<l.sources.length;t+=1){const s=l.sources[t];if(s.sources){const o=s.state;o===L?s!==e&&(!s.updatedAt||s.updatedAt<q)&&z(s):o===G&&U(s,e)}}}function ve(l){for(let e=0;e<l.observers.length;e+=1){const t=l.observers[e];t.state||(t.state=G,t.pure?M.push(t):O.push(t),t.observers&&ve(t))}}function H(l){let e;if(l.sources)for(;l.sources.length;){const t=l.sources.pop(),s=l.sourceSlots.pop(),o=t.observers;if(o&&o.length){const i=o.pop(),r=t.observerSlots.pop();s<o.length&&(i.sourceSlots[r]=s,o[s]=i,t.observerSlots[s]=r)}}if(l.tOwned){for(e=l.tOwned.length-1;e>=0;e--)H(l.tOwned[e]);delete l.tOwned}if(l.owned){for(e=l.owned.length-1;e>=0;e--)H(l.owned[e]);l.owned=null}if(l.cleanups){for(e=l.cleanups.length-1;e>=0;e--)l.cleanups[e]();l.cleanups=null}l.state=0}function Ne(l){return l instanceof Error?l:new Error(typeof l=="string"?l:"Unknown error",{cause:l})}function Ce(l,e=R){throw Ne(l)}function N(){return!0}const Ge={get(l,e,t){return e===se?t:l.get(e)},has(l,e){return e===se?!0:l.has(e)},set:N,deleteProperty:N,getOwnPropertyDescriptor(l,e){return{configurable:!0,enumerable:!0,get(){return l.get(e)},set:N,deleteProperty:N}},ownKeys(l){return l.keys()}};function te(l){return(l=typeof l=="function"?l():l)?l:{}}function ze(){for(let l=0,e=this.length;l<e;++l){const t=this[l]();if(t!==void 0)return t}}function Ee(...l){let e=!1;for(let r=0;r<l.length;r++){const a=l[r];e=e||!!a&&se in a,l[r]=typeof a=="function"?(e=!0,Be(a)):a}if(Fe&&e)return new Proxy({get(r){for(let a=l.length-1;a>=0;a--){const n=te(l[a])[r];if(n!==void 0)return n}},has(r){for(let a=l.length-1;a>=0;a--)if(r in te(l[a]))return!0;return!1},keys(){const r=[];for(let a=0;a<l.length;a++)r.push(...Object.keys(te(l[a])));return[...new Set(r)]}},Ge);const t={},s=Object.create(null);for(let r=l.length-1;r>=0;r--){const a=l[r];if(!a)continue;const n=Object.getOwnPropertyNames(a);for(let d=n.length-1;d>=0;d--){const c=n[d];if(c==="__proto__"||c==="constructor")continue;const h=Object.getOwnPropertyDescriptor(a,c);if(!s[c])s[c]=h.get?{enumerable:!0,configurable:!0,get:ze.bind(t[c]=[h.get.bind(a)])}:h.value!==void 0?h:void 0;else{const p=t[c];p&&(h.get?p.push(h.get.bind(a)):h.value!==void 0&&p.push(()=>h.value))}}}const o={},i=Object.keys(s);for(let r=i.length-1;r>=0;r--){const a=i[r],n=s[a];n&&n.get?Object.defineProperty(o,a,n):o[a]=n?n.value:void 0}return o}function Ue(l,e,t){let s=t.length,o=e.length,i=s,r=0,a=0,n=e[o-1].nextSibling,d=null;for(;r<o||a<i;){if(e[r]===t[a]){r++,a++;continue}for(;e[o-1]===t[i-1];)o--,i--;if(o===r){const c=i<s?a?t[a-1].nextSibling:t[i-a]:n;for(;a<i;)l.insertBefore(t[a++],c)}else if(i===a)for(;r<o;)(!d||!d.has(e[r]))&&e[r].remove(),r++;else if(e[r]===t[i-1]&&t[a]===e[o-1]){const c=e[--o].nextSibling;l.insertBefore(t[a++],e[r++].nextSibling),l.insertBefore(t[--i],c),e[o]=t[i]}else{if(!d){d=new Map;let h=a;for(;h<i;)d.set(t[h],h++)}const c=d.get(e[r]);if(c!=null)if(a<c&&c<i){let h=r,p=1,u;for(;++h<o&&h<i&&!((u=d.get(e[h]))==null||u!==c+p);)p++;if(p>c-a){const g=e[r];for(;a<c;)l.insertBefore(t[a++],g)}else l.replaceChild(t[a++],e[r++])}else r++;else e[r++].remove()}}}function je(l,e,t,s={}){let o;return Oe(i=>{o=i,e===document?l():Ye(e,l(),e.firstChild?null:void 0,t)},s.owner),()=>{o(),e.textContent=""}}function Xe(l,e,t){let s;const o=()=>{const r=document.createElement("template");return r.innerHTML=l,r.content.firstChild},i=()=>(s||(s=o())).cloneNode(!0);return i.cloneNode=i,i}function Ke(l,e,t){return Z(()=>l(e,t))}function Ye(l,e,t,s){if(t!==void 0&&!s&&(s=[]),typeof e!="function")return j(l,e,s,t);oe(o=>j(l,e(),o,t),s)}function j(l,e,t,s,o){for(;typeof t=="function";)t=t();if(e===t)return t;const i=typeof e,r=s!==void 0;if(l=r&&t[0]&&t[0].parentNode||l,i==="string"||i==="number"){if(i==="number"&&(e=e.toString(),e===t))return t;if(r){let a=t[0];a&&a.nodeType===3?a.data!==e&&(a.data=e):a=document.createTextNode(e),t=P(l,t,s,a)}else t!==""&&typeof t=="string"?t=l.firstChild.data=e:t=l.textContent=e}else if(e==null||i==="boolean")t=P(l,t,s);else{if(i==="function")return oe(()=>{let a=e();for(;typeof a=="function";)a=a();t=j(l,a,t,s)}),()=>t;if(Array.isArray(e)){const a=[],n=t&&Array.isArray(t);if(ie(a,e,t,o))return oe(()=>t=j(l,a,t,s,!0)),()=>t;if(a.length===0){if(t=P(l,t,s),r)return t}else n?t.length===0?fe(l,a,s):Ue(l,t,a):(t&&P(l),fe(l,a));t=a}else if(e.nodeType){if(Array.isArray(t)){if(r)return t=P(l,t,s,e);P(l,t,null,e)}else t==null||t===""||!l.firstChild?l.appendChild(e):l.replaceChild(e,l.firstChild);t=e}}return t}function ie(l,e,t,s){let o=!1;for(let i=0,r=e.length;i<r;i++){let a=e[i],n=t&&t[l.length],d;if(!(a==null||a===!0||a===!1))if((d=typeof a)=="object"&&a.nodeType)l.push(a);else if(Array.isArray(a))o=ie(l,a,n)||o;else if(d==="function")if(s){for(;typeof a=="function";)a=a();o=ie(l,Array.isArray(a)?a:[a],Array.isArray(n)?n:[n])||o}else l.push(a),o=!0;else{const c=String(a);n&&n.nodeType===3&&n.data===c?l.push(n):l.push(document.createTextNode(c))}}return o}function fe(l,e,t=null){for(let s=0,o=e.length;s<o;s++)l.insertBefore(e[s],t)}function P(l,e,t,s){if(t===void 0)return l.textContent="";const o=s||document.createTextNode("");if(e.length){let i=!1;for(let r=e.length-1;r>=0;r--){const a=e[r];if(o!==a){const n=a.parentNode===l;!i&&!r?n?l.replaceChild(o,a):l.insertBefore(o,t):n&&a.remove()}else i=!0}}else l.insertBefore(o,t);return[o]}class Je{constructor(e){this.code=e}render(e,t,s,o,i,r,a){const n=Ee({rowIndex:t,columnIndex:s,areaIdent:o,areaModel:i,cellValue:r});je(()=>this.code(n),e)}}const qe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Ze(l,e=500){let t=null;return function(...s){t&&window.clearTimeout(t),t=window.setTimeout(()=>{l.apply(this,s),t=null},e)}}class B{constructor(){this.alreadySet=!1}static getInstance(){return B.instance||(B.instance=new B),B.instance}setLicenseKey(e){if(e&&!this.alreadySet){const t=document.createElement("meta");t.content="license="+e,t.name="guiexperttable",document.getElementsByTagName("head")[0].appendChild(t),this.alreadySet=!0}}}function X(l){return l&&l.type==="TreeRow"}function re(l){return l&&l.type==="AreaModelTree"}class ae{constructor(e=-1,t=-1,s=-1,o=-1,i,r,a,n=0,d=0,c=0,h=""){this.rowIndex=e,this.rowTop=t,this.columnIndex=s,this.columnLeft=o,this.areaIdent=i,this.sideIdent=r,this.originalEvent=a,this.clickCount=n,this.draggingX=d,this.draggingY=c,this.action=h}clone(){return new ae(this.rowIndex,this.rowTop,this.columnIndex,this.columnLeft,this.areaIdent,this.sideIdent,this.originalEvent,this.clickCount,this.draggingX,this.draggingY,this.action)}}class I{constructor(e=">",t="",s=[]){this.content=e,this.style=t,this.classes=s}}class Ae{constructor(e=new I(">","transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",["gt-table-tree-arrow-expanded"]),t=new I(">","",["ge-table-tree-arrow-collapsed"]),s=new I(">","color:transparent;",["gt-table-tree-arrow-hidden"]),o=new I("↕","",["gt-table-tree-arrow-expanded-all"])){this.arrowExpanded=e,this.arrowCollapsed=t,this.arrowPlaceholder=s,this.arrowExpandCollapseAll=o}}class Me{constructor(e=new I("↑","",["ge-header-sorted-asc"]),t=new I("↓","",["ge-header-sorted-desc"]),s=new I("↑","color:transparent;",[])){this.iconAsc=e,this.iconDesc=t,this.iconPlaceholder=s}}class Qe{constructor(e){this.domService=e}setStyle(e,t,s){return this.domService.setStyle(e,t,s),e}applyStyle(e,t){for(const s in t)this.domService.setStyle(e,s,t[s]);return e}applyDisplayNoneStyle(e){return this.domService.setStyle(e,"display","none"),e}applyDisplayBlockStyle(e){return this.domService.setStyle(e,"display","block"),e}applyStyleInPx(e,t){return Object.entries(t).forEach(([s,o])=>this.domService.setStyle(e,s,o+"px")),e}applyStylePosistionRelative(e){return this.domService.setStyle(e,"position","relative"),this.domService.setStyle(e,"overflow","clip"),e}applyStylePosistionAbsolute(e){return this.domService.setStyle(e,"position","absolute"),e}applyStyleFullSize(e){return this.domService.setStyle(e,"width","100%"),this.domService.setStyle(e,"height","100%"),e}applyStyleOverflowAuto(e="auto",t="auto",s){return this.domService.setStyle(s,"overflow-x",e),this.domService.setStyle(s,"overflow-y",t),s}applyStyleNoPadding(e){return this.domService.setStyle(e,"padding","0"),this.domService.setStyle(e,"margin","0"),this.domService.setStyle(e,"border","0"),e}appendRelativeChildDiv(e){const t=this.applyStylePosistionRelative(this.applyStyleFullSize(this.applyStyleNoPadding(this.domService.createElement("div"))));return this.domService.appendChild(e,t),this.applyStylePosistionAbsolute(e),{parent:e,child:t,cache:{}}}appendText(e,t){const s=this.domService.createText(t);return this.domService.appendChild(e,s),s}addClass(e,t){return e.includes(" ")?e.split(" ").forEach(s=>this.domService.addClass(t,s)):this.domService.addClass(t,e),t}removeClass(e,t){return e.includes(" ")?e.split(" ").forEach(s=>this.domService.removeClass(t,s)):this.domService.removeClass(t,e),t}addClasses(e,t){if(e)for(const s of e)this.domService.addClass(t,s);return t}setAttribute(e,t,s){return t&&s&&this.domService.setAttribute(e,t,s),e}createAreaDivWithClass(e,t,s,o){const i=this.domService.createElement("div");return this.addClass(e,i),this.domService.setAttribute(i,"data-area",s),this.domService.setAttribute(i,"data-side",o),this.domService.appendChild(t,i),i}createDivWithClass(e,t){const s=this.domService.createElement("div");return this.addClass(e,s),this.domService.appendChild(t,s),s}addRowDiv(e,t,s=-1,o,i,r=""){const a=t.index??-1,n=this.getDivOrCreateDiv(a,e);if(this.domService.addClass(n,"ge-table-row-div"),this.domService.addClass(n,`ge-table-row-div-${t.index}`),o==="body"&&i==="center"){const d=((t==null?void 0:t.index)??0)%2===0?"even":"odd";this.domService.addClass(n,`ge-table-row-${d}`)}if(this.domService.setStyle(n,"display","clip"),this.domService.setStyle(n,"position","absolute"),this.domService.setStyle(n,"left",`${t.left}px`),this.domService.setStyle(n,"top",`${t.top}px`),this.domService.setStyle(n,"width",`${t.width}px`),this.domService.setStyle(n,"height",`${t.height}px`),this.domService.setAttribute(n,"data-row-index",`${s}`),this.domService.setAttribute(n,"data-area",`${o}`),r){const d=this.domService.createText(r);this.domService.appendChild(n,d)}return this.domService.appendChild(e.child,n),n}addColumnDiv(e){const{parent:t,geo:s,rowIndex:o=-1,columnIndex:i=-1,areaIdent:r,sideIdent:a,text:n="",treeArrow:d,tableOptions:c,checkedType:h=void 0,sortState:p}=e,u=c==null?void 0:c.treeOptions,g=c==null?void 0:c.showCheckboxWihoutExtraColumn,b=this.domService.createElement("div");this.domService.addClass(b,"ge-table-col-div"),g&&this.domService.addClass(b,"ge-with-checkbox"),this.domService.addClass(b,`ge-table-col-div-${s.index}`),this.domService.setAttribute(b,"data-col-index",`${s.index}`),this.domService.setAttribute(b,"data-row-index",`${o}`),this.domService.setAttribute(b,"data-area",`${r}`);const f=((s==null?void 0:s.index)??0)%2===0?"even":"odd";if(r==="body"&&a==="center"&&this.domService.addClass(b,`ge-table-column-${f}`),this.domService.setStyle(b,"display","clip"),this.domService.setStyle(b,"position","absolute"),this.domService.setStyle(b,"left",`${s.left}px`),this.domService.setStyle(b,"top",`${s.top}px`),this.domService.setStyle(b,"width",`${s.width}px`),this.domService.setStyle(b,"height",`${s.height}px`),d&&d!=="none"&&(this.domService.addClass(b,"ge-table-col-tree"),this.addArrowDiv(b,d,u,o,i,r)),g&&i===0&&h&&this.addCheckboxToDiv(b,h,r,o),n){const m=d!=="none"&&i===0;this.addLabelDiv(b,n,m,o,i,r)}return p&&this.addSortedIcon(b,p,c==null?void 0:c.sortedOptions,i),this.domService.appendChild(t,b),b}addCheckboxToDiv(e,t,s,o){const i=this.domService.createElement("div"),r=t==="full"?"checked":"";return i.innerHTML=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=(l,e)=>l===e,se=Symbol("solid-proxy"),Fe=typeof Proxy=="function",ge={equals:ke};let ye=we;const L=1,G=2,xe={owned:null,cleanups:null,context:null,owner:null};var R=null;let ee=null,Ie=null,w=null,M=null,O=null,q=0;function Oe(l,e){const t=w,s=R,o=l.length===0,i=e===void 0?s:e,r=o?xe:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?l:()=>l(()=>Z(()=>H(r)));R=r,w=null;try{return V(a,!0)}finally{w=t,R=s}}function oe(l,e,t){const s=le(l,e,!1,L);$(s)}function Le(l,e,t){ye=_e;const s=le(l,e,!1,L);s.user=!0,O?O.push(s):$(s)}function Be(l,e,t){t=t?Object.assign({},ge,t):ge;const s=le(l,e,!0,0);return s.observers=null,s.observerSlots=null,s.comparator=t.equals||void 0,$(s),We.bind(s)}function Z(l){if(w===null)return l();const e=w;w=null;try{return l()}finally{w=e}}function Pe(l){Le(()=>Z(l))}function We(){if(this.sources&&this.state)if(this.state===L)$(this);else{const l=M;M=null,V(()=>U(this),!1),M=l}if(w){const l=this.observers?this.observers.length:0;w.sources?(w.sources.push(this),w.sourceSlots.push(l)):(w.sources=[this],w.sourceSlots=[l]),this.observers?(this.observers.push(w),this.observerSlots.push(w.sources.length-1)):(this.observers=[w],this.observerSlots=[w.sources.length-1])}return this.value}function He(l,e,t){let s=l.value;return(!l.comparator||!l.comparator(s,e))&&(l.value=e,l.observers&&l.observers.length&&V(()=>{for(let o=0;o<l.observers.length;o+=1){const i=l.observers[o],r=ee&&ee.running;r&&ee.disposed.has(i),(r?!i.tState:!i.state)&&(i.pure?M.push(i):O.push(i),i.observers&&Ce(i)),r||(i.state=L)}if(M.length>1e6)throw M=[],new Error},!1)),e}function $(l){if(!l.fn)return;H(l);const e=q;$e(l,l.value,e)}function $e(l,e,t){let s;const o=R,i=w;w=R=l;try{s=l.fn(e)}catch(r){return l.pure&&(l.state=L,l.owned&&l.owned.forEach(H),l.owned=null),l.updatedAt=t+1,ve(r)}finally{w=i,R=o}(!l.updatedAt||l.updatedAt<=t)&&(l.updatedAt!=null&&"observers"in l?He(l,s):l.value=s,l.updatedAt=t)}function le(l,e,t,s=L,o){const i={fn:l,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:R,context:R?R.context:null,pure:t};return R===null||R!==xe&&(R.owned?R.owned.push(i):R.owned=[i]),i}function z(l){if(l.state===0)return;if(l.state===G)return U(l);if(l.suspense&&Z(l.suspense.inFallback))return l.suspense.effects.push(l);const e=[l];for(;(l=l.owner)&&(!l.updatedAt||l.updatedAt<q);)l.state&&e.push(l);for(let t=e.length-1;t>=0;t--)if(l=e[t],l.state===L)$(l);else if(l.state===G){const s=M;M=null,V(()=>U(l,e[0]),!1),M=s}}function V(l,e){if(M)return l();let t=!1;e||(M=[]),O?t=!0:O=[],q++;try{const s=l();return Ve(t),s}catch(s){t||(O=null),M=null,ve(s)}}function Ve(l){if(M&&(we(M),M=null),l)return;const e=O;O=null,e.length&&V(()=>ye(e),!1)}function we(l){for(let e=0;e<l.length;e++)z(l[e])}function _e(l){let e,t=0;for(e=0;e<l.length;e++){const s=l[e];s.user?l[t++]=s:z(s)}for(e=0;e<t;e++)z(l[e])}function U(l,e){l.state=0;for(let t=0;t<l.sources.length;t+=1){const s=l.sources[t];if(s.sources){const o=s.state;o===L?s!==e&&(!s.updatedAt||s.updatedAt<q)&&z(s):o===G&&U(s,e)}}}function Ce(l){for(let e=0;e<l.observers.length;e+=1){const t=l.observers[e];t.state||(t.state=G,t.pure?M.push(t):O.push(t),t.observers&&Ce(t))}}function H(l){let e;if(l.sources)for(;l.sources.length;){const t=l.sources.pop(),s=l.sourceSlots.pop(),o=t.observers;if(o&&o.length){const i=o.pop(),r=t.observerSlots.pop();s<o.length&&(i.sourceSlots[r]=s,o[s]=i,t.observerSlots[s]=r)}}if(l.tOwned){for(e=l.tOwned.length-1;e>=0;e--)H(l.tOwned[e]);delete l.tOwned}if(l.owned){for(e=l.owned.length-1;e>=0;e--)H(l.owned[e]);l.owned=null}if(l.cleanups){for(e=l.cleanups.length-1;e>=0;e--)l.cleanups[e]();l.cleanups=null}l.state=0}function Ne(l){return l instanceof Error?l:new Error(typeof l=="string"?l:"Unknown error",{cause:l})}function ve(l,e=R){throw Ne(l)}function N(){return!0}const Ge={get(l,e,t){return e===se?t:l.get(e)},has(l,e){return e===se?!0:l.has(e)},set:N,deleteProperty:N,getOwnPropertyDescriptor(l,e){return{configurable:!0,enumerable:!0,get(){return l.get(e)},set:N,deleteProperty:N}},ownKeys(l){return l.keys()}};function te(l){return(l=typeof l=="function"?l():l)?l:{}}function ze(){for(let l=0,e=this.length;l<e;++l){const t=this[l]();if(t!==void 0)return t}}function Ee(...l){let e=!1;for(let r=0;r<l.length;r++){const a=l[r];e=e||!!a&&se in a,l[r]=typeof a=="function"?(e=!0,Be(a)):a}if(Fe&&e)return new Proxy({get(r){for(let a=l.length-1;a>=0;a--){const n=te(l[a])[r];if(n!==void 0)return n}},has(r){for(let a=l.length-1;a>=0;a--)if(r in te(l[a]))return!0;return!1},keys(){const r=[];for(let a=0;a<l.length;a++)r.push(...Object.keys(te(l[a])));return[...new Set(r)]}},Ge);const t={},s=Object.create(null);for(let r=l.length-1;r>=0;r--){const a=l[r];if(!a)continue;const n=Object.getOwnPropertyNames(a);for(let d=n.length-1;d>=0;d--){const c=n[d];if(c==="__proto__"||c==="constructor")continue;const h=Object.getOwnPropertyDescriptor(a,c);if(!s[c])s[c]=h.get?{enumerable:!0,configurable:!0,get:ze.bind(t[c]=[h.get.bind(a)])}:h.value!==void 0?h:void 0;else{const p=t[c];p&&(h.get?p.push(h.get.bind(a)):h.value!==void 0&&p.push(()=>h.value))}}}const o={},i=Object.keys(s);for(let r=i.length-1;r>=0;r--){const a=i[r],n=s[a];n&&n.get?Object.defineProperty(o,a,n):o[a]=n?n.value:void 0}return o}function Ue(l,e,t){let s=t.length,o=e.length,i=s,r=0,a=0,n=e[o-1].nextSibling,d=null;for(;r<o||a<i;){if(e[r]===t[a]){r++,a++;continue}for(;e[o-1]===t[i-1];)o--,i--;if(o===r){const c=i<s?a?t[a-1].nextSibling:t[i-a]:n;for(;a<i;)l.insertBefore(t[a++],c)}else if(i===a)for(;r<o;)(!d||!d.has(e[r]))&&e[r].remove(),r++;else if(e[r]===t[i-1]&&t[a]===e[o-1]){const c=e[--o].nextSibling;l.insertBefore(t[a++],e[r++].nextSibling),l.insertBefore(t[--i],c),e[o]=t[i]}else{if(!d){d=new Map;let h=a;for(;h<i;)d.set(t[h],h++)}const c=d.get(e[r]);if(c!=null)if(a<c&&c<i){let h=r,p=1,f;for(;++h<o&&h<i&&!((f=d.get(e[h]))==null||f!==c+p);)p++;if(p>c-a){const g=e[r];for(;a<c;)l.insertBefore(t[a++],g)}else l.replaceChild(t[a++],e[r++])}else r++;else e[r++].remove()}}}function je(l,e,t,s={}){let o;return Oe(i=>{o=i,e===document?l():Ye(e,l(),e.firstChild?null:void 0,t)},s.owner),()=>{o(),e.textContent=""}}function Xe(l,e,t){let s;const o=()=>{const r=document.createElement("template");return r.innerHTML=l,r.content.firstChild},i=()=>(s||(s=o())).cloneNode(!0);return i.cloneNode=i,i}function Ke(l,e,t){return Z(()=>l(e,t))}function Ye(l,e,t,s){if(t!==void 0&&!s&&(s=[]),typeof e!="function")return j(l,e,s,t);oe(o=>j(l,e(),o,t),s)}function j(l,e,t,s,o){for(;typeof t=="function";)t=t();if(e===t)return t;const i=typeof e,r=s!==void 0;if(l=r&&t[0]&&t[0].parentNode||l,i==="string"||i==="number"){if(i==="number"&&(e=e.toString(),e===t))return t;if(r){let a=t[0];a&&a.nodeType===3?a.data!==e&&(a.data=e):a=document.createTextNode(e),t=P(l,t,s,a)}else t!==""&&typeof t=="string"?t=l.firstChild.data=e:t=l.textContent=e}else if(e==null||i==="boolean")t=P(l,t,s);else{if(i==="function")return oe(()=>{let a=e();for(;typeof a=="function";)a=a();t=j(l,a,t,s)}),()=>t;if(Array.isArray(e)){const a=[],n=t&&Array.isArray(t);if(ie(a,e,t,o))return oe(()=>t=j(l,a,t,s,!0)),()=>t;if(a.length===0){if(t=P(l,t,s),r)return t}else n?t.length===0?ue(l,a,s):Ue(l,t,a):(t&&P(l),ue(l,a));t=a}else if(e.nodeType){if(Array.isArray(t)){if(r)return t=P(l,t,s,e);P(l,t,null,e)}else t==null||t===""||!l.firstChild?l.appendChild(e):l.replaceChild(e,l.firstChild);t=e}}return t}function ie(l,e,t,s){let o=!1;for(let i=0,r=e.length;i<r;i++){let a=e[i],n=t&&t[l.length],d;if(!(a==null||a===!0||a===!1))if((d=typeof a)=="object"&&a.nodeType)l.push(a);else if(Array.isArray(a))o=ie(l,a,n)||o;else if(d==="function")if(s){for(;typeof a=="function";)a=a();o=ie(l,Array.isArray(a)?a:[a],Array.isArray(n)?n:[n])||o}else l.push(a),o=!0;else{const c=String(a);n&&n.nodeType===3&&n.data===c?l.push(n):l.push(document.createTextNode(c))}}return o}function ue(l,e,t=null){for(let s=0,o=e.length;s<o;s++)l.insertBefore(e[s],t)}function P(l,e,t,s){if(t===void 0)return l.textContent="";const o=s||document.createTextNode("");if(e.length){let i=!1;for(let r=e.length-1;r>=0;r--){const a=e[r];if(o!==a){const n=a.parentNode===l;!i&&!r?n?l.replaceChild(o,a):l.insertBefore(o,t):n&&a.remove()}else i=!0}}else l.insertBefore(o,t);return[o]}class Je{constructor(e){this.code=e}render(e,t,s,o,i,r,a){const n=Ee({rowIndex:t,columnIndex:s,areaIdent:o,areaModel:i,cellValue:r});je(()=>this.code(n),e)}}const qe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Ze(l,e=500){let t=null;return function(...s){t&&window.clearTimeout(t),t=window.setTimeout(()=>{l.apply(this,s),t=null},e)}}class B{constructor(){this.alreadySet=!1}static getInstance(){return B.instance||(B.instance=new B),B.instance}setLicenseKey(e){if(e&&!this.alreadySet){const t=document.createElement("meta");t.content="license="+e,t.name="guiexperttable",document.getElementsByTagName("head")[0].appendChild(t),this.alreadySet=!0}}}function X(l){return l&&l.type==="TreeRow"}function re(l){return l&&l.type==="AreaModelTree"}class ae{constructor(e=-1,t=-1,s=-1,o=-1,i,r,a,n=0,d=0,c=0,h=""){this.rowIndex=e,this.rowTop=t,this.columnIndex=s,this.columnLeft=o,this.areaIdent=i,this.sideIdent=r,this.originalEvent=a,this.clickCount=n,this.draggingX=d,this.draggingY=c,this.action=h}clone(){return new ae(this.rowIndex,this.rowTop,this.columnIndex,this.columnLeft,this.areaIdent,this.sideIdent,this.originalEvent,this.clickCount,this.draggingX,this.draggingY,this.action)}}class I{constructor(e=">",t="",s=[]){this.content=e,this.style=t,this.classes=s}}class Ae{constructor(e=new I(">","transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",["gt-table-tree-arrow-expanded"]),t=new I(">","",["ge-table-tree-arrow-collapsed"]),s=new I(">","color:transparent;",["gt-table-tree-arrow-hidden"]),o=new I("↕","",["gt-table-tree-arrow-expanded-all"])){this.arrowExpanded=e,this.arrowCollapsed=t,this.arrowPlaceholder=s,this.arrowExpandCollapseAll=o}}class Me{constructor(e=new I("↑","",["ge-header-sorted-asc"]),t=new I("↓","",["ge-header-sorted-desc"]),s=new I("↑","color:transparent;",[])){this.iconAsc=e,this.iconDesc=t,this.iconPlaceholder=s}}class Qe{constructor(e){this.domService=e}setStyle(e,t,s){return this.domService.setStyle(e,t,s),e}applyStyle(e,t){for(const s in t)this.domService.setStyle(e,s,t[s]);return e}applyDisplayNoneStyle(e){return this.domService.setStyle(e,"display","none"),e}applyDisplayBlockStyle(e){return this.domService.setStyle(e,"display","block"),e}applyStyleInPx(e,t){return Object.entries(t).forEach(([s,o])=>this.domService.setStyle(e,s,o+"px")),e}applyStylePosistionRelative(e){return this.domService.setStyle(e,"position","relative"),this.domService.setStyle(e,"overflow","clip"),e}applyStylePosistionAbsolute(e){return this.domService.setStyle(e,"position","absolute"),e}applyStyleFullSize(e){return this.domService.setStyle(e,"width","100%"),this.domService.setStyle(e,"height","100%"),e}applyStyleOverflowAuto(e="auto",t="auto",s){return this.domService.setStyle(s,"overflow-x",e),this.domService.setStyle(s,"overflow-y",t),s}applyStyleNoPadding(e){return this.domService.setStyle(e,"padding","0"),this.domService.setStyle(e,"margin","0"),this.domService.setStyle(e,"border","0"),e}appendRelativeChildDiv(e){const t=this.applyStylePosistionRelative(this.applyStyleFullSize(this.applyStyleNoPadding(this.domService.createElement("div"))));return this.domService.appendChild(e,t),this.applyStylePosistionAbsolute(e),{parent:e,child:t,cache:{}}}appendText(e,t){const s=this.domService.createText(t);return this.domService.appendChild(e,s),s}addClass(e,t){return e.includes(" ")?e.split(" ").forEach(s=>this.domService.addClass(t,s)):this.domService.addClass(t,e),t}removeClass(e,t){return e.includes(" ")?e.split(" ").forEach(s=>this.domService.removeClass(t,s)):this.domService.removeClass(t,e),t}addClasses(e,t){if(e)for(const s of e)this.domService.addClass(t,s);return t}setAttribute(e,t,s){return t&&s&&this.domService.setAttribute(e,t,s),e}createAreaDivWithClass(e,t,s,o){const i=this.domService.createElement("div");return this.addClass(e,i),this.domService.setAttribute(i,"data-area",s),this.domService.setAttribute(i,"data-side",o),this.domService.appendChild(t,i),i}createDivWithClass(e,t){const s=this.domService.createElement("div");return this.addClass(e,s),this.domService.appendChild(t,s),s}addRowDiv(e,t,s=-1,o,i,r=""){const a=t.index??-1,n=this.getDivOrCreateDiv(a,e);if(this.domService.addClass(n,"ge-table-row-div"),this.domService.addClass(n,`ge-table-row-div-${t.index}`),o==="body"&&i==="center"){const d=((t==null?void 0:t.index)??0)%2===0?"even":"odd";this.domService.addClass(n,`ge-table-row-${d}`)}if(this.domService.setStyle(n,"display","clip"),this.domService.setStyle(n,"position","absolute"),this.domService.setStyle(n,"left",`${t.left}px`),this.domService.setStyle(n,"top",`${t.top}px`),this.domService.setStyle(n,"width",`${t.width}px`),this.domService.setStyle(n,"height",`${t.height}px`),this.domService.setAttribute(n,"data-row-index",`${s}`),this.domService.setAttribute(n,"data-area",`${o}`),r){const d=this.domService.createText(r);this.domService.appendChild(n,d)}return this.domService.appendChild(e.child,n),n}addColumnDiv(e){const{parent:t,geo:s,rowIndex:o=-1,columnIndex:i=-1,areaIdent:r,sideIdent:a,text:n="",treeArrow:d,tableOptions:c,checkedType:h=void 0,sortState:p}=e,f=c==null?void 0:c.treeOptions,g=c==null?void 0:c.showCheckboxWihoutExtraColumn,b=this.domService.createElement("div");this.domService.addClass(b,"ge-table-col-div"),g&&this.domService.addClass(b,"ge-with-checkbox"),this.domService.addClass(b,`ge-table-col-div-${s.index}`),this.domService.setAttribute(b,"data-col-index",`${s.index}`),this.domService.setAttribute(b,"data-row-index",`${o}`),this.domService.setAttribute(b,"data-area",`${r}`);const u=((s==null?void 0:s.index)??0)%2===0?"even":"odd";if(r==="body"&&a==="center"&&this.domService.addClass(b,`ge-table-column-${u}`),this.domService.setStyle(b,"display","clip"),this.domService.setStyle(b,"position","absolute"),this.domService.setStyle(b,"left",`${s.left}px`),this.domService.setStyle(b,"top",`${s.top}px`),this.domService.setStyle(b,"width",`${s.width}px`),this.domService.setStyle(b,"height",`${s.height}px`),d&&d!=="none"&&(this.domService.addClass(b,"ge-table-col-tree"),this.addArrowDiv(b,d,f,o,i,r)),g&&i===0&&h&&this.addCheckboxToDiv(b,h,r,o),n){const m=d!=="none"&&i===0;this.addLabelDiv(b,n,m,o,i,r)}return p&&this.addSortedIcon(b,p,c==null?void 0:c.sortedOptions,i),this.domService.appendChild(t,b),b}addCheckboxToDiv(e,t,s,o){const i=this.domService.createElement("div"),r=t==="full"?"checked":"";return i.innerHTML=`
2
2
  <input
3
3
  type="checkbox"
4
4
  data-area="${s}"
5
5
  data-row-index="${o}"
6
6
  data-input-type="checkbox"
7
7
  ${r}
8
- class="ge-table-row-checkbox"> `,this.domService.setStyle(i,"display","inline"),this.domService.setStyle(i,"width","inherit"),this.domService.setAttribute(i,"data-row-index",`${o}`),this.domService.appendChild(e,i),i}addLabelDiv(e,t="",s=!1,o=-1,i=-1,r="body"){const a=this.domService.createElement("div");if(this.domService.addClass(a,"ge-table-label-div"),this.domService.setStyle(a,"position","relative"),this.domService.setStyle(a,"background","transparent"),this.domService.setStyle(a,"width","100%"),this.domService.setStyle(a,"height","100%"),this.domService.setAttribute(a,"data-row-index",`${o}`),this.domService.setAttribute(a,"data-col-index",`${i}`),this.domService.setAttribute(a,"data-area",`${r}`),t)if(s){const n=this.domService.createText(t);this.domService.appendChild(a,n)}else{const n=this.domService.createElement("div");this.domService.appendChild(a,n);const d=this.domService.createText(t);this.domService.addClass(n,"ge-table-label"),this.domService.appendChild(n,d),this.domService.setAttribute(n,"data-row-index",`${o}`),this.domService.setAttribute(n,"data-col-index",`${i}`),this.domService.setAttribute(n,"data-area",`${r}`)}return this.domService.appendChild(e,a),a}addSortedIcon(e,t="",s=new Me,o=-1){const i=this.domService.createElement("div");this.domService.addClass(i,"ge-table-sorted-icon-div"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"top","0"),this.domService.setStyle(i,"right","0"),this.domService.setStyle(i,"width","20px"),this.domService.setStyle(i,"background","transparent"),this.domService.setStyle(i,"cursor","pointer"),this.domService.setAttribute(i,"data-col-index",`${o}`),this.domService.setAttribute(i,"data-area","header");let r;t==="asc"?r=s.iconAsc:t==="desc"?r=s.iconDesc:r=s.iconPlaceholder;const a=r.content,n=this.domService.createText(a);this.domService.appendChild(i,n),r.style&&this.applyStyleString(i,r.style);for(const d of r.classes)this.domService.addClass(i,d);return this.domService.appendChild(e,i),i}addArrowDiv(e,t="none",s=new Ae,o=-1,i=-1,r="body"){const a=this.domService.createElement("div");this.domService.addClass(a,"ge-table-tree-arrow-div"),this.domService.setStyle(a,"display","inline-block"),this.domService.setStyle(a,"position",""),this.domService.setStyle(a,"width","20px"),this.domService.setStyle(a,"background","transparent"),this.domService.setStyle(a,"cursor","pointer"),this.domService.setAttribute(a,"data-row-index",`${o}`),this.domService.setAttribute(a,"data-col-index",`${i}`),this.domService.setAttribute(a,"data-area",`${r}`);let n;t==="expanded"?n=s.arrowExpanded:t==="collapsed"?n=s.arrowCollapsed:n=s.arrowPlaceholder;const d=n.content,c=this.domService.createText(d);this.domService.appendChild(a,c),n.style&&this.applyStyleString(a,n.style);for(const h of n.classes)this.domService.addClass(a,h);return this.domService.appendChild(e,a),a}addColumnBorderDivs(e,t,s,o,i){if(e.verticalBorderVisible){const r=`ge-table-${o}-${i}-vertical-border`;this.addVerticalBorder(s,t,r)}if(e.horizontalBorderVisible){const r=`ge-table-${o}-${i}-horizontal-border`;this.addHorizontalBorder(s,t,r)}return t}addHorizontalBorder(e,t,s="ge-table-body-center-horizontal-border"){const o=this.domService.createElement("div");return this.domService.addClass(o,s),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${e.left}px`),this.domService.setStyle(o,"top",`${e.top}px`),this.domService.setStyle(o,"width",`${e.width}px`),this.domService.setStyle(o,"height","1px"),this.domService.appendChild(t,o),o}addFocusBorderDivs(e,t,s){t={...t,width:t.width+1,height:t.height+1};let o=this.domService.createElement("div");return this.domService.addClass(o,"ge-table-focus-border"),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${t.left}px`),this.domService.setStyle(o,"top",`${t.top}px`),this.domService.setStyle(o,"width","1px"),this.domService.setStyle(o,"height",`${t.height}px`),this.domService.setStyle(o,"z-index","9999"),this.applyStyle(o,s),this.domService.appendChild(e,o),o=this.domService.createElement("div"),this.domService.addClass(o,"ge-table-focus-border"),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${t.left+t.width-1}px`),this.domService.setStyle(o,"top",`${t.top}px`),this.domService.setStyle(o,"width","1px"),this.domService.setStyle(o,"height",`${t.height}px`),this.domService.setStyle(o,"z-index","9999"),this.applyStyle(o,s),this.domService.appendChild(e,o),o=this.domService.createElement("div"),this.domService.addClass(o,"ge-table-focus-border"),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${t.left}px`),this.domService.setStyle(o,"top",`${t.top}px`),this.domService.setStyle(o,"width",`${t.width}px`),this.domService.setStyle(o,"height","1px"),this.domService.setStyle(o,"z-index","9999"),this.applyStyle(o,s),this.domService.appendChild(e,o),o=this.domService.createElement("div"),this.domService.addClass(o,"ge-table-focus-border"),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${t.left}px`),this.domService.setStyle(o,"top",`${t.top+t.height-1}px`),this.domService.setStyle(o,"width",`${t.width}px`),this.domService.setStyle(o,"height","1px"),this.domService.setStyle(o,"z-index","9999"),this.applyStyle(o,s),this.domService.appendChild(e,o),e}addVerticalBorder(e,t,s="ge-table-body-center-vertical-border"){const o=this.domService.createElement("div");return this.domService.addClass(o,s),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${e.left}px`),this.domService.setStyle(o,"top",`${e.top}px`),this.domService.setStyle(o,"width","1px"),this.domService.setStyle(o,"height",`${e.height}px`),this.domService.appendChild(t,o),o}addDiv(e,t,s=""){const o=this.domService.createElement("div");return s&&this.domService.addClass(o,s),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${t.left}px`),this.domService.setStyle(o,"top",`${t.top}px`),this.domService.setStyle(o,"width",`${t.width}px`),this.domService.setStyle(o,"height",`${t.height}px`),this.domService.appendChild(e,o),o}applyStyleString(e,t){const s=t.split(";").map(o=>o.trim()).filter(o=>o);for(const o of s){const[i,r]=o.split(":");this.domService.setStyle(e,i.trim(),r.trim())}}getDivOrCreateDiv(e,t){let s=t.cache[e];return s?(s.innerText="",s):(s=this.domService.createElement("div"),t.cache[e]=s,s)}}const ne=l=>l==="header"?"header":l==="footer"?"footer":"body";class et{constructor(e,t){if(this.rowIdx=-1,this.colIdx=-1,this.action=null,this.inputType=null,this.className="",e!==null&&(e instanceof HTMLDivElement||e instanceof HTMLSpanElement||e instanceof HTMLInputElement)){this.className=e.className,this.action=e.getAttribute("data-ge-action"),this.inputType=e.getAttribute("data-input-type"),this.rowIdx=Number(e.getAttribute("data-row-index")),this.colIdx=Number(e.getAttribute("data-col-index"));const s=e.getAttribute("data-area");if(s&&(this.areaIdent=ne(s),this.areaModel=t.tableModel.getAreaModel(this.areaIdent),this.row=this.areaModel.getRowByIndex(this.rowIdx)),e instanceof HTMLInputElement){const o=e;this.value=o.value}}}}class tt{constructor(e){this.tableScope=e,this.doubleClickDelay=500,this.expandedAll=!0,this.mouseDown=!1,this.dragging=!1,this.lastClicked=0,this.tableScope.hostElement.addEventListener("click",this.onHostElementClicked.bind(this)),this.tableScope.hostElement.addEventListener("dblclick",this.onHostElementDblClicked.bind(this)),this.tableScope.hostElement.addEventListener("mousedown",this.onMouseDown.bind(this)),this.tableScope.hostElement.addEventListener("mousemove",this.onMouseMove.bind(this)),this.tableScope.hostElement.addEventListener("mouseup",this.onMouseUp.bind(this)),this.tableScope.hostElement.addEventListener("contextmenu",this.onContextmenu.bind(this)),this.tableScope.hostElement._MouseHandler="true",this.tableScope.scrollViewport.addEventListener("scroll",this.tableScope.adjustAfterScrolling.bind(this.tableScope)),[window,this.tableScope.hostElement].forEach(t=>t.addEventListener("resize",this.tableScope.adjustContainersAndRows.bind(this.tableScope)))}onContextmenu(e){this.mouseEvent=e;const t=this.tableScope.createGeMouseEvent(this.mouseEvent);this.tableScope.contextmenu(t)}onHostElementClicked(e){const t=Date.now();if(t-this.lastClicked<this.doubleClickDelay)return;this.lastClicked=t;const s=new et(e.target,this.tableScope);if(s.action==="toggleExpandCollapseAll")this.expandedAll=!this.expandedAll,this.tableScope.toggleExpandCollapseAll(this.expandedAll),e.preventDefault(),e.stopPropagation();else if(s.action==="toggleHeaderGroup")this.tableScope.toggleHeaderGroup(s),e.preventDefault(),e.stopPropagation();else if(s.inputType==="checkbox"&&s.areaIdent)this.tableScope.toggleRowCheckbox(s.rowIdx,s.colIdx,s.areaIdent),e.preventDefault(),e.stopPropagation();else if(X(s.row)&&s.areaModel){const o=s.colIdx===this.getArrowColumnIndex()&&e.altKey,i=s.className.includes("ge-table-tree-arrow-div");if(o||i){e.preventDefault(),e.stopPropagation();const r=s.row;r.expanded=!r.expanded,"recalcVisibleTreeRows"in s.areaModel&&s.areaModel.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(r)}}if(s.areaIdent==="body"&&this.tableScope.tableOptions.getFocusModel){const o=this.tableScope.tableOptions.getFocusModel();o==null||o.clear(),o==null||o.setFocus(s.rowIdx,s.colIdx)}this.publishGeMouseEvent(e,1)}onHostElementDblClicked(e){if(this.lastClicked=Date.now(),e.target instanceof HTMLElement){const t=e.target,s=t.getAttribute("data-area"),o=ne(s),i=Number(t.getAttribute("data-row-index")),r=Number(t.getAttribute("data-col-index")),a=this.tableScope.tableModel.getAreaModel(o);if(s&&o==="header")this.tableScope.tableModel.isSortable(r)&&(this.tableScope.clearSelection(),this.tableScope.onHeaderDblClicked(e,i,r));else if(t.getAttribute("data-row-index")){const n=a.getRowByIndex(i);if(s&&o==="body"&&a.isEditable(i,r)&&(this.tableScope.clearSelection(),this.tableScope.initRenderEditor(i,r)),X(n)&&r===this.getArrowColumnIndex()){e.preventDefault(),e.stopPropagation();const d=n;d.expanded=!d.expanded,"recalcVisibleTreeRows"in a&&a.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(d)}}}this.publishGeMouseEvent(e,2)}publishGeMouseEvent(e,t){var s;this.mouseEvent=e,this.geMouseEventOld=(s=this.geMouseEvent)==null?void 0:s.clone(),this.geMouseEvent=this.tableScope.createGeMouseEvent(e),this.geMouseEvent&&(this.geMouseEvent.clickCount=t),this.tableScope.onMouseClicked(this.geMouseEvent,this.geMouseEventOld),this.tableScope.publishGeMouseEvent(this.geMouseEvent)}updateCollapsedExpandedState(e){var s,o,i,r,a;const t=(o=(s=this.tableScope.tableOptions)==null?void 0:s.autoRestoreOptions)==null?void 0:o.getRowId;if(t){const n=(i=this.tableScope.storeStateCollapsedExpandService)==null?void 0:i.collapsedExpandedStateGet().mode,d=n==="collapsed"&&!e.expanded||n==="expanded"&&e.expanded,c=n==="collapsed"&&e.expanded||n==="expanded"&&!e.expanded,h=t(e.data);d?(r=this.tableScope.storeStateCollapsedExpandService)==null||r.collapsedStateIdsPush(h):c&&((a=this.tableScope.storeStateCollapsedExpandService)==null||a.collapsedStateIdsRemove(h))}}getArrowColumnIndex(){return this.tableScope.tableModel.isRowCheckboxVisible()?1:0}onMouseDown(e){this.dragging||(this.mouseEvent=e,this.startMouseEvent=this.tableScope.createGeMouseEvent(this.mouseEvent),this.tableScope.onMouseDown(this.startMouseEvent),this.mouseDown=!0)}onMouseMove(e){this.mouseEvent=e,this.mouseDown?(this.dragging||(this.dragging=!0,this.tableScope.setDragging(!0)),requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))):requestAnimationFrame(this.mouseMoveOnFrame.bind(this))}onMouseUp(e){this.mouseEvent=e,this.dragging&&requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)),this.mouseDown=!1,this.dragging=!1,this.tableScope.setDragging(!1)}mouseDraggingOnFrame(){var e;if(this.mouseEvent){const t=this.tableScope.createGeMouseEvent(this.mouseEvent);(e=this.startMouseEvent)!=null&&e.originalEvent&&(t.draggingX=this.mouseEvent.clientX-this.startMouseEvent.originalEvent.clientX,t.draggingY=this.mouseEvent.clientY-this.startMouseEvent.originalEvent.clientY),this.tableScope.mouseDraggingOnFrame(t,this.startMouseEvent)}}mouseDraggingEndOnFrame(){var e;if(this.mouseEvent){const t=this.tableScope.createGeMouseEvent(this.mouseEvent);(e=this.startMouseEvent)!=null&&e.originalEvent&&(t.draggingX=this.mouseEvent.clientX-this.startMouseEvent.originalEvent.clientX,t.draggingY=this.mouseEvent.clientY-this.startMouseEvent.originalEvent.clientY),this.tableScope.mouseDraggingEndOnFrame(t)}}mouseMoveOnFrame(){if(this.mouseEvent){const e=this.tableScope.createGeMouseEvent(this.mouseEvent);this.tableScope.mouseMove(e)}}}class st{constructor(e,t=[],s=-1){this.areaIdent=e,this.columnDefs=t,this.defaultRowHeight=s,this.rowSelectionModel=void 0,this.yPositions=[],this.cellRenderers=t.map(o=>o.rendererMap[e])}getTextValueAt(e,t){return""+this.getValueAt(e,t)}getTooltipAt(e,t){return""}getCellRenderer(e,t){if(t<this.cellRenderers.length)return this.cellRenderers[t]}getColspanAt(e,t){return 0}getCustomClassesAt(e,t){return[]}getCustomStyleAt(e,t){}getRowspanAt(e,t){return 0}getRowByIndex(e){}isRowCheckable(e){return!0}isRowChecked(e){var s;const t=this.getRowByIndex(e);return(s=this.rowSelectionModel)==null?void 0:s.isRowChecked(t)}setRowChecked(e,t){if(this.rowSelectionModel){const s=this.getRowByIndex(e);this.rowSelectionModel.checkRow(s,t)}}getMaxColspan(){return 31}getMaxRowspan(){return 31}getYPosByRowIndex(e){return this.defaultRowHeight>0?this.defaultRowHeight*e:this.yPositions[e]}init(){!this.yPositions.length&&this.getRowCount()!==void 0&&this.defaultRowHeight===-1&&this.calcYPositions()}isFilterable(){return this.areaIdent==="body"}doSort(e){return!1}isEditable(e,t){var o,i;const s=(o=this.columnDefs)==null?void 0:o[t];return((i=s==null?void 0:s.editable)==null?void 0:i.call(s))??!1}setValue(e,t,s){var a;const o=(a=this.columnDefs[t])==null?void 0:a.editInputPipe;o&&(s=o(s,e,t));const i=this.getRowByIndex(e),r=this.columnDefs[t].property;return r.includes(".")?this.setPropertyValue(i,r.split("."),s):(i[r]=s,!0)}isSelectable(e,t){return!0}changeColumnOrder(e,t){this.arrayMove(this.cellRenderers,e,t)}setPropertyValue(e,t,s){const o=t.shift();if(o){const i=e[o];return i&&t.length?this.setPropertyValue(i,t,s):(e[o]=s,!0)}return!1}arrayMove(e,t,s){const o=e.splice(t,1)[0];return e.splice(s,0,o),e}calcYPositions(){const e=this.getRowCount();this.yPositions=new Array(e+1),this.yPositions[0]=0;for(let t=0;t<e;t++)this.yPositions[t+1]=this.getRowHeight(t)+this.yPositions[t]}}class ot{genericSortComparator(e,t,s){if(typeof e=="number"&&typeof t=="number")return s*(e-t);if(typeof e=="string"&&typeof t=="string")return s*e.localeCompare(t);if(typeof e=="boolean"&&typeof t=="boolean")return s*((e?-1:1)-(t?-1:1));if(e instanceof Date&&t instanceof Date)return s*(e.getTime()-t.getTime());if(e instanceof Array&&t instanceof Array){const o=e,i=t;if(o.length&&i.length)return this.genericSortComparator(o[0],i[0],s)}return s*(""+e).localeCompare(""+t)}}class it extends st{constructor(e,t,s,o=[]){super(e,o,s),this.areaIdent=e,this.rows=t,this.defaultRowHeight=s,this.columnDefs=o,this.focusedRowIndex=0,this.sorterService=new ot,this.filteredRows=[...t],this.properties=o.map(i=>i.property)}setRows(e){this.rows=e,this.filteredRows=[...e]}filterRowsByPredict(e){this.rows=this.rows.filter(e),this.filteredRows=this.filteredRows.filter(e)}getRowCount(){var e;return((e=this.filteredRows)==null?void 0:e.length)??0}getValueAt(e,t){const s=this.properties[t];let o=this.filteredRows[e];return X(o)&&(o=o.data),o?this.getValueByT(o,s):""}getFilteredRows(){return this.filteredRows}getAllRows(){return this.rows}getRowHeight(e){return this.defaultRowHeight}getRowByIndex(e){return this.filteredRows[e]}externalFilterChanged(e){this.filteredRows=this.rows?this.rows.filter(e):[]}doSort(e){for(const t of e){const{columnIndex:s,sortState:o}=t,i=o==="asc"?1:o==="desc"?-1:0,r=this.properties[s];this.filteredRows=this.filteredRows.sort(this.genericFlatTableSortComparator(r,i))}return!0}getValueByT(e,t){return t.includes(".")?this.getPropertyValue(e,t.split(".")):e[t]}changeColumnOrder(e,t){this.arrayMove(this.properties,e,t),super.changeColumnOrder(e,t)}getCustomClassesAt(e,t){const s=super.getCustomClassesAt(e,t);return this.getRowByIndex(e).selected&&s.push("ge-selected-row"),this.focusedRowIndex===e&&s.push("ge-focused-row"),s}genericFlatTableSortComparator(e,t){const s=this.columnDefs.find(o=>o.property===e);return(o,i)=>{const r=this.getValueByT(o,e),a=this.getValueByT(i,e);return s!=null&&s.sortComparator?t*s.sortComparator(r,a,o,i,t):this.sorterService.genericSortComparator(r,a,t)}}getPropertyValue(e,t){const s=t.shift(),o=e[s];return o&&t.length?this.getPropertyValue(o,t):o}}class rt{constructor(e){this.tableScope=e}updateCells(e,t=!1){this.tableScope.updateCells(e,t)}externalFilterChanged(){this.tableScope.externalFilterChanged()}scrollToPixel(e=0,t=0){this.tableScope.scrollToPixel(e,t)}scrollToIndex(e=0,t=0){this.tableScope.scrollToIndex(e,t)}setHeaderVisible(e=!0){}setColumnVisible(e,t=!0){}isColumnVisible(e){return!0}isHeaderVisible(){return!0}setFooterVisible(e=!0){}isFooterVisible(){return!0}repaint(){this.tableScope.repaint()}repaintHard(){this.tableScope.repaintHard()}recalcColumnWidths(e){this.tableScope.recalcColumnWidths(e)}clearSelection(){this.tableScope.clearSelection(!0)}setSelectionModel(e,t=!0){this.tableScope.setSelectionModel(e,t)}triggerAction(e){this.tableScope.onActionTriggered(e)}getShortcutActionMapping(){return this.tableScope.shortcutService.getShortcutActionMapping()}copyToClipboard(){return this.tableScope.copyService.copyToClipboard(this.tableScope.tableModel,this.tableScope.selectionModel(),this.tableScope.focusModel())}downloadExcel(e="table.xlsx",t=""){const s=[],o=this.tableScope.tableModel.getColumnCount(),i=["header","body","footer"];for(const r of i){const a=this.tableScope.tableModel.getAreaModel(r),n=(a==null?void 0:a.getRowCount())??0;for(let d=0;d<n;d++){const c=[];s.push(c);for(let h=0;h<o;h++)c.push(a.getValueAt(d,h))}}return this.tableScope.excelService.downloadExcel(s,e,t)}getTableScope(){return this.tableScope}getSelectionModel(){return this.tableScope.selectionModel()}autoResizeColumns(e=!0){this.tableScope.autoResizeColumns(e)}recalcWrappers(){this.tableScope.recalcWrappers()}setColumnWidth(e,t){this.tableScope.setColumnWidth(e,t)}getTableModel(){return this.tableScope.tableModel}getBodyModel(){return this.tableScope.tableModel.getBodyModel()}setRows(e){const t=this.getBodyModel();t instanceof it?t.setRows(e):console.warn("setRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof t)}reSort(){this.tableScope.reSort()}}class ce{constructor(e){this.getStorageKeyFn=e}autoConvertMapToObject(e){const t={};return e instanceof Map&&e.forEach((o,i)=>{t[o]=i}),t}checkAndPersistItem(e,t){const s=this.getStorageKeyFn;if(s){const o=s();if(o){const i=o+e;if((t+"").includes("Map")){const r=this.autoConvertMapToObject(t);this.persistItem(i,r)}else this.persistItem(i,t)}}}persistItem(e,t){t?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}loadFromLocalStorage(e){const t=localStorage.getItem(e);return t?JSON.parse(t):null}}class lt extends ce{constructor(e){super(e),this.SCROLL_STATE="scrollState",this.scrollOffset=[0,0],this.load()}getScrollOffset(){return this.scrollOffset}updateScrollOffset(e){this.scrollOffset=e,this.checkAndPersistItem(this.SCROLL_STATE,this.scrollOffset)}load(){const e=this.getStorageKeyFn;if(e){const t=e();if(t){const s=t+this.SCROLL_STATE;let o=this.loadFromLocalStorage(s);this.scrollOffset=o||[0,0]}}}}class at{constructor(e="collapsed",t=[],s=!1,o=!1){this.mode=e,this.rowIds=t,this.allCollapsed=s,this.allExpanded=o}}class nt extends ce{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new at,this.load()}collapsedExpandedStateGet(){return this.collapsedExpandedState}collapsedExpandedStateIncludes(e){return this.collapsedExpandedState.rowIds.includes(e)}collapsedStateIdsPush(e){this.collapsedExpandedState.rowIds.includes(e)||(this.collapsedExpandedState.rowIds.push(e),this.collapsedExpandedState.allCollapsed=!1,this.collapsedExpandedState.allExpanded=!1,this.persist())}collapsedStateIdsRemove(e){const t=this.collapsedExpandedState.rowIds.indexOf(e);t!==-1&&(this.collapsedExpandedState.rowIds.splice(t,1),this.collapsedExpandedState.allCollapsed=!1,this.collapsedExpandedState.allExpanded=!1,this.persist())}collapsedStateAll(e){this.collapsedExpandedState.rowIds=[],this.collapsedExpandedState.mode=e?"collapsed":"expanded",this.collapsedExpandedState.allCollapsed=!e,this.collapsedExpandedState.allExpanded=e,this.persist()}load(){const e=this.getStorageKeyFn;if(e){const t=e();if(t){const s=t+this.COLLAPSED_EXPANDED_STATE,o=this.loadFromLocalStorage(s);o&&(this.collapsedExpandedState=o)}}}persist(){this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE,this.collapsedExpandedState)}}class ct extends ce{constructor(e){super(e),this.SORTING_STATE="sortingState",this.sortItems=[],this.load()}getSortItems(){return this.sortItems}setSortItems(e){this.sortItems=e,this.checkAndPersistItem(this.SORTING_STATE,this.sortItems)}load(){const e=this.getStorageKeyFn;if(e){const t=e();if(t){const s=t+this.SORTING_STATE,o=this.loadFromLocalStorage(s);this.sortItems=o||[]}}}}class F{constructor(e=0,t=0,s=0,o=0,i){this.left=e,this.width=t,this.height=s,this.top=o,this.index=i}}class dt{constructor(e,t,s,o){this.hostElement=e,this.tableModel=t,this.dom=s,this.tableOptions=o,this.scrollTop=0,this.areaBodyWestGeo=new F,this.areaBodyCenterGeo=new F,this.areaBodyEastGeo=new F;const i=this.hostElement;i.innerText="",this.dom.setAttribute(i,"tabindex","0"),this.dom.setStyle(this.dom.addClass("ge-table",i),"position","relative"),this.hoverRow=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-hover-row",i)),this.hoverColumn=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-hover-column",i)),this.draggingColumn=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-dragging-column",i)),this.areaHeaderWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-west",i,"header","west"))),this.areaHeaderCenter=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-center",i,"header","center"))),this.areaHeaderEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-east",i,"body","east"))),this.areaBodyWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-body ge-table-body-west",i,"body","west"))),this.areaBodyEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-body ge-table-body-east",i,"body","east"))),this.areaFooterWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-west",i,"footer","west"))),this.areaFooterCenter=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-center",i,"footer","center"))),this.areaFooterEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-east",i,"footer","east"))),this.scrollViewport=s.applyStyleOverflowAuto(this.tableOptions.overflowX??"auto",this.tableOptions.overflowY??"auto",s.applyStyleNoPadding(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-scroll-viewport",i,"body","center")))),this.contentWrapperDiv=s.applyStyleNoPadding(s.applyStylePosistionRelative(s.createDivWithClass("ge-table-scroll-content-wrapper",this.scrollViewport))),this.contentDiv=s.applyStyleNoPadding(s.applyStylePosistionRelative(s.createDivWithClass("ge-table-scroll-content",this.contentWrapperDiv))),this.areaBodyCenter=s.appendRelativeChildDiv(s.createDivWithClass("ge-table-body-center",this.contentDiv)),this.borderHeaderBottom=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-header-border",i)),this.borderFixedWest=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-west-fixed-column-border",i)),this.borderFixedEast=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-east-fixed-column-border",i)),this.borderFooterTop=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-footer-border",i))}adjustContainersAndRows(){const e=this.tableModel.getPadding(),t=this.hostElement.clientWidth,s=this.hostElement.clientHeight;this.dom.applyStyle(this.scrollViewport,{width:`${t-e.left}px`,height:`${s-e.top}px`,top:`${e.top}px`,left:`${e.left}px`}),this.scrollTop=this.scrollViewport.scrollTop,this.dom.applyStyle(this.contentDiv,{width:`${this.scrollViewport.clientWidth}px`,height:`${this.scrollViewport.clientHeight}px`,top:`${this.scrollTop}px`,left:`${this.scrollViewport.scrollLeft}px`}),this.areaBodyWestGeo.width=e.left,this.areaBodyWestGeo.height=s-e.top-e.bottom,this.areaBodyWestGeo.top=e.top,this.areaBodyWestGeo.left=0,this.dom.applyStyleInPx(this.areaBodyWest.parent,this.areaBodyWestGeo),this.tableOptions.fixedWestSeparatorBorderVisible&&this.tableModel.getFixedLeftColumnCount()?this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderFixedWest,{width:"1px",height:`${this.areaBodyWestGeo.height}px`,top:`${this.areaBodyWestGeo.top}px`,left:`${this.areaBodyWestGeo.width}px`})):this.dom.applyDisplayNoneStyle(this.borderFixedWest),this.areaBodyEastGeo.width=e.right,this.areaBodyEastGeo.height=s-e.top-e.bottom,this.areaBodyEastGeo.top=e.top,this.areaBodyEastGeo.left=t-e.right,this.dom.applyStyleInPx(this.areaBodyEast.parent,this.areaBodyEastGeo),this.tableOptions.fixedEastSeparatorBorderVisible&&this.tableModel.getFixedLeftColumnCount()?this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderFixedEast,{width:"1px",height:`${this.areaBodyEastGeo.height}px`,top:`${this.areaBodyEastGeo.top}px`,left:`${this.areaBodyEastGeo.left}px`})):this.dom.applyDisplayNoneStyle(this.borderFixedEast),this.areaBodyCenterGeo.width=t-e.left-e.right,this.areaBodyCenterGeo.height=s-e.top-e.bottom,this.areaBodyCenterGeo.top=0,this.areaBodyCenterGeo.left=0,this.dom.applyStyleInPx(this.areaBodyCenter.parent,this.areaBodyCenterGeo),this.dom.applyStyle(this.areaHeaderCenter.parent,{width:`${t-e.left-e.right}px`,height:`${e.top}px`,top:"0",left:`${e.left}px`}),this.dom.applyStyle(this.areaHeaderWest.parent,{width:`${e.left}px`,height:`${e.top}px`,top:"0",left:"0"}),this.dom.applyStyle(this.areaHeaderEast.parent,{width:`${e.right}px`,height:`${e.top}px`,top:"0",left:`${t-e.right}px`}),this.tableOptions.headerSeparatorBorderVisible&&this.tableModel.isHeaderVisibe()?this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderHeaderBottom,{width:`${t}px`,height:"1px",top:`${e.top}px`,left:"0px"})):this.dom.applyDisplayNoneStyle(this.borderHeaderBottom),this.dom.applyStyle(this.areaFooterWest.parent,{width:`${e.left}px`,height:`${e.bottom}px`,top:`${s-e.bottom}px`,left:"0"}),this.dom.applyStyle(this.areaFooterCenter.parent,{width:`${t-e.left-e.right}px`,height:`${e.bottom}px`,top:`${s-e.bottom}px`,left:`${e.left}px`}),this.dom.applyStyle(this.areaFooterEast.parent,{width:`${e.right}px`,height:`${e.bottom}px`,top:`${s-e.bottom}px`,left:`${t-e.right}px`}),this.tableOptions.footerSeparatorBorderVisible&&this.tableModel.isFooterVisibe()?this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderFooterTop,{width:`${t}px`,height:"1px",top:`${s-e.bottom}px`,left:"0px"})):this.dom.applyDisplayNoneStyle(this.borderFooterTop),this.adjustAfterScrolling()}adjustAfterScrolling(){}resetSizeOfWrapperDiv(){const e=`${this.tableModel.getContentWidthInPixel()}px`,t=`${this.tableModel.getContentHeightInPixel()+1}px`;this.dom.setStyle(this.contentWrapperDiv,"width",e),this.dom.setStyle(this.contentWrapperDiv,"height",t)}}class A{constructor(e,t,s,o,i=!1){this.r1=e,this.c1=t,this.r2=s,this.c2=o,this.gammaRange=i}static create(e){return e.gammaRange===void 0&&(e.gammaRange=!1),new A(e.rowIndex1,e.columnIndex1,e.rowIndex2,e.columnIndex2,e.gammaRange)}static singleCell(e,t){return new A(e,t,e,t)}static singleRow(e){return new A(e,0,e,Number.MAX_SAFE_INTEGER)}static singleColumn(e){return new A(0,e,Number.MAX_SAFE_INTEGER,e)}isInRange(e,t){return e>=this.r1&&e<=this.r2&&t>=this.c1&&t<=this.c2}}class ht{constructor(e,t){this.tableModel=e,this.areaModel=t,this.colAndRowspanRanges=void 0}init(){if(this.areaModel.getMaxColspan()<2&&this.areaModel.getMaxRowspan()<2)return;this.colAndRowspanRanges=[];const e=this.areaModel.getRowCount(),t=this.tableModel.getColumnCount();for(let s=0;s<e;s++)for(let o=0;o<t;o++){let i=this.areaModel.getColspanAt(s,o),r=this.areaModel.getRowspanAt(s,o);if(i>1||r>1){i===0&&(i=1),r===0&&(r=1);const a="gammaCells"in this.areaModel;this.colAndRowspanRanges.push(new A(s,o,s+r-1,o+i-1,a))}}}getRanges(){return this.colAndRowspanRanges?this.colAndRowspanRanges:[]}isInRange(e,t){if(this.colAndRowspanRanges){for(const s of this.colAndRowspanRanges)if(s.isInRange(e,t))return!0}return!1}}class pt{constructor(e,t,s){this.header=e,this.body=t,this.footer=s}}class gt extends dt{constructor(e,t,s,o){var r,a;super(e,t,s,o),this.dragging=!1,this.editing=!1,this.storedColumnWidths=[],this.scrollLeft=0,this.scrollViewportLeft=0,this.scrollFactorY=0,this.scrollFactorX=0,this.cleanupFunctions={header:[],body:[],footer:[]},this.tree=!1,this.colAndRowspanModels=new pt,this.firstVisibleRowIndex=-1,this.draggingTargetColumnIndex=-1,this.removables=[],this.tableModel.getSelectionModel?this.getSelectionModel=this.tableModel.getSelectionModel:(r=this.tableOptions)!=null&&r.getSelectionModel&&(this.getSelectionModel=this.tableOptions.getSelectionModel),(a=this.tableOptions)!=null&&a.getFocusModel&&(this.getFocusModel=this.tableOptions.getFocusModel),re(t.getAreaModel("body"))&&(this.tree=!0),["header","body","footer"].forEach(n=>{var d;this.colAndRowspanModels[n]=new ht(t,t.getAreaModel(n)),(d=this.colAndRowspanModels[n])==null||d.init()})}isEditing(){return this.editing}resetEditorRenderer(){this.editorRenderer=void 0,this.editorRendererRow=-1,this.editorRendererColumn=-1,this.editing=!1}clearSelection(e=!1){if(this.getSelectionModel){const t=this.getSelectionModel();t==null||t.clear(),e&&this.repaint()}}initRenderEditor(e,t){var o;let s=(o=this.tableModel.getColumnDef(t))==null?void 0:o.getEditRenderer;if(s||(s=this.tableOptions.getEditRenderer),s)if(this.editorRenderer=s(e,t),this.editorRenderer){this.editorRendererRow=e,this.editorRendererColumn=t,this.editing=!0,this.repaint();const i=document.querySelector("input.ge-table-cell-editor-input");i&&i.focus()}else this.resetEditorRenderer()}repaint(){this.adjustAfterScrolling()}repaintHard(){this.tableModel.recalcHeightAndPadding(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows(),this.adjustAfterScrolling()}recalcColumnWidths(e){let t=e||this.scrollViewport.clientWidth;this.tableModel.setParentWidth(t),this.tableModel.init(),this.repaintHard()}adjustAfterScrolling(){var e;for(const t of this.removables)t.remove();this.hideHoverRow(),this.hideHoverColumn(),this.scrollTop=this.scrollViewport.scrollTop,this.scrollLeft=this.scrollViewport.scrollLeft,this.debounce(this.checkForScrollPosSaving.bind(this)),this.scrollFactorY=this.scrollTop/(this.scrollViewport.scrollHeight-this.scrollViewport.clientHeight),this.scrollFactorX=this.scrollLeft/(this.scrollViewport.scrollWidth-this.scrollViewport.clientWidth),isNaN(this.scrollFactorY)&&(this.scrollFactorY=0),isNaN(this.scrollFactorX)&&(this.scrollFactorX=0),this.adjustBody(),this.adjustArea("footer"),this.adjustArea("header"),this.tableOptions.tableTopBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new F(0,this.hostElement.clientWidth,1,0),this.hostElement,"ge-table-border")),this.tableOptions.tableBottomBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new F(0,this.hostElement.clientWidth,1,this.hostElement.clientHeight-1),this.hostElement,"ge-table-border")),this.tableModel.getFixedLeftColumnCount()>0&&this.removables.push(this.dom.addVerticalBorder(new F(this.areaBodyWest.child.clientWidth,1,this.hostElement.clientHeight,0),this.hostElement,"ge-table-body-west-vertical-border")),((e=this.tableModel.getAreaModel("header"))==null?void 0:e.getRowCount())>0&&this.removables.push(this.dom.addHorizontalBorder(new F(0,this.hostElement.clientWidth,1,this.areaHeaderCenter.child.clientHeight),this.hostElement,"ge-table-body-west-vertical-border"))}checkForScrollPosSaving(){var e,t;this.storeScrollPosStateService&&((t=(e=this.tableOptions)==null?void 0:e.autoRestoreOptions)!=null&&t.autoRestoreScrollPosition)&&this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft,this.scrollTop])}updateCells(e,t=!1){e.forEach(s=>{this.tableModel.getAreaModel(s.area).setValue(s.rowIndex,s.columnIndex,s.value),t||this.rerenderCellContent(s)}),t&&this.repaint()}rerenderCellContent({area:e,rowIndex:t,columnIndex:s,value:o,cssClasses:i}){const r=this.tableModel.getAreaModel(e),a='div[data-col-index="'+s+'"][data-row-index="'+t+'"][data-area="'+e+'"]',n=document.querySelector(a);if(n){let d;const c=this.editorRenderer&&this.editorRendererRow===t&&this.editorRendererColumn===s;let h;if(c?h=this.editorRenderer:h=r.getCellRenderer(t,s),n.innerText="",this.applyCssClasses(n,i),h)d=h.render(n,t,s,e,r,o,this.dom.domService),d&&this.cleanupFunctions[e].push(d);else{const g=`${o}`;this.dom.addLabelDiv(n,g,!1,t,s,e)}const p=r.getCustomClassesAt(t,s);p.length&&this.dom.addClasses(p,n);const u=r.getCustomStyleAt(t,s);if(u)for(const g in u)this.dom.setStyle(n,g,u[g])}}storeColumnWidths(){const e=this.tableModel.getColumnDefs();e!=null&&e.length&&(this.storedColumnWidths=e.map((t,s)=>this.tableModel.getColumnWidth(s)))}getAreaAndSideIdentByAttr(e){if(e){const t=this.getStringByAttr(e,"data-area"),s=this.getStringByAttr(e,"data-side");if(s&&t)return[t,s]}return[void 0,void 0]}getArea(e,t){if(e==="header"){if(t==="west")return this.areaHeaderWest;if(t==="center")return this.areaHeaderCenter;if(t==="east")return this.areaHeaderEast}else if(e==="body"){if(t==="west")return this.areaBodyWest;if(t==="center")return this.areaBodyCenter;if(t==="east")return this.areaBodyEast}else if(e==="footer"){if(t==="west")return this.areaFooterWest;if(t==="center")return this.areaFooterCenter;if(t==="east")return this.areaFooterEast}throw Error(`Wrong area identifier: row:${e}, col:${t}`)}adjustBody(){const e=this.areaBodyCenterGeo.height-this.tableModel.getContentHeightInPixel(),t=this.scrollFactorY*e;this.dom.setStyle(this.contentDiv,"top",`${this.scrollTop}px`),this.dom.setStyle(this.contentDiv,"left",`${this.scrollViewport.scrollLeft}px`),this.adjustArea("body",t)}getNumberByAttr(e,t){var s;if(e){const o=(s=e.closest("["+t+"]"))==null?void 0:s.getAttribute(t);if(o)return Number(o)}return-1}getStringByAttr(e,t){var s;if(e){const o=(s=e.closest("["+t+"]"))==null?void 0:s.getAttribute(t);if(o)return o}return""}adjustArea(e,t=0){var f;const s=this.getArea(e,"west"),o=this.getArea(e,"center"),i=this.getArea(e,"east"),r=o.child.clientHeight;s.child.innerText="",o.child.innerText="",i.child.innerText="";const a=0,n=this.areaBodyCenterGeo.width,d=this.tableModel.getPadding(),c=this.tableModel.getAreaModel(e),h=c.getRowCount();for(;this.cleanupFunctions[e].length;){const m=this.cleanupFunctions[e].shift();m&&m()}let p=t;const u=this.tableModel.getColumnCount(),g=this.tableModel.getFixedRightColumnCount(),b=this.tableModel.getFixedLeftColumnCount();for(let m=0;m<h;m++){const x=p,v=m===h-1,E=this.tableModel.getRowHeight(e,m);if(x+E>0){this.firstVisibleRowIndex=m;let y={left:a,width:n,height:E,top:x,index:m},S=this.dom.addRowDiv(o,y,m,e,"center");const k=b;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:c,geo:y,parent:S,rowIndex:m,columnIndexStart:k,columnIndexEnd:u-g-1,verticalFixed:!1,lastRowOfModel:v}),d.left>0&&(y={left:a,width:this.areaBodyWestGeo.width,height:E,top:x,index:m},S=this.dom.addRowDiv(s,y,m,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:c,geo:y,parent:S,rowIndex:m,columnIndexStart:0,columnIndexEnd:k-1,verticalFixed:!0,lastRowOfModel:v})),d.right>0&&(y={left:a,width:this.areaBodyEastGeo.width,height:E,top:x,index:m},S=this.dom.addRowDiv(i,y,m,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:c,geo:y,parent:S,rowIndex:m,columnIndexStart:u-g,columnIndexEnd:u-1,verticalFixed:!0,lastRowOfModel:v})),e==="header"&&this.tree&&m===h-1){const T=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(S,new F(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),D=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(D){const _=this.dom.domService.createText(D.content);this.dom.domService.appendChild(T,_),D.style&&this.dom.applyStyleString(T,D.style)}}}if(p=p+E,p>r)break}if(this.colAndRowspanModels&&this.colAndRowspanModels[e]){const m=((f=this.colAndRowspanModels[e])==null?void 0:f.getRanges())??[];if(m.length)for(const x of m){let v=0,E=o.child,y="center";if(x.c1<b)E=s.child,y="west";else if(g>0&&x.c1>=u-g)E=i.child,y="east";else{const S=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();v=this.scrollFactorX*S-this.areaBodyWestGeo.width,y="center"}this.drawBigCell(x,v,t,c,E,y)}}}drawBigCell(e,t,s,o,i,r){const a=s+this.getRowHeights(0,e.r1-1,o).reduce((f,m)=>f+m,0),n=this.tableModel.getColumnCount(),d=this.tableModel.getFixedRightColumnCount();let c=0;d>0&&e.c1>=n-d&&(c=n-d);const h=t+this.getColumnWidths(c,e.c1-1).reduce((f,m)=>f+m,0),p=this.getRowHeights(e.r1,e.r2,o).reduce((f,m)=>f+m,0),u=this.getColumnWidths(e.c1,e.c2).reduce((f,m)=>f+m,0);let g=!1;const b=this.getSelectionModel?this.getSelectionModel():void 0;b&&(g=b.getSelectionCount(e.r1,e.c1)>0),e.gammaRange?this.renderCell({areaModel:o,areaIdent:o.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:h,top:a,width:u,height:p,parent:i,cellSelected:g,lastRowOfModel:!0,gammaRange:e.gammaRange}):this.renderCell({areaModel:o,areaIdent:o.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:h,top:a,width:u,height:p,parent:i,cellSelected:g,lastRowOfModel:!0,gammaRange:e.gammaRange}),o.areaIdent==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:e.r1,columnIndex:e.c1,cellLeft:h,cellTop:a,cellWidth:u,cellHeight:p,parent:i})}findRowOfImportantRowspanCell(e,t,s){const o=e.getMaxRowspan();for(let i=t-1;i>-1;i--){const r=e.getRowspanAt(i,s);if(r>1&&i+r+1>=t)return i;if(t-i>o)return-1}return-1}adjustColumnsToRowParent({areaIdent:e,sideIdent:t,areaModel:s,geo:o,parent:i,rowIndex:r,columnIndexStart:a,columnIndexEnd:n,verticalFixed:d=!1,lastRowOfModel:c=!1}){var b;this.scrollViewportLeft=this.scrollViewport.scrollLeft;let h=0;if(!d){const f=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();h=this.scrollFactorX*f}const p=0,u=!!(e==="body"&&t);let g=h;for(let f=a;f<=n;f++){const m=g,x=this.tableModel.getColumnWidth(f);if(x>0&&m+x>0){let v=o.height;const E=s.getRowspanAt(r,f),y=s.getColspanAt(r,f);E>1&&(v=this.getRowHeights(r,r+E-1,s).reduce((T,D)=>T+D,0));let S=x;y>1&&(S=this.getColumnWidths(f,f+y-1).reduce((T,D)=>T+D,0));let k=!1;if(this.colAndRowspanModels&&this.colAndRowspanModels[e]&&(b=this.colAndRowspanModels[e])!=null&&b.isInRange(r,f)&&(k=!0),this.draggingTargetColumnIndex===f&&e!=="header"){this.renderDragTargetDiv(i,m,p,S,v);const T={left:m,top:p,width:S,height:v};this.dom.addColumnBorderDivs(this.tableOptions,i,T,e,t)}else{const T=this.renderSelectedBackgroundDiv(k,u,t,s,r,f,i,m,p,S,v);"gammaCells"in s&&s.getValueAt(r,f)&&(k=!1),k||this.renderCell({areaModel:s,areaIdent:e,sideIdent:t,rowIndex:r,columnIndex:f,left:m,top:p,width:S,height:v,parent:i,cellSelected:T,lastRowOfModel:c,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:r,columnIndex:f,cellLeft:m,cellTop:p,cellWidth:S,cellHeight:v,parent:i})}}if(g=g+x,g>this.areaBodyCenterGeo.width)break}this.tableOptions.verticalBorderVisible&&this.dom.addVerticalBorder(new F(g-1,1,o.height,0),i)}getTreeArrowColumnIndex(){return this.tableOptions.showCheckboxWihoutExtraColumn?0:this.tableModel.isRowCheckboxVisible()?1:0}addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:o,index:i,left:r,width:a,height:n,top:d,parent:c,lastRowOfModel:h}){var pe;const u=this.editorRenderer&&this.editorRendererRow===o&&this.editorRendererColumn===i?this.editorRenderer:e.getCellRenderer(o,i),g={left:r,width:a,height:n,top:d,index:i},b=e.getRowByIndex(o);let f="none";if(i===this.getTreeArrowColumnIndex()&&X(b)){const C=b;(pe=C.children)!=null&&pe.length?C.expanded?f="expanded":f="collapsed":f="hidden"}let x;if(t==="header"){const C=this.tableModel.getColumnDef(i);(!(C!=null&&C.sortIconVisible)||C!=null&&C.sortIconVisible())&&(x=C==null?void 0:C.sortState)}const v=e.getValueAt(o,i),E=u?"":`${v}`,y=e.isRowChecked(o),S=this.dom.addColumnDiv({parent:c,geo:g,rowIndex:o,columnIndex:i,areaIdent:t,sideIdent:s,text:E,treeArrow:f,tableOptions:this.tableOptions,checkedType:y,sortState:x}),k=e.getTooltipAt(o,i);k&&this.dom.setAttribute(S,"title",k);const T=this.tableModel.getColumnDef(i);T&&T.classes[t]&&this.dom.addClasses(T.classes[t],S);let D;u&&(D=u.render(S,o,i,t,e,v,this.dom.domService));const _=e.getCustomClassesAt(o,i);if(_.length&&this.dom.addClasses(_,S),this.dom.addColumnBorderDivs(this.tableOptions,c,g,t,s),h&&this.dom.addHorizontalBorder({left:r,width:a,height:n,top:d+n},c),this.getFocusModel&&t==="body"){const C=this.getFocusModel();C!=null&&C.hasFocus(o,i)&&this.dom.addFocusBorderDivs(c,g,{})}t==="header"&&this.dom.setAttribute(S,"data-ge-action","drag-column");const Q=e.getCustomStyleAt(o,i);if(Q)for(const C in Q)this.dom.setStyle(S,C,Q[C]);return[S,D]}applyCssClasses(e,t={}){e&&Object.entries(t).forEach(([s,o])=>{o?this.dom.addClass(s,e):this.dom.removeClass(s,e)})}getColumnWidths(e,t){const s=[];for(let o=e;o<=t;o++)s.push(this.tableModel.getColumnWidth(o));return s}getRowHeights(e,t,s){const o=[];for(let i=e;i<=t;i++)o.push(s.getRowHeight(i));return o}adjustHoverRows(e){if(this.tableOptions.hoverRowVisible&&e.rowIndex>-1){const t=this.hostElement.clientWidth,s=this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex),o=e.rowTop+this.areaHeaderCenter.parent.clientHeight-this.scrollTop;this.dom.applyStyle(this.hoverRow,{left:"0",top:o+"px",width:t+"px",height:s+"px",display:"block"})}else this.hideHoverRow()}hideHoverRow(){this.dom.applyStyle(this.hoverRow,{display:"none"})}adjustHoverColumns(e){if(this.tableOptions.hoverColumnVisible&&e.rowIndex>-1){const t=this.hostElement.clientHeight,s=this.tableModel.getColumnWidth(e.columnIndex),o=this.areaBodyWestGeo.width,i=e.columnLeft+this.tableModel.getPadding().left-this.scrollLeft-o;this.dom.applyStyle(this.hoverColumn,{left:i+"px",top:"0px",width:s+"px",height:t+"px",display:"block"})}else this.hideHoverColumn()}hideHoverColumn(){this.dom.applyStyle(this.hoverColumn,{display:"none"})}debounce(e,t=1e3){this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(e.bind(this),t)}adjustDraggingColumn(e,t,s){var o,i;if(this.dragging){const r=this.hostElement.clientHeight,a=this.storedColumnWidths[t];if((o=e.originalEvent)!=null&&o.clientX){const c={left:((i=e.originalEvent)==null?void 0:i.clientX)-a/2,width:a,height:r,top:0,index:t};this.dom.applyStyle(this.draggingColumn,{background:"rgba(128,128,128,0.2)",display:"block",overfllow:"clip"}),this.dom.applyStyleInPx(this.draggingColumn,c),s&&this.renderContentOfDraggingColumn(c)}}else this.hideDraggingColumn()}renderContentOfDraggingColumn(e){const t=this.renderContentOfDraggingColumnForArea(e,"header",0);this.renderContentOfDraggingColumnForArea(e,"body",t)}renderContentOfDraggingColumnForArea(e,t,s=0){const o="center",i=this.tableModel.getAreaModel(t),r=i==null?void 0:i.getRowCount();if(r){const a=e.index??0,n=this.draggingColumn;for(let d=0;d<r;d++){const c=s,h=i.getRowHeight(d),p={left:0,width:e.width,height:h,top:c,index:d},u=i.getValueAt(d,a),g=i.getCellRenderer(d,a),b=g?"":`${u}`,f={parent:n,geo:p,rowIndex:d,columnIndex:a,areaIdent:t,sideIdent:o,text:b},m=this.dom.addColumnDiv(f);let x;g&&(x=g.render(m,d,a,t,i,u,this.dom.domService),x&&this.cleanupFunctions[t].push(x));const v=i.getCustomClassesAt(d,a);v.length&&this.dom.addClasses(v,m);const E=this.tableModel.getColumnDef(a);E&&E.classes[t]&&this.dom.addClasses(E.classes[t],m),this.dom.addColumnBorderDivs(this.tableOptions,n,p,t,o);const y=i.getCustomStyleAt(d,a);if(y)for(const S in y)this.dom.setStyle(m,S,y[S]);s=s+h}}return s}hideDraggingColumn(){this.dom.applyStyle(this.draggingColumn,{display:"none"})}renderDragTargetDiv(e,t,s,o,i){const r=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass("ge-table-drop-zone",e));return this.dom.setStyle(r,"left",`${t}px`),this.dom.setStyle(r,"top",`${s}px`),this.dom.setStyle(r,"width",`${o}px`),this.dom.setStyle(r,"height",`${i}px`),r}renderSelectedBackgroundDiv(e,t,s,o,i,r,a,n,d,c,h){let p=!1;if(!e&&t&&o.isSelectable(i,r)&&this.getSelectionModel){const u=this.getSelectionModel();if(u){const g=u.getSelectionCount(i,r);p=g>0;for(let b=0;b<g;b++){const f=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`,a));this.dom.setStyle(f,"left",`${n}px`),this.dom.setStyle(f,"top",`${d}px`),this.dom.setStyle(f,"width",`${c}px`),this.dom.setStyle(f,"height",`${h}px`)}}}return p}renderCell({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:o,columnIndex:i,left:r,top:a,width:n,height:d,parent:c,cellSelected:h,lastRowOfModel:p}){const[u,g]=this.addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:o,index:i,left:r,width:n,height:d,top:a,parent:c,lastRowOfModel:p});h&&this.dom.addClass(`ge-table-${t}-${s}-selected-range`,u),g&&this.cleanupFunctions[t].push(g)}renderHeaderCellResizeHandle({rowIndex:e,columnIndex:t,cellLeft:s,cellTop:o,cellWidth:i,cellHeight:r,parent:a}){const n=this.dom.domService,d=this.tableOptions.columnResizeHandleWidthInPx??2,c=n.createElement("div");n.setAttribute(c,"data-col-index",`${t}`),n.setAttribute(c,"data-row-index",`${e}`),n.setAttribute(c,"data-area","header"),n.setAttribute(c,"data-ge-action","resize-column"),n.addClass(c,"ge-table-column-resize-handle"),n.setStyle(c,"display","clip"),n.setStyle(c,"position","absolute"),n.setStyle(c,"cursor","col-resize"),n.setStyle(c,"left",`${s+i-d}px`),n.setStyle(c,"top",`${o}px`),n.setStyle(c,"width",`${d}px`),n.setStyle(c,"height",`${r}px`),n.appendChild(a,c)}}class ft{constructor(e,t){this.columnIndex=e,this.sortState=t}}class ut{constructor(e){this.tableScope=e,this.tableScope.hostElement.addEventListener("change",this.onHostElementChanged.bind(this))}onHostElementChanged(e){if(e.target instanceof HTMLInputElement||e.target instanceof HTMLSelectElement||e.target instanceof HTMLTextAreaElement){const t=e.target,s=t.getAttribute("data-area"),o=t.getAttribute("data-row-index"),i=t.getAttribute("data-col-index");if(s&&o&&i){const r=ne(s),a=Number(o),n=Number(i);this.tableScope.updateModelValueAfterEdit(r,a,n,t.value)}}}}class mt{constructor(e=-1,t=-1){this.rowIndex=e,this.columnIndex=t}}class de{constructor(e){this.cells=e}static createSingle(e,t){return new de([new mt(e,t)])}}class bt{constructor(e){var t,s;this.tableScope=e,(t=this.tableScope.tableOptions)!=null&&t.getSelectionModel&&(this.getSelectionModel=this.tableScope.tableOptions.getSelectionModel),(s=this.tableScope.tableOptions)!=null&&s.getFocusModel&&(this.getFocusModel=this.tableScope.tableOptions.getFocusModel)}onMouseClicked(e,t){var i,r,a,n,d,c,h;let s=!1,o=!1;if(this.getSelectionModel&&this.getFocusModel){const p=this.getSelectionModel(),u=this.getFocusModel();p&&u&&(u.hasFocus(e.rowIndex,e.columnIndex)||(u.setFocus(e.rowIndex,e.columnIndex),this.tableScope.onFocusChanged(u),s=!0),(i=e.originalEvent)!=null&&i.shiftKey||p.hasSelection()&&(p.clear(),s=!0),(r=e.originalEvent)!=null&&r.shiftKey&&this.previousEvt?(p.addSelection(this.createRangeByEvents(e,this.previousEvt)),o=!0,s=!0):(a=e.originalEvent)!=null&&a.altKey&&((n=e.originalEvent)!=null&&n.ctrlKey||(d=e.originalEvent)!=null&&d.metaKey)?(p.removeSelection(A.singleCell(e.rowIndex,e.columnIndex)),o=!0,s=!0):(c=e.originalEvent)!=null&&c.ctrlKey||(h=e.originalEvent)!=null&&h.metaKey?(p.addSelection(A.singleCell(e.rowIndex,e.columnIndex)),o=!0,s=!0):(p.firstClick(e.rowIndex,e.columnIndex),s=!0),this.tableScope.onSelectionChanged(p))}return o?this.previousEvt=void 0:this.previousEvt=e==null?void 0:e.clone(),s}onActionTriggered(e){if(this.getSelectionModel&&this.getFocusModel){const t=this.getSelectionModel(),s=this.getFocusModel();if(t&&s){if(e==="SELECT_ALL")return t.selectAll(),this.tableScope.repaint(),!0;if(e==="DESELECT_ALL")return t.clear(),this.tableScope.repaint(),!0;if(e==="TOGGLE_SELECTION"){const[o,i]=s.getFocus();return t.togglePoint(o,i),this.tableScope.repaint(),!0}}}return!1}createRangeByEvents(e,t){t||(t=e);const s=Math.min(e.rowIndex,t==null?void 0:t.rowIndex),o=Math.max(e.rowIndex,t==null?void 0:t.rowIndex),i=Math.min(e.columnIndex,t==null?void 0:t.columnIndex),r=Math.max(e.columnIndex,t==null?void 0:t.columnIndex);return A.create({rowIndex1:s,columnIndex1:i,rowIndex2:o,columnIndex2:r})}}class St{get(){return{f2:"START_EDITING",space:"TOGGLE_SELECTION","ctrl+num_add":"SELECT_ALL","ctrl+a":"SELECT_ALL","ctrl+shift+a":"DESELECT_ALL","ctrl+x":"DESELECT_ALL","ctrl+num_subtract":"DESELECT_ALL","meta -":"DESELECT_ALL",arrowup:"NAVIGATE_UP",arrowdown:"NAVIGATE_DOWN",arrowleft:"NAVIGATE_LEFT",arrowright:"NAVIGATE_RIGHT","meta+c":"COPY_2_CLIPBOARD","ctrl+c":"COPY_2_CLIPBOARD"}}}class yt{get(){return{f2:"START_EDITING",space:"TOGGLE_SELECTION","ctrl+num_add":"SELECT_ALL","meta+a":"SELECT_ALL","ctrl+a":"SELECT_ALL","meta+x":"DESELECT_ALL","meta+shift+a":"DESELECT_ALL","ctrl+shift+a":"DESELECT_ALL","ctrl+num_subtract":"DESELECT_ALL","ctrl -":"DESELECT_ALL",arrowup:"NAVIGATE_UP",arrowdown:"NAVIGATE_DOWN",arrowleft:"NAVIGATE_LEFT",arrowright:"NAVIGATE_RIGHT","meta+c":"COPY_2_CLIPBOARD","ctrl+c":"COPY_2_CLIPBOARD"}}}function xt(l){return l.trim().replace(/\+/g," ").replace(/ +/g," ").replace(/⌫/g,"backspace").replace(/↩/g,"enter").replace(/⇧/g,"shift").replace(/⌥/g,"alt").replace(/option/g,"alt").replace(/opt/g,"alt").replace(/⌃/g,"ctrl").replace(/control/g,"ctrl").replace(/command/g,"cmd").replace(/meta/g,"cmd").replace(/escape/g,"esc").replace(/⌘/g,"cmd").replace(/\*/g,"multiply").split(" ").filter(e=>e).sort((e,t)=>{const s={cmd:1,ctrl:2,alt:3,shift:4},o=s[e]||5,i=s[t]||5;return o!==i?o-i:e.localeCompare(t)}).join(" ")}function ue(l){let e=l.key.toLowerCase();if(e===" "&&(e="space"),e==="arrowleft"&&(e="left"),e==="arrowright"&&(e="right"),e==="arrowup"&&(e="up"),e==="arrowdown"&&(e="down"),e==="delete"&&l.code==="Delete"&&(e="delete"),e==="backspace"&&(e="backspace"),e==="escape"&&(e="esc"),e==="return"&&(e="enter"),l.code.startsWith("Numpad")){const s=l.code.replace("Numpad","").toLowerCase();s==="add"?e="num_add":s==="subtract"?e="num_subtract":s==="multiply"?e="num_multiply":s==="divide"?e="num_divide":s==="decimal"?e="num_decimal":s==="enter"?e="num_enter":e="num_"+s}l.code.match(/^F\d+$/)&&(e=l.code.toLowerCase()),l.code.match(/^Digit\d+$/)&&(e=l.code.replace(/Digit/g,""));let t="";return l.ctrlKey&&(t+=" ctrl"),l.altKey&&(t+=t+" alt"),l.shiftKey&&(t+=t+" shift"),l.metaKey&&(t+=t+" cmd"),xt(t+" "+e)}class wt{constructor(e){this.tableScope=e,this.shortcutActionIdMapping={},this.listener=[],this.listener.push(e),this.init()}addListener(e){this.listener.includes(e)||this.listener.push(e)}init(){var e,t;(t=(e=this.tableScope)==null?void 0:e.tableOptions)!=null&&t.shortcutActionsDisabled?this.isDebug()&&console.debug("ShortcutService skipped."):(this.assignPredefinedSystemShortcutMappings(),Object.assign(this.shortcutActionIdMapping,this.tableScope.tableOptions.shortcutActionIdMapping),this.isDebug()&&console.debug("ShortcutService",this.shortcutActionIdMapping),this.tableScope.hostElement.addEventListener("keydown",this.onKeyDown.bind(this)))}assignPredefinedSystemShortcutMappings(){this.isMacintosh()?Object.assign(this.shortcutActionIdMapping,new yt().get()):Object.assign(this.shortcutActionIdMapping,new St().get())}isMacintosh(){return navigator.platform.indexOf("Mac")>-1}isDebug(){return this.isLocalhost()}isLocalhost(){return location.hostname==="localhost"||location.hostname==="127.0.0.1"}onKeyDown(e){const t=this.findEntity(e);t&&this.emit(t)&&(e.preventDefault(),e.stopPropagation())}emit(e){this.isDebug()&&console.debug("ShortcutService emit :",e);let t=!1;for(const s of this.listener)s.onActionTriggered(e)&&(t=!0);return t}findEntity(e){const t=ue(e);this.isDebug()&&console.debug("ShortcutService shortcut :",t);for(const s in this.shortcutActionIdMapping)if(ue(e)===t)return this.isDebug()&&console.debug("ShortcutService action :",this.shortcutActionIdMapping[s]),this.shortcutActionIdMapping[s]}getShortcutActionMapping(){return this.shortcutActionIdMapping}}class me{onCheckboxChanged(e){}onContextmenu(e){}onModelChanged(e){}onMouseClicked(e){}onMouseDragging(e){}onMouseDraggingEnd(e){}onMouseMoved(e){}onSelectionChanged(e){}onFocusChanged(e){}}class Re{setStyle(e,t,s){return e.style[t]=s,e}appendText(e,t){const s=this.createText(t);return this.appendChild(e,s),s}addClass(e,t){return t.includes(" ")?t.split(" ").forEach(s=>e.classList.add(s)):e.classList.add(t),e}removeClass(e,t){return t.includes(" ")?t.split(" ").forEach(s=>e.classList.remove(s)):e.classList.remove(t),e}appendChild(e,t){e.appendChild(t)}createElement(e){return document.createElement(e)}createText(e){return document.createTextNode(e)}setAttribute(e,t,s){e.setAttribute(t,s)}}class vt{render(e,t,s,o,i,r,a){if(i.isEditable(t,s)){a.addClass(e,"ge-table-row-input-div");const n=i.getValueAt(t,s);e.innerHTML=`
8
+ class="ge-table-row-checkbox"> `,this.domService.setStyle(i,"display","inline"),this.domService.setStyle(i,"width","inherit"),this.domService.setAttribute(i,"data-row-index",`${o}`),this.domService.appendChild(e,i),i}addLabelDiv(e,t="",s=!1,o=-1,i=-1,r="body"){const a=this.domService.createElement("div");if(this.domService.addClass(a,"ge-table-label-div"),this.domService.setStyle(a,"position","relative"),this.domService.setStyle(a,"background","transparent"),this.domService.setStyle(a,"width","100%"),this.domService.setStyle(a,"height","100%"),this.domService.setAttribute(a,"data-row-index",`${o}`),this.domService.setAttribute(a,"data-col-index",`${i}`),this.domService.setAttribute(a,"data-area",`${r}`),t)if(s){const n=this.domService.createText(t);this.domService.appendChild(a,n)}else{const n=this.domService.createElement("div");this.domService.appendChild(a,n);const d=this.domService.createText(t);this.domService.addClass(n,"ge-table-label"),this.domService.appendChild(n,d),this.domService.setAttribute(n,"data-row-index",`${o}`),this.domService.setAttribute(n,"data-col-index",`${i}`),this.domService.setAttribute(n,"data-area",`${r}`)}return this.domService.appendChild(e,a),a}addSortedIcon(e,t="",s=new Me,o=-1){const i=this.domService.createElement("div");this.domService.addClass(i,"ge-table-sorted-icon-div"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"top","0"),this.domService.setStyle(i,"right","0"),this.domService.setStyle(i,"width","20px"),this.domService.setStyle(i,"background","transparent"),this.domService.setStyle(i,"cursor","pointer"),this.domService.setAttribute(i,"data-col-index",`${o}`),this.domService.setAttribute(i,"data-area","header");let r;t==="asc"?r=s.iconAsc:t==="desc"?r=s.iconDesc:r=s.iconPlaceholder;const a=r.content,n=this.domService.createText(a);this.domService.appendChild(i,n),r.style&&this.applyStyleString(i,r.style);for(const d of r.classes)this.domService.addClass(i,d);return this.domService.appendChild(e,i),i}addArrowDiv(e,t="none",s=new Ae,o=-1,i=-1,r="body"){const a=this.domService.createElement("div");this.domService.addClass(a,"ge-table-tree-arrow-div"),this.domService.setStyle(a,"display","inline-block"),this.domService.setStyle(a,"position",""),this.domService.setStyle(a,"width","20px"),this.domService.setStyle(a,"background","transparent"),this.domService.setStyle(a,"cursor","pointer"),this.domService.setAttribute(a,"data-row-index",`${o}`),this.domService.setAttribute(a,"data-col-index",`${i}`),this.domService.setAttribute(a,"data-area",`${r}`);let n;t==="expanded"?n=s.arrowExpanded:t==="collapsed"?n=s.arrowCollapsed:n=s.arrowPlaceholder;const d=n.content,c=this.domService.createText(d);this.domService.appendChild(a,c),n.style&&this.applyStyleString(a,n.style);for(const h of n.classes)this.domService.addClass(a,h);return this.domService.appendChild(e,a),a}addColumnBorderDivs(e,t,s,o,i){if(e.verticalBorderVisible){const r=`ge-table-${o}-${i}-vertical-border`;this.addVerticalBorder(s,t,r)}if(e.horizontalBorderVisible){const r=`ge-table-${o}-${i}-horizontal-border`;this.addHorizontalBorder(s,t,r)}return t}addHorizontalBorder(e,t,s="ge-table-body-center-horizontal-border"){const o=this.domService.createElement("div");return this.domService.addClass(o,s),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${e.left}px`),this.domService.setStyle(o,"top",`${e.top}px`),this.domService.setStyle(o,"width",`${e.width}px`),this.domService.setStyle(o,"height","1px"),this.domService.appendChild(t,o),o}addFocusBorderDivs(e,t,s){t={...t,width:t.width+1,height:t.height+1};let o=this.domService.createElement("div");return this.domService.addClass(o,"ge-table-focus-border"),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${t.left}px`),this.domService.setStyle(o,"top",`${t.top}px`),this.domService.setStyle(o,"width","1px"),this.domService.setStyle(o,"height",`${t.height}px`),this.domService.setStyle(o,"z-index","9999"),this.applyStyle(o,s),this.domService.appendChild(e,o),o=this.domService.createElement("div"),this.domService.addClass(o,"ge-table-focus-border"),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${t.left+t.width-1}px`),this.domService.setStyle(o,"top",`${t.top}px`),this.domService.setStyle(o,"width","1px"),this.domService.setStyle(o,"height",`${t.height}px`),this.domService.setStyle(o,"z-index","9999"),this.applyStyle(o,s),this.domService.appendChild(e,o),o=this.domService.createElement("div"),this.domService.addClass(o,"ge-table-focus-border"),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${t.left}px`),this.domService.setStyle(o,"top",`${t.top}px`),this.domService.setStyle(o,"width",`${t.width}px`),this.domService.setStyle(o,"height","1px"),this.domService.setStyle(o,"z-index","9999"),this.applyStyle(o,s),this.domService.appendChild(e,o),o=this.domService.createElement("div"),this.domService.addClass(o,"ge-table-focus-border"),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${t.left}px`),this.domService.setStyle(o,"top",`${t.top+t.height-1}px`),this.domService.setStyle(o,"width",`${t.width}px`),this.domService.setStyle(o,"height","1px"),this.domService.setStyle(o,"z-index","9999"),this.applyStyle(o,s),this.domService.appendChild(e,o),e}addVerticalBorder(e,t,s="ge-table-body-center-vertical-border"){const o=this.domService.createElement("div");return this.domService.addClass(o,s),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${e.left}px`),this.domService.setStyle(o,"top",`${e.top}px`),this.domService.setStyle(o,"width","1px"),this.domService.setStyle(o,"height",`${e.height}px`),this.domService.appendChild(t,o),o}addDiv(e,t,s=""){const o=this.domService.createElement("div");return s&&this.domService.addClass(o,s),this.domService.setStyle(o,"display","clip"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"left",`${t.left}px`),this.domService.setStyle(o,"top",`${t.top}px`),this.domService.setStyle(o,"width",`${t.width}px`),this.domService.setStyle(o,"height",`${t.height}px`),this.domService.appendChild(e,o),o}applyStyleString(e,t){const s=t.split(";").map(o=>o.trim()).filter(o=>o);for(const o of s){const[i,r]=o.split(":");this.domService.setStyle(e,i.trim(),r.trim())}}getDivOrCreateDiv(e,t){let s=t.cache[e];return s?(s.innerText="",s):(s=this.domService.createElement("div"),t.cache[e]=s,s)}}const ne=l=>l==="header"?"header":l==="footer"?"footer":"body";class et{constructor(e,t){if(this.rowIdx=-1,this.colIdx=-1,this.action=null,this.inputType=null,this.className="",e!==null&&(e instanceof HTMLDivElement||e instanceof HTMLSpanElement||e instanceof HTMLInputElement)){this.className=e.className,this.action=e.getAttribute("data-ge-action"),this.inputType=e.getAttribute("data-input-type"),this.rowIdx=Number(e.getAttribute("data-row-index")),this.colIdx=Number(e.getAttribute("data-col-index"));const s=e.getAttribute("data-area");if(s&&(this.areaIdent=ne(s),this.areaModel=t.tableModel.getAreaModel(this.areaIdent),this.row=this.areaModel.getRowByIndex(this.rowIdx)),e instanceof HTMLInputElement){const o=e;this.value=o.value}}}}class tt{constructor(e){this.tableScope=e,this.doubleClickDelay=500,this.expandedAll=!0,this.mouseDown=!1,this.dragging=!1,this.lastClicked=0,this.tableScope.hostElement.addEventListener("click",this.onHostElementClicked.bind(this)),this.tableScope.hostElement.addEventListener("dblclick",this.onHostElementDblClicked.bind(this)),this.tableScope.hostElement.addEventListener("mousedown",this.onMouseDown.bind(this)),this.tableScope.hostElement.addEventListener("mousemove",this.onMouseMove.bind(this)),this.tableScope.hostElement.addEventListener("mouseup",this.onMouseUp.bind(this)),this.tableScope.hostElement.addEventListener("contextmenu",this.onContextmenu.bind(this)),this.tableScope.hostElement._MouseHandler="true",this.tableScope.scrollViewport.addEventListener("scroll",this.tableScope.adjustAfterScrolling.bind(this.tableScope)),[window,this.tableScope.hostElement].forEach(t=>t.addEventListener("resize",this.tableScope.adjustContainersAndRows.bind(this.tableScope)))}onContextmenu(e){this.mouseEvent=e;const t=this.tableScope.createGeMouseEvent(this.mouseEvent);this.tableScope.contextmenu(t)}onHostElementClicked(e){const t=Date.now();if(t-this.lastClicked<this.doubleClickDelay)return;this.lastClicked=t;const s=new et(e.target,this.tableScope);if(s.action==="toggleExpandCollapseAll")this.expandedAll=!this.expandedAll,this.tableScope.toggleExpandCollapseAll(this.expandedAll),e.preventDefault(),e.stopPropagation();else if(s.action==="toggleHeaderGroup")this.tableScope.toggleHeaderGroup(s),e.preventDefault(),e.stopPropagation();else if(s.inputType==="checkbox"&&s.areaIdent)this.tableScope.toggleRowCheckbox(s.rowIdx,s.colIdx,s.areaIdent),e.preventDefault(),e.stopPropagation();else if(X(s.row)&&s.areaModel){const o=s.colIdx===this.getArrowColumnIndex()&&e.altKey,i=s.className.includes("ge-table-tree-arrow-div");if(o||i){e.preventDefault(),e.stopPropagation();const r=s.row;r.expanded=!r.expanded,"recalcVisibleTreeRows"in s.areaModel&&s.areaModel.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(r)}}if(s.areaIdent==="body"&&this.tableScope.tableOptions.getFocusModel){const o=this.tableScope.tableOptions.getFocusModel();o==null||o.clear(),o==null||o.setFocus(s.rowIdx,s.colIdx)}this.publishGeMouseEvent(e,1)}onHostElementDblClicked(e){if(this.lastClicked=Date.now(),e.target instanceof HTMLElement){const t=e.target,s=t.getAttribute("data-area"),o=ne(s),i=Number(t.getAttribute("data-row-index")),r=Number(t.getAttribute("data-col-index")),a=this.tableScope.tableModel.getAreaModel(o);if(s&&o==="header")this.tableScope.tableModel.isSortable(r)&&(this.tableScope.clearSelection(),this.tableScope.onHeaderDblClicked(e,i,r));else if(t.getAttribute("data-row-index")){const n=a.getRowByIndex(i);if(s&&o==="body"&&a.isEditable(i,r)&&(this.tableScope.clearSelection(),this.tableScope.initRenderEditor(i,r)),X(n)&&r===this.getArrowColumnIndex()){e.preventDefault(),e.stopPropagation();const d=n;d.expanded=!d.expanded,"recalcVisibleTreeRows"in a&&a.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(d)}}}this.publishGeMouseEvent(e,2)}publishGeMouseEvent(e,t){var s;this.mouseEvent=e,this.geMouseEventOld=(s=this.geMouseEvent)==null?void 0:s.clone(),this.geMouseEvent=this.tableScope.createGeMouseEvent(e),this.geMouseEvent&&(this.geMouseEvent.clickCount=t),this.tableScope.onMouseClicked(this.geMouseEvent,this.geMouseEventOld),this.tableScope.publishGeMouseEvent(this.geMouseEvent)}updateCollapsedExpandedState(e){var s,o,i,r,a;const t=(o=(s=this.tableScope.tableOptions)==null?void 0:s.autoRestoreOptions)==null?void 0:o.getRowId;if(t){const n=(i=this.tableScope.storeStateCollapsedExpandService)==null?void 0:i.collapsedExpandedStateGet().mode,d=n==="collapsed"&&!e.expanded||n==="expanded"&&e.expanded,c=n==="collapsed"&&e.expanded||n==="expanded"&&!e.expanded,h=t(e.data);d?(r=this.tableScope.storeStateCollapsedExpandService)==null||r.collapsedStateIdsPush(h):c&&((a=this.tableScope.storeStateCollapsedExpandService)==null||a.collapsedStateIdsRemove(h))}}getArrowColumnIndex(){return this.tableScope.tableModel.isRowCheckboxVisible()?1:0}onMouseDown(e){this.dragging||(this.mouseEvent=e,this.startMouseEvent=this.tableScope.createGeMouseEvent(this.mouseEvent),this.tableScope.onMouseDown(this.startMouseEvent),this.mouseDown=!0)}onMouseMove(e){this.mouseEvent=e,this.mouseDown?(this.dragging||(this.dragging=!0,this.tableScope.setDragging(!0)),requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))):requestAnimationFrame(this.mouseMoveOnFrame.bind(this))}onMouseUp(e){this.mouseEvent=e,this.dragging&&requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)),this.mouseDown=!1,this.dragging=!1,this.tableScope.setDragging(!1)}mouseDraggingOnFrame(){var e;if(this.mouseEvent){const t=this.tableScope.createGeMouseEvent(this.mouseEvent);(e=this.startMouseEvent)!=null&&e.originalEvent&&(t.draggingX=this.mouseEvent.clientX-this.startMouseEvent.originalEvent.clientX,t.draggingY=this.mouseEvent.clientY-this.startMouseEvent.originalEvent.clientY),this.tableScope.mouseDraggingOnFrame(t,this.startMouseEvent)}}mouseDraggingEndOnFrame(){var e;if(this.mouseEvent){const t=this.tableScope.createGeMouseEvent(this.mouseEvent);(e=this.startMouseEvent)!=null&&e.originalEvent&&(t.draggingX=this.mouseEvent.clientX-this.startMouseEvent.originalEvent.clientX,t.draggingY=this.mouseEvent.clientY-this.startMouseEvent.originalEvent.clientY),this.tableScope.mouseDraggingEndOnFrame(t)}}mouseMoveOnFrame(){if(this.mouseEvent){const e=this.tableScope.createGeMouseEvent(this.mouseEvent);this.tableScope.mouseMove(e)}}}class st{constructor(e,t=[],s=-1){this.areaIdent=e,this.columnDefs=t,this.defaultRowHeight=s,this.rowSelectionModel=void 0,this.yPositions=[],this.cellRenderers=t.map(o=>o.rendererMap[e])}getTextValueAt(e,t){return""+this.getValueAt(e,t)}getTooltipAt(e,t){return""}getCellRenderer(e,t){if(t<this.cellRenderers.length)return this.cellRenderers[t]}getColspanAt(e,t){return 0}getCustomClassesAt(e,t){return[]}getCustomStyleAt(e,t){}getRowspanAt(e,t){return 0}getRowByIndex(e){}isRowCheckable(e){return!0}isRowChecked(e){var s;const t=this.getRowByIndex(e);return(s=this.rowSelectionModel)==null?void 0:s.isRowChecked(t)}setRowChecked(e,t){if(this.rowSelectionModel){const s=this.getRowByIndex(e);this.rowSelectionModel.checkRow(s,t)}}getMaxColspan(){return 31}getMaxRowspan(){return 31}getYPosByRowIndex(e){return this.defaultRowHeight>0?this.defaultRowHeight*e:this.yPositions[e]}init(){!this.yPositions.length&&this.getRowCount()!==void 0&&this.defaultRowHeight===-1&&this.calcYPositions()}isFilterable(){return this.areaIdent==="body"}doSort(e){return!1}isEditable(e,t){var o,i;const s=(o=this.columnDefs)==null?void 0:o[t];return((i=s==null?void 0:s.editable)==null?void 0:i.call(s))??!1}setValue(e,t,s){var a;const o=(a=this.columnDefs[t])==null?void 0:a.editInputPipe;o&&(s=o(s,e,t));const i=this.getRowByIndex(e),r=this.columnDefs[t].property;return r.includes(".")?this.setPropertyValue(i,r.split("."),s):(i[r]=s,!0)}isSelectable(e,t){return!0}changeColumnOrder(e,t){this.arrayMove(this.cellRenderers,e,t)}setPropertyValue(e,t,s){const o=t.shift();if(o){const i=e[o];return i&&t.length?this.setPropertyValue(i,t,s):(e[o]=s,!0)}return!1}arrayMove(e,t,s){const o=e.splice(t,1)[0];return e.splice(s,0,o),e}calcYPositions(){const e=this.getRowCount();this.yPositions=new Array(e+1),this.yPositions[0]=0;for(let t=0;t<e;t++)this.yPositions[t+1]=this.getRowHeight(t)+this.yPositions[t]}}class ot{genericSortComparator(e,t,s){if(typeof e=="number"&&typeof t=="number")return s*(e-t);if(typeof e=="string"&&typeof t=="string")return s*e.localeCompare(t);if(typeof e=="boolean"&&typeof t=="boolean")return s*((e?-1:1)-(t?-1:1));if(e instanceof Date&&t instanceof Date)return s*(e.getTime()-t.getTime());if(e instanceof Array&&t instanceof Array){const o=e,i=t;if(o.length&&i.length)return this.genericSortComparator(o[0],i[0],s)}return s*(""+e).localeCompare(""+t)}}class it extends st{constructor(e,t,s,o=[],i="ge-selected-row",r="ge-focused-row"){super(e,o,s),this.areaIdent=e,this.rows=t,this.defaultRowHeight=s,this.columnDefs=o,this.selectedRowClass=i,this.focusedRowClass=r,this.focusedRowIndex=0,this.sorterService=new ot,this.filteredRows=[...t],this.properties=o.map(a=>a.property)}setRows(e){this.rows=e,this.filteredRows=[...e]}filterRowsByPredict(e){this.rows=this.rows.filter(e),this.filteredRows=this.filteredRows.filter(e)}getRowCount(){var e;return((e=this.filteredRows)==null?void 0:e.length)??0}getValueAt(e,t){const s=this.properties[t];let o=this.filteredRows[e];return X(o)&&(o=o.data),o?this.getValueByT(o,s):""}getFilteredRows(){return this.filteredRows}getAllRows(){return this.rows}getRowHeight(e){return this.defaultRowHeight}getRowByIndex(e){return this.filteredRows[e]}externalFilterChanged(e){this.filteredRows=this.rows?this.rows.filter(e):[]}doSort(e){for(const t of e){const{columnIndex:s,sortState:o}=t,i=o==="asc"?1:o==="desc"?-1:0,r=this.properties[s];this.filteredRows=this.filteredRows.sort(this.genericFlatTableSortComparator(r,i))}return!0}getValueByT(e,t){return t.includes(".")?this.getPropertyValue(e,t.split(".")):e[t]}changeColumnOrder(e,t){this.arrayMove(this.properties,e,t),super.changeColumnOrder(e,t)}getCustomClassesAt(e,t){const s=super.getCustomClassesAt(e,t);return this.getRowByIndex(e).selected&&s.push(this.selectedRowClass),this.focusedRowIndex===e&&s.push(this.focusedRowClass),s}genericFlatTableSortComparator(e,t){const s=this.columnDefs.find(o=>o.property===e);return(o,i)=>{const r=this.getValueByT(o,e),a=this.getValueByT(i,e);return s!=null&&s.sortComparator?t*s.sortComparator(r,a,o,i,t):this.sorterService.genericSortComparator(r,a,t)}}getPropertyValue(e,t){const s=t.shift(),o=e[s];return o&&t.length?this.getPropertyValue(o,t):o}}class rt{constructor(e){this.tableScope=e}updateCells(e,t=!1){this.tableScope.updateCells(e,t)}externalFilterChanged(){this.tableScope.externalFilterChanged()}scrollToPixel(e=0,t=0){this.tableScope.scrollToPixel(e,t)}scrollToIndex(e=0,t=0){this.tableScope.scrollToIndex(e,t)}setHeaderVisible(e=!0){}setColumnVisible(e,t=!0){}isColumnVisible(e){return!0}isHeaderVisible(){return!0}setFooterVisible(e=!0){}isFooterVisible(){return!0}repaint(){this.tableScope.repaint()}repaintHard(){this.tableScope.repaintHard()}recalcColumnWidths(e){this.tableScope.recalcColumnWidths(e)}clearSelection(){this.tableScope.clearSelection(!0)}setSelectionModel(e,t=!0){this.tableScope.setSelectionModel(e,t)}triggerAction(e){this.tableScope.onActionTriggered(e)}getShortcutActionMapping(){return this.tableScope.shortcutService.getShortcutActionMapping()}copyToClipboard(){return this.tableScope.copyService.copyToClipboard(this.tableScope.tableModel,this.tableScope.selectionModel(),this.tableScope.focusModel())}downloadExcel(e="table.xlsx",t=""){const s=[],o=this.tableScope.tableModel.getColumnCount(),i=["header","body","footer"];for(const r of i){const a=this.tableScope.tableModel.getAreaModel(r),n=(a==null?void 0:a.getRowCount())??0;for(let d=0;d<n;d++){const c=[];s.push(c);for(let h=0;h<o;h++)c.push(a.getValueAt(d,h))}}return this.tableScope.excelService.downloadExcel(s,e,t)}getTableScope(){return this.tableScope}getSelectionModel(){return this.tableScope.selectionModel()}autoResizeColumns(e=!0){this.tableScope.autoResizeColumns(e)}recalcWrappers(){this.tableScope.recalcWrappers()}setColumnWidth(e,t){this.tableScope.setColumnWidth(e,t)}getTableModel(){return this.tableScope.tableModel}getBodyModel(){return this.tableScope.tableModel.getBodyModel()}setRows(e){const t=this.getBodyModel();t instanceof it?t.setRows(e):console.warn("setRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof t)}reSort(){this.tableScope.reSort()}getDisplayedRowCount(){return this.tableScope.getDisplayedRowCount()}}class ce{constructor(e){this.getStorageKeyFn=e}autoConvertMapToObject(e){const t={};return e instanceof Map&&e.forEach((o,i)=>{t[o]=i}),t}checkAndPersistItem(e,t){const s=this.getStorageKeyFn;if(s){const o=s();if(o){const i=o+e;if((t+"").includes("Map")){const r=this.autoConvertMapToObject(t);this.persistItem(i,r)}else this.persistItem(i,t)}}}persistItem(e,t){t?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}loadFromLocalStorage(e){const t=localStorage.getItem(e);return t?JSON.parse(t):null}}class lt extends ce{constructor(e){super(e),this.SCROLL_STATE="scrollState",this.scrollOffset=[0,0],this.load()}getScrollOffset(){return this.scrollOffset}updateScrollOffset(e){this.scrollOffset=e,this.checkAndPersistItem(this.SCROLL_STATE,this.scrollOffset)}load(){const e=this.getStorageKeyFn;if(e){const t=e();if(t){const s=t+this.SCROLL_STATE;let o=this.loadFromLocalStorage(s);this.scrollOffset=o||[0,0]}}}}class at{constructor(e="collapsed",t=[],s=!1,o=!1){this.mode=e,this.rowIds=t,this.allCollapsed=s,this.allExpanded=o}}class nt extends ce{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new at,this.load()}collapsedExpandedStateGet(){return this.collapsedExpandedState}collapsedExpandedStateIncludes(e){return this.collapsedExpandedState.rowIds.includes(e)}collapsedStateIdsPush(e){this.collapsedExpandedState.rowIds.includes(e)||(this.collapsedExpandedState.rowIds.push(e),this.collapsedExpandedState.allCollapsed=!1,this.collapsedExpandedState.allExpanded=!1,this.persist())}collapsedStateIdsRemove(e){const t=this.collapsedExpandedState.rowIds.indexOf(e);t!==-1&&(this.collapsedExpandedState.rowIds.splice(t,1),this.collapsedExpandedState.allCollapsed=!1,this.collapsedExpandedState.allExpanded=!1,this.persist())}collapsedStateAll(e){this.collapsedExpandedState.rowIds=[],this.collapsedExpandedState.mode=e?"collapsed":"expanded",this.collapsedExpandedState.allCollapsed=!e,this.collapsedExpandedState.allExpanded=e,this.persist()}load(){const e=this.getStorageKeyFn;if(e){const t=e();if(t){const s=t+this.COLLAPSED_EXPANDED_STATE,o=this.loadFromLocalStorage(s);o&&(this.collapsedExpandedState=o)}}}persist(){this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE,this.collapsedExpandedState)}}class ct extends ce{constructor(e){super(e),this.SORTING_STATE="sortingState",this.sortItems=[],this.load()}getSortItems(){return this.sortItems}setSortItems(e){this.sortItems=e,this.checkAndPersistItem(this.SORTING_STATE,this.sortItems)}load(){const e=this.getStorageKeyFn;if(e){const t=e();if(t){const s=t+this.SORTING_STATE,o=this.loadFromLocalStorage(s);this.sortItems=o||[]}}}}class F{constructor(e=0,t=0,s=0,o=0,i){this.left=e,this.width=t,this.height=s,this.top=o,this.index=i}}class dt{constructor(e,t,s,o){this.hostElement=e,this.tableModel=t,this.dom=s,this.tableOptions=o,this.scrollTop=0,this.areaBodyWestGeo=new F,this.areaBodyCenterGeo=new F,this.areaBodyEastGeo=new F;const i=this.hostElement;i.innerText="",this.dom.setAttribute(i,"tabindex","0"),this.dom.setStyle(this.dom.addClass("ge-table",i),"position","relative"),this.hoverRow=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-hover-row",i)),this.hoverColumn=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-hover-column",i)),this.draggingColumn=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-dragging-column",i)),this.areaHeaderWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-west",i,"header","west"))),this.areaHeaderCenter=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-center",i,"header","center"))),this.areaHeaderEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-east",i,"body","east"))),this.areaBodyWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-body ge-table-body-west",i,"body","west"))),this.areaBodyEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-body ge-table-body-east",i,"body","east"))),this.areaFooterWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-west",i,"footer","west"))),this.areaFooterCenter=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-center",i,"footer","center"))),this.areaFooterEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-east",i,"footer","east"))),this.scrollViewport=s.applyStyleOverflowAuto(this.tableOptions.overflowX??"auto",this.tableOptions.overflowY??"auto",s.applyStyleNoPadding(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-scroll-viewport",i,"body","center")))),this.contentWrapperDiv=s.applyStyleNoPadding(s.applyStylePosistionRelative(s.createDivWithClass("ge-table-scroll-content-wrapper",this.scrollViewport))),this.contentDiv=s.applyStyleNoPadding(s.applyStylePosistionRelative(s.createDivWithClass("ge-table-scroll-content",this.contentWrapperDiv))),this.areaBodyCenter=s.appendRelativeChildDiv(s.createDivWithClass("ge-table-body-center",this.contentDiv)),this.borderHeaderBottom=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-header-border",i)),this.borderFixedWest=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-west-fixed-column-border",i)),this.borderFixedEast=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-east-fixed-column-border",i)),this.borderFooterTop=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-footer-border",i))}adjustContainersAndRows(){const e=this.tableModel.getPadding(),t=this.hostElement.clientWidth,s=this.hostElement.clientHeight;this.dom.applyStyle(this.scrollViewport,{width:`${t-e.left}px`,height:`${s-e.top}px`,top:`${e.top}px`,left:`${e.left}px`}),this.scrollTop=this.scrollViewport.scrollTop,this.dom.applyStyle(this.contentDiv,{width:`${this.scrollViewport.clientWidth}px`,height:`${this.scrollViewport.clientHeight}px`,top:`${this.scrollTop}px`,left:`${this.scrollViewport.scrollLeft}px`}),this.areaBodyWestGeo.width=e.left,this.areaBodyWestGeo.height=s-e.top-e.bottom,this.areaBodyWestGeo.top=e.top,this.areaBodyWestGeo.left=0,this.dom.applyStyleInPx(this.areaBodyWest.parent,this.areaBodyWestGeo),this.tableOptions.fixedWestSeparatorBorderVisible&&this.tableModel.getFixedLeftColumnCount()?this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderFixedWest,{width:"1px",height:`${this.areaBodyWestGeo.height}px`,top:`${this.areaBodyWestGeo.top}px`,left:`${this.areaBodyWestGeo.width}px`})):this.dom.applyDisplayNoneStyle(this.borderFixedWest),this.areaBodyEastGeo.width=e.right,this.areaBodyEastGeo.height=s-e.top-e.bottom,this.areaBodyEastGeo.top=e.top,this.areaBodyEastGeo.left=t-e.right,this.dom.applyStyleInPx(this.areaBodyEast.parent,this.areaBodyEastGeo),this.tableOptions.fixedEastSeparatorBorderVisible&&this.tableModel.getFixedLeftColumnCount()?this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderFixedEast,{width:"1px",height:`${this.areaBodyEastGeo.height}px`,top:`${this.areaBodyEastGeo.top}px`,left:`${this.areaBodyEastGeo.left}px`})):this.dom.applyDisplayNoneStyle(this.borderFixedEast),this.areaBodyCenterGeo.width=t-e.left-e.right,this.areaBodyCenterGeo.height=s-e.top-e.bottom,this.areaBodyCenterGeo.top=0,this.areaBodyCenterGeo.left=0,this.dom.applyStyleInPx(this.areaBodyCenter.parent,this.areaBodyCenterGeo),this.dom.applyStyle(this.areaHeaderCenter.parent,{width:`${t-e.left-e.right}px`,height:`${e.top}px`,top:"0",left:`${e.left}px`}),this.dom.applyStyle(this.areaHeaderWest.parent,{width:`${e.left}px`,height:`${e.top}px`,top:"0",left:"0"}),this.dom.applyStyle(this.areaHeaderEast.parent,{width:`${e.right}px`,height:`${e.top}px`,top:"0",left:`${t-e.right}px`}),this.tableOptions.headerSeparatorBorderVisible&&this.tableModel.isHeaderVisibe()?this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderHeaderBottom,{width:`${t}px`,height:"1px",top:`${e.top}px`,left:"0px"})):this.dom.applyDisplayNoneStyle(this.borderHeaderBottom),this.dom.applyStyle(this.areaFooterWest.parent,{width:`${e.left}px`,height:`${e.bottom}px`,top:`${s-e.bottom}px`,left:"0"}),this.dom.applyStyle(this.areaFooterCenter.parent,{width:`${t-e.left-e.right}px`,height:`${e.bottom}px`,top:`${s-e.bottom}px`,left:`${e.left}px`}),this.dom.applyStyle(this.areaFooterEast.parent,{width:`${e.right}px`,height:`${e.bottom}px`,top:`${s-e.bottom}px`,left:`${t-e.right}px`}),this.tableOptions.footerSeparatorBorderVisible&&this.tableModel.isFooterVisibe()?this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderFooterTop,{width:`${t}px`,height:"1px",top:`${s-e.bottom}px`,left:"0px"})):this.dom.applyDisplayNoneStyle(this.borderFooterTop),this.adjustAfterScrolling()}adjustAfterScrolling(){}resetSizeOfWrapperDiv(){const e=`${this.tableModel.getContentWidthInPixel()}px`,t=`${this.tableModel.getContentHeightInPixel()+1}px`;this.dom.setStyle(this.contentWrapperDiv,"width",e),this.dom.setStyle(this.contentWrapperDiv,"height",t)}}class A{constructor(e,t,s,o,i=!1){this.r1=e,this.c1=t,this.r2=s,this.c2=o,this.gammaRange=i}static create(e){return e.gammaRange===void 0&&(e.gammaRange=!1),new A(e.rowIndex1,e.columnIndex1,e.rowIndex2,e.columnIndex2,e.gammaRange)}static singleCell(e,t){return new A(e,t,e,t)}static singleRow(e){return new A(e,0,e,Number.MAX_SAFE_INTEGER)}static singleColumn(e){return new A(0,e,Number.MAX_SAFE_INTEGER,e)}isInRange(e,t){return e>=this.r1&&e<=this.r2&&t>=this.c1&&t<=this.c2}}class ht{constructor(e,t){this.tableModel=e,this.areaModel=t,this.colAndRowspanRanges=void 0}init(){if(this.areaModel.getMaxColspan()<2&&this.areaModel.getMaxRowspan()<2)return;this.colAndRowspanRanges=[];const e=this.areaModel.getRowCount(),t=this.tableModel.getColumnCount();for(let s=0;s<e;s++)for(let o=0;o<t;o++){let i=this.areaModel.getColspanAt(s,o),r=this.areaModel.getRowspanAt(s,o);if(i>1||r>1){i===0&&(i=1),r===0&&(r=1);const a="gammaCells"in this.areaModel;this.colAndRowspanRanges.push(new A(s,o,s+r-1,o+i-1,a))}}}getRanges(){return this.colAndRowspanRanges?this.colAndRowspanRanges:[]}isInRange(e,t){if(this.colAndRowspanRanges){for(const s of this.colAndRowspanRanges)if(s.isInRange(e,t))return!0}return!1}}class pt{constructor(e,t,s){this.header=e,this.body=t,this.footer=s}}class gt extends dt{constructor(e,t,s,o){var r,a;super(e,t,s,o),this.dragging=!1,this.editing=!1,this.storedColumnWidths=[],this.scrollLeft=0,this.scrollViewportLeft=0,this.scrollFactorY=0,this.scrollFactorX=0,this.cleanupFunctions={header:[],body:[],footer:[]},this.tree=!1,this.colAndRowspanModels=new pt,this.firstVisibleRowIndex=-1,this.draggingTargetColumnIndex=-1,this.removables=[],this.displayedRowCount=0,this.tableModel.getSelectionModel?this.getSelectionModel=this.tableModel.getSelectionModel:(r=this.tableOptions)!=null&&r.getSelectionModel&&(this.getSelectionModel=this.tableOptions.getSelectionModel),(a=this.tableOptions)!=null&&a.getFocusModel&&(this.getFocusModel=this.tableOptions.getFocusModel),re(t.getAreaModel("body"))&&(this.tree=!0),["header","body","footer"].forEach(n=>{var d;this.colAndRowspanModels[n]=new ht(t,t.getAreaModel(n)),(d=this.colAndRowspanModels[n])==null||d.init()})}isEditing(){return this.editing}resetEditorRenderer(){this.editorRenderer=void 0,this.editorRendererRow=-1,this.editorRendererColumn=-1,this.editing=!1}clearSelection(e=!1){if(this.getSelectionModel){const t=this.getSelectionModel();t==null||t.clear(),e&&this.repaint()}}initRenderEditor(e,t){var o;let s=(o=this.tableModel.getColumnDef(t))==null?void 0:o.getEditRenderer;if(s||(s=this.tableOptions.getEditRenderer),s)if(this.editorRenderer=s(e,t),this.editorRenderer){this.editorRendererRow=e,this.editorRendererColumn=t,this.editing=!0,this.repaint();const i=document.querySelector("input.ge-table-cell-editor-input");i&&i.focus()}else this.resetEditorRenderer()}repaint(){this.adjustAfterScrolling()}repaintHard(){this.tableModel.recalcHeightAndPadding(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows(),this.adjustAfterScrolling()}recalcColumnWidths(e){let t=e||this.scrollViewport.clientWidth;this.tableModel.setParentWidth(t),this.tableModel.init(),this.repaintHard()}adjustAfterScrolling(){var e;for(const t of this.removables)t.remove();this.hideHoverRow(),this.hideHoverColumn(),this.scrollTop=this.scrollViewport.scrollTop,this.scrollLeft=this.scrollViewport.scrollLeft,this.debounce(this.checkForScrollPosSaving.bind(this)),this.scrollFactorY=this.scrollTop/(this.scrollViewport.scrollHeight-this.scrollViewport.clientHeight),this.scrollFactorX=this.scrollLeft/(this.scrollViewport.scrollWidth-this.scrollViewport.clientWidth),isNaN(this.scrollFactorY)&&(this.scrollFactorY=0),isNaN(this.scrollFactorX)&&(this.scrollFactorX=0),this.adjustBody(),this.adjustArea("footer"),this.adjustArea("header"),this.tableOptions.tableTopBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new F(0,this.hostElement.clientWidth,1,0),this.hostElement,"ge-table-border")),this.tableOptions.tableBottomBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new F(0,this.hostElement.clientWidth,1,this.hostElement.clientHeight-1),this.hostElement,"ge-table-border")),this.tableModel.getFixedLeftColumnCount()>0&&this.removables.push(this.dom.addVerticalBorder(new F(this.areaBodyWest.child.clientWidth,1,this.hostElement.clientHeight,0),this.hostElement,"ge-table-body-west-vertical-border")),((e=this.tableModel.getAreaModel("header"))==null?void 0:e.getRowCount())>0&&this.removables.push(this.dom.addHorizontalBorder(new F(0,this.hostElement.clientWidth,1,this.areaHeaderCenter.child.clientHeight),this.hostElement,"ge-table-body-west-vertical-border"))}checkForScrollPosSaving(){var e,t;this.storeScrollPosStateService&&((t=(e=this.tableOptions)==null?void 0:e.autoRestoreOptions)!=null&&t.autoRestoreScrollPosition)&&this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft,this.scrollTop])}updateCells(e,t=!1){e.forEach(s=>{this.tableModel.getAreaModel(s.area).setValue(s.rowIndex,s.columnIndex,s.value),t||this.rerenderCellContent(s)}),t&&this.repaint()}rerenderCellContent({area:e,rowIndex:t,columnIndex:s,value:o,cssClasses:i}){const r=this.tableModel.getAreaModel(e),a='div[data-col-index="'+s+'"][data-row-index="'+t+'"][data-area="'+e+'"]',n=document.querySelector(a);if(n){let d;const c=this.editorRenderer&&this.editorRendererRow===t&&this.editorRendererColumn===s;let h;if(c?h=this.editorRenderer:h=r.getCellRenderer(t,s),n.innerText="",this.applyCssClasses(n,i),h)d=h.render(n,t,s,e,r,o,this.dom.domService),d&&this.cleanupFunctions[e].push(d);else{const g=`${o}`;this.dom.addLabelDiv(n,g,!1,t,s,e)}const p=r.getCustomClassesAt(t,s);p.length&&this.dom.addClasses(p,n);const f=r.getCustomStyleAt(t,s);if(f)for(const g in f)this.dom.setStyle(n,g,f[g])}}storeColumnWidths(){const e=this.tableModel.getColumnDefs();e!=null&&e.length&&(this.storedColumnWidths=e.map((t,s)=>this.tableModel.getColumnWidth(s)))}getAreaAndSideIdentByAttr(e){if(e){const t=this.getStringByAttr(e,"data-area"),s=this.getStringByAttr(e,"data-side");if(s&&t)return[t,s]}return[void 0,void 0]}getArea(e,t){if(e==="header"){if(t==="west")return this.areaHeaderWest;if(t==="center")return this.areaHeaderCenter;if(t==="east")return this.areaHeaderEast}else if(e==="body"){if(t==="west")return this.areaBodyWest;if(t==="center")return this.areaBodyCenter;if(t==="east")return this.areaBodyEast}else if(e==="footer"){if(t==="west")return this.areaFooterWest;if(t==="center")return this.areaFooterCenter;if(t==="east")return this.areaFooterEast}throw Error(`Wrong area identifier: row:${e}, col:${t}`)}adjustBody(){const e=this.areaBodyCenterGeo.height-this.tableModel.getContentHeightInPixel(),t=this.scrollFactorY*e;this.dom.setStyle(this.contentDiv,"top",`${this.scrollTop}px`),this.dom.setStyle(this.contentDiv,"left",`${this.scrollViewport.scrollLeft}px`),this.adjustArea("body",t)}getNumberByAttr(e,t){var s;if(e){const o=(s=e.closest("["+t+"]"))==null?void 0:s.getAttribute(t);if(o)return Number(o)}return-1}getStringByAttr(e,t){var s;if(e){const o=(s=e.closest("["+t+"]"))==null?void 0:s.getAttribute(t);if(o)return o}return""}adjustArea(e,t=0){var u;const s=this.getArea(e,"west"),o=this.getArea(e,"center"),i=this.getArea(e,"east"),r=o.child.clientHeight;s.child.innerText="",o.child.innerText="",i.child.innerText="";const a=0,n=this.areaBodyCenterGeo.width,d=this.tableModel.getPadding(),c=this.tableModel.getAreaModel(e),h=c.getRowCount();for(;this.cleanupFunctions[e].length;){const m=this.cleanupFunctions[e].shift();m&&m()}let p=t;const f=this.tableModel.getColumnCount(),g=this.tableModel.getFixedRightColumnCount(),b=this.tableModel.getFixedLeftColumnCount();for(let m=0;m<h;m++){const x=p,C=m===h-1,E=this.tableModel.getRowHeight(e,m);if(x+E>0){this.firstVisibleRowIndex=m;let y={left:a,width:n,height:E,top:x,index:m},S=this.dom.addRowDiv(o,y,m,e,"center");const k=b;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:c,geo:y,parent:S,rowIndex:m,columnIndexStart:k,columnIndexEnd:f-g-1,verticalFixed:!1,lastRowOfModel:C}),d.left>0&&(y={left:a,width:this.areaBodyWestGeo.width,height:E,top:x,index:m},S=this.dom.addRowDiv(s,y,m,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:c,geo:y,parent:S,rowIndex:m,columnIndexStart:0,columnIndexEnd:k-1,verticalFixed:!0,lastRowOfModel:C})),d.right>0&&(y={left:a,width:this.areaBodyEastGeo.width,height:E,top:x,index:m},S=this.dom.addRowDiv(i,y,m,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:c,geo:y,parent:S,rowIndex:m,columnIndexStart:f-g,columnIndexEnd:f-1,verticalFixed:!0,lastRowOfModel:C})),e==="header"&&this.tree&&m===h-1){const T=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(S,new F(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),D=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(D){const _=this.dom.domService.createText(D.content);this.dom.domService.appendChild(T,_),D.style&&this.dom.applyStyleString(T,D.style)}}}if(p=p+E,p>r){e==="body"&&(this.displayedRowCount=this.firstVisibleRowIndex-m);break}}if(this.colAndRowspanModels&&this.colAndRowspanModels[e]){const m=((u=this.colAndRowspanModels[e])==null?void 0:u.getRanges())??[];if(m.length)for(const x of m){let C=0,E=o.child,y="center";if(x.c1<b)E=s.child,y="west";else if(g>0&&x.c1>=f-g)E=i.child,y="east";else{const S=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();C=this.scrollFactorX*S-this.areaBodyWestGeo.width,y="center"}this.drawBigCell(x,C,t,c,E,y)}}}drawBigCell(e,t,s,o,i,r){const a=s+this.getRowHeights(0,e.r1-1,o).reduce((u,m)=>u+m,0),n=this.tableModel.getColumnCount(),d=this.tableModel.getFixedRightColumnCount();let c=0;d>0&&e.c1>=n-d&&(c=n-d);const h=t+this.getColumnWidths(c,e.c1-1).reduce((u,m)=>u+m,0),p=this.getRowHeights(e.r1,e.r2,o).reduce((u,m)=>u+m,0),f=this.getColumnWidths(e.c1,e.c2).reduce((u,m)=>u+m,0);let g=!1;const b=this.getSelectionModel?this.getSelectionModel():void 0;b&&(g=b.getSelectionCount(e.r1,e.c1)>0),e.gammaRange?this.renderCell({areaModel:o,areaIdent:o.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:h,top:a,width:f,height:p,parent:i,cellSelected:g,lastRowOfModel:!0,gammaRange:e.gammaRange}):this.renderCell({areaModel:o,areaIdent:o.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:h,top:a,width:f,height:p,parent:i,cellSelected:g,lastRowOfModel:!0,gammaRange:e.gammaRange}),o.areaIdent==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:e.r1,columnIndex:e.c1,cellLeft:h,cellTop:a,cellWidth:f,cellHeight:p,parent:i})}findRowOfImportantRowspanCell(e,t,s){const o=e.getMaxRowspan();for(let i=t-1;i>-1;i--){const r=e.getRowspanAt(i,s);if(r>1&&i+r+1>=t)return i;if(t-i>o)return-1}return-1}adjustColumnsToRowParent({areaIdent:e,sideIdent:t,areaModel:s,geo:o,parent:i,rowIndex:r,columnIndexStart:a,columnIndexEnd:n,verticalFixed:d=!1,lastRowOfModel:c=!1}){var b;this.scrollViewportLeft=this.scrollViewport.scrollLeft;let h=0;if(!d){const u=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();h=this.scrollFactorX*u}const p=0,f=!!(e==="body"&&t);let g=h;for(let u=a;u<=n;u++){const m=g,x=this.tableModel.getColumnWidth(u);if(x>0&&m+x>0){let C=o.height;const E=s.getRowspanAt(r,u),y=s.getColspanAt(r,u);E>1&&(C=this.getRowHeights(r,r+E-1,s).reduce((T,D)=>T+D,0));let S=x;y>1&&(S=this.getColumnWidths(u,u+y-1).reduce((T,D)=>T+D,0));let k=!1;if(this.colAndRowspanModels&&this.colAndRowspanModels[e]&&(b=this.colAndRowspanModels[e])!=null&&b.isInRange(r,u)&&(k=!0),this.draggingTargetColumnIndex===u&&e!=="header"){this.renderDragTargetDiv(i,m,p,S,C);const T={left:m,top:p,width:S,height:C};this.dom.addColumnBorderDivs(this.tableOptions,i,T,e,t)}else{const T=this.renderSelectedBackgroundDiv(k,f,t,s,r,u,i,m,p,S,C);"gammaCells"in s&&s.getValueAt(r,u)&&(k=!1),k||this.renderCell({areaModel:s,areaIdent:e,sideIdent:t,rowIndex:r,columnIndex:u,left:m,top:p,width:S,height:C,parent:i,cellSelected:T,lastRowOfModel:c,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:r,columnIndex:u,cellLeft:m,cellTop:p,cellWidth:S,cellHeight:C,parent:i})}}if(g=g+x,g>this.areaBodyCenterGeo.width)break}this.tableOptions.verticalBorderVisible&&this.dom.addVerticalBorder(new F(g-1,1,o.height,0),i)}getTreeArrowColumnIndex(){return this.tableOptions.showCheckboxWihoutExtraColumn?0:this.tableModel.isRowCheckboxVisible()?1:0}addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:o,index:i,left:r,width:a,height:n,top:d,parent:c,lastRowOfModel:h}){var pe;const f=this.editorRenderer&&this.editorRendererRow===o&&this.editorRendererColumn===i?this.editorRenderer:e.getCellRenderer(o,i),g={left:r,width:a,height:n,top:d,index:i},b=e.getRowByIndex(o);let u="none";if(i===this.getTreeArrowColumnIndex()&&X(b)){const v=b;(pe=v.children)!=null&&pe.length?v.expanded?u="expanded":u="collapsed":u="hidden"}let x;if(t==="header"){const v=this.tableModel.getColumnDef(i);(!(v!=null&&v.sortIconVisible)||v!=null&&v.sortIconVisible())&&(x=v==null?void 0:v.sortState)}const C=e.getValueAt(o,i),E=f?"":`${C}`,y=e.isRowChecked(o),S=this.dom.addColumnDiv({parent:c,geo:g,rowIndex:o,columnIndex:i,areaIdent:t,sideIdent:s,text:E,treeArrow:u,tableOptions:this.tableOptions,checkedType:y,sortState:x}),k=e.getTooltipAt(o,i);k&&this.dom.setAttribute(S,"title",k);const T=this.tableModel.getColumnDef(i);T&&T.classes[t]&&this.dom.addClasses(T.classes[t],S);let D;f&&(D=f.render(S,o,i,t,e,C,this.dom.domService));const _=e.getCustomClassesAt(o,i);if(_.length&&this.dom.addClasses(_,S),this.dom.addColumnBorderDivs(this.tableOptions,c,g,t,s),h&&this.dom.addHorizontalBorder({left:r,width:a,height:n,top:d+n},c),this.getFocusModel&&t==="body"){const v=this.getFocusModel();v!=null&&v.hasFocus(o,i)&&this.dom.addFocusBorderDivs(c,g,{})}t==="header"&&this.dom.setAttribute(S,"data-ge-action","drag-column");const Q=e.getCustomStyleAt(o,i);if(Q)for(const v in Q)this.dom.setStyle(S,v,Q[v]);return[S,D]}applyCssClasses(e,t={}){e&&Object.entries(t).forEach(([s,o])=>{o?this.dom.addClass(s,e):this.dom.removeClass(s,e)})}getColumnWidths(e,t){const s=[];for(let o=e;o<=t;o++)s.push(this.tableModel.getColumnWidth(o));return s}getRowHeights(e,t,s){const o=[];for(let i=e;i<=t;i++)o.push(s.getRowHeight(i));return o}adjustHoverRows(e){if(this.tableOptions.hoverRowVisible&&e.rowIndex>-1){const t=this.hostElement.clientWidth,s=this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex),o=e.rowTop+this.areaHeaderCenter.parent.clientHeight-this.scrollTop;this.dom.applyStyle(this.hoverRow,{left:"0",top:o+"px",width:t+"px",height:s+"px",display:"block"})}else this.hideHoverRow()}hideHoverRow(){this.dom.applyStyle(this.hoverRow,{display:"none"})}adjustHoverColumns(e){if(this.tableOptions.hoverColumnVisible&&e.rowIndex>-1){const t=this.hostElement.clientHeight,s=this.tableModel.getColumnWidth(e.columnIndex),o=this.areaBodyWestGeo.width,i=e.columnLeft+this.tableModel.getPadding().left-this.scrollLeft-o;this.dom.applyStyle(this.hoverColumn,{left:i+"px",top:"0px",width:s+"px",height:t+"px",display:"block"})}else this.hideHoverColumn()}hideHoverColumn(){this.dom.applyStyle(this.hoverColumn,{display:"none"})}debounce(e,t=1e3){this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(e.bind(this),t)}adjustDraggingColumn(e,t,s){var o,i;if(this.dragging){const r=this.hostElement.clientHeight,a=this.storedColumnWidths[t];if((o=e.originalEvent)!=null&&o.clientX){const c={left:((i=e.originalEvent)==null?void 0:i.clientX)-a/2,width:a,height:r,top:0,index:t};this.dom.applyStyle(this.draggingColumn,{background:"rgba(128,128,128,0.2)",display:"block",overfllow:"clip"}),this.dom.applyStyleInPx(this.draggingColumn,c),s&&this.renderContentOfDraggingColumn(c)}}else this.hideDraggingColumn()}renderContentOfDraggingColumn(e){const t=this.renderContentOfDraggingColumnForArea(e,"header",0);this.renderContentOfDraggingColumnForArea(e,"body",t)}renderContentOfDraggingColumnForArea(e,t,s=0){const o="center",i=this.tableModel.getAreaModel(t),r=i==null?void 0:i.getRowCount();if(r){const a=e.index??0,n=this.draggingColumn;for(let d=0;d<r;d++){const c=s,h=i.getRowHeight(d),p={left:0,width:e.width,height:h,top:c,index:d},f=i.getValueAt(d,a),g=i.getCellRenderer(d,a),b=g?"":`${f}`,u={parent:n,geo:p,rowIndex:d,columnIndex:a,areaIdent:t,sideIdent:o,text:b},m=this.dom.addColumnDiv(u);let x;g&&(x=g.render(m,d,a,t,i,f,this.dom.domService),x&&this.cleanupFunctions[t].push(x));const C=i.getCustomClassesAt(d,a);C.length&&this.dom.addClasses(C,m);const E=this.tableModel.getColumnDef(a);E&&E.classes[t]&&this.dom.addClasses(E.classes[t],m),this.dom.addColumnBorderDivs(this.tableOptions,n,p,t,o);const y=i.getCustomStyleAt(d,a);if(y)for(const S in y)this.dom.setStyle(m,S,y[S]);s=s+h}}return s}hideDraggingColumn(){this.dom.applyStyle(this.draggingColumn,{display:"none"})}renderDragTargetDiv(e,t,s,o,i){const r=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass("ge-table-drop-zone",e));return this.dom.setStyle(r,"left",`${t}px`),this.dom.setStyle(r,"top",`${s}px`),this.dom.setStyle(r,"width",`${o}px`),this.dom.setStyle(r,"height",`${i}px`),r}renderSelectedBackgroundDiv(e,t,s,o,i,r,a,n,d,c,h){let p=!1;if(!e&&t&&o.isSelectable(i,r)&&this.getSelectionModel){const f=this.getSelectionModel();if(f){const g=f.getSelectionCount(i,r);p=g>0;for(let b=0;b<g;b++){const u=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`,a));this.dom.setStyle(u,"left",`${n}px`),this.dom.setStyle(u,"top",`${d}px`),this.dom.setStyle(u,"width",`${c}px`),this.dom.setStyle(u,"height",`${h}px`)}}}return p}renderCell({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:o,columnIndex:i,left:r,top:a,width:n,height:d,parent:c,cellSelected:h,lastRowOfModel:p}){const[f,g]=this.addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:o,index:i,left:r,width:n,height:d,top:a,parent:c,lastRowOfModel:p});h&&this.dom.addClass(`ge-table-${t}-${s}-selected-range`,f),g&&this.cleanupFunctions[t].push(g)}renderHeaderCellResizeHandle({rowIndex:e,columnIndex:t,cellLeft:s,cellTop:o,cellWidth:i,cellHeight:r,parent:a}){const n=this.dom.domService,d=this.tableOptions.columnResizeHandleWidthInPx??2,c=n.createElement("div");n.setAttribute(c,"data-col-index",`${t}`),n.setAttribute(c,"data-row-index",`${e}`),n.setAttribute(c,"data-area","header"),n.setAttribute(c,"data-ge-action","resize-column"),n.addClass(c,"ge-table-column-resize-handle"),n.setStyle(c,"display","clip"),n.setStyle(c,"position","absolute"),n.setStyle(c,"cursor","col-resize"),n.setStyle(c,"left",`${s+i-d}px`),n.setStyle(c,"top",`${o}px`),n.setStyle(c,"width",`${d}px`),n.setStyle(c,"height",`${r}px`),n.appendChild(a,c)}}class ut{constructor(e,t){this.columnIndex=e,this.sortState=t}}class ft{constructor(e){this.tableScope=e,this.tableScope.hostElement.addEventListener("change",this.onHostElementChanged.bind(this))}onHostElementChanged(e){if(e.target instanceof HTMLInputElement||e.target instanceof HTMLSelectElement||e.target instanceof HTMLTextAreaElement){const t=e.target,s=t.getAttribute("data-area"),o=t.getAttribute("data-row-index"),i=t.getAttribute("data-col-index");if(s&&o&&i){const r=ne(s),a=Number(o),n=Number(i);this.tableScope.updateModelValueAfterEdit(r,a,n,t.value)}}}}class mt{constructor(e=-1,t=-1){this.rowIndex=e,this.columnIndex=t}}class de{constructor(e){this.cells=e}static createSingle(e,t){return new de([new mt(e,t)])}}class bt{constructor(e){var t,s;this.tableScope=e,(t=this.tableScope.tableOptions)!=null&&t.getSelectionModel&&(this.getSelectionModel=this.tableScope.tableOptions.getSelectionModel),(s=this.tableScope.tableOptions)!=null&&s.getFocusModel&&(this.getFocusModel=this.tableScope.tableOptions.getFocusModel)}onMouseClicked(e,t){var i,r,a,n,d,c,h;let s=!1,o=!1;if(this.getSelectionModel&&this.getFocusModel){const p=this.getSelectionModel(),f=this.getFocusModel();p&&f&&(f.hasFocus(e.rowIndex,e.columnIndex)||(f.setFocus(e.rowIndex,e.columnIndex),this.tableScope.onFocusChanged(f),s=!0),(i=e.originalEvent)!=null&&i.shiftKey||p.hasSelection()&&(p.clear(),s=!0),(r=e.originalEvent)!=null&&r.shiftKey&&this.previousEvt?(p.addSelection(this.createRangeByEvents(e,this.previousEvt)),o=!0,s=!0):(a=e.originalEvent)!=null&&a.altKey&&((n=e.originalEvent)!=null&&n.ctrlKey||(d=e.originalEvent)!=null&&d.metaKey)?(p.removeSelection(A.singleCell(e.rowIndex,e.columnIndex)),o=!0,s=!0):(c=e.originalEvent)!=null&&c.ctrlKey||(h=e.originalEvent)!=null&&h.metaKey?(p.addSelection(A.singleCell(e.rowIndex,e.columnIndex)),o=!0,s=!0):(p.firstClick(e.rowIndex,e.columnIndex),s=!0),this.tableScope.onSelectionChanged(p))}return o?this.previousEvt=void 0:this.previousEvt=e==null?void 0:e.clone(),s}onActionTriggered(e){if(this.getSelectionModel&&this.getFocusModel){const t=this.getSelectionModel(),s=this.getFocusModel();if(t&&s){if(e==="SELECT_ALL")return t.selectAll(),this.tableScope.repaint(),!0;if(e==="DESELECT_ALL")return t.clear(),this.tableScope.repaint(),!0;if(e==="TOGGLE_SELECTION"){const[o,i]=s.getFocus();return t.togglePoint(o,i),this.tableScope.repaint(),!0}}}return!1}createRangeByEvents(e,t){t||(t=e);const s=Math.min(e.rowIndex,t==null?void 0:t.rowIndex),o=Math.max(e.rowIndex,t==null?void 0:t.rowIndex),i=Math.min(e.columnIndex,t==null?void 0:t.columnIndex),r=Math.max(e.columnIndex,t==null?void 0:t.columnIndex);return A.create({rowIndex1:s,columnIndex1:i,rowIndex2:o,columnIndex2:r})}}class St{get(){return{f2:"START_EDITING",space:"TOGGLE_SELECTION","ctrl+num_add":"SELECT_ALL","ctrl+a":"SELECT_ALL","ctrl+shift+a":"DESELECT_ALL","ctrl+x":"DESELECT_ALL","ctrl+num_subtract":"DESELECT_ALL","meta -":"DESELECT_ALL",arrowup:"NAVIGATE_UP",arrowdown:"NAVIGATE_DOWN",arrowleft:"NAVIGATE_LEFT",arrowright:"NAVIGATE_RIGHT","meta+c":"COPY_2_CLIPBOARD","ctrl+c":"COPY_2_CLIPBOARD"}}}class yt{get(){return{f2:"START_EDITING",space:"TOGGLE_SELECTION","ctrl+num_add":"SELECT_ALL","meta+a":"SELECT_ALL","ctrl+a":"SELECT_ALL","meta+x":"DESELECT_ALL","meta+shift+a":"DESELECT_ALL","ctrl+shift+a":"DESELECT_ALL","ctrl+num_subtract":"DESELECT_ALL","ctrl -":"DESELECT_ALL",arrowup:"NAVIGATE_UP",arrowdown:"NAVIGATE_DOWN",arrowleft:"NAVIGATE_LEFT",arrowright:"NAVIGATE_RIGHT","meta+c":"COPY_2_CLIPBOARD","ctrl+c":"COPY_2_CLIPBOARD"}}}function xt(l){return l.trim().replace(/\+/g," ").replace(/ +/g," ").replace(/⌫/g,"backspace").replace(/↩/g,"enter").replace(/⇧/g,"shift").replace(/⌥/g,"alt").replace(/option/g,"alt").replace(/opt/g,"alt").replace(/⌃/g,"ctrl").replace(/control/g,"ctrl").replace(/command/g,"cmd").replace(/meta/g,"cmd").replace(/escape/g,"esc").replace(/⌘/g,"cmd").replace(/\*/g,"multiply").split(" ").filter(e=>e).sort((e,t)=>{const s={cmd:1,ctrl:2,alt:3,shift:4},o=s[e]||5,i=s[t]||5;return o!==i?o-i:e.localeCompare(t)}).join(" ")}function fe(l){let e=l.key.toLowerCase();if(e===" "&&(e="space"),e==="arrowleft"&&(e="left"),e==="arrowright"&&(e="right"),e==="arrowup"&&(e="up"),e==="arrowdown"&&(e="down"),e==="delete"&&l.code==="Delete"&&(e="delete"),e==="backspace"&&(e="backspace"),e==="escape"&&(e="esc"),e==="return"&&(e="enter"),l.code.startsWith("Numpad")){const s=l.code.replace("Numpad","").toLowerCase();s==="add"?e="num_add":s==="subtract"?e="num_subtract":s==="multiply"?e="num_multiply":s==="divide"?e="num_divide":s==="decimal"?e="num_decimal":s==="enter"?e="num_enter":e="num_"+s}l.code.match(/^F\d+$/)&&(e=l.code.toLowerCase()),l.code.match(/^Digit\d+$/)&&(e=l.code.replace(/Digit/g,""));let t="";return l.ctrlKey&&(t+=" ctrl"),l.altKey&&(t+=t+" alt"),l.shiftKey&&(t+=t+" shift"),l.metaKey&&(t+=t+" cmd"),xt(t+" "+e)}class wt{constructor(e){this.tableScope=e,this.shortcutActionIdMapping={},this.listener=[],this.listener.push(e),this.init()}addListener(e){this.listener.includes(e)||this.listener.push(e)}init(){var e,t;(t=(e=this.tableScope)==null?void 0:e.tableOptions)!=null&&t.shortcutActionsDisabled?this.isDebug()&&console.debug("ShortcutService skipped."):(this.assignPredefinedSystemShortcutMappings(),Object.assign(this.shortcutActionIdMapping,this.tableScope.tableOptions.shortcutActionIdMapping),this.isDebug()&&console.debug("ShortcutService",this.shortcutActionIdMapping),this.tableScope.hostElement.addEventListener("keydown",this.onKeyDown.bind(this)))}assignPredefinedSystemShortcutMappings(){this.isMacintosh()?Object.assign(this.shortcutActionIdMapping,new yt().get()):Object.assign(this.shortcutActionIdMapping,new St().get())}isMacintosh(){return navigator.platform.indexOf("Mac")>-1}isDebug(){return this.isLocalhost()}isLocalhost(){return location.hostname==="localhost"||location.hostname==="127.0.0.1"}onKeyDown(e){const t=this.findEntity(e);t&&this.emit(t)&&(e.preventDefault(),e.stopPropagation())}emit(e){this.isDebug()&&console.debug("ShortcutService emit :",e);let t=!1;for(const s of this.listener)s.onActionTriggered(e)&&(t=!0);return t}findEntity(e){const t=fe(e);this.isDebug()&&console.debug("ShortcutService shortcut :",t);for(const s in this.shortcutActionIdMapping)if(fe(e)===t)return this.isDebug()&&console.debug("ShortcutService action :",this.shortcutActionIdMapping[s]),this.shortcutActionIdMapping[s]}getShortcutActionMapping(){return this.shortcutActionIdMapping}}class me{onCheckboxChanged(e){}onContextmenu(e){}onModelChanged(e){}onMouseClicked(e){}onMouseDragging(e){}onMouseDraggingEnd(e){}onMouseMoved(e){}onSelectionChanged(e){}onFocusChanged(e){}}class Re{setStyle(e,t,s){return e.style[t]=s,e}appendText(e,t){const s=this.createText(t);return this.appendChild(e,s),s}addClass(e,t){return t.includes(" ")?t.split(" ").forEach(s=>e.classList.add(s)):e.classList.add(t),e}removeClass(e,t){return t.includes(" ")?t.split(" ").forEach(s=>e.classList.remove(s)):e.classList.remove(t),e}appendChild(e,t){e.appendChild(t)}createElement(e){return document.createElement(e)}createText(e){return document.createTextNode(e)}setAttribute(e,t,s){e.setAttribute(t,s)}}class Ct{render(e,t,s,o,i,r,a){if(i.isEditable(t,s)){a.addClass(e,"ge-table-row-input-div");const n=i.getValueAt(t,s);e.innerHTML=`
9
9
  <input
10
10
  type="text"
11
11
  value="${n}"
@@ -17,7 +17,7 @@
17
17
  data-col-index="${s}"
18
18
  data-input-type="text"
19
19
  style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
20
- class="ge-table-cell-editor-input">`}}}class Ct{constructor(e="none",t="single"){this.selectionType=e,this.selectionMode=t,this.ranges=[],this.negativeRanges=[],this.allSelected=!1,this.silent=!1,this.listenerArr=[]}getEventSelectionChangedListeners(){return this.listenerArr}addEventSelectionChangedListener(e){this.listenerArr.includes(e)||this.listenerArr.push(e)}removeEventSelectionChangedListener(e){const t=this.listenerArr.indexOf(e,0);t>-1&&this.listenerArr.splice(t,1)}fireChangeEvent(){this.silent||this.listenerArr.forEach(e=>e.onSelectionChanged(this))}firstClick(e,t){this.selectionType==="row"?this.addRange(A.singleRow(e)):this.selectionType==="column"&&this.addRange(A.singleColumn(t))}getSelectionCount(e,t){let s=0;for(const o of this.ranges)o.isInRange(e,t)&&s++;return this.allSelected&&s++,this.isInNegativeRange(e,t)&&(s=0),s}isInNegativeRange(e,t){for(const s of this.negativeRanges)if(s.isInRange(e,t))return!0;return!1}getRanges(){return this.ranges}clear(){this.ranges=[],this.negativeRanges=[],this.allSelected=!1,this.fireChangeEvent()}hasSelection(){return this.allSelected||!!this.ranges.length}hasNoSelection(){return!this.hasSelection()}getMergedRowIndices(){const e=new Set;for(const t of this.ranges)for(let s=t.r1;s<=t.r2;s++)!e.has(s)&&!this.isInNegativeRange(s,0)&&e.add(s);return Array.from(e)}selectAll(){this.allSelected=!0,this.fireChangeEvent()}isAllSelected(){return this.allSelected}addSelection(e){this.addRange(e),this.fireChangeEvent()}removeSelection(e){if(this.selectionType==="none")return;let t=e;this.selectionType==="row"?t=A.singleRow(e.r1):this.selectionType==="column"&&(t=A.singleColumn(e.c1)),this.negativeRanges.push(t),this.fireChangeEvent()}togglePoint(e,t){this.getSelectionCount(e,t)>0?this.removeSelection(A.singleCell(e,t)):this.addSelection(A.singleCell(e,t))}isSelected(e,t){return this.getSelectionCount(e,t)>0}addRange(e){this.selectionType!=="none"&&(this.allSelected=!1,this.selectionMode==="single"&&(this.ranges=[]),this.selectionType==="row"?(e.c1=0,e.c2=Number.MAX_SAFE_INTEGER):this.selectionType==="column"?(e.r1=0,e.r2=Number.MAX_SAFE_INTEGER):this.selectionType==="cell"?(e.r2=e.r1,e.c2=e.c1):this.selectionType,this.ranges.push(e),this.fireChangeEvent())}}class Et{constructor(e="none"){this.selectionType=e,this.rowIndex=-1,this.columnIndex=-1,this.changed=!1,this.listenerArr=[]}getEventFocusChangedListeners(){return this.listenerArr}addEventFocusChangedListener(e){this.listenerArr.includes(e)||this.listenerArr.push(e)}removeEventFocusChangedListener(e){const t=this.listenerArr.indexOf(e,0);t>-1&&this.listenerArr.splice(t,1)}fireChangeEvent(){this.listenerArr.forEach(e=>e.onFocusChanged(this))}clearChanged(){this.changed=!1}hasChanged(){return this.changed}clear(){this.rowIndex=-1,this.columnIndex=-1,this.fireChangeEvent()}setFocus(e,t){(this.rowIndex!==e||this.columnIndex!==t)&&(this.rowIndex=e,this.columnIndex=t,this.changed=!0,this.fireChangeEvent())}hasFocus(e,t){return this.rowIndex===e&&this.columnIndex===t}getFocus(){return[this.rowIndex,this.columnIndex]}}class Te{constructor(e=new I("❯","",["gt-table-icon-expanded"]),t=new I("❯","transform: rotate(180deg) translate(-100%, -100%); transform-origin: 0 0;",["ge-table-icon-collapsed"])){this.iconExpanded=e,this.iconCollapsed=t}}const At=new Ct,Mt=new Et("cell");class De{constructor(){this.overflowX="auto",this.overflowY="auto",this.horizontalBorderVisible=!0,this.verticalBorderVisible=!0,this.footerSeparatorBorderVisible=!0,this.headerSeparatorBorderVisible=!0,this.fixedEastSeparatorBorderVisible=!0,this.fixedWestSeparatorBorderVisible=!0,this.tableTopBorderVisible=!0,this.tableBottomBorderVisible=!0,this.hoverRowVisible=!0,this.hoverColumnVisible=!0,this.columnsResizable=!0,this.columnsDraggable=!0,this.columnResizeHandleWidthInPx=4,this.defaultRowHeights={header:34,body:34,footer:34},this.footerVerticalSeparator=!1,this.headerToggleExpandCollapseIcons=!1,this.headerVerticalSeparator=!1,this.treeOptions=new Ae,this.headerGroupOptions=new Te,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new Me,this.sortOrder=["asc","desc"],this.shortcutActionsDisabled=!1,this.resizeEventDebounceDelay=500,this.getEditRenderer=(e,t)=>new vt,this.getSelectionModel=()=>At,this.getFocusModel=()=>Mt}}const W=class W{createContent(e,t,s){return new Promise((o,i)=>{if(t!=null&&t.hasSelection()){const r=this.mergeRanges(t.getRanges());if(r){r.c2=Math.min(r.c2,e.getColumnCount()-1),r.r2=Math.min(r.r2,e.getBodyModel().getRowCount()-1);const a=[];for(let n=r.r1;n<=r.r2;n++){const d=[];for(let c=r.c1;c<=r.c2;c++){const h=t.isSelected(n,c)?e.getBodyModel().getTextValueAt(n,c):"";d.push(h)}a.push(d.join(W.columnSeparatorChar))}return o(a.join(W.rowSeparatorChar))}}if(s){const[r,a]=s.getFocus(),n=e.getBodyModel().getTextValueAt(r,a);return o(n)}i("Cannot copy, neither selection nor focus defined.")})}copyContent(e){return navigator.clipboard.writeText(e)}copyToClipboard(e,t,s){return new Promise((o,i)=>{this.createContent(e,t,s).then(r=>{r&&this.copyContent(r).then(a=>{o(r)}).catch(a=>{i()})}).catch(r=>{i()})})}mergeRanges(e){let t;for(const s of e)t?(t.r1=Math.min(t.r1,s.r1),t.c1=Math.min(t.c1,s.c1),t.r2=Math.max(t.r2,s.r2),t.c2=Math.max(t.c2,s.c2)):t=new A(s.r1,s.c1,s.r2,s.c2);return t}};W.columnSeparatorChar=" ",W.rowSeparatorChar=`
20
+ class="ge-table-cell-editor-input">`}}}class vt{constructor(e="none",t="single"){this.selectionType=e,this.selectionMode=t,this.ranges=[],this.negativeRanges=[],this.allSelected=!1,this.silent=!1,this.listenerArr=[]}getEventSelectionChangedListeners(){return this.listenerArr}addEventSelectionChangedListener(e){this.listenerArr.includes(e)||this.listenerArr.push(e)}removeEventSelectionChangedListener(e){const t=this.listenerArr.indexOf(e,0);t>-1&&this.listenerArr.splice(t,1)}fireChangeEvent(){this.silent||this.listenerArr.forEach(e=>e.onSelectionChanged(this))}firstClick(e,t){this.selectionType==="row"?this.addRange(A.singleRow(e)):this.selectionType==="column"&&this.addRange(A.singleColumn(t))}getSelectionCount(e,t){let s=0;for(const o of this.ranges)o.isInRange(e,t)&&s++;return this.allSelected&&s++,this.isInNegativeRange(e,t)&&(s=0),s}isInNegativeRange(e,t){for(const s of this.negativeRanges)if(s.isInRange(e,t))return!0;return!1}getRanges(){return this.ranges}clear(){this.ranges=[],this.negativeRanges=[],this.allSelected=!1,this.fireChangeEvent()}hasSelection(){return this.allSelected||!!this.ranges.length}hasNoSelection(){return!this.hasSelection()}getMergedRowIndices(){const e=new Set;for(const t of this.ranges)for(let s=t.r1;s<=t.r2;s++)!e.has(s)&&!this.isInNegativeRange(s,0)&&e.add(s);return Array.from(e)}selectAll(){this.allSelected=!0,this.fireChangeEvent()}isAllSelected(){return this.allSelected}addSelection(e){this.addRange(e),this.fireChangeEvent()}removeSelection(e){if(this.selectionType==="none")return;let t=e;this.selectionType==="row"?t=A.singleRow(e.r1):this.selectionType==="column"&&(t=A.singleColumn(e.c1)),this.negativeRanges.push(t),this.fireChangeEvent()}togglePoint(e,t){this.getSelectionCount(e,t)>0?this.removeSelection(A.singleCell(e,t)):this.addSelection(A.singleCell(e,t))}isSelected(e,t){return this.getSelectionCount(e,t)>0}addRange(e){this.selectionType!=="none"&&(this.allSelected=!1,this.selectionMode==="single"&&(this.ranges=[]),this.selectionType==="row"?(e.c1=0,e.c2=Number.MAX_SAFE_INTEGER):this.selectionType==="column"?(e.r1=0,e.r2=Number.MAX_SAFE_INTEGER):this.selectionType==="cell"?(e.r2=e.r1,e.c2=e.c1):this.selectionType,this.ranges.push(e),this.fireChangeEvent())}}class Et{constructor(e="none"){this.selectionType=e,this.rowIndex=-1,this.columnIndex=-1,this.changed=!1,this.listenerArr=[]}getEventFocusChangedListeners(){return this.listenerArr}addEventFocusChangedListener(e){this.listenerArr.includes(e)||this.listenerArr.push(e)}removeEventFocusChangedListener(e){const t=this.listenerArr.indexOf(e,0);t>-1&&this.listenerArr.splice(t,1)}fireChangeEvent(){this.listenerArr.forEach(e=>e.onFocusChanged(this))}clearChanged(){this.changed=!1}hasChanged(){return this.changed}clear(){this.rowIndex=-1,this.columnIndex=-1,this.fireChangeEvent()}setFocus(e,t){(this.rowIndex!==e||this.columnIndex!==t)&&(this.rowIndex=e,this.columnIndex=t,this.changed=!0,this.fireChangeEvent())}hasFocus(e,t){return this.rowIndex===e&&this.columnIndex===t}getFocus(){return[this.rowIndex,this.columnIndex]}}class Te{constructor(e=new I("❯","",["gt-table-icon-expanded"]),t=new I("❯","transform: rotate(180deg) translate(-100%, -100%); transform-origin: 0 0;",["ge-table-icon-collapsed"])){this.iconExpanded=e,this.iconCollapsed=t}}const At=new vt,Mt=new Et("cell");class De{constructor(){this.overflowX="auto",this.overflowY="auto",this.horizontalBorderVisible=!0,this.verticalBorderVisible=!0,this.footerSeparatorBorderVisible=!0,this.headerSeparatorBorderVisible=!0,this.fixedEastSeparatorBorderVisible=!0,this.fixedWestSeparatorBorderVisible=!0,this.tableTopBorderVisible=!0,this.tableBottomBorderVisible=!0,this.hoverRowVisible=!0,this.hoverColumnVisible=!0,this.columnsResizable=!0,this.columnsDraggable=!0,this.columnResizeHandleWidthInPx=4,this.defaultRowHeights={header:34,body:34,footer:34},this.footerVerticalSeparator=!1,this.headerToggleExpandCollapseIcons=!1,this.headerVerticalSeparator=!1,this.treeOptions=new Ae,this.headerGroupOptions=new Te,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new Me,this.sortOrder=["asc","desc"],this.shortcutActionsDisabled=!1,this.resizeEventDebounceDelay=500,this.getEditRenderer=(e,t)=>new Ct,this.getSelectionModel=()=>At,this.getFocusModel=()=>Mt}}const W=class W{createContent(e,t,s){return new Promise((o,i)=>{if(t!=null&&t.hasSelection()){const r=this.mergeRanges(t.getRanges());if(r){r.c2=Math.min(r.c2,e.getColumnCount()-1),r.r2=Math.min(r.r2,e.getBodyModel().getRowCount()-1);const a=[];for(let n=r.r1;n<=r.r2;n++){const d=[];for(let c=r.c1;c<=r.c2;c++){const h=t.isSelected(n,c)?e.getBodyModel().getTextValueAt(n,c):"";d.push(h)}a.push(d.join(W.columnSeparatorChar))}return o(a.join(W.rowSeparatorChar))}}if(s){const[r,a]=s.getFocus(),n=e.getBodyModel().getTextValueAt(r,a);return o(n)}i("Cannot copy, neither selection nor focus defined.")})}copyContent(e){return navigator.clipboard.writeText(e)}copyToClipboard(e,t,s){return new Promise((o,i)=>{this.createContent(e,t,s).then(r=>{r&&this.copyContent(r).then(a=>{o(r)}).catch(a=>{i()})}).catch(r=>{i()})})}mergeRanges(e){let t;for(const s of e)t?(t.r1=Math.min(t.r1,s.r1),t.c1=Math.min(t.c1,s.c1),t.r2=Math.max(t.r2,s.r2),t.c2=Math.max(t.c2,s.c2)):t=new A(s.r1,s.c1,s.r2,s.c2);return t}};W.columnSeparatorChar=" ",W.rowSeparatorChar=`
21
21
  `;let K=W;class Rt{constructor(e,t=500){this.tableScope=e,this.debounceDelay=t,new ResizeObserver(Ze(this.handleResize.bind(this),t)).observe(this.tableScope.hostElement)}handleResize(e){const t=e[0],{width:s}=t.contentRect;this.tableScope.recalcColumnWidths(s)}}class Tt{downloadExcel(e,t="file.xlsx",s=""){if(!Array.isArray(e)||e.some(o=>!Array.isArray(o)))throw new Error("Invalid matrix format. Expected a 2D array.");if((t==null?void 0:t.trim())==="")throw new Error("Invalid filename. Filename must be a non-empty string.");try{const o=this.generateBuffer(e,s),i=new Blob([o],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),r=document.createElement("a");r.href=URL.createObjectURL(i),r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}catch(o){throw console.error("Error generating Excel file:",o),new Error("Failed to download Excel file.")}}generateMap(e,t=""){const s=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
22
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`,o=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
23
23
  <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Macintosh Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>1</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="1" baseType="lpstr"><vt:lpstr>Sheet1</vt:lpstr></vt:vector></TitlesOfParts><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0300</AppVersion></Properties>`,i=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
@@ -34,7 +34,7 @@
34
34
  <sheetView tabSelected="1" workbookViewId="0"/></sheetViews>
35
35
  <sheetFormatPr baseColWidth="10" defaultRowHeight="16" x14ac:dyDescent="0.2"/>
36
36
  <sheetData>`);for(let s=0;s<e.length;s++){const o=e[s];t.push('<row r="${r + 1}" spans="1:2" x14ac:dyDescent="0.2">');for(let i=0;i<o.length;i++){const r=o[i],a=this.getCellAddress(s,i);if(typeof r=="number")t.push(`<c r="${a}"><v>${r}</v></c>`);else if(r instanceof Date){const n=r;t.push(`<c r="${a}" t="inlineStr"><is><t>${n.toISOString()}</t></is></c>`)}else{const n=r!=null?this.escapeXml(String(r)):"";t.push(`<c r="${a}" t="inlineStr"><is><t>${n}</t></is></c>`)}}t.push("</row>")}return t.push(""),t.push(""),t.push('</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>'),t.push("</worksheet>"),t.join(`
37
- `)}escapeXml(e){return e==null?"":String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}getCellAddress(e,t){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZ";let o="";for(;t>=0;)o=s[t%26]+o,t=Math.floor(t/26)-1;return`${o}${e+1}`}createZip(e){const t=[];let s=0;const o=[];e.forEach((h,p)=>{const u=new TextEncoder().encode(p),g=new TextEncoder().encode(h),b=new Uint8Array(30+u.length),f=new DataView(b.buffer);b.set([80,75,3,4],0),f.setUint16(4,20,!0),f.setUint16(6,0,!0),f.setUint16(8,0,!0),f.setUint16(10,0,!0),f.setUint16(12,0,!0),f.setUint32(14,0,!0),f.setUint32(18,g.length,!0),f.setUint32(22,g.length,!0),f.setUint16(26,u.length,!0),f.setUint16(28,0,!0),b.set(u,30),t.push(b,g),o.push({path:p,offset:s,contentSize:g.length}),s+=b.length+g.length});const i=s;o.forEach(h=>{const p=new TextEncoder().encode(h.path),u=new Uint8Array(46+p.length),g=new DataView(u.buffer);u.set([80,75,1,2],0),g.setUint16(4,20,!0),g.setUint16(6,20,!0),g.setUint16(8,0,!0),g.setUint16(10,0,!0),g.setUint16(12,0,!0),g.setUint16(14,0,!0),g.setUint32(16,0,!0),g.setUint32(20,h.contentSize,!0),g.setUint32(24,h.contentSize,!0),g.setUint16(28,p.length,!0),g.setUint16(30,0,!0),g.setUint16(32,0,!0),g.setUint16(34,0,!0),g.setUint16(36,0,!0),g.setUint32(38,0,!0),g.setUint32(42,h.offset,!0),u.set(p,46),t.push(u),s+=u.length});const r=new Uint8Array(22),a=new DataView(r.buffer);r.set([80,75,5,6],0),a.setUint16(4,0,!0),a.setUint16(6,0,!0),a.setUint16(8,o.length,!0),a.setUint16(10,o.length,!0),a.setUint32(12,s-i,!0),a.setUint32(16,i,!0),a.setUint16(20,0,!0),t.push(r);const n=t.reduce((h,p)=>h+p.length,0),d=new Uint8Array(n);let c=0;for(const h of t)d.set(h,c),c+=h.length;return d}generateBuffer(e,t=""){const s=this.generateMap(e,t);return this.createZip(s)}}class he extends gt{constructor(e,t,s,o,i,r=new K,a=new Tt){var c;if(super(e,t,new Qe(s),o),this.eventListener=i,this.copyService=r,this.excelService=a,this.licenseManager=B.getInstance(),this.selectionService=new bt(this),this.api=new rt(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.lastDragFrom=-1,this.lastDragTo=-1,this.firstDraggingRendering=!0,this.lastContextmenu=Date.now(),t.setTableScope(this),i||(this.eventListener=new me),(c=this.tableOptions)!=null&&c.autoRestoreOptions){const h=this.tableOptions.autoRestoreOptions,p=h.getStorageKeyFn;p&&(h.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new lt(p)),h.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new nt(p)),h.autoRestoreSortingState&&(this.storeSortingService=new ct(p)))}this.mouseHandler=new tt(this),this.inputHandler=new ut(this),this.resizeHandler=new Rt(this,o.resizeEventDebounceDelay),this.shortcutService=new wt(this),this.shortcutService.addListener(this.selectionService);const n=this.getSelectionModel?this.getSelectionModel():void 0;n&&n.addEventSelectionChangedListener(this);const d=this.getFocusModel?this.getFocusModel():void 0;d&&d.addEventFocusChangedListener(this)}static create(e,t,s=new De,o=new me,i=new Re,r=new K){return new he(e,t,i,s,o,r)}onActionTriggered(e){if(e==="NAVIGATE_DOWN"&&this.changeFocusCell(0,1)||e==="NAVIGATE_UP"&&this.changeFocusCell(0,-1)||e==="NAVIGATE_LEFT"&&this.changeFocusCell(-1,0)||e==="NAVIGATE_RIGHT"&&this.changeFocusCell(1,0))return!0;if(e==="START_EDITING"&&this.getFocusModel){const t=this.getFocusModel();if(t){const[s,o]=t.getFocus();this.tableModel.getBodyModel().isEditable(s,o)&&(this.clearSelection(),this.initRenderEditor(s,o))}return!0}if(e==="COPY_2_CLIPBOARD"){const t=this.getSelectionModel?this.getSelectionModel():void 0,s=this.getFocusModel?this.getFocusModel():void 0;this.copyService.createContent(this.tableModel,t,s).then(o=>this.copyService.copyContent(o))}return!1}updateModelValueAfterEdit(e,t,s,o){e==="body"&&this.tableModel.getAreaModel(e).setValue(t,s,o)&&(this.resetEditorRenderer(),this.repaint(),this.eventListener.onModelChanged(de.createSingle(t,s)),this.hostElement.focus())}getApi(){return this.api}firstInit(){var e;return this.tableModel.init(),(e=this.tableOptions)!=null&&e.externalFilterFunction&&this.externalFilterChanged(!1),this.autoRestoreCollapsedExpandedState(),this.autoRestoreSortingState(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows(),this.autoRestoreScrollPosition(),this}createGeMouseEvent(e){const t=new ae;if(t.originalEvent=e,e){const s=e.target;if([t.areaIdent,t.sideIdent]=this.getAreaAndSideIdentByAttr(s),t.rowIndex=this.getNumberByAttr(s,"data-row-index"),t.columnIndex=this.getNumberByAttr(s,"data-col-index"),t.action=this.getStringByAttr(s,"data-ge-action"),t.areaIdent){const o=this.tableModel.getAreaModel(t.areaIdent);t.rowTop=o.getYPosByRowIndex(t.rowIndex)}if(t.columnLeft=this.tableModel.getXPosByColumnIndex(t.columnIndex),e.ctrlKey&&e.altKey){const o=e.clientY-this.hostElement.offsetTop-this.areaHeaderCenter.parent.clientHeight,i=e.clientX-this.hostElement.offsetLeft-this.areaBodyWestGeo.width;this.debugOnce(i,o)}}return t}onMouseDown(e){e.columnIndex>-1&&e.action&&["resize-column","drag-column"].includes(e.action)&&(this.mouseStartWidth=this.tableModel.getColumnWidth(e.columnIndex),this.mouseStartAction=e.action,this.mouseStartColumnIndex=e.columnIndex,this.mouseStartAction==="drag-column"&&(this.firstDraggingRendering=!0,this.dragFrom=this.mouseStartColumnIndex))}mouseDraggingOnFrame(e,t){this.eventListener.onMouseDragging(e),this.mouseEvent=e,this.mouseStartColumnIndex>-1&&this.mouseStartAction==="resize-column"&&this.tableOptions.columnsResizable?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&e.columnIndex>-1&&this.tableOptions.columnsDraggable&&(this.draggingTargetColumnIndex=e.columnIndex,this.dragTo=this.draggingTargetColumnIndex,this.dragFrom>-1&&this.dragTo>-1&&this.dragFrom!==this.dragTo&&(this.lastDragFrom===this.dragTo&&this.lastDragTo===this.dragFrom||(this.tableModel.changeColumnOrder(this.dragFrom,this.dragTo),this.lastDragFrom=this.dragFrom,this.lastDragTo=this.dragTo,this.dragFrom=this.dragTo,this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows())),t&&(this.adjustDraggingColumn(e,t.columnIndex,this.firstDraggingRendering),this.firstDraggingRendering=!1),this.repaint())}mouseDraggingEndOnFrame(e){this.eventListener.onMouseDraggingEnd(e),this.draggingTargetColumnIndex=-1,this.mouseStartAction==="resize-column"?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&(this.hideDraggingColumn(),this.repaint()),this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.firstDraggingRendering=!0,this.mouseStartAction=""}mouseMove(e){this.eventListener.onMouseMoved(e),this.adjustHoverRows(e),this.adjustHoverColumns(e)}contextmenu(e){var s,o;const t=Date.now();if(t-this.lastContextmenu<50){this.lastContextmenu=t,(s=e.originalEvent)==null||s.preventDefault(),(o=e.originalEvent)==null||o.stopImmediatePropagation();return}this.lastContextmenu=t,this.eventListener.onContextmenu(e)}toggleExpandCollapseAll(e=!0){var s;const t=this.tableModel.getBodyModel();re(t)&&(t.toggleExpandCollapseAll(e),this.repaint(),(s=this.storeStateCollapsedExpandService)==null||s.collapsedStateAll(e))}toggleRowCheckbox(e,t,s){var n;const o=this.tableModel.getAreaModel(s),i=o.isRowChecked(e),r=i===void 0||i==="semi"||i==="none";o.setRowChecked(e,r),this.repaint();const a=(n=o.rowSelectionModel)==null?void 0:n.getCheckedRows();this.eventListener.onCheckboxChanged(a||[])}onMouseClicked(e,t){let s=this.selectionService.onMouseClicked(e,t);if(!s&&this.getFocusModel){this.resetEditorRenderer();const o=this.getFocusModel();o&&(s=o.hasChanged(),o.clearChanged())}return s}debounceRepaint(){this.debounce(this.repaint.bind(this),1)}publishGeMouseEvent(e){this.eventListener.onMouseClicked(e)}onFocusChanged(e){this.eventListener.onFocusChanged(e)}onSelectionChanged(e){this.eventListener.onSelectionChanged(e)}externalFilterChanged(e=!0){const t=this.tableOptions.externalFilterFunction;t&&(e&&this.clearSelectionModel(),this.tableModel.externalFilterChanged(t),this.scrollViewport.scrollTo(0,0),this.tableModel.recalcHeightAndPadding(),this.resetSizeOfWrapperDiv(),this.repaint())}onHeaderDblClicked(e,t,s){var i,r;const o=this.tableModel.getColumnDef(s);if(o!=null&&o.sortable&&o.sortable()){e.preventDefault(),e.stopPropagation();const a=o.sortStatesOrder?o.sortStatesOrder:this.tableOptions.sortOrder,n=o.sortState??"",d=a[(a.indexOf(n)+1)%a.length],c=new ft(s,d);this.tableModel.doSort([c])&&((i=this.tableModel.getColumnDefs())==null||i.forEach(p=>p.sortState=""),o.sortState=d),this.repaint(),(r=this.storeSortingService)==null||r.setSortItems([c])}}scrollToPixel(e,t){this.scrollViewport.scrollTo(e,t)}scrollToIndex(e,t){const o=this.tableModel.getAreaModel("body").getYPosByRowIndex(t);this.scrollToPixel(0,o)}setSelectionModel(e,t=!1){const s=()=>e;this.tableOptions.getSelectionModel=s,this.getSelectionModel=s,this.selectionService.getSelectionModel=s,t&&this.repaint()}toggleHeaderGroup(e){const t=this.tableModel.getAreaModel("header");"columnDefs"in this.tableModel&&(this.tableModel.columnDefs=t.toggleHeaderGroup(e),console.info("####### !!!!!! *******, this.tableModel.columnDefs")),this.firstInit()}selectionModel(){if(this!=null&&this.getSelectionModel)return this.getSelectionModel()}focusModel(){if(this!=null&&this.getFocusModel)return this.getFocusModel()}setDragging(e){this.dragging=e,this.dragging?(this.storeColumnWidths(),this.lastDragFrom=-1,this.lastDragTo=-1):this.storedColumnWidths=[]}changeFocusCell(e,t){if(!this.isEditing()&&this.getFocusModel){const s=this.getFocusModel();if(s){const[o,i]=s.getFocus();return s.setFocus(o+t,i+e),this.repaint(),!0}}return!1}resizeColumn(e){this.tableModel.setColumnWidth(this.mouseStartColumnIndex,this.mouseStartWidth+e.draggingX),this.tableModel.recalcPadding(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows()}clearSelectionModel(){var e;this.getSelectionModel&&((e=this.getSelectionModel())==null||e.clear())}debugOnce(e,t){var s;console.clear(),console.info("this.hostElement.offsetTop",this.hostElement.offsetTop),console.info("this.hostElement.scrollHeight",this.hostElement.scrollHeight),console.info("this.scrollViewportTop",this.scrollTop),console.info("this.areaHeaderCenter.parent.clientHeight",this.areaHeaderCenter.parent.clientHeight),console.info("bodyY",t),console.info("bodyX",e),console.info("rows",this.firstVisibleRowIndex),console.info(""),console.info("this.tableModel",this.tableModel),console.info(""),console.info("this.mouseMoveEvent.clientX",(s=this.mouseHandler.mouseEvent)==null?void 0:s.clientX),console.info("this.hostElement.offsetLeft",this.hostElement.offsetLeft),console.info("this.areaBodyWestGeo.width",this.areaBodyWestGeo.width)}autoRestoreScrollPosition(){var e;if((e=this.tableOptions)!=null&&e.autoRestoreOptions&&this.storeScrollPosStateService&&this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition){const s=this.storeScrollPosStateService.getScrollOffset();s&&this.scrollViewport.scrollTo(...s)}}autoRestoreSortingState(){var e,t;if((t=(e=this.tableOptions)==null?void 0:e.autoRestoreOptions)!=null&&t.autoRestoreSortingState&&this.storeSortingService){const s=this.storeSortingService.getSortItems();s!=null&&s.length&&this.tableModel.getBodyModel().doSort(s)}}autoRestoreCollapsedExpandedState(){var e,t;if((t=(e=this.tableOptions)==null?void 0:e.autoRestoreOptions)!=null&&t.getRowId&&this.storeStateCollapsedExpandService){const s=this.tableOptions.autoRestoreOptions,o=s.getRowId;if(s.autoRestoreCollapsedExpandedState&&o){const i=this.storeStateCollapsedExpandService.collapsedExpandedStateGet(),r=this.tableModel.getAreaModel("body");if(re(r)){const a=r,n=r.getRowCount();for(let d=0;d<n;d++){const c=r.getRowByIndex(d);if(c)if(i.allExpanded)c.expanded=!0;else if(i.allCollapsed)c.expanded=!1;else{const h=o(c.data);i.mode==="expanded"?c.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h):i.mode==="collapsed"&&(c.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h))}}a.recalcVisibleTreeRows()}}}}calcAutoColumnWidths(){const e=this.tableModel.getBodyModel(),t=this.tableModel.getColumnCount(),s=(e==null?void 0:e.getRowCount())??0;if(!e)return console.warn("Body model is not available."),[];const o=new Array(t).fill(0);for(let i=0;i<s;i++)for(let r=0;r<t;r++){const a=e.getValueAt(i,r),n=(a==null?void 0:a.toString().length)||0;n>o[r]&&(o[r]=n)}return o.map(i=>Math.max(i*10,50))}setColumnWidth(e,t){this.tableModel.setColumnWidth(e,t)}autoResizeColumns(e=!0){const t=this.calcAutoColumnWidths();for(let s=0;s<t.length;s++){const o=t[s];this.tableModel.setColumnWidth(s,o)}e&&this.recalcWrappers()}recalcWrappers(){this.tableModel.recalcPadding(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows()}reSort(){var t;let e=((t=this.storeSortingService)==null?void 0:t.getSortItems())??[];this.tableModel.doSort(e)}}const Y=class Y{};Y.themes=["light","combat","paper","blackboard"],Y.vars={light:`html[data-theme="light"] {
37
+ `)}escapeXml(e){return e==null?"":String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}getCellAddress(e,t){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZ";let o="";for(;t>=0;)o=s[t%26]+o,t=Math.floor(t/26)-1;return`${o}${e+1}`}createZip(e){const t=[];let s=0;const o=[];e.forEach((h,p)=>{const f=new TextEncoder().encode(p),g=new TextEncoder().encode(h),b=new Uint8Array(30+f.length),u=new DataView(b.buffer);b.set([80,75,3,4],0),u.setUint16(4,20,!0),u.setUint16(6,0,!0),u.setUint16(8,0,!0),u.setUint16(10,0,!0),u.setUint16(12,0,!0),u.setUint32(14,0,!0),u.setUint32(18,g.length,!0),u.setUint32(22,g.length,!0),u.setUint16(26,f.length,!0),u.setUint16(28,0,!0),b.set(f,30),t.push(b,g),o.push({path:p,offset:s,contentSize:g.length}),s+=b.length+g.length});const i=s;o.forEach(h=>{const p=new TextEncoder().encode(h.path),f=new Uint8Array(46+p.length),g=new DataView(f.buffer);f.set([80,75,1,2],0),g.setUint16(4,20,!0),g.setUint16(6,20,!0),g.setUint16(8,0,!0),g.setUint16(10,0,!0),g.setUint16(12,0,!0),g.setUint16(14,0,!0),g.setUint32(16,0,!0),g.setUint32(20,h.contentSize,!0),g.setUint32(24,h.contentSize,!0),g.setUint16(28,p.length,!0),g.setUint16(30,0,!0),g.setUint16(32,0,!0),g.setUint16(34,0,!0),g.setUint16(36,0,!0),g.setUint32(38,0,!0),g.setUint32(42,h.offset,!0),f.set(p,46),t.push(f),s+=f.length});const r=new Uint8Array(22),a=new DataView(r.buffer);r.set([80,75,5,6],0),a.setUint16(4,0,!0),a.setUint16(6,0,!0),a.setUint16(8,o.length,!0),a.setUint16(10,o.length,!0),a.setUint32(12,s-i,!0),a.setUint32(16,i,!0),a.setUint16(20,0,!0),t.push(r);const n=t.reduce((h,p)=>h+p.length,0),d=new Uint8Array(n);let c=0;for(const h of t)d.set(h,c),c+=h.length;return d}generateBuffer(e,t=""){const s=this.generateMap(e,t);return this.createZip(s)}}class he extends gt{constructor(e,t,s,o,i,r=new K,a=new Tt){var c;if(super(e,t,new Qe(s),o),this.eventListener=i,this.copyService=r,this.excelService=a,this.licenseManager=B.getInstance(),this.selectionService=new bt(this),this.api=new rt(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.lastDragFrom=-1,this.lastDragTo=-1,this.firstDraggingRendering=!0,this.lastContextmenu=Date.now(),t.setTableScope(this),i||(this.eventListener=new me),(c=this.tableOptions)!=null&&c.autoRestoreOptions){const h=this.tableOptions.autoRestoreOptions,p=h.getStorageKeyFn;p&&(h.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new lt(p)),h.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new nt(p)),h.autoRestoreSortingState&&(this.storeSortingService=new ct(p)))}this.mouseHandler=new tt(this),this.inputHandler=new ft(this),this.resizeHandler=new Rt(this,o.resizeEventDebounceDelay),this.shortcutService=new wt(this),this.shortcutService.addListener(this.selectionService);const n=this.getSelectionModel?this.getSelectionModel():void 0;n&&n.addEventSelectionChangedListener(this);const d=this.getFocusModel?this.getFocusModel():void 0;d&&d.addEventFocusChangedListener(this)}static create(e,t,s=new De,o=new me,i=new Re,r=new K){return new he(e,t,i,s,o,r)}onActionTriggered(e){if(e==="NAVIGATE_DOWN"&&this.changeFocusCell(0,1)||e==="NAVIGATE_UP"&&this.changeFocusCell(0,-1)||e==="NAVIGATE_LEFT"&&this.changeFocusCell(-1,0)||e==="NAVIGATE_RIGHT"&&this.changeFocusCell(1,0))return!0;if(e==="START_EDITING"&&this.getFocusModel){const t=this.getFocusModel();if(t){const[s,o]=t.getFocus();this.tableModel.getBodyModel().isEditable(s,o)&&(this.clearSelection(),this.initRenderEditor(s,o))}return!0}if(e==="COPY_2_CLIPBOARD"){const t=this.getSelectionModel?this.getSelectionModel():void 0,s=this.getFocusModel?this.getFocusModel():void 0;this.copyService.createContent(this.tableModel,t,s).then(o=>this.copyService.copyContent(o))}return!1}updateModelValueAfterEdit(e,t,s,o){e==="body"&&this.tableModel.getAreaModel(e).setValue(t,s,o)&&(this.resetEditorRenderer(),this.repaint(),this.eventListener.onModelChanged(de.createSingle(t,s)),this.hostElement.focus())}getApi(){return this.api}firstInit(){var e;return this.tableModel.init(),(e=this.tableOptions)!=null&&e.externalFilterFunction&&this.externalFilterChanged(!1),this.autoRestoreCollapsedExpandedState(),this.autoRestoreSortingState(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows(),this.autoRestoreScrollPosition(),this}createGeMouseEvent(e){const t=new ae;if(t.originalEvent=e,e){const s=e.target;if([t.areaIdent,t.sideIdent]=this.getAreaAndSideIdentByAttr(s),t.rowIndex=this.getNumberByAttr(s,"data-row-index"),t.columnIndex=this.getNumberByAttr(s,"data-col-index"),t.action=this.getStringByAttr(s,"data-ge-action"),t.areaIdent){const o=this.tableModel.getAreaModel(t.areaIdent);t.rowTop=o.getYPosByRowIndex(t.rowIndex)}if(t.columnLeft=this.tableModel.getXPosByColumnIndex(t.columnIndex),e.ctrlKey&&e.altKey){const o=e.clientY-this.hostElement.offsetTop-this.areaHeaderCenter.parent.clientHeight,i=e.clientX-this.hostElement.offsetLeft-this.areaBodyWestGeo.width;this.debugOnce(i,o)}}return t}onMouseDown(e){e.columnIndex>-1&&e.action&&["resize-column","drag-column"].includes(e.action)&&(this.mouseStartWidth=this.tableModel.getColumnWidth(e.columnIndex),this.mouseStartAction=e.action,this.mouseStartColumnIndex=e.columnIndex,this.mouseStartAction==="drag-column"&&(this.firstDraggingRendering=!0,this.dragFrom=this.mouseStartColumnIndex))}mouseDraggingOnFrame(e,t){this.eventListener.onMouseDragging(e),this.mouseEvent=e,this.mouseStartColumnIndex>-1&&this.mouseStartAction==="resize-column"&&this.tableOptions.columnsResizable?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&e.columnIndex>-1&&this.tableOptions.columnsDraggable&&(this.draggingTargetColumnIndex=e.columnIndex,this.dragTo=this.draggingTargetColumnIndex,this.dragFrom>-1&&this.dragTo>-1&&this.dragFrom!==this.dragTo&&(this.lastDragFrom===this.dragTo&&this.lastDragTo===this.dragFrom||(this.tableModel.changeColumnOrder(this.dragFrom,this.dragTo),this.lastDragFrom=this.dragFrom,this.lastDragTo=this.dragTo,this.dragFrom=this.dragTo,this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows())),t&&(this.adjustDraggingColumn(e,t.columnIndex,this.firstDraggingRendering),this.firstDraggingRendering=!1),this.repaint())}mouseDraggingEndOnFrame(e){this.eventListener.onMouseDraggingEnd(e),this.draggingTargetColumnIndex=-1,this.mouseStartAction==="resize-column"?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&(this.hideDraggingColumn(),this.repaint()),this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.firstDraggingRendering=!0,this.mouseStartAction=""}mouseMove(e){this.eventListener.onMouseMoved(e),this.adjustHoverRows(e),this.adjustHoverColumns(e)}contextmenu(e){var s,o;const t=Date.now();if(t-this.lastContextmenu<50){this.lastContextmenu=t,(s=e.originalEvent)==null||s.preventDefault(),(o=e.originalEvent)==null||o.stopImmediatePropagation();return}this.lastContextmenu=t,this.eventListener.onContextmenu(e)}toggleExpandCollapseAll(e=!0){var s;const t=this.tableModel.getBodyModel();re(t)&&(t.toggleExpandCollapseAll(e),this.repaint(),(s=this.storeStateCollapsedExpandService)==null||s.collapsedStateAll(e))}toggleRowCheckbox(e,t,s){var n;const o=this.tableModel.getAreaModel(s),i=o.isRowChecked(e),r=i===void 0||i==="semi"||i==="none";o.setRowChecked(e,r),this.repaint();const a=(n=o.rowSelectionModel)==null?void 0:n.getCheckedRows();this.eventListener.onCheckboxChanged(a||[])}onMouseClicked(e,t){let s=this.selectionService.onMouseClicked(e,t);if(!s&&this.getFocusModel){this.resetEditorRenderer();const o=this.getFocusModel();o&&(s=o.hasChanged(),o.clearChanged())}return s}debounceRepaint(){this.debounce(this.repaint.bind(this),1)}publishGeMouseEvent(e){this.eventListener.onMouseClicked(e)}onFocusChanged(e){this.eventListener.onFocusChanged(e)}onSelectionChanged(e){this.eventListener.onSelectionChanged(e)}externalFilterChanged(e=!0){const t=this.tableOptions.externalFilterFunction;t&&(e&&this.clearSelectionModel(),this.tableModel.externalFilterChanged(t),this.scrollViewport.scrollTo(0,0),this.tableModel.recalcHeightAndPadding(),this.resetSizeOfWrapperDiv(),this.repaint())}onHeaderDblClicked(e,t,s){var i,r;const o=this.tableModel.getColumnDef(s);if(o!=null&&o.sortable&&o.sortable()){e.preventDefault(),e.stopPropagation();const a=o.sortStatesOrder?o.sortStatesOrder:this.tableOptions.sortOrder,n=o.sortState??"",d=a[(a.indexOf(n)+1)%a.length],c=new ut(s,d);this.tableModel.doSort([c])&&((i=this.tableModel.getColumnDefs())==null||i.forEach(p=>p.sortState=""),o.sortState=d),this.repaint(),(r=this.storeSortingService)==null||r.setSortItems([c])}}scrollToPixel(e,t){this.scrollViewport.scrollTo(e,t)}scrollToIndex(e,t){const o=this.tableModel.getAreaModel("body").getYPosByRowIndex(t);this.scrollToPixel(0,o)}setSelectionModel(e,t=!1){const s=()=>e;this.tableOptions.getSelectionModel=s,this.getSelectionModel=s,this.selectionService.getSelectionModel=s,t&&this.repaint()}toggleHeaderGroup(e){const t=this.tableModel.getAreaModel("header");"columnDefs"in this.tableModel&&(this.tableModel.columnDefs=t.toggleHeaderGroup(e),console.info("####### !!!!!! *******, this.tableModel.columnDefs")),this.firstInit()}selectionModel(){if(this!=null&&this.getSelectionModel)return this.getSelectionModel()}focusModel(){if(this!=null&&this.getFocusModel)return this.getFocusModel()}setDragging(e){this.dragging=e,this.dragging?(this.storeColumnWidths(),this.lastDragFrom=-1,this.lastDragTo=-1):this.storedColumnWidths=[]}changeFocusCell(e,t){if(!this.isEditing()&&this.getFocusModel){const s=this.getFocusModel();if(s){const[o,i]=s.getFocus();return s.setFocus(o+t,i+e),this.repaint(),!0}}return!1}resizeColumn(e){this.tableModel.setColumnWidth(this.mouseStartColumnIndex,this.mouseStartWidth+e.draggingX),this.tableModel.recalcPadding(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows()}clearSelectionModel(){var e;this.getSelectionModel&&((e=this.getSelectionModel())==null||e.clear())}debugOnce(e,t){var s;console.clear(),console.info("this.hostElement.offsetTop",this.hostElement.offsetTop),console.info("this.hostElement.scrollHeight",this.hostElement.scrollHeight),console.info("this.scrollViewportTop",this.scrollTop),console.info("this.areaHeaderCenter.parent.clientHeight",this.areaHeaderCenter.parent.clientHeight),console.info("bodyY",t),console.info("bodyX",e),console.info("rows",this.firstVisibleRowIndex),console.info(""),console.info("this.tableModel",this.tableModel),console.info(""),console.info("this.mouseMoveEvent.clientX",(s=this.mouseHandler.mouseEvent)==null?void 0:s.clientX),console.info("this.hostElement.offsetLeft",this.hostElement.offsetLeft),console.info("this.areaBodyWestGeo.width",this.areaBodyWestGeo.width)}autoRestoreScrollPosition(){var e;if((e=this.tableOptions)!=null&&e.autoRestoreOptions&&this.storeScrollPosStateService&&this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition){const s=this.storeScrollPosStateService.getScrollOffset();s&&this.scrollViewport.scrollTo(...s)}}autoRestoreSortingState(){var e,t;if((t=(e=this.tableOptions)==null?void 0:e.autoRestoreOptions)!=null&&t.autoRestoreSortingState&&this.storeSortingService){const s=this.storeSortingService.getSortItems();s!=null&&s.length&&this.tableModel.getBodyModel().doSort(s)}}autoRestoreCollapsedExpandedState(){var e,t;if((t=(e=this.tableOptions)==null?void 0:e.autoRestoreOptions)!=null&&t.getRowId&&this.storeStateCollapsedExpandService){const s=this.tableOptions.autoRestoreOptions,o=s.getRowId;if(s.autoRestoreCollapsedExpandedState&&o){const i=this.storeStateCollapsedExpandService.collapsedExpandedStateGet(),r=this.tableModel.getAreaModel("body");if(re(r)){const a=r,n=r.getRowCount();for(let d=0;d<n;d++){const c=r.getRowByIndex(d);if(c)if(i.allExpanded)c.expanded=!0;else if(i.allCollapsed)c.expanded=!1;else{const h=o(c.data);i.mode==="expanded"?c.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h):i.mode==="collapsed"&&(c.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h))}}a.recalcVisibleTreeRows()}}}}calcAutoColumnWidths(){const e=this.tableModel.getBodyModel(),t=this.tableModel.getColumnCount(),s=(e==null?void 0:e.getRowCount())??0;if(!e)return console.warn("Body model is not available."),[];const o=new Array(t).fill(0);for(let i=0;i<s;i++)for(let r=0;r<t;r++){const a=e.getValueAt(i,r),n=(a==null?void 0:a.toString().length)||0;n>o[r]&&(o[r]=n)}return o.map(i=>Math.max(i*10,50))}setColumnWidth(e,t){this.tableModel.setColumnWidth(e,t)}autoResizeColumns(e=!0){const t=this.calcAutoColumnWidths();for(let s=0;s<t.length;s++){const o=t[s];this.tableModel.setColumnWidth(s,o)}e&&this.recalcWrappers()}recalcWrappers(){this.tableModel.recalcPadding(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows()}reSort(){var t;let e=((t=this.storeSortingService)==null?void 0:t.getSortItems())??[];this.tableModel.doSort(e)}getDisplayedRowCount(){return this.displayedRowCount}}const Y=class Y{};Y.themes=["light","combat","paper","blackboard"],Y.vars={light:`html[data-theme="light"] {
38
38
  --ge-table-bg: rgba(255,255,255, 0.5);
39
39
  --ge-table-header-west-bg: rgba(233, 233, 233, 0.5);
40
40
  --ge-table-header-center-bg: rgba(233, 233, 233, 0.5);
package/index.js CHANGED
@@ -69,7 +69,7 @@ function He(l, e, t) {
69
69
  return (!l.comparator || !l.comparator(s, e)) && (l.value = e, l.observers && l.observers.length && V(() => {
70
70
  for (let o = 0; o < l.observers.length; o += 1) {
71
71
  const i = l.observers[o], r = ee && ee.running;
72
- r && ee.disposed.has(i), (r ? !i.tState : !i.state) && (i.pure ? M.push(i) : O.push(i), i.observers && ve(i)), r || (i.state = L);
72
+ r && ee.disposed.has(i), (r ? !i.tState : !i.state) && (i.pure ? M.push(i) : O.push(i), i.observers && Ce(i)), r || (i.state = L);
73
73
  }
74
74
  if (M.length > 1e6)
75
75
  throw M = [], new Error();
@@ -92,7 +92,7 @@ function $e(l, e, t) {
92
92
  try {
93
93
  s = l.fn(e);
94
94
  } catch (r) {
95
- return l.pure && (l.state = L, l.owned && l.owned.forEach(H), l.owned = null), l.updatedAt = t + 1, Ce(r);
95
+ return l.pure && (l.state = L, l.owned && l.owned.forEach(H), l.owned = null), l.updatedAt = t + 1, ve(r);
96
96
  } finally {
97
97
  w = i, R = o;
98
98
  }
@@ -137,7 +137,7 @@ function V(l, e) {
137
137
  const s = l();
138
138
  return Ve(t), s;
139
139
  } catch (s) {
140
- t || (O = null), M = null, Ce(s);
140
+ t || (O = null), M = null, ve(s);
141
141
  }
142
142
  }
143
143
  function Ve(l) {
@@ -166,10 +166,10 @@ function U(l, e) {
166
166
  }
167
167
  }
168
168
  }
169
- function ve(l) {
169
+ function Ce(l) {
170
170
  for (let e = 0; e < l.observers.length; e += 1) {
171
171
  const t = l.observers[e];
172
- t.state || (t.state = G, t.pure ? M.push(t) : O.push(t), t.observers && ve(t));
172
+ t.state || (t.state = G, t.pure ? M.push(t) : O.push(t), t.observers && Ce(t));
173
173
  }
174
174
  }
175
175
  function H(l) {
@@ -201,7 +201,7 @@ function Ne(l) {
201
201
  cause: l
202
202
  });
203
203
  }
204
- function Ce(l, e = R) {
204
+ function ve(l, e = R) {
205
205
  throw Ne(l);
206
206
  }
207
207
  function N() {
@@ -994,8 +994,8 @@ class tt {
994
994
  }
995
995
  }
996
996
  class st extends et {
997
- constructor(e, t, s, o = []) {
998
- super(e, o, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = o, this.focusedRowIndex = 0, this.sorterService = new tt(), this.filteredRows = [...t], this.properties = o.map((i) => i.property);
997
+ constructor(e, t, s, o = [], i = "ge-selected-row", r = "ge-focused-row") {
998
+ super(e, o, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = o, this.selectedRowClass = i, this.focusedRowClass = r, this.focusedRowIndex = 0, this.sorterService = new tt(), this.filteredRows = [...t], this.properties = o.map((a) => a.property);
999
999
  }
1000
1000
  setRows(e) {
1001
1001
  this.rows = e, this.filteredRows = [...e];
@@ -1003,6 +1003,9 @@ class st extends et {
1003
1003
  filterRowsByPredict(e) {
1004
1004
  this.rows = this.rows.filter(e), this.filteredRows = this.filteredRows.filter(e);
1005
1005
  }
1006
+ /**
1007
+ * return row count of filtered rows
1008
+ */
1006
1009
  getRowCount() {
1007
1010
  var e;
1008
1011
  return ((e = this.filteredRows) == null ? void 0 : e.length) ?? 0;
@@ -1048,7 +1051,7 @@ class st extends et {
1048
1051
  }
1049
1052
  getCustomClassesAt(e, t) {
1050
1053
  const s = super.getCustomClassesAt(e, t);
1051
- return this.getRowByIndex(e).selected && s.push("ge-selected-row"), this.focusedRowIndex === e && s.push("ge-focused-row"), s;
1054
+ return this.getRowByIndex(e).selected && s.push(this.selectedRowClass), this.focusedRowIndex === e && s.push(this.focusedRowClass), s;
1052
1055
  }
1053
1056
  genericFlatTableSortComparator(e, t) {
1054
1057
  const s = this.columnDefs.find((o) => o.property === e);
@@ -1298,6 +1301,9 @@ class ot {
1298
1301
  reSort() {
1299
1302
  this.tableScope.reSort();
1300
1303
  }
1304
+ getDisplayedRowCount() {
1305
+ return this.tableScope.getDisplayedRowCount();
1306
+ }
1301
1307
  }
1302
1308
  class ce {
1303
1309
  constructor(e) {
@@ -1704,7 +1710,7 @@ class ht extends nt {
1704
1710
  header: [],
1705
1711
  body: [],
1706
1712
  footer: []
1707
- }, this.tree = !1, this.colAndRowspanModels = new dt(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (a = this.tableOptions) != null && a.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), re(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
1713
+ }, this.tree = !1, this.colAndRowspanModels = new dt(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.displayedRowCount = 0, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (a = this.tableOptions) != null && a.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), re(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
1708
1714
  (n) => {
1709
1715
  var d;
1710
1716
  this.colAndRowspanModels[n] = new ct(t, t.getAreaModel(n)), (d = this.colAndRowspanModels[n]) == null || d.init();
@@ -1969,7 +1975,7 @@ class ht extends nt {
1969
1975
  let p = t;
1970
1976
  const u = this.tableModel.getColumnCount(), g = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
1971
1977
  for (let m = 0; m < h; m++) {
1972
- const x = p, v = m === h - 1, E = this.tableModel.getRowHeight(e, m);
1978
+ const x = p, C = m === h - 1, E = this.tableModel.getRowHeight(e, m);
1973
1979
  if (x + E > 0) {
1974
1980
  this.firstVisibleRowIndex = m;
1975
1981
  let y = { left: a, width: n, height: E, top: x, index: m }, S = this.dom.addRowDiv(o, y, m, e, "center");
@@ -1984,7 +1990,7 @@ class ht extends nt {
1984
1990
  columnIndexStart: k,
1985
1991
  columnIndexEnd: u - g - 1,
1986
1992
  verticalFixed: !1,
1987
- lastRowOfModel: v
1993
+ lastRowOfModel: C
1988
1994
  }), d.left > 0 && (y = { left: a, width: this.areaBodyWestGeo.width, height: E, top: x, index: m }, S = this.dom.addRowDiv(s, y, m, e, "west"), this.adjustColumnsToRowParent({
1989
1995
  areaIdent: e,
1990
1996
  sideIdent: "west",
@@ -1995,7 +2001,7 @@ class ht extends nt {
1995
2001
  columnIndexStart: 0,
1996
2002
  columnIndexEnd: k - 1,
1997
2003
  verticalFixed: !0,
1998
- lastRowOfModel: v
2004
+ lastRowOfModel: C
1999
2005
  })), d.right > 0 && (y = { left: a, width: this.areaBodyEastGeo.width, height: E, top: x, index: m }, S = this.dom.addRowDiv(i, y, m, e, "east"), this.adjustColumnsToRowParent({
2000
2006
  areaIdent: e,
2001
2007
  sideIdent: "east",
@@ -2006,7 +2012,7 @@ class ht extends nt {
2006
2012
  columnIndexStart: u - g,
2007
2013
  columnIndexEnd: u - 1,
2008
2014
  verticalFixed: !0,
2009
- lastRowOfModel: v
2015
+ lastRowOfModel: C
2010
2016
  })), e === "header" && this.tree && m === h - 1) {
2011
2017
  const T = this.dom.applyStyle(
2012
2018
  this.dom.setAttribute(
@@ -2022,23 +2028,25 @@ class ht extends nt {
2022
2028
  }
2023
2029
  }
2024
2030
  }
2025
- if (p = p + E, p > r)
2031
+ if (p = p + E, p > r) {
2032
+ e === "body" && (this.displayedRowCount = this.firstVisibleRowIndex - m);
2026
2033
  break;
2034
+ }
2027
2035
  }
2028
2036
  if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
2029
2037
  const m = ((f = this.colAndRowspanModels[e]) == null ? void 0 : f.getRanges()) ?? [];
2030
2038
  if (m.length)
2031
2039
  for (const x of m) {
2032
- let v = 0, E = o.child, y = "center";
2040
+ let C = 0, E = o.child, y = "center";
2033
2041
  if (x.c1 < b)
2034
2042
  E = s.child, y = "west";
2035
2043
  else if (g > 0 && x.c1 >= u - g)
2036
2044
  E = i.child, y = "east";
2037
2045
  else {
2038
2046
  const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
2039
- v = this.scrollFactorX * S - this.areaBodyWestGeo.width, y = "center";
2047
+ C = this.scrollFactorX * S - this.areaBodyWestGeo.width, y = "center";
2040
2048
  }
2041
- this.drawBigCell(x, v, t, c, E, y);
2049
+ this.drawBigCell(x, C, t, c, E, y);
2042
2050
  }
2043
2051
  }
2044
2052
  }
@@ -2148,18 +2156,18 @@ class ht extends nt {
2148
2156
  for (let f = a; f <= n; f++) {
2149
2157
  const m = g, x = this.tableModel.getColumnWidth(f);
2150
2158
  if (x > 0 && m + x > 0) {
2151
- let v = o.height;
2159
+ let C = o.height;
2152
2160
  const E = s.getRowspanAt(r, f), y = s.getColspanAt(r, f);
2153
- E > 1 && (v = this.getRowHeights(r, r + E - 1, s).reduce((T, D) => T + D, 0));
2161
+ E > 1 && (C = this.getRowHeights(r, r + E - 1, s).reduce((T, D) => T + D, 0));
2154
2162
  let S = x;
2155
2163
  y > 1 && (S = this.getColumnWidths(f, f + y - 1).reduce((T, D) => T + D, 0));
2156
2164
  let k = !1;
2157
2165
  if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(r, f) && (k = !0), this.draggingTargetColumnIndex === f && e !== "header") {
2158
- this.renderDragTargetDiv(i, m, p, S, v);
2159
- const T = { left: m, top: p, width: S, height: v };
2166
+ this.renderDragTargetDiv(i, m, p, S, C);
2167
+ const T = { left: m, top: p, width: S, height: C };
2160
2168
  this.dom.addColumnBorderDivs(this.tableOptions, i, T, e, t);
2161
2169
  } else {
2162
- const T = this.renderSelectedBackgroundDiv(k, u, t, s, r, f, i, m, p, S, v);
2170
+ const T = this.renderSelectedBackgroundDiv(k, u, t, s, r, f, i, m, p, S, C);
2163
2171
  "gammaCells" in s && s.getValueAt(r, f) && (k = !1), k || this.renderCell({
2164
2172
  areaModel: s,
2165
2173
  areaIdent: e,
@@ -2169,7 +2177,7 @@ class ht extends nt {
2169
2177
  left: m,
2170
2178
  top: p,
2171
2179
  width: S,
2172
- height: v,
2180
+ height: C,
2173
2181
  parent: i,
2174
2182
  cellSelected: T,
2175
2183
  lastRowOfModel: c,
@@ -2180,7 +2188,7 @@ class ht extends nt {
2180
2188
  cellLeft: m,
2181
2189
  cellTop: p,
2182
2190
  cellWidth: S,
2183
- cellHeight: v,
2191
+ cellHeight: C,
2184
2192
  parent: i
2185
2193
  });
2186
2194
  }
@@ -2219,15 +2227,15 @@ class ht extends nt {
2219
2227
  const u = this.editorRenderer && this.editorRendererRow === o && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(o, i), g = { left: r, width: a, height: n, top: d, index: i }, b = e.getRowByIndex(o);
2220
2228
  let f = "none";
2221
2229
  if (i === this.getTreeArrowColumnIndex() && X(b)) {
2222
- const C = b;
2223
- (pe = C.children) != null && pe.length ? C.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
2230
+ const v = b;
2231
+ (pe = v.children) != null && pe.length ? v.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
2224
2232
  }
2225
2233
  let x;
2226
2234
  if (t === "header") {
2227
- const C = this.tableModel.getColumnDef(i);
2228
- (!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (x = C == null ? void 0 : C.sortState);
2235
+ const v = this.tableModel.getColumnDef(i);
2236
+ (!(v != null && v.sortIconVisible) || v != null && v.sortIconVisible()) && (x = v == null ? void 0 : v.sortState);
2229
2237
  }
2230
- const v = e.getValueAt(o, i), E = u ? "" : `${v}`, y = e.isRowChecked(o), S = this.dom.addColumnDiv(
2238
+ const C = e.getValueAt(o, i), E = u ? "" : `${C}`, y = e.isRowChecked(o), S = this.dom.addColumnDiv(
2231
2239
  {
2232
2240
  parent: c,
2233
2241
  geo: g,
@@ -2246,17 +2254,17 @@ class ht extends nt {
2246
2254
  const T = this.tableModel.getColumnDef(i);
2247
2255
  T && T.classes[t] && this.dom.addClasses(T.classes[t], S);
2248
2256
  let D;
2249
- u && (D = u.render(S, o, i, t, e, v, this.dom.domService));
2257
+ u && (D = u.render(S, o, i, t, e, C, this.dom.domService));
2250
2258
  const _ = e.getCustomClassesAt(o, i);
2251
2259
  if (_.length && this.dom.addClasses(_, S), this.dom.addColumnBorderDivs(this.tableOptions, c, g, t, s), h && this.dom.addHorizontalBorder({ left: r, width: a, height: n, top: d + n }, c), this.getFocusModel && t === "body") {
2252
- const C = this.getFocusModel();
2253
- C != null && C.hasFocus(o, i) && this.dom.addFocusBorderDivs(c, g, {});
2260
+ const v = this.getFocusModel();
2261
+ v != null && v.hasFocus(o, i) && this.dom.addFocusBorderDivs(c, g, {});
2254
2262
  }
2255
2263
  t === "header" && this.dom.setAttribute(S, "data-ge-action", "drag-column");
2256
2264
  const Q = e.getCustomStyleAt(o, i);
2257
2265
  if (Q)
2258
- for (const C in Q)
2259
- this.dom.setStyle(S, C, Q[C]);
2266
+ for (const v in Q)
2267
+ this.dom.setStyle(S, v, Q[v]);
2260
2268
  return [S, D];
2261
2269
  }
2262
2270
  /**
@@ -2434,8 +2442,8 @@ class ht extends nt {
2434
2442
  }, m = this.dom.addColumnDiv(f);
2435
2443
  let x;
2436
2444
  g && (x = g.render(m, d, a, t, i, u, this.dom.domService), x && this.cleanupFunctions[t].push(x));
2437
- const v = i.getCustomClassesAt(d, a);
2438
- v.length && this.dom.addClasses(v, m);
2445
+ const C = i.getCustomClassesAt(d, a);
2446
+ C.length && this.dom.addClasses(C, m);
2439
2447
  const E = this.tableModel.getColumnDef(a);
2440
2448
  E && E.classes[t] && this.dom.addClasses(E.classes[t], m), this.dom.addColumnBorderDivs(this.tableOptions, n, p, t, o);
2441
2449
  const y = i.getCustomStyleAt(d, a);
@@ -2960,7 +2968,7 @@ class wt {
2960
2968
  this.selectionType !== "none" && (this.allSelected = !1, this.selectionMode === "single" && (this.ranges = []), this.selectionType === "row" ? (e.c1 = 0, e.c2 = Number.MAX_SAFE_INTEGER) : this.selectionType === "column" ? (e.r1 = 0, e.r2 = Number.MAX_SAFE_INTEGER) : this.selectionType === "cell" ? (e.r2 = e.r1, e.c2 = e.c1) : this.selectionType, this.ranges.push(e), this.fireChangeEvent());
2961
2969
  }
2962
2970
  }
2963
- class vt {
2971
+ class Ct {
2964
2972
  constructor(e = "none") {
2965
2973
  this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1, this.listenerArr = [];
2966
2974
  }
@@ -3011,14 +3019,14 @@ class Te {
3011
3019
  }
3012
3020
  // `⊖ `, `⊕ `;
3013
3021
  }
3014
- const Ct = new wt(), Et = new vt("cell");
3022
+ const vt = new wt(), Et = new Ct("cell");
3015
3023
  class De {
3016
3024
  constructor() {
3017
3025
  this.overflowX = "auto", this.overflowY = "auto", this.horizontalBorderVisible = !0, this.verticalBorderVisible = !0, this.footerSeparatorBorderVisible = !0, this.headerSeparatorBorderVisible = !0, this.fixedEastSeparatorBorderVisible = !0, this.fixedWestSeparatorBorderVisible = !0, this.tableTopBorderVisible = !0, this.tableBottomBorderVisible = !0, this.hoverRowVisible = !0, this.hoverColumnVisible = !0, this.columnsResizable = !0, this.columnsDraggable = !0, this.columnResizeHandleWidthInPx = 4, this.defaultRowHeights = {
3018
3026
  header: 34,
3019
3027
  body: 34,
3020
3028
  footer: 34
3021
- }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new Ae(), this.headerGroupOptions = new Te(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new Me(), this.sortOrder = ["asc", "desc"], this.shortcutActionsDisabled = !1, this.resizeEventDebounceDelay = 500, this.getEditRenderer = (e, t) => new xt(), this.getSelectionModel = () => Ct, this.getFocusModel = () => Et;
3029
+ }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new Ae(), this.headerGroupOptions = new Te(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new Me(), this.sortOrder = ["asc", "desc"], this.shortcutActionsDisabled = !1, this.resizeEventDebounceDelay = 500, this.getEditRenderer = (e, t) => new xt(), this.getSelectionModel = () => vt, this.getFocusModel = () => Et;
3022
3030
  }
3023
3031
  }
3024
3032
  const W = class W {
@@ -3646,6 +3654,9 @@ class he extends ht {
3646
3654
  let e = ((t = this.storeSortingService) == null ? void 0 : t.getSortItems()) ?? [];
3647
3655
  this.tableModel.doSort(e);
3648
3656
  }
3657
+ getDisplayedRowCount() {
3658
+ return this.displayedRowCount;
3659
+ }
3649
3660
  }
3650
3661
  const Y = class Y {
3651
3662
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/solid-table",
3
- "version": "1.1.62",
3
+ "version": "1.1.64",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "tslib": "^2.3.0",
21
- "@guiexpert/table": "^1.1.62"
21
+ "@guiexpert/table": "^1.1.64"
22
22
  },
23
23
  "devDependencies": {
24
24
  "solid-jest": "^0.2.0",