@syncfusion/ej2-treegrid 26.1.35-469198 → 26.1.35-760834
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-treegrid.min.js +1 -1
- package/dist/ej2-treegrid.umd.min.js +1 -1
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +156 -35
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +158 -35
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +1 -1
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/ts/undefined +73 -602
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/package.json +1 -1
- package/src/index.d.ts +4 -0
- package/src/treegrid/actions/batch-edit.d.ts +73 -0
- package/src/treegrid/actions/clipboard.d.ts +36 -0
- package/src/treegrid/actions/column-chooser.d.ts +37 -0
- package/src/treegrid/actions/column-menu.d.ts +24 -0
- package/src/treegrid/actions/command-column.d.ts +24 -0
- package/src/treegrid/actions/context-menu.d.ts +42 -0
- package/src/treegrid/actions/crud-actions.d.ts +66 -0
- package/src/treegrid/actions/crud-actions.js +1 -1
- package/src/treegrid/actions/detail-row.d.ts +39 -0
- package/src/treegrid/actions/edit.d.ts +112 -0
- package/src/treegrid/actions/edit.js +3 -2
- package/src/treegrid/actions/excel-export.d.ts +59 -0
- package/src/treegrid/actions/excel-export.js +14 -3
- package/src/treegrid/actions/filter.d.ts +57 -0
- package/src/treegrid/actions/freeze-column.d.ts +28 -0
- package/src/treegrid/actions/index.d.ts +24 -0
- package/src/treegrid/actions/infinite-scroll.d.ts +96 -0
- package/src/treegrid/actions/logger.d.ts +25 -0
- package/src/treegrid/actions/page.d.ts +67 -0
- package/src/treegrid/actions/pdf-export.d.ts +55 -0
- package/src/treegrid/actions/print.d.ts +37 -0
- package/src/treegrid/actions/reorder.d.ts +36 -0
- package/src/treegrid/actions/resize.d.ts +36 -0
- package/src/treegrid/actions/rowdragdrop.d.ts +113 -0
- package/src/treegrid/actions/rowdragdrop.js +2 -2
- package/src/treegrid/actions/selection.d.ts +51 -0
- package/src/treegrid/actions/selection.js +9 -0
- package/src/treegrid/actions/sort.d.ts +63 -0
- package/src/treegrid/actions/summary.d.ts +47 -0
- package/src/treegrid/actions/toolbar.d.ts +52 -0
- package/src/treegrid/actions/virtual-scroll.d.ts +55 -0
- package/src/treegrid/actions/virtual-scroll.js +13 -1
- package/src/treegrid/base/constant.d.ts +162 -0
- package/src/treegrid/base/data.d.ts +90 -0
- package/src/treegrid/base/data.js +20 -3
- package/src/treegrid/base/index.d.ts +11 -0
- package/src/treegrid/base/interface.d.ts +182 -0
- package/src/treegrid/base/treegrid.d.ts +2190 -0
- package/src/treegrid/base/treegrid.js +86 -17
- package/src/treegrid/enum.d.ts +155 -0
- package/src/treegrid/index.d.ts +9 -0
- package/src/treegrid/models/column.d.ts +752 -0
- package/src/treegrid/models/edit-settings.d.ts +90 -0
- package/src/treegrid/models/filter-settings.d.ts +203 -0
- package/src/treegrid/models/index.d.ts +24 -0
- package/src/treegrid/models/infinite-scroll-settings.d.ts +25 -0
- package/src/treegrid/models/loading-indicator.d.ts +19 -0
- package/src/treegrid/models/page-settings.d.ts +60 -0
- package/src/treegrid/models/rowdrop-settings.d.ts +27 -0
- package/src/treegrid/models/search-settings.d.ts +71 -0
- package/src/treegrid/models/selection-settings.d.ts +79 -0
- package/src/treegrid/models/sort-settings.d.ts +40 -0
- package/src/treegrid/models/summary.d.ts +124 -0
- package/src/treegrid/models/textwrap-settings.d.ts +16 -0
- package/src/treegrid/renderer/index.d.ts +5 -0
- package/src/treegrid/renderer/render.d.ts +41 -0
- package/src/treegrid/renderer/virtual-row-model-generator.d.ts +16 -0
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +75 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +11 -6
- package/src/treegrid/utils.d.ts +70 -0
- package/styles/bootstrap5.3-lite.css +2 -1090
- package/styles/bootstrap5.3.css +3 -1091
- package/styles/fluent2-lite.css +8 -1129
- package/styles/fluent2.css +8 -1129
- package/styles/material3-dark-lite.css +10 -1098
- package/styles/material3-dark.css +10 -1098
- package/styles/material3-lite.css +10 -1098
- package/styles/material3.css +10 -1098
- package/styles/tailwind3-lite.css +77 -1213
- package/styles/tailwind3.css +84 -1220
- package/styles/treegrid/_bds-definition.scss +0 -25
- package/styles/treegrid/_bigger.scss +6 -6
- package/styles/treegrid/_bootstrap-dark-definition.scss +0 -25
- package/styles/treegrid/_bootstrap-definition.scss +0 -25
- package/styles/treegrid/_bootstrap4-definition.scss +0 -25
- package/styles/treegrid/_bootstrap5-definition.scss +0 -25
- package/styles/treegrid/_bootstrap5.3-definition.scss +0 -25
- package/styles/treegrid/_fabric-dark-definition.scss +0 -25
- package/styles/treegrid/_fabric-definition.scss +0 -25
- package/styles/treegrid/_fluent-definition.scss +0 -25
- package/styles/treegrid/_fluent2-definition.scss +0 -25
- package/styles/treegrid/_fusionnew-definition.scss +0 -25
- package/styles/treegrid/_highcontrast-definition.scss +0 -25
- package/styles/treegrid/_highcontrast-light-definition.scss +0 -25
- package/styles/treegrid/_layout.scss +29 -29
- package/styles/treegrid/_material-dark-definition.scss +0 -25
- package/styles/treegrid/_material-definition.scss +0 -25
- package/styles/treegrid/_material3-definition.scss +0 -25
- package/styles/treegrid/_tailwind-definition.scss +0 -25
- package/styles/treegrid/_tailwind3-definition.scss +17 -42
- package/styles/treegrid/bootstrap5.3.css +3 -1091
- package/styles/treegrid/fluent2.css +8 -1129
- package/styles/treegrid/material3-dark.css +10 -1098
- package/styles/treegrid/material3.css +10 -1098
- package/styles/treegrid/tailwind3.css +84 -1220
- package/treegrid.d.ts +4 -0
- package/treegrid.js +4 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { merge, Property, ChildProperty, Collection, isNullOrUndefined, Browser, removeClass, addClass, getValue, createElement, setValue, extend as extend$1, Internationalization, getEnumValue, compile, Component, L10n, EventHandler, KeyboardEvents, SanitizeHtmlHelper, Complex, Event, NotifyPropertyChanges, closest, classList, setStyleAttribute, select, debounce, remove } from '@syncfusion/ej2-base';
|
|
2
|
-
import { Logger as Logger$1, Grid, 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, RowDD as RowDD$1, Scroll, VirtualRowModelGenerator, Filter as Filter$1, ExcelExport as ExcelExport$1, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, Aggregate as Aggregate$1, calculateAggregate, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, Edit as Edit$1, resetRowIndex, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, VirtualContentRenderer, Cell, InterSectionObserver, getTransformValues, VirtualScroll as VirtualScroll$1, RenderType, VirtualHeaderRenderer, ColumnChooser as ColumnChooser$1, InfiniteScroll as InfiniteScroll$1, RowRenderer } from '@syncfusion/ej2-grids';
|
|
2
|
+
import { Logger as Logger$1, Grid, 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, RowDD as RowDD$1, Scroll, VirtualRowModelGenerator, Filter as Filter$1, ExcelExport as ExcelExport$1, Data, ExportHelper, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, Aggregate as Aggregate$1, calculateAggregate, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, Edit as Edit$1, resetRowIndex, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, VirtualContentRenderer, Cell, InterSectionObserver, getTransformValues, VirtualScroll as VirtualScroll$1, RenderType, VirtualHeaderRenderer, ColumnChooser as ColumnChooser$1, InfiniteScroll as InfiniteScroll$1, RowRenderer } 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';
|
|
@@ -943,6 +943,14 @@ class Selection {
|
|
|
943
943
|
checkBox = checkWrap.querySelector('input[type="checkbox"]');
|
|
944
944
|
this.triggerChkChangeEvent(checkBox, checkBoxvalue, target.closest('tr'));
|
|
945
945
|
}
|
|
946
|
+
if (!isNullOrUndefined(this.parent['parentQuery']) && this.parent.selectionSettings.persistSelection
|
|
947
|
+
&& this.parent['columnModel'].filter((col) => { return col.type === 'checkbox'; }).length > 0
|
|
948
|
+
&& isRemoteData(this.parent)) {
|
|
949
|
+
if (this.parent['parentQuery'].length > 0) {
|
|
950
|
+
this.parent.query.queries.push(...this.parent['parentQuery']);
|
|
951
|
+
this.parent['parentQuery'] = [];
|
|
952
|
+
}
|
|
953
|
+
}
|
|
946
954
|
}
|
|
947
955
|
triggerChkChangeEvent(checkBox, checkState, rowElement) {
|
|
948
956
|
const data = this.parent.getCurrentViewRecords()[rowElement.rowIndex];
|
|
@@ -2206,16 +2214,20 @@ class DataManipulation {
|
|
|
2206
2214
|
const clonequries = qry.queries.filter((e) => e.fn !== 'onPage' && e.fn !== 'onWhere');
|
|
2207
2215
|
qry.queries = clonequries;
|
|
2208
2216
|
qry.isCountRequired = true;
|
|
2217
|
+
let idMappingValue = parseInt(rowDetails.record[this.parent.idMapping], 10);
|
|
2218
|
+
if (isNaN(idMappingValue)) {
|
|
2219
|
+
idMappingValue = rowDetails.record[this.parent.idMapping].toString();
|
|
2220
|
+
}
|
|
2209
2221
|
if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
|
|
2210
2222
|
qry.take(this.parent.pageSettings.pageSize);
|
|
2211
2223
|
const expandDetail = [];
|
|
2212
|
-
expandDetail.push('ExpandingAction',
|
|
2224
|
+
expandDetail.push('ExpandingAction', idMappingValue.toString());
|
|
2213
2225
|
qry.expand(expandDetail);
|
|
2214
2226
|
}
|
|
2215
2227
|
else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {
|
|
2216
2228
|
qry.take(this.parent.grid.pageSettings.pageSize);
|
|
2217
2229
|
const expandDetail = [];
|
|
2218
|
-
expandDetail.push('CollapsingAction',
|
|
2230
|
+
expandDetail.push('CollapsingAction', idMappingValue.toString());
|
|
2219
2231
|
qry.expand(expandDetail);
|
|
2220
2232
|
}
|
|
2221
2233
|
qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
|
|
@@ -2410,6 +2422,9 @@ class DataManipulation {
|
|
|
2410
2422
|
e[`${result}`] = this.parent.summaryModule.calculateSummaryValue(summaryQuery, e[`${result}`], true);
|
|
2411
2423
|
}
|
|
2412
2424
|
}
|
|
2425
|
+
if (rowDetails.action === 'remoteExpand' && this.parent.allowPaging && this.parent.pageSettings.pageSizeMode === 'All') {
|
|
2426
|
+
this.parent.grid.pageSettings.totalRecordsCount = this.parent.grid.currentViewData.length + result.length;
|
|
2427
|
+
}
|
|
2413
2428
|
if (this.parent.enableVirtualization) {
|
|
2414
2429
|
this.parent.grid.pageSettings.totalRecordsCount = e.count;
|
|
2415
2430
|
}
|
|
@@ -2463,7 +2478,17 @@ class DataManipulation {
|
|
|
2463
2478
|
}
|
|
2464
2479
|
if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) ||
|
|
2465
2480
|
((currentData[this.parent.hasChildMapping]) && isCountRequired(this.parent))) {
|
|
2466
|
-
currentData.
|
|
2481
|
+
if (!isNullOrUndefined(currentData[this.parent.childMapping])) {
|
|
2482
|
+
if (currentData[this.parent.childMapping].length > 0) {
|
|
2483
|
+
currentData.hasChildRecords = true;
|
|
2484
|
+
}
|
|
2485
|
+
else {
|
|
2486
|
+
currentData.hasChildRecords = false;
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
else {
|
|
2490
|
+
currentData.hasChildRecords = true;
|
|
2491
|
+
}
|
|
2467
2492
|
if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)
|
|
2468
2493
|
&& isNullOrUndefined(currentData[this.parent.childMapping])) {
|
|
2469
2494
|
currentData.expanded = false;
|
|
@@ -3207,7 +3232,7 @@ function removeChildRecords(childRecords, modifiedData, action, key, control, is
|
|
|
3207
3232
|
editedData.taskData[keys[parseInt(i.toString(), 10)]] =
|
|
3208
3233
|
childRecords[parseInt(j.toString(), 10)][keys[parseInt(i.toString(), 10)]] =
|
|
3209
3234
|
modifiedData[keys[parseInt(i.toString(), 10)]];
|
|
3210
|
-
if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell') {
|
|
3235
|
+
if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell' && !isNullOrUndefined(control.grid.editModule)) {
|
|
3211
3236
|
const editModule = 'editModule';
|
|
3212
3237
|
control.grid.editModule[`${editModule}`].editRowIndex = modifiedData.index;
|
|
3213
3238
|
control.grid.editModule[`${editModule}`].updateCurrentViewData(modifiedData);
|
|
@@ -3799,8 +3824,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3799
3824
|
if (summaryElement !== null) {
|
|
3800
3825
|
const cellIndex = target.cellIndex;
|
|
3801
3826
|
const row = summaryElement.children[parseInt(cellIndex.toString(), 10)];
|
|
3802
|
-
|
|
3803
|
-
|
|
3827
|
+
if (!isNullOrUndefined(row) && !this.grid.isEdit) {
|
|
3828
|
+
addClass([row], 'e-focused');
|
|
3829
|
+
addClass([row], 'e-focus');
|
|
3830
|
+
}
|
|
3804
3831
|
}
|
|
3805
3832
|
else {
|
|
3806
3833
|
this.clearSelection();
|
|
@@ -3827,8 +3854,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3827
3854
|
const cellIndex = target.cellIndex;
|
|
3828
3855
|
if (!isNullOrUndefined(cellIndex)) {
|
|
3829
3856
|
const row = summaryElement.children[parseInt(cellIndex.toString(), 10)];
|
|
3830
|
-
|
|
3831
|
-
|
|
3857
|
+
if (!isNullOrUndefined(row) && !this.grid.isEdit) {
|
|
3858
|
+
addClass([row], 'e-focused');
|
|
3859
|
+
addClass([row], 'e-focus');
|
|
3860
|
+
}
|
|
3832
3861
|
}
|
|
3833
3862
|
}
|
|
3834
3863
|
else {
|
|
@@ -3907,7 +3936,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3907
3936
|
requiredModules() {
|
|
3908
3937
|
const modules = [];
|
|
3909
3938
|
const splitFrozenCount = 'splitFrozenCount';
|
|
3910
|
-
this.
|
|
3939
|
+
if (!this.isReact && isNullOrUndefined(this['changedProperties'].columns)) {
|
|
3940
|
+
this.grid[`${splitFrozenCount}`](this.getColumns());
|
|
3941
|
+
}
|
|
3911
3942
|
if (this.isDestroyed) {
|
|
3912
3943
|
return modules;
|
|
3913
3944
|
}
|
|
@@ -4223,12 +4254,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4223
4254
|
if (this.treeColumnIndex >= this.columns.length) {
|
|
4224
4255
|
failureCases.push('TreeColumnIndex value should not exceed the total column count.');
|
|
4225
4256
|
}
|
|
4226
|
-
if (this.enableVirtualization &&
|
|
4227
|
-
|
|
4228
|
-
|
|
4257
|
+
if (this.enableVirtualization &&
|
|
4258
|
+
(this.columnModel.some((col) => /%$/.test(col.width)) ||
|
|
4259
|
+
/%$/.test(this.height.toString()))) {
|
|
4229
4260
|
failureCases.push('column width and height should be in pixels');
|
|
4230
4261
|
}
|
|
4231
|
-
if (
|
|
4262
|
+
if ((this.childMapping !== 'Children') && !isNullOrUndefined(this.idMapping)) {
|
|
4232
4263
|
failureCases.push('Both IdMapping and ChildMapping should not be used together for tree grid rendering.');
|
|
4233
4264
|
}
|
|
4234
4265
|
if ((!isNullOrUndefined(this.idMapping) && (isNullOrUndefined(this.parentIdMapping))) ||
|
|
@@ -4391,10 +4422,28 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4391
4422
|
bindGridEvents() {
|
|
4392
4423
|
this.grid.rowSelecting = (args) => {
|
|
4393
4424
|
this.IsExpandCollapseClicked(args);
|
|
4425
|
+
if (!isNullOrUndefined(args.data) && this.selectionSettings.persistSelection
|
|
4426
|
+
&& this.columnModel.filter((col) => col.type === 'checkbox').length > 0 && isRemoteData(this)) {
|
|
4427
|
+
if (!isNullOrUndefined(args.data.parentItem) || args.isHeaderCheckboxClicked) {
|
|
4428
|
+
this.parentQuery = this.query.queries.filter((q) => q.e.field === this.parentIdMapping);
|
|
4429
|
+
this.query.queries = this.query.queries.slice(0, 0);
|
|
4430
|
+
}
|
|
4431
|
+
}
|
|
4432
|
+
if (this.pageSettings.pageSizeMode === 'Root') {
|
|
4433
|
+
this.grid.selectionModule['totalRecordsCount'] = this.grid.currentViewData.length;
|
|
4434
|
+
}
|
|
4435
|
+
if (this.enableVirtualization && args.rowIndex === this.selectedRowIndex) {
|
|
4436
|
+
args.cancel = true;
|
|
4437
|
+
}
|
|
4394
4438
|
this.trigger(rowSelecting, args);
|
|
4395
4439
|
};
|
|
4396
4440
|
this.grid.rowDeselecting = (args) => {
|
|
4397
4441
|
this.IsExpandCollapseClicked(args);
|
|
4442
|
+
if (!isNullOrUndefined(args.data) && this.selectionSettings.persistSelection
|
|
4443
|
+
&& this.columnModel.filter((col) => col.type === 'checkbox').length > 0 && isRemoteData(this)) {
|
|
4444
|
+
this.parentQuery = this.query.queries.filter((q) => q.e.field === this.parentIdMapping);
|
|
4445
|
+
this.query.queries = this.query.queries.slice(0, 0);
|
|
4446
|
+
}
|
|
4398
4447
|
this.trigger(rowDeselecting, args);
|
|
4399
4448
|
};
|
|
4400
4449
|
this.grid.rowSelected = (args) => {
|
|
@@ -4534,6 +4583,16 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4534
4583
|
this.grid.selectionModule[`${updateRowSelection}`](this.getRows()[parseInt(index.toString(), 10)], index);
|
|
4535
4584
|
}
|
|
4536
4585
|
}
|
|
4586
|
+
if (this.enableVirtualization && this.selectionSettings.persistSelection
|
|
4587
|
+
&& !isNullOrUndefined(this.virtualScrollModule.prevSelectedRecord)) {
|
|
4588
|
+
for (let i = 0; i < this.virtualScrollModule.prevSelectedRecord.length; i++) {
|
|
4589
|
+
const updateRowSelection = 'updateRowSelection';
|
|
4590
|
+
const index =
|
|
4591
|
+
// eslint-disable-next-line max-len
|
|
4592
|
+
this.getCurrentViewRecords().indexOf(this.virtualScrollModule.prevSelectedRecord[parseInt(i.toString(), 10)]);
|
|
4593
|
+
this.grid.selectionModule[`${updateRowSelection}`](this.getRows()[parseInt(index.toString(), 10)], index);
|
|
4594
|
+
}
|
|
4595
|
+
}
|
|
4537
4596
|
this.trigger(dataBound, args);
|
|
4538
4597
|
this.initialRender = false;
|
|
4539
4598
|
};
|
|
@@ -5137,6 +5196,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5137
5196
|
onPropertyChanged(newProp) {
|
|
5138
5197
|
const properties = Object.keys(newProp);
|
|
5139
5198
|
let requireRefresh = false;
|
|
5199
|
+
if (properties.indexOf('columns') > -1 && !isNullOrUndefined(newProp.columns) && this.frozenColumns === 0
|
|
5200
|
+
&& this.frozenRows === 0 && !this.columnModel.some((col) => col.isFrozen || col.freeze)) {
|
|
5201
|
+
this.grid.columns = this.getGridColumns(newProp.columns);
|
|
5202
|
+
this.grid['updateColumnObject']();
|
|
5203
|
+
requireRefresh = true;
|
|
5204
|
+
}
|
|
5140
5205
|
for (const prop of properties) {
|
|
5141
5206
|
switch (prop) {
|
|
5142
5207
|
case 'treeColumnIndex':
|
|
@@ -5478,6 +5543,22 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5478
5543
|
}
|
|
5479
5544
|
}
|
|
5480
5545
|
}
|
|
5546
|
+
if (((target.classList.contains('e-flmenu-cancelbtn') || target.classList.contains('e-flmenu-okbtn')
|
|
5547
|
+
|| target.classList.contains('e-content') || target.classList.contains('e-rowcell'))
|
|
5548
|
+
&& !isNullOrUndefined(this.filterModule) && this.isReact)) {
|
|
5549
|
+
if (!isNullOrUndefined(this.grid.filterModule['column'])) {
|
|
5550
|
+
if (this.grid.filterModule['column'].filterTemplate) {
|
|
5551
|
+
const elem = document.getElementById(this.grid.filterModule.filterModule['dlgObj'].element.id);
|
|
5552
|
+
this.grid.filterModule['fltrDlgDetails'].isOpen = false;
|
|
5553
|
+
if (this.grid.filterModule.filterModule['dlgObj'] && !this.grid.filterModule.filterModule['dlgObj'].isDestroyed && elem) {
|
|
5554
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5555
|
+
this.clearTemplate(['filterTemplate'], undefined, () => {
|
|
5556
|
+
this.grid.filterModule.filterModule['dlgObj'].destroy();
|
|
5557
|
+
});
|
|
5558
|
+
}
|
|
5559
|
+
}
|
|
5560
|
+
}
|
|
5561
|
+
}
|
|
5481
5562
|
}
|
|
5482
5563
|
/**
|
|
5483
5564
|
* Returns TreeGrid rows
|
|
@@ -6250,6 +6331,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6250
6331
|
* @returns {void}
|
|
6251
6332
|
*/
|
|
6252
6333
|
expandRow(row, record, key, level) {
|
|
6334
|
+
this.isCollapseAll = false;
|
|
6253
6335
|
if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key) && isNullOrUndefined(level)) {
|
|
6254
6336
|
const error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
|
|
6255
6337
|
this.trigger(actionFailure, { error: error });
|
|
@@ -6313,6 +6395,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6313
6395
|
expandArgs = { data: parentRec, row: row };
|
|
6314
6396
|
this.trigger(expanded, expandArgs);
|
|
6315
6397
|
}
|
|
6398
|
+
else if (!this.isExpandAll && this.enableVirtualization && this.selectionSettings.persistSelection
|
|
6399
|
+
&& !isNullOrUndefined(this.virtualScrollModule.prevSelectedRecord)) {
|
|
6400
|
+
this.virtualScrollModule.prevSelectedRecord = [];
|
|
6401
|
+
}
|
|
6316
6402
|
else if (!this.isExpandAll) {
|
|
6317
6403
|
this.trigger(expanded, expandArgs);
|
|
6318
6404
|
}
|
|
@@ -6338,13 +6424,13 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6338
6424
|
return e.hasChildRecords;
|
|
6339
6425
|
});
|
|
6340
6426
|
}
|
|
6341
|
-
else if (isNullOrUndefined(record)) {
|
|
6427
|
+
else if (isNullOrUndefined(record) && !isNullOrUndefined(row)) {
|
|
6342
6428
|
if (this.detailTemplate) {
|
|
6343
6429
|
record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
|
|
6344
6430
|
}
|
|
6345
6431
|
else {
|
|
6346
|
-
if (this.enableVirtualization && this.isCollapseAll) {
|
|
6347
|
-
if (
|
|
6432
|
+
if (this.enableVirtualization && (this.isCollapseAll || this.isExpandAll)) {
|
|
6433
|
+
if (row.rowIndex === -1) {
|
|
6348
6434
|
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
|
|
6349
6435
|
}
|
|
6350
6436
|
else {
|
|
@@ -6370,6 +6456,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6370
6456
|
* @returns {void}
|
|
6371
6457
|
*/
|
|
6372
6458
|
collapseRow(row, record, key) {
|
|
6459
|
+
this.isExpandAll = false;
|
|
6373
6460
|
if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key)) {
|
|
6374
6461
|
const error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
|
|
6375
6462
|
this.trigger(actionFailure, { error: error });
|
|
@@ -6638,6 +6725,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6638
6725
|
return e.querySelector('.e-treegrid' + (action === 'expand' ? 'collapse' : 'expand'));
|
|
6639
6726
|
});
|
|
6640
6727
|
}
|
|
6728
|
+
if (!rows.length && this.getRows().length) {
|
|
6729
|
+
rows.push(this.getRows()[0]);
|
|
6730
|
+
}
|
|
6641
6731
|
this.isExpandAll = true;
|
|
6642
6732
|
this.isCollapseAll = true;
|
|
6643
6733
|
if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {
|
|
@@ -6685,9 +6775,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6685
6775
|
}
|
|
6686
6776
|
expandCollapse(action, row, record, isChild) {
|
|
6687
6777
|
const expandingArgs = { row: row, data: record, childData: [], requestType: action };
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6778
|
+
let childRecords;
|
|
6779
|
+
if (!isNullOrUndefined(record)) {
|
|
6780
|
+
childRecords = this.grid.currentViewData.filter((e) => {
|
|
6781
|
+
return e.parentUniqueID === record.uniqueID;
|
|
6782
|
+
});
|
|
6783
|
+
}
|
|
6691
6784
|
let targetEle;
|
|
6692
6785
|
if ((!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) || (action === 'collapse' || (this.isExpandAll && this.loadChildOnDemand) && !isRemoteData(this) && this.isSelfReference && isCountRequired(this))) {
|
|
6693
6786
|
this.updateChildOnDemand(expandingArgs);
|
|
@@ -6716,7 +6809,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6716
6809
|
let displayAction;
|
|
6717
6810
|
if (action === 'expand') {
|
|
6718
6811
|
displayAction = 'table-row';
|
|
6719
|
-
if (!isChild) {
|
|
6812
|
+
if (!isChild && !isNullOrUndefined(record)) {
|
|
6720
6813
|
record.expanded = true;
|
|
6721
6814
|
this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
|
|
6722
6815
|
}
|
|
@@ -6737,7 +6830,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
6737
6830
|
}
|
|
6738
6831
|
else {
|
|
6739
6832
|
displayAction = 'none';
|
|
6740
|
-
if (!isChild || isCountRequired(this)) {
|
|
6833
|
+
if ((!isChild || isCountRequired(this)) && !isNullOrUndefined(row)) {
|
|
6741
6834
|
record.expanded = false;
|
|
6742
6835
|
this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
|
|
6743
6836
|
}
|
|
@@ -8759,7 +8852,7 @@ class RowDD {
|
|
|
8759
8852
|
this.canDrop = false;
|
|
8760
8853
|
this.addErrorElem();
|
|
8761
8854
|
}
|
|
8762
|
-
if (!tObj.rowDropSettings.targetID && this.canDrop) {
|
|
8855
|
+
if (!tObj.rowDropSettings.targetID && this.canDrop && !isNullOrUndefined(args.rows[0])) {
|
|
8763
8856
|
tObj.rowDragAndDropModule.updateIcon(args.rows, rowIdx, args);
|
|
8764
8857
|
}
|
|
8765
8858
|
if (isNullOrUndefined(tObj.rowDropSettings.targetID) && !this.canDrop) {
|
|
@@ -9003,7 +9096,7 @@ class RowDD {
|
|
|
9003
9096
|
for (let i = 0; i < dragLength; i++) {
|
|
9004
9097
|
draggedRecord = dragRecords[parseInt(i.toString(), 10)];
|
|
9005
9098
|
this.draggedRecord = draggedRecord;
|
|
9006
|
-
if (this.dropPosition !== 'Invalid') {
|
|
9099
|
+
if (this.dropPosition !== 'Invalid' && !isNullOrUndefined(this.droppedRecord)) {
|
|
9007
9100
|
if (!tObj.rowDropSettings.targetID || isByMethod) {
|
|
9008
9101
|
this.deleteDragRow();
|
|
9009
9102
|
}
|
|
@@ -9840,14 +9933,19 @@ class ExcelExport {
|
|
|
9840
9933
|
/* eslint-disable-next-line */
|
|
9841
9934
|
isMultipleExport, workbook, isBlob, isCsv) {
|
|
9842
9935
|
const dataSource = this.parent.dataSource;
|
|
9936
|
+
const data = new Data(this.parent.grid);
|
|
9843
9937
|
const property = Object();
|
|
9844
9938
|
setValue('isCsv', isCsv, property);
|
|
9845
9939
|
setValue('cancel', false, property);
|
|
9846
9940
|
if (!isNullOrUndefined(excelExportProperties)) {
|
|
9847
9941
|
this.isCollapsedStatePersist = excelExportProperties.isCollapsedStatePersist;
|
|
9848
9942
|
}
|
|
9849
|
-
if (!isNullOrUndefined(excelExportProperties)
|
|
9850
|
-
if (!excelExportProperties.dataSource['dataSource']) {
|
|
9943
|
+
if (!isNullOrUndefined(excelExportProperties)) {
|
|
9944
|
+
if (!isNullOrUndefined(excelExportProperties.dataSource) && !excelExportProperties.dataSource['dataSource']) {
|
|
9945
|
+
return this.parent.grid.excelExportModule.Map(this.parent.grid, excelExportProperties, isMultipleExport, workbook, isCsv, isBlob);
|
|
9946
|
+
}
|
|
9947
|
+
if (excelExportProperties.exportType === 'CurrentPage') {
|
|
9948
|
+
excelExportProperties.dataSource = this.parent.getCurrentViewRecords();
|
|
9851
9949
|
return this.parent.grid.excelExportModule.Map(this.parent.grid, excelExportProperties, isMultipleExport, workbook, isCsv, isBlob);
|
|
9852
9950
|
}
|
|
9853
9951
|
}
|
|
@@ -9858,6 +9956,11 @@ class ExcelExport {
|
|
|
9858
9956
|
if (!this.isLocal()) {
|
|
9859
9957
|
query = this.generateQuery(query);
|
|
9860
9958
|
query.queries = this.parent.grid.getDataModule().generateQuery().queries;
|
|
9959
|
+
query = ExportHelper.getQuery(this.parent.grid, data);
|
|
9960
|
+
if (isNullOrUndefined(this.parent.filterModule)) {
|
|
9961
|
+
query.queries = query.queries.slice(1, 2);
|
|
9962
|
+
query.params = query.params.slice(0, 0);
|
|
9963
|
+
}
|
|
9861
9964
|
setValue('query', query, property);
|
|
9862
9965
|
}
|
|
9863
9966
|
this.parent.trigger(beforeExcelExport, extend$1(property, excelExportProperties));
|
|
@@ -12421,6 +12524,7 @@ class Edit {
|
|
|
12421
12524
|
this.addRowIndex = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;
|
|
12422
12525
|
}
|
|
12423
12526
|
}
|
|
12527
|
+
const selectedRecords = this.parent.getSelectedRecords()[0];
|
|
12424
12528
|
if ((this.isAddedRowByMethod || (this.isAddedRowByContextMenu && this.parent.grid.selectedRowIndex !== -1)) &&
|
|
12425
12529
|
(this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
|
|
12426
12530
|
this.addRowRecord = this.parent.flatData[this.parent.grid.selectedRowIndex];
|
|
@@ -12428,8 +12532,8 @@ class Edit {
|
|
|
12428
12532
|
this.addRowRecord = this.parent.getCurrentViewRecords()[this.addRowIndex];
|
|
12429
12533
|
}
|
|
12430
12534
|
}
|
|
12431
|
-
else {
|
|
12432
|
-
this.addRowRecord =
|
|
12535
|
+
else if (!isNullOrUndefined(selectedRecords)) {
|
|
12536
|
+
this.addRowRecord = selectedRecords;
|
|
12433
12537
|
}
|
|
12434
12538
|
}
|
|
12435
12539
|
if (this.isAddedRowByMethod && args.index !== 0) {
|
|
@@ -13021,6 +13125,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13021
13125
|
rowSelectedEvent(args) {
|
|
13022
13126
|
const rowSelected = 'rowSelected';
|
|
13023
13127
|
super[`${rowSelected}`](args);
|
|
13128
|
+
this.parent.notify('virtualTransform', { requestType: 'transformChange' });
|
|
13024
13129
|
}
|
|
13025
13130
|
toSelectVirtualRow(args) {
|
|
13026
13131
|
if (this.parent.isEdit) {
|
|
@@ -13187,21 +13292,25 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13187
13292
|
const info = scrollArgs.sentinel;
|
|
13188
13293
|
const rowHeight = this.parent.getRowHeight();
|
|
13189
13294
|
const outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
|
|
13190
|
-
|
|
13295
|
+
let content;
|
|
13296
|
+
if (!isNullOrUndefined(this.parent.contentModule)) {
|
|
13297
|
+
content = this.parent.getContent().querySelector('.e-content');
|
|
13298
|
+
}
|
|
13191
13299
|
const scrollHeight = outBuffer * rowHeight;
|
|
13192
|
-
const upScroll = (scrollArgs.offset.top - this.translateY)
|
|
13300
|
+
const upScroll = (scrollArgs.offset.top - this.translateY) <= 0;
|
|
13193
13301
|
const downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) + rowHeight >= scrollHeight;
|
|
13194
13302
|
const selectedRowIndex = 'selectedRowIndex';
|
|
13195
13303
|
const currentViewData = this.parent.currentViewData;
|
|
13196
13304
|
const indexValue = 'index';
|
|
13197
|
-
if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
|
|
13305
|
+
if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') && !isNullOrUndefined(content)) {
|
|
13198
13306
|
const vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? parseInt(this.parent.height.toString(), 10) :
|
|
13199
13307
|
this.parent.element.getBoundingClientRect().height);
|
|
13200
13308
|
let index = (~~(content.scrollTop / rowHeight)
|
|
13201
13309
|
+ Math.ceil(vHeight / rowHeight))
|
|
13202
13310
|
- this.parent.pageSettings.pageSize;
|
|
13203
13311
|
index = (index > 0) ? index : 0;
|
|
13204
|
-
if (!isNullOrUndefined(this[`${selectedRowIndex}`]) && this[`${selectedRowIndex}`] !== -1 && index !== this[`${selectedRowIndex}`]
|
|
13312
|
+
if (!isNullOrUndefined(this[`${selectedRowIndex}`]) && this[`${selectedRowIndex}`] !== -1 && index !== this[`${selectedRowIndex}`] &&
|
|
13313
|
+
((this.parent.rowHeight * this.parent.pageSettings.pageSize) < content.scrollTop)) {
|
|
13205
13314
|
index = this[`${selectedRowIndex}`];
|
|
13206
13315
|
}
|
|
13207
13316
|
this.startIndex = index;
|
|
@@ -13241,7 +13350,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13241
13350
|
scrollArgs.offset.top - (outBuffer * rowHeight) + 10 : 0;
|
|
13242
13351
|
}
|
|
13243
13352
|
}
|
|
13244
|
-
else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
|
|
13353
|
+
else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') && !isNullOrUndefined(content)) {
|
|
13245
13354
|
let nextSetResIndex = ~~(content.scrollTop / rowHeight);
|
|
13246
13355
|
const isLastBlock = (this[`${selectedRowIndex}`] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;
|
|
13247
13356
|
if (!isNullOrUndefined(this[`${selectedRowIndex}`]) && this[`${selectedRowIndex}`] !== -1 &&
|
|
@@ -13315,7 +13424,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
13315
13424
|
}
|
|
13316
13425
|
appendContent(target, newChild, e) {
|
|
13317
13426
|
if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
13318
|
-
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)
|
|
13427
|
+
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
|
|
13319
13428
|
if (getValue('isExpandCollapse', e)) {
|
|
13320
13429
|
this.isRemoteExpand = true;
|
|
13321
13430
|
}
|
|
@@ -13502,6 +13611,7 @@ class VirtualScroll {
|
|
|
13502
13611
|
constructor(parent) {
|
|
13503
13612
|
this.prevstartIndex = -1;
|
|
13504
13613
|
this.prevendIndex = -1;
|
|
13614
|
+
this.prevSelectedRecord = [];
|
|
13505
13615
|
this.parent = parent;
|
|
13506
13616
|
Grid.Inject(TreeVirtual);
|
|
13507
13617
|
this.addEventListener();
|
|
@@ -13557,6 +13667,10 @@ class VirtualScroll {
|
|
|
13557
13667
|
this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection) {
|
|
13558
13668
|
this.parent.grid.clearSelection();
|
|
13559
13669
|
}
|
|
13670
|
+
if (getValue('isCollapseAll', this.parent) && this.parent.selectionSettings.persistSelection && this.parent.getSelectedRecords().length > 0) {
|
|
13671
|
+
this.prevSelectedRecord = this.parent.getSelectedRecords();
|
|
13672
|
+
this.parent.grid.clearSelection();
|
|
13673
|
+
}
|
|
13560
13674
|
const requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
|
|
13561
13675
|
getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });
|
|
13562
13676
|
}
|
|
@@ -13586,7 +13700,7 @@ class VirtualScroll {
|
|
|
13586
13700
|
}
|
|
13587
13701
|
else {
|
|
13588
13702
|
const requestType = pageingDetails.actionArgs.requestType;
|
|
13589
|
-
if (requestType === 'filtering' || requestType === 'collapseAll' || requestType === 'searching' ||
|
|
13703
|
+
if (requestType === 'filtering' || requestType === 'collapseAll' || requestType === 'searching' || (requestType === 'refresh' && getValue('isExpandAll', this.parent)) ||
|
|
13590
13704
|
(requestType === 'refresh' && this.parent.enableCollapseAll && endIndex > visualData.length && isNullOrUndefined(this.expandCollapseRec))) {
|
|
13591
13705
|
startIndex = 0;
|
|
13592
13706
|
endIndex = this.parent.grid.pageSettings.pageSize - 1;
|
|
@@ -13627,6 +13741,12 @@ class VirtualScroll {
|
|
|
13627
13741
|
}
|
|
13628
13742
|
}
|
|
13629
13743
|
//}
|
|
13744
|
+
if (this.prevrequestType === 'collapseAll' && pageingDetails.actionArgs.requestType === 'virtualscroll'
|
|
13745
|
+
&& !isNullOrUndefined(this.parent.idMapping) && startIndex === 0) {
|
|
13746
|
+
startIndex = 0;
|
|
13747
|
+
endIndex = this.parent.grid.pageSettings.pageSize - 1;
|
|
13748
|
+
this.parent.grid.notify(virtualActionArgs, { setTop: true });
|
|
13749
|
+
}
|
|
13630
13750
|
if ((this.parent.enableCollapseAll || this.parent.expandStateMapping) && !isNullOrUndefined(this.expandCollapseRec)) {
|
|
13631
13751
|
if (pageingDetails.count < this.parent.getRows()[0].getBoundingClientRect().height) {
|
|
13632
13752
|
startIndex = 0;
|
|
@@ -13645,6 +13765,7 @@ class VirtualScroll {
|
|
|
13645
13765
|
}
|
|
13646
13766
|
this.prevstartIndex = startIndex;
|
|
13647
13767
|
this.prevendIndex = endIndex;
|
|
13768
|
+
this.prevrequestType = pageingDetails.actionArgs.requestType;
|
|
13648
13769
|
}
|
|
13649
13770
|
this.parent.notify('updateAction', pageingDetails);
|
|
13650
13771
|
}
|