@syncfusion/ej2-treegrid 20.1.47 → 20.1.52
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 +40 -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 +4844 -4615
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +3453 -3227
- 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 +7 -7
- package/src/treegrid/actions/batch-edit.js +21 -4
- package/src/treegrid/actions/crud-actions.js +6 -1
- package/src/treegrid/actions/edit.js +16 -1
- package/src/treegrid/actions/filter.js +3 -0
- package/src/treegrid/actions/rowdragdrop.d.ts +13 -0
- package/src/treegrid/actions/rowdragdrop.js +131 -16
- package/src/treegrid/actions/selection.js +4 -2
- package/src/treegrid/actions/toolbar.d.ts +0 -1
- package/src/treegrid/actions/toolbar.js +50 -79
- package/src/treegrid/actions/virtual-scroll.js +1 -1
- package/src/treegrid/base/treegrid-model.d.ts +1 -1
- package/src/treegrid/base/treegrid.d.ts +22 -6
- package/src/treegrid/base/treegrid.js +101 -49
- package/src/treegrid/models/column.d.ts +9 -0
- package/src/treegrid/models/column.js +19 -0
- package/src/treegrid/models/rowdrop-settings.d.ts +9 -1
- package/src/treegrid/renderer/render.d.ts +6 -0
- package/src/treegrid/renderer/render.js +27 -1
- package/src/treegrid/renderer/virtual-tree-content-render.js +1 -1
- package/styles/bootstrap-dark.css +0 -8
- package/styles/bootstrap.css +0 -8
- package/styles/bootstrap4.css +0 -8
- package/styles/bootstrap5-dark.css +0 -8
- package/styles/bootstrap5.css +0 -8
- package/styles/fabric-dark.css +0 -8
- package/styles/fabric.css +0 -8
- package/styles/fluent-dark.css +1 -5
- package/styles/fluent.css +1 -5
- package/styles/highcontrast-light.css +0 -8
- package/styles/highcontrast.css +0 -8
- package/styles/material-dark.css +0 -8
- package/styles/material.css +0 -8
- package/styles/tailwind-dark.css +0 -8
- package/styles/tailwind.css +0 -8
- package/styles/treegrid/_bootstrap-dark-definition.scss +0 -2
- package/styles/treegrid/_bootstrap-definition.scss +0 -2
- package/styles/treegrid/_bootstrap4-definition.scss +0 -2
- package/styles/treegrid/_bootstrap5-definition.scss +0 -2
- package/styles/treegrid/_fabric-dark-definition.scss +0 -2
- package/styles/treegrid/_fabric-definition.scss +0 -2
- package/styles/treegrid/_fluent-definition.scss +0 -1
- package/styles/treegrid/_highcontrast-definition.scss +0 -2
- package/styles/treegrid/_highcontrast-light-definition.scss +0 -2
- package/styles/treegrid/_layout.scss +4 -6
- package/styles/treegrid/_material-dark-definition.scss +0 -2
- package/styles/treegrid/_material-definition.scss +0 -2
- package/styles/treegrid/_tailwind-definition.scss +0 -2
- package/styles/treegrid/bootstrap-dark.css +0 -8
- package/styles/treegrid/bootstrap.css +0 -8
- package/styles/treegrid/bootstrap4.css +0 -8
- package/styles/treegrid/bootstrap5-dark.css +0 -8
- package/styles/treegrid/bootstrap5.css +0 -8
- package/styles/treegrid/fabric-dark.css +0 -8
- package/styles/treegrid/fabric.css +0 -8
- package/styles/treegrid/fluent-dark.css +1 -5
- package/styles/treegrid/fluent.css +1 -5
- package/styles/treegrid/highcontrast-light.css +0 -8
- package/styles/treegrid/highcontrast.css +0 -8
- package/styles/treegrid/material-dark.css +0 -8
- package/styles/treegrid/material.css +0 -8
- package/styles/treegrid/tailwind-dark.css +0 -8
- package/styles/treegrid/tailwind.css +0 -8
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.1.
|
|
3
|
+
* version : 20.1.52
|
|
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@
|
|
3
|
+
"_id": "@syncfusion/ej2-treegrid@20.1.51",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-9awiYCeU9G5d700L+2nhTh0/F/31+EWJZawEtrU7qxpGyoFxb3EICIFVb51oO9+BQphSS3Xnp204Vk9xQV511g==",
|
|
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-
|
|
28
|
-
"_shasum": "
|
|
27
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.1.51.tgz",
|
|
28
|
+
"_shasum": "24c27866fd177d1a5bf5b2c11bd29aa74c005f69",
|
|
29
29
|
"_spec": "@syncfusion/ej2-treegrid@*",
|
|
30
30
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
31
31
|
"author": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
},
|
|
37
37
|
"bundleDependencies": false,
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@syncfusion/ej2-base": "~20.1.
|
|
39
|
+
"@syncfusion/ej2-base": "~20.1.50",
|
|
40
40
|
"@syncfusion/ej2-data": "~20.1.47",
|
|
41
|
-
"@syncfusion/ej2-grids": "~20.1.
|
|
41
|
+
"@syncfusion/ej2-grids": "~20.1.52",
|
|
42
42
|
"@syncfusion/ej2-popups": "~20.1.47"
|
|
43
43
|
},
|
|
44
44
|
"deprecated": false,
|
|
@@ -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": "20.1.
|
|
63
|
+
"version": "20.1.52",
|
|
64
64
|
"sideEffects": false
|
|
65
65
|
}
|
|
@@ -4,6 +4,7 @@ import { DataManager } from '@syncfusion/ej2-data';
|
|
|
4
4
|
import { findChildrenRecords, getParentData, extendArray } from '../utils';
|
|
5
5
|
import { getUid } from '@syncfusion/ej2-grids';
|
|
6
6
|
import { updateParentRow, editAction } from './crud-actions';
|
|
7
|
+
import { classList } from '@syncfusion/ej2-base';
|
|
7
8
|
/**
|
|
8
9
|
* `BatchEdit` module is used to handle batch editing actions.
|
|
9
10
|
*
|
|
@@ -236,9 +237,17 @@ var BatchEdit = /** @class */ (function () {
|
|
|
236
237
|
this.parent.editModule[isTabLastRow] = false;
|
|
237
238
|
return;
|
|
238
239
|
}
|
|
239
|
-
this.
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && this.parent.grid.selectedRowIndex === -1) {
|
|
241
|
+
this.selectedIndex = this.parent.editModule['selectedIndex'];
|
|
242
|
+
this.addRowIndex = this.parent.editModule['addRowIndex'];
|
|
243
|
+
this.addRowRecord = this.parent.getCurrentViewRecords()[this.selectedIndex];
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
this.selectedIndex = this.parent.grid.selectedRowIndex;
|
|
247
|
+
this.addRowIndex = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;
|
|
248
|
+
this.parent.editModule['addRowIndex'] = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;
|
|
249
|
+
this.addRowRecord = this.parent.getSelectedRecords()[0];
|
|
250
|
+
}
|
|
242
251
|
};
|
|
243
252
|
BatchEdit.prototype.batchAdd = function (e) {
|
|
244
253
|
if (this.parent.editSettings.newRowPosition !== 'Bottom') {
|
|
@@ -250,6 +259,9 @@ var BatchEdit = /** @class */ (function () {
|
|
|
250
259
|
this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());
|
|
251
260
|
this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());
|
|
252
261
|
}
|
|
262
|
+
if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex'])) {
|
|
263
|
+
classList(this.parent.grid.getDataRows()[0], ['e-batchrow'], []);
|
|
264
|
+
}
|
|
253
265
|
if (this.parent.editSettings.newRowPosition !== 'Top') {
|
|
254
266
|
var records = this.parent.grid.getCurrentViewRecords();
|
|
255
267
|
if (this.parent.editSettings.mode === 'Batch' && (this.parent.getBatchChanges()[this.addedRecords].length > 1
|
|
@@ -473,6 +485,10 @@ var BatchEdit = /** @class */ (function () {
|
|
|
473
485
|
}
|
|
474
486
|
if (this.parent.editSettings.newRowPosition !== 'Bottom' && !Object.hasOwnProperty.call(args, 'updatedRecords')) {
|
|
475
487
|
data.splice(data.length - addRecords.length, addRecords.length);
|
|
488
|
+
if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex'])) {
|
|
489
|
+
var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[0].getAttribute('aria-rowindex'), 10);
|
|
490
|
+
data.splice(index_1, 0, addRecords[0]);
|
|
491
|
+
}
|
|
476
492
|
if (!this.parent.allowPaging && data.length !== currentViewRecords.length) {
|
|
477
493
|
if (currentViewRecords.length > addRecords.length) {
|
|
478
494
|
currentViewRecords.splice(currentViewRecords.length - addRecords.length, addRecords.length);
|
|
@@ -524,7 +540,8 @@ var BatchEdit = /** @class */ (function () {
|
|
|
524
540
|
}
|
|
525
541
|
editAction({ value: addRecords[i], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
|
|
526
542
|
selectedIndex = null;
|
|
527
|
-
if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[i][parentItem])
|
|
543
|
+
if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[i][parentItem]) &&
|
|
544
|
+
(isNullOrUndefined(this.parent.editModule['addRowIndex']) || this.isSelfReference)) {
|
|
528
545
|
var indexValue = currentViewRecords.map(function (e) { return e[primarykey_1]; })
|
|
529
546
|
.indexOf(addRecords[i][parentItem][primarykey_1]);
|
|
530
547
|
var children = currentViewRecords[indexValue][childRecords];
|
|
@@ -366,7 +366,12 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
|
|
|
366
366
|
control.grid.setRowData(key, record);
|
|
367
367
|
var row = control.getRowByIndex(index_1);
|
|
368
368
|
if (control.editSettings.mode === 'Batch') {
|
|
369
|
-
|
|
369
|
+
if (action === 'add') {
|
|
370
|
+
row = control.getRows()[control.grid.getCurrentViewRecords().indexOf(record)];
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
row = control.getRows()[control.grid.getRowIndexByPrimaryKey(record[key])];
|
|
374
|
+
}
|
|
370
375
|
}
|
|
371
376
|
var movableRow = void 0;
|
|
372
377
|
if (control.frozenRows || control.getFrozenColumns()) {
|
|
@@ -677,6 +677,21 @@ var Edit = /** @class */ (function () {
|
|
|
677
677
|
focussedElement.focus();
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
|
+
if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1) {
|
|
681
|
+
index = this.batchEditModule.getAddRowIndex();
|
|
682
|
+
this.selectedIndex = this.batchEditModule.getSelectedIndex();
|
|
683
|
+
if (this.parent.editModule['isAddedRowByMethod']) {
|
|
684
|
+
var args = {
|
|
685
|
+
action: 'add',
|
|
686
|
+
data: this.parent.getBatchChanges()['addedRecords'][0],
|
|
687
|
+
index: index,
|
|
688
|
+
seletedRow: 0
|
|
689
|
+
};
|
|
690
|
+
this.parent.editModule.beginAddEdit(args);
|
|
691
|
+
this.parent.editModule.batchEditModule['batchAddRowRecord'].push(this.parent.editModule.batchEditModule['addRowRecord']);
|
|
692
|
+
this.parent.editModule.batchEditModule['batchAddedRecords'].push(args['data']);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
680
695
|
};
|
|
681
696
|
// private beforeDataBound(args: BeforeDataBoundArgs): void {
|
|
682
697
|
// if (this.parent.grid.isEdit && this.parent.dataSource instanceof DataManager &&
|
|
@@ -821,7 +836,7 @@ var Edit = /** @class */ (function () {
|
|
|
821
836
|
var parentIdMapping = void 0;
|
|
822
837
|
var isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';
|
|
823
838
|
var rows = this.parent.getRows();
|
|
824
|
-
var firstAriaIndex = rows.length ?
|
|
839
|
+
var firstAriaIndex = rows.length ? currentData.indexOf(currentData[0]) : 0;
|
|
825
840
|
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;
|
|
826
841
|
var withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
|
|
827
842
|
if (currentData.length) {
|
|
@@ -155,6 +155,9 @@ var Filter = /** @class */ (function () {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
else {
|
|
158
|
+
if (parent['expanded'] === false && this.parent.getVisibleRecords().indexOf(record) === -1 && isNullOrUndefined(this.parent['dataResults']['action'])) {
|
|
159
|
+
this.parent.expandRow(this.parent.getRows()[parent['index']], parent);
|
|
160
|
+
}
|
|
158
161
|
this.addParentRecord(parent);
|
|
159
162
|
}
|
|
160
163
|
}
|
|
@@ -24,9 +24,19 @@ export declare class RowDD {
|
|
|
24
24
|
/** @hidden */
|
|
25
25
|
isMultipleGrid: string;
|
|
26
26
|
/** @hidden */
|
|
27
|
+
private modifiedRecords;
|
|
28
|
+
/** @hidden */
|
|
29
|
+
private selectedItem;
|
|
30
|
+
/** @hidden */
|
|
31
|
+
private selectedRecords;
|
|
32
|
+
/** @hidden */
|
|
33
|
+
private selectedRows;
|
|
34
|
+
/** @hidden */
|
|
27
35
|
private hasDropItem;
|
|
28
36
|
/** @hidden */
|
|
29
37
|
isaddtoBottom: boolean;
|
|
38
|
+
private selectedRecord;
|
|
39
|
+
private selectedRow;
|
|
30
40
|
/**
|
|
31
41
|
* Constructor for render module
|
|
32
42
|
*
|
|
@@ -48,6 +58,8 @@ export declare class RowDD {
|
|
|
48
58
|
* @param {string} position - Drop position as above or below or child
|
|
49
59
|
*/
|
|
50
60
|
reorderRows(fromIndexes: number[], toIndex: number, position: string): void;
|
|
61
|
+
private indentOutdentAction;
|
|
62
|
+
private eventTrigger;
|
|
51
63
|
private orderToIndex;
|
|
52
64
|
private rowsAdded;
|
|
53
65
|
private rowsRemoved;
|
|
@@ -78,6 +90,7 @@ export declare class RowDD {
|
|
|
78
90
|
private updateChildRecord;
|
|
79
91
|
private updateChildRecordLevel;
|
|
80
92
|
private removeRecords;
|
|
93
|
+
private updateModifiedRecords;
|
|
81
94
|
private removeChildItem;
|
|
82
95
|
private getChildCount;
|
|
83
96
|
private ensuredropPosition;
|
|
@@ -22,6 +22,12 @@ var RowDD = /** @class */ (function () {
|
|
|
22
22
|
/** @hidden */
|
|
23
23
|
this.isDraggedWithChild = false;
|
|
24
24
|
/** @hidden */
|
|
25
|
+
this.modifiedRecords = 'modifiedRecords';
|
|
26
|
+
/** @hidden */
|
|
27
|
+
this.selectedRecords = 'selectedRecords';
|
|
28
|
+
/** @hidden */
|
|
29
|
+
this.selectedRows = 'selectedRows';
|
|
30
|
+
/** @hidden */
|
|
25
31
|
this.hasDropItem = true;
|
|
26
32
|
/** @hidden */
|
|
27
33
|
this.isaddtoBottom = false;
|
|
@@ -63,6 +69,7 @@ var RowDD = /** @class */ (function () {
|
|
|
63
69
|
RowDD.prototype.reorderRows = function (fromIndexes, toIndex, position) {
|
|
64
70
|
var tObj = this.parent;
|
|
65
71
|
var action = 'action';
|
|
72
|
+
var dropPosition = 'dropPosition';
|
|
66
73
|
var updateRowAndCellElements = 'updateRowAndCellElements';
|
|
67
74
|
if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {
|
|
68
75
|
if (position === 'above') {
|
|
@@ -74,6 +81,7 @@ var RowDD = /** @class */ (function () {
|
|
|
74
81
|
if (position === 'child') {
|
|
75
82
|
this.dropPosition = 'middleSegment';
|
|
76
83
|
}
|
|
84
|
+
this.parent[dropPosition] = this.dropPosition;
|
|
77
85
|
var data = [];
|
|
78
86
|
for (var i = 0; i < fromIndexes.length; i++) {
|
|
79
87
|
data[i] = this.parent.getCurrentViewRecords()[fromIndexes[i]];
|
|
@@ -138,18 +146,96 @@ var RowDD = /** @class */ (function () {
|
|
|
138
146
|
return;
|
|
139
147
|
}
|
|
140
148
|
};
|
|
149
|
+
RowDD.prototype.indentOutdentAction = function (record, request) {
|
|
150
|
+
var tObj = this.parent;
|
|
151
|
+
var action = 'action';
|
|
152
|
+
var droppedIndex = 'dropIndex';
|
|
153
|
+
var selectedItemIndex = -1;
|
|
154
|
+
if (isNullOrUndefined(record) && this.parent.selectedRowIndex === -1) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
if (this.parent.enableVirtualization && this.parent.selectedRowIndex !== -1) {
|
|
159
|
+
selectedItemIndex = this.parent.getSelectedRows()[0].rowIndex;
|
|
160
|
+
}
|
|
161
|
+
else if (this.parent.selectedRowIndex !== -1) {
|
|
162
|
+
selectedItemIndex = this.parent.selectedRowIndex;
|
|
163
|
+
}
|
|
164
|
+
this.selectedItem = isNullOrUndefined(record) ?
|
|
165
|
+
tObj.getCurrentViewRecords()[selectedItemIndex] : record;
|
|
166
|
+
var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
|
|
167
|
+
var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[primaryKeyField]);
|
|
168
|
+
this.selectedRow = this.parent[this.selectedRows] = selectedItemIndex !== -1 ?
|
|
169
|
+
this.parent.getSelectedRows()[0]
|
|
170
|
+
: this.parent.grid.getRowByIndex(rowIndex);
|
|
171
|
+
this.selectedRecord = this.parent[this.selectedRecords] = selectedItemIndex !== -1 ?
|
|
172
|
+
tObj.getCurrentViewRecords()[selectedItemIndex]
|
|
173
|
+
: this.selectedItem;
|
|
174
|
+
if (request === 'indent') {
|
|
175
|
+
var record_1 = tObj.getCurrentViewRecords()[this.selectedRow.rowIndex - 1];
|
|
176
|
+
var dropIndex = void 0;
|
|
177
|
+
if (this.selectedRow.rowIndex === 0 || this.selectedRow.rowIndex === -1 ||
|
|
178
|
+
tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level - record_1.level === 1) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (record_1.level > this.selectedRecord.level) {
|
|
182
|
+
for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
|
|
183
|
+
if (tObj.getCurrentViewRecords()[i].taskData === record_1.parentItem.taskData) {
|
|
184
|
+
dropIndex = i;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
dropIndex = this.selectedRow.rowIndex - 1;
|
|
190
|
+
}
|
|
191
|
+
tObj[action] = 'indenting';
|
|
192
|
+
tObj[droppedIndex] = dropIndex;
|
|
193
|
+
this.eventTrigger('indenting', dropIndex);
|
|
194
|
+
}
|
|
195
|
+
else if (request === 'outdent') {
|
|
196
|
+
if (this.selectedRow.rowIndex === -1 || this.selectedRow.rowIndex === 0 ||
|
|
197
|
+
tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level === 0) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
var dropIndex = void 0;
|
|
201
|
+
var parentItem = this.selectedRecord.parentItem;
|
|
202
|
+
for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
|
|
203
|
+
if (tObj.getCurrentViewRecords()[i].taskData === parentItem.taskData) {
|
|
204
|
+
dropIndex = i;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
tObj[action] = 'outdenting';
|
|
208
|
+
tObj[droppedIndex] = dropIndex;
|
|
209
|
+
this.eventTrigger('outdenting', dropIndex);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
RowDD.prototype.eventTrigger = function (action, dropIndex) {
|
|
214
|
+
var _this = this;
|
|
215
|
+
var actionArgs = {
|
|
216
|
+
action: action,
|
|
217
|
+
cancel: false,
|
|
218
|
+
data: [this.parent[this.selectedRecords]],
|
|
219
|
+
row: this.parent[this.selectedRows]
|
|
220
|
+
};
|
|
221
|
+
this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {
|
|
222
|
+
if (!actionArgs.cancel) {
|
|
223
|
+
if (actionArgs.action === 'indenting') {
|
|
224
|
+
_this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'child');
|
|
225
|
+
}
|
|
226
|
+
else if (actionArgs.action === 'outdenting') {
|
|
227
|
+
_this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'below');
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
};
|
|
141
232
|
RowDD.prototype.orderToIndex = function (currentData) {
|
|
142
|
-
var
|
|
233
|
+
for (var i = 0; i < currentData.length; i++) {
|
|
143
234
|
currentData[i].index = i;
|
|
144
235
|
if (!isNullOrUndefined(currentData[i].parentItem)) {
|
|
145
|
-
var updatedParent = currentData.
|
|
146
|
-
return data.uniqueID === currentData[i].parentUniqueID;
|
|
147
|
-
})[0];
|
|
236
|
+
var updatedParent = getValue('uniqueIDCollection.' + currentData[i].parentUniqueID, this.parent);
|
|
148
237
|
currentData[i].parentItem.index = updatedParent.index;
|
|
149
238
|
}
|
|
150
|
-
};
|
|
151
|
-
for (var i = 0; i < currentData.length; i++) {
|
|
152
|
-
_loop_1(i);
|
|
153
239
|
}
|
|
154
240
|
return currentData;
|
|
155
241
|
};
|
|
@@ -208,7 +294,8 @@ var RowDD = /** @class */ (function () {
|
|
|
208
294
|
}
|
|
209
295
|
}
|
|
210
296
|
}
|
|
211
|
-
if (Object.prototype.hasOwnProperty.call(draggedRecord_1, tObj.parentIdMapping)
|
|
297
|
+
if (Object.prototype.hasOwnProperty.call(draggedRecord_1, tObj.parentIdMapping)
|
|
298
|
+
&& draggedRecord_1[tObj.parentIdMapping] !== null
|
|
212
299
|
&& !this.isDraggedWithChild) {
|
|
213
300
|
draggedRecord_1.taskData[tObj.parentIdMapping] = null;
|
|
214
301
|
delete draggedRecord_1.parentItem;
|
|
@@ -700,7 +787,7 @@ var RowDD = /** @class */ (function () {
|
|
|
700
787
|
indexes[i] = records[i].index;
|
|
701
788
|
}
|
|
702
789
|
var data = srcControl.dataSource;
|
|
703
|
-
if (this.parent.idMapping
|
|
790
|
+
if (this.parent.idMapping !== null && (isNullOrUndefined(this.dropPosition) || this.dropPosition === 'bottomSegment' || this.dropPosition === 'Invalid') && !(data.length)) {
|
|
704
791
|
var actualData = [];
|
|
705
792
|
for (var i = 0; i < records.length; i++) {
|
|
706
793
|
if (records[i].hasChildRecords) {
|
|
@@ -748,14 +835,25 @@ var RowDD = /** @class */ (function () {
|
|
|
748
835
|
RowDD.prototype.getTargetIdx = function (targetRow) {
|
|
749
836
|
return targetRow ? parseInt(targetRow.getAttribute('aria-rowindex'), 10) : 0;
|
|
750
837
|
};
|
|
751
|
-
RowDD.prototype.getParentData = function (record) {
|
|
838
|
+
RowDD.prototype.getParentData = function (record, data) {
|
|
752
839
|
var parentItem = record.parentItem;
|
|
840
|
+
var selectedItemIndex = -1;
|
|
841
|
+
if (this.parent.enableVirtualization && this.parent.selectedRowIndex !== -1) {
|
|
842
|
+
selectedItemIndex = this.parent.getSelectedRows()[0].rowIndex;
|
|
843
|
+
}
|
|
844
|
+
else if (this.parent.selectedRowIndex !== -1) {
|
|
845
|
+
selectedItemIndex = this.parent.selectedRowIndex;
|
|
846
|
+
}
|
|
753
847
|
if (this.dropPosition === 'bottomSegment') {
|
|
754
|
-
var
|
|
848
|
+
var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
|
|
849
|
+
var rowIndex = selectedItemIndex === -1 ?
|
|
850
|
+
(this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField])) - 1
|
|
851
|
+
: this.parent.getSelectedRowIndexes()[0] - 1;
|
|
852
|
+
var selectedRecord = this.parent.getCurrentViewRecords()[rowIndex];
|
|
755
853
|
this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);
|
|
756
854
|
}
|
|
757
855
|
if (this.dropPosition === 'middleSegment') {
|
|
758
|
-
var level = this.parent.
|
|
856
|
+
var level = this.parent.getCurrentViewRecords()[selectedItemIndex].level;
|
|
759
857
|
if (level === parentItem.level) {
|
|
760
858
|
this.droppedRecord = getParentData(this.parent, parentItem.uniqueID);
|
|
761
859
|
}
|
|
@@ -770,9 +868,12 @@ var RowDD = /** @class */ (function () {
|
|
|
770
868
|
var draggedRecord_2;
|
|
771
869
|
var droppedRecord = void 0;
|
|
772
870
|
if (isNullOrUndefined(args.dropIndex)) {
|
|
773
|
-
var
|
|
871
|
+
var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
|
|
872
|
+
var rowIndex = tObj.selectedRowIndex === -1 ?
|
|
873
|
+
(this.parent.grid.getRowIndexByPrimaryKey(args.data[0][primaryKeyField])) - 1
|
|
874
|
+
: tObj.getSelectedRowIndexes()[0] - 1;
|
|
774
875
|
var record = tObj.getCurrentViewRecords()[rowIndex];
|
|
775
|
-
this.getParentData(record);
|
|
876
|
+
this.getParentData(record, args.data);
|
|
776
877
|
}
|
|
777
878
|
else {
|
|
778
879
|
args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;
|
|
@@ -786,6 +887,7 @@ var RowDD = /** @class */ (function () {
|
|
|
786
887
|
else {
|
|
787
888
|
dragRecords = args.data;
|
|
788
889
|
}
|
|
890
|
+
this.parent[this.modifiedRecords].push(args.data[0], droppedRecord);
|
|
789
891
|
var count = 0;
|
|
790
892
|
var multiplegrid = this.parent.rowDropSettings.targetID;
|
|
791
893
|
this.isMultipleGrid = multiplegrid;
|
|
@@ -799,7 +901,7 @@ var RowDD = /** @class */ (function () {
|
|
|
799
901
|
if (!isNullOrUndefined(this.parent.idMapping)) {
|
|
800
902
|
dragRecords.reverse();
|
|
801
903
|
}
|
|
802
|
-
var
|
|
904
|
+
var _loop_1 = function (i) {
|
|
803
905
|
draggedRecord_2 = dragRecords[i];
|
|
804
906
|
this_1.draggedRecord = draggedRecord_2;
|
|
805
907
|
if (this_1.dropPosition !== 'Invalid') {
|
|
@@ -886,7 +988,7 @@ var RowDD = /** @class */ (function () {
|
|
|
886
988
|
};
|
|
887
989
|
var this_1 = this;
|
|
888
990
|
for (var i = 0; i < dragLength; i++) {
|
|
889
|
-
|
|
991
|
+
_loop_1(i);
|
|
890
992
|
}
|
|
891
993
|
}
|
|
892
994
|
};
|
|
@@ -1108,6 +1210,19 @@ var RowDD = /** @class */ (function () {
|
|
|
1108
1210
|
flatParentData.hasChildRecords = false;
|
|
1109
1211
|
flatParentData.hasFilteredChildRecords = false;
|
|
1110
1212
|
}
|
|
1213
|
+
if (this.parent[this.modifiedRecords].indexOf(flatParentData) === -1 && !isNullOrUndefined(flatParentData)) {
|
|
1214
|
+
this.parent[this.modifiedRecords].push(flatParentData);
|
|
1215
|
+
}
|
|
1216
|
+
if (!isNullOrUndefined(flatParentData)) {
|
|
1217
|
+
this.updateModifiedRecords(flatParentData);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
};
|
|
1221
|
+
RowDD.prototype.updateModifiedRecords = function (record) {
|
|
1222
|
+
var parentData = getParentData(this.parent, record.parentUniqueID);
|
|
1223
|
+
if (!isNullOrUndefined(parentData)) {
|
|
1224
|
+
this.parent[this.modifiedRecords].push(parentData);
|
|
1225
|
+
this.updateModifiedRecords(parentData);
|
|
1111
1226
|
}
|
|
1112
1227
|
};
|
|
1113
1228
|
RowDD.prototype.removeChildItem = function (record) {
|
|
@@ -85,10 +85,12 @@ var Selection = /** @class */ (function () {
|
|
|
85
85
|
Selection.prototype.getCheckboxcolumnIndex = function () {
|
|
86
86
|
var mappingUid;
|
|
87
87
|
var columnIndex;
|
|
88
|
-
var
|
|
88
|
+
var stackedHeader = "stackedHeader";
|
|
89
|
+
var columnModel = 'columnModel';
|
|
90
|
+
var columns = this.parent[stackedHeader] ? this.parent[columnModel] : (this.parent.columns);
|
|
89
91
|
for (var col = 0; col < columns.length; col++) {
|
|
90
92
|
if (columns[col].showCheckbox) {
|
|
91
|
-
mappingUid =
|
|
93
|
+
mappingUid = columns[col].uid;
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
var headerCelllength = this.parent.getHeaderContent().querySelectorAll('.e-headercelldiv').length;
|
|
@@ -44,46 +44,59 @@ var Toolbar = /** @class */ (function () {
|
|
|
44
44
|
};
|
|
45
45
|
Toolbar.prototype.refreshToolbar = function (args) {
|
|
46
46
|
var tObj = this.parent;
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
var indentElement;
|
|
48
|
+
var outdentElement;
|
|
49
|
+
var indentID = tObj.element.id + '_gridcontrol_indent';
|
|
50
|
+
var outdentID = tObj.element.id + '_gridcontrol_outdent';
|
|
51
|
+
var toolbarElement = this.parent.grid.toolbarModule.getToolbar();
|
|
52
|
+
var indentEle = toolbarElement.querySelector('#' + indentID);
|
|
53
|
+
var outdentEle = toolbarElement.querySelector('#' + outdentID);
|
|
54
|
+
var row = args.row;
|
|
55
|
+
var selectedrow = tObj.getSelectedRows()[0];
|
|
56
|
+
if (!isNullOrUndefined(row[0])) {
|
|
57
|
+
row = row[0];
|
|
49
58
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (
|
|
61
|
-
tObj.getCurrentViewRecords()[
|
|
62
|
-
|
|
59
|
+
row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;
|
|
60
|
+
if (indentEle !== null && outdentEle !== null) {
|
|
61
|
+
indentElement = toolbarElement.querySelector('#' + indentID).parentElement;
|
|
62
|
+
outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;
|
|
63
|
+
if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
|
|
64
|
+
indentElement.classList.add('e-hidden');
|
|
65
|
+
outdentElement.classList.add('e-hidden');
|
|
66
|
+
}
|
|
67
|
+
else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {
|
|
68
|
+
var selectedItem = tObj.getCurrentViewRecords()[row.rowIndex];
|
|
69
|
+
if (!isNullOrUndefined(selectedItem)) {
|
|
70
|
+
if ((selectedItem.level > tObj.getCurrentViewRecords()[row.rowIndex - 1].level)) {
|
|
71
|
+
indentElement.classList.add('e-hidden');
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
indentElement.classList.remove('e-hidden');
|
|
75
|
+
}
|
|
76
|
+
if (selectedItem.level === tObj.getCurrentViewRecords()[row.rowIndex - 1].level) {
|
|
77
|
+
indentElement.classList.remove('e-hidden');
|
|
78
|
+
}
|
|
79
|
+
if (selectedItem.level === 0) {
|
|
80
|
+
outdentElement.classList.add('e-hidden');
|
|
81
|
+
}
|
|
82
|
+
if (selectedItem.level !== 0) {
|
|
83
|
+
outdentElement.classList.remove('e-hidden');
|
|
84
|
+
}
|
|
63
85
|
}
|
|
64
|
-
|
|
65
|
-
|
|
86
|
+
}
|
|
87
|
+
if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {
|
|
88
|
+
if (this.parent.toolbar['includes']('Indent')) {
|
|
89
|
+
indentElement.classList.add('e-hidden');
|
|
66
90
|
}
|
|
67
|
-
if (
|
|
68
|
-
|
|
91
|
+
if (this.parent.toolbar['includes']('Outdent')) {
|
|
92
|
+
outdentElement.classList.add('e-hidden');
|
|
69
93
|
}
|
|
70
94
|
}
|
|
71
95
|
}
|
|
72
|
-
if (args['name'] === 'rowDeselected') {
|
|
73
|
-
if (this.parent.toolbar['includes']('Indent')) {
|
|
74
|
-
this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);
|
|
75
|
-
}
|
|
76
|
-
if (this.parent.toolbar['includes']('Outdent')) {
|
|
77
|
-
this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (args.row.rowIndex === 0 && !isNullOrUndefined(args.data.parentItem)) {
|
|
81
|
-
this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);
|
|
82
|
-
}
|
|
83
96
|
};
|
|
84
97
|
Toolbar.prototype.toolbarClickHandler = function (args) {
|
|
85
98
|
var tObj = this.parent;
|
|
86
|
-
var
|
|
99
|
+
var indentOutdentAction = 'indentOutdentAction';
|
|
87
100
|
if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.editSettings.mode === 'Batch' &&
|
|
88
101
|
args.item.id === this.parent.grid.element.id + '_update') {
|
|
89
102
|
args.cancel = true;
|
|
@@ -95,57 +108,15 @@ var Toolbar = /** @class */ (function () {
|
|
|
95
108
|
if (args.item.id === this.parent.grid.element.id + '_collapseall') {
|
|
96
109
|
this.parent.collapseAll();
|
|
97
110
|
}
|
|
98
|
-
if (args.item.id === tObj.grid.element.id + '_indent' && tObj.getSelectedRecords().length
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (record.level > tObj.getSelectedRecords()[0].level) {
|
|
102
|
-
for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
|
|
103
|
-
if (tObj.getCurrentViewRecords()[i].taskData === record.parentItem.taskData) {
|
|
104
|
-
dropIndex = i;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
dropIndex = tObj.getSelectedRowIndexes()[0] - 1;
|
|
110
|
-
}
|
|
111
|
-
this.parent[action] = 'indenting';
|
|
112
|
-
this.eventTrigger('indenting', dropIndex);
|
|
111
|
+
if (args.item.id === tObj.grid.element.id + '_indent' && tObj.getSelectedRecords().length
|
|
112
|
+
&& !isNullOrUndefined(tObj.rowDragAndDropModule)) {
|
|
113
|
+
this.parent.rowDragAndDropModule[indentOutdentAction](null, 'indent');
|
|
113
114
|
}
|
|
114
|
-
if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
|
|
118
|
-
if (tObj.getCurrentViewRecords()[i].taskData === parentItem.taskData) {
|
|
119
|
-
dropIndex = i;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
this.parent[action] = 'outdenting';
|
|
123
|
-
this.eventTrigger('outdenting', dropIndex);
|
|
115
|
+
if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length
|
|
116
|
+
&& !isNullOrUndefined(tObj.rowDragAndDropModule)) {
|
|
117
|
+
this.parent.rowDragAndDropModule[indentOutdentAction](null, 'outdent');
|
|
124
118
|
}
|
|
125
119
|
};
|
|
126
|
-
Toolbar.prototype.eventTrigger = function (action, dropIndex) {
|
|
127
|
-
var _this = this;
|
|
128
|
-
var selectedRecords = 'selectedRecords';
|
|
129
|
-
var selectedRows = 'selectedRows';
|
|
130
|
-
this.parent[selectedRows] = this.parent.getSelectedRows();
|
|
131
|
-
this.parent[selectedRecords] = this.parent.getSelectedRecords();
|
|
132
|
-
var actionArgs = {
|
|
133
|
-
requestType: action,
|
|
134
|
-
data: this.parent.getSelectedRecords(),
|
|
135
|
-
row: this.parent.getSelectedRows(),
|
|
136
|
-
cancel: false
|
|
137
|
-
};
|
|
138
|
-
this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {
|
|
139
|
-
if (!actionArgs.cancel) {
|
|
140
|
-
if (actionArgs.requestType === 'indenting') {
|
|
141
|
-
_this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'child');
|
|
142
|
-
}
|
|
143
|
-
else if (actionArgs.requestType === 'outdenting') {
|
|
144
|
-
_this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'below');
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
120
|
/**
|
|
150
121
|
* Gets the toolbar of the TreeGrid.
|
|
151
122
|
*
|
|
@@ -117,7 +117,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
117
117
|
}
|
|
118
118
|
else {
|
|
119
119
|
var requestType = pageingDetails.actionArgs.requestType;
|
|
120
|
-
if (requestType === 'filtering' || requestType === 'collapseAll' ||
|
|
120
|
+
if (requestType === 'filtering' || requestType === 'collapseAll' || requestType === 'searching' ||
|
|
121
121
|
(requestType === 'refresh' && this.parent.enableCollapseAll && endIndex > visualData.length)) {
|
|
122
122
|
startIndex = 0;
|
|
123
123
|
endIndex = this.parent.grid.pageSettings.pageSize - 1;
|