@syncfusion/ej2-treegrid 29.2.8 → 30.1.37
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 +2 -0
- 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 +246 -139
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +306 -168
- 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 +5 -5
- package/src/treegrid/actions/batch-edit.d.ts +1 -0
- package/src/treegrid/actions/batch-edit.js +57 -29
- package/src/treegrid/actions/clipboard.js +5 -8
- package/src/treegrid/actions/crud-actions.js +3 -1
- package/src/treegrid/actions/detail-row.js +7 -8
- package/src/treegrid/actions/edit.d.ts +1 -0
- package/src/treegrid/actions/edit.js +26 -11
- package/src/treegrid/actions/filter.js +2 -5
- package/src/treegrid/actions/rowdragdrop.js +7 -13
- package/src/treegrid/actions/summary.js +2 -16
- package/src/treegrid/actions/toolbar.js +2 -2
- package/src/treegrid/base/data.js +34 -14
- package/src/treegrid/base/treegrid-model.d.ts +7 -0
- package/src/treegrid/base/treegrid.d.ts +7 -0
- package/src/treegrid/base/treegrid.js +85 -51
- package/src/treegrid/renderer/virtual-row-model-generator.js +13 -5
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +1 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +64 -6
- package/styles/bds-lite.css +30 -0
- package/styles/bds.css +30 -0
- package/styles/bootstrap-dark-lite.css +30 -0
- package/styles/bootstrap-dark.css +30 -0
- package/styles/bootstrap-lite.css +30 -0
- package/styles/bootstrap.css +30 -0
- package/styles/bootstrap4-lite.css +30 -0
- package/styles/bootstrap4.css +30 -0
- package/styles/bootstrap5-dark-lite.css +30 -0
- package/styles/bootstrap5-dark.css +30 -0
- package/styles/bootstrap5-lite.css +30 -0
- package/styles/bootstrap5.3-lite.css +30 -0
- package/styles/bootstrap5.3.css +30 -0
- package/styles/bootstrap5.css +30 -0
- package/styles/fabric-dark-lite.css +30 -0
- package/styles/fabric-dark.css +30 -0
- package/styles/fabric-lite.css +30 -0
- package/styles/fabric.css +30 -0
- package/styles/fluent-dark-lite.css +30 -0
- package/styles/fluent-dark.css +30 -0
- package/styles/fluent-lite.css +30 -0
- package/styles/fluent.css +30 -0
- package/styles/fluent2-lite.css +30 -0
- package/styles/fluent2.css +30 -3
- package/styles/highcontrast-light-lite.css +30 -0
- package/styles/highcontrast-light.css +30 -0
- package/styles/highcontrast-lite.css +30 -0
- package/styles/highcontrast.css +30 -0
- package/styles/material-dark-lite.css +30 -0
- package/styles/material-dark.css +30 -0
- package/styles/material-lite.css +30 -0
- package/styles/material.css +30 -0
- package/styles/material3-dark-lite.css +30 -0
- package/styles/material3-dark.css +30 -0
- package/styles/material3-lite.css +30 -0
- package/styles/material3.css +30 -0
- package/styles/tailwind-dark-lite.css +30 -0
- package/styles/tailwind-dark.css +30 -0
- package/styles/tailwind-lite.css +30 -0
- package/styles/tailwind.css +30 -0
- package/styles/tailwind3-lite.css +30 -0
- package/styles/tailwind3.css +30 -0
- package/styles/treegrid/_bigger.scss +66 -66
- package/styles/treegrid/_layout.scss +39 -0
- package/styles/treegrid/bds.css +30 -0
- package/styles/treegrid/bootstrap-dark.css +30 -0
- package/styles/treegrid/bootstrap.css +30 -0
- package/styles/treegrid/bootstrap4.css +30 -0
- package/styles/treegrid/bootstrap5-dark.css +30 -0
- package/styles/treegrid/bootstrap5.3.css +30 -0
- package/styles/treegrid/bootstrap5.css +30 -0
- package/styles/treegrid/fabric-dark.css +30 -0
- package/styles/treegrid/fabric.css +30 -0
- package/styles/treegrid/fluent-dark.css +30 -0
- package/styles/treegrid/fluent.css +30 -0
- package/styles/treegrid/fluent2.css +30 -3
- package/styles/treegrid/highcontrast-light.css +30 -0
- package/styles/treegrid/highcontrast.css +30 -0
- package/styles/treegrid/material-dark.css +30 -0
- package/styles/treegrid/material.css +30 -0
- package/styles/treegrid/material3-dark.css +30 -0
- package/styles/treegrid/material3.css +30 -0
- package/styles/treegrid/tailwind-dark.css +30 -0
- package/styles/treegrid/tailwind.css +30 -0
- package/styles/treegrid/tailwind3.css +30 -0
|
@@ -481,6 +481,13 @@ export interface TreeGridModel extends ComponentModel{
|
|
|
481
481
|
*/
|
|
482
482
|
enableImmutableMode?: boolean;
|
|
483
483
|
|
|
484
|
+
/**
|
|
485
|
+
* Enables the sticky header feature, which keeps the column headers visible while scrolling the Tree Grid content or the entire document.
|
|
486
|
+
*
|
|
487
|
+
* @default false
|
|
488
|
+
*/
|
|
489
|
+
enableStickyHeader?: boolean;
|
|
490
|
+
|
|
484
491
|
/**
|
|
485
492
|
* Defines the scrollable height of the TreeGrid content.
|
|
486
493
|
*
|
|
@@ -615,6 +615,12 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
615
615
|
* @default false
|
|
616
616
|
*/
|
|
617
617
|
enableImmutableMode: boolean;
|
|
618
|
+
/**
|
|
619
|
+
* Enables the sticky header feature, which keeps the column headers visible while scrolling the Tree Grid content or the entire document.
|
|
620
|
+
*
|
|
621
|
+
* @default false
|
|
622
|
+
*/
|
|
623
|
+
enableStickyHeader: boolean;
|
|
618
624
|
/**
|
|
619
625
|
* Defines the scrollable height of the TreeGrid content.
|
|
620
626
|
*
|
|
@@ -1317,6 +1323,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1317
1323
|
private lastRowBorder;
|
|
1318
1324
|
private isPixelHeight;
|
|
1319
1325
|
private extendedGridDataBoundEvent;
|
|
1326
|
+
private lastRowBorderEventListener;
|
|
1320
1327
|
private objectEqualityChecker;
|
|
1321
1328
|
private bindCallBackEvents;
|
|
1322
1329
|
private extendedGridEditEvents;
|
|
@@ -432,7 +432,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
432
432
|
parentTarget = target.parentElement;
|
|
433
433
|
if (!isNullOrUndefined(parentTarget)) {
|
|
434
434
|
var cellIndex = parentTarget.cellIndex;
|
|
435
|
-
if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
435
|
+
if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
436
436
|
parentTarget = target;
|
|
437
437
|
}
|
|
438
438
|
summaryElement = this.findnextRowElement(parentTarget);
|
|
@@ -440,8 +440,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
440
440
|
var cellIndex_1 = target.cellIndex;
|
|
441
441
|
var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
|
|
442
442
|
if (!isNullOrUndefined(row_1) && !this.grid.isEdit) {
|
|
443
|
-
|
|
444
|
-
|
|
443
|
+
var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
|
|
444
|
+
focusedCells.forEach(function (cell) {
|
|
445
|
+
removeClass([cell], ['e-focused', 'e-focus']);
|
|
446
|
+
});
|
|
447
|
+
addClass([row_1], ['e-focused', 'e-focus']);
|
|
445
448
|
}
|
|
446
449
|
}
|
|
447
450
|
else {
|
|
@@ -461,7 +464,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
461
464
|
parentTarget = target.parentElement;
|
|
462
465
|
if (!isNullOrUndefined(parentTarget)) {
|
|
463
466
|
var cellIndex = parentTarget.cellIndex;
|
|
464
|
-
if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
467
|
+
if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
465
468
|
parentTarget = target;
|
|
466
469
|
}
|
|
467
470
|
summaryElement = this.findPreviousRowElement(parentTarget);
|
|
@@ -470,8 +473,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
470
473
|
if (!isNullOrUndefined(cellIndex_2)) {
|
|
471
474
|
var row_2 = summaryElement.children[parseInt(cellIndex_2.toString(), 10)];
|
|
472
475
|
if (!isNullOrUndefined(row_2) && !this.grid.isEdit) {
|
|
473
|
-
|
|
474
|
-
|
|
476
|
+
var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
|
|
477
|
+
focusedCells.forEach(function (cell) {
|
|
478
|
+
removeClass([cell], ['e-focused', 'e-focus']);
|
|
479
|
+
});
|
|
480
|
+
addClass([row_2], ['e-focused', 'e-focus']);
|
|
475
481
|
}
|
|
476
482
|
}
|
|
477
483
|
}
|
|
@@ -838,11 +844,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
838
844
|
var destroyTemplate = 'destroyTemplate';
|
|
839
845
|
var destroyTemplateFn = this.grid["" + destroyTemplate];
|
|
840
846
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
841
|
-
this.grid["" + destroyTemplate] = function (args, index) {
|
|
847
|
+
this.grid["" + destroyTemplate] = function (args, index, callback) {
|
|
842
848
|
destroyTemplateFn.apply(_this.grid);
|
|
843
849
|
var portals = 'portals';
|
|
844
850
|
if (!(_this.isReact && isNullOrUndefined(_this["" + portals]))) {
|
|
845
|
-
_this.clearTemplate(args, index);
|
|
851
|
+
_this.clearTemplate(args, index, callback);
|
|
852
|
+
}
|
|
853
|
+
else if (!isNullOrUndefined(callback)) {
|
|
854
|
+
callback();
|
|
846
855
|
}
|
|
847
856
|
};
|
|
848
857
|
};
|
|
@@ -938,18 +947,24 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
938
947
|
this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this, this.grid.serviceLocator);
|
|
939
948
|
};
|
|
940
949
|
TreeGrid.prototype.convertTreeData = function (data) {
|
|
941
|
-
var _this = this;
|
|
942
950
|
if (isCountRequired(this)) {
|
|
943
951
|
data = getValue('result', data);
|
|
944
952
|
}
|
|
945
953
|
if (data instanceof Array && data.length > 0 && Object.prototype.hasOwnProperty.call(data[0], 'level')) {
|
|
946
954
|
this.flatData = data;
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
955
|
+
var _loop_1 = function (i, len) {
|
|
956
|
+
var rowData = this_1.flatData[parseInt(i.toString(), 10)];
|
|
957
|
+
setValue('uniqueIDCollection.' + rowData['uniqueID'], rowData, this_1);
|
|
958
|
+
if (rowData.level === 0 && !this_1.parentData.some(function (record) {
|
|
959
|
+
return record.uniqueID === rowData.uniqueID;
|
|
960
|
+
})) {
|
|
961
|
+
this_1.parentData.push(rowData);
|
|
951
962
|
}
|
|
952
|
-
}
|
|
963
|
+
};
|
|
964
|
+
var this_1 = this;
|
|
965
|
+
for (var i = 0, len = this.flatData.length; i < len; i++) {
|
|
966
|
+
_loop_1(i, len);
|
|
967
|
+
}
|
|
953
968
|
}
|
|
954
969
|
else {
|
|
955
970
|
if (isCountRequired(this)) {
|
|
@@ -1039,6 +1054,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1039
1054
|
this.grid["" + isJsComponent] = true;
|
|
1040
1055
|
var enableHtmlSanitizer = 'enableHtmlSanitizer';
|
|
1041
1056
|
this.grid["" + enableHtmlSanitizer] = this.enableHtmlSanitizer;
|
|
1057
|
+
this.grid.enableStickyHeader = this.enableStickyHeader;
|
|
1058
|
+
var isTreeGrid = 'isTreeGrid';
|
|
1059
|
+
this.grid["" + isTreeGrid] = true;
|
|
1042
1060
|
};
|
|
1043
1061
|
TreeGrid.prototype.triggerEvents = function (args) {
|
|
1044
1062
|
this.trigger(getObject('name', args), args);
|
|
@@ -1176,6 +1194,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1176
1194
|
TreeGrid.prototype.extendedGridDataBoundEvent = function () {
|
|
1177
1195
|
var _this = this;
|
|
1178
1196
|
this.grid.dataBound = function (args) {
|
|
1197
|
+
_this.lastRowBorderEventListener();
|
|
1179
1198
|
_this.updateRowTemplate();
|
|
1180
1199
|
_this.updateColumnModel();
|
|
1181
1200
|
_this.updateAltRow(_this.getRows());
|
|
@@ -1268,6 +1287,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1268
1287
|
}
|
|
1269
1288
|
};
|
|
1270
1289
|
};
|
|
1290
|
+
TreeGrid.prototype.lastRowBorderEventListener = function () {
|
|
1291
|
+
this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
|
|
1292
|
+
};
|
|
1271
1293
|
TreeGrid.prototype.bindCallBackEvents = function () {
|
|
1272
1294
|
var _this = this;
|
|
1273
1295
|
this.grid.toolbarClick = function (args) {
|
|
@@ -1435,6 +1457,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1435
1457
|
if (args.requestType === 'sorting' && args.target && args.target.parentElement &&
|
|
1436
1458
|
args.target.parentElement.classList.contains('e-hierarchycheckbox')) {
|
|
1437
1459
|
args.cancel = true;
|
|
1460
|
+
return;
|
|
1438
1461
|
}
|
|
1439
1462
|
var requestType = getObject('requestType', args);
|
|
1440
1463
|
if (requestType === 'reorder') {
|
|
@@ -1625,6 +1648,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1625
1648
|
* @returns {void}
|
|
1626
1649
|
*/
|
|
1627
1650
|
TreeGrid.prototype.autoGenerateColumns = function () {
|
|
1651
|
+
var _this = this;
|
|
1628
1652
|
if (!this.columns.length && (!this.dataModule.isRemote() && Object.keys(this.dataSource).length)) {
|
|
1629
1653
|
this.columns = [];
|
|
1630
1654
|
// if (this.dataSource instanceof DataManager) {
|
|
@@ -1633,11 +1657,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1633
1657
|
var record = this.dataSource[0];
|
|
1634
1658
|
// }
|
|
1635
1659
|
var keys = Object.keys(record);
|
|
1636
|
-
|
|
1637
|
-
if ([this.childMapping, this.parentIdMapping].indexOf(keys[parseInt(i.toString(), 10)]) === -1) {
|
|
1638
|
-
this.columns.push(keys[parseInt(i.toString(), 10)]);
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1660
|
+
this.columns = keys.filter(function (key) { return [_this.childMapping, _this.parentIdMapping].indexOf(key) === -1; });
|
|
1641
1661
|
}
|
|
1642
1662
|
};
|
|
1643
1663
|
TreeGrid.prototype.getGridEditSettings = function () {
|
|
@@ -1791,8 +1811,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1791
1811
|
gridColumn.field = treeGridColumn.field = this.columns[parseInt(i.toString(), 10)];
|
|
1792
1812
|
}
|
|
1793
1813
|
else {
|
|
1794
|
-
|
|
1795
|
-
|
|
1814
|
+
var columnProps = Object.keys(column[parseInt(i.toString(), 10)]);
|
|
1815
|
+
for (var j = 0; j < columnProps.length; j++) {
|
|
1816
|
+
var prop = columnProps[parseInt(j.toString(), 10)];
|
|
1796
1817
|
if (index === this.treeColumnIndex && prop === 'template') {
|
|
1797
1818
|
treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
|
|
1798
1819
|
}
|
|
@@ -1963,6 +1984,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1963
1984
|
break;
|
|
1964
1985
|
case 'rowHeight':
|
|
1965
1986
|
this.grid.rowHeight = this.rowHeight;
|
|
1987
|
+
this.refresh();
|
|
1966
1988
|
break;
|
|
1967
1989
|
case 'height':
|
|
1968
1990
|
if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {
|
|
@@ -2038,6 +2060,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2038
2060
|
case 'columnMenuItems':
|
|
2039
2061
|
this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);
|
|
2040
2062
|
break;
|
|
2063
|
+
case 'enableStickyHeader':
|
|
2064
|
+
this.grid.enableStickyHeader = this.enableStickyHeader;
|
|
2065
|
+
break;
|
|
2041
2066
|
case 'editSettings':
|
|
2042
2067
|
if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp["" + prop].mode &&
|
|
2043
2068
|
(newProp["" + prop].mode === 'Cell' || newProp["" + prop].mode === 'Row')) {
|
|
@@ -2925,14 +2950,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2925
2950
|
* @returns {Column[]} - Returns an array of visible column objects.
|
|
2926
2951
|
*/
|
|
2927
2952
|
TreeGrid.prototype.getVisibleColumns = function () {
|
|
2928
|
-
|
|
2929
|
-
for (var _i = 0, _a = this.columnModel; _i < _a.length; _i++) {
|
|
2930
|
-
var col = _a[_i];
|
|
2931
|
-
if (col.visible) {
|
|
2932
|
-
cols.push(col);
|
|
2933
|
-
}
|
|
2934
|
-
}
|
|
2935
|
-
return cols;
|
|
2953
|
+
return this.columnModel.filter(function (col) { return col.visible; });
|
|
2936
2954
|
};
|
|
2937
2955
|
/**
|
|
2938
2956
|
* Displays a loading spinner overlay across the TreeGrid for any data action or long-running process.
|
|
@@ -3060,17 +3078,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3060
3078
|
TreeGrid.prototype.getTreeColumn = function () {
|
|
3061
3079
|
var columnModel = 'columnModel';
|
|
3062
3080
|
var treeColumn = this["" + columnModel][this.treeColumnIndex];
|
|
3063
|
-
var treeIndex;
|
|
3064
3081
|
var updatedCols = this.getColumns();
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
}
|
|
3082
|
+
var treeColumnField = getObject('field', treeColumn);
|
|
3083
|
+
var treeIndex = updatedCols.findIndex(function (col) {
|
|
3084
|
+
return getObject('field', col) === treeColumnField;
|
|
3085
|
+
});
|
|
3086
|
+
if (!isNullOrUndefined(treeIndex)) {
|
|
3087
|
+
this.setProperties({ treeColumnIndex: treeIndex }, true);
|
|
3072
3088
|
}
|
|
3073
|
-
this.setProperties({ treeColumnIndex: treeIndex }, true);
|
|
3074
3089
|
};
|
|
3075
3090
|
/**
|
|
3076
3091
|
* Refreshes the header section of the TreeGrid to reflect any structural or data changes.
|
|
@@ -3393,14 +3408,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3393
3408
|
};
|
|
3394
3409
|
TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
|
|
3395
3410
|
if (isPaging === void 0) { isPaging = false; }
|
|
3396
|
-
var
|
|
3411
|
+
var _loop_2 = function (i) {
|
|
3397
3412
|
if (!isNullOrUndefined(record[parseInt(i.toString(), 10)].parentItem)) {
|
|
3398
3413
|
var puniqueID_1 = record[parseInt(i.toString(), 10)].parentItem.uniqueID;
|
|
3399
|
-
var parentItem =
|
|
3414
|
+
var parentItem = this_2.flatData.filter(function (e) {
|
|
3400
3415
|
return e.uniqueID === puniqueID_1;
|
|
3401
3416
|
});
|
|
3402
|
-
if (isRemoteData(
|
|
3403
|
-
parentItem =
|
|
3417
|
+
if (isRemoteData(this_2)) {
|
|
3418
|
+
parentItem = this_2.getCurrentViewRecords().filter(function (e) {
|
|
3404
3419
|
return e.uniqueID === puniqueID_1;
|
|
3405
3420
|
});
|
|
3406
3421
|
}
|
|
@@ -3409,7 +3424,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3409
3424
|
parentItem[0].expanded = true;
|
|
3410
3425
|
}
|
|
3411
3426
|
else {
|
|
3412
|
-
if (!getExpandStatus(
|
|
3427
|
+
if (!getExpandStatus(this_2, parentItem[0], this_2.parentData)) {
|
|
3413
3428
|
if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
|
|
3414
3429
|
record.push(parentItem[0]);
|
|
3415
3430
|
}
|
|
@@ -3417,12 +3432,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3417
3432
|
}
|
|
3418
3433
|
}
|
|
3419
3434
|
if (!isPaging) {
|
|
3420
|
-
|
|
3435
|
+
this_2.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
|
|
3421
3436
|
}
|
|
3422
3437
|
};
|
|
3423
|
-
var
|
|
3438
|
+
var this_2 = this;
|
|
3424
3439
|
for (var i = 0; i < record.length; i++) {
|
|
3425
|
-
|
|
3440
|
+
_loop_2(i);
|
|
3426
3441
|
}
|
|
3427
3442
|
if (isPaging) {
|
|
3428
3443
|
this.expandRow(null, record, key, level);
|
|
@@ -3526,8 +3541,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3526
3541
|
if (this.editSettings.mode === 'Batch') {
|
|
3527
3542
|
var obj = 'dialogObj';
|
|
3528
3543
|
var showDialog = 'showDialog';
|
|
3529
|
-
|
|
3530
|
-
|
|
3544
|
+
var changes = this.getBatchChanges ? this.getBatchChanges() : {};
|
|
3545
|
+
var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
|
|
3546
|
+
var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
|
|
3547
|
+
var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
|
|
3548
|
+
var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
|
|
3549
|
+
if (hasChanges && this.editSettings.showConfirmDialog) {
|
|
3531
3550
|
var dialogObj = this.grid.editModule["" + obj];
|
|
3532
3551
|
this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
|
|
3533
3552
|
return;
|
|
@@ -3553,8 +3572,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3553
3572
|
if (this.editSettings.mode === 'Batch') {
|
|
3554
3573
|
var obj = 'dialogObj';
|
|
3555
3574
|
var showDialog = 'showDialog';
|
|
3556
|
-
|
|
3557
|
-
|
|
3575
|
+
var changes = this.getBatchChanges ? this.getBatchChanges() : {};
|
|
3576
|
+
var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
|
|
3577
|
+
var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
|
|
3578
|
+
var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
|
|
3579
|
+
var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
|
|
3580
|
+
if (hasChanges && this.editSettings.showConfirmDialog) {
|
|
3558
3581
|
var dialogObj = this.grid.editModule["" + obj];
|
|
3559
3582
|
this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
|
|
3560
3583
|
return;
|
|
@@ -3844,6 +3867,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3844
3867
|
TreeGrid.prototype.remoteExpand = function (action, row, record) {
|
|
3845
3868
|
var gridRows = this.getRows();
|
|
3846
3869
|
var fetchRemoteChildData = 'fetchRemoteChildData';
|
|
3870
|
+
var requestType = getValue('isCollapseAll', this) ? 'collapseAll' : 'refresh';
|
|
3871
|
+
this.grid.contentModule.requestType = requestType;
|
|
3847
3872
|
if (this.rowTemplate) {
|
|
3848
3873
|
var rows_1 = this.getContentTable().rows;
|
|
3849
3874
|
gridRows = [].slice.call(rows_1);
|
|
@@ -3918,6 +3943,13 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3918
3943
|
gridRowsObject[parseInt(currentIndex.toString(), 10)].visible !== false) {
|
|
3919
3944
|
gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = true;
|
|
3920
3945
|
}
|
|
3946
|
+
if (this.detailTemplate) {
|
|
3947
|
+
gridRows.forEach(function (row) {
|
|
3948
|
+
if (row.classList.contains('e-detailrow') && row.style.display === 'none') {
|
|
3949
|
+
row.style.display = '';
|
|
3950
|
+
}
|
|
3951
|
+
});
|
|
3952
|
+
}
|
|
3921
3953
|
var detailrows = gridRows.filter(function (r) {
|
|
3922
3954
|
return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
|
|
3923
3955
|
});
|
|
@@ -4082,7 +4114,6 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
4082
4114
|
TreeGrid.prototype.addListener = function () {
|
|
4083
4115
|
this.on('updateResults', this.updateResultModel, this);
|
|
4084
4116
|
this.grid.on('initial-end', this.afterGridRender, this);
|
|
4085
|
-
this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
|
|
4086
4117
|
};
|
|
4087
4118
|
TreeGrid.prototype.updateResultModel = function (returnResult) {
|
|
4088
4119
|
this.dataResults = returnResult;
|
|
@@ -4675,6 +4706,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
4675
4706
|
__decorate([
|
|
4676
4707
|
Property(false)
|
|
4677
4708
|
], TreeGrid.prototype, "enableImmutableMode", void 0);
|
|
4709
|
+
__decorate([
|
|
4710
|
+
Property(false)
|
|
4711
|
+
], TreeGrid.prototype, "enableStickyHeader", void 0);
|
|
4678
4712
|
__decorate([
|
|
4679
4713
|
Property('auto')
|
|
4680
4714
|
], TreeGrid.prototype, "height", void 0);
|
|
@@ -39,10 +39,15 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
|
|
|
39
39
|
};
|
|
40
40
|
TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
|
|
41
41
|
var info = this.getDataInfo();
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
if (notifyArgs.requestType === 'refresh' && notifyArgs.isExpandCollapse) {
|
|
43
|
+
notifyArgs.virtualInfo = this['prevInfo'];
|
|
44
|
+
}
|
|
45
|
+
if (!isNullOrUndefined(notifyArgs.virtualInfo) && !(this.parent.root.loadChildOnDemand && isRemoteData(this.parent.root))) {
|
|
46
|
+
if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
|
|
47
|
+
if ((!isRemoteData(this.parent.root) || isCountRequired(this.parent))
|
|
48
|
+
|| notifyArgs.virtualInfo.blockIndexes.length === 1) {
|
|
49
|
+
notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
|
|
50
|
+
}
|
|
46
51
|
}
|
|
47
52
|
else {
|
|
48
53
|
notifyArgs.virtualInfo.blockIndexes = this.getBlockIndexes(notifyArgs.virtualInfo.page);
|
|
@@ -83,7 +88,10 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
|
|
|
83
88
|
else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&
|
|
84
89
|
this.cache[parseInt(currentPage.toString(), 10)].length >
|
|
85
90
|
(this.parent.contentModule).getBlockSize()) {
|
|
86
|
-
|
|
91
|
+
if (this.cache[parseInt(currentPage.toString(), 10)].length > (this.parent.contentModule).getBlockSize()) {
|
|
92
|
+
this.cache[parseInt(currentPage.toString(), 10)] =
|
|
93
|
+
this.cache[parseInt(currentPage.toString(), 10)].slice(0, (this.parent.contentModule).getBlockSize());
|
|
94
|
+
}
|
|
87
95
|
}
|
|
88
96
|
}
|
|
89
97
|
else {
|
|
@@ -197,6 +197,7 @@ export declare class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
197
197
|
* @returns {void} This method does not return any value.
|
|
198
198
|
*/
|
|
199
199
|
private restoreEditState;
|
|
200
|
+
private SetVirtualPageQury;
|
|
200
201
|
/**
|
|
201
202
|
* Resets the edit state if certain conditions are met.
|
|
202
203
|
*
|
|
@@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
11
11
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
12
|
};
|
|
13
13
|
})();
|
|
14
|
-
import { Cell, CellType } from '@syncfusion/ej2-grids';
|
|
14
|
+
import { Cell, CellType, getVisiblePage } from '@syncfusion/ej2-grids';
|
|
15
15
|
import { VirtualContentRenderer } from '@syncfusion/ej2-grids';
|
|
16
16
|
import * as literals from '../base/constant';
|
|
17
17
|
import { InterSectionObserver } from '@syncfusion/ej2-grids';
|
|
@@ -19,7 +19,7 @@ import { TreeVirtualRowModelGenerator } from '../renderer/virtual-row-model-gene
|
|
|
19
19
|
import * as events from '../base/constant';
|
|
20
20
|
import { isNullOrUndefined, EventHandler, getValue, setValue, Browser, debounce } from '@syncfusion/ej2-base';
|
|
21
21
|
import { DataManager } from '@syncfusion/ej2-data';
|
|
22
|
-
import { isCountRequired } from '../utils';
|
|
22
|
+
import { isCountRequired, isRemoteData } from '../utils';
|
|
23
23
|
/**
|
|
24
24
|
* VirtualTreeContentRenderer
|
|
25
25
|
*
|
|
@@ -219,6 +219,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
219
219
|
this.parent["" + action]('refresh-virtual-editform-cells', this.refreshCell, this);
|
|
220
220
|
this.parent["" + action]('virtaul-cell-focus', this.cellFocus, this);
|
|
221
221
|
this.parent["" + action]('virtual-scroll-edit', this.restoreEditState, this);
|
|
222
|
+
this.parent["" + action]('set-virtual-page-query', this.SetVirtualPageQury, this);
|
|
222
223
|
}
|
|
223
224
|
else {
|
|
224
225
|
_super.prototype.eventListener.call(this, 'on');
|
|
@@ -471,6 +472,18 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
471
472
|
var restoreEdit = 'restoreEdit';
|
|
472
473
|
_super.prototype["" + restoreEdit].call(this);
|
|
473
474
|
};
|
|
475
|
+
VirtualTreeContentRenderer.prototype.SetVirtualPageQury = function (args) {
|
|
476
|
+
var visiblePage = [];
|
|
477
|
+
if (this.prevInfo && this.prevInfo.blockIndexes) {
|
|
478
|
+
visiblePage = getVisiblePage(this.prevInfo.blockIndexes);
|
|
479
|
+
}
|
|
480
|
+
if ((this.requestType === 'refresh') && visiblePage.length) {
|
|
481
|
+
args.query.skip(this.parent.pageSettings.pageSize * (visiblePage[0] - 1));
|
|
482
|
+
args.query.take(this.parent.pageSettings.pageSize * visiblePage.length);
|
|
483
|
+
args.skipPage = true;
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
};
|
|
474
487
|
/**
|
|
475
488
|
* Resets the edit state if certain conditions are met.
|
|
476
489
|
*
|
|
@@ -611,6 +624,19 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
611
624
|
var xAxis = current.axis === 'X';
|
|
612
625
|
var x = _this.getColumnOffset(xAxis ? _this.vgenerator.getColumnIndexes()[0] - 1 : _this.prevInfo.columnIndexes[0]
|
|
613
626
|
- 1);
|
|
627
|
+
if (_this.parent.isFrozenGrid() && _this.parent.enableColumnVirtualization && _this.currentInfo &&
|
|
628
|
+
_this.currentInfo.columnIndexes) {
|
|
629
|
+
var cBlock = _this.currentInfo.columnIndexes[0] - 1;
|
|
630
|
+
var frzLeftWidth_1 = 0;
|
|
631
|
+
_this.parent.getColumns().filter(function (col) {
|
|
632
|
+
if (col.visible && col.freeze === 'Left') {
|
|
633
|
+
frzLeftWidth_1 += parseInt(col.width.toString(), 10);
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
if (cBlock > _this.parent.getVisibleFrozenLeftCount()) {
|
|
637
|
+
x = x - frzLeftWidth_1;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
614
640
|
if (xAxis) {
|
|
615
641
|
var idx = Object.keys(_this.vgenerator.cOffsets).length - _this.prevInfo.columnIndexes.length;
|
|
616
642
|
var maxLeft = _this.vgenerator.cOffsets[idx - 1];
|
|
@@ -628,6 +654,9 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
628
654
|
}
|
|
629
655
|
if (_this.parent.enableColumnVirtualization) {
|
|
630
656
|
_this.header.virtualEle.adjustTable(x, 0);
|
|
657
|
+
if (_this.parent.isFrozenGrid()) {
|
|
658
|
+
_this.parent.contentModule['resetStickyLeftPos'](x);
|
|
659
|
+
}
|
|
631
660
|
}
|
|
632
661
|
}
|
|
633
662
|
}
|
|
@@ -772,10 +801,10 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
772
801
|
if (((downScroll && scrollArgs.direction !== 'up' && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
|
|
773
802
|
|| (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||
|
|
774
803
|
((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
775
|
-
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '')
|
|
804
|
+
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== ''))) {
|
|
776
805
|
var viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
|
|
777
806
|
this.previousInfo = viewInfo;
|
|
778
|
-
if (this.prevInfo &&
|
|
807
|
+
if (this.prevInfo && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
|
|
779
808
|
|| ((info.axis === 'X' && this.prevInfo.columnIndexes.toString() === viewInfo.columnIndexes.toString())
|
|
780
809
|
|| (this.parent.isFrozenGrid() && this.parent.getVisibleFrozenLeftCount() >= viewInfo.columnIndexes[0]
|
|
781
810
|
&& this.prevInfo.columnIndexes.toString().includes(viewInfo.columnIndexes.toString()))))) {
|
|
@@ -797,7 +826,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
797
826
|
viewInfo.loadNext = false;
|
|
798
827
|
}
|
|
799
828
|
this.requestType = 'virtualscroll';
|
|
800
|
-
if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
|
|
829
|
+
if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left' && !isRemoteData(this.parent.root)) {
|
|
801
830
|
viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
|
|
802
831
|
}
|
|
803
832
|
if (this.parent.enableVirtualMaskRow) {
|
|
@@ -870,9 +899,33 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
870
899
|
if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'Y') {
|
|
871
900
|
this.isExpandCollapse = false;
|
|
872
901
|
}
|
|
902
|
+
var reduceWidth_1 = 0;
|
|
903
|
+
if (this.parent.enableColumnVirtualization && this.parent.isFrozenGrid()) {
|
|
904
|
+
var frzLeftWidth_2 = 0;
|
|
905
|
+
this.parent.getColumns().filter(function (col) {
|
|
906
|
+
if (col.visible) {
|
|
907
|
+
reduceWidth_1 += parseInt(col.width.toString(), 10);
|
|
908
|
+
if (col.freeze === 'Left') {
|
|
909
|
+
frzLeftWidth_2 += parseInt(col.width.toString(), 10);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
var cIndex = info.columnIndexes;
|
|
914
|
+
width = this.getColumnOffset(cIndex[cIndex.length - 1]) - this.getColumnOffset(cIndex[0] - 1) + '';
|
|
915
|
+
if (cBlock > this.parent.getVisibleFrozenLeftCount()) {
|
|
916
|
+
cOffset = cOffset - frzLeftWidth_2;
|
|
917
|
+
}
|
|
918
|
+
this.resetStickyLeftPos(cOffset, newChild);
|
|
919
|
+
}
|
|
873
920
|
if (!this.isExpandCollapse || this.translateY === 0) {
|
|
874
921
|
this.translateY = this.translateY < 0 ? 0 : this.translateY;
|
|
875
922
|
getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
|
|
923
|
+
if (this.parent.enableColumnVirtualization) {
|
|
924
|
+
this.header.virtualEle.adjustTable(cOffset, 0);
|
|
925
|
+
if (this.parent.isFrozenGrid()) {
|
|
926
|
+
this.resetStickyLeftPos(cOffset);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
876
929
|
}
|
|
877
930
|
else {
|
|
878
931
|
this.isExpandCollapse = false;
|
|
@@ -991,7 +1044,12 @@ var TreeInterSectionObserver = /** @class */ (function (_super) {
|
|
|
991
1044
|
this["" + options].prevTop = this["" + options].prevLeft = 0;
|
|
992
1045
|
var isScrollByFocus = 'isScrollByFocus';
|
|
993
1046
|
return function (e) {
|
|
994
|
-
|
|
1047
|
+
var keyPress = 'keyPress';
|
|
1048
|
+
var keyaction;
|
|
1049
|
+
if (instance && instance.root && instance.root.editModule && instance.root.editModule["" + keyPress]) {
|
|
1050
|
+
keyaction = instance.root.editModule["" + keyPress];
|
|
1051
|
+
}
|
|
1052
|
+
if ((instance.isEdit && instance.root.editModule["" + isScrollByFocus]) || (instance.isEdit && (keyaction === 'tab' || keyaction === 'shiftTab'))) {
|
|
995
1053
|
instance.root.editModule["" + isScrollByFocus] = false;
|
|
996
1054
|
return;
|
|
997
1055
|
}
|
package/styles/bds-lite.css
CHANGED
|
@@ -371,6 +371,12 @@
|
|
|
371
371
|
content: "\e72a";
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
+
@media print {
|
|
375
|
+
.e-treecell-child {
|
|
376
|
+
width: 10px;
|
|
377
|
+
display: inline-block;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
374
380
|
.e-treegrid .e-icons.e-none::before {
|
|
375
381
|
content: "";
|
|
376
382
|
}
|
|
@@ -390,6 +396,22 @@
|
|
|
390
396
|
text-align: center;
|
|
391
397
|
vertical-align: unset;
|
|
392
398
|
}
|
|
399
|
+
.e-treegrid .e-treecolumn-container .e-treecell-icon {
|
|
400
|
+
width: 4px;
|
|
401
|
+
display: inline-block;
|
|
402
|
+
}
|
|
403
|
+
.e-treegrid .e-treecolumn-container .e-treecell-child {
|
|
404
|
+
width: 10px;
|
|
405
|
+
display: inline-block;
|
|
406
|
+
}
|
|
407
|
+
.e-treegrid .e-expand-iconstyle {
|
|
408
|
+
width: 16px;
|
|
409
|
+
}
|
|
410
|
+
.e-treegrid .e-print-layout {
|
|
411
|
+
position: absolute;
|
|
412
|
+
top: -9999px;
|
|
413
|
+
left: -9999px;
|
|
414
|
+
}
|
|
393
415
|
.e-treegrid tr.e-childrow-hidden {
|
|
394
416
|
display: none;
|
|
395
417
|
}
|
|
@@ -507,6 +529,7 @@
|
|
|
507
529
|
width: 0;
|
|
508
530
|
}
|
|
509
531
|
.e-treegrid .e-detailheadercell,
|
|
532
|
+
.e-treegrid .e-detailcell-visible,
|
|
510
533
|
.e-treegrid .e-headercontent .e-table .e-detail-intent,
|
|
511
534
|
.e-treegrid .e-gridcontent .e-table .e-detail-intent,
|
|
512
535
|
.e-treegrid .e-table .e-detailrow .e-detailindentcell,
|
|
@@ -515,6 +538,13 @@
|
|
|
515
538
|
.e-treegrid tr.e-detailrow.e-childrow-hidden {
|
|
516
539
|
display: none;
|
|
517
540
|
}
|
|
541
|
+
.e-treegrid .e-table-cell::before {
|
|
542
|
+
content: none;
|
|
543
|
+
display: none;
|
|
544
|
+
}
|
|
545
|
+
.e-treegrid .e-table-cell {
|
|
546
|
+
display: table-cell;
|
|
547
|
+
}
|
|
518
548
|
.e-treegrid .e-icons.e-errorelem {
|
|
519
549
|
padding-left: 10px;
|
|
520
550
|
display: inline-block;
|