@syncfusion/ej2-treegrid 20.1.55 → 20.1.60

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.1.55
3
+ * version : 20.1.60
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-treegrid@*",
3
- "_id": "@syncfusion/ej2-treegrid@20.1.52",
3
+ "_id": "@syncfusion/ej2-treegrid@20.1.59",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-YN6uR63NYY2AMQf0v1YosSbea/+ZxrGmsWZovV2FqShGumMbDXHzh94cYc0zrMEW4Un3ChCObIZLdi0FVGmxxA==",
5
+ "_integrity": "sha512-LOslqFTo0Gua6HY+2oUsYWRa9AABCh+9DilQp1ewuMxw1mu3rrlTUQk52FGE6VGi78oOUmGbZcAAeMz6lc/XYQ==",
6
6
  "_location": "/@syncfusion/ej2-treegrid",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -24,8 +24,8 @@
24
24
  "/@syncfusion/ej2-react-treegrid",
25
25
  "/@syncfusion/ej2-vue-treegrid"
26
26
  ],
27
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.1.52.tgz",
28
- "_shasum": "8c82053c644986cdb461e9381c0c5c77c6b8f58d",
27
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.1.59.tgz",
28
+ "_shasum": "5723cf35775fc07a90823da3f4dae1200ea0b243",
29
29
  "_spec": "@syncfusion/ej2-treegrid@*",
30
30
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
31
31
  "author": {
@@ -36,10 +36,10 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "@syncfusion/ej2-base": "~20.1.55",
39
+ "@syncfusion/ej2-base": "~20.1.60",
40
40
  "@syncfusion/ej2-data": "~20.1.55",
41
- "@syncfusion/ej2-grids": "~20.1.55",
42
- "@syncfusion/ej2-popups": "~20.1.55"
41
+ "@syncfusion/ej2-grids": "~20.1.60",
42
+ "@syncfusion/ej2-popups": "~20.1.58"
43
43
  },
44
44
  "deprecated": false,
45
45
  "description": "Essential JS 2 TreeGrid Component",
@@ -60,6 +60,6 @@
60
60
  "url": "git+https://github.com/syncfusion/ej2-treegrid.git"
61
61
  },
62
62
  "typings": "index.d.ts",
63
- "version": "20.1.55",
63
+ "version": "20.1.60",
64
64
  "sideEffects": false
65
65
  }
