@syncfusion/ej2-treegrid 19.4.55 → 20.1.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 +6 -56
- 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 +4885 -4779
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +5024 -4922
- 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 +3 -1
- package/src/treegrid/actions/edit.js +16 -1
- package/src/treegrid/actions/filter.js +3 -0
- package/src/treegrid/actions/rowdragdrop.d.ts +2 -0
- package/src/treegrid/actions/rowdragdrop.js +56 -24
- package/src/treegrid/actions/toolbar.js +2 -2
- package/src/treegrid/base/data.js +4 -2
- package/src/treegrid/base/treegrid-model.d.ts +1 -1
- package/src/treegrid/base/treegrid.d.ts +13 -6
- package/src/treegrid/base/treegrid.js +85 -35
- package/src/treegrid/models/column.d.ts +0 -9
- package/src/treegrid/models/column.js +0 -19
- package/src/treegrid/utils.js +2 -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.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@
|
|
3
|
+
"_id": "@syncfusion/ej2-treegrid@20.1.47",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512
|
|
5
|
+
"_integrity": "sha512-wi8XwhJB7KOHPpwl6tPNlqmE8HiFV+wPZHy+nOFvu2CL3/TQEqPhwz44h5EAuG+xRN6DqrOODGjf/R7DfWNAZA==",
|
|
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.47.tgz",
|
|
28
|
+
"_shasum": "4e9347d2be3329f13cd71967f9b245887b42f746",
|
|
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.48",
|
|
40
|
+
"@syncfusion/ej2-data": "~20.1.47",
|
|
41
|
+
"@syncfusion/ej2-grids": "~20.1.48",
|
|
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.48",
|
|
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].ariaRowIndex);
|
|
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;
|
|
@@ -275,7 +275,7 @@ var Edit = /** @class */ (function () {
|
|
|
275
275
|
var promise = 'promise';
|
|
276
276
|
var prom = args[promise];
|
|
277
277
|
delete args[promise];
|
|
278
|
-
if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex)) {
|
|
278
|
+
if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex) && this.prevAriaRowIndex !== '-1') {
|
|
279
279
|
args.row.setAttribute('aria-rowindex', this.prevAriaRowIndex);
|
|
280
280
|
this.prevAriaRowIndex = undefined;
|
|
281
281
|
}
|
|
@@ -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 &&
|
|
@@ -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
|
}
|
|
@@ -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,8 @@ var RowDD = /** @class */ (function () {
|
|
|
22
22
|
/** @hidden */
|
|
23
23
|
this.isDraggedWithChild = false;
|
|
24
24
|
/** @hidden */
|
|
25
|
+
this.hasDropItem = true;
|
|
26
|
+
/** @hidden */
|
|
25
27
|
this.isaddtoBottom = false;
|
|
26
28
|
Grid.Inject(GridDragDrop);
|
|
27
29
|
this.parent = parent;
|
|
@@ -61,6 +63,7 @@ var RowDD = /** @class */ (function () {
|
|
|
61
63
|
RowDD.prototype.reorderRows = function (fromIndexes, toIndex, position) {
|
|
62
64
|
var tObj = this.parent;
|
|
63
65
|
var action = 'action';
|
|
66
|
+
var updateRowAndCellElements = 'updateRowAndCellElements';
|
|
64
67
|
if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {
|
|
65
68
|
if (position === 'above') {
|
|
66
69
|
this.dropPosition = 'topSegment';
|
|
@@ -94,7 +97,13 @@ var RowDD = /** @class */ (function () {
|
|
|
94
97
|
}
|
|
95
98
|
this.parent.grid.refresh();
|
|
96
99
|
if (this.parent.enableImmutableMode && this.dropPosition === 'middleSegment') {
|
|
97
|
-
var index =
|
|
100
|
+
var index = void 0;
|
|
101
|
+
if (this.parent.allowRowDragAndDrop) {
|
|
102
|
+
index = this.parent.treeColumnIndex + 1;
|
|
103
|
+
}
|
|
104
|
+
else if (this.parent[action] === 'indenting') {
|
|
105
|
+
index = this.parent.treeColumnIndex;
|
|
106
|
+
}
|
|
98
107
|
var row = this.parent.getRows()[fromIndexes[0]];
|
|
99
108
|
var dropData = args.data[0];
|
|
100
109
|
var totalRecord = [];
|
|
@@ -106,18 +115,23 @@ var RowDD = /** @class */ (function () {
|
|
|
106
115
|
var parentrow = this.parent.getRows()[toIndex];
|
|
107
116
|
totalRecord.push(parentData);
|
|
108
117
|
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
|
-
}
|
|
118
|
+
this.parent[updateRowAndCellElements](totalRecord, rows, index);
|
|
119
|
+
}
|
|
120
|
+
if (this.parent.enableImmutableMode && this.parent[action] === 'outdenting') {
|
|
121
|
+
var index = void 0;
|
|
122
|
+
if (this.parent.allowRowDragAndDrop) {
|
|
123
|
+
index = this.parent.treeColumnIndex + 1;
|
|
120
124
|
}
|
|
125
|
+
else if (this.parent[action] === 'outdenting') {
|
|
126
|
+
index = this.parent.treeColumnIndex;
|
|
127
|
+
}
|
|
128
|
+
var record = args.data[0];
|
|
129
|
+
var row = this.parent.getRows()[fromIndexes[0]];
|
|
130
|
+
var totalRecord = [];
|
|
131
|
+
var rows = [];
|
|
132
|
+
totalRecord.push(record);
|
|
133
|
+
rows.push(row);
|
|
134
|
+
this.parent[updateRowAndCellElements](totalRecord, rows, index);
|
|
121
135
|
}
|
|
122
136
|
}
|
|
123
137
|
else {
|
|
@@ -125,17 +139,12 @@ var RowDD = /** @class */ (function () {
|
|
|
125
139
|
}
|
|
126
140
|
};
|
|
127
141
|
RowDD.prototype.orderToIndex = function (currentData) {
|
|
128
|
-
var
|
|
142
|
+
for (var i = 0; i < currentData.length; i++) {
|
|
129
143
|
currentData[i].index = i;
|
|
130
144
|
if (!isNullOrUndefined(currentData[i].parentItem)) {
|
|
131
|
-
var updatedParent = currentData.
|
|
132
|
-
return data.uniqueID === currentData[i].parentUniqueID;
|
|
133
|
-
})[0];
|
|
145
|
+
var updatedParent = getValue('uniqueIDCollection.' + currentData[i].parentUniqueID, this.parent);
|
|
134
146
|
currentData[i].parentItem.index = updatedParent.index;
|
|
135
147
|
}
|
|
136
|
-
};
|
|
137
|
-
for (var i = 0; i < currentData.length; i++) {
|
|
138
|
-
_loop_1(i);
|
|
139
148
|
}
|
|
140
149
|
return currentData;
|
|
141
150
|
};
|
|
@@ -265,7 +274,8 @@ var RowDD = /** @class */ (function () {
|
|
|
265
274
|
}
|
|
266
275
|
// eslint-disable-next-line max-len
|
|
267
276
|
if (tempDataSource && (!isNullOrUndefined(droppedRecord) && !droppedRecord.parentItem) && !isNullOrUndefined(droppedRecord.taskData)) {
|
|
268
|
-
|
|
277
|
+
var keys = Object.keys(tempDataSource);
|
|
278
|
+
for (var i = 0; i < keys.length; i++) {
|
|
269
279
|
if (tempDataSource[i][this.parent.childMapping] === droppedRecord.taskData[this.parent.childMapping]) {
|
|
270
280
|
idx = i;
|
|
271
281
|
}
|
|
@@ -469,13 +479,34 @@ var RowDD = /** @class */ (function () {
|
|
|
469
479
|
spanContent.innerHTML = content;
|
|
470
480
|
dragelem.querySelector('.e-rowcell').appendChild(ele);
|
|
471
481
|
dragelem.querySelector('.e-rowcell').appendChild(spanContent);
|
|
482
|
+
var dropItemSpan = document.querySelector('.e-dropitemscount');
|
|
483
|
+
if (this.hasDropItem && dropItemSpan) {
|
|
484
|
+
var dropItemLeft = parseInt(dropItemSpan.style.left, 10) + ele.offsetWidth + 16;
|
|
485
|
+
var spanLeft = !this.parent.enableRtl ? dropItemLeft : 0;
|
|
486
|
+
dropItemSpan.style.left = spanLeft + "px";
|
|
487
|
+
this.hasDropItem = false;
|
|
488
|
+
}
|
|
472
489
|
}
|
|
473
490
|
};
|
|
474
491
|
RowDD.prototype.removeErrorElem = function () {
|
|
475
492
|
var errorelem = document.querySelector('.e-errorelem');
|
|
493
|
+
var errorValue = document.querySelector('.errorValue');
|
|
494
|
+
var dropItemSpan = document.querySelector('.e-dropitemscount');
|
|
476
495
|
if (errorelem) {
|
|
496
|
+
if (dropItemSpan) {
|
|
497
|
+
var dropItemLeft = parseInt(dropItemSpan.style.left, 10) - errorelem.offsetWidth - 16;
|
|
498
|
+
setStyleAttribute(errorValue, {
|
|
499
|
+
paddingLeft: '0px'
|
|
500
|
+
});
|
|
501
|
+
if (!this.parent.enableRtl) {
|
|
502
|
+
setStyleAttribute(dropItemSpan, {
|
|
503
|
+
left: dropItemLeft + "px"
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
}
|
|
477
507
|
errorelem.remove();
|
|
478
508
|
}
|
|
509
|
+
this.hasDropItem = true;
|
|
479
510
|
};
|
|
480
511
|
RowDD.prototype.topOrBottomBorder = function (target) {
|
|
481
512
|
var rowElement = [];
|
|
@@ -763,7 +794,7 @@ var RowDD = /** @class */ (function () {
|
|
|
763
794
|
if (!isNullOrUndefined(this.parent.idMapping)) {
|
|
764
795
|
dragRecords.reverse();
|
|
765
796
|
}
|
|
766
|
-
var
|
|
797
|
+
var _loop_1 = function (i) {
|
|
767
798
|
draggedRecord_2 = dragRecords[i];
|
|
768
799
|
this_1.draggedRecord = draggedRecord_2;
|
|
769
800
|
if (this_1.dropPosition !== 'Invalid') {
|
|
@@ -803,6 +834,7 @@ var RowDD = /** @class */ (function () {
|
|
|
803
834
|
}
|
|
804
835
|
if (isNullOrUndefined(droppedRecord.parentItem)) {
|
|
805
836
|
delete draggedRecord_2.parentItem;
|
|
837
|
+
delete draggedRecord_2.parentUniqueID;
|
|
806
838
|
draggedRecord_2.level = 0;
|
|
807
839
|
if (this_1.parent.parentIdMapping) {
|
|
808
840
|
draggedRecord_2[this_1.parent.parentIdMapping] = null;
|
|
@@ -849,7 +881,7 @@ var RowDD = /** @class */ (function () {
|
|
|
849
881
|
};
|
|
850
882
|
var this_1 = this;
|
|
851
883
|
for (var i = 0; i < dragLength; i++) {
|
|
852
|
-
|
|
884
|
+
_loop_1(i);
|
|
853
885
|
}
|
|
854
886
|
}
|
|
855
887
|
};
|
|
@@ -1017,7 +1049,7 @@ var RowDD = /** @class */ (function () {
|
|
|
1017
1049
|
if (childRecords && childRecords.length > 0) {
|
|
1018
1050
|
childIndex = childRecords.indexOf(deletedRow);
|
|
1019
1051
|
flatParentData.childRecords.splice(childIndex, 1);
|
|
1020
|
-
if (!this.parent.parentIdMapping) {
|
|
1052
|
+
if (!this.parent.parentIdMapping || tObj.enableImmutableMode) {
|
|
1021
1053
|
editAction({ value: deletedRow, action: 'delete' }, this.parent, isSelfReference, deletedRow.index, deletedRow.index);
|
|
1022
1054
|
}
|
|
1023
1055
|
}
|
|
@@ -47,7 +47,7 @@ var Toolbar = /** @class */ (function () {
|
|
|
47
47
|
if (args.row.rowIndex === 0 || tObj.getSelectedRecords().length > 1) {
|
|
48
48
|
this.enableItems([tObj.element.id + '_gridcontrol_indent', tObj.element.id + '_gridcontrol_outdent'], false);
|
|
49
49
|
}
|
|
50
|
-
else if (args['name'] !==
|
|
50
|
+
else if (args['name'] !== 'rowDeselected') {
|
|
51
51
|
if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex])) {
|
|
52
52
|
if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex]) &&
|
|
53
53
|
(tObj.getCurrentViewRecords()[args.row.rowIndex].level >
|
|
@@ -69,7 +69,7 @@ var Toolbar = /** @class */ (function () {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
if (args['name'] ===
|
|
72
|
+
if (args['name'] === 'rowDeselected') {
|
|
73
73
|
if (this.parent.toolbar['includes']('Indent')) {
|
|
74
74
|
this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);
|
|
75
75
|
}
|
|
@@ -127,7 +127,8 @@ var DataManipulation = /** @class */ (function () {
|
|
|
127
127
|
this.hierarchyData = data;
|
|
128
128
|
}
|
|
129
129
|
else {
|
|
130
|
-
|
|
130
|
+
var keys = Object.keys(data);
|
|
131
|
+
for (var i = 0; i < keys.length; i++) {
|
|
131
132
|
var tempData = data[i];
|
|
132
133
|
this.hierarchyData.push(extend({}, tempData));
|
|
133
134
|
if (!isNullOrUndefined(tempData[this.parent.idMapping])) {
|
|
@@ -367,7 +368,8 @@ var DataManipulation = /** @class */ (function () {
|
|
|
367
368
|
};
|
|
368
369
|
DataManipulation.prototype.createRecords = function (data, parentRecords) {
|
|
369
370
|
var treeGridData = [];
|
|
370
|
-
|
|
371
|
+
var keys = Object.keys(data);
|
|
372
|
+
for (var i = 0, len = keys.length; i < len; i++) {
|
|
371
373
|
var currentData = extend({}, data[i]);
|
|
372
374
|
currentData.taskData = data[i];
|
|
373
375
|
var level = 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, Ajax, ModuleDeclaration, extend} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue } from '@syncfusion/ej2-base';import {Event, Property, NotifyPropertyChanges, INotifyPropertyChanged, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { Column, ColumnModel } from '../models/column';import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs
|
|
1
|
+
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, Ajax, ModuleDeclaration, extend} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue } from '@syncfusion/ej2-base';import {Event, Property, NotifyPropertyChanges, INotifyPropertyChanged, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { Column, ColumnModel } from '../models/column';import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs } from '@syncfusion/ej2-grids';import { GridModel, ColumnQueryModeType, HeaderCellInfoEventArgs, EditSettingsModel as GridEditModel } from '@syncfusion/ej2-grids';import {RowDragEventArgs, RowDropEventArgs, RowDropSettingsModel, RowDropSettings, getUid } from '@syncfusion/ej2-grids';import { ActionEventArgs, TextAlign } from'@syncfusion/ej2-grids';import { DetailDataBoundEventArgs, ClipMode, ColumnChooser} from '@syncfusion/ej2-grids';import { SearchEventArgs, AddEventArgs, EditEventArgs, DeleteEventArgs} from '@syncfusion/ej2-grids';import { SaveEventArgs, CellSaveArgs, BatchAddArgs, BatchCancelArgs, BeginEditArgs, CellEditArgs} from '@syncfusion/ej2-grids';import { FilterSettings } from '../models/filter-settings';import { TextWrapSettings } from '../models/textwrap-settings';import { TextWrapSettingsModel } from '../models/textwrap-settings-model';import {Filter} from '../actions/filter';import { Logger as TreeLogger } from '../actions/logger';import { BeforeCopyEventArgs, BeforePasteEventArgs } from '@syncfusion/ej2-grids';import { TreeClipboard } from '../actions/clipboard';import {Aggregate} from '../actions/summary';import { Reorder } from '../actions/reorder';import { Resize } from '../actions/resize';import { Selection as TreeGridSelection } from '../actions/selection';import { ColumnMenu } from '../actions/column-menu';import { DetailRow } from '../actions/detail-row';import { Freeze } from '../actions/freeze-column';import { Print } from '../actions/print';import * as events from '../base/constant';import { FilterSettingsModel } from '../models/filter-settings-model';import { SearchSettings} from '../models/search-settings';import { SearchSettingsModel } from '../models/search-settings-model';import {RowInfo, RowDataBoundEventArgs, PageEventArgs, FilterEventArgs, FailureEventArgs, SortEventArgs } from '@syncfusion/ej2-grids';import { RowSelectingEventArgs, RowSelectEventArgs, RowDeselectEventArgs, IIndex, ISelectedCell } from '@syncfusion/ej2-grids';import {ColumnModel as GridColumnModel, Column as GridColumn, CellSelectEventArgs, CellDeselectEventArgs } from '@syncfusion/ej2-grids';import { SelectionSettings } from '../models/selection-settings';import { SelectionSettingsModel } from '../models/selection-settings-model';import {getActualProperties, SortDirection, getObject, ColumnDragEventArgs } from '@syncfusion/ej2-grids';import { PrintMode, Data, IGrid, ContextMenuItemModel } from '@syncfusion/ej2-grids';import { ColumnMenuItem, ColumnMenuItemModel, CheckBoxChangeEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportCompleteArgs, ExcelHeaderQueryCellInfoEventArgs, ExcelQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { PdfExportCompleteArgs, PdfHeaderQueryCellInfoEventArgs, PdfQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportProperties, PdfExportProperties, CellSelectingEventArgs, PrintEventArgs } from '@syncfusion/ej2-grids';import { ColumnMenuOpenEventArgs } from '@syncfusion/ej2-grids';import {BeforeDataBoundArgs} from '@syncfusion/ej2-grids';import { DataManager, ReturnOption, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred } from '@syncfusion/ej2-data';import { createSpinner, hideSpinner, showSpinner, Dialog } from '@syncfusion/ej2-popups';import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';import { Grid, QueryCellInfoEventArgs, Logger } from '@syncfusion/ej2-grids';import { Render } from '../renderer/render';import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';import { DataManipulation } from './data';import { RowDD } from '../actions/rowdragdrop';import { Sort } from '../actions/sort';import { ITreeData, RowExpandedEventArgs, RowCollapsedEventArgs, RowCollapsingEventArgs, TreeGridExcelExportProperties } from './interface';import { CellSaveEventArgs, DataStateChangeEventArgs, RowExpandingEventArgs, TreeGridPdfExportProperties } from './interface';import { iterateArrayOrObject, GridLine } from '@syncfusion/ej2-grids';import { DataSourceChangedEventArgs, RecordDoubleClickEventArgs, ResizeArgs } from '@syncfusion/ej2-grids';import { ToolbarItems, ToolbarItem, ContextMenuItem, ContextMenuItems, RowPosition, CopyHierarchyType } from '../enum';import { ItemModel, ClickEventArgs, BeforeOpenCloseMenuEventArgs, MenuEventArgs } from '@syncfusion/ej2-navigations';import { PageSettings } from '../models/page-settings';import { PageSettingsModel } from '../models/page-settings-model';import { AggregateRow } from '../models/summary';import { AggregateRowModel } from '../models/summary-model';import { ExcelExport } from '../actions/excel-export';import { PdfExport } from '../actions/pdf-export';import { Toolbar } from '../actions/toolbar';import { Page } from '../actions/page';import { ContextMenu } from '../actions/context-menu';import { EditSettings } from '../models/edit-settings';import { EditSettingsModel } from '../models/edit-settings-model';import { Edit} from '../actions/edit';import { SortSettings } from '../models/sort-settings';import { SortSettingsModel } from '../models/sort-settings-model';import { isHidden, getExpandStatus } from '../utils';import { editAction } from '../actions/crud-actions';import { InfiniteScrollSettings } from '../models/infinite-scroll-settings';import { InfiniteScrollSettingsModel } from '../models/infinite-scroll-settings-model';import { TreeActionEventArgs } from '..';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -97,6 +97,8 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
97
97
|
private isExpandRefresh;
|
|
98
98
|
private gridSettings;
|
|
99
99
|
private isEditCollapse;
|
|
100
|
+
private treeColumnTextAlign;
|
|
101
|
+
private treeColumnField;
|
|
100
102
|
/** @hidden */
|
|
101
103
|
initialRender: boolean;
|
|
102
104
|
/** @hidden */
|
|
@@ -1263,6 +1265,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1263
1265
|
* @returns {void}
|
|
1264
1266
|
*/
|
|
1265
1267
|
onPropertyChanged(newProp: TreeGridModel): void;
|
|
1268
|
+
private updateTreeColumnTextAlign;
|
|
1266
1269
|
/**
|
|
1267
1270
|
* Destroys the component (detaches/removes all event handlers, attributes, classes, and empties the component element).
|
|
1268
1271
|
*
|
|
@@ -1531,12 +1534,6 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1531
1534
|
*/
|
|
1532
1535
|
getColumns(isRefresh?: boolean): Column[];
|
|
1533
1536
|
private updateColumnModel;
|
|
1534
|
-
/**
|
|
1535
|
-
* @param {string} columnUid - Defines column uid
|
|
1536
|
-
* @returns {void}
|
|
1537
|
-
* @hidden
|
|
1538
|
-
*/
|
|
1539
|
-
private refreshReactColumnTemplateByUid;
|
|
1540
1537
|
/**
|
|
1541
1538
|
* Gets the content div of the TreeGrid.
|
|
1542
1539
|
*
|
|
@@ -1698,6 +1695,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1698
1695
|
* @returns {void}
|
|
1699
1696
|
*/
|
|
1700
1697
|
collapseRow(row: HTMLTableRowElement, record?: Object, key?: Object): void;
|
|
1698
|
+
private updateExpandStateMapping;
|
|
1701
1699
|
/**
|
|
1702
1700
|
* Expands the records at specific hierarchical level
|
|
1703
1701
|
*
|
|
@@ -1750,6 +1748,15 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1750
1748
|
private updateAltRow;
|
|
1751
1749
|
private treeColumnRowTemplate;
|
|
1752
1750
|
private collapseRemoteChild;
|
|
1751
|
+
/**
|
|
1752
|
+
* Updates the rows and cells
|
|
1753
|
+
*
|
|
1754
|
+
* @param {Object[]} records - Updates the given records
|
|
1755
|
+
* @param {HTMLTableRowElement[]} rows - Updates the given rows
|
|
1756
|
+
* @param {number} index - Updates the given cell index
|
|
1757
|
+
* @returns {void}
|
|
1758
|
+
*/
|
|
1759
|
+
private updateRowAndCellElements;
|
|
1753
1760
|
/**
|
|
1754
1761
|
* @hidden
|
|
1755
1762
|
* @returns {void}
|