@syncfusion/ej2-pivotview 19.3.57 → 19.4.38

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.
Files changed (136) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +76 -0
  2. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +56 -0
  3. package/CHANGELOG.md +26 -38
  4. package/dist/ej2-pivotview.umd.min.js +2 -2
  5. package/dist/ej2-pivotview.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-pivotview.es2015.js +2026 -1092
  7. package/dist/es6/ej2-pivotview.es2015.js.map +1 -1
  8. package/dist/es6/ej2-pivotview.es5.js +2042 -1102
  9. package/dist/es6/ej2-pivotview.es5.js.map +1 -1
  10. package/dist/global/ej2-pivotview.min.js +2 -2
  11. package/dist/global/ej2-pivotview.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +22 -22
  14. package/src/base/engine.d.ts +17 -1
  15. package/src/base/engine.js +70 -27
  16. package/src/base/export-util.d.ts +17 -0
  17. package/src/base/export-util.js +245 -0
  18. package/src/base/olap/engine.d.ts +7 -0
  19. package/src/base/olap/engine.js +138 -35
  20. package/src/base/util.d.ts +0 -9
  21. package/src/base/util.js +2 -215
  22. package/src/common/actions/field-list.js +1 -1
  23. package/src/common/actions/pivot-button.d.ts +5 -8
  24. package/src/common/actions/pivot-button.js +187 -171
  25. package/src/common/base/constant.d.ts +186 -0
  26. package/src/common/base/constant.js +186 -0
  27. package/src/common/base/css-constant.d.ts +2 -0
  28. package/src/common/base/css-constant.js +2 -0
  29. package/src/common/base/enum.d.ts +11 -0
  30. package/src/common/base/interface.d.ts +272 -2
  31. package/src/common/calculatedfield/calculated-field.js +108 -93
  32. package/src/common/conditionalformatting/conditional-formatting.js +8 -2
  33. package/src/common/grouping-bar/grouping-bar.js +1 -1
  34. package/src/common/popups/aggregate-menu.js +57 -35
  35. package/src/common/popups/drillthrough-dialog.js +187 -139
  36. package/src/common/popups/filter-dialog.d.ts +1 -0
  37. package/src/common/popups/filter-dialog.js +22 -1
  38. package/src/common/popups/formatting-dialog.js +4 -0
  39. package/src/common/popups/grouping.js +2 -1
  40. package/src/common/popups/toolbar.js +305 -203
  41. package/src/pivotchart/base/pivotchart.js +36 -15
  42. package/src/pivotfieldlist/base/field-list-model.d.ts +49 -1
  43. package/src/pivotfieldlist/base/field-list.d.ts +55 -1
  44. package/src/pivotfieldlist/base/field-list.js +68 -1
  45. package/src/pivotfieldlist/renderer/dialog-renderer.js +38 -15
  46. package/src/pivotfieldlist/renderer/tree-renderer.js +35 -22
  47. package/src/pivotview/actions/drill-through.js +1 -1
  48. package/src/pivotview/actions/excel-export.js +9 -7
  49. package/src/pivotview/actions/pdf-export.js +3 -3
  50. package/src/pivotview/base/pivotview-model.d.ts +46 -1
  51. package/src/pivotview/base/pivotview.d.ts +56 -2
  52. package/src/pivotview/base/pivotview.js +288 -107
  53. package/src/pivotview/model/chartsettings-model.d.ts +1 -1
  54. package/src/pivotview/model/chartsettings.d.ts +1 -1
  55. package/src/pivotview/model/chartsettings.js +1 -1
  56. package/src/pivotview/model/datasourcesettings-model.d.ts +8 -1
  57. package/src/pivotview/model/datasourcesettings.d.ts +7 -0
  58. package/src/pivotview/model/datasourcesettings.js +3 -0
  59. package/src/pivotview/renderer/render.d.ts +2 -1
  60. package/src/pivotview/renderer/render.js +39 -6
  61. package/styles/bootstrap-dark.css +115 -104
  62. package/styles/bootstrap.css +115 -104
  63. package/styles/bootstrap4.css +114 -81
  64. package/styles/bootstrap5-dark.css +220 -168
  65. package/styles/bootstrap5.css +215 -161
  66. package/styles/fabric-dark.css +117 -103
  67. package/styles/fabric.css +115 -102
  68. package/styles/highcontrast-light.css +116 -102
  69. package/styles/highcontrast.css +118 -104
  70. package/styles/material-dark.css +108 -97
  71. package/styles/material.css +108 -97
  72. package/styles/pivotfieldlist/_bootstrap-dark-definition.scss +1 -4
  73. package/styles/pivotfieldlist/_bootstrap-definition.scss +1 -4
  74. package/styles/pivotfieldlist/_bootstrap4-definition.scss +1 -4
  75. package/styles/pivotfieldlist/_bootstrap5-definition.scss +8 -11
  76. package/styles/pivotfieldlist/_fabric-dark-definition.scss +1 -4
  77. package/styles/pivotfieldlist/_fabric-definition.scss +1 -4
  78. package/styles/pivotfieldlist/_fluent-definition.scss +177 -0
  79. package/styles/pivotfieldlist/_highcontrast-definition.scss +1 -4
  80. package/styles/pivotfieldlist/_highcontrast-light-definition.scss +1 -4
  81. package/styles/pivotfieldlist/_layout.scss +199 -109
  82. package/styles/pivotfieldlist/_material-dark-definition.scss +1 -4
  83. package/styles/pivotfieldlist/_material-definition.scss +1 -4
  84. package/styles/pivotfieldlist/_tailwind-definition.scss +6 -9
  85. package/styles/pivotfieldlist/_theme.scss +185 -35
  86. package/styles/pivotfieldlist/bootstrap-dark.css +49 -58
  87. package/styles/pivotfieldlist/bootstrap.css +49 -58
  88. package/styles/pivotfieldlist/bootstrap4.css +44 -39
  89. package/styles/pivotfieldlist/bootstrap5-dark.css +115 -89
  90. package/styles/pivotfieldlist/bootstrap5.css +115 -89
  91. package/styles/pivotfieldlist/fabric-dark.css +49 -58
  92. package/styles/pivotfieldlist/fabric.css +49 -58
  93. package/styles/pivotfieldlist/highcontrast-light.css +49 -58
  94. package/styles/pivotfieldlist/highcontrast.css +49 -58
  95. package/styles/pivotfieldlist/icons/_bootstrap5.scss +2 -2
  96. package/styles/pivotfieldlist/icons/_fluent.scss +352 -0
  97. package/styles/pivotfieldlist/icons/_tailwind.scss +2 -2
  98. package/styles/pivotfieldlist/material-dark.css +44 -53
  99. package/styles/pivotfieldlist/material.css +44 -53
  100. package/styles/pivotfieldlist/tailwind-dark.css +138 -81
  101. package/styles/pivotfieldlist/tailwind.css +140 -83
  102. package/styles/pivotview/_bootstrap-dark-definition.scss +9 -6
  103. package/styles/pivotview/_bootstrap-definition.scss +9 -6
  104. package/styles/pivotview/_bootstrap4-definition.scss +10 -7
  105. package/styles/pivotview/_bootstrap5-definition.scss +12 -9
  106. package/styles/pivotview/_fabric-dark-definition.scss +8 -5
  107. package/styles/pivotview/_fabric-definition.scss +7 -4
  108. package/styles/pivotview/_fluent-definition.scss +126 -0
  109. package/styles/pivotview/_highcontrast-definition.scss +8 -5
  110. package/styles/pivotview/_highcontrast-light-definition.scss +7 -4
  111. package/styles/pivotview/_layout.scss +119 -64
  112. package/styles/pivotview/_material-dark-definition.scss +7 -4
  113. package/styles/pivotview/_material-definition.scss +8 -4
  114. package/styles/pivotview/_tailwind-definition.scss +8 -5
  115. package/styles/pivotview/_theme.scss +124 -70
  116. package/styles/pivotview/bootstrap-dark.css +66 -46
  117. package/styles/pivotview/bootstrap.css +66 -46
  118. package/styles/pivotview/bootstrap4.css +70 -42
  119. package/styles/pivotview/bootstrap5-dark.css +99 -73
  120. package/styles/pivotview/bootstrap5-dark.scss +0 -1
  121. package/styles/pivotview/bootstrap5.css +100 -72
  122. package/styles/pivotview/fabric-dark.css +68 -45
  123. package/styles/pivotview/fabric.css +66 -44
  124. package/styles/pivotview/highcontrast-light.css +67 -44
  125. package/styles/pivotview/highcontrast.css +69 -46
  126. package/styles/pivotview/icons/_bootstrap4.scss +1 -1
  127. package/styles/pivotview/icons/_bootstrap5.scss +1 -1
  128. package/styles/pivotview/icons/_fluent.scss +183 -0
  129. package/styles/pivotview/icons/_tailwind.scss +1 -1
  130. package/styles/pivotview/material-dark.css +64 -44
  131. package/styles/pivotview/material.css +64 -44
  132. package/styles/pivotview/tailwind-dark.css +106 -58
  133. package/styles/pivotview/tailwind-dark.scss +0 -1
  134. package/styles/pivotview/tailwind.css +107 -57
  135. package/styles/tailwind-dark.css +250 -145
  136. package/styles/tailwind.css +247 -140
