@syncfusion/ej2-grids
Version:
Feature-rich JavaScript datagrid (datatable) control with built-in support for editing, filtering, grouping, paging, sorting, and exporting to Excel.
10 lines • 1.43 MB
JavaScript
/*!
* filename: ej2-grids.umd.min.js
* version : 32.1.21
* Copyright Syncfusion Inc. 2001 - 2025. 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.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-excel-export"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-popups","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-dropdowns","@syncfusion/ej2-calendars","@syncfusion/ej2-navigations","@syncfusion/ej2-excel-export","@syncfusion/ej2-pdf-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Data,e.ej2Popups,e.ej2Buttons,e.ej2Inputs,e.ej2Dropdowns,e.ej2Calendars,e.ej2Navigations,e.ej2ExcelExport,e.ej2PdfExport)}(this,function(N,q,U,F,M,L,P,B,z,j,R){"use strict";G.prototype.getFormatFunction=function(e){return q.isNullOrUndefined(e)||"dateTime"!==e.type&&"datetime"!==e.type&&"date"!==e.type&&"time"!==e.type?this.intl.getNumberFormat(e):this.intl.getDateFormat(e)},G.prototype.getParserFunction=function(e){return e.type?this.intl.getDateParser(e):this.intl.getNumberParser(e)},G.prototype.fromView=function(e,t,i){return"date"!==i&&"datetime"!==i&&"number"!==i||q.isNullOrUndefined(t)||q.isNullOrUndefined(e)?e:t(e)},G.prototype.toView=function(e,t){var i=e;return i=q.isNullOrUndefined(t)||q.isNullOrUndefined(e)?i:t(e)},G.prototype.setCulture=function(e){q.isNullOrUndefined(e)||q.setCulture(e)};var V=G;function G(e){this.intl=new q.Internationalization,q.isNullOrUndefined(e)||(this.intl.culture=e)}_=function(e,t){return(_=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])}))(e,t)};var _,K=function(e,t){function i(){this.constructor=e}_(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},W=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},Q=(X.prototype.getSortDirection=function(){return this.sortDirection},X.prototype.setSortDirection=function(e){this.sortDirection=e},X.prototype.getFreezeTableName=function(){return this.freezeTable},X.prototype.setProperties=function(n){for(var r=Object.keys(n),e=function(e){if("columns"===r[parseInt(e.toString(),10)])for(var i=n[r[parseInt(e.toString(),10)]],t=0;t<i.length;t++)!function(t){s.columns.find(function(e){return e.field===i[parseInt(t.toString(),10)].field}).setProperties(i[parseInt(t.toString(),10)])}(t);else s[r[parseInt(e.toString(),10)]]=n[r[parseInt(e.toString(),10)]];s.parent&&s.parent.isReact&&("template"===r[parseInt(e.toString(),10)]?(s.templateFn=th(n[r[parseInt(e.toString(),10)]]),s.parent.refreshReactColumnTemplateByUid(s.uid,!0)):"headerTemplate"===r[parseInt(e.toString(),10)]?(s.headerTemplateFn=th(n[r[parseInt(e.toString(),10)]]),s.parent.refreshReactHeaderTemplateByUid(s.uid)):"editTemplate"===r[parseInt(e.toString(),10)]?s.editTemplateFn=th(n[r[parseInt(e.toString(),10)]]):"filterTemplate"===r[parseInt(e.toString(),10)]?s.filterTemplateFn=th(n[r[parseInt(e.toString(),10)]]):"commandsTemplate"===r[parseInt(e.toString(),10)]&&(s.templateFn=th(n[r[parseInt(e.toString(),10)]])))},s=this,t=0;t<r.length;t++)e(t)},X.prototype.isForeignColumn=function(){return!(!this.dataSource||!this.foreignKeyValue)},X.prototype.getFormatter=function(){return this.formatFn},X.prototype.setFormatter=function(e){this.formatFn=e},X.prototype.getParser=function(){return this.parserFn},X.prototype.setParser=function(e){this.parserFn=e},X.prototype.getColumnTemplate=function(){return this.templateFn},X.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},X.prototype.getFilterItemTemplate=function(){return this.fltrTemplateFn},X.prototype.getDomSetter=function(){return this.disableHtmlEncode?"textContent":"innerHTML"},X);function X(e,t){var s,o=this,t=(this.disableHtmlEncode=!0,this.enableRowSpan=!0,this.enableColumnSpan=!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 o.editTemplateFn},this.getFilterTemplate=function(){return o.filterTemplateFn},this.templateOptions={enableAriaLabel:!0},q.merge(this,e),this.parent=t,"none"===this.type?this.type=null:this.type&&(this.type="string"==typeof this.type?this.type.toLowerCase():void 0),this.editType&&(this.editType=this.editType.toLowerCase()),q.isNullOrUndefined(this.uid)&&(this.uid=gh("grid-column")),new V);e.format&&(e.format.skeleton||e.format.format&&"string"==typeof e.format.format)&&(this.setFormatter(t.getFormatFunction(q.extend({},e.format))),this.setParser(t.getParserFunction(e.format))),this.toJSON=function(){for(var e={},t=["filter","dataSource","headerText","template","headerTemplate","edit","editTemplate","filterTemplate","commandsTemplate","parent"],i=Object.keys(o),n=0;n<i.length;n++)if("columns"===i[parseInt(n.toString(),10)]){e[i[parseInt(n.toString(),10)]]=[];for(var r=0;r<o[i[parseInt(n.toString(),10)]].length;r++)e[i[parseInt(n.toString(),10)]].push(o[i[parseInt(n.toString(),10)]][parseInt(r.toString(),10)].toJSON())}else t.indexOf(i[parseInt(n.toString(),10)])<0&&(e[i[parseInt(n.toString(),10)]]=o[i[parseInt(n.toString(),10)]]);return e},this.field||(this.allowFiltering=!1,this.allowGrouping=!1,this.allowSorting=!1,this.enableColumnSpan=!1,this.enableRowSpan=!1,this.columns&&(this.allowResizing=this.columns.some(function(e){return e.allowResizing}))),this.commands&&!this.textAlign&&(this.textAlign="Right"),(this.template||this.commandsTemplate)&&(this.templateFn=th(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=th(this.headerTemplate)),!q.isNullOrUndefined(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=th(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=th(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=th(this.filterTemplate)),this.isForeignColumn()&&(q.isNullOrUndefined(this.editType)||"dropdownedit"===this.editType||"defaultedit"===this.editType)&&(this.editType="dropdownedit",this.edit.params&&this.edit.params.dataSource&&(this.edit.params.ddEditedData=!0),this.edit.params=q.extend({dataSource:this.dataSource,query:new U.Query,fields:{value:this.foreignKeyField||this.field,text:this.foreignKeyValue}},this.edit.params)),this.sortComparer&&(s=this.sortComparer,this.sortComparer=function(e,t,i,n){var r;return"string"==typeof s&&(s=Wh(s,window)),"Descending"===o.sortDirection&&(r=e,e=t,t=r,r=i,i=n,n=r),s(e,t,i,n)}),!this.sortComparer&&this.isForeignColumn()&&(this.sortComparer=function(e,t){return e=Wh(o.foreignKeyValue,jh(o,{},e)[0]),t=Wh(o.foreignKeyValue,jh(o,{},t)[0]),"Descending"===o.sortDirection?U.DataUtil.fnDescending(e,t):U.DataUtil.fnAscending(e,t)})}W([q.Property()],J.prototype,"title",void 0),W([q.Property()],J.prototype,"type",void 0),W([q.Property()],J.prototype,"buttonOption",void 0);var Y=J;function J(){}K($,Z=Q),W([q.Property(null)],$.prototype,"columns",void 0);var Z,W=$;function $(){return null!==Z&&Z.apply(this,arguments)||this}K(te,ee=W);var ee,K=te;function te(){return null!==ee&&ee.apply(this,arguments)||this}var ie="load",ne="rowDataBound",re="queryCellInfo",se="headerCellInfo",y="actionBegin",d="actionComplete",oe="actionFailure",ae="dataBound",le="rowSelecting",he="rowSelected",pe="rowDeselecting",de="rowDeselected",ce="cellSelecting",ue="cellSelected",ge="cellDeselecting",fe="cellDeselected",me="columnSelecting",ye="columnSelected",Se="columnDeselecting",ve="columnDeselected",Ce="columnDragStart",we="columnDrag",be="columnDrop",Ie="rowDragStartHelper",xe="rowDragStart",Re="rowDrag",Te="rowDrop",De="beforePrint",Ee="printComplete",Oe="detailDataBound",ke="detailExpand",Ae="detailCollapse",Fe="toolbarClick",Me="batchAdd",Le="batchCancel",Pe="batchDelete",Ne="beforeBatchAdd",Be="beforeBatchDelete",ze="beforeBatchSave",qe="beginEdit",Ue="cellEdit",He="cellSave",je="cellSaved",Ve="recordDoubleClick",Ge="recordClick",_e="beforeDataBound",Ke="beforeOpenColumnChooser",We="beforeOpenAdaptiveDialog",Qe="resizeStart",Xe="resizing",Ye="resizeStop",Je="checkBoxChange",Ze="beforeCopy",$e="beforePaste",et="beforeAutoFill",tt="filterchoicerequest",it="filterAfterOpen",nt="filterBeforeOpen",rt="filterSearchBegin",st="commandClick",ot="exportGroupCaption",at="lazyLoadGroupExpand",lt="lazyLoadGroupCollapse",ht="initial-load",pt="initial-end",dt="data-ready",ct="content-ready",g="ui-update",ut="on-empty",gt="inbound-model-changed",ft="model-changed",mt="colgroup-refresh",yt="header-refreshed",St="paging-complete",vt="sorting-complete",Ct="filtering-complete",wt="searching-complete",bt="reorder-complete",It="rowdraganddrop-complete",xt="grouping-complete",Rt="ungrouping-complete",Tt="group-aggregates",Dt="refresh-footer-rendered",Et="refresh-aggregate-cell",Ot="refresh-aggregates",kt="rowselected",At="cellselected",Ft="destroy-autofill-elements",Mt="beforecellfocused",Lt="cellfocused",Pt="key-pressed",Nt="click",r="destroy",Bt="column-visible-changed",zt="scroll",qt="column-width-changed",Ut="column-position-changed",Ht="rows-added",jt="rows-removed",Vt="column-drag-stop",Gt="header-drop",_t="datasource-modified",Kt="refresh-complete",Wt="refresh-virtual-block",Qt="dblclick",Xt="toolbar-refresh",Yt="bulk-save",Jt="auto-col",Zt="tooltip-destroy",$t="update-data",ei="save-complete",ti="delete-complete",ii="refresh-aggregate-on-save-complete",ni="prevent-batch",ri="dialog-destroy",si="crud-Action",oi="add-delete-Action",ai="destroy-form",li="double-tap",hi="beforeExcelExport",pi="excelExportComplete",di="excelQueryCellInfo",ci="excelHeaderQueryCellInfo",ui="exportDetailDataBound",gi="exportDetailTemplate",fi="beforePdfExport",mi="pdfExportComplete",yi="pdfQueryCellInfo",Si="pdfHeaderQueryCellInfo",vi="contextMenuClick",Ci="freezerender",wi="contextMenuOpen",bi="contextMenuClose",Ii="columnMenuClick",xi="columnMenuOpen",Ri="columnMenuClose",Ti="filterOpen",Di="filterDialogCreated",Ei="filter-menu-close",Oi="initForeignKeyColumn",ki="getForeignKeyData",Ai="generateQuery",Fi="showEmptyGrid",Mi="foreignKeyData",Li="columnDataStateChange",Pi="dataStateChange",Ni="dataSourceChanged",Bi="rtl-updated",zi="beforeFragAppend",qi="textWrapRefresh",Ui="recordAdded",Hi="cancel-Begin",ji="editNextValCell",Vi="hierarchyprint",Gi="expandchildgrid",_i="printGrid-Init",Ki="export-RowDataBound",Wi="export-DataBound",Qi="row-position-changed",Xi="columnChooserOpened",Yi="batchedit-form",Ji="edit-form",Zi="before-batch-cancel",$i="batcheditform-rendered",en="partial-refresh",tn="beforeCustomFilterOpen",nn="customFilterOpen",rn="select-virtual-Row",sn="columns-prepared",on="cbox-filter-begin",an="cbox-filter-complete",ln="filter-Prevent",hn="before-filter-cmenu-open",pn="validation-custom-placement",dn="filter-cbox-value",cn="restore-Focus",un="detail-state-change",gn="detail-indentcell-info",fn="virtaul-cell-focus",mn="virtual-scroll-edit-action-begin",yn="virtual-scroll-edit-success",Sn="virtual-scroll-edit-cancel",vn="virtual-scroll-edit",Cn="refresh-virtual-cache",wn="edit-reset",bn="virtual-scroll-add-action-begin",In="get-virtual-data",xn="refresh-infinite-mode-blocks",Rn="reset-infinite-blocks",Tn="infinite-scroll-handler",Dn="infinite-page-query",En="infinite-show-hide",On="append-infinite-content",kn="remove-infinite-rows",An="set-infinite-cache",Fn="infinite-edit-handler",Mn="initial-collapse",Ln="close-filter-dialog",Pn="columnChooserCancelBtnClick",Nn="get-filterbar-operator",Bn="reset-columns",zn="pdfAggregateQueryCellInfo",qn="excelAggregateQueryCellInfo",Un="group-cache",Hn="lazy-load-scroll-handler",jn="group-collapse",Vn="beforeCheckboxRenderer",Gn="refreshResizeHandlers",_n="refresh-frozen-columns",Kn="set-reorder-destination-element",Wn="refresh-virtual-frozen-height",Qn="set-freeze-selection",Xn="before-refresh-on-data-change",Yn="immutable-batch-cancel",Jn="refresh-virtual-frozenrows",Zn="check-scroll-reset",$n="prevent-frozen-scroll-refresh",er="next-cell-index",tr="refresh-infinite-current-view-data",ir="infinite-crud-cancel",nr="filter-dialog-close",rr="refresh-cutsom-filter-ok-button",sr="refresh-cutsom-filter-clear-button",or="render-responsive-cmenu",ar="filter-cmenu-select",lr="custom-filter-close",hr="set-fullscreen-dialog",pr="refresh-Expand-and-Collapse",dr="row-mode-change",cr="enter-key-handler",ur="refresh-virtual-max-page",gr="set-virtual-page-query",fr="select-row-on-context-open",mr="pager-refresh",yr="closeinline",Sr="close-edit",vr="reset-virtual-focus",Cr="refresh-virtual-editform-cells",wr="scroll-to-edit",br="before-checkbox-renderer-query",Ir="create-virtual-validation-form",xr="validate-virtual-form",Rr="destroy-child-grid",Tr="sticky-scroll-complete",Dr="infinite-group-collapse",Er="refresh-infinite-persist-selection",Or="refresh-infinite-editrowindex",kr="after-filter-column-menu-close",Ar="beforeCheckboxfilterRenderer",Fr="commandColumnDestroy",Mr="cancelcnfrmDlg",Lr="refresh-Virtual-LazyLoad-Cache",Pr="refresh-Frozen-Position",Nr="refresh-Resize-Position",Br="refresh-Split-Frozen-Column",zr="render-Responsive-Change-Action",qr="render-Responsive-Column-Chooser-Div",Ur="show-Add-New-Row-Focus",Hr="infinitescroll-complete",jr="last-rowcell-border-updated",Vr="destroy-edit-form",Gr="beforeDetailTemplateDetach",_r="detach-detail-template",Kr="beforeSetPartialRecords",Wr=((e=N.CellType||(N.CellType={}))[e.Data=0]="Data",e[e.Header=1]="Header",e[e.Summary=2]="Summary",e[e.GroupSummary=3]="GroupSummary",e[e.CaptionSummary=4]="CaptionSummary",e[e.Filter=5]="Filter",e[e.Indent=6]="Indent",e[e.GroupCaption=7]="GroupCaption",e[e.GroupCaptionEmpty=8]="GroupCaptionEmpty",e[e.Expand=9]="Expand",e[e.HeaderIndent=10]="HeaderIndent",e[e.StackedHeader=11]="StackedHeader",e[e.DetailHeader=12]="DetailHeader",e[e.DetailExpand=13]="DetailExpand",e[e.CommandColumn=14]="CommandColumn",e[e.DetailFooterIntent=15]="DetailFooterIntent",e[e.RowDragIcon=16]="RowDragIcon",e[e.RowDragHIcon=17]="RowDragHIcon",(e=N.RenderType||(N.RenderType={}))[e.Header=0]="Header",e[e.Content=1]="Content",e[e.Summary=2]="Summary",(e=N.ToolbarItem||(N.ToolbarItem={}))[e.Add=0]="Add",e[e.Edit=1]="Edit",e[e.Update=2]="Update",e[e.Delete=3]="Delete",e[e.Cancel=4]="Cancel",e[e.Print=5]="Print",e[e.Search=6]="Search",e[e.ColumnChooser=7]="ColumnChooser",e[e.PdfExport=8]="PdfExport",e[e.ExcelExport=9]="ExcelExport",e[e.CsvExport=10]="CsvExport",e[e.WordExport=11]="WordExport",(e=N.ResponsiveDialogAction||(N.ResponsiveDialogAction={}))[e.isEdit=0]="isEdit",e[e.isAdd=1]="isAdd",e[e.isSort=2]="isSort",e[e.isFilter=3]="isFilter",e[e.isColMenu=4]="isColMenu",e[e.isColumnChooser=5]="isColumnChooser",(e=N.ResponsiveToolbarAction||(N.ResponsiveToolbarAction={}))[e.isInitial=0]="isInitial",e[e.isSearch=1]="isSearch",Qr.prototype.reorderRows=function(e){this.parent.isRemote()?this.parent.getCurrentViewRecords().splice(e.toIndex,0,this.parent.getCurrentViewRecords().splice(e.fromIndex,1)[0]):this.dataManager.dataSource.json.splice(e.toIndex,0,this.dataManager.dataSource.json.splice(e.fromIndex,1)[0])},Qr.prototype.getModuleName=function(){return"data"},Qr.prototype.initDataManager=function(){var e=this.parent;this.dataManager=e.dataSource instanceof U.DataManager?e.dataSource:q.isNullOrUndefined(e.dataSource)?new U.DataManager:new U.DataManager(e.dataSource),!e.isAngular||e.query instanceof U.Query?(this.isQueryInvokedFromData=!0,e.query instanceof U.Query||(e.query=new U.Query)):e.setProperties({query:new U.Query},!0)},Qr.prototype.generateQuery=function(e,t){var i=this.parent,i=q.isNullOrUndefined(i.getQuery())?new U.Query:i.getQuery().clone();if("ExcludeHidden"===this.parent.columnQueryMode)i.select(this.parent.getColumns().filter(function(e){return!(!0!==e.isPrimaryKey&&!1===e.visible||void 0===e.field)}).map(function(e){return e.field}));else if("Schema"===this.parent.columnQueryMode){for(var n=[],r=this.parent.columns,s=0;s<r.length;s++)n.push(r[parseInt(s.toString(),10)].field);i.select(n)}return this.filterQuery(i),this.searchQuery(i),this.aggregateQuery(i),this.sortQuery(i),Kh(this.parent)?this.virtualGroupPageQuery(i):this.pageQuery(i,e),!q.isNullOrUndefined(t)&&t||this.groupQuery(i),i},Qr.prototype.pinnedDataQuery=function(e){return this.filterQuery(e),this.searchQuery(e),this.sortQuery(e),e},Qr.prototype.aggregateQuery=function(e){for(var t=this.parent.aggregates,i=0;i<t.length;i++)for(var n=t[parseInt(i.toString(),10)],r=0;r<n.columns.length;r++)for(var s=n.columns[parseInt(r.toString(),10)],o=s.type instanceof Array?s.type:[s.type],a=0;a<o.length;a++)e.aggregate(o[parseInt(a.toString(),10)].toLowerCase(),s.field);return e},Qr.prototype.virtualGroupPageQuery=function(e){if(e.queries.length)for(var t=0;t<e.queries.length;t++)"onPage"===e.queries[parseInt(t.toString(),10)].fn&&e.queries.splice(t,1);return e},Qr.prototype.pageQuery=function(e,t){var i=this.parent;if(!t){var n={query:e,skipPage:!1};if(i.notify(gr,n),!n.skipPage&&(i.allowPaging||i.enableVirtualization||i.enableInfiniteScrolling)&&!0!==t){if(i.pageSettings.currentPage=Math.max(1,i.pageSettings.currentPage),i.pageSettings.pageCount<=0&&(i.pageSettings.pageCount=8),i.pageSettings.pageSize<=0&&(i.pageSettings.pageSize=12),e.queries.length)for(var r=0;r<e.queries.length;r++)"onPage"===e.queries[parseInt(r.toString(),10)].fn&&e.queries.splice(r,1);!q.isNullOrUndefined(i.infiniteScrollModule)&&i.enableInfiniteScrolling?this.parent.notify(Dn,e):e.page(i.pageSettings.currentPage,!(i.allowPaging&&i.pagerModule&&i.pagerModule.pagerObj.isAllPage)||i.isManualRefresh||this.dataManager.dataSource.offline||this.dataManager.adaptor instanceof U.RemoteSaveAdaptor?i.pageSettings.pageSize:null)}}return e},Qr.prototype.groupQuery=function(e){var t=this.parent;if(t.allowGrouping&&t.groupSettings.columns.length){this.parent.groupSettings.enableLazyLoading&&e.lazyLoad.push({key:"isLazyLoad",value:this.parent.groupSettings.enableLazyLoading});for(var i=t.groupSettings.columns,n=0,r=i.length;n<r;n++){var s=this.getColumnByField(i[parseInt(n.toString(),10)]),o=(s||this.parent.log("initial_action",{moduleName:"group",columnName:i[parseInt(n.toString(),10)]}),s.enableGroupByFormat),s=s.format;o?e.group(i[parseInt(n.toString(),10)],this.formatGroupColumn.bind(this),s):e.group(i[parseInt(n.toString(),10)],null)}}return e},Qr.prototype.sortQuery=function(e){var t=this.parent;if((t.allowSorting||t.allowGrouping)&&t.sortSettings.columns.length){for(var i=t.sortSettings.columns,n=[],r=i.length-1;-1<r;r--){if(!(o=this.getColumnByField(i[parseInt(r.toString(),10)].field)))return this.parent.log("initial_action",{moduleName:"sort",columnName:i[parseInt(r.toString(),10)].field}),e;o.setSortDirection(i[parseInt(r.toString(),10)].direction);var s=i[parseInt(r.toString(),10)].direction;o.sortComparer&&(s=o.sortComparer.bind(o)),-1===t.groupSettings.columns.indexOf(i[parseInt(r.toString(),10)].field)?o.isForeignColumn()||o.sortComparer?e.sortByForeignKey(o.field,s,void 0,i[parseInt(r.toString(),10)].direction.toLowerCase(),o.foreignKeyValue):e.sortBy(o.field,s):n.push({direction:s,field:o.field})}for(var o,r=0,a=n.length;r<a;r++)"string"==typeof n[parseInt(r.toString(),10)].direction?e.sortBy(n[parseInt(r.toString(),10)].field,n[parseInt(r.toString(),10)].direction):(o=this.getColumnByField(n[parseInt(r.toString(),10)].field),e.sortByForeignKey(n[parseInt(r.toString(),10)].field,n[parseInt(r.toString(),10)].direction,void 0,o.getSortDirection().toLowerCase(),o.foreignKeyValue))}return e},Qr.prototype.searchQuery=function(e,t,i){var n=this.parent.searchSettings,r=!q.isNullOrUndefined(n.fields)&&n.fields.length?n.fields:this.getSearchColumnFieldNames(),s=[];if(!q.isNullOrUndefined(this.parent.searchSettings.key)&&this.parent.searchSettings.key.length){var o=this.parent.getForeignKeyColumns().some(function(e){return-1<r.indexOf(e.field)}),a=(i?t.dataSource:this.dataManager).adaptor;if(o||a.getModuleName&&"ODataV4Adaptor"===a.getModuleName()){for(var r=i?[t.foreignKeyValue]:r,l=0;l<r.length;l++){var h=i?t:this.getColumnByField(r[parseInt(l.toString(),10)]);h.isForeignColumn()&&!i?s=this.fGeneratePredicate(h,s):s.push(new U.Predicate(r[parseInt(l.toString(),10)],n.operator,n.key,n.ignoreCase,n.ignoreAccent))}o=U.Predicate.or(s);o.key=n.key,e.where(o)}else e.search(n.key,r,n.operator,n.ignoreCase,n.ignoreAccent)}return e},Qr.prototype.filterQuery=function(e,t,i){var n,r=this.parent,s=[],o=this.parent.getForeignKeyColumns();if(r.allowFiltering&&r.filterSettings.columns.length){for(var a=t||r.filterSettings.columns,l=0,h=r.getColumns();l<h.length;l++)(I=h[l]).field,I.filter.type||r.filterSettings.type;for(var p=[],d=[],c=0,u=a;c<u.length;c++){var g=(I=u[c]).isForeignKey?r.getColumnByUid(I.uid):r.getColumnByField(I.field);q.isNullOrUndefined(I.type)&&g&&("date"===g.type||"datetime"===g.type||"dateonly"===g.type)&&(I.type=(I.isForeignKey?r.getColumnByUid(I.uid):r.getColumnByField(I.field)).type),(I.isForeignKey?p:d).push(I)}if(d.length){for(var f=0,m=d.length;f<m;f++)d[parseInt(f.toString(),10)].uid=d[parseInt(f.toString(),10)].uid||this.parent.grabColumnByFieldFromAllCols(d[parseInt(f.toString(),10)].field,d[parseInt(f.toString(),10)].isForeignKey).uid;for(var y=id.getPredicate(d),S=0,v=Object.keys(y);S<v.length;S++){var C=v[S];s.push(y[""+C])}}if(p.length)for(var w=0,b=p;w<b.length;w++){(I=b[w]).uid=I.uid||this.parent.grabColumnByFieldFromAllCols(I.field,I.isForeignKey).uid;var I,x=this.parent.grabColumnByUidFromAllCols(I.uid);if(x||this.parent.log("initial_action",{moduleName:"filter",columnName:I.field}),x.isForeignColumn()&&Vh(I.field,o)&&!i)x.columnData.length||(n=!0),s=this.fGeneratePredicate(x,s);else for(var y=id.getPredicate(a),R=0,T=Object.keys(y);R<T.length;R++){C=T[R];s.push(y[""+C])}}s.length&&!n?e.where(U.Predicate.and(s)):this.parent.notify(Fi,{})}return e},Qr.prototype.fGeneratePredicate=function(e,t){var i={};return e&&(this.parent.notify(Ai,{predicate:i,column:e}),i.predicate.predicates.length)&&t.push(i.predicate),t},Qr.prototype.getData=function(e,t){var i=this,n=(void 0===e&&(e={requestType:""}),this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames()));if(this.parent.log("datasource_syntax_mismatch",{dataState:this.parent}),this.parent.dataSource&&"result"in this.parent.dataSource)return this.eventPromise(e,t,n).promise;var r=void 0;switch(e.requestType){case"delete":t=t||this.generateQuery();var s,r=1===Object.keys(e.data).length?this.dataManager.remove(n,e.data[0],t.fromTable,t):((s={addedRecords:[],deletedRecords:[],changedRecords:[]}).deletedRecords=e.data,this.dataManager.saveChanges(s,n,t.fromTable,t.requiresCount()));break;case"save":t=t||this.generateQuery(),e.index=q.isNullOrUndefined(e.index)?0:e.index,r=this.dataManager.insert(e.data,t.fromTable,t,e.index)}return!(e.promise=r)||Array.isArray(r)||r.hasOwnProperty("deletedRecords")?this.insert(t,e):r.then(function(){return i.insert(t,e)})},Qr.prototype.insert=function(e,t){return"save"===t.requestType&&(t.query=e,this.parent.notify(Ui,t)),this.executeQuery(e)},Qr.prototype.executeQuery=function(e){var t,i=this;return this.dataManager.ready?(t=new U.Deferred,this.dataManager.ready.then(function(){i.dataManager.executeQuery(e).then(function(e){t.resolve(e)})}).catch(function(e){t.reject(e)}),t.promise):this.dataManager.executeQuery(e)},Qr.prototype.formatGroupColumn=function(e,t){var i=this.serviceLocator,t=this.getColumnByField(t),n=e;return t.type||(t.type=n.getDay?0<n.getHours()||0<n.getMinutes()||0<n.getSeconds()||0<n.getMilliseconds()?"datetime":"date":typeof e),q.isNullOrUndefined(t.getFormatter())&&Ah(i,t),V.prototype.toView(e,t.getFormatter())},Qr.prototype.crudActions=function(e){var t=this.generateQuery(),i=null,n="promise",r=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());this.parent.dataSource&&"result"in this.parent.dataSource&&this.eventPromise(e,t,r),"save"===e.requestType&&(i=this.dataManager.update(r,e.data,t.fromTable,t,e.previousData)),e[n]=i||e[n],this.parent.notify(si,e)},Qr.prototype.saveChanges=function(e,t,i,n){var r,s;return(n=void 0===n?this.generateQuery():n).requiresCount(),"result"in this.parent.dataSource?(s={requestType:"batchsave",changes:e,key:t,query:n,endEdit:(r=new U.Deferred).resolve},this.setState({isPending:!0,resolver:r.resolve}),this.parent.trigger(Ni,s),r.promise):this.dataManager.saveChanges(e,t,n.fromTable,n,i)},Qr.prototype.getKey=function(e){if(e&&e.length)return e[0]},Qr.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},Qr.prototype.clearCache=function(){this.isRemote()&&this.parent.dataSource.clearCache()},Qr.prototype.addRows=function(e){for(var t=e.records.length;0<t;t--)this.parent.dataSource instanceof U.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[t-1]):this.parent.getDataModule().isRemote()||q.isNullOrUndefined(this.parent.dataSource)||this.parent.dataSource.result||this.parent.dataSource.splice(e.toIndex,0,e.records[t-1])},Qr.prototype.removeRows=function(t){var e=this.dataManager.dataSource.json;this.parent.dataSource instanceof U.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json=e.filter(function(e){return-1===t.records.indexOf(e)}):this.parent.getDataModule().isRemote()||q.isNullOrUndefined(this.parent.dataSource)||this.parent.dataSource.result||(this.parent.dataSource=e.filter(function(e){return-1===t.records.indexOf(e)}))},Qr.prototype.getColumnByField=function(t){var i;return this.parent.columnModel.some(function(e){return(i=e).field===t})&&i},Qr.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Ht,this.addRows),this.parent.off(jt,this.removeRows),this.parent.off(_t,this.initDataManager),this.parent.off(r,this.destroy),this.parent.off($t,this.crudActions),this.parent.off(oi,this.getData),this.parent.off(Jt,this.refreshFilteredCols),this.parent.off(sn,this.refreshFilteredCols))},Qr.prototype.getState=function(){return this.dataState},Qr.prototype.setState=function(e){return this.dataState=e},Qr.prototype.getForeignKeyDataState=function(){return this.foreignKeyDataState},Qr.prototype.setForeignKeyDataState=function(e){this.foreignKeyDataState=e},Qr.prototype.getStateEventArgument=function(e){var t=new U.UrlAdaptor,i=new U.DataManager({url:"",adaptor:new U.UrlAdaptor}),t=t.processQuery(i,e),i=JSON.parse(t.data);return q.extend(i,t.pvtData)},Qr.prototype.eventPromise=function(e,t,i){var n,r=this,s=e,o=this.getStateEventArgument(t),a=new U.Deferred,l=new U.Deferred;return(void 0!==e.requestType||this.parent.groupSettings.disablePageWiseAggregates&&t.queries.some(function(e){return"onGroup"===e.fn}))&&!1!==this.dataState.isDataChanged?"save"===(o.action=e).requestType||"delete"===e.requestType||"batchsave"===e.requestType?((n=e).key=i,n.promise=l.promise,n.state=o,this.setState({isPending:!0,resolver:l.resolve}),s.endEdit=l.resolve,s.cancelEdit=l.reject,this.parent.trigger(Ni,n),l.promise.then(function(){r.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),"save"===n.requestType&&r.parent.notify(Ui,n),r.parent.trigger(Pi,o)}).catch(function(){})):(this.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),this.parent.trigger(Pi,o)):(this.setState({}),a.resolve(this.parent.dataSource)),a},Qr.prototype.getSearchColumnFieldNames=function(){for(var e=[],t=0,i=this.parent.getColumns();t<i.length;t++){var n=i[t];n.allowSearching&&!q.isNullOrUndefined(n.field)&&e.push(n.field)}return e},Qr.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&tp(this.parent,this.parent.filterSettings.columns)},Qr);function Qr(e,t){this.dataState={isPending:!1,resolver:null,group:[]},this.foreignKeyDataState={isPending:!1,resolver:null},this.parent=e,this.serviceLocator=t,this.initDataManager(),this.parent.isDestroyed||"foreignKey"===this.getModuleName()||(this.parent.on(Ht,this.addRows,this),this.parent.on(Qi,this.reorderRows,this),this.parent.on(jt,this.removeRows,this),this.parent.on(_t,this.initDataManager,this),this.parent.on(r,this.destroy,this),this.parent.on($t,this.crudActions,this),this.parent.on(oi,this.getData,this),this.parent.on(Jt,this.refreshFilteredCols,this),this.parent.on(sn,this.refreshFilteredCols,this))}Yr.prototype.clone=function(){var e=new Yr({});return q.merge(e,this),e.cells=this.cells.map(function(e){return e.clone()}),e},Yr.prototype.setRowValue=function(e){var t;this.parent&&(t=this.data[this.parent.getPrimaryKeyFieldNames()[0]],this.parent.setRowData(t,e))},Yr.prototype.setCellValue=function(e,t){var i,n;this.parent&&this.data[""+e].toString()!==t.toString()&&(i=this.parent.getPrimaryKeyFieldNames()[0],n=this.data[""+i],this.parent.setCellValue(n,e,t),this.makechanges(i,this.data))},Yr.prototype.makechanges=function(e,t){this.parent&&this.parent.getDataModule().dataManager.update(e,t)};var Xr=Yr;function Yr(e,t){q.merge(this,e),this.parent=t}Zr.prototype.clone=function(){var e=new Zr({});return q.merge(e,this),e};var Jr=Zr;function Zr(e){this.isSpanned=!1,this.isRowSpanned=!1,q.merge(this,e)}es.prototype.render=function(e,t,i,n){for(var r,s,o,a=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(t.cells[parseInt(i.toString(),10)].cellType||N.CellType.Data),l=t.cells[parseInt(i.toString(),10)].cellSpan?t.cells[parseInt(i.toString(),10)].cellSpan:e.colSpan?e.colSpan+i<=t.cells.length?e.colSpan:t.cells.length-i:1,h=e.rowSpan,p=0,d=(t.index>this.parent.pinnedTopRecords.length&&(o=t.index-this.parent.pinnedTopRecords.length,s=this.parent.getRowsObject().filter(function(e){return e.isDataRow}),s=(0<this.parent.groupSettings.columns.length&&!s[parseInt(o.toString(),10)-1].isDataRow?s[parseInt(o.toString(),10)]:s[parseInt(o.toString(),10)-1]).cells,r=t.cells[parseInt(i.toString(),10)],s=s.filter(function(e){return e.column.uid===r.column.uid})[0]),s&&1<s.colSpanRange&&1<s.rowSpanRange?s.colSpanRange:l),c=i+1;c<i+d&&c<t.cells.length;c++)!1===t.cells[parseInt(c.toString(),10)].visible?p++:t.cells[parseInt(c.toString(),10)].isSpanned=!0;if(0<p){for(c=i+l;c<i+l+p&&c<t.cells.length;c++)t.cells[parseInt(c.toString(),10)].isSpanned=!0;i+l+p>=t.cells.length&&(l-=i+l+p-t.cells.length)}return t.cells[parseInt(i.toString(),10)].cellSpan&&(t.data[e.column.field]=t.cells[parseInt(i.toString(),10)].spanText,o=t.index-this.parent.pinnedTopRecords.length,n=a.render(t.cells[parseInt(i.toString(),10)],t.data,{index:q.isNullOrUndefined(o)?"":o.toString()})),1<l&&q.attributes(n,{colSpan:l.toString(),"aria-colSpan":l.toString()}),1<h&&(q.attributes(n,{rowspan:h.toString(),"aria-rowspan":h.toString()}),t.cells[parseInt(i.toString(),10)].isRowSpanned=!0,t.cells[parseInt(i.toString(),10)].rowSpanRange=Number(h),1<l)&&(t.cells[parseInt(i.toString(),10)].colSpanRange=Number(l)),t.index>this.parent.pinnedTopRecords.length&&1<s.rowSpanRange&&(t.cells[parseInt(i.toString(),10)].isSpanned=!0,t.cells[parseInt(i.toString(),10)].rowSpanRange=Number(s.rowSpanRange-1),t.cells[parseInt(i.toString(),10)].colSpanRange=0<s.rowSpanRange?s.colSpanRange:1),!this.parent.enableColumnVirtualization||t.cells[parseInt(i.toString(),10)].cellSpan||this.containsKey(e.column.field,e.data[e.column.field])||this.backupMergeCells(e.column.field,e.data[e.column.field],e.colSpan),n},es.prototype.backupMergeCells=function(e,t,i){this.setMergeCells(this.generteKey(e,t),i)},es.prototype.generteKey=function(e,t){return e+"__"+t.toString()},es.prototype.splitKey=function(e){return e.split("__")},es.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},es.prototype.getMergeCells=function(){return this.parent.mergeCells},es.prototype.setMergeCells=function(e,t){this.parent.mergeCells[""+e]=t},es.prototype.updateVirtualCells=function(e){for(var t=this.getMergeCells(),i=0,n=Object.keys(t);i<n.length;i++){var r=n[i],s=t[""+r],o=this.splitKey(r),r=this.getIndexFromAllColumns(o[0]),a=this.parent.getColumnIndexesInView(),l=s-(a[0]-r);if(r<a[0]&&1<l)for(var h=0,p=e;h<p.length;h++){var d=p[h];if(d.data[o[0]].toString()===o[1].toString()){d.cells[0].cellSpan=l,d.cells[0].spanText=o[1];break}}}return e},es.prototype.getIndexFromAllColumns=function(i){return $l(this.parent.getVisibleColumns(),function(e,t){if(e.field===i)return t})[0]};var $r=es;function es(e,t){this.serviceLocator=e,this.parent=t}var b="e-rowcell",ts="e-gridheader",is="e-gridcontent",ns="e-gridfooter",rs="e-headercontent",ss="e-movablecontent",os="e-movableheader",as="e-frozencontent",ls="e-frozenheader",hs="e-content",ps="e-table",I="e-row",ds="e-gridchkbox",cs="e-editedrow",us="e-addedrow",gs="e-groupcaptionrow",fs="changedRecords",ms="addedRecords",ys="deletedRecords",Ss="Left-Right",vs="frozen-right",Cs="frozen-left",ws="aria-colindex",T="aria-rowindex",H="tbody",bs="colgroup",Is="open",xs="change",Rs="focus",Ts="created",Ds="beforeOpen",Es="downArrow",Os="upArrow",ks="PageDown",As="enter",Fs="shiftEnter",Ms="initialFrozenColumnIndex",Ls=(Ps.prototype.render=function(e,t,i,n,r){return this.refreshRow(e,t,i,n,r)},Ps.prototype.refresh=function(e,t,i,n,r){var s=this,o=(i&&(e.data=Jh({},e.changes),this.refreshMergeCells(e)),this.parent.element.querySelector("[data-uid="+e.uid+"]")),e=this.refreshRow(e,t,n,r,null,i),n=(o.classList.contains("e-grid-pin-row")&&e.classList.add("e-grid-pin-row"),i&&xp(e),[].slice.call(e.cells)),r=[].slice.call(o.querySelectorAll(".e-templatecell"));if(this.parent.isReact&&r.length)for(var a=0,l=t;a<l.length;a++)if("break"===function(e){if(e.template)return setTimeout(function(){s.parent.refreshReactColumnTemplateByUid(e.uid,!0)},0),"break"}(l[a]))break;[].slice.call(e.attributes).map(function(e){o.setAttribute(e.name,e.value)}),o.innerHTML="";for(var h=0,p=n;h<p.length;h++){var d=p[h];o.appendChild(d)}},Ps.prototype.refreshRow=function(D,e,t,i,n,E){for(var O=q.isNullOrUndefined(n)?this.element.cloneNode():n,n={data:D.data},k={data:D.data},r=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],s=!1,A=this.parent.isFrozenGrid(),F=!0,r=(r&&(s=Wh(r.field,n.data)),this.parent.getSelectedRowIndexes()),M=(D.isDataRow&&(D.isSelected=-1<r.indexOf(D.index)||s),this.parent.currentViewData),L=(D.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(D.isSelected=!0,-1===r.indexOf(D.index))&&r.push(D.index),this.buildAttributeFromRow(O,D),q.attributes(O,q.extend({},t,{})),ih(O,D.attributes),this.serviceLocator.getService("cellRendererFactory")),P=this,o=0,a=D.cells.length;o<a;o++)!function(t){var i=D.cells[parseInt(t.toString(),10)],e=(i.isSelected=D.isSelected,i.isColumnSelected=i.column.isSelected,L.getCellRenderer(D.cells[parseInt(t.toString(),10)].cellType||N.CellType.Data)),n={"data-index":q.isNullOrUndefined(D.index)?"":D.index.toString()},r=(D.isExpand&&D.cells[parseInt(t.toString(),10)].cellType===N.CellType.DetailExpand&&(n.class=P.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand"),!P.parent.enableRtl&&F&&("Vertical"===P.parent.gridLines||"Both"===P.parent.gridLines)),s=e.render(D.cells[parseInt(t.toString(),10)],D.data,n,D.isExpand,E);if(D.cells[parseInt(t.toString(),10)].cellType!==N.CellType.Filter){if(D.cells[parseInt(t.toString(),10)].cellType===N.CellType.Data||D.cells[parseInt(t.toString(),10)].cellType===N.CellType.CommandColumn){i.visible&&r&&(P.parent.groupSettings&&P.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):P.parent.renderModule&&P.parent.renderModule.isFirstColumnHidden&&!(P.parent.allowRowDragAndDrop||P.parent.childGrid||P.parent.detailTemplate)&&s.classList.add("e-first-visible-cell"),F=!1);var o,n=P.parent.parentDetails&&P.parent.parentDetails.parentInstObj&&P.parent.parentDetails.parentInstObj.isReact,a=P.parent.printGridParent&&P.parent.printGridParent.isReact;if((P.parent.isReact&&P.parent.requireTemplateRef||n&&P.parent.parentDetails.parentInstObj.requireTemplateRef||a&&P.parent.printGridParent.requireTemplateRef)&&i.isTemplate?(o=P).parent.renderTemplates(function(){var e;"string"!=typeof i.column.template&&(e=s.getAttribute("aria-label"),s.setAttribute("aria-label",s.innerText+e)),o.parent.trigger(re,q.extend(k,{cell:s,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:D.cells[parseInt(t.toString(),10)].foreignKeyData,requestType:o.parent.requestTypeAction}))}):P.parent.trigger(re,q.extend(k,{cell:s,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:D.cells[parseInt(t.toString(),10)].foreignKeyData,requestType:P.parent.requestTypeAction})),!(P.parent.enableVirtualization||P.parent.enableColumnVirtualization||P.parent.enableInfiniteScrolling||P.parent.allowGrouping&&P.parent.groupSettings.columns.length&&P.parent.groupSettings.enableLazyLoading||D.index<P.parent.pinnedTopRecords.length)){var l="field",h=["date","datetime","dateonly"];if(D.isDataRow&&P.parent.enableColumnSpan&&i.column.enableColumnSpan&&!i.isSpanned&&i.visible&&!i.isTemplate&&""!==D.data[i.column[""+l]]&&!i.isForeignKey){var p=1,d=e.getValue(i.column[""+l],D.data,i.column);-1!==h.indexOf(i.column.type)&&!q.isNullOrUndefined(d)&&d instanceof Date&&(d=d.getTime());for(var c=t;c<D.cells.length-1;c++){var u=D.cells[parseInt(c.toString(),10)+1],g=e.getValue(u.column[""+l],D.data,u.column);if(d!==(g=-1!==h.indexOf(u.column.type)&&!q.isNullOrUndefined(g)&&g instanceof Date?g.getTime():g)||!u.visible||!u.column.enableColumnSpan||u.isForeignKey)break;p++}k.colSpan=p}if(D.isDataRow&&P.parent.enableRowSpan&&i.column.enableRowSpan&&!i.isSpanned&&!i.isTemplate&&i.visible&&""!==D.data[i.column[""+l]]&&!i.isForeignKey){var f=D.index-P.parent.pinnedTopRecords.length,n=P.parent.groupSettings.columns.length?D.groupDataIndex:f,m=(D.isDataRow&&P.parent.groupSettings.columns.length&&!q.isNullOrUndefined(D.parentUid)&&(M=P.parent.getRowObjectFromUID(D.parentUid).data.items),1),d=e.getValue(i.column[""+l],D.data,i.column);-1!==h.indexOf(i.column.type)&&!q.isNullOrUndefined(d)&&d instanceof Date&&(d=d.getTime());for(c=n+1;c<M.length;c++){var y=e.getValue(i.column[""+l],M[parseInt(c.toString(),10)],i.column);if(d!==(y=-1!==h.indexOf(i.column.type)&&!q.isNullOrUndefined(y)&&y instanceof Date?y.getTime():y))break;m++}k.rowSpan=m}}var S,v,C,w,a=!1;if(D.index>P.parent.pinnedTopRecords.length&&(P.isSpan||P.parent.isSpan&&E)&&(f=D.index-P.parent.pinnedTopRecords.length,S=P.parent.getRowsObject().filter(function(e){return e.isDataRow}),v=(0<P.parent.groupSettings.columns.length&&!S[f-1].isDataRow?S[parseInt(f.toString(),10)]:S[parseInt(f.toString(),10)-1]).cells,a=(C=v.filter(function(e){return e.column.uid===D.cells[parseInt(t.toString(),10)].column.uid})[0]).isRowSpanned||1<C.rowSpanRange),(1<k.rowSpan||1<k.colSpan)&&D.index>=P.parent.pinnedTopRecords.length){var f=D.index-P.parent.pinnedTopRecords.length;if(P.resetrowSpanvalue(P.parent.frozenRows>f?P.parent.frozenRows:M.length,k,f),!1===k.column.visible)k.colSpan=1;else if(A){var b=P.parent.getColumns(),n=P.parent.getFrozenRightColumnsCount(),I=P.parent.getFrozenLeftCount(),n=b.length-n,x=k.column.index;if(x<I&&I<x+k.colSpan){var R=x+k.colSpan-I;k.colSpan=k.colSpan-R}else if(n<=x&&b.length<x+k.colSpan){var R=x+k.colSpan-b.length;k.colSpan=k.colSpan-R}else if("Fixed"===k.column.freeze){for(var R=1,T=x,c=T+1;c<T+k.colSpan&&"Fixed"===b[parseInt(c.toString(),10)].freeze;c++)R++;k.colSpan=R}else x<n&&n<x+k.colSpan&&(R=x+k.colSpan-n,k.colSpan=k.colSpan-R)}}(1<k.colSpan||1<D.cells[parseInt(t.toString(),10)].cellSpan||1<k.rowSpan||a)&&D.index>=P.parent.pinnedTopRecords.length&&(P.parent.isSpan=!0,P.isSpan=!0,s=(w=new $r(P.serviceLocator,P.parent)).render(k,D,t,s),A)&&Tp(P.parent,k.column,s,k.colSpan)}i.cellType!==N.CellType.Header&&i.cellType!==N.CellType.StackedHeader||!r||!i.visible&&i.cellType!==N.CellType.StackedHeader||(I=P.parent.getVisibleColumns(),l="field",(i.column.type&&"checkbox"===i.column.type||i.cellType===N.CellType.Header&&i.column[""+l]&&I.length&&I[0].field===i.column[""+l]||i.cellType===N.CellType.StackedHeader)&&(P.parent.groupSettings&&P.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):P.parent.renderModule&&P.parent.renderModule.isFirstColumnHidden&&!(P.parent.allowRowDragAndDrop||P.parent.childGrid||P.parent.detailTemplate)&&s.classList.add("e-first-visible-cell")),F=!1),i.cellType===N.CellType.Header&&(1<D.cells[parseInt(t.toString(),10)].colSpan||1<D.cells[parseInt(t.toString(),10)].rowSpan)&&(w=new $r(P.serviceLocator,P.parent),s=w.render(D.cells[parseInt(t.toString(),10)],D,t,s)),P.isSpan&&(S=P.parent.getRowsObject(),x=P.parent.enableRtl,f=D.index-P.parent.pinnedTopRecords.length,S[D.index-1])&&S[f-1].isDataRow&&(C=(v=S[f-1].cells)[t-1],n=v[parseInt(t.toString(),10)],a=v[t+1],I=v[parseInt(t.toString(),10)].column.freeze,C&&(C.isRowSpanned||1<C.rowSpanRange)&&C.visible&&(x||n.isRowSpanned&&!(C.rowSpanRange>n.rowSpanRange)||s.classList.add("e-rowcell-firstchild"),A)&&("Fixed"===C.column.freeze&&"Fixed"===I?s.classList.add(x?"e-removefreezerightborder":"e-removefreezeleftborder"):x||1!==t||"Left"!==I||s.classList.add("e-addfreezefirstchildborder")),a)&&(a.isRowSpanned||1<a.rowSpanRange)&&a.visible&&(x&&(!n.isRowSpanned||a.rowSpanRange>n.rowSpanRange)&&s.classList.add("e-rowcell-lastchild"),A)&&"Fixed"===a.column.freeze&&"Fixed"===I&&k.colSpan<2&&s.classList.add(x?"e-removefreezeleftborder":"e-removefreezerightborder"),1<k.rowSpan&&M.length-(D.index-P.parent.pinnedTopRecords.length)===k.rowSpan&&s.classList.add("e-row-span-lastrowcell"),D.cells[parseInt(t.toString(),10)].isSpanned||O.appendChild(s)}else i.visible&&r&&(P.parent.groupSettings&&P.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):P.parent.renderModule&&P.parent.renderModule.isFirstColumnHidden&&!(P.parent.allowRowDragAndDrop||P.parent.childGrid||P.parent.detailTemplate)&&s.classList.add("e-first-visible-cell"),F=!1)}(o);var l=0;if(this.parent.groupSettings.columns.length&&this.parent.getFrozenLeftColumnsCount()){if(O.classList.contains("e-groupcaptionrow")){s=[].slice.call(O.querySelectorAll(".e-leftfreeze,.e-unfreeze,.e-rightfreeze,.e-fixedfreeze,.e-freezerightborder,.e-freezeleftborder"));if(s.length&&q.removeClass(s,["e-leftfreeze","e-unfreeze","e-rightfreeze","e-fixedfreeze","e-freezerightborder","e-freezeleftborder"]),O.querySelector(".e-summarycell"))op(O,this.parent);else{for(var h,p,d=0;d<O.childNodes.length;d++)(c=O.childNodes[parseInt(d.toString(),10)]).classList.add("e-leftfreeze"),Rp(c,30*d,this.parent.enableRtl,"Left"),c.classList.contains("e-groupcaption")&&(h=parseInt(c.getAttribute("colspan"),10),p=sp(this.parent,d),c.setAttribute("colspan",p.toString()),l=h-p);l&&(c=this.parent.createElement("TD",{className:"e-groupcaption",attrs:{colspan:l.toString(),id:this.parent.element.id+"captioncell",tabindex:"-1"}}),O.appendChild(c))}}if((O.querySelectorAll(".e-leftfreeze").length||O.classList.contains("e-columnheader"))&&(O.querySelectorAll(".e-indentcell").length||O.querySelectorAll(".e-grouptopleftcell").length))for(var c=O.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),o=0;o<c.length;o++)c[parseInt(o.toString(),10)].classList.add("e-leftfreeze"),Rp(c[parseInt(o.toString(),10)],30*o,this.parent.enableRtl,"Left")}var u,g,f,m,y={row:O,rowHeight:this.parent.rowHeight};if(D.isDataRow&&((u=q.extend(n,y)).isSelectable=!0,g=this.parent.getPrimaryKeyFieldNames()[0],r=D.data[""+g],this.parent.renderModule&&Object.keys(this.parent.renderModule.nonselectableDataKey).length&&!1===this.parent.renderModule.nonselectableDataKey[""+r]&&(u.isSelectable=!1),t=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,s=u.row.querySelectorAll(".e-templatecell"),(this.parent.isReact&&this.parent.requireTemplateRef||t&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&s.length?(f=this).parent.renderTemplates(function(){f.parent.trigger(ne,u),u.isSelectable||(D.isSelectable=u.isSelectable,f.disableRowSelection(f,D,y,u))}):this.parent.trigger(ne,u),D.isSelectable=u.isSelectable,r=this.parent.isRowDragable(),this.parent.allowPaging&&this.parent.selectionSettings.persistSelection&&(m=D.data?D.data[""+g]:null,(t=u.isSelectable?this.parent.partialSelectedRecords:this.parent.disableSelectedRecords).some(function(e){return e[""+g]===m})||t.push(D.data)),u.isSelectable||this.disableRowSelection(this,D,y,u),this.parent.childGrid||r||this.parent.detailTemplate)&&(c=O.querySelectorAll(".e-rowcell:not(.e-hide)")[0])&&c.classList.add("e-detailrowvisible"),this.parent.enableVirtualization&&(n.rowHeight=this.parent.rowHeight),n.rowHeight?O.style.height=n.rowHeight+"px":this.parent.rowHeight&&(O.querySelector(".e-headercell")||O.querySelector(".e-groupcaption"))&&(O.style.height=this.parent.rowHeight+"px"),D.cssClass&&O.classList.add(D.cssClass),D.lazyLoadCssClass&&O.classList.add(D.lazyLoadCssClass),"Vertical"!==this.parent.rowRenderingMode||!this.parent.allowTextWrap||"Header"!==this.parent.textWrapSettings.wrapMode&&"Both"!==this.parent.textWrapSettings.wrapMode||O.classList.add("e-verticalwrap"),!this.parent.enableColumnVirtualization&&this.parent.aggregates.length&&this.parent.element.scrollHeight>this.parent.height)for(o=0;o<this.parent.aggregates.length;o++){var S,v;this.parent.aggregates[parseInt(o.toString(),10)].properties.columns[0].footerTemplate&&(S=[].slice.call(O.getElementsByClassName("e-summarycell"))).length&&(v=S[S.length-1],q.addClass([v],["e-lastsummarycell"]),v=S[0],q.addClass([v],["e-firstsummarycell"]))}return O},Ps.prototype.resetrowSpanvalue=function(e,t,i){i<e&&e<i+t.rowSpan&&(i=i+t.rowSpan-e,t.rowSpan=t.rowSpan-i)},Ps.prototype.disableRowSelection=function(e,t,i,n){for(var r=this.parent.getSelectedRowIndexes(),s=(this.parent.selectionModule.isPartialSelection=!0,t.isSelected=!1,r.indexOf(t.index)),o=(-1<s&&r.splice(s,1),i.row.querySelectorAll(".e-rowcell.e-gridchkbox")),r=n.row.querySelector(".e-rowdragdrop"),s=e.parent.groupSettings.columns.length+(r||e.parent.isDetail()?1:0),a=0;a<o.length;a++)o[parseInt(a.toString(),10)].firstElementChild.classList.add("e-checkbox-disabled"),o[parseInt(a.toString(),10)].querySelector(".e-frame").classList.remove("e-check");if(t.cells.length)for(a=s;a<t.cells.length;a++){var l=n.row.querySelector('.e-rowcell[aria-colindex="'+(t.cells[parseInt(a.toString(),10)].index+1)+'"]');l&&q.removeClass([l],["e-selectionbackground","e-active"])}r&&q.removeClass([r],["e-selectionbackground","e-active"])},Ps.prototype.refreshMergeCells=function(e){for(var t=0,i=e.cells;t<i.length;t++)i[t].isSpanned=!1;return e},Ps.prototype.buildAttributeFromRow=function(e,t){var i={},n="data-uid",r="aria-selected",s=[];t.isDataRow&&s.push(I),t.isAltRow&&s.push("e-altrow"),t.isCaptionRow&&s.push("e-groupcaptionrow"),t.isAggregateRow&&t.parentUid&&s.push("e-groupfooterrow"),q.isNullOrUndefined(t.index)||(i[T]=t.index+1),t.rowSpan&&(i.rowSpan=t.rowSpan),t.uid&&(i[n]=t.uid),t.isSelected&&(i[r]=!0),!1===t.visible&&s.push("e-hide"),i.class=s,ih(e,i)},Ps);function Ps(e,t,i){this.isSpan=!1,this.cellType=t,this.serviceLocator=e,this.parent=i,this.element=this.parent.createElement("tr",{attrs:{role:"row"}})}Bs.prototype.generateRows=function(e,t){var i=[],n=this.parent.enableVirtualization&&t?t.startIndex:0,n=this.parent.enableInfiniteScrolling&&t?this.getInfiniteIndex(t):n;this.parent.enableImmutableMode&&t&&t.startIndex&&(n=t.startIndex),!this.parent.enableVirtualization&&this.parent.pinnedTopRowModels.length&&t&&"infiniteScroll"!==t.requestType&&(n=this.parent.pinnedTopRowModels.length);for(var r=0,s=Object.keys(e).length;r<s;r++,n++)i[parseInt(r.toString(),10)]=this.generateRow(e[parseInt(r.toString(),10)],n);return i},Bs.prototype.generatePinnedTopRows=function(e){for(var t=[],i=0,n=0,r=Object.keys(e).length;n<r;n++,i++){t[parseInt(n.toString(),10)]=this.generateRow(e[parseInt(n.toString(),10)],i);for(var s=0;s<this.parent.groupSettings.columns.length;s++)this.parent.enableColumnVirtualization||t[parseInt(n.toString(),10)].cells.unshift(this.generateCell({},null,N.CellType.HeaderIndent))}return t},Bs.prototype.ensurePinnedColumns=function(){var e=[];return(this.parent.detailTemplate||this.parent.childGrid)&&e.push(this.generateCell({},null,N.CellType.HeaderIndent)),this.parent.isRowDragable()&&e.push(this.generateCell({},null,N.CellType.HeaderIndent)),e},Bs.prototype.ensureColumns=function(){var e,t=[];return(this.parent.detailTemplate||this.parent.childGrid)&&(this.parent.notify(gn,e={}),t.push(this.generateCell(e,null,N.CellType.DetailExpand))),this.parent.isRowDragable()&&t.push(this.generateCell({},null,N.CellType.RowDragIcon)),t},Bs.prototype.generateRow=function(e,t,i,n,r,s,o,a){var l={foreignKeyData:{}},e=(l.uid=gh("grid-row"),l.data=e,l.index=t,l.indent=n,l.tIndex=s,l.isDataRow=!0,l.parentGid=r,l.parentUid=o,this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(l.groupDataIndex=a),this.parent.isPrinting&&("All"===this