@syncfusion/ej2-treegrid 28.1.33 → 28.1.36
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/dist/ej2-treegrid.min.js +1 -10
- package/dist/ej2-treegrid.umd.min.js +1 -10
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +47 -10
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +47 -10
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +1 -10
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/package.json +6 -7
- package/src/treegrid/base/treegrid.js +29 -2
- package/src/treegrid/renderer/virtual-tree-content-render.js +18 -8
- package/styles/bds-lite.css +27 -12
- package/styles/bds.css +27 -12
- package/styles/bootstrap-dark-lite.css +39 -16
- package/styles/bootstrap-dark.css +39 -16
- package/styles/bootstrap-lite.css +50 -15
- package/styles/bootstrap.css +50 -15
- package/styles/bootstrap4-lite.css +39 -16
- package/styles/bootstrap4.css +39 -16
- package/styles/bootstrap5-dark-lite.css +39 -16
- package/styles/bootstrap5-dark.css +39 -16
- package/styles/bootstrap5-lite.css +39 -16
- package/styles/bootstrap5.3-lite.css +39 -16
- package/styles/bootstrap5.3.css +39 -16
- package/styles/bootstrap5.css +39 -16
- package/styles/fabric-dark-lite.css +39 -16
- package/styles/fabric-dark.css +39 -16
- package/styles/fabric-lite.css +39 -16
- package/styles/fabric.css +39 -16
- package/styles/fluent-dark-lite.css +39 -16
- package/styles/fluent-dark.css +39 -16
- package/styles/fluent-lite.css +39 -16
- package/styles/fluent.css +39 -16
- package/styles/fluent2-lite.css +39 -16
- package/styles/fluent2.css +39 -16
- package/styles/highcontrast-light-lite.css +39 -16
- package/styles/highcontrast-light.css +39 -16
- package/styles/highcontrast-lite.css +39 -16
- package/styles/highcontrast.css +39 -16
- package/styles/material-dark-lite.css +39 -16
- package/styles/material-dark.css +39 -16
- package/styles/material-lite.css +39 -16
- package/styles/material.css +39 -16
- package/styles/material3-dark-lite.css +39 -16
- package/styles/material3-dark.css +39 -16
- package/styles/material3-lite.css +39 -16
- package/styles/material3.css +39 -16
- package/styles/tailwind-dark-lite.css +39 -16
- package/styles/tailwind-dark.css +39 -16
- package/styles/tailwind-lite.css +39 -16
- package/styles/tailwind.css +39 -16
- package/styles/tailwind3-lite.css +39 -16
- package/styles/tailwind3.css +39 -16
- package/styles/treegrid/_icons.scss +15 -5
- package/styles/treegrid/_layout.scss +33 -13
- package/styles/treegrid/bds.css +27 -12
- package/styles/treegrid/bootstrap-dark.css +39 -16
- package/styles/treegrid/bootstrap.css +50 -15
- package/styles/treegrid/bootstrap4.css +39 -16
- package/styles/treegrid/bootstrap5-dark.css +39 -16
- package/styles/treegrid/bootstrap5.3.css +39 -16
- package/styles/treegrid/bootstrap5.css +39 -16
- package/styles/treegrid/fabric-dark.css +39 -16
- package/styles/treegrid/fabric.css +39 -16
- package/styles/treegrid/fluent-dark.css +39 -16
- package/styles/treegrid/fluent.css +39 -16
- package/styles/treegrid/fluent2.css +39 -16
- package/styles/treegrid/highcontrast-light.css +39 -16
- package/styles/treegrid/highcontrast.css +39 -16
- package/styles/treegrid/icons/_bootstrap-dark.scss +15 -5
- package/styles/treegrid/icons/_bootstrap.scss +31 -4
- package/styles/treegrid/icons/_bootstrap4.scss +15 -5
- package/styles/treegrid/icons/_bootstrap5.3.scss +15 -5
- package/styles/treegrid/icons/_bootstrap5.scss +15 -5
- package/styles/treegrid/icons/_fabric-dark.scss +15 -5
- package/styles/treegrid/icons/_fabric.scss +15 -5
- package/styles/treegrid/icons/_fluent.scss +15 -5
- package/styles/treegrid/icons/_fluent2.scss +15 -5
- package/styles/treegrid/icons/_fusionnew.scss +8 -5
- package/styles/treegrid/icons/_highcontrast-light.scss +15 -5
- package/styles/treegrid/icons/_highcontrast.scss +15 -5
- package/styles/treegrid/icons/_material-dark.scss +15 -5
- package/styles/treegrid/icons/_material.scss +15 -5
- package/styles/treegrid/icons/_material3.scss +15 -5
- package/styles/treegrid/icons/_tailwind-dark.scss +15 -5
- package/styles/treegrid/icons/_tailwind.scss +15 -5
- package/styles/treegrid/icons/_tailwind3.scss +15 -5
- package/styles/treegrid/material-dark.css +39 -16
- package/styles/treegrid/material.css +39 -16
- package/styles/treegrid/material3-dark.css +39 -16
- package/styles/treegrid/material3.css +39 -16
- package/styles/treegrid/tailwind-dark.css +39 -16
- package/styles/treegrid/tailwind.css +39 -16
- package/styles/treegrid/tailwind3.css +39 -16
|
@@ -4010,8 +4010,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4010
4010
|
const freezePresent = this.injectedModules.filter((e) => {
|
|
4011
4011
|
return e.prototype.getModuleName() === 'freeze';
|
|
4012
4012
|
});
|
|
4013
|
+
const hasFreezeProp = Array.isArray(this.columns) &&
|
|
4014
|
+
this.columns.some((col) => !!col.freeze);
|
|
4013
4015
|
if ((this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
|
|
4014
|
-
|
|
4016
|
+
hasFreezeProp) && freezePresent.length > 0) {
|
|
4015
4017
|
modules.push({
|
|
4016
4018
|
member: 'freeze', args: [this],
|
|
4017
4019
|
name: 'Freeze'
|
|
@@ -4181,7 +4183,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4181
4183
|
this.grid.rowDropSettings.targetID += '_gridcontrol';
|
|
4182
4184
|
}
|
|
4183
4185
|
this.addListener();
|
|
4184
|
-
const gridContainer = createElement('div', { id: this.element.id + '_gridcontrol' });
|
|
4186
|
+
const gridContainer = createElement('div', { id: this.element.id + '_gridcontrol', className: 'e-treelistgrid' });
|
|
4185
4187
|
addClass([this.element], 'e-treegrid');
|
|
4186
4188
|
if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {
|
|
4187
4189
|
this.element.style.height = this.height;
|
|
@@ -6394,6 +6396,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6394
6396
|
}
|
|
6395
6397
|
// Internal method to handle the rows expand
|
|
6396
6398
|
expandRows(row, record, parentRec) {
|
|
6399
|
+
const initialTotalRecordsCount = this.grid.totalDataRecordsCount;
|
|
6397
6400
|
this.expandCollapse('expand', row, record);
|
|
6398
6401
|
const children = 'Children';
|
|
6399
6402
|
if (!(isRemoteData(this) && !isOffline(this)) && (!isCountRequired(this) || !isNullOrUndefined(record[`${children}`]))) {
|
|
@@ -6414,6 +6417,18 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6414
6417
|
this.trigger(expanded, expandArgs);
|
|
6415
6418
|
}
|
|
6416
6419
|
}
|
|
6420
|
+
if (this.enableVirtualization) {
|
|
6421
|
+
const index = this.grid.currentViewData.indexOf(record);
|
|
6422
|
+
const expandedRow = isNullOrUndefined(row) ? this.getRows()[parseInt(index.toString(), 10)] : row;
|
|
6423
|
+
if (!isNullOrUndefined(expandedRow)) {
|
|
6424
|
+
const rowIndex = +expandedRow.getAttribute('data-rowindex');
|
|
6425
|
+
const outBuffer = this.grid.pageSettings.pageSize - Math.ceil(this.grid.pageSettings.pageSize / 2);
|
|
6426
|
+
const lastBlockIdx = initialTotalRecordsCount - outBuffer;
|
|
6427
|
+
if (rowIndex > lastBlockIdx) {
|
|
6428
|
+
this.grid.getContent().firstElementChild.scrollTop = rowIndex * this.grid.getRowHeight();
|
|
6429
|
+
}
|
|
6430
|
+
}
|
|
6431
|
+
}
|
|
6417
6432
|
}
|
|
6418
6433
|
expandCollapseAllChildren(record, action, key, level) {
|
|
6419
6434
|
if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||
|
|
@@ -6528,6 +6543,18 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6528
6543
|
this.grid.getContent().firstElementChild.scrollBy(0, this.grid.getRowHeight());
|
|
6529
6544
|
}
|
|
6530
6545
|
}
|
|
6546
|
+
if (this.enableVirtualization) {
|
|
6547
|
+
const index = this.grid.currentViewData.indexOf(record);
|
|
6548
|
+
const collapsedRow = isNullOrUndefined(row) ? this.getRows()[parseInt(index.toString(), 10)] : row;
|
|
6549
|
+
if (!isNullOrUndefined(collapsedRow)) {
|
|
6550
|
+
const rowIndex = +collapsedRow.getAttribute('data-rowindex');
|
|
6551
|
+
const outBuffer = this.grid.pageSettings.pageSize - Math.ceil(this.grid.pageSettings.pageSize / 2);
|
|
6552
|
+
const lastBlockIdx = this.grid.totalDataRecordsCount - outBuffer;
|
|
6553
|
+
if (rowIndex > lastBlockIdx) {
|
|
6554
|
+
this.grid.getContent().firstElementChild.scrollBy(0, (rowIndex - lastBlockIdx) * this.grid.getRowHeight());
|
|
6555
|
+
}
|
|
6556
|
+
}
|
|
6557
|
+
}
|
|
6531
6558
|
}
|
|
6532
6559
|
}
|
|
6533
6560
|
updateExpandStateMapping(record, state) {
|
|
@@ -13402,13 +13429,13 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13402
13429
|
dataBoundEvent() {
|
|
13403
13430
|
const dataBoundEve = 'dataBound';
|
|
13404
13431
|
const initialRowTop = 'initialRowTop';
|
|
13405
|
-
if (this.parent.getRows().length && !isNullOrUndefined(this.parent.getRowByIndex(0)) && !this[`${initialRowTop}`]) {
|
|
13432
|
+
if (!isNullOrUndefined(this.parent.getRows()) && this.parent.getRows().length && !isNullOrUndefined(this.parent.getRowByIndex(0)) && !this[`${initialRowTop}`]) {
|
|
13406
13433
|
const rowTop = this.parent.getRowByIndex(0).getBoundingClientRect().top;
|
|
13407
13434
|
const gridTop = this.parent.element.getBoundingClientRect().top;
|
|
13408
13435
|
if (rowTop > 0) {
|
|
13409
13436
|
this[`${initialRowTop}`] = this.parent.getRowByIndex(0).getBoundingClientRect().top - gridTop;
|
|
13410
13437
|
}
|
|
13411
|
-
else {
|
|
13438
|
+
else if (this.parent.selectedRowIndex === -1) {
|
|
13412
13439
|
this[`${initialRowTop}`] = this.content.getBoundingClientRect().top -
|
|
13413
13440
|
this.parent.getRowByIndex(0).getBoundingClientRect().height;
|
|
13414
13441
|
}
|
|
@@ -13593,7 +13620,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13593
13620
|
content = this.parent.getContent().querySelector('.e-content');
|
|
13594
13621
|
}
|
|
13595
13622
|
const scrollHeight = outBuffer * rowHeight;
|
|
13596
|
-
const upScroll = (scrollArgs.offset.top - this.translateY) < 0;
|
|
13623
|
+
const upScroll = (scrollArgs.offset.top - this.translateY) < 0 && this.activeKey !== 'downArrow';
|
|
13597
13624
|
const downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) + rowHeight >= scrollHeight;
|
|
13598
13625
|
const selectedRowIndex = 'selectedRowIndex';
|
|
13599
13626
|
const currentViewData = this.parent.currentViewData;
|
|
@@ -13606,7 +13633,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13606
13633
|
- this.parent.pageSettings.pageSize;
|
|
13607
13634
|
index = (index > 0) ? index : 0;
|
|
13608
13635
|
if (!isNullOrUndefined(this[`${selectedRowIndex}`]) && this[`${selectedRowIndex}`] !== -1 && index !== this[`${selectedRowIndex}`] &&
|
|
13609
|
-
((this.parent.rowHeight * this.parent.pageSettings.pageSize) < content.scrollTop)) {
|
|
13636
|
+
((this.parent.rowHeight * this.parent.pageSettings.pageSize) < content.scrollTop) && !this.parent.allowRowDragAndDrop) {
|
|
13610
13637
|
index = this[`${selectedRowIndex}`];
|
|
13611
13638
|
}
|
|
13612
13639
|
this.startIndex = index;
|
|
@@ -13618,7 +13645,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13618
13645
|
this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);
|
|
13619
13646
|
}
|
|
13620
13647
|
if (currentViewData.length && (currentViewData[0][`${indexValue}`] >= this.parent.pageSettings.pageSize / 2) &&
|
|
13621
|
-
((currentViewData[0][`${indexValue}`] - this.startIndex) < (this.parent.pageSettings.pageSize / 2)) &&
|
|
13648
|
+
((currentViewData[0][`${indexValue}`] - this.startIndex) < (this.parent.pageSettings.pageSize / 2)) &&
|
|
13649
|
+
this.parent.selectionModule && this.parent.selectionModule.isRowSelected) {
|
|
13622
13650
|
this.startIndex = currentViewData[0][`${indexValue}`] - (this.parent.pageSettings.pageSize / 2);
|
|
13623
13651
|
this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;
|
|
13624
13652
|
}
|
|
@@ -13638,6 +13666,9 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13638
13666
|
(this.endIndex - this.parent.pageSettings.pageSize) * (this.parent.rowHeight ?
|
|
13639
13667
|
this.parent.rowHeight : this.parent.getRowHeight()) : 0;
|
|
13640
13668
|
}
|
|
13669
|
+
else if (this.startIndex === this[`${selectedRowIndex}`]) {
|
|
13670
|
+
this.translateY = scrollArgs.offset.top;
|
|
13671
|
+
}
|
|
13641
13672
|
else {
|
|
13642
13673
|
this.translateY = (scrollArgs.offset.top - (outBuffer * rowHeight) > 0) ?
|
|
13643
13674
|
scrollArgs.offset.top - (outBuffer * rowHeight) + rowHeight : 0;
|
|
@@ -13657,7 +13688,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13657
13688
|
let nextSetResIndex = ~~(content.scrollTop / rowHeight);
|
|
13658
13689
|
const isLastBlock = (this[`${selectedRowIndex}`] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;
|
|
13659
13690
|
if (!isNullOrUndefined(this[`${selectedRowIndex}`]) && this[`${selectedRowIndex}`] !== -1 &&
|
|
13660
|
-
nextSetResIndex !== this[`${selectedRowIndex}`] && !isLastBlock) {
|
|
13691
|
+
nextSetResIndex !== this[`${selectedRowIndex}`] && !isLastBlock && !this.parent.allowRowDragAndDrop) {
|
|
13661
13692
|
nextSetResIndex = this[`${selectedRowIndex}`];
|
|
13662
13693
|
}
|
|
13663
13694
|
let lastIndex = nextSetResIndex + this.parent.pageSettings.pageSize;
|
|
@@ -13672,7 +13703,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13672
13703
|
this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
|
|
13673
13704
|
}
|
|
13674
13705
|
if (currentViewData.length && this.startIndex > currentViewData[0][`${indexValue}`] &&
|
|
13675
|
-
((this.startIndex - currentViewData[0][`${indexValue}`]) < (this.parent.pageSettings.pageSize / 2)) &&
|
|
13706
|
+
((this.startIndex - currentViewData[0][`${indexValue}`]) < (this.parent.pageSettings.pageSize / 2)) &&
|
|
13707
|
+
this.parent.selectionModule && this.parent.selectionModule.isRowSelected) {
|
|
13676
13708
|
this.startIndex = currentViewData[0][`${indexValue}`] + (this.parent.pageSettings.pageSize / 2);
|
|
13677
13709
|
}
|
|
13678
13710
|
if (this.parent.root.isSelfReference) {
|
|
@@ -13684,7 +13716,12 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13684
13716
|
}
|
|
13685
13717
|
else {
|
|
13686
13718
|
if (this.totalRecords === this.endIndex) {
|
|
13687
|
-
|
|
13719
|
+
if (isLastBlock) {
|
|
13720
|
+
this.translateY = (this.totalRecords * rowHeight) - (this.parent.pageSettings.pageSize * rowHeight);
|
|
13721
|
+
}
|
|
13722
|
+
else {
|
|
13723
|
+
this.translateY = (this.totalRecords * rowHeight) - ((this.endIndex - this.startIndex) * rowHeight);
|
|
13724
|
+
}
|
|
13688
13725
|
}
|
|
13689
13726
|
else {
|
|
13690
13727
|
if (this.parent.getFrozenColumns() > 0) {
|