@syncfusion/ej2-treegrid 19.4.56 → 20.1.51
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 +11 -57
- 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 +446 -156
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +451 -164
- 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 +21 -4
- package/src/treegrid/actions/crud-actions.js +9 -2
- package/src/treegrid/actions/edit.js +16 -1
- package/src/treegrid/actions/filter.js +3 -0
- package/src/treegrid/actions/rowdragdrop.d.ts +15 -0
- package/src/treegrid/actions/rowdragdrop.js +181 -30
- 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 +33 -6
- package/src/treegrid/base/treegrid.js +136 -39
- package/src/treegrid/models/column.d.ts +6 -6
- package/src/treegrid/models/column.js +7 -7
- 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 +27 -12
- package/styles/bootstrap.css +27 -12
- package/styles/bootstrap4.css +21 -12
- package/styles/bootstrap5-dark.css +43 -27
- package/styles/bootstrap5.css +43 -27
- package/styles/fabric-dark.css +27 -12
- package/styles/fabric.css +27 -12
- package/styles/fluent-dark.css +556 -0
- package/styles/fluent-dark.scss +1 -0
- package/styles/fluent.css +556 -0
- package/styles/fluent.scss +1 -0
- package/styles/highcontrast-light.css +27 -12
- package/styles/highcontrast.css +27 -12
- package/styles/material-dark.css +19 -10
- package/styles/material.css +19 -10
- package/styles/tailwind-dark.css +41 -88
- package/styles/tailwind.css +26 -73
- 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 +3 -5
- package/styles/treegrid/_fabric-dark-definition.scss +0 -2
- package/styles/treegrid/_fabric-definition.scss +0 -2
- package/styles/treegrid/_fluent-dark-definition.scss +1 -0
- package/styles/treegrid/_fluent-definition.scss +3 -4
- package/styles/treegrid/_highcontrast-definition.scss +0 -2
- package/styles/treegrid/_highcontrast-light-definition.scss +0 -2
- package/styles/treegrid/_layout.scss +66 -13
- package/styles/treegrid/_material-dark-definition.scss +0 -2
- package/styles/treegrid/_material-definition.scss +0 -2
- package/styles/treegrid/_tailwind-definition.scss +3 -5
- package/styles/treegrid/bootstrap-dark.css +27 -12
- package/styles/treegrid/bootstrap.css +27 -12
- package/styles/treegrid/bootstrap4.css +21 -12
- package/styles/treegrid/bootstrap5-dark.css +43 -27
- package/styles/treegrid/bootstrap5.css +43 -27
- package/styles/treegrid/fabric-dark.css +27 -12
- package/styles/treegrid/fabric.css +27 -12
- package/styles/treegrid/fluent-dark.css +556 -0
- package/styles/treegrid/fluent-dark.scss +18 -0
- package/styles/treegrid/fluent.css +556 -0
- package/styles/treegrid/fluent.scss +18 -0
- package/styles/treegrid/highcontrast-light.css +27 -12
- package/styles/treegrid/highcontrast.css +27 -12
- package/styles/treegrid/icons/_fluent-dark.scss +1 -0
- package/styles/treegrid/icons/_tailwind-dark.scss +5 -5
- package/styles/treegrid/icons/_tailwind.scss +5 -5
- package/styles/treegrid/material-dark.css +19 -10
- package/styles/treegrid/material.css +19 -10
- package/styles/treegrid/tailwind-dark.css +41 -88
- package/styles/treegrid/tailwind.css +26 -73
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 20.1.51
|
|
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.48",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-8wPx7RsFAoz5CZKwde0HxmCx1MYBUtZGrzI/e+at8zwvQlxMLvVJnhERqJFFhdPoZcdQga4D6tx0vGHCrfM/+Q==",
|
|
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-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-
|
|
28
|
-
"_shasum": "
|
|
27
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.1.48.tgz",
|
|
28
|
+
"_shasum": "e7bd8249c5a14245b20a6295bc7a8668f094da53",
|
|
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": "~
|
|
40
|
-
"@syncfusion/ej2-data": "~
|
|
41
|
-
"@syncfusion/ej2-grids": "~
|
|
42
|
-
"@syncfusion/ej2-popups": "~
|
|
39
|
+
"@syncfusion/ej2-base": "~20.1.50",
|
|
40
|
+
"@syncfusion/ej2-data": "~20.1.47",
|
|
41
|
+
"@syncfusion/ej2-grids": "~20.1.51",
|
|
42
|
+
"@syncfusion/ej2-popups": "~20.1.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": "
|
|
63
|
+
"version": "20.1.51",
|
|
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];
|
|
@@ -66,7 +66,9 @@ 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
|
-
|
|
69
|
+
if (!control.enableImmutableMode) {
|
|
70
|
+
parentData['childRecords'].splice(p, 1);
|
|
71
|
+
}
|
|
70
72
|
childRecords.splice(p, 1);
|
|
71
73
|
if (!childRecords.length) {
|
|
72
74
|
parentData.hasChildRecords = false;
|
|
@@ -364,7 +366,12 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
|
|
|
364
366
|
control.grid.setRowData(key, record);
|
|
365
367
|
var row = control.getRowByIndex(index_1);
|
|
366
368
|
if (control.editSettings.mode === 'Batch') {
|
|
367
|
-
|
|
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
|
+
}
|
|
368
375
|
}
|
|
369
376
|
var movableRow = void 0;
|
|
370
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,7 +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 */
|
|
35
|
+
private hasDropItem;
|
|
36
|
+
/** @hidden */
|
|
27
37
|
isaddtoBottom: boolean;
|
|
38
|
+
private selectedRecord;
|
|
39
|
+
private selectedRow;
|
|
28
40
|
/**
|
|
29
41
|
* Constructor for render module
|
|
30
42
|
*
|
|
@@ -46,6 +58,8 @@ export declare class RowDD {
|
|
|
46
58
|
* @param {string} position - Drop position as above or below or child
|
|
47
59
|
*/
|
|
48
60
|
reorderRows(fromIndexes: number[], toIndex: number, position: string): void;
|
|
61
|
+
private indentOutdentAction;
|
|
62
|
+
private eventTrigger;
|
|
49
63
|
private orderToIndex;
|
|
50
64
|
private rowsAdded;
|
|
51
65
|
private rowsRemoved;
|
|
@@ -76,6 +90,7 @@ export declare class RowDD {
|
|
|
76
90
|
private updateChildRecord;
|
|
77
91
|
private updateChildRecordLevel;
|
|
78
92
|
private removeRecords;
|
|
93
|
+
private updateModifiedRecords;
|
|
79
94
|
private removeChildItem;
|
|
80
95
|
private getChildCount;
|
|
81
96
|
private ensuredropPosition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Grid, RowDD as GridDragDrop, parentsUntil } from '@syncfusion/ej2-grids';
|
|
2
2
|
import { getObject, Scroll } from '@syncfusion/ej2-grids';
|
|
3
|
-
import { closest, isNullOrUndefined, classList, setValue, extend, getValue, removeClass, addClass } from '@syncfusion/ej2-base';
|
|
3
|
+
import { closest, isNullOrUndefined, classList, setValue, extend, getValue, removeClass, addClass, setStyleAttribute } from '@syncfusion/ej2-base';
|
|
4
4
|
import { DataManager } from '@syncfusion/ej2-data';
|
|
5
5
|
import * as events from '../base/constant';
|
|
6
6
|
import { editAction } from './crud-actions';
|
|
@@ -22,6 +22,14 @@ 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 */
|
|
31
|
+
this.hasDropItem = true;
|
|
32
|
+
/** @hidden */
|
|
25
33
|
this.isaddtoBottom = false;
|
|
26
34
|
Grid.Inject(GridDragDrop);
|
|
27
35
|
this.parent = parent;
|
|
@@ -61,6 +69,8 @@ var RowDD = /** @class */ (function () {
|
|
|
61
69
|
RowDD.prototype.reorderRows = function (fromIndexes, toIndex, position) {
|
|
62
70
|
var tObj = this.parent;
|
|
63
71
|
var action = 'action';
|
|
72
|
+
var dropPosition = 'dropPosition';
|
|
73
|
+
var updateRowAndCellElements = 'updateRowAndCellElements';
|
|
64
74
|
if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {
|
|
65
75
|
if (position === 'above') {
|
|
66
76
|
this.dropPosition = 'topSegment';
|
|
@@ -71,6 +81,7 @@ var RowDD = /** @class */ (function () {
|
|
|
71
81
|
if (position === 'child') {
|
|
72
82
|
this.dropPosition = 'middleSegment';
|
|
73
83
|
}
|
|
84
|
+
this.parent[dropPosition] = this.dropPosition;
|
|
74
85
|
var data = [];
|
|
75
86
|
for (var i = 0; i < fromIndexes.length; i++) {
|
|
76
87
|
data[i] = this.parent.getCurrentViewRecords()[fromIndexes[i]];
|
|
@@ -94,7 +105,13 @@ var RowDD = /** @class */ (function () {
|
|
|
94
105
|
}
|
|
95
106
|
this.parent.grid.refresh();
|
|
96
107
|
if (this.parent.enableImmutableMode && this.dropPosition === 'middleSegment') {
|
|
97
|
-
var index =
|
|
108
|
+
var index = void 0;
|
|
109
|
+
if (this.parent.allowRowDragAndDrop) {
|
|
110
|
+
index = this.parent.treeColumnIndex + 1;
|
|
111
|
+
}
|
|
112
|
+
else if (this.parent[action] === 'indenting') {
|
|
113
|
+
index = this.parent.treeColumnIndex;
|
|
114
|
+
}
|
|
98
115
|
var row = this.parent.getRows()[fromIndexes[0]];
|
|
99
116
|
var dropData = args.data[0];
|
|
100
117
|
var totalRecord = [];
|
|
@@ -106,36 +123,119 @@ var RowDD = /** @class */ (function () {
|
|
|
106
123
|
var parentrow = this.parent.getRows()[toIndex];
|
|
107
124
|
totalRecord.push(parentData);
|
|
108
125
|
rows.push(parentrow);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (this.parent[action] === 'indenting' || this.parent[action] === 'outdenting') {
|
|
116
|
-
this.parent.renderModule.RowModifier({
|
|
117
|
-
data: totalRecord[i], row: rows[i]
|
|
118
|
-
});
|
|
119
|
-
}
|
|
126
|
+
this.parent[updateRowAndCellElements](totalRecord, rows, index);
|
|
127
|
+
}
|
|
128
|
+
if (this.parent.enableImmutableMode && this.parent[action] === 'outdenting') {
|
|
129
|
+
var index = void 0;
|
|
130
|
+
if (this.parent.allowRowDragAndDrop) {
|
|
131
|
+
index = this.parent.treeColumnIndex + 1;
|
|
120
132
|
}
|
|
133
|
+
else if (this.parent[action] === 'outdenting') {
|
|
134
|
+
index = this.parent.treeColumnIndex;
|
|
135
|
+
}
|
|
136
|
+
var record = args.data[0];
|
|
137
|
+
var row = this.parent.getRows()[fromIndexes[0]];
|
|
138
|
+
var totalRecord = [];
|
|
139
|
+
var rows = [];
|
|
140
|
+
totalRecord.push(record);
|
|
141
|
+
rows.push(row);
|
|
142
|
+
this.parent[updateRowAndCellElements](totalRecord, rows, index);
|
|
121
143
|
}
|
|
122
144
|
}
|
|
123
145
|
else {
|
|
124
146
|
return;
|
|
125
147
|
}
|
|
126
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
|
+
};
|
|
127
232
|
RowDD.prototype.orderToIndex = function (currentData) {
|
|
128
|
-
var
|
|
233
|
+
for (var i = 0; i < currentData.length; i++) {
|
|
129
234
|
currentData[i].index = i;
|
|
130
235
|
if (!isNullOrUndefined(currentData[i].parentItem)) {
|
|
131
|
-
var updatedParent = currentData.
|
|
132
|
-
return data.uniqueID === currentData[i].parentUniqueID;
|
|
133
|
-
})[0];
|
|
236
|
+
var updatedParent = getValue('uniqueIDCollection.' + currentData[i].parentUniqueID, this.parent);
|
|
134
237
|
currentData[i].parentItem.index = updatedParent.index;
|
|
135
238
|
}
|
|
136
|
-
};
|
|
137
|
-
for (var i = 0; i < currentData.length; i++) {
|
|
138
|
-
_loop_1(i);
|
|
139
239
|
}
|
|
140
240
|
return currentData;
|
|
141
241
|
};
|
|
@@ -194,7 +294,8 @@ var RowDD = /** @class */ (function () {
|
|
|
194
294
|
}
|
|
195
295
|
}
|
|
196
296
|
}
|
|
197
|
-
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
|
|
198
299
|
&& !this.isDraggedWithChild) {
|
|
199
300
|
draggedRecord_1.taskData[tObj.parentIdMapping] = null;
|
|
200
301
|
delete draggedRecord_1.parentItem;
|
|
@@ -470,13 +571,34 @@ var RowDD = /** @class */ (function () {
|
|
|
470
571
|
spanContent.innerHTML = content;
|
|
471
572
|
dragelem.querySelector('.e-rowcell').appendChild(ele);
|
|
472
573
|
dragelem.querySelector('.e-rowcell').appendChild(spanContent);
|
|
574
|
+
var dropItemSpan = document.querySelector('.e-dropitemscount');
|
|
575
|
+
if (this.hasDropItem && dropItemSpan) {
|
|
576
|
+
var dropItemLeft = parseInt(dropItemSpan.style.left, 10) + ele.offsetWidth + 16;
|
|
577
|
+
var spanLeft = !this.parent.enableRtl ? dropItemLeft : 0;
|
|
578
|
+
dropItemSpan.style.left = spanLeft + "px";
|
|
579
|
+
this.hasDropItem = false;
|
|
580
|
+
}
|
|
473
581
|
}
|
|
474
582
|
};
|
|
475
583
|
RowDD.prototype.removeErrorElem = function () {
|
|
476
584
|
var errorelem = document.querySelector('.e-errorelem');
|
|
585
|
+
var errorValue = document.querySelector('.errorValue');
|
|
586
|
+
var dropItemSpan = document.querySelector('.e-dropitemscount');
|
|
477
587
|
if (errorelem) {
|
|
588
|
+
if (dropItemSpan) {
|
|
589
|
+
var dropItemLeft = parseInt(dropItemSpan.style.left, 10) - errorelem.offsetWidth - 16;
|
|
590
|
+
setStyleAttribute(errorValue, {
|
|
591
|
+
paddingLeft: '0px'
|
|
592
|
+
});
|
|
593
|
+
if (!this.parent.enableRtl) {
|
|
594
|
+
setStyleAttribute(dropItemSpan, {
|
|
595
|
+
left: dropItemLeft + "px"
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
}
|
|
478
599
|
errorelem.remove();
|
|
479
600
|
}
|
|
601
|
+
this.hasDropItem = true;
|
|
480
602
|
};
|
|
481
603
|
RowDD.prototype.topOrBottomBorder = function (target) {
|
|
482
604
|
var rowElement = [];
|
|
@@ -665,7 +787,7 @@ var RowDD = /** @class */ (function () {
|
|
|
665
787
|
indexes[i] = records[i].index;
|
|
666
788
|
}
|
|
667
789
|
var data = srcControl.dataSource;
|
|
668
|
-
if (this.parent.idMapping
|
|
790
|
+
if (this.parent.idMapping !== null && (isNullOrUndefined(this.dropPosition) || this.dropPosition === 'bottomSegment' || this.dropPosition === 'Invalid') && !(data.length)) {
|
|
669
791
|
var actualData = [];
|
|
670
792
|
for (var i = 0; i < records.length; i++) {
|
|
671
793
|
if (records[i].hasChildRecords) {
|
|
@@ -713,14 +835,25 @@ var RowDD = /** @class */ (function () {
|
|
|
713
835
|
RowDD.prototype.getTargetIdx = function (targetRow) {
|
|
714
836
|
return targetRow ? parseInt(targetRow.getAttribute('aria-rowindex'), 10) : 0;
|
|
715
837
|
};
|
|
716
|
-
RowDD.prototype.getParentData = function (record) {
|
|
838
|
+
RowDD.prototype.getParentData = function (record, data) {
|
|
717
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
|
+
}
|
|
718
847
|
if (this.dropPosition === 'bottomSegment') {
|
|
719
|
-
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];
|
|
720
853
|
this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);
|
|
721
854
|
}
|
|
722
855
|
if (this.dropPosition === 'middleSegment') {
|
|
723
|
-
var level = this.parent.
|
|
856
|
+
var level = this.parent.getCurrentViewRecords()[selectedItemIndex].level;
|
|
724
857
|
if (level === parentItem.level) {
|
|
725
858
|
this.droppedRecord = getParentData(this.parent, parentItem.uniqueID);
|
|
726
859
|
}
|
|
@@ -735,9 +868,12 @@ var RowDD = /** @class */ (function () {
|
|
|
735
868
|
var draggedRecord_2;
|
|
736
869
|
var droppedRecord = void 0;
|
|
737
870
|
if (isNullOrUndefined(args.dropIndex)) {
|
|
738
|
-
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;
|
|
739
875
|
var record = tObj.getCurrentViewRecords()[rowIndex];
|
|
740
|
-
this.getParentData(record);
|
|
876
|
+
this.getParentData(record, args.data);
|
|
741
877
|
}
|
|
742
878
|
else {
|
|
743
879
|
args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;
|
|
@@ -751,6 +887,7 @@ var RowDD = /** @class */ (function () {
|
|
|
751
887
|
else {
|
|
752
888
|
dragRecords = args.data;
|
|
753
889
|
}
|
|
890
|
+
this.parent[this.modifiedRecords].push(args.data[0], droppedRecord);
|
|
754
891
|
var count = 0;
|
|
755
892
|
var multiplegrid = this.parent.rowDropSettings.targetID;
|
|
756
893
|
this.isMultipleGrid = multiplegrid;
|
|
@@ -764,7 +901,7 @@ var RowDD = /** @class */ (function () {
|
|
|
764
901
|
if (!isNullOrUndefined(this.parent.idMapping)) {
|
|
765
902
|
dragRecords.reverse();
|
|
766
903
|
}
|
|
767
|
-
var
|
|
904
|
+
var _loop_1 = function (i) {
|
|
768
905
|
draggedRecord_2 = dragRecords[i];
|
|
769
906
|
this_1.draggedRecord = draggedRecord_2;
|
|
770
907
|
if (this_1.dropPosition !== 'Invalid') {
|
|
@@ -804,6 +941,7 @@ var RowDD = /** @class */ (function () {
|
|
|
804
941
|
}
|
|
805
942
|
if (isNullOrUndefined(droppedRecord.parentItem)) {
|
|
806
943
|
delete draggedRecord_2.parentItem;
|
|
944
|
+
delete draggedRecord_2.parentUniqueID;
|
|
807
945
|
draggedRecord_2.level = 0;
|
|
808
946
|
if (this_1.parent.parentIdMapping) {
|
|
809
947
|
draggedRecord_2[this_1.parent.parentIdMapping] = null;
|
|
@@ -850,7 +988,7 @@ var RowDD = /** @class */ (function () {
|
|
|
850
988
|
};
|
|
851
989
|
var this_1 = this;
|
|
852
990
|
for (var i = 0; i < dragLength; i++) {
|
|
853
|
-
|
|
991
|
+
_loop_1(i);
|
|
854
992
|
}
|
|
855
993
|
}
|
|
856
994
|
};
|
|
@@ -1018,7 +1156,7 @@ var RowDD = /** @class */ (function () {
|
|
|
1018
1156
|
if (childRecords && childRecords.length > 0) {
|
|
1019
1157
|
childIndex = childRecords.indexOf(deletedRow);
|
|
1020
1158
|
flatParentData.childRecords.splice(childIndex, 1);
|
|
1021
|
-
if (!this.parent.parentIdMapping) {
|
|
1159
|
+
if (!this.parent.parentIdMapping || tObj.enableImmutableMode) {
|
|
1022
1160
|
editAction({ value: deletedRow, action: 'delete' }, this.parent, isSelfReference, deletedRow.index, deletedRow.index);
|
|
1023
1161
|
}
|
|
1024
1162
|
}
|
|
@@ -1072,6 +1210,19 @@ var RowDD = /** @class */ (function () {
|
|
|
1072
1210
|
flatParentData.hasChildRecords = false;
|
|
1073
1211
|
flatParentData.hasFilteredChildRecords = false;
|
|
1074
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);
|
|
1075
1226
|
}
|
|
1076
1227
|
};
|
|
1077
1228
|
RowDD.prototype.removeChildItem = function (record) {
|