/*! * filename: ej2-grids.min.js * version : 19.1.57 * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ this.ej=this.ej||{},this.ej.grids=function(e,t,i,r,n,o,s,l,a,h,d){"use strict";function p(e,t,i,r){if(r&&e)return void e.removeAttribute(t);e&&e.setAttribute(t,i)}function c(){return["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings","queryCellInfo","beforeDataBound"]}function u(e,t){return e.prototype&&t in e.prototype}function g(e,r,n){return t.isNullOrUndefined(e)||""===e?"":i.DataUtil.getObject(e,r)}function f(e,r){return t.isNullOrUndefined(e)||""===e?"":i.DataUtil.getObject(e,r)}function m(e,t){requestAnimationFrame(function(){try{t(null,e())}catch(e){t(e)}})}function y(e){return!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.columns)&&e.columns.length>0}function v(e,t){for(var i=e.columns,r=t.columns,n=0;n=n)if(r[n].columns)for(var o=0;oe.offsetHeight+10,e.style.top=l.top-s.top+(n?-(e.offsetHeight+10):e.offsetHeight+10)+"px",e.style.left=M(e,i,l,s.left)+"px",n?(e.querySelector(".e-downtail").style.display="",e.querySelector(".e-uptail").style.display="none"):(e.querySelector(".e-downtail").style.display="none",e.querySelector(".e-uptail").style.display="")}function M(e,t,i,r){var n=e.offsetWidth/2,o=P(t).x;return o-i.left1}function W(e){return void 0===e&&(e=""),e.replace(/\./g,"___")}function K(e){return void 0===e&&(e=""),e.replace(/___/g,".")}function Q(e,t,i){var r=O(i,"e-row"),n=!r||r&&!r.classList.contains("e-insertedrow");return"beginEdit"===t&&n?!(e.isIdentity||e.isPrimaryKey||!e.allowEditing):("add"!==t||!e.isIdentity)&&!(n&&!e.allowEditing&&!e.isIdentity&&!e.isPrimaryKey)}function J(e){var i=t.select("#"+e.element.id+"EditConfirm",e.element);return"Batch"===e.editSettings.mode&&t.selectAll(".e-updatedtd",e.element).length&&e.editSettings.showConfirmDialog&&(!i||i.classList.contains("e-popup-close"))}function X(e,t){e=e instanceof Array?e:[e];for(var i=0;i0&&e.isVirtualAdaptive}function ce(e,i){if(void 0===e&&(e=""),e){for(var r=i,n=e.split("."),o=0;on?i.style.height=r+"px":e.style.height=n+"px"}}function Re(e,t){var i=t.getContent().firstElementChild.offsetHeight;return e&&e.getBoundingClientRect().top>i}function Fe(e,t){return e&&e.getBoundingClientRect().topr}function Ie(e,t){var i,r=e.getPrimaryKeyFieldNames()[0];return e.getCurrentViewRecords().filter(function(e,n){e[r]===t[r]&&(i=n)}),i}function Te(e,t){var r;r=Ee(t);var n=new i.Deferred;return r.dataSource=n.resolve,r.action=e,{state:r,deffered:n}}function Ee(e){var t=new i.UrlAdaptor,r=new i.DataManager({url:"",adaptor:new i.UrlAdaptor}),n=t.processQuery(r,e);return JSON.parse(n.data)}function Me(e){for(var i=e.getVisibleColumns(),r=0,n=0,o=0;o=t&&o-1){h[p].isSelected=!0;for(var c=0;c=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},ft=function(){function e(e,r){var n=this;this.disableHtmlEncode=!0,this.allowSorting=!0,this.allowResizing=!0,this.allowFiltering=!0,this.allowGrouping=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.enableGroupByFormat=!1,this.allowEditing=!0,this.filter={},this.showInColumnChooser=!0,this.edit={},this.allowSearching=!0,this.autoFit=!1,this.sortDirection="Descending",this.getEditTemplate=function(){return n.editTemplateFn},this.getFilterTemplate=function(){return n.filterTemplateFn},t.merge(this,e),this.parent=r,"none"===this.type?this.type=t.isBlazor()&&!t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(this.field)?"none":null:this.type&&(this.type="string"==typeof this.type?this.type.toLowerCase():void 0),this.editType&&(this.editType=this.editType.toLowerCase()),t.isNullOrUndefined(this.uid)&&(this.uid=N("grid-column"));var o=new ut;if(e.format&&(e.format.skeleton||e.format.format)&&(this.setFormatter(o.getFormatFunction(t.extend({},e.format))),this.setParser(o.getParserFunction(e.format))),this.toJSON=function(){for(var e={},i=["filter","dataSource",t.isBlazor()?" ":"headerText","template","headerTemplate","edit","editTemplate","filterTemplate","commandsTemplate","parent"],r=Object.keys(n),o=0;o-1;n--){if(!(l=this.getColumnByField(i[n].field)))return this.parent.log("initial_action",{moduleName:"sort",columnName:i[n].field}),e;l.setSortDirection(i[n].direction);var o=i[n].direction;l.sortComparer&&(this.parent.log("grid_sort_comparer"),o=this.isRemote()?i[n].direction:l.sortComparer.bind(l)),-1===t.groupSettings.columns.indexOf(i[n].field)?l.isForeignColumn()||l.sortComparer?e.sortByForeignKey(l.field,o,void 0,i[n].direction.toLowerCase()):e.sortBy(l.field,o):r.push({direction:o,field:l.field})}for(var n=0,s=r.length;n-1});var a=r?t.dataSource.adaptor:this.dataManager.adaptor;if(l||a.getModuleName&&"ODataV4Adaptor"===a.getModuleName()){o=r?[t.foreignKeyValue]:o;for(var h=0;h0||o.getMinutes()>0||o.getSeconds()>0||o.getMilliseconds()>0?"datetime":"date":typeof e),t.isNullOrUndefined(n.getFormatter())&&Y(r,n),ut.prototype.toView(e,n.getFormatter())},e.prototype.crudActions=function(e){var i=this.generateQuery(),r=null,n="promise",o=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());switch(this.parent.dataSource&&"result"in this.parent.dataSource&&this.eventPromise(e,i,o),e.requestType){case"save":t.isBlazor()&&this.parent.isServerRendered&&this.parent.notify("offset",e),r=this.dataManager.update(o,e.data,i.fromTable,i,e.previousData)}e[n]=r||e[n],this.parent.notify("crud-Action",e)},e.prototype.saveChanges=function(e,r,n,o){if(void 0===o&&(o=this.generateQuery()),o.requiresCount(),"result"in this.parent.dataSource){this.getStateEventArgument(o);var s=new i.Deferred,l={requestType:"batchsave",changes:e,key:r,query:o,endEdit:s.resolve};return this.setState({isPending:!0,resolver:s.resolve}),this.parent.trigger("dataSourceChanged",l),s.promise}if(t.isBlazor()&&this.parent.isServerRendered){for(a=0;a0;t--)this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[t-1])},e.prototype.removeRows=function(e){var t=this.dataManager.dataSource.json;this.dataManager.dataSource.json=t.filter(function(t,i){return-1===e.records.indexOf(t)})},e.prototype.getColumnByField=function(e){var t;return this.parent.columnModel.some(function(i){return t=i,i.field===e})&&t},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Gt,this.addRows),this.parent.off(_t,this.removeRows),this.parent.off(Qt,this.initDataManager),this.parent.off(Ut,this.destroy),this.parent.off($t,this.crudActions),this.parent.off(ti,this.getData),this.parent.off(Yt,this.refreshFilteredCols),this.parent.off(si,this.refreshFilteredCols))},e.prototype.getState=function(){return this.dataState},e.prototype.setState=function(e){return this.dataState=e},e.prototype.getForeignKeyDataState=function(){return this.foreignKeyDataState},e.prototype.setForeignKeyDataState=function(e){this.foreignKeyDataState=e},e.prototype.getStateEventArgument=function(e){var r=new i.UrlAdaptor,n=new i.DataManager({url:"",adaptor:new i.UrlAdaptor}),o=r.processQuery(n,e),s=JSON.parse(o.data);return t.extend(s,o.pvtData)},e.prototype.eventPromise=function(e,t,r){var n,o=this,s=e;n=this.getStateEventArgument(t);var l=new i.Deferred,a=new i.Deferred;if(void 0!==e.requestType&&!1!==this.dataState.isDataChanged)if(n.action=e,"save"===e.requestType||"delete"===e.requestType){var h=e;h.key=r;h.promise=a.promise,h.state=n,this.setState({isPending:!0,resolver:a.resolve}),s.endEdit=a.resolve,s.cancelEdit=a.reject,this.parent.trigger("dataSourceChanged",h),a.promise.then(function(e){o.setState({isPending:!0,resolver:l.resolve,group:n.group,aggregates:n.aggregates}),"save"===h.requestType&&o.parent.notify("recordAdded",h),o.parent.trigger("dataStateChange",n)}).catch(function(){})}else this.setState({isPending:!0,resolver:l.resolve,group:n.group,aggregates:n.aggregates}),this.parent.trigger("dataStateChange",n);else this.setState({}),l.resolve(this.parent.dataSource);return l},e.prototype.getSearchColumnFieldNames=function(){for(var e=[],i=0,r=this.parent.getColumns();i0){var p=this.parent.groupSettings.columns.length>0&&!this.parent.getRowsObject()[r.index-1].isDataRow?this.parent.getRowsObject()[r.index].cells:this.parent.getRowsObject()[r.index-1].cells,c=r.cells[n];s=p.filter(function(e){return e.column.uid===c.column.uid})[0]}for(var u=s&&s.colSpanRange>1&&s.rowSpanRange>1?s.colSpanRange:a,g=n+1;g0){for(g=n+a;g=r.cells.length&&(a-=n+a+d-r.cells.length)}return r.cells[n].cellSpan&&(r.data[i.column.field]=r.cells[n].spanText,o=l.render(r.cells[n],r.data,{index:t.isNullOrUndefined(r.index)?"":r.index.toString()})),a>1&&t.attributes(o,{colSpan:a.toString(),"aria-colSpan":a.toString()}),h>1&&(t.attributes(o,{rowspan:h.toString(),"aria-rowspan":h.toString()}),r.cells[n].isRowSpanned=!0,r.cells[n].rowSpanRange=Number(h),a>1&&(r.cells[n].colSpanRange=Number(a))),r.index>0&&s.rowSpanRange>1&&(r.cells[n].isSpanned=!0,r.cells[n].rowSpanRange=Number(s.rowSpanRange-1),r.cells[n].colSpanRange=s.rowSpanRange>0?s.colSpanRange:1),!this.parent.enableColumnVirtualization||r.cells[n].cellSpan||this.containsKey(i.column.field,i.data[i.column.field])||this.backupMergeCells(i.column.field,i.data[i.column.field],i.colSpan),o},i.prototype.backupMergeCells=function(e,t,i){this.setMergeCells(this.generteKey(e,t),i)},i.prototype.generteKey=function(e,t){return e+"__"+t.toString()},i.prototype.splitKey=function(e){return e.split("__")},i.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},i.prototype.getMergeCells=function(){return this.parent.mergeCells},i.prototype.setMergeCells=function(e,t){this.parent.mergeCells[e]=t},i.prototype.updateVirtualCells=function(e){for(var t=this.getMergeCells(),i=0,r=Object.keys(t);i1)for(var d=0,p=e;d-1||u),i.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(i.isSelected=!0,-1===this.parent.getSelectedRowIndexes().indexOf(i.index)&&this.parent.getSelectedRowIndexes().push(i.index)),this.buildAttributeFromRow(a,i),t.attributes(a,p),F(a,i.attributes);for(var g=this.serviceLocator.getService("cellRendererFactory"),f=this,m=0,y=i.cells.length;m0&&f.isSpan){var u=(f.parent.groupSettings.columns.length>0&&!f.parent.getRowsObject()[i.index-1].isDataRow?f.parent.getRowsObject()[i.index].cells:f.parent.getRowsObject()[i.index-1].cells).filter(function(e){return e.column.uid===i.cells[r].column.uid})[0];c=u.isRowSpanned?u.isRowSpanned:u.rowSpanRange>1}(d.colSpan>1||i.cells[r].cellSpan>1||d.rowSpan>1||c)&&(f.isSpan=!0,p=new yi(f.serviceLocator,f.parent).render(d,i,r,p))}i.cells[r].isSpanned||a.appendChild(p)}}(m);var v={row:a,rowHeight:this.parent.rowHeight};if(i.isDataRow&&(this.parent.trigger("rowDataBound",t.extend(h,v)),this.parent.childGrid||this.parent.isRowDragable()||this.parent.detailTemplate)){var C=a.querySelectorAll(".e-rowcell:not(.e-hide)")[0];C&&C.classList.add("e-detailrowvisible")}if(this.parent.enableVirtualization&&(h.rowHeight=this.parent.rowHeight),h.rowHeight?a.style.height=h.rowHeight+"px":this.parent.rowHeight&&(a.querySelector(".e-headercell")||a.querySelector(".e-groupcaption"))&&(a.style.height=this.parent.rowHeight+"px"),i.cssClass&&a.classList.add(i.cssClass),i.lazyLoadCssClass&&a.classList.add(i.lazyLoadCssClass),!(this.parent.enableColumnVirtualization&&0!==this.parent.frozenColumns)&&this.parent.element.scrollHeight>this.parent.height&&this.parent.aggregates.length)for(m=0;m-1,this.refreshForeignKeyRow(a);var h=this.ensureColumns(),d=t.isBlazor()?new fi(a):new fi(a,this.parent);return d.cells="Right"===this.parent.getFrozenMode()?this.generateCells(a).concat(h):h.concat(this.generateCells(a)),d},i.prototype.refreshForeignKeyRow=function(e){for(var i=this.parent.getForeignKeyColumns(),r=0;r=c?this.getCellType():g=0;f--)if(this.rows[f].isCaptionRow)this.rows[f].aggregatesCount=this.rows.length-g;else if(!this.rows[f].isCaptionRow&&!this.rows[f].isDataRow)break}}this.prevKey=i.key},r.prototype.getCaptionRowCells=function(i,r,n){var o=[],s=[],l=this.parent.getColumnByField(i),a=this.parent.getColumnIndexesInView();this.parent.enableColumnVirtualization&&(l=this.parent.columns.filter(function(e){return e.field===i})[0]);var h=this.parent.groupSettings.columns.length,d=this.parent;if(!this.parent.enableColumnVirtualization||-1!==a.indexOf(r)){for(var p=0;p tbody")[1])||t.remove(this.getTable().querySelectorAll(".e-table > tbody")[1])),this.parent.notify("contentcolgroup",{}),this.rafCallback(Y)(),u&&(S.style.overflowY="hidden",w.style.height=b.offsetHeight-j()+"px",b.style.overflowY="auto"!==this.parent.height?"scroll":"auto",w.style.borderRightWidth="1px",this.parent.notify(Mt,{rows:this.movableRows,args:t.extend({},Y,{isFrozen:!1})})),!this.parent.isCheckBoxSelection&&"Multiple"!==this.parent.selectionSettings.type||!this.parent.isPersistSelection&&!this.parent.enableVirtualization){"Normal"!==this.parent.editSettings.mode||t.isNullOrUndefined(e.editRowIndex)||this.parent.selectRow(e.editRowIndex)}if(this.parent.enableVirtualization&&!this.parent.getHeaderContent().querySelectorAll(".e-check").length){for(var R=this.parent.getRows().filter(function(e){return e.getAttribute("aria-selected")}).map(function(e){return e.getAttribute("data-uid")}),F=this.parent.getRows().filter(function(e){return null===e.getAttribute("aria-selected")}).map(function(e){return e.getAttribute("data-uid")}),z=0;z=this.contentPanel.firstElementChild.scrollHeight&&!e.rowObject&&(D=!1)}}var P=r.frozenRows&&!r.isFrozenGrid()&&this.parent.enableVirtualization&&"reorder"===e.requestType;if(r.frozenRows&&"virtualscroll"===e.requestType&&"X"===e.virtualInfo.sentinelInfo.axis||P){var N=e.virtualInfo.blockIndexes,H=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],P&&(e.virtualInfo.page=1);var U=P?this.initialPageRecords:n,V=this.vgenerator.generateRows(U,e);V.splice(this.parent.frozenRows);for(z=0;z=r.pageSettings.pageSize&&D)break;if(r.rowTemplate){var _=r.element.id+"rowTemplate",W=void 0;if(r.isReact){var K=r.frozenRows&&z1&&(t=this.infiniteCache[1][l].slice(0,this.parent.frozenRows).concat(t))}else{for(a=o;a<=s;a++)t=t.length?t.concat(this.infiniteCache[a]):this.infiniteCache[a];this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(t=this.infiniteCache[1].slice(0,this.parent.frozenRows).concat(t))}}return t},e.prototype.getReorderedVFRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},e.prototype.getReorderedRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},e.prototype.virtualFrozenHdrRefresh=function(e,t,i,r,n,o){if(this.parent.frozenRows&&this.parent.enableVirtualization&&("reorder"===r.requestType||"refresh"===r.requestType)){var s=void 0,l=[];this.parent.isFrozenGrid()?(this.currentMovableRows=n,l=this.getReorderedVFRows(r)):l=this.getReorderedRows(r);for(var a=0;ae?0:t,r=parseInt(this.parent.getRows()[i].getAttribute("aria-rowindex"),10);e=t>e?e:e-r+t}return e},e.prototype.getVirtualRowIndex=function(e){return e},e.prototype.getMovableRowByIndex=function(e){return e=this.getInfiniteRowIndex(e),this.parent.getMovableDataRows()[e]},e.prototype.enableAfterRender=function(e){"group"===e.module&&e.enable&&(this.generator=this.getModelGenerator())},e.prototype.setRowObjects=function(e){this.rows=e},e.prototype.immutableModeRendering=function(e){var i=this;void 0===e&&(e={});var r=this.parent;r.hideSpinner();var n=r.getPrimaryKeyFieldNames()[0],o={},s={},l=[],a={},h=r.getRowsObject().slice(),d=this.getBatchEditedRecords(n,h),p={},c=0!==Object.keys(d).length;if(r.getContent().querySelector(".e-emptyrow")||"reorder"===e.requestType||this.parent.groupSettings.columns.length)this.refreshContentRows(e);else{if(0===r.currentViewData.length)return;var u={},g=r.createElement("tbody"),f=r.currentViewData,m=[].slice.call(this.getTable().querySelector("tbody").children);if(this.prevCurrentView.length){var y=this.prevCurrentView.length,v=f.length;if(y===v)for(C=0;C0)return!1;var s=r.parent.createElement("div",{className:"e-cloneproperties e-dragclone e-headerclone"}),l=n.classList.contains("e-headercell")?n:o;if(!l||!i.allowReordering&&l.classList.contains("e-stackedheadercell"))return!1;var a,h=l.offsetHeight,d=l.querySelector(".e-headercelldiv")||l.querySelector(".e-stackedheadercelldiv");if(d){if(a=l.querySelector(".e-stackedheadercelldiv")?i.getStackedHeaderColumnByHeaderText(d.innerText.trim(),i.columns):i.getColumnByUid(d.getAttribute("e-mappinguid")),r.column=a,r.column.lockColumn)return!1;s.setAttribute("e-mappinguid",r.column.uid)}if(a&&!t.isNullOrUndefined(a.headerTemplate))if(t.isNullOrUndefined(a.headerTemplate))s.innerHTML=a.headerTemplate;else{var p=i.getColumnIndexByField(a.field);q(s,a.getHeaderTemplate()(t.extend({index:p},a),i,"headerTemplate"))}else s.innerHTML=d?a.headerText:l.firstElementChild.innerHTML;return s.style.width=l.offsetWidth+"px",s.style.height=l.offsetHeight+"px",s.style.lineHeight=(h-6).toString()+"px",i.element.appendChild(s),s},this.dragStart=function(e){var i=r.parent;i.element.querySelector(".e-gridpopup").style.display="none",i.notify(wt,{target:r.draggable.currentStateTarget,column:r.column,event:e.event}),t.isBlazor()&&e.bindEvents(e.dragElement)},this.drag=function(e){var i=r.parent,n=e.target;if(n){var o=t.closest(n,".e-grid"),s=r.parent.element.querySelector(".e-cloneproperties");if(!(o&&o.getAttribute("id")===i.element.getAttribute("id")||(t.classList(s,["e-notallowedcur"],["e-defaultcur"]),i.allowReordering&&(i.element.querySelector(".e-reorderuparrow").style.display="none",i.element.querySelector(".e-reorderdownarrow").style.display="none"),i.groupSettings.allowReordering)))return;i.notify(bt,{target:e.target,column:r.column,event:e.event})}},this.dragStop=function(e){var i,n=r.parent;n.element.querySelector(".e-gridpopup").style.display="none",(!O(e.target,"e-headercell")&&!O(e.target,"e-groupdroparea")||!n.allowReordering&&O(e.target,"e-headercell")||!e.helper.getAttribute("e-mappinguid")&&O(e.target,"e-groupdroparea"))&&(t.remove(e.helper),i=!0),n.notify(Wt,{target:e.target,event:e.event,column:r.column,cancel:i})},this.drop=function(e){var i=r.parent,n=e.droppedElement.getAttribute("e-mappinguid"),o=t.closest(e.target,".e-grid");t.remove(e.droppedElement),o&&o.getAttribute("id")!==i.element.getAttribute("id")||!i.allowReordering&&!i.allowGrouping||i.notify(Kt,{target:e.target,uid:n,droppedElement:e.droppedElement})},this.parent=e,this.serviceLocator=i,this.ariaService=this.serviceLocator.getService("ariaService"),this.widthService=this.serviceLocator.getService("widthService"),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenRightColumnsCount()||this.parent.on(jt,this.setVisible,this),this.parent.on(Vt,this.colPosRefresh,this),this.parent.on(Tt,this.renderCustomToolbar,this),"Vertical"===this.parent.rowRenderingMode&&this.parent.on(Dt,this.updateCustomResponsiveToolbar,this))}return i.prototype.renderPanel=function(){var e=this.parent.element.querySelector(".e-gridheader"),t=null!=e;e=t?e:this.parent.createElement("div",{className:"e-gridheader"});var i=t?e.querySelector(".e-headercontent"):this.parent.createElement("div",{className:"e-headercontent"});this.toggleStackClass(e),e.appendChild(i),this.setPanel(e),t||this.parent.element.appendChild(e)},i.prototype.renderTable=function(){var e=this.getPanel();e.appendChild(this.createHeaderTable()),this.setTable(e.querySelector(".e-table")),this.parent.getFrozenColumns()||this.parent.getFrozenRightColumnsCount()||this.parent.getFrozenLeftColumnsCount()||(this.initializeHeaderDrag(),this.initializeHeaderDrop()),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:this.parent.isFrozenGrid()}})},i.prototype.getPanel=function(){return this.headerPanel},i.prototype.setPanel=function(e){this.headerPanel=e},i.prototype.getTable=function(){return this.headerTable},i.prototype.setTable=function(e){this.headerTable=e},i.prototype.getColGroup=function(){return this.colgroup},i.prototype.setColGroup=function(e){return this.colgroup=e},i.prototype.getRows=function(){return this.getTable().tHead.rows},i.prototype.createHeaderTable=function(){var e=t.isBlazor()&&0!==this.parent.frozenRows,i=this.createTable(),r=this.getPanel().querySelector(".e-headercontent");return e||r.appendChild(i),r},i.prototype.createHeader=function(i,r){void 0===i&&(i=null);var n=t.isBlazor()&&0!==this.parent.frozenRows,o=this.parent,s=o.isFrozenGrid();t.isBlazor()&&!o.isJsComponent||!this.getTable()||s||t.remove(this.getTable());o.getColumns();var l=this.getPanel().querySelector(".e-headercontent"),a=n?i||l.querySelector(".e-table"):this.parent.createElement("table",{className:"e-table",attrs:{cellspacing:"0.25px",role:"grid"}}),h=r||(o.getFrozenLeftCount()?"frozen-left":"frozen-right"),d=this.createHeaderContent(h),p=d.thead,c=this.parent.createElement("tbody",{className:this.parent.frozenRows?"":"e-hide"});this.caption=this.parent.createElement("caption",{innerHTML:this.parent.element.id+"_header_table",className:"e-hide"});for(var u,g=this.parent.createElement("colgroup"),f=this.parent.createElement("tr"),m=this.rows=d.rows,y=(new vi(this.serviceLocator,e.CellType.Header,this.parent),0),v=m.length;y0&&this.parent.contentModule.isXaxis()&&0!==this.parent.inViewIndexes[0]&&"movable"===t.getFreezeTableName()?i[r].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-r,(n?"":o?"e-firstcell":"")+d,r,this.parent.getColumnIndexByUid(t.uid))):(!p&&c||p&&t.getFreezeTableName()===a&&u)&&i[r].cells.push(this.generateCell(t,e.CellType.Header,this.colDepth-r,(n?"":o?"e-firstcell":"")+d,r,this.parent.getColumnIndexByUid(t.uid))),this.parent.lockcolPositionCount?this.frzIdx+this.notfrzIdx0,f=n.createCheckBox(this.parent.createElement,!1,{checked:g,label:" "});a.innerHTML="",f.classList.add("e-checkbox-disabled"),a.appendChild(f),a.setAttribute("aria-label",g+" column header "+e.column.headerText)}return a},i.prototype.appendHtml=function(e,t,i){return void 0===i&&(i="innerHTML"),e[i]=t,e},i.prototype.setAttributes=function(e,t,i){var r=t.column;this.buildAttributeFromCell(e,t,"checkbox"===r.type),F(e,i),F(e,t.attributes),r.customAttributes&&F(e,r.customAttributes),"Vertical"===this.parent.rowRenderingMode&&F(e,{"data-cell":r.headerText}),r.textAlign&&(e.style.textAlign=r.textAlign),"Clip"===r.clipMode||!r.clipMode&&"Clip"===this.parent.clipMode?e.classList.add("e-gridclip"):("EllipsisWithTooltip"===r.clipMode||!r.clipMode&&"EllipsisWithTooltip"===this.parent.clipMode)&&"checkbox"!==r.type&&e.classList.add("e-ellipsistooltip")},i.prototype.buildAttributeFromCell=function(i,r,n){var o={},s={colindex:"aria-colindex"},l=[];r.colSpan&&(o.colSpan=r.colSpan),r.rowSpan&&(o.rowSpan=r.rowSpan),r.isTemplate&&l.push("e-templatecell"),r.isSelected&&(l.push.apply(l,["e-selectionbackground","e-active"]),n&&i.querySelector(".e-frame").classList.add("e-check")),r.isColumnSelected&&l.push.apply(l,["e-columnselection"]),r.cellType===e.CellType.Header?o[s.colindex]=r.colIndex:t.isNullOrUndefined(r.index)||(o[s.colindex]=r.index),r.visible||l.push("e-hide"),o.class=l,F(i,o)},i.prototype.getValue=function(e,t,i){return i.valueAccessor(e,t,i)},i}(),Ei=function(){function e(){}return e.prototype.setOptions=function(e,t){for(var i=Object.keys(t),r=0;r0||i.getMinutes()>0||i.getSeconds()>0||i.getMilliseconds()>0?"datetime":"date":typeof i));var a=new ut;if(r[s].format&&(r[s].format.skeleton||r[s].format.format)&&(r[s].setFormatter(a.getFormatFunction(t.extend({},r[s].format))),r[s].setParser(a.getParserFunction(r[s].format))),"string"==typeof r[s].format){var h=this.parent.isServerRendered||this.parent.printModule.isPrintGrid();Y(this.locator,r[s],h)}else r[s].format||"number"!==r[s].type||r[s].setParser(o.getParserFunction({format:"n2"}))}},r.prototype.dataManagerSuccess=function(i,r){var n=this,o=this.parent;this.contentRenderer=this.renderer.getRenderer(e.RenderType.Content),this.headerRenderer=this.renderer.getRenderer(e.RenderType.Header),i.actionArgs=r;var s=this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&("delete"===r.requestType||"save"===r.requestType&&"add"===this.parent.infiniteScrollModule.requestType);o.trigger("beforeDataBound",i,function(e){if(!e.cancel){e.result=t.isNullOrUndefined(e.result)?[]:e.result;var l=Object.keys(e.result).length;if(!n.parent.isDestroyed){if(!(o.getColumns().length||l||o.columns.length&&o.columns[0]instanceof ft))return void o.hideSpinner();if(n.isInfiniteEnd(r)&&!l)return void n.parent.notify("infinite-edit-handler",{e:r,result:i.result,count:i.count,agg:i.aggregates});if(n.parent.isEdit=!1,n.parent.notify("edit-reset",{}),n.parent.notify("tooltip-destroy",{}),n.contentRenderer.prevCurrentView=n.parent.currentViewData.slice(),o.currentViewData=e.result,o.notify("refresh-infinite-current-view-data",{args:r,data:e.result}),t.isBlazor()&&"FilterBar"===o.filterSettings.type&&(t.isNullOrUndefined(o.currentViewData)||!t.isNullOrUndefined(o.currentViewData)&&!o.currentViewData.length))for(var a=o.getColumns(),h=0;h-1?this.parent.sortSettings.columns[c].direction:"None",u.onclick=function(e){r.sortButtonClickHandler(e.target)}}if(this.action===e.ResponsiveDialogAction.isFilter&&a.indexOf(s[h].field)>-1){var f=o.createElement("div",{className:"e-icons e-res-icon e-filtersetdiv"}),m=o.createElement("span",{className:"e-icons e-res-icon e-filterset"});m.setAttribute("colType",s[h].type),f.appendChild(m),d.appendChild(f)}}return t.EventHandler.add(this.customColumnDiv,"click",this.customFilterColumnClickHandler,this),this.customColumnDiv},i.prototype.getSortedFieldsAndDirections=function(e){for(var t=[],i=0;i-1&&(this.sortedCols.splice(i,1),this.sortPredicate.splice(i,1)),this.isSortApplied=!0,"None"!==t&&(this.sortedCols.push(e),this.sortPredicate.push({field:e,direction:t}))},i.prototype.getCurrentSortedFields=function(){for(var e=[],t=0;tn&&this.setWidth("",this.parent.getColumnIndexByField(r[a].field)+this.parent.getIndentCount(),!0)}},e.prototype.setUndefinedColumnWidth=function(e){for(var t=0;ti&&Me(this.parent)&&(e=(30/this.parent.element.offsetWidth*100).toFixed(1)+"%");var n,o=this.parent.getHeaderTable(),s=this.parent.getContentTable(),l=t.formatUnit(e),a=this.parent.getFrozenColumns(),h=this.parent.isRowDragable();a=a&&h?a+1:a;var d=this.parent.getHeaderContent().querySelector(".e-movableheader"),p=this.parent.getContent().querySelector(".e-movablecontent"),c=this.parent.getFrozenLeftColumnsCount(),u=this.parent.getFrozenRightColumnsCount(),g=this.parent.getMovableColumnsCount(),f=0!==c||0!==u;if(a&&i>=a&&d&&d.querySelector("colgroup"))n=d.querySelector("colgroup").children[i-a];else if(this.parent.enableColumnVirtualization&&a&&this.parent.contentModule.isXaxis()&&d.scrollLeft>0)n=(v=d.querySelector("colgroup")).children[v.children.length-1-i];else if(f){C=void 0;if(c&&!u)C=(i=h?i-1:i)=g?o:d;else if(c&&u){i=h?i-1:i;var m=this.parent.getFrozenRightHeader();C=i=a)y=this.parent.getContent().querySelector(".e-movablecontent").querySelector("colgroup").children[i-a];else if(this.parent.enableColumnVirtualization&&a&&this.parent.contentModule.isXaxis()&&p.scrollLeft>0){var v=this.parent.getContent().querySelector(".e-movablecontent").querySelector("colgroup");y=v.children[v.children.length-1-i]}else if(f){var C=void 0;if(c&&!u&&(C=i=g?s:p),c&&u){var w=this.parent.getContent().querySelector(".e-frozen-right-content");C=iparseInt(e.maxWidth.toString(),10)?e.maxWidth:e.width},e.prototype.getTableWidth=function(e){for(var t=0,i=0,r=e;i=1,r=this.parent.getColumns().filter(function(e){return"auto"===e.width}).length>=1;"number"!=typeof this.parent.width||i||r?i||r||(e=this.calcMovableOrFreezeColWidth("movable")):e=t.formatUnit(this.parent.width-parseInt(this.calcMovableOrFreezeColWidth("freeze").split("px")[0],10)-5),e=this.isAutoResize()?"100%":e,this.parent.getHeaderContent().querySelector(".e-movableheader").firstElementChild&&(this.parent.getHeaderContent().querySelector(".e-movableheader").firstElementChild.style.width=e),this.parent.getContent().querySelector(".e-movablecontent").firstElementChild.style.width=e},e.prototype.setWidthToFrozenEditTable=function(){var e=this.calcMovableOrFreezeColWidth("freeze");e=this.isAutoResize()?"100%":e,this.parent.element.querySelectorAll(".e-table.e-inline-edit")[0].style.width=e},e.prototype.setWidthToMovableEditTable=function(){var e=this.calcMovableOrFreezeColWidth("movable");e=this.isAutoResize()?"100%":e,this.parent.element.querySelectorAll(".e-table.e-inline-edit")[1].style.width=e},e.prototype.setWidthToTable=function(){var e=t.formatUnit(this.getTableWidth(this.parent.getColumns()));this.parent.isFrozenGrid()?((this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount())&&this.setWidthToFrozenLeftTable(),this.setWidthToMovableTable(),this.parent.getFrozenRightColumnsCount()&&this.setWidthToFrozenRightTable()):((this.parent.detailTemplate||this.parent.childGrid)&&this.setColumnWidth(new ft({width:"30px"})),e=this.isAutoResize()?"100%":e,this.parent.getHeaderTable().style.width=e,this.parent.getContentTable().style.width=e);var i=this.parent.element.querySelector(".e-table.e-inline-edit");i&&this.parent.getFrozenColumns()?(this.setWidthToFrozenEditTable(),this.setWidthToMovableEditTable()):i&&(i.style.width=e)},e.prototype.isAutoResize=function(){return this.parent.allowResizing&&"Auto"===this.parent.resizeSettings.mode},e}(),nr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),or=function(){function e(e){this.currentInfo={},this.oneTime=!0,this.swap={},this.forget=!1,this.skipFocus=!0,this.focusByClick=!1,this.prevIndexes={},this.refMatrix=this.refreshMatrix(!0),this.actions=["downArrow","upArrow"],this.isVirtualScroll=!1,this.parent=e,this.rowModelGen=new Ci(this.parent),this.addEventListener()}return e.prototype.focusCheck=function(e){var t=e.target;this.focusByClick=!0,this.skipFocus=t.classList.contains("e-grid")},e.prototype.onFocus=function(){if(!(this.parent.isDestroyed||t.Browser.isDevice||this.parent.enableVirtualization)){this.setActive(!this.parent.enableHeaderFocus&&0===this.parent.frozenRows,this.parent.isFrozenGrid());this.parent.enableHeaderFocus||this.parent.getCurrentViewRecords().length||"Batch"===this.parent.editSettings.mode&&("Batch"!==this.parent.editSettings.mode||this.parent.editModule.getBatchChanges().addedRecords.length)||this.getContent().matrix.generate(this.rowModelGen.generateRows({rows:[new fi({isDataRow:!0})]}),this.getContent().selector,!1);var e=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator());this.getContent().matrix.select(e[0],e[1]),this.skipFocus&&(this.focus(),this.skipFocus=!1)}},e.prototype.passiveFocus=function(e){this.parent.isDestroyed||e.target&&e.target.classList.contains("e-detailcell")&&(this.currentInfo.skipAction=!1,t.addClass([this.currentInfo.element],["e-focused","e-focus"]))},e.prototype.onBlur=function(e){this.parent.isEdit||e&&(!e.relatedTarget||t.closest(e.relatedTarget,".e-grid"))||(this.removeFocus(),this.skipFocus=!1,this.currentInfo.skipAction=!1,this.getContent().getFocusInfo().elementToFocus&&(this.getContent().getFocusInfo().elementToFocus.tabIndex=0))},e.prototype.onClick=function(e,i){if(!O(e.target,"e-filterbarcell")||!e.target.classList.contains("e-input-group-icon")){var r=!t.isNullOrUndefined(t.closest(e.target,".e-gridcontent")),n=!t.isNullOrUndefined(t.closest(e.target,".e-gridheader"));r=r&&n?!r:r;var o=!t.isNullOrUndefined(t.closest(e.target,".e-frozencontent"))||!t.isNullOrUndefined(t.closest(e.target,".e-frozenheader")),s=!1;if("Left-Right"===this.parent.getFrozenMode()&&(s=!t.isNullOrUndefined(t.closest(e.target,".e-frozen-right-content"))||!t.isNullOrUndefined(t.closest(e.target,".e-frozen-right-header")),o=o&&!s),!(!r&&t.isNullOrUndefined(t.closest(e.target,".e-gridheader"))||e.target.classList.contains("e-content"))&&t.isNullOrUndefined(t.closest(e.target,".e-unboundcell"))){if(this.setActive(r,o,s),!r&&t.isNullOrUndefined(t.closest(e.target,".e-gridheader")))return void this.clearOutline();var l={cancel:!1,byKey:!1,byClick:!t.isNullOrUndefined(e.target),clickArgs:e};if(this.parent.notify(Nt,l),!l.cancel&&!t.closest(e.target,".e-inline-edit")&&(this.setActive(r,o,s),this.getContent())){if(!1===this.getContent().onClick(e,i))return;this.focus()}}}},e.prototype.onKeyPress=function(e){if(!this.skipOn(e)){this.activeKey=e.action;var t={cancel:!1,byKey:!0,byClick:!1,keyArgs:e};if(this.parent.notify(Nt,t),!t.cancel){var i=this.getContent().matrix.current;this.currentInfo.outline=!0;var r=this.getContent().jump(e.action,i);if(this.swap=r,r.swap&&(this.setActive(!r.toHeader,r.toFrozen,r.toFrozenRight),this.getContent().matrix.current=this.getContent().getNextCurrent(i,r,this.active,e.action),this.prevIndexes={}),this.setActiveByKey(e.action,this.getContent()),!1===(!this.content.lastIdxCell&&this.getContent().onKeyPress(e)))return void this.clearIndicator();e.preventDefault(),this.focus(e)}}},e.prototype.skipOn=function(e){var i=e.target;if(!i)return!1;if(this.currentInfo.skipAction)return this.clearIndicator(),!0;if(["pageUp","pageDown","altDownArrow"].indexOf(e.action)>-1)return this.clearIndicator(),!0;var r=t.closest(i,"th")&&!t.closest(i,"th").tabIndex;!e.target.classList.contains("e-filterbaroperator")||13!==e.keyCode&&27!==e.keyCode||t.closest(e.target,".e-filterbarcell").querySelector("input").focus(),r&&null!==t.closest(document.activeElement,".e-filterbarcell")&&this.removeFocus();var n=null!==t.closest(document.activeElement,".e-filterbarcell");if(this.parent.enableHeaderFocus&&n){var o=this.active.matrix,s=o.current;n=o.matrix[s[0]].lastIndexOf(1)!==s[1]}return"delete"===e.action||"Batch"!==this.parent.editSettings.mode&&(this.parent.isEdit||["insert","f2"].indexOf(e.action)>-1)||n||null!==t.closest(document.activeElement,"#"+this.parent.element.id+"_searchbar")&&["enter","leftArrow","rightArrow","shiftLeft","shiftRight","ctrlPlusA"].indexOf(e.action)>-1||null===t.closest(i,".e-gridcontent")&&null===t.closest(i,".e-gridheader")||"space"===e.action&&!i.classList.contains("e-gridchkbox")&&null===t.closest(i,".e-gridchkbox")&&null===t.closest(i,".e-headerchkcelldiv")||null!==t.closest(i,".e-filter-popup")},e.prototype.focusVirtualElement=function(e){var t=this;if(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling){var i={virtualData:{},isAdd:!1,isCancel:!1};this.parent.notify(hi,i);var r=this.actions.some(function(e){return e===t.activeKey}),n=!!this.parent.contentModule&&this.parent.contentModule.selectedRowIndex>-1;i.isAdd||Object.keys(i.virtualData).length||r||i.isCancel||n?(i.isCancel=!1,this.parent.contentModule.selectedRowIndex=-1,r&&(this.activeKey=this.empty,this.parent.notify("virtaul-key-handler",e)),this.currentInfo.elementToFocus.focus({preventScroll:!0})):this.isVirtualScroll?this.currentInfo.elementToFocus.focus({preventScroll:!0}):this.currentInfo.elementToFocus.focus()}this.isVirtualScroll=!1},e.prototype.getFocusedElement=function(){return this.currentInfo.elementToFocus},e.prototype.getContent=function(){return this.active||this.content},e.prototype.setActive=function(e,t,i){this.active=e?t?this.fContent:i?this.frContent:this.content:t?this.fHeader:i?this.frHeader:this.header},e.prototype.setFocusedElement=function(e,i){var r=this;this.currentInfo.elementToFocus=e,setTimeout(function(){t.isNullOrUndefined(r.currentInfo.elementToFocus)||(r.parent.enableVirtualization||r.parent.enableInfiniteScrolling?r.focusVirtualElement(i):r.currentInfo.elementToFocus.focus())},0)},e.prototype.focus=function(e){this.parent.notify("virtaul-cell-focus",e),this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)},e.prototype.removeFocus=function(e){this.currentInfo.element&&(t.removeClass([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focused","e-focus"]),this.currentInfo.element.tabIndex=-1)},e.prototype.addOutline=function(){var e=this.getContent().getFocusInfo();e.element&&(t.addClass([e.element],["e-focused"]),t.addClass([e.elementToFocus],["e-focus"]))},e.prototype.focusHeader=function(){this.setActive(!1,this.parent.isFrozenGrid()),this.resetFocus()},e.prototype.focusContent=function(){this.setActive(!0,this.parent.isFrozenGrid()),this.resetFocus()},e.prototype.resetFocus=function(){var e=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator());this.getContent().matrix.select(e[0],e[1]),this.focus()},e.prototype.addFocus=function(e,i){if(this.currentInfo=e,this.currentInfo.outline=e.outline&&!t.isNullOrUndefined(i),e.element){var r=e.elementToFocus.classList.contains("e-focus");if(!r){this.currentInfo.outline&&t.addClass([e.element],["e-focused"]),t.addClass([e.elementToFocus],["e-focus"]),e.element.tabIndex=0,r||this.setFocusedElement(e.elementToFocus,i),this.parent.notify("cellfocused",{element:e.elementToFocus,parent:e.element,indexes:this.getContent().matrix.current,byKey:!t.isNullOrUndefined(i),byClick:t.isNullOrUndefined(i),keyArgs:i,isJump:this.swap.swap,container:this.getContent().getInfo(i),outline:!t.isNullOrUndefined(i),swapInfo:this.swap});var n=this.getContent().matrix.current,o=n[0],s=n[1];this.prevIndexes={rowIndex:o,cellIndex:s},this.focusedColumnUid=this.parent.getColumnByIndex(s).uid,this.focusByClick=!1}}},e.prototype.refreshMatrix=function(e){var i=this;return function(r){e&&r.args&&r.args.isFrozen&&!i.fContent?i.fContent=new hr(i.parent):e&&!i.frContent&&r.args&&r.args.renderFrozenRightContent?i.frContent=new cr(i.parent):e&&!i.content&&(i.content=new lr(i.parent)),!e&&r.args&&r.args.isFrozen&&!i.fHeader?i.fHeader=new dr(i.parent):!e&&r.args&&r.args.renderFrozenRightContent&&!i.frHeader?i.frHeader=new ur(i.parent):e||i.header||(i.header=new ar(i.parent));var n=e?r.args&&r.args.isFrozen?i.fContent:r.args&&r.args.renderFrozenRightContent?i.frContent:i.content:r.args&&r.args.isFrozen?i.fHeader:r.args&&r.args.renderFrozenRightContent?i.frHeader:i.header,o=e?r.rows.slice(i.parent.frozenRows):r.rows,s=e?r.rows.slice(0,i.parent.frozenRows):r.rows;i.parent.isCollapseStateEnabled()&&e&&(o=o.filter(function(e){return!1!==e.visible}));var l=!t.isNullOrUndefined(i.parent.rowTemplate),a=n.matrix.generate(s,n.selector,l);if("batchAdd"===r.name&&i.parent.isFrozenGrid()){var h=i.parent.getMovableRowsObject().map(function(e){return e.clone()}),d=o.map(function(e){return e.clone()});if(i.fContent.matrix.generate(d,i.fContent.selector,l),i.content.matrix.generate(h,i.content.selector,l),"Left-Right"===i.parent.getFrozenMode()){var p=i.parent.getFrozenRightRowsObject().map(function(e){return e.clone()});i.frContent.matrix.generate(p,i.frContent.selector,l)}}else n.matrix.generate(o,n.selector,l);if(n.generateRows(s,{matrix:a,handlerInstance:r.args&&r.args.isFrozen?i.fHeader:r.args&&r.args.renderFrozenRightContent?i.frHeader:i.header}),!t.Browser.isDevice&&r&&r.args&&(i.focusByClick||"paging"!==r.args.requestType||(i.skipFocus=!1,i.parent.element.focus()),"grouping"===r.args.requestType&&(i.skipFocus=!0)),r&&r.args&&"virtualscroll"===r.args.requestType)if(i.currentInfo.uid){var c;if(r.rows.some(function(e,t){return c=t,e.uid===i.currentInfo.uid})&&(i.content.matrix.current[0]=c,i.content.matrix.current[1]=i.parent.getColumnIndexByUid(i.focusedColumnUid)||0,f=i.getContent().getFocusInfo().elementToFocus)){var u=f.getBoundingClientRect(),g=i.parent.element.getBoundingClientRect();u.top>=0&&u.left>=0&&u.right<=Math.min(g.right,window.innerWidth||document.documentElement.clientWidth)&&u.bottom<=Math.min(g.bottom,window.innerHeight||document.documentElement.clientHeight)&&(i.isVirtualScroll=!0,i.focus())}}else if(r.args.focusElement&&r.args.focusElement.classList.contains("e-filtertext")){var f=i.parent.element.querySelector("#"+r.args.focusElement.id);f&&f.focus()}}},e.prototype.addEventListener=function(){var e=this;if(!this.parent.isDestroyed){t.EventHandler.add(this.parent.element,"mousedown",this.focusCheck,this),t.EventHandler.add(this.parent.element,"focus",this.onFocus,this),this.parent.element.addEventListener("focus",this.passiveHandler=function(t){return e.passiveFocus(t)},!0),t.EventHandler.add(this.parent.element,"focusout",this.onBlur,this),this.parent.on(qt,this.onKeyPress,this),this.parent.on(Ht,this.onClick,this),this.parent.on(Mt,this.refMatrix,this),this.parent.on("partial-refresh",this.refMatrix,this),this.parent.on("refresh-Expand-and-Collapse",this.refMatrix,this),this.parent.on(Lt,this.refreshMatrix(),this),this.parent.on("close-edit",this.restoreFocus,this),this.parent.on("restore-Focus",this.restoreFocus,this);for(var i=["start-edit","start-add"],r=0;rthis.matrix[e].length-1&&o(e,i,n))return[e,s];var a=this.first(this.matrix[e],i,r,!0,n);i=null===a?s:a;var h=t.getValue(e+"."+i,this.matrix);if(e!==this.rows||"downArrow"!==n&&"enter"!==n||(r[0]=-1),null===a){for(var d=0;d-1&&this.matrix.current||[]).toString()===i.toString()){if(i.toString()===[this.matrix.rows,this.matrix.columns].toString()||i.toString()===[0,0].toString()||this.matrix.current[0]===this.matrix.rows&&this.matrix.current.toString()===i.toString())return!1;i=this.editNextRow(i[0],i[1],e.action)}this.matrix.select(i[0],i[1])}},i.prototype.editNextRow=function(e,t,i){var r=this.parent,n=r.editSettings.allowNextRowEdit&&(r.isEdit||r.isLastCellPrimaryKey),o=r.getColumnIndexByField(r.getVisibleColumns()[0].field),s=this.getTable().rows[e].cells[t];return"tab"===i&&n&&(e++,t=o+(this.getTable().rows[e].querySelectorAll(".e-indentcell").length+this.getTable().rows[e].querySelectorAll(".e-detailrowcollapse").length)),"shiftTab"===i&&n&&(e--,t=r.getColumnIndexByField(r.getVisibleColumns()[r.getVisibleColumns().length-1].field)),s.classList.contains("e-rowcell")||s.classList.contains("e-headercell")||s.classList.contains("e-groupcaption")?[e,t]:this.editNextRow(e,t,i)},i.prototype.getCurrentFromAction=function(e,t,i,r){if(void 0===t&&(t=[0,0]),!i&&!this.indexesByKey(e)||0===this.matrix.current.length)return null;if(!this.shouldFocusChange(r))return this.matrix.current;var n=this.indexesByKey(e)||this.matrix.current.concat(t),o=n[0],s=n[1],l=n[2],a=n[3];return this.matrix.get(o,s,[l,a],e,this.validator())},i.prototype.onClick=function(e,i){var r=e.target;if(this.target=r,r=r.classList.contains("e-rowcell")?r:t.closest(r,"td"),r=r||(t.closest(e.target,"td.e-detailrowcollapse")||t.closest(e.target,"td.e-detailrowexpand")),r=t.closest(e.target,"td.e-detailcell")&&t.isNullOrUndefined(t.closest(t.closest(e.target,".e-grid"),"td.e-detailcell"))?null:r,!(r=r&&t.closest(r,"table").classList.contains("e-table")?r:null))return!1;var n=[r.parentElement.rowIndex,r.cellIndex],o=n[0],s=n[1],l=this.matrix.current,a=l[0],h=l[1],d=t.getValue(o+"."+s,this.matrix.matrix);if(this.matrix.inValid(d)||!i&&a===o&&h===s||!O(e.target,"e-rowcell")&&!O(e.target,"e-groupcaption"))return!1;this.matrix.select(o,s)},i.prototype.getFocusInfo=function(){var e={},i=this.matrix.current,r=i[0],n=void 0===r?0:r,o=i[1],s=void 0===o?0:o;return this.matrix.current=[n,s],e.element=t.isNullOrUndefined(this.getTable().rows[n])?null:this.getTable().rows[n].cells[s],e.element?(e.elementToFocus=e.element.classList.contains("e-unboundcell")||e.element.classList.contains("e-detailcell")?e.element:this.getFocusable(e.element),e.outline=!0,e.uid=e.element.parentElement.getAttribute("data-uid"),e):e},i.prototype.getFocusable=function(e){var i='button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])',r=!t.isNullOrUndefined(t.closest(e,".e-templatecell"));this.parent.isEdit&&(i='input:not([type="hidden"]), select:not([aria-hidden="true"]), textarea');var n=[].slice.call(e.querySelectorAll(i));return n.length?r?this.target:n[0]:e},i.prototype.selector=function(i,r,n){var o=[e.CellType.Expand,e.CellType.GroupCaption,e.CellType.CaptionSummary,e.CellType.GroupSummary];return(i.isDataRow&&r.visible&&(r.isDataCell||r.isTemplate)||i.isDataRow&&r.cellType===e.CellType.DetailExpand&&t.isNullOrUndefined(r.visible)||!i.isDataRow&&o.indexOf(r.cellType)>-1||r.column&&"checkbox"===r.column.type||r.cellType===e.CellType.CommandColumn||i.isDataRow&&n)&&!("delete"===i.edit&&i.isDirty)},i.prototype.nextRowFocusValidate=function(e){for(var t=e,i=e,r=this.matrix.rows;i=0;i--){if(-1!==this.matrix.matrix[e].indexOf(1))return e;if((e-=1)<0)return this.lastIdxCell=!0,t}return t},i.prototype.jump=function(e,t){var i=this.parent.getFrozenLeftCount()&&("leftArrow"===e||"shiftTab"===e)&&0===t[1],r=("rightArrow"===e||"tab"===e)&&t[1]===this.matrix.columns,n="Left-Right"===this.parent.getFrozenMode()&&r;"Right"===this.parent.getFrozenMode()&&(i=r),this.lastIdxCell=!1;var o=0!==this.parent.frozenRows&&"shiftEnter"===e;"tab"!==e||this.parent.isEdit||t[1]!==this.matrix.matrix[t[0]].lastIndexOf(1)||this.matrix.matrix.length-1===t[0]||(this.matrix.current[0]=this.nextRowFocusValidate(this.matrix.current[0]+1),this.matrix.current[1]=-1,i=this.parent.isFrozenGrid()),"shiftTab"!==e||this.parent.isEdit||0===t[0]||this.matrix.matrix[t[0]].indexOf(1)!==t[1]||(this.matrix.current[0]=this.previousRowFocusValidate(this.matrix.current[0]-1),this.matrix.current[1]=this.matrix.matrix[t[0]].length);var s=!1,l=document.activeElement.parentElement;return(this.parent.enableVirtualization||this.parent.infiniteScrollSettings.enableCache)&&l.classList.contains("e-row")&&(s=parseInt(l.getAttribute("aria-rowindex"),10)>0),{swap:!s&&(("upArrow"===e||o)&&0===t[0]||i||n),toHeader:("upArrow"===e||o)&&0===t[0],toFrozen:i,toFrozenRight:n}},i.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"Right"===this.parent.getFrozenMode()||"Left-Right"===this.parent.getFrozenMode()?("leftArrow"!==r&&"shiftTab"!==r||(n[0]=e[0],n[1]=i.matrix.columns+1),"Left-Right"!==this.parent.getFrozenMode()||"rightArrow"!==r&&"tab"!==r||(n[0]=e[0],n[1]=-1)):"rightArrow"!==r&&"tab"!==r||(n[0]=e[0],n[1]=-1),"downArrow"!==r&&"enter"!==r||(n[0]=-1,n[1]=e[1]),n},i.prototype.generateRows=function(e,t){var i,r=t.matrix,n=t.handlerInstance,o=n.matrix.matrix.length,s=this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type?o+1:o;n.matrix.matrix=n.matrix.matrix.slice(0,s),n.matrix.rows=s,(i=n.matrix.matrix).push.apply(i,r),n.matrix.rows+=r.length},i.prototype.getInfo=function(e){var t=this.getFocusInfo(),i=this.matrix.current,r=i[0],n=i[1],o=t.element.classList.contains("e-rowcell"),s=o||e&&"enter"!==e.action&&(t.element.classList.contains("e-detailrowcollapse")||t.element.classList.contains("e-detailrowexpand")),l=[Math.min(parseInt(t.element.parentElement.getAttribute("aria-rowindex"),10),r),Math.min(parseInt(t.element.getAttribute("aria-colindex"),10),n)];return{isContent:!0,isDataCell:o,indexes:[l[0],l[1]],isSelectable:s}},i.prototype.validator=function(){var e=this.getTable();return function(i,r,n){if(!t.isNullOrUndefined(e.rows[i])){var o=void 0;r=e.querySelector(".e-emptyrow")?0:r;var s=0!==(o=e.rows[i].cells[0].classList.contains("e-editcell")?e.rows[i].cells[0].querySelectorAll("td")[r]:e.rows[i].cells[r]).getBoundingClientRect().width;if("enter"===n||"shiftEnter"===n)return s&&o.classList.contains("e-rowcell");if(("shiftUp"===n||"shiftDown"===n)&&o.classList.contains("e-rowcell"))return s;if("shiftUp"!==n&&"shiftDown"!==n)return s}return!1}},i.prototype.shouldFocusChange=function(e){var i=this.matrix.current,r=i[0],n=void 0===r?-1:r,o=i[1],s=void 0===o?-1:o;if(n<0||s<0)return!0;var l=t.getValue(n+".cells."+s,this.getTable().rows);return!l||("enter"!==e.action&&"shiftEnter"!==e.action||l.classList.contains("e-rowcell")&&!l.classList.contains("e-unboundcell")&&(!l.classList.contains("e-templatecell")||l.classList.contains("e-editedbatchcell"))&&!l.classList.contains("e-detailcell"))},i.prototype.getGridSeletion=function(){return!t.isBlazor()&&this.parent.allowSelection&&this.parent.selectionSettings.allowColumnSelection},i}(),ar=function(i){function r(e){return i.call(this,e)||this}return nr(r,i),r.prototype.getTable=function(){return this.parent.isFrozenGrid()?this.parent.getHeaderContent().querySelector(".e-movableheader .e-table"):this.parent.getHeaderTable()},r.prototype.onClick=function(e){var i=e.target;if((i=i.classList.contains("e-headercell")?i:t.closest(i,"th"))||0===this.parent.frozenRows||(i=e.target.classList.contains("e-rowcell")?e.target:t.closest(e.target,"td")),e.target.classList.contains("e-columnheader")||e.target.querySelector(".e-stackedheadercell"))return!1;if(i){var r=[i.parentElement.rowIndex,i.cellIndex],n=r[0],o=r[1],s=t.getValue(n+"."+o,this.matrix.matrix);if(this.matrix.inValid(s))return!1;this.matrix.select(i.parentElement.rowIndex,i.cellIndex)}},r.prototype.getFocusInfo=function(){var e={},i=this.matrix.current,r=i[0],n=void 0===r?0:r,o=i[1],s=void 0===o?0:o;return e.element=this.getTable().rows[n].cells[s],t.isNullOrUndefined(e.element)||(e.elementToFocus=this.getFocusable(e.element),e.outline=!e.element.classList.contains("e-filterbarcell")),e},r.prototype.selector=function(i,r){return r.visible&&(void 0!==r.column.field||r.isTemplate||!t.isNullOrUndefined(r.column.template))||"checkbox"===r.column.type||r.cellType===e.CellType.StackedHeader},r.prototype.jump=function(e,i){var r=this.parent.getFrozenLeftCount()&&("leftArrow"===e||"shiftLeft"===e&&this.getGridSeletion()||"shiftTab"===e)&&0===i[1],n=("rightArrow"===e||"shiftRight"===e&&this.getGridSeletion()||"tab"===e)&&i[1]===this.matrix.columns,o="Left-Right"===this.parent.getFrozenMode()&&n;"Right"===this.parent.getFrozenMode()&&(r=n);var s,l,a=0!==this.parent.frozenRows&&"enter"===e,h=r||o,d=this.parent.focusModule.fHeader&&this.parent.focusModule.fHeader.matrix.matrix,p=d&&!t.isNullOrUndefined(d[i[0]]);return this.parent.enableHeaderFocus&&"tab"===e&&(l=this.matrix.matrix.length-1===i[0],(s=i[1]===this.matrix.matrix[i[0]].lastIndexOf(1))&&(this.matrix.current[0]=l?0:this.matrix.current[0]+1,this.matrix.current[1]=-1),this.parent.isFrozenGrid()&&l&&s&&(r=!0,h=!1)),{swap:("downArrow"===e||a)&&i[0]===this.matrix.matrix.length-1||p&&(r||o)||"tab"===e&&l&&s,toHeader:h,toFrozen:r,toFrozenRight:o}},r.prototype.getNextCurrent=function(e,t,i,r){void 0===e&&(e=[]);var n=[];return"Right"===this.parent.getFrozenMode()||"Left-Right"===this.parent.getFrozenMode()?(("leftArrow"===r||"shiftLeft"===r&&this.getGridSeletion()||"shiftTab"===r)&&(n[0]=e[0],n[1]=i.matrix.columns+1),"Left-Right"===this.parent.getFrozenMode()&&("rightArrow"===r||"shiftRight"===r&&this.getGridSeletion()||"tab"===r)&&(n[0]=e[0],n[1]=-1)):("rightArrow"===r||"shiftRight"===r&&this.getGridSeletion()||"tab"===r)&&(n[0]=e[0],n[1]=-1),"upArrow"!==r&&"shiftEnter"!==r||(n[0]=this.matrix.matrix.length,n[1]=e[1]),n},r.prototype.generateRows=function(e){var t=this.matrix.matrix.length;if(this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type){this.matrix.rows=++this.matrix.rows;for(var i=e[0].cells,r=0;r=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},mr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return gr(i,e),fr([t.Property(12)],i.prototype,"pageSize",void 0),fr([t.Property(8)],i.prototype,"pageCount",void 0),fr([t.Property(1)],i.prototype,"currentPage",void 0),fr([t.Property()],i.prototype,"totalRecordsCount",void 0),fr([t.Property(!1)],i.prototype,"enableQueryString",void 0),fr([t.Property(!1)],i.prototype,"pageSizes",void 0),fr([t.Property(null)],i.prototype,"template",void 0),i}(t.ChildProperty),yr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vr=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Cr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return yr(i,e),vr([t.Property("startsWith")],i.prototype,"operator",void 0),i}(t.ChildProperty),wr=function(){return(wr=Object.assign||function(e){for(var t,i=1,r=arguments.length;i-1){this.parent.notify("select-virtual-Row",{selectedIndex:e});var a=n.isFrozenGrid()?n.contentModule.getRowObjectByIndex(e):null;if(!o||!n.getRowObjectFromUID(o.getAttribute("data-uid"))&&!a)return void(this.parent.getSelectedRecords().length>0&&this.clearRowSelection());r=a||n.getRowObjectFromUID(o.getAttribute("data-uid")).data}else r=this.getCurrentBatchRecordChanges()[e];if(this.isRowType()&&o&&!this.isEditing()){var h=o.hasAttribute("aria-selected");this.activeTarget();var d;if(i=i?!!this.selectedRowIndexes.length&&(1===this.selectedRowIndexes.length&&e===this.selectedRowIndexes[0]):i)this.rowSelectingCallBack(d,i,e,r,!1,h,"cancel")(d);else{!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid?(d={data:r,rowIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,row:o,previousRow:n.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},d=this.addMovableArgs(d,s,l)):d={data:r,rowIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowIndex:this.prevRowIndex,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},this.parent.trigger("rowSelecting",this.fDataUpdate(d),this.rowSelectingCallBack(d,i,e,r,!1,h,"cancel"))}}},r.prototype.rowSelectingCallBack=function(e,i,r,n,o,s,l){var a=this;return function(e){if(!t.isNullOrUndefined(e)&&!0===e[l])return void a.disableInteracted();a.index=r,a.toggle=i,a.data=n,a.removed=o,s&&a.selectionSettings.persistSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode?(a.clearSelectedRow(r),a.selectRowCallBack()):!s&&a.selectionSettings.persistSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode&&a.selectRowCallBack(),"ResetOnRowClick"===a.selectionSettings.checkboxMode&&a.clearSelection(),(!a.selectionSettings.persistSelection||"ResetOnRowClick"===a.selectionSettings.checkboxMode||!a.parent.isCheckBoxSelection&&a.selectionSettings.persistSelection)&&(a.selectRowCheck=!0,a.clearRow())}},r.prototype.selectRowCallBack=function(){var e,i=this.parent,r=this.index,n=this.toggle,o=this.data,s=this.removed,l=i.getRowByIndex(r),a=this.getSelectedMovableRow(r),h=this.getSelectedFrozenRightRow(r);if(n||s||(this.selectedRowIndexes.indexOf(r)<=-1&&(this.updateRowSelection(l,r),this.selectMovableRow(a,h,r)),this.selectRowIndex(r)),!n){!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid?(e={data:o,rowIndex:r,row:l,previousRow:i.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,isInteracted:this.isInteracted,isHeaderCheckBoxClicked:this.isHeaderCheckboxClicked},e=this.addMovableArgs(e,a,h)):e={data:o,rowIndex:r,row:l,previousRow:i.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,isInteracted:this.isInteracted,isHeaderCheckBoxClicked:this.isHeaderCheckboxClicked},this.onActionComplete(e,"rowSelected")}if(t.isBlazor()&&this.parent.isServerRendered&&this.parent.enableVirtualization){this.parent.interopAdaptor.invokeMethodAsync("MaintainSelection",!0,"normal",[r])}this.isInteracted=!1,this.updateRowProps(r)},r.prototype.selectMovableRow=function(e,t,i){this.parent.isFrozenGrid()&&(this.updateRowSelection(e,i),"Left-Right"===this.parent.getFrozenMode()&&t&&this.updateRowSelection(t,i))},r.prototype.addMovableArgs=function(e,t,i){if(this.parent.isFrozenGrid()){var r={mRow:t,previousMovRow:this.parent.getMovableRows()[this.prevRowIndex]};"Left-Right"===this.parent.getFrozenMode()&&i&&(r.frozenRightRow=i,r.previousFrozenRightRow=this.parent.getFrozenRightDataRows()[this.prevRowIndex]),e=wr({},e,r)}return e},r.prototype.selectRowsByRange=function(e,t){this.selectRows(this.getCollectionFromIndexes(e,t)),this.selectRowIndex(t)},r.prototype.selectRows=function(e){var i=this,r=this.parent,n=this.isSingleSel()?e[e.length-1]:e[0];this.isMultiSelection=!0;var o=[],s=[],l=this.getSelectedMovableRow(n),a=this.getSelectedFrozenRightRow(n),h=[];if(this.isRowType()&&!this.isEditing()){for(var d=0,p=e.length;d-1;if(this.selectRowIndex(c),g&&(h.length||this.selectionSettings.enableToggle||this.isMultiCtrlRequest)){if(this.isAddRowsToSelection=!0,this.rowDeselect("rowDeselecting",[c],[u.data],[o],[u.foreignKeyData],r),this.isCancelDeSelect)return;this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(c),1),this.selectedRecords.splice(this.selectedRecords.indexOf(o),1),o.removeAttribute("aria-selected"),this.addRemoveClassesForRow(o,!1,null,"e-selectionbackground","e-active"),s&&(this.selectedRecords.splice(this.selectedRecords.indexOf(s),1),s.removeAttribute("aria-selected"),this.addRemoveClassesForRow(s,!1,null,"e-selectionbackground","e-active")),l&&(this.selectedRecords.splice(this.selectedRecords.indexOf(l),1),l.removeAttribute("aria-selected"),this.addRemoveClassesForRow(l,!1,null,"e-selectionbackground","e-active")),this.rowDeselect("rowDeselected",[c],[u.data],[o],[u.foreignKeyData],r,[s],void 0,[l]),this.isInteracted=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1}else{f="isHybrid";if(this.activeTarget(),!t.isBlazor()||this.parent.isJsComponent||this.parent[f]?(a={cancel:!1,data:u.data,rowIndex:c,row:o,target:this.actualTarget,prevRow:i.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},a=this.addMovableArgs(a,s,l)):a={cancel:!1,data:u.data,rowIndex:c,previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},this.parent.trigger("rowSelecting",this.fDataUpdate(a)),!t.isNullOrUndefined(a)&&!0===a.cancel)return void this.disableInteracted();this.isSingleSel()&&this.clearRow(),this.updateRowSelection(o,c),this.selectMovableRow(s,l,c)}if(!g){var f="isHybrid";!t.isBlazor()||this.parent.isJsComponent||this.parent[f]?(a={data:u.data,rowIndex:c,row:o,target:this.actualTarget,prevRow:i.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},a=this.addMovableArgs(a,s,l)):a={data:u.data,rowIndex:c,previousRowIndex:this.prevRowIndex,row:o,prevRow:i.getRows()[this.prevRowIndex],foreignKeyData:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:n},this.onActionComplete(a,"rowSelected")}if(this.isInteracted=!1,this.updateRowProps(c),this.isSingleSel())break}},r.prototype.getCollectionFromIndexes=function(e,t){for(var i=[],r=e<=t?{i:e,max:t}:{i:t,max:e},n=r.i,o=r.max;n<=o;n++)i.push(n);return e>t&&i.reverse(),i},r.prototype.clearRow=function(){this.clearRowCheck=!0,this.clearRowSelection()},r.prototype.clearRowCallBack=function(){this.isCancelDeSelect&&"Check"!==this.parent.checkAllRows||(this.selectedRowIndexes=[],this.selectedRecords=[],this.selectRowIndex(-1),this.isSingleSel()&&this.parent.isPersistSelection&&(this.selectedRowState={}))},r.prototype.clearSelectedRow=function(e){if(this.toggle){var t=this.parent.getRowByIndex(e);this.disableUI||(t.removeAttribute("aria-selected"),this.addRemoveClassesForRow(t,!1,!0,"e-selectionbackground","e-active")),this.removed=!0,this.updatePersistCollection(t,!1),this.updateCheckBoxes(t),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(e),1),this.selectedRecords.splice(this.selectedRecords.indexOf(this.parent.getRowByIndex(e)),1)}},r.prototype.updateRowProps=function(e){this.prevRowIndex=e,this.isRowSelected=this.selectedRowIndexes.length&&!0},r.prototype.updatePersistCollection=function(e,i){var r=this;if((this.parent.isPersistSelection||this.parent.selectionSettings.persistSelection&&this.parent.getPrimaryKeyFieldNames().length>0)&&!t.isNullOrUndefined(e)){this.parent.isPersistSelection||this.ensureCheckboxFieldSelection();var n=this.getRowObj(e),o=n.data?n.data[this.primaryKey]:null;if(null===o)return;n.isSelected=i,i?(this.selectedRowState[o]=i,this.persistSelectedData.some(function(e){return e[r.primaryKey]===o})||this.persistSelectedData.push(n.data)):this.updatePersistDelete(o)}},r.prototype.updatePersistDelete=function(e){var t=this;delete this.selectedRowState[e];var i;this.persistSelectedData.some(function(r,n){return i=n,r[t.primaryKey]===e})&&this.persistSelectedData.splice(i,1)},r.prototype.updateCheckBoxes=function(e,i,r){if(!t.isNullOrUndefined(e)){var n=e.querySelector(".e-checkselect");t.isNullOrUndefined(n)||(oe(n.nextElementSibling,i),re(n,i),(t.isNullOrUndefined(this.checkedTarget)||!t.isNullOrUndefined(this.checkedTarget)&&!this.checkedTarget.classList.contains("e-checkselectall"))&&this.setCheckAllState(r))}},r.prototype.updateRowSelection=function(e,t){if(e){this.selectedRowIndexes.push(t);var i=this.selectedRowIndexes.length;if(this.parent.isFrozenGrid()&&i>1&&this.selectedRowIndexes[i-2]===this.selectedRowIndexes[i-1]&&this.selectedRowIndexes.pop(),this.selectedRecords.push(e),e.setAttribute("aria-selected","true"),this.updatePersistCollection(e,!0),this.updateCheckBoxes(e,!0),this.addRemoveClassesForRow(e,!0,null,"e-selectionbackground","e-active"),!this.preventFocus){var r=this.focus.getPrevIndexes().cellIndex?e.cells[this.focus.getPrevIndexes().cellIndex]:e.querySelector(".e-selectionbackground:not(.e-hide):not(.e-detailrowcollapse):not(.e-detailrowexpand)");if(this.parent.contextMenuModule&&2===this.mouseButton&&(r=this.parent.contextMenuModule.cell),!r)return;this.focus.onClick({target:r},!0)}}},r.prototype.clearSelection=function(){if(!this.parent.isPersistSelection||this.parent.isPersistSelection&&!this.parent.isEdit||!t.isNullOrUndefined(this.checkedTarget)&&this.checkedTarget.classList.contains("e-checkselectall")){var e=this.parent.element.querySelector(".e-gridpopup").querySelector("span");e.classList.contains("e-rowselect")&&e.classList.remove("e-spanclicked"),this.parent.isPersistSelection&&(this.persistSelectedData=[],this.selectedRowState={}),this.clearRowSelection(),this.clearCellSelection(),this.clearColumnSelection(),this.prevRowIndex=void 0,this.enableSelectMultiTouch=!1,this.isInteracted=!1}},r.prototype.clearRowSelection=function(){var e=this;if(this.isRowSelected){for(var i=this.parent,r=this.parent.getDataRows(),n=[],o=[],s=[],l=[],a=[],h=[],d=this.target,p=(this.parent.getCurrentViewRecords(),0),c=this.selectedRowIndexes.length;p1?(c.rowIndex=i[0],c.rowIndexes=i):1===i.length&&(c.data=c.data[0],c.row=c.row[0],c.foreignKeyData=c.foreignKeyData[0],this.isAddRowsToSelection&&(c.rowIndexes=i))}else{c.rowIndex=c.rowIndex[c.rowIndex.length-1],c.data=c.data[c.data.length-1]}this.parent.trigger(e,t.isBlazor()&&!this.parent.isJsComponent||!this.parent.isFrozenGrid()?c:wr({},c,{mRow:l,frozenRightRow:h}),function(e){d.isCancelDeSelect=e.cancel,d.isCancelDeSelect&&(d.isRowClicked||d.isInteracted||d.checkSelectAllClicked)||(d.updatePersistCollection(n[0],!1),d.updateCheckBoxes(n[0],void 0,i[0]),l&&d.updateCheckBoxes(l[0],void 0,i[0]),h&&d.updateCheckBoxes(h[0],void 0,i[0])),void 0!==a&&a()})}else this.selectionSettings.persistSelection&&!this.isInteracted&&void 0!==a&&a()},r.prototype.getRowObj=function(e){return void 0===e&&(e=this.currentIndex),t.isNullOrUndefined(e)?{}:("number"==typeof e&&(e=this.parent.getRowByIndex(e)),e?this.parent.getRowObjectFromUID(e.getAttribute("data-uid"))||{}:{})},r.prototype.getSelectedMovableCell=function(e){var t=this.parent,i=t.getColumnByIndex(e.cellIndex);return t.isFrozenGrid()&&"movable"===i.getFreezeTableName()?t.getMovableCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex)):null},r.prototype.selectCell=function(e,i){if(this.isCellType()){var r,n=this.parent,o=this.getSelectedMovableCell(e);o||(o=n.getCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex))),this.currentIndex=e.rowIndex;var s=this.getCurrentBatchRecordChanges()[this.currentIndex];if(this.isCellType()&&o&&!this.isEditing()){var l=o.classList.contains("e-cellselectionbackground");if(i=i?!t.isUndefined(this.prevCIdxs)&&e.rowIndex===this.prevCIdxs.rowIndex&&e.cellIndex===this.prevCIdxs.cellIndex&&l:i)this.successCallBack(r,i,e,o,s)(r);else{if(r={data:s,cellIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,cancel:!1},!t.isBlazor()||this.parent.isJsComponent){r.currentCell=o;r.previousRowCellIndex=this.prevECIdxs}this.parent.trigger("cellSelecting",this.fDataUpdate(r),this.successCallBack(r,i,e,o,s)),this.cellselected=!0}}}},r.prototype.successCallBack=function(e,i,r,n,o){var s=this;return function(e){if((t.isNullOrUndefined(e)||!0!==e.cancel)&&(i||(e.currentCell=e.currentCell?e.currentCell:n),s.clearCell(),i||s.updateCellSelection(n,r.rowIndex,r.cellIndex),!i)){var l=void 0;if(!t.isBlazor()||s.parent.isJsComponent||s.parent.isHybrid){(l={data:o,cellIndex:r,currentCell:n,selectedRowCellIndex:s.selectedRowCellIndexes,previousRowCell:s.prevECIdxs?s.getCellIndex(s.prevECIdxs.rowIndex,s.prevECIdxs.cellIndex):void 0}).previousRowCellIndex=s.prevECIdxs}else l={data:o,cellIndex:r,selectedRowCellIndex:s.selectedRowCellIndexes};s.updateCellProps(r,r),s.onActionComplete(l,"cellSelected")}}},r.prototype.getCellIndex=function(e,t){return this.parent.getFrozenColumns()&&t>=this.parent.getFrozenColumns()?this.parent.getMovableCellFromIndex(e,t):this.parent.getCellFromIndex(e,t)},r.prototype.selectCellsByRange=function(e,i){var r=this;if(this.isCellType()){var n=this.parent,o=this.getSelectedMovableCell(e),s=n.getFrozenColumns();o||(o=n.getCellFromIndex(e.rowIndex,e.cellIndex));var l,a,h,d=e,p=i=i||e;this.currentIndex=e.rowIndex;var c=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var u={data:c,cellIndex:e,currentCell:o,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};if(!t.isBlazor()){u.previousRowCellIndex=this.prevECIdxs}this.parent.trigger("cellSelecting",this.fDataUpdate(u),function(u){if(t.isNullOrUndefined(u)||!0!==u.cancel){if(r.clearCell(),e.rowIndex>i.rowIndex){var g=e;e=i,i=g}for(var f=e.rowIndex;f<=i.rowIndex;f++){r.selectionSettings.cellSelectionMode.indexOf("Box")<0?(l=f===e.rowIndex?e.cellIndex:0,a=f===i.rowIndex?i.cellIndex:r.getLastColIndex(f)):(l=e.cellIndex,a=i.cellIndex),h=[];for(var m=la?l:a;m<=y;m++)(o=s?m-1;if(v){var C=this.selectedRowCellIndexes[r].cellIndexes;C.indexOf(u.cellIndex)>-1?(this.cellDeselect("cellDeselecting",[{rowIndex:u.rowIndex,cellIndexes:[u.cellIndex]}],o,[i],d),C.splice(C.indexOf(u.cellIndex),1),0===C.length&&this.selectedRowCellIndexes.splice(r,1),i.classList.remove("e-cellselectionbackground"),i.removeAttribute("aria-selected"),this.cellDeselect("cellDeselected",[{rowIndex:u.rowIndex,cellIndexes:[u.cellIndex]}],o,[i],d)):(v=!1,this.onActionBegin(y,"cellSelecting"),this.addRowCellIndex({rowIndex:u.rowIndex,cellIndex:u.cellIndex}),this.updateCellSelection(i),this.addAttribute(i))}else{if(this.onActionBegin(y,"cellSelecting"),!t.isNullOrUndefined(y)&&!0===y.cancel)return;this.updateCellSelection(i,u.rowIndex,u.cellIndex)}if(!v){var w=void 0;if(!t.isBlazor()||this.parent.isJsComponent||this.parent.isHybrid){var b="previousRowCellIndex";(w={data:o,cellIndex:e[0],currentCell:i,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,selectedRowCellIndex:this.selectedRowCellIndexes})[b]=this.prevECIdxs}else w={data:o,cellIndex:e[0],selectedRowCellIndex:this.selectedRowCellIndexes};this.onActionComplete(w,"cellSelected"),this.cellselected=!0}this.updateCellProps(u,u)}}}},r.prototype.getColIndex=function(e,t){var i=this.parent.isFrozenGrid(),r=this.parent.getColumnByIndex(t),n=He(this.parent,r,e);if(n)for(var o=0;ol&&(i=l,l=n,n=i),o>a&&(i=a,a=o,o=i),this.element.style.left=n+"px",this.element.style.top=o+"px",this.element.style.width=l-n+"px",this.element.style.height=a-o+"px"),h&&!e.ctrlKey&&!e.shiftKey){var d=parseInt(h.getAttribute("aria-rowindex"),10);if(this.isCellDrag){var p=O(e.target,"e-rowcell");p&&(this.startAFCell=this.startCell,this.endAFCell=O(e.target,"e-rowcell"),this.selectLikeExcel(e,d,parseInt(p.getAttribute("aria-colindex"),10)))}else this.hideAutoFill(),this.selectRowsByRange(this.startDIndex,d)}},r.prototype.selectLikeExcel=function(e,t,i){this.isAutoFillSel?(this.showAFBorders(),this.selectLikeAutoFill(e)):(this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:t,cellIndex:i}),this.drawBorders())},r.prototype.drawBorders=function(){"BoxWithBorder"===this.selectionSettings.cellSelectionMode&&this.selectedRowCellIndexes.length&&!this.parent.isEdit?(this.parent.element.classList.add("e-enabledboxbdr"),this.bdrElement||this.createBorders(),this.positionBorders()):this.showHideBorders("none")},r.prototype.isLastCell=function(e){var t=[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"));return t[t.length-1]===e},r.prototype.isLastRow=function(e){var i=[].slice.call(t.closest(e,"tbody").querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===i[i.length-1]},r.prototype.isFirstRow=function(e){var i=[].slice.call(t.closest(e,"tbody").querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===i[0]},r.prototype.isFirstCell=function(e){return[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"))[0]===e},r.prototype.setBorders=function(e,t,i){var r=[].slice.call(e.querySelectorAll(".e-cellselectionbackground")).filter(function(e){return""===e.style.display});if(r.length){var n=this.parent.isFrozenGrid(),o=r[0],s=r[r.length-1],l=o.getBoundingClientRect(),a=s.getBoundingClientRect(),h=o.offsetParent.getBoundingClientRect(),d=!this.isLastRow(s)||"1"!==i&&"2"!==i&&"5"!==i?0:2,p=this.parent.frozenRows&&("1"===i||"2"===i)&&this.isFirstRow(o)?1.5:0,c=n&&("2"===i||"4"===i)&&this.isFirstCell(o)?1:0,u=("Right"!==this.parent.getFrozenMode()||"1"!==i&&"3"!==i)&&("Left-Right"!==this.parent.getFrozenMode()||"5"!==i&&"6"!==i)||!this.isFirstCell(o)?0:1;this.parent.enableRtl?(t.style.right=h.right-l.right-c+"px",t.style.width=l.right-a.left+c+1+"px"):(t.style.left=l.left-h.left-c-u+"px",t.style.width=a.right-l.left+c-u+1+"px"),t.style.top=l.top-h.top-p+"px",t.style.height=a.top-l.top>0?a.top-h.top+a.height+1-(l.top-h.top)-d+p+"px":a.height+p-d+1+"px",this.selectDirection+=i}else t.style.display="none"},r.prototype.positionBorders=function(){this.updateStartEndCells(),this.startCell&&this.bdrElement&&this.selectedRowCellIndexes.length&&(this.selectDirection="",this.showHideBorders(""),this.setBorders(this.parent.getContentTable(),this.bdrElement,"1"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.contentModule.getMovableContent(),this.mcBdrElement,"2"),"Left-Right"===this.parent.getFrozenMode()&&this.setBorders(this.parent.contentModule.getFrozenRightContent(),this.frcBdrElement,"5")),this.parent.frozenRows&&(this.setBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.headerModule.getMovableHeader(),this.mhBdrElement,"4"),"Left-Right"===this.parent.getFrozenMode()&&this.setBorders(this.parent.headerModule.getFrozenRightHeader(),this.frhBdrElement,"6"))),this.applyBorders(this.selectDirection))},r.prototype.applyBothFrozenBorders=function(e){var t=this.parent.enableRtl;switch(e.length){case 6:this.bdrElement.style.borderWidth=t?"0 2px 2px 0":"0 0 2px 2px",this.mcBdrElement.style.borderWidth="0 0 2px 0",this.fhBdrElement.style.borderWidth=t?"2px 2px 0 0":"2px 0 0 2px",this.mhBdrElement.style.borderWidth="2px 0 0 0",this.frcBdrElement.style.borderWidth=t?"0 0 2px 2px":"0 2px 2px 0",this.frhBdrElement.style.borderWidth=t?"2px 0 0 2px":"2px 2px 0 0";break;case 4:e.includes("1")&&e.includes("2")&&e.includes("3")&&e.includes("4")&&(this.bdrElement.style.borderWidth=t?"0 2px 2px 0":"0 0 2px 2px",this.mcBdrElement.style.borderWidth=t?"0 0 2px 2px":"0 2px 2px 0",this.fhBdrElement.style.borderWidth=t?"2px 2px 0 0":"2px 0 0 2px",this.mhBdrElement.style.borderWidth=t?"2px 0 0 2px":"2px 2px 0 0"),e.includes("2")&&e.includes("4")&&e.includes("5")&&e.includes("6")&&(this.mcBdrElement.style.borderWidth=t?"0 2px 2px 0":"0 0 2px 2px",this.mhBdrElement.style.borderWidth=t?"2px 2px 0 0":"2px 0 0 2px",this.frcBdrElement.style.borderWidth=t?"0 0 2px 2px":"0 2px 2px 0",this.frhBdrElement.style.borderWidth=t?"2px 0 0 2px":"2px 2px 0 0");break;case 3:this.bdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.mcBdrElement.style.borderWidth="2p 0 2px 0",this.frcBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0",this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.mhBdrElement.style.borderWidth="2px 0 2px 0",this.frcBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0");break;case 2:e.includes("1")&&(this.mcBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0",this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth="2px 2px 0 2px")),e.includes("2")&&(this.bdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.frcBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0",this.parent.frozenRows&&(this.mhBdrElement.style.borderWidth="2px 2px 0 2px")),e.includes("3")&&(this.mhBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0",this.bdrElement.style.borderWidth="0 2px 2px 2px"),e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.frhBdrElement.style.borderWidth=t?"2px 0 2px 2px":"2px 2px 2px 0",this.mcBdrElement.style.borderWidth="0 2px 2px 2px"),e.includes("5")&&(this.mcBdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.parent.frozenRows&&(this.frhBdrElement.style.borderWidth="2px 2px 0 2px")),e.includes("6")&&(this.mhBdrElement.style.borderWidth=t?"2px 2px 2px 0":"2px 0 2px 2px",this.frcBdrElement.style.borderWidth="0 2px 2px 2px");break;default:this.bdrElement.style.borderWidth="2px",this.mcBdrElement.style.borderWidth="2px",this.frcBdrElement.style.borderWidth="2px",this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth="2px",this.mhBdrElement.style.borderWidth="2px",this.frhBdrElement.style.borderWidth="2px")}},r.prototype.applyBorders=function(e){var t=this.parent.enableRtl;if("Left-Right"===this.parent.getFrozenMode())this.applyBothFrozenBorders(e);else switch(e.length){case 4:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=t?"0 0 2px 2px":"0 2px 2px 0",this.mcBdrElement.style.borderWidth=t?"0 2px 2px 0":"0 0 2px 2px",this.fhBdrElement.style.borderWidth=t?"2px 0 0 2px":"2px 2px 0 0",this.mhBdrElement.style.borderWidth=t?"2px 2px 0 0":"2px 0 0 2px"):(this.bdrElement.style.borderWidth=t?"0 2px 2px 0":"0 0 2px 2px",this.mcBdrElement.style.borderWidth=t?"0 0 2px 2px":"0 2px 2px 0",this.fhBdrElement.style.borderWidth=t?"2px 2px 0 0":"2px 0 0 2px",this.mhBdrElement.style.borderWidth=t?"2px 0 0 2px":"2px 2px 0 0");break;case 2:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=e.includes("2")?t?"2px 0 2px 2px":"2px 2px 2px 0":"0 2px 2px 2px",this.mcBdrElement.style.borderWidth=e.includes("1")?t?"2px 2px 2px 0":"2px 0 2px 2px":"0 2px 2px 2px",this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=e.includes("1")?"2px 2px 0 2px":t?"2px 0 2px 2px":"2px 2px 2px 0",this.mhBdrElement.style.borderWidth=e.includes("2")?"2px 2px 0 2px":t?"2px 2px 2px 0":"2px 0 2px 2px")):(this.bdrElement.style.borderWidth=e.includes("2")?t?"2px 2px 2px 0":"2px 0 2px 2px":"0 2px 2px 2px",this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=e.includes("1")?t?"2px 0 2px 2px":"2px 2px 2px 0":"0 2px 2px 2px"),this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=e.includes("1")?"2px 2px 0 2px":t?"2px 2px 2px 0":"2px 0 2px 2px",this.parent.isFrozenGrid()&&(this.mhBdrElement.style.borderWidth=e.includes("2")?"2px 2px 0 2px":t?"2px 0 2px 2px":"2px 2px 2px 0")));break;default:this.bdrElement.style.borderWidth="2px",this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth="2px"),this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth="2px",this.parent.isFrozenGrid()&&(this.mhBdrElement.style.borderWidth="2px"))}},r.prototype.createBorders=function(){this.bdrElement||(this.bdrElement=this.parent.getContentTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdr",styles:"width: 2px; border-width: 0;"})),this.parent.isFrozenGrid()&&(this.mcBdrElement=this.parent.contentModule.getMovableContent().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_mcbdr",styles:"height: 2px; border-width: 0;"})),"Left-Right"===this.parent.getFrozenMode()&&(this.frcBdrElement=this.parent.contentModule.getFrozenRightContent().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_frcbdr",styles:"height: 2px; border-width: 0;"})))),this.parent.frozenRows&&(this.fhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_fhbdr",styles:"height: 2px;"}))),this.parent.frozenRows&&this.parent.isFrozenGrid()&&(this.mhBdrElement=this.parent.headerModule.getMovableHeader().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_mhbdr",styles:"height: 2px;"})),"Left-Right"===this.parent.getFrozenMode()&&(this.frhBdrElement=this.parent.headerModule.getFrozenRightHeader().appendChild(t.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_frhbdr",styles:"height: 2px;"})))))},r.prototype.showHideBorders=function(e){this.bdrElement&&(this.bdrElement.style.display=e,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.display=e,"Left-Right"===this.parent.getFrozenMode()&&(this.frcBdrElement.style.display=e)),this.parent.frozenRows&&(this.fhBdrElement.style.display=e),this.parent.frozenRows&&this.parent.isFrozenGrid()&&(this.mhBdrElement.style.display=e,"Left-Right"===this.parent.getFrozenMode()&&(this.frhBdrElement.style.display=e)))},r.prototype.drawAFBorders=function(){this.bdrAFBottom||this.createAFBorders(),this.positionAFBorders()},r.prototype.positionAFBorders=function(){if(this.startCell&&this.bdrAFLeft){var e=this.startAFCell.getBoundingClientRect(),t=this.endAFCell.getBoundingClientRect(),i=t.top-e.top>0?1:0,r=t.top-e.top>=0&&(O(this.startAFCell,"e-movablecontent")||O(this.startAFCell,"e-frozencontent"))&&this.isFirstRow(this.startAFCell)?1.5:0,n=(O(this.startAFCell,"e-movablecontent")||O(this.startAFCell,"e-movableheader"))&&this.isFirstCell(this.startAFCell)?1:0,o=this.isLastRow(this.endAFCell)&&(O(this.endAFCell,"e-movablecontent")||O(this.endAFCell,"e-frozencontent"))?2:0,s=this.startAFCell.offsetParent.getBoundingClientRect(),l=this.parent.element.getBoundingClientRect(),a=this.startAFCell.offsetParent.parentElement.scrollTop,h=this.startAFCell.offsetParent.parentElement.scrollLeft,d=a-this.startAFCell.offsetTop,p=h-this.startAFCell.offsetLeft,c=this.parent.element.clientHeight,u=this.parent.element.clientWidth;d=d>0?Math.floor(d)-1:0,p=p>0?p:0;var g=e.left-l.left;if(this.parent.enableRtl){var f=O(this.startAFCell,"e-movablecontent")||O(this.startAFCell,"e-movableheader")?e.right-this.startAFCell.offsetParent.parentElement.getBoundingClientRect().width-l.left:0;this.bdrAFLeft.style.right=l.right-t.right-2+t.width+"px",this.bdrAFLeft.style.width=u<=parseInt(this.bdrAFLeft.style.right,10)?"0px":"2px",this.bdrAFRight.style.right=l.right-e.right-n+f-1+"px",this.bdrAFTop.style.left=t.left-l.left-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFLeft.style.right,10)-parseInt(this.bdrAFRight.style.right,10)-n+1+"px",parseInt(this.bdrAFTop.style.left,10)<0&&(this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)+"px",this.bdrAFTop.style.left="0px")}else if(this.bdrAFLeft.style.left=g-n+p-1+"px",this.bdrAFRight.style.left=t.left-l.left-2+t.width+"px",this.bdrAFRight.style.width=u<=parseInt(this.bdrAFRight.style.left,10)?"0px":"2px",this.bdrAFTop.style.left=g+p-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFRight.style.left,10)-parseInt(this.bdrAFLeft.style.left,10)-n+1+"px",u<=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)){var m=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)-u;this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-m+"px"}if(this.bdrAFLeft.style.top=e.top-l.top-r+d+"px",this.bdrAFLeft.style.height=t.top-e.top>0?t.top-s.top+t.height+1-(e.top-s.top)+r-o-d+"px":t.height+r-o-d+"px",this.bdrAFRight.style.top=this.bdrAFLeft.style.top,this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px",this.bdrAFTop.style.top=this.bdrAFRight.style.top,this.bdrAFBottom.style.left=this.bdrAFTop.style.left,this.bdrAFBottom.style.top=parseFloat(this.bdrAFLeft.style.top)+parseFloat(this.bdrAFLeft.style.height)-i-1+"px",this.bdrAFBottom.style.width=c<=parseFloat(this.bdrAFBottom.style.top)?"0px":this.bdrAFTop.style.width,c<=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)){var y=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)-c;this.bdrAFLeft.style.height=parseInt(this.bdrAFLeft.style.height,10)-y+"px",this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px"}}},r.prototype.createAFBorders=function(){this.bdrAFLeft||(this.bdrAFLeft=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafleft",styles:"width: 2px;"})),this.bdrAFRight=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafright",styles:"width: 2px;"})),this.bdrAFBottom=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafbottom",styles:"height: 2px;"})),this.bdrAFTop=this.parent.element.appendChild(t.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdraftop",styles:"height: 2px;"})))},r.prototype.showAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="",this.bdrAFRight.style.display="",this.bdrAFBottom.style.display="",this.bdrAFTop.style.display="")},r.prototype.hideAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="none",this.bdrAFRight.style.display="none",this.bdrAFBottom.style.display="none",this.bdrAFTop.style.display="none")},r.prototype.updateValue=function(e,t,i){var r=this.createBeforeAutoFill(e,t,i);if(!r.cancel){var n=this.parent.getColumnByIndex(t);this.parent.editModule&&i&&("number"===n.type?this.parent.editModule.updateCell(e,n.field,parseInt(r.value,10)):this.parent.editModule.updateCell(e,n.field,r.value))}},r.prototype.createBeforeAutoFill=function(e,t,i){var r={column:this.parent.getColumnByIndex(t),value:i.innerText};return this.parent.trigger("beforeAutoFill",r),r},r.prototype.getAutoFillCells=function(e,t){var i=".e-cellselectionbackground",r=[].slice.call(this.parent.getDataRows()[e].querySelectorAll(i));return this.parent.isFrozenGrid()&&(r=r.concat([].slice.call(this.parent.getMovableDataRows()[e].querySelectorAll(i))),"Left-Right"===this.parent.getFrozenMode()&&(r=r.concat([].slice.call(this.parent.getFrozenRightDataRows()[e].querySelectorAll(i))))),r},r.prototype.selectLikeAutoFill=function(e,t){var i=parseInt(O(this.startAFCell,"e-row").getAttribute("aria-rowindex"),10),r=parseInt(this.startAFCell.getAttribute("aria-colindex"),10),n=parseInt(O(this.endAFCell,"e-row").getAttribute("aria-rowindex"),10),o=parseInt(this.endAFCell.getAttribute("aria-colindex"),10),s=this.selectedRowCellIndexes.length-1,l=this.selectedRowCellIndexes[0].cellIndexes.length-1;switch(!0){case!t&&this.endAFCell.classList.contains("e-cellselectionbackground")&&!!O(e.target,"e-rowcell"):this.startAFCell=this.parent.getCellFromIndex(i,r),this.endAFCell=this.parent.getCellFromIndex(i+s,r+l),this.drawAFBorders();break;case this.autoFillRLselection&&r+ln-i-s&&o-r-l+1>i-n:if(this.endAFCell=this.parent.getCellFromIndex(i+s,o),n=parseInt(O(this.endAFCell,"e-row").getAttribute("aria-rowindex"),10),o=parseInt(this.endAFCell.getAttribute("aria-colindex"),10),t){for(var a=parseInt(this.endCell.getAttribute("aria-colindex"),10),h=i;h<=n;h++)for(var d=this.getAutoFillCells(h,r),p=0,c=a+1;c<=o;c++)p>l&&(p=0),this.updateValue(h,c,d[p]),p++;this.selectCellsByRange({rowIndex:i,cellIndex:this.startCellIndex},{rowIndex:n,cellIndex:o})}else this.drawAFBorders();break;case this.autoFillRLselection&&r>o&&r-o+1>n-i-s&&r-o+1>i-n:if(this.startAFCell=this.parent.getCellFromIndex(i,o),this.endAFCell=this.endCell,t){for(h=i;h<=i+s;h++){(d=this.getAutoFillCells(h,r)).reverse();for(var p=0,c=this.startCellIndex-1;c>=o;c--)p>l&&(p=0),this.updateValue(h,c,d[p]),p++}this.selectCellsByRange({rowIndex:i,cellIndex:o},{rowIndex:i+s,cellIndex:this.startCellIndex+l})}else this.drawAFBorders();break;case i>n:if(this.startAFCell=this.parent.getCellFromIndex(n,r),this.endAFCell=this.endCell,t){for(var u=g=parseInt(this.endCell.parentElement.getAttribute("aria-rowindex"),10),h=i-1;h>=n;h--){u===this.startIndex-1&&(u=g);var d=this.getAutoFillCells(u,r),p=0;u--;for(c=this.startCellIndex;c<=this.startCellIndex+l;c++)this.updateValue(h,c,d[p]),p++}this.selectCellsByRange({rowIndex:n,cellIndex:r+l},{rowIndex:i+s,cellIndex:r})}else this.drawAFBorders();break;default:if(this.endAFCell=this.parent.getCellFromIndex(n,r+l),t){for(var g=parseInt(this.endCell.parentElement.getAttribute("aria-rowindex"),10),u=this.startIndex,h=g+1;h<=n;h++){u===g+1&&(u=this.startIndex);d=this.getAutoFillCells(u,r);u++;for(var p=0,f=this.startCellIndex;f<=this.startCellIndex+l;f++)this.updateValue(h,f,d[p]),p++}this.selectCellsByRange({rowIndex:g-s,cellIndex:r},{rowIndex:n,cellIndex:r+l})}else this.drawAFBorders()}},r.prototype.mouseUpHandler=function(e){if(document.body.classList.remove("e-disableuserselect"),this.element&&t.remove(this.element),this.isDragged&&1===this.selectedRowCellIndexes.length&&1===this.selectedRowCellIndexes[0].cellIndexes.length?this.mUPTarget=O(e.target,"e-rowcell"):this.mUPTarget=null,this.isDragged&&!this.isAutoFillSel&&"Cell"===this.selectionSettings.mode){var i=e.target,r=parseInt(i.parentElement.getAttribute("aria-rowindex"),10),n=parseInt(i.getAttribute("aria-colindex"),10);this.isDragged=!1,this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:r,cellIndex:n})}if(this.isDragged=!1,this.updateAutoFillPosition(),this.isAutoFillSel){var o=O(e.target,"e-rowcell");this.endAFCell=o||(this.endCell===this.endAFCell?this.startAFCell:this.endAFCell),this.startAFCell=this.startCell,this.updateStartCellsIndex(),this.selectLikeAutoFill(e,!0),this.updateAutoFillPosition(),this.hideAFBorders(),this.positionBorders(),this.isAutoFillSel=!1}t.EventHandler.remove(this.parent.getContent(),"mousemove",this.mouseMoveHandler),this.parent.frozenRows&&t.EventHandler.remove(this.parent.getHeaderContent(),"mousemove",this.mouseMoveHandler),t.EventHandler.remove(document,"mouseup",this.mouseUpHandler)},r.prototype.hideAutoFill=function(){this.autofill&&(this.autofill.style.display="none")},r.prototype.updateAutoFillPosition=function(){if(this.parent.enableAutoFill&&!this.parent.isEdit&&this.selectionSettings.cellSelectionMode.indexOf("Box")>-1&&!this.isRowType()&&!this.isSingleSel()&&this.selectedRowCellIndexes.length){var e=parseInt(this.target.getAttribute("aria-colindex"),10),i=parseInt(this.target.getAttribute("index"),10),r=this.selectedRowCellIndexes[this.selectedRowCellIndexes.length-1].rowIndex,n=this.getAutoFillCells(r,e).filter(function(e){return""===e.style.display}),o=this.parent.getColumnByIndex(e),s="movable"===o.getFreezeTableName(),l=i-1&&!this.isRowType()&&!this.isSingleSel())this.isCellDrag=!0,i=!0;else if(n.allowRowDragAndDrop&&!n.isEdit&&!this.parent.selectionSettings.checkboxOnly){if(!this.isRowType()||this.isSingleSel()||t.closest(r,"td").classList.contains("e-selectionbackground"))return void(this.isDragged=!1);i=!0,this.element=this.parent.createElement("div",{className:"e-griddragarea"}),n.getContent().appendChild(this.element)}i&&this.enableDrag(e,!0)}this.updateStartEndCells(),(r.classList.contains("e-autofill")||r.classList.contains("e-xlsel"))&&(this.isCellDrag=!0,this.isAutoFillSel=!0,this.enableDrag(e))}},r.prototype.updateStartEndCells=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-cellselectionbackground"));this.startCell=e[0],this.endCell=e[e.length-1],this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute("aria-rowindex"),10),this.startCellIndex=parseInt(O(this.startCell,"e-rowcell").getAttribute("aria-colindex"),10))},r.prototype.updateStartCellsIndex=function(){this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute("aria-rowindex"),10),this.startCellIndex=parseInt(O(this.startCell,"e-rowcell").getAttribute("aria-colindex"),10))},r.prototype.enableDrag=function(e,i){var r=this.parent;if(i){var n=t.closest(e.target,"tr");this.startDIndex=parseInt(n.getAttribute("aria-rowindex"),10),this.startDCellIndex=parseInt(O(e.target,"e-rowcell").getAttribute("aria-colindex"),10)}document.body.classList.add("e-disableuserselect");var o=r.element.getBoundingClientRect(),s=P(e);this.x=s.x-o.left,this.y=s.y-o.top,t.EventHandler.add(r.getContent(),"mousemove",this.mouseMoveHandler,this),this.parent.frozenRows&&t.EventHandler.add(r.getHeaderContent(),"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)},r.prototype.clearSelAfterRefresh=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;"virtualscroll"===e.requestType||this.parent.isPersistSelection||t||this.clearSelection()},r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Dt,this.enableAfterRender,this),this.parent.on(Tt,this.initializeSelection,this),this.parent.on("rowselected",this.onActionComplete,this),this.parent.on("cellselected",this.onActionComplete,this),this.parent.on(At,this.onPropertyChanged,this),this.parent.on("cellfocused",this.onCellFocused,this),this.parent.on("beforeFragAppend",this.clearSelAfterRefresh,this),this.parent.on(Vt,this.columnPositionChanged,this),this.parent.on(Mt,this.initialEnd,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(yt,this.actionBeginFunction),this.parent.addEventListener(vt,this.actionCompleteFunction),this.parent.on(_t,this.rowsRemoved,this),this.parent.on(Lt,this.refreshHeader,this),this.addEventListener_checkbox())},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Dt,this.enableAfterRender),this.parent.off(Tt,this.initializeSelection),this.parent.off("rowselected",this.onActionComplete),this.parent.off("cellselected",this.onActionComplete),this.parent.off(At,this.onPropertyChanged),this.parent.off("cellfocused",this.onCellFocused),this.parent.off("beforeFragAppend",this.clearSelAfterRefresh),this.parent.off(Vt,this.columnPositionChanged),this.parent.removeEventListener(yt,this.actionBeginFunction),this.parent.removeEventListener(vt,this.actionCompleteFunction),this.parent.off(_t,this.rowsRemoved),this.parent.off(Lt,this.refreshHeader),this.removeEventListener_checkbox())},r.prototype.wireEvents=function(){this.isMacOS=-1!==navigator.userAgent.indexOf("Mac OS"),this.isMacOS&&(t.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.parent.element,"keyup",this.keyUpHandler,this))},r.prototype.unWireEvents=function(){this.isMacOS&&(t.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.parent.element,"keyup",this.keyUpHandler))},r.prototype.columnPositionChanged=function(){this.parent.isPersistSelection||this.clearSelection()},r.prototype.refreshHeader=function(){this.setCheckAllState()},r.prototype.rowsRemoved=function(e){for(var t=0;t1&&(this.clearCellSelection(),this.prevCIdxs=void 0),this.selectedRowIndexes.length>1&&(this.clearRowSelection(),this.prevRowIndex=void 0),this.selectedColumnsIndexes.length>1&&(this.clearColumnSelection(),this.prevColIndex=void 0),this.enableSelectMultiTouch=!1,this.hidePopUp()),t.isNullOrUndefined(e.properties.mode)&&t.isNullOrUndefined(e.properties.cellSelectionMode)||(this.clearSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevColIndex=void 0),this.isPersisted=!0,this.checkBoxSelectionChanged(),this.isPersisted=!1,this.initPerisistSelection(),this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&(i.isCheckBoxSelection=!("ResetOnRowClick"===this.selectionSettings.checkboxMode)),this.drawBorders()}},r.prototype.hidePopUp=function(){this.parent.element.querySelector(".e-gridpopup").querySelectorAll(".e-rowselect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none")},r.prototype.initialEnd=function(e){var t=this.parent.isFrozenGrid(),i="Left-Right"===this.parent.getFrozenMode();(!t||t&&!i&&!e.args.isFrozen||i&&e.args.renderFrozenRightContent)&&(this.parent.off(Mt,this.initialEnd),this.selectRow(this.parent.selectedRowIndex))},r.prototype.checkBoxSelectionChanged=function(){this.parent.off(Mt,this.checkBoxSelectionChanged);var e=this.parent,i=e.getColumns().filter(function(e){return"checkbox"===e.type});i.length>0&&(e.isCheckBoxSelection=!0,this.chkField=i[0].field,this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount,t.isNullOrUndefined(this.totalRecordsCount)&&(this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),this.isSingleSel()?(e.selectionSettings.type="Multiple",e.dataBind()):this.initPerisistSelection()),e.isCheckBoxSelection||this.isPersisted||(this.chkField=null,this.initPerisistSelection())},r.prototype.initPerisistSelection=function(){var e=this.parent;this.parent.selectionSettings.persistSelection&&this.parent.getPrimaryKeyFieldNames().length>0?(e.isPersistSelection=!0,this.ensureCheckboxFieldSelection()):this.parent.getPrimaryKeyFieldNames().length>0?(e.isPersistSelection=!1,this.ensureCheckboxFieldSelection()):(e.isPersistSelection=!1,this.selectedRowState={})},r.prototype.ensureCheckboxFieldSelection=function(){var e=this.parent;if(this.primaryKey=this.parent.getPrimaryKeyFieldNames()[0],!e.enableVirtualization&&this.chkField&&(e.isPersistSelection&&0===Object.keys(this.selectedRowState).length||!e.isPersistSelection)){var t=this.parent.getDataModule(),r=(new i.Query).where(this.chkField,"equal",!0);r.params||(r.params=this.parent.query.params);var n=t.getData({},r),o=this;this.parent.showSpinner(),n.then(function(e){o.dataSuccess(e.result),o.refreshPersistSelection(),o.parent.hideSpinner()})}},r.prototype.dataSuccess=function(e){for(var i=0;i0&&(this.parent.isPersistSelection||this.chkField)){for(var i=[],r=0;r0||"Intermediate"===this.parent.checkAllRows&&!t.isNullOrUndefined(this.chkField)&&n.data[this.chkField]?(i.push(parseInt(e[r].getAttribute("aria-rowindex"),10)),s=!0):(s=!1,this.checkedTarget!==l&&this.parent.isCheckBoxSelection&&oe(l.nextElementSibling,s)),this.updatePersistCollection(e[r],s)}this.isSingleSel()&&i.length>0?this.selectRow(i[0],!0):this.selectRows(i)}this.parent.isCheckBoxSelection&&this.getCurrentBatchRecordChanges().length>0&&this.setCheckAllState()},r.prototype.actionBegin=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){var i=this.parent.element.querySelector(".e-edit-checkselect");if(!t.isNullOrUndefined(i)){var r=t.closest(i,".e-editedrow");if(r){"Dialog"===this.parent.editSettings.mode&&(r=this.parent.element.querySelector(".e-dlgeditrow"));var n=this.getRowObj(r);if(!n)return;this.selectedRowState[n.data[this.primaryKey]]=n.isSelected=i.checked}else this.isCheckedOnAdd=i.checked}}},r.prototype.actionComplete=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){if("add"===e.action&&this.isCheckedOnAdd){var i=this.parent.getRowObjectFromUID(this.parent.getRows()[e.selectedRow].getAttribute("data-uid"));this.selectedRowState[i.data[this.primaryKey]]=i.isSelected=this.isCheckedOnAdd}this.refreshPersistSelection()}if("delete"===e.requestType&&this.parent.isPersistSelection){for(var r=[],n=(r=t.isBlazor()?this.getSelectedRecords():e.data).slice(),o=0;o0&&this.setCheckAllState(),this.triggerChkChangeEvent(e,!n)},r.prototype.getCheckAllStatus=function(e){var t=e?e.nextElementSibling.classList:this.getCheckAllBox().nextElementSibling.classList;return t.contains("e-check")?"Check":t.contains("e-uncheck")?"Uncheck":t.contains("e-stop")?"Intermediate":"None"},r.prototype.checkSelect=function(e){var i=t.closest(this.checkedTarget,".e-rowcell"),r=this.parent;this.isMultiCtrlRequest=!0;var n=0;if(this.isHeaderCheckboxClicked=!1,pe(r)){var o=i.parentElement.getAttribute("data-uid");n=r.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(o)}else n=parseInt(i.parentElement.getAttribute("aria-rowindex"),10);this.parent.isPersistSelection&&this.parent.element.querySelectorAll(".e-addedrow").length>0&&"Top"===this.parent.editSettings.newRowPosition&&++n,this.rowCellSelectionHandler(n,parseInt(i.getAttribute("aria-colindex"),10)),this.moveIntoUncheckCollection(t.closest(i,".e-row")),this.setCheckAllState(),this.isMultiCtrlRequest=!1,this.triggerChkChangeEvent(e,e.nextElementSibling.classList.contains("e-check"))},r.prototype.moveIntoUncheckCollection=function(e){if("Check"===this.parent.checkAllRows||"Uncheck"===this.parent.checkAllRows){var t=this.getRowObj(e),i=t&&t.data?t.data[this.primaryKey]:null;if(!i)return;this.chkAllCollec.indexOf(i)<0?this.chkAllCollec.push(i):this.chkAllCollec.splice(this.chkAllCollec.indexOf(i),1)}},r.prototype.triggerChkChangeEvent=function(e,t){this.parent.trigger("checkBoxChange",{checked:t,selectedRowIndexes:this.parent.getSelectedRowIndexes(),target:e}),this.parent.isEdit||(this.checkedTarget=null)},r.prototype.updateSelectedRowIndex=function(e){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!this.parent.getDataModule().isRemote()&&(!t.isBlazor()||!this.parent.isServerRendered))if("Check"===this.parent.checkAllRows){this.selectedRowIndexes=[];for(var i=this.getData().length,r=0;r0&&(n=o.querySelector('input[type="checkbox"]'),r=!0),this.drawBorders(),this.updateAutoFillPosition(),(i=O(i,"e-rowcell"))&&i.parentElement.classList.contains("e-row")&&!this.parent.selectionSettings.checkboxOnly||r){if(this.parent.isCheckBoxSelection&&(this.isMultiCtrlRequest=!0),this.target=i,t.isNullOrUndefined(n)){var s=this.parent,l=0;if(pe(s)){a=i.parentElement.getAttribute("data-uid");l=s.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(a)}else l=parseInt(i.parentElement.getAttribute("aria-rowindex"),10);this.parent.isPersistSelection&&this.parent.element.querySelectorAll(".e-addedrow").length>0&&++l,this.mUPTarget&&this.mUPTarget.isEqualNode(i)||this.rowCellSelectionHandler(l,parseInt(i.getAttribute("aria-colindex"),10)),this.parent.hoverFrozenRows(e),this.parent.isCheckBoxSelection&&(this.moveIntoUncheckCollection(t.closest(i,".e-row")),this.setCheckAllState())}else this.checkedTarget=n,n.classList.contains("e-checkselectall")?this.checkSelectAll(n):this.checkSelect(n);this.parent.isCheckBoxSelection||!t.Browser.isDevice||this.isSingleSel()||this.showPopup(e)}else if(e.target.classList.contains("e-headercell")&&!e.target.classList.contains("e-stackedheadercell")){var a=e.target.querySelector(".e-headercelldiv").getAttribute("e-mappinguid");this.headerSelectionHandler(this.parent.getColumnIndexByUid(a))}this.isMultiCtrlRequest=!1,this.isMultiShiftRequest=!1,t.isNullOrUndefined(t.closest(e.target,".e-unboundcell"))&&(this.preventFocus=!1)},r.prototype.popUpClickHandler=function(e){var i=e.target;t.closest(i,".e-headercell")||e.target.classList.contains("e-rowcell")||t.closest(i,".e-gridpopup")?i.classList.contains("e-rowselect")&&(i.classList.contains("e-spanclicked")?(i.classList.remove("e-spanclicked"),this.enableSelectMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(i.classList.add("e-spanclicked"),this.enableSelectMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},r.prototype.showPopup=function(e){this.selectionSettings.enableSimpleMultiRowSelection||E(this.parent.element.querySelector(".e-gridpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(!this.isSingleSel()&&(this.selectedRecords.length>(this.parent.getFrozenColumns()?2:1)||this.selectedRowCellIndexes.length>1)?" e-spanclicked":""))},r.prototype.rowCellSelectionHandler=function(e,i){this.parent;if(!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel())this.isDragged||this.selectRow(e,this.selectionSettings.enableToggle),this.selectCell({rowIndex:e,cellIndex:i},this.selectionSettings.enableToggle),this.selectedRowCellIndexes.length&&this.updateAutoFillPosition(),this.drawBorders();else if(this.isMultiShiftRequest)this.parent.isCheckBoxSelection||!this.parent.isCheckBoxSelection&&!t.closest(this.target,".e-rowcell").classList.contains("e-gridchkbox")?this.selectRowsByRange(t.isUndefined(this.prevRowIndex)?e:this.prevRowIndex,e):this.addRowsToSelection([e]),this.selectCellsByRange(t.isUndefined(this.prevCIdxs)?{rowIndex:e,cellIndex:i}:this.prevCIdxs,{rowIndex:e,cellIndex:i}),this.updateAutoFillPosition(),this.drawBorders();else{if(this.addRowsToSelection([e]),t.isBlazor()&&this.parent.enableVirtualization&&this.parent.isServerRendered){var r=this.parent.getSelectedRowIndexes();this.parent.interopAdaptor.invokeMethodAsync("MaintainSelection",!0,"normal",r)}this.addCellsToSelection([{rowIndex:e,cellIndex:i}]),this.showHideBorders("none")}this.isDragged=!1},r.prototype.onCellFocused=function(e){if(this.parent.frozenRows&&e.container.isHeader&&e.byKey)if("upArrow"===e.keyArgs.action)this.parent.allowFiltering?e.isJump="INPUT"===e.element.tagName:e.isJump="TH"===e.element.tagName;else if("downArrow"===e.keyArgs.action){var i=Number(e.element.parentElement.getAttribute("aria-rowindex"));e.isJump=0===i}else"ctrlHome"===e.keyArgs.action&&(e.isJump=!0);var r=this.parent.isFrozenGrid()?(e.container.isHeader&&"TD"!==e.element.tagName&&e.isJump&&!this.selectionSettings.allowColumnSelection||(e.container.isContent||"TD"===e.element.tagName)&&!(e.container.isSelectable||"TD"===e.element.tagName))&&!(e.byKey&&"space"===e.keyArgs.action):(e.container.isHeader&&e.isJump||e.container.isContent&&!e.container.isSelectable)&&!(e.byKey&&"space"===e.keyArgs.action)&&!(e.element.classList.contains("e-detailrowexpand")||e.element.classList.contains("e-detailrowcollapse")),n=e.container.isHeader&&"TD"!==e.element.tagName&&!t.closest(e.element,".e-rowcell")&&!(e.byKey&&"space"===e.keyArgs.action);if(!e.byKey||r)return void(r&&!this.parent.isCheckBoxSelection&&this.clearSelection());var o=e.container.isContent?e.container.indexes:e.indexes,s=o[0],l=o[1],a=this.focus.getPrevIndexes();if(this.parent.frozenRows)if(e.container.isHeader&&("TD"===e.element.tagName||t.closest(e.element,".e-rowcell"))){var h=this.parent.getHeaderTable().querySelector("thead").childElementCount;s-=h,a.rowIndex=t.isNullOrUndefined(a.rowIndex)?null:a.rowIndex-h}else s+=this.parent.frozenRows,a.rowIndex=0!==a.rowIndex&&t.isNullOrUndefined(a.rowIndex)?null:a.rowIndex+this.parent.frozenRows;if(this.parent.isFrozenGrid()){var d=Number(e.element.getAttribute("aria-colindex")),p=this.parent.getSelectedRowCellIndexes();p.length&&0===a.cellIndex&&(a.cellIndex=p[p.length-1].cellIndexes[0]),a.cellIndex=t.isNullOrUndefined(a.cellIndex)?null:a.cellIndex===l?d:d-1,l=d}if(!(n||-1===["ctrlPlusA","escape"].indexOf(e.keyArgs.action)&&"space"!==e.keyArgs.action&&s===a.rowIndex&&l===a.cellIndex)||this.selectionSettings.allowColumnSelection){this.preventFocus=!0;var c=this.getKeyColIndex(e);switch(this.needColumnSelection&&(l=c),e.keyArgs.action){case"downArrow":case"upArrow":case"enter":case"shiftEnter":this.target=e.element,this.applyDownUpKey(s,l);break;case"rightArrow":case"leftArrow":this.applyRightLeftKey(s,l);break;case"shiftDown":case"shiftUp":this.shiftDownKey(s,l);break;case"shiftLeft":case"shiftRight":this.applyShiftLeftRightKey(s,l);break;case"home":case"end":l="end"===e.keyArgs.action?this.getLastColIndex(s):0,this.applyHomeEndKey(s,l);break;case"ctrlHome":case"ctrlEnd":this.applyCtrlHomeEndKey(s,l);break;case"escape":this.clearSelection();break;case"ctrlPlusA":this.ctrlPlusA();break;case"space":this.applySpaceSelection(e.element);break;case"tab":this.parent.editSettings.allowNextRowEdit&&this.selectRow(s)}this.needColumnSelection=!1,this.preventFocus=!1,this.positionBorders(),this.updateAutoFillPosition()}},r.prototype.getKeyColIndex=function(e){var t,i=null,r=e.element.querySelector(".e-stackedheadercelldiv");if(this.selectionSettings.allowColumnSelection&&O(e.element,"e-columnheader"))if(this.needColumnSelection=!!e.container.isHeader,r){if("rightArrow"===e.keyArgs.action||"leftArrow"===e.keyArgs.action)return i;t=r.getAttribute("e-mappinguid");var n=this.getstackedColumns(this.parent.getColumnByUid(t).columns),o=this.parent.getColumnIndexByUid(n[n.length-1].uid),s=this.parent.getColumnIndexByUid(n[0].uid);i=this.prevColIndex>=o?s:o}else i=this.parent.getColumnIndexByUid(e.element.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"));return i},r.prototype.ctrlPlusA=function(){this.isRowType()&&!this.isSingleSel()&&this.selectRowsByRange(0,this.getCurrentBatchRecordChanges().length-1),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange({rowIndex:0,cellIndex:0},{rowIndex:this.parent.getRows().length-1,cellIndex:this.parent.getColumns().length-1})},r.prototype.applySpaceSelection=function(e){e.classList.contains("e-checkselectall")?(this.checkedTarget=e,this.checkSelectAll(this.checkedTarget)):e.classList.contains("e-checkselect")&&(this.checkedTarget=e,this.checkSelect(this.checkedTarget))},r.prototype.applyDownUpKey=function(e,t){var i=this.parent;this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&!this.selectionSettings.persistSelection&&(this.checkSelectAllAction(!1),this.checkedTarget=null),this.isRowType()&&(this.parent.frozenRows,this.selectRow(e,!0),this.applyUpDown(i.selectedRowIndex)),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0),this.selectionSettings.allowColumnSelection&&this.needColumnSelection&&this.selectColumn(t)},r.prototype.applyUpDown=function(e){if(!(e<0)){this.target||(this.target=this.parent.getRows()[0].children[this.parent.groupSettings.columns.length||0]);var t=parseInt(this.target.getAttribute("aria-colindex"),10),i=this.parent.getFrozenColumns();this.target=i&&t>=i?this.contentRenderer.getMovableRowByIndex(e).querySelectorAll(".e-rowcell")[t-i]:this.contentRenderer.getRowByIndex(e).querySelectorAll(".e-rowcell")[t],this.addAttribute(this.target)}},r.prototype.applyRightLeftKey=function(e,t){this.parent;this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumn(t):this.isCellType()&&(this.selectCell({rowIndex:e,cellIndex:t},!0),this.addAttribute(this.target))},r.prototype.applyHomeEndKey=function(e,t){this.isCellType()?this.selectCell({rowIndex:e,cellIndex:t},!0):this.addAttribute(this.parent.getCellFromIndex(e,t))},r.prototype.shiftDownKey=function(e,i){this.parent;this.isMultiShiftRequest=!0,this.isRowType()&&!this.isSingleSel()&&(t.isUndefined(this.prevRowIndex)?this.selectRow(0,!0):(this.selectRowsByRange(this.prevRowIndex,e),this.applyUpDown(e))),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange(this.prevCIdxs||{rowIndex:0,cellIndex:0},{rowIndex:e,cellIndex:i}),this.isMultiShiftRequest=!1},r.prototype.applyShiftLeftRightKey=function(e,t){this.parent;this.isMultiShiftRequest=!0,this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumnsByRange(this.prevColIndex,t):this.selectCellsByRange(this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},r.prototype.getstackedColumns=function(e){for(var t=[],i=0,r=e.length;i1&&this.selectedColumnsIndexes.indexOf(e)>-1;if(this.clearColDependency(),!o||!this.selectionSettings.enableToggle||s){var l={columnIndex:e,headerCell:n,column:r,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(l,"columnSelecting"),l.cancel)return void this.disableInteracted();i.selectionSettings.enableToggle&&e===this.prevColIndex&&o&&!s||this.updateColSelection(n,e);var a={columnIndex:e,headerCell:n,column:r,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(a,"columnSelected")}this.updateColProps(e)}}},r.prototype.selectColumnsByRange=function(e,i){var r=this.parent;if(!t.isNullOrUndefined(r.getColumns()[e])){var n=[];if("Single"===r.selectionSettings.type||t.isNullOrUndefined(i))n[0]=e;else for(var o=e=i;o?s++:s--)n.push(s);this.selectColumns(n)}},r.prototype.selectColumns=function(e){var t=this.parent,i=this.getselectedCols();if("Single"===t.selectionSettings.type&&(e=[e[0]]),t.selectionSettings.allowColumnSelection){this.clearColDependency();var r={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(r,"columnSelecting"),r.cancel)return void this.disableInteracted();for(var n=0,o=e.length;n=r,o=i.getColumnHeaderByUid(i.getColumnByIndex(e).uid),s=this.getselectedCols();if("Single"===i.selectionSettings.type&&this.clearColDependency(),i.selectionSettings.allowColumnSelection){n?i.getMovableRows():i.getDataRows();if(this.selectedColumnsIndexes.indexOf(e)>-1)this.clearColumnSelection(e);else{var l={columnIndex:e,headerCell:s,columnIndexes:this.selectedColumnsIndexes,column:i.getColumnByIndex(e),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(l,"columnSelecting"),l.cancel)return void this.disableInteracted();this.updateColSelection(o,e);var a={columnIndex:e,headerCell:s=this.getselectedCols(),column:i.getColumnByIndex(e),columnIndexes:this.selectedColumnsIndexes,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(a,"columnSelected")}this.updateColProps(e)}}},r.prototype.clearColumnSelection=function(e){if(this.isColumnSelected){var i=this.parent;if(!t.isNullOrUndefined(e)&&-1===this.selectedColumnsIndexes.indexOf(e))return;var r=t.isNullOrUndefined(e)?this.selectedColumnsIndexes[this.selectedColumnsIndexes.length-1]:e,n=i.getColumnByIndex(r),o=void 0,s=i.getColumnByIndex(r),l={columnIndex:r,headerCell:o="frozen-right"===n.getFreezeTableName()?i.getFrozenRightColumnHeaderByIndex(r):"movable"===n.getFreezeTableName()?i.getMovableColumnHeaderByIndex(r):i.getColumnHeaderByUid(s.uid),columnIndexes:this.selectedColumnsIndexes,column:s,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted};if(this.columnDeselect(l,"columnDeselecting"))return void this.disableInteracted();for(var a=t.isNullOrUndefined(e)?[].slice.call(i.getHeaderContent().querySelectorAll(".e-columnselection")):[o],h=this.getSelectedColumnCells(e),d=0,p=a.length;d1){e=[];for(var i=0;i0?i:t.isBlazor()?JSON.parse(JSON.stringify(e)):e};this.parent.trigger(yt,n,function(n){var o=r.parent.getColumns();if(e=t.isNullOrUndefined(e)?o:e,n.cancel)return r.parent.notify("reset-columns",{showHideArgs:n}),void(e.length>0&&(e[0].visible=!0));pe(r.parent)&&r.parent.contentModule.emptyVcRows(),r.parent.allowSelection&&r.parent.getSelectedRecords().length&&!r.parent.selectionSettings.persistSelection&&r.parent.clearSelection(),r.parent.enableColumnVirtualization?e.filter(function(e){return o.some(function(t){return e.field===t.field})}).length&&r.parent.notify(jt,e):r.parent.notify(jt,e);var s={requestType:"columnstate",columns:i};r.parent.trigger(vt,s),"All"!==r.parent.columnQueryMode&&r.parent.refresh()})},e}(),Rr=function(){function e(e){this.lastScrollTop=0,this.previousValues={top:0,left:0},this.oneTimeReady=!0,this.parent=e,this.widthService=new rr(e),this.addEventListener()}return e.prototype.getModuleName=function(){return"scroll"},e.prototype.setWidth=function(e){this.parent.element.style.width=t.formatUnit(this.parent.width),e&&this.widthService.setWidthToColumns(),this.parent.toolbarModule&&this.parent.toolbarModule.toolbar&&this.parent.toolbarModule.toolbar.element&&this.parent.toolbarModule.toolbar.refreshOverflow()},e.prototype.setHeight=function(){var i=0,r=this.parent.getContent().querySelector(".e-content"),n=this.parent.height;if(this.parent.isFrozenGrid()&&"auto"!==this.parent.height&&this.parent.height.toString().indexOf("%")<0&&(n=parseInt(n,10)-e.getScrollBarWidth()),!this.parent.enableVirtualization&&this.parent.frozenRows&&"auto"!==this.parent.height){var o=this.parent.getHeaderContent().querySelector("tbody");i=o?o.offsetHeight:0,o&&i&&(i-=o.querySelectorAll(".e-addedrow").length*this.parent.getRowHeight()),r.style.height=t.formatUnit(n-i)}else r.style.height=t.formatUnit(n);this.ensureOverflow(r),this.parent.isFrozenGrid()&&this.refresh()},e.prototype.setPadding=function(){var t=this.parent.getHeaderContent(),i=e.getScrollBarWidth()-this.getThreshold(),r=this.getCssProperties(),n="Right"===this.parent.getFrozenMode()||"Left-Right"===this.parent.getFrozenMode()?"0.5px":"1px";t.querySelector(".e-headercontent").style[r.border]=i>0?n:"0px",t.style[r.padding]=i>0?i+"px":"0px"},e.prototype.removePadding=function(e){var t=this.getCssProperties(e),i=this.parent.getHeaderContent().querySelector(".e-headercontent");i.style[t.border]="",i.parentElement.style[t.padding]="";var r=this.parent.getFooterContent();r&&r.classList.contains("e-footerpadding")&&r.classList.remove("e-footerpadding")},e.prototype.refresh=function(){if("100%"===this.parent.height){var e=this.parent.getContent();this.parent.element.style.height="100%";var t=this.widthService.getSiblingsHeight(e);e.style.height="calc(100% - "+t+"px)",this.parent.isFrozenGrid()&&(e.firstElementChild.style.height="calc(100% - "+j()+"px)")}},e.prototype.getThreshold=function(){return"mozilla"===t.Browser.info.name?.5:1},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ot,this.wireEvents,this),this.parent.on(Mt,this.wireEvents,this),this.parent.on(Dt,this.onPropertyChanged,this),this.parent.on("textWrapRefresh",this.wireEvents,this),this.parent.on(Lt,this.setScrollLeft,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ot,this.wireEvents),this.parent.off(Mt,this.wireEvents),this.parent.off(Dt,this.onPropertyChanged),this.parent.off("textWrapRefresh",this.wireEvents),this.parent.off(Lt,this.setScrollLeft))},e.prototype.setScrollLeft=function(){this.parent.isFrozenGrid()?this.parent.headerModule.getMovableHeader().scrollLeft=this.previousValues.left:this.parent.getHeaderContent().querySelector(".e-headercontent").scrollLeft=this.previousValues.left},e.prototype.onFrozenContentScroll=function(){var e=this;return function(i){null===e.content.querySelector("tbody")||e.parent.isPreventScrollEvent||(!t.isNullOrUndefined(e.parent.infiniteScrollModule)&&e.parent.enableInfiniteScrolling&&e.parent.notify("infinite-scroll-handler",i),e.previousValues.top=i.target.scrollTop)}},e.prototype.onContentScroll=function(e){var i=this,r=e,n=r.classList.contains("e-headercontent");return function(e){if(null!==i.content.querySelector("tbody")&&!i.parent.isPreventScrollEvent){var o=e.target,s=o.scrollLeft;if(!t.isNullOrUndefined(i.parent.infiniteScrollModule)&&i.parent.enableInfiniteScrolling&&i.parent.notify("infinite-scroll-handler",{target:e.target,isLeft:i.previousValues.left!==s}),i.parent.groupSettings.columns.length&&i.parent.groupSettings.enableLazyLoading){var l=i.previousValues.top0||e.parent.isFrozenGrid())&&e.header.querySelector(".e-movableheader")?e.header.querySelector(".e-movableheader").scrollLeft=e.previousValues.left:e.header.scrollLeft=e.previousValues.left,e.content.scrollLeft=e.previousValues.left,e.content.scrollTop=e.previousValues.top)),e.parent.enableColumnVirtualization||(e.content.scrollLeft=s),e.parent.isFrozenGrid()&&e.header.querySelector(".e-movableheader")&&(e.header.querySelector(".e-movableheader").scrollLeft=e.content.querySelector(".e-movablecontent").scrollLeft)}),this.parent.isPreventScrollEvent=!1},e.prototype.getCssProperties=function(e){var i={},r=t.isNullOrUndefined(e)?this.parent.enableRtl:e;return i.border=r?"borderLeftWidth":"borderRightWidth",i.padding=r?"paddingLeft":"paddingRight",i},e.prototype.ensureOverflow=function(e){e.style.overflowY="auto"===this.parent.height?"auto":"scroll"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){this.setPadding(),this.oneTimeReady=!0,"auto"===this.parent.height&&this.removePadding(),this.wireEvents(),this.setHeight();this.setWidth(!t.isNullOrUndefined(e.properties.width))}},e.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))){this.removeEventListener(),this.removePadding();var i=this.parent.getContent().querySelector(".e-content");t.removeClass([this.parent.getHeaderContent().querySelector(".e-headercontent")],"e-headercontent"),t.removeClass([i],"e-content"),i.style.height="",this.parent.element.style.width="",t.EventHandler.remove(i,"scroll",this.onContentScroll)}},e.getScrollBarWidth=function(){return j()},e}(),Fr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zr=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Ir=function(i){function r(){var e=null!==i&&i.apply(this,arguments)||this;return e.templateFn={},e}return Fr(r,i),r.prototype.setFormatter=function(e){this.formatFn=e},r.prototype.getFormatter=function(){return this.formatFn},r.prototype.setTemplate=function(i){void 0===i&&(i={}),void 0!==this.footerTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.Summary)]={fn:t.compile(this.footerTemplate,i),property:"footerTemplate"}),void 0!==this.groupFooterTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.GroupSummary)]={fn:t.compile(this.groupFooterTemplate,i),property:"groupFooterTemplate"}),void 0!==this.groupCaptionTemplate&&(this.templateFn[t.getEnumValue(e.CellType,e.CellType.CaptionSummary)]={fn:t.compile(this.groupCaptionTemplate,i),property:"groupCaptionTemplate"})},r.prototype.getTemplate=function(i){return this.templateFn[t.getEnumValue(e.CellType,i)]},r.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},zr([t.Property()],r.prototype,"type",void 0),zr([t.Property()],r.prototype,"field",void 0),zr([t.Property()],r.prototype,"columnName",void 0),zr([t.Property()],r.prototype,"format",void 0),zr([t.Property()],r.prototype,"footerTemplate",void 0),zr([t.Property()],r.prototype,"groupFooterTemplate",void 0),zr([t.Property()],r.prototype,"groupCaptionTemplate",void 0),zr([t.Property()],r.prototype,"customAggregate",void 0),r}(t.ChildProperty),Tr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Fr(i,e),zr([t.Collection([],Ir)],i.prototype,"columns",void 0),i}(t.ChildProperty),Er=function(){function e(e){this.copyContent="",this.isSelect=!1,this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Mt,this.initialEnd,this),this.parent.on(qt,this.keyDownHandler,this),this.parent.on(Ht,this.clickHandler,this),t.EventHandler.add(this.parent.element,"keydown",this.pasteHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(qt,this.keyDownHandler),this.parent.off(Mt,this.initialEnd),this.parent.off(Ht,this.clickHandler),t.EventHandler.remove(this.parent.element,"keydown",this.pasteHandler))},e.prototype.clickHandler=function(e){var t=e.target;t=O(t,"e-rowcell")},e.prototype.pasteHandler=function(e){var i=this,r=this.parent,n=/(Mac)/i.test(navigator.platform);if(86===e.keyCode&&(e.ctrlKey||n&&e.metaKey)&&!r.isEdit){if(!t.closest(document.activeElement,".e-rowcell")||!r.editSettings.allowEditing||"Batch"!==r.editSettings.mode||"Cell"!==r.selectionSettings.mode||"Flow"===r.selectionSettings.cellSelectionMode)return;this.activeElement=document.activeElement,this.clipBoardTextArea.value="";var o=window.scrollX,s=window.scrollY;this.clipBoardTextArea.focus(),setTimeout(function(){i.activeElement.focus(),window.scrollTo(o,s),i.paste(i.clipBoardTextArea.value,i.parent.getSelectedRowCellIndexes()[0].rowIndex,i.parent.getSelectedRowCellIndexes()[0].cellIndexes[0])},10)}},e.prototype.paste=function(e,i,r){var n,o,s,l=this.parent,a=r,h=i;if(l.editSettings.allowEditing&&"Batch"===l.editSettings.mode&&"Cell"===l.selectionSettings.mode&&"Flow"!==l.selectionSettings.cellSelectionMode){var d,p,c,u=e.split("\n"),g=l.getDataRows(),f=this.parent.isFrozenGrid();f&&(p=l.getMovableDataRows(),l.getFrozenRightColumnsCount()&&(c=l.getFrozenRightDataRows()));for(var m=0;m0&&(this.copyContent+="\n");p=[].slice.call(o[s[a]].querySelectorAll(".e-rowcell:not(.e-hide)"));i&&(p.push.apply(p,[].slice.call(r[s[a]].querySelectorAll(".e-rowcell:not(.e-hide)"))),n&&p.push.apply(p,[].slice.call(n[s[a]].querySelectorAll(".e-rowcell:not(.e-hide)")))),this.getCopyData(p,!1,"\t",e)}}else{var h=this.checkBoxSelection();if(h.status){if(e){for(var d=[],a=0;a0&&(this.copyContent+="\n");var p=[].slice.call(o[h.rowIndexes[a]].querySelectorAll(".e-cellselectionbackground"));i&&(p.push.apply(p,[].slice.call(r[h.rowIndexes[a]].querySelectorAll(".e-cellselectionbackground"))),n&&p.push.apply(p,[].slice.call(n[h.rowIndexes[a]].querySelectorAll(".e-cellselectionbackground")))),this.getCopyData(p,!1,"\t",e)}}else this.getCopyData([].slice.call(this.parent.element.querySelectorAll(".e-cellselectionbackground")),!0,"\n",e)}var c={data:this.copyContent,cancel:!1};if(this.parent.trigger("beforeCopy",c),c.cancel)return;this.clipBoardTextArea.value=this.copyContent=c.data,t.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0}},e.prototype.getCopyData=function(e,i,r,n){for(var o="string"!=typeof e[0],s=0;s-1&&(t.columns[n].visible=!0);t.mergePersistGridData(r),t.notify("persist-data-changed",{}),t.bulkChanges.columns&&delete t.bulkChanges.columns,t.headerModule.refreshUI();for(var n=0;n=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Br=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property()],i.prototype,"field",void 0),Ar([t.Property()],i.prototype,"direction",void 0),Ar([t.Property(!1)],i.prototype,"isFromGroup",void 0),i}(t.ChildProperty),kr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Collection([],Br)],i.prototype,"columns",void 0),Ar([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),Lr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property()],i.prototype,"field",void 0),Ar([t.Property()],i.prototype,"operator",void 0),Ar([t.Property()],i.prototype,"value",void 0),Ar([t.Property()],i.prototype,"matchCase",void 0),Ar([t.Property(!1)],i.prototype,"ignoreAccent",void 0),Ar([t.Property()],i.prototype,"predicate",void 0),Ar([t.Property({})],i.prototype,"actualFilterValue",void 0),Ar([t.Property({})],i.prototype,"actualOperator",void 0),Ar([t.Property()],i.prototype,"type",void 0),Ar([t.Property()],i.prototype,"ejpredicate",void 0),Ar([t.Property()],i.prototype,"uid",void 0),Ar([t.Property()],i.prototype,"isForeignKey",void 0),i}(t.ChildProperty),Pr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property(!1)],i.prototype,"enableCache",void 0),Ar([t.Property(3)],i.prototype,"maxBlocks",void 0),Ar([t.Property(3)],i.prototype,"initialBlocks",void 0),i}(t.ChildProperty),Nr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Collection([],Lr)],i.prototype,"columns",void 0),Ar([t.Property("FilterBar")],i.prototype,"type",void 0),Ar([t.Property()],i.prototype,"mode",void 0),Ar([t.Property(!0)],i.prototype,"showFilterBarStatus",void 0),Ar([t.Property(1500)],i.prototype,"immediateModeDelay",void 0),Ar([t.Property()],i.prototype,"operators",void 0),Ar([t.Property(!1)],i.prototype,"ignoreAccent",void 0),Ar([t.Property(!1)],i.prototype,"enableCaseSensitivity",void 0),Ar([t.Property(!1)],i.prototype,"showFilterBarOperator",void 0),i}(t.ChildProperty),qr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property("Row")],i.prototype,"mode",void 0),Ar([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),Ar([t.Property("Single")],i.prototype,"type",void 0),Ar([t.Property(!1)],i.prototype,"checkboxOnly",void 0),Ar([t.Property(!1)],i.prototype,"persistSelection",void 0),Ar([t.Property("Default")],i.prototype,"checkboxMode",void 0),Ar([t.Property(!1)],i.prototype,"enableSimpleMultiRowSelection",void 0),Ar([t.Property(!0)],i.prototype,"enableToggle",void 0),Ar([t.Property(!1)],i.prototype,"allowColumnSelection",void 0),i}(t.ChildProperty),Hr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property([])],i.prototype,"fields",void 0),Ar([t.Property("")],i.prototype,"key",void 0),Ar([t.Property("contains")],i.prototype,"operator",void 0),Ar([t.Property(!0)],i.prototype,"ignoreCase",void 0),Ar([t.Property(!1)],i.prototype,"ignoreAccent",void 0),i}(t.ChildProperty),Ur=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property()],i.prototype,"targetID",void 0),i}(t.ChildProperty),jr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property("Both")],i.prototype,"wrapMode",void 0),i}(t.ChildProperty),Vr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property("Normal")],i.prototype,"mode",void 0),i}(t.ChildProperty),Gr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property(!0)],i.prototype,"showDropArea",void 0),Ar([t.Property(!1)],i.prototype,"allowReordering",void 0),Ar([t.Property(!1)],i.prototype,"showToggleButton",void 0),Ar([t.Property(!1)],i.prototype,"showGroupedColumn",void 0),Ar([t.Property(!0)],i.prototype,"showUngroupButton",void 0),Ar([t.Property(!1)],i.prototype,"disablePageWiseAggregates",void 0),Ar([t.Property([])],i.prototype,"columns",void 0),Ar([t.Property()],i.prototype,"captionTemplate",void 0),Ar([t.Property(!1)],i.prototype,"enableLazyLoading",void 0),i}(t.ChildProperty),_r=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Or(i,e),Ar([t.Property(!1)],i.prototype,"allowAdding",void 0),Ar([t.Property(!1)],i.prototype,"allowEditing",void 0),Ar([t.Property(!1)],i.prototype,"allowDeleting",void 0),Ar([t.Property("Normal")],i.prototype,"mode",void 0),Ar([t.Property(!0)],i.prototype,"allowEditOnDblClick",void 0),Ar([t.Property(!0)],i.prototype,"showConfirmDialog",void 0),Ar([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),Ar([t.Property("")],i.prototype,"template",void 0),Ar([t.Property("")],i.prototype,"headerTemplate",void 0),Ar([t.Property("")],i.prototype,"footerTemplate",void 0),Ar([t.Property("Top")],i.prototype,"newRowPosition",void 0),Ar([t.Property({})],i.prototype,"dialog",void 0),Ar([t.Property(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),Wr=function(n){function o(e,i){var r=n.call(this,e,i)||this;return r.isPreventScrollEvent=!1,r.inViewIndexes=[],r.keyA=!1,r.frozenRightCount=0,r.frozenLeftCount=0,r.tablesCount=1,r.movableCount=0,r.visibleFrozenLeft=0,r.visibleFrozenRight=0,r.visibleMovable=0,r.frozenLeftColumns=[],r.frozenRightColumns=[],r.movableColumns=[],r.media={},r.isFreezeRefresh=!1,r.tableIndex=0,r.componentRefresh=t.Component.prototype.refresh,r.isVirtualAdaptive=!1,r.vRows=[],r.vcRows=[],r.vGroupOffsets={},r.rowUid=0,r.currentViewData=[],r.lockcolPositionCount=0,r.prevPageMoving=!1,r.pageTemplateChange=!1,r.isAutoGen=!1,r.mediaBindInstance={},r.commandDelIndex=void 0,r.asyncTimeOut=50,r.enableLogger=!0,r.needsID=!0,s.Inject(br),t.setValue("mergePersistData",r.mergePersistGridData,r),r}Or(o,n),s=o,o.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","groupSettings","columns","searchSettings","selectedRowIndex","scrollPosition"],i={pageSettings:["template","pageSizes","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent"],groupSettings:["showDropArea","showToggleButton","showGroupedColumn","showUngroupButton","disablePageWiseAggregates","hideCaptionCount"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},r=0;rthis.height&&e&&t.addClass([e],["e-footerpadding"]),this.getColumns().filter(function(e){return"checkbox"===e.type}).length&&"ResetOnRowClick"===this.selectionSettings.checkboxMode&&(this.isCheckBoxSelection=!1),"Vertical"===this.rowRenderingMode&&this.enableHover&&(this.setProperties({enableAdaptiveUI:!0,enableHover:!1},!0),t.removeClass([this.element],"e-gridhover"))},o.prototype.removeMediaListener=function(){for(var e=0;e-1&&(this.updateColumnObject(),o=!0);for(var h=0,d=a;h=t?(s.freezeTable="frozen-left",e.splice(this.frozenColumns+r,0,e.splice(n,1)[0]),r++):i&&!t&&(s.freezeTable="movable")}},o.prototype.getFrozenLeftCount=function(){return this.getFrozenColumns()||this.getFrozenLeftColumnsCount()},o.prototype.isFrozenGrid=function(){return 0!==this.getFrozenColumns()||0!==this.getFrozenLeftColumnsCount()||0!==this.getFrozenRightColumnsCount()},o.prototype.getFrozenMode=function(){return this.frozenName},o.prototype.updateLockableColumns=function(){for(var e=this.columnModel,t=0,i=0,r=this.getFrozenColumns(),n=0;n-1}),n=r.length;(!this.enableColumnVirtualization||t.isNullOrUndefined(this.columnModel)||0===this.columnModel.length||e)&&(this.columnModel=[],this.updateColumnModel(this.columns));var o=0===n?this.columnModel:this.columnModel.slice(r[0],r[n-1]+1);return this.contentModule&&this.enableColumnVirtualization&&this.isFrozenGrid()&&r.length&&r[0]>0&&(o=this.contentModule.ensureFrozenCols(o)),o},o.prototype.getStackedHeaderColumnByHeaderText=function(e,t){for(var i=0;i0&&(this.notify("refresh-footer-rendered",{}),this.groupSettings.columns.length>0&&this.notify("group-aggregates",{})),t.isNullOrUndefined(p)||t.isNullOrUndefined(p.changes)||(p.changes[i]=r),this.trigger("queryCellInfo",{cell:g,column:o,data:d.data})}}},o.prototype.refreshReactColumnTemplateByUid=function(e){var i=this;this.isReact&&this.clearTemplate(["columnTemplate"],void 0,function(){for(var r=i.getRowsObject(),n=i.getIndentCount(),o=i.getNormalizedColumnIndex(e),s=0;s0&&this.aggregates.length>0&&(n=n.filter(function(e){return e.isDataRow})),r=n.filter(function(i){return t.getValue(o,i.data)===e})[0],!t.isNullOrUndefined(r)&&this.element.querySelectorAll("[data-uid="+r.uid+"]").length&&(r.changes=i,se(r,this.getForeignKeyColumns(),r.changes),s.refresh(r,this.getColumns(),!0),this.aggregates.length>0&&(this.notify("refresh-footer-rendered",{}),this.groupSettings.columns.length>0&&this.notify("group-aggregates",{})))},o.prototype.getCellFromIndex=function(e,t){return Ue(this,this.getColumnByIndex(t),e,t)},o.prototype.getMovableCellFromIndex=function(e,t){if(!("Left-Right"===this.frozenName&&t>=this.movableCount)){var i=this.getFrozenColumns()||this.getFrozenLeftColumnsCount();return this.getMovableDataRows()[e]&&this.getMovableDataRows()[e].querySelectorAll(".e-rowcell")[t-i]}},o.prototype.getFrozenRightCellFromIndex=function(e,t){var i=this.getFrozenLeftColumnsCount()+this.getMovableColumnsCount(),r=this.getFrozenRightDataRows();return r[e]&&r[e].querySelectorAll(".e-rowcell")[t-i]},o.prototype.getColumnHeaderByIndex=function(e){return this.getHeaderTable().querySelectorAll(".e-headercell")[e]},o.prototype.getMovableColumnHeaderByIndex=function(e){var t=this.getFrozenColumns()||this.getFrozenLeftColumnsCount();return this.getMovableVirtualHeader().querySelectorAll(".e-headercell")[e-t]},o.prototype.getFrozenRightColumnHeaderByIndex=function(e){var t=this.getFrozenLeftColumnsCount()+this.getMovableColumnsCount();return this.getFrozenRightHeader().querySelectorAll(".e-headercell")[e-t]},o.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.getFrozenVirtualHeader().querySelectorAll(".e-headercell")[e]},o.prototype.getRowObjectFromUID=function(e,i,r){var n=this.contentModule.getRows(),o=this.rowObject(n,e);return this.isFrozenGrid()&&(!o||i||r)?((!(o=this.rowObject(this.contentModule.getMovableRows(),e))&&"Left-Right"===this.getFrozenMode()||r)&&(o=this.rowObject(this.contentModule.getFrozenRightRows(),e)),o):t.isNullOrUndefined(o)&&this.enableVirtualization&&this.groupSettings.columns.length>0?o=this.rowObject(this.vRows,e):o},o.prototype.rowObject=function(e,t){for(var i=0,r=e;ithis.frozenColumns-1&&t++,i++);return t},o.prototype.goToPage=function(e){this.pagerModule&&this.pagerModule.goToPage(e)},o.prototype.updateExternalMessage=function(e){this.pagerModule&&this.pagerModule.updateExternalMessage(e)},o.prototype.sortColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},o.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},o.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},o.prototype.filterByColumn=function(e,t,i,r,n,o,s,l){this.filterModule&&this.filterModule.filterByColumn(e,t,i,r,n,o,s,l)},o.prototype.clearFiltering=function(e){this.filterModule&&this.filterModule.clearFiltering(e)},o.prototype.removeFilteredColsByField=function(e,t){this.filterModule&&this.filterModule.removeFilteredColsByField(e,t)},o.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},o.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},o.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},o.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},o.prototype.selectCellsByRange=function(e,t){this.selectionModule.selectCellsByRange(e,t)},o.prototype.search=function(e){this.searchModule&&this.searchModule.search(e)},o.prototype.print=function(){this.printModule&&this.printModule.print()},o.prototype.deleteRecord=function(e,t){this.editModule&&this.editModule.deleteRecord(e,t)},o.prototype.startEdit=function(){this.editModule&&this.editModule.startEdit()},o.prototype.endEdit=function(){this.editModule&&this.editModule.endEdit()},o.prototype.closeEdit=function(){this.editModule&&this.editModule.closeEdit()},o.prototype.addRecord=function(e,t){this.editModule&&this.editModule.addRecord(e,t)},o.prototype.deleteRow=function(e){this.editModule&&this.editModule.deleteRow(e)},o.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},o.prototype.saveCell=function(){this.editModule&&this.editModule.saveCell()},o.prototype.updateCell=function(e,t,i){this.editModule&&this.editModule.updateCell(e,t,i)},o.prototype.updateRow=function(e,t){this.editModule&&this.editModule.updateRow(e,t)},o.prototype.getBatchChanges=function(){return this.editModule?this.editModule.getBatchChanges():{}},o.prototype.enableToolbarItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},o.prototype.copy=function(e){this.clipboardModule&&this.clipboardModule.copy(e)},o.prototype.recalcIndentWidth=function(){var e=this;if(this.getHeaderTable().querySelector(".e-emptycell")&&(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())&&!this.getHeaderTable().querySelector(".e-emptycell").getAttribute("indentRefreshed")&&this.getContentTable()){var t=this.getHeaderTable().querySelector(".e-emptycell").parentElement.offsetWidth,i=[].slice.call(this.getHeaderTable().querySelector("colgroup").childNodes),r=[].slice.call(this.getContentTable().querySelector("colgroup").childNodes),n=t/30,o="Right"===this.getFrozenMode()?this.frozenRightCount:0,s=this.element.offsetWidth,l=function(t,n){if(Me(e)){var o=(n/s*100).toFixed(1)+"%";i[t].style.width=o,r[t].style.width=o}else i[t].style.width=n+"px",r[t].style.width=n+"px";e.notify("column-width-changed",{index:t,width:n})};for(n>=1&&(t=30/n),(this.enableColumnVirtualization||this.isAutoGen)&&(t=30);o0){var e=this.widthService.getTableWidth(this.getColumns());this.widthService.setMinwidthBycalculation(e)}this.isFrozenGrid()&&this.widthService&&this.widthService.refreshFrozenScrollbar(),this.allowTextWrap&&"Content"!=this.textWrapSettings.wrapMode&&this.notify(pi,{})},o.prototype.isRowDragable=function(){return this.allowRowDragAndDrop&&!this.rowDropSettings.targetID},o.prototype.reorderColumns=function(e,t){this.reorderModule&&this.reorderModule.reorderColumns(e,t)},o.prototype.reorderColumnByIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByIndex(e,t)},o.prototype.reorderColumnByTargetIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByTargetIndex(e,t)},o.prototype.reorderRows=function(e,t){this.rowDragAndDropModule&&this.rowDragAndDropModule.reorderRows(e,t)},o.prototype.refreshDataSource=function(e,t){this.notify("refreshdataSource",e)},o.prototype.disableRowDD=function(e){var i=this.getHeaderTable(),r=this.getContentTable(),n=i.querySelectorAll("th.e-rowdragheader, th.e-mastercell"),o=this.getRows(),s=e?"none":"";t.setStyleAttribute(i.querySelector("colgroup").childNodes[0],{display:s}),t.setStyleAttribute(r.querySelector("colgroup").childNodes[0],{display:s});for(var l=0;le.getBoundingClientRect().width},o.prototype.mouseMoveHandler=function(e){if(this.isEllipsisTooltip()){var i=O(e.target,"e-ellipsistooltip");this.prevElement===i&&"mouseout"!==e.type||this.toolTipObj.close();var r=e.target.tagName,n=["A","BUTTON","INPUT"];if(i&&"mouseout"!==e.type&&(!t.Browser.isDevice||-1===n.indexOf(r))){if(i.getAttribute("aria-describedby"))return;this.getTooltipStatus(i)&&(i.getElementsByClassName("e-headertext").length?this.toolTipObj.content=i.getElementsByClassName("e-headertext")[0].innerText:this.toolTipObj.content=i.innerText,this.prevElement=i,this.toolTipObj.open(i))}}this.hoverFrozenRows(e)},o.prototype.hoverFrozenRows=function(e){if(this.isFrozenGrid()){var t=O(e.target,"e-row");if([].slice.call(this.element.querySelectorAll(".e-frozenhover")).length&&"mouseout"===e.type)for(var i=[].slice.call(this.element.querySelectorAll(".e-frozenhover")),r=0;r=0},o.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},o.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.log(e,t)},o.prototype.applyBiggerTheme=function(e){this.element.classList.contains("e-bigger")&&e.classList.add("e-bigger")},o.prototype.getPreviousRowData=function(){return this.getRowsObject()[this.getRows().length-1].data},o.prototype.hideScroll=function(){var e=this.getContent().querySelector(".e-content"),t=this.getContent().querySelector(".e-scrollbar");if(e.scrollHeight<=e.clientHeight&&(this.scrollModule.removePadding(),e.style.overflowY="auto"),this.isFrozenGrid()&&t){var i=this.getContent().querySelector(".e-movablescrollbar"),r=this.getContent().querySelector(".e-movablechild");t.style.display="flex",i.offsetWidth>=r.offsetWidth&&(t.style.display="none",this.notify("frozenHeight",0))}},o.prototype.getRowIndexByPrimaryKey=function(e){var t=this.getPrimaryKeyFieldNames()[0];e="object"==typeof e?e[t]:e;for(var i=0;i1&&(r=Qe(t,this.getRowsObject()[i].data)),r===e)return this.getRowsObject()[i].index}return-1},o.prototype.grabColumnByFieldFromAllCols=function(e){var t;this.columnModel=[],this.updateColumnModel(this.columns);for(var i=this.columnModel,r=0;rthis.getNoncontentHeight()+this.getRowHeight()){t=(e-this.getNoncontentHeight())/this.getRowHeight()}if(t>0)return Math.floor(t)}return 0},o.prototype.getNoncontentHeight=function(){var e=0;if(t.isNullOrUndefined(this.getHeaderContent().clientHeight)||(e+=this.getHeaderContent().clientHeight),this.toolbar&&!t.isNullOrUndefined(this.element.querySelector(".e-toolbar").clientHeight)&&(e+=this.element.querySelector(".e-toolbar").clientHeight),this.allowPaging&&!t.isNullOrUndefined(this.element.querySelector(".e-gridpager").clientHeight)&&(e+=this.element.querySelector(".e-gridpager").clientHeight),this.showColumnChooser&&!t.isNullOrUndefined(this.element.querySelector(".e-columnheader").clientHeight)&&(e+=this.element.querySelector(".e-columnheader").clientHeight),this.allowGrouping&&this.groupSettings.showDropArea&&!t.isNullOrUndefined(this.element.querySelector(".e-groupdroparea").clientHeight)&&(e+=this.element.querySelector(".e-groupdroparea").clientHeight),this.aggregates.length>0&&!t.isNullOrUndefined(this.element.querySelector(".e-summaryrow").clientHeight))for(var i=0;i0&&this.parent.isPrinting},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Mt,this.contentReady.bind(this)),this.parent.removeEventListener(yt,this.actionBegin.bind(this)),this.parent.off(Ot,this.onEmpty.bind(this)),this.parent.off(ri,this.hierarchyPrint))},e.prototype.getModuleName=function(){return"print"},e.printGridProp=["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings","queryCellInfo","beforeDataBound"].concat(["beforePrint","printComplete","load"]),e}(),Qr=0,Jr=0,Xr=null;!function(e){e.timer=null}(e.Global||(e.Global={}));var Yr=function(){function e(e){this.existingPredicate={},this.foreignKeyQuery=new i.Query,this.filterState=!0,this.values={},this.renderEmpty=!1,this.parent=e,this.id=this.parent.element.id,this.valueFormatter=new ut(this.parent.locale),this.cBoxTrue=n.createCheckBox(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=n.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&t.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"])}return e.prototype.destroy=function(){this.closeDialog()},e.prototype.wireEvents=function(){t.EventHandler.add(this.dlg,"click",this.clickHandler,this),t.EventHandler.add(this.dlg,"keyup",this.keyupHandler,this),this.searchHandler=t.debounce(this.searchBoxKeyUp,200);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&t.EventHandler.add(e,"keyup",this.searchHandler,this)},e.prototype.unWireEvents=function(){t.EventHandler.remove(this.dlg,"click",this.clickHandler),t.EventHandler.remove(this.dlg,"keyup",this.keyupHandler);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&t.EventHandler.remove(e,"keyup",this.searchHandler)},e.prototype.foreignKeyFilter=function(e,t,i){var r=this,n={},o=[],s=this.foreignKeyQuery.clone();this.options.column.dataSource.executeQuery(s.where(i)).then(function(i){r.options.column.columnData=i.result,r.parent.notify("generateQuery",{predicate:n,column:r.options.column}),e.ejpredicate=n.predicate.predicates;for(var s=n.predicate.predicates,l=0;l .e-dlg-content > .e-mainfilterdiv").appendChild(this.dlg):this.parent.element.appendChild(this.dlg),this.dialogObj.appendTo(this.dlg),this.dialogObj.element.style.maxHeight=e.isResponsiveFilter?"none":this.options.height+"px",this.dialogObj.show(),this.dialogObj.element.querySelector(".e-dlg-content").appendChild(this.sBox),this.wireEvents(),r.createSpinner({target:this.spinner},this.parent.createElement),r.showSpinner(this.spinner),this.getAllData()}},e.prototype.renderResponsiveFilter=function(e){e.isResponsiveFilter&&(this.dialogObj.buttons=[{}],this.dialogObj.position={X:"",Y:""},this.dialogObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dialogObj.width="100%")},e.prototype.dialogCreated=function(e){this.options.isResponsiveFilter?this.dialogObj.element.style.left="0px":t.Browser.isDevice?this.dialogObj.position={X:"center",Y:"center"}:ee(this.options.target,this.dialogObj,this.parent),this.parent.notify("filterDialogCreated",e)},e.prototype.openDialog=function(e){this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e)},e.prototype.closeDialog=function(){if(this.dialogObj&&!this.dialogObj.isDestroyed){var e=this.options.columns.filter(function(e){return e.getFilterItemTemplate()}),i=this.parent.registeredTemplate;e.length&&!t.isNullOrUndefined(i)&&i.filterItemTemplate&&this.parent.destroyTemplate(["filterItemTemplate"]),this.parent.isReact&&(this.parent.destroyTemplate(["filterItemTemplate"]),this.parent.renderTemplates()),this.parent.notify("filter-menu-close",{field:this.options.field}),this.dialogObj.destroy(),this.unWireEvents(),t.remove(this.dlg),this.dlg=null,this.parent.notify("filter-dialog-close",{})}},e.prototype.clearFilter=function(e){var t={instance:this,handler:this.clearFilter,cancel:!1};this.parent.notify(ai,t),t.cancel||this.options.handler({action:"clear-filter",field:e?e.field:this.options.field})},e.prototype.btnClick=function(e){if(this.filterState){if("input"===e.target.tagName.toLowerCase()&&e.target.classList.contains("e-searchinput")){var t=e.target.value;"boolean"===this.options.column.type&&(""!==t&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(t.toLowerCase())?t=!0:""!==t&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(t.toLowerCase())&&(t=!1));var i={action:"filtering",filterCollection:{field:this.options.field,operator:this.options.isRemote?"string"===this.options.column.type?"contains":"equal":"date"===this.options.column.type||"datetime"===this.options.column.type||"boolean"===this.options.column.type?"equal":"contains",value:t,matchCase:!1,type:this.options.column.type},field:this.options.field};void 0!==t&&null!==t&&""!==t?this.isForeignColumn(this.options.column)?this.foreignFilter(i,t):this.options.handler(i):this.closeDialog()}else if(13===e.keyCode)this.fltrBtnHandler();else{var r=e.target.firstChild.textContent.toLowerCase();this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton").toLowerCase()===r?this.fltrBtnHandler():this.getLocalizedLabel("ClearButton").toLowerCase()===r&&this.clearFilter()}this.closeDialog()}else"input"!==e.target.tagName.toLowerCase()&&(this.clearFilter(),this.closeDialog())},e.prototype.fltrBtnHandler=function(){var i=[].slice.call(this.cBox.querySelectorAll(".e-check:not(.e-selectall)")),r=i,n="equal",o=this.dialogObj.element.querySelector(".e-dropdownlist");o&&(this.options.operator=n=o.ej2_instances[0].value),this.isMenuNotEqual="notequal"===this.options.operator;var s;this.options.hideSearchbox||(s=this.searchBox.querySelector(".e-searchinput"));var l=this.options.allowCaseSensitive,a={field:this.options.field,predicate:this.isMenuNotEqual?"and":"or",uid:this.options.uid,operator:n,type:this.options.type,matchCase:l,ignoreAccent:this.options.ignoreAccent},h=this.itemsCnt!==i.length&&this.itemsCnt-i.length2&&l>1&&"or"===r[l].predicate?"date"===r[l].type||"datetime"===r[l].type?n.predicates.push(he(r[l],r[l].type)):n.predicates.push(new i.Predicate(r[l].field,r[l].operator,r[l].value,!e.getCaseValue(r[l]),r[l].ignoreAccent)):n="date"===r[l].type||"datetime"===r[l].type?"and"===r[l].predicate&&"equal"===r[l].operator?n.or(he(r[l],r[l].type),r[l].type,r[l].ignoreAccent):n[r[l].predicate](he(r[l],r[l].type),r[l].type,r[l].ignoreAccent):r[l].ejpredicate?n[r[l].predicate](r[l].ejpredicate):n[r[l].predicate](r[l].field,r[l].operator,r[l].value,!e.getCaseValue(r[l]),r[l].ignoreAccent);return n||null},e.getCaseValue=function(e){return t.isNullOrUndefined(e.matchCase)?!("string"===e.type||t.isNullOrUndefined(e.type)&&"string"==typeof e.value):e.matchCase},e.updateDateFilter=function(e){return("date"===e.type||"datetime"===e.type||e.value instanceof Date)&&(e.type=e.type||"date"),e},e}(),$r=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zr=function(e){function h(t,i){var r=e.call(this,t)||this;return r.customFilterOperators=i,r.isExcel=!0,r}return $r(h,e),h.prototype.getCMenuDS=function(e,t){var i={number:["Equal","NotEqual","","LessThan","LessThanOrEqual","GreaterThan","GreaterThanOrEqual","Between","","CustomFilter"],string:["Equal","NotEqual","","StartsWith","EndsWith","","Contains","","CustomFilter"]};i.date=i.number,i.datetime=i.number;for(var r=[],n=0;n .e-dlg-header-content").offsetHeight+4;this.menuObj.element.style.height="calc(100% - "+u+"px)",this.menuObj.open(u,0,document.body);var g=this.getLocalizedLabel(c[this.options.type]);this.parent.notify("render-responsive-cmenu",{target:this.menuObj.element.parentElement,header:g,isOpen:!0})}else{if(t.Browser.isDevice){var f=this.getContextBounds(this.menuObj);p.top=(window.innerHeight-f.height)/2,p.left=(window.innerWidth-f.width)/2,this.closeDialog()}else p.top=t.Browser.isIE?window.pageYOffset+d.top:window.scrollY+d.top,p.left=this.getCMenuYPosition(this.dlg,this.menuObj);this.menuObj.open(p.top,p.left,e.target)}Se(this.parent.element,this.menuObj.element.parentElement)}}}},h.prototype.ensureTextFilter=function(){var e,t=this.existingPredicate[this.options.field];return t&&2===t.length?e="greaterthanorequal"===t[0].operator&&"lessthanorequal"===t[1].operator?"between":"customfilter":t&&1===t.length&&(this.optrData=this.customFilterOperators[this.options.type+"Operator"],e=t[0].operator),e},h.prototype.preventClose=function(e){if(this.options&&this.options.isResponsiveFilter&&e.event){var t=e.event.target,i=t.classList.contains("e-resfilterback")||t.classList.contains("e-res-back-btn")||t.classList.contains("e-menu-item");e.cancel=!i}else e.event instanceof MouseEvent&&e.event.target.classList.contains("e-submenu")&&(e.cancel=!0)},h.prototype.getContextBounds=function(e){this.menuObj.element.style.display;return this.menuObj.element.style.display="block",this.menuObj.element.getBoundingClientRect()},h.prototype.getCMenuYPosition=function(e,t){var i=this.getContextBounds(t).width,r=e.getBoundingClientRect(),n=r.right+i-this.parent.element.clientWidth,o=e.offsetWidth-e.clientWidth;return o=o?o+1:0,n<1?r.right+1-o:r.left-i-1+o},h.prototype.openDialog=function(e){var t=this;this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e),this.dialogObj.dataBind();var i=this.existingPredicate[e.field]&&this.existingPredicate[e.field].length||this.options.filteredColumns.filter(function(e){return t.options.field===e.field}).length;this.createMenu(e.type,i>0,1===i||2===i,e),this.dlg.insertBefore(this.menu,this.dlg.firstChild),this.dlg.classList.add("e-excelfilter"),this.parent.enableRtl&&this.dlg.classList.add("e-rtl"),this.dlg.classList.remove("e-checkboxfilter"),this.cmenu=this.parent.createElement("ul",{className:"e-excel-menu"}),this.parent.notify("filterDialogCreated",{}),this.wireExEvents()},h.prototype.closeDialog=function(){e.prototype.closeDialog.call(this)},h.prototype.selectHandler=function(e){e.item&&(this.parent.notify("filter-cmenu-select",{}),this.menuItem=e.item,this.renderDialogue(e))},h.prototype.renderDialogue=function(e){var i=this,n=e?e.element:void 0,o=this.options.field,s=!t.isNullOrUndefined(o)&&_(o),l=!t.isNullOrUndefined(o)&&W(o),a=this.parent.createElement("div",{className:"e-xlfl-maindiv",id:s?l+"-xlflmenu":o+"-xlflmenu"});this.dlgDiv=this.parent.createElement("div",{className:"e-xlflmenu",id:s?l+"-xlfldlg":o+"-xlfldlg"}),this.options.isResponsiveFilter?document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv").appendChild(this.dlgDiv):this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new r.Dialog({header:this.getLocalizedLabel("CustomFilter"),isModal:!0,overlayClick:this.removeDialog.bind(this),showCloseIcon:!0,closeOnEscape:!1,target:document.body,visible:!1,enableRtl:this.parent.enableRtl,open:function(){var e=i.dlgObj.element.querySelector("table.e-xlfl-table>tr");i.options.column.filterTemplate&&(t.isBlazor()?e.querySelector(".e-xlfl-valuediv").children[0].focus():e.querySelector("#"+i.options.column.field+"-xlfl-frstvalue").focus())},close:this.removeDialog.bind(this),created:this.createdDialog.bind(this,n,o),buttons:[{click:this.filterBtnClick.bind(this,o),buttonModel:{content:this.getLocalizedLabel("OKButton"),isPrimary:!0,cssClass:"e-xlfl-okbtn"}},{click:this.removeDialog.bind(this),buttonModel:{content:this.getLocalizedLabel("CancelButton"),cssClass:"e-xlfl-cancelbtn"}}],content:a,width:430,animationSettings:{effect:"None"}});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dlgDiv.setAttribute("aria-label",this.getLocalizedLabel("CustomFilterDialogARIA")),this.dlgObj.appendTo(this.dlgDiv)},h.prototype.renderResponsiveDialog=function(){if(this.options.isResponsiveFilter){var e=document.querySelector(".e-row-responsive-filter");e&&e.classList.remove("e-row-responsive-filter"),this.dlgObj.buttons=[{}],this.dlgObj.header=void 0,this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.showCloseIcon=!1}},h.prototype.removeDialog=function(){if(t.isBlazor())for(var e=this.options.columns||[],i=0;i .e-dlg-header-content").offsetHeight+4;this.dlgObj.element.style.top=r+"px"}else this.dlgObj.element.style.top="0px";!this.options.isResponsiveFilter&&t.Browser.isDevice&&window.innerWidth<440&&(this.dlgObj.element.style.width="90%"),this.parent.notify("beforeCustomFilterOpen",{column:i,dialog:this.dialogObj}),this.dlgObj.show(),Se(this.parent.element,this.dlgObj.element.parentElement),this.parent.notify("set-custom-filter-header",{title:this.getLocalizedLabel("CustomFilter")})},h.prototype.renderCustomFilter=function(e,t){var i=this.dlgObj.element.querySelector(".e-xlfl-maindiv"),r=this.parent.createElement("div",{innerHTML:this.getLocalizedLabel("ShowRowsWhere"),className:"e-xlfl-dlgfields"});i.appendChild(r);var n=this.parent.createElement("div",{innerHTML:this.options.displayName,className:"e-xlfl-fieldset"});i.appendChild(n),this.renderFilterUI(t,i)},h.prototype.filterBtnClick=function(e){var i,r=!t.isNullOrUndefined(e)&&_(e),n=!t.isNullOrUndefined(e)&&W(e),o=r?n:e,s=this.options.column.filterTemplate&&t.isBlazor()?this.dlgDiv.querySelector(".-xlfl-frstvalue").children[0].querySelector(".e-control").ej2_instances[0]:this.dlgDiv.querySelector("#"+o+"-xlfl-frstvalue").ej2_instances[0],l=this.dlgDiv.querySelector("#"+o+"-xlfl-frstoptr").ej2_instances[0],a=this.options.column.filterTemplate&&t.isBlazor()?this.dlgDiv.querySelector(".-xlfl-secndvalue").children[0].querySelector(".e-control").ej2_instances[0]:this.dlgDiv.querySelector("#"+o+"-xlfl-secndvalue").ej2_instances[0],h=this.dlgDiv.querySelector("#"+o+"-xlfl-secndoptr").ej2_instances[0];"string"===this.options.type&&(i=this.dlgDiv.querySelector("#"+o+"-xlflmtcase").ej2_instances[0].checked);var d=this.dlgDiv.querySelector("#"+o+"e-xlfl-frstpredicate").ej2_instances[0],p=(this.dlgDiv.querySelector("#"+o+"e-xlfl-secndpredicate").ej2_instances[0],d.checked?"and":"or");null===a.value&&(p="or"),this.filterByColumn(this.options.field,l.value,s.value,p,i,this.options.ignoreAccent,h.value,a.value),this.removeDialog()},h.prototype.filterByColumn=function(e,r,n,o,s,l,a,h){var d,p=this.parent.getColumnByField?this.parent.getColumnByField(e):this.options.column,c=this.isForeignColumn(p)?p.foreignKeyValue:e,u=[];u.push({field:c,predicate:o,matchCase:s,ignoreAccent:l,operator:r,value:n,type:this.options.type});var g={instance:this,handler:this.filterByColumn,arg1:e,arg2:r,arg3:n,arg4:o,arg5:s,arg6:l,arg7:a,arg8:h,cancel:!1};if(this.parent.notify(ai,g),!g.cancel){d=new i.Predicate(c,r.toLowerCase(),n,!s,l),t.isNullOrUndefined(h)||t.isNullOrUndefined(a)||(u.push({field:c,predicate:o,matchCase:s,ignoreAccent:l,operator:a,value:h,type:this.options.type}),d=d[o](c,a.toLowerCase(),h,!s,l));var f={action:"filtering",filterCollection:u,field:this.options.field,ejpredicate:d,actualPredicate:u};this.isForeignColumn(p)?this.foreignKeyFilter(f,u,d):this.options.handler(f)}},h.prototype.renderOperatorUI=function(e,i,r,n,o){var l=this.parent.createElement("tr",{className:"e-xlfl-fields"});i.appendChild(l);var a=this.parent.createElement("td",{className:"e-xlfl-optr"});l.appendChild(a);var h=this.parent.createElement("div",{className:"e-xlfl-optrdiv"}),d=!t.isNullOrUndefined(e)&&_(e),p=!t.isNullOrUndefined(e)&&W(e),c=this.parent.createElement("input",{id:d?p+r:e+r});h.appendChild(c),a.appendChild(h);var u=this.options.type+"Operator",g=this.customFilterOperators[u];this.optrData=g;var f=this.dropSelectedVal(this.options.column,n,o),m="";this.menuItem&&((m=this.menuItem.text.slice(0,-3))!==this.getLocalizedLabel("CustomFilter")&&(f=o?m:void 0),m===this.getLocalizedLabel("Between")&&(f=this.getLocalizedLabel(o?"GreaterThanOrEqual":"LessThanOrEqual")));var y=this.options.column;return this.dropOptr=new s.DropDownList(z({dataSource:g,fields:{text:"text",value:"value"},text:f,open:this.dropDownOpen.bind(this),enableRtl:this.parent.enableRtl,change:this.dropDownValueChange.bind(this)},y.filter.params)),this.dropOptr.appendTo(c),{fieldElement:l,operator:this.getSelectedValue(f)}},h.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},h.prototype.dropDownValueChange=function(e){e.element.id.includes("-xlfl-frstoptr")?this.firstOperator=e.value.toString():this.secondOperator=e.value.toString()},h.prototype.getFilterUIInfo=function(){return{firstOperator:this.firstOperator,secondOperator:this.secondOperator,field:this.options.field}},h.prototype.getSelectedValue=function(e){var r=new i.DataManager(this.optrData).executeLocal((new i.Query).where("text","equal",e));return t.isNullOrUndefined(r[0])?"":r[0].value},h.prototype.dropSelectedVal=function(e,t,i){var r;return r=t&&t.length>0?2===t.length?i?t[0].operator:t[1].operator:i?t[0].operator:void 0:i&&"string"===e.type&&!e.filter.operator?"startswith":i?e.filter.operator||"equal":void 0,this.getSelectedText(r)},h.prototype.getSelectedText=function(e){var r=new i.DataManager(this.optrData).executeLocal((new i.Query).where("value","equal",e));return t.isNullOrUndefined(r[0])?"":r[0].text},h.prototype.renderFilterUI=function(e,t){var i=this.existingPredicate[e],r=this.parent.createElement("table",{className:"e-xlfl-table"});t.appendChild(r);var n=this.parent.createElement("colGroup");n.innerHTML='',r.appendChild(n);var o=this.renderOperatorUI(e,r,"-xlfl-frstoptr",i,!0);this.firstOperator=o.operator,this.renderFlValueUI(e,o,"-xlfl-frstvalue",i,!0);var s=this.parent.createElement("tr",{className:"e-xlfl-predicate"});r.appendChild(s),this.renderRadioButton(e,s,i),o=this.renderOperatorUI(e,r,"-xlfl-secndoptr",i,!1),this.secondOperator=o.operator,this.renderFlValueUI(e,o,"-xlfl-secndvalue",i,!1)},h.prototype.renderRadioButton=function(e,i,r){var o=this.parent.createElement("td",{className:"e-xlfl-radio",attrs:{colSpan:"2"}});i.appendChild(o);var s=this.parent.createElement("div",{className:"e-xlfl-radiodiv",attrs:{style:"display: inline-block"}}),l=!t.isNullOrUndefined(e)&&_(e),a=!t.isNullOrUndefined(e)&&W(e),h=this.parent.createElement("input",{id:l?a+"e-xlfl-frstpredicate":e+"e-xlfl-frstpredicate",attrs:{type:"radio"}}),d=this.parent.createElement("input",{id:l?a+"e-xlfl-secndpredicate":e+"e-xlfl-secndpredicate",attrs:{type:"radio"}});s.appendChild(h),s.appendChild(d),o.appendChild(s),"string"===this.options.type&&this.renderMatchCase(e,i,o,"-xlflmtcase",r);var p=new n.RadioButton({label:this.getLocalizedLabel("AND"),name:"default",cssClass:"e-xlfl-radio-and",checked:!0,enableRtl:this.parent.enableRtl}),c=new n.RadioButton({label:this.getLocalizedLabel("OR"),name:"default",cssClass:"e-xlfl-radio-or",enableRtl:this.parent.enableRtl});"and"===(r&&2===r.length?r[1].predicate:"and")?(p.checked=!0,c.checked=!1):(c.checked=!0,p.checked=!1),p.appendTo(h),c.appendTo(d)},h.prototype.removeObjects=function(e){for(var t=0,i=e;t1&&t.updateBlazorTemplate(f,"FilterTemplate",u)):h.querySelector("input").id=l?a+r:e+r,s.appendChild(h)}else{var m=this.parent.createElement("input",{id:l?a+r:e+r});h.appendChild(m),s.appendChild(h);var y=void 0,v=void 0;n&&n.length>0&&(y=(v=2===n.length?o?n[0]:n[1]:o?n[0]:void 0)&&v.operator===i.operator?v.value:void 0,t.isNullOrUndefined(y)&&(y=void 0)),{string:this.renderAutoComplete.bind(this),number:this.renderNumericTextBox.bind(this),date:this.renderDate.bind(this),datetime:this.renderDateTime.bind(this)}[this.options.type](this.options,e,m,y,this.parent.enableRtl)}},h.prototype.getExcelFilterData=function(e,t,i,r,n){var o="-xlfl-frstvalue"===e?0:1;if("-xlfl-frstvalue"===e||n.length>1){t={column:r instanceof Array?r[o]:r};var s=this.options.column.columnData&&n.length>1?1===this.options.column.columnData.length?0:1:o;t[this.options.field]=i.foreignKeyValue?this.options.column.columnData[s][i.foreignKeyValue]:n[s].value,this.options.foreignKeyValue&&(t[this.options.foreignKeyValue]=this.options.column.columnData[s][i.foreignKeyValue])}return t},h.prototype.renderMatchCase=function(e,i,r,o,s){var l=this.parent.createElement("div",{className:"e-xlfl-matchcasediv",attrs:{style:"display: inline-block"}}),a=!t.isNullOrUndefined(e)&&_(e),h=!t.isNullOrUndefined(e)&&W(e),d=this.parent.createElement("input",{id:a?h+o:e+o,attrs:{type:"checkbox"}});l.appendChild(d),r.appendChild(l);var p=!!(s&&s.length>0)&&(s&&2===s.length?s[1].matchCase:s[0].matchCase);new n.CheckBox({label:this.getLocalizedLabel("MatchCase"),enableRtl:this.parent.enableRtl,checked:p}).appendTo(d)},h.prototype.renderDate=function(e,t,i,r,n){var o=ue(e.format,e.type);this.datePicker=new l.DatePicker(z({format:o,cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:n,value:new Date(r),locale:this.parent.locale},e.column.filter.params)),this.datePicker.appendTo(i)},h.prototype.renderDateTime=function(e,t,i,r,n){var o=ue(e.format,e.type);this.dateTimePicker=new l.DateTimePicker(z({format:o,cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:n,value:new Date(r),locale:this.parent.locale},e.column.filter.params)),this.dateTimePicker.appendTo(i)},h.prototype.completeAction=function(e){e.result=Z(e.result)},h.prototype.renderNumericTextBox=function(e,t,i,r,n){this.numericTxtObj=new o.NumericTextBox(z({format:e.format,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:n,value:r,locale:this.parent.locale},e.column.filter.params)),this.numericTxtObj.appendTo(i)},h.prototype.renderAutoComplete=function(e,r,n,o,l){var a=this,h=this.options.column,d=this.isForeignColumn(h),p=d?h.dataSource:e.dataSource,c={value:d?h.foreignKeyValue:r},u=new s.AutoComplete(z({dataSource:p instanceof i.DataManager?p:new i.DataManager(p),fields:c,query:this.getQuery(),sortOrder:"Ascending",locale:this.parent.locale,cssClass:"e-popup-flmenu",autofill:!0,focus:function(){var i=!t.isNullOrUndefined(r)&&_(r),o=!t.isNullOrUndefined(r)&&W(r),s=i?o:r;u.filterType=a.dlgDiv.querySelector("#"+s+(n.id===s+"-xlfl-frstvalue"?"-xlfl-frstoptr":"-xlfl-secndoptr")).ej2_instances[0].value,u.ignoreCase="string"!==e.type||!a.dlgDiv.querySelector("#"+s+"-xlflmtcase").ej2_instances[0].checked,u.filterType=t.isNullOrUndefined(u.filterType)?"equal":u.filterType},placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:l,actionComplete:function(e){var i=!t.isNullOrUndefined(r)&&_(r);e.result=e.result.filter(function(e,t,r){return r.map(function(e){return i?Qe(u.fields.value,e):e[u.fields.value]}).indexOf(i?Qe(u.fields.value,e):e[a.actObj.fields.value])===t})},text:o},h.filter.params));if(p&&"result"in p){var g=Te({requestType:"stringfilterrequest"},this.getQuery());this.parent.trigger("dataStateChange",g.state),g.deffered.promise.then(function(e){u.dataSource=new i.DataManager(e)})}u.appendTo(n),this.actObj=u},h}(Yr),en=function(){function i(e,t,i,r){this.contentRefresh=!0,this.isModelChanged=!0,this.aria=new Ei,this.currentTarget=null,this.parent=e,this.sortSettings=t,this.sortedColumns=i,this.serviceLocator=r,this.focus=r.getService("focus"),this.addEventListener(),this.setFullScreenDialog()}return i.prototype.updateModel=function(){var e,t={field:this.columnName,direction:this.direction},i=this.parent.groupSettings.columns,r=!1;if(this.isMultiSort)(e=this.getSortedColsIndexByField(this.columnName))>-1&&this.sortSettings.columns.splice(e,1),this.sortSettings.columns.push(t),this.sortSettings.columns=this.sortSettings.columns;else if(i.length){for(var n=[],o=0,s=i.length;o-1)continue;this.sortedColumns.splice(this.sortedColumns.indexOf(i[r].field),1),i.splice(r,1),this.isRemove=!0,this.isModelChanged&&this.parent.notify(Bt,{requestType:"sorting",type:yt,target:this.currentTarget});break}this.addSortIcons()}},i.prototype.getSortedColsIndexByField=function(e,t){for(var i=t||this.sortSettings.columns,r=0,n=i.length;r1;for(var i=0,r=e.sortSettings.columns.slice();i-1&&this.sortColumn(n.field,n.direction,!0)}this.isMultiSort=!1,this.contentRefresh=!0}},i.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("set-fullscreen-dialog",this.setFullScreenDialog,this),this.parent.on(Mt,this.initialEnd,this),this.parent.on("sorting-complete",this.onActionComplete,this),this.parent.on(At,this.onPropertyChanged,this),this.parent.on(Ht,this.clickHandler,this),this.parent.on(Lt,this.refreshSortIcons,this),this.parent.on(qt,this.keyPressed,this),this.parent.on("cancel-Begin",this.cancelBeginEvent,this))},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("set-fullscreen-dialog",this.setFullScreenDialog),this.parent.off("sorting-complete",this.onActionComplete),this.parent.off(At,this.onPropertyChanged),this.parent.off(Ht,this.clickHandler),this.parent.off(Lt,this.refreshSortIcons),this.parent.off(qt,this.keyPressed),this.parent.off("cancel-Begin",this.cancelBeginEvent))},i.prototype.destroy=function(){this.isModelChanged=!1;var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.parent.element.querySelector(".e-gridpopup").querySelectorAll(".e-sortdirect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none"),this.parent.refreshing||this.clearSorting(),this.isModelChanged=!0,this.removeEventListener())},i.prototype.cancelBeginEvent=function(e){"sorting"===e.requestType&&(this.restoreSettings(),this.refreshSortIcons(),this.isMultiSort=!0)},i.prototype.clickHandler=function(e){var i=this.parent;this.currentTarget=null,this.popUpClickHandler(e);var r=t.closest(e.target,".e-headercell");if(r&&!e.target.classList.contains("e-grptogglebtn")&&!r.classList.contains("e-resized")&&!e.target.classList.contains("e-rhandler")&&!e.target.classList.contains("e-columnmenu")&&!e.target.classList.contains("e-filtermenudiv")&&!O(e.target,"e-stackedheadercell")&&!(i.allowSelection&&i.selectionSettings.allowColumnSelection&&e.target.classList.contains("e-headercell"))){var n=this.parent.getColumnByUid(r.querySelector(".e-headercelldiv").getAttribute("e-mappinguid")),o=r.querySelectorAll(".e-ascending").length?"Descending":"Ascending";"checkbox"!==n.type&&(this.initiateSort(r,e,n),t.Browser.isDevice&&this.showPopUp(e))}if(r&&r.classList.remove("e-resized"),O(e.target,"e-excel-ascending")||O(e.target,"e-excel-descending")){var s=t.closest(e.target,".e-filter-popup").getAttribute("uid"),o=t.isNullOrUndefined(O(e.target,"e-excel-descending"))?"Ascending":"Descending";this.sortColumn(i.getColumnByUid(s).field,o,!1)}},i.prototype.keyPressed=function(e){var i=e.target;if(!this.parent.isEdit&&("enter"===e.action||"ctrlEnter"===e.action||"shiftEnter"===e.action)&&t.closest(i,".e-headercell")){var r=this.focus.getFocusedElement();if(t.isNullOrUndefined(r)||!r.classList.contains("e-headercell")||!r.querySelector(".e-headercelldiv"))return;var n=this.parent.getColumnByUid(r.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"));this.initiateSort(r,e,n)}},i.prototype.initiateSort=function(e,i,r){var n=this.parent,o=r.field;this.currentTarget=i.target;var s=e.querySelectorAll(".e-ascending").length?"Descending":"Ascending";i.shiftKey||this.sortSettings.allowUnsort&&e.querySelectorAll(".e-descending").length&&!(n.groupSettings.columns.indexOf(o)>-1)?(this.removeSortColumn(o),t.isBlazor()&&!this.parent.isJsComponent&&(this.sortSettings.columns=this.sortSettings.columns)):this.sortColumn(o,s,i.ctrlKey||this.enableSortMultiTouch||-1!==navigator.userAgent.indexOf("Mac OS")&&i.metaKey)},i.prototype.showPopUp=function(e){var i=t.closest(e.target,".e-headercell");!this.parent.allowMultiSorting||t.isNullOrUndefined(i)&&!this.parent.isContextMenuOpen()||E(this.parent.element.querySelector(".e-gridpopup"),e,"e-sortdirect e-icons e-icon-sortdirect"+(this.sortedColumns.length>1?" e-spanclicked":""))},i.prototype.popUpClickHandler=function(e){var i=e.target;t.closest(i,".e-headercell")||e.target.classList.contains("e-rowcell")||t.closest(i,".e-gridpopup")?i.classList.contains("e-sortdirect")&&(i.classList.contains("e-spanclicked")?(i.classList.remove("e-spanclicked"),this.enableSortMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(i.classList.add("e-spanclicked"),this.enableSortMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},i.prototype.addSortIcons=function(){for(var e,i,r=this.parent,n=this.sortSettings.columns,o=this.parent.getColumns().map(function(e){return e.field}),s=0,l=n.length;s1&&e.querySelector(".e-headercelldiv").insertBefore(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(s+1).toString()}),e.querySelector(".e-headertext")),i=e.querySelector(".e-sortfilterdiv"),"Ascending"===n[s].direction?t.classList(i,["e-ascending","e-icon-ascending"],[]):t.classList(i,["e-descending","e-icon-descending"],[]))},i.prototype.removeSortIcons=function(e){for(var i,r=this.parent,n=this.sortSettings.columns,o=this.parent.getColumns().map(function(e){return e.field}),s=e||0,l=t.isNullOrUndefined(e)?n.length:e+1;s-1&&!i.querySelector(".e-sortfilterdiv")||-1!==o.indexOf(n[s].field)&&(this.aria.setSort(i,"none"),t.classList(i.querySelector(".e-sortfilterdiv"),[],["e-descending","e-icon-descending","e-ascending","e-icon-ascending"]),i.querySelector(".e-sortnumber")&&i.querySelector(".e-headercelldiv").removeChild(i.querySelector(".e-sortnumber")))},i.prototype.getSortColumnFromField=function(e){for(var t=0,i=this.sortSettings.columns.length;tr.totalPages&&r.totalPages&&(r.currentPage=r.totalPages),e=parseInt((r.currentPage/r.pageCount).toString(),10),r.currentPage%r.pageCount==0&&e>0&&(e-=1);for(var n=0;n0&&this.pagerModule.currentPage>1?(t.classList(this.prev,r,n),t.classList(this.first,e,i),t.classList(this.pagerElement.querySelector(".e-mfirst"),e,i),t.classList(this.pagerElement.querySelector(".e-mprev"),r,n)):(t.classList(this.prev,n,r),t.classList(this.first,i,e),t.classList(this.pagerElement.querySelector(".e-mprev"),n,r),t.classList(this.pagerElement.querySelector(".e-mfirst"),i,e))},e.prototype.updatePrevPagerSetStyles=function(){this.pagerModule.currentPage>this.pagerModule.pageCount?t.classList(this.PP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]):t.classList(this.PP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"])},e.prototype.updateNextPagerSetStyles=function(){var e=this.pagerModule,i=this.links[0].innerHTML.replace(e.customText,"");!i.length||!this.links.length||parseInt(i,10)+e.pageCount>e.totalPages?t.classList(this.NP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]):t.classList(this.NP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])},e.prototype.updateNextNLastStyles=function(){var e=["e-lastpage","e-pager-default"],i=["e-lastpagedisabled","e-disable"],r=["e-nextpage","e-pager-default"],n=["e-nextpagedisabled","e-disable"],o=this.pagerModule;o.currentPage===o.totalPages||0===o.totalRecordsCount?(t.classList(this.last,i,e),t.classList(this.next,n,r),t.classList(this.pagerElement.querySelector(".e-mlast"),i,e),t.classList(this.pagerElement.querySelector(".e-mnext"),n,r)):(t.classList(this.last,e,i),t.classList(this.next,r,n),t.classList(this.pagerElement.querySelector(".e-mlast"),e,i),t.classList(this.pagerElement.querySelector(".e-mnext"),r,n))},e}(),rn=function(){function e(e){this.pagerModule=e}return e.prototype.render=function(){var e=t.createElement("div",{className:"e-parentmsgbar",attrs:{"aria-label":"Pager Information"}});this.pageNoMsgElem=t.createElement("span",{className:"e-pagenomsg",styles:"textalign:right"}),this.pageCountMsgElem=t.createElement("span",{className:"e-pagecountmsg",styles:"textalign:right"}),t.append([this.pageNoMsgElem,this.pageCountMsgElem],e),this.pagerModule.element.appendChild(e),this.refresh()},e.prototype.refresh=function(){var e=this.pagerModule;t.isBlazor()?(this.pageNoMsgElem.textContent=this.format(e.getLocalizedLabel("CurrentPageInfo"),[0===e.totalRecordsCount?0:e.currentPage,e.totalPages||0])+" ",this.pageCountMsgElem.textContent=this.format(e.getLocalizedLabel("TotalItemsInfo"),[e.totalRecordsCount||0])):(this.pageNoMsgElem.textContent=this.format(e.getLocalizedLabel("currentPageInfo"),[0===e.totalRecordsCount?0:e.currentPage,e.totalPages||0,e.totalRecordsCount||0])+" ",this.pageCountMsgElem.textContent=this.format(e.getLocalizedLabel(e.totalRecordsCount<=1?"totalItemInfo":"totalItemsInfo"),[e.totalRecordsCount||0,e.totalRecordsCount?e.pageSize*(e.currentPage-1)+1:0,e.pageSize*e.currentPage>e.totalRecordsCount?e.totalRecordsCount:e.pageSize*e.currentPage])),this.pageNoMsgElem.parentElement.setAttribute("aria-label",this.pageNoMsgElem.textContent+this.pageCountMsgElem.textContent)},e.prototype.hideMessage=function(){this.pageNoMsgElem&&(this.pageNoMsgElem.style.display="none"),this.pageCountMsgElem&&(this.pageCountMsgElem.style.display="none")},e.prototype.showMessage=function(){this.pageNoMsgElem||this.render(),this.pageNoMsgElem.style.display="",this.pageCountMsgElem.style.display=""},e.prototype.destroy=function(){},e.prototype.format=function(e,t){for(var i,r=0;r=0;l--)(n=e[l])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},sn=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.hasParent=!1,r}return nn(i,e),i.prototype.requiredModules=function(){var e=[];return this.enableExternalMessage&&e.push({member:"externalMessage",args:[this]}),this.checkpagesizes()&&e.push({member:"pagerdropdown",args:[this]}),e},i.prototype.preRender=function(){this.defaultConstants={currentPageInfo:"{0} of {1} pages",totalItemsInfo:"({0} items)",totalItemInfo:"({0} item)",firstPageTooltip:"Go to first page",lastPageTooltip:"Go to last page",nextPageTooltip:"Go to next page",previousPageTooltip:"Go to previous page",nextPagerTooltip:"Go to next pager",previousPagerTooltip:"Go to previous pager",pagerDropDown:"Items per page",pagerAllDropDown:"Items",CurrentPageInfo:"{0} of {1} pages",TotalItemsInfo:"({0} items)",FirstPageTooltip:"Go to first page",LastPageTooltip:"Go to last page",NextPageTooltip:"Go to next page",PreviousPageTooltip:"Go to previous page",NextPagerTooltip:"Go to next pager",PreviousPagerTooltip:"Go to previous pager",PagerDropDown:"Items per page",PagerAllDropDown:"Items",All:"All"},this.containerModule=new tn(this),this.pagerMessageModule=new rn(this)},i.prototype.render=function(){this.template?this.isReactTemplate()?(this.on("pager-refresh",this.pagerTemplate,this),this.notify("pager-refresh",{})):this.pagerTemplate():(this.initLocalization(),this.updateRTL(),this.totalRecordsCount=this.totalRecordsCount||0,this.renderFirstPrevDivForDevice(),this.containerModule.render(),this.enablePagerMessage&&this.pagerMessageModule.render(),this.renderNextLastDivForDevice(),this.checkpagesizes()&&this.pagerdropdownModule&&this.pagerdropdownModule.render(),this.addAriaLabel(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render(),this.refresh(),this.trigger("created",{currentPage:this.currentPage,totalRecordsCount:this.totalRecordsCount}))},i.prototype.getPersistData=function(){var e=["currentPage","pageSize"];return this.addOnPersist(e)},i.prototype.destroy=function(){this.isReactTemplate()&&(this.off("pager-refresh",this.pagerTemplate),this.hasParent||this.destroyTemplate(["template"])),e.prototype.destroy.call(this),this.containerModule.destroy(),this.pagerMessageModule.destroy(),this.isReactTemplate()||(this.element.innerHTML="")},i.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},i.prototype.getModuleName=function(){return"pager"},i.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){e.pageCount!==t.pageCount&&(this.containerModule.refreshNumericLinks(),this.containerModule.refresh());for(var i=0,r=Object.keys(e);i=1&&e<=this.totalPages},i.prototype.currentPageChanged=function(e,t){if(this.enableQueryString&&this.updateQueryString(this.currentPage),e.currentPage!==t.currentPage||e.pageSize!==t.pageSize){var i={currentPage:this.currentPage,newProp:e,oldProp:t,cancel:!1};this.trigger("click",i),i.cancel||this.refresh()}},i.prototype.pagerTemplate=function(){if(!this.isReactTemplate()||!this.hasParent){var e;this.element.classList.add("e-pagertemplate"),this.compile(this.template);var i={currentPage:this.currentPage,pageSize:this.pageSize,pageCount:this.pageCount,totalRecordsCount:this.totalRecordsCount,totalPages:this.totalPages},r=this.element.parentElement.id+"_template";this.isReactTemplate()?(this.getPagerTemplate()(i,this,"template",r,null,null,this.element),this.renderReactTemplates()):(e=t.isBlazor()?this.getPagerTemplate()(i,this,"template",r,this.isStringTemplate):this.getPagerTemplate()(i),q(this.element,e))}},i.prototype.updateTotalPages=function(){this.totalPages=this.totalRecordsCount%this.pageSize==0?this.totalRecordsCount/this.pageSize:parseInt((this.totalRecordsCount/this.pageSize).toString(),10)+1},i.prototype.getPagerTemplate=function(){return this.templateFn},i.prototype.compile=function(e){if(e)try{document.querySelectorAll(e).length&&(this.templateFn=t.compile(document.querySelector(e).innerHTML.trim()))}catch(i){this.templateFn=t.compile(e)}},i.prototype.refresh=function(){this.template?this.isReactTemplate()?(this.updateTotalPages(),this.notify("pager-refresh",{})):(this.element.innerHTML="",this.updateTotalPages(),this.pagerTemplate()):(this.updateRTL(),this.containerModule.refresh(),this.enablePagerMessage&&this.pagerMessageModule.refresh(),this.pagerdropdownModule&&this.pagerdropdownModule.refresh(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.refresh())},i.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},i.prototype.initLocalization=function(){this.localeObj=new t.L10n(this.getModuleName(),this.defaultConstants,this.locale)},i.prototype.updateQueryString=function(e){var t=this.getUpdatedURL(window.location.href,"page",e.toString());window.history.pushState({path:t},"",t)},i.prototype.getUpdatedURL=function(e,t,i){var r=new RegExp("([?|&])"+t+"=.*?(&|#|$)","i");if(e.match(r))return e.replace(r,"$1"+t+"="+i+"$2");var n="";return-1!==e.indexOf("#")&&(n=e.replace(/.*#/,"#"),e=e.replace(/#.*/,"")),e+(-1!==e.indexOf("?")?"&":"?")+t+"="+i+n},i.prototype.renderFirstPrevDivForDevice=function(){this.element.appendChild(t.createElement("div",{className:"e-mfirst e-icons e-icon-first",attrs:{title:t.isBlazor()?this.getLocalizedLabel("FirstPageTooltip"):this.getLocalizedLabel("firstPageTooltip"),tabindex:"-1"}})),this.element.appendChild(t.createElement("div",{className:"e-mprev e-icons e-icon-prev",attrs:{title:t.isBlazor()?this.getLocalizedLabel("PreviousPageTooltip"):this.getLocalizedLabel("previousPageTooltip"),tabindex:"-1"}}))},i.prototype.renderNextLastDivForDevice=function(){this.element.appendChild(t.createElement("div",{className:"e-mnext e-icons e-icon-next",attrs:{title:t.isBlazor()?this.getLocalizedLabel("NextPageTooltip"):this.getLocalizedLabel("nextPageTooltip"),tabindex:"-1"}})),this.element.appendChild(t.createElement("div",{className:"e-mlast e-icons e-icon-last",attrs:{title:t.isBlazor()?this.getLocalizedLabel("LastPageTooltip"):this.getLocalizedLabel("lastPageTooltip"),tabindex:"-1"}}))},i.prototype.addAriaLabel=function(){var e=[".e-mfirst",".e-mprev",".e-mnext",".e-mlast"];if(!t.Browser.isDevice)for(var i=0;i .e-dlg-content > .e-mainfilterdiv").appendChild(this.dlgDiv):this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new r.Dialog({showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,created:this.dialogCreated.bind(this,e,i),position:this.parent.element.classList.contains("e-device")?{X:"center",Y:"center"}:{X:"",Y:""},target:this.parent.element.classList.contains("e-device")?document.body:this.parent.element,buttons:[{click:this.filterBtnClick.bind(this,i),buttonModel:{content:this.l10n.getConstant("FilterButton"),isPrimary:!0,cssClass:"e-flmenu-okbtn"}},{click:this.clearBtnClick.bind(this,i),buttonModel:{content:this.l10n.getConstant("ClearButton"),cssClass:"e-flmenu-cancelbtn"}}],content:o,width:!t.isNullOrUndefined(O(e,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:250,animationSettings:{effect:"None"},cssClass:"e-filter-popup"});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dlgObj.appendTo(this.dlgDiv)},e.prototype.renderResponsiveDialog=function(){this.parent.enableAdaptiveUI&&(this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.buttons=[{}])},e.prototype.dialogCreated=function(e,i){!t.Browser.isDevice&&e&&ee(e,this.dlgObj,this.parent),this.renderFilterUI(e,i),this.parent.notify("filterDialogCreated",{}),this.parent.enableAdaptiveUI?(this.dlgObj.element.style.left="0px",this.dlgObj.element.style.maxHeight="none"):this.dlgObj.element.style.maxHeight=this.maxHeight,this.dlgObj.show(),i.filterTemplate||this.writeMethod(i,this.dlgObj.element.querySelector("#"+i.uid+"-flmenu"));var r={requestType:"filterafteropen",columnName:i.field,columnType:i.type};if(!t.isBlazor()||this.parent.isJsComponent){r.filterModel=this}this.isDialogOpen=!0,this.isMenuCheck||this.parent.trigger(vt,r)},e.prototype.renderFilterUI=function(e,t){var i=this.dlgObj.element.querySelector(".e-flmenu-maindiv");this.parent.log("column_type_missing",{column:t}),this.renderOperatorUI(i,e,t),this.renderFlValueUI(i,e,t)},e.prototype.renderOperatorUI=function(e,t,i){this.flMuiObj.renderOperatorUI(e,t,i,this.dlgObj,this.filterObj.menuOperator)},e.prototype.renderFlValueUI=function(e,i,r){var n=this.parent.createElement("div",{className:"e-flmenu-valuediv"}),o=this.filterObj;e.appendChild(n);this.flMuiObj,this.dlgObj;var s=new this.colTypes[r.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(r.filterTemplate){var l={};l[r.field]=l.value=o.values[r.field],r.foreignKeyValue&&(l[r.foreignKeyValue]=o.values[r.field],l[r.field]=void 0);l.column=r;var a=this.parent.isReact&&"string"!=typeof r.filterTemplate,h=this.parent.element.id+r.uid+"filterTemplate";if(a)r.getFilterTemplate()(l,this.parent,"filterTemplate",h,null,null,n),this.parent.renderTemplates();else{var d=r.getFilterTemplate()(l,this.parent,"filterTemplate",h);t.updateBlazorTemplate(h,"FilterTemplate",r),q(n,d)}this.isMenuCheck&&(this.menuFilterBase.cBox=this.dlgObj.element.querySelector(".e-checkboxlist.e-fields"),this.menuFilterBase.wireEvents(),this.parent.on(li,this.actionComplete,this),this.menuFilterBase.getAllData())}else if(t.isNullOrUndefined(r.filter)||t.isNullOrUndefined(r.filter.ui)||t.isNullOrUndefined(r.filter.ui.create))s.create({column:r,target:n,getOptrInstance:this.flMuiObj,localizeText:this.l10n,dialogObj:this.dlgObj});else{var p=r.filter.ui.create;"string"==typeof p&&(p=t.getValue(p,window)),p({column:r,target:n,getOptrInstance:this.flMuiObj,dialogObj:this.dlgObj})}},e.prototype.writeMethod=function(e,i){for(var r,n=i.querySelector(".e-flmenu-valinput"),o=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings),s=0,l=this.filterSettings.columns;s","<","="],this.actualPredicate={},this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.addEventListener(),this.setFullScreenDialog()}return r.prototype.render=function(r){if(!(i.DataUtil.getObject("args.isFrozen",r)||"Left-Right"===this.parent.getFrozenMode()&&i.DataUtil.getObject("args.renderFrozenRightContent",r))){var n=this.parent;if(this.l10n=this.serviceLocator.getService("localization"),this.getLocalizedCustomOperators(),"FilterBar"===this.parent.filterSettings.type&&n.columns.length){var o=this.parent.element.querySelector(".e-filterbar");o&&t.remove(o);var s=new vi(this.serviceLocator,e.CellType.Filter,n),l=void 0;this.serviceLocator.getService("cellRendererFactory").addCellRenderer(e.CellType.Filter,new cn(this.parent,this.serviceLocator)),this.valueFormatter=this.serviceLocator.getService("valueFormatter"),s.element=this.parent.createElement("tr",{className:"e-filterbar"}),(l=this.generateRow()).data=this.values,"Right"===n.getFrozenMode()?n.getFrozenRightHeader().querySelector("thead").appendChild(s.element):this.parent.getHeaderContent().querySelector("thead").appendChild(s.element);var a=this.parent.element.querySelector(".e-rowdragheader");this.element=s.render(l,n.getColumns(),null,null,s.element);var h=this.element.querySelector(".e-detailheadercell");h&&(h.className="e-filterbarcell e-mastercell"),a&&(a.className="e-dragheadercell e-mastercell");var d=[].slice.call(this.element.querySelectorAll(".e-grouptopleftcell"));d.length&&d[d.length-1].classList.add("e-lastgrouptopleftcell"),this.wireEvents(),this.parent.notify(ii,{case:"filter"})}}},r.prototype.showCustomFilter=function(){this.responsiveDialogRenderer.showResponsiveDialog(this.column)},r.prototype.setFilterModel=function(e){var t=e.filter.type||this.parent.filterSettings.type;this.filterModule=new this.type[t](this.parent,this.parent.filterSettings,this.serviceLocator,this.customOperators,this)},r.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))){if(this.filterModule&&this.filterModule.destroy(),this.parent.refreshing||(this.filterSettings.columns=[]),this.updateFilterMsg(),this.removeEventListener(),this.unWireEvents(),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator)for(var i=this.element.querySelectorAll(".e-filterbaroperator"),r=0;r-1&&!Array.isArray(this.value)?this.filterSettings.columns[o]=this.currentFilterObject:this.filterSettings.columns.push(this.currentFilterObject)}this.filterSettings.columns=this.filterSettings.columns,this.parent.dataBind()},r.prototype.getFilteredColsIndexByField=function(e){for(var t=this.filterSettings.columns,i=0,r=t.length;i1&&!t.isNullOrUndefined(this.actualPredicate[this.fieldName])?this.actualPredicate[this.fieldName].push(c):this.actualPredicate[this.fieldName]=[c],this.checkAlreadyColFiltered(this.column.field)||this.updateModel()}},r.prototype.applyColumnFormat=function(e){var t="date"===this.column.type||"datetime"===this.column.type?new Date(e):parseFloat(e);this.values[this.column.field]=this.setFormatForFlColumn(t,this.column)},r.prototype.skipUid=function(e){for(var t=!0,i=Object.keys(e),r=0;r0&&this.filterStatusMsg!==this.l10n.getConstant("InvalidFilterMessage")){this.filterStatusMsg="";for(var o=0;o-1)&&(r=!0);else if("string"===e.type)for(var n=0,o=t;n-1&&(r=!0)}return r},r.prototype.processFilter=function(e){this.stopTimer(),this.startTimer(e)},r.prototype.startTimer=function(e){var t=this;this.timer=window.setInterval(function(){t.onTimerTick()},13===e.keyCode?0:this.filterSettings.immediateModeDelay)},r.prototype.stopTimer=function(){window.clearInterval(this.timer)},r.prototype.onTimerTick=function(){var e="[id='"+this.column.field+"_filterBarcell']",i=this.element.querySelector(e);!i&&this.parent.isFrozenGrid()&&(i=this.parent.getHeaderContent().querySelector(e));var r;if(this.cellText[this.column.field]=i.value,this.stopTimer(),t.isNullOrUndefined(this.column.filterBarTemplate))r=JSON.parse(JSON.stringify(i.value));else{var n=this.column.filterBarTemplate.read;"string"==typeof n&&(n=t.getValue(n,window)),t.isNullOrUndefined(n)||(this.value=n.call(this,i))}if(t.isNullOrUndefined(this.value)||""===this.value)return void this.removeFilteredColsByField(this.column.field);this.validateFilterValue(this.value),this.filterByMethod=!1,this.filterByColumn(this.column.field,this.operator,this.value,this.predicate,this.filterSettings.enableCaseSensitivity,this.ignoreAccent),this.filterByMethod=!0,i.value=r,this.updateFilterMsg()},r.prototype.validateFilterValue=function(e){var i,r;this.parent;switch(this.matchCase=this.filterSettings.enableCaseSensitivity,this.column.type){case"number":this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal,i=[">","<","=","!"];for(var n=0;n-1){r=n;break}this.getOperator(e.substring(r)),0!==r&&(this.value=e.substring(0,r)),""!==this.value&&e.length>=1&&(this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type)),isNaN(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage"));break;case"date":case"datetime":this.operator=this.filterOperators.equal,""===this.value||this.value instanceof Date||(this.getOperator(e),this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type),t.isNullOrUndefined(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")));break;case"string":this.matchCase=!1,"*"===e.charAt(0)?(this.value=this.value.slice(1),this.operator=this.filterOperators.startsWith):"%"===e.charAt(e.length-1)?(this.value=this.value.slice(0,-1),this.operator=this.filterOperators.startsWith):"%"===e.charAt(0)?(this.value=this.value.slice(1),this.operator=this.filterOperators.endsWith):this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.startsWith;break;case"boolean":"true"===e.toLowerCase()||"1"===e?this.value=!0:"false"===e.toLowerCase()||"0"===e?this.value=!1:e.length&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")),this.operator=this.filterOperators.equal;break;default:this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal}},r.prototype.getOperator=function(e){var r=e.charAt(0),n=e.slice(0,2),o=t.extend({"=":this.filterOperators.equal,"!":this.filterOperators.notEqual},i.DataUtil.operatorSymbols);(o.hasOwnProperty(r)||o.hasOwnProperty(n))&&(this.operator=o[r],this.value=e.substring(1),this.operator||(this.operator=o[n],this.value=e.substring(2))),this.operator!==this.filterOperators.lessThan&&this.operator!==this.filterOperators.greaterThan||"="===this.value.charAt(0)&&(this.operator=this.operator+"orequal",this.value=this.value.substring(1))},r.prototype.columnPositionChanged=function(e){this.parent.filterSettings.type},r.prototype.getLocalizedCustomOperators=function(){var e=[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}];this.customOperators={stringOperator:[{value:"startswith",text:this.l10n.getConstant("StartsWith")},{value:"endswith",text:this.l10n.getConstant("EndsWith")},{value:"contains",text:this.l10n.getConstant("Contains")},{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}],numberOperator:e,dateOperator:e,datetimeOperator:e,booleanOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}]}},r.prototype.openMenuByField=function(e){var t=this.parent;if(t.enableAdaptiveUI)return void this.showCustomFilter();var i=t.getColumnByField(e),r=t.getColumnHeaderByField(e).querySelector(".e-filtermenudiv");if(r){var n=t.element.getBoundingClientRect(),o=r.getBoundingClientRect();this.filterDialogOpen(i,r,o.right-n.left,o.bottom-n.top)}},r.prototype.filterIconClickHandler=function(e){var t=e.target;if(t.classList.contains("e-filtermenudiv")&&("Menu"===this.parent.filterSettings.type||"CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type)){var i=this.parent.getColumnByUid(O(t,"e-headercell").firstElementChild.getAttribute("e-mappinguid"));if(this.column=i,this.fltrDlgDetails.field===i.field&&this.fltrDlgDetails.isOpen)return;this.filterModule&&this.filterModule.closeDialog(),this.fltrDlgDetails={field:i.field,isOpen:!0},this.openMenuByField(i.field)}},r.prototype.clickHandler=function(e){if("FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&(O(e.target,"e-filterbarcell")&&e.target.classList.contains("e-input-group-icon")&&t.closest(e.target,"div").querySelector(".e-filterbaroperator").focus(),e.target.classList.contains("e-list-item"))){var i=document.querySelector(".e-popup-open").getAttribute("id").replace("_popup","");-1!==i.indexOf("grid-column")&&t.closest(document.getElementById(i),"div").querySelector(".e-filtertext").focus()}if("Immediate"===this.filterSettings.mode||"Menu"===this.parent.filterSettings.type||"CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type){this.parent;var r=e.target,n=r.classList.contains("e-day"),o=O(this.parent.element,"e-dialog"),s=!1,l=O(r,"e-popup"),a=this.parent.element.querySelector(".e-filter-popup");if(o&&l&&(s=o.id===l.id),a&&(O(r,"e-excel-ascending")||O(r,"e-excel-descending"))&&this.filterModule.closeDialog(r),O(r,"e-filter-popup")||r.classList.contains("e-filtermenudiv"))return;if(!this.filterModule||O(r,"e-popup-wrapper")||t.closest(r,".e-filter-item.e-menu-item")||n||(s&&!O(r,"e-filter-popup")&&!O(r,"e-popup-flmenu")||!l&&a)&&(this.filterModule.isresetFocus=O(r,"e-grid")&&O(r,"e-grid").id===this.parent.element.id,this.filterModule.closeDialog(r)),"Immediate"===this.filterSettings.mode&&r.classList.contains("e-clear-icon")){var h=r.previousElementSibling;this.removeFilteredColsByField(h.id.slice(0,-14))}}},r.prototype.filterHandler=function(e){var r;this.actualPredicate[e.field]=e.actualPredicate;for(var n=new i.DataManager(this.filterSettings.columns),o=(new i.Query).where("field",this.filterOperators.equal,e.field),s=n.executeLocal(o),l=0;l0&&this.autoFitColumns(e),"Auto"===this.parent.resizeSettings.mode&&this.widthService.setWidthToTable()},i.prototype.resizeColumn=function(e,i,r){var n,o,s,l,a,h,d=this.parent,p=0,c=0,u=r||this.parent.getUidByColumnField(e),g=this.parent.getNormalizedColumnIndex(u),f=this.parent.getColumnIndexByField(e),m=d.getFrozenColumns()||d.getFrozenLeftColumnsCount(),y=d.getMovableColumnsCount();if(t.isNullOrUndefined(d.getFooterContent())||(s=d.getFooterContentTable()),d.isFrozenGrid()){var v=d.getColumnByField(e);"frozen-left"===v.getFreezeTableName()?(n=d.getHeaderTable(),o=d.getContentTable(),l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g+1)+")"),s&&(h=s.querySelectorAll("td:nth-child("+(g+1)+")"))):"movable"===v.getFreezeTableName()?(n=d.getHeaderContent().querySelector(".e-movableheader").children[0],o=d.getContent().querySelector(".e-movablecontent").children[0],l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g-m+1)+")"),s&&(h=(s=d.getFooterContent().querySelector(".e-movablefootercontent").children[0]).querySelectorAll("td:nth-child("+(g-m+1)+")"))):"frozen-right"===v.getFreezeTableName()&&(n=d.getHeaderContent().querySelector(".e-frozen-right-header").children[0],o=d.getContent().querySelector(".e-frozen-right-content").children[0],l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g-(m+y)+1)+")"),s&&(h=(s=d.getFooterContent().querySelector(".e-movablefootercontent").children[0]).querySelectorAll("td:nth-child("+(g-(m+y)+1)+")")))}else n=d.getHeaderTable(),o=d.getContentTable(),l=n.querySelector('[e-mappinguid="'+u+'"]').parentElement.cloneNode(!0),a=o.querySelectorAll("td:nth-child("+(g+1)+"):not(.e-groupcaption)"),s&&(h=s.querySelectorAll("td:nth-child("+(g+1)+"):not(.e-groupcaption)"));var C=n.querySelector("tr").querySelectorAll(".e-grouptopleftcell");if(C.length>0)for(D=0;DE&&(I.width=E),this.widthService.setColumnWidth(d.getColumns()[f]),!1===d.getColumns().some(function(e){return null===e.width||void 0===e.width||e.width.length<=0}))for(var M=d.getColumns(),D=0;D0&&!d.isFrozenGrid()&&((this.parent.detailTemplate||this.parent.childGrid)&&this.widthService.setColumnWidth(new ft({width:"30px"})),"Auto"===this.parent.resizeSettings.mode&&(O="100%"),n.style.width=t.formatUnit(O),o.style.width=t.formatUnit(O),t.isNullOrUndefined(s)||(s.style.width=t.formatUnit(O)));var A=n.offsetWidth;d.getContent().scrollWidth>A?(n.classList.add("e-tableborder"),o.classList.add("e-tableborder")):(n.classList.remove("e-tableborder"),o.classList.remove("e-tableborder")),t.isNullOrUndefined(s)||s.classList.add("e-tableborder")},i.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.widthService=null,this.unwireEvents(),this.removeEventListener())},i.prototype.getModuleName=function(){return"resize"},i.prototype.findColumn=function(e){for(var i=0;i-1&&!t.isNullOrUndefined(o)&&!0===o.visible&&this.resizeColumn(r,n)}},i.prototype.createTable=function(e,t,i){var r=this.parent.createElement("div");r.className=this.parent.element.className,r.style.cssText="display: inline-block;visibility:hidden;position:absolute";var n=this.parent.createElement("div");n.className=i;var o=this.parent.createElement("table");o.className=e.className,o.classList.add("e-resizetable"),o.style.cssText="table-layout: auto;width: auto";for(var s=this.parent.createElement("tr"),l=0;l0&&(e[t].style.height=e[t].parentElement.offsetHeight+"px");this.setHandlerHeight()},i.prototype.wireEvents=function(){t.EventHandler.add(this.parent.getHeaderContent(),t.Browser.touchStartEvent,this.touchResizeStart,this),t.EventHandler.add(this.parent.getHeaderContent(),"dblclick",this.callAutoFit,this)},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.parent.getHeaderContent(),t.Browser.touchStartEvent,this.touchResizeStart),t.EventHandler.remove(this.parent.getHeaderContent(),"dblclick",this.callAutoFit)},i.prototype.getResizeHandlers=function(){return this.parent.isFrozenGrid()?[].slice.call(this.parent.getHeaderContent().querySelectorAll("."+xn.root)):[].slice.call(this.parent.getHeaderTable().querySelectorAll("."+xn.root))},i.prototype.setHandlerHeight=function(){for(var e=[].slice.call(this.parent.getHeaderTable().querySelectorAll("."+xn.suppress)),t=0;ti?i:e},i.prototype.updateResizeEleHeight=function(){for(var e=[].slice.call(this.parent.getHeaderContent().querySelectorAll(".e-rhandler")),t=0;t=r||!this.parent.enableRtl&&this.minMove<=r)&&(s=this.column.minWidth?parseFloat(this.column.minWidth.toString()):10,this.pageX=r=this.minMove),("frozen-right"!==this.column.getFreezeTableName()&&(!this.parent.enableRtl&&this.minMove>=r||this.parent.enableRtl&&this.minMove<=r)||"frozen-right"===this.column.getFreezeTableName()&&(this.parent.enableRtl&&this.minMove>=r||!this.parent.enableRtl&&this.minMove<=r))&&(s=this.column.minWidth?parseFloat(this.column.minWidth.toString()):10,this.pageX=r=this.minMove),s!==parseFloat(t.isNullOrUndefined(this.column.width)||"auto"===this.column.width?i.toString():this.column.width.toString())){this.pageX=r,this.column.width=t.formatUnit(s);var l={e:e,column:this.column};if(this.parent.trigger("resizing",l),l.cancel)return void this.cancelResizeAction(!0);var a=[this.column],h=[this.column];this.column.columns&&(a=this.getSubColumns(this.column,[]),a=this.calulateColumnsWidth(a,!1,n),h=this.calulateColumnsWidth(a,!0,n));for(var d=0,p=h;dn.clientHeight&&(this.parent.scrollModule.setPadding(),n.style.overflowY="scroll"),this.parent.trigger("resizeStop",i),t.closest(this.element,".e-headercell").classList.add("e-resized"),O(this.element,"e-frozenheader")?this.isFrozenColResized=!0:this.isFrozenColResized=!1,this.parent.isFrozenGrid()&&this.parent.notify(ii,{case:"textwrap"}),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.parent.notify("textWrapRefresh",{case:"textwrap"})),this.refresh(),this.doubleTapEvent(e),this.isDblClk=!0}},i.prototype.getPointX=function(e){return e.touches&&e.touches.length?e.touches[0].pageX:e.pageX},i.prototype.refreshColumnWidth=function(){for(var e=this.parent.getColumns(),t=0,i=[].slice.apply(this.parent.getHeaderContent().querySelectorAll("th.e-headercell"));t-1;s++)i+=n[s].offsetHeight;var l=this.calcPos(r);O(r,"e-frozen-right-header")?l.left+=this.parent.enableRtl?r.offsetWidth-2:-1:l.left+=this.parent.enableRtl?-1:r.offsetWidth-2,this.helper.style.cssText="height: "+i+"px; top: "+l.top+"px; left:"+Math.floor(l.left)+"px;",this.parent.enableVirtualization&&this.helper.classList.add("e-virtual-rhandler")},i.prototype.getScrollBarWidth=function(e){var t=this.parent.getContent().firstChild;return t.scrollHeight>t.clientHeight&&e||t.scrollWidth>t.clientWidth?j():0},i.prototype.removeHelper=function(e){var i=e.target.classList;i.contains(xn.root)||i.contains(xn.icon)||!this.helper||(t.EventHandler.remove(document,t.Browser.touchStartEvent,this.removeHelper),t.EventHandler.remove(this.helper,t.Browser.touchStartEvent,this.resizeStart),t.detach(this.helper),this.refresh())},i.prototype.updateHelper=function(){var e,i=t.closest(this.element,xn.header);if((e=O(i,"e-frozen-right-header")?Math.floor(this.calcPos(i).left+(this.parent.enableRtl?i.offsetWidth-2:-1)):Math.floor(this.calcPos(i).left+(this.parent.enableRtl?-1:i.offsetWidth-2)))>this.parentElementWidth&&(e=this.parentElementWidth-2),this.parent.isFrozenGrid()){var r=t.closest(i,".e-table").offsetLeft;e-1&&n},e.prototype.chkDropAllCols=function(e,t){this.parent.columns;for(var i,r=this.getHeaderCells();!i&&r.length>0;)i=e!==r.pop()&&this.targetParentContainerIndex(e,t)>-1;return i},e.prototype.findColParent=function(e,t,i){i=i;for(var r=0,n=t.length;r-1&&this.moveColumns(l,r,!0)},e.prototype.reorderMultipleColumns=function(e,i){var r=this.parent.getColumnIndexByField(i),n=this.parent.getColumnByField(i);if(!(r<0)&&(t.isNullOrUndefined(n)||n.allowReordering&&!n.lockColumn)){for(o=0;o-1&&this.moveColumns(a,this.parent.getColumnByField(e[o]),!0,!(t.isBlazor()&&!this.parent.isJsComponent)),this.parent.getColumnIndexByField(e[o+1])>=a&&r++}if(t.isBlazor()&&!this.parent.isJsComponent){var h=this.parent.getColumns();this.parent.notify(Bt,{fromColumnUid:e.map(function(e){return h.filter(function(t){return t.field===e})[0].uid}),toColumnUid:n.uid,isMultipleReorder:!0,requestType:"reorder",type:"actionBegin"})}}},e.prototype.moveTargetColumn=function(e,t){t>-1&&this.moveColumns(t,e,!0)},e.prototype.reorderSingleColumnByTarget=function(e,t){var i=this.parent.getColumnByField(e);this.moveTargetColumn(i,t)},e.prototype.reorderMultipleColumnByTarget=function(e,t){for(var i=0;iP(e.event).x+s.scrollLeft;t.removeClass(i.getHeaderTable().querySelectorAll(".e-reorderindicate"),["e-reorderindicate"]),this.setDisplay("none"),this.stopTimer(),t.classList(o,["e-defaultcur"],["e-notallowedcur"]),this.updateScrollPostion(e.event),n&&!n.isEqualNode(this.element)&&(r=n,this.chkDropPosition(this.element,r)&&this.chkDropAllCols(this.element,r)?(this.updateArrowPosition(r,l),t.classList(r,["e-allowDrop","e-reorderindicate"],[])):i.allowGrouping&&O(e.target,"e-groupdroparea")||t.classList(o,["e-notallowedcur"],["e-defaultcur"])),i.trigger(bt,{target:r,draggableType:"headercell",column:e.column})}},e.prototype.updateScrollPostion=function(e){var t=this,i=P(e).x,r=this.parent.element.getBoundingClientRect(),n=r.right;if(this.parent.isFrozenGrid())this.updateFrozenScrollPosition(i,r);else{var o=r.left,s=this.parent.getContent().firstElementChild;i>o&&in-35&&(this.timer=window.setInterval(function(){t.setScrollLeft(s,!1)},50))}},e.prototype.updateFrozenScrollPosition=function(e,t){var i=this,r=this.parent.getContent().querySelector(".e-movablecontent"),n=this.parent.element.querySelector(".e-movableheader").getBoundingClientRect(),o=this.parent.getFrozenLeftCount(),s=this.parent.getFrozenRightColumnsCount()?n.right:t.right,l=o?n.left:t.left;e>l&&es-35&&(this.timer=window.setInterval(function(){i.setScrollLeft(r,!1)},50))},e.prototype.setScrollLeft=function(e,t){var i=e.scrollLeft;e.scrollLeft=e.scrollLeft+(t?-5:5),i!==e.scrollLeft&&this.setDisplay("none")},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.updateArrowPosition=function(e,t){var i=e.getBoundingClientRect(),r=this.parent.element.getBoundingClientRect();if(!(t&&i.leftr.right)){if(this.parent.isFrozenGrid()&&e.classList.contains("e-headercell")){var n=this.parent.getFrozenLeftCount(),o=this.parent.getFrozenRightColumnsCount(),s=this.element.querySelector(".e-headercelldiv"),l=s?this.parent.getColumnByUid(s.getAttribute("data-uid")):null,a=this.parent.getColumnByUid(e.firstElementChild.getAttribute("e-mappinguid")),h=Math.round(this.parent.getFrozenVirtualHeader().getBoundingClientRect().right),d=Math.round(this.parent.getMovableVirtualHeader().getBoundingClientRect().right);if(a){if(n&&!o&&this.parent.getNormalizedColumnIndex(a.uid)>=n&&(t&&Math.round(i.left)1&&r.startedRow.hasAttribute("aria-selected")){var u="Left-Right"===i.getFrozenMode()?3:2,g=r.parent.createElement("span",{className:"e-dropitemscount",innerHTML:a?""+p.length/u:""+p.length});o.appendChild(g)}var f=t.closest(n,"tr").querySelector(".e-icon-rowdragicon");return f&&f.classList.add("e-dragstartrow"),s.appendChild(l),o.appendChild(s),i.element.appendChild(o),o},this.dragStart=function(e){var i=r.parent;if(!document.getElementsByClassName("e-griddragarea").length){var n=e.target,o=r.parent.element.querySelector(".e-dropitemscount");r.parent.getSelectedRecords().length>1&&o&&(o.style.left=r.parent.element.querySelector(".e-cloneproperties table").offsetWidth-5+"px"),r.processArgs(n),i.trigger(Rt,{rows:t.isBlazor()?null:r.rows,target:t.isBlazor()?null:e.target,draggableType:"rows",fromIndex:parseInt(r.rows[0].getAttribute("aria-rowindex"),10),data:Object.keys(r.rowData[0]).length>0?r.rowData:r.currentViewData()}),t.isBlazor()&&e.bindEvents(e.dragElement),r.dragStartData=r.rowData;var s=document.getElementById(i.rowDropSettings.targetID);i.rowDropSettings.targetID&&s&&s.ej2_instances&&"grid"===s.ej2_instances[0].getModuleName()&&s.ej2_instances[0].getContent().classList.add("e-allowRowDrop")}},this.drag=function(e){var i=r.parent;if(r.isDropGrid=r.parent,r.istargetGrid=!1,r.parent.rowDropSettings.targetID){var n=document.getElementById(i.rowDropSettings.targetID);r.isDropGrid=n.ej2_instances[0],O(e.target,"e-grid")&&(r.istargetGrid=r.parent.rowDropSettings.targetID===O(e.target,"e-grid").id)}var o=r.parent.element.querySelector(".e-cloneproperties"),s=r.getElementFromPosition(o,e.event);t.classList(o,["e-defaultcur"],["e-notallowedcur","e-movecur"]),r.isOverflowBorder=!0,r.hoverState=i.enableHover;var l=O(s,"e-grid")?t.closest(e.target,"tr"):null;if(i.enableHover=!1,e.target){r.processArgs(s);var a={rows:r.rows,target:s,draggableType:"rows",data:r.rowData,originalEvent:e,cancel:!1};if(i.trigger(Ft,a),r.stopTimer(),!a.cancel){if(i.element.classList.add("e-rowdrag"),r.dragTarget=l&&O(s,"e-grid").id===o.parentElement.id?parseInt(l.getAttribute("aria-rowindex"),10):parseInt(r.startedRow.getAttribute("aria-rowindex"),10),i.rowDropSettings.targetID)O(s,"e-grid")&&O(o.parentElement,"e-grid").id!==O(s,"e-grid").id?t.classList(o,["e-defaultcur"],["e-notallowedcur"]):t.classList(o,["e-notallowedcur"],["e-defaultcur"]);else{var h=O(s,"e-grid");h&&h.id===o.parentElement.id?t.classList(o,["e-movecur"],["e-defaultcur"]):t.classList(o,["e-notallowedcur"],["e-movecur"])}if(O(r.isDropGrid.element,"e-grid")){if((!r.isDropGrid.groupSettings.columns.length||e.target.classList.contains("e-selectionbackground"))&&!r.isDropGrid.element.querySelector(".e-emptyrow"))if(O(s,"e-grid")&&O(s,"e-grid").id===r.isDropGrid.element.id&&r.updateScrollPostion(e.event,s),(r.isOverflowBorder||r.parent.frozenRows>r.dragTarget)&&(parseInt(r.startedRow.getAttribute("aria-rowindex"),10)!==r.dragTarget||r.istargetGrid)||r.istargetGrid&&l&&r.isDropGrid.getRowByIndex(r.isDropGrid.getCurrentViewRecords().length-1).getAttribute("data-uid")===l.getAttribute("data-uid"))r.moveDragRows(e,r.startedRow,l);else{var d=void 0;if(r.parent.enableVirtualization)d=l&&parseInt(l.getAttribute("aria-rowindex"),10)===r.parent.renderModule.data.dataManager.dataSource.json.length-1;else{var p=r.parent.getRowByIndex(r.parent.getCurrentViewRecords().length-1).getAttribute("data-uid");d=l&&p===l.getAttribute("data-uid")&&p!==r.startedRow.getAttribute("data-uid")}if(d&&!r.parent.rowDropSettings.targetID){var c=r.parent.createElement("div",{className:"e-lastrow-dragborder"}),u=r.parent.getContent();c.style.width=r.parent.element.offsetWidth-r.getScrollWidth()+"px",u.querySelectorAll(".e-lastrow-dragborder").length||(u.classList.add("e-grid-relative"),u.appendChild(c),c.style.bottom=r.getScrollWidth()+"px")}r.removeBorder(l)}if(s&&s.classList.contains("e-content")&&!r.isDropGrid.element.querySelector(".e-emptyrow")&&r.istargetGrid){r.removeBorder(l);var g=r.isDropGrid.getCurrentViewRecords().length-1,f=".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse",m=[];m=[].slice.call(r.isDropGrid.getRowByIndex(g).querySelectorAll(f)),r.isDropGrid.isFrozenGrid()&&(m=r.borderRowElement(g,f)),m.length>0&&$(m,!0,"e-dragborder")}}}}},this.dragStop=function(e){J(r.parent)?r.parent.notify(Zt,{instance:r,handler:r.processDragStop,arg1:e}):r.processDragStop(e)},this.processDragStop=function(e){var n=r.parent;if(!r.parent.isDestroyed){var o=r.getElementFromPosition(e.helper,e.event),s=o&&!o.classList.contains("e-dlg-overlay")?o:e.target;r.parent.element.querySelector(".e-cloneproperties");n.element.classList.remove("e-rowdrag");var l=document.getElementById(n.rowDropSettings.targetID);if(n.rowDropSettings.targetID&&l&&l.ej2_instances&&"grid"===l.ej2_instances[0].getModuleName()&&l.ej2_instances[0].getContent().classList.remove("e-allowRowDrop"),O(r.isDropGrid.element,"e-grid")){r.stopTimer(),r.isDropGrid.enableHover=r.hoverState,r.isDropGrid.getContent().classList.remove("e-grid-relative"),r.removeBorder(o);var a=r.isDropGrid.element.querySelector(".e-dragstartrow");a&&a.classList.remove("e-dragstartrow")}if(r.processArgs(s),r.parent.enableVirtualization&&t.isNullOrUndefined(r.rows[0]))return r.dragTarget=null,void t.remove(e.helper);var h={target:t.isBlazor()?null:s,draggableType:"rows",cancel:!1,fromIndex:parseInt(r.rows[0].getAttribute("aria-rowindex"),10),dropIndex:r.dragTarget,rows:t.isBlazor()?null:r.rows,data:Object.keys(r.dragStartData[0]).length>0?r.dragStartData:r.currentViewData()};n.trigger(zt,h,function(){if(!(O(s,"e-row")||O(s,"e-emptyrow")||O(s,"e-gridcontent"))||h.cancel)return r.dragTarget=null,void t.remove(e.helper);r.isRefresh=!1;var o=r.parent.getSelectedRowIndexes();if(n.isRowDragable()){if(t.isBlazor()){var l=r.parent.getSelectedRecords().length?r.parent.getSelectedRecords():r.currentViewData(),a={addedRecords:[],deletedRecords:l,changedRecords:[]},d=r.dragTarget?r.dragTarget:h.dropIndex,p=new i.Query;p.dragDropDestinationIndex=d,r.saveChange(a,p),a.deletedRecords=[],a.addedRecords=l,r.saveChange(a,p)}else!r.parent.rowDropSettings.targetID&&r.startedRow.querySelector("td.e-selectionbackground")&&o.length>1&&o.length!==r.parent.getCurrentViewRecords().length?r.reorderRows(o,h.dropIndex):r.reorderRows([parseInt(r.startedRow.getAttribute("aria-rowindex"),10)],r.dragTarget);r.dragTarget=null,n.rowDropSettings.targetID||(t.remove(e.helper),n.frozenRows&&n.enableVirtualization?n.refresh():r.rowOrder(h))}r.isRefresh=!0})}},this.removeCell=function(e,t){return[].slice.call(e.querySelectorAll("td")).filter(function(i){i.classList.contains(t)&&e.deleteCell(i.cellIndex)})},this.parent=e,this.parent.isDestroyed||(this.parent.on(Tt,this.initializeDrag,this),this.parent.on(St,this.columnDrop,this),this.onDataBoundFn=this.onDataBound.bind(this),this.parent.addEventListener(Ct,this.onDataBoundFn),this.parent.on(Dt,this.enableAfterRender,this))}return e.prototype.refreshRow=function(e,t,i,r,n,o,s){var l,a,h,d,p=this.parent,c=p.isFrozenGrid(),u="Left-Right"===p.getFrozenMode(),g=p.getContentTable().querySelector("tbody"),f=p.getHeaderTable().querySelector("tbody");c&&(l=p.getMovableHeaderTbody(),a=p.getMovableContentTbody(),u&&(h=p.getFrozenRightHeaderTbody(),d=p.getFrozenRightContentTbody()));for(var m="Left-Right"===p.getFrozenMode()?3:2,y=0,v=e.rows.length;y0){this.parent.selectRows(this.selectedRowColls);var o=[];if(this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length){for(var r=0,n=e.rows.length;rp&&(l=p+1);break}}this.reorderRow(a-s,l-s)}this.isRefresh&&this.parent.notify(Bt,{type:yt,requestType:"rowdraganddrop"});for(var h=0,d=r.length;h=r){var l=-this.isDropGrid.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){i.setScrollDown(s,l,!0)},200)}else if(n.top+this.isDropGrid.getContent().clientHeight-o-33<=r){var a=this.isDropGrid.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){i.setScrollDown(s,a,!0)},200)}},e.prototype.setScrollDown=function(e,t,i){e.scrollTop=e.scrollTop+t},e.prototype.moveDragRows=function(e,i,r){var n=this.parent.element.querySelector(".e-cloneproperties"),o=t.closest(e.target,"tr");if(O(o,"e-grid")&&(O(n.parentElement,"e-grid").id===O(o,"e-grid").id||this.istargetGrid)){var s=o||this.startedRow;this.setBorder(s,e.event,i,r)}},e.prototype.setBorder=function(e,i,r,n){var o=this.parent.element;this.istargetGrid&&(o=this.isDropGrid.element);var s=this.parent.element.querySelector(".e-cloneproperties");if(this.removeFirstRowBorder(e),this.removeLastRowBorder(e),O(e,"e-grid")&&!this.parent.rowDropSettings.targetID&&e.classList.contains("e-row")&&O(s.parentElement,"e-grid").id===O(e,"e-grid").id||this.istargetGrid){t.removeClass(o.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragborder"]);var l=[],a=parseInt(n.getAttribute("aria-rowindex"),10);if(n&&0===a){var h=this.parent.createElement("div",{className:"e-firstrow-dragborder"}),d=this.isDropGrid.getHeaderContent();d.classList.add("e-grid-relative"),h.style.width=o.offsetWidth-this.getScrollWidth()+"px",d.querySelectorAll(".e-firstrow-dragborder").length||d.appendChild(h)}else this.parent.rowDropSettings.targetID&&n?(e=this.isDropGrid.getRowByIndex(a-1),l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):n&&parseInt(r.getAttribute("aria-rowindex"),10)>a?(e=this.parent.getRowByIndex(a-1),l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):l=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"));var p=this.parent.isFrozenGrid();if(n&&0!==a&&p){var c=parseInt(e.getAttribute("aria-rowindex"),10);l=this.borderRowElement(c,".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")}l.length>0&&$(l,!0,"e-dragborder")}},e.prototype.borderRowElement=function(e,t){var i=[];return i=[].slice.call(this.isDropGrid.getRowByIndex(e).querySelectorAll(t)).concat([].slice.call(this.isDropGrid.getMovableRowByIndex(e).querySelectorAll(t))),"Left-Right"===this.isDropGrid.getFrozenMode()&&(i=i.concat([].slice.call(this.isDropGrid.getFrozenRightRowByIndex(e).querySelectorAll(t)))),i},e.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?Rr.getScrollBarWidth():0},e.prototype.removeFirstRowBorder=function(e){this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder").length>0&&e&&0!==e.rowIndex&&t.remove(this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder")[0])},e.prototype.removeLastRowBorder=function(e){var i;i=this.parent.enableVirtualization?e&&parseInt(e.getAttribute("aria-rowindex"),10)!==this.parent.renderModule.data.dataManager.dataSource.json.length-1:e&&this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1).getAttribute("data-uid")!==e.getAttribute("data-uid"),this.parent.element.getElementsByClassName("e-lastrow-dragborder").length>0&&e&&i&&t.remove(this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0])},e.prototype.removeBorder=function(e){if(this.removeFirstRowBorder(e),this.parent.rowDropSettings.targetID||this.removeLastRowBorder(e),e=(this.isDropGrid.isFrozenGrid()?this.isDropGrid.getMovableRows():this.isDropGrid.getRows()).filter(function(e){return e.querySelector("td.e-dragborder")})[0]){var t=[].slice.call(e.querySelectorAll(".e-dragborder"));if(this.parent.isFrozenGrid()){var i=parseInt(e.getAttribute("aria-rowindex"),10);t=this.borderRowElement(i,".e-dragborder")}$(t,!1,"e-dragborder")}},e.prototype.getElementFromPosition=function(e,t){var i,r=P(t);return e.style.display="none",i=document.elementFromPoint(r.x,r.y),e.style.display="",i},e.prototype.onDataBound=function(e){this.selectedRowColls.length>0&&(this.parent.selectRows(this.selectedRowColls),this.selectedRowColls=[])},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("aria-rowindex"),10):0},e.prototype.singleRowDrop=function(e){var i,r,n=t.closest(e.target,"tr");r=e.droppedElement.parentElement.ej2_instances[0],i=n?n.rowIndex:r.currentViewData.length-1,this.reorderRow(this.startedRowIndex,i)},e.prototype.columnDrop=function(e){var r=this.parent;e.droppedElement.parentElement.ej2_instances[0];if("grouping"!==e.droppedElement.getAttribute("action")&&(O(e.target,"e-row")||O(e.target,"e-emptyrow")||O(e.target,"e-gridcontent"))){var n,o=t.closest(e.target,"tr"),s=void 0;if("true"!==e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id===r.element.id||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id!==r.element.id)return;if(e.droppedElement.parentElement.id!==r.element.id)n=e.droppedElement.parentElement.ej2_instances[0];else if(this.isSingleRowDragDrop||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow"))return void this.singleRowDrop(e);if(n.element.id!==r.element.id&&n.rowDropSettings.targetID!==r.element.id)return;var l=n.getSelectedRecords(),a=s=this.getTargetIdx(o);if(isNaN(a)&&(a=s=0),r.allowPaging&&(a=a+r.pageSettings.currentPage*r.pageSettings.pageSize-r.pageSettings.pageSize),t.isBlazor()){for(var h=[],d=n.getSelectedRowIndexes(),p=0;p0&&!1===this.startedRow.cells[0].classList.contains("e-selectionbackground")||0===t.getSelectedRecords().length)this.rows=[this.parent.getRowByIndex(i)],t.isFrozenGrid()&&(this.rows=[t.getRowByIndex(i),t.getMovableRowByIndex(i)],"Left-Right"===t.getFrozenMode()&&(this.rows=[t.getRowByIndex(i),t.getMovableRowByIndex(i),t.getFrozenRightRowByIndex(i)])),this.rowData=[this.parent.getRowInfo(this.startedRow.querySelector(".e-rowcell")).rowData];else if(this.rows=t.getSelectedRows(),this.rowData=t.getSelectedRecords(),this.parent.enableVirtualization){this.rows=[];for(var r=t.getSelectedRowIndexes(),n=0,o=r.length;n=0;s--)if(!n[s].classList.contains("e-row")&&!n[s].classList.contains("e-detailrow")){o=n[s];break}this.expandCollapseRows(o.querySelector("altUpArrow"===e.action?".e-recordplusexpand":".e-recordpluscollapse"))}break;case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"enter":if(this.parent.isEdit||null!==t.closest(e.target,"#"+this.parent.element.id+"_searchbar"))return;var l=this.focus.getFocusedElement(),a=l?l.parentElement.querySelector('[class^="e-record"]'):null;if(!a)break;this.expandCollapseRows(a);break;case"ctrlSpace":var h=i.focusModule.currentInfo.element;if(h&&h.classList.contains("e-headercell")){var d=i.getColumnByUid(h.firstElementChild.getAttribute("e-mappinguid"));d.field&&i.groupSettings.columns.indexOf(d.field)<0?this.groupColumn(d.field):this.ungroupColumn(d.field)}}},e.prototype.clickHandler=function(e){this.expandCollapseRows(e.target),this.applySortFromTarget(e.target),this.unGroupFromTarget(e.target),this.toogleGroupFromHeader(e.target)},e.prototype.unGroupFromTarget=function(e){e.classList.contains("e-ungroupbutton")&&this.ungroupColumn(e.parentElement.getAttribute("ej-mappingname"))},e.prototype.toogleGroupFromHeader=function(e){this.groupSettings.showToggleButton&&(e.classList.contains("e-grptogglebtn")?e.classList.contains("e-toggleungroup")?this.ungroupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("e-mappinguid")).field):this.groupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("e-mappinguid")).field):e.classList.contains("e-toggleungroup")&&this.ungroupColumn(e.parentElement.getAttribute("ej-mappingname")))},e.prototype.applySortFromTarget=function(e){var i=this.parent,r=t.closest(e,".e-groupheadercell");if(i.allowSorting&&r&&!e.classList.contains("e-ungroupbutton")&&!e.classList.contains("e-toggleungroup")){var n=r.firstElementChild.getAttribute("ej-mappingname");i.getColumnHeaderByField(n).querySelectorAll(".e-ascending").length?i.sortColumn(n,"Descending",!0):i.sortColumn(n,"Ascending",!0)}},e.prototype.expandCollapseRows=function(e){var i=O(e,"e-recordplusexpand")||O(e,"e-recordpluscollapse");if(i){var r=i.cellIndex,n=i.parentElement.rowIndex,o=this.parent.getContentTable().querySelector("tbody").children,s=[].slice.call(o).slice(n+1,o.length),l=void 0,a=void 0,h=[],d=this.parent,p=i.parentElement.querySelectorAll(".e-indentcell").length,c=!1;if(t.isBlazor()&&this.parent.isCollapseStateEnabled())return void this.parent.notify("group-expand-collapse",{uid:i.parentElement.getAttribute("data-uid"),isExpand:i.classList.contains("e-recordpluscollapse")});if(i.classList.contains("e-recordpluscollapse")?(t.addClass([i],"e-recordplusexpand"),t.removeClass([i],"e-recordpluscollapse"),i.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",c=!0,pe(d)&&this.updateVirtualRows(d,e,c,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&this.parent.contentModule.captionExpand(i.parentElement)):(l=!0,t.removeClass([i],"e-recordplusexpand"),t.addClass([i],"e-recordpluscollapse"),i.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",pe(d)&&this.updateVirtualRows(d,e,!l,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&this.parent.contentModule.captionCollapse(i.parentElement)),this.aria.setExpand(i,c),!pe(d)&&!this.parent.groupSettings.enableLazyLoading){for(var u=0,g=s.length;u-1?void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:r.headerText}):J(i)?void i.notify(Zt,{instance:this,handler:this.groupColumn,arg1:e}):(r.visible=i.groupSettings.showGroupedColumn,this.colName=e,this.isAppliedGroup=!0,this.contentRefresh?this.updateModel():this.addColToGroupDrop(e),this.updateGroupDropArea(),void(this.isAppliedGroup=!1))},e.prototype.ungroupColumn=function(e){var i=this.parent,r=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(t){return t.field===e})[0]:i.getColumnByField(e);if(!(t.isNullOrUndefined(r)||!1===r.allowGrouping||this.groupSettings.columns.indexOf(e)<0)){if(J(i))return void i.notify(Zt,{instance:this,handler:this.ungroupColumn,arg1:e});if(r.visible=!0,t.isBlazor()&&i.isServerRendered){var n=[];n[0]=r,this.parent.notify("setvisibility",n)}this.colName=r.field;var o=JSON.parse(JSON.stringify(this.groupSettings.columns));if(o.splice(o.indexOf(this.colName),1),this.sortedColumns.indexOf(e)<0)for(var s=0,l=i.sortSettings.columns.length;s-1?{columnName:this.colName,requestType:"grouping",type:vt}:{requestType:"ungrouping",type:vt};this.parent.trigger(vt,t.extend(e,i)),this.colName=null},e.prototype.groupAddSortingQuery=function(e){for(var i=0;i-1?"e-toggleungroup e-icon-ungroup":"e-togglegroup e-icon-group"),attrs:{tabindex:"-1","aria-label":"Group button"}})))}},e.prototype.removeColFromGroupDrop=function(e){if(!t.isNullOrUndefined(this.getGHeaderCell(e))){var i=this.getGHeaderCell(e);if(this.groupSettings.allowReordering){var r=O(i,"e-group-animator");t.remove(r)}else t.remove(i);this.updateGroupDropArea()}this.isAppliedUnGroup=!1},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var i=0,r=Object.keys(e.properties);i-1||this.groupSettings.columns.indexOf(n[l].field)>-1)?(t.classList(i.querySelector(".e-sortfilterdiv"),["e-ascending","e-icon-ascending"],[]),n.length>1&&i.querySelector(".e-headercelldiv").appendChild(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(l+1).toString()}))):this.getGHeaderCell(n[l].field)&&this.getGHeaderCell(n[l].field).querySelectorAll(".e-groupsort").length&&("Ascending"===n[l].direction?t.classList(this.getGHeaderCell(n[l].field).querySelector(".e-groupsort"),["e-ascending","e-icon-ascending"],["e-descending","e-icon-descending"]):t.classList(this.getGHeaderCell(n[l].field).querySelector(".e-groupsort"),["e-descending","e-icon-descending"],["e-ascending","e-icon-ascending"])));for(var l=0,a=o.length;l0)for(var d=0;do.scrollHeight){t.removeClass(i.parentElement.querySelectorAll("td"),"e-lastrowcell");var F=o.querySelector("tbody").querySelectorAll(".e-detailrow").length-1;t.addClass(o.querySelector("tbody").querySelectorAll(".e-detailrow")[F].childNodes,["e-lastrowcell"]),this.lastrowcell=!0}this.aria.setExpand(i,!0)}else this.isDetailRow(p)&&(p.style.display="none",n.notify("detail-state-change",{data:d.data,childGrid:n.childGrid,detailElement:i,isExpanded:l})),t.classList(i,["e-detailrowcollapse"],["e-detailrowexpand"]),t.classList(i.firstElementChild,["e-dtdiagonalright","e-icon-grightarrow"],["e-dtdiagonaldown","e-icon-gdownarrow"]),parseInt(a.getAttribute("aria-rowindex"),10)===s&&this.lastrowcell&&(t.addClass(i.parentElement.querySelectorAll("td"),"e-lastrowcell"),this.lastrowcell=!1),d.isExpand=!1,this.aria.setExpand(i,!1)}},i.prototype.getGridModel=function(e,t,i){var r;return e.isPrinting&&t.isExpand&&e.expandedRows&&e.expandedRows[t.index]&&e.expandedRows[t.index].gridModel?(e.expandedRows[t.index].gridModel.hierarchyPrintMode=e.childGrid.hierarchyPrintMode,r=e.expandedRows[t.index].gridModel):e.isPrinting&&e.childGrid.allowPaging?(e.childGrid.allowPaging="CurrentPage"===i,r=e.childGrid):r=e.childGrid,r},i.prototype.promiseResolve=function(e){var t=this;return function(){e.off(Mt,t.promiseResolve),e.off(Ot,t.promiseResolve),e.notify(ri,{})}},i.prototype.isDetailRow=function(e){return e&&e.classList.contains("e-detailrow")},i.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.parent.off(Ht,this.clickHandler),this.parent.off(Ut,this.destroy),this.parent.off(qt,this.keyPressHandler),this.parent.off(ni,this.expand),this.parent.off(jt,this.refreshColSpan))},i.prototype.getTDfromIndex=function(e,t){var i=this.parent.getDataRows()[e];return i&&i.querySelector(t)?i.querySelector(t):null},i.prototype.expand=function(e){isNaN(e)||(e=this.getTDfromIndex(e,".e-detailrowcollapse")),e&&e.classList.contains("e-detailrowcollapse")&&this.toogleExpandcollapse(e)},i.prototype.collapse=function(e){isNaN(e)||(e=this.getTDfromIndex(e,".e-detailrowexpand")),e&&e.classList.contains("e-detailrowexpand")&&this.toogleExpandcollapse(e)},i.prototype.expandAll=function(){this.expandCollapse(!0),this.parent.trigger(vt,{requestType:"expandAllComplete",type:vt,moduleObj:this})},i.prototype.collapseAll=function(){this.expandCollapse(!1),this.parent.trigger(vt,{requestType:"collapseAllComplete",type:vt,moduleObj:this})},i.prototype.expandCollapse=function(e){for(var t,i=this.parent.getDataRows(),r=0,n=i.length;r-1&&(this.predefinedItems.responsiveBack={id:this.gridID+"_responsiveback",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resback-icon"}),this.createToolbar()},i.prototype.getToolbar=function(){return this.toolbar.element},i.prototype.destroy=function(){this.toolbar&&!this.toolbar.isDestroyed&&(this.toolbar.element?(this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.toolbar.destroy()):(this.parent.destroyTemplate(["toolbarTemplate"]),this.parent.isReact&&this.parent.renderTemplates()),this.unWireEvent(),this.removeEventListener(),t.remove(this.element))},i.prototype.bindSearchEvents=function(){this.searchElement=t.select("#"+this.gridID+"_searchbar",this.element),this.wireEvent(),this.refreshToolbarItems(),this.parent.searchSettings&&this.updateSearchBox()},i.prototype.toolbarCreated=function(e){this.element.querySelector(".e-search-wrapper")&&(!this.parent.enableAdaptiveUI||e?this.element.querySelector(".e-search-wrapper").innerHTML='':this.element.querySelector(".e-search-wrapper").innerHTML=' '),this.bindSearchEvents()},i.prototype.createToolbar=function(){var e=this.getResponsiveToolbarItems(this.getItems());this.toolbar=new a.Toolbar({items:e,clicked:this.toolbarClickHandler.bind(this),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,created:this.toolbarCreated.bind(this)}),this.toolbar.isReact=this.parent.isReact,this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this);this.toolbar.isStringTemplate=!0;var i="viewContainerRef";if(this.parent[i]&&(this.toolbar.registeredTemplate={},this.toolbar[i]=this.parent[i]),this.element=this.parent.createElement("div",{id:this.gridID+"_toolbarItems"}),this.parent.enableAdaptiveUI&&(this.toolbar.overflowMode="Popup",this.element.classList.add("e-res-toolbar")),this.parent.toolbarTemplate)if(t.isBlazor()||"string"!=typeof this.parent.toolbarTemplate)if(t.isBlazor()){var r=this.parent.element.id+"toolbarTemplate",n=q(this.element,R(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",r)),o=this.getItem(n);this.toolbar.items.push(o),this.toolbar.appendTo(this.element),t.updateBlazorTemplate(this.parent.element.id+"toolbarTemplate","ToolbarTemplate",this.parent)}else{var s=this.parent.isReact&&"string"!=typeof this.parent.toolbarTemplate,l=this.parent.element.id+"toolbarTemplate";s?(R(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",l,null,null,this.element),this.parent.renderTemplates()):q(this.element,R(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate"))}else this.toolbar.appendTo(this.parent.toolbarTemplate),this.element=this.toolbar.element;else this.toolbar.appendTo(this.element);this.parent.element.insertBefore(this.element,this.parent.getHeaderContent())},i.prototype.addReactToolbarPortals=function(e){this.parent.isReact&&e&&(this.parent.portals=this.parent.portals.concat(e),this.parent.renderTemplates())},i.prototype.renderResponsiveSearch=function(i){if(i)this.toolbarCreated(!0),this.refreshResponsiveToolbarItems(e.ResponsiveToolbarAction.isSearch),this.searchElement=t.select("#"+this.gridID+"_searchbar",this.element),(r=O(this.searchElement,"e-toolbar-right")).classList.add("e-responsive-right"),this.parent.searchSettings&&this.updateSearchBox(),this.searchBoxObj.searchFocus({target:this.searchElement}),this.searchElement.focus();else{var r=O(this.searchElement,"e-toolbar-right");r.classList.remove("e-responsive-right"),this.refreshResponsiveToolbarItems(e.ResponsiveToolbarAction.isInitial),this.toolbarCreated(!1),this.unWireEvent(),this.searchElement=void 0}},i.prototype.getResponsiveToolbarItems=function(e){if(this.parent.enableAdaptiveUI)for(var t=0;t-1?h.classList.remove("e-hidden"):h.classList.add("e-hidden")}}return i},i.prototype.refreshToolbarItems=function(e){var t=this.parent,i=[],r=[],n=t.editSettings,o=t.currentViewData&&t.currentViewData.length;n.allowAdding?i.push(this.gridID+"_add"):r.push(this.gridID+"_add"),n.allowEditing&&o?i.push(this.gridID+"_edit"):r.push(this.gridID+"_edit"),n.allowDeleting&&o?i.push(this.gridID+"_delete"):r.push(this.gridID+"_delete"),"Batch"===t.editSettings.mode?t.element.querySelectorAll(".e-updatedtd").length&&(n.allowAdding||n.allowEditing)?(i.push(this.gridID+"_update"),i.push(this.gridID+"_cancel")):(r.push(this.gridID+"_update"),r.push(this.gridID+"_cancel")):t.isEdit&&(n.allowAdding||n.allowEditing)?(i=[this.gridID+"_update",this.gridID+"_cancel"],r=[this.gridID+"_add",this.gridID+"_edit",this.gridID+"_delete"]):(r.push(this.gridID+"_update"),r.push(this.gridID+"_cancel")),this.enableItems(i,!0),this.enableItems(r,!1)},i.prototype.getItems=function(){var e=[],t=this.parent.toolbar||[];if("string"==typeof this.parent.toolbar)return[];for(var i=0,r=t;in&&(t[i].classList.remove("e-hide"),t[i].style.height=r+"px")}},r.prototype.refreshCol=function(){var e,t=e=this.parent.element.querySelector(".e-gridheader").querySelector("colgroup").cloneNode(!0);this.parent.getFrozenColumns()&&(this.parent.enableColumnVirtualization&&this.parent.contentModule.isXaxis()?e=this.parent.getMovableVirtualHeader().querySelector("colgroup").cloneNode(!0):(e=de(t,this.parent.getFrozenColumns(),this.parent),this.freezeTable.replaceChild(t,this.freezeTable.querySelector("colGroup")))),this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)},r.prototype.onWidthChange=function(e){this.getColFromIndex(e.index).style.width=t.formatUnit(e.width),this.parent.allowResizing&&"resize"===e.module&&this.updateFooterTableWidth(this.getTable())},r.prototype.onScroll=function(e){void 0===e&&(e={left:this.parent.isFrozenGrid()?this.parent.getContent().querySelector(".e-movablecontent").scrollLeft:this.parent.getContent().firstChild.scrollLeft}),this.getTable().parentElement.scrollLeft=e.left},r.prototype.getColFromIndex=function(e){var t=this.parent.getFrozenColumns();return t=t&&this.parent.isRowDragable()?t+1:t,t&&t>e?this.freezeTable.querySelector("colGroup").children[e]:this.getColGroup().children[e-t]},r.prototype.columnVisibilityChanged=function(){this.refresh()},r.prototype.addEventListener=function(){this.parent.on(kt,this.refreshCol,this),this.parent.on("column-width-changed",this.onWidthChange,this),this.parent.on("scroll",this.onScroll,this),this.parent.on(jt,this.columnVisibilityChanged,this),this.parent.on("refresh-footer-rendered",this.refreshFooterRenderer,this)},r.prototype.removeEventListener=function(){this.parent.off(kt,this.refreshCol),this.parent.off("column-width-changed",this.onWidthChange),this.parent.off("scroll",this.onScroll),this.parent.off(jt,this.columnVisibilityChanged),this.parent.off("refresh-footer-rendered",this.refreshFooterRenderer)},r.prototype.updateFooterTableWidth=function(e){var t=this.parent.getHeaderTable();t&&e&&(e.style.width=t.style.width)},r.prototype.refreshFooterRenderer=function(e){var t=this.onAggregates(e);this.refresh(t)},r.prototype.getIndexByKey=function(e,t){for(var i=this.parent.getPrimaryKeyFieldNames()[0],r=0;r-1&&(n=!0,r.push(o.changedRecords[this.getIndexByKey(s[p],o.changedRecords)])),o.deletedRecords.length&&this.getIndexByKey(s[p],o.deletedRecords)>-1?n=!0:n||r.push(s[p]);if(o.addedRecords.length)for(p=0;p=this.parent.getHeight(this.parent.height)&&l&&t.addClass([l],["e-footerpadding"]),this.locator.register("footerRenderer",this.footerRenderer);var a=function(){i.prepareSummaryInfo(),i.parent.off(Et,a)};this.parent.on(Et,a,this),this.parent.on(Et,this.footerRenderer.refresh,this.footerRenderer)},i.prototype.prepareSummaryInfo=function(){var e=this;if(Je(this.parent.aggregates,function(i){e.parent.getColumnByField(i.field);if(t.isNullOrUndefined(i.customFormat)||i.setPropertiesSilent({format:i.customFormat}),"object"==typeof i.format){var r=new ut;i.setFormatter(r.getFormatFunction(t.extend({},i.format)))}else if("string"==typeof i.format){var n=e.locator.getService("valueFormatter");i.setFormatter(n.getFormatFunction({format:i.format}))}i.setPropertiesSilent({columnName:i.columnName||i.field})}),t.isBlazor()&&this.parent.isServerRendered)for(var i=Object.keys(this.parent.bulkChanges),r=0;r0&&this.parent.notify("group-aggregates",t)},i}(),kn=function(){function e(e,t,i){var r=this;this.fromWheel=!1,this.touchMove=!1,this.options={},this.sentinelInfo={up:{check:function(e,t){var i=e.top-r.containerRect.top;return t.entered=i>=0,i+r.options.pageHeight/2>=0},axis:"Y"},down:{check:function(e,t){r.options.container.clientHeight;var i=e.bottom;return t.entered=e.bottom<=r.containerRect.bottom,i-r.options.pageHeight/2<=r.options.pageHeight/2},axis:"Y"},right:{check:function(e,t){var i=e.right;return r.movableEle?(t.entered=i0,r.movableEle?i+r.movableContainerRect.width>=r.movableContainerRect.left:i+r.containerRect.width>=r.containerRect.left},axis:"X"}},this.element=e,this.options=t,this.movableEle=i}return e.prototype.observe=function(e,i){var r=this;this.containerRect=this.options.container.getBoundingClientRect(),t.EventHandler.add(this.options.container,"wheel",function(){return r.fromWheel=!0},this),t.EventHandler.add(this.options.container,"scroll",this.virtualScrollHandler(e,i),this),this.options.movableContainer&&(this.movableContainerRect=this.options.movableContainer.getBoundingClientRect(),t.EventHandler.add(this.options.scrollbar,"wheel",function(){return r.fromWheel=!0},this),t.EventHandler.add(this.options.scrollbar,"scroll",this.virtualScrollHandler(e,i),this))},e.prototype.check=function(e){var t=this.sentinelInfo[e];return!this.movableContainerRect||"left"!==e&&"right"!==e?t.check(this.element.getBoundingClientRect(),t):t.check(this.movableEle.getBoundingClientRect(),t)},e.prototype.virtualScrollHandler=function(e,i){var r=this,n="chrome"===t.Browser.info.name?200:100,o=t.debounce(e,n),s=t.debounce(e,50);return this.options.prevTop=this.options.prevLeft=0,function(e){var t=r.options.movableContainer?r.options.container.scrollTop:e.target.scrollTop,n=r.options.movableContainer?r.options.scrollbar.scrollLeft:e.target.scrollLeft,l=r.options.prevTop=h&&r.push(s),a+ls.startIndex+Math.round(this.parent.pageSettings.pageSize/2+f)&&s.endIndex!==this.count){s.startIndex=v>=0?Math.round(v):0,s.startIndex=s.startIndex>c?Math.floor(c):s.startIndex;y=s.startIndex+this.parent.pageSettings.pageSize;s.startIndex=y=this.count?s.endIndex-this.parent.pageSettings.pageSize:s.startIndex,s.currentPage=Math.ceil(s.endIndex/this.parent.pageSettings.pageSize),this.setKeyboardNavIndex()}}else if("up"===s.direction&&s.startIndex&&s.endIndex&&cu?f:u+u/4,y=Math.round(c+m);s.endIndex=y0?v:0,s.endIndex=v<0?this.parent.pageSettings.pageSize:s.endIndex,s.currentPage=Math.ceil(s.startIndex/this.parent.pageSettings.pageSize),this.setKeyboardNavIndex()}this.preStartIndex=this.startIndex=s.startIndex,this.preEndIndex=s.endIndex,s.event=s.currentPage!==this.parent.pageSettings.currentPage?Bt:Jt}return s},n.prototype.setKeyboardNavIndex=function(){this.blazorDataLoad=!0,"downArrow"!==this.activeKey&&"upArrow"!==this.activeKey||(this.blzRowIndex="downArrow"===this.activeKey?this.rowIndex+1:this.rowIndex-1,document.activeElement.blur())},n.prototype.ensureBlocks=function(e){var t,i=this,r=e.blockIndexes[e.block],n=r,o=Math.max,s="down"===e.direction?[o(r,1),++r,++r]:[o(r-1,1),r,r+1];return this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&("X"===e.sentinelInfo.axis||"Y"===e.sentinelInfo.axis&&e.page===this.prevInfo.page)&&(s=this.prevInfo.blockIndexes),s=s.filter(function(e,t){return s.indexOf(e)===t}),this.prevInfo.blockIndexes.toString()===s.toString()?s:((e.loadSelf||"down"===e.direction&&this.isEndBlock(n))&&(s=this.vgenerator.getBlockIndexes(e.page)),s.some(function(e,r){var n=e===(pe(i.parent)?i.getGroupedTotalBlocks():i.getTotalBlocks());return n&&(t=r),n}),void 0!==t&&(s=s.slice(0,t+1),0===e.block&&1===s.length&&this.vgenerator.isBlockAvailable(s[0]-1)&&(s=[s[0]-1,s[0]])),s)},n.prototype.appendContent=function(e,i,r){var n=this,o=this.parent.isFrozenGrid(),s=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount(),l=this.parent.enableColumnVirtualization&&o;this.checkFirstBlockColIndexes(r);var a=r.virtualInfo.sentinelInfo&&"Y"===r.virtualInfo.sentinelInfo.axis&&this.currentInfo.page&&this.currentInfo.page!==r.virtualInfo.page?this.currentInfo:r.virtualInfo;this.prevInfo=this.prevInfo||r.virtualInfo;var h=a.columnIndexes[0]-1;l&&a.columnIndexes[0]===s&&(h=a.columnIndexes[0]-s-1);var d,p=this.getColumnOffset(h),c=a.blockIndexes;this.parent.groupSettings.columns.length&&this.refreshOffsets(),"100%"===this.parent.height&&(this.parent.element.style.height="100%");var u=this.parent.height.toString().indexOf("%")<0?this.content.getBoundingClientRect().height:this.parent.element.getBoundingClientRect().height;if(!this.requestTypes.some(function(e){return e===n.requestType})){var g=this.getTranslateY(this.content.scrollTop,u,a);this.virtualEle.adjustTable(l?0:p,g),l&&this.virtualEle.adjustMovableTable(p,0)}if(this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(l?0:p,0),l&&this.header.virtualEle.adjustMovableTable(p,0)),this.parent.enableColumnVirtualization){var f=a.columnIndexes;d=this.getColumnOffset(f[f.length-1])-this.getColumnOffset(f[0]-1)+"",l?this.header.virtualEle.setMovableWrapperWidth(d):this.header.virtualEle.setWrapperWidth(d)}l?this.virtualEle.setMovableWrapperWidth(d,t.Browser.isIE||"edge"===t.Browser.info.name):this.virtualEle.setWrapperWidth(d,t.Browser.isIE||"edge"===t.Browser.info.name),t.isNullOrUndefined(e.parentNode)||t.remove(e);var m;if(o?r.renderFrozenRightContent?m=this.parent.getContent().querySelector(".e-frozen-right-content").querySelector("tbody"):r.renderMovableContent?r.renderMovableContent&&(m=this.parent.getMovableVirtualContent().querySelector("tbody")):m=this.parent.getFrozenVirtualContent().querySelector("tbody"):m=this.parent.element.querySelector(".e-content").querySelector("tbody"),m&&(t.remove(m),e=null),this.parent.isReact&&!t.isNullOrUndefined(this.parent.rowTemplate)?e=i:(e=this.parent.createElement("tbody")).appendChild(i),this.parent.frozenRows&&"virtualscroll"===r.requestType&&1===this.parent.pageSettings.currentPage)for(var y=0;yr){this.vfColIndex=e.virtualInfo.columnIndexes;for(var n=0;nthis.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(s))}if(s&&this.content.querySelector(".e-editedrow")&&!Object.keys(this.virtualData).length){var a=t.extend({},this.getRowObjectByIndex(this.editedRowIndex));this.virtualData=this.getVirtualEditedData(a)}}this.restoreAdd(e)}},n.prototype.getVirtualEditedData=function(e){var t=[].slice.call(this.parent.element.querySelectorAll(".e-gridform")),i=this.parent.isFrozenGrid(),r=this.parent.editModule.getCurrentEditedData(t[0],e);return i&&("Left-Right"!==this.parent.getFrozenMode()?r=this.parent.editModule.getCurrentEditedData(t[1],e):(r=this.parent.editModule.getCurrentEditedData(t[1],e),r=this.parent.editModule.getCurrentEditedData(t[2],e))),r},n.prototype.restoreAdd=function(e){var t=this.parent.getFrozenColumns(),i=e&&this.parent.isFrozenGrid(),r=this.parent.getFrozenMode(),n=e&&(t||"Left"===r||"Right"===r?e.renderMovableContent:e.renderFrozenRightContent);if((!i||i&&n)&&this.isNormaledit&&this.isAdd&&!this.parent.element.querySelector(".e-addedrow")){var o="Top"===this.parent.editSettings.newRowPosition&&this.content.scrollTopthis.content.clientHeight?r:0,this.virtualEle.setVirtualHeight(r,i)}else{var n=t.isBlazor()&&this.parent.isServerRendered&&this.parent.groupSettings.columns.length&&e?e:this.offsets[pe(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks()];this.virtualEle.setVirtualHeight(n,i)}this.parent.enableColumnVirtualization&&(this.header.virtualEle.setVirtualHeight(1,i),this.parent.isFrozenGrid()&&(this.virtualEle.setMovableVirtualHeight(1,i),this.header.virtualEle.setMovableVirtualHeight(1,i)))},n.prototype.getPageFromTop=function(e,t){var i=this,r=pe(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks(),n=0;this.offsets[r],this.prevHeight;return this.offsetKeys.some(function(o){var s=Number(o),l=e<=i.offsets[o]||s===r&&e>i.offsets[o];return l&&(i.offsetKeys.length%2!=0&&s.toString()===i.offsetKeys[i.offsetKeys.length-2]&&e<=i.offsets[i.offsetKeys.length-1]&&(s+=1),t.block=s%2==0?1:0,n=Math.max(1,Math.min(i.vgenerator.getPage(s),i.maxPage))),l}),n},n.prototype.getTranslateY=function(e,t,i,r){void 0===i&&((i={page:this.getPageFromTop(e,{})}).blockIndexes=this.vgenerator.getBlockIndexes(i.page));var n=(i.blockIndexes[0]||1)-1,o=this.getOffset(n),s=this.getOffset(i.blockIndexes[i.blockIndexes.length-1]);r&&(i=this.prevInfo);var l=o>e?this.getOffset(n-1):sthis.offsets[h]&&(l-=l+a-this.offsets[h]),l},n.prototype.getOffset=function(e){return Math.min(0|this.offsets[e],0|this.offsets[this.maxBlock])},n.prototype.onEntered=function(){var e=this;return function(i,r,n,o,s,l){t.Browser.isIE&&!s&&l&&!e.preventEvent&&e.parent.showSpinner();var a=e.parent.enableColumnVirtualization&&e.parent.isFrozenGrid(),h="X"===r.axis,d=e.prevInfo.offsets?e.prevInfo.offsets.top:null,p=e.content.getBoundingClientRect().height,c=e.getColumnOffset(h?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1),u=e.getTranslateY(o.top,p,h&&d===o.top?e.prevInfo:void 0,!0);t.isBlazor()&&e.parent.isServerRendered&&e.currentInfo&&e.currentInfo.startIndex&&h&&(u=e.currentInfo.startIndex*e.parent.getRowHeight()),e.virtualEle.adjustTable(a?0:c,Math.min(u,e.offsets[e.maxBlock])),a&&e.virtualEle.adjustMovableTable(c,0),t.isBlazor()&&e.parent.isServerRendered&&h&&e.parent.notify("setcolumnstyles",{refresh:!0}),e.parent.enableColumnVirtualization&&(!t.isBlazor()||t.isBlazor()&&!e.parent.isServerRendered)&&(e.header.virtualEle.adjustTable(a?0:c,0),a&&e.header.virtualEle.adjustMovableTable(c,0))}},n.prototype.dataBound=function(){this.parent.notify("refresh-virtual-frozen-height",{}),this.isSelection&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey?this.parent.selectRow(this.selectedRowIndex):t.isBlazor()||(this.activeKey=this.empty)},n.prototype.rowSelected=function(e){if(this.isSelection&&!this.isLastBlockRow(e.rowIndex)){var t=be(this.content.firstElementChild),i=e.row.getBoundingClientRect().top,r=this.content.getBoundingClientRect().height,n=r=this.maxPage*this.parent.pageSettings.pageSize-i},n.prototype.refreshVirtualCacheOnRowDD=function(e){var t=this.getBlockSize(),i=Math.ceil((e.objIndex+1)/t),r=e.objIndex-e.startIndex>=t?t:0,n=e.objIndex-e.startIndex>=t+t?t:0;if(this.orderRowObj.push(this.vgenerator.cache[i][e.objIndex-e.startIndex-r-n]),this.parent.isFrozenGrid()&&(this.mvbOrderRowObj.push(this.vgenerator.movableCache[i][e.objIndex-e.startIndex-r-n]),"Left-Right"===this.parent.getFrozenMode()&&this.frOrderRowObj.push(this.vgenerator.frozenRightCache[i][e.objIndex-e.startIndex-r-n])),!0===e.end){var o=this.currentInfo.blockIndexes;o||(o=[1,2]),Oe(this.parent,this.orderRowObj,e.startIndex),this.parent.isFrozenGrid()&&(Oe(this.parent,this.mvbOrderRowObj,e.startIndex),"Left-Right"===this.parent.getFrozenMode()&&Oe(this.parent,this.frOrderRowObj,e.startIndex));for(var s=0;s0&&this.parent.resetFilterDlgPosition(e.columnName)},n.prototype.resetIsedit=function(){this.parent.enableVirtualization&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&Object.keys(this.virtualData).length||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},n.prototype.scrollAfterEdit=function(){if(this.parent.editModule&&this.parent.editSettings.allowEditing&&this.isNormaledit&&this.parent.element.querySelector(".e-gridform")){var e=this.parent.element.querySelector(".e-editedrow"),i=this.parent.element.querySelector(".e-addedrow");if(e||i){var r=e?t.extend({},this.getRowObjectByIndex(this.editedRowIndex)):t.extend({},this.emptyRowData);this.virtualData=this.getVirtualEditedData(r)}}},n.prototype.createEmptyRowdata=function(){var e=this;this.parent.getColumns().filter(function(t){e.emptyRowData[t.field]=e.empty})},n.prototype.addActionBegin=function(e){if(this.isNormaledit){Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.isAdd=!0;var t=this.parent.pageSettings.currentPage;t>1&&"Top"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.onActionBegin(),e.startEdit=!1,this.content.scrollTop=0),t>1},n.prototype.getBlockHeight=function(){return this.getBlockSize()*this.parent.getRowHeight()},n.prototype.isEndBlock=function(e){var t=this.getTotalBlocks();return e>=t||e===t-1},n.prototype.getGroupedTotalBlocks=function(){var e=this.parent.vcRows;return Math.floor(e.length/this.getBlockSize()<1?1:e.length/this.getBlockSize())},n.prototype.getTotalBlocks=function(){return Math.ceil(this.count/this.getBlockSize())},n.prototype.getColumnOffset=function(e){return 0|this.vgenerator.cOffsets[e]},n.prototype.getModelGenerator=function(){return new Ln(this.parent)},n.prototype.resetScrollPosition=function(e){this.actions.some(function(t){return t===e})&&(this.preventEvent=0!==this.content.scrollTop,this.content.scrollTop=0),"virtualscroll"!==e&&(this.isAdd=!1)},n.prototype.onActionBegin=function(e){this.parent.setProperties({pageSettings:{currentPage:1}},!0)},n.prototype.getRows=function(){return this.vgenerator.getRows()},n.prototype.getRowByIndex=function(e){return pe(this.parent)?this.parent.getDataRows()[e]:this.getRowCollection(e,!1)},n.prototype.getMovableVirtualRowByIndex=function(e){return this.getRowCollection(e,!0)},n.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},n.prototype.getRowCollection=function(e,i,r,n){var o=this.prevInfo.blockIndexes,s=!t.isBlazor()||t.isBlazor()&&!this.parent.isServerRendered?(o[0]-1)*this.getBlockSize():this.startIndex,l=i?this.parent.getMovableDataRows():this.parent.getDataRows();l=n?this.parent.getFrozenRightDataRows():l;var a=(r?this.parent.getCurrentViewRecords():l)[e-s];return this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(a=r?e<=this.parent.frozenRows?this.parent.getRowsObject()[e].data:a:e<=this.parent.frozenRows?l[e]:l[e-s+this.parent.frozenRows]),a},n.prototype.getVirtualRowIndex=function(e){return(this.prevInfo.blockIndexes[0]-1)*this.getBlockSize()+e},n.prototype.refreshOffsets=function(){var e=this.parent,t=0,i=this.getBlockSize(),r=pe(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();this.prevHeight=this.offsets[r],this.maxBlock=r%2==0?r-2:r-1,this.offsets={};for(var n=Array.apply(null,Array(r)).map(function(){return++t}),o=0;o=o?(f=r,h=this.parent.getMovableRows(),u-=o):f=i:f=this.getColGroup().children,-1!==u&&s&&un.width?(this.setDisplayNone(h,u,g,l),this.parent.enableColumnVirtualization&&this.virtualEle.setWrapperWidth(v+""),this.refreshVirtualElement()):a=!0}!this.parent.invokedFromMedia&&c.hideAtMedia&&this.parent.updateMediaColumns(c),this.parent.invokedFromMedia=!1}if(t.isBlazor()&&this.parent.isServerRendered&&a){var m=this.parent.inViewIndexes,y=this.getColumnOffset(m[0]-1),v=this.getColumnOffset(m[m.length-1])-y+"";this.parent.notify("refresh-virtual-indices",{requestType:"virtualScrollRefresh",startColumnIndex:m[0],endColumnIndex:m[m.length-1],axis:"X",VTablewidth:v,translateX:y}),this.parent.notify("setcolumnstyles",{})}a||o?this.refreshContentRows({requestType:"refresh"}):this.parent.notify("partial-refresh",{rows:l,args:{isFrozen:!1,rows:l}})},n.prototype.selectVirtualRow=function(e){var i=this;if(!this.isContextMenuOpen&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey&&!this.requestTypes.some(function(e){return e===i.requestType})&&!this.parent.selectionModule.isInteracted){var r=this.parent.getRowByIndex(e.selectedIndex),n=this.parent.getRowHeight();if(!r||!this.isRowInView(r)){this.isSelection=!0,this.selectedRowIndex=e.selectedIndex;var o=(e.selectedIndex+1)*n;t.isNullOrUndefined(o)||(this.content.scrollTop=o)}}this.parent.isFrozenGrid()&&this.requestType?this.parent.getTablesCount()===this.frzIdx?(this.requestType=this.empty,this.frzIdx=1):this.frzIdx++:this.requestType=this.empty},n.prototype.isRowInView=function(e){var t=e.getBoundingClientRect().top;return t>=this.initialRowTop&&t<=this.content.offsetHeight},n}(zi),qn=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.virtualEle=new Hn,r.isMovable=!1,r.gen=new Ln(r.parent),r.parent.on(jt,r.setVisible,r),r.parent.on(Jt,function(e){return"X"===e.virtualInfo.sentinelInfo.axis?r.refreshUI():null},r),r}return Pn(i,e),i.prototype.renderTable=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector(".e-headercontent"))),t.isBlazor()&&this.parent.isServerRendered&&this.parent.notify("refresh-virtual-indices",{startColumnIndex:this.parent.contentModule.startColIndex,endColumnIndex:this.parent.contentModule.endColIndex,axis:"X"}),e.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.getPanel().querySelector(".e-headercontent"),this.virtualEle.content.style.position="relative",this.virtualEle.renderWrapper(),this.virtualEle.renderPlaceHolder("absolute")},i.prototype.appendContent=function(e){this.isMovable?(this.virtualEle.movableWrapper.appendChild(e),this.isMovable=!1):this.virtualEle.wrapper.appendChild(e)},i.prototype.refreshUI=function(){this.isMovable=this.parent.isFrozenGrid(),this.setFrozenTable(this.parent.getMovableVirtualContent()),this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector(".e-headercontent"))),e.prototype.refreshUI.call(this),this.setFrozenTable(this.parent.getFrozenVirtualContent())},i.prototype.setVisible=function(e){var i,r,n,o,s,l=this.parent,a=this.parent.getFrozenColumns();a&&(o=[].slice.call(this.parent.getFrozenVirtualHeader().querySelectorAll("col")),s=[].slice.call(this.parent.getMovableVirtualHeader().querySelectorAll("col")));for(var h=0,d=e.length;h=a?(c=s,r-=a):c=o:c=this.getColGroup().children,t.setStyleAttribute(c[r],{display:i}),l.enableColumnVirtualization&&!l.groupSettings.columns.length){var u=void 0;(u=p.visible?this.virtualEle.wrapper.offsetWidth+parseInt(p.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(p.width.toString(),10))>l.width?(this.setDisplayNone(p,i),this.virtualEle.setWrapperWidth(u+""),this.gen.refreshColOffsets()):n=!0}else n=!0;n&&!a&&this.refreshUI()}a&&this.parent.notify(Vt,{})},i.prototype.setFrozenTable=function(e){this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.parent.contentModule.isXaxis()&&this.parent.contentModule.setTable(e.querySelector(".e-table"))},i.prototype.setDisplayNone=function(e,i){var r=this.parent.isFrozenGrid(),n=this.getTable();r&&"movable"===e.getFreezeTableName()&&(n=this.parent.getMovableVirtualHeader().querySelector(".e-table"));for(var o=0,s=[].slice.apply(n.querySelectorAll("th.e-headercell"));om.offsetHeight)m.style.height=y.offsetHeight+"px",o&&((v=n.querySelector("tr").children[0]).style.height=y.offsetHeight+"px");else if(y.style.height=m.offsetHeight+"px",o){var v=n.querySelector("tr").children[0];v.style.height=m.offsetHeight+"px"}}},i.prototype.focusElement=function(e,i){var r=this.parent.element.querySelector(".e-edit-checkselect");t.isNullOrUndefined(r)||r.nextElementSibling.classList.add("e-focus"),"Batch"===this.parent.editSettings.mode?this.focus.onClick({target:t.closest(e,"td")},!0):!this.parent.enableVirtualization||"Normal"!==this.parent.editSettings.mode||this.parent.enableVirtualization&&"Bottom"===this.parent.editSettings.newRowPosition&&O(e,"e-addedrow")?e.focus():e.focus({preventScroll:!0}),e.classList.contains("e-defaultcell")&&e.setSelectionRange(e.value.length,e.value.length)},i.prototype.getEditElements=function(i){var r=this,n=this.parent,o={},s="Batch"!==n.editSettings.mode?n.getColumns():[n.getColumnByField(i.columnName)];if(this.parent.editSettings.template)return{};for(var l=0,a=s.length;l-1?this.rowIndex:this.editRowIndex:this.parent.selectRow(this.rowIndex>-1?this.rowIndex:this.editRowIndex)),this.parent.hideSpinner()},e.prototype.closeForm=function(){!this.cloneRow&&this.parent.isEdit&&this.stopEditStatus(),this.cloneRow&&(this.cloneRow.remove(),this.cloneRow=null,this.originalRow.classList.remove("e-hiddenrow")),this.parent.isFrozenGrid()&&this.cloneFrozen&&(this.cloneFrozen.remove(),this.frozen.classList.remove("e-hiddenrow"))},e.prototype.blazorTemplate=function(){var e=this.parent.getColumns();this.parent.editSettings.template&&"Normal"===this.parent.editSettings.mode&&t.updateBlazorTemplate(this.parent.element.id+"editSettingsTemplate","Template",this.parent.editSettings);for(var i=0;i1){var l=this.parent.getSelectedRows()[0].getAttribute("data-uid");s.data=[this.parent.getRowObjectFromUID(l).data]}t.isBlazor()&&!this.parent.isJsComponent&&(s.data=s.data[0]),this.parent.notify(Bt,s)},e.prototype.stopEditStatus=function(){for(var e=this.parent,i=[].slice.call(e.element.querySelectorAll(".e-addedrow")),r=[].slice.call(e.element.querySelectorAll(".e-editedrow")),n=0;n-1)&&(e.cancel=!0,e.byClick?e.clickArgs.preventDefault():e.keyArgs.preventDefault())},r.prototype.onCellFocused=function(e){var t=this.parent.getFrozenLeftCount(),i=this.parent.getFrozenRightColumnsCount(),r=this.parent.getContent().querySelector(".e-movablecontent"),n=this.parent.getHeaderContent().querySelector(".e-movableheader"),o=!(e.container.isContent&&e.container.isDataCell||this.parent.frozenRows&&e.container.isHeader);if(!e.byKey||o)return void(this.parent.isEdit&&o&&this.saveCell());var s=e.container.indexes,l=s[0],a=s[1];if(t&&(r.contains(e.element)||this.parent.frozenRows&&n.contains(e.element))&&(a+=t),i){var h=this.parent.getHeaderContent().querySelector(".e-frozen-right-header");(this.parent.getContent().querySelector(".e-frozen-right-content").contains(e.element)||this.parent.frozenRows&&h.contains(e.element))&&(a+=t+this.parent.getMovableColumnsCount())}this.parent.frozenRows&&e.container.isContent&&(l+=this.parent.frozenRows);var d=this.parent.isEdit;if(!this.parent.element.querySelectorAll(".e-popup-open").length)switch(d=d&&!this.validateFormObj(),e.keyArgs.action){case"tab":case"shiftTab":var p=this.parent.getColumns()[e.indexes[1]];p&&!this.parent.isEdit&&this.editCell(e.indexes[0],p.field),(d||this.parent.isLastCellPrimaryKey)&&this.editCellFromIndex(l,a);break;case"enter":case"shiftEnter":e.keyArgs.preventDefault();var c={cancel:!1,keyArgs:e.keyArgs};this.parent.notify("beforeFocusCellEdit",c),!c.cancel&&d&&this.editCell(l,this.cellDetails.column.field);break;case"f2":this.editCellFromIndex(l,a),this.focus.focus()}},r.prototype.isAddRow=function(e){return this.parent.getDataRows()[e].classList.contains("e-insertedrow")},r.prototype.editCellFromIndex=function(e,t){this.cellDetails.rowIndex=e,this.cellDetails.cellIndex=t,this.editCell(e,this.parent.getColumns()[t].field,this.isAddRow(e))},r.prototype.closeEdit=function(){var e=this,i=this.parent,r=this.parent.getRowsObject(),n={cancel:!1,batchChanges:this.getBatchChanges()};if(i.notify("before-batch-cancel",n),!n.cancel){var o=this.parent.getColumns();if(t.isBlazor())for(d=0;d0)){var l=[];l.type="cancel",this.parent.notify("refresh-footer-rendered",l),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",l)}}return o},r.prototype.removeHideAndSelection=function(e){if(e.classList.contains("e-hiddenrow")){e.removeAttribute("aria-selected");for(var i=[].slice.call(e.querySelectorAll(".e-selectionbackground")),r=0;r0&&(this.parent.notify("refresh-footer-rendered",{}),this.parent.groupSettings.columns.length>0&&this.parent.notify("group-aggregates",{}))},r.prototype.addRecord=function(e){this.bulkAddRow(e)},r.prototype.endEdit=function(e){this.parent.isEdit&&this.validateFormObj()||this.batchSave()},r.prototype.closeForm=function(){for(var e=0;ei.currentViewData.length&&t.removeClass([r],["e-checkbox-disabled"])}var n=this.parent.getColumns();if(t.isBlazor())for(var o=0;o=n.frozenRows&&(n.getMovableHeaderTbody().appendChild(n.getMovableRowByIndex(n.frozenRows-1)),n.getFrozenHeaderTbody().appendChild(n.getRowByIndex(n.frozenRows-1)),"Left-Right"===n.getFrozenMode()&&n.getFrozenRightHeaderTbody().appendChild(n.getFrozenRightRowByIndex(n.frozenRows-1))),n.frozenRows&&o=n.frozenRows&&n.getHeaderTable().querySelector("tbody").appendChild(n.getRowByIndex(n.frozenRows-1))),delete s[l]}}else if(r.parent.isFrozenGrid()||1!==s.length&&!i)for(var l=0;l0&&(i||m.addedRecords.length)&&r.parent.notify("refresh-footer-rendered",{});var v={defaultData:o.defaultData,row:c,columnObject:a,columnIndex:h,primaryKey:o.primaryKey,cell:c.cells[h]};n.trigger("batchAdd",v),n.isFrozenGrid()&&xe(s.querySelector("td:not(.e-hide)"),c.querySelector("td:not(.e-hide)")),t.isBlazor()&&(r.parent.notify(Xt,{}),r.parent.notify("start-add",{}))}})}},r.prototype.renderFrozenAddRow=function(e,i,r){var n=this.parent,o=Ve(this.parent),s=Ge(this.parent);"Top"===n.editSettings.newRowPosition?o.insertBefore(i,o.firstChild):o.appendChild(i),t.addClass(i.querySelectorAll(".e-rowcell"),["e-updatedtd"]),s&&r&&("Top"===n.editSettings.newRowPosition?s.insertBefore(r,s.firstChild):s.appendChild(r),t.addClass(r.querySelectorAll(".e-rowcell"),["e-updatedtd"]),xe(r.querySelector("td:not(.e-hide)"),e.querySelector("td:not(.e-hide)"))),"auto"===n.height&&n.notify("frozenHeight",{})},r.prototype.removeFrozenTbody=function(){var e=this.parent;if(e.isFrozenGrid()){var t=e.getContent().querySelector(".e-movablecontent").querySelector("tbody");if(t.firstElementChild.parentNode.removeChild(t.firstElementChild),"Left-Right"===e.getFrozenMode()){var i=e.getContent().querySelector(".e-frozen-right-content").querySelector("tbody");i.firstElementChild.parentNode.removeChild(i.firstElementChild)}}},r.prototype.renderMovable=function(e,t){var i=e.cloneNode(!0),r=this.parent.getMovableColumnsCount(),n=this.parent.getFrozenLeftCount(),o=this.parent.getFrozenRightColumnsCount();return qe(e,0,n),qe(i,n,o?i.children.length-o:i.children.length),qe(t,n+r,t.children.length),i},r.prototype.findNextEditableCell=function(e,i,r){for(var n,o=this.parent.getColumns(),s=o.length,l=e;l0&&(o.parent.notify("refresh-footer-rendered",{}),o.parent.groupSettings.columns.length>0&&!o.isAddRow(o.cellDetails.rowIndex)&&o.parent.notify("group-aggregates",{})),o.preventSaveCell=!1,o.editNext){if(o.editNext=!1,o.cellDetails.rowIndex===o.index&&o.cellDetails.column.field===o.field)return;var a=s.getColumnByField(o.field);a&&a.allowEditing&&o.editCellExtend(o.index,o.field,o.isAdd)}n&&s.notify("restore-Focus",{})}}},r.prototype.getDataByIndex=function(e){var t=this.parent.getRowObjectFromUID(this.parent.getDataRows()[e].getAttribute("data-uid"));return t.changes?t.changes:t.data},r.prototype.keyDownHandler=function(e){if(("tab"===e.action||"shiftTab"===e.action)&&this.parent.isEdit){var t=this.parent,i=this.getBatchChanges(),r=this.parent.getCurrentViewRecords().length+i.addedRecords.length-i.deletedRecords.length-1,n=O(e.target,"e-rowcell");if(n){var o=n.querySelector(".e-field");if(o){var s=this.parent.getVisibleColumns();s["tab"===e.action?s.length-1:0].field===o.getAttribute("id").slice(this.parent.element.id.length)&&(this.cellDetails.rowIndex===r&&"tab"===e.action?"Top"===t.editSettings.newRowPosition?(t.editSettings.newRowPosition="Bottom",this.addRecord(),t.editSettings.newRowPosition="Top"):this.addRecord():this.saveCell())}}}},r.prototype.addCancelWhilePaging=function(){this.validateFormObj()&&(this.parent.notify("destroy-form",{}),this.parent.isEdit=!1,this.isColored=!1)},r}(),eo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),to=function(e){function t(t,i,r){var n=e.call(this,t,i)||this;return n.parent=t,n.serviceLocator=i,n.renderer=r,n}return eo(t,e),t.prototype.closeEdit=function(){e.prototype.closeEdit.call(this)},t.prototype.addRecord=function(t,i){e.prototype.addRecord.call(this,t,i)},t.prototype.endEdit=function(){e.prototype.endEdit.call(this)},t.prototype.updateRow=function(t,i){e.prototype.updateRow.call(this,t,i)},t.prototype.deleteRecord=function(t,i){e.prototype.deleteRecord.call(this,t,i)},t.prototype.startEdit=function(t){e.prototype.startEdit.call(this,t)},t}(Xn),io=function(){function e(e){this.parent=e}return e.prototype.create=function(e){var t=W(e.column.field);return this.parent.createElement("input",{className:"e-field",attrs:{id:this.parent.element.id+t,name:t,type:"text","e-mappinguid":e.column.uid}})},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.write=function(e){"datepickeredit"===e.column.editType?this.obj=new l.DatePicker(t.extend(Xe(e,this.parent.editSettings.mode,this.parent.enableRtl),e.column.edit.params)):"datetimepickeredit"===e.column.editType&&(this.obj=new l.DateTimePicker(t.extend(Xe(e,this.parent.editSettings.mode,this.parent.enableRtl),e.column.edit.params))),t.isBlazor()&&(this.obj.locale=this.parent.locale),this.obj.appendTo(e.element)},e.prototype.destroy=function(){this.obj&&this.obj.destroy()},e}(),ro=function(){function e(e){this.parent=e}return e.prototype.read=function(e,t){return t},e.prototype.write=function(){},e.prototype.destroy=function(){},e}(),no=function(){function e(e,t){this.editType={Inline:$n,Normal:$n,Batch:Zn,Dialog:to},this.parent=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization"),this.addEventListener(),this.updateEditObj(),this.createAlertDlg(),this.createConfirmDlg()}return e.prototype.updateColTypeObj=function(){for(var i=this.parent.columnModel,r=0;rthis.parent.getContentTable().scrollHeight?t.addClass(e.querySelectorAll(".e-rowcell"),"e-lastrowadded"):r&&e&&e.classList&&t.addClass(e.querySelectorAll(".e-rowcell"),"e-lastrowcell")},e.prototype.closeEdit=function(){if("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&this.parent.element.querySelectorAll(".e-updatedtd").length)return void this.showDialog("CancelEdit",this.dialogObj);this.parent.element.classList.remove("e-editing"),this.editModule.closeEdit(),t.isBlazor()||(this.refreshToolbar(),this.parent.notify("close-edit",{}))},e.prototype.refreshToolbar=function(){this.parent.notify(Xt,{})},e.prototype.addRecord=function(e,i){if(this.parent.editSettings.allowAdding){var r={startEdit:!0};e||this.parent.notify("virtual-scroll-add-action-begin",r),r.startEdit&&(this.parent.element.classList.add("e-editing"),this.editModule.addRecord(e,i),t.isBlazor()||(this.refreshToolbar(),this.parent.notify("start-add",{})))}},e.prototype.deleteRecord=function(e,i){var r=this.parent;if(r.editSettings.allowDeleting)return i||r.getSelectedRecords().length||!t.isNullOrUndefined(r.commandDelIndex)?r.editSettings.showDeleteConfirmDialog?void this.showDialog("ConfirmDelete",this.dialogObj):void this.editModule.deleteRecord(e,i):void this.showDialog("DeleteOperationAlert",this.alertDObj)},e.prototype.deleteRow=function(e){this.deleteRowUid=e.getAttribute("data-uid");var i=this.parent.getRowObjectFromUID(this.deleteRowUid);t.isNullOrUndefined(i)||this.deleteRecord(null,i.data)},e.prototype.endEdit=function(){if("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&(t.isNullOrUndefined(this.formObj)||this.formObj.validate())&&(this.parent.editModule.saveCell(),this.parent.notify("editNextValCell",{}),t.isNullOrUndefined(this.formObj)||this.formObj.validate()))return void this.showDialog("BatchSaveConfirm",this.dialogObj);this.endEditing()},e.prototype.updateCell=function(e,t,i){this.editModule.updateCell(e,t,i)},e.prototype.updateRow=function(e,t){this.editModule.updateRow(e,t)},e.prototype.batchCancel=function(){this.closeEdit()},e.prototype.batchSave=function(){this.endEdit()},e.prototype.editCell=function(e,t){this.editModule.editCell(e,t)},e.prototype.editFormValidate=function(){return!!this.formObj&&this.formObj.validate()},e.prototype.getBatchChanges=function(){return this.editModule.getBatchChanges?this.editModule.getBatchChanges():{}},e.prototype.getCurrentEditCellData=function(){var e=this.getCurrentEditedData(this.formObj.element,{});return e[Object.keys(e)[0]]},e.prototype.saveCell=function(){this.editModule.saveCell()},e.prototype.endEditing=function(){this.parent.element.classList.remove("e-editing"),this.editModule.endEdit(),this.refreshToolbar()},e.prototype.showDialog=function(e,t){t.content="
"+this.l10n.getConstant(e)+"
",t.dataBind(),t.show()},e.prototype.getValueFromType=function(e,t){var i=t;switch(e.type){case"number":i=isNaN(parseFloat(t))?null:parseFloat(t);break;case"boolean":"booleanedit"!==e.editType&&(i=t===this.l10n.getConstant("True")||!0===t);break;case"date":case"datetime":"datepickeredit"!==e.editType&&"datetimepickeredit"!==e.editType&&t&&t.length?i=new Date(t):""===t&&(i=null)}return i},e.prototype.destroyToolTip=function(){for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-griderror"));e0&&(this.dialogObj.destroy(),t.remove(r)),(r=this.alertDObj.element).childElementCount>0&&(this.alertDObj.destroy(),t.remove(r)),i&&this.editModule&&this.editModule.destroy()}},e.prototype.keyPressHandler=function(e){switch(e.action){case"insert":this.addRecord();break;case"delete":"INPUT"===e.target.tagName&&!e.target.classList.contains("e-checkselect")||document.querySelector(".e-popup-open")||this.deleteRecord();break;case"f2":this.startEdit();break;case"enter":O(e.target,"e-unboundcelldiv")||"Batch"===this.parent.editSettings.mode||!(O(e.target,"e-gridcontent")||this.parent.frozenRows&&O(e.target,"e-headercontent"))||document.querySelectorAll(".e-popup-open").length||(e.preventDefault(),this.endEdit());break;case"escape":this.parent.isEdit&&("Batch"===this.parent.editSettings.mode?this.editModule.escapeCellEdit():this.closeEdit())}},e.prototype.preventBatch=function(e){this.preventObj=e,this.showDialog("BatchSaveLostChanges",this.dialogObj)},e.prototype.executeAction=function(){this.preventObj.handler.call(this.preventObj.instance,this.preventObj.arg1,this.preventObj.arg2,this.preventObj.arg3,this.preventObj.arg4,this.preventObj.arg5,this.preventObj.arg6,this.preventObj.arg7,this.preventObj.arg8)},e.prototype.applyFormValidation=function(e){var i=this.parent,r=i.isFrozenGrid(),n="Normal"===this.parent.editSettings.mode,o="Right"===this.parent.getFrozenMode()&&n?1:0,s="Dialog"!==this.parent.editSettings.mode?i.element.querySelectorAll(".e-gridform")[o]:t.select("#"+i.element.id+"_dialogEdit_wrapper .e-gridform",document),l="Right"===this.parent.getFrozenMode()&&n?0:1,a=i.element.querySelectorAll(".e-gridform")[l],h={},d={},p={};e=e||i.getColumns();for(var c=0;c(parseInt(t.closest(e,".e-row").getAttribute("aria-rowindex"),10)||0)),"Dialog"!==this.parent.editSettings.mode?i?this.parent.getHeaderTable():this.parent.getContentTable():t.select("#"+this.parent.element.id+"_dialogEdit_wrapper",document)},e.prototype.resetElemPosition=function(e,t){var i=O(t.element,"e-rowcell");if(i){var r=i.getBoundingClientRect().right,n=e.getBoundingClientRect().right;if(n>r){var o=n-r;e.style.left=e.offsetLeft-o+"px"}}},e.prototype.validationComplete=function(e){if(this.parent.isEdit){var t=this.getElemTable(e.element).querySelector("#"+e.inputName+"_Error");t&&("failure"===e.status?(t.style.display="",this.resetElemPosition(t,e)):t.style.display="none")}},e.prototype.createTooltip=function(e,i,n,o){var s=this.parent.getColumnByField(n),l="Left-Right"===this.parent.getFrozenMode()&&"Normal"===this.parent.editSettings.mode&&"frozen-right"===s.getFreezeTableName()?this.frFormObj.element:this.formObj.element,a=this.parent.getContent().firstElementChild,h=this.parent.getFrozenColumns()||this.parent.getFrozenLeftColumnsCount()||this.parent.getFrozenRightColumnsCount();h&&(a=this.parent.getMovableVirtualContent());var d,p,c=a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth,u="Dialog"!==this.parent.editSettings.mode,g=t.closest(e,".e-rowcell"),f=t.closest(e,".e-row"),m=this.parent.getContent().querySelector(".e-frozencontent"),y=!1,v=!1,C=Math.round(this.parent.getContent().clientHeight/this.parent.getRowHeight())-1,w=m?[].slice.call(this.parent.getFrozenVirtualContent().querySelectorAll(".e-row")):[].slice.call(this.parent.getContent().querySelectorAll(".e-row"));if("Batch"===this.parent.editSettings.mode&&C>1&&w.length>=C&&w[w.length-1].getAttribute("aria-rowindex")===f.getAttribute("aria-rowindex")&&(v=!0),u){if(this.parent.frozenRows){var b=h?this.parent.getFrozenVirtualHeader().querySelector("tbody").children:this.parent.getHeaderTable().querySelector("tbody").children;y=(d=b.length>(parseInt(f.getAttribute("aria-rowindex"),10)||0))&&parseInt(f.getAttribute("aria-rowindex"),10)===b.length-1}(y||C>1&&w.length>=C&&("Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType||g.classList.contains("e-lastrowcell")&&!f.classList.contains("e-addedrow"))||v)&&(p=!0)}var S=u?d?this.parent.getHeaderTable():this.parent.getContentTable():t.select("#"+this.parent.element.id+"_dialogEdit_wrapper .e-dlg-content",document),x=S.getBoundingClientRect(),R=u?this.parent.element.getBoundingClientRect().left:x.left,F=t.closest(e,"td"),z=F?F.getBoundingClientRect():e.parentElement.getBoundingClientRect(),I=this.parent.createElement("div",{className:"e-tooltip-wrap e-lib e-control e-popup e-griderror",id:n+"_Error",styles:"display:"+o+";top:"+((d?z.top+z.height:z.bottom-x.top-(h?m.scrollTop:0))+S.scrollTop+9)+"px;left:"+(z.left-R+S.scrollLeft+z.width/2)+"px;max-width:"+z.width+"px;text-align:center;"});u&&x.left=2&&(I.style.width=I.style.maxWidth),(h||this.parent.frozenRows)&&"Dialog"!==this.parent.editSettings.mode?I.style.left=F.offsetLeft+(F.offsetWidth/2-I.offsetWidth/2)+"px":I.style.left=parseInt(I.style.left,10)-I.offsetWidth/2+"px",u&&!c&&!this.parent.allowPaging||h||this.parent.frozenRows){a.style.position="static";var D=r.calculateRelativeBasedPosition(F,I);I.style.top=D.top+z.height+9+"px"}if(p){if(!c||h||"auto"===this.parent.height||this.parent.frozenRows||this.parent.enableVirtualization)I.style.bottom=z.height+9+"px";else{var O=a.scrollWidth>a.offsetWidth?j():0;I.style.bottom=this.parent.height-a.querySelector("table").offsetHeight-O+z.height+9+"px"}if(w.length-1)},e.AddEditors=function(i){e.editCellType=t.extend(e.editCellType,i)},e.editCellType={dropdownedit:Kn,numericedit:Qn,datepickeredit:io,datetimepickeredit:io,booleanedit:Wn,defaultedit:Jn,templateedit:ro},e}(),oo=function(){function e(e,i){this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.unchangedColumns=[],this.isDlgOpen=!1,this.dlghide=!1,this.initialOpenDlg=!0,this.stateChangeColumns=[],this.changedStateColumns=[],this.isInitialOpen=!1,this.isCustomizeOpenCC=!1,this.searchOperator="startswith",this.prevShowedCols=[],this.parent=e,this.serviceLocator=i,this.addEventListener(),this.cBoxTrue=n.createCheckBox(this.parent.createElement,!0,{checked:!0,label:" "}),this.cBoxFalse=n.createCheckBox(this.parent.createElement,!0,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&t.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"])}return e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector(".e-gridheader")||e.querySelector(".e-gridcontent"))&&(this.removeEventListener(),this.unWireEvents(),t.isNullOrUndefined(this.dlgObj)||!this.dlgObj.element||this.dlgObj.isDestroyed||this.dlgObj.destroy())},e.prototype.rtlUpdate=function(){this.parent.enableRtl?t.addClass(this.innerDiv.querySelectorAll(".e-checkbox-wrapper"),["e-rtl"]):t.removeClass(this.innerDiv.querySelectorAll(".e-checkbox-wrapper"),["e-rtl"])},e.prototype.addEventListener=function(){this.parent.isDestroyed||(t.EventHandler.add(document,"click",this.clickHandler,this),this.parent.on(Dt,this.enableAfterRenderEle,this),this.parent.on(Tt,this.render,this),this.parent.addEventListener(Ct,this.hideDialog.bind(this)),this.parent.on(Ut,this.destroy,this),this.parent.on("rtl-updated",this.rtlUpdate,this),this.parent.on(qt,this.keyUpHandler,this),this.parent.on("reset-columns",this.onResetColumns,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(t.EventHandler.remove(document,"click",this.clickHandler),this.parent.off(Tt,this.render),this.parent.off(Ut,this.destroy),this.parent.off(Dt,this.enableAfterRenderEle),this.parent.off("rtl-updated",this.rtlUpdate),this.parent.on(qt,this.keyUpHandler,this),this.parent.off("reset-columns",this.onResetColumns))},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderDlgContent(),this.getShowHideService=this.serviceLocator.getService("showHideService")},e.prototype.clickHandler=function(e){var i=e.target;if(!this.isCustomizeOpenCC){if(t.isNullOrUndefined(t.closest(i,".e-cc"))&&t.isNullOrUndefined(t.closest(i,".e-cc-toolbar")))t.isNullOrUndefined(this.dlgObj)||!this.dlgObj.visible||i.classList.contains("e-toolbar-items")||(this.dlgObj.hide(),this.clearActions(),this.refreshCheckboxState(),this.isDlgOpen=!1);else if(i.classList.contains("e-columnchooser-btn")||i.classList.contains("e-cc-toolbar")){if(this.initialOpenDlg&&this.dlgObj.visible||!this.isDlgOpen)return void(this.isDlgOpen=!0)}else i.classList.contains("e-cc-cancel")&&(i.parentElement.querySelector(".e-ccsearch").value="",this.columnChooserSearch(""),this.removeCancelIcon(),this.refreshCheckboxButton());(this.parent.detailTemplate||this.parent.childGrid)&&(this.targetdlg=e.target)}this.isCustomizeOpenCC&&e.target.classList.contains("e-cc-cancel")&&this.refreshCheckboxState(),this.rtlUpdate()},e.prototype.hideDialog=function(){!t.isNullOrUndefined(this.dlgObj)&&this.dlgObj.visible&&(this.dlgObj.hide(),this.isDlgOpen=!1)},e.prototype.renderColumnChooser=function(e,i,n){if(this.dlgObj.visible||!this.parent.detailTemplate&&!this.parent.childGrid||this.hideOpenedDialog(),this.dlgObj.visible)this.hideDialog(),this.addcancelIcon(),this.clearActions(),this.refreshCheckboxState();else{if(this.beforeOpenColumnChooserEvent().cancel)return;n&&(this.targetdlg=n),this.refreshCheckboxState(),this.dlgObj.dataBind(),this.dlgObj.element.style.maxHeight="430px";var o=this.dlgObj.element.style.display;this.dlgObj.element.style.display="block";var s=r.calculateRelativeBasedPosition(t.closest(n,".e-toolbar-item"),this.dlgObj.element);this.dlgObj.element.style.display=o,this.dlgObj.element.style.top=s.top+t.closest(n,".e-cc-toolbar").getBoundingClientRect().height+"px";t.isNullOrUndefined(t.closest(n,".e-bigger"))||(this.dlgObj.width=258),t.Browser.isDevice?(this.dlgObj.target=document.body,this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition(),this.dlgObj.open=this.mOpenDlg.bind(this)):this.parent.enableRtl?this.dlgObj.element.style.left=n.offsetLeft+"px":this.dlgObj.element.style.left=s.left-250+t.closest(n,".e-cc-toolbar").clientWidth+2+"px",this.removeCancelIcon(),this.dlgObj.show(),this.parent.notify("columnChooserOpened",{dialog:this.dlgObj})}this.rtlUpdate()},e.prototype.openColumnChooser=function(e,i){if(this.isCustomizeOpenCC=!0,this.dlgObj.visible)return void this.hideDialog();this.beforeOpenColumnChooserEvent().cancel||(this.isInitialOpen?this.refreshCheckboxState():(this.dlgObj.content=this.renderChooserList(),this.updateIntermediateBtn()),this.dlgObj.dataBind(),this.dlgObj.position={X:"center",Y:"center"},t.isNullOrUndefined(e)?(this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition()):(this.dlgObj.element.style.top="",this.dlgObj.element.style.left="",this.dlgObj.element.style.top=i+"px",this.dlgObj.element.style.left=e+"px"),this.dlgObj.beforeOpen=this.customDialogOpen.bind(this),this.dlgObj.show(),this.isInitialOpen=!0,this.dlgObj.beforeClose=this.customDialogClose.bind(this))},e.prototype.enableAfterRenderEle=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},e.prototype.keyUpHandler=function(e){"escape"===e.action&&this.hideDialog()},e.prototype.customDialogOpen=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");t.EventHandler.add(e,"keyup",this.columnChooserManualSearch,this)},e.prototype.customDialogClose=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");t.EventHandler.remove(e,"keyup",this.columnChooserManualSearch)},e.prototype.getColumns=function(){return this.parent.getColumns().filter(function(e){return"checkbox"!==e.type&&!0===e.showInColumnChooser||"checkbox"===e.type&&void 0!==e.field})},e.prototype.renderDlgContent=function(){this.dlgDiv=this.parent.createElement("div",{className:"e-ccdlg e-cc",id:this.parent.element.id+"_ccdlg"}),this.dlgDiv.setAttribute("aria-label",this.l10n.getConstant("ColumnChooserDialogARIA")),this.parent.element.appendChild(this.dlgDiv);this.parent.element.getBoundingClientRect().width,this.parent.enableRtl;var e=this.parent.element.querySelector(".e-ccdiv");t.isNullOrUndefined(e)||e.getBoundingClientRect().top,this.dlgObj=new r.Dialog({header:this.l10n.getConstant("ChooseColumns"),showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,target:document.getElementById(this.parent.element.id),buttons:[{click:this.confirmDlgBtnClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),isPrimary:!0,cssClass:"e-cc e-cc_okbtn"}},{click:this.clearBtnClick.bind(this),buttonModel:{cssClass:"e-flat e-cc e-cc-cnbtn",content:this.l10n.getConstant("CancelButton")}}],content:this.renderChooserList(),width:250,cssClass:"e-cc",animationSettings:{effect:"None"}});this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv),this.wireEvents()},e.prototype.renderChooserList=function(){this.mainDiv=this.parent.createElement("div",{className:"e-main-div e-cc"});var e=this.parent.createElement("div",{className:"e-cc-searchdiv e-cc e-input-group"}),t=this.parent.createElement("input",{className:"e-ccsearch e-cc e-input",attrs:{placeholder:this.l10n.getConstant("Search")}}),i=this.parent.createElement("span",{className:"e-ccsearch-icon e-icons e-cc e-input-group-icon",attrs:{title:this.l10n.getConstant("Search")}}),r=this.parent.createElement("div",{className:"e-cc-contentdiv"});this.innerDiv=this.parent.createElement("div",{className:"e-innerdiv e-cc"}),e.appendChild(t),e.appendChild(i),this.searchBoxObj=new pr(t);var n=this.refreshCheckboxList(this.parent.getColumns());return this.innerDiv.appendChild(n),r.appendChild(this.innerDiv),this.mainDiv.appendChild(e),this.mainDiv.appendChild(r),this.mainDiv},e.prototype.confirmDlgBtnClick=function(e){this.stateChangeColumns=[],this.changedStateColumns=[],this.changedColumns=this.changedColumns.length>0?this.changedColumns:this.unchangedColumns,this.changedColumnState(this.changedColumns);var i=this.ulElement.querySelector(".e-uncheck")&&this.ulElement.querySelectorAll(".e-uncheck:not(.e-selectall)").length;t.isNullOrUndefined(e)||io;o++)r.push(this.generateCell({},e.CellType.Indent));for(var s=0,l=t;s0&&(s.sheet.columns=s.columns),s.sheet.rows=s.rows,s.sheet.enableRtl=s.parent.enableRtl,s.parent.allowFiltering&&e.getVisibleColumns().length&&c&&i.enableFilter){var a={row:p,column:s.groupedColLength?s.groupedColLength+1:s.sheet.columns[0].index,lastRow:s.sheet.rows.length,lastColumn:s.sheet.columns.length};s.sheet.autoFilters=a}if(s.workSheet.push(s.sheet),s.book.worksheets=s.workSheet,s.book.styles=s.styles,e.notify("finalPageSetup",s.book),!r){if(s.isCsvExport){t.isBlazor()&&e.isServerRendered&&(s.book.isServerRendered=e.isServerRendered),c&&!t.isNullOrUndefined(i.separator)&&","!==i.separator&&(l=i.separator);u=new h.Workbook(s.book,"csv",e.locale,e.currencyCode,l);s.isBlob?s.blobPromise=u.saveAsBlob("text/csv"):c&&i.fileName?u.save(i.fileName):u.save("Export.csv")}else{var u=new h.Workbook(s.book,"xlsx",e.locale,e.currencyCode);s.isBlob?s.blobPromise=u.saveAsBlob("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):c&&i.fileName?u.save(i.fileName):u.save("Export.xlsx")}s.isElementIdChanged&&(e.element.id=""),delete e.expandedRows}return n})},r.prototype.organiseRows=function(e,t,i){if(!e.length)return t;for(var r=0;r1?m+=p.count+" items":m+=p.count+" item";var y={captionText:m,type:this.isCsvExport?"CSV":"Excel"};this.parent.trigger("exportGroupCaption",y),u.value=y.captionText,u.style=this.getCaptionThemeStyle(this.theme);var v=new xi(e).generateRows(p);if(this.fillAggregates(e,v,i.level+i.childLevels,l,this.rowLength),c.push(u),l[l.length-1].cells.length>0){for(var C=i.level+i.childLevels+v[0].cells.length,w=0,b=0,S=l[l.length-1].cells;bw&&(w=x.index),c[c.length-1].index!==x.index&&c.push(x)}for(C-u.index>1&&(u.colSpan=C-u.index);w1){var T={outlineLevel:n-1,isCollapsed:!0};l[l.length-1].grouping=T}!t.isNullOrUndefined(i.childLevels)&&i.childLevels>0?(this.processGroupedRows(e,p.items,r,p.items.level,o,s,l,a),this.processAggregates(e,p,l,void 0,n+i.childLevels,!0)):(o=this.processRecordRows(e,p.items,r,n,o,s,l,a),this.processAggregates(e,p,l,void 0,n,!0))}},r.prototype.processRecordRows=function(i,r,n,o,s,l,a,h){for(var d=1,p=[],c=n.columns,u=0,g=h.getGridRowModel(c,r,i,s);u1&&(F.colSpan=I.colSpan),t.isNullOrUndefined(I.style))F.style={name:i.element.id+"column"+(d+o)};else{var M=this.getColumnStyle(i,d+o);F.style=this.mergeOptions(this.styles[M],I.style)}p.push(F)}d++}}var D={index:this.rowLength++,cells:p};if(t.isNullOrUndefined(m)||(D.height=m),this.groupedColLength<8&&o>0?(D.grouping={outlineLevel:o,isCollapsed:!0},a.push(D)):a.push(D),!t.isNullOrUndefined(i.childGrid)){i.isPrinting=!0;var O=!t.isNullOrUndefined(l)&&l.exportType?l.exportType:"AllPages",A=this.helper.createChildGrid(i,f,O,this.gridPool),B=A.childGrid,k=A.element;B.actionFailure=h.failureHandler(this.gridPool,B,this.globalResolve),B.childGridLevel=i.childGridLevel+1;var L={childGrid:B,row:f,exportProperties:l};this.parent.trigger("exportdetaildatabound",L),B.beforeDataBound=this.childGridCell(D,B,l,f),B.appendTo(k)}i.notify("export-RowDataBound",{rowObj:f,type:"excel",excelRows:a})}return s},r.prototype.childGridCell=function(e,i,r,n){var o=this;return function(s){i.beforeDataBound=null,s.cancel=!0,0===s.result.length&&(s.result=[""]),e.childRows=o.processGridExport(i,r,s);for(var l=o.parent.groupSettings.columns.length,a=e.childRows,h=0;h0&&s){var d=new Si(e).generateRows(h,{level:h.level});d.length>0&&(r=this.fillAggregates(e,d,o,r))}else{o=e.groupSettings.columns.length>0&&!s?e.groupSettings.columns.length:o;var p=l.generateRows(h,i.aggregates,null,null,a);p.length>0&&!s&&(r=this.fillAggregates(e,p,o,r))}return r},r.prototype.fillAggregates=function(i,r,n,o,s){for(var l=0,a=r;l0){var F={outlineLevel:o[o.length-1].grouping.outlineLevel,isCollapsed:!0};R={index:this.rowLength++,cells:d,grouping:F}}else R={index:this.rowLength++,cells:d};p||o.push(R)}else o.push({index:s,cells:d})}return o},r.prototype.aggregateStyle=function(e,i,r){var n=this.parent.getColumnByField(r);if("object"==typeof e.format){var o=e.format;i.numberFormat=t.isNullOrUndefined(o.format)?o.skeleton:o.format,t.isNullOrUndefined(o.type)||(i.type=o.type.toLowerCase())}else i.numberFormat=e.format;!t.isNullOrUndefined(n)&&t.isNullOrUndefined(i.type)&&(i.type=n.type.toLowerCase())},r.prototype.getAggreateValue=function(i,r,n,o){var s={};s[t.getEnumValue(e.CellType,n.cellType)]=t.compile(r);var l,a=o.data[n.column.field?n.column.field:n.column.columnName];return this.parent.isReact||this.parent.isVue?(l=s[t.getEnumValue(e.CellType,n.cellType)](a,this.parent),this.parent.isReact&&this.parent.renderTemplates()):l=s[t.getEnumValue(e.CellType,n.cellType)](a),l[0].textContent},r.prototype.mergeOptions=function(e,t){for(var i={},r=Object.keys(e),n=0;n0)for(var h=0;h!==n;)this.columns.push({index:h+1,width:30}),h++;for(var d=0;de.rows.length?(this.rowLength+=e.footerRows-e.rows.length,i=e.rows.length):i=e.footerRows;for(var r=0;r0&&(r.name=e.element.id+"column"+n,this.styles.push(r)),t.isNullOrUndefined(i.width)||"auto"===i.width||this.columns.push({index:n+e.childGridLevel,width:"number"==typeof i.width?i.width:this.helper.getConvertedWidth(i.width)})},r.prototype.destroy=function(){},r}(),ho=function(){function r(e){this.hideColumnInclude=!1,this.currentViewData=!1,this.customDataSource=!1,this.isGrouping=!1,this.headerOnPages=[],this.drawPosition={xPosition:0,yPosition:0},this.parent=e,this.helper=new so(e),this.gridPool={}}return r.prototype.getModuleName=function(){return"PdfExport"},r.prototype.init=function(e){this.exportValueFormatter=new lo(e.locale),this.pdfDocument=void 0,this.hideColumnInclude=!1,this.currentViewData=!1,this.parent=e,this.isGrouping=!1,this.isExporting=!0,e.id=N("main-grid"),this.gridPool[e.id]=!1,this.pdfPageSettings=new d.PdfPageSettings},r.prototype.exportWithData=function(e,i,r,n,o,s,l){var a=this;this.init(e),t.isNullOrUndefined(i)?this.pdfDocument=new d.PdfDocument:this.pdfDocument=i,this.processExport(e,n,o,s).then(function(){a.isExporting=!1,e.trigger("pdfExportComplete",a.isBlob?{promise:a.blobPromise}:{}),a.parent.log("exporting_complete",a.getModuleName()),r(a.pdfDocument)}).catch(function(e){l(a.pdfDocument),a.parent.trigger("actionFailure",e)})},r.prototype.Map=function(e,r,n,o,s){var l=this;this.data=new gi(this.parent),this.isBlob=s,this.gridPool={};var a=new i.Query;e.childGrid&&(t.isNullOrUndefined(r)||"None"!==r.hierarchyExportMode)&&(e.expandedRows=fe(e).expandedRows);var h={requestType:"beforePdfExport",cancel:!1,headerPageNumbers:[],gridDrawPosition:{xPosition:0,yPosition:0},generateQuery:!1};if(!t.isBlazor()){h.gridObject=e}if(e.trigger("beforePdfExport",h),!0===h.cancel)return new Promise(function(e,t){return e()});if(y(r)&&v(r,e),h.generateQuery&&(a=so.getQuery(e,this.data)),this.headerOnPages=h.headerPageNumbers,this.drawPosition=h.gridDrawPosition,this.parent.log("exporting_begin",this.getModuleName()),!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.dataSource)&&r.dataSource instanceof i.DataManager)return new Promise(function(t,i){r.dataSource.executeQuery(a).then(function(s){l.exportWithData(e,o,t,s,r,n,i)})});if(t.isNullOrUndefined(r)||"CurrentPage"!==r.exportType){var p=[];return p.push(this.data.getData({},so.getQuery(e,this.data))),p.push(this.helper.getColumnData(e)),new Promise(function(i,s){Promise.all(p).then(function(a){l.init(e),t.isNullOrUndefined(o)?l.pdfDocument=new d.PdfDocument:l.pdfDocument=o,l.processExport(e,a[0],r,n).then(function(){l.isExporting=!1,e.trigger("pdfExportComplete",l.isBlob?{promise:l.blobPromise}:{}),l.parent.log("exporting_complete",l.getModuleName()),i(l.pdfDocument)}).catch(function(e){s(l.pdfDocument),l.parent.trigger("actionFailure",e)})})})}return new Promise(function(t,i){l.exportWithData(e,o,t,l.parent.getCurrentViewRecords(),r,n,i)})},r.prototype.processExport=function(e,i,r,n){var o,s=this,l=this.pdfDocument.sections.add();this.processSectionExportProperties(l,r);var a=l.pages.add();return new Promise(function(t,n){o=s.processGridExport(e,i,r),s.globalResolve=t,s.gridPool[e.id]=!0,s.helper.checkAndExport(s.gridPool,s.globalResolve)}).then(function(){return o.draw(a,s.drawPosition.xPosition,s.drawPosition.yPosition),s.drawHeader(r),n||(s.isBlob?s.blobPromise=s.pdfDocument.save():!t.isNullOrUndefined(r)&&r.fileName?s.pdfDocument.save(r.fileName):s.pdfDocument.save("Export.pdf"),s.pdfDocument.destroy(),delete e.expandedRows),s.pdfDocument})},r.prototype.processSectionExportProperties=function(e,i){return t.isNullOrUndefined(i)||t.isNullOrUndefined(i.pageOrientation)&&t.isNullOrUndefined(i.pageSize)||(this.pdfPageSettings.orientation="Landscape"===i.pageOrientation?d.PdfPageOrientation.Landscape:d.PdfPageOrientation.Portrait,this.pdfPageSettings.size=this.getPageSize(i.pageSize),e.setPageSettings(this.pdfPageSettings)),e},r.prototype.processGridExport=function(e,i,r){var n=!0,o=this.parent.isFrozenGrid()&&!this.parent.getFrozenColumns();t.isNullOrUndefined(r)||(this.gridTheme=r.theme,t.isBlazor()&&!t.isNullOrUndefined(this.gridTheme)&&this.getGridPdfFont(this.gridTheme),n=!!t.isNullOrUndefined(r.allowHorizontalOverflow)||r.allowHorizontalOverflow);var s=new so(e,this.helper.getForeignKeyData()),l=this.processExportProperties(r,i.result),a=y(r)?T(r.columns,e.enableColumnVirtualization):s.getGridExportColumns(o?e.getColumns():e.columns);a=a.filter(function(e){return t.isNullOrUndefined(e.commands)});var h=!1;e.groupSettings.columns.length&&(h=!0),e.childGrid&&!t.isNullOrUndefined(r)&&(e.hierarchyPrintMode=r.hierarchyExportMode||"Expanded");var p=new d.PdfGrid,c=this.getHeaderThemeStyle(),u=c.border,g=c.font,f=c.brush,m=s.getHeaders(a,this.hideColumnInclude),v=m.columns;p=this.processGridHeaders(e.groupSettings.columns.length,p,m.rows,v,u,g,f,e,n,a),this.setColumnProperties(v,p,s,e,n);var C=this.getSummaryCaptionThemeStyle();if(!t.isNullOrUndefined(l)&&l.length){if(h?(t.isNullOrUndefined(C.border)||(u=C.border),this.processGroupedRecords(p,l,v,e,u,0,C.font,C.brush,C.backgroundBrush,i,r,s,0)):this.processRecord(u,v,e,l,p,0,r,s,0),!t.isNullOrUndefined(i.aggregates)){var w=new bi(e),b=void 0,S=w.getColumns();S=S.filter(function(e){return t.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),b=this.customDataSource?w.generateRows(l,i.aggregates):this.currentViewData?w.generateRows(this.parent.getCurrentViewRecords(),i.aggregates):h?w.generateRows(l.records,i.aggregates):w.generateRows(i.result,i.aggregates,null,null,S),this.processAggregates(b,p,u,C.font,C.brush,C.backgroundBrush,!1)}}else p.rows.addRow().style.setBorder(u);return p},r.prototype.getSummaryCaptionThemeStyle=function(){if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.caption))return{font:new d.PdfStandardFont(d.PdfFontFamily.Helvetica,9.75),brush:new d.PdfSolidBrush(new d.PdfColor(0,0,0)),backgroundBrush:new d.PdfSolidBrush(new d.PdfColor(246,246,246))};var e=t.isNullOrUndefined(this.gridTheme.caption.fontSize)?9.75:this.gridTheme.caption.fontSize,i=t.isNullOrUndefined(this.gridTheme.caption.fontName)?d.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.caption.fontName),r=this.getFontStyle(this.gridTheme.caption),n=new d.PdfColor(0,0,0);if(!t.isNullOrUndefined(this.gridTheme.caption.fontColor)){var o=this.hexToRgb(this.gridTheme.caption.fontColor);n=new d.PdfColor(o.r,o.g,o.b)}var s=this.gridTheme.caption.border?this.getBorderStyle(this.gridTheme.caption.border):null,l=new d.PdfStandardFont(i,e,r);return t.isNullOrUndefined(this.gridTheme.caption.font)||(l=this.gridTheme.caption.font),{font:l,brush:new d.PdfSolidBrush(n),backgroundBrush:new d.PdfSolidBrush(new d.PdfColor(246,246,246)),border:s}},r.prototype.getGridPdfFont=function(e){var i=0;if(e.header&&e.header.font){var r=e.header.font.fontFamily,n=e.header.font.fontSize,o=e.header.font.fontStyle;if(i=t.isNullOrUndefined(d.PdfFontStyle[o])?0:d.PdfFontStyle[o],e.header.font.isTrueType)e.header.font=new d.PdfTrueTypeFont(r,n,i);else{var s=t.isNullOrUndefined(r)?d.PdfFontFamily.Helvetica:this.getFontFamily(r);e.header.font=new d.PdfStandardFont(s,n,i)}}if(e.caption&&e.caption.font){var l=e.caption.font.fontFamily,a=e.caption.font.fontSize,h=e.caption.font.fontStyle;if(i=t.isNullOrUndefined(d.PdfFontStyle[h])?0:d.PdfFontStyle[h],e.caption.font.isTrueType)e.caption.font=new d.PdfTrueTypeFont(l,a,i);else{var p=t.isNullOrUndefined(l)?d.PdfFontFamily.Helvetica:this.getFontFamily(l);e.caption.font=new d.PdfStandardFont(p,a,i)}}if(e.record&&e.record.font){var c=e.record.font.fontFamily,u=e.record.font.fontSize,g=e.record.font.fontStyle;if(i=t.isNullOrUndefined(d.PdfFontStyle[g])?0:d.PdfFontStyle[g],e.record.font.isTrueType)e.record.font=new d.PdfTrueTypeFont(c,u,i);else{var f=t.isNullOrUndefined(c)?d.PdfFontFamily.Helvetica:this.getFontFamily(c);e.record.font=new d.PdfStandardFont(f,u,i)}}},r.prototype.getHeaderThemeStyle=function(){var e=new d.PdfBorders;if(t.isNullOrUndefined(this.gridTheme)||t.isNullOrUndefined(this.gridTheme.header))return e.all=new d.PdfPen(new d.PdfColor(234,234,234)),{border:e,font:new d.PdfStandardFont(d.PdfFontFamily.Helvetica,10.5),brush:new d.PdfSolidBrush(new d.PdfColor(102,102,102))};var i=t.isNullOrUndefined(this.gridTheme.header.fontName)?d.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.header.fontName),r=this.getFontStyle(this.gridTheme.header),n=t.isNullOrUndefined(this.gridTheme.header.fontSize)?10.5:this.gridTheme.header.fontSize,o=new d.PdfColor;if(!t.isNullOrUndefined(this.gridTheme.header.fontColor)){var s=this.hexToRgb(this.gridTheme.header.fontColor);o=new d.PdfColor(s.r,s.g,s.b)}var l=new d.PdfStandardFont(i,n,r);return t.isNullOrUndefined(this.gridTheme.header.font)||(l=this.gridTheme.header.font),{border:this.getBorderStyle(this.gridTheme.header.border),font:l,brush:new d.PdfSolidBrush(o)}},r.prototype.processGroupedRecords=function(e,i,r,n,o,s,l,a,h,p,c,u,g){for(var f=this,m=s,y=this,v=0,C=i;v1?" items":" item"),type:"PDF"};y.parent.trigger("exportGroupCaption",b,function(y){v.cells.getCell(m).value=y.captionText,v.cells.getCell(m+1).style.stringFormat=new d.PdfStringFormat(d.PdfTextAlignment.Left),v.style.setBorder(o),v.style.setFont(l),v.style.setTextBrush(a),v.style.setBackgroundBrush(h);var C,w=new xi(n);if(C=t.isNullOrUndefined(s.items.records)?w.generateRows(s.items,s):w.generateRows(s.items.records,s),t.isNullOrUndefined(C)||0!==C.length||(v.cells.getCell(m+1).columnSpan=e.columns.count-(m+1)),!t.isNullOrUndefined(i.childLevels)&&i.childLevels>0)f.processAggregates(C,e,o,l,a,h,!0,v,m),f.processGroupedRecords(e,s.items,r,n,o,m+1,l,a,h,p,c,u,g),C=(b=new Si(n)).generateRows(s.items.records,s),f.processAggregates(C,e,o,l,a,h,!1);else{f.processAggregates(C,e,o,l,a,h,!0,v,m),g=f.processRecord(o,r,n,s.items,e,m+1,c,u,g);var b=new Si(n);C=b.generateRows(s.items,s);f.processAggregates(C,e,o,l,a,h,!1,null,null,!0)}})}(C[v])},r.prototype.processGridHeaders=function(i,r,n,o,s,l,a,h,d,p){var c=this,u=o.length+i,g=ve(p),f=p,m=0;this.parent.allowGrouping&&(m=this.parent.groupSettings.columns.length),r.columns.add(u),r.headers.add(n.length);var y=function(i,o,h,d,p){var u=r.headers.getHeader(i),g=u.cells.getCell(o),f=n[i].cells[o];t.isNullOrUndefined(h.headerTextAlign)||(g.style.stringFormat=c.getHorizontalAlignment(h.headerTextAlign)),d>0&&(g.rowSpan=d,g.style.stringFormat=c.getVerticalAlignment("Bottom",g.style.stringFormat,h.textAlign)),p>0&&(g.columnSpan=p),u.style.setBorder(s),u.style.setFont(l),u.style.setTextBrush(a),g.value=h.headerText,t.isNullOrUndefined(f)||f.cellType!==e.CellType.HeaderIndent&&f.cellType!==e.CellType.DetailHeader||(g.value="",g.width=20);var m={cell:g,gridCell:f,style:g.style};c.parent.trigger("pdfHeaderQueryCellInfo",m)},v=function(e,t,i,r,n,o){for(var s=0,l=0;l=6&&d&&(r.style.allowHorizontalOverflow=!0),r},r.prototype.processExportProperties=function(e,r){if(t.isNullOrUndefined(e))this.currentViewData=!1,this.customDataSource=!1;else{t.isNullOrUndefined(e.theme)||(this.gridTheme=e.theme);var n=this.pdfPageSettings.size;if(this.drawHeader(e),!t.isNullOrUndefined(e.footer)){var o=e.footer,s=new d.PointF(0,n.width-80-.75*o.fromBottom),l=new d.SizeF(n.width-80,.75*o.height),a=new d.RectangleF(s,l);this.pdfDocument.template.bottom=this.drawPageTemplate(new d.PdfPageTemplateElement(a),o)}t.isNullOrUndefined(e.includeHiddenColumn)||this.isGrouping||(this.hideColumnInclude=e.includeHiddenColumn),t.isNullOrUndefined(e.dataSource)?t.isNullOrUndefined(e.exportType)?(this.currentViewData=!1,this.customDataSource=!1):"CurrentPage"===e.exportType?(r=this.parent.currentViewData,this.currentViewData=!0,this.customDataSource=!1):(this.currentViewData=!1,this.customDataSource=!1):(e.dataSource instanceof i.DataManager||(r=e.dataSource),this.customDataSource=!0,this.currentViewData=!1)}return r},r.prototype.drawHeader=function(e){var i=this,r=this.pdfPageSettings.size;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.header)){var n=e.header,o=new d.PointF(0,n.fromTop),s=new d.SizeF(r.width-80,.75*n.height),l=new d.RectangleF(o,s);if(this.headerOnPages.length){var a=this.drawPageTemplate(new d.PdfPageTemplateElement(l),n);this.headerOnPages.filter(function(e){e-1>=0&&e-1i.format.indexOf("$current")?(a=i.format.replace("$current","0")).replace("$total","1"):(a=i.format.replace("$current","1")).replace("$total","0"),l=new d.PdfCompositeField(r,n,a,s,h);else if(-1!==i.format.indexOf("$current")&&-1===i.format.indexOf("$total"))a=i.format.replace("$current","0"),l=new d.PdfCompositeField(r,n,a,s);else{var h=new d.PdfPageCountField(r);a=i.format.replace("$total","0"),l=new d.PdfCompositeField(r,n,a,h)}var p=.75*i.position.x,c=.75*i.position.y,u=this.setContentFormat(i,l.stringFormat);null===u||t.isNullOrUndefined(u.format)||t.isNullOrUndefined(u.size)||(l.stringFormat=u.format,l.bounds=new d.RectangleF(p,c,u.size.width,u.size.height)),l.draw(e.graphics,p,c)},r.prototype.drawImage=function(e,i){var r=.75*i.position.x,n=.75*i.position.y,o=t.isNullOrUndefined(i.size)?void 0:.75*i.size.width,s=t.isNullOrUndefined(i.size)?void 0:.75*i.size.height,l=new d.PdfBitmap(i.src);t.isNullOrUndefined(o)?e.graphics.drawImage(l,r,n):e.graphics.drawImage(l,r,n,o,s)},r.prototype.drawLine=function(e,i){var r=.75*i.points.x1,n=.75*i.points.y1,o=.75*i.points.x2,s=.75*i.points.y2,l=this.getPenFromContent(i);t.isNullOrUndefined(i.style)||null===i.style||(t.isNullOrUndefined(i.style.penSize)||null===i.style.penSize||"number"!=typeof i.style.penSize||(l.width=.75*i.style.penSize),l.dashStyle=this.getDashStyle(i.style.dashStyle)),e.graphics.drawLine(l,r,n,o,s)},r.prototype.processAggregates=function(i,r,n,o,s,l,a,h,d,p){for(var c=0,u=i;c1){y+1+O.colSpan>f.cells.count&&(O.colSpan=f.cells.count-(y+1)),I.columnSpan=O.colSpan;for(var F=1;F>16&255,g:t>>8&255,b:255&t}},r.prototype.getFontStyle=function(e){var i=d.PdfFontStyle.Regular;return!t.isNullOrUndefined(e)&&e.bold&&(i|=d.PdfFontStyle.Bold),!t.isNullOrUndefined(e)&&e.italic&&(i|=d.PdfFontStyle.Italic),!t.isNullOrUndefined(e)&&e.underline&&(i|=d.PdfFontStyle.Underline),!t.isNullOrUndefined(e)&&e.strikeout&&(i|=d.PdfFontStyle.Strikeout),i},r.prototype.getBorderStyle=function(e){var i=new d.PdfBorders;if(t.isNullOrUndefined(e))i.all=new d.PdfPen(new d.PdfColor(234,234,234));else{var r=e.width,n=t.isNullOrUndefined(r)||"number"!=typeof r?void 0:.75*r,o=new d.PdfColor(196,196,196);if(!t.isNullOrUndefined(e.color)){var s=this.hexToRgb(e.color);o=new d.PdfColor(s.r,s.g,s.b)}var l=new d.PdfPen(o,n);t.isNullOrUndefined(e.dashStyle)||(l.dashStyle=this.getDashStyle(e.dashStyle)),i.all=l}return i},r.prototype.destroy=function(){},r}(),po=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),co=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.buttonElement=r.parent.createElement("button",{}),r.unbounDiv=r.parent.createElement("div",{className:"e-unboundcelldiv",styles:"display: inline-block"}),r.element=r.parent.createElement("TD",{className:"e-rowcell e-unboundcell",attrs:{role:"gridcell",tabindex:"-1"}}),r}return po(i,e),i.prototype.render=function(e,i,r){var n=this.element.cloneNode();if(n.appendChild(this.unbounDiv.cloneNode()),n.setAttribute("aria-label","is Command column column header "+e.column.headerText),e.column.commandsTemplate)if(this.parent.isReact&&"string"!=typeof e.column.commandsTemplate){var o=this.parent+"commandsTemplate";e.column.getColumnTemplate()(i,this.parent,"commandsTemplate",o,null,null,n.firstElementChild),this.parent.renderTemplates()}else q(n.firstElementChild,e.column.getColumnTemplate()(i));else for(var s=0,l=e.commands;s0){var o=this.buildDefaultItems("export");o.items=t,e.push(o)}return e},e.prototype.getLastPage=function(){var e=Math.floor(this.parent.pageSettings.totalRecordsCount/this.parent.pageSettings.pageSize);return this.parent.pageSettings.totalRecordsCount%this.parent.pageSettings.pageSize&&(e+=1),e},e.prototype.contextMenuOpen=function(){this.isOpen=!0},e.prototype.contextMenuItemClick=function(e){switch(this.getKeyFromId(e.item.id)){case"AutoFitAll":this.parent.autoFitColumns([]);break;case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Edit":this.parent.editModule&&("Batch"===this.parent.editSettings.mode?this.row&&this.cell&&!isNaN(parseInt(this.cell.getAttribute("aria-colindex"),10))&&this.parent.editModule.editCell(parseInt(this.row.getAttribute("aria-rowindex"),10),this.parent.getColumns()[parseInt(this.cell.getAttribute("aria-colindex"),10)].field):(this.parent.editModule.endEdit(),this.parent.editModule.startEdit(this.row)));break;case"Delete":this.parent.editModule&&("Batch"!==this.parent.editSettings.mode&&this.parent.editModule.endEdit(),1===this.parent.getSelectedRecords().length?this.parent.editModule.deleteRow(this.row):this.parent.deleteRecord());break;case"Save":this.parent.editModule&&this.parent.editModule.endEdit();break;case"Cancel":this.parent.editModule&&this.parent.editModule.closeEdit();break;case"Copy":this.parent.copy();break;case"PdfExport":this.parent.pdfExport();break;case"ExcelExport":this.parent.excelExport();break;case"CsvExport":this.parent.csvExport();break;case"SortAscending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"FirstPage":this.parent.goToPage(1);break;case"PrevPage":this.parent.goToPage(this.parent.pageSettings.currentPage-1);break;case"LastPage":this.parent.goToPage(this.getLastPage());break;case"NextPage":this.parent.goToPage(this.parent.pageSettings.currentPage+1)}if(e.column=this.targetColumn,e.rowInfo=this.targetRowdata,t.isBlazor()){var i=e.rowInfo.row?{element:e.element,item:e.item,event:e.event,column:this.targetColumn,rowInfo:{rowData:this.targetRowdata.rowData,rowIndex:this.targetRowdata.rowIndex,cellIndex:this.targetRowdata.cellIndex}}:this.targetColumn?{element:e.element,item:e.item,event:e.event,column:this.targetColumn}:{element:e.element,item:e.item,event:e.event};this.parent.trigger("contextMenuClick",i)}else this.parent.trigger("contextMenuClick",e)},e.prototype.contextMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof a.ContextMenu&&this.updateItemStatus(),this.parent.notify("select-row-on-context-open",{isOpen:!1})},e.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[e])},e.prototype.updateItemStatus=function(){this.contextMenu.showItems(this.hiddenItems),this.contextMenu.enableItems(this.disableItems),this.hiddenItems=[],this.disableItems=[],this.isOpen=!1},e.prototype.contextMenuBeforeOpen=function(e){var i=t.closest(e.event.target,".e-grid");if(e.event&&i&&i!==this.parent.element)e.cancel=!0;else if(e.event&&(t.closest(e.event.target,"."+go.groupHeader)||t.closest(e.event.target,"."+go.touchPop)||t.closest(e.event.target,".e-summarycell")||t.closest(e.event.target,".e-groupcaption")||t.closest(e.event.target,".e-filterbarcell")))e.cancel=!0;else{this.targetColumn=this.getColumn(e.event),this.targetRowdata=this.parent.getRowInfo(e.event.target),t.isNullOrUndefined(e.parentItem)&&this.targetColumn&&this.targetRowdata.cell&&(this.parent.notify("select-row-on-context-open",{isOpen:!0}),this.selectRow(e.event,!this.targetRowdata.cell.classList.contains("e-selectionbackground")||"Multiple"!==this.parent.selectionSettings.type));for(var r=[],n=[],o=0,s=e.items;o0&&this.contextMenu.showItems(n,!0),this.contextMenu.enableItems(this.disableItems,!1),this.contextMenu.hideItems(this.hiddenItems),r.length>0&&this.contextMenu.hideItems(r,!0),this.eventArgs=e.event,e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger("contextMenuOpen",e),(e.cancel||this.hiddenItems.length===e.items.length&&!e.parentItem)&&(this.updateItemStatus(),e.cancel=!0)}Se(this.parent.element,this.contextMenu.element.parentElement)},e.prototype.ensureTarget=function(e,i){var r=e;return(r=!this.ensureFrozenHeader(e)||i!==go.header&&i!==go.content?i===go.content||i===go.header?O(t.closest(e,".e-table"),i.substr(1,i.length)):t.closest(e,i):t.closest(e,i===go.header?"thead":"tbody"))&&O(r,"e-grid")===this.parent.element},e.prototype.ensureFrozenHeader=function(e){return!(!this.parent.isFrozenGrid()&&!this.parent.frozenRows||!t.closest(e,go.header))},e.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"AutoFitAll":case"AutoFit":t=!(this.parent.ensureModuleInjected(Rn)&&!this.parent.isEdit)||this.targetColumn&&!this.targetColumn.field&&"AutoFit"===e;break;case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(In)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)>=0||this.targetColumn&&!this.targetColumn.field)&&(t=!0);break;case"Ungroup":(!this.parent.allowGrouping||!this.parent.ensureModuleInjected(In)||this.parent.ensureModuleInjected(In)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(t=!0);break;case"Edit":case"Delete":case"Save":case"Cancel":this.parent.editModule&&0!==this.parent.getDataRows().length||(t=!0);break;case"Copy":0!==this.parent.getSelectedRowIndexes().length&&0!==this.parent.getCurrentViewRecords().length||(t=!0);break;case"export":this.parent.allowExcelExport&&this.parent.excelExport&&(this.parent.ensureModuleInjected(ho)||this.parent.ensureModuleInjected(ao))||(t=!0);break;case"PdfExport":this.parent.allowPdfExport&&this.parent.ensureModuleInjected(ho)||(t=!0);break;case"ExcelExport":case"CsvExport":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(ao)||(t=!0);break;case"SortAscending":case"SortDescending":if(!this.parent.allowSorting||!this.parent.ensureModuleInjected(en)||this.targetColumn&&!this.targetColumn.field)t=!0;else if(this.parent.ensureModuleInjected(en)&&this.parent.sortSettings.columns.length>0&&this.targetColumn)for(var i=this.parent.sortSettings.columns,r=0;r-1&&"safari"===t.Browser.info.name&&!this.parent.enableVirtualization&&this.getPanel().firstElementChild.classList.add("e-mac-safari")},i.prototype.renderFrozenRigthPanel=function(){e.prototype.renderPanel.call(this)},i.prototype.renderEmpty=function(i){t.isBlazor()&&!this.parent.isJsComponent||(e.prototype.renderEmpty.call(this,i),this.getMovableContent().querySelector("tbody").innerHTML="",t.addClass([this.getMovableContent().querySelector("tbody").querySelector("tr")],["e-emptyrow"]),this.getFrozenContent().querySelector(".e-emptyrow").querySelector("td").colSpan=this.parent.getVisibleFrozenColumns(),this.getFrozenContent().style.borderRightWidth="0px",this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector(".e-frozenheader").querySelector("tbody").innerHTML="",this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody").innerHTML=""))},i.prototype.renderFrozenRightEmpty=function(t){e.prototype.renderEmpty.call(this,t)},i.prototype.setFrozenContent=function(e){this.frozenContent=e},i.prototype.setMovableContent=function(e){this.movableContent=e},i.prototype.getFrozenContent=function(){return this.frozenContent},i.prototype.getMovableContent=function(){return this.movableContent},i.prototype.getModelGenerator=function(){return new mo(this.parent)},i.prototype.renderFrozenRightTable=function(){e.prototype.renderTable.call(this)},i.prototype.renderTable=function(){var i;null==this.getFrozenContent().querySelector(".e-table")?(e.prototype.renderTable.call(this),this.getFrozenContent().appendChild(this.getTable()),i=this.getTable().cloneNode(!0),this.getMovableContent().appendChild(i)):(this.setTable(this.getFrozenContent().querySelector(".e-table")),this.setColGroup(this.parent.element.querySelector(".e-gridheader").querySelector("colgroup").cloneNode(!0)),this.getFrozenContent().querySelector(".e-table").appendChild(this.getColGroup()),i=this.getMovableContent().querySelector(".e-table"),this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdrcont")),this.getMovableContent().querySelector("colgroup")&&t.remove(this.getMovableContent().querySelector("colgroup"));var r=this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("colgroup").cloneNode(!0);i.insertBefore(r,i.querySelector("tbody"));var n=this.parent.enableVirtualization?"":"flex";this.getPanel().firstChild.style.display=n,this.renderHorizontalScrollbar("e-frozenscrollbar e-frozen-left-scrollbar",this.getScrollbarDisplay())},i.prototype.getScrollbarDisplay=function(){var e="";return(this.parent.getFrozenColumns()&&!this.parent.getVisibleFrozenColumns()||this.parent.getFrozenLeftColumnsCount()&&!this.parent.getVisibleFrozenLeftCount())&&(e="none"),e},i.prototype.renderHorizontalScrollbar=function(e,t,i){var r=this.parent.createElement("div",{className:e,styles:"display:"+t}),n=this.parent.createElement("div",{className:"e-movablescrollbar"}),o=this.parent.createElement("div",{className:"e-movablechild"}),s=j().toString();this.setScrollbarHeight(n,s),this.setScrollbarHeight(o,s),n.appendChild(o),this.appendScrollbar(r,n,i)},i.prototype.appendScrollbar=function(e,t,i){var r=this.parent.createElement("div",{className:"e-scrollbar",styles:"display: flex"});r.appendChild(e),r.appendChild(t),this.parent.getContent().appendChild(r)},i.prototype.setScrollbarHeight=function(e,t){e.style.minHeight=t+"px",e.style.maxHeight=t+"px"},i.prototype.setIsFrozen=function(e,t){e.isFrozen=!e.isFrozen},i.prototype.setTbody=function(e,i){var r;t.isNullOrUndefined(e[0].cells[0])&&(this.getMovableContent().querySelector("tbody").innerHTML="");var n=e[0].cells[0],o=n.index;return t.isUndefined(o)&&this.parent.isRowDragable()&&(o=(n=e[0].cells[1]).index),0===o&&(this.getPanel().firstChild.style.overflowX="hidden",this.parent.enableColumnVirtualization&&(this.getMovableContent().style.overflowX="hidden")),this.parent.enableColumnVirtualization&&i.renderMovableContent&&"virtualscroll"===i.requestType&&this.getMovableContent().scrollLeft>0&&0!==i.virtualInfo.columnIndexes[0]&&(o=this.parent.getFrozenColumns()),n&&n.column&&(r=n.column.getFreezeTableName()),this.setIdx(o),r},i.prototype.splitRows=function(e){"frozen-left"===e?(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):this.movableRows=this.rows},i.prototype.renderNextFrozentPart=function(e,i){var r=this.parent.enableVirtualization;"frozen-left"===i&&(r&&(e.renderMovableContent=!0),this.refreshContentRows(t.extend({},e)))},i.prototype.appendContent=function(e,i,r,n){this.parent.isReact&&!t.isNullOrUndefined(this.parent.rowTemplate)?e=i:e.appendChild(i),"frozen-left"===n?(this.isLoaded=!1,this.getFrozenContent().querySelector("table").appendChild(e)):(this.refreshTbody(e),this.isLoaded=!0,this.getMovableContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset(),this.widthService.refreshFrozenScrollbar()),this.isInitialRender&&(this.parent.scrollModule.setHeight(),this.isInitialRender=!1)},i.prototype.refreshScrollOffset=function(){if("auto"!==this.parent.height){var e=this.getTable().offsetHeight+1;this.setHeightToContent(e)}this.parent.notify("refresh-frozen-height",{})},i.prototype.getFrozenHeader=function(e){return"frozen-left"===e?this.parent.getHeaderContent().querySelector(".e-frozenheader").querySelector("tbody"):this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody")},i.prototype.refreshTbody=function(e){e.childElementCount<1&&e.appendChild(this.parent.createElement("tr").appendChild(this.parent.createElement("td")))},i.prototype.refreshHeight=function(){this.parent.allowTextWrap||this.parent.notify(ii,{case:"refreshHeight"}),this.getFrozenContent().style.borderRightWidth="1px"},i.prototype.setIdx=function(e){this.idx=e},i.prototype.getIdx=function(){return this.idx},i.prototype.getTbody=function(e){return"frozen-left"===e?this.getTable().querySelector("tbody"):this.getMovableContent().querySelector("tbody")},i}(zi),Co=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.addEventListener(),r}return yo(i,e),i.prototype.addEventListener=function(){this.parent.on(ii,this.refreshFreeze,this),this.parent.on("frozenHeight",this.setFrozenHeight,this),this.parent.on(Dt,this.enableAfterRender,this)},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("frozenHeight",this.setFrozenHeight),this.parent.off(Dt,this.enableAfterRender))},i.prototype.renderTable=function(){t.isBlazor()?(this.setTable(this.createTable(this.getFrozenHeader().querySelector(".e-table"))),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:!0}}),this.createTable(this.getMovableHeader().querySelector(".e-table"))):e.prototype.renderTable.call(this),this.rfshMovable(),this.updateColgroup(),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.renderPanel=function(){var i=this.parent.element.querySelector(".e-frozenheader"),r=this.parent.element.querySelector(".e-movableheader");e.prototype.renderPanel.call(this),t.isNullOrUndefined(i)&&(i=this.parent.createElement("div",{className:"e-frozenheader e-frozen-left-header"}),r=this.parent.createElement("div",{className:"e-movableheader"}),this.getPanel().querySelector(".e-headercontent").appendChild(i),this.getPanel().querySelector(".e-headercontent").appendChild(r)),this.setFrozenHeader(i),this.setMovableHeader(r)},i.prototype.renderFrozenRightPanel=function(){e.prototype.renderPanel.call(this)},i.prototype.renderFrozenRightTable=function(){e.prototype.renderTable.call(this)},i.prototype.refreshUI=function(){if(t.isBlazor()&&this.parent.isServerRendered&&0!==this.parent.frozenRows)this.parent.getFrozenColumns()&&this.freezeReorder&&(e.prototype.refreshUI.call(this),this.freezeReorder=!1,e.prototype.refreshUI.call(this)),this.rfshMovable();else{var i=this.getMovableHeader().querySelector("tbody");t.remove(this.getMovableHeader().querySelector("table")),e.prototype.refreshUI.call(this),this.rfshMovable(),this.getMovableHeader().querySelector("tbody").innerHTML=i.innerHTML}t.isBlazor()&&0!==this.parent.frozenRows||this.updateColgroup(),this.parent.enableVirtualization||this.widthService.setWidthToTable(),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&X([].slice.call(this.movableHeader.querySelectorAll("tr.e-columnheader")),!0),this.parent.updateDefaultCursor(),t.isBlazor()&&0!==this.parent.frozenRows||de(this.parent.getContentTable().querySelector("colgroup"),this.parent.getFrozenColumns(),this.parent),this.widthService.refreshFrozenScrollbar(),this.initializeHeaderDrag(),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.refreshFrozenLeftUI=function(){e.prototype.refreshUI.call(this)},i.prototype.rfshMovable=function(){t.isBlazor()&&0!==this.parent.frozenRows||(this.getFrozenHeader().appendChild(this.getTable()),this.getMovableHeader().appendChild(this.createHeader(void 0,"movable"))),this.refreshStackedHdrHgt(),this.addMovableFirstCls()},i.prototype.addMovableFirstCls=function(){if(this.parent.getVisibleFrozenColumns())for(var e=this.parent.element.querySelector(".e-movableheader").querySelector("thead").querySelectorAll(".e-columnheader"),i=e.length,r=0;r1&&(r+=e[r].cells[0].rowSpan-1))}},i.prototype.refreshFreeze=function(e){if("filter"===e.case){var t=this.getTable().querySelector(".e-filterbar");if(this.parent.allowFiltering&&t&&this.getMovableHeader().querySelector("thead")){this.getMovableHeader().querySelector("thead").appendChild(this.filterRenderer(t,this.parent.getFrozenColumns()));for(var i=0,r=[].slice.call(this.getMovableHeader().querySelectorAll("thead .e-filterbarcell .e-input"));i1),this.refreshStackedHdrHgt()):"refreshHeight"===e.case&&(this.setWrapHeight(o.querySelector(".e-frozencontent").querySelectorAll("tr"),o.querySelector(".e-movablecontent").querySelectorAll("tr"),e.isModeChg),this.parent.getHeaderContent().querySelectorAll(".e-stackedheadercell").length||this.setWrapHeight(r.querySelectorAll("tr"),n.querySelectorAll("tr"),e.isModeChg))},i.prototype.enableAfterRender=function(e){"scroll"===e.module&&this.setFrozenHeight()},i.prototype.updateResizeHandler=function(){for(var e=[].slice.call(this.parent.getHeaderContent().querySelectorAll(".e-rhandler")),t=0;tl||!a&&s>l||this.parent.allowResizing&&this.parent.resizeModule&&!0===this.parent.resizeModule.isFrozenColResized)&&(i[g].style.height=s+"px");a&&"auto"!==this.parent.height&&this.setFrozenHeight()},i.prototype.setFrozenHeight=function(e){void 0===e&&(e=j());var t=this.parent.element.querySelector(".e-movablecontent").getBoundingClientRect().height,i=this.parent.element.querySelector(".e-movablecontent"),r=this.parent.element.querySelector(".e-frozencontent"),n=this.parent.getContent().scrollWidth,o=this.parent.element.querySelector(".e-movablecontent table").scrollWidth+this.parent.getContentTable().scrollWidth;i.scrollWidth-i.clientWidth?(r.style.height=t-e+"px",r.style.borderBottom=""):(r.style.height=t+"px",(r.scrollHeight<=r.clientHeight||i.scrollHeight<=i.clientHeight)&&n===o&&this.parent.scrollModule.removePadding(),r.style.borderBottom="0px")},i.prototype.refreshStackedHdrHgt=function(){for(var e,t,i=this.getFrozenHeader().querySelectorAll(".e-columnheader"),r=this.getMovableHeader().querySelectorAll(".e-columnheader"),n=0,o=i.length;n1?this.updateStackedHdrRowHgt(n,e.max,i[n],r):t.min>1&&this.updateStackedHdrRowHgt(n,t.max,r[n],i);this.parent.allowResizing&&this.updateResizeHandler()},i.prototype.getRowSpan=function(e){for(var t,i,r,n=0,o=e.childElementCount;na||!d&&C>a||this.parent.allowResizing&&this.parent.resizeModule&&!0===this.parent.resizeModule.isFrozenColResized)&&(i[y].style.height=C+"px"),s&&!t.isNullOrUndefined(s[y])&&s[y].childElementCount&&(d&&C>h||!d&&C>h||this.parent.allowResizing&&this.parent.resizeModule&&!0===this.parent.resizeModule.isFrozenColResized)&&(s[y].style.height=C+"px")}d&&this.setFrozenHeight()},i.prototype.refreshHeight=function(e){var t,i,r,n="Left-Right"===this.parent.getFrozenMode(),o=this.getFrozenRightHeader(),s=this.parent.getHeaderContent().querySelector(".e-frozenheader"),l=this.parent.getContent(),a=this.getMovableHeader(),h=this.parent.getHeaderContent().querySelector(".e-headercontent").classList,d=this.parent.textWrapSettings.wrapMode;"textwrap"===e.case?(("Header"!==d||e.isModeChg)&&(n&&(i=l.querySelector(".e-frozen-right-content").querySelectorAll("tr")),r=l.querySelector(".e-movablecontent").querySelectorAll("tr"),t=l.querySelector(".e-frozencontent").querySelectorAll("tr"),this.setWrapHeight(t,r,e.isModeChg,!0,!1,i)),"Content"===d&&this.parent.allowTextWrap?h.add("e-wrap"):h.remove("e-wrap"),"Both"===d||e.isModeChg?(n&&(i=o.querySelectorAll("tr")),t=s.querySelectorAll("tr"),r=a.querySelectorAll("tr")):(n&&(i=o.querySelector("Content"===d?"tbody":"thead").querySelectorAll("tr")),t=s.querySelector("Content"===d?"tbody":"thead").querySelectorAll("tr"),r=a.querySelector("Content"===d?"tbody":"thead").querySelectorAll("tr")),this.parent.getHeaderContent().querySelectorAll(".e-stackedheadercell").length||this.setWrapHeight(t,r,e.isModeChg,!1,this.colDepth>1,i),this.refreshStackedHdrHgt()):"refreshHeight"===e.case&&(r=l.querySelector(".e-movablecontent").querySelectorAll("tr"),t=l.querySelector(".e-frozencontent").querySelectorAll("tr"),n&&(i=l.querySelector(".e-frozen-right-content").querySelectorAll("tr")),this.setWrapHeight(t,r,e.isModeChg,!1,!1,i),this.parent.getHeaderContent().querySelectorAll(".e-stackedheadercell").length||(n&&(i=o.querySelectorAll("tr")),t=s.querySelectorAll("tr"),r=a.querySelectorAll("tr"),this.setWrapHeight(t,r,e.isModeChg,!1,!1,i)))},i.prototype.setVisible=function(e){for(var i,r,n=this.parent,o=this.parent.getFrozenLeftColumnsCount(),s=this.parent.getFrozenRightColumnsCount(),l=this.parent.getMovableColumnsCount(),a=0,h=e.length;a1&&this.updateStackedHdrRowHgt(r,e.max,t[r],i)},i.prototype.updateColgroup=function(){this.updateMovableColGroup(),this.parent.getFrozenLeftColumnsCount()&&this.updateFrozenLeftColGroup(),this.parent.getFrozenRightColumnsCount()&&this.updateFrozenRightColGroup()},i.prototype.renderRightFrozenPanelAlone=function(){var i=this.parent.element.querySelector(".e-movableheader"),r=this.parent.element.querySelector(".e-frozen-right-header");e.prototype.renderFrozenRightPanel.call(this),t.isNullOrUndefined(r)&&(i=this.parent.createElement("div",{className:"e-movableheader"}),r=this.parent.createElement("div",{className:"e-frozenheader e-frozen-right-header"}),this.getPanel().querySelector(".e-headercontent").appendChild(i),this.getPanel().querySelector(".e-headercontent").appendChild(r)),e.prototype.setMovableHeader.call(this,i),this.setFrozenRightHeader(r)},i.prototype.renderLeftWithRightFrozenPanel=function(){var i=this.parent.element.querySelector(".e-frozen-right-header");e.prototype.renderFrozenRightPanel.call(this),t.isNullOrUndefined(i)&&(i=this.parent.createElement("div",{className:"e-frozenheader e-frozen-right-header"}),this.getPanel().querySelector(".e-headercontent").appendChild(i)),this.setFrozenRightHeader(i)},i.prototype.renderFrozenRightTableAlone=function(){e.prototype.renderFrozenRightTable.call(this),this.rfshMovable(),this.updateColgroup(),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(Lt,{rows:this.rows,args:{isFrozen:!1}})},i.prototype.updateFrozenLeftColGroup=function(){for(var e=this.getFrozenHeader().querySelector("colgroup").children,i=this.parent.isRowDragable()?1:0,r=this.parent.isRowDragable()?this.parent.getFrozenLeftColumnsCount()+1:this.parent.getFrozenLeftColumnsCount(),n=i;n=r&&(t.remove(e[n]),n--)},i.prototype.updateMovableColGroup=function(){var e=this.getMovableHeader().querySelector("colgroup").children;this.parent.isRowDragable()&&t.remove(e[0]);for(var i=e.length,r=this.parent.getFrozenLeftColumnsCount(),n=this.parent.getMovableColumnsCount(),o=0,s=0;s=r+n)&&(t.remove(e[o]),o--)},i.prototype.updateFrozenRightColGroup=function(){var e=this.parent.isRowDragable(),i=this.parent.getFrozenRightColumns(),r=this.getFrozenRightHeader().querySelector("colgroup").children;"Left-Right"===this.parent.getFrozenMode()&&e&&t.remove(r[0]);for(var n=r.length,o=this.parent.getFrozenLeftColumnsCount(),s=this.parent.getMovableColumnsCount(),l=0,a=0;a",t.addClass([this.parent.getMovableContentTbody().querySelector("tr")],["e-emptyrow"]),this.getFrozenRightContent().querySelector(".e-emptyrow").querySelector("td").colSpan=this.parent.getVisibleFrozenRightCount(),this.parent.frozenRows&&(this.parent.getFrozenRightHeaderTbody().innerHTML="",this.parent.getMovableHeaderTbody().innerHTML="")},i.prototype.getFrozenHeader=function(e){return"frozen-left"===e?this.parent.getHeaderContent().querySelector(".e-frozen-left-header").querySelector("tbody"):"movable"===e?this.parent.getHeaderContent().querySelector(".e-movableheader").querySelector("tbody"):this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("tbody")},i.prototype.renderFrozenLeftWithRightEmptyRow=function(){this.getFrozenRightContent().querySelector("tbody").innerHTML="",t.addClass([this.getFrozenRightContent().querySelector("tbody").querySelector("tr")],["e-emptyrow"]),this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("tbody").innerHTML="")},i.prototype.setFrozenRightContent=function(e){this.frozenRigthContent=e},i.prototype.getFrozenRightContent=function(){return this.frozenRigthContent},i.prototype.getHeaderColGroup=function(){var e=this.parent.element.querySelector(".e-gridheader").querySelector("colgroup").cloneNode(!0);if(!this.parent.getFrozenLeftColumnsCount()){var t=this.getFrozenRightHeaderColGroup();e=t&&this.frzCount?t.cloneNode(!0):e,this.frzCount++,this.isColGroupRefresh=!0}return e},i.prototype.getFrozenRightHeaderColGroup=function(){var e=this.parent.getHeaderContent().querySelector(".e-frozen-right-header").querySelector("colgroup");return e||(e=this.parent.getHeaderContent().querySelector("colgroup")),e.cloneNode(!0)},i.prototype.setColGroup=function(i){return this.parent.getFrozenLeftColumnsCount()?e.prototype.setColGroup.call(this,i):(i=this.isColGroupRefresh?i:this.getFrozenRightHeaderColGroup(),t.isNullOrUndefined(i)||(i.id="content-"+i.id),this.isColGroupRefresh=!1,2===this.frzCount&&(this.frzCount=0),this.colgroup=i)},i.prototype.renderEmpty=function(t){this.parent.getFrozenLeftColumnsCount()?(e.prototype.renderEmpty.call(this,t),this.getFrozenContent().querySelector(".e-emptyrow").querySelector("td").colSpan=this.parent.getVisibleFrozenLeftCount(),this.parent.getFrozenRightColumnsCount()&&this.renderFrozenLeftWithRightEmptyRow()):this.renderFrozenRightEmptyRowAlone(t),this.parent.notify(ii,{case:"refreshHeight"})},i.prototype.setHeightToContent=function(e){this.parent.getFrozenRightColumnsCount()&&(this.getFrozenRightContent().style.height=e.toString()+"px"),this.parent.getFrozenLeftColumnsCount()&&(this.getFrozenContent().style.height=e.toString()+"px"),this.getMovableContent().style.height=e.toString()+"px"},i.prototype.actionComplete=function(t){e.prototype.actionComplete.call(this,t)},i.prototype.batchAdd=function(t){e.prototype.batchAdd.call(this,t)},i.prototype.getTbody=function(e){var t;return"frozen-left"===e?t=this.parent.getFrozenLeftContentTbody():"movable"===e?t=this.parent.getMovableContentTbody():"frozen-right"===e&&(t=this.parent.getFrozenRightContentTbody()),t},i.prototype.setIsFrozen=function(e,t){e.isFrozen="frozen-left"===t||"Right"===this.parent.getFrozenMode()&&"frozen-right"===t,e.renderFrozenRightContent="Left-Right"===this.parent.getFrozenMode()&&"frozen-right"===t,e.renderMovableContent="movable"===t},i.prototype.appendContent=function(e,i,r,n){!t.isNullOrUndefined(this.parent.rowTemplate)&&this.parent.isReact?e=i:e.appendChild(i),"Left"===this.parent.getFrozenMode()?"frozen-left"===n?(this.isLoaded=!1,this.getFrozenContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):(this.refreshTbody(e),this.isLoaded=!0,this.getMovableContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset()):"Right"===this.parent.getFrozenMode()?"movable"===n?(this.refreshTbody(e),this.isLoaded=!0,this.getMovableContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset()):(this.isLoaded=!1,this.getFrozenRightContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):"Left-Right"===this.parent.getFrozenMode()&&("frozen-left"===n?(this.isLoaded=!1,this.getFrozenContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):"movable"===n?(this.refreshTbody(e),this.isLoaded=!1,this.getMovableContent().querySelector("table").appendChild(e),this.refreshContentRows(t.extend({},r))):(this.isLoaded=!0,this.getFrozenRightContent().querySelector("table").appendChild(e),this.refreshHeight(),this.refreshScrollOffset())),this.isInitialRender&&(this.parent.scrollModule.setHeight(),this.isInitialRender=!1),this.widthService.refreshFrozenScrollbar()},i.prototype.refreshHeight=function(){this.parent.allowTextWrap||this.parent.notify(ii,{case:"refreshHeight"})},i.prototype.splitRows=function(e){var t=this.parent.getFrozenLeftColumnsCount(),i=this.parent.getFrozenRightColumnsCount();t&&!i?"frozen-left"===e?(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):this.movableRows=this.rows:!t&&i?"movable"===e?this.movableRows=this.rows:(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):t&&i&&("frozen-left"===e?(this.freezeRows=this.rows,this.freezeRowElements=this.rowElements):"movable"===e?(this.movableRows=this.rows,this.movableRowElements=this.rowElements):(this.frozenRightRows=this.rows,this.frozenRightRowElements=this.rowElements))},i.prototype.getMovableRowElements=function(){return"Left-Right"!==this.parent.getFrozenMode()?this.rowElements:this.movableRowElements},i.prototype.getFrozenRightRowElements=function(){return"Left-Right"!==this.parent.getFrozenMode()?this.freezeRowElements:this.frozenRightRowElements},i.prototype.getFrozenRightRows=function(){return"Left-Right"===this.parent.getFrozenMode()?this.parent.enableInfiniteScrolling?this.rightFreezeRows:this.frozenRightRows:this.getRows()},i.prototype.getFrozenRightRowByIndex=function(e){return this.parent.getFrozenRightDataRows()[e]},i.prototype.getRows=function(){var e=this.getInfiniteRows();return e.length?e:this.freezeRows},i.prototype.getRowElements=function(){return this.freezeRowElements},i}(vo),xo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ro=function(t){function i(e,i){var r=t.call(this,e,i)||this;return r.frzRows=[],r.mvblRows=[],r.frRows=[],r.serviceLoc=i,r.eventListener("on"),r.rowModelGenerator=new Ci(r.parent),r}return xo(i,t),i.prototype.eventListener=function(e){this.parent[e](hi,this.getVirtualData,this),this.parent[e]("set-freeze-selection",this.setFreezeSelection,this),this.parent[e]("refresh-virtual-frozenrows",this.refreshVirtualFrozenRows,this),this.parent.addEventListener(vt,this.actionComplete.bind(this))},i.prototype.actionComplete=function(e){if("delete"===e.requestType&&this.parent.frozenRows)for(var t=0;t=0&&-1===this.getKeyFromId(e.id,this.CHOOSER).indexOf("_colmenu_")},e.prototype.columnMenuBeforeOpen=function(e){e.column=this.targetColumn=this.getColumn(),this.parent.trigger("columnMenuOpen",e);for(var t=0,i=e.items;twindow.innerHeight?(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto"):this.parent.element.offsetHeight>window.innerHeight&&(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto"))},e.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(In)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)>=0||this.targetColumn&&!this.targetColumn.allowGrouping)&&(t=!0);break;case"AutoFitAll":case"AutoFit":t=!this.parent.ensureModuleInjected(Rn);break;case"Ungroup":(!this.parent.ensureModuleInjected(In)||this.parent.ensureModuleInjected(In)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(t=!0);break;case"SortDescending":case"SortAscending":if(this.parent.allowSorting&&this.parent.ensureModuleInjected(en)&&this.parent.sortSettings.columns.length>0&&this.targetColumn&&this.targetColumn.allowSorting)for(var i=this.parent.sortSettings.columns,r=0;r0&&e.items[0].parentObj instanceof a.ContextMenu&&(this.columnMenu.enableItems(this.disableItems,!1),this.disableItems=[],this.columnMenu.showItems(this.hiddenItems),this.hiddenItems=[],this.isFilterPopupOpen()&&this.getFilter(e.element,e.element.id,!0)),this.parent.isFrozenGrid()||this.parent.notify("restore-Focus",{})},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","SortAscending","SortDescending","Group","Ungroup","ColumnChooser","Filter"]},e.prototype.getItems=function(){for(var e=[],t=0,i=this.parent.columnMenuItems?this.parent.columnMenuItems:this.getDefault();t0&&e.replace(this.gridID+"_colmenu_"+(t||""),"")},e.prototype.getColumnMenu=function(){return this.element},e.prototype.getModuleName=function(){return"columnMenu"},e.prototype.setLocaleKey=function(){var e={AutoFitAll:"autoFitAll",AutoFit:"autoFit",Group:"Group",Ungroup:"Ungroup",SortAscending:"SortAscending",SortDescending:"SortDescending",ColumnChooser:"Columnchooser",Filter:"FilterMenu"};if(t.isBlazor()){e.AutoFitAll="AutoFitAll";e.AutoFit="AutoFit"}return e},e.prototype.getHeaderCell=function(e){return t.closest(e.target,"th.e-headercell")},e.prototype.getColumn=function(){if(this.headerCell){var e=this.headerCell.querySelector(".e-headercelldiv").getAttribute("e-mappinguid");return this.parent.getColumnByUid(e)}return null},e.prototype.createChooserItems=function(){for(var e=[],t=0,i=this.parent.columnModel;t=0||!this.parent.columnMenuItems},e}(),Eo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mo=function(e){function r(t,i){var r=e.call(this,t,i)||this;return r.parent=t,r.serviceLocator=i,r.initEvent(),r}return Eo(r,e),r.prototype.initEvent=function(){this.parent.isDestroyed||(this.parent.on("initForeignKeyColumn",this.initForeignKeyColumns,this),this.parent.on("getForeignKeyData",this.getForeignKeyData,this),this.parent.on("generateQuery",this.generateQueryFormData,this))},r.prototype.initForeignKeyColumns=function(e){for(var r=0;r0,options:r}},generateMessage:function(e,t,i){return i=i.filter(function(e){return"resize"!==e}).reduce(function(e,t){return e+"* "+t+"\n"},""),Ao+": MODULES MISSING\nThe following modules are not injected:.\n"+i+"Refer to "+Do+"/module.html for documentation on importing feature modules."}},promise_enabled:{type:"promise_enabled",logType:"error",check:function(e,t){return{success:"undefined"==typeof Promise}},generateMessage:function(e,t){return Bo+": PROMISE UNDEFINED\nPromise object is not present in the global environment,please use polyfil to support Promise object in your environment.\nRefer to "+Oo+"/base/browser.html?#required-polyfills for more information."}},primary_column_missing:{type:"primary_column_missing",logType:"warn",check:function(e,t){return{success:0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(e,t){return Ao+": PRIMARY KEY MISSING\nEditing is enabled but primary key column is not specified.\nRefer to "+Do+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},selection_key_missing:{type:"selection_key_missing",logType:"warn",check:function(e,t){return{success:t.selectionSettings.persistSelection&&0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(e,t){return Ao+": PRIMARY KEY MISSING\nselectionSettings.persistSelection property is enabled. It requires one primary key column to persist selection.\nRefer to "+Do+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},actionfailure:{type:"actionfailure",logType:"error",check:function(e,t){return{success:!0}},generateMessage:function(e,t){var i="",r=No(e,t),n=qo(e,t);return i=""!==n?n:""!==r?r:e.error,Ao+": "+i}},locale_missing:{type:"locale_missing",logType:"warn",check:function(e,r){var n=i.DataUtil.getObject("locale."+r.locale+".grid",t.L10n);return{success:"en-US"!==r.locale&&t.isNullOrUndefined(n)}},generateMessage:function(e,t){return Ao+": LOCALE CONFIG MISSING\nLocale configuration for '"+t.locale+"' is not provided.\nRefer to "+Do+"/globalization-and-localization.html?#localization \n for documentation on setting locale configuration."}},limitation:{type:"limitation",logType:"warn",check:function(e,i){var r;switch(e){case"freeze":r={success:i.allowGrouping||!t.isUndefined(i.detailTemplate)||!t.isUndefined(i.childGrid)||!t.isUndefined(i.rowTemplate)||i.enableVirtualization,options:{name:"freeze"}};break;case"virtualization":r={success:!t.isUndefined(i.detailTemplate)||!t.isUndefined(i.childGrid)||0!==i.frozenRows||0!==i.frozenColumns,options:{name:"virtualization"}};break;default:r={success:!1}}return r},generateMessage:function(e,t,i){var r,n=i.name;switch(n){case"freeze":r="Frozen rows and columns do not support the following features:\n* Virtualization\n* Row Template\n* Details Template\n* Hierarchy Grid\n* Grouping";break;case"virtualization":r="Virtualization does not support the following features.\n* Freeze rows and columns.\n* Details Template.\n* Hierarchy Grid.\n";break;default:r=""}return Ao+": "+n.toUpperCase()+" LIMITATIONS\n"+r}},check_datasource_columns:{type:"check_datasource_columns",logType:"warn",check:function(e,t){return{success:!(t.columns.length||t.dataSource instanceof i.DataManager||t.dataSource.length)}},generateMessage:function(e,t){return Ao+": GRID CONFIG MISSING\ndataSource and columns are not provided in the grid. At least one of either must be provided for grid configuration.\nRefer to "+Do+"/columns.html for documentation on configuring the grid data and columns."}},virtual_height:{type:"virtual_height",logType:"error",check:function(e,i){return{success:t.isNullOrUndefined(i.height)||"auto"===i.height}},generateMessage:function(e,t){return Bo+": GRID HEIGHT MISSING \nheight property is required to use virtualization.\nRefer to "+Do+"/virtual.html for documentation on configuring the virtual grid."}},grid_remote_edit:{type:"grid_remote_edit",logType:"error",check:function(e,t){return{success:Array.isArray(e)||Array.isArray(e.result)}},generateMessage:function(e,t){return Bo+": RETRUN VALUE MISSING \nRemote service returns invalid data. \nRefer to "+Do+"/edit.html for documentation on configuring editing with remote data."}},grid_sort_comparer:{type:"grid_sort_comparer",logType:"warn",check:function(e,t){return{success:t.getDataModule().isRemote()}},generateMessage:function(e,t){return Ao+": SORT COMPARER NOT WORKING \nSort comparer will not work with remote data.Refer to "+Do+"/sorting/#custom-sort-comparer for documentation on using the sort comparer."}},resize_min_max:{type:"resize_min_max",logType:"info",check:function(e,t){return{success:e.column.minWidth&&e.column.minWidth>=e.width||e.column.maxWidth&&e.column.maxWidth<=e.width}},generateMessage:function(e,t){return ko+": RESIZING COLUMN REACHED MIN OR MAX \nThe column resizing width is at its min or max."}},action_disabled_column:{type:"action_disabled_column",logType:"info",check:function(e,i){var r;switch(e.moduleName){case"reorder":r=t.isNullOrUndefined(e.destColumn)?"reordering action is disabled for the "+e.column.headerText+" column":"reordering action is disabled for the "+(e.column.allowReordering?e.destColumn.headerText:e.column.headerText)+" column";break;case"group":r="grouping action is disabled for the "+e.columnName+" column.";break;case"filter":r="filtering action is disabled for the "+e.columnName+" column.";break;case"sort":r="sorting action is disabled for the "+e.columnName+" column."}return{success:!0,options:{fn:r}}},generateMessage:function(e,t,i){return ko+": ACTION DISABLED \n "+i.fn}},exporting_begin:{type:"exporting_begin",logType:"info",check:function(e,t){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return ko+": EXPORTNIG INPROGRESS \n Grid "+i.args+"ing is in progress"}},exporting_complete:{type:"exporting_complete",logType:"info",check:function(e,t){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return ko+": EXPORTNIG COMPLETED \n Grid "+i.args+"ing is complete"}},foreign_key_failure:{type:"foreign_key_failure",logType:"error",check:function(e,t){return{success:!0}},generateMessage:function(e,t){return Bo+": FOREIGNKEY CONFIG \n Grid foreign key column needs a valid data source/service.Refer to "+Do+"/columns/#foreign-key-column for documentation on configuring foreign key columns."}},initial_action:{type:"initial_action",logType:"error",check:function(e,t){var i;switch(e.moduleName){case"group":i="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to group the column";break;case"filter":i="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to filter the column.";break;case"sort":i="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to sort the column."}return{success:!0,options:{fn:i}}},generateMessage:function(e,t,i){return Bo+": INITIAL ACTION FAILURE \n "+i.fn}},frozen_rows_columns:{type:"frozen_rows_columns",logType:"error",check:function(e,t){return{success:t.getColumns().length<=t.frozenColumns||t.frozenRows>=t.currentViewData.length}},generateMessage:function(e,t,i){return Bo+": OUT OF RANGE ERROR-\n "+(t.getColumns().length<=t.frozenColumns?"FROZEN COLUMNS,":"")+(t.frozenRows>=t.currentViewData.length?"FROZEN ROWS":"")+" invalid"}},column_type_missing:{type:"column_type_missing",logType:"error",check:function(e,i){return{success:t.isNullOrUndefined(e.column.type),options:e.column.headerText}},generateMessage:function(e,t,i){return Bo+": COLUMN TYPE MISSING-\n "+i+" column type was invalid or not defined.Please go through below help link: "+Oo+"/grid/columns/#column-type"}},datasource_syntax_mismatch:{type:"datasource_syntax_mismatch",logType:"warn",check:function(e,r){return{success:(e.dataState.dataSource instanceof i.DataManager||e.dataState.dataSource instanceof Array)&&!t.isNullOrUndefined(e.dataState.dataStateChange)}},generateMessage:function(e,t,i){return Ao+": DATASOURCE SYNTAX WARNING\nDataSource should be in the form of {result: Object[], count: number}when dataStateChangeEvent used"}}},No=function(e,t){var i=e.error;return i.indexOf&&0!==i.indexOf("Format options")?"":"INVALID FORMAT\nFor more information, refer to the following documentation links:\nNumber format: "+Oo+"/base/intl.html?#supported-format-string.\nDate format: "+Oo+"/base/intl.html?#manipulating-datetime.\nMessage: "+i},qo=function(e,r){var n=i.DataUtil.getObject("error.error",e);if(t.isNullOrUndefined(n))return"";var o="";try{o=JSON.parse(n.responseText)}catch(e){o=""}return"XMLHTTPREQUEST FAILED\nUrl: "+n.responseURL+"\nStatus: "+n.status+" - "+n.statusText+"\n"+(""!==o?"Message: "+o:"")},Ho=function(){function e(e,t){this.infiniteCache={},this.infiniteCurrentViewData={},this.infiniteFrozenCache={},this.isDownScroll=!1,this.isUpScroll=!1,this.isScroll=!0,this.enableContinuousScroll=!1,this.initialRender=!0,this.isRemove=!1,this.isInitialCollapse=!1,this.prevScrollTop=0,this.actions=["filtering","searching","grouping","ungrouping","reorder","sorting"],this.keys=["downArrow","upArrow","PageUp","PageDown"],this.rowTop=0,this.isInitialMovableRender=!0,this.virtualInfiniteData={},this.isCancel=!1,this.emptyRowData={},this.isNormaledit=!1,this.isInfiniteScroll=!1,this.isLastPage=!1,this.isInitialRender=!0,this.parent=e,this.serviceLocator=t,this.isNormaledit="Normal"===this.parent.editSettings.mode,this.addEventListener(),this.widthService=t.getService("widthService"),this.rowModelGenerator=this.parent.isFrozenGrid()?new mo(this.parent):new Ci(this.parent)}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on(Et,this.onDataReady,this),this.parent.on(Qt,this.dataSourceModified,this),this.parent.on("infinite-page-query",this.infinitePageQuery,this),this.parent.on("infinite-scroll-handler",this.infiniteScrollHandler,this),this.parent.on(Nt,this.infiniteCellFocus,this),this.parent.on("append-infinite-content",this.appendInfiniteRows,this),this.parent.on("remove-infinite-rows",this.removeInfiniteCacheRows,this),this.parent.on("reset-infinite-blocks",this.resetInfiniteBlocks,this),this.parent.on("set-infinite-cache",this.setCache,this),this.parent.on("initial-collapse",this.ensureIntialCollapse,this),this.parent.on(qt,this.infiniteCellFocus,this),this.parent.on("infinite-show-hide",this.setDisplayNone,this),this.parent.on("virtual-scroll-edit-action-begin",this.editActionBegin,this),this.parent.on(hi,this.getVirtualInfiniteData,this),this.parent.on("edit-reset",this.resetInfiniteEdit,this),this.parent.on("virtual-scroll-edit-success",this.infiniteEditSuccess,this),this.parent.on("refresh-virtual-cache",this.refreshInfiniteCache,this),this.parent.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.on("virtual-scroll-add-action-begin",this.infiniteAddActionBegin,this),this.parent.on(Bt,this.modelChanged,this),this.parent.on("refresh-infinite-current-view-data",this.refreshInfiniteCurrentViewData,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.on("delete-complete",this.deleteComplate,this),this.parent.addEventListener(yt,this.actionBeginFunction),this.parent.addEventListener(vt,this.actionCompleteFunction)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Et,this.onDataReady),this.parent.off(Qt,this.dataSourceModified),this.parent.off("infinite-page-query",this.infinitePageQuery),this.parent.off("infinite-scroll-handler",this.infiniteScrollHandler),this.parent.off(Nt,this.infiniteCellFocus),this.parent.off("append-infinite-content",this.appendInfiniteRows),this.parent.off("remove-infinite-rows",this.removeInfiniteCacheRows),this.parent.off("reset-infinite-blocks",this.resetInfiniteBlocks),this.parent.off("set-infinite-cache",this.setCache),this.parent.off("initial-collapse",this.ensureIntialCollapse),this.parent.off(qt,this.infiniteCellFocus),this.parent.off("infinite-show-hide",this.setDisplayNone),this.parent.off("virtual-scroll-edit-action-begin",this.editActionBegin),this.parent.off(hi,this.getVirtualInfiniteData),this.parent.off("edit-reset",this.resetInfiniteEdit),this.parent.off("virtual-scroll-edit-success",this.infiniteEditSuccess),this.parent.off("refresh-virtual-cache",this.refreshInfiniteCache),this.parent.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off("virtual-scroll-add-action-begin",this.infiniteAddActionBegin),this.parent.off(Bt,this.modelChanged),this.parent.off("refresh-infinite-current-view-data",this.refreshInfiniteCurrentViewData),this.parent.removeEventListener(yt,this.actionBeginFunction),this.parent.removeEventListener(vt,this.actionCompleteFunction))},e.prototype.updateCurrentViewData=function(){var e=this.parent;if(!e.groupSettings.columns.length){var t=Object.keys(this.infiniteCurrentViewData);e.currentViewData=[];for(var i=e.pageSettings.currentPage,r=e.infiniteScrollSettings.enableCache,n=e.infiniteScrollSettings.maxBlocks,o=r&&(i>n||this.isUpScroll&&i>1),s=o?this.isUpScroll?i:i-n+1:1,l=o?s+n-1:r?n:t.length,a=s;a<=l;a++)this.infiniteCurrentViewData[a]&&(e.currentViewData=e.currentViewData.concat(this.infiniteCurrentViewData[a]))}},e.prototype.refreshInfiniteCurrentViewData=function(e){var t=this.parent.pageSettings.currentPage,i=this.parent.pageSettings.pageSize,r=this.parent.infiniteScrollSettings.initialBlocks,n=Object.keys(this.infiniteCurrentViewData),o=this.parent.infiniteScrollSettings.enableCache;if(!this.parent.groupSettings.columns.length){var s="save"===e.args.requestType,l="delete"===e.args.requestType;o||!s&&!l?r>1&&e.data.length===r*i?this.setInitialCache(e.data.slice(),{},o&&"delete"===e.args.requestType,!0):this.infiniteCurrentViewData[t]=e.data.slice():s?this.infiniteCurrentViewData[1]=e.data.concat(this.infiniteCurrentViewData[1]):this.infiniteCurrentViewData[n[n.length-1]].push(e.data[0])}},e.prototype.deleteComplate=function(){this.parent.isFrozenGrid()&&!this.parent.infiniteScrollSettings.enableCache&&this.parent.contentModule.refreshScrollOffset()},e.prototype.modelChanged=function(e){if("infiniteScroll"!==e.requestType&&("delete"===e.requestType||"add"===this.requestType)){var t=this.parent.getRows();if(this.firstIndex=parseInt(t[0].getAttribute("aria-rowindex"),10),this.firstBlock=Math.ceil((this.firstIndex+1)/this.parent.pageSettings.pageSize),this.lastIndex=parseInt(t[t.length-1].getAttribute("aria-rowindex"),10),"delete"===e.requestType){var i=this.parent.getRowsObject();e.startIndex=this.parent.infiniteScrollSettings.enableCache?(this.firstBlock-1)*this.parent.pageSettings.pageSize:i[i.length-1].index}else e.startIndex=this.firstIndex;this.parent.infiniteScrollSettings.enableCache||this.parent.pageSettings.currentPage!==this.maxPage||"delete"!==e.requestType||(this.isLastPage=!0,this.lastIndex=this.lastIndex-1)}},e.prototype.infiniteAddActionBegin=function(e){this.isNormaledit&&(this.isAdd=!0,this.parent.infiniteScrollSettings.enableCache&&(Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.parent.pageSettings.currentPage>1&&(e.startEdit=!1,this.resetInfiniteBlocks({},!0),this.makeRequest({currentPage:1}))))},e.prototype.infiniteEditHandler=function(e){if(!this.parent.infiniteScrollSettings.enableCache&&("delete"===e.e.requestType||"save"===e.e.requestType&&"add"===this.requestType)){var i=this.parent.isFrozenGrid(),r=this.parent.getRows(),n=this.parent.getRowsObject();if(this.ensureRowAvailability(n,e.result[0])){if(this.resetRowIndex(n,e.e,r,"add"===this.requestType,!0),i){var o=this.parent.getMovableRowsObject();if(this.resetRowIndex(o,e.e,this.parent.getMovableDataRows(),"add"===this.requestType),"Left-Right"===this.parent.getFrozenMode()){var s=this.parent.getFrozenRightRowsObject();this.resetRowIndex(s,e.e,this.parent.getFrozenRightRows(),"add"===this.requestType)}}if(this.isLastPage){if(this.isLastPage=!1,this.parent.pageSettings.currentPage=this.maxPage,this.parent.selectionModule.index=0;d--)"delete"===this.requestType?s.appendChild(a.render(l[d],this.parent.getColumns())):s.insertBefore(a.render(l[d],this.parent.getColumns()),s.firstElementChild);if(!n&&this.parent.frozenRows&&(this.parent.selectionModule.indexthis.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var t=this.parent.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks;e.page(1,t)},e.prototype.infiniteCellFocus=function(e){if(!e.byKey||"upArrow"!==e.keyArgs.action&&"downArrow"!==e.keyArgs.action)"PageDown"!==e.key&&"PageUp"!==e.key||(this.pressedKey=e.key);else{this.pressedKey=e.keyArgs.action;var t=document.activeElement,i=parseInt(t.parentElement.getAttribute("aria-rowindex"),10),r=this.parent.getContent().firstElementChild;this.rowIndex="downArrow"===e.keyArgs.action?i+1:i-1,this.cellIndex=parseInt(t.getAttribute("aria-colindex"),10);var n=this.parent.getRowByIndex(i),o=Math.floor(r.offsetHeight/this.parent.getRowHeight());if(!n||Re(n,this.parent)||Fe(n,this.rowTop)){var s=n?n.getBoundingClientRect().height:this.parent.getRowHeight();if(!this.parent.infiniteScrollSettings.enableCache){if("downArrow"===e.keyArgs.action&&(Re(n,this.parent)||!n)){var l=(this.rowIndex-o)*s,a=r.scrollTop+this.parent.getRowHeight();r.scrollTop=l=this.parent.frozenRows;if(this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&i&&this.parent.editSettings.allowEditing&&!t.isNullOrUndefined(this.editRowIndex)){var r=this.parent.getRowByIndex(this.editRowIndex);if(Object.keys(this.virtualInfiniteData).length&&r&&!this.parent.getContent().querySelector(".e-editedrow")){var n=r.getBoundingClientRect().top;nthis.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(r))}}},e.prototype.restoreInfiniteAdd=function(){var e=this.parent.getContent().firstElementChild;this.parent.getCurrentViewRecords().length&&this.parent.getRowByIndex(0)&&this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&this.isAdd&&!e.querySelector(".e-addedrow")&&e.scrollTopi-this.parent.frozenRows||(t.remove(e[s]),o&&t.remove(o[s]),n&&t.remove(n[s]))},e.prototype.removeBottomRows=function(e,i,r){var n=0,o=this.parent.isFrozenGrid(),s=o?[].slice.call(this.parent.getMovableVirtualContent().querySelectorAll(".e-row")):null,l="Left-Right"===this.parent.getFrozenMode()?[].slice.call(this.parent.element.querySelector(".e-frozen-right-content").querySelectorAll(".e-row")):null,a=this.parent.pageSettings.pageSize;!o&&this.infiniteCache[r.prevPage].length=r||e[s].index===r-1));s++);this.infiniteCache[t]=n,this.resetContentModuleCache(this.infiniteCache)},e.prototype.resetContentModuleCache=function(e){this.parent.contentModule.infiniteCache=e},e.prototype.destroy=function(){this.removeEventListener()},e}(),Uo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jo=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.childCount=0,r.scrollData=[],r.isFirstChildRow=!1,r.groupCache={},r.startIndexes={},r.captionCounts={},r.rowsByUid={},r.objIdxByUid={},r.initialGroupCaptions={},r.requestType=["paging","columnstate","reorder","cancel","save","beginEdit","add","delete"],r.cacheMode=!1,r.cacheBlockSize=5,r.ignoreAccent=!!r.parent.allowFiltering&&r.parent.filterSettings.ignoreAccent,r.allowCaseSensitive=!1,r.locator=i,r.groupGenerator=new Fi(r.parent),r.summaryModelGen=new Si(r.parent),r.captionModelGen=new xi(r.parent),r.rowRenderer=new vi(r.locator,null,r.parent),r.eventListener(),r}return Uo(i,e),i.prototype.eventListener=function(){this.parent.addEventListener(yt,this.actionBegin.bind(this)),this.parent.addEventListener(vt,this.actionComplete.bind(this)),this.parent.on(Tt,this.setLazyLoadPageSize,this),this.parent.on("group-cache",this.setCache,this),this.parent.on("lazy-load-scroll-handler",this.scrollHandler,this),this.parent.on(jt,this.setVisible,this),this.parent.on("group-collapse",this.collapseShortcut,this)},i.prototype.captionExpand=function(e){var t=this,i=this.parent.pageSettings.currentPage,r=this.groupCache[i],n=e.getAttribute("data-uid"),o=this.getRowObjectIndexByUid(n),s=!!r[o+1]&&r[o].indent=e.length)for(var r=t-e.length;1+r--;)e.push(void 0);e.splice(t,0,e.splice(i,1)[0])},i.prototype.removeRows=function(e,i){var r,n=this.parent.pageSettings.currentPage,o=this.groupCache[n],s=[].slice.call(this.parent.getContent().querySelectorAll("tr"));if(this.parent.aggregates.length){var l=this.getAggregateByCaptionIndex(e);r=l.length?l[l.length-1].uid:void 0}var a=o[e].indent;this.addClass(this.getNextChilds(e)),o[e].isExpand=this.rowsByUid[n][o[e].uid].isExpand=!1;for(var h,d=e+1;d0)for(var l=e-1;l>=0&&!(r[l].indent=0&&0!==i[n].indent&&!(i[n].indent=0;o--)n.insertAdjacentElement("afterend",this.rowRenderer.render(r[o],this.parent.getColumns()));if(n&&t.length)for(var o=t.length-1;o>=0;o--)this.confirmRowRendering(t[o])&&n.insertAdjacentElement("afterend",this.rowRenderer.render(t[o],this.parent.getColumns()))},i.prototype.maintainRows=function(e,t){var i=this.parent.pageSettings.currentPage;this.rowsByUid[i]||(this.rowsByUid[i]={},this.objIdxByUid[i]={}),e.uid&&(this.rowsByUid[i][e.uid]=e),this.objIdxByUid[i][e.uid]=t},i.prototype.confirmRowRendering=function(e){var i=!0;if(t.isNullOrUndefined(e.indent)&&!e.isDataRow&&!e.isCaptionRow){var r=this.getRowByUid(e.parentUid);r.isCaptionRow&&!r.isExpand&&(i=!1)}return i},i.prototype.refreshRowObjects=function(e,i){var r=this.parent.pageSettings.currentPage,n=this.groupCache[r];this.rowsByUid[r]={},this.objIdxByUid[r]={};for(var o=[],s=0,l=0;lr[e].indent||t.isNullOrUndefined(r[n].indent))&&o--,n++;return i},i.prototype.getCacheRowsOnUpScroll=function(e,t,i){for(var r=[],n=this.groupCache[this.parent.pageSettings.currentPage],o=!1,s=0;s0&&h=this.pageSize*this.cacheBlockSize){var f=this.getChildRowsByParentIndex(a),m=Math.ceil(f.indexOf(i[o])/this.pageSize)-(this.cacheBlockSize-1);this.removeBlock(r,c,m,f),g.cachedRowIndex=m*this.pageSize}this.captionRowExpand(g)}else this.childCount=0},i.prototype.scrollDownHandler=function(e){var i=this.parent.pageSettings.currentPage,r=this.groupCache[i],n=e.getAttribute("data-uid"),o=this.getRowObjectIndexByUid(n),s=o,l=r[o],a=this.getRowByUid(l.parentUid),h=this.getRowObjectIndexByUid(a.uid),d=this.getRowElementByUid(a.uid).rowIndex,p=this.getChildRowsByParentIndex(h),c=p.indexOf(l),u=Math.ceil(c/this.pageSize);this.childCount=u*this.pageSize;var g=r[o=this.rowObjectIndex=this.getRowObjectIndexByUid(p[this.childCount-1].uid)],f=this.getRowElementByUid(g.uid);if(this.rowIndex=f.rowIndex,o=this.getCurrentBlockEndIndex(g,o),this.childCount1||!this.cacheMode)&&(e.classList.remove("e-lazyload-middle-down"),f.classList.remove("e-not-lazyload-end"),g.lazyLoadCssClass=""),this.scrollData=m?this.getCacheRowsOnDownScroll(this.rowObjectIndex+1):[];var y=this.getGroupKeysAndFields(h,r),v={rowIndex:d,makeRequest:!m,groupInfo:a,fields:y.fields,keys:y.keys,skip:this.childCount,take:this.pageSize,isScroll:!0};if(this.cacheMode&&this.childCount-this.pageSize>=this.pageSize*this.cacheBlockSize){var C=this.getChildRowsByParentIndex(h),w=Math.ceil(C.indexOf(r[s])/this.pageSize)-1-(this.cacheBlockSize-1)+1;this.removeBlock(n,m,w,C,g),v.cachedRowIndex=w*this.pageSize}this.captionRowExpand(v)}else this.childCount=0},i.prototype.getCurrentBlockEndIndex=function(e,t){var i=this.parent.pageSettings.currentPage,r=this.groupCache[i];if(e.isCaptionRow){if(e.isExpand){var n=this.getChildRowsByParentIndex(t,!0).length;this.rowIndex=this.rowIndex+n}var o=this.getAggregateByCaptionIndex(t);this.rowObjectIndex=this.rowObjectIndex+o.length;for(var s=t,l=s+1;lthis.pageSize&&(u=2*this.blockSize-this.pageSize,u=this.blockSize-u);var g=d[p-(u-1)-this.pageSize].uid,f=d[p-(u-1)].uid;this.scrollData=this.getCacheRowsOnUpScroll(g,f,s-(u-1)),this.isFirstChildRow=c>1,this.isFirstChildRow&&(this.scrollData[0].lazyLoadCssClass="e-not-lazyload-first"),this.getRowByUid(f).lazyLoadCssClass="",this.getRowElementByUid(f).classList.remove("e-not-lazyload-first");var m=c+this.cacheBlockSize;if(d.length!==l.data.count&&m*this.pageSize>d.length)return this.isFirstChildRow=!1,this.scrollData[0].lazyLoadCssClass="",void this.getRowElementByUid(f).classList.add("e-not-lazyload-first");var y=m*this.pageSize>l.data.count?l.data.count:m*this.pageSize,v=m*this.pageSize>l.data.count?this.pageSize-(this.pageSize*m-l.data.count):this.pageSize,C=this.getChildRowsByParentIndex(r.indexOf(d[y-1]),!0,!1,null,!0),w=C.length?C[C.length-1].uid:d[y-1].uid,b=d[y-v].uid,S=d[y-v-1].uid,x=this.objIdxByUid[i][b]-u;if("e-lazyload-middle-down"===r[x].lazyLoadCssClass){var R=this.getRowElementByUid(r[x].uid);R&&R.classList.add("e-lazyload-middle-down")}if(this.getRowByUid(w).lazyLoadCssClass="",this.getRowByUid(S).lazyLoadCssClass="e-not-lazyload-end",this.getRowElementByUid(S).classList.add("e-not-lazyload-end"),this.removeBottomRows(w,b,S),this.rowIndex=e.rowIndex-u,e.classList.length>1?e.classList.remove("e-lazyload-middle-up"):e.removeAttribute("class"),!t.isNullOrUndefined(this.getRowElementByUid(g)))return this.childCount=0,void(this.scrollData=[]);var F=this.getGroupKeysAndFields(this.getRowObjectIndexByUid(l.uid),r),z={rowIndex:h,makeRequest:!1,groupInfo:l,fields:F.fields,keys:F.keys,skip:this.childCount,take:this.pageSize,isScroll:!0,scrollUp:!0};this.captionRowExpand(z)},i.prototype.findRowElements=function(e){for(var t,i=!1,r=0;r=0&&(!t[n].isCaptionRow||-1!==i.indexOf(t[n].data.field)||!(t[n].indent