Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-grids

Package Overview
Dependencies
15
Maintainers
3
Versions
357
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 24.2.9 to 25.1.35

styles/excel-filter/_bds-definition.scss

2

dist/global/index.d.ts
/*!
* filename: index.d.ts
* version : 24.2.9
* version : 25.1.35
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.

@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license.

{
"_from": "@syncfusion/ej2-grids@*",
"_id": "@syncfusion/ej2-grids@24.2.8",
"_id": "@syncfusion/ej2-grids@1.193.11",
"_inBundle": false,
"_integrity": "sha512-bsWcow6wAZCUe4X/1EjEVVdQ/0uiNjsGQT3aRtzWK3TVE2BowhUwBkENGj2QTz+BhFYIRltZ4BFFr7j2enFdwA==",
"_integrity": "sha512-jN+mAxU9LoX3cKESRPJ0xaPZoz3/w7e+OeTwvi/tuqr06Lf7nrKlbBbnBzKaN55DJ2D0bsMubeSisDIJgxsGqg==",
"_location": "/@syncfusion/ej2-grids",

@@ -31,6 +31,6 @@ "_phantomChildren": {},

],
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-grids/-/ej2-grids-24.2.8.tgz",
"_shasum": "d5b513c1161816d92676f37a5936f52e4d12238a",
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-grids/-/ej2-grids-1.193.11.tgz",
"_shasum": "cb1c540cadbc60c774bfc1834d40e883aa29e14d",
"_spec": "@syncfusion/ej2-grids@*",
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
"_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
"author": {

@@ -41,17 +41,17 @@ "name": "Syncfusion Inc."

"dependencies": {
"@syncfusion/ej2-base": "~24.2.7",
"@syncfusion/ej2-buttons": "~24.2.7",
"@syncfusion/ej2-calendars": "~24.2.9",
"@syncfusion/ej2-compression": "~24.2.3",
"@syncfusion/ej2-data": "~24.2.3",
"@syncfusion/ej2-dropdowns": "~24.2.9",
"@syncfusion/ej2-excel-export": "~24.2.4",
"@syncfusion/ej2-file-utils": "~24.2.3",
"@syncfusion/ej2-inputs": "~24.2.9",
"@syncfusion/ej2-lists": "~24.2.8",
"@syncfusion/ej2-navigations": "~24.2.8",
"@syncfusion/ej2-notifications": "~24.2.4",
"@syncfusion/ej2-pdf-export": "~24.2.3",
"@syncfusion/ej2-popups": "~24.2.9",
"@syncfusion/ej2-splitbuttons": "~24.2.7"
"@syncfusion/ej2-base": "~25.1.35",
"@syncfusion/ej2-buttons": "~25.1.35",
"@syncfusion/ej2-calendars": "~25.1.35",
"@syncfusion/ej2-compression": "~25.1.35",
"@syncfusion/ej2-data": "~25.1.35",
"@syncfusion/ej2-dropdowns": "~25.1.35",
"@syncfusion/ej2-excel-export": "~25.1.35",
"@syncfusion/ej2-file-utils": "~25.1.35",
"@syncfusion/ej2-inputs": "~25.1.35",
"@syncfusion/ej2-lists": "~25.1.35",
"@syncfusion/ej2-navigations": "~25.1.35",
"@syncfusion/ej2-notifications": "~25.1.35",
"@syncfusion/ej2-pdf-export": "~25.1.35",
"@syncfusion/ej2-popups": "~25.1.35",
"@syncfusion/ej2-splitbuttons": "~25.1.35"
},

@@ -82,5 +82,5 @@ "deprecated": false,

"typings": "index.d.ts",
"version": "24.2.9",
"version": "25.1.35",
"sideEffects": false,
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
}

@@ -5,3 +5,3 @@ import { extend, addClass, removeClass, setValue, closest, select, EventHandler } from '@syncfusion/ej2-base';

import { CellType } from '../base/enum';
import { parentsUntil, refreshForeignData, getObject, addRemoveEventListener, } from '../base/util';
import { parentsUntil, refreshForeignData, getObject, addRemoveEventListener, getCellFromRow } from '../base/util';
import { getCellByColAndRowIndex, addFixedColumnBorder } from '../base/util';

@@ -278,6 +278,11 @@ import * as events from '../base/constant';

if (this.parent.aggregates.length > 0) {
this.parent.notify(events.refreshFooterRenderer, {});
if (!(this.parent.isReact || this.parent.isVue)) {
this.parent.notify(events.refreshFooterRenderer, {});
}
if (this.parent.groupSettings.columns.length > 0) {
this.parent.notify(events.groupAggregates, {});
}
if (this.parent.isReact || this.parent.isVue) {
this.parent.notify(events.refreshFooterRenderer, {});
}
}

@@ -720,3 +725,7 @@ };

if (col && !col.isPrimaryKey && col.allowEditing) {
var td_1 = getCellByColAndRowIndex(this.parent, col, rowIndex, index);
var td_1 = this.parent.isSpan ? getCellFromRow(gObj, rowIndex, index) :
getCellByColAndRowIndex(this.parent, col, rowIndex, index);
if (this.parent.isSpan && !td_1) {
return;
}
var rowObj_1 = gObj.getRowObjectFromUID(td_1.parentElement.getAttribute('data-uid'));

@@ -723,0 +732,0 @@ if (gObj.isEdit ||

@@ -292,2 +292,3 @@ import { Browser, remove, EventHandler, isUndefined, closest, classList } from '@syncfusion/ej2-base';

remove(this.clipBoardTextArea);
this.clipBoardTextArea = null;
}

@@ -294,0 +295,0 @@ };

@@ -80,8 +80,10 @@ import { classList, addClass, removeClass, isNullOrUndefined, Browser } from '@syncfusion/ej2-base';

ColumnChooser.prototype.rtlUpdate = function () {
if (this.parent.enableRtl) {
addClass([].slice.call(this.innerDiv.getElementsByClassName('e-checkbox-wrapper')), ['e-rtl']);
if (!isNullOrUndefined(this.innerDiv)) {
if (this.parent.enableRtl) {
addClass([].slice.call(this.innerDiv.getElementsByClassName('e-checkbox-wrapper')), ['e-rtl']);
}
else {
removeClass([].slice.call(this.innerDiv.getElementsByClassName('e-checkbox-wrapper')), ['e-rtl']);
}
}
else {
removeClass([].slice.call(this.innerDiv.getElementsByClassName('e-checkbox-wrapper')), ['e-rtl']);
}
};

@@ -441,2 +443,5 @@ /**

}
if (this.parent.editSettings.showAddNewRow) {
this.parent.notify(events.showAddNewRowFocus, {});
}
}

@@ -443,0 +448,0 @@ };

@@ -305,3 +305,3 @@ import { EventHandler, closest, Browser, isNullOrUndefined } from '@syncfusion/ej2-base';

colChooser && this.isChooserItem(colChooser)) {
args.cancel = true;
args.cancel = args.event && args.event.code === 'Escape' ? false : true;
}

@@ -453,3 +453,9 @@ else if (args.event && (closest(args.event.target, '.' + this.POP)

}
this.parent.notify(events.restoreFocus, {});
if (!isNullOrUndefined(args.parentItem) && this.getKeyFromId(args.parentItem.id) === 'ColumnChooser'
&& this.columnMenu.element.querySelector('.e-selected')) {
this.columnMenu.element.querySelector('.e-selected').focus();
}
else {
this.parent.notify(events.restoreFocus, {});
}
};

@@ -456,0 +462,0 @@ ColumnMenu.prototype.getDefaultItems = function () {

@@ -272,3 +272,5 @@ import { closest, isNullOrUndefined, EventHandler } from '@syncfusion/ej2-base';

closest(args.event.target, '.e-groupcaption') ||
closest(args.event.target, '.e-filterbarcell'))) {
closest(args.event.target, '.e-filterbarcell')) ||
(this.parent.editSettings.showAddNewRow && closest(args.event.target, '.e-addedrow')
&& this.parent.element.querySelector('.e-editedrow'))) {
args.cancel = true;

@@ -275,0 +277,0 @@ }

@@ -22,2 +22,4 @@ import { L10n } from '@syncfusion/ej2-base';

virtualFormObj: FormValidator;
/** @hidden */
isShowAddedRowValidate: boolean;
private static editCellType;

@@ -24,0 +26,0 @@ private editType;

@@ -35,2 +35,4 @@ import { closest, addClass, select } from '@syncfusion/ej2-base';

