Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@syncfusion/ej2-treegrid

Package Overview
Dependencies
Maintainers
3
Versions
240
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-treegrid - npm Package Compare versions

Comparing version 20.2.39 to 20.2.40

15

CHANGELOG.md

@@ -5,2 +5,17 @@ # Changelog

### Tree Grid
#### Bug fixes
- `#F175410` - Resolved adding multiple rows through add record method in batch editing.
## 20.2.39 (2022-07-19)
### Tree Grid
#### Bug fixes
- `#I384210` - Resolved infinite scrolling does not working properly when we toggle between virtualization to infinite scrolling.
- `#F175598` - The checkbox column selection works properly when the child has an empty child array.
## 20.2.38 (2022-07-12)

@@ -7,0 +22,0 @@

2

dist/global/index.d.ts
/*!
* filename: index.d.ts
* version : 20.2.39
* version : 20.2.40
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.

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

{
"_from": "@syncfusion/ej2-treegrid@*",
"_id": "@syncfusion/ej2-treegrid@20.2.38",
"_id": "@syncfusion/ej2-treegrid@20.2.39",
"_inBundle": false,
"_integrity": "sha512-NYCz9DaDQ4XOOV2NoH8jhhXRZFIkCI8982VHG9zXaEW2dSMQWllM8gLS2pChBtIswjofew9fMjJoGO8ppr+ZNA==",
"_integrity": "sha512-5rBNYV7TLamFp9Hc0N6hCtVjsqk1ZxtGLsP49vRZQRTAc2zps0a3OwOVsfGQkh6YTwyojMRNwsiV+GeHUXe+6w==",
"_location": "/@syncfusion/ej2-treegrid",

@@ -27,4 +27,4 @@ "_phantomChildren": {},

],
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.2.38.tgz",
"_shasum": "d00d11ccedaf101a1069a1e3c91f7fe22caf58a8",
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.2.39.tgz",
"_shasum": "45ce481300501f03d225973a53a749b17c4fab18",
"_spec": "@syncfusion/ej2-treegrid@*",

@@ -40,6 +40,6 @@ "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",

"dependencies": {
"@syncfusion/ej2-base": "~20.2.38",
"@syncfusion/ej2-base": "~20.2.39",
"@syncfusion/ej2-data": "~20.2.38",
"@syncfusion/ej2-grids": "~20.2.39",
"@syncfusion/ej2-popups": "~20.2.39"
"@syncfusion/ej2-grids": "~20.2.40",
"@syncfusion/ej2-popups": "~20.2.40"
},

@@ -65,4 +65,4 @@ "deprecated": false,

"typings": "index.d.ts",
"version": "20.2.39",
"version": "20.2.40",
"sideEffects": false
}

@@ -240,6 +240,7 @@ import { isNullOrUndefined, extend, setValue, getValue, merge } from '@syncfusion/ej2-base';

}
if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && this.parent.grid.selectedRowIndex === -1) {
if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) &&
!this.parent.editModule['isAddedRowByContextMenu'] && (this.parent.grid.selectedRowIndex === -1 || this.parent.editModule['batchEditModule'].isAdd)) {
this.selectedIndex = this.parent.editModule['selectedIndex'];
this.addRowIndex = this.parent.editModule['addRowIndex'];
this.addRowRecord = this.parent.getCurrentViewRecords()[this.selectedIndex];
this.addRowRecord = this.batchRecords.length ? this.batchRecords[this.selectedIndex] : this.parent.getCurrentViewRecords()[this.selectedIndex];
}

@@ -291,2 +292,7 @@ else {

focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];
if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {
var newlyAddedRecords = this.parent.getBatchChanges()['addedRecords'];
var index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[newlyAddedRecords.length - 1].getAttribute('data-rowindex'), 10);
this.batchRecords.splice(index, 0, newlyAddedRecords[newlyAddedRecords.length - 1]);
}
}

@@ -317,3 +323,3 @@ };

}
var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10);
var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('data-rowindex'), 10);
if (childs.length) {

@@ -355,3 +361,3 @@ var totalCount = parentRowIndex + childs.length;

for (var i = 0; i < rows.length; i++) {
rows[i].setAttribute('aria-rowindex', i.toString());
rows[i].setAttribute('data-rowindex', i.toString());
}

@@ -364,5 +370,5 @@ var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||

for (var i = 0; i < mRows.length; i++) {
mRows[i].setAttribute('aria-rowindex', i.toString());
mRows[i].setAttribute('data-rowindex', i.toString());
if (freeze) {
freezeRightRows[i].setAttribute('aria-rowindex', i.toString());
freezeRightRows[i].setAttribute('data-rowindex', i.toString());
}

@@ -427,3 +433,5 @@ }

index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
data.splice(index, 1);
if (index !== -1) {
data.splice(index, 1);
}
if (this.parent.editSettings.newRowPosition === 'Child') {

@@ -494,5 +502,8 @@ index = currentViewRecords.map(function (e) { return e[primaryKey]; })

data.splice(data.length - addRecords.length, addRecords.length);
if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex'])) {
var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[0].getAttribute('aria-rowindex'), 10);
data.splice(index_1, 0, addRecords[0]);
if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {
addRecords.reverse();
for (var i_1 = 0; i_1 < addRecords.length; i_1++) {
var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[i_1].getAttribute('data-rowindex'), 10);
data.splice(index_1, 0, addRecords[i_1]);
}
}

@@ -517,2 +528,5 @@ if (!this.parent.allowPaging && data.length !== currentViewRecords.length) {

}
if (this.parent.editModule['isAddedRowByContextMenu']) {
addRecords.reverse();
}
for (i = 0; i < addRecords.length; i++) {

@@ -530,2 +544,7 @@ var taskData = extend({}, addRecords[i]);

}
if (addRecords.length > 1 && this.parent.editModule['isAddedRowByContextMenu']) {
var rowPosition = this.parent.editSettings.newRowPosition;
this.parent.editSettings.newRowPosition = this.parent.editModule['previousNewRowPosition'];
this.parent.editModule['previousNewRowPosition'] = rowPosition;
}
addRecords[i].taskData = taskData;

@@ -570,7 +589,7 @@ addRowRecord = this.batchAddRowRecord[i];

this.parent.parentData = [];
for (var i_1 = 0; i_1 < data.length; i_1++) {
data[i_1][index] = i_1;
setValue('uniqueIDCollection.' + data[i_1][uniqueID] + '.index', i_1, this.parent);
if (!data[i_1][level]) {
this.parent.parentData.push(data[i_1]);
for (var i_2 = 0; i_2 < data.length; i_2++) {
data[i_2][index] = i_2;
setValue('uniqueIDCollection.' + data[i_2][uniqueID] + '.index', i_2, this.parent);
if (!data[i_2][level]) {
this.parent.parentData.push(data[i_2]);
}

@@ -580,2 +599,5 @@ }

this.batchAddRowRecord = this.batchAddedRecords = this.batchRecords = this.batchDeletedRecords = this.currentViewRecords = [];
if (this.parent.editModule['isAddedRowByContextMenu']) {
this.parent.editModule['isAddedRowByContextMenu'] = false;
}
};

@@ -582,0 +604,0 @@ BatchEdit.prototype.getActualRowObjectIndex = function (index) {

@@ -96,2 +96,3 @@ import { Grid, ContextMenu as cmenu } from '@syncfusion/ej2-grids';

this.parent.setProperties({ editSettings: { newRowPosition: args.item.id } }, true);
this.parent.editModule['isAddedRowByContextMenu'] = true;
this.parent.addRecord();

@@ -98,0 +99,0 @@ }

@@ -25,2 +25,3 @@ import { Column } from '@syncfusion/ej2-grids';

private isAddedRowByMethod;
private isAddedRowByContextMenu;
/**

@@ -27,0 +28,0 @@ * Constructor for Edit module

@@ -24,2 +24,3 @@ import { Grid, Edit as GridEdit, getUid, getObject, resetRowIndex } from '@syncfusion/ej2-grids';

this.isAddedRowByMethod = false;
this.isAddedRowByContextMenu = false;
Grid.Inject(GridEdit);

@@ -75,3 +76,3 @@ this.parent = parent;

addArgs.addRowIndex = this.addRowIndex;
addArgs.ariaRowIndex = +this.prevAriaRowIndex;
addArgs.dataRowIndex = +this.prevAriaRowIndex;
};

@@ -232,3 +233,3 @@ Edit.prototype.beforeStartEdit = function (args) {

}
var column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('aria-colindex'));
var column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('data-colindex'));
if (this.parent.editSettings.mode === 'Cell' && !this.isOnBatch && column && !column.isPrimaryKey &&

@@ -241,4 +242,4 @@ this.parent.editSettings.allowEditing && column.allowEditing && !(target.classList.contains('e-treegridexpand') ||

var tr = parentsUntil(args.target, 'e-row');
this.prevAriaRowIndex = tr.getAttribute('aria-rowindex');
tr.setAttribute('aria-rowindex', tr.rowIndex + '');
this.prevAriaRowIndex = tr.getAttribute('data-rowindex');
tr.setAttribute('data-rowindex', tr.rowIndex + '');
}

@@ -283,3 +284,3 @@ this.updateGridEditMode('Batch');

if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex) && this.prevAriaRowIndex !== '-1') {
args.row.setAttribute('aria-rowindex', this.prevAriaRowIndex);
args.row.setAttribute('data-rowindex', this.prevAriaRowIndex);
this.prevAriaRowIndex = undefined;

@@ -620,4 +621,4 @@ }

var rows = this.parent.grid.getDataRows();
var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;
var firstAriaIndex = rows.length ? +rows[0].getAttribute('data-rowindex') : 0;
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
var withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;

@@ -692,16 +693,23 @@ var isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';

}
if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1) {
if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1 && this['isAddedRowByMethod'] && !this.isAddedRowByContextMenu) {
index = this.batchEditModule.getAddRowIndex();
this.selectedIndex = this.batchEditModule.getSelectedIndex();
if (this.parent.editModule['isAddedRowByMethod']) {
var args = {
action: 'add',
data: this.parent.getBatchChanges()['addedRecords'][0],
index: index,
seletedRow: 0
};
this.parent.editModule.beginAddEdit(args);
this.parent.editModule.batchEditModule['batchAddRowRecord'].push(this.parent.editModule.batchEditModule['addRowRecord']);
this.parent.editModule.batchEditModule['batchAddedRecords'].push(args['data']);
var batchAddedRecords = this.parent.getBatchChanges()['addedRecords'];
var newlyAddedRecord = void 0;
if (batchAddedRecords.length) {
for (var i = 0; i < batchAddedRecords.length; i++) {
if (isNullOrUndefined(batchAddedRecords[i].uniqueID)) {
newlyAddedRecord = batchAddedRecords[i];
}
}
}
var args = {
action: 'add',
data: newlyAddedRecord,
index: index,
seletedRow: 0
};
this.beginAddEdit(args);
this.batchEditModule['batchAddRowRecord'].push(this.batchEditModule['addRowRecord']);
this.batchEditModule['batchAddedRecords'].push(args['data']);
}

@@ -773,3 +781,3 @@ };

if (this.parent.enableVirtualization) {
var selector = '.e-row[aria-rowindex="' + this.selectedIndex + '"]';
var selector = '.e-row[data-rowindex="' + this.selectedIndex + '"]';
var row = void 0;

@@ -784,3 +792,3 @@ if (this.selectedIndex > -1 && this.parent.editSettings.newRowPosition !== 'Top' &&

if (this.prevAriaRowIndex && this.prevAriaRowIndex !== '-1') {
selector = '.e-row[aria-rowindex="' + this.prevAriaRowIndex + '"]';
selector = '.e-row[data-rowindex="' + this.prevAriaRowIndex + '"]';
row = this.parent.getContent().querySelector(selector);

@@ -844,6 +852,12 @@ this.addRowIndex = row ? row.rowIndex : 0;

value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;
var currentData = this.parent.grid.getCurrentViewRecords();
var currentData = void 0;
if (this.parent.editSettings.mode === 'Batch' && this['isAddedRowByMethod'] && !isNullOrUndefined(this.addRowIndex)) {
currentData = this.batchEditModule['batchRecords'];
}
else {
currentData = this.parent.grid.getCurrentViewRecords();
}
if (this.parent.enableVirtualization && args.index !== 0) {
this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);
this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('data-rowindex'), 10);
}

@@ -861,3 +875,3 @@ var index = this.addRowIndex;

var firstAriaIndex = rows.length ? currentData.indexOf(currentData[0]) : 0;
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
var withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;

@@ -864,0 +878,0 @@ if (currentData.length) {

@@ -140,2 +140,5 @@ import { Grid, InfiniteScroll as GridInfiniteScroll } from '@syncfusion/ej2-grids';

var actions = getValue('actions', this.parent.grid.infiniteScrollModule);
if (this.parent.grid.infiniteScrollModule['isInitialRender'] && !this.parent.initialRender) {
this.parent.grid.pageSettings.currentPage = 1;
}
var initial = actions.some(function (value) { return value === actionArgs.requestType; });

@@ -155,4 +158,4 @@ var initialRender = initial ? true : this.parent.initialRender ? true : false;

var size = initialRender ?
this.parent.pageSettings.pageSize * this.parent.infiniteScrollSettings.initialBlocks :
this.parent.pageSettings.pageSize;
this.parent.grid.pageSettings.pageSize * this.parent.infiniteScrollSettings.initialBlocks :
this.parent.grid.pageSettings.pageSize;
var current = this.parent.grid.pageSettings.currentPage;

@@ -175,3 +178,3 @@ if (!isNullOrUndefined(actionArgs)) {

current = 1;
size = this.parent.pageSettings.pageSize * this.parent.grid.pageSettings.currentPage;
size = this.parent.grid.pageSettings.pageSize * this.parent.grid.pageSettings.currentPage;
}

@@ -178,0 +181,0 @@ query = query.page(current, size);

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

childData.forEach(function (record) {
if (_this.parent.enableVirtualization) {
if (_this.parent.enableVirtualization && record.childRecords.length > 0) {
if (record.hasChildRecords) {

@@ -446,0 +446,0 @@ _this.updateParentSelection(record);

@@ -131,1 +131,3 @@ /**

export declare const autoCol: string;
/** @hidden */
export declare const rowDeselecting: string;

@@ -131,1 +131,3 @@ /**

export var autoCol = 'auto-col';
/** @hidden */
export var rowDeselecting = 'rowDeselecting';

@@ -230,3 +230,3 @@ import { getObject, appendChildren } from '@syncfusion/ej2-grids';

if (isNullOrUndefined(treeColumn.field)) {
args.cell.setAttribute('aria-colindex', colindex + '');
args.cell.setAttribute('data-colindex', colindex + '');
}

@@ -233,0 +233,0 @@ if (treeColumn.field === args.column.field && !isNullOrUndefined(treeColumn.template)) {

@@ -14,3 +14,3 @@ import { Cell, CellType, Column, NotifyArgs, SentinelType } from '@syncfusion/ej2-grids';

private addRowIndex;
private ariaRowIndex;
private dataRowIndex;
private recordAdded;

@@ -17,0 +17,0 @@ /** @hidden */

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

VirtualTreeContentRenderer.prototype.getRowByIndex = function (index) {
return this.parent.getDataRows().filter(function (e) { return parseInt(e.getAttribute('aria-rowindex'), 10) === index; })[0];
return this.parent.getDataRows().filter(function (e) { return parseInt(e.getAttribute('data-rowindex'), 10) === index; })[0];
};

@@ -224,3 +224,3 @@ VirtualTreeContentRenderer.prototype.addEventListener = function () {

VirtualTreeContentRenderer.prototype.beginEdit = function (e) {
var selector = '.e-row[aria-rowindex="' + e.index + '"]';
var selector = '.e-row[data-rowindex="' + e.index + '"]';
var index = this.parent.getContent().querySelector(selector).rowIndex;

@@ -233,10 +233,10 @@ var rowData = this.parent.getCurrentViewRecords()[index];

var isAdd = 'isAdd';
var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, ariaRowIndex: this.ariaRowIndex };
var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, dataRowIndex: this.dataRowIndex };
this.parent.notify('get-row-position', addArgs);
this.rowPosition = addArgs.newRowPosition;
this.addRowIndex = addArgs.addRowIndex;
this.ariaRowIndex = addArgs.ariaRowIndex;
this.dataRowIndex = addArgs.dataRowIndex;
var rows = this.parent.getRows();
var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;
var firstAriaIndex = rows.length ? +rows[0].getAttribute('data-rowindex') : 0;
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
var withInRange = this.parent.selectedRowIndex >= firstAriaIndex && this.parent.selectedRowIndex <= lastAriaIndex;

@@ -292,7 +292,7 @@ if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {

if (args.requestType === 'add') {
var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, ariaRowIndex: this.ariaRowIndex };
var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, dataRowIndex: this.dataRowIndex };
this.parent.notify('get-row-position', addArgs);
this.rowPosition = addArgs.newRowPosition;
this.addRowIndex = addArgs.addRowIndex;
this.ariaRowIndex = addArgs.ariaRowIndex;
this.dataRowIndex = addArgs.dataRowIndex;
}

@@ -360,3 +360,3 @@ var actionComplete = 'actionComplete';

.querySelector('td').getAttribute('index');
firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('aria-rowindex');
firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('data-rowindex');
}

@@ -460,3 +460,3 @@ if (firsttdinx === 0) {

if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {
if (this.ariaRowIndex >= this.startIndex) {
if (this.dataRowIndex >= this.startIndex) {
this.restoreNewRow();

@@ -463,0 +463,0 @@ }

@@ -124,3 +124,3 @@ import { getObject } from '@syncfusion/ej2-grids';

if (!isNullOrUndefined(records.childRecords)) {
var childRecords = records.childRecords;
var childRecords = records.childRecords.filter(function (items) { return !items.isSummaryRow; });
var keys = Object.keys(childRecords);

@@ -127,0 +127,0 @@ for (var i = 0, len = keys.length; i < len; i++) {

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc