@guiexpert/vue3-table 1.0.19 → 3.0.1
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 +3 -3
- package/index.js +151 -98
- package/lib/GuiexpertTable.vue.d.ts +9 -0
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("vue");function
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("vue");class I{constructor(){this.alreadySet=!1}static getInstance(){return I.instance||(I.instance=new I),I.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 $(h){return h&&h.type==="TreeRow"}function B(h){return h&&h.type==="AreaModelTree"}class W{constructor(e=-1,t=-1,s=-1,i=-1,o,l,n,r=0,a=0,d=0,u=""){this.rowIndex=e,this.rowTop=t,this.columnIndex=s,this.columnLeft=i,this.areaIdent=o,this.sideIdent=l,this.originalEvent=n,this.clickCount=r,this.draggingX=a,this.draggingY=d,this.action=u}clone(){return new W(this.rowIndex,this.rowTop,this.columnIndex,this.columnLeft,this.areaIdent,this.sideIdent,this.originalEvent,this.clickCount,this.draggingX,this.draggingY,this.action)}}class F{constructor(e=">",t="",s=[]){this.content=e,this.style=t,this.classes=s}}class j{constructor(e=new F(">","transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",["gt-table-tree-arrow-expanded"]),t=new F(">","",["ge-table-tree-arrow-collapsed"]),s=new F(">","color:transparent;",["gt-table-tree-arrow-hidden"]),i=new F("↕","",["gt-table-tree-arrow-expanded-all"])){this.arrowExpanded=e,this.arrowCollapsed=t,this.arrowPlaceholder=s,this.arrowExpandCollapseAll=i}}class X{constructor(e=new F("↑","",["ge-header-sorted-asc"]),t=new F("↓","",["ge-header-sorted-desc"]),s=new F("↑","color:transparent;",[])){this.iconAsc=e,this.iconDesc=t,this.iconPlaceholder=s}}class q{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,i])=>this.domService.setStyle(e,s,i+"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,i){const o=this.domService.createElement("div");return this.addClass(e,o),this.domService.setAttribute(o,"data-area",s),this.domService.setAttribute(o,"data-side",i),this.domService.appendChild(t,o),o}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,i,o,l=""){const n=t.index??-1,r=this.getDivOrCreateDiv(n,e);if(this.domService.addClass(r,"ge-table-row-div"),this.domService.addClass(r,`ge-table-row-div-${t.index}`),i==="body"&&o==="center"){const a=((t==null?void 0:t.index)??0)%2===0?"even":"odd";this.domService.addClass(r,`ge-table-row-${a}`)}if(this.domService.setStyle(r,"display","clip"),this.domService.setStyle(r,"position","absolute"),this.domService.setStyle(r,"left",`${t.left}px`),this.domService.setStyle(r,"top",`${t.top}px`),this.domService.setStyle(r,"width",`${t.width}px`),this.domService.setStyle(r,"height",`${t.height}px`),this.domService.setAttribute(r,"data-row-index",`${s}`),this.domService.setAttribute(r,"data-area",`${i}`),l){const a=this.domService.createText(l);this.domService.appendChild(r,a)}return this.domService.appendChild(e.child,r),r}addColumnDiv(e,t,s=-1,i=-1,o,l,n="",r,a,d=void 0,u){const g=a==null?void 0:a.treeOptions,m=a==null?void 0:a.showCheckboxWihoutExtraColumn,c=this.domService.createElement("div");this.domService.addClass(c,"ge-table-col-div"),this.domService.addClass(c,`ge-table-col-div-${t.index}`),this.domService.setAttribute(c,"data-col-index",`${t.index}`),this.domService.setAttribute(c,"data-row-index",`${s}`),this.domService.setAttribute(c,"data-area",`${o}`);const f=((t==null?void 0:t.index)??0)%2===0?"even":"odd";if(o==="body"&&l==="center"&&this.domService.addClass(c,`ge-table-column-${f}`),this.domService.setStyle(c,"display","clip"),this.domService.setStyle(c,"position","absolute"),this.domService.setStyle(c,"left",`${t.left}px`),this.domService.setStyle(c,"top",`${t.top}px`),this.domService.setStyle(c,"width",`${t.width}px`),this.domService.setStyle(c,"height",`${t.height}px`),r&&r!=="none"&&(this.domService.addClass(c,"ge-table-col-tree"),this.addArrowDiv(c,r,g,s,i,o)),m&&i===0&&d&&this.addCheckboxToDiv(c,d,o,s),n){const S=r!=="none"&&i===0;this.addLabelDiv(c,n,S,s,i,o)}return u&&this.addSortedIcon(c,u,a==null?void 0:a.sortedOptions,i),this.domService.appendChild(e,c),c}addCheckboxToDiv(e,t,s,i){const o=this.domService.createElement("div"),l=t==="full"?"checked":"";return o.innerHTML=`
|
|
2
2
|
<input
|
|
3
3
|
type="checkbox"
|
|
4
4
|
data-area="${s}"
|
|
5
5
|
data-row-index="${i}"
|
|
6
6
|
data-input-type="checkbox"
|
|
7
7
|
${l}
|
|
8
|
-
class="ge-table-row-checkbox"> `,this.domService.setStyle(o,"display","inline"),this.domService.setStyle(o,"width","inherit"),this.domService.setAttribute(o,"data-row-index",`${i}`),this.domService.appendChild(e,o),o}addLabelDiv(e,t="",s=!1,i=-1,o=-1,l="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",`${i}`),this.domService.setAttribute(n,"data-col-index",`${o}`),this.domService.setAttribute(n,"data-area",`${l}`),t)if(s){const r=this.domService.createText(t);this.domService.appendChild(n,r)}else{const r=this.domService.createElement("div");this.domService.appendChild(n,r);const a=this.domService.createText(t);this.domService.addClass(r,"ge-table-label"),this.domService.appendChild(r,a),this.domService.setAttribute(r,"data-row-index",`${i}`),this.domService.setAttribute(r,"data-col-index",`${o}`),this.domService.setAttribute(r,"data-area",`${l}`)}return this.domService.appendChild(e,n),n}addSortedIcon(e,t="",s=new j,i=-1){const o=this.domService.createElement("div");this.domService.addClass(o,"ge-table-sorted-icon-div"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"top","0"),this.domService.setStyle(o,"right","0"),this.domService.setStyle(o,"width","20px"),this.domService.setStyle(o,"background","transparent"),this.domService.setStyle(o,"cursor","pointer"),this.domService.setAttribute(o,"data-col-index",`${i}`),this.domService.setAttribute(o,"data-area","header");let l;t==="asc"?l=s.iconAsc:t==="desc"?l=s.iconDesc:l=s.iconPlaceholder;const n=l.content,r=this.domService.createText(n);this.domService.appendChild(o,r),l.style&&this.applyStyleString(o,l.style);for(const a of l.classes)this.domService.addClass(o,a);return this.domService.appendChild(e,o),o}addArrowDiv(e,t="none",s=new N,i=-1,o=-1,l="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",`${i}`),this.domService.setAttribute(n,"data-col-index",`${o}`),this.domService.setAttribute(n,"data-area",`${l}`);let r;t==="expanded"?r=s.arrowExpanded:t==="collapsed"?r=s.arrowCollapsed:r=s.arrowPlaceholder;const a=r.content,d=this.domService.createText(a);this.domService.appendChild(n,d),r.style&&this.applyStyleString(n,r.style);for(const u of r.classes)this.domService.addClass(n,u);return this.domService.appendChild(e,n),n}addColumnBorderDivs(e,t,s,i,o){if(e.verticalBorderVisible){const l=`ge-table-${i}-${o}-vertical-border`;this.addVerticalBorder(s,t,l)}if(e.horizontalBorderVisible){const l=`ge-table-${i}-${o}-horizontal-border`;this.addHorizontalBorder(s,t,l)}return t}addHorizontalBorder(e,t,s="ge-table-body-center-horizontal-border"){const i=this.domService.createElement("div");return this.domService.addClass(i,s),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${e.left}px`),this.domService.setStyle(i,"top",`${e.top}px`),this.domService.setStyle(i,"width",`${e.width}px`),this.domService.setStyle(i,"height","1px"),this.domService.appendChild(t,i),i}addFocusBorderDivs(e,t,s){let i=this.domService.createElement("div");return this.domService.addClass(i,"ge-table-focus-border"),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${t.left}px`),this.domService.setStyle(i,"top",`${t.top}px`),this.domService.setStyle(i,"width","1px"),this.domService.setStyle(i,"height",`${t.height}px`),this.applyStyle(i,s),this.domService.appendChild(e,i),i=this.domService.createElement("div"),this.domService.addClass(i,"ge-table-focus-border"),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${t.left+t.width-1}px`),this.domService.setStyle(i,"top",`${t.top}px`),this.domService.setStyle(i,"width","1px"),this.domService.setStyle(i,"height",`${t.height}px`),this.applyStyle(i,s),this.domService.appendChild(e,i),i=this.domService.createElement("div"),this.domService.addClass(i,"ge-table-focus-border"),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${t.left}px`),this.domService.setStyle(i,"top",`${t.top}px`),this.domService.setStyle(i,"width",`${t.width}px`),this.domService.setStyle(i,"height","1px"),this.applyStyle(i,s),this.domService.appendChild(e,i),i=this.domService.createElement("div"),this.domService.addClass(i,"ge-table-focus-border"),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${t.left}px`),this.domService.setStyle(i,"top",`${t.top+t.height-1}px`),this.domService.setStyle(i,"width",`${t.width}px`),this.domService.setStyle(i,"height","1px"),this.applyStyle(i,s),this.domService.appendChild(e,i),e}addVerticalBorder(e,t,s="ge-table-body-center-vertical-border"){const i=this.domService.createElement("div");return this.domService.addClass(i,s),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${e.left}px`),this.domService.setStyle(i,"top",`${e.top}px`),this.domService.setStyle(i,"width","1px"),this.domService.setStyle(i,"height",`${e.height}px`),this.domService.appendChild(t,i),i}addDiv(e,t,s=""){const i=this.domService.createElement("div");return s&&this.domService.addClass(i,s),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${t.left}px`),this.domService.setStyle(i,"top",`${t.top}px`),this.domService.setStyle(i,"width",`${t.width}px`),this.domService.setStyle(i,"height",`${t.height}px`),this.domService.appendChild(e,i),i}applyStyleString(e,t){const s=t.split(";").map(i=>i.trim()).filter(i=>i);for(const i of s){const[o,l]=i.split(":");this.domService.setStyle(e,o.trim(),l.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 W=h=>h==="header"?"header":h==="footer"?"footer":"body";class q{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=W(s),this.areaModel=t.tableModel.getAreaModel(this.areaIdent),this.row=this.areaModel.getRowByIndex(this.rowIdx)),e instanceof HTMLInputElement){const i=e;this.value=i.value}}}}class U{constructor(e){this.tableScope=e,this.expandedAll=!0,this.mouseDown=!1,this.dragging=!1,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=new q(e.target,this.tableScope);if(t.action==="toggleExpandCollapseAll")this.expandedAll=!this.expandedAll,this.tableScope.toggleExpandCollapseAll(this.expandedAll),e.preventDefault(),e.stopPropagation();else if(t.inputType==="checkbox"&&t.areaIdent)this.tableScope.toggleRowCheckbox(t.rowIdx,t.colIdx,t.areaIdent),e.preventDefault(),e.stopPropagation();else if(O(t.row)&&t.areaModel){const s=t.colIdx===this.getArrowColumnIndex()&&e.altKey,i=t.className.includes("ge-table-tree-arrow-div");if(console.info(i,s),s||i){e.preventDefault(),e.stopPropagation();const o=t.row;o.expanded=!o.expanded,"recalcVisibleTreeRows"in t.areaModel&&t.areaModel.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(o)}}if(t.areaIdent==="body"&&this.tableScope.tableOptions.getFocusModel){const s=this.tableScope.tableOptions.getFocusModel();s==null||s.clear(),s==null||s.setFocus(t.rowIdx,t.colIdx)}this.publishGeMouseEvent(e,1)}onHostElementDblClicked(e){if(e.target instanceof HTMLElement){const t=e.target,s=t.getAttribute("data-area"),i=W(s),o=Number(t.getAttribute("data-row-index")),l=Number(t.getAttribute("data-col-index")),n=this.tableScope.tableModel.getAreaModel(i);if(s&&i==="header")this.tableScope.tableModel.isSortable(l)&&(this.tableScope.clearSelection(),this.tableScope.onHeaderDblClicked(e,o,l));else if(t.getAttribute("data-row-index")){const r=n.getRowByIndex(o);if(s&&i==="body"&&n.isEditable(o,l)&&(this.tableScope.clearSelection(),this.tableScope.initRenderEditor(o,l)),O(r)&&l===this.getArrowColumnIndex()){e.preventDefault(),e.stopPropagation();const a=r;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)}updateCollapsedExpandedState(e){var s,i,o,l,n;const t=(i=(s=this.tableScope.tableOptions)==null?void 0:s.autoRestoreOptions)==null?void 0:i.getRowId;if(t){const r=(o=this.tableScope.storeStateCollapsedExpandService)==null?void 0:o.collapsedExpandedStateGet().mode,a=r==="collapsed"&&!e.expanded||r==="expanded"&&e.expanded,d=r==="collapsed"&&e.expanded||r==="expanded"&&!e.expanded,u=t(e.data);a?(l=this.tableScope.storeStateCollapsedExpandService)==null||l.collapsedStateIdsPush(u):d&&((n=this.tableScope.storeStateCollapsedExpandService)==null||n.collapsedStateIdsRemove(u))}}getArrowColumnIndex(){return this.tableScope.tableModel.isRowCheckboxVisible()?1:0}onMouseDown(e){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=!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}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)}}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 J{constructor(e){this.tableScope=e}updateCells(e,t=!1){this.tableScope.updateCells(e,t)}externalFilterChanged(){this.tableScope.externalFilterChanged()}scrollToPixel(e=0,t=0){}scrollToIndex(e=0,t=0){}setHeaderVisible(e=!0){}setColumnVisible(e,t=!0){}isColumnVisible(e){return!0}isHeaderVisible(){return!0}setFooterVisible(e=!0){}isFooterVisible(){return!0}repaint(){this.tableScope.repaint()}}class H{constructor(e){this.getStorageKeyFn=e}autoConvertMapToObject(e){const t={};if(e instanceof Map){const s=e;for(const i of[...s]){const[o,l]=i;t[o]=l}}return t}checkAndPersistItem(e,t){const s=this.getStorageKeyFn;if(s){const i=s();if(i){const o=i+e;if((t+"").includes("Map")){const l=this.autoConvertMapToObject(t);this.persistItem(o,l)}else this.persistItem(o,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 Q extends H{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 i=this.loadFromLocalStorage(s);this.scrollOffset=i||[0,0]}}}}class Z{constructor(e="collapsed",t=[],s=!1,i=!1){this.mode=e,this.rowIds=t,this.allCollapsed=s,this.allExpanded=i}}class ee extends H{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new Z,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,i=this.loadFromLocalStorage(s);i&&(this.collapsedExpandedState=i)}}}persist(){this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE,this.collapsedExpandedState)}}class te extends H{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;let i=this.loadFromLocalStorage(s);this.sortItems=i||[]}}}}class T{constructor(e=0,t=0,s=0,i=0,o){this.left=e,this.width=t,this.height=s,this.top=i,this.index=o}}class se{constructor(e,t,s,i){this.hostElement=e,this.tableModel=t,this.dom=s,this.tableOptions=i,this.scrollTop=0,this.areaBodyWestGeo=new T,this.areaBodyCenterGeo=new T,this.areaBodyEastGeo=new T;const o=this.hostElement;o.innerText="",this.dom.setAttribute(o,"tabindex","0"),this.dom.setStyle(this.dom.addClass("ge-table",o),"position","relative"),this.hoverRow=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-hover-row",o)),this.hoverColumn=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-hover-column",o)),this.areaHeaderWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-west",o,"header","west"))),this.areaHeaderCenter=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-center",o,"header","center"))),this.areaHeaderEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-east",o,"body","east"))),this.areaBodyWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-body ge-table-body-west",o,"body","west"))),this.areaBodyEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-body ge-table-body-east",o,"body","east"))),this.areaFooterWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-west",o,"footer","west"))),this.areaFooterCenter=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-center",o,"footer","center"))),this.areaFooterEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-east",o,"footer","east"))),this.scrollViewport=s.applyStyleOverflowAuto(this.tableOptions.overflowX??"auto",this.tableOptions.overflowY??"auto",s.applyStyleNoPadding(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-scroll-viewport",o,"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",o)),this.borderFixedWest=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-west-fixed-column-border",o)),this.borderFixedEast=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-east-fixed-column-border",o)),this.borderFooterTop=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-footer-border",o))}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 M{constructor(e,t,s,i,o=!1){this.r1=e,this.c1=t,this.r2=s,this.c2=i,this.gammaRange=o}static create(e){return e.gammaRange===void 0&&(e.gammaRange=!1),new M(e.rowIndex1,e.columnIndex1,e.rowIndex2,e.columnIndex2,e.gammaRange)}static singleCell(e,t){return new M(e,t,e,t)}static singleRow(e){return new M(e,0,e,Number.MAX_SAFE_INTEGER)}static singleColumn(e){return new M(0,e,Number.MAX_SAFE_INTEGER,e)}isInRange(e,t){return e>=this.r1&&e<=this.r2&&t>=this.c1&&t<=this.c2}}class ie{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 i=0;i<t;i++){let o=this.areaModel.getColspanAt(s,i),l=this.areaModel.getRowspanAt(s,i);if(o>1||l>1){o===0&&(o=1),l===0&&(l=1);const n=this.areaModel.hasOwnProperty("gammaCells");this.colAndRowspanRanges.push(new M(s,i,s+l-1,i+o-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 oe{constructor(e,t,s){this.header=e,this.body=t,this.footer=s}}class le extends se{constructor(e,t,s,i){var l,n;super(e,t,s,i),this.scrollLeft=0,this.scrollViewportLeft=0,this.scrollFactorY=0,this.scrollFactorX=0,this.cleanupFunctions={header:[],body:[],footer:[]},this.tree=!1,this.colAndRowspanModels=new oe,this.firstVisibleRowIndex=-1,this.draggingTargetColumnIndex=-1,this.removables=[],this.editing=!1,this.tableModel.getSelectionModel?this.getSelectionModel=this.tableModel.getSelectionModel:(l=this.tableOptions)!=null&&l.getSelectionModel&&(this.getSelectionModel=this.tableOptions.getSelectionModel),(n=this.tableOptions)!=null&&n.getFocusModel&&(this.getFocusModel=this.tableOptions.getFocusModel),$(t.getAreaModel("body"))&&(this.tree=!0),["header","body","footer"].forEach(r=>{var a;this.colAndRowspanModels[r]=new ie(t,t.getAreaModel(r)),(a=this.colAndRowspanModels[r])==null||a.init()})}isEditing(){return this.editing}resetEditorRenderer(){this.editorRenderer=void 0,this.editorRendererRow=-1,this.editorRendererColumn=-1,this.editing=!1}clearSelection(){if(this.getSelectionModel){const e=this.getSelectionModel();e==null||e.clear()}}initRenderEditor(e,t){var i;let s=(i=this.tableModel.getColumnDef(t))==null?void 0:i.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 o=document.querySelector("input.ge-table-cell-editor-input");o&&o.focus()}else this.resetEditorRenderer()}repaint(){this.adjustAfterScrolling()}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 T(0,this.hostElement.clientWidth,1,0),this.hostElement,"ge-table-border")),this.tableOptions.tableBottomBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new T(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 T(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 T(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()}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 i=(s=e.closest("["+t+"]"))==null?void 0:s.getAttribute(t);if(i)return Number(i)}return-1}getStringByAttr(e,t){var s;if(e){const i=(s=e.closest("["+t+"]"))==null?void 0:s.getAttribute(t);if(i)return i}return""}adjustArea(e,t=0){var S;const s=this.getArea(e,"west"),i=this.getArea(e,"center"),o=this.getArea(e,"east"),l=i.child.clientHeight;s.child.innerText="",i.child.innerText="",o.child.innerText="";const n=0,r=this.areaBodyCenterGeo.width,a=this.tableModel.getPadding(),d=this.tableModel.getAreaModel(e),u=d.getRowCount();for(;this.cleanupFunctions[e].length;){const p=this.cleanupFunctions[e].shift();p&&p()}let g=t;const m=this.tableModel.getColumnCount(),c=this.tableModel.getFixedRightColumnCount(),f=this.tableModel.getFixedLeftColumnCount();for(let p=0;p<u;p++){const w=g,C=p===u-1,x=this.tableModel.getRowHeight(e,p);if(w+x>0){this.firstVisibleRowIndex=p;let y={left:n,width:r,height:x,top:w,index:p},v=this.dom.addRowDiv(i,y,p,e,"center");const E=f;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:d,geo:y,parent:v,rowIndex:p,columnIndexStart:E,columnIndexEnd:m-c-1,verticalFixed:!1,lastRowOfModel:C}),a.left>0&&(y={left:n,width:this.areaBodyWestGeo.width,height:x,top:w,index:p},v=this.dom.addRowDiv(s,y,p,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:d,geo:y,parent:v,rowIndex:p,columnIndexStart:0,columnIndexEnd:E-1,verticalFixed:!0,lastRowOfModel:C})),a.right>0&&(y={left:n,width:this.areaBodyEastGeo.width,height:x,top:w,index:p},v=this.dom.addRowDiv(o,y,p,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:d,geo:y,parent:v,rowIndex:p,columnIndexStart:m-c,columnIndexEnd:m-1,verticalFixed:!0,lastRowOfModel:C})),e==="header"&&this.tree&&p===u-1){const A=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(v,new T(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),R=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(R){const I=this.dom.domService.createText(R.content);this.dom.domService.appendChild(A,I),R.style&&this.dom.applyStyleString(A,R.style)}}}if(g=g+x,g>l)break}if(this.colAndRowspanModels&&this.colAndRowspanModels[e]){const p=((S=this.colAndRowspanModels[e])==null?void 0:S.getRanges())??[];if(p.length)for(const w of p){let C=0,x=i.child,y="center";if(w.c1<f)x=s.child,y="west";else if(c>0&&w.c1>=m-c)x=o.child,y="east";else{const v=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();C=this.scrollFactorX*v-this.areaBodyWestGeo.width,y="center"}this.drawBigCell(w,C,t,d,x,y)}}}drawBigCell(e,t,s,i,o,l){const n=s+this.getRowHeights(0,e.r1-1,i).reduce((S,p)=>S+p,0),r=this.tableModel.getColumnCount(),a=this.tableModel.getFixedRightColumnCount();let d=0;a>0&&e.c1>=r-a&&(d=r-a);const u=t+this.getColumnWidths(d,e.c1-1).reduce((S,p)=>S+p,0),g=this.getRowHeights(e.r1,e.r2,i).reduce((S,p)=>S+p,0),m=this.getColumnWidths(e.c1,e.c2).reduce((S,p)=>S+p,0);let c=!1;const f=this.getSelectionModel?this.getSelectionModel():void 0;f&&(c=f.getSelectionCount(e.r1,e.c1)>0),e.gammaRange?(console.info("TODO here",e),this.renderCell({areaModel:i,areaIdent:i.areaIdent,sideIdent:l,rowIndex:e.r1,columnIndex:e.c1,left:u,top:n,width:m,height:g,parent:o,cellSelected:c,lastRowOfModel:!0,gammaRange:e.gammaRange})):this.renderCell({areaModel:i,areaIdent:i.areaIdent,sideIdent:l,rowIndex:e.r1,columnIndex:e.c1,left:u,top:n,width:m,height:g,parent:o,cellSelected:c,lastRowOfModel:!0,gammaRange:e.gammaRange}),i.areaIdent==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:e.r1,columnIndex:e.c1,cellLeft:u,cellTop:n,cellWidth:m,cellHeight:g,parent:o})}findRowOfImportantRowspanCell(e,t,s){const i=e.getMaxRowspan();for(let o=t-1;o>-1;o--){const l=e.getRowspanAt(o,s);if(l>1&&o+l+1>=t)return o;if(t-o>i)return-1}return-1}adjustColumnsToRowParent({areaIdent:e,sideIdent:t,areaModel:s,geo:i,parent:o,rowIndex:l,columnIndexStart:n,columnIndexEnd:r,verticalFixed:a=!1,lastRowOfModel:d=!1}){var f;this.scrollViewportLeft=this.scrollViewport.scrollLeft;let u=0;if(!a){const S=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();u=this.scrollFactorX*S}const g=0,m=!!(e==="body"&&t);let c=u;for(let S=n;S<=r;S++){const p=c,w=this.tableModel.getColumnWidth(S);if(w>0&&p+w>0){let C=i.height;const x=s.getRowspanAt(l,S),y=s.getColspanAt(l,S);x>1&&(C=this.getRowHeights(l,l+x-1,s).reduce((A,R)=>A+R,0));let v=w;y>1&&(v=this.getColumnWidths(S,S+y-1).reduce((A,R)=>A+R,0));let E=!1;if(this.colAndRowspanModels&&this.colAndRowspanModels[e]&&(f=this.colAndRowspanModels[e])!=null&&f.isInRange(l,S)&&(E=!0),this.draggingTargetColumnIndex===S&&e!=="header"){this.renderDragTargetDiv(o,p,g,v,C);const A={left:p,top:g,width:v,height:C};this.dom.addColumnBorderDivs(this.tableOptions,o,A,e,t)}else{const A=this.renderSelectedBackgroundDiv(E,m,t,s,l,S,o,p,g,v,C);E||this.renderCell({areaModel:s,areaIdent:e,sideIdent:t,rowIndex:l,columnIndex:S,left:p,top:g,width:v,height:C,parent:o,cellSelected:A,lastRowOfModel:d,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:l,columnIndex:S,cellLeft:p,cellTop:g,cellWidth:v,cellHeight:C,parent:o})}}if(c=c+w,c>this.areaBodyCenterGeo.width)break}this.tableOptions.verticalBorderVisible&&this.dom.addVerticalBorder(new T(c-1,1,i.height,0),o)}getTreeArrowColumnIndex(){return this.tableOptions.showCheckboxWihoutExtraColumn?0:this.tableModel.isRowCheckboxVisible()?1:0}addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:i,index:o,left:l,width:n,height:r,top:a,parent:d,lastRowOfModel:u,gammaRange:g}){var V;const c=this.editorRenderer&&this.editorRendererRow===i&&this.editorRendererColumn===o?this.editorRenderer:e.getCellRenderer(i,o),f={left:l,width:n,height:r,top:a,index:o},S=e.getRowByIndex(i);let p="none";if(o===this.getTreeArrowColumnIndex()&&O(S)){const b=S;(V=b.children)!=null&&V.length?b.expanded?p="expanded":p="collapsed":p="hidden"}let C;if(t==="header"){const b=this.tableModel.getColumnDef(o);(!(b!=null&&b.sortIconVisible)||b!=null&&b.sortIconVisible())&&(C=b==null?void 0:b.sortState)}const x=e.getValueAt(i,o),y=c?"":`${x}`,v=e.isRowChecked(i),E=this.dom.addColumnDiv(d,f,i,o,t,s,y,p,this.tableOptions,v,C),A=e.getTooltipAt(i,o);A&&this.dom.setAttribute(E,"title",A);const R=this.tableModel.getColumnDef(o);R&&R.classes[t]&&this.dom.addClasses(R.classes[t],E);let I;c&&(I=c.render(E,i,o,t,e,x,this.dom.domService));const k=e.getCustomClassesAt(i,o);if(k.length&&this.dom.addClasses(k,E),this.dom.addColumnBorderDivs(this.tableOptions,d,f,t,s),u&&this.dom.addHorizontalBorder({left:l,width:n,height:r,top:a+r},d),this.getFocusModel&&t==="body"){const b=this.getFocusModel();b!=null&&b.hasFocus(i,o)&&this.dom.addFocusBorderDivs(d,f,{})}t==="header"&&this.dom.setAttribute(E,"data-ge-action","drag-column");const L=e.getCustomStyleAt(i,o);if(L)for(const b in L)this.dom.setStyle(E,b,L[b]);return[E,I]}applyCssClasses(e,t={}){e&&Object.entries(t).forEach(([s,i])=>{i?this.dom.addClass(s,e):this.dom.removeClass(s,e)})}rerenderCellContent({area:e,rowIndex:t,columnIndex:s,value:i,cssClasses:o}){const l=this.tableModel.getAreaModel(e),n='div[data-col-index="'+s+'"][data-row-index="'+t+'"][data-area="'+e+'"]',r=document.querySelector(n);if(r){let a;const u=this.editorRenderer&&this.editorRendererRow===t&&this.editorRendererColumn===s?this.editorRenderer:l.getCellRenderer(t,s);if(r.innerText="",this.applyCssClasses(r,o),u)a=u.render(r,t,s,e,l,i,this.dom.domService),a&&this.cleanupFunctions[e].push(a);else{const c=`${i}`;this.dom.addLabelDiv(r,c,!1,t,s,e)}const g=l.getCustomClassesAt(t,s);g.length&&this.dom.addClasses(g,r);const m=l.getCustomStyleAt(t,s);if(m)for(const c in m)this.dom.setStyle(r,c,m[c])}}getColumnWidths(e,t){const s=[];for(let i=e;i<=t;i++)s.push(this.tableModel.getColumnWidth(i));return s}getRowHeights(e,t,s){const i=[];for(let o=e;o<=t;o++)i.push(s.getRowHeight(o));return i}adjustHoverRows(e){if(this.tableOptions.hoverRowVisible&&e.rowIndex>-1){const t=this.hostElement.clientWidth,s=this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex),i=e.rowTop+this.areaHeaderCenter.parent.clientHeight-this.scrollTop;this.dom.applyStyle(this.hoverRow,{left:"0",top:i+"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),i=this.areaBodyWestGeo.width,o=e.columnLeft+this.tableModel.getPadding().left-this.scrollLeft-i;this.dom.applyStyle(this.hoverColumn,{left:o+"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)}renderDragTargetDiv(e,t,s,i,o){const l=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass("ge-table-drop-zone",e));return this.dom.setStyle(l,"left",`${t}px`),this.dom.setStyle(l,"top",`${s}px`),this.dom.setStyle(l,"width",`${i}px`),this.dom.setStyle(l,"height",`${o}px`),l}renderSelectedBackgroundDiv(e,t,s,i,o,l,n,r,a,d,u){let g=!1;if(!e&&t&&i.isSelectable(o,l)&&this.getSelectionModel){const m=this.getSelectionModel();if(m){const c=m.getSelectionCount(o,l);g=c>0;for(let f=0;f<c;f++){const S=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`,n));this.dom.setStyle(S,"left",`${r}px`),this.dom.setStyle(S,"top",`${a}px`),this.dom.setStyle(S,"width",`${d}px`),this.dom.setStyle(S,"height",`${u}px`)}}}return g}renderCell({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:i,columnIndex:o,left:l,top:n,width:r,height:a,parent:d,cellSelected:u,lastRowOfModel:g,gammaRange:m}){const[c,f]=this.addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:i,index:o,left:l,width:r,height:a,top:n,parent:d,lastRowOfModel:g,gammaRange:m});u&&this.dom.addClass(`ge-table-${t}-${s}-selected-range`,c),f&&this.cleanupFunctions[t].push(f)}renderHeaderCellResizeHandle({rowIndex:e,columnIndex:t,cellLeft:s,cellTop:i,cellWidth:o,cellHeight:l,parent:n}){const r=this.dom.domService,a=this.tableOptions.columnResizeHandleWidthInPx??2,d=r.createElement("div");r.setAttribute(d,"data-col-index",`${t}`),r.setAttribute(d,"data-row-index",`${e}`),r.setAttribute(d,"data-area","header"),r.setAttribute(d,"data-ge-action","resize-column"),r.addClass(d,"ge-table-column-resize-handle"),r.setStyle(d,"display","clip"),r.setStyle(d,"position","absolute"),r.setStyle(d,"cursor","col-resize"),r.setStyle(d,"left",`${s+o-a}px`),r.setStyle(d,"top",`${i}px`),r.setStyle(d,"width",`${a}px`),r.setStyle(d,"height",`${l}px`),r.appendChild(n,d)}}class re{constructor(e,t){this.columnIndex=e,this.sortState=t}}class ne{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"),i=t.getAttribute("data-row-index"),o=t.getAttribute("data-col-index");if(s&&i&&o){const l=W(s),n=Number(i),r=Number(o);this.tableScope.updateModelValueAfterEdit(l,n,r,t.value)}}}}class ae{constructor(e=-1,t=-1){this.rowIndex=e,this.columnIndex=t}}class _{constructor(e){this.cells=e}static createSingle(e,t){return new _([new ae(e,t)])}}class de{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 o,l,n,r,a,d,u;let s=!1,i=!1;if(this.getSelectionModel&&this.getFocusModel){const g=this.getSelectionModel(),m=this.getFocusModel();g&&m&&(m.hasFocus(e.rowIndex,e.columnIndex)||(m.setFocus(e.rowIndex,e.columnIndex),s=!0),(o=e.originalEvent)!=null&&o.shiftKey||g.hasSelection()&&(g.clear(),s=!0),(l=e.originalEvent)!=null&&l.shiftKey&&this.previousEvt?(g.addSelection(this.createRangeByEvents(e,this.previousEvt)),i=!0,s=!0):(n=e.originalEvent)!=null&&n.ctrlKey||(r=e.originalEvent)!=null&&r.metaKey?(g.addSelection(M.singleCell(e.rowIndex,e.columnIndex)),i=!0,s=!0):(a=e.originalEvent)!=null&&a.altKey&&((d=e.originalEvent)!=null&&d.ctrlKey||(u=e.originalEvent)!=null&&u.metaKey)&&(g.removeSelection(M.singleCell(e.rowIndex,e.columnIndex)),i=!0,s=!0))}return i?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[i,o]=s.getFocus();return t.togglePoint(i,o),this.tableScope.repaint(),!0}}}return!1}createRangeByEvents(e,t){t||(t=e);const s=Math.min(e.rowIndex,t==null?void 0:t.rowIndex),i=Math.max(e.rowIndex,t==null?void 0:t.rowIndex),o=Math.min(e.columnIndex,t==null?void 0:t.columnIndex),l=Math.max(e.columnIndex,t==null?void 0:t.columnIndex);return M.create({rowIndex1:s,columnIndex1:o,rowIndex2:i,columnIndex2:l})}}class he{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","cmd -":"DESELECT_ALL",arrowup:"NAVIGATE_UP",arrowdown:"NAVIGATE_DOWN",arrowleft:"NAVIGATE_LEFT",arrowright:"NAVIGATE_RIGHT"}}}class ce{get(){return{f2:"START_EDITING",space:"TOGGLE_SELECTION","ctrl+num_add":"SELECT_ALL","cmd+a":"SELECT_ALL","ctrl+a":"SELECT_ALL","cmd+x":"DESELECT_ALL","cmd+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"}}}class pe{constructor(e){this.tableScope=e,this.shortcutActionIdMapping={},this.listener=[],this.listener.push(e),this.init()}addListener(e){this.listener.includes(e)||this.listener.push(e)}init(){this.isMacintosh()?Object.assign(this.shortcutActionIdMapping,new ce().get()):Object.assign(this.shortcutActionIdMapping,new he().get()),Object.assign(this.shortcutActionIdMapping,this.tableScope.tableOptions.shortcutActionIdMapping),this.isDebug()&&console.debug("ShortcutService",this.shortcutActionIdMapping),this.tableScope.hostElement.addEventListener("keydown",this.onKeyDown.bind(this))}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.findEnty(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}findEnty(e){const t=this.getTokenByEvent(e);this.isDebug()&&console.debug("ShortcutService tokens:",t);for(const s in this.shortcutActionIdMapping){const i=s.replace(/opt/g,"alt").replace(/cmd/g,"meta").split(/[\+ ]/g).sort();if(this.areTokensEquals(t,i))return this.shortcutActionIdMapping[s]}}areTokensEquals(e,t){if(e.length!==t.length||e.length===0)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}getTokenByEvent(e){const t=[];return e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.code&&t.push(e.code.toLowerCase().replace(/key/g,"")),t.sort()}}class G{onCheckboxChanged(e){}onContextmenu(e){}onModelChanged(e){}onMouseClicked(e){}onMouseDragging(e){}onMouseDraggingEnd(e){}onMouseMoved(e){}}class X{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 ue{render(e,t,s,i,o,l,n){if(o.isEditable(t,s)){n.addClass(e,"ge-table-row-input-div");const r=o.getValueAt(t,s);e.innerHTML=`
|
|
8
|
+
class="ge-table-row-checkbox"> `,this.domService.setStyle(o,"display","inline"),this.domService.setStyle(o,"width","inherit"),this.domService.setAttribute(o,"data-row-index",`${i}`),this.domService.appendChild(e,o),o}addLabelDiv(e,t="",s=!1,i=-1,o=-1,l="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",`${i}`),this.domService.setAttribute(n,"data-col-index",`${o}`),this.domService.setAttribute(n,"data-area",`${l}`),t)if(s){const r=this.domService.createText(t);this.domService.appendChild(n,r)}else{const r=this.domService.createElement("div");this.domService.appendChild(n,r);const a=this.domService.createText(t);this.domService.addClass(r,"ge-table-label"),this.domService.appendChild(r,a),this.domService.setAttribute(r,"data-row-index",`${i}`),this.domService.setAttribute(r,"data-col-index",`${o}`),this.domService.setAttribute(r,"data-area",`${l}`)}return this.domService.appendChild(e,n),n}addSortedIcon(e,t="",s=new X,i=-1){const o=this.domService.createElement("div");this.domService.addClass(o,"ge-table-sorted-icon-div"),this.domService.setStyle(o,"position","absolute"),this.domService.setStyle(o,"top","0"),this.domService.setStyle(o,"right","0"),this.domService.setStyle(o,"width","20px"),this.domService.setStyle(o,"background","transparent"),this.domService.setStyle(o,"cursor","pointer"),this.domService.setAttribute(o,"data-col-index",`${i}`),this.domService.setAttribute(o,"data-area","header");let l;t==="asc"?l=s.iconAsc:t==="desc"?l=s.iconDesc:l=s.iconPlaceholder;const n=l.content,r=this.domService.createText(n);this.domService.appendChild(o,r),l.style&&this.applyStyleString(o,l.style);for(const a of l.classes)this.domService.addClass(o,a);return this.domService.appendChild(e,o),o}addArrowDiv(e,t="none",s=new j,i=-1,o=-1,l="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",`${i}`),this.domService.setAttribute(n,"data-col-index",`${o}`),this.domService.setAttribute(n,"data-area",`${l}`);let r;t==="expanded"?r=s.arrowExpanded:t==="collapsed"?r=s.arrowCollapsed:r=s.arrowPlaceholder;const a=r.content,d=this.domService.createText(a);this.domService.appendChild(n,d),r.style&&this.applyStyleString(n,r.style);for(const u of r.classes)this.domService.addClass(n,u);return this.domService.appendChild(e,n),n}addColumnBorderDivs(e,t,s,i,o){if(e.verticalBorderVisible){const l=`ge-table-${i}-${o}-vertical-border`;this.addVerticalBorder(s,t,l)}if(e.horizontalBorderVisible){const l=`ge-table-${i}-${o}-horizontal-border`;this.addHorizontalBorder(s,t,l)}return t}addHorizontalBorder(e,t,s="ge-table-body-center-horizontal-border"){const i=this.domService.createElement("div");return this.domService.addClass(i,s),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${e.left}px`),this.domService.setStyle(i,"top",`${e.top}px`),this.domService.setStyle(i,"width",`${e.width}px`),this.domService.setStyle(i,"height","1px"),this.domService.appendChild(t,i),i}addFocusBorderDivs(e,t,s){let i=this.domService.createElement("div");return this.domService.addClass(i,"ge-table-focus-border"),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${t.left}px`),this.domService.setStyle(i,"top",`${t.top}px`),this.domService.setStyle(i,"width","1px"),this.domService.setStyle(i,"height",`${t.height}px`),this.applyStyle(i,s),this.domService.appendChild(e,i),i=this.domService.createElement("div"),this.domService.addClass(i,"ge-table-focus-border"),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${t.left+t.width-1}px`),this.domService.setStyle(i,"top",`${t.top}px`),this.domService.setStyle(i,"width","1px"),this.domService.setStyle(i,"height",`${t.height}px`),this.applyStyle(i,s),this.domService.appendChild(e,i),i=this.domService.createElement("div"),this.domService.addClass(i,"ge-table-focus-border"),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${t.left}px`),this.domService.setStyle(i,"top",`${t.top}px`),this.domService.setStyle(i,"width",`${t.width}px`),this.domService.setStyle(i,"height","1px"),this.applyStyle(i,s),this.domService.appendChild(e,i),i=this.domService.createElement("div"),this.domService.addClass(i,"ge-table-focus-border"),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${t.left}px`),this.domService.setStyle(i,"top",`${t.top+t.height-1}px`),this.domService.setStyle(i,"width",`${t.width}px`),this.domService.setStyle(i,"height","1px"),this.applyStyle(i,s),this.domService.appendChild(e,i),e}addVerticalBorder(e,t,s="ge-table-body-center-vertical-border"){const i=this.domService.createElement("div");return this.domService.addClass(i,s),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${e.left}px`),this.domService.setStyle(i,"top",`${e.top}px`),this.domService.setStyle(i,"width","1px"),this.domService.setStyle(i,"height",`${e.height}px`),this.domService.appendChild(t,i),i}addDiv(e,t,s=""){const i=this.domService.createElement("div");return s&&this.domService.addClass(i,s),this.domService.setStyle(i,"display","clip"),this.domService.setStyle(i,"position","absolute"),this.domService.setStyle(i,"left",`${t.left}px`),this.domService.setStyle(i,"top",`${t.top}px`),this.domService.setStyle(i,"width",`${t.width}px`),this.domService.setStyle(i,"height",`${t.height}px`),this.domService.appendChild(e,i),i}applyStyleString(e,t){const s=t.split(";").map(i=>i.trim()).filter(i=>i);for(const i of s){const[o,l]=i.split(":");this.domService.setStyle(e,o.trim(),l.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 H=h=>h==="header"?"header":h==="footer"?"footer":"body";class U{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=H(s),this.areaModel=t.tableModel.getAreaModel(this.areaIdent),this.row=this.areaModel.getRowByIndex(this.rowIdx)),e instanceof HTMLInputElement){const i=e;this.value=i.value}}}}class J{constructor(e){this.tableScope=e,this.expandedAll=!0,this.mouseDown=!1,this.dragging=!1,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=new U(e.target,this.tableScope);if(t.action==="toggleExpandCollapseAll")this.expandedAll=!this.expandedAll,this.tableScope.toggleExpandCollapseAll(this.expandedAll),e.preventDefault(),e.stopPropagation();else if(t.inputType==="checkbox"&&t.areaIdent)this.tableScope.toggleRowCheckbox(t.rowIdx,t.colIdx,t.areaIdent),e.preventDefault(),e.stopPropagation();else if($(t.row)&&t.areaModel){const s=t.colIdx===this.getArrowColumnIndex()&&e.altKey,i=t.className.includes("ge-table-tree-arrow-div");if(console.info(i,s),s||i){e.preventDefault(),e.stopPropagation();const o=t.row;o.expanded=!o.expanded,"recalcVisibleTreeRows"in t.areaModel&&t.areaModel.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(o)}}if(t.areaIdent==="body"&&this.tableScope.tableOptions.getFocusModel){const s=this.tableScope.tableOptions.getFocusModel();s==null||s.clear(),s==null||s.setFocus(t.rowIdx,t.colIdx)}this.publishGeMouseEvent(e,1)}onHostElementDblClicked(e){if(e.target instanceof HTMLElement){const t=e.target,s=t.getAttribute("data-area"),i=H(s),o=Number(t.getAttribute("data-row-index")),l=Number(t.getAttribute("data-col-index")),n=this.tableScope.tableModel.getAreaModel(i);if(s&&i==="header")this.tableScope.tableModel.isSortable(l)&&(this.tableScope.clearSelection(),this.tableScope.onHeaderDblClicked(e,o,l));else if(t.getAttribute("data-row-index")){const r=n.getRowByIndex(o);if(s&&i==="body"&&n.isEditable(o,l)&&(this.tableScope.clearSelection(),this.tableScope.initRenderEditor(o,l)),$(r)&&l===this.getArrowColumnIndex()){e.preventDefault(),e.stopPropagation();const a=r;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)}updateCollapsedExpandedState(e){var s,i,o,l,n;const t=(i=(s=this.tableScope.tableOptions)==null?void 0:s.autoRestoreOptions)==null?void 0:i.getRowId;if(t){const r=(o=this.tableScope.storeStateCollapsedExpandService)==null?void 0:o.collapsedExpandedStateGet().mode,a=r==="collapsed"&&!e.expanded||r==="expanded"&&e.expanded,d=r==="collapsed"&&e.expanded||r==="expanded"&&!e.expanded,u=t(e.data);a?(l=this.tableScope.storeStateCollapsedExpandService)==null||l.collapsedStateIdsPush(u):d&&((n=this.tableScope.storeStateCollapsedExpandService)==null||n.collapsedStateIdsRemove(u))}}getArrowColumnIndex(){return this.tableScope.tableModel.isRowCheckboxVisible()?1:0}onMouseDown(e){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=!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}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)}}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 Q{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()}}class P{constructor(e){this.getStorageKeyFn=e}autoConvertMapToObject(e){const t={};if(e instanceof Map){const s=e;for(const i of[...s]){const[o,l]=i;t[o]=l}}return t}checkAndPersistItem(e,t){const s=this.getStorageKeyFn;if(s){const i=s();if(i){const o=i+e;if((t+"").includes("Map")){const l=this.autoConvertMapToObject(t);this.persistItem(o,l)}else this.persistItem(o,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 Z extends P{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 i=this.loadFromLocalStorage(s);this.scrollOffset=i||[0,0]}}}}class ee{constructor(e="collapsed",t=[],s=!1,i=!1){this.mode=e,this.rowIds=t,this.allCollapsed=s,this.allExpanded=i}}class te extends P{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new ee,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,i=this.loadFromLocalStorage(s);i&&(this.collapsedExpandedState=i)}}}persist(){this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE,this.collapsedExpandedState)}}class se extends P{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;let i=this.loadFromLocalStorage(s);this.sortItems=i||[]}}}}class T{constructor(e=0,t=0,s=0,i=0,o){this.left=e,this.width=t,this.height=s,this.top=i,this.index=o}}class ie{constructor(e,t,s,i){this.hostElement=e,this.tableModel=t,this.dom=s,this.tableOptions=i,this.scrollTop=0,this.areaBodyWestGeo=new T,this.areaBodyCenterGeo=new T,this.areaBodyEastGeo=new T;const o=this.hostElement;o.innerText="",this.dom.setAttribute(o,"tabindex","0"),this.dom.setStyle(this.dom.addClass("ge-table",o),"position","relative"),this.hoverRow=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-hover-row",o)),this.hoverColumn=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-hover-column",o)),this.areaHeaderWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-west",o,"header","west"))),this.areaHeaderCenter=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-center",o,"header","center"))),this.areaHeaderEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-header ge-table-header-east",o,"body","east"))),this.areaBodyWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-body ge-table-body-west",o,"body","west"))),this.areaBodyEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-body ge-table-body-east",o,"body","east"))),this.areaFooterWest=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-west",o,"footer","west"))),this.areaFooterCenter=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-center",o,"footer","center"))),this.areaFooterEast=s.appendRelativeChildDiv(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-footer ge-table-footer-east",o,"footer","east"))),this.scrollViewport=s.applyStyleOverflowAuto(this.tableOptions.overflowX??"auto",this.tableOptions.overflowY??"auto",s.applyStyleNoPadding(s.applyStylePosistionAbsolute(s.createAreaDivWithClass("ge-table-scroll-viewport",o,"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",o)),this.borderFixedWest=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-west-fixed-column-border",o)),this.borderFixedEast=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-east-fixed-column-border",o)),this.borderFooterTop=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-footer-border",o))}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 M{constructor(e,t,s,i,o=!1){this.r1=e,this.c1=t,this.r2=s,this.c2=i,this.gammaRange=o}static create(e){return e.gammaRange===void 0&&(e.gammaRange=!1),new M(e.rowIndex1,e.columnIndex1,e.rowIndex2,e.columnIndex2,e.gammaRange)}static singleCell(e,t){return new M(e,t,e,t)}static singleRow(e){return new M(e,0,e,Number.MAX_SAFE_INTEGER)}static singleColumn(e){return new M(0,e,Number.MAX_SAFE_INTEGER,e)}isInRange(e,t){return e>=this.r1&&e<=this.r2&&t>=this.c1&&t<=this.c2}}class oe{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 i=0;i<t;i++){let o=this.areaModel.getColspanAt(s,i),l=this.areaModel.getRowspanAt(s,i);if(o>1||l>1){o===0&&(o=1),l===0&&(l=1);const n=this.areaModel.hasOwnProperty("gammaCells");this.colAndRowspanRanges.push(new M(s,i,s+l-1,i+o-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 le{constructor(e,t,s){this.header=e,this.body=t,this.footer=s}}class re extends ie{constructor(e,t,s,i){var l,n;super(e,t,s,i),this.scrollLeft=0,this.scrollViewportLeft=0,this.scrollFactorY=0,this.scrollFactorX=0,this.cleanupFunctions={header:[],body:[],footer:[]},this.tree=!1,this.colAndRowspanModels=new le,this.firstVisibleRowIndex=-1,this.draggingTargetColumnIndex=-1,this.removables=[],this.editing=!1,this.tableModel.getSelectionModel?this.getSelectionModel=this.tableModel.getSelectionModel:(l=this.tableOptions)!=null&&l.getSelectionModel&&(this.getSelectionModel=this.tableOptions.getSelectionModel),(n=this.tableOptions)!=null&&n.getFocusModel&&(this.getFocusModel=this.tableOptions.getFocusModel),B(t.getAreaModel("body"))&&(this.tree=!0),["header","body","footer"].forEach(r=>{var a;this.colAndRowspanModels[r]=new oe(t,t.getAreaModel(r)),(a=this.colAndRowspanModels[r])==null||a.init()})}isEditing(){return this.editing}resetEditorRenderer(){this.editorRenderer=void 0,this.editorRendererRow=-1,this.editorRendererColumn=-1,this.editing=!1}clearSelection(){if(this.getSelectionModel){const e=this.getSelectionModel();e==null||e.clear()}}initRenderEditor(e,t){var i;let s=(i=this.tableModel.getColumnDef(t))==null?void 0:i.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 o=document.querySelector("input.ge-table-cell-editor-input");o&&o.focus()}else this.resetEditorRenderer()}repaint(){this.adjustAfterScrolling()}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 T(0,this.hostElement.clientWidth,1,0),this.hostElement,"ge-table-border")),this.tableOptions.tableBottomBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new T(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 T(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 T(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()}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 i=(s=e.closest("["+t+"]"))==null?void 0:s.getAttribute(t);if(i)return Number(i)}return-1}getStringByAttr(e,t){var s;if(e){const i=(s=e.closest("["+t+"]"))==null?void 0:s.getAttribute(t);if(i)return i}return""}adjustArea(e,t=0){var S;const s=this.getArea(e,"west"),i=this.getArea(e,"center"),o=this.getArea(e,"east"),l=i.child.clientHeight;s.child.innerText="",i.child.innerText="",o.child.innerText="";const n=0,r=this.areaBodyCenterGeo.width,a=this.tableModel.getPadding(),d=this.tableModel.getAreaModel(e),u=d.getRowCount();for(;this.cleanupFunctions[e].length;){const p=this.cleanupFunctions[e].shift();p&&p()}let g=t;const m=this.tableModel.getColumnCount(),c=this.tableModel.getFixedRightColumnCount(),f=this.tableModel.getFixedLeftColumnCount();for(let p=0;p<u;p++){const w=g,C=p===u-1,x=this.tableModel.getRowHeight(e,p);if(w+x>0){this.firstVisibleRowIndex=p;let y={left:n,width:r,height:x,top:w,index:p},v=this.dom.addRowDiv(i,y,p,e,"center");const E=f;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:d,geo:y,parent:v,rowIndex:p,columnIndexStart:E,columnIndexEnd:m-c-1,verticalFixed:!1,lastRowOfModel:C}),a.left>0&&(y={left:n,width:this.areaBodyWestGeo.width,height:x,top:w,index:p},v=this.dom.addRowDiv(s,y,p,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:d,geo:y,parent:v,rowIndex:p,columnIndexStart:0,columnIndexEnd:E-1,verticalFixed:!0,lastRowOfModel:C})),a.right>0&&(y={left:n,width:this.areaBodyEastGeo.width,height:x,top:w,index:p},v=this.dom.addRowDiv(o,y,p,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:d,geo:y,parent:v,rowIndex:p,columnIndexStart:m-c,columnIndexEnd:m-1,verticalFixed:!0,lastRowOfModel:C})),e==="header"&&this.tree&&p===u-1){const A=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(v,new T(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),R=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(R){const L=this.dom.domService.createText(R.content);this.dom.domService.appendChild(A,L),R.style&&this.dom.applyStyleString(A,R.style)}}}if(g=g+x,g>l)break}if(this.colAndRowspanModels&&this.colAndRowspanModels[e]){const p=((S=this.colAndRowspanModels[e])==null?void 0:S.getRanges())??[];if(p.length)for(const w of p){let C=0,x=i.child,y="center";if(w.c1<f)x=s.child,y="west";else if(c>0&&w.c1>=m-c)x=o.child,y="east";else{const v=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();C=this.scrollFactorX*v-this.areaBodyWestGeo.width,y="center"}this.drawBigCell(w,C,t,d,x,y)}}}drawBigCell(e,t,s,i,o,l){const n=s+this.getRowHeights(0,e.r1-1,i).reduce((S,p)=>S+p,0),r=this.tableModel.getColumnCount(),a=this.tableModel.getFixedRightColumnCount();let d=0;a>0&&e.c1>=r-a&&(d=r-a);const u=t+this.getColumnWidths(d,e.c1-1).reduce((S,p)=>S+p,0),g=this.getRowHeights(e.r1,e.r2,i).reduce((S,p)=>S+p,0),m=this.getColumnWidths(e.c1,e.c2).reduce((S,p)=>S+p,0);let c=!1;const f=this.getSelectionModel?this.getSelectionModel():void 0;f&&(c=f.getSelectionCount(e.r1,e.c1)>0),e.gammaRange?(console.info("TODO here",e),this.renderCell({areaModel:i,areaIdent:i.areaIdent,sideIdent:l,rowIndex:e.r1,columnIndex:e.c1,left:u,top:n,width:m,height:g,parent:o,cellSelected:c,lastRowOfModel:!0,gammaRange:e.gammaRange})):this.renderCell({areaModel:i,areaIdent:i.areaIdent,sideIdent:l,rowIndex:e.r1,columnIndex:e.c1,left:u,top:n,width:m,height:g,parent:o,cellSelected:c,lastRowOfModel:!0,gammaRange:e.gammaRange}),i.areaIdent==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:e.r1,columnIndex:e.c1,cellLeft:u,cellTop:n,cellWidth:m,cellHeight:g,parent:o})}findRowOfImportantRowspanCell(e,t,s){const i=e.getMaxRowspan();for(let o=t-1;o>-1;o--){const l=e.getRowspanAt(o,s);if(l>1&&o+l+1>=t)return o;if(t-o>i)return-1}return-1}adjustColumnsToRowParent({areaIdent:e,sideIdent:t,areaModel:s,geo:i,parent:o,rowIndex:l,columnIndexStart:n,columnIndexEnd:r,verticalFixed:a=!1,lastRowOfModel:d=!1}){var f;this.scrollViewportLeft=this.scrollViewport.scrollLeft;let u=0;if(!a){const S=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();u=this.scrollFactorX*S}const g=0,m=!!(e==="body"&&t);let c=u;for(let S=n;S<=r;S++){const p=c,w=this.tableModel.getColumnWidth(S);if(w>0&&p+w>0){let C=i.height;const x=s.getRowspanAt(l,S),y=s.getColspanAt(l,S);x>1&&(C=this.getRowHeights(l,l+x-1,s).reduce((A,R)=>A+R,0));let v=w;y>1&&(v=this.getColumnWidths(S,S+y-1).reduce((A,R)=>A+R,0));let E=!1;if(this.colAndRowspanModels&&this.colAndRowspanModels[e]&&(f=this.colAndRowspanModels[e])!=null&&f.isInRange(l,S)&&(E=!0),this.draggingTargetColumnIndex===S&&e!=="header"){this.renderDragTargetDiv(o,p,g,v,C);const A={left:p,top:g,width:v,height:C};this.dom.addColumnBorderDivs(this.tableOptions,o,A,e,t)}else{const A=this.renderSelectedBackgroundDiv(E,m,t,s,l,S,o,p,g,v,C);E||this.renderCell({areaModel:s,areaIdent:e,sideIdent:t,rowIndex:l,columnIndex:S,left:p,top:g,width:v,height:C,parent:o,cellSelected:A,lastRowOfModel:d,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:l,columnIndex:S,cellLeft:p,cellTop:g,cellWidth:v,cellHeight:C,parent:o})}}if(c=c+w,c>this.areaBodyCenterGeo.width)break}this.tableOptions.verticalBorderVisible&&this.dom.addVerticalBorder(new T(c-1,1,i.height,0),o)}getTreeArrowColumnIndex(){return this.tableOptions.showCheckboxWihoutExtraColumn?0:this.tableModel.isRowCheckboxVisible()?1:0}addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:i,index:o,left:l,width:n,height:r,top:a,parent:d,lastRowOfModel:u,gammaRange:g}){var G;const c=this.editorRenderer&&this.editorRendererRow===i&&this.editorRendererColumn===o?this.editorRenderer:e.getCellRenderer(i,o),f={left:l,width:n,height:r,top:a,index:o},S=e.getRowByIndex(i);let p="none";if(o===this.getTreeArrowColumnIndex()&&$(S)){const b=S;(G=b.children)!=null&&G.length?b.expanded?p="expanded":p="collapsed":p="hidden"}let C;if(t==="header"){const b=this.tableModel.getColumnDef(o);(!(b!=null&&b.sortIconVisible)||b!=null&&b.sortIconVisible())&&(C=b==null?void 0:b.sortState)}const x=e.getValueAt(i,o),y=c?"":`${x}`,v=e.isRowChecked(i),E=this.dom.addColumnDiv(d,f,i,o,t,s,y,p,this.tableOptions,v,C),A=e.getTooltipAt(i,o);A&&this.dom.setAttribute(E,"title",A);const R=this.tableModel.getColumnDef(o);R&&R.classes[t]&&this.dom.addClasses(R.classes[t],E);let L;c&&(L=c.render(E,i,o,t,e,x,this.dom.domService));const _=e.getCustomClassesAt(i,o);if(_.length&&this.dom.addClasses(_,E),this.dom.addColumnBorderDivs(this.tableOptions,d,f,t,s),u&&this.dom.addHorizontalBorder({left:l,width:n,height:r,top:a+r},d),this.getFocusModel&&t==="body"){const b=this.getFocusModel();b!=null&&b.hasFocus(i,o)&&this.dom.addFocusBorderDivs(d,f,{})}t==="header"&&this.dom.setAttribute(E,"data-ge-action","drag-column");const O=e.getCustomStyleAt(i,o);if(O)for(const b in O)this.dom.setStyle(E,b,O[b]);return[E,L]}applyCssClasses(e,t={}){e&&Object.entries(t).forEach(([s,i])=>{i?this.dom.addClass(s,e):this.dom.removeClass(s,e)})}rerenderCellContent({area:e,rowIndex:t,columnIndex:s,value:i,cssClasses:o}){const l=this.tableModel.getAreaModel(e),n='div[data-col-index="'+s+'"][data-row-index="'+t+'"][data-area="'+e+'"]',r=document.querySelector(n);if(r){let a;const u=this.editorRenderer&&this.editorRendererRow===t&&this.editorRendererColumn===s?this.editorRenderer:l.getCellRenderer(t,s);if(r.innerText="",this.applyCssClasses(r,o),u)a=u.render(r,t,s,e,l,i,this.dom.domService),a&&this.cleanupFunctions[e].push(a);else{const c=`${i}`;this.dom.addLabelDiv(r,c,!1,t,s,e)}const g=l.getCustomClassesAt(t,s);g.length&&this.dom.addClasses(g,r);const m=l.getCustomStyleAt(t,s);if(m)for(const c in m)this.dom.setStyle(r,c,m[c])}}getColumnWidths(e,t){const s=[];for(let i=e;i<=t;i++)s.push(this.tableModel.getColumnWidth(i));return s}getRowHeights(e,t,s){const i=[];for(let o=e;o<=t;o++)i.push(s.getRowHeight(o));return i}adjustHoverRows(e){if(this.tableOptions.hoverRowVisible&&e.rowIndex>-1){const t=this.hostElement.clientWidth,s=this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex),i=e.rowTop+this.areaHeaderCenter.parent.clientHeight-this.scrollTop;this.dom.applyStyle(this.hoverRow,{left:"0",top:i+"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),i=this.areaBodyWestGeo.width,o=e.columnLeft+this.tableModel.getPadding().left-this.scrollLeft-i;this.dom.applyStyle(this.hoverColumn,{left:o+"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)}renderDragTargetDiv(e,t,s,i,o){const l=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass("ge-table-drop-zone",e));return this.dom.setStyle(l,"left",`${t}px`),this.dom.setStyle(l,"top",`${s}px`),this.dom.setStyle(l,"width",`${i}px`),this.dom.setStyle(l,"height",`${o}px`),l}renderSelectedBackgroundDiv(e,t,s,i,o,l,n,r,a,d,u){let g=!1;if(!e&&t&&i.isSelectable(o,l)&&this.getSelectionModel){const m=this.getSelectionModel();if(m){const c=m.getSelectionCount(o,l);g=c>0;for(let f=0;f<c;f++){const S=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`,n));this.dom.setStyle(S,"left",`${r}px`),this.dom.setStyle(S,"top",`${a}px`),this.dom.setStyle(S,"width",`${d}px`),this.dom.setStyle(S,"height",`${u}px`)}}}return g}renderCell({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:i,columnIndex:o,left:l,top:n,width:r,height:a,parent:d,cellSelected:u,lastRowOfModel:g,gammaRange:m}){const[c,f]=this.addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:i,index:o,left:l,width:r,height:a,top:n,parent:d,lastRowOfModel:g,gammaRange:m});u&&this.dom.addClass(`ge-table-${t}-${s}-selected-range`,c),f&&this.cleanupFunctions[t].push(f)}renderHeaderCellResizeHandle({rowIndex:e,columnIndex:t,cellLeft:s,cellTop:i,cellWidth:o,cellHeight:l,parent:n}){const r=this.dom.domService,a=this.tableOptions.columnResizeHandleWidthInPx??2,d=r.createElement("div");r.setAttribute(d,"data-col-index",`${t}`),r.setAttribute(d,"data-row-index",`${e}`),r.setAttribute(d,"data-area","header"),r.setAttribute(d,"data-ge-action","resize-column"),r.addClass(d,"ge-table-column-resize-handle"),r.setStyle(d,"display","clip"),r.setStyle(d,"position","absolute"),r.setStyle(d,"cursor","col-resize"),r.setStyle(d,"left",`${s+o-a}px`),r.setStyle(d,"top",`${i}px`),r.setStyle(d,"width",`${a}px`),r.setStyle(d,"height",`${l}px`),r.appendChild(n,d)}}class ne{constructor(e,t){this.columnIndex=e,this.sortState=t}}class ae{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"),i=t.getAttribute("data-row-index"),o=t.getAttribute("data-col-index");if(s&&i&&o){const l=H(s),n=Number(i),r=Number(o);this.tableScope.updateModelValueAfterEdit(l,n,r,t.value)}}}}class de{constructor(e=-1,t=-1){this.rowIndex=e,this.columnIndex=t}}class k{constructor(e){this.cells=e}static createSingle(e,t){return new k([new de(e,t)])}}class he{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 o,l,n,r,a,d,u;let s=!1,i=!1;if(this.getSelectionModel&&this.getFocusModel){const g=this.getSelectionModel(),m=this.getFocusModel();g&&m&&(m.hasFocus(e.rowIndex,e.columnIndex)||(m.setFocus(e.rowIndex,e.columnIndex),s=!0),(o=e.originalEvent)!=null&&o.shiftKey||g.hasSelection()&&(g.clear(),s=!0),(l=e.originalEvent)!=null&&l.shiftKey&&this.previousEvt?(g.addSelection(this.createRangeByEvents(e,this.previousEvt)),i=!0,s=!0):(n=e.originalEvent)!=null&&n.ctrlKey||(r=e.originalEvent)!=null&&r.metaKey?(g.addSelection(M.singleCell(e.rowIndex,e.columnIndex)),i=!0,s=!0):(a=e.originalEvent)!=null&&a.altKey&&((d=e.originalEvent)!=null&&d.ctrlKey||(u=e.originalEvent)!=null&&u.metaKey)&&(g.removeSelection(M.singleCell(e.rowIndex,e.columnIndex)),i=!0,s=!0))}return i?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[i,o]=s.getFocus();return t.togglePoint(i,o),this.tableScope.repaint(),!0}}}return!1}createRangeByEvents(e,t){t||(t=e);const s=Math.min(e.rowIndex,t==null?void 0:t.rowIndex),i=Math.max(e.rowIndex,t==null?void 0:t.rowIndex),o=Math.min(e.columnIndex,t==null?void 0:t.columnIndex),l=Math.max(e.columnIndex,t==null?void 0:t.columnIndex);return M.create({rowIndex1:s,columnIndex1:o,rowIndex2:i,columnIndex2:l})}}class ce{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","cmd -":"DESELECT_ALL",arrowup:"NAVIGATE_UP",arrowdown:"NAVIGATE_DOWN",arrowleft:"NAVIGATE_LEFT",arrowright:"NAVIGATE_RIGHT"}}}class pe{get(){return{f2:"START_EDITING",space:"TOGGLE_SELECTION","ctrl+num_add":"SELECT_ALL","cmd+a":"SELECT_ALL","ctrl+a":"SELECT_ALL","cmd+x":"DESELECT_ALL","cmd+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"}}}class ue{constructor(e){this.tableScope=e,this.shortcutActionIdMapping={},this.listener=[],this.listener.push(e),this.init()}addListener(e){this.listener.includes(e)||this.listener.push(e)}init(){this.isMacintosh()?Object.assign(this.shortcutActionIdMapping,new pe().get()):Object.assign(this.shortcutActionIdMapping,new ce().get()),Object.assign(this.shortcutActionIdMapping,this.tableScope.tableOptions.shortcutActionIdMapping),this.isDebug()&&console.debug("ShortcutService",this.shortcutActionIdMapping),this.tableScope.hostElement.addEventListener("keydown",this.onKeyDown.bind(this))}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.findEnty(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}findEnty(e){const t=this.getTokenByEvent(e);this.isDebug()&&console.debug("ShortcutService tokens:",t);for(const s in this.shortcutActionIdMapping){const i=s.replace(/opt/g,"alt").replace(/cmd/g,"meta").split(/[\+ ]/g).sort();if(this.areTokensEquals(t,i))return this.shortcutActionIdMapping[s]}}areTokensEquals(e,t){if(e.length!==t.length||e.length===0)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}getTokenByEvent(e){const t=[];return e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.code&&t.push(e.code.toLowerCase().replace(/key/g,"")),t.sort()}}class N{onCheckboxChanged(e){}onContextmenu(e){}onModelChanged(e){}onMouseClicked(e){}onMouseDragging(e){}onMouseDraggingEnd(e){}onMouseMoved(e){}}class K{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 Se{render(e,t,s,i,o,l,n){if(o.isEditable(t,s)){n.addClass(e,"ge-table-row-input-div");const r=o.getValueAt(t,s);e.innerHTML=`
|
|
9
9
|
<input
|
|
10
10
|
type="text"
|
|
11
11
|
value="${r}"
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
data-col-index="${s}"
|
|
18
18
|
data-input-type="text"
|
|
19
19
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
20
|
-
class="ge-table-cell-editor-input">`}}}class Se{constructor(e="none",t="single"){this.selectionType=e,this.selectionMode=t,this.ranges=[],this.negativeRanges=[],this.allSelected=!1}getSelectionCount(e,t){let s=0;for(const i of this.ranges)i.isInRange(e,t)&&s++;return this.allSelected&&s++,this.isInNegativeRange(e,t)&&(s=0),s}isInNegativeRange(e,t){for(const s of this.negativeRanges)if(s.isInRange(e,t))return!0;return!1}getRanges(){return this.ranges}clear(){this.ranges=[],this.negativeRanges=[],this.allSelected=!1}hasSelection(){return!!this.ranges.length}selectAll(){this.allSelected=!0}addSelection(e){this.addRange(e)}removeSelection(e){if(this.selectionType==="none")return;let t=e;this.selectionType==="row"?t=M.singleRow(e.r1):this.selectionType==="column"&&(t=M.singleColumn(e.c1)),this.negativeRanges.push(t)}togglePoint(e,t){this.getSelectionCount(e,t)>0?this.removeSelection(M.singleCell(e,t)):this.addSelection(M.singleCell(e,t))}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))}}class ge{constructor(e="none"){this.selectionType=e,this.rowIndex=-1,this.columnIndex=-1,this.changed=!1}clearChanged(){this.changed=!1}hasChanged(){return this.changed}clear(){this.rowIndex=-1,this.columnIndex=-1}setFocus(e,t){(this.rowIndex!==e||this.columnIndex!==t)&&(this.rowIndex=e,this.columnIndex=t,this.changed=!0)}hasFocus(e,t){return this.rowIndex===e&&this.columnIndex===t}getFocus(){return[this.rowIndex,this.columnIndex]}}const me=new Se,fe=new ge("cell");class z{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 N,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new j,this.sortOrder=["asc","desc"],this.getEditRenderer=(e,t)=>new ue,this.getSelectionModel=()=>me,this.getFocusModel=()=>fe}}class P extends le{constructor(e,t,s,i,o){var l;if(super(e,t,new Y(s),i),this.eventListener=o,this.selectionService=new de(this),this.api=new J(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,o||(this.eventListener=new G),(l=this.tableOptions)!=null&&l.autoRestoreOptions){const n=this.tableOptions.autoRestoreOptions,r=n.getStorageKeyFn;r&&(n.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new Q(r)),n.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new ee(r)),n.autoRestoreSortingState&&(this.storeSortingService=new te(r)))}this.mouseHandler=new U(this),this.inputHandler=new ne(this),this.shortcutService=new pe(this),this.shortcutService.addListener(this.selectionService)}static create(e,t,s=new z,i=new G,o=new X){return new P(e,t,o,s,i)}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,i]=t.getFocus();this.tableModel.getBodyModel().isEditable(s,i)&&(this.clearSelection(),this.initRenderEditor(s,i))}return!0}return!1}updateModelValueAfterEdit(e,t,s,i){e==="body"&&this.tableModel.getAreaModel(e).setValue(t,s,i)&&(this.resetEditorRenderer(),this.repaint(),this.eventListener.onModelChanged(_.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 B;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 i=this.tableModel.getAreaModel(t.areaIdent);t.rowTop=i.getYPosByRowIndex(t.rowIndex)}if(t.columnLeft=this.tableModel.getXPosByColumnIndex(t.columnIndex),e.ctrlKey&&e.altKey){const i=e.clientY-this.hostElement.offsetTop-this.areaHeaderCenter.parent.clientHeight,o=e.clientX-this.hostElement.offsetLeft-this.areaBodyWestGeo.width;this.debugOnce(o,i)}}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.dragFrom=this.mouseStartColumnIndex))}mouseDraggingOnFrame(e){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.tableModel.changeColumnOrder(this.dragFrom,this.dragTo),this.dragFrom=this.dragTo,this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows()),this.repaint())}mouseDraggingEndOnFrame(e){this.eventListener.onMouseDraggingEnd(e),this.draggingTargetColumnIndex=-1,this.mouseStartAction==="resize-column"?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&this.repaint(),this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.mouseStartAction=""}mouseMove(e){this.eventListener.onMouseMoved(e),this.adjustHoverRows(e),this.adjustHoverColumns(e)}contextmenu(e){this.eventListener.onContextmenu(e)}toggleExpandCollapseAll(e=!0){var s;const t=this.tableModel.getBodyModel();$(t)&&(t.toggleExpandCollapseAll(e),this.repaint(),(s=this.storeStateCollapsedExpandService)==null||s.collapsedStateAll(e))}toggleRowCheckbox(e,t,s){var r;const i=this.tableModel.getAreaModel(s),o=i.isRowChecked(e),l=o===void 0||o==="semi"||o==="none";i.setRowChecked(e,l),this.repaint();const n=(r=i.rowSelectionModel)==null?void 0:r.getCheckedRows();this.eventListener.onCheckboxChanged(n||[])}onMouseClicked(e,t){let s=this.selectionService.onMouseClicked(e,t);if(!s&&this.getFocusModel){const i=this.getFocusModel();i&&(s=i.hasChanged(),i.clearChanged(),s&&this.resetEditorRenderer())}this.eventListener.onMouseClicked(e),s&&this.debounce(this.repaint.bind(this),10)}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 o,l;const i=this.tableModel.getColumnDef(s);if(i!=null&&i.sortable&&i.sortable()){e.preventDefault(),e.stopPropagation();const n=i.sortStatesOrder?i.sortStatesOrder:this.tableOptions.sortOrder,r=i.sortState??"",a=n[(n.indexOf(r)+1)%n.length],d=new re(s,a);this.tableModel.doSort([d])&&((o=this.tableModel.getColumnDefs())==null||o.forEach(g=>g.sortState=""),i.sortState=a),this.repaint(),(l=this.storeSortingService)==null||l.setSortItems([d])}}changeFocusCell(e,t){if(!this.isEditing()&&this.getFocusModel){const s=this.getFocusModel();if(s){const[i,o]=s.getFocus();return s.setFocus(i+t,o+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,i=s.getRowId;if(s.autoRestoreCollapsedExpandedState&&i){const o=this.storeStateCollapsedExpandService.collapsedExpandedStateGet(),l=this.tableModel.getAreaModel("body");if($(l)){const n=l,r=l.getRowCount();for(let a=0;a<r;a++){const d=l.getRowByIndex(a);if(d)if(o.allExpanded)d.expanded=!0;else if(o.allCollapsed)d.expanded=!1;else{const u=i(d.data);o.mode==="expanded"?d.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(u):o.mode==="collapsed"&&(d.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(u))}}n.recalcVisibleTreeRows()}}}}}const be=D.defineComponent({inheritAttrs:!1,props:{tableModel:{required:!0},tableOptions:{required:!1,default:new z},debounceMouseClickDelay:{required:!1,default:150}},emits:["tableReady","mouseClicked","mouseDragging","checkboxChanged","contextmenu","modelChanged","mouseDraggingEnd","mouseMoved"],setup(h,{emit:e}){const t=D.ref(null),s=i=>{const o={onCheckboxChanged:n=>{e("checkboxChanged",n)},onContextmenu:n=>{e("contextmenu",n)},onModelChanged:n=>{e("modelChanged",n)},onMouseClicked:n=>{e("mouseClicked",n)},onMouseDragging:n=>{e("mouseDragging",n)},onMouseDraggingEnd:n=>{e("mouseDraggingEnd",n)},onMouseMoved:n=>{e("mouseMoved",n)}},l=new P(i,h.tableModel,new X,h.tableOptions,o);l.firstInit(),e("tableReady",l.getApi())};return D.onMounted(()=>{t.value&&s(t.value)}),{root:t}}});const ye=(h,e)=>{const t=h.__vccOpts||h;for(const[s,i]of e)t[s]=i;return t},ve={ref:"root",class:"container-div",style:{width:"100%",height:"100%","background-color":"transparent",padding:"0",margin:"0"}};function Ce(h,e,t,s,i,o){return D.openBlock(),D.createElementBlock("div",ve,null,512)}const K=ye(be,[["render",Ce]]);class xe{constructor(e,t){this.component=e,this.appContext=t}render(e,t,s,i,o,l,n){return this.mount(this.component,{cellDiv:e,rowIndex:t,columnIndex:s,areaIdent:i,areaModel:o,cellValue:l},this.appContext,e)}mount(e,t,s,i){let o=D.createVNode(e,t);return o.appContext=s,D.render(o,i),()=>{i&&D.render(null,i)}}}const we={install:(h,e={img:""})=>{h.component("GuiexpertTable",K)}};exports.ComponentRendererWrapper=xe;exports.GuiexpertTable=K;exports.default=we;
|
|
20
|
+
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}getSelectionCount(e,t){let s=0;for(const i of this.ranges)i.isInRange(e,t)&&s++;return this.allSelected&&s++,this.isInNegativeRange(e,t)&&(s=0),s}isInNegativeRange(e,t){for(const s of this.negativeRanges)if(s.isInRange(e,t))return!0;return!1}getRanges(){return this.ranges}clear(){this.ranges=[],this.negativeRanges=[],this.allSelected=!1}hasSelection(){return!!this.ranges.length}selectAll(){this.allSelected=!0}addSelection(e){this.addRange(e)}removeSelection(e){if(this.selectionType==="none")return;let t=e;this.selectionType==="row"?t=M.singleRow(e.r1):this.selectionType==="column"&&(t=M.singleColumn(e.c1)),this.negativeRanges.push(t)}togglePoint(e,t){this.getSelectionCount(e,t)>0?this.removeSelection(M.singleCell(e,t)):this.addSelection(M.singleCell(e,t))}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))}}class me{constructor(e="none"){this.selectionType=e,this.rowIndex=-1,this.columnIndex=-1,this.changed=!1}clearChanged(){this.changed=!1}hasChanged(){return this.changed}clear(){this.rowIndex=-1,this.columnIndex=-1}setFocus(e,t){(this.rowIndex!==e||this.columnIndex!==t)&&(this.rowIndex=e,this.columnIndex=t,this.changed=!0)}hasFocus(e,t){return this.rowIndex===e&&this.columnIndex===t}getFocus(){return[this.rowIndex,this.columnIndex]}}const fe=new ge,be=new me("cell");class z{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 j,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new X,this.sortOrder=["asc","desc"],this.getEditRenderer=(e,t)=>new Se,this.getSelectionModel=()=>fe,this.getFocusModel=()=>be}}class V extends re{constructor(e,t,s,i,o){var l;if(super(e,t,new q(s),i),this.eventListener=o,this.licenseManager=I.getInstance(),this.selectionService=new he(this),this.api=new Q(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,o||(this.eventListener=new N),(l=this.tableOptions)!=null&&l.autoRestoreOptions){const n=this.tableOptions.autoRestoreOptions,r=n.getStorageKeyFn;r&&(n.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new Z(r)),n.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new te(r)),n.autoRestoreSortingState&&(this.storeSortingService=new se(r)))}this.mouseHandler=new J(this),this.inputHandler=new ae(this),this.shortcutService=new ue(this),this.shortcutService.addListener(this.selectionService)}static create(e,t,s=new z,i=new N,o=new K){return new V(e,t,o,s,i)}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,i]=t.getFocus();this.tableModel.getBodyModel().isEditable(s,i)&&(this.clearSelection(),this.initRenderEditor(s,i))}return!0}return!1}updateModelValueAfterEdit(e,t,s,i){e==="body"&&this.tableModel.getAreaModel(e).setValue(t,s,i)&&(this.resetEditorRenderer(),this.repaint(),this.eventListener.onModelChanged(k.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 W;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 i=this.tableModel.getAreaModel(t.areaIdent);t.rowTop=i.getYPosByRowIndex(t.rowIndex)}if(t.columnLeft=this.tableModel.getXPosByColumnIndex(t.columnIndex),e.ctrlKey&&e.altKey){const i=e.clientY-this.hostElement.offsetTop-this.areaHeaderCenter.parent.clientHeight,o=e.clientX-this.hostElement.offsetLeft-this.areaBodyWestGeo.width;this.debugOnce(o,i)}}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.dragFrom=this.mouseStartColumnIndex))}mouseDraggingOnFrame(e){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.tableModel.changeColumnOrder(this.dragFrom,this.dragTo),this.dragFrom=this.dragTo,this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows()),this.repaint())}mouseDraggingEndOnFrame(e){this.eventListener.onMouseDraggingEnd(e),this.draggingTargetColumnIndex=-1,this.mouseStartAction==="resize-column"?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&this.repaint(),this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.mouseStartAction=""}mouseMove(e){this.eventListener.onMouseMoved(e),this.adjustHoverRows(e),this.adjustHoverColumns(e)}contextmenu(e){this.eventListener.onContextmenu(e)}toggleExpandCollapseAll(e=!0){var s;const t=this.tableModel.getBodyModel();B(t)&&(t.toggleExpandCollapseAll(e),this.repaint(),(s=this.storeStateCollapsedExpandService)==null||s.collapsedStateAll(e))}toggleRowCheckbox(e,t,s){var r;const i=this.tableModel.getAreaModel(s),o=i.isRowChecked(e),l=o===void 0||o==="semi"||o==="none";i.setRowChecked(e,l),this.repaint();const n=(r=i.rowSelectionModel)==null?void 0:r.getCheckedRows();this.eventListener.onCheckboxChanged(n||[])}onMouseClicked(e,t){let s=this.selectionService.onMouseClicked(e,t);if(!s&&this.getFocusModel){const i=this.getFocusModel();i&&(s=i.hasChanged(),i.clearChanged(),s&&this.resetEditorRenderer())}this.eventListener.onMouseClicked(e),s&&this.debounce(this.repaint.bind(this),10)}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 o,l;const i=this.tableModel.getColumnDef(s);if(i!=null&&i.sortable&&i.sortable()){e.preventDefault(),e.stopPropagation();const n=i.sortStatesOrder?i.sortStatesOrder:this.tableOptions.sortOrder,r=i.sortState??"",a=n[(n.indexOf(r)+1)%n.length],d=new ne(s,a);this.tableModel.doSort([d])&&((o=this.tableModel.getColumnDefs())==null||o.forEach(g=>g.sortState=""),i.sortState=a),this.repaint(),(l=this.storeSortingService)==null||l.setSortItems([d])}}changeFocusCell(e,t){if(!this.isEditing()&&this.getFocusModel){const s=this.getFocusModel();if(s){const[i,o]=s.getFocus();return s.setFocus(i+t,o+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,i=s.getRowId;if(s.autoRestoreCollapsedExpandedState&&i){const o=this.storeStateCollapsedExpandService.collapsedExpandedStateGet(),l=this.tableModel.getAreaModel("body");if(B(l)){const n=l,r=l.getRowCount();for(let a=0;a<r;a++){const d=l.getRowByIndex(a);if(d)if(o.allExpanded)d.expanded=!0;else if(o.allCollapsed)d.expanded=!1;else{const u=i(d.data);o.mode==="expanded"?d.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(u):o.mode==="collapsed"&&(d.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(u))}}n.recalcVisibleTreeRows()}}}}scrollToPixel(e,t){this.scrollViewport.scrollTo(e,t)}scrollToIndex(e,t){const i=this.tableModel.getAreaModel("body").getYPosByRowIndex(t);this.scrollToPixel(0,i)}}const ye=D.defineComponent({inheritAttrs:!1,props:{tableModel:{required:!0},tableOptions:{required:!1,default:new z},debounceMouseClickDelay:{required:!1,default:150},licenseKey:{default:"",required:!1}},emits:["tableReady","mouseClicked","mouseDragging","checkboxChanged","contextmenu","modelChanged","mouseDraggingEnd","mouseMoved"],setup(h,{emit:e}){const t=D.ref(null),s=i=>{const o={onCheckboxChanged:n=>{e("checkboxChanged",n)},onContextmenu:n=>{e("contextmenu",n)},onModelChanged:n=>{e("modelChanged",n)},onMouseClicked:n=>{e("mouseClicked",n)},onMouseDragging:n=>{e("mouseDragging",n)},onMouseDraggingEnd:n=>{e("mouseDraggingEnd",n)},onMouseMoved:n=>{e("mouseMoved",n)}},l=new V(i,h.tableModel,new K,h.tableOptions,o);l.firstInit(),e("tableReady",l.getApi())};return D.onMounted(()=>{t.value&&s(t.value)}),h.licenseKey&&I.getInstance().setLicenseKey(h.licenseKey),{root:t}}});const ve=(h,e)=>{const t=h.__vccOpts||h;for(const[s,i]of e)t[s]=i;return t},Ce={ref:"root",class:"container-div",style:{width:"100%",height:"100%","background-color":"transparent",padding:"0",margin:"0"}};function xe(h,e,t,s,i,o){return D.openBlock(),D.createElementBlock("div",Ce,null,512)}const Y=ve(ye,[["render",xe]]);class we{constructor(e,t){this.component=e,this.appContext=t}render(e,t,s,i,o,l,n){return this.mount(this.component,{cellDiv:e,rowIndex:t,columnIndex:s,areaIdent:i,areaModel:o,cellValue:l},this.appContext,e)}mount(e,t,s,i){let o=D.createVNode(e,t);return o.appContext=s,D.render(o,i),()=>{i&&D.render(null,i)}}}const Ee={install:(h,e={img:""})=>{h.component("GuiexpertTable",Y)}};exports.ComponentRendererWrapper=we;exports.GuiexpertTable=Y;exports.default=Ee;
|
package/index.js
CHANGED
|
@@ -1,16 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { defineComponent as Y, ref as q, onMounted as U, openBlock as J, createElementBlock as Q, createVNode as Z, render as G } from "vue";
|
|
2
|
+
class D {
|
|
3
|
+
// The constructor is private to prevent direct construction calls
|
|
4
|
+
// with the `new` operator
|
|
5
|
+
constructor() {
|
|
6
|
+
this.alreadySet = !1;
|
|
7
|
+
}
|
|
8
|
+
static getInstance() {
|
|
9
|
+
return D.instance || (D.instance = new D()), D.instance;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Method to set the license key for the application.
|
|
13
|
+
* A 'meta' element is created with content as 'guiexperttable=<license key>'
|
|
14
|
+
* and appended into the head section of the document
|
|
15
|
+
*
|
|
16
|
+
* @param {string} key - The license key to set for the application.
|
|
17
|
+
*
|
|
18
|
+
* @return {void} - This method does not return anything
|
|
19
|
+
*/
|
|
20
|
+
setLicenseKey(e) {
|
|
21
|
+
if (e && !this.alreadySet) {
|
|
22
|
+
const t = document.createElement("meta");
|
|
23
|
+
t.content = "license=" + e, t.name = "guiexperttable", document.getElementsByTagName("head")[0].appendChild(t), this.alreadySet = !0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
4
26
|
}
|
|
5
27
|
function O(h) {
|
|
28
|
+
return h && h.type === "TreeRow";
|
|
29
|
+
}
|
|
30
|
+
function $(h) {
|
|
6
31
|
return h && h.type === "AreaModelTree";
|
|
7
32
|
}
|
|
8
|
-
class
|
|
33
|
+
class B {
|
|
9
34
|
constructor(e = -1, t = -1, s = -1, i = -1, o, l, n, r = 0, a = 0, d = 0, u = "") {
|
|
10
35
|
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent = l, this.originalEvent = n, this.clickCount = r, this.draggingX = a, this.draggingY = d, this.action = u;
|
|
11
36
|
}
|
|
12
37
|
clone() {
|
|
13
|
-
return new
|
|
38
|
+
return new B(
|
|
14
39
|
this.rowIndex,
|
|
15
40
|
this.rowTop,
|
|
16
41
|
this.columnIndex,
|
|
@@ -25,25 +50,25 @@ class $ {
|
|
|
25
50
|
);
|
|
26
51
|
}
|
|
27
52
|
}
|
|
28
|
-
class
|
|
53
|
+
class I {
|
|
29
54
|
constructor(e = ">", t = "", s = []) {
|
|
30
55
|
this.content = e, this.style = t, this.classes = s;
|
|
31
56
|
}
|
|
32
57
|
}
|
|
33
|
-
class
|
|
34
|
-
constructor(e = new
|
|
58
|
+
class j {
|
|
59
|
+
constructor(e = new I(
|
|
35
60
|
">",
|
|
36
61
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
37
62
|
["gt-table-tree-arrow-expanded"]
|
|
38
|
-
), t = new
|
|
63
|
+
), t = new I(
|
|
39
64
|
">",
|
|
40
65
|
"",
|
|
41
66
|
["ge-table-tree-arrow-collapsed"]
|
|
42
|
-
), s = new
|
|
67
|
+
), s = new I(
|
|
43
68
|
">",
|
|
44
69
|
"color:transparent;",
|
|
45
70
|
["gt-table-tree-arrow-hidden"]
|
|
46
|
-
), i = new
|
|
71
|
+
), i = new I(
|
|
47
72
|
"↕",
|
|
48
73
|
"",
|
|
49
74
|
["gt-table-tree-arrow-expanded-all"]
|
|
@@ -51,12 +76,12 @@ class N {
|
|
|
51
76
|
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
|
|
52
77
|
}
|
|
53
78
|
}
|
|
54
|
-
class
|
|
55
|
-
constructor(e = new
|
|
79
|
+
class X {
|
|
80
|
+
constructor(e = new I("↑", "", ["ge-header-sorted-asc"]), t = new I("↓", "", ["ge-header-sorted-desc"]), s = new I("↑", "color:transparent;", [])) {
|
|
56
81
|
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
57
82
|
}
|
|
58
83
|
}
|
|
59
|
-
class
|
|
84
|
+
class ee {
|
|
60
85
|
constructor(e) {
|
|
61
86
|
this.domService = e;
|
|
62
87
|
}
|
|
@@ -176,7 +201,7 @@ class Z {
|
|
|
176
201
|
}
|
|
177
202
|
return this.domService.appendChild(e, n), n;
|
|
178
203
|
}
|
|
179
|
-
addSortedIcon(e, t = "", s = new
|
|
204
|
+
addSortedIcon(e, t = "", s = new X(), i = -1) {
|
|
180
205
|
const o = this.domService.createElement("div");
|
|
181
206
|
this.domService.addClass(o, "ge-table-sorted-icon-div"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "top", "0"), this.domService.setStyle(o, "right", "0"), this.domService.setStyle(o, "width", "20px"), this.domService.setStyle(o, "background", "transparent"), this.domService.setStyle(o, "cursor", "pointer"), this.domService.setAttribute(o, "data-col-index", `${i}`), this.domService.setAttribute(o, "data-area", "header");
|
|
182
207
|
let l;
|
|
@@ -187,7 +212,7 @@ class Z {
|
|
|
187
212
|
this.domService.addClass(o, a);
|
|
188
213
|
return this.domService.appendChild(e, o), o;
|
|
189
214
|
}
|
|
190
|
-
addArrowDiv(e, t = "none", s = new
|
|
215
|
+
addArrowDiv(e, t = "none", s = new j(), i = -1, o = -1, l = "body") {
|
|
191
216
|
const n = this.domService.createElement("div");
|
|
192
217
|
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", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${l}`);
|
|
193
218
|
let r;
|
|
@@ -237,20 +262,20 @@ class Z {
|
|
|
237
262
|
return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
|
|
238
263
|
}
|
|
239
264
|
}
|
|
240
|
-
const
|
|
241
|
-
class
|
|
265
|
+
const W = (h) => h === "header" ? "header" : h === "footer" ? "footer" : "body";
|
|
266
|
+
class te {
|
|
242
267
|
constructor(e, t) {
|
|
243
268
|
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)) {
|
|
244
269
|
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"));
|
|
245
270
|
const s = e.getAttribute("data-area");
|
|
246
|
-
if (s && (this.areaIdent =
|
|
271
|
+
if (s && (this.areaIdent = W(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
|
|
247
272
|
const i = e;
|
|
248
273
|
this.value = i.value;
|
|
249
274
|
}
|
|
250
275
|
}
|
|
251
276
|
}
|
|
252
277
|
}
|
|
253
|
-
class
|
|
278
|
+
class se {
|
|
254
279
|
constructor(e) {
|
|
255
280
|
this.tableScope = e, this.expandedAll = !0, this.mouseDown = !1, this.dragging = !1, 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(
|
|
256
281
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
@@ -276,12 +301,12 @@ class te {
|
|
|
276
301
|
* @return {void}
|
|
277
302
|
*/
|
|
278
303
|
onHostElementClicked(e) {
|
|
279
|
-
const t = new
|
|
304
|
+
const t = new te(e.target, this.tableScope);
|
|
280
305
|
if (t.action === "toggleExpandCollapseAll")
|
|
281
306
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
282
307
|
else if (t.inputType === "checkbox" && t.areaIdent)
|
|
283
308
|
this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
284
|
-
else if (
|
|
309
|
+
else if (O(t.row) && t.areaModel) {
|
|
285
310
|
const s = t.colIdx === this.getArrowColumnIndex() && e.altKey, i = t.className.includes("ge-table-tree-arrow-div");
|
|
286
311
|
if (console.info(i, s), s || i) {
|
|
287
312
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -303,12 +328,12 @@ class te {
|
|
|
303
328
|
*/
|
|
304
329
|
onHostElementDblClicked(e) {
|
|
305
330
|
if (e.target instanceof HTMLElement) {
|
|
306
|
-
const t = e.target, s = t.getAttribute("data-area"), i =
|
|
331
|
+
const t = e.target, s = t.getAttribute("data-area"), i = W(s), o = Number(t.getAttribute("data-row-index")), l = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(i);
|
|
307
332
|
if (s && i === "header")
|
|
308
333
|
this.tableScope.tableModel.isSortable(l) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, l));
|
|
309
334
|
else if (t.getAttribute("data-row-index")) {
|
|
310
335
|
const r = n.getRowByIndex(o);
|
|
311
|
-
if (s && i === "body" && n.isEditable(o, l) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, l)),
|
|
336
|
+
if (s && i === "body" && n.isEditable(o, l) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, l)), O(r) && l === this.getArrowColumnIndex()) {
|
|
312
337
|
e.preventDefault(), e.stopPropagation();
|
|
313
338
|
const a = r;
|
|
314
339
|
a.expanded = !a.expanded, "recalcVisibleTreeRows" in n && n.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(a);
|
|
@@ -376,7 +401,7 @@ class te {
|
|
|
376
401
|
}
|
|
377
402
|
}
|
|
378
403
|
}
|
|
379
|
-
class
|
|
404
|
+
class ie {
|
|
380
405
|
constructor(e) {
|
|
381
406
|
this.tableScope = e;
|
|
382
407
|
}
|
|
@@ -402,21 +427,23 @@ class se {
|
|
|
402
427
|
/**
|
|
403
428
|
* Scrolls the table body to the specified pixel coordinates.
|
|
404
429
|
*
|
|
405
|
-
* @param {number}
|
|
406
|
-
* @param {number}
|
|
430
|
+
* @param {number} px - The horizontal pixel coordinate to scroll to. Defaults to 0.
|
|
431
|
+
* @param {number} py - The vertical pixel coordinate to scroll to. Defaults to 0.
|
|
407
432
|
* @return {void}
|
|
408
433
|
*/
|
|
409
434
|
scrollToPixel(e = 0, t = 0) {
|
|
435
|
+
this.tableScope.scrollToPixel(e, t);
|
|
410
436
|
}
|
|
411
437
|
/**
|
|
412
438
|
* Scrolls to the specified index in both horizontal and vertical directions.
|
|
413
439
|
*
|
|
414
|
-
* @param {number}
|
|
415
|
-
* @param {number}
|
|
440
|
+
* @param {number} indexX - The index of the column to scroll to in the horizontal direction. Default is 0.
|
|
441
|
+
* @param {number} indexY - The index of the row to scroll to in the vertical direction. Default is 0.
|
|
416
442
|
*
|
|
417
443
|
* @return undefined
|
|
418
444
|
*/
|
|
419
445
|
scrollToIndex(e = 0, t = 0) {
|
|
446
|
+
this.tableScope.scrollToIndex(e, t);
|
|
420
447
|
}
|
|
421
448
|
/**
|
|
422
449
|
* Sets whether the header is visible or not.
|
|
@@ -481,7 +508,7 @@ class se {
|
|
|
481
508
|
this.tableScope.repaint();
|
|
482
509
|
}
|
|
483
510
|
}
|
|
484
|
-
class
|
|
511
|
+
class H {
|
|
485
512
|
constructor(e) {
|
|
486
513
|
this.getStorageKeyFn = e;
|
|
487
514
|
}
|
|
@@ -556,7 +583,7 @@ class W {
|
|
|
556
583
|
// }
|
|
557
584
|
// }
|
|
558
585
|
}
|
|
559
|
-
class
|
|
586
|
+
class oe extends H {
|
|
560
587
|
constructor(e) {
|
|
561
588
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
562
589
|
}
|
|
@@ -578,14 +605,14 @@ class ie extends W {
|
|
|
578
605
|
}
|
|
579
606
|
}
|
|
580
607
|
}
|
|
581
|
-
class
|
|
608
|
+
class le {
|
|
582
609
|
constructor(e = "collapsed", t = [], s = !1, i = !1) {
|
|
583
610
|
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
|
|
584
611
|
}
|
|
585
612
|
}
|
|
586
|
-
class
|
|
613
|
+
class re extends H {
|
|
587
614
|
constructor(e) {
|
|
588
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
615
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new le(), this.load();
|
|
589
616
|
}
|
|
590
617
|
collapsedExpandedStateGet() {
|
|
591
618
|
return this.collapsedExpandedState;
|
|
@@ -617,7 +644,7 @@ class le extends W {
|
|
|
617
644
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
618
645
|
}
|
|
619
646
|
}
|
|
620
|
-
class
|
|
647
|
+
class ne extends H {
|
|
621
648
|
constructor(e) {
|
|
622
649
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
623
650
|
}
|
|
@@ -644,7 +671,7 @@ class T {
|
|
|
644
671
|
this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
|
|
645
672
|
}
|
|
646
673
|
}
|
|
647
|
-
class
|
|
674
|
+
class ae {
|
|
648
675
|
constructor(e, t, s, i) {
|
|
649
676
|
this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = i, this.scrollTop = 0, this.areaBodyWestGeo = new T(), this.areaBodyCenterGeo = new T(), this.areaBodyEastGeo = new T();
|
|
650
677
|
const o = this.hostElement;
|
|
@@ -830,7 +857,7 @@ class M {
|
|
|
830
857
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
831
858
|
}
|
|
832
859
|
}
|
|
833
|
-
class
|
|
860
|
+
class de {
|
|
834
861
|
constructor(e, t) {
|
|
835
862
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
836
863
|
}
|
|
@@ -863,22 +890,22 @@ class ae {
|
|
|
863
890
|
return !1;
|
|
864
891
|
}
|
|
865
892
|
}
|
|
866
|
-
class
|
|
893
|
+
class he {
|
|
867
894
|
constructor(e, t, s) {
|
|
868
895
|
this.header = e, this.body = t, this.footer = s;
|
|
869
896
|
}
|
|
870
897
|
}
|
|
871
|
-
class
|
|
898
|
+
class ce extends ae {
|
|
872
899
|
constructor(e, t, s, i) {
|
|
873
900
|
var l, n;
|
|
874
901
|
super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
875
902
|
header: [],
|
|
876
903
|
body: [],
|
|
877
904
|
footer: []
|
|
878
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
905
|
+
}, this.tree = !1, this.colAndRowspanModels = new he(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (l = this.tableOptions) != null && l.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (n = this.tableOptions) != null && n.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), $(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
879
906
|
(r) => {
|
|
880
907
|
var a;
|
|
881
|
-
this.colAndRowspanModels[r] = new
|
|
908
|
+
this.colAndRowspanModels[r] = new de(t, t.getAreaModel(r)), (a = this.colAndRowspanModels[r]) == null || a.init();
|
|
882
909
|
}
|
|
883
910
|
);
|
|
884
911
|
}
|
|
@@ -1230,12 +1257,12 @@ class he extends ne {
|
|
|
1230
1257
|
lastRowOfModel: u,
|
|
1231
1258
|
gammaRange: g
|
|
1232
1259
|
}) {
|
|
1233
|
-
var
|
|
1260
|
+
var _;
|
|
1234
1261
|
const c = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), f = { left: l, width: n, height: r, top: a, index: o }, S = e.getRowByIndex(i);
|
|
1235
1262
|
let p = "none";
|
|
1236
|
-
if (o === this.getTreeArrowColumnIndex() &&
|
|
1263
|
+
if (o === this.getTreeArrowColumnIndex() && O(S)) {
|
|
1237
1264
|
const b = S;
|
|
1238
|
-
(
|
|
1265
|
+
(_ = b.children) != null && _.length ? b.expanded ? p = "expanded" : p = "collapsed" : p = "hidden";
|
|
1239
1266
|
}
|
|
1240
1267
|
let C;
|
|
1241
1268
|
if (t === "header") {
|
|
@@ -1260,16 +1287,16 @@ class he extends ne {
|
|
|
1260
1287
|
R && R.classes[t] && this.dom.addClasses(R.classes[t], E);
|
|
1261
1288
|
let F;
|
|
1262
1289
|
c && (F = c.render(E, i, o, t, e, x, this.dom.domService));
|
|
1263
|
-
const
|
|
1264
|
-
if (
|
|
1290
|
+
const V = e.getCustomClassesAt(i, o);
|
|
1291
|
+
if (V.length && this.dom.addClasses(V, E), this.dom.addColumnBorderDivs(this.tableOptions, d, f, t, s), u && this.dom.addHorizontalBorder({ left: l, width: n, height: r, top: a + r }, d), this.getFocusModel && t === "body") {
|
|
1265
1292
|
const b = this.getFocusModel();
|
|
1266
1293
|
b != null && b.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, f, {});
|
|
1267
1294
|
}
|
|
1268
1295
|
t === "header" && this.dom.setAttribute(E, "data-ge-action", "drag-column");
|
|
1269
|
-
const
|
|
1270
|
-
if (
|
|
1271
|
-
for (const b in
|
|
1272
|
-
this.dom.setStyle(E, b,
|
|
1296
|
+
const L = e.getCustomStyleAt(i, o);
|
|
1297
|
+
if (L)
|
|
1298
|
+
for (const b in L)
|
|
1299
|
+
this.dom.setStyle(E, b, L[b]);
|
|
1273
1300
|
return [E, F];
|
|
1274
1301
|
}
|
|
1275
1302
|
applyCssClasses(e, t = {}) {
|
|
@@ -1407,12 +1434,12 @@ class he extends ne {
|
|
|
1407
1434
|
r.setAttribute(d, "data-col-index", `${t}`), r.setAttribute(d, "data-row-index", `${e}`), r.setAttribute(d, "data-area", "header"), r.setAttribute(d, "data-ge-action", "resize-column"), r.addClass(d, "ge-table-column-resize-handle"), r.setStyle(d, "display", "clip"), r.setStyle(d, "position", "absolute"), r.setStyle(d, "cursor", "col-resize"), r.setStyle(d, "left", `${s + o - a}px`), r.setStyle(d, "top", `${i}px`), r.setStyle(d, "width", `${a}px`), r.setStyle(d, "height", `${l}px`), r.appendChild(n, d);
|
|
1408
1435
|
}
|
|
1409
1436
|
}
|
|
1410
|
-
class
|
|
1437
|
+
class pe {
|
|
1411
1438
|
constructor(e, t) {
|
|
1412
1439
|
this.columnIndex = e, this.sortState = t;
|
|
1413
1440
|
}
|
|
1414
1441
|
}
|
|
1415
|
-
class
|
|
1442
|
+
class ue {
|
|
1416
1443
|
constructor(e) {
|
|
1417
1444
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1418
1445
|
}
|
|
@@ -1428,26 +1455,26 @@ class pe {
|
|
|
1428
1455
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1429
1456
|
const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
|
|
1430
1457
|
if (s && i && o) {
|
|
1431
|
-
const l =
|
|
1458
|
+
const l = W(s), n = Number(i), r = Number(o);
|
|
1432
1459
|
this.tableScope.updateModelValueAfterEdit(l, n, r, t.value);
|
|
1433
1460
|
}
|
|
1434
1461
|
}
|
|
1435
1462
|
}
|
|
1436
1463
|
}
|
|
1437
|
-
class
|
|
1464
|
+
class Se {
|
|
1438
1465
|
constructor(e = -1, t = -1) {
|
|
1439
1466
|
this.rowIndex = e, this.columnIndex = t;
|
|
1440
1467
|
}
|
|
1441
1468
|
}
|
|
1442
|
-
class
|
|
1469
|
+
class P {
|
|
1443
1470
|
constructor(e) {
|
|
1444
1471
|
this.cells = e;
|
|
1445
1472
|
}
|
|
1446
1473
|
static createSingle(e, t) {
|
|
1447
|
-
return new
|
|
1474
|
+
return new P([new Se(e, t)]);
|
|
1448
1475
|
}
|
|
1449
1476
|
}
|
|
1450
|
-
class
|
|
1477
|
+
class ge {
|
|
1451
1478
|
constructor(e) {
|
|
1452
1479
|
var t, s;
|
|
1453
1480
|
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);
|
|
@@ -1488,7 +1515,7 @@ class Se {
|
|
|
1488
1515
|
});
|
|
1489
1516
|
}
|
|
1490
1517
|
}
|
|
1491
|
-
class
|
|
1518
|
+
class me {
|
|
1492
1519
|
get() {
|
|
1493
1520
|
return {
|
|
1494
1521
|
f2: "START_EDITING",
|
|
@@ -1506,7 +1533,7 @@ class ge {
|
|
|
1506
1533
|
};
|
|
1507
1534
|
}
|
|
1508
1535
|
}
|
|
1509
|
-
class
|
|
1536
|
+
class fe {
|
|
1510
1537
|
get() {
|
|
1511
1538
|
return {
|
|
1512
1539
|
f2: "START_EDITING",
|
|
@@ -1526,7 +1553,7 @@ class me {
|
|
|
1526
1553
|
};
|
|
1527
1554
|
}
|
|
1528
1555
|
}
|
|
1529
|
-
class
|
|
1556
|
+
class be {
|
|
1530
1557
|
constructor(e) {
|
|
1531
1558
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1532
1559
|
}
|
|
@@ -1534,7 +1561,7 @@ class fe {
|
|
|
1534
1561
|
this.listener.includes(e) || this.listener.push(e);
|
|
1535
1562
|
}
|
|
1536
1563
|
init() {
|
|
1537
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
1564
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new fe().get()) : Object.assign(this.shortcutActionIdMapping, new me().get()), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
1538
1565
|
}
|
|
1539
1566
|
isMacintosh() {
|
|
1540
1567
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -1578,7 +1605,7 @@ class fe {
|
|
|
1578
1605
|
return e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.code && t.push(e.code.toLowerCase().replace(/key/g, "")), t.sort();
|
|
1579
1606
|
}
|
|
1580
1607
|
}
|
|
1581
|
-
class
|
|
1608
|
+
class N {
|
|
1582
1609
|
onCheckboxChanged(e) {
|
|
1583
1610
|
}
|
|
1584
1611
|
onContextmenu(e) {
|
|
@@ -1594,7 +1621,7 @@ class G {
|
|
|
1594
1621
|
onMouseMoved(e) {
|
|
1595
1622
|
}
|
|
1596
1623
|
}
|
|
1597
|
-
class
|
|
1624
|
+
class K {
|
|
1598
1625
|
setStyle(e, t, s) {
|
|
1599
1626
|
return e.style[t] = s, e;
|
|
1600
1627
|
}
|
|
@@ -1621,7 +1648,7 @@ class X {
|
|
|
1621
1648
|
e.setAttribute(t, s);
|
|
1622
1649
|
}
|
|
1623
1650
|
}
|
|
1624
|
-
class
|
|
1651
|
+
class ye {
|
|
1625
1652
|
render(e, t, s, i, o, l, n) {
|
|
1626
1653
|
if (o.isEditable(t, s)) {
|
|
1627
1654
|
n.addClass(e, "ge-table-row-input-div");
|
|
@@ -1642,7 +1669,7 @@ class be {
|
|
|
1642
1669
|
}
|
|
1643
1670
|
}
|
|
1644
1671
|
}
|
|
1645
|
-
class
|
|
1672
|
+
class ve {
|
|
1646
1673
|
constructor(e = "none", t = "single") {
|
|
1647
1674
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1648
1675
|
}
|
|
@@ -1686,7 +1713,7 @@ class ye {
|
|
|
1686
1713
|
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));
|
|
1687
1714
|
}
|
|
1688
1715
|
}
|
|
1689
|
-
class
|
|
1716
|
+
class Ce {
|
|
1690
1717
|
constructor(e = "none") {
|
|
1691
1718
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
1692
1719
|
}
|
|
@@ -1709,29 +1736,29 @@ class ve {
|
|
|
1709
1736
|
return [this.rowIndex, this.columnIndex];
|
|
1710
1737
|
}
|
|
1711
1738
|
}
|
|
1712
|
-
const
|
|
1739
|
+
const xe = new ve(), we = new Ce("cell");
|
|
1713
1740
|
class z {
|
|
1714
1741
|
constructor() {
|
|
1715
1742
|
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 = {
|
|
1716
1743
|
header: 34,
|
|
1717
1744
|
body: 34,
|
|
1718
1745
|
footer: 34
|
|
1719
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new
|
|
1746
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new j(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new X(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new ye(), this.getSelectionModel = () => xe, this.getFocusModel = () => we;
|
|
1720
1747
|
}
|
|
1721
1748
|
}
|
|
1722
|
-
class
|
|
1749
|
+
class k extends ce {
|
|
1723
1750
|
constructor(e, t, s, i, o) {
|
|
1724
1751
|
var l;
|
|
1725
1752
|
if (super(
|
|
1726
1753
|
e,
|
|
1727
1754
|
t,
|
|
1728
|
-
new
|
|
1755
|
+
new ee(s),
|
|
1729
1756
|
i
|
|
1730
|
-
), this.eventListener = o, this.selectionService = new
|
|
1757
|
+
), this.eventListener = o, this.licenseManager = D.getInstance(), this.selectionService = new ge(this), this.api = new ie(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new N()), (l = this.tableOptions) != null && l.autoRestoreOptions) {
|
|
1731
1758
|
const n = this.tableOptions.autoRestoreOptions, r = n.getStorageKeyFn;
|
|
1732
|
-
r && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new
|
|
1759
|
+
r && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new oe(r)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new re(r)), n.autoRestoreSortingState && (this.storeSortingService = new ne(r)));
|
|
1733
1760
|
}
|
|
1734
|
-
this.mouseHandler = new
|
|
1761
|
+
this.mouseHandler = new se(this), this.inputHandler = new ue(this), this.shortcutService = new be(this), this.shortcutService.addListener(this.selectionService);
|
|
1735
1762
|
}
|
|
1736
1763
|
/**
|
|
1737
1764
|
* Creates a TableScope instance.
|
|
@@ -1744,8 +1771,8 @@ class _ extends he {
|
|
|
1744
1771
|
*
|
|
1745
1772
|
* @return {TableScope} - The newly created TableScope instance.
|
|
1746
1773
|
*/
|
|
1747
|
-
static create(e, t, s = new z(), i = new
|
|
1748
|
-
return new
|
|
1774
|
+
static create(e, t, s = new z(), i = new N(), o = new K()) {
|
|
1775
|
+
return new k(
|
|
1749
1776
|
e,
|
|
1750
1777
|
t,
|
|
1751
1778
|
o,
|
|
@@ -1767,7 +1794,7 @@ class _ extends he {
|
|
|
1767
1794
|
return !1;
|
|
1768
1795
|
}
|
|
1769
1796
|
updateModelValueAfterEdit(e, t, s, i) {
|
|
1770
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(
|
|
1797
|
+
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(P.createSingle(t, s)), this.hostElement.focus());
|
|
1771
1798
|
}
|
|
1772
1799
|
/**
|
|
1773
1800
|
* Retrieves the TableApi object.
|
|
@@ -1796,7 +1823,7 @@ class _ extends he {
|
|
|
1796
1823
|
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
1797
1824
|
*/
|
|
1798
1825
|
createGeMouseEvent(e) {
|
|
1799
|
-
const t = new
|
|
1826
|
+
const t = new B();
|
|
1800
1827
|
if (t.originalEvent = e, e) {
|
|
1801
1828
|
const s = e.target;
|
|
1802
1829
|
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) {
|
|
@@ -1865,7 +1892,7 @@ class _ extends he {
|
|
|
1865
1892
|
toggleExpandCollapseAll(e = !0) {
|
|
1866
1893
|
var s;
|
|
1867
1894
|
const t = this.tableModel.getBodyModel();
|
|
1868
|
-
|
|
1895
|
+
$(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
1869
1896
|
}
|
|
1870
1897
|
/**
|
|
1871
1898
|
* Toggles the checkbox state of a specific row in a table.
|
|
@@ -1922,7 +1949,7 @@ class _ extends he {
|
|
|
1922
1949
|
const i = this.tableModel.getColumnDef(s);
|
|
1923
1950
|
if (i != null && i.sortable && i.sortable()) {
|
|
1924
1951
|
e.preventDefault(), e.stopPropagation();
|
|
1925
|
-
const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, r = i.sortState ?? "", a = n[(n.indexOf(r) + 1) % n.length], d = new
|
|
1952
|
+
const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, r = i.sortState ?? "", a = n[(n.indexOf(r) + 1) % n.length], d = new pe(s, a);
|
|
1926
1953
|
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((g) => g.sortState = ""), i.sortState = a), this.repaint(), (l = this.storeSortingService) == null || l.setSortItems([d]);
|
|
1927
1954
|
}
|
|
1928
1955
|
}
|
|
@@ -2012,7 +2039,7 @@ class _ extends he {
|
|
|
2012
2039
|
const s = this.tableOptions.autoRestoreOptions, i = s.getRowId;
|
|
2013
2040
|
if (s.autoRestoreCollapsedExpandedState && i) {
|
|
2014
2041
|
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), l = this.tableModel.getAreaModel("body");
|
|
2015
|
-
if (
|
|
2042
|
+
if ($(l)) {
|
|
2016
2043
|
const n = l, r = l.getRowCount();
|
|
2017
2044
|
for (let a = 0; a < r; a++) {
|
|
2018
2045
|
const d = l.getRowByIndex(a);
|
|
@@ -2031,8 +2058,30 @@ class _ extends he {
|
|
|
2031
2058
|
}
|
|
2032
2059
|
}
|
|
2033
2060
|
}
|
|
2061
|
+
/**
|
|
2062
|
+
* Scrolls the viewport to the specified pixel coordinates.
|
|
2063
|
+
*
|
|
2064
|
+
* @param {number} px - The horizontal pixel coordinate to scroll to.
|
|
2065
|
+
* @param {number} py - The vertical pixel coordinate to scroll to.
|
|
2066
|
+
*
|
|
2067
|
+
* @return {void}
|
|
2068
|
+
*/
|
|
2069
|
+
scrollToPixel(e, t) {
|
|
2070
|
+
this.scrollViewport.scrollTo(e, t);
|
|
2071
|
+
}
|
|
2072
|
+
/**
|
|
2073
|
+
* Scrolls to the specified index in the table.
|
|
2074
|
+
*
|
|
2075
|
+
* @param {number} _indexX - The horizontal index of the table where scrolling is needed.
|
|
2076
|
+
* @param {number} indexY - The vertical index of the table where scrolling is needed.
|
|
2077
|
+
* @return {void}
|
|
2078
|
+
*/
|
|
2079
|
+
scrollToIndex(e, t) {
|
|
2080
|
+
const i = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
|
|
2081
|
+
this.scrollToPixel(0, i);
|
|
2082
|
+
}
|
|
2034
2083
|
}
|
|
2035
|
-
const
|
|
2084
|
+
const Ee = Y({
|
|
2036
2085
|
inheritAttrs: !1,
|
|
2037
2086
|
props: {
|
|
2038
2087
|
tableModel: {
|
|
@@ -2045,6 +2094,10 @@ const we = K({
|
|
|
2045
2094
|
debounceMouseClickDelay: {
|
|
2046
2095
|
required: !1,
|
|
2047
2096
|
default: 150
|
|
2097
|
+
},
|
|
2098
|
+
licenseKey: {
|
|
2099
|
+
default: "",
|
|
2100
|
+
required: !1
|
|
2048
2101
|
}
|
|
2049
2102
|
},
|
|
2050
2103
|
emits: [
|
|
@@ -2058,7 +2111,7 @@ const we = K({
|
|
|
2058
2111
|
"mouseMoved"
|
|
2059
2112
|
],
|
|
2060
2113
|
setup(h, { emit: e }) {
|
|
2061
|
-
const t =
|
|
2114
|
+
const t = q(null), s = (i) => {
|
|
2062
2115
|
const o = {
|
|
2063
2116
|
onCheckboxChanged: (n) => {
|
|
2064
2117
|
e("checkboxChanged", n);
|
|
@@ -2081,37 +2134,37 @@ const we = K({
|
|
|
2081
2134
|
onMouseMoved: (n) => {
|
|
2082
2135
|
e("mouseMoved", n);
|
|
2083
2136
|
}
|
|
2084
|
-
}, l = new
|
|
2137
|
+
}, l = new k(
|
|
2085
2138
|
i,
|
|
2086
2139
|
h.tableModel,
|
|
2087
|
-
new
|
|
2140
|
+
new K(),
|
|
2088
2141
|
h.tableOptions,
|
|
2089
2142
|
o
|
|
2090
2143
|
);
|
|
2091
2144
|
l.firstInit(), e("tableReady", l.getApi());
|
|
2092
2145
|
};
|
|
2093
|
-
return
|
|
2146
|
+
return U(() => {
|
|
2094
2147
|
t.value && s(t.value);
|
|
2095
|
-
}), {
|
|
2148
|
+
}), h.licenseKey && D.getInstance().setLicenseKey(h.licenseKey), {
|
|
2096
2149
|
root: t
|
|
2097
2150
|
};
|
|
2098
2151
|
}
|
|
2099
2152
|
});
|
|
2100
|
-
const
|
|
2153
|
+
const Ae = (h, e) => {
|
|
2101
2154
|
const t = h.__vccOpts || h;
|
|
2102
2155
|
for (const [s, i] of e)
|
|
2103
2156
|
t[s] = i;
|
|
2104
2157
|
return t;
|
|
2105
|
-
},
|
|
2158
|
+
}, Me = {
|
|
2106
2159
|
ref: "root",
|
|
2107
2160
|
class: "container-div",
|
|
2108
2161
|
style: { width: "100%", height: "100%", "background-color": "transparent", padding: "0", margin: "0" }
|
|
2109
2162
|
};
|
|
2110
|
-
function
|
|
2111
|
-
return
|
|
2163
|
+
function Re(h, e, t, s, i, o) {
|
|
2164
|
+
return J(), Q("div", Me, null, 512);
|
|
2112
2165
|
}
|
|
2113
|
-
const
|
|
2114
|
-
class
|
|
2166
|
+
const Te = /* @__PURE__ */ Ae(Ee, [["render", Re]]);
|
|
2167
|
+
class Ie {
|
|
2115
2168
|
constructor(e, t) {
|
|
2116
2169
|
this.component = e, this.appContext = t;
|
|
2117
2170
|
}
|
|
@@ -2131,19 +2184,19 @@ class De {
|
|
|
2131
2184
|
);
|
|
2132
2185
|
}
|
|
2133
2186
|
mount(e, t, s, i) {
|
|
2134
|
-
let o =
|
|
2135
|
-
return o.appContext = s,
|
|
2136
|
-
i &&
|
|
2187
|
+
let o = Z(e, t);
|
|
2188
|
+
return o.appContext = s, G(o, i), () => {
|
|
2189
|
+
i && G(null, i);
|
|
2137
2190
|
};
|
|
2138
2191
|
}
|
|
2139
2192
|
}
|
|
2140
2193
|
const Fe = {
|
|
2141
2194
|
install: (h, e = { img: "" }) => {
|
|
2142
|
-
h.component("GuiexpertTable",
|
|
2195
|
+
h.component("GuiexpertTable", Te);
|
|
2143
2196
|
}
|
|
2144
2197
|
};
|
|
2145
2198
|
export {
|
|
2146
|
-
|
|
2147
|
-
|
|
2199
|
+
Ie as ComponentRendererWrapper,
|
|
2200
|
+
Te as GuiexpertTable,
|
|
2148
2201
|
Fe as default
|
|
2149
2202
|
};
|
|
@@ -10,6 +10,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10
10
|
required: false;
|
|
11
11
|
default: number;
|
|
12
12
|
};
|
|
13
|
+
licenseKey: {
|
|
14
|
+
default: string;
|
|
15
|
+
required: false;
|
|
16
|
+
};
|
|
13
17
|
}, {
|
|
14
18
|
root: import("vue").Ref<null>;
|
|
15
19
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("tableReady" | "mouseClicked" | "mouseDragging" | "checkboxChanged" | "contextmenu" | "modelChanged" | "mouseDraggingEnd" | "mouseMoved")[], "tableReady" | "mouseClicked" | "mouseDragging" | "checkboxChanged" | "contextmenu" | "modelChanged" | "mouseDraggingEnd" | "mouseMoved", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -24,6 +28,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
28
|
required: false;
|
|
25
29
|
default: number;
|
|
26
30
|
};
|
|
31
|
+
licenseKey: {
|
|
32
|
+
default: string;
|
|
33
|
+
required: false;
|
|
34
|
+
};
|
|
27
35
|
}>> & {
|
|
28
36
|
onTableReady?: ((...args: any[]) => any) | undefined;
|
|
29
37
|
onMouseClicked?: ((...args: any[]) => any) | undefined;
|
|
@@ -36,5 +44,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
44
|
}, {
|
|
37
45
|
tableOptions: any;
|
|
38
46
|
debounceMouseClickDelay: number;
|
|
47
|
+
licenseKey: string;
|
|
39
48
|
}, {}>;
|
|
40
49
|
export default _default;
|