@syncfusion/ej2-treegrid 21.2.9 → 22.1.34
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 +1 -0
- package/CHANGELOG.md +4 -80
- 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 +55 -20
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +57 -22
- 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/edit.js +23 -9
- package/src/treegrid/actions/freeze-column.js +5 -1
- package/src/treegrid/actions/summary.js +1 -0
- package/src/treegrid/actions/virtual-scroll.js +2 -1
- package/src/treegrid/base/treegrid-model.d.ts +9 -4
- package/src/treegrid/base/treegrid.d.ts +10 -4
- package/src/treegrid/base/treegrid.js +14 -6
- package/src/treegrid/models/column.d.ts +18 -10
- package/src/treegrid/models/edit-settings-model.d.ts +2 -1
- package/src/treegrid/models/edit-settings.d.ts +2 -1
- package/src/treegrid/models/page-settings-model.d.ts +2 -1
- package/src/treegrid/models/page-settings.d.ts +2 -1
- package/src/treegrid/models/summary-model.d.ts +3 -1
- package/src/treegrid/models/summary.d.ts +3 -1
- package/src/treegrid/renderer/render.js +7 -1
- package/src/treegrid/renderer/virtual-tree-content-render.js +6 -5
- package/styles/material3-dark.css +545 -0
- package/styles/material3-dark.scss +3 -0
- package/styles/material3.css +601 -0
- package/styles/material3.scss +3 -0
- package/styles/treegrid/_material3-dark-definition.scss +1 -0
- package/styles/treegrid/_material3-definition.scss +28 -0
- package/styles/treegrid/icons/_material3-dark.scss +1 -0
- package/styles/treegrid/icons/_material3.scss +12 -1
- package/styles/treegrid/material3-dark.css +545 -0
- package/styles/treegrid/material3-dark.scss +19 -0
- package/styles/treegrid/material3.css +601 -0
- package/styles/treegrid/material3.scss +19 -0
|
@@ -1775,7 +1775,12 @@ var Render = /** @__PURE__ @class */ (function () {
|
|
|
1775
1775
|
var iconRequired = !isNullOrUndefined(data.hasFilteredChildRecords)
|
|
1776
1776
|
? data.hasFilteredChildRecords : data.hasChildRecords;
|
|
1777
1777
|
if (iconRequired && !isNullOrUndefined(data.childRecords)) {
|
|
1778
|
-
|
|
1778
|
+
if (this.parent['isFromGantt'] && !this.parent.loadChildOnDemand) {
|
|
1779
|
+
iconRequired = data.hasChildRecords;
|
|
1780
|
+
}
|
|
1781
|
+
else {
|
|
1782
|
+
iconRequired = !(data.childRecords.length === 0);
|
|
1783
|
+
}
|
|
1779
1784
|
}
|
|
1780
1785
|
if (iconRequired) {
|
|
1781
1786
|
addClass([args.cell], 'e-treerowcell');
|
|
@@ -1894,6 +1899,7 @@ var Render = /** @__PURE__ @class */ (function () {
|
|
|
1894
1899
|
args.cell.setAttribute('data-colindex', colindex + '');
|
|
1895
1900
|
}
|
|
1896
1901
|
if (treeColumn.field === args.column.field && !isNullOrUndefined(treeColumn.template)) {
|
|
1902
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
1897
1903
|
args.column.template = treeColumn.template;
|
|
1898
1904
|
args.column["" + templateFn] = templateCompiler(args.column.template);
|
|
1899
1905
|
args.cell.classList.add('e-templatecell');
|
|
@@ -4291,7 +4297,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4291
4297
|
this.grid.query = this.query;
|
|
4292
4298
|
this.grid.columnQueryMode = this.columnQueryMode;
|
|
4293
4299
|
this.grid.allowPaging = this.allowPaging;
|
|
4300
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4294
4301
|
this.grid.pageSettings = getActualProperties(this.pageSettings);
|
|
4302
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4295
4303
|
this.grid.pagerTemplate = this.pagerTemplate;
|
|
4296
4304
|
this.grid.showColumnMenu = this.showColumnMenu;
|
|
4297
4305
|
this.grid.allowSorting = this.allowSorting;
|
|
@@ -4318,12 +4326,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4318
4326
|
this.grid.gridLines = this.gridLines;
|
|
4319
4327
|
this.grid.allowSelection = this.allowSelection;
|
|
4320
4328
|
this.grid.toolbar = getActualProperties(this.getGridToolbar());
|
|
4329
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4321
4330
|
this.grid.toolbarTemplate = this.toolbarTemplate;
|
|
4322
4331
|
this.grid.showColumnChooser = this.showColumnChooser;
|
|
4323
4332
|
this.grid.filterSettings = getActualProperties(this.filterSettings);
|
|
4324
4333
|
this.grid.selectionSettings = getActualProperties(this.selectionSettings);
|
|
4325
4334
|
this.grid.sortSettings = getActualProperties(this.sortSettings);
|
|
4326
4335
|
this.grid.searchSettings = getActualProperties(this.searchSettings);
|
|
4336
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4327
4337
|
this.grid.aggregates = getActualProperties(this.aggregates);
|
|
4328
4338
|
this.grid.textWrapSettings = getActualProperties(this.textWrapSettings);
|
|
4329
4339
|
this.grid.printMode = getActualProperties(this.printMode);
|
|
@@ -4332,7 +4342,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4332
4342
|
this.grid.contextMenuItems = getActualProperties(this.getContextMenu());
|
|
4333
4343
|
this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);
|
|
4334
4344
|
this.grid.editSettings = this.getGridEditSettings();
|
|
4345
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4335
4346
|
this.grid.rowTemplate = getActualProperties(this.rowTemplate);
|
|
4347
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4336
4348
|
this.grid.detailTemplate = getActualProperties(this.detailTemplate);
|
|
4337
4349
|
this.grid.frozenRows = this.frozenRows;
|
|
4338
4350
|
this.grid.frozenColumns = this.frozenColumns;
|
|
@@ -4662,10 +4674,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4662
4674
|
var currentData = _this.getCurrentViewRecords();
|
|
4663
4675
|
var rows = _this.getContentTable().rows;
|
|
4664
4676
|
for (var i = 0; i < rows.length; i++) {
|
|
4665
|
-
var args = {
|
|
4666
|
-
|
|
4667
|
-
row: rows[parseInt(i.toString(), 10)]
|
|
4668
|
-
};
|
|
4677
|
+
var args = { data: currentData[parseInt(i.toString(), 10)],
|
|
4678
|
+
row: rows[parseInt(i.toString(), 10)] };
|
|
4669
4679
|
_this.renderModule.RowModifier(args);
|
|
4670
4680
|
}
|
|
4671
4681
|
}
|
|
@@ -5124,6 +5134,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5124
5134
|
this.grid.allowPaging = this.allowPaging;
|
|
5125
5135
|
break;
|
|
5126
5136
|
case 'pageSettings':
|
|
5137
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
5127
5138
|
this.grid.pageSettings = getActualProperties(this.pageSettings);
|
|
5128
5139
|
requireRefresh = true;
|
|
5129
5140
|
break;
|
|
@@ -5169,6 +5180,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5169
5180
|
this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;
|
|
5170
5181
|
break;
|
|
5171
5182
|
case 'aggregates':
|
|
5183
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
5172
5184
|
this.grid.aggregates = getActualProperties(this.aggregates);
|
|
5173
5185
|
break;
|
|
5174
5186
|
case 'enableInfiniteScrolling':
|
|
@@ -5219,6 +5231,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5219
5231
|
this.grid.gridLines = this.gridLines;
|
|
5220
5232
|
break;
|
|
5221
5233
|
case 'rowTemplate':
|
|
5234
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
5222
5235
|
this.grid.rowTemplate = getActualProperties(this.rowTemplate);
|
|
5223
5236
|
break;
|
|
5224
5237
|
case 'frozenRows':
|
|
@@ -5298,6 +5311,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5298
5311
|
this.grid.showColumnChooser = this.showColumnChooser;
|
|
5299
5312
|
break;
|
|
5300
5313
|
case 'detailTemplate':
|
|
5314
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
5301
5315
|
this.grid.detailTemplate = getActualProperties(this.detailTemplate);
|
|
5302
5316
|
break;
|
|
5303
5317
|
case 'columnMenuItems':
|
|
@@ -5882,8 +5896,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5882
5896
|
}
|
|
5883
5897
|
}
|
|
5884
5898
|
else if (!isNullOrUndefined(this.columns[parseInt(i.toString(), 10)].field)) {
|
|
5885
|
-
var
|
|
5886
|
-
|
|
5899
|
+
var currentColumn = this.grid.getColumnByField(this.columns[parseInt(i.toString(), 10)]
|
|
5900
|
+
.field);
|
|
5887
5901
|
this.columns[parseInt(i.toString(), 10)].width = currentColumn.width;
|
|
5888
5902
|
}
|
|
5889
5903
|
}
|
|
@@ -10522,6 +10536,7 @@ var Aggregate$1 = /** @__PURE__ @class */ (function () {
|
|
|
10522
10536
|
summaryKey = types[parseInt(i.toString(), 10)];
|
|
10523
10537
|
var key = summaryColumn.field + ' - ' + types[parseInt(i.toString(), 10)].toLowerCase();
|
|
10524
10538
|
var val = types[parseInt(i.toString(), 10)] !== 'Custom' ? getObject('aggregates', sumData) :
|
|
10539
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
10525
10540
|
calculateAggregate(types[parseInt(i.toString(), 10)], sumData, summaryColumn, this.parent);
|
|
10526
10541
|
var disp = summaryColumn.columnName;
|
|
10527
10542
|
var value_1 = types[parseInt(i.toString(), 10)] !== 'Custom' ? val["" + key] : val;
|
|
@@ -11576,6 +11591,14 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
|
|
|
11576
11591
|
if (e.target.classList.contains('e-frame') && this.parent.getCurrentViewRecords().length === 0) {
|
|
11577
11592
|
this.doubleClickTarget = null;
|
|
11578
11593
|
}
|
|
11594
|
+
if (e.target.classList.contains('e-treegridcollapse') || e.target.classList.contains('e-treegridexpand')) {
|
|
11595
|
+
var tr = parentsUntil(e.target, 'e-row');
|
|
11596
|
+
var rowIndex = tr && parseInt(tr.getAttribute('data-rowindex'), 10);
|
|
11597
|
+
if (!isNullOrUndefined(rowIndex) && rowIndex >= 0 && this.parent.allowPaging) {
|
|
11598
|
+
/* eslint-disable-next-line */
|
|
11599
|
+
this.parent.grid.getDataRows()[rowIndex].dataset.uid = this.parent.grid.contentModule.getRows()[rowIndex].uid;
|
|
11600
|
+
}
|
|
11601
|
+
}
|
|
11579
11602
|
};
|
|
11580
11603
|
Edit$$1.prototype.getRowPosition = function (addArgs) {
|
|
11581
11604
|
addArgs.newRowPosition = this.parent.editSettings.newRowPosition;
|
|
@@ -11934,15 +11957,21 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
|
|
|
11934
11957
|
else if (isRemoteData(this.parent) ||
|
|
11935
11958
|
(this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {
|
|
11936
11959
|
var query = this.parent.grid.query;
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
11960
|
+
if (this.parent['isGantt'] && !this.parent.loadChildOnDemand) {
|
|
11961
|
+
this.updateCell(args, rowIndex_1);
|
|
11962
|
+
this.afterCellSave(args, row_1, rowIndex_1);
|
|
11963
|
+
}
|
|
11964
|
+
else {
|
|
11965
|
+
var crud = null;
|
|
11966
|
+
crud = this.parent.grid.dataSource.update(primaryKeys_1[0], args.rowData, query.fromTable, query, args.previousValue);
|
|
11967
|
+
crud.then(function (e) {
|
|
11968
|
+
if (!isNullOrUndefined(e)) {
|
|
11969
|
+
args.rowData[args.columnName] = e[args.columnName];
|
|
11970
|
+
}
|
|
11971
|
+
_this.updateCell(args, rowIndex_1);
|
|
11972
|
+
_this.afterCellSave(args, row_1, rowIndex_1);
|
|
11973
|
+
});
|
|
11974
|
+
}
|
|
11946
11975
|
}
|
|
11947
11976
|
}
|
|
11948
11977
|
else {
|
|
@@ -13166,9 +13195,8 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13166
13195
|
}
|
|
13167
13196
|
this.startIndex = !isLastBlock ? lastIndex - this.parent.pageSettings.pageSize : nextSetResIndex;
|
|
13168
13197
|
this.endIndex = lastIndex;
|
|
13169
|
-
if ((nextSetResIndex + this.parent.pageSettings.pageSize) > this.totalRecords &&
|
|
13170
|
-
(this.endIndex -
|
|
13171
|
-
(this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
|
|
13198
|
+
if ((nextSetResIndex + this.parent.pageSettings.pageSize) > this.totalRecords && (this.endIndex - this.startIndex) <
|
|
13199
|
+
(this.parent.pageSettings.pageSize / 2) && (this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
|
|
13172
13200
|
this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
|
|
13173
13201
|
}
|
|
13174
13202
|
if (currentViewData.length && this.startIndex > currentViewData[0]["" + indexValue] &&
|
|
@@ -13183,8 +13211,8 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13183
13211
|
this.translateY = scrollArgs.offset.top - rowHeight * 2;
|
|
13184
13212
|
}
|
|
13185
13213
|
else {
|
|
13186
|
-
if (this.totalRecords
|
|
13187
|
-
this.translateY =
|
|
13214
|
+
if (this.totalRecords === this.endIndex) {
|
|
13215
|
+
this.translateY = (this.totalRecords * rowHeight) - ((this.endIndex - this.startIndex) * rowHeight);
|
|
13188
13216
|
}
|
|
13189
13217
|
else {
|
|
13190
13218
|
this.translateY = scrollArgs.offset.top;
|
|
@@ -13375,6 +13403,8 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
|
|
|
13375
13403
|
if (_this["" + options].axes.indexOf(current.axis) === -1) {
|
|
13376
13404
|
return;
|
|
13377
13405
|
}
|
|
13406
|
+
var containerRect = 'containerRect';
|
|
13407
|
+
_this["" + containerRect] = _this["" + options].container.getBoundingClientRect();
|
|
13378
13408
|
var check = _this.check(direction);
|
|
13379
13409
|
if (current.entered && (current.axis === 'X' || instance.enableVirtualMaskRow)) {
|
|
13380
13410
|
if (_this["" + movableEle] && (direction === 'right' || direction === 'left')) {
|
|
@@ -13528,9 +13558,10 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
|
|
|
13528
13558
|
this.parent.grid.getContent().firstElementChild.scrollTop = 0;
|
|
13529
13559
|
this.parent.grid.notify(virtualActionArgs, { setTop: true });
|
|
13530
13560
|
}
|
|
13531
|
-
if (requestType === 'save') {
|
|
13561
|
+
if (requestType === 'save' || (requestType === 'refresh' && this.parent['isGantt'] && this.parent['isAddedFromGantt'])) {
|
|
13532
13562
|
startIndex = counts.startIndex + (counts.count - counts.endIndex);
|
|
13533
13563
|
endIndex = counts.count;
|
|
13564
|
+
this.parent['isAddedFromGantt'] = false;
|
|
13534
13565
|
}
|
|
13535
13566
|
//if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&
|
|
13536
13567
|
//this.prevendIndex === endIndex && this.prevstartIndex === startIndex) {
|
|
@@ -13829,6 +13860,10 @@ var Freeze$1 = /** @__PURE__ @class */ (function () {
|
|
|
13829
13860
|
getValue('addRenderer', renderer)
|
|
13830
13861
|
.apply(renderer, [RenderType.Content, new VirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
|
|
13831
13862
|
}
|
|
13863
|
+
else {
|
|
13864
|
+
getValue('addRenderer', renderer)
|
|
13865
|
+
.apply(renderer, [RenderType.Content, new FreezeContentRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
|
|
13866
|
+
}
|
|
13832
13867
|
}
|
|
13833
13868
|
if (this.parent.getFrozenLeftColumnsCount() || this.parent.getFrozenRightColumnsCount()) {
|
|
13834
13869
|
getValue('addRenderer', renderer)
|