@@ -34,28 +34,39 @@ var AggregateMenu = /** @class */ (function () {
34
34
  AggregateMenu.prototype.openContextMenu = function (args) {
35
35
  var _this = this;
36
36
  var fieldName = args.target.parentElement.id;
37
+ var fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
37
38
  this.buttonElement = args.target.parentElement;
38
39
  var isStringField = this.parent.engineModule.fieldList[fieldName].type !== 'number' ? 1 : 0;
39
40
  this.summaryTypes = this.getMenuItem(isStringField).slice();
41
+ this.parent.actionObj.actionName = events.aggregateField;
42
+ this.parent.actionObj.fieldInfo = fieldInfo.fieldItem;
43
+ if (this.parent.actionBeginMethod()) {
44
+ return;
45
+ }
40
46
  var eventArgs = {
41
47
  cancel: false, fieldName: fieldName, aggregateTypes: this.summaryTypes, displayMenuCount: 7
42
48
  };
43
49
  var control = this.parent.getModuleName() === 'pivotfieldlist' && this.parent.isPopupView ?
44
50
  this.parent.pivotGridModule : this.parent;
45
- control.trigger(events.aggregateMenuOpen, eventArgs, function (observedArgs) {
46
- if (!observedArgs.cancel) {
47
- _this.summaryTypes = observedArgs.aggregateTypes;
48
- _this.createContextMenu(isStringField, observedArgs.displayMenuCount);
49
- _this.currentMenu = args.target;
50
- var pos = _this.currentMenu.getBoundingClientRect();
51
- if (_this.parent.enableRtl) {
52
- _this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left - 105);
53
- }
54
- else {
55
- _this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left);
51
+ try {
52
+ control.trigger(events.aggregateMenuOpen, eventArgs, function (observedArgs) {
53
+ if (!observedArgs.cancel) {
54
+ _this.summaryTypes = observedArgs.aggregateTypes;
55
+ _this.createContextMenu(isStringField, observedArgs.displayMenuCount);
56
+ _this.currentMenu = args.target;
57
+ var pos = _this.currentMenu.getBoundingClientRect();
58
+ if (_this.parent.enableRtl) {
59
+ _this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left - 105);
60
+ }
61
+ else {
62
+ _this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left);
63
+ }
56
64
  }
57
- }
58
- });
65
+ });
66
+ }
67
+ catch (execption) {
68
+ this.parent.actionFailureMethod(execption);
69
+ }
59
70
  };
