UNPKG

@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.39 MB
/*! * filename: ej2-grids.umd.min.js * version : 31.2.5 * 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(P,B,k,M,L,N,q,U,H,j,R){"use strict";G.prototype.getFormatFunction=function(e){return B.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||B.isNullOrUndefined(t)||B.isNullOrUndefined(e)?e:t(e)},G.prototype.toView=function(e,t){var i=e;return i=B.isNullOrUndefined(t)||B.isNullOrUndefined(e)?i:t(e)},G.prototype.setCulture=function(e){B.isNullOrUndefined(e)||B.setCulture(e)};var V=G;function G(e){this.intl=new B.Internationalization,B.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 _,W=function(e,t){function i(){this.constructor=e}_(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},K=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=Zl(n[r[parseInt(e.toString(),10)]]),s.parent.refreshReactColumnTemplateByUid(s.uid,!0)):"headerTemplate"===r[parseInt(e.toString(),10)]?(s.headerTemplateFn=Zl(n[r[parseInt(e.toString(),10)]]),s.parent.refreshReactHeaderTemplateByUid(s.uid)):"editTemplate"===r[parseInt(e.toString(),10)]?s.editTemplateFn=Zl(n[r[parseInt(e.toString(),10)]]):"filterTemplate"===r[parseInt(e.toString(),10)]?s.filterTemplateFn=Zl(n[r[parseInt(e.toString(),10)]]):"commandsTemplate"===r[parseInt(e.toString(),10)]&&(s.templateFn=Zl(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},B.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()),B.isNullOrUndefined(this.uid)&&(this.uid=dh("grid-column")),new V);e.format&&(e.format.skeleton||e.format.format&&"string"==typeof e.format.format)&&(this.setFormatter(t.getFormatFunction(B.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=Zl(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=Zl(this.headerTemplate)),!B.isNullOrUndefined(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=Zl(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=Zl(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=Zl(this.filterTemplate)),this.isForeignColumn()&&(B.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=B.extend({dataSource:this.dataSource,query:new k.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=Gh(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=Gh(o.foreignKeyValue,qh(o,{},e)[0]),t=Gh(o.foreignKeyValue,qh(o,{},t)[0]),"Descending"===o.sortDirection?k.DataUtil.fnDescending(e,t):k.DataUtil.fnAscending(e,t)})}K([B.Property()],J.prototype,"title",void 0),K([B.Property()],J.prototype,"type",void 0),K([B.Property()],J.prototype,"buttonOption",void 0);var Y=J;function J(){}W($,Z=Q),K([B.Property(null)],$.prototype,"columns",void 0);var Z,K=$;function $(){return null!==Z&&Z.apply(this,arguments)||this}W(te,ee=K);var ee,W=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",De="rowDrop",Te="beforePrint",Ee="printComplete",Oe="detailDataBound",ke="toolbarClick",Ae="batchAdd",Fe="batchCancel",Me="batchDelete",Le="beforeBatchAdd",Pe="beforeBatchDelete",Ne="beforeBatchSave",Be="beginEdit",ze="cellEdit",qe="cellSave",Ue="cellSaved",He="recordDoubleClick",je="recordClick",Ve="beforeDataBound",Ge="beforeOpenColumnChooser",_e="beforeOpenAdaptiveDialog",We="resizeStart",Ke="resizing",Qe="resizeStop",Xe="checkBoxChange",Ye="beforeCopy",Je="beforePaste",Ze="beforeAutoFill",$e="filterchoicerequest",et="filterAfterOpen",tt="filterBeforeOpen",it="filterSearchBegin",nt="commandClick",rt="exportGroupCaption",st="lazyLoadGroupExpand",ot="lazyLoadGroupCollapse",at="initial-load",lt="initial-end",ht="data-ready",pt="content-ready",g="ui-update",dt="on-empty",ct="inbound-model-changed",ut="model-changed",gt="colgroup-refresh",ft="header-refreshed",mt="paging-complete",yt="sorting-complete",St="filtering-complete",vt="searching-complete",Ct="reorder-complete",wt="rowdraganddrop-complete",bt="grouping-complete",It="ungrouping-complete",xt="group-aggregates",Rt="refresh-footer-rendered",Dt="refresh-aggregate-cell",Tt="refresh-aggregates",Et="rowselected",Ot="cellselected",kt="destroy-autofill-elements",At="beforecellfocused",Ft="cellfocused",Mt="key-pressed",Lt="click",r="destroy",Pt="column-visible-changed",Nt="scroll",Bt="column-width-changed",zt="column-position-changed",qt="rows-added",Ut="rows-removed",Ht="column-drag-stop",jt="header-drop",Vt="datasource-modified",Gt="refresh-complete",_t="refresh-virtual-block",Wt="dblclick",Kt="toolbar-refresh",Qt="bulk-save",Xt="auto-col",Yt="tooltip-destroy",Jt="update-data",Zt="save-complete",$t="delete-complete",ei="refresh-aggregate-on-save-complete",ti="prevent-batch",ii="dialog-destroy",ni="crud-Action",ri="add-delete-Action",si="destroy-form",oi="double-tap",ai="beforeExcelExport",li="excelExportComplete",hi="excelQueryCellInfo",pi="excelHeaderQueryCellInfo",di="exportDetailDataBound",ci="exportDetailTemplate",ui="beforePdfExport",gi="pdfExportComplete",fi="pdfQueryCellInfo",mi="pdfHeaderQueryCellInfo",yi="contextMenuClick",Si="freezerender",vi="contextMenuOpen",Ci="contextMenuClose",wi="columnMenuClick",bi="columnMenuOpen",Ii="columnMenuClose",xi="filterOpen",Ri="filterDialogCreated",Di="filter-menu-close",Ti="initForeignKeyColumn",Ei="getForeignKeyData",Oi="generateQuery",ki="showEmptyGrid",Ai="foreignKeyData",Fi="columnDataStateChange",Mi="dataStateChange",Li="dataSourceChanged",Pi="rtl-updated",Ni="beforeFragAppend",Bi="textWrapRefresh",zi="recordAdded",qi="cancel-Begin",Ui="editNextValCell",Hi="hierarchyprint",ji="expandchildgrid",Vi="printGrid-Init",Gi="export-RowDataBound",_i="export-DataBound",Wi="row-position-changed",Ki="columnChooserOpened",Qi="batchedit-form",Xi="edit-form",Yi="before-batch-cancel",Ji="batcheditform-rendered",Zi="partial-refresh",$i="beforeCustomFilterOpen",en="customFilterOpen",tn="select-virtual-Row",nn="columns-prepared",rn="cbox-filter-begin",sn="cbox-filter-complete",on="filter-Prevent",an="before-filter-cmenu-open",ln="validation-custom-placement",hn="filter-cbox-value",pn="restore-Focus",dn="detail-state-change",cn="detail-indentcell-info",un="virtaul-cell-focus",gn="virtual-scroll-edit-action-begin",fn="virtual-scroll-edit-success",mn="virtual-scroll-edit-cancel",yn="virtual-scroll-edit",Sn="refresh-virtual-cache",vn="edit-reset",Cn="virtual-scroll-add-action-begin",wn="get-virtual-data",bn="refresh-infinite-mode-blocks",In="reset-infinite-blocks",xn="infinite-scroll-handler",Rn="infinite-page-query",Dn="infinite-show-hide",Tn="append-infinite-content",En="remove-infinite-rows",On="set-infinite-cache",kn="infinite-edit-handler",An="initial-collapse",Fn="close-filter-dialog",Mn="columnChooserCancelBtnClick",Ln="get-filterbar-operator",Pn="reset-columns",Nn="pdfAggregateQueryCellInfo",Bn="excelAggregateQueryCellInfo",zn="group-cache",qn="lazy-load-scroll-handler",Un="group-collapse",Hn="beforeCheckboxRenderer",jn="refreshResizeHandlers",Vn="refresh-frozen-columns",Gn="set-reorder-destination-element",_n="refresh-virtual-frozen-height",Wn="set-freeze-selection",Kn="before-refresh-on-data-change",Qn="immutable-batch-cancel",Xn="refresh-virtual-frozenrows",Yn="check-scroll-reset",Jn="prevent-frozen-scroll-refresh",Zn="next-cell-index",$n="refresh-infinite-current-view-data",er="infinite-crud-cancel",tr="filter-dialog-close",ir="refresh-cutsom-filter-ok-button",nr="refresh-cutsom-filter-clear-button",rr="render-responsive-cmenu",sr="filter-cmenu-select",or="custom-filter-close",ar="set-fullscreen-dialog",lr="refresh-Expand-and-Collapse",hr="row-mode-change",pr="enter-key-handler",dr="refresh-virtual-max-page",cr="set-virtual-page-query",ur="select-row-on-context-open",gr="pager-refresh",fr="closeinline",mr="close-edit",yr="reset-virtual-focus",Sr="refresh-virtual-editform-cells",vr="scroll-to-edit",Cr="before-checkbox-renderer-query",wr="create-virtual-validation-form",br="validate-virtual-form",Ir="destroy-child-grid",xr="sticky-scroll-complete",Rr="infinite-group-collapse",Dr="refresh-infinite-persist-selection",Tr="refresh-infinite-editrowindex",Er="after-filter-column-menu-close",Or="beforeCheckboxfilterRenderer",kr="commandColumnDestroy",Ar="cancelcnfrmDlg",Fr="refresh-Virtual-LazyLoad-Cache",Mr="refresh-Frozen-Position",Lr="refresh-Resize-Position",Pr="refresh-Split-Frozen-Column",Nr="render-Responsive-Change-Action",Br="render-Responsive-Column-Chooser-Div",zr="show-Add-New-Row-Focus",qr="infinitescroll-complete",Ur="last-rowcell-border-updated",Hr="destroy-edit-form",jr="beforeDetailTemplateDetach",Vr="detach-detail-template",Gr=((e=P.CellType||(P.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=P.RenderType||(P.RenderType={}))[e.Header=0]="Header",e[e.Content=1]="Content",e[e.Summary=2]="Summary",(e=P.ToolbarItem||(P.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=P.ResponsiveDialogAction||(P.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=P.ResponsiveToolbarAction||(P.ResponsiveToolbarAction={}))[e.isInitial=0]="isInitial",e[e.isSearch=1]="isSearch",_r.prototype.reorderRows=function(e){this.parent.getDataModule().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])},_r.prototype.getModuleName=function(){return"data"},_r.prototype.initDataManager=function(){var e=this.parent;this.dataManager=e.dataSource instanceof k.DataManager?e.dataSource:B.isNullOrUndefined(e.dataSource)?new k.DataManager:new k.DataManager(e.dataSource),!e.isAngular||e.query instanceof k.Query?(this.isQueryInvokedFromData=!0,e.query instanceof k.Query||(e.query=new k.Query)):e.setProperties({query:new k.Query},!0)},_r.prototype.generateQuery=function(e,t){var i=this.parent,i=B.isNullOrUndefined(i.getQuery())?new k.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),Vh(this.parent)?this.virtualGroupPageQuery(i):this.pageQuery(i,e),!B.isNullOrUndefined(t)&&t||this.groupQuery(i),i},_r.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},_r.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},_r.prototype.pageQuery=function(e,t){var i=this.parent,n={query:e,skipPage:!1};if(i.notify(cr,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);!B.isNullOrUndefined(i.infiniteScrollModule)&&i.enableInfiniteScrolling?this.parent.notify(Rn,e):e.page(i.pageSettings.currentPage,!(i.allowPaging&&i.pagerModule&&i.pagerModule.pagerObj.isAllPage)||i.isManualRefresh||this.dataManager.dataSource.offline||this.dataManager.adaptor instanceof k.RemoteSaveAdaptor?i.pageSettings.pageSize:null)}return e},_r.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},_r.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&&(this.parent.log("grid_sort_comparer"),s=this.isRemote()?i[parseInt(r.toString(),10)].direction: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()):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()))}return e},_r.prototype.searchQuery=function(e,t,i){var n=this.parent.searchSettings,r=!B.isNullOrUndefined(n.fields)&&n.fields.length?n.fields:this.getSearchColumnFieldNames(),s=[];if(!B.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 k.Predicate(r[parseInt(l.toString(),10)],n.operator,n.key,n.ignoreCase,n.ignoreAccent))}o=k.Predicate.or(s);o.key=n.key,e.where(o)}else e.search(n.key,r,n.operator,n.ignoreCase,n.ignoreAccent)}return e},_r.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);B.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=Zp.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()&&Uh(I.field,o)&&!i)x.columnData.length||(n=!0),s=this.fGeneratePredicate(x,s);else for(var y=Zp.getPredicate(a),R=0,D=Object.keys(y);R<D.length;R++){C=D[R];s.push(y[""+C])}}s.length&&!n?e.where(k.Predicate.and(s)):this.parent.notify(ki,{})}return e},_r.prototype.fGeneratePredicate=function(e,t){var i={};return e&&(this.parent.notify(Oi,{predicate:i,column:e}),i.predicate.predicates.length)&&t.push(i.predicate),t},_r.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=B.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)})},_r.prototype.insert=function(e,t){return"save"===t.requestType&&(t.query=e,this.parent.notify(zi,t)),this.executeQuery(e)},_r.prototype.executeQuery=function(e){var t,i=this;return this.dataManager.ready?(t=new k.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)},_r.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),B.isNullOrUndefined(t.getFormatter())&&Eh(i,t),V.prototype.toView(e,t.getFormatter())},_r.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(ni,e)},_r.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 k.Deferred).resolve},this.setState({isPending:!0,resolver:r.resolve}),this.parent.trigger(Li,s),r.promise):this.dataManager.saveChanges(e,t,n.fromTable,n,i)},_r.prototype.getKey=function(e){if(e&&e.length)return e[0]},_r.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},_r.prototype.addRows=function(e){for(var t=e.records.length;0<t;t--)this.parent.dataSource instanceof k.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[t-1]):this.parent.getDataModule().isRemote()||B.isNullOrUndefined(this.parent.dataSource)||this.parent.dataSource.result||this.parent.dataSource.splice(e.toIndex,0,e.records[t-1])},_r.prototype.removeRows=function(t){var e=this.dataManager.dataSource.json;this.parent.dataSource instanceof k.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json=e.filter(function(e){return-1===t.records.indexOf(e)}):this.parent.getDataModule().isRemote()||B.isNullOrUndefined(this.parent.dataSource)||this.parent.dataSource.result||(this.parent.dataSource=e.filter(function(e){return-1===t.records.indexOf(e)}))},_r.prototype.getColumnByField=function(t){var i;return this.parent.columnModel.some(function(e){return(i=e).field===t})&&i},_r.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(qt,this.addRows),this.parent.off(Ut,this.removeRows),this.parent.off(Vt,this.initDataManager),this.parent.off(r,this.destroy),this.parent.off(Jt,this.crudActions),this.parent.off(ri,this.getData),this.parent.off(Xt,this.refreshFilteredCols),this.parent.off(nn,this.refreshFilteredCols))},_r.prototype.getState=function(){return this.dataState},_r.prototype.setState=function(e){return this.dataState=e},_r.prototype.getForeignKeyDataState=function(){return this.foreignKeyDataState},_r.prototype.setForeignKeyDataState=function(e){this.foreignKeyDataState=e},_r.prototype.getStateEventArgument=function(e){var t=new k.UrlAdaptor,i=new k.DataManager({url:"",adaptor:new k.UrlAdaptor}),t=t.processQuery(i,e),i=JSON.parse(t.data);return B.extend(i,t.pvtData)},_r.prototype.eventPromise=function(e,t,i){var n,r=this,s=e,o=this.getStateEventArgument(t),a=new k.Deferred,l=new k.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(Li,n),l.promise.then(function(){r.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),"save"===n.requestType&&r.parent.notify(zi,n),r.parent.trigger(Mi,o)}).catch(function(){})):(this.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),this.parent.trigger(Mi,o)):(this.setState({}),a.resolve(this.parent.dataSource)),a},_r.prototype.getSearchColumnFieldNames=function(){for(var e=[],t=0,i=this.parent.getColumns();t<i.length;t++){var n=i[t];n.allowSearching&&!B.isNullOrUndefined(n.field)&&e.push(n.field)}return e},_r.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&Zh(this.parent,this.parent.filterSettings.columns)},_r);function _r(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(qt,this.addRows,this),this.parent.on(Wi,this.reorderRows,this),this.parent.on(Ut,this.removeRows,this),this.parent.on(Vt,this.initDataManager,this),this.parent.on(r,this.destroy,this),this.parent.on(Jt,this.crudActions,this),this.parent.on(ri,this.getData,this),this.parent.on(Xt,this.refreshFilteredCols,this),this.parent.on(nn,this.refreshFilteredCols,this))}Kr.prototype.clone=function(){var e=new Kr({});return B.merge(e,this),e.cells=this.cells.map(function(e){return e.clone()}),e},Kr.prototype.setRowValue=function(e){var t;this.parent&&(t=this.data[this.parent.getPrimaryKeyFieldNames()[0]],this.parent.setRowData(t,e))},Kr.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))},Kr.prototype.makechanges=function(e,t){this.parent&&this.parent.getDataModule().dataManager.update(e,t)};var Wr=Kr;function Kr(e,t){B.merge(this,e),this.parent=t}Xr.prototype.clone=function(){var e=new Xr({});return B.merge(e,this),e};var Qr=Xr;function Xr(e){this.isSpanned=!1,this.isRowSpanned=!1,B.merge(this,e)}Jr.prototype.render=function(e,t,i,n){for(var r,s,o=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(t.cells[parseInt(i.toString(),10)].cellType||P.CellType.Data),a=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,l=e.rowSpan,h=0,p=(0<t.index&&(s=this.parent.getRowsObject().filter(function(e){return e.isDataRow}),s=(0<this.parent.groupSettings.columns.length&&!s[t.index-1].isDataRow?s[t.index]:s[t.index-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:a),d=i+1;d<i+p&&d<t.cells.length;d++)!1===t.cells[parseInt(d.toString(),10)].visible?h++:t.cells[parseInt(d.toString(),10)].isSpanned=!0;if(0<h){for(d=i+a;d<i+a+h&&d<t.cells.length;d++)t.cells[parseInt(d.toString(),10)].isSpanned=!0;i+a+h>=t.cells.length&&(a-=i+a+h-t.cells.length)}return t.cells[parseInt(i.toString(),10)].cellSpan&&(t.data[e.column.field]=t.cells[parseInt(i.toString(),10)].spanText,n=o.render(t.cells[parseInt(i.toString(),10)],t.data,{index:B.isNullOrUndefined(t.index)?"":t.index.toString()})),1<a&&B.attributes(n,{colSpan:a.toString(),"aria-colSpan":a.toString()}),1<l&&(B.attributes(n,{rowspan:l.toString(),"aria-rowspan":l.toString()}),t.cells[parseInt(i.toString(),10)].isRowSpanned=!0,t.cells[parseInt(i.toString(),10)].rowSpanRange=Number(l),1<a)&&(t.cells[parseInt(i.toString(),10)].colSpanRange=Number(a)),0<t.index&&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},Jr.prototype.backupMergeCells=function(e,t,i){this.setMergeCells(this.generteKey(e,t),i)},Jr.prototype.generteKey=function(e,t){return e+"__"+t.toString()},Jr.prototype.splitKey=function(e){return e.split("__")},Jr.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},Jr.prototype.getMergeCells=function(){return this.parent.mergeCells},Jr.prototype.setMergeCells=function(e,t){this.parent.mergeCells[""+e]=t},Jr.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},Jr.prototype.getIndexFromAllColumns=function(i){return Yl(this.parent.getVisibleColumns(),function(e,t){if(e.field===i)return t})[0]};var Yr=Jr;function Jr(e,t){this.serviceLocator=e,this.parent=t}var b="e-rowcell",Zr="e-gridheader",$r="e-gridcontent",es="e-gridfooter",ts="e-headercontent",is="e-movablecontent",ns="e-movableheader",rs="e-frozencontent",ss="e-frozenheader",os="e-content",as="e-table",I="e-row",ls="e-gridchkbox",hs="e-editedrow",ps="e-addedrow",ds="e-groupcaptionrow",cs="changedRecords",us="addedRecords",gs="deletedRecords",fs="Left-Right",ms="frozen-right",ys="frozen-left",Ss="aria-colindex",x="aria-rowindex",z="tbody",vs="colgroup",Cs="open",ws="change",bs="focus",Is="created",xs="beforeOpen",Rs="downArrow",Ds="upArrow",Ts="PageDown",Es="enter",Os="shiftEnter",ks="initialFrozenColumnIndex",As=(Fs.prototype.render=function(e,t,i,n,r){return this.refreshRow(e,t,i,n,r)},Fs.prototype.refresh=function(e,t,i,n,r){var s=this,o=(i&&(e.data=Qh({},e.changes),this.refreshMergeCells(e)),this.parent.element.querySelector("[data-uid="+e.uid+"]")),e=this.refreshRow(e,t,n,r,null,i),n=(i&&wp(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)}},Fs.prototype.refreshRow=function(D,e,t,i,n,T){for(var E=B.isNullOrUndefined(n)?this.element.cloneNode():n,n={data:D.data},O={data:D.data},r=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],s=!1,k=this.parent.isFrozenGrid(),A=!0,r=(r&&(s=Gh(r.field,n.data)),this.parent.getSelectedRowIndexes()),F=(D.isDataRow&&(D.isSelected=-1<r.indexOf(D.index)||s),this.parent.currentViewData),M=(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(E,D),B.attributes(E,B.extend({},t,{})),$l(E,D.attributes),this.serviceLocator.getService("cellRendererFactory")),L=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,M.getCellRenderer(D.cells[parseInt(t.toString(),10)].cellType||P.CellType.Data)),n={"data-index":B.isNullOrUndefined(D.index)?"":D.index.toString()},r=(D.isExpand&&D.cells[parseInt(t.toString(),10)].cellType===P.CellType.DetailExpand&&(n.class=L.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand"),!L.parent.enableRtl&&A&&("Vertical"===L.parent.gridLines||"Both"===L.parent.gridLines)),s=e.render(D.cells[parseInt(t.toString(),10)],D.data,n,D.isExpand,T);if(D.cells[parseInt(t.toString(),10)].cellType!==P.CellType.Filter){if(D.cells[parseInt(t.toString(),10)].cellType===P.CellType.Data||D.cells[parseInt(t.toString(),10)].cellType===P.CellType.CommandColumn){i.visible&&r&&(L.parent.groupSettings&&L.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):L.parent.renderModule&&L.parent.renderModule.isFirstColumnHidden&&!(L.parent.allowRowDragAndDrop||L.parent.childGrid||L.parent.detailTemplate)&&s.classList.add("e-first-visible-cell"),A=!1);var o,n=L.parent.parentDetails&&L.parent.parentDetails.parentInstObj&&L.parent.parentDetails.parentInstObj.isReact,a=L.parent.printGridParent&&L.parent.printGridParent.isReact;if((L.parent.isReact&&L.parent.requireTemplateRef||n&&L.parent.parentDetails.parentInstObj.requireTemplateRef||a&&L.parent.printGridParent.requireTemplateRef)&&i.isTemplate?(o=L).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,B.extend(O,{cell:s,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:D.cells[parseInt(t.toString(),10)].foreignKeyData,requestType:o.parent.requestTypeAction}))}):L.parent.trigger(re,B.extend(O,{cell:s,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:D.cells[parseInt(t.toString(),10)].foreignKeyData,requestType:L.parent.requestTypeAction})),!(L.parent.enableVirtualization||L.parent.enableColumnVirtualization||L.parent.enableInfiniteScrolling||L.parent.allowGrouping&&L.parent.groupSettings.columns.length&&L.parent.groupSettings.enableLazyLoading)){var l="field",h=["date","datetime","dateonly"];if(D.isDataRow&&L.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)&&!B.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)&&!B.isNullOrUndefined(g)&&g instanceof Date?g.getTime():g)||!u.visible||!u.column.enableColumnSpan||u.isForeignKey)break;p++}O.colSpan=p}if(D.isDataRow&&L.parent.enableRowSpan&&i.column.enableRowSpan&&!i.isSpanned&&!i.isTemplate&&i.visible&&""!==D.data[i.column[""+l]]&&!i.isForeignKey){var n=L.parent.groupSettings.columns.length?D.groupDataIndex:D.index,f=(D.isDataRow&&L.parent.groupSettings.columns.length&&!B.isNullOrUndefined(D.parentUid)&&(F=L.parent.getRowObjectFromUID(D.parentUid).data.items),1),d=e.getValue(i.column[""+l],D.data,i.column);-1!==h.indexOf(i.column.type)&&!B.isNullOrUndefined(d)&&d instanceof Date&&(d=d.getTime());for(c=n+1;c<F.length;c++){var m=e.getValue(i.column[""+l],F[parseInt(c.toString(),10)],i.column);if(d!==(m=-1!==h.indexOf(i.column.type)&&!B.isNullOrUndefined(m)&&m instanceof Date?m.getTime():m))break;f++}O.rowSpan=f}}var y,S,v,C,a=!1;if(0<D.index&&(L.isSpan||L.parent.isSpan&&T)&&(y=L.parent.getRowsObject().filter(function(e){return e.isDataRow}),S=(0<L.parent.groupSettings.columns.length&&!y[D.index-1].isDataRow?y[D.index]:y[D.index-1]).cells,a=(v=S.filter(function(e){return e.column.uid===D.cells[parseInt(t.toString(),10)].column.uid})[0]).isRowSpanned||1<v.rowSpanRange),1<O.rowSpan||1<O.colSpan)if(L.resetrowSpanvalue(L.parent.frozenRows>D.index?L.parent.frozenRows:F.length,O,D.index),!1===O.column.visible)O.colSpan=1;else if(k){var w=L.parent.getColumns(),n=L.parent.getFrozenRightColumnsCount(),b=L.parent.getFrozenLeftCount(),n=w.length-n,I=O.column.index;if(I<b&&b<I+O.colSpan){var x=I+O.colSpan-b;O.colSpan=O.colSpan-x}else if(n<=I&&w.length<I+O.colSpan){var x=I+O.colSpan-w.length;O.colSpan=O.colSpan-x}else if("Fixed"===O.column.freeze){for(var x=1,R=I,c=R+1;c<R+O.colSpan&&"Fixed"===w[parseInt(c.toString(),10)].freeze;c++)x++;O.colSpan=x}else I<n&&n<I+O.colSpan&&(x=I+O.colSpan-n,O.colSpan=O.colSpan-x)}(1<O.colSpan||1<D.cells[parseInt(t.toString(),10)].cellSpan||1<O.rowSpan||a)&&(L.parent.isSpan=!0,L.isSpan=!0,s=(C=new Yr(L.serviceLocator,L.parent)).render(O,D,t,s),k)&&Ip(L.parent,O.column,s,O.colSpan)}i.cellType!==P.CellType.Header&&i.cellType!==P.CellType.StackedHeader||!r||!i.visible&&i.cellType!==P.CellType.StackedHeader||(b=L.parent.getVisibleColumns(),l="field",(i.column.type&&"checkbox"===i.column.type||i.cellType===P.CellType.Header&&i.column[""+l]&&b.length&&b[0].field===i.column[""+l]||i.cellType===P.CellType.StackedHeader)&&(L.parent.groupSettings&&L.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):L.parent.renderModule&&L.parent.renderModule.isFirstColumnHidden&&!(L.parent.allowRowDragAndDrop||L.parent.childGrid||L.parent.detailTemplate)&&s.classList.add("e-first-visible-cell")),A=!1),i.cellType===P.CellType.Header&&(1<D.cells[parseInt(t.toString(),10)].colSpan||1<D.cells[parseInt(t.toString(),10)].rowSpan)&&(C=new Yr(L.serviceLocator,L.parent),s=C.render(D.cells[parseInt(t.toString(),10)],D,t,s)),L.isSpan&&(y=L.parent.getRowsObject(),I=L.parent.enableRtl,y[D.index-1])&&y[D.index-1].isDataRow&&(v=(S=y[D.index-1].cells)[t-1],n=S[parseInt(t.toString(),10)],a=S[t+1],b=S[parseInt(t.toString(),10)].column.freeze,v&&(v.isRowSpanned||1<v.rowSpanRange)&&v.visible&&(I||n.isRowSpanned&&!(v.rowSpanRange>n.rowSpanRange)||s.classList.add("e-rowcell-firstchild"),k)&&("Fixed"===v.column.freeze&&"Fixed"===b?s.classList.add(I?"e-removefreezerightborder":"e-removefreezeleftborder"):I||1!==t||"Left"!==b||s.classList.add("e-addfreezefirstchildborder")),a)&&(a.isRowSpanned||1<a.rowSpanRange)&&a.visible&&(I&&(!n.isRowSpanned||a.rowSpanRange>n.rowSpanRange)&&s.classList.add("e-rowcell-lastchild"),k)&&"Fixed"===a.column.freeze&&"Fixed"===b&&O.colSpan<2&&s.classList.add(I?"e-removefreezeleftborder":"e-removefreezerightborder"),1<O.rowSpan&&F.length-D.index===O.rowSpan&&s.classList.add("e-row-span-lastrowcell"),D.cells[parseInt(t.toString(),10)].isSpanned||E.appendChild(s)}else i.visible&&r&&(L.parent.groupSettings&&L.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):L.parent.renderModule&&L.parent.renderModule.isFirstColumnHidden&&!(L.parent.allowRowDragAndDrop||L.parent.childGrid||L.parent.detailTemplate)&&s.classList.add("e-first-visible-cell"),A=!1)}(o);var l=0;if(this.parent.groupSettings.columns.length&&this.parent.getFrozenLeftColumnsCount()){if(E.classList.contains("e-groupcaptionrow")){s=[].slice.call(E.querySelectorAll(".e-leftfreeze,.e-unfreeze,.e-rightfreeze,.e-fixedfreeze,.e-freezerightborder,.e-freezeleftborder"));if(s.length&&B.removeClass(s,["e-leftfreeze","e-unfreeze","e-rightfreeze","e-fixedfreeze","e-freezerightborder","e-freezeleftborder"]),E.querySelector(".e-summarycell"))np(E,this.parent);else{for(var h,p,d=0;d<E.childNodes.length;d++)(c=E.childNodes[parseInt(d.toString(),10)]).classList.add("e-leftfreeze"),bp(c,30*d,this.parent.enableRtl,"Left"),c.classList.contains("e-groupcaption")&&(h=parseInt(c.getAttribute("colspan"),10),p=ip(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"}}),E.appendChild(c))}}if((E.querySelectorAll(".e-leftfreeze").length||E.classList.contains("e-columnheader"))&&(E.querySelectorAll(".e-indentcell").length||E.querySelectorAll(".e-grouptopleftcell").length))for(var c=E.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),o=0;o<c.length;o++)c[parseInt(o.toString(),10)].classList.add("e-leftfreeze"),bp(c[parseInt(o.toString(),10)],30*o,this.parent.enableRtl,"Left")}var u,g,f,m,y={row:E,rowHeight:this.parent.rowHeight};if(D.isDataRow&&((u=B.extend(n,y)).isSelectable=!0,r=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,t=u.row.querySelectorAll(".e-templatecell"),(this.parent.isReact&&this.parent.requireTemplateRef||r&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&t.length?(g=this).parent.renderTemplates(function(){g.parent.trigger(ne,u),u.isSelectable||(D.isSelectable=u.isSelectable,g.disableRowSelection(g,D,y,u))}):this.parent.trigger(ne,u),D.isSelectable=u.isSelectable,s=this.parent.isRowDragable(),this.parent.allowPaging&&this.parent.selectionSettings.persistSelection&&(f=this.parent.getPrimaryKeyFieldNames()[0],m=D.data?D.data[""+f]:null,(r=u.isSelectable?this.parent.partialSelectedRecords:this.parent.disableSelectedRecords).some(function(e){return e[""+f]===m})||r.push(D.data)),u.isSelectable||this.disableRowSelection(this,D,y,u),this.parent.childGrid||s||this.parent.detailTemplate)&&(c=E.querySelectorAll(".e-rowcell:not(.e-hide)")[0])&&c.classList.add("e-detailrowvisible"),this.parent.enableVirtualization&&(n.rowHeight=this.parent.rowHeight),n.rowHeight?E.style.height=n.rowHeight+"px":this.parent.rowHeight&&(E.querySelector(".e-headercell")||E.querySelector(".e-groupcaption"))&&(E.style.height=this.parent.rowHeight+"px"),D.cssClass&&E.classList.add(D.cssClass),D.lazyLoadCssClass&&E.classList.add(D.lazyLoadCssClass),"Vertical"!==this.parent.rowRenderingMode||!this.parent.allowTextWrap||"Header"!==this.parent.textWrapSettings.wrapMode&&"Both"!==this.parent.textWrapSettings.wrapMode||E.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(E.getElementsByClassName("e-summarycell"))).length&&(v=S[S.length-1],B.addClass([v],["e-lastsummarycell"]),v=S[0],B.addClass([v],["e-firstsummarycell"]))}return E},Fs.prototype.resetrowSpanvalue=function(e,t,i){i<e&&e<i+t.rowSpan&&(i=i+t.rowSpan-e,t.rowSpan=t.rowSpan-i)},Fs.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&&B.removeClass([l],["e-selectionbackground","e-active"])}r&&B.removeClass([r],["e-selectionbackground","e-active"])},Fs.prototype.refreshMergeCells=function(e){for(var t=0,i=e.cells;t<i.length;t++)i[t].isSpanned=!1;return e},Fs.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"),B.isNullOrUndefined(t.index)||(i[x]=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,$l(e,i)},Fs);function Fs(e,t,i){this.isSpan=!1,this.cellType=t,this.serviceLocator=e,this.parent=i,this.element=this.parent.createElement("tr",{attrs:{role:"row"}})}Ls.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);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},Ls.prototype.ensureColumns=function(){var e,t=[];return(this.parent.detailTemplate||this.parent.childGrid)&&(this.parent.notify(cn,e={}),t.push(this.generateCell(e,null,P.CellType.DetailExpand))),this.parent.isRowDragable()&&t.push(this.generateCell({},null,P.CellType.RowDragIcon)),t},Ls.prototype.generateRow=function(e,t,i,n,r,s,o,a){var l={foreignKeyData:{}},e=(l.uid=dh("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.parent.hierarchyPrintMode?l.isExpand=!0:"Expanded"===this.parent.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[parseInt(t.toString(),10)]&&(l.isExpand=this.parent.expandedRows[parseInt(t.toString(),10)].isExpand)),l.cssClass=i,l.isAltRow=!!this.parent.enableAltRow&&t%2!=0,l.isAltRow=!!this.parent.enableAltRow&&t%2!=0,l.isSelected=-1<this.parent.getSelectedRowIndexes().indexOf(t),this.refreshForeignKeyRow(l),this.ensureColumns()),n=new Wr(l,this.parent);return n.cells="Right"===this.parent.getFrozenMode()?this.generateCells(l).concat(e):e.concat(this.generateCells(l)),n},Ls.prototype.refreshForeignKeyRow=function(e){for(var t=this.parent.getForeignKeyColumns(),i=0;i<t.length;i++)B.setValue(t[parseInt(i.toString(),10)].field,qh(t[parseInt(i.toString(),10)],e.data),e.foreignKeyData)},Ls.prototype.generateCells=function(e){for(var t=this.parent.getColumns(),i=[],n=0;n<t.length;n++)i.push(this.generateCell(t[parseInt(n.toString(),10)],e.uid,B.isNullOrUndefined(t[parseInt(n.toString(),10)].commands)?void 0:P.CellType.CommandColumn,null,n,e.foreignKeyData));return i},Ls.prototype.generateCell=function(e,t,i,n,r,s){t={visible:e.visible,isDataCell:!B.isNullOrUndefined(e.field||e.template),isTemplate:!B.isNullOrUndefined(e.template),rowID:t,column:e,cellType:B.isNullOrUndefined(i)?P.CellType.Data:i,colSpan:n,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&B.getValue(e.field,s)};return(t.isDataCell||"checkbox"===t.column.type||t.commands)&&(t.index=r),new Qr(t)},Ls.prototype.refreshRows=function(e){for(var t=0;t<e.length;t++)this.refreshForeignKeyRow(e[parseInt(t.toString(),10)]),e[parseInt(t.toString(),10)].cells=this.generateCells(e[parseInt(t.toString(),10)]);return e},Ls.prototype.getInfiniteIndex=function(e){return"i