@syncfusion/ej2-treegrid 20.3.61 → 20.4.40
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/.eslintrc.json +16 -1
- package/CHANGELOG.md +9 -60
- package/README.md +64 -51
- 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 +1198 -910
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +1256 -946
- 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 +17 -11
- package/src/treegrid/actions/batch-edit.js +82 -82
- package/src/treegrid/actions/clipboard.js +34 -33
- package/src/treegrid/actions/context-menu.js +1 -1
- package/src/treegrid/actions/crud-actions.js +62 -55
- package/src/treegrid/actions/detail-row.js +7 -7
- package/src/treegrid/actions/edit.js +61 -60
- package/src/treegrid/actions/excel-export.js +2 -2
- package/src/treegrid/actions/filter.js +13 -13
- package/src/treegrid/actions/freeze-column.js +9 -8
- package/src/treegrid/actions/infinite-scroll.js +19 -19
- package/src/treegrid/actions/logger.js +10 -10
- package/src/treegrid/actions/page.js +8 -8
- package/src/treegrid/actions/reorder.js +2 -2
- package/src/treegrid/actions/rowdragdrop.js +88 -82
- package/src/treegrid/actions/selection.js +34 -32
- package/src/treegrid/actions/sort.js +7 -6
- package/src/treegrid/actions/summary.js +24 -24
- package/src/treegrid/actions/toolbar.js +2 -2
- package/src/treegrid/base/data.js +242 -55
- package/src/treegrid/base/treegrid-model.d.ts +20 -4
- package/src/treegrid/base/treegrid.d.ts +24 -5
- package/src/treegrid/base/treegrid.js +232 -192
- package/src/treegrid/models/column.js +3 -3
- package/src/treegrid/models/index.d.ts +2 -0
- package/src/treegrid/models/index.js +1 -0
- package/src/treegrid/models/loading-indicator-model.d.ts +19 -0
- package/src/treegrid/models/loading-indicator.d.ts +16 -0
- package/src/treegrid/models/loading-indicator.js +34 -0
- package/src/treegrid/renderer/render.js +20 -19
- package/src/treegrid/renderer/virtual-row-model-generator.js +6 -5
- package/src/treegrid/renderer/virtual-tree-content-render.js +128 -99
- package/src/treegrid/utils.js +12 -11
|
@@ -82,11 +82,11 @@ var Column = /** @class */ (function () {
|
|
|
82
82
|
//Angular two way binding
|
|
83
83
|
var keys = Object.keys(column);
|
|
84
84
|
for (var i = 0; i < keys.length; i++) {
|
|
85
|
-
this[keys[i]] = column[keys[i]];
|
|
85
|
+
this[keys[parseInt(i.toString(), 10)]] = column[keys[parseInt(i.toString(), 10)]];
|
|
86
86
|
//Refresh the react columnTemplates on state change
|
|
87
|
-
if (this.parent && this.parent['isReact'] && keys[i] === 'template') {
|
|
87
|
+
if (this.parent && this.parent['isReact'] && keys[parseInt(i.toString(), 10)] === 'template') {
|
|
88
88
|
var refreshReactColumnTemplateByUid = 'refreshReactColumnTemplateByUid';
|
|
89
|
-
this.parent.clipboardModule['treeGridParent'].renderModule[refreshReactColumnTemplateByUid](this.uid);
|
|
89
|
+
this.parent.clipboardModule['treeGridParent'].renderModule["" + refreshReactColumnTemplateByUid](this.uid);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Property, ChildProperty } from '@syncfusion/ej2-base';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interface for a class LoadingIndicator
|
|
5
|
+
*/
|
|
6
|
+
export interface LoadingIndicatorModel {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Defines the loading indicator. The available loading indicator are:
|
|
10
|
+
* * Spinner
|
|
11
|
+
* * Shimmer
|
|
12
|
+
* @default Syncfusion.EJ2.Grids.IndicatorType.Spinner
|
|
13
|
+
* @isEnumeration true
|
|
14
|
+
* @aspType Syncfusion.EJ2.Grids.IndicatorType
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
indicatorType?: IndicatorType;
|
|
18
|
+
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChildProperty } from '@syncfusion/ej2-base';
|
|
2
|
+
import { IndicatorType } from '@syncfusion/ej2-grids';
|
|
3
|
+
/**
|
|
4
|
+
* Configures the Loading Indicator of the Tree Grid.
|
|
5
|
+
*/
|
|
6
|
+
export declare class LoadingIndicator extends ChildProperty<LoadingIndicator> {
|
|
7
|
+
/**
|
|
8
|
+
* Defines the loading indicator. The available loading indicator are:
|
|
9
|
+
* * Spinner
|
|
10
|
+
* * Shimmer
|
|
11
|
+
* @default Syncfusion.EJ2.Grids.IndicatorType.Spinner
|
|
12
|
+
* @isEnumeration true
|
|
13
|
+
* @aspType Syncfusion.EJ2.Grids.IndicatorType
|
|
14
|
+
*/
|
|
15
|
+
indicatorType: IndicatorType;
|
|
16
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { Property, ChildProperty } from '@syncfusion/ej2-base';
|
|
21
|
+
/**
|
|
22
|
+
* Configures the Loading Indicator of the Tree Grid.
|
|
23
|
+
*/
|
|
24
|
+
var LoadingIndicator = /** @class */ (function (_super) {
|
|
25
|
+
__extends(LoadingIndicator, _super);
|
|
26
|
+
function LoadingIndicator() {
|
|
27
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
28
|
+
}
|
|
29
|
+
__decorate([
|
|
30
|
+
Property('Spinner')
|
|
31
|
+
], LoadingIndicator.prototype, "indicatorType", void 0);
|
|
32
|
+
return LoadingIndicator;
|
|
33
|
+
}(ChildProperty));
|
|
34
|
+
export { LoadingIndicator };
|
|
@@ -99,7 +99,7 @@ var Render = /** @class */ (function () {
|
|
|
99
99
|
var columnIndex;
|
|
100
100
|
var getVirtualColIndexByUid = 'getVirtualColIndexByUid';
|
|
101
101
|
if (this.parent.enableColumnVirtualization && !this.parent.initialRender) {
|
|
102
|
-
columnIndex = this.parent[getVirtualColIndexByUid](args.column.uid);
|
|
102
|
+
columnIndex = this.parent["" + getVirtualColIndexByUid](args.column.uid);
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
105
105
|
columnIndex = grid.getColumnIndexByUid(args.column.uid);
|
|
@@ -237,7 +237,7 @@ var Render = /** @class */ (function () {
|
|
|
237
237
|
}
|
|
238
238
|
if (treeColumn.field === args.column.field && !isNullOrUndefined(treeColumn.template)) {
|
|
239
239
|
args.column.template = treeColumn.template;
|
|
240
|
-
args.column[templateFn] = templateCompiler(args.column.template);
|
|
240
|
+
args.column["" + templateFn] = templateCompiler(args.column.template);
|
|
241
241
|
args.cell.classList.add('e-templatecell');
|
|
242
242
|
}
|
|
243
243
|
var textContent = args.cell.querySelector('.e-treecell') != null ?
|
|
@@ -254,25 +254,25 @@ var Render = /** @class */ (function () {
|
|
|
254
254
|
var portals = 'portals';
|
|
255
255
|
var renderReactTemplates = 'renderReactTemplates';
|
|
256
256
|
if (this.parent.isReact && typeof (args.column.template) !== 'string') {
|
|
257
|
-
args.column[templateFn](args.data, this.parent, 'template', tempID, null, null, cellElement);
|
|
258
|
-
if (isNullOrUndefined(this.parent.grid[portals])) {
|
|
259
|
-
this.parent.grid[portals] = this.parent[portals];
|
|
257
|
+
args.column["" + templateFn](args.data, this.parent, 'template', tempID, null, null, cellElement);
|
|
258
|
+
if (isNullOrUndefined(this.parent.grid["" + portals])) {
|
|
259
|
+
this.parent.grid["" + portals] = this.parent["" + portals];
|
|
260
260
|
}
|
|
261
|
-
this.parent.notify('renderReactTemplate', this.parent[portals]);
|
|
262
|
-
this.parent[renderReactTemplates]();
|
|
261
|
+
this.parent.notify('renderReactTemplate', this.parent["" + portals]);
|
|
262
|
+
this.parent["" + renderReactTemplates]();
|
|
263
263
|
}
|
|
264
264
|
else {
|
|
265
265
|
var str = 'isStringTemplate';
|
|
266
|
-
var result = args.column[templateFn](extend({ 'index': '' }, args.data), this.parent, 'template', tempID, this.parent[str]);
|
|
266
|
+
var result = args.column["" + templateFn](extend({ 'index': '' }, args.data), this.parent, 'template', tempID, this.parent["" + str]);
|
|
267
267
|
appendChildren(cellElement, result);
|
|
268
268
|
}
|
|
269
269
|
delete args.column.template;
|
|
270
|
-
delete args.column[templateFn];
|
|
270
|
+
delete args.column["" + templateFn];
|
|
271
271
|
args.cell.innerHTML = '';
|
|
272
272
|
}
|
|
273
273
|
else {
|
|
274
274
|
for (var i = 0; i < len; len = args.cell.children.length) {
|
|
275
|
-
cellElement.appendChild(args.cell.children[i]);
|
|
275
|
+
cellElement.appendChild(args.cell.children[parseInt(i.toString(), 10)]);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
}
|
|
@@ -297,13 +297,14 @@ var Render = /** @class */ (function () {
|
|
|
297
297
|
var indent = _this.parent.grid.getIndentCount();
|
|
298
298
|
var cellIndex = _this.parent.grid.getNormalizedColumnIndex(columnUid);
|
|
299
299
|
for (var j = 0; j < rowsObj.length; j++) {
|
|
300
|
-
if (rowsObj[j].isDataRow && !isNullOrUndefined(rowsObj[j].index)) {
|
|
301
|
-
var cell = rowsObj[j][cells][cellIndex];
|
|
300
|
+
if (rowsObj[parseInt(j.toString(), 10)].isDataRow && !isNullOrUndefined(rowsObj[parseInt(j.toString(), 10)].index)) {
|
|
301
|
+
var cell = rowsObj[parseInt(j.toString(), 10)]["" + cells][parseInt(cellIndex.toString(), 10)];
|
|
302
302
|
var cellRenderer = new CellRenderer(_this.parent.grid, _this.parent.grid.serviceLocator);
|
|
303
|
-
var td = _this.parent.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
|
|
304
|
-
cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
|
|
305
|
-
var treecell = _this.parent.getRows()[j
|
|
306
|
-
|
|
303
|
+
var td = _this.parent.getCellFromIndex(rowsObj[parseInt(j.toString(), 10)].index, cellIndex - indent);
|
|
304
|
+
cellRenderer.refreshTD(td, cell, rowsObj[parseInt(j.toString(), 10)].data, { index: rowsObj[parseInt(j.toString(), 10)]["" + rowIdx] });
|
|
305
|
+
var treecell = _this.parent.getRows()[parseInt(j.toString(), 10)]
|
|
306
|
+
.cells[parseInt(cellIndex.toString(), 10)];
|
|
307
|
+
_this.cellRender({ data: rowsObj[parseInt(j.toString(), 10)].data, cell: treecell, column: cell.column });
|
|
307
308
|
}
|
|
308
309
|
}
|
|
309
310
|
});
|
|
@@ -315,9 +316,9 @@ var Render = /** @class */ (function () {
|
|
|
315
316
|
Render.prototype.reactTemplateRender = function (args) {
|
|
316
317
|
var renderReactTemplates = 'renderReactTemplates';
|
|
317
318
|
var portals = 'portals';
|
|
318
|
-
this.parent[portals] = args;
|
|
319
|
-
this.parent.notify('renderReactTemplate', this.parent[portals]);
|
|
320
|
-
this.parent[renderReactTemplates]();
|
|
319
|
+
this.parent["" + portals] = args;
|
|
320
|
+
this.parent.notify('renderReactTemplate', this.parent["" + portals]);
|
|
321
|
+
this.parent["" + renderReactTemplates]();
|
|
321
322
|
};
|
|
322
323
|
Render.prototype.destroy = function () {
|
|
323
324
|
this.parent.grid.off('template-result', this.columnTemplateResult);
|
|
@@ -69,7 +69,7 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
|
|
|
69
69
|
}
|
|
70
70
|
var rows = _super.prototype.generateRows.call(this, data, notifyArgs);
|
|
71
71
|
for (var r = 0; r < rows.length; r++) {
|
|
72
|
-
rows[r].index = (this.visualData).indexOf(rows[r].data);
|
|
72
|
+
rows[parseInt(r.toString(), 10)].index = (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
|
|
73
73
|
}
|
|
74
74
|
return rows;
|
|
75
75
|
}
|
|
@@ -80,7 +80,7 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
|
|
|
80
80
|
if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
81
81
|
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
|
|
82
82
|
var model = 'model';
|
|
83
|
-
var currentPage = this[model].currentPage;
|
|
83
|
+
var currentPage = this["" + model].currentPage;
|
|
84
84
|
if (clear) {
|
|
85
85
|
this.cache = {};
|
|
86
86
|
this.movableCache = {};
|
|
@@ -88,9 +88,10 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
|
|
|
88
88
|
this.data = {};
|
|
89
89
|
this.groups = {};
|
|
90
90
|
}
|
|
91
|
-
else if (action === 'virtualscroll' && this.cache[currentPage] &&
|
|
92
|
-
this.cache[currentPage].length >
|
|
93
|
-
|
|
91
|
+
else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&
|
|
92
|
+
this.cache[parseInt(currentPage.toString(), 10)].length >
|
|
93
|
+
(this.parent.contentModule).getBlockSize()) {
|
|
94
|
+
delete this.cache[parseInt(currentPage.toString(), 10)];
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
else {
|