@guiexpert/vue3-table 1.0.17 → 1.0.18
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 +4 -4
- package/index.js +184 -152
- package/package.json +1 -1
- package/style.css +1 -1
package/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("vue");function O(h){return h&&h.type==="TreeRow"}function $(h){return h&&h.type==="AreaModelTree"}class B{constructor(e=-1,t=-1,s=-1,i=-1,o,l,r
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("vue");function O(h){return h&&h.type==="TreeRow"}function $(h){return h&&h.type==="AreaModelTree"}class B{constructor(e=-1,t=-1,s=-1,i=-1,o,l,n,r=0,a=0,d=0,S=""){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=S}clone(){return new B(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 G{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 N{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 K{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,S){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 b=((t==null?void 0:t.index)??0)%2===0?"even":"odd";if(o==="body"&&l==="center"&&this.domService.addClass(c,`ge-table-column-${b}`),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 p=r!=="none"&&i===0;this.addLabelDiv(c,n,p,s,i,o)}return S&&this.addSortedIcon(c,S,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 r=this.domService.createElement("div");if(this.domService.addClass(r,"ge-table-label-div"),this.domService.setStyle(r,"position","relative"),this.domService.setStyle(r,"background","transparent"),this.domService.setStyle(r,"width","100%"),this.domService.setStyle(r,"height","100%"),this.domService.setAttribute(r,"data-row-index",`${i}`),this.domService.setAttribute(r,"data-col-index",`${o}`),this.domService.setAttribute(r,"data-area",`${l}`),t)if(s){const n=this.domService.createText(t);this.domService.appendChild(r,n)}else{const n=this.domService.createElement("div");this.domService.appendChild(r,n);const a=this.domService.createText(t);this.domService.addClass(n,"ge-table-label"),this.domService.appendChild(n,a),this.domService.setAttribute(n,"data-row-index",`${i}`),this.domService.setAttribute(n,"data-col-index",`${o}`),this.domService.setAttribute(n,"data-area",`${l}`)}return this.domService.appendChild(e,r),r}addSortedIcon(e,t="",s=new N,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 r=l.content,n=this.domService.createText(r);this.domService.appendChild(o,n),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 G,i=-1,o=-1,l="body"){const r=this.domService.createElement("div");this.domService.addClass(r,"ge-table-tree-arrow-div"),this.domService.setStyle(r,"display","inline-block"),this.domService.setStyle(r,"position",""),this.domService.setStyle(r,"width","20px"),this.domService.setStyle(r,"background","transparent"),this.domService.setStyle(r,"cursor","pointer"),this.domService.setAttribute(r,"data-row-index",`${i}`),this.domService.setAttribute(r,"data-col-index",`${o}`),this.domService.setAttribute(r,"data-area",`${l}`);let n;t==="expanded"?n=s.arrowExpanded:t==="collapsed"?n=s.arrowCollapsed:n=s.arrowPlaceholder;const a=n.content,d=this.domService.createText(a);this.domService.appendChild(r,d),n.style&&this.applyStyleString(r,n.style);for(const S of n.classes)this.domService.addClass(r,S);return this.domService.appendChild(e,r),r}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 Y{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 q{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 Y(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")),r=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 n=r.getRowByIndex(o);if(s&&i==="body"&&r.isEditable(o,l)&&(this.tableScope.clearSelection(),this.tableScope.initRenderEditor(o,l)),O(n)&&l===this.getArrowColumnIndex()){e.preventDefault(),e.stopPropagation();const a=n;a.expanded=!a.expanded,"recalcVisibleTreeRows"in r&&r.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,r;const t=(i=(s=this.tableScope.tableOptions)==null?void 0:s.autoRestoreOptions)==null?void 0:i.getRowId;if(t){const n=(o=this.tableScope.storeStateCollapsedExpandService)==null?void 0:o.collapsedExpandedStateGet().mode,a=n==="collapsed"&&!e.expanded||n==="expanded"&&e.expanded,d=n==="collapsed"&&e.expanded||n==="expanded"&&!e.expanded,S=t(e.data);a?(l=this.tableScope.storeStateCollapsedExpandService)==null||l.collapsedStateIdsPush(S):d&&((r=this.tableScope.storeStateCollapsedExpandService)==null||r.collapsedStateIdsRemove(S))}}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 U{constructor(e){this.tableScope=e}updateCells(e){this.tableScope.updateCells(e)}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 J 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 Q{constructor(e="collapsed",t=[],s=!1,i=!1){this.mode=e,this.rowIds=t,this.allCollapsed=s,this.allExpanded=i}}class Z extends H{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new Q,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 ee 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 te{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 A{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 A(e.rowIndex1,e.columnIndex1,e.rowIndex2,e.columnIndex2,e.gammaRange)}static singleCell(e,t){return new A(e,t,e,t)}static singleRow(e){return new A(e,0,e,Number.MAX_SAFE_INTEGER)}static singleColumn(e){return new A(0,e,Number.MAX_SAFE_INTEGER,e)}isInRange(e,t){return e>=this.r1&&e<=this.r2&&t>=this.c1&&t<=this.c2}}class se{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 r=this.areaModel.hasOwnProperty("gammaCells");this.colAndRowspanRanges.push(new A(s,i,s+l-1,i+o-1,r))}}}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 ie{constructor(e,t,s){this.header=e,this.body=t,this.footer=s}}class oe extends te{constructor(e,t,s,i){var l,r;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 ie,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),(r=this.tableOptions)!=null&&r.getFocusModel&&(this.getFocusModel=this.tableOptions.getFocusModel),$(t.getAreaModel("body"))&&(this.tree=!0),["header","body","footer"].forEach(n=>{var a;this.colAndRowspanModels[n]=new se(t,t.getAreaModel(n)),(a=this.colAndRowspanModels[n])==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){e.forEach(t=>this.tableModel.getAreaModel(t.area).setValue(t.rowIndex,t.columnIndex,t.value)),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 p;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 r=0,n=this.areaBodyCenterGeo.width,a=this.tableModel.getPadding(),d=this.tableModel.getAreaModel(e),S=d.getRowCount();for(;this.cleanupFunctions[e].length;){const u=this.cleanupFunctions[e].shift();u&&u()}let g=t;const m=this.tableModel.getColumnCount(),c=this.tableModel.getFixedRightColumnCount(),b=this.tableModel.getFixedLeftColumnCount();for(let u=0;u<S;u++){const x=g,C=u===S-1,w=this.tableModel.getRowHeight(e,u);if(x+w>0){this.firstVisibleRowIndex=u;let v={left:r,width:n,height:w,top:x,index:u},f=this.dom.addRowDiv(i,v,u,e,"center");const R=b;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:d,geo:v,parent:f,rowIndex:u,columnIndexStart:R,columnIndexEnd:m-c-1,verticalFixed:!1,lastRowOfModel:C}),a.left>0&&(v={left:r,width:this.areaBodyWestGeo.width,height:w,top:x,index:u},f=this.dom.addRowDiv(s,v,u,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:d,geo:v,parent:f,rowIndex:u,columnIndexStart:0,columnIndexEnd:R-1,verticalFixed:!0,lastRowOfModel:C})),a.right>0&&(v={left:r,width:this.areaBodyEastGeo.width,height:w,top:x,index:u},f=this.dom.addRowDiv(o,v,u,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:d,geo:v,parent:f,rowIndex:u,columnIndexStart:m-c,columnIndexEnd:m-1,verticalFixed:!0,lastRowOfModel:C})),e==="header"&&this.tree&&u===S-1){const E=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(f,new T(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),M=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(M){const F=this.dom.domService.createText(M.content);this.dom.domService.appendChild(E,F),M.style&&this.dom.applyStyleString(E,M.style)}}}if(g=g+w,g>l)break}if(this.colAndRowspanModels&&this.colAndRowspanModels[e]){const u=((p=this.colAndRowspanModels[e])==null?void 0:p.getRanges())??[];if(u.length)for(const x of u){let C=0,w=i.child,v="center";if(x.c1<b)w=s.child,v="west";else if(c>0&&x.c1>=m-c)w=o.child,v="east";else{const f=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();C=this.scrollFactorX*f-this.areaBodyWestGeo.width,v="center"}this.drawBigCell(x,C,t,d,w,v)}}}drawBigCell(e,t,s,i,o,l){const r=s+this.getRowHeights(0,e.r1-1,i).reduce((p,u)=>p+u,0),n=this.tableModel.getColumnCount(),a=this.tableModel.getFixedRightColumnCount();let d=0;a>0&&e.c1>=n-a&&(d=n-a);const S=t+this.getColumnWidths(d,e.c1-1).reduce((p,u)=>p+u,0),g=this.getRowHeights(e.r1,e.r2,i).reduce((p,u)=>p+u,0),m=this.getColumnWidths(e.c1,e.c2).reduce((p,u)=>p+u,0);let c=!1;const b=this.getSelectionModel?this.getSelectionModel():void 0;b&&(c=b.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:S,top:r,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:S,top:r,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:S,cellTop:r,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:r,columnIndexEnd:n,verticalFixed:a=!1,lastRowOfModel:d=!1}){var b;this.scrollViewportLeft=this.scrollViewport.scrollLeft;let S=0;if(!a){const p=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();S=this.scrollFactorX*p}const g=0,m=!!(e==="body"&&t);let c=S;for(let p=r;p<=n;p++){const u=c,x=this.tableModel.getColumnWidth(p);if(x>0&&u+x>0){let C=i.height;const w=s.getRowspanAt(l,p),v=s.getColspanAt(l,p);w>1&&(C=this.getRowHeights(l,l+w-1,s).reduce((E,M)=>E+M,0));let f=x;v>1&&(f=this.getColumnWidths(p,p+v-1).reduce((E,M)=>E+M,0));let R=!1;if(this.colAndRowspanModels&&this.colAndRowspanModels[e]&&(b=this.colAndRowspanModels[e])!=null&&b.isInRange(l,p)&&(R=!0),this.draggingTargetColumnIndex===p&&e!=="header"){this.renderDragTargetDiv(o,u,g,f,C);const E={left:u,top:g,width:f,height:C};this.dom.addColumnBorderDivs(this.tableOptions,o,E,e,t)}else{const E=this.renderSelectedBackgroundDiv(R,m,t,s,l,p,o,u,g,f,C);R||this.renderCell({areaModel:s,areaIdent:e,sideIdent:t,rowIndex:l,columnIndex:p,left:u,top:g,width:f,height:C,parent:o,cellSelected:E,lastRowOfModel:d,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:l,columnIndex:p,cellLeft:u,cellTop:g,cellWidth:f,cellHeight:C,parent:o})}}if(c=c+x,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:r,height:n,top:a,parent:d,lastRowOfModel:S}){var k;const m=this.editorRenderer&&this.editorRendererRow===i&&this.editorRendererColumn===o?this.editorRenderer:e.getCellRenderer(i,o),c={left:l,width:r,height:n,top:a,index:o},b=e.getRowByIndex(i);let p="none";if(o===this.getTreeArrowColumnIndex()&&O(b)){const y=b;(k=y.children)!=null&&k.length?y.expanded?p="expanded":p="collapsed":p="hidden"}let x;if(t==="header"){const y=this.tableModel.getColumnDef(o);(!(y!=null&&y.sortIconVisible)||y!=null&&y.sortIconVisible())&&(x=y==null?void 0:y.sortState)}const C=e.getValueAt(i,o),w=m?"":`${C}`,v=e.isRowChecked(i),f=this.dom.addColumnDiv(d,c,i,o,t,s,w,p,this.tableOptions,v,x),R=e.getTooltipAt(i,o);R&&this.dom.setAttribute(f,"title",R);const E=this.tableModel.getColumnDef(o);E&&E.classes[t]&&this.dom.addClasses(E.classes[t],f);let M;m&&(M=m.render(f,i,o,t,e,C,this.dom.domService));const F=e.getCustomClassesAt(i,o);if(F.length&&this.dom.addClasses(F,f),this.dom.addColumnBorderDivs(this.tableOptions,d,c,t,s),S&&this.dom.addHorizontalBorder({left:l,width:r,height:n,top:a+n},d),this.getFocusModel&&t==="body"){const y=this.getFocusModel();y!=null&&y.hasFocus(i,o)&&this.dom.addFocusBorderDivs(d,c,{})}t==="header"&&this.dom.setAttribute(f,"data-ge-action","drag-column");const L=e.getCustomStyleAt(i,o);if(L)for(const y in L)this.dom.setStyle(f,y,L[y]);return[f,M]}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,r,n,a,d,S){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 b=0;b<c;b++){const p=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`,r));this.dom.setStyle(p,"left",`${n}px`),this.dom.setStyle(p,"top",`${a}px`),this.dom.setStyle(p,"width",`${d}px`),this.dom.setStyle(p,"height",`${S}px`)}}}return g}renderCell({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:i,columnIndex:o,left:l,top:r,width:n,height:a,parent:d,cellSelected:S,lastRowOfModel:g,gammaRange:m}){const[c,b]=this.addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:i,index:o,left:l,width:n,height:a,top:r,parent:d,lastRowOfModel:g,gammaRange:m});S&&this.dom.addClass(`ge-table-${t}-${s}-selected-range`,c),b&&this.cleanupFunctions[t].push(b)}renderHeaderCellResizeHandle({rowIndex:e,columnIndex:t,cellLeft:s,cellTop:i,cellWidth:o,cellHeight:l,parent:r}){const n=this.dom.domService,a=this.tableOptions.columnResizeHandleWidthInPx??2,d=n.createElement("div");n.setAttribute(d,"data-col-index",`${t}`),n.setAttribute(d,"data-row-index",`${e}`),n.setAttribute(d,"data-area","header"),n.setAttribute(d,"data-ge-action","resize-column"),n.addClass(d,"ge-table-column-resize-handle"),n.setStyle(d,"display","clip"),n.setStyle(d,"position","absolute"),n.setStyle(d,"cursor","col-resize"),n.setStyle(d,"left",`${s+o-a}px`),n.setStyle(d,"top",`${i}px`),n.setStyle(d,"width",`${a}px`),n.setStyle(d,"height",`${l}px`),n.appendChild(r,d)}}class le{constructor(e,t){this.columnIndex=e,this.sortState=t}}class re{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),r=Number(i),n=Number(o);this.tableScope.updateModelValueAfterEdit(l,r,n,t.value)}}}}class ne{constructor(e=-1,t=-1){this.rowIndex=e,this.columnIndex=t}}class _{constructor(e){this.cells=e}static createSingle(e,t){return new _([new ne(e,t)])}}class ae{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,r,n,a,d,S;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):(r=e.originalEvent)!=null&&r.ctrlKey||(n=e.originalEvent)!=null&&n.metaKey?(g.addSelection(A.singleCell(e.rowIndex,e.columnIndex)),i=!0,s=!0):(a=e.originalEvent)!=null&&a.altKey&&((d=e.originalEvent)!=null&&d.ctrlKey||(S=e.originalEvent)!=null&&S.metaKey)&&(g.removeSelection(A.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 A.create({rowIndex1:s,columnIndex1:o,rowIndex2:i,columnIndex2:l})}}class de{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 he{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 ce{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 he().get()):Object.assign(this.shortcutActionIdMapping,new de().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 V{onCheckboxChanged(e){}onContextmenu(e){}onModelChanged(e){}onMouseClicked(e){}onMouseDragging(e){}onMouseDraggingEnd(e){}onMouseMoved(e){}}class j{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}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 pe{render(e,t,s,i,o,l,r){if(o.isEditable(t,s)){r.addClass(e,"ge-table-row-input-div");const n=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 N,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 G,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 S of r.classes)this.domService.addClass(n,S);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 Y{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 q{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 Y(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,S=t(e.data);a?(l=this.tableScope.storeStateCollapsedExpandService)==null||l.collapsedStateIdsPush(S):d&&((n=this.tableScope.storeStateCollapsedExpandService)==null||n.collapsedStateIdsRemove(S))}}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 U{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 J 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 Q{constructor(e="collapsed",t=[],s=!1,i=!1){this.mode=e,this.rowIds=t,this.allCollapsed=s,this.allExpanded=i}}class Z extends H{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new Q,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 ee 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 te{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 A{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 A(e.rowIndex1,e.columnIndex1,e.rowIndex2,e.columnIndex2,e.gammaRange)}static singleCell(e,t){return new A(e,t,e,t)}static singleRow(e){return new A(e,0,e,Number.MAX_SAFE_INTEGER)}static singleColumn(e){return new A(0,e,Number.MAX_SAFE_INTEGER,e)}isInRange(e,t){return e>=this.r1&&e<=this.r2&&t>=this.c1&&t<=this.c2}}class se{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 A(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 ie{constructor(e,t,s){this.header=e,this.body=t,this.footer=s}}class oe extends te{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 ie,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 se(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 p;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),S=d.getRowCount();for(;this.cleanupFunctions[e].length;){const u=this.cleanupFunctions[e].shift();u&&u()}let g=t;const m=this.tableModel.getColumnCount(),c=this.tableModel.getFixedRightColumnCount(),b=this.tableModel.getFixedLeftColumnCount();for(let u=0;u<S;u++){const C=g,x=u===S-1,w=this.tableModel.getRowHeight(e,u);if(C+w>0){this.firstVisibleRowIndex=u;let v={left:n,width:r,height:w,top:C,index:u},f=this.dom.addRowDiv(i,v,u,e,"center");const R=b;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:d,geo:v,parent:f,rowIndex:u,columnIndexStart:R,columnIndexEnd:m-c-1,verticalFixed:!1,lastRowOfModel:x}),a.left>0&&(v={left:n,width:this.areaBodyWestGeo.width,height:w,top:C,index:u},f=this.dom.addRowDiv(s,v,u,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:d,geo:v,parent:f,rowIndex:u,columnIndexStart:0,columnIndexEnd:R-1,verticalFixed:!0,lastRowOfModel:x})),a.right>0&&(v={left:n,width:this.areaBodyEastGeo.width,height:w,top:C,index:u},f=this.dom.addRowDiv(o,v,u,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:d,geo:v,parent:f,rowIndex:u,columnIndexStart:m-c,columnIndexEnd:m-1,verticalFixed:!0,lastRowOfModel:x})),e==="header"&&this.tree&&u===S-1){const E=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(f,new T(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),M=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(M){const I=this.dom.domService.createText(M.content);this.dom.domService.appendChild(E,I),M.style&&this.dom.applyStyleString(E,M.style)}}}if(g=g+w,g>l)break}if(this.colAndRowspanModels&&this.colAndRowspanModels[e]){const u=((p=this.colAndRowspanModels[e])==null?void 0:p.getRanges())??[];if(u.length)for(const C of u){let x=0,w=i.child,v="center";if(C.c1<b)w=s.child,v="west";else if(c>0&&C.c1>=m-c)w=o.child,v="east";else{const f=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();x=this.scrollFactorX*f-this.areaBodyWestGeo.width,v="center"}this.drawBigCell(C,x,t,d,w,v)}}}drawBigCell(e,t,s,i,o,l){const n=s+this.getRowHeights(0,e.r1-1,i).reduce((p,u)=>p+u,0),r=this.tableModel.getColumnCount(),a=this.tableModel.getFixedRightColumnCount();let d=0;a>0&&e.c1>=r-a&&(d=r-a);const S=t+this.getColumnWidths(d,e.c1-1).reduce((p,u)=>p+u,0),g=this.getRowHeights(e.r1,e.r2,i).reduce((p,u)=>p+u,0),m=this.getColumnWidths(e.c1,e.c2).reduce((p,u)=>p+u,0);let c=!1;const b=this.getSelectionModel?this.getSelectionModel():void 0;b&&(c=b.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:S,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:S,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:S,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 b;this.scrollViewportLeft=this.scrollViewport.scrollLeft;let S=0;if(!a){const p=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();S=this.scrollFactorX*p}const g=0,m=!!(e==="body"&&t);let c=S;for(let p=n;p<=r;p++){const u=c,C=this.tableModel.getColumnWidth(p);if(C>0&&u+C>0){let x=i.height;const w=s.getRowspanAt(l,p),v=s.getColspanAt(l,p);w>1&&(x=this.getRowHeights(l,l+w-1,s).reduce((E,M)=>E+M,0));let f=C;v>1&&(f=this.getColumnWidths(p,p+v-1).reduce((E,M)=>E+M,0));let R=!1;if(this.colAndRowspanModels&&this.colAndRowspanModels[e]&&(b=this.colAndRowspanModels[e])!=null&&b.isInRange(l,p)&&(R=!0),this.draggingTargetColumnIndex===p&&e!=="header"){this.renderDragTargetDiv(o,u,g,f,x);const E={left:u,top:g,width:f,height:x};this.dom.addColumnBorderDivs(this.tableOptions,o,E,e,t)}else{const E=this.renderSelectedBackgroundDiv(R,m,t,s,l,p,o,u,g,f,x);R||this.renderCell({areaModel:s,areaIdent:e,sideIdent:t,rowIndex:l,columnIndex:p,left:u,top:g,width:f,height:x,parent:o,cellSelected:E,lastRowOfModel:d,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:l,columnIndex:p,cellLeft:u,cellTop:g,cellWidth:f,cellHeight:x,parent:o})}}if(c=c+C,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:S}){var k;const m=this.editorRenderer&&this.editorRendererRow===i&&this.editorRendererColumn===o?this.editorRenderer:e.getCellRenderer(i,o),c={left:l,width:n,height:r,top:a,index:o},b=e.getRowByIndex(i);let p="none";if(o===this.getTreeArrowColumnIndex()&&O(b)){const y=b;(k=y.children)!=null&&k.length?y.expanded?p="expanded":p="collapsed":p="hidden"}let C;if(t==="header"){const y=this.tableModel.getColumnDef(o);(!(y!=null&&y.sortIconVisible)||y!=null&&y.sortIconVisible())&&(C=y==null?void 0:y.sortState)}const x=e.getValueAt(i,o),w=m?"":`${x}`,v=e.isRowChecked(i),f=this.dom.addColumnDiv(d,c,i,o,t,s,w,p,this.tableOptions,v,C),R=e.getTooltipAt(i,o);R&&this.dom.setAttribute(f,"title",R);const E=this.tableModel.getColumnDef(o);E&&E.classes[t]&&this.dom.addClasses(E.classes[t],f);let M;m&&(M=m.render(f,i,o,t,e,x,this.dom.domService));const I=e.getCustomClassesAt(i,o);if(I.length&&this.dom.addClasses(I,f),this.dom.addColumnBorderDivs(this.tableOptions,d,c,t,s),S&&this.dom.addHorizontalBorder({left:l,width:n,height:r,top:a+r},d),this.getFocusModel&&t==="body"){const y=this.getFocusModel();y!=null&&y.hasFocus(i,o)&&this.dom.addFocusBorderDivs(d,c,{})}t==="header"&&this.dom.setAttribute(f,"data-ge-action","drag-column");const L=e.getCustomStyleAt(i,o);if(L)for(const y in L)this.dom.setStyle(f,y,L[y]);return[f,M]}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 S=this.editorRenderer&&this.editorRendererRow===t&&this.editorRendererColumn===s?this.editorRenderer:l.getCellRenderer(t,s);if(r.innerText="",this.applyCssClasses(r,o),S)a=S.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,S){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 b=0;b<c;b++){const p=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`,n));this.dom.setStyle(p,"left",`${r}px`),this.dom.setStyle(p,"top",`${a}px`),this.dom.setStyle(p,"width",`${d}px`),this.dom.setStyle(p,"height",`${S}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:S,lastRowOfModel:g,gammaRange:m}){const[c,b]=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});S&&this.dom.addClass(`ge-table-${t}-${s}-selected-range`,c),b&&this.cleanupFunctions[t].push(b)}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 le{constructor(e,t){this.columnIndex=e,this.sortState=t}}class re{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 ne{constructor(e=-1,t=-1){this.rowIndex=e,this.columnIndex=t}}class _{constructor(e){this.cells=e}static createSingle(e,t){return new _([new ne(e,t)])}}class ae{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,S;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(A.singleCell(e.rowIndex,e.columnIndex)),i=!0,s=!0):(a=e.originalEvent)!=null&&a.altKey&&((d=e.originalEvent)!=null&&d.ctrlKey||(S=e.originalEvent)!=null&&S.metaKey)&&(g.removeSelection(A.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 A.create({rowIndex1:s,columnIndex1:o,rowIndex2:i,columnIndex2:l})}}class de{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 he{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 ce{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 he().get()):Object.assign(this.shortcutActionIdMapping,new de().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 V{onCheckboxChanged(e){}onContextmenu(e){}onModelChanged(e){}onMouseClicked(e){}onMouseDragging(e){}onMouseDraggingEnd(e){}onMouseMoved(e){}}class j{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 pe{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
|
-
value="${
|
|
11
|
+
value="${r}"
|
|
12
12
|
autofocus
|
|
13
13
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
14
14
|
data-listen="change"
|
|
@@ -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 ue{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=A.singleRow(e.r1):this.selectionType==="column"&&(t=A.singleColumn(e.c1)),this.negativeRanges.push(t)}togglePoint(e,t){this.getSelectionCount(e,t)>0?this.removeSelection(A.singleCell(e,t)):this.addSelection(A.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 Se{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 ge=new ue,me=new Se("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 G,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new N,this.sortOrder=["asc","desc"],this.getEditRenderer=(e,t)=>new pe,this.getSelectionModel=()=>ge,this.getFocusModel=()=>me}}class P extends oe{constructor(e,t,s,i,o){var l;if(super(e,t,new K(s),i),this.eventListener=o,this.selectionService=new ae(this),this.api=new U(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,o||(this.eventListener=new V),(l=this.tableOptions)!=null&&l.autoRestoreOptions){const r=this.tableOptions.autoRestoreOptions,n=r.getStorageKeyFn;n&&(r.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new J(n)),r.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new Z(n)),r.autoRestoreSortingState&&(this.storeSortingService=new ee(n)))}this.mouseHandler=new q(this),this.inputHandler=new re(this),this.shortcutService=new ce(this),this.shortcutService.addListener(this.selectionService)}static create(e,t,s=new z,i=new V,o=new j){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 n;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 r=(n=i.rowSelectionModel)==null?void 0:n.getCheckedRows();this.eventListener.onCheckboxChanged(r||[])}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 r=i.sortStatesOrder?i.sortStatesOrder:this.tableOptions.sortOrder,n=i.sortState??"",a=r[(r.indexOf(n)+1)%r.length],d=new le(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 r=l,n=l.getRowCount();for(let a=0;a<n;a++){const d=l.getRowByIndex(a);if(d)if(o.allExpanded)d.expanded=!0;else if(o.allCollapsed)d.expanded=!1;else{const S=i(d.data);o.mode==="expanded"?d.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S):o.mode==="collapsed"&&(d.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S))}}r.recalcVisibleTreeRows()}}}}}const fe=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:r=>{e("checkboxChanged",r)},onContextmenu:r=>{e("contextmenu",r)},onModelChanged:r=>{e("modelChanged",r)},onMouseClicked:r=>{e("mouseClicked",r)},onMouseDragging:r=>{e("mouseDragging",r)},onMouseDraggingEnd:r=>{e("mouseDraggingEnd",r)},onMouseMoved:r=>{e("mouseMoved",r)}},l=new P(i,h.tableModel,new j,h.tableOptions,o);l.firstInit(),e("tableReady",l.getApi())};return D.onMounted(()=>{t.value&&s(t.value)}),{root:t}}});const be=(h,e)=>{const t=h.__vccOpts||h;for(const[s,i]of e)t[s]=i;return t},ye={ref:"root",class:"container-div",style:{width:"100%",height:"100%","background-color":"transparent",padding:"0",margin:"0"}};function ve(h,e,t,s,i,o){return D.openBlock(),D.createElementBlock("div",ye,null,512)}const X=be(fe,[["render",ve]]);class xe{constructor(e,t){this.component=e,this.appContext=t}render(e,t,s,i,o,l,r){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 Ce={install:(h,e={img:""})=>{h.component("GuiexpertTable",X)}};exports.ComponentRendererWrapper=xe;exports.GuiexpertTable=X;exports.default=Ce;
|
|
20
|
+
class="ge-table-cell-editor-input">`}}}class ue{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=A.singleRow(e.r1):this.selectionType==="column"&&(t=A.singleColumn(e.c1)),this.negativeRanges.push(t)}togglePoint(e,t){this.getSelectionCount(e,t)>0?this.removeSelection(A.singleCell(e,t)):this.addSelection(A.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 Se{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 ge=new ue,me=new Se("cell");class X{constructor(){this.overflowX="auto",this.overflowY="auto",this.horizontalBorderVisible=!0,this.verticalBorderVisible=!0,this.footerSeparatorBorderVisible=!0,this.headerSeparatorBorderVisible=!0,this.fixedEastSeparatorBorderVisible=!0,this.fixedWestSeparatorBorderVisible=!0,this.tableTopBorderVisible=!0,this.tableBottomBorderVisible=!0,this.hoverRowVisible=!0,this.hoverColumnVisible=!0,this.columnsResizable=!0,this.columnsDraggable=!0,this.columnResizeHandleWidthInPx=4,this.defaultRowHeights={header:34,body:34,footer:34},this.footerVerticalSeparator=!1,this.headerToggleExpandCollapseIcons=!1,this.headerVerticalSeparator=!1,this.treeOptions=new G,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new N,this.sortOrder=["asc","desc"],this.getEditRenderer=(e,t)=>new pe,this.getSelectionModel=()=>ge,this.getFocusModel=()=>me}}class P extends oe{constructor(e,t,s,i,o){var l;if(super(e,t,new K(s),i),this.eventListener=o,this.selectionService=new ae(this),this.api=new U(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,o||(this.eventListener=new V),(l=this.tableOptions)!=null&&l.autoRestoreOptions){const n=this.tableOptions.autoRestoreOptions,r=n.getStorageKeyFn;r&&(n.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new J(r)),n.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new Z(r)),n.autoRestoreSortingState&&(this.storeSortingService=new ee(r)))}this.mouseHandler=new q(this),this.inputHandler=new re(this),this.shortcutService=new ce(this),this.shortcutService.addListener(this.selectionService)}static create(e,t,s=new X,i=new V,o=new j){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 le(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 S=i(d.data);o.mode==="expanded"?d.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S):o.mode==="collapsed"&&(d.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S))}}n.recalcVisibleTreeRows()}}}}}const fe=D.defineComponent({inheritAttrs:!1,props:{tableModel:{required:!0},tableOptions:{required:!1,default:new X},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 j,h.tableOptions,o);l.firstInit(),e("tableReady",l.getApi())};return D.onMounted(()=>{t.value&&s(t.value)}),{root:t}}});const be=(h,e)=>{const t=h.__vccOpts||h;for(const[s,i]of e)t[s]=i;return t},ye={ref:"root",class:"container-div",style:{width:"100%",height:"100%","background-color":"transparent",padding:"0",margin:"0"}};function ve(h,e,t,s,i,o){return D.openBlock(),D.createElementBlock("div",ye,null,512)}const z=be(fe,[["render",ve]]);class Ce{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 xe={install:(h,e={img:""})=>{h.component("GuiexpertTable",z)}};exports.ComponentRendererWrapper=Ce;exports.GuiexpertTable=z;exports.default=xe;
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as z, ref as K, onMounted as Y, openBlock as q, createElementBlock as U, createVNode as J, render as k } from "vue";
|
|
2
2
|
function L(h) {
|
|
3
3
|
return h && h.type === "TreeRow";
|
|
4
4
|
}
|
|
@@ -6,8 +6,8 @@ function O(h) {
|
|
|
6
6
|
return h && h.type === "AreaModelTree";
|
|
7
7
|
}
|
|
8
8
|
class $ {
|
|
9
|
-
constructor(e = -1, t = -1, s = -1, i = -1, o, l,
|
|
10
|
-
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent = l, this.originalEvent =
|
|
9
|
+
constructor(e = -1, t = -1, s = -1, i = -1, o, l, n, r = 0, a = 0, d = 0, S = "") {
|
|
10
|
+
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 = S;
|
|
11
11
|
}
|
|
12
12
|
clone() {
|
|
13
13
|
return new $(
|
|
@@ -109,6 +109,9 @@ class Q {
|
|
|
109
109
|
addClass(e, t) {
|
|
110
110
|
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.addClass(t, s)) : this.domService.addClass(t, e), t;
|
|
111
111
|
}
|
|
112
|
+
removeClass(e, t) {
|
|
113
|
+
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.removeClass(t, s)) : this.domService.removeClass(t, e), t;
|
|
114
|
+
}
|
|
112
115
|
addClasses(e, t) {
|
|
113
116
|
if (e)
|
|
114
117
|
for (const s of e)
|
|
@@ -127,24 +130,24 @@ class Q {
|
|
|
127
130
|
return this.addClass(e, s), this.domService.appendChild(t, s), s;
|
|
128
131
|
}
|
|
129
132
|
addRowDiv(e, t, s = -1, i, o, l = "") {
|
|
130
|
-
const
|
|
131
|
-
if (this.domService.addClass(
|
|
133
|
+
const n = t.index ?? -1, r = this.getDivOrCreateDiv(n, e);
|
|
134
|
+
if (this.domService.addClass(r, "ge-table-row-div"), this.domService.addClass(r, `ge-table-row-div-${t.index}`), i === "body" && o === "center") {
|
|
132
135
|
const a = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
133
|
-
this.domService.addClass(
|
|
136
|
+
this.domService.addClass(r, `ge-table-row-${a}`);
|
|
134
137
|
}
|
|
135
|
-
if (this.domService.setStyle(
|
|
138
|
+
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) {
|
|
136
139
|
const a = this.domService.createText(l);
|
|
137
|
-
this.domService.appendChild(
|
|
140
|
+
this.domService.appendChild(r, a);
|
|
138
141
|
}
|
|
139
|
-
return this.domService.appendChild(e.child,
|
|
142
|
+
return this.domService.appendChild(e.child, r), r;
|
|
140
143
|
}
|
|
141
|
-
addColumnDiv(e, t, s = -1, i = -1, o, l,
|
|
144
|
+
addColumnDiv(e, t, s = -1, i = -1, o, l, n = "", r, a, d = void 0, S) {
|
|
142
145
|
const g = a == null ? void 0 : a.treeOptions, m = a == null ? void 0 : a.showCheckboxWihoutExtraColumn, c = this.domService.createElement("div");
|
|
143
146
|
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}`);
|
|
144
147
|
const b = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
145
|
-
if (o === "body" && l === "center" && this.domService.addClass(c, `ge-table-column-${b}`), 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`),
|
|
146
|
-
const p =
|
|
147
|
-
this.addLabelDiv(c,
|
|
148
|
+
if (o === "body" && l === "center" && this.domService.addClass(c, `ge-table-column-${b}`), 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) {
|
|
149
|
+
const p = r !== "none" && i === 0;
|
|
150
|
+
this.addLabelDiv(c, n, p, s, i, o);
|
|
148
151
|
}
|
|
149
152
|
return S && this.addSortedIcon(c, S, a == null ? void 0 : a.sortedOptions, i), this.domService.appendChild(e, c), c;
|
|
150
153
|
}
|
|
@@ -160,40 +163,40 @@ class Q {
|
|
|
160
163
|
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;
|
|
161
164
|
}
|
|
162
165
|
addLabelDiv(e, t = "", s = !1, i = -1, o = -1, l = "body") {
|
|
163
|
-
const
|
|
164
|
-
if (this.domService.addClass(
|
|
166
|
+
const n = this.domService.createElement("div");
|
|
167
|
+
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)
|
|
165
168
|
if (s) {
|
|
166
|
-
const
|
|
167
|
-
this.domService.appendChild(
|
|
169
|
+
const r = this.domService.createText(t);
|
|
170
|
+
this.domService.appendChild(n, r);
|
|
168
171
|
} else {
|
|
169
|
-
const
|
|
170
|
-
this.domService.appendChild(
|
|
172
|
+
const r = this.domService.createElement("div");
|
|
173
|
+
this.domService.appendChild(n, r);
|
|
171
174
|
const a = this.domService.createText(t);
|
|
172
|
-
this.domService.addClass(
|
|
175
|
+
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}`);
|
|
173
176
|
}
|
|
174
|
-
return this.domService.appendChild(e,
|
|
177
|
+
return this.domService.appendChild(e, n), n;
|
|
175
178
|
}
|
|
176
179
|
addSortedIcon(e, t = "", s = new N(), i = -1) {
|
|
177
180
|
const o = this.domService.createElement("div");
|
|
178
181
|
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");
|
|
179
182
|
let l;
|
|
180
183
|
t === "asc" ? l = s.iconAsc : t === "desc" ? l = s.iconDesc : l = s.iconPlaceholder;
|
|
181
|
-
const
|
|
182
|
-
this.domService.appendChild(o,
|
|
184
|
+
const n = l.content, r = this.domService.createText(n);
|
|
185
|
+
this.domService.appendChild(o, r), l.style && this.applyStyleString(o, l.style);
|
|
183
186
|
for (const a of l.classes)
|
|
184
187
|
this.domService.addClass(o, a);
|
|
185
188
|
return this.domService.appendChild(e, o), o;
|
|
186
189
|
}
|
|
187
190
|
addArrowDiv(e, t = "none", s = new G(), i = -1, o = -1, l = "body") {
|
|
188
|
-
const
|
|
189
|
-
this.domService.addClass(
|
|
190
|
-
let
|
|
191
|
-
t === "expanded" ?
|
|
192
|
-
const a =
|
|
193
|
-
this.domService.appendChild(
|
|
194
|
-
for (const S of
|
|
195
|
-
this.domService.addClass(
|
|
196
|
-
return this.domService.appendChild(e,
|
|
191
|
+
const n = this.domService.createElement("div");
|
|
192
|
+
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
|
+
let r;
|
|
194
|
+
t === "expanded" ? r = s.arrowExpanded : t === "collapsed" ? r = s.arrowCollapsed : r = s.arrowPlaceholder;
|
|
195
|
+
const a = r.content, d = this.domService.createText(a);
|
|
196
|
+
this.domService.appendChild(n, d), r.style && this.applyStyleString(n, r.style);
|
|
197
|
+
for (const S of r.classes)
|
|
198
|
+
this.domService.addClass(n, S);
|
|
199
|
+
return this.domService.appendChild(e, n), n;
|
|
197
200
|
}
|
|
198
201
|
addColumnBorderDivs(e, t, s, i, o) {
|
|
199
202
|
if (e.verticalBorderVisible) {
|
|
@@ -280,15 +283,15 @@ class ee {
|
|
|
280
283
|
}
|
|
281
284
|
onHostElementDblClicked(e) {
|
|
282
285
|
if (e.target instanceof HTMLElement) {
|
|
283
|
-
const t = e.target, s = t.getAttribute("data-area"), i = B(s), o = Number(t.getAttribute("data-row-index")), l = Number(t.getAttribute("data-col-index")),
|
|
286
|
+
const t = e.target, s = t.getAttribute("data-area"), i = B(s), o = Number(t.getAttribute("data-row-index")), l = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(i);
|
|
284
287
|
if (s && i === "header")
|
|
285
288
|
this.tableScope.tableModel.isSortable(l) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, l));
|
|
286
289
|
else if (t.getAttribute("data-row-index")) {
|
|
287
|
-
const
|
|
288
|
-
if (s && i === "body" &&
|
|
290
|
+
const r = n.getRowByIndex(o);
|
|
291
|
+
if (s && i === "body" && n.isEditable(o, l) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, l)), L(r) && l === this.getArrowColumnIndex()) {
|
|
289
292
|
e.preventDefault(), e.stopPropagation();
|
|
290
|
-
const a =
|
|
291
|
-
a.expanded = !a.expanded, "recalcVisibleTreeRows" in
|
|
293
|
+
const a = r;
|
|
294
|
+
a.expanded = !a.expanded, "recalcVisibleTreeRows" in n && n.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(a);
|
|
292
295
|
}
|
|
293
296
|
}
|
|
294
297
|
}
|
|
@@ -299,11 +302,11 @@ class ee {
|
|
|
299
302
|
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);
|
|
300
303
|
}
|
|
301
304
|
updateCollapsedExpandedState(e) {
|
|
302
|
-
var s, i, o, l,
|
|
305
|
+
var s, i, o, l, n;
|
|
303
306
|
const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
|
|
304
307
|
if (t) {
|
|
305
|
-
const
|
|
306
|
-
a ? (l = this.tableScope.storeStateCollapsedExpandService) == null || l.collapsedStateIdsPush(S) : d && ((
|
|
308
|
+
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, S = t(e.data);
|
|
309
|
+
a ? (l = this.tableScope.storeStateCollapsedExpandService) == null || l.collapsedStateIdsPush(S) : d && ((n = this.tableScope.storeStateCollapsedExpandService) == null || n.collapsedStateIdsRemove(S));
|
|
307
310
|
}
|
|
308
311
|
}
|
|
309
312
|
getArrowColumnIndex() {
|
|
@@ -343,8 +346,8 @@ class te {
|
|
|
343
346
|
constructor(e) {
|
|
344
347
|
this.tableScope = e;
|
|
345
348
|
}
|
|
346
|
-
updateCells(e) {
|
|
347
|
-
this.tableScope.updateCells(e);
|
|
349
|
+
updateCells(e, t = !1) {
|
|
350
|
+
this.tableScope.updateCells(e, t);
|
|
348
351
|
}
|
|
349
352
|
externalFilterChanged() {
|
|
350
353
|
this.tableScope.externalFilterChanged();
|
|
@@ -726,9 +729,9 @@ class ne {
|
|
|
726
729
|
let o = this.areaModel.getColspanAt(s, i), l = this.areaModel.getRowspanAt(s, i);
|
|
727
730
|
if (o > 1 || l > 1) {
|
|
728
731
|
o === 0 && (o = 1), l === 0 && (l = 1);
|
|
729
|
-
const
|
|
732
|
+
const n = this.areaModel.hasOwnProperty("gammaCells");
|
|
730
733
|
this.colAndRowspanRanges.push(
|
|
731
|
-
new A(s, i, s + l - 1, i + o - 1,
|
|
734
|
+
new A(s, i, s + l - 1, i + o - 1, n)
|
|
732
735
|
);
|
|
733
736
|
}
|
|
734
737
|
}
|
|
@@ -752,15 +755,15 @@ class ae {
|
|
|
752
755
|
}
|
|
753
756
|
class de extends re {
|
|
754
757
|
constructor(e, t, s, i) {
|
|
755
|
-
var l,
|
|
758
|
+
var l, n;
|
|
756
759
|
super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
757
760
|
header: [],
|
|
758
761
|
body: [],
|
|
759
762
|
footer: []
|
|
760
|
-
}, this.tree = !1, this.colAndRowspanModels = new ae(), 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), (
|
|
761
|
-
(
|
|
763
|
+
}, this.tree = !1, this.colAndRowspanModels = new ae(), 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), O(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
764
|
+
(r) => {
|
|
762
765
|
var a;
|
|
763
|
-
this.colAndRowspanModels[
|
|
766
|
+
this.colAndRowspanModels[r] = new ne(t, t.getAreaModel(r)), (a = this.colAndRowspanModels[r]) == null || a.init();
|
|
764
767
|
}
|
|
765
768
|
);
|
|
766
769
|
}
|
|
@@ -816,10 +819,12 @@ class de extends re {
|
|
|
816
819
|
var e, t;
|
|
817
820
|
this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
818
821
|
}
|
|
819
|
-
updateCells(e) {
|
|
822
|
+
updateCells(e, t = !1) {
|
|
820
823
|
e.forEach(
|
|
821
|
-
(
|
|
822
|
-
|
|
824
|
+
(s) => {
|
|
825
|
+
this.tableModel.getAreaModel(s.area).setValue(s.rowIndex, s.columnIndex, s.value), t || this.rerenderCellContent(s);
|
|
826
|
+
}
|
|
827
|
+
), t && this.repaint();
|
|
823
828
|
}
|
|
824
829
|
getAreaAndSideIdentByAttr(e) {
|
|
825
830
|
if (e) {
|
|
@@ -880,7 +885,7 @@ class de extends re {
|
|
|
880
885
|
var p;
|
|
881
886
|
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), l = i.child.clientHeight;
|
|
882
887
|
s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
|
|
883
|
-
const
|
|
888
|
+
const n = 0, r = this.areaBodyCenterGeo.width, a = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), S = d.getRowCount();
|
|
884
889
|
for (; this.cleanupFunctions[e].length; ) {
|
|
885
890
|
const u = this.cleanupFunctions[e].shift();
|
|
886
891
|
u && u();
|
|
@@ -888,10 +893,10 @@ class de extends re {
|
|
|
888
893
|
let g = t;
|
|
889
894
|
const m = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
|
|
890
895
|
for (let u = 0; u < S; u++) {
|
|
891
|
-
const
|
|
892
|
-
if (
|
|
896
|
+
const C = g, x = u === S - 1, w = this.tableModel.getRowHeight(e, u);
|
|
897
|
+
if (C + w > 0) {
|
|
893
898
|
this.firstVisibleRowIndex = u;
|
|
894
|
-
let v = { left:
|
|
899
|
+
let v = { left: n, width: r, height: w, top: C, index: u }, f = this.dom.addRowDiv(i, v, u, e, "center");
|
|
895
900
|
const R = b;
|
|
896
901
|
if (this.adjustColumnsToRowParent({
|
|
897
902
|
areaIdent: e,
|
|
@@ -903,8 +908,8 @@ class de extends re {
|
|
|
903
908
|
columnIndexStart: R,
|
|
904
909
|
columnIndexEnd: m - c - 1,
|
|
905
910
|
verticalFixed: !1,
|
|
906
|
-
lastRowOfModel:
|
|
907
|
-
}), a.left > 0 && (v = { left:
|
|
911
|
+
lastRowOfModel: x
|
|
912
|
+
}), a.left > 0 && (v = { left: n, width: this.areaBodyWestGeo.width, height: w, top: C, index: u }, f = this.dom.addRowDiv(s, v, u, e, "west"), this.adjustColumnsToRowParent({
|
|
908
913
|
areaIdent: e,
|
|
909
914
|
sideIdent: "west",
|
|
910
915
|
areaModel: d,
|
|
@@ -914,8 +919,8 @@ class de extends re {
|
|
|
914
919
|
columnIndexStart: 0,
|
|
915
920
|
columnIndexEnd: R - 1,
|
|
916
921
|
verticalFixed: !0,
|
|
917
|
-
lastRowOfModel:
|
|
918
|
-
})), a.right > 0 && (v = { left:
|
|
922
|
+
lastRowOfModel: x
|
|
923
|
+
})), a.right > 0 && (v = { left: n, width: this.areaBodyEastGeo.width, height: w, top: C, index: u }, f = this.dom.addRowDiv(o, v, u, e, "east"), this.adjustColumnsToRowParent({
|
|
919
924
|
areaIdent: e,
|
|
920
925
|
sideIdent: "east",
|
|
921
926
|
areaModel: d,
|
|
@@ -925,7 +930,7 @@ class de extends re {
|
|
|
925
930
|
columnIndexStart: m - c,
|
|
926
931
|
columnIndexEnd: m - 1,
|
|
927
932
|
verticalFixed: !0,
|
|
928
|
-
lastRowOfModel:
|
|
933
|
+
lastRowOfModel: x
|
|
929
934
|
})), e === "header" && this.tree && u === S - 1) {
|
|
930
935
|
const E = this.dom.applyStyle(
|
|
931
936
|
this.dom.setAttribute(
|
|
@@ -936,8 +941,8 @@ class de extends re {
|
|
|
936
941
|
{ cursor: "pointer" }
|
|
937
942
|
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
938
943
|
if (M) {
|
|
939
|
-
const
|
|
940
|
-
this.dom.domService.appendChild(E,
|
|
944
|
+
const F = this.dom.domService.createText(M.content);
|
|
945
|
+
this.dom.domService.appendChild(E, F), M.style && this.dom.applyStyleString(E, M.style);
|
|
941
946
|
}
|
|
942
947
|
}
|
|
943
948
|
}
|
|
@@ -947,17 +952,17 @@ class de extends re {
|
|
|
947
952
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
948
953
|
const u = ((p = this.colAndRowspanModels[e]) == null ? void 0 : p.getRanges()) ?? [];
|
|
949
954
|
if (u.length)
|
|
950
|
-
for (const
|
|
951
|
-
let
|
|
952
|
-
if (
|
|
955
|
+
for (const C of u) {
|
|
956
|
+
let x = 0, w = i.child, v = "center";
|
|
957
|
+
if (C.c1 < b)
|
|
953
958
|
w = s.child, v = "west";
|
|
954
|
-
else if (c > 0 &&
|
|
959
|
+
else if (c > 0 && C.c1 >= m - c)
|
|
955
960
|
w = o.child, v = "east";
|
|
956
961
|
else {
|
|
957
962
|
const f = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
958
|
-
|
|
963
|
+
x = this.scrollFactorX * f - this.areaBodyWestGeo.width, v = "center";
|
|
959
964
|
}
|
|
960
|
-
this.drawBigCell(
|
|
965
|
+
this.drawBigCell(C, x, t, d, w, v);
|
|
961
966
|
}
|
|
962
967
|
}
|
|
963
968
|
}
|
|
@@ -972,9 +977,9 @@ class de extends re {
|
|
|
972
977
|
* @protected
|
|
973
978
|
*/
|
|
974
979
|
drawBigCell(e, t, s, i, o, l) {
|
|
975
|
-
const
|
|
980
|
+
const n = s + this.getRowHeights(0, e.r1 - 1, i).reduce((p, u) => p + u, 0), r = this.tableModel.getColumnCount(), a = this.tableModel.getFixedRightColumnCount();
|
|
976
981
|
let d = 0;
|
|
977
|
-
a > 0 && e.c1 >=
|
|
982
|
+
a > 0 && e.c1 >= r - a && (d = r - a);
|
|
978
983
|
const S = t + this.getColumnWidths(d, e.c1 - 1).reduce((p, u) => p + u, 0), g = this.getRowHeights(e.r1, e.r2, i).reduce((p, u) => p + u, 0), m = this.getColumnWidths(e.c1, e.c2).reduce((p, u) => p + u, 0);
|
|
979
984
|
let c = !1;
|
|
980
985
|
const b = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
@@ -985,7 +990,7 @@ class de extends re {
|
|
|
985
990
|
rowIndex: e.r1,
|
|
986
991
|
columnIndex: e.c1,
|
|
987
992
|
left: S,
|
|
988
|
-
top:
|
|
993
|
+
top: n,
|
|
989
994
|
width: m,
|
|
990
995
|
height: g,
|
|
991
996
|
parent: o,
|
|
@@ -999,7 +1004,7 @@ class de extends re {
|
|
|
999
1004
|
rowIndex: e.r1,
|
|
1000
1005
|
columnIndex: e.c1,
|
|
1001
1006
|
left: S,
|
|
1002
|
-
top:
|
|
1007
|
+
top: n,
|
|
1003
1008
|
width: m,
|
|
1004
1009
|
height: g,
|
|
1005
1010
|
parent: o,
|
|
@@ -1010,7 +1015,7 @@ class de extends re {
|
|
|
1010
1015
|
rowIndex: e.r1,
|
|
1011
1016
|
columnIndex: e.c1,
|
|
1012
1017
|
cellLeft: S,
|
|
1013
|
-
cellTop:
|
|
1018
|
+
cellTop: n,
|
|
1014
1019
|
cellWidth: m,
|
|
1015
1020
|
cellHeight: g,
|
|
1016
1021
|
parent: o
|
|
@@ -1034,8 +1039,8 @@ class de extends re {
|
|
|
1034
1039
|
geo: i,
|
|
1035
1040
|
parent: o,
|
|
1036
1041
|
rowIndex: l,
|
|
1037
|
-
columnIndexStart:
|
|
1038
|
-
columnIndexEnd:
|
|
1042
|
+
columnIndexStart: n,
|
|
1043
|
+
columnIndexEnd: r,
|
|
1039
1044
|
verticalFixed: a = !1,
|
|
1040
1045
|
lastRowOfModel: d = !1
|
|
1041
1046
|
}) {
|
|
@@ -1048,21 +1053,21 @@ class de extends re {
|
|
|
1048
1053
|
}
|
|
1049
1054
|
const g = 0, m = !!(e === "body" && t);
|
|
1050
1055
|
let c = S;
|
|
1051
|
-
for (let p =
|
|
1052
|
-
const u = c,
|
|
1053
|
-
if (
|
|
1054
|
-
let
|
|
1056
|
+
for (let p = n; p <= r; p++) {
|
|
1057
|
+
const u = c, C = this.tableModel.getColumnWidth(p);
|
|
1058
|
+
if (C > 0 && u + C > 0) {
|
|
1059
|
+
let x = i.height;
|
|
1055
1060
|
const w = s.getRowspanAt(l, p), v = s.getColspanAt(l, p);
|
|
1056
|
-
w > 1 && (
|
|
1057
|
-
let f =
|
|
1061
|
+
w > 1 && (x = this.getRowHeights(l, l + w - 1, s).reduce((E, M) => E + M, 0));
|
|
1062
|
+
let f = C;
|
|
1058
1063
|
v > 1 && (f = this.getColumnWidths(p, p + v - 1).reduce((E, M) => E + M, 0));
|
|
1059
1064
|
let R = !1;
|
|
1060
1065
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(l, p) && (R = !0), this.draggingTargetColumnIndex === p && e !== "header") {
|
|
1061
|
-
this.renderDragTargetDiv(o, u, g, f,
|
|
1062
|
-
const E = { left: u, top: g, width: f, height:
|
|
1066
|
+
this.renderDragTargetDiv(o, u, g, f, x);
|
|
1067
|
+
const E = { left: u, top: g, width: f, height: x };
|
|
1063
1068
|
this.dom.addColumnBorderDivs(this.tableOptions, o, E, e, t);
|
|
1064
1069
|
} else {
|
|
1065
|
-
const E = this.renderSelectedBackgroundDiv(R, m, t, s, l, p, o, u, g, f,
|
|
1070
|
+
const E = this.renderSelectedBackgroundDiv(R, m, t, s, l, p, o, u, g, f, x);
|
|
1066
1071
|
R || this.renderCell({
|
|
1067
1072
|
areaModel: s,
|
|
1068
1073
|
areaIdent: e,
|
|
@@ -1072,7 +1077,7 @@ class de extends re {
|
|
|
1072
1077
|
left: u,
|
|
1073
1078
|
top: g,
|
|
1074
1079
|
width: f,
|
|
1075
|
-
height:
|
|
1080
|
+
height: x,
|
|
1076
1081
|
parent: o,
|
|
1077
1082
|
cellSelected: E,
|
|
1078
1083
|
lastRowOfModel: d,
|
|
@@ -1083,12 +1088,12 @@ class de extends re {
|
|
|
1083
1088
|
cellLeft: u,
|
|
1084
1089
|
cellTop: g,
|
|
1085
1090
|
cellWidth: f,
|
|
1086
|
-
cellHeight:
|
|
1091
|
+
cellHeight: x,
|
|
1087
1092
|
parent: o
|
|
1088
1093
|
});
|
|
1089
1094
|
}
|
|
1090
1095
|
}
|
|
1091
|
-
if (c = c +
|
|
1096
|
+
if (c = c + C, c > this.areaBodyCenterGeo.width)
|
|
1092
1097
|
break;
|
|
1093
1098
|
}
|
|
1094
1099
|
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(c - 1, 1, i.height, 0), o);
|
|
@@ -1103,25 +1108,25 @@ class de extends re {
|
|
|
1103
1108
|
rowIndex: i,
|
|
1104
1109
|
index: o,
|
|
1105
1110
|
left: l,
|
|
1106
|
-
width:
|
|
1107
|
-
height:
|
|
1111
|
+
width: n,
|
|
1112
|
+
height: r,
|
|
1108
1113
|
top: a,
|
|
1109
1114
|
parent: d,
|
|
1110
1115
|
lastRowOfModel: S
|
|
1111
1116
|
}) {
|
|
1112
1117
|
var _;
|
|
1113
|
-
const m = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), c = { left: l, width:
|
|
1118
|
+
const m = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), c = { left: l, width: n, height: r, top: a, index: o }, b = e.getRowByIndex(i);
|
|
1114
1119
|
let p = "none";
|
|
1115
1120
|
if (o === this.getTreeArrowColumnIndex() && L(b)) {
|
|
1116
1121
|
const y = b;
|
|
1117
1122
|
(_ = y.children) != null && _.length ? y.expanded ? p = "expanded" : p = "collapsed" : p = "hidden";
|
|
1118
1123
|
}
|
|
1119
|
-
let
|
|
1124
|
+
let C;
|
|
1120
1125
|
if (t === "header") {
|
|
1121
1126
|
const y = this.tableModel.getColumnDef(o);
|
|
1122
|
-
(!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (
|
|
1127
|
+
(!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (C = y == null ? void 0 : y.sortState);
|
|
1123
1128
|
}
|
|
1124
|
-
const
|
|
1129
|
+
const x = e.getValueAt(i, o), w = m ? "" : `${x}`, v = e.isRowChecked(i), f = this.dom.addColumnDiv(
|
|
1125
1130
|
d,
|
|
1126
1131
|
c,
|
|
1127
1132
|
i,
|
|
@@ -1132,25 +1137,49 @@ class de extends re {
|
|
|
1132
1137
|
p,
|
|
1133
1138
|
this.tableOptions,
|
|
1134
1139
|
v,
|
|
1135
|
-
|
|
1140
|
+
C
|
|
1136
1141
|
), R = e.getTooltipAt(i, o);
|
|
1137
1142
|
R && this.dom.setAttribute(f, "title", R);
|
|
1138
1143
|
const E = this.tableModel.getColumnDef(o);
|
|
1139
1144
|
E && E.classes[t] && this.dom.addClasses(E.classes[t], f);
|
|
1140
1145
|
let M;
|
|
1141
|
-
m && (M = m.render(f, i, o, t, e,
|
|
1142
|
-
const
|
|
1143
|
-
if (
|
|
1146
|
+
m && (M = m.render(f, i, o, t, e, x, this.dom.domService));
|
|
1147
|
+
const F = e.getCustomClassesAt(i, o);
|
|
1148
|
+
if (F.length && this.dom.addClasses(F, f), this.dom.addColumnBorderDivs(this.tableOptions, d, c, t, s), S && this.dom.addHorizontalBorder({ left: l, width: n, height: r, top: a + r }, d), this.getFocusModel && t === "body") {
|
|
1144
1149
|
const y = this.getFocusModel();
|
|
1145
1150
|
y != null && y.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, c, {});
|
|
1146
1151
|
}
|
|
1147
1152
|
t === "header" && this.dom.setAttribute(f, "data-ge-action", "drag-column");
|
|
1148
|
-
const
|
|
1149
|
-
if (
|
|
1150
|
-
for (const y in
|
|
1151
|
-
this.dom.setStyle(f, y,
|
|
1153
|
+
const I = e.getCustomStyleAt(i, o);
|
|
1154
|
+
if (I)
|
|
1155
|
+
for (const y in I)
|
|
1156
|
+
this.dom.setStyle(f, y, I[y]);
|
|
1152
1157
|
return [f, M];
|
|
1153
1158
|
}
|
|
1159
|
+
applyCssClasses(e, t = {}) {
|
|
1160
|
+
e && Object.entries(t).forEach(([s, i]) => {
|
|
1161
|
+
i ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: i, cssClasses: o }) {
|
|
1165
|
+
const l = this.tableModel.getAreaModel(e), n = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', r = document.querySelector(n);
|
|
1166
|
+
if (r) {
|
|
1167
|
+
let a;
|
|
1168
|
+
const S = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s ? this.editorRenderer : l.getCellRenderer(t, s);
|
|
1169
|
+
if (r.innerText = "", this.applyCssClasses(r, o), S)
|
|
1170
|
+
a = S.render(r, t, s, e, l, i, this.dom.domService), a && this.cleanupFunctions[e].push(a);
|
|
1171
|
+
else {
|
|
1172
|
+
const c = `${i}`;
|
|
1173
|
+
this.dom.addLabelDiv(r, c, !1, t, s, e);
|
|
1174
|
+
}
|
|
1175
|
+
const g = l.getCustomClassesAt(t, s);
|
|
1176
|
+
g.length && this.dom.addClasses(g, r);
|
|
1177
|
+
const m = l.getCustomStyleAt(t, s);
|
|
1178
|
+
if (m)
|
|
1179
|
+
for (const c in m)
|
|
1180
|
+
this.dom.setStyle(r, c, m[c]);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1154
1183
|
getColumnWidths(e, t) {
|
|
1155
1184
|
const s = [];
|
|
1156
1185
|
for (let i = e; i <= t; i++)
|
|
@@ -1208,7 +1237,7 @@ class de extends re {
|
|
|
1208
1237
|
);
|
|
1209
1238
|
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;
|
|
1210
1239
|
}
|
|
1211
|
-
renderSelectedBackgroundDiv(e, t, s, i, o, l,
|
|
1240
|
+
renderSelectedBackgroundDiv(e, t, s, i, o, l, n, r, a, d, S) {
|
|
1212
1241
|
let g = !1;
|
|
1213
1242
|
if (!e && t && i.isSelectable(o, l) && this.getSelectionModel) {
|
|
1214
1243
|
const m = this.getSelectionModel();
|
|
@@ -1218,9 +1247,9 @@ class de extends re {
|
|
|
1218
1247
|
for (let b = 0; b < c; b++) {
|
|
1219
1248
|
const p = this.dom.applyStylePosistionAbsolute(
|
|
1220
1249
|
// ge-table-body-west-selected-range
|
|
1221
|
-
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`,
|
|
1250
|
+
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, n)
|
|
1222
1251
|
);
|
|
1223
|
-
this.dom.setStyle(p, "left", `${
|
|
1252
|
+
this.dom.setStyle(p, "left", `${r}px`), this.dom.setStyle(p, "top", `${a}px`), this.dom.setStyle(p, "width", `${d}px`), this.dom.setStyle(p, "height", `${S}px`);
|
|
1224
1253
|
}
|
|
1225
1254
|
}
|
|
1226
1255
|
}
|
|
@@ -1233,8 +1262,8 @@ class de extends re {
|
|
|
1233
1262
|
rowIndex: i,
|
|
1234
1263
|
columnIndex: o,
|
|
1235
1264
|
left: l,
|
|
1236
|
-
top:
|
|
1237
|
-
width:
|
|
1265
|
+
top: n,
|
|
1266
|
+
width: r,
|
|
1238
1267
|
height: a,
|
|
1239
1268
|
parent: d,
|
|
1240
1269
|
cellSelected: S,
|
|
@@ -1248,18 +1277,18 @@ class de extends re {
|
|
|
1248
1277
|
rowIndex: i,
|
|
1249
1278
|
index: o,
|
|
1250
1279
|
left: l,
|
|
1251
|
-
width:
|
|
1280
|
+
width: r,
|
|
1252
1281
|
height: a,
|
|
1253
|
-
top:
|
|
1282
|
+
top: n,
|
|
1254
1283
|
parent: d,
|
|
1255
1284
|
lastRowOfModel: g,
|
|
1256
1285
|
gammaRange: m
|
|
1257
1286
|
});
|
|
1258
1287
|
S && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, c), b && this.cleanupFunctions[t].push(b);
|
|
1259
1288
|
}
|
|
1260
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: l, parent:
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1289
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: l, parent: n }) {
|
|
1290
|
+
const r = this.dom.domService, a = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = r.createElement("div");
|
|
1291
|
+
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);
|
|
1263
1292
|
}
|
|
1264
1293
|
}
|
|
1265
1294
|
class he {
|
|
@@ -1275,8 +1304,8 @@ class ce {
|
|
|
1275
1304
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1276
1305
|
const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
|
|
1277
1306
|
if (s && i && o) {
|
|
1278
|
-
const l = B(s),
|
|
1279
|
-
this.tableScope.updateModelValueAfterEdit(l,
|
|
1307
|
+
const l = B(s), n = Number(i), r = Number(o);
|
|
1308
|
+
this.tableScope.updateModelValueAfterEdit(l, n, r, t.value);
|
|
1280
1309
|
}
|
|
1281
1310
|
}
|
|
1282
1311
|
}
|
|
@@ -1300,11 +1329,11 @@ class ue {
|
|
|
1300
1329
|
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);
|
|
1301
1330
|
}
|
|
1302
1331
|
onMouseClicked(e, t) {
|
|
1303
|
-
var o, l,
|
|
1332
|
+
var o, l, n, r, a, d, S;
|
|
1304
1333
|
let s = !1, i = !1;
|
|
1305
1334
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1306
1335
|
const g = this.getSelectionModel(), m = this.getFocusModel();
|
|
1307
|
-
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) : (
|
|
1336
|
+
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(A.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0) : (a = e.originalEvent) != null && a.altKey && ((d = e.originalEvent) != null && d.ctrlKey || (S = e.originalEvent) != null && S.metaKey) && (g.removeSelection(A.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
|
|
1308
1337
|
}
|
|
1309
1338
|
return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
1310
1339
|
}
|
|
@@ -1441,7 +1470,7 @@ class V {
|
|
|
1441
1470
|
onMouseMoved(e) {
|
|
1442
1471
|
}
|
|
1443
1472
|
}
|
|
1444
|
-
class
|
|
1473
|
+
class j {
|
|
1445
1474
|
setStyle(e, t, s) {
|
|
1446
1475
|
return e.style[t] = s, e;
|
|
1447
1476
|
}
|
|
@@ -1452,6 +1481,9 @@ class z {
|
|
|
1452
1481
|
addClass(e, t) {
|
|
1453
1482
|
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
1454
1483
|
}
|
|
1484
|
+
removeClass(e, t) {
|
|
1485
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.remove(s)) : e.classList.remove(t), e;
|
|
1486
|
+
}
|
|
1455
1487
|
appendChild(e, t) {
|
|
1456
1488
|
e.appendChild(t);
|
|
1457
1489
|
}
|
|
@@ -1466,14 +1498,14 @@ class z {
|
|
|
1466
1498
|
}
|
|
1467
1499
|
}
|
|
1468
1500
|
class fe {
|
|
1469
|
-
render(e, t, s, i, o, l,
|
|
1501
|
+
render(e, t, s, i, o, l, n) {
|
|
1470
1502
|
if (o.isEditable(t, s)) {
|
|
1471
|
-
|
|
1472
|
-
const
|
|
1503
|
+
n.addClass(e, "ge-table-row-input-div");
|
|
1504
|
+
const r = o.getValueAt(t, s);
|
|
1473
1505
|
e.innerHTML = `
|
|
1474
1506
|
<input
|
|
1475
1507
|
type="text"
|
|
1476
|
-
value="${
|
|
1508
|
+
value="${r}"
|
|
1477
1509
|
autofocus
|
|
1478
1510
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1479
1511
|
data-listen="change"
|
|
@@ -1553,14 +1585,14 @@ class ye {
|
|
|
1553
1585
|
return [this.rowIndex, this.columnIndex];
|
|
1554
1586
|
}
|
|
1555
1587
|
}
|
|
1556
|
-
const ve = new be(),
|
|
1557
|
-
class
|
|
1588
|
+
const ve = new be(), Ce = new ye("cell");
|
|
1589
|
+
class X {
|
|
1558
1590
|
constructor() {
|
|
1559
1591
|
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 = {
|
|
1560
1592
|
header: 34,
|
|
1561
1593
|
body: 34,
|
|
1562
1594
|
footer: 34
|
|
1563
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new G(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new N(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new fe(), this.getSelectionModel = () => ve, this.getFocusModel = () =>
|
|
1595
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new G(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new N(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new fe(), this.getSelectionModel = () => ve, this.getFocusModel = () => Ce;
|
|
1564
1596
|
}
|
|
1565
1597
|
}
|
|
1566
1598
|
class P extends de {
|
|
@@ -1572,12 +1604,12 @@ class P extends de {
|
|
|
1572
1604
|
new Q(s),
|
|
1573
1605
|
i
|
|
1574
1606
|
), this.eventListener = o, this.selectionService = new ue(this), this.api = new te(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new V()), (l = this.tableOptions) != null && l.autoRestoreOptions) {
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1607
|
+
const n = this.tableOptions.autoRestoreOptions, r = n.getStorageKeyFn;
|
|
1608
|
+
r && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new se(r)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new oe(r)), n.autoRestoreSortingState && (this.storeSortingService = new le(r)));
|
|
1577
1609
|
}
|
|
1578
1610
|
this.mouseHandler = new ee(this), this.inputHandler = new ce(this), this.shortcutService = new me(this), this.shortcutService.addListener(this.selectionService);
|
|
1579
1611
|
}
|
|
1580
|
-
static create(e, t, s = new
|
|
1612
|
+
static create(e, t, s = new X(), i = new V(), o = new j()) {
|
|
1581
1613
|
return new P(
|
|
1582
1614
|
e,
|
|
1583
1615
|
t,
|
|
@@ -1648,11 +1680,11 @@ class P extends de {
|
|
|
1648
1680
|
O(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
1649
1681
|
}
|
|
1650
1682
|
toggleRowCheckbox(e, t, s) {
|
|
1651
|
-
var
|
|
1683
|
+
var r;
|
|
1652
1684
|
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), l = o === void 0 || o === "semi" || o === "none";
|
|
1653
1685
|
i.setRowChecked(e, l), this.repaint();
|
|
1654
|
-
const
|
|
1655
|
-
this.eventListener.onCheckboxChanged(
|
|
1686
|
+
const n = (r = i.rowSelectionModel) == null ? void 0 : r.getCheckedRows();
|
|
1687
|
+
this.eventListener.onCheckboxChanged(n || []);
|
|
1656
1688
|
}
|
|
1657
1689
|
onMouseClicked(e, t) {
|
|
1658
1690
|
let s = this.selectionService.onMouseClicked(e, t);
|
|
@@ -1671,7 +1703,7 @@ class P extends de {
|
|
|
1671
1703
|
const i = this.tableModel.getColumnDef(s);
|
|
1672
1704
|
if (i != null && i.sortable && i.sortable()) {
|
|
1673
1705
|
e.preventDefault(), e.stopPropagation();
|
|
1674
|
-
const
|
|
1706
|
+
const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, r = i.sortState ?? "", a = n[(n.indexOf(r) + 1) % n.length], d = new he(s, a);
|
|
1675
1707
|
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]);
|
|
1676
1708
|
}
|
|
1677
1709
|
}
|
|
@@ -1717,8 +1749,8 @@ class P extends de {
|
|
|
1717
1749
|
if (s.autoRestoreCollapsedExpandedState && i) {
|
|
1718
1750
|
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), l = this.tableModel.getAreaModel("body");
|
|
1719
1751
|
if (O(l)) {
|
|
1720
|
-
const
|
|
1721
|
-
for (let a = 0; a <
|
|
1752
|
+
const n = l, r = l.getRowCount();
|
|
1753
|
+
for (let a = 0; a < r; a++) {
|
|
1722
1754
|
const d = l.getRowByIndex(a);
|
|
1723
1755
|
if (d)
|
|
1724
1756
|
if (o.allExpanded)
|
|
@@ -1730,13 +1762,13 @@ class P extends de {
|
|
|
1730
1762
|
o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S) : o.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S));
|
|
1731
1763
|
}
|
|
1732
1764
|
}
|
|
1733
|
-
|
|
1765
|
+
n.recalcVisibleTreeRows();
|
|
1734
1766
|
}
|
|
1735
1767
|
}
|
|
1736
1768
|
}
|
|
1737
1769
|
}
|
|
1738
1770
|
}
|
|
1739
|
-
const
|
|
1771
|
+
const xe = z({
|
|
1740
1772
|
inheritAttrs: !1,
|
|
1741
1773
|
props: {
|
|
1742
1774
|
tableModel: {
|
|
@@ -1744,7 +1776,7 @@ const Ce = X({
|
|
|
1744
1776
|
},
|
|
1745
1777
|
tableOptions: {
|
|
1746
1778
|
required: !1,
|
|
1747
|
-
default: new
|
|
1779
|
+
default: new X()
|
|
1748
1780
|
},
|
|
1749
1781
|
debounceMouseClickDelay: {
|
|
1750
1782
|
required: !1,
|
|
@@ -1764,31 +1796,31 @@ const Ce = X({
|
|
|
1764
1796
|
setup(h, { emit: e }) {
|
|
1765
1797
|
const t = K(null), s = (i) => {
|
|
1766
1798
|
const o = {
|
|
1767
|
-
onCheckboxChanged: (
|
|
1768
|
-
e("checkboxChanged",
|
|
1799
|
+
onCheckboxChanged: (n) => {
|
|
1800
|
+
e("checkboxChanged", n);
|
|
1769
1801
|
},
|
|
1770
|
-
onContextmenu: (
|
|
1771
|
-
e("contextmenu",
|
|
1802
|
+
onContextmenu: (n) => {
|
|
1803
|
+
e("contextmenu", n);
|
|
1772
1804
|
},
|
|
1773
|
-
onModelChanged: (
|
|
1774
|
-
e("modelChanged",
|
|
1805
|
+
onModelChanged: (n) => {
|
|
1806
|
+
e("modelChanged", n);
|
|
1775
1807
|
},
|
|
1776
|
-
onMouseClicked: (
|
|
1777
|
-
e("mouseClicked",
|
|
1808
|
+
onMouseClicked: (n) => {
|
|
1809
|
+
e("mouseClicked", n);
|
|
1778
1810
|
},
|
|
1779
|
-
onMouseDragging: (
|
|
1780
|
-
e("mouseDragging",
|
|
1811
|
+
onMouseDragging: (n) => {
|
|
1812
|
+
e("mouseDragging", n);
|
|
1781
1813
|
},
|
|
1782
|
-
onMouseDraggingEnd: (
|
|
1783
|
-
e("mouseDraggingEnd",
|
|
1814
|
+
onMouseDraggingEnd: (n) => {
|
|
1815
|
+
e("mouseDraggingEnd", n);
|
|
1784
1816
|
},
|
|
1785
|
-
onMouseMoved: (
|
|
1786
|
-
e("mouseMoved",
|
|
1817
|
+
onMouseMoved: (n) => {
|
|
1818
|
+
e("mouseMoved", n);
|
|
1787
1819
|
}
|
|
1788
1820
|
}, l = new P(
|
|
1789
1821
|
i,
|
|
1790
1822
|
h.tableModel,
|
|
1791
|
-
new
|
|
1823
|
+
new j(),
|
|
1792
1824
|
h.tableOptions,
|
|
1793
1825
|
o
|
|
1794
1826
|
);
|
|
@@ -1814,12 +1846,12 @@ const we = (h, e) => {
|
|
|
1814
1846
|
function Ae(h, e, t, s, i, o) {
|
|
1815
1847
|
return q(), U("div", Ee, null, 512);
|
|
1816
1848
|
}
|
|
1817
|
-
const Me = /* @__PURE__ */ we(
|
|
1849
|
+
const Me = /* @__PURE__ */ we(xe, [["render", Ae]]);
|
|
1818
1850
|
class Te {
|
|
1819
1851
|
constructor(e, t) {
|
|
1820
1852
|
this.component = e, this.appContext = t;
|
|
1821
1853
|
}
|
|
1822
|
-
render(e, t, s, i, o, l,
|
|
1854
|
+
render(e, t, s, i, o, l, n) {
|
|
1823
1855
|
return this.mount(
|
|
1824
1856
|
this.component,
|
|
1825
1857
|
{
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ge-table{display:block;margin:0;width:100%;height:100%}.ge-table-col-div{text-align:center;line-height:2.5;-webkit-user-select:none;user-select:none}.ge-table-label-div{padding:0;display:block;text-overflow:ellipsis;overflow:hidden}.ge-table-label-div .ge-table-label{padding-left:10px;padding-right:10px}.ge-table-text-align-left{text-align:left}.ge-table-text-align-right{text-align:right}.ge-table-text-align-center{text-align:center}.ge-table-row-checkbox-div{padding-left:14px}.ge-table{background-color:var(--ge-table-bg)}.ge-table-header-west{background-color:var(--ge-table-header-west-bg)}.ge-table-header-center{background-color:var(--ge-table-header-center-bg)}.ge-table-header-east{background-color:var(--ge-table-header-east-bg)}.ge-table-header-west{color:var(--ge-table-header-west-text)}.ge-table-header-center{color:var(--ge-table-header-center-text)}.ge-table-header-east{color:var(--ge-table-header-east-text)}.ge-table-header-west-horizontal-border{background-color:var(--ge-table-header-west-horizontal-border)}.ge-table-header-west-vertical-border{background-color:var(--ge-table-header-west-vertical-border)}.ge-table-header-center-horizontal-border{background-color:var(--ge-table-header-center-horizontal-border)}.ge-table-header-center-vertical-border{background-color:var(--ge-table-header-center-vertical-border)}.ge-table-header-east-horizontal-border{background-color:var(--ge-table-header-east-horizontal-border)}.ge-table-header-east-vertical-border{background-color:var(--ge-table-header-east-vertical-border)}.ge-table-body-west{background-color:var(--ge-table-body-west-bg)}.ge-table-body-center{background-color:var(--ge-table-body-center-bg)}.ge-table-body-east{background-color:var(--ge-table-body-east-bg)}.ge-table-body-west{color:var(--ge-table-body-west-text)}.ge-table-body-center{color:var(--ge-table-body-center-text)}.ge-table-body-east{color:var(--ge-table-body-east-text)}.ge-table-body-west-horizontal-border{background-color:var(--ge-table-body-west-horizontal-border)}.ge-table-body-west-vertical-border{background-color:var(--ge-table-body-west-vertical-border)}.ge-table-body-center-horizontal-border{background-color:var(--ge-table-body-center-horizontal-border)}.ge-table-body-center-vertical-border{background-color:var(--ge-table-body-center-vertical-border)}.ge-table-body-east-horizontal-border{background-color:var(--ge-table-body-east-horizontal-border)}.ge-table-body-east-vertical-border{background-color:var(--ge-table-body-east-vertical-border)}.ge-table-body-west-selected-range{background-color:var(--ge-table-body-west-selected-range-bg)}.ge-table-body-center-selected-range{background-color:var(--ge-table-body-center-selected-range-bg)}.ge-table-body-east-selected-range{background-color:var(--ge-table-body-east-selected-range-bg)}.ge-table-body-west-selected-range{color:var(--ge-table-body-west-selected-range-text)}.ge-table-body-center-selected-range{color:var(--ge-table-body-center-selected-range-text)}.ge-table-body-east-selected-range{color:var(--ge-table-body-east-selected-range-text)}.ge-table-footer-west{background-color:var(--ge-table-footer-west-bg)}.ge-table-footer-center{background-color:var(--ge-table-footer-center-bg)}.ge-table-footer-east{background-color:var(--ge-table-footer-east-bg)}.ge-table-footer-west{color:var(--ge-table-footer-west-text)}.ge-table-footer-center{color:var(--ge-table-footer-center-text)}.ge-table-footer-east{color:var(--ge-table-footer-east-text)}.ge-table-footer-west-horizontal-border{background-color:var(--ge-table-footer-west-horizontal-border)}.ge-table-footer-west-vertical-border{background-color:var(--ge-table-footer-west-vertical-border)}.ge-table-footer-center-horizontal-border{background-color:var(--ge-table-footer-center-horizontal-border)}.ge-table-footer-center-vertical-border{background-color:var(--ge-table-footer-center-vertical-border)}.ge-table-footer-east-horizontal-border{background-color:var(--ge-table-footer-east-horizontal-border)}.ge-table-footer-east-vertical-border{background-color:var(--ge-table-footer-east-vertical-border)}.ge-table-border{background-color:var(--ge-table-border)}.ge-table-row-odd{background-color:var(--ge-table-row-odd-bg)}.ge-table-row-even{background-color:var(--ge-table-row-even-bg)}.ge-table-column-odd{background-color:var(--ge-table-column-odd-bg)}.ge-table-column-even{background-color:var(--ge-table-column-even-bg)}.ge-table-hover-column{background-color:var(--ge-table-hover-column-bg)}.ge-table-hover-row{background-color:var(--ge-table-hover-row-bg)}.ge-table-focus-border{background-color:var(--ge-table-focus-border)}.ge-table-color-col-resize-handle-hover{background-color:var(--ge-table-color-col-resize-handle-hover-bg)}.ge-table-color-dragged-col-div{background-color:var(--ge-table-color-dragged-col-div-bg)}.ge-table-color-drop-zone{background-color:var(--ge-table-color-drop-zone-bg)}.ge-table-color-drop-zone{background-color:var(--ge-table-color-drop-zone)}.ge-table-color-tree-arrow-collapsed-color{background-color:var(--ge-table-color-tree-arrow-collapsed-color)}.ge-table-color-error{color:var(--ge-table-color-error-text)}.ge-table-tree-arrow-collapsed{color:var(--ge-table-tree-arrow-collapsed-color)}.ge-table-column-resize-handle:hover{background-color:var(--ge-table-column-resize-handle-border)}.ge-table-drop-zone{background-color:var(--ge-table-drop-zone-bg)}.ge-table-dragged-col-div{background-color:var(--ge-table-dragged-col-div-bg)}.ge-table-cell-editor-input,.ge-table-cell-editor-input:focus-within{border:none}html,:root [data-theme=light]{--ge-table-bg: #fff;--ge-table-header-west-bg: var(--ge-table-header-center-bg);--ge-table-header-center-bg: rgba(233, 233, 233, .5);--ge-table-header-east-bg: var(--ge-table-header-center-bg);--ge-table-header-west-text: var(--ge-table-header-center-text);--ge-table-header-center-text: #000;--ge-table-header-east-text: var(--ge-table-header-center-text);--ge-table-header-west-horizontal-border: var(--ge-table-header-center-horizontal-border);--ge-table-header-west-vertical-border: var(--ge-table-header-center-vertical-border);--ge-table-header-center-horizontal-border: #ddd;--ge-table-header-center-vertical-border: #ccc;--ge-table-header-east-horizontal-border: var(--ge-table-header-center-horizontal-border);--ge-table-header-east-vertical-border: var(--ge-table-header-center-vertical-border);--ge-table-body-west-bg: var(--ge-table-header-center-bg);--ge-table-body-center-bg: rgba(255,255,255, .5);--ge-table-body-east-bg: var(--ge-table-header-center-bg);--ge-table-body-west-text: var(--ge-table-header-center-text);--ge-table-body-center-text: var(--ge-table-header-center-text);--ge-table-body-east-text: var(--ge-table-header-center-text);--ge-table-body-west-horizontal-border: var(--ge-table-header-west-horizontal-border);--ge-table-body-west-vertical-border: var(--ge-table-header-west-vertical-border);--ge-table-body-center-horizontal-border: #bbb;--ge-table-body-center-vertical-border: #ddd;--ge-table-body-east-horizontal-border: var(--ge-table-header-east-horizontal-border);--ge-table-body-east-vertical-border: var(--ge-table-header-east-vertical-border);--ge-table-footer-west-bg: var(--ge-table-header-center-bg);--ge-table-footer-center-bg: var(--ge-table-header-center-bg);--ge-table-footer-east-bg: var(--ge-table-header-center-bg);--ge-table-footer-west-text: var(--ge-table-header-center-text);--ge-table-footer-center-text: var(--ge-table-header-center-text);--ge-table-footer-east-text: var(--ge-table-header-center-text);--ge-table-footer-west-horizontal-border: var(--ge-table-header-west-horizontal-border);--ge-table-footer-west-vertical-border: var(--ge-table-header-west-vertical-border);--ge-table-footer-center-horizontal-border: var(--ge-table-header-center-horizontal-border);--ge-table-footer-center-vertical-border: var(--ge-table-header-center-vertical-border);--ge-table-footer-east-horizontal-border: var(--ge-table-header-east-horizontal-border);--ge-table-footer-east-vertical-border: var(--ge-table-header-east-vertical-border);--ge-table-body-west-selected-range-bg: rgba(0, 152, 219, .4);--ge-table-body-center-selected-range-bg: rgba(0, 152, 219, .4);--ge-table-body-east-selected-range-bg: rgba(0, 152, 219, .4);--ge-table-body-west-selected-range-text: #000;--ge-table-body-center-selected-range-text: #000;--ge-table-body-east-selected-range-text: #000;--ge-table-border: #ccc;--ge-table-row-odd-bg: transparent;--ge-table-row-even-bg: transparent;--ge-table-column-odd-bg: transparent;--ge-table-column-even-bg: transparent;--ge-table-hover-column-bg: rgba(0, 224, 255, .27);--ge-table-hover-row-bg: rgba(0, 224, 255, .27);--ge-table-focus-border: rgb(0, 255, 255);--ge-table-color-error-text: #e00034;--ge-table-tree-arrow-collapsed-color: #e00034;--ge-table-column-resize-handle-border: rgb(0, 255, 255);--ge-table-dragged-col-div-bg: lightcyan;--ge-table-drop-zone-bg: rgba(244, 255, 242, .6);--ge-table-color-col-resize-handle-hover-bg: cyan;--ge-table-color-dragged-col-div-bg: #fafafa;--ge-table-color-drop-zone-bg: #fafafa;--ge-table-color-drop-zone: #fafafa;--ge-table-color-tree-arrow-collapsed-color: var(--ge-table-body-west-text)}:root [data-theme=dark]{--ge-table-bg: #000;--ge-table-header-west-bg: oklch(0% 0 0);--ge-table-header-center-bg: oklch(0% 0 0);--ge-table-header-east-bg: oklch(0% 0 0);--ge-table-header-west-text: oklch(100% 0 0);--ge-table-header-center-text: oklch(100% 0 0);--ge-table-header-east-text: oklch(100% 0 0);--ge-table-header-west-horizontal-border: oklch(30% 0 0);--ge-table-header-west-vertical-border: oklch(32% 0 0);--ge-table-header-center-horizontal-border: oklch(30% 0 0);--ge-table-header-center-vertical-border: oklch(32% 0 0);--ge-table-header-east-horizontal-border: oklch(30% 0 0);--ge-table-header-east-vertical-border: oklch(32% 0 0);--ge-table-body-west-bg: oklch(0% 0 0);--ge-table-body-center-bg: oklch(0% 0 0);--ge-table-body-east-bg: oklch(0% 0 0);--ge-table-body-west-text: oklch(100% 0 0);--ge-table-body-center-text: oklch(100% 0 0);--ge-table-body-east-text: oklch(100% 0 0);--ge-table-body-west-horizontal-border: oklch(30% 0 0);--ge-table-body-west-vertical-border: oklch(32% 0 0);--ge-table-body-center-horizontal-border: oklch(30% 0 0);--ge-table-body-center-vertical-border: oklch(32% 0 0);--ge-table-body-east-horizontal-border: oklch(30% 0 0);--ge-table-body-east-vertical-border: oklch(32% 0 0);--ge-table-footer-west-bg: oklch(0% 0 0);--ge-table-footer-center-bg: oklch(0% 0 0);--ge-table-footer-east-bg: oklch(0% 0 0);--ge-table-footer-west-text: var(--ge-table-header-center-text);--ge-table-footer-center-text: var(--ge-table-header-center-text);--ge-table-footer-east-text: var(--ge-table-header-center-text);--ge-table-footer-west-horizontal-border: oklch(30% 0 0);--ge-table-footer-west-vertical-border: oklch(32% 0 0);--ge-table-footer-center-horizontal-border: oklch(30% 0 0);--ge-table-footer-center-vertical-border: oklch(32% 0 0);--ge-table-footer-east-horizontal-border: oklch(30% 0 0);--ge-table-footer-east-vertical-border: oklch(32% 0 0);--ge-table-border: oklch(32% 0 0);--ge-table-row-odd-bg: oklch(0% 0 0);--ge-table-row-even-bg: oklch(0% 0 0);--ge-table-column-odd-bg: oklch(0% 0 0);--ge-table-column-even-bg: oklch(0% 0 0);--ge-table-hover-column-bg: oklch(0% 0 0);--ge-table-hover-row-bg: oklch(0% 0 0);--ge-table-focus-border: rgb(0, 255, 255);--ge-table-color-error-text: #ffa8b5;--ge-table-tree-arrow-collapsed-color: #ffa8b5;--ge-table-column-resize-handle-border: rgb(0, 255, 255);--ge-table-dragged-col-div-bg: oklch(0% 0 0);--ge-table-drop-zone-bg: oklch(0% 0 0);--ge-table-body-west-selected-range-bg: oklch(19% .2 205.2);--ge-table-body-center-selected-range-bg: oklch(19% .2 205.2);--ge-table-body-east-selected-range-bg: oklch(19% .2 205.2);--ge-table-body-west-selected-range-text: #000;--ge-table-body-center-selected-range-text: #000;--ge-table-body-east-selected-range-text: #000;--ge-table-color-col-resize-handle-hover-bg: cyan;--ge-table-color-dragged-col-div-bg: #fafafa;--ge-table-color-drop-zone-bg: #fafafa;--ge-table-color-drop-zone: #fafafa;--ge-table-color-tree-arrow-collapsed-color: var(--ge-table-body-west-text)}.ge-table-col-div.ge-table-col-div-0.ge-table-tree-cell{text-align:left}.ge-table-tree-cell .ge-table-label-div{padding-left:0;padding-right:10px;display:inline}.ge-table-col-tree{text-align:left}.ge-padding-property-checkbox{padding-left:0}.ge-table-col-tree.ge-table-tree-deep-0{padding-left:16px}.ge-table-col-tree.ge-table-tree-deep-1{padding-left:36px}.ge-table-col-tree.ge-table-tree-deep-2{padding-left:56px}.ge-table-col-tree.ge-table-tree-deep-3{padding-left:76px}.ge-table-col-tree.ge-table-tree-deep-4{padding-left:96px}.ge-table-col-tree.ge-table-tree-deep-5{padding-left:116px}.ge-table-col-tree.ge-table-tree-deep-5{padding-left:136px}.ge-table-col-div.ge-table-col-tree.ge-table-tree-cell{display:grid;grid-template-columns:16px 1fr}
|
|
1
|
+
.ge-table{display:block;margin:0;width:100%;height:100%}.ge-table-col-div{text-align:center;line-height:2.5;-webkit-user-select:none;user-select:none}.ge-table-label-div{padding:0;display:block;text-overflow:ellipsis;overflow:hidden}.ge-table-label-div .ge-table-label{padding-left:10px;padding-right:10px}.ge-table-text-align-left{text-align:left}.ge-table-text-align-right{text-align:right}.ge-table-text-align-center{text-align:center}.ge-table-row-checkbox-div{padding-left:14px}.ge-table{background-color:var(--ge-table-bg)}.ge-table-header-west{background-color:var(--ge-table-header-west-bg)}.ge-table-header-center{background-color:var(--ge-table-header-center-bg)}.ge-table-header-east{background-color:var(--ge-table-header-east-bg)}.ge-table-header-west{color:var(--ge-table-header-west-text)}.ge-table-header-center{color:var(--ge-table-header-center-text)}.ge-table-header-east{color:var(--ge-table-header-east-text)}.ge-table-header-west-horizontal-border{background-color:var(--ge-table-header-west-horizontal-border)}.ge-table-header-west-vertical-border{background-color:var(--ge-table-header-west-vertical-border)}.ge-table-header-center-horizontal-border{background-color:var(--ge-table-header-center-horizontal-border)}.ge-table-header-center-vertical-border{background-color:var(--ge-table-header-center-vertical-border)}.ge-table-header-east-horizontal-border{background-color:var(--ge-table-header-east-horizontal-border)}.ge-table-header-east-vertical-border{background-color:var(--ge-table-header-east-vertical-border)}.ge-table-body-west{background-color:var(--ge-table-body-west-bg)}.ge-table-body-center{background-color:var(--ge-table-body-center-bg)}.ge-table-body-east{background-color:var(--ge-table-body-east-bg)}.ge-table-body-west{color:var(--ge-table-body-west-text)}.ge-table-body-center{color:var(--ge-table-body-center-text)}.ge-table-body-east{color:var(--ge-table-body-east-text)}.ge-table-body-west-horizontal-border{background-color:var(--ge-table-body-west-horizontal-border)}.ge-table-body-west-vertical-border{background-color:var(--ge-table-body-west-vertical-border)}.ge-table-body-center-horizontal-border{background-color:var(--ge-table-body-center-horizontal-border)}.ge-table-body-center-vertical-border{background-color:var(--ge-table-body-center-vertical-border)}.ge-table-body-east-horizontal-border{background-color:var(--ge-table-body-east-horizontal-border)}.ge-table-body-east-vertical-border{background-color:var(--ge-table-body-east-vertical-border)}.ge-table-body-west-selected-range{background-color:var(--ge-table-body-west-selected-range-bg)}.ge-table-body-center-selected-range{background-color:var(--ge-table-body-center-selected-range-bg)}.ge-table-body-east-selected-range{background-color:var(--ge-table-body-east-selected-range-bg)}.ge-table-body-west-selected-range{color:var(--ge-table-body-west-selected-range-text)}.ge-table-body-center-selected-range{color:var(--ge-table-body-center-selected-range-text)}.ge-table-body-east-selected-range{color:var(--ge-table-body-east-selected-range-text)}.ge-table-footer-west{background-color:var(--ge-table-footer-west-bg)}.ge-table-footer-center{background-color:var(--ge-table-footer-center-bg)}.ge-table-footer-east{background-color:var(--ge-table-footer-east-bg)}.ge-table-footer-west{color:var(--ge-table-footer-west-text)}.ge-table-footer-center{color:var(--ge-table-footer-center-text)}.ge-table-footer-east{color:var(--ge-table-footer-east-text)}.ge-table-footer-west-horizontal-border{background-color:var(--ge-table-footer-west-horizontal-border)}.ge-table-footer-west-vertical-border{background-color:var(--ge-table-footer-west-vertical-border)}.ge-table-footer-center-horizontal-border{background-color:var(--ge-table-footer-center-horizontal-border)}.ge-table-footer-center-vertical-border{background-color:var(--ge-table-footer-center-vertical-border)}.ge-table-footer-east-horizontal-border{background-color:var(--ge-table-footer-east-horizontal-border)}.ge-table-footer-east-vertical-border{background-color:var(--ge-table-footer-east-vertical-border)}.ge-table-border{background-color:var(--ge-table-border)}.ge-table-row-odd{background-color:var(--ge-table-row-odd-bg)}.ge-table-row-even{background-color:var(--ge-table-row-even-bg)}.ge-table-column-odd{background-color:var(--ge-table-column-odd-bg)}.ge-table-column-even{background-color:var(--ge-table-column-even-bg)}.ge-table-hover-column{background-color:var(--ge-table-hover-column-bg)}.ge-table-hover-row{background-color:var(--ge-table-hover-row-bg)}.ge-table-focus-border{background-color:var(--ge-table-focus-border)}.ge-table-color-col-resize-handle-hover{background-color:var(--ge-table-color-col-resize-handle-hover-bg)}.ge-table-color-dragged-col-div{background-color:var(--ge-table-color-dragged-col-div-bg)}.ge-table-color-drop-zone{background-color:var(--ge-table-color-drop-zone-bg)}.ge-table-color-drop-zone{background-color:var(--ge-table-color-drop-zone)}.ge-table-color-tree-arrow-collapsed-color{background-color:var(--ge-table-color-tree-arrow-collapsed-color)}.ge-table-color-error{color:var(--ge-table-color-error-text)}.ge-table-tree-arrow-collapsed{color:var(--ge-table-tree-arrow-collapsed-color)}.ge-table-column-resize-handle:hover{background-color:var(--ge-table-column-resize-handle-border)}.ge-table-drop-zone{background-color:var(--ge-table-drop-zone-bg)}.ge-table-dragged-col-div{background-color:var(--ge-table-dragged-col-div-bg)}.ge-table-cell-editor-input,.ge-table-cell-editor-input:focus-within{border:none}html,html[data-theme=light]{--ge-table-bg: #fff;--ge-table-header-west-bg: var(--ge-table-header-center-bg);--ge-table-header-center-bg: rgba(233, 233, 233, .5);--ge-table-header-east-bg: var(--ge-table-header-center-bg);--ge-table-header-west-text: var(--ge-table-header-center-text);--ge-table-header-center-text: #000;--ge-table-header-east-text: var(--ge-table-header-center-text);--ge-table-header-west-horizontal-border: var(--ge-table-header-center-horizontal-border);--ge-table-header-west-vertical-border: var(--ge-table-header-center-vertical-border);--ge-table-header-center-horizontal-border: #ddd;--ge-table-header-center-vertical-border: #ccc;--ge-table-header-east-horizontal-border: var(--ge-table-header-center-horizontal-border);--ge-table-header-east-vertical-border: var(--ge-table-header-center-vertical-border);--ge-table-body-west-bg: var(--ge-table-header-center-bg);--ge-table-body-center-bg: rgba(255,255,255, .5);--ge-table-body-east-bg: var(--ge-table-header-center-bg);--ge-table-body-west-text: var(--ge-table-header-center-text);--ge-table-body-center-text: var(--ge-table-header-center-text);--ge-table-body-east-text: var(--ge-table-header-center-text);--ge-table-body-west-horizontal-border: var(--ge-table-header-west-horizontal-border);--ge-table-body-west-vertical-border: var(--ge-table-header-west-vertical-border);--ge-table-body-center-horizontal-border: #bbb;--ge-table-body-center-vertical-border: #ddd;--ge-table-body-east-horizontal-border: var(--ge-table-header-east-horizontal-border);--ge-table-body-east-vertical-border: var(--ge-table-header-east-vertical-border);--ge-table-footer-west-bg: var(--ge-table-header-center-bg);--ge-table-footer-center-bg: var(--ge-table-header-center-bg);--ge-table-footer-east-bg: var(--ge-table-header-center-bg);--ge-table-footer-west-text: var(--ge-table-header-center-text);--ge-table-footer-center-text: var(--ge-table-header-center-text);--ge-table-footer-east-text: var(--ge-table-header-center-text);--ge-table-footer-west-horizontal-border: var(--ge-table-header-west-horizontal-border);--ge-table-footer-west-vertical-border: var(--ge-table-header-west-vertical-border);--ge-table-footer-center-horizontal-border: var(--ge-table-header-center-horizontal-border);--ge-table-footer-center-vertical-border: var(--ge-table-header-center-vertical-border);--ge-table-footer-east-horizontal-border: var(--ge-table-header-east-horizontal-border);--ge-table-footer-east-vertical-border: var(--ge-table-header-east-vertical-border);--ge-table-body-west-selected-range-bg: rgba(0, 152, 219, .4);--ge-table-body-center-selected-range-bg: rgba(0, 152, 219, .4);--ge-table-body-east-selected-range-bg: rgba(0, 152, 219, .4);--ge-table-body-west-selected-range-text: #000;--ge-table-body-center-selected-range-text: #000;--ge-table-body-east-selected-range-text: #000;--ge-table-border: #ccc;--ge-table-row-odd-bg: transparent;--ge-table-row-even-bg: transparent;--ge-table-column-odd-bg: transparent;--ge-table-column-even-bg: transparent;--ge-table-hover-column-bg: rgba(0, 224, 255, .27);--ge-table-hover-row-bg: rgba(0, 224, 255, .27);--ge-table-focus-border: rgb(0, 255, 255);--ge-table-color-error-text: #e00034;--ge-table-tree-arrow-collapsed-color: #e00034;--ge-table-column-resize-handle-border: rgb(0, 255, 255);--ge-table-dragged-col-div-bg: lightcyan;--ge-table-drop-zone-bg: rgba(244, 255, 242, .6);--ge-table-color-col-resize-handle-hover-bg: cyan;--ge-table-color-dragged-col-div-bg: #fafafa;--ge-table-color-drop-zone-bg: #fafafa;--ge-table-color-drop-zone: #fafafa;--ge-table-color-tree-arrow-collapsed-color: var(--ge-table-body-west-text)}html[data-theme=dark]{--ge-table-bg: #111827;--ge-table-header-west-bg: #111827;--ge-table-header-center-bg: #111827;--ge-table-header-east-bg: #111827;--ge-table-header-west-text: oklch(100% 0 0);--ge-table-header-center-text: oklch(100% 0 0);--ge-table-header-east-text: oklch(100% 0 0);--ge-table-header-west-horizontal-border: #313641;--ge-table-header-west-vertical-border: oklch(32% 0 0);--ge-table-header-center-horizontal-border: #313641;--ge-table-header-center-vertical-border: oklch(32% 0 0);--ge-table-header-east-horizontal-border: #313641;--ge-table-header-east-vertical-border: oklch(32% 0 0);--ge-table-body-west-bg: #23272e;--ge-table-body-center-bg: #23272e55;--ge-table-body-east-bg: #23272e;--ge-table-body-west-text: oklch(100% 0 0);--ge-table-body-center-text: oklch(100% 0 0);--ge-table-body-east-text: oklch(100% 0 0);--ge-table-body-west-horizontal-border: #313641;--ge-table-body-west-vertical-border: oklch(32% 0 0);--ge-table-body-center-horizontal-border: #313641;--ge-table-body-center-vertical-border: oklch(32% 0 0);--ge-table-body-east-horizontal-border: #313641;--ge-table-body-east-vertical-border: oklch(32% 0 0);--ge-table-footer-west-bg: #111827;--ge-table-footer-center-bg: #111827;--ge-table-footer-east-bg: #111827;--ge-table-footer-west-text: var(--ge-table-header-center-text);--ge-table-footer-center-text: var(--ge-table-header-center-text);--ge-table-footer-east-text: var(--ge-table-header-center-text);--ge-table-footer-west-horizontal-border: oklch(30% 0 0);--ge-table-footer-west-vertical-border: oklch(32% 0 0);--ge-table-footer-center-horizontal-border: oklch(30% 0 0);--ge-table-footer-center-vertical-border: oklch(32% 0 0);--ge-table-footer-east-horizontal-border: oklch(30% 0 0);--ge-table-footer-east-vertical-border: oklch(32% 0 0);--ge-table-border: oklch(32% 0 0);--ge-table-row-odd-bg: #11151F55;--ge-table-row-even-bg: #1A202F55;--ge-table-column-odd-bg: transparent;--ge-table-column-even-bg: transparent;--ge-table-hover-column-bg: rgba(0, 224, 255, .27);--ge-table-hover-row-bg: rgba(0, 224, 255, .27);--ge-table-focus-border: rgb(0, 255, 255);--ge-table-color-error-text: #ffa8b5;--ge-table-tree-arrow-collapsed-color: #ffa8b5;--ge-table-column-resize-handle-border: rgb(0, 255, 255);--ge-table-dragged-col-div-bg: oklch(0% 0 0);--ge-table-drop-zone-bg: oklch(0% 0 0);--ge-table-body-west-selected-range-bg: oklch(19% .2 205.2);--ge-table-body-center-selected-range-bg: oklch(19% .2 205.2);--ge-table-body-east-selected-range-bg: oklch(19% .2 205.2);--ge-table-body-west-selected-range-text: #0098db;--ge-table-body-center-selected-range-text: #0098db;--ge-table-body-east-selected-range-text: #0098db;--ge-table-color-col-resize-handle-hover-bg: cyan;--ge-table-color-dragged-col-div-bg: #fafafa;--ge-table-color-drop-zone-bg: #fafafa;--ge-table-color-drop-zone: #fafafa;--ge-table-color-tree-arrow-collapsed-color: var(--ge-table-body-west-text)}.ge-table-col-div.ge-table-col-div-0.ge-table-tree-cell{text-align:left}.ge-table-tree-cell .ge-table-label-div{padding-left:0;padding-right:10px;display:inline}.ge-table-col-tree{text-align:left}.ge-padding-property-checkbox{padding-left:0}.ge-table-col-tree.ge-table-tree-deep-0{padding-left:16px}.ge-table-col-tree.ge-table-tree-deep-1{padding-left:36px}.ge-table-col-tree.ge-table-tree-deep-2{padding-left:56px}.ge-table-col-tree.ge-table-tree-deep-3{padding-left:76px}.ge-table-col-tree.ge-table-tree-deep-4{padding-left:96px}.ge-table-col-tree.ge-table-tree-deep-5{padding-left:116px}.ge-table-col-tree.ge-table-tree-deep-5{padding-left:136px}.ge-table-col-div.ge-table-col-tree.ge-table-tree-cell{display:grid;grid-template-columns:16px 1fr}
|