function Edit(parent, serviceLocator) {
/** @hidden */
this.isShowAddedRowValidate = false;
this.editType = { 'Inline': InlineEdit, 'Normal': InlineEdit, 'Batch': BatchEdit, 'Dialog': DialogEdit };

@@ -95,3 +97,3 @@ this.fieldname = '';

this.updateEditObj();
gObj.isEdit = false;
gObj.isEdit = gObj.editSettings.showAddNewRow ? true : false;
gObj.refresh();

@@ -120,3 +122,5 @@ break;

var gObj = this.parent;
if (!gObj.editSettings.allowEditing || gObj.isEdit || gObj.editSettings.mode === 'Batch') {
if (!gObj.editSettings.allowEditing || (gObj.isEdit && (!gObj.editSettings.showAddNewRow ||
(gObj.editSettings.showAddNewRow && !isNullOrUndefined(gObj.element.querySelector('.' + literals.editedRow)))))
|| gObj.editSettings.mode === 'Batch') {
return;

@@ -153,2 +157,5 @@ }

this.parent.notify('start-edit', {});
if (gObj.editSettings.showAddNewRow) {
this.destroyToolTip();
}
};

@@ -188,2 +195,5 @@ /**

this.parent.notify(events.closeEdit, {});
if (this.parent.editSettings.showAddNewRow) {
this.destroyToolTip();
}
};

@@ -357,4 +367,7 @@ Edit.prototype.refreshToolbar = function () {

Edit.prototype.endEditing = function () {
this.parent.element.classList.remove('e-editing');
if (!this.parent.editSettings.showAddNewRow) {
this.parent.element.classList.remove('e-editing');
}
this.editModule.endEdit();
this.isShowAddedRowValidate = false;
this.refreshToolbar();

@@ -366,2 +379,5 @@ };

obj.show();
if (this.parent.enableRtl) {
obj.refresh();
}
};

@@ -534,3 +550,3 @@ Edit.prototype.getValueFromType = function (col, value) {

if (actions.indexOf(e.requestType) < 0) {
this.parent.isEdit = false;
this.parent.isEdit = this.parent.editSettings.showAddNewRow ? true : false;
}

@@ -624,3 +640,3 @@ if (e.requestType === 'batchsave') {

var value = this.getValue(col_1, inputs[parseInt(i.toString(), 10)], editedData);
if (col_1.type === 'string') {
if (col_1.type === 'string' && !(col_1.isForeignColumn() && typeof value !== 'string')) {
value = this.parent.sanitize(value);

@@ -659,4 +675,4 @@ }

Edit.prototype.onActionBegin = function (e) {
if (e.requestType === 'columnstate' && this.parent.isEdit
&& this.parent.editSettings.mode !== 'Batch') {
if ((e.requestType === 'columnstate' || (this.parent.enableInfiniteScrolling && this.parent.infiniteScrollSettings.enableCache
&& e.requestType === 'sorting')) && this.parent.isEdit && this.parent.editSettings.mode !== 'Batch') {
this.closeEdit();

@@ -673,5 +689,7 @@ }

var isRestrict = restrictedRequestTypes.indexOf(e.requestType) === -1;
var isDestroyVirtualForm = this.parent.enableVirtualization && this.formObj
var isAddRows = !this.parent.editSettings.showAddNewRow || (this.parent.editSettings.showAddNewRow &&
!isNullOrUndefined(this.parent.element.querySelector('.e-editedrow')));
var isDestroyVirtualForm = (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling) && this.formObj && isAddRows
&& !this.formObj.isDestroyed && (editRow || addRow || e.requestType === 'cancel') && isRestrict;
if ((!this.parent.enableVirtualization && this.parent.editSettings.mode !== 'Batch' && this.formObj && !this.formObj.isDestroyed
if ((!this.parent.enableVirtualization && isAddRows && this.parent.editSettings.mode !== 'Batch' && this.formObj && !this.formObj.isDestroyed
&& isRestrict && !e.cancel) || isDestroyVirtualForm) {

@@ -796,3 +814,4 @@ this.destroyWidgets();

if (!parentsUntil(e.target, 'e-unboundcelldiv') && this.parent.editSettings.mode !== 'Batch' &&
(parentsUntil(e.target, literals.gridContent) || (this.parent.frozenRows
(parentsUntil(e.target, literals.gridContent) || ((this.parent.frozenRows ||
(this.parent.editSettings.showAddNewRow && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)))
&& parentsUntil(e.target, literals.headerContent)))

@@ -838,4 +857,4 @@ && !document.getElementsByClassName('e-popup-open').length) {

&& e.action === 'tab' && !rowCell.classList.contains('e-unboundcell'))
|| (rowCell === parentsUntil(focusableEditCells[0], 'e-rowcell') && e.action === 'shiftTab')
|| e.action === 'escape') {
|| (rowCell === parentsUntil(focusableEditCells[0], 'e-rowcell') && e.action === 'shiftTab' &&
!this.parent.editSettings.showAddNewRow) || e.action === 'escape') {
var uid = editedRow.getAttribute('data-uid');

@@ -854,8 +873,15 @@ var rows = this.parent.getRows();

else {
this.isShowAddedRowValidate = true;
this.endEdit();
this.isShowAddedRowValidate = false;
}
if (this.parent.focusModule.active) {
if (this.parent.focusModule.active && (!this.parent.editSettings.showAddNewRow ||
editedRow.classList.contains('e-editedrow') || (this.parent.editSettings.showAddNewRow &&
(editedRow.classList.contains('e-addedrow') && isNullOrUndefined(this.parent.element.querySelector('.e-griderror:not([style*="display: none"])')))))) {
this.parent.focusModule.active.matrix.current = [rowIndex, 0];
}
}
if (this.parent.editSettings.showAddNewRow && e.action === 'tab' && parentsUntil(e.target, 'e-addedrow')) {
this.isShowAddedRowValidate = true;
}
}

@@ -881,3 +907,5 @@ }

var form = this.parent.editSettings.mode !== 'Dialog' ?
gObj.element.getElementsByClassName('e-gridform')[parseInt(idx.toString(), 10)] :
gObj.editSettings.showAddNewRow && gObj.element.querySelector('.' + literals.editedRow) ?
gObj.element.querySelector('.' + literals.editedRow).getElementsByClassName('e-gridform')[parseInt(idx.toString(), 10)] :
gObj.element.getElementsByClassName('e-gridform')[parseInt(idx.toString(), 10)] :
select('#' + gObj.element.id + '_dialogEdit_wrapper .e-gridform', document);

@@ -923,5 +951,13 @@ var index = 1;

};
if (!(event && event['relatedTarget'] && event['relatedTarget'].classList.contains('e-cancelbutton'))) {
if ((!(event && event['relatedTarget'] && event['relatedTarget'].classList.contains('e-cancelbutton')) &&
!_this.parent.editSettings.showAddNewRow) || (_this.parent.editSettings.showAddNewRow && event && event.target &&
(parentsUntil(event.target, _this.parent.element.id + '_update', true) ||
(parentsUntil(event.target, 'e-grid-menu') && (event.target.classList.contains('e-save') ||
event.target.querySelector('.e-save'))) || _this.isShowAddedRowValidate ||
(parentsUntil(event.target, 'e-unboundcell') && parentsUntil(event.target, 'e-update')) ||
(event['action'] === 'enter' && (parentsUntil(event.target, 'e-content') || parentsUntil(event.target, 'e-addedrow'))))) ||
(_this.parent.editSettings.showAddNewRow && !isNullOrUndefined(_this.parent.element.querySelector('.' + literals.editedRow)))) {
_this.valErrorPlacement(inputElement, error);
}
_this.isShowAddedRowValidate = false;
_this.parent.notify(events.valCustomPlacement, args);

@@ -944,10 +980,11 @@ }

Edit.prototype.getElemTable = function (inputElement) {
var isFHdr;
var isFrozenHdr;
var gObj = this.parent;
var table;
if (gObj.editSettings.mode !== 'Dialog') {
isFHdr = (gObj.frozenRows && gObj.frozenRows
isFrozenHdr = (gObj.frozenRows && closest(inputElement, '.' + literals.row) && gObj.frozenRows
> (parseInt(closest(inputElement, '.' + literals.row).getAttribute(literals.dataRowIndex), 10) || 0));
var field = inputElement.name;
table = this.parent.isFrozenGrid() ? gObj.element : isFHdr ? gObj.getHeaderTable() : gObj.getContentTable();
table = this.parent.isFrozenGrid() ? gObj.element : isFrozenHdr || (gObj.editSettings.showAddNewRow &&
(gObj.enableVirtualization || gObj.enableInfiniteScrolling)) ? gObj.getHeaderTable() : gObj.getContentTable();
}

@@ -973,2 +1010,8 @@ else {

var elem = this.getElemTable(args.element).querySelector('#' + getParsedFieldID(args.inputName) + '_Error');
if (this.parent.editSettings.showAddNewRow && !elem && args.element) {
var error = parentsUntil(args.element, 'e-rowcell').querySelector('.e-error');
if (error) {
error.classList.remove('e-error');
}
}
if (elem) {

@@ -1000,2 +1043,4 @@ if (args.status === 'failure') {

var isBatchModeLastRow = false;
var isAddNewRow = this.parent.editSettings.showAddNewRow && !isNullOrUndefined(parentsUntil(element, literals.addedRow))
&& (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling);
var viewPortRowCount = Math.round(this.parent.getContent().clientHeight / this.parent.getRowHeight()) - 1;

@@ -1011,4 +1056,6 @@ var rows = [].slice.call(this.parent.getContent().getElementsByClassName(literals.row));

if (isInline) {
if (this.parent.frozenRows) {
var fHearderRows = [].slice.call(this.parent.getHeaderTable().querySelector(literals.tbody).querySelectorAll('.e-row:not(.e-hiddenrow)'));
if (this.parent.frozenRows || isAddNewRow) {
var headerRows = this.parent.editSettings.showAddNewRow ? '.e-row:not(.e-hiddenrow.e-addedrow)' :
'.e-row:not(.e-hiddenrow)';
var fHearderRows = [].slice.call(this.parent.getHeaderTable().querySelector(literals.tbody).querySelectorAll(headerRows));
isFHdr = fHearderRows.length > (parseInt(row.getAttribute(literals.dataRowIndex), 10) || 0);

@@ -1065,3 +1112,3 @@ isFHdrLastRow = isFHdr && parseInt(row.getAttribute(literals.dataRowIndex), 10) === fHearderRows.length - 1;

div.appendChild(arrow);
if (!customForm && (this.parent.frozenRows) && this.parent.editSettings.mode !== 'Dialog') {
if (!customForm && (this.parent.frozenRows || isAddNewRow) && this.parent.editSettings.mode !== 'Dialog') {
var getEditCell = this.parent.editSettings.mode === 'Normal' ?

@@ -1073,3 +1120,3 @@ closest(element, '.e-editcell') : closest(element, '.' + literals.table);

(closest(element, '.' + literals.frozenContent) || closest(element, '.' + literals.frozenHeader))
|| (this.parent.frozenRows)) {
|| (this.parent.frozenRows || isAddNewRow)) {
if (this.parent.isFrozenGrid()) {

@@ -1141,3 +1188,3 @@ if (td.classList.contains('e-unfreeze')) {

}
if (this.parent.frozenRows && this.parent.editSettings.mode !== 'Dialog') {
if ((this.parent.frozenRows || isAddNewRow) && this.parent.editSettings.mode !== 'Dialog') {
div.style.left = input.offsetLeft + (input.offsetWidth / 2 - div.offsetWidth / 2) + 'px';

@@ -1148,3 +1195,3 @@ }

}
if (isInline && !isScroll && !this.parent.allowPaging || this.parent.frozenRows) {
if (isInline && !isScroll && !this.parent.allowPaging || (this.parent.frozenRows || isAddNewRow)) {
// gcontent.style.position = 'static';

@@ -1155,4 +1202,5 @@ var pos = calculateRelativeBasedPosition(input, div);

if (validationForBottomRowPos) {
if (isScroll && this.parent.height !== 'auto' && !this.parent.frozenRows
&& !this.parent.enableVirtualization && !(div.classList.contains('e-freezeerror') && div.classList.contains('e-fixederror'))) {
if (isScroll && this.parent.height !== 'auto' && (!this.parent.frozenRows || !isAddNewRow)
&& !this.parent.enableVirtualization && !this.parent.enableInfiniteScrolling && !(div.classList.contains('e-freezeerror')
&& div.classList.contains('e-fixederror'))) {
var scrollWidth = gcontent.scrollWidth > gcontent.offsetWidth ? getScrollBarWidth() : 0;

@@ -1169,3 +1217,4 @@ var gHeight = this.parent.height.toString().indexOf('%') === -1 ?

&& this.editModule.args.requestType === 'add')) {
var rowsCount = this.parent.frozenRows ? this.parent.frozenRows + (rows.length - 1) : rows.length - 1;
var rowsCount = this.parent.frozenRows ? (isAddNewRow ? this.parent.frozenRows + 1 : this.parent.frozenRows) +
(rows.length - 1) : rows.length - 1;
var rowsHeight = rowsCount * this.parent.getRowHeight();

@@ -1172,0 +1221,0 @@ var position = this.parent.getContent().clientHeight - rowsHeight;

@@ -116,3 +116,7 @@ var __extends = (this && this.__extends) || (function () {

}).catch(function (e) {
_this.parent.log(['actionfailure', 'foreign_key_failure']);
var errorMsg = e;
if (!errorMsg.error) {
errorMsg = { error: errorMsg };
}
_this.parent.log(['actionfailure', 'foreign_key_failure'], errorMsg);
if (args.promise && args.promise.reject) {

@@ -119,0 +123,0 @@ args.promise.reject(e);

@@ -204,3 +204,2 @@ import { Column } from '../models/column';

groupedRowReorder(fromRowObj: Row<Column>, toRowObj: Row<Column>): void;
private vGroupResetRowIndex;
private groupReorderHandler;

@@ -211,3 +210,2 @@ private updatedRowObjChange;

private evaluateGroupAggregateValueChange;
private groupReorderRowObject;
private gettingVirtualData;

@@ -214,0 +212,0 @@ private iterateGroupAggregates;

import { IGrid, IAction } from '../base/interface';
import { ServiceLocator } from '../services/service-locator';
import { Column } from '../models/column';
import { Row } from '../models/row';
import { Action } from '../base/enum';

@@ -136,6 +138,12 @@ import { ColumnWidthService } from '../services/width-controller';

/**
* @param {Row<Column>[]} rowObjects - Defines the grid's row objects
* @returns {void}
* @hidden
*/
resetInfiniteCache(rowObjects: Row<Column>[]): void;
/**
* @returns {void}
* @hidden
*/
destroy(): void;
}

