@guiexpert/table 1.1.49 → 1.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +18 -18
- package/index.d.ts +1 -0
- package/index.js +163 -155
- package/lib/table/event-checkbox-changed-handler.d.ts +5 -0
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Ot(h,e=500){let t=null,s=0;return function(...o){const i=Date.now(),r=e-(i-s);r<=0?(h.apply(this,o),s=i):t||(t=window.setTimeout(()=>{h.apply(this,o),s=Date.now(),t=null},r))}}function Ve(h,e=500){let t=null;return function(...s){t&&window.clearTimeout(t),t=window.setTimeout(()=>{h.apply(this,s),t=null},e)}}function Lt(h=500){return function(e,t,s){let o=0;const i=s.value;return s.value=function(...r){if(!(Date.now()-o<h))return o=Date.now(),i.apply(this,r)},s}}const Ee="any",z="undefined",Te="null",Me="string",
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Ot(h,e=500){let t=null,s=0;return function(...o){const i=Date.now(),r=e-(i-s);r<=0?(h.apply(this,o),s=i):t||(t=window.setTimeout(()=>{h.apply(this,o),s=Date.now(),t=null},r))}}function Ve(h,e=500){let t=null;return function(...s){t&&window.clearTimeout(t),t=window.setTimeout(()=>{h.apply(this,s),t=null},e)}}function Lt(h=500){return function(e,t,s){let o=0;const i=s.value;return s.value=function(...r){if(!(Date.now()-o<h))return o=Date.now(),i.apply(this,r)},s}}const Ee="any",z="undefined",Te="null",Me="string",le="number",ae="boolean",Ie="Array",j="object",U=[Te,z,Ee];class ke{constructor(e){this.propertyName=e,this.type=Ee}}class Z{constructor(e){this.propertyName=e,this.type=z}}class We{constructor(e){this.propertyName=e,this.type=Te}}class Ne{constructor(e){this.propertyName=e,this.type=Me}}class Ge{constructor(e){this.propertyName=e,this.type=le}}class ze{constructor(e){this.propertyName=e,this.type=ae}}class B{constructor(e,t=[]){this.propertyName=e,this.items=t,this.type=Ie}}class De{constructor(e,t=[]){this.propertyName=e,this.types=t}toString(){return`PropertyItem(propertyName: ${this.propertyName}, types: [${this.types.map(e=>e.type).join(", ")}])`}}class k{constructor(e,t,s=[]){this.propertyName=e,this.className=t,this.properties=s,this.type=j}}class _t{constructor(){this.rootPropertyType=null,this.allowCustomRenderer=!0,this.bufCustomRenderer=[],this.LABEL_MAPPINGS={Id:"ID",In:"in",At:"at",Of:"of",From:"from",And:"and",The:"the",On:"on",By:"by",To:"to",With:"with",For:"for",As:"as",Or:"or",But:"but",Nor:"nor"}}renderColumnDefs(e,t=!0){this.allowCustomRenderer=t,this.rootPropertyType=e,this.bufCustomRenderer=[];const s=[];if(!this.rootPropertyType)return s;if(e instanceof B){const o=e.items.find(i=>i.type===j);if(o&&o instanceof k){const i=o.properties;s.push(" const columnDefs: ColumnDefIf[] = ["),this.iteratePropertyItems(s,i,""),s.push(" ];")}}return[...s,...this.bufCustomRenderer]}iteratePropertyItems(e,t,s=""){for(let o=0;o<t.length;o++){let r=t[o].types.filter(n=>!U.includes(n.type));if(r.length===1){let n=r[0];const l=s?[s,n.propertyName].join("."):n.propertyName;if(n instanceof k)this.iteratePropertyItems(e,n.properties,l);else{let a="";if(n instanceof B){const p=n.items.find(m=>m.type===j);p&&p instanceof k&&(a=p.className)}const c=this.getReadableColumnLabel(l);let d=100,u="",f="ge-table-text-align-left";if(n.type===Ie){if(this.allowCustomRenderer&&a){const p=`${a}ArrayCellRenderer`;u=` bodyRenderer: new ${p}(),`,f="",this.renderCumstomCellRenderer(a,p)}else u=" bodyRenderer: new SimpleArrayCellRenderer(),";d=250}else n.type===le?(u=" bodyRenderer: new NumberCellRenderer(),",f="ge-table-text-align-right"):n.type===ae&&(u=" bodyRenderer: new TrueFalseCellRenderer(),",f="ge-table-text-align-center",d=80);e.push(` ColumnDef.create({
|
|
2
2
|
property: "${l}",
|
|
3
3
|
headerLabel: "${c}",
|
|
4
4
|
width: new Size(${d}, "px"),
|
|
@@ -38,14 +38,14 @@ export class ${t} implements CellRendererIf {
|
|
|
38
38
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
`)}}class pe{fixJSON(e){const t=[];let s="",o=!1,i=!1;for(let r=0;r<e.length;r++){const n=e[r];if(s+=n,n==='"'&&!i&&(o=!o),n==="\\"&&!i){i=!0;continue}else i=!1;if(!o){if(n==="{"||n==="[")t.push(n);else if(n==="}"||n==="]"){const l=t.pop();if(n==="}"&&l!=="{"||n==="]"&&l!=="[")throw new Error("Invalid JSON structure detected.")}}}for(;t.length>0;){const r=t.pop();r==="{"?s+="}":r==="["&&(s+="]")}return s}}class je{constructor(){this.property="",this.value="",this.path="",this.propertyItem=new De("",[new ke("")])}toString(){var e;return`${this.path} -> : ${((e=this.propertyItem)==null?void 0:e.toString())??""}`}}const ge="Entity";function Ye(h){let e=Ue(Ke(h));return e.includes(ge)||(e=e+ge),e}function Ue(h){if(!h||h.length===0)return h;const e=["Array","Arr","List","s"];for(const t of e)if(h.endsWith(t))return h.slice(0,-t.length);return h}function Ke(h){return!h||h.length===0?"":h[0].toUpperCase()+h.slice(1)}class $t{constructor(){this.debugging=!1}json2PropertyType(e,t=""){let s;if(typeof e=="string"){const o=new pe().fixJSON(e);s=this.json2Object(o)}else s=e;return this.object2PropertyType(s,t)}json2Object(e){return JSON.parse(e)}object2PropertyType(e,t=""){const s=this.object2ValueInfos(e,t);this.debugging&&this.logValueInfos(s);const o=this.valueInfos2PropertyType(s);return"name"in o&&(o.name=t),o}json2ValueInfos(e,t=""){let s;if(typeof e=="string"){const o=new pe().fixJSON(e);s=this.json2Object(o)}else s=e;return this.object2ValueInfos(s,t)}object2ValueInfos(e,t=""){const s=this.extractValueInfos(e,t),o=this.mergeValueInfos(s);return o.length>0&&(o[0].propertyItem.propertyName=t),this.debugging&&this.logValueInfos(o),o}getParentPath(e){const t=e.lastIndexOf("/");return t===-1?"":e.substring(0,t)}valueInfos2PropertyType(e){const t=e[0].propertyItem.types[0],s=new Map;for(const o of e)s.set(o.path,o);for(const o of e){const i=this.getParentPath(o.path);if(i){const r=s.get(i);if(r){let n=!1;const l=r.propertyItem.types.filter(a=>!U.includes(a.type));if(l.length===1){const a=l[0];if(a instanceof B){n=!0;for(const c of o.propertyItem.types)a.items.push(c)}else a instanceof k&&(n=!0,a.properties.push(o.propertyItem))}if(!n)for(const a of o.propertyItem.types)r.propertyItem.types.push(a)}}}return t||new ke("")}logValueInfos(e){for(let t=0;t<e.length;t++){const s=e[t];s.value=null;const o=t.toString().padStart(2,"0");console.info(o+") "+s.toString()+" parent: "+this.getParentPath(s.path))}}mergeValueInfos(e){const t=[];let s=e.length-1;t.push(e[s]);let o=e[s].path;for(let i=s-1;i>=0;i--){if(e[i].path===o){const r=e[i].propertyItem.types[0];e[s].propertyItem.types.some(n=>n.type===r.type)||e[s].propertyItem.types.push(r)}(i===0||e[i].path!==o)&&(s=i,t.push(e[i]),o=e[s].path)}for(const i of e){const r=this.getParentPath(i.path);if(r){const n=this.getParentPath(r);if(n){const l=this.getFirstValueInfoByPath(e,n);if(Array.isArray(l==null?void 0:l.value)){const a=(l==null?void 0:l.value.length)??0,c=this.countPath(e,i.path);a>c&&(i.propertyItem.types.some(d=>d.type===z)||i.propertyItem.types.push(new Z(i.property)))}}}}return t.reverse(),t}countPath(e,t){let s=0;for(const o of e)o.path===t&&s++;return s}getFirstValueInfoByPath(e,t){for(let s=e.length-1;s>=0;s--)if(e[s].path===t)return e[s];return null}extractValueInfos(e,t){const s=[],o=(i,r,n)=>{const l=new je;let a=r.split("/").pop()||"";if(a==="[]"?a=n:a==="root"&&(a=t),l.property=a,l.value=i,l.path=r,l.propertyItem=this.createPropertyItem(i,l.property),s.push(l),i&&typeof i===j&&!Array.isArray(i)){for(const c in i)if(i.hasOwnProperty(c)){const d=r?`${r}/${c}`:c;o(i[c],d,a)}}else Array.isArray(i)&&i.forEach((c,d)=>{const u=`${r}/[]`;o(c,u,a)})};return o(e,"root",t),s.sort((i,r)=>i.path.localeCompare(r.path))}createPropertyItem(e,t){return new De(t,[this.createPropertyType(e,t)])}createPropertyType(e,t){return e===null?new We(t):e===void 0?new Z(t):typeof e===Me?new Ne(t):typeof e===ne&&!isNaN(e)?new Ge(t):typeof e===le?new ze(t):Array.isArray(e)?new B(t):typeof e===j?new k(t,Ye(t)):new Z(t)}}class Bt{constructor(){this.orOperator="|",this.rootPropertyType=null,this.rootName="Root",this.renderTypeScriptInterfacesFifo=[],this.renderTypeScriptInterfacesDone=[]}renderTypeScriptInterfaces(e){"name"in e&&(this.rootName=e.name+""),this.rootPropertyType=e;const t=[];return this.rootPropertyType&&(this.renderTypeScriptInterfacesFifo=[],this.renderTypeScriptInterfacesRecursive(this.rootPropertyType,t),this.renderTypeScriptInterfacesFifoNext(t)),t}renderTypeScriptInterfacesFifoNext(e){var t;for(;(t=this.renderTypeScriptInterfacesFifo)!=null&&t.length;){const s=this.renderTypeScriptInterfacesFifo.shift();s&&this.renderTypeScriptInterfacesRecursive(s,e,s.propertyName)}}renderTypeScriptInterfacesRecursive(e=this.rootPropertyType,t=[],s=this.rootName){if(!e)return t;if(e instanceof B){for(const o of e.items)if(this.renderTypeScriptInterfacesRecursive(o,t,s),o instanceof k){const i=o;i!==this.rootPropertyType&&this.renderTypeScriptInterfacesFifo.push(i)}}else if(e instanceof k){const o=e,i=o.className;if(!this.renderTypeScriptInterfacesDone.includes(i)){this.renderTypeScriptInterfacesDone.push(i),t.push(`export interface ${i} {`);for(const r of o.properties){let n=this.propertyItem2InterfaceDateType(r);n==="[]"?n="any[]":n.startsWith("(")&&n.endsWith(")")&&(n=n.substring(1,n.length-1));const l=this.containsUndefinedPropertyType(r)?"?":"";t.push(" "+r.propertyName+l+": "+n+";");for(const a of r.types)if(a instanceof k)a!==this.rootPropertyType&&this.renderTypeScriptInterfacesFifo.push(a);else if(a instanceof B)for(const c of a.items)c instanceof k&&this.renderTypeScriptInterfacesFifo.push(c)}t.push("}"),t.push("")}}return t}propertyItem2InterfaceDateType(e){var s,o;if(((s=e.types)==null?void 0:s.length)===0)return"any";if(((o=e.types)==null?void 0:o.length)===1)return this.renderType(e.types[0],e);const t=e.types.map(i=>this.renderType(i,e)).filter(i=>i!==z).sort((i,r)=>U.includes(i)?100:U.includes(r)?-100:i.localeCompare(r)).join(this.orOperator);return t.includes(this.orOperator)?"("+t+")":t}renderType(e,t){if(e instanceof B){const s=e.items.map(o=>this.renderType(o,t)).join(this.orOperator);return s.includes(this.orOperator)?`(${s})[]`:`${s}[]`}return e instanceof k?e.className:e.type}containsUndefinedPropertyType(e){for(const t of e.types)if(t.type===z)return!0;return!1}}class V{constructor(){this.alreadySet=!1}static getInstance(){return V.instance||(V.instance=new V),V.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 W(h){return h&&h.type==="TreeRow"}function te(h){return h&&h.type==="AreaModelTree"}function Xe(h){return h&&h.type==="CheckboxColumnDef"}class ae{constructor(e=-1,t=-1,s=-1,o=-1,i,r,n,l=0,a=0,c=0,d=""){this.rowIndex=e,this.rowTop=t,this.columnIndex=s,this.columnLeft=o,this.areaIdent=i,this.sideIdent=r,this.originalEvent=n,this.clickCount=l,this.draggingX=a,this.draggingY=c,this.action=d}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 L{constructor(e=">",t="",s=[]){this.content=e,this.style=t,this.classes=s}}class Pe{constructor(e=new L(">","transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",["gt-table-tree-arrow-expanded"]),t=new L(">","",["ge-table-tree-arrow-collapsed"]),s=new L(">","color:transparent;",["gt-table-tree-arrow-hidden"]),o=new L("↕","",["gt-table-tree-arrow-expanded-all"])){this.arrowExpanded=e,this.arrowCollapsed=t,this.arrowPlaceholder=s,this.arrowExpandCollapseAll=o}}class Fe{constructor(e=new L("↑","",["ge-header-sorted-asc"]),t=new L("↓","",["ge-header-sorted-desc"]),s=new L("↑","color:transparent;",[])){this.iconAsc=e,this.iconDesc=t,this.iconPlaceholder=s}}class Je{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 n=t.index??-1,l=this.getDivOrCreateDiv(n,e);if(this.domService.addClass(l,"ge-table-row-div"),this.domService.addClass(l,`ge-table-row-div-${t.index}`),o==="body"&&i==="center"){const a=((t==null?void 0:t.index)??0)%2===0?"even":"odd";this.domService.addClass(l,`ge-table-row-${a}`)}if(this.domService.setStyle(l,"display","clip"),this.domService.setStyle(l,"position","absolute"),this.domService.setStyle(l,"left",`${t.left}px`),this.domService.setStyle(l,"top",`${t.top}px`),this.domService.setStyle(l,"width",`${t.width}px`),this.domService.setStyle(l,"height",`${t.height}px`),this.domService.setAttribute(l,"data-row-index",`${s}`),this.domService.setAttribute(l,"data-area",`${o}`),r){const a=this.domService.createText(r);this.domService.appendChild(l,a)}return this.domService.appendChild(e.child,l),l}addColumnDiv(e){const{parent:t,geo:s,rowIndex:o=-1,columnIndex:i=-1,areaIdent:r,sideIdent:n,text:l="",treeArrow:a,tableOptions:c,checkedType:d=void 0,sortState:u}=e,f=c==null?void 0:c.treeOptions,p=c==null?void 0:c.showCheckboxWihoutExtraColumn,m=this.domService.createElement("div");this.domService.addClass(m,"ge-table-col-div"),p&&this.domService.addClass(m,"ge-with-checkbox"),this.domService.addClass(m,`ge-table-col-div-${s.index}`),this.domService.setAttribute(m,"data-col-index",`${s.index}`),this.domService.setAttribute(m,"data-row-index",`${o}`),this.domService.setAttribute(m,"data-area",`${r}`);const g=((s==null?void 0:s.index)??0)%2===0?"even":"odd";if(r==="body"&&n==="center"&&this.domService.addClass(m,`ge-table-column-${g}`),this.domService.setStyle(m,"display","clip"),this.domService.setStyle(m,"position","absolute"),this.domService.setStyle(m,"left",`${s.left}px`),this.domService.setStyle(m,"top",`${s.top}px`),this.domService.setStyle(m,"width",`${s.width}px`),this.domService.setStyle(m,"height",`${s.height}px`),a&&a!=="none"&&(this.domService.addClass(m,"ge-table-col-tree"),this.addArrowDiv(m,a,f,o,i,r)),p&&i===0&&d&&this.addCheckboxToDiv(m,d,r,o),l){const b=a!=="none"&&i===0;this.addLabelDiv(m,l,b,o,i,r)}return u&&this.addSortedIcon(m,u,c==null?void 0:c.sortedOptions,i),this.domService.appendChild(t,m),m}addCheckboxToDiv(e,t,s,o){const i=this.domService.createElement("div"),r=t==="full"?"checked":"";return i.innerHTML=`
|
|
41
|
+
`)}}class ge{fixJSON(e){const t=[];let s="",o=!1,i=!1;for(let r=0;r<e.length;r++){const n=e[r];if(s+=n,n==='"'&&!i&&(o=!o),n==="\\"&&!i){i=!0;continue}else i=!1;if(!o){if(n==="{"||n==="[")t.push(n);else if(n==="}"||n==="]"){const l=t.pop();if(n==="}"&&l!=="{"||n==="]"&&l!=="[")throw new Error("Invalid JSON structure detected.")}}}for(;t.length>0;){const r=t.pop();r==="{"?s+="}":r==="["&&(s+="]")}return s}}class je{constructor(){this.property="",this.value="",this.path="",this.propertyItem=new De("",[new ke("")])}toString(){var e;return`${this.path} -> : ${((e=this.propertyItem)==null?void 0:e.toString())??""}`}}const fe="Entity";function Ye(h){let e=Ue(Ke(h));return e.includes(fe)||(e=e+fe),e}function Ue(h){if(!h||h.length===0)return h;const e=["Array","Arr","List","s"];for(const t of e)if(h.endsWith(t))return h.slice(0,-t.length);return h}function Ke(h){return!h||h.length===0?"":h[0].toUpperCase()+h.slice(1)}class $t{constructor(){this.debugging=!1}json2PropertyType(e,t=""){let s;if(typeof e=="string"){const o=new ge().fixJSON(e);s=this.json2Object(o)}else s=e;return this.object2PropertyType(s,t)}json2Object(e){return JSON.parse(e)}object2PropertyType(e,t=""){const s=this.object2ValueInfos(e,t);this.debugging&&this.logValueInfos(s);const o=this.valueInfos2PropertyType(s);return"name"in o&&(o.name=t),o}json2ValueInfos(e,t=""){let s;if(typeof e=="string"){const o=new ge().fixJSON(e);s=this.json2Object(o)}else s=e;return this.object2ValueInfos(s,t)}object2ValueInfos(e,t=""){const s=this.extractValueInfos(e,t),o=this.mergeValueInfos(s);return o.length>0&&(o[0].propertyItem.propertyName=t),this.debugging&&this.logValueInfos(o),o}getParentPath(e){const t=e.lastIndexOf("/");return t===-1?"":e.substring(0,t)}valueInfos2PropertyType(e){const t=e[0].propertyItem.types[0],s=new Map;for(const o of e)s.set(o.path,o);for(const o of e){const i=this.getParentPath(o.path);if(i){const r=s.get(i);if(r){let n=!1;const l=r.propertyItem.types.filter(a=>!U.includes(a.type));if(l.length===1){const a=l[0];if(a instanceof B){n=!0;for(const c of o.propertyItem.types)a.items.push(c)}else a instanceof k&&(n=!0,a.properties.push(o.propertyItem))}if(!n)for(const a of o.propertyItem.types)r.propertyItem.types.push(a)}}}return t||new ke("")}logValueInfos(e){for(let t=0;t<e.length;t++){const s=e[t];s.value=null;const o=t.toString().padStart(2,"0");console.info(o+") "+s.toString()+" parent: "+this.getParentPath(s.path))}}mergeValueInfos(e){const t=[];let s=e.length-1;t.push(e[s]);let o=e[s].path;for(let i=s-1;i>=0;i--){if(e[i].path===o){const r=e[i].propertyItem.types[0];e[s].propertyItem.types.some(n=>n.type===r.type)||e[s].propertyItem.types.push(r)}(i===0||e[i].path!==o)&&(s=i,t.push(e[i]),o=e[s].path)}for(const i of e){const r=this.getParentPath(i.path);if(r){const n=this.getParentPath(r);if(n){const l=this.getFirstValueInfoByPath(e,n);if(Array.isArray(l==null?void 0:l.value)){const a=(l==null?void 0:l.value.length)??0,c=this.countPath(e,i.path);a>c&&(i.propertyItem.types.some(d=>d.type===z)||i.propertyItem.types.push(new Z(i.property)))}}}}return t.reverse(),t}countPath(e,t){let s=0;for(const o of e)o.path===t&&s++;return s}getFirstValueInfoByPath(e,t){for(let s=e.length-1;s>=0;s--)if(e[s].path===t)return e[s];return null}extractValueInfos(e,t){const s=[],o=(i,r,n)=>{const l=new je;let a=r.split("/").pop()||"";if(a==="[]"?a=n:a==="root"&&(a=t),l.property=a,l.value=i,l.path=r,l.propertyItem=this.createPropertyItem(i,l.property),s.push(l),i&&typeof i===j&&!Array.isArray(i)){for(const c in i)if(i.hasOwnProperty(c)){const d=r?`${r}/${c}`:c;o(i[c],d,a)}}else Array.isArray(i)&&i.forEach((c,d)=>{const u=`${r}/[]`;o(c,u,a)})};return o(e,"root",t),s.sort((i,r)=>i.path.localeCompare(r.path))}createPropertyItem(e,t){return new De(t,[this.createPropertyType(e,t)])}createPropertyType(e,t){return e===null?new We(t):e===void 0?new Z(t):typeof e===Me?new Ne(t):typeof e===le&&!isNaN(e)?new Ge(t):typeof e===ae?new ze(t):Array.isArray(e)?new B(t):typeof e===j?new k(t,Ye(t)):new Z(t)}}class Bt{constructor(){this.orOperator="|",this.rootPropertyType=null,this.rootName="Root",this.renderTypeScriptInterfacesFifo=[],this.renderTypeScriptInterfacesDone=[]}renderTypeScriptInterfaces(e){"name"in e&&(this.rootName=e.name+""),this.rootPropertyType=e;const t=[];return this.rootPropertyType&&(this.renderTypeScriptInterfacesFifo=[],this.renderTypeScriptInterfacesRecursive(this.rootPropertyType,t),this.renderTypeScriptInterfacesFifoNext(t)),t}renderTypeScriptInterfacesFifoNext(e){var t;for(;(t=this.renderTypeScriptInterfacesFifo)!=null&&t.length;){const s=this.renderTypeScriptInterfacesFifo.shift();s&&this.renderTypeScriptInterfacesRecursive(s,e,s.propertyName)}}renderTypeScriptInterfacesRecursive(e=this.rootPropertyType,t=[],s=this.rootName){if(!e)return t;if(e instanceof B){for(const o of e.items)if(this.renderTypeScriptInterfacesRecursive(o,t,s),o instanceof k){const i=o;i!==this.rootPropertyType&&this.renderTypeScriptInterfacesFifo.push(i)}}else if(e instanceof k){const o=e,i=o.className;if(!this.renderTypeScriptInterfacesDone.includes(i)){this.renderTypeScriptInterfacesDone.push(i),t.push(`export interface ${i} {`);for(const r of o.properties){let n=this.propertyItem2InterfaceDateType(r);n==="[]"?n="any[]":n.startsWith("(")&&n.endsWith(")")&&(n=n.substring(1,n.length-1));const l=this.containsUndefinedPropertyType(r)?"?":"";t.push(" "+r.propertyName+l+": "+n+";");for(const a of r.types)if(a instanceof k)a!==this.rootPropertyType&&this.renderTypeScriptInterfacesFifo.push(a);else if(a instanceof B)for(const c of a.items)c instanceof k&&this.renderTypeScriptInterfacesFifo.push(c)}t.push("}"),t.push("")}}return t}propertyItem2InterfaceDateType(e){var s,o;if(((s=e.types)==null?void 0:s.length)===0)return"any";if(((o=e.types)==null?void 0:o.length)===1)return this.renderType(e.types[0],e);const t=e.types.map(i=>this.renderType(i,e)).filter(i=>i!==z).sort((i,r)=>U.includes(i)?100:U.includes(r)?-100:i.localeCompare(r)).join(this.orOperator);return t.includes(this.orOperator)?"("+t+")":t}renderType(e,t){if(e instanceof B){const s=e.items.map(o=>this.renderType(o,t)).join(this.orOperator);return s.includes(this.orOperator)?`(${s})[]`:`${s}[]`}return e instanceof k?e.className:e.type}containsUndefinedPropertyType(e){for(const t of e.types)if(t.type===z)return!0;return!1}}class V{constructor(){this.alreadySet=!1}static getInstance(){return V.instance||(V.instance=new V),V.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 W(h){return h&&h.type==="TreeRow"}function te(h){return h&&h.type==="AreaModelTree"}function Xe(h){return h&&h.type==="CheckboxColumnDef"}class ce{constructor(e=-1,t=-1,s=-1,o=-1,i,r,n,l=0,a=0,c=0,d=""){this.rowIndex=e,this.rowTop=t,this.columnIndex=s,this.columnLeft=o,this.areaIdent=i,this.sideIdent=r,this.originalEvent=n,this.clickCount=l,this.draggingX=a,this.draggingY=c,this.action=d}clone(){return new ce(this.rowIndex,this.rowTop,this.columnIndex,this.columnLeft,this.areaIdent,this.sideIdent,this.originalEvent,this.clickCount,this.draggingX,this.draggingY,this.action)}}class L{constructor(e=">",t="",s=[]){this.content=e,this.style=t,this.classes=s}}class Pe{constructor(e=new L(">","transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",["gt-table-tree-arrow-expanded"]),t=new L(">","",["ge-table-tree-arrow-collapsed"]),s=new L(">","color:transparent;",["gt-table-tree-arrow-hidden"]),o=new L("↕","",["gt-table-tree-arrow-expanded-all"])){this.arrowExpanded=e,this.arrowCollapsed=t,this.arrowPlaceholder=s,this.arrowExpandCollapseAll=o}}class Fe{constructor(e=new L("↑","",["ge-header-sorted-asc"]),t=new L("↓","",["ge-header-sorted-desc"]),s=new L("↑","color:transparent;",[])){this.iconAsc=e,this.iconDesc=t,this.iconPlaceholder=s}}class Je{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 n=t.index??-1,l=this.getDivOrCreateDiv(n,e);if(this.domService.addClass(l,"ge-table-row-div"),this.domService.addClass(l,`ge-table-row-div-${t.index}`),o==="body"&&i==="center"){const a=((t==null?void 0:t.index)??0)%2===0?"even":"odd";this.domService.addClass(l,`ge-table-row-${a}`)}if(this.domService.setStyle(l,"display","clip"),this.domService.setStyle(l,"position","absolute"),this.domService.setStyle(l,"left",`${t.left}px`),this.domService.setStyle(l,"top",`${t.top}px`),this.domService.setStyle(l,"width",`${t.width}px`),this.domService.setStyle(l,"height",`${t.height}px`),this.domService.setAttribute(l,"data-row-index",`${s}`),this.domService.setAttribute(l,"data-area",`${o}`),r){const a=this.domService.createText(r);this.domService.appendChild(l,a)}return this.domService.appendChild(e.child,l),l}addColumnDiv(e){const{parent:t,geo:s,rowIndex:o=-1,columnIndex:i=-1,areaIdent:r,sideIdent:n,text:l="",treeArrow:a,tableOptions:c,checkedType:d=void 0,sortState:u}=e,f=c==null?void 0:c.treeOptions,p=c==null?void 0:c.showCheckboxWihoutExtraColumn,m=this.domService.createElement("div");this.domService.addClass(m,"ge-table-col-div"),p&&this.domService.addClass(m,"ge-with-checkbox"),this.domService.addClass(m,`ge-table-col-div-${s.index}`),this.domService.setAttribute(m,"data-col-index",`${s.index}`),this.domService.setAttribute(m,"data-row-index",`${o}`),this.domService.setAttribute(m,"data-area",`${r}`);const g=((s==null?void 0:s.index)??0)%2===0?"even":"odd";if(r==="body"&&n==="center"&&this.domService.addClass(m,`ge-table-column-${g}`),this.domService.setStyle(m,"display","clip"),this.domService.setStyle(m,"position","absolute"),this.domService.setStyle(m,"left",`${s.left}px`),this.domService.setStyle(m,"top",`${s.top}px`),this.domService.setStyle(m,"width",`${s.width}px`),this.domService.setStyle(m,"height",`${s.height}px`),a&&a!=="none"&&(this.domService.addClass(m,"ge-table-col-tree"),this.addArrowDiv(m,a,f,o,i,r)),p&&i===0&&d&&this.addCheckboxToDiv(m,d,r,o),l){const b=a!=="none"&&i===0;this.addLabelDiv(m,l,b,o,i,r)}return u&&this.addSortedIcon(m,u,c==null?void 0:c.sortedOptions,i),this.domService.appendChild(t,m),m}addCheckboxToDiv(e,t,s,o){const i=this.domService.createElement("div"),r=t==="full"?"checked":"";return i.innerHTML=`
|
|
42
42
|
<input
|
|
43
43
|
type="checkbox"
|
|
44
44
|
data-area="${s}"
|
|
45
45
|
data-row-index="${o}"
|
|
46
46
|
data-input-type="checkbox"
|
|
47
47
|
${r}
|
|
48
|
-
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 n=this.domService.createElement("div");if(this.domService.addClass(n,"ge-table-label-div"),this.domService.setStyle(n,"position","relative"),this.domService.setStyle(n,"background","transparent"),this.domService.setStyle(n,"width","100%"),this.domService.setStyle(n,"height","100%"),this.domService.setAttribute(n,"data-row-index",`${o}`),this.domService.setAttribute(n,"data-col-index",`${i}`),this.domService.setAttribute(n,"data-area",`${r}`),t)if(s){const l=this.domService.createText(t);this.domService.appendChild(n,l)}else{const l=this.domService.createElement("div");this.domService.appendChild(n,l);const a=this.domService.createText(t);this.domService.addClass(l,"ge-table-label"),this.domService.appendChild(l,a),this.domService.setAttribute(l,"data-row-index",`${o}`),this.domService.setAttribute(l,"data-col-index",`${i}`),this.domService.setAttribute(l,"data-area",`${r}`)}return this.domService.appendChild(e,n),n}addSortedIcon(e,t="",s=new Fe,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 n=r.content,l=this.domService.createText(n);this.domService.appendChild(i,l),r.style&&this.applyStyleString(i,r.style);for(const a of r.classes)this.domService.addClass(i,a);return this.domService.appendChild(e,i),i}addArrowDiv(e,t="none",s=new Pe,o=-1,i=-1,r="body"){const n=this.domService.createElement("div");this.domService.addClass(n,"ge-table-tree-arrow-div"),this.domService.setStyle(n,"display","inline-block"),this.domService.setStyle(n,"position",""),this.domService.setStyle(n,"width","20px"),this.domService.setStyle(n,"background","transparent"),this.domService.setStyle(n,"cursor","pointer"),this.domService.setAttribute(n,"data-row-index",`${o}`),this.domService.setAttribute(n,"data-col-index",`${i}`),this.domService.setAttribute(n,"data-area",`${r}`);let l;t==="expanded"?l=s.arrowExpanded:t==="collapsed"?l=s.arrowCollapsed:l=s.arrowPlaceholder;const a=l.content,c=this.domService.createText(a);this.domService.appendChild(n,c),l.style&&this.applyStyleString(n,l.style);for(const d of l.classes)this.domService.addClass(n,d);return this.domService.appendChild(e,n),n}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 J=h=>h==="header"?"header":h==="footer"?"footer":"body";class qe{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=J(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 Ze{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 qe(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(W(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=J(s),i=Number(t.getAttribute("data-row-index")),r=Number(t.getAttribute("data-col-index")),n=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 l=n.getRowByIndex(i);if(s&&o==="body"&&n.isEditable(i,r)&&(this.tableScope.clearSelection(),this.tableScope.initRenderEditor(i,r)),W(l)&&r===this.getArrowColumnIndex()){e.preventDefault(),e.stopPropagation();const a=l;a.expanded=!a.expanded,"recalcVisibleTreeRows"in n&&n.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(a)}}}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,n;const t=(o=(s=this.tableScope.tableOptions)==null?void 0:s.autoRestoreOptions)==null?void 0:o.getRowId;if(t){const l=(i=this.tableScope.storeStateCollapsedExpandService)==null?void 0:i.collapsedExpandedStateGet().mode,a=l==="collapsed"&&!e.expanded||l==="expanded"&&e.expanded,c=l==="collapsed"&&e.expanded||l==="expanded"&&!e.expanded,d=t(e.data);a?(r=this.tableScope.storeStateCollapsedExpandService)==null||r.collapsedStateIdsPush(d):c&&((n=this.tableScope.storeStateCollapsedExpandService)==null||n.collapsedStateIdsRemove(d))}}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 Qe{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 n=this.tableScope.tableModel.getAreaModel(r),l=(n==null?void 0:n.getRowCount())??0;for(let a=0;a<l;a++){const c=[];s.push(c);for(let d=0;d<o;d++)c.push(n.getValueAt(a,d))}}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}}class Oe{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 et extends Oe{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 tt{constructor(e="collapsed",t=[],s=!1,o=!1){this.mode=e,this.rowIds=t,this.allCollapsed=s,this.allExpanded=o}}class st extends Oe{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new tt,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 ot extends Oe{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 O{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 it{constructor(e,t,s,o){this.hostElement=e,this.tableModel=t,this.dom=s,this.tableOptions=o,this.scrollTop=0,this.areaBodyWestGeo=new O,this.areaBodyCenterGeo=new O,this.areaBodyEastGeo=new O;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 R{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 R(e.rowIndex1,e.columnIndex1,e.rowIndex2,e.columnIndex2,e.gammaRange)}static singleCell(e,t){return new R(e,t,e,t)}static singleRow(e){return new R(e,0,e,Number.MAX_SAFE_INTEGER)}static singleColumn(e){return new R(0,e,Number.MAX_SAFE_INTEGER,e)}isInRange(e,t){return e>=this.r1&&e<=this.r2&&t>=this.c1&&t<=this.c2}}class rt{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 n="gammaCells"in this.areaModel;this.colAndRowspanRanges.push(new R(s,o,s+r-1,o+i-1,n))}}}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 M{constructor(e,t,s){this.header=e,this.body=t,this.footer=s}}class nt extends it{constructor(e,t,s,o){var r,n;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 M,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),(n=this.tableOptions)!=null&&n.getFocusModel&&(this.getFocusModel=this.tableOptions.getFocusModel),te(t.getAreaModel("body"))&&(this.tree=!0),["header","body","footer"].forEach(l=>{var a;this.colAndRowspanModels[l]=new rt(t,t.getAreaModel(l)),(a=this.colAndRowspanModels[l])==null||a.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 O(0,this.hostElement.clientWidth,1,0),this.hostElement,"ge-table-border")),this.tableOptions.tableBottomBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new O(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 O(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 O(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),n='div[data-col-index="'+s+'"][data-row-index="'+t+'"][data-area="'+e+'"]',l=document.querySelector(n);if(l){let a;const c=this.editorRenderer&&this.editorRendererRow===t&&this.editorRendererColumn===s;let d;if(c?d=this.editorRenderer:d=r.getCellRenderer(t,s),l.innerText="",this.applyCssClasses(l,i),d)a=d.render(l,t,s,e,r,o,this.dom.domService),a&&this.cleanupFunctions[e].push(a);else{const p=`${o}`;this.dom.addLabelDiv(l,p,!1,t,s,e)}const u=r.getCustomClassesAt(t,s);u.length&&this.dom.addClasses(u,l);const f=r.getCustomStyleAt(t,s);if(f)for(const p in f)this.dom.setStyle(l,p,f[p])}}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 g;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 n=0,l=this.areaBodyCenterGeo.width,a=this.tableModel.getPadding(),c=this.tableModel.getAreaModel(e),d=c.getRowCount();for(;this.cleanupFunctions[e].length;){const b=this.cleanupFunctions[e].shift();b&&b()}let u=t;const f=this.tableModel.getColumnCount(),p=this.tableModel.getFixedRightColumnCount(),m=this.tableModel.getFixedLeftColumnCount();for(let b=0;b<d;b++){const x=u,w=b===d-1,A=this.tableModel.getRowHeight(e,b);if(x+A>0){this.firstVisibleRowIndex=b;let C={left:n,width:l,height:A,top:x,index:b},S=this.dom.addRowDiv(o,C,b,e,"center");const D=m;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:c,geo:C,parent:S,rowIndex:b,columnIndexStart:D,columnIndexEnd:f-p-1,verticalFixed:!1,lastRowOfModel:w}),a.left>0&&(C={left:n,width:this.areaBodyWestGeo.width,height:A,top:x,index:b},S=this.dom.addRowDiv(s,C,b,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:c,geo:C,parent:S,rowIndex:b,columnIndexStart:0,columnIndexEnd:D-1,verticalFixed:!0,lastRowOfModel:w})),a.right>0&&(C={left:n,width:this.areaBodyEastGeo.width,height:A,top:x,index:b},S=this.dom.addRowDiv(i,C,b,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:c,geo:C,parent:S,rowIndex:b,columnIndexStart:f-p,columnIndexEnd:f-1,verticalFixed:!0,lastRowOfModel:w})),e==="header"&&this.tree&&b===d-1){const E=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(S,new O(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),I=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(I){const q=this.dom.domService.createText(I.content);this.dom.domService.appendChild(E,q),I.style&&this.dom.applyStyleString(E,I.style)}}}if(u=u+A,u>r)break}if(this.colAndRowspanModels&&this.colAndRowspanModels[e]){const b=((g=this.colAndRowspanModels[e])==null?void 0:g.getRanges())??[];if(b.length)for(const x of b){let w=0,A=o.child,C="center";if(x.c1<m)A=s.child,C="west";else if(p>0&&x.c1>=f-p)A=i.child,C="east";else{const S=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();w=this.scrollFactorX*S-this.areaBodyWestGeo.width,C="center"}this.drawBigCell(x,w,t,c,A,C)}}}drawBigCell(e,t,s,o,i,r){const n=s+this.getRowHeights(0,e.r1-1,o).reduce((g,b)=>g+b,0),l=this.tableModel.getColumnCount(),a=this.tableModel.getFixedRightColumnCount();let c=0;a>0&&e.c1>=l-a&&(c=l-a);const d=t+this.getColumnWidths(c,e.c1-1).reduce((g,b)=>g+b,0),u=this.getRowHeights(e.r1,e.r2,o).reduce((g,b)=>g+b,0),f=this.getColumnWidths(e.c1,e.c2).reduce((g,b)=>g+b,0);let p=!1;const m=this.getSelectionModel?this.getSelectionModel():void 0;m&&(p=m.getSelectionCount(e.r1,e.c1)>0),e.gammaRange?this.renderCell({areaModel:o,areaIdent:o.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:d,top:n,width:f,height:u,parent:i,cellSelected:p,lastRowOfModel:!0,gammaRange:e.gammaRange}):this.renderCell({areaModel:o,areaIdent:o.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:d,top:n,width:f,height:u,parent:i,cellSelected:p,lastRowOfModel:!0,gammaRange:e.gammaRange}),o.areaIdent==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:e.r1,columnIndex:e.c1,cellLeft:d,cellTop:n,cellWidth:f,cellHeight:u,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:n,columnIndexEnd:l,verticalFixed:a=!1,lastRowOfModel:c=!1}){var m;this.scrollViewportLeft=this.scrollViewport.scrollLeft;let d=0;if(!a){const g=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();d=this.scrollFactorX*g}const u=0,f=!!(e==="body"&&t);let p=d;for(let g=n;g<=l;g++){const b=p,x=this.tableModel.getColumnWidth(g);if(x>0&&b+x>0){let w=o.height;const A=s.getRowspanAt(r,g),C=s.getColspanAt(r,g);A>1&&(w=this.getRowHeights(r,r+A-1,s).reduce((E,I)=>E+I,0));let S=x;C>1&&(S=this.getColumnWidths(g,g+C-1).reduce((E,I)=>E+I,0));let D=!1;if(this.colAndRowspanModels&&this.colAndRowspanModels[e]&&(m=this.colAndRowspanModels[e])!=null&&m.isInRange(r,g)&&(D=!0),this.draggingTargetColumnIndex===g&&e!=="header"){this.renderDragTargetDiv(i,b,u,S,w);const E={left:b,top:u,width:S,height:w};this.dom.addColumnBorderDivs(this.tableOptions,i,E,e,t)}else{const E=this.renderSelectedBackgroundDiv(D,f,t,s,r,g,i,b,u,S,w);"gammaCells"in s&&s.getValueAt(r,g)&&(D=!1),D||this.renderCell({areaModel:s,areaIdent:e,sideIdent:t,rowIndex:r,columnIndex:g,left:b,top:u,width:S,height:w,parent:i,cellSelected:E,lastRowOfModel:c,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:r,columnIndex:g,cellLeft:b,cellTop:u,cellWidth:S,cellHeight:w,parent:i})}}if(p=p+x,p>this.areaBodyCenterGeo.width)break}this.tableOptions.verticalBorderVisible&&this.dom.addVerticalBorder(new O(p-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:n,height:l,top:a,parent:c,lastRowOfModel:d}){var He;const f=this.editorRenderer&&this.editorRendererRow===o&&this.editorRendererColumn===i?this.editorRenderer:e.getCellRenderer(o,i),p={left:r,width:n,height:l,top:a,index:i},m=e.getRowByIndex(o);let g="none";if(i===this.getTreeArrowColumnIndex()&&W(m)){const v=m;(He=v.children)!=null&&He.length?v.expanded?g="expanded":g="collapsed":g="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 w=e.getValueAt(o,i),A=f?"":`${w}`,C=e.isRowChecked(o),S=this.dom.addColumnDiv({parent:c,geo:p,rowIndex:o,columnIndex:i,areaIdent:t,sideIdent:s,text:A,treeArrow:g,tableOptions:this.tableOptions,checkedType:C,sortState:x}),D=e.getTooltipAt(o,i);D&&this.dom.setAttribute(S,"title",D);const E=this.tableModel.getColumnDef(i);E&&E.classes[t]&&this.dom.addClasses(E.classes[t],S);let I;f&&(I=f.render(S,o,i,t,e,w,this.dom.domService));const q=e.getCustomClassesAt(o,i);if(q.length&&this.dom.addClasses(q,S),this.dom.addColumnBorderDivs(this.tableOptions,c,p,t,s),d&&this.dom.addHorizontalBorder({left:r,width:n,height:l,top:a+l},c),this.getFocusModel&&t==="body"){const v=this.getFocusModel();v!=null&&v.hasFocus(o,i)&&this.dom.addFocusBorderDivs(c,p,{})}t==="header"&&this.dom.setAttribute(S,"data-ge-action","drag-column");const ue=e.getCustomStyleAt(o,i);if(ue)for(const v in ue)this.dom.setStyle(S,v,ue[v]);return[S,I]}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,n=this.storedColumnWidths[t];if((o=e.originalEvent)!=null&&o.clientX){const c={left:((i=e.originalEvent)==null?void 0:i.clientX)-n/2,width:n,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 n=e.index??0,l=this.draggingColumn;for(let a=0;a<r;a++){const c=s,d=i.getRowHeight(a),u={left:0,width:e.width,height:d,top:c,index:a},f=i.getValueAt(a,n),p=i.getCellRenderer(a,n),m=p?"":`${f}`,g={parent:l,geo:u,rowIndex:a,columnIndex:n,areaIdent:t,sideIdent:o,text:m},b=this.dom.addColumnDiv(g);let x;p&&(x=p.render(b,a,n,t,i,f,this.dom.domService),x&&this.cleanupFunctions[t].push(x));const w=i.getCustomClassesAt(a,n);w.length&&this.dom.addClasses(w,b);const A=this.tableModel.getColumnDef(n);A&&A.classes[t]&&this.dom.addClasses(A.classes[t],b),this.dom.addColumnBorderDivs(this.tableOptions,l,u,t,o);const C=i.getCustomStyleAt(a,n);if(C)for(const S in C)this.dom.setStyle(b,S,C[S]);s=s+d}}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,n,l,a,c,d){let u=!1;if(!e&&t&&o.isSelectable(i,r)&&this.getSelectionModel){const f=this.getSelectionModel();if(f){const p=f.getSelectionCount(i,r);u=p>0;for(let m=0;m<p;m++){const g=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`,n));this.dom.setStyle(g,"left",`${l}px`),this.dom.setStyle(g,"top",`${a}px`),this.dom.setStyle(g,"width",`${c}px`),this.dom.setStyle(g,"height",`${d}px`)}}}return u}renderCell({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:o,columnIndex:i,left:r,top:n,width:l,height:a,parent:c,cellSelected:d,lastRowOfModel:u}){const[f,p]=this.addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:o,index:i,left:r,width:l,height:a,top:n,parent:c,lastRowOfModel:u});d&&this.dom.addClass(`ge-table-${t}-${s}-selected-range`,f),p&&this.cleanupFunctions[t].push(p)}renderHeaderCellResizeHandle({rowIndex:e,columnIndex:t,cellLeft:s,cellTop:o,cellWidth:i,cellHeight:r,parent:n}){const l=this.dom.domService,a=this.tableOptions.columnResizeHandleWidthInPx??2,c=l.createElement("div");l.setAttribute(c,"data-col-index",`${t}`),l.setAttribute(c,"data-row-index",`${e}`),l.setAttribute(c,"data-area","header"),l.setAttribute(c,"data-ge-action","resize-column"),l.addClass(c,"ge-table-column-resize-handle"),l.setStyle(c,"display","clip"),l.setStyle(c,"position","absolute"),l.setStyle(c,"cursor","col-resize"),l.setStyle(c,"left",`${s+i-a}px`),l.setStyle(c,"top",`${o}px`),l.setStyle(c,"width",`${a}px`),l.setStyle(c,"height",`${r}px`),l.appendChild(n,c)}}class lt{constructor(e,t){this.columnIndex=e,this.sortState=t}}class at{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=J(s),n=Number(o),l=Number(i);this.tableScope.updateModelValueAfterEdit(r,n,l,t.value)}}}}class ct{constructor(e=-1,t=-1){this.rowIndex=e,this.columnIndex=t}}class ce{constructor(e){this.cells=e}static createSingle(e,t){return new ce([new ct(e,t)])}}class dt{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,n,l,a,c,d;let s=!1,o=!1;if(this.getSelectionModel&&this.getFocusModel){const u=this.getSelectionModel(),f=this.getFocusModel();u&&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||u.hasSelection()&&(u.clear(),s=!0),(r=e.originalEvent)!=null&&r.shiftKey&&this.previousEvt?(u.addSelection(this.createRangeByEvents(e,this.previousEvt)),o=!0,s=!0):(n=e.originalEvent)!=null&&n.altKey&&((l=e.originalEvent)!=null&&l.ctrlKey||(a=e.originalEvent)!=null&&a.metaKey)?(u.removeSelection(R.singleCell(e.rowIndex,e.columnIndex)),o=!0,s=!0):(c=e.originalEvent)!=null&&c.ctrlKey||(d=e.originalEvent)!=null&&d.metaKey?(u.addSelection(R.singleCell(e.rowIndex,e.columnIndex)),o=!0,s=!0):(u.firstClick(e.rowIndex,e.columnIndex),s=!0),this.tableScope.onSelectionChanged(u))}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 R.create({rowIndex1:s,columnIndex1:i,rowIndex2:o,columnIndex2:r})}}class ht{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 ut{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"}}}class pt{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(){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 ut().get()):Object.assign(this.shortcutActionIdMapping,new ht().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=this.getTokenByEvent(e);this.isDebug()&&console.debug("ShortcutService tokens :",t);for(const s in this.shortcutActionIdMapping){const o=s.replace(/opt/g,"alt").replace(/cmd/g,"meta").split(/[+ ]/g).sort();if(this.areTokensEquals(t,o))return this.shortcutActionIdMapping[s]}}areTokensEquals(e,t){if(e.length!==t.length||e.length===0)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}getTokenByEvent(e){const t=[];return e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.code&&t.push(e.code.toLowerCase().replace(/key/g,"")),t.sort()}getShortcutActionMapping(){return this.shortcutActionIdMapping}}class fe{onCheckboxChanged(e){}onContextmenu(e){}onModelChanged(e){}onMouseClicked(e){}onMouseDragging(e){}onMouseDraggingEnd(e){}onMouseMoved(e){}onSelectionChanged(e){}onFocusChanged(e){}}class gt{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 ft{render(e,t,s,o,i,r,n){if(i.isEditable(t,s)){n.addClass(e,"ge-table-row-input-div");const l=i.getValueAt(t,s);e.innerHTML=`
|
|
48
|
+
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 n=this.domService.createElement("div");if(this.domService.addClass(n,"ge-table-label-div"),this.domService.setStyle(n,"position","relative"),this.domService.setStyle(n,"background","transparent"),this.domService.setStyle(n,"width","100%"),this.domService.setStyle(n,"height","100%"),this.domService.setAttribute(n,"data-row-index",`${o}`),this.domService.setAttribute(n,"data-col-index",`${i}`),this.domService.setAttribute(n,"data-area",`${r}`),t)if(s){const l=this.domService.createText(t);this.domService.appendChild(n,l)}else{const l=this.domService.createElement("div");this.domService.appendChild(n,l);const a=this.domService.createText(t);this.domService.addClass(l,"ge-table-label"),this.domService.appendChild(l,a),this.domService.setAttribute(l,"data-row-index",`${o}`),this.domService.setAttribute(l,"data-col-index",`${i}`),this.domService.setAttribute(l,"data-area",`${r}`)}return this.domService.appendChild(e,n),n}addSortedIcon(e,t="",s=new Fe,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 n=r.content,l=this.domService.createText(n);this.domService.appendChild(i,l),r.style&&this.applyStyleString(i,r.style);for(const a of r.classes)this.domService.addClass(i,a);return this.domService.appendChild(e,i),i}addArrowDiv(e,t="none",s=new Pe,o=-1,i=-1,r="body"){const n=this.domService.createElement("div");this.domService.addClass(n,"ge-table-tree-arrow-div"),this.domService.setStyle(n,"display","inline-block"),this.domService.setStyle(n,"position",""),this.domService.setStyle(n,"width","20px"),this.domService.setStyle(n,"background","transparent"),this.domService.setStyle(n,"cursor","pointer"),this.domService.setAttribute(n,"data-row-index",`${o}`),this.domService.setAttribute(n,"data-col-index",`${i}`),this.domService.setAttribute(n,"data-area",`${r}`);let l;t==="expanded"?l=s.arrowExpanded:t==="collapsed"?l=s.arrowCollapsed:l=s.arrowPlaceholder;const a=l.content,c=this.domService.createText(a);this.domService.appendChild(n,c),l.style&&this.applyStyleString(n,l.style);for(const d of l.classes)this.domService.addClass(n,d);return this.domService.appendChild(e,n),n}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 J=h=>h==="header"?"header":h==="footer"?"footer":"body";class qe{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=J(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 Ze{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 qe(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(W(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=J(s),i=Number(t.getAttribute("data-row-index")),r=Number(t.getAttribute("data-col-index")),n=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 l=n.getRowByIndex(i);if(s&&o==="body"&&n.isEditable(i,r)&&(this.tableScope.clearSelection(),this.tableScope.initRenderEditor(i,r)),W(l)&&r===this.getArrowColumnIndex()){e.preventDefault(),e.stopPropagation();const a=l;a.expanded=!a.expanded,"recalcVisibleTreeRows"in n&&n.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(a)}}}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,n;const t=(o=(s=this.tableScope.tableOptions)==null?void 0:s.autoRestoreOptions)==null?void 0:o.getRowId;if(t){const l=(i=this.tableScope.storeStateCollapsedExpandService)==null?void 0:i.collapsedExpandedStateGet().mode,a=l==="collapsed"&&!e.expanded||l==="expanded"&&e.expanded,c=l==="collapsed"&&e.expanded||l==="expanded"&&!e.expanded,d=t(e.data);a?(r=this.tableScope.storeStateCollapsedExpandService)==null||r.collapsedStateIdsPush(d):c&&((n=this.tableScope.storeStateCollapsedExpandService)==null||n.collapsedStateIdsRemove(d))}}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 Qe{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 n=this.tableScope.tableModel.getAreaModel(r),l=(n==null?void 0:n.getRowCount())??0;for(let a=0;a<l;a++){const c=[];s.push(c);for(let d=0;d<o;d++)c.push(n.getValueAt(a,d))}}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}}class Oe{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 et extends Oe{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 tt{constructor(e="collapsed",t=[],s=!1,o=!1){this.mode=e,this.rowIds=t,this.allCollapsed=s,this.allExpanded=o}}class st extends Oe{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new tt,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 ot extends Oe{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 O{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 it{constructor(e,t,s,o){this.hostElement=e,this.tableModel=t,this.dom=s,this.tableOptions=o,this.scrollTop=0,this.areaBodyWestGeo=new O,this.areaBodyCenterGeo=new O,this.areaBodyEastGeo=new O;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 R{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 R(e.rowIndex1,e.columnIndex1,e.rowIndex2,e.columnIndex2,e.gammaRange)}static singleCell(e,t){return new R(e,t,e,t)}static singleRow(e){return new R(e,0,e,Number.MAX_SAFE_INTEGER)}static singleColumn(e){return new R(0,e,Number.MAX_SAFE_INTEGER,e)}isInRange(e,t){return e>=this.r1&&e<=this.r2&&t>=this.c1&&t<=this.c2}}class rt{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 n="gammaCells"in this.areaModel;this.colAndRowspanRanges.push(new R(s,o,s+r-1,o+i-1,n))}}}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 M{constructor(e,t,s){this.header=e,this.body=t,this.footer=s}}class nt extends it{constructor(e,t,s,o){var r,n;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 M,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),(n=this.tableOptions)!=null&&n.getFocusModel&&(this.getFocusModel=this.tableOptions.getFocusModel),te(t.getAreaModel("body"))&&(this.tree=!0),["header","body","footer"].forEach(l=>{var a;this.colAndRowspanModels[l]=new rt(t,t.getAreaModel(l)),(a=this.colAndRowspanModels[l])==null||a.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 O(0,this.hostElement.clientWidth,1,0),this.hostElement,"ge-table-border")),this.tableOptions.tableBottomBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new O(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 O(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 O(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),n='div[data-col-index="'+s+'"][data-row-index="'+t+'"][data-area="'+e+'"]',l=document.querySelector(n);if(l){let a;const c=this.editorRenderer&&this.editorRendererRow===t&&this.editorRendererColumn===s;let d;if(c?d=this.editorRenderer:d=r.getCellRenderer(t,s),l.innerText="",this.applyCssClasses(l,i),d)a=d.render(l,t,s,e,r,o,this.dom.domService),a&&this.cleanupFunctions[e].push(a);else{const p=`${o}`;this.dom.addLabelDiv(l,p,!1,t,s,e)}const u=r.getCustomClassesAt(t,s);u.length&&this.dom.addClasses(u,l);const f=r.getCustomStyleAt(t,s);if(f)for(const p in f)this.dom.setStyle(l,p,f[p])}}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 g;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 n=0,l=this.areaBodyCenterGeo.width,a=this.tableModel.getPadding(),c=this.tableModel.getAreaModel(e),d=c.getRowCount();for(;this.cleanupFunctions[e].length;){const b=this.cleanupFunctions[e].shift();b&&b()}let u=t;const f=this.tableModel.getColumnCount(),p=this.tableModel.getFixedRightColumnCount(),m=this.tableModel.getFixedLeftColumnCount();for(let b=0;b<d;b++){const x=u,w=b===d-1,A=this.tableModel.getRowHeight(e,b);if(x+A>0){this.firstVisibleRowIndex=b;let C={left:n,width:l,height:A,top:x,index:b},S=this.dom.addRowDiv(o,C,b,e,"center");const D=m;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:c,geo:C,parent:S,rowIndex:b,columnIndexStart:D,columnIndexEnd:f-p-1,verticalFixed:!1,lastRowOfModel:w}),a.left>0&&(C={left:n,width:this.areaBodyWestGeo.width,height:A,top:x,index:b},S=this.dom.addRowDiv(s,C,b,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:c,geo:C,parent:S,rowIndex:b,columnIndexStart:0,columnIndexEnd:D-1,verticalFixed:!0,lastRowOfModel:w})),a.right>0&&(C={left:n,width:this.areaBodyEastGeo.width,height:A,top:x,index:b},S=this.dom.addRowDiv(i,C,b,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:c,geo:C,parent:S,rowIndex:b,columnIndexStart:f-p,columnIndexEnd:f-1,verticalFixed:!0,lastRowOfModel:w})),e==="header"&&this.tree&&b===d-1){const E=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(S,new O(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),I=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(I){const q=this.dom.domService.createText(I.content);this.dom.domService.appendChild(E,q),I.style&&this.dom.applyStyleString(E,I.style)}}}if(u=u+A,u>r)break}if(this.colAndRowspanModels&&this.colAndRowspanModels[e]){const b=((g=this.colAndRowspanModels[e])==null?void 0:g.getRanges())??[];if(b.length)for(const x of b){let w=0,A=o.child,C="center";if(x.c1<m)A=s.child,C="west";else if(p>0&&x.c1>=f-p)A=i.child,C="east";else{const S=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();w=this.scrollFactorX*S-this.areaBodyWestGeo.width,C="center"}this.drawBigCell(x,w,t,c,A,C)}}}drawBigCell(e,t,s,o,i,r){const n=s+this.getRowHeights(0,e.r1-1,o).reduce((g,b)=>g+b,0),l=this.tableModel.getColumnCount(),a=this.tableModel.getFixedRightColumnCount();let c=0;a>0&&e.c1>=l-a&&(c=l-a);const d=t+this.getColumnWidths(c,e.c1-1).reduce((g,b)=>g+b,0),u=this.getRowHeights(e.r1,e.r2,o).reduce((g,b)=>g+b,0),f=this.getColumnWidths(e.c1,e.c2).reduce((g,b)=>g+b,0);let p=!1;const m=this.getSelectionModel?this.getSelectionModel():void 0;m&&(p=m.getSelectionCount(e.r1,e.c1)>0),e.gammaRange?this.renderCell({areaModel:o,areaIdent:o.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:d,top:n,width:f,height:u,parent:i,cellSelected:p,lastRowOfModel:!0,gammaRange:e.gammaRange}):this.renderCell({areaModel:o,areaIdent:o.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:d,top:n,width:f,height:u,parent:i,cellSelected:p,lastRowOfModel:!0,gammaRange:e.gammaRange}),o.areaIdent==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:e.r1,columnIndex:e.c1,cellLeft:d,cellTop:n,cellWidth:f,cellHeight:u,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:n,columnIndexEnd:l,verticalFixed:a=!1,lastRowOfModel:c=!1}){var m;this.scrollViewportLeft=this.scrollViewport.scrollLeft;let d=0;if(!a){const g=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();d=this.scrollFactorX*g}const u=0,f=!!(e==="body"&&t);let p=d;for(let g=n;g<=l;g++){const b=p,x=this.tableModel.getColumnWidth(g);if(x>0&&b+x>0){let w=o.height;const A=s.getRowspanAt(r,g),C=s.getColspanAt(r,g);A>1&&(w=this.getRowHeights(r,r+A-1,s).reduce((E,I)=>E+I,0));let S=x;C>1&&(S=this.getColumnWidths(g,g+C-1).reduce((E,I)=>E+I,0));let D=!1;if(this.colAndRowspanModels&&this.colAndRowspanModels[e]&&(m=this.colAndRowspanModels[e])!=null&&m.isInRange(r,g)&&(D=!0),this.draggingTargetColumnIndex===g&&e!=="header"){this.renderDragTargetDiv(i,b,u,S,w);const E={left:b,top:u,width:S,height:w};this.dom.addColumnBorderDivs(this.tableOptions,i,E,e,t)}else{const E=this.renderSelectedBackgroundDiv(D,f,t,s,r,g,i,b,u,S,w);"gammaCells"in s&&s.getValueAt(r,g)&&(D=!1),D||this.renderCell({areaModel:s,areaIdent:e,sideIdent:t,rowIndex:r,columnIndex:g,left:b,top:u,width:S,height:w,parent:i,cellSelected:E,lastRowOfModel:c,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:r,columnIndex:g,cellLeft:b,cellTop:u,cellWidth:S,cellHeight:w,parent:i})}}if(p=p+x,p>this.areaBodyCenterGeo.width)break}this.tableOptions.verticalBorderVisible&&this.dom.addVerticalBorder(new O(p-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:n,height:l,top:a,parent:c,lastRowOfModel:d}){var He;const f=this.editorRenderer&&this.editorRendererRow===o&&this.editorRendererColumn===i?this.editorRenderer:e.getCellRenderer(o,i),p={left:r,width:n,height:l,top:a,index:i},m=e.getRowByIndex(o);let g="none";if(i===this.getTreeArrowColumnIndex()&&W(m)){const v=m;(He=v.children)!=null&&He.length?v.expanded?g="expanded":g="collapsed":g="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 w=e.getValueAt(o,i),A=f?"":`${w}`,C=e.isRowChecked(o),S=this.dom.addColumnDiv({parent:c,geo:p,rowIndex:o,columnIndex:i,areaIdent:t,sideIdent:s,text:A,treeArrow:g,tableOptions:this.tableOptions,checkedType:C,sortState:x}),D=e.getTooltipAt(o,i);D&&this.dom.setAttribute(S,"title",D);const E=this.tableModel.getColumnDef(i);E&&E.classes[t]&&this.dom.addClasses(E.classes[t],S);let I;f&&(I=f.render(S,o,i,t,e,w,this.dom.domService));const q=e.getCustomClassesAt(o,i);if(q.length&&this.dom.addClasses(q,S),this.dom.addColumnBorderDivs(this.tableOptions,c,p,t,s),d&&this.dom.addHorizontalBorder({left:r,width:n,height:l,top:a+l},c),this.getFocusModel&&t==="body"){const v=this.getFocusModel();v!=null&&v.hasFocus(o,i)&&this.dom.addFocusBorderDivs(c,p,{})}t==="header"&&this.dom.setAttribute(S,"data-ge-action","drag-column");const pe=e.getCustomStyleAt(o,i);if(pe)for(const v in pe)this.dom.setStyle(S,v,pe[v]);return[S,I]}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,n=this.storedColumnWidths[t];if((o=e.originalEvent)!=null&&o.clientX){const c={left:((i=e.originalEvent)==null?void 0:i.clientX)-n/2,width:n,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 n=e.index??0,l=this.draggingColumn;for(let a=0;a<r;a++){const c=s,d=i.getRowHeight(a),u={left:0,width:e.width,height:d,top:c,index:a},f=i.getValueAt(a,n),p=i.getCellRenderer(a,n),m=p?"":`${f}`,g={parent:l,geo:u,rowIndex:a,columnIndex:n,areaIdent:t,sideIdent:o,text:m},b=this.dom.addColumnDiv(g);let x;p&&(x=p.render(b,a,n,t,i,f,this.dom.domService),x&&this.cleanupFunctions[t].push(x));const w=i.getCustomClassesAt(a,n);w.length&&this.dom.addClasses(w,b);const A=this.tableModel.getColumnDef(n);A&&A.classes[t]&&this.dom.addClasses(A.classes[t],b),this.dom.addColumnBorderDivs(this.tableOptions,l,u,t,o);const C=i.getCustomStyleAt(a,n);if(C)for(const S in C)this.dom.setStyle(b,S,C[S]);s=s+d}}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,n,l,a,c,d){let u=!1;if(!e&&t&&o.isSelectable(i,r)&&this.getSelectionModel){const f=this.getSelectionModel();if(f){const p=f.getSelectionCount(i,r);u=p>0;for(let m=0;m<p;m++){const g=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`,n));this.dom.setStyle(g,"left",`${l}px`),this.dom.setStyle(g,"top",`${a}px`),this.dom.setStyle(g,"width",`${c}px`),this.dom.setStyle(g,"height",`${d}px`)}}}return u}renderCell({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:o,columnIndex:i,left:r,top:n,width:l,height:a,parent:c,cellSelected:d,lastRowOfModel:u}){const[f,p]=this.addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:o,index:i,left:r,width:l,height:a,top:n,parent:c,lastRowOfModel:u});d&&this.dom.addClass(`ge-table-${t}-${s}-selected-range`,f),p&&this.cleanupFunctions[t].push(p)}renderHeaderCellResizeHandle({rowIndex:e,columnIndex:t,cellLeft:s,cellTop:o,cellWidth:i,cellHeight:r,parent:n}){const l=this.dom.domService,a=this.tableOptions.columnResizeHandleWidthInPx??2,c=l.createElement("div");l.setAttribute(c,"data-col-index",`${t}`),l.setAttribute(c,"data-row-index",`${e}`),l.setAttribute(c,"data-area","header"),l.setAttribute(c,"data-ge-action","resize-column"),l.addClass(c,"ge-table-column-resize-handle"),l.setStyle(c,"display","clip"),l.setStyle(c,"position","absolute"),l.setStyle(c,"cursor","col-resize"),l.setStyle(c,"left",`${s+i-a}px`),l.setStyle(c,"top",`${o}px`),l.setStyle(c,"width",`${a}px`),l.setStyle(c,"height",`${r}px`),l.appendChild(n,c)}}class lt{constructor(e,t){this.columnIndex=e,this.sortState=t}}class at{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=J(s),n=Number(o),l=Number(i);this.tableScope.updateModelValueAfterEdit(r,n,l,t.value)}}}}class ct{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 ct(e,t)])}}class dt{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,n,l,a,c,d;let s=!1,o=!1;if(this.getSelectionModel&&this.getFocusModel){const u=this.getSelectionModel(),f=this.getFocusModel();u&&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||u.hasSelection()&&(u.clear(),s=!0),(r=e.originalEvent)!=null&&r.shiftKey&&this.previousEvt?(u.addSelection(this.createRangeByEvents(e,this.previousEvt)),o=!0,s=!0):(n=e.originalEvent)!=null&&n.altKey&&((l=e.originalEvent)!=null&&l.ctrlKey||(a=e.originalEvent)!=null&&a.metaKey)?(u.removeSelection(R.singleCell(e.rowIndex,e.columnIndex)),o=!0,s=!0):(c=e.originalEvent)!=null&&c.ctrlKey||(d=e.originalEvent)!=null&&d.metaKey?(u.addSelection(R.singleCell(e.rowIndex,e.columnIndex)),o=!0,s=!0):(u.firstClick(e.rowIndex,e.columnIndex),s=!0),this.tableScope.onSelectionChanged(u))}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 R.create({rowIndex1:s,columnIndex1:i,rowIndex2:o,columnIndex2:r})}}class ht{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 ut{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"}}}class pt{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(){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 ut().get()):Object.assign(this.shortcutActionIdMapping,new ht().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=this.getTokenByEvent(e);this.isDebug()&&console.debug("ShortcutService tokens :",t);for(const s in this.shortcutActionIdMapping){const o=s.replace(/opt/g,"alt").replace(/cmd/g,"meta").split(/[+ ]/g).sort();if(this.areTokensEquals(t,o))return this.shortcutActionIdMapping[s]}}areTokensEquals(e,t){if(e.length!==t.length||e.length===0)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}getTokenByEvent(e){const t=[];return e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.code&&t.push(e.code.toLowerCase().replace(/key/g,"")),t.sort()}getShortcutActionMapping(){return this.shortcutActionIdMapping}}class se{onCheckboxChanged(e){}onContextmenu(e){}onModelChanged(e){}onMouseClicked(e){}onMouseDragging(e){}onMouseDraggingEnd(e){}onMouseMoved(e){}onSelectionChanged(e){}onFocusChanged(e){}}class gt{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 ft{render(e,t,s,o,i,r,n){if(i.isEditable(t,s)){n.addClass(e,"ge-table-row-input-div");const l=i.getValueAt(t,s);e.innerHTML=`
|
|
49
49
|
<input
|
|
50
50
|
type="text"
|
|
51
51
|
value="${l}"
|
|
@@ -57,7 +57,7 @@ export class ${t} implements CellRendererIf {
|
|
|
57
57
|
data-col-index="${s}"
|
|
58
58
|
data-input-type="text"
|
|
59
59
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
60
|
-
class="ge-table-cell-editor-input">`}}}class
|
|
60
|
+
class="ge-table-cell-editor-input">`}}}class he{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(R.singleRow(e)):this.selectionType==="column"&&this.addRange(R.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=R.singleRow(e.r1):this.selectionType==="column"&&(t=R.singleColumn(e.c1)),this.negativeRanges.push(t),this.fireChangeEvent()}togglePoint(e,t){this.getSelectionCount(e,t)>0?this.removeSelection(R.singleCell(e,t)):this.addSelection(R.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 mt{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 Le{constructor(e=new L("❯","",["gt-table-icon-expanded"]),t=new L("❯","transform: rotate(180deg) translate(-100%, -100%); transform-origin: 0 0;",["ge-table-icon-collapsed"])){this.iconExpanded=e,this.iconCollapsed=t}}const Ht=new he,Vt=new mt("cell");class K{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 Pe,this.headerGroupOptions=new Le,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new Fe,this.sortOrder=["asc","desc"],this.resizeEventDebounceDelay=500,this.getEditRenderer=(e,t)=>new ft,this.getSelectionModel=()=>Ht,this.getFocusModel=()=>Vt}}const G=class G{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 n=[];for(let l=r.r1;l<=r.r2;l++){const a=[];for(let c=r.c1;c<=r.c2;c++){const d=t.isSelected(l,c)?e.getBodyModel().getTextValueAt(l,c):"";a.push(d)}n.push(a.join(G.columnSeparatorChar))}return o(n.join(G.rowSeparatorChar))}}if(s){const[r,n]=s.getFocus(),l=e.getBodyModel().getTextValueAt(r,n);return o(l)}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(n=>{o(r)}).catch(n=>{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 R(s.r1,s.c1,s.r2,s.c2);return t}};G.columnSeparatorChar=" ",G.rowSeparatorChar=`
|
|
61
61
|
`;let X=G;class bt{constructor(e,t=500){this.tableScope=e,this.debounceDelay=t,new ResizeObserver(Ve(this.handleResize.bind(this),t)).observe(this.tableScope.hostElement)}handleResize(e){const t=e[0],{width:s}=t.contentRect;this.tableScope.recalcColumnWidths(s)}}class yt{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"?>
|
|
62
62
|
<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"?>
|
|
63
63
|
<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"?>
|
|
@@ -74,7 +74,7 @@ export class ${t} implements CellRendererIf {
|
|
|
74
74
|
<sheetView tabSelected="1" workbookViewId="0"/></sheetViews>
|
|
75
75
|
<sheetFormatPr baseColWidth="10" defaultRowHeight="16" x14ac:dyDescent="0.2"/>
|
|
76
76
|
<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],n=this.getCellAddress(s,i);if(typeof r=="number")t.push(`<c r="${n}"><v>${r}</v></c>`);else if(r instanceof Date){const l=r;t.push(`<c r="${n}" t="inlineStr"><is><t>${l.toISOString()}</t></is></c>`)}else{const l=r!=null?this.escapeXml(String(r)):"";t.push(`<c r="${n}" t="inlineStr"><is><t>${l}</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(`
|
|
77
|
-
`)}escapeXml(e){return e==null?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}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((d,u)=>{const f=new TextEncoder().encode(u),p=new TextEncoder().encode(d),m=new Uint8Array(30+f.length),g=new DataView(m.buffer);m.set([80,75,3,4],0),g.setUint16(4,20,!0),g.setUint16(6,0,!0),g.setUint16(8,0,!0),g.setUint16(10,0,!0),g.setUint16(12,0,!0),g.setUint32(14,0,!0),g.setUint32(18,p.length,!0),g.setUint32(22,p.length,!0),g.setUint16(26,f.length,!0),g.setUint16(28,0,!0),m.set(f,30),t.push(m,p),o.push({path:u,offset:s,contentSize:p.length}),s+=m.length+p.length});const i=s;o.forEach(d=>{const u=new TextEncoder().encode(d.path),f=new Uint8Array(46+u.length),p=new DataView(f.buffer);f.set([80,75,1,2],0),p.setUint16(4,20,!0),p.setUint16(6,20,!0),p.setUint16(8,0,!0),p.setUint16(10,0,!0),p.setUint16(12,0,!0),p.setUint16(14,0,!0),p.setUint32(16,0,!0),p.setUint32(20,d.contentSize,!0),p.setUint32(24,d.contentSize,!0),p.setUint16(28,u.length,!0),p.setUint16(30,0,!0),p.setUint16(32,0,!0),p.setUint16(34,0,!0),p.setUint16(36,0,!0),p.setUint32(38,0,!0),p.setUint32(42,d.offset,!0),f.set(u,46),t.push(f),s+=f.length});const r=new Uint8Array(22),n=new DataView(r.buffer);r.set([80,75,5,6],0),n.setUint16(4,0,!0),n.setUint16(6,0,!0),n.setUint16(8,o.length,!0),n.setUint16(10,o.length,!0),n.setUint32(12,s-i,!0),n.setUint32(16,i,!0),n.setUint16(20,0,!0),t.push(r);const l=t.reduce((d,u)=>d+u.length,0),a=new Uint8Array(l);let c=0;for(const d of t)a.set(d,c),c+=d.length;return a}generateBuffer(e,t=""){const s=this.generateMap(e,t);return this.createZip(s)}}class _e extends nt{constructor(e,t,s,o,i,r=new X,n=new yt){var c;if(super(e,t,new Je(s),o),this.eventListener=i,this.copyService=r,this.excelService=n,this.licenseManager=V.getInstance(),this.selectionService=new dt(this),this.api=new Qe(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.lastDragFrom=-1,this.lastDragTo=-1,this.firstDraggingRendering=!0,t.setTableScope(this),i||(this.eventListener=new fe),(c=this.tableOptions)!=null&&c.autoRestoreOptions){const d=this.tableOptions.autoRestoreOptions,u=d.getStorageKeyFn;u&&(d.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new et(u)),d.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new st(u)),d.autoRestoreSortingState&&(this.storeSortingService=new ot(u)))}this.mouseHandler=new Ze(this),this.inputHandler=new at(this),this.resizeHandler=new bt(this,o.resizeEventDebounceDelay),this.shortcutService=new pt(this),this.shortcutService.addListener(this.selectionService);const l=this.getSelectionModel?this.getSelectionModel():void 0;l&&l.addEventSelectionChangedListener(this);const a=this.getFocusModel?this.getFocusModel():void 0;a&&a.addEventFocusChangedListener(this)}static create(e,t,s=new K,o=new fe,i=new gt,r=new X){return new _e(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(ce.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){this.eventListener.onContextmenu(e)}toggleExpandCollapseAll(e=!0){var s;const t=this.tableModel.getBodyModel();te(t)&&(t.toggleExpandCollapseAll(e),this.repaint(),(s=this.storeStateCollapsedExpandService)==null||s.collapsedStateAll(e))}toggleRowCheckbox(e,t,s){var l;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 n=(l=o.rowSelectionModel)==null?void 0:l.getCheckedRows();this.eventListener.onCheckboxChanged(n||[])}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 n=o.sortStatesOrder?o.sortStatesOrder:this.tableOptions.sortOrder,l=o.sortState??"",a=n[(n.indexOf(l)+1)%n.length],c=new lt(s,a);this.tableModel.doSort([c])&&((i=this.tableModel.getColumnDefs())==null||i.forEach(u=>u.sortState=""),o.sortState=a),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(te(r)){const n=r,l=r.getRowCount();for(let a=0;a<l;a++){const c=r.getRowByIndex(a);if(c)if(i.allExpanded)c.expanded=!0;else if(i.allCollapsed)c.expanded=!1;else{const d=o(c.data);i.mode==="expanded"?c.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(d):i.mode==="collapsed"&&(c.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(d))}}n.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 n=e.getValueAt(i,r),l=(n==null?void 0:n.toString().length)||0;l>o[r]&&(o[r]=l)}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()}}const ie=class ie{};ie.themes=["light","combat","paper","blackboard"],ie.vars={light:`html[data-theme="light"] {
|
|
77
|
+
`)}escapeXml(e){return e==null?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}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((d,u)=>{const f=new TextEncoder().encode(u),p=new TextEncoder().encode(d),m=new Uint8Array(30+f.length),g=new DataView(m.buffer);m.set([80,75,3,4],0),g.setUint16(4,20,!0),g.setUint16(6,0,!0),g.setUint16(8,0,!0),g.setUint16(10,0,!0),g.setUint16(12,0,!0),g.setUint32(14,0,!0),g.setUint32(18,p.length,!0),g.setUint32(22,p.length,!0),g.setUint16(26,f.length,!0),g.setUint16(28,0,!0),m.set(f,30),t.push(m,p),o.push({path:u,offset:s,contentSize:p.length}),s+=m.length+p.length});const i=s;o.forEach(d=>{const u=new TextEncoder().encode(d.path),f=new Uint8Array(46+u.length),p=new DataView(f.buffer);f.set([80,75,1,2],0),p.setUint16(4,20,!0),p.setUint16(6,20,!0),p.setUint16(8,0,!0),p.setUint16(10,0,!0),p.setUint16(12,0,!0),p.setUint16(14,0,!0),p.setUint32(16,0,!0),p.setUint32(20,d.contentSize,!0),p.setUint32(24,d.contentSize,!0),p.setUint16(28,u.length,!0),p.setUint16(30,0,!0),p.setUint16(32,0,!0),p.setUint16(34,0,!0),p.setUint16(36,0,!0),p.setUint32(38,0,!0),p.setUint32(42,d.offset,!0),f.set(u,46),t.push(f),s+=f.length});const r=new Uint8Array(22),n=new DataView(r.buffer);r.set([80,75,5,6],0),n.setUint16(4,0,!0),n.setUint16(6,0,!0),n.setUint16(8,o.length,!0),n.setUint16(10,o.length,!0),n.setUint32(12,s-i,!0),n.setUint32(16,i,!0),n.setUint16(20,0,!0),t.push(r);const l=t.reduce((d,u)=>d+u.length,0),a=new Uint8Array(l);let c=0;for(const d of t)a.set(d,c),c+=d.length;return a}generateBuffer(e,t=""){const s=this.generateMap(e,t);return this.createZip(s)}}class _e extends nt{constructor(e,t,s,o,i,r=new X,n=new yt){var c;if(super(e,t,new Je(s),o),this.eventListener=i,this.copyService=r,this.excelService=n,this.licenseManager=V.getInstance(),this.selectionService=new dt(this),this.api=new Qe(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.lastDragFrom=-1,this.lastDragTo=-1,this.firstDraggingRendering=!0,t.setTableScope(this),i||(this.eventListener=new se),(c=this.tableOptions)!=null&&c.autoRestoreOptions){const d=this.tableOptions.autoRestoreOptions,u=d.getStorageKeyFn;u&&(d.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new et(u)),d.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new st(u)),d.autoRestoreSortingState&&(this.storeSortingService=new ot(u)))}this.mouseHandler=new Ze(this),this.inputHandler=new at(this),this.resizeHandler=new bt(this,o.resizeEventDebounceDelay),this.shortcutService=new pt(this),this.shortcutService.addListener(this.selectionService);const l=this.getSelectionModel?this.getSelectionModel():void 0;l&&l.addEventSelectionChangedListener(this);const a=this.getFocusModel?this.getFocusModel():void 0;a&&a.addEventFocusChangedListener(this)}static create(e,t,s=new K,o=new se,i=new gt,r=new X){return new _e(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 ce;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){this.eventListener.onContextmenu(e)}toggleExpandCollapseAll(e=!0){var s;const t=this.tableModel.getBodyModel();te(t)&&(t.toggleExpandCollapseAll(e),this.repaint(),(s=this.storeStateCollapsedExpandService)==null||s.collapsedStateAll(e))}toggleRowCheckbox(e,t,s){var l;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 n=(l=o.rowSelectionModel)==null?void 0:l.getCheckedRows();this.eventListener.onCheckboxChanged(n||[])}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 n=o.sortStatesOrder?o.sortStatesOrder:this.tableOptions.sortOrder,l=o.sortState??"",a=n[(n.indexOf(l)+1)%n.length],c=new lt(s,a);this.tableModel.doSort([c])&&((i=this.tableModel.getColumnDefs())==null||i.forEach(u=>u.sortState=""),o.sortState=a),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(te(r)){const n=r,l=r.getRowCount();for(let a=0;a<l;a++){const c=r.getRowByIndex(a);if(c)if(i.allExpanded)c.expanded=!0;else if(i.allCollapsed)c.expanded=!1;else{const d=o(c.data);i.mode==="expanded"?c.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(d):i.mode==="collapsed"&&(c.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(d))}}n.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 n=e.getValueAt(i,r),l=(n==null?void 0:n.toString().length)||0;l>o[r]&&(o[r]=l)}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()}}class Wt extends se{constructor(e){super(),this.onCheckboxChangedCallback=e,super.onCheckboxChanged=t=>{this.onCheckboxChangedCallback(t)}}}const re=class re{};re.themes=["light","combat","paper","blackboard"],re.vars={light:`html[data-theme="light"] {
|
|
78
78
|
--ge-table-bg: rgba(255,255,255, 0.5);
|
|
79
79
|
--ge-table-header-west-bg: rgba(233, 233, 233, 0.5);
|
|
80
80
|
--ge-table-header-center-bg: rgba(233, 233, 233, 0.5);
|
|
@@ -302,7 +302,7 @@ export class ${t} implements CellRendererIf {
|
|
|
302
302
|
--ge-table-column-resize-handle-border: oklch(0% 0 0);
|
|
303
303
|
--ge-table-dragged-col-div-bg: #2c2e33;
|
|
304
304
|
--ge-table-drop-zone-bg: #758129;
|
|
305
|
-
}`};let me=ie;class be{constructor(e,t=!0,s,o,i=0,r=!1,n=!1){this.data=e,this.expanded=t,this.children=s,this.parent=o,this.deep=i,this.checked=r,this.keep=n,this.type="TreeRow"}}class se{static buildTreeRows(e,t="children",s=12){const o=[];for(const i of e)o.push(se.buildTreeRow(i,t,void 0,0,s));return o}static buildTreeRow(e,t="children",s=new be(e,!0,[],void 0,0),o=0,i=12){var n;if(o>i)return console.warn("Max deep limit reached: ",o),s;const r=e[t];if(r)for(const l of r){const a=new be(l,!0,[],s,o+1);if((n=s.children)==null||n.push(a),se.buildTreeRow(l,t,a,o+1),o>i)return console.warn("Max deep limit reached: ",o),s}return s}}class N{constructor(e=34,t=34,s=34){this.header=e,this.body=t,this.footer=s}}class y{constructor(e=100,t="px"){this.value=e,this.unit=t}}const xt=()=>!0,ye=()=>!1;class H{constructor(e,t,s=new y(100,"px"),o=new M,i=new M,r=new y(100,"px"),n=new y(100,"px"),l,a,c,d,u,f,p,m,g=()=>this.visible){this.property=e,this.headerLabel=t,this.width=s,this.classes=o,this.rendererMap=i,this.minWidth=r,this.maxWidth=n,this.sortable=l,this.sortComparator=a,this.sortState=c,this.sortStatesOrder=d,this.sortIconVisible=u,this.editable=f,this.getEditRenderer=p,this.editInputPipe=m,this.isVisible=g,this.visible=!0,s.unit!=="px"&&(this.minWidth=new y(0,"px"),this.maxWidth=new y(1e5,"px"))}static bodyRenderer(e){return new M(void 0,e,void 0)}static create(e){const t=new M(e.headerRenderer,e.bodyRenderer,e.footerRenderer),s=new M(e.headerClasses,e.bodyClasses,e.footerClasses),o=e.sortIconVisible??e.sortable??ye,i=e.editable??e.editable??ye,r=e.isVisible??e.isVisible??xt;return new H(e.property??"",e.headerLabel??"",e.width??new y(100,"px"),s,t,e.minWidth??new y(100,"px"),e.maxWidth??new y(100,"px"),e.sortable,e.sortComparator,e.sortState,e.sortStatesOrder,o,i,e.getEditRenderer,e.editInputPipe,r)}}const Wt=new y(500,"px"),Nt=new y(400,"px"),St=new y(300,"px"),Gt=new y(290,"px"),zt=new y(280,"px"),jt=new y(270,"px"),Yt=new y(260,"px"),Ut=new y(250,"px"),Kt=new y(240,"px"),Xt=new y(230,"px"),Jt=new y(220,"px"),qt=new y(210,"px"),xe=new y(200,"px"),Zt=new y(190,"px"),Qt=new y(180,"px"),es=new y(170,"px"),ts=new y(160,"px"),ss=new y(150,"px"),os=new y(140,"px"),is=new y(130,"px"),rs=new y(120,"px"),ns=new y(110,"px"),ls=new y(100,"px"),as=new y(90,"px"),cs=new y(80,"px"),ds=new y(70,"px"),hs=new y(60,"px"),us=new y(50,"px"),ps=new y(40,"px"),gs=new y(30,"px"),fs=new y(20,"px"),ms=new y(10,"px"),bs=new y(0,"px");class he{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 n;const o=(n=this.columnDefs[t])==null?void 0:n.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 P extends he{constructor(e,t,s,o=[]){super(e,o,s),this.areaIdent=e,this.arr=t,this.defaultRowHeight=s,this.columnDefs=o,this.filteredArr=[...t]}externalFilterChanged(e){this.filteredArr=this.arr?this.arr.filter(e):[]}getRowCount(){return this.filteredArr?this.filteredArr.length:0}getValueAt(e,t){return this.filteredArr[e][t]}setValue(e,t,s){var i;const o=(i=this.columnDefs[t])==null?void 0:i.editInputPipe;return o&&(s=o(s,e,t)),this.arr[e][t]=s,!0}getRowByIndex(e){return this.filteredArr[e]}getRowHeight(e){return this.defaultRowHeight}changeColumnOrder(e,t){this.filteredArr.forEach(s=>this.arrayMove(s,e,t)),super.changeColumnOrder(e,t)}}class F{constructor(e="body"){this.areaIdent=e,this.rowSelectionModel=void 0}getRowCount(){return 0}getValueAt(e,t){return""}getTextValueAt(e,t){return""}getCellRenderer(e,t){}getRowHeight(e){return 0}getColspanAt(e,t){return 0}getCustomClassesAt(e,t){return[]}getCustomStyleAt(e,t){}getRowspanAt(e,t){return 0}getRowByIndex(e){}isRowCheckable(e){return!1}isRowChecked(e){}setRowChecked(e,t){}getTooltipAt(e,t){return""}getMaxColspan(){return 0}getMaxRowspan(){return 0}getYPosByRowIndex(e){return 0}init(){}externalFilterChanged(e){}isFilterable(){return!1}doSort(e){return!1}isEditable(e,t){return!1}setValue(e,t,s){return!1}isSelectable(e,t){return!1}changeColumnOrder(e,t){}}class wt{flattenTree(e,t=[]){var s;for(const o of e)this.isVisible(o)&&t.push(o),(s=o.children)!=null&&s.length&&this.flattenTree(o.children,t);return t}isVisible(e){return e.parent?e.parent.expanded?this.isVisible(e.parent):!1:!0}}class Ct{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 Se extends he{constructor(e,t,s,o=[]){super(e,o,s),this.areaIdent=e,this.rows=t,this.defaultRowHeight=s,this.columnDefs=o,this.type="AreaModelTree",this.sorterService=new Ct,this.service=new wt,this.properties=o.map(i=>i.property),this.flattenRows=this.service.flattenTree(t),this.filteredFlattenRows=[...this.flattenRows]}changeColumnOrder(e,t){this.arrayMove(this.properties,e,t),super.changeColumnOrder(e,t)}recalcVisibleTreeRows(){this.filteredFlattenRows=this.service.flattenTree(this.rows)}getFilteredFlattenRows(){return this.filteredFlattenRows}getRowCount(){let e=0;for(const t of this.filteredFlattenRows)this.service.isVisible(t)&&e++;return e}getValueAt(e,t){const s=this.getRowByIndex(e);if(s){const o=this.properties[t];if(o)return o.includes(".")?this.getPropertyValue(s.data,o.split(".")):s.data[o]}return""}getRowHeight(e){return this.defaultRowHeight}getCustomClassesAt(e,t){return["ge-table-tree-cell","ge-table-tree-deep-"+this.filteredFlattenRows[e].deep]}getRowByIndex(e){return this.filteredFlattenRows[e]}getValueByT(e,t){return t.includes(".")?this.getPropertyValue(e,t.split(".")):e[t]}externalFilterChanged(e){this.lastPredictFn=e,this.doFiltering()}doSort(e){const{columnIndex:t,sortState:s}=e[e.length-1],o=s==="asc"?1:s==="desc"?-1:0,i=this.properties[t];return this.treeSort(this.rows,i,o),this.flattenRows=this.service.flattenTree(this.rows),this.filteredFlattenRows=[...this.flattenRows],!0}toggleExpandCollapseAll(e){this.expandAllRecursive(this.rows,e),this.flattenRows=this.service.flattenTree(this.rows),this.doFiltering()}setAllParentsOk(e){return e.parent&&(e.parent.keep=!0,this.setAllParentsOk(e.parent)),!1}setValue(e,t,s){var r;const o=(r=this.columnDefs[t])==null?void 0:r.editInputPipe;o&&(s=o(s,e,t));const i=this.getRowByIndex(e);if(i){const n=i.data,l=this.columnDefs[t].property;return l.includes(".")?this.setPropertyValue(n,l.split("."),s):(n[l]=s,!0)}return!1}genericTreeTableSortComparator(e,t){return(s,o)=>{const i=this.getValueByT(s.data,e),r=this.getValueByT(o.data,e);return this.sorterService.genericSortComparator(i,r,t)}}expandAllRecursive(e,t){for(const s of e)s.expanded=t,s.children&&this.expandAllRecursive(s.children,t)}doFiltering(){if(!this.lastPredictFn)this.filteredFlattenRows=[...this.flattenRows?this.flattenRows:[]];else{this.flattenRows||(this.flattenRows=[]);let e=0;this.flattenRows.forEach(s=>{e=Math.max(e,s.deep)});const t=this.flattenRows.filter((s,o,i)=>this.lastPredictFn(s,o,i));this.flattenRows.forEach(s=>s.keep=!1),this.flattenRows.forEach(s=>{t.includes(s)&&(s.keep=!0,this.setAllParentsOk(s))}),this.filteredFlattenRows=this.flattenRows.filter((s,o,i)=>s.keep)}}getPropertyValue(e,t){const s=t.shift();let o=e[s];return o&&t.length?this.getPropertyValue(o,t):o}treeSort(e,t,s){e.sort(this.genericTreeTableSortComparator(t,s));for(const o of e)o.children&&this.treeSort(o.children,t,s)}}class we{constructor(e=[]){this.allRootNodes=e}checkRow(e,t){if(e.checked=t,e.children)for(const s of e.children)this.checkRow(s,t);this.autoCheckParent(e.parent)}checkAll(e){for(const t of this.allRootNodes)t.checked=!1,t.children&&this.checkAll(t.children)}getCheckedRows(){const e=[];return this.addSelectedRecursive(this.allRootNodes,e),e}isRowChecked(e){if(e.checked)return"full";const t=this.areAllChildrenChecked(e),s=this.areAllChildrenUnchecked(e);return!t&&!s?"semi":"none"}setCheckedRows(e){this.addCheckedRows(e)}addCheckedRows(e){for(const t of e)t.checked=!0}autoCheckParent(e){if(e){const t=this.areAllChildrenChecked(e),s=this.areAllChildrenUnchecked(e);t?e.checked=!0:e.checked=!1,this.autoCheckParent(e.parent)}}areAllChildrenChecked(e){var t,s;if((t=e.children)!=null&&t.length){for(const o of e.children)if(!o.checked||(s=o.children)!=null&&s.length&&!this.areAllChildrenChecked(o))return!1}return!0}areAllChildrenUnchecked(e){var t,s;if((t=e.children)!=null&&t.length){for(const o of e.children)if(o.checked||(s=o.children)!=null&&s.length&&!this.areAllChildrenUnchecked(o))return!1}return!0}addSelectedRecursive(e,t){for(const s of e)s.checked&&t.push(s),s.children&&this.addSelectedRecursive(s.children,t)}}class Ce{constructor(e=0,t=0,s=0,o=0){this.top=e,this.right=t,this.bottom=s,this.left=o}}class vt{constructor(){this.checkedRows=[]}getCheckedRows(){return this.checkedRows}setCheckedRows(e){this.checkedRows=e}addCheckedRows(e){this.checkedRows||(this.checkedRows=[]);for(const t of e)this.checkedRows.includes(t)||this.checkedRows.push(t)}checkRow(e,t){this.checkedRows||(this.checkedRows=[]),t?this.checkedRows.includes(e)||this.checkedRows.push(e):this.removeSelectedRow(e)}isRowChecked(e){return this.checkedRows&&this.checkedRows.includes(e)?"full":"none"}checkAll(e){this.checkedRows=[]}removeSelectedRow(e){if(this.checkedRows){const t=this.checkedRows.indexOf(e);t>-1&&this.checkedRows.splice(t,1)}}}class Q{constructor(e,t,s,o=0,i=0,r=!1,n=new N,l=[],a=[],c=-1,d=0,u=400,f=()=>{}){var p,m,g,b;this.headerAreaModel=e,this.bodyAreaModel=t,this.footerAreaModel=s,this.fixedLeftColumnCount=o,this.fixedRightColumnCount=i,this.rowCheckboxVisible=r,this.defaultRowHeights=n,this.columnDefs=l,this.columnSizes=a,this.overridingColumnWidth=c,this.columnCount=d,this.parentSize=u,this.getSelectionModel=f,this.rowCount=0,this.contentHeightInPx=0,this.contentWidthInPx=0,this.padding=new Ce(0,0,0,0),this.xPositions=[],e.areaIdent="header",t.areaIdent="body",s.areaIdent="footer",this.columnCount||((p=this.columnDefs)!=null&&p.length?this.columnCount=this.columnDefs.length:(m=this.columnSizes)!=null&&m.length&&(this.columnCount=(g=this.columnSizes)==null?void 0:g.length)),(b=this.columnDefs)!=null&&b.length&&Xe(this.columnDefs[0])&&!t.rowSelectionModel&&(t.rowSelectionModel=new vt)}init(){this.recalcSize(this.parentSize),this.overridingColumnWidth===-1&&this.calcXPositions(),this.headerAreaModel&&this.headerAreaModel.init(),this.bodyAreaModel&&this.bodyAreaModel.init(),this.footerAreaModel&&this.footerAreaModel.init()}setParentWidth(e){this.parentSize=e}getColumnCount(){return this.columnCount}setColumnWidth(e,t){var s;t=Math.max(0,t),this.overridingColumnWidth!==-1&&(this.overridingColumnWidth=t),e>-1&&e<((s=this.columnSizes)==null?void 0:s.length)&&(this.columnSizes[e]=t),this.recalcContentWidthInPx()}getColumnWidth(e){var s;const t=this.getColumnDef(e);return t&&t.isVisible&&!t.isVisible()?0:this.overridingColumnWidth!==-1?this.overridingColumnWidth:e>-1&&e<((s=this.columnSizes)==null?void 0:s.length)?this.columnSizes[e]:0}getXPosByColumnIndex(e){return e===0?0:this.overridingColumnWidth>-1?this.overridingColumnWidth*e:this.xPositions[e]}recalcSize(e){this.recalcColumnWidths(e),this.recalcHeightAndPadding()}recalcHeightAndPadding(){const e=this.getAreaModel("body");this.rowCount=e.getRowCount(),this.contentHeightInPx=this.getAreaHeight("body"),this.recalcContentWidthInPx(),this.recalcPadding()}recalcPadding(){const e=this.getSideAreaWidth("west"),t=this.getSideAreaWidth("east"),s=this.getAreaHeight("header"),o=this.getAreaHeight("footer");this.padding=new Ce(s,t,o,e)}getPadding(){return this.padding}getContentHeightInPixel(){return this.contentHeightInPx}getContentWidthInPixel(){return this.contentWidthInPx}getRowHeight(e,t){return this.getAreaModel(e).getRowHeight(t)}getModel(e){return this.getAreaModel(e)}getAreaHeight(e){const t=this.getModel(e),s=t.getRowCount();if(this.defaultRowHeights[e])return s*this.defaultRowHeights[e];let o=0;for(let i=0;i<s;i++)o=o+t.getRowHeight(i);return o}getSideAreaWidth(e){const[t,s]=this.getSideStartAndEndColumnIndex(e);let o=0;for(let i=t;i<=s;i++)o=o+this.getColumnWidth(i);return o}getSideStartAndEndColumnIndex(e){const t=this.getFixedLeftColumnCount(),s=this.getFixedRightColumnCount();let o=0,i=this.columnCount-1;return e==="west"?i=t-1:e==="east"?o=this.columnCount-s:(o=t,i=this.columnCount-s-1),[o,i]}getColumnDef(e){if(e<this.columnDefs.length)return this.columnDefs[e]}getFixedLeftColumnCount(){return this.fixedLeftColumnCount}getFixedRightColumnCount(){return this.fixedRightColumnCount}getAreaModel(e){if(e==="header")return this.headerAreaModel;if(e==="body")return this.bodyAreaModel;if(e==="footer")return this.footerAreaModel;throw new Error("Wrong ident.")}getBodyModel(){return this.bodyAreaModel}isFooterVisibe(){var e;return(((e=this.footerAreaModel)==null?void 0:e.getRowCount())??0)>0}isHeaderVisibe(){var e;return(((e=this.headerAreaModel)==null?void 0:e.getRowCount())??0)>0}isRowCheckboxVisible(){return this.rowCheckboxVisible}externalFilterChanged(e){this.getAreaModel("body").externalFilterChanged(e)}doSort(e){return this.getAreaModel("body").doSort(e)}getColumnDefs(){return this.columnDefs}getColumnProperty(e){return this.columnDefs?this.columnDefs[e].property:""}getBodyRowByIndex(e){return this.getBodyModel().getRowByIndex(e)}isSortable(e){var t;if(this.columnDefs&&e<this.columnDefs.length){const s=(t=this.columnDefs[e])==null?void 0:t.sortable;if(typeof s=="function")return s()}return!1}changeColumnOrder(e,t){var s,o,i;this.arrayMove(this.columnDefs,e,t),this.arrayMove(this.columnSizes,e,t),(s=this.headerAreaModel)==null||s.changeColumnOrder(e,t),(o=this.bodyAreaModel)==null||o.changeColumnOrder(e,t),(i=this.footerAreaModel)==null||i.changeColumnOrder(e,t),this.calcXPositions()}recalcColumnWidths(e){var t,s,o;if(!((t=this.columnDefs)!=null&&t.length)&&!((s=this.columnSizes)!=null&&s.length)&&(this.columnSizes=new Array(this.getColumnCount()).fill(this.overridingColumnWidth)),(o=this.columnDefs)!=null&&o.length){const i=this.columnDefs.filter(l=>{var a;return((a=l.width)==null?void 0:a.unit)==="weight"});this.columnSizes=this.columnDefs.map(l=>{if(l.width.unit==="%"&&e){let a=Math.floor(l.width.value*e/100);if(l.minWidth){const c=this.sizeToPixel(l.minWidth,e);a=Math.max(c,a)}if(l.maxWidth){const c=this.sizeToPixel(l.maxWidth,e);a=Math.min(c,a)}return a}else if(l.width.unit==="px"&&e)return l.width.value;return 0});const r=this.columnSizes.reduce((l,a)=>l+a),n=e-r;if(n>0&&i.length){const l=i.map(a=>a.width.value).reduce((a,c)=>a+c);for(let a=0;a<this.columnDefs.length;a++){const c=this.columnDefs[a];c.width.unit==="weight"&&(this.columnSizes[a]=c.width.value*n/l)}}}}sizeToPixel(e,t){return e.unit==="px"?e.value:e.unit==="%"?Math.floor(e.value*t/100):-1}arrayMove(e,t,s){const o=e.splice(t,1)[0];return e.splice(s,0,o),e}recalcContentWidthInPx(){this.contentWidthInPx=this.getSideAreaWidth("center")}calcXPositions(){const e=this.getColumnCount();this.xPositions=new Array(e+1),this.xPositions[0]=0;for(let t=0;t<e;t++)this.xPositions[t+1]=this.getColumnWidth(t)+this.xPositions[t]}setTableScope(e){this.tableScope=e}getTableScope(){return this.tableScope}}class Rt extends he{constructor(e,t,s,o=[]){super(e,o,s),this.areaIdent=e,this.rows=t,this.defaultRowHeight=s,this.columnDefs=o,this.sorterService=new Ct,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 W(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)}genericFlatTableSortComparator(e,t){return(s,o)=>{const i=this.getValueByT(s,e),r=this.getValueByT(o,e);return this.sorterService.genericSortComparator(i,r,t)}}getPropertyValue(e,t){const s=t.shift(),o=e[s];return o&&t.length?this.getPropertyValue(o,t):o}}class ve extends Rt{constructor(e,t,s,o){super(e,t,o,s),this.areaIdent=e,this.rows=t,this.columnDefs=s,this.defaultRowHeight=o}}class ${static createTableModel(e){var t,s,o,i,r,n,l,a,c,d,u,f,p,m;if(e.defaultRowHeights===void 0)if((t=e.tableOptions)!=null&&t.defaultRowHeights)e.defaultRowHeights=e.tableOptions.defaultRowHeights;else{if(e.defaultRowHeights=new N,e.headerAreaModel&&"defaultRowHeight"in e.headerAreaModel){const g=e.headerAreaModel.defaultRowHeight;g>-1&&(e.defaultRowHeights.header=g)}if(e.bodyAreaModel&&"defaultRowHeight"in e.bodyAreaModel){const g=e.bodyAreaModel.defaultRowHeight;g>-1&&(e.defaultRowHeights.body=g)}if(e.footerAreaModel&&"defaultRowHeight"in e.footerAreaModel){const g=e.footerAreaModel.defaultRowHeight;g>-1&&(e.defaultRowHeights.footer=g)}}if(e.columnDefs===void 0&&((s=e.properties)!=null&&s.length?e.columnDefs=e.properties.map(g=>new H(g,g.toUpperCase(),xe)):(o=e.rows)!=null&&o.length?e.columnDefs=Object.keys(e.rows[0]).map(g=>new H(g,g.toUpperCase(),xe)):e.columnDefs=[]),e.columnCount===void 0&&((i=e.columnDefs)!=null&&i.length?e.columnCount=e.columnDefs.length:(r=e.headerData)!=null&&r.length?e.columnCount=e.headerData[0].length:(n=e.columnSizes)!=null&&n.length?e.columnCount=(l=e.columnSizes)==null?void 0:l.length:console.warn('Property "columnCount" is missing and cannot be derived from other properties.')),e.headerAreaModel||((a=e.headerData)!=null&&a.length?e.headerAreaModel=new P("header",e.headerData,e.defaultRowHeights.header,e.columnDefs):(c=e.columnDefs)!=null&&c.length?e.headerAreaModel=new P("header",[e.columnDefs.map(g=>g.headerLabel)],e.defaultRowHeights.header,e.columnDefs):e.headerAreaModel=new F("header")),e.footerAreaModel||((d=e.footerData)!=null&&d.length?e.footerAreaModel=new P("footer",e.footerData,e.defaultRowHeights.footer,e.columnDefs):e.footerAreaModel=new F("footer")),!e.bodyAreaModel)if(e.rows)if((u=e.rows)!=null&&u.length&&W(e.rows[0])){const g=e.rows;e.bodyAreaModel=new Se("body",g,e.defaultRowHeights.body,e.columnDefs),(e.columnDefs[0].property==="CheckboxColumn"||(f=e.tableOptions)!=null&&f.showCheckboxWihoutExtraColumn)&&(e.bodyAreaModel.rowSelectionModel=new we(g))}else e.bodyAreaModel=new ve("body",e.rows,e.columnDefs,e.defaultRowHeights.body);else e.bodyData?e.bodyAreaModel=new P("body",e.bodyData,e.defaultRowHeights.body):e.bodyAreaModel=new F("body");return e.fixedLeftColumnCount===void 0&&(e.fixedLeftColumnCount=0),e.fixedRightColumnCount===void 0&&(e.fixedRightColumnCount=0),e.rowCheckboxVisible===void 0&&(e.rowCheckboxVisible=!1),e.overridingColumnWidth===void 0&&(e.overridingColumnWidth=-1),!e.getSelectionModel&&((p=e.tableOptions)!=null&&p.getSelectionModel)&&(e.getSelectionModel=(m=e.tableOptions)==null?void 0:m.getSelectionModel),new Q(e.headerAreaModel,e.bodyAreaModel,e.footerAreaModel,e.fixedLeftColumnCount,e.fixedRightColumnCount,e.rowCheckboxVisible,e.defaultRowHeights,e.columnDefs,e.columnSizes,e.overridingColumnWidth,e.columnCount,e.parentSize,e.getSelectionModel)}static buildByTypedRowsParam(e){return $.buildByTypedRows(e.rows??[],e.columnDefs,e.tableOptions??new K,e.fixedLeftColumnCount??0,e.fixedRightColumnCount??0)}static buildByTypedRows(e,t,s=new K,o=0,i=0){const r=s.defaultRowHeights,n=t[0].property==="CheckboxColumn";if(e!=null&&e.length&&W(e[0])){const a=e,c=new Se("body",a,r.body,t);return(n||s.showCheckboxWihoutExtraColumn)&&(c.rowSelectionModel=new we(a)),$.createByAreaModelsParam({headerAreaModel:new P("header",[t.map(d=>d.headerLabel)],r.header),bodyAreaModel:c,footerAreaModel:new P("footer",[],r.footer),columnDefs:t,fixedLeftColumnCount:o,fixedRightColumnCount:i,defaultRowHeights:s.defaultRowHeights,rowCheckboxVisible:!1,columnSizes:[],columnCount:t.length,overridingColumnWidth:-1})}return $.createByObjectArrayParam({rows:e,columnDefs:t,fixedLeftColumnCount:o,fixedRightColumnCount:i,defaultRowHeights:s.defaultRowHeights})}static createByObjectArrayParam(e){const t=e.rowCheckboxVisible!==void 0?e.rowCheckboxVisible:!1;return $.createByObjectArray(e.rows,e.header??[],e.footer??[],e.fixedLeftColumnCount??0,e.fixedRightColumnCount??0,t,e.defaultRowHeights??new N,e.columnDefs??[],e.columnSizes??[])}static createByAreaModels(e=new F,t,s=new F,o=0,i=0,r=!1,n=new N,l,a=[],c=-1,d){return new Q(e,t,s,o,i,r,n,l,a,c,d)}static createByAreaModelsParam(e){return $.createByAreaModels(e.headerAreaModel??new F,e.bodyAreaModel,e.footerAreaModel??new F,e.fixedLeftColumnCount??0,e.fixedRightColumnCount??0,e.rowCheckboxVisible===void 0?!1:e.rowCheckboxVisible,e.defaultRowHeights,e.columnDefs??[],e.columnSizes??[],e.overridingColumnWidth??-1,e.columnCount??0)}static createByObjectArray(e,t=[],s=[],o=0,i=0,r=!1,n=new N,l,a=[]){let c;t!=null&&t.length?c=new P("header",t,n.header,l):l!=null&&l.length?c=new P("header",[l.map(f=>f.headerLabel)],n.header,l):c=new F;const d=s?new P("footer",s,n.footer,l):new F,u=new ve("body",e,l,n.body);return new Q(c,u,d,o,i,r,n,l,a)}}const ys=["COPY_2_CLIPBOARD","START_EDITING","TOGGLE_SELECTION","SELECT_ALL","DESELECT_ALL","NAVIGATE_LEFT","NAVIGATE_RIGHT","NAVIGATE_UP","NAVIGATE_DOWN"];class At{constructor(e,t){this.tableModel=e,this.tableOptions=t}}class Et{constructor(e,t,s,o,i,r,n){this.emmitDataKey=e,this.emmitCancelKey=t,this.queryId=s,this.filter=o,this.sorting=i,this.startIndex=r,this.endIndex=n}}class xs extends Et{constructor(e,t,s,o,i,r,n,l){super(e,t,s,o,i,r,n),this.rows=l}}class Tt{constructor(e,t){this.value=e,this.label=t}}class Ss{constructor(e,t){this.index=e,this.px=t}}const ws={body:["ge-table-text-align-left"]},Cs={body:["ge-table-text-align-center"]},vs={body:["ge-table-text-align-right"]},Rs={header:["ge-table-text-align-left"],body:["ge-table-text-align-left"],footer:["ge-table-text-align-left"]},As={header:["ge-table-text-align-center"],body:["ge-table-text-align-center"],footer:["ge-table-text-align-center"]},Es={header:["ge-table-text-align-right"],body:["ge-table-text-align-right"],footer:["ge-table-text-align-right"]};class Re{render(e,t,s,o,i,r,n){if(i.isRowCheckable(t)){n.addClass(e,"ge-table-row-checkbox-div");const l=i.isRowChecked(t),a=l==="full"?"checked":"",c=l==="semi"?'<span style="opacity: 0.4;">✓<span>':"";e.innerHTML=`
|
|
305
|
+
}`};let me=re;class be{constructor(e,t=!0,s,o,i=0,r=!1,n=!1){this.data=e,this.expanded=t,this.children=s,this.parent=o,this.deep=i,this.checked=r,this.keep=n,this.type="TreeRow"}}class oe{static buildTreeRows(e,t="children",s=12){const o=[];for(const i of e)o.push(oe.buildTreeRow(i,t,void 0,0,s));return o}static buildTreeRow(e,t="children",s=new be(e,!0,[],void 0,0),o=0,i=12){var n;if(o>i)return console.warn("Max deep limit reached: ",o),s;const r=e[t];if(r)for(const l of r){const a=new be(l,!0,[],s,o+1);if((n=s.children)==null||n.push(a),oe.buildTreeRow(l,t,a,o+1),o>i)return console.warn("Max deep limit reached: ",o),s}return s}}class N{constructor(e=34,t=34,s=34){this.header=e,this.body=t,this.footer=s}}class y{constructor(e=100,t="px"){this.value=e,this.unit=t}}const xt=()=>!0,ye=()=>!1;class H{constructor(e,t,s=new y(100,"px"),o=new M,i=new M,r=new y(100,"px"),n=new y(100,"px"),l,a,c,d,u,f,p,m,g=()=>this.visible){this.property=e,this.headerLabel=t,this.width=s,this.classes=o,this.rendererMap=i,this.minWidth=r,this.maxWidth=n,this.sortable=l,this.sortComparator=a,this.sortState=c,this.sortStatesOrder=d,this.sortIconVisible=u,this.editable=f,this.getEditRenderer=p,this.editInputPipe=m,this.isVisible=g,this.visible=!0,s.unit!=="px"&&(this.minWidth=new y(0,"px"),this.maxWidth=new y(1e5,"px"))}static bodyRenderer(e){return new M(void 0,e,void 0)}static create(e){const t=new M(e.headerRenderer,e.bodyRenderer,e.footerRenderer),s=new M(e.headerClasses,e.bodyClasses,e.footerClasses),o=e.sortIconVisible??e.sortable??ye,i=e.editable??e.editable??ye,r=e.isVisible??e.isVisible??xt;return new H(e.property??"",e.headerLabel??"",e.width??new y(100,"px"),s,t,e.minWidth??new y(100,"px"),e.maxWidth??new y(100,"px"),e.sortable,e.sortComparator,e.sortState,e.sortStatesOrder,o,i,e.getEditRenderer,e.editInputPipe,r)}}const Nt=new y(500,"px"),Gt=new y(400,"px"),St=new y(300,"px"),zt=new y(290,"px"),jt=new y(280,"px"),Yt=new y(270,"px"),Ut=new y(260,"px"),Kt=new y(250,"px"),Xt=new y(240,"px"),Jt=new y(230,"px"),qt=new y(220,"px"),Zt=new y(210,"px"),xe=new y(200,"px"),Qt=new y(190,"px"),es=new y(180,"px"),ts=new y(170,"px"),ss=new y(160,"px"),os=new y(150,"px"),is=new y(140,"px"),rs=new y(130,"px"),ns=new y(120,"px"),ls=new y(110,"px"),as=new y(100,"px"),cs=new y(90,"px"),ds=new y(80,"px"),hs=new y(70,"px"),us=new y(60,"px"),ps=new y(50,"px"),gs=new y(40,"px"),fs=new y(30,"px"),ms=new y(20,"px"),bs=new y(10,"px"),ys=new y(0,"px");class ue{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 n;const o=(n=this.columnDefs[t])==null?void 0:n.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 P extends ue{constructor(e,t,s,o=[]){super(e,o,s),this.areaIdent=e,this.arr=t,this.defaultRowHeight=s,this.columnDefs=o,this.filteredArr=[...t]}externalFilterChanged(e){this.filteredArr=this.arr?this.arr.filter(e):[]}getRowCount(){return this.filteredArr?this.filteredArr.length:0}getValueAt(e,t){return this.filteredArr[e][t]}setValue(e,t,s){var i;const o=(i=this.columnDefs[t])==null?void 0:i.editInputPipe;return o&&(s=o(s,e,t)),this.arr[e][t]=s,!0}getRowByIndex(e){return this.filteredArr[e]}getRowHeight(e){return this.defaultRowHeight}changeColumnOrder(e,t){this.filteredArr.forEach(s=>this.arrayMove(s,e,t)),super.changeColumnOrder(e,t)}}class F{constructor(e="body"){this.areaIdent=e,this.rowSelectionModel=void 0}getRowCount(){return 0}getValueAt(e,t){return""}getTextValueAt(e,t){return""}getCellRenderer(e,t){}getRowHeight(e){return 0}getColspanAt(e,t){return 0}getCustomClassesAt(e,t){return[]}getCustomStyleAt(e,t){}getRowspanAt(e,t){return 0}getRowByIndex(e){}isRowCheckable(e){return!1}isRowChecked(e){}setRowChecked(e,t){}getTooltipAt(e,t){return""}getMaxColspan(){return 0}getMaxRowspan(){return 0}getYPosByRowIndex(e){return 0}init(){}externalFilterChanged(e){}isFilterable(){return!1}doSort(e){return!1}isEditable(e,t){return!1}setValue(e,t,s){return!1}isSelectable(e,t){return!1}changeColumnOrder(e,t){}}class wt{flattenTree(e,t=[]){var s;for(const o of e)this.isVisible(o)&&t.push(o),(s=o.children)!=null&&s.length&&this.flattenTree(o.children,t);return t}isVisible(e){return e.parent?e.parent.expanded?this.isVisible(e.parent):!1:!0}}class Ct{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 Se extends ue{constructor(e,t,s,o=[]){super(e,o,s),this.areaIdent=e,this.rows=t,this.defaultRowHeight=s,this.columnDefs=o,this.type="AreaModelTree",this.sorterService=new Ct,this.service=new wt,this.properties=o.map(i=>i.property),this.flattenRows=this.service.flattenTree(t),this.filteredFlattenRows=[...this.flattenRows]}changeColumnOrder(e,t){this.arrayMove(this.properties,e,t),super.changeColumnOrder(e,t)}recalcVisibleTreeRows(){this.filteredFlattenRows=this.service.flattenTree(this.rows)}getFilteredFlattenRows(){return this.filteredFlattenRows}getRowCount(){let e=0;for(const t of this.filteredFlattenRows)this.service.isVisible(t)&&e++;return e}getValueAt(e,t){const s=this.getRowByIndex(e);if(s){const o=this.properties[t];if(o)return o.includes(".")?this.getPropertyValue(s.data,o.split(".")):s.data[o]}return""}getRowHeight(e){return this.defaultRowHeight}getCustomClassesAt(e,t){return["ge-table-tree-cell","ge-table-tree-deep-"+this.filteredFlattenRows[e].deep]}getRowByIndex(e){return this.filteredFlattenRows[e]}getValueByT(e,t){return t.includes(".")?this.getPropertyValue(e,t.split(".")):e[t]}externalFilterChanged(e){this.lastPredictFn=e,this.doFiltering()}doSort(e){const{columnIndex:t,sortState:s}=e[e.length-1],o=s==="asc"?1:s==="desc"?-1:0,i=this.properties[t];return this.treeSort(this.rows,i,o),this.flattenRows=this.service.flattenTree(this.rows),this.filteredFlattenRows=[...this.flattenRows],!0}toggleExpandCollapseAll(e){this.expandAllRecursive(this.rows,e),this.flattenRows=this.service.flattenTree(this.rows),this.doFiltering()}setAllParentsOk(e){return e.parent&&(e.parent.keep=!0,this.setAllParentsOk(e.parent)),!1}setValue(e,t,s){var r;const o=(r=this.columnDefs[t])==null?void 0:r.editInputPipe;o&&(s=o(s,e,t));const i=this.getRowByIndex(e);if(i){const n=i.data,l=this.columnDefs[t].property;return l.includes(".")?this.setPropertyValue(n,l.split("."),s):(n[l]=s,!0)}return!1}genericTreeTableSortComparator(e,t){return(s,o)=>{const i=this.getValueByT(s.data,e),r=this.getValueByT(o.data,e);return this.sorterService.genericSortComparator(i,r,t)}}expandAllRecursive(e,t){for(const s of e)s.expanded=t,s.children&&this.expandAllRecursive(s.children,t)}doFiltering(){if(!this.lastPredictFn)this.filteredFlattenRows=[...this.flattenRows?this.flattenRows:[]];else{this.flattenRows||(this.flattenRows=[]);let e=0;this.flattenRows.forEach(s=>{e=Math.max(e,s.deep)});const t=this.flattenRows.filter((s,o,i)=>this.lastPredictFn(s,o,i));this.flattenRows.forEach(s=>s.keep=!1),this.flattenRows.forEach(s=>{t.includes(s)&&(s.keep=!0,this.setAllParentsOk(s))}),this.filteredFlattenRows=this.flattenRows.filter((s,o,i)=>s.keep)}}getPropertyValue(e,t){const s=t.shift();let o=e[s];return o&&t.length?this.getPropertyValue(o,t):o}treeSort(e,t,s){e.sort(this.genericTreeTableSortComparator(t,s));for(const o of e)o.children&&this.treeSort(o.children,t,s)}}class we{constructor(e=[]){this.allRootNodes=e}checkRow(e,t){if(e.checked=t,e.children)for(const s of e.children)this.checkRow(s,t);this.autoCheckParent(e.parent)}checkAll(e){for(const t of this.allRootNodes)t.checked=!1,t.children&&this.checkAll(t.children)}getCheckedRows(){const e=[];return this.addSelectedRecursive(this.allRootNodes,e),e}isRowChecked(e){if(e.checked)return"full";const t=this.areAllChildrenChecked(e),s=this.areAllChildrenUnchecked(e);return!t&&!s?"semi":"none"}setCheckedRows(e){this.addCheckedRows(e)}addCheckedRows(e){for(const t of e)t.checked=!0}autoCheckParent(e){if(e){const t=this.areAllChildrenChecked(e),s=this.areAllChildrenUnchecked(e);t?e.checked=!0:e.checked=!1,this.autoCheckParent(e.parent)}}areAllChildrenChecked(e){var t,s;if((t=e.children)!=null&&t.length){for(const o of e.children)if(!o.checked||(s=o.children)!=null&&s.length&&!this.areAllChildrenChecked(o))return!1}return!0}areAllChildrenUnchecked(e){var t,s;if((t=e.children)!=null&&t.length){for(const o of e.children)if(o.checked||(s=o.children)!=null&&s.length&&!this.areAllChildrenUnchecked(o))return!1}return!0}addSelectedRecursive(e,t){for(const s of e)s.checked&&t.push(s),s.children&&this.addSelectedRecursive(s.children,t)}}class Ce{constructor(e=0,t=0,s=0,o=0){this.top=e,this.right=t,this.bottom=s,this.left=o}}class vt{constructor(){this.checkedRows=[]}getCheckedRows(){return this.checkedRows}setCheckedRows(e){this.checkedRows=e}addCheckedRows(e){this.checkedRows||(this.checkedRows=[]);for(const t of e)this.checkedRows.includes(t)||this.checkedRows.push(t)}checkRow(e,t){this.checkedRows||(this.checkedRows=[]),t?this.checkedRows.includes(e)||this.checkedRows.push(e):this.removeSelectedRow(e)}isRowChecked(e){return this.checkedRows&&this.checkedRows.includes(e)?"full":"none"}checkAll(e){this.checkedRows=[]}removeSelectedRow(e){if(this.checkedRows){const t=this.checkedRows.indexOf(e);t>-1&&this.checkedRows.splice(t,1)}}}class Q{constructor(e,t,s,o=0,i=0,r=!1,n=new N,l=[],a=[],c=-1,d=0,u=400,f=()=>{}){var p,m,g,b;this.headerAreaModel=e,this.bodyAreaModel=t,this.footerAreaModel=s,this.fixedLeftColumnCount=o,this.fixedRightColumnCount=i,this.rowCheckboxVisible=r,this.defaultRowHeights=n,this.columnDefs=l,this.columnSizes=a,this.overridingColumnWidth=c,this.columnCount=d,this.parentSize=u,this.getSelectionModel=f,this.rowCount=0,this.contentHeightInPx=0,this.contentWidthInPx=0,this.padding=new Ce(0,0,0,0),this.xPositions=[],e.areaIdent="header",t.areaIdent="body",s.areaIdent="footer",this.columnCount||((p=this.columnDefs)!=null&&p.length?this.columnCount=this.columnDefs.length:(m=this.columnSizes)!=null&&m.length&&(this.columnCount=(g=this.columnSizes)==null?void 0:g.length)),(b=this.columnDefs)!=null&&b.length&&Xe(this.columnDefs[0])&&!t.rowSelectionModel&&(t.rowSelectionModel=new vt)}init(){this.recalcSize(this.parentSize),this.overridingColumnWidth===-1&&this.calcXPositions(),this.headerAreaModel&&this.headerAreaModel.init(),this.bodyAreaModel&&this.bodyAreaModel.init(),this.footerAreaModel&&this.footerAreaModel.init()}setParentWidth(e){this.parentSize=e}getColumnCount(){return this.columnCount}setColumnWidth(e,t){var s;t=Math.max(0,t),this.overridingColumnWidth!==-1&&(this.overridingColumnWidth=t),e>-1&&e<((s=this.columnSizes)==null?void 0:s.length)&&(this.columnSizes[e]=t),this.recalcContentWidthInPx()}getColumnWidth(e){var s;const t=this.getColumnDef(e);return t&&t.isVisible&&!t.isVisible()?0:this.overridingColumnWidth!==-1?this.overridingColumnWidth:e>-1&&e<((s=this.columnSizes)==null?void 0:s.length)?this.columnSizes[e]:0}getXPosByColumnIndex(e){return e===0?0:this.overridingColumnWidth>-1?this.overridingColumnWidth*e:this.xPositions[e]}recalcSize(e){this.recalcColumnWidths(e),this.recalcHeightAndPadding()}recalcHeightAndPadding(){const e=this.getAreaModel("body");this.rowCount=e.getRowCount(),this.contentHeightInPx=this.getAreaHeight("body"),this.recalcContentWidthInPx(),this.recalcPadding()}recalcPadding(){const e=this.getSideAreaWidth("west"),t=this.getSideAreaWidth("east"),s=this.getAreaHeight("header"),o=this.getAreaHeight("footer");this.padding=new Ce(s,t,o,e)}getPadding(){return this.padding}getContentHeightInPixel(){return this.contentHeightInPx}getContentWidthInPixel(){return this.contentWidthInPx}getRowHeight(e,t){return this.getAreaModel(e).getRowHeight(t)}getModel(e){return this.getAreaModel(e)}getAreaHeight(e){const t=this.getModel(e),s=t.getRowCount();if(this.defaultRowHeights[e])return s*this.defaultRowHeights[e];let o=0;for(let i=0;i<s;i++)o=o+t.getRowHeight(i);return o}getSideAreaWidth(e){const[t,s]=this.getSideStartAndEndColumnIndex(e);let o=0;for(let i=t;i<=s;i++)o=o+this.getColumnWidth(i);return o}getSideStartAndEndColumnIndex(e){const t=this.getFixedLeftColumnCount(),s=this.getFixedRightColumnCount();let o=0,i=this.columnCount-1;return e==="west"?i=t-1:e==="east"?o=this.columnCount-s:(o=t,i=this.columnCount-s-1),[o,i]}getColumnDef(e){if(e<this.columnDefs.length)return this.columnDefs[e]}getFixedLeftColumnCount(){return this.fixedLeftColumnCount}getFixedRightColumnCount(){return this.fixedRightColumnCount}getAreaModel(e){if(e==="header")return this.headerAreaModel;if(e==="body")return this.bodyAreaModel;if(e==="footer")return this.footerAreaModel;throw new Error("Wrong ident.")}getBodyModel(){return this.bodyAreaModel}isFooterVisibe(){var e;return(((e=this.footerAreaModel)==null?void 0:e.getRowCount())??0)>0}isHeaderVisibe(){var e;return(((e=this.headerAreaModel)==null?void 0:e.getRowCount())??0)>0}isRowCheckboxVisible(){return this.rowCheckboxVisible}externalFilterChanged(e){this.getAreaModel("body").externalFilterChanged(e)}doSort(e){return this.getAreaModel("body").doSort(e)}getColumnDefs(){return this.columnDefs}getColumnProperty(e){return this.columnDefs?this.columnDefs[e].property:""}getBodyRowByIndex(e){return this.getBodyModel().getRowByIndex(e)}isSortable(e){var t;if(this.columnDefs&&e<this.columnDefs.length){const s=(t=this.columnDefs[e])==null?void 0:t.sortable;if(typeof s=="function")return s()}return!1}changeColumnOrder(e,t){var s,o,i;this.arrayMove(this.columnDefs,e,t),this.arrayMove(this.columnSizes,e,t),(s=this.headerAreaModel)==null||s.changeColumnOrder(e,t),(o=this.bodyAreaModel)==null||o.changeColumnOrder(e,t),(i=this.footerAreaModel)==null||i.changeColumnOrder(e,t),this.calcXPositions()}recalcColumnWidths(e){var t,s,o;if(!((t=this.columnDefs)!=null&&t.length)&&!((s=this.columnSizes)!=null&&s.length)&&(this.columnSizes=new Array(this.getColumnCount()).fill(this.overridingColumnWidth)),(o=this.columnDefs)!=null&&o.length){const i=this.columnDefs.filter(l=>{var a;return((a=l.width)==null?void 0:a.unit)==="weight"});this.columnSizes=this.columnDefs.map(l=>{if(l.width.unit==="%"&&e){let a=Math.floor(l.width.value*e/100);if(l.minWidth){const c=this.sizeToPixel(l.minWidth,e);a=Math.max(c,a)}if(l.maxWidth){const c=this.sizeToPixel(l.maxWidth,e);a=Math.min(c,a)}return a}else if(l.width.unit==="px"&&e)return l.width.value;return 0});const r=this.columnSizes.reduce((l,a)=>l+a),n=e-r;if(n>0&&i.length){const l=i.map(a=>a.width.value).reduce((a,c)=>a+c);for(let a=0;a<this.columnDefs.length;a++){const c=this.columnDefs[a];c.width.unit==="weight"&&(this.columnSizes[a]=c.width.value*n/l)}}}}sizeToPixel(e,t){return e.unit==="px"?e.value:e.unit==="%"?Math.floor(e.value*t/100):-1}arrayMove(e,t,s){const o=e.splice(t,1)[0];return e.splice(s,0,o),e}recalcContentWidthInPx(){this.contentWidthInPx=this.getSideAreaWidth("center")}calcXPositions(){const e=this.getColumnCount();this.xPositions=new Array(e+1),this.xPositions[0]=0;for(let t=0;t<e;t++)this.xPositions[t+1]=this.getColumnWidth(t)+this.xPositions[t]}setTableScope(e){this.tableScope=e}getTableScope(){return this.tableScope}}class Rt extends ue{constructor(e,t,s,o=[]){super(e,o,s),this.areaIdent=e,this.rows=t,this.defaultRowHeight=s,this.columnDefs=o,this.sorterService=new Ct,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 W(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)}genericFlatTableSortComparator(e,t){return(s,o)=>{const i=this.getValueByT(s,e),r=this.getValueByT(o,e);return this.sorterService.genericSortComparator(i,r,t)}}getPropertyValue(e,t){const s=t.shift(),o=e[s];return o&&t.length?this.getPropertyValue(o,t):o}}class ve extends Rt{constructor(e,t,s,o){super(e,t,o,s),this.areaIdent=e,this.rows=t,this.columnDefs=s,this.defaultRowHeight=o}}class ${static createTableModel(e){var t,s,o,i,r,n,l,a,c,d,u,f,p,m;if(e.defaultRowHeights===void 0)if((t=e.tableOptions)!=null&&t.defaultRowHeights)e.defaultRowHeights=e.tableOptions.defaultRowHeights;else{if(e.defaultRowHeights=new N,e.headerAreaModel&&"defaultRowHeight"in e.headerAreaModel){const g=e.headerAreaModel.defaultRowHeight;g>-1&&(e.defaultRowHeights.header=g)}if(e.bodyAreaModel&&"defaultRowHeight"in e.bodyAreaModel){const g=e.bodyAreaModel.defaultRowHeight;g>-1&&(e.defaultRowHeights.body=g)}if(e.footerAreaModel&&"defaultRowHeight"in e.footerAreaModel){const g=e.footerAreaModel.defaultRowHeight;g>-1&&(e.defaultRowHeights.footer=g)}}if(e.columnDefs===void 0&&((s=e.properties)!=null&&s.length?e.columnDefs=e.properties.map(g=>new H(g,g.toUpperCase(),xe)):(o=e.rows)!=null&&o.length?e.columnDefs=Object.keys(e.rows[0]).map(g=>new H(g,g.toUpperCase(),xe)):e.columnDefs=[]),e.columnCount===void 0&&((i=e.columnDefs)!=null&&i.length?e.columnCount=e.columnDefs.length:(r=e.headerData)!=null&&r.length?e.columnCount=e.headerData[0].length:(n=e.columnSizes)!=null&&n.length?e.columnCount=(l=e.columnSizes)==null?void 0:l.length:console.warn('Property "columnCount" is missing and cannot be derived from other properties.')),e.headerAreaModel||((a=e.headerData)!=null&&a.length?e.headerAreaModel=new P("header",e.headerData,e.defaultRowHeights.header,e.columnDefs):(c=e.columnDefs)!=null&&c.length?e.headerAreaModel=new P("header",[e.columnDefs.map(g=>g.headerLabel)],e.defaultRowHeights.header,e.columnDefs):e.headerAreaModel=new F("header")),e.footerAreaModel||((d=e.footerData)!=null&&d.length?e.footerAreaModel=new P("footer",e.footerData,e.defaultRowHeights.footer,e.columnDefs):e.footerAreaModel=new F("footer")),!e.bodyAreaModel)if(e.rows)if((u=e.rows)!=null&&u.length&&W(e.rows[0])){const g=e.rows;e.bodyAreaModel=new Se("body",g,e.defaultRowHeights.body,e.columnDefs),(e.columnDefs[0].property==="CheckboxColumn"||(f=e.tableOptions)!=null&&f.showCheckboxWihoutExtraColumn)&&(e.bodyAreaModel.rowSelectionModel=new we(g))}else e.bodyAreaModel=new ve("body",e.rows,e.columnDefs,e.defaultRowHeights.body);else e.bodyData?e.bodyAreaModel=new P("body",e.bodyData,e.defaultRowHeights.body):e.bodyAreaModel=new F("body");return e.fixedLeftColumnCount===void 0&&(e.fixedLeftColumnCount=0),e.fixedRightColumnCount===void 0&&(e.fixedRightColumnCount=0),e.rowCheckboxVisible===void 0&&(e.rowCheckboxVisible=!1),e.overridingColumnWidth===void 0&&(e.overridingColumnWidth=-1),!e.getSelectionModel&&((p=e.tableOptions)!=null&&p.getSelectionModel)&&(e.getSelectionModel=(m=e.tableOptions)==null?void 0:m.getSelectionModel),new Q(e.headerAreaModel,e.bodyAreaModel,e.footerAreaModel,e.fixedLeftColumnCount,e.fixedRightColumnCount,e.rowCheckboxVisible,e.defaultRowHeights,e.columnDefs,e.columnSizes,e.overridingColumnWidth,e.columnCount,e.parentSize,e.getSelectionModel)}static buildByTypedRowsParam(e){return $.buildByTypedRows(e.rows??[],e.columnDefs,e.tableOptions??new K,e.fixedLeftColumnCount??0,e.fixedRightColumnCount??0)}static buildByTypedRows(e,t,s=new K,o=0,i=0){const r=s.defaultRowHeights,n=t[0].property==="CheckboxColumn";if(e!=null&&e.length&&W(e[0])){const a=e,c=new Se("body",a,r.body,t);return(n||s.showCheckboxWihoutExtraColumn)&&(c.rowSelectionModel=new we(a)),$.createByAreaModelsParam({headerAreaModel:new P("header",[t.map(d=>d.headerLabel)],r.header),bodyAreaModel:c,footerAreaModel:new P("footer",[],r.footer),columnDefs:t,fixedLeftColumnCount:o,fixedRightColumnCount:i,defaultRowHeights:s.defaultRowHeights,rowCheckboxVisible:!1,columnSizes:[],columnCount:t.length,overridingColumnWidth:-1})}return $.createByObjectArrayParam({rows:e,columnDefs:t,fixedLeftColumnCount:o,fixedRightColumnCount:i,defaultRowHeights:s.defaultRowHeights})}static createByObjectArrayParam(e){const t=e.rowCheckboxVisible!==void 0?e.rowCheckboxVisible:!1;return $.createByObjectArray(e.rows,e.header??[],e.footer??[],e.fixedLeftColumnCount??0,e.fixedRightColumnCount??0,t,e.defaultRowHeights??new N,e.columnDefs??[],e.columnSizes??[])}static createByAreaModels(e=new F,t,s=new F,o=0,i=0,r=!1,n=new N,l,a=[],c=-1,d){return new Q(e,t,s,o,i,r,n,l,a,c,d)}static createByAreaModelsParam(e){return $.createByAreaModels(e.headerAreaModel??new F,e.bodyAreaModel,e.footerAreaModel??new F,e.fixedLeftColumnCount??0,e.fixedRightColumnCount??0,e.rowCheckboxVisible===void 0?!1:e.rowCheckboxVisible,e.defaultRowHeights,e.columnDefs??[],e.columnSizes??[],e.overridingColumnWidth??-1,e.columnCount??0)}static createByObjectArray(e,t=[],s=[],o=0,i=0,r=!1,n=new N,l,a=[]){let c;t!=null&&t.length?c=new P("header",t,n.header,l):l!=null&&l.length?c=new P("header",[l.map(f=>f.headerLabel)],n.header,l):c=new F;const d=s?new P("footer",s,n.footer,l):new F,u=new ve("body",e,l,n.body);return new Q(c,u,d,o,i,r,n,l,a)}}const xs=["COPY_2_CLIPBOARD","START_EDITING","TOGGLE_SELECTION","SELECT_ALL","DESELECT_ALL","NAVIGATE_LEFT","NAVIGATE_RIGHT","NAVIGATE_UP","NAVIGATE_DOWN"];class At{constructor(e,t){this.tableModel=e,this.tableOptions=t}}class Et{constructor(e,t,s,o,i,r,n){this.emmitDataKey=e,this.emmitCancelKey=t,this.queryId=s,this.filter=o,this.sorting=i,this.startIndex=r,this.endIndex=n}}class Ss extends Et{constructor(e,t,s,o,i,r,n,l){super(e,t,s,o,i,r,n),this.rows=l}}class Tt{constructor(e,t){this.value=e,this.label=t}}class ws{constructor(e,t){this.index=e,this.px=t}}const Cs={body:["ge-table-text-align-left"]},vs={body:["ge-table-text-align-center"]},Rs={body:["ge-table-text-align-right"]},As={header:["ge-table-text-align-left"],body:["ge-table-text-align-left"],footer:["ge-table-text-align-left"]},Es={header:["ge-table-text-align-center"],body:["ge-table-text-align-center"],footer:["ge-table-text-align-center"]},Ts={header:["ge-table-text-align-right"],body:["ge-table-text-align-right"],footer:["ge-table-text-align-right"]};class Re{render(e,t,s,o,i,r,n){if(i.isRowCheckable(t)){n.addClass(e,"ge-table-row-checkbox-div");const l=i.isRowChecked(t),a=l==="full"?"checked":"",c=l==="semi"?'<span style="opacity: 0.4;">✓<span>':"";e.innerHTML=`
|
|
306
306
|
<input
|
|
307
307
|
type="checkbox"
|
|
308
308
|
data-area="${o}"
|
|
@@ -311,7 +311,7 @@ export class ${t} implements CellRendererIf {
|
|
|
311
311
|
data-input-type="checkbox"
|
|
312
312
|
${a}
|
|
313
313
|
class="ge-table-row-checkbox">
|
|
314
|
-
${c} `}}}class
|
|
314
|
+
${c} `}}}class Ms{constructor(){this.type="CheckboxColumnDef",this.property="CheckboxColumn",this.headerLabel="",this.width=new y(50,"px"),this.minWidth=new y(50,"px"),this.maxWidth=new y(100,"px"),this.rendererMap=new M(new Re,new Re,void 0),this.classes=new M([],["ge-table-text-align-left"],[])}}class Is{static body(e){return new M(void 0,e,void 0)}}class ks{constructor(e="down",t){this.status=e,this.originalEvent=t}}class Ds{constructor(e,t,s,o,i={}){this.area=e,this.rowIndex=t,this.columnIndex=s,this.value=o,this.cssClasses=i}}class Ps{constructor(){this.autoRestoreSortingState=!1,this.autoRestoreCollapsedExpandedState=!1,this.autoRestoreScrollPosition=!1,this.autoRestoreCheckedState=!1,this.autoRestoreSelectedState=!1,this.getStorageKeyFn=void 0,this.isSame=(e,t,s)=>{if(e&&t&&s.getRowId){const o=s.getRowId(e),i=s.getRowId(t);return o===i}return!1},this.getRowId=e=>{if(e){for(const t of["id","uuid"]){const s=e[t];if(s!=null)return s}try{return JSON.stringify(e)}catch(t){console.error(t)}}return console.warn('One of following options set to true without a valid "getRowId()": autoRestoreExpandedState, autoRestoreCheckedState.'),-1}}}class Mt{constructor(e,t,s,o=!1,i="normal",r=void 0){this.data=e,this.property=t,this.toggle=s,this.closed=o,this.visibility=i,this.children=r,this.impl="CellGroup"}}class It extends Mt{constructor(e,t=0,s=0,o){super(e.data,e.property,e.toggle,e.closed,e.visibility,e.children),this.rowIndex=t,this.childIndex=s,this.parent=o,this.impl="CellGroupExt",this.children=void 0,this.leftNeighbour=void 0,this.rightNeighbour=void 0}ownColumn(){return!!this.property}toString(){return this.data+""}getColumnIndex(){return this.parent?this.parent.getColumnIndex()+this.childIndex:(this.leftNeighbour,0)}isVisible(){return this.parent?this.visibility==="always"?this.parent.isVisible():this.visibility==="normal"||!this.visibility?this.parent.isVisible()&&!this.parent.closed:this.visibility==="inverted"?this.parent.isVisible()&&this.parent.closed:!0:!0}claimsSpace(){return this.isVisible()&&(this.ownColumn()||this.closed)}getColumnCount(e=this,t=0){var s;if(e!=null&&e.claimsSpace()&&t++,(s=e==null?void 0:e.children)!=null&&s.length)for(const o of e.children)t=this.getColumnCount(o,t);return t}getRowSpan(e=this,t){return e!=null&&e.claimsSpace()?t-this.getParentCount(e,0):1}getParentCount(e=this,t=0){return e.parent&&(t=t+1+this.getParentCount(e.parent,t)),t}log(e=10){const t=" ".substring(0,2*this.rowIndex),s=`${this.getColumnIndex()}`,o=`${this.getColumnCount(this)}`,i=`${this.getRowSpan(this,e)}`,r=`${this.getParentCount(this)}`,n=`${t+this.data}
|
|
315
315
|
childIndex:${this.childIndex}
|
|
316
316
|
row:${this.rowIndex}
|
|
317
317
|
col:${s}
|
|
@@ -323,12 +323,12 @@ export class ${t} implements CellRendererIf {
|
|
|
323
323
|
claimsSpace:${this.claimsSpace()}
|
|
324
324
|
colCount:${o}
|
|
325
325
|
rowSpan:${i}
|
|
326
|
-
pc:${r}`.replace(/[ \n]+/g," ");if(this.children)for(const l of this.children)l.log(e);return n}}class T{static buildColumnDefs(e,t=[]){for(const s of e)s.property&&t.push(H.create({property:s.property,headerLabel:s.data?s.data:s.property,isVisible:()=>typeof s.isVisible=="function"?s.isVisible():!0})),s.children&&T.buildColumnDefs(s.children,t);return t}static buildGroupExts(e,t=[],s=0,o){let i;for(let r=0;r<e.length;r++){const n=e[r],l=new It(n,s,r,o);i&&(l.leftNeighbour=i,i.rightNeighbour=l),t.push(l),n.children&&(l.children=T.buildGroupExts(n.children,[],s+1,l)),i=l}return t}static flattenGroupExts(e,t=[]){for(const s of e)t.push(s),s.children&&T.flattenGroupExts(s.children,t);return t}static buildArrayOfArrays(e,t){var i;let s=-1,o=99999;for(const r of e){if(r.rowIndex<=o){s++;for(let n=0;n<t.length;n++)t[n][s]=null}if(t[r.rowIndex][s]=r,o=r.rowIndex,r.ownColumn()&&((i=r.children)!=null&&i.length)){for(let n=r.rowIndex+1;n<t.length;n++)t[n][s]=void 0;s++;for(let n=0;n<t.length;n++)t[n][s]=null}}return t}static iterateThrowColumns(e=[],t){var s;for(const o of t)e.push(o.data+" rowIndex:"+o.rowIndex),(s=o.children)!=null&&s.length&&T.iterateThrowColumns(e,o.children)}}class
|
|
326
|
+
pc:${r}`.replace(/[ \n]+/g," ");if(this.children)for(const l of this.children)l.log(e);return n}}class T{static buildColumnDefs(e,t=[]){for(const s of e)s.property&&t.push(H.create({property:s.property,headerLabel:s.data?s.data:s.property,isVisible:()=>typeof s.isVisible=="function"?s.isVisible():!0})),s.children&&T.buildColumnDefs(s.children,t);return t}static buildGroupExts(e,t=[],s=0,o){let i;for(let r=0;r<e.length;r++){const n=e[r],l=new It(n,s,r,o);i&&(l.leftNeighbour=i,i.rightNeighbour=l),t.push(l),n.children&&(l.children=T.buildGroupExts(n.children,[],s+1,l)),i=l}return t}static flattenGroupExts(e,t=[]){for(const s of e)t.push(s),s.children&&T.flattenGroupExts(s.children,t);return t}static buildArrayOfArrays(e,t){var i;let s=-1,o=99999;for(const r of e){if(r.rowIndex<=o){s++;for(let n=0;n<t.length;n++)t[n][s]=null}if(t[r.rowIndex][s]=r,o=r.rowIndex,r.ownColumn()&&((i=r.children)!=null&&i.length)){for(let n=r.rowIndex+1;n<t.length;n++)t[n][s]=void 0;s++;for(let n=0;n<t.length;n++)t[n][s]=null}}return t}static iterateThrowColumns(e=[],t){var s;for(const o of t)e.push(o.data+" rowIndex:"+o.rowIndex),(s=o.children)!=null&&s.length&&T.iterateThrowColumns(e,o.children)}}class Fs{constructor(){this.areaIdent="body",this.rowSelectionModel=void 0}changeColumnOrder(e,t){}doSort(e){return!1}externalFilterChanged(e){}getCellRenderer(e,t){}getColspanAt(e,t){return 0}getCustomClassesAt(e,t){return[]}getCustomStyleAt(e,t){}getMaxColspan(){return 0}getMaxRowspan(){return 0}getRowByIndex(e){}getRowCount(){return 0}getRowHeight(e){return 0}getRowspanAt(e,t){return 0}getTooltipAt(e,t){}getValueAt(e,t){}getTextValueAt(e,t){return""}getYPosByRowIndex(e){return 0}init(){}isEditable(e,t){return!1}isFilterable(){return!1}isRowCheckable(e){return!1}isRowChecked(e){}isSelectable(e,t){return!1}setRowChecked(e,t){}setValue(e,t,s){return!1}}const ne=class ne{constructor(e=new Le){this.headerGroupOptions=e}render(e,t,s,o,i,r,n){const l=r!=null&&r.data?r.data:"";if(r){const{toggle:a,visibility:c,closed:d}=r,u=a?ne.toggleHeaderGroup:"";this.addText(e,o,t,s,l,u),a&&c!=="always"&&this.addArrowDiv(n,e,!d,t,s,o,u)}else this.addText(e,o,t,s,l,"")}addText(e,t,s,o,i,r){e.innerHTML=`<span
|
|
327
327
|
data-ge-action="${r}"
|
|
328
328
|
data-area="${t}"
|
|
329
329
|
data-row-index="${s}"
|
|
330
330
|
data-col-index="${o}"
|
|
331
|
-
>${i}</span>`}addArrowDiv(e,t,s=!0,o=-1,i=-1,r="header",n){const l=e.createElement("div");e.addClass(l,"ge-table-toggle-icon-div"),e.setStyle(l,"display","inline-block"),e.setStyle(l,"position",""),e.setStyle(l,"width","20px"),e.setStyle(l,"background","transparent"),e.setStyle(l,"cursor","pointer"),e.setAttribute(l,"data-row-index",`${o}`),e.setAttribute(l,"data-col-index",`${i}`),e.setAttribute(l,"data-area",`${r}`),e.setAttribute(l,"data-ge-action",`${n}`);let a;s?a=this.headerGroupOptions.iconExpanded:a=this.headerGroupOptions.iconCollapsed;const c=a.content,d=e.createText(c);e.appendChild(l,d),a.style&&this.applyStyleString(e,l,a.style);for(const u of a.classes)e.addClass(l,u);return e.appendChild(t,l),l}applyStyleString(e,t,s){const o=s.split(";").map(i=>i.trim()).filter(i=>i);for(const i of o){const[r,n]=i.split(":");e.setStyle(t,r.trim(),n.trim())}}};
|
|
331
|
+
>${i}</span>`}addArrowDiv(e,t,s=!0,o=-1,i=-1,r="header",n){const l=e.createElement("div");e.addClass(l,"ge-table-toggle-icon-div"),e.setStyle(l,"display","inline-block"),e.setStyle(l,"position",""),e.setStyle(l,"width","20px"),e.setStyle(l,"background","transparent"),e.setStyle(l,"cursor","pointer"),e.setAttribute(l,"data-row-index",`${o}`),e.setAttribute(l,"data-col-index",`${i}`),e.setAttribute(l,"data-area",`${r}`),e.setAttribute(l,"data-ge-action",`${n}`);let a;s?a=this.headerGroupOptions.iconExpanded:a=this.headerGroupOptions.iconCollapsed;const c=a.content,d=e.createText(c);e.appendChild(l,d),a.style&&this.applyStyleString(e,l,a.style);for(const u of a.classes)e.addClass(l,u);return e.appendChild(t,l),l}applyStyleString(e,t,s){const o=s.split(";").map(i=>i.trim()).filter(i=>i);for(const i of o){const[r,n]=i.split(":");e.setStyle(t,r.trim(),n.trim())}}};ne.toggleHeaderGroup="toggleHeaderGroup";let ie=ne;class Os{constructor(e="header",t,s=[],o,i=new Le){this.areaIdent=e,this.groups=t,this.columnDefs=s,this.defaultRowHeight=o,this.headerGroupOptions=i,this.gammaCells=!0,this.arr=[],this.groupExts=[],this.cellGroupExtCellRenderer=new ie(this.headerGroupOptions),this.groupExts=T.buildGroupExts(t),this.init()}init(){var e;for(const t of this.groupExts)t.log(this.getMaxRowCount());this.arr=this.buildArray(),!((e=this.columnDefs)!=null&&e.length)&&this.areaIdent==="header"&&(this.columnDefs=T.buildColumnDefs(this.groups))}getAllLeafs(){return T.flattenGroupExts(this.groupExts).filter(t=>!t.children)}getMaxRowCount(){const e=this.getAllLeafs();return e!=null&&e.length?1+Math.max(...e.map(t=>t.getParentCount(t))):0}buildArray(){const e=T.flattenGroupExts(this.groupExts),t=1+Math.max(...e.map(r=>r.rowIndex)),s=[];T.iterateThrowColumns(s,this.groupExts);const o=Array.from(Array(t).keys()).map(r=>[]),i=T.buildArrayOfArrays(e,o);return console.table(i),i}changeColumnOrder(e,t){}doSort(e){return!1}externalFilterChanged(e){}getCellRenderer(e,t){return this.cellGroupExtCellRenderer}getColspanAt(e,t){const s=this.getValueAt(e,t);return s?s.getColumnCount():0}getCustomClassesAt(e,t){return[]}getCustomStyleAt(e,t){}getMaxColspan(){return 12}getMaxRowspan(){return 12}getRowByIndex(e){}getRowCount(){return this.arr?this.arr.length:0}getRowspanAt(e,t){const s=this.getValueAt(e,t);if(s){const o=this.getRowCount();return s.getRowSpan(s,o)}return 0}getTooltipAt(e,t){return""}getValueAt(e,t){return this.arr[e][t]}getTextValueAt(e,t){return""+this.getValueAt(e,t)}getYPosByRowIndex(e){return 0}getRowHeight(e){return this.defaultRowHeight}isEditable(e,t){return!1}isFilterable(){return!1}isRowCheckable(e){return!1}isRowChecked(e){}isSelectable(e,t){return!1}setRowChecked(e,t){}setValue(e,t,s){return!1}toggleHeaderGroup(e){const t=this.arr[e.rowIdx][e.colIdx];return t!=null&&t.toggle&&t.visibility!=="always"&&(t.closed=!t.closed,this.init()),T.buildColumnDefs(this.groupExts)}}class Ls{filterPredict(e,t,s=this.objectToString.bind(this)){if(!e)return!1;if(!t)return!0;t=t.toLowerCase();const o="+",i="-",r=t.toLowerCase().split(" ").filter(d=>d!==o&&d!==i&&d!==""),n=r.filter(d=>!d.startsWith(o)&&!d.startsWith(i)),l=r.filter(d=>d.startsWith(o)).map(d=>d.replace(/\+/g,"")),a=r.filter(d=>d.startsWith(i)).map(d=>d.replace(/-/g,""));let c=!n.length;for(let d=0;d<n.length;d++)(c||s(e).includes(n[d]))&&(c=!0);if(!c)return!1;for(let d=0;d<l.length;d++)if(!s(e).includes(l[d]))return!1;for(let d=0;d<a.length;d++)if(s(e).includes(a[d]))return!1;return!0}filterRows(e,t,s=o=>JSON.stringify(o).toLowerCase()){if(!e)return[];if(!t)return[...e];t=t.toLowerCase();const o="+",i="-",r=t.toLowerCase().split(" ").filter(c=>c!==o&&c!==i&&c!==""),n=r.filter(c=>!c.startsWith(o)&&!c.startsWith(i)),l=r.filter(c=>c.startsWith(o)).map(c=>c.replace(/\+/g,"")),a=r.filter(c=>c.startsWith(i)).map(c=>c.replace(/-/g,""));return e==null?void 0:e.filter(c=>{let d=!n.length;for(let u=0;u<n.length;u++)(d||s(c).includes(n[u]))&&(d=!0);if(!d)return!1;for(let u=0;u<l.length;u++)if(!s(c).includes(l[u]))return!1;for(let u=0;u<a.length;u++)if(s(c).includes(a[u]))return!1;return!0})}objectToString(e){if(!e)return"";const t=[],s=Object.keys(e);for(let o=0;o<s.length;o++){const i=s[o];t.push(e[i])}return t.join(" ").toLowerCase()}}class _s{static bodyRenderer(e){return new M(void 0,e,void 0)}}class $s{constructor(e,t=!0,s=!1){this.property=e,this.skipCheckableCheck=t,this.readonly=s}render(e,t,s,o,i,r,n){if(this.readonly||this.skipCheckableCheck||i.isRowCheckable(t)){n.addClass(e,"ge-table-row-checkbox-div");const l=i.getRowByIndex(t),c=i.getValueByT(l,this.property)===!0?"checked":"",d=this.readonly?" readonly ":"";if(n.addClass(e,"ge-padding-property-checkbox"),e.innerHTML=`
|
|
332
332
|
<input
|
|
333
333
|
type="checkbox"
|
|
334
334
|
data-area="${o}"
|
|
@@ -338,10 +338,10 @@ export class ${t} implements CellRendererIf {
|
|
|
338
338
|
data-input-type="checkbox"
|
|
339
339
|
${c}
|
|
340
340
|
${d}
|
|
341
|
-
class="ge-input-checkbox">`,!this.readonly){const u=e.querySelector(".ge-input-checkbox");u&&u.addEventListener("click",(f,p)=>(l[this.property]=!l[this.property],!0))}}}}class
|
|
341
|
+
class="ge-input-checkbox">`,!this.readonly){const u=e.querySelector(".ge-input-checkbox");u&&u.addEventListener("click",(f,p)=>(l[this.property]=!l[this.property],!0))}}}}class Bs{render(e,t,s,o,i,r,n){r&&(e.innerText=new Date(r).toISOString())}}class Hs{constructor(){this.formatter=new Intl.DateTimeFormat("de-DE",{year:"numeric",month:"2-digit",day:"2-digit"})}render(e,t,s,o,i,r,n){if(r){let l="";try{l=this.formatter.format(new Date(r))}catch{l=r}e.innerHTML=`
|
|
342
342
|
<div class="ge-table-label-div" data-row-index="${t}" data-col-index="${s}" data-area="${o}" style="position: relative; background: transparent; width: 100%; height: 100%;">
|
|
343
343
|
<div class="ge-table-label" data-row-index="${t}" data-col-index="${s}" data-area="${o}">${l}</div>
|
|
344
|
-
</div>`}}}class
|
|
344
|
+
</div>`}}}class Vs{render(e,t,s,o,i,r,n){r&&(e.innerText=new Date(r).toLocaleDateString())}}class Ws{render(e,t,s,o,i,r,n){r==="male"||r==="m"?e.innerText="♂":(r==="female"||r==="f")&&(e.innerText="♀")}}class Ns{constructor(e=100,t=!1){this.maxValue=e,this.labelVisible=t}render(e,t,s,o,i,r,n){if(n.addClass(e,"ge-progressbar-div"),!isNaN(r)){const a=Number(r)*100/this.maxValue,c=this.labelVisible?Math.round(a)+"%":"";e.innerHTML=`
|
|
345
345
|
<div class="ge-table-label-div"
|
|
346
346
|
data-row-index="${t}"
|
|
347
347
|
data-col-index="${s}"
|
|
@@ -360,13 +360,13 @@ export class ${t} implements CellRendererIf {
|
|
|
360
360
|
data-area="${o}">
|
|
361
361
|
</div>
|
|
362
362
|
</div>
|
|
363
|
-
</div>`}}}class
|
|
363
|
+
</div>`}}}class Gs{render(e,t,s,o,i,r,n){r==="true"||r===!0?e.innerHTML='<span class="ge-true-text-color">✅</span>':r==="false"||r===!1?e.innerHTML='<span class="ge-false-text-color">❌</span>':e.innerText=""}}class zs{render(e,t,s,o,i,r,n){r&&(e.innerText=new Date(r).toISOString().replace(/T/g," ").replace(/\..*/g,""))}}class js{constructor(e=Number.MIN_SAFE_INTEGER,t=Number.MAX_SAFE_INTEGER){this.min=e,this.max=t}render(e,t,s,o,i,r,n){r&&(e.innerHTML=`
|
|
364
364
|
<div class="ge-table-label-div">
|
|
365
365
|
<div class="ge-table-label">${r}</div>
|
|
366
|
-
</div>`,(typeof r=="string"||isNaN(r)||r<this.min||r>this.max)&&n.addClass(e,"ge-cell-error"))}}class
|
|
366
|
+
</div>`,(typeof r=="string"||isNaN(r)||r<this.min||r>this.max)&&n.addClass(e,"ge-cell-error"))}}class Ys{constructor(e){this.property=e}render(e,t,s,o,i,r,n){n.addClass(e,"ge-star-rating-div");const l=i.getRowByIndex(t),a=+(""+i.getValueByT(l,this.property));if(!isNaN(a)){const c=[];for(let u=0;u<a;u++)c.push("★");const d=c.join(" ");e.innerHTML=`
|
|
367
367
|
<div class="ge-table-label-div" data-row-index="${t}" data-col-index="${s}" data-area="${o}" style="position: relative; background: transparent; width: 100%; height: 100%;">
|
|
368
368
|
<div class="ge-table-label" data-row-index="${t}" data-col-index="${s}" data-area="${o}">${d}</div>
|
|
369
|
-
</div>`}}}class
|
|
369
|
+
</div>`}}}class Us{render(e,t,s,o,i,r,n){if(r!=null&&r.length){const l=n.createElement("div");n.addClass(l,"ge-table-label-div"),n.appendChild(e,l);const a=n.createElement("div");n.addClass(a,"ge-table-label"),n.appendChild(l,a);const c=n.createText(r.join(", "));n.appendChild(a,c)}else e.innerText=""}}class Ks{constructor(e,t=100,s=!1){this.property=e,this.maxValue=t,this.labelVisible=s}render(e,t,s,o,i,r,n){n.addClass(e,"ge-star-rating-div");const l=i.getRowByIndex(t),a=+(""+i.getValueByT(l,this.property));if(!isNaN(a)){const c=a*100/this.maxValue,d=this.labelVisible?Math.round(c)+"%":"";e.innerHTML=`
|
|
370
370
|
<div class="ge-table-label-div"
|
|
371
371
|
data-row-index="${t}"
|
|
372
372
|
data-col-index="${s}"
|
|
@@ -385,7 +385,7 @@ export class ${t} implements CellRendererIf {
|
|
|
385
385
|
data-area="${o}">
|
|
386
386
|
</div>
|
|
387
387
|
</div>
|
|
388
|
-
</div>`}}}class
|
|
388
|
+
</div>`}}}class Xs{render(e,t,s,o,i,r,n){if(r){e.innerHTML=`
|
|
389
389
|
<div
|
|
390
390
|
class="ge-table-label-div"
|
|
391
391
|
data-row-index=${t}"
|
|
@@ -419,7 +419,7 @@ export class ${t} implements CellRendererIf {
|
|
|
419
419
|
${r}
|
|
420
420
|
class="ge-table-cell-action ge-table-cell-link ${e.elementClass}">
|
|
421
421
|
${e.label}
|
|
422
|
-
</a>`}addClickEventListeners(e,t,s){e.querySelectorAll(".ge-table-cell-action").forEach(i=>{i.addEventListener("click",r=>{const n=r.target;if(n){const l=this.createActionEvent(n,s);l&&this.actionEventListener.onActionEvent(l)}})})}createActionEvent(e,t){const s=e.getAttribute("data-area"),o=e.getAttribute("data-row-index"),i=e.getAttribute("data-col-index"),r=e.getAttribute("data-action")??"unknown",n=e.getAttribute("data-id")??"unknown";if(s&&o&&i){const l=J(s),a=Number(o),c=Number(i);return new $e(r,l,t,a,c,n)}return null}getCrudActions(e){return Array.isArray(e)&&e.every(t=>t instanceof _)?e:this.crudActions}}const
|
|
422
|
+
</a>`}addClickEventListeners(e,t,s){e.querySelectorAll(".ge-table-cell-action").forEach(i=>{i.addEventListener("click",r=>{const n=r.target;if(n){const l=this.createActionEvent(n,s);l&&this.actionEventListener.onActionEvent(l)}})})}createActionEvent(e,t){const s=e.getAttribute("data-area"),o=e.getAttribute("data-row-index"),i=e.getAttribute("data-col-index"),r=e.getAttribute("data-action")??"unknown",n=e.getAttribute("data-id")??"unknown";if(s&&o&&i){const l=J(s),a=Number(o),c=Number(i);return new $e(r,l,t,a,c,n)}return null}getCrudActions(e){return Array.isArray(e)&&e.every(t=>t instanceof _)?e:this.crudActions}}const Js=function(h,e,t){return h?Number(h):""};class Be{constructor(e){this.options=e}static create(e){return new Be(e.map(t=>new Tt(t,t)))}render(e,t,s,o,i,r,n){if(i.isEditable(t,s)){n.addClass(e,"ge-table-row-select-div");const l=i.getValueAt(t,s);let a=[];for(let d of this.options){const u=d.value===l?" selected ":"";a.push(`<option value="${d.value}" ${u}>${d.label}</option>`)}const c=a.join("");e.innerHTML=`
|
|
423
423
|
<select
|
|
424
424
|
autofocus
|
|
425
425
|
data-listen="change"
|
|
@@ -428,7 +428,7 @@ export class ${t} implements CellRendererIf {
|
|
|
428
428
|
data-col-index="${s}"
|
|
429
429
|
data-input-type="text"
|
|
430
430
|
style="width:100%;height:100%;border:0;padding:0 0 0 8px;"
|
|
431
|
-
class="ge-table-cell-editor-select">${c}</select>`}}}class
|
|
431
|
+
class="ge-table-cell-editor-select">${c}</select>`}}}class qs extends he{constructor(e){super("row","multi"),this.model=e}getSelectedRowItems(e){const t=this.getMergedRowIndices();return this.isAllSelected()?e:e.filter((s,o)=>t.includes(o))}selectRow(e){this.addRange(R.singleRow(e))}unselectRow(e){this.removeSelection(R.singleRow(e))}toggleSelection(){if(this.isAllSelected())this.clear();else if(this.hasNoSelection())this.selectAll();else{const e=this.model.getAllRows();this.silent=!0;for(let t=0;t<e.length;t++)this.toggleRow(t);this.silent=!1,this.fireChangeEvent()}}toggleFilteredRowsSelection(){if(this.isAllSelected())this.clear();else if(this.hasNoSelection()){const e=this.model.getFilteredRows();this.silent=!0;for(let t=0;t<e.length;t++)this.selectRow(t);this.silent=!1,this.fireChangeEvent()}else{const e=this.model.getFilteredRows();this.silent=!0;for(let t=0;t<e.length;t++)this.toggleRow(t);this.silent=!1,this.fireChangeEvent()}}toggleRow(e){this.isSelected(e,0)?this.unselectRow(e):this.selectRow(e)}}class Zs{constructor(e,t,s){this.r=e,this.g=t,this.b=s}}class Ae{constructor(e,t,s,o){this.minValue=e,this.minColor=t,this.maxValue=s,this.maxColor=o}}class Y{static normalize(e,t,s,o=0,i=1){return(e-t)/(s-t)*(i-o)+o}static getTwoColorGradientRGB(e,t){const s=Y.normalize(e,t.minValue,t.maxValue,0,1),o=t.maxColor.r-t.minColor.r,i=t.maxColor.g-t.minColor.g,r=t.maxColor.b-t.minColor.b,n=o*s+t.minColor.r,l=i*s+t.minColor.g,a=r*s+t.minColor.b;return`rgb(${Math.round(n)}, ${Math.round(l)}, ${Math.round(a)})`}static getThreeColorGradientRGB(e,t){return e<t.middleValue?Y.getTwoColorGradientRGB(e,new Ae(t.minValue,t.minColor,t.middleValue,t.middleColor)):e>t.middleValue?Y.getTwoColorGradientRGB(e,new Ae(t.middleValue,t.middleColor,t.maxValue,t.maxColor)):`rgb(${t.middleColor.r}, ${t.middleColor.g}, ${t.middleColor.b})`}}class Qs{constructor(e,t,s,o,i,r){this.minValue=e,this.minColor=t,this.middleValue=s,this.middleColor=o,this.maxValue=i,this.maxColor=r}}class Dt{constructor(e=!0,t=!0,s=(r,n)=>r*10+10,o=50,i=450){this.autoCalc=e,this.takeHeaderLabelsIntoAccount=t,this.charCountToWidth=s,this.minWidth=o,this.maxWidth=i}}class Pt{constructor(e){this.object=e}openDialog(){const e=document.createElement("dialog");e.classList.add("ge-table-crud-object-view"),e.innerHTML=`
|
|
432
432
|
<div class="ge-table-dialog-header">Item</div>
|
|
433
433
|
<div class="ge-table-dialog-content">
|
|
434
434
|
${this.generateHtmlTable(this.object)}
|
|
@@ -464,4 +464,4 @@ export class ${t} implements CellRendererIf {
|
|
|
464
464
|
<label for="${i}">${r}</label>
|
|
465
465
|
${l}
|
|
466
466
|
</div>
|
|
467
|
-
`)}}return`<form>${s.join("")}</form>`}setNestedValue(e,t,s){const o=t.split(".");let i=e;for(let r=0;r<o.length-1;r++)i[o[r]]||(i[o[r]]={}),i=i[o[r]];i[o[o.length-1]]=s}getCombinedKey(e,t){return e?`${e}.${t}`:t}getLabel(e){return e.replace(/\./g," ")}}class Ft{constructor(){this.urls={list:{url:"",method:"GET"}},this.singleRowActions=[new _("VIEW","View","","","link"),new _("EDIT","Edit","","","link"),new _("CLONE","Clone","","","link"),new _("DELETE","Delete","","","link")],this.tableActions=[new _("CREATE","Create","","","button"),new _("DELETE_SELECTED","Delete Selected","","","button")],this.autoAddActionColumn=!0,this.columnWidths=new Dt,this.calcFixedRightColumnCount=e=>e>6?1:0,this.getHeadersInit=()=>({}),this.getIdKey=()=>"id",this.getIdByObject=e=>(this.getIdKey()??"id")in e?e.id:e,this.fetchList=e=>{const t=e.getHeadersInit?e.getHeadersInit():{};let s=e.urls.list.url,o=e.urls.list.method??"GET";return fetch(s,{headers:t,method:o}).then(i=>i.json())},this.fetchItem=(e,t)=>{var r,n;const s=e.getHeadersInit?e.getHeadersInit():{};let o=((r=e.urls.read)==null?void 0:r.url)??"";o=o.replace("{id}",t);let i=((n=e.urls.read)==null?void 0:n.method)??"GET";return fetch(o,{headers:s,method:i}).then(l=>l.json())},this.updateItem=(e,t,s)=>{var n,l;const o=e.getHeadersInit?e.getHeadersInit():{};let i=((n=e.urls.update)==null?void 0:n.url)??"";i=i.replace("{id}",t);let r=((l=e.urls.update)==null?void 0:l.method)??"PATCH";return fetch(i,{headers:o,method:r,body:JSON.stringify(s)}).then(a=>a.json())},this.createItem=(e,t)=>{var r,n;const s=e.getHeadersInit?e.getHeadersInit():{};let o=((r=e.urls.create)==null?void 0:r.url)??"",i=((n=e.urls.create)==null?void 0:n.method)??"POST";return fetch(o,{headers:s,method:i,body:JSON.stringify(t)}).then(l=>l.json())},this.deleteItem=(e,t)=>{var r,n;const s=e.getHeadersInit?e.getHeadersInit():{};let o=((r=e.urls.delete)==null?void 0:r.url)??"";o=o.replace("{id}",t);let i=((n=e.urls.delete)==null?void 0:n.method)??"GET";return fetch(o,{headers:s,method:i}).then(l=>l.json())},this.getEmptyItem=()=>{}}}class Qs{constructor(){this.crudOptions=new Ft,this.listenActionEvent=e=>{}}createTableModel(e,t,s=i=>{},o=i=>{}){this.crudOptions=e,this.listenActionEvent=o,e.fetchList(e).then(i=>{var r,n,l,a;if(t.rows=i,i!=null&&i.length){const c=(r=t.columnDefs)!=null&&r.length?t.columnDefs.map(x=>x.property):this.extractProperties(i[0]),d=new de("row","multi"),u=()=>d;this.tableOptions={...new K,...t.tableOptions,hoverColumnVisible:!1,getSelectionModel:u};const f=this.calcAutoColumnWidths(i,c),p=(n=t.columnDefs)!=null&&n.length?t.columnDefs:c.map((x,w)=>new H(x,x.toUpperCase(),new y(f[w],"px")));if((l=e==null?void 0:e.columnWidths)!=null&&l.autoCalc)for(let x=0;x<p.length;x++){const w=p[x];w.width=new y(f[x],"px")}if(e.autoAddActionColumn){let x=new H("id","Actions",St,new M(["ge-table-text-align-left"],["ge-table-text-align-left ge-table-actions-cell"],void 0));x.rendererMap=new M(void 0,new kt(this,e.singleRowActions),void 0),p.push(x)}const m=0,g=e.calcFixedRightColumnCount(p.length);this.tableModel=$.buildByTypedRowsParam({rows:i,columnDefs:p,tableOptions:this.tableOptions,fixedLeftColumnCount:m,fixedRightColumnCount:g}),this.tableModel.getSelectionModel=u,this.bodyModel=(a=this.tableModel)==null?void 0:a.getBodyModel();const b=new At(this.tableModel,this.tableOptions);s(b)}})}openDialogForCreate(){if(this.bodyModel){const e=new $e("CREATE","body",this.bodyModel,-1,-1,null);this.onActionEvent(e)}}onActionEvent(e){var t,s,o,i;if(this.listenActionEvent&&this.listenActionEvent(e),e.action==="VIEW"){let r=e.id;(t=this.crudOptions)==null||t.fetchItem(this.crudOptions,r).then(n=>(console.info(n),new Pt(n).openDialog(),n))}else if(e.action==="EDIT"){let r=e.id;const n=this.crudOptions.getIdKey()??"id";(s=this.crudOptions)==null||s.fetchItem(this.crudOptions,r).then(l=>(console.info(l),new ee(n,l).openDialog(a=>{console.info(a),this.crudOptions.updateItem(this.crudOptions,r,a)}),l))}else if(e.action==="CLONE"){let r=e.id;const n=this.crudOptions.getIdKey()??"id";(o=this.crudOptions)==null||o.fetchItem(this.crudOptions,r).then(l=>{const a=JSON.parse(JSON.stringify(l));return new ee(n,a,"Clone Item").openDialog(c=>{console.info(c),this.crudOptions.createItem(this.crudOptions,c)}),a})}else if(e.action==="CREATE"){const r=this.crudOptions.getIdKey()??"id",n=JSON.parse(JSON.stringify(this.crudOptions.getEmptyItem()));return new ee(r,n,"Create Item").openDialog(l=>{console.info(l),this.crudOptions.createItem(this.crudOptions,n)}),n}else if(e.action==="DELETE"){let r=e.id;(i=this.crudOptions)==null||i.deleteItem(this.crudOptions,r).then(n=>{var l,a,c,d,u;return(l=this.bodyModel)==null||l.filterRowsByPredict(f=>f.id!=r),(c=(a=this.tableModel)==null?void 0:a.getTableScope())==null||c.clearSelection(!0),(u=(d=this.tableModel)==null?void 0:d.getTableScope())==null||u.repaintHard(),n})}}calcAutoColumnWidths(e,t,s=t){var a;const o=t.length;if(!((a=this.crudOptions.columnWidths)!=null&&a.autoCalc))return new Array(o).fill(200);const i=e.length??0,r=new Array(o).fill(0);for(let c=0;c<i;c++)for(let d=0;d<o;d++){const u=t[d],f=this.getValueByT(e[c],u),p=(f==null?void 0:f.toString().length)||0;p>r[d]&&(r[d]=p)}if(this.crudOptions.columnWidths.takeHeaderLabelsIntoAccount)for(let c=0;c<o;c++){const d=s[c].length||0;d>r[c]&&(r[c]=d)}const n=this.crudOptions.columnWidths.minWidth,l=this.crudOptions.columnWidths.maxWidth;return r.map((c,d)=>Math.min(l,Math.max(this.crudOptions.columnWidths.charCountToWidth(c,d),n)))}getValueByT(e,t){return t.includes(".")?this.getPropertyValue(e,t.split(".")):e[t]}getPropertyValue(e,t){const s=t.shift(),o=e[s];return o&&t.length?this.getPropertyValue(o,t):o}extractProperties(e,t="",s=[]){for(const o in e)if(e.hasOwnProperty(o)){const i=t?`${t}.${o}`:o;typeof e[o]=="object"&&e[o]!==null&&!Array.isArray(e[o])?this.extractProperties(e[o],i,s):s.push(i)}return s}}class eo{constructor(e,t){this.method=e,this.url=t}}exports.AbstractAreaModel=he;exports.ActionEvent=$e;exports.ActionsCellRenderer=kt;exports.AnyPropertyType=ke;exports.AreaMapFactory=Ms;exports.AreaModel=Ps;exports.AreaModelArrayOfArrays=P;exports.AreaModelCellGroups=Fs;exports.AreaModelHidden=F;exports.AreaModelObjectArray=Rt;exports.AreaModelObjectArrayWithColumndefs=ve;exports.AreaModelTree=Se;exports.AreaObjectMap=M;exports.ArrayPropertyType=B;exports.AutoRestoreOptions=Ds;exports.AvoidDoubleExecution=Lt;exports.BooleanPropertyType=ze;exports.CellGroup=Mt;exports.CellGroupExt=It;exports.CellGroupExtCellRenderer=oe;exports.CellRange=R;exports.CellgroupFactory=T;exports.CheckboxBooleanPropertyCellRenderer=_s;exports.CheckboxCellRenderer=Re;exports.CheckboxColumnDef=Ts;exports.CheckboxModel=vt;exports.ChunkData=xs;exports.ColAndRowspanModel=rt;exports.CollapsedExpandedData=tt;exports.ColorRgb=qs;exports.ColumnDef=H;exports.ColumnDefGenerator=_t;exports.ColumnWidths=Dt;exports.ConvenienceDomService=Je;exports.CopyService=X;exports.CrudAction=_;exports.CrudObjectEdit=ee;exports.CrudObjectView=Pt;exports.CrudOptions=Ft;exports.CrudTableModelFactory=Qs;exports.CssVars=me;exports.DateToIntlDDMMYYYYCellRenderer=Bs;exports.DateToIsoCellRenderer=$s;exports.DateToLocaleDateCellRenderer=Hs;exports.DateToTecCellRenderer=Gs;exports.DefaultRowHeights=N;exports.EleScope=it;exports.EventAdapter=fe;exports.ExcelService=yt;exports.FalseFn=ye;exports.FocusModel=mt;exports.GeCellIndices=ct;exports.GeCssColorUtil=Y;exports.GeFilterService=Os;exports.GeKeyEvent=Is;exports.GeModelChangeEvent=ce;exports.GeMouseEvent=ae;exports.GeoData=O;exports.Icon=L;exports.IndexAndPx=Ss;exports.InputCellRenderer=ft;exports.InputHandler=at;exports.JsonService=pe;exports.LicenseManager=V;exports.MaleFemaleToIconCellRenderer=Vs;exports.MouseHandler=Ze;exports.MouseTargetData=qe;exports.MultiRowsSelectionModel=Js;exports.NullPropertyType=We;exports.NumberCellProgressBarCellRenderer=Ws;exports.NumberCellRenderer=zs;exports.NumberPropertyType=Ge;exports.ObjectPropertyType=k;exports.OsxShortcutActionIdMapping=ut;exports.PROPERTY_TYPE_KEY_ANY=Ee;exports.PROPERTY_TYPE_KEY_ARRAY=Ie;exports.PROPERTY_TYPE_KEY_BOOLEAN=le;exports.PROPERTY_TYPE_KEY_NULL=Te;exports.PROPERTY_TYPE_KEY_NUMBER=ne;exports.PROPERTY_TYPE_KEY_OBJECT=j;exports.PROPERTY_TYPE_KEY_STRING=Me;exports.PROPERTY_TYPE_KEY_UNDEFINED=z;exports.Padding=Ce;exports.PositiveAndNegativeNumberRenderer=Ks;exports.ProgressBarCellRenderer=Us;exports.PropertyItem=De;exports.PropertyTypeService=$t;exports.RenderScope=nt;exports.Renderer=Ls;exports.RequestChunk=Et;exports.ResizeHandler=bt;exports.SchemeGenerator=Bt;exports.SelectCellRenderer=Be;exports.SelectionModel=de;exports.SelectionService=dt;exports.ShortcutService=pt;exports.SimpleArrayCellRenderer=Ys;exports.SimpleDomService=gt;exports.Size=y;exports.SortItem=lt;exports.SortedOptions=Fe;exports.StarRatingCellRenderer=js;exports.StoreStateCollapsedExpandService=st;exports.StoreStateScrollPosService=et;exports.StoreStateSortingService=ot;exports.StringPropertyType=Ne;exports.TableApi=Qe;exports.TableCellUpdateEvent=ks;exports.TableFactory=$;exports.TableModel=Q;exports.TableModelAndOptions=At;exports.TableOptions=K;exports.TableScope=_e;exports.ThreeColorGradientArg=Zs;exports.TreeCheckboxModel=we;exports.TreeFactory=se;exports.TreeOptions=Pe;exports.TreeRow=be;exports.TreeRowService=wt;exports.TrueFalseCellRenderer=Ns;exports.TrueFn=xt;exports.TwoColorGradientArg=Ae;exports.UNIMPORTANT_TYPES=U;exports.UndefinedPropertyType=Z;exports.UrlInfo=eo;exports.ValueInfo=je;exports.ValueLabel=Tt;exports.WindowsShortcutActionIdMapping=ht;exports.actionIds=ys;exports.allCenter=As;exports.allLeft=Rs;exports.allRight=Es;exports.bodyCenter=Cs;exports.bodyLeft=ws;exports.bodyRight=vs;exports.debounce=Ve;exports.editInputPipeForNumber=Xs;exports.entitySuffix=ge;exports.firstLetterUppercase=Ke;exports.getAreaIdentByString=J;exports.getEntityName=Ye;exports.isAreaModelTree=te;exports.isCheckboxColumnDef=Xe;exports.isTreeRow=W;exports.px0=bs;exports.px10=ms;exports.px100=ls;exports.px110=ns;exports.px120=rs;exports.px130=is;exports.px140=os;exports.px150=ss;exports.px160=ts;exports.px170=es;exports.px180=Qt;exports.px190=Zt;exports.px20=fs;exports.px200=xe;exports.px210=qt;exports.px220=Jt;exports.px230=Xt;exports.px240=Kt;exports.px250=Ut;exports.px260=Yt;exports.px270=jt;exports.px280=zt;exports.px290=Gt;exports.px30=gs;exports.px300=St;exports.px40=ps;exports.px400=Nt;exports.px50=us;exports.px500=Wt;exports.px60=hs;exports.px70=ds;exports.px80=cs;exports.px90=as;exports.throttle=Ot;exports.trimArraySuffixes=Ue;
|
|
467
|
+
`)}}return`<form>${s.join("")}</form>`}setNestedValue(e,t,s){const o=t.split(".");let i=e;for(let r=0;r<o.length-1;r++)i[o[r]]||(i[o[r]]={}),i=i[o[r]];i[o[o.length-1]]=s}getCombinedKey(e,t){return e?`${e}.${t}`:t}getLabel(e){return e.replace(/\./g," ")}}class Ft{constructor(){this.urls={list:{url:"",method:"GET"}},this.singleRowActions=[new _("VIEW","View","","","link"),new _("EDIT","Edit","","","link"),new _("CLONE","Clone","","","link"),new _("DELETE","Delete","","","link")],this.tableActions=[new _("CREATE","Create","","","button"),new _("DELETE_SELECTED","Delete Selected","","","button")],this.autoAddActionColumn=!0,this.columnWidths=new Dt,this.calcFixedRightColumnCount=e=>e>6?1:0,this.getHeadersInit=()=>({}),this.getIdKey=()=>"id",this.getIdByObject=e=>(this.getIdKey()??"id")in e?e.id:e,this.fetchList=e=>{const t=e.getHeadersInit?e.getHeadersInit():{};let s=e.urls.list.url,o=e.urls.list.method??"GET";return fetch(s,{headers:t,method:o}).then(i=>i.json())},this.fetchItem=(e,t)=>{var r,n;const s=e.getHeadersInit?e.getHeadersInit():{};let o=((r=e.urls.read)==null?void 0:r.url)??"";o=o.replace("{id}",t);let i=((n=e.urls.read)==null?void 0:n.method)??"GET";return fetch(o,{headers:s,method:i}).then(l=>l.json())},this.updateItem=(e,t,s)=>{var n,l;const o=e.getHeadersInit?e.getHeadersInit():{};let i=((n=e.urls.update)==null?void 0:n.url)??"";i=i.replace("{id}",t);let r=((l=e.urls.update)==null?void 0:l.method)??"PATCH";return fetch(i,{headers:o,method:r,body:JSON.stringify(s)}).then(a=>a.json())},this.createItem=(e,t)=>{var r,n;const s=e.getHeadersInit?e.getHeadersInit():{};let o=((r=e.urls.create)==null?void 0:r.url)??"",i=((n=e.urls.create)==null?void 0:n.method)??"POST";return fetch(o,{headers:s,method:i,body:JSON.stringify(t)}).then(l=>l.json())},this.deleteItem=(e,t)=>{var r,n;const s=e.getHeadersInit?e.getHeadersInit():{};let o=((r=e.urls.delete)==null?void 0:r.url)??"";o=o.replace("{id}",t);let i=((n=e.urls.delete)==null?void 0:n.method)??"GET";return fetch(o,{headers:s,method:i}).then(l=>l.json())},this.getEmptyItem=()=>{}}}class eo{constructor(){this.crudOptions=new Ft,this.listenActionEvent=e=>{}}createTableModel(e,t,s=i=>{},o=i=>{}){this.crudOptions=e,this.listenActionEvent=o,e.fetchList(e).then(i=>{var r,n,l,a;if(t.rows=i,i!=null&&i.length){const c=(r=t.columnDefs)!=null&&r.length?t.columnDefs.map(x=>x.property):this.extractProperties(i[0]),d=new he("row","multi"),u=()=>d;this.tableOptions={...new K,...t.tableOptions,hoverColumnVisible:!1,getSelectionModel:u};const f=this.calcAutoColumnWidths(i,c),p=(n=t.columnDefs)!=null&&n.length?t.columnDefs:c.map((x,w)=>new H(x,x.toUpperCase(),new y(f[w],"px")));if((l=e==null?void 0:e.columnWidths)!=null&&l.autoCalc)for(let x=0;x<p.length;x++){const w=p[x];w.width=new y(f[x],"px")}if(e.autoAddActionColumn){let x=new H("id","Actions",St,new M(["ge-table-text-align-left"],["ge-table-text-align-left ge-table-actions-cell"],void 0));x.rendererMap=new M(void 0,new kt(this,e.singleRowActions),void 0),p.push(x)}const m=0,g=e.calcFixedRightColumnCount(p.length);this.tableModel=$.buildByTypedRowsParam({rows:i,columnDefs:p,tableOptions:this.tableOptions,fixedLeftColumnCount:m,fixedRightColumnCount:g}),this.tableModel.getSelectionModel=u,this.bodyModel=(a=this.tableModel)==null?void 0:a.getBodyModel();const b=new At(this.tableModel,this.tableOptions);s(b)}})}openDialogForCreate(){if(this.bodyModel){const e=new $e("CREATE","body",this.bodyModel,-1,-1,null);this.onActionEvent(e)}}onActionEvent(e){var t,s,o,i;if(this.listenActionEvent&&this.listenActionEvent(e),e.action==="VIEW"){let r=e.id;(t=this.crudOptions)==null||t.fetchItem(this.crudOptions,r).then(n=>(console.info(n),new Pt(n).openDialog(),n))}else if(e.action==="EDIT"){let r=e.id;const n=this.crudOptions.getIdKey()??"id";(s=this.crudOptions)==null||s.fetchItem(this.crudOptions,r).then(l=>(console.info(l),new ee(n,l).openDialog(a=>{console.info(a),this.crudOptions.updateItem(this.crudOptions,r,a)}),l))}else if(e.action==="CLONE"){let r=e.id;const n=this.crudOptions.getIdKey()??"id";(o=this.crudOptions)==null||o.fetchItem(this.crudOptions,r).then(l=>{const a=JSON.parse(JSON.stringify(l));return new ee(n,a,"Clone Item").openDialog(c=>{console.info(c),this.crudOptions.createItem(this.crudOptions,c)}),a})}else if(e.action==="CREATE"){const r=this.crudOptions.getIdKey()??"id",n=JSON.parse(JSON.stringify(this.crudOptions.getEmptyItem()));return new ee(r,n,"Create Item").openDialog(l=>{console.info(l),this.crudOptions.createItem(this.crudOptions,n)}),n}else if(e.action==="DELETE"){let r=e.id;(i=this.crudOptions)==null||i.deleteItem(this.crudOptions,r).then(n=>{var l,a,c,d,u;return(l=this.bodyModel)==null||l.filterRowsByPredict(f=>f.id!=r),(c=(a=this.tableModel)==null?void 0:a.getTableScope())==null||c.clearSelection(!0),(u=(d=this.tableModel)==null?void 0:d.getTableScope())==null||u.repaintHard(),n})}}calcAutoColumnWidths(e,t,s=t){var a;const o=t.length;if(!((a=this.crudOptions.columnWidths)!=null&&a.autoCalc))return new Array(o).fill(200);const i=e.length??0,r=new Array(o).fill(0);for(let c=0;c<i;c++)for(let d=0;d<o;d++){const u=t[d],f=this.getValueByT(e[c],u),p=(f==null?void 0:f.toString().length)||0;p>r[d]&&(r[d]=p)}if(this.crudOptions.columnWidths.takeHeaderLabelsIntoAccount)for(let c=0;c<o;c++){const d=s[c].length||0;d>r[c]&&(r[c]=d)}const n=this.crudOptions.columnWidths.minWidth,l=this.crudOptions.columnWidths.maxWidth;return r.map((c,d)=>Math.min(l,Math.max(this.crudOptions.columnWidths.charCountToWidth(c,d),n)))}getValueByT(e,t){return t.includes(".")?this.getPropertyValue(e,t.split(".")):e[t]}getPropertyValue(e,t){const s=t.shift(),o=e[s];return o&&t.length?this.getPropertyValue(o,t):o}extractProperties(e,t="",s=[]){for(const o in e)if(e.hasOwnProperty(o)){const i=t?`${t}.${o}`:o;typeof e[o]=="object"&&e[o]!==null&&!Array.isArray(e[o])?this.extractProperties(e[o],i,s):s.push(i)}return s}}class to{constructor(e,t){this.method=e,this.url=t}}exports.AbstractAreaModel=ue;exports.ActionEvent=$e;exports.ActionsCellRenderer=kt;exports.AnyPropertyType=ke;exports.AreaMapFactory=Is;exports.AreaModel=Fs;exports.AreaModelArrayOfArrays=P;exports.AreaModelCellGroups=Os;exports.AreaModelHidden=F;exports.AreaModelObjectArray=Rt;exports.AreaModelObjectArrayWithColumndefs=ve;exports.AreaModelTree=Se;exports.AreaObjectMap=M;exports.ArrayPropertyType=B;exports.AutoRestoreOptions=Ps;exports.AvoidDoubleExecution=Lt;exports.BooleanPropertyType=ze;exports.CellGroup=Mt;exports.CellGroupExt=It;exports.CellGroupExtCellRenderer=ie;exports.CellRange=R;exports.CellgroupFactory=T;exports.CheckboxBooleanPropertyCellRenderer=$s;exports.CheckboxCellRenderer=Re;exports.CheckboxColumnDef=Ms;exports.CheckboxModel=vt;exports.ChunkData=Ss;exports.ColAndRowspanModel=rt;exports.CollapsedExpandedData=tt;exports.ColorRgb=Zs;exports.ColumnDef=H;exports.ColumnDefGenerator=_t;exports.ColumnWidths=Dt;exports.ConvenienceDomService=Je;exports.CopyService=X;exports.CrudAction=_;exports.CrudObjectEdit=ee;exports.CrudObjectView=Pt;exports.CrudOptions=Ft;exports.CrudTableModelFactory=eo;exports.CssVars=me;exports.DateToIntlDDMMYYYYCellRenderer=Hs;exports.DateToIsoCellRenderer=Bs;exports.DateToLocaleDateCellRenderer=Vs;exports.DateToTecCellRenderer=zs;exports.DefaultRowHeights=N;exports.EleScope=it;exports.EventAdapter=se;exports.EventCheckboxChangedHandler=Wt;exports.ExcelService=yt;exports.FalseFn=ye;exports.FocusModel=mt;exports.GeCellIndices=ct;exports.GeCssColorUtil=Y;exports.GeFilterService=Ls;exports.GeKeyEvent=ks;exports.GeModelChangeEvent=de;exports.GeMouseEvent=ce;exports.GeoData=O;exports.Icon=L;exports.IndexAndPx=ws;exports.InputCellRenderer=ft;exports.InputHandler=at;exports.JsonService=ge;exports.LicenseManager=V;exports.MaleFemaleToIconCellRenderer=Ws;exports.MouseHandler=Ze;exports.MouseTargetData=qe;exports.MultiRowsSelectionModel=qs;exports.NullPropertyType=We;exports.NumberCellProgressBarCellRenderer=Ns;exports.NumberCellRenderer=js;exports.NumberPropertyType=Ge;exports.ObjectPropertyType=k;exports.OsxShortcutActionIdMapping=ut;exports.PROPERTY_TYPE_KEY_ANY=Ee;exports.PROPERTY_TYPE_KEY_ARRAY=Ie;exports.PROPERTY_TYPE_KEY_BOOLEAN=ae;exports.PROPERTY_TYPE_KEY_NULL=Te;exports.PROPERTY_TYPE_KEY_NUMBER=le;exports.PROPERTY_TYPE_KEY_OBJECT=j;exports.PROPERTY_TYPE_KEY_STRING=Me;exports.PROPERTY_TYPE_KEY_UNDEFINED=z;exports.Padding=Ce;exports.PositiveAndNegativeNumberRenderer=Xs;exports.ProgressBarCellRenderer=Ks;exports.PropertyItem=De;exports.PropertyTypeService=$t;exports.RenderScope=nt;exports.Renderer=_s;exports.RequestChunk=Et;exports.ResizeHandler=bt;exports.SchemeGenerator=Bt;exports.SelectCellRenderer=Be;exports.SelectionModel=he;exports.SelectionService=dt;exports.ShortcutService=pt;exports.SimpleArrayCellRenderer=Us;exports.SimpleDomService=gt;exports.Size=y;exports.SortItem=lt;exports.SortedOptions=Fe;exports.StarRatingCellRenderer=Ys;exports.StoreStateCollapsedExpandService=st;exports.StoreStateScrollPosService=et;exports.StoreStateSortingService=ot;exports.StringPropertyType=Ne;exports.TableApi=Qe;exports.TableCellUpdateEvent=Ds;exports.TableFactory=$;exports.TableModel=Q;exports.TableModelAndOptions=At;exports.TableOptions=K;exports.TableScope=_e;exports.ThreeColorGradientArg=Qs;exports.TreeCheckboxModel=we;exports.TreeFactory=oe;exports.TreeOptions=Pe;exports.TreeRow=be;exports.TreeRowService=wt;exports.TrueFalseCellRenderer=Gs;exports.TrueFn=xt;exports.TwoColorGradientArg=Ae;exports.UNIMPORTANT_TYPES=U;exports.UndefinedPropertyType=Z;exports.UrlInfo=to;exports.ValueInfo=je;exports.ValueLabel=Tt;exports.WindowsShortcutActionIdMapping=ht;exports.actionIds=xs;exports.allCenter=Es;exports.allLeft=As;exports.allRight=Ts;exports.bodyCenter=vs;exports.bodyLeft=Cs;exports.bodyRight=Rs;exports.debounce=Ve;exports.editInputPipeForNumber=Js;exports.entitySuffix=fe;exports.firstLetterUppercase=Ke;exports.getAreaIdentByString=J;exports.getEntityName=Ye;exports.isAreaModelTree=te;exports.isCheckboxColumnDef=Xe;exports.isTreeRow=W;exports.px0=ys;exports.px10=bs;exports.px100=as;exports.px110=ls;exports.px120=ns;exports.px130=rs;exports.px140=is;exports.px150=os;exports.px160=ss;exports.px170=ts;exports.px180=es;exports.px190=Qt;exports.px20=ms;exports.px200=xe;exports.px210=Zt;exports.px220=qt;exports.px230=Jt;exports.px240=Xt;exports.px250=Kt;exports.px260=Ut;exports.px270=Yt;exports.px280=jt;exports.px290=zt;exports.px30=fs;exports.px300=St;exports.px40=gs;exports.px400=Gt;exports.px50=ps;exports.px500=Nt;exports.px60=us;exports.px70=hs;exports.px80=ds;exports.px90=cs;exports.throttle=Ot;exports.trimArraySuffixes=Ue;
|