@syncfusion/ej2-treegrid 20.1.47 → 20.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/ej2-treegrid.umd.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +4844 -4615
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +3453 -3227
- 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 +7 -7
- package/src/treegrid/actions/batch-edit.js +21 -4
- package/src/treegrid/actions/crud-actions.js +6 -1
- package/src/treegrid/actions/edit.js +16 -1
- package/src/treegrid/actions/filter.js +3 -0
- package/src/treegrid/actions/rowdragdrop.d.ts +13 -0
- package/src/treegrid/actions/rowdragdrop.js +131 -16
- package/src/treegrid/actions/selection.js +4 -2
- package/src/treegrid/actions/toolbar.d.ts +0 -1
- package/src/treegrid/actions/toolbar.js +50 -79
- package/src/treegrid/actions/virtual-scroll.js +1 -1
- package/src/treegrid/base/treegrid-model.d.ts +1 -1
- package/src/treegrid/base/treegrid.d.ts +22 -6
- package/src/treegrid/base/treegrid.js +101 -49
- package/src/treegrid/models/column.d.ts +9 -0
- package/src/treegrid/models/column.js +19 -0
- package/src/treegrid/models/rowdrop-settings.d.ts +9 -1
- package/src/treegrid/renderer/render.d.ts +6 -0
- package/src/treegrid/renderer/render.js +27 -1
- package/src/treegrid/renderer/virtual-tree-content-render.js +1 -1
- package/styles/bootstrap-dark.css +0 -8
- package/styles/bootstrap.css +0 -8
- package/styles/bootstrap4.css +0 -8
- package/styles/bootstrap5-dark.css +0 -8
- package/styles/bootstrap5.css +0 -8
- package/styles/fabric-dark.css +0 -8
- package/styles/fabric.css +0 -8
- package/styles/fluent-dark.css +1 -5
- package/styles/fluent.css +1 -5
- package/styles/highcontrast-light.css +0 -8
- package/styles/highcontrast.css +0 -8
- package/styles/material-dark.css +0 -8
- package/styles/material.css +0 -8
- package/styles/tailwind-dark.css +0 -8
- package/styles/tailwind.css +0 -8
- package/styles/treegrid/_bootstrap-dark-definition.scss +0 -2
- package/styles/treegrid/_bootstrap-definition.scss +0 -2
- package/styles/treegrid/_bootstrap4-definition.scss +0 -2
- package/styles/treegrid/_bootstrap5-definition.scss +0 -2
- package/styles/treegrid/_fabric-dark-definition.scss +0 -2
- package/styles/treegrid/_fabric-definition.scss +0 -2
- package/styles/treegrid/_fluent-definition.scss +0 -1
- package/styles/treegrid/_highcontrast-definition.scss +0 -2
- package/styles/treegrid/_highcontrast-light-definition.scss +0 -2
- package/styles/treegrid/_layout.scss +4 -6
- package/styles/treegrid/_material-dark-definition.scss +0 -2
- package/styles/treegrid/_material-definition.scss +0 -2
- package/styles/treegrid/_tailwind-definition.scss +0 -2
- package/styles/treegrid/bootstrap-dark.css +0 -8
- package/styles/treegrid/bootstrap.css +0 -8
- package/styles/treegrid/bootstrap4.css +0 -8
- package/styles/treegrid/bootstrap5-dark.css +0 -8
- package/styles/treegrid/bootstrap5.css +0 -8
- package/styles/treegrid/fabric-dark.css +0 -8
- package/styles/treegrid/fabric.css +0 -8
- package/styles/treegrid/fluent-dark.css +1 -5
- package/styles/treegrid/fluent.css +1 -5
- package/styles/treegrid/highcontrast-light.css +0 -8
- package/styles/treegrid/highcontrast.css +0 -8
- package/styles/treegrid/material-dark.css +0 -8
- package/styles/treegrid/material.css +0 -8
- package/styles/treegrid/tailwind-dark.css +0 -8
- package/styles/treegrid/tailwind.css +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, Ajax, ModuleDeclaration, extend} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue } from '@syncfusion/ej2-base';import {Event, Property, NotifyPropertyChanges, INotifyPropertyChanged, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { Column, ColumnModel } from '../models/column';import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs
|
|
1
|
+
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, Ajax, ModuleDeclaration, extend} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue } from '@syncfusion/ej2-base';import {Event, Property, NotifyPropertyChanges, INotifyPropertyChanged, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { Column, ColumnModel } from '../models/column';import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs } from '@syncfusion/ej2-grids';import { GridModel, ColumnQueryModeType, HeaderCellInfoEventArgs, EditSettingsModel as GridEditModel } from '@syncfusion/ej2-grids';import {RowDragEventArgs, RowDropEventArgs, RowDropSettingsModel, RowDropSettings, getUid } from '@syncfusion/ej2-grids';import { ActionEventArgs, TextAlign } from'@syncfusion/ej2-grids';import { DetailDataBoundEventArgs, ClipMode, ColumnChooser} from '@syncfusion/ej2-grids';import { SearchEventArgs, AddEventArgs, EditEventArgs, DeleteEventArgs} from '@syncfusion/ej2-grids';import { SaveEventArgs, CellSaveArgs, BatchAddArgs, BatchCancelArgs, BeginEditArgs, CellEditArgs} from '@syncfusion/ej2-grids';import { FilterSettings } from '../models/filter-settings';import { TextWrapSettings } from '../models/textwrap-settings';import { TextWrapSettingsModel } from '../models/textwrap-settings-model';import {Filter} from '../actions/filter';import { Logger as TreeLogger } from '../actions/logger';import { BeforeCopyEventArgs, BeforePasteEventArgs } from '@syncfusion/ej2-grids';import { TreeClipboard } from '../actions/clipboard';import {Aggregate} from '../actions/summary';import { Reorder } from '../actions/reorder';import { Resize } from '../actions/resize';import { Selection as TreeGridSelection } from '../actions/selection';import { ColumnMenu } from '../actions/column-menu';import { DetailRow } from '../actions/detail-row';import { Freeze } from '../actions/freeze-column';import { Print } from '../actions/print';import * as events from '../base/constant';import { FilterSettingsModel } from '../models/filter-settings-model';import { SearchSettings} from '../models/search-settings';import { SearchSettingsModel } from '../models/search-settings-model';import {RowInfo, RowDataBoundEventArgs, PageEventArgs, FilterEventArgs, FailureEventArgs, SortEventArgs } from '@syncfusion/ej2-grids';import { RowSelectingEventArgs, RowSelectEventArgs, RowDeselectEventArgs, IIndex, ISelectedCell } from '@syncfusion/ej2-grids';import {ColumnModel as GridColumnModel, Column as GridColumn, CellSelectEventArgs, CellDeselectEventArgs } from '@syncfusion/ej2-grids';import { SelectionSettings } from '../models/selection-settings';import { SelectionSettingsModel } from '../models/selection-settings-model';import {getActualProperties, SortDirection, getObject, ColumnDragEventArgs } from '@syncfusion/ej2-grids';import { PrintMode, Data, IGrid, ContextMenuItemModel } from '@syncfusion/ej2-grids';import { ColumnMenuItem, ColumnMenuItemModel, CheckBoxChangeEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportCompleteArgs, ExcelHeaderQueryCellInfoEventArgs, ExcelQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { PdfExportCompleteArgs, PdfHeaderQueryCellInfoEventArgs, PdfQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportProperties, PdfExportProperties, CellSelectingEventArgs, PrintEventArgs } from '@syncfusion/ej2-grids';import { ColumnMenuOpenEventArgs } from '@syncfusion/ej2-grids';import {BeforeDataBoundArgs} from '@syncfusion/ej2-grids';import { DataManager, ReturnOption, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred } from '@syncfusion/ej2-data';import { createSpinner, hideSpinner, showSpinner, Dialog } from '@syncfusion/ej2-popups';import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';import { Grid, QueryCellInfoEventArgs, Logger } from '@syncfusion/ej2-grids';import { Render } from '../renderer/render';import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';import { DataManipulation } from './data';import { RowDD } from '../actions/rowdragdrop';import { Sort } from '../actions/sort';import { ITreeData, RowExpandedEventArgs, RowCollapsedEventArgs, RowCollapsingEventArgs, TreeGridExcelExportProperties } from './interface';import { CellSaveEventArgs, DataStateChangeEventArgs, RowExpandingEventArgs, TreeGridPdfExportProperties } from './interface';import { iterateArrayOrObject, GridLine } from '@syncfusion/ej2-grids';import { DataSourceChangedEventArgs, RecordDoubleClickEventArgs, ResizeArgs } from '@syncfusion/ej2-grids';import { ToolbarItems, ToolbarItem, ContextMenuItem, ContextMenuItems, RowPosition, CopyHierarchyType } from '../enum';import { ItemModel, ClickEventArgs, BeforeOpenCloseMenuEventArgs, MenuEventArgs } from '@syncfusion/ej2-navigations';import { PageSettings } from '../models/page-settings';import { PageSettingsModel } from '../models/page-settings-model';import { AggregateRow } from '../models/summary';import { AggregateRowModel } from '../models/summary-model';import { ExcelExport } from '../actions/excel-export';import { PdfExport } from '../actions/pdf-export';import { Toolbar } from '../actions/toolbar';import { Page } from '../actions/page';import { ContextMenu } from '../actions/context-menu';import { EditSettings } from '../models/edit-settings';import { EditSettingsModel } from '../models/edit-settings-model';import { Edit} from '../actions/edit';import { SortSettings } from '../models/sort-settings';import { SortSettingsModel } from '../models/sort-settings-model';import { isHidden, getExpandStatus } from '../utils';import { editAction } from '../actions/crud-actions';import { InfiniteScrollSettings } from '../models/infinite-scroll-settings';import { InfiniteScrollSettingsModel } from '../models/infinite-scroll-settings-model';import { TreeActionEventArgs } from '..';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -82,11 +82,16 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
82
82
|
private addedRecords;
|
|
83
83
|
private targetElement;
|
|
84
84
|
private isGantt;
|
|
85
|
+
private isIndentEnabled;
|
|
86
|
+
private indentOutdentAction;
|
|
85
87
|
/**
|
|
86
88
|
* The `sortModule` is used to manipulate sorting in TreeGrid.
|
|
87
89
|
*/
|
|
88
90
|
sortModule: Sort;
|
|
89
91
|
private action;
|
|
92
|
+
private dropIndex;
|
|
93
|
+
private dropPosition;
|
|
94
|
+
private modifiedRecords;
|
|
90
95
|
private selectedRecords;
|
|
91
96
|
private selectedRows;
|
|
92
97
|
private loggerModule;
|
|
@@ -99,6 +104,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
99
104
|
private isEditCollapse;
|
|
100
105
|
private treeColumnTextAlign;
|
|
101
106
|
private treeColumnField;
|
|
107
|
+
private stackedHeader;
|
|
102
108
|
/** @hidden */
|
|
103
109
|
initialRender: boolean;
|
|
104
110
|
/** @hidden */
|
|
@@ -1211,6 +1217,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1211
1217
|
* @returns {void}
|
|
1212
1218
|
*/
|
|
1213
1219
|
protected render(): void;
|
|
1220
|
+
private refreshToolbarItems;
|
|
1214
1221
|
private afterGridRender;
|
|
1215
1222
|
private convertTreeData;
|
|
1216
1223
|
private bindGridProperties;
|
|
@@ -1534,12 +1541,6 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1534
1541
|
*/
|
|
1535
1542
|
getColumns(isRefresh?: boolean): Column[];
|
|
1536
1543
|
private updateColumnModel;
|
|
1537
|
-
/**
|
|
1538
|
-
* @param {string} columnUid - Defines column uid
|
|
1539
|
-
* @returns {void}
|
|
1540
|
-
* @hidden
|
|
1541
|
-
*/
|
|
1542
|
-
private refreshReactColumnTemplateByUid;
|
|
1543
1544
|
/**
|
|
1544
1545
|
* Gets the content div of the TreeGrid.
|
|
1545
1546
|
*
|
|
@@ -1701,6 +1702,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1701
1702
|
* @returns {void}
|
|
1702
1703
|
*/
|
|
1703
1704
|
collapseRow(row: HTMLTableRowElement, record?: Object, key?: Object): void;
|
|
1705
|
+
private updateExpandStateMapping;
|
|
1704
1706
|
/**
|
|
1705
1707
|
* Expands the records at specific hierarchical level
|
|
1706
1708
|
*
|
|
@@ -2020,6 +2022,20 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
2020
2022
|
* @returns {void}
|
|
2021
2023
|
*/
|
|
2022
2024
|
reorderRows(fromIndexes: number[], toIndex: number, position: string): void;
|
|
2025
|
+
/**
|
|
2026
|
+
* Indents the record to one level of hierarchy. Moves the selected row as the last child of its previous row.
|
|
2027
|
+
*
|
|
2028
|
+
* @param {Object} record – specifies the record to do indented
|
|
2029
|
+
* @returns {void}
|
|
2030
|
+
*/
|
|
2031
|
+
indent(record?: Object): void;
|
|
2032
|
+
/**
|
|
2033
|
+
* Outdent the record to one level of hierarchy. Moves the selected row as sibling to its parent row.
|
|
2034
|
+
*
|
|
2035
|
+
* @param {Object} record – specifies the record to do outdented
|
|
2036
|
+
* @returns {void}
|
|
2037
|
+
*/
|
|
2038
|
+
outdent(record?: Object): void;
|
|
2023
2039
|
/**
|
|
2024
2040
|
* `columnchooserModule` is used to dynamically show or hide the TreeGrid columns.
|
|
2025
2041
|
*
|
|
@@ -21,7 +21,6 @@ import { Component, addClass, createElement, EventHandler, isNullOrUndefined, ex
|
|
|
21
21
|
import { removeClass, Complex, Collection, getValue } from '@syncfusion/ej2-base';
|
|
22
22
|
import { Event, Property, NotifyPropertyChanges, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';
|
|
23
23
|
import { Column } from '../models/column';
|
|
24
|
-
import { CellRenderer } from '@syncfusion/ej2-grids';
|
|
25
24
|
import { RowDropSettings, getUid } from '@syncfusion/ej2-grids';
|
|
26
25
|
import { FilterSettings } from '../models/filter-settings';
|
|
27
26
|
import { TextWrapSettings } from '../models/textwrap-settings';
|
|
@@ -39,7 +38,6 @@ import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenReco
|
|
|
39
38
|
import { Grid, Logger } from '@syncfusion/ej2-grids';
|
|
40
39
|
import { Render } from '../renderer/render';
|
|
41
40
|
import { DataManipulation } from './data';
|
|
42
|
-
import { RowDD } from '../actions/rowdragdrop';
|
|
43
41
|
import { iterateArrayOrObject } from '@syncfusion/ej2-grids';
|
|
44
42
|
import { ToolbarItem, ContextMenuItems } from '../enum';
|
|
45
43
|
import { PageSettings } from '../models/page-settings';
|
|
@@ -69,6 +67,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
69
67
|
_this.changedRecords = 'changedRecords';
|
|
70
68
|
_this.deletedRecords = 'deletedRecords';
|
|
71
69
|
_this.addedRecords = 'addedRecords';
|
|
70
|
+
_this.indentOutdentAction = 'indentOutdentAction';
|
|
71
|
+
_this.modifiedRecords = [];
|
|
72
|
+
_this.stackedHeader = false;
|
|
72
73
|
_this.objectEqualityChecker = function (old, current) {
|
|
73
74
|
if (old) {
|
|
74
75
|
var keys = Object.keys(old);
|
|
@@ -477,14 +478,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
477
478
|
return modules;
|
|
478
479
|
};
|
|
479
480
|
TreeGrid.prototype.extendRequiredModules = function (modules) {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
481
|
+
var IsRowDDInjected = this.injectedModules.filter(function (e) {
|
|
482
|
+
return e.name === 'RowDD';
|
|
483
|
+
});
|
|
484
|
+
if (this.allowRowDragAndDrop || IsRowDDInjected.length) {
|
|
485
|
+
if ((!isNullOrUndefined(this.toolbar) && (this.toolbar['includes']('Indent') ||
|
|
486
|
+
this.toolbar['includes']('Outdent')))) {
|
|
487
|
+
this.isIndentEnabled = true;
|
|
488
|
+
}
|
|
488
489
|
modules.push({
|
|
489
490
|
member: 'rowDragAndDrop',
|
|
490
491
|
args: [this]
|
|
@@ -613,6 +614,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
613
614
|
var root = 'root';
|
|
614
615
|
this.grid[root] = this[root] ? this[root] : this;
|
|
615
616
|
this.grid.appendTo(gridContainer);
|
|
617
|
+
if (this.isIndentEnabled) {
|
|
618
|
+
this.refreshToolbarItems();
|
|
619
|
+
}
|
|
616
620
|
this.wireEvents();
|
|
617
621
|
this.renderComplete();
|
|
618
622
|
var destroyTemplate = 'destroyTemplate';
|
|
@@ -626,6 +630,15 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
626
630
|
}
|
|
627
631
|
};
|
|
628
632
|
};
|
|
633
|
+
TreeGrid.prototype.refreshToolbarItems = function () {
|
|
634
|
+
var toolbarElement = this.toolbarModule.getToolbar();
|
|
635
|
+
var indentID = this.element.id + '_gridcontrol_indent';
|
|
636
|
+
var outdentID = this.element.id + '_gridcontrol_outdent';
|
|
637
|
+
var indentElement = toolbarElement.querySelector('#' + indentID).parentElement;
|
|
638
|
+
var outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;
|
|
639
|
+
indentElement.classList.add('e-hidden');
|
|
640
|
+
outdentElement.classList.add('e-hidden');
|
|
641
|
+
};
|
|
629
642
|
TreeGrid.prototype.afterGridRender = function () {
|
|
630
643
|
if (!isNullOrUndefined(this.grid.clipboardModule)) {
|
|
631
644
|
this.grid.clipboardModule.destroy();
|
|
@@ -1105,14 +1118,24 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1105
1118
|
}
|
|
1106
1119
|
if (_this.action === 'indenting' || _this.action === 'outdenting') {
|
|
1107
1120
|
_this.action = _this.action === 'indenting' ? 'indented' : 'outdented';
|
|
1121
|
+
var selectedItem_1 = [_this.selectedRecords];
|
|
1108
1122
|
var actionArgs = {
|
|
1123
|
+
data: selectedItem_1,
|
|
1124
|
+
dropIndex: _this.dropIndex,
|
|
1125
|
+
dropPosition: _this.dropPosition,
|
|
1126
|
+
modifiedRecords: _this.modifiedRecords,
|
|
1109
1127
|
requestType: _this.action,
|
|
1110
|
-
data: _this.selectedRecords,
|
|
1111
1128
|
row: _this.selectedRows
|
|
1112
1129
|
};
|
|
1113
1130
|
_this.trigger(events.actionComplete, actionArgs);
|
|
1131
|
+
var currentPageItem = _this.getCurrentViewRecords().filter(function (e) {
|
|
1132
|
+
return e.uniqueID === selectedItem_1[0].uniqueID;
|
|
1133
|
+
});
|
|
1134
|
+
if (!currentPageItem.length) {
|
|
1135
|
+
_this.refreshToolbarItems();
|
|
1136
|
+
}
|
|
1114
1137
|
_this.action = '';
|
|
1115
|
-
_this.selectedRecords = _this.selectedRows = [];
|
|
1138
|
+
_this.selectedRecords = _this.selectedRows = _this.modifiedRecords = [];
|
|
1116
1139
|
}
|
|
1117
1140
|
else {
|
|
1118
1141
|
_this.trigger(events.actionComplete, args);
|
|
@@ -1316,7 +1339,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1316
1339
|
case ToolbarItem.RowIndent:
|
|
1317
1340
|
tooltipText = this.l10n.getConstant('RowIndent');
|
|
1318
1341
|
items.push({
|
|
1319
|
-
text: tooltipText, tooltipText: tooltipText,
|
|
1342
|
+
text: tooltipText, tooltipText: tooltipText,
|
|
1320
1343
|
prefixIcon: 'e-indent', id: this.element.id + '_gridcontrol_indent'
|
|
1321
1344
|
});
|
|
1322
1345
|
break;
|
|
@@ -1324,7 +1347,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1324
1347
|
case ToolbarItem.RowOutdent:
|
|
1325
1348
|
tooltipText = this.l10n.getConstant('RowOutdent');
|
|
1326
1349
|
items.push({
|
|
1327
|
-
text: tooltipText, tooltipText: tooltipText,
|
|
1350
|
+
text: tooltipText, tooltipText: tooltipText,
|
|
1328
1351
|
prefixIcon: 'e-outdent', id: this.element.id + '_gridcontrol_outdent'
|
|
1329
1352
|
});
|
|
1330
1353
|
break;
|
|
@@ -1943,10 +1966,13 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1943
1966
|
rowData.parentUniqueID = record.parentUniqueID;
|
|
1944
1967
|
rowData.expanded = record.expanded;
|
|
1945
1968
|
this.grid.setRowData(key, rowData);
|
|
1946
|
-
var
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1969
|
+
var visibleRecords = this.getVisibleRecords();
|
|
1970
|
+
if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])[primaryKey]) {
|
|
1971
|
+
var table = this.getContentTable();
|
|
1972
|
+
var sHeight = table.scrollHeight;
|
|
1973
|
+
var clientHeight = this.getContent().clientHeight;
|
|
1974
|
+
this.lastRowBorder(this.getRows()[currentRecords.indexOf(record)], sHeight <= clientHeight);
|
|
1975
|
+
}
|
|
1950
1976
|
};
|
|
1951
1977
|
/**
|
|
1952
1978
|
* Navigates to the specified target page.
|
|
@@ -2002,6 +2028,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2002
2028
|
*/
|
|
2003
2029
|
TreeGrid.prototype.getColumnByUid = function (uid) {
|
|
2004
2030
|
var Columns = this.initialRender ? this.grid.columns : this.columns;
|
|
2031
|
+
var columnModel = 'columnModel';
|
|
2032
|
+
if (this.grid.columns.length !== this.columnModel.length) {
|
|
2033
|
+
Columns = this.grid[columnModel];
|
|
2034
|
+
}
|
|
2005
2035
|
return iterateArrayOrObject(Columns, function (item) {
|
|
2006
2036
|
if (item.uid === uid) {
|
|
2007
2037
|
return item;
|
|
@@ -2129,7 +2159,6 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2129
2159
|
temp = this.columnModel[this.treeColumnIndex].template;
|
|
2130
2160
|
field = this.columnModel[this.treeColumnIndex].field;
|
|
2131
2161
|
}
|
|
2132
|
-
var stackedHeader = false;
|
|
2133
2162
|
var gridColumn;
|
|
2134
2163
|
if (!this.enableColumnVirtualization || (this.enableColumnVirtualization && this.columnModel.length === gridColumns.length)) {
|
|
2135
2164
|
this.columnModel = [];
|
|
@@ -2148,40 +2177,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2148
2177
|
var merge = 'deepMerge';
|
|
2149
2178
|
this[merge] = ['columns']; // Workaround for blazor updateModel
|
|
2150
2179
|
if (this.grid.columns.length !== this.columnModel.length) {
|
|
2151
|
-
stackedHeader = true;
|
|
2180
|
+
this.stackedHeader = true;
|
|
2152
2181
|
}
|
|
2153
|
-
if (!stackedHeader) {
|
|
2182
|
+
if (!this.stackedHeader) {
|
|
2154
2183
|
this.setProperties({ columns: this.columnModel }, true);
|
|
2155
2184
|
}
|
|
2156
2185
|
this[merge] = undefined; // Workaround for blazor updateModel
|
|
2157
2186
|
return this.columnModel;
|
|
2158
2187
|
};
|
|
2159
|
-
/**
|
|
2160
|
-
* @param {string} columnUid - Defines column uid
|
|
2161
|
-
* @returns {void}
|
|
2162
|
-
* @hidden
|
|
2163
|
-
*/
|
|
2164
|
-
TreeGrid.prototype.refreshReactColumnTemplateByUid = function (columnUid) {
|
|
2165
|
-
var _this = this;
|
|
2166
|
-
if (this.isReact) {
|
|
2167
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2168
|
-
this.clearTemplate(['columnTemplate'], undefined, function () {
|
|
2169
|
-
var cells = 'cells';
|
|
2170
|
-
var rowIdx = 'index';
|
|
2171
|
-
var rowsObj = _this.grid.getRowsObject();
|
|
2172
|
-
var indent = _this.grid.getIndentCount();
|
|
2173
|
-
var cellIndex = _this.grid.getNormalizedColumnIndex(columnUid);
|
|
2174
|
-
for (var j = 0; j < rowsObj.length; j++) {
|
|
2175
|
-
if (rowsObj[j].isDataRow && !isNullOrUndefined(rowsObj[j].index)) {
|
|
2176
|
-
var cell = rowsObj[j][cells][cellIndex];
|
|
2177
|
-
var cellRenderer = new CellRenderer(_this.grid, _this.grid.serviceLocator);
|
|
2178
|
-
var td = _this.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
|
|
2179
|
-
cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
});
|
|
2183
|
-
}
|
|
2184
|
-
};
|
|
2185
2188
|
/**
|
|
2186
2189
|
* Gets the content div of the TreeGrid.
|
|
2187
2190
|
*
|
|
@@ -2327,8 +2330,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2327
2330
|
this.uniqueIDCollection = {};
|
|
2328
2331
|
this.convertTreeData(this.dataSource);
|
|
2329
2332
|
if (!isCountRequired(this)) {
|
|
2330
|
-
|
|
2331
|
-
|
|
2333
|
+
if (!(this.dataSource instanceof DataManager)) {
|
|
2334
|
+
this.grid.dataSource = this.flatData;
|
|
2335
|
+
}
|
|
2336
|
+
else {
|
|
2337
|
+
this.grid.setProperties({
|
|
2338
|
+
dataSource: new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor)
|
|
2339
|
+
}, true);
|
|
2340
|
+
}
|
|
2332
2341
|
}
|
|
2333
2342
|
this.grid.refresh();
|
|
2334
2343
|
};
|
|
@@ -2472,6 +2481,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2472
2481
|
if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record[children]))) {
|
|
2473
2482
|
var collapseArgs = { data: record, row: row };
|
|
2474
2483
|
_this.setHeightForFrozenContent();
|
|
2484
|
+
if (!isNullOrUndefined(_this.expandStateMapping)) {
|
|
2485
|
+
_this.updateExpandStateMapping(collapseArgs.data, true);
|
|
2486
|
+
}
|
|
2475
2487
|
_this.trigger(events.expanded, collapseArgs);
|
|
2476
2488
|
}
|
|
2477
2489
|
}
|
|
@@ -2534,6 +2546,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2534
2546
|
var collapseArgs = { data: record, row: row };
|
|
2535
2547
|
if (!isRemoteData(_this)) {
|
|
2536
2548
|
_this.setHeightForFrozenContent();
|
|
2549
|
+
if (!isNullOrUndefined(_this.expandStateMapping)) {
|
|
2550
|
+
_this.updateExpandStateMapping(collapseArgs.data, false);
|
|
2551
|
+
}
|
|
2537
2552
|
_this.trigger(events.collapsed, collapseArgs);
|
|
2538
2553
|
if (_this.enableInfiniteScrolling) {
|
|
2539
2554
|
var scrollHeight = _this.grid.getContent().firstElementChild.scrollHeight;
|
|
@@ -2546,6 +2561,19 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2546
2561
|
}
|
|
2547
2562
|
});
|
|
2548
2563
|
};
|
|
2564
|
+
TreeGrid.prototype.updateExpandStateMapping = function (record, state) {
|
|
2565
|
+
var totalRecords = record;
|
|
2566
|
+
if (totalRecords.length) {
|
|
2567
|
+
for (var i = 0; i < totalRecords.length; i++) {
|
|
2568
|
+
totalRecords[i][this.expandStateMapping] = state;
|
|
2569
|
+
editAction({ value: totalRecords[i], action: 'edit' }, this, this.isSelfReference, totalRecords[i].index, this.grid.selectedRowIndex, this.expandStateMapping);
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
else {
|
|
2573
|
+
record[this.expandStateMapping] = state;
|
|
2574
|
+
editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, this.expandStateMapping);
|
|
2575
|
+
}
|
|
2576
|
+
};
|
|
2549
2577
|
/**
|
|
2550
2578
|
* Expands the records at specific hierarchical level
|
|
2551
2579
|
*
|
|
@@ -3462,6 +3490,30 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3462
3490
|
TreeGrid.prototype.reorderRows = function (fromIndexes, toIndex, position) {
|
|
3463
3491
|
this.rowDragAndDropModule.reorderRows(fromIndexes, toIndex, position);
|
|
3464
3492
|
};
|
|
3493
|
+
/**
|
|
3494
|
+
* Indents the record to one level of hierarchy. Moves the selected row as the last child of its previous row.
|
|
3495
|
+
*
|
|
3496
|
+
* @param {Object} record – specifies the record to do indented
|
|
3497
|
+
* @returns {void}
|
|
3498
|
+
*/
|
|
3499
|
+
TreeGrid.prototype.indent = function (record) {
|
|
3500
|
+
if (!isNullOrUndefined(this.rowDragAndDropModule)) {
|
|
3501
|
+
record = record;
|
|
3502
|
+
this.rowDragAndDropModule[this.indentOutdentAction](record, 'indent');
|
|
3503
|
+
}
|
|
3504
|
+
};
|
|
3505
|
+
/**
|
|
3506
|
+
* Outdent the record to one level of hierarchy. Moves the selected row as sibling to its parent row.
|
|
3507
|
+
*
|
|
3508
|
+
* @param {Object} record – specifies the record to do outdented
|
|
3509
|
+
* @returns {void}
|
|
3510
|
+
*/
|
|
3511
|
+
TreeGrid.prototype.outdent = function (record) {
|
|
3512
|
+
if (!isNullOrUndefined(this.rowDragAndDropModule)) {
|
|
3513
|
+
record = record;
|
|
3514
|
+
this.rowDragAndDropModule[this.indentOutdentAction](record, 'outdent');
|
|
3515
|
+
}
|
|
3516
|
+
};
|
|
3465
3517
|
var TreeGrid_1;
|
|
3466
3518
|
__decorate([
|
|
3467
3519
|
Property(0)
|
|
@@ -326,7 +326,16 @@ export declare class Column {
|
|
|
326
326
|
* @default null
|
|
327
327
|
*/
|
|
328
328
|
freeze: freezeDirection;
|
|
329
|
+
private parent;
|
|
329
330
|
constructor(options: ColumnModel);
|
|
331
|
+
/**
|
|
332
|
+
* Update the State changes reflected for TreeGrid columndirective in react platform.
|
|
333
|
+
*
|
|
334
|
+
* @param {Column} column - specifies the column
|
|
335
|
+
* @returns {void}
|
|
336
|
+
* @hidden
|
|
337
|
+
*/
|
|
338
|
+
private setProperties;
|
|
330
339
|
}
|
|
331
340
|
/**
|
|
332
341
|
* Interface for a TreeGrid class Column
|
|
@@ -71,6 +71,25 @@ var Column = /** @class */ (function () {
|
|
|
71
71
|
this.filter = {};
|
|
72
72
|
merge(this, options);
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Update the State changes reflected for TreeGrid columndirective in react platform.
|
|
76
|
+
*
|
|
77
|
+
* @param {Column} column - specifies the column
|
|
78
|
+
* @returns {void}
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
81
|
+
Column.prototype.setProperties = function (column) {
|
|
82
|
+
//Angular two way binding
|
|
83
|
+
var keys = Object.keys(column);
|
|
84
|
+
for (var i = 0; i < keys.length; i++) {
|
|
85
|
+
this[keys[i]] = column[keys[i]];
|
|
86
|
+
//Refresh the react columnTemplates on state change
|
|
87
|
+
if (this.parent && this.parent['isReact'] && keys[i] === 'template') {
|
|
88
|
+
var refreshReactColumnTemplateByUid = 'refreshReactColumnTemplateByUid';
|
|
89
|
+
this.parent.clipboardModule['treeGridParent'].renderModule[refreshReactColumnTemplateByUid](this.uid);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
74
93
|
return Column;
|
|
75
94
|
}());
|
|
76
95
|
export { Column };
|
|
@@ -13,7 +13,15 @@ export declare class RowDropSettings extends ChildProperty<RowDropSettings> {
|
|
|
13
13
|
}
|
|
14
14
|
export interface TreeActionEventArgs {
|
|
15
15
|
requestType?: string;
|
|
16
|
-
data?: ITreeData[];
|
|
16
|
+
data?: ITreeData | ITreeData[];
|
|
17
17
|
row?: Object[];
|
|
18
18
|
cancel?: boolean;
|
|
19
|
+
/** Defines the corresponding action */
|
|
20
|
+
action?: string;
|
|
21
|
+
/** Defines the target element from index. */
|
|
22
|
+
dropIndex?: number;
|
|
23
|
+
/** Defines drop position of the dragged record */
|
|
24
|
+
dropPosition?: string;
|
|
25
|
+
/** Defines the modified records. */
|
|
26
|
+
modifiedRecords?: ITreeData[];
|
|
19
27
|
}
|
|
@@ -29,6 +29,12 @@ export declare class Render {
|
|
|
29
29
|
*/
|
|
30
30
|
cellRender(args: QueryCellInfoEventArgs): void;
|
|
31
31
|
private updateTreeCell;
|
|
32
|
+
/**
|
|
33
|
+
* @param {string} columnUid - Defines column uid
|
|
34
|
+
* @returns {void}
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
private refreshReactColumnTemplateByUid;
|
|
32
38
|
private columnTemplateResult;
|
|
33
39
|
private reactTemplateRender;
|
|
34
40
|
destroy(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getObject, appendChildren } from '@syncfusion/ej2-grids';
|
|
2
|
-
import { templateCompiler, extend } from '@syncfusion/ej2-grids';
|
|
2
|
+
import { templateCompiler, extend, CellRenderer } from '@syncfusion/ej2-grids';
|
|
3
3
|
import { addClass, createElement, isNullOrUndefined, getValue } from '@syncfusion/ej2-base';
|
|
4
4
|
import * as events from '../base/constant';
|
|
5
5
|
import { isRemoteData, isOffline, getExpandStatus, isFilterChildHierarchy } from '../utils';
|
|
@@ -275,6 +275,32 @@ var Render = /** @class */ (function () {
|
|
|
275
275
|
args.cell.innerHTML = '';
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
|
+
/**
|
|
279
|
+
* @param {string} columnUid - Defines column uid
|
|
280
|
+
* @returns {void}
|
|
281
|
+
* @hidden
|
|
282
|
+
*/
|
|
283
|
+
Render.prototype.refreshReactColumnTemplateByUid = function (columnUid) {
|
|
284
|
+
var _this = this;
|
|
285
|
+
if (this.parent.isReact) {
|
|
286
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
287
|
+
this.parent.clearTemplate(['columnTemplate'], undefined, function () {
|
|
288
|
+
var cells = 'cells';
|
|
289
|
+
var rowIdx = 'index';
|
|
290
|
+
var rowsObj = _this.parent.grid.getRowsObject();
|
|
291
|
+
var indent = _this.parent.grid.getIndentCount();
|
|
292
|
+
var cellIndex = _this.parent.grid.getNormalizedColumnIndex(columnUid);
|
|
293
|
+
for (var j = 0; j < rowsObj.length; j++) {
|
|
294
|
+
if (rowsObj[j].isDataRow && !isNullOrUndefined(rowsObj[j].index)) {
|
|
295
|
+
var cell = rowsObj[j][cells][cellIndex];
|
|
296
|
+
var cellRenderer = new CellRenderer(_this.parent.grid, _this.parent.grid.serviceLocator);
|
|
297
|
+
var td = _this.parent.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
|
|
298
|
+
cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
};
|
|
278
304
|
Render.prototype.columnTemplateResult = function (args) {
|
|
279
305
|
this.templateResult = args.template;
|
|
280
306
|
};
|
|
@@ -126,7 +126,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
126
126
|
getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || this.isDataSourceChanged) {
|
|
129
|
+
if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || (this.isDataSourceChanged && this.startIndex === -1)) {
|
|
130
130
|
this.contents.scrollTop = 0;
|
|
131
131
|
this.isDataSourceChanged = false;
|
|
132
132
|
}
|
|
@@ -159,10 +159,6 @@
|
|
|
159
159
|
width: 18px;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
.e-bigger .e-treegrid .e-rowcell.e-treerowcell {
|
|
163
|
-
padding-left: 5px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
162
|
.e-bigger .e-treegrid .e-hierarchycheckbox {
|
|
167
163
|
padding-left: 2px;
|
|
168
164
|
}
|
|
@@ -216,10 +212,6 @@
|
|
|
216
212
|
color: #f0f0f0;
|
|
217
213
|
}
|
|
218
214
|
|
|
219
|
-
.e-treegrid .e-rowcell.e-treerowcell {
|
|
220
|
-
padding-left: 5px;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
215
|
.e-treegrid .e-rtl .e-treegridcollapse {
|
|
224
216
|
transform: scale(-1);
|
|
225
217
|
}
|
package/styles/bootstrap.css
CHANGED
|
@@ -160,10 +160,6 @@
|
|
|
160
160
|
width: 18px;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.e-bigger .e-treegrid .e-rowcell.e-treerowcell {
|
|
164
|
-
padding-left: 5px;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
163
|
.e-bigger .e-treegrid .e-hierarchycheckbox {
|
|
168
164
|
padding-left: 2px;
|
|
169
165
|
}
|
|
@@ -217,10 +213,6 @@
|
|
|
217
213
|
color: #333;
|
|
218
214
|
}
|
|
219
215
|
|
|
220
|
-
.e-treegrid .e-rowcell.e-treerowcell {
|
|
221
|
-
padding-left: 5px;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
216
|
.e-treegrid .e-rtl .e-treegridcollapse {
|
|
225
217
|
transform: scale(-1);
|
|
226
218
|
}
|
package/styles/bootstrap4.css
CHANGED
|
@@ -200,10 +200,6 @@
|
|
|
200
200
|
width: 16px;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
.e-bigger .e-treegrid .e-rowcell.e-treerowcell {
|
|
204
|
-
padding-left: 12px;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
203
|
.e-bigger .e-treegrid .e-hierarchycheckbox {
|
|
208
204
|
padding-left: 2px;
|
|
209
205
|
}
|
|
@@ -254,10 +250,6 @@
|
|
|
254
250
|
color: #343a40;
|
|
255
251
|
}
|
|
256
252
|
|
|
257
|
-
.e-treegrid .e-rowcell.e-treerowcell {
|
|
258
|
-
padding-left: 9px;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
253
|
.e-treegrid .e-rtl .e-treegridcollapse {
|
|
262
254
|
transform: scale(-1);
|
|
263
255
|
}
|
|
@@ -200,10 +200,6 @@
|
|
|
200
200
|
width: 22px;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
.e-bigger .e-treegrid .e-rowcell.e-treerowcell {
|
|
204
|
-
padding-left: 7px;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
203
|
.e-bigger .e-treegrid .e-hierarchycheckbox {
|
|
208
204
|
padding-left: 2px;
|
|
209
205
|
}
|
|
@@ -254,10 +250,6 @@
|
|
|
254
250
|
color: #dee2e6;
|
|
255
251
|
}
|
|
256
252
|
|
|
257
|
-
.e-treegrid .e-rowcell.e-treerowcell {
|
|
258
|
-
padding-left: 12px;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
253
|
.e-treegrid .e-rtl .e-treegridcollapse {
|
|
262
254
|
transform: scale(-1);
|
|
263
255
|
}
|
package/styles/bootstrap5.css
CHANGED
|
@@ -200,10 +200,6 @@
|
|
|
200
200
|
width: 22px;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
.e-bigger .e-treegrid .e-rowcell.e-treerowcell {
|
|
204
|
-
padding-left: 7px;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
203
|
.e-bigger .e-treegrid .e-hierarchycheckbox {
|
|
208
204
|
padding-left: 2px;
|
|
209
205
|
}
|
|
@@ -254,10 +250,6 @@
|
|
|
254
250
|
color: #343a40;
|
|
255
251
|
}
|
|
256
252
|
|
|
257
|
-
.e-treegrid .e-rowcell.e-treerowcell {
|
|
258
|
-
padding-left: 12px;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
253
|
.e-treegrid .e-rtl .e-treegridcollapse {
|
|
262
254
|
transform: scale(-1);
|
|
263
255
|
}
|
package/styles/fabric-dark.css
CHANGED
|
@@ -133,10 +133,6 @@
|
|
|
133
133
|
width: 18px;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.e-bigger .e-treegrid .e-rowcell.e-treerowcell {
|
|
137
|
-
padding-left: 9px;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
136
|
.e-bigger .e-treegrid .e-hierarchycheckbox {
|
|
141
137
|
padding-left: 2px;
|
|
142
138
|
}
|
|
@@ -190,10 +186,6 @@
|
|
|
190
186
|
color: #dadada;
|
|
191
187
|
}
|
|
192
188
|
|
|
193
|
-
.e-treegrid .e-rowcell.e-treerowcell {
|
|
194
|
-
padding-left: 5px;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
189
|
.e-treegrid .e-rtl .e-treegridcollapse {
|
|
198
190
|
transform: scale(-1);
|
|
199
191
|
}
|