@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
@@ -60,41 +60,6 @@ class PivotUtil {
60
60
  }
61
61
  return clonedData;
62
62
  }
63
- static getClonedPivotValues(pivotValues) {
64
- let clonedSets = [];
65
- for (let i = 0; i < pivotValues.length; i++) {
66
- if (pivotValues[i]) {
67
- clonedSets[i] = [];
68
- for (let j = 0; j < pivotValues[i].length; j++) {
69
- if (pivotValues[i][j]) {
70
- /* eslint-disable */
71
- clonedSets[i][j] = this.getClonedPivotValueObj(pivotValues[i][j]);
72
- /* eslint-enable */
73
- }
74
- }
75
- }
76
- }
77
- return clonedSets;
78
- }
79
- /* eslint-disable */
80
- static getClonedPivotValueObj(data) {
81
- /* eslint-enable */
82
- let keyPos = 0;
83
- /* eslint-disable @typescript-eslint/no-explicit-any */
84
- let framedSet = {};
85
- /* eslint-enable @typescript-eslint/no-explicit-any */
86
- if (!(data === null || data === undefined)) {
87
- let fields = Object.keys(data);
88
- while (keyPos < fields.length) {
89
- framedSet[fields[keyPos]] = data[fields[keyPos]];
90
- keyPos++;
91
- }
92
- }
93
- else {
94
- framedSet = data;
95
- }
96
- return framedSet;
97
- }
98
63
  /* eslint-disable @typescript-eslint/no-explicit-any */
