1"use strict";(self.webpackChunksoneta_pckg=self.webpackChunksoneta_pckg||[]).push([[3277],{449191:function(e,t,i){i.d(t,{x:function(){return u}});var n=i(115238),r=i(925881),a=i(455904),s=i(746880),l=i(914002),o=i(182196),d=i(978389),c=i(276305),h=i(229919),p=i(590820),g=i(46470),u=function(){function e(e,t,i){this.cellDetails={},this.originalCell={},this.cloneCell={},this.editNext=!1,this.preventSaveCell=!1,this.initialRender=!0,this.validationColObj=[],this.addBatchRow=!1,this.prevEditedBatchCell=!1,this.parent=e,this.serviceLocator=t,this.renderer=i,this.focus=t.getService("focus"),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:s.jMr,handler:this.clickHandler},{event:s.lVf,handler:this.dblClickHandler},{event:s.BzX,handler:this.onBeforeCellFocused},{event:s.uJh,handler:this.onCellFocused},{event:s.jnc,handler:this.dblClickHandler},{event:s._ld,handler:this.keyDownHandler},{event:s.lJd,handler:this.editNextValCell},{event:s.zrj,handler:this.destroy}],(0,a.yc)(this.parent,this.evtHandlers,!0,this),n.Jm.add(this.parent.element,"mousedown",this.mouseDownHandler,this),this.dataBoundFunction=this.dataBound.bind(this),this.batchCancelFunction=this.batchCancel.bind(this),this.parent.addEventListener(s.BPR,this.dataBoundFunction),this.parent.addEventListener(s.X5v,this.batchCancelFunction))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||((0,a.yc)(this.parent,this.evtHandlers,!1),n.Jm.remove(this.parent.element,"mousedown",this.mouseDownHandler),this.parent.removeEventListener(s.BPR,this.dataBoundFunction),this.parent.removeEventListener(s.X5v,this.batchCancelFunction))},e.prototype.batchCancel=function(){this.parent.focusModule.restoreFocus()},e.prototype.dataBound=function(){this.parent.notify(s.VxU,{})},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.mouseDownHandler=function(e){(0,n.hX)(this.parent.element.querySelector(".e-gridform"))?this.mouseDownElement=void 0:this.mouseDownElement=e.target},e.prototype.clickHandler=function(e){(0,a.oC)(e.target,this.parent.element.id+"_add",!0)||((this.parent.isEdit&&(0,n.kp)(this.form,"td")!==(0,n.kp)(e.target,"td")&&(0,n.hX)(this.mouseDownElement)||this.mouseDownElement===e.target)&&(this.saveCell(),this.editNextValCell()),(0,a.oC)(e.target,g.Jt)&&!this.parent.isEdit&&this.setCellIdx(e.target))},e.prototype.dblClickHandler=function(e){var t=(0,a.oC)(e.target,g.Jt),i=(0,a.oC)(e.target,g.nM),r=i&&parseInt(i.getAttribute(g.bB),10),s=t&&parseInt(t.getAttribute(g.Pc),10);(0,n.hX)(t)||(0,n.hX)(r)||isNaN(s)||t.parentElement.classList.contains(g.QF)||!this.parent.getColumns()[parseInt(s.toString(),10)].allowEditing||this.editCell(r,this.parent.getColumns()[parseInt(s.toString(),10)].field,this.isAddRow(r))},e.prototype.onBeforeCellFocused=function(e){this.parent.isEdit&&this.validateFormObj()&&(e.byClick||["tab","shiftTab","enter","shiftEnter"].indexOf(e.keyArgs.action)>-1)&&(e.cancel=!0,e.byClick?e.clickArgs.preventDefault():e.keyArgs.preventDefault())},e.prototype.onCellFocused=function(e){var t=!(e.container.isContent&&e.container.isDataCell||this.parent.frozenRows&&e.container.isHeader);if(this.parent.focusModule.active&&(this.prevEditedBatchCell=this.parent.focusModule.active.matrix.current.toString()===this.prevEditedBatchCellMatrix().toString(),this.crtRowIndex=[].slice.call(this.parent.focusModule.active.getTable().rows).indexOf((0,n.kp)(e.element,"tr"))),e.byKey&&!t){var i=e.container.indexes,r=i[0],a=i[1],s=e.element.getAttribute("data-colindex")?parseInt(e.element.getAttribute("data-colindex")):a;s!==a&&(a=s),this.parent.frozenRows&&e.container.isContent&&(r+=(this.parent.getContent().querySelector(".e-hiddenrow")?0:this.parent.frozenRows)+this.parent.getHeaderContent().querySelectorAll(".e-insertedrow").length);var l=this.parent.isEdit;if(!this.parent.element.getElementsByClassName("e-popup-open").length)switch(l=l&&!this.validateFormObj(),e.keyArgs.action){case"tab":case"shiftTab":var o=this.parent.isRowDragable()&&this.parent.isDetail()?2:this.parent.isRowDragable()||this.parent.isDetail()?1:0,d=this.parent.getColumns()[a-o];d&&!this.parent.isEdit&&this.editCell(r,d.field),(l||this.parent.isLastCellPrimaryKey)&&this.editCellFromIndex(r,a);break;case"enter":case"shiftEnter":e.keyArgs.preventDefault();var c={cancel:!1,keyArgs:e.keyArgs};this.parent.notify("beforeFocusCellEdit",c),!c.cancel&&l&&this.editCell(r,this.cellDetails.column.field);break;case"f2":this.editCellFromIndex(r,a),this.focus.focus()}}else this.parent.isEdit&&t&&this.saveCell()},e.prototype.isAddRow=function(e){return this.parent.getDataRows()[parseInt(e.toString(),10)].classList.contains("e-insertedrow")},e.prototype.editCellFromIndex=function(e,t){this.cellDetails.rowIndex=e,this.cellDetails.cellIndex=t,this.editCell(e,this.parent.getColumns()[parseInt(t.toString(),10)].field,this.isAddRow(e))},e.prototype.closeEdit=function(){var e=this.parent,t=this.parent.getRowsObject(),i={cancel:!1,batchChanges:this.getBatchChanges()};if(e.notify(s.auS,i),!i.cancel){e.isEdit&&this.saveCell(!0),this.isAdded=!1,e.clearSelection();for(var n=0;n<t.length;n++){var r,a=t[parseInt(n.toString(),10)].isDirty;(r=this.removeBatchElementChanges(t[parseInt(n.toString(),10)],a))&&t.splice(n,1),r&&n--}e.getContentTable().querySelector("tr.e-row")||e.renderModule.renderEmptyRow();var l=this.parent.getRowsObject();e.notify(s.X5v,{rows:this.parent.getRowsObject().length?this.parent.getRowsObject():[new d.f({isDataRow:!0,cells:[new c.f({isDataCell:!0,visible:!0})]})]}),e.selectRow(this.cellDetails.rowIndex),this.refreshRowIdx(),e.notify(s.VxU,{}),this.parent.notify(s.YAh,{}),l={requestType:"batchCancel",rows:this.parent.getRowsObject()},e.trigger(s.X5v,l)}},e.prototype.removeBatchElementChanges=function(e,t){var i=this.parent,r=new l.k(this.serviceLocator,null,this.parent),o=!1;if(t){e.isDirty=t;var d=i.getRowElementByUID(e.uid);if(d&&(d.classList.contains("e-insertedrow")?((0,n.TF)(d),o=!0):((0,a.AZ)(e,this.parent.getForeignKeyColumns(),e.data),delete e.changes,delete e.edit,e.isDirty=!1,(0,n.pP)(d,[],["e-hiddenrow","e-updatedtd"]),r.refresh(e,i.getColumns(),!1)),this.parent.aggregates.length>0)){var c=[];c.type="cancel",this.parent.notify(s.whj,c),this.parent.groupSettings.columns.length>0&&this.parent.notify(s.a_A,c)}}return o},e.prototype.deleteRecord=function(e,t){this.saveCell(),this.validateFormObj()&&this.saveCell(!0),this.isAdded=!1,this.bulkDelete(e,t),this.parent.aggregates.length>0&&(this.parent.notify(s.whj,{}),this.parent.groupSettings.columns.length>0&&this.parent.notify(s.a_A,{}))},e.prototype.addRecord=function(e){this.bulkAddRow(e)},e.prototype.endEdit=function(){this.parent.isEdit&&this.validateFormObj()||this.batchSave()},e.prototype.validateFormObj=function(){return this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate()},e.prototype.batchSave=function(){var e=this.parent,t="deletedRecords";if(e.isCheckBoxSelection){var i=e.element.querySelector(".e-checkselectall").parentElement;i.classList.contains("e-checkbox-disabled")&&e.pageSettings.totalRecordsCount>e.currentViewData.length&&(0,n.vy)([i],["e-checkbox-disabled"])}if(this.saveCell(),!(e.isEdit||this.editNextValCell()||e.isEdit)){var r=this.getBatchChanges();"Multiple"===this.parent.selectionSettings.type&&r[""+t].length&&this.parent.selectionSettings.persistSelection&&(r[""+t]=this.removeSelectedData,this.removeSelectedData=[]);var a={changedRecords:this.parent.getRowsObject().filter(function(e){return e.isDirty&&-1===["add","delete"].indexOf(e.edit)}).map(function(e){return e.data})},l={batchChanges:r,cancel:!1};e.trigger(s.roB,l,function(t){t.cancel||(e.showSpinner(),e.notify(s.WyP,{changes:r,original:a}))})}},e.prototype.getBatchChanges=function(){for(var e={addedRecords:[],deletedRecords:[],changedRecords:[]},t=0,i=this.parent.getRowsObject();t<i.length;t++){var n=i[t];if(n.isDirty)switch(n.edit){case"add":e.addedRecords.push(n.changes);break;case"delete":e.deletedRecords.push(n.data);break;default:e.changedRecords.push(n.changes)}}return e},e.prototype.removeRowObjectFromUID=function(e){for(var t=this.parent.getRowsObject(),i=0,n=t.length;i<n&&t[parseInt(i.toString(),10)].uid!==e;i++);t.splice(i,1)},e.prototype.addRowObject=function(e){var t=this.parent,i="Top"===t.editSettings.newRowPosition,n=e.clone();i?t.getRowsObject().unshift(n):t.getRowsObject().push(n)},e.prototype.bulkDelete=function(e,t){var i=this;this.removeSelectedData=[];var r=this.parent,a=r.selectedRowIndex,l=r.getSelectedRows(),o={primaryKey:this.parent.getPrimaryKeyFieldNames(),rowIndex:a,rowData:t||r.getSelectedRecords()[0],cancel:!1};o.row=t?r.editModule.deleteRowUid?r.getRowElementByUID(r.editModule.deleteRowUid):r.getRows()[r.getCurrentViewRecords().indexOf(t)]:l[0],o.row&&r.trigger(s.DJw,o,function(e){if(!e.cancel){if(i.removeSelectedData=r.getSelectedRecords(),r.clearSelection(),e.row=e.row?e.row:t?r.getRows()[parseInt(a.toString(),10)]:l[0],1===l.length||t){var o=e.row.getAttribute("data-uid");if(o=t&&i.parent.editModule.deleteRowUid?o=i.parent.editModule.deleteRowUid:o,e.row.classList.contains("e-insertedrow"))i.removeRowObjectFromUID(o),(0,n.TF)(e.row);else{var d=r.getRowObjectFromUID(o);d.isDirty=!0,d.edit="delete",(0,n.pP)(e.row,["e-hiddenrow","e-updatedtd"],[]),r.frozenRows&&a<r.frozenRows&&r.getDataRows().length>=r.frozenRows&&r.getHeaderTable().querySelector(g.T_).appendChild(r.getRowByIndex(r.frozenRows-1))}delete e.row}else{t&&(a=parseInt(e.row.getAttribute(g.bB),10));for(var c=0;c<l.length;c++){var h=l[parseInt(c.toString(),10)].getAttribute("data-uid");if(l[parseInt(c.toString(),10)].classList.contains("e-insertedrow"))i.removeRowObjectFromUID(h),(0,n.TF)(l[parseInt(c.toString(),10)]);else{(0,n.pP)(l[parseInt(c.toString(),10)],["e-hiddenrow","e-updatedtd"],[]);var p=r.getRowObjectFromUID(h);p.isDirty=!0,p.edit="delete",delete l[parseInt(c.toString(),10)],r.frozenRows&&a<r.frozenRows&&r.getDataRows().length>=r.frozenRows&&r.getHeaderTable().querySelector(g.T_).appendChild(r.getRowByIndex(r.frozenRows-1))}}}i.refreshRowIdx(),t&&(r.editModule.deleteRowUid=void 0),r.isCheckBoxSelection||r.selectRow(a),r.trigger(s.yip,e),r.notify(s.yip,{rows:i.parent.getRowsObject()}),r.notify(s.VxU,{})}})},e.prototype.refreshRowIdx=function(){for(var e=this.parent,t=e.getAllDataRows(!0),i=e.getRowsObject().filter(function(e){return!e.isDetailRow}),n=0,r=0,a=t.length;n<a;n++)t[parseInt(n.toString(),10)].classList.contains(g.nM)&&!t[parseInt(n.toString(),10)].classList.contains("e-hiddenrow")?(t[parseInt(n.toString(),10)].setAttribute(g.bB,r.toString()),t[parseInt(n.toString(),10)].setAttribute(g.E3,(r+1).toString()),i[parseInt(n.toString(),10)].index=r,r++):(t[parseInt(n.toString(),10)].removeAttribute(g.bB),t[parseInt(n.toString(),10)].removeAttribute(g.E3),i[parseInt(n.toString(),10)].index=-1)},e.prototype.bulkAddRow=function(e){var t=this,i=this.parent;if(i.editSettings.allowAdding){if(i.isEdit&&(this.saveCell(),this.parent.notify(s.lJd,{})),this.initialRender){for(var o=i.getVisibleColumns(),d=0;d<o.length;
1d++)if(o[parseInt(d.toString(),10)].validationRules&&o[parseInt(d.toString(),10)].validationRules.required){var p={field:o[parseInt(d.toString(),10)].field.slice(),cellIdx:d};this.validationColObj.push(p)}this.initialRender=!1}this.parent.element.classList.add("e-editing");var u={defaultData:e||this.getDefaultData(),primaryKey:i.getPrimaryKeyFieldNames(),cancel:!1};i.trigger(s.rdj,u,function(o){if(!o.cancel){t.isAdded=!0,i.clearSelection();var d,p,u=new l.k(t.serviceLocator,null,t.parent),f=new h.Z(t.parent).generateRows([o.defaultData]),w=u.render(f[0],i.getColumns());(0,a.oW)(w);for(var v=0;v<t.parent.groupSettings.columns.length;v++)w.insertBefore(t.parent.createElement("td",{className:"e-indentcell"}),w.firstChild),f[0].cells.unshift(new c.f({cellType:r.vZ.Indent}));var m=i.getContentTable().querySelector(g.T_);if(w.classList.add("e-insertedrow"),m.querySelector(".e-emptyrow")){var y=m.querySelector(".e-emptyrow");y.parentNode.removeChild(y),i.frozenRows&&i.element.querySelector(".e-frozenrow-empty")&&i.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty")}m=i.frozenRows&&"Top"===i.editSettings.newRowPosition?i.getHeaderTable().querySelector(g.T_):i.getContentTable().querySelector(g.T_),"Top"===t.parent.editSettings.newRowPosition?m.insertBefore(w,m.firstChild):m.appendChild(w),(0,n.iQ)([].slice.call(w.getElementsByClassName(g.Jt)),["e-updatedtd"]),f[0].isDirty=!0,f[0].changes=(0,n.X$)({},{},f[0].data,!0),f[0].edit="add",t.addRowObject(f[0]),t.refreshRowIdx(),t.focus.forgetPrevious(),i.notify(s.QO1,{rows:t.parent.getRowsObject()});var C=t.getBatchChanges(),b=t.getBottomIndex();"Top"===t.parent.editSettings.newRowPosition?i.selectRow(0):i.selectRow(b),e||(p=t.findNextEditableCell(0,!0),d=i.getColumns()[parseInt(p.toString(),10)],"Top"===t.parent.editSettings.newRowPosition?t.editCell(0,d.field,!0):t.editCell(b,d.field,!0)),t.parent.aggregates.length>0&&(e||C[g.V0].length)&&t.parent.notify(s.whj,{});var R={defaultData:o.defaultData,row:w,columnObject:d,columnIndex:p,primaryKey:o.primaryKey,cell:(0,n.hX)(p)?void 0:w.cells[parseInt(p.toString(),10)]};i.trigger(s.QO1,R)}})}else i.isEdit&&this.saveCell()},e.prototype.findNextEditableCell=function(e,t,i){for(var r,a=this.parent.getColumns(),s=a.length,l=e;l<s;l++)if(r=!!i&&(0,n.hX)(a[parseInt(l.toString(),10)].validationRules),t&&(!a[parseInt(l.toString(),10)].template||a[parseInt(l.toString(),10)].field)&&a[parseInt(l.toString(),10)].allowEditing&&a[parseInt(l.toString(),10)].visible&&(!a[parseInt(l.toString(),10)].isIdentity||!a[parseInt(l.toString(),10)].isPrimaryKey)&&!r)return l;return-1},e.prototype.getDefaultData=function(){for(var e={},t={number:0,string:null,boolean:!1,date:null,datetime:null},i=0,r=this.parent.columnModel;i<r.length;i++){var a=r[i];a.field&&(0,n.KY)(a.field,Object.keys(a).indexOf("defaultValue")>=0?a.defaultValue:t[a.type],e)}return e},e.prototype.setCellIdx=function(e){var t=0;this.parent.allowGrouping&&(t=this.parent.groupSettings.columns.length),this.cellDetails.cellIndex=e.cellIndex-t,this.cellDetails.rowIndex=parseInt(e.getAttribute("index"),10)},e.prototype.editCell=function(e,t,i){var n=this.parent,r=n.getColumnByField(t);this.index=e,this.field=t,this.isAdd=i;var a=n.isEdit&&!(this.cellDetails.column.field===t&&this.cellDetails.rowIndex===e&&this.parent.getDataRows().length-1!==e&&this.prevEditedBatchCell);n.editSettings.allowEditing&&(!a&&(r.allowEditing||!r.allowEditing&&n.focusModule.active&&n.focusModule.active.getTable().rows[this.crtRowIndex]&&n.focusModule.active.getTable().rows[this.crtRowIndex].classList.contains("e-insertedrow"))?this.editCellExtend(e,t,i):a&&(this.editNext=!0,this.saveCell()))},e.prototype.editCellExtend=function(e,t,i){var r=this,l=this.parent,o=l.getColumnByField(t),d=l.getPrimaryKeyFieldNames();if(!l.isEdit){var c=(0,n.X$)({},{},this.getDataByIndex(e),!0),h=l.getDataRows()[parseInt(e.toString(),10)];if(c=(0,n.X$)({},{},this.getDataByIndex(e),!0),d[0]===o.field&&!h.classList.contains("e-insertedrow")||o.columns||o.isPrimaryKey&&o.isIdentity||o.commands)this.parent.isLastCellPrimaryKey=!0;else{this.parent.isLastCellPrimaryKey=!1,this.parent.element.classList.add("e-editing");var p=l.getRowObjectFromUID(h.getAttribute("data-uid")),u=[].slice.apply(h.cells),f={columnName:o.field,isForeignKey:!(0,n.hX)(o.foreignKeyValue),primaryKey:d,rowData:c,validationRules:(0,n.X$)({},o.validationRules?o.validationRules:{}),value:(0,a.iM)(o.field,c),type:i?"add":"edit",cancel:!1,foreignKeyData:p&&p.foreignKeyData};f.cell=u[this.getColIndex(u,this.getCellIdx(o.uid))],f.row=h,f.columnObject=o,f.cell&&l.trigger(s.dWv,f,function(t){t.cancel||(t.cell=t.cell?t.cell:u[r.getColIndex(u,r.getCellIdx(o.uid))],t.row=t.row?t.row:h,t.columnObject=t.columnObject?t.columnObject:o,r.cellDetails={rowData:c,column:o,value:t.value,isForeignKey:t.isForeignKey,rowIndex:e,cellIndex:parseInt(t.cell.getAttribute(g.Pc),10),foreignKeyData:t.foreignKeyData},t.cell.classList.contains("e-updatedtd")&&(r.isColored=!0,t.cell.classList.remove("e-updatedtd")),l.isEdit=!0,l.clearSelection(),l.isCheckBoxSelection&&l.isPersistSelection||l.selectRow(r.cellDetails.rowIndex,!0),r.renderer.update(t),r.parent.notify(s.eOl,t),r.form=(0,n.Lt)("#"+l.element.i
1d+"EditForm",l.element),l.editModule.applyFormValidation([o]),r.parent.element.querySelector(".e-gridpopup").style.display="none")})}}},e.prototype.updateCell=function(e,t,i){var n=this.parent,r=n.getColumnByField(t),l=n.getColumnIndexByField(t);if(r&&!r.isPrimaryKey&&r.allowEditing){var o=(0,a.lK)(this.parent,r,e,l),d=n.getRowObjectFromUID(o.parentElement.getAttribute("data-uid"));if(n.isEdit||!d.changes&&(!(i instanceof Date)&&d.data[""+t]!==i||i instanceof Date&&new Date(d.data[""+t]).toString()!==new Date(i).toString())||d.changes&&(!(i instanceof Date)&&d.changes[""+t]!==i||i instanceof Date&&new Date(d.changes[""+t]).toString()!==new Date(i).toString())){this.refreshTD(o,r,d,i);var c=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;if((this.parent.isReact&&this.parent.requireTemplateRef||c&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&r.template){var h=this,p=this.newReactTd;h.parent.renderTemplates(function(){h.parent.trigger(s.B55,{cell:p||o,column:r,data:d.changes})})}else(this.parent.isReact||c)&&r.template?(this.parent.renderTemplates(),this.parent.trigger(s.B55,{cell:this.newReactTd||o,column:r,data:d.changes})):this.parent.trigger(s.B55,{cell:this.newReactTd||o,column:r,data:d.changes})}}},e.prototype.setChanges=function(e,t,i){if(e.changes||(e.changes=(0,n.X$)({},{},e.data,!0)),(0,n.hX)(t)||("string"==typeof i&&(i=this.parent.sanitize(i)),p.$.setValue(t,i,e.changes)),e.data[""+t]!==i){var r=this.parent.getColumnByField(t).type;"date"===r||"datetime"===r?new Date(e.data[""+t]).toString()!==new Date(i).toString()&&(e.isDirty=!0):e.isDirty=!0}},e.prototype.updateRow=function(e,t){for(var i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];this.updateCell(e,r,t[""+r])}},e.prototype.getCellIdx=function(e){var t=this.parent.getColumnIndexByUid(e)+this.parent.groupSettings.columns.length;return(0,n.hX)(this.parent.detailTemplate)&&(0,n.hX)(this.parent.childGrid)||t++,this.parent.isRowDragable()&&t++,t},e.prototype.refreshTD=function(e,t,i,r){var l=new o.w(this.parent,this.serviceLocator);r="number"!==t.type||(0,n.hX)(r)?r:parseFloat(r),i&&(this.setChanges(i,t.field,r),(0,a.AZ)(i,this.parent.getForeignKeyColumns(),i.changes));var d,c,h=i?i.cells:void 0;this.parent.isReact&&(d=e.parentElement,c=e.cellIndex);i&&l.refreshTD(e,h[this.getCellIdx(t.uid)-0],i.changes,{index:this.getCellIdx(t.uid)}),this.parent.isReact?(this.newReactTd=d.cells[parseInt(c.toString(),10)],d.cells[parseInt(c.toString(),10)].classList.add("e-updatedtd")):e.classList.add("e-updatedtd"),e.classList.add("e-updatedtd"),this.parent.notify(s.VxU,{})},e.prototype.getColIndex=function(e,t){var i=0;this.parent.allowGrouping&&this.parent.groupSettings.columns&&(i=this.parent.groupSettings.columns.length),(0,n.hX)(this.parent.detailTemplate)&&(0,n.hX)(this.parent.childGrid)||i++,this.parent.isRowDragable()&&i++;for(var r=0;r<e.length;r++){if(parseInt(e[parseInt(r.toString(),10)].getAttribute(g.Pc),10)===t-i)return r}return-1},e.prototype.editNextValCell=function(){var e=this.parent,t=e.element.querySelectorAll(".e-insertedrow"),i=1===t.length;if(i&&this.isAdded&&!e.isEdit){for(var n=this.getBottomIndex(),r=this.cellDetails.cellIndex;r<e.getColumns().length;r++){if(e.isEdit)return;var a=this.findNextEditableCell(this.cellDetails.cellIndex+1,!0,!0),l=e.getColumns()[parseInt(a.toString(),10)];if(l){if("Bottom"===this.parent.editSettings.newRowPosition)this.editCell(n,l.field,!0);else{var o={index:0,column:l};this.parent.notify(s.mUy,o),this.editCell(o.index,l.field,!0)}this.saveCell()}}e.isEdit||(this.isAdded=!1)}else if(!i&&this.isAdded&&!e.isEdit){if("Bottom"===e.editSettings.newRowPosition){var d=this.getBatchChanges();e.getCurrentViewRecords().length-d[g.S4].length}for(r=0;r<t.length&&!e.isEdit;r++)for(var c=0;c<this.validationColObj.length&&!e.isEdit;c++)""===t[parseInt(r.toString(),10)].querySelectorAll("td:not(.e-hide)")[this.validationColObj[parseInt(c.toString(),10)].cellIdx].innerHTML&&(this.editCell(parseInt(t[parseInt(r.toString(),10)].getAttribute("data-rowindex"),10),this.validationColObj[parseInt(c.toString(),10)].field),this.validateFormObj()&&this.saveCell());e.isEdit||(this.isAdded=!1)}},e.prototype.escapeCellEdit=function(){var e=this.generateCellArgs();e.value=e.previousValue,!e.value&&this.cellDetails.column.validationRules||this.successCallBack(e,e.cell.parentElement,e.column,!0)(e)},e.prototype.generateCellArgs=function(){var e=this.parent;this.parent.element.classList.remove("e-editing");var t=this.cellDetails.column,i={};i[t.field]=(0,a.iM)(t.field,this.cellDetails.rowData);var r=e.editModule.getCurrentEditedData(this.form,i),s=(0,n.X$)({},r);r=(0,n.X$)({},r,this.cellDetails.rowData);var l=(0,a.iM)(t.field,s);(0,n.hX)(t.field)||(0,n.b0)(l)||(0,n.KY)(t.field,l,r);var o={columnName:t.field,value:(0,a.iM)(t.field,r),rowData:this.cellDetails.rowData,column:t,previousValue:this.cellDetails.value,isForeignKey:this.cellDetails.isForeignKey,cancel:!1};return o.cell=this.form.parentElement,o.columnObject=t,o},e.prototype.saveCell=function(e){if(!this.preventSaveCell&&this.form){var t=this.parent;if(e||t.isEdit&&!this.validateFormObj()){this.preventSaveCell=!0;
1var i=this.generateCellArgs(),n=i.cell.parentElement,r=i.column;i.cell.removeAttribute("aria-label"),e?this.successCallBack(i,n,r)(i):(t.trigger(s.U$9,i,this.successCallBack(i,n,r)),t.notify(s.VcE,{formObj:this.form}))}}},e.prototype.successCallBack=function(e,t,i,r){var a=this;return function(e){var l=a.parent;if(e.cell=e.cell?e.cell:a.form.parentElement,e.columnObject=e.columnObject?e.columnObject:i,e.cancel){if(a.preventSaveCell=!1,a.editNext){if(a.editNext=!1,a.cellDetails.rowIndex===a.index&&a.cellDetails.column.field===a.field)return;a.editCellExtend(a.index,a.field,a.isAdd)}}else{l.editModule.destroyWidgets([i]),l.isEdit=!1,l.editModule.destroyForm(),a.parent.notify(s.YAh,{});var o=l.getRowObjectFromUID(t.getAttribute("data-uid"));if(a.refreshTD(e.cell,i,o,e.value),a.parent.isReact&&(e.cell=a.newReactTd),(0,n.vy)([t],[g.QF,"e-batchrow"]),(0,n.vy)([e.cell],["e-editedbatchcell","e-boolcell"]),(!(0,n.hX)(e.value)&&e.value.toString()===((0,n.hX)(a.cellDetails.value)?"":a.cellDetails.value).toString()&&!a.isColored||(0,n.hX)(e.value)&&(0,n.hX)(o.data[i.field])&&(0,n.hX)(a.cellDetails.value)&&!e.cell.parentElement.classList.contains("e-insertedrow"))&&e.cell.classList.remove("e-updatedtd"),(0,n.hX)(r)){var d=l.isReact&&i.template&&"string"!=typeof i.template,c=l.parentDetails&&l.parentDetails.parentInstObj&&l.parentDetails.parentInstObj.isReact;d||c?l.requireTemplateRef?l.renderTemplates(function(){l.trigger(s.Ipu,e)}):(l.renderTemplates(),l.trigger(s.Ipu,e)):l.trigger(s.Ipu,e)}if(l.notify(s.VxU,{}),a.isColored=!1,a.parent.aggregates.length>0&&(a.parent.isReact||a.parent.isVue||a.parent.notify(s.whj,{}),a.parent.groupSettings.columns.length>0&&!a.isAddRow(a.cellDetails.rowIndex)&&a.parent.notify(s.a_A,{}),(a.parent.isReact||a.parent.isVue)&&a.parent.notify(s.whj,{})),a.preventSaveCell=!1,a.editNext){if(a.editNext=!1,a.cellDetails.rowIndex===a.index&&a.cellDetails.column.field===a.field&&a.prevEditedBatchCell)return;var h=l.getColumnByField(a.field);h&&(h.allowEditing||!h.allowEditing&&l.focusModule.active&&l.focusModule.active.getTable().rows[a.crtRowIndex]&&l.focusModule.active.getTable().rows[a.crtRowIndex].classList.contains("e-insertedrow"))&&a.editCellExtend(a.index,a.field,a.isAdd)}r&&l.notify(s.Dyl,{})}}},e.prototype.prevEditedBatchCellMatrix=function(){var e=[],t=this.parent.focusModule.active.getTable().querySelector(".e-editedbatchcell");if(t){var i=t.parentElement;e=[[].slice.call(this.parent.focusModule.active.getTable().rows).indexOf(i),[].slice.call(i.cells).indexOf(t)]}return e},e.prototype.getDataByIndex=function(e){var t=this.parent.getRowObjectFromUID(this.parent.getDataRows()[parseInt(e.toString(),10)].getAttribute("data-uid"));return t.changes?t.changes:t.data},e.prototype.keyDownHandler=function(e){if(this.addBatchRow||("tab"===e.action||"shiftTab"===e.action)&&this.parent.isEdit){var t=this.parent,i=this.getBottomIndex(),n=(0,a.oC)(e.target,g.Jt);if(this.addBatchRow||n&&!this.parent.isReact){var r=void 0;if(n&&(r=n.querySelector(".e-field")),this.addBatchRow||r){var s=this.parent.getVisibleColumns(),l="tab"===e.action?s.length-1:0;(this.addBatchRow||s[parseInt(l.toString(),10)].field===r.getAttribute("id").slice(this.parent.element.id.length))&&(this.cellDetails.rowIndex===i&&"tab"===e.action?("Top"===t.editSettings.newRowPosition?(t.editSettings.newRowPosition="Bottom",this.addRecord(),t.editSettings.newRowPosition="Top"):this.addRecord(),this.addBatchRow=!1):this.saveCell())}}}},e.prototype.addCancelWhilePaging=function(){this.validateFormObj()&&(this.parent.notify(s.BxP,{}),this.parent.isEdit=!1,this.editNext=!1,this.mouseDownElement=void 0,this.isColored=!1)},e.prototype.getBottomIndex=function(){var e=this.getBatchChanges();return this.parent.getCurrentViewRecords().length+e[g.V0].length-e[g.S4].length-1},e}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.