60
71
  AggregateMenu.prototype.createContextMenu = function (isStringField, displayMenuCount) {
61
72
  var _this = this;
@@ -332,31 +343,42 @@ var AggregateMenu = /** @class */ (function () {
332
343
  AggregateMenu.prototype.selectOptionInContextMenu = function (menu) {
333
344
  if (menu.item.text !== null) {
334
345
  var buttonElement = this.currentMenu.parentElement;
335
- var type = menu.item.id.split('_').pop();
336
- if (type === 'MoreOption' || type === 'PercentageOfDifferenceFrom'
337
- || type === 'PercentageOfParentTotal' || type === 'DifferenceFrom') {
338
- this.createValueSettingsDialog(buttonElement, this.parentElement, type);
346
+ var fieldInfo = PivotUtil.getFieldInfo((buttonElement ? buttonElement.id : ''), this.parent);
347
+ this.parent.actionObj.actionName = events.aggregateField;
348
+ this.parent.actionObj.fieldInfo = fieldInfo.fieldItem;
349
+ if (this.parent.actionBeginMethod()) {
350
+ return;
339
351
  }
340
- else {
341
- var field = buttonElement.getAttribute('data-uid');
342
- var valuefields = this.parent.dataSourceSettings.values;
343
- var contentElement = buttonElement.querySelector('.e-content');
344
- var captionName = menu.item.text + ' ' + this.parent.localeObj.getConstant('of') + ' ' +
345
- this.parent.engineModule.fieldList[field].caption;
346
- contentElement.innerHTML = captionName;
347
- contentElement.setAttribute('title', captionName);
348
- buttonElement.setAttribute('data-type', type);
349
- for (var vCnt = 0; vCnt < this.parent.dataSourceSettings.values.length; vCnt++) {
350
- if (this.parent.dataSourceSettings.values[vCnt].name === field) {
351
- var dataSourceItem = extend({}, valuefields[vCnt].properties ?
352
- valuefields[vCnt].properties : valuefields[vCnt], null, true);
353
- dataSourceItem.type = type;
354
- this.parent.engineModule.fieldList[field].aggregateType = type;
355
- valuefields.splice(vCnt, 1, dataSourceItem);
356
- this.parent.lastAggregationInfo = dataSourceItem;
352
+ var type = menu.item.id.split('_').pop();
353
+ try {
354
+ if (type === 'MoreOption' || type === 'PercentageOfDifferenceFrom'
355
+ || type === 'PercentageOfParentTotal' || type === 'DifferenceFrom') {
356
+ this.createValueSettingsDialog(buttonElement, this.parentElement, type);
357
+ }
358
+ else {
359
+ var field = buttonElement.getAttribute('data-uid');
360
+ var valuefields = this.parent.dataSourceSettings.values;
361
+ var contentElement = buttonElement.querySelector('.e-content');
362
+ var captionName = menu.item.text + ' ' + this.parent.localeObj.getConstant('of') + ' ' +
363
+ this.parent.engineModule.fieldList[field].caption;
364
+ contentElement.innerHTML = captionName;
365
+ contentElement.setAttribute('title', captionName);
366
+ buttonElement.setAttribute('data-type', type);
367
+ for (var vCnt = 0; vCnt < this.parent.dataSourceSettings.values.length; vCnt++) {
368
+ if (this.parent.dataSourceSettings.values[vCnt].name === field) {
369
+ var dataSourceItem = extend({}, valuefields[vCnt].properties ?
370
+ valuefields[vCnt].properties : valuefields[vCnt], null, true);
371
+ dataSourceItem.type = type;
372
+ this.parent.engineModule.fieldList[field].aggregateType = type;
373
+ valuefields.splice(vCnt, 1, dataSourceItem);
374
+ this.parent.lastAggregationInfo = dataSourceItem;
375
+ }
357
376
  }
377
+ this.updateDataSource();
358
378
  }
359
- this.updateDataSource();
379
+ }
380
+ catch (execption) {
381
+ this.parent.actionFailureMethod(execption);
360
382
  }
361
383
  }
362
384
  };
@@ -48,142 +48,159 @@ var DrillThroughDialog = /** @class */ (function () {
48
48
  this.clonedData.push(this.frameHeaderWithKeys(eventArgs.rawData[i]));
49
49
  }
50
50
  var actualText = eventArgs.currentCell.actualText.toString();
51
- if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
52
- this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
53
- this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
54
- this.editCell(eventArgs);
55
- }
56
- else {
57
- this.removeDrillThroughDialog();
58
- var drillThroughDialog = createElement('div', {
59
- id: this.parent.element.id + '_drillthrough',
60
- className: cls.DRILLTHROUGH_DIALOG
61
- });
62
- this.parent.element.appendChild(drillThroughDialog);
63
- this.dialogPopUp = new Dialog({
64
- animationSettings: { effect: 'Fade' },
65
- allowDragging: false,
66
- header: this.parent.localeObj.getConstant('details'),
67
- content: this.createDrillThroughGrid(eventArgs),
68
- beforeOpen: function () {
69
- _this.drillThroughGrid.setProperties({
70
- dataSource: _this.parent.editSettings.allowEditing ?
71
- _this.dataWithPrimarykey(eventArgs) : _this.gridData,
72
- height: !_this.parent.editSettings.allowEditing ? 300 : 220
73
- }, false);
74
- },
75
- beforeClose: function () {
76
- if (_this.parent.editSettings.allowEditing && _this.isUpdated) {
77
- if (_this.parent.dataSourceSettings.type === 'CSV') {
78
- _this.updateData(_this.drillThroughGrid.dataSource);
79
- }
80
- var gridIndexObjectsValue = Object.keys(_this.gridIndexObjects);
81
- var previousPosition = [];
82
- for (var _i = 0, gridIndexObjectsValue_1 = gridIndexObjectsValue; _i < gridIndexObjectsValue_1.length; _i++) {
83
- var value = gridIndexObjectsValue_1[_i];
84
- previousPosition.push(_this.gridIndexObjects[value]);
85
- }
86
- var count = Object.keys(_this.gridIndexObjects).length;
87
- var addItems = [];
88
- var prevItems = [];
89
- var index = 0;
90
- /* eslint-disable @typescript-eslint/dot-notation */
91
- for (var _a = 0, _b = _this.drillThroughGrid.dataSource; _a < _b.length; _a++) {
92
- var item = _b[_a];
93
- if (isNullOrUndefined(item['__index']) || item['__index'] === '') {
94
- for (var _c = 0, _d = _this.engine.fields; _c < _d.length; _c++) {
95
- var field = _d[_c];
96
- if (isNullOrUndefined(item[field])) {
97
- delete item[field];
98
- }
99
- }
100
- delete item['__index'];
101
- addItems.push(item);
51
+ try {
52
+ if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
53
+ this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
54
+ this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
55
+ this.parent.actionObj.actionName = events.editRecord;
56
+ if (this.parent.actionBeginMethod()) {
57
+ return;
58
+ }
59
+ this.editCell(eventArgs);
60
+ }
61
+ else {
62
+ this.removeDrillThroughDialog();
63
+ var drillThroughDialog = createElement('div', {
64
+ id: this.parent.element.id + '_drillthrough',
65
+ className: cls.DRILLTHROUGH_DIALOG
66
+ });
67
+ this.parent.element.appendChild(drillThroughDialog);
68
+ this.dialogPopUp = new Dialog({
69
+ animationSettings: { effect: 'Fade' },
70
+ allowDragging: false,
71
+ header: this.parent.localeObj.getConstant('details'),
72
+ content: this.createDrillThroughGrid(eventArgs),
73
+ beforeOpen: function () {
74
+ _this.drillThroughGrid.setProperties({
75
+ dataSource: _this.parent.editSettings.allowEditing ?
76
+ _this.dataWithPrimarykey(eventArgs) : _this.gridData,
77
+ height: !_this.parent.editSettings.allowEditing ? 300 : 220
78
+ }, false);
79
+ },
80
+ beforeClose: function () {
81
+ if (_this.parent.editSettings.allowEditing && _this.isUpdated) {
82
+ if (_this.parent.dataSourceSettings.type === 'CSV') {
83
+ _this.updateData(_this.drillThroughGrid.dataSource);
102
84
  }
103
- else if (count > 0) {
104
- delete _this.gridIndexObjects[item['__index'].toString()];
105
- prevItems.push(item);
106
- count--;
85
+ var gridIndexObjectsValue = Object.keys(_this.gridIndexObjects);
86
+ var previousPosition = [];
87
+ for (var _i = 0, gridIndexObjectsValue_1 = gridIndexObjectsValue; _i < gridIndexObjectsValue_1.length; _i++) {
88
+ var value = gridIndexObjectsValue_1[_i];
89
+ previousPosition.push(_this.gridIndexObjects[value]);
107
90
  }
108
- if (_this.parent.dataSourceSettings.mode === 'Server') {
109
- if (item['__index']) {
91
+ var count = Object.keys(_this.gridIndexObjects).length;
92
+ var addItems = [];
93
+ var prevItems = [];
94
+ var index = 0;
95
+ /* eslint-disable @typescript-eslint/dot-notation */
96
+ for (var _a = 0, _b = _this.drillThroughGrid.dataSource; _a < _b.length; _a++) {
97
+ var item = _b[_a];
98
+ if (isNullOrUndefined(item['__index']) || item['__index'] === '') {
99
+ for (var _c = 0, _d = _this.engine.fields; _c < _d.length; _c++) {
100
+ var field = _d[_c];
101
+ if (isNullOrUndefined(item[field])) {
102
+ delete item[field];
103
+ }
104
+ }
110
105
  delete item['__index'];
106
+ addItems.push(item);
111
107
  }
112
- if (_this.gridData[index]['__index']) {
113
- delete _this.gridData[index]['__index'];
108
+ else if (count > 0) {
109
+ delete _this.gridIndexObjects[item['__index'].toString()];
110
+ prevItems.push(item);
111
+ count--;
114
112
  }
113
+ if (_this.parent.dataSourceSettings.mode === 'Server') {
114
+ if (item['__index']) {
115
+ delete item['__index'];
116
+ }
117
+ if (_this.gridData[index]['__index']) {
118
+ delete _this.gridData[index]['__index'];
119
+ }
120
+ }
121
+ index++;
115
122
  }
116
- index++;
117
- }
118
- count = 0;
119
- if (_this.parent.dataSourceSettings.mode === 'Server') {
120
- var gridIndex = []; /* eslint-disable-line */
121
- var keys = Object.keys(_this.gridIndexObjects);
122
- for (var len = 0; len < keys.length; len++) {
123
- delete _this.parent.drillThroughValue.indexObject[_this.gridIndexObjects[keys[len]]];
124
- gridIndex.push({ Key: keys[len], Value: _this.gridIndexObjects[keys[len]] }); /* eslint-disable-line */
125
- }
126
- var indexObject = []; /* eslint-disable-line */
127
- keys = Object.keys(_this.parent.drillThroughValue.indexObject);
128
- for (var len = 0; len < keys.length; len++) {
129
- indexObject.push({ Key: keys[len], Value: _this.parent.drillThroughValue.indexObject[keys[len]] }); /* eslint-disable-line */
123
+ count = 0;
124
+ if (_this.parent.dataSourceSettings.mode === 'Server') {
125
+ var gridIndex = []; /* eslint-disable-line */
126
+ var keys = Object.keys(_this.gridIndexObjects);
127
+ for (var len = 0; len < keys.length; len++) {
128
+ delete _this.parent.drillThroughValue.indexObject[_this.gridIndexObjects[keys[len]]];
129
+ gridIndex.push({ Key: keys[len], Value: _this.gridIndexObjects[keys[len]] }); /* eslint-disable-line */
130
+ }
131
+ var indexObject = []; /* eslint-disable-line */
132
+ keys = Object.keys(_this.parent.drillThroughValue.indexObject);
133
+ for (var len = 0; len < keys.length; len++) {
134
+ indexObject.push({ Key: keys[len], Value: _this.parent.drillThroughValue.indexObject[keys[len]] }); /* eslint-disable-line */
135
+ }
136
+ _this.parent.getEngine('updateRawData', null, null, null, null, null, null, null, { 'addedData': addItems, 'removedData': gridIndex, 'updatedData': prevItems, indexObject: indexObject });
130
137
  }
131
- _this.parent.getEngine('updateRawData', null, null, null, null, null, null, null, { 'addedData': addItems, 'removedData': gridIndex, 'updatedData': prevItems, indexObject: indexObject });
132
- }
133
- else {
134
- var items = [];
135
- var data = (_this.parent.allowDataCompression && _this.parent.enableVirtualization) ?
136
- _this.parent.engineModule.actualData : _this.parent.engineModule.data;
137
- for (var _e = 0, _f = data; _e < _f.length; _e++) {
138
- var item = _f[_e];
139
- delete item['__index'];
140
- if (_this.gridIndexObjects[count.toString()] === undefined) {
141
- items.push(item);
138
+ else {
139
+ var items = [];
140
+ var data = (_this.parent.allowDataCompression && _this.parent.enableVirtualization) ?
141
+ _this.parent.engineModule.actualData : _this.parent.engineModule.data;
142
+ for (var _e = 0, _f = data; _e < _f.length; _e++) {
143
+ var item = _f[_e];
144
+ delete item['__index'];
145
+ if (_this.gridIndexObjects[count.toString()] === undefined) {
146
+ items.push(item);
147
+ }
148
+ count++;
149
+ }
150
+ /* eslint-enable @typescript-eslint/dot-notation */
151
+ items = items.concat(addItems);
152
+ var eventArgs_1 = {
153
+ currentData: _this.drillThroughGrid.dataSource,
154
+ previousData: _this.clonedData,
155
+ previousPosition: previousPosition,
156
+ cancel: false
157
+ };
158
+ _this.parent.trigger(events.editCompleted, eventArgs_1);
159
+ if (!eventArgs_1.cancel) {
160
+ _this.parent.setProperties({ dataSourceSettings: { dataSource: items } }, true);
161
+ _this.engine.updateGridData(_this.parent.dataSourceSettings);
162
+ _this.parent.pivotValues = _this.engine.pivotValues;
142
163
  }
143
- count++;
144
164
  }
145
- /* eslint-enable @typescript-eslint/dot-notation */
146
- items = items.concat(addItems);
147
- var eventArgs_1 = {
148
- currentData: _this.drillThroughGrid.dataSource,
149
- previousData: _this.clonedData,
150
- previousPosition: previousPosition,
151
- cancel: false
165
+ _this.parent.actionObj.actionName = events.recordUpdated;
166
+ var actionInfo = {
167
+ editInfo: {
168
+ type: _this.drillThroughGrid.editSettings.mode, action: 'Update', currentData: _this.drillThroughGrid.dataSource,
169
+ previousData: _this.clonedData, previousPosition: previousPosition
170
+ }
152
171
  };
153
- _this.parent.trigger(events.editCompleted, eventArgs_1);
154
- if (!eventArgs_1.cancel) {
155
- _this.parent.setProperties({ dataSourceSettings: { dataSource: items } }, true);
156
- _this.engine.updateGridData(_this.parent.dataSourceSettings);
157
- _this.parent.pivotValues = _this.engine.pivotValues;
158
- }
172
+ _this.parent.actionObj.actionInfo = actionInfo;
159
173
  }
160
- }
161
- _this.isUpdated = false;
162
- _this.gridIndexObjects = {};
163
- },
164
- isModal: true,
165
- visible: true,
166
- showCloseIcon: true,
167
- locale: this.parent.locale,
168
- enableRtl: this.parent.enableRtl,
169
- width: this.parent.isAdaptive ? '100%' : '60%',
170
- position: { X: 'center', Y: 'center' },
171
- closeOnEscape: !this.parent.editSettings.allowEditing,
172
- target: document.body,
173
- close: this.removeDrillThroughDialog.bind(this)
174
- });
175
- this.dialogPopUp.isStringTemplate = true;
176
- this.dialogPopUp.appendTo(drillThroughDialog);
177
- // this.dialogPopUp.element.querySelector('.e-dlg-header').innerHTML = this.parent.localeObj.getConstant('details');
178
- setStyleAttribute(this.dialogPopUp.element, { 'visibility': 'visible' });
179
- if (this.parent.editSettings.allowEditing) {
180
- this.drillthroughKeyboardModule = new KeyboardEvents(this.dialogPopUp.element, {
181
- keyAction: this.drillthroughKeyActionHandler.bind(this),
182
- keyConfigs: this.drillKeyConfigs,
183
- eventName: 'keydown'
174
+ _this.isUpdated = false;
175
+ _this.gridIndexObjects = {};
176
+ },
177
+ isModal: true,
178
+ visible: true,
179
+ showCloseIcon: true,
180
+ locale: this.parent.locale,
181
+ enableRtl: this.parent.enableRtl,
182
+ width: this.parent.isAdaptive ? '100%' : '60%',
183
+ position: { X: 'center', Y: 'center' },
184
+ closeOnEscape: !this.parent.editSettings.allowEditing,
185
+ target: document.body,
186
+ close: this.removeDrillThroughDialog.bind(this)
184
187
  });
188
+ this.dialogPopUp.isStringTemplate = true;
189
+ this.dialogPopUp.appendTo(drillThroughDialog);
190
+ // this.dialogPopUp.element.querySelector('.e-dlg-header').innerHTML = this.parent.localeObj.getConstant('details');
191
+ setStyleAttribute(this.dialogPopUp.element, { 'visibility': 'visible' });
192
+ if (this.parent.editSettings.allowEditing) {
193
+ this.drillthroughKeyboardModule = new KeyboardEvents(this.dialogPopUp.element, {
194
+ keyAction: this.drillthroughKeyActionHandler.bind(this),
195
+ keyConfigs: this.drillKeyConfigs,
196
+ eventName: 'keydown'
197
+ });
198
+ }
185
199
  }
186
200
  }
201
+ catch (execption) {
202
+ this.parent.actionFailureMethod(execption);
203
+ }
187
204
  };
188
205
  DrillThroughDialog.prototype.editCell = function (eventArgs) {
189
206
  var _this = this;
@@ -199,6 +216,10 @@ var DrillThroughDialog = /** @class */ (function () {
199
216
  if (eventArgs.currentCell.actualText in previousData) {
200
217
  currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
201
218
  }
219
+ var actionInfo = {
220
+ editInfo: { type: 'Inline editing', action: 'update', data: this.gridData }
221
+ };
222
+ this.parent.actionObj.actionInfo = actionInfo;
202
223
  this.numericTextBox = new NumericTextBox({
203
224
  value: cellValue,
204
225
  enableRtl: this.parent.enableRtl,
@@ -263,6 +284,10 @@ var DrillThroughDialog = /** @class */ (function () {
263
284
  };
264
285
  DrillThroughDialog.prototype.removeDrillThroughDialog = function () {
265
286
  if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
287
+ this.parent.actionObj.actionName = events.drillThroughClosed;
288
+ if (this.parent.actionObj.actionName) {
289
+ this.parent.actionCompleteMethod();
290
+ }
266
291
  this.dialogPopUp.destroy();
267
292
  }
268
293
  var dialogElement = document.getElementById(this.parent.element.id + '_drillthrough');
@@ -275,6 +300,7 @@ var DrillThroughDialog = /** @class */ (function () {
275
300
  };
276
301
  /* eslint-disable */
277
302
  DrillThroughDialog.prototype.createDrillThroughGrid = function (eventArgs) {
303
+ var _this = this;
278
304
  var drillThroughBody = createElement('div', { id: this.parent.element.id + '_drillthroughbody', className: cls.DRILLTHROUGH_BODY_CLASS });
279
305
  var drillThroughBodyHeader = createElement('div', {
280
306
  id: this.parent.element.id +
@@ -352,31 +378,53 @@ var DrillThroughDialog = /** @class */ (function () {
352
378
  }
353
379
  if (this.parent.editSettings.allowEditing) {
354
380
  Grid.Inject(Edit, Page);
355
- this.drillThroughGrid.editSettings = this.parent.editSettings;
356
- if (this.parent.editSettings.allowCommandColumns) {
357
- this.drillThroughGrid.editSettings.mode = 'Normal';
358
- this.drillThroughGrid.editSettings.allowEditOnDblClick = false;
359
- Grid.Inject(CommandColumn);
381
+ try {
382
+ this.drillThroughGrid.editSettings = this.parent.editSettings;
383
+ this.drillThroughGrid.actionBegin = function (args) {
384
+ var actionName = (args.requestType == 'save') ? events.saveEditedRecords : (args.requestType == 'add') ? events.addNewRecord : (args.requestType == 'delete') ? events.removeRecord : '';
385
+ _this.parent.actionObj.actionName = actionName;
386
+ if (_this.parent.actionObj.actionName) {
387
+ if (_this.parent.actionBeginMethod()) {
388
+ return;
389
+ }
390
+ }
391
+ };
392
+ if (this.parent.editSettings.allowCommandColumns) {
393
+ this.drillThroughGrid.editSettings.mode = 'Normal';
394
+ this.drillThroughGrid.editSettings.allowEditOnDblClick = false;
395
+ Grid.Inject(CommandColumn);
396
+ this.drillThroughGrid.columns.push({
397
+ headerText: this.parent.localeObj.getConstant('manageRecords'), width: 160, showInColumnChooser: false,
398
+ commands: [
399
+ { type: 'Edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' } },
400
+ { type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' } },
401
+ { type: 'Save', buttonOption: { iconCss: 'e-icons e-update', cssClass: 'e-flat' } },
402
+ { type: 'Cancel', buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' } }
403
+ ]
404
+ });
405
+ }
406
+ else {
407
+ this.drillThroughGrid.editSettings.allowEditOnDblClick = this.parent.editSettings.allowEditOnDblClick;
408
+ }
360
409
  this.drillThroughGrid.columns.push({
361
- headerText: this.parent.localeObj.getConstant('manageRecords'), width: 160, showInColumnChooser: false,
362
- commands: [
363
- { type: 'Edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' } },
364
- { type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' } },
365
- { type: 'Save', buttonOption: { iconCss: 'e-icons e-update', cssClass: 'e-flat' } },
366
- { type: 'Cancel', buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' } }
367
- ]
410
+ field: '__index', visible: false, isPrimaryKey: true, type: 'string', showInColumnChooser: false
368
411
  });
369
412
  }
370
- else {
371
- this.drillThroughGrid.editSettings.allowEditOnDblClick = this.parent.editSettings.allowEditOnDblClick;
413
+ catch (execption) {
414
+ this.parent.actionFailureMethod(execption);
372
415
  }
373
- this.drillThroughGrid.columns.push({
374
- field: '__index', visible: false, isPrimaryKey: true, type: 'string', showInColumnChooser: false
375
- });
376
416
  this.drillThroughGrid.actionComplete = function (args) {
377
417
  if (args.requestType === 'batchsave' || args.requestType === 'save' || args.requestType === 'delete') {
378
418
  dialogModule.isUpdated = true;
379
419
  }
420
+ _this.parent.actionObj.actionName = _this.parent.getActionCompleteName();
421
+ var actionInfo = {
422
+ editInfo: { type: _this.drillThroughGrid.editSettings.mode, action: args.requestType, data: _this.gridData }
423
+ };
424
+ _this.parent.actionObj.actionInfo = actionInfo;
425
+ if (_this.parent.actionObj.actionName) {
426
+ _this.parent.actionCompleteMethod();
427
+ }
380
428
  if ((dialogModule.drillThroughGrid.editSettings.mode === 'Normal' && args.requestType === 'save' &&
381
429
  dialogModule.drillThroughGrid.element.querySelectorAll('.e-tbar-btn:hover').length > 0 &&
382
430
  !dialogModule.parent.editSettings.allowCommandColumns) || args.requestType === 'batchsave') {
@@ -73,4 +73,5 @@ export declare class FilterDialog {
73
73
  */
74
74
  closeFilterDialog(): void;
75
75
  private removeFilterDialog;
76
+ private setFocus;
76
77
  }
@@ -106,7 +106,6 @@ var FilterDialog = /** @class */ (function () {
106
106
  if (_this.allowExcelLikeFilter) {
107
107
  _this.dialogPopUp.element.querySelector('.e-dlg-closeicon-btn').focus();
108
108
  }
109
- _this.parent.control.pivotButtonModule.memberTreeView = _this.parent.filterDialog.memberTreeView;
110
109
  _this.memberTreeView.nodeChecked =
111
110
  _this.parent.control.pivotButtonModule.nodeStateModified.bind(_this.parent.control.pivotButtonModule);
112
111
  _this.allMemberSelect.nodeChecked =
@@ -1122,6 +1121,15 @@ var FilterDialog = /** @class */ (function () {
1122
1121
  if (this.dropMenu && !this.dropMenu.isDestroyed) {
1123
1122
  this.dropMenu.destroy();
1124
1123
  }
1124
+ if (this.memberTreeView && !this.memberTreeView.isDestroyed) {
1125
+ this.memberTreeView.destroy();
1126
+ }
1127
+ if (this.allMemberSelect && !this.allMemberSelect.isDestroyed) {
1128
+ this.allMemberSelect.destroy();
1129
+ }
1130
+ if (this.editorSearch && !this.editorSearch.isDestroyed) {
1131
+ this.editorSearch.destroy();
1132
+ }
1125
1133
  if (document.getElementById(this.parent.parentID + '_LevelDiv-popup')) {
1126
1134
  remove(document.getElementById(this.parent.parentID + '_LevelDiv-popup'));
1127
1135
  }
@@ -1130,11 +1138,24 @@ var FilterDialog = /** @class */ (function () {
1130
1138
  FilterDialog.prototype.removeFilterDialog = function () {
1131
1139
  if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
1132
1140
  this.dialogPopUp.destroy();
1141
+ setTimeout(this.setFocus.bind(this));
1133
1142
  }
1134
1143
  if (document.getElementById(this.parent.parentID + '_EditorTreeView')) {
1135
1144
  remove(document.getElementById(this.parent.parentID + '_EditorTreeView'));
1136
1145
  }
1137
1146
  };
1147
+ FilterDialog.prototype.setFocus = function () {
1148
+ if (this.parent.control.pivotButtonModule.parentElement) {
1149
+ var pivotButtons = [].slice.call(this.parent.control.pivotButtonModule.parentElement.querySelectorAll('.e-pivot-button'));
1150
+ for (var _i = 0, pivotButtons_1 = pivotButtons; _i < pivotButtons_1.length; _i++) {
1151
+ var item = pivotButtons_1[_i];
1152
+ if (item.getAttribute('data-uid') === this.parent.control.pivotButtonModule.fieldName) {
1153
+ item.focus();
1154
+ break;
1155
+ }
1156
+ }
1157
+ }
1158
+ };
1138
1159
  return FilterDialog;
1139
1160
  }());
1140
1161
  export { FilterDialog };
@@ -383,6 +383,10 @@ var NumberFormatting = /** @class */ (function () {
383
383
  this.parent.trigger(events.numberFormatting, eventArgs, function (observedArgs) {
384
384
  if (!observedArgs.cancel) {
385
385
  _this.parent.setProperties({ dataSourceSettings: { formatSettings: observedArgs.formatSettings } }, true);
386
+ var actionInfo = {
387
+ numberFormattingInfo: _this.parent.dataSourceSettings.formatSettings
388
+ };
389
+ _this.parent.actionObj.actionInfo = actionInfo;
386
390
  try {
387
391
  _this.parent.updateDataSource(false);
388
392
  _this.dialog.close();
@@ -4,6 +4,7 @@ import { Dialog } from '@syncfusion/ej2-popups';
4
4
  import { MaskedTextBox, NumericTextBox } from '@syncfusion/ej2-inputs';
5
5
  import { MultiSelect, CheckBoxSelection } from '@syncfusion/ej2-dropdowns';
6
6
  import { PivotUtil } from '../../base/util';
7
+ import { PivotExportUtil } from '../../base/export-util';
7
8
  import { CheckBox } from '@syncfusion/ej2-buttons';
8
9
  import { DateTimePicker } from '@syncfusion/ej2-calendars';
9
10
  import * as events from '../../common/base/constant';
@@ -599,7 +600,7 @@ var Grouping = /** @class */ (function () {
599
600
  for (var j = 0, len_1 = field.customGroups.length; j < len_1; j++) {
600
601
  if (field.customGroups[j]) {
601
602
  var group = field.customGroups[j];
602
- if (group.items && PivotUtil.isContainCommonElements(group.items, selectedOptions)) {
603
+ if (group.items && PivotExportUtil.isContainCommonElements(group.items, selectedOptions)) {
603
604
  splicedItems = this.mergeArray(splicedItems, [group.groupName]);
604
605
  newItems = this.mergeArray(newItems, group.items);
605
606
  field.customGroups.splice(j, 1);