@guiexpert/table 1.1.80 → 1.1.82
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 +71 -71
- package/index.d.ts +3 -0
- package/index.js +758 -560
- package/lib/table/data/tablemodel/areamodel/cover-grid-body-model.d.ts +53 -0
- package/lib/table/data/tablemodel/cover-grid-table-model.d.ts +50 -0
- package/lib/table/factory/cover-grid-factory.d.ts +5 -0
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Vt(c,e=500){let t=null,o=0;return function(...s){const i=Date.now(),r=e-(i-o);r<=0?(c.apply(this,s),o=i):t||(t=window.setTimeout(()=>{c.apply(this,s),o=Date.now(),t=null},r))}}function Ge(c,e=500){let t=null;return function(...o){t&&window.clearTimeout(t),t=window.setTimeout(()=>{c.apply(this,o),t=null},e)}}function Bt(c=500){return function(e,t,o){let s=0;const i=o.value;return o.value=function(...r){if(!(Date.now()-s<c))return s=Date.now(),i.apply(this,r)},o}}const Te="any",j="undefined",Ie="null",ke="string",de="number",ce="boolean",De="Array",Y="object",K=[Ie,j,Te];class Pe{constructor(e){this.propertyName=e,this.type=Te}}class Q{constructor(e){this.propertyName=e,this.type=j}}class ze{constructor(e){this.propertyName=e,this.type=Ie}}class je{constructor(e){this.propertyName=e,this.type=ke}}class Ye{constructor(e){this.propertyName=e,this.type=de}}class Ue{constructor(e){this.propertyName=e,this.type=ce}}class B{constructor(e,t=[]){this.propertyName=e,this.items=t,this.type=De}}class Fe{constructor(e,t=[]){this.propertyName=e,this.types=t}toString(){return`PropertyItem(propertyName: ${this.propertyName}, types: [${this.types.map(e=>e.type).join(", ")}])`}}class D{constructor(e,t,o=[]){this.propertyName=e,this.className=t,this.properties=o,this.type=Y}}class Ht{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 o=[];if(!this.rootPropertyType)return o;if(e instanceof B){const s=e.items.find(i=>i.type===Y);if(s&&s instanceof D){const i=s.properties;o.push(" const columnDefs: ColumnDefIf[] = ["),this.iteratePropertyItems(o,i,""),o.push(" ];")}}return[...o,...this.bufCustomRenderer]}iteratePropertyItems(e,t,o=""){for(let s=0;s<t.length;s++){let r=t[s].types.filter(n=>!K.includes(n.type));if(r.length===1){let n=r[0];const l=o?[o,n.propertyName].join("."):n.propertyName;if(n instanceof D)this.iteratePropertyItems(e,n.properties,l);else{let a="";if(n instanceof B){const p=n.items.find(m=>m.type===Y);p&&p instanceof D&&(a=p.className)}const d=this.getReadableColumnLabel(l);let h=100,u="",f="ge-table-text-align-left";if(n.type===De){if(this.allowCustomRenderer&&a){const p=`${a}ArrayCellRenderer`;u=` bodyRenderer: new ${p}(),`,f="",this.renderCumstomCellRenderer(a,p)}else u=" bodyRenderer: new SimpleArrayCellRenderer(),";h=250}else n.type===de?(u=" bodyRenderer: new NumberCellRenderer(),",f="ge-table-text-align-right"):n.type===ce&&(u=" bodyRenderer: new TrueFalseCellRenderer(),",f="ge-table-text-align-center",h=80);e.push(` ColumnDef.create({
|
|
2
2
|
property: "${l}",
|
|
3
|
-
headerLabel: "${
|
|
3
|
+
headerLabel: "${d}",
|
|
4
4
|
width: new Size(${h}, "px"),
|
|
5
5
|
bodyClasses: ["${f}"],
|
|
6
|
-
headerClasses: ["${f}"],`),u&&e.push(u),e.push(" }),")}}}}transformLabel(e){return this.LABEL_MAPPINGS[e]||e}getReadableColumnLabel(e){const
|
|
6
|
+
headerClasses: ["${f}"],`),u&&e.push(u),e.push(" }),")}}}}transformLabel(e){return this.LABEL_MAPPINGS[e]||e}getReadableColumnLabel(e){const o=e.split(".").map(s=>{const i=s.replace(/([a-z])([A-Z])/g,"$1 $2");return i.charAt(0).toUpperCase()+i.slice(1)});for(let s=0;s<o.length;s++)o[s]=this.transformLabel(o[s]);return o.join(" ")}renderCumstomCellRenderer(e,t){this.bufCustomRenderer.push(`
|
|
7
7
|
// --------------------------------------------------------------
|
|
8
8
|
|
|
9
9
|
import { AreaModelIf, CellRendererIf, DomServiceIf, AreaIdent, RendererCleanupFnType } from "@guiexpert/table";
|
|
@@ -38,46 +38,46 @@ export class ${t} implements CellRendererIf {
|
|
|
38
38
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
`)}}class fe{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 Ue{constructor(){this.property="",this.value="",this.path="",this.propertyItem=new Fe("",[new Pe("")])}toString(){var e;return`${this.path} -> : ${((e=this.propertyItem)==null?void 0:e.toString())??""}`}}const me="Entity";function Ke(d){let e=Xe(Je(d));return e.includes(me)||(e=e+me),e}function Xe(d){if(!d||d.length===0)return d;const e=["Array","Arr","List","s"];for(const t of e)if(d.endsWith(t))return d.slice(0,-t.length);return d}function Je(d){return!d||d.length===0?"":d[0].toUpperCase()+d.slice(1)}class Bt{constructor(){this.debugging=!1}json2PropertyType(e,t=""){let s;if(typeof e=="string"){const o=new fe().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 fe().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=>!K.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 Pe("")}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(h=>h.type===j)||i.propertyItem.types.push(new Q(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 Ue;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===Y&&!Array.isArray(i)){for(const c in i)if(i.hasOwnProperty(c)){const h=r?`${r}/${c}`:c;o(i[c],h,a)}}else Array.isArray(i)&&i.forEach((c,h)=>{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 Fe(t,[this.createPropertyType(e,t)])}createPropertyType(e,t){return e===null?new Ge(t):e===void 0?new Q(t):typeof e===ke?new ze(t):typeof e===ae&&!isNaN(e)?new je(t):typeof e===ce?new Ye(t):Array.isArray(e)?new B(t):typeof e===Y?new k(t,Ke(t)):new Q(t)}}class Ht{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!==j).sort((i,r)=>K.includes(i)?100:K.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===j)return!0;return!1}}class W{constructor(){this.alreadySet=!1}static getInstance(){return W.instance||(W.instance=new W),W.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 N(d){return d&&d.type==="TreeRow"}function se(d){return d&&d.type==="AreaModelTree"}function qe(d){return d&&d.type==="CheckboxColumnDef"}class de{constructor(e=-1,t=-1,s=-1,o=-1,i,r,n,l=0,a=0,c=0,h=""){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=h}clone(){return new de(this.rowIndex,this.rowTop,this.columnIndex,this.columnLeft,this.areaIdent,this.sideIdent,this.originalEvent,this.clickCount,this.draggingX,this.draggingY,this.action)}}class _{constructor(e=">",t="",s=[]){this.content=e,this.style=t,this.classes=s}}class Oe{constructor(e=new _(">","transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",["gt-table-tree-arrow-expanded"]),t=new _(">","",["ge-table-tree-arrow-collapsed"]),s=new _(">","color:transparent;",["gt-table-tree-arrow-hidden"]),o=new _("↕","",["gt-table-tree-arrow-expanded-all"])){this.arrowExpanded=e,this.arrowCollapsed=t,this.arrowPlaceholder=s,this.arrowExpandCollapseAll=o}}class Le{constructor(e=new _("↑","",["ge-header-sorted-asc"]),t=new _("↓","",["ge-header-sorted-desc"]),s=new _("↑","color:transparent;",[])){this.iconAsc=e,this.iconDesc=t,this.iconPlaceholder=s}}class Ze{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:h=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&&h&&this.addCheckboxToDiv(m,h,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 me{fixJSON(e){const t=[];let o="",s=!1,i=!1;for(let r=0;r<e.length;r++){const n=e[r];if(o+=n,n==='"'&&!i&&(s=!s),n==="\\"&&!i){i=!0;continue}else i=!1;if(!s){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==="{"?o+="}":r==="["&&(o+="]")}return o}}class Ke{constructor(){this.property="",this.value="",this.path="",this.propertyItem=new Fe("",[new Pe("")])}toString(){var e;return`${this.path} -> : ${((e=this.propertyItem)==null?void 0:e.toString())??""}`}}const be="Entity";function Xe(c){let e=Je(qe(c));return e.includes(be)||(e=e+be),e}function Je(c){if(!c||c.length===0)return c;const e=["Array","Arr","List","s"];for(const t of e)if(c.endsWith(t))return c.slice(0,-t.length);return c}function qe(c){return!c||c.length===0?"":c[0].toUpperCase()+c.slice(1)}class Wt{constructor(){this.debugging=!1}json2PropertyType(e,t=""){let o;if(typeof e=="string"){const s=new me().fixJSON(e);o=this.json2Object(s)}else o=e;return this.object2PropertyType(o,t)}json2Object(e){return JSON.parse(e)}object2PropertyType(e,t=""){const o=this.object2ValueInfos(e,t);this.debugging&&this.logValueInfos(o);const s=this.valueInfos2PropertyType(o);return"name"in s&&(s.name=t),s}json2ValueInfos(e,t=""){let o;if(typeof e=="string"){const s=new me().fixJSON(e);o=this.json2Object(s)}else o=e;return this.object2ValueInfos(o,t)}object2ValueInfos(e,t=""){const o=this.extractValueInfos(e,t),s=this.mergeValueInfos(o);return s.length>0&&(s[0].propertyItem.propertyName=t),this.debugging&&this.logValueInfos(s),s}getParentPath(e){const t=e.lastIndexOf("/");return t===-1?"":e.substring(0,t)}valueInfos2PropertyType(e){const t=e[0].propertyItem.types[0],o=new Map;for(const s of e)o.set(s.path,s);for(const s of e){const i=this.getParentPath(s.path);if(i){const r=o.get(i);if(r){let n=!1;const l=r.propertyItem.types.filter(a=>!K.includes(a.type));if(l.length===1){const a=l[0];if(a instanceof B){n=!0;for(const d of s.propertyItem.types)a.items.push(d)}else a instanceof D&&(n=!0,a.properties.push(s.propertyItem))}if(!n)for(const a of s.propertyItem.types)r.propertyItem.types.push(a)}}}return t||new Pe("")}logValueInfos(e){for(let t=0;t<e.length;t++){const o=e[t];o.value=null;const s=t.toString().padStart(2,"0");console.info(s+") "+o.toString()+" parent: "+this.getParentPath(o.path))}}mergeValueInfos(e){const t=[];let o=e.length-1;t.push(e[o]);let s=e[o].path;for(let i=o-1;i>=0;i--){if(e[i].path===s){const r=e[i].propertyItem.types[0];e[o].propertyItem.types.some(n=>n.type===r.type)||e[o].propertyItem.types.push(r)}(i===0||e[i].path!==s)&&(o=i,t.push(e[i]),s=e[o].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,d=this.countPath(e,i.path);a>d&&(i.propertyItem.types.some(h=>h.type===j)||i.propertyItem.types.push(new Q(i.property)))}}}}return t.reverse(),t}countPath(e,t){let o=0;for(const s of e)s.path===t&&o++;return o}getFirstValueInfoByPath(e,t){for(let o=e.length-1;o>=0;o--)if(e[o].path===t)return e[o];return null}extractValueInfos(e,t){const o=[],s=(i,r,n)=>{const l=new Ke;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),o.push(l),i&&typeof i===Y&&!Array.isArray(i)){for(const d in i)if(i.hasOwnProperty(d)){const h=r?`${r}/${d}`:d;s(i[d],h,a)}}else Array.isArray(i)&&i.forEach((d,h)=>{const u=`${r}/[]`;s(d,u,a)})};return s(e,"root",t),o.sort((i,r)=>i.path.localeCompare(r.path))}createPropertyItem(e,t){return new Fe(t,[this.createPropertyType(e,t)])}createPropertyType(e,t){return e===null?new ze(t):e===void 0?new Q(t):typeof e===ke?new je(t):typeof e===de&&!isNaN(e)?new Ye(t):typeof e===ce?new Ue(t):Array.isArray(e)?new B(t):typeof e===Y?new D(t,Xe(t)):new Q(t)}}class Nt{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 o=this.renderTypeScriptInterfacesFifo.shift();o&&this.renderTypeScriptInterfacesRecursive(o,e,o.propertyName)}}renderTypeScriptInterfacesRecursive(e=this.rootPropertyType,t=[],o=this.rootName){if(!e)return t;if(e instanceof B){for(const s of e.items)if(this.renderTypeScriptInterfacesRecursive(s,t,o),s instanceof D){const i=s;i!==this.rootPropertyType&&this.renderTypeScriptInterfacesFifo.push(i)}}else if(e instanceof D){const s=e,i=s.className;if(!this.renderTypeScriptInterfacesDone.includes(i)){this.renderTypeScriptInterfacesDone.push(i),t.push(`export interface ${i} {`);for(const r of s.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 D)a!==this.rootPropertyType&&this.renderTypeScriptInterfacesFifo.push(a);else if(a instanceof B)for(const d of a.items)d instanceof D&&this.renderTypeScriptInterfacesFifo.push(d)}t.push("}"),t.push("")}}return t}propertyItem2InterfaceDateType(e){var o,s;if(((o=e.types)==null?void 0:o.length)===0)return"any";if(((s=e.types)==null?void 0:s.length)===1)return this.renderType(e.types[0],e);const t=e.types.map(i=>this.renderType(i,e)).filter(i=>i!==j).sort((i,r)=>K.includes(i)?100:K.includes(r)?-100:i.localeCompare(r)).join(this.orOperator);return t.includes(this.orOperator)?"("+t+")":t}renderType(e,t){if(e instanceof B){const o=e.items.map(s=>this.renderType(s,t)).join(this.orOperator);return o.includes(this.orOperator)?`(${o})[]`:`${o}[]`}return e instanceof D?e.className:e.type}containsUndefinedPropertyType(e){for(const t of e.types)if(t.type===j)return!0;return!1}}class W{constructor(){this.alreadySet=!1}static getInstance(){return W.instance||(W.instance=new W),W.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 N(c){return c&&c.type==="TreeRow"}function oe(c){return c&&c.type==="AreaModelTree"}function Ze(c){return c&&c.type==="CheckboxColumnDef"}class he{constructor(e=-1,t=-1,o=-1,s=-1,i,r,n,l=0,a=0,d=0,h=""){this.rowIndex=e,this.rowTop=t,this.columnIndex=o,this.columnLeft=s,this.areaIdent=i,this.sideIdent=r,this.originalEvent=n,this.clickCount=l,this.draggingX=a,this.draggingY=d,this.action=h}clone(){return new he(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="",o=[]){this.content=e,this.style=t,this.classes=o}}class _e{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"]),o=new L(">","color:transparent;",["gt-table-tree-arrow-hidden"]),s=new L("↕","",["gt-table-tree-arrow-expanded-all"])){this.arrowExpanded=e,this.arrowCollapsed=t,this.arrowPlaceholder=o,this.arrowExpandCollapseAll=s}}class Oe{constructor(e=new L("↑","",["ge-header-sorted-asc"]),t=new L("↓","",["ge-header-sorted-desc"]),o=new L("↑","color:transparent;",[])){this.iconAsc=e,this.iconDesc=t,this.iconPlaceholder=o}}class Qe{constructor(e){this.domService=e}setStyle(e,t,o){return this.domService.setStyle(e,t,o),e}applyStyle(e,t){for(const o in t)this.domService.setStyle(e,o,t[o]);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(([o,s])=>this.domService.setStyle(e,o,s+"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",o){return this.domService.setStyle(o,"overflow-x",e),this.domService.setStyle(o,"overflow-y",t),o}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 o=this.domService.createText(t);return this.domService.appendChild(e,o),o}addClass(e,t){return e.includes(" ")?e.split(" ").forEach(o=>this.domService.addClass(t,o)):this.domService.addClass(t,e),t}removeClass(e,t){return e.includes(" ")?e.split(" ").forEach(o=>this.domService.removeClass(t,o)):this.domService.removeClass(t,e),t}addClasses(e,t){if(e)for(const o of e)this.domService.addClass(t,o);return t}setAttribute(e,t,o){return t&&o&&this.domService.setAttribute(e,t,o),e}createAreaDivWithClass(e,t,o,s){const i=this.domService.createElement("div");return this.addClass(e,i),this.domService.setAttribute(i,"data-area",o),this.domService.setAttribute(i,"data-side",s),this.domService.appendChild(t,i),i}createDivWithClass(e,t){const o=this.domService.createElement("div");return this.addClass(e,o),this.domService.appendChild(t,o),o}addRowDiv(e,t,o=-1,s,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}`),s==="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",`${o}`),this.domService.setAttribute(l,"data-area",`${s}`),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:o,rowIndex:s=-1,columnIndex:i=-1,areaIdent:r,sideIdent:n,text:l="",treeArrow:a,tableOptions:d,checkedType:h=void 0,sortState:u}=e,f=d==null?void 0:d.treeOptions,p=d==null?void 0:d.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-${o.index}`),this.domService.setAttribute(m,"data-col-index",`${o.index}`),this.domService.setAttribute(m,"data-row-index",`${s}`),this.domService.setAttribute(m,"data-area",`${r}`);const g=((o==null?void 0:o.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",`${o.left}px`),this.domService.setStyle(m,"top",`${o.top}px`),this.domService.setStyle(m,"width",`${o.width}px`),this.domService.setStyle(m,"height",`${o.height}px`),a&&a!=="none"&&(this.domService.addClass(m,"ge-table-col-tree"),this.addArrowDiv(m,a,f,s,i,r)),p&&i===0&&h&&this.addCheckboxToDiv(m,h,r,s),l){const b=a!=="none"&&i===0;this.addLabelDiv(m,l,b,s,i,r)}return u&&this.addSortedIcon(m,u,d==null?void 0:d.sortedOptions,i),this.domService.appendChild(t,m),m}addCheckboxToDiv(e,t,o,s){const i=this.domService.createElement("div"),r=t==="full"?"checked":"";return i.innerHTML=`
|
|
42
42
|
<input
|
|
43
43
|
type="checkbox"
|
|
44
|
-
data-area="${
|
|
45
|
-
data-row-index="${
|
|
44
|
+
data-area="${o}"
|
|
45
|
+
data-row-index="${s}"
|
|
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 Le,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 Oe,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 h of l.classes)this.domService.addClass(n,h);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 q=d=>d==="header"?"header":d==="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=q(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 et{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){this.lastClicked=t,this.publishGeMouseEvent(e,2);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(N(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=q(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)),N(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,h=t(e.data);a?(r=this.tableScope.storeStateCollapsedExpandService)==null||r.collapsedStateIdsPush(h):c&&((n=this.tableScope.storeStateCollapsedExpandService)==null||n.collapsedStateIdsRemove(h))}}getArrowColumnIndex(){return this.tableScope.tableModel.isRowCheckboxVisible()?1:0}onMouseDown(e){this.dragging||(this.mouseEvent=e,this.startMouseEvent=this.tableScope.createGeMouseEvent(this.mouseEvent),this.tableScope.onMouseDown(this.startMouseEvent),this.mouseDown=!0)}onMouseMove(e){this.mouseEvent=e,this.mouseDown?(this.dragging||(this.dragging=!0,this.tableScope.setDragging(!0)),requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))):requestAnimationFrame(this.mouseMoveOnFrame.bind(this))}onMouseUp(e){this.mouseEvent=e,this.dragging&&requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)),this.mouseDown=!1,this.dragging=!1,this.tableScope.setDragging(!1)}mouseDraggingOnFrame(){var e;if(this.mouseEvent){const t=this.tableScope.createGeMouseEvent(this.mouseEvent);(e=this.startMouseEvent)!=null&&e.originalEvent&&(t.draggingX=this.mouseEvent.clientX-this.startMouseEvent.originalEvent.clientX,t.draggingY=this.mouseEvent.clientY-this.startMouseEvent.originalEvent.clientY),this.tableScope.mouseDraggingOnFrame(t,this.startMouseEvent)}}mouseDraggingEndOnFrame(){var e;if(this.mouseEvent){const t=this.tableScope.createGeMouseEvent(this.mouseEvent);(e=this.startMouseEvent)!=null&&e.originalEvent&&(t.draggingX=this.mouseEvent.clientX-this.startMouseEvent.originalEvent.clientX,t.draggingY=this.mouseEvent.clientY-this.startMouseEvent.originalEvent.clientY),this.tableScope.mouseDraggingEndOnFrame(t)}}mouseMoveOnFrame(){if(this.mouseEvent){const e=this.tableScope.createGeMouseEvent(this.mouseEvent);this.tableScope.mouseMove(e)}}}class 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}sort(e){}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 tt{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 O extends he{constructor(e,t,s,o=[],i="ge-selected-row",r="ge-focused-row"){super(e,o,s),this.areaIdent=e,this.rows=t,this.defaultRowHeight=s,this.columnDefs=o,this.selectedRowClass=i,this.focusedRowClass=r,this.sorterService=new tt,this._focusedRowIndex=0,this.filteredRows=[...t],this.properties=o.map(n=>n.property)}getFocusedRowIndex(){return this._focusedRowIndex}setFocusedRowIndex(e){this._focusedRowIndex=e}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 N(o)&&(o=o.data),o?this.getValueByT(o,s):""}getFilteredRows(){return this.filteredRows}getAllRows(){return this.rows}findRowFromFilteredRowsByAllCriteria(e,t){return this.getFilteredRows().find(s=>t(e,s))}findRowFromAllRowsByAllCriteria(e,t){return this.getAllRows().find(s=>t(e,s))}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}sort(e){this.filteredRows=this.filteredRows.sort(e)}getValueByT(e,t){if(e&&t)return t.includes(".")?this.getPropertyValue(e,t.split(".")):e[t]}changeColumnOrder(e,t){this.arrayMove(this.properties,e,t),super.changeColumnOrder(e,t)}getCustomClassesAt(e,t){const s=super.getCustomClassesAt(e,t);return this.getRowByIndex(e).selected&&s.push(this.selectedRowClass),this._focusedRowIndex===e&&s.push(this.focusedRowClass),s}genericFlatTableSortComparator(e,t){const s=this.columnDefs.find(o=>o.property===e);return(o,i)=>{const r=this.getValueByT(o,e),n=this.getValueByT(i,e);return s!=null&&s.sortComparator?t*s.sortComparator(r,n,o,i,t):this.sorterService.genericSortComparator(r,n,t)}}getPropertyValue(e,t){const s=t.shift(),o=e[s];return o&&t.length?this.getPropertyValue(o,t):o}}class st{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 h=0;h<o;h++)c.push(n.getValueAt(a,h))}}return this.tableScope.excelService.downloadExcel(s,e,t)}getTableScope(){return this.tableScope}getSelectionModel(){return this.tableScope.selectionModel()}autoResizeColumns(e=!0){this.tableScope.autoResizeColumns(e)}recalcWrappers(){this.tableScope.recalcWrappers()}setColumnWidth(e,t){this.tableScope.setColumnWidth(e,t)}getTableModel(){return this.tableScope.tableModel}getBodyModel(){return this.tableScope.tableModel.getBodyModel()}setRows(e){const t=this.getBodyModel();t instanceof O?t.setRows(e):console.warn("setRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof t,t)}addRows(e){const t=this.getBodyModel();if(t instanceof O){const s=t;let o=s.getAllRows();s.setRows([...o,...e])}else console.warn("addRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof t,t)}addRowsAt(e,t){const s=this.getBodyModel();if(s instanceof O){const o=s;let i=o.getAllRows();o.setRows([...i.slice(0,t),...e,...i.slice(t)])}else console.warn("addRowsAt<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s)}removeRows(e,t=(s,o)=>s===o){const s=this.getBodyModel();if(s instanceof O){const o=s,i=o.getAllRows().filter(r=>!e.some(n=>t(r,n)));o.setRows(i)}else console.warn("removeRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s)}findRows(e,t=(s,o)=>s===o){const s=this.getBodyModel();return s instanceof O?s.getAllRows().filter(i=>e.some(r=>t(i,r))):(console.warn("findRows<T>(rows: T[], predicate: (a: T, b: T) => boolean) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s),[])}findRowFromFilteredRowsByAllCriteria(e,t){const s=this.getBodyModel();if(s instanceof O)return s.getFilteredRows().find(i=>t(e,i));console.warn("findRowFromFilteredRowsByAllCriteria(...) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s)}findRowFromAllRowsByAllCriteria(e,t){const s=this.getBodyModel();if(s instanceof O)return s.getAllRows().find(i=>t(e,i));console.warn("findRowFromAllRowsByAllCriteria(...) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s)}updateRows(e,t=(s,o)=>s===o){const s=this.getBodyModel();if(s instanceof O){let i=s.getAllRows();for(const r of i)for(const n of e)if(t(r,n))for(const l of Object.keys(n))r[l]=n[l]}else console.warn("updateRows<T>(rows: T[], predicate: (a: T, b: T) => boolean) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s)}reSort(){this.tableScope.reSort()}sort(e){this.tableScope.sort(e)}ensureRowIsVisible(e){return this.tableScope.ensureRowIsVisible(e)}getDisplayedRowCount(){return this.tableScope.getDisplayedRowCount()}getFirstVisibleRowIndex(){return this.tableScope.getFirstVisibleRowIndex()}getFirstFullVisibleRowIndex(){return this.tableScope.getFirstFullVisibleRowIndex()}getLastVisibleRowIndex(){return this.tableScope.getLastVisibleRowIndex()}getLastFullVisibleRowIndex(){return this.tableScope.getLastFullVisibleRowIndex()}setLoggingActive(e){this.tableScope.loggingActive=e}isLoggingActive(){return this.tableScope.loggingActive}}class _e{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 ot extends _e{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 it{constructor(e="collapsed",t=[],s=!1,o=!1){this.mode=e,this.rowIds=t,this.allCollapsed=s,this.allExpanded=o}}class rt extends _e{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new it,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 nt extends _e{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 L{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 lt{constructor(e,t,s,o){this.hostElement=e,this.tableModel=t,this.dom=s,this.tableOptions=o,this.scrollTop=0,this.areaBodyWestGeo=new L,this.areaBodyCenterGeo=new L,this.areaBodyEastGeo=new L;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 at{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 ct extends lt{constructor(e,t,s,o){var r,n;super(e,t,s,o),this.firstVisibleRowIndex=-1,this.lastVisibleRowIndex=-1,this.firstFullVisibleRowIndex=-1,this.lastFullVisibleRowIndex=-1,this.displayedRowCount=0,this.pixelLimitForFullVisible=5,this.loggingActive=!1,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.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),se(t.getAreaModel("body"))&&(this.tree=!0),["header","body","footer"].forEach(l=>{var a;this.colAndRowspanModels[l]=new at(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||e>this.scrollViewport.offsetWidth)&&this.scrollViewport.offsetWidth>100?this.scrollViewport.offsetWidth: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 L(0,this.hostElement.clientWidth,1,0),this.hostElement,"ge-table-border")),this.tableOptions.tableBottomBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new L(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 L(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 L(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 h;if(c?h=this.editorRenderer:h=r.getCellRenderer(t,s),l.innerText="",this.applyCssClasses(l,i),h)a=h.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])}}getFirstVisibleRowIndex(){return this.firstVisibleRowIndex}getLastVisibleRowIndex(){return this.lastVisibleRowIndex}getFirstFullVisibleRowIndex(){return this.firstFullVisibleRowIndex}getLastFullVisibleRowIndex(){return this.lastFullVisibleRowIndex}getDisplayedRowCount(){return this.displayedRowCount}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),h=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();e==="body"&&(this.firstVisibleRowIndex=-1,this.firstFullVisibleRowIndex=-1,this.lastVisibleRowIndex=-1,this.lastFullVisibleRowIndex=-1);for(let b=0;b<h;b++){const w=u,S=b===h-1,A=this.tableModel.getRowHeight(e,b);if(w+A>0){e==="body"&&this.firstVisibleRowIndex===-1&&(this.firstVisibleRowIndex=b,this.firstFullVisibleRowIndex=w<-this.pixelLimitForFullVisible?this.firstVisibleRowIndex+1:this.firstVisibleRowIndex);let C={left:n,width:l,height:A,top:w,index:b},x=this.dom.addRowDiv(o,C,b,e,"center");const D=m;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:c,geo:C,parent:x,rowIndex:b,columnIndexStart:D,columnIndexEnd:f-p-1,verticalFixed:!1,lastRowOfModel:S}),a.left>0&&(C={left:n,width:this.areaBodyWestGeo.width,height:A,top:w,index:b},x=this.dom.addRowDiv(s,C,b,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:c,geo:C,parent:x,rowIndex:b,columnIndexStart:0,columnIndexEnd:D-1,verticalFixed:!0,lastRowOfModel:S})),a.right>0&&(C={left:n,width:this.areaBodyEastGeo.width,height:A,top:w,index:b},x=this.dom.addRowDiv(i,C,b,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:c,geo:C,parent:x,rowIndex:b,columnIndexStart:f-p,columnIndexEnd:f-1,verticalFixed:!0,lastRowOfModel:S})),e==="header"&&this.tree&&b===h-1){const E=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(x,new L(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),I=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(I){const Z=this.dom.domService.createText(I.content);this.dom.domService.appendChild(E,Z),I.style&&this.dom.applyStyleString(E,I.style)}}}if(u=u+A,u>r){e==="body"&&(this.lastVisibleRowIndex=b,this.lastFullVisibleRowIndex=r-u<-this.pixelLimitForFullVisible?b-1:b,this.displayedRowCount=this.lastFullVisibleRowIndex-this.firstFullVisibleRowIndex+1);break}}if(this.loggingActive&&e==="body"&&console.log("render scope: this.firstVisibleRowIndex <- "+this.firstVisibleRowIndex+`
|
|
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",`${s}`),this.domService.appendChild(e,i),i}addLabelDiv(e,t="",o=!1,s=-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",`${s}`),this.domService.setAttribute(n,"data-col-index",`${i}`),this.domService.setAttribute(n,"data-area",`${r}`),t)if(o){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",`${s}`),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="",o=new Oe,s=-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",`${s}`),this.domService.setAttribute(i,"data-area","header");let r;t==="asc"?r=o.iconAsc:t==="desc"?r=o.iconDesc:r=o.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",o=new _e,s=-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",`${s}`),this.domService.setAttribute(n,"data-col-index",`${i}`),this.domService.setAttribute(n,"data-area",`${r}`);let l;t==="expanded"?l=o.arrowExpanded:t==="collapsed"?l=o.arrowCollapsed:l=o.arrowPlaceholder;const a=l.content,d=this.domService.createText(a);this.domService.appendChild(n,d),l.style&&this.applyStyleString(n,l.style);for(const h of l.classes)this.domService.addClass(n,h);return this.domService.appendChild(e,n),n}addColumnBorderDivs(e,t,o,s,i){if(e.verticalBorderVisible){const r=`ge-table-${s}-${i}-vertical-border`;this.addVerticalBorder(o,t,r)}if(e.horizontalBorderVisible){const r=`ge-table-${s}-${i}-horizontal-border`;this.addHorizontalBorder(o,t,r)}return t}addHorizontalBorder(e,t,o="ge-table-body-center-horizontal-border"){const s=this.domService.createElement("div");return this.domService.addClass(s,o),this.domService.setStyle(s,"display","clip"),this.domService.setStyle(s,"position","absolute"),this.domService.setStyle(s,"left",`${e.left}px`),this.domService.setStyle(s,"top",`${e.top}px`),this.domService.setStyle(s,"width",`${e.width}px`),this.domService.setStyle(s,"height","1px"),this.domService.appendChild(t,s),s}addFocusBorderDivs(e,t,o){t={...t,width:t.width+1,height:t.height+1};let s=this.domService.createElement("div");return this.domService.addClass(s,"ge-table-focus-border"),this.domService.setStyle(s,"display","clip"),this.domService.setStyle(s,"position","absolute"),this.domService.setStyle(s,"left",`${t.left}px`),this.domService.setStyle(s,"top",`${t.top}px`),this.domService.setStyle(s,"width","1px"),this.domService.setStyle(s,"height",`${t.height}px`),this.domService.setStyle(s,"z-index","9999"),this.applyStyle(s,o),this.domService.appendChild(e,s),s=this.domService.createElement("div"),this.domService.addClass(s,"ge-table-focus-border"),this.domService.setStyle(s,"display","clip"),this.domService.setStyle(s,"position","absolute"),this.domService.setStyle(s,"left",`${t.left+t.width-1}px`),this.domService.setStyle(s,"top",`${t.top}px`),this.domService.setStyle(s,"width","1px"),this.domService.setStyle(s,"height",`${t.height}px`),this.domService.setStyle(s,"z-index","9999"),this.applyStyle(s,o),this.domService.appendChild(e,s),s=this.domService.createElement("div"),this.domService.addClass(s,"ge-table-focus-border"),this.domService.setStyle(s,"display","clip"),this.domService.setStyle(s,"position","absolute"),this.domService.setStyle(s,"left",`${t.left}px`),this.domService.setStyle(s,"top",`${t.top}px`),this.domService.setStyle(s,"width",`${t.width}px`),this.domService.setStyle(s,"height","1px"),this.domService.setStyle(s,"z-index","9999"),this.applyStyle(s,o),this.domService.appendChild(e,s),s=this.domService.createElement("div"),this.domService.addClass(s,"ge-table-focus-border"),this.domService.setStyle(s,"display","clip"),this.domService.setStyle(s,"position","absolute"),this.domService.setStyle(s,"left",`${t.left}px`),this.domService.setStyle(s,"top",`${t.top+t.height-1}px`),this.domService.setStyle(s,"width",`${t.width}px`),this.domService.setStyle(s,"height","1px"),this.domService.setStyle(s,"z-index","9999"),this.applyStyle(s,o),this.domService.appendChild(e,s),e}addVerticalBorder(e,t,o="ge-table-body-center-vertical-border"){const s=this.domService.createElement("div");return this.domService.addClass(s,o),this.domService.setStyle(s,"display","clip"),this.domService.setStyle(s,"position","absolute"),this.domService.setStyle(s,"left",`${e.left}px`),this.domService.setStyle(s,"top",`${e.top}px`),this.domService.setStyle(s,"width","1px"),this.domService.setStyle(s,"height",`${e.height}px`),this.domService.appendChild(t,s),s}addDiv(e,t,o=""){const s=this.domService.createElement("div");return o&&this.domService.addClass(s,o),this.domService.setStyle(s,"display","clip"),this.domService.setStyle(s,"position","absolute"),this.domService.setStyle(s,"left",`${t.left}px`),this.domService.setStyle(s,"top",`${t.top}px`),this.domService.setStyle(s,"width",`${t.width}px`),this.domService.setStyle(s,"height",`${t.height}px`),this.domService.appendChild(e,s),s}applyStyleString(e,t){const o=t.split(";").map(s=>s.trim()).filter(s=>s);for(const s of o){const[i,r]=s.split(":");this.domService.setStyle(e,i.trim(),r.trim())}}getDivOrCreateDiv(e,t){let o=t.cache[e];return o?(o.innerText="",o):(o=this.domService.createElement("div"),t.cache[e]=o,o)}}const q=c=>c==="header"?"header":c==="footer"?"footer":"body";class et{constructor(e,t){if(this.rowIdx=-1,this.colIdx=-1,this.action=null,this.inputType=null,this.className="",e!==null&&(e instanceof HTMLDivElement||e instanceof HTMLSpanElement||e instanceof HTMLInputElement)){this.className=e.className,this.action=e.getAttribute("data-ge-action"),this.inputType=e.getAttribute("data-input-type"),this.rowIdx=Number(e.getAttribute("data-row-index")),this.colIdx=Number(e.getAttribute("data-col-index"));const o=e.getAttribute("data-area");if(o&&(this.areaIdent=q(o),this.areaModel=t.tableModel.getAreaModel(this.areaIdent),this.row=this.areaModel.getRowByIndex(this.rowIdx)),e instanceof HTMLInputElement){const s=e;this.value=s.value}}}}class tt{constructor(e){this.tableScope=e,this.doubleClickDelay=500,this.expandedAll=!0,this.mouseDown=!1,this.dragging=!1,this.lastClicked=0,this.tableScope.hostElement.addEventListener("click",this.onHostElementClicked.bind(this)),this.tableScope.hostElement.addEventListener("dblclick",this.onHostElementDblClicked.bind(this)),this.tableScope.hostElement.addEventListener("mousedown",this.onMouseDown.bind(this)),this.tableScope.hostElement.addEventListener("mousemove",this.onMouseMove.bind(this)),this.tableScope.hostElement.addEventListener("mouseup",this.onMouseUp.bind(this)),this.tableScope.hostElement.addEventListener("contextmenu",this.onContextmenu.bind(this)),this.tableScope.hostElement._MouseHandler="true",this.tableScope.scrollViewport.addEventListener("scroll",this.tableScope.adjustAfterScrolling.bind(this.tableScope)),[window,this.tableScope.hostElement].forEach(t=>t.addEventListener("resize",this.tableScope.adjustContainersAndRows.bind(this.tableScope)))}onContextmenu(e){this.mouseEvent=e;const t=this.tableScope.createGeMouseEvent(this.mouseEvent);this.tableScope.contextmenu(t)}onHostElementClicked(e){const t=Date.now();if(t-this.lastClicked<this.doubleClickDelay){this.lastClicked=t,this.publishGeMouseEvent(e,2);return}this.lastClicked=t;const o=new et(e.target,this.tableScope);if(o.action==="toggleExpandCollapseAll")this.expandedAll=!this.expandedAll,this.tableScope.toggleExpandCollapseAll(this.expandedAll),e.preventDefault(),e.stopPropagation();else if(o.action==="toggleHeaderGroup")this.tableScope.toggleHeaderGroup(o),e.preventDefault(),e.stopPropagation();else if(o.inputType==="checkbox"&&o.areaIdent)this.tableScope.toggleRowCheckbox(o.rowIdx,o.colIdx,o.areaIdent),e.preventDefault(),e.stopPropagation();else if(N(o.row)&&o.areaModel){const s=o.colIdx===this.getArrowColumnIndex()&&e.altKey,i=o.className.includes("ge-table-tree-arrow-div");if(s||i){e.preventDefault(),e.stopPropagation();const r=o.row;r.expanded=!r.expanded,"recalcVisibleTreeRows"in o.areaModel&&o.areaModel.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(r)}}if(o.areaIdent==="body"&&this.tableScope.tableOptions.getFocusModel){const s=this.tableScope.tableOptions.getFocusModel();s==null||s.clear(),s==null||s.setFocus(o.rowIdx,o.colIdx)}this.publishGeMouseEvent(e,1)}onHostElementDblClicked(e){if(this.lastClicked=Date.now(),e.target instanceof HTMLElement){const t=e.target,o=t.getAttribute("data-area"),s=q(o),i=Number(t.getAttribute("data-row-index")),r=Number(t.getAttribute("data-col-index")),n=this.tableScope.tableModel.getAreaModel(s);if(o&&s==="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(o&&s==="body"&&n.isEditable(i,r)&&(this.tableScope.clearSelection(),this.tableScope.initRenderEditor(i,r)),N(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 o;this.mouseEvent=e,this.geMouseEventOld=(o=this.geMouseEvent)==null?void 0:o.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 o,s,i,r,n;const t=(s=(o=this.tableScope.tableOptions)==null?void 0:o.autoRestoreOptions)==null?void 0:s.getRowId;if(t){const l=(i=this.tableScope.storeStateCollapsedExpandService)==null?void 0:i.collapsedExpandedStateGet().mode,a=l==="collapsed"&&!e.expanded||l==="expanded"&&e.expanded,d=l==="collapsed"&&e.expanded||l==="expanded"&&!e.expanded,h=t(e.data);a?(r=this.tableScope.storeStateCollapsedExpandService)==null||r.collapsedStateIdsPush(h):d&&((n=this.tableScope.storeStateCollapsedExpandService)==null||n.collapsedStateIdsRemove(h))}}getArrowColumnIndex(){return this.tableScope.tableModel.isRowCheckboxVisible()?1:0}onMouseDown(e){this.dragging||(this.mouseEvent=e,this.startMouseEvent=this.tableScope.createGeMouseEvent(this.mouseEvent),this.tableScope.onMouseDown(this.startMouseEvent),this.mouseDown=!0)}onMouseMove(e){this.mouseEvent=e,this.mouseDown?(this.dragging||(this.dragging=!0,this.tableScope.setDragging(!0)),requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))):requestAnimationFrame(this.mouseMoveOnFrame.bind(this))}onMouseUp(e){this.mouseEvent=e,this.dragging&&requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)),this.mouseDown=!1,this.dragging=!1,this.tableScope.setDragging(!1)}mouseDraggingOnFrame(){var e;if(this.mouseEvent){const t=this.tableScope.createGeMouseEvent(this.mouseEvent);(e=this.startMouseEvent)!=null&&e.originalEvent&&(t.draggingX=this.mouseEvent.clientX-this.startMouseEvent.originalEvent.clientX,t.draggingY=this.mouseEvent.clientY-this.startMouseEvent.originalEvent.clientY),this.tableScope.mouseDraggingOnFrame(t,this.startMouseEvent)}}mouseDraggingEndOnFrame(){var e;if(this.mouseEvent){const t=this.tableScope.createGeMouseEvent(this.mouseEvent);(e=this.startMouseEvent)!=null&&e.originalEvent&&(t.draggingX=this.mouseEvent.clientX-this.startMouseEvent.originalEvent.clientX,t.draggingY=this.mouseEvent.clientY-this.startMouseEvent.originalEvent.clientY),this.tableScope.mouseDraggingEndOnFrame(t)}}mouseMoveOnFrame(){if(this.mouseEvent){const e=this.tableScope.createGeMouseEvent(this.mouseEvent);this.tableScope.mouseMove(e)}}}class ue{constructor(e,t=[],o=-1){this.areaIdent=e,this.columnDefs=t,this.defaultRowHeight=o,this.rowSelectionModel=void 0,this.yPositions=[],this.cellRenderers=t.map(s=>s.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 o;const t=this.getRowByIndex(e);return(o=this.rowSelectionModel)==null?void 0:o.isRowChecked(t)}setRowChecked(e,t){if(this.rowSelectionModel){const o=this.getRowByIndex(e);this.rowSelectionModel.checkRow(o,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}sort(e){}isEditable(e,t){var s,i;const o=(s=this.columnDefs)==null?void 0:s[t];return((i=o==null?void 0:o.editable)==null?void 0:i.call(o))??!1}setValue(e,t,o){var n;const s=(n=this.columnDefs[t])==null?void 0:n.editInputPipe;s&&(o=s(o,e,t));const i=this.getRowByIndex(e),r=this.columnDefs[t].property;return r.includes(".")?this.setPropertyValue(i,r.split("."),o):(i[r]=o,!0)}isSelectable(e,t){return!0}changeColumnOrder(e,t){this.arrayMove(this.cellRenderers,e,t)}setPropertyValue(e,t,o){const s=t.shift();if(s){const i=e[s];return i&&t.length?this.setPropertyValue(i,t,o):(e[s]=o,!0)}return!1}arrayMove(e,t,o){const s=e.splice(t,1)[0];return e.splice(o,0,s),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 Le{genericSortComparator(e,t,o){if(typeof e=="number"&&typeof t=="number")return o*(e-t);if(typeof e=="string"&&typeof t=="string")return o*e.localeCompare(t);if(typeof e=="boolean"&&typeof t=="boolean")return o*((e?-1:1)-(t?-1:1));if(e instanceof Date&&t instanceof Date)return o*(e.getTime()-t.getTime());if(e instanceof Array&&t instanceof Array){const s=e,i=t;if(s.length&&i.length)return this.genericSortComparator(s[0],i[0],o)}return o*(""+e).localeCompare(""+t)}}class _ extends ue{constructor(e,t,o,s=[],i="ge-selected-row",r="ge-focused-row"){super(e,s,o),this.areaIdent=e,this.rows=t,this.defaultRowHeight=o,this.columnDefs=s,this.selectedRowClass=i,this.focusedRowClass=r,this.sorterService=new Le,this._focusedRowIndex=0,this.filteredRows=[...t],this.properties=s.map(n=>n.property)}getFocusedRowIndex(){return this._focusedRowIndex}setFocusedRowIndex(e){this._focusedRowIndex=e}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 o=this.properties[t];let s=this.filteredRows[e];return N(s)&&(s=s.data),s?this.getValueByT(s,o):""}getFilteredRows(){return this.filteredRows}getAllRows(){return this.rows}findRowFromFilteredRowsByAllCriteria(e,t){return this.getFilteredRows().find(o=>t(e,o))}findRowFromAllRowsByAllCriteria(e,t){return this.getAllRows().find(o=>t(e,o))}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:o,sortState:s}=t,i=s==="asc"?1:s==="desc"?-1:0,r=this.properties[o];this.filteredRows=this.filteredRows.sort(this.genericFlatTableSortComparator(r,i))}return!0}sort(e){this.filteredRows=this.filteredRows.sort(e)}getValueByT(e,t){if(e&&t)return t.includes(".")?this.getPropertyValue(e,t.split(".")):e[t]}changeColumnOrder(e,t){this.arrayMove(this.properties,e,t),super.changeColumnOrder(e,t)}getCustomClassesAt(e,t){const o=super.getCustomClassesAt(e,t);return this.getRowByIndex(e).selected&&o.push(this.selectedRowClass),this._focusedRowIndex===e&&o.push(this.focusedRowClass),o}genericFlatTableSortComparator(e,t){const o=this.columnDefs.find(s=>s.property===e);return(s,i)=>{const r=this.getValueByT(s,e),n=this.getValueByT(i,e);return o!=null&&o.sortComparator?t*o.sortComparator(r,n,s,i,t):this.sorterService.genericSortComparator(r,n,t)}}getPropertyValue(e,t){const o=t.shift(),s=e[o];return s&&t.length?this.getPropertyValue(s,t):s}}class ot{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 o=[],s=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 d=[];o.push(d);for(let h=0;h<s;h++)d.push(n.getValueAt(a,h))}}return this.tableScope.excelService.downloadExcel(o,e,t)}getTableScope(){return this.tableScope}getSelectionModel(){return this.tableScope.selectionModel()}autoResizeColumns(e=!0){this.tableScope.autoResizeColumns(e)}recalcWrappers(){this.tableScope.recalcWrappers()}setColumnWidth(e,t){this.tableScope.setColumnWidth(e,t)}getTableModel(){return this.tableScope.tableModel}getBodyModel(){return this.tableScope.tableModel.getBodyModel()}setRows(e){const t=this.getBodyModel();t instanceof _?t.setRows(e):console.warn("setRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof t,t)}addRows(e){const t=this.getBodyModel();if(t instanceof _){const o=t;let s=o.getAllRows();o.setRows([...s,...e])}else console.warn("addRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof t,t)}addRowsAt(e,t){const o=this.getBodyModel();if(o instanceof _){const s=o;let i=s.getAllRows();s.setRows([...i.slice(0,t),...e,...i.slice(t)])}else console.warn("addRowsAt<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof o,o)}removeRows(e,t=(o,s)=>o===s){const o=this.getBodyModel();if(o instanceof _){const s=o,i=s.getAllRows().filter(r=>!e.some(n=>t(r,n)));s.setRows(i)}else console.warn("removeRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof o,o)}findRows(e,t=(o,s)=>o===s){const o=this.getBodyModel();return o instanceof _?o.getAllRows().filter(i=>e.some(r=>t(i,r))):(console.warn("findRows<T>(rows: T[], predicate: (a: T, b: T) => boolean) only works with AreaModelObjectArray<T>, but this body area model is ",typeof o,o),[])}findRowFromFilteredRowsByAllCriteria(e,t){const o=this.getBodyModel();if(o instanceof _)return o.getFilteredRows().find(i=>t(e,i));console.warn("findRowFromFilteredRowsByAllCriteria(...) only works with AreaModelObjectArray<T>, but this body area model is ",typeof o,o)}findRowFromAllRowsByAllCriteria(e,t){const o=this.getBodyModel();if(o instanceof _)return o.getAllRows().find(i=>t(e,i));console.warn("findRowFromAllRowsByAllCriteria(...) only works with AreaModelObjectArray<T>, but this body area model is ",typeof o,o)}updateRows(e,t=(o,s)=>o===s){const o=this.getBodyModel();if(o instanceof _){let i=o.getAllRows();for(const r of i)for(const n of e)if(t(r,n))for(const l of Object.keys(n))r[l]=n[l]}else console.warn("updateRows<T>(rows: T[], predicate: (a: T, b: T) => boolean) only works with AreaModelObjectArray<T>, but this body area model is ",typeof o,o)}reSort(){this.tableScope.reSort()}sort(e){this.tableScope.sort(e)}ensureRowIsVisible(e){return this.tableScope.ensureRowIsVisible(e)}getDisplayedRowCount(){return this.tableScope.getDisplayedRowCount()}getFirstVisibleRowIndex(){return this.tableScope.getFirstVisibleRowIndex()}getFirstFullVisibleRowIndex(){return this.tableScope.getFirstFullVisibleRowIndex()}getLastVisibleRowIndex(){return this.tableScope.getLastVisibleRowIndex()}getLastFullVisibleRowIndex(){return this.tableScope.getLastFullVisibleRowIndex()}setLoggingActive(e){this.tableScope.loggingActive=e}isLoggingActive(){return this.tableScope.loggingActive}}class $e{constructor(e){this.getStorageKeyFn=e}autoConvertMapToObject(e){const t={};return e instanceof Map&&e.forEach((s,i)=>{t[s]=i}),t}checkAndPersistItem(e,t){const o=this.getStorageKeyFn;if(o){const s=o();if(s){const i=s+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 st extends $e{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 o=t+this.SCROLL_STATE;let s=this.loadFromLocalStorage(o);this.scrollOffset=s||[0,0]}}}}class it{constructor(e="collapsed",t=[],o=!1,s=!1){this.mode=e,this.rowIds=t,this.allCollapsed=o,this.allExpanded=s}}class rt extends $e{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new it,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 o=t+this.COLLAPSED_EXPANDED_STATE,s=this.loadFromLocalStorage(o);s&&(this.collapsedExpandedState=s)}}}persist(){this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE,this.collapsedExpandedState)}}class nt extends $e{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 o=t+this.SORTING_STATE,s=this.loadFromLocalStorage(o);this.sortItems=s||[]}}}}class O{constructor(e=0,t=0,o=0,s=0,i){this.left=e,this.width=t,this.height=o,this.top=s,this.index=i}}class lt{constructor(e,t,o,s){this.hostElement=e,this.tableModel=t,this.dom=o,this.tableOptions=s,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=o.applyStylePosistionAbsolute(o.createDivWithClass("ge-table-hover-row",i)),this.hoverColumn=o.applyStylePosistionAbsolute(o.createDivWithClass("ge-table-hover-column",i)),this.draggingColumn=o.applyStylePosistionAbsolute(o.createDivWithClass("ge-table-dragging-column",i)),this.areaHeaderWest=o.appendRelativeChildDiv(o.applyStylePosistionAbsolute(o.createAreaDivWithClass("ge-table-header ge-table-header-west",i,"header","west"))),this.areaHeaderCenter=o.appendRelativeChildDiv(o.applyStylePosistionAbsolute(o.createAreaDivWithClass("ge-table-header ge-table-header-center",i,"header","center"))),this.areaHeaderEast=o.appendRelativeChildDiv(o.applyStylePosistionAbsolute(o.createAreaDivWithClass("ge-table-header ge-table-header-east",i,"body","east"))),this.areaBodyWest=o.appendRelativeChildDiv(o.applyStylePosistionAbsolute(o.createAreaDivWithClass("ge-table-body ge-table-body-west",i,"body","west"))),this.areaBodyEast=o.appendRelativeChildDiv(o.applyStylePosistionAbsolute(o.createAreaDivWithClass("ge-table-body ge-table-body-east",i,"body","east"))),this.areaFooterWest=o.appendRelativeChildDiv(o.applyStylePosistionAbsolute(o.createAreaDivWithClass("ge-table-footer ge-table-footer-west",i,"footer","west"))),this.areaFooterCenter=o.appendRelativeChildDiv(o.applyStylePosistionAbsolute(o.createAreaDivWithClass("ge-table-footer ge-table-footer-center",i,"footer","center"))),this.areaFooterEast=o.appendRelativeChildDiv(o.applyStylePosistionAbsolute(o.createAreaDivWithClass("ge-table-footer ge-table-footer-east",i,"footer","east"))),this.scrollViewport=o.applyStyleOverflowAuto(this.tableOptions.overflowX??"auto",this.tableOptions.overflowY??"auto",o.applyStyleNoPadding(o.applyStylePosistionAbsolute(o.createAreaDivWithClass("ge-table-scroll-viewport",i,"body","center")))),this.contentWrapperDiv=o.applyStyleNoPadding(o.applyStylePosistionRelative(o.createDivWithClass("ge-table-scroll-content-wrapper",this.scrollViewport))),this.contentDiv=o.applyStyleNoPadding(o.applyStylePosistionRelative(o.createDivWithClass("ge-table-scroll-content",this.contentWrapperDiv))),this.areaBodyCenter=o.appendRelativeChildDiv(o.createDivWithClass("ge-table-body-center",this.contentDiv)),this.borderHeaderBottom=o.applyStylePosistionAbsolute(o.createDivWithClass("ge-table-header-border",i)),this.borderFixedWest=o.applyStylePosistionAbsolute(o.createDivWithClass("ge-table-west-fixed-column-border",i)),this.borderFixedEast=o.applyStylePosistionAbsolute(o.createDivWithClass("ge-table-east-fixed-column-border",i)),this.borderFooterTop=o.applyStylePosistionAbsolute(o.createDivWithClass("ge-table-footer-border",i))}adjustContainersAndRows(){const e=this.tableModel.getPadding(),t=this.hostElement.clientWidth,o=this.hostElement.clientHeight;this.dom.applyStyle(this.scrollViewport,{width:`${t-e.left}px`,height:`${o-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=o-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=o-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=o-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:`${o-e.bottom}px`,left:"0"}),this.dom.applyStyle(this.areaFooterCenter.parent,{width:`${t-e.left-e.right}px`,height:`${e.bottom}px`,top:`${o-e.bottom}px`,left:`${e.left}px`}),this.dom.applyStyle(this.areaFooterEast.parent,{width:`${e.right}px`,height:`${e.bottom}px`,top:`${o-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:`${o-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,o,s,i=!1){this.r1=e,this.c1=t,this.r2=o,this.c2=s,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 at{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 o=0;o<e;o++)for(let s=0;s<t;s++){let i=this.areaModel.getColspanAt(o,s),r=this.areaModel.getRowspanAt(o,s);if(i>1||r>1){i===0&&(i=1),r===0&&(r=1);const n="gammaCells"in this.areaModel;this.colAndRowspanRanges.push(new R(o,s,o+r-1,s+i-1,n))}}}getRanges(){return this.colAndRowspanRanges?this.colAndRowspanRanges:[]}isInRange(e,t){if(this.colAndRowspanRanges){for(const o of this.colAndRowspanRanges)if(o.isInRange(e,t))return!0}return!1}}class T{constructor(e,t,o){this.header=e,this.body=t,this.footer=o}}class dt extends lt{constructor(e,t,o,s){var r,n;super(e,t,o,s),this.firstVisibleRowIndex=-1,this.lastVisibleRowIndex=-1,this.firstFullVisibleRowIndex=-1,this.lastFullVisibleRowIndex=-1,this.displayedRowCount=0,this.pixelLimitForFullVisible=5,this.loggingActive=!1,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 T,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),oe(t.getAreaModel("body"))&&(this.tree=!0),["header","body","footer"].forEach(l=>{var a;this.colAndRowspanModels[l]=new at(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 s;let o=(s=this.tableModel.getColumnDef(t))==null?void 0:s.getEditRenderer;if(o||(o=this.tableOptions.getEditRenderer),o)if(this.editorRenderer=o(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||e>this.scrollViewport.offsetWidth)&&this.scrollViewport.offsetWidth>100?this.scrollViewport.offsetWidth: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(o=>{this.tableModel.getAreaModel(o.area).setValue(o.rowIndex,o.columnIndex,o.value),t||this.rerenderCellContent(o)}),t&&this.repaint()}rerenderCellContent({area:e,rowIndex:t,columnIndex:o,value:s,cssClasses:i}){const r=this.tableModel.getAreaModel(e),n='div[data-col-index="'+o+'"][data-row-index="'+t+'"][data-area="'+e+'"]',l=document.querySelector(n);if(l){let a;const d=this.editorRenderer&&this.editorRendererRow===t&&this.editorRendererColumn===o;let h;if(d?h=this.editorRenderer:h=r.getCellRenderer(t,o),l.innerText="",this.applyCssClasses(l,i),h)a=h.render(l,t,o,e,r,s,this.dom.domService),a&&this.cleanupFunctions[e].push(a);else{const p=`${s}`;this.dom.addLabelDiv(l,p,!1,t,o,e)}const u=r.getCustomClassesAt(t,o);u.length&&this.dom.addClasses(u,l);const f=r.getCustomStyleAt(t,o);if(f)for(const p in f)this.dom.setStyle(l,p,f[p])}}getFirstVisibleRowIndex(){return this.firstVisibleRowIndex}getLastVisibleRowIndex(){return this.lastVisibleRowIndex}getFirstFullVisibleRowIndex(){return this.firstFullVisibleRowIndex}getLastFullVisibleRowIndex(){return this.lastFullVisibleRowIndex}getDisplayedRowCount(){return this.displayedRowCount}storeColumnWidths(){const e=this.tableModel.getColumnDefs();e!=null&&e.length&&(this.storedColumnWidths=e.map((t,o)=>this.tableModel.getColumnWidth(o)))}getAreaAndSideIdentByAttr(e){if(e){const t=this.getStringByAttr(e,"data-area"),o=this.getStringByAttr(e,"data-side");if(o&&t)return[t,o]}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 o;if(e){const s=(o=e.closest("["+t+"]"))==null?void 0:o.getAttribute(t);if(s)return Number(s)}return-1}getStringByAttr(e,t){var o;if(e){const s=(o=e.closest("["+t+"]"))==null?void 0:o.getAttribute(t);if(s)return s}return""}adjustArea(e,t=0){var g;const o=this.getArea(e,"west"),s=this.getArea(e,"center"),i=this.getArea(e,"east"),r=s.child.clientHeight;o.child.innerText="",s.child.innerText="",i.child.innerText="";const n=0,l=this.areaBodyCenterGeo.width,a=this.tableModel.getPadding(),d=this.tableModel.getAreaModel(e),h=d.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();e==="body"&&(this.firstVisibleRowIndex=-1,this.firstFullVisibleRowIndex=-1,this.lastVisibleRowIndex=-1,this.lastFullVisibleRowIndex=-1);for(let b=0;b<h;b++){const w=u,S=b===h-1,A=this.tableModel.getRowHeight(e,b);if(w+A>0){e==="body"&&this.firstVisibleRowIndex===-1&&(this.firstVisibleRowIndex=b,this.firstFullVisibleRowIndex=w<-this.pixelLimitForFullVisible?this.firstVisibleRowIndex+1:this.firstVisibleRowIndex);let C={left:n,width:l,height:A,top:w,index:b},x=this.dom.addRowDiv(s,C,b,e,"center");const P=m;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:d,geo:C,parent:x,rowIndex:b,columnIndexStart:P,columnIndexEnd:f-p-1,verticalFixed:!1,lastRowOfModel:S}),a.left>0&&(C={left:n,width:this.areaBodyWestGeo.width,height:A,top:w,index:b},x=this.dom.addRowDiv(o,C,b,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:d,geo:C,parent:x,rowIndex:b,columnIndexStart:0,columnIndexEnd:P-1,verticalFixed:!0,lastRowOfModel:S})),a.right>0&&(C={left:n,width:this.areaBodyEastGeo.width,height:A,top:w,index:b},x=this.dom.addRowDiv(i,C,b,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:d,geo:C,parent:x,rowIndex:b,columnIndexStart:f-p,columnIndexEnd:f-1,verticalFixed:!0,lastRowOfModel:S})),e==="header"&&this.tree&&b===h-1){const M=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(x,new O(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),I=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(I){const Z=this.dom.domService.createText(I.content);this.dom.domService.appendChild(M,Z),I.style&&this.dom.applyStyleString(M,I.style)}}}if(u=u+A,u>r){e==="body"&&(this.lastVisibleRowIndex=b,this.lastFullVisibleRowIndex=r-u<-this.pixelLimitForFullVisible?b-1:b,this.displayedRowCount=this.lastFullVisibleRowIndex-this.firstFullVisibleRowIndex+1);break}}if(this.loggingActive&&e==="body"&&console.log("render scope: this.firstVisibleRowIndex <- "+this.firstVisibleRowIndex+`
|
|
49
49
|
render scope: this.firstFullVisibleRowIndex <- `+this.firstFullVisibleRowIndex+`
|
|
50
50
|
render scope: this.lastVisibleRowIndex <- `+this.lastVisibleRowIndex+`
|
|
51
|
-
render scope: this.lastFullVisibleRowIndex <- `+this.lastFullVisibleRowIndex),this.colAndRowspanModels&&this.colAndRowspanModels[e]){const b=((g=this.colAndRowspanModels[e])==null?void 0:g.getRanges())??[];if(b.length)for(const w of b){let S=0,A=o.child,C="center";if(w.c1<m)A=s.child,C="west";else if(p>0&&w.c1>=f-p)A=i.child,C="east";else{const x=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();S=this.scrollFactorX*x-this.areaBodyWestGeo.width,C="center"}this.drawBigCell(w,S,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 h=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:h,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:h,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:h,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 h=0;if(!a){const g=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();h=this.scrollFactorX*g}const u=0,f=!!(e==="body"&&t);let p=h;for(let g=n;g<=l;g++){const b=p,w=this.tableModel.getColumnWidth(g);if(w>0&&b+w>0){let S=o.height;const A=s.getRowspanAt(r,g),C=s.getColspanAt(r,g);A>1&&(S=this.getRowHeights(r,r+A-1,s).reduce((E,I)=>E+I,0));let x=w;C>1&&(x=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,x,S);const E={left:b,top:u,width:x,height:S};this.dom.addColumnBorderDivs(this.tableOptions,i,E,e,t)}else{const E=this.renderSelectedBackgroundDiv(D,f,t,s,r,g,i,b,u,x,S);"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:x,height:S,parent:i,cellSelected:E,lastRowOfModel:c,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:r,columnIndex:g,cellLeft:b,cellTop:u,cellWidth:x,cellHeight:S,parent:i})}}if(p=p+w,p>this.areaBodyCenterGeo.width)break}this.tableOptions.verticalBorderVisible&&this.dom.addVerticalBorder(new L(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:h}){var We;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()&&N(m)){const v=m;(We=v.children)!=null&&We.length?v.expanded?g="expanded":g="collapsed":g="hidden"}let w;if(t==="header"){const v=this.tableModel.getColumnDef(i);(!(v!=null&&v.sortIconVisible)||v!=null&&v.sortIconVisible())&&(w=v==null?void 0:v.sortState)}const S=e.getValueAt(o,i),A=f?"":`${S}`,C=e.isRowChecked(o),x=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:w}),D=e.getTooltipAt(o,i);D&&this.dom.setAttribute(x,"title",D);const E=this.tableModel.getColumnDef(i);E&&E.classes[t]&&this.dom.addClasses(E.classes[t],x);let I;f&&(I=f.render(x,o,i,t,e,S,this.dom.domService));const Z=e.getCustomClassesAt(o,i);if(Z.length&&this.dom.addClasses(Z,x),this.dom.addColumnBorderDivs(this.tableOptions,c,p,t,s),h&&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(x,"data-ge-action","drag-column");const ge=e.getCustomStyleAt(o,i);if(ge)for(const v in ge)this.dom.setStyle(x,v,ge[v]);return[x,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,h=i.getRowHeight(a),u={left:0,width:e.width,height:h,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 w;p&&(w=p.render(b,a,n,t,i,f,this.dom.domService),w&&this.cleanupFunctions[t].push(w));const S=i.getCustomClassesAt(a,n);S.length&&this.dom.addClasses(S,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 x in C)this.dom.setStyle(b,x,C[x]);s=s+h}}return s}hideDraggingColumn(){this.dom.applyStyle(this.draggingColumn,{display:"none"})}renderDragTargetDiv(e,t,s,o,i){const r=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass("ge-table-drop-zone",e));return this.dom.setStyle(r,"left",`${t}px`),this.dom.setStyle(r,"top",`${s}px`),this.dom.setStyle(r,"width",`${o}px`),this.dom.setStyle(r,"height",`${i}px`),r}renderSelectedBackgroundDiv(e,t,s,o,i,r,n,l,a,c,h){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",`${h}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:h,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});h&&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 dt{constructor(e,t){this.columnIndex=e,this.sortState=t}}class ht{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=q(s),n=Number(o),l=Number(i);this.tableScope.updateModelValueAfterEdit(r,n,l,t.value)}}}}class ut{constructor(e=-1,t=-1){this.rowIndex=e,this.columnIndex=t}}class ue{constructor(e){this.cells=e}static createSingle(e,t){return new ue([new ut(e,t)])}}class pt{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,h;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||(h=e.originalEvent)!=null&&h.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 gt{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 ft{get(){return{f2:"START_EDITING",space:"TOGGLE_SELECTION","ctrl+num_add":"SELECT_ALL","meta+a":"SELECT_ALL","ctrl+a":"SELECT_ALL","meta+x":"DESELECT_ALL","meta+shift+a":"DESELECT_ALL","ctrl+shift+a":"DESELECT_ALL","ctrl+num_subtract":"DESELECT_ALL","ctrl -":"DESELECT_ALL",arrowup:"NAVIGATE_UP",arrowdown:"NAVIGATE_DOWN",arrowleft:"NAVIGATE_LEFT",arrowright:"NAVIGATE_RIGHT","meta+c":"COPY_2_CLIPBOARD","ctrl+c":"COPY_2_CLIPBOARD"}}}function mt(d){return d.trim().replace(/\+/g," ").replace(/ +/g," ").replace(/⌫/g,"backspace").replace(/↩/g,"enter").replace(/⇧/g,"shift").replace(/⌥/g,"alt").replace(/option/g,"alt").replace(/opt/g,"alt").replace(/⌃/g,"ctrl").replace(/control/g,"ctrl").replace(/command/g,"cmd").replace(/meta/g,"cmd").replace(/escape/g,"esc").replace(/⌘/g,"cmd").replace(/\*/g,"multiply").split(" ").filter(e=>e).filter((e,t,s)=>s.indexOf(e)===t).sort((e,t)=>{const s={cmd:1,ctrl:2,alt:3,shift:4},o=s[e]||5,i=s[t]||5;return o!==i?o-i:e.localeCompare(t)}).join(" ")}function be(d){let e=d.key.toLowerCase();if(e===" "&&(e="space"),e==="arrowleft"&&(e="left"),e==="arrowright"&&(e="right"),e==="arrowup"&&(e="up"),e==="arrowdown"&&(e="down"),e==="delete"&&d.code==="Delete"&&(e="delete"),e==="backspace"&&(e="backspace"),e==="escape"&&(e="esc"),e==="return"&&(e="enter"),d.code.startsWith("Numpad")){const s=d.code.replace("Numpad","").toLowerCase();s==="add"?e="num_add":s==="subtract"?e="num_subtract":s==="multiply"?e="num_multiply":s==="divide"?e="num_divide":s==="decimal"?e="num_decimal":s==="enter"?e="num_enter":e="num_"+s}d.code.match(/^F\d+$/)&&(e=d.code.toLowerCase()),d.code.match(/^Digit\d+$/)&&(e=d.code.replace(/Digit/g,""));let t="";return d.ctrlKey&&(t+=" ctrl"),d.altKey&&(t+=t+" alt"),d.shiftKey&&(t+=t+" shift"),d.metaKey&&(t+=t+" cmd"),mt(t+" "+e)}class bt{constructor(e){this.tableScope=e,this.shortcutActionIdMapping={},this.listener=[],this.listener.push(e),this.init()}addListener(e){this.listener.includes(e)||this.listener.push(e)}init(){var e,t;(t=(e=this.tableScope)==null?void 0:e.tableOptions)!=null&&t.shortcutActionsDisabled?this.isDebug()&&console.debug("ShortcutService skipped."):(this.assignPredefinedSystemShortcutMappings(),Object.assign(this.shortcutActionIdMapping,this.tableScope.tableOptions.shortcutActionIdMapping),this.isDebug()&&console.debug("ShortcutService",this.shortcutActionIdMapping),this.tableScope.hostElement.addEventListener("keydown",this.onKeyDown.bind(this)))}assignPredefinedSystemShortcutMappings(){this.isMacintosh()?Object.assign(this.shortcutActionIdMapping,new ft().get()):Object.assign(this.shortcutActionIdMapping,new gt().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=be(e);this.isDebug()&&console.debug("ShortcutService shortcut :",t);for(const s in this.shortcutActionIdMapping)if(be(e)===t)return this.isDebug()&&console.debug("ShortcutService action :",this.shortcutActionIdMapping[s]),this.shortcutActionIdMapping[s]}getShortcutActionMapping(){return this.shortcutActionIdMapping}}class oe{onCheckboxChanged(e){}onContextmenu(e){}onModelChanged(e){}onMouseClicked(e){}onMouseDragging(e){}onMouseDraggingEnd(e){}onMouseMoved(e){}onSelectionChanged(e){}onFocusChanged(e){}}class yt{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 wt{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=`
|
|
51
|
+
render scope: this.lastFullVisibleRowIndex <- `+this.lastFullVisibleRowIndex),this.colAndRowspanModels&&this.colAndRowspanModels[e]){const b=((g=this.colAndRowspanModels[e])==null?void 0:g.getRanges())??[];if(b.length)for(const w of b){let S=0,A=s.child,C="center";if(w.c1<m)A=o.child,C="west";else if(p>0&&w.c1>=f-p)A=i.child,C="east";else{const x=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();S=this.scrollFactorX*x-this.areaBodyWestGeo.width,C="center"}this.drawBigCell(w,S,t,d,A,C)}}}drawBigCell(e,t,o,s,i,r){const n=o+this.getRowHeights(0,e.r1-1,s).reduce((g,b)=>g+b,0),l=this.tableModel.getColumnCount(),a=this.tableModel.getFixedRightColumnCount();let d=0;a>0&&e.c1>=l-a&&(d=l-a);const h=t+this.getColumnWidths(d,e.c1-1).reduce((g,b)=>g+b,0),u=this.getRowHeights(e.r1,e.r2,s).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:s,areaIdent:s.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:h,top:n,width:f,height:u,parent:i,cellSelected:p,lastRowOfModel:!0,gammaRange:e.gammaRange}):this.renderCell({areaModel:s,areaIdent:s.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:h,top:n,width:f,height:u,parent:i,cellSelected:p,lastRowOfModel:!0,gammaRange:e.gammaRange}),s.areaIdent==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:e.r1,columnIndex:e.c1,cellLeft:h,cellTop:n,cellWidth:f,cellHeight:u,parent:i})}findRowOfImportantRowspanCell(e,t,o){const s=e.getMaxRowspan();for(let i=t-1;i>-1;i--){const r=e.getRowspanAt(i,o);if(r>1&&i+r+1>=t)return i;if(t-i>s)return-1}return-1}adjustColumnsToRowParent({areaIdent:e,sideIdent:t,areaModel:o,geo:s,parent:i,rowIndex:r,columnIndexStart:n,columnIndexEnd:l,verticalFixed:a=!1,lastRowOfModel:d=!1}){var m;this.scrollViewportLeft=this.scrollViewport.scrollLeft;let h=0;if(!a){const g=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();h=this.scrollFactorX*g}const u=0,f=!!(e==="body"&&t);let p=h;for(let g=n;g<=l;g++){const b=p,w=this.tableModel.getColumnWidth(g);if(w>0&&b+w>0){let S=s.height;const A=o.getRowspanAt(r,g),C=o.getColspanAt(r,g);A>1&&(S=this.getRowHeights(r,r+A-1,o).reduce((M,I)=>M+I,0));let x=w;C>1&&(x=this.getColumnWidths(g,g+C-1).reduce((M,I)=>M+I,0));let P=!1;if(this.colAndRowspanModels&&this.colAndRowspanModels[e]&&(m=this.colAndRowspanModels[e])!=null&&m.isInRange(r,g)&&(P=!0),this.draggingTargetColumnIndex===g&&e!=="header"){this.renderDragTargetDiv(i,b,u,x,S);const M={left:b,top:u,width:x,height:S};this.dom.addColumnBorderDivs(this.tableOptions,i,M,e,t)}else{const M=this.renderSelectedBackgroundDiv(P,f,t,o,r,g,i,b,u,x,S);"gammaCells"in o&&o.getValueAt(r,g)&&(P=!1),P||this.renderCell({areaModel:o,areaIdent:e,sideIdent:t,rowIndex:r,columnIndex:g,left:b,top:u,width:x,height:S,parent:i,cellSelected:M,lastRowOfModel:d,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:r,columnIndex:g,cellLeft:b,cellTop:u,cellWidth:x,cellHeight:S,parent:i})}}if(p=p+w,p>this.areaBodyCenterGeo.width)break}this.tableOptions.verticalBorderVisible&&this.dom.addVerticalBorder(new O(p-1,1,s.height,0),i)}getTreeArrowColumnIndex(){return this.tableOptions.showCheckboxWihoutExtraColumn?0:this.tableModel.isRowCheckboxVisible()?1:0}addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:o,rowIndex:s,index:i,left:r,width:n,height:l,top:a,parent:d,lastRowOfModel:h}){var Ne;const f=this.editorRenderer&&this.editorRendererRow===s&&this.editorRendererColumn===i?this.editorRenderer:e.getCellRenderer(s,i),p={left:r,width:n,height:l,top:a,index:i},m=e.getRowByIndex(s);let g="none";if(i===this.getTreeArrowColumnIndex()&&N(m)){const v=m;(Ne=v.children)!=null&&Ne.length?v.expanded?g="expanded":g="collapsed":g="hidden"}let w;if(t==="header"){const v=this.tableModel.getColumnDef(i);(!(v!=null&&v.sortIconVisible)||v!=null&&v.sortIconVisible())&&(w=v==null?void 0:v.sortState)}const S=e.getValueAt(s,i),A=f?"":`${S}`,C=e.isRowChecked(s),x=this.dom.addColumnDiv({parent:d,geo:p,rowIndex:s,columnIndex:i,areaIdent:t,sideIdent:o,text:A,treeArrow:g,tableOptions:this.tableOptions,checkedType:C,sortState:w}),P=e.getTooltipAt(s,i);P&&this.dom.setAttribute(x,"title",P);const M=this.tableModel.getColumnDef(i);M&&M.classes[t]&&this.dom.addClasses(M.classes[t],x);let I;f&&(I=f.render(x,s,i,t,e,S,this.dom.domService));const Z=e.getCustomClassesAt(s,i);if(Z.length&&this.dom.addClasses(Z,x),this.dom.addColumnBorderDivs(this.tableOptions,d,p,t,o),h&&this.dom.addHorizontalBorder({left:r,width:n,height:l,top:a+l},d),this.getFocusModel&&t==="body"){const v=this.getFocusModel();v!=null&&v.hasFocus(s,i)&&this.dom.addFocusBorderDivs(d,p,{})}t==="header"&&this.dom.setAttribute(x,"data-ge-action","drag-column");const fe=e.getCustomStyleAt(s,i);if(fe)for(const v in fe)this.dom.setStyle(x,v,fe[v]);return[x,I]}applyCssClasses(e,t={}){e&&Object.entries(t).forEach(([o,s])=>{s?this.dom.addClass(o,e):this.dom.removeClass(o,e)})}getColumnWidths(e,t){const o=[];for(let s=e;s<=t;s++)o.push(this.tableModel.getColumnWidth(s));return o}getRowHeights(e,t,o){const s=[];for(let i=e;i<=t;i++)s.push(o.getRowHeight(i));return s}adjustHoverRows(e){if(this.tableOptions.hoverRowVisible&&e.rowIndex>-1){const t=this.hostElement.clientWidth,o=this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex),s=e.rowTop+this.areaHeaderCenter.parent.clientHeight-this.scrollTop;this.dom.applyStyle(this.hoverRow,{left:"0",top:s+"px",width:t+"px",height:o+"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,o=this.tableModel.getColumnWidth(e.columnIndex),s=this.areaBodyWestGeo.width,i=e.columnLeft+this.tableModel.getPadding().left-this.scrollLeft-s;this.dom.applyStyle(this.hoverColumn,{left:i+"px",top:"0px",width:o+"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,o){var s,i;if(this.dragging){const r=this.hostElement.clientHeight,n=this.storedColumnWidths[t];if((s=e.originalEvent)!=null&&s.clientX){const d={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,d),o&&this.renderContentOfDraggingColumn(d)}}else this.hideDraggingColumn()}renderContentOfDraggingColumn(e){const t=this.renderContentOfDraggingColumnForArea(e,"header",0);this.renderContentOfDraggingColumnForArea(e,"body",t)}renderContentOfDraggingColumnForArea(e,t,o=0){const s="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 d=o,h=i.getRowHeight(a),u={left:0,width:e.width,height:h,top:d,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:s,text:m},b=this.dom.addColumnDiv(g);let w;p&&(w=p.render(b,a,n,t,i,f,this.dom.domService),w&&this.cleanupFunctions[t].push(w));const S=i.getCustomClassesAt(a,n);S.length&&this.dom.addClasses(S,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,s);const C=i.getCustomStyleAt(a,n);if(C)for(const x in C)this.dom.setStyle(b,x,C[x]);o=o+h}}return o}hideDraggingColumn(){this.dom.applyStyle(this.draggingColumn,{display:"none"})}renderDragTargetDiv(e,t,o,s,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",`${o}px`),this.dom.setStyle(r,"width",`${s}px`),this.dom.setStyle(r,"height",`${i}px`),r}renderSelectedBackgroundDiv(e,t,o,s,i,r,n,l,a,d,h){let u=!1;if(!e&&t&&s.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-${s.areaIdent}-${o}-selected-range`,n));this.dom.setStyle(g,"left",`${l}px`),this.dom.setStyle(g,"top",`${a}px`),this.dom.setStyle(g,"width",`${d}px`),this.dom.setStyle(g,"height",`${h}px`)}}}return u}renderCell({areaModel:e,areaIdent:t,sideIdent:o,rowIndex:s,columnIndex:i,left:r,top:n,width:l,height:a,parent:d,cellSelected:h,lastRowOfModel:u}){const[f,p]=this.addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:o,rowIndex:s,index:i,left:r,width:l,height:a,top:n,parent:d,lastRowOfModel:u});h&&this.dom.addClass(`ge-table-${t}-${o}-selected-range`,f),p&&this.cleanupFunctions[t].push(p)}renderHeaderCellResizeHandle({rowIndex:e,columnIndex:t,cellLeft:o,cellTop:s,cellWidth:i,cellHeight:r,parent:n}){const l=this.dom.domService,a=this.tableOptions.columnResizeHandleWidthInPx??2,d=l.createElement("div");l.setAttribute(d,"data-col-index",`${t}`),l.setAttribute(d,"data-row-index",`${e}`),l.setAttribute(d,"data-area","header"),l.setAttribute(d,"data-ge-action","resize-column"),l.addClass(d,"ge-table-column-resize-handle"),l.setStyle(d,"display","clip"),l.setStyle(d,"position","absolute"),l.setStyle(d,"cursor","col-resize"),l.setStyle(d,"left",`${o+i-a}px`),l.setStyle(d,"top",`${s}px`),l.setStyle(d,"width",`${a}px`),l.setStyle(d,"height",`${r}px`),l.appendChild(n,d)}}class ct{constructor(e,t){this.columnIndex=e,this.sortState=t}}class ht{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,o=t.getAttribute("data-area"),s=t.getAttribute("data-row-index"),i=t.getAttribute("data-col-index");if(o&&s&&i){const r=q(o),n=Number(s),l=Number(i);this.tableScope.updateModelValueAfterEdit(r,n,l,t.value)}}}}class ut{constructor(e=-1,t=-1){this.rowIndex=e,this.columnIndex=t}}class pe{constructor(e){this.cells=e}static createSingle(e,t){return new pe([new ut(e,t)])}}class pt{constructor(e){var t,o;this.tableScope=e,(t=this.tableScope.tableOptions)!=null&&t.getSelectionModel&&(this.getSelectionModel=this.tableScope.tableOptions.getSelectionModel),(o=this.tableScope.tableOptions)!=null&&o.getFocusModel&&(this.getFocusModel=this.tableScope.tableOptions.getFocusModel)}onMouseClicked(e,t){var i,r,n,l,a,d,h;let o=!1,s=!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),o=!0),(i=e.originalEvent)!=null&&i.shiftKey||u.hasSelection()&&(u.clear(),o=!0),(r=e.originalEvent)!=null&&r.shiftKey&&this.previousEvt?(u.addSelection(this.createRangeByEvents(e,this.previousEvt)),s=!0,o=!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)),s=!0,o=!0):(d=e.originalEvent)!=null&&d.ctrlKey||(h=e.originalEvent)!=null&&h.metaKey?(u.addSelection(R.singleCell(e.rowIndex,e.columnIndex)),s=!0,o=!0):(u.firstClick(e.rowIndex,e.columnIndex),o=!0),this.tableScope.onSelectionChanged(u))}return s?this.previousEvt=void 0:this.previousEvt=e==null?void 0:e.clone(),o}onActionTriggered(e){if(this.getSelectionModel&&this.getFocusModel){const t=this.getSelectionModel(),o=this.getFocusModel();if(t&&o){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[s,i]=o.getFocus();return t.togglePoint(s,i),this.tableScope.repaint(),!0}}}return!1}createRangeByEvents(e,t){t||(t=e);const o=Math.min(e.rowIndex,t==null?void 0:t.rowIndex),s=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:o,columnIndex1:i,rowIndex2:s,columnIndex2:r})}}class gt{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 ft{get(){return{f2:"START_EDITING",space:"TOGGLE_SELECTION","ctrl+num_add":"SELECT_ALL","meta+a":"SELECT_ALL","ctrl+a":"SELECT_ALL","meta+x":"DESELECT_ALL","meta+shift+a":"DESELECT_ALL","ctrl+shift+a":"DESELECT_ALL","ctrl+num_subtract":"DESELECT_ALL","ctrl -":"DESELECT_ALL",arrowup:"NAVIGATE_UP",arrowdown:"NAVIGATE_DOWN",arrowleft:"NAVIGATE_LEFT",arrowright:"NAVIGATE_RIGHT","meta+c":"COPY_2_CLIPBOARD","ctrl+c":"COPY_2_CLIPBOARD"}}}function mt(c){return c.trim().replace(/\+/g," ").replace(/ +/g," ").replace(/⌫/g,"backspace").replace(/↩/g,"enter").replace(/⇧/g,"shift").replace(/⌥/g,"alt").replace(/option/g,"alt").replace(/opt/g,"alt").replace(/⌃/g,"ctrl").replace(/control/g,"ctrl").replace(/command/g,"cmd").replace(/meta/g,"cmd").replace(/escape/g,"esc").replace(/⌘/g,"cmd").replace(/\*/g,"multiply").split(" ").filter(e=>e).filter((e,t,o)=>o.indexOf(e)===t).sort((e,t)=>{const o={cmd:1,ctrl:2,alt:3,shift:4},s=o[e]||5,i=o[t]||5;return s!==i?s-i:e.localeCompare(t)}).join(" ")}function ye(c){let e=c.key.toLowerCase();if(e===" "&&(e="space"),e==="arrowleft"&&(e="left"),e==="arrowright"&&(e="right"),e==="arrowup"&&(e="up"),e==="arrowdown"&&(e="down"),e==="delete"&&c.code==="Delete"&&(e="delete"),e==="backspace"&&(e="backspace"),e==="escape"&&(e="esc"),e==="return"&&(e="enter"),c.code.startsWith("Numpad")){const o=c.code.replace("Numpad","").toLowerCase();o==="add"?e="num_add":o==="subtract"?e="num_subtract":o==="multiply"?e="num_multiply":o==="divide"?e="num_divide":o==="decimal"?e="num_decimal":o==="enter"?e="num_enter":e="num_"+o}c.code.match(/^F\d+$/)&&(e=c.code.toLowerCase()),c.code.match(/^Digit\d+$/)&&(e=c.code.replace(/Digit/g,""));let t="";return c.ctrlKey&&(t+=" ctrl"),c.altKey&&(t+=t+" alt"),c.shiftKey&&(t+=t+" shift"),c.metaKey&&(t+=t+" cmd"),mt(t+" "+e)}class bt{constructor(e){this.tableScope=e,this.shortcutActionIdMapping={},this.listener=[],this.listener.push(e),this.init()}addListener(e){this.listener.includes(e)||this.listener.push(e)}init(){var e,t;(t=(e=this.tableScope)==null?void 0:e.tableOptions)!=null&&t.shortcutActionsDisabled?this.isDebug()&&console.debug("ShortcutService skipped."):(this.assignPredefinedSystemShortcutMappings(),Object.assign(this.shortcutActionIdMapping,this.tableScope.tableOptions.shortcutActionIdMapping),this.isDebug()&&console.debug("ShortcutService",this.shortcutActionIdMapping),this.tableScope.hostElement.addEventListener("keydown",this.onKeyDown.bind(this)))}assignPredefinedSystemShortcutMappings(){this.isMacintosh()?Object.assign(this.shortcutActionIdMapping,new ft().get()):Object.assign(this.shortcutActionIdMapping,new gt().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 o of this.listener)o.onActionTriggered(e)&&(t=!0);return t}findEntity(e){const t=ye(e);this.isDebug()&&console.debug("ShortcutService shortcut :",t);for(const o in this.shortcutActionIdMapping)if(ye(e)===t)return this.isDebug()&&console.debug("ShortcutService action :",this.shortcutActionIdMapping[o]),this.shortcutActionIdMapping[o]}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 yt{setStyle(e,t,o){return e.style[t]=o,e}appendText(e,t){const o=this.createText(t);return this.appendChild(e,o),o}addClass(e,t){return t.includes(" ")?t.split(" ").forEach(o=>e.classList.add(o)):e.classList.add(t),e}removeClass(e,t){return t.includes(" ")?t.split(" ").forEach(o=>e.classList.remove(o)):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,o){e.setAttribute(t,o)}}class wt{render(e,t,o,s,i,r,n){if(i.isEditable(t,o)){n.addClass(e,"ge-table-row-input-div");const l=i.getValueAt(t,o);e.innerHTML=`
|
|
52
52
|
<input
|
|
53
53
|
type="text"
|
|
54
54
|
value="${l}"
|
|
55
55
|
autofocus
|
|
56
56
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
57
57
|
data-listen="change"
|
|
58
|
-
data-area="${
|
|
58
|
+
data-area="${s}"
|
|
59
59
|
data-row-index="${t}"
|
|
60
|
-
data-col-index="${
|
|
60
|
+
data-col-index="${o}"
|
|
61
61
|
data-input-type="text"
|
|
62
62
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
63
|
-
class="ge-table-cell-editor-input">`}}}class
|
|
64
|
-
`;let J=z;class St{constructor(e,t=500){this.tableScope=e,this.debounceDelay=t,new ResizeObserver(
|
|
65
|
-
<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>`,
|
|
63
|
+
class="ge-table-cell-editor-input">`}}}class ge{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 o=0;for(const s of this.ranges)s.isInRange(e,t)&&o++;return this.allSelected&&o++,this.isInNegativeRange(e,t)&&(o=0),o}isInNegativeRange(e,t){for(const o of this.negativeRanges)if(o.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 o=t.r1;o<=t.r2;o++)!e.has(o)&&!this.isInNegativeRange(o,0)&&e.add(o);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 xt{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 Ve{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 Gt=new ge,zt=new xt("cell");class X{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 _e,this.headerGroupOptions=new Ve,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new Oe,this.sortOrder=["asc","desc"],this.shortcutActionsDisabled=!1,this.resizeEventDebounceDelay=500,this.getEditRenderer=(e,t)=>new wt,this.getSelectionModel=()=>Gt,this.getFocusModel=()=>zt}}const z=class z{createContent(e,t,o){return new Promise((s,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 d=r.c1;d<=r.c2;d++){const h=t.isSelected(l,d)?e.getBodyModel().getTextValueAt(l,d):"";a.push(h)}n.push(a.join(z.columnSeparatorChar))}return s(n.join(z.rowSeparatorChar))}}if(o){const[r,n]=o.getFocus(),l=e.getBodyModel().getTextValueAt(r,n);return s(l)}i("Cannot copy, neither selection nor focus defined.")})}copyContent(e){return navigator.clipboard.writeText(e)}copyToClipboard(e,t,o){return new Promise((s,i)=>{this.createContent(e,t,o).then(r=>{r&&this.copyContent(r).then(n=>{s(r)}).catch(n=>{i()})}).catch(r=>{i()})})}mergeRanges(e){let t;for(const o of e)t?(t.r1=Math.min(t.r1,o.r1),t.c1=Math.min(t.c1,o.c1),t.r2=Math.max(t.r2,o.r2),t.c2=Math.max(t.c2,o.c2)):t=new R(o.r1,o.c1,o.r2,o.c2);return t}};z.columnSeparatorChar=" ",z.rowSeparatorChar=`
|
|
64
|
+
`;let J=z;class St{constructor(e,t=500){this.tableScope=e,this.debounceDelay=t,new ResizeObserver(Ge(this.handleResize.bind(this),t)).observe(this.tableScope.hostElement)}handleResize(e){const t=e[0],{width:o}=t.contentRect;this.tableScope.recalcColumnWidths(o)}}class Ct{downloadExcel(e,t="file.xlsx",o=""){if(!Array.isArray(e)||e.some(s=>!Array.isArray(s)))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 s=this.generateBuffer(e,o),i=new Blob([s],{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(s){throw console.error("Error generating Excel file:",s),new Error("Failed to download Excel file.")}}generateMap(e,t=""){const o=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
65
|
+
<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>`,s=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
66
66
|
<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"?>
|
|
67
67
|
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>${t}</dc:creator><cp:lastModifiedBy>${t}</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">2024-12-13T19:45:08Z</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">2024-12-13T19:45:35Z</dcterms:modified></cp:coreProperties>`,r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
68
68
|
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/></Relationships>`,n=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
69
69
|
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="0E2841"/></a:dk2><a:lt2><a:srgbClr val="E8E8E8"/></a:lt2><a:accent1><a:srgbClr val="156082"/></a:accent1><a:accent2><a:srgbClr val="E97132"/></a:accent2><a:accent3><a:srgbClr val="196B24"/></a:accent3><a:accent4><a:srgbClr val="0F9ED5"/></a:accent4><a:accent5><a:srgbClr val="A02B93"/></a:accent5><a:accent6><a:srgbClr val="4EA72E"/></a:accent6><a:hlink><a:srgbClr val="467886"/></a:hlink><a:folHlink><a:srgbClr val="96607D"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Aptos Display" panose="02110004020202020204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック Light"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线 Light"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/><a:font script="Armn" typeface="Arial"/><a:font script="Bugi" typeface="Leelawadee UI"/><a:font script="Bopo" typeface="Microsoft JhengHei"/><a:font script="Java" typeface="Javanese Text"/><a:font script="Lisu" typeface="Segoe UI"/><a:font script="Mymr" typeface="Myanmar Text"/><a:font script="Nkoo" typeface="Ebrima"/><a:font script="Olck" typeface="Nirmala UI"/><a:font script="Osma" typeface="Ebrima"/><a:font script="Phag" typeface="Phagspa"/><a:font script="Syrn" typeface="Estrangelo Edessa"/><a:font script="Syrj" typeface="Estrangelo Edessa"/><a:font script="Syre" typeface="Estrangelo Edessa"/><a:font script="Sora" typeface="Nirmala UI"/><a:font script="Tale" typeface="Microsoft Tai Le"/><a:font script="Talu" typeface="Microsoft New Tai Lue"/><a:font script="Tfng" typeface="Ebrima"/></a:majorFont><a:minorFont><a:latin typeface="Aptos Narrow" panose="02110004020202020204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="DaunPenh"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/><a:font script="Armn" typeface="Arial"/><a:font script="Bugi" typeface="Leelawadee UI"/><a:font script="Bopo" typeface="Microsoft JhengHei"/><a:font script="Java" typeface="Javanese Text"/><a:font script="Lisu" typeface="Segoe UI"/><a:font script="Mymr" typeface="Myanmar Text"/><a:font script="Nkoo" typeface="Ebrima"/><a:font script="Olck" typeface="Nirmala UI"/><a:font script="Osma" typeface="Ebrima"/><a:font script="Phag" typeface="Phagspa"/><a:font script="Syrn" typeface="Estrangelo Edessa"/><a:font script="Syrj" typeface="Estrangelo Edessa"/><a:font script="Syre" typeface="Estrangelo Edessa"/><a:font script="Sora" typeface="Nirmala UI"/><a:font script="Tale" typeface="Microsoft Tai Le"/><a:font script="Talu" typeface="Microsoft New Tai Lue"/><a:font script="Tfng" typeface="Ebrima"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000"/><a:lumMod val="100000"/><a:shade val="100000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="63000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:lnDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst/><a:extLst><a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}"><thm15:themeFamily xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="Office Theme" id="{2E142A2C-CD16-42D6-873A-C26D2A0506FA}" vid="{1BDDFF52-6CD6-40A5-AB3C-68EB2F1E4D0A}"/></a:ext></a:extLst></a:theme>`,l=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
70
70
|
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="3" uniqueCount="3"><si><t>a</t></si><si><t>b</t></si><si><t>c</t></si></sst>`,a=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
71
|
-
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac x16r2 xr" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision"><fonts count="1" x14ac:knownFonts="1"><font><sz val="12"/><color theme="1"/><name val="Aptos Narrow"/><family val="2"/><scheme val="minor"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0"/><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/><extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1"/></ext><ext uri="{9260A510-F301-46a8-8635-F512D64BE5F5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:timelineStyles defaultTimelineStyle="TimeSlicerStyleLight1"/></ext></extLst></styleSheet>`,
|
|
71
|
+
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac x16r2 xr" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision"><fonts count="1" x14ac:knownFonts="1"><font><sz val="12"/><color theme="1"/><name val="Aptos Narrow"/><family val="2"/><scheme val="minor"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0"/><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/><extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1"/></ext><ext uri="{9260A510-F301-46a8-8635-F512D64BE5F5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:timelineStyles defaultTimelineStyle="TimeSlicerStyleLight1"/></ext></extLst></styleSheet>`,d=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
72
72
|
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x15 xr xr6 xr10 xr2" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr6="http://schemas.microsoft.com/office/spreadsheetml/2016/revision6" xmlns:xr10="http://schemas.microsoft.com/office/spreadsheetml/2016/revision10" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"><fileVersion appName="xl" lastEdited="7" lowestEdited="7" rupBuild="11207"/><workbookPr defaultThemeVersion="202300"/><mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice Requires="x15"><x15ac:absPath url="/" xmlns:x15ac="http://schemas.microsoft.com/office/spreadsheetml/2010/11/ac"/></mc:Choice></mc:AlternateContent><xr:revisionPtr revIDLastSave="0" documentId="8_{292BF245-1F37-B045-B1A5-26C42FB62779}" xr6:coauthVersionLast="47" xr6:coauthVersionMax="47" xr10:uidLastSave="{00000000-0000-0000-0000-000000000000}"/><bookViews><workbookView xWindow="11340" yWindow="5060" windowWidth="28040" windowHeight="17440" xr2:uid="{858B8D3F-6246-774D-8903-6D38687B7BC6}"/></bookViews><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets><calcPr calcId="181029"/><extLst><ext uri="{140A7094-0E35-4892-8432-C4D2E57EDEB5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:workbookPr chartTrackingRefBase="1"/></ext><ext uri="{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}" xmlns:xcalcf="http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures"><xcalcf:calcFeatures><xcalcf:feature name="microsoft.com:RD"/><xcalcf:feature name="microsoft.com:Single"/><xcalcf:feature name="microsoft.com:FV"/><xcalcf:feature name="microsoft.com:CNMTM"/><xcalcf:feature name="microsoft.com:LET_WF"/><xcalcf:feature name="microsoft.com:LAMBDA_WF"/><xcalcf:feature name="microsoft.com:ARRAYTEXT_WF"/></xcalcf:calcFeatures></ext></extLst></workbook>`,h=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
73
|
-
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>`,u=new Map;return u.set("_rels/.rels",
|
|
73
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>`,u=new Map;return u.set("_rels/.rels",o),u.set("docProps/app.xml",s),u.set("docProps/core.xml",i),u.set("xl/_rels/workbook.xml.rels",r),u.set("xl/theme/theme1.xml",n),u.set("xl/worksheets/sheet1.xml",this.getX1WorksheetsSheet1Xml(e)),u.set("xl/sharedStrings.xml",l),u.set("xl/styles.xml",a),u.set("xl/workbook.xml",d),u.set("[Content_Types].xml",h),u}getX1WorksheetsSheet1Xml(e){const t=[];t.push(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
74
74
|
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac xr xr2 xr3" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2" xmlns:xr3="http://schemas.microsoft.com/office/spreadsheetml/2016/revision3" xr:uid="{E15F8FC4-4D40-434C-921A-3D9CFAAA2865}">
|
|
75
75
|
<dimension ref="A1:B3"/>
|
|
76
76
|
<sheetViews>
|
|
77
77
|
<sheetView tabSelected="1" workbookViewId="0"/></sheetViews>
|
|
78
78
|
<sheetFormatPr baseColWidth="10" defaultRowHeight="16" x14ac:dyDescent="0.2"/>
|
|
79
|
-
<sheetData>`);for(let
|
|
80
|
-
`)}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((h,u)=>{const f=new TextEncoder().encode(u),p=new TextEncoder().encode(h),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(h=>{const u=new TextEncoder().encode(h.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,h.contentSize,!0),p.setUint32(24,h.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,h.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((h,u)=>h+u.length,0),a=new Uint8Array(l);let c=0;for(const h of t)a.set(h,c),c+=h.length;return a}generateBuffer(e,t=""){const s=this.generateMap(e,t);return this.createZip(s)}}class Ve extends ct{constructor(e,t,s,o,i,r=new J,n=new Ct){var c;if(super(e,t,new Ze(s),o),this.eventListener=i,this.copyService=r,this.excelService=n,this.licenseManager=W.getInstance(),this.selectionService=new pt(this),this.api=new st(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.lastDragFrom=-1,this.lastDragTo=-1,this.firstDraggingRendering=!0,this.lastContextmenu=Date.now(),t.setTableScope(this),i||(this.eventListener=new oe),(c=this.tableOptions)!=null&&c.autoRestoreOptions){const h=this.tableOptions.autoRestoreOptions,u=h.getStorageKeyFn;u&&(h.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new ot(u)),h.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new rt(u)),h.autoRestoreSortingState&&(this.storeSortingService=new nt(u)))}this.mouseHandler=new et(this),this.inputHandler=new ht(this),this.resizeHandler=new St(this,o.resizeEventDebounceDelay),this.shortcutService=new bt(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 X,o=new oe,i=new yt,r=new J){return new Ve(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(ue.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 de;if(t.originalEvent=e,e){const s=e.target;if([t.areaIdent,t.sideIdent]=this.getAreaAndSideIdentByAttr(s),t.rowIndex=this.getNumberByAttr(s,"data-row-index"),t.columnIndex=this.getNumberByAttr(s,"data-col-index"),t.action=this.getStringByAttr(s,"data-ge-action"),t.areaIdent){const o=this.tableModel.getAreaModel(t.areaIdent);t.rowTop=o.getYPosByRowIndex(t.rowIndex)}if(t.columnLeft=this.tableModel.getXPosByColumnIndex(t.columnIndex),e.ctrlKey&&e.altKey){const o=e.clientY-this.hostElement.offsetTop-this.areaHeaderCenter.parent.clientHeight,i=e.clientX-this.hostElement.offsetLeft-this.areaBodyWestGeo.width;this.debugOnce(i,o)}}return t}onMouseDown(e){e.columnIndex>-1&&e.action&&["resize-column","drag-column"].includes(e.action)&&(this.mouseStartWidth=this.tableModel.getColumnWidth(e.columnIndex),this.mouseStartAction=e.action,this.mouseStartColumnIndex=e.columnIndex,this.mouseStartAction==="drag-column"&&(this.firstDraggingRendering=!0,this.dragFrom=this.mouseStartColumnIndex))}mouseDraggingOnFrame(e,t){this.eventListener.onMouseDragging(e),this.mouseEvent=e,this.mouseStartColumnIndex>-1&&this.mouseStartAction==="resize-column"&&this.tableOptions.columnsResizable?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&e.columnIndex>-1&&this.tableOptions.columnsDraggable&&(this.draggingTargetColumnIndex=e.columnIndex,this.dragTo=this.draggingTargetColumnIndex,this.dragFrom>-1&&this.dragTo>-1&&this.dragFrom!==this.dragTo&&(this.lastDragFrom===this.dragTo&&this.lastDragTo===this.dragFrom||(this.tableModel.changeColumnOrder(this.dragFrom,this.dragTo),this.lastDragFrom=this.dragFrom,this.lastDragTo=this.dragTo,this.dragFrom=this.dragTo,this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows())),t&&(this.adjustDraggingColumn(e,t.columnIndex,this.firstDraggingRendering),this.firstDraggingRendering=!1),this.repaint())}mouseDraggingEndOnFrame(e){this.eventListener.onMouseDraggingEnd(e),this.draggingTargetColumnIndex=-1,this.mouseStartAction==="resize-column"?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&(this.hideDraggingColumn(),this.repaint()),this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.firstDraggingRendering=!0,this.mouseStartAction=""}mouseMove(e){this.eventListener.onMouseMoved(e),this.adjustHoverRows(e),this.adjustHoverColumns(e)}contextmenu(e){var s,o;const t=Date.now();if(t-this.lastContextmenu<50){this.lastContextmenu=t,(s=e.originalEvent)==null||s.preventDefault(),(o=e.originalEvent)==null||o.stopImmediatePropagation();return}this.lastContextmenu=t,this.eventListener.onContextmenu(e)}toggleExpandCollapseAll(e=!0){var s;const t=this.tableModel.getBodyModel();se(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 dt(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(se(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 h=o(c.data);i.mode==="expanded"?c.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h):i.mode==="collapsed"&&(c.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h))}}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()}reSort(){var t;let e=((t=this.storeSortingService)==null?void 0:t.getSortItems())??[];this.tableModel.doSort(e)}sort(e){this.tableModel.sort(e)}ensureRowIsVisible(e){const t=this.getFirstFullVisibleRowIndex(),s=this.getLastFullVisibleRowIndex(),o=this.getDisplayedRowCount();return e<t?(this.scrollToIndex(0,e),!0):e>s?(this.scrollToIndex(0,e-o+1),!0):!1}}class Gt extends oe{constructor(e){super(),this.onCheckboxChangedCallback=e,super.onCheckboxChanged=t=>{this.onCheckboxChangedCallback(t)}}}const ne=class ne{};ne.themes=["light","combat","paper","blackboard"],ne.vars={light:`html[data-theme="light"] {
|
|
79
|
+
<sheetData>`);for(let o=0;o<e.length;o++){const s=e[o];t.push('<row r="${r + 1}" spans="1:2" x14ac:dyDescent="0.2">');for(let i=0;i<s.length;i++){const r=s[i],n=this.getCellAddress(o,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(`
|
|
80
|
+
`)}escapeXml(e){return e==null?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}getCellAddress(e,t){const o="ABCDEFGHIJKLMNOPQRSTUVWXYZ";let s="";for(;t>=0;)s=o[t%26]+s,t=Math.floor(t/26)-1;return`${s}${e+1}`}createZip(e){const t=[];let o=0;const s=[];e.forEach((h,u)=>{const f=new TextEncoder().encode(u),p=new TextEncoder().encode(h),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),s.push({path:u,offset:o,contentSize:p.length}),o+=m.length+p.length});const i=o;s.forEach(h=>{const u=new TextEncoder().encode(h.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,h.contentSize,!0),p.setUint32(24,h.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,h.offset,!0),f.set(u,46),t.push(f),o+=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,s.length,!0),n.setUint16(10,s.length,!0),n.setUint32(12,o-i,!0),n.setUint32(16,i,!0),n.setUint16(20,0,!0),t.push(r);const l=t.reduce((h,u)=>h+u.length,0),a=new Uint8Array(l);let d=0;for(const h of t)a.set(h,d),d+=h.length;return a}generateBuffer(e,t=""){const o=this.generateMap(e,t);return this.createZip(o)}}class Be extends dt{constructor(e,t,o,s,i,r=new J,n=new Ct){var d;if(super(e,t,new Qe(o),s),this.eventListener=i,this.copyService=r,this.excelService=n,this.licenseManager=W.getInstance(),this.selectionService=new pt(this),this.api=new ot(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.lastDragFrom=-1,this.lastDragTo=-1,this.firstDraggingRendering=!0,this.lastContextmenu=Date.now(),t.setTableScope(this),i||(this.eventListener=new se),(d=this.tableOptions)!=null&&d.autoRestoreOptions){const h=this.tableOptions.autoRestoreOptions,u=h.getStorageKeyFn;u&&(h.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new st(u)),h.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new rt(u)),h.autoRestoreSortingState&&(this.storeSortingService=new nt(u)))}this.mouseHandler=new tt(this),this.inputHandler=new ht(this),this.resizeHandler=new St(this,s.resizeEventDebounceDelay),this.shortcutService=new bt(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,o=new X,s=new se,i=new yt,r=new J){return new Be(e,t,i,o,s,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[o,s]=t.getFocus();this.tableModel.getBodyModel().isEditable(o,s)&&(this.clearSelection(),this.initRenderEditor(o,s))}return!0}if(e==="COPY_2_CLIPBOARD"){const t=this.getSelectionModel?this.getSelectionModel():void 0,o=this.getFocusModel?this.getFocusModel():void 0;this.copyService.createContent(this.tableModel,t,o).then(s=>this.copyService.copyContent(s))}return!1}updateModelValueAfterEdit(e,t,o,s){e==="body"&&this.tableModel.getAreaModel(e).setValue(t,o,s)&&(this.resetEditorRenderer(),this.repaint(),this.eventListener.onModelChanged(pe.createSingle(t,o)),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 he;if(t.originalEvent=e,e){const o=e.target;if([t.areaIdent,t.sideIdent]=this.getAreaAndSideIdentByAttr(o),t.rowIndex=this.getNumberByAttr(o,"data-row-index"),t.columnIndex=this.getNumberByAttr(o,"data-col-index"),t.action=this.getStringByAttr(o,"data-ge-action"),t.areaIdent){const s=this.tableModel.getAreaModel(t.areaIdent);t.rowTop=s.getYPosByRowIndex(t.rowIndex)}if(t.columnLeft=this.tableModel.getXPosByColumnIndex(t.columnIndex),e.ctrlKey&&e.altKey){const s=e.clientY-this.hostElement.offsetTop-this.areaHeaderCenter.parent.clientHeight,i=e.clientX-this.hostElement.offsetLeft-this.areaBodyWestGeo.width;this.debugOnce(i,s)}}return t}onMouseDown(e){e.columnIndex>-1&&e.action&&["resize-column","drag-column"].includes(e.action)&&(this.mouseStartWidth=this.tableModel.getColumnWidth(e.columnIndex),this.mouseStartAction=e.action,this.mouseStartColumnIndex=e.columnIndex,this.mouseStartAction==="drag-column"&&(this.firstDraggingRendering=!0,this.dragFrom=this.mouseStartColumnIndex))}mouseDraggingOnFrame(e,t){this.eventListener.onMouseDragging(e),this.mouseEvent=e,this.mouseStartColumnIndex>-1&&this.mouseStartAction==="resize-column"&&this.tableOptions.columnsResizable?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&e.columnIndex>-1&&this.tableOptions.columnsDraggable&&(this.draggingTargetColumnIndex=e.columnIndex,this.dragTo=this.draggingTargetColumnIndex,this.dragFrom>-1&&this.dragTo>-1&&this.dragFrom!==this.dragTo&&(this.lastDragFrom===this.dragTo&&this.lastDragTo===this.dragFrom||(this.tableModel.changeColumnOrder(this.dragFrom,this.dragTo),this.lastDragFrom=this.dragFrom,this.lastDragTo=this.dragTo,this.dragFrom=this.dragTo,this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows())),t&&(this.adjustDraggingColumn(e,t.columnIndex,this.firstDraggingRendering),this.firstDraggingRendering=!1),this.repaint())}mouseDraggingEndOnFrame(e){this.eventListener.onMouseDraggingEnd(e),this.draggingTargetColumnIndex=-1,this.mouseStartAction==="resize-column"?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&(this.hideDraggingColumn(),this.repaint()),this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.firstDraggingRendering=!0,this.mouseStartAction=""}mouseMove(e){this.eventListener.onMouseMoved(e),this.adjustHoverRows(e),this.adjustHoverColumns(e)}contextmenu(e){var o,s;const t=Date.now();if(t-this.lastContextmenu<50){this.lastContextmenu=t,(o=e.originalEvent)==null||o.preventDefault(),(s=e.originalEvent)==null||s.stopImmediatePropagation();return}this.lastContextmenu=t,this.eventListener.onContextmenu(e)}toggleExpandCollapseAll(e=!0){var o;const t=this.tableModel.getBodyModel();oe(t)&&(t.toggleExpandCollapseAll(e),this.repaint(),(o=this.storeStateCollapsedExpandService)==null||o.collapsedStateAll(e))}toggleRowCheckbox(e,t,o){var l;const s=this.tableModel.getAreaModel(o),i=s.isRowChecked(e),r=i===void 0||i==="semi"||i==="none";s.setRowChecked(e,r),this.repaint();const n=(l=s.rowSelectionModel)==null?void 0:l.getCheckedRows();this.eventListener.onCheckboxChanged(n||[])}onMouseClicked(e,t){let o=this.selectionService.onMouseClicked(e,t);if(!o&&this.getFocusModel){this.resetEditorRenderer();const s=this.getFocusModel();s&&(o=s.hasChanged(),s.clearChanged())}return o}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,o){var i,r;const s=this.tableModel.getColumnDef(o);if(s!=null&&s.sortable&&s.sortable()){e.preventDefault(),e.stopPropagation();const n=s.sortStatesOrder?s.sortStatesOrder:this.tableOptions.sortOrder,l=s.sortState??"",a=n[(n.indexOf(l)+1)%n.length],d=new ct(o,a);this.tableModel.doSort([d])&&((i=this.tableModel.getColumnDefs())==null||i.forEach(u=>u.sortState=""),s.sortState=a),this.repaint(),(r=this.storeSortingService)==null||r.setSortItems([d])}}scrollToPixel(e,t){this.scrollViewport.scrollTo(e,t)}scrollToIndex(e,t){const s=this.tableModel.getAreaModel("body").getYPosByRowIndex(t);this.scrollToPixel(0,s)}setSelectionModel(e,t=!1){const o=()=>e;this.tableOptions.getSelectionModel=o,this.getSelectionModel=o,this.selectionService.getSelectionModel=o,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 o=this.getFocusModel();if(o){const[s,i]=o.getFocus();return o.setFocus(s+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 o;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",(o=this.mouseHandler.mouseEvent)==null?void 0:o.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 o=this.storeScrollPosStateService.getScrollOffset();o&&this.scrollViewport.scrollTo(...o)}}autoRestoreSortingState(){var e,t;if((t=(e=this.tableOptions)==null?void 0:e.autoRestoreOptions)!=null&&t.autoRestoreSortingState&&this.storeSortingService){const o=this.storeSortingService.getSortItems();o!=null&&o.length&&this.tableModel.getBodyModel().doSort(o)}}autoRestoreCollapsedExpandedState(){var e,t;if((t=(e=this.tableOptions)==null?void 0:e.autoRestoreOptions)!=null&&t.getRowId&&this.storeStateCollapsedExpandService){const o=this.tableOptions.autoRestoreOptions,s=o.getRowId;if(o.autoRestoreCollapsedExpandedState&&s){const i=this.storeStateCollapsedExpandService.collapsedExpandedStateGet(),r=this.tableModel.getAreaModel("body");if(oe(r)){const n=r,l=r.getRowCount();for(let a=0;a<l;a++){const d=r.getRowByIndex(a);if(d)if(i.allExpanded)d.expanded=!0;else if(i.allCollapsed)d.expanded=!1;else{const h=s(d.data);i.mode==="expanded"?d.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h):i.mode==="collapsed"&&(d.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h))}}n.recalcVisibleTreeRows()}}}}calcAutoColumnWidths(){const e=this.tableModel.getBodyModel(),t=this.tableModel.getColumnCount(),o=(e==null?void 0:e.getRowCount())??0;if(!e)return console.warn("Body model is not available."),[];const s=new Array(t).fill(0);for(let i=0;i<o;i++)for(let r=0;r<t;r++){const n=e.getValueAt(i,r),l=(n==null?void 0:n.toString().length)||0;l>s[r]&&(s[r]=l)}return s.map(i=>Math.max(i*10,50))}setColumnWidth(e,t){this.tableModel.setColumnWidth(e,t)}autoResizeColumns(e=!0){const t=this.calcAutoColumnWidths();for(let o=0;o<t.length;o++){const s=t[o];this.tableModel.setColumnWidth(o,s)}e&&this.recalcWrappers()}recalcWrappers(){this.tableModel.recalcPadding(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows()}reSort(){var t;let e=((t=this.storeSortingService)==null?void 0:t.getSortItems())??[];this.tableModel.doSort(e)}sort(e){this.tableModel.sort(e)}ensureRowIsVisible(e){const t=this.getFirstFullVisibleRowIndex(),o=this.getLastFullVisibleRowIndex(),s=this.getDisplayedRowCount();return e<t?(this.scrollToIndex(0,e),!0):e>o?(this.scrollToIndex(0,e-s+1),!0):!1}}class jt extends se{constructor(e){super(),this.onCheckboxChangedCallback=e,super.onCheckboxChanged=t=>{this.onCheckboxChangedCallback(t)}}}const le=class le{};le.themes=["light","combat","paper","blackboard"],le.vars={light:`html[data-theme="light"] {
|
|
81
81
|
--ge-table-bg: rgba(255,255,255, 0.5);
|
|
82
82
|
--ge-table-header-west-bg: rgba(233, 233, 233, 0.5);
|
|
83
83
|
--ge-table-header-center-bg: rgba(233, 233, 233, 0.5);
|
|
@@ -305,133 +305,133 @@ render scope: this.lastFullVisibleRowIndex <- `+this.lastFullVisibleRowIndex),th
|
|
|
305
305
|
--ge-table-column-resize-handle-border: oklch(0% 0 0);
|
|
306
306
|
--ge-table-dragged-col-div-bg: #2c2e33;
|
|
307
307
|
--ge-table-drop-zone-bg: #758129;
|
|
308
|
-
}`};let ye=ne;class we{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 ie{static buildTreeRows(e,t="children",s=12){const o=[];for(const i of e)o.push(ie.buildTreeRow(i,t,void 0,0,s));return o}static buildTreeRow(e,t="children",s=new we(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 we(l,!0,[],s,o+1);if((n=s.children)==null||n.push(a),ie.buildTreeRow(l,t,a,o+1),o>i)return console.warn("Max deep limit reached: ",o),s}return s}}class G{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 vt=()=>!0,xe=()=>!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,h,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=h,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??xe,i=e.editable??e.editable??xe,r=e.isVisible??e.isVisible??vt;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 zt=new y(500,"px"),jt=new y(400,"px"),Rt=new y(300,"px"),Yt=new y(290,"px"),Ut=new y(280,"px"),Kt=new y(270,"px"),Xt=new y(260,"px"),Jt=new y(250,"px"),qt=new y(240,"px"),Zt=new y(230,"px"),Qt=new y(220,"px"),es=new y(210,"px"),Se=new y(200,"px"),ts=new y(190,"px"),ss=new y(180,"px"),os=new y(170,"px"),is=new y(160,"px"),rs=new y(150,"px"),ns=new y(140,"px"),ls=new y(130,"px"),as=new y(120,"px"),cs=new y(110,"px"),ds=new y(100,"px"),hs=new y(90,"px"),us=new y(80,"px"),ps=new y(70,"px"),gs=new y(60,"px"),fs=new y(50,"px"),ms=new y(40,"px"),bs=new y(30,"px"),ys=new y(20,"px"),ws=new y(10,"px"),xs=new y(0,"px");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}sort(e){}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 At{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 Ce 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 tt,this.service=new At,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){if(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){const s=this.columnDefs.find(o=>o.property===e);return(o,i)=>{const r=this.getValueByT(o.data,e),n=this.getValueByT(i.data,e);return s!=null&&s.sortComparator?t*s.sortComparator(r,n,o.data,i.data,t):this.sorterService.genericSortComparator(r,n,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 ve{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 Re{constructor(e=0,t=0,s=0,o=0){this.top=e,this.right=t,this.bottom=s,this.left=o}}class Et{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 ee{constructor(e,t,s,o=0,i=0,r=!1,n=new G,l=[],a=[],c=-1,h=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=h,this.parentSize=u,this.getSelectionModel=f,this.rowCount=0,this.contentHeightInPx=0,this.contentWidthInPx=0,this.padding=new Re(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&&qe(this.columnDefs[0])&&!t.rowSelectionModel&&(t.rowSelectionModel=new Et)}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 Re(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)}sort(e){return this.getAreaModel("body").sort(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 Ae extends O{constructor(e,t,s,o,i="ge-selected-row",r="ge-focused-row"){super(e,t,o,s,i,r),this.areaIdent=e,this.rows=t,this.columnDefs=s,this.defaultRowHeight=o}}class V{static createTableModel(e){var t,s,o,i,r,n,l,a,c,h,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 G,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(),Se)):(o=e.rows)!=null&&o.length?e.columnDefs=Object.keys(e.rows[0]).map(g=>new H(g,g.toUpperCase(),Se)):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||((h=e.footerData)!=null&&h.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&&N(e.rows[0])){const g=e.rows;e.bodyAreaModel=new Ce("body",g,e.defaultRowHeights.body,e.columnDefs),(e.columnDefs[0].property==="CheckboxColumn"||(f=e.tableOptions)!=null&&f.showCheckboxWihoutExtraColumn)&&(e.bodyAreaModel.rowSelectionModel=new ve(g))}else e.bodyAreaModel=new Ae("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 ee(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 V.buildByTypedRows(e.rows??[],e.columnDefs,e.tableOptions??new X,e.fixedLeftColumnCount??0,e.fixedRightColumnCount??0)}static buildByTypedRows(e,t,s=new X,o=0,i=0){const r=s.defaultRowHeights,n=t[0].property==="CheckboxColumn";if(e!=null&&e.length&&N(e[0])){const a=e,c=new Ce("body",a,r.body,t);return(n||s.showCheckboxWihoutExtraColumn)&&(c.rowSelectionModel=new ve(a)),V.createByAreaModelsParam({headerAreaModel:new P("header",[t.map(h=>h.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 V.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 V.createByObjectArray(e.rows,e.header??[],e.footer??[],e.fixedLeftColumnCount??0,e.fixedRightColumnCount??0,t,e.defaultRowHeights??new G,e.columnDefs??[],e.columnSizes??[])}static createByAreaModels(e=new F,t,s=new F,o=0,i=0,r=!1,n=new G,l,a=[],c=-1,h){return new ee(e,t,s,o,i,r,n,l,a,c,h)}static createByAreaModelsParam(e){return V.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 G,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 h=s?new P("footer",s,n.footer,l):new F,u=new Ae("body",e,l,n.body);return new ee(c,u,h,o,i,r,n,l,a)}}const Ss=["COPY_2_CLIPBOARD","START_EDITING","TOGGLE_SELECTION","SELECT_ALL","DESELECT_ALL","NAVIGATE_LEFT","NAVIGATE_RIGHT","NAVIGATE_UP","NAVIGATE_DOWN"];class Tt{constructor(e,t){this.tableModel=e,this.tableOptions=t}}class Mt{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 Cs extends Mt{constructor(e,t,s,o,i,r,n,l){super(e,t,s,o,i,r,n),this.rows=l}}class It{constructor(e,t){this.value=e,this.label=t}}class vs{constructor(e,t){this.index=e,this.px=t}}const Rs={body:["ge-table-text-align-left"]},As={body:["ge-table-text-align-center"]},Es={body:["ge-table-text-align-right"]},Ts={header:["ge-table-text-align-left"],body:["ge-table-text-align-left"],footer:["ge-table-text-align-left"]},Ms={header:["ge-table-text-align-center"],body:["ge-table-text-align-center"],footer:["ge-table-text-align-center"]},Is={header:["ge-table-text-align-right"],body:["ge-table-text-align-right"],footer:["ge-table-text-align-right"]};class Ee{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=`
|
|
308
|
+
}`};let we=le;class xe{constructor(e,t=!0,o,s,i=0,r=!1,n=!1){this.data=e,this.expanded=t,this.children=o,this.parent=s,this.deep=i,this.checked=r,this.keep=n,this.type="TreeRow"}}class ie{static buildTreeRows(e,t="children",o=12){const s=[];for(const i of e)s.push(ie.buildTreeRow(i,t,void 0,0,o));return s}static buildTreeRow(e,t="children",o=new xe(e,!0,[],void 0,0),s=0,i=12){var n;if(s>i)return console.warn("Max deep limit reached: ",s),o;const r=e[t];if(r)for(const l of r){const a=new xe(l,!0,[],o,s+1);if((n=o.children)==null||n.push(a),ie.buildTreeRow(l,t,a,s+1),s>i)return console.warn("Max deep limit reached: ",s),o}return o}}class G{constructor(e=34,t=34,o=34){this.header=e,this.body=t,this.footer=o}}class y{constructor(e=100,t="px"){this.value=e,this.unit=t}}const vt=()=>!0,Se=()=>!1;class H{constructor(e,t,o=new y(100,"px"),s=new T,i=new T,r=new y(100,"px"),n=new y(100,"px"),l,a,d,h,u,f,p,m,g=()=>this.visible){this.property=e,this.headerLabel=t,this.width=o,this.classes=s,this.rendererMap=i,this.minWidth=r,this.maxWidth=n,this.sortable=l,this.sortComparator=a,this.sortState=d,this.sortStatesOrder=h,this.sortIconVisible=u,this.editable=f,this.getEditRenderer=p,this.editInputPipe=m,this.isVisible=g,this.visible=!0,o.unit!=="px"&&(this.minWidth=new y(0,"px"),this.maxWidth=new y(1e5,"px"))}static bodyRenderer(e){return new T(void 0,e,void 0)}static create(e){const t=new T(e.headerRenderer,e.bodyRenderer,e.footerRenderer),o=new T(e.headerClasses,e.bodyClasses,e.footerClasses),s=e.sortIconVisible??e.sortable??Se,i=e.editable??e.editable??Se,r=e.isVisible??e.isVisible??vt;return new H(e.property??"",e.headerLabel??"",e.width??new y(100,"px"),o,t,e.minWidth??new y(100,"px"),e.maxWidth??new y(100,"px"),e.sortable,e.sortComparator,e.sortState,e.sortStatesOrder,s,i,e.getEditRenderer,e.editInputPipe,r)}}const Yt=new y(500,"px"),Ut=new y(400,"px"),Rt=new y(300,"px"),Kt=new y(290,"px"),Xt=new y(280,"px"),Jt=new y(270,"px"),qt=new y(260,"px"),Zt=new y(250,"px"),Qt=new y(240,"px"),eo=new y(230,"px"),to=new y(220,"px"),oo=new y(210,"px"),Ce=new y(200,"px"),so=new y(190,"px"),io=new y(180,"px"),ro=new y(170,"px"),no=new y(160,"px"),lo=new y(150,"px"),ao=new y(140,"px"),co=new y(130,"px"),ho=new y(120,"px"),uo=new y(110,"px"),po=new y(100,"px"),go=new y(90,"px"),fo=new y(80,"px"),mo=new y(70,"px"),bo=new y(60,"px"),yo=new y(50,"px"),wo=new y(40,"px"),xo=new y(30,"px"),So=new y(20,"px"),Co=new y(10,"px"),vo=new y(0,"px");class F extends ue{constructor(e,t,o,s=[]){super(e,s,o),this.areaIdent=e,this.arr=t,this.defaultRowHeight=o,this.columnDefs=s,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,o){var i;const s=(i=this.columnDefs[t])==null?void 0:i.editInputPipe;return s&&(o=s(o,e,t)),this.arr[e][t]=o,!0}getRowByIndex(e){return this.filteredArr[e]}getRowHeight(e){return this.defaultRowHeight}changeColumnOrder(e,t){this.filteredArr.forEach(o=>this.arrayMove(o,e,t)),super.changeColumnOrder(e,t)}}class k{constructor(e="body"){this.areaIdent=e,this.rowSelectionModel=void 0}sort(e){}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,o){return!1}isSelectable(e,t){return!1}changeColumnOrder(e,t){}}class At{flattenTree(e,t=[]){var o;for(const s of e)this.isVisible(s)&&t.push(s),(o=s.children)!=null&&o.length&&this.flattenTree(s.children,t);return t}isVisible(e){return e.parent?e.parent.expanded?this.isVisible(e.parent):!1:!0}}class ve extends ue{constructor(e,t,o,s=[]){super(e,s,o),this.areaIdent=e,this.rows=t,this.defaultRowHeight=o,this.columnDefs=s,this.type="AreaModelTree",this.sorterService=new Le,this.service=new At,this.properties=s.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 o=this.getRowByIndex(e);if(o){const s=this.properties[t];if(s)return s.includes(".")?this.getPropertyValue(o.data,s.split(".")):o.data[s]}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){if(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:o}=e[e.length-1],s=o==="asc"?1:o==="desc"?-1:0,i=this.properties[t];return this.treeSort(this.rows,i,s),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,o){var r;const s=(r=this.columnDefs[t])==null?void 0:r.editInputPipe;s&&(o=s(o,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("."),o):(n[l]=o,!0)}return!1}genericTreeTableSortComparator(e,t){const o=this.columnDefs.find(s=>s.property===e);return(s,i)=>{const r=this.getValueByT(s.data,e),n=this.getValueByT(i.data,e);return o!=null&&o.sortComparator?t*o.sortComparator(r,n,s.data,i.data,t):this.sorterService.genericSortComparator(r,n,t)}}expandAllRecursive(e,t){for(const o of e)o.expanded=t,o.children&&this.expandAllRecursive(o.children,t)}doFiltering(){if(!this.lastPredictFn)this.filteredFlattenRows=[...this.flattenRows?this.flattenRows:[]];else{this.flattenRows||(this.flattenRows=[]);let e=0;this.flattenRows.forEach(o=>{e=Math.max(e,o.deep)});const t=this.flattenRows.filter((o,s,i)=>this.lastPredictFn(o,s,i));this.flattenRows.forEach(o=>o.keep=!1),this.flattenRows.forEach(o=>{t.includes(o)&&(o.keep=!0,this.setAllParentsOk(o))}),this.filteredFlattenRows=this.flattenRows.filter((o,s,i)=>o.keep)}}getPropertyValue(e,t){const o=t.shift();let s=e[o];return s&&t.length?this.getPropertyValue(s,t):s}treeSort(e,t,o){e.sort(this.genericTreeTableSortComparator(t,o));for(const s of e)s.children&&this.treeSort(s.children,t,o)}}class Re{constructor(e=[]){this.allRootNodes=e}checkRow(e,t){if(e.checked=t,e.children)for(const o of e.children)this.checkRow(o,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),o=this.areAllChildrenUnchecked(e);return!t&&!o?"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),o=this.areAllChildrenUnchecked(e);t?e.checked=!0:e.checked=!1,this.autoCheckParent(e.parent)}}areAllChildrenChecked(e){var t,o;if((t=e.children)!=null&&t.length){for(const s of e.children)if(!s.checked||(o=s.children)!=null&&o.length&&!this.areAllChildrenChecked(s))return!1}return!0}areAllChildrenUnchecked(e){var t,o;if((t=e.children)!=null&&t.length){for(const s of e.children)if(s.checked||(o=s.children)!=null&&o.length&&!this.areAllChildrenUnchecked(s))return!1}return!0}addSelectedRecursive(e,t){for(const o of e)o.checked&&t.push(o),o.children&&this.addSelectedRecursive(o.children,t)}}class re{constructor(e=0,t=0,o=0,s=0){this.top=e,this.right=t,this.bottom=o,this.left=s}}class Mt{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 ee{constructor(e,t,o,s=0,i=0,r=!1,n=new G,l=[],a=[],d=-1,h=0,u=400,f=()=>{}){var p,m,g,b;this.headerAreaModel=e,this.bodyAreaModel=t,this.footerAreaModel=o,this.fixedLeftColumnCount=s,this.fixedRightColumnCount=i,this.rowCheckboxVisible=r,this.defaultRowHeights=n,this.columnDefs=l,this.columnSizes=a,this.overridingColumnWidth=d,this.columnCount=h,this.parentSize=u,this.getSelectionModel=f,this.rowCount=0,this.contentHeightInPx=0,this.contentWidthInPx=0,this.padding=new re(0,0,0,0),this.xPositions=[],e.areaIdent="header",t.areaIdent="body",o.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&&Ze(this.columnDefs[0])&&!t.rowSelectionModel&&(t.rowSelectionModel=new Mt)}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 o;t=Math.max(0,t),this.overridingColumnWidth!==-1&&(this.overridingColumnWidth=t),e>-1&&e<((o=this.columnSizes)==null?void 0:o.length)&&(this.columnSizes[e]=t),this.recalcContentWidthInPx()}getColumnWidth(e){var o;const t=this.getColumnDef(e);return t&&t.isVisible&&!t.isVisible()?0:this.overridingColumnWidth!==-1?this.overridingColumnWidth:e>-1&&e<((o=this.columnSizes)==null?void 0:o.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"),o=this.getAreaHeight("header"),s=this.getAreaHeight("footer");this.padding=new re(o,t,s,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),o=t.getRowCount();if(this.defaultRowHeights[e])return o*this.defaultRowHeights[e];let s=0;for(let i=0;i<o;i++)s=s+t.getRowHeight(i);return s}getSideAreaWidth(e){const[t,o]=this.getSideStartAndEndColumnIndex(e);let s=0;for(let i=t;i<=o;i++)s=s+this.getColumnWidth(i);return s}getSideStartAndEndColumnIndex(e){const t=this.getFixedLeftColumnCount(),o=this.getFixedRightColumnCount();let s=0,i=this.columnCount-1;return e==="west"?i=t-1:e==="east"?s=this.columnCount-o:(s=t,i=this.columnCount-o-1),[s,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)}sort(e){return this.getAreaModel("body").sort(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 o=(t=this.columnDefs[e])==null?void 0:t.sortable;if(typeof o=="function")return o()}return!1}changeColumnOrder(e,t){var o,s,i;this.arrayMove(this.columnDefs,e,t),this.arrayMove(this.columnSizes,e,t),(o=this.headerAreaModel)==null||o.changeColumnOrder(e,t),(s=this.bodyAreaModel)==null||s.changeColumnOrder(e,t),(i=this.footerAreaModel)==null||i.changeColumnOrder(e,t),this.calcXPositions()}recalcColumnWidths(e){var t,o,s;if(!((t=this.columnDefs)!=null&&t.length)&&!((o=this.columnSizes)!=null&&o.length)&&(this.columnSizes=new Array(this.getColumnCount()).fill(this.overridingColumnWidth)),(s=this.columnDefs)!=null&&s.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 d=this.sizeToPixel(l.minWidth,e);a=Math.max(d,a)}if(l.maxWidth){const d=this.sizeToPixel(l.maxWidth,e);a=Math.min(d,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,d)=>a+d);for(let a=0;a<this.columnDefs.length;a++){const d=this.columnDefs[a];d.width.unit==="weight"&&(this.columnSizes[a]=d.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,o){const s=e.splice(t,1)[0];return e.splice(o,0,s),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 Ae extends _{constructor(e,t,o,s,i="ge-selected-row",r="ge-focused-row"){super(e,t,s,o,i,r),this.areaIdent=e,this.rows=t,this.columnDefs=o,this.defaultRowHeight=s}}class V{static createTableModel(e){var t,o,s,i,r,n,l,a,d,h,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 G,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&&((o=e.properties)!=null&&o.length?e.columnDefs=e.properties.map(g=>new H(g,g.toUpperCase(),Ce)):(s=e.rows)!=null&&s.length?e.columnDefs=Object.keys(e.rows[0]).map(g=>new H(g,g.toUpperCase(),Ce)):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 F("header",e.headerData,e.defaultRowHeights.header,e.columnDefs):(d=e.columnDefs)!=null&&d.length?e.headerAreaModel=new F("header",[e.columnDefs.map(g=>g.headerLabel)],e.defaultRowHeights.header,e.columnDefs):e.headerAreaModel=new k("header")),e.footerAreaModel||((h=e.footerData)!=null&&h.length?e.footerAreaModel=new F("footer",e.footerData,e.defaultRowHeights.footer,e.columnDefs):e.footerAreaModel=new k("footer")),!e.bodyAreaModel)if(e.rows)if((u=e.rows)!=null&&u.length&&N(e.rows[0])){const g=e.rows;e.bodyAreaModel=new ve("body",g,e.defaultRowHeights.body,e.columnDefs),(e.columnDefs[0].property==="CheckboxColumn"||(f=e.tableOptions)!=null&&f.showCheckboxWihoutExtraColumn)&&(e.bodyAreaModel.rowSelectionModel=new Re(g))}else e.bodyAreaModel=new Ae("body",e.rows,e.columnDefs,e.defaultRowHeights.body);else e.bodyData?e.bodyAreaModel=new F("body",e.bodyData,e.defaultRowHeights.body):e.bodyAreaModel=new k("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 ee(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 V.buildByTypedRows(e.rows??[],e.columnDefs,e.tableOptions??new X,e.fixedLeftColumnCount??0,e.fixedRightColumnCount??0)}static buildByTypedRows(e,t,o=new X,s=0,i=0){const r=o.defaultRowHeights,n=t[0].property==="CheckboxColumn";if(e!=null&&e.length&&N(e[0])){const a=e,d=new ve("body",a,r.body,t);return(n||o.showCheckboxWihoutExtraColumn)&&(d.rowSelectionModel=new Re(a)),V.createByAreaModelsParam({headerAreaModel:new F("header",[t.map(h=>h.headerLabel)],r.header),bodyAreaModel:d,footerAreaModel:new F("footer",[],r.footer),columnDefs:t,fixedLeftColumnCount:s,fixedRightColumnCount:i,defaultRowHeights:o.defaultRowHeights,rowCheckboxVisible:!1,columnSizes:[],columnCount:t.length,overridingColumnWidth:-1})}return V.createByObjectArrayParam({rows:e,columnDefs:t,fixedLeftColumnCount:s,fixedRightColumnCount:i,defaultRowHeights:o.defaultRowHeights})}static createByObjectArrayParam(e){const t=e.rowCheckboxVisible!==void 0?e.rowCheckboxVisible:!1;return V.createByObjectArray(e.rows,e.header??[],e.footer??[],e.fixedLeftColumnCount??0,e.fixedRightColumnCount??0,t,e.defaultRowHeights??new G,e.columnDefs??[],e.columnSizes??[])}static createByAreaModels(e=new k,t,o=new k,s=0,i=0,r=!1,n=new G,l,a=[],d=-1,h){return new ee(e,t,o,s,i,r,n,l,a,d,h)}static createByAreaModelsParam(e){return V.createByAreaModels(e.headerAreaModel??new k,e.bodyAreaModel,e.footerAreaModel??new k,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=[],o=[],s=0,i=0,r=!1,n=new G,l,a=[]){let d;t!=null&&t.length?d=new F("header",t,n.header,l):l!=null&&l.length?d=new F("header",[l.map(f=>f.headerLabel)],n.header,l):d=new k;const h=o?new F("footer",o,n.footer,l):new k,u=new Ae("body",e,l,n.body);return new ee(d,u,h,s,i,r,n,l,a)}}class Et{constructor(e,t,o=200,s=300,i=0,r=0){this.items=e,this.cellRenderer=t,this.coverWidth=o,this.coverHeight=s,this.width=i,this.firstRowPaddingTop=r,this.rowSelectionModel=void 0,this.areaIdent="body",this.filteredItems=[],this.sorterService=new Le,this.filteredItems=e}setParentWidth(e){this.width=e}getRowCount(){var e;return(e=this.filteredItems)!=null&&e.length?Math.floor(this.filteredItems.length/this.getColumnCount())+1:0}getColumnCount(){return this.width?Math.floor(this.width/this.coverWidth):1}getValueAt(e,t){var o;return(o=this.filteredItems)==null?void 0:o[e*this.getColumnCount()+t]}getTextValueAt(e,t){return""}getTooltipAt(e,t){return""}getRowHeight(e){return e===0&&this.firstRowPaddingTop>0?this.firstRowPaddingTop+this.coverHeight:this.coverHeight}getCellRenderer(e,t){return this.cellRenderer}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){}setRowChecked(e,t){}getMaxColspan(){return 31}getMaxRowspan(){return 31}getYPosByRowIndex(e){const t=this.firstRowPaddingTop>0?this.firstRowPaddingTop:0;return this.coverHeight*e+t}init(){}externalFilterChanged(e){this.filteredItems=this.items.filter(e)}isFilterable(){return!0}doSort(e){if(!this.filteredItems)return!1;for(const t of e){const{sortState:o}=t,s=o==="asc"?1:o==="desc"?-1:0;this.filteredItems=this.filteredItems.sort((i,r)=>this.sorterService.genericSortComparator(i,r,s))}return!0}sort(e){this.filteredItems=this.filteredItems.sort(e)}isEditable(e,t){return!1}setValue(e,t,o){return!0}isSelectable(e,t){return!1}changeColumnOrder(e,t){}setPropertyValue(e,t,o){return!1}arrayMove(e,t,o){}}class Tt{constructor(e,t=0){this.bodyModel=e,this.paddingTop=t,this.headerAreaModel=new k,this.footerAreaModel=new k}changeColumnOrder(e,t){}isSortable(e){return!1}init(){}setParentWidth(e){this.bodyModel.width=e}getColumnCount(){return this.bodyModel.getColumnCount()}getXPosByColumnIndex(e){return e*this.getColumnWidth(e)}getAreaModel(e){return e==="header"?this.headerAreaModel:e==="footer"?this.footerAreaModel:this.bodyModel}getBodyModel(){return this.bodyModel}getFixedLeftColumnCount(){return 0}getFixedRightColumnCount(){return 0}isHeaderVisibe(){return!1}isFooterVisibe(){return!1}isRowCheckboxVisible(){return!1}getRowHeight(e,t){return this.bodyModel.getRowHeight(t)}getColumnDef(e){}getColumnDefs(){}getColumnProperty(e){return""}getBodyRowByIndex(e){return this.bodyModel.getRowByIndex(e)}getColumnWidth(e){return this.bodyModel.coverWidth}setColumnWidth(e,t){this.bodyModel.coverWidth=t}recalcSize(e){}recalcPadding(){}recalcHeightAndPadding(){}getPadding(){return new re(0,0,0,0)}getContentHeightInPixel(){return this.paddingTop+this.bodyModel.getRowCount()*this.bodyModel.coverHeight}getContentWidthInPixel(){return this.bodyModel.getColumnCount()*this.bodyModel.coverWidth}externalFilterChanged(e){this.bodyModel.externalFilterChanged(e)}doSort(e){return this.bodyModel.doSort(e)}sort(e){this.bodyModel.sort(e)}getSelectionModel(){}setTableScope(e){this.tableScope=e}getTableScope(){return this.tableScope}}class Ro{static createCoverGridModel(e,t,o=200,s=300,i=0,r=0){const n=new Et(e,t,o,s,i,r);return new Tt(n,r)}}const Ao=["COPY_2_CLIPBOARD","START_EDITING","TOGGLE_SELECTION","SELECT_ALL","DESELECT_ALL","NAVIGATE_LEFT","NAVIGATE_RIGHT","NAVIGATE_UP","NAVIGATE_DOWN"];class It{constructor(e,t){this.tableModel=e,this.tableOptions=t}}class kt{constructor(e,t,o,s,i,r,n){this.emmitDataKey=e,this.emmitCancelKey=t,this.queryId=o,this.filter=s,this.sorting=i,this.startIndex=r,this.endIndex=n}}class Mo extends kt{constructor(e,t,o,s,i,r,n,l){super(e,t,o,s,i,r,n),this.rows=l}}class Dt{constructor(e,t){this.value=e,this.label=t}}class Eo{constructor(e,t){this.index=e,this.px=t}}const To={body:["ge-table-text-align-left"]},Io={body:["ge-table-text-align-center"]},ko={body:["ge-table-text-align-right"]},Do={header:["ge-table-text-align-left"],body:["ge-table-text-align-left"],footer:["ge-table-text-align-left"]},Po={header:["ge-table-text-align-center"],body:["ge-table-text-align-center"],footer:["ge-table-text-align-center"]},Fo={header:["ge-table-text-align-right"],body:["ge-table-text-align-right"],footer:["ge-table-text-align-right"]};class Me{render(e,t,o,s,i,r,n){if(i.isRowCheckable(t)){n.addClass(e,"ge-table-row-checkbox-div");const l=i.isRowChecked(t),a=l==="full"?"checked":"",d=l==="semi"?'<span style="opacity: 0.4;">✓<span>':"";e.innerHTML=`
|
|
309
309
|
<input
|
|
310
310
|
type="checkbox"
|
|
311
|
-
data-area="${
|
|
311
|
+
data-area="${s}"
|
|
312
312
|
data-row-index="${t}"
|
|
313
|
-
data-col-index="${
|
|
313
|
+
data-col-index="${o}"
|
|
314
314
|
data-input-type="checkbox"
|
|
315
315
|
${a}
|
|
316
316
|
class="ge-table-row-checkbox">
|
|
317
|
-
${
|
|
317
|
+
${d} `}}}class _o{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 T(new Me,new Me,void 0),this.classes=new T([],["ge-table-text-align-left"],[])}}class Oo{static body(e){return new T(void 0,e,void 0)}}class Lo{constructor(e="down",t){this.status=e,this.originalEvent=t}}class $o{constructor(e,t,o,s,i={}){this.area=e,this.rowIndex=t,this.columnIndex=o,this.value=s,this.cssClasses=i}}class Vo{constructor(){this.autoRestoreSortingState=!1,this.autoRestoreCollapsedExpandedState=!1,this.autoRestoreScrollPosition=!1,this.autoRestoreCheckedState=!1,this.autoRestoreSelectedState=!1,this.getStorageKeyFn=void 0,this.isSame=(e,t,o)=>{if(e&&t&&o.getRowId){const s=o.getRowId(e),i=o.getRowId(t);return s===i}return!1},this.getRowId=e=>{if(e){for(const t of["id","uuid"]){const o=e[t];if(o!=null)return o}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 Pt{constructor(e,t,o,s=!1,i="normal",r=void 0){this.data=e,this.property=t,this.toggle=o,this.closed=s,this.visibility=i,this.children=r,this.impl="CellGroup"}}class Ft extends Pt{constructor(e,t=0,o=0,s){super(e.data,e.property,e.toggle,e.closed,e.visibility,e.children),this.rowIndex=t,this.childIndex=o,this.parent=s,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 o;if(e!=null&&e.claimsSpace()&&t++,(o=e==null?void 0:e.children)!=null&&o.length)for(const s of e.children)t=this.getColumnCount(s,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),o=`${this.getColumnIndex()}`,s=`${this.getColumnCount(this)}`,i=`${this.getRowSpan(this,e)}`,r=`${this.getParentCount(this)}`,n=`${t+this.data}
|
|
318
318
|
childIndex:${this.childIndex}
|
|
319
319
|
row:${this.rowIndex}
|
|
320
|
-
col:${
|
|
320
|
+
col:${o}
|
|
321
321
|
vis:${this.visibility}
|
|
322
322
|
toggle:${this.toggle}
|
|
323
323
|
closed:${this.closed}
|
|
324
324
|
isVisible:${this.isVisible()}
|
|
325
325
|
ownColumn:${this.ownColumn()}
|
|
326
326
|
claimsSpace:${this.claimsSpace()}
|
|
327
|
-
colCount:${
|
|
327
|
+
colCount:${s}
|
|
328
328
|
rowSpan:${i}
|
|
329
|
-
pc:${r}`.replace(/[ \n]+/g," ");if(this.children)for(const l of this.children)l.log(e);return n}}class
|
|
329
|
+
pc:${r}`.replace(/[ \n]+/g," ");if(this.children)for(const l of this.children)l.log(e);return n}}class E{static buildColumnDefs(e,t=[]){for(const o of e)o.property&&t.push(H.create({property:o.property,headerLabel:o.data?o.data:o.property,isVisible:()=>typeof o.isVisible=="function"?o.isVisible():!0})),o.children&&E.buildColumnDefs(o.children,t);return t}static buildGroupExts(e,t=[],o=0,s){let i;for(let r=0;r<e.length;r++){const n=e[r],l=new Ft(n,o,r,s);i&&(l.leftNeighbour=i,i.rightNeighbour=l),t.push(l),n.children&&(l.children=E.buildGroupExts(n.children,[],o+1,l)),i=l}return t}static flattenGroupExts(e,t=[]){for(const o of e)t.push(o),o.children&&E.flattenGroupExts(o.children,t);return t}static buildArrayOfArrays(e,t){var i;let o=-1,s=99999;for(const r of e){if(r.rowIndex<=s){o++;for(let n=0;n<t.length;n++)t[n][o]=null}if(t[r.rowIndex][o]=r,s=r.rowIndex,r.ownColumn()&&((i=r.children)!=null&&i.length)){for(let n=r.rowIndex+1;n<t.length;n++)t[n][o]=void 0;o++;for(let n=0;n<t.length;n++)t[n][o]=null}}return t}static iterateThrowColumns(e=[],t){var o;for(const s of t)e.push(s.data+" rowIndex:"+s.rowIndex),(o=s.children)!=null&&o.length&&E.iterateThrowColumns(e,s.children)}}class Bo{constructor(){this.areaIdent="body",this.rowSelectionModel=void 0}changeColumnOrder(e,t){}doSort(e){return!1}sort(e){}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,o){return!1}}const ae=class ae{constructor(e=new Ve){this.headerGroupOptions=e}render(e,t,o,s,i,r,n){const l=r!=null&&r.data?r.data:"";if(r){const{toggle:a,visibility:d,closed:h}=r,u=a?ae.toggleHeaderGroup:"";this.addText(e,s,t,o,l,u),a&&d!=="always"&&this.addArrowDiv(n,e,!h,t,o,s,u)}else this.addText(e,s,t,o,l,"")}addText(e,t,o,s,i,r){e.innerHTML=`<span
|
|
330
330
|
data-ge-action="${r}"
|
|
331
331
|
data-area="${t}"
|
|
332
|
-
data-row-index="${
|
|
333
|
-
data-col-index="${
|
|
334
|
-
>${i}</span>`}addArrowDiv(e,t,
|
|
332
|
+
data-row-index="${o}"
|
|
333
|
+
data-col-index="${s}"
|
|
334
|
+
>${i}</span>`}addArrowDiv(e,t,o=!0,s=-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",`${s}`),e.setAttribute(l,"data-col-index",`${i}`),e.setAttribute(l,"data-area",`${r}`),e.setAttribute(l,"data-ge-action",`${n}`);let a;o?a=this.headerGroupOptions.iconExpanded:a=this.headerGroupOptions.iconCollapsed;const d=a.content,h=e.createText(d);e.appendChild(l,h),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,o){const s=o.split(";").map(i=>i.trim()).filter(i=>i);for(const i of s){const[r,n]=i.split(":");e.setStyle(t,r.trim(),n.trim())}}};ae.toggleHeaderGroup="toggleHeaderGroup";let ne=ae;class Ho{constructor(e="header",t,o=[],s,i=new Ve){this.areaIdent=e,this.groups=t,this.columnDefs=o,this.defaultRowHeight=s,this.headerGroupOptions=i,this.gammaCells=!0,this.arr=[],this.groupExts=[],this.cellGroupExtCellRenderer=new ne(this.headerGroupOptions),this.groupExts=E.buildGroupExts(t),this.init()}sort(e){}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=E.buildColumnDefs(this.groups))}getAllLeafs(){return E.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=E.flattenGroupExts(this.groupExts),t=1+Math.max(...e.map(r=>r.rowIndex)),o=[];E.iterateThrowColumns(o,this.groupExts);const s=Array.from(Array(t).keys()).map(r=>[]),i=E.buildArrayOfArrays(e,s);return console.table(i),i}changeColumnOrder(e,t){}doSort(e){return!1}externalFilterChanged(e){}getCellRenderer(e,t){return this.cellGroupExtCellRenderer}getColspanAt(e,t){const o=this.getValueAt(e,t);return o?o.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 o=this.getValueAt(e,t);if(o){const s=this.getRowCount();return o.getRowSpan(o,s)}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,o){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()),E.buildColumnDefs(this.groupExts)}}class Wo{filterPredict(e,t,o=this.objectToString.bind(this)){if(!e)return!1;if(!t)return!0;t=t.toLowerCase();const s="+",i="-",r=t.toLowerCase().split(" ").filter(h=>h!==s&&h!==i&&h!==""),n=r.filter(h=>!h.startsWith(s)&&!h.startsWith(i)),l=r.filter(h=>h.startsWith(s)).map(h=>h.replace(/\+/g,"")),a=r.filter(h=>h.startsWith(i)).map(h=>h.replace(/-/g,""));let d=!n.length;for(let h=0;h<n.length;h++)(d||o(e).includes(n[h]))&&(d=!0);if(!d)return!1;for(let h=0;h<l.length;h++)if(!o(e).includes(l[h]))return!1;for(let h=0;h<a.length;h++)if(o(e).includes(a[h]))return!1;return!0}filterRows(e,t,o=s=>JSON.stringify(s).toLowerCase()){if(!e)return[];if(!t)return[...e];t=t.toLowerCase();const s="+",i="-",r=t.toLowerCase().split(" ").filter(d=>d!==s&&d!==i&&d!==""),n=r.filter(d=>!d.startsWith(s)&&!d.startsWith(i)),l=r.filter(d=>d.startsWith(s)).map(d=>d.replace(/\+/g,"")),a=r.filter(d=>d.startsWith(i)).map(d=>d.replace(/-/g,""));return e==null?void 0:e.filter(d=>{let h=!n.length;for(let u=0;u<n.length;u++)(h||o(d).includes(n[u]))&&(h=!0);if(!h)return!1;for(let u=0;u<l.length;u++)if(!o(d).includes(l[u]))return!1;for(let u=0;u<a.length;u++)if(o(d).includes(a[u]))return!1;return!0})}objectToString(e){if(!e)return"";const t=[],o=Object.keys(e);for(let s=0;s<o.length;s++){const i=o[s];t.push(e[i])}return t.join(" ").toLowerCase()}}class No{static bodyRenderer(e){return new T(void 0,e,void 0)}}class Go{constructor(e,t=!0,o=!1){this.property=e,this.skipCheckableCheck=t,this.readonly=o}render(e,t,o,s,i,r,n){if(this.readonly||this.skipCheckableCheck||i.isRowCheckable(t)){n.addClass(e,"ge-table-row-checkbox-div");const l=i.getRowByIndex(t),d=i.getValueByT(l,this.property)===!0?"checked":"",h=this.readonly?" readonly ":"";if(n.addClass(e,"ge-padding-property-checkbox"),e.innerHTML=`
|
|
335
335
|
<input
|
|
336
336
|
type="checkbox"
|
|
337
|
-
data-area="${
|
|
337
|
+
data-area="${s}"
|
|
338
338
|
data-row-index="${t}"
|
|
339
|
-
data-col-index="${
|
|
339
|
+
data-col-index="${o}"
|
|
340
340
|
data-property-index="${this.property}"
|
|
341
341
|
data-input-type="checkbox"
|
|
342
|
-
${
|
|
342
|
+
${d}
|
|
343
343
|
${h}
|
|
344
|
-
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
|
|
345
|
-
<div class="ge-table-label-div" data-row-index="${t}" data-col-index="${
|
|
346
|
-
<div class="ge-table-label" data-row-index="${t}" data-col-index="${
|
|
347
|
-
</div>`}}}class
|
|
344
|
+
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 zo{render(e,t,o,s,i,r,n){r&&(e.innerText=new Date(r).toISOString())}}class jo{constructor(){this.formatter=new Intl.DateTimeFormat("de-DE",{year:"numeric",month:"2-digit",day:"2-digit"})}render(e,t,o,s,i,r,n){if(r){let l="";try{l=this.formatter.format(new Date(r))}catch{l=r}e.innerHTML=`
|
|
345
|
+
<div class="ge-table-label-div" data-row-index="${t}" data-col-index="${o}" data-area="${s}" style="position: relative; background: transparent; width: 100%; height: 100%;">
|
|
346
|
+
<div class="ge-table-label" data-row-index="${t}" data-col-index="${o}" data-area="${s}">${l}</div>
|
|
347
|
+
</div>`}}}class Yo{render(e,t,o,s,i,r,n){r&&(e.innerText=new Date(r).toLocaleDateString())}}class Uo{render(e,t,o,s,i,r,n){r==="male"||r==="m"?e.innerText="♂":(r==="female"||r==="f")&&(e.innerText="♀")}}class Ko{constructor(e=100,t=!1){this.maxValue=e,this.labelVisible=t}render(e,t,o,s,i,r,n){if(n.addClass(e,"ge-progressbar-div"),!isNaN(r)){const a=Number(r)*100/this.maxValue,d=this.labelVisible?Math.round(a)+"%":"";e.innerHTML=`
|
|
348
348
|
<div class="ge-table-label-div"
|
|
349
349
|
data-row-index="${t}"
|
|
350
|
-
data-col-index="${
|
|
351
|
-
data-area="${
|
|
352
|
-
title="${
|
|
350
|
+
data-col-index="${o}"
|
|
351
|
+
data-area="${s}"
|
|
352
|
+
title="${d}"
|
|
353
353
|
style="position: relative; background: transparent; width: 100%; height: 100%;">
|
|
354
354
|
<div class="ge-table-progress-container"
|
|
355
355
|
style="width:100%;height:50%;padding:0;margin-top:6px;"
|
|
356
356
|
data-row-index="${t}"
|
|
357
|
-
data-col-index="${
|
|
358
|
-
data-area="${
|
|
357
|
+
data-col-index="${o}"
|
|
358
|
+
data-area="${s}">
|
|
359
359
|
<div class="ge-table-progress-bar"
|
|
360
360
|
style="width:${a}%;height:100%;padding:0;margin:0;"
|
|
361
361
|
data-row-index="${t}"
|
|
362
|
-
data-col-index="${
|
|
363
|
-
data-area="${
|
|
362
|
+
data-col-index="${o}"
|
|
363
|
+
data-area="${s}">
|
|
364
364
|
</div>
|
|
365
365
|
</div>
|
|
366
|
-
</div>`}}}class
|
|
366
|
+
</div>`}}}class Xo{render(e,t,o,s,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 Jo{render(e,t,o,s,i,r,n){r&&(e.innerText=new Date(r).toISOString().replace(/T/g," ").replace(/\..*/g,""))}}class qo{constructor(e=Number.MIN_SAFE_INTEGER,t=Number.MAX_SAFE_INTEGER){this.min=e,this.max=t}render(e,t,o,s,i,r,n){r&&(e.innerHTML=`
|
|
367
367
|
<div class="ge-table-label-div">
|
|
368
368
|
<div class="ge-table-label">${r}</div>
|
|
369
|
-
</div>`,(typeof r=="string"||isNaN(r)||r<this.min||r>this.max)&&n.addClass(e,"ge-cell-error"))}}class
|
|
370
|
-
<div class="ge-table-label-div" data-row-index="${t}" data-col-index="${
|
|
371
|
-
<div class="ge-table-label" data-row-index="${t}" data-col-index="${
|
|
372
|
-
</div>`}}}class
|
|
369
|
+
</div>`,(typeof r=="string"||isNaN(r)||r<this.min||r>this.max)&&n.addClass(e,"ge-cell-error"))}}class Zo{constructor(e){this.property=e}render(e,t,o,s,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 d=[];for(let u=0;u<a;u++)d.push("★");const h=d.join(" ");e.innerHTML=`
|
|
370
|
+
<div class="ge-table-label-div" data-row-index="${t}" data-col-index="${o}" data-area="${s}" style="position: relative; background: transparent; width: 100%; height: 100%;">
|
|
371
|
+
<div class="ge-table-label" data-row-index="${t}" data-col-index="${o}" data-area="${s}">${h}</div>
|
|
372
|
+
</div>`}}}class Qo{render(e,t,o,s,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 d=n.createText(r.join(", "));n.appendChild(a,d)}else e.innerText=""}}class es{constructor(e,t=100,o=!1){this.property=e,this.maxValue=t,this.labelVisible=o}render(e,t,o,s,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 d=a*100/this.maxValue,h=this.labelVisible?Math.round(d)+"%":"";e.innerHTML=`
|
|
373
373
|
<div class="ge-table-label-div"
|
|
374
374
|
data-row-index="${t}"
|
|
375
|
-
data-col-index="${
|
|
376
|
-
data-area="${
|
|
375
|
+
data-col-index="${o}"
|
|
376
|
+
data-area="${s}"
|
|
377
377
|
title="${h}"
|
|
378
378
|
style="position: relative; background: transparent; width: 100%; height: 100%;">
|
|
379
379
|
<div class="ge-table-progress-container"
|
|
380
380
|
style="width:100%;height:50%;padding:0;margin-top:6px;"
|
|
381
381
|
data-row-index="${t}"
|
|
382
|
-
data-col-index="${
|
|
383
|
-
data-area="${
|
|
382
|
+
data-col-index="${o}"
|
|
383
|
+
data-area="${s}">
|
|
384
384
|
<div class="ge-table-progress-bar"
|
|
385
|
-
style="width:${
|
|
385
|
+
style="width:${d}%;height:100%;padding:0;margin:0;"
|
|
386
386
|
data-row-index="${t}"
|
|
387
|
-
data-col-index="${
|
|
388
|
-
data-area="${
|
|
387
|
+
data-col-index="${o}"
|
|
388
|
+
data-area="${s}">
|
|
389
389
|
</div>
|
|
390
390
|
</div>
|
|
391
|
-
</div>`}}}class
|
|
391
|
+
</div>`}}}class ts{render(e,t,o,s,i,r,n){if(r){e.innerHTML=`
|
|
392
392
|
<div
|
|
393
393
|
class="ge-table-label-div"
|
|
394
394
|
data-row-index=${t}"
|
|
395
|
-
data-col-index="${
|
|
396
|
-
data-area="${
|
|
395
|
+
data-col-index="${o}"
|
|
396
|
+
data-area="${s}"
|
|
397
397
|
style="position: relative; background: transparent; width: 100%; height: 100%;">
|
|
398
398
|
<div
|
|
399
399
|
class="ge-table-label"
|
|
400
400
|
data-row-index="${t}"
|
|
401
|
-
data-col-index="${
|
|
402
|
-
data-area="${
|
|
401
|
+
data-col-index="${o}"
|
|
402
|
+
data-area="${s}">${r}</div></div>`;const l=Number(r);l>0?n.addClass(e,"ge-positive-text-color"):l<0&&n.addClass(e,"ge-negative-text-color")}}}class He{constructor(e,t,o,s,i,r){this.action=e,this.area=t,this.areaModel=o,this.rowIndex=s,this.columnIndex=i,this.id=r}}class ${constructor(e,t,o="",s="",i="button",r=!0){this.action=e,this.label=t,this.icon=o,this.elementClass=s,this.elementType=i,this.enabled=r}}class _t{constructor(e,t){this.actionEventListener=e,this.crudActions=t}render(e,t,o,s,i,r,n){n.addClass(e,"ge-table-row-action-div");const l=r,d=this.getCrudActions(r).map(h=>h.elementType==="button"?this.buildButtonHtml(h,s,t,o,l):this.buildLinkHtml(h,s,t,o,l));e.innerHTML=d.join(""),this.addClickEventListeners(e,s,i)}buildButtonHtml(e,t,o,s,i){const r=e.enabled?'data-listen="click"':"disabled";return`
|
|
403
403
|
<button
|
|
404
404
|
type="button"
|
|
405
405
|
data-area="${t}"
|
|
406
406
|
data-action="${e.action}"
|
|
407
407
|
data-id="${i}"
|
|
408
|
-
data-row-index="${
|
|
409
|
-
data-col-index="${
|
|
408
|
+
data-row-index="${o}"
|
|
409
|
+
data-col-index="${s}"
|
|
410
410
|
style="height: 100%;line-height: 1;"
|
|
411
411
|
${r}
|
|
412
412
|
class="ge-table-cell-action ge-table-cell-button ${e.elementClass}">
|
|
413
413
|
${e.label}
|
|
414
|
-
</button>`}buildLinkHtml(e,t,s,
|
|
414
|
+
</button>`}buildLinkHtml(e,t,o,s,i){const r=e.enabled?'data-listen="click"':"disabled";return`
|
|
415
415
|
<a
|
|
416
416
|
href="javascript:void(0)"
|
|
417
417
|
data-area="${t}"
|
|
418
418
|
data-action="${e.action}"
|
|
419
419
|
data-id="${i}"
|
|
420
|
-
data-row-index="${
|
|
421
|
-
data-col-index="${
|
|
420
|
+
data-row-index="${o}"
|
|
421
|
+
data-col-index="${s}"
|
|
422
422
|
${r}
|
|
423
423
|
class="ge-table-cell-action ge-table-cell-link ${e.elementClass}">
|
|
424
424
|
${e.label}
|
|
425
|
-
</a>`}addClickEventListeners(e,t,
|
|
425
|
+
</a>`}addClickEventListeners(e,t,o){e.querySelectorAll(".ge-table-cell-action").forEach(i=>{i.addEventListener("click",r=>{const n=r.target;if(n){const l=this.createActionEvent(n,o);l&&this.actionEventListener.onActionEvent(l)}})})}createActionEvent(e,t){const o=e.getAttribute("data-area"),s=e.getAttribute("data-row-index"),i=e.getAttribute("data-col-index"),r=e.getAttribute("data-action")??"unknown",n=e.getAttribute("data-id")??"unknown";if(o&&s&&i){const l=q(o),a=Number(s),d=Number(i);return new He(r,l,t,a,d,n)}return null}getCrudActions(e){return Array.isArray(e)&&e.every(t=>t instanceof $)?e:this.crudActions}}const os=function(c,e,t){return c?Number(c):""};class We{constructor(e){this.options=e}static create(e){return new We(e.map(t=>new Dt(t,t)))}render(e,t,o,s,i,r,n){if(i.isEditable(t,o)){n.addClass(e,"ge-table-row-select-div");const l=i.getValueAt(t,o);let a=[];for(let h of this.options){const u=h.value===l?" selected ":"";a.push(`<option value="${h.value}" ${u}>${h.label}</option>`)}const d=a.join("");e.innerHTML=`
|
|
426
426
|
<select
|
|
427
427
|
autofocus
|
|
428
428
|
data-listen="change"
|
|
429
|
-
data-area="${
|
|
429
|
+
data-area="${s}"
|
|
430
430
|
data-row-index="${t}"
|
|
431
|
-
data-col-index="${
|
|
431
|
+
data-col-index="${o}"
|
|
432
432
|
data-input-type="text"
|
|
433
433
|
style="width:100%;height:100%;border:0;padding:0 0 0 8px;"
|
|
434
|
-
class="ge-table-cell-editor-select">${
|
|
434
|
+
class="ge-table-cell-editor-select">${d}</select>`}}}class ss extends ge{constructor(e){super("row","multi"),this.model=e}getSelectedRowItems(e){const t=this.getMergedRowIndices();return this.isAllSelected()?e:e.filter((o,s)=>t.includes(s))}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 is{constructor(e,t,o){this.r=e,this.g=t,this.b=o}}class Ee{constructor(e,t,o,s){this.minValue=e,this.minColor=t,this.maxValue=o,this.maxColor=s}}class U{static normalize(e,t,o,s=0,i=1){return(e-t)/(o-t)*(i-s)+s}static getTwoColorGradientRGB(e,t){const o=U.normalize(e,t.minValue,t.maxValue,0,1),s=t.maxColor.r-t.minColor.r,i=t.maxColor.g-t.minColor.g,r=t.maxColor.b-t.minColor.b,n=s*o+t.minColor.r,l=i*o+t.minColor.g,a=r*o+t.minColor.b;return`rgb(${Math.round(n)}, ${Math.round(l)}, ${Math.round(a)})`}static getThreeColorGradientRGB(e,t){return e<t.middleValue?U.getTwoColorGradientRGB(e,new Ee(t.minValue,t.minColor,t.middleValue,t.middleColor)):e>t.middleValue?U.getTwoColorGradientRGB(e,new Ee(t.middleValue,t.middleColor,t.maxValue,t.maxColor)):`rgb(${t.middleColor.r}, ${t.middleColor.g}, ${t.middleColor.b})`}}class rs{constructor(e,t,o,s,i,r){this.minValue=e,this.minColor=t,this.middleValue=o,this.middleColor=s,this.maxValue=i,this.maxColor=r}}class Ot{constructor(e=!0,t=!0,o=(r,n)=>r*10+10,s=50,i=450){this.autoCalc=e,this.takeHeaderLabelsIntoAccount=t,this.charCountToWidth=o,this.minWidth=s,this.maxWidth=i}}class Lt{constructor(e){this.object=e}openDialog(){const e=document.createElement("dialog");e.classList.add("ge-table-crud-object-view"),e.innerHTML=`
|
|
435
435
|
<div class="ge-table-dialog-header">Item</div>
|
|
436
436
|
<div class="ge-table-dialog-content">
|
|
437
437
|
${this.generateHtmlTable(this.object)}
|
|
@@ -449,11 +449,11 @@ render scope: this.lastFullVisibleRowIndex <- `+this.lastFullVisibleRowIndex),th
|
|
|
449
449
|
<tbody>
|
|
450
450
|
${this.generateTableRows(e)}
|
|
451
451
|
</tbody>
|
|
452
|
-
</table>`}generateTableRows(e,t=""){const
|
|
452
|
+
</table>`}generateTableRows(e,t=""){const o=[],s=(i,r=null,n=!1)=>`
|
|
453
453
|
<tr>
|
|
454
454
|
<td${n?' class="ge-table-crud-object-view-object-child"':""}>${i}</td>
|
|
455
455
|
<td>${r??""}</td>
|
|
456
|
-
</tr>`;for(const i in e){if(!e.hasOwnProperty(i))continue;const r=e[i],n=this.getCombinedKey(t,i),l=this.getLabel(n);typeof r=="object"&&r!==null?(
|
|
456
|
+
</tr>`;for(const i in e){if(!e.hasOwnProperty(i))continue;const r=e[i],n=this.getCombinedKey(t,i),l=this.getLabel(n);typeof r=="object"&&r!==null?(o.push(s(l,null,!0)),o.push(this.generateTableRows(r,n))):o.push(s(l,String(r)))}return o.join("")}}class te{constructor(e,t,o="Edit Item"){this.idKey=e,this.dialogTitle=o,this.object={...t}}openDialog(e){const t=document.createElement("dialog");t.classList.add("ge-table-crud-object-edit"),t.innerHTML=`
|
|
457
457
|
<div class="ge-table-dialog-header">${this.dialogTitle}</div>
|
|
458
458
|
<div class="ge-table-dialog-content">
|
|
459
459
|
${this.generateForm(this.object)}
|
|
@@ -462,9 +462,9 @@ render scope: this.lastFullVisibleRowIndex <- `+this.lastFullVisibleRowIndex),th
|
|
|
462
462
|
<button class="ge-table-dialog-footer-save-button primary">Save</button>
|
|
463
463
|
<button class="ge-table-dialog-footer-cancel-button">Cancel</button>
|
|
464
464
|
</div>
|
|
465
|
-
`,document.body.appendChild(t);const
|
|
465
|
+
`,document.body.appendChild(t);const o=t.querySelector(".ge-table-dialog-footer-save-button"),s=t.querySelector(".ge-table-dialog-footer-cancel-button");o.addEventListener("click",()=>{const i=t.querySelector("form"),r=new FormData(i);for(const[n,l]of r)this.setNestedValue(this.object,n,l);e(this.object),t.close(),t.remove()}),s.addEventListener("click",()=>{t.close(),t.remove()}),t.showModal()}generateForm(e,t=""){const o=[];for(const s in e){if(!e.hasOwnProperty(s)||this.idKey===s)continue;const i=this.getCombinedKey(t,s),r=this.getLabel(i),n=e[s];if(typeof n=="object"&&n!==null)o.push(this.generateForm(n,i));else{let l;typeof n=="string"?l=`<input type="text" id="${i}" name="${i}" value="${n}" />`:typeof n=="number"?l=`<input type="number" id="${i}" name="${i}" value="${n}" />`:typeof n=="boolean"?l=`<input type="checkbox" id="${i}" name="${i}" ${n?"checked":""} />`:l=`<input type="text" id="${i}" name="${i}" value="${n}" />`,o.push(`
|
|
466
466
|
<div class="form-field">
|
|
467
467
|
<label for="${i}">${r}</label>
|
|
468
468
|
${l}
|
|
469
469
|
</div>
|
|
470
|
-
`)}}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 Lt{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 Ft,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 so{constructor(){this.crudOptions=new Lt,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(w=>w.property):this.extractProperties(i[0]),h=new pe("row","multi"),u=()=>h;this.tableOptions={...new X,...t.tableOptions,hoverColumnVisible:!1,getSelectionModel:u};const f=this.calcAutoColumnWidths(i,c),p=(n=t.columnDefs)!=null&&n.length?t.columnDefs:c.map((w,S)=>new H(w,w.toUpperCase(),new y(f[S],"px")));if((l=e==null?void 0:e.columnWidths)!=null&&l.autoCalc)for(let w=0;w<p.length;w++){const S=p[w];S.width=new y(f[w],"px")}if(e.autoAddActionColumn){let w=new H("id","Actions",Rt,new M(["ge-table-text-align-left"],["ge-table-text-align-left ge-table-actions-cell"],void 0));w.rendererMap=new M(void 0,new Pt(this,e.singleRowActions),void 0),p.push(w)}const m=0,g=e.calcFixedRightColumnCount(p.length);this.tableModel=V.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 Tt(this.tableModel,this.tableOptions);s(b)}})}openDialogForCreate(){if(this.bodyModel){const e=new Be("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 Ot(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 te(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 te(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 te(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,h,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=(h=this.tableModel)==null?void 0:h.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 h=0;h<o;h++){const u=t[h],f=this.getValueByT(e[c],u),p=(f==null?void 0:f.toString().length)||0;p>r[h]&&(r[h]=p)}if(this.crudOptions.columnWidths.takeHeaderLabelsIntoAccount)for(let c=0;c<o;c++){const h=s[c].length||0;h>r[c]&&(r[c]=h)}const n=this.crudOptions.columnWidths.minWidth,l=this.crudOptions.columnWidths.maxWidth;return r.map((c,h)=>Math.min(l,Math.max(this.crudOptions.columnWidths.charCountToWidth(c,h),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 oo{constructor(e,t){this.method=e,this.url=t}}exports.AbstractAreaModel=he;exports.ActionEvent=Be;exports.ActionsCellRenderer=Pt;exports.AnyPropertyType=Pe;exports.AreaMapFactory=Ds;exports.AreaModel=Ls;exports.AreaModelArrayOfArrays=P;exports.AreaModelCellGroups=_s;exports.AreaModelHidden=F;exports.AreaModelObjectArray=O;exports.AreaModelObjectArrayWithColumndefs=Ae;exports.AreaModelTree=Ce;exports.AreaObjectMap=M;exports.ArrayPropertyType=B;exports.AutoRestoreOptions=Os;exports.AvoidDoubleExecution=$t;exports.BooleanPropertyType=Ye;exports.CellGroup=kt;exports.CellGroupExt=Dt;exports.CellGroupExtCellRenderer=re;exports.CellRange=R;exports.CellgroupFactory=T;exports.CheckboxBooleanPropertyCellRenderer=Bs;exports.CheckboxCellRenderer=Ee;exports.CheckboxColumnDef=ks;exports.CheckboxModel=Et;exports.ChunkData=Cs;exports.ColAndRowspanModel=at;exports.CollapsedExpandedData=it;exports.ColorRgb=eo;exports.ColumnDef=H;exports.ColumnDefGenerator=Vt;exports.ColumnWidths=Ft;exports.ConvenienceDomService=Ze;exports.CopyService=J;exports.CrudAction=$;exports.CrudObjectEdit=te;exports.CrudObjectView=Ot;exports.CrudOptions=Lt;exports.CrudTableModelFactory=so;exports.CssVars=ye;exports.DateToIntlDDMMYYYYCellRenderer=Ws;exports.DateToIsoCellRenderer=Hs;exports.DateToLocaleDateCellRenderer=Ns;exports.DateToTecCellRenderer=Ys;exports.DefaultRowHeights=G;exports.EleScope=lt;exports.EventAdapter=oe;exports.EventCheckboxChangedHandler=Gt;exports.ExcelService=Ct;exports.FalseFn=xe;exports.FocusModel=xt;exports.GeCellIndices=ut;exports.GeCssColorUtil=U;exports.GeFilterService=$s;exports.GeKeyEvent=Ps;exports.GeModelChangeEvent=ue;exports.GeMouseEvent=de;exports.GeoData=L;exports.Icon=_;exports.IndexAndPx=vs;exports.InputCellRenderer=wt;exports.InputHandler=ht;exports.JsonService=fe;exports.LicenseManager=W;exports.MaleFemaleToIconCellRenderer=Gs;exports.MouseHandler=et;exports.MouseTargetData=Qe;exports.MultiRowsSelectionModel=Qs;exports.NullPropertyType=Ge;exports.NumberCellProgressBarCellRenderer=zs;exports.NumberCellRenderer=Us;exports.NumberPropertyType=je;exports.ObjectPropertyType=k;exports.OsxShortcutActionIdMapping=ft;exports.PROPERTY_TYPE_KEY_ANY=Me;exports.PROPERTY_TYPE_KEY_ARRAY=De;exports.PROPERTY_TYPE_KEY_BOOLEAN=ce;exports.PROPERTY_TYPE_KEY_NULL=Ie;exports.PROPERTY_TYPE_KEY_NUMBER=ae;exports.PROPERTY_TYPE_KEY_OBJECT=Y;exports.PROPERTY_TYPE_KEY_STRING=ke;exports.PROPERTY_TYPE_KEY_UNDEFINED=j;exports.Padding=Re;exports.PositiveAndNegativeNumberRenderer=qs;exports.ProgressBarCellRenderer=Js;exports.PropertyItem=Fe;exports.PropertyTypeService=Bt;exports.RenderScope=ct;exports.Renderer=Vs;exports.RequestChunk=Mt;exports.ResizeHandler=St;exports.SchemeGenerator=Ht;exports.SelectCellRenderer=He;exports.SelectionModel=pe;exports.SelectionService=pt;exports.ShortcutService=bt;exports.SimpleArrayCellRenderer=Xs;exports.SimpleDomService=yt;exports.Size=y;exports.SortItem=dt;exports.SortedOptions=Le;exports.StarRatingCellRenderer=Ks;exports.StoreStateCollapsedExpandService=rt;exports.StoreStateScrollPosService=ot;exports.StoreStateSortingService=nt;exports.StringPropertyType=ze;exports.TableApi=st;exports.TableCellUpdateEvent=Fs;exports.TableFactory=V;exports.TableModel=ee;exports.TableModelAndOptions=Tt;exports.TableOptions=X;exports.TableScope=Ve;exports.ThreeColorGradientArg=to;exports.TreeCheckboxModel=ve;exports.TreeFactory=ie;exports.TreeOptions=Oe;exports.TreeRow=we;exports.TreeRowService=At;exports.TrueFalseCellRenderer=js;exports.TrueFn=vt;exports.TwoColorGradientArg=Te;exports.UNIMPORTANT_TYPES=K;exports.UndefinedPropertyType=Q;exports.UrlInfo=oo;exports.ValueInfo=Ue;exports.ValueLabel=It;exports.WindowsShortcutActionIdMapping=gt;exports.actionIds=Ss;exports.allCenter=Ms;exports.allLeft=Ts;exports.allRight=Is;exports.bodyCenter=As;exports.bodyLeft=Rs;exports.bodyRight=Es;exports.createHarmonizedShortcutByKeyboardEvent=be;exports.debounce=Ne;exports.editInputPipeForNumber=Zs;exports.entitySuffix=me;exports.firstLetterUppercase=Je;exports.getAreaIdentByString=q;exports.getEntityName=Ke;exports.harmonizeShortcut=mt;exports.isAreaModelTree=se;exports.isCheckboxColumnDef=qe;exports.isTreeRow=N;exports.px0=xs;exports.px10=ws;exports.px100=ds;exports.px110=cs;exports.px120=as;exports.px130=ls;exports.px140=ns;exports.px150=rs;exports.px160=is;exports.px170=os;exports.px180=ss;exports.px190=ts;exports.px20=ys;exports.px200=Se;exports.px210=es;exports.px220=Qt;exports.px230=Zt;exports.px240=qt;exports.px250=Jt;exports.px260=Xt;exports.px270=Kt;exports.px280=Ut;exports.px290=Yt;exports.px30=bs;exports.px300=Rt;exports.px40=ms;exports.px400=jt;exports.px50=fs;exports.px500=zt;exports.px60=gs;exports.px70=ps;exports.px80=us;exports.px90=hs;exports.throttle=_t;exports.trimArraySuffixes=Xe;
|
|
470
|
+
`)}}return`<form>${o.join("")}</form>`}setNestedValue(e,t,o){const s=t.split(".");let i=e;for(let r=0;r<s.length-1;r++)i[s[r]]||(i[s[r]]={}),i=i[s[r]];i[s[s.length-1]]=o}getCombinedKey(e,t){return e?`${e}.${t}`:t}getLabel(e){return e.replace(/\./g," ")}}class $t{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 Ot,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 o=e.urls.list.url,s=e.urls.list.method??"GET";return fetch(o,{headers:t,method:s}).then(i=>i.json())},this.fetchItem=(e,t)=>{var r,n;const o=e.getHeadersInit?e.getHeadersInit():{};let s=((r=e.urls.read)==null?void 0:r.url)??"";s=s.replace("{id}",t);let i=((n=e.urls.read)==null?void 0:n.method)??"GET";return fetch(s,{headers:o,method:i}).then(l=>l.json())},this.updateItem=(e,t,o)=>{var n,l;const s=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:s,method:r,body:JSON.stringify(o)}).then(a=>a.json())},this.createItem=(e,t)=>{var r,n;const o=e.getHeadersInit?e.getHeadersInit():{};let s=((r=e.urls.create)==null?void 0:r.url)??"",i=((n=e.urls.create)==null?void 0:n.method)??"POST";return fetch(s,{headers:o,method:i,body:JSON.stringify(t)}).then(l=>l.json())},this.deleteItem=(e,t)=>{var r,n;const o=e.getHeadersInit?e.getHeadersInit():{};let s=((r=e.urls.delete)==null?void 0:r.url)??"";s=s.replace("{id}",t);let i=((n=e.urls.delete)==null?void 0:n.method)??"GET";return fetch(s,{headers:o,method:i}).then(l=>l.json())},this.getEmptyItem=()=>{}}}class ns{constructor(){this.crudOptions=new $t,this.listenActionEvent=e=>{}}createTableModel(e,t,o=i=>{},s=i=>{}){this.crudOptions=e,this.listenActionEvent=s,e.fetchList(e).then(i=>{var r,n,l,a;if(t.rows=i,i!=null&&i.length){const d=(r=t.columnDefs)!=null&&r.length?t.columnDefs.map(w=>w.property):this.extractProperties(i[0]),h=new ge("row","multi"),u=()=>h;this.tableOptions={...new X,...t.tableOptions,hoverColumnVisible:!1,getSelectionModel:u};const f=this.calcAutoColumnWidths(i,d),p=(n=t.columnDefs)!=null&&n.length?t.columnDefs:d.map((w,S)=>new H(w,w.toUpperCase(),new y(f[S],"px")));if((l=e==null?void 0:e.columnWidths)!=null&&l.autoCalc)for(let w=0;w<p.length;w++){const S=p[w];S.width=new y(f[w],"px")}if(e.autoAddActionColumn){let w=new H("id","Actions",Rt,new T(["ge-table-text-align-left"],["ge-table-text-align-left ge-table-actions-cell"],void 0));w.rendererMap=new T(void 0,new _t(this,e.singleRowActions),void 0),p.push(w)}const m=0,g=e.calcFixedRightColumnCount(p.length);this.tableModel=V.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 It(this.tableModel,this.tableOptions);o(b)}})}openDialogForCreate(){if(this.bodyModel){const e=new He("CREATE","body",this.bodyModel,-1,-1,null);this.onActionEvent(e)}}onActionEvent(e){var t,o,s,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 Lt(n).openDialog(),n))}else if(e.action==="EDIT"){let r=e.id;const n=this.crudOptions.getIdKey()??"id";(o=this.crudOptions)==null||o.fetchItem(this.crudOptions,r).then(l=>(console.info(l),new te(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";(s=this.crudOptions)==null||s.fetchItem(this.crudOptions,r).then(l=>{const a=JSON.parse(JSON.stringify(l));return new te(n,a,"Clone Item").openDialog(d=>{console.info(d),this.crudOptions.createItem(this.crudOptions,d)}),a})}else if(e.action==="CREATE"){const r=this.crudOptions.getIdKey()??"id",n=JSON.parse(JSON.stringify(this.crudOptions.getEmptyItem()));return new te(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,d,h,u;return(l=this.bodyModel)==null||l.filterRowsByPredict(f=>f.id!=r),(d=(a=this.tableModel)==null?void 0:a.getTableScope())==null||d.clearSelection(!0),(u=(h=this.tableModel)==null?void 0:h.getTableScope())==null||u.repaintHard(),n})}}calcAutoColumnWidths(e,t,o=t){var a;const s=t.length;if(!((a=this.crudOptions.columnWidths)!=null&&a.autoCalc))return new Array(s).fill(200);const i=e.length??0,r=new Array(s).fill(0);for(let d=0;d<i;d++)for(let h=0;h<s;h++){const u=t[h],f=this.getValueByT(e[d],u),p=(f==null?void 0:f.toString().length)||0;p>r[h]&&(r[h]=p)}if(this.crudOptions.columnWidths.takeHeaderLabelsIntoAccount)for(let d=0;d<s;d++){const h=o[d].length||0;h>r[d]&&(r[d]=h)}const n=this.crudOptions.columnWidths.minWidth,l=this.crudOptions.columnWidths.maxWidth;return r.map((d,h)=>Math.min(l,Math.max(this.crudOptions.columnWidths.charCountToWidth(d,h),n)))}getValueByT(e,t){return t.includes(".")?this.getPropertyValue(e,t.split(".")):e[t]}getPropertyValue(e,t){const o=t.shift(),s=e[o];return s&&t.length?this.getPropertyValue(s,t):s}extractProperties(e,t="",o=[]){for(const s in e)if(e.hasOwnProperty(s)){const i=t?`${t}.${s}`:s;typeof e[s]=="object"&&e[s]!==null&&!Array.isArray(e[s])?this.extractProperties(e[s],i,o):o.push(i)}return o}}class ls{constructor(e,t){this.method=e,this.url=t}}exports.AbstractAreaModel=ue;exports.ActionEvent=He;exports.ActionsCellRenderer=_t;exports.AnyPropertyType=Pe;exports.AreaMapFactory=Oo;exports.AreaModel=Bo;exports.AreaModelArrayOfArrays=F;exports.AreaModelCellGroups=Ho;exports.AreaModelHidden=k;exports.AreaModelObjectArray=_;exports.AreaModelObjectArrayWithColumndefs=Ae;exports.AreaModelTree=ve;exports.AreaObjectMap=T;exports.ArrayPropertyType=B;exports.AutoRestoreOptions=Vo;exports.AvoidDoubleExecution=Bt;exports.BooleanPropertyType=Ue;exports.CellGroup=Pt;exports.CellGroupExt=Ft;exports.CellGroupExtCellRenderer=ne;exports.CellRange=R;exports.CellgroupFactory=E;exports.CheckboxBooleanPropertyCellRenderer=Go;exports.CheckboxCellRenderer=Me;exports.CheckboxColumnDef=_o;exports.CheckboxModel=Mt;exports.ChunkData=Mo;exports.ColAndRowspanModel=at;exports.CollapsedExpandedData=it;exports.ColorRgb=is;exports.ColumnDef=H;exports.ColumnDefGenerator=Ht;exports.ColumnWidths=Ot;exports.ConvenienceDomService=Qe;exports.CopyService=J;exports.CoverGridBodyModel=Et;exports.CoverGridFactory=Ro;exports.CoverGridTableModel=Tt;exports.CrudAction=$;exports.CrudObjectEdit=te;exports.CrudObjectView=Lt;exports.CrudOptions=$t;exports.CrudTableModelFactory=ns;exports.CssVars=we;exports.DateToIntlDDMMYYYYCellRenderer=jo;exports.DateToIsoCellRenderer=zo;exports.DateToLocaleDateCellRenderer=Yo;exports.DateToTecCellRenderer=Jo;exports.DefaultRowHeights=G;exports.EleScope=lt;exports.EventAdapter=se;exports.EventCheckboxChangedHandler=jt;exports.ExcelService=Ct;exports.FalseFn=Se;exports.FocusModel=xt;exports.GeCellIndices=ut;exports.GeCssColorUtil=U;exports.GeFilterService=Wo;exports.GeKeyEvent=Lo;exports.GeModelChangeEvent=pe;exports.GeMouseEvent=he;exports.GeoData=O;exports.Icon=L;exports.IndexAndPx=Eo;exports.InputCellRenderer=wt;exports.InputHandler=ht;exports.JsonService=me;exports.LicenseManager=W;exports.MaleFemaleToIconCellRenderer=Uo;exports.MouseHandler=tt;exports.MouseTargetData=et;exports.MultiRowsSelectionModel=ss;exports.NullPropertyType=ze;exports.NumberCellProgressBarCellRenderer=Ko;exports.NumberCellRenderer=qo;exports.NumberPropertyType=Ye;exports.ObjectPropertyType=D;exports.OsxShortcutActionIdMapping=ft;exports.PROPERTY_TYPE_KEY_ANY=Te;exports.PROPERTY_TYPE_KEY_ARRAY=De;exports.PROPERTY_TYPE_KEY_BOOLEAN=ce;exports.PROPERTY_TYPE_KEY_NULL=Ie;exports.PROPERTY_TYPE_KEY_NUMBER=de;exports.PROPERTY_TYPE_KEY_OBJECT=Y;exports.PROPERTY_TYPE_KEY_STRING=ke;exports.PROPERTY_TYPE_KEY_UNDEFINED=j;exports.Padding=re;exports.PositiveAndNegativeNumberRenderer=ts;exports.ProgressBarCellRenderer=es;exports.PropertyItem=Fe;exports.PropertyTypeService=Wt;exports.RenderScope=dt;exports.Renderer=No;exports.RequestChunk=kt;exports.ResizeHandler=St;exports.SchemeGenerator=Nt;exports.SelectCellRenderer=We;exports.SelectionModel=ge;exports.SelectionService=pt;exports.ShortcutService=bt;exports.SimpleArrayCellRenderer=Qo;exports.SimpleDomService=yt;exports.Size=y;exports.SortItem=ct;exports.SortedOptions=Oe;exports.StarRatingCellRenderer=Zo;exports.StoreStateCollapsedExpandService=rt;exports.StoreStateScrollPosService=st;exports.StoreStateSortingService=nt;exports.StringPropertyType=je;exports.TableApi=ot;exports.TableCellUpdateEvent=$o;exports.TableFactory=V;exports.TableModel=ee;exports.TableModelAndOptions=It;exports.TableOptions=X;exports.TableScope=Be;exports.ThreeColorGradientArg=rs;exports.TreeCheckboxModel=Re;exports.TreeFactory=ie;exports.TreeOptions=_e;exports.TreeRow=xe;exports.TreeRowService=At;exports.TrueFalseCellRenderer=Xo;exports.TrueFn=vt;exports.TwoColorGradientArg=Ee;exports.UNIMPORTANT_TYPES=K;exports.UndefinedPropertyType=Q;exports.UrlInfo=ls;exports.ValueInfo=Ke;exports.ValueLabel=Dt;exports.WindowsShortcutActionIdMapping=gt;exports.actionIds=Ao;exports.allCenter=Po;exports.allLeft=Do;exports.allRight=Fo;exports.bodyCenter=Io;exports.bodyLeft=To;exports.bodyRight=ko;exports.createHarmonizedShortcutByKeyboardEvent=ye;exports.debounce=Ge;exports.editInputPipeForNumber=os;exports.entitySuffix=be;exports.firstLetterUppercase=qe;exports.getAreaIdentByString=q;exports.getEntityName=Xe;exports.harmonizeShortcut=mt;exports.isAreaModelTree=oe;exports.isCheckboxColumnDef=Ze;exports.isTreeRow=N;exports.px0=vo;exports.px10=Co;exports.px100=po;exports.px110=uo;exports.px120=ho;exports.px130=co;exports.px140=ao;exports.px150=lo;exports.px160=no;exports.px170=ro;exports.px180=io;exports.px190=so;exports.px20=So;exports.px200=Ce;exports.px210=oo;exports.px220=to;exports.px230=eo;exports.px240=Qt;exports.px250=Zt;exports.px260=qt;exports.px270=Jt;exports.px280=Xt;exports.px290=Kt;exports.px30=xo;exports.px300=Rt;exports.px40=wo;exports.px400=Ut;exports.px50=yo;exports.px500=Yt;exports.px60=bo;exports.px70=mo;exports.px80=fo;exports.px90=go;exports.throttle=Vt;exports.trimArraySuffixes=Je;
|