@omegagrid/bundle 0.10.28 → 0.10.29
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/omegagrid.js +21 -19
- package/package.json +18 -18
package/omegagrid.js
CHANGED
|
@@ -2416,33 +2416,35 @@
|
|
|
2416
2416
|
@click="${t=>this._onCrossClick(t,e)}">
|
|
2417
2417
|
</og-close>`:""}
|
|
2418
2418
|
</div>
|
|
2419
|
-
`)),this.
|
|
2419
|
+
`)),this.renderEmptySpace=()=>as`
|
|
2420
|
+
<div
|
|
2421
|
+
class="empty"
|
|
2422
|
+
@dragover="${t=>this._onDragover(t,this.items.length)}"
|
|
2423
|
+
@drop="${()=>this._onDrop()}"
|
|
2424
|
+
@dragleave="${()=>this.hideOverlay()}">
|
|
2425
|
+
${this.addButton?as`
|
|
2426
|
+
<og-button
|
|
2427
|
+
id="btnAdd"
|
|
2428
|
+
icon="plus"
|
|
2429
|
+
color="gray"
|
|
2430
|
+
@click="${()=>this.dispatchEvent(new Wp("add",{tab:this.items[this.items.length-1],tabs:this}))}">
|
|
2431
|
+
</og-button>
|
|
2432
|
+
`:""}
|
|
2433
|
+
</div>
|
|
2434
|
+
`,this.render=()=>as`
|
|
2420
2435
|
${this.items&&this.items.length>0?this.scrollable?as`
|
|
2421
2436
|
<og-container sliderSize="6" scrollMode="horizontal">
|
|
2422
2437
|
<div class="tabs" slot="content"
|
|
2423
2438
|
@dragend="${()=>this.hideOverlay()}">
|
|
2424
2439
|
${this.renderTabs()}
|
|
2440
|
+
${this.renderEmptySpace()}
|
|
2425
2441
|
</div>
|
|
2426
2442
|
</og-container>
|
|
2427
2443
|
`:as`
|
|
2428
2444
|
<div class="tabs"
|
|
2429
2445
|
@dragend="${()=>this.hideOverlay()}">
|
|
2430
2446
|
${this.renderTabs()}
|
|
2431
|
-
|
|
2432
|
-
<div
|
|
2433
|
-
class="empty"
|
|
2434
|
-
@dragover="${t=>this._onDragover(t,this.items.length)}"
|
|
2435
|
-
@drop="${()=>this._onDrop()}"
|
|
2436
|
-
@dragleave="${()=>this.hideOverlay()}">
|
|
2437
|
-
${this.addButton?as`
|
|
2438
|
-
<og-button
|
|
2439
|
-
id="btnAdd"
|
|
2440
|
-
icon="plus"
|
|
2441
|
-
color="gray"
|
|
2442
|
-
@click="${()=>this.dispatchEvent(new Wp("add",{tab:this.items[this.items.length-1],tabs:this}))}">
|
|
2443
|
-
</og-button>
|
|
2444
|
-
`:""}
|
|
2445
|
-
</div>
|
|
2447
|
+
${this.renderEmptySpace()}
|
|
2446
2448
|
</div>
|
|
2447
2449
|
`:""}
|
|
2448
2450
|
|
|
@@ -2522,7 +2524,7 @@
|
|
|
2522
2524
|
${"top"==this.tabPosition?t:e}
|
|
2523
2525
|
${"bottom"==this.tabPosition?t:e}
|
|
2524
2526
|
<div id="overlay" style="display: none"></div>
|
|
2525
|
-
`}}set inactive(t){(function(t,e,i,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===o?r.call(t,i):r?r.value=i:e.set(t,i)})(this,Yp,t,"f"),this.tabs&&this.tabs.classList.toggle("inactive",t)}get inactive(){return function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)}(this,Yp,"f")}get selectedIndex(){return this._selectedIndex}set selectedIndex(t){t!=this._selectedIndex&&(this.requestUpdate("selectedIndex",this._selectedIndex),this._selectedIndex=t)}get selectedId(){return this.tabs?.selectedItem?.id}get component(){return this.currentComponent}layout(){this.currentComponent?.layout&&this.currentComponent.layout()}updateTabs(){this.tabs.requestUpdate()}async getComponent(t){if(!this.createComponent)return null;const e=this.cacheComponents||this._itemMap?.get(t)?.preventDisconnect;if(!e||!this.components.has(t)){const i=await this.createComponent(t);if(i.dataset.preventDisconnect=this._itemMap?.get(t)?.preventDisconnect?"1":"0",!e)return i;this.components.set(t,i)}return this.components.get(t)}async loadComponent(t){if(null!=t){
|
|
2527
|
+
`}}set inactive(t){(function(t,e,i,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===o?r.call(t,i):r?r.value=i:e.set(t,i)})(this,Yp,t,"f"),this.tabs&&this.tabs.classList.toggle("inactive",t)}get inactive(){return function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)}(this,Yp,"f")}get selectedIndex(){return this._selectedIndex}set selectedIndex(t){t!=this._selectedIndex&&(this.requestUpdate("selectedIndex",this._selectedIndex),this._selectedIndex=t)}get selectedId(){return this.tabs?.selectedItem?.id}get component(){return this.currentComponent}layout(){this.currentComponent?.layout&&this.currentComponent.layout()}updateTabs(){this.tabs.requestUpdate()}async getComponent(t){if(!this.createComponent)return null;const e=this.cacheComponents||this._itemMap?.get(t)?.preventDisconnect;if(!e||!this.components.has(t)){const i=await this.createComponent(t);if(i.dataset.preventDisconnect=this._itemMap?.get(t)?.preventDisconnect?"1":"0",!e)return i;this.components.set(t,i)}return this.components.get(t)}async loadComponent(t){if(null!=t){this.currentComponent=await this.getComponent(t);for(const t of this.container.children)"1"===t.dataset?.preventDisconnect?kt(t):t.remove();this.currentComponent&&(this.currentComponent.parentElement!==this.container&&wt(this.container,this.currentComponent),xt(this.currentComponent)),this._firstLoad&&(this._firstLoad=!1,this.dispatchEvent(new Event("load")))}else St(this.container),this.currentComponent=null;this._firstLoad&&(this._firstLoad=!1,this.layout())}refresh(){const t=this.tabs?.selectedItem?.id;this._selectedIndex=this.tabs?.selectedIndex??-1,null!=t&&this.loadComponent(this.tabs.selectedItem?.id)}open(t,e=!0){const i=this.tabs.getIndexById(t.id);i>-1?i==this.tabs.selectedIndex&&this.component||this.tabs.selectTab(i,e):(this.tabs.addTab(t),this.tabs.selectTabById(t.id,e)),xt(this.tabs,"flex")}willUpdate(t){this.topLevelComponent||(this.topLevelComponent=this),this.selectedIndex=this.items?.length>0?Math.max(0,Math.min(this.selectedIndex??-1,this.items.length-1)):-1,t.has("items")&&(this._firstLoad=!0,this._itemMap=new Map(this.items.map((t=>[t.id,t]))))}firstUpdated(){this.selectedIndex>-1&&this.open(this.items[this.selectedIndex])}positionOverlay(t){if(Zp.dropPosition=t,this.tabs.hideOverlay(),null==t)return this.tabs.positionOverlay(this.tabs.empty),kt(this.overlay);xt(this.overlay),Ht(this.overlay,{t:("bottom"==t?this.container.clientHeight/2:0)+this.container.offsetTop,l:"right"==t?this.container.clientWidth/2:0,b:"top"==t?this.container.clientHeight/2:0,r:"left"==t?this.container.clientWidth/2:0})}calculateOverlayPosition(t,e){const[i,o]=[this.container.clientWidth,this.container.clientHeight],r=.3;if(t>i*r&&t<i-i*r&&e>o*r&&e<o-o*r)return null;const[n,s]=[i/o>t/e,i/o>t/(o-e)];return n?s?"left":"bottom":s?"top":"right"}};Yp=new WeakMap,Qp.styles=[qp],Xp([Ts({type:Boolean,noAccessor:!0})],Qp.prototype,"inactive",null),Xp([Ts({type:Object})],Qp.prototype,"topLevelComponent",void 0),Xp([Ts({type:Array})],Qp.prototype,"items",void 0),Xp([Ts({type:Boolean})],Qp.prototype,"closable",void 0),Xp([Ts({type:Object})],Qp.prototype,"createComponent",void 0),Xp([Ds("og-tabs")],Qp.prototype,"tabs",void 0),Xp([Ts({type:Array})],Qp.prototype,"actions",void 0),Xp([Ts({type:Boolean})],Qp.prototype,"addButton",void 0),Xp([Ts({type:Boolean})],Qp.prototype,"scrollableTabs",void 0),Xp([Ts({type:Boolean})],Qp.prototype,"draggableTabs",void 0),Xp([Ts({type:String})],Qp.prototype,"tabSize",void 0),Xp([Ts({type:Number,reflect:!0,noAccessor:!0})],Qp.prototype,"selectedIndex",null),Xp([Ts({type:String,reflect:!0})],Qp.prototype,"tabPosition",void 0),Xp([Ts({type:Boolean})],Qp.prototype,"cacheComponents",void 0),Xp([Ds("#container")],Qp.prototype,"container",void 0),Xp([Ds("#overlay")],Qp.prototype,"overlay",void 0),Qp=Zp=Xp([Ls("og-tabcontainer")],Qp);var Kp,Jp=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let tg=Kp=class extends zs{constructor(){super(...arguments),this.addButton=!1,this.closable=!1,this.singleActive=!1,this.tabPosition="top",this.scrollableTabs=!1,this.tabContainers=new Set,this.loadState=0,this._createTabContainer=t=>{const e=yt("og-tabcontainer");e.draggableTabs=!0,e.inactive=this.singleActive,e.index=t,e.parentContainer=this,e.tabPosition=this.tabPosition,this.model.items=this.model.items??[],e.closable=this.closable,e.addButton=this.addButton,e.scrollableTabs=this.scrollableTabs,e.style.height="100%";const i=this.model.items[t];return e.items=i?.tabs??[],e.selectedIndex=i.selectedIndex,e.topLevelComponent=this.topLevelComponent,e.addEventListener("tab.remove",(()=>{0==e.tabs.items.length&&(this.model.items.length>1&&this.model.items.splice(t,1),this.model.items.forEach((t=>t.size=null)),this.requestUpdate()),this.removeEmptyContainers()})),e.addEventListener("tab.move",(()=>{this.removeEmptyContainers()})),e.addEventListener("tab.select",(t=>{t.tabs.topLevelComponent==this.topLevelComponent&&i&&(i.selectedIndex=t.tabs.selectedIndex,this.singleActive&&(this._activeTabContainer=e,this._activeTab=t.tab,this.updateActiveTab()))})),e.createComponent=this.createComponent,e},this._createSplitContainer=t=>{const e=yt("og-tabsplitcontainer");return e.style.height="100%",e.addButton=this.addButton,e.scrollableTabs=this.scrollableTabs,e.tabPosition=this.tabPosition,e.model=this.model.items[t].container,e.createComponent=this.createComponent,e.topLevelComponent=this.topLevelComponent,e.closable=this.closable,e.singleActive=this.singleActive,e},this._createSplitContainerComponent=t=>new Promise(((e,i)=>{const o=t,r=this.model.items?this.model.items[o]:null;if(r){const t=r.container?this._createSplitContainer(o):this._createTabContainer(o);t.addEventListener("load",(()=>{this.loadState++,this.loadState==this.splitContainer.items.length&&this.dispatchEvent(new Event("load"))})),this.tabContainers.add(t),e(t)}else i()})),this._onDrop=async t=>{if(!Qp.dragParent&&!Gp.dragParent)return;if(Qp.dragParent.topLevelComponent!=this.topLevelComponent&&Gp.dragParent.topLevelComponent!=this.topLevelComponent)return;t.stopImmediatePropagation();const e=Qp.dragParent,i=Qp.dropTarget;if(Qp.dragParent=null,Qp.dropTarget=null,!e||!i)return e&&0==e.parentContainer.model.items[e.index].tabs.length&&e.parentContainer.model.items.splice(e.index,1),void e.parentContainer.splitContainer.requestUpdate();const o=await e.tabs.removeTab(Gp.dragIndex,!1),r=Qp.dropPosition?["left","right"].includes(Qp.dropPosition)?"horizontal":"vertical":null,n=i?.parentContainer;if(n){if(null==r)n.model.items[i.index].tabs.push(o);else if(r==n.model.orientation)n.model.items.splice(i.index+(["right","bottom"].includes(Qp.dropPosition)?1:0),0,{tabs:[o]});else{const t=n.model.items[i.index];t.container=new Pp({orientation:r,items:[{tabs:t.tabs},{tabs:[o]}]})}n.splitContainer.resetContainerSizes(),n.splitContainer.items=n.model.items}const s=e?.parentContainer;if(s){for(let t=s.model.items.length-1;t>=0;t--){const e=s.model.items[t];e.tabs&&0!=e.tabs.length||e.container||s.model.items.splice(t,1)}s.splitContainer.resetContainerSizes(),s.splitContainer.requestUpdate()}},this.render=()=>this.model?as`
|
|
2526
2528
|
<og-splitcontainer
|
|
2527
2529
|
orientation=${this.model?.orientation}
|
|
2528
2530
|
.items="${this.model.items??[]}"
|
|
@@ -4377,7 +4379,7 @@
|
|
|
4377
4379
|
</style>
|
|
4378
4380
|
|
|
4379
4381
|
${this.table}
|
|
4380
|
-
`,this.clearHeaderCache=()=>{this.resetFreezeLeft(),this.hCache=new Tx(this.model.columns.length,this.columnHeaderCount),this.hCache.disabled=!this.model.options.cellCache},this.clearBodyCache=()=>{this.bCache=new Tx(this.model.columns.length,this.model.rows.length),this.bCache.disabled=!this.model.options.cellCache},this.cellRenderSchedules=new WeakMap}get thead(){return this._thead?this._thead:this._thead=yt("thead")}get tbody(){return this._tbody?this._tbody:this._tbody=yt("tbody")}get colgroup(){return this._colgroup?this._colgroup:this._colgroup=yt("colgroup")}get table(){return this._table||(this._table=yt("table"),this._table.appendChild(this.colgroup),this._table.appendChild(this.thead),this._table.appendChild(this.tbody)),this._table}get colMap(){return this._colMap}get rowMap(){return this._rowMap}get freezeLeft(){if(null==this._freezeLeft){const t=this.model.options.freezeLeft;if(t>=this.model.columns.length)this._freezeLeft=0;else if(this.offsetWidth>0){let e=0;for(let i=0;i<t;i++)e+=this.model.columns[i].width;this._freezeLeft=e<this.offsetWidth/2?t:0}else this._freezeLeft=t}return this._freezeLeft}get freezeTop(){return null==this._freezeTop&&(this._freezeTop=this.model.options.freezeTop),this._freezeTop}previewZoom(t){Jt(this.table,t)}highlightColHeaderCells(t){if(!this.model.options.colLetters)return;this._highlightedColHeaderCells.forEach((t=>t.className="hlabel")),this._highlightedColHeaderCells=[];const e=this.rowHeaderCount;t.forEach((t=>{const i=this.hRows[this.model.hasColumnTreeEnabled?1:0].children[this.colMap.get(t)+e];i&&(this._highlightedColHeaderCells.push(i),i.className="hlabel selected")}))}highlightRowHeaderCells(t){this.model.options.rowNumbers&&0!=this.model.rows.length&&(this._highlightedRowHeaderCells.forEach((t=>t.className="vlabel")),this._highlightedRowHeaderCells=[],t.forEach((t=>{const e=this.getRowByModelIndex(t)?.children[this.model.hasRowTreeEnabled?1:0];e&&(this._highlightedRowHeaderCells.push(e),e.className="vlabel selected")})))}get columnHeaderCount(){return this.model.headerCount+(this.model.hasColumnTreeEnabled?1:0)+(this.model.hasFilter?1:0)+(this.model.options.colLetters?1:0)}get rowHeaderCount(){return(this.model.hasRowTreeEnabled?1:0)+(this.model.options.rowNumbers?1:0)}get renderRowCount(){return this.renderAll?this.model.visibleRows.length:Math.round(Math.min(this.clientHeight/Rx.MIN_ROW_HEIGHT,this.model.rows.length))}get renderColCount(){return this.renderAll?this.model.visibleColumns.length+this.rowHeaderCount:Math.round(Math.min(this.clientWidth/Rx.MIN_COL_WIDTH||5,this.model.columns.length+this.rowHeaderCount))}get totalHeaderHeight(){let t=0,e=0;this.model.hasColumnTreeEnabled&&(t+=this.treeHeaderHeight,++e),this.model.options.colLetters&&(t+=this.thead.children[e].offsetHeight||this.model.options.rowHeight,++e);for(let i=0;i<this.model.headerCount;i++)t+=this.thead.children[e+i].offsetHeight||this.model.options.rowHeight;return this.model.hasFilter&&(t+=this.model.options.rowHeight),t}get treeHeaderWidth(){return this.model.hasRowTreeEnabled?15*this.model.maxRowLevel+20:0}get treeHeaderHeight(){return this.model.hasColumnTree?15*this.model.maxColumnLevel+20:0}get totalHeaderWidth(){let t=0;return this.model.options.rowNumbers&&(t+=Rx.ROW_HEADER_WIDTH),t+=this.treeHeaderWidth,t}get viewportSize(){return this._viewportSize||(this._viewportSize=this.renderAll?{w:1/0,h:1/0}:{w:(this.clientWidth-this.totalHeaderWidth-Rx.SLIDER_SIZE)/this.zoom,h:(this.clientHeight-this.totalHeaderHeight-Rx.SLIDER_SIZE)/this.zoom}),this._viewportSize}get viewport(){return this._viewport||(this._viewport=this.model.getViewport({c:this.colOffset,r:this.rowOffset},this.viewportSize,{t:this.model.options.freezeTop,l:this.freezeLeft,b:this.model.options.freezeBottom,r:this.model.options.freezeRight})),this._viewport}get viewportRange(){return 0==this.viewport.columns.length||0==this.viewport.rows.length?null:new _v(this.viewport.columns[0].index,this.viewport.rows[0].index,this.viewport.columns[this.viewport.columns.length-1].index,this.viewport.rows[this.viewport.rows.length-1].index)}findColumnIndexByOffset(t){let e=0;const i=this.colgroup.children;for(let o=0;o<i.length;o++)if(e+=i[o].offsetWidth,e>=t)return o;return-1}findRowByOffset(t){const e=(t>this.thead.offsetHeight?this.tbody:this.thead).children;t>this.thead.offsetHeight&&(t-=this.thead.offsetHeight);let i=0;for(let o=0;o<e.length;o++){const r=e[o];if(i+=r.offsetHeight,i>=t)return r}return null}findTableCellByOffset(t,e){t/=this.zoom,e/=this.zoom;const i=this.findRowByOffset(e),o=this.findColumnIndexByOffset(t),r=i&&o>-1?i.children[o]:null;return r&&!Ct(r)?r:null}findNearestTableCellByOffset(t,e){let i,o;t/=this.zoom,e/=this.zoom;const r=this.findRowByOffset(e),n=this.findColumnIndexByOffset(t);i=e<0?this.tbody.children[0]:e>this.tbody.offsetHeight+this.thead.offsetHeight?this.tbody.children[this.viewport.rows.length-1]:r,o=t<0?this.rowHeaderCount:t>=this.tbody.offsetWidth?this.viewport.columns.length+this.rowHeaderCount-1:n;let s=i&&o>-1?i.children[o]:null;for(;s&&Ct(s);)s=s.previousElementSibling;const a=r&&n>-1?r.children[n]:null;return[s,a&&!Ct(a)?a:null]}connectedCallback(){super.connectedCallback(),this.grid=Et(this,"og-grid")}willUpdate(){this._viewport=null,this._viewportSize=null,this.model&&(this.clearHeaderCache(),this.clearBodyCache())}updated(){this.model&&(this.createColumns(),this.createHeaderRows(),this.createBodyRows(),this.renderCells())}refresh(){this.clearHeaderCache(),this.clearBodyCache(),this.requestUpdate()}createColumns(){this._freezeLeft=null;const t=this.renderColCount;if(!this.cols||this.cols.length!=t){this.cols=new Array(t);for(let e=0;e<t;e++)this.cols[e]=yt("col"),this.cols.forEach((()=>this.colgroup.appendChild(this.cols[e])))}}createHeaderRows(){const t=this.columnHeaderCount,e=this.renderColCount;if(St(this.thead),!this.hRows||this.hRows.length!=t||!this.hRows[0]||this.hRows[0].children.length!=e){this.hRows=new Array(t);for(let i=0;i<t;i++){this.hRows[i]=yt("tr");for(let t=0;t<e;t++)this.hRows[i].appendChild(yt("th"))}}St(this.thead),this.hRows.forEach((t=>this.thead.appendChild(t)))}createBodyRows(){const t=this.renderRowCount,e=this.renderColCount,i=this.rowHeaderCount;if(!this.bRows||0==this.bRows.length||this.bRows.length!=t||this.bRows[0].children.length!=e)if(0==t&&this.grid.options.emptyPlaceholder)this.bRows=[yt("tr")],this.bRows[0].appendChild(yt("td"));else{this.bRows=new Array(t);for(let o=0;o<t;o++){this.bRows[o]=yt("tr");for(let t=0;t<i;t++)this.bRows[o].appendChild(yt("th"));for(let t=i;t<e;t++)this.bRows[o].appendChild(yt("td"))}}St(this.tbody),this.bRows.forEach((t=>this.tbody.appendChild(t)))}renderCells(t={vertical:!0,horizontal:!0}){this.table&&(t.vertical||t.horizontal)&&(this._viewport=null,t.horizontal&&this.renderHeader(),this.model.rows.length>0?(this.renderBody(),t.vertical&&this.renderRowTree()):this.model.options.emptyPlaceholder&&(this.renderEmptyBody(),this.table.appendChild(this.tbody)),this.dispatchEvent(new Wx("rendercells")))}renderEmptyBody(){const t=this.bRows[0].children[0];t.innerHTML="no data",t.className="empty-placeholder",t.colSpan=this.viewport.columns.length+this.rowHeaderCount}renderHeader(){let t;this.colMap.clear();const e=this.rowHeaderCount,i=this.viewport;this.model.hasRowTreeEnabled&&Nt(this.colgroup.children[0],{w:this.treeHeaderWidth},!0),this.model.options.rowNumbers&&Nt(this.colgroup.children[e-1],{w:Rx.ROW_HEADER_WIDTH},!0);for(let o=0;o<i.columns.length;o++)t=i.columns[o],this.model.autofitColumns.has(t.index)&&(this.grid.rendering.autofitColumn(t.index,!1,!1),this.model.autofitColumns.delete(t.index)),this.colMap.set(t.index,o),Nt(this.colgroup.children[o+e],{w:t.width}),jt(this.colgroup.children[o+e],{w:t.width}),Pt(this.colgroup.children[o+e],{w:t.width});let o=0;this.model.hasColumnTreeEnabled&&(this.renderHeaderRowTree(this.hRows[o],o),++o),this.model.options.colLetters&&(Nt(this.hRows[o],{h:this.model.options.rowHeight}),this.renderHeaderRowLetters(this.hRows[o],o),++o);for(let t=0;t<this.model.headerCount;t++)this.renderHeaderRowLabels(this.hRows[o+t],o+t,t);o+=this.model.headerCount,this.model.hasFilter&&(Nt(this.hRows[o],{h:this.model.options.rowHeight}),this.renderHeaderRowFilters(this.hRows[o],o))}renderHeaderRowLetters(t,e){let i,o;const r=this.viewport,n=e-this.columnHeaderCount;let s=0;if(Nt(t,{h:this.model.options.rowHeight}),(this.model.hasRowTree||this.model.options.rowNumbers)&&!this.model.hasColumnTreeEnabled){i=t.children[s],i.colSpan=this.rowHeaderCount,i.rowSpan=this.columnHeaderCount;const e=s-this.rowHeaderCount,o=this.model.options.levelButtonCell;(!o||n==o.r&&e==o.c)&&this.renderHeaderRowCornerCell(i),s++}for(let e=s;e<this.rowHeaderCount;e++)_t(t.children[e]),s++;for(let e=s;e<t.children.length;e++)o=e-s,i=t.children[e],i.className="hlabel",r.columns.length>o?(i.innerHTML=r.columns[o].address,i.c=r.columns[o].index,Mt(i)):_t(i)}renderHeaderRowTree(t,e){if(!this.model.hasColumnTreeEnabled)return;let i,o,r=0;const n=e-this.columnHeaderCount,s=this.viewport,a=this.model.options.rowNumbers,l=this.model.hasRowTreeEnabled;if(Nt(t,{h:this.treeHeaderHeight}),i=t.children[r],!i)return;i.rowSpan=a||l?this.columnHeaderCount:1,i.colSpan=this.rowHeaderCount;const c=r-this.rowHeaderCount,h=this.model.options.levelButtonCell;let d=null;(!h&&(a||l)||h&&n==h.r&&c==h.c)&&(d=c,this.renderHeaderRowCornerCell(i)),(a||l)&&++r;for(let n=r;n<t.children.length;n++)o=n-r,i=t.children[n],s.columns.length>o?(d!=n&&(i.innerHTML="",i.className="htree",this.renderHeaderRowTreeCell(t,e,s.columns[o],i)),Mt(i)):_t(i)}renderHeaderRowTreeCell(t,e,i,o){let r=this.hCache.get(i.index,e);if(!r){r=yt("div"),this.hCache.set(i.index,e,r);const t=i.width+1,o=this.treeHeaderHeight/this.model.maxColumnLevel;if(i.hasChildren){const e=new Vu;e.addEventListener("toggle",(()=>this.grid.rendering.toggleColumn(i.index))),r.expander=e,r.appendChild(e),Ht(e,{l:t/2-Rx.EXPANDER_SIZE/2,t:i.level*o+o/2-Rx.EXPANDER_SIZE/2}),r.expanderLine=this.createExpanderLine("h"),r.appendChild(r.expanderLine),Ht(r.expanderLine,{l:this.model.options.columnTree.reversed?0:t/2,t:i.level*o+o/2}),Nt(r.expanderLine,{h:o/2,w:t/2+1})}if(i.hasParent){let e=i;for(;e.hasParent;){e=e.parent;const i=this.createExpanderLine("h");r.appendChild(i),Nt(i,{h:o/2,w:t-1}),Ht(i,{l:0,t:e.level*o+o/2})}}}r.expander&&(r.expander.state=i.collapsed?"closed":"open"),o.appendChild(r)}createExpanderLine(t){const e=yt("div");return e.className=`${t}tree-line`,e}renderHeaderRowLabels(t,e,i){let o,r,n,s,a=0;const l=this.viewport,c=e-this.columnHeaderCount,h=this.model.options.levelButtonCell;let d;this.model.hasRowTreeEnabled&&(r=t.children[a],r.innerHTML="",this.model.hasColumnTreeEnabled||this.model.options.colLetters||i>0?_t(r):(r.rowSpan=this.columnHeaderCount,r.colSpan=this.rowHeaderCount,this.renderHeaderRowCornerCell(r)),++a),this.model.options.rowNumbers&&(r=t.children[a],r.innerHTML="",this.model.hasRowTreeEnabled||this.model.options.colLetters||this.model.hasColumnTreeEnabled||i>0?_t(r):(r.rowSpan=this.columnHeaderCount,r.colSpan=this.rowHeaderCount,this.renderHeaderRowCornerCell(r)),++a);for(let u=a;u<t.children.length;u++)if(s=u-a,r=t.children[u],r.className="hlabel",r.innerHTML="",l.columns.length>s)if(o=l.columns[s],n=o.header[i],n.height&&(d=Math.max(n.height,d||0)),r.colSpan=1,r.rowSpan=1,r.c=o.index,r.r=i,n?.hidden)if(s==this.freezeLeft){let t=o.prevVisible,n=0;for(;t&&t.header[i]?.hidden;)t=t.prevVisible,++n;t&&t.header[i].cs?(Mt(r),r.colSpan=t.header[i].cs-n-1,r.rowSpan=t.header[i].rs||1,this.renderHeaderRowLabelCell(r,t,e,i)):_t(r)}else _t(r);else{if(o.header&&o.header[i]){const t=o.header[i].cs||1;r.colSpan=t>1?o.calculateRealColspan(t):1,r.rowSpan=o.header[i].rs||1}Mt(r),this.renderHeaderRowLabelCell(r,o,e,i),h&&h.r==c&&h.c==o.index&&this.renderHeaderRowCornerCell(r)}else _t(r);Nt(t,{h:d??this.model.options.rowHeight})}renderHeaderRowLabelCell(t,e,i,o){let r=this.hCache.get(e.index,i);const n=e.header[o];if(r||(r=yt("div"),n?n.html?r.innerHTML=n.label??"":r.innerText=n.label??"":r.innerHTML="",n&&null!=n._style&&mC(r,bw(this.model.styles.get(n._style))),this.hCache.set(e.index,i,r)),this.model.options.columnHeaderTreeButtons&&e.hasChildren&&o==e.level){let t=r.expander;t||(t=new Vu,t.addEventListener("toggle",(()=>this.grid.rendering.toggleColumn(e.index))),r.expander=t,r.prepend(t),Ht(t,{l:4,t:4})),t.state=e.collapsed?"closed":"open"}if(e.sorting&&o==e.header.length-1&&(t.className+=" sort",r.sortingArrow||(r.sortingArrow=yt("og-sortingarrow"),r.appendChild(r.sortingArrow),Ht(r.sortingArrow,{t:2,r:5})),r.sortingArrow.sortSettings=this.model.sorting.get(e.index)),e.hasHeaderTooltip(o)){const t=yt("div");t.className="crn",r.appendChild(t),r.classList.add("tt")}t.appendChild(r)}renderHeaderRowFilters(t,e){let i,o,r=0;const n=this.viewport;this.model.hasRowTreeEnabled&&(i=t.children[r],i.innerHTML="",this.model.columnHeaderCount>1?_t(i):i.colSpan=this.model.columnHeaderCount,++r),this.model.options.rowNumbers&&(i=t.children[r],i.innerHTML="",this.model.hasRowTreeEnabled||this.model.options.colLetters||this.model.hasColumnTreeEnabled||this.model.headerCount>0?_t(i):(i.rowSpan=this.columnHeaderCount,i.colSpan=this.rowHeaderCount,this.renderHeaderRowCornerCell(i)),++r);for(let s=r;s<t.children.length;s++)if(o=s-r,i=t.children[s],n.columns.length>o){Mt(i);const r=n.columns[o];r.hasFilter?this.renderHeaderRowFilterCell(t,e,r,i):i.innerHTML=""}else _t(i)}renderHeaderRowFilterCell(t,e,i,o){o.innerHTML="",o.className="filter",o.c=i.index;let r=this.hCache.get(i.index,e);r||(r=yt("div"),r.filter=yt("og-filter-label"),r.appendChild(r.filter),this.hCache.set(i.index,e,r));const n=this.grid.filtering.filter.get(i.index)?.term;r.filter.value=Array.isArray(n)?n.map((t=>t.value??t.key)).join(", "):n,o.appendChild(r)}renderHeaderRowCornerCell(t){this.cornerDiv=yt("div");const e=Math.max((this.treeHeaderWidth||Rx.EXPANDER_SIZE+2)/(this.model.maxRowLevel+1),Rx.EXPANDER_SIZE+2);if(this.model.hasRowTree)for(let t=0;t<=this.model.maxRowLevel;t++){const i=new Uu;i.level=t,this.cornerDiv.appendChild(i),Ht(i,{l:t*e+e/2-Rx.EXPANDER_SIZE/2,b:3}),i.addEventListener("mousedown",(t=>t.stopPropagation())),i.addEventListener("toggle",(t=>{this.model.columns.filter((t=>t.levelButtons)).forEach((t=>this.bCache.deleteColumn(t.index))),this.grid.rendering.setRowExpandLevel(t.level)}))}if(this.model.hasColumnTree){const i=(this.model.hasColumnTree?this.treeHeaderHeight:t.clientHeight)/(this.model.maxColumnLevel+1),o=15*this.model.maxColumnLevel+20<=t.clientHeight;for(let t=0;t<=this.model.maxColumnLevel;t++){const r=new Uu;r.level=t,this.cornerDiv.appendChild(r),Ht(r,o?{t:t*i+i/2-Rx.EXPANDER_SIZE/2,r:3}:{r:t*e+e/2-Rx.EXPANDER_SIZE/2,b:3}),r.addEventListener("mousedown",(t=>t.stopPropagation())),r.addEventListener("toggle",(t=>{this.grid.rendering.setColumnExpandLevel(t.level)}))}}St(t),t.appendChild(this.cornerDiv)}renderBody(){let t,e,i,o,r,n,s,a,l;const c=this.freezeLeft||0,h=this.rowHeaderCount,d=this.model.merges,u=this.model.options.rowNumbers,p=this.viewport,g=this.viewportRange;if(!g)return;const m=new _v(this.colOffset+c,this.rowOffset,g.c2,g.r2);this.rowMap.clear();for(let c=0;c<this.bRows.length;c++)if(t=this.bRows[c],c<p.rows.length){i=p.rows[c],o=i.index,this.model.autofitRows.has(o)&&(this.grid.rendering.autofitRow(o,!1,!1),this.model.autofitRows.delete(o)),Nt(t,{h:i.height}),i.height<this.model.options.rowHeight&&Vt(t,i.height),this.rowMap.set(o,c),u&&(e=t.children[h-1],e.className="vlabel",e.r=o,e.c=-1,e.innerHTML=`<div>${Sv(o)}</div>`);for(let c=h;c<t.children.length;c++)if(e=t.children[c],c-h<p.columns.length){if(n=p.columns[c-h],r=n.index,e.r=o,e.c=r,s=i.cell(r),a=s.address,l=d.getMergeState(a),l==Mx.HIDDEN){const t=d.hiddenCells.get(s.address),i=m.intersect(new _v(t.c,t.r,t.c+t.cs-1,t.r+t.rs-1));if(!i||s.c!=i.c1||s.r!=i.r1){_t(e);continue}s=this.model.rows[t.r].cell(t.c),e.colSpan=i.size.columns,e.rowSpan=i.size.rows,e.c=s.c,e.r=s.r}else if(l==Mx.MERGED){const t=s.merge;e.colSpan=t.cs,e.rowSpan=t.rs}else e.colSpan=1,e.rowSpan=1;Mt(e),this.renderBodyCell(s,e)}else _t(e);t.style.display="table-row",t.className=i.filterState>1?"filtered":""}else t.style.display="none"}scheduleRenderBodyCell(t,e){this.cellRenderSchedules.has(e)&&(window.clearTimeout(this.cellRenderSchedules.get(e)),this.cellRenderSchedules.delete(e)),this.cellRenderSchedules.set(e,window.setTimeout((()=>this.renderBodyCell(t,e))))}fixCellBorders(t,e){"none"==e.bottom?.style&&(t.style.borderBottomColor="transparent"),"none"==e.top?.style&&(t.style.borderTop="transparent"),"none"==e.right?.style&&(t.style.borderRight="transparent"),"none"==e.left?.style&&(t.style.borderLeft="transparent")}renderBodyCell(t,e){const i=!e;if(e=e||this.getCellByCellModel(t)){let o=i?null:this.bCache.get(t.c,t.r);if(o||(o=yt("div"),zC(t).call(this,o,t),this.bCache.set(t.c,t.r,o)),this.renderAll){const i=t.composedStyle;i&&this.fixCellBorders(e,i)}St(e),e.appendChild(o)}else this.bCache.delete(t.c,t.r)}mergeBodyCells(t){let e;const i=new Set;for(const o of t)if(e=this.bRows[o.r].cells[o.c],e&&!i.has(e))for(let t=o.r;t<o.r+o.rs;t++)for(let r=o.c;r<o.c+o.cs;r++)e=this.bRows[t].cells[r],e&&(t==o.r&&r==o.c?(e.colSpan=o.cs,e.rowSpan=o.rs):(i.add(e),_t(e)))}renderRowTree(){if(!this.model.hasRowTreeEnabled)return;let t;const e=this.viewport,i=-this.rowHeaderCount;for(let o=0;o<this.bRows.length;o++)t=this.bRows[o].children[0],t.innerHTML="",o<e.rows.length&&(t.className="vtree",this.renderRowTreeCell(i,e.rows[o],t))}renderRowTreeCell(t,e,i){let o=this.bCache.get(t,e.index);if(!o){o=yt("div"),this.bCache.set(t,e.index,o);const r=e.height+1,n=this.treeHeaderWidth/this.model.maxRowLevel;if(e.hasChildren){const t=new Vu;t.addEventListener("toggle",(()=>this.grid.rendering.toggleRow(e.index))),i.parentElement.expander=t,o.expander=t,o.appendChild(t),Ht(t,{t:r/2-Rx.EXPANDER_SIZE/2,l:e.level*n+n/2-Rx.EXPANDER_SIZE/2});const s=this.createExpanderLine("v");o.appendChild(s),Ht(s,{t:this.model.options.rowTree.reversed?0:r/2,l:e.level*n+n/2}),Nt(s,{w:n/2,h:r/2+1})}if(e.hasParent){let t=e;for(;t.hasParent;){t=t.parent;const e=this.createExpanderLine("v");o.appendChild(e),Nt(e,{w:n/2,h:r+2}),Ht(e,{t:-1,l:t.level*n+n/2})}}}o.expander&&(o.expander.state=e.collapsed?"closed":"open"),i.appendChild(o)}};Vx.styles=[Fx],Bx([Ts({type:Object})],Vx.prototype,"model",void 0),Bx([Ts({type:Boolean,reflect:!0})],Vx.prototype,"hideOuterBorder",void 0),Bx([Ts({type:Number,hasChanged:()=>!1})],Vx.prototype,"rowOffset",void 0),Bx([Ts({type:Number,hasChanged:()=>!1})],Vx.prototype,"colOffset",void 0),Bx([Ts({type:Number,reflect:!0})],Vx.prototype,"zoom",void 0),Bx([Ts({type:Boolean,reflect:!0})],Vx.prototype,"nogrid",void 0),Bx([Ts({type:Boolean,reflect:!0})],Vx.prototype,"renderAll",void 0),Vx=Bx([Ls("og-table")],Vx);const Ux=["F5","F12"];class Gx extends Event{constructor(t){super("grid.error",{bubbles:!0,composed:!0}),this.error=t}}class qx extends Event{get selection(){return this.grid.selecting.selection}get activeCell(){return this.selection.activeCell}constructor(t,e){super(`grid.${t}`,{bubbles:!0,composed:!0}),Object.assign(this,e),this.cell&&(this.row=this.cell.row,this.column=this.cell.column)}}class Yx extends qx{constructor(t){super("edit",t)}}class Zx extends Cp{constructor(t,e,i){super(`grid.${t}`,i),this.grid=e}}class Xx extends Zx{constructor(t,e,i,o){super(t,e,o),this.column=i}}class Qx extends Zx{constructor(t,e,i,o){super(t,e,o),this.row=i}}class Kx{get model(){return this.grid.model}get selection(){return this.grid.selection}get table(){return this.grid.table}constructor(t){this.grid=t,this.clickDisabled=!1,this.editDisabled=!1,this.clicked=!1,this.startOffset={x:0,y:0},this.suspendClick=()=>this.clickDisabled=!0,this.resumeClick=(t=!1)=>{this.isSliding||(t?setTimeout((()=>this.clickDisabled=!1),100):this.clickDisabled=!1)},this._onKeyDown=t=>{switch(Ux.includes(t.key)||t.preventDefault(),t.key){case"Tab":t.preventDefault(),this.grid.selecting.shiftActiveCell(t.shiftKey?-1:1,!0);break;case"ArrowRight":this.grid.selecting.debounceMoveSelector(1,0);break;case"ArrowLeft":this.grid.selecting.debounceMoveSelector(-1,0);break;case"ArrowDown":this.grid.selecting.debounceMoveSelector(0,1);break;case"ArrowUp":this.grid.selecting.debounceMoveSelector(0,-1);break;case"PageUp":this.grid.selecting.debounceMoveSelector(0,-this.table.viewport.rows.length);break;case"PageDown":this.grid.selecting.debounceMoveSelector(0,this.table.viewport.rows.length);break;case"Home":this.grid.selecting.debounceMoveSelector(-this.selection.range.c1,t.ctrlKey?-this.selection.range.r1:0);break;case"End":this.grid.selecting.debounceMoveSelector(this.model.gridRange.c2-this.selection.range.c1,t.ctrlKey?this.model.gridRange.r2-this.selection.range.r1:0);break;case"Enter":this.grid.selecting.enter();break;case"Escape":this.grid.selecting.hideCopySelector();break;case"c":case"C":t.ctrlKey&&this.grid.editing.copySelection();break;case"v":case"V":t.ctrlKey&&this.grid.editing.paste();break;case"z":case"Z":if(!this.grid.options.undoRedo)return;t.ctrlKey&&this.grid.editing.undo();break;case"y":case"Y":if(!this.grid.options.undoRedo)return;t.ctrlKey&&this.grid.editing.redo();break;case"F2":t.preventDefault(),this.grid.editing.startEdit();break;case"Delete":t.preventDefault(),this.grid.objects.delete(),this.grid.editing.clearSelection();break;case"Backspace":t.preventDefault(),this.grid.editing.clearSelection();break;case"F1":if(!this.grid.options.commandWindow)return;t.preventDefault(),this.grid.openCommands()}1!=t.key.length||t.ctrlKey||this.grid.editing.startEdit(t.key)},this._onMouseMove=t=>{if(!this.model)return;let e=!0,i=!0;const o=this.grid.hSizer,r=this.grid.vSizer,{offsetX:n,offsetY:s}=t;let a=this.model.options.scrolling.scrollbarVisibilityTreshold;a<=0&&(a=Math.max(this.grid.clientWidth,this.grid.clientHeight)),n>this.grid.clientWidth-a?this.grid.vSlider.show():this.grid.vSlider.hide(),s>this.grid.clientHeight-a?this.grid.hSlider.show():this.grid.hSlider.hide();const[l,c]=this.table.findNearestTableCellByOffset(n,s);if(c&&"TH"==c.tagName&&(this.model.options.columnResize&&!o.resizing&&c.classList.contains("hlabel")?c.offsetWidth-t.offsetX+c.offsetLeft<Rx.RESIZE_TRESHOLD?(o.snap(c,this.grid),this.grid.rendering.currentResizedColumn=this.model.columns[c.c]):kt(o):this.model.options.rowResize&&!r.resizing&&c.classList.contains("vlabel")&&(c.offsetHeight-t.offsetY+c.offsetTop<Rx.RESIZE_TRESHOLD?(r.snap(c,this.grid),this.grid.rendering.currentResizedRow=this.model.rows[c.r]):kt(r)),null!=c.c)){const t=this.model.columns[c.c];t?.hasHeaderTooltip(c.r)&&(e=!1,this.grid.tooltip.attachToCell(c,t.header[c.r],"bottom"))}if(l&&"TH"==l.tagName)this.grid.selecting.isSelecting&&(this.suspendClick(),this.grid.selecting.updateSelecting(l.c,l.r)),i=!1;else if(l&&"TD"==l.tagName)if(this.grid.selecting.isSelectorOperationActive||this.grid.selecting.isFormulaSelectorOperationActive){const{top:e,left:i}=Tt(l,this.grid);this.grid.rendering.autoscroll({x:i-this.table.totalHeaderWidth+t.offsetX-l.offsetLeft,y:e-this.table.thead.clientHeight+t.offsetY-l.offsetTop}),this.grid.selecting.isSelecting&&this.suspendClick(),this.grid.selecting.updateSelecting(l.c,l.r)}else{const t=this.model.rows[l.r]?.cell(l.c);t&&t.hasTooltip&&(e=!1,this.grid.tooltip.attachToCell(l,t)),t&&t.hasComment&&(e=!1,this.grid.comment.attachedTo!==l&&this.grid.comment.attachTo(l,t))}e&&(this.grid.tooltip.deatach(),this.grid.comment.deatach(this.model.options.comments.hideTimeout)),i&&(kt(o),kt(r))},this._onMouseDown=t=>{if(1&t.buttons){this.grid.setPointerCapture(t.pointerId),this.startOffset={x:t.offsetX,y:t.offsetY};for(const e of t.composedPath()){if("TD"==e.tagName){const t=e;this.grid.selecting.startCellSelecting(new _v(t.c,t.r));break}if("TH"==e.tagName){const t=e;e.matches(".sort")?this.grid.sorting.sort(t.c):t.classList.contains("filter")?this.grid.filtering.openFilter(this.model.columns[t.c],t):t.classList.contains("hlabel")?this.grid.selecting.startColumnSelecting(t.c):t.classList.contains("vlabel")&&this.grid.selecting.startRowSelecting(t.r);break}}}},this._onMouseUp=t=>{if(0!=t.buttons)return;const e=Math.abs(this.startOffset.x-t.offsetX),i=Math.abs(this.startOffset.y-t.offsetY);Math.sqrt(Math.pow(e,2)+Math.pow(i,2))<this.model.options.events.click.mouseMoveTreshold&&this.resumeClick(),this.grid.releasePointerCapture(t.pointerId),this.grid.selecting.stopSelectOperations()},this._onClick=t=>{if(this.clickDisabled)return;if(this.grid.clientHeight-t.offsetY<this.grid.hSlider.offsetHeight)return;if(this.grid.clientWidth-t.offsetX<this.grid.vSlider.offsetWidth)return;const e=this.table.findTableCellByOffset(t.offsetX,t.offsetY),i="TD"==e?.tagName?this.model.rows[e.r]?.cell(e.c):null;this.grid.dispatchEvent(new qx("click",{grid:this.grid,cell:i}))},this._onContextMenu=t=>{t.preventDefault();for(const e of t.composedPath())if("TD"==e.tagName){const i=e;this.grid.menus.openCellMenu(this.model.rows[i.r].cell(i.c),{x:t.pageX,y:t.pageY})}else if("TH"==e.tagName){const i=e;i.classList.contains("hlabel")?this.grid.menus.openColumnMenu(this.model.columns[i.c],{x:t.pageX,y:t.pageY}):i.classList.contains("vlabel")&&this.grid.menus.openRowMenu(this.model.rows[i.r],{x:t.pageX,y:t.pageY})}},this._onVerticalSlide=t=>{this.table.rowOffset=Math.min(t.value,this.model.visibleRows.length-1),this.grid.rendering.requireVerticalUpdate=!0,this.grid.rendering.renderCells()},this._onHorizontalSlide=t=>{this.table.colOffset=Math.min(t.value,this.model.visibleColumns.length-1),this.grid.rendering.requireHorizontalUpdate=!0,this.grid.rendering.renderCells()},this._onSlideStart=()=>{this.suspendClick()},this._onSlideStop=()=>{this.resumeClick(!0)},this._denbounceHorizontalScroll=q((t=>this.grid.rendering.scrollHorizontalByPixels(t)),50),this._onWheel=t=>{t.ctrlKey||(0!=t.deltaY&&this.grid.rendering.scrollVerticalByPixels(t.deltaY),0!=t.deltaX&&this._denbounceHorizontalScroll(Math.sign(t.deltaX)*Math.min(100,Math.abs(t.deltaX))))},this._onTouchStart=t=>{this.grid.rendering.touchStartX=t.touches[0],this.grid.rendering.touchStartY=t.touches[0]},this._onTouchEnd=t=>{this.grid.rendering.touchStartX=t.touches[0],this.grid.rendering.touchStartY=t.touches[0]},this._onTouchMove=t=>{const e=this.grid.rendering;if(e.touchStartY){const i=e.touchStartY.clientY-t.touches[0].clientY;Math.abs(i)>this.model.options.rowHeight&&this.table.viewport.rows.length>0&&(e.scrollVerticalByPixels(i),e.touchStartY=t.touches[0])}if(e.touchStartX){const i=e.touchStartX.clientX-t.touches[0].clientX;Math.abs(i)>this.model.options.columnWidth&&this.table.viewport.columns.length>0&&(e.scrollHorizontalByPixels(i),e.touchStartX=t.touches[0])}},this._onHorizontalResizeStart=()=>{this.grid.rendering.resizing=!0,this.grid.rendering.currentResizedColumnWidth=this.grid.rendering.currentResizedColumn.width},this._onHorizontalResizeStop=t=>{this.suspendClick(),this.grid.rendering.resizing=!1,this.table.clearHeaderCache(),this.table.renderCells({horizontal:!0}),this.grid.dispatchEvent(new Xx("column.resize",this.grid,this.grid.rendering.currentResizedColumn,t))},this._onHorizontalResize=t=>{const e=this.grid.rendering;e.currentResizedColumn.width=e.currentResizedColumnWidth+t.deltaX,Nt(this.table.getColumnByModelIndex(e.currentResizedColumn.index),{w:e.currentResizedColumn.width},!0),this.grid.selecting.updateSelector()},this._onVerticalResizeStart=()=>{this.grid.rendering.resizing=!0,this.grid.rendering.currentResizedRowHeight=this.grid.rendering.currentResizedRow.height},this._onVerticalResizeStop=t=>{this.suspendClick(),this.grid.rendering.resizing=!1,this.table.clearBodyCache(),this.table.renderCells({vertical:!0}),this.grid.dispatchEvent(new Qx("row.resize",this.grid,this.grid.rendering.currentResizedRow,t))},this._onVerticalResize=t=>{const e=this.grid.rendering;e.currentResizedRow.height=e.currentResizedRowHeight+t.deltaY,Nt(this.table.getRowByModelIndex(e.currentResizedRow.index),{h:e.currentResizedRow.height},!1),this.grid.selecting.updateSelector()},this._onCommentCommit=t=>{this.grid.model.comments.set(t.cell.address,t.items),t.cell.invalidateStyle(),this.grid.rendering.updateCells([t.cell])},this._onAutofill=t=>{if(this.suspendClick(),this.grid.selection.range.equals(t.selector.autofillRange))return;const{cells:e,oldValues:i}=nw(this.model,this.grid.selection.range,t.selector.autofillRange,t.selector.autofillDirection);this.grid.rendering.updateCells(e,!0),this.grid.selection.setRange(this.grid.selection.range.unite(t.selector.autofillRange)),this.grid.selecting.updateSelector(),this.grid.dispatchEvent(new Yx({grid:this.grid,editType:"autofill",cells:e,oldValues:i,newValues:e.map((t=>t.value2))}))},this._onEdit=t=>{if(t.fromHistory)return;const e=[],i=[],o=this.model.names.rangeMap;let r=[],n=[],s=[],a=[];switch(t.editType){case"value":r=t.newValues,n=t.newProps,s=t.oldValues,a=t.oldProps,t.cells.forEach((t=>{const r=t.address;e.push(r),i.push(o.get(r))}));break;case"insert_column":case"insert_row":t.newValues.forEach((t=>{const n=t.address;e.push(n),i.push(o.get(n)),r.push(t.getSourceData())}))}this.grid.history.push({type:t.editType,addresses:e,names:i,oldValues:s,oldProps:a,newValues:r,newProps:n})},this._onSelectorMove=t=>{this.suspendClick(),this.selection.setRange(t.toRange),t.fromRange.isRow?this.grid.editing.moveRows({index:t.fromRange.r1,count:t.fromRange.size.rows,targetIndex:t.toRange.r1}):t.fromRange.isColumn?this.grid.editing.moveColumns({index:t.fromRange.c1,count:t.fromRange.size.columns,targetIndex:t.toRange.c1}):console.log(t)},this._onMouseLeave=()=>{this.grid.rendering.hideSliders()},this.debounceHideSliders=q((()=>this.grid.rendering.hideSliders()),1e3,{isImmediate:!1}),this._onRender=()=>{const t=this.grid;t.selecting.updateSelectors(),t.dispatchEvent(new qx("render",{grid:this.grid})),t.adapter&&t.options.pageSize&&t.rendering.isLastRowInViewport()&&t.rendering.loadNextPage(),t.rendering.updateSliderVisibility(),this.model.options.scrolling.scrollbarVisibilityTreshold>0&&this.debounceHideSliders()},this._onHorizontalSizerDblClick=t=>{t.stopPropagation(),this.editDisabled=!0,this.grid.rendering.autofitColumn(this.grid.rendering.currentResizedColumn.index),this.grid.dispatchEvent(new Xx("column.resize",this.grid,this.grid.rendering.currentResizedColumn,t))},this._onVerticalSizerDblClick=t=>{t.stopPropagation(),this.editDisabled=!0,this.grid.rendering.autofitRow(this.grid.rendering.currentResizedRow.index),this.grid.dispatchEvent(new Qx("row.resize",this.grid,this.grid.rendering.currentResizedRow,t))},this._onDblClick=()=>{this.editDisabled?this.editDisabled=!1:this.grid.editing.startEdit()}}get isSliding(){return this.grid.hSlider.sliding||this.grid.vSlider.sliding}async init(){await this.grid.updateComplete,await this.table.updateComplete;const t=this.grid;t.addEventListener("wheel",this._onWheel,{passive:!0}),t.addEventListener("touchstart",this._onTouchStart,{passive:!0}),t.addEventListener("touchend",this._onTouchEnd,{passive:!0}),t.addEventListener("touchmove",this._onTouchMove,{passive:!0}),t.hSizer.addEventListener("resizestart",this._onHorizontalResizeStart),t.hSizer.addEventListener("resizestop",this._onHorizontalResizeStop),t.hSizer.addEventListener("resize",this._onHorizontalResize),t.hSizer.addEventListener("dblclick",this._onHorizontalSizerDblClick),t.vSizer.addEventListener("resizestart",this._onVerticalResizeStart),t.vSizer.addEventListener("resizestop",this._onVerticalResizeStop),t.vSizer.addEventListener("resize",this._onVerticalResize),t.vSizer.addEventListener("dblclick",this._onVerticalSizerDblClick),t.comment.addEventListener("comment.commit",this._onCommentCommit),t.addEventListener("keydown",this._onKeyDown),t.addEventListener("click",this._onClick),t.addEventListener("contextmenu",this._onContextMenu),t.addEventListener("toggle",(()=>t.rendering.debounceCalculateViewport())),t.addEventListener("pointerup",this._onMouseUp),t.addEventListener("pointerdown",this._onMouseDown);const e=q(this._onMouseMove,20,{maxWait:50,isImmediate:!0});t.addEventListener("pointermove",e),t.addEventListener("mouseleave",this._onMouseLeave),t.table.addEventListener("rendercells",this._onRender),t.selector.addEventListener("grid.selector.autofill",this._onAutofill),t.selector.addEventListener("grid.selector.move",this._onSelectorMove),t.addEventListener("dblclick",this._onDblClick),t.addEventListener("grid.edit",this._onEdit)}}class Jx{get vScrolling(){return this._vScrolling}get hScrolling(){return this._hScrolling}get model(){return this.grid.model}get selection(){return this.grid.selection}get table(){return this.grid.table}constructor(t){this.grid=t,this.requireVerticalUpdate=!0,this.requireHorizontalUpdate=!1,this.resizing=!1,this._vScrolling=!0,this._hScrolling=!0,this.debounceRenderCells=q(this.renderCells,50,{isImmediate:!1,maxWait:100}),this.debounceCalculateViewport=q(this.calculateViewport,200)}isLastRowInViewport(){const t=this.grid.table.viewport.rows,e=this.model.visibleRows;return t[t.length-1]==e[e.length-1]}renderCells(t){t=t||{vertical:this.requireVerticalUpdate,horizontal:this.requireHorizontalUpdate},this.grid.comment.deatach(),this.grid.table.renderCells(t),this.requireHorizontalUpdate=!1,this.requireVerticalUpdate=!1,this.debounceCalculateViewport(),this.grid.objects.updatePostions()}renderAll(t=!1){this.grid.group?this.grid.group.grids.forEach((e=>e.rendering.render(t))):this.render(t)}async render(t=!1){this.grid.table&&this.model&&(this.grid.table.clearHeaderCache(),this.grid.table.clearBodyCache(),this.grid.table.isConnected&&(t&&(this.grid.table.requestUpdate(),await this.grid.table.updateComplete),this.grid.table.renderCells({horizontal:!0,vertical:!0}),this.calculateViewport()))}updateRange(t,e=!1){for(const i of this.model.getRangeIterator(t))this.updateCells([i],e)}updateCell(t,e=!1){this.updateCells([t],e)}updateSpilledCells(t){let e;t.prevSpillRange&&(e=new Set,this.model.getRangeIterator(t.prevSpillRange).forEach((t=>e.add(t)))),t.spillRange&&(e=e||new Set,this.model.getRangeIterator(t.spillRange).forEach((t=>e.add(t)))),e?.size>0&&this.updateCells(e)}updateCells(t,e=!1){if(e)for(const e of t)e.invalidateStyle(),e.invalidateValue(),this.model.calculations.clearDependecies(e).evaluate(e),this.updateSpilledCells(e);const i=this.grid.table;for(const e of t)i.renderBodyCell(e);e&&(this.model.calculations.invalidateDependants(t).forEach(((t,e)=>{t?this.grid.group.getGrid(t)?.table.renderBodyCell(e):i.renderBodyCell(e),this.updateSpilledCells(e)})),this.grid.dispatchGridEvent("calculate",{cells:Array.from(t)}))}updateHeaders(){this.model.indexVisibleColumns(),this.table.clearHeaderCache(),this.table.createHeaderRows(),this.table.renderHeader()}calculateViewport(t=!1){this.grid.logger.info("calculate viwport"),this.updateCells(this.model.calculateViewport(),t)}updateSliders(){const t=this.table.viewportSize;this.grid.vSlider.maxValue=this.model.visibleRows.length,this.grid.vSlider.pageSize=t.h/this.model.options.rowHeight,this.grid.vSlider.value=this.table.rowOffset,this.grid.hSlider.maxValue=this.model.visibleColumns.length,this.grid.hSlider.pageSize=t.w/this.model.options.columnWidth,this.grid.hSlider.value=this.table.colOffset}isVerticalScrollingEnabled(){return!1!==this.grid.options.scrolling.verticalOverscroll||this.table.viewport.rows.length<this.model.visibleRows.length}isHorizontalScrollingEnabled(){return!1!==this.grid.options.scrolling.horizontalOverscroll||this.table.viewport.columns.length<this.model.visibleColumns.length}updateSliderVisibility(){this._vScrolling=this.isVerticalScrollingEnabled(),this._vScrolling?(this.grid.vSlider.show(),xt(this.grid.vSlider)):(this.grid.vSlider.hide(),kt(this.grid.vSlider)),this._hScrolling=this.isHorizontalScrollingEnabled(),this._hScrolling?(this.grid.hSlider.show(),xt(this.grid.hSlider)):(this.grid.hSlider.hide(),kt(this.grid.hSlider))}hideSliders(){this.grid.vSlider.hide(),this.grid.hSlider.hide()}scrollVerticalByPixels(t){if(!this.vScrolling)return;let e,i=this.table.rowOffset,o=0,r=0;if(t>0){for(;o<t&&i+r<this.model.visibleRows.length;)o+=this.model.visibleRows[i+r++].height+2;i+=r}else if(t<0){for(t=Math.abs(t);o<t&&i+r>=0;)e=this.model.visibleRows[Math.min(this.model.visibleRows.length-1,i+r--)],o+=(e?e.height:0)+2;i+=r}i>=this.model.visibleRows.length&&(i=this.model.visibleRows.length-1),this.requireVerticalUpdate=!0,this.table.rowOffset=Math.max(0,i),this.debounceRenderCells(),this.updateSliders()}scrollHorizontalByPixels(t){if(!this.hScrolling)return;let e=this.table.colOffset,i=0,o=0;if(t>0){for(;i<t&&e+o<this.model.visibleColumns.length;)i+=this.model.visibleColumns[e+o++].width+2;e+=o}else if(t<0){for(t=Math.abs(t);i<t&&e+o>=0;)i+=this.model.visibleColumns[Math.min(this.model.visibleColumns.length-1,e+o--)].width+2;e+=o}e>=this.model.visibleColumns.length&&(e=this.model.visibleColumns.length-1),this.requireHorizontalUpdate=!0,this.table.colOffset=Math.max(0,e),this.debounceRenderCells(),this.updateSliders()}updateCellSelectionRange(){const t=this.table;for(const e of this.model.getRangeIterator(this.selection.range,!1))t.renderBodyCell(e)}getAdapterRequestFilters(){return{offset:0,filter:this.grid.filtering?.filter?Array.from(this.grid.filtering.filter.settings.values()):null,order:this.grid.model?.sorting?.settings}}async toggleRow(t,e=!0){const i=this.model.rows[t];if(i.isLoaded||i.isPartialyLoaded)i.toggleCollapse(!1,this.model.options.unhideRowAfterExpand),this.table.renderCells({vertical:!0});else if(this.grid.adapter){const e=this.table.getRowByModelIndex(t);e&&e.expander&&(e.expander.state="waiting"),i.collapsed=!1;const o=Object.assign(this.getAdapterRequestFilters(),{parent:{r:i.index,props:i.properties}}),[r]=await Promise.all([this.grid.adapter.getRows(o)]);this.model.insertRowData(i,0,r),o.rows=r;const[n]=await Promise.all([this.grid.adapter.getCells(o)]);n?.map((t=>this.model.getCellByCoords(t.r,t.c)?.update(t))),this.table.requestUpdate()}this.updateSliders(),e&&this.grid.dispatchEvent(new qx("row.toggle",{grid:this.grid,row:i}))}toggleColumn(t,e=!0){const i=this.model.columns[t];i.toggleCollapse(!1,this.model.options.unhideColumnAfterExpand),this.table.renderCells({horizontal:!0}),this.updateSliders(),e&&this.grid.dispatchEvent(new qx("column.toggle",{grid:this.grid,column:i}))}setRowExpandLevel(t){this.model.setRowExpandLevel(t),this.table.rowOffset=0,this.table.renderCells({vertical:!0}),this.updateSliders(),this.grid.dispatchEvent(new qx("row.toggle",{grid:this.grid}))}setColumnExpandLevel(t){this.model.setColumnExpandLevel(t),this.table.colOffset=0,this.table.renderCells({horizontal:!0}),this.updateSliders(),this.grid.dispatchEvent(new qx("column.toggle",{grid:this.grid}))}async exportHTML(){const t=yt("div");kt(t),document.body.appendChild(t);const e=yt("og-table");e.grid=this.grid,e.model=this.model,e.renderAll=!0,t.appendChild(e),await e.updateComplete;const i=this.model.options?.print?.rowBreaks,o=e.table,r=i&&i.length>0;if(r){const t=o.querySelector("colgroup"),r=[...o.tBodies[0].rows],n=this.model.options?.print?.rowTitles?_v.fromA1(this.model.options?.print?.rowTitles):null,s=n?Array.from({length:n.r2-n.r1+1},((t,i)=>r[e.rowMap.get(n.r1+i)])):[];for(let o=0;o<i.length;o++){const n=yt("table");n.appendChild(t.cloneNode(!0));const a=yt("tbody");n.appendChild(a);const l=e.rowMap.get(i[o]),c=o<i.length-1?e.rowMap.get(i[o+1]):this.model.visibleRows.length-1;s.forEach((t=>a.appendChild(t.cloneNode(!0))));for(let t=l;t<=c;t++)a.appendChild(r[t]);e.shadowRoot.appendChild(n)}t.cloneNode(!0)}const n=`\n\t\t\t<style>\n\t\t\t\thtml {\n\t\t\t\t\t${Ba(Xa().themes.get("light")).cssText}\n\t\t\t\t}\n\t\t\t\t${r?"table {break-after: page}":""}\n\t\t\t\t${Vx.styles.map((t=>t.cssText)).join("\n")}\n\t\t\t</style>\n\n\t\t`,s=n+e.shadowRoot.innerHTML.replace(/<!---->/g,"");return t.remove(),s}stopAutoscroll(){this.autoscrollTimer&&window.clearInterval(this.autoscrollTimer)}startAutoscroll(){this.stopAutoscroll(),this.autoscrollTimer=window.setInterval((()=>{if(0==this.autoscrollValue)return this.stopAutoscroll();const t=Math.pow(this.autoscrollValue,rv.AUTOSCROLL_RATIO);switch(this.autoscrollDirection){case"down":this.scrollVerticalByPixels(t);break;case"up":this.scrollVerticalByPixels(-t);break;case"left":this.scrollHorizontalByPixels(-t);break;case"right":this.scrollHorizontalByPixels(t)}}),rv.AUTOSCROLL_INTERVAL)}autoscroll(t){const{x:e,y:i}=t,o=this.table.clientWidth/this.table.zoom-this.table.totalHeaderWidth,r=this.table.clientHeight/this.table.zoom-this.table.totalHeaderHeight;let n,s=0;e<rv.AUTOSCROLL_TRESHOLD&&e<i&&e<r-i?(n="left",s=rv.AUTOSCROLL_TRESHOLD-e):o-e<rv.AUTOSCROLL_TRESHOLD&&o-e<i&&o-e<r-i?(n="right",s=rv.AUTOSCROLL_TRESHOLD-o+e):i<rv.AUTOSCROLL_TRESHOLD?(n="up",s=rv.AUTOSCROLL_TRESHOLD-i):r-i<rv.AUTOSCROLL_TRESHOLD&&(n="down",s=rv.AUTOSCROLL_TRESHOLD-r+i),this.autoscrollDirection=n,this.autoscrollValue=s,this.stopAutoscroll(),s>0&&this.startAutoscroll()}async load(t){t=t||this.getAdapterRequestFilters();const e=t.parent?.r??null,i=null!=e?this.model.rows[e]:this.model.rowRoot,[o]=await Promise.all([this.grid.adapter.getRows(t)]);o.length>0&&null===e&&this.model.insertRowData(i,t.offset,o);const[r]=await Promise.all([this.grid.adapter.getCells(t)]);r?.map((t=>this.model.getCellByCoords(t.r,t.c)?.update(t))),this.table.requestUpdate(),o.length>=this.model.options.pageSize?i.count=1/0:i.count=i.children.length,this.grid.logger.info(`loaded ${o.length} rows`),this.grid.loading=!1,this.grid.dispatchEvent(new qx("afterLoad",{grid:this.grid}))}async loadNextPage(t=null,e=!1){if(this.grid.loading)return;const i=null!=t?this.model.rows[t]:this.model.rowRoot;if(!e&&i.isLoaded)return;this.grid.dispatchEvent(new qx("beforeLoad",{grid:this.grid})),this.grid.loading=!0;const o=this.model.rows.length;this.grid.logger.info(`loading rows offset = ${o}`),await this.load(Object.assign(this.getAdapterRequestFilters(),{offset:o,parent:{r:t,props:null}}))}get totalSize(){return{width:this.table.totalHeaderWidth+this.model.visibleColumns.reduce(((t,e)=>t+e.width),0),height:this.table.thead.offsetHeight+this.model.visibleRows.reduce(((t,e)=>t+e.height),0)}}autofitColumn(t,e=!1,i=!0){const o="number"==typeof t?this.model.columns[t]:t,r=this.autofitDiv??(this.autofitDiv=yt("div"));r.style.position="absolute",r.style.zIndex="100000",Ht(r,{l:-1e3,t:-1e3}),this.grid.shadowRoot.appendChild(r);let n=0;for(const t of this.model.getRangeIterator(_v.fromA1(o.address),!!e)){const e=zC(t).call(this.table,r,t)||r;e.style.width="auto",n=Math.max(n,e.offsetWidth)}if(o.header){for(const t of o.header)t&&(t.html?r.innerHTML=t.label??"":r.innerText=t.label??"",n=Math.max(n,r.offsetWidth));r.innerHTML=""}o.width=n+10,i&&this.table.renderCells({horizontal:!0})}autofitColumns(t=!1){this.model.columns.forEach((e=>this.autofitColumn(e,t,!1))),this.table.renderCells({horizontal:!0})}autofitRow(t,e=!1,i=!0){const o="number"==typeof t?this.model.rows[t]:t,r=this.autofitDiv??(this.autofitDiv=yt("div"));r.style.position="absolute",r.style.zIndex="100000",Ht(r,{l:-1e3,t:-1e3}),this.grid.shadowRoot.appendChild(r);let n=0;for(const t of this.model.getRangeIterator(_v.fromA1(o.address),!!e)){const e=zC(t).call(this.table,r,t)||r;e.style.height="auto",n=Math.max(n,e.offsetHeight)}o.height=n+8,i&&this.table.renderCells({vertical:!0})}autofitRows(t=!1){this.model.rows.forEach((e=>this.autofitRow(e,t,!1))),this.table.renderCells({vertical:!0})}scrollTo(t,e=0){let i;i=Q(t)?_v.fromA1(t):new _v(e,t),this.table.rowOffset=i.r1,this.table.colOffset=i.c1,this.requireVerticalUpdate=!0,this.requireHorizontalUpdate=!0,this.debounceRenderCells(),this.updateSliders()}}class tk{get model(){return this.grid.model}get selection(){return this.grid.editing.isFormulaMode?this.formulaSelection:this.grid.selection}get selector(){return this.grid.editing.isFormulaMode?this.grid.formulaSelector:this.grid.selector}get formulaSelection(){return this._formulaSelection}get events(){return this.grid.events}get table(){return this.grid.table}get isSelecting(){return this.isCellSelecting||this.columnSelecting||this.rowSelecting}get isCellSelecting(){return this.selector.isSelecting}get isAutofilling(){return this.selector.isAutofilling}get isMoving(){return this.selector.isMoving}get isSelectorOperationActive(){return this.selector.isSelectorOperationActive}get isFormulaSelectorOperationActive(){if(!this.grid.editing.isFormulaMode)return!1;for(const t of this.formulaSelectors.values())if(t.isSelectorOperationActive)return!0;return!1}get activeCell(){const{c:t,r:e}=this.selection.activeCellCoords;return this.model.rows[e]?.cell(t)}constructor(t){this.grid=t,this.columnSelecting=!1,this.rowSelecting=!1,this._formulaSelection=new Ix(0,0,0,0),this.formulaSelectors=new Map,this.debounceMoveSelector=q(((t,e)=>this.moveSelector(t,e)),10)}moveToSelection(){const t=new _v(this.selection.range.c1,this.selection.range.r1);this.table.viewportRange.contains(t)}select(t,e=!1){this.selection.setRange(t),this.updateSelector(),e&&this.grid.dispatchEvent(new qx("select",{grid:this.grid}))}startCellSelecting(t){this.grid.style.cursor="cell",this.startSelectingRange=t.clone(),this.select(t,!0),this.selector.startSelecting(t)}startColumnSelecting(t){this.columnSelecting=!0;const e=new _v(t,null,t,null);this.startSelectingRange=e.clone(),this.select(e,!0)}startRowSelecting(t){this.rowSelecting=!0;const e=new _v(null,t,null,t);this.startSelectingRange=e.clone(),this.select(e,!0)}updateSelecting(t,e){const i=this.model.options.selecting.multiSelect;(this.isCellSelecting||this.rowSelecting)&&(i||(this.selection.range.r1=e),this.selection.range.r2=e),(this.isCellSelecting||this.columnSelecting)&&(i||(this.selection.range.c1=t),this.selection.range.c2=t),this.grid.editing.isFormulaMode?(this.updateFormulaSelector(),this.formulaSelectors.forEach((i=>i.updateMovingOperations(t,e)))):(this.updateSelector(),this.hideFormulaSelector(),this.selector.updateMovingOperations(t,e))}stopSelecting(){this.grid.rendering.stopAutoscroll(),this.isSelecting&&!this.selection.range.equals(this.startSelectingRange)&&this.grid.dispatchEvent(new qx("select",{grid:this.grid})),this.columnSelecting=!1,this.rowSelecting=!1,this.startSelectingRange=null,this.selector.stopSelectorOperations()}highlightSelection(){const t=this.selection.range,[e,i]=[Math.min(t.c1,t.c2),Math.max(t.c1,t.c2)],[o,r]=[Math.min(t.r1,t.r2),Math.max(t.r1,t.r2)],n=i-e+1,s=r-o+1;this.table.highlightColHeaderCells(n<1/0?Array.from(new Array(n),((t,i)=>i+e)):[]),this.table.highlightRowHeaderCells(s<1/0?Array.from(new Array(s),((t,e)=>e+o)):[])}updateSelector(t=!0){this.model.options.selecting.enabled?(this.showSelector(t),this.highlightSelection()):this.hideSelector(),this.grid.editing.isFormulaMode||this.grid.editing.endEdit()}showSelector(t=!0){this.selector&&(this.selector.show(),this.selector.select(this.selection.range,t))}hideSelector(){this.selector.hide()}moveSelector(t,e){if(this.selection.move(t,e,this.model.columns.length,this.model.rows.length),0!=e&&!this.model.rows[this.selection.range.r1].visible){const t=e>0?this.model.rows[this.selection.range.r1].nextVisible:this.model.rows[this.selection.range.r1].prevVisible;t&&(this.selection.range.r1=t.index,this.selection.range.r2=t.index)}if(0!=t&&!this.model.columns[this.selection.range.c1].visible){const e=t>0?this.model.columns[this.selection.range.c1].nextVisible:this.model.columns[this.selection.range.c1].prevVisible;e&&(this.selection.range.c1=e.index,this.selection.range.c2=e.index)}this.selector.selection=this.selection.range,this.selector.updatePosition();const i={c:0,r:0};(e>0&&this.selector.offsetTop+this.selector.offsetHeight>this.grid.clientHeight||e<0&&this.selector.offsetTop<this.table.totalHeaderHeight-1||e>=this.table.viewport.rows.length)&&(i.r+=e),(t>0&&this.selector.offsetLeft+this.selector.offsetWidth>this.grid.clientWidth||t<0&&this.selector.offsetLeft<this.table.totalHeaderWidth-1)&&(i.c+=t),0==i.c&&0==i.r||(this.table.colOffset=Math.max(0,this.table.colOffset+i.c),this.table.rowOffset=Math.min(Math.max(0,this.table.rowOffset+i.r),this.model.visibleRows.length-1),this.table.renderCells({horizontal:0!=i.c,vertical:0!=i.r}),this.grid.rendering.updateSliders()),this.grid.editing.isFormulaMode||this.grid.editing.endEdit(),this.highlightSelection(),this.grid.dispatchEvent(new qx("select",{grid:this.grid}))}shiftActiveCell(t,e=!1){this.selection.moveActiveCell(t,0),this.selector.updatePosition(),e&&this.grid.dispatchEvent(new qx("select",{grid:this.grid}))}updateFormulaSelector(t=!0){this.grid.editing.isFormulaMode?this.showFormulaSelector(t):this.hideFormulaSelector()}showFormulaSelector(t=!0){this.grid.formulaSelector.show(),this.grid.formulaSelector?.select(this.formulaSelection.range,t)}hideFormulaSelector(){this.grid.formulaSelector.hide()}updateFormulaSelectors(){this.formulaSelectors.forEach((t=>t.updatePosition()))}highlightColorItem(t){const e=Ix.fromRange(_v.fromA1(t.address)),i=yt("og-selector");this.grid.shadowRoot.appendChild(i),i.addEventListener("grid.selector.move",(t=>this.select(t.selector.selection.clone()))),i.addEventListener("grid.selector.resize",(t=>this.select(t.selector.selection.clone()))),i.grid=this.grid,i.color=t.color,i.subselector=!1,i.movable=!0,i.resizable=!0,i.index=t.tokenIndex,this.formulaSelectors.set(t.tokenIndex,i),i.select(e.range.clone(),!1),i.show()}highlightFormula(t){this.removeFormulaHighlight(),this.formulaSelectors.clear();const e=new Set;t.colors.forEach((t=>{if(null==t.sheet||t.sheet==this.model.name)this.highlightColorItem(t);else if(this.grid.group){const i=this.grid.group.getGrid(t.sheet);if(!i)return;e.has(i)||(e.add(i),i.selecting.removeFormulaHighlight()),i.isConnected&&i.selecting.highlightColorItem(t)}}))}removeFormulaHighlight(){this.formulaSelectors?.forEach((t=>zt(t))),this.formulaSelectors.clear()}updateCopySelector(){this.grid.copySelector.isVisible&&this.grid.copySelector.updatePosition()}showCopySelector(){this.grid.copySelector.show(),this.grid.copySelector?.select(this.selection.range.clone(),!1)}hideCopySelector(){this.grid.copySelector.hide()}updateSelectors(){this.updateSelector(!1),this.updateCopySelector(),this.updateFormulaSelectors()}stopSelectOperations(){this.stopSelecting(),this.formulaSelectors.forEach((t=>t.stopSelectorOperations())),this.grid.style.removeProperty("cursor")}enter(){const t=this.grid.group;if(this.grid.editing.isFormulaMode&&t){const e=t.formulaModeGrid;e.editing.commitEdit(),t.activateGrid(e.model.name)}else this.debounceMoveSelector(0,1)}}class ek extends Event{}class ik extends zs{get isOpen(){return this._open}get isValid(){return this._valid}validate(){return this._valid=!0,this.activeCell&&(this._valid=aw(this.activeCellModel,this.getValue())),this.classList.toggle("invalid",!this._valid),this._valid}constructor(){super(),this.cancel=!1,this._open=!1,this._valid=!0,this.init()}getDisplayValue(){return null}init(){this.addEventListener("keydown",(t=>{"Enter"==t.key?this.close():"Escape"==t.key?(this.cancel=!0,this.close()):t.stopPropagation()}))}connectedCallback(){super.connectedCallback(),this.performUpdate()}alignWithCell(){if(!this.activeCell)return;const t=Tt(this.activeCell,this.grid);Ht(this,{t:t.top*this.grid.zoom,l:t.left*this.grid.zoom}),Nt(this,{w:this.activeCell.offsetWidth,h:this.activeCell.offsetHeight})}open(t,e=null,i=!0){this._valid=!0,this.initialValue=e,this._open=!0,this.grid=t;const o=t.selecting.activeCell;return this.activeCellModel=o,this.activeCell=this.grid.table.getCellByModelIndex(o.c,o.r),this.grid.selector.hide(),xt(this),i&&this.alignWithCell(),this.activate(o),null!==e&&this.setValue(e),Jt(this,this.grid.zoom),this}commit(){this._open&&!this.cancel&&this.activeCellModel&&(this.grid.editing.updateCell(this.activeCellModel,{v:this.getValue(),dv:this.getDisplayValue()}),this.grid.rendering.updateCell(this.activeCellModel,!0)),this.cancel=!1}close(){this._open&&(this.deactivate(),kt(this),this.grid.table.renderBodyCell(this.activeCellModel),this.grid.selecting.showSelector(),this.grid.focus(),this._open=!1,this.grid.editing.endEdit()),this.cancel=!1}activate(t){this.activeCellModel=t,this.dispatchEvent(new ek("activate"))}deactivate(){this.dispatchEvent(new ek("deactivate"))}}ik.baseStyles=kn`
|
|
4382
|
+
`,this.clearHeaderCache=()=>{this.resetFreezeLeft(),this.hCache=new Tx(this.model.columns.length,this.columnHeaderCount),this.hCache.disabled=!this.model.options.cellCache},this.clearBodyCache=()=>{this.bCache=new Tx(this.model.columns.length,this.model.rows.length),this.bCache.disabled=!this.model.options.cellCache},this.cellRenderSchedules=new WeakMap}get thead(){return this._thead?this._thead:this._thead=yt("thead")}get tbody(){return this._tbody?this._tbody:this._tbody=yt("tbody")}get colgroup(){return this._colgroup?this._colgroup:this._colgroup=yt("colgroup")}get table(){return this._table||(this._table=yt("table"),this._table.appendChild(this.colgroup),this._table.appendChild(this.thead),this._table.appendChild(this.tbody)),this._table}get colMap(){return this._colMap}get rowMap(){return this._rowMap}get freezeLeft(){if(null==this._freezeLeft){const t=this.model.options.freezeLeft;if(t>=this.model.columns.length)this._freezeLeft=0;else if(this.offsetWidth>0){let e=0;for(let i=0;i<t;i++)e+=this.model.columns[i].width;this._freezeLeft=e<this.offsetWidth/2?t:0}else this._freezeLeft=t}return this._freezeLeft}get freezeTop(){return null==this._freezeTop&&(this._freezeTop=this.model.options.freezeTop),this._freezeTop}previewZoom(t){Jt(this.table,t)}highlightColHeaderCells(t){if(!this.model.options.colLetters)return;this._highlightedColHeaderCells.forEach((t=>t.className="hlabel")),this._highlightedColHeaderCells=[];const e=this.rowHeaderCount;t.forEach((t=>{const i=this.hRows[this.model.hasColumnTreeEnabled?1:0].children[this.colMap.get(t)+e];i&&(this._highlightedColHeaderCells.push(i),i.className="hlabel selected")}))}highlightRowHeaderCells(t){this.model.options.rowNumbers&&0!=this.model.rows.length&&(this._highlightedRowHeaderCells.forEach((t=>t.className="vlabel")),this._highlightedRowHeaderCells=[],t.forEach((t=>{const e=this.getRowByModelIndex(t)?.children[this.model.hasRowTreeEnabled?1:0];e&&(this._highlightedRowHeaderCells.push(e),e.className="vlabel selected")})))}get columnHeaderCount(){return this.model.headerCount+(this.model.hasColumnTreeEnabled?1:0)+(this.model.hasFilter?1:0)+(this.model.options.colLetters?1:0)}get rowHeaderCount(){return(this.model.hasRowTreeEnabled?1:0)+(this.model.options.rowNumbers?1:0)}get renderRowCount(){return this.renderAll?this.model.visibleRows.length:Math.round(Math.min(this.clientHeight/Rx.MIN_ROW_HEIGHT,this.model.rows.length))}get renderColCount(){return this.renderAll?this.model.visibleColumns.length+this.rowHeaderCount:Math.round(Math.min(this.clientWidth/Rx.MIN_COL_WIDTH||5,this.model.columns.length+this.rowHeaderCount))}get totalHeaderHeight(){let t=0,e=0;this.model.hasColumnTreeEnabled&&(t+=this.treeHeaderHeight,++e),this.model.options.colLetters&&(t+=this.thead.children[e].offsetHeight||this.model.options.rowHeight,++e);for(let i=0;i<this.model.headerCount;i++)t+=this.thead.children[e+i].offsetHeight||this.model.options.rowHeight;return this.model.hasFilter&&(t+=this.model.options.rowHeight),t}get treeHeaderWidth(){return this.model.hasRowTreeEnabled?15*this.model.maxRowLevel+20:0}get treeHeaderHeight(){return this.model.hasColumnTree?15*this.model.maxColumnLevel+20:0}get totalHeaderWidth(){let t=0;return this.model.options.rowNumbers&&(t+=Rx.ROW_HEADER_WIDTH),t+=this.treeHeaderWidth,t}get viewportSize(){return this._viewportSize||(this._viewportSize=this.renderAll?{w:1/0,h:1/0}:{w:(this.clientWidth-this.totalHeaderWidth-Rx.SLIDER_SIZE)/this.zoom,h:(this.clientHeight-this.totalHeaderHeight-Rx.SLIDER_SIZE)/this.zoom}),this._viewportSize}get viewport(){return this._viewport||(this._viewport=this.model.getViewport({c:this.colOffset,r:this.rowOffset},this.viewportSize,{t:this.model.options.freezeTop,l:this.freezeLeft,b:this.model.options.freezeBottom,r:this.model.options.freezeRight})),this._viewport}get viewportRange(){return 0==this.viewport.columns.length||0==this.viewport.rows.length?null:new _v(this.viewport.columns[0].index,this.viewport.rows[0].index,this.viewport.columns[this.viewport.columns.length-1].index,this.viewport.rows[this.viewport.rows.length-1].index)}findColumnIndexByOffset(t){let e=0;const i=this.colgroup.children;for(let o=0;o<i.length;o++)if(e+=i[o].offsetWidth,e>=t)return o;return-1}findRowByOffset(t){const e=(t>this.thead.offsetHeight?this.tbody:this.thead).children;t>this.thead.offsetHeight&&(t-=this.thead.offsetHeight);let i=0;for(let o=0;o<e.length;o++){const r=e[o];if(i+=r.offsetHeight,i>=t)return r}return null}findTableCellByOffset(t,e){t/=this.zoom,e/=this.zoom;const i=this.findRowByOffset(e),o=this.findColumnIndexByOffset(t),r=i&&o>-1?i.children[o]:null;return r&&!Ct(r)?r:null}findNearestTableCellByOffset(t,e){let i,o;t/=this.zoom,e/=this.zoom;const r=this.findRowByOffset(e),n=this.findColumnIndexByOffset(t);i=e<0?this.tbody.children[0]:e>this.tbody.offsetHeight+this.thead.offsetHeight?this.tbody.children[this.viewport.rows.length-1]:r,o=t<0?this.rowHeaderCount:t>=this.tbody.offsetWidth?this.viewport.columns.length+this.rowHeaderCount-1:n;let s=i&&o>-1?i.children[o]:null;for(;s&&Ct(s);)s=s.previousElementSibling;const a=r&&n>-1?r.children[n]:null;return[s,a&&!Ct(a)?a:null]}connectedCallback(){super.connectedCallback(),this.grid=Et(this,"og-grid")}willUpdate(){this._viewport=null,this._viewportSize=null,this.model&&(this.clearHeaderCache(),this.clearBodyCache())}updated(){this.model&&(this.createColumns(),this.createHeaderRows(),this.createBodyRows(),this.renderCells())}refresh(){this.clearHeaderCache(),this.clearBodyCache(),this.requestUpdate()}createColumns(){this._freezeLeft=null;const t=this.renderColCount;if(!this.cols||this.cols.length!=t){this.cols=new Array(t);for(let e=0;e<t;e++)this.cols[e]=yt("col"),this.cols.forEach((()=>this.colgroup.appendChild(this.cols[e])))}}createHeaderRows(){const t=this.columnHeaderCount,e=this.renderColCount;if(St(this.thead),!this.hRows||this.hRows.length!=t||!this.hRows[0]||this.hRows[0].children.length!=e){this.hRows=new Array(t);for(let i=0;i<t;i++){this.hRows[i]=yt("tr");for(let t=0;t<e;t++)this.hRows[i].appendChild(yt("th"))}}St(this.thead),this.hRows.forEach((t=>this.thead.appendChild(t)))}createBodyRows(){const t=this.renderRowCount,e=this.renderColCount,i=this.rowHeaderCount;if(!this.bRows||0==this.bRows.length||this.bRows.length!=t||this.bRows[0].children.length!=e)if(0==t&&this.grid.options.emptyPlaceholder)this.bRows=[yt("tr")],this.bRows[0].appendChild(yt("td"));else{this.bRows=new Array(t);for(let o=0;o<t;o++){this.bRows[o]=yt("tr");for(let t=0;t<i;t++)this.bRows[o].appendChild(yt("th"));for(let t=i;t<e;t++)this.bRows[o].appendChild(yt("td"))}}St(this.tbody),this.bRows.forEach((t=>this.tbody.appendChild(t)))}renderCells(t={vertical:!0,horizontal:!0}){this.table&&(t.vertical||t.horizontal)&&(this._viewport=null,t.horizontal&&this.renderHeader(),this.model.rows.length>0?(this.renderBody(),t.vertical&&this.renderRowTree()):this.model.options.emptyPlaceholder&&(this.renderEmptyBody(),this.table.appendChild(this.tbody)),this.dispatchEvent(new Wx("rendercells")))}renderEmptyBody(){const t=this.bRows[0].children[0];t.innerHTML="no data",t.className="empty-placeholder",t.colSpan=this.viewport.columns.length+this.rowHeaderCount}renderHeader(){let t;this.colMap.clear();const e=this.rowHeaderCount,i=this.viewport;this.model.hasRowTreeEnabled&&Nt(this.colgroup.children[0],{w:this.treeHeaderWidth},!0),this.model.options.rowNumbers&&Nt(this.colgroup.children[e-1],{w:Rx.ROW_HEADER_WIDTH},!0);for(let o=0;o<i.columns.length;o++)t=i.columns[o],this.model.autofitColumns.has(t.index)&&(this.grid.rendering.autofitColumn(t.index,!1,!1),this.model.autofitColumns.delete(t.index)),this.colMap.set(t.index,o),Nt(this.colgroup.children[o+e],{w:t.width}),jt(this.colgroup.children[o+e],{w:t.width}),Pt(this.colgroup.children[o+e],{w:t.width});let o=0;this.model.hasColumnTreeEnabled&&(this.renderHeaderRowTree(this.hRows[o],o),++o),this.model.options.colLetters&&(Nt(this.hRows[o],{h:this.model.options.rowHeight}),this.renderHeaderRowLetters(this.hRows[o],o),++o);for(let t=0;t<this.model.headerCount;t++)this.renderHeaderRowLabels(this.hRows[o+t],o+t,t);o+=this.model.headerCount,this.model.hasFilter&&(Nt(this.hRows[o],{h:this.model.options.rowHeight}),this.renderHeaderRowFilters(this.hRows[o],o))}renderHeaderRowLetters(t,e){let i,o;const r=this.viewport,n=e-this.columnHeaderCount;let s=0;if(Nt(t,{h:this.model.options.rowHeight}),(this.model.hasRowTree||this.model.options.rowNumbers)&&!this.model.hasColumnTreeEnabled){i=t.children[s],i.colSpan=this.rowHeaderCount,i.rowSpan=this.columnHeaderCount;const e=s-this.rowHeaderCount,o=this.model.options.levelButtonCell;(!o||n==o.r&&e==o.c)&&this.renderHeaderRowCornerCell(i),s++}for(let e=s;e<this.rowHeaderCount;e++)_t(t.children[e]),s++;for(let e=s;e<t.children.length;e++)o=e-s,i=t.children[e],i.className="hlabel",r.columns.length>o?(i.innerHTML=r.columns[o].address,i.c=r.columns[o].index,Mt(i)):_t(i)}renderHeaderRowTree(t,e){if(!this.model.hasColumnTreeEnabled)return;let i,o,r=0;const n=e-this.columnHeaderCount,s=this.viewport,a=this.model.options.rowNumbers,l=this.model.hasRowTreeEnabled;if(Nt(t,{h:this.treeHeaderHeight}),i=t.children[r],!i)return;i.rowSpan=a||l?this.columnHeaderCount:1,i.colSpan=this.rowHeaderCount;const c=r-this.rowHeaderCount,h=this.model.options.levelButtonCell;let d=null;(!h&&(a||l)||h&&n==h.r&&c==h.c)&&(d=c,this.renderHeaderRowCornerCell(i)),(a||l)&&++r;for(let n=r;n<t.children.length;n++)o=n-r,i=t.children[n],s.columns.length>o?(d!=n&&(i.innerHTML="",i.className="htree",this.renderHeaderRowTreeCell(t,e,s.columns[o],i)),Mt(i)):_t(i)}renderHeaderRowTreeCell(t,e,i,o){let r=this.hCache.get(i.index,e);if(!r){r=yt("div"),this.hCache.set(i.index,e,r);const t=i.width+1,o=this.treeHeaderHeight/this.model.maxColumnLevel;if(i.hasChildren){const e=new Vu;e.addEventListener("toggle",(()=>this.grid.rendering.toggleColumn(i.index))),r.expander=e,r.appendChild(e),Ht(e,{l:t/2-Rx.EXPANDER_SIZE/2,t:i.level*o+o/2-Rx.EXPANDER_SIZE/2}),r.expanderLine=this.createExpanderLine("h"),r.appendChild(r.expanderLine),Ht(r.expanderLine,{l:this.model.options.columnTree.reversed?0:t/2,t:i.level*o+o/2}),Nt(r.expanderLine,{h:o/2,w:t/2+1})}if(i.hasParent){let e=i;for(;e.hasParent;){e=e.parent;const i=this.createExpanderLine("h");r.appendChild(i),Nt(i,{h:o/2,w:t-1}),Ht(i,{l:0,t:e.level*o+o/2})}}}r.expander&&(r.expander.state=i.collapsed?"closed":"open"),o.appendChild(r)}createExpanderLine(t){const e=yt("div");return e.className=`${t}tree-line`,e}renderHeaderRowLabels(t,e,i){let o,r,n,s,a=0;const l=this.viewport,c=e-this.columnHeaderCount,h=this.model.options.levelButtonCell;let d;this.model.hasRowTreeEnabled&&(r=t.children[a],r.innerHTML="",this.model.hasColumnTreeEnabled||this.model.options.colLetters||i>0?_t(r):(r.rowSpan=this.columnHeaderCount,r.colSpan=this.rowHeaderCount,this.renderHeaderRowCornerCell(r)),++a),this.model.options.rowNumbers&&(r=t.children[a],r.innerHTML="",this.model.hasRowTreeEnabled||this.model.options.colLetters||this.model.hasColumnTreeEnabled||i>0?_t(r):(r.rowSpan=this.columnHeaderCount,r.colSpan=this.rowHeaderCount,this.renderHeaderRowCornerCell(r)),++a);for(let u=a;u<t.children.length;u++)if(s=u-a,r=t.children[u],r.className="hlabel",r.innerHTML="",l.columns.length>s)if(o=l.columns[s],n=o.header[i],n.height&&(d=Math.max(n.height,d||0)),r.colSpan=1,r.rowSpan=1,r.c=o.index,r.r=i,n?.hidden)if(s==this.freezeLeft){let t=o.prevVisible,n=0;for(;t&&t.header[i]?.hidden;)t=t.prevVisible,++n;t&&t.header[i].cs?(Mt(r),r.colSpan=t.header[i].cs-n-1,r.rowSpan=t.header[i].rs||1,this.renderHeaderRowLabelCell(r,t,e,i)):_t(r)}else _t(r);else{if(o.header&&o.header[i]){const t=o.header[i].cs||1;r.colSpan=t>1?o.calculateRealColspan(t):1,r.rowSpan=o.header[i].rs||1}Mt(r),this.renderHeaderRowLabelCell(r,o,e,i),h&&h.r==c&&h.c==o.index&&this.renderHeaderRowCornerCell(r)}else _t(r);Nt(t,{h:d??this.model.options.rowHeight})}renderHeaderRowLabelCell(t,e,i,o){let r=this.hCache.get(e.index,i);const n=e.header[o];if(r||(r=yt("div"),n?n.html?r.innerHTML=n.label??"":r.innerText=n.label??"":r.innerHTML="",n&&null!=n._style&&mC(r,bw(this.model.styles.get(n._style))),this.hCache.set(e.index,i,r)),this.model.options.columnHeaderTreeButtons&&e.hasChildren&&o==e.level){let t=r.expander;t||(t=new Vu,t.addEventListener("toggle",(()=>this.grid.rendering.toggleColumn(e.index))),r.expander=t,r.prepend(t),Ht(t,{l:4,t:4})),t.state=e.collapsed?"closed":"open"}if(e.sorting&&o==e.header.length-1&&(t.className+=" sort",r.sortingArrow||(r.sortingArrow=yt("og-sortingarrow"),r.appendChild(r.sortingArrow),Ht(r.sortingArrow,{t:2,r:5})),r.sortingArrow.sortSettings=this.model.sorting.get(e.index)),e.hasHeaderTooltip(o)){const t=yt("div");t.className="crn",r.appendChild(t),r.classList.add("tt")}t.appendChild(r)}renderHeaderRowFilters(t,e){let i,o,r=0;const n=this.viewport;this.model.hasRowTreeEnabled&&(i=t.children[r],i.innerHTML="",this.model.columnHeaderCount>1?_t(i):i.colSpan=this.model.columnHeaderCount,++r),this.model.options.rowNumbers&&(i=t.children[r],i.innerHTML="",this.model.hasRowTreeEnabled||this.model.options.colLetters||this.model.hasColumnTreeEnabled||this.model.headerCount>0?_t(i):(i.rowSpan=this.columnHeaderCount,i.colSpan=this.rowHeaderCount,this.renderHeaderRowCornerCell(i)),++r);for(let s=r;s<t.children.length;s++)if(o=s-r,i=t.children[s],n.columns.length>o){Mt(i);const r=n.columns[o];r.hasFilter?this.renderHeaderRowFilterCell(t,e,r,i):i.innerHTML=""}else _t(i)}renderHeaderRowFilterCell(t,e,i,o){o.innerHTML="",o.className="filter",o.c=i.index;let r=this.hCache.get(i.index,e);r||(r=yt("div"),r.filter=yt("og-filter-label"),r.appendChild(r.filter),this.hCache.set(i.index,e,r));const n=this.grid.filtering.filter.get(i.index)?.term;r.filter.value=Array.isArray(n)?n.map((t=>t.value??t.key)).join(", "):n,o.appendChild(r)}renderHeaderRowCornerCell(t){this.cornerDiv=yt("div");const e=Math.max((this.treeHeaderWidth||Rx.EXPANDER_SIZE+2)/(this.model.maxRowLevel+1),Rx.EXPANDER_SIZE+2);if(this.model.hasRowTree)for(let t=0;t<=this.model.maxRowLevel;t++){const i=new Uu;i.level=t,this.cornerDiv.appendChild(i),Ht(i,{l:t*e+e/2-Rx.EXPANDER_SIZE/2,b:3}),i.addEventListener("mousedown",(t=>t.stopPropagation())),i.addEventListener("toggle",(t=>{this.model.columns.filter((t=>t.levelButtons)).forEach((t=>this.bCache.deleteColumn(t.index))),this.grid.rendering.setRowExpandLevel(t.level)}))}if(this.model.hasColumnTree){const i=(this.model.hasColumnTree?this.treeHeaderHeight:t.clientHeight)/(this.model.maxColumnLevel+1),o=15*this.model.maxColumnLevel+20<=t.clientHeight;for(let t=0;t<=this.model.maxColumnLevel;t++){const r=new Uu;r.level=t,this.cornerDiv.appendChild(r),Ht(r,o?{t:t*i+i/2-Rx.EXPANDER_SIZE/2,r:3}:{r:t*e+e/2-Rx.EXPANDER_SIZE/2,b:3}),r.addEventListener("mousedown",(t=>t.stopPropagation())),r.addEventListener("toggle",(t=>{this.grid.rendering.setColumnExpandLevel(t.level)}))}}St(t),t.appendChild(this.cornerDiv)}renderBody(){let t,e,i,o,r,n,s,a,l;const c=this.freezeLeft||0,h=this.rowHeaderCount,d=this.model.merges,u=this.model.options.rowNumbers,p=this.viewport,g=this.viewportRange;if(!g)return;const m=new _v(this.colOffset+c,this.rowOffset,g.c2,g.r2);this.rowMap.clear();for(let c=0;c<this.bRows.length;c++)if(t=this.bRows[c],c<p.rows.length){i=p.rows[c],o=i.index,this.model.autofitRows.has(o)&&(this.grid.rendering.autofitRow(o,!1,!1),this.model.autofitRows.delete(o)),Nt(t,{h:i.height}),i.height<this.model.options.rowHeight&&Vt(t,i.height),this.rowMap.set(o,c),u&&(e=t.children[h-1],e.className="vlabel",e.r=o,e.c=-1,e.innerHTML=`<div>${Sv(o)}</div>`);for(let c=h;c<t.children.length;c++)if(e=t.children[c],c-h<p.columns.length){if(n=p.columns[c-h],r=n.index,e.r=o,e.c=r,s=i.cell(r),a=s.address,l=d.getMergeState(a),l==Mx.HIDDEN){const t=d.hiddenCells.get(s.address),i=m.intersect(new _v(t.c,t.r,t.c+t.cs-1,t.r+t.rs-1));if(!i||s.c!=i.c1||s.r!=i.r1){_t(e);continue}s=this.model.rows[t.r].cell(t.c),e.colSpan=i.size.columns,e.rowSpan=i.size.rows,e.c=s.c,e.r=s.r}else if(l==Mx.MERGED){const t=s.merge;e.colSpan=t.cs,e.rowSpan=t.rs}else e.colSpan=1,e.rowSpan=1;Mt(e),this.renderBodyCell(s,e)}else _t(e);t.style.display="table-row",t.className=i.filterState>1?"filtered":""}else t.style.display="none"}scheduleRenderBodyCell(t,e){this.cellRenderSchedules.has(e)&&(window.clearTimeout(this.cellRenderSchedules.get(e)),this.cellRenderSchedules.delete(e)),this.cellRenderSchedules.set(e,window.setTimeout((()=>this.renderBodyCell(t,e))))}fixCellBorders(t,e){"none"==e.bottom?.style&&(t.style.borderBottomColor="transparent"),"none"==e.top?.style&&(t.style.borderTop="transparent"),"none"==e.right?.style&&(t.style.borderRight="transparent"),"none"==e.left?.style&&(t.style.borderLeft="transparent")}renderBodyCell(t,e){const i=!e;if(e=e||this.getCellByCellModel(t)){let o=i?null:this.bCache.get(t.c,t.r);if(o||(o=yt("div"),zC(t).call(this,o,t),this.bCache.set(t.c,t.r,o)),this.renderAll){const i=t.composedStyle;i&&this.fixCellBorders(e,i)}St(e),e.appendChild(o)}else this.bCache.delete(t.c,t.r)}mergeBodyCells(t){let e;const i=new Set;for(const o of t)if(e=this.bRows[o.r].cells[o.c],e&&!i.has(e))for(let t=o.r;t<o.r+o.rs;t++)for(let r=o.c;r<o.c+o.cs;r++)e=this.bRows[t].cells[r],e&&(t==o.r&&r==o.c?(e.colSpan=o.cs,e.rowSpan=o.rs):(i.add(e),_t(e)))}renderRowTree(){if(!this.model.hasRowTreeEnabled)return;let t;const e=this.viewport,i=-this.rowHeaderCount;for(let o=0;o<this.bRows.length;o++)t=this.bRows[o].children[0],t.innerHTML="",o<e.rows.length&&(t.className="vtree",this.renderRowTreeCell(i,e.rows[o],t))}renderRowTreeCell(t,e,i){let o=this.bCache.get(t,e.index);if(!o){o=yt("div"),this.bCache.set(t,e.index,o);const r=e.height+1,n=this.treeHeaderWidth/this.model.maxRowLevel;if(e.hasChildren){const t=new Vu;t.addEventListener("toggle",(()=>this.grid.rendering.toggleRow(e.index))),i.parentElement.expander=t,o.expander=t,o.appendChild(t),Ht(t,{t:r/2-Rx.EXPANDER_SIZE/2,l:e.level*n+n/2-Rx.EXPANDER_SIZE/2});const s=this.createExpanderLine("v");o.appendChild(s),Ht(s,{t:this.model.options.rowTree.reversed?0:r/2,l:e.level*n+n/2}),Nt(s,{w:n/2,h:r/2+1})}if(e.hasParent){let t=e;for(;t.hasParent;){t=t.parent;const e=this.createExpanderLine("v");o.appendChild(e),Nt(e,{w:n/2,h:r+2}),Ht(e,{t:-1,l:t.level*n+n/2})}}}o.expander&&(o.expander.state=e.collapsed?"closed":"open"),i.appendChild(o)}};Vx.styles=[Fx],Bx([Ts({type:Object})],Vx.prototype,"model",void 0),Bx([Ts({type:Boolean,reflect:!0})],Vx.prototype,"hideOuterBorder",void 0),Bx([Ts({type:Number,hasChanged:()=>!1})],Vx.prototype,"rowOffset",void 0),Bx([Ts({type:Number,hasChanged:()=>!1})],Vx.prototype,"colOffset",void 0),Bx([Ts({type:Number,reflect:!0})],Vx.prototype,"zoom",void 0),Bx([Ts({type:Boolean,reflect:!0})],Vx.prototype,"nogrid",void 0),Bx([Ts({type:Boolean,reflect:!0})],Vx.prototype,"renderAll",void 0),Vx=Bx([Ls("og-table")],Vx);const Ux=["F5","F12"];class Gx extends Event{constructor(t){super("grid.error",{bubbles:!0,composed:!0}),this.error=t}}class qx extends Event{get selection(){return this.grid.selecting.selection}get activeCell(){return this.selection.activeCell}constructor(t,e){super(`grid.${t}`,{bubbles:!0,composed:!0}),Object.assign(this,e),this.cell&&(this.row=this.cell.row,this.column=this.cell.column)}}class Yx extends qx{constructor(t){super("edit",t)}}class Zx extends Cp{constructor(t,e,i){super(`grid.${t}`,i),this.grid=e}}class Xx extends Zx{constructor(t,e,i,o){super(t,e,o),this.column=i}}class Qx extends Zx{constructor(t,e,i,o){super(t,e,o),this.row=i}}class Kx{get model(){return this.grid.model}get selection(){return this.grid.selection}get table(){return this.grid.table}constructor(t){this.grid=t,this.clickDisabled=!1,this.editDisabled=!1,this.clicked=!1,this.startOffset={x:0,y:0},this.suspendClick=()=>this.clickDisabled=!0,this.resumeClick=(t=!1)=>{this.isSliding||(t?setTimeout((()=>this.clickDisabled=!1),100):this.clickDisabled=!1)},this._onKeyDown=t=>{switch(Ux.includes(t.key)||t.preventDefault(),t.key){case"Tab":t.preventDefault(),this.grid.selecting.shiftActiveCell(t.shiftKey?-1:1,!0);break;case"ArrowRight":this.grid.selecting.debounceMoveSelector(1,0);break;case"ArrowLeft":this.grid.selecting.debounceMoveSelector(-1,0);break;case"ArrowDown":this.grid.selecting.debounceMoveSelector(0,1);break;case"ArrowUp":this.grid.selecting.debounceMoveSelector(0,-1);break;case"PageUp":this.grid.selecting.debounceMoveSelector(0,-this.table.viewport.rows.length);break;case"PageDown":this.grid.selecting.debounceMoveSelector(0,this.table.viewport.rows.length);break;case"Home":this.grid.selecting.debounceMoveSelector(-this.selection.range.c1,t.ctrlKey?-this.selection.range.r1:0);break;case"End":this.grid.selecting.debounceMoveSelector(this.model.gridRange.c2-this.selection.range.c1,t.ctrlKey?this.model.gridRange.r2-this.selection.range.r1:0);break;case"Enter":this.grid.selecting.enter();break;case"Escape":this.grid.selecting.hideCopySelector();break;case"c":case"C":t.ctrlKey&&this.grid.editing.copySelection();break;case"v":case"V":t.ctrlKey&&this.grid.editing.paste();break;case"z":case"Z":if(!this.grid.options.undoRedo)return;t.ctrlKey&&this.grid.editing.undo();break;case"y":case"Y":if(!this.grid.options.undoRedo)return;t.ctrlKey&&this.grid.editing.redo();break;case"F2":t.preventDefault(),this.grid.editing.startEdit();break;case"Delete":t.preventDefault(),this.grid.objects.delete(),this.grid.editing.clearSelection();break;case"Backspace":t.preventDefault(),this.grid.editing.clearSelection();break;case"F1":if(!this.grid.options.commandWindow)return;t.preventDefault(),this.grid.openCommands()}1!=t.key.length||t.ctrlKey||this.grid.editing.startEdit(t.key)},this._onMouseMove=t=>{if(!this.model)return;let e=!0,i=!0;const o=this.grid.hSizer,r=this.grid.vSizer,{offsetX:n,offsetY:s}=t;let a=this.model.options.scrolling.scrollbarVisibilityTreshold;a<=0&&(a=Math.max(this.grid.clientWidth,this.grid.clientHeight)),n>this.grid.clientWidth-a?this.grid.vSlider.show():this.grid.vSlider.hide(),s>this.grid.clientHeight-a?this.grid.hSlider.show():this.grid.hSlider.hide();const[l,c]=this.table.findNearestTableCellByOffset(n,s);if(c&&"TH"==c.tagName&&(this.model.options.columnResize&&!o.resizing&&c.classList.contains("hlabel")?c.offsetWidth-t.offsetX+c.offsetLeft<Rx.RESIZE_TRESHOLD?(o.snap(c,this.grid),this.grid.rendering.currentResizedColumn=this.model.columns[c.c]):kt(o):this.model.options.rowResize&&!r.resizing&&c.classList.contains("vlabel")&&(c.offsetHeight-t.offsetY+c.offsetTop<Rx.RESIZE_TRESHOLD?(r.snap(c,this.grid),this.grid.rendering.currentResizedRow=this.model.rows[c.r]):kt(r)),null!=c.c)){const t=this.model.columns[c.c];t?.hasHeaderTooltip(c.r)&&(e=!1,this.grid.tooltip.attachToCell(c,t.header[c.r],"bottom"))}if(l&&"TH"==l.tagName)this.grid.selecting.isSelecting&&(this.suspendClick(),this.grid.selecting.updateSelecting(l.c,l.r)),i=!1;else if(l&&"TD"==l.tagName)if(this.grid.selecting.isSelectorOperationActive||this.grid.selecting.isFormulaSelectorOperationActive){const{top:e,left:i}=Tt(l,this.grid);this.grid.rendering.autoscroll({x:i-this.table.totalHeaderWidth+t.offsetX-l.offsetLeft,y:e-this.table.thead.clientHeight+t.offsetY-l.offsetTop}),this.grid.selecting.isSelecting&&this.suspendClick(),this.grid.selecting.updateSelecting(l.c,l.r)}else{const t=this.model.rows[l.r]?.cell(l.c);t&&t.hasTooltip&&(e=!1,this.grid.tooltip.attachToCell(l,t)),t&&t.hasComment&&(e=!1,this.grid.comment.attachedTo!==l&&this.grid.comment.attachTo(l,t))}e&&(this.grid.tooltip.deatach(),this.grid.comment.deatach(this.model.options.comments.hideTimeout)),i&&(kt(o),kt(r))},this._onMouseDown=t=>{if(1&t.buttons){this.grid.setPointerCapture(t.pointerId),this.startOffset={x:t.offsetX,y:t.offsetY};for(const e of t.composedPath()){if("TD"==e.tagName){const t=e;this.grid.selecting.startCellSelecting(new _v(t.c,t.r));break}if("TH"==e.tagName){const t=e;e.matches(".sort")?this.grid.sorting.sort(t.c):t.classList.contains("filter")?this.grid.filtering.openFilter(this.model.columns[t.c],t):t.classList.contains("hlabel")?this.grid.selecting.startColumnSelecting(t.c):t.classList.contains("vlabel")&&this.grid.selecting.startRowSelecting(t.r);break}}}},this._onMouseUp=t=>{if(0!=t.buttons)return;const e=Math.abs(this.startOffset.x-t.offsetX),i=Math.abs(this.startOffset.y-t.offsetY);Math.sqrt(Math.pow(e,2)+Math.pow(i,2))<this.model.options.events.click.mouseMoveTreshold&&this.resumeClick(),this.grid.releasePointerCapture(t.pointerId),this.grid.selecting.stopSelectOperations()},this._onClick=t=>{if(this.clickDisabled)return;if(this.grid.clientHeight-t.offsetY<this.grid.hSlider.offsetHeight)return;if(this.grid.clientWidth-t.offsetX<this.grid.vSlider.offsetWidth)return;const e=this.table.findTableCellByOffset(t.offsetX,t.offsetY),i="TD"==e?.tagName?this.model.rows[e.r]?.cell(e.c):null;this.grid.dispatchEvent(new qx("click",{grid:this.grid,cell:i}))},this._onContextMenu=t=>{t.preventDefault();for(const e of t.composedPath())if("TD"==e.tagName){const i=e;this.grid.menus.openCellMenu(this.model.rows[i.r].cell(i.c),{x:t.pageX,y:t.pageY})}else if("TH"==e.tagName){const i=e;i.classList.contains("hlabel")?this.grid.menus.openColumnMenu(this.model.columns[i.c],{x:t.pageX,y:t.pageY}):i.classList.contains("vlabel")&&this.grid.menus.openRowMenu(this.model.rows[i.r],{x:t.pageX,y:t.pageY})}},this._onVerticalSlide=t=>{this.table.rowOffset=Math.min(t.value,this.model.visibleRows.length-1),this.grid.rendering.requireVerticalUpdate=!0,this.grid.rendering.renderCells()},this._onHorizontalSlide=t=>{this.table.colOffset=Math.min(t.value,this.model.visibleColumns.length-1),this.grid.rendering.requireHorizontalUpdate=!0,this.grid.rendering.renderCells()},this._onSlideStart=()=>{this.suspendClick()},this._onSlideStop=()=>{this.resumeClick(!0)},this._denbounceHorizontalScroll=q((t=>this.grid.rendering.scrollHorizontalByPixels(t)),50),this._onWheel=t=>{t.ctrlKey||(0!=t.deltaY&&this.grid.rendering.scrollVerticalByPixels(t.deltaY),0!=t.deltaX&&this._denbounceHorizontalScroll(Math.sign(t.deltaX)*Math.min(100,Math.abs(t.deltaX))))},this._onTouchStart=t=>{this.grid.rendering.touchStartX=t.touches[0],this.grid.rendering.touchStartY=t.touches[0]},this._onTouchEnd=t=>{this.grid.rendering.touchStartX=t.touches[0],this.grid.rendering.touchStartY=t.touches[0]},this._onTouchMove=t=>{const e=this.grid.rendering;if(e.touchStartY){const i=e.touchStartY.clientY-t.touches[0].clientY;Math.abs(i)>this.model.options.rowHeight&&this.table.viewport.rows.length>0&&(e.scrollVerticalByPixels(i),e.touchStartY=t.touches[0])}if(e.touchStartX){const i=e.touchStartX.clientX-t.touches[0].clientX;Math.abs(i)>this.model.options.columnWidth&&this.table.viewport.columns.length>0&&(e.scrollHorizontalByPixels(i),e.touchStartX=t.touches[0])}},this._onHorizontalResizeStart=()=>{this.grid.rendering.resizing=!0,this.grid.rendering.currentResizedColumnWidth=this.grid.rendering.currentResizedColumn.width},this._onHorizontalResizeStop=t=>{this.suspendClick(),this.grid.rendering.resizing=!1,this.table.clearHeaderCache(),this.table.renderCells({horizontal:!0}),this.grid.dispatchEvent(new Xx("column.resize",this.grid,this.grid.rendering.currentResizedColumn,t))},this._onHorizontalResize=t=>{const e=this.grid.rendering;e.currentResizedColumn.width=e.currentResizedColumnWidth+t.deltaX,Nt(this.table.getColumnByModelIndex(e.currentResizedColumn.index),{w:e.currentResizedColumn.width},!0),this.grid.selecting.updateSelector()},this._onVerticalResizeStart=()=>{this.grid.rendering.resizing=!0,this.grid.rendering.currentResizedRowHeight=this.grid.rendering.currentResizedRow.height},this._onVerticalResizeStop=t=>{this.suspendClick(),this.grid.rendering.resizing=!1,this.table.clearBodyCache(),this.table.renderCells({vertical:!0}),this.grid.dispatchEvent(new Qx("row.resize",this.grid,this.grid.rendering.currentResizedRow,t))},this._onVerticalResize=t=>{const e=this.grid.rendering;e.currentResizedRow.height=e.currentResizedRowHeight+t.deltaY,Nt(this.table.getRowByModelIndex(e.currentResizedRow.index),{h:e.currentResizedRow.height},!1),this.grid.selecting.updateSelector()},this._onCommentCommit=t=>{this.grid.model.comments.set(t.cell.address,t.items),t.cell.invalidateStyle(),this.grid.rendering.updateCells([t.cell])},this._onAutofill=t=>{if(this.suspendClick(),this.grid.selection.range.equals(t.selector.autofillRange))return;const{cells:e,oldValues:i}=nw(this.model,this.grid.selection.range,t.selector.autofillRange,t.selector.autofillDirection);this.grid.rendering.updateCells(e,!0),this.grid.selection.setRange(this.grid.selection.range.unite(t.selector.autofillRange)),this.grid.selecting.updateSelector(),this.grid.dispatchEvent(new Yx({grid:this.grid,editType:"autofill",cells:e,oldValues:i,newValues:e.map((t=>t.value2))}))},this._onEdit=t=>{if(t.fromHistory)return;const e=[],i=[],o=this.model.names.rangeMap;let r=[],n=[],s=[],a=[];switch(t.editType){case"value":r=t.newValues,n=t.newProps,s=t.oldValues,a=t.oldProps,t.cells.forEach((t=>{const r=t.address;e.push(r),i.push(o.get(r))}));break;case"insert_column":case"insert_row":t.newValues.forEach((t=>{const n=t.address;e.push(n),i.push(o.get(n)),r.push(t.getSourceData())}))}this.grid.history.push({type:t.editType,addresses:e,names:i,oldValues:s,oldProps:a,newValues:r,newProps:n})},this._onSelectorMove=t=>{this.suspendClick(),this.selection.setRange(t.toRange),t.fromRange.isRow?this.grid.editing.moveRows({index:t.fromRange.r1,count:t.fromRange.size.rows,targetIndex:t.toRange.r1}):t.fromRange.isColumn?this.grid.editing.moveColumns({index:t.fromRange.c1,count:t.fromRange.size.columns,targetIndex:t.toRange.c1}):console.log(t)},this._onMouseLeave=()=>{this.grid.rendering.hideSliders()},this.debounceHideSliders=q((()=>this.grid.rendering.hideSliders()),1e3,{isImmediate:!1}),this._onRender=()=>{const t=this.grid;t.selecting.updateSelectors(),t.dispatchEvent(new qx("render",{grid:this.grid})),t.adapter&&t.options.pageSize&&t.rendering.isLastRowInViewport()&&t.rendering.loadNextPage(),t.rendering.updateSliderVisibility(),this.model.options.scrolling.scrollbarVisibilityTreshold>0&&this.debounceHideSliders()},this._onHorizontalSizerDblClick=t=>{t.stopPropagation(),this.editDisabled=!0,this.grid.rendering.autofitColumn(this.grid.rendering.currentResizedColumn.index),this.grid.dispatchEvent(new Xx("column.resize",this.grid,this.grid.rendering.currentResizedColumn,t))},this._onVerticalSizerDblClick=t=>{t.stopPropagation(),this.editDisabled=!0,this.grid.rendering.autofitRow(this.grid.rendering.currentResizedRow.index),this.grid.dispatchEvent(new Qx("row.resize",this.grid,this.grid.rendering.currentResizedRow,t))},this._onDblClick=()=>{this.editDisabled?this.editDisabled=!1:this.grid.editing.startEdit()}}get isSliding(){return this.grid.hSlider.sliding||this.grid.vSlider.sliding}async init(){await this.grid.updateComplete,await this.table.updateComplete;const t=this.grid;t.addEventListener("wheel",this._onWheel,{passive:!0}),t.addEventListener("touchstart",this._onTouchStart,{passive:!0}),t.addEventListener("touchend",this._onTouchEnd,{passive:!0}),t.addEventListener("touchmove",this._onTouchMove,{passive:!0}),t.hSizer.addEventListener("resizestart",this._onHorizontalResizeStart),t.hSizer.addEventListener("resizestop",this._onHorizontalResizeStop),t.hSizer.addEventListener("resize",this._onHorizontalResize),t.hSizer.addEventListener("dblclick",this._onHorizontalSizerDblClick),t.vSizer.addEventListener("resizestart",this._onVerticalResizeStart),t.vSizer.addEventListener("resizestop",this._onVerticalResizeStop),t.vSizer.addEventListener("resize",this._onVerticalResize),t.vSizer.addEventListener("dblclick",this._onVerticalSizerDblClick),t.comment.addEventListener("comment.commit",this._onCommentCommit),t.addEventListener("keydown",this._onKeyDown),t.addEventListener("click",this._onClick),t.addEventListener("contextmenu",this._onContextMenu),t.addEventListener("toggle",(()=>t.rendering.debounceCalculateViewport())),t.addEventListener("pointerup",this._onMouseUp),t.addEventListener("pointerdown",this._onMouseDown);const e=q(this._onMouseMove,20,{maxWait:50,isImmediate:!0});t.addEventListener("pointermove",e),t.addEventListener("mouseleave",this._onMouseLeave),t.table.addEventListener("rendercells",this._onRender),t.selector.addEventListener("grid.selector.autofill",this._onAutofill),t.selector.addEventListener("grid.selector.move",this._onSelectorMove),t.addEventListener("dblclick",this._onDblClick),t.addEventListener("grid.edit",this._onEdit)}}class Jx{get vScrolling(){return this._vScrolling}get hScrolling(){return this._hScrolling}get model(){return this.grid.model}get selection(){return this.grid.selection}get table(){return this.grid.table}constructor(t){this.grid=t,this.requireVerticalUpdate=!0,this.requireHorizontalUpdate=!1,this.resizing=!1,this._vScrolling=!0,this._hScrolling=!0,this.debounceRenderCells=q(this.renderCells,50,{isImmediate:!1,maxWait:100}),this.debounceCalculateViewport=q(this.calculateViewport,200)}isLastRowInViewport(){const t=this.grid.table.viewport.rows,e=this.model.visibleRows;return t[t.length-1]==e[e.length-1]}renderCells(t){t=t||{vertical:this.requireVerticalUpdate,horizontal:this.requireHorizontalUpdate},this.grid.comment.deatach(),this.grid.table.renderCells(t),this.requireHorizontalUpdate=!1,this.requireVerticalUpdate=!1,this.debounceCalculateViewport(),this.grid.objects.updatePostions()}renderAll(t=!1){this.grid.group?this.grid.group.grids.forEach((e=>e.rendering.render(t))):this.render(t)}async render(t=!1){this.grid.table&&this.model&&(this.grid.table.clearHeaderCache(),this.grid.table.clearBodyCache(),this.grid.table.isConnected&&(t&&(this.grid.table.requestUpdate(),await this.grid.table.updateComplete),this.grid.table.renderCells({horizontal:!0,vertical:!0}),this.calculateViewport()))}updateRange(t,e=!1){for(const i of this.model.getRangeIterator(t))this.updateCells([i],e)}updateCell(t,e=!1){this.updateCells([t],e)}updateSpilledCells(t){let e;t.prevSpillRange&&(e=new Set,this.model.getRangeIterator(t.prevSpillRange).forEach((t=>e.add(t)))),t.spillRange&&(e=e||new Set,this.model.getRangeIterator(t.spillRange).forEach((t=>e.add(t)))),e?.size>0&&this.updateCells(e)}updateCells(t,e=!1){if(e)for(const e of t)e.invalidateStyle(),e.invalidateValue(),this.model.calculations.clearDependecies(e).evaluate(e),this.updateSpilledCells(e);const i=this.grid.table;for(const e of t)i.renderBodyCell(e);e&&(this.model.calculations.invalidateDependants(t).forEach(((t,e)=>{t?this.grid.group.getGrid(t)?.table.renderBodyCell(e):i.renderBodyCell(e),this.updateSpilledCells(e)})),this.grid.dispatchGridEvent("calculate",{cells:Array.from(t)}))}updateHeaders(){this.model.indexVisibleColumns(),this.table.clearHeaderCache(),this.table.createHeaderRows(),this.table.renderHeader()}calculateViewport(t=!1){this.grid.logger.info("calculate viwport"),this.updateCells(this.model.calculateViewport(),t)}updateSliders(){const t=this.table.viewportSize;this.grid.vSlider.maxValue=this.model.visibleRows.length,this.grid.vSlider.pageSize=t.h/this.model.options.rowHeight,this.grid.vSlider.value=this.table.rowOffset,this.grid.hSlider.maxValue=this.model.visibleColumns.length,this.grid.hSlider.pageSize=t.w/this.model.options.columnWidth,this.grid.hSlider.value=this.table.colOffset}isVerticalScrollingEnabled(){return!1!==this.grid.options.scrolling.verticalOverscroll||this.table.viewport.rows.length<this.model.visibleRows.length}isHorizontalScrollingEnabled(){return!1!==this.grid.options.scrolling.horizontalOverscroll||this.table.viewport.columns.length<this.model.visibleColumns.length}updateSliderVisibility(){this._vScrolling=this.isVerticalScrollingEnabled(),this._vScrolling?(this.grid.vSlider.show(),xt(this.grid.vSlider)):(this.grid.vSlider.hide(),kt(this.grid.vSlider)),this._hScrolling=this.isHorizontalScrollingEnabled(),this._hScrolling?(this.grid.hSlider.show(),xt(this.grid.hSlider)):(this.grid.hSlider.hide(),kt(this.grid.hSlider))}hideSliders(){this.grid.vSlider.hide(),this.grid.hSlider.hide()}scrollVerticalByPixels(t){if(!this.vScrolling)return;let e,i=this.table.rowOffset,o=0,r=0;if(t>0){for(;o<t&&i+r<this.model.visibleRows.length;)o+=this.model.visibleRows[i+r++].height+2;i+=r}else if(t<0){for(t=Math.abs(t);o<t&&i+r>=0;)e=this.model.visibleRows[Math.min(this.model.visibleRows.length-1,i+r--)],o+=(e?e.height:0)+2;i+=r}i>=this.model.visibleRows.length&&(i=this.model.visibleRows.length-1),this.requireVerticalUpdate=!0,this.table.rowOffset=Math.max(0,i),this.debounceRenderCells(),this.updateSliders()}scrollHorizontalByPixels(t){if(!this.hScrolling)return;let e=this.table.colOffset,i=0,o=0;if(t>0){for(;i<t&&e+o<this.model.visibleColumns.length;)i+=this.model.visibleColumns[e+o++].width+2;e+=o}else if(t<0){for(t=Math.abs(t);i<t&&e+o>=0;)i+=this.model.visibleColumns[Math.min(this.model.visibleColumns.length-1,e+o--)].width+2;e+=o}e>=this.model.visibleColumns.length&&(e=this.model.visibleColumns.length-1),this.requireHorizontalUpdate=!0,this.table.colOffset=Math.max(0,e),this.debounceRenderCells(),this.updateSliders()}updateCellSelectionRange(){const t=this.table;for(const e of this.model.getRangeIterator(this.selection.range,!1))t.renderBodyCell(e)}getAdapterRequestFilters(){return{offset:0,filter:this.grid.filtering?.filter?Array.from(this.grid.filtering.filter.settings.values()):null,order:this.grid.model?.sorting?.settings}}async toggleRow(t,e=!0){const i=this.model.rows[t];if(i.isLoaded||i.isPartialyLoaded)i.toggleCollapse(!1,this.model.options.unhideRowAfterExpand),this.table.renderCells({vertical:!0});else if(this.grid.adapter){const e=this.table.getRowByModelIndex(t);e&&e.expander&&(e.expander.state="waiting"),i.collapsed=!1;const o=Object.assign(this.getAdapterRequestFilters(),{parent:{r:i.index,props:i.properties}}),[r]=await Promise.all([this.grid.adapter.getRows(o)]);this.model.insertRowData(i,0,r),o.rows=r;const[n]=await Promise.all([this.grid.adapter.getCells(o)]);n?.map((t=>this.model.getCellByCoords(t.r,t.c)?.update(t))),this.table.requestUpdate()}this.updateSliders(),e&&this.grid.dispatchEvent(new qx("row.toggle",{grid:this.grid,row:i}))}toggleColumn(t,e=!0){const i=this.model.columns[t];i.toggleCollapse(!1,this.model.options.unhideColumnAfterExpand),this.table.renderCells({horizontal:!0}),this.updateSliders(),e&&this.grid.dispatchEvent(new qx("column.toggle",{grid:this.grid,column:i}))}setRowExpandLevel(t){this.model.setRowExpandLevel(t),this.table.rowOffset=0,this.table.renderCells({vertical:!0}),this.updateSliders(),this.grid.dispatchEvent(new qx("row.toggle",{grid:this.grid}))}setColumnExpandLevel(t){this.model.setColumnExpandLevel(t),this.table.colOffset=0,this.table.renderCells({horizontal:!0}),this.updateSliders(),this.grid.dispatchEvent(new qx("column.toggle",{grid:this.grid}))}async exportHTML(){const t=yt("div");kt(t),document.body.appendChild(t);const e=yt("og-table");e.grid=this.grid,e.model=this.model,e.renderAll=!0,t.appendChild(e),await e.updateComplete;const i=this.model.options?.print?.rowBreaks,o=e.table,r=i&&i.length>0;if(r){const t=o.querySelector("colgroup"),r=[...o.tBodies[0].rows],n=this.model.options?.print?.rowTitles?_v.fromA1(this.model.options?.print?.rowTitles):null,s=n?Array.from({length:n.r2-n.r1+1},((t,i)=>r[e.rowMap.get(n.r1+i)])):[];for(let o=0;o<i.length;o++){const n=yt("table");n.appendChild(t.cloneNode(!0));const a=yt("tbody");n.appendChild(a);const l=e.rowMap.get(i[o]),c=o<i.length-1?e.rowMap.get(i[o+1]):this.model.visibleRows.length-1;s.forEach((t=>a.appendChild(t.cloneNode(!0))));for(let t=l;t<=c;t++)a.appendChild(r[t]);e.shadowRoot.appendChild(n)}t.cloneNode(!0)}const n=`\n\t\t\t<style>\n\t\t\t\thtml {\n\t\t\t\t\t${Ba(Xa().themes.get("light")).cssText}\n\t\t\t\t}\n\t\t\t\t${r?"table {break-after: page}":""}\n\t\t\t\t${Vx.styles.map((t=>t.cssText)).join("\n")}\n\t\t\t</style>\n\n\t\t`,s=n+e.shadowRoot.innerHTML.replace(/<!---->/g,"");return t.remove(),s}stopAutoscroll(){this.autoscrollTimer&&window.clearInterval(this.autoscrollTimer)}startAutoscroll(){this.stopAutoscroll(),this.autoscrollTimer=window.setInterval((()=>{if(0==this.autoscrollValue)return this.stopAutoscroll();const t=Math.pow(this.autoscrollValue,rv.AUTOSCROLL_RATIO);switch(this.autoscrollDirection){case"down":this.scrollVerticalByPixels(t);break;case"up":this.scrollVerticalByPixels(-t);break;case"left":this.scrollHorizontalByPixels(-t);break;case"right":this.scrollHorizontalByPixels(t)}}),rv.AUTOSCROLL_INTERVAL)}autoscroll(t){const{x:e,y:i}=t,o=this.table.clientWidth/this.table.zoom-this.table.totalHeaderWidth,r=this.table.clientHeight/this.table.zoom-this.table.totalHeaderHeight;let n,s=0;e<rv.AUTOSCROLL_TRESHOLD&&e<i&&e<r-i?(n="left",s=rv.AUTOSCROLL_TRESHOLD-e):o-e<rv.AUTOSCROLL_TRESHOLD&&o-e<i&&o-e<r-i?(n="right",s=rv.AUTOSCROLL_TRESHOLD-o+e):i<rv.AUTOSCROLL_TRESHOLD?(n="up",s=rv.AUTOSCROLL_TRESHOLD-i):r-i<rv.AUTOSCROLL_TRESHOLD&&(n="down",s=rv.AUTOSCROLL_TRESHOLD-r+i),this.autoscrollDirection=n,this.autoscrollValue=s,this.stopAutoscroll(),s>0&&this.startAutoscroll()}async load(t){t=t||this.getAdapterRequestFilters();const e=t.parent?.r??null,i=null!=e?this.model.rows[e]:this.model.rowRoot,[o]=await Promise.all([this.grid.adapter.getRows(t)]);o.length>0&&null===e&&this.model.insertRowData(i,t.offset,o);const[r]=await Promise.all([this.grid.adapter.getCells(t)]);r?.map((t=>this.model.getCellByCoords(t.r,t.c)?.update(t))),this.table.requestUpdate(),o.length>=this.model.options.pageSize?i.count=1/0:i.count=i.children.length,this.grid.logger.info(`loaded ${o.length} rows`),this.grid.loading=!1,this.grid.dispatchEvent(new qx("afterLoad",{grid:this.grid}))}async loadNextPage(t=null,e=!1){if(this.grid.loading)return;const i=null!=t?this.model.rows[t]:this.model.rowRoot;if(!e&&i.isLoaded)return;this.grid.dispatchEvent(new qx("beforeLoad",{grid:this.grid})),this.grid.loading=!0;const o=this.model.rows.length;this.grid.logger.info(`loading rows offset = ${o}`),await this.load(Object.assign(this.getAdapterRequestFilters(),{offset:o,parent:{r:t,props:null}}))}get totalSize(){return{width:this.table.totalHeaderWidth+this.model.visibleColumns.reduce(((t,e)=>t+e.width),0),height:this.table.thead.offsetHeight+this.model.visibleRows.reduce(((t,e)=>t+e.height),0)}}autofitColumn(t,e=!1,i=!0){const o="number"==typeof t?this.model.columns[t]:t,r=this.autofitDiv??(this.autofitDiv=yt("div"));r.style.position="absolute",r.style.zIndex="100000",Ht(r,{l:-1e3,t:-1e3}),this.grid.shadowRoot.appendChild(r);let n=0;for(const t of this.model.getRangeIterator(_v.fromA1(o.address),!!e)){const e=zC(t).call(this.table,r,t)||r;e.style.width="auto",n=Math.max(n,e.offsetWidth)}if(o.header){for(const t of o.header)t&&(t.html?r.innerHTML=t.label??"":r.innerText=t.label??"",n=Math.max(n,r.offsetWidth));r.innerHTML=""}o.width=n+22,i&&this.table.renderCells({horizontal:!0})}autofitColumns(t=!1){this.model.columns.forEach((e=>this.autofitColumn(e,t,!1))),this.table.renderCells({horizontal:!0})}autofitRow(t,e=!1,i=!0){const o="number"==typeof t?this.model.rows[t]:t,r=this.autofitDiv??(this.autofitDiv=yt("div"));r.style.position="absolute",r.style.zIndex="100000",Ht(r,{l:-1e3,t:-1e3}),this.grid.shadowRoot.appendChild(r);let n=0;for(const t of this.model.getRangeIterator(_v.fromA1(o.address),!!e)){const e=zC(t).call(this.table,r,t)||r;e.style.height="auto",n=Math.max(n,e.offsetHeight)}o.height=n+8,i&&this.table.renderCells({vertical:!0})}autofitRows(t=!1){this.model.rows.forEach((e=>this.autofitRow(e,t,!1))),this.table.renderCells({vertical:!0})}scrollTo(t,e=0){let i;i=Q(t)?_v.fromA1(t):new _v(e,t),this.table.rowOffset=i.r1,this.table.colOffset=i.c1,this.requireVerticalUpdate=!0,this.requireHorizontalUpdate=!0,this.debounceRenderCells(),this.updateSliders()}}class tk{get model(){return this.grid.model}get selection(){return this.grid.editing.isFormulaMode?this.formulaSelection:this.grid.selection}get selector(){return this.grid.editing.isFormulaMode?this.grid.formulaSelector:this.grid.selector}get formulaSelection(){return this._formulaSelection}get events(){return this.grid.events}get table(){return this.grid.table}get isSelecting(){return this.isCellSelecting||this.columnSelecting||this.rowSelecting}get isCellSelecting(){return this.selector.isSelecting}get isAutofilling(){return this.selector.isAutofilling}get isMoving(){return this.selector.isMoving}get isSelectorOperationActive(){return this.selector.isSelectorOperationActive}get isFormulaSelectorOperationActive(){if(!this.grid.editing.isFormulaMode)return!1;for(const t of this.formulaSelectors.values())if(t.isSelectorOperationActive)return!0;return!1}get activeCell(){const{c:t,r:e}=this.selection.activeCellCoords;return this.model.rows[e]?.cell(t)}constructor(t){this.grid=t,this.columnSelecting=!1,this.rowSelecting=!1,this._formulaSelection=new Ix(0,0,0,0),this.formulaSelectors=new Map,this.debounceMoveSelector=q(((t,e)=>this.moveSelector(t,e)),10)}moveToSelection(){const t=new _v(this.selection.range.c1,this.selection.range.r1);this.table.viewportRange.contains(t)}select(t,e=!1){this.selection.setRange(t),this.updateSelector(),e&&this.grid.dispatchEvent(new qx("select",{grid:this.grid}))}startCellSelecting(t){this.grid.style.cursor="cell",this.startSelectingRange=t.clone(),this.select(t,!0),this.selector.startSelecting(t)}startColumnSelecting(t){this.columnSelecting=!0;const e=new _v(t,null,t,null);this.startSelectingRange=e.clone(),this.select(e,!0)}startRowSelecting(t){this.rowSelecting=!0;const e=new _v(null,t,null,t);this.startSelectingRange=e.clone(),this.select(e,!0)}updateSelecting(t,e){const i=this.model.options.selecting.multiSelect;(this.isCellSelecting||this.rowSelecting)&&(i||(this.selection.range.r1=e),this.selection.range.r2=e),(this.isCellSelecting||this.columnSelecting)&&(i||(this.selection.range.c1=t),this.selection.range.c2=t),this.grid.editing.isFormulaMode?(this.updateFormulaSelector(),this.formulaSelectors.forEach((i=>i.updateMovingOperations(t,e)))):(this.updateSelector(),this.hideFormulaSelector(),this.selector.updateMovingOperations(t,e))}stopSelecting(){this.grid.rendering.stopAutoscroll(),this.isSelecting&&!this.selection.range.equals(this.startSelectingRange)&&this.grid.dispatchEvent(new qx("select",{grid:this.grid})),this.columnSelecting=!1,this.rowSelecting=!1,this.startSelectingRange=null,this.selector.stopSelectorOperations()}highlightSelection(){const t=this.selection.range,[e,i]=[Math.min(t.c1,t.c2),Math.max(t.c1,t.c2)],[o,r]=[Math.min(t.r1,t.r2),Math.max(t.r1,t.r2)],n=i-e+1,s=r-o+1;this.table.highlightColHeaderCells(n<1/0?Array.from(new Array(n),((t,i)=>i+e)):[]),this.table.highlightRowHeaderCells(s<1/0?Array.from(new Array(s),((t,e)=>e+o)):[])}updateSelector(t=!0){this.model.options.selecting.enabled?(this.showSelector(t),this.highlightSelection()):this.hideSelector(),this.grid.editing.isFormulaMode||this.grid.editing.endEdit()}showSelector(t=!0){this.selector&&(this.selector.show(),this.selector.select(this.selection.range,t))}hideSelector(){this.selector.hide()}moveSelector(t,e){if(this.selection.move(t,e,this.model.columns.length,this.model.rows.length),0!=e&&!this.model.rows[this.selection.range.r1].visible){const t=e>0?this.model.rows[this.selection.range.r1].nextVisible:this.model.rows[this.selection.range.r1].prevVisible;t&&(this.selection.range.r1=t.index,this.selection.range.r2=t.index)}if(0!=t&&!this.model.columns[this.selection.range.c1].visible){const e=t>0?this.model.columns[this.selection.range.c1].nextVisible:this.model.columns[this.selection.range.c1].prevVisible;e&&(this.selection.range.c1=e.index,this.selection.range.c2=e.index)}this.selector.selection=this.selection.range,this.selector.updatePosition();const i={c:0,r:0};(e>0&&this.selector.offsetTop+this.selector.offsetHeight>this.grid.clientHeight||e<0&&this.selector.offsetTop<this.table.totalHeaderHeight-1||e>=this.table.viewport.rows.length)&&(i.r+=e),(t>0&&this.selector.offsetLeft+this.selector.offsetWidth>this.grid.clientWidth||t<0&&this.selector.offsetLeft<this.table.totalHeaderWidth-1)&&(i.c+=t),0==i.c&&0==i.r||(this.table.colOffset=Math.max(0,this.table.colOffset+i.c),this.table.rowOffset=Math.min(Math.max(0,this.table.rowOffset+i.r),this.model.visibleRows.length-1),this.table.renderCells({horizontal:0!=i.c,vertical:0!=i.r}),this.grid.rendering.updateSliders()),this.grid.editing.isFormulaMode||this.grid.editing.endEdit(),this.highlightSelection(),this.grid.dispatchEvent(new qx("select",{grid:this.grid}))}shiftActiveCell(t,e=!1){this.selection.moveActiveCell(t,0),this.selector.updatePosition(),e&&this.grid.dispatchEvent(new qx("select",{grid:this.grid}))}updateFormulaSelector(t=!0){this.grid.editing.isFormulaMode?this.showFormulaSelector(t):this.hideFormulaSelector()}showFormulaSelector(t=!0){this.grid.formulaSelector.show(),this.grid.formulaSelector?.select(this.formulaSelection.range,t)}hideFormulaSelector(){this.grid.formulaSelector.hide()}updateFormulaSelectors(){this.formulaSelectors.forEach((t=>t.updatePosition()))}highlightColorItem(t){const e=Ix.fromRange(_v.fromA1(t.address)),i=yt("og-selector");this.grid.shadowRoot.appendChild(i),i.addEventListener("grid.selector.move",(t=>this.select(t.selector.selection.clone()))),i.addEventListener("grid.selector.resize",(t=>this.select(t.selector.selection.clone()))),i.grid=this.grid,i.color=t.color,i.subselector=!1,i.movable=!0,i.resizable=!0,i.index=t.tokenIndex,this.formulaSelectors.set(t.tokenIndex,i),i.select(e.range.clone(),!1),i.show()}highlightFormula(t){this.removeFormulaHighlight(),this.formulaSelectors.clear();const e=new Set;t.colors.forEach((t=>{if(null==t.sheet||t.sheet==this.model.name)this.highlightColorItem(t);else if(this.grid.group){const i=this.grid.group.getGrid(t.sheet);if(!i)return;e.has(i)||(e.add(i),i.selecting.removeFormulaHighlight()),i.isConnected&&i.selecting.highlightColorItem(t)}}))}removeFormulaHighlight(){this.formulaSelectors?.forEach((t=>zt(t))),this.formulaSelectors.clear()}updateCopySelector(){this.grid.copySelector.isVisible&&this.grid.copySelector.updatePosition()}showCopySelector(){this.grid.copySelector.show(),this.grid.copySelector?.select(this.selection.range.clone(),!1)}hideCopySelector(){this.grid.copySelector.hide()}updateSelectors(){this.updateSelector(!1),this.updateCopySelector(),this.updateFormulaSelectors()}stopSelectOperations(){this.stopSelecting(),this.formulaSelectors.forEach((t=>t.stopSelectorOperations())),this.grid.style.removeProperty("cursor")}enter(){const t=this.grid.group;if(this.grid.editing.isFormulaMode&&t){const e=t.formulaModeGrid;e.editing.commitEdit(),t.activateGrid(e.model.name)}else this.debounceMoveSelector(0,1)}}class ek extends Event{}class ik extends zs{get isOpen(){return this._open}get isValid(){return this._valid}validate(){return this._valid=!0,this.activeCell&&(this._valid=aw(this.activeCellModel,this.getValue())),this.classList.toggle("invalid",!this._valid),this._valid}constructor(){super(),this.cancel=!1,this._open=!1,this._valid=!0,this.init()}getDisplayValue(){return null}init(){this.addEventListener("keydown",(t=>{"Enter"==t.key?this.close():"Escape"==t.key?(this.cancel=!0,this.close()):t.stopPropagation()}))}connectedCallback(){super.connectedCallback(),this.performUpdate()}alignWithCell(){if(!this.activeCell)return;const t=Tt(this.activeCell,this.grid);Ht(this,{t:t.top*this.grid.zoom,l:t.left*this.grid.zoom}),Nt(this,{w:this.activeCell.offsetWidth,h:this.activeCell.offsetHeight})}open(t,e=null,i=!0){this._valid=!0,this.initialValue=e,this._open=!0,this.grid=t;const o=t.selecting.activeCell;return this.activeCellModel=o,this.activeCell=this.grid.table.getCellByModelIndex(o.c,o.r),this.grid.selector.hide(),xt(this),i&&this.alignWithCell(),this.activate(o),null!==e&&this.setValue(e),Jt(this,this.grid.zoom),this}commit(){this._open&&!this.cancel&&this.activeCellModel&&(this.grid.editing.updateCell(this.activeCellModel,{v:this.getValue(),dv:this.getDisplayValue()}),this.grid.rendering.updateCell(this.activeCellModel,!0)),this.cancel=!1}close(){this._open&&(this.deactivate(),kt(this),this.grid.table.renderBodyCell(this.activeCellModel),this.grid.selecting.showSelector(),this.grid.focus(),this._open=!1,this.grid.editing.endEdit()),this.cancel=!1}activate(t){this.activeCellModel=t,this.dispatchEvent(new ek("activate"))}deactivate(){this.dispatchEvent(new ek("deactivate"))}}ik.baseStyles=kn`
|
|
4381
4383
|
* { box-sizing: border-box }
|
|
4382
4384
|
|
|
4383
4385
|
:host {
|
|
@@ -9932,4 +9934,4 @@ milkdown-block-handle {
|
|
|
9932
9934
|
`:null}
|
|
9933
9935
|
</div>
|
|
9934
9936
|
</og-panel>
|
|
9935
|
-
`:null,this.addEventListener("mousedown",(t=>t.stopPropagation()))}getTypeIndex(t){const e=this.types.findIndex((e=>e.type==t.type&&e.grouping==(t.grouping||"standard")));return e>-1?e:null}updateModel(){if(this.editTitle=!1,!this.model)return;this.titleInput&&(this.model.title=this.titleInput.value);const t=this.types[this.typeList.value];this.model.type=t.type,this.model.grouping=t.grouping,this.model.categoriesRange=this.categoryRangeInput?.value?_v.fromA1(this.categoryRangeInput.value):null,this.model.seriesRange=this.seriesRangeInput?.value?_v.fromA1(this.seriesRangeInput.value):null,this.model.dataRange=_v.fromA1(this.dataRangeInput.value),this.dispatchEvent(new Xr({value:this.model}))}async updated(){this.editTitle&&this.titleInput&&(await this.titleInput.updateComplete,this.titleInput.focus(),this.titleInput.selectAll())}};RL.styles=[LL],IL([Ts({type:Object})],RL.prototype,"model",void 0),IL([$s()],RL.prototype,"editTitle",void 0),IL([Ds("#title")],RL.prototype,"titleInput",void 0),IL([Ds("#type")],RL.prototype,"typeList",void 0),IL([Ds("#dataRange")],RL.prototype,"dataRangeInput",void 0),IL([Ds("#seriesRange")],RL.prototype,"seriesRangeInput",void 0),IL([Ds("#categoryRange")],RL.prototype,"categoryRangeInput",void 0),RL=IL([Ls("og-plugin-chart-form")],RL);const TL=Xa().themes.get("og-dark");Object.assign(TL.definition,{"highcharts-title-font-size":"16px","highcharts-subtitle-font-size":"14px","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"rgb(48, 48, 48)","highcharts-neutral-color-100":"rgb(255, 255, 255)","highcharts-neutral-color-80":"rgb(214, 214, 214)","highcharts-neutral-color-60":"rgb(173, 173, 173)","highcharts-neutral-color-40":"rgb(133, 133, 133)","highcharts-neutral-color-20":"rgb(92, 92, 92)","highcharts-neutral-color-10":"rgb(71, 71, 71)","highcharts-neutral-color-5":"rgb(61, 61, 61)","highcharts-neutral-color-3":"rgb(57, 57, 57)","highcharts-highlight-color-100":"rgb(122, 167, 255)","highcharts-highlight-color-80":"rgb(108, 144, 214)","highcharts-highlight-color-60":"rgb(94, 121, 173)","highcharts-highlight-color-20":"rgb(65, 74, 92)","highcharts-highlight-color-10":"rgb(58, 63, 71)"});const $L=Xa().themes.get("og-light");Object.assign($L.definition,{"highcharts-title-font-size":"16px","chart-background-color":"#2a2a2b","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"#ffffff","highcharts-neutral-color-100":"#000000","highcharts-neutral-color-80":"#333333","highcharts-neutral-color-60":"#666666","highcharts-neutral-color-40":"#999999","highcharts-neutral-color-20":"#cccccc","highcharts-neutral-color-10":"#e6e6e6","highcharts-neutral-color-5":"#f2f2f2","highcharts-neutral-color-3":"#f7f7f7","highcharts-highlight-color-100":"#0022ff","highcharts-highlight-color-80":"#334eff","highcharts-highlight-color-60":"#667aff","highcharts-highlight-color-20":"#ccd3ff","highcharts-highlight-color-10":"#e6e9ff","highcharts-positive-color":"#06b535","highcharts-negative-color":"#f21313","highcharts-annotation-color-0":"rgba(130, 170, 255, 0.4)","highcharts-annotation-color-1":"rgba(139, 191, 216, 0.4)","highcharts-annotation-color-2":"rgba(150, 216, 192, 0.4)","highcharts-annotation-color-3":"rgba(156, 229, 161, 0.4)","highcharts-annotation-color-4":"rgba(162, 241, 130, 0.4)","highcharts-annotation-color-5":"rgba(169, 255, 101, 0.4)"});var AL=i(6946),DL=i(6471),OL=i(4969),NL=i(9502),PL=i(7706),jL=i(1480),HL=i(2006),FL=i(7503),BL=i(7873),WL=i(8746),VL=i(2570),UL=i(8815),GL=i(6390),qL=i(6593),YL=i(895),ZL=i(9083),XL=i(6093),QL=i(9685),KL=i(9849),JL=i(8268),tI=i(4693),eI=i(3599),iI=i(782),oI=i(754),rI=i(5700),nI=i(4731),sI=i(7291),aI=i(597),lI=i(1474),cI=i(6224),hI=i(6239),dI=i(6828),uI=i(2212),pI=i(863),gI=i(3602),mI=i(1985),fI=i(886),vI=i(7201),bI=i(9937),yI=i(8450),wI=i(9630),xI=i(9766),kI=i(388),CI=i(1903),MI=i(398),_I=i(6105),SI=i(6147),zI=i(5722),EI=i(5576),LI=i(3131),II=i(6308),RI=i(9645),TI=i(3199),$I=i(871),AI=i(5251),DI=i(6426),OI=i(2643),NI=i(8522),PI=i(6398),jI=i(2525),HI=i(8434),FI=i(6138),BI=i(5835),WI=i(5654),VI=i(6659),UI=i(2977),GI=i(4480),qI=i(9886),YI=i(6815),ZI=i(1582),XI=i(2968),QI=i(394),KI=i(7024),JI=i(7853),tR=i(8249),eR=i(2869),iR=i(486),oR=i(5735),rR=i(470),nR=i(4612),sR=i(4018),aR=i(1476),lR=i(3194),cR=i(3525),hR=i(7541),dR=i(4104),uR=i(6686),pR=i(7719),gR=i(3898),mR=i(8153),fR=i(3690),vR=i(1776),bR=i(4980),yR=i(5578),wR=i(9613),xR=i(1119),kR=i(8444),CR=i(2978),MR=i(9130),_R=i(2127),SR=i(2732),zR=i(4287),ER=i(4045),LR=i(7642),IR=i(1367),RR=i(320),TR=i(821),$R=i(102),AR=i(7683),DR=i(3980),OR=i(576),NR=i(654),PR=i(73),jR=i(140),HR=i(8129),FR=i(5087),BR=i(6992),WR=i(8247),VR=i(8038),UR=i(5286),GR=i(9179),qR=i(1808),YR=i(9459),ZR=i(2883),XR=i(9124),QR=i(7067),KR=i(1054),JR=i(7325),tT=i(1272),eT=i(3359),iT=i(6562),oT=i(4193),rT=i(6348),nT=i(2435),sT=i(7544),aT=i(4470),lT=i(9111),cT=i(9318),hT=i(7294),dT=i(4479),uT=i(2409),pT=i(3091),gT=i(5789),mT=i(5890),fT=i(3874),vT=i(2907),bT=i(1175),yT=i(1686),wT=i(703),xT=i(6606),kT=i(4194),CT=i(6228),MT=i(62),_T=i(2072),ST=i(9744),zT=i(25),ET=i(2618),LT=i(1988),IT=i(8013),RT=i(1133),TT=i(362),$T=i(6845),AT=i(6800),DT=i(1103),OT=i(4933),NT=i(7284),PT=i(2620),jT=i(2366),HT=i(7457),FT=i(2449),BT=i(2),WT=i(5697),VT=i(7069),UT=i(4716),GT=i(4740),qT=i(4557),YT=i(1868),ZT=i(8647),XT=i(5127),QT=i(4816),KT=i(4009),JT=i(5104),t$=i(2830),e$=i(3093),i$=i(5029),o$=i(3514),r$=i(2142),n$=i(4999),s$=i(7523),a$=i(346),l$=i(7917),c$=i(3976),h$=i(9801),d$=i(2464),u$=i(5511),p$=i(5210),g$=i(5815),m$=i(3339),f$=i(7472),v$=i(8811),b$=i(8548),y$=i(6880),w$=i(1840),x$=i(5547),k$=i(4788),C$=i(9467),M$=i(9187),_$=i(9217),S$=i(7897),z$=i(2644),E$=i(6204),L$=i(1472),I$=i(1247),R$=i(7406),T$=i(925),$$=i(7455),A$=i(3771),D$=i(1549),O$=i(3541),N$=i(3140),P$=i(9800),j$=i(229),H$=i(2677),F$=i(1844),B$=i(3245),W$=i(9056),V$=i(7535),U$=i(2359),G$=i(15),q$=i(5569),Y$=i(2014),Z$=i(1599),X$=i(6521),Q$=i(232),K$=i(9745),J$=i(9594),tA=i(6979),eA=i(4494),iA=i(312),oA=i(4983),rA=i(1258),nA=i(6313),sA=i(12),aA=i(8003),lA=i(7830),cA=i(8875),hA=i(3911),dA=i(1817),uA=i(478),pA=i(2585),gA=i(6564),mA=i(2884),fA=i(3825),vA=i(7348),bA=i(9277),yA=i(4118),wA=i(9200),xA=i(51),kA=i(2872),CA=i(4702),MA=i(9281),_A=i(1394),SA=i(7295),zA=i(2936),EA=i(3789),LA=i(3614),IA=i(4827),RA=i(9204),TA=i(9113),$A=i(4058),AA=i(9939),DA=i(1139);const OA=[AL.mw,DL.mw,OL.mw,NL.mw,PL.mw,jL.mw,HL.mw,FL.mw,WL.mw,UL.mw,VL.mw,GL.mw,qL.mw,YL.mw,ZL.mw,XL.mw,QL.mw,KL.mw,JL.mw,tI.mw,eI.mw,iI.mw,oI.mw,rI.mw,nI.mw,sI.mw,aI.mw,lI.mw,cI.mw,dI.mw,uI.mw,pI.mw,gI.mw,mI.mw,fI.mw,vI.mw,bI.mw,yI.mw,wI.mw,xI.mw,kI.mw,CI.mw,_I.mw,MI.mw,SI.mw,zI.mw,EI.mw,LI.mw,II.mw,RI.mw,TI.mw,$I.mw,AI.mw,DI.mw,OI.mw,NI.mw,jI.mw,HI.mw,FI.mw,BI.mw,WI.mw,VI.mw,UI.mw,GI.mw,qI.mw,YI.mw,ZI.mw,XI.mw,QI.mw,KI.mw,JI.mw,tR.mw,eR.mw,iR.mw,oR.mw,PI.mw,rR.mw,nR.mw,sR.mw,aR.mw,lR.mw,cR.mw,hR.mw,dR.mw,uR.mw,pR.mw,gR.mw,mR.mw,fR.mw,vR.mw,bR.mw,yR.mw,wR.mw,xR.mw,kR.mw,CR.mw,MR.mw,_R.mw,SR.mw,zR.mw,ER.mw,LR.mw,IR.mw,RR.mw,TR.mw,$R.mw,AR.mw,DR.mw,OR.mw,NR.mw,PR.mw,jR.mw,HR.mw,FR.mw,BR.mw,WR.mw,VR.mw,hI.mw,UR.mw,GR.mw,qR.mw,YR.mw,ZR.mw,XR.mw,QR.mw,KR.mw,JR.mw,tT.mw,eT.mw,iT.mw,oT.mw,rT.mw,nT.mw,BL.mw,sT.mw,aT.mw],NA=[lT.mw,cT.mw,hT.mw,dT.mw,uT.mw,pT.mw,gT.mw,mT.mw,vT.mw,yT.mw,bT.mw,xT.mw,wT.mw,kT.mw,CT.mw,MT.mw,_T.mw,ST.mw,zT.mw,ET.mw,LT.mw,IT.mw,DT.mw,OT.mw,NT.mw,PT.mw,jT.mw,HT.mw,FT.mw,WT.mw,VT.mw,UT.mw,XT.mw,QT.mw,KT.mw,JT.mw,t$.mw,e$.mw,i$.mw,o$.mw,RT.mw,TT.mw,AT.mw,$T.mw,r$.mw,n$.mw,s$.mw,a$.mw,l$.mw,c$.mw,h$.mw,d$.mw,GT.mw,qT.mw,YT.mw,ZT.mw,p$.mw,g$.mw,m$.mw,f$.mw,v$.mw,b$.mw,y$.mw,w$.mw,x$.mw,k$.mw,C$.mw,M$.mw,_$.mw,S$.mw,z$.mw,E$.mw,L$.mw,I$.mw,R$.mw,u$.mw,T$.mw,$$.mw,A$.mw,D$.mw,O$.mw,N$.mw,P$.mw,j$.mw,H$.mw,F$.mw,B$.mw,W$.mw,V$.mw,U$.mw,G$.mw,q$.mw,Y$.mw,Z$.mw,X$.mw,Q$.mw,K$.mw,J$.mw,tA.mw,eA.mw,iA.mw,oA.mw,rA.mw,nA.mw,sA.mw,aA.mw,lA.mw,cA.mw,hA.mw,dA.mw,uA.mw,pA.mw,gA.mw,mA.mw,fA.mw,vA.mw,bA.mw,BT.mw,yA.mw,wA.mw,xA.mw,kA.mw,CA.mw,MA.mw,_A.mw,SA.mw,zA.mw,EA.mw,LA.mw,IA.mw,RA.mw,TA.mw,$A.mw,fT.mw,AA.mw,DA.mw],PA={xlsx:F,charts:B},jA={name:"@omegagrid/bundle",version:"0.10.
|
|
9937
|
+
`:null,this.addEventListener("mousedown",(t=>t.stopPropagation()))}getTypeIndex(t){const e=this.types.findIndex((e=>e.type==t.type&&e.grouping==(t.grouping||"standard")));return e>-1?e:null}updateModel(){if(this.editTitle=!1,!this.model)return;this.titleInput&&(this.model.title=this.titleInput.value);const t=this.types[this.typeList.value];this.model.type=t.type,this.model.grouping=t.grouping,this.model.categoriesRange=this.categoryRangeInput?.value?_v.fromA1(this.categoryRangeInput.value):null,this.model.seriesRange=this.seriesRangeInput?.value?_v.fromA1(this.seriesRangeInput.value):null,this.model.dataRange=_v.fromA1(this.dataRangeInput.value),this.dispatchEvent(new Xr({value:this.model}))}async updated(){this.editTitle&&this.titleInput&&(await this.titleInput.updateComplete,this.titleInput.focus(),this.titleInput.selectAll())}};RL.styles=[LL],IL([Ts({type:Object})],RL.prototype,"model",void 0),IL([$s()],RL.prototype,"editTitle",void 0),IL([Ds("#title")],RL.prototype,"titleInput",void 0),IL([Ds("#type")],RL.prototype,"typeList",void 0),IL([Ds("#dataRange")],RL.prototype,"dataRangeInput",void 0),IL([Ds("#seriesRange")],RL.prototype,"seriesRangeInput",void 0),IL([Ds("#categoryRange")],RL.prototype,"categoryRangeInput",void 0),RL=IL([Ls("og-plugin-chart-form")],RL);const TL=Xa().themes.get("og-dark");Object.assign(TL.definition,{"highcharts-title-font-size":"16px","highcharts-subtitle-font-size":"14px","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"rgb(48, 48, 48)","highcharts-neutral-color-100":"rgb(255, 255, 255)","highcharts-neutral-color-80":"rgb(214, 214, 214)","highcharts-neutral-color-60":"rgb(173, 173, 173)","highcharts-neutral-color-40":"rgb(133, 133, 133)","highcharts-neutral-color-20":"rgb(92, 92, 92)","highcharts-neutral-color-10":"rgb(71, 71, 71)","highcharts-neutral-color-5":"rgb(61, 61, 61)","highcharts-neutral-color-3":"rgb(57, 57, 57)","highcharts-highlight-color-100":"rgb(122, 167, 255)","highcharts-highlight-color-80":"rgb(108, 144, 214)","highcharts-highlight-color-60":"rgb(94, 121, 173)","highcharts-highlight-color-20":"rgb(65, 74, 92)","highcharts-highlight-color-10":"rgb(58, 63, 71)"});const $L=Xa().themes.get("og-light");Object.assign($L.definition,{"highcharts-title-font-size":"16px","chart-background-color":"#2a2a2b","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"#ffffff","highcharts-neutral-color-100":"#000000","highcharts-neutral-color-80":"#333333","highcharts-neutral-color-60":"#666666","highcharts-neutral-color-40":"#999999","highcharts-neutral-color-20":"#cccccc","highcharts-neutral-color-10":"#e6e6e6","highcharts-neutral-color-5":"#f2f2f2","highcharts-neutral-color-3":"#f7f7f7","highcharts-highlight-color-100":"#0022ff","highcharts-highlight-color-80":"#334eff","highcharts-highlight-color-60":"#667aff","highcharts-highlight-color-20":"#ccd3ff","highcharts-highlight-color-10":"#e6e9ff","highcharts-positive-color":"#06b535","highcharts-negative-color":"#f21313","highcharts-annotation-color-0":"rgba(130, 170, 255, 0.4)","highcharts-annotation-color-1":"rgba(139, 191, 216, 0.4)","highcharts-annotation-color-2":"rgba(150, 216, 192, 0.4)","highcharts-annotation-color-3":"rgba(156, 229, 161, 0.4)","highcharts-annotation-color-4":"rgba(162, 241, 130, 0.4)","highcharts-annotation-color-5":"rgba(169, 255, 101, 0.4)"});var AL=i(6946),DL=i(6471),OL=i(4969),NL=i(9502),PL=i(7706),jL=i(1480),HL=i(2006),FL=i(7503),BL=i(7873),WL=i(8746),VL=i(2570),UL=i(8815),GL=i(6390),qL=i(6593),YL=i(895),ZL=i(9083),XL=i(6093),QL=i(9685),KL=i(9849),JL=i(8268),tI=i(4693),eI=i(3599),iI=i(782),oI=i(754),rI=i(5700),nI=i(4731),sI=i(7291),aI=i(597),lI=i(1474),cI=i(6224),hI=i(6239),dI=i(6828),uI=i(2212),pI=i(863),gI=i(3602),mI=i(1985),fI=i(886),vI=i(7201),bI=i(9937),yI=i(8450),wI=i(9630),xI=i(9766),kI=i(388),CI=i(1903),MI=i(398),_I=i(6105),SI=i(6147),zI=i(5722),EI=i(5576),LI=i(3131),II=i(6308),RI=i(9645),TI=i(3199),$I=i(871),AI=i(5251),DI=i(6426),OI=i(2643),NI=i(8522),PI=i(6398),jI=i(2525),HI=i(8434),FI=i(6138),BI=i(5835),WI=i(5654),VI=i(6659),UI=i(2977),GI=i(4480),qI=i(9886),YI=i(6815),ZI=i(1582),XI=i(2968),QI=i(394),KI=i(7024),JI=i(7853),tR=i(8249),eR=i(2869),iR=i(486),oR=i(5735),rR=i(470),nR=i(4612),sR=i(4018),aR=i(1476),lR=i(3194),cR=i(3525),hR=i(7541),dR=i(4104),uR=i(6686),pR=i(7719),gR=i(3898),mR=i(8153),fR=i(3690),vR=i(1776),bR=i(4980),yR=i(5578),wR=i(9613),xR=i(1119),kR=i(8444),CR=i(2978),MR=i(9130),_R=i(2127),SR=i(2732),zR=i(4287),ER=i(4045),LR=i(7642),IR=i(1367),RR=i(320),TR=i(821),$R=i(102),AR=i(7683),DR=i(3980),OR=i(576),NR=i(654),PR=i(73),jR=i(140),HR=i(8129),FR=i(5087),BR=i(6992),WR=i(8247),VR=i(8038),UR=i(5286),GR=i(9179),qR=i(1808),YR=i(9459),ZR=i(2883),XR=i(9124),QR=i(7067),KR=i(1054),JR=i(7325),tT=i(1272),eT=i(3359),iT=i(6562),oT=i(4193),rT=i(6348),nT=i(2435),sT=i(7544),aT=i(4470),lT=i(9111),cT=i(9318),hT=i(7294),dT=i(4479),uT=i(2409),pT=i(3091),gT=i(5789),mT=i(5890),fT=i(3874),vT=i(2907),bT=i(1175),yT=i(1686),wT=i(703),xT=i(6606),kT=i(4194),CT=i(6228),MT=i(62),_T=i(2072),ST=i(9744),zT=i(25),ET=i(2618),LT=i(1988),IT=i(8013),RT=i(1133),TT=i(362),$T=i(6845),AT=i(6800),DT=i(1103),OT=i(4933),NT=i(7284),PT=i(2620),jT=i(2366),HT=i(7457),FT=i(2449),BT=i(2),WT=i(5697),VT=i(7069),UT=i(4716),GT=i(4740),qT=i(4557),YT=i(1868),ZT=i(8647),XT=i(5127),QT=i(4816),KT=i(4009),JT=i(5104),t$=i(2830),e$=i(3093),i$=i(5029),o$=i(3514),r$=i(2142),n$=i(4999),s$=i(7523),a$=i(346),l$=i(7917),c$=i(3976),h$=i(9801),d$=i(2464),u$=i(5511),p$=i(5210),g$=i(5815),m$=i(3339),f$=i(7472),v$=i(8811),b$=i(8548),y$=i(6880),w$=i(1840),x$=i(5547),k$=i(4788),C$=i(9467),M$=i(9187),_$=i(9217),S$=i(7897),z$=i(2644),E$=i(6204),L$=i(1472),I$=i(1247),R$=i(7406),T$=i(925),$$=i(7455),A$=i(3771),D$=i(1549),O$=i(3541),N$=i(3140),P$=i(9800),j$=i(229),H$=i(2677),F$=i(1844),B$=i(3245),W$=i(9056),V$=i(7535),U$=i(2359),G$=i(15),q$=i(5569),Y$=i(2014),Z$=i(1599),X$=i(6521),Q$=i(232),K$=i(9745),J$=i(9594),tA=i(6979),eA=i(4494),iA=i(312),oA=i(4983),rA=i(1258),nA=i(6313),sA=i(12),aA=i(8003),lA=i(7830),cA=i(8875),hA=i(3911),dA=i(1817),uA=i(478),pA=i(2585),gA=i(6564),mA=i(2884),fA=i(3825),vA=i(7348),bA=i(9277),yA=i(4118),wA=i(9200),xA=i(51),kA=i(2872),CA=i(4702),MA=i(9281),_A=i(1394),SA=i(7295),zA=i(2936),EA=i(3789),LA=i(3614),IA=i(4827),RA=i(9204),TA=i(9113),$A=i(4058),AA=i(9939),DA=i(1139);const OA=[AL.mw,DL.mw,OL.mw,NL.mw,PL.mw,jL.mw,HL.mw,FL.mw,WL.mw,UL.mw,VL.mw,GL.mw,qL.mw,YL.mw,ZL.mw,XL.mw,QL.mw,KL.mw,JL.mw,tI.mw,eI.mw,iI.mw,oI.mw,rI.mw,nI.mw,sI.mw,aI.mw,lI.mw,cI.mw,dI.mw,uI.mw,pI.mw,gI.mw,mI.mw,fI.mw,vI.mw,bI.mw,yI.mw,wI.mw,xI.mw,kI.mw,CI.mw,_I.mw,MI.mw,SI.mw,zI.mw,EI.mw,LI.mw,II.mw,RI.mw,TI.mw,$I.mw,AI.mw,DI.mw,OI.mw,NI.mw,jI.mw,HI.mw,FI.mw,BI.mw,WI.mw,VI.mw,UI.mw,GI.mw,qI.mw,YI.mw,ZI.mw,XI.mw,QI.mw,KI.mw,JI.mw,tR.mw,eR.mw,iR.mw,oR.mw,PI.mw,rR.mw,nR.mw,sR.mw,aR.mw,lR.mw,cR.mw,hR.mw,dR.mw,uR.mw,pR.mw,gR.mw,mR.mw,fR.mw,vR.mw,bR.mw,yR.mw,wR.mw,xR.mw,kR.mw,CR.mw,MR.mw,_R.mw,SR.mw,zR.mw,ER.mw,LR.mw,IR.mw,RR.mw,TR.mw,$R.mw,AR.mw,DR.mw,OR.mw,NR.mw,PR.mw,jR.mw,HR.mw,FR.mw,BR.mw,WR.mw,VR.mw,hI.mw,UR.mw,GR.mw,qR.mw,YR.mw,ZR.mw,XR.mw,QR.mw,KR.mw,JR.mw,tT.mw,eT.mw,iT.mw,oT.mw,rT.mw,nT.mw,BL.mw,sT.mw,aT.mw],NA=[lT.mw,cT.mw,hT.mw,dT.mw,uT.mw,pT.mw,gT.mw,mT.mw,vT.mw,yT.mw,bT.mw,xT.mw,wT.mw,kT.mw,CT.mw,MT.mw,_T.mw,ST.mw,zT.mw,ET.mw,LT.mw,IT.mw,DT.mw,OT.mw,NT.mw,PT.mw,jT.mw,HT.mw,FT.mw,WT.mw,VT.mw,UT.mw,XT.mw,QT.mw,KT.mw,JT.mw,t$.mw,e$.mw,i$.mw,o$.mw,RT.mw,TT.mw,AT.mw,$T.mw,r$.mw,n$.mw,s$.mw,a$.mw,l$.mw,c$.mw,h$.mw,d$.mw,GT.mw,qT.mw,YT.mw,ZT.mw,p$.mw,g$.mw,m$.mw,f$.mw,v$.mw,b$.mw,y$.mw,w$.mw,x$.mw,k$.mw,C$.mw,M$.mw,_$.mw,S$.mw,z$.mw,E$.mw,L$.mw,I$.mw,R$.mw,u$.mw,T$.mw,$$.mw,A$.mw,D$.mw,O$.mw,N$.mw,P$.mw,j$.mw,H$.mw,F$.mw,B$.mw,W$.mw,V$.mw,U$.mw,G$.mw,q$.mw,Y$.mw,Z$.mw,X$.mw,Q$.mw,K$.mw,J$.mw,tA.mw,eA.mw,iA.mw,oA.mw,rA.mw,nA.mw,sA.mw,aA.mw,lA.mw,cA.mw,hA.mw,dA.mw,uA.mw,pA.mw,gA.mw,mA.mw,fA.mw,vA.mw,bA.mw,BT.mw,yA.mw,wA.mw,xA.mw,kA.mw,CA.mw,MA.mw,_A.mw,SA.mw,zA.mw,EA.mw,LA.mw,IA.mw,RA.mw,TA.mw,$A.mw,fT.mw,AA.mw,DA.mw],PA={xlsx:F,charts:B},jA={name:"@omegagrid/bundle",version:"0.10.29"};Xa().activate("light"),Hd.styleDefault="fal",Fd.add(OA),Fd.add(NA)})(),window.Omegagrid=o})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/bundle",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.29",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Distribution package for Omegagrid library",
|
|
6
6
|
"main": "omegagrid.js",
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
"@fortawesome/fontawesome-svg-core": "^7.0.1",
|
|
20
20
|
"@fortawesome/pro-light-svg-icons": "^7.0.1",
|
|
21
21
|
"@fortawesome/pro-solid-svg-icons": "^7.0.1",
|
|
22
|
-
"@omegagrid/bucket": "^0.10.
|
|
23
|
-
"@omegagrid/calendar": "^0.10.
|
|
24
|
-
"@omegagrid/code": "^0.10.
|
|
25
|
-
"@omegagrid/commands": "^0.10.
|
|
26
|
-
"@omegagrid/core": "^0.10.
|
|
27
|
-
"@omegagrid/dialog": "^0.10.
|
|
28
|
-
"@omegagrid/editor": "^0.10.
|
|
29
|
-
"@omegagrid/form": "^0.10.
|
|
30
|
-
"@omegagrid/grid": "^0.10.
|
|
31
|
-
"@omegagrid/localize": "^0.10.
|
|
32
|
-
"@omegagrid/markdown": "^0.10.
|
|
33
|
-
"@omegagrid/plugin-charts": "^0.10.
|
|
34
|
-
"@omegagrid/plugin-xlsx": "^0.10.
|
|
35
|
-
"@omegagrid/statusbar": "^0.10.
|
|
36
|
-
"@omegagrid/tabs": "^0.10.
|
|
37
|
-
"@omegagrid/toolbar": "^0.10.
|
|
38
|
-
"@omegagrid/tree": "^0.10.
|
|
22
|
+
"@omegagrid/bucket": "^0.10.29",
|
|
23
|
+
"@omegagrid/calendar": "^0.10.29",
|
|
24
|
+
"@omegagrid/code": "^0.10.29",
|
|
25
|
+
"@omegagrid/commands": "^0.10.29",
|
|
26
|
+
"@omegagrid/core": "^0.10.29",
|
|
27
|
+
"@omegagrid/dialog": "^0.10.29",
|
|
28
|
+
"@omegagrid/editor": "^0.10.29",
|
|
29
|
+
"@omegagrid/form": "^0.10.29",
|
|
30
|
+
"@omegagrid/grid": "^0.10.29",
|
|
31
|
+
"@omegagrid/localize": "^0.10.29",
|
|
32
|
+
"@omegagrid/markdown": "^0.10.29",
|
|
33
|
+
"@omegagrid/plugin-charts": "^0.10.29",
|
|
34
|
+
"@omegagrid/plugin-xlsx": "^0.10.29",
|
|
35
|
+
"@omegagrid/statusbar": "^0.10.29",
|
|
36
|
+
"@omegagrid/tabs": "^0.10.29",
|
|
37
|
+
"@omegagrid/toolbar": "^0.10.29",
|
|
38
|
+
"@omegagrid/tree": "^0.10.29",
|
|
39
39
|
"lit": "^3.1.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|