@@ -91,3 +91,5 @@ /**

check: function (args, parent) {
return { success: parent.getColumns().filter(function (column) { return column.isPrimaryKey; }).length === 0 };
return { success: parent.enableColumnVirtualization
? parent.getPrimaryKeyFieldNames().length === 0
: parent.getColumns().filter(function (column) { return column.isPrimaryKey; }).length === 0 };
},

@@ -362,3 +364,4 @@ generateMessage: function () {

check: function (args, parent) {
return { success: parent.getColumns().length <= parent.frozenColumns || parent.frozenRows >= parent.currentViewData.length };
return { success: parent.getColumns().length <= parent.frozenColumns
|| (parent.currentViewData.length && parent.frozenRows >= parent.currentViewData.length) };
},

@@ -365,0 +368,0 @@ generateMessage: function (args, parent) {

@@ -40,2 +40,3 @@ import { IGrid, NotifyArgs } from '../base/interface';

protected startEdit(tr: Element): void;
private disabledShowAddRow;
private inlineEditHandler;

@@ -42,0 +43,0 @@ protected updateRow(index: number, data: Object): void;

@@ -26,2 +26,5 @@ import { extend, select } from '@syncfusion/ej2-base';

var gObj = this.parent;
if (gObj.editSettings.showAddNewRow && isNullOrUndefined(gObj.element.querySelector('.' + literals.editedRow))) {
return;
}
if ((((parentsUntil(target, literals.gridContent) &&

@@ -38,3 +41,5 @@ parentsUntil(parentsUntil(target, literals.gridContent), 'e-grid').id === gObj.element.id)) || (gObj.frozenRows

NormalEdit.prototype.dblClickHandler = function (e) {
if (parentsUntil(e.target, literals.rowCell) && this.parent.editSettings.allowEditOnDblClick) {
if (parentsUntil(e.target, literals.rowCell) && this.parent.editSettings.allowEditOnDblClick &&
(!this.parent.editSettings.showAddNewRow || (this.parent.editSettings.showAddNewRow &&
!parentsUntil(e.target, 'e-addedrow')))) {
this.parent.editModule.startEdit(parentsUntil(e.target, literals.row));

@@ -51,3 +56,3 @@ }

NormalEdit.prototype.editComplete = function (e) {
this.parent.isEdit = false;
this.parent.isEdit = this.parent.editSettings.showAddNewRow ? true : false;
var action = 'action';

@@ -58,3 +63,4 @@ switch (e.requestType) {

|| (!this.parent.isPersistSelection)) {
if (e["" + action] !== 'edit') {
if (e["" + action] !== 'edit' && (!this.parent.editSettings.showAddNewRow ||
(this.parent.editSettings.showAddNewRow && e["" + action] !== 'add'))) {
this.parent.selectRow(e['index']);

@@ -136,2 +142,55 @@ }

};
NormalEdit.prototype.disabledShowAddRow = function (disable, prevent) {
var addRow = this.parent.element.querySelector('.e-addedrow');
var inputs = [].slice.call(addRow ? addRow.querySelectorAll('.e-input') : []);
if (addRow && addRow.querySelector('.e-unboundcell')) {
var buttons = [].slice.call(addRow.querySelector('.e-unboundcell').querySelectorAll('.e-btn'));
for (var i = 0; i < buttons.length; i++) {
if (!disable) {
buttons[parseInt(i.toString(), 10)].classList.add('e-disabled');
buttons[parseInt(i.toString(), 10)].setAttribute('disabled', 'disabled');
}
else {
buttons[parseInt(i.toString(), 10)].classList.remove('e-disabled');
buttons[parseInt(i.toString(), 10)].removeAttribute('disabled');
}
}
}
if (inputs.length) {
for (var i = 0; i < inputs.length; i++) {
var input = inputs[parseInt(i.toString(), 10)];
var uid = input.getAttribute('e-mappinguid');
var column = this.parent.getColumnByUid(uid);
var error = parentsUntil(input, 'e-rowcell').querySelector('.e-error');
if (error) {
error.classList.remove('e-error');
}
if (input.ej2_instances) {
if (prevent && isNullOrUndefined(column.defaultValue)) {
input.ej2_instances[0].value = null;
input.value = null;
}
if (!isNullOrUndefined(disable)) {
input.ej2_instances[0].enabled = disable && column.allowEditing ? true : false;
}
}
else {
if (prevent && input.value && input.value.length &&
isNullOrUndefined(column.defaultValue)) {
input.value = null;
}
if (!isNullOrUndefined(disable)) {
if (!disable) {
input.classList.add('e-disabled');
input.setAttribute('disabled', 'disabled');
}
else if (column.allowEditing) {
input.classList.remove('e-disabled');
input.removeAttribute('disabled');
}
}
}
}
}
};
NormalEdit.prototype.inlineEditHandler = function (editargs, tr) {

@@ -151,2 +210,5 @@ var gObj = this.parent;

gObj.editModule.applyFormValidation();
if (gObj.editSettings.showAddNewRow && !tr.classList.contains('e-addedrow')) {
this.disabledShowAddRow(false, true);
}
editargs.type = 'actionComplete';

@@ -209,3 +271,4 @@ gObj.trigger(events.actionComplete, editargs);

var dlgWrapper = select('#' + gObj.element.id + '_dialogEdit_wrapper', document);
var dlgForm = isDlg ? dlgWrapper.querySelector('.e-gridform') : gObj.element.getElementsByClassName('e-gridform')[0];
var dlgForm = isDlg ? dlgWrapper.querySelector('.e-gridform') : gObj.editSettings.showAddNewRow &&
gObj.element.querySelector('.' + literals.editedRow) ? gObj.element.querySelector('.' + literals.editedRow).getElementsByClassName('e-gridform')[0] : gObj.element.getElementsByClassName('e-gridform')[0];
var data = {

@@ -240,2 +303,5 @@ virtualData: extend({}, {}, this.previousData, true), isAdd: false, isScroll: false, endEdit: true

}
if (gObj.editSettings.showAddNewRow) {
_this.disabledShowAddRow(true);
}
gObj.notify(events.updateData, endEditArgs);

@@ -254,2 +320,8 @@ });

}
if (this.parent.editSettings.showAddNewRow) {
this.parent.notify(events.showAddNewRowFocus, {});
if (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling) {
this.disabledShowAddRow(true, true);
}
}
}

@@ -259,4 +331,6 @@ };

var gObj = this.parent;
gObj.editModule.destroyWidgets();
gObj.editModule.destroyForm();
if (!gObj.editSettings.showAddNewRow || (gObj.editSettings.showAddNewRow && gObj.element.querySelector('.e-editedrow'))) {
gObj.editModule.destroyWidgets();
gObj.editModule.destroyForm();
}
this.parent.notify(events.dialogDestroy, {});

@@ -272,2 +346,5 @@ };

}
if (this.parent.editSettings.showAddNewRow) {
this.parent.editModule.applyFormValidation();
}
};

@@ -303,3 +380,3 @@ NormalEdit.prototype.edSucc = function (e, args) {

args.type = events.actionComplete;
this.parent.isEdit = false;
this.parent.isEdit = this.parent.editSettings.showAddNewRow ? true : false;
this.refreshRow(args.data);

@@ -455,3 +532,8 @@ this.parent.notify(events.virtualScrollEditSuccess, args);

var _this = this;
if (!this.parent.isEdit) {
if (!this.parent.isEdit || (this.parent.editSettings.showAddNewRow && this.parent.element.querySelector('.e-addedrow') &&
isNullOrUndefined(this.parent.element.querySelector('.' + literals.editedRow)))) {
if (this.parent.editSettings.showAddNewRow) {
this.disabledShowAddRow(true, true);
this.parent.notify(events.showAddNewRowFocus, {});
}
return;

@@ -472,8 +554,16 @@ }

}
gObj.isEdit = false;
_this.stopEditStatus();
closeEditArgs.type = events.actionComplete;
if (!_this.parent.editSettings.showAddNewRow) {
gObj.isEdit = false;
}
if (gObj.editSettings.mode !== 'Dialog') {
_this.refreshRow(closeEditArgs.data);
}
_this.stopEditStatus();
gObj.isEdit = false;
if (gObj.editSettings.showAddNewRow) {
_this.disabledShowAddRow(true);
gObj.editModule.applyFormValidation();
gObj.isEdit = true;
}
var isLazyLoad = gObj.groupSettings.enableLazyLoading && gObj.groupSettings.columns.length

@@ -508,3 +598,5 @@ && !gObj.getContentTable().querySelector('tr.e-emptyrow');

var rowData = { virtualData: {}, isScroll: false };
this.parent.notify(events.getVirtualData, rowData);
if (!gObj.editSettings.showAddNewRow) {
this.parent.notify(events.getVirtualData, rowData);
}
for (var i = 0; i < cols.length; i++) {

@@ -532,8 +624,13 @@ if (rowData.isScroll) {

this.parent.notify(events.createVirtualValidationForm, { uid: this.uid, prevData: this.previousData, argsCreator: this.getEditArgs.bind(this), renderer: this.renderer });
gObj.trigger(events.actionBegin, args, function (addArgs) {
if (addArgs.cancel) {
return;
}
_this.inlineAddHandler(addArgs);
});
if (gObj.editSettings.showAddNewRow) {
this.inlineAddHandler(args);
}
else {
gObj.trigger(events.actionBegin, args, function (addArgs) {
if (addArgs.cancel) {
return;
}
_this.inlineAddHandler(addArgs);
});
}
}

@@ -554,3 +651,5 @@ else {

addArgs.row = gObj.element.querySelector('.' + literals.addedRow);
gObj.trigger(events.actionComplete, addArgs);
if (!gObj.editSettings.showAddNewRow) {
gObj.trigger(events.actionComplete, addArgs);
}
if (gObj.editSettings.template) {

@@ -598,3 +697,4 @@ gObj.editModule.applyFormValidation(undefined, addArgs.form.ej2_instances[0].rules);

var gObj = this.parent;
var addElements = [].slice.call(gObj.element.getElementsByClassName(literals.addedRow));
var addElements = [].slice.call(gObj.editSettings.showAddNewRow ? [] :
gObj.element.getElementsByClassName(literals.addedRow));
var editElements = [].slice.call(gObj.element.getElementsByClassName(literals.editedRow));

@@ -601,0 +701,0 @@ for (var i = 0; i < addElements.length; i++) {

@@ -79,6 +79,6 @@ import { extend } from '@syncfusion/ej2-base';

if (this.parent.getContentTable()) {
links[parseInt(i.toString(), 10)].setAttribute('aria-owns', this.parent.getContentTable().id);
links[parseInt(i.toString(), 10)].setAttribute('aria-owns', this.parent.getContentTable().id + ' ' + (i + 1));
}
else {
links[parseInt(i.toString(), 10)].setAttribute('aria-owns', this.parent.element.getAttribute('id') + '_content_table');
links[parseInt(i.toString(), 10)].setAttribute('aria-owns', this.parent.element.getAttribute('id') + '_content_table' + ' ' + (i + 1));
}

@@ -95,3 +95,3 @@ var numericContainerDiv = this.parent.createElement('div');

if (this.parent.getContentTable()) {
element.setAttribute('aria-owns', this.parent.getContentTable().id);
element.setAttribute('aria-owns', this.parent.getContentTable().id + classList[parseInt(j.toString(), 10)].replace('.e-', ' '));
}

@@ -184,3 +184,3 @@ }

this.pagerObj.setProperties({ pageSize: e.oldProp.pageSize }, true);
gObj.setProperties({ pageSettings: { pageSize: e.oldProp.pageSize } }, true);
this.parent.setProperties({ pageSettings: { pageSize: e.oldProp.pageSize } }, true);
this.pagerObj.setProperties({

@@ -187,0 +187,0 @@ currentPage: gObj.pageSettings.currentPage === this.pagerObj.currentPage ?

@@ -31,2 +31,3 @@ import { IGrid, IAction } from '../base/interface';

private widthService;
private isCancelAutoFit;
/**

@@ -43,6 +44,9 @@ * Constructor for the Grid resize module

* @param {string|string[]} fName - Defines the field name.
* @param {number} startRowIndex - Specifies the start row index.
* @param {number} endRowIndex - Specifies the end row index.
* @returns {void}
*/
autoFitColumns(fName?: string | string[]): void;
autoFitColumns(fName?: string | string[], startRowIndex?: number, endRowIndex?: number): void;
private autoFit;
private getCellElementsByColumnIndex;
private resizeColumn;

@@ -70,6 +74,8 @@ /**

* @param {string} tag - specifies the tag name
* @param {number} startRowIndex - Specifies the start row index.
* @param {number} endRowIndex - Specifies the end row index.
* @returns {number} returns the number
* @hidden
*/
protected createTable(table: Element, text: Element[], tag: string): number;
protected createTable(table: Element, text: Element[], tag: string, startRowIndex?: number, endRowIndex?: number): number;
/**

@@ -103,2 +109,3 @@ * @returns {void}

private refreshResizeFixedCols;
private calculateColspanWidth;
private refreshResizePosition;

@@ -105,0 +112,0 @@ private refreshResizefrzCols;

@@ -34,2 +34,3 @@ import { EventHandler, detach, formatUnit, Browser, closest } from '@syncfusion/ej2-base';

this.resizeProcess = false;
this.isCancelAutoFit = false;
this.parent = parent;

@@ -46,5 +47,7 @@ if (this.parent.isDestroyed) {

* @param {string|string[]} fName - Defines the field name.
* @param {number} startRowIndex - Specifies the start row index.
* @param {number} endRowIndex - Specifies the end row index.
* @returns {void}
*/
Resize.prototype.autoFitColumns = function (fName) {
Resize.prototype.autoFitColumns = function (fName, startRowIndex, endRowIndex) {
var columnName = (fName === undefined || fName === null || fName.length <= 0) ?

@@ -56,3 +59,3 @@ this.parent.getColumns().map(function (x) { return x.field; }) : (typeof fName === 'string') ? [fName] : fName;

}
this.findColumn(columnName);
this.findColumn(columnName, startRowIndex, endRowIndex);
};