@@ -33,6 +33,8 @@ var ContextMenu = /** @class */ (function () {
33
33
  ContextMenu.prototype.contextMenuOpen = function (args) {
34
34
  var addRow = select('#' + this.parent.element.id + '_gridcontrol_cmenu_AddRow', args.element);
35
35
  var editRecord = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Edit', args.element);
36
+ var indent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Indent', args.element);
37
+ var outdent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Outdent', args.element);
36
38
  if (addRow) {
37
39
  if (this.parent.grid.editSettings.allowAdding === false) {
38
40
  addRow.style.display = 'none';
@@ -45,6 +47,47 @@ var ContextMenu = /** @class */ (function () {
45
47
  && !(isNullOrUndefined(editRecord)) && !(editRecord.classList.contains('e-menu-hide'))) {
46
48
  editRecord.style.display = 'none';
47
49
  }
50
+ if (indent || outdent) {
51
+ var tObj = this.parent;
52
+ var selectedrow = tObj.getSelectedRows()[0];
53
+ var targetElement = args.event.target.closest('td');
54
+ if (isNullOrUndefined(targetElement) || (!isNullOrUndefined(targetElement) && !targetElement.classList.contains('e-rowcell'))) {
55
+ indent.style.display = outdent.style.display = 'none';
56
+ }
57
+ else {
58
+ if (selectedrow.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
59
+ indent.style.display = outdent.style.display = 'none';
60
+ }
61
+ else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {
62
+ var selectedItem = tObj.getCurrentViewRecords()[selectedrow.rowIndex];
63
+ if (!isNullOrUndefined(selectedItem)) {
64
+ if ((selectedItem.level > tObj.getCurrentViewRecords()[selectedrow.rowIndex - 1].level)) {
65
+ indent.style.display = 'none';
66
+ }
67
+ else {
68
+ indent.style.display = 'block';
69
+ }
70
+ if (selectedItem.level === tObj.getCurrentViewRecords()[selectedrow.rowIndex - 1].level) {
71
+ indent.style.display = 'block';
72
+ }
73
+ if (selectedItem.level === 0) {
74
+ outdent.style.display = 'none';
75
+ }
76
+ if (selectedItem.level !== 0) {
77
+ outdent.style.display = 'block';
78
+ }
79
+ }
80
+ }
81
+ if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {
82
+ if (this.parent.toolbar['includes']('Indent')) {
83
+ indent.style.display = 'none';
84
+ }
85
+ if (this.parent.toolbar['includes']('Outdent')) {
86
+ outdent.style.display = 'none';
87
+ }
88
+ }
89
+ }
90
+ }
48
91
  };
49
92
  ContextMenu.prototype.contextMenuClick = function (args) {
50
93
  if (args.item.id === 'Above' || args.item.id === 'Below' || args.item.id === 'Child') {
@@ -52,6 +95,13 @@ var ContextMenu = /** @class */ (function () {
52
95
  this.parent.setProperties({ editSettings: { newRowPosition: args.item.id } }, true);
53
96
  this.parent.addRecord();
54
97
  }
98
+ if (args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' || args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Outdent') {
99
+ if (!isNullOrUndefined(this.parent.rowDragAndDropModule)) {
100
+ var indentOutdentAction = 'indentOutdentAction';
101
+ var action = args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' ? 'indent' : 'outdent';
102
+ this.parent.rowDragAndDropModule[indentOutdentAction](null, action);
103
+ }
104
+ }
55
105
  };
56
106
  /**
57
107
  * For internal use only - Get the module name.
@@ -540,11 +540,13 @@ var Edit = /** @class */ (function () {
540
540
  Edit.prototype.updateIndex = function (data, rows, records) {
541
541
  for (var j = 0; j < this.parent.getDataRows().length; j++) {
542
542
  var data1 = records[j];
543
- var index = getValue('uniqueIDCollection.' + data1.uniqueID + '.index', this.parent);
544
- data1.index = index;
545
- if (!isNullOrUndefined(data1.parentItem)) {
546
- var parentIndex = getValue('uniqueIDCollection.' + data1.parentItem.uniqueID + '.index', this.parent);
547
- data1.parentItem.index = parentIndex;
543
+ if (!isNullOrUndefined(data1)) {
544
+ var index = getValue('uniqueIDCollection.' + data1.uniqueID + '.index', this.parent);
545
+ data1.index = index;
546
+ if (!isNullOrUndefined(data1.parentItem)) {
547
+ var parentIndex = getValue('uniqueIDCollection.' + data1.parentItem.uniqueID + '.index', this.parent);
548
+ data1.parentItem.index = parentIndex;
549
+ }
548
550
  }
549
551
  }
550
552
  var count = -1;
@@ -563,32 +565,34 @@ var Edit = /** @class */ (function () {
563
565
  count++;
564
566
  }
565
567
  var data2 = records[count];
566
- var index = data2.index;
567
- var level = data2.level;
568
- var row = rows[k];
569
- if (!isNullOrUndefined(data2.parentItem)) {
570
- index = getValue('uniqueIDCollection.' + data2.parentItem.uniqueID + '.index', this.parent);
571
- }
572
- var treecell = row.cells[treeColIndex];
573
- if (!isNullOrUndefined(treecell)) {
574
- for (var l = 0; l < treecell.classList.length; l++) {
575
- var value = treecell.classList[l];
576
- var remove = /e-gridrowindex/i;
577
- var removed = /e-griddetailrowindex/i;
578
- var result = value.match(remove);
579
- var results = value.match(removed);
580
- if (result != null) {
581
- removeClass([treecell], value);
568
+ if (!isNullOrUndefined(data2)) {
569
+ var index = data2.index;
570
+ var level = data2.level;
571
+ var row = rows[k];
572
+ if (!isNullOrUndefined(data2.parentItem)) {
573
+ index = getValue('uniqueIDCollection.' + data2.parentItem.uniqueID + '.index', this.parent);
574
+ }
575
+ var treecell = row.cells[treeColIndex];
576
+ if (!isNullOrUndefined(treecell)) {
577
+ for (var l = 0; l < treecell.classList.length; l++) {
578
+ var value = treecell.classList[l];
579
+ var remove = /e-gridrowindex/i;
580
+ var removed = /e-griddetailrowindex/i;
581
+ var result = value.match(remove);
582
+ var results = value.match(removed);
583
+ if (result != null) {
584
+ removeClass([treecell], value);
585
+ }
586
+ if (results != null) {
587
+ removeClass([treecell], value);
588
+ }
582
589
  }
583
- if (results != null) {
584
- removeClass([treecell], value);
590
+ if (!rows[k].classList.contains('e-detailrow')) {
591
+ addClass([treecell], 'e-gridrowindex' + index + 'level' + level);
592
+ }
593
+ else {
594
+ addClass([treecell], 'e-griddetailrowindex' + index + 'level' + level);
585
595
  }
586
- }
587
- if (!rows[k].classList.contains('e-detailrow')) {
588
- addClass([treecell], 'e-gridrowindex' + index + 'level' + level);
589
- }
590
- else {
591
- addClass([treecell], 'e-griddetailrowindex' + index + 'level' + level);
592
596
  }
593
597
  }
594
598
  }
@@ -294,7 +294,7 @@ var InfiniteScroll = /** @class */ (function () {
294
294
  if (getValue('selectedIndex', this.parent.editModule) !== -1 && this.parent.editSettings.newRowPosition !== 'Top') {
295
295
  if (this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child') {
296
296
  position = 'after';
297
- newRowIndex += findChildrenRecords(currentData[newRowIndex + 1]).length;
297
+ newRowIndex += findChildrenRecords(currentData[newRowIndex]).length;
298
298
  if (this.parent.editSettings.newRowPosition === 'Child') {
299
299
  newRowIndex -= 1; //// for child position already child record is added in childRecords so subtracting 1
300
300
  }
@@ -62,5 +62,6 @@ export declare class Page {
62
62
  */
63
63
  private collapseExpandPagedchilds;
64
64
  private pageRoot;
65
+ private updatePageSize;
65
66
  private pageAction;
66
67
  }
@@ -144,6 +144,16 @@ var Page = /** @class */ (function () {
144
144
  }
145
145
  return newResults;
146
146
  };
147
+ Page.prototype.updatePageSize = function (pageingDetails) {
148
+ var updateSize = pageingDetails.result.length;
149
+ var gridPagerModule = this.parent.grid.pagerModule;
150
+ if (this.parent.pageSettings.pageSizes === true) {
151
+ if (gridPagerModule.pagerObj.pagerdropdownModule['dropDownListObject'].value === gridPagerModule.pagerObj.getLocalizedLabel('All')) {
152
+ gridPagerModule['pagerObj'].totalRecordsCount = updateSize;
153
+ this.parent.grid.pageSettings.pageSize = updateSize;
154
+ }
155
+ }
156
+ };
147
157
  Page.prototype.pageAction = function (pageingDetails) {
148
158
  var _this = this;
149
159
  var dm = new DataManager(pageingDetails.result);
@@ -180,6 +190,7 @@ var Page = /** @class */ (function () {
180
190
  pageingDetails.count = visualData.length;
181
191
  var query = new Query();
182
192
  var size = this.parent.grid.pageSettings.pageSize;
193
+ this.updatePageSize(pageingDetails);
183
194
  var current = this.parent.grid.pageSettings.currentPage;
184
195
  if (visualData.length < (current * size)) {
185
196
  current = (Math.floor(visualData.length / size)) + ((visualData.length % size) ? 1 : 0);
@@ -847,8 +847,8 @@ var RowDD = /** @class */ (function () {
847
847
  if (this.dropPosition === 'bottomSegment') {
848
848
  var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
849
849
  var rowIndex = selectedItemIndex === -1 ?
850
- (this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField])) - 1
851
- : this.parent.getSelectedRowIndexes()[0] - 1;
850
+ (this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField]))
851
+ : this.parent.getSelectedRowIndexes()[0];
852
852
  var selectedRecord = this.parent.getCurrentViewRecords()[rowIndex];
853
853
  this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);
854
854
  }
@@ -85,7 +85,7 @@ var Selection = /** @class */ (function () {
85
85
  Selection.prototype.getCheckboxcolumnIndex = function () {
86
86
  var mappingUid;
87
87
  var columnIndex;
88
- var stackedHeader = "stackedHeader";
88
+ var stackedHeader = 'stackedHeader';
89
89
  var columnModel = 'columnModel';
90
90
  var columns = this.parent[stackedHeader] ? this.parent[columnModel] : (this.parent.columns);
91
91
  for (var col = 0; col < columns.length; col++) {
@@ -27,6 +27,7 @@ import { TextWrapSettings } from '../models/textwrap-settings';
27
27
  import { Logger as TreeLogger } from '../actions/logger';
28
28
  import { TreeClipboard } from '../actions/clipboard';
29
29
  import { Selection as TreeGridSelection } from '../actions/selection';
30
+ import { Freeze } from '../actions/freeze-column';
30
31
  import { Print } from '../actions/print';
31
32
  import * as events from '../base/constant';
32
33
  import { SearchSettings } from '../models/search-settings';
@@ -398,6 +399,7 @@ var TreeGrid = /** @class */ (function (_super) {
398
399
  TreeGrid.prototype.requiredModules = function () {
399
400
  var modules = [];
400
401
  var splitFrozenCount = 'splitFrozenCount';
402
+ this.freezeModule = new Freeze(this);
401
403
  this.grid[splitFrozenCount](this.getGridColumns(this.columns));
402
404
  if (this.isDestroyed) {
403
405
  return modules;
@@ -449,7 +451,7 @@ var TreeGrid = /** @class */ (function (_super) {
449
451
  });
450
452
  }
451
453
  if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
452
- this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) {
454
+ this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount() || this.freezeModule) {
453
455
  modules.push({
454
456
  member: 'freeze', args: [this]
455
457
  });
@@ -479,7 +481,7 @@ var TreeGrid = /** @class */ (function (_super) {
479
481
  };
480
482
  TreeGrid.prototype.extendRequiredModules = function (modules) {
481
483
  var IsRowDDInjected = this.injectedModules.filter(function (e) {
482
- return e.name === 'RowDD';
484
+ return e.prototype.getModuleName() === 'rowDragAndDrop';
483
485
  });
484
486
  if (this.allowRowDragAndDrop || IsRowDDInjected.length) {
485
487
  if ((!isNullOrUndefined(this.toolbar) && (this.toolbar['includes']('Indent') ||
@@ -1292,6 +1294,16 @@ var TreeGrid = /** @class */ (function (_super) {
1292
1294
  target: '.e-content', id: this.element.id + '_gridcontrol_cmenu_AddRow',
1293
1295
  items: [{ text: this.l10n.getConstant('Above'), id: 'Above' }, { text: this.l10n.getConstant('Below'), id: 'Below' }, { text: this.l10n.getConstant('Child'), id: 'Child' }] });
1294
1296
  break;
1297
+ case 'Indent':
1298
+ case ContextMenuItems.RowIndent:
1299
+ items.push({ text: this.l10n.getConstant('RowIndent'),
1300
+ target: '.e-content', iconCss: 'e-indent e-icons', id: this.element.id + '_gridcontrol_cmenu_Indent' });
1301
+ break;
1302
+ case 'Outdent':
1303
+ case ContextMenuItems.RowOutdent:
1304
+ items.push({ text: this.l10n.getConstant('RowOutdent'),
1305
+ target: '.e-content', iconCss: 'e-outdent e-icons', id: this.element.id + '_gridcontrol_cmenu_Outdent' });
1306
+ break;
1295
1307
  default:
1296
1308
  items.push(this.contextMenuItems[i]);
1297
1309
  }
@@ -1310,6 +1322,7 @@ var TreeGrid = /** @class */ (function (_super) {
1310
1322
  */
1311
1323
  TreeGrid.prototype.getGridToolbar = function () {
1312
1324
  if (this.toolbar) {
1325
+ this.l10n = new L10n('treegrid', this.defaultLocale, this.locale);
1313
1326
  var items = [];
1314
1327
  var tooltipText = void 0;
1315
1328
  for (var i = 0; i < this.toolbar.length; i++) {
@@ -1391,6 +1404,9 @@ var TreeGrid = /** @class */ (function (_super) {
1391
1404
  gridColumn[prop] = this.getGridColumns(column[i][prop], false, index);
1392
1405
  treeGridColumn[prop] = column[i][prop];
1393
1406
  }
1407
+ else if (this.initialRender && !isNullOrUndefined(treeColumn) && this.enablePersistence && prop === 'edit') {
1408
+ gridColumn[prop] = treeGridColumn[prop] = treeColumn[prop];
1409
+ }
1394
1410
  else if (!(treeColumn) || prop !== 'sortComparer') {
1395
1411
  gridColumn[prop] = treeGridColumn[prop] = column[i][prop];
1396
1412
  }
@@ -1555,6 +1571,9 @@ var TreeGrid = /** @class */ (function (_super) {
1555
1571
  break;
1556
1572
  case 'locale':
1557
1573
  this.grid.locale = this.locale;
1574
+ this.TreeGridLocale();
1575
+ this.grid.toolbar = this.getGridToolbar();
1576
+ this.grid.contextMenuItems = this.getContextMenu();
1558
1577
  break;
1559
1578
  case 'selectedRowIndex':
1560
1579
  this.grid.selectedRowIndex = this.selectedRowIndex;
@@ -112,7 +112,11 @@ export declare type ContextMenuItem =
112
112
  /** `NextPage` - Go to the next page. */
113
113
  'NextPage' |
114
114
  /** AddRow to the TreeGrid */
115
- 'AddRow';
115
+ 'AddRow' |
116
+ /** `Indent` - Indents the record to one level of hierarchy */
117
+ 'Indent' |
118
+ /** `Outdent` - Outdent the record to one level of hierarchy */
119
+ 'Outdent';
116
120
  /**
117
121
  * Defines predefined contextmenu items.
118
122
  *
@@ -134,7 +138,9 @@ export declare enum ContextMenuItems {
134
138
  PrevPage = 12,
135
139
  LastPage = 13,
136
140
  NextPage = 14,
137
- AddRow = 15
141
+ AddRow = 15,
142
+ RowIndent = 16,
143
+ RowOutdent = 17
138
144
  }
139
145
  /**
140
146
  * Defines modes of editing.
@@ -43,4 +43,6 @@ export var ContextMenuItems;
43
43
  ContextMenuItems[ContextMenuItems["LastPage"] = 13] = "LastPage";
44
44
  ContextMenuItems[ContextMenuItems["NextPage"] = 14] = "NextPage";
45
45
  ContextMenuItems[ContextMenuItems["AddRow"] = 15] = "AddRow";
46
+ ContextMenuItems[ContextMenuItems["RowIndent"] = 16] = "RowIndent";
47
+ ContextMenuItems[ContextMenuItems["RowOutdent"] = 17] = "RowOutdent";
46
48
  })(ContextMenuItems || (ContextMenuItems = {}));
@@ -329,12 +329,12 @@ export declare class Column {
329
329
  private parent;
330
330
  constructor(options: ColumnModel);
331
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
- */
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
338
  private setProperties;
339
339
  }
340
340
  /**
@@ -72,12 +72,12 @@ var Column = /** @class */ (function () {
72
72
  merge(this, options);
73
73
  }
74
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
- */
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
81
  Column.prototype.setProperties = function (column) {
82
82
  //Angular two way binding
83
83
  var keys = Object.keys(column);
@@ -30,10 +30,10 @@ export declare class Render {
30
30
  cellRender(args: QueryCellInfoEventArgs): void;
31
31
  private updateTreeCell;
32
32
  /**
33
- * @param {string} columnUid - Defines column uid
34
- * @returns {void}
35
- * @hidden
36
- */
33
+ * @param {string} columnUid - Defines column uid
34
+ * @returns {void}
35
+ * @hidden
36
+ */
37
37
  private refreshReactColumnTemplateByUid;
38
38
  private columnTemplateResult;
39
39
  private reactTemplateRender;
@@ -276,10 +276,10 @@ var Render = /** @class */ (function () {
276
276
  }
277
277
  };
278
278
  /**
279
- * @param {string} columnUid - Defines column uid
280
- * @returns {void}
281
- * @hidden
282
- */
279
+ * @param {string} columnUid - Defines column uid
280
+ * @returns {void}
281
+ * @hidden
282
+ */
283
283
  Render.prototype.refreshReactColumnTemplateByUid = function (columnUid) {
284
284
  var _this = this;
285
285
  if (this.parent.isReact) {
@@ -296,6 +296,8 @@ var Render = /** @class */ (function () {
296
296
  var cellRenderer = new CellRenderer(_this.parent.grid, _this.parent.grid.serviceLocator);
297
297
  var td = _this.parent.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
298
298
  cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
299
+ var treecell = _this.parent.getRows()[j].cells[cellIndex];
300
+ _this.cellRender({ data: rowsObj[j].data, cell: treecell, column: cell.column });
299
301
  }
300
302
  }
301
303
  });