@syncfusion/ej2-pivotview 19.3.55 → 19.4.41

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 (139) 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 +34 -28
  4. package/README.md +1 -1
  5. package/dist/ej2-pivotview.umd.min.js +2 -2
  6. package/dist/ej2-pivotview.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-pivotview.es2015.js +2068 -1096
  8. package/dist/es6/ej2-pivotview.es2015.js.map +1 -1
  9. package/dist/es6/ej2-pivotview.es5.js +2084 -1106
  10. package/dist/es6/ej2-pivotview.es5.js.map +1 -1
  11. package/dist/global/ej2-pivotview.min.js +2 -2
  12. package/dist/global/ej2-pivotview.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +22 -22
  15. package/src/base/engine.d.ts +17 -1
  16. package/src/base/engine.js +82 -29
  17. package/src/base/export-util.d.ts +17 -0
  18. package/src/base/export-util.js +245 -0
  19. package/src/base/olap/engine.d.ts +7 -0
  20. package/src/base/olap/engine.js +138 -35
  21. package/src/base/util.d.ts +0 -9
  22. package/src/base/util.js +2 -215
  23. package/src/common/actions/field-list.js +1 -1
  24. package/src/common/actions/pivot-button.d.ts +5 -8
  25. package/src/common/actions/pivot-button.js +188 -171
  26. package/src/common/base/constant.d.ts +186 -0
  27. package/src/common/base/constant.js +186 -0
  28. package/src/common/base/css-constant.d.ts +2 -0
  29. package/src/common/base/css-constant.js +2 -0
  30. package/src/common/base/enum.d.ts +11 -0
  31. package/src/common/base/interface.d.ts +272 -2
  32. package/src/common/calculatedfield/calculated-field.js +108 -93
  33. package/src/common/conditionalformatting/conditional-formatting.js +8 -2
  34. package/src/common/grouping-bar/grouping-bar.js +1 -1
  35. package/src/common/popups/aggregate-menu.js +57 -35
  36. package/src/common/popups/drillthrough-dialog.js +187 -139
  37. package/src/common/popups/filter-dialog.d.ts +1 -0
  38. package/src/common/popups/filter-dialog.js +22 -1
  39. package/src/common/popups/formatting-dialog.js +4 -0
  40. package/src/common/popups/grouping.js +2 -1
  41. package/src/common/popups/toolbar.js +305 -203
  42. package/src/pivotchart/base/pivotchart.js +36 -15
  43. package/src/pivotfieldlist/base/field-list-model.d.ts +49 -1
  44. package/src/pivotfieldlist/base/field-list.d.ts +55 -1
  45. package/src/pivotfieldlist/base/field-list.js +68 -1
  46. package/src/pivotfieldlist/renderer/dialog-renderer.js +38 -15
  47. package/src/pivotfieldlist/renderer/tree-renderer.js +35 -22
  48. package/src/pivotview/actions/drill-through.js +1 -1
  49. package/src/pivotview/actions/excel-export.js +9 -7
  50. package/src/pivotview/actions/pdf-export.js +3 -3
  51. package/src/pivotview/actions/virtualscroll.d.ts +1 -0
  52. package/src/pivotview/actions/virtualscroll.js +6 -2
  53. package/src/pivotview/base/pivotview-model.d.ts +46 -1
  54. package/src/pivotview/base/pivotview.d.ts +56 -2
  55. package/src/pivotview/base/pivotview.js +311 -107
  56. package/src/pivotview/model/chartsettings-model.d.ts +2 -2
  57. package/src/pivotview/model/chartsettings.d.ts +2 -2
  58. package/src/pivotview/model/chartsettings.js +2 -2
  59. package/src/pivotview/model/datasourcesettings-model.d.ts +8 -1
  60. package/src/pivotview/model/datasourcesettings.d.ts +7 -0
  61. package/src/pivotview/model/datasourcesettings.js +3 -0
  62. package/src/pivotview/renderer/render.d.ts +2 -1
  63. package/src/pivotview/renderer/render.js +39 -6
  64. package/styles/bootstrap-dark.css +115 -104
  65. package/styles/bootstrap.css +115 -104
  66. package/styles/bootstrap4.css +114 -81
  67. package/styles/bootstrap5-dark.css +220 -168
  68. package/styles/bootstrap5.css +215 -161
  69. package/styles/fabric-dark.css +117 -103
  70. package/styles/fabric.css +115 -102
  71. package/styles/highcontrast-light.css +116 -102
  72. package/styles/highcontrast.css +118 -104
  73. package/styles/material-dark.css +108 -97
  74. package/styles/material.css +108 -97
  75. package/styles/pivotfieldlist/_bootstrap-dark-definition.scss +1 -4
  76. package/styles/pivotfieldlist/_bootstrap-definition.scss +1 -4
  77. package/styles/pivotfieldlist/_bootstrap4-definition.scss +1 -4
  78. package/styles/pivotfieldlist/_bootstrap5-definition.scss +8 -11
  79. package/styles/pivotfieldlist/_fabric-dark-definition.scss +1 -4
  80. package/styles/pivotfieldlist/_fabric-definition.scss +1 -4
  81. package/styles/pivotfieldlist/_fluent-definition.scss +177 -0
  82. package/styles/pivotfieldlist/_highcontrast-definition.scss +1 -4
  83. package/styles/pivotfieldlist/_highcontrast-light-definition.scss +1 -4
  84. package/styles/pivotfieldlist/_layout.scss +199 -109
  85. package/styles/pivotfieldlist/_material-dark-definition.scss +1 -4
  86. package/styles/pivotfieldlist/_material-definition.scss +1 -4
  87. package/styles/pivotfieldlist/_tailwind-definition.scss +6 -9
  88. package/styles/pivotfieldlist/_theme.scss +185 -35
  89. package/styles/pivotfieldlist/bootstrap-dark.css +49 -58
  90. package/styles/pivotfieldlist/bootstrap.css +49 -58
  91. package/styles/pivotfieldlist/bootstrap4.css +44 -39
  92. package/styles/pivotfieldlist/bootstrap5-dark.css +115 -89
  93. package/styles/pivotfieldlist/bootstrap5.css +115 -89
  94. package/styles/pivotfieldlist/fabric-dark.css +49 -58
  95. package/styles/pivotfieldlist/fabric.css +49 -58
  96. package/styles/pivotfieldlist/highcontrast-light.css +49 -58
  97. package/styles/pivotfieldlist/highcontrast.css +49 -58
  98. package/styles/pivotfieldlist/icons/_bootstrap5.scss +2 -2
  99. package/styles/pivotfieldlist/icons/_fluent.scss +352 -0
  100. package/styles/pivotfieldlist/icons/_tailwind.scss +2 -2
  101. package/styles/pivotfieldlist/material-dark.css +44 -53
  102. package/styles/pivotfieldlist/material.css +44 -53
  103. package/styles/pivotfieldlist/tailwind-dark.css +138 -81
  104. package/styles/pivotfieldlist/tailwind.css +140 -83
  105. package/styles/pivotview/_bootstrap-dark-definition.scss +9 -6
  106. package/styles/pivotview/_bootstrap-definition.scss +9 -6
  107. package/styles/pivotview/_bootstrap4-definition.scss +10 -7
  108. package/styles/pivotview/_bootstrap5-definition.scss +12 -9
  109. package/styles/pivotview/_fabric-dark-definition.scss +8 -5
  110. package/styles/pivotview/_fabric-definition.scss +7 -4
  111. package/styles/pivotview/_fluent-definition.scss +126 -0
  112. package/styles/pivotview/_highcontrast-definition.scss +8 -5
  113. package/styles/pivotview/_highcontrast-light-definition.scss +7 -4
  114. package/styles/pivotview/_layout.scss +119 -64
  115. package/styles/pivotview/_material-dark-definition.scss +7 -4
  116. package/styles/pivotview/_material-definition.scss +8 -4
  117. package/styles/pivotview/_tailwind-definition.scss +8 -5
  118. package/styles/pivotview/_theme.scss +124 -70
  119. package/styles/pivotview/bootstrap-dark.css +66 -46
  120. package/styles/pivotview/bootstrap.css +66 -46
  121. package/styles/pivotview/bootstrap4.css +70 -42
  122. package/styles/pivotview/bootstrap5-dark.css +99 -73
  123. package/styles/pivotview/bootstrap5-dark.scss +0 -1
  124. package/styles/pivotview/bootstrap5.css +100 -72
  125. package/styles/pivotview/fabric-dark.css +68 -45
  126. package/styles/pivotview/fabric.css +66 -44
  127. package/styles/pivotview/highcontrast-light.css +67 -44
  128. package/styles/pivotview/highcontrast.css +69 -46
  129. package/styles/pivotview/icons/_bootstrap4.scss +1 -1
  130. package/styles/pivotview/icons/_bootstrap5.scss +1 -1
  131. package/styles/pivotview/icons/_fluent.scss +183 -0
  132. package/styles/pivotview/icons/_tailwind.scss +1 -1
  133. package/styles/pivotview/material-dark.css +64 -44
  134. package/styles/pivotview/material.css +64 -44
  135. package/styles/pivotview/tailwind-dark.css +106 -58
  136. package/styles/pivotview/tailwind-dark.scss +0 -1
  137. package/styles/pivotview/tailwind.css +107 -57
  138. package/styles/tailwind-dark.css +250 -145
  139. package/styles/tailwind.css +247 -140
