@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';
|
|
@@ -447,6 +447,8 @@ var virtualColumnIndex = 'virtualColumnIndex';
|
|
|
447
447
|
/** @hidden */
|
|
448
448
|
var virtualActionArgs = 'virtual-action-args';
|
|
449
449
|
/** @hidden */
|
|
450
|
+
var destroy = 'destroy';
|
|
451
|
+
/** @hidden */
|
|
450
452
|
var dataListener = 'data-listener';
|
|
451
453
|
/** @hidden */
|
|
452
454
|
var indexModifier = 'index-modifier';
|
|
@@ -474,6 +476,8 @@ var rowsRemove = 'rows-remove';
|
|
|
474
476
|
var rowdraging = 'row-draging';
|
|
475
477
|
/** @hidden */
|
|
476
478
|
var rowDropped = 'row-dropped';
|
|
479
|
+
/** @hidden */
|
|
480
|
+
var autoCol = 'auto-col';
|
|
477
481
|
|
|
478
482
|
var __extends$4 = (undefined && undefined.__extends) || (function () {
|
|
479
483
|
var extendStatics = function (d, b) {
|
|
@@ -1111,11 +1115,11 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
1111
1115
|
var length = 0;
|
|
1112
1116
|
if (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) {
|
|
1113
1117
|
var filterResult = this.parent.filterModule.filteredResult;
|
|
1114
|
-
if (this.filteredList.length
|
|
1118
|
+
if (this.filteredList.length === 0) {
|
|
1115
1119
|
this.filteredList = filterResult;
|
|
1116
1120
|
}
|
|
1117
1121
|
else {
|
|
1118
|
-
if (this.filteredList
|
|
1122
|
+
if (this.filteredList !== filterResult) {
|
|
1119
1123
|
this.filteredList = filterResult;
|
|
1120
1124
|
}
|
|
1121
1125
|
}
|
|
@@ -1284,7 +1288,12 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
1284
1288
|
this.parent.getCurrentViewRecords() : this.parent.flatData;
|
|
1285
1289
|
childData.forEach(function (record) {
|
|
1286
1290
|
if (_this.parent.enableVirtualization) {
|
|
1287
|
-
record.hasChildRecords
|
|
1291
|
+
if (record.hasChildRecords) {
|
|
1292
|
+
_this.updateParentSelection(record);
|
|
1293
|
+
}
|
|
1294
|
+
else {
|
|
1295
|
+
_this.updateSelectedItems(record, record.checkboxState);
|
|
1296
|
+
}
|
|
1288
1297
|
var child = findChildrenRecords(record);
|
|
1289
1298
|
child = _this.getFilteredChildRecords(child);
|
|
1290
1299
|
for (var i = 0; i < child.length; i++) {
|
|
@@ -1566,7 +1575,15 @@ var Render = /** @__PURE__ @class */ (function () {
|
|
|
1566
1575
|
else {
|
|
1567
1576
|
index = data.index;
|
|
1568
1577
|
}
|
|
1569
|
-
|
|
1578
|
+
var columnIndex;
|
|
1579
|
+
var getVirtualColIndexByUid = 'getVirtualColIndexByUid';
|
|
1580
|
+
if (this.parent.enableColumnVirtualization && !this.parent.initialRender) {
|
|
1581
|
+
columnIndex = this.parent[getVirtualColIndexByUid](args.column.uid);
|
|
1582
|
+
}
|
|
1583
|
+
else {
|
|
1584
|
+
columnIndex = grid.getColumnIndexByUid(args.column.uid);
|
|
1585
|
+
}
|
|
1586
|
+
if (columnIndex === this.parent.treeColumnIndex && (args.requestType === 'add' || args.requestType
|
|
1570
1587
|
=== 'rowDragAndDrop' || args.requestType === 'delete' || isNullOrUndefined(args.cell.querySelector('.e-treecell')))) {
|
|
1571
1588
|
var container = createElement('div', { className: 'e-treecolumn-container' });
|
|
1572
1589
|
var emptyExpandIcon = createElement('span', {
|
|
@@ -2750,6 +2767,7 @@ function editAction(details, control, isSelfReference, addRowIndex, selectedInde
|
|
|
2750
2767
|
var childRecords = parentData ? parentData[control.childMapping] : [];
|
|
2751
2768
|
for (var p = childRecords.length - 1; p >= 0; p--) {
|
|
2752
2769
|
if (childRecords[p][control.idMapping] === currentData_1[control.idMapping]) {
|
|
2770
|
+
parentData['childRecords'].splice(p, 1);
|
|
2753
2771
|
childRecords.splice(p, 1);
|
|
2754
2772
|
if (!childRecords.length) {
|
|
2755
2773
|
parentData.hasChildRecords = false;
|
|
@@ -3520,7 +3538,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
3520
3538
|
member: 'ExcelExport', args: [this]
|
|
3521
3539
|
});
|
|
3522
3540
|
}
|
|
3523
|
-
if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
|
|
3541
|
+
if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
|
|
3542
|
+
this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) {
|
|
3524
3543
|
modules.push({
|
|
3525
3544
|
member: 'freeze', args: [this]
|
|
3526
3545
|
});
|
|
@@ -3741,6 +3760,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
3741
3760
|
this.grid.allowSorting = this.allowSorting;
|
|
3742
3761
|
this.grid.allowFiltering = this.allowFiltering;
|
|
3743
3762
|
this.grid.enableVirtualization = this.enableVirtualization;
|
|
3763
|
+
this.grid.enableColumnVirtualization = this.enableColumnVirtualization;
|
|
3744
3764
|
this.grid.enableInfiniteScrolling = this.enableInfiniteScrolling;
|
|
3745
3765
|
this.grid.infiniteScrollSettings = this.infiniteScrollSettings;
|
|
3746
3766
|
this.grid.width = this.width;
|
|
@@ -4102,6 +4122,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4102
4122
|
&& (_this.grid.filterSettings.columns.length === 0 || _this.grid.searchSettings.key.length === 0)) {
|
|
4103
4123
|
_this.notify('clearFilters', { flatData: _this.grid.dataSource });
|
|
4104
4124
|
_this.grid.setProperties({ dataSource: _this.dataResults.result }, true);
|
|
4125
|
+
if (isNullOrUndefined(_this.grid['changedProperties'].dataSource)) {
|
|
4126
|
+
_this.grid.renderModule.data.dataManager = _this.grid.dataSource instanceof DataManager ? _this.grid.dataSource :
|
|
4127
|
+
(isNullOrUndefined(_this.grid.dataSource) ? new DataManager() : new DataManager(_this.grid.dataSource));
|
|
4128
|
+
}
|
|
4105
4129
|
}
|
|
4106
4130
|
var callBackPromise = new Deferred();
|
|
4107
4131
|
_this.trigger(actionBegin, args, function (actionArgs) {
|
|
@@ -4127,7 +4151,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4127
4151
|
_this.notify(batchSave, args);
|
|
4128
4152
|
}
|
|
4129
4153
|
_this.notify('updateGridActions', args);
|
|
4130
|
-
if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary
|
|
4154
|
+
if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
|
|
4131
4155
|
_this.grid.refresh();
|
|
4132
4156
|
}
|
|
4133
4157
|
_this.trigger(actionComplete, args);
|
|
@@ -4423,6 +4447,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4423
4447
|
case 'enableVirtualization':
|
|
4424
4448
|
this.grid.enableVirtualization = this.enableVirtualization;
|
|
4425
4449
|
break;
|
|
4450
|
+
case 'enableColumnVirtualization':
|
|
4451
|
+
this.grid.enableColumnVirtualization = this.enableColumnVirtualization;
|
|
4452
|
+
break;
|
|
4426
4453
|
case 'toolbar':
|
|
4427
4454
|
this.grid.toolbar = this.getGridToolbar();
|
|
4428
4455
|
break;
|
|
@@ -4646,6 +4673,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4646
4673
|
if (isNullOrUndefined(this.grid)) {
|
|
4647
4674
|
return;
|
|
4648
4675
|
}
|
|
4676
|
+
if (!isNullOrUndefined(this.rowDropSettings.targetID) &&
|
|
4677
|
+
isNullOrUndefined(document.getElementById(this.grid.rowDropSettings.targetID))) {
|
|
4678
|
+
document.getElementById(this.rowDropSettings.targetID).id = this.grid.rowDropSettings.targetID;
|
|
4679
|
+
this.rowDropSettings.targetID = this.grid.rowDropSettings.targetID;
|
|
4680
|
+
}
|
|
4649
4681
|
_super.prototype.dataBind.call(this);
|
|
4650
4682
|
this.grid.dataBind();
|
|
4651
4683
|
};
|
|
@@ -4657,7 +4689,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4657
4689
|
*/
|
|
4658
4690
|
TreeGrid.prototype.getPersistData = function () {
|
|
4659
4691
|
var keyEntity = ['pageSettings', 'sortSettings',
|
|
4660
|
-
'filterSettings', 'columns', 'searchSettings', 'selectedRowIndex'];
|
|
4692
|
+
'filterSettings', 'columns', 'searchSettings', 'selectedRowIndex', 'treeColumnIndex'];
|
|
4661
4693
|
var ignoreOnPersist = {
|
|
4662
4694
|
pageSettings: ['template', 'pageSizes', 'pageSizeMode', 'enableQueryString', 'totalRecordsCount', 'pageCount'],
|
|
4663
4695
|
filterSettings: ['type', 'mode', 'showFilterBarStatus', 'immediateModeDelay', 'ignoreAccent', 'hierarchyMode'],
|
|
@@ -4668,9 +4700,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4668
4700
|
'commandTemplate', 'commands', 'dataSource'];
|
|
4669
4701
|
for (var i = 0; i < keyEntity.length; i++) {
|
|
4670
4702
|
var currentObject = this[keyEntity[i]];
|
|
4671
|
-
for (var
|
|
4672
|
-
var
|
|
4673
|
-
delete currentObject[
|
|
4703
|
+
for (var k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {
|
|
4704
|
+
var objVal = val[k];
|
|
4705
|
+
delete currentObject[objVal];
|
|
4674
4706
|
}
|
|
4675
4707
|
}
|
|
4676
4708
|
this.ignoreInArrays(ignoreOnColumn, this.columns);
|
|
@@ -5073,6 +5105,16 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5073
5105
|
TreeGrid.prototype.getColumnIndexByField = function (field) {
|
|
5074
5106
|
return this.grid.getColumnIndexByField(field);
|
|
5075
5107
|
};
|
|
5108
|
+
TreeGrid.prototype.getVirtualColIndexByUid = function (uid) {
|
|
5109
|
+
var columnModel = 'columnModel';
|
|
5110
|
+
var index = iterateArrayOrObject(this.grid[columnModel], function (item, index) {
|
|
5111
|
+
if (item.uid === uid) {
|
|
5112
|
+
return index;
|
|
5113
|
+
}
|
|
5114
|
+
return undefined;
|
|
5115
|
+
})[0];
|
|
5116
|
+
return !isNullOrUndefined(index) ? index : -1;
|
|
5117
|
+
};
|
|
5076
5118
|
/**
|
|
5077
5119
|
* Gets a column index by UID.
|
|
5078
5120
|
*
|
|
@@ -5101,18 +5143,20 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5101
5143
|
temp = this.columnModel[this.treeColumnIndex].template;
|
|
5102
5144
|
field = this.columnModel[this.treeColumnIndex].field;
|
|
5103
5145
|
}
|
|
5104
|
-
this.columnModel = [];
|
|
5105
5146
|
var stackedHeader = false;
|
|
5106
5147
|
var gridColumn;
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
for (var
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
this.columnModel
|
|
5148
|
+
if (!this.enableColumnVirtualization || (this.enableColumnVirtualization && this.columnModel.length === gridColumns.length)) {
|
|
5149
|
+
this.columnModel = [];
|
|
5150
|
+
for (var i = 0; i < gridColumns.length; i++) {
|
|
5151
|
+
gridColumn = {};
|
|
5152
|
+
for (var _i = 0, _a = Object.keys(gridColumns[i]); _i < _a.length; _i++) {
|
|
5153
|
+
var prop = _a[_i];
|
|
5154
|
+
gridColumn[prop] = gridColumns[i][prop];
|
|
5155
|
+
}
|
|
5156
|
+
this.columnModel.push(new Column(gridColumn));
|
|
5157
|
+
if (field === this.columnModel[i].field && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
5158
|
+
this.columnModel[i].template = temp;
|
|
5159
|
+
}
|
|
5116
5160
|
}
|
|
5117
5161
|
}
|
|
5118
5162
|
var merge$$1 = 'deepMerge';
|
|
@@ -5484,7 +5528,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5484
5528
|
var row = getObject('rows', rec);
|
|
5485
5529
|
var record = getObject('records', rec);
|
|
5486
5530
|
for (var i = 0; i < record.length; i++) {
|
|
5487
|
-
if (record[i].parentItem
|
|
5531
|
+
if (record[i].parentItem !== undefined) {
|
|
5488
5532
|
var pindex = this.flatData[record[i].parentItem.index].index;
|
|
5489
5533
|
if (this.flatData[pindex].expanded === false) {
|
|
5490
5534
|
record.push(this.flatData[pindex]);
|
|
@@ -6449,6 +6493,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6449
6493
|
__decorate([
|
|
6450
6494
|
Property(false)
|
|
6451
6495
|
], TreeGrid.prototype, "enableVirtualization", void 0);
|
|
6496
|
+
__decorate([
|
|
6497
|
+
Property(false)
|
|
6498
|
+
], TreeGrid.prototype, "enableColumnVirtualization", void 0);
|
|
6452
6499
|
__decorate([
|
|
6453
6500
|
Property(false)
|
|
6454
6501
|
], TreeGrid.prototype, "enableInfiniteScrolling", void 0);
|
|
@@ -7130,7 +7177,8 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
|
|
|
7130
7177
|
var bottomRowSegment = middleRowSegment + divide;
|
|
7131
7178
|
var mouseEvent = getObject('originalEvent.event', args);
|
|
7132
7179
|
var touchEvent = getObject('originalEvent.event', args);
|
|
7133
|
-
var posy = (mouseEvent.type
|
|
7180
|
+
var posy = (mouseEvent.type === 'mousemove') ? mouseEvent.pageY : ((!isNullOrUndefined(touchEvent) &&
|
|
7181
|
+
!isNullOrUndefined(touchEvent.changedTouches)) ? touchEvent.changedTouches[0].pageY : null);
|
|
7134
7182
|
var isTopSegment = posy <= topRowSegment;
|
|
7135
7183
|
var isMiddleRowSegment = (posy > topRowSegment && posy <= middleRowSegment);
|
|
7136
7184
|
var isBottomRowSegment = (posy > middleRowSegment && posy <= bottomRowSegment);
|
|
@@ -7357,7 +7405,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
|
|
|
7357
7405
|
}
|
|
7358
7406
|
else {
|
|
7359
7407
|
if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID) || parentsUntil(args.target, 'e-treegrid') &&
|
|
7360
|
-
parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID) {
|
|
7408
|
+
parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID || args.target && document.getElementById(tObj.rowDropSettings.targetID)) {
|
|
7361
7409
|
setValue('dropPosition', this.dropPosition, args);
|
|
7362
7410
|
tObj.trigger(rowDrop, args);
|
|
7363
7411
|
if (!args.cancel && tObj.rowDropSettings.targetID) {
|
|
@@ -7684,6 +7732,11 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
|
|
|
7684
7732
|
draggedRecord.parentItem = parentItem;
|
|
7685
7733
|
draggedRecord.parentUniqueID = droppedRecord.uniqueID;
|
|
7686
7734
|
droppedRecord.childRecords.splice(droppedRecord.childRecords.length, 0, draggedRecord);
|
|
7735
|
+
var isSelfReference = 'isSelfReference';
|
|
7736
|
+
if (tObj[isSelfReference]) {
|
|
7737
|
+
droppedRecord[tObj.childMapping] = [];
|
|
7738
|
+
droppedRecord[tObj.childMapping].splice(droppedRecord[tObj.childMapping].length, 0, draggedRecord);
|
|
7739
|
+
}
|
|
7687
7740
|
if (!isNullOrUndefined(draggedRecord) && !tObj.parentIdMapping && !isNullOrUndefined(droppedRecord.taskData[childItem])) {
|
|
7688
7741
|
droppedRecord.taskData[tObj.childMapping].splice(droppedRecord.childRecords.length, 0, draggedRecord.taskData);
|
|
7689
7742
|
}
|
|
@@ -7722,7 +7775,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
|
|
|
7722
7775
|
}
|
|
7723
7776
|
length = record.childRecords.length;
|
|
7724
7777
|
for (var i = 0; i < length; i++) {
|
|
7725
|
-
currentRecord = record.childRecords[i];
|
|
7778
|
+
currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, tObj);
|
|
7726
7779
|
count++;
|
|
7727
7780
|
tObj.flatData.splice(count, 0, currentRecord);
|
|
7728
7781
|
setValue('uniqueIDCollection.' + currentRecord.uniqueID, currentRecord, this.parent);
|
|
@@ -7744,7 +7797,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
|
|
|
7744
7797
|
}
|
|
7745
7798
|
length = record.childRecords.length;
|
|
7746
7799
|
for (var i = 0; i < length; i++) {
|
|
7747
|
-
currentRecord = record.childRecords[i];
|
|
7800
|
+
currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, this.parent);
|
|
7748
7801
|
var parentData = void 0;
|
|
7749
7802
|
if (record.parentItem) {
|
|
7750
7803
|
parentData = getParentData(this.parent, record.parentItem.uniqueID);
|
|
@@ -8014,7 +8067,19 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
|
|
|
8014
8067
|
TreeVirtualRowModelGenerator.prototype.getDatas = function (args) {
|
|
8015
8068
|
this.visualData = args.data;
|
|
8016
8069
|
};
|
|
8070
|
+
TreeVirtualRowModelGenerator.prototype.getDataInfo = function () {
|
|
8071
|
+
return _super.prototype.getData.call(this);
|
|
8072
|
+
};
|
|
8017
8073
|
TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
|
|
8074
|
+
var info = this.getDataInfo();
|
|
8075
|
+
if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
|
|
8076
|
+
if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
|
|
8077
|
+
notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
|
|
8078
|
+
}
|
|
8079
|
+
else {
|
|
8080
|
+
notifyArgs.virtualInfo.blockIndexes = this.getBlockIndexes(notifyArgs.virtualInfo.page);
|
|
8081
|
+
}
|
|
8082
|
+
}
|
|
8018
8083
|
if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
8019
8084
|
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
|
|
8020
8085
|
return _super.prototype.generateRows.call(this, data, notifyArgs);
|
|
@@ -9564,10 +9629,11 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
9564
9629
|
if (frozenCols && args.columnObject.index > frozenCols) {
|
|
9565
9630
|
actualCellIndex = actualCellIndex + frozenCols;
|
|
9566
9631
|
}
|
|
9567
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
9632
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
9633
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
9568
9634
|
if (freeze) {
|
|
9569
9635
|
var colCount = this.parent.getFrozenLeftColumnsCount() + actualCellIndex;
|
|
9570
|
-
if (colCount
|
|
9636
|
+
if (colCount === this.parent.treeColumnIndex) {
|
|
9571
9637
|
this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,
|
|
9572
9638
|
column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)
|
|
9573
9639
|
});
|
|
@@ -9729,7 +9795,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
9729
9795
|
focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];
|
|
9730
9796
|
}
|
|
9731
9797
|
};
|
|
9732
|
-
BatchEdit.prototype.beforeBatchDelete = function () {
|
|
9798
|
+
BatchEdit.prototype.beforeBatchDelete = function (args) {
|
|
9733
9799
|
if (!this.batchRecords.length) {
|
|
9734
9800
|
this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());
|
|
9735
9801
|
this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());
|
|
@@ -9739,9 +9805,19 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
9739
9805
|
var row = [];
|
|
9740
9806
|
var records = [];
|
|
9741
9807
|
var primarykey = this.parent.grid.getPrimaryKeyFieldNames()[0];
|
|
9742
|
-
var data
|
|
9743
|
-
var childs
|
|
9744
|
-
var uid
|
|
9808
|
+
var data;
|
|
9809
|
+
var childs;
|
|
9810
|
+
var uid;
|
|
9811
|
+
if (!isNullOrUndefined(args.row) && this.parent.getSelectedRows().indexOf(args.row) === -1) {
|
|
9812
|
+
data = args.rowData;
|
|
9813
|
+
childs = findChildrenRecords(data);
|
|
9814
|
+
uid = args.row.getAttribute('data-uid');
|
|
9815
|
+
}
|
|
9816
|
+
else {
|
|
9817
|
+
data = this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length - 1];
|
|
9818
|
+
childs = findChildrenRecords(data);
|
|
9819
|
+
uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');
|
|
9820
|
+
}
|
|
9745
9821
|
var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10);
|
|
9746
9822
|
if (childs.length) {
|
|
9747
9823
|
var totalCount = parentRowIndex + childs.length;
|
|
@@ -9781,7 +9857,8 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
9781
9857
|
for (var i = 0; i < rows.length; i++) {
|
|
9782
9858
|
rows[i].setAttribute('aria-rowindex', i.toString());
|
|
9783
9859
|
}
|
|
9784
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
9860
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
9861
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
9785
9862
|
if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {
|
|
9786
9863
|
var mRows = this.parent.grid.getMovableDataRows();
|
|
9787
9864
|
var freezeRightRows = this.parent.grid.getFrozenRightDataRows();
|
|
@@ -10294,7 +10371,7 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
|
|
|
10294
10371
|
if (args.action === 'f2') {
|
|
10295
10372
|
this.recordDoubleClick(args);
|
|
10296
10373
|
}
|
|
10297
|
-
if (args.action
|
|
10374
|
+
if (args.action === 'escape') {
|
|
10298
10375
|
this.parent.closeEdit();
|
|
10299
10376
|
}
|
|
10300
10377
|
};
|
|
@@ -10405,12 +10482,13 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
|
|
|
10405
10482
|
});
|
|
10406
10483
|
}
|
|
10407
10484
|
else {
|
|
10408
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
10485
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
10486
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
10409
10487
|
if (freeze) {
|
|
10410
|
-
if (this.parent.getRows().indexOf(row_1)
|
|
10488
|
+
if (this.parent.getRows().indexOf(row_1) !== -1) {
|
|
10411
10489
|
rowIndex_1 = this.parent.getRows().indexOf(row_1);
|
|
10412
10490
|
}
|
|
10413
|
-
else if (this.parent.getFrozenRightRows().indexOf(row_1)
|
|
10491
|
+
else if (this.parent.getFrozenRightRows().indexOf(row_1) !== -1) {
|
|
10414
10492
|
rowIndex_1 = this.parent.getFrozenRightRows().indexOf(row_1);
|
|
10415
10493
|
}
|
|
10416
10494
|
else {
|
|
@@ -10477,7 +10555,8 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
|
|
|
10477
10555
|
this.isOnBatch = false;
|
|
10478
10556
|
}
|
|
10479
10557
|
this.enableToolbarItems('save');
|
|
10480
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
10558
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
10559
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
10481
10560
|
if (freeze) {
|
|
10482
10561
|
if (args.cell.closest('.e-frozen-left-header') || args.cell.closest('.e-frozen-left-content')) {
|
|
10483
10562
|
mRow = this.parent.grid.getRows()[rowIndex];
|
|
@@ -10514,7 +10593,7 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
|
|
|
10514
10593
|
type: 'save', column: this.parent.getColumnByField(args.columnName), data: args.rowData,
|
|
10515
10594
|
previousData: args.previousValue, row: row, target: args.cell
|
|
10516
10595
|
};
|
|
10517
|
-
if (this.parent.aggregates.map(function (ag) { return ag.showChildSummary
|
|
10596
|
+
if (this.parent.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
|
|
10518
10597
|
this.parent.grid.refresh();
|
|
10519
10598
|
}
|
|
10520
10599
|
this.parent.trigger(actionComplete, saveArgs);
|
|
@@ -10556,6 +10635,10 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
|
|
|
10556
10635
|
}
|
|
10557
10636
|
}
|
|
10558
10637
|
setValue('uniqueIDCollection.' + data[i].uniqueID + '.index', i, this.parent);
|
|
10638
|
+
var adaptor = this.parent.dataSource.adaptor;
|
|
10639
|
+
if ((isRemoteData(this.parent) || adaptor instanceof RemoteSaveAdaptor)) {
|
|
10640
|
+
setValue('uniqueIDCollection.' + data[i].uniqueID, data[i], this.parent);
|
|
10641
|
+
}
|
|
10559
10642
|
if (!data[i].level) {
|
|
10560
10643
|
this.parent.parentData.push(data[i]);
|
|
10561
10644
|
}
|
|
@@ -10675,7 +10758,8 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
|
|
|
10675
10758
|
this.parent.grid.contentModule[r].splice(0, 1);
|
|
10676
10759
|
this.parent.grid.contentModule[r].splice(rowObjectIndex, 0, newRowObject);
|
|
10677
10760
|
}
|
|
10678
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
10761
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
10762
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
10679
10763
|
if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {
|
|
10680
10764
|
var movableRows = this.parent.getMovableDataRows();
|
|
10681
10765
|
var frows = 'freezeRows';
|
|
@@ -11242,9 +11326,9 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
11242
11326
|
if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
11243
11327
|
&& this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
|
|
11244
11328
|
this.parent[action]('data-ready', this.onDataReady, this);
|
|
11245
|
-
|
|
11329
|
+
this.parent[action]('refresh-virtual-block', this.refreshContentRows, this);
|
|
11246
11330
|
this.fn = function () {
|
|
11247
|
-
_this.observers.observes(function (scrollArgs) { return _this.scrollListeners(scrollArgs); });
|
|
11331
|
+
_this.observers.observes(function (scrollArgs) { return _this.scrollListeners(scrollArgs); }, _this.onEnteredAction());
|
|
11248
11332
|
_this.parent.off('content-ready', _this.fn);
|
|
11249
11333
|
};
|
|
11250
11334
|
this.parent.addEventListener('dataBound', this.dataBoundEvent.bind(this));
|
|
@@ -11276,7 +11360,9 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
11276
11360
|
&& this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
|
|
11277
11361
|
if (!isNullOrUndefined(e.count)) {
|
|
11278
11362
|
this.totalRecords = e.count;
|
|
11279
|
-
|
|
11363
|
+
if (!this.parent.enableColumnVirtualization) {
|
|
11364
|
+
getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');
|
|
11365
|
+
}
|
|
11280
11366
|
}
|
|
11281
11367
|
if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || this.isDataSourceChanged) {
|
|
11282
11368
|
this.contents.scrollTop = 0;
|
|
@@ -11334,6 +11420,10 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
11334
11420
|
return;
|
|
11335
11421
|
}
|
|
11336
11422
|
var selectVirtualRow = 'selectVirtualRow';
|
|
11423
|
+
var containerRect = 'containerRect';
|
|
11424
|
+
if (isNullOrUndefined(this.observer[containerRect])) {
|
|
11425
|
+
this.observer[containerRect] = this.observers[containerRect];
|
|
11426
|
+
}
|
|
11337
11427
|
_super.prototype[selectVirtualRow].call(this, args);
|
|
11338
11428
|
};
|
|
11339
11429
|
VirtualTreeContentRenderer.prototype.refreshCell = function (rowObj) {
|
|
@@ -11440,15 +11530,39 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
11440
11530
|
var actionComplete$$1 = 'actionComplete';
|
|
11441
11531
|
_super.prototype[actionComplete$$1].call(this, args);
|
|
11442
11532
|
};
|
|
11533
|
+
VirtualTreeContentRenderer.prototype.onEnteredAction = function () {
|
|
11534
|
+
var _this = this;
|
|
11535
|
+
return function (element, current, direction, e, isWheel, check) {
|
|
11536
|
+
var directVirtualRender = 'directVirtualRender';
|
|
11537
|
+
if (!_this.parent[directVirtualRender]) { // with this property, columns are rendered without debouncing on horizontal scroll.
|
|
11538
|
+
var preventEvent = 'preventEvent';
|
|
11539
|
+
if (Browser.isIE && !isWheel && check && !_this[preventEvent]) {
|
|
11540
|
+
_this.parent.showSpinner();
|
|
11541
|
+
}
|
|
11542
|
+
var xAxis = current.axis === 'X';
|
|
11543
|
+
var x = _this.getColumnOffset(xAxis ? _this.vgenerator.getColumnIndexes()[0] - 1 : _this.prevInfo.columnIndexes[0]
|
|
11544
|
+
- 1);
|
|
11545
|
+
if (xAxis) {
|
|
11546
|
+
var idx = Object.keys(_this.vgenerator.cOffsets).length - _this.prevInfo.columnIndexes.length;
|
|
11547
|
+
var maxLeft = _this.vgenerator.cOffsets[idx - 1];
|
|
11548
|
+
x = x > maxLeft ? maxLeft : x; //TODO: This fix horizontal scrollbar jumping issue in column virtualization.
|
|
11549
|
+
}
|
|
11550
|
+
_this.virtualEle.adjustTable(x, _this.translateY);
|
|
11551
|
+
if (_this.parent.enableColumnVirtualization) {
|
|
11552
|
+
_this.header.virtualEle.adjustTable(x, 0);
|
|
11553
|
+
}
|
|
11554
|
+
}
|
|
11555
|
+
};
|
|
11556
|
+
};
|
|
11443
11557
|
VirtualTreeContentRenderer.prototype.scrollListeners = function (scrollArgs) {
|
|
11444
11558
|
var info = scrollArgs.sentinel;
|
|
11445
|
-
var outBuffer =
|
|
11559
|
+
var outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
|
|
11446
11560
|
var content = this.parent.getContent().querySelector('.e-content');
|
|
11447
11561
|
var scrollHeight = outBuffer * this.parent.getRowHeight();
|
|
11448
11562
|
var upScroll = (scrollArgs.offset.top - this.translateY) < 0;
|
|
11449
11563
|
var downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) >= scrollHeight;
|
|
11450
11564
|
var selectedRowIndex = 'selectedRowIndex';
|
|
11451
|
-
if (upScroll) {
|
|
11565
|
+
if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
|
|
11452
11566
|
var vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :
|
|
11453
11567
|
this.parent.element.getBoundingClientRect().height);
|
|
11454
11568
|
var index = (~~(content.scrollTop / this.parent.getRowHeight())
|
|
@@ -11485,7 +11599,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
11485
11599
|
scrollArgs.offset.top - (outBuffer * height) + 10 : 0;
|
|
11486
11600
|
}
|
|
11487
11601
|
}
|
|
11488
|
-
else if (downScroll) {
|
|
11602
|
+
else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
|
|
11489
11603
|
var nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
|
|
11490
11604
|
var isLastBlock = (this[selectedRowIndex] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;
|
|
11491
11605
|
if (!isNullOrUndefined(this[selectedRowIndex]) && this[selectedRowIndex] !== -1 &&
|
|
@@ -11506,14 +11620,17 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
11506
11620
|
this.translateY = scrollArgs.offset.top;
|
|
11507
11621
|
}
|
|
11508
11622
|
}
|
|
11509
|
-
if ((downScroll && (scrollArgs.offset.top < (this.parent.getRowHeight() * this.totalRecords)))
|
|
11510
|
-
|| (upScroll)) {
|
|
11511
|
-
var viewInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
|
|
11623
|
+
if (((downScroll && (scrollArgs.offset.top < (this.parent.getRowHeight() * this.totalRecords)))
|
|
11624
|
+
|| (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left')) {
|
|
11625
|
+
var viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
|
|
11512
11626
|
this.previousInfo = viewInfo;
|
|
11627
|
+
this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);
|
|
11513
11628
|
var page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;
|
|
11514
11629
|
this.parent.setProperties({ pageSettings: { currentPage: page } }, true);
|
|
11515
|
-
|
|
11516
|
-
|
|
11630
|
+
if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
|
|
11631
|
+
viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
|
|
11632
|
+
}
|
|
11633
|
+
this.parent.notify(viewInfo.event, { requestType: 'virtualscroll', virtualInfo: viewInfo, focusElement: scrollArgs.focusElement });
|
|
11517
11634
|
}
|
|
11518
11635
|
};
|
|
11519
11636
|
VirtualTreeContentRenderer.prototype.appendContent = function (target, newChild, e) {
|
|
@@ -11530,7 +11647,14 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
11530
11647
|
getValue('currentInfo', this) : e.virtualInfo;
|
|
11531
11648
|
var cBlock = (info.columnIndexes[0]) - 1;
|
|
11532
11649
|
var cOffset = this.getColumnOffset(cBlock);
|
|
11533
|
-
|
|
11650
|
+
var width = void 0;
|
|
11651
|
+
if (this.parent.enableColumnVirtualization) {
|
|
11652
|
+
this.header.virtualEle.adjustTable(cOffset, 0);
|
|
11653
|
+
var cIndex = info.columnIndexes;
|
|
11654
|
+
width = this.getColumnOffset(cIndex[cIndex.length - 1]) - this.getColumnOffset(cIndex[0] - 1) + '';
|
|
11655
|
+
this.header.virtualEle.setWrapperWidth(width);
|
|
11656
|
+
}
|
|
11657
|
+
this.virtualEle.setWrapperWidth(width, (Browser.isIE || Browser.info.name === 'edge'));
|
|
11534
11658
|
target = this.parent.createElement('tbody');
|
|
11535
11659
|
target.appendChild(newChild);
|
|
11536
11660
|
var replace = 'replaceWith';
|
|
@@ -11542,8 +11666,12 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
11542
11666
|
this.isExpandCollapse = false;
|
|
11543
11667
|
}
|
|
11544
11668
|
setValue('prevInfo', this.previousInfo ? this.previousInfo : info, this);
|
|
11669
|
+
if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'X') {
|
|
11670
|
+
this.parent.notify(autoCol, {});
|
|
11671
|
+
}
|
|
11545
11672
|
var focusCell = 'focusCell';
|
|
11546
11673
|
var restoreAdd = 'restoreAdd';
|
|
11674
|
+
var ensureSelectedRowPosition = 'ensureSelectedRowPosition';
|
|
11547
11675
|
_super.prototype[focusCell].call(this, e);
|
|
11548
11676
|
var isAdd = 'isAdd';
|
|
11549
11677
|
if (this[isAdd] && !this.parent.getContent().querySelector('.e-content').querySelector('.e-addedrow')) {
|
|
@@ -11559,6 +11687,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
11559
11687
|
}
|
|
11560
11688
|
this.restoreEditState();
|
|
11561
11689
|
_super.prototype[restoreAdd].call(this);
|
|
11690
|
+
_super.prototype[ensureSelectedRowPosition].call(this);
|
|
11562
11691
|
}
|
|
11563
11692
|
};
|
|
11564
11693
|
VirtualTreeContentRenderer.prototype.removeEventListener = function () {
|
|
@@ -11594,28 +11723,34 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
|
|
|
11594
11723
|
_this.timer = 0;
|
|
11595
11724
|
return _this;
|
|
11596
11725
|
}
|
|
11597
|
-
TreeInterSectionObserver.prototype.observes = function (callback) {
|
|
11726
|
+
TreeInterSectionObserver.prototype.observes = function (callback, onEnterCallback) {
|
|
11598
11727
|
var containerRect = 'containerRect';
|
|
11599
11728
|
_super.prototype[containerRect] = getValue('options', this).container.getBoundingClientRect();
|
|
11600
|
-
EventHandler.add(getValue('options', this).container, 'scroll', this.virtualScrollHandlers(callback), this);
|
|
11729
|
+
EventHandler.add(getValue('options', this).container, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);
|
|
11601
11730
|
};
|
|
11602
11731
|
TreeInterSectionObserver.prototype.clear = function () {
|
|
11603
11732
|
this.lastPos = null;
|
|
11604
11733
|
};
|
|
11605
|
-
TreeInterSectionObserver.prototype.virtualScrollHandlers = function (callback) {
|
|
11734
|
+
TreeInterSectionObserver.prototype.virtualScrollHandlers = function (callback, onEnterCallback) {
|
|
11606
11735
|
var _this = this;
|
|
11607
|
-
var
|
|
11608
|
-
var
|
|
11736
|
+
var delay = Browser.info.name === 'chrome' ? 200 : 100;
|
|
11737
|
+
var options = 'options';
|
|
11738
|
+
var movableEle = 'movableEle';
|
|
11739
|
+
var element = 'element';
|
|
11740
|
+
var fromWheel = 'fromWheel';
|
|
11741
|
+
var debounced100 = debounce(callback, delay);
|
|
11742
|
+
var debounced50 = debounce(callback, 50);
|
|
11743
|
+
this[options].prevTop = this[options].prevLeft = 0;
|
|
11609
11744
|
return function (e) {
|
|
11610
|
-
var
|
|
11611
|
-
var
|
|
11612
|
-
var direction = prevTop <
|
|
11613
|
-
direction = prevLeft ===
|
|
11614
|
-
prevTop =
|
|
11615
|
-
prevLeft =
|
|
11616
|
-
var current =
|
|
11745
|
+
var top = _this[options].movableContainer ? _this[options].container.scrollTop : e.target.scrollTop;
|
|
11746
|
+
var left = _this[options].movableContainer ? _this[options].scrollbar.scrollLeft : e.target.scrollLeft;
|
|
11747
|
+
var direction = _this[options].prevTop < top ? 'down' : 'up';
|
|
11748
|
+
direction = _this[options].prevLeft === left ? direction : _this[options].prevLeft < left ? 'right' : 'left';
|
|
11749
|
+
_this[options].prevTop = top;
|
|
11750
|
+
_this[options].prevLeft = left;
|
|
11751
|
+
var current = _this.sentinelInfo[direction];
|
|
11617
11752
|
var delta = 0;
|
|
11618
|
-
_this.newPos =
|
|
11753
|
+
_this.newPos = top;
|
|
11619
11754
|
if (_this.lastPos != null) { // && newPos < maxScroll
|
|
11620
11755
|
delta = _this.newPos - _this.lastPos;
|
|
11621
11756
|
}
|
|
@@ -11624,19 +11759,35 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
|
|
|
11624
11759
|
clearTimeout(_this.timer);
|
|
11625
11760
|
}
|
|
11626
11761
|
_this.timer = setTimeout(_this.clear, 0);
|
|
11627
|
-
/*if (this.options.axes.indexOf(current.axis) === -1) {
|
|
11628
|
-
return;
|
|
11629
|
-
}*/
|
|
11630
|
-
/*if(delta > 45 || delta < -45){
|
|
11631
|
-
this.isWheeling = true;
|
|
11632
|
-
}*/
|
|
11633
11762
|
if ((delta > 100 || delta < -100) && (e && e.preventDefault)) {
|
|
11634
11763
|
e.returnValue = false;
|
|
11635
11764
|
e.preventDefault();
|
|
11636
11765
|
}
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
11766
|
+
if (_this[options].axes.indexOf(current.axis) === -1) {
|
|
11767
|
+
return;
|
|
11768
|
+
}
|
|
11769
|
+
var check = _this.check(direction);
|
|
11770
|
+
if (current.entered && current.axis === 'X') {
|
|
11771
|
+
if (_this[movableEle] && (direction === 'right' || direction === 'left')) {
|
|
11772
|
+
onEnterCallback(_this[movableEle], current, direction, { top: top, left: left }, _this[fromWheel], check);
|
|
11773
|
+
}
|
|
11774
|
+
else {
|
|
11775
|
+
onEnterCallback(_this[element], current, direction, { top: top, left: left }, _this[fromWheel], check);
|
|
11776
|
+
}
|
|
11777
|
+
}
|
|
11778
|
+
if (check) {
|
|
11779
|
+
var fn = debounced100;
|
|
11780
|
+
if (current.axis === 'X') {
|
|
11781
|
+
fn = debounced50;
|
|
11782
|
+
fn({ direction: direction, sentinel: current, offset: { top: top, left: left },
|
|
11783
|
+
focusElement: document.activeElement });
|
|
11784
|
+
}
|
|
11785
|
+
else {
|
|
11786
|
+
callback({ direction: direction, sentinel: current, offset: { top: top, left: left },
|
|
11787
|
+
focusElement: document.activeElement });
|
|
11788
|
+
}
|
|
11789
|
+
}
|
|
11790
|
+
_this[fromWheel] = false;
|
|
11640
11791
|
};
|
|
11641
11792
|
};
|
|
11642
11793
|
return TreeInterSectionObserver;
|
|
@@ -11690,8 +11841,12 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
|
|
|
11690
11841
|
* @returns {void}
|
|
11691
11842
|
*/
|
|
11692
11843
|
VirtualScroll$$1.prototype.addEventListener = function () {
|
|
11844
|
+
if (this.parent.isDestroyed) {
|
|
11845
|
+
return;
|
|
11846
|
+
}
|
|
11693
11847
|
this.parent.on(localPagedExpandCollapse, this.collapseExpandVirtualchilds, this);
|
|
11694
11848
|
this.parent.on(pagingActions, this.virtualPageAction, this);
|
|
11849
|
+
this.parent.on(destroy, this.destroy, this);
|
|
11695
11850
|
};
|
|
11696
11851
|
/**
|
|
11697
11852
|
* @hidden
|
|
@@ -11703,6 +11858,7 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
|
|
|
11703
11858
|
}
|
|
11704
11859
|
this.parent.off(localPagedExpandCollapse, this.collapseExpandVirtualchilds);
|
|
11705
11860
|
this.parent.off(pagingActions, this.virtualPageAction);
|
|
11861
|
+
this.parent.off(destroy, this.destroy);
|
|
11706
11862
|
};
|
|
11707
11863
|
VirtualScroll$$1.prototype.collapseExpandVirtualchilds = function (row) {
|
|
11708
11864
|
this.parent.grid.notify(virtualActionArgs, { isExpandCollapse: true });
|
|
@@ -11758,7 +11914,7 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
|
|
|
11758
11914
|
var resourceCount = this.parent.getRows();
|
|
11759
11915
|
var sIndex = visualData.indexOf(this.expandCollapseRec);
|
|
11760
11916
|
var tempdata = visualData.slice(sIndex, sIndex + resourceCount.length);
|
|
11761
|
-
if (tempdata.length < resourceCount.length && sIndex >= 0) {
|
|
11917
|
+
if (tempdata.length < resourceCount.length && sIndex >= 0 && startIndex !== 0) {
|
|
11762
11918
|
sIndex = visualData.length - resourceCount.length;
|
|
11763
11919
|
sIndex = sIndex > 0 ? sIndex : 0;
|
|
11764
11920
|
startIndex = sIndex;
|
|
@@ -11771,7 +11927,7 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
|
|
|
11771
11927
|
}
|
|
11772
11928
|
}
|
|
11773
11929
|
//}
|
|
11774
|
-
if (
|
|
11930
|
+
if ((this.parent.enableCollapseAll || this.parent.expandStateMapping) && !isNullOrUndefined(this.expandCollapseRec)) {
|
|
11775
11931
|
if (pageingDetails.count < this.parent.getRows()[0].getBoundingClientRect().height) {
|
|
11776
11932
|
startIndex = 0;
|
|
11777
11933
|
}
|
|
@@ -11809,8 +11965,13 @@ var TreeVirtual = /** @__PURE__ @class */ (function (_super) {
|
|
|
11809
11965
|
return 'treeVirtualScroll';
|
|
11810
11966
|
};
|
|
11811
11967
|
TreeVirtual.prototype.instantiateRenderers = function () {
|
|
11968
|
+
var parentGrid = getValue('parent', this);
|
|
11812
11969
|
getValue('parent', this).log(['limitation', 'virtual_height'], 'virtualization');
|
|
11813
11970
|
var renderer = getValue('locator', this).getService('rendererFactory');
|
|
11971
|
+
if (parentGrid.enableColumnVirtualization) {
|
|
11972
|
+
getValue('addRenderer', renderer)
|
|
11973
|
+
.apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
|
|
11974
|
+
}
|
|
11814
11975
|
getValue('addRenderer', renderer)
|
|
11815
11976
|
.apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
|
|
11816
11977
|
//renderer.addRenderer(RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this)));
|
|
@@ -11866,7 +12027,8 @@ var Freeze$1 = /** @__PURE__ @class */ (function () {
|
|
|
11866
12027
|
var frozenrows = this.parent.getRows();
|
|
11867
12028
|
var rows;
|
|
11868
12029
|
var frozenRightRows;
|
|
11869
|
-
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
12030
|
+
var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
12031
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
11870
12032
|
if (freeze) {
|
|
11871
12033
|
frozenRightRows = this.parent.getFrozenRightRows().filter(function (e) {
|
|
11872
12034
|
return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));
|
|
@@ -12292,5 +12454,5 @@ var InfiniteScroll$1 = /** @__PURE__ @class */ (function () {
|
|
|
12292
12454
|
* Export TreeGrid component
|
|
12293
12455
|
*/
|
|
12294
12456
|
|
|
12295
|
-
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 };
|
|
12457
|
+
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 };
|
|
12296
12458
|
//# sourceMappingURL=ej2-treegrid.es5.js.map
|