@syncfusion/ej2-treegrid 19.3.44 → 19.3.48
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/CHANGELOG.md +39 -0
- 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 +286 -93
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +322 -125
- 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 +9 -9
- package/src/treegrid/actions/batch-edit.js +19 -7
- package/src/treegrid/actions/crud-actions.js +1 -0
- package/src/treegrid/actions/edit.js +14 -7
- package/src/treegrid/actions/freeze-column.js +2 -1
- package/src/treegrid/actions/rowdragdrop.js +69 -46
- package/src/treegrid/actions/selection.js +29 -6
- package/src/treegrid/actions/virtual-scroll.js +15 -4
- package/src/treegrid/base/constant.d.ts +4 -0
- package/src/treegrid/base/constant.js +4 -0
- package/src/treegrid/base/treegrid-model.d.ts +8 -0
- package/src/treegrid/base/treegrid.d.ts +8 -0
- package/src/treegrid/base/treegrid.js +46 -17
- package/src/treegrid/renderer/render.js +9 -1
- package/src/treegrid/renderer/virtual-row-model-generator.d.ts +1 -0
- package/src/treegrid/renderer/virtual-row-model-generator.js +12 -0
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +2 -1
- package/src/treegrid/renderer/virtual-tree-content-render.js +102 -35
- package/styles/bootstrap-dark.css +1 -1
- package/styles/bootstrap.css +1 -1
- package/styles/bootstrap4.css +6 -1
- package/styles/bootstrap5-dark.css +32 -27
- package/styles/bootstrap5.css +32 -27
- package/styles/fabric-dark.css +1 -1
- package/styles/fabric.css +1 -1
- package/styles/highcontrast-light.css +1 -1
- package/styles/highcontrast.css +1 -1
- package/styles/material-dark.css +1 -1
- package/styles/material.css +1 -1
- package/styles/tailwind-dark.css +27 -27
- package/styles/tailwind.css +1 -1
- package/styles/treegrid/_bootstrap5-definition.scss +4 -4
- package/styles/treegrid/_layout.scss +1 -1
- package/styles/treegrid/_tailwind-definition.scss +4 -4
- package/styles/treegrid/bootstrap-dark.css +1 -1
- package/styles/treegrid/bootstrap.css +1 -1
- package/styles/treegrid/bootstrap4.css +6 -1
- package/styles/treegrid/bootstrap5-dark.css +32 -27
- package/styles/treegrid/bootstrap5.css +32 -27
- package/styles/treegrid/fabric-dark.css +1 -1
- package/styles/treegrid/fabric.css +1 -1
- package/styles/treegrid/highcontrast-light.css +1 -1
- package/styles/treegrid/highcontrast.css +1 -1
- package/styles/treegrid/material-dark.css +1 -1
- package/styles/treegrid/material.css +1 -1
- package/styles/treegrid/tailwind-dark.css +27 -27
- package/styles/treegrid/tailwind.css +1 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.3.
|
|
3
|
+
* version : 19.3.48
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. 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,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-treegrid@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-treegrid@19.
|
|
3
|
+
"_id": "@syncfusion/ej2-treegrid@19.3.47",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-1qAa8qD3pixiqbAaV3Iqu5V6+3NzXa8G+EHL6QLhJF0fo/Fgj4DOuEUXSnQCy602s3YVzqSSPSAboKUvBNe4gg==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-treegrid",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"/@syncfusion/ej2-react-treegrid",
|
|
25
25
|
"/@syncfusion/ej2-vue-treegrid"
|
|
26
26
|
],
|
|
27
|
-
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-treegrid/-/ej2-treegrid-19.
|
|
28
|
-
"_shasum": "
|
|
27
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-treegrid/-/ej2-treegrid-19.3.47.tgz",
|
|
28
|
+
"_shasum": "9d3509b03b5ef89e7c2517ecea267f4908255bb6",
|
|
29
29
|
"_spec": "@syncfusion/ej2-treegrid@*",
|
|
30
30
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
31
31
|
"author": {
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
},
|
|
37
37
|
"bundleDependencies": false,
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@syncfusion/ej2-base": "~19.3.
|
|
40
|
-
"@syncfusion/ej2-data": "~19.3.
|
|
41
|
-
"@syncfusion/ej2-grids": "~19.3.
|
|
42
|
-
"@syncfusion/ej2-popups": "~19.3.
|
|
39
|
+
"@syncfusion/ej2-base": "~19.3.47",
|
|
40
|
+
"@syncfusion/ej2-data": "~19.3.47",
|
|
41
|
+
"@syncfusion/ej2-grids": "~19.3.48",
|
|
42
|
+
"@syncfusion/ej2-popups": "~19.3.47"
|
|
43
43
|
},
|
|
44
44
|
"deprecated": false,
|
|
45
45
|
"description": "Essential JS 2 TreeGrid Component",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
"url": "git+https://github.com/syncfusion/ej2-treegrid.git"
|
|
61
61
|
},
|
|
62
62
|
"typings": "index.d.ts",
|
|
63
|
-
"version": "19.3.
|
|
63
|
+
"version": "19.3.48",
|
|
64
64
|
"sideEffects": false
|
|
65
65
|
}
|
|
@@ -111,10 +111,11 @@ var BatchEdit = /** @class */ (function () {
|
|
|
111
111
|
if (frozenCols && args.columnObject.index > frozenCols) {
|
|
112
112
|
actualCellIndex = actualCellIndex + frozenCols;
|
|
113
113
|
}
|
|
114
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
114
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
115
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
115
116
|
if (freeze) {
|
|
116
117
|
var colCount = this.parent.getFrozenLeftColumnsCount() + actualCellIndex;
|
|
117
|
-
if (colCount
|
|
118
|
+
if (colCount === this.parent.treeColumnIndex) {
|
|
118
119
|
this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,
|
|
119
120
|
column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)
|
|
120
121
|
});
|
|
@@ -276,7 +277,7 @@ var BatchEdit = /** @class */ (function () {
|
|
|
276
277
|
focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];
|
|
277
278
|
}
|
|
278
279
|
};
|
|
279
|
-
BatchEdit.prototype.beforeBatchDelete = function () {
|
|
280
|
+
BatchEdit.prototype.beforeBatchDelete = function (args) {
|
|
280
281
|
if (!this.batchRecords.length) {
|
|
281
282
|
this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());
|
|
282
283
|
this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());
|
|
@@ -286,9 +287,19 @@ var BatchEdit = /** @class */ (function () {
|
|
|
286
287
|
var row = [];
|
|
287
288
|
var records = [];
|
|
288
289
|
var primarykey = this.parent.grid.getPrimaryKeyFieldNames()[0];
|
|
289
|
-
var data
|
|
290
|
-
var childs
|
|
291
|
-
var uid
|
|
290
|
+
var data;
|
|
291
|
+
var childs;
|
|
292
|
+
var uid;
|
|
293
|
+
if (!isNullOrUndefined(args.row) && this.parent.getSelectedRows().indexOf(args.row) === -1) {
|
|
294
|
+
data = args.rowData;
|
|
295
|
+
childs = findChildrenRecords(data);
|
|
296
|
+
uid = args.row.getAttribute('data-uid');
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
data = this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length - 1];
|
|
300
|
+
childs = findChildrenRecords(data);
|
|
301
|
+
uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');
|
|
302
|
+
}
|
|
292
303
|
var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10);
|
|
293
304
|
if (childs.length) {
|
|
294
305
|
var totalCount = parentRowIndex + childs.length;
|
|
@@ -328,7 +339,8 @@ var BatchEdit = /** @class */ (function () {
|
|
|
328
339
|
for (var i = 0; i < rows.length; i++) {
|
|
329
340
|
rows[i].setAttribute('aria-rowindex', i.toString());
|
|
330
341
|
}
|
|
331
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
342
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
343
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
332
344
|
if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {
|
|
333
345
|
var mRows = this.parent.grid.getMovableDataRows();
|
|
334
346
|
var freezeRightRows = this.parent.grid.getFrozenRightDataRows();
|
|
@@ -66,6 +66,7 @@ export function editAction(details, control, isSelfReference, addRowIndex, selec
|
|
|
66
66
|
var childRecords = parentData ? parentData[control.childMapping] : [];
|
|
67
67
|
for (var p = childRecords.length - 1; p >= 0; p--) {
|
|
68
68
|
if (childRecords[p][control.idMapping] === currentData_1[control.idMapping]) {
|
|
69
|
+
parentData['childRecords'].splice(p, 1);
|
|
69
70
|
childRecords.splice(p, 1);
|
|
70
71
|
if (!childRecords.length) {
|
|
71
72
|
parentData.hasChildRecords = false;
|
|
@@ -260,7 +260,7 @@ var Edit = /** @class */ (function () {
|
|
|
260
260
|
if (args.action === 'f2') {
|
|
261
261
|
this.recordDoubleClick(args);
|
|
262
262
|
}
|
|
263
|
-
if (args.action
|
|
263
|
+
if (args.action === 'escape') {
|
|
264
264
|
this.parent.closeEdit();
|
|
265
265
|
}
|
|
266
266
|
};
|
|
@@ -371,12 +371,13 @@ var Edit = /** @class */ (function () {
|
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
373
|
else {
|
|
374
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
374
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
375
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
375
376
|
if (freeze) {
|
|
376
|
-
if (this.parent.getRows().indexOf(row_1)
|
|
377
|
+
if (this.parent.getRows().indexOf(row_1) !== -1) {
|
|
377
378
|
rowIndex_1 = this.parent.getRows().indexOf(row_1);
|
|
378
379
|
}
|
|
379
|
-
else if (this.parent.getFrozenRightRows().indexOf(row_1)
|
|
380
|
+
else if (this.parent.getFrozenRightRows().indexOf(row_1) !== -1) {
|
|
380
381
|
rowIndex_1 = this.parent.getFrozenRightRows().indexOf(row_1);
|
|
381
382
|
}
|
|
382
383
|
else {
|
|
@@ -443,7 +444,8 @@ var Edit = /** @class */ (function () {
|
|
|
443
444
|
this.isOnBatch = false;
|
|
444
445
|
}
|
|
445
446
|
this.enableToolbarItems('save');
|
|
446
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
447
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
448
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
447
449
|
if (freeze) {
|
|
448
450
|
if (args.cell.closest('.e-frozen-left-header') || args.cell.closest('.e-frozen-left-content')) {
|
|
449
451
|
mRow = this.parent.grid.getRows()[rowIndex];
|
|
@@ -480,7 +482,7 @@ var Edit = /** @class */ (function () {
|
|
|
480
482
|
type: 'save', column: this.parent.getColumnByField(args.columnName), data: args.rowData,
|
|
481
483
|
previousData: args.previousValue, row: row, target: args.cell
|
|
482
484
|
};
|
|
483
|
-
if (this.parent.aggregates.map(function (ag) { return ag.showChildSummary
|
|
485
|
+
if (this.parent.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
|
|
484
486
|
this.parent.grid.refresh();
|
|
485
487
|
}
|
|
486
488
|
this.parent.trigger(events.actionComplete, saveArgs);
|
|
@@ -522,6 +524,10 @@ var Edit = /** @class */ (function () {
|
|
|
522
524
|
}
|
|
523
525
|
}
|
|
524
526
|
setValue('uniqueIDCollection.' + data[i].uniqueID + '.index', i, this.parent);
|
|
527
|
+
var adaptor = this.parent.dataSource.adaptor;
|
|
528
|
+
if ((isRemoteData(this.parent) || adaptor instanceof RemoteSaveAdaptor)) {
|
|
529
|
+
setValue('uniqueIDCollection.' + data[i].uniqueID, data[i], this.parent);
|
|
530
|
+
}
|
|
525
531
|
if (!data[i].level) {
|
|
526
532
|
this.parent.parentData.push(data[i]);
|
|
527
533
|
}
|
|
@@ -641,7 +647,8 @@ var Edit = /** @class */ (function () {
|
|
|
641
647
|
this.parent.grid.contentModule[r].splice(0, 1);
|
|
642
648
|
this.parent.grid.contentModule[r].splice(rowObjectIndex, 0, newRowObject);
|
|
643
649
|
}
|
|
644
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
650
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
651
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
645
652
|
if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {
|
|
646
653
|
var movableRows = this.parent.getMovableDataRows();
|
|
647
654
|
var frows = 'freezeRows';
|
|
@@ -35,7 +35,8 @@ var Freeze = /** @class */ (function () {
|
|
|
35
35
|
var frozenrows = this.parent.getRows();
|
|
36
36
|
var rows;
|
|
37
37
|
var frozenRightRows;
|
|
38
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
38
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
39
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
39
40
|
if (freeze) {
|
|
40
41
|
frozenRightRows = this.parent.getFrozenRightRows().filter(function (e) {
|
|
41
42
|
return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));
|
|
@@ -351,7 +351,8 @@ var RowDD = /** @class */ (function () {
|
|
|
351
351
|
var bottomRowSegment = middleRowSegment + divide;
|
|
352
352
|
var mouseEvent = getObject('originalEvent.event', args);
|
|
353
353
|
var touchEvent = getObject('originalEvent.event', args);
|
|
354
|
-
var posy = (mouseEvent.type
|
|
354
|
+
var posy = (mouseEvent.type === 'mousemove') ? mouseEvent.pageY : ((!isNullOrUndefined(touchEvent) &&
|
|
355
|
+
!isNullOrUndefined(touchEvent.changedTouches)) ? touchEvent.changedTouches[0].pageY : null);
|
|
355
356
|
var isTopSegment = posy <= topRowSegment;
|
|
356
357
|
var isMiddleRowSegment = (posy > topRowSegment && posy <= middleRowSegment);
|
|
357
358
|
var isBottomRowSegment = (posy > middleRowSegment && posy <= bottomRowSegment);
|
|
@@ -578,7 +579,7 @@ var RowDD = /** @class */ (function () {
|
|
|
578
579
|
}
|
|
579
580
|
else {
|
|
580
581
|
if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID) || parentsUntil(args.target, 'e-treegrid') &&
|
|
581
|
-
parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID) {
|
|
582
|
+
parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID || args.target && document.getElementById(tObj.rowDropSettings.targetID)) {
|
|
582
583
|
setValue('dropPosition', this.dropPosition, args);
|
|
583
584
|
tObj.trigger(events.rowDrop, args);
|
|
584
585
|
if (!args.cancel && tObj.rowDropSettings.targetID) {
|
|
@@ -719,7 +720,7 @@ var RowDD = /** @class */ (function () {
|
|
|
719
720
|
RowDD.prototype.dropRows = function (args, isByMethod) {
|
|
720
721
|
if (this.dropPosition !== 'Invalid' && !isRemoteData(this.parent)) {
|
|
721
722
|
var tObj = this.parent;
|
|
722
|
-
var
|
|
723
|
+
var draggedRecord_2;
|
|
723
724
|
var droppedRecord = void 0;
|
|
724
725
|
if (isNullOrUndefined(args.dropIndex)) {
|
|
725
726
|
var rowIndex = tObj.getSelectedRowIndexes()[0] - 1;
|
|
@@ -751,76 +752,93 @@ var RowDD = /** @class */ (function () {
|
|
|
751
752
|
if (!isNullOrUndefined(this.parent.idMapping)) {
|
|
752
753
|
dragRecords.reverse();
|
|
753
754
|
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
if (
|
|
755
|
+
var _loop_2 = function (i) {
|
|
756
|
+
draggedRecord_2 = dragRecords[i];
|
|
757
|
+
this_1.draggedRecord = draggedRecord_2;
|
|
758
|
+
if (this_1.dropPosition !== 'Invalid') {
|
|
758
759
|
if (!tObj.rowDropSettings.targetID || isByMethod) {
|
|
759
|
-
|
|
760
|
+
this_1.deleteDragRow();
|
|
760
761
|
}
|
|
761
|
-
if (
|
|
762
|
-
var correctIndex =
|
|
762
|
+
if (this_1.draggedRecord === this_1.droppedRecord) {
|
|
763
|
+
var correctIndex = this_1.getTargetIdx(args.target.offsetParent.parentElement);
|
|
763
764
|
if (isNaN(correctIndex)) {
|
|
764
|
-
correctIndex =
|
|
765
|
+
correctIndex = this_1.getTargetIdx(args.target.parentElement);
|
|
765
766
|
}
|
|
766
767
|
args.dropIndex = correctIndex;
|
|
767
|
-
droppedRecord =
|
|
768
|
+
droppedRecord = this_1.droppedRecord = this_1.parent.getCurrentViewRecords()[args.dropIndex];
|
|
769
|
+
}
|
|
770
|
+
if (droppedRecord.parentItem || this_1.dropPosition === 'middleSegment') {
|
|
771
|
+
var parentRecords = tObj.parentData;
|
|
772
|
+
var newParentIndex = parentRecords.indexOf(this_1.draggedRecord);
|
|
773
|
+
if (newParentIndex !== -1) {
|
|
774
|
+
parentRecords.splice(newParentIndex, 1);
|
|
775
|
+
}
|
|
768
776
|
}
|
|
769
|
-
var recordIndex1 =
|
|
770
|
-
|
|
771
|
-
if (
|
|
777
|
+
var recordIndex1 = this_1.treeGridData.indexOf(droppedRecord);
|
|
778
|
+
this_1.dropAtTop(recordIndex1);
|
|
779
|
+
if (this_1.dropPosition === 'bottomSegment') {
|
|
772
780
|
if (!droppedRecord.hasChildRecords) {
|
|
773
|
-
if (
|
|
774
|
-
|
|
781
|
+
if (this_1.parent.parentIdMapping) {
|
|
782
|
+
this_1.treeData.splice(recordIndex1 + 1, 0, this_1.draggedRecord.taskData);
|
|
775
783
|
}
|
|
776
|
-
|
|
784
|
+
this_1.treeGridData.splice(recordIndex1 + 1, 0, this_1.draggedRecord);
|
|
777
785
|
}
|
|
778
786
|
else {
|
|
779
|
-
count =
|
|
780
|
-
if (
|
|
781
|
-
|
|
787
|
+
count = this_1.getChildCount(droppedRecord, 0);
|
|
788
|
+
if (this_1.parent.parentIdMapping) {
|
|
789
|
+
this_1.treeData.splice(recordIndex1 + count + 1, 0, this_1.draggedRecord.taskData);
|
|
782
790
|
}
|
|
783
|
-
|
|
791
|
+
this_1.treeGridData.splice(recordIndex1 + count + 1, 0, this_1.draggedRecord);
|
|
784
792
|
}
|
|
785
793
|
if (isNullOrUndefined(droppedRecord.parentItem)) {
|
|
786
|
-
delete
|
|
787
|
-
|
|
788
|
-
if (
|
|
789
|
-
|
|
794
|
+
delete draggedRecord_2.parentItem;
|
|
795
|
+
draggedRecord_2.level = 0;
|
|
796
|
+
if (this_1.parent.parentIdMapping) {
|
|
797
|
+
draggedRecord_2[this_1.parent.parentIdMapping] = null;
|
|
790
798
|
}
|
|
791
799
|
}
|
|
792
800
|
if (droppedRecord.parentItem) {
|
|
793
|
-
var rec =
|
|
801
|
+
var rec = this_1.getChildrecordsByParentID(droppedRecord.parentUniqueID);
|
|
794
802
|
var childRecords = rec[0].childRecords;
|
|
795
803
|
var droppedRecordIndex = childRecords.indexOf(droppedRecord) + 1;
|
|
796
|
-
childRecords.splice(droppedRecordIndex, 0,
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
if (
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
804
|
+
childRecords.splice(droppedRecordIndex, 0, draggedRecord_2);
|
|
805
|
+
draggedRecord_2.parentItem = droppedRecord.parentItem;
|
|
806
|
+
draggedRecord_2.parentUniqueID = droppedRecord.parentUniqueID;
|
|
807
|
+
if (this_1.parent.parentIdMapping) {
|
|
808
|
+
draggedRecord_2[this_1.parent.parentIdMapping] = droppedRecord[this_1.parent.parentIdMapping];
|
|
809
|
+
draggedRecord_2.parentItem = droppedRecord.parentItem;
|
|
810
|
+
draggedRecord_2.level = droppedRecord.level;
|
|
803
811
|
}
|
|
804
812
|
}
|
|
805
|
-
if (
|
|
813
|
+
if (draggedRecord_2.hasChildRecords) {
|
|
806
814
|
var level = 1;
|
|
807
|
-
|
|
808
|
-
|
|
815
|
+
this_1.updateChildRecordLevel(draggedRecord_2, level);
|
|
816
|
+
this_1.updateChildRecord(draggedRecord_2, recordIndex1 + count + 1);
|
|
809
817
|
}
|
|
810
818
|
}
|
|
811
|
-
|
|
819
|
+
this_1.dropMiddle(recordIndex1);
|
|
812
820
|
}
|
|
813
|
-
if (isNullOrUndefined(
|
|
821
|
+
if (isNullOrUndefined(draggedRecord_2.parentItem)) {
|
|
814
822
|
var parentRecords = tObj.parentData;
|
|
815
|
-
var newParentIndex = parentRecords.indexOf(
|
|
816
|
-
|
|
817
|
-
|
|
823
|
+
var newParentIndex = parentRecords.indexOf(this_1.droppedRecord);
|
|
824
|
+
var nonRepeat_1 = 0;
|
|
825
|
+
parentRecords.filter(function (e) {
|
|
826
|
+
if (draggedRecord_2.uniqueID === e.uniqueID) {
|
|
827
|
+
nonRepeat_1++;
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
if (this_1.dropPosition === 'bottomSegment' && nonRepeat_1 === 0) {
|
|
831
|
+
parentRecords.splice(newParentIndex + 1, 0, draggedRecord_2);
|
|
818
832
|
}
|
|
819
|
-
else if (
|
|
820
|
-
parentRecords.splice(newParentIndex, 0,
|
|
833
|
+
else if (this_1.dropPosition === 'topSegment' && nonRepeat_1 === 0) {
|
|
834
|
+
parentRecords.splice(newParentIndex, 0, draggedRecord_2);
|
|
821
835
|
}
|
|
822
836
|
}
|
|
823
837
|
tObj.rowDragAndDropModule.refreshGridDataSource();
|
|
838
|
+
};
|
|
839
|
+
var this_1 = this;
|
|
840
|
+
for (var i = 0; i < dragLength; i++) {
|
|
841
|
+
_loop_2(i);
|
|
824
842
|
}
|
|
825
843
|
}
|
|
826
844
|
};
|
|
@@ -888,6 +906,11 @@ var RowDD = /** @class */ (function () {
|
|
|
888
906
|
draggedRecord.parentItem = parentItem;
|
|
889
907
|
draggedRecord.parentUniqueID = droppedRecord.uniqueID;
|
|
890
908
|
droppedRecord.childRecords.splice(droppedRecord.childRecords.length, 0, draggedRecord);
|
|
909
|
+
var isSelfReference = 'isSelfReference';
|
|
910
|
+
if (tObj[isSelfReference]) {
|
|
911
|
+
droppedRecord[tObj.childMapping] = [];
|
|
912
|
+
droppedRecord[tObj.childMapping].splice(droppedRecord[tObj.childMapping].length, 0, draggedRecord);
|
|
913
|
+
}
|
|
891
914
|
if (!isNullOrUndefined(draggedRecord) && !tObj.parentIdMapping && !isNullOrUndefined(droppedRecord.taskData[childItem])) {
|
|
892
915
|
droppedRecord.taskData[tObj.childMapping].splice(droppedRecord.childRecords.length, 0, draggedRecord.taskData);
|
|
893
916
|
}
|
|
@@ -926,7 +949,7 @@ var RowDD = /** @class */ (function () {
|
|
|
926
949
|
}
|
|
927
950
|
length = record.childRecords.length;
|
|
928
951
|
for (var i = 0; i < length; i++) {
|
|
929
|
-
currentRecord = record.childRecords[i];
|
|
952
|
+
currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, tObj);
|
|
930
953
|
count++;
|
|
931
954
|
tObj.flatData.splice(count, 0, currentRecord);
|
|
932
955
|
setValue('uniqueIDCollection.' + currentRecord.uniqueID, currentRecord, this.parent);
|
|
@@ -948,7 +971,7 @@ var RowDD = /** @class */ (function () {
|
|
|
948
971
|
}
|
|
949
972
|
length = record.childRecords.length;
|
|
950
973
|
for (var i = 0; i < length; i++) {
|
|
951
|
-
currentRecord = record.childRecords[i];
|
|
974
|
+
currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, this.parent);
|
|
952
975
|
var parentData = void 0;
|
|
953
976
|
if (record.parentItem) {
|
|
954
977
|
parentData = getParentData(this.parent, record.parentItem.uniqueID);
|
|
@@ -2,7 +2,7 @@ import { isNullOrUndefined, removeClass } from '@syncfusion/ej2-base';
|
|
|
2
2
|
import { createCheckBox } from '@syncfusion/ej2-buttons';
|
|
3
3
|
import { parentsUntil, getObject } from '@syncfusion/ej2-grids';
|
|
4
4
|
import * as events from '../base/constant';
|
|
5
|
-
import { getParentData, isRemoteData, isCheckboxcolumn } from '../utils';
|
|
5
|
+
import { getParentData, isRemoteData, isCheckboxcolumn, findChildrenRecords } from '../utils';
|
|
6
6
|
/**
|
|
7
7
|
* TreeGrid Selection module
|
|
8
8
|
*
|
|
@@ -261,11 +261,11 @@ var Selection = /** @class */ (function () {
|
|
|
261
261
|
var length = 0;
|
|
262
262
|
if (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) {
|
|
263
263
|
var filterResult = this.parent.filterModule.filteredResult;
|
|
264
|
-
if (this.filteredList.length
|
|
264
|
+
if (this.filteredList.length === 0) {
|
|
265
265
|
this.filteredList = filterResult;
|
|
266
266
|
}
|
|
267
267
|
else {
|
|
268
|
-
if (this.filteredList
|
|
268
|
+
if (this.filteredList !== filterResult) {
|
|
269
269
|
this.filteredList = filterResult;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
@@ -357,6 +357,9 @@ var Selection = /** @class */ (function () {
|
|
|
357
357
|
(!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0))) {
|
|
358
358
|
this.selectedItems.push(checkedRecord);
|
|
359
359
|
}
|
|
360
|
+
if (this.selectedItems.indexOf(checkedRecord) === -1 && this.parent.enableVirtualization && ((!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0))) {
|
|
361
|
+
this.selectedItems.push(checkedRecord);
|
|
362
|
+
}
|
|
360
363
|
if (this.selectedItems.indexOf(checkedRecord) === -1 && (!isNullOrUndefined(this.parent.filterModule) &&
|
|
361
364
|
this.parent.filterModule.filteredResult.length === 0)) {
|
|
362
365
|
this.selectedItems.push(checkedRecord);
|
|
@@ -430,11 +433,31 @@ var Selection = /** @class */ (function () {
|
|
|
430
433
|
childData = (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) ?
|
|
431
434
|
this.parent.getCurrentViewRecords() : this.parent.flatData;
|
|
432
435
|
childData.forEach(function (record) {
|
|
433
|
-
if (
|
|
434
|
-
|
|
436
|
+
if (_this.parent.enableVirtualization) {
|
|
437
|
+
if (record.hasChildRecords) {
|
|
438
|
+
_this.updateParentSelection(record);
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
_this.updateSelectedItems(record, record.checkboxState);
|
|
442
|
+
}
|
|
443
|
+
var child = findChildrenRecords(record);
|
|
444
|
+
child = _this.getFilteredChildRecords(child);
|
|
445
|
+
for (var i = 0; i < child.length; i++) {
|
|
446
|
+
if (child[i].hasChildRecords) {
|
|
447
|
+
_this.updateParentSelection(child[i]);
|
|
448
|
+
}
|
|
449
|
+
else if (!(child[i].hasChildRecords) && !isNullOrUndefined(child[i])) {
|
|
450
|
+
_this.updateSelectedItems(child[i], child[i].checkboxState);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
435
453
|
}
|
|
436
454
|
else {
|
|
437
|
-
|
|
455
|
+
if (record.hasChildRecords) {
|
|
456
|
+
_this.updateParentSelection(record);
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
_this.updateSelectedItems(record, record.checkboxState);
|
|
460
|
+
}
|
|
438
461
|
}
|
|
439
462
|
});
|
|
440
463
|
this.headerSelection();
|
|
@@ -18,6 +18,7 @@ import * as events from '../base/constant';
|
|
|
18
18
|
import { DataManager, Predicate, Query } from '@syncfusion/ej2-data';
|
|
19
19
|
import { getExpandStatus } from '../utils';
|
|
20
20
|
import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';
|
|
21
|
+
import { VirtualHeaderRenderer } from '@syncfusion/ej2-grids';
|
|
21
22
|
/**
|
|
22
23
|
* TreeGrid Virtual Scroll module will handle Virtualization
|
|
23
24
|
*
|
|
@@ -53,8 +54,12 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
53
54
|
* @returns {void}
|
|
54
55
|
*/
|
|
55
56
|
VirtualScroll.prototype.addEventListener = function () {
|
|
57
|
+
if (this.parent.isDestroyed) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
56
60
|
this.parent.on(events.localPagedExpandCollapse, this.collapseExpandVirtualchilds, this);
|
|
57
61
|
this.parent.on(events.pagingActions, this.virtualPageAction, this);
|
|
62
|
+
this.parent.on(events.destroy, this.destroy, this);
|
|
58
63
|
};
|
|
59
64
|
/**
|
|
60
65
|
* @hidden
|
|
@@ -66,6 +71,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
66
71
|
}
|
|
67
72
|
this.parent.off(events.localPagedExpandCollapse, this.collapseExpandVirtualchilds);
|
|
68
73
|
this.parent.off(events.pagingActions, this.virtualPageAction);
|
|
74
|
+
this.parent.off(events.destroy, this.destroy);
|
|
69
75
|
};
|
|
70
76
|
VirtualScroll.prototype.collapseExpandVirtualchilds = function (row) {
|
|
71
77
|
this.parent.grid.notify(events.virtualActionArgs, { isExpandCollapse: true });
|
|
@@ -121,7 +127,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
121
127
|
var resourceCount = this.parent.getRows();
|
|
122
128
|
var sIndex = visualData.indexOf(this.expandCollapseRec);
|
|
123
129
|
var tempdata = visualData.slice(sIndex, sIndex + resourceCount.length);
|
|
124
|
-
if (tempdata.length < resourceCount.length && sIndex >= 0) {
|
|
130
|
+
if (tempdata.length < resourceCount.length && sIndex >= 0 && startIndex !== 0) {
|
|
125
131
|
sIndex = visualData.length - resourceCount.length;
|
|
126
132
|
sIndex = sIndex > 0 ? sIndex : 0;
|
|
127
133
|
startIndex = sIndex;
|
|
@@ -132,17 +138,17 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
132
138
|
endIndex = this.parent.grid.pageSettings.pageSize - 1;
|
|
133
139
|
this.parent.grid.notify(events.virtualActionArgs, { setTop: true });
|
|
134
140
|
}
|
|
135
|
-
this.expandCollapseRec = null;
|
|
136
141
|
}
|
|
137
142
|
//}
|
|
138
|
-
if (
|
|
143
|
+
if ((this.parent.enableCollapseAll || this.parent.expandStateMapping) && !isNullOrUndefined(this.expandCollapseRec)) {
|
|
139
144
|
if (pageingDetails.count < this.parent.getRows()[0].getBoundingClientRect().height) {
|
|
140
|
-
startIndex =
|
|
145
|
+
startIndex = 0;
|
|
141
146
|
}
|
|
142
147
|
else {
|
|
143
148
|
startIndex = this.prevstartIndex === -1 ? 0 : this.prevstartIndex;
|
|
144
149
|
}
|
|
145
150
|
}
|
|
151
|
+
this.expandCollapseRec = null;
|
|
146
152
|
pageingDetails.result = visualData.slice(startIndex, endIndex);
|
|
147
153
|
this.prevstartIndex = startIndex;
|
|
148
154
|
this.prevendIndex = endIndex;
|
|
@@ -173,8 +179,13 @@ var TreeVirtual = /** @class */ (function (_super) {
|
|
|
173
179
|
return 'treeVirtualScroll';
|
|
174
180
|
};
|
|
175
181
|
TreeVirtual.prototype.instantiateRenderers = function () {
|
|
182
|
+
var parentGrid = getValue('parent', this);
|
|
176
183
|
getValue('parent', this).log(['limitation', 'virtual_height'], 'virtualization');
|
|
177
184
|
var renderer = getValue('locator', this).getService('rendererFactory');
|
|
185
|
+
if (parentGrid.enableColumnVirtualization) {
|
|
186
|
+
getValue('addRenderer', renderer)
|
|
187
|
+
.apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
|
|
188
|
+
}
|
|
178
189
|
getValue('addRenderer', renderer)
|
|
179
190
|
.apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
|
|
180
191
|
//renderer.addRenderer(RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this)));
|
|
@@ -97,6 +97,8 @@ export declare const virtualColumnIndex: string;
|
|
|
97
97
|
/** @hidden */
|
|
98
98
|
export declare const virtualActionArgs: string;
|
|
99
99
|
/** @hidden */
|
|
100
|
+
export declare const destroy: string;
|
|
101
|
+
/** @hidden */
|
|
100
102
|
export declare const dataListener: string;
|
|
101
103
|
/** @hidden */
|
|
102
104
|
export declare const indexModifier: string;
|
|
@@ -124,3 +126,5 @@ export declare const rowsRemove: string;
|
|
|
124
126
|
export declare const rowdraging: string;
|
|
125
127
|
/** @hidden */
|
|
126
128
|
export declare const rowDropped: string;
|
|
129
|
+
/** @hidden */
|
|
130
|
+
export declare const autoCol: string;
|
|
@@ -97,6 +97,8 @@ export var virtualColumnIndex = 'virtualColumnIndex';
|
|
|
97
97
|
/** @hidden */
|
|
98
98
|
export var virtualActionArgs = 'virtual-action-args';
|
|
99
99
|
/** @hidden */
|
|
100
|
+
export var destroy = 'destroy';
|
|
101
|
+
/** @hidden */
|
|
100
102
|
export var dataListener = 'data-listener';
|
|
101
103
|
/** @hidden */
|
|
102
104
|
export var indexModifier = 'index-modifier';
|
|
@@ -124,3 +126,5 @@ export var rowsRemove = 'rows-remove';
|
|
|
124
126
|
export var rowdraging = 'row-draging';
|
|
125
127
|
/** @hidden */
|
|
126
128
|
export var rowDropped = 'row-dropped';
|
|
129
|
+
/** @hidden */
|
|
130
|
+
export var autoCol = 'auto-col';
|
|
@@ -462,6 +462,14 @@ export interface TreeGridModel extends ComponentModel{
|
|
|
462
462
|
*/
|
|
463
463
|
enableVirtualization?: boolean;
|
|
464
464
|
|
|
465
|
+
/**
|
|
466
|
+
* If `enableColumnVirtualization` set to true, then the Tree Grid will render only the columns visible within the view-port
|
|
467
|
+
* and load subsequent columns on horizontal scrolling. This helps to load large dataset of columns in Tree Grid.
|
|
468
|
+
*
|
|
469
|
+
* @default false
|
|
470
|
+
*/
|
|
471
|
+
enableColumnVirtualization?: boolean;
|
|
472
|
+
|
|
465
473
|
/**
|
|
466
474
|
* If `enableInfiniteScrolling` set to true, then the data will be loaded in TreeGrid when the scrollbar reaches the end.
|
|
467
475
|
* This helps to load large dataset in TreeGrid.
|
|
@@ -566,6 +566,13 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
566
566
|
* @default false
|
|
567
567
|
*/
|
|
568
568
|
enableVirtualization: boolean;
|
|
569
|
+
/**
|
|
570
|
+
* If `enableColumnVirtualization` set to true, then the Tree Grid will render only the columns visible within the view-port
|
|
571
|
+
* and load subsequent columns on horizontal scrolling. This helps to load large dataset of columns in Tree Grid.
|
|
572
|
+
*
|
|
573
|
+
* @default false
|
|
574
|
+
*/
|
|
575
|
+
enableColumnVirtualization: boolean;
|
|
569
576
|
/**
|
|
570
577
|
* If `enableInfiniteScrolling` set to true, then the data will be loaded in TreeGrid when the scrollbar reaches the end.
|
|
571
578
|
* This helps to load large dataset in TreeGrid.
|
|
@@ -1491,6 +1498,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1491
1498
|
* @returns {number} - Returns column index
|
|
1492
1499
|
*/
|
|
1493
1500
|
getColumnIndexByField(field: string): number;
|
|
1501
|
+
private getVirtualColIndexByUid;
|
|
1494
1502
|
/**
|
|
1495
1503
|
* Gets a column index by UID.
|
|
1496
1504
|
*
|