@syncfusion/ej2-treegrid 20.1.55 → 20.1.56

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.56
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.55",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-YN6uR63NYY2AMQf0v1YosSbea/+ZxrGmsWZovV2FqShGumMbDXHzh94cYc0zrMEW4Un3ChCObIZLdi0FVGmxxA==",
5
+ "_integrity": "sha512-A1EOCEVmqUalNcK4SjlQKCn8lUFDKfEWKUHNw3EqzLQjDxZsUMneiA8ws+zwLgX33Bm6TevapkBRBtoW5jbQzw==",
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.55.tgz",
28
+ "_shasum": "ded97a9e20965294cf8792b759e1cdbeba0e8e68",
29
29
  "_spec": "@syncfusion/ej2-treegrid@*",
30
30
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
31
31
  "author": {
@@ -36,9 +36,9 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "@syncfusion/ej2-base": "~20.1.55",
39
+ "@syncfusion/ej2-base": "~20.1.56",
40
40
  "@syncfusion/ej2-data": "~20.1.55",
41
- "@syncfusion/ej2-grids": "~20.1.55",
41
+ "@syncfusion/ej2-grids": "~20.1.56",
42
42
  "@syncfusion/ej2-popups": "~20.1.55"
43
43
  },
44
44
  "deprecated": false,
@@ -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.56",
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.
@@ -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
  }
@@ -479,7 +479,7 @@ var TreeGrid = /** @class */ (function (_super) {
479
479
  };
480
480
  TreeGrid.prototype.extendRequiredModules = function (modules) {
481
481
  var IsRowDDInjected = this.injectedModules.filter(function (e) {
482
- return e.name === 'RowDD';
482
+ return e.prototype.getModuleName() === 'rowDragAndDrop';
483
483
  });
484
484
  if (this.allowRowDragAndDrop || IsRowDDInjected.length) {
485
485
  if ((!isNullOrUndefined(this.toolbar) && (this.toolbar['includes']('Indent') ||
@@ -1292,6 +1292,16 @@ var TreeGrid = /** @class */ (function (_super) {
1292
1292
  target: '.e-content', id: this.element.id + '_gridcontrol_cmenu_AddRow',
1293
1293
  items: [{ text: this.l10n.getConstant('Above'), id: 'Above' }, { text: this.l10n.getConstant('Below'), id: 'Below' }, { text: this.l10n.getConstant('Child'), id: 'Child' }] });
1294
1294
  break;
1295
+ case 'Indent':
1296
+ case ContextMenuItems.RowIndent:
1297
+ items.push({ text: this.l10n.getConstant('RowIndent'),
1298
+ target: '.e-content', iconCss: 'e-indent e-icons', id: this.element.id + '_gridcontrol_cmenu_Indent' });
1299
+ break;
1300
+ case 'Outdent':
1301
+ case ContextMenuItems.RowOutdent:
1302
+ items.push({ text: this.l10n.getConstant('RowOutdent'),
1303
+ target: '.e-content', iconCss: 'e-outdent e-icons', id: this.element.id + '_gridcontrol_cmenu_Outdent' });
1304
+ break;
1295
1305
  default:
1296
1306
  items.push(this.contextMenuItems[i]);
1297
1307
  }
@@ -1310,6 +1320,7 @@ var TreeGrid = /** @class */ (function (_super) {
1310
1320
  */
1311
1321
  TreeGrid.prototype.getGridToolbar = function () {
1312
1322
  if (this.toolbar) {
1323
+ this.l10n = new L10n('treegrid', this.defaultLocale, this.locale);
1313
1324
  var items = [];
1314
1325
  var tooltipText = void 0;
1315
1326
  for (var i = 0; i < this.toolbar.length; i++) {
@@ -1555,6 +1566,9 @@ var TreeGrid = /** @class */ (function (_super) {
1555
1566
  break;
1556
1567
  case 'locale':
1557
1568
  this.grid.locale = this.locale;
1569
+ this.TreeGridLocale();
1570
+ this.grid.toolbar = this.getGridToolbar();
1571
+ this.grid.contextMenuItems = this.getContextMenu();
1558
1572
  break;
1559
1573
  case 'selectedRowIndex':
1560
1574
  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) {