@syncfusion/ej2-treegrid 19.3.45 → 19.3.53
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 +29 -0
- 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 +249 -87
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +241 -79
- 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/batch-edit.js +19 -7
- package/src/treegrid/actions/crud-actions.js +1 -0
- package/src/treegrid/actions/edit.js +14 -7
- package/src/treegrid/actions/freeze-column.js +2 -1
- package/src/treegrid/actions/rowdragdrop.js +10 -4
- package/src/treegrid/actions/selection.js +8 -3
- package/src/treegrid/actions/virtual-scroll.js +13 -2
- package/src/treegrid/base/constant.d.ts +4 -0
- package/src/treegrid/base/constant.js +4 -0
- package/src/treegrid/base/treegrid-model.d.ts +8 -0
- package/src/treegrid/base/treegrid.d.ts +8 -0
- package/src/treegrid/base/treegrid.js +46 -17
- package/src/treegrid/renderer/render.js +9 -1
- package/src/treegrid/renderer/virtual-row-model-generator.d.ts +1 -0
- package/src/treegrid/renderer/virtual-row-model-generator.js +12 -0
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +2 -1
- package/src/treegrid/renderer/virtual-tree-content-render.js +102 -35
- package/styles/bootstrap-dark.css +1 -1
- package/styles/bootstrap.css +1 -1
- package/styles/bootstrap4.css +6 -1
- package/styles/bootstrap5-dark.css +6 -1
- package/styles/bootstrap5.css +6 -1
- package/styles/fabric-dark.css +1 -1
- package/styles/fabric.css +1 -1
- package/styles/highcontrast-light.css +1 -1
- package/styles/highcontrast.css +1 -1
- package/styles/material-dark.css +1 -1
- package/styles/material.css +1 -1
- package/styles/tailwind-dark.css +1 -1
- package/styles/tailwind.css +1 -1
- package/styles/treegrid/_layout.scss +1 -1
- package/styles/treegrid/bootstrap-dark.css +1 -1
- package/styles/treegrid/bootstrap.css +1 -1
- package/styles/treegrid/bootstrap4.css +6 -1
- package/styles/treegrid/bootstrap5-dark.css +6 -1
- package/styles/treegrid/bootstrap5.css +6 -1
- package/styles/treegrid/fabric-dark.css +1 -1
- package/styles/treegrid/fabric.css +1 -1
- package/styles/treegrid/highcontrast-light.css +1 -1
- package/styles/treegrid/highcontrast.css +1 -1
- package/styles/treegrid/material-dark.css +1 -1
- package/styles/treegrid/material.css +1 -1
- package/styles/treegrid/tailwind-dark.css +1 -1
- package/styles/treegrid/tailwind.css +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, addClass, classList, closest, compile, createElement, extend, getEnumValue, getValue, isNullOrUndefined, merge, remove, removeClass, select, setValue } from '@syncfusion/ej2-base';
|
|
2
|
-
import { Aggregate, Cell, CellType, Clipboard, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, templateCompiler } from '@syncfusion/ej2-grids';
|
|
1
|
+
import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, addClass, classList, closest, compile, createElement, debounce, extend, getEnumValue, getValue, isNullOrUndefined, merge, remove, removeClass, select, setValue } from '@syncfusion/ej2-base';
|
|
2
|
+
import { Aggregate, Cell, CellType, Clipboard, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, templateCompiler } from '@syncfusion/ej2-grids';
|
|
3
3
|
import { createCheckBox } from '@syncfusion/ej2-buttons';
|
|
4
4
|
import { CacheAdaptor, DataManager, DataUtil, Deferred, JsonAdaptor, ODataAdaptor, Predicate, Query, RemoteSaveAdaptor, UrlAdaptor, WebApiAdaptor, WebMethodAdaptor } from '@syncfusion/ej2-data';
|
|
5
5
|
import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
|
@@ -388,6 +388,8 @@ const virtualColumnIndex = 'virtualColumnIndex';
|
|
|
388
388
|
/** @hidden */
|
|
389
389
|
const virtualActionArgs = 'virtual-action-args';
|
|
390
390
|
/** @hidden */
|
|
391
|
+
const destroy = 'destroy';
|
|
392
|
+
/** @hidden */
|
|
391
393
|
const dataListener = 'data-listener';
|
|
392
394
|
/** @hidden */
|
|
393
395
|
const indexModifier = 'index-modifier';
|
|
@@ -415,6 +417,8 @@ const rowsRemove = 'rows-remove';
|
|
|
415
417
|
const rowdraging = 'row-draging';
|
|
416
418
|
/** @hidden */
|
|
417
419
|
const rowDropped = 'row-dropped';
|
|
420
|
+
/** @hidden */
|
|
421
|
+
const autoCol = 'auto-col';
|
|
418
422
|
|
|
419
423
|
/**
|
|
420
424
|
* The `Clipboard` module is used to handle clipboard copy action.
|
|
@@ -1033,12 +1037,12 @@ class Selection {
|
|
|
1033
1037
|
let index = -1;
|
|
1034
1038
|
let length = 0;
|
|
1035
1039
|
if (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) {
|
|
1036
|
-
|
|
1037
|
-
if (this.filteredList.length
|
|
1040
|
+
const filterResult = this.parent.filterModule.filteredResult;
|
|
1041
|
+
if (this.filteredList.length === 0) {
|
|
1038
1042
|
this.filteredList = filterResult;
|
|
1039
1043
|
}
|
|
1040
1044
|
else {
|
|
1041
|
-
if (this.filteredList
|
|
1045
|
+
if (this.filteredList !== filterResult) {
|
|
1042
1046
|
this.filteredList = filterResult;
|
|
1043
1047
|
}
|
|
1044
1048
|
}
|
|
@@ -1206,7 +1210,12 @@ class Selection {
|
|
|
1206
1210
|
this.parent.getCurrentViewRecords() : this.parent.flatData;
|
|
1207
1211
|
childData.forEach((record) => {
|
|
1208
1212
|
if (this.parent.enableVirtualization) {
|
|
1209
|
-
record.hasChildRecords
|
|
1213
|
+
if (record.hasChildRecords) {
|
|
1214
|
+
this.updateParentSelection(record);
|
|
1215
|
+
}
|
|
1216
|
+
else {
|
|
1217
|
+
this.updateSelectedItems(record, record.checkboxState);
|
|
1218
|
+
}
|
|
1210
1219
|
let child = findChildrenRecords(record);
|
|
1211
1220
|
child = this.getFilteredChildRecords(child);
|
|
1212
1221
|
for (let i = 0; i < child.length; i++) {
|
|
@@ -1450,7 +1459,15 @@ class Render {
|
|
|
1450
1459
|
else {
|
|
1451
1460
|
index = data.index;
|
|
1452
1461
|
}
|
|
1453
|
-
|
|
1462
|
+
let columnIndex;
|
|
1463
|
+
const getVirtualColIndexByUid = 'getVirtualColIndexByUid';
|
|
1464
|
+
if (this.parent.enableColumnVirtualization && !this.parent.initialRender) {
|
|
1465
|
+
columnIndex = this.parent[getVirtualColIndexByUid](args.column.uid);
|
|
1466
|
+
}
|
|
1467
|
+
else {
|
|
1468
|
+
columnIndex = grid.getColumnIndexByUid(args.column.uid);
|
|
1469
|
+
}
|
|
1470
|
+
if (columnIndex === this.parent.treeColumnIndex && (args.requestType === 'add' || args.requestType
|
|
1454
1471
|
=== 'rowDragAndDrop' || args.requestType === 'delete' || isNullOrUndefined(args.cell.querySelector('.e-treecell')))) {
|
|
1455
1472
|
const container = createElement('div', { className: 'e-treecolumn-container' });
|
|
1456
1473
|
const emptyExpandIcon = createElement('span', {
|
|
@@ -1507,7 +1524,7 @@ class Render {
|
|
|
1507
1524
|
else if (this.templateResult) {
|
|
1508
1525
|
this.templateResult = null;
|
|
1509
1526
|
}
|
|
1510
|
-
|
|
1527
|
+
const freeze = (grid.getFrozenLeftColumnsCount() > 0 || grid.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
1511
1528
|
if (!freeze) {
|
|
1512
1529
|
if (frozenColumns > this.parent.treeColumnIndex && frozenColumns > 0 &&
|
|
1513
1530
|
grid.getColumnIndexByUid(args.column.uid) === frozenColumns) {
|
|
@@ -1524,9 +1541,9 @@ class Render {
|
|
|
1524
1541
|
}
|
|
1525
1542
|
}
|
|
1526
1543
|
else {
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1544
|
+
const freezerightColumns = grid.getFrozenRightColumns();
|
|
1545
|
+
const freezeLeftColumns = grid.getFrozenLeftColumns();
|
|
1546
|
+
const movableColumns = grid.getMovableColumns();
|
|
1530
1547
|
if ((freezerightColumns.length > 0) && freezerightColumns[0].field === args.column.field) {
|
|
1531
1548
|
addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);
|
|
1532
1549
|
}
|
|
@@ -2545,6 +2562,7 @@ function editAction(details, control, isSelfReference, addRowIndex, selectedInde
|
|
|
2545
2562
|
const childRecords = parentData ? parentData[control.childMapping] : [];
|
|
2546
2563
|
for (let p = childRecords.length - 1; p >= 0; p--) {
|
|
2547
2564
|
if (childRecords[p][control.idMapping] === currentData[control.idMapping]) {
|
|
2565
|
+
parentData['childRecords'].splice(p, 1);
|
|
2548
2566
|
childRecords.splice(p, 1);
|
|
2549
2567
|
if (!childRecords.length) {
|
|
2550
2568
|
parentData.hasChildRecords = false;
|
|
@@ -3277,7 +3295,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3277
3295
|
member: 'ExcelExport', args: [this]
|
|
3278
3296
|
});
|
|
3279
3297
|
}
|
|
3280
|
-
if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
|
|
3298
|
+
if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
|
|
3299
|
+
this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) {
|
|
3281
3300
|
modules.push({
|
|
3282
3301
|
member: 'freeze', args: [this]
|
|
3283
3302
|
});
|
|
@@ -3495,6 +3514,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3495
3514
|
this.grid.allowSorting = this.allowSorting;
|
|
3496
3515
|
this.grid.allowFiltering = this.allowFiltering;
|
|
3497
3516
|
this.grid.enableVirtualization = this.enableVirtualization;
|
|
3517
|
+
this.grid.enableColumnVirtualization = this.enableColumnVirtualization;
|
|
3498
3518
|
this.grid.enableInfiniteScrolling = this.enableInfiniteScrolling;
|
|
3499
3519
|
this.grid.infiniteScrollSettings = this.infiniteScrollSettings;
|
|
3500
3520
|
this.grid.width = this.width;
|
|
@@ -3851,6 +3871,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3851
3871
|
&& (this.grid.filterSettings.columns.length === 0 || this.grid.searchSettings.key.length === 0)) {
|
|
3852
3872
|
this.notify('clearFilters', { flatData: this.grid.dataSource });
|
|
3853
3873
|
this.grid.setProperties({ dataSource: this.dataResults.result }, true);
|
|
3874
|
+
if (isNullOrUndefined(this.grid['changedProperties'].dataSource)) {
|
|
3875
|
+
this.grid.renderModule.data.dataManager = this.grid.dataSource instanceof DataManager ? this.grid.dataSource :
|
|
3876
|
+
(isNullOrUndefined(this.grid.dataSource) ? new DataManager() : new DataManager(this.grid.dataSource));
|
|
3877
|
+
}
|
|
3854
3878
|
}
|
|
3855
3879
|
const callBackPromise = new Deferred();
|
|
3856
3880
|
this.trigger(actionBegin, args, (actionArgs) => {
|
|
@@ -3876,7 +3900,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3876
3900
|
this.notify(batchSave, args);
|
|
3877
3901
|
}
|
|
3878
3902
|
this.notify('updateGridActions', args);
|
|
3879
|
-
if (args.requestType === 'save' && this.aggregates.map((ag) => ag.showChildSummary
|
|
3903
|
+
if (args.requestType === 'save' && this.aggregates.map((ag) => ag.showChildSummary === true).length) {
|
|
3880
3904
|
this.grid.refresh();
|
|
3881
3905
|
}
|
|
3882
3906
|
this.trigger(actionComplete, args);
|
|
@@ -4166,6 +4190,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4166
4190
|
case 'enableVirtualization':
|
|
4167
4191
|
this.grid.enableVirtualization = this.enableVirtualization;
|
|
4168
4192
|
break;
|
|
4193
|
+
case 'enableColumnVirtualization':
|
|
4194
|
+
this.grid.enableColumnVirtualization = this.enableColumnVirtualization;
|
|
4195
|
+
break;
|
|
4169
4196
|
case 'toolbar':
|
|
4170
4197
|
this.grid.toolbar = this.getGridToolbar();
|
|
4171
4198
|
break;
|
|
@@ -4389,6 +4416,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4389
4416
|
if (isNullOrUndefined(this.grid)) {
|
|
4390
4417
|
return;
|
|
4391
4418
|
}
|
|
4419
|
+
if (!isNullOrUndefined(this.rowDropSettings.targetID) &&
|
|
4420
|
+
isNullOrUndefined(document.getElementById(this.grid.rowDropSettings.targetID))) {
|
|
4421
|
+
document.getElementById(this.rowDropSettings.targetID).id = this.grid.rowDropSettings.targetID;
|
|
4422
|
+
this.rowDropSettings.targetID = this.grid.rowDropSettings.targetID;
|
|
4423
|
+
}
|
|
4392
4424
|
super.dataBind();
|
|
4393
4425
|
this.grid.dataBind();
|
|
4394
4426
|
}
|
|
@@ -4400,7 +4432,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4400
4432
|
*/
|
|
4401
4433
|
getPersistData() {
|
|
4402
4434
|
const keyEntity = ['pageSettings', 'sortSettings',
|
|
4403
|
-
'filterSettings', 'columns', 'searchSettings', 'selectedRowIndex'];
|
|
4435
|
+
'filterSettings', 'columns', 'searchSettings', 'selectedRowIndex', 'treeColumnIndex'];
|
|
4404
4436
|
const ignoreOnPersist = {
|
|
4405
4437
|
pageSettings: ['template', 'pageSizes', 'pageSizeMode', 'enableQueryString', 'totalRecordsCount', 'pageCount'],
|
|
4406
4438
|
filterSettings: ['type', 'mode', 'showFilterBarStatus', 'immediateModeDelay', 'ignoreAccent', 'hierarchyMode'],
|
|
@@ -4411,8 +4443,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4411
4443
|
'commandTemplate', 'commands', 'dataSource'];
|
|
4412
4444
|
for (let i = 0; i < keyEntity.length; i++) {
|
|
4413
4445
|
const currentObject = this[keyEntity[i]];
|
|
4414
|
-
for (
|
|
4415
|
-
|
|
4446
|
+
for (let k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {
|
|
4447
|
+
let objVal = val[k];
|
|
4448
|
+
delete currentObject[objVal];
|
|
4416
4449
|
}
|
|
4417
4450
|
}
|
|
4418
4451
|
this.ignoreInArrays(ignoreOnColumn, this.columns);
|
|
@@ -4725,7 +4758,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4725
4758
|
* @returns {Column} - Returns tree grid column
|
|
4726
4759
|
*/
|
|
4727
4760
|
getColumnByUid(uid) {
|
|
4728
|
-
|
|
4761
|
+
const Columns = this.initialRender ? this.grid.columns : this.columns;
|
|
4729
4762
|
return iterateArrayOrObject(Columns, (item) => {
|
|
4730
4763
|
if (item.uid === uid) {
|
|
4731
4764
|
return item;
|
|
@@ -4815,6 +4848,16 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4815
4848
|
getColumnIndexByField(field) {
|
|
4816
4849
|
return this.grid.getColumnIndexByField(field);
|
|
4817
4850
|
}
|
|
4851
|
+
getVirtualColIndexByUid(uid) {
|
|
4852
|
+
const columnModel = 'columnModel';
|
|
4853
|
+
const index = iterateArrayOrObject(this.grid[columnModel], (item, index) => {
|
|
4854
|
+
if (item.uid === uid) {
|
|
4855
|
+
return index;
|
|
4856
|
+
}
|
|
4857
|
+
return undefined;
|
|
4858
|
+
})[0];
|
|
4859
|
+
return !isNullOrUndefined(index) ? index : -1;
|
|
4860
|
+
}
|
|
4818
4861
|
/**
|
|
4819
4862
|
* Gets a column index by UID.
|
|
4820
4863
|
*
|
|
@@ -4843,17 +4886,19 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4843
4886
|
temp = this.columnModel[this.treeColumnIndex].template;
|
|
4844
4887
|
field = this.columnModel[this.treeColumnIndex].field;
|
|
4845
4888
|
}
|
|
4846
|
-
this.columnModel = [];
|
|
4847
4889
|
let stackedHeader = false;
|
|
4848
4890
|
let gridColumn;
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
for (
|
|
4852
|
-
gridColumn
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
this.columnModel
|
|
4891
|
+
if (!this.enableColumnVirtualization || (this.enableColumnVirtualization && this.columnModel.length === gridColumns.length)) {
|
|
4892
|
+
this.columnModel = [];
|
|
4893
|
+
for (let i = 0; i < gridColumns.length; i++) {
|
|
4894
|
+
gridColumn = {};
|
|
4895
|
+
for (const prop of Object.keys(gridColumns[i])) {
|
|
4896
|
+
gridColumn[prop] = gridColumns[i][prop];
|
|
4897
|
+
}
|
|
4898
|
+
this.columnModel.push(new Column(gridColumn));
|
|
4899
|
+
if (field === this.columnModel[i].field && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
4900
|
+
this.columnModel[i].template = temp;
|
|
4901
|
+
}
|
|
4857
4902
|
}
|
|
4858
4903
|
}
|
|
4859
4904
|
const merge$$1 = 'deepMerge';
|
|
@@ -5156,7 +5201,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5156
5201
|
});
|
|
5157
5202
|
}
|
|
5158
5203
|
setHeightForFrozenContent() {
|
|
5159
|
-
|
|
5204
|
+
const freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
5160
5205
|
if (this.grid.getFrozenColumns() > 0 || freeze) {
|
|
5161
5206
|
this.grid.contentModule.refreshScrollOffset();
|
|
5162
5207
|
}
|
|
@@ -5222,7 +5267,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5222
5267
|
const row = getObject('rows', rec);
|
|
5223
5268
|
const record = getObject('records', rec);
|
|
5224
5269
|
for (let i = 0; i < record.length; i++) {
|
|
5225
|
-
if (record[i].parentItem
|
|
5270
|
+
if (record[i].parentItem !== undefined) {
|
|
5226
5271
|
const pindex = this.flatData[record[i].parentItem.index].index;
|
|
5227
5272
|
if (this.flatData[pindex].expanded === false) {
|
|
5228
5273
|
record.push(this.flatData[pindex]);
|
|
@@ -5546,7 +5591,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5546
5591
|
else {
|
|
5547
5592
|
rows = gridRows.filter((r) => r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1)));
|
|
5548
5593
|
}
|
|
5549
|
-
|
|
5594
|
+
const freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
5550
5595
|
if (this.frozenRows || this.frozenColumns || this.getFrozenColumns() || freeze) {
|
|
5551
5596
|
movableRows = this.getMovableRows().filter((r) => r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1)));
|
|
5552
5597
|
}
|
|
@@ -5614,7 +5659,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5614
5659
|
let childRecord;
|
|
5615
5660
|
let movablerows = [];
|
|
5616
5661
|
let rightrows = [];
|
|
5617
|
-
|
|
5662
|
+
const freeze = (this.getFrozenLeftColumnsCount() > 0 || this.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
5618
5663
|
if (freeze) {
|
|
5619
5664
|
movablerows = this.getMovableRows().filter((r) => r.querySelector('.e-gridrowindex' + rowDetails.record.index + 'level' + (rowDetails.record.level + 1)));
|
|
5620
5665
|
rightrows = this.getFrozenRightRows().filter((r) => r.querySelector('.e-gridrowindex' + rowDetails.record.index + 'level' + (rowDetails.record.level + 1)));
|
|
@@ -6172,6 +6217,9 @@ __decorate([
|
|
|
6172
6217
|
__decorate([
|
|
6173
6218
|
Property(false)
|
|
6174
6219
|
], TreeGrid.prototype, "enableVirtualization", void 0);
|
|
6220
|
+
__decorate([
|
|
6221
|
+
Property(false)
|
|
6222
|
+
], TreeGrid.prototype, "enableColumnVirtualization", void 0);
|
|
6175
6223
|
__decorate([
|
|
6176
6224
|
Property(false)
|
|
6177
6225
|
], TreeGrid.prototype, "enableInfiniteScrolling", void 0);
|
|
@@ -6846,7 +6894,8 @@ class RowDD$1 {
|
|
|
6846
6894
|
const bottomRowSegment = middleRowSegment + divide;
|
|
6847
6895
|
const mouseEvent = getObject('originalEvent.event', args);
|
|
6848
6896
|
const touchEvent = getObject('originalEvent.event', args);
|
|
6849
|
-
const posy = (mouseEvent.type
|
|
6897
|
+
const posy = (mouseEvent.type === 'mousemove') ? mouseEvent.pageY : ((!isNullOrUndefined(touchEvent) &&
|
|
6898
|
+
!isNullOrUndefined(touchEvent.changedTouches)) ? touchEvent.changedTouches[0].pageY : null);
|
|
6850
6899
|
const isTopSegment = posy <= topRowSegment;
|
|
6851
6900
|
const isMiddleRowSegment = (posy > topRowSegment && posy <= middleRowSegment);
|
|
6852
6901
|
const isBottomRowSegment = (posy > middleRowSegment && posy <= bottomRowSegment);
|
|
@@ -7073,7 +7122,7 @@ class RowDD$1 {
|
|
|
7073
7122
|
}
|
|
7074
7123
|
else {
|
|
7075
7124
|
if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID) || parentsUntil(args.target, 'e-treegrid') &&
|
|
7076
|
-
parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID) {
|
|
7125
|
+
parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID || args.target && document.getElementById(tObj.rowDropSettings.targetID)) {
|
|
7077
7126
|
setValue('dropPosition', this.dropPosition, args);
|
|
7078
7127
|
tObj.trigger(rowDrop, args);
|
|
7079
7128
|
if (!args.cancel && tObj.rowDropSettings.targetID) {
|
|
@@ -7396,6 +7445,11 @@ class RowDD$1 {
|
|
|
7396
7445
|
draggedRecord.parentItem = parentItem;
|
|
7397
7446
|
draggedRecord.parentUniqueID = droppedRecord.uniqueID;
|
|
7398
7447
|
droppedRecord.childRecords.splice(droppedRecord.childRecords.length, 0, draggedRecord);
|
|
7448
|
+
const isSelfReference = 'isSelfReference';
|
|
7449
|
+
if (tObj[isSelfReference]) {
|
|
7450
|
+
droppedRecord[tObj.childMapping] = [];
|
|
7451
|
+
droppedRecord[tObj.childMapping].splice(droppedRecord[tObj.childMapping].length, 0, draggedRecord);
|
|
7452
|
+
}
|
|
7399
7453
|
if (!isNullOrUndefined(draggedRecord) && !tObj.parentIdMapping && !isNullOrUndefined(droppedRecord.taskData[childItem])) {
|
|
7400
7454
|
droppedRecord.taskData[tObj.childMapping].splice(droppedRecord.childRecords.length, 0, draggedRecord.taskData);
|
|
7401
7455
|
}
|
|
@@ -7434,7 +7488,7 @@ class RowDD$1 {
|
|
|
7434
7488
|
}
|
|
7435
7489
|
length = record.childRecords.length;
|
|
7436
7490
|
for (let i = 0; i < length; i++) {
|
|
7437
|
-
currentRecord = record.childRecords[i];
|
|
7491
|
+
currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, tObj);
|
|
7438
7492
|
count++;
|
|
7439
7493
|
tObj.flatData.splice(count, 0, currentRecord);
|
|
7440
7494
|
setValue('uniqueIDCollection.' + currentRecord.uniqueID, currentRecord, this.parent);
|
|
@@ -7456,7 +7510,7 @@ class RowDD$1 {
|
|
|
7456
7510
|
}
|
|
7457
7511
|
length = record.childRecords.length;
|
|
7458
7512
|
for (let i = 0; i < length; i++) {
|
|
7459
|
-
currentRecord = record.childRecords[i];
|
|
7513
|
+
currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, this.parent);
|
|
7460
7514
|
let parentData;
|
|
7461
7515
|
if (record.parentItem) {
|
|
7462
7516
|
parentData = getParentData(this.parent, record.parentItem.uniqueID);
|
|
@@ -7691,7 +7745,19 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
|
|
|
7691
7745
|
getDatas(args) {
|
|
7692
7746
|
this.visualData = args.data;
|
|
7693
7747
|
}
|
|
7748
|
+
getDataInfo() {
|
|
7749
|
+
return super.getData();
|
|
7750
|
+
}
|
|
7694
7751
|
generateRows(data, notifyArgs) {
|
|
7752
|
+
const info = this.getDataInfo();
|
|
7753
|
+
if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
|
|
7754
|
+
if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
|
|
7755
|
+
notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
|
|
7756
|
+
}
|
|
7757
|
+
else {
|
|
7758
|
+
notifyArgs.virtualInfo.blockIndexes = this.getBlockIndexes(notifyArgs.virtualInfo.page);
|
|
7759
|
+
}
|
|
7760
|
+
}
|
|
7695
7761
|
if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
7696
7762
|
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
|
|
7697
7763
|
return super.generateRows(data, notifyArgs);
|
|
@@ -9219,10 +9285,11 @@ class BatchEdit {
|
|
|
9219
9285
|
if (frozenCols && args.columnObject.index > frozenCols) {
|
|
9220
9286
|
actualCellIndex = actualCellIndex + frozenCols;
|
|
9221
9287
|
}
|
|
9222
|
-
|
|
9288
|
+
const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
9289
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
9223
9290
|
if (freeze) {
|
|
9224
|
-
|
|
9225
|
-
if (colCount
|
|
9291
|
+
const colCount = this.parent.getFrozenLeftColumnsCount() + actualCellIndex;
|
|
9292
|
+
if (colCount === this.parent.treeColumnIndex) {
|
|
9226
9293
|
this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,
|
|
9227
9294
|
column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)
|
|
9228
9295
|
});
|
|
@@ -9384,7 +9451,7 @@ class BatchEdit {
|
|
|
9384
9451
|
focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];
|
|
9385
9452
|
}
|
|
9386
9453
|
}
|
|
9387
|
-
beforeBatchDelete() {
|
|
9454
|
+
beforeBatchDelete(args) {
|
|
9388
9455
|
if (!this.batchRecords.length) {
|
|
9389
9456
|
this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());
|
|
9390
9457
|
this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());
|
|
@@ -9394,9 +9461,19 @@ class BatchEdit {
|
|
|
9394
9461
|
const row = [];
|
|
9395
9462
|
let records = [];
|
|
9396
9463
|
const primarykey = this.parent.grid.getPrimaryKeyFieldNames()[0];
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9464
|
+
let data;
|
|
9465
|
+
let childs;
|
|
9466
|
+
let uid;
|
|
9467
|
+
if (!isNullOrUndefined(args.row) && this.parent.getSelectedRows().indexOf(args.row) === -1) {
|
|
9468
|
+
data = args.rowData;
|
|
9469
|
+
childs = findChildrenRecords(data);
|
|
9470
|
+
uid = args.row.getAttribute('data-uid');
|
|
9471
|
+
}
|
|
9472
|
+
else {
|
|
9473
|
+
data = this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length - 1];
|
|
9474
|
+
childs = findChildrenRecords(data);
|
|
9475
|
+
uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');
|
|
9476
|
+
}
|
|
9400
9477
|
const parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10);
|
|
9401
9478
|
if (childs.length) {
|
|
9402
9479
|
const totalCount = parentRowIndex + childs.length;
|
|
@@ -9436,7 +9513,8 @@ class BatchEdit {
|
|
|
9436
9513
|
for (let i = 0; i < rows.length; i++) {
|
|
9437
9514
|
rows[i].setAttribute('aria-rowindex', i.toString());
|
|
9438
9515
|
}
|
|
9439
|
-
|
|
9516
|
+
const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
9517
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
9440
9518
|
if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {
|
|
9441
9519
|
const mRows = this.parent.grid.getMovableDataRows();
|
|
9442
9520
|
const freezeRightRows = this.parent.grid.getFrozenRightDataRows();
|
|
@@ -9947,7 +10025,7 @@ class Edit$1 {
|
|
|
9947
10025
|
if (args.action === 'f2') {
|
|
9948
10026
|
this.recordDoubleClick(args);
|
|
9949
10027
|
}
|
|
9950
|
-
if (args.action
|
|
10028
|
+
if (args.action === 'escape') {
|
|
9951
10029
|
this.parent.closeEdit();
|
|
9952
10030
|
}
|
|
9953
10031
|
}
|
|
@@ -10056,12 +10134,13 @@ class Edit$1 {
|
|
|
10056
10134
|
});
|
|
10057
10135
|
}
|
|
10058
10136
|
else {
|
|
10059
|
-
|
|
10137
|
+
const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
10138
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
10060
10139
|
if (freeze) {
|
|
10061
|
-
if (this.parent.getRows().indexOf(row)
|
|
10140
|
+
if (this.parent.getRows().indexOf(row) !== -1) {
|
|
10062
10141
|
rowIndex = this.parent.getRows().indexOf(row);
|
|
10063
10142
|
}
|
|
10064
|
-
else if (this.parent.getFrozenRightRows().indexOf(row)
|
|
10143
|
+
else if (this.parent.getFrozenRightRows().indexOf(row) !== -1) {
|
|
10065
10144
|
rowIndex = this.parent.getFrozenRightRows().indexOf(row);
|
|
10066
10145
|
}
|
|
10067
10146
|
else {
|
|
@@ -10128,7 +10207,8 @@ class Edit$1 {
|
|
|
10128
10207
|
this.isOnBatch = false;
|
|
10129
10208
|
}
|
|
10130
10209
|
this.enableToolbarItems('save');
|
|
10131
|
-
|
|
10210
|
+
const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
10211
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
10132
10212
|
if (freeze) {
|
|
10133
10213
|
if (args.cell.closest('.e-frozen-left-header') || args.cell.closest('.e-frozen-left-content')) {
|
|
10134
10214
|
mRow = this.parent.grid.getRows()[rowIndex];
|
|
@@ -10165,7 +10245,7 @@ class Edit$1 {
|
|
|
10165
10245
|
type: 'save', column: this.parent.getColumnByField(args.columnName), data: args.rowData,
|
|
10166
10246
|
previousData: args.previousValue, row: row, target: args.cell
|
|
10167
10247
|
};
|
|
10168
|
-
if (this.parent.aggregates.map((ag) => ag.showChildSummary
|
|
10248
|
+
if (this.parent.aggregates.map((ag) => ag.showChildSummary === true).length) {
|
|
10169
10249
|
this.parent.grid.refresh();
|
|
10170
10250
|
}
|
|
10171
10251
|
this.parent.trigger(actionComplete, saveArgs);
|
|
@@ -10207,6 +10287,10 @@ class Edit$1 {
|
|
|
10207
10287
|
}
|
|
10208
10288
|
}
|
|
10209
10289
|
setValue('uniqueIDCollection.' + data[i].uniqueID + '.index', i, this.parent);
|
|
10290
|
+
const adaptor = this.parent.dataSource.adaptor;
|
|
10291
|
+
if ((isRemoteData(this.parent) || adaptor instanceof RemoteSaveAdaptor)) {
|
|
10292
|
+
setValue('uniqueIDCollection.' + data[i].uniqueID, data[i], this.parent);
|
|
10293
|
+
}
|
|
10210
10294
|
if (!data[i].level) {
|
|
10211
10295
|
this.parent.parentData.push(data[i]);
|
|
10212
10296
|
}
|
|
@@ -10326,7 +10410,8 @@ class Edit$1 {
|
|
|
10326
10410
|
this.parent.grid.contentModule[r].splice(0, 1);
|
|
10327
10411
|
this.parent.grid.contentModule[r].splice(rowObjectIndex, 0, newRowObject);
|
|
10328
10412
|
}
|
|
10329
|
-
|
|
10413
|
+
const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
10414
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
10330
10415
|
if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {
|
|
10331
10416
|
const movableRows = this.parent.getMovableDataRows();
|
|
10332
10417
|
const frows = 'freezeRows';
|
|
@@ -10874,9 +10959,9 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
10874
10959
|
if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
10875
10960
|
&& this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
|
|
10876
10961
|
this.parent[action]('data-ready', this.onDataReady, this);
|
|
10877
|
-
|
|
10962
|
+
this.parent[action]('refresh-virtual-block', this.refreshContentRows, this);
|
|
10878
10963
|
this.fn = () => {
|
|
10879
|
-
this.observers.observes((scrollArgs) => this.scrollListeners(scrollArgs));
|
|
10964
|
+
this.observers.observes((scrollArgs) => this.scrollListeners(scrollArgs), this.onEnteredAction());
|
|
10880
10965
|
this.parent.off('content-ready', this.fn);
|
|
10881
10966
|
};
|
|
10882
10967
|
this.parent.addEventListener('dataBound', this.dataBoundEvent.bind(this));
|
|
@@ -10908,7 +10993,9 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
10908
10993
|
&& this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
|
|
10909
10994
|
if (!isNullOrUndefined(e.count)) {
|
|
10910
10995
|
this.totalRecords = e.count;
|
|
10911
|
-
|
|
10996
|
+
if (!this.parent.enableColumnVirtualization) {
|
|
10997
|
+
getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');
|
|
10998
|
+
}
|
|
10912
10999
|
}
|
|
10913
11000
|
if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || this.isDataSourceChanged) {
|
|
10914
11001
|
this.contents.scrollTop = 0;
|
|
@@ -10966,6 +11053,10 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
10966
11053
|
return;
|
|
10967
11054
|
}
|
|
10968
11055
|
const selectVirtualRow = 'selectVirtualRow';
|
|
11056
|
+
const containerRect = 'containerRect';
|
|
11057
|
+
if (isNullOrUndefined(this.observer[containerRect])) {
|
|
11058
|
+
this.observer[containerRect] = this.observers[containerRect];
|
|
11059
|
+
}
|
|
10969
11060
|
super[selectVirtualRow](args);
|
|
10970
11061
|
}
|
|
10971
11062
|
refreshCell(rowObj) {
|
|
@@ -11072,15 +11163,38 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11072
11163
|
const actionComplete$$1 = 'actionComplete';
|
|
11073
11164
|
super[actionComplete$$1](args);
|
|
11074
11165
|
}
|
|
11166
|
+
onEnteredAction() {
|
|
11167
|
+
return (element, current, direction, e, isWheel, check) => {
|
|
11168
|
+
const directVirtualRender = 'directVirtualRender';
|
|
11169
|
+
if (!this.parent[directVirtualRender]) { // with this property, columns are rendered without debouncing on horizontal scroll.
|
|
11170
|
+
const preventEvent = 'preventEvent';
|
|
11171
|
+
if (Browser.isIE && !isWheel && check && !this[preventEvent]) {
|
|
11172
|
+
this.parent.showSpinner();
|
|
11173
|
+
}
|
|
11174
|
+
const xAxis = current.axis === 'X';
|
|
11175
|
+
let x = this.getColumnOffset(xAxis ? this.vgenerator.getColumnIndexes()[0] - 1 : this.prevInfo.columnIndexes[0]
|
|
11176
|
+
- 1);
|
|
11177
|
+
if (xAxis) {
|
|
11178
|
+
const idx = Object.keys(this.vgenerator.cOffsets).length - this.prevInfo.columnIndexes.length;
|
|
11179
|
+
const maxLeft = this.vgenerator.cOffsets[idx - 1];
|
|
11180
|
+
x = x > maxLeft ? maxLeft : x; //TODO: This fix horizontal scrollbar jumping issue in column virtualization.
|
|
11181
|
+
}
|
|
11182
|
+
this.virtualEle.adjustTable(x, this.translateY);
|
|
11183
|
+
if (this.parent.enableColumnVirtualization) {
|
|
11184
|
+
this.header.virtualEle.adjustTable(x, 0);
|
|
11185
|
+
}
|
|
11186
|
+
}
|
|
11187
|
+
};
|
|
11188
|
+
}
|
|
11075
11189
|
scrollListeners(scrollArgs) {
|
|
11076
11190
|
const info = scrollArgs.sentinel;
|
|
11077
|
-
const outBuffer =
|
|
11191
|
+
const outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
|
|
11078
11192
|
const content = this.parent.getContent().querySelector('.e-content');
|
|
11079
11193
|
const scrollHeight = outBuffer * this.parent.getRowHeight();
|
|
11080
11194
|
const upScroll = (scrollArgs.offset.top - this.translateY) < 0;
|
|
11081
11195
|
const downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) >= scrollHeight;
|
|
11082
11196
|
const selectedRowIndex = 'selectedRowIndex';
|
|
11083
|
-
if (upScroll) {
|
|
11197
|
+
if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
|
|
11084
11198
|
const vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :
|
|
11085
11199
|
this.parent.element.getBoundingClientRect().height);
|
|
11086
11200
|
let index = (~~(content.scrollTop / this.parent.getRowHeight())
|
|
@@ -11117,7 +11231,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11117
11231
|
scrollArgs.offset.top - (outBuffer * height) + 10 : 0;
|
|
11118
11232
|
}
|
|
11119
11233
|
}
|
|
11120
|
-
else if (downScroll) {
|
|
11234
|
+
else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
|
|
11121
11235
|
let nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
|
|
11122
11236
|
const isLastBlock = (this[selectedRowIndex] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;
|
|
11123
11237
|
if (!isNullOrUndefined(this[selectedRowIndex]) && this[selectedRowIndex] !== -1 &&
|
|
@@ -11138,14 +11252,17 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11138
11252
|
this.translateY = scrollArgs.offset.top;
|
|
11139
11253
|
}
|
|
11140
11254
|
}
|
|
11141
|
-
if ((downScroll && (scrollArgs.offset.top < (this.parent.getRowHeight() * this.totalRecords)))
|
|
11142
|
-
|| (upScroll)) {
|
|
11143
|
-
const viewInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
|
|
11255
|
+
if (((downScroll && (scrollArgs.offset.top < (this.parent.getRowHeight() * this.totalRecords)))
|
|
11256
|
+
|| (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left')) {
|
|
11257
|
+
const viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
|
|
11144
11258
|
this.previousInfo = viewInfo;
|
|
11259
|
+
this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);
|
|
11145
11260
|
const page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;
|
|
11146
11261
|
this.parent.setProperties({ pageSettings: { currentPage: page } }, true);
|
|
11147
|
-
|
|
11148
|
-
|
|
11262
|
+
if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
|
|
11263
|
+
viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
|
|
11264
|
+
}
|
|
11265
|
+
this.parent.notify(viewInfo.event, { requestType: 'virtualscroll', virtualInfo: viewInfo, focusElement: scrollArgs.focusElement });
|
|
11149
11266
|
}
|
|
11150
11267
|
}
|
|
11151
11268
|
appendContent(target, newChild, e) {
|
|
@@ -11162,7 +11279,14 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11162
11279
|
getValue('currentInfo', this) : e.virtualInfo;
|
|
11163
11280
|
const cBlock = (info.columnIndexes[0]) - 1;
|
|
11164
11281
|
const cOffset = this.getColumnOffset(cBlock);
|
|
11165
|
-
|
|
11282
|
+
let width;
|
|
11283
|
+
if (this.parent.enableColumnVirtualization) {
|
|
11284
|
+
this.header.virtualEle.adjustTable(cOffset, 0);
|
|
11285
|
+
const cIndex = info.columnIndexes;
|
|
11286
|
+
width = this.getColumnOffset(cIndex[cIndex.length - 1]) - this.getColumnOffset(cIndex[0] - 1) + '';
|
|
11287
|
+
this.header.virtualEle.setWrapperWidth(width);
|
|
11288
|
+
}
|
|
11289
|
+
this.virtualEle.setWrapperWidth(width, (Browser.isIE || Browser.info.name === 'edge'));
|
|
11166
11290
|
target = this.parent.createElement('tbody');
|
|
11167
11291
|
target.appendChild(newChild);
|
|
11168
11292
|
const replace = 'replaceWith';
|
|
@@ -11174,8 +11298,12 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11174
11298
|
this.isExpandCollapse = false;
|
|
11175
11299
|
}
|
|
11176
11300
|
setValue('prevInfo', this.previousInfo ? this.previousInfo : info, this);
|
|
11301
|
+
if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'X') {
|
|
11302
|
+
this.parent.notify(autoCol, {});
|
|
11303
|
+
}
|
|
11177
11304
|
const focusCell = 'focusCell';
|
|
11178
11305
|
const restoreAdd = 'restoreAdd';
|
|
11306
|
+
const ensureSelectedRowPosition = 'ensureSelectedRowPosition';
|
|
11179
11307
|
super[focusCell](e);
|
|
11180
11308
|
const isAdd = 'isAdd';
|
|
11181
11309
|
if (this[isAdd] && !this.parent.getContent().querySelector('.e-content').querySelector('.e-addedrow')) {
|
|
@@ -11191,6 +11319,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11191
11319
|
}
|
|
11192
11320
|
this.restoreEditState();
|
|
11193
11321
|
super[restoreAdd]();
|
|
11322
|
+
super[ensureSelectedRowPosition]();
|
|
11194
11323
|
}
|
|
11195
11324
|
}
|
|
11196
11325
|
removeEventListener() {
|
|
@@ -11223,27 +11352,33 @@ class TreeInterSectionObserver extends InterSectionObserver {
|
|
|
11223
11352
|
this.lastPos = 0;
|
|
11224
11353
|
this.timer = 0;
|
|
11225
11354
|
}
|
|
11226
|
-
observes(callback) {
|
|
11355
|
+
observes(callback, onEnterCallback) {
|
|
11227
11356
|
const containerRect = 'containerRect';
|
|
11228
11357
|
super[containerRect] = getValue('options', this).container.getBoundingClientRect();
|
|
11229
|
-
EventHandler.add(getValue('options', this).container, 'scroll', this.virtualScrollHandlers(callback), this);
|
|
11358
|
+
EventHandler.add(getValue('options', this).container, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);
|
|
11230
11359
|
}
|
|
11231
11360
|
clear() {
|
|
11232
11361
|
this.lastPos = null;
|
|
11233
11362
|
}
|
|
11234
|
-
virtualScrollHandlers(callback) {
|
|
11235
|
-
|
|
11236
|
-
|
|
11363
|
+
virtualScrollHandlers(callback, onEnterCallback) {
|
|
11364
|
+
const delay = Browser.info.name === 'chrome' ? 200 : 100;
|
|
11365
|
+
const options = 'options';
|
|
11366
|
+
const movableEle = 'movableEle';
|
|
11367
|
+
const element = 'element';
|
|
11368
|
+
const fromWheel = 'fromWheel';
|
|
11369
|
+
const debounced100 = debounce(callback, delay);
|
|
11370
|
+
const debounced50 = debounce(callback, 50);
|
|
11371
|
+
this[options].prevTop = this[options].prevLeft = 0;
|
|
11237
11372
|
return (e) => {
|
|
11238
|
-
const
|
|
11239
|
-
const
|
|
11240
|
-
let direction = prevTop <
|
|
11241
|
-
direction = prevLeft ===
|
|
11242
|
-
prevTop =
|
|
11243
|
-
prevLeft =
|
|
11244
|
-
const current =
|
|
11373
|
+
const top = this[options].movableContainer ? this[options].container.scrollTop : e.target.scrollTop;
|
|
11374
|
+
const left = this[options].movableContainer ? this[options].scrollbar.scrollLeft : e.target.scrollLeft;
|
|
11375
|
+
let direction = this[options].prevTop < top ? 'down' : 'up';
|
|
11376
|
+
direction = this[options].prevLeft === left ? direction : this[options].prevLeft < left ? 'right' : 'left';
|
|
11377
|
+
this[options].prevTop = top;
|
|
11378
|
+
this[options].prevLeft = left;
|
|
11379
|
+
const current = this.sentinelInfo[direction];
|
|
11245
11380
|
let delta = 0;
|
|
11246
|
-
this.newPos =
|
|
11381
|
+
this.newPos = top;
|
|
11247
11382
|
if (this.lastPos != null) { // && newPos < maxScroll
|
|
11248
11383
|
delta = this.newPos - this.lastPos;
|
|
11249
11384
|
}
|
|
@@ -11252,19 +11387,35 @@ class TreeInterSectionObserver extends InterSectionObserver {
|
|
|
11252
11387
|
clearTimeout(this.timer);
|
|
11253
11388
|
}
|
|
11254
11389
|
this.timer = setTimeout(this.clear, 0);
|
|
11255
|
-
/*if (this.options.axes.indexOf(current.axis) === -1) {
|
|
11256
|
-
return;
|
|
11257
|
-
}*/
|
|
11258
|
-
/*if(delta > 45 || delta < -45){
|
|
11259
|
-
this.isWheeling = true;
|
|
11260
|
-
}*/
|
|
11261
11390
|
if ((delta > 100 || delta < -100) && (e && e.preventDefault)) {
|
|
11262
11391
|
e.returnValue = false;
|
|
11263
11392
|
e.preventDefault();
|
|
11264
11393
|
}
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11394
|
+
if (this[options].axes.indexOf(current.axis) === -1) {
|
|
11395
|
+
return;
|
|
11396
|
+
}
|
|
11397
|
+
const check = this.check(direction);
|
|
11398
|
+
if (current.entered && current.axis === 'X') {
|
|
11399
|
+
if (this[movableEle] && (direction === 'right' || direction === 'left')) {
|
|
11400
|
+
onEnterCallback(this[movableEle], current, direction, { top: top, left: left }, this[fromWheel], check);
|
|
11401
|
+
}
|
|
11402
|
+
else {
|
|
11403
|
+
onEnterCallback(this[element], current, direction, { top: top, left: left }, this[fromWheel], check);
|
|
11404
|
+
}
|
|
11405
|
+
}
|
|
11406
|
+
if (check) {
|
|
11407
|
+
let fn = debounced100;
|
|
11408
|
+
if (current.axis === 'X') {
|
|
11409
|
+
fn = debounced50;
|
|
11410
|
+
fn({ direction: direction, sentinel: current, offset: { top: top, left: left },
|
|
11411
|
+
focusElement: document.activeElement });
|
|
11412
|
+
}
|
|
11413
|
+
else {
|
|
11414
|
+
callback({ direction: direction, sentinel: current, offset: { top: top, left: left },
|
|
11415
|
+
focusElement: document.activeElement });
|
|
11416
|
+
}
|
|
11417
|
+
}
|
|
11418
|
+
this[fromWheel] = false;
|
|
11268
11419
|
};
|
|
11269
11420
|
}
|
|
11270
11421
|
}
|
|
@@ -11304,8 +11455,12 @@ class VirtualScroll$1 {
|
|
|
11304
11455
|
* @returns {void}
|
|
11305
11456
|
*/
|
|
11306
11457
|
addEventListener() {
|
|
11458
|
+
if (this.parent.isDestroyed) {
|
|
11459
|
+
return;
|
|
11460
|
+
}
|
|
11307
11461
|
this.parent.on(localPagedExpandCollapse, this.collapseExpandVirtualchilds, this);
|
|
11308
11462
|
this.parent.on(pagingActions, this.virtualPageAction, this);
|
|
11463
|
+
this.parent.on(destroy, this.destroy, this);
|
|
11309
11464
|
}
|
|
11310
11465
|
/**
|
|
11311
11466
|
* @hidden
|
|
@@ -11317,6 +11472,7 @@ class VirtualScroll$1 {
|
|
|
11317
11472
|
}
|
|
11318
11473
|
this.parent.off(localPagedExpandCollapse, this.collapseExpandVirtualchilds);
|
|
11319
11474
|
this.parent.off(pagingActions, this.virtualPageAction);
|
|
11475
|
+
this.parent.off(destroy, this.destroy);
|
|
11320
11476
|
}
|
|
11321
11477
|
collapseExpandVirtualchilds(row) {
|
|
11322
11478
|
this.parent.grid.notify(virtualActionArgs, { isExpandCollapse: true });
|
|
@@ -11371,7 +11527,7 @@ class VirtualScroll$1 {
|
|
|
11371
11527
|
const resourceCount = this.parent.getRows();
|
|
11372
11528
|
let sIndex = visualData.indexOf(this.expandCollapseRec);
|
|
11373
11529
|
const tempdata = visualData.slice(sIndex, sIndex + resourceCount.length);
|
|
11374
|
-
if (tempdata.length < resourceCount.length && sIndex >= 0) {
|
|
11530
|
+
if (tempdata.length < resourceCount.length && sIndex >= 0 && startIndex !== 0) {
|
|
11375
11531
|
sIndex = visualData.length - resourceCount.length;
|
|
11376
11532
|
sIndex = sIndex > 0 ? sIndex : 0;
|
|
11377
11533
|
startIndex = sIndex;
|
|
@@ -11384,7 +11540,7 @@ class VirtualScroll$1 {
|
|
|
11384
11540
|
}
|
|
11385
11541
|
}
|
|
11386
11542
|
//}
|
|
11387
|
-
if (
|
|
11543
|
+
if ((this.parent.enableCollapseAll || this.parent.expandStateMapping) && !isNullOrUndefined(this.expandCollapseRec)) {
|
|
11388
11544
|
if (pageingDetails.count < this.parent.getRows()[0].getBoundingClientRect().height) {
|
|
11389
11545
|
startIndex = 0;
|
|
11390
11546
|
}
|
|
@@ -11419,8 +11575,13 @@ class TreeVirtual extends VirtualScroll {
|
|
|
11419
11575
|
return 'treeVirtualScroll';
|
|
11420
11576
|
}
|
|
11421
11577
|
instantiateRenderers() {
|
|
11578
|
+
const parentGrid = getValue('parent', this);
|
|
11422
11579
|
getValue('parent', this).log(['limitation', 'virtual_height'], 'virtualization');
|
|
11423
11580
|
const renderer = getValue('locator', this).getService('rendererFactory');
|
|
11581
|
+
if (parentGrid.enableColumnVirtualization) {
|
|
11582
|
+
getValue('addRenderer', renderer)
|
|
11583
|
+
.apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
|
|
11584
|
+
}
|
|
11424
11585
|
getValue('addRenderer', renderer)
|
|
11425
11586
|
.apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
|
|
11426
11587
|
//renderer.addRenderer(RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this)));
|
|
@@ -11475,7 +11636,8 @@ class Freeze$1 {
|
|
|
11475
11636
|
const frozenrows = this.parent.getRows();
|
|
11476
11637
|
let rows;
|
|
11477
11638
|
let frozenRightRows;
|
|
11478
|
-
|
|
11639
|
+
const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
11640
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
11479
11641
|
if (freeze) {
|
|
11480
11642
|
frozenRightRows = this.parent.getFrozenRightRows().filter((e) => e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1)));
|
|
11481
11643
|
}
|
|
@@ -11890,5 +12052,5 @@ class InfiniteScroll$1 {
|
|
|
11890
12052
|
* Export TreeGrid component
|
|
11891
12053
|
*/
|
|
11892
12054
|
|
|
11893
|
-
export { TreeGrid, load, rowDataBound, dataBound, queryCellInfo, beforeDataBound, actionBegin, dataStateChange, actionComplete, rowSelecting, rowSelected, checkboxChange, rowDeselected, toolbarClick, beforeExcelExport, beforePdfExport, resizeStop, expanded, expanding, collapsed, collapsing, remoteExpand, localPagedExpandCollapse, pagingActions, printGridInit, contextMenuOpen, contextMenuClick, beforeCopy, beforePaste, savePreviousRowPosition, crudAction, beginEdit, beginAdd, recordDoubleClick, cellSave, cellSaved, cellEdit, batchDelete, batchCancel, batchAdd, beforeBatchDelete, beforeBatchAdd, beforeBatchSave, batchSave, keyPressed, updateData, doubleTap, virtualColumnIndex, virtualActionArgs, dataListener, indexModifier, beforeStartEdit, beforeBatchCancel, batchEditFormRendered, detailDataBound, rowDrag, rowDragStartHelper, rowDrop, rowDragStart, rowsAdd, rowsRemove, rowdraging, rowDropped, DataManipulation, Reorder$1 as Reorder, Resize$1 as Resize, RowDD$1 as RowDD, Column, EditSettings, Predicate$1 as Predicate, FilterSettings, PageSettings, SearchSettings, SelectionSettings, AggregateColumn, AggregateRow, SortDescriptor, SortSettings, RowDropSettings$1 as RowDropSettings, InfiniteScrollSettings, Render, TreeVirtualRowModelGenerator, isRemoteData, isCountRequired, isCheckboxcolumn, isFilterChildHierarchy, findParentRecords, getExpandStatus, findChildrenRecords, isOffline, extendArray, getPlainData, getParentData, isHidden, ToolbarItem, ContextMenuItems, Filter$1 as Filter, ExcelExport$1 as ExcelExport, PdfExport$1 as PdfExport, Page$1 as Page, Toolbar$1 as Toolbar, Aggregate$1 as Aggregate, Sort$1 as Sort, TreeClipboard, ColumnMenu$1 as ColumnMenu, ContextMenu$1 as ContextMenu, Edit$1 as Edit, CommandColumn$1 as CommandColumn, Selection, DetailRow$1 as DetailRow, VirtualScroll$1 as VirtualScroll, TreeVirtual, Freeze$1 as Freeze, ColumnChooser$1 as ColumnChooser, Logger$1 as Logger, treeGridDetails, InfiniteScroll$1 as InfiniteScroll };
|
|
12055
|
+
export { TreeGrid, load, rowDataBound, dataBound, queryCellInfo, beforeDataBound, actionBegin, dataStateChange, actionComplete, rowSelecting, rowSelected, checkboxChange, rowDeselected, toolbarClick, beforeExcelExport, beforePdfExport, resizeStop, expanded, expanding, collapsed, collapsing, remoteExpand, localPagedExpandCollapse, pagingActions, printGridInit, contextMenuOpen, contextMenuClick, beforeCopy, beforePaste, savePreviousRowPosition, crudAction, beginEdit, beginAdd, recordDoubleClick, cellSave, cellSaved, cellEdit, batchDelete, batchCancel, batchAdd, beforeBatchDelete, beforeBatchAdd, beforeBatchSave, batchSave, keyPressed, updateData, doubleTap, virtualColumnIndex, virtualActionArgs, destroy, dataListener, indexModifier, beforeStartEdit, beforeBatchCancel, batchEditFormRendered, detailDataBound, rowDrag, rowDragStartHelper, rowDrop, rowDragStart, rowsAdd, rowsRemove, rowdraging, rowDropped, autoCol, DataManipulation, Reorder$1 as Reorder, Resize$1 as Resize, RowDD$1 as RowDD, Column, EditSettings, Predicate$1 as Predicate, FilterSettings, PageSettings, SearchSettings, SelectionSettings, AggregateColumn, AggregateRow, SortDescriptor, SortSettings, RowDropSettings$1 as RowDropSettings, InfiniteScrollSettings, Render, TreeVirtualRowModelGenerator, isRemoteData, isCountRequired, isCheckboxcolumn, isFilterChildHierarchy, findParentRecords, getExpandStatus, findChildrenRecords, isOffline, extendArray, getPlainData, getParentData, isHidden, ToolbarItem, ContextMenuItems, Filter$1 as Filter, ExcelExport$1 as ExcelExport, PdfExport$1 as PdfExport, Page$1 as Page, Toolbar$1 as Toolbar, Aggregate$1 as Aggregate, Sort$1 as Sort, TreeClipboard, ColumnMenu$1 as ColumnMenu, ContextMenu$1 as ContextMenu, Edit$1 as Edit, CommandColumn$1 as CommandColumn, Selection, DetailRow$1 as DetailRow, VirtualScroll$1 as VirtualScroll, TreeVirtual, Freeze$1 as Freeze, ColumnChooser$1 as ColumnChooser, Logger$1 as Logger, treeGridDetails, InfiniteScroll$1 as InfiniteScroll };
|
|
11894
12056
|
//# sourceMappingURL=ej2-treegrid.es2015.js.map
|