@syncfusion/ej2-pivotview 19.3.48 → 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 +29 -19
  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 +2080 -1110
  7. package/dist/es6/ej2-pivotview.es2015.js.map +1 -1
  8. package/dist/es6/ej2-pivotview.es5.js +2096 -1120
  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 +74 -29
  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 +313 -109
  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 +64 -20
  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);
@@ -4086,6 +3907,7 @@ class PivotEngine {
4086
3907
  let summCell = headers[headers.length - 1];
4087
3908
  if (summCell && summCell.type === 'grand sum') {
4088
3909
  summCell.index = this.filterMembers;
3910
+ summCell.indexObject = {};
4089
3911
  /* eslint-disable */
4090
3912
  for (let ln = 0, lt = this.filterMembers.length; ln < lt; ln++) {
4091
3913
  summCell.indexObject[this.filterMembers[ln]] = this.filterMembers[ln];
@@ -4227,7 +4049,7 @@ class PivotEngine {
4227
4049
  insertAllMember(set, filter, customText, axis) {
4228
4050
  let len = set.length;
4229
4051
  customText = ' Total';
4230
- set[len] = {
4052
+ let grandTotalSet = {
4231
4053
  hasChild: false,
4232
4054
  index: filter,
4233
4055
  level: 0,
@@ -4241,13 +4063,14 @@ class PivotEngine {
4241
4063
  type: 'grand sum',
4242
4064
  valueSort: {}
4243
4065
  };
4244
- set[len].valueSort[set[len].formattedText] = 1;
4245
- set[len].valueSort.levelName = set[len].formattedText;
4246
- set[len].valueSort[set[len].actualText] = 1;
4247
- 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;
4248
4070
  for (let ln = 0, lt = filter.length; ln < lt; ln++) {
4249
- set[len].indexObject[filter[ln]] = filter[ln];
4071
+ grandTotalSet.indexObject[filter[ln]] = filter[ln];
4250
4072
  }
4073
+ (this.dataSourceSettings.grandTotalsPosition === 'Top' && this.dataSourceSettings.showGrandTotals) ? set.unshift(grandTotalSet) : set.push(grandTotalSet);
4251
4074
  // if (axis === 'row') {
4252
4075
  // this.rowCount += this.rowValuesLength;
4253
4076
  // } else {
@@ -4266,10 +4089,11 @@ class PivotEngine {
4266
4089
  row.colIndex = 0;
4267
4090
  row.rowIndex = tnum;
4268
4091
  let isRowFieldsAvail = false;
4092
+ let delimiter = this.dataSourceSettings.valueSortSettings.headerDelimiter;
4269
4093
  if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && this.dataSourceSettings.values.length > 1) {
4270
4094
  this.rowIndex = (isNullOrUndefined(this.rowIndex) && !isLeastNode && this.dataSourceSettings.rows.length === 0) ? row.index : this.rowIndex;
4271
- isRowFieldsAvail = (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total.') !== 0);
4272
- if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total.') === 0) {
4095
+ isRowFieldsAvail = (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName && row.valueSort.levelName.toString().indexOf('Grand Total' + delimiter) !== 0);
4096
+ if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total' + delimiter) === 0) {
4273
4097
  row.index = this.rowIndex;
4274
4098
  }
4275
4099
  }
@@ -4294,7 +4118,7 @@ class PivotEngine {
4294
4118
  for (let cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
4295
4119
  if (!isValueIndexFound) {
4296
4120
  for (vln = 0; vln < vlt; vln++) {
4297
- 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) {
4298
4122
  isValueIndexFound = true;
4299
4123
  isValueCellUpdated = true;
4300
4124
  break;
@@ -4329,7 +4153,7 @@ class PivotEngine {
4329
4153
  for (let cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
4330
4154
  for (let vln = 0; vln < vlt; vln++) {
4331
4155
  if (!this.valueAxis && !this.isLastHeaderHasMeasures) {
4332
- 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) {
4333
4157
  this.updateRowData(rows, columns, tnum, data, vln, rln, cln, dln, actCnt, rTotal, cTotal);
4334
4158
  dln = data[tnum].length;
4335
4159
  }
@@ -5249,6 +5073,10 @@ class PivotEngine {
5249
5073
  this.updateValueMembers(this.measureIndex === 0 && axis.length > 1, null, null, columnHeaders, axis.slice(0, axis.length - 1), vcnt, 0);
5250
5074
  this.updateValueMembers(false, null, null, columnHeaders, axis.slice(axis.length - 1, axis.length), vcnt, -1);
5251
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
+ }
5252
5080
  else {
5253
5081
  let hasColumnTotal = columns.length === 0 && axis.length === 1 && axis[0].type == 'grand sum';
5254
5082
  this.updateValueMembers(!hasColumnTotal && this.measureIndex === 0, null, null, columnHeaders, axis, vcnt, hasColumnTotal ? -1 : 0);
@@ -5288,6 +5116,10 @@ class PivotEngine {
5288
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);
5289
5117
  this.updateValueMembers(false, null, null, rowAxis, this.rMembers.slice(this.rMembers.length - 1, this.rMembers.length), this.values.length, -1);
5290
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
+ }
5291
5123
  else {
5292
5124
  let hasRowTotal = rows.length === 0 && this.rMembers.length === 1 && this.rMembers[0].type == 'grand sum';
5293
5125
  this.updateValueMembers(!hasRowTotal && this.measureIndex == 0, null, null, rowAxis, this.rMembers, this.values.length, hasRowTotal ? -1 : 0);
@@ -5891,6 +5723,12 @@ const fieldDragStart = 'fieldDragStart';
5891
5723
  const chartPointClick = 'chartPointClick';
5892
5724
  /** @hidden */
5893
5725
  const beforeServiceInvoke = 'beforeServiceInvoke';
5726
+ /** @hidden */
5727
+ const actionBegin = 'actionBegin';
5728
+ /** @hidden */
5729
+ const actionComplete = 'actionComplete';
5730
+ /** @hidden */
5731
+ const actionFailure = 'actionFailure';
5894
5732
  /**
5895
5733
  * Specifies pivot internal events
5896
5734
  */
@@ -5920,6 +5758,186 @@ const initToolbar = 'init-toolbar';
5920
5758
  const initFormatting = 'init-formatting';
5921
5759
  /** @hidden */
5922
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';
5923
5941
 
5924
5942
  /**
5925
5943
  * CSS Constants
@@ -6593,6 +6611,8 @@ const PIVOTCHART_TYPE_DIALOG = 'e-pivotchart-type-dialog';
6593
6611
  const FORMAT_FONT_COLOR_PICKER = 'e-format-font-color-picker';
6594
6612
  /** @hidden */
6595
6613
  const GROUP_PIVOT_ROW = 'e-group-pivot-rows';
6614
+ /** @hidden */
6615
+ const TOOLBAR_MENU = 'e-pivot-toolbar-menu';
6596
6616
 
6597
6617
  /**
6598
6618
  * `AggregateMenu` module to create aggregate type popup.
@@ -6621,28 +6641,39 @@ class AggregateMenu {
6621
6641
  }
6622
6642
  openContextMenu(args) {
6623
6643
  let fieldName = args.target.parentElement.id;
6644
+ let fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
6624
6645
  this.buttonElement = args.target.parentElement;
6625
6646
  let isStringField = this.parent.engineModule.fieldList[fieldName].type !== 'number' ? 1 : 0;
6626
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
+ }
6627
6653
  let eventArgs = {
6628
6654
  cancel: false, fieldName: fieldName, aggregateTypes: this.summaryTypes, displayMenuCount: 7
6629
6655
  };
6630
6656
  let control = this.parent.getModuleName() === 'pivotfieldlist' && this.parent.isPopupView ?
6631
6657
  this.parent.pivotGridModule : this.parent;
6632
- control.trigger(aggregateMenuOpen, eventArgs, (observedArgs) => {
6633
- if (!observedArgs.cancel) {
6634
- this.summaryTypes = observedArgs.aggregateTypes;
6635
- this.createContextMenu(isStringField, observedArgs.displayMenuCount);
6636
- this.currentMenu = args.target;
6637
- let pos = this.currentMenu.getBoundingClientRect();
6638
- if (this.parent.enableRtl) {
6639
- this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left - 105);
6640
- }
6641
- else {
6642
- 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
+ }
6643
6671
  }
6644
- }
6645
- });
6672
+ });
6673
+ }
6674
+ catch (execption) {
6675
+ this.parent.actionFailureMethod(execption);
6676
+ }
6646
6677
  }
6647
6678
  createContextMenu(isStringField, displayMenuCount) {
6648
6679
  let menuItems = [];
@@ -6916,31 +6947,42 @@ class AggregateMenu {
6916
6947
  selectOptionInContextMenu(menu) {
6917
6948
  if (menu.item.text !== null) {
6918
6949
  let buttonElement = this.currentMenu.parentElement;
6919
- let type = menu.item.id.split('_').pop();
6920
- if (type === 'MoreOption' || type === 'PercentageOfDifferenceFrom'
6921
- || type === 'PercentageOfParentTotal' || type === 'DifferenceFrom') {
6922
- 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;
6923
6955
  }
6924
- else {
6925
- let field = buttonElement.getAttribute('data-uid');
6926
- let valuefields = this.parent.dataSourceSettings.values;
6927
- let contentElement = buttonElement.querySelector('.e-content');
6928
- let captionName = menu.item.text + ' ' + this.parent.localeObj.getConstant('of') + ' ' +
6929
- this.parent.engineModule.fieldList[field].caption;
6930
- contentElement.innerHTML = captionName;
6931
- contentElement.setAttribute('title', captionName);
6932
- buttonElement.setAttribute('data-type', type);
6933
- for (let vCnt = 0; vCnt < this.parent.dataSourceSettings.values.length; vCnt++) {
6934
- if (this.parent.dataSourceSettings.values[vCnt].name === field) {
6935
- let dataSourceItem = extend({}, valuefields[vCnt].properties ?
6936
- valuefields[vCnt].properties : valuefields[vCnt], null, true);
6937
- dataSourceItem.type = type;
6938
- this.parent.engineModule.fieldList[field].aggregateType = type;
6939
- valuefields.splice(vCnt, 1, dataSourceItem);
6940
- 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
+ }
6941
6980
  }
6981
+ this.updateDataSource();
6942
6982
  }
6943
- this.updateDataSource();
6983
+ }
6984
+ catch (execption) {
6985
+ this.parent.actionFailureMethod(execption);
6944
6986
  }
6945
6987
  }
6946
6988
  }
@@ -7056,34 +7098,40 @@ class Render {
7056
7098
  this.resColWidth = (this.parent.showGroupingBar && this.parent.groupingBarModule) ? (this.parent.isAdaptive ? 180 : 250) :
7057
7099
  (this.parent.isAdaptive ? 140 : 200);
7058
7100
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
7059
- this.gridSettings = parent.gridSettings;
7101
+ this.gridSettings = this.parent.gridSettings;
7060
7102
  this.formatList = this.getFormatList();
7061
7103
  this.aggMenu = new AggregateMenu(this.parent);
7062
7104
  }
7063
7105
  /* eslint-disable-next-line */
7064
7106
  /** @hidden */
7065
- render() {
7066
- let parent = this.parent;
7067
- let engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
7107
+ render(refreshRequired) {
7108
+ if (refreshRequired) {
7109
+ this.initProperties();
7110
+ }
7111
+ this.resColWidth = (this.parent.showGroupingBar && this.parent.groupingBarModule) ? (this.parent.isAdaptive ? 180 : 250) :
7112
+ (this.parent.isAdaptive ? 140 : 200);
7113
+ this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
7114
+ this.gridSettings = this.parent.gridSettings;
7115
+ this.formatList = this.getFormatList();
7068
7116
  this.parent.gridHeaderCellInfo = [];
7069
7117
  this.parent.gridCellCollection = {};
7070
- this.injectGridModules(parent);
7118
+ this.injectGridModules(this.parent);
7071
7119
  this.rowStartPos = this.getRowStartPos();
7072
7120
  if (this.parent.grid && this.parent.grid.element && this.parent.element.querySelector('.e-grid')) {
7073
7121
  this.parent.notEmpty = true;
7074
- if (!engine.isEngineUpdated) {
7075
- engine.headerContent = this.frameDataSource('header');
7076
- engine.valueContent = this.frameDataSource('value');
7122
+ if (!this.engine.isEngineUpdated) {
7123
+ this.engine.headerContent = this.frameDataSource('header');
7124
+ this.engine.valueContent = this.frameDataSource('value');
7077
7125
  }
7078
7126
  else {
7079
7127
  if (this.parent.enableValueSorting) {
7080
- engine.valueContent = this.frameDataSource('value');
7128
+ this.engine.valueContent = this.frameDataSource('value');
7081
7129
  }
7082
- engine.isEngineUpdated = false;
7130
+ this.engine.isEngineUpdated = false;
7083
7131
  }
7084
7132
  this.parent.grid.setProperties({
7085
7133
  columns: this.frameStackedHeaders(), dataSource: (this.parent.dataType === 'olap' ? true :
7086
- parent.dataSourceSettings.values.length > 0) && !this.engine.isEmptyData ? engine.valueContent :
7134
+ this.parent.dataSourceSettings.values.length > 0) && !this.engine.isEmptyData ? this.engine.valueContent :
7087
7135
  this.frameDataSource('value')
7088
7136
  }, true);
7089
7137
  if (this.parent.grid.height === 'auto') {
@@ -7123,6 +7171,30 @@ class Render {
7123
7171
  }
7124
7172
  this.parent.grid.on(headerRefreshed, this.refreshHeader, this);
7125
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
+ }
7126
7198
  refreshHeader() {
7127
7199
  if (this.parent.enableVirtualization) {
7128
7200
  let mHdr = this.parent.element.querySelector('.' + MOVABLEHEADER_DIV);
@@ -7323,9 +7395,9 @@ class Render {
7323
7395
  this.parent.renderReactTemplates(); /* eslint-disable-line */
7324
7396
  }
7325
7397
  if (this.parent.isInitial) {
7398
+ this.parent.isInitial = false;
7326
7399
  this.parent.refreshData();
7327
7400
  }
7328
- this.parent.isInitial = false;
7329
7401
  this.parent.notify(contentReady, {});
7330
7402
  }
7331
7403
  setFocusOnLastCell() {
@@ -8129,7 +8201,7 @@ class Render {
8129
8201
  if (cell.isSum) {
8130
8202
  tCell.classList.add(SUMMARY);
8131
8203
  }
8132
- 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' &&
8133
8205
  ((this.colGrandPos - this.parent.dataSourceSettings.values.length) < Number(tCell.getAttribute('aria-colindex'))));
8134
8206
  if (cell.isGrandSum || (isGrandSum || this.colGrandPos === Number(tCell.getAttribute('aria-colindex'))) || this.rowGrandPos === Number(tCell.getAttribute('index'))) {
8135
8207
  tCell.classList.add('e-gtot');
@@ -8270,6 +8342,12 @@ class Render {
8270
8342
  }
8271
8343
  lvlPos++;
8272
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
+ }
8273
8351
  if (cell.memberType === 3 && cell.level === -1 && Object.keys(this.lvlCollection).length > 1) {
8274
8352
  tCell.appendChild(createElement('span', {
8275
8353
  className: NEXTSPAN,
@@ -8581,8 +8659,8 @@ class Render {
8581
8659
  if (this.parent.currentView !== 'Chart') {
8582
8660
  if (this.gridSettings.height === 'auto' && parHeight && this.parent.element.querySelector('.' + GRID_HEADER)) {
8583
8661
  let rowColHeight = this.parent.element.querySelector('.' + GRID_HEADER).offsetHeight;
8584
- let gBarHeight = rowColHeight + (this.parent.element.querySelector('.' + GROUPING_BAR_CLASS) ?
8585
- 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);
8586
8664
  let toolBarHeight = this.parent.element.querySelector('.' + GRID_TOOLBAR) ? 42 : 0;
8587
8665
  gridHeight = parHeight - (gBarHeight + toolBarHeight) - 1;
8588
8666
  gridHeight = gridHeight < 40 ? 40 : gridHeight;
@@ -8794,7 +8872,7 @@ class Render {
8794
8872
  return this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[cellInfo.value.toString()].aggregateType)
8795
8873
  + ' ' + this.parent.localeObj.getConstant('of') + ' ' + cellInfo.value.toString();
8796
8874
  }
8797
- else if (values.length === 1) {
8875
+ else if (values.length === 1 && this.parent.dataSourceSettings.rows.length === 0) {
8798
8876
  return this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(values[values.length - 1].type)
8799
8877
  + ' ' + this.parent.localeObj.getConstant('of') + ' ' + (!isNullOrUndefined(values[values.length - 1].caption) ? values[values.length - 1].caption : values[values.length - 1].name);
8800
8878
  }
@@ -8816,7 +8894,9 @@ class Render {
8816
8894
  }
8817
8895
  /* eslint-disable */
8818
8896
  excelColumnEvent(args) {
8819
- (args.cell).value = this.getValidHeader(args, 'column');
8897
+ if (this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column') {
8898
+ (args.cell).value = this.getValidHeader(args, 'column');
8899
+ }
8820
8900
  if (args.gridCell !== undefined && args.gridCell.column.width === 'auto') {
8821
8901
  this.parent.lastColumn = args.gridCell.column;
8822
8902
  args.gridCell.column.width = args.gridCell.column.minWidth;
@@ -8825,7 +8905,9 @@ class Render {
8825
8905
  this.parent.trigger(excelHeaderQueryCellInfo, args);
8826
8906
  }
8827
8907
  pdfColumnEvent(args) {
8828
- (args.cell).value = this.getValidHeader(args, 'column');
8908
+ if (this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column') {
8909
+ (args.cell).value = this.getValidHeader(args, 'column');
8910
+ }
8829
8911
  if (args.gridCell !== undefined && args.gridCell.column.width === 'auto') {
8830
8912
  this.parent.lastColumn = args.gridCell.column;
8831
8913
  args.gridCell.column.width = args.gridCell.column.minWidth;
@@ -8866,7 +8948,9 @@ class Render {
8866
8948
  }
8867
8949
  }
8868
8950
  args = this.exportContentEvent(args);
8869
- args.value = args.column.field === '0.formattedText' ? this.getValidHeader(args, 'row') : args.value;
8951
+ if (this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row') {
8952
+ args.value = args.column.field === '0.formattedText' ? this.getValidHeader(args, 'row') : args.value;
8953
+ }
8870
8954
  this.parent.trigger(excelQueryCellInfo, args);
8871
8955
  }
8872
8956
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -8890,7 +8974,9 @@ class Render {
8890
8974
  }
8891
8975
  args.style = { paragraphIndent: level * 10 };
8892
8976
  this.lastSpan = isValueCell ? this.lastSpan : level;
8893
- args.value = this.getValidHeader(args, 'row');
8977
+ if (this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row') {
8978
+ args.value = this.getValidHeader(args, 'row');
8979
+ }
8894
8980
  }
8895
8981
  this.parent.trigger(pdfQueryCellInfo, args);
8896
8982
  }
@@ -10282,7 +10368,6 @@ class FilterDialog {
10282
10368
  if (this.allowExcelLikeFilter) {
10283
10369
  this.dialogPopUp.element.querySelector('.e-dlg-closeicon-btn').focus();
10284
10370
  }
10285
- this.parent.control.pivotButtonModule.memberTreeView = this.parent.filterDialog.memberTreeView;
10286
10371
  this.memberTreeView.nodeChecked =
10287
10372
  this.parent.control.pivotButtonModule.nodeStateModified.bind(this.parent.control.pivotButtonModule);
10288
10373
  this.allMemberSelect.nodeChecked =
@@ -11285,6 +11370,15 @@ class FilterDialog {
11285
11370
  if (this.dropMenu && !this.dropMenu.isDestroyed) {
11286
11371
  this.dropMenu.destroy();
11287
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
+ }
11288
11382
  if (document.getElementById(this.parent.parentID + '_LevelDiv-popup')) {
11289
11383
  remove(document.getElementById(this.parent.parentID + '_LevelDiv-popup'));
11290
11384
  }
@@ -11293,11 +11387,23 @@ class FilterDialog {
11293
11387
  removeFilterDialog() {
11294
11388
  if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
11295
11389
  this.dialogPopUp.destroy();
11390
+ setTimeout(this.setFocus.bind(this));
11296
11391
  }
11297
11392
  if (document.getElementById(this.parent.parentID + '_EditorTreeView')) {
11298
11393
  remove(document.getElementById(this.parent.parentID + '_EditorTreeView'));
11299
11394
  }
11300
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
+ }
11301
11407
  }
11302
11408
 
11303
11409
  /**
@@ -11929,6 +12035,9 @@ __decorate$1([
11929
12035
  __decorate$1([
11930
12036
  Property(true)
11931
12037
  ], DataSourceSettings.prototype, "showGrandTotals", void 0);
12038
+ __decorate$1([
12039
+ Property('Bottom')
12040
+ ], DataSourceSettings.prototype, "grandTotalsPosition", void 0);
11932
12041
  __decorate$1([
11933
12042
  Property(true)
11934
12043
  ], DataSourceSettings.prototype, "showRowGrandTotals", void 0);
@@ -13147,138 +13256,155 @@ class DrillThroughDialog {
13147
13256
  this.clonedData.push(this.frameHeaderWithKeys(eventArgs.rawData[i]));
13148
13257
  }
13149
13258
  let actualText = eventArgs.currentCell.actualText.toString();
13150
- if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
13151
- this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
13152
- this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
13153
- this.editCell(eventArgs);
13154
- }
13155
- else {
13156
- this.removeDrillThroughDialog();
13157
- let drillThroughDialog = createElement('div', {
13158
- id: this.parent.element.id + '_drillthrough',
13159
- className: DRILLTHROUGH_DIALOG
13160
- });
13161
- this.parent.element.appendChild(drillThroughDialog);
13162
- this.dialogPopUp = new Dialog({
13163
- animationSettings: { effect: 'Fade' },
13164
- allowDragging: false,
13165
- header: this.parent.localeObj.getConstant('details'),
13166
- content: this.createDrillThroughGrid(eventArgs),
13167
- beforeOpen: () => {
13168
- this.drillThroughGrid.setProperties({
13169
- dataSource: this.parent.editSettings.allowEditing ?
13170
- this.dataWithPrimarykey(eventArgs) : this.gridData,
13171
- height: !this.parent.editSettings.allowEditing ? 300 : 220
13172
- }, false);
13173
- },
13174
- beforeClose: () => {
13175
- if (this.parent.editSettings.allowEditing && this.isUpdated) {
13176
- if (this.parent.dataSourceSettings.type === 'CSV') {
13177
- this.updateData(this.drillThroughGrid.dataSource);
13178
- }
13179
- let gridIndexObjectsValue = Object.keys(this.gridIndexObjects);
13180
- let previousPosition = [];
13181
- for (let value of gridIndexObjectsValue) {
13182
- previousPosition.push(this.gridIndexObjects[value]);
13183
- }
13184
- let count = Object.keys(this.gridIndexObjects).length;
13185
- let addItems = [];
13186
- let prevItems = [];
13187
- let index = 0;
13188
- /* eslint-disable @typescript-eslint/dot-notation */
13189
- for (let item of this.drillThroughGrid.dataSource) {
13190
- if (isNullOrUndefined(item['__index']) || item['__index'] === '') {
13191
- for (let field of this.engine.fields) {
13192
- if (isNullOrUndefined(item[field])) {
13193
- delete item[field];
13194
- }
13195
- }
13196
- delete item['__index'];
13197
- 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);
13198
13292
  }
13199
- else if (count > 0) {
13200
- delete this.gridIndexObjects[item['__index'].toString()];
13201
- prevItems.push(item);
13202
- count--;
13293
+ let gridIndexObjectsValue = Object.keys(this.gridIndexObjects);
13294
+ let previousPosition = [];
13295
+ for (let value of gridIndexObjectsValue) {
13296
+ previousPosition.push(this.gridIndexObjects[value]);
13203
13297
  }
13204
- if (this.parent.dataSourceSettings.mode === 'Server') {
13205
- 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
+ }
13206
13310
  delete item['__index'];
13311
+ addItems.push(item);
13207
13312
  }
13208
- if (this.gridData[index]['__index']) {
13209
- delete this.gridData[index]['__index'];
13313
+ else if (count > 0) {
13314
+ delete this.gridIndexObjects[item['__index'].toString()];
13315
+ prevItems.push(item);
13316
+ count--;
13210
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++;
13211
13327
  }
13212
- index++;
13213
- }
13214
- count = 0;
13215
- if (this.parent.dataSourceSettings.mode === 'Server') {
13216
- let gridIndex = []; /* eslint-disable-line */
13217
- let keys = Object.keys(this.gridIndexObjects);
13218
- for (let len = 0; len < keys.length; len++) {
13219
- delete this.parent.drillThroughValue.indexObject[this.gridIndexObjects[keys[len]]];
13220
- gridIndex.push({ Key: keys[len], Value: this.gridIndexObjects[keys[len]] }); /* eslint-disable-line */
13221
- }
13222
- let indexObject = []; /* eslint-disable-line */
13223
- keys = Object.keys(this.parent.drillThroughValue.indexObject);
13224
- for (let len = 0; len < keys.length; len++) {
13225
- 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 });
13226
13342
  }
13227
- this.parent.getEngine('updateRawData', null, null, null, null, null, null, null, { 'addedData': addItems, 'removedData': gridIndex, 'updatedData': prevItems, indexObject: indexObject });
13228
- }
13229
- else {
13230
- let items = [];
13231
- let data = (this.parent.allowDataCompression && this.parent.enableVirtualization) ?
13232
- this.parent.engineModule.actualData : this.parent.engineModule.data;
13233
- for (let item of data) {
13234
- delete item['__index'];
13235
- if (this.gridIndexObjects[count.toString()] === undefined) {
13236
- 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;
13237
13367
  }
13238
- count++;
13239
13368
  }
13240
- /* eslint-enable @typescript-eslint/dot-notation */
13241
- items = items.concat(addItems);
13242
- let eventArgs = {
13243
- currentData: this.drillThroughGrid.dataSource,
13244
- previousData: this.clonedData,
13245
- previousPosition: previousPosition,
13246
- 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
+ }
13247
13375
  };
13248
- this.parent.trigger(editCompleted, eventArgs);
13249
- if (!eventArgs.cancel) {
13250
- this.parent.setProperties({ dataSourceSettings: { dataSource: items } }, true);
13251
- this.engine.updateGridData(this.parent.dataSourceSettings);
13252
- this.parent.pivotValues = this.engine.pivotValues;
13253
- }
13376
+ this.parent.actionObj.actionInfo = actionInfo;
13254
13377
  }
13255
- }
13256
- this.isUpdated = false;
13257
- this.gridIndexObjects = {};
13258
- },
13259
- isModal: true,
13260
- visible: true,
13261
- showCloseIcon: true,
13262
- locale: this.parent.locale,
13263
- enableRtl: this.parent.enableRtl,
13264
- width: this.parent.isAdaptive ? '100%' : '60%',
13265
- position: { X: 'center', Y: 'center' },
13266
- closeOnEscape: !this.parent.editSettings.allowEditing,
13267
- target: document.body,
13268
- close: this.removeDrillThroughDialog.bind(this)
13269
- });
13270
- this.dialogPopUp.isStringTemplate = true;
13271
- this.dialogPopUp.appendTo(drillThroughDialog);
13272
- // this.dialogPopUp.element.querySelector('.e-dlg-header').innerHTML = this.parent.localeObj.getConstant('details');
13273
- setStyleAttribute(this.dialogPopUp.element, { 'visibility': 'visible' });
13274
- if (this.parent.editSettings.allowEditing) {
13275
- this.drillthroughKeyboardModule = new KeyboardEvents(this.dialogPopUp.element, {
13276
- keyAction: this.drillthroughKeyActionHandler.bind(this),
13277
- keyConfigs: this.drillKeyConfigs,
13278
- 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)
13279
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
+ }
13280
13403
  }
13281
13404
  }
13405
+ catch (execption) {
13406
+ this.parent.actionFailureMethod(execption);
13407
+ }
13282
13408
  }
13283
13409
  editCell(eventArgs) {
13284
13410
  let gridResize = this.parent.gridSettings.allowResizing;
@@ -13293,6 +13419,10 @@ class DrillThroughDialog {
13293
13419
  if (eventArgs.currentCell.actualText in previousData) {
13294
13420
  currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
13295
13421
  }
13422
+ let actionInfo = {
13423
+ editInfo: { type: 'Inline editing', action: 'update', data: this.gridData }
13424
+ };
13425
+ this.parent.actionObj.actionInfo = actionInfo;
13296
13426
  this.numericTextBox = new NumericTextBox({
13297
13427
  value: cellValue,
13298
13428
  enableRtl: this.parent.enableRtl,
@@ -13357,6 +13487,10 @@ class DrillThroughDialog {
13357
13487
  }
13358
13488
  removeDrillThroughDialog() {
13359
13489
  if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
13490
+ this.parent.actionObj.actionName = drillThroughClosed;
13491
+ if (this.parent.actionObj.actionName) {
13492
+ this.parent.actionCompleteMethod();
13493
+ }
13360
13494
  this.dialogPopUp.destroy();
13361
13495
  }
13362
13496
  let dialogElement = document.getElementById(this.parent.element.id + '_drillthrough');
@@ -13446,31 +13580,53 @@ class DrillThroughDialog {
13446
13580
  }
13447
13581
  if (this.parent.editSettings.allowEditing) {
13448
13582
  Grid.Inject(Edit, Page);
13449
- this.drillThroughGrid.editSettings = this.parent.editSettings;
13450
- if (this.parent.editSettings.allowCommandColumns) {
13451
- this.drillThroughGrid.editSettings.mode = 'Normal';
13452
- this.drillThroughGrid.editSettings.allowEditOnDblClick = false;
13453
- 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
+ }
13454
13611
  this.drillThroughGrid.columns.push({
13455
- headerText: this.parent.localeObj.getConstant('manageRecords'), width: 160, showInColumnChooser: false,
13456
- commands: [
13457
- { type: 'Edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' } },
13458
- { type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' } },
13459
- { type: 'Save', buttonOption: { iconCss: 'e-icons e-update', cssClass: 'e-flat' } },
13460
- { type: 'Cancel', buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' } }
13461
- ]
13612
+ field: '__index', visible: false, isPrimaryKey: true, type: 'string', showInColumnChooser: false
13462
13613
  });
13463
13614
  }
13464
- else {
13465
- this.drillThroughGrid.editSettings.allowEditOnDblClick = this.parent.editSettings.allowEditOnDblClick;
13615
+ catch (execption) {
13616
+ this.parent.actionFailureMethod(execption);
13466
13617
  }
13467
- this.drillThroughGrid.columns.push({
13468
- field: '__index', visible: false, isPrimaryKey: true, type: 'string', showInColumnChooser: false
13469
- });
13470
13618
  this.drillThroughGrid.actionComplete = (args) => {
13471
13619
  if (args.requestType === 'batchsave' || args.requestType === 'save' || args.requestType === 'delete') {
13472
13620
  dialogModule.isUpdated = true;
13473
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
+ }
13474
13630
  if ((dialogModule.drillThroughGrid.editSettings.mode === 'Normal' && args.requestType === 'save' &&
13475
13631
  dialogModule.drillThroughGrid.element.querySelectorAll('.e-tbar-btn:hover').length > 0 &&
13476
13632
  !dialogModule.parent.editSettings.allowCommandColumns) || args.requestType === 'batchsave') {
@@ -13659,7 +13815,7 @@ class DrillThrough {
13659
13815
  * @hidden
13660
13816
  */
13661
13817
  getModuleName() {
13662
- return 'drillthrough';
13818
+ return 'drillThrough';
13663
13819
  }
13664
13820
  addInternalEvents() {
13665
13821
  this.parent.on(contentReady, this.wireEvents, this);
@@ -13863,7 +14019,7 @@ class PivotChart {
13863
14019
  * @private
13864
14020
  */
13865
14021
  getModuleName() {
13866
- return 'pivotchart';
14022
+ return 'pivotChart';
13867
14023
  }
13868
14024
  /* eslint-disable */
13869
14025
  loadChart(parent, chartSettings) {
@@ -14054,7 +14210,9 @@ class PivotChart {
14054
14210
  this.maxLevel = currrentLevel > this.maxLevel ? currrentLevel : this.maxLevel;
14055
14211
  let name = this.parent.dataType === 'olap' ? firstRowCell.formattedText :
14056
14212
  (firstRowCell.actualText ? firstRowCell.actualText.toString() : firstRowCell.formattedText.toString());
14057
- 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;
14058
14216
  let caption = (firstRowCell.hasChild && !firstRowCell.isNamedSet) ?
14059
14217
  ((firstRowCell.isDrilled ? ' - ' : ' + ') + text) : text;
14060
14218
  let levelName = tupInfo ? tupInfo.uNameCollection : firstRowCell.valueSort.levelName.toString();
@@ -14228,7 +14386,9 @@ class PivotChart {
14228
14386
  this.chartSettings.palettes = currentSeries.palettes;
14229
14387
  }
14230
14388
  for (let i = 0; i < this.columnGroupObject[key].length; i++) {
14231
- 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;
14232
14392
  }
14233
14393
  currentSeries.dataSource = this.columnGroupObject[key];
14234
14394
  currentSeries.xName = 'x';
@@ -14384,7 +14544,7 @@ class PivotChart {
14384
14544
  enableSmartLabels: this.chartSettings.enableSmartLabels,
14385
14545
  center: this.chartSettings.pieCenter,
14386
14546
  enableBorderOnMouseMove: this.chartSettings.enableBorderOnMouseMove,
14387
- highLightMode: this.chartSettings.highlightMode,
14547
+ highlightMode: this.chartSettings.highlightMode,
14388
14548
  highlightPattern: this.chartSettings.highlightPattern,
14389
14549
  titleStyle: this.chartSettings.titleStyle,
14390
14550
  subTitle: this.chartSettings.subTitle,
@@ -14512,7 +14672,7 @@ class PivotChart {
14512
14672
  this.parent.chart.highlightPattern = this.parent.chartSettings.highlightPattern;
14513
14673
  if (this.accumulationType.indexOf(type) > -1) {
14514
14674
  this.parent.chart.enableBorderOnMouseMove = this.parent.chartSettings.enableBorderOnMouseMove;
14515
- this.parent.chart.highLightMode = this.parent.chartSettings.highlightMode;
14675
+ this.parent.chart.highlightMode = this.parent.chartSettings.highlightMode;
14516
14676
  this.parent.chart.enableSmartLabels = this.parent.chartSettings.enableSmartLabels;
14517
14677
  }
14518
14678
  else {
@@ -14619,9 +14779,14 @@ class PivotChart {
14619
14779
  currentYAxis.labelFormat = currentYAxis.labelFormat ?
14620
14780
  currentYAxis.labelFormat : (percentChart ? '' : (!resFormat ? format : 'N'));
14621
14781
  currentYAxis.title = currentYAxis.title ? currentYAxis.title : measureAggregatedName;
14622
- currentYAxis.plotOffsetTop = currentYAxis.plotOffsetTop ? currentYAxis.plotOffsetTop :
14623
- this.chartSettings.chartSeries.type === 'Bar' || this.chartSettings.chartSeries.type === 'StackingBar' ||
14624
- 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
+ }
14625
14790
  if (!resFormat) {
14626
14791
  currentYAxis.name = this.measuresNames[item.name] ? this.measuresNames[item.name] : item.name;
14627
14792
  }
@@ -14667,6 +14832,7 @@ class PivotChart {
14667
14832
  currentYAxis = this.persistSettings.primaryYAxis ? this.frameObjectWithKeys(this.persistSettings.primaryYAxis) : currentYAxis;
14668
14833
  currentYAxis.rowIndex = 0;
14669
14834
  currentYAxis.columnIndex = 0;
14835
+ currentYAxis.edgeLabelPlacement = this.chartSettings.primaryYAxis.edgeLabelPlacement ? this.chartSettings.primaryYAxis.edgeLabelPlacement : this.persistSettings.primaryYAxis.edgeLabelPlacement;
14670
14836
  if (!(this.chartSettings.chartSeries.type === 'Polar' || this.chartSettings.chartSeries.type === 'Radar')) {
14671
14837
  currentYAxis.name = this.measuresNames[this.currentMeasure] ? this.measuresNames[this.currentMeasure] : this.currentMeasure;
14672
14838
  }
@@ -14983,6 +15149,7 @@ class PivotChart {
14983
15149
  }
14984
15150
  loaded(args) {
14985
15151
  this.parent.isChartLoaded = true;
15152
+ let width = this.parent.grid ? this.parent.getGridWidthAsNumber().toString() : this.parent.getWidthAsNumber().toString();
14986
15153
  if (this.parent.chart && this.parent.showGroupingBar && this.parent.groupingBarModule &&
14987
15154
  this.parent.showFieldList && this.parent.currentView === 'Chart') {
14988
15155
  this.parent.groupingBarModule.alignIcon();
@@ -14994,13 +15161,15 @@ class PivotChart {
14994
15161
  this.parent.element.querySelector('#' + this.parent.element.id + multilabelAxisName).setAttribute('cursor', 'pointer');
14995
15162
  }
14996
15163
  }
14997
- if ((['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) >= 0)
14998
- && this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
14999
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'visible';
15000
- }
15001
- else if (this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
15002
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'auto';
15003
- 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';
15004
15173
  }
15005
15174
  this.parent.chart.height = ['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) < 0 &&
15006
15175
  this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis &&
@@ -15221,6 +15390,11 @@ class PivotChart {
15221
15390
  offSetHeight = this.parent.getHeightAsNumber() - offSetVal;
15222
15391
  }
15223
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
+ }
15224
15398
  if (this.parent.showToolbar && this.parent.showGroupingBar) {
15225
15399
  height = (offSetHeight - (this.parent.element.querySelector('.e-pivot-toolbar') ?
15226
15400
  this.parent.element.querySelector('.e-pivot-toolbar').clientHeight : 42) -
@@ -15238,6 +15412,9 @@ class PivotChart {
15238
15412
  else if ((this.parent.chart && parseInt(this.parent.chart.height, 10) < 200) || offSetHeight < 200) {
15239
15413
  height = '200';
15240
15414
  }
15415
+ if (isNone) {
15416
+ this.parent.element.querySelector('.e-chart-grouping-bar').style.display = "none";
15417
+ }
15241
15418
  }
15242
15419
  else {
15243
15420
  height = 'auto';
@@ -16838,7 +17015,7 @@ __decorate$3([
16838
17015
  Property(0)
16839
17016
  ], PivotAxis.prototype, "plotOffset", void 0);
16840
17017
  __decorate$3([
16841
- Property('None')
17018
+ Property('Shift')
16842
17019
  ], PivotAxis.prototype, "edgeLabelPlacement", void 0);
16843
17020
  __decorate$3([
16844
17021
  Property('BetweenTicks')
@@ -18133,6 +18310,7 @@ class OlapEngine {
18133
18310
  this.updateTupCollection(customArgs.drillInfo.axis === 'row' ? rowTuples.length : columnTuples.length);
18134
18311
  }
18135
18312
  if (customArgs.action === 'down' ? customArgs.drillInfo.axis === 'column' : true) {
18313
+ this.olapValueAxis = isNullOrUndefined(this.getValueAxis(undefined, undefined)) ? 'column' : 'row';
18136
18314
  this.frameColumnHeader(columnTuples);
18137
18315
  if (!this.isPaging) {
18138
18316
  this.performColumnSorting();
@@ -18187,6 +18365,7 @@ class OlapEngine {
18187
18365
  frameRowHeader(tuples) {
18188
18366
  this.headerGrouping = {};
18189
18367
  this.lastLevel = [];
18368
+ let isGrandTotalAdd = true;
18190
18369
  let position = this.pivotValues.length;
18191
18370
  let pivotValues = [];
18192
18371
  let valueContent = [];
@@ -18247,6 +18426,7 @@ class OlapEngine {
18247
18426
  let startTupPos = tupPos;
18248
18427
  let pagingAllowFlag = true;
18249
18428
  let lastMesPos = 0;
18429
+ let isGrandTotalTop = false;
18250
18430
  while (tupPos < tuplesLength && pagingAllowFlag) {
18251
18431
  let members = tuples[this.customArgs.action === 'down' ?
18252
18432
  (tupPos - (this.customArgs.drillInfo.currentCell.ordinal + 1)) : tupPos].querySelectorAll('Member');
@@ -18301,35 +18481,25 @@ class OlapEngine {
18301
18481
  (allStartPos === (drillStartPos + 1) || this.tupRowInfo[tupPos].measurePosition === (drillStartPos + 1))))
18302
18482
  : drillAllow;
18303
18483
  let withoutAllAllow = (withoutAllStartPos > -1 && allCount > 0) ? (attrDrill || allStartPos > withoutAllEndPos) : true;
18304
- 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) {
18305
18490
  let levelName = 'Grand Total.' + members[measurePos].querySelector('Caption').textContent;
18306
- gTotals.push({
18307
- axis: 'row',
18308
- actualText: this.getUniqueName(members[measurePos].querySelector('UName').textContent),
18309
- colIndex: 0,
18310
- formattedText: (typeColl[measurePos] === '3' &&
18311
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
18312
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption) ?
18313
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption :
18314
- members[measurePos].querySelector('Caption').textContent,
18315
- hasChild: false,
18316
- level: -1,
18317
- rowIndex: position,
18318
- index: [],
18319
- ordinal: tupPos,
18320
- colSpan: 1,
18321
- rowSpan: 1,
18322
- memberType: Number(typeColl[measurePos]),
18323
- isDrilled: false,
18324
- parentUniqueName: members[measurePos].querySelector('PARENT_UNIQUE_NAME') ?
18325
- members[measurePos].querySelector('PARENT_UNIQUE_NAME').textContent : undefined,
18326
- levelUniqueName: members[measurePos].querySelector('LName').textContent,
18327
- hierarchy: members[measurePos].getAttribute('Hierarchy'),
18328
- valueSort: { levelName: levelName, axis: members[measurePos].getAttribute('Hierarchy') }
18329
- });
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') });
18330
18495
  gTotals[gTotals.length - 1].valueSort['Grand Total.' + members[measurePos].querySelector('Caption').textContent] = 1;
18331
18496
  }
18332
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
+ }
18333
18503
  prevTupInfo = this.tupRowInfo[tupPos];
18334
18504
  let lastPos = position;
18335
18505
  let lastMemPos = memPos;
@@ -18420,6 +18590,11 @@ class OlapEngine {
18420
18590
  }
18421
18591
  tupPos++;
18422
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) {
18423
18598
  if (gTotals.length > 1 && gTotals[0].memberType !== 3) {
18424
18599
  gTotals[0].ordinal = -1;
18425
18600
  }
@@ -18445,6 +18620,41 @@ class OlapEngine {
18445
18620
  this.updateRowEngine(pivotValues, valueContent, tuples.length);
18446
18621
  this.onDemandDrillEngine = pivotValues;
18447
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;
18448
18658
  }
18449
18659
  getDepth(tupInfo, uniqueName, memberType) {
18450
18660
  let memberPosition = tupInfo.uNameCollection.indexOf(uniqueName);
@@ -18684,6 +18894,53 @@ class OlapEngine {
18684
18894
  currTupCount--;
18685
18895
  }
18686
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
+ }
18687
18944
  frameColumnHeader(tuples) {
18688
18945
  this.headerGrouping = {};
18689
18946
  this.lastLevel = [];
@@ -18747,8 +19004,18 @@ class OlapEngine {
18747
19004
  withoutAllAvail = true;
18748
19005
  isStartCol = (allCount > 0 && isStartCol) ? (allStartPos > withoutAllStartPos) : isStartCol;
18749
19006
  }
18750
- if (isStartCol) {
18751
- 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) {
18752
19019
  let levelComp = [-1, -1, -1];
18753
19020
  if (this.tupColumnInfo[tupPos - 1] && this.tupColumnInfo[tupPos - 1].allCount === 0) {
18754
19021
  levelComp = this.levelCompare(levelColl, this.tupColumnInfo[tupPos - 1].levelCollection);
@@ -18785,8 +19052,10 @@ class OlapEngine {
18785
19052
  }
18786
19053
  this.setParentCollection(members);
18787
19054
  if (withoutAllAvail ? (withoutAllEndPos <= drillStartPos) : true) {
18788
- this.totalCollection[this.totalCollection.length] =
18789
- ({ 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
+ }
18790
19059
  lastSavedInfo.allCount = allCount;
18791
19060
  lastSavedInfo.allStartPos = allStartPos;
18792
19061
  lastSavedInfo.drillStartPos = drillStartPos;
@@ -18811,10 +19080,12 @@ class OlapEngine {
18811
19080
  }
18812
19081
  this.setParentCollection(members);
18813
19082
  if ((withoutAllAvail && drillStartPos > -1) ? (withoutAllEndPos <= drillStartPos) : true) {
18814
- this.totalCollection[this.totalCollection.length] =
18815
- ({
18816
- allCount: allCount, ordinal: tupPos, members: members, allStartPos: allStartPos, drillInfo: drillInfo
18817
- });
19083
+ if (!isGrandTotalTop) {
19084
+ this.totalCollection[this.totalCollection.length] =
19085
+ ({
19086
+ allCount: allCount, ordinal: tupPos, members: members, allStartPos: allStartPos, drillInfo: drillInfo
19087
+ });
19088
+ }
18818
19089
  lastSavedInfo.allCount = allCount;
18819
19090
  lastSavedInfo.allStartPos = allStartPos;
18820
19091
  lastSavedInfo.drillStartPos = drillStartPos;
@@ -19307,19 +19578,26 @@ class OlapEngine {
19307
19578
  }
19308
19579
  let newPos = 0;
19309
19580
  let totPos = 0;
19581
+ let valuePos = 0;
19310
19582
  gSumFlag = false;
19311
19583
  gSumGrouping = this.sortRowHeaders(gSumGrouping);
19312
19584
  for (let rPos = this.colDepth; rPos < rowCount; rPos++) {
19313
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
+ }
19314
19591
  let cell = gSumFlag ? gSumGrouping : sortLvlGrouping[levels[0]]['parent'];
19315
19592
  /* eslint-enable @typescript-eslint/dot-notation */
19316
- 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;
19317
19594
  if (cell[currPos]) {
19318
19595
  this.pivotValues[rPos] = [cell[currPos]];
19319
19596
  this.pivotValues[rPos][0].rowIndex = rPos;
19320
- this.valueContent[newPos][0] = this.pivotValues[rPos][0];
19597
+ this.valueContent[valuePos][0] = this.pivotValues[rPos][0];
19321
19598
  }
19322
19599
  newPos++;
19600
+ valuePos++;
19323
19601
  if (this.pivotValues[rPos][0].type === 'grand sum') {
19324
19602
  gSumFlag = true;
19325
19603
  totPos = newPos;
@@ -21561,6 +21839,8 @@ let PivotView = class PivotView extends Component {
21561
21839
  this.request = new XMLHttpRequest();
21562
21840
  /** @hidden */
21563
21841
  this.isServerWaitingPopup = false;
21842
+ /** @hidden */
21843
+ this.actionObj = {};
21564
21844
  this.pivotView = this;
21565
21845
  setValue('mergePersistData', this.mergePersistPivotData, this);
21566
21846
  }
@@ -21602,10 +21882,10 @@ let PivotView = class PivotView extends Component {
21602
21882
  modules.push({ args: [this], member: 'grouping' });
21603
21883
  }
21604
21884
  if (this.allowDrillThrough || (this.editSettings && this.editSettings.allowEditing)) {
21605
- modules.push({ args: [this], member: 'drillthrough' });
21885
+ modules.push({ args: [this], member: 'drillThrough' });
21606
21886
  }
21607
21887
  if (this.displayOption.view !== 'Table') {
21608
- modules.push({ args: [this], member: 'pivotchart' });
21888
+ modules.push({ args: [this], member: 'pivotChart' });
21609
21889
  }
21610
21890
  return modules;
21611
21891
  }
@@ -22184,7 +22464,7 @@ let PivotView = class PivotView extends Component {
22184
22464
  this.setProperties({ gridSettings: { allowSelection: true, selectionSettings: { cellSelectionMode: 'Box', mode: 'Cell', type: 'Multiple' } } }, true);
22185
22465
  }
22186
22466
  if (this.displayOption.view !== 'Table') {
22187
- this.chartModule = new PivotChart();
22467
+ this.pivotChartModule = new PivotChart();
22188
22468
  }
22189
22469
  this.currentView = this.currentView ? this.currentView : (this.displayOption.view === 'Both' ?
22190
22470
  this.displayOption.primary : this.displayOption.view);
@@ -22449,32 +22729,37 @@ let PivotView = class PivotView extends Component {
22449
22729
  }
22450
22730
  }
22451
22731
  initialLoad() {
22452
- this.cellTemplateFn = this.templateParser(this.cellTemplate);
22453
- this.tooltipTemplateFn = this.templateParser(this.tooltipTemplate);
22454
- if (this.spinnerTemplate) {
22455
- createSpinner({ target: this.element, template: this.spinnerTemplate }, this.createElement);
22456
- }
22457
- else {
22458
- createSpinner({ target: this.element }, this.createElement);
22459
- }
22460
- let loadArgs = {
22461
- dataSourceSettings: this.dataSourceSettings,
22462
- pivotview: this,
22463
- fieldsType: {}
22464
- };
22465
- this.trigger(load, loadArgs, (observedArgs) => {
22466
- this.dataSourceSettings = observedArgs.dataSourceSettings;
22467
- this.fieldsType = observedArgs.fieldsType;
22468
- this.updateClass();
22469
- this.notify(initSubComponent, {});
22470
- if (this.dataSourceSettings.mode !== 'Server') {
22471
- 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);
22472
22737
  }
22473
- if (this.isAdaptive) {
22474
- this.contextMenuModule.render();
22738
+ else {
22739
+ createSpinner({ target: this.element }, this.createElement);
22475
22740
  }
22476
- this.notify(initToolbar, {});
22477
- });
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
+ }
22478
22763
  }
22479
22764
  /**
22480
22765
  * Register the internal events.
@@ -22505,12 +22790,32 @@ let PivotView = class PivotView extends Component {
22505
22790
  /* eslint-disable */
22506
22791
  let columnRender = this.gridSettings['columnRender'];
22507
22792
  let chartLoadEvent = this.chartSettings['load'];
22793
+ let chartLoadedEvent = this.chartSettings['loaded'];
22794
+ let chartTextRenderEvent = this.chartSettings['textRender'];
22795
+ let chartPointRenderEvent = this.chartSettings['pointRender'];
22796
+ let chartSeriesRenderEvent = this.chartSettings['seriesRender'];
22797
+ let chartLegendRenderEvent = this.chartSettings['legendRender'];
22798
+ let chartPointClickEvent = this.chartSettings['pointClick'];
22799
+ let chartTooltipRenderEvent = this.chartSettings['tooltipRender'];
22508
22800
  this.gridSettings['columnRender'] = undefined;
22509
22801
  this.chartSettings['tooltipRender'] = undefined;
22510
22802
  this.chartSettings['load'] = undefined;
22803
+ this.chartSettings['loaded'] = undefined;
22804
+ this.chartSettings['textRender'] = undefined;
22805
+ this.chartSettings['pointRender'] = undefined;
22806
+ this.chartSettings['seriesRender'] = undefined;
22807
+ this.chartSettings['legendRender'] = undefined;
22808
+ this.chartSettings['pointClick'] = undefined;
22511
22809
  let persistData = this.addOnPersist(keyEntity);
22512
22810
  this.gridSettings['columnRender'] = columnRender;
22513
22811
  this.chartSettings['load'] = chartLoadEvent;
22812
+ this.chartSettings['loaded'] = chartLoadedEvent;
22813
+ this.chartSettings['textRender'] = chartTextRenderEvent;
22814
+ this.chartSettings['pointRender'] = chartPointRenderEvent;
22815
+ this.chartSettings['seriesRender'] = chartSeriesRenderEvent;
22816
+ this.chartSettings['legendRender'] = chartLegendRenderEvent;
22817
+ this.chartSettings['pointClick'] = chartPointClickEvent;
22818
+ this.chartSettings['tooltipRender'] = chartTooltipRenderEvent;
22514
22819
  /* eslint-enable */
22515
22820
  return persistData;
22516
22821
  }
@@ -22692,15 +22997,15 @@ let PivotView = class PivotView extends Component {
22692
22997
  if (!this.grid && newProp.displayOption.view !== 'Chart') {
22693
22998
  this.renderEmptyGrid();
22694
22999
  if (newProp.displayOption.view === 'Table') {
22695
- if (this.chartModule) {
22696
- this.chartModule.destroy();
23000
+ if (this.pivotChartModule) {
23001
+ this.pivotChartModule.destroy();
22697
23002
  this.chart = undefined;
22698
- this.chartModule = undefined;
23003
+ this.pivotChartModule = undefined;
22699
23004
  }
22700
23005
  }
22701
23006
  }
22702
- else if (!this.chartModule && this.displayOption.view !== 'Table') {
22703
- this.chartModule = new PivotChart();
23007
+ else if (!this.pivotChartModule && this.displayOption.view !== 'Table') {
23008
+ this.pivotChartModule = new PivotChart();
22704
23009
  }
22705
23010
  }
22706
23011
  else if (this.showToolbar && !isNullOrUndefined(newProp.displayOption) && newProp.displayOption.view) {
@@ -22730,12 +23035,12 @@ let PivotView = class PivotView extends Component {
22730
23035
  (newProp.chartSettings.chartSeries && Object.keys(newProp.chartSettings.chartSeries).indexOf('type') !== -1))) {
22731
23036
  this.groupingBarModule.renderLayout();
22732
23037
  }
22733
- if (isNullOrUndefined(this.chartModule) && this.displayOption.view !== 'Table') {
22734
- this.chartModule = new PivotChart();
23038
+ if (isNullOrUndefined(this.pivotChartModule) && this.displayOption.view !== 'Table') {
23039
+ this.pivotChartModule = new PivotChart();
22735
23040
  }
22736
23041
  let engineModule = this.dataType === 'pivot' ? this.engineModule : this.olapEngineModule;
22737
- if (!isNullOrUndefined(this.chartModule) && !isNullOrUndefined(engineModule.pivotValues)) {
22738
- this.chartModule.loadChart(this, this.chartSettings);
23042
+ if (!isNullOrUndefined(this.pivotChartModule) && !isNullOrUndefined(engineModule.pivotValues)) {
23043
+ this.pivotChartModule.loadChart(this, this.chartSettings);
22739
23044
  }
22740
23045
  if (!isNullOrUndefined(engineModule.pivotValues) && !isNullOrUndefined(engineModule.fieldList)) {
22741
23046
  this.notify(uiUpdate, this);
@@ -22762,6 +23067,9 @@ let PivotView = class PivotView extends Component {
22762
23067
  if (this.element.querySelector('.e-grouping-bar')) {
22763
23068
  this.element.querySelector('.e-grouping-bar').remove();
22764
23069
  }
23070
+ else if (this.groupingBarModule) {
23071
+ this.groupingBarModule.renderLayout();
23072
+ }
22765
23073
  if (isNullOrUndefined(newProp.showFieldList))
22766
23074
  this.renderPivotGrid();
22767
23075
  break;
@@ -22855,9 +23163,9 @@ let PivotView = class PivotView extends Component {
22855
23163
  */
22856
23164
  renderPivotGrid() {
22857
23165
  this.clearTemplate();
22858
- if (this.chartModule) {
22859
- this.chartModule.engineModule = this.engineModule;
22860
- this.chartModule.loadChart(this, this.chartSettings);
23166
+ if (this.pivotChartModule) {
23167
+ this.pivotChartModule.engineModule = this.engineModule;
23168
+ this.pivotChartModule.loadChart(this, this.chartSettings);
22861
23169
  if (this.enableRtl && this.chart && document.body.getAttribute('dir') !== 'rtl') {
22862
23170
  addClass([this.chart.element], PIVOTCHART_LTR);
22863
23171
  }
@@ -22887,8 +23195,8 @@ let PivotView = class PivotView extends Component {
22887
23195
  true : this.hyperlinkSettings.showHyperlink ? true : false);
22888
23196
  this.applyHyperlinkSettings();
22889
23197
  }
22890
- this.renderModule = new Render(this);
22891
- this.renderModule.render();
23198
+ this.renderModule = this.renderModule ? this.renderModule : new Render(this);
23199
+ this.renderModule.render(true);
22892
23200
  }
22893
23201
  else if (this.grid) {
22894
23202
  remove(this.grid.element);
@@ -22904,7 +23212,9 @@ let PivotView = class PivotView extends Component {
22904
23212
  if (this.toolbarModule && this.toolbarModule.toolbar) {
22905
23213
  this.toolbarModule.toolbar.width = this.getGridWidthAsNumber() - 2;
22906
23214
  }
22907
- 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
+ }
22908
23218
  this.chart.width = formatUnit(this.getGridWidthAsNumber());
22909
23219
  if (this.currentView === 'Table') {
22910
23220
  this.grid.element.style.display = '';
@@ -22924,7 +23234,13 @@ let PivotView = class PivotView extends Component {
22924
23234
  }
22925
23235
  if (this.toolbarModule) {
22926
23236
  if (this.showFieldList && select('#' + this.element.id + '_PivotFieldList', this.element)) {
22927
- 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
+ }
22928
23244
  }
22929
23245
  if (this.toolbar && this.toolbar.indexOf('FieldList') !== -1 &&
22930
23246
  this.showToolbar && this.element.querySelector('.e-toggle-field-list')) {
@@ -23075,7 +23391,9 @@ let PivotView = class PivotView extends Component {
23075
23391
  isDrillThrough: (pivot.allowDrillThrough || pivot.editSettings.allowEditing),
23076
23392
  localeObj: pivot.localeObj,
23077
23393
  fieldsType: pivot.fieldsType,
23078
- clonedReport: pivot.clonedReport
23394
+ clonedReport: pivot.clonedReport,
23395
+ globalize: pivot.globalize,
23396
+ currenyCode: pivot.currencyCode
23079
23397
  };
23080
23398
  /* eslint-enable @typescript-eslint/indent */
23081
23399
  if (pivot.dataSourceSettings.mode === 'Server') {
@@ -23125,6 +23443,14 @@ let PivotView = class PivotView extends Component {
23125
23443
  this.exportType = 'Excel';
23126
23444
  this.grid.excelExport(excelExportProperties, isMultipleExport, workbook, isBlob);
23127
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
+ }
23128
23454
  }
23129
23455
  /**
23130
23456
  * Export PivotGrid data to CSV file.
@@ -23142,6 +23468,14 @@ let PivotView = class PivotView extends Component {
23142
23468
  this.exportType = 'CSV';
23143
23469
  this.grid.csvExport(excelExportProperties, isMultipleExport, workbook, isBlob);
23144
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
+ }
23145
23479
  }
23146
23480
  /**
23147
23481
  * Export Pivot widget data to PDF document.
@@ -23158,6 +23492,14 @@ let PivotView = class PivotView extends Component {
23158
23492
  else {
23159
23493
  this.grid.pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
23160
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
+ }
23161
23503
  }
23162
23504
  /**
23163
23505
  * Export method for the chart.
@@ -23172,6 +23514,14 @@ let PivotView = class PivotView extends Component {
23172
23514
  if (this.chart && this.chart.enableExport) {
23173
23515
  this.chart.exportModule.export(type, fileName, orientation, null, width, height);
23174
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
+ }
23175
23525
  }
23176
23526
  /**
23177
23527
  * Print method for the chart.
@@ -23282,6 +23632,10 @@ let PivotView = class PivotView extends Component {
23282
23632
  };
23283
23633
  this.trigger(enginePopulated, eventArgs);
23284
23634
  pivot.engineModule.pivotValues = eventArgs.pivotValues;
23635
+ let actionInfo = {
23636
+ drillInfo: drilledItem
23637
+ };
23638
+ this.actionObj.actionInfo = actionInfo;
23285
23639
  pivot.renderPivotGrid();
23286
23640
  }
23287
23641
  else {
@@ -23629,6 +23983,12 @@ let PivotView = class PivotView extends Component {
23629
23983
  this.unwireEvents();
23630
23984
  this.wireEvents();
23631
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
+ }
23632
23992
  }
23633
23993
  setToolTip(args) {
23634
23994
  let colIndex = Number(args.target.getAttribute('aria-colindex'));
@@ -23660,6 +24020,13 @@ let PivotView = class PivotView extends Component {
23660
24020
  if (cell && this.engineModule.fieldList[cell.actualText]) {
23661
24021
  let field = this.engineModule.fieldList[cell.actualText];
23662
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
+ }
23663
24030
  caption = field.caption;
23664
24031
  hasField = true;
23665
24032
  }
@@ -23879,75 +24246,104 @@ let PivotView = class PivotView extends Component {
23879
24246
  ele = target.parentElement.parentElement;
23880
24247
  }
23881
24248
  this.CellClicked(target, e);
23882
- if ((ele.parentElement.parentElement.parentElement.parentElement.classList.contains('e-movableheader')
23883
- && this.dataSourceSettings.valueAxis === 'column') || (ele.parentElement.classList.contains('e-row') &&
23884
- this.dataSourceSettings.valueAxis === 'row') && (ele.classList.contains('e-rowsheader') ||
23885
- ele.classList.contains('e-stot'))) {
23886
- let colIndex = Number(ele.getAttribute('aria-colindex'));
23887
- let rowIndex = Number(ele.getAttribute('index'));
23888
- if (this.dataSourceSettings.valueAxis === 'row' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
23889
- let header = this.pivotValues[rowIndex][colIndex];
23890
- if (this.dataSourceSettings.valueIndex === -1) {
23891
- rowIndex = header.type === 'value' ? rowIndex : (rowIndex + 1);
23892
- }
23893
- else {
23894
- let level = this.getLevel(header);
23895
- rowIndex = (level <= this.engineModule.measureIndex &&
23896
- 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;
23897
24260
  }
23898
- }
23899
- else if (this.dataSourceSettings.valueAxis === 'column' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
23900
- colIndex = (Number(ele.getAttribute('aria-colindex')) + Number(ele.getAttribute('aria-colspan')) - 1);
23901
- rowIndex = this.engineModule.headerContent.length - 1;
23902
- }
23903
- this.setProperties({
23904
- dataSourceSettings: {
23905
- valueSortSettings: {
23906
- columnIndex: (Number(ele.getAttribute('aria-colindex')) +
23907
- Number(ele.getAttribute('aria-colspan')) - 1),
23908
- sortOrder: this.dataSourceSettings.valueSortSettings.sortOrder === 'Descending' ? 'Ascending' : 'Descending',
23909
- headerText: this.pivotValues[rowIndex][colIndex].valueSort.levelName,
23910
- headerDelimiter: this.dataSourceSettings.valueSortSettings.headerDelimiter ?
23911
- 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);
23912
24267
  }
23913
- }
23914
- }, true);
23915
- this.showWaitingPopup();
23916
- let pivot = this; /* eslint-disable-line */
23917
- pivot.engineModule.enableValueSorting = true;
23918
- if (pivot.enableVirtualization) {
23919
- if (pivot.dataSourceSettings.enableSorting) {
23920
- for (let key of Object.keys(pivot.engineModule.fieldList)) {
23921
- 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();
23922
24308
  }
23923
- pivot.setProperties({ dataSourceSettings: { sortSettings: [] } }, true);
23924
24309
  }
23925
- if (pivot.dataSourceSettings.mode === 'Server') {
24310
+ else if (pivot.dataSourceSettings.mode === 'Server') {
23926
24311
  pivot.getEngine('onValueSort', null, null, null, null, null, null);
23927
24312
  }
23928
24313
  else {
23929
- pivot.engineModule.rMembers = pivot.engineModule.headerCollection.rowHeaders;
23930
- pivot.engineModule.cMembers = pivot.engineModule.headerCollection.columnHeaders;
23931
- pivot.engineModule.applyValueSorting();
23932
- pivot.engineModule.updateEngine();
24314
+ pivot.engineModule.generateGridData(pivot.dataSourceSettings, true);
23933
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();
23934
24326
  }
23935
- else if (pivot.dataSourceSettings.mode === 'Server') {
23936
- pivot.getEngine('onValueSort', null, null, null, null, null, null);
23937
- }
23938
- else {
23939
- pivot.engineModule.generateGridData(pivot.dataSourceSettings, true);
23940
- }
23941
- pivot.allowServerDataBinding = false;
23942
- pivot.setProperties({ pivotValues: pivot.engineModule.pivotValues }, true);
23943
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
23944
- delete pivot.bulkChanges.pivotValues;
23945
- pivot.allowServerDataBinding = true;
23946
- pivot.renderPivotGrid();
24327
+ }
24328
+ catch (execption) {
24329
+ this.actionFailureMethod(execption);
23947
24330
  }
23948
24331
  }
23949
24332
  else if (target.classList.contains(COLLAPSE) || target.classList.contains(EXPAND)) {
23950
- 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
+ }
23951
24347
  }
23952
24348
  else {
23953
24349
  this.CellClicked(target, e);
@@ -24045,7 +24441,8 @@ let PivotView = class PivotView extends Component {
24045
24441
  let firstColWidth = this.pivotColumns[0].width;
24046
24442
  let eventArgs = {
24047
24443
  columns: this.pivotColumns,
24048
- dataSourceSettings: this.dataSourceSettings
24444
+ dataSourceSettings: this.dataSourceSettings,
24445
+ stackedColumns: this.getStackedColumns(gridcolumns, [])
24049
24446
  };
24050
24447
  this.trigger(beforeColumnsRender, eventArgs);
24051
24448
  if (this.enableVirtualization && eventArgs.columns.length > 0 && eventArgs.columns[0].width !== gridcolumns[0].width) {
@@ -24149,8 +24546,16 @@ let PivotView = class PivotView extends Component {
24149
24546
  /* eslint-disable-next-line */
24150
24547
  /** @hidden */
24151
24548
  onWindowResize() {
24549
+ this.actionObj.actionName = windowResize;
24550
+ if (this.actionBeginMethod()) {
24551
+ return;
24552
+ }
24152
24553
  clearTimeout(this.timeOutObj);
24153
24554
  this.timeOutObj = setTimeout(this.layoutRefresh.bind(this), 500);
24555
+ this.actionObj.actionName = this.getActionCompleteName();
24556
+ if (this.actionObj.actionName) {
24557
+ this.actionCompleteMethod();
24558
+ }
24154
24559
  }
24155
24560
  /**
24156
24561
  * Refreshes the Pivot Table for blazor layoutRefresh is called for other base refresh is called.
@@ -24470,7 +24875,7 @@ let PivotView = class PivotView extends Component {
24470
24875
  this.isEmptyGrid = true;
24471
24876
  this.notEmpty = false;
24472
24877
  this.isInitial = true;
24473
- this.renderModule = new Render(this);
24878
+ this.renderModule = this.renderModule ? this.renderModule : new Render(this);
24474
24879
  if (this.grid && this.grid.element && this.element.querySelector('.e-grid')) {
24475
24880
  this.notEmpty = true;
24476
24881
  this.grid.setProperties({
@@ -24534,7 +24939,9 @@ let PivotView = class PivotView extends Component {
24534
24939
  isDrillThrough: (this.allowDrillThrough || this.editSettings.allowEditing),
24535
24940
  localeObj: this.localeObj,
24536
24941
  fieldsType: this.fieldsType,
24537
- clonedReport: this.clonedReport
24942
+ clonedReport: this.clonedReport,
24943
+ globalize: this.globalize,
24944
+ currenyCode: this.currencyCode
24538
24945
  };
24539
24946
  if (this.dataType === 'pivot') {
24540
24947
  if (this.dataSourceSettings.groupSettings && this.dataSourceSettings.groupSettings.length > 0) {
@@ -24760,7 +25167,8 @@ let PivotView = class PivotView extends Component {
24760
25167
  let str = 'color: ' + format[k].style.color + '!important;background-color: ' + format[k].style.backgroundColor +
24761
25168
  '!important;font-size: ' + format[k].style.fontSize + '!important;font-family: ' + format[k].style.fontFamily +
24762
25169
  ' !important;';
24763
- 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);
24764
25172
  }
24765
25173
  }
24766
25174
  }
@@ -24986,6 +25394,64 @@ let PivotView = class PivotView extends Component {
24986
25394
  EventHandler.remove(document, this.isAdaptive ? 'touchend' : 'click', this.removeButtonFocus);
24987
25395
  window.removeEventListener('resize', this.onWindowResize.bind(this), true);
24988
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
+ }
24989
25455
  /**
24990
25456
  * To destroy the PivotView elements.
24991
25457
  * @returns {void}
@@ -25049,8 +25515,8 @@ let PivotView = class PivotView extends Component {
25049
25515
  if (this.commonModule) {
25050
25516
  this.commonModule.destroy();
25051
25517
  }
25052
- if (this.chartModule) {
25053
- this.chartModule.destroy();
25518
+ if (this.pivotChartModule) {
25519
+ this.pivotChartModule.destroy();
25054
25520
  }
25055
25521
  if (this.pivotButtonModule && !this.pivotButtonModule.isDestroyed) {
25056
25522
  this.pivotButtonModule.destroy();
@@ -25105,8 +25571,8 @@ let PivotView = class PivotView extends Component {
25105
25571
  if (this.commonModule) {
25106
25572
  this.commonModule = null;
25107
25573
  }
25108
- if (this.chartModule) {
25109
- this.chartModule = null;
25574
+ if (this.pivotChartModule) {
25575
+ this.pivotChartModule = null;
25110
25576
  }
25111
25577
  if (this.pivotButtonModule) {
25112
25578
  this.pivotButtonModule = null;
@@ -25126,6 +25592,12 @@ let PivotView = class PivotView extends Component {
25126
25592
  if (this.drillThroughModule) {
25127
25593
  this.drillThroughModule = null;
25128
25594
  }
25595
+ if (this.clonedDataSet) {
25596
+ this.clonedDataSet = null;
25597
+ }
25598
+ if (this.clonedReport) {
25599
+ this.clonedReport = null;
25600
+ }
25129
25601
  this.element.innerHTML = '';
25130
25602
  removeClass([this.element], ROOT);
25131
25603
  removeClass([this.element], RTL);
@@ -25469,6 +25941,15 @@ __decorate([
25469
25941
  __decorate([
25470
25942
  Event()
25471
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);
25472
25953
  PivotView = __decorate([
25473
25954
  NotifyPropertyChanges
25474
25955
  ], PivotView);
@@ -25481,6 +25962,247 @@ PivotView = __decorate([
25481
25962
  * Renderer Export
25482
25963
  */
25483
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
+
25484
26206
  /**
25485
26207
  * @hidden
25486
26208
  * `ExcelExport` module is used to handle the Excel export action.
@@ -25548,7 +26270,7 @@ class ExcelExport$1 {
25548
26270
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
25549
26271
  /** Event trigerring */
25550
26272
  let clonedValues;
25551
- let currentPivotValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26273
+ let currentPivotValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
25552
26274
  let customFileName = isFileNameSet ? exportProperties.fileName : 'default.xlsx';
25553
26275
  if (isHeaderSet) {
25554
26276
  this.addHeaderAndFooter(exportProperties.header, '', 'header', exportProperties.header.headerRows);
@@ -25558,7 +26280,7 @@ class ExcelExport$1 {
25558
26280
  this.engine.pageSettings = null;
25559
26281
  this.engine.generateGridData(this.parent.dataSourceSettings, true);
25560
26282
  this.parent.applyFormatting(this.engine.pivotValues);
25561
- clonedValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26283
+ clonedValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
25562
26284
  this.engine.pivotValues = currentPivotValues;
25563
26285
  this.engine.pageSettings = pageSettings;
25564
26286
  }
@@ -25602,15 +26324,17 @@ class ExcelExport$1 {
25602
26324
  let pivotCell = pivotValues[rCnt][cCnt];
25603
26325
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
25604
26326
  let cellValue = pivotCell.axis === 'value' ? pivotCell.value : pivotCell.formattedText;
25605
- if (pivotCell.type === 'grand sum') {
25606
- cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'grandTotal') :
25607
- 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');
25608
26331
  }
25609
26332
  else if (pivotCell.type === 'sum') {
25610
26333
  cellValue = cellValue.toString().replace('Total', this.parent.localeObj.getConstant('total'));
25611
26334
  }
25612
26335
  else {
25613
- 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;
25614
26338
  }
25615
26339
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
25616
26340
  cells.push({
@@ -26122,13 +26846,13 @@ class PDFExport {
26122
26846
  applyEvent() {
26123
26847
  /** Event trigerring */
26124
26848
  let clonedValues;
26125
- let currentPivotValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26849
+ let currentPivotValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
26126
26850
  if (this.parent.exportAllPages && this.parent.enableVirtualization && this.parent.dataType !== 'olap') {
26127
26851
  let pageSettings = this.engine.pageSettings;
26128
26852
  this.engine.pageSettings = null;
26129
26853
  this.engine.generateGridData(this.parent.dataSourceSettings, true);
26130
26854
  this.parent.applyFormatting(this.engine.pivotValues);
26131
- clonedValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26855
+ clonedValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
26132
26856
  this.engine.pivotValues = currentPivotValues;
26133
26857
  this.engine.pageSettings = pageSettings;
26134
26858
  }
@@ -26617,31 +27341,50 @@ class DialogRenderer {
26617
27341
  return axisWrapper;
26618
27342
  }
26619
27343
  showCalculatedField(event) {
26620
- if (!this.parent.isAdaptive) {
26621
- if (this.parent.dialogRenderer.fieldListDialog) {
26622
- this.parent.dialogRenderer.fieldListDialog.hide();
26623
- 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
+ }
26624
27354
  }
27355
+ this.parent.notify(initCalculatedField, {});
27356
+ }
27357
+ catch (execption) {
27358
+ this.parent.actionFailureMethod(execption);
26625
27359
  }
26626
- this.parent.notify(initCalculatedField, {});
26627
27360
  }
26628
27361
  showFieldListDialog(event) {
26629
27362
  let activeindex = this.adaptiveElement.selectedItem;
26630
27363
  this.parent.treeViewModule.render(activeindex);
26631
27364
  }
26632
27365
  onShowFieldList() {
26633
- if (this.parent.allowDeferLayoutUpdate) {
26634
- if (this.parent.isAdaptive) {
26635
- 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);
26636
27378
  }
26637
- this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
26638
- 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);
26639
27387
  }
26640
- addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
26641
- this.parent.dialogRenderer.fieldListDialog.show();
26642
- this.parent.dialogRenderer.fieldListDialog.element.style.top =
26643
- parseInt(this.parent.dialogRenderer.fieldListDialog.element.style.top, 10) < 0 ?
26644
- '0px' : this.parent.dialogRenderer.fieldListDialog.element.style.top;
26645
27388
  }
26646
27389
  onCloseFieldList() {
26647
27390
  if (this.parent.allowDeferLayoutUpdate) {
@@ -26669,6 +27412,10 @@ class DialogRenderer {
26669
27412
  }
26670
27413
  }
26671
27414
  this.parent.dialogRenderer.fieldListDialog.hide();
27415
+ this.parent.actionObj.actionName = closeFieldlist;
27416
+ if (this.parent.actionObj.actionName) {
27417
+ this.parent.actionCompleteMethod();
27418
+ }
26672
27419
  }
26673
27420
  removeFieldListIcon() {
26674
27421
  if (this.parent.isAdaptive && this.parent.allowCalculatedField && this.parent.calculatedFieldModule) {
@@ -27544,28 +28291,41 @@ class TreeViewRenderer {
27544
28291
  updateSorting(args) {
27545
28292
  let target = args.target;
27546
28293
  let option = target.getAttribute('data-sort');
27547
- if (target.className.indexOf('e-selected') === -1) {
27548
- switch (option) {
27549
- case 'None':
27550
- this.fieldListSort = 'None';
27551
- addClass([target], 'e-selected');
27552
- removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
27553
- removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
27554
- break;
27555
- case 'Ascend':
27556
- this.fieldListSort = 'Ascend';
27557
- addClass([target], 'e-selected');
27558
- removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
27559
- removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
27560
- break;
27561
- case 'Descend':
27562
- this.fieldListSort = 'Descend';
27563
- addClass([target], 'e-selected');
27564
- removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
27565
- removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
27566
- 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();
27567
28321
  }
27568
- 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();
27569
28329
  }
27570
28330
  }
27571
28331
  /* eslint-disable */
@@ -27927,7 +28687,7 @@ class PivotButton {
27927
28687
  attrs: { 'tabindex': '-1', 'aria-disabled': 'false', 'title': this.parent.localeObj.getConstant('editCalculatedField') },
27928
28688
  className: ICON + ' ' + CALC_EDIT
27929
28689
  });
27930
- 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)) {
27931
28691
  removeClass([calcElement], ICON_DISABLE);
27932
28692
  }
27933
28693
  else {
@@ -27940,7 +28700,7 @@ class PivotButton {
27940
28700
  className: ICON + ' ' + REMOVE_CLASS
27941
28701
  });
27942
28702
  if (this.parent.getModuleName() === 'pivotview') {
27943
- if ((this.parent.groupingBarSettings.showRemoveIcon && field[i].showRemoveIcon)) {
28703
+ if ((this.parent.groupingBarSettings.showRemoveIcon && (field[i].showRemoveIcon || field[i].showRemoveIcon === undefined))) {
27944
28704
  removeClass([removeElement], ICON_DISABLE);
27945
28705
  }
27946
28706
  else {
@@ -27948,7 +28708,7 @@ class PivotButton {
27948
28708
  }
27949
28709
  }
27950
28710
  else {
27951
- if (field[i].showRemoveIcon) {
28711
+ if (field[i].showRemoveIcon || field[i].showRemoveIcon === undefined) {
27952
28712
  removeClass([removeElement], ICON_DISABLE);
27953
28713
  }
27954
28714
  else {
@@ -27980,13 +28740,13 @@ class PivotButton {
27980
28740
  }
27981
28741
  if (axis === 'values') {
27982
28742
  for (let element of this.parentElement.querySelectorAll('.e-group-' + axis)) {
27983
- if (element.classList.contains(GROUP_CHART_VALUE) && this.parent.chartModule) {
28743
+ if (element.classList.contains(GROUP_CHART_VALUE) && this.parent.pivotChartModule) {
27984
28744
  let valueData = field.map((item) => { return { text: item.caption ? item.caption : item.name, value: item.name }; });
27985
28745
  let parent = this.parent;
27986
28746
  if (this.valueFiedDropDownList && element.querySelector('.' + GROUP_CHART_VALUE_DROPDOWN_DIV)) {
27987
28747
  this.valueFiedDropDownList.dataSource = valueData;
27988
28748
  this.valueFiedDropDownList.value = !parent.chartSettings.enableMultipleAxis ?
27989
- parent.chartModule.currentMeasure : valueData[0].value;
28749
+ parent.pivotChartModule.currentMeasure : valueData[0].value;
27990
28750
  }
27991
28751
  else {
27992
28752
  let ddlDiv = createElement('div', { className: GROUP_CHART_VALUE_DROPDOWN_DIV });
@@ -27996,7 +28756,7 @@ class PivotButton {
27996
28756
  enableRtl: this.parent.enableRtl,
27997
28757
  locale: this.parent.locale,
27998
28758
  value: !parent.chartSettings.enableMultipleAxis ?
27999
- parent.chartModule.currentMeasure : valueData[0].value,
28759
+ parent.pivotChartModule.currentMeasure : valueData[0].value,
28000
28760
  width: 200,
28001
28761
  fields: { value: 'value', text: 'text' },
28002
28762
  cssClass: GROUP_CHART_VALUE_DROPDOWN,
@@ -28015,14 +28775,14 @@ class PivotButton {
28015
28775
  else if (axis === 'columns') {
28016
28776
  let availColindex = undefined;
28017
28777
  for (let element of this.parentElement.querySelectorAll('.e-group-' + axis)) {
28018
- if (element.classList.contains(GROUP_CHART_COLUMN) && this.parent.chartModule) {
28019
- let currentMeasure = this.parent.chartModule.currentMeasure;
28778
+ if (element.classList.contains(GROUP_CHART_COLUMN) && this.parent.pivotChartModule) {
28779
+ let currentMeasure = this.parent.pivotChartModule.currentMeasure;
28020
28780
  let delimiter = this.parent.chartSettings.columnDelimiter ? this.parent.chartSettings.columnDelimiter : '-';
28021
28781
  let columnHeader = (this.parent.chartSettings.columnHeader && this.parent.chartSettings.columnHeader !== '') ?
28022
28782
  this.parent.chartSettings.columnHeader.split(delimiter).join(' - ') : '';
28023
28783
  let engineModule = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
28024
28784
  let pivotValues = engineModule.pivotValues;
28025
- let totColIndex = this.parent.chartModule.getColumnTotalIndex(pivotValues);
28785
+ let totColIndex = this.parent.pivotChartModule.getColumnTotalIndex(pivotValues);
28026
28786
  let rKeys = Object.keys(pivotValues);
28027
28787
  let columnData = [];
28028
28788
  let firstValueRow = false;
@@ -28132,7 +28892,7 @@ class PivotButton {
28132
28892
  },
28133
28893
  className: PIVOT_BUTTON_CONTENT_CLASS + ' ' +
28134
28894
  (this.parent.getModuleName() === 'pivotview' ?
28135
- 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 : ''),
28136
28896
  innerHTML: axis === 'filters' ? (this.parent.dataType === 'olap' && engineModule.fieldList[field[i].name].type === 'CalculatedField') ?
28137
28897
  text : (text + ' (' + filterMem + ')') : (this.parent.dataType === 'olap' ?
28138
28898
  text : (!this.parent.dataSourceSettings.showAggregationOnValueField || axis !== 'values' || aggregation === 'CalculatedField' ?
@@ -28198,43 +28958,54 @@ class PivotButton {
28198
28958
  }
28199
28959
  openCalculatedFieldDialog(args) {
28200
28960
  let fieldName = args.target.parentElement.id;
28201
- if (this.parent.getModuleName() === 'pivotview') {
28202
- if (this.parent.isAdaptive && (this.parent.showFieldList &&
28203
- this.parent.pivotFieldListModule &&
28204
- !this.parent.pivotFieldListModule.isDestroyed)) {
28205
- this.parent.pivotFieldListModule.element
28206
- .querySelector('.' + TOGGLE_FIELD_LIST_CLASS).click();
28207
- this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4);
28208
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28209
- this.parent.pivotFieldListModule.calculatedFieldModule
28210
- .updateAdaptiveCalculatedField(true, fieldName);
28211
- }
28212
- else {
28213
- if (!this.parent.isAdaptive) {
28214
- this.parent.calculatedFieldModule.buttonCall = true;
28215
- }
28216
- this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28217
- }
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;
28218
28966
  }
28219
- else if (this.parent.getModuleName() === 'pivotfieldlist') {
28220
- if (this.parent.isAdaptive) {
28221
- this.parent.dialogRenderer.adaptiveElement.select(4);
28222
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28223
- this.parent.calculatedFieldModule
28224
- .updateAdaptiveCalculatedField(true, fieldName);
28225
- this.parent.calculatedFieldModule.buttonCall = true;
28226
- }
28227
- else {
28228
- if (this.parent.dialogRenderer.fieldListDialog) {
28229
- this.parent.dialogRenderer.fieldListDialog.hide();
28230
- 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);
28231
28978
  }
28232
- this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28233
- 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);
28234
28992
  this.parent.calculatedFieldModule.buttonCall = true;
28235
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
+ }
28236
29004
  }
28237
29005
  }
29006
+ catch (execption) {
29007
+ this.parent.actionFailureMethod(execption);
29008
+ }
28238
29009
  }
28239
29010
  createDraggable(field, target) {
28240
29011
  this.draggable = new Draggable(target, {
@@ -28258,7 +29029,7 @@ class PivotButton {
28258
29029
  attrs: {
28259
29030
  'tabindex': '-1', 'aria-disabled': 'false', 'title': this.parent.localeObj.getConstant('drag')
28260
29031
  },
28261
- className: ICON + ' ' + DRAG_CLASS + ' ' + (field.allowDragAndDrop ? '' : DRAG_DISABLE_CLASS)
29032
+ className: ICON + ' ' + DRAG_CLASS + ' ' + ((field.allowDragAndDrop || field.allowDragAndDrop === undefined) ? '' : DRAG_DISABLE_CLASS)
28262
29033
  });
28263
29034
  dragWrapper.appendChild(dragElement);
28264
29035
  if (this.parent.getModuleName() === 'pivotfieldlist') {
@@ -28619,39 +29390,53 @@ class PivotButton {
28619
29390
  !(args.target.classList.contains(DRAG_CLASS)) &&
28620
29391
  (buttonElement && fieldInfo.fieldItem && (fieldInfo.fieldItem.showSortIcon ||
28621
29392
  isNullOrUndefined(fieldInfo.fieldItem.showSortIcon)))) {
28622
- if ((this.parent instanceof PivotFieldList || this.parent.groupingBarSettings.showSortIcon) &&
28623
- this.parent.dataSourceSettings.enableSorting &&
28624
- !(this.parent.dataType === 'olap' && ((this.parent.getModuleName() === 'pivotfieldlist' &&
28625
- this.parent.pivotGridModule !== undefined &&
28626
- this.parent.pivotGridModule.enableVirtualization) ||
28627
- (this.parent.getModuleName() === 'pivotview' && this.parent.enableVirtualization)))) {
28628
- if (((this.parent.getModuleName() === 'pivotview' && this.parent.enableValueSorting) ||
28629
- (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule !== undefined &&
28630
- this.parent.pivotGridModule.enableValueSorting))) {
28631
- if (this.parent.enableValueSorting || this.parent.pivotGridModule.enableValueSorting) { /* eslint-disable-line */
28632
- if (args.target.classList.contains('e-pivot-button')) {
28633
- if (args.target.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
28634
- 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
+ }
28635
29413
  }
28636
- }
28637
- else {
28638
- if (args.target.parentElement.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
28639
- 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
+ }
28640
29418
  }
28641
29419
  }
28642
29420
  }
28643
- }
28644
- this.parent.pivotCommon.eventBase.updateSorting(args);
28645
- if (!this.parent.allowDeferLayoutUpdate || this.parent.getModuleName() !== 'pivotfieldlist') {
28646
- this.updateDataSource(true);
28647
- }
28648
- /* eslint-disable */
28649
- let thisObj = this;
28650
- /* eslint-enable */
28651
- if (thisObj.parent instanceof PivotFieldList) {
28652
- thisObj.axisField.render();
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
+ }
28653
29435
  }
28654
29436
  }
29437
+ catch (execption) {
29438
+ this.parent.actionFailureMethod(execption);
29439
+ }
28655
29440
  }
28656
29441
  }
28657
29442
  /* eslint-disable-next-line */
@@ -28682,26 +29467,37 @@ class PivotButton {
28682
29467
  updateFiltering(args) {
28683
29468
  /* eslint-disable */
28684
29469
  let pivotObj = this.parent.pivotGridModule ? this.parent.pivotGridModule : this.parent;
28685
- if (pivotObj.getModuleName() === 'pivotfieldlist') {
28686
- showSpinner(pivotObj.fieldListSpinnerElement);
28687
- }
28688
- else {
28689
- pivotObj.showWaitingPopup();
28690
- }
28691
- pivotObj.mouseEventArgs = args;
28692
- pivotObj.filterTargetID = this.parent.pivotCommon.moduleName !== 'pivotfieldlist' ?
28693
- this.parent.element : document.getElementById(this.parent.pivotCommon.parentID + '_Wrapper');
28694
29470
  let fieldName = args.target.parentElement.id;
28695
- if (pivotObj.dataSourceSettings.mode === 'Server') {
28696
- if (this.parent.engineModule.fieldList[fieldName].members && Object.keys(this.parent.engineModule.fieldList[fieldName].members).length > 0) {
28697
- 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);
29480
+ }
29481
+ else {
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
+ }
28698
29494
  }
28699
29495
  else {
28700
- pivotObj.getEngine('fetchFieldMembers', null, null, null, null, null, fieldName);
29496
+ this.updateFilterEvents();
28701
29497
  }
28702
29498
  }
28703
- else {
28704
- this.updateFilterEvents();
29499
+ catch (execption) {
29500
+ this.parent.actionFailureMethod(execption);
28705
29501
  }
28706
29502
  /* eslint-enable */
28707
29503
  }
@@ -28714,11 +29510,6 @@ class PivotButton {
28714
29510
  let target = pivotObj.mouseEventArgs.target;
28715
29511
  this.fieldName = target.parentElement.id;
28716
29512
  if (this.parent.pivotCommon.filterDialog.dialogPopUp) {
28717
- this.dialogPopUp = this.parent.pivotCommon.filterDialog.dialogPopUp;
28718
- this.parent.pivotCommon.filterDialog.dialogPopUp.close = this.removeFilterDialog.bind(this);
28719
- // this.memberTreeView = this.parent.pivotCommon.filterDialog.memberTreeView;
28720
- // this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
28721
- // this.parent.pivotCommon.filterDialog.allMemberSelect.nodeChecked = this.nodeStateModified.bind(this);
28722
29513
  this.bindDialogEvents();
28723
29514
  }
28724
29515
  if (pivotObj.getModuleName() === 'pivotfieldlist') {
@@ -28732,8 +29523,8 @@ class PivotButton {
28732
29523
  if (this.parent.pivotCommon.filterDialog.allowExcelLikeFilter && this.parent.pivotCommon.filterDialog.tabObj) {
28733
29524
  this.index = this.parent.pivotCommon.filterDialog.tabObj.selectedItem;
28734
29525
  this.updateDialogButtonEvents();
28735
- this.dialogPopUp.buttons = this.buttonModel();
28736
- this.dialogPopUp.dataBind();
29526
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons = this.buttonModel();
29527
+ this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind();
28737
29528
  this.parent.pivotCommon.filterDialog.tabObj.selected = this.tabSelect.bind(this);
28738
29529
  }
28739
29530
  else if (this.parent.dataSourceSettings.allowMemberFilter) {
@@ -28758,7 +29549,7 @@ class PivotButton {
28758
29549
  click: (this.index === 0 ? this.updateFilterState.bind(this, this.fieldName) : this.updateCustomFilter.bind(this))
28759
29550
  },
28760
29551
  {
28761
- click: this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this),
29552
+ click: this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this.parent.pivotCommon.filterDialog),
28762
29553
  buttonModel: { cssClass: CANCEL_BUTTON_CLASS, content: this.parent.localeObj.getConstant('cancel') }
28763
29554
  }
28764
29555
  ];
@@ -28766,24 +29557,24 @@ class PivotButton {
28766
29557
  tabSelect(e) {
28767
29558
  this.index = e.selectedIndex;
28768
29559
  this.updateDialogButtonEvents();
28769
- 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');
28770
29561
  if (e.selectedIndex > 0) {
28771
- 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');
28772
29563
  }
28773
29564
  if (e.selectedIndex === 0) {
28774
29565
  this.parent.pivotCommon.filterDialog.updateCheckedState();
28775
29566
  }
28776
29567
  else {
28777
- this.dialogPopUp.buttons[0].buttonModel.disabled = false;
28778
- 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');
28779
29570
  }
28780
29571
  }
28781
29572
  updateDialogButtonEvents() {
28782
- this.dialogPopUp.buttons = this.buttonModel();
28783
- this.dialogPopUp.dataBind();
29573
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons = this.buttonModel();
29574
+ this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind();
28784
29575
  }
28785
29576
  updateCustomFilter(args) {
28786
- let dialogElement = this.dialogPopUp.element.querySelector('.e-selected-tab');
29577
+ let dialogElement = this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector('.e-selected-tab');
28787
29578
  let fieldName = dialogElement.getAttribute('data-fieldname');
28788
29579
  let levelName = dialogElement.getAttribute('data-selectedField');
28789
29580
  let filterType = dialogElement.getAttribute('data-type');
@@ -28853,38 +29644,18 @@ class PivotButton {
28853
29644
  if (type !== 'Value') {
28854
29645
  this.parent.lastFilterInfo = PivotUtil.getFilterItemByName(fieldName, this.parent.dataSourceSettings.filterSettings);
28855
29646
  }
28856
- this.dialogPopUp.close();
29647
+ this.parent.pivotCommon.filterDialog.dialogPopUp.close();
28857
29648
  if (!observedArgs.cancel) {
28858
29649
  this.refreshPivotButtonState(fieldName, true);
28859
29650
  this.updateDataSource(true);
28860
29651
  }
28861
29652
  });
28862
29653
  }
28863
- removeFilterDialog() {
28864
- if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
28865
- this.dialogPopUp.destroy();
28866
- setTimeout(this.setFocus.bind(this));
28867
- }
28868
- if (document.getElementById(this.parentElement.id + '_EditorTreeView')) {
28869
- remove(document.getElementById(this.parentElement.id + '_EditorTreeView'));
28870
- }
28871
- }
28872
- setFocus() {
28873
- if (this.parentElement) {
28874
- let pivotButtons = [].slice.call(this.parentElement.querySelectorAll('.e-pivot-button'));
28875
- for (let item of pivotButtons) {
28876
- if (item.getAttribute('data-uid') === this.fieldName) {
28877
- item.focus();
28878
- break;
28879
- }
28880
- }
28881
- }
28882
- }
28883
29654
  ClearFilter(e) {
28884
- let dialogElement = this.dialogPopUp.element;
29655
+ let dialogElement = this.parent.pivotCommon.filterDialog.dialogPopUp.element;
28885
29656
  let fieldName = dialogElement.getAttribute('data-fieldname');
28886
29657
  let tabElement = dialogElement.querySelector('.e-selected-tab');
28887
- this.dialogPopUp.close();
29658
+ this.parent.pivotCommon.filterDialog.dialogPopUp.close();
28888
29659
  if (this.parent.dataType === 'olap' && tabElement) {
28889
29660
  let levelName = tabElement.getAttribute('data-selectedField');
28890
29661
  this.removeDataSourceSettings(fieldName, levelName);
@@ -28900,63 +29671,73 @@ class PivotButton {
28900
29671
  let target = args.target;
28901
29672
  let fieldName = target.parentElement.id;
28902
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
+ }
28903
29679
  let removeFieldArgs = {
28904
29680
  cancel: false, fieldName: fieldName,
28905
29681
  dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.parent.dataSourceSettings),
28906
29682
  fieldItem: fieldInfo.fieldItem, axis: fieldInfo.axis
28907
29683
  };
28908
- let control = this.parent.getModuleName() === 'pivotfieldlist' &&
28909
- this.parent.isPopupView ? this.parent.pivotGridModule : this.parent;
28910
- control.trigger(fieldRemove, removeFieldArgs, (observedArgs) => {
28911
- if (!observedArgs.cancel) {
28912
- if (target.parentElement.getAttribute('isvalue') === 'true') {
28913
- this.parent.setProperties({ dataSourceSettings: { values: [] } }, true);
28914
- if (this.parent.dataType === 'olap') {
28915
- 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
+ }
28916
29694
  }
28917
- }
28918
- else {
28919
- this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(fieldName);
28920
- if (this.parent.dataType === 'pivot' && this.parent.showValuesButton && this.parent.dataSourceSettings.values.length > 1 &&
28921
- fieldInfo.position < this.parent.dataSourceSettings.valueIndex && ((this.parent.dataSourceSettings.valueAxis === 'row' &&
28922
- observedArgs.axis === 'rows') || (this.parent.dataSourceSettings.valueAxis === 'column' && observedArgs.axis === 'columns'))) {
28923
- 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
+ }
28924
29705
  }
28925
- if (this.parent.dataType === 'olap' && this.parent.dataSourceSettings.values.length === 0) {
28926
- this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
29706
+ if (this.parent.getModuleName() === 'pivotfieldlist') {
29707
+ this.parent.axisFieldModule.render();
28927
29708
  }
29709
+ this.updateDataSource();
28928
29710
  }
28929
- if (this.parent.getModuleName() === 'pivotfieldlist') {
28930
- this.parent.axisFieldModule.render();
28931
- }
28932
- this.updateDataSource();
28933
- }
28934
- });
29711
+ });
29712
+ }
29713
+ catch (execption) {
29714
+ this.parent.actionFailureMethod(execption);
29715
+ }
28935
29716
  }
28936
29717
  /** @hidden */
28937
29718
  nodeStateModified(args) {
28938
29719
  let target = closest(args.node, 'li');
28939
29720
  let fieldName = target.getAttribute('data-fieldname');
28940
29721
  if (target.getAttribute('data-memberId') === 'all') {
28941
- this.memberTreeView.nodeChecked = null;
29722
+ this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = null;
28942
29723
  if (args.action === 'check') {
28943
- this.memberTreeView.checkAll();
29724
+ this.parent.pivotCommon.filterDialog.memberTreeView.checkAll();
28944
29725
  }
28945
29726
  else {
28946
- this.memberTreeView.uncheckAll();
29727
+ this.parent.pivotCommon.filterDialog.memberTreeView.uncheckAll();
28947
29728
  }
28948
29729
  if (this.parent.dataType === 'olap' && this.parent.olapEngineModule &&
28949
29730
  !this.parent.olapEngineModule.fieldList[fieldName].isHierarchy) {
28950
- this.updateNodeStates(this.memberTreeView.getAllCheckedNodes(), fieldName, args.action);
29731
+ this.updateNodeStates(this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(), fieldName, args.action);
28951
29732
  }
28952
29733
  this.checkedStateAll(args.action);
28953
- this.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
29734
+ this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
28954
29735
  }
28955
29736
  else {
28956
29737
  if (this.parent.dataType === 'olap' && this.parent.olapEngineModule &&
28957
29738
  !this.parent.olapEngineModule.fieldList[fieldName].isHierarchy) {
28958
29739
  // let st1: number = new Date().getTime();
28959
- let checkedNodes = this.memberTreeView.getAllCheckedNodes();
29740
+ let checkedNodes = this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes();
28960
29741
  // let st2: number = (new Date().getTime() - st1) / 1000;
28961
29742
  // console.log('getAllCheckedNodes:' + st2);
28962
29743
  this.updateNodeStates(checkedNodes, fieldName, args.action);
@@ -28996,8 +29777,8 @@ class PivotButton {
28996
29777
  }
28997
29778
  if (currentMembers[member]) {
28998
29779
  currentMembers[member].isSelected = false;
28999
- if (this.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]')) {
29000
- 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 + '"]');
29001
29782
  if (element && !element.querySelector('ul')) {
29002
29783
  this.parent.pivotCommon.eventBase.updateChildNodeStates(fieldList.filterMembers, fieldName, member, false);
29003
29784
  }
@@ -29006,8 +29787,8 @@ class PivotButton {
29006
29787
  }
29007
29788
  for (let node of checkedNodes) {
29008
29789
  if (currentMembers[node]) {
29009
- if (this.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]')) {
29010
- 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 + '"]');
29011
29792
  if (element && !element.querySelector('ul')) {
29012
29793
  currentMembers[node].isSelected = true;
29013
29794
  this.parent.pivotCommon.eventBase.updateChildNodeStates(fieldList.filterMembers, fieldName, node, true);
@@ -29042,10 +29823,10 @@ class PivotButton {
29042
29823
  !engineModule.fieldList[fieldName].isHierarchy) {
29043
29824
  let cMembers = engineModule.fieldList[fieldName].members;
29044
29825
  let sMembers = engineModule.fieldList[fieldName].currrentMembers;
29045
- filterItem.items = this.memberTreeView.getAllCheckedNodes();
29826
+ filterItem.items = this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes();
29046
29827
  filterItem.levelCount = engineModule.fieldList[fieldName].levelCount;
29047
29828
  isNodeUnChecked = (filterItem.items.length ===
29048
- this.memberTreeView.fields.dataSource.length ? false : true);
29829
+ this.parent.pivotCommon.filterDialog.memberTreeView.fields.dataSource.length ? false : true);
29049
29830
  if (engineModule.fieldList[fieldName].searchMembers.length > 0 && !isNodeUnChecked) {
29050
29831
  let cNodeLength = Object.keys(cMembers).length;
29051
29832
  let sNodeLength = Object.keys(sMembers).length;
@@ -29106,13 +29887,17 @@ class PivotButton {
29106
29887
  }
29107
29888
  this.parent.dataSourceSettings.filterSettings.push(filterItem);
29108
29889
  }
29109
- this.dialogPopUp.close();
29890
+ this.parent.pivotCommon.filterDialog.dialogPopUp.close();
29110
29891
  if (!observedArgs.cancel) {
29111
29892
  this.refreshPivotButtonState(fieldName, isNodeUnChecked);
29112
29893
  if (!isNodeUnChecked) {
29113
29894
  this.removeDataSourceSettings(fieldName);
29114
29895
  }
29115
29896
  this.parent.lastFilterInfo = filterItem;
29897
+ let actionInfo = {
29898
+ filterInfo: this.parent.lastFilterInfo
29899
+ };
29900
+ this.parent.actionObj.actionInfo = actionInfo;
29116
29901
  this.updateDataSource(true);
29117
29902
  let thisObj = this;
29118
29903
  //setTimeout(() => {
@@ -29266,14 +30051,6 @@ class PivotButton {
29266
30051
  this.columnFieldDropDownList.destroy();
29267
30052
  this.columnFieldDropDownList = null;
29268
30053
  }
29269
- if (this.memberTreeView && !this.memberTreeView.isDestroyed) {
29270
- this.memberTreeView.destroy();
29271
- this.memberTreeView = null;
29272
- }
29273
- if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
29274
- this.dialogPopUp.destroy();
29275
- this.dialogPopUp = null;
29276
- }
29277
30054
  if (this.draggable && !this.draggable.isDestroyed) {
29278
30055
  this.draggable.destroy();
29279
30056
  this.draggable = null;
@@ -29413,6 +30190,8 @@ let PivotFieldList = class PivotFieldList extends Component {
29413
30190
  this.enableValueSorting = false;
29414
30191
  this.request = new XMLHttpRequest();
29415
30192
  this.remoteData = [];
30193
+ /** @hidden */
30194
+ this.actionObj = {};
29416
30195
  }
29417
30196
  /**
29418
30197
  * To provide the array of modules needed for control rendering
@@ -29643,7 +30422,9 @@ let PivotFieldList = class PivotFieldList extends Component {
29643
30422
  enableValueSorting: enableValueSorting,
29644
30423
  isDrillThrough: isDrillThrough,
29645
30424
  localeObj: localeObj,
29646
- clonedReport: this.clonedReport
30425
+ clonedReport: this.clonedReport,
30426
+ globalize: this.globalize,
30427
+ currenyCode: this.currencyCode
29647
30428
  };
29648
30429
  }
29649
30430
  return customProperties;
@@ -30328,6 +31109,11 @@ let PivotFieldList = class PivotFieldList extends Component {
30328
31109
  pivot.pivotGridModule.fieldListSpinnerElement = pivot.fieldListSpinnerElement;
30329
31110
  }
30330
31111
  });
31112
+ let actionName = this.getActionCompleteName();
31113
+ this.actionObj.actionName = actionName;
31114
+ if (this.actionObj.actionName) {
31115
+ this.actionCompleteMethod();
31116
+ }
30331
31117
  }
30332
31118
  updateOlapDataSource(pivot, isSorted, isCalcChange, isOlapDataRefreshed) {
30333
31119
  let customProperties = pivot.frameCustomProperties(pivot.olapEngineModule.fieldListData, pivot.olapEngineModule.fieldList);
@@ -30361,6 +31147,7 @@ let PivotFieldList = class PivotFieldList extends Component {
30361
31147
  update(control) {
30362
31148
  if (control) {
30363
31149
  this.clonedDataSet = control.clonedDataSet;
31150
+ this.clonedReport = control.clonedReport;
30364
31151
  this.setProperties({ dataSourceSettings: control.dataSourceSettings, showValuesButton: control.showValuesButton }, true);
30365
31152
  this.engineModule = control.engineModule;
30366
31153
  this.olapEngineModule = control.olapEngineModule;
@@ -30395,6 +31182,7 @@ let PivotFieldList = class PivotFieldList extends Component {
30395
31182
  updateView(control) {
30396
31183
  if (control) {
30397
31184
  control.clonedDataSet = this.clonedDataSet;
31185
+ control.clonedReport = this.clonedReport;
30398
31186
  control.setProperties({ dataSourceSettings: this.dataSourceSettings, showValuesButton: this.showValuesButton }, true);
30399
31187
  control.engineModule = this.engineModule;
30400
31188
  control.olapEngineModule = this.olapEngineModule;
@@ -30437,6 +31225,47 @@ let PivotFieldList = class PivotFieldList extends Component {
30437
31225
  }
30438
31226
  });
30439
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
+ }
30440
31269
  /**
30441
31270
  * Destroys the Field Table component.
30442
31271
  * @function destroy
@@ -30511,6 +31340,9 @@ let PivotFieldList = class PivotFieldList extends Component {
30511
31340
  if (this.clonedDataSet) {
30512
31341
  this.clonedDataSet = null;
30513
31342
  }
31343
+ if (this.clonedReport) {
31344
+ this.clonedReport = null;
31345
+ }
30514
31346
  if (this.clonedFieldList) {
30515
31347
  this.clonedFieldList = null;
30516
31348
  }
@@ -30559,6 +31391,9 @@ __decorate$4([
30559
31391
  __decorate$4([
30560
31392
  Property(['Sum', 'Count', 'DistinctCount', 'Product', 'Min', 'Max', 'Avg', 'Median', 'Index', 'PopulationVar', 'SampleVar', 'PopulationStDev', 'SampleStDev', 'RunningTotals', 'PercentageOfGrandTotal', 'PercentageOfColumnTotal', 'PercentageOfRowTotal', 'PercentageOfParentColumnTotal', 'PercentageOfParentRowTotal', 'DifferenceFrom', 'PercentageOfDifferenceFrom', 'PercentageOfParentTotal'])
30561
31393
  ], PivotFieldList.prototype, "aggregateTypes", void 0);
31394
+ __decorate$4([
31395
+ Property('USD')
31396
+ ], PivotFieldList.prototype, "currencyCode", void 0);
30562
31397
  __decorate$4([
30563
31398
  Event()
30564
31399
  ], PivotFieldList.prototype, "load", void 0);
@@ -30607,6 +31442,15 @@ __decorate$4([
30607
31442
  __decorate$4([
30608
31443
  Event()
30609
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);
30610
31454
  PivotFieldList = __decorate$4([
30611
31455
  NotifyPropertyChanges
30612
31456
  ], PivotFieldList);
@@ -30839,105 +31683,114 @@ class CalculatedField {
30839
31683
  displayMenu(node, treeNode, target) {
30840
31684
  let edit = target ? target.classList.contains(CALC_EDIT) : true;
30841
31685
  let edited = target ? target.classList.contains(CALC_EDITED) : true;
30842
- if (this.parent.dataType === 'pivot' && node.querySelector('.e-list-icon.e-format') &&
30843
- node.querySelector('.e-list-icon.e-format').classList.contains(ICON) &&
30844
- !node.querySelector('.e-list-icon').classList.contains(CALC_EDITED) &&
30845
- !node.querySelector('.e-list-icon').classList.contains(GRID_REMOVE) &&
30846
- !node.querySelector('.e-list-icon').classList.contains(CALC_EDIT) && node.tagName === 'LI') {
30847
- if (this.menuObj && !this.menuObj.isDestroyed) {
30848
- this.menuObj.destroy();
30849
- }
30850
- this.curMenu = node.querySelector('.' + LIST_TEXT_CLASS);
30851
- this.openContextMenu(node);
30852
- }
30853
- else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDIT) &&
30854
- node.querySelector('.' + CALC_EDIT).classList.contains('e-list-icon') && edit ||
30855
- (this.parent.dataType === 'olap' && node.getAttribute('data-type') === CALC && node.classList.contains('e-active') && ((target && !target.classList.contains(GRID_REMOVE)) || !target)))) {
30856
- this.isEdit = true;
30857
- let fieldName = node.getAttribute('data-field');
30858
- let caption = node.getAttribute('data-caption');
30859
- this.currentFieldName = fieldName;
30860
- this.inputObj.value = caption;
30861
- this.inputObj.dataBind();
30862
- let formatString = node.getAttribute('data-formatString');
30863
- let dialogElement = this.dialog.element;
30864
- let customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
30865
- if (this.parent.dataType === 'olap') {
30866
- let memberType = node.getAttribute('data-membertype');
30867
- let parentHierarchy = node.getAttribute('data-hierarchy');
30868
- let expression = node.getAttribute('data-formula');
30869
- let customString = node.getAttribute('data-customString');
30870
- let fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
30871
- let memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
30872
- let hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
30873
- let formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
30874
- /* eslint-enable max-len */
30875
- fieldTitle.innerHTML = this.parent.localeObj.getConstant('caption');
30876
- select('#' + this.parentID + 'droppable', document).value = expression;
30877
- memberTypeDrop.readonly = true;
30878
- memberTypeDrop.value = memberType;
30879
- memberTypeDrop.dataBind();
30880
- if (memberType === 'Dimension') {
30881
- 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');
30882
31742
  }
30883
- if (formatString !== '') {
30884
- 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;
30885
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'));
30886
31774
  }
30887
- customFormat.value = customString;
31775
+ select('#' + this.parentID + 'droppable', document).value = '';
30888
31776
  }
30889
- else {
30890
- customFormat.value = formatString;
30891
- addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
30892
- removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
30893
- addClass([node.querySelector('.e-list-icon')], CALC_EDITED);
30894
- removeClass([node.querySelector('.e-list-icon')], CALC_EDIT);
30895
- node.querySelector('.' + CALC_EDITED).setAttribute('title', this.parent.localeObj.getConstant('clearCalculatedField'));
30896
- 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);
30897
31790
  }
30898
- customFormat.dataBind();
30899
31791
  }
30900
- else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDITED) &&
30901
- node.querySelector('.' + CALC_EDITED).classList.contains('e-list-icon') && edited ||
30902
- (this.parent.dataType === 'olap' && !node.classList.contains('e-active')))) {
30903
- this.isEdit = false;
30904
- this.inputObj.value = '';
30905
- this.inputObj.dataBind();
30906
- let dialogElement = this.dialog.element;
30907
- let customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
30908
- customFormat.value = '';
30909
- customFormat.dataBind();
30910
- if (this.parent.dataType === 'olap') {
30911
- let hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
30912
- let formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
30913
- let memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
30914
- let fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
30915
- /* eslint-enable max-len */
30916
- fieldTitle.innerHTML = this.parent.localeObj.getConstant('fieldTitle');
30917
- hierarchyDrop.index = 0;
30918
- hierarchyDrop.dataBind();
30919
- formatDrop.index = 0;
30920
- formatDrop.dataBind();
30921
- memberTypeDrop.index = 0;
30922
- memberTypeDrop.readonly = false;
30923
- memberTypeDrop.dataBind();
30924
- }
30925
- else {
30926
- addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
30927
- removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
30928
- node.querySelector('.' + CALC_EDIT).setAttribute('title', this.parent.localeObj.getConstant('edit'));
30929
- }
30930
- select('#' + this.parentID + 'droppable', document).value = '';
30931
- }
30932
- else if (node.tagName === 'LI' && (node.querySelector('.' + GRID_REMOVE) &&
30933
- node.querySelector('.' + GRID_REMOVE).classList.contains('e-list-icon')) && !edit && !edited) {
30934
- let dropField = select('#' + this.parentID + 'droppable', document);
30935
- let field = {
30936
- name: this.isEdit ? this.currentFieldName : this.inputObj.value,
30937
- caption: this.inputObj.value,
30938
- formula: dropField.value
30939
- };
30940
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeCalculatedField'), field, true, treeNode);
31792
+ catch (execption) {
31793
+ this.parent.actionFailureMethod(execption);
30941
31794
  }
30942
31795
  }
30943
31796
  removeCalcField(node) {
@@ -31346,6 +32199,12 @@ class CalculatedField {
31346
32199
  this.parent.isRequiredUpdate = false;
31347
32200
  }
31348
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;
31349
32208
  this.parent.updateDataSource(false);
31350
32209
  let pivot = (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule) ?
31351
32210
  this.parent.pivotGridModule : this.parent;
@@ -32787,7 +33646,7 @@ class FieldList {
32787
33646
  update() {
32788
33647
  let currentWidth;
32789
33648
  if (this.parent.currentView !== 'Table') {
32790
- currentWidth = this.parent.chart ? this.parent.chartModule.getCalulatedWidth() : currentWidth;
33649
+ currentWidth = this.parent.chart ? this.parent.pivotChartModule.getCalulatedWidth() : currentWidth;
32791
33650
  }
32792
33651
  else {
32793
33652
  currentWidth = this.parent.grid ? this.parent.grid.element.offsetWidth : currentWidth;
@@ -33256,7 +34115,7 @@ class GroupingBar {
33256
34115
  currentWidth = this.parent.grid ? this.parent.grid.element.offsetWidth : currentWidth;
33257
34116
  }
33258
34117
  else {
33259
- currentWidth = this.parent.chart ? this.parent.chartModule.getCalulatedWidth() : currentWidth;
34118
+ currentWidth = this.parent.chart ? this.parent.pivotChartModule.getCalulatedWidth() : currentWidth;
33260
34119
  }
33261
34120
  if (currentWidth) {
33262
34121
  let actWidth = currentWidth < 400 ? 400 : currentWidth;
@@ -33526,15 +34385,17 @@ class ConditionalFormatting {
33526
34385
  },
33527
34386
  {
33528
34387
  click: this.applyButtonClick.bind(this),
34388
+ isFlat: true,
33529
34389
  buttonModel: {
33530
- cssClass: FLAT_CLASS + ' ' + FORMAT_APPLY_BUTTON,
34390
+ isPrimary: true, cssClass: FORMAT_APPLY_BUTTON,
33531
34391
  content: this.parent.localeObj.getConstant('apply')
33532
34392
  }
33533
34393
  },
33534
34394
  {
33535
34395
  click: this.cancelButtonClick.bind(this),
34396
+ isFlat: true,
33536
34397
  buttonModel: {
33537
- cssClass: FLAT_CLASS + ' ' + FORMAT_CANCEL_BUTTON,
34398
+ cssClass: FORMAT_CANCEL_BUTTON,
33538
34399
  content: this.parent.localeObj.getConstant('cancel')
33539
34400
  }
33540
34401
  }
@@ -33587,6 +34448,10 @@ class ConditionalFormatting {
33587
34448
  applyButtonClick() {
33588
34449
  if (this.refreshConditionValues()) {
33589
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;
33590
34455
  this.parent.renderPivotGrid();
33591
34456
  this.dialog.close();
33592
34457
  }
@@ -34283,12 +35148,22 @@ class Toolbar$2 {
34283
35148
  }
34284
35149
  /* eslint-enable */
34285
35150
  reportChange(args) {
34286
- this.dropArgs = args;
34287
- if (this.parent.isModified && this.currentReport !== '') {
34288
- 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;
34289
35155
  }
34290
- else {
34291
- 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);
34292
35167
  }
34293
35168
  }
34294
35169
  reportLoad(args) {
@@ -34296,6 +35171,10 @@ class Toolbar$2 {
34296
35171
  let loadArgs = {
34297
35172
  reportName: args.itemData.value
34298
35173
  };
35174
+ let actionInfo = {
35175
+ reportName: args.itemData.value
35176
+ };
35177
+ this.parent.actionObj.actionInfo = actionInfo;
34299
35178
  this.parent.trigger(loadReport, loadArgs, (observedArgs) => {
34300
35179
  this.currentReport = observedArgs.reportName;
34301
35180
  this.parent.isModified = false;
@@ -34308,7 +35187,15 @@ class Toolbar$2 {
34308
35187
  report: this.parent.getPersistData(),
34309
35188
  reportName: this.currentReport
34310
35189
  };
35190
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
35191
+ let actionInfo = {
35192
+ reportName: this.currentReport
35193
+ };
35194
+ this.parent.actionObj.actionInfo = actionInfo;
34311
35195
  this.parent.trigger(saveReport, saveArgs);
35196
+ if (this.parent.actionObj.actionName) {
35197
+ this.parent.actionCompleteMethod();
35198
+ }
34312
35199
  this.parent.isModified = false;
34313
35200
  }
34314
35201
  else if (this.currentReport === '' && (args.item.id === (this.parent.element.id + 'save') || args.item.id === (this.parent.element.id + 'saveas'))) {
@@ -34372,54 +35259,67 @@ class Toolbar$2 {
34372
35259
  }
34373
35260
  }
34374
35261
  actionClick(args) {
34375
- switch (args.item.id) {
34376
- case (this.parent.element.id + 'save'):
34377
- case (this.parent.element.id + 'saveas'):
34378
- this.saveReport(args);
34379
- break;
34380
- case (this.parent.element.id + 'remove'):
34381
- this.action = 'Remove';
34382
- if (this.currentReport && this.currentReport !== '') {
34383
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeConfirm'));
34384
- }
34385
- else {
34386
- this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant('error'), this.parent.localeObj.getConstant('emptyReport'));
34387
- }
34388
- return;
34389
- case (this.parent.element.id + 'rename'):
34390
- this.renameReport(args);
34391
- break;
34392
- case (this.parent.element.id + 'new'):
34393
- this.action = 'New';
34394
- this.newArgs = args;
34395
- if (this.parent.isModified && this.currentReport && this.currentReport !== '') {
34396
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
34397
- }
34398
- else {
34399
- this.createNewReport(args);
34400
- }
34401
- break;
34402
- case (this.parent.element.id + 'load'):
34403
- this.action = 'Load';
34404
- break;
34405
- case (this.parent.element.id + 'fieldlist'):
34406
- if (this.parent.pivotFieldListModule && this.parent.pivotFieldListModule.dialogRenderer) {
34407
- this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.show();
34408
- }
34409
- break;
34410
- case (this.parent.element.id + 'formatting'):
34411
- if (this.parent.conditionalFormattingModule) {
34412
- this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
34413
- }
34414
- break;
34415
- case (this.parent.element.id + 'mdxQuery'):
34416
- this.mdxQueryDialog(args);
34417
- break;
34418
- case (this.parent.element.id + 'numberFormatting'):
34419
- if (this.parent.numberFormattingModule) {
34420
- this.parent.numberFormattingModule.showNumberFormattingDialog();
34421
- }
34422
- 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);
34423
35323
  }
34424
35324
  }
34425
35325
  renderDialog() {
@@ -34542,6 +35442,10 @@ class Toolbar$2 {
34542
35442
  report: _this.parent.getPersistData(),
34543
35443
  reportName: reportInput.value
34544
35444
  };
35445
+ let actionInfo = {
35446
+ reportName: reportInput.value
35447
+ };
35448
+ this.parent.actionObj.actionInfo = actionInfo;
34545
35449
  _this.parent.trigger(saveReport, saveArgs);
34546
35450
  _this.parent.isModified = false;
34547
35451
  _this.updateReportList();
@@ -34574,6 +35478,10 @@ class Toolbar$2 {
34574
35478
  report: _this.parent.getPersistData(),
34575
35479
  reportName: reportInput.value
34576
35480
  };
35481
+ let actionInfo = {
35482
+ reportName: reportInput.value
35483
+ };
35484
+ this.parent.actionObj.actionInfo = actionInfo;
34577
35485
  _this.parent.trigger(saveReport, saveArgs);
34578
35486
  _this.parent.isModified = false;
34579
35487
  _this.updateReportList();
@@ -34608,12 +35516,20 @@ class Toolbar$2 {
34608
35516
  reportName: _this.currentReport,
34609
35517
  rename: reportInput.value
34610
35518
  };
35519
+ let actionInfo = {
35520
+ reportName: { oldName: _this.currentReport, newName: reportInput.value }
35521
+ };
35522
+ this.parent.actionObj.actionInfo = actionInfo;
34611
35523
  _this.parent.trigger(renameReport, renameArgs);
34612
35524
  _this.currentReport = reportInput.value;
34613
35525
  _this.updateReportList();
34614
35526
  _this.dialog.hide();
34615
35527
  });
34616
35528
  }
35529
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
35530
+ if (this.parent.actionObj.actionName) {
35531
+ this.parent.actionCompleteMethod();
35532
+ }
34617
35533
  }
34618
35534
  createNewReport(args) {
34619
35535
  this.dialogShow(args);
@@ -34671,6 +35587,10 @@ class Toolbar$2 {
34671
35587
  let removeArgs = {
34672
35588
  reportName: this.currentReport
34673
35589
  };
35590
+ let actionInfo = {
35591
+ reportName: this.currentReport
35592
+ };
35593
+ this.parent.actionObj.actionInfo = actionInfo;
34674
35594
  this.parent.trigger(removeReport, removeArgs);
34675
35595
  let reports = this.fetchReports();
34676
35596
  if (reports.reportName && reports.reportName.length > 0) {
@@ -34689,6 +35609,10 @@ class Toolbar$2 {
34689
35609
  this.action = '';
34690
35610
  }
34691
35611
  this.updateReportList();
35612
+ this.parent.actionObj.actionName = reportRemoved;
35613
+ if (this.parent.actionObj.actionName) {
35614
+ this.parent.actionCompleteMethod();
35615
+ }
34692
35616
  }
34693
35617
  else if (this.action === 'New' || (this.action !== 'Save' && this.action !== 'Rename' && this.action !== 'New')) {
34694
35618
  if (this.currentReport && this.currentReport !== '' && this.parent.isModified) {
@@ -34696,12 +35620,22 @@ class Toolbar$2 {
34696
35620
  report: this.parent.getPersistData(),
34697
35621
  reportName: this.currentReport
34698
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
+ }
34699
35631
  this.parent.trigger(saveReport, saveArgs);
34700
35632
  this.parent.isModified = false;
34701
35633
  if (this.action === 'New') {
35634
+ this.parent.actionObj.actionName = addNewReport;
34702
35635
  this.createNewReport(this.newArgs);
34703
35636
  }
34704
35637
  else {
35638
+ this.parent.actionObj.actionName = reportChange;
34705
35639
  this.reportLoad(this.dropArgs);
34706
35640
  }
34707
35641
  }
@@ -34806,6 +35740,7 @@ class Toolbar$2 {
34806
35740
  this.chartMenu = new Menu({
34807
35741
  items: menu, enableRtl: this.parent.enableRtl,
34808
35742
  locale: this.parent.locale,
35743
+ cssClass: TOOLBAR_MENU,
34809
35744
  select: this.menuItemClick.bind(this),
34810
35745
  beforeOpen: this.whitespaceRemove.bind(this),
34811
35746
  onClose: (args) => {
@@ -34861,6 +35796,7 @@ class Toolbar$2 {
34861
35796
  this.exportMenu = new Menu({
34862
35797
  items: menu, enableRtl: this.parent.enableRtl,
34863
35798
  locale: this.parent.locale,
35799
+ cssClass: TOOLBAR_MENU,
34864
35800
  select: this.menuItemClick.bind(this), beforeOpen: this.updateExportMenu.bind(this),
34865
35801
  onClose: (args) => {
34866
35802
  this.focusToolBar();
@@ -34898,6 +35834,7 @@ class Toolbar$2 {
34898
35834
  this.subTotalMenu = new Menu({
34899
35835
  items: menu, enableRtl: this.parent.enableRtl,
34900
35836
  locale: this.parent.locale,
35837
+ cssClass: TOOLBAR_MENU,
34901
35838
  select: this.menuItemClick.bind(this), beforeOpen: this.updateSubtotalSelection.bind(this),
34902
35839
  onClose: (args) => {
34903
35840
  this.focusToolBar();
@@ -34935,6 +35872,7 @@ class Toolbar$2 {
34935
35872
  this.grandTotalMenu = new Menu({
34936
35873
  items: menu, enableRtl: this.parent.enableRtl,
34937
35874
  locale: this.parent.locale,
35875
+ cssClass: TOOLBAR_MENU,
34938
35876
  select: this.menuItemClick.bind(this), beforeOpen: this.updateGrandtotalSelection.bind(this),
34939
35877
  onClose: (args) => {
34940
35878
  this.focusToolBar();
@@ -34962,6 +35900,7 @@ class Toolbar$2 {
34962
35900
  this.formattingMenu = new Menu({
34963
35901
  items: menu, enableRtl: this.parent.enableRtl,
34964
35902
  locale: this.parent.locale,
35903
+ cssClass: TOOLBAR_MENU,
34965
35904
  select: this.menuItemClick.bind(this)
34966
35905
  });
34967
35906
  this.formattingMenu.isStringTemplate = true;
@@ -35159,181 +36098,202 @@ class Toolbar$2 {
35159
36098
  menuItemClick(args) {
35160
36099
  let exportArgs = {};
35161
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
+ }
35162
36113
  if (this.getAllChartItems().indexOf(args.item.id.split(this.parent.element.id + '_')[1]) > -1 ||
35163
36114
  (args.item.id.split(this.parent.element.id + '_')[1] === 'ChartMoreOption') ||
35164
36115
  (args.item.id.split(this.parent.element.id + '_')[1] === 'multipleAxes') ||
35165
36116
  (args.item.id.split(this.parent.element.id + '_')[1] === 'showLegend')) {
35166
36117
  type = args.item.id.split(this.parent.element.id + '_')[1];
35167
36118
  }
35168
- switch (args.item.id) {
35169
- case (this.parent.element.id + 'grid'):
35170
- if (this.parent.grid && this.parent.chart) {
35171
- this.parent.grid.element.style.display = '';
35172
- this.parent.chart.element.style.display = 'none';
35173
- if (this.parent.chartSettings.enableMultipleAxis && this.parent.chartSettings.enableScrollOnMultiAxis) {
35174
- this.parent.element.querySelector('.e-pivotchart').style.display = 'none';
35175
- }
35176
- this.parent.currentView = 'Table';
35177
- this.parent.setProperties({ displayOption: { primary: 'Table' } }, true);
35178
- if (this.parent.showGroupingBar && this.parent.groupingBarModule) {
35179
- this.parent.element.querySelector('.e-pivot-grouping-bar').style.display = '';
35180
- 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();
35181
36139
  }
35182
- this.parent.layoutRefresh();
35183
- }
35184
- break;
35185
- case (this.parent.element.id + 'pdf'):
35186
- 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'):
35187
36178
  exportArgs = {
35188
- pdfExportProperties: { fileName: 'Export.pdf' },
35189
- pdfDoc: undefined,
36179
+ excelExportProperties: { fileName: 'Export.csv' },
35190
36180
  isBlob: false,
35191
- isMultipleExport: false
36181
+ isMultipleExport: false,
36182
+ workbook: undefined
35192
36183
  };
35193
36184
  this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35194
- this.parent.pdfExport(observedArgs.pdfExportProperties, observedArgs.isMultipleExport, observedArgs.pdfDoc, observedArgs.isBlob);
36185
+ this.parent.csvExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
35195
36186
  });
35196
- }
35197
- else {
36187
+ break;
36188
+ case (this.parent.element.id + 'png'):
35198
36189
  exportArgs = {
36190
+ type: 'PNG',
35199
36191
  width: undefined,
35200
36192
  height: undefined,
36193
+ fileName: 'result',
35201
36194
  orientation: PdfPageOrientation.Landscape,
35202
- 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',
35203
36203
  fileName: 'result',
36204
+ orientation: PdfPageOrientation.Landscape,
36205
+ width: undefined,
36206
+ height: undefined,
35204
36207
  };
35205
36208
  this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35206
36209
  this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35207
36210
  });
35208
- }
35209
- break;
35210
- case (this.parent.element.id + 'excel'):
35211
- exportArgs = {
35212
- excelExportProperties: { fileName: 'Export.xlsx' },
35213
- isBlob: undefined,
35214
- isMultipleExport: undefined,
35215
- workbook: undefined
35216
- };
35217
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35218
- this.parent.excelExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
35219
- });
35220
- break;
35221
- case (this.parent.element.id + 'csv'):
35222
- exportArgs = {
35223
- excelExportProperties: { fileName: 'Export.csv' },
35224
- isBlob: false,
35225
- isMultipleExport: false,
35226
- workbook: undefined
35227
- };
35228
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35229
- this.parent.csvExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
35230
- });
35231
- break;
35232
- case (this.parent.element.id + 'png'):
35233
- exportArgs = {
35234
- type: 'PNG',
35235
- width: undefined,
35236
- height: undefined,
35237
- fileName: 'result',
35238
- orientation: PdfPageOrientation.Landscape,
35239
- };
35240
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35241
- this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35242
- });
35243
- break;
35244
- case (this.parent.element.id + 'jpeg'):
35245
- exportArgs = {
35246
- type: 'JPEG',
35247
- fileName: 'result',
35248
- orientation: PdfPageOrientation.Landscape,
35249
- width: undefined,
35250
- height: undefined,
35251
- };
35252
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35253
- this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35254
- });
35255
- break;
35256
- case (this.parent.element.id + 'svg'):
35257
- exportArgs = {
35258
- width: undefined,
35259
- height: undefined,
35260
- type: 'SVG',
35261
- fileName: 'result',
35262
- orientation: PdfPageOrientation.Landscape,
35263
- };
35264
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35265
- this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35266
- });
35267
- break;
35268
- case (this.parent.element.id + 'notsubtotal'):
35269
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: false, showColumnSubTotals: false, showRowSubTotals: false } }, true);
35270
- this.parent.refreshData();
35271
- break;
35272
- case (this.parent.element.id + 'subtotalrow'):
35273
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: false, showRowSubTotals: true } }, true);
35274
- this.parent.refreshData();
35275
- break;
35276
- case (this.parent.element.id + 'subtotalcolumn'):
35277
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: false } }, true);
35278
- this.parent.refreshData();
35279
- break;
35280
- case (this.parent.element.id + 'subtotal'):
35281
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: true } }, true);
35282
- this.parent.refreshData();
35283
- break;
35284
- case (this.parent.element.id + 'notgrandtotal'):
35285
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: false, showColumnGrandTotals: false, showRowGrandTotals: false } }, true);
35286
- this.parent.refreshData();
35287
- break;
35288
- case (this.parent.element.id + 'grandtotalrow'):
35289
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: false, showRowGrandTotals: true } }, true);
35290
- this.parent.refreshData();
35291
- break;
35292
- case (this.parent.element.id + 'grandtotalcolumn'):
35293
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: false } }, true);
35294
- this.parent.refreshData();
35295
- break;
35296
- case (this.parent.element.id + 'grandtotal'):
35297
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: true } }, true);
35298
- this.parent.refreshData();
35299
- break;
35300
- case (this.parent.element.id + 'numberFormattingMenu'):
35301
- if (this.parent.numberFormattingModule) {
35302
- this.parent.numberFormattingModule.showNumberFormattingDialog();
35303
- }
35304
- break;
35305
- case (this.parent.element.id + 'conditionalFormattingMenu'):
35306
- if (this.parent.conditionalFormattingModule) {
35307
- this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
35308
- }
35309
- break;
35310
- case (this.parent.element.id + '_' + type):
35311
- if (args.item && args.item.text) {
35312
- if (type === 'ChartMoreOption') {
35313
- this.createChartTypeDialog();
35314
- }
35315
- else if (type === 'multipleAxes') {
35316
- if (this.parent.chartSettings.enableScrollOnMultiAxis) {
35317
- this.isMultiAxisChange = true;
35318
- }
35319
- this.parent.chartSettings.enableMultipleAxis = !this.parent.chartSettings.enableMultipleAxis;
35320
- 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();
35321
36259
  }
35322
- else if (this.getAllChartItems().indexOf(type) > -1) {
35323
- this.updateChartType(type, false);
36260
+ break;
36261
+ case (this.parent.element.id + 'conditionalFormattingMenu'):
36262
+ if (this.parent.conditionalFormattingModule) {
36263
+ this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
35324
36264
  }
35325
- else if (type === 'showLegend') {
35326
- this.parent.chart.legendSettings.visible = !this.showLableState;
35327
- if (this.parent.chartSettings.legendSettings) {
35328
- 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);
35329
36277
  }
35330
- else {
35331
- 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);
35332
36290
  }
35333
- this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
35334
36291
  }
35335
- }
35336
- break;
36292
+ break;
36293
+ }
36294
+ }
36295
+ catch (execption) {
36296
+ this.parent.actionFailureMethod(execption);
35337
36297
  }
35338
36298
  /* eslint-enable max-len */
35339
36299
  }
@@ -35424,14 +36384,20 @@ class Toolbar$2 {
35424
36384
  if (this.parent.chart) {
35425
36385
  this.parent.currentView = 'Chart';
35426
36386
  this.parent.setProperties({ displayOption: { primary: 'Chart' } }, true);
35427
- 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
+ }
35428
36390
  this.parent.chart.setProperties({ width: formatUnit(this.parent.grid ? this.parent.getGridWidthAsNumber() : this.parent.getWidthAsNumber()) }, true); /* eslint-disable-line */
35429
36391
  if (this.parent.chartSettings.chartSeries.type === type && !isMultiAxis) {
35430
- this.parent.chartModule.updateView();
36392
+ this.parent.pivotChartModule.updateView();
35431
36393
  }
35432
36394
  else {
35433
36395
  this.parent.chartSettings.chartSeries.type = type;
35434
36396
  }
36397
+ let actionInfo = {
36398
+ toolbarInfo: { displayOption: this.parent.displayOption, chartSettings: this.parent.chartSettings }
36399
+ };
36400
+ this.parent.actionObj.actionInfo = actionInfo;
35435
36401
  }
35436
36402
  }
35437
36403
  }
@@ -35991,6 +36957,10 @@ class NumberFormatting {
35991
36957
  this.parent.trigger(numberFormatting, eventArgs, (observedArgs) => {
35992
36958
  if (!observedArgs.cancel) {
35993
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;
35994
36964
  try {
35995
36965
  this.parent.updateDataSource(false);
35996
36966
  this.dialog.close();
@@ -36648,7 +37618,7 @@ class Grouping {
36648
37618
  for (let j = 0, len = field.customGroups.length; j < len; j++) {
36649
37619
  if (field.customGroups[j]) {
36650
37620
  let group = field.customGroups[j];
36651
- if (group.items && PivotUtil.isContainCommonElements(group.items, selectedOptions)) {
37621
+ if (group.items && PivotExportUtil.isContainCommonElements(group.items, selectedOptions)) {
36652
37622
  splicedItems = this.mergeArray(splicedItems, [group.groupName]);
36653
37623
  newItems = this.mergeArray(newItems, group.items);
36654
37624
  field.customGroups.splice(j, 1);
@@ -36898,5 +37868,5 @@ class Grouping {
36898
37868
  * Export PivotGrid components
36899
37869
  */
36900
37870
 
36901
- 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 };
36902
37872
  //# sourceMappingURL=ej2-pivotview.es2015.js.map