@syncfusion/ej2-treegrid 34.2.8 → 35.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/ej2-treegrid.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +1028 -588
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +1120 -608
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +2 -2
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/global.js +1 -1
- package/src/treegrid/actions/crud-actions.js +4 -9
- package/src/treegrid/actions/dom-virtualization.d.ts +66 -0
- package/src/treegrid/actions/dom-virtualization.js +240 -0
- package/src/treegrid/actions/edit.d.ts +1 -4
- package/src/treegrid/actions/edit.js +23 -191
- package/src/treegrid/actions/filter.js +1 -1
- package/src/treegrid/actions/index.d.ts +1 -0
- package/src/treegrid/actions/index.js +1 -0
- package/src/treegrid/actions/page.js +12 -6
- package/src/treegrid/actions/rowdragdrop.js +20 -1
- package/src/treegrid/actions/selection.d.ts +21 -0
- package/src/treegrid/actions/selection.js +197 -31
- package/src/treegrid/actions/toolbar.js +8 -5
- package/src/treegrid/base/constant.d.ts +4 -0
- package/src/treegrid/base/constant.js +4 -0
- package/src/treegrid/base/data.d.ts +17 -0
- package/src/treegrid/base/data.js +189 -132
- package/src/treegrid/base/treegrid-model.d.ts +35 -4
- package/src/treegrid/base/treegrid.d.ts +43 -7
- package/src/treegrid/base/treegrid.js +181 -73
- package/src/treegrid/enum.d.ts +12 -0
- package/src/treegrid/models/column.d.ts +2 -2
- package/src/treegrid/models/dom-virtualization-settings-model.d.ts +50 -0
- package/src/treegrid/models/dom-virtualization-settings.d.ts +43 -0
- package/src/treegrid/models/dom-virtualization-settings.js +47 -0
- package/src/treegrid/models/index.d.ts +2 -0
- package/src/treegrid/models/index.js +1 -0
- package/src/treegrid/models/summary-model.d.ts +1 -1
- package/src/treegrid/models/summary.d.ts +1 -1
- package/src/treegrid/renderer/dom-virtual-tree-content-renderer.d.ts +20 -0
- package/src/treegrid/renderer/dom-virtual-tree-content-renderer.js +49 -0
- package/src/treegrid/renderer/index.d.ts +1 -0
- package/src/treegrid/renderer/index.js +1 -0
- package/src/treegrid/renderer/render.js +4 -3
- package/src/treegrid/renderer/virtual-tree-content-render.js +1 -2
- package/helpers/e2e/index.d.ts +0 -1
- package/helpers/e2e/index.js +0 -8
- package/helpers/e2e/treegridhelper.d.ts +0 -21
- package/helpers/e2e/treegridhelper.js +0 -83
- package/styles/bds-lite.css +0 -402
- package/styles/bds-lite.scss +0 -3
- package/styles/bds.css +0 -422
- package/styles/bds.scss +0 -4
- package/styles/bootstrap-dark-lite.css +0 -406
- package/styles/bootstrap-dark-lite.scss +0 -3
- package/styles/bootstrap-dark.css +0 -426
- package/styles/bootstrap-dark.scss +0 -4
- package/styles/bootstrap-lite.css +0 -409
- package/styles/bootstrap-lite.scss +0 -3
- package/styles/bootstrap.css +0 -432
- package/styles/bootstrap.scss +0 -4
- package/styles/bootstrap4-lite.css +0 -406
- package/styles/bootstrap4-lite.scss +0 -3
- package/styles/bootstrap4.css +0 -426
- package/styles/bootstrap4.scss +0 -4
- package/styles/bootstrap5-dark-lite.css +0 -406
- package/styles/bootstrap5-dark-lite.scss +0 -3
- package/styles/bootstrap5-dark.css +0 -426
- package/styles/bootstrap5-dark.scss +0 -4
- package/styles/bootstrap5-lite.css +0 -406
- package/styles/bootstrap5-lite.scss +0 -3
- package/styles/bootstrap5.3-lite.css +0 -490
- package/styles/bootstrap5.3-lite.scss +0 -3
- package/styles/bootstrap5.3.css +0 -510
- package/styles/bootstrap5.3.scss +0 -4
- package/styles/bootstrap5.css +0 -426
- package/styles/bootstrap5.scss +0 -4
- package/styles/fabric-dark-lite.css +0 -409
- package/styles/fabric-dark-lite.scss +0 -3
- package/styles/fabric-dark.css +0 -432
- package/styles/fabric-dark.scss +0 -4
- package/styles/fabric-lite.css +0 -409
- package/styles/fabric-lite.scss +0 -3
- package/styles/fabric.css +0 -432
- package/styles/fabric.scss +0 -4
- package/styles/fluent-dark-lite.css +0 -417
- package/styles/fluent-dark-lite.scss +0 -3
- package/styles/fluent-dark.css +0 -444
- package/styles/fluent-dark.scss +0 -4
- package/styles/fluent-lite.css +0 -417
- package/styles/fluent-lite.scss +0 -3
- package/styles/fluent.css +0 -444
- package/styles/fluent.scss +0 -4
- package/styles/fluent2-lite.css +0 -507
- package/styles/fluent2-lite.scss +0 -3
- package/styles/fluent2.css +0 -531
- package/styles/fluent2.scss +0 -4
- package/styles/highcontrast-light-lite.css +0 -406
- package/styles/highcontrast-light-lite.scss +0 -3
- package/styles/highcontrast-light.css +0 -426
- package/styles/highcontrast-light.scss +0 -4
- package/styles/highcontrast-lite.css +0 -413
- package/styles/highcontrast-lite.scss +0 -3
- package/styles/highcontrast.css +0 -439
- package/styles/highcontrast.scss +0 -4
- package/styles/material-dark-lite.css +0 -406
- package/styles/material-dark-lite.scss +0 -3
- package/styles/material-dark.css +0 -426
- package/styles/material-dark.scss +0 -4
- package/styles/material-lite.css +0 -406
- package/styles/material-lite.scss +0 -3
- package/styles/material.css +0 -426
- package/styles/material.scss +0 -4
- package/styles/material3-dark-lite.css +0 -488
- package/styles/material3-dark-lite.scss +0 -3
- package/styles/material3-dark.css +0 -508
- package/styles/material3-dark.scss +0 -4
- package/styles/material3-lite.css +0 -490
- package/styles/material3-lite.scss +0 -3
- package/styles/material3.css +0 -510
- package/styles/material3.scss +0 -4
- package/styles/tailwind-dark-lite.css +0 -406
- package/styles/tailwind-dark-lite.scss +0 -3
- package/styles/tailwind-dark.css +0 -426
- package/styles/tailwind-dark.scss +0 -4
- package/styles/tailwind-lite.css +0 -406
- package/styles/tailwind-lite.scss +0 -3
- package/styles/tailwind.css +0 -426
- package/styles/tailwind.scss +0 -4
- package/styles/tailwind3-lite.css +0 -480
- package/styles/tailwind3-lite.scss +0 -3
- package/styles/tailwind3.css +0 -500
- package/styles/tailwind3.scss +0 -4
- package/styles/treegrid/_all.scss +0 -2
- package/styles/treegrid/_bds-definition.scss +0 -28
- package/styles/treegrid/_bigger.scss +0 -70
- package/styles/treegrid/_bootstrap-dark-definition.scss +0 -33
- package/styles/treegrid/_bootstrap-definition.scss +0 -33
- package/styles/treegrid/_bootstrap4-definition.scss +0 -33
- package/styles/treegrid/_bootstrap5-dark-definition.scss +0 -28
- package/styles/treegrid/_bootstrap5-definition.scss +0 -28
- package/styles/treegrid/_bootstrap5.3-definition.scss +0 -28
- package/styles/treegrid/_fabric-dark-definition.scss +0 -33
- package/styles/treegrid/_fabric-definition.scss +0 -33
- package/styles/treegrid/_fluent-dark-definition.scss +0 -29
- package/styles/treegrid/_fluent-definition.scss +0 -29
- package/styles/treegrid/_fluent2-definition.scss +0 -28
- package/styles/treegrid/_fusionnew-definition.scss +0 -26
- package/styles/treegrid/_highcontrast-definition.scss +0 -33
- package/styles/treegrid/_highcontrast-light-definition.scss +0 -33
- package/styles/treegrid/_icons.scss +0 -47
- package/styles/treegrid/_layout.scss +0 -531
- package/styles/treegrid/_material-dark-definition.scss +0 -33
- package/styles/treegrid/_material-definition.scss +0 -33
- package/styles/treegrid/_material3-dark-definition.scss +0 -28
- package/styles/treegrid/_material3-definition.scss +0 -28
- package/styles/treegrid/_tailwind-dark-definition.scss +0 -28
- package/styles/treegrid/_tailwind-definition.scss +0 -28
- package/styles/treegrid/_tailwind3-definition.scss +0 -28
- package/styles/treegrid/_theme.scss +0 -1
- package/styles/treegrid/_variables.scss +0 -2
- package/styles/treegrid/bds.css +0 -422
- package/styles/treegrid/bds.scss +0 -4
- package/styles/treegrid/bootstrap-dark.css +0 -426
- package/styles/treegrid/bootstrap-dark.scss +0 -4
- package/styles/treegrid/bootstrap.css +0 -432
- package/styles/treegrid/bootstrap.scss +0 -4
- package/styles/treegrid/bootstrap4.css +0 -426
- package/styles/treegrid/bootstrap4.scss +0 -4
- package/styles/treegrid/bootstrap5-dark.css +0 -426
- package/styles/treegrid/bootstrap5-dark.scss +0 -4
- package/styles/treegrid/bootstrap5.3.css +0 -510
- package/styles/treegrid/bootstrap5.3.scss +0 -4
- package/styles/treegrid/bootstrap5.css +0 -426
- package/styles/treegrid/bootstrap5.scss +0 -4
- package/styles/treegrid/fabric-dark.css +0 -432
- package/styles/treegrid/fabric-dark.scss +0 -4
- package/styles/treegrid/fabric.css +0 -432
- package/styles/treegrid/fabric.scss +0 -4
- package/styles/treegrid/fluent-dark.css +0 -444
- package/styles/treegrid/fluent-dark.scss +0 -4
- package/styles/treegrid/fluent.css +0 -444
- package/styles/treegrid/fluent.scss +0 -4
- package/styles/treegrid/fluent2.css +0 -531
- package/styles/treegrid/fluent2.scss +0 -4
- package/styles/treegrid/highcontrast-light.css +0 -426
- package/styles/treegrid/highcontrast-light.scss +0 -4
- package/styles/treegrid/highcontrast.css +0 -439
- package/styles/treegrid/highcontrast.scss +0 -4
- package/styles/treegrid/icons/_bds.scss +0 -38
- package/styles/treegrid/icons/_bootstrap-dark.scss +0 -48
- package/styles/treegrid/icons/_bootstrap.scss +0 -48
- package/styles/treegrid/icons/_bootstrap4.scss +0 -48
- package/styles/treegrid/icons/_bootstrap5-dark.scss +0 -1
- package/styles/treegrid/icons/_bootstrap5.3.scss +0 -48
- package/styles/treegrid/icons/_bootstrap5.scss +0 -48
- package/styles/treegrid/icons/_fabric-dark.scss +0 -48
- package/styles/treegrid/icons/_fabric.scss +0 -48
- package/styles/treegrid/icons/_fluent-dark.scss +0 -1
- package/styles/treegrid/icons/_fluent.scss +0 -48
- package/styles/treegrid/icons/_fluent2.scss +0 -48
- package/styles/treegrid/icons/_fusionnew.scss +0 -31
- package/styles/treegrid/icons/_highcontrast-light.scss +0 -48
- package/styles/treegrid/icons/_highcontrast.scss +0 -48
- package/styles/treegrid/icons/_material-dark.scss +0 -48
- package/styles/treegrid/icons/_material.scss +0 -48
- package/styles/treegrid/icons/_material3-dark.scss +0 -1
- package/styles/treegrid/icons/_material3.scss +0 -48
- package/styles/treegrid/icons/_tailwind-dark.scss +0 -48
- package/styles/treegrid/icons/_tailwind.scss +0 -48
- package/styles/treegrid/icons/_tailwind3.scss +0 -48
- package/styles/treegrid/material-dark.css +0 -426
- package/styles/treegrid/material-dark.scss +0 -4
- package/styles/treegrid/material.css +0 -426
- package/styles/treegrid/material.scss +0 -4
- package/styles/treegrid/material3-dark.css +0 -508
- package/styles/treegrid/material3-dark.scss +0 -4
- package/styles/treegrid/material3.css +0 -510
- package/styles/treegrid/material3.scss +0 -4
- package/styles/treegrid/tailwind-dark.css +0 -426
- package/styles/treegrid/tailwind-dark.scss +0 -4
- package/styles/treegrid/tailwind.css +0 -426
- package/styles/treegrid/tailwind.scss +0 -4
- package/styles/treegrid/tailwind3.css +0 -500
- package/styles/treegrid/tailwind3.scss +0 -4
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 35.1.37
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncfusion/ej2-treegrid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.1.37",
|
|
4
4
|
"description": "Essential JS 2 TreeGrid Component",
|
|
5
5
|
"author": "Syncfusion Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN license",
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"module": "./index.js",
|
|
9
9
|
"es2015": "./dist/es6/ej2-treegrid.es5.js",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@syncfusion/ej2-base": "~
|
|
12
|
-
"@syncfusion/ej2-data": "~
|
|
13
|
-
"@syncfusion/ej2-grids": "~
|
|
14
|
-
"@syncfusion/ej2-popups": "~
|
|
11
|
+
"@syncfusion/ej2-base": "~35.1.37",
|
|
12
|
+
"@syncfusion/ej2-data": "~35.1.37",
|
|
13
|
+
"@syncfusion/ej2-grids": "~35.1.37",
|
|
14
|
+
"@syncfusion/ej2-popups": "~35.1.37"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {},
|
|
17
17
|
"keywords": [
|
package/src/global.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as index from './index';
|
|
2
|
-
index.TreeGrid.Inject(index.Filter, index.Page, index.Sort, index.Reorder, index.Toolbar, index.Aggregate, index.Resize, index.ColumnMenu, index.ExcelExport, index.PdfExport, index.CommandColumn, index.ContextMenu, index.Edit, index.Selection, index.VirtualScroll, index.DetailRow, index.RowDD, index.Freeze, index.ColumnChooser, index.Logger, index.InfiniteScroll);
|
|
2
|
+
index.TreeGrid.Inject(index.Filter, index.Page, index.Sort, index.Reorder, index.Toolbar, index.Aggregate, index.Resize, index.ColumnMenu, index.ExcelExport, index.PdfExport, index.CommandColumn, index.ContextMenu, index.Edit, index.Selection, index.VirtualScroll, index.DetailRow, index.RowDD, index.Freeze, index.ColumnChooser, index.Logger, index.InfiniteScroll, index.DomVirtualization);
|
|
3
3
|
export * from './index';
|
|
@@ -86,9 +86,9 @@ export function editAction(details, control, isSelfReference, addRowIndex, selec
|
|
|
86
86
|
else {
|
|
87
87
|
if (action === 'edit') {
|
|
88
88
|
for (j = 0; j < keys.length; j++) {
|
|
89
|
-
if (Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], keys[parseInt(j.toString(), 10)]) &&
|
|
90
|
-
|| (!isNullOrUndefined(batchChanges) && batchChanges["" + changedRecords].length === 0))
|
|
91
|
-
|
|
89
|
+
if (Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], keys[parseInt(j.toString(), 10)]) &&
|
|
90
|
+
((!isNullOrUndefined(control.editSettings.mode) || (!isNullOrUndefined(batchChanges) && batchChanges["" + changedRecords].length === 0))
|
|
91
|
+
|| keys[parseInt(j.toString(), 10)] === columnName)) {
|
|
92
92
|
var editedData = getParentData(control, modifiedData[parseInt(k.toString(), 10)].uniqueID);
|
|
93
93
|
treeData[parseInt(i.toString(), 10)][keys[parseInt(j.toString(), 10)]] =
|
|
94
94
|
modifiedData[parseInt(k.toString(), 10)][keys[parseInt(j.toString(), 10)]];
|
|
@@ -241,16 +241,11 @@ export function removeChildRecords(childRecords, modifiedData, action, key, cont
|
|
|
241
241
|
var editedData = getParentData(control, modifiedData.uniqueID);
|
|
242
242
|
for (var i = 0; i < keys.length; i++) {
|
|
243
243
|
if (Object.prototype.hasOwnProperty.call(childRecords[parseInt(j.toString(), 10)], keys[parseInt(i.toString(), 10)]) &&
|
|
244
|
-
(control.editSettings.mode
|
|
244
|
+
(!isNullOrUndefined(control.editSettings.mode) || keys[parseInt(i.toString(), 10)] === columnName)) {
|
|
245
245
|
editedData[keys[parseInt(i.toString(), 10)]] =
|
|
246
246
|
editedData.taskData[keys[parseInt(i.toString(), 10)]] =
|
|
247
247
|
childRecords[parseInt(j.toString(), 10)][keys[parseInt(i.toString(), 10)]] =
|
|
248
248
|
modifiedData[keys[parseInt(i.toString(), 10)]];
|
|
249
|
-
if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell' && !isNullOrUndefined(control.grid.editModule)) {
|
|
250
|
-
var editModule = 'editModule';
|
|
251
|
-
control.grid.editModule["" + editModule].editRowIndex = modifiedData.index;
|
|
252
|
-
control.grid.editModule["" + editModule].updateCurrentViewData(modifiedData);
|
|
253
|
-
}
|
|
254
249
|
}
|
|
255
250
|
}
|
|
256
251
|
break;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { TreeGrid } from '../base/treegrid';
|
|
2
|
+
import { IGrid, ServiceLocator } from '@syncfusion/ej2-grids';
|
|
3
|
+
import { DomVirtualization as GridDomVirtualization } from '@syncfusion/ej2-grids';
|
|
4
|
+
/**
|
|
5
|
+
* TreeGrid DOM Virtualization module handles high-performance rendering of large hierarchical datasets.
|
|
6
|
+
*
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
export declare class DomVirtualization {
|
|
10
|
+
private parent;
|
|
11
|
+
private locator;
|
|
12
|
+
private visualData;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor for DomVirtualization module
|
|
15
|
+
*
|
|
16
|
+
* @param {TreeGrid} parent - TreeGrid instance
|
|
17
|
+
* @param {ServiceLocator} locator - Service locator for dependency injection
|
|
18
|
+
*/
|
|
19
|
+
constructor(parent: TreeGrid, locator?: ServiceLocator);
|
|
20
|
+
getModuleName(): string;
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
25
|
+
addEventListener(): void;
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
* @returns {void}
|
|
29
|
+
*/
|
|
30
|
+
removeEventListener(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Handles the action related to virtual scrolling with paging details.
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} pageingDetails - Contains the result data, count of results, and action arguments.
|
|
35
|
+
* @param {ITreeData[]} pageingDetails.result - The result data to be handled.
|
|
36
|
+
* @param {number} pageingDetails.count - The count of results.
|
|
37
|
+
* @param {ActionEventArgs} pageingDetails.actionArgs - The action arguments related to the virtual page action.
|
|
38
|
+
* @returns {void}
|
|
39
|
+
*/
|
|
40
|
+
private virtualPageAction;
|
|
41
|
+
private calculateChildCount;
|
|
42
|
+
/**
|
|
43
|
+
* Handles the virtual child collapse or expand action in a tree grid.
|
|
44
|
+
*
|
|
45
|
+
* @param {object} row - Object containing information about the collapse/expand action.
|
|
46
|
+
* @param {string} row.action - The type of action, either "collapse" or "expand".
|
|
47
|
+
* @param {HTMLTableRowElement} row.row - The HTML row element that is affected by the action.
|
|
48
|
+
* @param {ITreeData} row.record - The tree data record associated with the row.
|
|
49
|
+
* @param {RowCollapsedEventArgs} row.args - Additional event arguments related to the row collapse or expand.
|
|
50
|
+
*
|
|
51
|
+
* @returns {void} No return value as the function executes a procedure.
|
|
52
|
+
*/
|
|
53
|
+
private collapseExpandVirtualchilds;
|
|
54
|
+
destroy(): void;
|
|
55
|
+
}
|
|
56
|
+
export declare class DomVirtualTreeExtension extends GridDomVirtualization {
|
|
57
|
+
/**
|
|
58
|
+
* Constructor for DomVirtualTreeExtension
|
|
59
|
+
*
|
|
60
|
+
* @param {IGrid} parent - Grid instance (actually TreeGrid)
|
|
61
|
+
* @param {ServiceLocator} locator - Service locator for dependency injection
|
|
62
|
+
*/
|
|
63
|
+
constructor(parent: IGrid, locator?: ServiceLocator);
|
|
64
|
+
getModuleName(): string;
|
|
65
|
+
protected instantiateRenderers(): void;
|
|
66
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
import { RenderType, Grid } from '@syncfusion/ej2-grids';
|
|
15
|
+
import { DomVirtualization as GridDomVirtualization } from '@syncfusion/ej2-grids';
|
|
16
|
+
import { initialLoad, destroy } from '@syncfusion/ej2-grids';
|
|
17
|
+
import { DomVirtualTreeContentRenderer } from '../renderer/dom-virtual-tree-content-renderer';
|
|
18
|
+
import { getValue, initializeTelemetryFeature, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
19
|
+
import * as events from '../base/constant';
|
|
20
|
+
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
21
|
+
import { getExpandStatus, isOffline, isRemoteData } from '../utils';
|
|
22
|
+
/**
|
|
23
|
+
* TreeGrid DOM Virtualization module handles high-performance rendering of large hierarchical datasets.
|
|
24
|
+
*
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
var DomVirtualization = /** @class */ (function () {
|
|
28
|
+
/**
|
|
29
|
+
* Constructor for DomVirtualization module
|
|
30
|
+
*
|
|
31
|
+
* @param {TreeGrid} parent - TreeGrid instance
|
|
32
|
+
* @param {ServiceLocator} locator - Service locator for dependency injection
|
|
33
|
+
*/
|
|
34
|
+
function DomVirtualization(parent, locator) {
|
|
35
|
+
initializeTelemetryFeature('DomVirtualization', 'TreeGrid');
|
|
36
|
+
this.parent = parent;
|
|
37
|
+
this.locator = locator;
|
|
38
|
+
Grid.Inject(DomVirtualTreeExtension);
|
|
39
|
+
this.addEventListener();
|
|
40
|
+
}
|
|
41
|
+
DomVirtualization.prototype.getModuleName = function () {
|
|
42
|
+
return 'domVirtualization';
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
* @returns {void}
|
|
47
|
+
*/
|
|
48
|
+
DomVirtualization.prototype.addEventListener = function () {
|
|
49
|
+
if (this.parent.isDestroyed) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.parent.on(destroy, this.destroy, this);
|
|
53
|
+
this.parent.on(events.virtualExpandCollapse, this.collapseExpandVirtualchilds, this);
|
|
54
|
+
this.parent.on(events.pagingActions, this.virtualPageAction, this);
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @hidden
|
|
58
|
+
* @returns {void}
|
|
59
|
+
*/
|
|
60
|
+
DomVirtualization.prototype.removeEventListener = function () {
|
|
61
|
+
if (this.parent.isDestroyed) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
this.parent.off(destroy, this.destroy);
|
|
65
|
+
this.parent.off(events.virtualExpandCollapse, this.collapseExpandVirtualchilds);
|
|
66
|
+
this.parent.off(events.pagingActions, this.virtualPageAction);
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Handles the action related to virtual scrolling with paging details.
|
|
70
|
+
*
|
|
71
|
+
* @param {Object} pageingDetails - Contains the result data, count of results, and action arguments.
|
|
72
|
+
* @param {ITreeData[]} pageingDetails.result - The result data to be handled.
|
|
73
|
+
* @param {number} pageingDetails.count - The count of results.
|
|
74
|
+
* @param {ActionEventArgs} pageingDetails.actionArgs - The action arguments related to the virtual page action.
|
|
75
|
+
* @returns {void}
|
|
76
|
+
*/
|
|
77
|
+
DomVirtualization.prototype.virtualPageAction = function (pageingDetails) {
|
|
78
|
+
var _this = this;
|
|
79
|
+
var actionArgs = getValue('actionArgs', pageingDetails.actionArgs);
|
|
80
|
+
var action = getValue('action', pageingDetails.actionArgs);
|
|
81
|
+
var isFiltering = (pageingDetails.actionArgs.requestType === 'filtering' && (pageingDetails.actionArgs.action !== 'clear-filter' && pageingDetails.actionArgs.action !== 'clearFilter')) ||
|
|
82
|
+
(!isNullOrUndefined(this.parent['filterModule']) && (this.parent['filterModule'].filteredResult && this.parent['filterModule'].filteredResult.length > 0));
|
|
83
|
+
var isFlatHierarchy = this.parent.filterSettings.hierarchyMode === 'Child' ||
|
|
84
|
+
this.parent.filterSettings.hierarchyMode === 'None';
|
|
85
|
+
var parents = pageingDetails.result;
|
|
86
|
+
parents = isFiltering && isFlatHierarchy ? parents.filter(function (e) {
|
|
87
|
+
if (isNullOrUndefined(e.parentItem)) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
var hasParentInFilteredList = parents.some(function (p) { return p.uniqueID === e.parentItem.uniqueID; });
|
|
91
|
+
return hasParentInFilteredList ? getExpandStatus(_this.parent, e, parents) : true;
|
|
92
|
+
}) : parents.filter(function (e) { return getExpandStatus(_this.parent, e, parents); });
|
|
93
|
+
this.parent.virtualDomScrollData = parents;
|
|
94
|
+
var dm = new DataManager(parents);
|
|
95
|
+
this.visualData = parents;
|
|
96
|
+
var query = new Query();
|
|
97
|
+
if (this.parent.allowPaging || this.parent.enableVirtualization) {
|
|
98
|
+
var take = isNullOrUndefined(actionArgs.requestType) || actionArgs.requestType === 'dom-virtualscroll' ?
|
|
99
|
+
pageingDetails.actionArgs.result.length : pageingDetails.result.length;
|
|
100
|
+
if (action === 'collapse') {
|
|
101
|
+
take = this.parent.grid.currentViewData.length;
|
|
102
|
+
}
|
|
103
|
+
var skip = this.parent.grid.pageSettings.currentPage <= 1 ? 0 :
|
|
104
|
+
(this.parent.grid.pageSettings.currentPage - 1) * this.parent.grid.pageSettings.pageSize;
|
|
105
|
+
if (actionArgs.requestType === 'dom-virtualscroll') {
|
|
106
|
+
var pagingQueries = (pageingDetails.actionArgs && pageingDetails.actionArgs.query
|
|
107
|
+
&& pageingDetails.actionArgs.query.queries) || [];
|
|
108
|
+
var takeQuery = pagingQueries.filter(function (q) { return q.fn === 'onTake'; });
|
|
109
|
+
var explicitTake = takeQuery.length > 0
|
|
110
|
+
? takeQuery[parseInt((takeQuery.length - 1).toString(), 10)] : undefined;
|
|
111
|
+
if (!isNullOrUndefined(explicitTake) && typeof explicitTake.e.nos === 'number') {
|
|
112
|
+
take = explicitTake.e.nos;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else if ((actionArgs.requestType === 'filtering' || actionArgs.requestType === 'searching') && skip > 0) {
|
|
116
|
+
skip = 0;
|
|
117
|
+
this.parent.grid.setProperties({ pageSettings: { currentPage: 1 } }, true);
|
|
118
|
+
}
|
|
119
|
+
query = query.skip(skip).take(take);
|
|
120
|
+
}
|
|
121
|
+
dm.dataSource.json = this.visualData;
|
|
122
|
+
pageingDetails.result = dm.executeLocal(query);
|
|
123
|
+
pageingDetails.count = this.visualData.length;
|
|
124
|
+
this.parent.notify('updateAction', pageingDetails);
|
|
125
|
+
};
|
|
126
|
+
DomVirtualization.prototype.calculateChildCount = function (startIndex, level, records) {
|
|
127
|
+
var count = 0;
|
|
128
|
+
for (var i = startIndex; i < records.length; i++) {
|
|
129
|
+
if (records[i + 1] && (level === records[i + 1].level || level === records[i + 1].level + 1)) {
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
count++;
|
|
133
|
+
}
|
|
134
|
+
return count;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Handles the virtual child collapse or expand action in a tree grid.
|
|
138
|
+
*
|
|
139
|
+
* @param {object} row - Object containing information about the collapse/expand action.
|
|
140
|
+
* @param {string} row.action - The type of action, either "collapse" or "expand".
|
|
141
|
+
* @param {HTMLTableRowElement} row.row - The HTML row element that is affected by the action.
|
|
142
|
+
* @param {ITreeData} row.record - The tree data record associated with the row.
|
|
143
|
+
* @param {RowCollapsedEventArgs} row.args - Additional event arguments related to the row collapse or expand.
|
|
144
|
+
*
|
|
145
|
+
* @returns {void} No return value as the function executes a procedure.
|
|
146
|
+
*/
|
|
147
|
+
DomVirtualization.prototype.collapseExpandVirtualchilds = function (row) {
|
|
148
|
+
var contentModule = this.parent.grid.contentModule;
|
|
149
|
+
var isRemote = isRemoteData(this.parent) && !isOffline(this.parent);
|
|
150
|
+
var flatData = isRemote ? this.parent.getCurrentViewRecords() : this.parent.enableVirtualization ?
|
|
151
|
+
this.parent.virtualDomScrollData.slice() : this.parent.grid.currentViewData.slice();
|
|
152
|
+
var totalflatData = this.parent.infiniteScrollData;
|
|
153
|
+
var uniqueIDCollpaseCollection = this.parent.uniqueIDCollpaseCollection;
|
|
154
|
+
var startIndex = contentModule.currentStartIndex;
|
|
155
|
+
if (getValue('isCollapseAll', this.parent) || getValue('isExpandAll', this.parent)) {
|
|
156
|
+
if (row.action === 'collapse') {
|
|
157
|
+
flatData.filter(function (e) {
|
|
158
|
+
if (e.hasChildRecords) {
|
|
159
|
+
e.expanded = row.action === 'collapse' ? false : true;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
flatData.splice.apply(flatData, [0, flatData.length].concat(this.parent.parentData));
|
|
163
|
+
// this.parent.pageSettings.totalRecordsCount = this.parent.parentData.length;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
totalflatData.filter(function (e) {
|
|
167
|
+
if (e.hasChildRecords) {
|
|
168
|
+
e.expanded = row.action === 'collapse' ? false : true;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
flatData.splice.apply(flatData, [0, flatData.length].concat(totalflatData));
|
|
172
|
+
// this.parent.pageSettings.totalRecordsCount = totalflatData.length;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
row.record.expanded = row.action === 'collapse' ? false : true;
|
|
177
|
+
for (var i = startIndex; i < flatData.length; i++) {
|
|
178
|
+
if (row.record.uniqueID === flatData[parseInt(i.toString(), 10)].uniqueID &&
|
|
179
|
+
row.record.childRecords.length > 0) {
|
|
180
|
+
if (row.action === 'collapse') {
|
|
181
|
+
var level = flatData[parseInt(i.toString(), 10)].level;
|
|
182
|
+
var count = this.calculateChildCount(i, level, flatData);
|
|
183
|
+
// this.parent.pageSettings.totalRecordsCount -= count;
|
|
184
|
+
uniqueIDCollpaseCollection[row.record.uniqueID] = flatData.splice(i + 1, count);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
if (uniqueIDCollpaseCollection[row.record.uniqueID] && uniqueIDCollpaseCollection[row.record.uniqueID].length) {
|
|
188
|
+
flatData.splice.apply(flatData, [i + 1, 0].concat(uniqueIDCollpaseCollection[row.record.uniqueID]));
|
|
189
|
+
// this.parent.pageSettings.totalRecordsCount += uniqueIDCollpaseCollection[row.record.uniqueID].length;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
uniqueIDCollpaseCollection[row.record.uniqueID] = row.record.childRecords;
|
|
193
|
+
flatData.splice.apply(flatData, [i + 1, 0].concat(uniqueIDCollpaseCollection[row.record.uniqueID]));
|
|
194
|
+
// this.parent.pageSettings.totalRecordsCount += uniqueIDCollpaseCollection[row.record.uniqueID].length;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
var actionDetails = {
|
|
202
|
+
result: flatData,
|
|
203
|
+
row: row.row,
|
|
204
|
+
action: row.action,
|
|
205
|
+
record: row.record,
|
|
206
|
+
count: flatData.length
|
|
207
|
+
};
|
|
208
|
+
getValue('grid.renderModule', this.parent).dataManagerSuccess(actionDetails, { requestType: 'refresh' });
|
|
209
|
+
};
|
|
210
|
+
DomVirtualization.prototype.destroy = function () {
|
|
211
|
+
this.removeEventListener();
|
|
212
|
+
};
|
|
213
|
+
return DomVirtualization;
|
|
214
|
+
}());
|
|
215
|
+
export { DomVirtualization };
|
|
216
|
+
var DomVirtualTreeExtension = /** @class */ (function (_super) {
|
|
217
|
+
__extends(DomVirtualTreeExtension, _super);
|
|
218
|
+
/**
|
|
219
|
+
* Constructor for DomVirtualTreeExtension
|
|
220
|
+
*
|
|
221
|
+
* @param {IGrid} parent - Grid instance (actually TreeGrid)
|
|
222
|
+
* @param {ServiceLocator} locator - Service locator for dependency injection
|
|
223
|
+
*/
|
|
224
|
+
function DomVirtualTreeExtension(parent, locator) {
|
|
225
|
+
var _this = _super.call(this, parent, locator) || this;
|
|
226
|
+
getValue('parent', _this).off(initialLoad, getValue('instantiateRenderer', _this), _this);
|
|
227
|
+
getValue('parent', _this).on(initialLoad, _this.instantiateRenderers, _this);
|
|
228
|
+
return _this;
|
|
229
|
+
}
|
|
230
|
+
DomVirtualTreeExtension.prototype.getModuleName = function () {
|
|
231
|
+
return 'treeDomVirtualization';
|
|
232
|
+
};
|
|
233
|
+
DomVirtualTreeExtension.prototype.instantiateRenderers = function () {
|
|
234
|
+
var rendererFactory = getValue('locator', this).getService('rendererFactory');
|
|
235
|
+
getValue('addRenderer', rendererFactory)
|
|
236
|
+
.apply(rendererFactory, [RenderType.Content, new DomVirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
|
|
237
|
+
};
|
|
238
|
+
return DomVirtualTreeExtension;
|
|
239
|
+
}(GridDomVirtualization));
|
|
240
|
+
export { DomVirtualTreeExtension };
|
|
@@ -49,8 +49,8 @@ export declare class Edit {
|
|
|
49
49
|
addEventListener(): void;
|
|
50
50
|
private gridDblClick;
|
|
51
51
|
private getRowPosition;
|
|
52
|
+
private resetDoubleClickTarget;
|
|
52
53
|
private beforeStartEdit;
|
|
53
|
-
private beforeBatchCancel;
|
|
54
54
|
/**
|
|
55
55
|
* @hidden
|
|
56
56
|
* @returns {void}
|
|
@@ -73,8 +73,6 @@ export declare class Edit {
|
|
|
73
73
|
private infiniteAddAction;
|
|
74
74
|
private updateInfiniteCurrentViewData;
|
|
75
75
|
private recordDoubleClick;
|
|
76
|
-
private updateGridEditMode;
|
|
77
|
-
private resetIsOnBatch;
|
|
78
76
|
private keyPressed;
|
|
79
77
|
private deleteUniqueID;
|
|
80
78
|
private cellEdit;
|
|
@@ -82,7 +80,6 @@ export declare class Edit {
|
|
|
82
80
|
private batchCancel;
|
|
83
81
|
private customCellSave;
|
|
84
82
|
private cellSave;
|
|
85
|
-
private afterCellSave;
|
|
86
83
|
private lastCellTab;
|
|
87
84
|
private updateCell;
|
|
88
85
|
private crudAction;
|