@@ -69,3 +72,11 @@ Resize.prototype.autoFit = function () {

};
Resize.prototype.resizeColumn = function (fName, index, id) {
Resize.prototype.getCellElementsByColumnIndex = function (columnIndex) {
if (this.parent.frozenRows) {
return [].slice.call(this.parent.getHeaderTable().querySelectorAll("td.e-rowcell:nth-child(" + (columnIndex + 1) + "):not(.e-groupcaption):not(.e-detailcell)")).concat([].slice.call(this.parent.getContentTable().querySelectorAll("td.e-rowcell:nth-child(" + (columnIndex + 1) + "):not(.e-groupcaption):not(.e-detailcell)")));
}
else {
return [].slice.call(this.parent.getContentTable().querySelectorAll("td.e-rowcell:nth-child(" + (columnIndex + 1) + "):not(.e-groupcaption):not(.e-detailcell)"));
}
};
Resize.prototype.resizeColumn = function (fName, index, id, startRowIndex, endRowIndex) {
var gObj = this.parent;

@@ -83,3 +94,3 @@ var tWidth = 0;

var headerTextClone = headerTable.querySelector('[e-mappinguid="' + uid + '"]').parentElement.cloneNode(true);
var contentTextClone = contentTable.querySelectorAll("td.e-rowcell:nth-child(" + (columnIndex + 1) + "):not(.e-groupcaption):not(.e-detailcell)");
var contentTextClone = this.getCellElementsByColumnIndex(columnIndex);
var footerTextClone;

@@ -119,3 +130,3 @@ var columnIndexByField = this.parent.getColumnIndexByField(fName);

if (gObj.getCurrentViewRecords().length) {
wContent = this.createTable(contentTable, contentText, contentDivTag);
wContent = this.createTable(contentTable, contentText, contentDivTag, startRowIndex, endRowIndex);
}

@@ -201,3 +212,3 @@ if (footerText.length) {

};
Resize.prototype.findColumn = function (fName) {
Resize.prototype.findColumn = function (fName, startRowIndex, endRowIndex) {
for (var i = 0; i < fName.length; i++) {

@@ -208,3 +219,3 @@ var fieldName = fName[parseInt(i.toString(), 10)];

if (columnIndex > -1 && !isNullOrUndefined(column) && column.visible === true) {
this.resizeColumn(fieldName, columnIndex);
this.resizeColumn(fieldName, columnIndex, null, startRowIndex, endRowIndex);
}

@@ -225,6 +236,15 @@ }

* @param {string} tag - specifies the tag name
* @param {number} startRowIndex - Specifies the start row index.
* @param {number} endRowIndex - Specifies the end row index.
* @returns {number} returns the number
* @hidden
*/
Resize.prototype.createTable = function (table, text, tag) {
Resize.prototype.createTable = function (table, text, tag, startRowIndex, endRowIndex) {
if (startRowIndex === void 0) { startRowIndex = 1; }
if (endRowIndex === void 0) { endRowIndex = text.length; }
if (startRowIndex > endRowIndex) {
startRowIndex ^= endRowIndex;
endRowIndex ^= startRowIndex;
startRowIndex ^= endRowIndex;
}
var myTableDiv = this.parent.createElement('div');

@@ -241,6 +261,6 @@ var adaptiveClass = this.parent.enableAdaptiveUI ? ' e-bigger' : '';

var myTr = this.parent.createElement('tr');
for (var i = 0; i < text.length; i++) {
for (var i = (startRowIndex <= 0 ? 1 : startRowIndex); i <= (endRowIndex > text.length ? text.length : endRowIndex); i++) {
var tr = myTr.cloneNode();
tr.className = table.querySelector('tr').className;
tr.appendChild(text[parseInt(i.toString(), 10)]);
tr.appendChild(text[parseInt((i - 1).toString(), 10)]);
myTable.appendChild(tr);

@@ -322,3 +342,3 @@ }

Resize.prototype.callAutoFit = function (e) {
if (e.target.classList.contains('e-rhandler')) {
if (e.target.classList.contains('e-rhandler') && !this.isCancelAutoFit) {
var col = this.getTargetColumn(e);

@@ -349,60 +369,64 @@ if (col.columns) {

if (e.target.classList.contains('e-rhandler')) {
if (!this.helper) {
if (this.getScrollBarWidth() === 0) {
this.resizeProcess = true;
if (this.parent.allowGrouping) {
for (var i = 0; i < this.parent.groupSettings.columns.length; i++) {
this.widthService.setColumnWidth(new Column({ width: '30px' }), i);
this.isCancelAutoFit = false;
var args = { e: e, column: this.getTargetColumn(e) };
this.parent.trigger(events.resizeStart, args, function (args) {
if (args.cancel || _this.parent.isEdit) {
_this.cancelResizeAction();
_this.isCancelAutoFit = true;
return;
}
});
if (!this.isCancelAutoFit) {
if (!this.helper) {
if (this.getScrollBarWidth() === 0) {
this.resizeProcess = true;
if (this.parent.allowGrouping) {
for (var i = 0; i < this.parent.groupSettings.columns.length; i++) {
this.widthService.setColumnWidth(new Column({ width: '30px' }), i);
}
}
for (var _i = 0, _a = this.refreshColumnWidth(); _i < _a.length; _i++) {
var col = _a[_i];
this.widthService.setColumnWidth(col);
}
this.widthService.setWidthToTable();
this.resizeProcess = false;
}
for (var _i = 0, _a = this.refreshColumnWidth(); _i < _a.length; _i++) {
var col = _a[_i];
this.widthService.setColumnWidth(col);
this.refreshStackedColumnWidth();
this.element = e.target;
this.parentElementWidth = this.parent.element.getBoundingClientRect().width;
this.appendHelper();
this.column = this.getTargetColumn(e);
this.pageX = this.getPointX(e);
if (this.column.getFreezeTableName() === literals.frozenRight) {
if (this.parent.enableRtl) {
this.minMove = (this.column.minWidth ? parseFloat(this.column.minWidth.toString()) : 0)
- parseFloat(isNullOrUndefined(this.column.width) ? '' : this.column.width.toString());
}
else {
this.minMove = parseFloat(isNullOrUndefined(this.column.width) ? '' : this.column.width.toString())
- (this.column.minWidth ? parseFloat(this.column.minWidth.toString()) : 0);
}
}
this.widthService.setWidthToTable();
this.resizeProcess = false;
}
this.refreshStackedColumnWidth();
this.element = e.target;
this.parentElementWidth = this.parent.element.getBoundingClientRect().width;
this.appendHelper();
this.column = this.getTargetColumn(e);
this.pageX = this.getPointX(e);
if (this.column.getFreezeTableName() === literals.frozenRight) {
if (this.parent.enableRtl) {
else if (this.parent.enableRtl) {
this.minMove = parseFloat(this.column.width.toString())
- (this.column.minWidth ? parseFloat(this.column.minWidth.toString()) : 0);
}
else {
this.minMove = (this.column.minWidth ? parseFloat(this.column.minWidth.toString()) : 0)
- parseFloat(isNullOrUndefined(this.column.width) ? '' : this.column.width.toString());
}
else {
this.minMove = parseFloat(isNullOrUndefined(this.column.width) ? '' : this.column.width.toString())
- (this.column.minWidth ? parseFloat(this.column.minWidth.toString()) : 0);
}
this.minMove += this.pageX;
}
else if (this.parent.enableRtl) {
this.minMove = parseFloat(this.column.width.toString())
- (this.column.minWidth ? parseFloat(this.column.minWidth.toString()) : 0);
if (Browser.isDevice && !this.helper.classList.contains(resizeClassList.icon)) {
this.helper.classList.add(resizeClassList.icon);
EventHandler.add(document, Browser.touchStartEvent, this.removeHelper, this);
EventHandler.add(this.helper, Browser.touchStartEvent, this.resizeStart, this);
}
else {
this.minMove = (this.column.minWidth ? parseFloat(this.column.minWidth.toString()) : 0)
- parseFloat(isNullOrUndefined(this.column.width) ? '' : this.column.width.toString());
EventHandler.add(document, Browser.touchEndEvent, this.resizeEnd, this);
EventHandler.add(this.parent.element, Browser.touchMoveEvent, this.resizing, this);
this.updateCursor('add');
}
this.minMove += this.pageX;
}
if (Browser.isDevice && !this.helper.classList.contains(resizeClassList.icon)) {
this.helper.classList.add(resizeClassList.icon);
EventHandler.add(document, Browser.touchStartEvent, this.removeHelper, this);
EventHandler.add(this.helper, Browser.touchStartEvent, this.resizeStart, this);
}
else {
var args = { e: e, column: this.column };
this.parent.trigger(events.resizeStart, args, function (args) {
if (args.cancel || _this.parent.isEdit) {
_this.cancelResizeAction();
return;
}
EventHandler.add(document, Browser.touchEndEvent, _this.resizeEnd, _this);
EventHandler.add(_this.parent.element, Browser.touchMoveEvent, _this.resizing, _this);
_this.updateCursor('add');
});
}
}

@@ -416,7 +440,9 @@ };

}
if (Browser.isDevice) {
if (Browser.isDevice && !isNullOrUndefined(this.helper)) {
EventHandler.remove(document, Browser.touchStartEvent, this.removeHelper);
EventHandler.remove(this.helper, Browser.touchStartEvent, this.resizeStart);
}
detach(this.helper);
if (!isNullOrUndefined(this.helper)) {
detach(this.helper);
}
this.refresh();

@@ -499,6 +525,17 @@ };

}
applyStickyLeftRightPosition(node, width + translateX, this.parent.enableRtl, 'Right');
var colSpanwidth = 0;
if (node.colSpan > 1) {
colSpanwidth = this.calculateColspanWidth(cols, node, column.index);
}
applyStickyLeftRightPosition(node, (width - colSpanwidth) + translateX, this.parent.enableRtl, 'Right');
}
}
};
Resize.prototype.calculateColspanWidth = function (cols, node, index) {
var width = 0;
for (var j = index + 1; j < index + node.colSpan; j++) {
width += parseInt(cols[parseInt(j.toString(), 10)].width.toString(), 10);
}
return width;
};
Resize.prototype.refreshResizePosition = function () {

@@ -541,24 +578,32 @@ this.refreshResizefrzCols(true);

var width_2 = this.parent.getFrozenMode() === 'Right' && this.parent.isRowDragable() ? 30 : 0;
var columns = this.parent.getColumns();
var columns_1 = this.parent.getColumns();
if (!freezeRefresh || isAutoFitCol) {
this.frzHdrRefresh('Right');
}
var columnsRight = columns.filter(function (col) { return col.freeze === 'Right'; });
for (var i = columns.length - 1; i >= columns.length - columnsRight.length; i--) {
var columnsRight = columns_1.filter(function (col) { return col.freeze === 'Right'; });
var _loop_1 = function (i) {
var elements = [];
if (this.parent.frozenRows) {
elements = [].slice.call(this.parent.getHeaderContent().querySelectorAll('td[data-colindex="' + i + '"]')).concat([].slice.call(this.parent.getContent().querySelectorAll('td[data-colindex="' + i + '"]')));
if (this_1.parent.frozenRows) {
elements = [].slice.call(this_1.parent.getHeaderContent().querySelectorAll('td[data-colindex="' + i + '"]')).concat([].slice.call(this_1.parent.getContent().querySelectorAll('td[data-colindex="' + i + '"]')));
}
else {
elements = [].slice.call(this.parent.getContent().querySelectorAll('td[data-colindex="' + i + '"]'));
elements = [].slice.call(this_1.parent.getContent().querySelectorAll('td[data-colindex="' + i + '"]'));
}
elements.filter(function (cell) {
applyStickyLeftRightPosition(cell, width_2 + translateX, _this.parent.enableRtl, 'Right');
var colSpanwidth = 0;
if (cell.colSpan > 1) {
colSpanwidth = _this.calculateColspanWidth(columns_1, cell, columns_1[parseInt(i.toString(), 10)].index);
}
applyStickyLeftRightPosition(cell, (width_2 - colSpanwidth) + translateX, _this.parent.enableRtl, 'Right');
});
if (this.parent.enableColumnVirtualization) {
columns[parseInt(i.toString(), 10)].valueX = width_2;
if (this_1.parent.enableColumnVirtualization) {
columns_1[parseInt(i.toString(), 10)].valueX = width_2;
}
if (columns[parseInt(i.toString(), 10)].visible) {
width_2 = width_2 + parseFloat(columns[parseInt(i.toString(), 10)].width.toString());
if (columns_1[parseInt(i.toString(), 10)].visible) {
width_2 = width_2 + parseFloat(columns_1[parseInt(i.toString(), 10)].width.toString());
}
};
var this_1 = this;
for (var i = columns_1.length - 1; i >= columns_1.length - columnsRight.length; i--) {
_loop_1(i);
}

@@ -594,3 +639,3 @@ this.refreshResizeFixedCols('Right');

var th = [].slice.call(tr[parseInt(i.toString(), 10)].querySelectorAll('.e-leftfreeze,.e-fixedfreeze'));
var _loop_1 = function (j) {
var _loop_2 = function (j) {
var node = th[parseInt(j.toString(), 10)];

@@ -601,9 +646,9 @@ if (node.classList.contains('e-rowdragheader') || node.classList.contains('e-dragheadercell') ||

}
var column = this_1.getParticularCol(node);
var cols = this_1.parent.getColumns();
var column = this_2.getParticularCol(node);
var cols = this_2.parent.getColumns();
var width = 0;
var summarycell = [];
if (this_1.parent.aggregates.length && this_1.parent.getFooterContent()) {
if (this_1.parent.getContent().querySelectorAll('.e-summaryrow').length) {
var summaryRows = [].slice.call(this_1.parent.getContent().querySelectorAll('.e-summaryrow'));
if (this_2.parent.aggregates.length && this_2.parent.getFooterContent()) {
if (this_2.parent.getContent().querySelectorAll('.e-summaryrow').length) {
var summaryRows = [].slice.call(this_2.parent.getContent().querySelectorAll('.e-summaryrow'));
summaryRows.filter(function (row) {

@@ -613,10 +658,10 @@ summarycell.push(row.querySelector('[e-mappinguid="' + column.uid + '"]'));

}
summarycell = summarycell.concat([].slice.call(this_1.parent.getFooterContent().querySelectorAll('[e-mappinguid="' + column.uid + '"]')));
summarycell = summarycell.concat([].slice.call(this_2.parent.getFooterContent().querySelectorAll('[e-mappinguid="' + column.uid + '"]')));
}
if (node.classList.contains('e-fixedfreeze')) {
if (this_1.parent.getVisibleFrozenLeftCount()) {
width = this_1.parent.getIndentCount() * 30;
if (this_2.parent.getVisibleFrozenLeftCount()) {
width = this_2.parent.getIndentCount() * 30;
}
else if (this_1.parent.getFrozenMode() === 'Right') {
width = this_1.parent.groupSettings.columns.length * 30;
else if (this_2.parent.getFrozenMode() === 'Right') {
width = this_2.parent.groupSettings.columns.length * 30;
}

@@ -641,6 +686,6 @@ for (var w = 0; w < cols.length; w++) {

}
applyStickyLeftRightPosition(node, ((width === 0 ? width : width - 1) - translateX), this_1.parent.enableRtl, 'Left');
applyStickyLeftRightPosition(node, ((width === 0 ? width : width - 1) - translateX), this_2.parent.enableRtl, 'Left');
}
else {
width = this_1.parent.getIndentCount() * 30;
width = this_2.parent.getIndentCount() * 30;
if (column.index === 0) {

@@ -652,4 +697,4 @@ if (summarycell && summarycell.length) {

}
applyStickyLeftRightPosition(node, width - translateX, this_1.parent.enableRtl, 'Left');
if (this_1.parent.enableColumnVirtualization) {
applyStickyLeftRightPosition(node, width - translateX, this_2.parent.enableRtl, 'Left');
if (this_2.parent.enableColumnVirtualization) {
column.valueX = width;

@@ -673,4 +718,4 @@ }

}
applyStickyLeftRightPosition(node, width - translateX, this_1.parent.enableRtl, 'Left');
if (this_1.parent.enableColumnVirtualization) {
applyStickyLeftRightPosition(node, width - translateX, this_2.parent.enableRtl, 'Left');
if (this_2.parent.enableColumnVirtualization) {
column.valueX = width;

@@ -681,5 +726,5 @@ }

};
var this_1 = this;
var this_2 = this;
for (var j = 0; j < th.length; j++) {
_loop_1(j);
_loop_2(j);
}

@@ -692,11 +737,11 @@ }

var th = [].slice.call(tr[parseInt(i.toString(), 10)].querySelectorAll('.e-rightfreeze, .e-fixedfreeze'));
var _loop_2 = function (j) {
var _loop_3 = function (j) {
var node = th[parseInt(j.toString(), 10)];
var column = this_2.getParticularCol(node);
var cols = this_2.parent.getColumns();
var column = this_3.getParticularCol(node);
var cols = this_3.parent.getColumns();
var width = 0;
var summarycell = [];
if (this_2.parent.aggregates.length && this_2.parent.getFooterContent()) {
if (this_2.parent.getContent().querySelectorAll('.e-summaryrow').length) {
var summaryRows = [].slice.call(this_2.parent.getContent().querySelectorAll('.e-summaryrow'));
if (this_3.parent.aggregates.length && this_3.parent.getFooterContent()) {
if (this_3.parent.getContent().querySelectorAll('.e-summaryrow').length) {
var summaryRows = [].slice.call(this_3.parent.getContent().querySelectorAll('.e-summaryrow'));
summaryRows.filter(function (row) {

@@ -706,6 +751,6 @@ summarycell.push(row.querySelector('[e-mappinguid="' + column.uid + '"]'));

}
summarycell = summarycell.concat([].slice.call(this_2.parent.getFooterContent().querySelectorAll('[e-mappinguid="' + column.uid + '"]')));
summarycell = summarycell.concat([].slice.call(this_3.parent.getFooterContent().querySelectorAll('[e-mappinguid="' + column.uid + '"]')));
}
if (node.classList.contains('e-fixedfreeze')) {
width = this_2.parent.getFrozenMode() === 'Right' && this_2.parent.isRowDragable() ? 30 : 0;
width = this_3.parent.getFrozenMode() === 'Right' && this_3.parent.isRowDragable() ? 30 : 0;
for (var w = cols.length - 1; w >= 0; w--) {

@@ -730,6 +775,6 @@ if (column.index < cols[parseInt(w.toString(), 10)].index) {

}
applyStickyLeftRightPosition(node, width + translateX, this_2.parent.enableRtl, 'Right');
applyStickyLeftRightPosition(node, width + translateX, this_3.parent.enableRtl, 'Right');
}
else {
width = this_2.parent.getFrozenMode() === 'Right' && this_2.parent.isRowDragable() ? 30 : 0;
width = this_3.parent.getFrozenMode() === 'Right' && this_3.parent.isRowDragable() ? 30 : 0;
for (var k = cols.length - 1; k >= 0; k--) {

@@ -750,4 +795,4 @@ if ((column.columns && isChildColumn(column, cols[parseInt(k.toString(), 10)].uid)) ||

}
applyStickyLeftRightPosition(node, width + translateX, this_2.parent.enableRtl, 'Right');
if (this_2.parent.enableColumnVirtualization) {
applyStickyLeftRightPosition(node, width + translateX, this_3.parent.enableRtl, 'Right');
if (this_3.parent.enableColumnVirtualization) {
column.valueX = width;

@@ -757,5 +802,5 @@ }

};
var this_2 = this;
var this_3 = this;
for (var j = th.length - 1; j >= 0; j--) {
_loop_2(j);
_loop_3(j);
}

@@ -829,4 +874,4 @@ }

var finalColumns = [];
for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
var col = columns_1[_i];
for (var _i = 0, columns_2 = columns; _i < columns_2.length; _i++) {
var col = columns_2[_i];
var totalWidth = 0;

@@ -923,4 +968,4 @@ for (var i = 0; i < columns.length; i++) {

var ele = _a[_i];
for (var _b = 0, columns_2 = columns; _b < columns_2.length; _b++) {
var column = columns_2[_b];
for (var _b = 0, columns_3 = columns; _b < columns_3.length; _b++) {
var column = columns_3[_b];
if (ele.querySelector('[e-mappinguid]') &&

@@ -927,0 +972,0 @@ ele.querySelector('[e-mappinguid]').getAttribute('e-mappinguid') === column.uid && column.visible) {

@@ -31,2 +31,3 @@ import { IGrid, NotifyArgs } from '../base/interface';

private drag;
private isNewRowAdded;
private groupRowDDIndicator;

@@ -33,0 +34,0 @@ private dragStop;

@@ -5,3 +5,3 @@ import { Draggable, isNullOrUndefined } from '@syncfusion/ej2-base';

import { parentsUntil, removeElement, getPosition, addRemoveActiveClasses, isActionPrevent } from '../base/util';
import { resetRowIndex } from '../base/util';
import { resetRowIndex, resetCachedRowIndex, groupReorderRowObject } from '../base/util';
import * as events from '../base/constant';

@@ -75,3 +75,5 @@ import { Scroll } from '../actions/scroll';

removeElement(_this.startedRow, '.e-detailrowexpand');
_this.removeCell(_this.startedRow, literals.gridChkBox);
if (!(gObj.enableInfiniteScrolling && gObj.infiniteScrollSettings.enableCache)) {
_this.removeCell(_this.startedRow, literals.gridChkBox);
}
var exp = new RegExp('e-active', 'g'); //high contrast issue

@@ -97,4 +99,4 @@ _this.startedRow.innerHTML = _this.startedRow.innerHTML.replace(exp, '');

var gObj = _this.parent;
if (gObj.enableVirtualization && gObj.allowGrouping && gObj.groupSettings.columns.length &&
!isNullOrUndefined(e.target.closest('tr'))) {
if ((gObj.enableVirtualization || gObj.infiniteScrollSettings.enableCache) && gObj.allowGrouping &&
gObj.groupSettings.columns.length && !isNullOrUndefined(e.target.closest('tr'))) {
var dragTrs = e.dragElement.querySelectorAll('tr');

@@ -195,4 +197,5 @@ var indentCells = e.target.closest('tr').querySelectorAll('.e-indentcell');

else {
var elem = parentsUntil(target, 'e-grid');
if (elem && elem.id === cloneElement.parentElement.id) {
var element = parentsUntil(target, 'e-grid');
if (element && element.id === cloneElement.parentElement.id && parentsUntil(target, 'e-row') &&
!parentsUntil(target, 'e-addedrow')) {
classList(cloneElement, ['e-movecur'], ['e-defaultcur']);

@@ -223,6 +226,12 @@ }

else {
var lastRowUid = _this.parent.getRowByIndex(_this.parent.getCurrentViewRecords().length - 1).
getAttribute('data-uid');
islastRowIndex = trElement && lastRowUid === trElement.getAttribute('data-uid') && lastRowUid !==
_this.startedRow.getAttribute('data-uid');
var rowIndex = _this.parent.enableInfiniteScrolling && _this.parent.infiniteScrollSettings.enableCache &&
!_this.parent.groupSettings.enableLazyLoading ?
_this.parent.pageSettings.currentPage * _this.parent.pageSettings.pageSize - 1 :
_this.parent.getCurrentViewRecords().length - 1;
var lastRow = _this.parent.getRowByIndex(rowIndex);
islastRowIndex = trElement && lastRow && lastRow.getAttribute('data-uid') === trElement.getAttribute('data-uid') &&
lastRow.getAttribute('data-uid') !== _this.startedRow.getAttribute('data-uid');
if (_this.isNewRowAdded() && _this.parent.editSettings.newRowPosition === 'Bottom') {
islastRowIndex = false;
}
}

@@ -271,2 +280,5 @@ if (islastRowIndex && !_this.parent.rowDropSettings.targetID) {

this.dragStop = function (e) {
if (_this.parent.isCheckBoxSelection && _this.parent.enableInfiniteScrolling) {
window.getSelection().removeAllRanges();
}
document.body.classList.remove('e-prevent-select');

@@ -383,2 +395,6 @@ if (isActionPrevent(_this.parent)) {

};
RowDD.prototype.isNewRowAdded = function () {
return this.parent.editSettings && this.parent.editSettings.showAddNewRow &&
!(this.parent.enableInfiniteScrolling || this.parent.enableVirtualization);
};
RowDD.prototype.groupRowDDIndicator = function (rowElement, isAdd) {

@@ -394,5 +410,7 @@ addRemoveActiveClasses([rowElement[0]], isAdd, 'e-dragleft');

for (var i = 0, len = args.rows.length; i < len; i++) {
if (gObj.enableVirtualization && gObj.allowGrouping && gObj.groupSettings.columns.length &&
var row = args.rows[parseInt(i.toString(), 10)];
if (((gObj.enableVirtualization && gObj.allowGrouping && gObj.groupSettings.columns.length) ||
(gObj.enableInfiniteScrolling && gObj.infiniteScrollSettings.enableCache)) &&
args.rows.length === 1) {
var removeElem = gObj.getRowElementByUID(args.rows[parseInt(i.toString(), 10)].getAttribute('data-uid'));
var removeElem = gObj.getRowElementByUID(row.getAttribute('data-uid'));
if (!isNullOrUndefined(removeElem)) {

@@ -402,5 +420,9 @@ remove(removeElem);

}
tbody.insertBefore(args.rows[parseInt(i.toString(), 10)], target);
var dragstartrow = row.querySelector('.e-dragstartrow');
if (dragstartrow) {
dragstartrow.classList.remove('e-dragstartrow');
}
tbody.insertBefore(row, target);
if (gObj.allowGrouping && gObj.groupSettings.columns.length) {
var dragRowUid = args.rows[parseInt(i.toString(), 10)].getAttribute('data-uid');
var dragRowUid = row.getAttribute('data-uid');
var dropRowUid = args.target.parentElement.getAttribute('data-uid');

@@ -414,12 +436,31 @@ var dragRowObject = gObj.getRowObjectFromUID(dragRowUid);

}
var tr = [].slice.call(tbody.getElementsByClassName(literals.row));
if (!gObj.enableVirtualization && gObj.allowGrouping && gObj.groupSettings.columns.length) {
gObj['groupModule'].groupReorderRowObject(args, tr);
resetRowIndex(this.parent, gObj.getRowsObject().filter(function (data) { return data.isDataRow; }), tr);
this.parent.notify(events.refreshExpandandCollapse, { rows: this.parent.getRowsObject() });
var tr = [].slice.call(gObj.editSettings.showAddNewRow ?
tbody.querySelectorAll('.e-row:not(.e-addedrow)') : tbody.getElementsByClassName(literals.row));
if (gObj.allowGrouping && gObj.groupSettings.columns.length) {
if (gObj.groupSettings.enableLazyLoading || (gObj.enableInfiniteScrolling &&
gObj.infiniteScrollSettings.enableCache && tr.length > gObj.pageSettings.pageSize * 3)) {
gObj.refresh();
}
else {
groupReorderRowObject(this.parent, args, tr);
if (gObj.enableVirtualization || (gObj.enableInfiniteScrolling && gObj.infiniteScrollSettings.enableCache)) {
resetCachedRowIndex(gObj);
}
else {
resetRowIndex(this.parent, gObj.getRowsObject().filter(function (data) { return data.isDataRow; }), tr);
}
this.parent.notify(events.refreshExpandandCollapse, {
rows: gObj.enableVirtualization ? this.parent.vRows : this.parent.getRowsObject()
});
}
}
else if (gObj.enableVirtualization && gObj.allowGrouping && gObj.groupSettings.columns.length) {
gObj['groupModule'].groupReorderRowObject(args, tr);
gObj['groupModule'].vGroupResetRowIndex();
this.parent.notify(events.refreshExpandandCollapse, { rows: this.parent.vRows });
else if (gObj.enableInfiniteScrolling && gObj.infiniteScrollSettings.enableCache &&
!gObj.groupSettings.columns.length) {
if (tr.length > gObj.pageSettings.pageSize * 3) {
gObj.refresh();
}
else {
groupReorderRowObject(this.parent, args, tr);
resetCachedRowIndex(gObj);
}
}

@@ -463,4 +504,8 @@ else {

}
var targetTR = gObj.getRowByIndex(targetIdx);
if (targetIdx === gObj.getRows().length && this.isNewRowAdded() && this.parent.editSettings.newRowPosition === 'Bottom') {
targetTR = this.parent.element.querySelector('.e-row.e-addedrow');
}
var tr = gObj.allowGrouping && gObj.groupSettings.columns.length && targetIdx !== -1 &&
args.fromIndex < args.dropIndex ? gObj.getRowByIndex(targetIdx).nextSibling : gObj.getRowByIndex(targetIdx);
args.fromIndex < args.dropIndex && targetTR ? targetTR.nextSibling : targetTR;
return tr;

@@ -540,2 +585,5 @@ };

}
else {
this.selectedRowColls = [];
}
};

@@ -711,3 +759,4 @@ RowDD.prototype.currentViewData = function () {

var targetRowIndex = parseInt(targetRow.getAttribute(literals.dataRowIndex), 10);
if (targetRow && targetRowIndex === 0) {
if (targetRow && targetRowIndex === 0 &&
!(this.isNewRowAdded() && this.parent.editSettings.newRowPosition === 'Top')) {
if (this.parent.allowGrouping && this.parent.groupSettings.columns.length) {

@@ -751,4 +800,9 @@ element = targetRow;

else {
element = this.parent.getRowByIndex(targetRowIndex - 1);
rowElement = [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse'));
if (targetRowIndex === 0 && this.isNewRowAdded() && this.parent.editSettings.newRowPosition === 'Top') {
element = this.parent.element.querySelector('.e-row.e-addedrow tr');
}
else {
element = this.parent.getRowByIndex(targetRowIndex - 1);
}
rowElement = [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell'));
}

@@ -775,5 +829,13 @@ }

if (this.isDropGrid.element.getElementsByClassName('e-firstrow-dragborder').length > 0 && element &&
element.rowIndex !== 0) {
(element.rowIndex !== 0 || element.classList.contains('e-columnheader'))) {
remove(this.isDropGrid.element.getElementsByClassName('e-firstrow-dragborder')[0]);
}
else {
var addNewRow = this.parent.element.querySelector('.e-row.e-addedrow tr');
if (addNewRow && addNewRow.querySelector('.e-dragborder')) {
var rowElement = [].slice.call(addNewRow.
querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell'));
addRemoveActiveClasses(rowElement, false, 'e-dragborder');
}
}
};

@@ -787,5 +849,8 @@ RowDD.prototype.removeLastRowBorder = function (element) {

else {
islastRowIndex = element &&
this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length - 1).getAttribute('data-uid') !==
element.getAttribute('data-uid');
var rowIndex = this.parent.enableInfiniteScrolling && this.parent.infiniteScrollSettings.enableCache &&
!this.parent.groupSettings.enableLazyLoading ?
this.parent.pageSettings.currentPage * this.parent.pageSettings.pageSize - 1 :
this.parent.getCurrentViewRecords().length - 1;
var lastRow = this.parent.getRowByIndex(rowIndex);
islastRowIndex = element && lastRow && lastRow.getAttribute('data-uid') !== element.getAttribute('data-uid');
}

@@ -965,11 +1030,11 @@ if (this.parent.element.getElementsByClassName('e-lastrow-dragborder').length > 0 && element && islastRowIndex) {

|| gObj.getSelectedRecords().length === 0) {
if (this.parent.enableVirtualization) {
if (gObj.enableVirtualization || (gObj.enableInfiniteScrolling && gObj.infiniteScrollSettings.enableCache)) {
this.rows = [this.startedRow];
}
else {
this.rows = [this.parent.getRowByIndex(dragIdx)];
this.rows = [gObj.getRowByIndex(dragIdx)];
}
this.rowData = [this.parent.getRowInfo((this.startedRow).querySelector('.' + literals.rowCell)).rowData];
if (gObj.enableVirtualization && gObj.allowGrouping && gObj.groupSettings.columns.length &&
gObj.getSelectedRows().length) {
this.rowData = [gObj.getRowInfo((this.startedRow).querySelector('.' + literals.rowCell)).rowData];
if ((gObj.enableVirtualization || (gObj.enableInfiniteScrolling && gObj.infiniteScrollSettings.enableCache))
&& gObj.allowGrouping && gObj.groupSettings.columns.length && gObj.getSelectedRows().length) {
this.rows = gObj.getSelectedRows();

@@ -976,0 +1041,0 @@ this.rowData = gObj.getSelectedRecords();

@@ -265,3 +265,4 @@ import { Browser, EventHandler } from '@syncfusion/ej2-base';

var left = target.scrollLeft;
if (!isNullOrUndefined(_this.parent.infiniteScrollModule) && _this.parent.enableInfiniteScrolling && !_this.parent.isEdit) {
if (!isNullOrUndefined(_this.parent.infiniteScrollModule) && _this.parent.enableInfiniteScrolling && (!_this.parent.isEdit
|| (_this.parent.editSettings.showAddNewRow && !_this.parent.element.querySelector('.e-editedrow')))) {
_this.parent.notify(infiniteScrollHandler, { target: e.target, isLeft: _this.previousValues.left !== left });

@@ -481,4 +482,13 @@ }

removeClass(table.querySelector('tr:nth-last-child(2)').querySelectorAll('td'), 'e-lastrowcell');
if (this.parent.isSpan) {
removeClass(table.querySelectorAll('.e-row-span-lastrowcell'), 'e-lastrowcell');
}
if (this.parent.editSettings.showAddNewRow && this.parent.editSettings.newRowPosition === 'Bottom') {
addClass(table.querySelector('tr:nth-last-child(2)').querySelectorAll('td'), 'e-lastrowcell');
}
}
addClass(table.querySelectorAll('tr:last-child td'), 'e-lastrowcell');
if (this.parent.isSpan) {
addClass(table.querySelectorAll('.e-row-span-lastrowcell'), 'e-lastrowcell');
}
};

@@ -485,0 +495,0 @@ /**

@@ -324,2 +324,3 @@ import { IGrid, IAction, IIndex, ISelectedCell } from '../base/interface';

private createAFBorders;
destroyAutoFillElements(): void;
private showAFBorders;

@@ -326,0 +327,0 @@ private hideAFBorders;

@@ -1,2 +0,2 @@

import { isNullOrUndefined } from '@syncfusion/ej2-base';
import { isNullOrUndefined, remove } from '@syncfusion/ej2-base';
import { iterateArrayOrObject, isGroupAdaptive, isActionPrevent, addRemoveEventListener } from '../base/util';

@@ -156,2 +156,11 @@ import * as events from '../base/constant';

}
var addedRow = _this.parent.element.querySelector('.e-addedrow');
if (_this.parent.editSettings.showAddNewRow && addedRow) {
remove(addedRow);
if (_this.parent.enableVirtualization || _this.parent.enableInfiniteScrolling) {
_this.parent.isAddNewRow = true;
}
_this.parent.addNewRowFocus = true;
_this.parent.isEdit = false;
}
if (_this.parent.allowSelection && _this.parent.getSelectedRecords().length &&

@@ -178,2 +187,10 @@ !_this.parent.selectionSettings.persistSelection) {

_this.parent.trigger(events.actionComplete, params);
var startAdd = !_this.parent.element.querySelector('.e-addedrow');
if (_this.parent.editSettings.showAddNewRow && startAdd) {
_this.parent.isEdit = false;
_this.parent.addRecord();
if (!(_this.parent.enableVirtualization || _this.parent.enableInfiniteScrolling)) {
_this.parent.notify(events.showAddNewRowFocus, {});
}
}
if (_this.parent.columnQueryMode !== 'All') {

@@ -180,0 +197,0 @@ _this.parent.refresh();

@@ -327,2 +327,3 @@ import { EventHandler, extend, isNullOrUndefined } from '@syncfusion/ej2-base';

var hasData = gObj.currentViewData && gObj.currentViewData.length;
var addRow = edit.showAddNewRow && !gObj.element.querySelector('.e-editedrow');
if (edit.allowAdding) {

@@ -357,5 +358,7 @@ enableItems.push(this.gridID + '_add');

else {
if (gObj.isEdit && (edit.allowAdding || edit.allowEditing)) {
enableItems = [this.gridID + '_update', this.gridID + '_cancel'];
disableItems = [this.gridID + '_add', this.gridID + '_edit', this.gridID + '_delete'];
if ((gObj.isEdit || edit.showAddNewRow) && (edit.allowAdding || edit.allowEditing)) {
enableItems = addRow ? [this.gridID + '_update', this.gridID + '_cancel', this.gridID + '_edit', this.gridID + '_delete'] :
[this.gridID + '_update', this.gridID + '_cancel'];
disableItems = addRow ? [this.gridID + '_add'] :
[this.gridID + '_add', this.gridID + '_edit', this.gridID + '_delete'];
}

@@ -650,3 +653,3 @@ else {

this.sIcon.classList.add('e-clear-icon');
this.sIcon.setAttribute('title', this.l10n.getConstant('ClearButton'));
this.sIcon.setAttribute('title', this.l10n.getConstant('Clear'));
this.sIcon.style.cursor = 'pointer';

@@ -653,0 +656,0 @@ }

@@ -209,2 +209,4 @@ /** @hidden */

/** @hidden */
export declare const destroyAutoFillElements: string;
/** @hidden */
export declare const beforeCellFocused: string;

@@ -575,1 +577,3 @@ /** @hidden */

export declare const renderResponsiveColumnChooserDiv: string;
/** @hidden */
export declare const showAddNewRowFocus: string;

@@ -209,2 +209,4 @@ /** @hidden */

/** @hidden */
export var destroyAutoFillElements = 'destroy-autofill-elements';
/** @hidden */
export var beforeCellFocused = 'beforecellfocused';

@@ -575,1 +577,3 @@ /** @hidden */

export var renderResponsiveColumnChooserDiv = 'render-Responsive-Column-Chooser-Div';
/** @hidden */
export var showAddNewRowFocus = 'show-Add-New-Row-Focus';

@@ -1,2 +0,2 @@

import { IPosition, IGrid, IRow, IExpandedRow, PdfExportProperties, ExcelExportProperties } from './interface';
import { IPosition, IGrid, IRow, IExpandedRow, PdfExportProperties, ExcelExportProperties, RowDropEventArgs } from './interface';
import { ServiceLocator } from '../services/service-locator';

@@ -551,2 +551,17 @@ import { Query, Predicate } from '@syncfusion/ej2-data';

/**
* @param {IGrid} gObj - Defines the IGrid
* @returns {void}
* @hidden
*/
export declare function resetCachedRowIndex(gObj: IGrid): void;
/**
* @param {IGrid} gObj - Defines the IGrid
* @param {RowDropEventArgs} args - Defines the row drop event argument
* @param {HTMLTableRowElement[]} tr - Row elements
* @param {Row<Column>} dropRObj - dropped row object
* @returns {void}
* @hidden
*/
export declare function groupReorderRowObject(gObj: IGrid, args: RowDropEventArgs, tr: HTMLTableRowElement[], dropRObj?: Row<Column>): void;
/**
* @param {IGrid} gObj - Defines the grid object

@@ -613,5 +628,22 @@ * @param {Object} changes - Defines the changes

* @param {Element} node - Defines the Element
* @param {number} colSpan - Defines the colSpan value
* @returns {void}
* @hidden
*/
export declare function resetColandRowSpanStickyPosition(gObj: IGrid, column: Column, node: Element, colSpan: number): void;
/**
* @param {IGrid} gObj - Defines the grid
* @param {number} rowIndex - Defines the row index
* @param {number} colIndex - Defines the colum index
* @returns {void}
* @hidden
*/
export declare function getCellFromRow(gObj: IGrid, rowIndex: number, colIndex: number): Element;
/**
* @param {IGrid} gObj - Defines the grid
* @param {Column} column - Defines the column
* @param {Element} node - Defines the Element
* @returns {void}
* @hidden
*/
export declare function addStickyColumnPosition(gObj: IGrid, column: Column, node: Element): void;

@@ -618,0 +650,0 @@ /**

@@ -53,3 +53,3 @@ import { getZIndexCalcualtion } from '../base/util';

var drpuiObj = document.querySelector('#bool-ui-' + column.uid).ej2_instances[0];
var filterValue = drpuiObj.value;
var filterValue = (drpuiObj.value);
filterObj.filterByColumn(column.field, filterOptr, filterValue, 'and', false);

@@ -56,0 +56,0 @@ };

@@ -17,3 +17,3 @@ var __extends = (this && this.__extends) || (function () {

import { CellRenderer } from './cell-renderer';
import { addStickyColumnPosition, appendChildren } from '../base/util';
import { addStickyColumnPosition, appendChildren, parentsUntil } from '../base/util';
import { destroy, commandColumnDestroy } from '../base/constant';

@@ -43,3 +43,5 @@ /**

for (var i = 0; i < this.childRefs.length; i++) {
if (this.childRefs[parseInt(i.toString(), 10)] && !this.childRefs[parseInt(i.toString(), 10)].isDestroyed) {
if (this.childRefs[parseInt(i.toString(), 10)] && !this.childRefs[parseInt(i.toString(), 10)].isDestroyed
&& !(this.parent.editSettings.showAddNewRow && this.parent.enableVirtualization
&& parentsUntil(this.childRefs[parseInt(i.toString(), 10)].element, 'e-addedrow'))) {
this.childRefs[parseInt(i.toString(), 10)].destroy();

@@ -56,3 +58,4 @@ if (this.childRefs[parseInt(i.toString(), 10)].element) {

for (var i = 0; i < elem.length; i++) {
if (elem[parseInt(i.toString(), 10)]) {
if (elem[parseInt(i.toString(), 10)] && !(this.parent.editSettings.showAddNewRow && this.parent.enableVirtualization
&& parentsUntil(elem[parseInt(i.toString(), 10)], 'e-addedrow'))) {
if (elem[parseInt(i.toString(), 10)].querySelector('.e-unboundcelldiv')) {

@@ -103,3 +106,4 @@ elem[parseInt(i.toString(), 10)].querySelector('.e-unboundcelldiv').innerHTML = '';

this.setAttributes(node, cell, attributes);
if ((!this.parent.enableVirtualization && this.parent.isEdit) || isVirtualEdit) {
if ((!this.parent.enableVirtualization && (this.parent.isEdit && (!this.parent.editSettings.showAddNewRow ||
(this.parent.editSettings.showAddNewRow && (!this.parent.element.querySelector('.e-editedrow')))))) || isVirtualEdit) {
addClass([].slice.call(node.getElementsByClassName('e-edit-delete')), 'e-hide');

@@ -106,0 +110,0 @@ removeClass([].slice.call(node.getElementsByClassName('e-save-cancel')), 'e-hide');

@@ -86,2 +86,4 @@ import { IRenderer, IGrid, NotifyArgs, IModelGenerator } from '../base/interface';

refreshContentRows(args?: NotifyArgs): void;
protected isInfiniteColumnvirtualization(): boolean;
protected enableCacheOnInfiniteColumnVirtual(): boolean;
emptyVcRows(): void;

@@ -88,0 +90,0 @@ appendContent(tbody: Element, frag: DocumentFragment, args: NotifyArgs, tableName?: string): void;

import { Droppable } from '@syncfusion/ej2-base';
import { isNullOrUndefined, extend } from '@syncfusion/ej2-base';
import { setStyleAttribute, remove, updateBlazorTemplate } from '@syncfusion/ej2-base';
import { getUpdateUsingRaf, appendChildren, setDisplayValue, clearReactVueTemplates, getScrollBarWidth, getScrollWidth } from '../base/util';
import { getUpdateUsingRaf, appendChildren, setDisplayValue, clearReactVueTemplates, getScrollBarWidth, getScrollWidth, getTransformValues } from '../base/util';
import * as events from '../base/constant';

@@ -79,2 +79,6 @@ import { RowRenderer } from './row-renderer';

_this.parent.notify(events.contentReady, { rows: rows, args: arg });
if (_this.parent.editSettings.showAddNewRow && _this.parent.addNewRowFocus) {
_this.parent.notify(events.showAddNewRowFocus, {});
_this.parent.addNewRowFocus = false;
}
if (_this.parent.autoFit) {

@@ -287,2 +291,3 @@ _this.parent.preventAdjustColumns();

&& args.requestType === 'infiniteScroll';
var isColumnVirtualInfiniteProcess = this.isInfiniteColumnvirtualization() && args.requestType !== 'virtualscroll';
gObj.notify(events.destroyChildGrid, {});

@@ -557,3 +562,4 @@ this.rowElements = [];

_this.parent.notify(events.beforeFragAppend, args);
if (!_this.parent.enableVirtualization && !_this.parent.enableColumnVirtualization && !isInfiniteScroll) {
if (!_this.parent.enableVirtualization && (!_this.parent.enableColumnVirtualization || isColumnVirtualInfiniteProcess)
&& !isInfiniteScroll) {
if (!gObj.isReact) {

@@ -573,3 +579,4 @@ _this.tbody.innerHTML = '';

}
if (!isNullOrUndefined(_this.parent.infiniteScrollModule) && _this.parent.enableInfiniteScrolling) {
if (!isNullOrUndefined(_this.parent.infiniteScrollModule) && ((_this.parent.enableInfiniteScrolling
&& !_this.isInfiniteColumnvirtualization()) || isColumnVirtualInfiniteProcess)) {
_this.isAddRows = false;

@@ -582,2 +589,8 @@ _this.parent.notify(events.removeInfiniteRows, { args: args });

});
if (_this.isInfiniteColumnvirtualization() && _this.parent.isFrozenGrid()) {
var virtualTable = _this.parent.getContent().querySelector('.e-virtualtable');
var transform = getTransformValues(virtualTable);
_this.parent.contentModule.resetStickyLeftPos(transform.width);
_this.widthService.refreshFrozenScrollbar();
}
}

@@ -588,2 +601,23 @@ else {

}
if (_this.parent.editSettings.showAddNewRow && (_this.parent.enableVirtualization || _this.parent.enableInfiniteScrolling)) {
var newRow = _this.parent.element.querySelector('.e-addrow-removed');
if (newRow) {
remove(newRow);
}
}
var startAdd = !_this.parent.element.querySelector('.' + literals.addedRow);
if (_this.parent.editSettings.showAddNewRow && _this.parent.editSettings.mode === 'Normal') {
if (startAdd) {
if (_this.parent.enableVirtualization || _this.parent.enableInfiniteScrolling) {
_this.parent.isAddNewRow = true;
}
_this.parent.isEdit = false;
_this.parent.addRecord();
}
if (startAdd || ((_this.parent.enableVirtualization || _this.parent.enableInfiniteScrolling) &&
['sorting', 'filtering', 'searching', 'grouping', 'ungrouping', 'reorder']
.some(function (value) { return args.requestType === value; }))) {
_this.parent.notify(events.showAddNewRowFocus, {});
}
}
if (_this.parent.getVisibleFrozenRightCount() && _this.parent.getContent() && getScrollWidth(_this.parent) > 0) {

@@ -595,2 +629,8 @@ _this.parent.element.classList.add('e-right-shadow');

};
ContentRender.prototype.isInfiniteColumnvirtualization = function () {
return this.parent.enableColumnVirtualization && this.parent.enableInfiniteScrolling;
};
ContentRender.prototype.enableCacheOnInfiniteColumnVirtual = function () {
return this.isInfiniteColumnvirtualization() && this.parent.infiniteScrollSettings.enableCache;
};
ContentRender.prototype.emptyVcRows = function () {

@@ -668,6 +708,5 @@ this.parent.vcRows = [];

ContentRender.prototype.setInfiniteVisibleRows = function (args, data) {
if (this.parent.enableInfiniteScrolling && !this.parent.infiniteScrollSettings.enableCache) {
if (!this.parent.infiniteScrollSettings.enableCache) {
this.visibleRows.push(data);
}
if (this.parent.enableInfiniteScrolling && !this.parent.infiniteScrollSettings.enableCache
&& !(this.isInfiniteColumnvirtualization() && args.requestType === 'virtualscroll')) {
this.visibleRows.push(data);
}

@@ -857,2 +896,5 @@ };

this.parent.notify(events.partialRefresh, { rows: contentrows, args: args });
if (this.parent.editSettings.showAddNewRow && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
this.parent.notify(events.showAddNewRowFocus, {});
}
}

@@ -859,0 +901,0 @@ };

@@ -52,4 +52,5 @@ import { isNullOrUndefined, closest, extend } from '@syncfusion/ej2-base';

var form = gObj.editSettings.mode === 'Dialog' ?
select('#' + gObj.element.id + '_dialogEdit_wrapper .e-gridform', document) :
gObj.element.getElementsByClassName('e-gridform')[0];
select('#' + gObj.element.id + '_dialogEdit_wrapper .e-gridform', document) : gObj.editSettings.showAddNewRow &&
gObj.element.querySelector('.e-editedrow') ? gObj.element.querySelector('.e-editedrow').getElementsByClassName('e-gridform')[0]
: gObj.element.getElementsByClassName('e-gridform')[0];
var cols = gObj.editSettings.mode !== 'Batch' ? gObj.getColumns() : [gObj.getColumnByField(args.columnName)];

@@ -90,3 +91,3 @@ for (var _i = 0, cols_1 = cols; _i < cols_1.length; _i++) {

}
if (!isFocused && !cell.getAttribute('disabled') && !parentsUntil(cell, 'e-checkbox-disabled')) {
if (!isFocused && isNullOrUndefined(cell.getAttribute('disabled')) && !parentsUntil(cell, 'e-checkbox-disabled')) {
this.focusElement(cell, args.type);

@@ -109,4 +110,5 @@ isFocused = true;

var isFocus = (this.parent.enableVirtualization || this.parent.enableColumnVirtualization) && this.parent.editSettings.mode === 'Normal' ? false : true;
if (isFocus || ((this.parent.enableVirtualization || this.parent.enableColumnVirtualization) && this.parent.editSettings.newRowPosition === 'Bottom'
&& parentsUntil(elem, literals.addedRow))) {
if ((isFocus || ((this.parent.enableVirtualization || this.parent.enableColumnVirtualization) && this.parent.editSettings.newRowPosition === 'Bottom'
&& parentsUntil(elem, literals.addedRow))) && (!this.parent.editSettings.showAddNewRow ||
(this.parent.editSettings.showAddNewRow && (!parentsUntil(elem, literals.addedRow)) || this.parent.addNewRowFocus))) {
elem.focus();

@@ -113,0 +115,0 @@ }

@@ -43,3 +43,4 @@ var __extends = (this && this.__extends) || (function () {

node.setAttribute('tabindex', '-1');
if (this.parent.infiniteScrollSettings && this.parent.infiniteScrollSettings.enableCache) {
if (this.parent.infiniteScrollSettings && this.parent.infiniteScrollSettings.enableCache &&
!this.parent.groupSettings.enableLazyLoading) {
cell.cellType = CellType.Indent;

@@ -46,0 +47,0 @@ node.className = isExpand ? 'e-recordplusexpand e-disablepointer' : 'e-recordpluscollapse e-disablepointer';

@@ -275,6 +275,9 @@ import { isNullOrUndefined, extend } from '@syncfusion/ej2-base';

var thead = findHeaderRow.thead;
var tbody = this.parent.createElement(literals.tbody, { className: this.parent.frozenRows ? '' : 'e-hide', attrs: { role: 'rowgroup' } });
var tbody = this.parent.createElement(literals.tbody, { className: this.parent.frozenRows ||
((this.parent.enableVirtualization || this.parent.enableInfiniteScrolling) && this.parent.editSettings.showAddNewRow) ? '' :
'e-hide', attrs: { role: 'rowgroup' } });
this.caption = this.parent.createElement('caption', { innerHTML: this.parent.element.id + '_header_table', className: 'e-hide' });
var colGroup = this.parent.createElement(literals.colGroup);
var rowBody = this.parent.createElement('tr', { attrs: { role: 'row' } });
var rowBody = this.parent.createElement('tr', { attrs: { role: 'row' }, className: (this.parent.enableVirtualization ||
this.parent.enableInfiniteScrolling) && this.parent.editSettings.showAddNewRow ? 'e-hide' : '' });
var bodyCell;

@@ -527,4 +530,10 @@ var rows = this.rows = findHeaderRow.rows;

setStyleAttribute(this.getColGroup().children[parseInt(idx.toString(), 10)], { 'display': displayVal });
if (gObj.editSettings.showAddNewRow && gObj.element.querySelector('.e-addedrow')) {
setStyleAttribute(gObj.element.querySelector('.e-addedrow').querySelector('colgroup').childNodes[parseInt(idx.toString(), 10)], { 'display': displayVal });
}
}
this.refreshUI();
if (this.parent.editSettings.showAddNewRow) {
this.parent.isAddNewRow = true;
}
};

@@ -547,2 +556,7 @@ HeaderRender.prototype.colPosRefresh = function () {

remove(table);
if (this.parent.editSettings.showAddNewRow && !this.parent.isAddNewRow && table.querySelector('.e-addedrow') &&
(this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
(table.querySelector('.e-addedrow')).classList.add('e-addrow-removed');
this.parent.isAddNewRow = true;
}
table.removeChild(table.firstChild);

@@ -549,0 +563,0 @@ table.removeChild(table.childNodes[0]);

import { isNullOrUndefined, addClass, extend } from '@syncfusion/ej2-base';
import { appendChildren, setStyleAndAttributes, addFixedColumnBorder, addStickyColumnPosition } from '../base/util';
import { appendChildren, setStyleAndAttributes, addFixedColumnBorder, addStickyColumnPosition, resetColandRowSpanStickyPosition } from '../base/util';
import * as literals from '../base/string-literals';

@@ -21,3 +21,4 @@ /**

var tbody;
if (this.parent.frozenRows && this.parent.editSettings.newRowPosition === 'Top') {
if ((this.parent.frozenRows || ((this.parent.enableVirtualization || this.parent.enableInfiniteScrolling) &&
this.parent.editSettings.showAddNewRow)) && this.parent.editSettings.newRowPosition === 'Top') {
tbody = this.parent.getHeaderTable().querySelector(literals.tbody);

@@ -29,3 +30,3 @@ }

args.row = this.parent.createElement('tr', { className: 'e-row e-addedrow' });
if (this.parent.getContentTable().querySelector('.e-emptyrow')) {
if (this.parent.getContentTable().querySelector('.e-emptyrow') && !this.parent.editSettings.showAddNewRow) {
var emptyRow = this.parent.getContentTable().querySelector('.e-emptyrow');

@@ -96,3 +97,4 @@ emptyRow.parentNode.removeChild(emptyRow);

while ((isEdit && m < tdElement.length && i < cols.length) || i < cols.length) {
var span = isEdit ? tdElement[parseInt(m.toString(), 10)].getAttribute('colspan') : null;
var span = isEdit && tdElement[parseInt(m.toString(), 10)] ?
tdElement[parseInt(m.toString(), 10)].getAttribute('colspan') : null;
var col = cols[parseInt(i.toString(), 10)];

@@ -123,2 +125,6 @@ inputValue = (elements[col.uid]).value;

addStickyColumnPosition(this.parent, col, td_1);
if (this.parent.isSpan) {
var colSpan = td_1.getAttribute('colspan') ? parseInt(td_1.getAttribute('colspan'), 10) : 1;
resetColandRowSpanStickyPosition(this.parent, col, td_1, colSpan);
}
if (this.parent.enableColumnVirtualization) {

@@ -125,0 +131,0 @@ if (col.freeze === 'Left' && !isNullOrUndefined(col.valueX)) {

@@ -0,1 +1,2 @@

import { Predicate } from '@syncfusion/ej2-data';
import { IGrid, NotifyArgs } from '../base/interface';

@@ -107,4 +108,15 @@ import { ReturnType } from '../base/type';

validateGroupRecords(e: ReturnType): Promise<Object>;
private getPredicate;
private updateGroupInfo;
/**
* @param {string} key - Defines the key
* @param {string} operator - Defines the operator
* @param {string | number | Date} value - Defines the value
* @returns {Predicate} - Returns the predicate
* @hidden */
getPredicate(key: string, operator: string, value: string | number | Date): Predicate;
/**
* @param {Object[]} current - Defines the current object
* @param {Object[]} untouched - Defines the object needs to merge
* @returns {Object[]} - Returns the updated group information
* @hidden */
updateGroupInfo(current: Object[], untouched: Object[]): Object[];
}

@@ -346,3 +346,5 @@ import { remove, resetBlazorTemplate, blazorTemplates, getValue } from '@syncfusion/ej2-base';

}
var tr = this.parent.createElement('tr', { className: 'e-emptyrow', attrs: { role: 'row' } });
var className = gObj.editSettings.showAddNewRow && gObj.editSettings.newRowPosition === 'Bottom' ?
'e-emptyrow e-show-added-row' : 'e-emptyrow';
var tr = this.parent.createElement('tr', { className: className, attrs: { role: 'row' } });
var td;

@@ -381,2 +383,6 @@ if (gObj.emptyRecordTemplate) {

this.parent.notify(events.onEmpty, { rows: [new Row({ isDataRow: true, cells: [new Cell({ isDataCell: true, visible: true })] })] });
if (gObj.editSettings.showAddNewRow) {
gObj.addRecord();
this.parent.notify(events.showAddNewRowFocus, {});
}
}

@@ -737,2 +743,8 @@ };

};
/**
* @param {string} key - Defines the key
* @param {string} operator - Defines the operator
* @param {string | number | Date} value - Defines the value
* @returns {Predicate} - Returns the predicate
* @hidden */
Render.prototype.getPredicate = function (key, operator, value) {

@@ -744,2 +756,7 @@ if (value instanceof Date) {

};
/**
* @param {Object[]} current - Defines the current object
* @param {Object[]} untouched - Defines the object needs to merge
* @returns {Object[]} - Returns the updated group information
* @hidden */
Render.prototype.updateGroupInfo = function (current, untouched) {

@@ -749,34 +766,35 @@ var dm = new DataManager(untouched);

for (var i = 0; i < elements.length; i++) {
var uGroup = dm.executeLocal(new Query()
var updatedGroup = dm.executeLocal(new Query()
.where(new Predicate('field', '==', elements[parseInt(i.toString(), 10)].field).and(this.getPredicate('key', 'equal', elements[parseInt(i.toString(), 10)].key))))[0];
elements[parseInt(i.toString(), 10)].count = uGroup.count;
var itemGroup = elements[parseInt(i.toString(), 10)].items;
var uGroupItem = uGroup.items;
if (itemGroup.GroupGuid) {
elements[parseInt(i.toString(), 10)].items =
this.updateGroupInfo(elements[parseInt(i.toString(), 10)].items, uGroup.items);
}
var rows = this.parent.aggregates;
for (var j = 0; j < rows.length; j++) {
var row = rows[parseInt(j.toString(), 10)];
for (var k = 0; k < row.columns.length; k++) {
var types = row.columns[parseInt(k.toString(), 10)].type instanceof Array ?
(row.columns[parseInt(k.toString(), 10)].type) :
[(row.columns[parseInt(k.toString(), 10)].type)];
for (var l = 0; l < types.length; l++) {
var key = row.columns[parseInt(k.toString(), 10)].field + ' - ' + types[parseInt(l.toString(), 10)].toLowerCase();
var data = itemGroup.level ? uGroupItem.records : uGroup.items;
var context = this.parent;
if (types[parseInt(l.toString(), 10)] === 'Custom') {
var data_1 = itemGroup.level ? uGroupItem : uGroup;
var temp = row.columns[parseInt(k.toString(), 10)]
.customAggregate;
if (typeof temp === 'string') {
temp = getValue(temp, window);
if (!isNullOrUndefined(updatedGroup)) {
elements[parseInt(i.toString(), 10)].count = updatedGroup.count;
var itemGroup = elements[parseInt(i.toString(), 10)].items;
var updatedGroupItem = updatedGroup.items;
if (itemGroup.GroupGuid) {
elements[parseInt(i.toString(), 10)].items =
this.updateGroupInfo(elements[parseInt(i.toString(), 10)].items, updatedGroup.items);
}
var rows = this.parent.aggregates;
for (var j = 0; j < rows.length; j++) {
var row = rows[parseInt(j.toString(), 10)];
for (var k = 0; k < row.columns.length; k++) {
var column = row.columns[parseInt(k.toString(), 10)];
var types = column.type instanceof Array ? (column.type) : [(column.type)];
for (var l = 0; l < types.length; l++) {
var key = column.field + ' - ' + types[parseInt(l.toString(), 10)].toLowerCase();
var data = itemGroup.level ? updatedGroupItem.records : updatedGroup.items;
var context = this.parent;
if (types[parseInt(l.toString(), 10)] === 'Custom') {
var data_1 = itemGroup.level ? updatedGroupItem : updatedGroup;
var temp = column
.customAggregate;
if (typeof temp === 'string') {
temp = getValue(temp, window);
}
elements[parseInt(i.toString(), 10)].aggregates["" + key] = temp ? temp.call(context, data_1, row.columns[parseInt(k.toString(), 10)]) : '';
}
elements[parseInt(i.toString(), 10)].aggregates["" + key] = temp ? temp.call(context, data_1, row.columns[parseInt(k.toString(), 10)]) : '';
else {
elements[parseInt(i.toString(), 10)].aggregates["" + key] = DataUtil.aggregates[types[parseInt(l.toString(), 10)].toLowerCase()](data, row.columns[parseInt(k.toString(), 10)].field);
}
}
else {
elements[parseInt(i.toString(), 10)].aggregates["" + key] = DataUtil.aggregates[types[parseInt(l.toString(), 10)].toLowerCase()](data, row.columns[parseInt(k.toString(), 10)].field);
}
}

@@ -783,0 +801,0 @@ }

@@ -46,2 +46,3 @@ import { Column } from '../models/column';

private refreshRow;
private resetrowSpanvalue;
private disableRowSelection;

@@ -48,0 +49,0 @@ private refreshMergeCells;

import { isNullOrUndefined, extend, addClass, removeClass } from '@syncfusion/ej2-base';
import { attributes as addAttributes } from '@syncfusion/ej2-base';
import { rowDataBound, queryCellInfo } from '../base/constant';
import { setStyleAndAttributes, getObject, extendObjWithFn, applyStickyLeftRightPosition, groupCaptionRowLeftRightPos, resetColspanGroupCaption } from '../base/util';
import { setStyleAndAttributes, getObject, extendObjWithFn, applyStickyLeftRightPosition, groupCaptionRowLeftRightPos, resetColspanGroupCaption, resetColandRowSpanStickyPosition } from '../base/util';
import { CellType } from '../base/enum';

@@ -91,2 +91,3 @@ import { CellMergeRender } from './cell-merge-renderer';

var value = false;
var isFrozen = this.parent.isFrozenGrid();
if (chekBoxEnable) {

@@ -150,3 +151,3 @@ value = getObject(chekBoxEnable.field, rowArgs.data);

var isRowSpanned = false;
if (row.index > 0 && this_1.isSpan) {
if (row.index > 0 && (this_1.isSpan || (this_1.parent.isSpan && isEdit))) {
var rowsObject = this_1.parent.getRowsObject();

@@ -161,9 +162,79 @@ var prevRowCells = this_1.parent.groupSettings.columns.length > 0 &&

}
if ((cellArgs.rowSpan > 1 || cellArgs.colSpan > 1)) {
this_1.resetrowSpanvalue(this_1.parent.frozenRows > row.index ? this_1.parent.frozenRows :
this_1.parent.currentViewData.length, cellArgs, row.index);
if (cellArgs.column.visible === false) {
cellArgs.colSpan = 1;
}
else {
if (isFrozen) {
var columns_2 = this_1.parent.getColumns();
var right = this_1.parent.getFrozenRightColumnsCount();
var left = this_1.parent.getFrozenLeftCount();
var movableCount = columns_2.length - right;
var cellIdx = cellArgs.column.index;
if (left > cellIdx && left < (cellIdx + cellArgs.colSpan)) {
var colSpan = (cellIdx + cellArgs.colSpan) - left;
cellArgs.colSpan = cellArgs.colSpan - colSpan;
}
else if (movableCount <= cellIdx && columns_2.length < (cellIdx + cellArgs.colSpan)) {
var colSpan = (cellIdx + cellArgs.colSpan) - columns_2.length;
cellArgs.colSpan = cellArgs.colSpan - colSpan;
}
else if (cellArgs.column.freeze === 'Fixed') {
var colSpan = 1;
var index = cellIdx;
for (var j = index + 1; j < index + cellArgs.colSpan; j++) {
if (columns_2[parseInt(j.toString(), 10)].freeze === 'Fixed') {
colSpan++;
}
else {
break;
}
}
cellArgs.colSpan = colSpan;
}
else if (movableCount > cellIdx && movableCount < (cellIdx + cellArgs.colSpan)) {
var colSpan = (cellIdx + cellArgs.colSpan) - movableCount;
cellArgs.colSpan = cellArgs.colSpan - colSpan;
}
}
}
}
if (cellArgs.colSpan > 1 || row.cells[parseInt(i.toString(), 10)].cellSpan > 1 || cellArgs.rowSpan > 1
|| isRowSpanned) {
this_1.parent.isSpan = true;
this_1.isSpan = true;
var cellMerge = new CellMergeRender(this_1.serviceLocator, this_1.parent);
td = cellMerge.render(cellArgs, row, i, td);
if (isFrozen) {
resetColandRowSpanStickyPosition(this_1.parent, cellArgs.column, td, cellArgs.colSpan);
}
}
}
if (isFrozen && this_1.isSpan) {
var rowsObject = this_1.parent.getRowsObject();
var isRtl = this_1.parent.enableRtl;
if (rowsObject[row.index - 1]) {
var prevRowCells = rowsObject[row.index - 1].cells;
var prevRowCell = prevRowCells[i - 1];
var nextRowCell = prevRowCells[i + 1];
var direction = prevRowCells[parseInt(i.toString(), 10)].column.freeze;
if (prevRowCell && (prevRowCell.isRowSpanned || prevRowCell.rowSpanRange > 1) && prevRowCell.visible) {
if (prevRowCell.column.freeze === 'Fixed' && direction === 'Fixed') {
td.classList.add(isRtl ? 'e-removefreezerightborder' : 'e-removefreezeleftborder');
}
else if (!isRtl && i === 1 && direction === 'Left') {
td.classList.add('e-addfreezefirstchildborder');
}
}
if (nextRowCell && (nextRowCell.isRowSpanned || nextRowCell.rowSpanRange > 1) && nextRowCell.visible &&
nextRowCell.column.freeze === 'Fixed' && direction === 'Fixed' && cellArgs.colSpan < 2) {
td.classList.add(isRtl ? 'e-removefreezeleftborder' : 'e-removefreezerightborder');
}
}
}
if (cellArgs.rowSpan > 1 && this_1.parent.currentViewData.length - row.index === cellArgs.rowSpan) {
td.classList.add('e-row-span-lastrowcell');
}
if (!row.cells[parseInt(i.toString(), 10)].isSpanned) {

@@ -298,2 +369,8 @@ tr.appendChild(td);

};
RowRenderer.prototype.resetrowSpanvalue = function (rowCount, cellArgs, rowIndex) {
if (rowCount > rowIndex && rowCount < rowIndex + cellArgs.rowSpan) {
var rowSpan = (rowIndex + cellArgs.rowSpan) - rowCount;
cellArgs.rowSpan = cellArgs.rowSpan - rowSpan;
}
};
RowRenderer.prototype.disableRowSelection = function (thisRef, row, args, eventArg) {

@@ -300,0 +377,0 @@ var selIndex = this.parent.getSelectedRowIndexes();

@@ -78,2 +78,3 @@ import { IGrid, IRenderer, NotifyArgs, VirtualInfo, IModelGenerator } from '../base/interface';

virtualData: Object;
private virtualInfiniteData;
private emptyRowData;

@@ -113,3 +114,11 @@ private initialRowTop;

private dataBound;
private resetStickyLeftPos;
/**
* To calculate the position of frozen cells
*
* @param {number} valueX - specifies the transform X value
* @param {DocumentFragment | HTMLElement} newChild - specifies the element to transform
* @returns {void}
* @hidden
*/
resetStickyLeftPos(valueX?: number, newChild?: DocumentFragment | HTMLElement): void;
private rowSelected;

@@ -116,0 +125,0 @@ private isLastBlockRow;

@@ -37,2 +37,3 @@ import { KeyboardEventArgs } from '@syncfusion/ej2-base';

private evtHandlers;
private groupedFrozenRow;
constructor(parent: IGrid);

@@ -83,3 +84,6 @@ protected focusCheck(e: Event): void;

protected refreshMatrix(content?: boolean): Function;
private refreshAddNewRowMatrix;
addEventListener(): void;
private showAddNewRowFocus;
findNextCellFocus(matrix?: number[], cellIndex?: number): number;
filterfocus(): void;

@@ -86,0 +90,0 @@ removeEventListener(): void;

@@ -119,5 +119,7 @@ var __extends = (this && this.__extends) || (function () {

while (i--) {
if (rowObj[parseInt(i.toString(), 10)].isCaptionRow && rowObj[parseInt(i.toString(), 10)].indent === indent
&& rowObj[parseInt(i.toString(), 10)].data.key === key) {
preCap = rowObj[parseInt(i.toString(), 10)];
if (rowObj[parseInt(i.toString(), 10)].isCaptionRow && rowObj[parseInt(i.toString(), 10)].indent === indent) {
var groupKey = rowObj[parseInt(i.toString(), 10)].data.key;
if ((groupKey instanceof Date && groupKey.toString() === key.toString()) || groupKey === key) {
preCap = rowObj[parseInt(i.toString(), 10)];
}
}

@@ -124,0 +126,0 @@ if (rowObj[parseInt(i.toString(), 10)].indent === indent || rowObj[parseInt(i.toString(), 10)].indent < indent) {

@@ -31,2 +31,3 @@ import { IModelGenerator, IGrid, VirtualInfo, NotifyArgs } from '../base/interface';

constructor(parent: IGrid);
private columnInfiniteRows;
generateRows(data: Object[], e?: NotifyArgs): Row<Column>[];

@@ -33,0 +34,0 @@ private setBlockForManualRefresh;

import { Browser, isNullOrUndefined } from '@syncfusion/ej2-base';
import { isGroupAdaptive } from '../base/util';
import { getRowIndexFromElement, isGroupAdaptive } from '../base/util';
import { RowModelGenerator } from '../services/row-model-generator';

@@ -22,4 +22,28 @@ import { GroupModelGenerator } from '../services/group-model-generator';

}
VirtualRowModelGenerator.prototype.columnInfiniteRows = function (data, e) {
var result = [];
if (e.requestType === 'virtualscroll') {
var rows = this.parent.getRowsObject();
result.push.apply(result, this.rowModelGenerator.refreshRows(rows));
if (this.parent.infiniteScrollSettings.enableCache) {
var currentRowStartIndex = this.parent.frozenRows && this.parent.pageSettings.currentPage === 1 ? 0
: getRowIndexFromElement(this.parent.getContentTable().querySelector('.e-row:not(.e-addedrow)'));
var newResult = result
.slice(currentRowStartIndex, currentRowStartIndex + (this.parent.pageSettings.pageSize * 3));
if (this.parent.frozenRows && this.parent.pageSettings.currentPage !== 1) {
newResult = result.slice(0, this.parent.frozenRows).concat(newResult);
}
result = newResult;
}
}
else {
result.push.apply(result, this.rowModelGenerator.generateRows(data, e));
}
return result;
};
VirtualRowModelGenerator.prototype.generateRows = function (data, e) {
var _this = this;
if (this.parent.enableColumnVirtualization && this.parent.enableInfiniteScrolling) {
return this.columnInfiniteRows(data, e);
}
var isManualRefresh = false;

@@ -26,0 +50,0 @@ var info = e.virtualInfo = e.virtualInfo || this.getData();

@@ -141,3 +141,3 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';

}
if (edit.length && editTableCol.length) {
if (edit.length && editTableCol.length && editTableCol[parseInt(index.toString(), 10)]) {
editTableCol[parseInt(index.toString(), 10)].style.width = fWidth;

@@ -144,0 +144,0 @@ }

@@ -73,3 +73,4 @@ var __extends = (this && this.__extends) || (function () {

member: 'externalMessage',
args: [this]
args: [this],
name: 'ExternalMessage'
});

@@ -80,3 +81,4 @@ }

member: 'pagerdropdown',
args: [this]
args: [this],
name: 'PagerDropDown'
});

@@ -688,6 +690,8 @@ }

Pager.prototype.addFocus = function (element, addFocusClass) {
if (addFocusClass) {
addClass([element], ['e-focused', 'e-focus']);
if (!isNullOrUndefined(element)) {
if (addFocusClass) {
addClass([element], ['e-focused', 'e-focus']);
}
element.tabIndex = 0;
}
element.tabIndex = 0;
};

@@ -694,0 +698,0 @@ Pager.prototype.removeFocus = function (element, removeFocusClass) {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc