@syncfusion/ej2-treegrid
Advanced tools
Comparing version 27.2.3 to 28.1.33
/*! | ||
* filename: index.d.ts | ||
* version : 27.2.3 | ||
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved. | ||
* version : 28.1.33 | ||
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved. | ||
* Use of this code is subject to the terms of our license. | ||
@@ -6,0 +6,0 @@ * A copy of the current license can be obtained at any time by e-mailing |
{ | ||
"_from": "@syncfusion/ej2-treegrid@*", | ||
"_id": "@syncfusion/ej2-treegrid@27.2.2", | ||
"_id": "@syncfusion/ej2-treegrid@20.12.1", | ||
"_inBundle": false, | ||
"_integrity": "sha512-m4YVQ/3IDS1fgyP2/WkJV4e9pQ59rIpbHkTRAVPcUkcxVycQIr/hQmSGITLP/NvEdBQMx6jZBHdtO0QAw+maWA==", | ||
"_integrity": "sha512-KuMGwYg2ZSNKoZwF2X8qdYvm9pIVGZV4byzVF/NBbkRBUolsR00VM0Te+qZpPd1aeYzYtLeloywSY4AET2zrzA==", | ||
"_location": "/@syncfusion/ej2-treegrid", | ||
@@ -27,6 +27,6 @@ "_phantomChildren": {}, | ||
], | ||
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-27.2.2.tgz", | ||
"_shasum": "91fc23a187349c166105f512deba88acba5dc3b0", | ||
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.12.1.tgz", | ||
"_shasum": "7d69a4b448497f60c93177b3a215f11ad0fb7bea", | ||
"_spec": "@syncfusion/ej2-treegrid@*", | ||
"_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included", | ||
"_where": "/jenkins/workspace/elease-automation_release_28.1.1/packages/included", | ||
"author": { | ||
@@ -40,6 +40,6 @@ "name": "Syncfusion Inc." | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "~27.2.2", | ||
"@syncfusion/ej2-data": "~27.2.2", | ||
"@syncfusion/ej2-grids": "~27.2.3", | ||
"@syncfusion/ej2-popups": "~27.2.2" | ||
"@syncfusion/ej2-base": "~28.1.33", | ||
"@syncfusion/ej2-data": "~28.1.33", | ||
"@syncfusion/ej2-grids": "~28.1.33", | ||
"@syncfusion/ej2-popups": "~28.1.33" | ||
}, | ||
@@ -81,4 +81,4 @@ "deprecated": false, | ||
"typings": "index.d.ts", | ||
"version": "27.2.3", | ||
"version": "28.1.33", | ||
"sideEffects": false | ||
} |
@@ -77,3 +77,3 @@ # JavaScript TreeGrid Control | ||
> This is a commercial product and requires a paid license for possession or use. Syncfusion’s licensed software, including this component, is subject to the terms and conditions of Syncfusion's [EULA](https://www.syncfusion.com/eula/es/). To acquire a license for 80+ [JavaScript UI controls](https://www.syncfusion.com/javascript-ui-controls), you can [purchase](https://www.syncfusion.com/sales/products) or [start a free 30-day trial](https://www.syncfusion.com/account/manage-trials/start-trials). | ||
> This is a commercial product and requires a paid license for possession or use. Syncfusion<sup>®</sup> licensed software, including this component, is subject to the terms and conditions of Syncfusion<sup>®</sup> [EULA](https://www.syncfusion.com/eula/es/). To acquire a license for 80+ [JavaScript UI controls](https://www.syncfusion.com/javascript-ui-controls), you can [purchase](https://www.syncfusion.com/sales/products) or [start a free 30-day trial](https://www.syncfusion.com/account/manage-trials/start-trials). | ||
@@ -84,2 +84,2 @@ > A [free community license](https://www.syncfusion.com/products/communitylicense) is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue and five or fewer developers. | ||
© Copyright 2024 Syncfusion, Inc. All Rights Reserved. The Syncfusion Essential Studio license and copyright applies to this distribution. | ||
© Copyright 2024 Syncfusion<sup>®</sup> Inc. All Rights Reserved. The Syncfusion<sup>®</sup> Essential Studio<sup>®</sup> license and copyright applies to this distribution. |
@@ -146,65 +146,67 @@ import { isNullOrUndefined, extend, setValue, getValue } from '@syncfusion/ej2-base'; | ||
added = this.parent.grid.getRowsObject()[parseInt(rowObjectIndex.toString(), 10)].changes; | ||
added.uniqueID = getUid(this.parent.element.id + '_data_'); | ||
setValue('uniqueIDCollection.' + added.uniqueID, added, this.parent); | ||
if (!Object.prototype.hasOwnProperty.call(added, 'level')) { | ||
this.batchIndex = this.selectedIndex === -1 ? 0 : this.batchIndex; | ||
if (this.parent.editSettings.newRowPosition === 'Child') { | ||
added.primaryParent = parentRecord; | ||
if (this.selectedIndex > -1) { | ||
added.parentItem = extend({}, this.batchRecords[this.addRowIndex]); | ||
added.parentUniqueID = added.parentItem.uniqueID; | ||
delete added.parentItem.childRecords; | ||
delete added.parentItem[this.parent.childMapping]; | ||
added.level = added.parentItem.level + 1; | ||
added.index = this.batchIndex; | ||
var childRecordCount = findChildrenRecords(this.batchRecords[this.addRowIndex]).length; | ||
var record = findChildrenRecords(this.batchRecords[this.addRowIndex])[childRecordCount - 1]; | ||
record = isNullOrUndefined(record) ? this.batchRecords[this.addRowIndex] : record; | ||
currentDataIndex = data.map(function (e) { return e["" + primaryKey_1]; }).indexOf(record["" + primaryKey_1]); | ||
if (!isNullOrUndefined(added)) { | ||
added.uniqueID = getUid(this.parent.element.id + '_data_'); | ||
setValue('uniqueIDCollection.' + added.uniqueID, added, this.parent); | ||
if (!Object.prototype.hasOwnProperty.call(added, 'level')) { | ||
this.batchIndex = this.selectedIndex === -1 ? 0 : this.batchIndex; | ||
if (this.parent.editSettings.newRowPosition === 'Child') { | ||
added.primaryParent = parentRecord; | ||
if (this.selectedIndex > -1) { | ||
added.parentItem = extend({}, this.batchRecords[this.addRowIndex]); | ||
added.parentUniqueID = added.parentItem.uniqueID; | ||
delete added.parentItem.childRecords; | ||
delete added.parentItem[this.parent.childMapping]; | ||
added.level = added.parentItem.level + 1; | ||
added.index = this.batchIndex; | ||
var childRecordCount = findChildrenRecords(this.batchRecords[this.addRowIndex]).length; | ||
var record = findChildrenRecords(this.batchRecords[this.addRowIndex])[childRecordCount - 1]; | ||
record = isNullOrUndefined(record) ? this.batchRecords[this.addRowIndex] : record; | ||
currentDataIndex = data.map(function (e) { return e["" + primaryKey_1]; }).indexOf(record["" + primaryKey_1]); | ||
if (this.isSelfReference) { | ||
added[this.parent.parentIdMapping] = idMapping; | ||
} | ||
updateParentRow(primaryKey_1, added.parentItem, 'add', this.parent, this.isSelfReference, added); | ||
} | ||
} | ||
else if ((this.parent.editSettings.newRowPosition === 'Above' || this.parent.editSettings.newRowPosition === 'Below') | ||
&& !isNullOrUndefined(this.batchRecords[this.addRowIndex])) { | ||
added.level = this.batchRecords[parseInt(this.addRowIndex.toString(), 10)]["" + level]; | ||
if (added.level && this.selectedIndex > -1) { | ||
added.parentItem = parentRecord; | ||
added.parentUniqueID = parentUniqueID; | ||
delete added.parentItem.childRecords; | ||
delete added.parentItem[this.parent.childMapping]; | ||
} | ||
added.index = this.parent.editSettings.newRowPosition === 'Below' ? this.batchIndex : this.batchIndex - 1; | ||
if (this.parent.editSettings.newRowPosition === 'Below' && this.selectedIndex > -1) { | ||
var childRecordCount = findChildrenRecords(this.batchRecords[this.addRowIndex]).length; | ||
var record = findChildrenRecords(this.batchRecords[this.addRowIndex])[childRecordCount - 1]; | ||
record = isNullOrUndefined(record) ? this.batchRecords[this.addRowIndex] : record; | ||
currentDataIndex = data.map(function (e) { return e["" + primaryKey_1]; }).indexOf(record["" + primaryKey_1]); | ||
} | ||
if (this.parent.editSettings.newRowPosition === 'Above' && this.selectedIndex > -1) { | ||
var record = this.batchRecords[this.addRowIndex]; | ||
currentDataIndex = data.map(function (e) { return e["" + primaryKey_1]; }).indexOf(record["" + primaryKey_1]); | ||
} | ||
if (this.isSelfReference) { | ||
added[this.parent.parentIdMapping] = idMapping; | ||
added[this.parent.parentIdMapping] = parentIdMapping; | ||
} | ||
updateParentRow(primaryKey_1, added.parentItem, 'add', this.parent, this.isSelfReference, added); | ||
} | ||
} | ||
else if ((this.parent.editSettings.newRowPosition === 'Above' || this.parent.editSettings.newRowPosition === 'Below') | ||
&& !isNullOrUndefined(this.batchRecords[this.addRowIndex])) { | ||
added.level = this.batchRecords[parseInt(this.addRowIndex.toString(), 10)]["" + level]; | ||
if (added.level && this.selectedIndex > -1) { | ||
added.parentItem = parentRecord; | ||
added.parentUniqueID = parentUniqueID; | ||
delete added.parentItem.childRecords; | ||
delete added.parentItem[this.parent.childMapping]; | ||
added.index = added.index === -1 ? 0 : added.index; | ||
added.hasChildRecords = false; | ||
added.childRecords = []; | ||
this.batchRecords.splice(added.index, 0, added); | ||
this.currentViewRecords.splice(added.index, 0, added); | ||
if (currentDataIndex) { | ||
indexvalue = currentDataIndex; | ||
} | ||
added.index = this.parent.editSettings.newRowPosition === 'Below' ? this.batchIndex : this.batchIndex - 1; | ||
if (this.parent.editSettings.newRowPosition === 'Below' && this.selectedIndex > -1) { | ||
var childRecordCount = findChildrenRecords(this.batchRecords[this.addRowIndex]).length; | ||
var record = findChildrenRecords(this.batchRecords[this.addRowIndex])[childRecordCount - 1]; | ||
record = isNullOrUndefined(record) ? this.batchRecords[this.addRowIndex] : record; | ||
currentDataIndex = data.map(function (e) { return e["" + primaryKey_1]; }).indexOf(record["" + primaryKey_1]); | ||
else { | ||
indexvalue = added.index; | ||
} | ||
if (this.parent.editSettings.newRowPosition === 'Above' && this.selectedIndex > -1) { | ||
var record = this.batchRecords[this.addRowIndex]; | ||
currentDataIndex = data.map(function (e) { return e["" + primaryKey_1]; }).indexOf(record["" + primaryKey_1]); | ||
if (this.parent.editSettings.newRowPosition !== 'Above') { | ||
indexvalue = added.index === 0 ? indexvalue : indexvalue + 1; | ||
} | ||
if (this.isSelfReference) { | ||
added[this.parent.parentIdMapping] = parentIdMapping; | ||
} | ||
data.splice(indexvalue, 0, added); | ||
this.batchAddedRecords.push(added); | ||
} | ||
added.index = added.index === -1 ? 0 : added.index; | ||
added.hasChildRecords = false; | ||
added.childRecords = []; | ||
this.batchRecords.splice(added.index, 0, added); | ||
this.currentViewRecords.splice(added.index, 0, added); | ||
if (currentDataIndex) { | ||
indexvalue = currentDataIndex; | ||
} | ||
else { | ||
indexvalue = added.index; | ||
} | ||
if (this.parent.editSettings.newRowPosition !== 'Above') { | ||
indexvalue = added.index === 0 ? indexvalue : indexvalue + 1; | ||
} | ||
data.splice(indexvalue, 0, added); | ||
this.batchAddedRecords.push(added); | ||
} | ||
@@ -211,0 +213,0 @@ this.parent.grid.getRowsObject()[parseInt(rowObjectIndex.toString(), 10)].data = added; |
@@ -96,3 +96,5 @@ import { Grid, ContextMenu as cmenu } from '@syncfusion/ej2-grids'; | ||
if (items.text === 'Outdent' || items.text === 'Indent') { | ||
tObj.grid.contextMenuModule['hiddenItems'].push(items.text); | ||
if (!tObj.grid.contextMenuModule['hiddenItems'].includes(items.text)) { | ||
tObj.grid.contextMenuModule['hiddenItems'].push(items.text); | ||
} | ||
} | ||
@@ -99,0 +101,0 @@ } |
@@ -35,3 +35,3 @@ import { TreeGrid } from '../base/treegrid'; | ||
destroy(): void; | ||
private getTreeColumn; | ||
private updateTreeColumn; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { getObject, Grid, Reorder as GridReorder } from '@syncfusion/ej2-grids'; | ||
import { Grid, Reorder as GridReorder } from '@syncfusion/ej2-grids'; | ||
/** | ||
@@ -32,3 +32,3 @@ * TreeGrid Reorder module | ||
Reorder.prototype.addEventListener = function () { | ||
this.parent.on('getColumnIndex', this.getTreeColumn, this); | ||
this.parent.on('getColumnIndex', this.updateTreeColumn, this); | ||
}; | ||
@@ -39,3 +39,3 @@ Reorder.prototype.removeEventListener = function () { | ||
} | ||
this.parent.off('getColumnIndex', this.getTreeColumn); | ||
this.parent.off('getColumnIndex', this.updateTreeColumn); | ||
}; | ||
@@ -51,16 +51,4 @@ /** | ||
}; | ||
Reorder.prototype.getTreeColumn = function () { | ||
var columnModel = 'columnModel'; | ||
var treeColumn = this.parent["" + columnModel][this.parent.treeColumnIndex]; | ||
var treeIndex; | ||
var updatedCols = this.parent.getColumns(); | ||
for (var f = 0; f < updatedCols.length; f++) { | ||
var treeColumnfield = getObject('field', treeColumn); | ||
var parentColumnfield = getObject('field', updatedCols[parseInt(f.toString(), 10)]); | ||
if (treeColumnfield === parentColumnfield) { | ||
treeIndex = f; | ||
break; | ||
} | ||
} | ||
this.parent.setProperties({ treeColumnIndex: treeIndex }, true); | ||
Reorder.prototype.updateTreeColumn = function () { | ||
this.parent['getTreeColumn'](); | ||
}; | ||
@@ -67,0 +55,0 @@ return Reorder; |
@@ -10,29 +10,57 @@ import { TreeGrid } from '../base/treegrid'; | ||
private parent; | ||
/** @hidden */ | ||
/** @hidden | ||
* Represents the position where a row can be dropped within the TreeGrid. | ||
*/ | ||
private dropPosition; | ||
/** @hidden */ | ||
/** @hidden | ||
* Represents the record that is currently being dragged in the TreeGrid. | ||
*/ | ||
private draggedRecord; | ||
/** @hidden */ | ||
/** @hidden | ||
* Represents the record that the currently dragged item is being dropped onto in the TreeGrid. | ||
*/ | ||
private droppedRecord; | ||
/** @hidden */ | ||
/** @hidden | ||
* Stores the data representation of the TreeGrid, including hierarchical structures. | ||
*/ | ||
treeGridData: ITreeData[]; | ||
/** @hidden */ | ||
/** @hidden | ||
* Represents the underlying hierarchical data of the TreeGrid. | ||
*/ | ||
private treeData; | ||
/** @hidden */ | ||
/** @hidden | ||
* Indicates whether a row can be dropped into the current target position during a drag-and-drop operation. | ||
*/ | ||
private canDrop; | ||
/** @hidden */ | ||
/** @hidden | ||
* Indicates whether the current drag operation includes child records of the dragged item. | ||
*/ | ||
private isDraggedWithChild; | ||
/** @hidden */ | ||
/** @hidden | ||
* | ||
*/ | ||
isMultipleGrid: string; | ||
/** @hidden */ | ||
/** @hidden | ||
* Indicates whether multiple TreeGrid instances are being managed or displayed. | ||
*/ | ||
private modifiedRecords; | ||
/** @hidden */ | ||
/** @hidden | ||
* Represents the currently selected item in the TreeGrid. | ||
*/ | ||
private selectedItem; | ||
/** @hidden */ | ||
/** @hidden | ||
* Represents the currently selected item in the TreeGrid. | ||
*/ | ||
private selectedRecords; | ||
/** @hidden */ | ||
/** @hidden | ||
* Holds an array of currently selected records in the TreeGrid. | ||
*/ | ||
private selectedRows; | ||
/** @hidden */ | ||
/** @hidden | ||
* Indicates whether there is a droppable item in the TreeGrid. | ||
*/ | ||
private hasDropItem; | ||
/** @hidden */ | ||
/** @hidden | ||
* Indicates whether the item is being added to the bottom of the TreeGrid. | ||
*/ | ||
isaddtoBottom: boolean; | ||
@@ -47,2 +75,8 @@ private selectedRecord; | ||
constructor(parent?: TreeGrid); | ||
/** | ||
* Retrieves child records for a specified parent ID in the TreeGrid. | ||
* | ||
* @param {string} id - The unique ID of the parent record for which to retrieve child records. | ||
* @returns {ITreeData[]} An array of child records corresponding to the specified parent ID. | ||
*/ | ||
private getChildrecordsByParentID; | ||
@@ -63,38 +97,276 @@ /** | ||
reorderRows(fromIndexes: number[], toIndex: number, position: string): void; | ||
/** | ||
* Performs indent or outdent actions on selected records in the TreeGrid. | ||
* | ||
* @param {ITreeData} [record] - The record to be indented or outdented. If undefined, the method operates on the currently selected record. | ||
* @param {string} [request] - The action to perform, either 'indent' or 'outdent'. | ||
* @returns {void} | ||
*/ | ||
private indentOutdentAction; | ||
/** | ||
* Triggers a specified event for the TreeGrid, notifying subscribers about the event occurrence. | ||
* | ||
* @param {string} action - The action to be triggered, either 'indenting' or 'outdenting'. | ||
* @param {number} dropIndex - The index at which the row should be dropped. | ||
* @returns {void} | ||
*/ | ||
private eventTrigger; | ||
/** | ||
* Reorders the flat data array of the TreeGrid and updates the index of each record. | ||
* | ||
* @param {ITreeData[]} currentData - The array of tree data records to reorder. | ||
* @returns {ITreeData[]} The updated array of tree data records with indices set. | ||
*/ | ||
private orderToIndex; | ||
/** | ||
* Handles the addition of new rows to the TreeGrid. | ||
* | ||
* @param {Object} e - The event object containing information about the rows being added. | ||
* @param {number} e.toIndex - The index at which the new rows should be added in the TreeGrid. | ||
* @param {Object[]} e.records - An array of the records to be added to the TreeGrid. | ||
* | ||
* @returns {void} This function does not return any value. | ||
*/ | ||
private rowsAdded; | ||
/** | ||
* Handles the removal of specified rows from the TreeGrid. | ||
* | ||
* @param {Object} e - The event object containing information about the removed rows. | ||
* @param {number[]} e.indexes - An array of indexes of the rows that were removed. | ||
* @param {Object[]} e.records - An array of the records corresponding to the removed rows. | ||
* | ||
* @returns {void} This function does not return any value. | ||
*/ | ||
private rowsRemoved; | ||
/** | ||
* Refreshes the data source of the TreeGrid. | ||
* | ||
* @returns {void} This function does not return any value. | ||
*/ | ||
private refreshGridDataSource; | ||
/** | ||
* Removes the border from the first row of the TreeGrid. | ||
* | ||
* @param {HTMLTableRowElement} element - The table row element from which to remove the border. | ||
* @returns {void} This function does not return any value. | ||
*/ | ||
private removeFirstrowBorder; | ||
/** | ||
* Removes the border from the last row of the TreeGrid. | ||
* | ||
* @param {HTMLTableRowElement} element - The row element from which to remove the last row border. | ||
* @returns {void} | ||
*/ | ||
private removeLastrowBorder; | ||
/** | ||
* Updates the icons associated with the specified rows in the TreeGrid. | ||
* | ||
* @param {Element[]} row - The array of row elements to update the icons for. | ||
* @param {number} index - The index of the row being updated. | ||
* @param {RowDragEventArgs} args - The event arguments associated with the row drag operation. | ||
* @returns {string} The drop position ('topSegment', 'middleSegment', 'bottomSegment', or 'Invalid'). | ||
*/ | ||
private updateIcon; | ||
/** | ||
* Removes the visual border from all child rows within the TreeGrid. | ||
* | ||
* @returns {void} No return value. | ||
*/ | ||
private removeChildBorder; | ||
/** | ||
* Adds a visual border to the first row of the TreeGrid. | ||
* | ||
* @param {HTMLTableRowElement} targetRow - The target row element to which the border will be added, if it is the first row. | ||
* @returns {void} No return value. | ||
*/ | ||
private addFirstrowBorder; | ||
/** | ||
* Adds a visual border to the last row of the TreeGrid. | ||
* | ||
* @param {HTMLTableRowElement} trElement - The table row element to which the border will be added, if it is the last row. | ||
* @returns {void} No return value. | ||
*/ | ||
private addLastRowborder; | ||
/** | ||
* Retrieves the total scroll width of the TreeGrid content area. | ||
* | ||
* @returns {number} The width of the scrollbar if content overflows, otherwise 0. | ||
*/ | ||
private getScrollWidth; | ||
/** | ||
* Adds an error element to the dragged row element during a row drag-and-drop operation. | ||
* | ||
* @returns {void} No return value. | ||
*/ | ||
private addErrorElem; | ||
/** | ||
* Removes the error element from the DOM and adjusts the position of the drop item count if necessary. | ||
* | ||
* @returns {void} No return value. | ||
*/ | ||
private removeErrorElem; | ||
/** | ||
* Applies drop border styles to row elements based on the current drop position ('topSegment' or 'bottomSegment'). | ||
* | ||
* @param {Element} target - The target element where the drop action is taking place. | ||
* @returns {void} No return value. | ||
*/ | ||
private topOrBottomBorder; | ||
/** | ||
* Removes the drop border classes ('e-dropbottom' and 'e-droptop') from the parent element if present. | ||
* | ||
* @returns {void} No return value. | ||
*/ | ||
private removetopOrBottomBorder; | ||
/** | ||
* Adds or removes a specified class from a list of HTML elements. | ||
* | ||
* @param {Element[]} cells - The list of HTML elements to which the class will be added or removed. | ||
* @param {boolean} add - A flag indicating whether to add (`true`) or remove (`false`) the class. | ||
* @param {string} className - The class name to be added or removed from each element in `cells`. | ||
* @returns {void} No return value. | ||
*/ | ||
private addRemoveClasses; | ||
/** | ||
* Calculates the offset position of the specified HTML element relative to the document. | ||
* | ||
* @param {Element} element - The HTML element for which the offset position is calculated. | ||
* @returns {PositionOffSet} The offset position containing `top` and `left` values. | ||
*/ | ||
private getOffset; | ||
/** | ||
* Handles the dragging of rows in the TreeGrid. | ||
* | ||
* @param {RowDragEventArgs} args - The event arguments for the row drag action. | ||
* @returns {void} This function does not return a value. | ||
*/ | ||
private Rowdraging; | ||
/** | ||
* Handles the row drop event for the TreeGrid. | ||
* | ||
* @param {RowDropEventArgs} args - The event arguments for the row drop action. | ||
* @returns {void} This function does not return a value. | ||
*/ | ||
private rowDropped; | ||
/** | ||
* Removes the border elements for the first and last rows of the TreeGrid. | ||
* | ||
* @returns {void} This function does not return a value. | ||
*/ | ||
private removeRowBorders; | ||
/** | ||
* Handles the drag-and-drop operation between TreeGrids, updating the source and target grids. | ||
* | ||
* @param {RowDropEventArgs} args - The arguments related to the row drop event, including target information and data being dropped. | ||
* @returns {void} - This function does not return any value. | ||
*/ | ||
private dragDropGrid; | ||
/** | ||
* Retrieves the index of the target row based on its 'data-rowindex' attribute. | ||
* | ||
* @param {Element} targetRow - The target row element from which to retrieve the index. | ||
* @returns {number} - The index of the target row, or 0 if the targetRow is null or undefined. | ||
*/ | ||
private getTargetIdx; | ||
/** | ||
* Retrieves the parent data of a given record during a row drag-and-drop operation. | ||
* | ||
* @param {ITreeData} record - The record for which to retrieve the parent data. | ||
* @param {Object[]} [data] - Optional data array containing additional information related to the drop operation. | ||
* @returns {void} - This function does not return any value. | ||
*/ | ||
private getParentData; | ||
/** | ||
* Handles the row drop operation for the tree grid. | ||
* | ||
* @param {RowDropEventArgs} args - The event arguments containing details about the drop operation, including the target index and data. | ||
* @param {boolean} [isByMethod=false] - Optional flag indicating if the drop operation is triggered by a method. | ||
* @returns {void} - This function does not return any value. | ||
*/ | ||
private dropRows; | ||
/** | ||
* Handles the logic for inserting a dragged record into the middle of a parent record's child records. | ||
* | ||
* @param {number} recordIndex - The index at which to insert the dragged record relative to the parent record's child records. | ||
* @returns {void} - This function does not return any value. | ||
*/ | ||
private dropMiddle; | ||
/** | ||
* Handles the logic for inserting a dragged record at the top of a parent record's child records. | ||
* | ||
* @param {number} recordIndex1 - The index at which to insert the dragged record in the tree grid data. | ||
* @returns {void} - This function does not return any value. | ||
*/ | ||
private dropAtTop; | ||
/** | ||
* Updates the level and hierarchy of the dragged record based on the drop position. | ||
* | ||
* @returns {void} - This function does not return any value. | ||
*/ | ||
private recordLevel; | ||
/** | ||
* Deletes the currently dragged row from the TreeGrid. | ||
* | ||
* @returns {void} - This function does not return any value. | ||
*/ | ||
private deleteDragRow; | ||
/** | ||
* Updates the child records of a specified parent record in the TreeGrid. | ||
* | ||
* @param {ITreeData} record - The parent record whose child records will be updated. | ||
* @param {number} count - The initial count to keep track of record positioning. | ||
* @returns {number} - The updated count after processing all child records. | ||
*/ | ||
private updateChildRecord; | ||
/** | ||
* Updates the level of child records for a specified parent record in the TreeGrid. | ||
* | ||
* @param {ITreeData} record - The parent record whose child records' levels will be updated. | ||
* @param {number} level - The current level of the parent record. | ||
* @returns {number} - The updated level after processing all child records. | ||
*/ | ||
private updateChildRecordLevel; | ||
/** | ||
* Removes specified records from the TreeGrid data source. | ||
* | ||
* @param {ITreeData} record - The record to be removed, including any child records if applicable. | ||
* @returns {void} - This method does not return a value. | ||
*/ | ||
private removeRecords; | ||
/** | ||
* Updates the records in the TreeGrid data source that have been modified. | ||
* | ||
* @param {ITreeData} record - The record to update, along with its parent records if applicable. | ||
* @returns {void} - This method does not return a value. | ||
*/ | ||
private updateModifiedRecords; | ||
/** | ||
* Recursively removes child records from the specified record and updates the data source. | ||
* | ||
* @param {ITreeData} record - The parent record whose child records are to be removed. | ||
* @returns {void} - This method does not return a value. | ||
*/ | ||
private removeChildItem; | ||
/** | ||
* Retrieves the count of child records associated with the specified parent record. | ||
* | ||
* @param {ITreeData} record - The parent record for which child count is to be calculated. | ||
* @param {number} count - The initial count to start with, usually passed as 0. | ||
* @returns {number} - The total count of child records. | ||
*/ | ||
private getChildCount; | ||
/** | ||
* Ensures the validity of the drop position for the dragged records by verifying the hierarchy and position constraints. | ||
* If the current record is found in the dragged records' children, sets the drop position to 'Invalid'. | ||
* | ||
* @param {ITreeData[]} draggedRecords - The array of dragged records being verified. | ||
* @param {ITreeData} currentRecord - The current record to check against dragged records. | ||
* @returns {void} - This function does not return a value. | ||
*/ | ||
private ensuredropPosition; | ||
private isDuplicateData; | ||
/** | ||
* Cleans up resources, event listeners, and DOM elements when the TreeGrid component is destroyed. | ||
* @returns {void} | ||
*/ | ||
destroy(): void; | ||
@@ -101,0 +373,0 @@ /** |
@@ -156,2 +156,7 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
if ((pageingDetails.actionArgs.requestType === 'save' && startIndex !== this.prevstartIndex) && | ||
(startIndex < this.parent.getRows().length && endIndex <= startIndex + this.parent.getRows().length) && translateY === 0) { | ||
startIndex = 0; | ||
endIndex = startIndex + this.parent.grid.pageSettings.pageSize; | ||
} | ||
if (!isNullOrUndefined(this.expandCollapseRec)) { | ||
@@ -158,0 +163,0 @@ var resourceCount = this.parent.getRows(); |
@@ -204,2 +204,3 @@ import { extend, isNullOrUndefined, setValue, getValue, addClass, removeClass } from '@syncfusion/ej2-base'; | ||
DataManipulation.prototype.updateParentRemoteData = function (args) { | ||
var _this = this; | ||
var actionArgs = 'actionArgs'; | ||
@@ -244,6 +245,12 @@ if (isRemoteData(this.parent) && this.parent.enableVirtualization && args["" + actionArgs].requestType === 'virtualscroll') { | ||
setValue('uniqueIDCollection.' + records[parseInt(rec.toString(), 10)].uniqueID, records[parseInt(rec.toString(), 10)], this_1.parent); | ||
records[parseInt(rec.toString(), 10)].level = 0; | ||
if (isRemoteData(this_1.parent) && this_1.parent.enableVirtualization && records[parseInt(rec.toString(), 10)]["" + this_1.parent.parentIdMapping] && records[parseInt(rec.toString(), 10)].level === 0) { | ||
records[parseInt(rec.toString(), 10)].level = records[parseInt(rec.toString(), 10)].level + 1; | ||
if (isRemoteData(this_1.parent) && this_1.parent.enableVirtualization && records[parseInt(rec.toString(), 10)]["" + this_1.parent.parentIdMapping] && (isNullOrUndefined(records[parseInt(rec.toString(), 10)].level) || records[parseInt(rec.toString(), 10)].level === 0)) { | ||
var parentID_1 = records[parseInt(rec.toString(), 10)]["" + this_1.parent.parentIdMapping]; | ||
var parentRec = records.find(function (record) { return record["" + _this.parent.idMapping] === parentID_1; }); | ||
if (parentRec) { | ||
records[parseInt(rec.toString(), 10)].level = parentRec.level + 1; | ||
} | ||
} | ||
else { | ||
records[parseInt(rec.toString(), 10)].level = 0; | ||
} | ||
records[parseInt(rec.toString(), 10)].index = Math.ceil(Math.random() * 1000); | ||
@@ -453,3 +460,3 @@ if ((records[parseInt(rec.toString(), 10)][this_1.parent.hasChildMapping] || | ||
result[parseInt(r.toString(), 10)].parentItem = parentData; | ||
result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID; | ||
result[parseInt(r.toString(), 10)].parentUniqueID = parentData.uniqueID; | ||
} | ||
@@ -489,2 +496,5 @@ } | ||
result[parseInt(r.toString(), 10)].uniqueID = getUid(_this.parent.element.id + '_data_'); | ||
if (rowDetails.record["" + _this.parent.idMapping] === result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping]) { | ||
rowDetails.record.uniqueID = result[parseInt(r.toString(), 10)].uniqueID; | ||
} | ||
result[parseInt(r.toString(), 10)].checkboxState = 'uncheck'; | ||
@@ -678,3 +688,10 @@ if (_this.parent.enableVirtualization && isNullOrUndefined(result[parseInt(r.toString(), 10)].level)) { | ||
else if (isNullOrUndefined(currentData["" + this.parent.parentIdMapping]) || currentData.parentItem) { | ||
this.parent.flatData.push(currentData); | ||
if (!isNullOrUndefined(this.parent.rowDropSettings.targetID)) { | ||
if (!this.parent.rowDragAndDropModule['isDuplicateData'](currentData)) { | ||
this.parent.flatData.push(currentData); | ||
} | ||
} | ||
else { | ||
this.parent.flatData.push(currentData); | ||
} | ||
this.parent['infiniteScrollData'].push(currentData); | ||
@@ -681,0 +698,0 @@ } |
@@ -495,4 +495,6 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
var selectedIndex = this.parent.root.selectedRowIndex; | ||
this.startIndex = selectedIndex !== -1 && selectedIndex !== this.startIndex ? this.startIndex - 1 : this.startIndex; | ||
if (this.parent.root.isSelfReference) { | ||
var selectedIndex = this.parent.root.selectedRowIndex; | ||
this.startIndex = selectedIndex !== -1 && selectedIndex !== this.startIndex ? this.startIndex - 1 : this.startIndex; | ||
} | ||
if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) { | ||
@@ -499,0 +501,0 @@ this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height); |
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 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9617716
316
87401
+ Added@syncfusion/ej2-base@28.1.33(transitive)
+ Added@syncfusion/ej2-buttons@28.1.33(transitive)
+ Added@syncfusion/ej2-calendars@28.1.33(transitive)
+ Added@syncfusion/ej2-compression@28.1.33(transitive)
+ Added@syncfusion/ej2-data@28.1.33(transitive)
+ Added@syncfusion/ej2-dropdowns@28.1.33(transitive)
+ Added@syncfusion/ej2-excel-export@28.1.33(transitive)
+ Added@syncfusion/ej2-file-utils@28.1.33(transitive)
+ Added@syncfusion/ej2-grids@28.1.33(transitive)
+ Added@syncfusion/ej2-icons@28.1.33(transitive)
+ Added@syncfusion/ej2-inputs@28.1.33(transitive)
+ Added@syncfusion/ej2-lists@28.1.33(transitive)
+ Added@syncfusion/ej2-navigations@28.1.33(transitive)
+ Added@syncfusion/ej2-notifications@28.1.33(transitive)
+ Added@syncfusion/ej2-pdf-export@28.1.33(transitive)
+ Added@syncfusion/ej2-popups@28.1.33(transitive)
+ Added@syncfusion/ej2-splitbuttons@28.1.33(transitive)
- Removed@syncfusion/ej2-base@27.2.5(transitive)
- Removed@syncfusion/ej2-buttons@27.2.4(transitive)
- Removed@syncfusion/ej2-calendars@27.2.3(transitive)
- Removed@syncfusion/ej2-compression@27.2.2(transitive)
- Removed@syncfusion/ej2-data@27.2.2(transitive)
- Removed@syncfusion/ej2-dropdowns@27.2.5(transitive)
- Removed@syncfusion/ej2-excel-export@27.2.2(transitive)
- Removed@syncfusion/ej2-file-utils@27.2.2(transitive)
- Removed@syncfusion/ej2-grids@27.2.5(transitive)
- Removed@syncfusion/ej2-icons@27.2.2(transitive)
- Removed@syncfusion/ej2-inputs@27.2.4(transitive)
- Removed@syncfusion/ej2-lists@27.2.5(transitive)
- Removed@syncfusion/ej2-navigations@27.2.5(transitive)
- Removed@syncfusion/ej2-notifications@27.2.4(transitive)
- Removed@syncfusion/ej2-pdf-export@27.2.2(transitive)
- Removed@syncfusion/ej2-popups@27.2.2(transitive)
- Removed@syncfusion/ej2-splitbuttons@27.2.2(transitive)