@@ -313,6 +313,8 @@ var PivotView = /** @class */ (function (_super) {
313
313
  _this_1.request = new XMLHttpRequest();
314
314
  /** @hidden */
315
315
  _this_1.isServerWaitingPopup = false;
316
+ /** @hidden */
317
+ _this_1.actionObj = {};
316
318
  _this_1.pivotView = _this_1;
317
319
  setValue('mergePersistData', _this_1.mergePersistPivotData, _this_1);
318
320
  return _this_1;
@@ -355,10 +357,10 @@ var PivotView = /** @class */ (function (_super) {
355
357
  modules.push({ args: [this], member: 'grouping' });
356
358
  }
357
359
  if (this.allowDrillThrough || (this.editSettings && this.editSettings.allowEditing)) {
358
- modules.push({ args: [this], member: 'drillthrough' });
360
+ modules.push({ args: [this], member: 'drillThrough' });
359
361
  }
360
362
  if (this.displayOption.view !== 'Table') {
361
- modules.push({ args: [this], member: 'pivotchart' });
363
+ modules.push({ args: [this], member: 'pivotChart' });
362
364
  }
363
365
  return modules;
364
366
  };
@@ -938,7 +940,7 @@ var PivotView = /** @class */ (function (_super) {
938
940
  this.setProperties({ gridSettings: { allowSelection: true, selectionSettings: { cellSelectionMode: 'Box', mode: 'Cell', type: 'Multiple' } } }, true);
939
941
  }
940
942
  if (this.displayOption.view !== 'Table') {
941
- this.chartModule = new PivotChart();
943
+ this.pivotChartModule = new PivotChart();
942
944
  }
943
945
  this.currentView = this.currentView ? this.currentView : (this.displayOption.view === 'Both' ?
944
946
  this.displayOption.primary : this.displayOption.view);
@@ -1205,32 +1207,37 @@ var PivotView = /** @class */ (function (_super) {
1205
1207
  };
1206
1208
  PivotView.prototype.initialLoad = function () {
1207
1209
  var _this_1 = this;
1208
- this.cellTemplateFn = this.templateParser(this.cellTemplate);
1209
- this.tooltipTemplateFn = this.templateParser(this.tooltipTemplate);
1210
- if (this.spinnerTemplate) {
1211
- createSpinner({ target: this.element, template: this.spinnerTemplate }, this.createElement);
1210
+ try {
1211
+ this.cellTemplateFn = this.templateParser(this.cellTemplate);
1212
+ this.tooltipTemplateFn = this.templateParser(this.tooltipTemplate);
1213
+ if (this.spinnerTemplate) {
1214
+ createSpinner({ target: this.element, template: this.spinnerTemplate }, this.createElement);
1215
+ }
1216
+ else {
1217
+ createSpinner({ target: this.element }, this.createElement);
1218
+ }
1219
+ var loadArgs = {
1220
+ dataSourceSettings: this.dataSourceSettings,
1221
+ pivotview: this,
1222
+ fieldsType: {}
1223
+ };
1224
+ this.trigger(events.load, loadArgs, function (observedArgs) {
1225
+ _this_1.dataSourceSettings = observedArgs.dataSourceSettings;
1226
+ _this_1.fieldsType = observedArgs.fieldsType;
1227
+ _this_1.updateClass();
1228
+ _this_1.notify(events.initSubComponent, {});
1229
+ if (_this_1.dataSourceSettings.mode !== 'Server') {
1230
+ _this_1.notify(events.initialLoad, {});
1231
+ }
1232
+ if (_this_1.isAdaptive) {
1233
+ _this_1.contextMenuModule.render();
1234
+ }
1235
+ _this_1.notify(events.initToolbar, {});
1236
+ });
1212
1237
  }
1213
- else {
1214
- createSpinner({ target: this.element }, this.createElement);
1238
+ catch (execption) {
1239
+ this.actionFailureMethod(execption);
1215
1240
  }
1216
- var loadArgs = {
1217
- dataSourceSettings: this.dataSourceSettings,
1218
- pivotview: this,
1219
- fieldsType: {}
1220
- };
1221
- this.trigger(events.load, loadArgs, function (observedArgs) {
1222
- _this_1.dataSourceSettings = observedArgs.dataSourceSettings;
1223
- _this_1.fieldsType = observedArgs.fieldsType;
1224
- _this_1.updateClass();
1225
- _this_1.notify(events.initSubComponent, {});
1226
- if (_this_1.dataSourceSettings.mode !== 'Server') {
1227
- _this_1.notify(events.initialLoad, {});
1228
- }
1229
- if (_this_1.isAdaptive) {
1230
- _this_1.contextMenuModule.render();
1231
- }
1232
- _this_1.notify(events.initToolbar, {});
1233
- });
1234
1241
  };
1235
1242
  /**
1236
1243
  * Register the internal events.
@@ -1261,12 +1268,32 @@ var PivotView = /** @class */ (function (_super) {
1261
1268
  /* eslint-disable */
1262
1269
  var columnRender = this.gridSettings['columnRender'];
1263
1270
  var chartLoadEvent = this.chartSettings['load'];
1271
+ var chartLoadedEvent = this.chartSettings['loaded'];
1272
+ var chartTextRenderEvent = this.chartSettings['textRender'];
1273
+ var chartPointRenderEvent = this.chartSettings['pointRender'];
1274
+ var chartSeriesRenderEvent = this.chartSettings['seriesRender'];
1275
+ var chartLegendRenderEvent = this.chartSettings['legendRender'];
1276
+ var chartPointClickEvent = this.chartSettings['pointClick'];
1277
+ var chartTooltipRenderEvent = this.chartSettings['tooltipRender'];
1264
1278
  this.gridSettings['columnRender'] = undefined;
1265
1279
  this.chartSettings['tooltipRender'] = undefined;
1266
1280
  this.chartSettings['load'] = undefined;
1281
+ this.chartSettings['loaded'] = undefined;
1282
+ this.chartSettings['textRender'] = undefined;
1283
+ this.chartSettings['pointRender'] = undefined;
1284
+ this.chartSettings['seriesRender'] = undefined;
1285
+ this.chartSettings['legendRender'] = undefined;
1286
+ this.chartSettings['pointClick'] = undefined;
1267
1287
  var persistData = this.addOnPersist(keyEntity);
1268
1288
  this.gridSettings['columnRender'] = columnRender;
1269
1289
  this.chartSettings['load'] = chartLoadEvent;
1290
+ this.chartSettings['loaded'] = chartLoadedEvent;
1291
+ this.chartSettings['textRender'] = chartTextRenderEvent;
1292
+ this.chartSettings['pointRender'] = chartPointRenderEvent;
1293
+ this.chartSettings['seriesRender'] = chartSeriesRenderEvent;
1294
+ this.chartSettings['legendRender'] = chartLegendRenderEvent;
1295
+ this.chartSettings['pointClick'] = chartPointClickEvent;
1296
+ this.chartSettings['tooltipRender'] = chartTooltipRenderEvent;
1270
1297
  /* eslint-enable */
1271
1298
  return persistData;
1272
1299
  };
@@ -1449,15 +1476,15 @@ var PivotView = /** @class */ (function (_super) {
1449
1476
  if (!this.grid && newProp.displayOption.view !== 'Chart') {
1450
1477
  this.renderEmptyGrid();
1451
1478
  if (newProp.displayOption.view === 'Table') {
1452
- if (this.chartModule) {
1453
- this.chartModule.destroy();
1479
+ if (this.pivotChartModule) {
1480
+ this.pivotChartModule.destroy();
1454
1481
  this.chart = undefined;
1455
- this.chartModule = undefined;
1482
+ this.pivotChartModule = undefined;
1456
1483
  }
1457
1484
  }
1458
1485
  }
1459
- else if (!this.chartModule && this.displayOption.view !== 'Table') {
1460
- this.chartModule = new PivotChart();
1486
+ else if (!this.pivotChartModule && this.displayOption.view !== 'Table') {
1487
+ this.pivotChartModule = new PivotChart();
1461
1488
  }
1462
1489
  }
1463
1490
  else if (this.showToolbar && !isNullOrUndefined(newProp.displayOption) && newProp.displayOption.view) {
@@ -1487,12 +1514,12 @@ var PivotView = /** @class */ (function (_super) {
1487
1514
  (newProp.chartSettings.chartSeries && Object.keys(newProp.chartSettings.chartSeries).indexOf('type') !== -1))) {
1488
1515
  this.groupingBarModule.renderLayout();
1489
1516
  }
1490
- if (isNullOrUndefined(this.chartModule) && this.displayOption.view !== 'Table') {
1491
- this.chartModule = new PivotChart();
1517
+ if (isNullOrUndefined(this.pivotChartModule) && this.displayOption.view !== 'Table') {
1518
+ this.pivotChartModule = new PivotChart();
1492
1519
  }
1493
1520
  var engineModule = this.dataType === 'pivot' ? this.engineModule : this.olapEngineModule;
1494
- if (!isNullOrUndefined(this.chartModule) && !isNullOrUndefined(engineModule.pivotValues)) {
1495
- this.chartModule.loadChart(this, this.chartSettings);
1521
+ if (!isNullOrUndefined(this.pivotChartModule) && !isNullOrUndefined(engineModule.pivotValues)) {
1522
+ this.pivotChartModule.loadChart(this, this.chartSettings);
1496
1523
  }
1497
1524
  if (!isNullOrUndefined(engineModule.pivotValues) && !isNullOrUndefined(engineModule.fieldList)) {
1498
1525
  this.notify(events.uiUpdate, this);
@@ -1519,6 +1546,9 @@ var PivotView = /** @class */ (function (_super) {
1519
1546
  if (this.element.querySelector('.e-grouping-bar')) {
1520
1547
  this.element.querySelector('.e-grouping-bar').remove();
1521
1548
  }
1549
+ else if (this.groupingBarModule) {
1550
+ this.groupingBarModule.renderLayout();
1551
+ }
1522
1552
  if (isNullOrUndefined(newProp.showFieldList))
1523
1553
  this.renderPivotGrid();
1524
1554
  break;
@@ -1612,9 +1642,9 @@ var PivotView = /** @class */ (function (_super) {
1612
1642
  */
1613
1643
  PivotView.prototype.renderPivotGrid = function () {
1614
1644
  this.clearTemplate();
1615
- if (this.chartModule) {
1616
- this.chartModule.engineModule = this.engineModule;
1617
- this.chartModule.loadChart(this, this.chartSettings);
1645
+ if (this.pivotChartModule) {
1646
+ this.pivotChartModule.engineModule = this.engineModule;
1647
+ this.pivotChartModule.loadChart(this, this.chartSettings);
1618
1648
  if (this.enableRtl && this.chart && document.body.getAttribute('dir') !== 'rtl') {
1619
1649
  addClass([this.chart.element], cls.PIVOTCHART_LTR);
1620
1650
  }
@@ -1645,7 +1675,7 @@ var PivotView = /** @class */ (function (_super) {
1645
1675
  this.applyHyperlinkSettings();
1646
1676
  }
1647
1677
  this.renderModule = this.renderModule ? this.renderModule : new Render(this);
1648
- this.renderModule.render();
1678
+ this.renderModule.render(true);
1649
1679
  }
1650
1680
  else if (this.grid) {
1651
1681
  remove(this.grid.element);
@@ -1661,7 +1691,9 @@ var PivotView = /** @class */ (function (_super) {
1661
1691
  if (this.toolbarModule && this.toolbarModule.toolbar) {
1662
1692
  this.toolbarModule.toolbar.width = this.getGridWidthAsNumber() - 2;
1663
1693
  }
1664
- this.chart.element.style.width = formatUnit(this.getGridWidthAsNumber());
1694
+ if (this.chartSettings.enableScrollOnMultiAxis && this.chartSettings.enableMultipleAxis) {
1695
+ this.element.querySelector('.' + cls.PIVOTCHART).style.width = formatUnit(this.getGridWidthAsNumber());
1696
+ }
1665
1697
  this.chart.width = formatUnit(this.getGridWidthAsNumber());
1666
1698
  if (this.currentView === 'Table') {
1667
1699
  this.grid.element.style.display = '';
@@ -1681,7 +1713,13 @@ var PivotView = /** @class */ (function (_super) {
1681
1713
  }
1682
1714
  if (this.toolbarModule) {
1683
1715
  if (this.showFieldList && select('#' + this.element.id + '_PivotFieldList', this.element)) {
1684
- select('#' + this.element.id + '_PivotFieldList', this.element).style.display = 'none';
1716
+ if (this.toolbar && this.toolbar.indexOf('FieldList') !== -1) {
1717
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.display = 'none';
1718
+ }
1719
+ else {
1720
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.top = this.element.querySelector('.' + cls.GRID_TOOLBAR).offsetHeight.toString() + 'px';
1721
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.position = 'relative';
1722
+ }
1685
1723
  }
1686
1724
  if (this.toolbar && this.toolbar.indexOf('FieldList') !== -1 &&
1687
1725
  this.showToolbar && this.element.querySelector('.e-toggle-field-list')) {
@@ -1834,7 +1872,9 @@ var PivotView = /** @class */ (function (_super) {
1834
1872
  isDrillThrough: (pivot.allowDrillThrough || pivot.editSettings.allowEditing),
1835
1873
  localeObj: pivot.localeObj,
1836
1874
  fieldsType: pivot.fieldsType,
1837
- clonedReport: pivot.clonedReport
1875
+ clonedReport: pivot.clonedReport,
1876
+ globalize: pivot.globalize,
1877
+ currenyCode: pivot.currencyCode
1838
1878
  };
1839
1879
  /* eslint-enable @typescript-eslint/indent */
1840
1880
  if (pivot.dataSourceSettings.mode === 'Server') {
@@ -1884,6 +1924,14 @@ var PivotView = /** @class */ (function (_super) {
1884
1924
  this.exportType = 'Excel';
1885
1925
  this.grid.excelExport(excelExportProperties, isMultipleExport, workbook, isBlob);
1886
1926
  }
1927
+ this.actionObj.actionName = this.getActionCompleteName();
1928
+ var actionInfo = {
1929
+ exportInfo: { type: this.exportType, info: excelExportProperties }
1930
+ };
1931
+ this.actionObj.actionInfo = actionInfo;
1932
+ if (this.actionObj.actionName) {
1933
+ this.actionCompleteMethod();
1934
+ }
1887
1935
  };
1888
1936
  /**
1889
1937
  * Export PivotGrid data to CSV file.
@@ -1901,6 +1949,14 @@ var PivotView = /** @class */ (function (_super) {
1901
1949
  this.exportType = 'CSV';
1902
1950
  this.grid.csvExport(excelExportProperties, isMultipleExport, workbook, isBlob);
1903
1951
  }
1952
+ this.actionObj.actionName = this.getActionCompleteName();
1953
+ var actionInfo = {
1954
+ exportInfo: { type: this.exportType, info: excelExportProperties }
1955
+ };
1956
+ this.actionObj.actionInfo = actionInfo;
1957
+ if (this.actionObj.actionName) {
1958
+ this.actionCompleteMethod();
1959
+ }
1904
1960
  };
1905
1961
  /**
1906
1962
  * Export Pivot widget data to PDF document.
@@ -1917,6 +1973,14 @@ var PivotView = /** @class */ (function (_super) {
1917
1973
  else {
1918
1974
  this.grid.pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
1919
1975
  }
1976
+ this.actionObj.actionName = this.getActionCompleteName();
1977
+ var actionInfo = {
1978
+ exportInfo: { type: 'PDF', info: pdfExportProperties }
1979
+ };
1980
+ this.actionObj.actionInfo = actionInfo;
1981
+ if (this.actionObj.actionName) {
1982
+ this.actionCompleteMethod();
1983
+ }
1920
1984
  };
1921
1985
  /**
1922
1986
  * Export method for the chart.
@@ -1931,6 +1995,14 @@ var PivotView = /** @class */ (function (_super) {
1931
1995
  if (this.chart && this.chart.enableExport) {
1932
1996
  this.chart.exportModule.export(type, fileName, orientation, null, width, height);
1933
1997
  }
1998
+ this.actionObj.actionName = this.getActionCompleteName();
1999
+ var actionInfo = {
2000
+ exportInfo: { type: type, info: fileName }
2001
+ };
2002
+ this.actionObj.actionInfo = actionInfo;
2003
+ if (this.actionObj.actionName) {
2004
+ this.actionCompleteMethod();
2005
+ }
1934
2006
  };
1935
2007
  /**
1936
2008
  * Print method for the chart.
@@ -2042,6 +2114,10 @@ var PivotView = /** @class */ (function (_super) {
2042
2114
  };
2043
2115
  _this_1.trigger(events.enginePopulated, eventArgs);
2044
2116
  pivot_1.engineModule.pivotValues = eventArgs.pivotValues;
2117
+ var actionInfo = {
2118
+ drillInfo: drilledItem_1
2119
+ };
2120
+ _this_1.actionObj.actionInfo = actionInfo;
2045
2121
  pivot_1.renderPivotGrid();
2046
2122
  }
2047
2123
  else {
@@ -2394,6 +2470,12 @@ var PivotView = /** @class */ (function (_super) {
2394
2470
  this.unwireEvents();
2395
2471
  this.wireEvents();
2396
2472
  this.isChartLoaded = false;
2473
+ this.actionObj.actionName = this.getActionCompleteName();
2474
+ if (this.actionObj.actionName) {
2475
+ if (this.actionObj.actionName !== events.windowResize) {
2476
+ this.actionCompleteMethod();
2477
+ }
2478
+ }
2397
2479
  };
2398
2480
  PivotView.prototype.setToolTip = function (args) {
2399
2481
  var colIndex = Number(args.target.getAttribute('aria-colindex'));
@@ -2425,6 +2507,13 @@ var PivotView = /** @class */ (function (_super) {
2425
2507
  if (cell && this.engineModule.fieldList[cell.actualText]) {
2426
2508
  var field = this.engineModule.fieldList[cell.actualText];
2427
2509
  aggregateType = field.aggregateType;
2510
+ if ((aggregateType !== 'DistinctCount') && (field.type !== 'number' || field.type === 'include' ||
2511
+ field.type === 'exclude')) {
2512
+ aggregateType = 'Count';
2513
+ }
2514
+ else {
2515
+ aggregateType = (aggregateType === undefined) ? 'Sum' : field.aggregateType;
2516
+ }
2428
2517
  caption = field.caption;
2429
2518
  hasField = true;
2430
2519
  }
@@ -2644,76 +2733,105 @@ var PivotView = /** @class */ (function (_super) {
2644
2733
  ele = target.parentElement.parentElement;
2645
2734
  }
2646
2735
  this.CellClicked(target, e);
2647
- if ((ele.parentElement.parentElement.parentElement.parentElement.classList.contains('e-movableheader')
2648
- && this.dataSourceSettings.valueAxis === 'column') || (ele.parentElement.classList.contains('e-row') &&
2649
- this.dataSourceSettings.valueAxis === 'row') && (ele.classList.contains('e-rowsheader') ||
2650
- ele.classList.contains('e-stot'))) {
2651
- var colIndex = Number(ele.getAttribute('aria-colindex'));
2652
- var rowIndex = Number(ele.getAttribute('index'));
2653
- if (this.dataSourceSettings.valueAxis === 'row' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
2654
- var header = this.pivotValues[rowIndex][colIndex];
2655
- if (this.dataSourceSettings.valueIndex === -1) {
2656
- rowIndex = header.type === 'value' ? rowIndex : (rowIndex + 1);
2657
- }
2658
- else {
2659
- var level = this.getLevel(header);
2660
- rowIndex = (level <= this.engineModule.measureIndex &&
2661
- header.members && header.members.length > 0) ? header.members[0].rowIndex : rowIndex;
2736
+ try {
2737
+ if ((ele.parentElement.parentElement.parentElement.parentElement.classList.contains('e-movableheader')
2738
+ && this.dataSourceSettings.valueAxis === 'column') || (ele.parentElement.classList.contains('e-row') &&
2739
+ this.dataSourceSettings.valueAxis === 'row') && (ele.classList.contains('e-rowsheader') ||
2740
+ ele.classList.contains('e-stot'))) {
2741
+ var FieldName = target.parentElement.getAttribute('fieldname');
2742
+ var fieldInfo = PivotUtil.getFieldInfo(FieldName, this);
2743
+ this.actionObj.actionName = events.sortValue;
2744
+ this.actionObj.fieldInfo = fieldInfo.fieldItem;
2745
+ if (this.actionBeginMethod()) {
2746
+ return;
2662
2747
  }
2663
- }
2664
- else if (this.dataSourceSettings.valueAxis === 'column' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
2665
- colIndex = (Number(ele.getAttribute('aria-colindex')) + Number(ele.getAttribute('aria-colspan')) - 1);
2666
- rowIndex = this.engineModule.headerContent.length - 1;
2667
- }
2668
- this.setProperties({
2669
- dataSourceSettings: {
2670
- valueSortSettings: {
2671
- columnIndex: (Number(ele.getAttribute('aria-colindex')) +
2672
- Number(ele.getAttribute('aria-colspan')) - 1),
2673
- sortOrder: this.dataSourceSettings.valueSortSettings.sortOrder === 'Descending' ? 'Ascending' : 'Descending',
2674
- headerText: this.pivotValues[rowIndex][colIndex].valueSort.levelName,
2675
- headerDelimiter: this.dataSourceSettings.valueSortSettings.headerDelimiter ?
2676
- this.dataSourceSettings.valueSortSettings.headerDelimiter : '.'
2748
+ var colIndex = Number(ele.getAttribute('aria-colindex'));
2749
+ var rowIndex = Number(ele.getAttribute('index'));
2750
+ if (this.dataSourceSettings.valueAxis === 'row' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
2751
+ var header = this.pivotValues[rowIndex][colIndex];
2752
+ if (this.dataSourceSettings.valueIndex === -1) {
2753
+ rowIndex = header.type === 'value' ? rowIndex : (rowIndex + 1);
2754
+ }
2755
+ else {
2756
+ var level = this.getLevel(header);
2757
+ rowIndex = (level <= this.engineModule.measureIndex &&
2758
+ header.members && header.members.length > 0) ? header.members[0].rowIndex : rowIndex;
2677
2759
  }
2678
2760
  }
2679
- }, true);
2680
- this.showWaitingPopup();
2681
- var pivot = this; /* eslint-disable-line */
2682
- pivot.engineModule.enableValueSorting = true;
2683
- if (pivot.enableVirtualization) {
2684
- if (pivot.dataSourceSettings.enableSorting) {
2685
- for (var _i = 0, _a = Object.keys(pivot.engineModule.fieldList); _i < _a.length; _i++) {
2686
- var key = _a[_i];
2687
- pivot.engineModule.fieldList[key].sort = 'Ascending';
2761
+ else if (this.dataSourceSettings.valueAxis === 'column' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
2762
+ colIndex = (Number(ele.getAttribute('aria-colindex')) + Number(ele.getAttribute('aria-colspan')) - 1);
2763
+ rowIndex = this.engineModule.headerContent.length - 1;
2764
+ }
2765
+ this.setProperties({
2766
+ dataSourceSettings: {
2767
+ valueSortSettings: {
2768
+ columnIndex: (Number(ele.getAttribute('aria-colindex')) +
2769
+ Number(ele.getAttribute('aria-colspan')) - 1),
2770
+ sortOrder: this.dataSourceSettings.valueSortSettings.sortOrder === 'Descending' ? 'Ascending' : 'Descending',
2771
+ headerText: this.pivotValues[rowIndex][colIndex].valueSort.levelName,
2772
+ headerDelimiter: this.dataSourceSettings.valueSortSettings.headerDelimiter ?
2773
+ this.dataSourceSettings.valueSortSettings.headerDelimiter : '.'
2774
+ }
2775
+ }
2776
+ }, true);
2777
+ this.showWaitingPopup();
2778
+ var pivot = this; /* eslint-disable-line */
2779
+ pivot.engineModule.enableValueSorting = true;
2780
+ if (pivot.enableVirtualization) {
2781
+ if (pivot.dataSourceSettings.enableSorting) {
2782
+ for (var _i = 0, _a = Object.keys(pivot.engineModule.fieldList); _i < _a.length; _i++) {
2783
+ var key = _a[_i];
2784
+ pivot.engineModule.fieldList[key].sort = 'Ascending';
2785
+ }
2786
+ pivot.setProperties({ dataSourceSettings: { sortSettings: [] } }, true);
2787
+ }
2788
+ if (pivot.dataSourceSettings.mode === 'Server') {
2789
+ pivot.getEngine('onValueSort', null, null, null, null, null, null);
2790
+ }
2791
+ else {
2792
+ pivot.engineModule.rMembers = pivot.engineModule.headerCollection.rowHeaders;
2793
+ pivot.engineModule.cMembers = pivot.engineModule.headerCollection.columnHeaders;
2794
+ pivot.engineModule.applyValueSorting();
2795
+ pivot.engineModule.updateEngine();
2688
2796
  }
2689
- pivot.setProperties({ dataSourceSettings: { sortSettings: [] } }, true);
2690
2797
  }
2691
- if (pivot.dataSourceSettings.mode === 'Server') {
2798
+ else if (pivot.dataSourceSettings.mode === 'Server') {
2692
2799
  pivot.getEngine('onValueSort', null, null, null, null, null, null);
2693
2800
  }
2694
2801
  else {
2695
- pivot.engineModule.rMembers = pivot.engineModule.headerCollection.rowHeaders;
2696
- pivot.engineModule.cMembers = pivot.engineModule.headerCollection.columnHeaders;
2697
- pivot.engineModule.applyValueSorting();
2698
- pivot.engineModule.updateEngine();
2802
+ pivot.engineModule.generateGridData(pivot.dataSourceSettings, true);
2699
2803
  }
2804
+ pivot.allowServerDataBinding = false;
2805
+ pivot.setProperties({ pivotValues: pivot.engineModule.pivotValues }, true);
2806
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2807
+ delete pivot.bulkChanges.pivotValues;
2808
+ pivot.allowServerDataBinding = true;
2809
+ var actionInfo = {
2810
+ valueSortInfo: this.engineModule.valueSortSettings
2811
+ };
2812
+ this.actionObj.actionInfo = actionInfo;
2813
+ pivot.renderPivotGrid();
2700
2814
  }
2701
- else if (pivot.dataSourceSettings.mode === 'Server') {
2702
- pivot.getEngine('onValueSort', null, null, null, null, null, null);
2703
- }
2704
- else {
2705
- pivot.engineModule.generateGridData(pivot.dataSourceSettings, true);
2706
- }
2707
- pivot.allowServerDataBinding = false;
2708
- pivot.setProperties({ pivotValues: pivot.engineModule.pivotValues }, true);
2709
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2710
- delete pivot.bulkChanges.pivotValues;
2711
- pivot.allowServerDataBinding = true;
2712
- pivot.renderPivotGrid();
2815
+ }
2816
+ catch (execption) {
2817
+ this.actionFailureMethod(execption);
2713
2818
  }
2714
2819
  }
2715
2820
  else if (target.classList.contains(cls.COLLAPSE) || target.classList.contains(cls.EXPAND)) {
2716
- this.onDrill(target);
2821
+ var drillFieldName = target.parentElement.getAttribute('fieldname');
2822
+ var fieldInfo = PivotUtil.getFieldInfo(drillFieldName, this);
2823
+ var actionName = target.classList.contains(cls.COLLAPSE) ? this.actionObj.actionName = events.drillUp : target.classList.contains(cls.EXPAND) ? this.actionObj.actionName = events.drillDown : '';
2824
+ this.actionObj.actionName = actionName;
2825
+ this.actionObj.fieldInfo = fieldInfo.fieldItem;
2826
+ if (this.actionBeginMethod()) {
2827
+ return;
2828
+ }
2829
+ try {
2830
+ this.onDrill(target);
2831
+ }
2832
+ catch (execption) {
2833
+ this.actionFailureMethod(execption);
2834
+ }
2717
2835
  }
2718
2836
  else {
2719
2837
  this.CellClicked(target, e);
@@ -2815,7 +2933,8 @@ var PivotView = /** @class */ (function (_super) {
2815
2933
  var firstColWidth = this.pivotColumns[0].width;
2816
2934
  var eventArgs = {
2817
2935
  columns: this.pivotColumns,
2818
- dataSourceSettings: this.dataSourceSettings
2936
+ dataSourceSettings: this.dataSourceSettings,
2937
+ stackedColumns: this.getStackedColumns(gridcolumns, [])
2819
2938
  };
2820
2939
  this.trigger(events.beforeColumnsRender, eventArgs);
2821
2940
  if (this.enableVirtualization && eventArgs.columns.length > 0 && eventArgs.columns[0].width !== gridcolumns[0].width) {
@@ -2920,8 +3039,16 @@ var PivotView = /** @class */ (function (_super) {
2920
3039
  /* eslint-disable-next-line */
2921
3040
  /** @hidden */
2922
3041
  PivotView.prototype.onWindowResize = function () {
3042
+ this.actionObj.actionName = events.windowResize;
3043
+ if (this.actionBeginMethod()) {
3044
+ return;
3045
+ }
2923
3046
  clearTimeout(this.timeOutObj);
2924
3047
  this.timeOutObj = setTimeout(this.layoutRefresh.bind(this), 500);
3048
+ this.actionObj.actionName = this.getActionCompleteName();
3049
+ if (this.actionObj.actionName) {
3050
+ this.actionCompleteMethod();
3051
+ }
2925
3052
  };
2926
3053
  /**
2927
3054
  * Refreshes the Pivot Table for blazor layoutRefresh is called for other base refresh is called.
@@ -3316,7 +3443,9 @@ var PivotView = /** @class */ (function (_super) {
3316
3443
  isDrillThrough: (_this_1.allowDrillThrough || _this_1.editSettings.allowEditing),
3317
3444
  localeObj: _this_1.localeObj,
3318
3445
  fieldsType: _this_1.fieldsType,
3319
- clonedReport: _this_1.clonedReport
3446
+ clonedReport: _this_1.clonedReport,
3447
+ globalize: _this_1.globalize,
3448
+ currenyCode: _this_1.currencyCode
3320
3449
  };
3321
3450
  if (_this_1.dataType === 'pivot') {
3322
3451
  if (_this_1.dataSourceSettings.groupSettings && _this_1.dataSourceSettings.groupSettings.length > 0) {
@@ -3542,7 +3671,8 @@ var PivotView = /** @class */ (function (_super) {
3542
3671
  var str = 'color: ' + format[k].style.color + '!important;background-color: ' + format[k].style.backgroundColor +
3543
3672
  '!important;font-size: ' + format[k].style.fontSize + '!important;font-family: ' + format[k].style.fontFamily +
3544
3673
  ' !important;';
3545
- sheet.insertRule('.format' + this.element.id + k + '{' + str + '}', 0);
3674
+ var formatClass = '.format' + this.element.id + k;
3675
+ sheet.insertRule(formatClass + ', ' + formatClass + ' .e-cellvalue' + '{' + str + '}', 0);
3546
3676
  }
3547
3677
  }
3548
3678
  };
@@ -3769,6 +3899,65 @@ var PivotView = /** @class */ (function (_super) {
3769
3899
  EventHandler.remove(document, this.isAdaptive ? 'touchend' : 'click', this.removeButtonFocus);
3770
3900
  window.removeEventListener('resize', this.onWindowResize.bind(this), true);
3771
3901
  };
3902
+ /** @hidden */
3903
+ PivotView.prototype.actionBeginMethod = function () {
3904
+ var eventArgs = {
3905
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
3906
+ actionName: this.actionObj.actionName,
3907
+ fieldInfo: this.actionObj.fieldInfo,
3908
+ cancel: false
3909
+ };
3910
+ this.trigger(events.actionBegin, eventArgs);
3911
+ return eventArgs.cancel;
3912
+ };
3913
+ /** @hidden */
3914
+ PivotView.prototype.actionCompleteMethod = function () {
3915
+ var eventArgs = {
3916
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
3917
+ actionName: this.actionObj.actionName,
3918
+ fieldInfo: this.actionObj.fieldInfo,
3919
+ actionInfo: this.actionObj.actionInfo
3920
+ };
3921
+ this.trigger(events.actionComplete, eventArgs);
3922
+ this.actionObj.actionName = '';
3923
+ this.actionObj.actionInfo = undefined;
3924
+ this.actionObj.fieldInfo = undefined;
3925
+ };
3926
+ /** @hidden */
3927
+ PivotView.prototype.actionFailureMethod = function (error) {
3928
+ var eventArgs = {
3929
+ actionName: this.actionObj.actionName,
3930
+ errorInfo: error
3931
+ };
3932
+ this.trigger(events.actionFailure, eventArgs);
3933
+ };
3934
+ /** @hidden */
3935
+ PivotView.prototype.getActionCompleteName = function () {
3936
+ var actionName = (this.actionObj.actionName == events.openConditionalFormatting) ? events.conditionallyFormatted : (this.actionObj.actionName == events.openNumberFormatting) ? events.numberFormatted
3937
+ : (this.actionObj.actionName == events.tableView) ? events.tableViewed : (this.actionObj.actionName == events.chartView) ? events.chartViewed : (this.actionObj.actionName == events.hideSubTotals) ? events.subTotalsHidden : (this.actionObj.actionName == events.subTotalsRow) ? events.subTotalsRowShown
3938
+ : (this.actionObj.actionName == events.subTotalsColumn) ? events.subTotalsColumnShown : (this.actionObj.actionName == events.showSubTotals) ? events.subTotalsShown : (this.actionObj.actionName == events.hideGrandTotals) ? events.grandTotalsHidden
3939
+ : (this.actionObj.actionName == events.grandTotalsRow) ? events.grandTotalsRowShown : (this.actionObj.actionName == events.grandTotalsColumn) ? events.grandTotalsColumnShown : (this.actionObj.actionName == events.showGrandTotals) ? events.grandTotalsShown
3940
+ : (this.actionObj.actionName == events.sortValue) ? events.valueSorted : (this.actionObj.actionName == events.openCalculatedField) ? events.calculatedFieldApplied : (this.actionObj.actionName == events.editCalculatedField) ? events.calculatedFieldEdited : (this.actionObj.actionName == events.sortField) ? events.fieldSorted
3941
+ : (this.actionObj.actionName == events.filterField) ? events.fieldFiltered : (this.actionObj.actionName == events.removeField) ? events.fieldRemoved : (this.actionObj.actionName == events.aggregateField) ? events.fieldAggregated : this.actionObj.actionName == events.editRecord ? events.recordEdited : this.actionObj.actionName == events.reportChange ? events.reportChanged
3942
+ : this.actionObj.actionName == events.saveEditedRecords ? events.editedRecordsSaved : this.actionObj.actionName == events.addNewRecord ? events.newRecordAdded
3943
+ : this.actionObj.actionName == events.removeRecord ? events.recordRemoved : (this.actionObj.actionName == events.pngExport) ? events.pngExported : (this.actionObj.actionName == events.jpegExport) ? events.jpegExported
3944
+ : (this.actionObj.actionName == events.svgExport) ? events.svgExported : (this.actionObj.actionName == events.pdfExport) ? events.pdfExported : (this.actionObj.actionName == events.csvExport) ? events.csvExported : (this.actionObj.actionName == events.excelExport) ? events.excelExported : this.actionObj.actionName == events.windowResize ? events.windowResized
3945
+ : this.actionObj.actionName == events.saveCurrentReport ? events.reportSaved : (this.actionObj.actionName == events.addNewReport) ? events.newReportAdded : (this.actionObj.actionName == events.saveAsCurrentReport) ? events.reportReSaved
3946
+ : (this.actionObj.actionName == events.renameCurrentReport) ? events.reportRenamed : this.actionObj.actionName;
3947
+ return actionName;
3948
+ };
3949
+ /* eslint-disable-next-line */
3950
+ /** @hidden */
3951
+ PivotView.prototype.getStackedColumns = function (gridcolumns, stackedColumns) {
3952
+ for (var _i = 0, gridcolumns_4 = gridcolumns; _i < gridcolumns_4.length; _i++) {
3953
+ var column = gridcolumns_4[_i];
3954
+ stackedColumns.push(column);
3955
+ if (column.columns && column.columns.length > 0) {
3956
+ this.getStackedColumns(column.columns, stackedColumns);
3957
+ }
3958
+ }
3959
+ return stackedColumns;
3960
+ };
3772
3961
  /**
3773
3962
  * To destroy the PivotView elements.
3774
3963
  * @returns {void}
@@ -3832,8 +4021,8 @@ var PivotView = /** @class */ (function (_super) {
3832
4021
  if (this.commonModule) {
3833
4022
  this.commonModule.destroy();
3834
4023
  }
3835
- if (this.chartModule) {
3836
- this.chartModule.destroy();
4024
+ if (this.pivotChartModule) {
4025
+ this.pivotChartModule.destroy();
3837
4026
  }
3838
4027
  if (this.pivotButtonModule && !this.pivotButtonModule.isDestroyed) {
3839
4028
  this.pivotButtonModule.destroy();
@@ -3888,8 +4077,8 @@ var PivotView = /** @class */ (function (_super) {
3888
4077
  if (this.commonModule) {
3889
4078
  this.commonModule = null;
3890
4079
  }
3891
- if (this.chartModule) {
3892
- this.chartModule = null;
4080
+ if (this.pivotChartModule) {
4081
+ this.pivotChartModule = null;
3893
4082
  }
3894
4083
  if (this.pivotButtonModule) {
3895
4084
  this.pivotButtonModule = null;
@@ -3909,6 +4098,12 @@ var PivotView = /** @class */ (function (_super) {
3909
4098
  if (this.drillThroughModule) {
3910
4099
  this.drillThroughModule = null;
3911
4100
  }
4101
+ if (this.clonedDataSet) {
4102
+ this.clonedDataSet = null;
4103
+ }
4104
+ if (this.clonedReport) {
4105
+ this.clonedReport = null;
4106
+ }
3912
4107
  this.element.innerHTML = '';
3913
4108
  removeClass([this.element], cls.ROOT);
3914
4109
  removeClass([this.element], cls.RTL);
@@ -4251,6 +4446,15 @@ var PivotView = /** @class */ (function (_super) {
4251
4446
  __decorate([
4252
4447
  Event()
4253
4448
  ], PivotView.prototype, "beforeServiceInvoke", void 0);
4449
+ __decorate([
4450
+ Event()
4451
+ ], PivotView.prototype, "actionBegin", void 0);
4452
+ __decorate([
4453
+ Event()
4454
+ ], PivotView.prototype, "actionComplete", void 0);
4455
+ __decorate([
4456
+ Event()
4457
+ ], PivotView.prototype, "actionFailure", void 0);
4254
4458
  PivotView = __decorate([
4255
4459
  NotifyPropertyChanges
4256
4460
  ], PivotView);