@guiexpert/preact-table 10.1.84 β 10.1.86
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/LICENSE +21 -0
- package/README.md +7 -1
- package/index.cjs +1 -40
- package/index.js +58 -5064
- package/package.json +12 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-2026 Dr. Marc Kronberg (gui.expert)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ This is the preact component of the GuiExpert Table Project.
|
|
|
7
7
|
|
|
8
8
|
This is the UI-agnostic table component for your next web app. π
|
|
9
9
|
|
|
10
|
-
<img src="https://raw.githubusercontent.com/guiexperttable/
|
|
10
|
+
<img src="https://raw.githubusercontent.com/guiexperttable/mono/main/apps/webpage-guiexpert/src/assets/screens/heatmap.png" width="50%">
|
|
11
11
|
|
|
12
12
|
### Features
|
|
13
13
|
- Handle large datasets easily
|
|
@@ -100,3 +100,9 @@ function onTableReady(api: TableApi) {
|
|
|
100
100
|
There are numerous possibilities to create table models.
|
|
101
101
|
Please refer to the [Documentation](https://gui.expert/doc) for further information or the [Demo](https://gui.expert/demos) section for examples.
|
|
102
102
|
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
**Current releases: MIT License.** All currently published versions are free to use, modify and distribute β also in commercial and proprietary applications. See [LICENSE](https://github.com/guiexperttable/mono/blob/main/LICENSE).
|
|
107
|
+
|
|
108
|
+
**Future releases: possible dual licensing.** Dr. Marc Kronberg (gui.expert) reserves the right to publish future versions under different terms (e.g. open source for individuals and non-commercial use, commercial license for businesses). Versions already released under MIT remain MIT. Details: [gui.expert/license](https://gui.expert/license/).
|
package/index.cjs
CHANGED
|
@@ -1,40 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
<input
|
|
3
|
-
type="checkbox"
|
|
4
|
-
data-area="${s}"
|
|
5
|
-
data-row-index="${i}"
|
|
6
|
-
data-input-type="checkbox"
|
|
7
|
-
${r}
|
|
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,r="body"){const a=this.domService.createElement("div");if(this.domService.addClass(a,"ge-table-label-div"),this.domService.setStyle(a,"position","relative"),this.domService.setStyle(a,"background","transparent"),this.domService.setStyle(a,"width","100%"),this.domService.setStyle(a,"height","100%"),this.domService.setAttribute(a,"data-row-index",`${i}`),this.domService.setAttribute(a,"data-col-index",`${o}`),this.domService.setAttribute(a,"data-area",`${r}`),t)if(s){const n=this.domService.createText(t);this.domService.appendChild(a,n)}else{const n=this.domService.createElement("div");this.domService.appendChild(a,n);const c=this.domService.createText(t);this.domService.addClass(n,"ge-table-label"),this.domService.appendChild(n,c),this.domService.setAttribute(n,"data-row-index",`${i}`),this.domService.setAttribute(n,"data-col-index",`${o}`),this.domService.setAttribute(n,"data-area",`${r}`)}return this.domService.appendChild(e,a),a}addSortedIcon(e,t="",s=new be,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 r;t==="asc"?r=s.iconAsc:t==="desc"?r=s.iconDesc:r=s.iconPlaceholder;const a=r.content,n=this.domService.createText(a);this.domService.appendChild(o,n),r.style&&this.applyStyleString(o,r.style);for(const c of r.classes)this.domService.addClass(o,c);return this.domService.appendChild(e,o),o}addArrowDiv(e,t="none",s=new ye,i=-1,o=-1,r="body"){const a=this.domService.createElement("div");this.domService.addClass(a,"ge-table-tree-arrow-div"),this.domService.setStyle(a,"display","inline-block"),this.domService.setStyle(a,"position",""),this.domService.setStyle(a,"width","20px"),this.domService.setStyle(a,"background","transparent"),this.domService.setStyle(a,"cursor","pointer"),this.domService.setAttribute(a,"data-row-index",`${i}`),this.domService.setAttribute(a,"data-col-index",`${o}`),this.domService.setAttribute(a,"data-area",`${r}`);let n;t==="expanded"?n=s.arrowExpanded:t==="collapsed"?n=s.arrowCollapsed:n=s.arrowPlaceholder;const c=n.content,d=this.domService.createText(c);this.domService.appendChild(a,d),n.style&&this.applyStyleString(a,n.style);for(const p of n.classes)this.domService.addClass(a,p);return this.domService.appendChild(e,a),a}addColumnBorderDivs(e,t,s,i,o){if(e.verticalBorderVisible){const r=`ge-table-${i}-${o}-vertical-border`;this.addVerticalBorder(s,t,r)}if(e.horizontalBorderVisible){const r=`ge-table-${i}-${o}-horizontal-border`;this.addHorizontalBorder(s,t,r)}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){t={...t,width:t.width+1,height:t.height+1};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.domService.setStyle(i,"z-index","9999"),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.domService.setStyle(i,"z-index","9999"),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.domService.setStyle(i,"z-index","9999"),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.domService.setStyle(i,"z-index","9999"),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,r]=i.split(":");this.domService.setStyle(e,o.trim(),r.trim())}}getDivOrCreateDiv(e,t){let s=t.cache[e];return s?(s.innerText="",s):(s=this.domService.createElement("div"),t.cache[e]=s,s)}}const X=l=>l==="header"?"header":l==="footer"?"footer":"body";class De{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=X(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 Ie{constructor(e){this.tableScope=e,this.doubleClickDelay=500,this.expandedAll=!0,this.mouseDown=!1,this.dragging=!1,this.lastClicked=0,this.tableScope.hostElement.addEventListener("click",this.onHostElementClicked.bind(this)),this.tableScope.hostElement.addEventListener("dblclick",this.onHostElementDblClicked.bind(this)),this.tableScope.hostElement.addEventListener("mousedown",this.onMouseDown.bind(this)),this.tableScope.hostElement.addEventListener("mousemove",this.onMouseMove.bind(this)),this.tableScope.hostElement.addEventListener("mouseup",this.onMouseUp.bind(this)),this.tableScope.hostElement.addEventListener("contextmenu",this.onContextmenu.bind(this)),this.tableScope.hostElement._MouseHandler="true",this.tableScope.scrollViewport.addEventListener("scroll",this.tableScope.adjustAfterScrolling.bind(this.tableScope)),[window,this.tableScope.hostElement].forEach(t=>t.addEventListener("resize",this.tableScope.adjustContainersAndRows.bind(this.tableScope)))}onContextmenu(e){this.mouseEvent=e;const t=this.tableScope.createGeMouseEvent(this.mouseEvent);this.tableScope.contextmenu(t)}onHostElementClicked(e){const t=Date.now();if(t-this.lastClicked<this.doubleClickDelay){this.lastClicked=t,this.publishGeMouseEvent(e,2);return}this.lastClicked=t;const s=new De(e.target,this.tableScope);if(s.action==="toggleExpandCollapseAll")this.expandedAll=!this.expandedAll,this.tableScope.toggleExpandCollapseAll(this.expandedAll),e.preventDefault(),e.stopPropagation();else if(s.action==="toggleHeaderGroup")this.tableScope.toggleHeaderGroup(s),e.preventDefault(),e.stopPropagation();else if(s.inputType==="checkbox"&&s.areaIdent)this.tableScope.toggleRowCheckbox(s.rowIdx,s.colIdx,s.areaIdent),e.preventDefault(),e.stopPropagation();else if(H(s.row)&&s.areaModel){const i=s.colIdx===this.getArrowColumnIndex()&&e.altKey,o=s.className.includes("ge-table-tree-arrow-div");if(i||o){e.preventDefault(),e.stopPropagation();const r=s.row;r.expanded=!r.expanded,"recalcVisibleTreeRows"in s.areaModel&&s.areaModel.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(r)}}if(s.areaIdent==="body"&&this.tableScope.tableOptions.getFocusModel){const i=this.tableScope.tableOptions.getFocusModel();i==null||i.clear(),i==null||i.setFocus(s.rowIdx,s.colIdx)}this.publishGeMouseEvent(e,1)}onHostElementDblClicked(e){if(this.lastClicked=Date.now(),e.target instanceof HTMLElement){const t=e.target,s=t.getAttribute("data-area"),i=X(s),o=Number(t.getAttribute("data-row-index")),r=Number(t.getAttribute("data-col-index")),a=this.tableScope.tableModel.getAreaModel(i);if(s&&i==="header")this.tableScope.tableModel.isSortable(r)&&(this.tableScope.clearSelection(),this.tableScope.onHeaderDblClicked(e,o,r));else if(t.getAttribute("data-row-index")){const n=a.getRowByIndex(o);if(s&&i==="body"&&a.isEditable(o,r)&&(this.tableScope.clearSelection(),this.tableScope.initRenderEditor(o,r)),H(n)&&r===this.getArrowColumnIndex()){e.preventDefault(),e.stopPropagation();const c=n;c.expanded=!c.expanded,"recalcVisibleTreeRows"in a&&a.recalcVisibleTreeRows(),this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth),this.tableScope.adjustContainersAndRows(),this.updateCollapsedExpandedState(c)}}}this.publishGeMouseEvent(e,2)}publishGeMouseEvent(e,t){var s;this.mouseEvent=e,this.geMouseEventOld=(s=this.geMouseEvent)==null?void 0:s.clone(),this.geMouseEvent=this.tableScope.createGeMouseEvent(e),this.geMouseEvent&&(this.geMouseEvent.clickCount=t),this.tableScope.onMouseClicked(this.geMouseEvent,this.geMouseEventOld),this.tableScope.publishGeMouseEvent(this.geMouseEvent)}updateCollapsedExpandedState(e){var s,i,o,r,a;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,c=n==="collapsed"&&!e.expanded||n==="expanded"&&e.expanded,d=n==="collapsed"&&e.expanded||n==="expanded"&&!e.expanded,p=t(e.data);c?(r=this.tableScope.storeStateCollapsedExpandService)==null||r.collapsedStateIdsPush(p):d&&((a=this.tableScope.storeStateCollapsedExpandService)==null||a.collapsedStateIdsRemove(p))}}getArrowColumnIndex(){return this.tableScope.tableModel.isRowCheckboxVisible()?1:0}onMouseDown(e){this.dragging||(this.mouseEvent=e,this.startMouseEvent=this.tableScope.createGeMouseEvent(this.mouseEvent),this.tableScope.onMouseDown(this.startMouseEvent),this.mouseDown=!0)}onMouseMove(e){this.mouseEvent=e,this.mouseDown?(this.dragging||(this.dragging=!0,this.tableScope.setDragging(!0)),requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))):requestAnimationFrame(this.mouseMoveOnFrame.bind(this))}onMouseUp(e){this.mouseEvent=e,this.dragging&&requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)),this.mouseDown=!1,this.dragging=!1,this.tableScope.setDragging(!1)}mouseDraggingOnFrame(){var e;if(this.mouseEvent){const t=this.tableScope.createGeMouseEvent(this.mouseEvent);(e=this.startMouseEvent)!=null&&e.originalEvent&&(t.draggingX=this.mouseEvent.clientX-this.startMouseEvent.originalEvent.clientX,t.draggingY=this.mouseEvent.clientY-this.startMouseEvent.originalEvent.clientY),this.tableScope.mouseDraggingOnFrame(t,this.startMouseEvent)}}mouseDraggingEndOnFrame(){var e;if(this.mouseEvent){const t=this.tableScope.createGeMouseEvent(this.mouseEvent);(e=this.startMouseEvent)!=null&&e.originalEvent&&(t.draggingX=this.mouseEvent.clientX-this.startMouseEvent.originalEvent.clientX,t.draggingY=this.mouseEvent.clientY-this.startMouseEvent.originalEvent.clientY),this.tableScope.mouseDraggingEndOnFrame(t)}}mouseMoveOnFrame(){if(this.mouseEvent){const e=this.tableScope.createGeMouseEvent(this.mouseEvent);this.tableScope.mouseMove(e)}}}class Le{constructor(e,t=[],s=-1){this.areaIdent=e,this.columnDefs=t,this.defaultRowHeight=s,this.rowSelectionModel=void 0,this.yPositions=[],this.cellRenderers=t.map(i=>i.rendererMap[e])}getTextValueAt(e,t){return""+this.getValueAt(e,t)}getTooltipAt(e,t){return""}getCellRenderer(e,t){if(t<this.cellRenderers.length)return this.cellRenderers[t]}getColspanAt(e,t){return 0}getCustomClassesAt(e,t){return[]}getCustomStyleAt(e,t){}getRowspanAt(e,t){return 0}getRowByIndex(e){}isRowCheckable(e){return!0}isRowChecked(e){var s;const t=this.getRowByIndex(e);return(s=this.rowSelectionModel)==null?void 0:s.isRowChecked(t)}setRowChecked(e,t){if(this.rowSelectionModel){const s=this.getRowByIndex(e);this.rowSelectionModel.checkRow(s,t)}}getMaxColspan(){return 31}getMaxRowspan(){return 31}getYPosByRowIndex(e){return this.defaultRowHeight>0?this.defaultRowHeight*e:this.yPositions[e]}init(){!this.yPositions.length&&this.getRowCount()!==void 0&&this.defaultRowHeight===-1&&this.calcYPositions()}isFilterable(){return this.areaIdent==="body"}doSort(e){return!1}sort(e){}isEditable(e,t){var i,o;const s=(i=this.columnDefs)==null?void 0:i[t];return((o=s==null?void 0:s.editable)==null?void 0:o.call(s))??!1}setValue(e,t,s){var a;const i=(a=this.columnDefs[t])==null?void 0:a.editInputPipe;i&&(s=i(s,e,t));const o=this.getRowByIndex(e),r=this.columnDefs[t].property;return r.includes(".")?this.setPropertyValue(o,r.split("."),s):(o[r]=s,!0)}isSelectable(e,t){return!0}changeColumnOrder(e,t){this.arrayMove(this.cellRenderers,e,t)}setPropertyValue(e,t,s){const i=t.shift();if(i){const o=e[i];return o&&t.length?this.setPropertyValue(o,t,s):(e[i]=s,!0)}return!1}arrayMove(e,t,s){const i=e.splice(t,1)[0];return e.splice(s,0,i),e}calcYPositions(){const e=this.getRowCount();this.yPositions=new Array(e+1),this.yPositions[0]=0;for(let t=0;t<e;t++)this.yPositions[t+1]=this.getRowHeight(t)+this.yPositions[t]}}class Oe{genericSortComparator(e,t,s){if(typeof e=="number"&&typeof t=="number")return s*(e-t);if(typeof e=="string"&&typeof t=="string")return s*e.localeCompare(t);if(typeof e=="boolean"&&typeof t=="boolean")return s*((e?-1:1)-(t?-1:1));if(e instanceof Date&&t instanceof Date)return s*(e.getTime()-t.getTime());if(e instanceof Array&&t instanceof Array){const i=e,o=t;if(i.length&&o.length)return this.genericSortComparator(i[0],o[0],s)}return s*(""+e).localeCompare(""+t)}}class L extends Le{constructor(e,t,s,i=[],o="ge-selected-row",r="ge-focused-row"){super(e,i,s),this.areaIdent=e,this.rows=t,this.defaultRowHeight=s,this.columnDefs=i,this.selectedRowClass=o,this.focusedRowClass=r,this.sorterService=new Oe,this._focusedRowIndex=0,this.filteredRows=[...t],this.properties=i.map(a=>a.property)}getFocusedRowIndex(){return this._focusedRowIndex}setFocusedRowIndex(e){this._focusedRowIndex=e}setRows(e){this.rows=e,this.filteredRows=[...e]}filterRowsByPredict(e){this.rows=this.rows.filter(e),this.filteredRows=this.filteredRows.filter(e)}getRowCount(){var e;return((e=this.filteredRows)==null?void 0:e.length)??0}getValueAt(e,t){const s=this.properties[t];let i=this.filteredRows[e];return H(i)&&(i=i.data),i?this.getValueByT(i,s):""}getFilteredRows(){return this.filteredRows}getAllRows(){return this.rows}findRowFromFilteredRowsByAllCriteria(e,t){return this.getFilteredRows().find(s=>t(e,s))}findRowFromAllRowsByAllCriteria(e,t){return this.getAllRows().find(s=>t(e,s))}getRowHeight(e){return this.defaultRowHeight}getRowByIndex(e){return this.filteredRows[e]}externalFilterChanged(e){this.filteredRows=this.rows?this.rows.filter(e):[]}doSort(e){for(const t of e){const{columnIndex:s,sortState:i}=t,o=i==="asc"?1:i==="desc"?-1:0,r=this.properties[s];this.filteredRows=this.filteredRows.sort(this.genericFlatTableSortComparator(r,o))}return!0}sort(e){this.filteredRows=this.filteredRows.sort(e)}getValueByT(e,t){if(e&&t)return t.includes(".")?this.getPropertyValue(e,t.split(".")):e[t]}changeColumnOrder(e,t){this.arrayMove(this.properties,e,t),super.changeColumnOrder(e,t)}getCustomClassesAt(e,t){const s=super.getCustomClassesAt(e,t);return this.getRowByIndex(e).selected&&s.push(this.selectedRowClass),this._focusedRowIndex===e&&s.push(this.focusedRowClass),s}genericFlatTableSortComparator(e,t){const s=this.columnDefs.find(i=>i.property===e);return(i,o)=>{const r=this.getValueByT(i,e),a=this.getValueByT(o,e);return s!=null&&s.sortComparator?t*s.sortComparator(r,a,i,o,t):this.sorterService.genericSortComparator(r,a,t)}}getPropertyValue(e,t){const s=t.shift(),i=e[s];return i&&t.length?this.getPropertyValue(i,t):i}}class ke{constructor(e){this.tableScope=e}updateCells(e,t=!1){this.tableScope.updateCells(e,t)}externalFilterChanged(){this.tableScope.externalFilterChanged()}scrollToPixel(e=0,t=0){this.tableScope.scrollToPixel(e,t)}scrollToIndex(e=0,t=0){this.tableScope.scrollToIndex(e,t)}setHeaderVisible(e=!0){}setColumnVisible(e,t=!0){}isColumnVisible(e){return!0}isHeaderVisible(){return!0}setFooterVisible(e=!0){}isFooterVisible(){return!0}repaint(){this.tableScope.repaint()}repaintHard(){this.tableScope.repaintHard()}recalcColumnWidths(e){this.tableScope.recalcColumnWidths(e)}clearSelection(){this.tableScope.clearSelection(!0)}setSelectionModel(e,t=!0){this.tableScope.setSelectionModel(e,t)}triggerAction(e){this.tableScope.onActionTriggered(e)}getShortcutActionMapping(){return this.tableScope.shortcutService.getShortcutActionMapping()}copyToClipboard(){return this.tableScope.copyService.copyToClipboard(this.tableScope.tableModel,this.tableScope.selectionModel(),this.tableScope.focusModel())}downloadExcel(e="table.xlsx",t=""){const s=[],i=this.tableScope.tableModel.getColumnCount(),o=["header","body","footer"];for(const r of o){const a=this.tableScope.tableModel.getAreaModel(r),n=(a==null?void 0:a.getRowCount())??0;for(let c=0;c<n;c++){const d=[];s.push(d);for(let p=0;p<i;p++)d.push(a.getValueAt(c,p))}}return this.tableScope.excelService.downloadExcel(s,e,t)}getTableScope(){return this.tableScope}getSelectionModel(){return this.tableScope.selectionModel()}autoResizeColumns(e=!0){this.tableScope.autoResizeColumns(e)}recalcWrappers(){this.tableScope.recalcWrappers()}setColumnWidth(e,t){this.tableScope.setColumnWidth(e,t)}getTableModel(){return this.tableScope.tableModel}getBodyModel(){return this.tableScope.tableModel.getBodyModel()}setRows(e){const t=this.getBodyModel();t instanceof L?t.setRows(e):console.warn("setRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof t,t)}addRows(e){const t=this.getBodyModel();if(t instanceof L){const s=t;let i=s.getAllRows();s.setRows([...i,...e])}else console.warn("addRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof t,t)}addRowsAt(e,t){const s=this.getBodyModel();if(s instanceof L){const i=s;let o=i.getAllRows();i.setRows([...o.slice(0,t),...e,...o.slice(t)])}else console.warn("addRowsAt<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s)}removeRows(e,t=(s,i)=>s===i){const s=this.getBodyModel();if(s instanceof L){const i=s,o=i.getAllRows().filter(r=>!e.some(a=>t(r,a)));i.setRows(o)}else console.warn("removeRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s)}findRows(e,t=(s,i)=>s===i){const s=this.getBodyModel();return s instanceof L?s.getAllRows().filter(o=>e.some(r=>t(o,r))):(console.warn("findRows<T>(rows: T[], predicate: (a: T, b: T) => boolean) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s),[])}findRowFromFilteredRowsByAllCriteria(e,t){const s=this.getBodyModel();if(s instanceof L)return s.getFilteredRows().find(o=>t(e,o));console.warn("findRowFromFilteredRowsByAllCriteria(...) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s)}findRowFromAllRowsByAllCriteria(e,t){const s=this.getBodyModel();if(s instanceof L)return s.getAllRows().find(o=>t(e,o));console.warn("findRowFromAllRowsByAllCriteria(...) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s)}updateRows(e,t=(s,i)=>s===i){const s=this.getBodyModel();if(s instanceof L){let o=s.getAllRows();for(const r of o)for(const a of e)if(t(r,a))for(const n of Object.keys(a))r[n]=a[n]}else console.warn("updateRows<T>(rows: T[], predicate: (a: T, b: T) => boolean) only works with AreaModelObjectArray<T>, but this body area model is ",typeof s,s)}reSort(){this.tableScope.reSort()}sort(e){this.tableScope.sort(e)}ensureRowIsVisible(e){return this.tableScope.ensureRowIsVisible(e)}getDisplayedRowCount(){return this.tableScope.getDisplayedRowCount()}getFirstVisibleRowIndex(){return this.tableScope.getFirstVisibleRowIndex()}getFirstFullVisibleRowIndex(){return this.tableScope.getFirstFullVisibleRowIndex()}getLastVisibleRowIndex(){return this.tableScope.getLastVisibleRowIndex()}getLastFullVisibleRowIndex(){return this.tableScope.getLastFullVisibleRowIndex()}setLoggingActive(e){this.tableScope.loggingActive=e}isLoggingActive(){return this.tableScope.loggingActive}}class K{constructor(e){this.getStorageKeyFn=e}autoConvertMapToObject(e){const t={};return e instanceof Map&&e.forEach((i,o)=>{t[i]=o}),t}checkAndPersistItem(e,t){const s=this.getStorageKeyFn;if(s){const i=s();if(i){const o=i+e;if((t+"").includes("Map")){const r=this.autoConvertMapToObject(t);this.persistItem(o,r)}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 Be extends K{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 Pe{constructor(e="collapsed",t=[],s=!1,i=!1){this.mode=e,this.rowIds=t,this.allCollapsed=s,this.allExpanded=i}}class Ve extends K{constructor(e){super(e),this.COLLAPSED_EXPANDED_STATE="collapsedExpandedState",this.collapsedExpandedState=new Pe,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 He extends K{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,i=this.loadFromLocalStorage(s);this.sortItems=i||[]}}}}class D{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 We{constructor(e,t,s,i){this.hostElement=e,this.tableModel=t,this.dom=s,this.tableOptions=i,this.scrollTop=0,this.areaBodyWestGeo=new D,this.areaBodyCenterGeo=new D,this.areaBodyEastGeo=new D;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.draggingColumn=s.applyStylePosistionAbsolute(s.createDivWithClass("ge-table-dragging-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 E{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 E(e.rowIndex1,e.columnIndex1,e.rowIndex2,e.columnIndex2,e.gammaRange)}static singleCell(e,t){return new E(e,t,e,t)}static singleRow(e){return new E(e,0,e,Number.MAX_SAFE_INTEGER)}static singleColumn(e){return new E(0,e,Number.MAX_SAFE_INTEGER,e)}isInRange(e,t){return e>=this.r1&&e<=this.r2&&t>=this.c1&&t<=this.c2}}class $e{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),r=this.areaModel.getRowspanAt(s,i);if(o>1||r>1){o===0&&(o=1),r===0&&(r=1);const a="gammaCells"in this.areaModel;this.colAndRowspanRanges.push(new E(s,i,s+r-1,i+o-1,a))}}}getRanges(){return this.colAndRowspanRanges?this.colAndRowspanRanges:[]}isInRange(e,t){if(this.colAndRowspanRanges){for(const s of this.colAndRowspanRanges)if(s.isInRange(e,t))return!0}return!1}}class Ne{constructor(e,t,s){this.header=e,this.body=t,this.footer=s}}class Ge extends We{constructor(e,t,s,i){var r,a;super(e,t,s,i),this.firstVisibleRowIndex=-1,this.lastVisibleRowIndex=-1,this.firstFullVisibleRowIndex=-1,this.lastFullVisibleRowIndex=-1,this.displayedRowCount=0,this.pixelLimitForFullVisible=5,this.loggingActive=!1,this.dragging=!1,this.editing=!1,this.storedColumnWidths=[],this.scrollLeft=0,this.scrollViewportLeft=0,this.scrollFactorY=0,this.scrollFactorX=0,this.cleanupFunctions={header:[],body:[],footer:[]},this.tree=!1,this.colAndRowspanModels=new Ne,this.draggingTargetColumnIndex=-1,this.removables=[],this.tableModel.getSelectionModel?this.getSelectionModel=this.tableModel.getSelectionModel:(r=this.tableOptions)!=null&&r.getSelectionModel&&(this.getSelectionModel=this.tableOptions.getSelectionModel),(a=this.tableOptions)!=null&&a.getFocusModel&&(this.getFocusModel=this.tableOptions.getFocusModel),U(t.getAreaModel("body"))&&(this.tree=!0),["header","body","footer"].forEach(n=>{var c;this.colAndRowspanModels[n]=new $e(t,t.getAreaModel(n)),(c=this.colAndRowspanModels[n])==null||c.init()})}isEditing(){return this.editing}resetEditorRenderer(){this.editorRenderer=void 0,this.editorRendererRow=-1,this.editorRendererColumn=-1,this.editing=!1}clearSelection(e=!1){if(this.getSelectionModel){const t=this.getSelectionModel();t==null||t.clear(),e&&this.repaint()}}initRenderEditor(e,t){var 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()}repaintHard(){this.tableModel.recalcHeightAndPadding(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows(),this.adjustAfterScrolling()}recalcColumnWidths(e){let t=(!e||e>this.scrollViewport.offsetWidth)&&this.scrollViewport.offsetWidth>100?this.scrollViewport.offsetWidth:this.scrollViewport.clientWidth;this.tableModel.setParentWidth(t),this.tableModel.init(),this.repaintHard()}adjustAfterScrolling(){var e;for(const t of this.removables)t.remove();this.hideHoverRow(),this.hideHoverColumn(),this.scrollTop=this.scrollViewport.scrollTop,this.scrollLeft=this.scrollViewport.scrollLeft,this.debounce(this.checkForScrollPosSaving.bind(this)),this.scrollFactorY=this.scrollTop/(this.scrollViewport.scrollHeight-this.scrollViewport.clientHeight),this.scrollFactorX=this.scrollLeft/(this.scrollViewport.scrollWidth-this.scrollViewport.clientWidth),isNaN(this.scrollFactorY)&&(this.scrollFactorY=0),isNaN(this.scrollFactorX)&&(this.scrollFactorX=0),this.adjustBody(),this.adjustArea("footer"),this.adjustArea("header"),this.tableOptions.tableTopBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new D(0,this.hostElement.clientWidth,1,0),this.hostElement,"ge-table-border")),this.tableOptions.tableBottomBorderVisible&&this.removables.push(this.dom.addHorizontalBorder(new D(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 D(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 D(0,this.hostElement.clientWidth,1,this.areaHeaderCenter.child.clientHeight),this.hostElement,"ge-table-body-west-vertical-border"))}checkForScrollPosSaving(){var e,t;this.storeScrollPosStateService&&((t=(e=this.tableOptions)==null?void 0:e.autoRestoreOptions)!=null&&t.autoRestoreScrollPosition)&&this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft,this.scrollTop])}updateCells(e,t=!1){e.forEach(s=>{this.tableModel.getAreaModel(s.area).setValue(s.rowIndex,s.columnIndex,s.value),t||this.rerenderCellContent(s)}),t&&this.repaint()}rerenderCellContent({area:e,rowIndex:t,columnIndex:s,value:i,cssClasses:o}){const r=this.tableModel.getAreaModel(e),a='div[data-col-index="'+s+'"][data-row-index="'+t+'"][data-area="'+e+'"]',n=document.querySelector(a);if(n){let c;const d=this.editorRenderer&&this.editorRendererRow===t&&this.editorRendererColumn===s;let p;if(d?p=this.editorRenderer:p=r.getCellRenderer(t,s),n.innerText="",this.applyCssClasses(n,o),p)c=p.render(n,t,s,e,r,i,this.dom.domService),c&&this.cleanupFunctions[e].push(c);else{const u=`${i}`;this.dom.addLabelDiv(n,u,!1,t,s,e)}const h=r.getCustomClassesAt(t,s);h.length&&this.dom.addClasses(h,n);const g=r.getCustomStyleAt(t,s);if(g)for(const u in g)this.dom.setStyle(n,u,g[u])}}getFirstVisibleRowIndex(){return this.firstVisibleRowIndex}getLastVisibleRowIndex(){return this.lastVisibleRowIndex}getFirstFullVisibleRowIndex(){return this.firstFullVisibleRowIndex}getLastFullVisibleRowIndex(){return this.lastFullVisibleRowIndex}getDisplayedRowCount(){return this.displayedRowCount}storeColumnWidths(){const e=this.tableModel.getColumnDefs();e!=null&&e.length&&(this.storedColumnWidths=e.map((t,s)=>this.tableModel.getColumnWidth(s)))}getAreaAndSideIdentByAttr(e){if(e){const t=this.getStringByAttr(e,"data-area"),s=this.getStringByAttr(e,"data-side");if(s&&t)return[t,s]}return[void 0,void 0]}getArea(e,t){if(e==="header"){if(t==="west")return this.areaHeaderWest;if(t==="center")return this.areaHeaderCenter;if(t==="east")return this.areaHeaderEast}else if(e==="body"){if(t==="west")return this.areaBodyWest;if(t==="center")return this.areaBodyCenter;if(t==="east")return this.areaBodyEast}else if(e==="footer"){if(t==="west")return this.areaFooterWest;if(t==="center")return this.areaFooterCenter;if(t==="east")return this.areaFooterEast}throw Error(`Wrong area identifier: row:${e}, col:${t}`)}adjustBody(){const e=this.areaBodyCenterGeo.height-this.tableModel.getContentHeightInPixel(),t=this.scrollFactorY*e;this.dom.setStyle(this.contentDiv,"top",`${this.scrollTop}px`),this.dom.setStyle(this.contentDiv,"left",`${this.scrollViewport.scrollLeft}px`),this.adjustArea("body",t)}getNumberByAttr(e,t){var s;if(e){const 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 f;const s=this.getArea(e,"west"),i=this.getArea(e,"center"),o=this.getArea(e,"east"),r=i.child.clientHeight;s.child.innerText="",i.child.innerText="",o.child.innerText="";const a=0,n=this.areaBodyCenterGeo.width,c=this.tableModel.getPadding(),d=this.tableModel.getAreaModel(e),p=d.getRowCount();for(;this.cleanupFunctions[e].length;){const m=this.cleanupFunctions[e].shift();m&&m()}let h=t;const g=this.tableModel.getColumnCount(),u=this.tableModel.getFixedRightColumnCount(),S=this.tableModel.getFixedLeftColumnCount();e==="body"&&(this.firstVisibleRowIndex=-1,this.firstFullVisibleRowIndex=-1,this.lastVisibleRowIndex=-1,this.lastFullVisibleRowIndex=-1);for(let m=0;m<p;m++){const w=h,v=m===p-1,R=this.tableModel.getRowHeight(e,m);if(w+R>0){e==="body"&&this.firstVisibleRowIndex===-1&&(this.firstVisibleRowIndex=m,this.firstFullVisibleRowIndex=w<-this.pixelLimitForFullVisible?this.firstVisibleRowIndex+1:this.firstVisibleRowIndex);let x={left:a,width:n,height:R,top:w,index:m},b=this.dom.addRowDiv(i,x,m,e,"center");const T=S;if(this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"center",areaModel:d,geo:x,parent:b,rowIndex:m,columnIndexStart:T,columnIndexEnd:g-u-1,verticalFixed:!1,lastRowOfModel:v}),c.left>0&&(x={left:a,width:this.areaBodyWestGeo.width,height:R,top:w,index:m},b=this.dom.addRowDiv(s,x,m,e,"west"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"west",areaModel:d,geo:x,parent:b,rowIndex:m,columnIndexStart:0,columnIndexEnd:T-1,verticalFixed:!0,lastRowOfModel:v})),c.right>0&&(x={left:a,width:this.areaBodyEastGeo.width,height:R,top:w,index:m},b=this.dom.addRowDiv(o,x,m,e,"east"),this.adjustColumnsToRowParent({areaIdent:e,sideIdent:"east",areaModel:d,geo:x,parent:b,rowIndex:m,columnIndexStart:g-u,columnIndexEnd:g-1,verticalFixed:!0,lastRowOfModel:v})),e==="header"&&this.tree&&m===p-1){const _=this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(b,new D(16,20,20,8)),"data-ge-action","toggleExpandCollapseAll"),{cursor:"pointer"}),M=this.tableOptions.treeOptions.arrowExpandCollapseAll;if(M){const B=this.dom.domService.createText(M.content);this.dom.domService.appendChild(_,B),M.style&&this.dom.applyStyleString(_,M.style)}}}if(h=h+R,h>r){e==="body"&&(this.lastVisibleRowIndex=m,this.lastFullVisibleRowIndex=r-h<-this.pixelLimitForFullVisible?m-1:m,this.displayedRowCount=this.lastFullVisibleRowIndex-this.firstFullVisibleRowIndex+1);break}}if(this.loggingActive&&e==="body"&&console.log("render scope: this.firstVisibleRowIndex <- "+this.firstVisibleRowIndex+`
|
|
9
|
-
render scope: this.firstFullVisibleRowIndex <- `+this.firstFullVisibleRowIndex+`
|
|
10
|
-
render scope: this.lastVisibleRowIndex <- `+this.lastVisibleRowIndex+`
|
|
11
|
-
render scope: this.lastFullVisibleRowIndex <- `+this.lastFullVisibleRowIndex),this.colAndRowspanModels&&this.colAndRowspanModels[e]){const m=((f=this.colAndRowspanModels[e])==null?void 0:f.getRanges())??[];if(m.length)for(const w of m){let v=0,R=i.child,x="center";if(w.c1<S)R=s.child,x="west";else if(u>0&&w.c1>=g-u)R=o.child,x="east";else{const b=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();v=this.scrollFactorX*b-this.areaBodyWestGeo.width,x="center"}this.drawBigCell(w,v,t,d,R,x)}}}drawBigCell(e,t,s,i,o,r){const a=s+this.getRowHeights(0,e.r1-1,i).reduce((f,m)=>f+m,0),n=this.tableModel.getColumnCount(),c=this.tableModel.getFixedRightColumnCount();let d=0;c>0&&e.c1>=n-c&&(d=n-c);const p=t+this.getColumnWidths(d,e.c1-1).reduce((f,m)=>f+m,0),h=this.getRowHeights(e.r1,e.r2,i).reduce((f,m)=>f+m,0),g=this.getColumnWidths(e.c1,e.c2).reduce((f,m)=>f+m,0);let u=!1;const S=this.getSelectionModel?this.getSelectionModel():void 0;S&&(u=S.getSelectionCount(e.r1,e.c1)>0),e.gammaRange?this.renderCell({areaModel:i,areaIdent:i.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:p,top:a,width:g,height:h,parent:o,cellSelected:u,lastRowOfModel:!0,gammaRange:e.gammaRange}):this.renderCell({areaModel:i,areaIdent:i.areaIdent,sideIdent:r,rowIndex:e.r1,columnIndex:e.c1,left:p,top:a,width:g,height:h,parent:o,cellSelected:u,lastRowOfModel:!0,gammaRange:e.gammaRange}),i.areaIdent==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:e.r1,columnIndex:e.c1,cellLeft:p,cellTop:a,cellWidth:g,cellHeight:h,parent:o})}findRowOfImportantRowspanCell(e,t,s){const i=e.getMaxRowspan();for(let o=t-1;o>-1;o--){const r=e.getRowspanAt(o,s);if(r>1&&o+r+1>=t)return o;if(t-o>i)return-1}return-1}adjustColumnsToRowParent({areaIdent:e,sideIdent:t,areaModel:s,geo:i,parent:o,rowIndex:r,columnIndexStart:a,columnIndexEnd:n,verticalFixed:c=!1,lastRowOfModel:d=!1}){var S;this.scrollViewportLeft=this.scrollViewport.scrollLeft;let p=0;if(!c){const f=this.areaBodyCenterGeo.width-this.tableModel.getContentWidthInPixel();p=this.scrollFactorX*f}const h=0,g=!!(e==="body"&&t);let u=p;for(let f=a;f<=n;f++){const m=u,w=this.tableModel.getColumnWidth(f);if(w>0&&m+w>0){let v=i.height;const R=s.getRowspanAt(r,f),x=s.getColspanAt(r,f);R>1&&(v=this.getRowHeights(r,r+R-1,s).reduce((_,M)=>_+M,0));let b=w;x>1&&(b=this.getColumnWidths(f,f+x-1).reduce((_,M)=>_+M,0));let T=!1;if(this.colAndRowspanModels&&this.colAndRowspanModels[e]&&(S=this.colAndRowspanModels[e])!=null&&S.isInRange(r,f)&&(T=!0),this.draggingTargetColumnIndex===f&&e!=="header"){this.renderDragTargetDiv(o,m,h,b,v);const _={left:m,top:h,width:b,height:v};this.dom.addColumnBorderDivs(this.tableOptions,o,_,e,t)}else{const _=this.renderSelectedBackgroundDiv(T,g,t,s,r,f,o,m,h,b,v);"gammaCells"in s&&s.getValueAt(r,f)&&(T=!1),T||this.renderCell({areaModel:s,areaIdent:e,sideIdent:t,rowIndex:r,columnIndex:f,left:m,top:h,width:b,height:v,parent:o,cellSelected:_,lastRowOfModel:d,gammaRange:!0}),e==="header"&&this.tableOptions.columnsResizable&&this.renderHeaderCellResizeHandle({rowIndex:r,columnIndex:f,cellLeft:m,cellTop:h,cellWidth:b,cellHeight:v,parent:o})}}if(u=u+w,u>this.areaBodyCenterGeo.width)break}this.tableOptions.verticalBorderVisible&&this.dom.addVerticalBorder(new D(u-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:r,width:a,height:n,top:c,parent:d,lastRowOfModel:p}){var J;const g=this.editorRenderer&&this.editorRendererRow===i&&this.editorRendererColumn===o?this.editorRenderer:e.getCellRenderer(i,o),u={left:r,width:a,height:n,top:c,index:o},S=e.getRowByIndex(i);let f="none";if(o===this.getTreeArrowColumnIndex()&&H(S)){const C=S;(J=C.children)!=null&&J.length?C.expanded?f="expanded":f="collapsed":f="hidden"}let w;if(t==="header"){const C=this.tableModel.getColumnDef(o);(!(C!=null&&C.sortIconVisible)||C!=null&&C.sortIconVisible())&&(w=C==null?void 0:C.sortState)}const v=e.getValueAt(i,o),R=g?"":`${v}`,x=e.isRowChecked(i),b=this.dom.addColumnDiv({parent:d,geo:u,rowIndex:i,columnIndex:o,areaIdent:t,sideIdent:s,text:R,treeArrow:f,tableOptions:this.tableOptions,checkedType:x,sortState:w}),T=e.getTooltipAt(i,o);T&&this.dom.setAttribute(b,"title",T);const _=this.tableModel.getColumnDef(o);_&&_.classes[t]&&this.dom.addClasses(_.classes[t],b);let M;g&&(M=g.render(b,i,o,t,e,v,this.dom.domService));const B=e.getCustomClassesAt(i,o);if(B.length&&this.dom.addClasses(B,b),this.dom.addColumnBorderDivs(this.tableOptions,d,u,t,s),p&&this.dom.addHorizontalBorder({left:r,width:a,height:n,top:c+n},d),this.getFocusModel&&t==="body"){const C=this.getFocusModel();C!=null&&C.hasFocus(i,o)&&this.dom.addFocusBorderDivs(d,u,{})}t==="header"&&this.dom.setAttribute(b,"data-ge-action","drag-column");const $=e.getCustomStyleAt(i,o);if($)for(const C in $)this.dom.setStyle(b,C,$[C]);return[b,M]}applyCssClasses(e,t={}){e&&Object.entries(t).forEach(([s,i])=>{i?this.dom.addClass(s,e):this.dom.removeClass(s,e)})}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)}adjustDraggingColumn(e,t,s){var i,o;if(this.dragging){const r=this.hostElement.clientHeight,a=this.storedColumnWidths[t];if((i=e.originalEvent)!=null&&i.clientX){const d={left:((o=e.originalEvent)==null?void 0:o.clientX)-a/2,width:a,height:r,top:0,index:t};this.dom.applyStyle(this.draggingColumn,{background:"rgba(128,128,128,0.2)",display:"block",overfllow:"clip"}),this.dom.applyStyleInPx(this.draggingColumn,d),s&&this.renderContentOfDraggingColumn(d)}}else this.hideDraggingColumn()}renderContentOfDraggingColumn(e){const t=this.renderContentOfDraggingColumnForArea(e,"header",0);this.renderContentOfDraggingColumnForArea(e,"body",t)}renderContentOfDraggingColumnForArea(e,t,s=0){const i="center",o=this.tableModel.getAreaModel(t),r=o==null?void 0:o.getRowCount();if(r){const a=e.index??0,n=this.draggingColumn;for(let c=0;c<r;c++){const d=s,p=o.getRowHeight(c),h={left:0,width:e.width,height:p,top:d,index:c},g=o.getValueAt(c,a),u=o.getCellRenderer(c,a),S=u?"":`${g}`,f={parent:n,geo:h,rowIndex:c,columnIndex:a,areaIdent:t,sideIdent:i,text:S},m=this.dom.addColumnDiv(f);let w;u&&(w=u.render(m,c,a,t,o,g,this.dom.domService),w&&this.cleanupFunctions[t].push(w));const v=o.getCustomClassesAt(c,a);v.length&&this.dom.addClasses(v,m);const R=this.tableModel.getColumnDef(a);R&&R.classes[t]&&this.dom.addClasses(R.classes[t],m),this.dom.addColumnBorderDivs(this.tableOptions,n,h,t,i);const x=o.getCustomStyleAt(c,a);if(x)for(const b in x)this.dom.setStyle(m,b,x[b]);s=s+p}}return s}hideDraggingColumn(){this.dom.applyStyle(this.draggingColumn,{display:"none"})}renderDragTargetDiv(e,t,s,i,o){const r=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass("ge-table-drop-zone",e));return this.dom.setStyle(r,"left",`${t}px`),this.dom.setStyle(r,"top",`${s}px`),this.dom.setStyle(r,"width",`${i}px`),this.dom.setStyle(r,"height",`${o}px`),r}renderSelectedBackgroundDiv(e,t,s,i,o,r,a,n,c,d,p){let h=!1;if(!e&&t&&i.isSelectable(o,r)&&this.getSelectionModel){const g=this.getSelectionModel();if(g){const u=g.getSelectionCount(o,r);h=u>0;for(let S=0;S<u;S++){const f=this.dom.applyStylePosistionAbsolute(this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`,a));this.dom.setStyle(f,"left",`${n}px`),this.dom.setStyle(f,"top",`${c}px`),this.dom.setStyle(f,"width",`${d}px`),this.dom.setStyle(f,"height",`${p}px`)}}}return h}renderCell({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:i,columnIndex:o,left:r,top:a,width:n,height:c,parent:d,cellSelected:p,lastRowOfModel:h}){const[g,u]=this.addAndRenderCellDiv({areaModel:e,areaIdent:t,sideIdent:s,rowIndex:i,index:o,left:r,width:n,height:c,top:a,parent:d,lastRowOfModel:h});p&&this.dom.addClass(`ge-table-${t}-${s}-selected-range`,g),u&&this.cleanupFunctions[t].push(u)}renderHeaderCellResizeHandle({rowIndex:e,columnIndex:t,cellLeft:s,cellTop:i,cellWidth:o,cellHeight:r,parent:a}){const n=this.dom.domService,c=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-c}px`),n.setStyle(d,"top",`${i}px`),n.setStyle(d,"width",`${c}px`),n.setStyle(d,"height",`${r}px`),n.appendChild(a,d)}}class Ue{constructor(e,t){this.columnIndex=e,this.sortState=t}}class je{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 r=X(s),a=Number(i),n=Number(o);this.tableScope.updateModelValueAfterEdit(r,a,n,t.value)}}}}class ze{constructor(e=-1,t=-1){this.rowIndex=e,this.columnIndex=t}}class Y{constructor(e){this.cells=e}static createSingle(e,t){return new Y([new ze(e,t)])}}class Xe{constructor(e,t,s,i,o,r,a,n){this.scrollTop=e,this.scrollLeft=t,this.scrollHeight=s,this.scrollWidth=i,this.clientHeight=o,this.clientWidth=r,this.scrollFactorY=a,this.scrollFactorX=n}}class Ke{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,r,a,n,c,d,p;let s=!1,i=!1;if(this.getSelectionModel&&this.getFocusModel){const h=this.getSelectionModel(),g=this.getFocusModel();h&&g&&(g.hasFocus(e.rowIndex,e.columnIndex)||(g.setFocus(e.rowIndex,e.columnIndex),this.tableScope.onFocusChanged(g),s=!0),(o=e.originalEvent)!=null&&o.shiftKey||h.hasSelection()&&(h.clear(),s=!0),(r=e.originalEvent)!=null&&r.shiftKey&&this.previousEvt?(h.addSelection(this.createRangeByEvents(e,this.previousEvt)),i=!0,s=!0):(a=e.originalEvent)!=null&&a.altKey&&((n=e.originalEvent)!=null&&n.ctrlKey||(c=e.originalEvent)!=null&&c.metaKey)?(h.removeSelection(E.singleCell(e.rowIndex,e.columnIndex)),i=!0,s=!0):(d=e.originalEvent)!=null&&d.ctrlKey||(p=e.originalEvent)!=null&&p.metaKey?(h.addSelection(E.singleCell(e.rowIndex,e.columnIndex)),i=!0,s=!0):(h.firstClick(e.rowIndex,e.columnIndex),s=!0),this.tableScope.onSelectionChanged(h))}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),r=Math.max(e.columnIndex,t==null?void 0:t.columnIndex);return E.create({rowIndex1:s,columnIndex1:o,rowIndex2:i,columnIndex2:r})}}class Ye{get(){return{f2:"START_EDITING",space:"TOGGLE_SELECTION","ctrl+num_add":"SELECT_ALL","ctrl+a":"SELECT_ALL","ctrl+shift+a":"DESELECT_ALL","ctrl+x":"DESELECT_ALL","ctrl+num_subtract":"DESELECT_ALL","meta -":"DESELECT_ALL",arrowup:"NAVIGATE_UP",arrowdown:"NAVIGATE_DOWN",arrowleft:"NAVIGATE_LEFT",arrowright:"NAVIGATE_RIGHT","meta+c":"COPY_2_CLIPBOARD","ctrl+c":"COPY_2_CLIPBOARD"}}}class qe{get(){return{f2:"START_EDITING",space:"TOGGLE_SELECTION","ctrl+num_add":"SELECT_ALL","meta+a":"SELECT_ALL","ctrl+a":"SELECT_ALL","meta+x":"DESELECT_ALL","meta+shift+a":"DESELECT_ALL","ctrl+shift+a":"DESELECT_ALL","ctrl+num_subtract":"DESELECT_ALL","ctrl -":"DESELECT_ALL",arrowup:"NAVIGATE_UP",arrowdown:"NAVIGATE_DOWN",arrowleft:"NAVIGATE_LEFT",arrowright:"NAVIGATE_RIGHT","meta+c":"COPY_2_CLIPBOARD","ctrl+c":"COPY_2_CLIPBOARD"}}}function Je(l){return l.trim().replace(/\+/g," ").replace(/ +/g," ").replace(/β«/g,"backspace").replace(/β©/g,"enter").replace(/β§/g,"shift").replace(/β₯/g,"alt").replace(/option/g,"alt").replace(/opt/g,"alt").replace(/β/g,"ctrl").replace(/control/g,"ctrl").replace(/command/g,"cmd").replace(/meta/g,"cmd").replace(/escape/g,"esc").replace(/β/g,"cmd").replace(/\*/g,"multiply").split(" ").filter(e=>e).filter((e,t,s)=>s.indexOf(e)===t).sort((e,t)=>{const s={cmd:1,ctrl:2,alt:3,shift:4},i=s[e]||5,o=s[t]||5;return i!==o?i-o:e.localeCompare(t)}).join(" ")}function Q(l){let e=l.key.toLowerCase();if(e===" "&&(e="space"),e==="arrowleft"&&(e="left"),e==="arrowright"&&(e="right"),e==="arrowup"&&(e="up"),e==="arrowdown"&&(e="down"),e==="delete"&&l.code==="Delete"&&(e="delete"),e==="backspace"&&(e="backspace"),e==="escape"&&(e="esc"),e==="return"&&(e="enter"),l.code.startsWith("Numpad")){const s=l.code.replace("Numpad","").toLowerCase();s==="add"?e="num_add":s==="subtract"?e="num_subtract":s==="multiply"?e="num_multiply":s==="divide"?e="num_divide":s==="decimal"?e="num_decimal":s==="enter"?e="num_enter":e="num_"+s}l.code.match(/^F\d+$/)&&(e=l.code.toLowerCase()),l.code.match(/^Digit\d+$/)&&(e=l.code.replace(/Digit/g,""));let t="";return l.ctrlKey&&(t+=" ctrl"),l.altKey&&(t+=t+" alt"),l.shiftKey&&(t+=t+" shift"),l.metaKey&&(t+=t+" cmd"),Je(t+" "+e)}class Ze{constructor(e){this.tableScope=e,this.shortcutActionIdMapping={},this.listener=[],this.listener.push(e),this.init()}addListener(e){this.listener.includes(e)||this.listener.push(e)}init(){var e,t;(t=(e=this.tableScope)==null?void 0:e.tableOptions)!=null&&t.shortcutActionsDisabled?this.isDebug()&&console.debug("ShortcutService skipped."):(this.assignPredefinedSystemShortcutMappings(),Object.assign(this.shortcutActionIdMapping,this.tableScope.tableOptions.shortcutActionIdMapping),this.isDebug()&&console.debug("ShortcutService",this.shortcutActionIdMapping),this.tableScope.hostElement.addEventListener("keydown",this.onKeyDown.bind(this)))}assignPredefinedSystemShortcutMappings(){this.isMacintosh()?Object.assign(this.shortcutActionIdMapping,new qe().get()):Object.assign(this.shortcutActionIdMapping,new Ye().get())}isMacintosh(){return navigator.platform.indexOf("Mac")>-1}isDebug(){return this.isLocalhost()}isLocalhost(){return location.hostname==="localhost"||location.hostname==="127.0.0.1"}onKeyDown(e){const t=this.findEntity(e);t&&this.emit(t)&&(e.preventDefault(),e.stopPropagation())}emit(e){this.isDebug()&&console.debug("ShortcutService emit :",e);let t=!1;for(const s of this.listener)s.onActionTriggered(e)&&(t=!0);return t}findEntity(e){const t=Q(e);this.isDebug()&&console.debug("ShortcutService shortcut :",t);for(const s in this.shortcutActionIdMapping)if(Q(e)===t)return this.isDebug()&&console.debug("ShortcutService action :",this.shortcutActionIdMapping[s]),this.shortcutActionIdMapping[s]}getShortcutActionMapping(){return this.shortcutActionIdMapping}}class ee{onCheckboxChanged(e){}onContextmenu(e){}onModelChanged(e){}onMouseClicked(e){}onMouseDragging(e){}onMouseDraggingEnd(e){}onMouseMoved(e){}onScroll(e){}onSelectionChanged(e){}onFocusChanged(e){}}class xe{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 Qe{render(e,t,s,i,o,r,a){if(o.isEditable(t,s)){a.addClass(e,"ge-table-row-input-div");const n=o.getValueAt(t,s);e.innerHTML=`
|
|
12
|
-
<input
|
|
13
|
-
type="text"
|
|
14
|
-
value="${n}"
|
|
15
|
-
autofocus
|
|
16
|
-
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
17
|
-
data-listen="change"
|
|
18
|
-
data-area="${i}"
|
|
19
|
-
data-row-index="${t}"
|
|
20
|
-
data-col-index="${s}"
|
|
21
|
-
data-input-type="text"
|
|
22
|
-
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
23
|
-
class="ge-table-cell-editor-input">`}}}class et{constructor(e="none",t="single"){this.selectionType=e,this.selectionMode=t,this.ranges=[],this.negativeRanges=[],this.allSelected=!1,this.silent=!1,this.listenerArr=[]}getEventSelectionChangedListeners(){return this.listenerArr}addEventSelectionChangedListener(e){this.listenerArr.includes(e)||this.listenerArr.push(e)}removeEventSelectionChangedListener(e){const t=this.listenerArr.indexOf(e,0);t>-1&&this.listenerArr.splice(t,1)}fireChangeEvent(){this.silent||this.listenerArr.forEach(e=>e.onSelectionChanged(this))}firstClick(e,t){this.selectionType==="row"?this.addRange(E.singleRow(e)):this.selectionType==="column"&&this.addRange(E.singleColumn(t))}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,this.fireChangeEvent()}hasSelection(){return this.allSelected||!!this.ranges.length}hasNoSelection(){return!this.hasSelection()}getMergedRowIndices(){const e=new Set;for(const t of this.ranges)for(let s=t.r1;s<=t.r2;s++)!e.has(s)&&!this.isInNegativeRange(s,0)&&e.add(s);return Array.from(e)}selectAll(){this.allSelected=!0,this.fireChangeEvent()}isAllSelected(){return this.allSelected}addSelection(e){this.addRange(e),this.fireChangeEvent()}removeSelection(e){if(this.selectionType==="none")return;let t=e;this.selectionType==="row"?t=E.singleRow(e.r1):this.selectionType==="column"&&(t=E.singleColumn(e.c1)),this.negativeRanges.push(t),this.fireChangeEvent()}togglePoint(e,t){this.getSelectionCount(e,t)>0?this.removeSelection(E.singleCell(e,t)):this.addSelection(E.singleCell(e,t))}isSelected(e,t){return this.getSelectionCount(e,t)>0}addRange(e){this.selectionType!=="none"&&(this.allSelected=!1,this.selectionMode==="single"&&(this.ranges=[]),this.selectionType==="row"?(e.c1=0,e.c2=Number.MAX_SAFE_INTEGER):this.selectionType==="column"?(e.r1=0,e.r2=Number.MAX_SAFE_INTEGER):this.selectionType==="cell"?(e.r2=e.r1,e.c2=e.c1):this.selectionType,this.ranges.push(e),this.fireChangeEvent())}}class tt{constructor(e="none"){this.selectionType=e,this.rowIndex=-1,this.columnIndex=-1,this.changed=!1,this.listenerArr=[]}getEventFocusChangedListeners(){return this.listenerArr}addEventFocusChangedListener(e){this.listenerArr.includes(e)||this.listenerArr.push(e)}removeEventFocusChangedListener(e){const t=this.listenerArr.indexOf(e,0);t>-1&&this.listenerArr.splice(t,1)}fireChangeEvent(){this.listenerArr.forEach(e=>e.onFocusChanged(this))}clearChanged(){this.changed=!1}hasChanged(){return this.changed}clear(){this.rowIndex=-1,this.columnIndex=-1,this.fireChangeEvent()}setFocus(e,t){(this.rowIndex!==e||this.columnIndex!==t)&&(this.rowIndex=e,this.columnIndex=t,this.changed=!0,this.fireChangeEvent())}hasFocus(e,t){return this.rowIndex===e&&this.columnIndex===t}getFocus(){return[this.rowIndex,this.columnIndex]}}class st{constructor(e=new I("β―","",["gt-table-icon-expanded"]),t=new I("β―","transform: rotate(180deg) translate(-100%, -100%); transform-origin: 0 0;",["ge-table-icon-collapsed"])){this.iconExpanded=e,this.iconCollapsed=t}}const it=new et,ot=new tt("cell");class we{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 ye,this.headerGroupOptions=new st,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new be,this.sortOrder=["asc","desc"],this.shortcutActionsDisabled=!1,this.resizeEventDebounceDelay=500,this.getEditRenderer=(e,t)=>new Qe,this.getSelectionModel=()=>it,this.getFocusModel=()=>ot}}const k=class k{createContent(e,t,s){return new Promise((i,o)=>{if(t!=null&&t.hasSelection()){const r=this.mergeRanges(t.getRanges());if(r){r.c2=Math.min(r.c2,e.getColumnCount()-1),r.r2=Math.min(r.r2,e.getBodyModel().getRowCount()-1);const a=[];for(let n=r.r1;n<=r.r2;n++){const c=[];for(let d=r.c1;d<=r.c2;d++){const p=t.isSelected(n,d)?e.getBodyModel().getTextValueAt(n,d):"";c.push(p)}a.push(c.join(k.columnSeparatorChar))}return i(a.join(k.rowSeparatorChar))}}if(s){const[r,a]=s.getFocus(),n=e.getBodyModel().getTextValueAt(r,a);return i(n)}o("Cannot copy, neither selection nor focus defined.")})}copyContent(e){return navigator.clipboard.writeText(e)}copyToClipboard(e,t,s){return new Promise((i,o)=>{this.createContent(e,t,s).then(r=>{r&&this.copyContent(r).then(a=>{i(r)}).catch(a=>{o()})}).catch(r=>{o()})})}mergeRanges(e){let t;for(const s of e)t?(t.r1=Math.min(t.r1,s.r1),t.c1=Math.min(t.c1,s.c1),t.r2=Math.max(t.r2,s.r2),t.c2=Math.max(t.c2,s.c2)):t=new E(s.r1,s.c1,s.r2,s.c2);return t}};k.columnSeparatorChar=" ",k.rowSeparatorChar=`
|
|
24
|
-
`;let W=k;class rt{constructor(e,t=500){this.tableScope=e,this.debounceDelay=t,new ResizeObserver(Te(this.handleResize.bind(this),t)).observe(this.tableScope.hostElement)}handleResize(e){const t=e[0],{width:s}=t.contentRect;this.tableScope.recalcColumnWidths(s)}}class lt{downloadExcel(e,t="file.xlsx",s=""){if(!Array.isArray(e)||e.some(i=>!Array.isArray(i)))throw new Error("Invalid matrix format. Expected a 2D array.");if((t==null?void 0:t.trim())==="")throw new Error("Invalid filename. Filename must be a non-empty string.");try{const i=this.generateBuffer(e,s),o=new Blob([i],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),r=document.createElement("a");r.href=URL.createObjectURL(o),r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}catch(i){throw console.error("Error generating Excel file:",i),new Error("Failed to download Excel file.")}}generateMap(e,t=""){const s=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
25
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`,i=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
26
|
-
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Macintosh Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>1</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="1" baseType="lpstr"><vt:lpstr>Sheet1</vt:lpstr></vt:vector></TitlesOfParts><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0300</AppVersion></Properties>`,o=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
27
|
-
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>${t}</dc:creator><cp:lastModifiedBy>${t}</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">2024-12-13T19:45:08Z</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">2024-12-13T19:45:35Z</dcterms:modified></cp:coreProperties>`,r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
28
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/></Relationships>`,a=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
29
|
-
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="0E2841"/></a:dk2><a:lt2><a:srgbClr val="E8E8E8"/></a:lt2><a:accent1><a:srgbClr val="156082"/></a:accent1><a:accent2><a:srgbClr val="E97132"/></a:accent2><a:accent3><a:srgbClr val="196B24"/></a:accent3><a:accent4><a:srgbClr val="0F9ED5"/></a:accent4><a:accent5><a:srgbClr val="A02B93"/></a:accent5><a:accent6><a:srgbClr val="4EA72E"/></a:accent6><a:hlink><a:srgbClr val="467886"/></a:hlink><a:folHlink><a:srgbClr val="96607D"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Aptos Display" panose="02110004020202020204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="ζΈΈγ΄γ·γγ― Light"/><a:font script="Hang" typeface="λ§μ κ³ λ"/><a:font script="Hans" typeface="ηηΊΏ Light"/><a:font script="Hant" typeface="ζ°η΄°ζι«"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/><a:font script="Armn" typeface="Arial"/><a:font script="Bugi" typeface="Leelawadee UI"/><a:font script="Bopo" typeface="Microsoft JhengHei"/><a:font script="Java" typeface="Javanese Text"/><a:font script="Lisu" typeface="Segoe UI"/><a:font script="Mymr" typeface="Myanmar Text"/><a:font script="Nkoo" typeface="Ebrima"/><a:font script="Olck" typeface="Nirmala UI"/><a:font script="Osma" typeface="Ebrima"/><a:font script="Phag" typeface="Phagspa"/><a:font script="Syrn" typeface="Estrangelo Edessa"/><a:font script="Syrj" typeface="Estrangelo Edessa"/><a:font script="Syre" typeface="Estrangelo Edessa"/><a:font script="Sora" typeface="Nirmala UI"/><a:font script="Tale" typeface="Microsoft Tai Le"/><a:font script="Talu" typeface="Microsoft New Tai Lue"/><a:font script="Tfng" typeface="Ebrima"/></a:majorFont><a:minorFont><a:latin typeface="Aptos Narrow" panose="02110004020202020204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="ζΈΈγ΄γ·γγ―"/><a:font script="Hang" typeface="λ§μ κ³ λ"/><a:font script="Hans" typeface="ηηΊΏ"/><a:font script="Hant" typeface="ζ°η΄°ζι«"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="DaunPenh"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/><a:font script="Armn" typeface="Arial"/><a:font script="Bugi" typeface="Leelawadee UI"/><a:font script="Bopo" typeface="Microsoft JhengHei"/><a:font script="Java" typeface="Javanese Text"/><a:font script="Lisu" typeface="Segoe UI"/><a:font script="Mymr" typeface="Myanmar Text"/><a:font script="Nkoo" typeface="Ebrima"/><a:font script="Olck" typeface="Nirmala UI"/><a:font script="Osma" typeface="Ebrima"/><a:font script="Phag" typeface="Phagspa"/><a:font script="Syrn" typeface="Estrangelo Edessa"/><a:font script="Syrj" typeface="Estrangelo Edessa"/><a:font script="Syre" typeface="Estrangelo Edessa"/><a:font script="Sora" typeface="Nirmala UI"/><a:font script="Tale" typeface="Microsoft Tai Le"/><a:font script="Talu" typeface="Microsoft New Tai Lue"/><a:font script="Tfng" typeface="Ebrima"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000"/><a:lumMod val="100000"/><a:shade val="100000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="63000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:lnDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst/><a:extLst><a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}"><thm15:themeFamily xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="Office Theme" id="{2E142A2C-CD16-42D6-873A-C26D2A0506FA}" vid="{1BDDFF52-6CD6-40A5-AB3C-68EB2F1E4D0A}"/></a:ext></a:extLst></a:theme>`,n=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
30
|
-
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="3" uniqueCount="3"><si><t>a</t></si><si><t>b</t></si><si><t>c</t></si></sst>`,c=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
31
|
-
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac x16r2 xr" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision"><fonts count="1" x14ac:knownFonts="1"><font><sz val="12"/><color theme="1"/><name val="Aptos Narrow"/><family val="2"/><scheme val="minor"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0"/><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/><extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1"/></ext><ext uri="{9260A510-F301-46a8-8635-F512D64BE5F5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:timelineStyles defaultTimelineStyle="TimeSlicerStyleLight1"/></ext></extLst></styleSheet>`,d=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
32
|
-
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x15 xr xr6 xr10 xr2" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr6="http://schemas.microsoft.com/office/spreadsheetml/2016/revision6" xmlns:xr10="http://schemas.microsoft.com/office/spreadsheetml/2016/revision10" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"><fileVersion appName="xl" lastEdited="7" lowestEdited="7" rupBuild="11207"/><workbookPr defaultThemeVersion="202300"/><mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice Requires="x15"><x15ac:absPath url="/" xmlns:x15ac="http://schemas.microsoft.com/office/spreadsheetml/2010/11/ac"/></mc:Choice></mc:AlternateContent><xr:revisionPtr revIDLastSave="0" documentId="8_{292BF245-1F37-B045-B1A5-26C42FB62779}" xr6:coauthVersionLast="47" xr6:coauthVersionMax="47" xr10:uidLastSave="{00000000-0000-0000-0000-000000000000}"/><bookViews><workbookView xWindow="11340" yWindow="5060" windowWidth="28040" windowHeight="17440" xr2:uid="{858B8D3F-6246-774D-8903-6D38687B7BC6}"/></bookViews><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets><calcPr calcId="181029"/><extLst><ext uri="{140A7094-0E35-4892-8432-C4D2E57EDEB5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:workbookPr chartTrackingRefBase="1"/></ext><ext uri="{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}" xmlns:xcalcf="http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures"><xcalcf:calcFeatures><xcalcf:feature name="microsoft.com:RD"/><xcalcf:feature name="microsoft.com:Single"/><xcalcf:feature name="microsoft.com:FV"/><xcalcf:feature name="microsoft.com:CNMTM"/><xcalcf:feature name="microsoft.com:LET_WF"/><xcalcf:feature name="microsoft.com:LAMBDA_WF"/><xcalcf:feature name="microsoft.com:ARRAYTEXT_WF"/></xcalcf:calcFeatures></ext></extLst></workbook>`,p=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
33
|
-
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>`,h=new Map;return h.set("_rels/.rels",s),h.set("docProps/app.xml",i),h.set("docProps/core.xml",o),h.set("xl/_rels/workbook.xml.rels",r),h.set("xl/theme/theme1.xml",a),h.set("xl/worksheets/sheet1.xml",this.getX1WorksheetsSheet1Xml(e)),h.set("xl/sharedStrings.xml",n),h.set("xl/styles.xml",c),h.set("xl/workbook.xml",d),h.set("[Content_Types].xml",p),h}getX1WorksheetsSheet1Xml(e){const t=[];t.push(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
34
|
-
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac xr xr2 xr3" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2" xmlns:xr3="http://schemas.microsoft.com/office/spreadsheetml/2016/revision3" xr:uid="{E15F8FC4-4D40-434C-921A-3D9CFAAA2865}">
|
|
35
|
-
<dimension ref="A1:B3"/>
|
|
36
|
-
<sheetViews>
|
|
37
|
-
<sheetView tabSelected="1" workbookViewId="0"/></sheetViews>
|
|
38
|
-
<sheetFormatPr baseColWidth="10" defaultRowHeight="16" x14ac:dyDescent="0.2"/>
|
|
39
|
-
<sheetData>`);for(let s=0;s<e.length;s++){const i=e[s];t.push('<row r="${r + 1}" spans="1:2" x14ac:dyDescent="0.2">');for(let o=0;o<i.length;o++){const r=i[o],a=this.getCellAddress(s,o);if(typeof r=="number")t.push(`<c r="${a}"><v>${r}</v></c>`);else if(r instanceof Date){const n=r;t.push(`<c r="${a}" t="inlineStr"><is><t>${n.toISOString()}</t></is></c>`)}else{const n=r!=null?this.escapeXml(String(r)):"";t.push(`<c r="${a}" t="inlineStr"><is><t>${n}</t></is></c>`)}}t.push("</row>")}return t.push(""),t.push(""),t.push('</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>'),t.push("</worksheet>"),t.join(`
|
|
40
|
-
`)}escapeXml(e){return e==null?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}getCellAddress(e,t){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZ";let i="";for(;t>=0;)i=s[t%26]+i,t=Math.floor(t/26)-1;return`${i}${e+1}`}createZip(e){const t=[];let s=0;const i=[];e.forEach((p,h)=>{const g=new TextEncoder().encode(h),u=new TextEncoder().encode(p),S=new Uint8Array(30+g.length),f=new DataView(S.buffer);S.set([80,75,3,4],0),f.setUint16(4,20,!0),f.setUint16(6,0,!0),f.setUint16(8,0,!0),f.setUint16(10,0,!0),f.setUint16(12,0,!0),f.setUint32(14,0,!0),f.setUint32(18,u.length,!0),f.setUint32(22,u.length,!0),f.setUint16(26,g.length,!0),f.setUint16(28,0,!0),S.set(g,30),t.push(S,u),i.push({path:h,offset:s,contentSize:u.length}),s+=S.length+u.length});const o=s;i.forEach(p=>{const h=new TextEncoder().encode(p.path),g=new Uint8Array(46+h.length),u=new DataView(g.buffer);g.set([80,75,1,2],0),u.setUint16(4,20,!0),u.setUint16(6,20,!0),u.setUint16(8,0,!0),u.setUint16(10,0,!0),u.setUint16(12,0,!0),u.setUint16(14,0,!0),u.setUint32(16,0,!0),u.setUint32(20,p.contentSize,!0),u.setUint32(24,p.contentSize,!0),u.setUint16(28,h.length,!0),u.setUint16(30,0,!0),u.setUint16(32,0,!0),u.setUint16(34,0,!0),u.setUint16(36,0,!0),u.setUint32(38,0,!0),u.setUint32(42,p.offset,!0),g.set(h,46),t.push(g),s+=g.length});const r=new Uint8Array(22),a=new DataView(r.buffer);r.set([80,75,5,6],0),a.setUint16(4,0,!0),a.setUint16(6,0,!0),a.setUint16(8,i.length,!0),a.setUint16(10,i.length,!0),a.setUint32(12,s-o,!0),a.setUint32(16,o,!0),a.setUint16(20,0,!0),t.push(r);const n=t.reduce((p,h)=>p+h.length,0),c=new Uint8Array(n);let d=0;for(const p of t)c.set(p,d),d+=p.length;return c}generateBuffer(e,t=""){const s=this.generateMap(e,t);return this.createZip(s)}}class q extends Ge{constructor(e,t,s,i,o,r=new W,a=new lt){var d;if(super(e,t,new Fe(s),i),this.eventListener=o,this.copyService=r,this.excelService=a,this.licenseManager=O.getInstance(),this.selectionService=new Ke(this),this.api=new ke(this),this.mouseStartAction="",this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.lastDragFrom=-1,this.lastDragTo=-1,this.firstDraggingRendering=!0,this.lastContextmenu=Date.now(),t.setTableScope(this),o||(this.eventListener=new ee),(d=this.tableOptions)!=null&&d.autoRestoreOptions){const p=this.tableOptions.autoRestoreOptions,h=p.getStorageKeyFn;h&&(p.autoRestoreScrollPosition&&(this.storeScrollPosStateService=new Be(h)),p.autoRestoreCollapsedExpandedState&&(this.storeStateCollapsedExpandService=new Ve(h)),p.autoRestoreSortingState&&(this.storeSortingService=new He(h)))}this.mouseHandler=new Ie(this),this.inputHandler=new je(this),this.resizeHandler=new rt(this,i.resizeEventDebounceDelay),this.shortcutService=new Ze(this),this.shortcutService.addListener(this.selectionService);const n=this.getSelectionModel?this.getSelectionModel():void 0;n&&n.addEventSelectionChangedListener(this);const c=this.getFocusModel?this.getFocusModel():void 0;c&&c.addEventFocusChangedListener(this)}static create(e,t,s=new we,i=new ee,o=new xe,r=new W){return new q(e,t,o,s,i,r)}onActionTriggered(e){if(e==="NAVIGATE_DOWN"&&this.changeFocusCell(0,1)||e==="NAVIGATE_UP"&&this.changeFocusCell(0,-1)||e==="NAVIGATE_LEFT"&&this.changeFocusCell(-1,0)||e==="NAVIGATE_RIGHT"&&this.changeFocusCell(1,0))return!0;if(e==="START_EDITING"&&this.getFocusModel){const t=this.getFocusModel();if(t){const[s,i]=t.getFocus();this.tableModel.getBodyModel().isEditable(s,i)&&(this.clearSelection(),this.initRenderEditor(s,i))}return!0}if(e==="COPY_2_CLIPBOARD"){const t=this.getSelectionModel?this.getSelectionModel():void 0,s=this.getFocusModel?this.getFocusModel():void 0;this.copyService.createContent(this.tableModel,t,s).then(i=>this.copyService.copyContent(i))}return!1}updateModelValueAfterEdit(e,t,s,i){e==="body"&&this.tableModel.getAreaModel(e).setValue(t,s,i)&&(this.resetEditorRenderer(),this.repaint(),this.eventListener.onModelChanged(Y.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 z;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.firstDraggingRendering=!0,this.dragFrom=this.mouseStartColumnIndex))}mouseDraggingOnFrame(e,t){this.eventListener.onMouseDragging(e),this.mouseEvent=e,this.mouseStartColumnIndex>-1&&this.mouseStartAction==="resize-column"&&this.tableOptions.columnsResizable?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&e.columnIndex>-1&&this.tableOptions.columnsDraggable&&(this.draggingTargetColumnIndex=e.columnIndex,this.dragTo=this.draggingTargetColumnIndex,this.dragFrom>-1&&this.dragTo>-1&&this.dragFrom!==this.dragTo&&(this.lastDragFrom===this.dragTo&&this.lastDragTo===this.dragFrom||(this.tableModel.changeColumnOrder(this.dragFrom,this.dragTo),this.lastDragFrom=this.dragFrom,this.lastDragTo=this.dragTo,this.dragFrom=this.dragTo,this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows())),t&&(this.adjustDraggingColumn(e,t.columnIndex,this.firstDraggingRendering),this.firstDraggingRendering=!1),this.repaint())}mouseDraggingEndOnFrame(e){this.eventListener.onMouseDraggingEnd(e),this.draggingTargetColumnIndex=-1,this.mouseStartAction==="resize-column"?this.resizeColumn(e):this.mouseStartAction==="drag-column"&&(this.hideDraggingColumn(),this.repaint()),this.mouseStartWidth=-1,this.mouseStartColumnIndex=-1,this.dragFrom=-1,this.dragTo=-1,this.firstDraggingRendering=!0,this.mouseStartAction=""}mouseMove(e){this.eventListener.onMouseMoved(e),this.adjustHoverRows(e),this.adjustHoverColumns(e)}contextmenu(e){var s,i;const t=Date.now();if(t-this.lastContextmenu<50){this.lastContextmenu=t,(s=e.originalEvent)==null||s.preventDefault(),(i=e.originalEvent)==null||i.stopImmediatePropagation();return}this.lastContextmenu=t,this.eventListener.onContextmenu(e)}toggleExpandCollapseAll(e=!0){var s;const t=this.tableModel.getBodyModel();U(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),r=o===void 0||o==="semi"||o==="none";i.setRowChecked(e,r),this.repaint();const a=(n=i.rowSelectionModel)==null?void 0:n.getCheckedRows();this.eventListener.onCheckboxChanged(a||[])}onMouseClicked(e,t){let s=this.selectionService.onMouseClicked(e,t);if(!s&&this.getFocusModel){this.resetEditorRenderer();const i=this.getFocusModel();i&&(s=i.hasChanged(),i.clearChanged())}return s}debounceRepaint(){this.debounce(this.repaint.bind(this),1)}publishGeMouseEvent(e){this.eventListener.onMouseClicked(e)}onFocusChanged(e){this.eventListener.onFocusChanged(e)}onSelectionChanged(e){this.eventListener.onSelectionChanged(e)}externalFilterChanged(e=!0){const t=this.tableOptions.externalFilterFunction;t&&(e&&this.clearSelectionModel(),this.tableModel.externalFilterChanged(t),this.scrollViewport.scrollTo(0,0),this.tableModel.recalcHeightAndPadding(),this.resetSizeOfWrapperDiv(),this.repaint())}onHeaderDblClicked(e,t,s){var o,r;const i=this.tableModel.getColumnDef(s);if(i!=null&&i.sortable&&i.sortable()){e.preventDefault(),e.stopPropagation();const a=i.sortStatesOrder?i.sortStatesOrder:this.tableOptions.sortOrder,n=i.sortState??"",c=a[(a.indexOf(n)+1)%a.length],d=new Ue(s,c);this.tableModel.doSort([d])&&((o=this.tableModel.getColumnDefs())==null||o.forEach(h=>h.sortState=""),i.sortState=c),this.repaint(),(r=this.storeSortingService)==null||r.setSortItems([d])}}scrollToPixel(e,t){this.scrollViewport.scrollTo(e,t)}scrollToIndex(e,t){const i=this.tableModel.getAreaModel("body").getYPosByRowIndex(t);this.scrollToPixel(0,i)}adjustAfterScrolling(){super.adjustAfterScrolling();const e=this.scrollViewport;this.eventListener.onScroll(new Xe(this.scrollTop,this.scrollLeft,e.scrollHeight,e.scrollWidth,e.clientHeight,e.clientWidth,this.scrollFactorY,this.scrollFactorX))}setSelectionModel(e,t=!1){const s=()=>e;this.tableOptions.getSelectionModel=s,this.getSelectionModel=s,this.selectionService.getSelectionModel=s,t&&this.repaint()}toggleHeaderGroup(e){const t=this.tableModel.getAreaModel("header");"columnDefs"in this.tableModel&&(this.tableModel.columnDefs=t.toggleHeaderGroup(e),console.info("####### !!!!!! *******, this.tableModel.columnDefs")),this.firstInit()}selectionModel(){if(this!=null&&this.getSelectionModel)return this.getSelectionModel()}focusModel(){if(this!=null&&this.getFocusModel)return this.getFocusModel()}setDragging(e){this.dragging=e,this.dragging?(this.storeColumnWidths(),this.lastDragFrom=-1,this.lastDragTo=-1):this.storedColumnWidths=[]}changeFocusCell(e,t){if(!this.isEditing()&&this.getFocusModel){const s=this.getFocusModel();if(s){const[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(),r=this.tableModel.getAreaModel("body");if(U(r)){const a=r,n=r.getRowCount();for(let c=0;c<n;c++){const d=r.getRowByIndex(c);if(d)if(o.allExpanded)d.expanded=!0;else if(o.allCollapsed)d.expanded=!1;else{const p=i(d.data);o.mode==="expanded"?d.expanded=this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(p):o.mode==="collapsed"&&(d.expanded=!this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(p))}}a.recalcVisibleTreeRows()}}}}calcAutoColumnWidths(){const e=this.tableModel.getBodyModel(),t=this.tableModel.getColumnCount(),s=(e==null?void 0:e.getRowCount())??0;if(!e)return console.warn("Body model is not available."),[];const i=new Array(t).fill(0);for(let o=0;o<s;o++)for(let r=0;r<t;r++){const a=e.getValueAt(o,r),n=(a==null?void 0:a.toString().length)||0;n>i[r]&&(i[r]=n)}return i.map(o=>Math.max(o*10,50))}setColumnWidth(e,t){this.tableModel.setColumnWidth(e,t)}autoResizeColumns(e=!0){const t=this.calcAutoColumnWidths();for(let s=0;s<t.length;s++){const i=t[s];this.tableModel.setColumnWidth(s,i)}e&&this.recalcWrappers()}recalcWrappers(){this.tableModel.recalcPadding(),this.resetSizeOfWrapperDiv(),this.adjustContainersAndRows()}reSort(){var t;let e=((t=this.storeSortingService)==null?void 0:t.getSortItems())??[];this.tableModel.doSort(e)}sort(e){this.tableModel.sort(e)}ensureRowIsVisible(e){const t=this.getFirstFullVisibleRowIndex(),s=this.getLastFullVisibleRowIndex(),i=this.getDisplayedRowCount();return e<t?(this.scrollToIndex(0,e),!0):e>s?(this.scrollToIndex(0,e-i+1),!0):!1}}class at extends y.Component{constructor(t){super(t);Z(this,"ref",y.createRef())}componentDidMount(){const t=this.ref.current;this.initTable(t,this.props)}componentWillUnmount(){}initTable(t,s){const i={onSelectionChanged(r){s.selectionChanged&&s.selectionChanged(r)},onScroll(r){s.scroll&&s.scroll(r)},onFocusChanged(r){s.focusChanged&&s.focusChanged(r)},onCheckboxChanged:r=>{s.checkboxChanged&&s.checkboxChanged(r)},onContextmenu:r=>{s.contextmenu&&s.contextmenu(r)},onModelChanged:r=>{s.modelChanged&&s.modelChanged(r)},onMouseClicked:r=>{s.mouseClicked&&s.mouseClicked(r)},onMouseDragging:r=>{s.mouseDragging&&s.mouseDragging(r)},onMouseDraggingEnd:r=>{s.mouseDraggingEnd&&s.mouseDraggingEnd(r)},onMouseMoved:r=>{}},o=new q(t,s.tableModel,new xe,s.tableOptions??new we,i);o.firstInit(),s.tableReady&&s.tableReady(o.getApi()),s.licenseKey&&O.getInstance().setLicenseKey(s.licenseKey)}render(){return Me.jsx("div",{ref:this.ref,className:"container-div",style:{width:"100%",height:"100%",backgroundColor:"transparent",padding:"0",margin:"0"}})}}var F,N,te,ve=[],A=y.options,se=A.__b,ie=A.__r,oe=A.diffed,re=A.__c,le=A.unmount,ae=A.__;function nt(){for(var l;l=ve.shift();)if(l.__P&&l.__H)try{l.__H.__h.forEach(V),l.__H.__h.forEach(j),l.__H.__h=[]}catch(e){l.__H.__h=[],A.__e(e,l.__v)}}A.__b=function(l){F=null,se&&se(l)},A.__=function(l,e){l&&e.__k&&e.__k.__m&&(l.__m=e.__k.__m),ae&&ae(l,e)},A.__r=function(l){ie&&ie(l);var e=(F=l.__c).__H;e&&(N===F?(e.__h=[],F.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(V),e.__h.forEach(j),e.__h=[])),N=F},A.diffed=function(l){oe&&oe(l);var e=l.__c;e&&e.__H&&(e.__H.__h.length&&(ve.push(e)!==1&&te===A.requestAnimationFrame||((te=A.requestAnimationFrame)||ct)(nt)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),N=F=null},A.__c=function(l,e){e.some(function(t){try{t.__h.forEach(V),t.__h=t.__h.filter(function(s){return!s.__||j(s)})}catch(s){e.some(function(i){i.__h&&(i.__h=[])}),e=[],A.__e(s,t.__v)}}),re&&re(l,e)},A.unmount=function(l){le&&le(l);var e,t=l.__c;t&&t.__H&&(t.__H.__.forEach(function(s){try{V(s)}catch(i){e=i}}),t.__H=void 0,e&&A.__e(e,t.__v))};var ne=typeof requestAnimationFrame=="function";function ct(l){var e,t=function(){clearTimeout(s),ne&&cancelAnimationFrame(e),setTimeout(l)},s=setTimeout(t,35);ne&&(e=requestAnimationFrame(t))}function V(l){var e=F,t=l.__c;typeof t=="function"&&(l.__c=void 0,t()),F=e}function j(l){var e=F;l.__c=l.__(),F=e}function dt(l,e){for(var t in e)l[t]=e[t];return l}function ce(l,e){for(var t in l)if(t!=="__source"&&!(t in e))return!0;for(var s in e)if(s!=="__source"&&l[s]!==e[s])return!0;return!1}function de(l,e){this.props=l,this.context=e}(de.prototype=new y.Component).isPureReactComponent=!0,de.prototype.shouldComponentUpdate=function(l,e){return ce(this.props,l)||ce(this.state,e)};var he=y.options.__b;y.options.__b=function(l){l.type&&l.type.__f&&l.ref&&(l.props.ref=l.ref,l.ref=null),he&&he(l)};var ht=y.options.__e;y.options.__e=function(l,e,t,s){if(l.then){for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(l,e)}ht(l,e,t,s)};var pe=y.options.unmount;function Ce(l,e,t){return l&&(l.__c&&l.__c.__H&&(l.__c.__H.__.forEach(function(s){typeof s.__c=="function"&&s.__c()}),l.__c.__H=null),(l=dt({},l)).__c!=null&&(l.__c.__P===t&&(l.__c.__P=e),l.__c.__e=!0,l.__c=null),l.__k=l.__k&&l.__k.map(function(s){return Ce(s,e,t)})),l}function Re(l,e,t){return l&&t&&(l.__v=null,l.__k=l.__k&&l.__k.map(function(s){return Re(s,e,t)}),l.__c&&l.__c.__P===e&&(l.__e&&t.appendChild(l.__e),l.__c.__e=!0,l.__c.__P=t)),l}function G(){this.__u=0,this.o=null,this.__b=null}function Ae(l){var e=l.__.__c;return e&&e.__a&&e.__a(l)}function P(){this.i=null,this.l=null}y.options.unmount=function(l){var e=l.__c;e&&e.__R&&e.__R(),e&&32&l.__u&&(l.type=null),pe&&pe(l)},(G.prototype=new y.Component).__c=function(l,e){var t=e.__c,s=this;s.o==null&&(s.o=[]),s.o.push(t);var i=Ae(s.__v),o=!1,r=function(){o||(o=!0,t.__R=null,i?i(a):a())};t.__R=r;var a=function(){if(!--s.__u){if(s.state.__a){var n=s.state.__a;s.__v.__k[0]=Re(n,n.__c.__P,n.__c.__O)}var c;for(s.setState({__a:s.__b=null});c=s.o.pop();)c.forceUpdate()}};s.__u++||32&e.__u||s.setState({__a:s.__b=s.__v.__k[0]}),l.then(r,r)},G.prototype.componentWillUnmount=function(){this.o=[]},G.prototype.render=function(l,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),s=this.__v.__k[0].__c;this.__v.__k[0]=Ce(this.__b,t,s.__O=s.__P)}this.__b=null}var i=e.__a&&y.createElement(y.Fragment,null,l.fallback);return i&&(i.__u&=-33),[y.createElement(y.Fragment,null,e.__a?null:l.children),i]};var ue=function(l,e,t){if(++t[1]===t[0]&&l.l.delete(e),l.props.revealOrder&&(l.props.revealOrder[0]!=="t"||!l.l.size))for(t=l.i;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;l.i=t=t[2]}};(P.prototype=new y.Component).__a=function(l){var e=this,t=Ae(e.__v),s=e.l.get(l);return s[0]++,function(i){var o=function(){e.props.revealOrder?(s.push(i),ue(e,l,s)):i()};t?t(o):o()}},P.prototype.render=function(l){this.i=null,this.l=new Map;var e=y.toChildArray(l.children);l.revealOrder&&l.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.l.set(e[t],this.i=[1,0,this.i]);return l.children},P.prototype.componentDidUpdate=P.prototype.componentDidMount=function(){var l=this;this.l.forEach(function(e,t){ue(l,t,e)})};var pt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,ut=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ft=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,mt=/[A-Z0-9]/g,gt=typeof document<"u",St=function(l){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(l)};function yt(l,e,t){return e.__k==null&&(e.textContent=""),y.render(l,e),typeof t=="function"&&t(),l?l.__c:null}y.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(l){Object.defineProperty(y.Component.prototype,l,{configurable:!0,get:function(){return this["UNSAFE_"+l]},set:function(e){Object.defineProperty(this,l,{configurable:!0,writable:!0,value:e})}})});var fe=y.options.event;function bt(){}function xt(){return this.cancelBubble}function wt(){return this.defaultPrevented}y.options.event=function(l){return fe&&(l=fe(l)),l.persist=bt,l.isPropagationStopped=xt,l.isDefaultPrevented=wt,l.nativeEvent=l};var vt={enumerable:!1,configurable:!0,get:function(){return this.class}},me=y.options.vnode;y.options.vnode=function(l){typeof l.type=="string"&&(function(e){var t=e.props,s=e.type,i={},o=s.indexOf("-")===-1;for(var r in t){var a=t[r];if(!(r==="value"&&"defaultValue"in t&&a==null||gt&&r==="children"&&s==="noscript"||r==="class"||r==="className")){var n=r.toLowerCase();r==="defaultValue"&&"value"in t&&t.value==null?r="value":r==="download"&&a===!0?a="":n==="translate"&&a==="no"?a=!1:n[0]==="o"&&n[1]==="n"?n==="ondoubleclick"?r="ondblclick":n!=="onchange"||s!=="input"&&s!=="textarea"||St(t.type)?n==="onfocus"?r="onfocusin":n==="onblur"?r="onfocusout":ft.test(r)&&(r=n):n=r="oninput":o&&ut.test(r)?r=r.replace(mt,"-$&").toLowerCase():a===null&&(a=void 0),n==="oninput"&&i[r=n]&&(r="oninputCapture"),i[r]=a}}s=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=y.toChildArray(t.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),s=="select"&&i.defaultValue!=null&&(i.value=y.toChildArray(t.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",vt)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i})(l),l.$$typeof=pt,me&&me(l)};var ge=y.options.__r;y.options.__r=function(l){ge&&ge(l),l.__c};var Se=y.options.diffed;y.options.diffed=function(l){Se&&Se(l);var e=l.props,t=l.__e;t!=null&&l.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value)};function Ct(l){return!!l.__k&&(y.render(null,l),!0)}function Rt(l){return{render:function(e){yt(e,l)},unmount:function(){Ct(l)}}}class At{constructor(e){this.Component=e,console.info(e)}render(e,t,s,i,o,r,a){const n={cellDiv:e,rowIndex:t,columnIndex:s,areaIdent:i,areaModel:o,cellValue:r},c=Rt(e);return c.render(this.Component(n)),()=>{c.unmount()}}}exports.ComponentRendererWrapper=At;exports.GuiexpertTable=at;
|
|
1
|
+
"use strict";var s=Object.defineProperty;var u=(o,t,i)=>t in o?s(o,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[t]=i;var l=(o,t,i)=>u(o,typeof t!="symbol"?t+"":t,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("preact/jsx-runtime"),a=require("preact"),r=require("@guiexpert/table");class h extends a.Component{constructor(i){super(i);l(this,"ref",a.createRef())}componentDidMount(){const i=this.ref.current;this.initTable(i,this.props)}componentWillUnmount(){}initTable(i,e){const d={onSelectionChanged(n){e.selectionChanged&&e.selectionChanged(n)},onScroll(n){e.scroll&&e.scroll(n)},onFocusChanged(n){e.focusChanged&&e.focusChanged(n)},onCheckboxChanged:n=>{e.checkboxChanged&&e.checkboxChanged(n)},onContextmenu:n=>{e.contextmenu&&e.contextmenu(n)},onModelChanged:n=>{e.modelChanged&&e.modelChanged(n)},onMouseClicked:n=>{e.mouseClicked&&e.mouseClicked(n)},onMouseDragging:n=>{e.mouseDragging&&e.mouseDragging(n)},onMouseDraggingEnd:n=>{e.mouseDraggingEnd&&e.mouseDraggingEnd(n)},onMouseMoved:n=>{}},c=new r.TableScope(i,e.tableModel,new r.SimpleDomService,e.tableOptions??new r.TableOptions,d);c.firstInit(),e.tableReady&&e.tableReady(c.getApi()),e.licenseKey&&r.LicenseManager.getInstance().setLicenseKey(e.licenseKey)}render(){return m.jsx("div",{ref:this.ref,className:"container-div",style:{width:"100%",height:"100%",backgroundColor:"transparent",padding:"0",margin:"0"}})}}class C{constructor(t){this.Component=t}render(t,i,e,d,c,n,f){const g={cellDiv:t,rowIndex:i,columnIndex:e,areaIdent:d,areaModel:c,cellValue:n};return a.render(a.h(this.Component,g),t),()=>{a.render(null,t)}}}exports.ComponentRendererWrapper=C;exports.GuiexpertTable=h;
|