@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.37 MB
JavaScript
/*!
* filename: ej2-grids.umd.min.js
* version : 29.1.35
* Copyright Syncfusion Inc. 2001 - 2024. 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(O,B,A,L,P,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)?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=Kl(n[r[parseInt(e.toString(),10)]]),s.parent.refreshReactColumnTemplateByUid(s.uid,!0)):"headerTemplate"===r[parseInt(e.toString(),10)]?(s.headerTemplateFn=Kl(n[r[parseInt(e.toString(),10)]]),s.parent.refreshReactHeaderTemplateByUid(s.uid)):"editTemplate"===r[parseInt(e.toString(),10)]?s.editTemplateFn=Kl(n[r[parseInt(e.toString(),10)]]):"filterTemplate"===r[parseInt(e.toString(),10)]?s.filterTemplateFn=Kl(n[r[parseInt(e.toString(),10)]]):"commandsTemplate"===r[parseInt(e.toString(),10)]&&(s.templateFn=Kl(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.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=oh("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.columns&&(this.allowResizing=this.columns.some(function(e){return e.allowResizing}))),this.commands&&!this.textAlign&&(this.textAlign="Right"),(this.template||this.commandsTemplate)&&(this.templateFn=Kl(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=Kl(this.headerTemplate)),!B.isNullOrUndefined(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=Kl(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=Kl(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=Kl(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 A.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=qh(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=qh(o.foreignKeyValue,Lh(o,{},e)[0]),t=qh(o.foreignKeyValue,Lh(o,{},t)[0]),"Descending"===o.sortDirection?A.DataUtil.fnDescending(e,t):A.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",Te="rowDrop",Ee="beforePrint",De="printComplete",Oe="detailDataBound",Ae="toolbarClick",Fe="batchAdd",ke="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",Tt="refresh-aggregate-cell",Et="refresh-aggregates",Dt="rowselected",Ot="cellselected",At="destroy-autofill-elements",Ft="beforecellfocused",kt="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="prevent-batch",ti="dialog-destroy",ii="crud-Action",ni="add-delete-Action",ri="destroy-form",si="double-tap",oi="beforeExcelExport",ai="excelExportComplete",li="excelQueryCellInfo",hi="excelHeaderQueryCellInfo",pi="exportDetailDataBound",di="exportDetailTemplate",ci="beforePdfExport",ui="pdfExportComplete",gi="pdfQueryCellInfo",fi="pdfHeaderQueryCellInfo",mi="contextMenuClick",yi="freezerender",Si="contextMenuOpen",vi="columnMenuClick",Ci="columnMenuOpen",wi="filterOpen",bi="filterDialogCreated",Ii="filter-menu-close",xi="initForeignKeyColumn",Ri="getForeignKeyData",Ti="generateQuery",Ei="showEmptyGrid",Di="foreignKeyData",Oi="columnDataStateChange",Ai="dataStateChange",Fi="dataSourceChanged",ki="rtl-updated",Mi="beforeFragAppend",Li="textWrapRefresh",Pi="recordAdded",Ni="cancel-Begin",Bi="editNextValCell",zi="hierarchyprint",qi="expandchildgrid",Ui="printGrid-Init",Hi="export-RowDataBound",ji="export-DataBound",Vi="row-position-changed",Gi="columnChooserOpened",_i="batchedit-form",Wi="edit-form",Ki="before-batch-cancel",Qi="batcheditform-rendered",Xi="partial-refresh",Yi="beforeCustomFilterOpen",Ji="select-virtual-Row",Zi="columns-prepared",$i="cbox-filter-begin",en="cbox-filter-complete",tn="filter-Prevent",nn="before-filter-cmenu-open",rn="validation-custom-placement",sn="filter-cbox-value",on="restore-Focus",an="detail-state-change",ln="detail-indentcell-info",hn="virtaul-cell-focus",pn="virtual-scroll-edit-action-begin",dn="virtual-scroll-edit-success",cn="virtual-scroll-edit-cancel",un="virtual-scroll-edit",gn="refresh-virtual-cache",fn="edit-reset",mn="virtual-scroll-add-action-begin",yn="get-virtual-data",Sn="refresh-infinite-mode-blocks",vn="reset-infinite-blocks",Cn="infinite-scroll-handler",wn="infinite-page-query",bn="infinite-show-hide",In="append-infinite-content",xn="remove-infinite-rows",Rn="set-infinite-cache",Tn="infinite-edit-handler",En="initial-collapse",Dn="close-filter-dialog",On="columnChooserCancelBtnClick",An="get-filterbar-operator",Fn="reset-columns",kn="pdfAggregateQueryCellInfo",Mn="excelAggregateQueryCellInfo",Ln="group-cache",Pn="lazy-load-scroll-handler",Nn="group-collapse",Bn="beforeCheckboxRenderer",zn="refreshResizeHandlers",qn="refresh-frozen-columns",Un="set-reorder-destination-element",Hn="refresh-virtual-frozen-height",jn="set-freeze-selection",Vn="before-refresh-on-data-change",Gn="immutable-batch-cancel",_n="refresh-virtual-frozenrows",Wn="check-scroll-reset",Kn="prevent-frozen-scroll-refresh",Qn="next-cell-index",Xn="refresh-infinite-current-view-data",Yn="infinite-crud-cancel",Jn="filter-dialog-close",Zn="refresh-cutsom-filter-ok-button",$n="refresh-cutsom-filter-clear-button",er="render-responsive-cmenu",tr="filter-cmenu-select",ir="custom-filter-close",nr="set-fullscreen-dialog",rr="refresh-Expand-and-Collapse",sr="row-mode-change",or="enter-key-handler",ar="refresh-virtual-max-page",lr="set-virtual-page-query",hr="select-row-on-context-open",pr="pager-refresh",dr="closeinline",cr="close-edit",ur="reset-virtual-focus",gr="refresh-virtual-editform-cells",fr="scroll-to-edit",mr="before-checkbox-renderer-query",yr="create-virtual-validation-form",Sr="validate-virtual-form",vr="destroy-child-grid",Cr="sticky-scroll-complete",wr="infinite-group-collapse",br="refresh-infinite-persist-selection",Ir="refresh-infinite-editrowindex",xr="after-filter-column-menu-close",Rr="beforeCheckboxfilterRenderer",Tr="commandColumnDestroy",Er="cancelcnfrmDlg",Dr="refresh-Virtual-LazyLoad-Cache",Or="refresh-Frozen-Position",Ar="refresh-Resize-Position",Fr="refresh-Split-Frozen-Column",kr="render-Responsive-Change-Action",Mr="render-Responsive-Column-Chooser-Div",Lr="show-Add-New-Row-Focus",Pr="infinitescroll-complete",Nr="last-rowcell-border-updated",Br="destroy-edit-form",zr="beforeDetailTemplateDetach",qr="detach-detail-template",Ur=((e=O.CellType||(O.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=O.RenderType||(O.RenderType={}))[e.Header=0]="Header",e[e.Content=1]="Content",e[e.Summary=2]="Summary",(e=O.ToolbarItem||(O.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=O.ResponsiveDialogAction||(O.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=O.ResponsiveToolbarAction||(O.ResponsiveToolbarAction={}))[e.isInitial=0]="isInitial",e[e.isSearch=1]="isSearch",Hr.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])},Hr.prototype.getModuleName=function(){return"data"},Hr.prototype.initDataManager=function(){var e=this.parent;this.dataManager=e.dataSource instanceof A.DataManager?e.dataSource:B.isNullOrUndefined(e.dataSource)?new A.DataManager:new A.DataManager(e.dataSource),!e.isAngular||e.query instanceof A.Query?(this.isQueryInvokedFromData=!0,e.query instanceof A.Query||(e.query=new A.Query)):e.setProperties({query:new A.Query},!0)},Hr.prototype.generateQuery=function(e,t){var i=this.parent,i=B.isNullOrUndefined(i.getQuery())?new A.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),zh(this.parent)?this.virtualGroupPageQuery(i):this.pageQuery(i,e),!B.isNullOrUndefined(t)&&t||this.groupQuery(i),i},Hr.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},Hr.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},Hr.prototype.pageQuery=function(e,t){var i=this.parent,n={query:e,skipPage:!1};if(i.notify(lr,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(wn,e):e.page(i.pageSettings.currentPage,!(i.allowPaging&&i.pagerModule&&i.pagerModule.pagerObj.isAllPage)||i.isManualRefresh||this.dataManager.dataSource.offline||this.dataManager.adaptor instanceof A.RemoteSaveAdaptor?i.pageSettings.pageSize:null)}return e},Hr.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},Hr.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},Hr.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 A.Predicate(r[parseInt(l.toString(),10)],n.operator,n.key,n.ignoreCase,n.ignoreAccent))}o=A.Predicate.or(s);o.key=n.key,e.where(o)}else e.search(n.key,r,n.operator,n.ignoreCase,n.ignoreAccent)}return e},Hr.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=Wp.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()&&Ph(I.field,o)&&!i)x.columnData.length||(n=!0),s=this.fGeneratePredicate(x,s);else for(var y=Wp.getPredicate(a),R=0,T=Object.keys(y);R<T.length;R++){C=T[R];s.push(y[""+C])}}s.length&&!n?e.where(A.Predicate.and(s)):this.parent.notify(Ei,{})}return e},Hr.prototype.fGeneratePredicate=function(e,t){var i={};return e&&(this.parent.notify(Ti,{predicate:i,column:e}),i.predicate.predicates.length)&&t.push(i.predicate),t},Hr.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)})},Hr.prototype.insert=function(e,t){return"save"===t.requestType&&(t.query=e,this.parent.notify(Pi,t)),this.executeQuery(e)},Hr.prototype.executeQuery=function(e){var t,i=this;return this.dataManager.ready?(t=new A.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)},Hr.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())&&Ih(i,t),V.prototype.toView(e,t.getFormatter())},Hr.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(ii,e)},Hr.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 A.Deferred).resolve},this.setState({isPending:!0,resolver:r.resolve}),this.parent.trigger(Fi,s),r.promise):this.dataManager.saveChanges(e,t,n.fromTable,n,i)},Hr.prototype.getKey=function(e){if(e&&e.length)return e[0]},Hr.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},Hr.prototype.addRows=function(e){for(var t=e.records.length;0<t;t--)this.parent.dataSource instanceof A.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])},Hr.prototype.removeRows=function(t){var e=this.dataManager.dataSource.json;this.parent.dataSource instanceof A.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)}))},Hr.prototype.getColumnByField=function(t){var i;return this.parent.columnModel.some(function(e){return(i=e).field===t})&&i},Hr.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(ni,this.getData),this.parent.off(Xt,this.refreshFilteredCols),this.parent.off(Zi,this.refreshFilteredCols))},Hr.prototype.getState=function(){return this.dataState},Hr.prototype.setState=function(e){return this.dataState=e},Hr.prototype.getForeignKeyDataState=function(){return this.foreignKeyDataState},Hr.prototype.setForeignKeyDataState=function(e){this.foreignKeyDataState=e},Hr.prototype.getStateEventArgument=function(e){var t=new A.UrlAdaptor,i=new A.DataManager({url:"",adaptor:new A.UrlAdaptor}),t=t.processQuery(i,e),i=JSON.parse(t.data);return B.extend(i,t.pvtData)},Hr.prototype.eventPromise=function(e,t,i){var n,r=this,s=e,o=this.getStateEventArgument(t),a=new A.Deferred,l=new A.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(Fi,n),l.promise.then(function(){r.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),"save"===n.requestType&&r.parent.notify(Pi,n),r.parent.trigger(Ai,o)}).catch(function(){})):(this.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),this.parent.trigger(Ai,o)):(this.setState({}),a.resolve(this.parent.dataSource)),a},Hr.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},Hr.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&Kh(this.parent,this.parent.filterSettings.columns)},Hr);function Hr(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(Vi,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(ni,this.getData,this),this.parent.on(Xt,this.refreshFilteredCols,this),this.parent.on(Zi,this.refreshFilteredCols,this))}Vr.prototype.clone=function(){var e=new Vr({});return B.merge(e,this),e.cells=this.cells.map(function(e){return e.clone()}),e},Vr.prototype.setRowValue=function(e){var t;this.parent&&(t=this.data[this.parent.getPrimaryKeyFieldNames()[0]],this.parent.setRowData(t,e))},Vr.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))},Vr.prototype.makechanges=function(e,t){this.parent&&this.parent.getDataModule().dataManager.update(e,t)};var jr=Vr;function Vr(e,t){B.merge(this,e),this.parent=t}_r.prototype.clone=function(){var e=new _r({});return B.merge(e,this),e};var Gr=_r;function _r(e){this.isSpanned=!1,this.isRowSpanned=!1,B.merge(this,e)}Kr.prototype.render=function(e,t,i,n){for(var r,s,o=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(t.cells[parseInt(i.toString(),10)].cellType||O.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(),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},Kr.prototype.backupMergeCells=function(e,t,i){this.setMergeCells(this.generteKey(e,t),i)},Kr.prototype.generteKey=function(e,t){return e+"__"+t.toString()},Kr.prototype.splitKey=function(e){return e.split("__")},Kr.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},Kr.prototype.getMergeCells=function(){return this.parent.mergeCells},Kr.prototype.setMergeCells=function(e,t){this.parent.mergeCells[""+e]=t},Kr.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},Kr.prototype.getIndexFromAllColumns=function(i){return _l(this.parent.getVisibleColumns(),function(e,t){if(e.field===i)return t})[0]};var Wr=Kr;function Kr(e,t){this.serviceLocator=e,this.parent=t}var b="e-rowcell",Qr="e-gridheader",Xr="e-gridcontent",Yr="e-gridfooter",Jr="e-headercontent",Zr="e-movablecontent",$r="e-movableheader",es="e-frozencontent",ts="e-frozenheader",is="e-content",ns="e-table",I="e-row",rs="e-gridchkbox",ss="e-editedrow",os="e-addedrow",as="e-groupcaptionrow",ls="changedRecords",hs="addedRecords",ps="deletedRecords",ds="Left-Right",cs="frozen-right",us="frozen-left",gs="aria-colindex",x="aria-rowindex",z="tbody",fs="colgroup",ms="open",ys="change",Ss="focus",vs="created",Cs="beforeOpen",ws="downArrow",bs="upArrow",Is="PageDown",xs="enter",Rs="shiftEnter",Ts="initialFrozenColumnIndex",Es=(Ds.prototype.render=function(e,t,i,n,r){return this.refreshRow(e,t,i,n,r)},Ds.prototype.refresh=function(e,t,i,n,r){var s=this,o=(i&&(e.data=Vh({},e.changes),this.refreshMergeCells(e)),this.parent.element.querySelector("[data-uid="+e.uid+"]")),e=this.refreshRow(e,t,n,r,null,i),n=[].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)}},Ds.prototype.refreshRow=function(y,e,t,i,n,S){for(var v=B.isNullOrUndefined(n)?this.element.cloneNode():n,n={data:y.data},C={data:y.data},r=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],s=!1,w=this.parent.isFrozenGrid(),b=!0,r=(r&&(s=qh(r.field,n.data)),this.parent.getSelectedRowIndexes()),I=(y.isDataRow&&(y.isSelected=-1<r.indexOf(y.index)||s),y.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(y.isSelected=!0,-1===r.indexOf(y.index))&&r.push(y.index),this.buildAttributeFromRow(v,y),B.attributes(v,B.extend({},t,{})),Ql(v,y.attributes),this.serviceLocator.getService("cellRendererFactory")),x=this,o=0,a=y.cells.length;o<a;o++)!function(t){var i=y.cells[parseInt(t.toString(),10)],e=(i.isSelected=y.isSelected,i.isColumnSelected=i.column.isSelected,I.getCellRenderer(y.cells[parseInt(t.toString(),10)].cellType||O.CellType.Data)),n={index:B.isNullOrUndefined(y.index)?"":y.index.toString()},r=(y.isExpand&&y.cells[parseInt(t.toString(),10)].cellType===O.CellType.DetailExpand&&(n.class=x.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand"),!x.parent.enableRtl&&x.parent.groupSettings&&b&&x.parent.groupSettings.columns.length&&("Vertical"===x.parent.gridLines||"Both"===x.parent.gridLines)),s=e.render(y.cells[parseInt(t.toString(),10)],y.data,n,y.isExpand,S);if(y.cells[parseInt(t.toString(),10)].cellType!==O.CellType.Filter){if(y.cells[parseInt(t.toString(),10)].cellType===O.CellType.Data||y.cells[parseInt(t.toString(),10)].cellType===O.CellType.CommandColumn){i.visible&&r&&(s.classList.add("e-grid-group-first-cell"),b=!1);var o,a,l,h,p,e=x.parent.parentDetails&&x.parent.parentDetails.parentInstObj&&x.parent.parentDetails.parentInstObj.isReact,n=x.parent.printGridParent&&x.parent.printGridParent.isReact,e=((x.parent.isReact&&x.parent.requireTemplateRef||e&&x.parent.parentDetails.parentInstObj.requireTemplateRef||n&&x.parent.printGridParent.requireTemplateRef)&&i.isTemplate?(o=x).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(C,{cell:s,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:y.cells[parseInt(t.toString(),10)].foreignKeyData,requestType:o.parent.requestTypeAction}))}):x.parent.trigger(re,B.extend(C,{cell:s,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:y.cells[parseInt(t.toString(),10)].foreignKeyData,requestType:x.parent.requestTypeAction})),!1);if(0<y.index&&(x.isSpan||x.parent.isSpan&&S)&&(a=x.parent.getRowsObject(),l=(0<x.parent.groupSettings.columns.length&&!a[y.index-1].isDataRow?a[y.index]:a[y.index-1]).cells,e=(h=l.filter(function(e){return e.column.uid===y.cells[parseInt(t.toString(),10)].column.uid})[0]).isRowSpanned||1<h.rowSpanRange),1<C.rowSpan||1<C.colSpan)if(x.resetrowSpanvalue(x.parent.frozenRows>y.index?x.parent.frozenRows:x.parent.currentViewData.length,C,y.index),!1===C.column.visible)C.colSpan=1;else if(w){var d=x.parent.getColumns(),n=x.parent.getFrozenRightColumnsCount(),c=x.parent.getFrozenLeftCount(),n=d.length-n,u=C.column.index;if(u<c&&c<u+C.colSpan){var g=u+C.colSpan-c;C.colSpan=C.colSpan-g}else if(n<=u&&d.length<u+C.colSpan){var g=u+C.colSpan-d.length;C.colSpan=C.colSpan-g}else if("Fixed"===C.column.freeze){for(var g=1,f=u,m=f+1;m<f+C.colSpan&&"Fixed"===d[parseInt(m.toString(),10)].freeze;m++)g++;C.colSpan=g}else u<n&&n<u+C.colSpan&&(g=u+C.colSpan-n,C.colSpan=C.colSpan-g)}(1<C.colSpan||1<y.cells[parseInt(t.toString(),10)].cellSpan||1<C.rowSpan||e)&&(x.parent.isSpan=!0,x.isSpan=!0,s=(p=new Wr(x.serviceLocator,x.parent)).render(C,y,t,s),w)&&yp(x.parent,C.column,s,C.colSpan)}(i.cellType===O.CellType.Header||i.cellType===O.CellType.StackedHeader)&&r&&(i.visible||i.cellType===O.CellType.StackedHeader)&&(c=x.parent.getVisibleColumns(),i.column.type&&"checkbox"===i.column.type||i.cellType===O.CellType.Header&&i.column.field&&c.length&&c[0].field===i.column.field||i.cellType===O.CellType.StackedHeader)&&(s.classList.add("e-grid-group-first-cell"),b=!1),i.cellType===O.CellType.Header&&(1<y.cells[parseInt(t.toString(),10)].colSpan||1<y.cells[parseInt(t.toString(),10)].rowSpan)&&(p=new Wr(x.serviceLocator,x.parent),s=p.render(y.cells[parseInt(t.toString(),10)],y,t,s)),x.isSpan&&(a=x.parent.getRowsObject(),u=x.parent.enableRtl,a[y.index-1])&&(h=(l=a[y.index-1].cells)[t-1],n=l[parseInt(t.toString(),10)],e=l[t+1],r=l[parseInt(t.toString(),10)].column.freeze,h&&(h.isRowSpanned||1<h.rowSpanRange)&&h.visible&&(u||n.isRowSpanned&&!(h.rowSpanRange>n.rowSpanRange)||s.classList.add("e-rowcell-firstchild"),w)&&("Fixed"===h.column.freeze&&"Fixed"===r?s.classList.add(u?"e-removefreezerightborder":"e-removefreezeleftborder"):u||1!==t||"Left"!==r||s.classList.add("e-addfreezefirstchildborder")),e)&&(e.isRowSpanned||1<e.rowSpanRange)&&e.visible&&(u&&(!n.isRowSpanned||e.rowSpanRange>n.rowSpanRange)&&s.classList.add("e-rowcell-lastchild"),w)&&"Fixed"===e.column.freeze&&"Fixed"===r&&C.colSpan<2&&s.classList.add(u?"e-removefreezeleftborder":"e-removefreezerightborder"),1<C.rowSpan&&x.parent.currentViewData.length-y.index===C.rowSpan&&s.classList.add("e-row-span-lastrowcell"),y.cells[parseInt(t.toString(),10)].isSpanned||v.appendChild(s)}}(o);var l=0;if(this.parent.groupSettings.columns.length&&this.parent.getFrozenLeftColumnsCount()){if(v.classList.contains("e-groupcaptionrow")){s=[].slice.call(v.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"]),v.querySelector(".e-summarycell"))Zh(v,this.parent);else{for(var h,p,d=0;d<v.childNodes.length;d++)(c=v.childNodes[parseInt(d.toString(),10)]).classList.add("e-leftfreeze"),mp(c,30*d,this.parent.enableRtl,"Left"),c.classList.contains("e-groupcaption")&&(h=parseInt(c.getAttribute("colspan"),10),p=Jh(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"}}),v.appendChild(c))}}if((v.querySelectorAll(".e-leftfreeze").length||v.classList.contains("e-columnheader"))&&(v.querySelectorAll(".e-indentcell").length||v.querySelectorAll(".e-grouptopleftcell").length))for(var c=v.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),o=0;o<c.length;o++)c[parseInt(o.toString(),10)].classList.add("e-leftfreeze"),mp(c[parseInt(o.toString(),10)],30*o,this.parent.enableRtl,"Left")}var u,g,f,m,R={row:v,rowHeight:this.parent.rowHeight};if(y.isDataRow&&((u=B.extend(n,R)).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||(y.isSelectable=u.isSelectable,g.disableRowSelection(g,y,R,u))}):this.parent.trigger(ne,u),y.isSelectable=u.isSelectable,s=this.parent.isRowDragable(),this.parent.allowPaging&&this.parent.selectionSettings.persistSelection&&(f=this.parent.getPrimaryKeyFieldNames()[0],m=y.data?y.data[""+f]:null,(r=u.isSelectable?this.parent.partialSelectedRecords:this.parent.disableSelectedRecords).some(function(e){return e[""+f]===m})||r.push(y.data)),u.isSelectable||this.disableRowSelection(this,y,R,u),this.parent.childGrid||s||this.parent.detailTemplate)&&(c=v.querySelectorAll(".e-rowcell:not(.e-hide)")[0])&&c.classList.add("e-detailrowvisible"),this.parent.enableVirtualization&&(n.rowHeight=this.parent.rowHeight),n.rowHeight?v.style.height=n.rowHeight+"px":this.parent.rowHeight&&(v.querySelector(".e-headercell")||v.querySelector(".e-groupcaption"))&&(v.style.height=this.parent.rowHeight+"px"),y.cssClass&&v.classList.add(y.cssClass),y.lazyLoadCssClass&&v.classList.add(y.lazyLoadCssClass),"Vertical"!==this.parent.rowRenderingMode||!this.parent.allowTextWrap||"Header"!==this.parent.textWrapSettings.wrapMode&&"Both"!==this.parent.textWrapSettings.wrapMode||v.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 T,E;this.parent.aggregates[parseInt(o.toString(),10)].properties.columns[0].footerTemplate&&(T=[].slice.call(v.getElementsByClassName("e-summarycell"))).length&&(E=T[T.length-1],B.addClass([E],["e-lastsummarycell"]),E=T[0],B.addClass([E],["e-firstsummarycell"]))}return v},Ds.prototype.resetrowSpanvalue=function(e,t,i){i<e&&e<i+t.rowSpan&&(i=i+t.rowSpan-e,t.rowSpan=t.rowSpan-i)},Ds.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"])},Ds.prototype.refreshMergeCells=function(e){for(var t=0,i=e.cells;t<i.length;t++)i[t].isSpanned=!1;return e},Ds.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,Ql(e,i)},Ds);function Ds(e,t,i){this.isSpan=!1,this.cellType=t,this.serviceLocator=e,this.parent=i,this.element=this.parent.createElement("tr",{attrs:{role:"row"}})}As.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},As.prototype.ensureColumns=function(){var e,t=[];return(this.parent.detailTemplate||this.parent.childGrid)&&(this.parent.notify(ln,e={}),t.push(this.generateCell(e,null,O.CellType.DetailExpand))),this.parent.isRowDragable()&&t.push(this.generateCell({},null,O.CellType.RowDragIcon)),t},As.prototype.generateRow=function(e,t,i,n,r,s,o){var a={foreignKeyData:{}},e=(a.uid=oh("grid-row"),a.data=e,a.index=t,a.indent=n,a.tIndex=s,a.isDataRow=!0,a.parentGid=r,a.parentUid=o,this.parent.isPrinting&&("All"===this.parent.hierarchyPrintMode?a.isExpand=!0:"Expanded"===this.parent.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[parseInt(t.toString(),10)]&&(a.isExpand=this.parent.expandedRows[parseInt(t.toString(),10)].isExpand)),a.cssClass=i,a.isAltRow=!!this.parent.enableAltRow&&t%2!=0,a.isAltRow=!!this.parent.enableAltRow&&t%2!=0,a.isSelected=-1<this.parent.getSelectedRowIndexes().indexOf(t),this.refreshForeignKeyRow(a),this.ensureColumns()),n=new jr(a,this.parent);return n.cells="Right"===this.parent.getFrozenMode()?this.generateCells(a).concat(e):e.concat(this.generateCells(a)),n},As.prototype.refreshForeignKeyRow=function(e){for(var t=this.parent.getForeignKeyColumns(),i=0;i<t.length;i++)B.setValue(t[parseInt(i.toString(),10)].field,Lh(t[parseInt(i.toString(),10)],e.data),e.foreignKeyData)},As.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:O.CellType.CommandColumn,null,n,e.foreignKeyData));return i},As.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)?O.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 Gr(t)},As.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},As.prototype.getInfiniteIndex=function(e){return"infiniteScroll"===e.requestType||"delete"===e.requestType||"add"===e.action?B.isNullOrUndefined(e.startIndex)?e.index:e.startIndex:0};var Os=As;function As(e){this.parent=e}Fs=function(e,t){return(Fs=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 Fs,e=function(e,t){function i(){this.constructor=e}Fs(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ks=(Ms.prototype.getData=function(){for(var t=this,e=[],i=this.parent.aggregates.slice(),n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)].columns.filter(function(e){return!(e.footerTemplate||e.groupFooterTemplate||e.groupCaptionTemplate)||t.columnSelector(e)});r.length&&e.push({columns:r})}return e},Ms.prototype.columnSelector=function(e){return void 0!==e.footerTemplate},Ms.prototype.getColumns=function(e){var t=[];if(!this.parent.detailTemplate&&B.isNullOrUndefined(this.parent.childGrid)||t.push(new Q({})),this.parent.allowGrouping)for(var i=0;i<this.parent.groupSettings.columns.length;i++)t.push(new Q({}));return this.parent.isRowDragable()&&!e&&t.push(new Q({})),t.push.apply(t,this.parent.getColumns()),t},Ms.prototype.generateRows=function(e,t,i,n,r){if(0===e.length&&(void 0===t||!t.count&&!t.loadSummaryOnEmpty))return[];for(var s=this.buildSummaryData(e,t),o=[],a=this.getData(),l=0;l<a.length;l++)o.push(this.getGeneratedRow(a[parseInt(l.toString(),10)],s[parseInt(l.toString(),10)],t?t.level:void 0,i,n,t?t.parentUid:void 0,r));return o},Ms.prototype.getGeneratedRow=function(e,t,i,n,r,s,o){for(var a=[],l=this.getIndentByLevel(),h=!B.isNullOrUndefined(this.parent.childGrid),p=this.parent.getIndentCount(),d=(this.parent.groupSettings.columns.length&&this.parent.allowRowDragAndDrop?l.push("e-indentcelltop"):this.parent.isRowDragable()&&!n&&(l=["e-indentcelltop"]),o||this.getColumns(n)),c=0;c<d.length;c++)a.push(this.getGeneratedCell(d[parseInt(c.toString(),10)],e,p<=c?this.getCellType():0===c&&this.parent.childGrid?O.CellType.DetailFooterIntent:O.CellType.Indent,l[parseInt(c.toString(),10)],h));o=new jr({data:t,attributes:{class:"e-summaryrow"}});return o.cells=a,o.uid=oh("grid-row"),o.parentUid=s,o.isAggregateRow=!0,o.visible=a.some(function(e){return e.isDataCell&&e.visible}),o},Ms.prototype.getGeneratedCell=function(t,e,i,n,r){var e=e.columns.filter(function(e){return e.columnName===t.field})[0],s={"e-mappinguid":t.uid,index:t.index},o=(t.textAlign&&(o={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"})[t.textAlign.toLowerCase()]&&(s.class=o[t.textAlign.toLowerCase()]),n&&(s.class=n),B.isNullOrUndefined(n)&&r&&(s.class="e-detailindentcelltop"),{visible:t.visible,isDataCell:!B.isNullOrUnd