@syncfusion/ej2-treegrid 29.2.8 → 30.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +2 -0
- package/dist/ej2-treegrid.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +246 -139
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +306 -168
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +2 -2
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/treegrid/actions/batch-edit.d.ts +1 -0
- package/src/treegrid/actions/batch-edit.js +57 -29
- package/src/treegrid/actions/clipboard.js +5 -8
- package/src/treegrid/actions/crud-actions.js +3 -1
- package/src/treegrid/actions/detail-row.js +7 -8
- package/src/treegrid/actions/edit.d.ts +1 -0
- package/src/treegrid/actions/edit.js +26 -11
- package/src/treegrid/actions/filter.js +2 -5
- package/src/treegrid/actions/rowdragdrop.js +7 -13
- package/src/treegrid/actions/summary.js +2 -16
- package/src/treegrid/actions/toolbar.js +2 -2
- package/src/treegrid/base/data.js +34 -14
- package/src/treegrid/base/treegrid-model.d.ts +7 -0
- package/src/treegrid/base/treegrid.d.ts +7 -0
- package/src/treegrid/base/treegrid.js +85 -51
- package/src/treegrid/renderer/virtual-row-model-generator.js +13 -5
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +1 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +64 -6
- package/styles/bds-lite.css +30 -0
- package/styles/bds.css +30 -0
- package/styles/bootstrap-dark-lite.css +30 -0
- package/styles/bootstrap-dark.css +30 -0
- package/styles/bootstrap-lite.css +30 -0
- package/styles/bootstrap.css +30 -0
- package/styles/bootstrap4-lite.css +30 -0
- package/styles/bootstrap4.css +30 -0
- package/styles/bootstrap5-dark-lite.css +30 -0
- package/styles/bootstrap5-dark.css +30 -0
- package/styles/bootstrap5-lite.css +30 -0
- package/styles/bootstrap5.3-lite.css +30 -0
- package/styles/bootstrap5.3.css +30 -0
- package/styles/bootstrap5.css +30 -0
- package/styles/fabric-dark-lite.css +30 -0
- package/styles/fabric-dark.css +30 -0
- package/styles/fabric-lite.css +30 -0
- package/styles/fabric.css +30 -0
- package/styles/fluent-dark-lite.css +30 -0
- package/styles/fluent-dark.css +30 -0
- package/styles/fluent-lite.css +30 -0
- package/styles/fluent.css +30 -0
- package/styles/fluent2-lite.css +30 -0
- package/styles/fluent2.css +30 -3
- package/styles/highcontrast-light-lite.css +30 -0
- package/styles/highcontrast-light.css +30 -0
- package/styles/highcontrast-lite.css +30 -0
- package/styles/highcontrast.css +30 -0
- package/styles/material-dark-lite.css +30 -0
- package/styles/material-dark.css +30 -0
- package/styles/material-lite.css +30 -0
- package/styles/material.css +30 -0
- package/styles/material3-dark-lite.css +30 -0
- package/styles/material3-dark.css +30 -0
- package/styles/material3-lite.css +30 -0
- package/styles/material3.css +30 -0
- package/styles/tailwind-dark-lite.css +30 -0
- package/styles/tailwind-dark.css +30 -0
- package/styles/tailwind-lite.css +30 -0
- package/styles/tailwind.css +30 -0
- package/styles/tailwind3-lite.css +30 -0
- package/styles/tailwind3.css +30 -0
- package/styles/treegrid/_bigger.scss +66 -66
- package/styles/treegrid/_layout.scss +39 -0
- package/styles/treegrid/bds.css +30 -0
- package/styles/treegrid/bootstrap-dark.css +30 -0
- package/styles/treegrid/bootstrap.css +30 -0
- package/styles/treegrid/bootstrap4.css +30 -0
- package/styles/treegrid/bootstrap5-dark.css +30 -0
- package/styles/treegrid/bootstrap5.3.css +30 -0
- package/styles/treegrid/bootstrap5.css +30 -0
- package/styles/treegrid/fabric-dark.css +30 -0
- package/styles/treegrid/fabric.css +30 -0
- package/styles/treegrid/fluent-dark.css +30 -0
- package/styles/treegrid/fluent.css +30 -0
- package/styles/treegrid/fluent2.css +30 -3
- package/styles/treegrid/highcontrast-light.css +30 -0
- package/styles/treegrid/highcontrast.css +30 -0
- package/styles/treegrid/material-dark.css +30 -0
- package/styles/treegrid/material.css +30 -0
- package/styles/treegrid/material3-dark.css +30 -0
- package/styles/treegrid/material3.css +30 -0
- package/styles/treegrid/tailwind-dark.css +30 -0
- package/styles/treegrid/tailwind.css +30 -0
- package/styles/treegrid/tailwind3.css +30 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Property, merge, ChildProperty, Collection, isNullOrUndefined, Browser, removeClass, addClass, getValue, createElement, setValue, extend as extend$1, Internationalization, getEnumValue, compile, L10n, EventHandler, KeyboardEvents, SanitizeHtmlHelper, Complex, Event, NotifyPropertyChanges, Component, closest, setStyleAttribute, select, classList, debounce, remove } from '@syncfusion/ej2-base';
|
|
2
|
-
import { Grid, Logger as Logger$1, detailLists, Clipboard, getObject, parentsUntil, Print as Print$1, templateCompiler, appendChildren, extend, CellRenderer, getUid, CellType, Freeze as Freeze$1, getNumberFormat, getActualProperties, iterateArrayOrObject, RowDropSettings as RowDropSettings$1, Reorder as Reorder$1, Resize as Resize$1, Scroll, RowDD as RowDD$1, VirtualRowModelGenerator, Filter as Filter$1, Data, ExportHelper, ExcelExport as ExcelExport$1, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, calculateAggregate, Aggregate as Aggregate$1, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, resetRowIndex, Edit as Edit$1, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, Cell, VirtualContentRenderer, InterSectionObserver, getTransformValues, RenderType, VirtualHeaderRenderer, VirtualScroll as VirtualScroll$1, ColumnChooser as ColumnChooser$1, RowRenderer, InfiniteScroll as InfiniteScroll$1 } from '@syncfusion/ej2-grids';
|
|
2
|
+
import { Grid, Logger as Logger$1, detailLists, Clipboard, getObject, parentsUntil, Print as Print$1, templateCompiler, appendChildren, extend, CellRenderer, getUid, CellType, Freeze as Freeze$1, getNumberFormat, getActualProperties, iterateArrayOrObject, RowDropSettings as RowDropSettings$1, Reorder as Reorder$1, Resize as Resize$1, Scroll, RowDD as RowDD$1, VirtualRowModelGenerator, Filter as Filter$1, Data, ExportHelper, ExcelExport as ExcelExport$1, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, calculateAggregate, Aggregate as Aggregate$1, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, resetRowIndex, Edit as Edit$1, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, Cell, getVisiblePage, VirtualContentRenderer, InterSectionObserver, getTransformValues, RenderType, VirtualHeaderRenderer, VirtualScroll as VirtualScroll$1, ColumnChooser as ColumnChooser$1, RowRenderer, InfiniteScroll as InfiniteScroll$1 } from '@syncfusion/ej2-grids';
|
|
3
3
|
import { createCheckBox } from '@syncfusion/ej2-buttons';
|
|
4
4
|
import { DataManager, ODataAdaptor, WebApiAdaptor, WebMethodAdaptor, CacheAdaptor, UrlAdaptor, Query, DataUtil, RemoteSaveAdaptor, Deferred, JsonAdaptor, Predicate as Predicate$1 } from '@syncfusion/ej2-data';
|
|
5
5
|
import { showSpinner, hideSpinner, createSpinner } from '@syncfusion/ej2-popups';
|
|
@@ -634,12 +634,13 @@ var TreeClipboard = /** @__PURE__ @class */ (function (_super) {
|
|
|
634
634
|
if (i > 0) {
|
|
635
635
|
this.treeCopyContent += '\n';
|
|
636
636
|
}
|
|
637
|
-
|
|
638
|
-
|
|
637
|
+
var selectedRowIndex = selectedIndexes[parseInt(i.toString(), 10)];
|
|
638
|
+
if (!rows[selectedRowIndex].classList.contains('e-summaryrow')) {
|
|
639
|
+
var cells = [].slice.call(rows[selectedRowIndex].querySelectorAll('.e-rowcell'));
|
|
639
640
|
var uniqueid = this.treeGridParent.getSelectedRecords()[parseInt(i.toString(), 10)]["" + uniqueID];
|
|
640
641
|
if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {
|
|
641
642
|
if (this.treeGridParent.copyHierarchyMode === 'Parent' || this.treeGridParent.copyHierarchyMode === 'Both') {
|
|
642
|
-
this.parentContentData(currentRecords,
|
|
643
|
+
this.parentContentData(currentRecords, selectedRowIndex, rows, withHeader, i);
|
|
643
644
|
}
|
|
644
645
|
this["" + getCopyData](cells, false, '\t', withHeader);
|
|
645
646
|
this.treeCopyContent += this["" + copyContent];
|
|
@@ -652,11 +653,7 @@ var TreeClipboard = /** @__PURE__ @class */ (function (_super) {
|
|
|
652
653
|
}
|
|
653
654
|
}
|
|
654
655
|
if (withHeader) {
|
|
655
|
-
var headerTextArray =
|
|
656
|
-
for (var i = 0; i < this.treeGridParent.getVisibleColumns().length; i++) {
|
|
657
|
-
headerTextArray[parseInt(i.toString(), 10)] =
|
|
658
|
-
this.treeGridParent.getVisibleColumns()[parseInt(i.toString(), 10)].headerText;
|
|
659
|
-
}
|
|
656
|
+
var headerTextArray = this.treeGridParent.getVisibleColumns().map(function (col) { return col.headerText; });
|
|
660
657
|
this["" + getCopyData](headerTextArray, false, '\t', withHeader);
|
|
661
658
|
this.treeCopyContent = this["" + copyContent] + '\n' + this.treeCopyContent;
|
|
662
659
|
}
|
|
@@ -2275,6 +2272,15 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2275
2272
|
if (parentRec) {
|
|
2276
2273
|
records[parseInt(rec.toString(), 10)].level = parentRec.level + 1;
|
|
2277
2274
|
}
|
|
2275
|
+
else {
|
|
2276
|
+
var parentRec_1 = args.actual.flatData.find(function (record) { return record["" + _this.parent.idMapping] === parentID_1; });
|
|
2277
|
+
if (isNullOrUndefined(parentRec_1["" + this_1.parent.parentIdMapping])) {
|
|
2278
|
+
records[parseInt(rec.toString(), 10)].level = 1;
|
|
2279
|
+
}
|
|
2280
|
+
else {
|
|
2281
|
+
records[parseInt(rec.toString(), 10)].level = parentRec_1.level + 1;
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2278
2284
|
}
|
|
2279
2285
|
else {
|
|
2280
2286
|
records[parseInt(rec.toString(), 10)].level = 0;
|
|
@@ -2376,33 +2382,33 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2376
2382
|
var _this = this;
|
|
2377
2383
|
var args = { row: rowDetails.parentRow, data: rowDetails.record };
|
|
2378
2384
|
var dm = this.parent.dataSource;
|
|
2379
|
-
var
|
|
2380
|
-
var clonequries =
|
|
2381
|
-
|
|
2382
|
-
|
|
2385
|
+
var query = this.parent.grid.getDataModule().generateQuery();
|
|
2386
|
+
var clonequries = query.queries.filter(function (e) { return e.fn !== 'onPage' && e.fn !== 'onWhere'; });
|
|
2387
|
+
query.queries = clonequries;
|
|
2388
|
+
query.isCountRequired = true;
|
|
2383
2389
|
var idMappingValue = parseInt(rowDetails.record[this.parent.idMapping], 10);
|
|
2384
2390
|
if (isNaN(idMappingValue)) {
|
|
2385
2391
|
idMappingValue = rowDetails.record[this.parent.idMapping].toString();
|
|
2386
2392
|
}
|
|
2387
2393
|
if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
|
|
2388
|
-
|
|
2394
|
+
query.take(this.parent.grid.pageSettings.pageSize);
|
|
2389
2395
|
var expandDetail = [];
|
|
2390
2396
|
expandDetail.push('ExpandingAction', idMappingValue.toString());
|
|
2391
|
-
|
|
2397
|
+
query.expand(expandDetail);
|
|
2392
2398
|
}
|
|
2393
2399
|
else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {
|
|
2394
|
-
|
|
2400
|
+
query.take(this.parent.grid.pageSettings.pageSize);
|
|
2395
2401
|
var expandDetail = [];
|
|
2396
2402
|
expandDetail.push('CollapsingAction', idMappingValue.toString());
|
|
2397
|
-
|
|
2403
|
+
query.expand(expandDetail);
|
|
2398
2404
|
}
|
|
2399
|
-
|
|
2405
|
+
query.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
|
|
2400
2406
|
if (rowDetails.action === 'remoteExpand' && this.parent.grid.filterSettings && this.parent.grid.filterSettings.columns.length) {
|
|
2401
2407
|
var filterqry = this.parent.grid.getDataModule().generateQuery().queries.filter(function (e) { return e.fn !== 'onPage' && typeof e.e.predicates !== 'undefined'; });
|
|
2402
|
-
|
|
2408
|
+
query.queries.push(filterqry[0]);
|
|
2403
2409
|
}
|
|
2404
2410
|
showSpinner(this.parent.element);
|
|
2405
|
-
dm.executeQuery(
|
|
2411
|
+
dm.executeQuery(query).then(function (e) {
|
|
2406
2412
|
var remoteExpandedData = 'remoteExpandedData';
|
|
2407
2413
|
var remoteCollapsedData = 'remoteCollapsedData';
|
|
2408
2414
|
var level = 'level';
|
|
@@ -2465,7 +2471,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2465
2471
|
else {
|
|
2466
2472
|
rowDetails.record.childRecords = result;
|
|
2467
2473
|
}
|
|
2468
|
-
|
|
2474
|
+
var _loop_2 = function (r) {
|
|
2469
2475
|
var record = result[parseInt(r.toString(), 10)];
|
|
2470
2476
|
if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
|
|
2471
2477
|
_this.parent["" + remoteExpandedData].push(rowDetails.record);
|
|
@@ -2575,8 +2581,18 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2575
2581
|
record.expanded = false;
|
|
2576
2582
|
}
|
|
2577
2583
|
}
|
|
2578
|
-
datas.
|
|
2584
|
+
var exists = datas.some(function (data) { return data["" + _this.parent.idMapping] === record[_this.parent.idMapping]; });
|
|
2585
|
+
if (!exists) {
|
|
2586
|
+
datas.splice(inx + r + 1, 0, record);
|
|
2587
|
+
}
|
|
2588
|
+
};
|
|
2589
|
+
for (var r = 0; r < result.length; r++) {
|
|
2590
|
+
_loop_2(r);
|
|
2579
2591
|
}
|
|
2592
|
+
var localIdMapping = _this.parent.idMapping;
|
|
2593
|
+
datas.sort(function (firstRecord, secondRecord) {
|
|
2594
|
+
return firstRecord["" + localIdMapping] - secondRecord["" + localIdMapping];
|
|
2595
|
+
});
|
|
2580
2596
|
setValue('result', datas, e);
|
|
2581
2597
|
setValue('action', 'beforecontentrender', e);
|
|
2582
2598
|
_this.parent.trigger(actionComplete, e);
|
|
@@ -2619,7 +2635,8 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2619
2635
|
var contentModule = getValue('grid.contentModule', this.parent);
|
|
2620
2636
|
var currentInfo = getValue('currentInfo', contentModule);
|
|
2621
2637
|
var prevInfo = getValue('prevInfo', contentModule);
|
|
2622
|
-
if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page
|
|
2638
|
+
if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page
|
|
2639
|
+
&& !this.parent.loadChildOnDemand) {
|
|
2623
2640
|
this.parent.grid.pageSettings.currentPage = prevInfo.page;
|
|
2624
2641
|
}
|
|
2625
2642
|
};
|
|
@@ -3610,7 +3627,9 @@ function updateParentRow(key, record, action, control, isSelfReference, child) {
|
|
|
3610
3627
|
}
|
|
3611
3628
|
else {
|
|
3612
3629
|
if (!isNullOrUndefined(child) && record["" + key] !== child["" + key]) {
|
|
3613
|
-
record.childRecords.
|
|
3630
|
+
if (!record.childRecords.some(function (records) { return records.uniqueID === child.uniqueID; })) {
|
|
3631
|
+
record.childRecords.push(child);
|
|
3632
|
+
}
|
|
3614
3633
|
}
|
|
3615
3634
|
}
|
|
3616
3635
|
if (record.childRecords.indexOf(childRecords) === -1 && record["" + key] !== child["" + key]) {
|
|
@@ -4108,7 +4127,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4108
4127
|
parentTarget = target.parentElement;
|
|
4109
4128
|
if (!isNullOrUndefined(parentTarget)) {
|
|
4110
4129
|
var cellIndex = parentTarget.cellIndex;
|
|
4111
|
-
if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
4130
|
+
if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
4112
4131
|
parentTarget = target;
|
|
4113
4132
|
}
|
|
4114
4133
|
summaryElement = this.findnextRowElement(parentTarget);
|
|
@@ -4116,8 +4135,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4116
4135
|
var cellIndex_1 = target.cellIndex;
|
|
4117
4136
|
var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
|
|
4118
4137
|
if (!isNullOrUndefined(row_1) && !this.grid.isEdit) {
|
|
4119
|
-
|
|
4120
|
-
|
|
4138
|
+
var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
|
|
4139
|
+
focusedCells.forEach(function (cell) {
|
|
4140
|
+
removeClass([cell], ['e-focused', 'e-focus']);
|
|
4141
|
+
});
|
|
4142
|
+
addClass([row_1], ['e-focused', 'e-focus']);
|
|
4121
4143
|
}
|
|
4122
4144
|
}
|
|
4123
4145
|
else {
|
|
@@ -4137,7 +4159,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4137
4159
|
parentTarget = target.parentElement;
|
|
4138
4160
|
if (!isNullOrUndefined(parentTarget)) {
|
|
4139
4161
|
var cellIndex = parentTarget.cellIndex;
|
|
4140
|
-
if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
4162
|
+
if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
4141
4163
|
parentTarget = target;
|
|
4142
4164
|
}
|
|
4143
4165
|
summaryElement = this.findPreviousRowElement(parentTarget);
|
|
@@ -4146,8 +4168,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4146
4168
|
if (!isNullOrUndefined(cellIndex_2)) {
|
|
4147
4169
|
var row_2 = summaryElement.children[parseInt(cellIndex_2.toString(), 10)];
|
|
4148
4170
|
if (!isNullOrUndefined(row_2) && !this.grid.isEdit) {
|
|
4149
|
-
|
|
4150
|
-
|
|
4171
|
+
var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
|
|
4172
|
+
focusedCells.forEach(function (cell) {
|
|
4173
|
+
removeClass([cell], ['e-focused', 'e-focus']);
|
|
4174
|
+
});
|
|
4175
|
+
addClass([row_2], ['e-focused', 'e-focus']);
|
|
4151
4176
|
}
|
|
4152
4177
|
}
|
|
4153
4178
|
}
|
|
@@ -4514,11 +4539,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4514
4539
|
var destroyTemplate = 'destroyTemplate';
|
|
4515
4540
|
var destroyTemplateFn = this.grid["" + destroyTemplate];
|
|
4516
4541
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4517
|
-
this.grid["" + destroyTemplate] = function (args, index) {
|
|
4542
|
+
this.grid["" + destroyTemplate] = function (args, index, callback) {
|
|
4518
4543
|
destroyTemplateFn.apply(_this.grid);
|
|
4519
4544
|
var portals = 'portals';
|
|
4520
4545
|
if (!(_this.isReact && isNullOrUndefined(_this["" + portals]))) {
|
|
4521
|
-
_this.clearTemplate(args, index);
|
|
4546
|
+
_this.clearTemplate(args, index, callback);
|
|
4547
|
+
}
|
|
4548
|
+
else if (!isNullOrUndefined(callback)) {
|
|
4549
|
+
callback();
|
|
4522
4550
|
}
|
|
4523
4551
|
};
|
|
4524
4552
|
};
|
|
@@ -4614,18 +4642,24 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4614
4642
|
this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this, this.grid.serviceLocator);
|
|
4615
4643
|
};
|
|
4616
4644
|
TreeGrid.prototype.convertTreeData = function (data) {
|
|
4617
|
-
var _this = this;
|
|
4618
4645
|
if (isCountRequired(this)) {
|
|
4619
4646
|
data = getValue('result', data);
|
|
4620
4647
|
}
|
|
4621
4648
|
if (data instanceof Array && data.length > 0 && Object.prototype.hasOwnProperty.call(data[0], 'level')) {
|
|
4622
4649
|
this.flatData = data;
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4650
|
+
var _loop_1 = function (i, len) {
|
|
4651
|
+
var rowData = this_1.flatData[parseInt(i.toString(), 10)];
|
|
4652
|
+
setValue('uniqueIDCollection.' + rowData['uniqueID'], rowData, this_1);
|
|
4653
|
+
if (rowData.level === 0 && !this_1.parentData.some(function (record) {
|
|
4654
|
+
return record.uniqueID === rowData.uniqueID;
|
|
4655
|
+
})) {
|
|
4656
|
+
this_1.parentData.push(rowData);
|
|
4627
4657
|
}
|
|
4628
|
-
}
|
|
4658
|
+
};
|
|
4659
|
+
var this_1 = this;
|
|
4660
|
+
for (var i = 0, len = this.flatData.length; i < len; i++) {
|
|
4661
|
+
_loop_1(i, len);
|
|
4662
|
+
}
|
|
4629
4663
|
}
|
|
4630
4664
|
else {
|
|
4631
4665
|
if (isCountRequired(this)) {
|
|
@@ -4715,6 +4749,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4715
4749
|
this.grid["" + isJsComponent] = true;
|
|
4716
4750
|
var enableHtmlSanitizer = 'enableHtmlSanitizer';
|
|
4717
4751
|
this.grid["" + enableHtmlSanitizer] = this.enableHtmlSanitizer;
|
|
4752
|
+
this.grid.enableStickyHeader = this.enableStickyHeader;
|
|
4753
|
+
var isTreeGrid = 'isTreeGrid';
|
|
4754
|
+
this.grid["" + isTreeGrid] = true;
|
|
4718
4755
|
};
|
|
4719
4756
|
TreeGrid.prototype.triggerEvents = function (args) {
|
|
4720
4757
|
this.trigger(getObject('name', args), args);
|
|
@@ -4852,6 +4889,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4852
4889
|
TreeGrid.prototype.extendedGridDataBoundEvent = function () {
|
|
4853
4890
|
var _this = this;
|
|
4854
4891
|
this.grid.dataBound = function (args) {
|
|
4892
|
+
_this.lastRowBorderEventListener();
|
|
4855
4893
|
_this.updateRowTemplate();
|
|
4856
4894
|
_this.updateColumnModel();
|
|
4857
4895
|
_this.updateAltRow(_this.getRows());
|
|
@@ -4944,6 +4982,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4944
4982
|
}
|
|
4945
4983
|
};
|
|
4946
4984
|
};
|
|
4985
|
+
TreeGrid.prototype.lastRowBorderEventListener = function () {
|
|
4986
|
+
this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
|
|
4987
|
+
};
|
|
4947
4988
|
TreeGrid.prototype.bindCallBackEvents = function () {
|
|
4948
4989
|
var _this = this;
|
|
4949
4990
|
this.grid.toolbarClick = function (args) {
|
|
@@ -5111,6 +5152,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5111
5152
|
if (args.requestType === 'sorting' && args.target && args.target.parentElement &&
|
|
5112
5153
|
args.target.parentElement.classList.contains('e-hierarchycheckbox')) {
|
|
5113
5154
|
args.cancel = true;
|
|
5155
|
+
return;
|
|
5114
5156
|
}
|
|
5115
5157
|
var requestType = getObject('requestType', args);
|
|
5116
5158
|
if (requestType === 'reorder') {
|
|
@@ -5301,6 +5343,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5301
5343
|
* @returns {void}
|
|
5302
5344
|
*/
|
|
5303
5345
|
TreeGrid.prototype.autoGenerateColumns = function () {
|
|
5346
|
+
var _this = this;
|
|
5304
5347
|
if (!this.columns.length && (!this.dataModule.isRemote() && Object.keys(this.dataSource).length)) {
|
|
5305
5348
|
this.columns = [];
|
|
5306
5349
|
// if (this.dataSource instanceof DataManager) {
|
|
@@ -5309,11 +5352,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5309
5352
|
var record = this.dataSource[0];
|
|
5310
5353
|
// }
|
|
5311
5354
|
var keys = Object.keys(record);
|
|
5312
|
-
|
|
5313
|
-
if ([this.childMapping, this.parentIdMapping].indexOf(keys[parseInt(i.toString(), 10)]) === -1) {
|
|
5314
|
-
this.columns.push(keys[parseInt(i.toString(), 10)]);
|
|
5315
|
-
}
|
|
5316
|
-
}
|
|
5355
|
+
this.columns = keys.filter(function (key) { return [_this.childMapping, _this.parentIdMapping].indexOf(key) === -1; });
|
|
5317
5356
|
}
|
|
5318
5357
|
};
|
|
5319
5358
|
TreeGrid.prototype.getGridEditSettings = function () {
|
|
@@ -5467,8 +5506,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5467
5506
|
gridColumn.field = treeGridColumn.field = this.columns[parseInt(i.toString(), 10)];
|
|
5468
5507
|
}
|
|
5469
5508
|
else {
|
|
5470
|
-
|
|
5471
|
-
|
|
5509
|
+
var columnProps = Object.keys(column[parseInt(i.toString(), 10)]);
|
|
5510
|
+
for (var j = 0; j < columnProps.length; j++) {
|
|
5511
|
+
var prop = columnProps[parseInt(j.toString(), 10)];
|
|
5472
5512
|
if (index === this.treeColumnIndex && prop === 'template') {
|
|
5473
5513
|
treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
|
|
5474
5514
|
}
|
|
@@ -5639,6 +5679,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5639
5679
|
break;
|
|
5640
5680
|
case 'rowHeight':
|
|
5641
5681
|
this.grid.rowHeight = this.rowHeight;
|
|
5682
|
+
this.refresh();
|
|
5642
5683
|
break;
|
|
5643
5684
|
case 'height':
|
|
5644
5685
|
if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {
|
|
@@ -5714,6 +5755,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5714
5755
|
case 'columnMenuItems':
|
|
5715
5756
|
this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);
|
|
5716
5757
|
break;
|
|
5758
|
+
case 'enableStickyHeader':
|
|
5759
|
+
this.grid.enableStickyHeader = this.enableStickyHeader;
|
|
5760
|
+
break;
|
|
5717
5761
|
case 'editSettings':
|
|
5718
5762
|
if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp["" + prop].mode &&
|
|
5719
5763
|
(newProp["" + prop].mode === 'Cell' || newProp["" + prop].mode === 'Row')) {
|
|
@@ -6601,14 +6645,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6601
6645
|
* @returns {Column[]} - Returns an array of visible column objects.
|
|
6602
6646
|
*/
|
|
6603
6647
|
TreeGrid.prototype.getVisibleColumns = function () {
|
|
6604
|
-
|
|
6605
|
-
for (var _i = 0, _a = this.columnModel; _i < _a.length; _i++) {
|
|
6606
|
-
var col = _a[_i];
|
|
6607
|
-
if (col.visible) {
|
|
6608
|
-
cols.push(col);
|
|
6609
|
-
}
|
|
6610
|
-
}
|
|
6611
|
-
return cols;
|
|
6648
|
+
return this.columnModel.filter(function (col) { return col.visible; });
|
|
6612
6649
|
};
|
|
6613
6650
|
/**
|
|
6614
6651
|
* Displays a loading spinner overlay across the TreeGrid for any data action or long-running process.
|
|
@@ -6736,17 +6773,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6736
6773
|
TreeGrid.prototype.getTreeColumn = function () {
|
|
6737
6774
|
var columnModel = 'columnModel';
|
|
6738
6775
|
var treeColumn = this["" + columnModel][this.treeColumnIndex];
|
|
6739
|
-
var treeIndex;
|
|
6740
6776
|
var updatedCols = this.getColumns();
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
}
|
|
6777
|
+
var treeColumnField = getObject('field', treeColumn);
|
|
6778
|
+
var treeIndex = updatedCols.findIndex(function (col) {
|
|
6779
|
+
return getObject('field', col) === treeColumnField;
|
|
6780
|
+
});
|
|
6781
|
+
if (!isNullOrUndefined(treeIndex)) {
|
|
6782
|
+
this.setProperties({ treeColumnIndex: treeIndex }, true);
|
|
6748
6783
|
}
|
|
6749
|
-
this.setProperties({ treeColumnIndex: treeIndex }, true);
|
|
6750
6784
|
};
|
|
6751
6785
|
/**
|
|
6752
6786
|
* Refreshes the header section of the TreeGrid to reflect any structural or data changes.
|
|
@@ -7069,14 +7103,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7069
7103
|
};
|
|
7070
7104
|
TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
|
|
7071
7105
|
if (isPaging === void 0) { isPaging = false; }
|
|
7072
|
-
var
|
|
7106
|
+
var _loop_2 = function (i) {
|
|
7073
7107
|
if (!isNullOrUndefined(record[parseInt(i.toString(), 10)].parentItem)) {
|
|
7074
7108
|
var puniqueID_1 = record[parseInt(i.toString(), 10)].parentItem.uniqueID;
|
|
7075
|
-
var parentItem =
|
|
7109
|
+
var parentItem = this_2.flatData.filter(function (e) {
|
|
7076
7110
|
return e.uniqueID === puniqueID_1;
|
|
7077
7111
|
});
|
|
7078
|
-
if (isRemoteData(
|
|
7079
|
-
parentItem =
|
|
7112
|
+
if (isRemoteData(this_2)) {
|
|
7113
|
+
parentItem = this_2.getCurrentViewRecords().filter(function (e) {
|
|
7080
7114
|
return e.uniqueID === puniqueID_1;
|
|
7081
7115
|
});
|
|
7082
7116
|
}
|
|
@@ -7085,7 +7119,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7085
7119
|
parentItem[0].expanded = true;
|
|
7086
7120
|
}
|
|
7087
7121
|
else {
|
|
7088
|
-
if (!getExpandStatus(
|
|
7122
|
+
if (!getExpandStatus(this_2, parentItem[0], this_2.parentData)) {
|
|
7089
7123
|
if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
|
|
7090
7124
|
record.push(parentItem[0]);
|
|
7091
7125
|
}
|
|
@@ -7093,12 +7127,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7093
7127
|
}
|
|
7094
7128
|
}
|
|
7095
7129
|
if (!isPaging) {
|
|
7096
|
-
|
|
7130
|
+
this_2.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
|
|
7097
7131
|
}
|
|
7098
7132
|
};
|
|
7099
|
-
var
|
|
7133
|
+
var this_2 = this;
|
|
7100
7134
|
for (var i = 0; i < record.length; i++) {
|
|
7101
|
-
|
|
7135
|
+
_loop_2(i);
|
|
7102
7136
|
}
|
|
7103
7137
|
if (isPaging) {
|
|
7104
7138
|
this.expandRow(null, record, key, level);
|
|
@@ -7202,8 +7236,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7202
7236
|
if (this.editSettings.mode === 'Batch') {
|
|
7203
7237
|
var obj = 'dialogObj';
|
|
7204
7238
|
var showDialog = 'showDialog';
|
|
7205
|
-
|
|
7206
|
-
|
|
7239
|
+
var changes = this.getBatchChanges ? this.getBatchChanges() : {};
|
|
7240
|
+
var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
|
|
7241
|
+
var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
|
|
7242
|
+
var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
|
|
7243
|
+
var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
|
|
7244
|
+
if (hasChanges && this.editSettings.showConfirmDialog) {
|
|
7207
7245
|
var dialogObj = this.grid.editModule["" + obj];
|
|
7208
7246
|
this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
|
|
7209
7247
|
return;
|
|
@@ -7229,8 +7267,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7229
7267
|
if (this.editSettings.mode === 'Batch') {
|
|
7230
7268
|
var obj = 'dialogObj';
|
|
7231
7269
|
var showDialog = 'showDialog';
|
|
7232
|
-
|
|
7233
|
-
|
|
7270
|
+
var changes = this.getBatchChanges ? this.getBatchChanges() : {};
|
|
7271
|
+
var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
|
|
7272
|
+
var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
|
|
7273
|
+
var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
|
|
7274
|
+
var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
|
|
7275
|
+
if (hasChanges && this.editSettings.showConfirmDialog) {
|
|
7234
7276
|
var dialogObj = this.grid.editModule["" + obj];
|
|
7235
7277
|
this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
|
|
7236
7278
|
return;
|
|
@@ -7520,6 +7562,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7520
7562
|
TreeGrid.prototype.remoteExpand = function (action, row, record) {
|
|
7521
7563
|
var gridRows = this.getRows();
|
|
7522
7564
|
var fetchRemoteChildData = 'fetchRemoteChildData';
|
|
7565
|
+
var requestType = getValue('isCollapseAll', this) ? 'collapseAll' : 'refresh';
|
|
7566
|
+
this.grid.contentModule.requestType = requestType;
|
|
7523
7567
|
if (this.rowTemplate) {
|
|
7524
7568
|
var rows_1 = this.getContentTable().rows;
|
|
7525
7569
|
gridRows = [].slice.call(rows_1);
|
|
@@ -7594,6 +7638,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7594
7638
|
gridRowsObject[parseInt(currentIndex.toString(), 10)].visible !== false) {
|
|
7595
7639
|
gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = true;
|
|
7596
7640
|
}
|
|
7641
|
+
if (this.detailTemplate) {
|
|
7642
|
+
gridRows.forEach(function (row) {
|
|
7643
|
+
if (row.classList.contains('e-detailrow') && row.style.display === 'none') {
|
|
7644
|
+
row.style.display = '';
|
|
7645
|
+
}
|
|
7646
|
+
});
|
|
7647
|
+
}
|
|
7597
7648
|
var detailrows = gridRows.filter(function (r) {
|
|
7598
7649
|
return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
|
|
7599
7650
|
});
|
|
@@ -7758,7 +7809,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7758
7809
|
TreeGrid.prototype.addListener = function () {
|
|
7759
7810
|
this.on('updateResults', this.updateResultModel, this);
|
|
7760
7811
|
this.grid.on('initial-end', this.afterGridRender, this);
|
|
7761
|
-
this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
|
|
7762
7812
|
};
|
|
7763
7813
|
TreeGrid.prototype.updateResultModel = function (returnResult) {
|
|
7764
7814
|
this.dataResults = returnResult;
|
|
@@ -8351,6 +8401,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
8351
8401
|
__decorate$b([
|
|
8352
8402
|
Property(false)
|
|
8353
8403
|
], TreeGrid.prototype, "enableImmutableMode", void 0);
|
|
8404
|
+
__decorate$b([
|
|
8405
|
+
Property(false)
|
|
8406
|
+
], TreeGrid.prototype, "enableStickyHeader", void 0);
|
|
8354
8407
|
__decorate$b([
|
|
8355
8408
|
Property('auto')
|
|
8356
8409
|
], TreeGrid.prototype, "height", void 0);
|
|
@@ -10335,6 +10388,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
10335
10388
|
* @returns {void} - This method does not return a value.
|
|
10336
10389
|
*/
|
|
10337
10390
|
RowDD.prototype.removeRecords = function (record) {
|
|
10391
|
+
var _this = this;
|
|
10338
10392
|
var tObj = this.parent;
|
|
10339
10393
|
var dataSource;
|
|
10340
10394
|
if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {
|
|
@@ -10362,20 +10416,13 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
10362
10416
|
if (deletedRow.hasChildRecords && deletedRow.childRecords.length > 0) {
|
|
10363
10417
|
this.removeChildItem(deletedRow);
|
|
10364
10418
|
}
|
|
10365
|
-
var idx = void 0;
|
|
10366
|
-
var idz = void 0;
|
|
10367
10419
|
var treeGridData = dataSource;
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
if (this.treeGridData[parseInt(i.toString(), 10)][this.parent.idMapping]
|
|
10375
|
-
=== deletedRow.taskData[this.parent.idMapping]) {
|
|
10376
|
-
idz = i;
|
|
10377
|
-
}
|
|
10378
|
-
}
|
|
10420
|
+
var idx = treeGridData.findIndex(function (data) {
|
|
10421
|
+
return data[_this.parent.idMapping] === deletedRow.taskData[_this.parent.idMapping];
|
|
10422
|
+
});
|
|
10423
|
+
var idz = this.treeGridData.findIndex(function (data) {
|
|
10424
|
+
return data[_this.parent.idMapping] === deletedRow.taskData[_this.parent.idMapping];
|
|
10425
|
+
});
|
|
10379
10426
|
if (idx !== -1 && !isNullOrUndefined(idx)) {
|
|
10380
10427
|
dataSource.splice(idx, 1);
|
|
10381
10428
|
}
|
|
@@ -10646,10 +10693,15 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
|
|
|
10646
10693
|
};
|
|
10647
10694
|
TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
|
|
10648
10695
|
var info = this.getDataInfo();
|
|
10649
|
-
if (
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10696
|
+
if (notifyArgs.requestType === 'refresh' && notifyArgs.isExpandCollapse) {
|
|
10697
|
+
notifyArgs.virtualInfo = this['prevInfo'];
|
|
10698
|
+
}
|
|
10699
|
+
if (!isNullOrUndefined(notifyArgs.virtualInfo) && !(this.parent.root.loadChildOnDemand && isRemoteData(this.parent.root))) {
|
|
10700
|
+
if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
|
|
10701
|
+
if ((!isRemoteData(this.parent.root) || isCountRequired(this.parent))
|
|
10702
|
+
|| notifyArgs.virtualInfo.blockIndexes.length === 1) {
|
|
10703
|
+
notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
|
|
10704
|
+
}
|
|
10653
10705
|
}
|
|
10654
10706
|
else {
|
|
10655
10707
|
notifyArgs.virtualInfo.blockIndexes = this.getBlockIndexes(notifyArgs.virtualInfo.page);
|
|
@@ -10690,7 +10742,10 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
|
|
|
10690
10742
|
else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&
|
|
10691
10743
|
this.cache[parseInt(currentPage.toString(), 10)].length >
|
|
10692
10744
|
(this.parent.contentModule).getBlockSize()) {
|
|
10693
|
-
|
|
10745
|
+
if (this.cache[parseInt(currentPage.toString(), 10)].length > (this.parent.contentModule).getBlockSize()) {
|
|
10746
|
+
this.cache[parseInt(currentPage.toString(), 10)] =
|
|
10747
|
+
this.cache[parseInt(currentPage.toString(), 10)].slice(0, (this.parent.contentModule).getBlockSize());
|
|
10748
|
+
}
|
|
10694
10749
|
}
|
|
10695
10750
|
}
|
|
10696
10751
|
else {
|
|
@@ -10778,11 +10833,11 @@ var Filter = /** @__PURE__ @class */ (function () {
|
|
|
10778
10833
|
this.filteredParentRecs = [];
|
|
10779
10834
|
this.filteredResult = [];
|
|
10780
10835
|
this.isHierarchyFilter = false;
|
|
10836
|
+
var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
|
|
10837
|
+
: this.parent.searchSettings.hierarchyMode;
|
|
10781
10838
|
for (var f = 0; f < this.flatFilteredData.length; f++) {
|
|
10782
10839
|
var rec = this.flatFilteredData[parseInt(f.toString(), 10)];
|
|
10783
10840
|
this.addParentRecord(rec);
|
|
10784
|
-
var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
|
|
10785
|
-
: this.parent.searchSettings.hierarchyMode;
|
|
10786
10841
|
if (((hierarchyMode === 'Child' || hierarchyMode === 'None') &&
|
|
10787
10842
|
(this.parent.grid.filterSettings.columns.length !== 0 || this.parent.grid.searchSettings.key !== ''))) {
|
|
10788
10843
|
this.isHierarchyFilter = true;
|
|
@@ -10794,8 +10849,6 @@ var Filter = /** @__PURE__ @class */ (function () {
|
|
|
10794
10849
|
var parent_1 = getObject('parentItem', rec);
|
|
10795
10850
|
if (!isNullOrUndefined(parent_1)) {
|
|
10796
10851
|
var parRecord = getParentData(this.parent, rec.parentItem.uniqueID, true);
|
|
10797
|
-
//let parRecord: Object = this.flatFilteredData.filter((e: ITreeData) => {
|
|
10798
|
-
// return e.uniqueID === rec.parentItem.uniqueID; })[0];
|
|
10799
10852
|
setValue('hasFilteredChildRecords', true, parRecord);
|
|
10800
10853
|
if (parRecord && parRecord.parentItem) {
|
|
10801
10854
|
this.updateParentFilteredRecord(parRecord);
|
|
@@ -10819,7 +10872,6 @@ var Filter = /** @__PURE__ @class */ (function () {
|
|
|
10819
10872
|
};
|
|
10820
10873
|
Filter.prototype.addParentRecord = function (record) {
|
|
10821
10874
|
var parent = getParentData(this.parent, record.parentUniqueID);
|
|
10822
|
-
//let parent: Object = this.parent.flatData.filter((e: ITreeData) => {return e.uniqueID === record.parentUniqueID; })[0];
|
|
10823
10875
|
var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
|
|
10824
10876
|
: this.parent.searchSettings.hierarchyMode;
|
|
10825
10877
|
if (hierarchyMode === 'None' && (this.parent.grid.filterSettings.columns.length !== 0
|
|
@@ -11586,8 +11638,8 @@ var Toolbar = /** @__PURE__ @class */ (function () {
|
|
|
11586
11638
|
}
|
|
11587
11639
|
row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;
|
|
11588
11640
|
if (indentEle !== null && outdentEle !== null) {
|
|
11589
|
-
indentElement =
|
|
11590
|
-
outdentElement =
|
|
11641
|
+
indentElement = indentEle.parentElement;
|
|
11642
|
+
outdentElement = outdentEle.parentElement;
|
|
11591
11643
|
if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
|
|
11592
11644
|
indentElement.classList.add('e-hidden');
|
|
11593
11645
|
outdentElement.classList.add('e-hidden');
|
|
@@ -11721,14 +11773,7 @@ var Aggregate = /** @__PURE__ @class */ (function () {
|
|
|
11721
11773
|
Aggregate.prototype.calculateSummaryValue = function (summaryQuery, filteredData, isSort) {
|
|
11722
11774
|
this.summaryQuery = summaryQuery;
|
|
11723
11775
|
var parentRecord;
|
|
11724
|
-
var
|
|
11725
|
-
var parentData = [];
|
|
11726
|
-
for (var p = 0, len = parentDataLength; p < len; p++) {
|
|
11727
|
-
var summaryRow = getObject('isSummaryRow', filteredData[parseInt(p.toString(), 10)]);
|
|
11728
|
-
if (!summaryRow) {
|
|
11729
|
-
parentData.push(filteredData[parseInt(p.toString(), 10)]);
|
|
11730
|
-
}
|
|
11731
|
-
}
|
|
11776
|
+
var parentData = filteredData.filter(function (data) { return !getObject('isSummaryRow', data); });
|
|
11732
11777
|
var parentRecords = findParentRecords(parentData);
|
|
11733
11778
|
var flatRecords = parentData.slice();
|
|
11734
11779
|
var summaryLength = Object.keys(this.parent.aggregates).length;
|
|
@@ -11886,14 +11931,7 @@ var Aggregate = /** @__PURE__ @class */ (function () {
|
|
|
11886
11931
|
appendChildren(cellElement, tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property));
|
|
11887
11932
|
}
|
|
11888
11933
|
var value = single["" + summaryColumn.columnName]["" + summaryKey];
|
|
11889
|
-
|
|
11890
|
-
if (cellElement.innerHTML.indexOf(value) === -1) {
|
|
11891
|
-
summaryValue = cellElement.innerHTML + value;
|
|
11892
|
-
return summaryValue;
|
|
11893
|
-
}
|
|
11894
|
-
else {
|
|
11895
|
-
return cellElement.innerHTML;
|
|
11896
|
-
}
|
|
11934
|
+
return cellElement.innerHTML.indexOf(value) === -1 ? cellElement.innerHTML + value : cellElement.innerHTML;
|
|
11897
11935
|
};
|
|
11898
11936
|
Aggregate.prototype.getFormatFromType = function (summaryformat, type) {
|
|
11899
11937
|
if (isNullOrUndefined(type) || typeof summaryformat !== 'string') {
|
|
@@ -12265,6 +12303,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12265
12303
|
this.parent.on('batchCancelAction', this.batchCancelAction, this);
|
|
12266
12304
|
this.parent.grid.on('immutable-batch-cancel', this.immutableBatchAction, this);
|
|
12267
12305
|
this.parent.grid.on('next-cell-index', this.nextCellIndex, this);
|
|
12306
|
+
this.parent.grid.on('cellfocused', this.onCellFocused, this);
|
|
12268
12307
|
};
|
|
12269
12308
|
/**
|
|
12270
12309
|
* @hidden
|
|
@@ -12284,6 +12323,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12284
12323
|
this.parent.off('batchCancelAction', this.batchCancelAction);
|
|
12285
12324
|
this.parent.grid.off('immutable-batch-cancel', this.immutableBatchAction);
|
|
12286
12325
|
this.parent.grid.off('next-cell-index', this.nextCellIndex);
|
|
12326
|
+
this.parent.grid.off('cellfocused', this.onCellFocused);
|
|
12287
12327
|
};
|
|
12288
12328
|
/**
|
|
12289
12329
|
* To destroy the editModule
|
|
@@ -12323,14 +12363,18 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12323
12363
|
return this.batchChildCount;
|
|
12324
12364
|
};
|
|
12325
12365
|
BatchEdit.prototype.batchPageAction = function () {
|
|
12366
|
+
var _this = this;
|
|
12326
12367
|
var data = (this.parent.grid.dataSource instanceof DataManager ?
|
|
12327
12368
|
this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
|
|
12328
|
-
var
|
|
12369
|
+
var primaryKeyField = this.parent.grid.getPrimaryKeyFieldNames()[0];
|
|
12329
12370
|
var index;
|
|
12330
12371
|
if (!isNullOrUndefined(this.batchAddedRecords) && this.batchAddedRecords.length) {
|
|
12331
|
-
|
|
12332
|
-
index = data.
|
|
12372
|
+
var _loop_1 = function (i) {
|
|
12373
|
+
index = data.findIndex(function (e) { return e["" + primaryKeyField] === _this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKeyField]; });
|
|
12333
12374
|
data.splice(index, 1);
|
|
12375
|
+
};
|
|
12376
|
+
for (var i = 0; i < this.batchAddedRecords.length; i++) {
|
|
12377
|
+
_loop_1(i);
|
|
12334
12378
|
}
|
|
12335
12379
|
}
|
|
12336
12380
|
this.batchAddedRecords = this.batchRecords = this.batchAddRowRecord = this.batchDeletedRecords = this.currentViewRecords = [];
|
|
@@ -12555,11 +12599,15 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12555
12599
|
}
|
|
12556
12600
|
childs.push(data);
|
|
12557
12601
|
records = childs;
|
|
12558
|
-
|
|
12559
|
-
var indexvalue =
|
|
12602
|
+
var _loop_2 = function (i) {
|
|
12603
|
+
var indexvalue = this_1.batchRecords.findIndex(function (e) { return e["" + primarykey] === records[parseInt(i.toString(), 10)]["" + primarykey]; });
|
|
12560
12604
|
if (indexvalue !== -1) {
|
|
12561
|
-
|
|
12605
|
+
this_1.batchRecords.splice(indexvalue, 1);
|
|
12562
12606
|
}
|
|
12607
|
+
};
|
|
12608
|
+
var this_1 = this;
|
|
12609
|
+
for (var i = 0; i < records.length; i++) {
|
|
12610
|
+
_loop_2(i);
|
|
12563
12611
|
}
|
|
12564
12612
|
for (var i = 0; i < row.length; i++) {
|
|
12565
12613
|
if (!isNullOrUndefined(row[parseInt(i.toString(), 10)])) {
|
|
@@ -12575,11 +12623,11 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12575
12623
|
};
|
|
12576
12624
|
BatchEdit.prototype.updateChildCount = function (records) {
|
|
12577
12625
|
var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
|
|
12578
|
-
var addedRecords =
|
|
12626
|
+
var addedRecords = this.parent.getBatchChanges().addedRecords || [];
|
|
12579
12627
|
var parentItem = this.parent.editSettings.newRowPosition === 'Child' ? 'primaryParent' : 'parentItem';
|
|
12580
|
-
for (var i = 0; i <
|
|
12581
|
-
if (!isNullOrUndefined(
|
|
12582
|
-
if (
|
|
12628
|
+
for (var i = 0; i < addedRecords.length; i++) {
|
|
12629
|
+
if (!isNullOrUndefined(addedRecords[parseInt(i.toString(), 10)]["" + parentItem])) {
|
|
12630
|
+
if (addedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey] === records[parseInt(this.addRowIndex.toString(), 10)]["" + primaryKey]) {
|
|
12583
12631
|
this.batchChildCount = this.batchChildCount + 1;
|
|
12584
12632
|
}
|
|
12585
12633
|
}
|
|
@@ -12616,6 +12664,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12616
12664
|
delete this.parent["" + id]["" + value];
|
|
12617
12665
|
};
|
|
12618
12666
|
BatchEdit.prototype.batchCancelAction = function () {
|
|
12667
|
+
var _this = this;
|
|
12619
12668
|
var targetElement = 'targetElement';
|
|
12620
12669
|
var index;
|
|
12621
12670
|
var parentItem = 'parentItem';
|
|
@@ -12626,24 +12675,28 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12626
12675
|
this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
|
|
12627
12676
|
var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
|
|
12628
12677
|
if (!isNullOrUndefined(this.batchAddedRecords)) {
|
|
12629
|
-
|
|
12630
|
-
index = data.
|
|
12678
|
+
var _loop_3 = function (i) {
|
|
12679
|
+
index = data.findIndex(function (e) { return e["" + primaryKey] === _this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]; });
|
|
12631
12680
|
if (index !== -1) {
|
|
12632
12681
|
data.splice(index, 1);
|
|
12633
12682
|
}
|
|
12634
|
-
if (
|
|
12683
|
+
if (this_2.parent.editSettings.newRowPosition === 'Child') {
|
|
12635
12684
|
index = currentViewRecords.map(function (e) { return e["" + primaryKey]; })
|
|
12636
|
-
.indexOf(
|
|
12637
|
-
:
|
|
12685
|
+
.indexOf(this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem] ? this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey]
|
|
12686
|
+
: this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
|
|
12638
12687
|
if (!isNullOrUndefined(currentViewRecords[parseInt(index.toString(), 10)])) {
|
|
12639
12688
|
var children = currentViewRecords[parseInt(index.toString(), 10)]["" + childRecords];
|
|
12640
12689
|
for (var j = 0; children && j < children.length; j++) {
|
|
12641
|
-
if (children[parseInt(j.toString(), 10)]["" + primaryKey] ===
|
|
12642
|
-
|
|
12690
|
+
if (children[parseInt(j.toString(), 10)]["" + primaryKey] === this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]) {
|
|
12691
|
+
children.splice(j, 1);
|
|
12643
12692
|
}
|
|
12644
12693
|
}
|
|
12645
12694
|
}
|
|
12646
12695
|
}
|
|
12696
|
+
};
|
|
12697
|
+
var this_2 = this;
|
|
12698
|
+
for (var i = 0; i < this.batchAddedRecords.length; i++) {
|
|
12699
|
+
_loop_3(i);
|
|
12647
12700
|
}
|
|
12648
12701
|
}
|
|
12649
12702
|
if (!isNullOrUndefined(this.parent["" + targetElement])) {
|
|
@@ -12689,7 +12742,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12689
12742
|
var selectedIndex = void 0;
|
|
12690
12743
|
var addRowIndex = void 0;
|
|
12691
12744
|
var columnName = void 0;
|
|
12692
|
-
var
|
|
12745
|
+
var addRowRecord_1;
|
|
12693
12746
|
var childRecords = 'childRecords';
|
|
12694
12747
|
if (addRecords.length > 1 && this.parent.editSettings.newRowPosition !== 'Bottom') {
|
|
12695
12748
|
addRecords.reverse();
|
|
@@ -12742,17 +12795,17 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12742
12795
|
this.parent.editModule['previousNewRowPosition'] = rowPosition;
|
|
12743
12796
|
}
|
|
12744
12797
|
addRecords[parseInt(i.toString(), 10)].taskData = taskData;
|
|
12745
|
-
|
|
12746
|
-
if (isNullOrUndefined(
|
|
12747
|
-
|
|
12798
|
+
addRowRecord_1 = this.batchAddRowRecord[parseInt(i.toString(), 10)];
|
|
12799
|
+
if (isNullOrUndefined(addRowRecord_1)) {
|
|
12800
|
+
addRowRecord_1 = this.batchAddRowRecord[i - 1];
|
|
12748
12801
|
}
|
|
12749
12802
|
if (this.isSelfReference) {
|
|
12750
12803
|
if (!isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem)) {
|
|
12751
12804
|
updateParentRow(primarykey_1, addRecords[parseInt(i.toString(), 10)].parentItem, 'add', this.parent, this.isSelfReference, addRecords[parseInt(i.toString(), 10)]);
|
|
12752
12805
|
}
|
|
12753
12806
|
}
|
|
12754
|
-
if (!isNullOrUndefined(
|
|
12755
|
-
addRowIndex =
|
|
12807
|
+
if (!isNullOrUndefined(addRowRecord_1)) {
|
|
12808
|
+
addRowIndex = addRowRecord_1.index;
|
|
12756
12809
|
}
|
|
12757
12810
|
if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].index)) {
|
|
12758
12811
|
addRowIndex = 0;
|
|
@@ -12760,26 +12813,30 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12760
12813
|
if (this.parent.editSettings.newRowPosition !== 'Top' && this.parent.editSettings.newRowPosition !== 'Bottom') {
|
|
12761
12814
|
if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem) && this.selectedIndex === -1) {
|
|
12762
12815
|
selectedIndex = -1;
|
|
12763
|
-
|
|
12816
|
+
addRowRecord_1 = null;
|
|
12764
12817
|
}
|
|
12765
12818
|
}
|
|
12766
|
-
editAction({ value: addRecords[parseInt(i.toString(), 10)], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName,
|
|
12819
|
+
editAction({ value: addRecords[parseInt(i.toString(), 10)], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord_1);
|
|
12767
12820
|
selectedIndex = null;
|
|
12768
12821
|
if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[parseInt(i.toString(), 10)]["" + parentItem]) &&
|
|
12769
12822
|
(isNullOrUndefined(this.parent.editModule['addRowIndex']) || this.isSelfReference)) {
|
|
12770
12823
|
var indexValue = currentViewRecords.map(function (e) { return e["" + primarykey_1]; })
|
|
12771
12824
|
.indexOf(addRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primarykey_1]);
|
|
12772
12825
|
var children = currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords];
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
|
|
12826
|
+
if (!isNullOrUndefined(addRowIndex) && children.some(function (records) {
|
|
12827
|
+
return records.uniqueID === addRowRecord_1.uniqueID;
|
|
12828
|
+
})) {
|
|
12829
|
+
for (var j = 0; j < children.length; j++) {
|
|
12830
|
+
if (children[parseInt(j.toString(), 10)]["" + primarykey_1] === addRecords[parseInt(i.toString(), 10)]["" + primarykey_1]) {
|
|
12831
|
+
currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords].splice(j, 1);
|
|
12832
|
+
}
|
|
12776
12833
|
}
|
|
12777
12834
|
}
|
|
12778
12835
|
}
|
|
12779
12836
|
}
|
|
12780
12837
|
if (batchChanges["" + deletedRecords].length) {
|
|
12781
12838
|
for (i = 0; i < batchChanges["" + deletedRecords].length; i++) {
|
|
12782
|
-
editAction({ value: batchChanges["" + deletedRecords][parseInt(i.toString(), 10)], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName,
|
|
12839
|
+
editAction({ value: batchChanges["" + deletedRecords][parseInt(i.toString(), 10)], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord_1);
|
|
12783
12840
|
}
|
|
12784
12841
|
}
|
|
12785
12842
|
this.parent.parentData = [];
|
|
@@ -12853,6 +12910,15 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12853
12910
|
args["" + index] = this.batchIndex;
|
|
12854
12911
|
}
|
|
12855
12912
|
};
|
|
12913
|
+
BatchEdit.prototype.onCellFocused = function (e) {
|
|
12914
|
+
if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.isEdit && e.keyArgs) {
|
|
12915
|
+
if (e.keyArgs.action === 'shiftEnter') {
|
|
12916
|
+
e.keyArgs.preventDefault();
|
|
12917
|
+
this.parent.endEdit();
|
|
12918
|
+
return;
|
|
12919
|
+
}
|
|
12920
|
+
}
|
|
12921
|
+
};
|
|
12856
12922
|
return BatchEdit;
|
|
12857
12923
|
}());
|
|
12858
12924
|
|
|
@@ -12872,6 +12938,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
12872
12938
|
this.prevAriaRowIndex = '-1';
|
|
12873
12939
|
this.isAddedRowByMethod = false;
|
|
12874
12940
|
this.isAddedRowByContextMenu = false;
|
|
12941
|
+
this.isIndexUndefined = false;
|
|
12875
12942
|
Grid.Inject(Edit$1);
|
|
12876
12943
|
this.parent = parent;
|
|
12877
12944
|
this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);
|
|
@@ -13124,7 +13191,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13124
13191
|
}
|
|
13125
13192
|
};
|
|
13126
13193
|
Edit.prototype.keyPressed = function (args) {
|
|
13127
|
-
if (this.isOnBatch) {
|
|
13194
|
+
if (this.isOnBatch || args.action === 'tab' || args.action === 'shiftTab') {
|
|
13128
13195
|
this.keyPress = args.action;
|
|
13129
13196
|
}
|
|
13130
13197
|
if (args.action === 'f2') {
|
|
@@ -13666,9 +13733,10 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13666
13733
|
this.addRowRecord = this.parent.flatData[args.index];
|
|
13667
13734
|
this.addRowIndex = args.index;
|
|
13668
13735
|
}
|
|
13669
|
-
if (this.parent.editSettings.newRowPosition === 'Child' &&
|
|
13736
|
+
if (this.parent.editSettings.newRowPosition === 'Child' && this.isIndexUndefined &&
|
|
13670
13737
|
!isNullOrUndefined(this.parent.getSelectedRecords()[0])) {
|
|
13671
13738
|
this.addRowRecord = this.parent.getSelectedRecords()[0];
|
|
13739
|
+
this.isIndexUndefined = false;
|
|
13672
13740
|
}
|
|
13673
13741
|
if (isNullOrUndefined(this.addRowRecord) && this.parent.getCurrentViewRecords().length > this.addRowIndex &&
|
|
13674
13742
|
args.requestType === 'save' && this.parent.getSelectedRecords().length !== 0) {
|
|
@@ -13724,7 +13792,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13724
13792
|
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
|
|
13725
13793
|
var withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
|
|
13726
13794
|
this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
|
|
13727
|
-
if (currentData.length) {
|
|
13795
|
+
if (currentData.length && !isNullOrUndefined(index)) {
|
|
13728
13796
|
idMapping = currentData[this.addRowIndex][this.parent.idMapping];
|
|
13729
13797
|
parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];
|
|
13730
13798
|
if (currentData[this.addRowIndex].parentItem) {
|
|
@@ -13732,7 +13800,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13732
13800
|
}
|
|
13733
13801
|
parentItem = currentData[this.addRowIndex].parentItem;
|
|
13734
13802
|
}
|
|
13735
|
-
if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length) {
|
|
13803
|
+
if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length && !isNullOrUndefined(index)) {
|
|
13736
13804
|
level = currentData[this.addRowIndex].level;
|
|
13737
13805
|
if (this.parent.editSettings.newRowPosition === 'Above') {
|
|
13738
13806
|
position = 'before';
|
|
@@ -13808,14 +13876,24 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13808
13876
|
childRecords: value.childRecords };
|
|
13809
13877
|
}
|
|
13810
13878
|
if (args.requestType === 'delete') {
|
|
13811
|
-
var
|
|
13812
|
-
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
|
|
13816
|
-
|
|
13817
|
-
parentItem.
|
|
13879
|
+
var deletedValues_1 = args.data;
|
|
13880
|
+
var primaryKeyField_1 = this.parent.getPrimaryKeyFieldNames();
|
|
13881
|
+
if (!isNullOrUndefined(primaryKeyField_1) && primaryKeyField_1.length > 0) {
|
|
13882
|
+
var _loop_2 = function (i) {
|
|
13883
|
+
var deletevalue = deletedValues_1[parseInt(i.toString(), 10)].parentItem;
|
|
13884
|
+
if (deletevalue) {
|
|
13885
|
+
var parentItem = getParentData(this_2.parent, deletevalue.uniqueID);
|
|
13886
|
+
if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {
|
|
13887
|
+
var childIndex = parentItem.childRecords.findIndex(function (child) {
|
|
13888
|
+
return deletedValues_1[parseInt(i.toString(), 10)][primaryKeyField_1[0]] === child[primaryKeyField_1[0]];
|
|
13889
|
+
});
|
|
13890
|
+
parentItem.childRecords.splice(childIndex, 1);
|
|
13891
|
+
}
|
|
13818
13892
|
}
|
|
13893
|
+
};
|
|
13894
|
+
var this_2 = this;
|
|
13895
|
+
for (var i = 0; i < deletedValues_1.length; i++) {
|
|
13896
|
+
_loop_2(i);
|
|
13819
13897
|
}
|
|
13820
13898
|
}
|
|
13821
13899
|
}
|
|
@@ -13830,6 +13908,9 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13830
13908
|
if (this.parent.editSettings.newRowPosition === this.previousNewRowPosition || this.previousNewRowPosition === null) {
|
|
13831
13909
|
this.previousNewRowPosition = this.parent.editSettings.newRowPosition;
|
|
13832
13910
|
}
|
|
13911
|
+
if (isNullOrUndefined(index)) {
|
|
13912
|
+
this.isIndexUndefined = true;
|
|
13913
|
+
}
|
|
13833
13914
|
if (!this.isSelfReference && !isNullOrUndefined(data) && Object.hasOwnProperty.call(data, this.parent.childMapping)) {
|
|
13834
13915
|
var addRecords = [];
|
|
13835
13916
|
var previousEditMode = this.parent.editSettings.mode;
|
|
@@ -14004,12 +14085,12 @@ var DetailRow = /** @__PURE__ @class */ (function () {
|
|
|
14004
14085
|
args["" + visible] = false;
|
|
14005
14086
|
};
|
|
14006
14087
|
DetailRow.prototype.dataBoundArg = function () {
|
|
14007
|
-
var
|
|
14088
|
+
var detailRows = this.parent.getRows().filter(function (e) {
|
|
14008
14089
|
return !e.classList.contains('e-detailrow');
|
|
14009
14090
|
});
|
|
14010
|
-
for (var i = 0; i <
|
|
14011
|
-
var elements =
|
|
14012
|
-
var detailData = this.parent.grid.getRowObjectFromUID(
|
|
14091
|
+
for (var i = 0; i < detailRows.length; i++) {
|
|
14092
|
+
var elements = detailRows[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
|
|
14093
|
+
var detailData = this.parent.grid.getRowObjectFromUID(detailRows[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
|
|
14013
14094
|
var parentItem = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(), 10)]);
|
|
14014
14095
|
if (isNullOrUndefined(parentItem) || !isNullOrUndefined(parentItem) &&
|
|
14015
14096
|
getExpandStatus(this.parent, detailData.data, this.parent.grid.getCurrentViewRecords())) {
|
|
@@ -14045,10 +14126,9 @@ var DetailRow = /** @__PURE__ @class */ (function () {
|
|
|
14045
14126
|
};
|
|
14046
14127
|
DetailRow.prototype.actioncomplete = function (args) {
|
|
14047
14128
|
if (args.requestType === 'beginEdit' || args.requestType === 'add') {
|
|
14048
|
-
var
|
|
14049
|
-
var colum = parseInt(
|
|
14050
|
-
|
|
14051
|
-
args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', updtdcolum);
|
|
14129
|
+
var colSpan = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));
|
|
14130
|
+
var colum = parseInt(colSpan, 10) - 1;
|
|
14131
|
+
args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', colum.toString());
|
|
14052
14132
|
}
|
|
14053
14133
|
var focusElement = this.parent.grid.contentModule.getRows();
|
|
14054
14134
|
for (var i = 0; i < focusElement.length; i++) {
|
|
@@ -14282,6 +14362,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14282
14362
|
this.parent["" + action]('refresh-virtual-editform-cells', this.refreshCell, this);
|
|
14283
14363
|
this.parent["" + action]('virtaul-cell-focus', this.cellFocus, this);
|
|
14284
14364
|
this.parent["" + action]('virtual-scroll-edit', this.restoreEditState, this);
|
|
14365
|
+
this.parent["" + action]('set-virtual-page-query', this.SetVirtualPageQury, this);
|
|
14285
14366
|
}
|
|
14286
14367
|
else {
|
|
14287
14368
|
_super.prototype.eventListener.call(this, 'on');
|
|
@@ -14534,6 +14615,18 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14534
14615
|
var restoreEdit = 'restoreEdit';
|
|
14535
14616
|
_super.prototype["" + restoreEdit].call(this);
|
|
14536
14617
|
};
|
|
14618
|
+
VirtualTreeContentRenderer.prototype.SetVirtualPageQury = function (args) {
|
|
14619
|
+
var visiblePage = [];
|
|
14620
|
+
if (this.prevInfo && this.prevInfo.blockIndexes) {
|
|
14621
|
+
visiblePage = getVisiblePage(this.prevInfo.blockIndexes);
|
|
14622
|
+
}
|
|
14623
|
+
if ((this.requestType === 'refresh') && visiblePage.length) {
|
|
14624
|
+
args.query.skip(this.parent.pageSettings.pageSize * (visiblePage[0] - 1));
|
|
14625
|
+
args.query.take(this.parent.pageSettings.pageSize * visiblePage.length);
|
|
14626
|
+
args.skipPage = true;
|
|
14627
|
+
return;
|
|
14628
|
+
}
|
|
14629
|
+
};
|
|
14537
14630
|
/**
|
|
14538
14631
|
* Resets the edit state if certain conditions are met.
|
|
14539
14632
|
*
|
|
@@ -14674,6 +14767,19 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14674
14767
|
var xAxis = current.axis === 'X';
|
|
14675
14768
|
var x = _this.getColumnOffset(xAxis ? _this.vgenerator.getColumnIndexes()[0] - 1 : _this.prevInfo.columnIndexes[0]
|
|
14676
14769
|
- 1);
|
|
14770
|
+
if (_this.parent.isFrozenGrid() && _this.parent.enableColumnVirtualization && _this.currentInfo &&
|
|
14771
|
+
_this.currentInfo.columnIndexes) {
|
|
14772
|
+
var cBlock = _this.currentInfo.columnIndexes[0] - 1;
|
|
14773
|
+
var frzLeftWidth_1 = 0;
|
|
14774
|
+
_this.parent.getColumns().filter(function (col) {
|
|
14775
|
+
if (col.visible && col.freeze === 'Left') {
|
|
14776
|
+
frzLeftWidth_1 += parseInt(col.width.toString(), 10);
|
|
14777
|
+
}
|
|
14778
|
+
});
|
|
14779
|
+
if (cBlock > _this.parent.getVisibleFrozenLeftCount()) {
|
|
14780
|
+
x = x - frzLeftWidth_1;
|
|
14781
|
+
}
|
|
14782
|
+
}
|
|
14677
14783
|
if (xAxis) {
|
|
14678
14784
|
var idx = Object.keys(_this.vgenerator.cOffsets).length - _this.prevInfo.columnIndexes.length;
|
|
14679
14785
|
var maxLeft = _this.vgenerator.cOffsets[idx - 1];
|
|
@@ -14691,6 +14797,9 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14691
14797
|
}
|
|
14692
14798
|
if (_this.parent.enableColumnVirtualization) {
|
|
14693
14799
|
_this.header.virtualEle.adjustTable(x, 0);
|
|
14800
|
+
if (_this.parent.isFrozenGrid()) {
|
|
14801
|
+
_this.parent.contentModule['resetStickyLeftPos'](x);
|
|
14802
|
+
}
|
|
14694
14803
|
}
|
|
14695
14804
|
}
|
|
14696
14805
|
}
|
|
@@ -14835,10 +14944,10 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14835
14944
|
if (((downScroll && scrollArgs.direction !== 'up' && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
|
|
14836
14945
|
|| (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||
|
|
14837
14946
|
((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
14838
|
-
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '')
|
|
14947
|
+
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== ''))) {
|
|
14839
14948
|
var viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
|
|
14840
14949
|
this.previousInfo = viewInfo;
|
|
14841
|
-
if (this.prevInfo &&
|
|
14950
|
+
if (this.prevInfo && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
|
|
14842
14951
|
|| ((info.axis === 'X' && this.prevInfo.columnIndexes.toString() === viewInfo.columnIndexes.toString())
|
|
14843
14952
|
|| (this.parent.isFrozenGrid() && this.parent.getVisibleFrozenLeftCount() >= viewInfo.columnIndexes[0]
|
|
14844
14953
|
&& this.prevInfo.columnIndexes.toString().includes(viewInfo.columnIndexes.toString()))))) {
|
|
@@ -14860,7 +14969,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14860
14969
|
viewInfo.loadNext = false;
|
|
14861
14970
|
}
|
|
14862
14971
|
this.requestType = 'virtualscroll';
|
|
14863
|
-
if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
|
|
14972
|
+
if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left' && !isRemoteData(this.parent.root)) {
|
|
14864
14973
|
viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
|
|
14865
14974
|
}
|
|
14866
14975
|
if (this.parent.enableVirtualMaskRow) {
|
|
@@ -14933,9 +15042,33 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14933
15042
|
if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'Y') {
|
|
14934
15043
|
this.isExpandCollapse = false;
|
|
14935
15044
|
}
|
|
15045
|
+
var reduceWidth_1 = 0;
|
|
15046
|
+
if (this.parent.enableColumnVirtualization && this.parent.isFrozenGrid()) {
|
|
15047
|
+
var frzLeftWidth_2 = 0;
|
|
15048
|
+
this.parent.getColumns().filter(function (col) {
|
|
15049
|
+
if (col.visible) {
|
|
15050
|
+
reduceWidth_1 += parseInt(col.width.toString(), 10);
|
|
15051
|
+
if (col.freeze === 'Left') {
|
|
15052
|
+
frzLeftWidth_2 += parseInt(col.width.toString(), 10);
|
|
15053
|
+
}
|
|
15054
|
+
}
|
|
15055
|
+
});
|
|
15056
|
+
var cIndex = info.columnIndexes;
|
|
15057
|
+
width = this.getColumnOffset(cIndex[cIndex.length - 1]) - this.getColumnOffset(cIndex[0] - 1) + '';
|
|
15058
|
+
if (cBlock > this.parent.getVisibleFrozenLeftCount()) {
|
|
15059
|
+
cOffset = cOffset - frzLeftWidth_2;
|
|
15060
|
+
}
|
|
15061
|
+
this.resetStickyLeftPos(cOffset, newChild);
|
|
15062
|
+
}
|
|
14936
15063
|
if (!this.isExpandCollapse || this.translateY === 0) {
|
|
14937
15064
|
this.translateY = this.translateY < 0 ? 0 : this.translateY;
|
|
14938
15065
|
getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
|
|
15066
|
+
if (this.parent.enableColumnVirtualization) {
|
|
15067
|
+
this.header.virtualEle.adjustTable(cOffset, 0);
|
|
15068
|
+
if (this.parent.isFrozenGrid()) {
|
|
15069
|
+
this.resetStickyLeftPos(cOffset);
|
|
15070
|
+
}
|
|
15071
|
+
}
|
|
14939
15072
|
}
|
|
14940
15073
|
else {
|
|
14941
15074
|
this.isExpandCollapse = false;
|
|
@@ -15053,7 +15186,12 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
|
|
|
15053
15186
|
this["" + options].prevTop = this["" + options].prevLeft = 0;
|
|
15054
15187
|
var isScrollByFocus = 'isScrollByFocus';
|
|
15055
15188
|
return function (e) {
|
|
15056
|
-
|
|
15189
|
+
var keyPress = 'keyPress';
|
|
15190
|
+
var keyaction;
|
|
15191
|
+
if (instance && instance.root && instance.root.editModule && instance.root.editModule["" + keyPress]) {
|
|
15192
|
+
keyaction = instance.root.editModule["" + keyPress];
|
|
15193
|
+
}
|
|
15194
|
+
if ((instance.isEdit && instance.root.editModule["" + isScrollByFocus]) || (instance.isEdit && (keyaction === 'tab' || keyaction === 'shiftTab'))) {
|
|
15057
15195
|
instance.root.editModule["" + isScrollByFocus] = false;
|
|
15058
15196
|
return;
|
|
15059
15197
|
}
|