99
64
  static getDefinedObj(data) {
100
65
  let keyPos = 0;
@@ -127,18 +92,6 @@ class PivotUtil {
127
92
  return -1;
128
93
  }
129
94
  /* eslint-disable */
130
- static isContainCommonElements(collection1, collection2) {
131
- /* eslint-enable */
132
- for (let i = 0, cnt = collection1.length; i < cnt; i++) {
133
- for (let j = 0, lnt = collection2.length; j < lnt; j++) {
134
- if (collection2[j] === collection1[i]) {
135
- return true;
136
- }
137
- }
138
- }
139
- return false;
140
- }
141
- /* eslint-disable */
142
95
  static setPivotProperties(control, properties) {
143
96
  /* eslint-enable */
144
97
  control.allowServerDataBinding = false;
@@ -175,6 +128,7 @@ class PivotUtil {
175
128
  drilledMembers: this.cloneDrillMemberSettings(dataSourceSettings.drilledMembers),
176
129
  valueSortSettings: this.CloneValueSortObject(dataSourceSettings.valueSortSettings),
177
130
  valueAxis: dataSourceSettings.valueAxis,
131
+ grandTotalsPosition: dataSourceSettings.grandTotalsPosition,
178
132
  formatSettings: this.cloneFormatSettings(dataSourceSettings.formatSettings),
179
133
  calculatedFieldSettings: this.cloneCalculatedFieldSettings(dataSourceSettings.calculatedFieldSettings),
180
134
  fieldMapping: this.cloneFieldSettings(dataSourceSettings.fieldMapping),
@@ -221,6 +175,7 @@ class PivotUtil {
221
175
  drilledMembers: dataSourceSettings.drilledMembers,
222
176
  valueSortSettings: dataSourceSettings.valueSortSettings,
223
177
  valueAxis: dataSourceSettings.valueAxis,
178
+ grandTotalsPosition: dataSourceSettings.grandTotalsPosition,
224
179
  formatSettings: dataSourceSettings.formatSettings,
225
180
  calculatedFieldSettings: dataSourceSettings.calculatedFieldSettings,
226
181
  fieldMapping: dataSourceSettings.fieldMapping,
@@ -632,174 +587,6 @@ class PivotUtil {
632
587
  return values;
633
588
  }
634
589
  /* eslint-disable */
635
- static formatPdfHeaderFooter(pdf) {
636
- let contents = [];
637
- if (!isNullOrUndefined(pdf)) {
638
- for (let i = 0; i < pdf.length; i++) {
639
- let a = pdf[i];
640
- let content = {
641
- /* eslint-enable */
642
- type: a.Type,
643
- pageNumberType: a.PageNumberType,
644
- style: a.Style ? {
645
- penColor: a.Style.PenColor,
646
- penSize: a.Style.PenSize,
647
- dashStyle: a.Style.DashStyle,
648
- textBrushColor: a.Style.TextBrushColor,
649
- textPenColor: a.Style.TextPenColor,
650
- fontSize: a.Style.FontSize,
651
- hAlign: a.Style.HAlign,
652
- vAlign: a.Style.VAlign
653
- } : a.Style,
654
- points: a.Points !== null ? {
655
- x1: a.Points.X1,
656
- y1: a.Points.Y1,
657
- x2: a.Points.X2,
658
- y2: a.Points.Y2
659
- } : null,
660
- format: a.Format,
661
- position: a.Position !== null ? {
662
- x: a.Position.X,
663
- y: a.Position.Y
664
- } : null,
665
- size: a.Size !== null ? {
666
- height: a.Size.Height,
667
- width: a.Size.Width
668
- } : null,
669
- src: a.Src,
670
- value: a.Value,
671
- font: a.Font
672
- };
673
- contents.push(content);
674
- }
675
- }
676
- return contents;
677
- }
678
- /* eslint-disable */
679
- static formatPdfExportProperties(pdf) {
680
- let values;
681
- /* eslint-enable */
682
- values = this.getDefinedObj({
683
- pageOrientation: typeof pdf.PageOrientation === 'string' ? pdf.PageOrientation : null,
684
- pageSize: typeof pdf.PageSize === 'string' ? pdf.PageSize : null,
685
- header: !isNullOrUndefined(pdf.Header) ? {
686
- fromTop: pdf.Header.FromTop,
687
- height: pdf.Header.Height,
688
- contents: this.formatPdfHeaderFooter(pdf.Header.Contents)
689
- } : null,
690
- columns: pdf.Columns,
691
- footer: !isNullOrUndefined(pdf.Footer) ? {
692
- fromTop: pdf.Footer.FromBottom,
693
- height: pdf.Footer.Height,
694
- contents: this.formatPdfHeaderFooter(pdf.Footer.Contents)
695
- } : null,
696
- includeHiddenColumn: pdf.IncludeHiddenColumn,
697
- dataSource: pdf.DataSource,
698
- exportType: typeof pdf.ExportType === 'string' ? pdf.ExportType : null,
699
- theme: !isNullOrUndefined(pdf.Theme) ? {
700
- header: pdf.Theme.Header,
701
- record: pdf.Theme.Record,
702
- caption: pdf.Theme.Caption
703
- } : null,
704
- fileName: pdf.FileName,
705
- hierarchyExportMode: typeof pdf.HierarchyExportMode === 'string' ? pdf.HierarchyExportMode : null,
706
- allowHorizontalOverflow: pdf.AllowHorizontalOverflow
707
- });
708
- return values;
709
- }
710
- /* eslint-disable */
711
- static formatExcelStyle(style) {
712
- let prop;
713
- /* eslint-enable */
714
- if (!isNullOrUndefined(style)) {
715
- prop = this.getDefinedObj({
716
- fontColor: style.FontColor,
717
- fontName: style.FontName,
718
- fontSize: style.FontSize,
719
- hAlign: style.HAlign === String ? style.HAlign : null,
720
- vAlign: style.VAlign === String ? style.VAlign : null,
721
- bold: style.Bold,
722
- indent: style.Indent,
723
- italic: style.Italic,
724
- underline: style.Underline,
725
- backColor: style.BackColor,
726
- wrapText: style.WrapText,
727
- borders: style.Borders,
728
- numberFormat: style.NumberFormat,
729
- type: style.Type
730
- });
731
- }
732
- return prop;
733
- }
734
- /* eslint-disable */
735
- static formatExcelCell(cell) {
736
- let cells = [];
737
- if (!isNullOrUndefined(cell)) {
738
- for (let i = 0; i < cell.length; i++) {
739
- this.getDefinedObj({
740
- index: !isNullOrUndefined(cell[i].Index) ? cell[i].Index : null,
741
- colSpan: !isNullOrUndefined(cell[i].ColSpan) ? cell[i].ColSpan : null,
742
- value: !isNullOrUndefined(cell[i].Value) ? cell[i].Value : null,
743
- hyperlink: {
744
- target: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.Target : null,
745
- displayText: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.DisplayText : null
746
- },
747
- styles: this.formatExcelStyle(cell[i].Style),
748
- rowSpan: !isNullOrUndefined(cell[i].RowSpan) ? cell[i].RowSpan : null
749
- });
750
- /* eslint-enable */
751
- }
752
- }
753
- return cells;
754
- }
755
- /* eslint-disable */
756
- static formatExcelHeaderFooter(excel) {
757
- let rows = [];
758
- if (!isNullOrUndefined(excel)) {
759
- for (let i = 0; i < excel.Rows.length; i++) {
760
- let row = excel.Rows[i];
761
- let prop = this.getDefinedObj({
762
- index: !isNullOrUndefined(row.Index) ? row.Index : null,
763
- cells: this.formatExcelCell(row.Cells),
764
- grouping: !isNullOrUndefined(row.Grouping) ? row.Grouping : null
765
- });
766
- rows.push(prop);
767
- }
768
- }
769
- return rows;
770
- }
771
- static formatExcelExportProperties(excel) {
772
- /* eslint-enable */
773
- let prop;
774
- prop = this.getDefinedObj({
775
- dataSource: excel.DataSource,
776
- query: excel.Query,
777
- multipleExport: this.getDefinedObj({
778
- type: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.Type : null,
779
- blankRows: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.BlankRows : null
780
- }),
781
- header: this.getDefinedObj({
782
- headerRows: !isNullOrUndefined(excel.Header) ? excel.Header.HeaderRows : null,
783
- rows: this.formatExcelHeaderFooter(excel.Header)
784
- }),
785
- footer: this.getDefinedObj({
786
- footerRows: !isNullOrUndefined(excel.Footer) ? excel.Footer.FooterRows : null,
787
- rows: this.formatExcelHeaderFooter(excel.Footer)
788
- }),
789
- columns: excel.Columns,
790
- exportType: typeof excel.ExportType === 'string' ? excel.ExportType : undefined,
791
- includeHiddenColumn: excel.IncludeHiddenColumn,
792
- theme: !isNullOrUndefined(excel.Theme) ? {
793
- header: this.formatExcelStyle(excel.Theme.Header),
794
- record: this.formatExcelStyle(excel.Theme.Record),
795
- caption: this.formatExcelStyle(excel.Theme.Caption)
796
- } : undefined,
797
- fileName: excel.FileName,
798
- hierarchyExportMode: typeof excel.HierarchyExportMode === 'string' ? excel.HierarchyExportMode : undefined
799
- });
800
- return prop;
801
- }
802
- /* eslint-disable */
803
590
  static formatFieldList(fieldList) {
804
591
  let keys = Object.keys(fieldList);
805
592
  let fList = {};
@@ -1099,7 +886,8 @@ class PivotEngine {
1099
886
  this.isLastHeaderHasMeasures = true;
1100
887
  this.isEditing = false;
1101
888
  let fields;
1102
- this.globalize = new Internationalization();
889
+ this.globalize = (customProperties && customProperties.globalize) ? customProperties.globalize : new Internationalization();
890
+ this.currencyCode = (customProperties && customProperties.currenyCode) ? customProperties.currenyCode : undefined;
1103
891
  this.localeObj = customProperties ? customProperties.localeObj : undefined;
1104
892
  this.fieldsType = customProperties ? customProperties.fieldsType : {};
1105
893
  this.clonedReport = customProperties ? (customProperties.clonedReport &&
@@ -1113,6 +901,7 @@ class PivotEngine {
1113
901
  this.showRowSubTotals = isNullOrUndefined(dataSource.showRowSubTotals) ? true : dataSource.showRowSubTotals;
1114
902
  this.showColumnSubTotals = isNullOrUndefined(dataSource.showColumnSubTotals) ? true : dataSource.showColumnSubTotals;
1115
903
  this.showGrandTotals = isNullOrUndefined(dataSource.showGrandTotals) ? true : dataSource.showGrandTotals;
904
+ this.grandTotalsPosition = isNullOrUndefined(dataSource.grandTotalsPosition) ? 'Bottom' : dataSource.grandTotalsPosition;
1116
905
  this.showRowGrandTotals = isNullOrUndefined(dataSource.showRowGrandTotals) ? true : dataSource.showRowGrandTotals;
1117
906
  this.showColumnGrandTotals = isNullOrUndefined(dataSource.showColumnGrandTotals) ? true : dataSource.showColumnGrandTotals;
1118
907
  this.allowValueFilter = dataSource.allowValueFilter;
@@ -1226,6 +1015,7 @@ class PivotEngine {
1226
1015
  this.showRowSubTotals = isNullOrUndefined(dataSource.showRowSubTotals) ? true : dataSource.showRowSubTotals;
1227
1016
  this.showColumnSubTotals = isNullOrUndefined(dataSource.showColumnSubTotals) ? true : dataSource.showColumnSubTotals;
1228
1017
  this.showGrandTotals = isNullOrUndefined(dataSource.showGrandTotals) ? true : dataSource.showGrandTotals;
1018
+ this.grandTotalsPosition = isNullOrUndefined(dataSource.grandTotalsPosition) ? 'Bottom' : dataSource.grandTotalsPosition;
1229
1019
  this.showRowGrandTotals = isNullOrUndefined(dataSource.showRowGrandTotals) ? true : dataSource.showRowGrandTotals;
1230
1020
  this.showColumnGrandTotals = isNullOrUndefined(dataSource.showColumnGrandTotals) ? true : dataSource.showColumnGrandTotals;
1231
1021
  this.allowValueFilter = dataSource.allowValueFilter;
@@ -1524,6 +1314,7 @@ class PivotEngine {
1524
1314
  }
1525
1315
  if (!PivotUtil.getFieldByName(groupKeys[gCnt], dataFields)) {
1526
1316
  groupField = groupFields[groupKeys[gCnt]];
1317
+ caption = (caption.indexOf(' (') !== -1 && caption.indexOf(')') !== -1) ? caption.slice(caption.indexOf('(') + 1, caption.length - 1) : caption;
1527
1318
  let newField = {
1528
1319
  name: groupKeys[gCnt],
1529
1320
  caption: (this.localeObj ? this.localeObj.getConstant(groupField) : groupField) + ' (' + caption + ')',
@@ -1551,6 +1342,8 @@ class PivotEngine {
1551
1342
  }
1552
1343
  }
1553
1344
  gCnt = Object.keys(groupKeys).length;
1345
+ let field = this.getMappingField(fieldName, this.clonedReport ? this.clonedReport.fieldMapping : this.fieldMapping);
1346
+ let caption = field.caption ? field.caption : fieldName;
1554
1347
  while (gCnt--) {
1555
1348
  groupField = groupFields[groupKeys[gCnt]];
1556
1349
  for (let i = 0, len = this.formats.length; i < len; i++) {
@@ -1569,6 +1362,33 @@ class PivotEngine {
1569
1362
  };
1570
1363
  this.formats.push(formatSettings);
1571
1364
  }
1365
+ if (!isDataSource) {
1366
+ let mappingField = this.getMappingField(groupKeys[gCnt], this.fieldMapping);
1367
+ if (groupKeys[gCnt] !== fieldName && isNullOrUndefined(mappingField.name)) {
1368
+ let newField = {
1369
+ name: groupKeys[gCnt],
1370
+ caption: (this.localeObj ? this.localeObj.getConstant(groupField) : groupField) + ' (' + caption + ')'
1371
+ };
1372
+ this.fieldMapping.push(newField);
1373
+ }
1374
+ else if (groupKeys[gCnt] !== fieldName) {
1375
+ mappingField.caption = (this.localeObj ? this.localeObj.getConstant(groupField) : groupField) + ' (' + caption + ')';
1376
+ }
1377
+ }
1378
+ }
1379
+ if (!isDataSource) {
1380
+ let mappingField = this.getMappingField(fieldName, this.fieldMapping);
1381
+ groupField = groupFields[fieldName];
1382
+ if (groupKeys[gCnt] !== fieldName && isNullOrUndefined(mappingField.name)) {
1383
+ let newField = {
1384
+ name: fieldName,
1385
+ caption: (this.localeObj ? this.localeObj.getConstant(groupField) : groupField) + ' (' + caption + ')'
1386
+ };
1387
+ this.fieldMapping.push(newField);
1388
+ }
1389
+ else {
1390
+ mappingField.caption = (this.localeObj ? this.localeObj.getConstant(groupField) : groupField) + ' (' + caption + ')';
1391
+ }
1572
1392
  }
1573
1393
  }
1574
1394
  else if (group.type === 'Number' && group.rangeInterval) {
@@ -1807,7 +1627,7 @@ class PivotEngine {
1807
1627
  this.fieldList = this.savedFieldList;
1808
1628
  while (len--) { /** while is used for better performance than for */
1809
1629
  let key = keys[len];
1810
- let field = this.getMappingField(key);
1630
+ let field = this.getMappingField(key, this.fieldMapping);
1811
1631
  if (this.fieldList[key]) {
1812
1632
  this.fieldList[key].isSelected = false;
1813
1633
  this.fieldList[key].index = len;
@@ -1886,7 +1706,7 @@ class PivotEngine {
1886
1706
  this.fieldList = {};
1887
1707
  while (len--) { /** while is used for better performance than for */
1888
1708
  let key = keys[len];
1889
- let field = this.getMappingField(key);
1709
+ let field = this.getMappingField(key, this.fieldMapping);
1890
1710
  type = (field && 'dataType' in field && field.dataType && dataTypes.indexOf(field.dataType.toLowerCase()) > -1) ?
1891
1711
  field.dataType.toLowerCase() : PivotUtil.getType(fields[this.fieldKeys[key]]);
1892
1712
  this.fieldList[key] = {
@@ -1930,12 +1750,12 @@ class PivotEngine {
1930
1750
  }
1931
1751
  this.updateTreeViewData(dataFields);
1932
1752
  }
1933
- getMappingField(key) {
1753
+ getMappingField(key, fieldMapping) {
1934
1754
  let field = {};
1935
- if (this.fieldMapping.length > 0) {
1936
- for (let index = 0, cnt = this.fieldMapping.length; index < cnt; index++) {
1937
- if (this.fieldMapping[index].name === key) {
1938
- field = this.fieldMapping[index];
1755
+ if (fieldMapping.length > 0) {
1756
+ for (let index = 0, cnt = fieldMapping.length; index < cnt; index++) {
1757
+ if (fieldMapping[index].name === key) {
1758
+ field = fieldMapping[index];
1939
1759
  break;
1940
1760
  }
1941
1761
  }
@@ -2496,8 +2316,8 @@ class PivotEngine {
2496
2316
  field.filter = filter;
2497
2317
  field.filterType = type;
2498
2318
  field.isExcelFilter = isLabelFilter;
2499
- let members = (this.formatFields[name] &&
2500
- (['date', 'dateTime', 'time'].indexOf(this.formatFields[name].type) > -1)) ?
2319
+ let members = ((this.formatFields[name] &&
2320
+ (['date', 'dateTime', 'time'].indexOf(this.formatFields[name].type) > -1)) || (name in this.groupingFields)) ?
2501
2321
  field.formattedMembers : field.members;
2502
2322
  let allowFil = isInclude;
2503
2323
  let final = {};
@@ -2544,7 +2364,7 @@ class PivotEngine {
2544
2364
  }
2545
2365
  applyValueFiltering(rowData, level, rows, columns, valueFilter, rowFilterData, type) {
2546
2366
  this.isValueFiltered = false;
2547
- let allMember = extend({}, (type === 'row' && this.rowGrandTotal ? this.rowGrandTotal : type === 'column' && this.columnGrandTotal ? this.columnGrandTotal : rows[rows.length - 1]), null, true);
2367
+ let allMember = extend({}, (type === 'row' && this.rowGrandTotal ? this.rowGrandTotal : type === 'column' && this.columnGrandTotal ? this.columnGrandTotal : (!(this.grandTotalsPosition === 'Top') ? rows[rows.length - 1] : rows[0])), null, true);
2548
2368
  this.getFilteredData(rows, columns, valueFilter, rowFilterData, level, rowData.name, allMember, type);
2549
2369
  if (this.isValueFiltered) {
2550
2370
  if ((type === 'row' && this.rowGrandTotal === null) || (type === 'column' && this.columnGrandTotal === null)) {
@@ -2879,14 +2699,14 @@ class PivotEngine {
2879
2699
  for (let i = 0; i < rLen; i++) {
2880
2700
  if (filterElement.name === rows[i].name && valueFields[filterElement.measure] && !isAvail) {
2881
2701
  isAvail = true;
2882
- rowFilteredData = this.applyValueFiltering(rows[i], i, rowHeaders, (this.columnGrandTotal ? this.columnGrandTotal : columnHeaders[columnHeaders.length - 1]), valueFilters, this.valueFilteredData, 'row');
2702
+ rowFilteredData = this.applyValueFiltering(rows[i], i, rowHeaders, (this.columnGrandTotal ? this.columnGrandTotal : (this.grandTotalsPosition === 'Top' && this.showGrandTotals) ? columnHeaders[0] : columnHeaders[columnHeaders.length - 1]), valueFilters, this.valueFilteredData, 'row');
2883
2703
  break;
2884
2704
  }
2885
2705
  }
2886
2706
  for (let j = 0; j < cLen; j++) {
2887
2707
  if (filterElement.name === columns[j].name && valueFields[filterElement.measure] && !isAvail) {
2888
2708
  isAvail = true;
2889
- columnFilteredData = this.applyValueFiltering(columns[j], j, columnHeaders, (this.rowGrandTotal ? this.rowGrandTotal : rowHeaders[rowHeaders.length - 1]), valueFilters, this.valueFilteredData, 'column');
2709
+ columnFilteredData = this.applyValueFiltering(columns[j], j, columnHeaders, (this.rowGrandTotal ? this.rowGrandTotal : (this.grandTotalsPosition === 'Top' && this.showGrandTotals) ? rowHeaders[0] : rowHeaders[rowHeaders.length - 1]), valueFilters, this.valueFilteredData, 'column');
2890
2710
  break;
2891
2711
  }
2892
2712
  }
@@ -3191,7 +3011,7 @@ class PivotEngine {
3191
3011
  }
3192
3012
  let engine = this;
3193
3013
  return headers.filter((item) => {
3194
- return item.members.length > 0 ? item.members.length > 0 : engine.matchIndexes(item.indexObject, filterObjects);
3014
+ return (item.members.length > 0 || item.type === 'grand sum') ? true : engine.matchIndexes(item.indexObject, filterObjects);
3195
3015
  });
3196
3016
  }
3197
3017
  matchIndexes(index, filterObjects) {
@@ -3408,8 +3228,8 @@ class PivotEngine {
3408
3228
  }
3409
3229
  }
3410
3230
  if (stringValue.length > 0) {
3411
- stringValue = childrens.sort === 'Ascending' ? (stringValue.sort((a, b) => (a.actualText > b.actualText) ? 1 : ((b.actualText > a.actualText) ? -1 : 0))) :
3412
- childrens.sort === 'Descending' ? (stringValue.sort((a, b) => (a.actualText < b.actualText) ? 1 : ((b.actualText < a.actualText) ? -1 : 0))) : stringValue;
3231
+ stringValue = childrens.sort === 'Ascending' ? (stringValue.sort((a, b) => (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : ((a.actualText > b.actualText) ? 1 : ((b.actualText > a.actualText) ? -1 : 0)))) :
3232
+ childrens.sort === 'Descending' ? (stringValue.sort((a, b) => (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : ((a.actualText < b.actualText) ? 1 : ((b.actualText < a.actualText) ? -1 : 0)))) : stringValue;
3413
3233
  }
3414
3234
  if (alphaNumbervalue.length > 0) {
3415
3235
  alphaNumbervalue = childrens.sort === 'Ascending' ?
@@ -3422,9 +3242,9 @@ class PivotEngine {
3422
3242
  }
3423
3243
  else {
3424
3244
  return sortOrder === 'Ascending' ?
3425
- (headers.sort(function (a, b) { return (a.actualText > b.actualText) ? 1 : ((b.actualText > a.actualText) ? -1 : 0); })) :
3245
+ (headers.sort(function (a, b) { return (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : ((a.actualText > b.actualText) ? 1 : ((b.actualText > a.actualText) ? -1 : 0)); })) :
3426
3246
  sortOrder === 'Descending' ?
3427
- (headers.sort(function (a, b) { return (a.actualText < b.actualText) ? 1 : ((b.actualText < a.actualText) ? -1 : 0); })) :
3247
+ (headers.sort(function (a, b) { return (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : ((a.actualText < b.actualText) ? 1 : ((b.actualText < a.actualText) ? -1 : 0)); })) :
3428
3248
  headers;
3429
3249
  }
3430
3250
  }
@@ -3444,7 +3264,8 @@ class PivotEngine {
3444
3264
  this.valueSortHeaderText = undefined;
3445
3265
  if (this.enableValueSorting && this.valueSortSettings.headerText && !this.valueSortHeaderText &&
3446
3266
  this.valueSortSettings.headerText !== '' && this.values.length > 0) {
3447
- let textArray = this.valueSortSettings.headerText.split(this.valueSortSettings.headerDelimiter);
3267
+ this.valueSortHeaderText = this.valueSortSettings.headerText;
3268
+ let textArray = this.valueSortHeaderText.split(this.valueSortSettings.headerDelimiter);
3448
3269
  for (let field of this.values) {
3449
3270
  let name = field.caption ? field.caption : field.name;
3450
3271
  let valueIndex = textArray.indexOf(name);
@@ -4228,7 +4049,7 @@ class PivotEngine {
4228
4049
  insertAllMember(set, filter, customText, axis) {
4229
4050
  let len = set.length;
4230
4051
  customText = ' Total';
4231
- set[len] = {
4052
+ let grandTotalSet = {
4232
4053
  hasChild: false,
4233
4054
  index: filter,
4234
4055
  level: 0,
@@ -4242,13 +4063,14 @@ class PivotEngine {
4242
4063
  type: 'grand sum',
4243
4064
  valueSort: {}
4244
4065
  };
4245
- set[len].valueSort[set[len].formattedText] = 1;
4246
- set[len].valueSort.levelName = set[len].formattedText;
4247
- set[len].valueSort[set[len].actualText] = 1;
4248
- set[len].valueSort.uniqueName = set[len].actualText;
4066
+ grandTotalSet.valueSort[grandTotalSet.formattedText] = 1;
4067
+ grandTotalSet.valueSort.levelName = grandTotalSet.formattedText;
4068
+ grandTotalSet.valueSort[grandTotalSet.actualText] = 1;
4069
+ grandTotalSet.valueSort.uniqueName = grandTotalSet.actualText;
4249
4070
  for (let ln = 0, lt = filter.length; ln < lt; ln++) {
4250
- set[len].indexObject[filter[ln]] = filter[ln];
4071
+ grandTotalSet.indexObject[filter[ln]] = filter[ln];
4251
4072
  }
4073
+ (this.dataSourceSettings.grandTotalsPosition === 'Top' && this.dataSourceSettings.showGrandTotals) ? set.unshift(grandTotalSet) : set.push(grandTotalSet);
4252
4074
  // if (axis === 'row') {
4253
4075
  // this.rowCount += this.rowValuesLength;
4254
4076
  // } else {
@@ -4296,7 +4118,7 @@ class PivotEngine {
4296
4118
  for (let cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
4297
4119
  if (!isValueIndexFound) {
4298
4120
  for (vln = 0; vln < vlt; vln++) {
4299
- if (row.valueSort.uniqueName && row.valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(this.values[vln].name) > -1) {
4121
+ if (row.valueSort.uniqueName && row.valueSort.uniqueName.toString().indexOf(this.values[vln].name) > -1) {
4300
4122
  isValueIndexFound = true;
4301
4123
  isValueCellUpdated = true;
4302
4124
  break;
@@ -4331,7 +4153,7 @@ class PivotEngine {
4331
4153
  for (let cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
4332
4154
  for (let vln = 0; vln < vlt; vln++) {
4333
4155
  if (!this.valueAxis && !this.isLastHeaderHasMeasures) {
4334
- if (columns[cln].valueSort.uniqueName && columns[cln].valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(this.values[vln].name) > -1) {
4156
+ if (columns[cln].valueSort.uniqueName && columns[cln].valueSort.uniqueName.toString().indexOf(this.values[vln].name) > -1) {
4335
4157
  this.updateRowData(rows, columns, tnum, data, vln, rln, cln, dln, actCnt, rTotal, cTotal);
4336
4158
  dln = data[tnum].length;
4337
4159
  }
@@ -5251,6 +5073,10 @@ class PivotEngine {
5251
5073
  this.updateValueMembers(this.measureIndex === 0 && axis.length > 1, null, null, columnHeaders, axis.slice(0, axis.length - 1), vcnt, 0);
5252
5074
  this.updateValueMembers(false, null, null, columnHeaders, axis.slice(axis.length - 1, axis.length), vcnt, -1);
5253
5075
  }
5076
+ else if (this.grandTotalsPosition === 'Top' && this.showGrandTotals && this.measureIndex === 0) {
5077
+ this.updateValueMembers(false, null, null, columnHeaders, axis.slice(0, 1), vcnt, -1);
5078
+ this.updateValueMembers(this.measureIndex === 0 && axis.length > 1, null, null, columnHeaders, axis.slice(1, axis.length), vcnt, 0);
5079
+ }
5254
5080
  else {
5255
5081
  let hasColumnTotal = columns.length === 0 && axis.length === 1 && axis[0].type == 'grand sum';
5256
5082
  this.updateValueMembers(!hasColumnTotal && this.measureIndex === 0, null, null, columnHeaders, axis, vcnt, hasColumnTotal ? -1 : 0);
@@ -5290,6 +5116,10 @@ class PivotEngine {
5290
5116
  this.updateValueMembers(this.measureIndex == 0 && this.rMembers.length > 1, null, null, rowAxis, this.rMembers.slice(0, this.rMembers.length - 1), this.values.length, 0);
5291
5117
  this.updateValueMembers(false, null, null, rowAxis, this.rMembers.slice(this.rMembers.length - 1, this.rMembers.length), this.values.length, -1);
5292
5118
  }
5119
+ else if (this.grandTotalsPosition === 'Top' && this.showGrandTotals && this.measureIndex === 0) {
5120
+ this.updateValueMembers(false, null, null, rowAxis, this.rMembers.slice(0, 1), this.values.length, -1);
5121
+ this.updateValueMembers(this.measureIndex == 0 && this.rMembers.length > 1, null, null, rowAxis, this.rMembers.slice(1, this.rMembers.length), this.values.length, 0);
5122
+ }
5293
5123
  else {
5294
5124
  let hasRowTotal = rows.length === 0 && this.rMembers.length === 1 && this.rMembers[0].type == 'grand sum';
5295
5125
  this.updateValueMembers(!hasRowTotal && this.measureIndex == 0, null, null, rowAxis, this.rMembers, this.values.length, hasRowTotal ? -1 : 0);
@@ -5893,6 +5723,12 @@ const fieldDragStart = 'fieldDragStart';
5893
5723
  const chartPointClick = 'chartPointClick';
5894
5724
  /** @hidden */
5895
5725
  const beforeServiceInvoke = 'beforeServiceInvoke';
5726
+ /** @hidden */
5727
+ const actionBegin = 'actionBegin';
5728
+ /** @hidden */
5729
+ const actionComplete = 'actionComplete';
5730
+ /** @hidden */
5731
+ const actionFailure = 'actionFailure';
5896
5732
  /**
5897
5733
  * Specifies pivot internal events
5898
5734
  */
@@ -5922,6 +5758,186 @@ const initToolbar = 'init-toolbar';
5922
5758
  const initFormatting = 'init-formatting';
5923
5759
  /** @hidden */
5924
5760
  const initGrouping = 'init-grouping';
5761
+ /**
5762
+ * Specifies action names of actionBegin events
5763
+ */
5764
+ /** @hidden */
5765
+ const sortValue = 'Sort value';
5766
+ /** @hidden */
5767
+ const drillUp = 'Drill up';
5768
+ /** @hidden */
5769
+ const drillDown = 'Drill down';
5770
+ /** @hidden */
5771
+ const addNewReport = 'Add new report';
5772
+ /** @hidden */
5773
+ const saveCurrentReport = 'Save current report';
5774
+ /** @hidden */
5775
+ const saveAsCurrentReport = 'Save as current report';
5776
+ /** @hidden */
5777
+ const renameCurrentReport = 'Rename current report';
5778
+ /** @hidden */
5779
+ const removeCurrentReport = 'Remove current report';
5780
+ /** @hidden */
5781
+ const loadReports = 'Load report';
5782
+ /** @hidden */
5783
+ const openConditionalFormatting = 'Open conditional formatting dialog';
5784
+ /** @hidden */
5785
+ const openNumberFormatting = 'Open number formatting dialog';
5786
+ /** @hidden */
5787
+ const MdxQuery = 'MdxQuery';
5788
+ /** @hidden */
5789
+ const showFieldList = 'Open field list';
5790
+ /** @hidden */
5791
+ const tableView = 'Show table view';
5792
+ /** @hidden */
5793
+ const chartView = 'Show chart view';
5794
+ /** @hidden */
5795
+ const multipleAxis = 'Multiple Axis';
5796
+ /** @hidden */
5797
+ const showLegend = 'Show legend';
5798
+ /** @hidden */
5799
+ const pdfExport = 'PDF export';
5800
+ /** @hidden */
5801
+ const pngExport = 'PNG export';
5802
+ /** @hidden */
5803
+ const excelExport = 'Excel export';
5804
+ /** @hidden */
5805
+ const csvExport = 'CSV export';
5806
+ /** @hidden */
5807
+ const jpegExport = 'JPEG export';
5808
+ /** @hidden */
5809
+ const svgExport = 'SVG export';
5810
+ /** @hidden */
5811
+ const hideSubTotals = 'Hide sub-totals';
5812
+ /** @hidden */
5813
+ const subTotalsRow = 'Show row sub-totals';
5814
+ /** @hidden */
5815
+ const subTotalsColumn = 'Show column sub-totals';
5816
+ /** @hidden */
5817
+ const showSubTotals = 'Show sub-totals';
5818
+ /** @hidden */
5819
+ const hideGrandTotals = 'Hide grand totals';
5820
+ /** @hidden */
5821
+ const grandTotalsRow = 'Show row grand totals';
5822
+ /** @hidden */
5823
+ const grandTotalsColumn = 'Show column grand totals';
5824
+ /** @hidden */
5825
+ const showGrandTotals = 'Show grand totals';
5826
+ /** @hidden */
5827
+ const numberFormattingMenu = 'Number Formatting menu';
5828
+ /** @hidden */
5829
+ const conditionalFormattingMenu = 'Conditional Formatting menu';
5830
+ /** @hidden */
5831
+ const reportChange = 'Report change';
5832
+ /** @hidden */
5833
+ const sortFieldTree = 'Sort field tree';
5834
+ /** @hidden */
5835
+ const editCalculatedField = 'Edit calculated field';
5836
+ /** @hidden */
5837
+ const sortField = 'Sort field';
5838
+ /** @hidden */
5839
+ const filterField = 'Filter field';
5840
+ /** @hidden */
5841
+ const removeField = 'Remove field';
5842
+ /** @hidden */
5843
+ const openCalculatedField = 'Open calculated field dialog';
5844
+ /** @hidden */
5845
+ const editRecord = 'Edit record';
5846
+ /** @hidden */
5847
+ const saveEditedRecords = 'Save edited records';
5848
+ /** @hidden */
5849
+ const addNewRecord = 'Add new record';
5850
+ /** @hidden */
5851
+ const removeRecord = 'Remove record';
5852
+ /** @hidden */
5853
+ const aggregateField = 'Aggregate field';
5854
+ /** @hidden */
5855
+ const contextMenuCalculatedField = 'CalculatedField Context menu';
5856
+ /** @hidden */
5857
+ const windowResize = 'Window resize';
5858
+ /**
5859
+ * Specifies action names of actionComplete events
5860
+ */
5861
+ /** @hidden */
5862
+ const calculatedFieldApplied = 'Calculated field applied';
5863
+ /** @hidden */
5864
+ const editedRecordsSaved = 'Edited records saved';
5865
+ /** @hidden */
5866
+ const newRecordAdded = 'New record added';
5867
+ /** @hidden */
5868
+ const recordRemoved = 'Record removed';
5869
+ /** @hidden */
5870
+ const closeFieldlist = 'Field list closed';
5871
+ /** @hidden */
5872
+ const fieldTreeSorted = 'Field tree sorted';
5873
+ /** @hidden */
5874
+ const reportSaved = 'Report saved';
5875
+ /** @hidden */
5876
+ const newReportAdded = 'New report added';
5877
+ /** @hidden */
5878
+ const reportReSaved = 'Report re-saved';
5879
+ /** @hidden */
5880
+ const reportRenamed = 'Report renamed';
5881
+ /** @hidden */
5882
+ const reportRemoved = 'Report removed';
5883
+ /** @hidden */
5884
+ const excelExported = 'Excel exported';
5885
+ /** @hidden */
5886
+ const csvExported = 'CSV exported';
5887
+ /** @hidden */
5888
+ const pdfExported = 'PDF exported';
5889
+ /** @hidden */
5890
+ const pngExported = 'PNG exported';
5891
+ /** @hidden */
5892
+ const jpegExported = 'JPEG exported';
5893
+ /** @hidden */
5894
+ const svgExported = 'SVG exported';
5895
+ /** @hidden */
5896
+ const conditionallyFormatted = 'Conditional formatting applied';
5897
+ /** @hidden */
5898
+ const numberFormatted = 'Number formatting applied';
5899
+ /** @hidden */
5900
+ const tableViewed = 'Table view shown';
5901
+ /** @hidden */
5902
+ const chartViewed = 'Chart view shown';
5903
+ /** @hidden */
5904
+ const subTotalsHidden = 'Sub-totals hidden';
5905
+ /** @hidden */
5906
+ const subTotalsRowShown = 'Row sub-totals shown';
5907
+ /** @hidden */
5908
+ const subTotalsColumnShown = 'Column sub-totals shown';
5909
+ /** @hidden */
5910
+ const subTotalsShown = 'Sub-totals shown';
5911
+ /** @hidden */
5912
+ const grandTotalsHidden = 'Grand totals hidden';
5913
+ /** @hidden */
5914
+ const grandTotalsRowShown = 'Row grand totals shown';
5915
+ /** @hidden */
5916
+ const grandTotalsColumnShown = 'Column grand totals shown';
5917
+ /** @hidden */
5918
+ const grandTotalsShown = 'Grand totals shown';
5919
+ /** @hidden */
5920
+ const valueSorted = 'Value sorted';
5921
+ /** @hidden */
5922
+ const calculatedFieldEdited = 'Calculated field edited';
5923
+ /** @hidden */
5924
+ const fieldSorted = 'Field sorted';
5925
+ /** @hidden */
5926
+ const fieldFiltered = 'Field filtered';
5927
+ /** @hidden */
5928
+ const fieldRemoved = 'Field removed';
5929
+ /** @hidden */
5930
+ const fieldAggregated = 'Field aggregated';
5931
+ /** @hidden */
5932
+ const recordEdited = 'Record edited';
5933
+ /** @hidden */
5934
+ const reportChanged = 'Report changed';
5935
+ /** @hidden */
5936
+ const windowResized = 'Window resized';
5937
+ /** @hidden */
5938
+ const recordUpdated = 'Records updated';
5939
+ /** @hidden */
5940
+ const drillThroughClosed = 'Drill-through closed';
5925
5941
 
5926
5942
  /**
5927
5943
  * CSS Constants
@@ -6595,6 +6611,8 @@ const PIVOTCHART_TYPE_DIALOG = 'e-pivotchart-type-dialog';
6595
6611
  const FORMAT_FONT_COLOR_PICKER = 'e-format-font-color-picker';
6596
6612
  /** @hidden */
6597
6613
  const GROUP_PIVOT_ROW = 'e-group-pivot-rows';
6614
+ /** @hidden */
6615
+ const TOOLBAR_MENU = 'e-pivot-toolbar-menu';
6598
6616
 
6599
6617
  /**
6600
6618
  * `AggregateMenu` module to create aggregate type popup.
@@ -6623,28 +6641,39 @@ class AggregateMenu {
6623
6641
  }
6624
6642
  openContextMenu(args) {
6625
6643
  let fieldName = args.target.parentElement.id;
6644
+ let fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
6626
6645
  this.buttonElement = args.target.parentElement;
6627
6646
  let isStringField = this.parent.engineModule.fieldList[fieldName].type !== 'number' ? 1 : 0;
6628
6647
  this.summaryTypes = [...this.getMenuItem(isStringField)];
6648
+ this.parent.actionObj.actionName = aggregateField;
6649
+ this.parent.actionObj.fieldInfo = fieldInfo.fieldItem;
6650
+ if (this.parent.actionBeginMethod()) {
6651
+ return;
6652
+ }
6629
6653
  let eventArgs = {
6630
6654
  cancel: false, fieldName: fieldName, aggregateTypes: this.summaryTypes, displayMenuCount: 7
6631
6655
  };
6632
6656
  let control = this.parent.getModuleName() === 'pivotfieldlist' && this.parent.isPopupView ?
6633
6657
  this.parent.pivotGridModule : this.parent;
6634
- control.trigger(aggregateMenuOpen, eventArgs, (observedArgs) => {
6635
- if (!observedArgs.cancel) {
6636
- this.summaryTypes = observedArgs.aggregateTypes;
6637
- this.createContextMenu(isStringField, observedArgs.displayMenuCount);
6638
- this.currentMenu = args.target;
6639
- let pos = this.currentMenu.getBoundingClientRect();
6640
- if (this.parent.enableRtl) {
6641
- this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left - 105);
6642
- }
6643
- else {
6644
- this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left);
6658
+ try {
6659
+ control.trigger(aggregateMenuOpen, eventArgs, (observedArgs) => {
6660
+ if (!observedArgs.cancel) {
6661
+ this.summaryTypes = observedArgs.aggregateTypes;
6662
+ this.createContextMenu(isStringField, observedArgs.displayMenuCount);
6663
+ this.currentMenu = args.target;
6664
+ let pos = this.currentMenu.getBoundingClientRect();
6665
+ if (this.parent.enableRtl) {
6666
+ this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left - 105);
6667
+ }
6668
+ else {
6669
+ this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left);
6670
+ }
6645
6671
  }
6646
- }
6647
- });
6672
+ });
6673
+ }
6674
+ catch (execption) {
6675
+ this.parent.actionFailureMethod(execption);
6676
+ }
6648
6677
  }
6649
6678
  createContextMenu(isStringField, displayMenuCount) {
6650
6679
  let menuItems = [];
@@ -6918,31 +6947,42 @@ class AggregateMenu {
6918
6947
  selectOptionInContextMenu(menu) {
6919
6948
  if (menu.item.text !== null) {
6920
6949
  let buttonElement = this.currentMenu.parentElement;
6921
- let type = menu.item.id.split('_').pop();
6922
- if (type === 'MoreOption' || type === 'PercentageOfDifferenceFrom'
6923
- || type === 'PercentageOfParentTotal' || type === 'DifferenceFrom') {
6924
- this.createValueSettingsDialog(buttonElement, this.parentElement, type);
6950
+ let fieldInfo = PivotUtil.getFieldInfo((buttonElement ? buttonElement.id : ''), this.parent);
6951
+ this.parent.actionObj.actionName = aggregateField;
6952
+ this.parent.actionObj.fieldInfo = fieldInfo.fieldItem;
6953
+ if (this.parent.actionBeginMethod()) {
6954
+ return;
6925
6955
  }
6926
- else {
6927
- let field = buttonElement.getAttribute('data-uid');
6928
- let valuefields = this.parent.dataSourceSettings.values;
6929
- let contentElement = buttonElement.querySelector('.e-content');
6930
- let captionName = menu.item.text + ' ' + this.parent.localeObj.getConstant('of') + ' ' +
6931
- this.parent.engineModule.fieldList[field].caption;
6932
- contentElement.innerHTML = captionName;
6933
- contentElement.setAttribute('title', captionName);
6934
- buttonElement.setAttribute('data-type', type);
6935
- for (let vCnt = 0; vCnt < this.parent.dataSourceSettings.values.length; vCnt++) {
6936
- if (this.parent.dataSourceSettings.values[vCnt].name === field) {
6937
- let dataSourceItem = extend({}, valuefields[vCnt].properties ?
6938
- valuefields[vCnt].properties : valuefields[vCnt], null, true);
6939
- dataSourceItem.type = type;
6940
- this.parent.engineModule.fieldList[field].aggregateType = type;
6941
- valuefields.splice(vCnt, 1, dataSourceItem);
6942
- this.parent.lastAggregationInfo = dataSourceItem;
6956
+ let type = menu.item.id.split('_').pop();
6957
+ try {
6958
+ if (type === 'MoreOption' || type === 'PercentageOfDifferenceFrom'
6959
+ || type === 'PercentageOfParentTotal' || type === 'DifferenceFrom') {
6960
+ this.createValueSettingsDialog(buttonElement, this.parentElement, type);
6961
+ }
6962
+ else {
6963
+ let field = buttonElement.getAttribute('data-uid');
6964
+ let valuefields = this.parent.dataSourceSettings.values;
6965
+ let contentElement = buttonElement.querySelector('.e-content');
6966
+ let captionName = menu.item.text + ' ' + this.parent.localeObj.getConstant('of') + ' ' +
6967
+ this.parent.engineModule.fieldList[field].caption;
6968
+ contentElement.innerHTML = captionName;
6969
+ contentElement.setAttribute('title', captionName);
6970
+ buttonElement.setAttribute('data-type', type);
6971
+ for (let vCnt = 0; vCnt < this.parent.dataSourceSettings.values.length; vCnt++) {
6972
+ if (this.parent.dataSourceSettings.values[vCnt].name === field) {
6973
+ let dataSourceItem = extend({}, valuefields[vCnt].properties ?
6974
+ valuefields[vCnt].properties : valuefields[vCnt], null, true);
6975
+ dataSourceItem.type = type;
6976
+ this.parent.engineModule.fieldList[field].aggregateType = type;
6977
+ valuefields.splice(vCnt, 1, dataSourceItem);
6978
+ this.parent.lastAggregationInfo = dataSourceItem;
6979
+ }
6943
6980
  }
6981
+ this.updateDataSource();
6944
6982
  }
6945
- this.updateDataSource();
6983
+ }
6984
+ catch (execption) {
6985
+ this.parent.actionFailureMethod(execption);
6946
6986
  }
6947
6987
  }
6948
6988
  }
@@ -7058,13 +7098,16 @@ class Render {
7058
7098
  this.resColWidth = (this.parent.showGroupingBar && this.parent.groupingBarModule) ? (this.parent.isAdaptive ? 180 : 250) :
7059
7099
  (this.parent.isAdaptive ? 140 : 200);
7060
7100
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
7061
- this.gridSettings = parent.gridSettings;
7101
+ this.gridSettings = this.parent.gridSettings;
7062
7102
  this.formatList = this.getFormatList();
7063
7103
  this.aggMenu = new AggregateMenu(this.parent);
7064
7104
  }
7065
7105
  /* eslint-disable-next-line */
7066
7106
  /** @hidden */
7067
- render() {
7107
+ render(refreshRequired) {
7108
+ if (refreshRequired) {
7109
+ this.initProperties();
7110
+ }
7068
7111
  this.resColWidth = (this.parent.showGroupingBar && this.parent.groupingBarModule) ? (this.parent.isAdaptive ? 180 : 250) :
7069
7112
  (this.parent.isAdaptive ? 140 : 200);
7070
7113
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
@@ -7128,6 +7171,30 @@ class Render {
7128
7171
  }
7129
7172
  this.parent.grid.on(headerRefreshed, this.refreshHeader, this);
7130
7173
  }
7174
+ initProperties() {
7175
+ this.rowStartPos = undefined;
7176
+ this.maxIndent = undefined;
7177
+ this.resColWidth = undefined;
7178
+ this.isOverflows = undefined;
7179
+ this.indentCollection = {};
7180
+ this.formatList = undefined;
7181
+ this.colPos = 0;
7182
+ this.colGrandPos = undefined;
7183
+ this.rowGrandPos = undefined;
7184
+ this.lastSpan = 0;
7185
+ this.field = undefined;
7186
+ this.fieldCaption = undefined;
7187
+ this.lvlCollection = {};
7188
+ this.hierarchyCollection = {};
7189
+ this.lvlPosCollection = {};
7190
+ this.hierarchyPosCollection = {};
7191
+ this.position = 0;
7192
+ this.measurePos = 0;
7193
+ this.maxMeasurePos = 0;
7194
+ this.hierarchyCount = 0;
7195
+ this.actualText = '';
7196
+ this.timeOutObj = undefined;
7197
+ }
7131
7198
  refreshHeader() {
7132
7199
  if (this.parent.enableVirtualization) {
7133
7200
  let mHdr = this.parent.element.querySelector('.' + MOVABLEHEADER_DIV);
@@ -7328,9 +7395,9 @@ class Render {
7328
7395
  this.parent.renderReactTemplates(); /* eslint-disable-line */
7329
7396
  }
7330
7397
  if (this.parent.isInitial) {
7398
+ this.parent.isInitial = false;
7331
7399
  this.parent.refreshData();
7332
7400
  }
7333
- this.parent.isInitial = false;
7334
7401
  this.parent.notify(contentReady, {});
7335
7402
  }
7336
7403
  setFocusOnLastCell() {
@@ -8134,7 +8201,7 @@ class Render {
8134
8201
  if (cell.isSum) {
8135
8202
  tCell.classList.add(SUMMARY);
8136
8203
  }
8137
- let isGrandSum = (isNullOrUndefined(cell.isGrandSum) && this.parent.dataSourceSettings.valueAxis === 'column' && this.parent.dataType === 'olap' &&
8204
+ let isGrandSum = (isNullOrUndefined(cell.isGrandSum) && (!isNullOrUndefined(this.parent.olapEngineModule) && this.parent.olapEngineModule.olapValueAxis === 'column') && this.parent.dataType === 'olap' &&
8138
8205
  ((this.colGrandPos - this.parent.dataSourceSettings.values.length) < Number(tCell.getAttribute('aria-colindex'))));
8139
8206
  if (cell.isGrandSum || (isGrandSum || this.colGrandPos === Number(tCell.getAttribute('aria-colindex'))) || this.rowGrandPos === Number(tCell.getAttribute('index'))) {
8140
8207
  tCell.classList.add('e-gtot');
@@ -8275,6 +8342,12 @@ class Render {
8275
8342
  }
8276
8343
  lvlPos++;
8277
8344
  }
8345
+ if (this.parent.dataSourceSettings.grandTotalsPosition === 'Top' && (!isNullOrUndefined(this.parent.olapEngineModule) && this.parent.olapEngineModule.olapValueAxis === 'row') && this.parent.dataType === 'olap' &&
8346
+ (cell.valueSort.levelName.toString()).indexOf(this.parent.localeObj.getConstant('grandTotal') + this.parent.dataSourceSettings.valueSortSettings.headerDelimiter) === 0) {
8347
+ tCell.appendChild(createElement('span', {
8348
+ className: NEXTSPAN,
8349
+ }));
8350
+ }
8278
8351
  if (cell.memberType === 3 && cell.level === -1 && Object.keys(this.lvlCollection).length > 1) {
8279
8352
  tCell.appendChild(createElement('span', {
8280
8353
  className: NEXTSPAN,
@@ -8586,8 +8659,8 @@ class Render {
8586
8659
  if (this.parent.currentView !== 'Chart') {
8587
8660
  if (this.gridSettings.height === 'auto' && parHeight && this.parent.element.querySelector('.' + GRID_HEADER)) {
8588
8661
  let rowColHeight = this.parent.element.querySelector('.' + GRID_HEADER).offsetHeight;
8589
- let gBarHeight = rowColHeight + (this.parent.element.querySelector('.' + GROUPING_BAR_CLASS) ?
8590
- this.parent.element.querySelector('.' + GROUPING_BAR_CLASS).offsetHeight : 0);
8662
+ let gBarHeight = rowColHeight + (this.parent.element.querySelector('.' + GRID_GROUPING_BAR_CLASS) ?
8663
+ this.parent.element.querySelector('.' + GRID_GROUPING_BAR_CLASS).offsetHeight : 0);
8591
8664
  let toolBarHeight = this.parent.element.querySelector('.' + GRID_TOOLBAR) ? 42 : 0;
8592
8665
  gridHeight = parHeight - (gBarHeight + toolBarHeight) - 1;
8593
8666
  gridHeight = gridHeight < 40 ? 40 : gridHeight;
@@ -10295,7 +10368,6 @@ class FilterDialog {
10295
10368
  if (this.allowExcelLikeFilter) {
10296
10369
  this.dialogPopUp.element.querySelector('.e-dlg-closeicon-btn').focus();
10297
10370
  }
10298
- this.parent.control.pivotButtonModule.memberTreeView = this.parent.filterDialog.memberTreeView;
10299
10371
  this.memberTreeView.nodeChecked =
10300
10372
  this.parent.control.pivotButtonModule.nodeStateModified.bind(this.parent.control.pivotButtonModule);
10301
10373
  this.allMemberSelect.nodeChecked =
@@ -11298,6 +11370,15 @@ class FilterDialog {
11298
11370
  if (this.dropMenu && !this.dropMenu.isDestroyed) {
11299
11371
  this.dropMenu.destroy();
11300
11372
  }
11373
+ if (this.memberTreeView && !this.memberTreeView.isDestroyed) {
11374
+ this.memberTreeView.destroy();
11375
+ }
11376
+ if (this.allMemberSelect && !this.allMemberSelect.isDestroyed) {
11377
+ this.allMemberSelect.destroy();
11378
+ }
11379
+ if (this.editorSearch && !this.editorSearch.isDestroyed) {
11380
+ this.editorSearch.destroy();
11381
+ }
11301
11382
  if (document.getElementById(this.parent.parentID + '_LevelDiv-popup')) {
11302
11383
  remove(document.getElementById(this.parent.parentID + '_LevelDiv-popup'));
11303
11384
  }
@@ -11306,11 +11387,23 @@ class FilterDialog {
11306
11387
  removeFilterDialog() {
11307
11388
  if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
11308
11389
  this.dialogPopUp.destroy();
11390
+ setTimeout(this.setFocus.bind(this));
11309
11391
  }
11310
11392
  if (document.getElementById(this.parent.parentID + '_EditorTreeView')) {
11311
11393
  remove(document.getElementById(this.parent.parentID + '_EditorTreeView'));
11312
11394
  }
11313
11395
  }
11396
+ setFocus() {
11397
+ if (this.parent.control.pivotButtonModule.parentElement) {
11398
+ let pivotButtons = [].slice.call(this.parent.control.pivotButtonModule.parentElement.querySelectorAll('.e-pivot-button'));
11399
+ for (let item of pivotButtons) {
11400
+ if (item.getAttribute('data-uid') === this.parent.control.pivotButtonModule.fieldName) {
11401
+ item.focus();
11402
+ break;
11403
+ }
11404
+ }
11405
+ }
11406
+ }
11314
11407
  }
11315
11408
 
11316
11409
  /**
@@ -11942,6 +12035,9 @@ __decorate$1([
11942
12035
  __decorate$1([
11943
12036
  Property(true)
11944
12037
  ], DataSourceSettings.prototype, "showGrandTotals", void 0);
12038
+ __decorate$1([
12039
+ Property('Bottom')
12040
+ ], DataSourceSettings.prototype, "grandTotalsPosition", void 0);
11945
12041
  __decorate$1([
11946
12042
  Property(true)
11947
12043
  ], DataSourceSettings.prototype, "showRowGrandTotals", void 0);
@@ -13160,138 +13256,155 @@ class DrillThroughDialog {
13160
13256
  this.clonedData.push(this.frameHeaderWithKeys(eventArgs.rawData[i]));
13161
13257
  }
13162
13258
  let actualText = eventArgs.currentCell.actualText.toString();
13163
- if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
13164
- this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
13165
- this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
13166
- this.editCell(eventArgs);
13167
- }
13168
- else {
13169
- this.removeDrillThroughDialog();
13170
- let drillThroughDialog = createElement('div', {
13171
- id: this.parent.element.id + '_drillthrough',
13172
- className: DRILLTHROUGH_DIALOG
13173
- });
13174
- this.parent.element.appendChild(drillThroughDialog);
13175
- this.dialogPopUp = new Dialog({
13176
- animationSettings: { effect: 'Fade' },
13177
- allowDragging: false,
13178
- header: this.parent.localeObj.getConstant('details'),
13179
- content: this.createDrillThroughGrid(eventArgs),
13180
- beforeOpen: () => {
13181
- this.drillThroughGrid.setProperties({
13182
- dataSource: this.parent.editSettings.allowEditing ?
13183
- this.dataWithPrimarykey(eventArgs) : this.gridData,
13184
- height: !this.parent.editSettings.allowEditing ? 300 : 220
13185
- }, false);
13186
- },
13187
- beforeClose: () => {
13188
- if (this.parent.editSettings.allowEditing && this.isUpdated) {
13189
- if (this.parent.dataSourceSettings.type === 'CSV') {
13190
- this.updateData(this.drillThroughGrid.dataSource);
13191
- }
13192
- let gridIndexObjectsValue = Object.keys(this.gridIndexObjects);
13193
- let previousPosition = [];
13194
- for (let value of gridIndexObjectsValue) {
13195
- previousPosition.push(this.gridIndexObjects[value]);
13196
- }
13197
- let count = Object.keys(this.gridIndexObjects).length;
13198
- let addItems = [];
13199
- let prevItems = [];
13200
- let index = 0;
13201
- /* eslint-disable @typescript-eslint/dot-notation */
13202
- for (let item of this.drillThroughGrid.dataSource) {
13203
- if (isNullOrUndefined(item['__index']) || item['__index'] === '') {
13204
- for (let field of this.engine.fields) {
13205
- if (isNullOrUndefined(item[field])) {
13206
- delete item[field];
13207
- }
13208
- }
13209
- delete item['__index'];
13210
- addItems.push(item);
13259
+ try {
13260
+ if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
13261
+ this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
13262
+ this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
13263
+ this.parent.actionObj.actionName = editRecord;
13264
+ if (this.parent.actionBeginMethod()) {
13265
+ return;
13266
+ }
13267
+ this.editCell(eventArgs);
13268
+ }
13269
+ else {
13270
+ this.removeDrillThroughDialog();
13271
+ let drillThroughDialog = createElement('div', {
13272
+ id: this.parent.element.id + '_drillthrough',
13273
+ className: DRILLTHROUGH_DIALOG
13274
+ });
13275
+ this.parent.element.appendChild(drillThroughDialog);
13276
+ this.dialogPopUp = new Dialog({
13277
+ animationSettings: { effect: 'Fade' },
13278
+ allowDragging: false,
13279
+ header: this.parent.localeObj.getConstant('details'),
13280
+ content: this.createDrillThroughGrid(eventArgs),
13281
+ beforeOpen: () => {
13282
+ this.drillThroughGrid.setProperties({
13283
+ dataSource: this.parent.editSettings.allowEditing ?
13284
+ this.dataWithPrimarykey(eventArgs) : this.gridData,
13285
+ height: !this.parent.editSettings.allowEditing ? 300 : 220
13286
+ }, false);
13287
+ },
13288
+ beforeClose: () => {
13289
+ if (this.parent.editSettings.allowEditing && this.isUpdated) {
13290
+ if (this.parent.dataSourceSettings.type === 'CSV') {
13291
+ this.updateData(this.drillThroughGrid.dataSource);
13211
13292
  }
13212
- else if (count > 0) {
13213
- delete this.gridIndexObjects[item['__index'].toString()];
13214
- prevItems.push(item);
13215
- count--;
13293
+ let gridIndexObjectsValue = Object.keys(this.gridIndexObjects);
13294
+ let previousPosition = [];
13295
+ for (let value of gridIndexObjectsValue) {
13296
+ previousPosition.push(this.gridIndexObjects[value]);
13216
13297
  }
13217
- if (this.parent.dataSourceSettings.mode === 'Server') {
13218
- if (item['__index']) {
13298
+ let count = Object.keys(this.gridIndexObjects).length;
13299
+ let addItems = [];
13300
+ let prevItems = [];
13301
+ let index = 0;
13302
+ /* eslint-disable @typescript-eslint/dot-notation */
13303
+ for (let item of this.drillThroughGrid.dataSource) {
13304
+ if (isNullOrUndefined(item['__index']) || item['__index'] === '') {
13305
+ for (let field of this.engine.fields) {
13306
+ if (isNullOrUndefined(item[field])) {
13307
+ delete item[field];
13308
+ }
13309
+ }
13219
13310
  delete item['__index'];
13311
+ addItems.push(item);
13220
13312
  }
13221
- if (this.gridData[index]['__index']) {
13222
- delete this.gridData[index]['__index'];
13313
+ else if (count > 0) {
13314
+ delete this.gridIndexObjects[item['__index'].toString()];
13315
+ prevItems.push(item);
13316
+ count--;
13223
13317
  }
13318
+ if (this.parent.dataSourceSettings.mode === 'Server') {
13319
+ if (item['__index']) {
13320
+ delete item['__index'];
13321
+ }
13322
+ if (this.gridData[index]['__index']) {
13323
+ delete this.gridData[index]['__index'];
13324
+ }
13325
+ }
13326
+ index++;
13224
13327
  }
13225
- index++;
13226
- }
13227
- count = 0;
13228
- if (this.parent.dataSourceSettings.mode === 'Server') {
13229
- let gridIndex = []; /* eslint-disable-line */
13230
- let keys = Object.keys(this.gridIndexObjects);
13231
- for (let len = 0; len < keys.length; len++) {
13232
- delete this.parent.drillThroughValue.indexObject[this.gridIndexObjects[keys[len]]];
13233
- gridIndex.push({ Key: keys[len], Value: this.gridIndexObjects[keys[len]] }); /* eslint-disable-line */
13234
- }
13235
- let indexObject = []; /* eslint-disable-line */
13236
- keys = Object.keys(this.parent.drillThroughValue.indexObject);
13237
- for (let len = 0; len < keys.length; len++) {
13238
- indexObject.push({ Key: keys[len], Value: this.parent.drillThroughValue.indexObject[keys[len]] }); /* eslint-disable-line */
13328
+ count = 0;
13329
+ if (this.parent.dataSourceSettings.mode === 'Server') {
13330
+ let gridIndex = []; /* eslint-disable-line */
13331
+ let keys = Object.keys(this.gridIndexObjects);
13332
+ for (let len = 0; len < keys.length; len++) {
13333
+ delete this.parent.drillThroughValue.indexObject[this.gridIndexObjects[keys[len]]];
13334
+ gridIndex.push({ Key: keys[len], Value: this.gridIndexObjects[keys[len]] }); /* eslint-disable-line */
13335
+ }
13336
+ let indexObject = []; /* eslint-disable-line */
13337
+ keys = Object.keys(this.parent.drillThroughValue.indexObject);
13338
+ for (let len = 0; len < keys.length; len++) {
13339
+ indexObject.push({ Key: keys[len], Value: this.parent.drillThroughValue.indexObject[keys[len]] }); /* eslint-disable-line */
13340
+ }
13341
+ this.parent.getEngine('updateRawData', null, null, null, null, null, null, null, { 'addedData': addItems, 'removedData': gridIndex, 'updatedData': prevItems, indexObject: indexObject });
13239
13342
  }
13240
- this.parent.getEngine('updateRawData', null, null, null, null, null, null, null, { 'addedData': addItems, 'removedData': gridIndex, 'updatedData': prevItems, indexObject: indexObject });
13241
- }
13242
- else {
13243
- let items = [];
13244
- let data = (this.parent.allowDataCompression && this.parent.enableVirtualization) ?
13245
- this.parent.engineModule.actualData : this.parent.engineModule.data;
13246
- for (let item of data) {
13247
- delete item['__index'];
13248
- if (this.gridIndexObjects[count.toString()] === undefined) {
13249
- items.push(item);
13343
+ else {
13344
+ let items = [];
13345
+ let data = (this.parent.allowDataCompression && this.parent.enableVirtualization) ?
13346
+ this.parent.engineModule.actualData : this.parent.engineModule.data;
13347
+ for (let item of data) {
13348
+ delete item['__index'];
13349
+ if (this.gridIndexObjects[count.toString()] === undefined) {
13350
+ items.push(item);
13351
+ }
13352
+ count++;
13353
+ }
13354
+ /* eslint-enable @typescript-eslint/dot-notation */
13355
+ items = items.concat(addItems);
13356
+ let eventArgs = {
13357
+ currentData: this.drillThroughGrid.dataSource,
13358
+ previousData: this.clonedData,
13359
+ previousPosition: previousPosition,
13360
+ cancel: false
13361
+ };
13362
+ this.parent.trigger(editCompleted, eventArgs);
13363
+ if (!eventArgs.cancel) {
13364
+ this.parent.setProperties({ dataSourceSettings: { dataSource: items } }, true);
13365
+ this.engine.updateGridData(this.parent.dataSourceSettings);
13366
+ this.parent.pivotValues = this.engine.pivotValues;
13250
13367
  }
13251
- count++;
13252
13368
  }
13253
- /* eslint-enable @typescript-eslint/dot-notation */
13254
- items = items.concat(addItems);
13255
- let eventArgs = {
13256
- currentData: this.drillThroughGrid.dataSource,
13257
- previousData: this.clonedData,
13258
- previousPosition: previousPosition,
13259
- cancel: false
13369
+ this.parent.actionObj.actionName = recordUpdated;
13370
+ let actionInfo = {
13371
+ editInfo: {
13372
+ type: this.drillThroughGrid.editSettings.mode, action: 'Update', currentData: this.drillThroughGrid.dataSource,
13373
+ previousData: this.clonedData, previousPosition: previousPosition
13374
+ }
13260
13375
  };
13261
- this.parent.trigger(editCompleted, eventArgs);
13262
- if (!eventArgs.cancel) {
13263
- this.parent.setProperties({ dataSourceSettings: { dataSource: items } }, true);
13264
- this.engine.updateGridData(this.parent.dataSourceSettings);
13265
- this.parent.pivotValues = this.engine.pivotValues;
13266
- }
13376
+ this.parent.actionObj.actionInfo = actionInfo;
13267
13377
  }
13268
- }
13269
- this.isUpdated = false;
13270
- this.gridIndexObjects = {};
13271
- },
13272
- isModal: true,
13273
- visible: true,
13274
- showCloseIcon: true,
13275
- locale: this.parent.locale,
13276
- enableRtl: this.parent.enableRtl,
13277
- width: this.parent.isAdaptive ? '100%' : '60%',
13278
- position: { X: 'center', Y: 'center' },
13279
- closeOnEscape: !this.parent.editSettings.allowEditing,
13280
- target: document.body,
13281
- close: this.removeDrillThroughDialog.bind(this)
13282
- });
13283
- this.dialogPopUp.isStringTemplate = true;
13284
- this.dialogPopUp.appendTo(drillThroughDialog);
13285
- // this.dialogPopUp.element.querySelector('.e-dlg-header').innerHTML = this.parent.localeObj.getConstant('details');
13286
- setStyleAttribute(this.dialogPopUp.element, { 'visibility': 'visible' });
13287
- if (this.parent.editSettings.allowEditing) {
13288
- this.drillthroughKeyboardModule = new KeyboardEvents(this.dialogPopUp.element, {
13289
- keyAction: this.drillthroughKeyActionHandler.bind(this),
13290
- keyConfigs: this.drillKeyConfigs,
13291
- eventName: 'keydown'
13378
+ this.isUpdated = false;
13379
+ this.gridIndexObjects = {};
13380
+ },
13381
+ isModal: true,
13382
+ visible: true,
13383
+ showCloseIcon: true,
13384
+ locale: this.parent.locale,
13385
+ enableRtl: this.parent.enableRtl,
13386
+ width: this.parent.isAdaptive ? '100%' : '60%',
13387
+ position: { X: 'center', Y: 'center' },
13388
+ closeOnEscape: !this.parent.editSettings.allowEditing,
13389
+ target: document.body,
13390
+ close: this.removeDrillThroughDialog.bind(this)
13292
13391
  });
13392
+ this.dialogPopUp.isStringTemplate = true;
13393
+ this.dialogPopUp.appendTo(drillThroughDialog);
13394
+ // this.dialogPopUp.element.querySelector('.e-dlg-header').innerHTML = this.parent.localeObj.getConstant('details');
13395
+ setStyleAttribute(this.dialogPopUp.element, { 'visibility': 'visible' });
13396
+ if (this.parent.editSettings.allowEditing) {
13397
+ this.drillthroughKeyboardModule = new KeyboardEvents(this.dialogPopUp.element, {
13398
+ keyAction: this.drillthroughKeyActionHandler.bind(this),
13399
+ keyConfigs: this.drillKeyConfigs,
13400
+ eventName: 'keydown'
13401
+ });
13402
+ }
13293
13403
  }
13294
13404
  }
13405
+ catch (execption) {
13406
+ this.parent.actionFailureMethod(execption);
13407
+ }
13295
13408
  }
13296
13409
  editCell(eventArgs) {
13297
13410
  let gridResize = this.parent.gridSettings.allowResizing;
@@ -13306,6 +13419,10 @@ class DrillThroughDialog {
13306
13419
  if (eventArgs.currentCell.actualText in previousData) {
13307
13420
  currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
13308
13421
  }
13422
+ let actionInfo = {
13423
+ editInfo: { type: 'Inline editing', action: 'update', data: this.gridData }
13424
+ };
13425
+ this.parent.actionObj.actionInfo = actionInfo;
13309
13426
  this.numericTextBox = new NumericTextBox({
13310
13427
  value: cellValue,
13311
13428
  enableRtl: this.parent.enableRtl,
@@ -13370,6 +13487,10 @@ class DrillThroughDialog {
13370
13487
  }
13371
13488
  removeDrillThroughDialog() {
13372
13489
  if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
13490
+ this.parent.actionObj.actionName = drillThroughClosed;
13491
+ if (this.parent.actionObj.actionName) {
13492
+ this.parent.actionCompleteMethod();
13493
+ }
13373
13494
  this.dialogPopUp.destroy();
13374
13495
  }
13375
13496
  let dialogElement = document.getElementById(this.parent.element.id + '_drillthrough');
@@ -13459,31 +13580,53 @@ class DrillThroughDialog {
13459
13580
  }
13460
13581
  if (this.parent.editSettings.allowEditing) {
13461
13582
  Grid.Inject(Edit, Page);
13462
- this.drillThroughGrid.editSettings = this.parent.editSettings;
13463
- if (this.parent.editSettings.allowCommandColumns) {
13464
- this.drillThroughGrid.editSettings.mode = 'Normal';
13465
- this.drillThroughGrid.editSettings.allowEditOnDblClick = false;
13466
- Grid.Inject(CommandColumn);
13583
+ try {
13584
+ this.drillThroughGrid.editSettings = this.parent.editSettings;
13585
+ this.drillThroughGrid.actionBegin = (args) => {
13586
+ let actionName = (args.requestType == 'save') ? saveEditedRecords : (args.requestType == 'add') ? addNewRecord : (args.requestType == 'delete') ? removeRecord : '';
13587
+ this.parent.actionObj.actionName = actionName;
13588
+ if (this.parent.actionObj.actionName) {
13589
+ if (this.parent.actionBeginMethod()) {
13590
+ return;
13591
+ }
13592
+ }
13593
+ };
13594
+ if (this.parent.editSettings.allowCommandColumns) {
13595
+ this.drillThroughGrid.editSettings.mode = 'Normal';
13596
+ this.drillThroughGrid.editSettings.allowEditOnDblClick = false;
13597
+ Grid.Inject(CommandColumn);
13598
+ this.drillThroughGrid.columns.push({
13599
+ headerText: this.parent.localeObj.getConstant('manageRecords'), width: 160, showInColumnChooser: false,
13600
+ commands: [
13601
+ { type: 'Edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' } },
13602
+ { type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' } },
13603
+ { type: 'Save', buttonOption: { iconCss: 'e-icons e-update', cssClass: 'e-flat' } },
13604
+ { type: 'Cancel', buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' } }
13605
+ ]
13606
+ });
13607
+ }
13608
+ else {
13609
+ this.drillThroughGrid.editSettings.allowEditOnDblClick = this.parent.editSettings.allowEditOnDblClick;
13610
+ }
13467
13611
  this.drillThroughGrid.columns.push({
13468
- headerText: this.parent.localeObj.getConstant('manageRecords'), width: 160, showInColumnChooser: false,
13469
- commands: [
13470
- { type: 'Edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' } },
13471
- { type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' } },
13472
- { type: 'Save', buttonOption: { iconCss: 'e-icons e-update', cssClass: 'e-flat' } },
13473
- { type: 'Cancel', buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' } }
13474
- ]
13612
+ field: '__index', visible: false, isPrimaryKey: true, type: 'string', showInColumnChooser: false
13475
13613
  });
13476
13614
  }
13477
- else {
13478
- this.drillThroughGrid.editSettings.allowEditOnDblClick = this.parent.editSettings.allowEditOnDblClick;
13615
+ catch (execption) {
13616
+ this.parent.actionFailureMethod(execption);
13479
13617
  }
13480
- this.drillThroughGrid.columns.push({
13481
- field: '__index', visible: false, isPrimaryKey: true, type: 'string', showInColumnChooser: false
13482
- });
13483
13618
  this.drillThroughGrid.actionComplete = (args) => {
13484
13619
  if (args.requestType === 'batchsave' || args.requestType === 'save' || args.requestType === 'delete') {
13485
13620
  dialogModule.isUpdated = true;
13486
13621
  }
13622
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
13623
+ let actionInfo = {
13624
+ editInfo: { type: this.drillThroughGrid.editSettings.mode, action: args.requestType, data: this.gridData }
13625
+ };
13626
+ this.parent.actionObj.actionInfo = actionInfo;
13627
+ if (this.parent.actionObj.actionName) {
13628
+ this.parent.actionCompleteMethod();
13629
+ }
13487
13630
  if ((dialogModule.drillThroughGrid.editSettings.mode === 'Normal' && args.requestType === 'save' &&
13488
13631
  dialogModule.drillThroughGrid.element.querySelectorAll('.e-tbar-btn:hover').length > 0 &&
13489
13632
  !dialogModule.parent.editSettings.allowCommandColumns) || args.requestType === 'batchsave') {
@@ -13672,7 +13815,7 @@ class DrillThrough {
13672
13815
  * @hidden
13673
13816
  */
13674
13817
  getModuleName() {
13675
- return 'drillthrough';
13818
+ return 'drillThrough';
13676
13819
  }
13677
13820
  addInternalEvents() {
13678
13821
  this.parent.on(contentReady, this.wireEvents, this);
@@ -13876,7 +14019,7 @@ class PivotChart {
13876
14019
  * @private
13877
14020
  */
13878
14021
  getModuleName() {
13879
- return 'pivotchart';
14022
+ return 'pivotChart';
13880
14023
  }
13881
14024
  /* eslint-disable */
13882
14025
  loadChart(parent, chartSettings) {
@@ -14067,7 +14210,9 @@ class PivotChart {
14067
14210
  this.maxLevel = currrentLevel > this.maxLevel ? currrentLevel : this.maxLevel;
14068
14211
  let name = this.parent.dataType === 'olap' ? firstRowCell.formattedText :
14069
14212
  (firstRowCell.actualText ? firstRowCell.actualText.toString() : firstRowCell.formattedText.toString());
14070
- let text = firstRowCell.formattedText ? firstRowCell.formattedText.toString() : name;
14213
+ let values = this.engineModule.fieldList[this.currentMeasure];
14214
+ let text = this.parent.dataSourceSettings.rows.length === 0 ? this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(values.aggregateType) + ' ' +
14215
+ this.parent.localeObj.getConstant('of') + ' ' + (!isNullOrUndefined(values.caption) ? values.caption : values.name) : firstRowCell.formattedText ? firstRowCell.formattedText.toString() : name;
14071
14216
  let caption = (firstRowCell.hasChild && !firstRowCell.isNamedSet) ?
14072
14217
  ((firstRowCell.isDrilled ? ' - ' : ' + ') + text) : text;
14073
14218
  let levelName = tupInfo ? tupInfo.uNameCollection : firstRowCell.valueSort.levelName.toString();
@@ -14241,7 +14386,9 @@ class PivotChart {
14241
14386
  this.chartSettings.palettes = currentSeries.palettes;
14242
14387
  }
14243
14388
  for (let i = 0; i < this.columnGroupObject[key].length; i++) {
14244
- this.columnGroupObject[key][i].x = this.columnGroupObject[key][i].x === '' ? this.parent.localeObj.getConstant('blank') : this.columnGroupObject[key][i].x;
14389
+ let values = this.engineModule.fieldList[this.currentMeasure];
14390
+ this.columnGroupObject[key][i].x = (this.parent.dataSourceSettings.rows.length === 0 && !this.chartSettings.showMultiLevelLabels) ? this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(values.aggregateType) + ' ' +
14391
+ this.parent.localeObj.getConstant('of') + ' ' + (!isNullOrUndefined(values.caption) ? values.caption : values.name) : this.columnGroupObject[key][i].x === '' ? this.parent.localeObj.getConstant('blank') : this.columnGroupObject[key][i].x;
14245
14392
  }
14246
14393
  currentSeries.dataSource = this.columnGroupObject[key];
14247
14394
  currentSeries.xName = 'x';
@@ -14397,7 +14544,7 @@ class PivotChart {
14397
14544
  enableSmartLabels: this.chartSettings.enableSmartLabels,
14398
14545
  center: this.chartSettings.pieCenter,
14399
14546
  enableBorderOnMouseMove: this.chartSettings.enableBorderOnMouseMove,
14400
- highLightMode: this.chartSettings.highlightMode,
14547
+ highlightMode: this.chartSettings.highlightMode,
14401
14548
  highlightPattern: this.chartSettings.highlightPattern,
14402
14549
  titleStyle: this.chartSettings.titleStyle,
14403
14550
  subTitle: this.chartSettings.subTitle,
@@ -14525,7 +14672,7 @@ class PivotChart {
14525
14672
  this.parent.chart.highlightPattern = this.parent.chartSettings.highlightPattern;
14526
14673
  if (this.accumulationType.indexOf(type) > -1) {
14527
14674
  this.parent.chart.enableBorderOnMouseMove = this.parent.chartSettings.enableBorderOnMouseMove;
14528
- this.parent.chart.highLightMode = this.parent.chartSettings.highlightMode;
14675
+ this.parent.chart.highlightMode = this.parent.chartSettings.highlightMode;
14529
14676
  this.parent.chart.enableSmartLabels = this.parent.chartSettings.enableSmartLabels;
14530
14677
  }
14531
14678
  else {
@@ -14632,9 +14779,14 @@ class PivotChart {
14632
14779
  currentYAxis.labelFormat = currentYAxis.labelFormat ?
14633
14780
  currentYAxis.labelFormat : (percentChart ? '' : (!resFormat ? format : 'N'));
14634
14781
  currentYAxis.title = currentYAxis.title ? currentYAxis.title : measureAggregatedName;
14635
- currentYAxis.plotOffsetTop = currentYAxis.plotOffsetTop ? currentYAxis.plotOffsetTop :
14636
- this.chartSettings.chartSeries.type === 'Bar' || this.chartSettings.chartSeries.type === 'StackingBar' ||
14637
- this.chartSettings.chartSeries.type === 'StackingBar100' ? 50 : 30;
14782
+ currentYAxis.edgeLabelPlacement = this.chartSettings.primaryYAxis.edgeLabelPlacement ? this.chartSettings.primaryYAxis.edgeLabelPlacement : this.persistSettings.primaryYAxis.edgeLabelPlacement;
14783
+ if (this.chartSettings.chartSeries.type === 'Bar' || this.chartSettings.chartSeries.type === 'StackingBar' ||
14784
+ this.chartSettings.chartSeries.type === 'StackingBar100') {
14785
+ currentYAxis.plotOffsetRight = currentYAxis.plotOffsetRight ? currentYAxis.plotOffsetRight : 30;
14786
+ }
14787
+ else {
14788
+ currentYAxis.plotOffsetTop = currentYAxis.plotOffsetTop ? currentYAxis.plotOffsetTop : 30;
14789
+ }
14638
14790
  if (!resFormat) {
14639
14791
  currentYAxis.name = this.measuresNames[item.name] ? this.measuresNames[item.name] : item.name;
14640
14792
  }
@@ -14680,6 +14832,7 @@ class PivotChart {
14680
14832
  currentYAxis = this.persistSettings.primaryYAxis ? this.frameObjectWithKeys(this.persistSettings.primaryYAxis) : currentYAxis;
14681
14833
  currentYAxis.rowIndex = 0;
14682
14834
  currentYAxis.columnIndex = 0;
14835
+ currentYAxis.edgeLabelPlacement = this.chartSettings.primaryYAxis.edgeLabelPlacement ? this.chartSettings.primaryYAxis.edgeLabelPlacement : this.persistSettings.primaryYAxis.edgeLabelPlacement;
14683
14836
  if (!(this.chartSettings.chartSeries.type === 'Polar' || this.chartSettings.chartSeries.type === 'Radar')) {
14684
14837
  currentYAxis.name = this.measuresNames[this.currentMeasure] ? this.measuresNames[this.currentMeasure] : this.currentMeasure;
14685
14838
  }
@@ -14996,6 +15149,7 @@ class PivotChart {
14996
15149
  }
14997
15150
  loaded(args) {
14998
15151
  this.parent.isChartLoaded = true;
15152
+ let width = this.parent.grid ? this.parent.getGridWidthAsNumber().toString() : this.parent.getWidthAsNumber().toString();
14999
15153
  if (this.parent.chart && this.parent.showGroupingBar && this.parent.groupingBarModule &&
15000
15154
  this.parent.showFieldList && this.parent.currentView === 'Chart') {
15001
15155
  this.parent.groupingBarModule.alignIcon();
@@ -15007,13 +15161,15 @@ class PivotChart {
15007
15161
  this.parent.element.querySelector('#' + this.parent.element.id + multilabelAxisName).setAttribute('cursor', 'pointer');
15008
15162
  }
15009
15163
  }
15010
- if ((['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) >= 0)
15011
- && this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
15012
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'visible';
15013
- }
15014
- else if (this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
15015
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'auto';
15016
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflowX = 'hidden';
15164
+ if (this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
15165
+ if (['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) >= 0) {
15166
+ this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'visible';
15167
+ }
15168
+ else {
15169
+ this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'auto';
15170
+ this.parent.element.querySelector('.' + PIVOTCHART).style.overflowX = 'hidden';
15171
+ }
15172
+ this.parent.element.querySelector('.' + PIVOTCHART).style.width = width + 'px';
15017
15173
  }
15018
15174
  this.parent.chart.height = ['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) < 0 &&
15019
15175
  this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis &&
@@ -15234,6 +15390,11 @@ class PivotChart {
15234
15390
  offSetHeight = this.parent.getHeightAsNumber() - offSetVal;
15235
15391
  }
15236
15392
  if (!isNullOrUndefined(this.parent.getHeightAsNumber())) {
15393
+ let isNone = false;
15394
+ if (this.parent.element.querySelector('.e-chart-grouping-bar') !== null && this.parent.element.querySelector('.e-chart-grouping-bar').style.display.toLowerCase() === 'none') {
15395
+ isNone = true;
15396
+ this.parent.element.querySelector('.e-chart-grouping-bar').style.display = "block";
15397
+ }
15237
15398
  if (this.parent.showToolbar && this.parent.showGroupingBar) {
15238
15399
  height = (offSetHeight - (this.parent.element.querySelector('.e-pivot-toolbar') ?
15239
15400
  this.parent.element.querySelector('.e-pivot-toolbar').clientHeight : 42) -
@@ -15251,6 +15412,9 @@ class PivotChart {
15251
15412
  else if ((this.parent.chart && parseInt(this.parent.chart.height, 10) < 200) || offSetHeight < 200) {
15252
15413
  height = '200';
15253
15414
  }
15415
+ if (isNone) {
15416
+ this.parent.element.querySelector('.e-chart-grouping-bar').style.display = "none";
15417
+ }
15254
15418
  }
15255
15419
  else {
15256
15420
  height = 'auto';
@@ -16851,7 +17015,7 @@ __decorate$3([
16851
17015
  Property(0)
16852
17016
  ], PivotAxis.prototype, "plotOffset", void 0);
16853
17017
  __decorate$3([
16854
- Property('None')
17018
+ Property('Shift')
16855
17019
  ], PivotAxis.prototype, "edgeLabelPlacement", void 0);
16856
17020
  __decorate$3([
16857
17021
  Property('BetweenTicks')
@@ -18146,6 +18310,7 @@ class OlapEngine {
18146
18310
  this.updateTupCollection(customArgs.drillInfo.axis === 'row' ? rowTuples.length : columnTuples.length);
18147
18311
  }
18148
18312
  if (customArgs.action === 'down' ? customArgs.drillInfo.axis === 'column' : true) {
18313
+ this.olapValueAxis = isNullOrUndefined(this.getValueAxis(undefined, undefined)) ? 'column' : 'row';
18149
18314
  this.frameColumnHeader(columnTuples);
18150
18315
  if (!this.isPaging) {
18151
18316
  this.performColumnSorting();
@@ -18200,6 +18365,7 @@ class OlapEngine {
18200
18365
  frameRowHeader(tuples) {
18201
18366
  this.headerGrouping = {};
18202
18367
  this.lastLevel = [];
18368
+ let isGrandTotalAdd = true;
18203
18369
  let position = this.pivotValues.length;
18204
18370
  let pivotValues = [];
18205
18371
  let valueContent = [];
@@ -18260,6 +18426,7 @@ class OlapEngine {
18260
18426
  let startTupPos = tupPos;
18261
18427
  let pagingAllowFlag = true;
18262
18428
  let lastMesPos = 0;
18429
+ let isGrandTotalTop = false;
18263
18430
  while (tupPos < tuplesLength && pagingAllowFlag) {
18264
18431
  let members = tuples[this.customArgs.action === 'down' ?
18265
18432
  (tupPos - (this.customArgs.drillInfo.currentCell.ordinal + 1)) : tupPos].querySelectorAll('Member');
@@ -18314,35 +18481,25 @@ class OlapEngine {
18314
18481
  (allStartPos === (drillStartPos + 1) || this.tupRowInfo[tupPos].measurePosition === (drillStartPos + 1))))
18315
18482
  : drillAllow;
18316
18483
  let withoutAllAllow = (withoutAllStartPos > -1 && allCount > 0) ? (attrDrill || allStartPos > withoutAllEndPos) : true;
18317
- if (members.length === allCount + (measure ? 1 : 0) && measure) {
18484
+ isGrandTotalTop = this.dataSourceSettings.grandTotalsPosition === 'Top' && this.olapRowValueIndex === 0 && this.olapValueAxis === 'row'
18485
+ && this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showRowGrandTotals && (this.olapValueAxis === 'row' ? this.dataSourceSettings.rows.length > 1 : true);
18486
+ if (isGrandTotalTop && gTotals.length === 1) {
18487
+ gTotals = this.frameGrandTotalValues(tuples, gTotals, typeColl, measurePos);
18488
+ }
18489
+ if (members.length === allCount + (measure ? 1 : 0) && measure && !isGrandTotalTop) {
18318
18490
  let levelName = 'Grand Total.' + members[measurePos].querySelector('Caption').textContent;
18319
- gTotals.push({
18320
- axis: 'row',
18321
- actualText: this.getUniqueName(members[measurePos].querySelector('UName').textContent),
18322
- colIndex: 0,
18323
- formattedText: (typeColl[measurePos] === '3' &&
18324
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
18325
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption) ?
18326
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption :
18327
- members[measurePos].querySelector('Caption').textContent,
18328
- hasChild: false,
18329
- level: -1,
18330
- rowIndex: position,
18331
- index: [],
18332
- ordinal: tupPos,
18333
- colSpan: 1,
18334
- rowSpan: 1,
18335
- memberType: Number(typeColl[measurePos]),
18336
- isDrilled: false,
18337
- parentUniqueName: members[measurePos].querySelector('PARENT_UNIQUE_NAME') ?
18338
- members[measurePos].querySelector('PARENT_UNIQUE_NAME').textContent : undefined,
18339
- levelUniqueName: members[measurePos].querySelector('LName').textContent,
18340
- hierarchy: members[measurePos].getAttribute('Hierarchy'),
18341
- valueSort: { levelName: levelName, axis: members[measurePos].getAttribute('Hierarchy') }
18342
- });
18491
+ let formattedText = (typeColl[measurePos] === '3' && this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
18492
+ this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption) ? this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption :
18493
+ members[measurePos].querySelector('Caption').textContent;
18494
+ gTotals = this.frameGrandTotalAxisSet(gTotals, this.getUniqueName(members[measurePos].querySelector('UName').textContent), formattedText, position, tupPos, Number(typeColl[measurePos]), members[measurePos].querySelector('PARENT_UNIQUE_NAME') ? members[measurePos].querySelector('PARENT_UNIQUE_NAME').textContent : undefined, members[measurePos].querySelector('LName').textContent, members[measurePos].getAttribute('Hierarchy'), { levelName: levelName, axis: members[measurePos].getAttribute('Hierarchy') });
18343
18495
  gTotals[gTotals.length - 1].valueSort['Grand Total.' + members[measurePos].querySelector('Caption').textContent] = 1;
18344
18496
  }
18345
18497
  else if (!(allStartPos === 0 || (measurePos === 0 && allStartPos === 1)) && drillAllow && withoutAllAllow) {
18498
+ if (this.dataSourceSettings.grandTotalsPosition === 'Top' && isGrandTotalAdd && this.dataSourceSettings.showGrandTotals && (this.olapValueAxis === 'row' ? this.dataSourceSettings.rows.length > 1 : true)) {
18499
+ this.insertRowGrandTotal(gTotals, valueContent, pivotValues, tuples, position);
18500
+ position = this.pivotValues.length;
18501
+ isGrandTotalAdd = false;
18502
+ }
18346
18503
  prevTupInfo = this.tupRowInfo[tupPos];
18347
18504
  let lastPos = position;
18348
18505
  let lastMemPos = memPos;
@@ -18433,6 +18590,11 @@ class OlapEngine {
18433
18590
  }
18434
18591
  tupPos++;
18435
18592
  }
18593
+ if (!(this.dataSourceSettings.grandTotalsPosition === 'Top') || (this.olapValueAxis === 'row' && this.dataSourceSettings.rows.length === 1 && this.dataSourceSettings.grandTotalsPosition === 'Top') || this.dataSourceSettings.rows.length === 0) {
18594
+ this.insertRowGrandTotal(gTotals, valueContent, pivotValues, tuples, position);
18595
+ }
18596
+ }
18597
+ insertRowGrandTotal(gTotals, valueContent, pivotValues, tuples, position) {
18436
18598
  if (gTotals.length > 1 && gTotals[0].memberType !== 3) {
18437
18599
  gTotals[0].ordinal = -1;
18438
18600
  }
@@ -18458,6 +18620,41 @@ class OlapEngine {
18458
18620
  this.updateRowEngine(pivotValues, valueContent, tuples.length);
18459
18621
  this.onDemandDrillEngine = pivotValues;
18460
18622
  }
18623
+ return gTotals;
18624
+ }
18625
+ getValueAxis(valueAxis, valueIndex) {
18626
+ this.olapValueAxis = valueAxis;
18627
+ this.olapRowValueIndex = valueIndex;
18628
+ for (let i = 0; i < this.dataSourceSettings.rows.length; i++) {
18629
+ if (this.dataSourceSettings.rows[i].name === '[Measures]') {
18630
+ this.olapValueAxis = 'row';
18631
+ this.olapRowValueIndex = i;
18632
+ break;
18633
+ }
18634
+ }
18635
+ return this.olapValueAxis;
18636
+ }
18637
+ frameGrandTotalAxisSet(gTotals, actualText, formattedText, rowIndex, ordinal, memberType, parentUniqueName, levelUniqueName, hierarchy, valueSort) {
18638
+ gTotals.push({
18639
+ axis: 'row',
18640
+ actualText: actualText,
18641
+ colIndex: 0,
18642
+ formattedText: formattedText,
18643
+ hasChild: false,
18644
+ level: -1,
18645
+ rowIndex: rowIndex,
18646
+ index: [],
18647
+ ordinal: ordinal,
18648
+ colSpan: 1,
18649
+ rowSpan: 1,
18650
+ memberType: memberType,
18651
+ isDrilled: false,
18652
+ parentUniqueName: parentUniqueName,
18653
+ levelUniqueName: levelUniqueName,
18654
+ hierarchy: hierarchy,
18655
+ valueSort: valueSort
18656
+ });
18657
+ return gTotals;
18461
18658
  }
18462
18659
  getDepth(tupInfo, uniqueName, memberType) {
18463
18660
  let memberPosition = tupInfo.uNameCollection.indexOf(uniqueName);
@@ -18697,6 +18894,53 @@ class OlapEngine {
18697
18894
  currTupCount--;
18698
18895
  }
18699
18896
  }
18897
+ frameGrandTotalValues(tuples, gTotals, typeColl, measurePos) {
18898
+ let tupPos = 0;
18899
+ let lastAllStartPos;
18900
+ let lastAllCount;
18901
+ let availAllMember = false;
18902
+ let withoutAllEndPos = -1;
18903
+ let isGrandtoalDataAdd = false;
18904
+ let prevTupInfo;
18905
+ let isGrandTotalTop = false;
18906
+ while (tupPos < tuples.length && !isGrandtoalDataAdd) {
18907
+ let members = tuples[this.customArgs.action === 'down' ?
18908
+ (tupPos - (this.customArgs.drillInfo.currentCell.ordinal + 1)) : tupPos].querySelectorAll('Member');
18909
+ let allCount = this.tupRowInfo[tupPos].allCount;
18910
+ let allStartPos = this.tupRowInfo[tupPos].allStartPos;
18911
+ let measure = this.tupRowInfo[tupPos].measure;
18912
+ let typeColl = this.tupRowInfo[tupPos].typeCollection;
18913
+ let drillStartPos = this.tupRowInfo[tupPos].drillStartPos;
18914
+ let startDrillUniquename = this.tupRowInfo[tupPos].startDrillUniquename;
18915
+ if (tupPos === 0 && (members.length > (allCount + (measure ? 1 : 0)) || (members.length === 1 && measure))) {
18916
+ gTotals.pop();
18917
+ }
18918
+ if ((tupPos === 0 && this.isPaging) ? gTotals.length === 0 :
18919
+ (!availAllMember || allCount === lastAllCount || allStartPos !== lastAllStartPos || (members.length === 1 && measure))) {
18920
+ let attrDrill = this.checkAttributeDrill(this.tupRowInfo[tupPos].drillInfo, 'rows');
18921
+ let drillAllow = drillStartPos > -1 ? (allCount > 0 ? (attrDrill || allStartPos > drillStartPos) : true) : true;
18922
+ drillAllow = (prevTupInfo && drillAllow && drillStartPos > -1) ?
18923
+ (prevTupInfo.startDrillUniquename !== startDrillUniquename ? true :
18924
+ ((withoutAllEndPos > prevTupInfo.measurePosition ? false :
18925
+ prevTupInfo.measureName !== this.tupRowInfo[tupPos].measureName) &&
18926
+ (allStartPos === (drillStartPos + 1) || this.tupRowInfo[tupPos].measurePosition === (drillStartPos + 1))))
18927
+ : drillAllow;
18928
+ if (members.length === allCount + (measure ? 1 : 0) && measure && !isGrandTotalTop) {
18929
+ let levelName = 'Grand Total.' + members[measurePos].querySelector('Caption').textContent;
18930
+ let formattedText = (typeColl[measurePos] === '3' && this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
18931
+ this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption) ? this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption :
18932
+ members[measurePos].querySelector('Caption').textContent;
18933
+ gTotals = this.frameGrandTotalAxisSet(gTotals, this.getUniqueName(members[measurePos].querySelector('UName').textContent), formattedText, this.pivotValues.length, tupPos, Number(typeColl[measurePos]), members[measurePos].querySelector('PARENT_UNIQUE_NAME') ? members[measurePos].querySelector('PARENT_UNIQUE_NAME').textContent : undefined, members[measurePos].querySelector('LName').textContent, members[measurePos].getAttribute('Hierarchy'), { levelName: levelName, axis: members[measurePos].getAttribute('Hierarchy') });
18934
+ gTotals[gTotals.length - 1].valueSort['Grand Total.' + members[measurePos].querySelector('Caption').textContent] = 1;
18935
+ }
18936
+ lastAllCount = allCount;
18937
+ lastAllStartPos = allStartPos;
18938
+ }
18939
+ isGrandtoalDataAdd = this.dataSourceSettings.values.length + 1 === gTotals.length ? true : false;
18940
+ tupPos++;
18941
+ }
18942
+ return gTotals;
18943
+ }
18700
18944
  frameColumnHeader(tuples) {
18701
18945
  this.headerGrouping = {};
18702
18946
  this.lastLevel = [];
@@ -18760,8 +19004,18 @@ class OlapEngine {
18760
19004
  withoutAllAvail = true;
18761
19005
  isStartCol = (allCount > 0 && isStartCol) ? (allStartPos > withoutAllStartPos) : isStartCol;
18762
19006
  }
18763
- if (isStartCol) {
18764
- if (allCount === 0) {
19007
+ let isGrandTotalTop = false;
19008
+ if (this.dataSourceSettings.grandTotalsPosition === 'Top' && this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showColumnGrandTotals) {
19009
+ let count = 0;
19010
+ for (let i = 0; i < members.length; i++) {
19011
+ if ((members[i].querySelector('Caption').textContent).indexOf('All') === 0) {
19012
+ count++;
19013
+ }
19014
+ }
19015
+ isGrandTotalTop = count === (this.olapValueAxis === 'column' ? this.dataSourceSettings.columns.length - 1 : this.dataSourceSettings.columns.length);
19016
+ }
19017
+ if (isStartCol || isGrandTotalTop) {
19018
+ if (allCount === 0 || isGrandTotalTop) {
18765
19019
  let levelComp = [-1, -1, -1];
18766
19020
  if (this.tupColumnInfo[tupPos - 1] && this.tupColumnInfo[tupPos - 1].allCount === 0) {
18767
19021
  levelComp = this.levelCompare(levelColl, this.tupColumnInfo[tupPos - 1].levelCollection);
@@ -18798,8 +19052,10 @@ class OlapEngine {
18798
19052
  }
18799
19053
  this.setParentCollection(members);
18800
19054
  if (withoutAllAvail ? (withoutAllEndPos <= drillStartPos) : true) {
18801
- this.totalCollection[this.totalCollection.length] =
18802
- ({ allCount: allCount, ordinal: tupPos, members: members, drillInfo: drillInfo });
19055
+ if (!isGrandTotalTop) {
19056
+ this.totalCollection[this.totalCollection.length] =
19057
+ ({ allCount: allCount, ordinal: tupPos, members: members, drillInfo: drillInfo });
19058
+ }
18803
19059
  lastSavedInfo.allCount = allCount;
18804
19060
  lastSavedInfo.allStartPos = allStartPos;
18805
19061
  lastSavedInfo.drillStartPos = drillStartPos;
@@ -18824,10 +19080,12 @@ class OlapEngine {
18824
19080
  }
18825
19081
  this.setParentCollection(members);
18826
19082
  if ((withoutAllAvail && drillStartPos > -1) ? (withoutAllEndPos <= drillStartPos) : true) {
18827
- this.totalCollection[this.totalCollection.length] =
18828
- ({
18829
- allCount: allCount, ordinal: tupPos, members: members, allStartPos: allStartPos, drillInfo: drillInfo
18830
- });
19083
+ if (!isGrandTotalTop) {
19084
+ this.totalCollection[this.totalCollection.length] =
19085
+ ({
19086
+ allCount: allCount, ordinal: tupPos, members: members, allStartPos: allStartPos, drillInfo: drillInfo
19087
+ });
19088
+ }
18831
19089
  lastSavedInfo.allCount = allCount;
18832
19090
  lastSavedInfo.allStartPos = allStartPos;
18833
19091
  lastSavedInfo.drillStartPos = drillStartPos;
@@ -19320,19 +19578,26 @@ class OlapEngine {
19320
19578
  }
19321
19579
  let newPos = 0;
19322
19580
  let totPos = 0;
19581
+ let valuePos = 0;
19323
19582
  gSumFlag = false;
19324
19583
  gSumGrouping = this.sortRowHeaders(gSumGrouping);
19325
19584
  for (let rPos = this.colDepth; rPos < rowCount; rPos++) {
19326
19585
  /* eslint-disable @typescript-eslint/dot-notation */
19586
+ if (this.dataSourceSettings.grandTotalsPosition === 'Top' && (this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showRowGrandTotals) &&
19587
+ ((this.olapValueAxis === 'column' && this.colDepth + 1 === rPos) || (this.olapValueAxis === 'row' && this.colDepth + this.dataSourceSettings.values.length + 1 === rPos))) {
19588
+ newPos = 0;
19589
+ gSumFlag = false;
19590
+ }
19327
19591
  let cell = gSumFlag ? gSumGrouping : sortLvlGrouping[levels[0]]['parent'];
19328
19592
  /* eslint-enable @typescript-eslint/dot-notation */
19329
- let currPos = gSumFlag ? (newPos - totPos) : newPos;
19593
+ let currPos = (this.dataSourceSettings.grandTotalsPosition === 'Top' && (this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showRowGrandTotals) && this.colDepth === rPos) ? cell.length : gSumFlag ? (newPos - totPos) : newPos;
19330
19594
  if (cell[currPos]) {
19331
19595
  this.pivotValues[rPos] = [cell[currPos]];
19332
19596
  this.pivotValues[rPos][0].rowIndex = rPos;
19333
- this.valueContent[newPos][0] = this.pivotValues[rPos][0];
19597
+ this.valueContent[valuePos][0] = this.pivotValues[rPos][0];
19334
19598
  }
19335
19599
  newPos++;
19600
+ valuePos++;
19336
19601
  if (this.pivotValues[rPos][0].type === 'grand sum') {
19337
19602
  gSumFlag = true;
19338
19603
  totPos = newPos;
@@ -21574,6 +21839,8 @@ let PivotView = class PivotView extends Component {
21574
21839
  this.request = new XMLHttpRequest();
21575
21840
  /** @hidden */
21576
21841
  this.isServerWaitingPopup = false;
21842
+ /** @hidden */
21843
+ this.actionObj = {};
21577
21844
  this.pivotView = this;
21578
21845
  setValue('mergePersistData', this.mergePersistPivotData, this);
21579
21846
  }
@@ -21615,10 +21882,10 @@ let PivotView = class PivotView extends Component {
21615
21882
  modules.push({ args: [this], member: 'grouping' });
21616
21883
  }
21617
21884
  if (this.allowDrillThrough || (this.editSettings && this.editSettings.allowEditing)) {
21618
- modules.push({ args: [this], member: 'drillthrough' });
21885
+ modules.push({ args: [this], member: 'drillThrough' });
21619
21886
  }
21620
21887
  if (this.displayOption.view !== 'Table') {
21621
- modules.push({ args: [this], member: 'pivotchart' });
21888
+ modules.push({ args: [this], member: 'pivotChart' });
21622
21889
  }
21623
21890
  return modules;
21624
21891
  }
@@ -22197,7 +22464,7 @@ let PivotView = class PivotView extends Component {
22197
22464
  this.setProperties({ gridSettings: { allowSelection: true, selectionSettings: { cellSelectionMode: 'Box', mode: 'Cell', type: 'Multiple' } } }, true);
22198
22465
  }
22199
22466
  if (this.displayOption.view !== 'Table') {
22200
- this.chartModule = new PivotChart();
22467
+ this.pivotChartModule = new PivotChart();
22201
22468
  }
22202
22469
  this.currentView = this.currentView ? this.currentView : (this.displayOption.view === 'Both' ?
22203
22470
  this.displayOption.primary : this.displayOption.view);
@@ -22462,32 +22729,37 @@ let PivotView = class PivotView extends Component {
22462
22729
  }
22463
22730
  }
22464
22731
  initialLoad() {
22465
- this.cellTemplateFn = this.templateParser(this.cellTemplate);
22466
- this.tooltipTemplateFn = this.templateParser(this.tooltipTemplate);
22467
- if (this.spinnerTemplate) {
22468
- createSpinner({ target: this.element, template: this.spinnerTemplate }, this.createElement);
22469
- }
22470
- else {
22471
- createSpinner({ target: this.element }, this.createElement);
22472
- }
22473
- let loadArgs = {
22474
- dataSourceSettings: this.dataSourceSettings,
22475
- pivotview: this,
22476
- fieldsType: {}
22477
- };
22478
- this.trigger(load, loadArgs, (observedArgs) => {
22479
- this.dataSourceSettings = observedArgs.dataSourceSettings;
22480
- this.fieldsType = observedArgs.fieldsType;
22481
- this.updateClass();
22482
- this.notify(initSubComponent, {});
22483
- if (this.dataSourceSettings.mode !== 'Server') {
22484
- this.notify(initialLoad, {});
22732
+ try {
22733
+ this.cellTemplateFn = this.templateParser(this.cellTemplate);
22734
+ this.tooltipTemplateFn = this.templateParser(this.tooltipTemplate);
22735
+ if (this.spinnerTemplate) {
22736
+ createSpinner({ target: this.element, template: this.spinnerTemplate }, this.createElement);
22485
22737
  }
22486
- if (this.isAdaptive) {
22487
- this.contextMenuModule.render();
22738
+ else {
22739
+ createSpinner({ target: this.element }, this.createElement);
22488
22740
  }
22489
- this.notify(initToolbar, {});
22490
- });
22741
+ let loadArgs = {
22742
+ dataSourceSettings: this.dataSourceSettings,
22743
+ pivotview: this,
22744
+ fieldsType: {}
22745
+ };
22746
+ this.trigger(load, loadArgs, (observedArgs) => {
22747
+ this.dataSourceSettings = observedArgs.dataSourceSettings;
22748
+ this.fieldsType = observedArgs.fieldsType;
22749
+ this.updateClass();
22750
+ this.notify(initSubComponent, {});
22751
+ if (this.dataSourceSettings.mode !== 'Server') {
22752
+ this.notify(initialLoad, {});
22753
+ }
22754
+ if (this.isAdaptive) {
22755
+ this.contextMenuModule.render();
22756
+ }
22757
+ this.notify(initToolbar, {});
22758
+ });
22759
+ }
22760
+ catch (execption) {
22761
+ this.actionFailureMethod(execption);
22762
+ }
22491
22763
  }
22492
22764
  /**
22493
22765
  * Register the internal events.
@@ -22725,15 +22997,15 @@ let PivotView = class PivotView extends Component {
22725
22997
  if (!this.grid && newProp.displayOption.view !== 'Chart') {
22726
22998
  this.renderEmptyGrid();
22727
22999
  if (newProp.displayOption.view === 'Table') {
22728
- if (this.chartModule) {
22729
- this.chartModule.destroy();
23000
+ if (this.pivotChartModule) {
23001
+ this.pivotChartModule.destroy();
22730
23002
  this.chart = undefined;
22731
- this.chartModule = undefined;
23003
+ this.pivotChartModule = undefined;
22732
23004
  }
22733
23005
  }
22734
23006
  }
22735
- else if (!this.chartModule && this.displayOption.view !== 'Table') {
22736
- this.chartModule = new PivotChart();
23007
+ else if (!this.pivotChartModule && this.displayOption.view !== 'Table') {
23008
+ this.pivotChartModule = new PivotChart();
22737
23009
  }
22738
23010
  }
22739
23011
  else if (this.showToolbar && !isNullOrUndefined(newProp.displayOption) && newProp.displayOption.view) {
@@ -22763,12 +23035,12 @@ let PivotView = class PivotView extends Component {
22763
23035
  (newProp.chartSettings.chartSeries && Object.keys(newProp.chartSettings.chartSeries).indexOf('type') !== -1))) {
22764
23036
  this.groupingBarModule.renderLayout();
22765
23037
  }
22766
- if (isNullOrUndefined(this.chartModule) && this.displayOption.view !== 'Table') {
22767
- this.chartModule = new PivotChart();
23038
+ if (isNullOrUndefined(this.pivotChartModule) && this.displayOption.view !== 'Table') {
23039
+ this.pivotChartModule = new PivotChart();
22768
23040
  }
22769
23041
  let engineModule = this.dataType === 'pivot' ? this.engineModule : this.olapEngineModule;
22770
- if (!isNullOrUndefined(this.chartModule) && !isNullOrUndefined(engineModule.pivotValues)) {
22771
- this.chartModule.loadChart(this, this.chartSettings);
23042
+ if (!isNullOrUndefined(this.pivotChartModule) && !isNullOrUndefined(engineModule.pivotValues)) {
23043
+ this.pivotChartModule.loadChart(this, this.chartSettings);
22772
23044
  }
22773
23045
  if (!isNullOrUndefined(engineModule.pivotValues) && !isNullOrUndefined(engineModule.fieldList)) {
22774
23046
  this.notify(uiUpdate, this);
@@ -22891,9 +23163,9 @@ let PivotView = class PivotView extends Component {
22891
23163
  */
22892
23164
  renderPivotGrid() {
22893
23165
  this.clearTemplate();
22894
- if (this.chartModule) {
22895
- this.chartModule.engineModule = this.engineModule;
22896
- this.chartModule.loadChart(this, this.chartSettings);
23166
+ if (this.pivotChartModule) {
23167
+ this.pivotChartModule.engineModule = this.engineModule;
23168
+ this.pivotChartModule.loadChart(this, this.chartSettings);
22897
23169
  if (this.enableRtl && this.chart && document.body.getAttribute('dir') !== 'rtl') {
22898
23170
  addClass([this.chart.element], PIVOTCHART_LTR);
22899
23171
  }
@@ -22924,7 +23196,7 @@ let PivotView = class PivotView extends Component {
22924
23196
  this.applyHyperlinkSettings();
22925
23197
  }
22926
23198
  this.renderModule = this.renderModule ? this.renderModule : new Render(this);
22927
- this.renderModule.render();
23199
+ this.renderModule.render(true);
22928
23200
  }
22929
23201
  else if (this.grid) {
22930
23202
  remove(this.grid.element);
@@ -22940,7 +23212,9 @@ let PivotView = class PivotView extends Component {
22940
23212
  if (this.toolbarModule && this.toolbarModule.toolbar) {
22941
23213
  this.toolbarModule.toolbar.width = this.getGridWidthAsNumber() - 2;
22942
23214
  }
22943
- this.chart.element.style.width = formatUnit(this.getGridWidthAsNumber());
23215
+ if (this.chartSettings.enableScrollOnMultiAxis && this.chartSettings.enableMultipleAxis) {
23216
+ this.element.querySelector('.' + PIVOTCHART).style.width = formatUnit(this.getGridWidthAsNumber());
23217
+ }
22944
23218
  this.chart.width = formatUnit(this.getGridWidthAsNumber());
22945
23219
  if (this.currentView === 'Table') {
22946
23220
  this.grid.element.style.display = '';
@@ -22960,7 +23234,13 @@ let PivotView = class PivotView extends Component {
22960
23234
  }
22961
23235
  if (this.toolbarModule) {
22962
23236
  if (this.showFieldList && select('#' + this.element.id + '_PivotFieldList', this.element)) {
22963
- select('#' + this.element.id + '_PivotFieldList', this.element).style.display = 'none';
23237
+ if (this.toolbar && this.toolbar.indexOf('FieldList') !== -1) {
23238
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.display = 'none';
23239
+ }
23240
+ else {
23241
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.top = this.element.querySelector('.' + GRID_TOOLBAR).offsetHeight.toString() + 'px';
23242
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.position = 'relative';
23243
+ }
22964
23244
  }
22965
23245
  if (this.toolbar && this.toolbar.indexOf('FieldList') !== -1 &&
22966
23246
  this.showToolbar && this.element.querySelector('.e-toggle-field-list')) {
@@ -23111,7 +23391,9 @@ let PivotView = class PivotView extends Component {
23111
23391
  isDrillThrough: (pivot.allowDrillThrough || pivot.editSettings.allowEditing),
23112
23392
  localeObj: pivot.localeObj,
23113
23393
  fieldsType: pivot.fieldsType,
23114
- clonedReport: pivot.clonedReport
23394
+ clonedReport: pivot.clonedReport,
23395
+ globalize: pivot.globalize,
23396
+ currenyCode: pivot.currencyCode
23115
23397
  };
23116
23398
  /* eslint-enable @typescript-eslint/indent */
23117
23399
  if (pivot.dataSourceSettings.mode === 'Server') {
@@ -23161,6 +23443,14 @@ let PivotView = class PivotView extends Component {
23161
23443
  this.exportType = 'Excel';
23162
23444
  this.grid.excelExport(excelExportProperties, isMultipleExport, workbook, isBlob);
23163
23445
  }
23446
+ this.actionObj.actionName = this.getActionCompleteName();
23447
+ let actionInfo = {
23448
+ exportInfo: { type: this.exportType, info: excelExportProperties }
23449
+ };
23450
+ this.actionObj.actionInfo = actionInfo;
23451
+ if (this.actionObj.actionName) {
23452
+ this.actionCompleteMethod();
23453
+ }
23164
23454
  }
23165
23455
  /**
23166
23456
  * Export PivotGrid data to CSV file.
@@ -23178,6 +23468,14 @@ let PivotView = class PivotView extends Component {
23178
23468
  this.exportType = 'CSV';
23179
23469
  this.grid.csvExport(excelExportProperties, isMultipleExport, workbook, isBlob);
23180
23470
  }
23471
+ this.actionObj.actionName = this.getActionCompleteName();
23472
+ let actionInfo = {
23473
+ exportInfo: { type: this.exportType, info: excelExportProperties }
23474
+ };
23475
+ this.actionObj.actionInfo = actionInfo;
23476
+ if (this.actionObj.actionName) {
23477
+ this.actionCompleteMethod();
23478
+ }
23181
23479
  }
23182
23480
  /**
23183
23481
  * Export Pivot widget data to PDF document.
@@ -23194,6 +23492,14 @@ let PivotView = class PivotView extends Component {
23194
23492
  else {
23195
23493
  this.grid.pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
23196
23494
  }
23495
+ this.actionObj.actionName = this.getActionCompleteName();
23496
+ let actionInfo = {
23497
+ exportInfo: { type: 'PDF', info: pdfExportProperties }
23498
+ };
23499
+ this.actionObj.actionInfo = actionInfo;
23500
+ if (this.actionObj.actionName) {
23501
+ this.actionCompleteMethod();
23502
+ }
23197
23503
  }
23198
23504
  /**
23199
23505
  * Export method for the chart.
@@ -23208,6 +23514,14 @@ let PivotView = class PivotView extends Component {
23208
23514
  if (this.chart && this.chart.enableExport) {
23209
23515
  this.chart.exportModule.export(type, fileName, orientation, null, width, height);
23210
23516
  }
23517
+ this.actionObj.actionName = this.getActionCompleteName();
23518
+ let actionInfo = {
23519
+ exportInfo: { type: type, info: fileName }
23520
+ };
23521
+ this.actionObj.actionInfo = actionInfo;
23522
+ if (this.actionObj.actionName) {
23523
+ this.actionCompleteMethod();
23524
+ }
23211
23525
  }
23212
23526
  /**
23213
23527
  * Print method for the chart.
@@ -23318,6 +23632,10 @@ let PivotView = class PivotView extends Component {
23318
23632
  };
23319
23633
  this.trigger(enginePopulated, eventArgs);
23320
23634
  pivot.engineModule.pivotValues = eventArgs.pivotValues;
23635
+ let actionInfo = {
23636
+ drillInfo: drilledItem
23637
+ };
23638
+ this.actionObj.actionInfo = actionInfo;
23321
23639
  pivot.renderPivotGrid();
23322
23640
  }
23323
23641
  else {
@@ -23665,6 +23983,12 @@ let PivotView = class PivotView extends Component {
23665
23983
  this.unwireEvents();
23666
23984
  this.wireEvents();
23667
23985
  this.isChartLoaded = false;
23986
+ this.actionObj.actionName = this.getActionCompleteName();
23987
+ if (this.actionObj.actionName) {
23988
+ if (this.actionObj.actionName !== windowResize) {
23989
+ this.actionCompleteMethod();
23990
+ }
23991
+ }
23668
23992
  }
23669
23993
  setToolTip(args) {
23670
23994
  let colIndex = Number(args.target.getAttribute('aria-colindex'));
@@ -23696,6 +24020,13 @@ let PivotView = class PivotView extends Component {
23696
24020
  if (cell && this.engineModule.fieldList[cell.actualText]) {
23697
24021
  let field = this.engineModule.fieldList[cell.actualText];
23698
24022
  aggregateType = field.aggregateType;
24023
+ if ((aggregateType !== 'DistinctCount') && (field.type !== 'number' || field.type === 'include' ||
24024
+ field.type === 'exclude')) {
24025
+ aggregateType = 'Count';
24026
+ }
24027
+ else {
24028
+ aggregateType = (aggregateType === undefined) ? 'Sum' : field.aggregateType;
24029
+ }
23699
24030
  caption = field.caption;
23700
24031
  hasField = true;
23701
24032
  }
@@ -23915,75 +24246,104 @@ let PivotView = class PivotView extends Component {
23915
24246
  ele = target.parentElement.parentElement;
23916
24247
  }
23917
24248
  this.CellClicked(target, e);
23918
- if ((ele.parentElement.parentElement.parentElement.parentElement.classList.contains('e-movableheader')
23919
- && this.dataSourceSettings.valueAxis === 'column') || (ele.parentElement.classList.contains('e-row') &&
23920
- this.dataSourceSettings.valueAxis === 'row') && (ele.classList.contains('e-rowsheader') ||
23921
- ele.classList.contains('e-stot'))) {
23922
- let colIndex = Number(ele.getAttribute('aria-colindex'));
23923
- let rowIndex = Number(ele.getAttribute('index'));
23924
- if (this.dataSourceSettings.valueAxis === 'row' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
23925
- let header = this.pivotValues[rowIndex][colIndex];
23926
- if (this.dataSourceSettings.valueIndex === -1) {
23927
- rowIndex = header.type === 'value' ? rowIndex : (rowIndex + 1);
23928
- }
23929
- else {
23930
- let level = this.getLevel(header);
23931
- rowIndex = (level <= this.engineModule.measureIndex &&
23932
- header.members && header.members.length > 0) ? header.members[0].rowIndex : rowIndex;
24249
+ try {
24250
+ if ((ele.parentElement.parentElement.parentElement.parentElement.classList.contains('e-movableheader')
24251
+ && this.dataSourceSettings.valueAxis === 'column') || (ele.parentElement.classList.contains('e-row') &&
24252
+ this.dataSourceSettings.valueAxis === 'row') && (ele.classList.contains('e-rowsheader') ||
24253
+ ele.classList.contains('e-stot'))) {
24254
+ let FieldName = target.parentElement.getAttribute('fieldname');
24255
+ let fieldInfo = PivotUtil.getFieldInfo(FieldName, this);
24256
+ this.actionObj.actionName = sortValue;
24257
+ this.actionObj.fieldInfo = fieldInfo.fieldItem;
24258
+ if (this.actionBeginMethod()) {
24259
+ return;
23933
24260
  }
23934
- }
23935
- else if (this.dataSourceSettings.valueAxis === 'column' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
23936
- colIndex = (Number(ele.getAttribute('aria-colindex')) + Number(ele.getAttribute('aria-colspan')) - 1);
23937
- rowIndex = this.engineModule.headerContent.length - 1;
23938
- }
23939
- this.setProperties({
23940
- dataSourceSettings: {
23941
- valueSortSettings: {
23942
- columnIndex: (Number(ele.getAttribute('aria-colindex')) +
23943
- Number(ele.getAttribute('aria-colspan')) - 1),
23944
- sortOrder: this.dataSourceSettings.valueSortSettings.sortOrder === 'Descending' ? 'Ascending' : 'Descending',
23945
- headerText: this.pivotValues[rowIndex][colIndex].valueSort.levelName,
23946
- headerDelimiter: this.dataSourceSettings.valueSortSettings.headerDelimiter ?
23947
- this.dataSourceSettings.valueSortSettings.headerDelimiter : '.'
24261
+ let colIndex = Number(ele.getAttribute('aria-colindex'));
24262
+ let rowIndex = Number(ele.getAttribute('index'));
24263
+ if (this.dataSourceSettings.valueAxis === 'row' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
24264
+ let header = this.pivotValues[rowIndex][colIndex];
24265
+ if (this.dataSourceSettings.valueIndex === -1) {
24266
+ rowIndex = header.type === 'value' ? rowIndex : (rowIndex + 1);
23948
24267
  }
23949
- }
23950
- }, true);
23951
- this.showWaitingPopup();
23952
- let pivot = this; /* eslint-disable-line */
23953
- pivot.engineModule.enableValueSorting = true;
23954
- if (pivot.enableVirtualization) {
23955
- if (pivot.dataSourceSettings.enableSorting) {
23956
- for (let key of Object.keys(pivot.engineModule.fieldList)) {
23957
- pivot.engineModule.fieldList[key].sort = 'Ascending';
24268
+ else {
24269
+ let level = this.getLevel(header);
24270
+ rowIndex = (level <= this.engineModule.measureIndex &&
24271
+ header.members && header.members.length > 0) ? header.members[0].rowIndex : rowIndex;
24272
+ }
24273
+ }
24274
+ else if (this.dataSourceSettings.valueAxis === 'column' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
24275
+ colIndex = (Number(ele.getAttribute('aria-colindex')) + Number(ele.getAttribute('aria-colspan')) - 1);
24276
+ rowIndex = this.engineModule.headerContent.length - 1;
24277
+ }
24278
+ this.setProperties({
24279
+ dataSourceSettings: {
24280
+ valueSortSettings: {
24281
+ columnIndex: (Number(ele.getAttribute('aria-colindex')) +
24282
+ Number(ele.getAttribute('aria-colspan')) - 1),
24283
+ sortOrder: this.dataSourceSettings.valueSortSettings.sortOrder === 'Descending' ? 'Ascending' : 'Descending',
24284
+ headerText: this.pivotValues[rowIndex][colIndex].valueSort.levelName,
24285
+ headerDelimiter: this.dataSourceSettings.valueSortSettings.headerDelimiter ?
24286
+ this.dataSourceSettings.valueSortSettings.headerDelimiter : '.'
24287
+ }
24288
+ }
24289
+ }, true);
24290
+ this.showWaitingPopup();
24291
+ let pivot = this; /* eslint-disable-line */
24292
+ pivot.engineModule.enableValueSorting = true;
24293
+ if (pivot.enableVirtualization) {
24294
+ if (pivot.dataSourceSettings.enableSorting) {
24295
+ for (let key of Object.keys(pivot.engineModule.fieldList)) {
24296
+ pivot.engineModule.fieldList[key].sort = 'Ascending';
24297
+ }
24298
+ pivot.setProperties({ dataSourceSettings: { sortSettings: [] } }, true);
24299
+ }
24300
+ if (pivot.dataSourceSettings.mode === 'Server') {
24301
+ pivot.getEngine('onValueSort', null, null, null, null, null, null);
24302
+ }
24303
+ else {
24304
+ pivot.engineModule.rMembers = pivot.engineModule.headerCollection.rowHeaders;
24305
+ pivot.engineModule.cMembers = pivot.engineModule.headerCollection.columnHeaders;
24306
+ pivot.engineModule.applyValueSorting();
24307
+ pivot.engineModule.updateEngine();
23958
24308
  }
23959
- pivot.setProperties({ dataSourceSettings: { sortSettings: [] } }, true);
23960
24309
  }
23961
- if (pivot.dataSourceSettings.mode === 'Server') {
24310
+ else if (pivot.dataSourceSettings.mode === 'Server') {
23962
24311
  pivot.getEngine('onValueSort', null, null, null, null, null, null);
23963
24312
  }
23964
24313
  else {
23965
- pivot.engineModule.rMembers = pivot.engineModule.headerCollection.rowHeaders;
23966
- pivot.engineModule.cMembers = pivot.engineModule.headerCollection.columnHeaders;
23967
- pivot.engineModule.applyValueSorting();
23968
- pivot.engineModule.updateEngine();
24314
+ pivot.engineModule.generateGridData(pivot.dataSourceSettings, true);
23969
24315
  }
24316
+ pivot.allowServerDataBinding = false;
24317
+ pivot.setProperties({ pivotValues: pivot.engineModule.pivotValues }, true);
24318
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
24319
+ delete pivot.bulkChanges.pivotValues;
24320
+ pivot.allowServerDataBinding = true;
24321
+ let actionInfo = {
24322
+ valueSortInfo: this.engineModule.valueSortSettings
24323
+ };
24324
+ this.actionObj.actionInfo = actionInfo;
24325
+ pivot.renderPivotGrid();
23970
24326
  }
23971
- else if (pivot.dataSourceSettings.mode === 'Server') {
23972
- pivot.getEngine('onValueSort', null, null, null, null, null, null);
23973
- }
23974
- else {
23975
- pivot.engineModule.generateGridData(pivot.dataSourceSettings, true);
23976
- }
23977
- pivot.allowServerDataBinding = false;
23978
- pivot.setProperties({ pivotValues: pivot.engineModule.pivotValues }, true);
23979
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
23980
- delete pivot.bulkChanges.pivotValues;
23981
- pivot.allowServerDataBinding = true;
23982
- pivot.renderPivotGrid();
24327
+ }
24328
+ catch (execption) {
24329
+ this.actionFailureMethod(execption);
23983
24330
  }
23984
24331
  }
23985
24332
  else if (target.classList.contains(COLLAPSE) || target.classList.contains(EXPAND)) {
23986
- this.onDrill(target);
24333
+ let drillFieldName = target.parentElement.getAttribute('fieldname');
24334
+ let fieldInfo = PivotUtil.getFieldInfo(drillFieldName, this);
24335
+ let actionName = target.classList.contains(COLLAPSE) ? this.actionObj.actionName = drillUp : target.classList.contains(EXPAND) ? this.actionObj.actionName = drillDown : '';
24336
+ this.actionObj.actionName = actionName;
24337
+ this.actionObj.fieldInfo = fieldInfo.fieldItem;
24338
+ if (this.actionBeginMethod()) {
24339
+ return;
24340
+ }
24341
+ try {
24342
+ this.onDrill(target);
24343
+ }
24344
+ catch (execption) {
24345
+ this.actionFailureMethod(execption);
24346
+ }
23987
24347
  }
23988
24348
  else {
23989
24349
  this.CellClicked(target, e);
@@ -24081,7 +24441,8 @@ let PivotView = class PivotView extends Component {
24081
24441
  let firstColWidth = this.pivotColumns[0].width;
24082
24442
  let eventArgs = {
24083
24443
  columns: this.pivotColumns,
24084
- dataSourceSettings: this.dataSourceSettings
24444
+ dataSourceSettings: this.dataSourceSettings,
24445
+ stackedColumns: this.getStackedColumns(gridcolumns, [])
24085
24446
  };
24086
24447
  this.trigger(beforeColumnsRender, eventArgs);
24087
24448
  if (this.enableVirtualization && eventArgs.columns.length > 0 && eventArgs.columns[0].width !== gridcolumns[0].width) {
@@ -24185,8 +24546,16 @@ let PivotView = class PivotView extends Component {
24185
24546
  /* eslint-disable-next-line */
24186
24547
  /** @hidden */
24187
24548
  onWindowResize() {
24549
+ this.actionObj.actionName = windowResize;
24550
+ if (this.actionBeginMethod()) {
24551
+ return;
24552
+ }
24188
24553
  clearTimeout(this.timeOutObj);
24189
24554
  this.timeOutObj = setTimeout(this.layoutRefresh.bind(this), 500);
24555
+ this.actionObj.actionName = this.getActionCompleteName();
24556
+ if (this.actionObj.actionName) {
24557
+ this.actionCompleteMethod();
24558
+ }
24190
24559
  }
24191
24560
  /**
24192
24561
  * Refreshes the Pivot Table for blazor layoutRefresh is called for other base refresh is called.
@@ -24570,7 +24939,9 @@ let PivotView = class PivotView extends Component {
24570
24939
  isDrillThrough: (this.allowDrillThrough || this.editSettings.allowEditing),
24571
24940
  localeObj: this.localeObj,
24572
24941
  fieldsType: this.fieldsType,
24573
- clonedReport: this.clonedReport
24942
+ clonedReport: this.clonedReport,
24943
+ globalize: this.globalize,
24944
+ currenyCode: this.currencyCode
24574
24945
  };
24575
24946
  if (this.dataType === 'pivot') {
24576
24947
  if (this.dataSourceSettings.groupSettings && this.dataSourceSettings.groupSettings.length > 0) {
@@ -24796,7 +25167,8 @@ let PivotView = class PivotView extends Component {
24796
25167
  let str = 'color: ' + format[k].style.color + '!important;background-color: ' + format[k].style.backgroundColor +
24797
25168
  '!important;font-size: ' + format[k].style.fontSize + '!important;font-family: ' + format[k].style.fontFamily +
24798
25169
  ' !important;';
24799
- sheet.insertRule('.format' + this.element.id + k + '{' + str + '}', 0);
25170
+ let formatClass = '.format' + this.element.id + k;
25171
+ sheet.insertRule(formatClass + ', ' + formatClass + ' .e-cellvalue' + '{' + str + '}', 0);
24800
25172
  }
24801
25173
  }
24802
25174
  }
@@ -25022,6 +25394,64 @@ let PivotView = class PivotView extends Component {
25022
25394
  EventHandler.remove(document, this.isAdaptive ? 'touchend' : 'click', this.removeButtonFocus);
25023
25395
  window.removeEventListener('resize', this.onWindowResize.bind(this), true);
25024
25396
  }
25397
+ /** @hidden */
25398
+ actionBeginMethod() {
25399
+ let eventArgs = {
25400
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
25401
+ actionName: this.actionObj.actionName,
25402
+ fieldInfo: this.actionObj.fieldInfo,
25403
+ cancel: false
25404
+ };
25405
+ this.trigger(actionBegin, eventArgs);
25406
+ return eventArgs.cancel;
25407
+ }
25408
+ /** @hidden */
25409
+ actionCompleteMethod() {
25410
+ let eventArgs = {
25411
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
25412
+ actionName: this.actionObj.actionName,
25413
+ fieldInfo: this.actionObj.fieldInfo,
25414
+ actionInfo: this.actionObj.actionInfo
25415
+ };
25416
+ this.trigger(actionComplete, eventArgs);
25417
+ this.actionObj.actionName = '';
25418
+ this.actionObj.actionInfo = undefined;
25419
+ this.actionObj.fieldInfo = undefined;
25420
+ }
25421
+ /** @hidden */
25422
+ actionFailureMethod(error) {
25423
+ let eventArgs = {
25424
+ actionName: this.actionObj.actionName,
25425
+ errorInfo: error
25426
+ };
25427
+ this.trigger(actionFailure, eventArgs);
25428
+ }
25429
+ /** @hidden */
25430
+ getActionCompleteName() {
25431
+ let actionName = (this.actionObj.actionName == openConditionalFormatting) ? conditionallyFormatted : (this.actionObj.actionName == openNumberFormatting) ? numberFormatted
25432
+ : (this.actionObj.actionName == tableView) ? tableViewed : (this.actionObj.actionName == chartView) ? chartViewed : (this.actionObj.actionName == hideSubTotals) ? subTotalsHidden : (this.actionObj.actionName == subTotalsRow) ? subTotalsRowShown
25433
+ : (this.actionObj.actionName == subTotalsColumn) ? subTotalsColumnShown : (this.actionObj.actionName == showSubTotals) ? subTotalsShown : (this.actionObj.actionName == hideGrandTotals) ? grandTotalsHidden
25434
+ : (this.actionObj.actionName == grandTotalsRow) ? grandTotalsRowShown : (this.actionObj.actionName == grandTotalsColumn) ? grandTotalsColumnShown : (this.actionObj.actionName == showGrandTotals) ? grandTotalsShown
25435
+ : (this.actionObj.actionName == sortValue) ? valueSorted : (this.actionObj.actionName == openCalculatedField) ? calculatedFieldApplied : (this.actionObj.actionName == editCalculatedField) ? calculatedFieldEdited : (this.actionObj.actionName == sortField) ? fieldSorted
25436
+ : (this.actionObj.actionName == filterField) ? fieldFiltered : (this.actionObj.actionName == removeField) ? fieldRemoved : (this.actionObj.actionName == aggregateField) ? fieldAggregated : this.actionObj.actionName == editRecord ? recordEdited : this.actionObj.actionName == reportChange ? reportChanged
25437
+ : this.actionObj.actionName == saveEditedRecords ? editedRecordsSaved : this.actionObj.actionName == addNewRecord ? newRecordAdded
25438
+ : this.actionObj.actionName == removeRecord ? recordRemoved : (this.actionObj.actionName == pngExport) ? pngExported : (this.actionObj.actionName == jpegExport) ? jpegExported
25439
+ : (this.actionObj.actionName == svgExport) ? svgExported : (this.actionObj.actionName == pdfExport) ? pdfExported : (this.actionObj.actionName == csvExport) ? csvExported : (this.actionObj.actionName == excelExport) ? excelExported : this.actionObj.actionName == windowResize ? windowResized
25440
+ : this.actionObj.actionName == saveCurrentReport ? reportSaved : (this.actionObj.actionName == addNewReport) ? newReportAdded : (this.actionObj.actionName == saveAsCurrentReport) ? reportReSaved
25441
+ : (this.actionObj.actionName == renameCurrentReport) ? reportRenamed : this.actionObj.actionName;
25442
+ return actionName;
25443
+ }
25444
+ /* eslint-disable-next-line */
25445
+ /** @hidden */
25446
+ getStackedColumns(gridcolumns, stackedColumns) {
25447
+ for (let column of gridcolumns) {
25448
+ stackedColumns.push(column);
25449
+ if (column.columns && column.columns.length > 0) {
25450
+ this.getStackedColumns(column.columns, stackedColumns);
25451
+ }
25452
+ }
25453
+ return stackedColumns;
25454
+ }
25025
25455
  /**
25026
25456
  * To destroy the PivotView elements.
25027
25457
  * @returns {void}
@@ -25085,8 +25515,8 @@ let PivotView = class PivotView extends Component {
25085
25515
  if (this.commonModule) {
25086
25516
  this.commonModule.destroy();
25087
25517
  }
25088
- if (this.chartModule) {
25089
- this.chartModule.destroy();
25518
+ if (this.pivotChartModule) {
25519
+ this.pivotChartModule.destroy();
25090
25520
  }
25091
25521
  if (this.pivotButtonModule && !this.pivotButtonModule.isDestroyed) {
25092
25522
  this.pivotButtonModule.destroy();
@@ -25141,8 +25571,8 @@ let PivotView = class PivotView extends Component {
25141
25571
  if (this.commonModule) {
25142
25572
  this.commonModule = null;
25143
25573
  }
25144
- if (this.chartModule) {
25145
- this.chartModule = null;
25574
+ if (this.pivotChartModule) {
25575
+ this.pivotChartModule = null;
25146
25576
  }
25147
25577
  if (this.pivotButtonModule) {
25148
25578
  this.pivotButtonModule = null;
@@ -25162,6 +25592,12 @@ let PivotView = class PivotView extends Component {
25162
25592
  if (this.drillThroughModule) {
25163
25593
  this.drillThroughModule = null;
25164
25594
  }
25595
+ if (this.clonedDataSet) {
25596
+ this.clonedDataSet = null;
25597
+ }
25598
+ if (this.clonedReport) {
25599
+ this.clonedReport = null;
25600
+ }
25165
25601
  this.element.innerHTML = '';
25166
25602
  removeClass([this.element], ROOT);
25167
25603
  removeClass([this.element], RTL);
@@ -25505,6 +25941,15 @@ __decorate([
25505
25941
  __decorate([
25506
25942
  Event()
25507
25943
  ], PivotView.prototype, "beforeServiceInvoke", void 0);
25944
+ __decorate([
25945
+ Event()
25946
+ ], PivotView.prototype, "actionBegin", void 0);
25947
+ __decorate([
25948
+ Event()
25949
+ ], PivotView.prototype, "actionComplete", void 0);
25950
+ __decorate([
25951
+ Event()
25952
+ ], PivotView.prototype, "actionFailure", void 0);
25508
25953
  PivotView = __decorate([
25509
25954
  NotifyPropertyChanges
25510
25955
  ], PivotView);
@@ -25517,6 +25962,247 @@ PivotView = __decorate([
25517
25962
  * Renderer Export
25518
25963
  */
25519
25964
 
25965
+ /**
25966
+ * This is a file to perform common utility for OLAP and Relational datasource
25967
+ * @hidden
25968
+ */
25969
+ class PivotExportUtil {
25970
+ /* eslint-disable @typescript-eslint/no-explicit-any */
25971
+ static getDefinedObj(data) {
25972
+ let keyPos = 0;
25973
+ let framedSet = {};
25974
+ /* eslint-enable @typescript-eslint/no-explicit-any */
25975
+ if (!(data === null || data === undefined)) {
25976
+ let fields = Object.keys(data);
25977
+ while (keyPos < fields.length) {
25978
+ if (!(data[fields[keyPos]] === null || data[fields[keyPos]] === undefined)) {
25979
+ framedSet[fields[keyPos]] = data[fields[keyPos]];
25980
+ }
25981
+ keyPos++;
25982
+ }
25983
+ }
25984
+ else {
25985
+ framedSet = data;
25986
+ }
25987
+ return framedSet;
25988
+ }
25989
+ static getClonedPivotValues(pivotValues) {
25990
+ let clonedSets = [];
25991
+ for (let i = 0; i < pivotValues.length; i++) {
25992
+ if (pivotValues[i]) {
25993
+ clonedSets[i] = [];
25994
+ for (let j = 0; j < pivotValues[i].length; j++) {
25995
+ if (pivotValues[i][j]) {
25996
+ /* eslint-disable */
25997
+ clonedSets[i][j] = this.getClonedPivotValueObj(pivotValues[i][j]);
25998
+ /* eslint-enable */
25999
+ }
26000
+ }
26001
+ }
26002
+ }
26003
+ return clonedSets;
26004
+ }
26005
+ /* eslint-disable */
26006
+ static getClonedPivotValueObj(data) {
26007
+ /* eslint-enable */
26008
+ let keyPos = 0;
26009
+ /* eslint-disable @typescript-eslint/no-explicit-any */
26010
+ let framedSet = {};
26011
+ /* eslint-enable @typescript-eslint/no-explicit-any */
26012
+ if (!(data === null || data === undefined)) {
26013
+ let fields = Object.keys(data);
26014
+ while (keyPos < fields.length) {
26015
+ framedSet[fields[keyPos]] = data[fields[keyPos]];
26016
+ keyPos++;
26017
+ }
26018
+ }
26019
+ else {
26020
+ framedSet = data;
26021
+ }
26022
+ return framedSet;
26023
+ }
26024
+ /* eslint-disable */
26025
+ static isContainCommonElements(collection1, collection2) {
26026
+ /* eslint-enable */
26027
+ for (let i = 0, cnt = collection1.length; i < cnt; i++) {
26028
+ for (let j = 0, lnt = collection2.length; j < lnt; j++) {
26029
+ if (collection2[j] === collection1[i]) {
26030
+ return true;
26031
+ }
26032
+ }
26033
+ }
26034
+ return false;
26035
+ }
26036
+ /* eslint-disable */
26037
+ static formatPdfHeaderFooter(pdf) {
26038
+ let contents = [];
26039
+ if (!isNullOrUndefined(pdf)) {
26040
+ for (let i = 0; i < pdf.length; i++) {
26041
+ let a = pdf[i];
26042
+ let content = {
26043
+ /* eslint-enable */
26044
+ type: a.Type,
26045
+ pageNumberType: a.PageNumberType,
26046
+ style: a.Style ? {
26047
+ penColor: a.Style.PenColor,
26048
+ penSize: a.Style.PenSize,
26049
+ dashStyle: a.Style.DashStyle,
26050
+ textBrushColor: a.Style.TextBrushColor,
26051
+ textPenColor: a.Style.TextPenColor,
26052
+ fontSize: a.Style.FontSize,
26053
+ hAlign: a.Style.HAlign,
26054
+ vAlign: a.Style.VAlign
26055
+ } : a.Style,
26056
+ points: a.Points !== null ? {
26057
+ x1: a.Points.X1,
26058
+ y1: a.Points.Y1,
26059
+ x2: a.Points.X2,
26060
+ y2: a.Points.Y2
26061
+ } : null,
26062
+ format: a.Format,
26063
+ position: a.Position !== null ? {
26064
+ x: a.Position.X,
26065
+ y: a.Position.Y
26066
+ } : null,
26067
+ size: a.Size !== null ? {
26068
+ height: a.Size.Height,
26069
+ width: a.Size.Width
26070
+ } : null,
26071
+ src: a.Src,
26072
+ value: a.Value,
26073
+ font: a.Font
26074
+ };
26075
+ contents.push(content);
26076
+ }
26077
+ }
26078
+ return contents;
26079
+ }
26080
+ /* eslint-disable */
26081
+ static formatPdfExportProperties(pdf) {
26082
+ let values;
26083
+ /* eslint-enable */
26084
+ values = this.getDefinedObj({
26085
+ pageOrientation: typeof pdf.PageOrientation === 'string' ? pdf.PageOrientation : null,
26086
+ pageSize: typeof pdf.PageSize === 'string' ? pdf.PageSize : null,
26087
+ header: !isNullOrUndefined(pdf.Header) ? {
26088
+ fromTop: pdf.Header.FromTop,
26089
+ height: pdf.Header.Height,
26090
+ contents: this.formatPdfHeaderFooter(pdf.Header.Contents)
26091
+ } : null,
26092
+ columns: pdf.Columns,
26093
+ footer: !isNullOrUndefined(pdf.Footer) ? {
26094
+ fromTop: pdf.Footer.FromBottom,
26095
+ height: pdf.Footer.Height,
26096
+ contents: this.formatPdfHeaderFooter(pdf.Footer.Contents)
26097
+ } : null,
26098
+ includeHiddenColumn: pdf.IncludeHiddenColumn,
26099
+ dataSource: pdf.DataSource,
26100
+ exportType: typeof pdf.ExportType === 'string' ? pdf.ExportType : null,
26101
+ theme: !isNullOrUndefined(pdf.Theme) ? {
26102
+ header: pdf.Theme.Header,
26103
+ record: pdf.Theme.Record,
26104
+ caption: pdf.Theme.Caption
26105
+ } : null,
26106
+ fileName: pdf.FileName,
26107
+ hierarchyExportMode: typeof pdf.HierarchyExportMode === 'string' ? pdf.HierarchyExportMode : null,
26108
+ allowHorizontalOverflow: pdf.AllowHorizontalOverflow
26109
+ });
26110
+ return values;
26111
+ }
26112
+ /* eslint-disable */
26113
+ static formatExcelStyle(style) {
26114
+ let prop;
26115
+ /* eslint-enable */
26116
+ if (!isNullOrUndefined(style)) {
26117
+ prop = this.getDefinedObj({
26118
+ fontColor: style.FontColor,
26119
+ fontName: style.FontName,
26120
+ fontSize: style.FontSize,
26121
+ hAlign: style.HAlign === String ? style.HAlign : null,
26122
+ vAlign: style.VAlign === String ? style.VAlign : null,
26123
+ bold: style.Bold,
26124
+ indent: style.Indent,
26125
+ italic: style.Italic,
26126
+ underline: style.Underline,
26127
+ backColor: style.BackColor,
26128
+ wrapText: style.WrapText,
26129
+ borders: style.Borders,
26130
+ numberFormat: style.NumberFormat,
26131
+ type: style.Type
26132
+ });
26133
+ }
26134
+ return prop;
26135
+ }
26136
+ /* eslint-disable */
26137
+ static formatExcelCell(cell) {
26138
+ let cells = [];
26139
+ if (!isNullOrUndefined(cell)) {
26140
+ for (let i = 0; i < cell.length; i++) {
26141
+ this.getDefinedObj({
26142
+ index: !isNullOrUndefined(cell[i].Index) ? cell[i].Index : null,
26143
+ colSpan: !isNullOrUndefined(cell[i].ColSpan) ? cell[i].ColSpan : null,
26144
+ value: !isNullOrUndefined(cell[i].Value) ? cell[i].Value : null,
26145
+ hyperlink: {
26146
+ target: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.Target : null,
26147
+ displayText: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.DisplayText : null
26148
+ },
26149
+ styles: this.formatExcelStyle(cell[i].Style),
26150
+ rowSpan: !isNullOrUndefined(cell[i].RowSpan) ? cell[i].RowSpan : null
26151
+ });
26152
+ /* eslint-enable */
26153
+ }
26154
+ }
26155
+ return cells;
26156
+ }
26157
+ /* eslint-disable */
26158
+ static formatExcelHeaderFooter(excel) {
26159
+ let rows = [];
26160
+ if (!isNullOrUndefined(excel)) {
26161
+ for (let i = 0; i < excel.Rows.length; i++) {
26162
+ let row = excel.Rows[i];
26163
+ let prop = this.getDefinedObj({
26164
+ index: !isNullOrUndefined(row.Index) ? row.Index : null,
26165
+ cells: this.formatExcelCell(row.Cells),
26166
+ grouping: !isNullOrUndefined(row.Grouping) ? row.Grouping : null
26167
+ });
26168
+ rows.push(prop);
26169
+ }
26170
+ }
26171
+ return rows;
26172
+ }
26173
+ static formatExcelExportProperties(excel) {
26174
+ /* eslint-enable */
26175
+ let prop;
26176
+ prop = this.getDefinedObj({
26177
+ dataSource: excel.DataSource,
26178
+ query: excel.Query,
26179
+ multipleExport: this.getDefinedObj({
26180
+ type: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.Type : null,
26181
+ blankRows: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.BlankRows : null
26182
+ }),
26183
+ header: this.getDefinedObj({
26184
+ headerRows: !isNullOrUndefined(excel.Header) ? excel.Header.HeaderRows : null,
26185
+ rows: this.formatExcelHeaderFooter(excel.Header)
26186
+ }),
26187
+ footer: this.getDefinedObj({
26188
+ footerRows: !isNullOrUndefined(excel.Footer) ? excel.Footer.FooterRows : null,
26189
+ rows: this.formatExcelHeaderFooter(excel.Footer)
26190
+ }),
26191
+ columns: excel.Columns,
26192
+ exportType: typeof excel.ExportType === 'string' ? excel.ExportType : undefined,
26193
+ includeHiddenColumn: excel.IncludeHiddenColumn,
26194
+ theme: !isNullOrUndefined(excel.Theme) ? {
26195
+ header: this.formatExcelStyle(excel.Theme.Header),
26196
+ record: this.formatExcelStyle(excel.Theme.Record),
26197
+ caption: this.formatExcelStyle(excel.Theme.Caption)
26198
+ } : undefined,
26199
+ fileName: excel.FileName,
26200
+ hierarchyExportMode: typeof excel.HierarchyExportMode === 'string' ? excel.HierarchyExportMode : undefined
26201
+ });
26202
+ return prop;
26203
+ }
26204
+ }
26205
+
25520
26206
  /**
25521
26207
  * @hidden
25522
26208
  * `ExcelExport` module is used to handle the Excel export action.
@@ -25584,7 +26270,7 @@ class ExcelExport$1 {
25584
26270
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
25585
26271
  /** Event trigerring */
25586
26272
  let clonedValues;
25587
- let currentPivotValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26273
+ let currentPivotValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
25588
26274
  let customFileName = isFileNameSet ? exportProperties.fileName : 'default.xlsx';
25589
26275
  if (isHeaderSet) {
25590
26276
  this.addHeaderAndFooter(exportProperties.header, '', 'header', exportProperties.header.headerRows);
@@ -25594,7 +26280,7 @@ class ExcelExport$1 {
25594
26280
  this.engine.pageSettings = null;
25595
26281
  this.engine.generateGridData(this.parent.dataSourceSettings, true);
25596
26282
  this.parent.applyFormatting(this.engine.pivotValues);
25597
- clonedValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26283
+ clonedValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
25598
26284
  this.engine.pivotValues = currentPivotValues;
25599
26285
  this.engine.pageSettings = pageSettings;
25600
26286
  }
@@ -25638,15 +26324,17 @@ class ExcelExport$1 {
25638
26324
  let pivotCell = pivotValues[rCnt][cCnt];
25639
26325
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
25640
26326
  let cellValue = pivotCell.axis === 'value' ? pivotCell.value : pivotCell.formattedText;
25641
- if (pivotCell.type === 'grand sum') {
25642
- cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'grandTotal') :
25643
- this.parent.localeObj.getConstant('grandTotal');
26327
+ let isgetValuesHeader = ((this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row')
26328
+ || (this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column'));
26329
+ if (pivotCell.type === 'grand sum' && !(this.parent.dataSourceSettings.values.length === 1 && this.parent.dataSourceSettings.valueAxis === 'row' && pivotCell.axis === 'column')) {
26330
+ cellValue = isgetValuesHeader ? this.parent.getValuesHeader(pivotCell, 'grandTotal') : this.parent.localeObj.getConstant('grandTotal');
25644
26331
  }
25645
26332
  else if (pivotCell.type === 'sum') {
25646
26333
  cellValue = cellValue.toString().replace('Total', this.parent.localeObj.getConstant('total'));
25647
26334
  }
25648
26335
  else {
25649
- cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'value') : cellValue;
26336
+ cellValue = (!isNullOrUndefined(pivotCell.valueSort) && (this.parent.localeObj.getConstant('grandTotal') + this.parent.dataSourceSettings.valueSortSettings.headerDelimiter + pivotCell.formattedText
26337
+ === pivotCell.valueSort.levelName) && isgetValuesHeader) ? this.parent.getValuesHeader(pivotCell, 'value') : cellValue;
25650
26338
  }
25651
26339
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
25652
26340
  cells.push({
@@ -26158,13 +26846,13 @@ class PDFExport {
26158
26846
  applyEvent() {
26159
26847
  /** Event trigerring */
26160
26848
  let clonedValues;
26161
- let currentPivotValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26849
+ let currentPivotValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
26162
26850
  if (this.parent.exportAllPages && this.parent.enableVirtualization && this.parent.dataType !== 'olap') {
26163
26851
  let pageSettings = this.engine.pageSettings;
26164
26852
  this.engine.pageSettings = null;
26165
26853
  this.engine.generateGridData(this.parent.dataSourceSettings, true);
26166
26854
  this.parent.applyFormatting(this.engine.pivotValues);
26167
- clonedValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26855
+ clonedValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
26168
26856
  this.engine.pivotValues = currentPivotValues;
26169
26857
  this.engine.pageSettings = pageSettings;
26170
26858
  }
@@ -26653,31 +27341,50 @@ class DialogRenderer {
26653
27341
  return axisWrapper;
26654
27342
  }
26655
27343
  showCalculatedField(event) {
26656
- if (!this.parent.isAdaptive) {
26657
- if (this.parent.dialogRenderer.fieldListDialog) {
26658
- this.parent.dialogRenderer.fieldListDialog.hide();
26659
- addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
27344
+ try {
27345
+ if (!this.parent.isAdaptive) {
27346
+ this.parent.actionObj.actionName = openCalculatedField;
27347
+ if (this.parent.actionBeginMethod()) {
27348
+ return;
27349
+ }
27350
+ if (this.parent.dialogRenderer.fieldListDialog) {
27351
+ this.parent.dialogRenderer.fieldListDialog.hide();
27352
+ addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
27353
+ }
26660
27354
  }
27355
+ this.parent.notify(initCalculatedField, {});
27356
+ }
27357
+ catch (execption) {
27358
+ this.parent.actionFailureMethod(execption);
26661
27359
  }
26662
- this.parent.notify(initCalculatedField, {});
26663
27360
  }
26664
27361
  showFieldListDialog(event) {
26665
27362
  let activeindex = this.adaptiveElement.selectedItem;
26666
27363
  this.parent.treeViewModule.render(activeindex);
26667
27364
  }
26668
27365
  onShowFieldList() {
26669
- if (this.parent.allowDeferLayoutUpdate) {
26670
- if (this.parent.isAdaptive) {
26671
- this.parent.axisFieldModule.render();
27366
+ this.parent.actionObj.actionName = showFieldList;
27367
+ if (this.parent.actionBeginMethod()) {
27368
+ return;
27369
+ }
27370
+ this.parent.actionObj.actionName = '';
27371
+ try {
27372
+ if (this.parent.allowDeferLayoutUpdate) {
27373
+ if (this.parent.isAdaptive) {
27374
+ this.parent.axisFieldModule.render();
27375
+ }
27376
+ this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
27377
+ this.parent.clonedFieldList = extend({}, this.parent.pivotFieldList, null, true);
26672
27378
  }
26673
- this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
26674
- this.parent.clonedFieldList = extend({}, this.parent.pivotFieldList, null, true);
27379
+ addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
27380
+ this.parent.dialogRenderer.fieldListDialog.show();
27381
+ this.parent.dialogRenderer.fieldListDialog.element.style.top =
27382
+ parseInt(this.parent.dialogRenderer.fieldListDialog.element.style.top, 10) < 0 ?
27383
+ '0px' : this.parent.dialogRenderer.fieldListDialog.element.style.top;
27384
+ }
27385
+ catch (execption) {
27386
+ this.parent.actionFailureMethod(execption);
26675
27387
  }
26676
- addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
26677
- this.parent.dialogRenderer.fieldListDialog.show();
26678
- this.parent.dialogRenderer.fieldListDialog.element.style.top =
26679
- parseInt(this.parent.dialogRenderer.fieldListDialog.element.style.top, 10) < 0 ?
26680
- '0px' : this.parent.dialogRenderer.fieldListDialog.element.style.top;
26681
27388
  }
26682
27389
  onCloseFieldList() {
26683
27390
  if (this.parent.allowDeferLayoutUpdate) {
@@ -26705,6 +27412,10 @@ class DialogRenderer {
26705
27412
  }
26706
27413
  }
26707
27414
  this.parent.dialogRenderer.fieldListDialog.hide();
27415
+ this.parent.actionObj.actionName = closeFieldlist;
27416
+ if (this.parent.actionObj.actionName) {
27417
+ this.parent.actionCompleteMethod();
27418
+ }
26708
27419
  }
26709
27420
  removeFieldListIcon() {
26710
27421
  if (this.parent.isAdaptive && this.parent.allowCalculatedField && this.parent.calculatedFieldModule) {
@@ -27580,28 +28291,41 @@ class TreeViewRenderer {
27580
28291
  updateSorting(args) {
27581
28292
  let target = args.target;
27582
28293
  let option = target.getAttribute('data-sort');
27583
- if (target.className.indexOf('e-selected') === -1) {
27584
- switch (option) {
27585
- case 'None':
27586
- this.fieldListSort = 'None';
27587
- addClass([target], 'e-selected');
27588
- removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
27589
- removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
27590
- break;
27591
- case 'Ascend':
27592
- this.fieldListSort = 'Ascend';
27593
- addClass([target], 'e-selected');
27594
- removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
27595
- removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
27596
- break;
27597
- case 'Descend':
27598
- this.fieldListSort = 'Descend';
27599
- addClass([target], 'e-selected');
27600
- removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
27601
- removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
27602
- break;
28294
+ this.parent.actionObj.actionName = sortFieldTree;
28295
+ if (this.parent.actionBeginMethod()) {
28296
+ return;
28297
+ }
28298
+ try {
28299
+ if (target.className.indexOf('e-selected') === -1) {
28300
+ switch (option) {
28301
+ case 'None':
28302
+ this.fieldListSort = 'None';
28303
+ addClass([target], 'e-selected');
28304
+ removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
28305
+ removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
28306
+ break;
28307
+ case 'Ascend':
28308
+ this.fieldListSort = 'Ascend';
28309
+ addClass([target], 'e-selected');
28310
+ removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
28311
+ removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
28312
+ break;
28313
+ case 'Descend':
28314
+ this.fieldListSort = 'Descend';
28315
+ addClass([target], 'e-selected');
28316
+ removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
28317
+ removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
28318
+ break;
28319
+ }
28320
+ this.refreshTreeView();
27603
28321
  }
27604
- this.refreshTreeView();
28322
+ }
28323
+ catch (execption) {
28324
+ this.parent.actionFailureMethod(execption);
28325
+ }
28326
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
28327
+ if (this.parent.actionObj.actionName) {
28328
+ this.parent.actionCompleteMethod();
27605
28329
  }
27606
28330
  }
27607
28331
  /* eslint-disable */
@@ -27963,7 +28687,7 @@ class PivotButton {
27963
28687
  attrs: { 'tabindex': '-1', 'aria-disabled': 'false', 'title': this.parent.localeObj.getConstant('editCalculatedField') },
27964
28688
  className: ICON + ' ' + CALC_EDIT
27965
28689
  });
27966
- if (this.parent.allowCalculatedField && this.parent.calculatedFieldModule && field[i].showEditIcon) {
28690
+ if (this.parent.allowCalculatedField && this.parent.calculatedFieldModule && (field[i].showEditIcon || field[i].showEditIcon === undefined)) {
27967
28691
  removeClass([calcElement], ICON_DISABLE);
27968
28692
  }
27969
28693
  else {
@@ -27976,7 +28700,7 @@ class PivotButton {
27976
28700
  className: ICON + ' ' + REMOVE_CLASS
27977
28701
  });
27978
28702
  if (this.parent.getModuleName() === 'pivotview') {
27979
- if ((this.parent.groupingBarSettings.showRemoveIcon && field[i].showRemoveIcon)) {
28703
+ if ((this.parent.groupingBarSettings.showRemoveIcon && (field[i].showRemoveIcon || field[i].showRemoveIcon === undefined))) {
27980
28704
  removeClass([removeElement], ICON_DISABLE);
27981
28705
  }
27982
28706
  else {
@@ -27984,7 +28708,7 @@ class PivotButton {
27984
28708
  }
27985
28709
  }
27986
28710
  else {
27987
- if (field[i].showRemoveIcon) {
28711
+ if (field[i].showRemoveIcon || field[i].showRemoveIcon === undefined) {
27988
28712
  removeClass([removeElement], ICON_DISABLE);
27989
28713
  }
27990
28714
  else {
@@ -28016,13 +28740,13 @@ class PivotButton {
28016
28740
  }
28017
28741
  if (axis === 'values') {
28018
28742
  for (let element of this.parentElement.querySelectorAll('.e-group-' + axis)) {
28019
- if (element.classList.contains(GROUP_CHART_VALUE) && this.parent.chartModule) {
28743
+ if (element.classList.contains(GROUP_CHART_VALUE) && this.parent.pivotChartModule) {
28020
28744
  let valueData = field.map((item) => { return { text: item.caption ? item.caption : item.name, value: item.name }; });
28021
28745
  let parent = this.parent;
28022
28746
  if (this.valueFiedDropDownList && element.querySelector('.' + GROUP_CHART_VALUE_DROPDOWN_DIV)) {
28023
28747
  this.valueFiedDropDownList.dataSource = valueData;
28024
28748
  this.valueFiedDropDownList.value = !parent.chartSettings.enableMultipleAxis ?
28025
- parent.chartModule.currentMeasure : valueData[0].value;
28749
+ parent.pivotChartModule.currentMeasure : valueData[0].value;
28026
28750
  }
28027
28751
  else {
28028
28752
  let ddlDiv = createElement('div', { className: GROUP_CHART_VALUE_DROPDOWN_DIV });
@@ -28032,7 +28756,7 @@ class PivotButton {
28032
28756
  enableRtl: this.parent.enableRtl,
28033
28757
  locale: this.parent.locale,
28034
28758
  value: !parent.chartSettings.enableMultipleAxis ?
28035
- parent.chartModule.currentMeasure : valueData[0].value,
28759
+ parent.pivotChartModule.currentMeasure : valueData[0].value,
28036
28760
  width: 200,
28037
28761
  fields: { value: 'value', text: 'text' },
28038
28762
  cssClass: GROUP_CHART_VALUE_DROPDOWN,
@@ -28051,14 +28775,14 @@ class PivotButton {
28051
28775
  else if (axis === 'columns') {
28052
28776
  let availColindex = undefined;
28053
28777
  for (let element of this.parentElement.querySelectorAll('.e-group-' + axis)) {
28054
- if (element.classList.contains(GROUP_CHART_COLUMN) && this.parent.chartModule) {
28055
- let currentMeasure = this.parent.chartModule.currentMeasure;
28778
+ if (element.classList.contains(GROUP_CHART_COLUMN) && this.parent.pivotChartModule) {
28779
+ let currentMeasure = this.parent.pivotChartModule.currentMeasure;
28056
28780
  let delimiter = this.parent.chartSettings.columnDelimiter ? this.parent.chartSettings.columnDelimiter : '-';
28057
28781
  let columnHeader = (this.parent.chartSettings.columnHeader && this.parent.chartSettings.columnHeader !== '') ?
28058
28782
  this.parent.chartSettings.columnHeader.split(delimiter).join(' - ') : '';
28059
28783
  let engineModule = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
28060
28784
  let pivotValues = engineModule.pivotValues;
28061
- let totColIndex = this.parent.chartModule.getColumnTotalIndex(pivotValues);
28785
+ let totColIndex = this.parent.pivotChartModule.getColumnTotalIndex(pivotValues);
28062
28786
  let rKeys = Object.keys(pivotValues);
28063
28787
  let columnData = [];
28064
28788
  let firstValueRow = false;
@@ -28168,7 +28892,7 @@ class PivotButton {
28168
28892
  },
28169
28893
  className: PIVOT_BUTTON_CONTENT_CLASS + ' ' +
28170
28894
  (this.parent.getModuleName() === 'pivotview' ?
28171
- this.parent.groupingBarSettings.allowDragAndDrop && field[i].allowDragAndDrop ? '' : DRAG_DISABLE_CLASS : ''),
28895
+ this.parent.groupingBarSettings.allowDragAndDrop && (field[i].allowDragAndDrop || field[i].allowDragAndDrop === undefined) ? '' : DRAG_DISABLE_CLASS : ''),
28172
28896
  innerHTML: axis === 'filters' ? (this.parent.dataType === 'olap' && engineModule.fieldList[field[i].name].type === 'CalculatedField') ?
28173
28897
  text : (text + ' (' + filterMem + ')') : (this.parent.dataType === 'olap' ?
28174
28898
  text : (!this.parent.dataSourceSettings.showAggregationOnValueField || axis !== 'values' || aggregation === 'CalculatedField' ?
@@ -28234,43 +28958,54 @@ class PivotButton {
28234
28958
  }
28235
28959
  openCalculatedFieldDialog(args) {
28236
28960
  let fieldName = args.target.parentElement.id;
28237
- if (this.parent.getModuleName() === 'pivotview') {
28238
- if (this.parent.isAdaptive && (this.parent.showFieldList &&
28239
- this.parent.pivotFieldListModule &&
28240
- !this.parent.pivotFieldListModule.isDestroyed)) {
28241
- this.parent.pivotFieldListModule.element
28242
- .querySelector('.' + TOGGLE_FIELD_LIST_CLASS).click();
28243
- this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4);
28244
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28245
- this.parent.pivotFieldListModule.calculatedFieldModule
28246
- .updateAdaptiveCalculatedField(true, fieldName);
28247
- }
28248
- else {
28249
- if (!this.parent.isAdaptive) {
28250
- this.parent.calculatedFieldModule.buttonCall = true;
28251
- }
28252
- this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28253
- }
28961
+ let fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
28962
+ this.parent.actionObj.actionName = editCalculatedField;
28963
+ this.parent.actionObj.fieldInfo = fieldInfo;
28964
+ if (this.parent.actionBeginMethod()) {
28965
+ return;
28254
28966
  }
28255
- else if (this.parent.getModuleName() === 'pivotfieldlist') {
28256
- if (this.parent.isAdaptive) {
28257
- this.parent.dialogRenderer.adaptiveElement.select(4);
28258
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28259
- this.parent.calculatedFieldModule
28260
- .updateAdaptiveCalculatedField(true, fieldName);
28261
- this.parent.calculatedFieldModule.buttonCall = true;
28262
- }
28263
- else {
28264
- if (this.parent.dialogRenderer.fieldListDialog) {
28265
- this.parent.dialogRenderer.fieldListDialog.hide();
28266
- addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
28967
+ try {
28968
+ if (this.parent.getModuleName() === 'pivotview') {
28969
+ if (this.parent.isAdaptive && (this.parent.showFieldList &&
28970
+ this.parent.pivotFieldListModule &&
28971
+ !this.parent.pivotFieldListModule.isDestroyed)) {
28972
+ this.parent.pivotFieldListModule.element
28973
+ .querySelector('.' + TOGGLE_FIELD_LIST_CLASS).click();
28974
+ this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4);
28975
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28976
+ this.parent.pivotFieldListModule.calculatedFieldModule
28977
+ .updateAdaptiveCalculatedField(true, fieldName);
28267
28978
  }
28268
- this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28269
- if (this.parent.calculatedFieldModule) {
28979
+ else {
28980
+ if (!this.parent.isAdaptive) {
28981
+ this.parent.calculatedFieldModule.buttonCall = true;
28982
+ }
28983
+ this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28984
+ }
28985
+ }
28986
+ else if (this.parent.getModuleName() === 'pivotfieldlist') {
28987
+ if (this.parent.isAdaptive) {
28988
+ this.parent.dialogRenderer.adaptiveElement.select(4);
28989
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28990
+ this.parent.calculatedFieldModule
28991
+ .updateAdaptiveCalculatedField(true, fieldName);
28270
28992
  this.parent.calculatedFieldModule.buttonCall = true;
28271
28993
  }
28994
+ else {
28995
+ if (this.parent.dialogRenderer.fieldListDialog) {
28996
+ this.parent.dialogRenderer.fieldListDialog.hide();
28997
+ addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
28998
+ }
28999
+ this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
29000
+ if (this.parent.calculatedFieldModule) {
29001
+ this.parent.calculatedFieldModule.buttonCall = true;
29002
+ }
29003
+ }
28272
29004
  }
28273
29005
  }
29006
+ catch (execption) {
29007
+ this.parent.actionFailureMethod(execption);
29008
+ }
28274
29009
  }
28275
29010
  createDraggable(field, target) {
28276
29011
  this.draggable = new Draggable(target, {
@@ -28294,7 +29029,7 @@ class PivotButton {
28294
29029
  attrs: {
28295
29030
  'tabindex': '-1', 'aria-disabled': 'false', 'title': this.parent.localeObj.getConstant('drag')
28296
29031
  },
28297
- className: ICON + ' ' + DRAG_CLASS + ' ' + (field.allowDragAndDrop ? '' : DRAG_DISABLE_CLASS)
29032
+ className: ICON + ' ' + DRAG_CLASS + ' ' + ((field.allowDragAndDrop || field.allowDragAndDrop === undefined) ? '' : DRAG_DISABLE_CLASS)
28298
29033
  });
28299
29034
  dragWrapper.appendChild(dragElement);
28300
29035
  if (this.parent.getModuleName() === 'pivotfieldlist') {
@@ -28655,38 +29390,52 @@ class PivotButton {
28655
29390
  !(args.target.classList.contains(DRAG_CLASS)) &&
28656
29391
  (buttonElement && fieldInfo.fieldItem && (fieldInfo.fieldItem.showSortIcon ||
28657
29392
  isNullOrUndefined(fieldInfo.fieldItem.showSortIcon)))) {
28658
- if ((this.parent instanceof PivotFieldList || this.parent.groupingBarSettings.showSortIcon) &&
28659
- this.parent.dataSourceSettings.enableSorting &&
28660
- !(this.parent.dataType === 'olap' && ((this.parent.getModuleName() === 'pivotfieldlist' &&
28661
- this.parent.pivotGridModule !== undefined &&
28662
- this.parent.pivotGridModule.enableVirtualization) ||
28663
- (this.parent.getModuleName() === 'pivotview' && this.parent.enableVirtualization)))) {
28664
- if (((this.parent.getModuleName() === 'pivotview' && this.parent.enableValueSorting) ||
28665
- (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule !== undefined &&
28666
- this.parent.pivotGridModule.enableValueSorting))) {
28667
- if (this.parent.enableValueSorting || this.parent.pivotGridModule.enableValueSorting) { /* eslint-disable-line */
28668
- if (args.target.classList.contains('e-pivot-button')) {
28669
- if (args.target.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
28670
- this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: '' } } }, true);
29393
+ this.parent.actionObj.actionName = sortField;
29394
+ this.parent.actionObj.fieldInfo = fieldInfo;
29395
+ if (this.parent.actionBeginMethod()) {
29396
+ return;
29397
+ }
29398
+ try {
29399
+ if ((this.parent instanceof PivotFieldList || this.parent.groupingBarSettings.showSortIcon) &&
29400
+ this.parent.dataSourceSettings.enableSorting &&
29401
+ !(this.parent.dataType === 'olap' && ((this.parent.getModuleName() === 'pivotfieldlist' &&
29402
+ this.parent.pivotGridModule !== undefined &&
29403
+ this.parent.pivotGridModule.enableVirtualization) ||
29404
+ (this.parent.getModuleName() === 'pivotview' && this.parent.enableVirtualization)))) {
29405
+ if (((this.parent.getModuleName() === 'pivotview' && this.parent.enableValueSorting) ||
29406
+ (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule !== undefined &&
29407
+ this.parent.pivotGridModule.enableValueSorting))) {
29408
+ if (this.parent.enableValueSorting || this.parent.pivotGridModule.enableValueSorting) { /* eslint-disable-line */
29409
+ if (args.target.classList.contains('e-pivot-button')) {
29410
+ if (args.target.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
29411
+ this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: undefined } } }, true);
29412
+ }
28671
29413
  }
28672
- }
28673
- else {
28674
- if (args.target.parentElement.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
28675
- this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: '' } } }, true);
29414
+ else {
29415
+ if (args.target.parentElement.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
29416
+ this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: undefined } } }, true);
29417
+ }
28676
29418
  }
28677
29419
  }
28678
29420
  }
29421
+ this.parent.pivotCommon.eventBase.updateSorting(args);
29422
+ if (!this.parent.allowDeferLayoutUpdate || this.parent.getModuleName() !== 'pivotfieldlist') {
29423
+ let actionInfo = {
29424
+ sortInfo: this.parent.lastSortInfo
29425
+ };
29426
+ this.parent.actionObj.actionInfo = actionInfo;
29427
+ this.updateDataSource(true);
29428
+ }
29429
+ /* eslint-disable */
29430
+ let thisObj = this;
29431
+ /* eslint-enable */
29432
+ if (thisObj.parent instanceof PivotFieldList) {
29433
+ thisObj.axisField.render();
29434
+ }
28679
29435
  }
28680
- this.parent.pivotCommon.eventBase.updateSorting(args);
28681
- if (!this.parent.allowDeferLayoutUpdate || this.parent.getModuleName() !== 'pivotfieldlist') {
28682
- this.updateDataSource(true);
28683
- }
28684
- /* eslint-disable */
28685
- let thisObj = this;
28686
- /* eslint-enable */
28687
- if (thisObj.parent instanceof PivotFieldList) {
28688
- thisObj.axisField.render();
28689
- }
29436
+ }
29437
+ catch (execption) {
29438
+ this.parent.actionFailureMethod(execption);
28690
29439
  }
28691
29440
  }
28692
29441
  }
@@ -28718,26 +29467,37 @@ class PivotButton {
28718
29467
  updateFiltering(args) {
28719
29468
  /* eslint-disable */
28720
29469
  let pivotObj = this.parent.pivotGridModule ? this.parent.pivotGridModule : this.parent;
28721
- if (pivotObj.getModuleName() === 'pivotfieldlist') {
28722
- showSpinner(pivotObj.fieldListSpinnerElement);
28723
- }
28724
- else {
28725
- pivotObj.showWaitingPopup();
28726
- }
28727
- pivotObj.mouseEventArgs = args;
28728
- pivotObj.filterTargetID = this.parent.pivotCommon.moduleName !== 'pivotfieldlist' ?
28729
- this.parent.element : document.getElementById(this.parent.pivotCommon.parentID + '_Wrapper');
28730
29470
  let fieldName = args.target.parentElement.id;
28731
- if (pivotObj.dataSourceSettings.mode === 'Server') {
28732
- if (this.parent.engineModule.fieldList[fieldName].members && Object.keys(this.parent.engineModule.fieldList[fieldName].members).length > 0) {
28733
- this.updateFilterEvents();
29471
+ let fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
29472
+ this.parent.actionObj.actionName = filterField;
29473
+ this.parent.actionObj.fieldInfo = fieldInfo;
29474
+ if (this.parent.actionBeginMethod()) {
29475
+ return;
29476
+ }
29477
+ try {
29478
+ if (pivotObj.getModuleName() === 'pivotfieldlist') {
29479
+ showSpinner(pivotObj.fieldListSpinnerElement);
28734
29480
  }
28735
29481
  else {
28736
- pivotObj.getEngine('fetchFieldMembers', null, null, null, null, null, fieldName);
29482
+ pivotObj.showWaitingPopup();
29483
+ }
29484
+ pivotObj.mouseEventArgs = args;
29485
+ pivotObj.filterTargetID = this.parent.pivotCommon.moduleName !== 'pivotfieldlist' ?
29486
+ this.parent.element : document.getElementById(this.parent.pivotCommon.parentID + '_Wrapper');
29487
+ if (pivotObj.dataSourceSettings.mode === 'Server') {
29488
+ if (this.parent.engineModule.fieldList[fieldName].members && Object.keys(this.parent.engineModule.fieldList[fieldName].members).length > 0) {
29489
+ this.updateFilterEvents();
29490
+ }
29491
+ else {
29492
+ pivotObj.getEngine('fetchFieldMembers', null, null, null, null, null, fieldName);
29493
+ }
29494
+ }
29495
+ else {
29496
+ this.updateFilterEvents();
28737
29497
  }
28738
29498
  }
28739
- else {
28740
- this.updateFilterEvents();
29499
+ catch (execption) {
29500
+ this.parent.actionFailureMethod(execption);
28741
29501
  }
28742
29502
  /* eslint-enable */
28743
29503
  }
@@ -28750,11 +29510,6 @@ class PivotButton {
28750
29510
  let target = pivotObj.mouseEventArgs.target;
28751
29511
  this.fieldName = target.parentElement.id;
28752
29512
  if (this.parent.pivotCommon.filterDialog.dialogPopUp) {
28753
- this.dialogPopUp = this.parent.pivotCommon.filterDialog.dialogPopUp;
28754
- this.parent.pivotCommon.filterDialog.dialogPopUp.close = this.removeFilterDialog.bind(this);
28755
- // this.memberTreeView = this.parent.pivotCommon.filterDialog.memberTreeView;
28756
- // this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
28757
- // this.parent.pivotCommon.filterDialog.allMemberSelect.nodeChecked = this.nodeStateModified.bind(this);
28758
29513
  this.bindDialogEvents();
28759
29514
  }
28760
29515
  if (pivotObj.getModuleName() === 'pivotfieldlist') {
@@ -28768,8 +29523,8 @@ class PivotButton {
28768
29523
  if (this.parent.pivotCommon.filterDialog.allowExcelLikeFilter && this.parent.pivotCommon.filterDialog.tabObj) {
28769
29524
  this.index = this.parent.pivotCommon.filterDialog.tabObj.selectedItem;
28770
29525
  this.updateDialogButtonEvents();
28771
- this.dialogPopUp.buttons = this.buttonModel();
28772
- this.dialogPopUp.dataBind();
29526
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons = this.buttonModel();
29527
+ this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind();
28773
29528
  this.parent.pivotCommon.filterDialog.tabObj.selected = this.tabSelect.bind(this);
28774
29529
  }
28775
29530
  else if (this.parent.dataSourceSettings.allowMemberFilter) {
@@ -28794,7 +29549,7 @@ class PivotButton {
28794
29549
  click: (this.index === 0 ? this.updateFilterState.bind(this, this.fieldName) : this.updateCustomFilter.bind(this))
28795
29550
  },
28796
29551
  {
28797
- click: this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this),
29552
+ click: this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this.parent.pivotCommon.filterDialog),
28798
29553
  buttonModel: { cssClass: CANCEL_BUTTON_CLASS, content: this.parent.localeObj.getConstant('cancel') }
28799
29554
  }
28800
29555
  ];
@@ -28802,24 +29557,24 @@ class PivotButton {
28802
29557
  tabSelect(e) {
28803
29558
  this.index = e.selectedIndex;
28804
29559
  this.updateDialogButtonEvents();
28805
- removeClass([].slice.call(this.dialogPopUp.element.querySelectorAll('.e-selected-tab')), 'e-selected-tab');
29560
+ removeClass([].slice.call(this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelectorAll('.e-selected-tab')), 'e-selected-tab');
28806
29561
  if (e.selectedIndex > 0) {
28807
- addClass([this.dialogPopUp.element.querySelector('.e-filter-div-content' + '.' + (e.selectedIndex === 1 && this.parent.dataSourceSettings.allowLabelFilter ? 'e-label-filter' : 'e-value-filter'))], 'e-selected-tab');
29562
+ addClass([this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector('.e-filter-div-content' + '.' + (e.selectedIndex === 1 && this.parent.dataSourceSettings.allowLabelFilter ? 'e-label-filter' : 'e-value-filter'))], 'e-selected-tab');
28808
29563
  }
28809
29564
  if (e.selectedIndex === 0) {
28810
29565
  this.parent.pivotCommon.filterDialog.updateCheckedState();
28811
29566
  }
28812
29567
  else {
28813
- this.dialogPopUp.buttons[0].buttonModel.disabled = false;
28814
- this.dialogPopUp.element.querySelector('.' + OK_BUTTON_CLASS).removeAttribute('disabled');
29568
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons[0].buttonModel.disabled = false;
29569
+ this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector('.' + OK_BUTTON_CLASS).removeAttribute('disabled');
28815
29570
  }
28816
29571
  }
28817
29572
  updateDialogButtonEvents() {
28818
- this.dialogPopUp.buttons = this.buttonModel();
28819
- this.dialogPopUp.dataBind();
29573
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons = this.buttonModel();
29574
+ this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind();
28820
29575
  }
28821
29576
  updateCustomFilter(args) {
28822
- let dialogElement = this.dialogPopUp.element.querySelector('.e-selected-tab');
29577
+ let dialogElement = this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector('.e-selected-tab');
28823
29578
  let fieldName = dialogElement.getAttribute('data-fieldname');
28824
29579
  let levelName = dialogElement.getAttribute('data-selectedField');
28825
29580
  let filterType = dialogElement.getAttribute('data-type');
@@ -28889,38 +29644,18 @@ class PivotButton {
28889
29644
  if (type !== 'Value') {
28890
29645
  this.parent.lastFilterInfo = PivotUtil.getFilterItemByName(fieldName, this.parent.dataSourceSettings.filterSettings);
28891
29646
  }
28892
- this.dialogPopUp.close();
29647
+ this.parent.pivotCommon.filterDialog.dialogPopUp.close();
28893
29648
  if (!observedArgs.cancel) {
28894
29649
  this.refreshPivotButtonState(fieldName, true);
28895
29650
  this.updateDataSource(true);
28896
29651
  }
28897
29652
  });
28898
29653
  }
28899
- removeFilterDialog() {
28900
- if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
28901
- this.dialogPopUp.destroy();
28902
- setTimeout(this.setFocus.bind(this));
28903
- }
28904
- if (document.getElementById(this.parentElement.id + '_EditorTreeView')) {
28905
- remove(document.getElementById(this.parentElement.id + '_EditorTreeView'));
28906
- }
28907
- }
28908
- setFocus() {
28909
- if (this.parentElement) {
28910
- let pivotButtons = [].slice.call(this.parentElement.querySelectorAll('.e-pivot-button'));
28911
- for (let item of pivotButtons) {
28912
- if (item.getAttribute('data-uid') === this.fieldName) {
28913
- item.focus();
28914
- break;
28915
- }
28916
- }
28917
- }
28918
- }
28919
29654
  ClearFilter(e) {
28920
- let dialogElement = this.dialogPopUp.element;
29655
+ let dialogElement = this.parent.pivotCommon.filterDialog.dialogPopUp.element;
28921
29656
  let fieldName = dialogElement.getAttribute('data-fieldname');
28922
29657
  let tabElement = dialogElement.querySelector('.e-selected-tab');
28923
- this.dialogPopUp.close();
29658
+ this.parent.pivotCommon.filterDialog.dialogPopUp.close();
28924
29659
  if (this.parent.dataType === 'olap' && tabElement) {
28925
29660
  let levelName = tabElement.getAttribute('data-selectedField');
28926
29661
  this.removeDataSourceSettings(fieldName, levelName);
@@ -28936,63 +29671,73 @@ class PivotButton {
28936
29671
  let target = args.target;
28937
29672
  let fieldName = target.parentElement.id;
28938
29673
  let fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
29674
+ this.parent.actionObj.actionName = removeField;
29675
+ this.parent.actionObj.fieldInfo = fieldInfo;
29676
+ if (this.parent.actionBeginMethod()) {
29677
+ return;
29678
+ }
28939
29679
  let removeFieldArgs = {
28940
29680
  cancel: false, fieldName: fieldName,
28941
29681
  dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.parent.dataSourceSettings),
28942
29682
  fieldItem: fieldInfo.fieldItem, axis: fieldInfo.axis
28943
29683
  };
28944
- let control = this.parent.getModuleName() === 'pivotfieldlist' &&
28945
- this.parent.isPopupView ? this.parent.pivotGridModule : this.parent;
28946
- control.trigger(fieldRemove, removeFieldArgs, (observedArgs) => {
28947
- if (!observedArgs.cancel) {
28948
- if (target.parentElement.getAttribute('isvalue') === 'true') {
28949
- this.parent.setProperties({ dataSourceSettings: { values: [] } }, true);
28950
- if (this.parent.dataType === 'olap') {
28951
- this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
29684
+ try {
29685
+ let control = this.parent.getModuleName() === 'pivotfieldlist' &&
29686
+ this.parent.isPopupView ? this.parent.pivotGridModule : this.parent;
29687
+ control.trigger(fieldRemove, removeFieldArgs, (observedArgs) => {
29688
+ if (!observedArgs.cancel) {
29689
+ if (target.parentElement.getAttribute('isvalue') === 'true') {
29690
+ this.parent.setProperties({ dataSourceSettings: { values: [] } }, true);
29691
+ if (this.parent.dataType === 'olap') {
29692
+ this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
29693
+ }
28952
29694
  }
28953
- }
28954
- else {
28955
- this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(fieldName);
28956
- if (this.parent.dataType === 'pivot' && this.parent.showValuesButton && this.parent.dataSourceSettings.values.length > 1 &&
28957
- fieldInfo.position < this.parent.dataSourceSettings.valueIndex && ((this.parent.dataSourceSettings.valueAxis === 'row' &&
28958
- observedArgs.axis === 'rows') || (this.parent.dataSourceSettings.valueAxis === 'column' && observedArgs.axis === 'columns'))) {
28959
- this.parent.setProperties({ dataSourceSettings: { valueIndex: this.parent.dataSourceSettings.valueIndex - 1 } }, true);
29695
+ else {
29696
+ this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(fieldName);
29697
+ if (this.parent.dataType === 'pivot' && this.parent.showValuesButton && this.parent.dataSourceSettings.values.length > 1 &&
29698
+ fieldInfo.position < this.parent.dataSourceSettings.valueIndex && ((this.parent.dataSourceSettings.valueAxis === 'row' &&
29699
+ observedArgs.axis === 'rows') || (this.parent.dataSourceSettings.valueAxis === 'column' && observedArgs.axis === 'columns'))) {
29700
+ this.parent.setProperties({ dataSourceSettings: { valueIndex: this.parent.dataSourceSettings.valueIndex - 1 } }, true);
29701
+ }
29702
+ if (this.parent.dataType === 'olap' && this.parent.dataSourceSettings.values.length === 0) {
29703
+ this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
29704
+ }
28960
29705
  }
28961
- if (this.parent.dataType === 'olap' && this.parent.dataSourceSettings.values.length === 0) {
28962
- this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
29706
+ if (this.parent.getModuleName() === 'pivotfieldlist') {
29707
+ this.parent.axisFieldModule.render();
28963
29708
  }
29709
+ this.updateDataSource();
28964
29710
  }
28965
- if (this.parent.getModuleName() === 'pivotfieldlist') {
28966
- this.parent.axisFieldModule.render();
28967
- }
28968
- this.updateDataSource();
28969
- }
28970
- });
29711
+ });
29712
+ }
29713
+ catch (execption) {
29714
+ this.parent.actionFailureMethod(execption);
29715
+ }
28971
29716
  }
28972
29717
  /** @hidden */
28973
29718
  nodeStateModified(args) {
28974
29719
  let target = closest(args.node, 'li');
28975
29720
  let fieldName = target.getAttribute('data-fieldname');
28976
29721
  if (target.getAttribute('data-memberId') === 'all') {
28977
- this.memberTreeView.nodeChecked = null;
29722
+ this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = null;
28978
29723
  if (args.action === 'check') {
28979
- this.memberTreeView.checkAll();
29724
+ this.parent.pivotCommon.filterDialog.memberTreeView.checkAll();
28980
29725
  }
28981
29726
  else {
28982
- this.memberTreeView.uncheckAll();
29727
+ this.parent.pivotCommon.filterDialog.memberTreeView.uncheckAll();
28983
29728
  }
28984
29729
  if (this.parent.dataType === 'olap' && this.parent.olapEngineModule &&
28985
29730
  !this.parent.olapEngineModule.fieldList[fieldName].isHierarchy) {
28986
- this.updateNodeStates(this.memberTreeView.getAllCheckedNodes(), fieldName, args.action);
29731
+ this.updateNodeStates(this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(), fieldName, args.action);
28987
29732
  }
28988
29733
  this.checkedStateAll(args.action);
28989
- this.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
29734
+ this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
28990
29735
  }
28991
29736
  else {
28992
29737
  if (this.parent.dataType === 'olap' && this.parent.olapEngineModule &&
28993
29738
  !this.parent.olapEngineModule.fieldList[fieldName].isHierarchy) {
28994
29739
  // let st1: number = new Date().getTime();
28995
- let checkedNodes = this.memberTreeView.getAllCheckedNodes();
29740
+ let checkedNodes = this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes();
28996
29741
  // let st2: number = (new Date().getTime() - st1) / 1000;
28997
29742
  // console.log('getAllCheckedNodes:' + st2);
28998
29743
  this.updateNodeStates(checkedNodes, fieldName, args.action);
@@ -29032,8 +29777,8 @@ class PivotButton {
29032
29777
  }
29033
29778
  if (currentMembers[member]) {
29034
29779
  currentMembers[member].isSelected = false;
29035
- if (this.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]')) {
29036
- let element = this.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]');
29780
+ if (this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]')) {
29781
+ let element = this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]');
29037
29782
  if (element && !element.querySelector('ul')) {
29038
29783
  this.parent.pivotCommon.eventBase.updateChildNodeStates(fieldList.filterMembers, fieldName, member, false);
29039
29784
  }
@@ -29042,8 +29787,8 @@ class PivotButton {
29042
29787
  }
29043
29788
  for (let node of checkedNodes) {
29044
29789
  if (currentMembers[node]) {
29045
- if (this.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]')) {
29046
- let element = this.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]');
29790
+ if (this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]')) {
29791
+ let element = this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]');
29047
29792
  if (element && !element.querySelector('ul')) {
29048
29793
  currentMembers[node].isSelected = true;
29049
29794
  this.parent.pivotCommon.eventBase.updateChildNodeStates(fieldList.filterMembers, fieldName, node, true);
@@ -29078,10 +29823,10 @@ class PivotButton {
29078
29823
  !engineModule.fieldList[fieldName].isHierarchy) {
29079
29824
  let cMembers = engineModule.fieldList[fieldName].members;
29080
29825
  let sMembers = engineModule.fieldList[fieldName].currrentMembers;
29081
- filterItem.items = this.memberTreeView.getAllCheckedNodes();
29826
+ filterItem.items = this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes();
29082
29827
  filterItem.levelCount = engineModule.fieldList[fieldName].levelCount;
29083
29828
  isNodeUnChecked = (filterItem.items.length ===
29084
- this.memberTreeView.fields.dataSource.length ? false : true);
29829
+ this.parent.pivotCommon.filterDialog.memberTreeView.fields.dataSource.length ? false : true);
29085
29830
  if (engineModule.fieldList[fieldName].searchMembers.length > 0 && !isNodeUnChecked) {
29086
29831
  let cNodeLength = Object.keys(cMembers).length;
29087
29832
  let sNodeLength = Object.keys(sMembers).length;
@@ -29142,13 +29887,17 @@ class PivotButton {
29142
29887
  }
29143
29888
  this.parent.dataSourceSettings.filterSettings.push(filterItem);
29144
29889
  }
29145
- this.dialogPopUp.close();
29890
+ this.parent.pivotCommon.filterDialog.dialogPopUp.close();
29146
29891
  if (!observedArgs.cancel) {
29147
29892
  this.refreshPivotButtonState(fieldName, isNodeUnChecked);
29148
29893
  if (!isNodeUnChecked) {
29149
29894
  this.removeDataSourceSettings(fieldName);
29150
29895
  }
29151
29896
  this.parent.lastFilterInfo = filterItem;
29897
+ let actionInfo = {
29898
+ filterInfo: this.parent.lastFilterInfo
29899
+ };
29900
+ this.parent.actionObj.actionInfo = actionInfo;
29152
29901
  this.updateDataSource(true);
29153
29902
  let thisObj = this;
29154
29903
  //setTimeout(() => {
@@ -29302,14 +30051,6 @@ class PivotButton {
29302
30051
  this.columnFieldDropDownList.destroy();
29303
30052
  this.columnFieldDropDownList = null;
29304
30053
  }
29305
- if (this.memberTreeView && !this.memberTreeView.isDestroyed) {
29306
- this.memberTreeView.destroy();
29307
- this.memberTreeView = null;
29308
- }
29309
- if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
29310
- this.dialogPopUp.destroy();
29311
- this.dialogPopUp = null;
29312
- }
29313
30054
  if (this.draggable && !this.draggable.isDestroyed) {
29314
30055
  this.draggable.destroy();
29315
30056
  this.draggable = null;
@@ -29449,6 +30190,8 @@ let PivotFieldList = class PivotFieldList extends Component {
29449
30190
  this.enableValueSorting = false;
29450
30191
  this.request = new XMLHttpRequest();
29451
30192
  this.remoteData = [];
30193
+ /** @hidden */
30194
+ this.actionObj = {};
29452
30195
  }
29453
30196
  /**
29454
30197
  * To provide the array of modules needed for control rendering
@@ -29679,7 +30422,9 @@ let PivotFieldList = class PivotFieldList extends Component {
29679
30422
  enableValueSorting: enableValueSorting,
29680
30423
  isDrillThrough: isDrillThrough,
29681
30424
  localeObj: localeObj,
29682
- clonedReport: this.clonedReport
30425
+ clonedReport: this.clonedReport,
30426
+ globalize: this.globalize,
30427
+ currenyCode: this.currencyCode
29683
30428
  };
29684
30429
  }
29685
30430
  return customProperties;
@@ -30364,6 +31109,11 @@ let PivotFieldList = class PivotFieldList extends Component {
30364
31109
  pivot.pivotGridModule.fieldListSpinnerElement = pivot.fieldListSpinnerElement;
30365
31110
  }
30366
31111
  });
31112
+ let actionName = this.getActionCompleteName();
31113
+ this.actionObj.actionName = actionName;
31114
+ if (this.actionObj.actionName) {
31115
+ this.actionCompleteMethod();
31116
+ }
30367
31117
  }
30368
31118
  updateOlapDataSource(pivot, isSorted, isCalcChange, isOlapDataRefreshed) {
30369
31119
  let customProperties = pivot.frameCustomProperties(pivot.olapEngineModule.fieldListData, pivot.olapEngineModule.fieldList);
@@ -30397,6 +31147,7 @@ let PivotFieldList = class PivotFieldList extends Component {
30397
31147
  update(control) {
30398
31148
  if (control) {
30399
31149
  this.clonedDataSet = control.clonedDataSet;
31150
+ this.clonedReport = control.clonedReport;
30400
31151
  this.setProperties({ dataSourceSettings: control.dataSourceSettings, showValuesButton: control.showValuesButton }, true);
30401
31152
  this.engineModule = control.engineModule;
30402
31153
  this.olapEngineModule = control.olapEngineModule;
@@ -30431,6 +31182,7 @@ let PivotFieldList = class PivotFieldList extends Component {
30431
31182
  updateView(control) {
30432
31183
  if (control) {
30433
31184
  control.clonedDataSet = this.clonedDataSet;
31185
+ control.clonedReport = this.clonedReport;
30434
31186
  control.setProperties({ dataSourceSettings: this.dataSourceSettings, showValuesButton: this.showValuesButton }, true);
30435
31187
  control.engineModule = this.engineModule;
30436
31188
  control.olapEngineModule = this.olapEngineModule;
@@ -30473,6 +31225,47 @@ let PivotFieldList = class PivotFieldList extends Component {
30473
31225
  }
30474
31226
  });
30475
31227
  }
31228
+ /** @hidden */
31229
+ actionBeginMethod() {
31230
+ let eventArgs = {
31231
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
31232
+ actionName: this.actionObj.actionName,
31233
+ fieldInfo: this.actionObj.fieldInfo,
31234
+ cancel: false
31235
+ };
31236
+ let control = this.isPopupView ? this.pivotGridModule : this;
31237
+ control.trigger(actionBegin, eventArgs);
31238
+ return eventArgs.cancel;
31239
+ }
31240
+ /** @hidden */
31241
+ actionCompleteMethod() {
31242
+ let eventArgs = {
31243
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
31244
+ actionName: this.actionObj.actionName,
31245
+ fieldInfo: this.actionObj.fieldInfo,
31246
+ actionInfo: this.actionObj.actionInfo
31247
+ };
31248
+ let control = this.isPopupView ? this.pivotGridModule : this;
31249
+ control.trigger(actionComplete, eventArgs);
31250
+ this.actionObj.actionName = '';
31251
+ this.actionObj.actionInfo = undefined;
31252
+ this.actionObj.fieldInfo = undefined;
31253
+ }
31254
+ /** @hidden */
31255
+ actionFailureMethod(error) {
31256
+ let eventArgs = {
31257
+ actionName: this.actionObj.actionName,
31258
+ errorInfo: error
31259
+ };
31260
+ let control = this.isPopupView ? this.pivotGridModule : this;
31261
+ control.trigger(actionFailure, eventArgs);
31262
+ }
31263
+ /** @hidden */
31264
+ getActionCompleteName() {
31265
+ let actionName = (this.actionObj.actionName == openCalculatedField) ? calculatedFieldApplied : (this.actionObj.actionName == editCalculatedField) ? calculatedFieldEdited : (this.actionObj.actionName == sortField) ? fieldSorted
31266
+ : (this.actionObj.actionName == filterField) ? fieldFiltered : (this.actionObj.actionName == removeField) ? fieldRemoved : (this.actionObj.actionName == aggregateField) ? fieldAggregated : this.actionObj.actionName == sortFieldTree ? fieldTreeSorted : this.actionObj.actionName;
31267
+ return actionName;
31268
+ }
30476
31269
  /**
30477
31270
  * Destroys the Field Table component.
30478
31271
  * @function destroy
@@ -30547,6 +31340,9 @@ let PivotFieldList = class PivotFieldList extends Component {
30547
31340
  if (this.clonedDataSet) {
30548
31341
  this.clonedDataSet = null;
30549
31342
  }
31343
+ if (this.clonedReport) {
31344
+ this.clonedReport = null;
31345
+ }
30550
31346
  if (this.clonedFieldList) {
30551
31347
  this.clonedFieldList = null;
30552
31348
  }
@@ -30595,6 +31391,9 @@ __decorate$4([
30595
31391
  __decorate$4([
30596
31392
  Property(['Sum', 'Count', 'DistinctCount', 'Product', 'Min', 'Max', 'Avg', 'Median', 'Index', 'PopulationVar', 'SampleVar', 'PopulationStDev', 'SampleStDev', 'RunningTotals', 'PercentageOfGrandTotal', 'PercentageOfColumnTotal', 'PercentageOfRowTotal', 'PercentageOfParentColumnTotal', 'PercentageOfParentRowTotal', 'DifferenceFrom', 'PercentageOfDifferenceFrom', 'PercentageOfParentTotal'])
30597
31393
  ], PivotFieldList.prototype, "aggregateTypes", void 0);
31394
+ __decorate$4([
31395
+ Property('USD')
31396
+ ], PivotFieldList.prototype, "currencyCode", void 0);
30598
31397
  __decorate$4([
30599
31398
  Event()
30600
31399
  ], PivotFieldList.prototype, "load", void 0);
@@ -30643,6 +31442,15 @@ __decorate$4([
30643
31442
  __decorate$4([
30644
31443
  Event()
30645
31444
  ], PivotFieldList.prototype, "beforeServiceInvoke", void 0);
31445
+ __decorate$4([
31446
+ Event()
31447
+ ], PivotFieldList.prototype, "actionBegin", void 0);
31448
+ __decorate$4([
31449
+ Event()
31450
+ ], PivotFieldList.prototype, "actionComplete", void 0);
31451
+ __decorate$4([
31452
+ Event()
31453
+ ], PivotFieldList.prototype, "actionFailure", void 0);
30646
31454
  PivotFieldList = __decorate$4([
30647
31455
  NotifyPropertyChanges
30648
31456
  ], PivotFieldList);
@@ -30875,105 +31683,114 @@ class CalculatedField {
30875
31683
  displayMenu(node, treeNode, target) {
30876
31684
  let edit = target ? target.classList.contains(CALC_EDIT) : true;
30877
31685
  let edited = target ? target.classList.contains(CALC_EDITED) : true;
30878
- if (this.parent.dataType === 'pivot' && node.querySelector('.e-list-icon.e-format') &&
30879
- node.querySelector('.e-list-icon.e-format').classList.contains(ICON) &&
30880
- !node.querySelector('.e-list-icon').classList.contains(CALC_EDITED) &&
30881
- !node.querySelector('.e-list-icon').classList.contains(GRID_REMOVE) &&
30882
- !node.querySelector('.e-list-icon').classList.contains(CALC_EDIT) && node.tagName === 'LI') {
30883
- if (this.menuObj && !this.menuObj.isDestroyed) {
30884
- this.menuObj.destroy();
30885
- }
30886
- this.curMenu = node.querySelector('.' + LIST_TEXT_CLASS);
30887
- this.openContextMenu(node);
30888
- }
30889
- else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDIT) &&
30890
- node.querySelector('.' + CALC_EDIT).classList.contains('e-list-icon') && edit ||
30891
- (this.parent.dataType === 'olap' && node.getAttribute('data-type') === CALC && node.classList.contains('e-active') && ((target && !target.classList.contains(GRID_REMOVE)) || !target)))) {
30892
- this.isEdit = true;
30893
- let fieldName = node.getAttribute('data-field');
30894
- let caption = node.getAttribute('data-caption');
30895
- this.currentFieldName = fieldName;
30896
- this.inputObj.value = caption;
30897
- this.inputObj.dataBind();
30898
- let formatString = node.getAttribute('data-formatString');
30899
- let dialogElement = this.dialog.element;
30900
- let customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
30901
- if (this.parent.dataType === 'olap') {
30902
- let memberType = node.getAttribute('data-membertype');
30903
- let parentHierarchy = node.getAttribute('data-hierarchy');
30904
- let expression = node.getAttribute('data-formula');
30905
- let customString = node.getAttribute('data-customString');
30906
- let fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
30907
- let memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
30908
- let hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
30909
- let formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
30910
- /* eslint-enable max-len */
30911
- fieldTitle.innerHTML = this.parent.localeObj.getConstant('caption');
30912
- select('#' + this.parentID + 'droppable', document).value = expression;
30913
- memberTypeDrop.readonly = true;
30914
- memberTypeDrop.value = memberType;
30915
- memberTypeDrop.dataBind();
30916
- if (memberType === 'Dimension') {
30917
- hierarchyDrop.value = parentHierarchy;
31686
+ try {
31687
+ if (this.parent.dataType === 'pivot' && node.querySelector('.e-list-icon.e-format') &&
31688
+ node.querySelector('.e-list-icon.e-format').classList.contains(ICON) &&
31689
+ !node.querySelector('.e-list-icon').classList.contains(CALC_EDITED) &&
31690
+ !node.querySelector('.e-list-icon').classList.contains(GRID_REMOVE) &&
31691
+ !node.querySelector('.e-list-icon').classList.contains(CALC_EDIT) && node.tagName === 'LI') {
31692
+ if (this.menuObj && !this.menuObj.isDestroyed) {
31693
+ this.menuObj.destroy();
31694
+ }
31695
+ this.curMenu = node.querySelector('.' + LIST_TEXT_CLASS);
31696
+ this.openContextMenu(node);
31697
+ }
31698
+ else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDIT) &&
31699
+ node.querySelector('.' + CALC_EDIT).classList.contains('e-list-icon') && edit ||
31700
+ (this.parent.dataType === 'olap' && node.getAttribute('data-type') === CALC && node.classList.contains('e-active') && ((target && !target.classList.contains(GRID_REMOVE)) || !target)))) {
31701
+ this.isEdit = true;
31702
+ let fieldName = node.getAttribute('data-field');
31703
+ let caption = node.getAttribute('data-caption');
31704
+ this.currentFieldName = fieldName;
31705
+ this.inputObj.value = caption;
31706
+ this.inputObj.dataBind();
31707
+ let formatString = node.getAttribute('data-formatString');
31708
+ let dialogElement = this.dialog.element;
31709
+ let customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
31710
+ if (this.parent.dataType === 'olap') {
31711
+ let memberType = node.getAttribute('data-membertype');
31712
+ let parentHierarchy = node.getAttribute('data-hierarchy');
31713
+ let expression = node.getAttribute('data-formula');
31714
+ let customString = node.getAttribute('data-customString');
31715
+ let fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
31716
+ let memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
31717
+ let hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
31718
+ let formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
31719
+ /* eslint-enable max-len */
31720
+ fieldTitle.innerHTML = this.parent.localeObj.getConstant('caption');
31721
+ select('#' + this.parentID + 'droppable', document).value = expression;
31722
+ memberTypeDrop.readonly = true;
31723
+ memberTypeDrop.value = memberType;
31724
+ memberTypeDrop.dataBind();
31725
+ if (memberType === 'Dimension') {
31726
+ hierarchyDrop.value = parentHierarchy;
31727
+ }
31728
+ if (formatString !== '') {
31729
+ formatDrop.value = formatString;
31730
+ formatDrop.dataBind();
31731
+ }
31732
+ customFormat.value = customString;
31733
+ }
31734
+ else {
31735
+ customFormat.value = formatString;
31736
+ addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
31737
+ removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
31738
+ addClass([node.querySelector('.e-list-icon')], CALC_EDITED);
31739
+ removeClass([node.querySelector('.e-list-icon')], CALC_EDIT);
31740
+ node.querySelector('.' + CALC_EDITED).setAttribute('title', this.parent.localeObj.getConstant('clearCalculatedField'));
31741
+ select('#' + this.parentID + 'droppable', document).value = node.getAttribute('data-uid');
30918
31742
  }
30919
- if (formatString !== '') {
30920
- formatDrop.value = formatString;
31743
+ customFormat.dataBind();
31744
+ }
31745
+ else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDITED) &&
31746
+ node.querySelector('.' + CALC_EDITED).classList.contains('e-list-icon') && edited ||
31747
+ (this.parent.dataType === 'olap' && !node.classList.contains('e-active')))) {
31748
+ this.isEdit = false;
31749
+ this.inputObj.value = '';
31750
+ this.inputObj.dataBind();
31751
+ let dialogElement = this.dialog.element;
31752
+ let customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
31753
+ customFormat.value = '';
31754
+ customFormat.dataBind();
31755
+ if (this.parent.dataType === 'olap') {
31756
+ let hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
31757
+ let formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
31758
+ let memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
31759
+ let fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
31760
+ /* eslint-enable max-len */
31761
+ fieldTitle.innerHTML = this.parent.localeObj.getConstant('fieldTitle');
31762
+ hierarchyDrop.index = 0;
31763
+ hierarchyDrop.dataBind();
31764
+ formatDrop.index = 0;
30921
31765
  formatDrop.dataBind();
31766
+ memberTypeDrop.index = 0;
31767
+ memberTypeDrop.readonly = false;
31768
+ memberTypeDrop.dataBind();
31769
+ }
31770
+ else {
31771
+ addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
31772
+ removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
31773
+ node.querySelector('.' + CALC_EDIT).setAttribute('title', this.parent.localeObj.getConstant('edit'));
30922
31774
  }
30923
- customFormat.value = customString;
31775
+ select('#' + this.parentID + 'droppable', document).value = '';
30924
31776
  }
30925
- else {
30926
- customFormat.value = formatString;
30927
- addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
30928
- removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
30929
- addClass([node.querySelector('.e-list-icon')], CALC_EDITED);
30930
- removeClass([node.querySelector('.e-list-icon')], CALC_EDIT);
30931
- node.querySelector('.' + CALC_EDITED).setAttribute('title', this.parent.localeObj.getConstant('clearCalculatedField'));
30932
- select('#' + this.parentID + 'droppable', document).value = node.getAttribute('data-uid');
31777
+ else if (node.tagName === 'LI' && (node.querySelector('.' + GRID_REMOVE) &&
31778
+ node.querySelector('.' + GRID_REMOVE).classList.contains('e-list-icon')) && !edit && !edited) {
31779
+ this.parent.actionObj.actionName = removeField;
31780
+ if (this.parent.actionBeginMethod()) {
31781
+ return;
31782
+ }
31783
+ let dropField = select('#' + this.parentID + 'droppable', document);
31784
+ let field = {
31785
+ name: this.isEdit ? this.currentFieldName : this.inputObj.value,
31786
+ caption: this.inputObj.value,
31787
+ formula: dropField.value
31788
+ };
31789
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeCalculatedField'), field, true, treeNode);
30933
31790
  }
30934
- customFormat.dataBind();
30935
31791
  }
30936
- else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDITED) &&
30937
- node.querySelector('.' + CALC_EDITED).classList.contains('e-list-icon') && edited ||
30938
- (this.parent.dataType === 'olap' && !node.classList.contains('e-active')))) {
30939
- this.isEdit = false;
30940
- this.inputObj.value = '';
30941
- this.inputObj.dataBind();
30942
- let dialogElement = this.dialog.element;
30943
- let customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
30944
- customFormat.value = '';
30945
- customFormat.dataBind();
30946
- if (this.parent.dataType === 'olap') {
30947
- let hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
30948
- let formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
30949
- let memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
30950
- let fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
30951
- /* eslint-enable max-len */
30952
- fieldTitle.innerHTML = this.parent.localeObj.getConstant('fieldTitle');
30953
- hierarchyDrop.index = 0;
30954
- hierarchyDrop.dataBind();
30955
- formatDrop.index = 0;
30956
- formatDrop.dataBind();
30957
- memberTypeDrop.index = 0;
30958
- memberTypeDrop.readonly = false;
30959
- memberTypeDrop.dataBind();
30960
- }
30961
- else {
30962
- addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
30963
- removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
30964
- node.querySelector('.' + CALC_EDIT).setAttribute('title', this.parent.localeObj.getConstant('edit'));
30965
- }
30966
- select('#' + this.parentID + 'droppable', document).value = '';
30967
- }
30968
- else if (node.tagName === 'LI' && (node.querySelector('.' + GRID_REMOVE) &&
30969
- node.querySelector('.' + GRID_REMOVE).classList.contains('e-list-icon')) && !edit && !edited) {
30970
- let dropField = select('#' + this.parentID + 'droppable', document);
30971
- let field = {
30972
- name: this.isEdit ? this.currentFieldName : this.inputObj.value,
30973
- caption: this.inputObj.value,
30974
- formula: dropField.value
30975
- };
30976
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeCalculatedField'), field, true, treeNode);
31792
+ catch (execption) {
31793
+ this.parent.actionFailureMethod(execption);
30977
31794
  }
30978
31795
  }
30979
31796
  removeCalcField(node) {
@@ -31382,6 +32199,12 @@ class CalculatedField {
31382
32199
  this.parent.isRequiredUpdate = false;
31383
32200
  }
31384
32201
  try {
32202
+ let actionInfo = {
32203
+ calculatedFieldInfo: this.parent.lastCalcFieldInfo
32204
+ };
32205
+ this.parent.actionObj.actionInfo = actionInfo;
32206
+ let actionName = (this.parent.actionObj.actionName == editCalculatedField) ? calculatedFieldEdited : calculatedFieldApplied;
32207
+ this.parent.actionObj.actionName = actionName;
31385
32208
  this.parent.updateDataSource(false);
31386
32209
  let pivot = (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule) ?
31387
32210
  this.parent.pivotGridModule : this.parent;
@@ -32823,7 +33646,7 @@ class FieldList {
32823
33646
  update() {
32824
33647
  let currentWidth;
32825
33648
  if (this.parent.currentView !== 'Table') {
32826
- currentWidth = this.parent.chart ? this.parent.chartModule.getCalulatedWidth() : currentWidth;
33649
+ currentWidth = this.parent.chart ? this.parent.pivotChartModule.getCalulatedWidth() : currentWidth;
32827
33650
  }
32828
33651
  else {
32829
33652
  currentWidth = this.parent.grid ? this.parent.grid.element.offsetWidth : currentWidth;
@@ -33292,7 +34115,7 @@ class GroupingBar {
33292
34115
  currentWidth = this.parent.grid ? this.parent.grid.element.offsetWidth : currentWidth;
33293
34116
  }
33294
34117
  else {
33295
- currentWidth = this.parent.chart ? this.parent.chartModule.getCalulatedWidth() : currentWidth;
34118
+ currentWidth = this.parent.chart ? this.parent.pivotChartModule.getCalulatedWidth() : currentWidth;
33296
34119
  }
33297
34120
  if (currentWidth) {
33298
34121
  let actWidth = currentWidth < 400 ? 400 : currentWidth;
@@ -33562,15 +34385,17 @@ class ConditionalFormatting {
33562
34385
  },
33563
34386
  {
33564
34387
  click: this.applyButtonClick.bind(this),
34388
+ isFlat: true,
33565
34389
  buttonModel: {
33566
- cssClass: FLAT_CLASS + ' ' + FORMAT_APPLY_BUTTON,
34390
+ isPrimary: true, cssClass: FORMAT_APPLY_BUTTON,
33567
34391
  content: this.parent.localeObj.getConstant('apply')
33568
34392
  }
33569
34393
  },
33570
34394
  {
33571
34395
  click: this.cancelButtonClick.bind(this),
34396
+ isFlat: true,
33572
34397
  buttonModel: {
33573
- cssClass: FLAT_CLASS + ' ' + FORMAT_CANCEL_BUTTON,
34398
+ cssClass: FORMAT_CANCEL_BUTTON,
33574
34399
  content: this.parent.localeObj.getConstant('cancel')
33575
34400
  }
33576
34401
  }
@@ -33623,6 +34448,10 @@ class ConditionalFormatting {
33623
34448
  applyButtonClick() {
33624
34449
  if (this.refreshConditionValues()) {
33625
34450
  this.parent.setProperties({ dataSourceSettings: { conditionalFormatSettings: this.newFormat } }, true);
34451
+ let actionInfo = {
34452
+ conditionalFormattingInfo: this.parent.dataSourceSettings.conditionalFormatSettings
34453
+ };
34454
+ this.parent.actionObj.actionInfo = actionInfo;
33626
34455
  this.parent.renderPivotGrid();
33627
34456
  this.dialog.close();
33628
34457
  }
@@ -34319,12 +35148,22 @@ class Toolbar$2 {
34319
35148
  }
34320
35149
  /* eslint-enable */
34321
35150
  reportChange(args) {
34322
- this.dropArgs = args;
34323
- if (this.parent.isModified && this.currentReport !== '') {
34324
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
35151
+ this.parent.actionObj.actionName = reportChange;
35152
+ if (this.parent.actionBeginMethod()) {
35153
+ args.cancel = true;
35154
+ return;
34325
35155
  }
34326
- else {
34327
- this.reportLoad(args);
35156
+ try {
35157
+ this.dropArgs = args;
35158
+ if (this.parent.isModified && this.currentReport !== '') {
35159
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
35160
+ }
35161
+ else {
35162
+ this.reportLoad(args);
35163
+ }
35164
+ }
35165
+ catch (execption) {
35166
+ this.parent.actionFailureMethod(execption);
34328
35167
  }
34329
35168
  }
34330
35169
  reportLoad(args) {
@@ -34332,6 +35171,10 @@ class Toolbar$2 {
34332
35171
  let loadArgs = {
34333
35172
  reportName: args.itemData.value
34334
35173
  };
35174
+ let actionInfo = {
35175
+ reportName: args.itemData.value
35176
+ };
35177
+ this.parent.actionObj.actionInfo = actionInfo;
34335
35178
  this.parent.trigger(loadReport, loadArgs, (observedArgs) => {
34336
35179
  this.currentReport = observedArgs.reportName;
34337
35180
  this.parent.isModified = false;
@@ -34344,7 +35187,15 @@ class Toolbar$2 {
34344
35187
  report: this.parent.getPersistData(),
34345
35188
  reportName: this.currentReport
34346
35189
  };
35190
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
35191
+ let actionInfo = {
35192
+ reportName: this.currentReport
35193
+ };
35194
+ this.parent.actionObj.actionInfo = actionInfo;
34347
35195
  this.parent.trigger(saveReport, saveArgs);
35196
+ if (this.parent.actionObj.actionName) {
35197
+ this.parent.actionCompleteMethod();
35198
+ }
34348
35199
  this.parent.isModified = false;
34349
35200
  }
34350
35201
  else if (this.currentReport === '' && (args.item.id === (this.parent.element.id + 'save') || args.item.id === (this.parent.element.id + 'saveas'))) {
@@ -34408,54 +35259,67 @@ class Toolbar$2 {
34408
35259
  }
34409
35260
  }
34410
35261
  actionClick(args) {
34411
- switch (args.item.id) {
34412
- case (this.parent.element.id + 'save'):
34413
- case (this.parent.element.id + 'saveas'):
34414
- this.saveReport(args);
34415
- break;
34416
- case (this.parent.element.id + 'remove'):
34417
- this.action = 'Remove';
34418
- if (this.currentReport && this.currentReport !== '') {
34419
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeConfirm'));
34420
- }
34421
- else {
34422
- this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant('error'), this.parent.localeObj.getConstant('emptyReport'));
34423
- }
34424
- return;
34425
- case (this.parent.element.id + 'rename'):
34426
- this.renameReport(args);
34427
- break;
34428
- case (this.parent.element.id + 'new'):
34429
- this.action = 'New';
34430
- this.newArgs = args;
34431
- if (this.parent.isModified && this.currentReport && this.currentReport !== '') {
34432
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
34433
- }
34434
- else {
34435
- this.createNewReport(args);
34436
- }
34437
- break;
34438
- case (this.parent.element.id + 'load'):
34439
- this.action = 'Load';
34440
- break;
34441
- case (this.parent.element.id + 'fieldlist'):
34442
- if (this.parent.pivotFieldListModule && this.parent.pivotFieldListModule.dialogRenderer) {
34443
- this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.show();
34444
- }
34445
- break;
34446
- case (this.parent.element.id + 'formatting'):
34447
- if (this.parent.conditionalFormattingModule) {
34448
- this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
34449
- }
34450
- break;
34451
- case (this.parent.element.id + 'mdxQuery'):
34452
- this.mdxQueryDialog(args);
34453
- break;
34454
- case (this.parent.element.id + 'numberFormatting'):
34455
- if (this.parent.numberFormattingModule) {
34456
- this.parent.numberFormattingModule.showNumberFormattingDialog();
34457
- }
34458
- break;
35262
+ let actionName = (args.item.id == "PivotViewnew") ? addNewReport : (args.item.id == "PivotViewsave") ? saveCurrentReport : (args.item.id == "PivotViewsaveas") ? saveAsCurrentReport
35263
+ : (args.item.id == "PivotViewrename") ? renameCurrentReport : (args.item.id == "PivotViewremove") ? removeCurrentReport : (args.item.id == "PivotViewload") ? loadReports
35264
+ : (args.item.id == "PivotViewformatting") ? openConditionalFormatting : (args.item.id == "PivotViewnumberFormatting") ? openNumberFormatting
35265
+ : (args.item.id == "PivotViewmdxQuery") ? MdxQuery : (args.item.id == "PivotViewfieldlist") ? showFieldList : '';
35266
+ this.parent.actionObj.actionName = actionName;
35267
+ if (this.parent.actionBeginMethod()) {
35268
+ return;
35269
+ }
35270
+ try {
35271
+ switch (args.item.id) {
35272
+ case (this.parent.element.id + 'save'):
35273
+ case (this.parent.element.id + 'saveas'):
35274
+ this.saveReport(args);
35275
+ break;
35276
+ case (this.parent.element.id + 'remove'):
35277
+ this.action = 'Remove';
35278
+ if (this.currentReport && this.currentReport !== '') {
35279
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeConfirm'));
35280
+ }
35281
+ else {
35282
+ this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant('error'), this.parent.localeObj.getConstant('emptyReport'));
35283
+ }
35284
+ return;
35285
+ case (this.parent.element.id + 'rename'):
35286
+ this.renameReport(args);
35287
+ break;
35288
+ case (this.parent.element.id + 'new'):
35289
+ this.action = 'New';
35290
+ this.newArgs = args;
35291
+ if (this.parent.isModified && this.currentReport && this.currentReport !== '') {
35292
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
35293
+ }
35294
+ else {
35295
+ this.createNewReport(args);
35296
+ }
35297
+ break;
35298
+ case (this.parent.element.id + 'load'):
35299
+ this.action = 'Load';
35300
+ break;
35301
+ case (this.parent.element.id + 'fieldlist'):
35302
+ if (this.parent.pivotFieldListModule && this.parent.pivotFieldListModule.dialogRenderer) {
35303
+ this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.show();
35304
+ }
35305
+ break;
35306
+ case (this.parent.element.id + 'formatting'):
35307
+ if (this.parent.conditionalFormattingModule) {
35308
+ this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
35309
+ }
35310
+ break;
35311
+ case (this.parent.element.id + 'mdxQuery'):
35312
+ this.mdxQueryDialog(args);
35313
+ break;
35314
+ case (this.parent.element.id + 'numberFormatting'):
35315
+ if (this.parent.numberFormattingModule) {
35316
+ this.parent.numberFormattingModule.showNumberFormattingDialog();
35317
+ }
35318
+ break;
35319
+ }
35320
+ }
35321
+ catch (execption) {
35322
+ this.parent.actionFailureMethod(execption);
34459
35323
  }
34460
35324
  }
34461
35325
  renderDialog() {
@@ -34578,6 +35442,10 @@ class Toolbar$2 {
34578
35442
  report: _this.parent.getPersistData(),
34579
35443
  reportName: reportInput.value
34580
35444
  };
35445
+ let actionInfo = {
35446
+ reportName: reportInput.value
35447
+ };
35448
+ this.parent.actionObj.actionInfo = actionInfo;
34581
35449
  _this.parent.trigger(saveReport, saveArgs);
34582
35450
  _this.parent.isModified = false;
34583
35451
  _this.updateReportList();
@@ -34610,6 +35478,10 @@ class Toolbar$2 {
34610
35478
  report: _this.parent.getPersistData(),
34611
35479
  reportName: reportInput.value
34612
35480
  };
35481
+ let actionInfo = {
35482
+ reportName: reportInput.value
35483
+ };
35484
+ this.parent.actionObj.actionInfo = actionInfo;
34613
35485
  _this.parent.trigger(saveReport, saveArgs);
34614
35486
  _this.parent.isModified = false;
34615
35487
  _this.updateReportList();
@@ -34644,12 +35516,20 @@ class Toolbar$2 {
34644
35516
  reportName: _this.currentReport,
34645
35517
  rename: reportInput.value
34646
35518
  };
35519
+ let actionInfo = {
35520
+ reportName: { oldName: _this.currentReport, newName: reportInput.value }
35521
+ };
35522
+ this.parent.actionObj.actionInfo = actionInfo;
34647
35523
  _this.parent.trigger(renameReport, renameArgs);
34648
35524
  _this.currentReport = reportInput.value;
34649
35525
  _this.updateReportList();
34650
35526
  _this.dialog.hide();
34651
35527
  });
34652
35528
  }
35529
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
35530
+ if (this.parent.actionObj.actionName) {
35531
+ this.parent.actionCompleteMethod();
35532
+ }
34653
35533
  }
34654
35534
  createNewReport(args) {
34655
35535
  this.dialogShow(args);
@@ -34707,6 +35587,10 @@ class Toolbar$2 {
34707
35587
  let removeArgs = {
34708
35588
  reportName: this.currentReport
34709
35589
  };
35590
+ let actionInfo = {
35591
+ reportName: this.currentReport
35592
+ };
35593
+ this.parent.actionObj.actionInfo = actionInfo;
34710
35594
  this.parent.trigger(removeReport, removeArgs);
34711
35595
  let reports = this.fetchReports();
34712
35596
  if (reports.reportName && reports.reportName.length > 0) {
@@ -34725,6 +35609,10 @@ class Toolbar$2 {
34725
35609
  this.action = '';
34726
35610
  }
34727
35611
  this.updateReportList();
35612
+ this.parent.actionObj.actionName = reportRemoved;
35613
+ if (this.parent.actionObj.actionName) {
35614
+ this.parent.actionCompleteMethod();
35615
+ }
34728
35616
  }
34729
35617
  else if (this.action === 'New' || (this.action !== 'Save' && this.action !== 'Rename' && this.action !== 'New')) {
34730
35618
  if (this.currentReport && this.currentReport !== '' && this.parent.isModified) {
@@ -34732,12 +35620,22 @@ class Toolbar$2 {
34732
35620
  report: this.parent.getPersistData(),
34733
35621
  reportName: this.currentReport
34734
35622
  };
35623
+ let actionInfo = {
35624
+ reportName: this.currentReport
35625
+ };
35626
+ this.parent.actionObj.actionInfo = actionInfo;
35627
+ this.parent.actionObj.actionName = reportSaved;
35628
+ if (this.parent.actionObj.actionName) {
35629
+ this.parent.actionCompleteMethod();
35630
+ }
34735
35631
  this.parent.trigger(saveReport, saveArgs);
34736
35632
  this.parent.isModified = false;
34737
35633
  if (this.action === 'New') {
35634
+ this.parent.actionObj.actionName = addNewReport;
34738
35635
  this.createNewReport(this.newArgs);
34739
35636
  }
34740
35637
  else {
35638
+ this.parent.actionObj.actionName = reportChange;
34741
35639
  this.reportLoad(this.dropArgs);
34742
35640
  }
34743
35641
  }
@@ -34842,6 +35740,7 @@ class Toolbar$2 {
34842
35740
  this.chartMenu = new Menu({
34843
35741
  items: menu, enableRtl: this.parent.enableRtl,
34844
35742
  locale: this.parent.locale,
35743
+ cssClass: TOOLBAR_MENU,
34845
35744
  select: this.menuItemClick.bind(this),
34846
35745
  beforeOpen: this.whitespaceRemove.bind(this),
34847
35746
  onClose: (args) => {
@@ -34897,6 +35796,7 @@ class Toolbar$2 {
34897
35796
  this.exportMenu = new Menu({
34898
35797
  items: menu, enableRtl: this.parent.enableRtl,
34899
35798
  locale: this.parent.locale,
35799
+ cssClass: TOOLBAR_MENU,
34900
35800
  select: this.menuItemClick.bind(this), beforeOpen: this.updateExportMenu.bind(this),
34901
35801
  onClose: (args) => {
34902
35802
  this.focusToolBar();
@@ -34934,6 +35834,7 @@ class Toolbar$2 {
34934
35834
  this.subTotalMenu = new Menu({
34935
35835
  items: menu, enableRtl: this.parent.enableRtl,
34936
35836
  locale: this.parent.locale,
35837
+ cssClass: TOOLBAR_MENU,
34937
35838
  select: this.menuItemClick.bind(this), beforeOpen: this.updateSubtotalSelection.bind(this),
34938
35839
  onClose: (args) => {
34939
35840
  this.focusToolBar();
@@ -34971,6 +35872,7 @@ class Toolbar$2 {
34971
35872
  this.grandTotalMenu = new Menu({
34972
35873
  items: menu, enableRtl: this.parent.enableRtl,
34973
35874
  locale: this.parent.locale,
35875
+ cssClass: TOOLBAR_MENU,
34974
35876
  select: this.menuItemClick.bind(this), beforeOpen: this.updateGrandtotalSelection.bind(this),
34975
35877
  onClose: (args) => {
34976
35878
  this.focusToolBar();
@@ -34998,6 +35900,7 @@ class Toolbar$2 {
34998
35900
  this.formattingMenu = new Menu({
34999
35901
  items: menu, enableRtl: this.parent.enableRtl,
35000
35902
  locale: this.parent.locale,
35903
+ cssClass: TOOLBAR_MENU,
35001
35904
  select: this.menuItemClick.bind(this)
35002
35905
  });
35003
35906
  this.formattingMenu.isStringTemplate = true;
@@ -35195,181 +36098,202 @@ class Toolbar$2 {
35195
36098
  menuItemClick(args) {
35196
36099
  let exportArgs = {};
35197
36100
  let type;
36101
+ let actionName = (args.item.id == "PivotViewgrid") ? tableView : (args.item.id == "PivotView_Column") ? chartView : (args.item.id == "PivotView_Bar") ? chartView : (args.item.id == "PivotView_Line") ? chartView
36102
+ : (args.item.id == "PivotView_Area") ? chartView : (args.item.id == "PivotView_Scatter") ? chartView : (args.item.id == "PivotView_Polar") ? chartView : (args.item.id == "PivotView_ChartMoreOption") ? chartView
36103
+ : (args.item.id == "PivotView_multipleAxes") ? multipleAxis : (args.item.id == "PivotView_showLegend") ? showLegend : (args.item.id == "PivotViewpdf") ? pdfExport : (args.item.id == "PivotViewpng") ? pngExport
36104
+ : (args.item.id == "PivotViewexcel") ? excelExport : (args.item.id == "PivotViewcsv") ? csvExport : (args.item.id == "PivotViewjpeg") ? jpegExport : (args.item.id == "PivotViewsvg") ? svgExport
36105
+ : (args.item.id == "PivotViewnotsubtotal") ? hideSubTotals : (args.item.id == "PivotViewsubtotalrow") ? subTotalsRow : (args.item.id == "PivotViewsubtotalcolumn") ? subTotalsColumn
36106
+ : (args.item.id == "PivotViewsubtotal") ? showSubTotals : (args.item.id == "PivotViewnotgrandtotal") ? hideGrandTotals : (args.item.id == "PivotViewgrandtotalrow") ? grandTotalsRow
36107
+ : (args.item.id == "PivotViewgrandtotalcolumn") ? grandTotalsColumn : (args.item.id == "PivotViewgrandtotal") ? showGrandTotals
36108
+ : (args.item.id == "PivotViewnumberFormattingMenu") ? numberFormattingMenu : (args.item.id == "PivotViewconditionalFormattingMenu") ? conditionalFormattingMenu : '';
36109
+ this.parent.actionObj.actionName = actionName;
36110
+ if (this.parent.actionBeginMethod()) {
36111
+ return;
36112
+ }
35198
36113
  if (this.getAllChartItems().indexOf(args.item.id.split(this.parent.element.id + '_')[1]) > -1 ||
35199
36114
  (args.item.id.split(this.parent.element.id + '_')[1] === 'ChartMoreOption') ||
35200
36115
  (args.item.id.split(this.parent.element.id + '_')[1] === 'multipleAxes') ||
35201
36116
  (args.item.id.split(this.parent.element.id + '_')[1] === 'showLegend')) {
35202
36117
  type = args.item.id.split(this.parent.element.id + '_')[1];
35203
36118
  }
35204
- switch (args.item.id) {
35205
- case (this.parent.element.id + 'grid'):
35206
- if (this.parent.grid && this.parent.chart) {
35207
- this.parent.grid.element.style.display = '';
35208
- this.parent.chart.element.style.display = 'none';
35209
- if (this.parent.chartSettings.enableMultipleAxis && this.parent.chartSettings.enableScrollOnMultiAxis) {
35210
- this.parent.element.querySelector('.e-pivotchart').style.display = 'none';
35211
- }
35212
- this.parent.currentView = 'Table';
35213
- this.parent.setProperties({ displayOption: { primary: 'Table' } }, true);
35214
- if (this.parent.showGroupingBar && this.parent.groupingBarModule) {
35215
- this.parent.element.querySelector('.e-pivot-grouping-bar').style.display = '';
35216
- this.parent.element.querySelector('.e-chart-grouping-bar').style.display = 'none';
36119
+ try {
36120
+ switch (args.item.id) {
36121
+ case (this.parent.element.id + 'grid'):
36122
+ if (this.parent.grid && this.parent.chart) {
36123
+ this.parent.grid.element.style.display = '';
36124
+ this.parent.chart.element.style.display = 'none';
36125
+ if (this.parent.chartSettings.enableMultipleAxis && this.parent.chartSettings.enableScrollOnMultiAxis) {
36126
+ this.parent.element.querySelector('.e-pivotchart').style.display = 'none';
36127
+ }
36128
+ this.parent.currentView = 'Table';
36129
+ this.parent.setProperties({ displayOption: { primary: 'Table' } }, true);
36130
+ if (this.parent.showGroupingBar && this.parent.groupingBarModule) {
36131
+ this.parent.element.querySelector('.e-pivot-grouping-bar').style.display = '';
36132
+ this.parent.element.querySelector('.e-chart-grouping-bar').style.display = 'none';
36133
+ }
36134
+ let actionInfo = {
36135
+ toolbarInfo: { displayOption: this.parent.displayOption, gridSettings: this.parent.gridSettings }
36136
+ };
36137
+ this.parent.actionObj.actionInfo = actionInfo;
36138
+ this.parent.layoutRefresh();
35217
36139
  }
35218
- this.parent.layoutRefresh();
35219
- }
35220
- break;
35221
- case (this.parent.element.id + 'pdf'):
35222
- if (this.parent.currentView === 'Table') {
36140
+ break;
36141
+ case (this.parent.element.id + 'pdf'):
36142
+ if (this.parent.currentView === 'Table') {
36143
+ exportArgs = {
36144
+ pdfExportProperties: { fileName: 'Export.pdf' },
36145
+ pdfDoc: undefined,
36146
+ isBlob: false,
36147
+ isMultipleExport: false
36148
+ };
36149
+ this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
36150
+ this.parent.pdfExport(observedArgs.pdfExportProperties, observedArgs.isMultipleExport, observedArgs.pdfDoc, observedArgs.isBlob);
36151
+ });
36152
+ }
36153
+ else {
36154
+ exportArgs = {
36155
+ width: undefined,
36156
+ height: undefined,
36157
+ orientation: PdfPageOrientation.Landscape,
36158
+ type: 'PDF',
36159
+ fileName: 'result',
36160
+ };
36161
+ this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
36162
+ this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
36163
+ });
36164
+ }
36165
+ break;
36166
+ case (this.parent.element.id + 'excel'):
36167
+ exportArgs = {
36168
+ excelExportProperties: { fileName: 'Export.xlsx' },
36169
+ isBlob: undefined,
36170
+ isMultipleExport: undefined,
36171
+ workbook: undefined
36172
+ };
36173
+ this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
36174
+ this.parent.excelExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
36175
+ });
36176
+ break;
36177
+ case (this.parent.element.id + 'csv'):
35223
36178
  exportArgs = {
35224
- pdfExportProperties: { fileName: 'Export.pdf' },
35225
- pdfDoc: undefined,
36179
+ excelExportProperties: { fileName: 'Export.csv' },
35226
36180
  isBlob: false,
35227
- isMultipleExport: false
36181
+ isMultipleExport: false,
36182
+ workbook: undefined
35228
36183
  };
35229
36184
  this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35230
- this.parent.pdfExport(observedArgs.pdfExportProperties, observedArgs.isMultipleExport, observedArgs.pdfDoc, observedArgs.isBlob);
36185
+ this.parent.csvExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
35231
36186
  });
35232
- }
35233
- else {
36187
+ break;
36188
+ case (this.parent.element.id + 'png'):
35234
36189
  exportArgs = {
36190
+ type: 'PNG',
35235
36191
  width: undefined,
35236
36192
  height: undefined,
36193
+ fileName: 'result',
35237
36194
  orientation: PdfPageOrientation.Landscape,
35238
- type: 'PDF',
36195
+ };
36196
+ this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
36197
+ this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
36198
+ });
36199
+ break;
36200
+ case (this.parent.element.id + 'jpeg'):
36201
+ exportArgs = {
36202
+ type: 'JPEG',
35239
36203
  fileName: 'result',
36204
+ orientation: PdfPageOrientation.Landscape,
36205
+ width: undefined,
36206
+ height: undefined,
35240
36207
  };
35241
36208
  this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35242
36209
  this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35243
36210
  });
35244
- }
35245
- break;
35246
- case (this.parent.element.id + 'excel'):
35247
- exportArgs = {
35248
- excelExportProperties: { fileName: 'Export.xlsx' },
35249
- isBlob: undefined,
35250
- isMultipleExport: undefined,
35251
- workbook: undefined
35252
- };
35253
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35254
- this.parent.excelExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
35255
- });
35256
- break;
35257
- case (this.parent.element.id + 'csv'):
35258
- exportArgs = {
35259
- excelExportProperties: { fileName: 'Export.csv' },
35260
- isBlob: false,
35261
- isMultipleExport: false,
35262
- workbook: undefined
35263
- };
35264
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35265
- this.parent.csvExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
35266
- });
35267
- break;
35268
- case (this.parent.element.id + 'png'):
35269
- exportArgs = {
35270
- type: 'PNG',
35271
- width: undefined,
35272
- height: undefined,
35273
- fileName: 'result',
35274
- orientation: PdfPageOrientation.Landscape,
35275
- };
35276
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35277
- this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35278
- });
35279
- break;
35280
- case (this.parent.element.id + 'jpeg'):
35281
- exportArgs = {
35282
- type: 'JPEG',
35283
- fileName: 'result',
35284
- orientation: PdfPageOrientation.Landscape,
35285
- width: undefined,
35286
- height: undefined,
35287
- };
35288
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35289
- this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35290
- });
35291
- break;
35292
- case (this.parent.element.id + 'svg'):
35293
- exportArgs = {
35294
- width: undefined,
35295
- height: undefined,
35296
- type: 'SVG',
35297
- fileName: 'result',
35298
- orientation: PdfPageOrientation.Landscape,
35299
- };
35300
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35301
- this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35302
- });
35303
- break;
35304
- case (this.parent.element.id + 'notsubtotal'):
35305
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: false, showColumnSubTotals: false, showRowSubTotals: false } }, true);
35306
- this.parent.refreshData();
35307
- break;
35308
- case (this.parent.element.id + 'subtotalrow'):
35309
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: false, showRowSubTotals: true } }, true);
35310
- this.parent.refreshData();
35311
- break;
35312
- case (this.parent.element.id + 'subtotalcolumn'):
35313
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: false } }, true);
35314
- this.parent.refreshData();
35315
- break;
35316
- case (this.parent.element.id + 'subtotal'):
35317
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: true } }, true);
35318
- this.parent.refreshData();
35319
- break;
35320
- case (this.parent.element.id + 'notgrandtotal'):
35321
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: false, showColumnGrandTotals: false, showRowGrandTotals: false } }, true);
35322
- this.parent.refreshData();
35323
- break;
35324
- case (this.parent.element.id + 'grandtotalrow'):
35325
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: false, showRowGrandTotals: true } }, true);
35326
- this.parent.refreshData();
35327
- break;
35328
- case (this.parent.element.id + 'grandtotalcolumn'):
35329
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: false } }, true);
35330
- this.parent.refreshData();
35331
- break;
35332
- case (this.parent.element.id + 'grandtotal'):
35333
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: true } }, true);
35334
- this.parent.refreshData();
35335
- break;
35336
- case (this.parent.element.id + 'numberFormattingMenu'):
35337
- if (this.parent.numberFormattingModule) {
35338
- this.parent.numberFormattingModule.showNumberFormattingDialog();
35339
- }
35340
- break;
35341
- case (this.parent.element.id + 'conditionalFormattingMenu'):
35342
- if (this.parent.conditionalFormattingModule) {
35343
- this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
35344
- }
35345
- break;
35346
- case (this.parent.element.id + '_' + type):
35347
- if (args.item && args.item.text) {
35348
- if (type === 'ChartMoreOption') {
35349
- this.createChartTypeDialog();
35350
- }
35351
- else if (type === 'multipleAxes') {
35352
- if (this.parent.chartSettings.enableScrollOnMultiAxis) {
35353
- this.isMultiAxisChange = true;
35354
- }
35355
- this.parent.chartSettings.enableMultipleAxis = !this.parent.chartSettings.enableMultipleAxis;
35356
- this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
36211
+ break;
36212
+ case (this.parent.element.id + 'svg'):
36213
+ exportArgs = {
36214
+ width: undefined,
36215
+ height: undefined,
36216
+ type: 'SVG',
36217
+ fileName: 'result',
36218
+ orientation: PdfPageOrientation.Landscape,
36219
+ };
36220
+ this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
36221
+ this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
36222
+ });
36223
+ break;
36224
+ case (this.parent.element.id + 'notsubtotal'):
36225
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: false, showColumnSubTotals: false, showRowSubTotals: false } }, true);
36226
+ this.parent.refreshData();
36227
+ break;
36228
+ case (this.parent.element.id + 'subtotalrow'):
36229
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: false, showRowSubTotals: true } }, true);
36230
+ this.parent.refreshData();
36231
+ break;
36232
+ case (this.parent.element.id + 'subtotalcolumn'):
36233
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: false } }, true);
36234
+ this.parent.refreshData();
36235
+ break;
36236
+ case (this.parent.element.id + 'subtotal'):
36237
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: true } }, true);
36238
+ this.parent.refreshData();
36239
+ break;
36240
+ case (this.parent.element.id + 'notgrandtotal'):
36241
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: false, showColumnGrandTotals: false, showRowGrandTotals: false } }, true);
36242
+ this.parent.refreshData();
36243
+ break;
36244
+ case (this.parent.element.id + 'grandtotalrow'):
36245
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: false, showRowGrandTotals: true } }, true);
36246
+ this.parent.refreshData();
36247
+ break;
36248
+ case (this.parent.element.id + 'grandtotalcolumn'):
36249
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: false } }, true);
36250
+ this.parent.refreshData();
36251
+ break;
36252
+ case (this.parent.element.id + 'grandtotal'):
36253
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: true } }, true);
36254
+ this.parent.refreshData();
36255
+ break;
36256
+ case (this.parent.element.id + 'numberFormattingMenu'):
36257
+ if (this.parent.numberFormattingModule) {
36258
+ this.parent.numberFormattingModule.showNumberFormattingDialog();
35357
36259
  }
35358
- else if (this.getAllChartItems().indexOf(type) > -1) {
35359
- this.updateChartType(type, false);
36260
+ break;
36261
+ case (this.parent.element.id + 'conditionalFormattingMenu'):
36262
+ if (this.parent.conditionalFormattingModule) {
36263
+ this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
35360
36264
  }
35361
- else if (type === 'showLegend') {
35362
- this.parent.chart.legendSettings.visible = !this.showLableState;
35363
- if (this.parent.chartSettings.legendSettings) {
35364
- this.parent.chartSettings.legendSettings.visible = !this.showLableState;
36265
+ break;
36266
+ case (this.parent.element.id + '_' + type):
36267
+ if (args.item && args.item.text) {
36268
+ if (type === 'ChartMoreOption') {
36269
+ this.createChartTypeDialog();
36270
+ }
36271
+ else if (type === 'multipleAxes') {
36272
+ if (this.parent.chartSettings.enableScrollOnMultiAxis) {
36273
+ this.isMultiAxisChange = true;
36274
+ }
36275
+ this.parent.chartSettings.enableMultipleAxis = !this.parent.chartSettings.enableMultipleAxis;
36276
+ this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
35365
36277
  }
35366
- else {
35367
- this.parent.setProperties({ chartSettings: { legendSettings: { visible: !this.showLableState } } }, true);
36278
+ else if (this.getAllChartItems().indexOf(type) > -1) {
36279
+ this.updateChartType(type, false);
36280
+ }
36281
+ else if (type === 'showLegend') {
36282
+ this.parent.chart.legendSettings.visible = !this.showLableState;
36283
+ if (this.parent.chartSettings.legendSettings) {
36284
+ this.parent.chartSettings.legendSettings.visible = !this.showLableState;
36285
+ }
36286
+ else {
36287
+ this.parent.setProperties({ chartSettings: { legendSettings: { visible: !this.showLableState } } }, true);
36288
+ }
36289
+ this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
35368
36290
  }
35369
- this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
35370
36291
  }
35371
- }
35372
- break;
36292
+ break;
36293
+ }
36294
+ }
36295
+ catch (execption) {
36296
+ this.parent.actionFailureMethod(execption);
35373
36297
  }
35374
36298
  /* eslint-enable max-len */
35375
36299
  }
@@ -35460,14 +36384,20 @@ class Toolbar$2 {
35460
36384
  if (this.parent.chart) {
35461
36385
  this.parent.currentView = 'Chart';
35462
36386
  this.parent.setProperties({ displayOption: { primary: 'Chart' } }, true);
35463
- this.parent.chart.element.style.width = formatUnit(this.parent.grid ? this.parent.getGridWidthAsNumber() : this.parent.getWidthAsNumber()); /* eslint-disable-line */
36387
+ if (this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
36388
+ this.parent.element.querySelector('.' + PIVOTCHART).style.width = formatUnit(this.parent.grid ? this.parent.getGridWidthAsNumber() : this.parent.getWidthAsNumber()); /* eslint-disable-line */
36389
+ }
35464
36390
  this.parent.chart.setProperties({ width: formatUnit(this.parent.grid ? this.parent.getGridWidthAsNumber() : this.parent.getWidthAsNumber()) }, true); /* eslint-disable-line */
35465
36391
  if (this.parent.chartSettings.chartSeries.type === type && !isMultiAxis) {
35466
- this.parent.chartModule.updateView();
36392
+ this.parent.pivotChartModule.updateView();
35467
36393
  }
35468
36394
  else {
35469
36395
  this.parent.chartSettings.chartSeries.type = type;
35470
36396
  }
36397
+ let actionInfo = {
36398
+ toolbarInfo: { displayOption: this.parent.displayOption, chartSettings: this.parent.chartSettings }
36399
+ };
36400
+ this.parent.actionObj.actionInfo = actionInfo;
35471
36401
  }
35472
36402
  }
35473
36403
  }
@@ -36027,6 +36957,10 @@ class NumberFormatting {
36027
36957
  this.parent.trigger(numberFormatting, eventArgs, (observedArgs) => {
36028
36958
  if (!observedArgs.cancel) {
36029
36959
  this.parent.setProperties({ dataSourceSettings: { formatSettings: observedArgs.formatSettings } }, true);
36960
+ let actionInfo = {
36961
+ numberFormattingInfo: this.parent.dataSourceSettings.formatSettings
36962
+ };
36963
+ this.parent.actionObj.actionInfo = actionInfo;
36030
36964
  try {
36031
36965
  this.parent.updateDataSource(false);
36032
36966
  this.dialog.close();
@@ -36684,7 +37618,7 @@ class Grouping {
36684
37618
  for (let j = 0, len = field.customGroups.length; j < len; j++) {
36685
37619
  if (field.customGroups[j]) {
36686
37620
  let group = field.customGroups[j];
36687
- if (group.items && PivotUtil.isContainCommonElements(group.items, selectedOptions)) {
37621
+ if (group.items && PivotExportUtil.isContainCommonElements(group.items, selectedOptions)) {
36688
37622
  splicedItems = this.mergeArray(splicedItems, [group.groupName]);
36689
37623
  newItems = this.mergeArray(newItems, group.items);
36690
37624
  field.customGroups.splice(j, 1);
@@ -36934,5 +37868,5 @@ class Grouping {
36934
37868
  * Export PivotGrid components
36935
37869
  */
36936
37870
 
36937
- export { GroupingBarSettings, CellEditSettings, ConditionalSettings, HyperlinkSettings, DisplayOption, PivotView, Render, ExcelExport$1 as ExcelExport, PDFExport, KeyboardInteraction, VirtualScroll$1 as VirtualScroll, DrillThrough, PivotChart, PivotFieldList, TreeViewRenderer, AxisFieldRenderer, AxisTableRenderer, DialogRenderer, EventBase, NodeStateModified, DataSourceUpdate, FieldList, CommonKeyboardInteraction, Common, GroupingBar, CalculatedField, ConditionalFormatting, PivotCommon, load, enginePopulating, enginePopulated, onFieldDropped, fieldDrop, beforePivotTableRender, afterPivotTableRender, beforeExport, excelHeaderQueryCellInfo, pdfHeaderQueryCellInfo, excelQueryCellInfo, pdfQueryCellInfo, onPdfCellRender, dataBound, queryCellInfo, headerCellInfo, hyperlinkCellClick, resizing, resizeStop, cellClick, drillThrough, beforeColumnsRender, selected, cellSelecting, drill, cellSelected, cellDeselected, rowSelected, rowDeselected, beginDrillThrough, editCompleted, multiLevelLabelClick, saveReport, fetchReport, loadReport, renameReport, removeReport, newReport, toolbarRender, toolbarClick, chartTooltipRender, chartLoaded, chartLoad, chartResized, chartAxisLabelRender, chartSeriesCreated, aggregateCellInfo, contextMenuClick, contextMenuOpen, fieldListRefreshed, conditionalFormatting, beforePdfExport, beforeExcelExport, memberFiltering, calculatedFieldCreate, memberEditorOpen, fieldRemove, numberFormatting, aggregateMenuOpen, fieldDragStart, chartPointClick, beforeServiceInvoke, initialLoad, uiUpdate, scroll, contentReady, dataReady, initSubComponent, treeViewUpdate, pivotButtonUpdate, initCalculatedField, click, initToolbar, initFormatting, initGrouping, Theme, ErrorDialog, FilterDialog, PivotContextMenu, AggregateMenu, Toolbar$2 as Toolbar, NumberFormatting, Grouping, PivotEngine, PivotUtil, OlapEngine, MDXQuery };
37871
+ export { GroupingBarSettings, CellEditSettings, ConditionalSettings, HyperlinkSettings, DisplayOption, PivotView, Render, ExcelExport$1 as ExcelExport, PDFExport, KeyboardInteraction, VirtualScroll$1 as VirtualScroll, DrillThrough, PivotChart, PivotFieldList, TreeViewRenderer, AxisFieldRenderer, AxisTableRenderer, DialogRenderer, EventBase, NodeStateModified, DataSourceUpdate, FieldList, CommonKeyboardInteraction, Common, GroupingBar, CalculatedField, ConditionalFormatting, PivotCommon, load, enginePopulating, enginePopulated, onFieldDropped, fieldDrop, beforePivotTableRender, afterPivotTableRender, beforeExport, excelHeaderQueryCellInfo, pdfHeaderQueryCellInfo, excelQueryCellInfo, pdfQueryCellInfo, onPdfCellRender, dataBound, queryCellInfo, headerCellInfo, hyperlinkCellClick, resizing, resizeStop, cellClick, drillThrough, beforeColumnsRender, selected, cellSelecting, drill, cellSelected, cellDeselected, rowSelected, rowDeselected, beginDrillThrough, editCompleted, multiLevelLabelClick, saveReport, fetchReport, loadReport, renameReport, removeReport, newReport, toolbarRender, toolbarClick, chartTooltipRender, chartLoaded, chartLoad, chartResized, chartAxisLabelRender, chartSeriesCreated, aggregateCellInfo, contextMenuClick, contextMenuOpen, fieldListRefreshed, conditionalFormatting, beforePdfExport, beforeExcelExport, memberFiltering, calculatedFieldCreate, memberEditorOpen, fieldRemove, numberFormatting, aggregateMenuOpen, fieldDragStart, chartPointClick, beforeServiceInvoke, actionBegin, actionComplete, actionFailure, initialLoad, uiUpdate, scroll, contentReady, dataReady, initSubComponent, treeViewUpdate, pivotButtonUpdate, initCalculatedField, click, initToolbar, initFormatting, initGrouping, sortValue, drillUp, drillDown, addNewReport, saveCurrentReport, saveAsCurrentReport, renameCurrentReport, removeCurrentReport, loadReports, openConditionalFormatting, openNumberFormatting, MdxQuery, showFieldList, tableView, chartView, multipleAxis, showLegend, pdfExport, pngExport, excelExport, csvExport, jpegExport, svgExport, hideSubTotals, subTotalsRow, subTotalsColumn, showSubTotals, hideGrandTotals, grandTotalsRow, grandTotalsColumn, showGrandTotals, numberFormattingMenu, conditionalFormattingMenu, reportChange, sortFieldTree, editCalculatedField, sortField, filterField, removeField, openCalculatedField, editRecord, saveEditedRecords, addNewRecord, removeRecord, aggregateField, contextMenuCalculatedField, windowResize, calculatedFieldApplied, editedRecordsSaved, newRecordAdded, recordRemoved, closeFieldlist, fieldTreeSorted, reportSaved, newReportAdded, reportReSaved, reportRenamed, reportRemoved, excelExported, csvExported, pdfExported, pngExported, jpegExported, svgExported, conditionallyFormatted, numberFormatted, tableViewed, chartViewed, subTotalsHidden, subTotalsRowShown, subTotalsColumnShown, subTotalsShown, grandTotalsHidden, grandTotalsRowShown, grandTotalsColumnShown, grandTotalsShown, valueSorted, calculatedFieldEdited, fieldSorted, fieldFiltered, fieldRemoved, fieldAggregated, recordEdited, reportChanged, windowResized, recordUpdated, drillThroughClosed, Theme, ErrorDialog, FilterDialog, PivotContextMenu, AggregateMenu, Toolbar$2 as Toolbar, NumberFormatting, Grouping, PivotEngine, PivotUtil, OlapEngine, MDXQuery };
36938
37872
  //# sourceMappingURL=ej2-pivotview.es2015.js.map