@syncfusion/ej2-treegrid 21.2.8 → 21.2.9
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 +13 -1
- package/dist/ej2-treegrid.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +141 -97
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +203 -136
- 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 +8 -8
- package/src/treegrid/actions/edit.js +6 -1
- package/src/treegrid/actions/rowdragdrop.js +4 -5
- package/src/treegrid/actions/virtual-scroll.js +6 -3
- package/src/treegrid/base/treegrid.js +12 -2
- package/src/treegrid/models/column-model.d.ts +30 -0
- package/src/treegrid/models/column.d.ts +32 -0
- package/src/treegrid/models/column.js +45 -1
- package/src/treegrid/renderer/render.js +2 -1
- package/src/treegrid/renderer/virtual-tree-content-render.js +10 -3
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 21.2.
|
|
3
|
+
* version : 21.2.9
|
|
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@21.2.
|
|
3
|
+
"_id": "@syncfusion/ej2-treegrid@21.2.8",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-YiqZ/KpWwbgUoxWXdQt7oXZEaAcc+ZvW4Jf22/wOVt64lGs3Qg+LrJk0rC0Z+XT1t+L7GJjvzVrq9nd1Niwsew==",
|
|
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": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-21.2.
|
|
28
|
-
"_shasum": "
|
|
27
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-21.2.8.tgz",
|
|
28
|
+
"_shasum": "33c37b706fce617fed0f97a2fcf9cde1814a8dcd",
|
|
29
29
|
"_spec": "@syncfusion/ej2-treegrid@*",
|
|
30
30
|
"_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
|
|
31
31
|
"author": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
},
|
|
37
37
|
"bundleDependencies": false,
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@syncfusion/ej2-base": "~21.2.
|
|
40
|
-
"@syncfusion/ej2-data": "~21.2.
|
|
41
|
-
"@syncfusion/ej2-grids": "~21.2.
|
|
39
|
+
"@syncfusion/ej2-base": "~21.2.9",
|
|
40
|
+
"@syncfusion/ej2-data": "~21.2.9",
|
|
41
|
+
"@syncfusion/ej2-grids": "~21.2.9",
|
|
42
42
|
"@syncfusion/ej2-popups": "~21.2.4"
|
|
43
43
|
},
|
|
44
44
|
"deprecated": false,
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"url": "git+https://github.com/syncfusion/ej2-treegrid.git"
|
|
67
67
|
},
|
|
68
68
|
"typings": "index.d.ts",
|
|
69
|
-
"version": "21.2.
|
|
69
|
+
"version": "21.2.9",
|
|
70
70
|
"sideEffects": false
|
|
71
71
|
}
|
|
@@ -68,6 +68,9 @@ var Edit = /** @class */ (function () {
|
|
|
68
68
|
};
|
|
69
69
|
Edit.prototype.gridDblClick = function (e) {
|
|
70
70
|
this.doubleClickTarget = e.target;
|
|
71
|
+
if (e.target.classList.contains('e-frame') && this.parent.getCurrentViewRecords().length === 0) {
|
|
72
|
+
this.doubleClickTarget = null;
|
|
73
|
+
}
|
|
71
74
|
};
|
|
72
75
|
Edit.prototype.getRowPosition = function (addArgs) {
|
|
73
76
|
addArgs.newRowPosition = this.parent.editSettings.newRowPosition;
|
|
@@ -75,7 +78,9 @@ var Edit = /** @class */ (function () {
|
|
|
75
78
|
addArgs.dataRowIndex = +this.prevAriaRowIndex;
|
|
76
79
|
};
|
|
77
80
|
Edit.prototype.beforeStartEdit = function (args) {
|
|
78
|
-
this.parent.
|
|
81
|
+
if (this.parent.editSettings.mode === 'Cell') {
|
|
82
|
+
this.parent.trigger(events.actionBegin, args);
|
|
83
|
+
}
|
|
79
84
|
};
|
|
80
85
|
Edit.prototype.beforeBatchCancel = function (args) {
|
|
81
86
|
if (this.parent.editSettings.mode === 'Cell') {
|
|
@@ -996,14 +996,13 @@ var RowDD = /** @class */ (function () {
|
|
|
996
996
|
var childRecords = rec[0].childRecords;
|
|
997
997
|
var droppedRecordIndex = childRecords.indexOf(droppedRecord) + 1;
|
|
998
998
|
childRecords.splice(droppedRecordIndex, 0, draggedRecord_2);
|
|
999
|
-
|
|
1000
|
-
draggedRecord_2.parentItem = droppedRecord.parentItem;
|
|
1001
|
-
draggedRecord_2.level = droppedRecord.level;
|
|
1002
|
-
}
|
|
999
|
+
draggedRecord_2.parentItem = droppedRecord.parentItem;
|
|
1003
1000
|
draggedRecord_2.parentUniqueID = droppedRecord.parentUniqueID;
|
|
1001
|
+
draggedRecord_2.level = droppedRecord.level;
|
|
1004
1002
|
if (this_1.parent.parentIdMapping) {
|
|
1005
1003
|
draggedRecord_2[this_1.parent.parentIdMapping] = droppedRecord[this_1.parent.parentIdMapping];
|
|
1006
|
-
draggedRecord_2.
|
|
1004
|
+
draggedRecord_2.parentItem = droppedRecord.parentItem;
|
|
1005
|
+
draggedRecord_2.level = droppedRecord.level;
|
|
1007
1006
|
}
|
|
1008
1007
|
}
|
|
1009
1008
|
if (draggedRecord_2.hasChildRecords) {
|
|
@@ -18,7 +18,7 @@ import * as events from '../base/constant';
|
|
|
18
18
|
import { DataManager, Predicate, Query } from '@syncfusion/ej2-data';
|
|
19
19
|
import { getExpandStatus } from '../utils';
|
|
20
20
|
import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';
|
|
21
|
-
import { VirtualHeaderRenderer } from '@syncfusion/ej2-grids';
|
|
21
|
+
import { VirtualHeaderRenderer, getTransformValues } from '@syncfusion/ej2-grids';
|
|
22
22
|
/**
|
|
23
23
|
* TreeGrid Virtual Scroll module will handle Virtualization
|
|
24
24
|
*
|
|
@@ -125,13 +125,16 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
125
125
|
this.parent.grid.notify(events.virtualActionArgs, { setTop: true });
|
|
126
126
|
}
|
|
127
127
|
if (requestType === 'save') {
|
|
128
|
+
startIndex = counts.startIndex + (counts.count - counts.endIndex);
|
|
128
129
|
endIndex = counts.count;
|
|
129
130
|
}
|
|
130
131
|
//if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&
|
|
131
132
|
//this.prevendIndex === endIndex && this.prevstartIndex === startIndex) {
|
|
133
|
+
var virtualWrapperElement = this.parent.grid.contentModule.virtualEle.wrapper;
|
|
134
|
+
var translateY = getTransformValues(virtualWrapperElement).height;
|
|
132
135
|
if (!isNullOrUndefined(this.expandCollapseRec) && (pageingDetails.actionArgs.requestType === 'virtualscroll' ||
|
|
133
136
|
(pageingDetails.actionArgs.requestType === 'refresh' && startIndex !== this.prevstartIndex)) &&
|
|
134
|
-
(startIndex < this.parent.getRows().length && endIndex <= startIndex + this.parent.getRows().length)) {
|
|
137
|
+
(startIndex < this.parent.getRows().length && endIndex <= startIndex + this.parent.getRows().length) && translateY === 0) {
|
|
135
138
|
startIndex = 0;
|
|
136
139
|
}
|
|
137
140
|
if (!isNullOrUndefined(this.expandCollapseRec)) {
|
|
@@ -211,7 +214,7 @@ var TreeVirtual = /** @class */ (function (_super) {
|
|
|
211
214
|
if (!isNullOrUndefined(parentGrid.height) && typeof (parentGrid.height) === 'string' && parentGrid.height.indexOf('%') !== -1) {
|
|
212
215
|
parentGrid.element.style.height = parentGrid.height;
|
|
213
216
|
}
|
|
214
|
-
var vHeight = parentGrid.height.toString().indexOf('%') < 0 ? parentGrid.height :
|
|
217
|
+
var vHeight = parentGrid.height.toString().indexOf('%') < 0 ? parseInt(parentGrid.height.toString(), 10) :
|
|
215
218
|
parentGrid.element.getBoundingClientRect().height;
|
|
216
219
|
var blockSize = ~~(vHeight / rowHeight);
|
|
217
220
|
var height = blockSize * 2;
|
|
@@ -2658,7 +2658,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2658
2658
|
}
|
|
2659
2659
|
else {
|
|
2660
2660
|
if (this.enableVirtualization && this.isCollapseAll) {
|
|
2661
|
-
|
|
2661
|
+
if (this.isExpandAll && row.rowIndex === -1) {
|
|
2662
|
+
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
|
|
2663
|
+
}
|
|
2664
|
+
else {
|
|
2665
|
+
record = this.grid.getCurrentViewRecords()[row.rowIndex];
|
|
2666
|
+
}
|
|
2662
2667
|
}
|
|
2663
2668
|
else {
|
|
2664
2669
|
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
|
|
@@ -2897,7 +2902,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2897
2902
|
}
|
|
2898
2903
|
}
|
|
2899
2904
|
else {
|
|
2900
|
-
this.
|
|
2905
|
+
if (!this.enableVirtualization) {
|
|
2906
|
+
this.expandRow(rows[parseInt(i.toString(), 10)]);
|
|
2907
|
+
}
|
|
2908
|
+
else if (rows[0].getAttribute('aria-expanded') !== 'true') {
|
|
2909
|
+
this.expandRow(rows[0]);
|
|
2910
|
+
}
|
|
2901
2911
|
}
|
|
2902
2912
|
}
|
|
2903
2913
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TextAlign, ClipMode, ValueAccessor, IFilter, IFilterUI, IEditCell, CommandModel, freezeDirection } from '@syncfusion/ej2-grids';import { NumberFormatOptions, DateFormatOptions, merge, Property } from '@syncfusion/ej2-base';import { ITreeGridCellFormatter } from '../base/interface';import { SortComparer} from '@syncfusion/ej2-grids';import { TreeGrid } from '..';
|
|
2
|
+
import {ColumnModel} from "./column";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface for a class Column
|
|
6
|
+
*/
|
|
7
|
+
export interface ColumnModel {
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Interface for a class TreeGridColumn
|
|
13
|
+
*/
|
|
14
|
+
export interface TreeGridColumnModel extends ColumnModel{
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Defines stacked columns
|
|
18
|
+
*
|
|
19
|
+
* @default null
|
|
20
|
+
*/
|
|
21
|
+
columns?: string[] | ColumnModel[];
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Interface for a class StackedColumn
|
|
27
|
+
*/
|
|
28
|
+
export interface StackedColumnModel extends TreeGridColumnModel{
|
|
29
|
+
|
|
30
|
+
}
|
|
@@ -709,3 +709,35 @@ export interface ColumnModel {
|
|
|
709
709
|
*/
|
|
710
710
|
freeze?: freezeDirection;
|
|
711
711
|
}
|
|
712
|
+
/**
|
|
713
|
+
* Defines TreeGrid column
|
|
714
|
+
*/
|
|
715
|
+
export declare class TreeGridColumn extends Column {
|
|
716
|
+
/**
|
|
717
|
+
* Defines stacked columns
|
|
718
|
+
*
|
|
719
|
+
* @default null
|
|
720
|
+
*/
|
|
721
|
+
columns: string[] | ColumnModel[];
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Interface for a class TreeGridColumn
|
|
725
|
+
*/
|
|
726
|
+
export interface TreeGridColumnModel extends ColumnModel {
|
|
727
|
+
/**
|
|
728
|
+
* Defines stacked columns
|
|
729
|
+
*
|
|
730
|
+
* @default null
|
|
731
|
+
*/
|
|
732
|
+
columns?: string[] | ColumnModel[];
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Defines stacked tree grid column
|
|
736
|
+
*/
|
|
737
|
+
export declare class StackedColumn extends TreeGridColumn {
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Interface for a class stacked tree grid column
|
|
741
|
+
*/
|
|
742
|
+
export interface StackedColumnModel extends TreeGridColumnModel {
|
|
743
|
+
}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
};
|
|
20
|
+
import { merge, Property } from '@syncfusion/ej2-base';
|
|
2
21
|
/**
|
|
3
22
|
* Represents TreeGrid `Column` model class.
|
|
4
23
|
*/
|
|
@@ -93,3 +112,28 @@ var Column = /** @class */ (function () {
|
|
|
93
112
|
return Column;
|
|
94
113
|
}());
|
|
95
114
|
export { Column };
|
|
115
|
+
/**
|
|
116
|
+
* Defines TreeGrid column
|
|
117
|
+
*/
|
|
118
|
+
var TreeGridColumn = /** @class */ (function (_super) {
|
|
119
|
+
__extends(TreeGridColumn, _super);
|
|
120
|
+
function TreeGridColumn() {
|
|
121
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
122
|
+
}
|
|
123
|
+
__decorate([
|
|
124
|
+
Property(null)
|
|
125
|
+
], TreeGridColumn.prototype, "columns", void 0);
|
|
126
|
+
return TreeGridColumn;
|
|
127
|
+
}(Column));
|
|
128
|
+
export { TreeGridColumn };
|
|
129
|
+
/**
|
|
130
|
+
* Defines stacked tree grid column
|
|
131
|
+
*/
|
|
132
|
+
var StackedColumn = /** @class */ (function (_super) {
|
|
133
|
+
__extends(StackedColumn, _super);
|
|
134
|
+
function StackedColumn() {
|
|
135
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
136
|
+
}
|
|
137
|
+
return StackedColumn;
|
|
138
|
+
}(TreeGridColumn));
|
|
139
|
+
export { StackedColumn };
|
|
@@ -41,7 +41,7 @@ var Render = /** @class */ (function () {
|
|
|
41
41
|
if (collapsed && !isNullOrUndefined(args.row)) {
|
|
42
42
|
args.row.style.display = 'none';
|
|
43
43
|
var rowsObj = this.parent.grid.getRowsObject();
|
|
44
|
-
if (!isNullOrUndefined(args.row.getAttribute('data-uid'))) {
|
|
44
|
+
if (!this.parent.grid.isFrozenGrid() && !isNullOrUndefined(args.row.getAttribute('data-uid'))) {
|
|
45
45
|
rowsObj.filter(function (e) { return e.uid === args.row.getAttribute('data-uid'); })[0].visible = false;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -227,6 +227,7 @@ var Render = /** @class */ (function () {
|
|
|
227
227
|
if (summaryRow) {
|
|
228
228
|
addClass([args.cell], 'e-summarycell');
|
|
229
229
|
var summaryData = getObject(args.column.field, args.data);
|
|
230
|
+
summaryData = isNullOrUndefined(summaryData) ? null : summaryData;
|
|
230
231
|
if (args.cell.querySelector('.e-treecell') != null) {
|
|
231
232
|
args.cell.querySelector('.e-treecell').innerHTML = summaryData;
|
|
232
233
|
}
|
|
@@ -384,7 +384,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
384
384
|
var currentViewData = this.parent.currentViewData;
|
|
385
385
|
var indexValue = 'index';
|
|
386
386
|
if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
|
|
387
|
-
var vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :
|
|
387
|
+
var vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? parseInt(this.parent.height.toString(), 10) :
|
|
388
388
|
this.parent.element.getBoundingClientRect().height);
|
|
389
389
|
var index = (~~(content.scrollTop / rowHeight)
|
|
390
390
|
+ Math.ceil(vHeight / rowHeight))
|
|
@@ -443,7 +443,9 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
443
443
|
}
|
|
444
444
|
this.startIndex = !isLastBlock ? lastIndex - this.parent.pageSettings.pageSize : nextSetResIndex;
|
|
445
445
|
this.endIndex = lastIndex;
|
|
446
|
-
if ((nextSetResIndex + this.parent.pageSettings.pageSize) > this.totalRecords &&
|
|
446
|
+
if ((nextSetResIndex + this.parent.pageSettings.pageSize) > this.totalRecords &&
|
|
447
|
+
(this.endIndex - this.startIndex) < (this.parent.pageSettings.pageSize / 2) &&
|
|
448
|
+
(this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
|
|
447
449
|
this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
|
|
448
450
|
}
|
|
449
451
|
if (currentViewData.length && this.startIndex > currentViewData[0]["" + indexValue] &&
|
|
@@ -458,7 +460,12 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
458
460
|
this.translateY = scrollArgs.offset.top - rowHeight * 2;
|
|
459
461
|
}
|
|
460
462
|
else {
|
|
461
|
-
this.
|
|
463
|
+
if (this.totalRecords == this.endIndex) {
|
|
464
|
+
this.translateY = scrollArgs.offset.top - (rowHeight - outBuffer);
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
this.translateY = scrollArgs.offset.top;
|
|
468
|
+
}
|
|
462
469
|
}
|
|
463
470
|
}
|
|
464
471
|
}
|