@syncfusion/ej2-pivotview 19.3.53 → 19.4.40

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 (137) 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 +31 -25
  4. package/README.md +1 -1
  5. package/dist/ej2-pivotview.umd.min.js +2 -2
  6. package/dist/ej2-pivotview.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-pivotview.es2015.js +2076 -1100
  8. package/dist/es6/ej2-pivotview.es2015.js.map +1 -1
  9. package/dist/es6/ej2-pivotview.es5.js +2092 -1110
  10. package/dist/es6/ej2-pivotview.es5.js.map +1 -1
  11. package/dist/global/ej2-pivotview.min.js +2 -2
  12. package/dist/global/ej2-pivotview.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +22 -22
  15. package/src/base/engine.d.ts +17 -1
  16. package/src/base/engine.js +82 -29
  17. package/src/base/export-util.d.ts +17 -0
  18. package/src/base/export-util.js +245 -0
  19. package/src/base/olap/engine.d.ts +7 -0
  20. package/src/base/olap/engine.js +138 -35
  21. package/src/base/util.d.ts +0 -9
  22. package/src/base/util.js +2 -215
  23. package/src/common/actions/field-list.js +1 -1
  24. package/src/common/actions/pivot-button.d.ts +5 -8
  25. package/src/common/actions/pivot-button.js +188 -171
  26. package/src/common/base/constant.d.ts +186 -0
  27. package/src/common/base/constant.js +186 -0
  28. package/src/common/base/css-constant.d.ts +2 -0
  29. package/src/common/base/css-constant.js +2 -0
  30. package/src/common/base/enum.d.ts +11 -0
  31. package/src/common/base/interface.d.ts +272 -2
  32. package/src/common/calculatedfield/calculated-field.js +108 -93
  33. package/src/common/conditionalformatting/conditional-formatting.js +8 -2
  34. package/src/common/grouping-bar/grouping-bar.js +1 -1
  35. package/src/common/popups/aggregate-menu.js +57 -35
  36. package/src/common/popups/drillthrough-dialog.js +187 -139
  37. package/src/common/popups/filter-dialog.d.ts +1 -0
  38. package/src/common/popups/filter-dialog.js +22 -1
  39. package/src/common/popups/formatting-dialog.js +4 -0
  40. package/src/common/popups/grouping.js +2 -1
  41. package/src/common/popups/toolbar.js +305 -203
  42. package/src/pivotchart/base/pivotchart.js +36 -15
  43. package/src/pivotfieldlist/base/field-list-model.d.ts +49 -1
  44. package/src/pivotfieldlist/base/field-list.d.ts +55 -1
  45. package/src/pivotfieldlist/base/field-list.js +68 -1
  46. package/src/pivotfieldlist/renderer/dialog-renderer.js +38 -15
  47. package/src/pivotfieldlist/renderer/tree-renderer.js +35 -22
  48. package/src/pivotview/actions/drill-through.js +1 -1
  49. package/src/pivotview/actions/excel-export.js +9 -7
  50. package/src/pivotview/actions/pdf-export.js +3 -3
  51. package/src/pivotview/base/pivotview-model.d.ts +46 -1
  52. package/src/pivotview/base/pivotview.d.ts +56 -2
  53. package/src/pivotview/base/pivotview.js +311 -107
  54. package/src/pivotview/model/chartsettings-model.d.ts +2 -2
  55. package/src/pivotview/model/chartsettings.d.ts +2 -2
  56. package/src/pivotview/model/chartsettings.js +2 -2
  57. package/src/pivotview/model/datasourcesettings-model.d.ts +8 -1
  58. package/src/pivotview/model/datasourcesettings.d.ts +7 -0
  59. package/src/pivotview/model/datasourcesettings.js +3 -0
  60. package/src/pivotview/renderer/render.d.ts +2 -1
  61. package/src/pivotview/renderer/render.js +52 -11
  62. package/styles/bootstrap-dark.css +115 -104
  63. package/styles/bootstrap.css +115 -104
  64. package/styles/bootstrap4.css +114 -81
  65. package/styles/bootstrap5-dark.css +220 -168
  66. package/styles/bootstrap5.css +215 -161
  67. package/styles/fabric-dark.css +117 -103
  68. package/styles/fabric.css +115 -102
  69. package/styles/highcontrast-light.css +116 -102
  70. package/styles/highcontrast.css +118 -104
  71. package/styles/material-dark.css +108 -97
  72. package/styles/material.css +108 -97
  73. package/styles/pivotfieldlist/_bootstrap-dark-definition.scss +1 -4
  74. package/styles/pivotfieldlist/_bootstrap-definition.scss +1 -4
  75. package/styles/pivotfieldlist/_bootstrap4-definition.scss +1 -4
  76. package/styles/pivotfieldlist/_bootstrap5-definition.scss +8 -11
  77. package/styles/pivotfieldlist/_fabric-dark-definition.scss +1 -4
  78. package/styles/pivotfieldlist/_fabric-definition.scss +1 -4
  79. package/styles/pivotfieldlist/_fluent-definition.scss +177 -0
  80. package/styles/pivotfieldlist/_highcontrast-definition.scss +1 -4
  81. package/styles/pivotfieldlist/_highcontrast-light-definition.scss +1 -4
  82. package/styles/pivotfieldlist/_layout.scss +199 -109
  83. package/styles/pivotfieldlist/_material-dark-definition.scss +1 -4
  84. package/styles/pivotfieldlist/_material-definition.scss +1 -4
  85. package/styles/pivotfieldlist/_tailwind-definition.scss +6 -9
  86. package/styles/pivotfieldlist/_theme.scss +185 -35
  87. package/styles/pivotfieldlist/bootstrap-dark.css +49 -58
  88. package/styles/pivotfieldlist/bootstrap.css +49 -58
  89. package/styles/pivotfieldlist/bootstrap4.css +44 -39
  90. package/styles/pivotfieldlist/bootstrap5-dark.css +115 -89
  91. package/styles/pivotfieldlist/bootstrap5.css +115 -89
  92. package/styles/pivotfieldlist/fabric-dark.css +49 -58
  93. package/styles/pivotfieldlist/fabric.css +49 -58
  94. package/styles/pivotfieldlist/highcontrast-light.css +49 -58
  95. package/styles/pivotfieldlist/highcontrast.css +49 -58
  96. package/styles/pivotfieldlist/icons/_bootstrap5.scss +2 -2
  97. package/styles/pivotfieldlist/icons/_fluent.scss +352 -0
  98. package/styles/pivotfieldlist/icons/_tailwind.scss +2 -2
  99. package/styles/pivotfieldlist/material-dark.css +44 -53
  100. package/styles/pivotfieldlist/material.css +44 -53
  101. package/styles/pivotfieldlist/tailwind-dark.css +138 -81
  102. package/styles/pivotfieldlist/tailwind.css +140 -83
  103. package/styles/pivotview/_bootstrap-dark-definition.scss +9 -6
  104. package/styles/pivotview/_bootstrap-definition.scss +9 -6
  105. package/styles/pivotview/_bootstrap4-definition.scss +10 -7
  106. package/styles/pivotview/_bootstrap5-definition.scss +12 -9
  107. package/styles/pivotview/_fabric-dark-definition.scss +8 -5
  108. package/styles/pivotview/_fabric-definition.scss +7 -4
  109. package/styles/pivotview/_fluent-definition.scss +126 -0
  110. package/styles/pivotview/_highcontrast-definition.scss +8 -5
  111. package/styles/pivotview/_highcontrast-light-definition.scss +7 -4
  112. package/styles/pivotview/_layout.scss +119 -64
  113. package/styles/pivotview/_material-dark-definition.scss +7 -4
  114. package/styles/pivotview/_material-definition.scss +8 -4
  115. package/styles/pivotview/_tailwind-definition.scss +8 -5
  116. package/styles/pivotview/_theme.scss +124 -70
  117. package/styles/pivotview/bootstrap-dark.css +66 -46
  118. package/styles/pivotview/bootstrap.css +66 -46
  119. package/styles/pivotview/bootstrap4.css +70 -42
  120. package/styles/pivotview/bootstrap5-dark.css +99 -73
  121. package/styles/pivotview/bootstrap5-dark.scss +0 -1
  122. package/styles/pivotview/bootstrap5.css +100 -72
  123. package/styles/pivotview/fabric-dark.css +68 -45
  124. package/styles/pivotview/fabric.css +66 -44
  125. package/styles/pivotview/highcontrast-light.css +67 -44
  126. package/styles/pivotview/highcontrast.css +69 -46
  127. package/styles/pivotview/icons/_bootstrap4.scss +1 -1
  128. package/styles/pivotview/icons/_bootstrap5.scss +1 -1
  129. package/styles/pivotview/icons/_fluent.scss +183 -0
  130. package/styles/pivotview/icons/_tailwind.scss +1 -1
  131. package/styles/pivotview/material-dark.css +64 -44
  132. package/styles/pivotview/material.css +64 -44
  133. package/styles/pivotview/tailwind-dark.css +106 -58
  134. package/styles/pivotview/tailwind-dark.scss +0 -1
  135. package/styles/pivotview/tailwind.css +107 -57
  136. package/styles/tailwind-dark.css +250 -145
  137. package/styles/tailwind.css +247 -140
@@ -63,41 +63,6 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
63
63
  }
64
64
  return clonedData;
65
65
  };
66
- PivotUtil.getClonedPivotValues = function (pivotValues) {
67
- var clonedSets = [];
68
- for (var i = 0; i < pivotValues.length; i++) {
69
- if (pivotValues[i]) {
70
- clonedSets[i] = [];
71
- for (var j = 0; j < pivotValues[i].length; j++) {
72
- if (pivotValues[i][j]) {
73
- /* eslint-disable */
74
- clonedSets[i][j] = this.getClonedPivotValueObj(pivotValues[i][j]);
75
- /* eslint-enable */
76
- }
77
- }
78
- }
79
- }
80
- return clonedSets;
81
- };
82
- /* eslint-disable */
83
- PivotUtil.getClonedPivotValueObj = function (data) {
84
- /* eslint-enable */
85
- var keyPos = 0;
86
- /* eslint-disable @typescript-eslint/no-explicit-any */
87
- var framedSet = {};
88
- /* eslint-enable @typescript-eslint/no-explicit-any */
89
- if (!(data === null || data === undefined)) {
90
- var fields = Object.keys(data);
91
- while (keyPos < fields.length) {
92
- framedSet[fields[keyPos]] = data[fields[keyPos]];
93
- keyPos++;
94
- }
95
- }
96
- else {
97
- framedSet = data;
98
- }
99
- return framedSet;
100
- };
101
66
  /* eslint-disable @typescript-eslint/no-explicit-any */
102
67
  PivotUtil.getDefinedObj = function (data) {
103
68
  var keyPos = 0;
@@ -130,18 +95,6 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
130
95
  return -1;
131
96
  };
132
97
  /* eslint-disable */
133
- PivotUtil.isContainCommonElements = function (collection1, collection2) {
134
- /* eslint-enable */
135
- for (var i = 0, cnt = collection1.length; i < cnt; i++) {
136
- for (var j = 0, lnt = collection2.length; j < lnt; j++) {
137
- if (collection2[j] === collection1[i]) {
138
- return true;
139
- }
140
- }
141
- }
142
- return false;
143
- };
144
- /* eslint-disable */
145
98
  PivotUtil.setPivotProperties = function (control, properties) {
146
99
  /* eslint-enable */
147
100
  control.allowServerDataBinding = false;
@@ -178,6 +131,7 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
178
131
  drilledMembers: this.cloneDrillMemberSettings(dataSourceSettings.drilledMembers),
179
132
  valueSortSettings: this.CloneValueSortObject(dataSourceSettings.valueSortSettings),
180
133
  valueAxis: dataSourceSettings.valueAxis,
134
+ grandTotalsPosition: dataSourceSettings.grandTotalsPosition,
181
135
  formatSettings: this.cloneFormatSettings(dataSourceSettings.formatSettings),
182
136
  calculatedFieldSettings: this.cloneCalculatedFieldSettings(dataSourceSettings.calculatedFieldSettings),
183
137
  fieldMapping: this.cloneFieldSettings(dataSourceSettings.fieldMapping),
@@ -224,6 +178,7 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
224
178
  drilledMembers: dataSourceSettings.drilledMembers,
225
179
  valueSortSettings: dataSourceSettings.valueSortSettings,
226
180
  valueAxis: dataSourceSettings.valueAxis,
181
+ grandTotalsPosition: dataSourceSettings.grandTotalsPosition,
227
182
  formatSettings: dataSourceSettings.formatSettings,
228
183
  calculatedFieldSettings: dataSourceSettings.calculatedFieldSettings,
229
184
  fieldMapping: dataSourceSettings.fieldMapping,
@@ -645,174 +600,6 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
645
600
  return values;
646
601
  };
647
602
  /* eslint-disable */
648
- PivotUtil.formatPdfHeaderFooter = function (pdf) {
649
- var contents = [];
650
- if (!isNullOrUndefined(pdf)) {
651
- for (var i = 0; i < pdf.length; i++) {
652
- var a = pdf[i];
653
- var content = {
654
- /* eslint-enable */
655
- type: a.Type,
656
- pageNumberType: a.PageNumberType,
657
- style: a.Style ? {
658
- penColor: a.Style.PenColor,
659
- penSize: a.Style.PenSize,
660
- dashStyle: a.Style.DashStyle,
661
- textBrushColor: a.Style.TextBrushColor,
662
- textPenColor: a.Style.TextPenColor,
663
- fontSize: a.Style.FontSize,
664
- hAlign: a.Style.HAlign,
665
- vAlign: a.Style.VAlign
666
- } : a.Style,
667
- points: a.Points !== null ? {
668
- x1: a.Points.X1,
669
- y1: a.Points.Y1,
670
- x2: a.Points.X2,
671
- y2: a.Points.Y2
672
- } : null,
673
- format: a.Format,
674
- position: a.Position !== null ? {
675
- x: a.Position.X,
676
- y: a.Position.Y
677
- } : null,
678
- size: a.Size !== null ? {
679
- height: a.Size.Height,
680
- width: a.Size.Width
681
- } : null,
682
- src: a.Src,
683
- value: a.Value,
684
- font: a.Font
685
- };
686
- contents.push(content);
687
- }
688
- }
689
- return contents;
690
- };
691
- /* eslint-disable */
692
- PivotUtil.formatPdfExportProperties = function (pdf) {
693
- var values;
694
- /* eslint-enable */
695
- values = this.getDefinedObj({
696
- pageOrientation: typeof pdf.PageOrientation === 'string' ? pdf.PageOrientation : null,
697
- pageSize: typeof pdf.PageSize === 'string' ? pdf.PageSize : null,
698
- header: !isNullOrUndefined(pdf.Header) ? {
699
- fromTop: pdf.Header.FromTop,
700
- height: pdf.Header.Height,
701
- contents: this.formatPdfHeaderFooter(pdf.Header.Contents)
702
- } : null,
703
- columns: pdf.Columns,
704
- footer: !isNullOrUndefined(pdf.Footer) ? {
705
- fromTop: pdf.Footer.FromBottom,
706
- height: pdf.Footer.Height,
707
- contents: this.formatPdfHeaderFooter(pdf.Footer.Contents)
708
- } : null,
709
- includeHiddenColumn: pdf.IncludeHiddenColumn,
710
- dataSource: pdf.DataSource,
711
- exportType: typeof pdf.ExportType === 'string' ? pdf.ExportType : null,
712
- theme: !isNullOrUndefined(pdf.Theme) ? {
713
- header: pdf.Theme.Header,
714
- record: pdf.Theme.Record,
715
- caption: pdf.Theme.Caption
716
- } : null,
717
- fileName: pdf.FileName,
718
- hierarchyExportMode: typeof pdf.HierarchyExportMode === 'string' ? pdf.HierarchyExportMode : null,
719
- allowHorizontalOverflow: pdf.AllowHorizontalOverflow
720
- });
721
- return values;
722
- };
723
- /* eslint-disable */
724
- PivotUtil.formatExcelStyle = function (style) {
725
- var prop;
726
- /* eslint-enable */
727
- if (!isNullOrUndefined(style)) {
728
- prop = this.getDefinedObj({
729
- fontColor: style.FontColor,
730
- fontName: style.FontName,
731
- fontSize: style.FontSize,
732
- hAlign: style.HAlign === String ? style.HAlign : null,
733
- vAlign: style.VAlign === String ? style.VAlign : null,
734
- bold: style.Bold,
735
- indent: style.Indent,
736
- italic: style.Italic,
737
- underline: style.Underline,
738
- backColor: style.BackColor,
739
- wrapText: style.WrapText,
740
- borders: style.Borders,
741
- numberFormat: style.NumberFormat,
742
- type: style.Type
743
- });
744
- }
745
- return prop;
746
- };
747
- /* eslint-disable */
748
- PivotUtil.formatExcelCell = function (cell) {
749
- var cells = [];
750
- if (!isNullOrUndefined(cell)) {
751
- for (var i = 0; i < cell.length; i++) {
752
- this.getDefinedObj({
753
- index: !isNullOrUndefined(cell[i].Index) ? cell[i].Index : null,
754
- colSpan: !isNullOrUndefined(cell[i].ColSpan) ? cell[i].ColSpan : null,
755
- value: !isNullOrUndefined(cell[i].Value) ? cell[i].Value : null,
756
- hyperlink: {
757
- target: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.Target : null,
758
- displayText: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.DisplayText : null
759
- },
760
- styles: this.formatExcelStyle(cell[i].Style),
761
- rowSpan: !isNullOrUndefined(cell[i].RowSpan) ? cell[i].RowSpan : null
762
- });
763
- /* eslint-enable */
764
- }
765
- }
766
- return cells;
767
- };
768
- /* eslint-disable */
769
- PivotUtil.formatExcelHeaderFooter = function (excel) {
770
- var rows = [];
771
- if (!isNullOrUndefined(excel)) {
772
- for (var i = 0; i < excel.Rows.length; i++) {
773
- var row = excel.Rows[i];
774
- var prop = this.getDefinedObj({
775
- index: !isNullOrUndefined(row.Index) ? row.Index : null,
776
- cells: this.formatExcelCell(row.Cells),
777
- grouping: !isNullOrUndefined(row.Grouping) ? row.Grouping : null
778
- });
779
- rows.push(prop);
780
- }
781
- }
782
- return rows;
783
- };
784
- PivotUtil.formatExcelExportProperties = function (excel) {
785
- /* eslint-enable */
786
- var prop;
787
- prop = this.getDefinedObj({
788
- dataSource: excel.DataSource,
789
- query: excel.Query,
790
- multipleExport: this.getDefinedObj({
791
- type: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.Type : null,
792
- blankRows: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.BlankRows : null
793
- }),
794
- header: this.getDefinedObj({
795
- headerRows: !isNullOrUndefined(excel.Header) ? excel.Header.HeaderRows : null,
796
- rows: this.formatExcelHeaderFooter(excel.Header)
797
- }),
798
- footer: this.getDefinedObj({
799
- footerRows: !isNullOrUndefined(excel.Footer) ? excel.Footer.FooterRows : null,
800
- rows: this.formatExcelHeaderFooter(excel.Footer)
801
- }),
802
- columns: excel.Columns,
803
- exportType: typeof excel.ExportType === 'string' ? excel.ExportType : undefined,
804
- includeHiddenColumn: excel.IncludeHiddenColumn,
805
- theme: !isNullOrUndefined(excel.Theme) ? {
806
- header: this.formatExcelStyle(excel.Theme.Header),
807
- record: this.formatExcelStyle(excel.Theme.Record),
808
- caption: this.formatExcelStyle(excel.Theme.Caption)
809
- } : undefined,
810
- fileName: excel.FileName,
811
- hierarchyExportMode: typeof excel.HierarchyExportMode === 'string' ? excel.HierarchyExportMode : undefined
812
- });
813
- return prop;
814
- };
815
- /* eslint-disable */
816
603
  PivotUtil.formatFieldList = function (fieldList) {
817
604
  var keys = Object.keys(fieldList);
818
605
  var fList = {};
@@ -1124,7 +911,8 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
1124
911
  this.isLastHeaderHasMeasures = true;
1125
912
  this.isEditing = false;
1126
913
  var fields;
1127
- this.globalize = new Internationalization();
914
+ this.globalize = (customProperties && customProperties.globalize) ? customProperties.globalize : new Internationalization();
915
+ this.currencyCode = (customProperties && customProperties.currenyCode) ? customProperties.currenyCode : undefined;
1128
916
  this.localeObj = customProperties ? customProperties.localeObj : undefined;
1129
917
  this.fieldsType = customProperties ? customProperties.fieldsType : {};
1130
918
  this.clonedReport = customProperties ? (customProperties.clonedReport &&
@@ -1138,6 +926,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
1138
926
  this.showRowSubTotals = isNullOrUndefined(dataSource.showRowSubTotals) ? true : dataSource.showRowSubTotals;
1139
927
  this.showColumnSubTotals = isNullOrUndefined(dataSource.showColumnSubTotals) ? true : dataSource.showColumnSubTotals;
1140
928
  this.showGrandTotals = isNullOrUndefined(dataSource.showGrandTotals) ? true : dataSource.showGrandTotals;
929
+ this.grandTotalsPosition = isNullOrUndefined(dataSource.grandTotalsPosition) ? 'Bottom' : dataSource.grandTotalsPosition;
1141
930
  this.showRowGrandTotals = isNullOrUndefined(dataSource.showRowGrandTotals) ? true : dataSource.showRowGrandTotals;
1142
931
  this.showColumnGrandTotals = isNullOrUndefined(dataSource.showColumnGrandTotals) ? true : dataSource.showColumnGrandTotals;
1143
932
  this.allowValueFilter = dataSource.allowValueFilter;
@@ -1251,6 +1040,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
1251
1040
  this.showRowSubTotals = isNullOrUndefined(dataSource.showRowSubTotals) ? true : dataSource.showRowSubTotals;
1252
1041
  this.showColumnSubTotals = isNullOrUndefined(dataSource.showColumnSubTotals) ? true : dataSource.showColumnSubTotals;
1253
1042
  this.showGrandTotals = isNullOrUndefined(dataSource.showGrandTotals) ? true : dataSource.showGrandTotals;
1043
+ this.grandTotalsPosition = isNullOrUndefined(dataSource.grandTotalsPosition) ? 'Bottom' : dataSource.grandTotalsPosition;
1254
1044
  this.showRowGrandTotals = isNullOrUndefined(dataSource.showRowGrandTotals) ? true : dataSource.showRowGrandTotals;
1255
1045
  this.showColumnGrandTotals = isNullOrUndefined(dataSource.showColumnGrandTotals) ? true : dataSource.showColumnGrandTotals;
1256
1046
  this.allowValueFilter = dataSource.allowValueFilter;
@@ -1553,6 +1343,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
1553
1343
  }
1554
1344
  if (!PivotUtil.getFieldByName(groupKeys[gCnt], dataFields)) {
1555
1345
  groupField = groupFields[groupKeys[gCnt]];
1346
+ caption_1 = (caption_1.indexOf(' (') !== -1 && caption_1.indexOf(')') !== -1) ? caption_1.slice(caption_1.indexOf('(') + 1, caption_1.length - 1) : caption_1;
1556
1347
  var newField = {
1557
1348
  name: groupKeys[gCnt],
1558
1349
  caption: (this_1.localeObj ? this_1.localeObj.getConstant(groupField) : groupField) + ' (' + caption_1 + ')',
@@ -1580,6 +1371,8 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
1580
1371
  }
1581
1372
  }
1582
1373
  gCnt = Object.keys(groupKeys).length;
1374
+ var field = this_1.getMappingField(fieldName, this_1.clonedReport ? this_1.clonedReport.fieldMapping : this_1.fieldMapping);
1375
+ var caption_2 = field.caption ? field.caption : fieldName;
1583
1376
  while (gCnt--) {
1584
1377
  groupField = groupFields[groupKeys[gCnt]];
1585
1378
  for (var i = 0, len_3 = this_1.formats.length; i < len_3; i++) {
@@ -1598,6 +1391,33 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
1598
1391
  };
1599
1392
  this_1.formats.push(formatSettings);
1600
1393
  }
1394
+ if (!isDataSource) {
1395
+ var mappingField = this_1.getMappingField(groupKeys[gCnt], this_1.fieldMapping);
1396
+ if (groupKeys[gCnt] !== fieldName && isNullOrUndefined(mappingField.name)) {
1397
+ var newField = {
1398
+ name: groupKeys[gCnt],
1399
+ caption: (this_1.localeObj ? this_1.localeObj.getConstant(groupField) : groupField) + ' (' + caption_2 + ')'
1400
+ };
1401
+ this_1.fieldMapping.push(newField);
1402
+ }
1403
+ else if (groupKeys[gCnt] !== fieldName) {
1404
+ mappingField.caption = (this_1.localeObj ? this_1.localeObj.getConstant(groupField) : groupField) + ' (' + caption_2 + ')';
1405
+ }
1406
+ }
1407
+ }
1408
+ if (!isDataSource) {
1409
+ var mappingField = this_1.getMappingField(fieldName, this_1.fieldMapping);
1410
+ groupField = groupFields[fieldName];
1411
+ if (groupKeys[gCnt] !== fieldName && isNullOrUndefined(mappingField.name)) {
1412
+ var newField = {
1413
+ name: fieldName,
1414
+ caption: (this_1.localeObj ? this_1.localeObj.getConstant(groupField) : groupField) + ' (' + caption_2 + ')'
1415
+ };
1416
+ this_1.fieldMapping.push(newField);
1417
+ }
1418
+ else {
1419
+ mappingField.caption = (this_1.localeObj ? this_1.localeObj.getConstant(groupField) : groupField) + ' (' + caption_2 + ')';
1420
+ }
1601
1421
  }
1602
1422
  }
1603
1423
  else if (group.type === 'Number' && group.rangeInterval) {
@@ -1846,7 +1666,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
1846
1666
  this.fieldList = this.savedFieldList;
1847
1667
  while (len--) { /** while is used for better performance than for */
1848
1668
  var key = keys[len];
1849
- var field = this.getMappingField(key);
1669
+ var field = this.getMappingField(key, this.fieldMapping);
1850
1670
  if (this.fieldList[key]) {
1851
1671
  this.fieldList[key].isSelected = false;
1852
1672
  this.fieldList[key].index = len;
@@ -1925,7 +1745,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
1925
1745
  this.fieldList = {};
1926
1746
  while (len--) { /** while is used for better performance than for */
1927
1747
  var key = keys[len];
1928
- var field = this.getMappingField(key);
1748
+ var field = this.getMappingField(key, this.fieldMapping);
1929
1749
  type = (field && 'dataType' in field && field.dataType && dataTypes.indexOf(field.dataType.toLowerCase()) > -1) ?
1930
1750
  field.dataType.toLowerCase() : PivotUtil.getType(fields[this.fieldKeys[key]]);
1931
1751
  this.fieldList[key] = {
@@ -1969,12 +1789,12 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
1969
1789
  }
1970
1790
  this.updateTreeViewData(dataFields);
1971
1791
  };
1972
- PivotEngine.prototype.getMappingField = function (key) {
1792
+ PivotEngine.prototype.getMappingField = function (key, fieldMapping) {
1973
1793
  var field = {};
1974
- if (this.fieldMapping.length > 0) {
1975
- for (var index = 0, cnt = this.fieldMapping.length; index < cnt; index++) {
1976
- if (this.fieldMapping[index].name === key) {
1977
- field = this.fieldMapping[index];
1794
+ if (fieldMapping.length > 0) {
1795
+ for (var index = 0, cnt = fieldMapping.length; index < cnt; index++) {
1796
+ if (fieldMapping[index].name === key) {
1797
+ field = fieldMapping[index];
1978
1798
  break;
1979
1799
  }
1980
1800
  }
@@ -2548,8 +2368,8 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
2548
2368
  field.filter = filter;
2549
2369
  field.filterType = type;
2550
2370
  field.isExcelFilter = isLabelFilter;
2551
- var members = (this.formatFields[name] &&
2552
- (['date', 'dateTime', 'time'].indexOf(this.formatFields[name].type) > -1)) ?
2371
+ var members = ((this.formatFields[name] &&
2372
+ (['date', 'dateTime', 'time'].indexOf(this.formatFields[name].type) > -1)) || (name in this.groupingFields)) ?
2553
2373
  field.formattedMembers : field.members;
2554
2374
  var allowFil = isInclude;
2555
2375
  var final = {};
@@ -2596,7 +2416,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
2596
2416
  };
2597
2417
  PivotEngine.prototype.applyValueFiltering = function (rowData, level, rows, columns, valueFilter, rowFilterData, type) {
2598
2418
  this.isValueFiltered = false;
2599
- var allMember = extend({}, (type === 'row' && this.rowGrandTotal ? this.rowGrandTotal : type === 'column' && this.columnGrandTotal ? this.columnGrandTotal : rows[rows.length - 1]), null, true);
2419
+ var 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);
2600
2420
  this.getFilteredData(rows, columns, valueFilter, rowFilterData, level, rowData.name, allMember, type);
2601
2421
  if (this.isValueFiltered) {
2602
2422
  if ((type === 'row' && this.rowGrandTotal === null) || (type === 'column' && this.columnGrandTotal === null)) {
@@ -2942,14 +2762,14 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
2942
2762
  for (var i = 0; i < rLen; i++) {
2943
2763
  if (filterElement.name === rows[i].name && valueFields[filterElement.measure] && !isAvail) {
2944
2764
  isAvail = true;
2945
- rowFilteredData = this.applyValueFiltering(rows[i], i, rowHeaders, (this.columnGrandTotal ? this.columnGrandTotal : columnHeaders[columnHeaders.length - 1]), valueFilters, this.valueFilteredData, 'row');
2765
+ 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');
2946
2766
  break;
2947
2767
  }
2948
2768
  }
2949
2769
  for (var j = 0; j < cLen; j++) {
2950
2770
  if (filterElement.name === columns[j].name && valueFields[filterElement.measure] && !isAvail) {
2951
2771
  isAvail = true;
2952
- columnFilteredData = this.applyValueFiltering(columns[j], j, columnHeaders, (this.rowGrandTotal ? this.rowGrandTotal : rowHeaders[rowHeaders.length - 1]), valueFilters, this.valueFilteredData, 'column');
2772
+ 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');
2953
2773
  break;
2954
2774
  }
2955
2775
  }
@@ -3260,7 +3080,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
3260
3080
  }
3261
3081
  var engine = this;
3262
3082
  return headers.filter(function (item) {
3263
- return item.members.length > 0 ? item.members.length > 0 : engine.matchIndexes(item.indexObject, filterObjects);
3083
+ return (item.members.length > 0 || item.type === 'grand sum') ? true : engine.matchIndexes(item.indexObject, filterObjects);
3264
3084
  });
3265
3085
  };
3266
3086
  PivotEngine.prototype.matchIndexes = function (index, filterObjects) {
@@ -3340,6 +3160,14 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
3340
3160
  }
3341
3161
  /* eslint-enable */
3342
3162
  rawHeaders = this.getSortedHeaders(rawHeaders.concat(excessHeaders), this.fieldList[headersInfo.fields[0].name].sort).concat(grandHeader);
3163
+ if (headersInfo.axis === 'row') {
3164
+ this.cMembers = this.getIndexedHeaders(this.columns, this.data, 0, this.filterMembers, 'column', '');
3165
+ this.insertAllMember(this.cMembers, this.filterMembers, '', 'column');
3166
+ }
3167
+ else {
3168
+ this.rMembers = this.getIndexedHeaders(this.rows, this.data, 0, this.filterMembers, 'row', '');
3169
+ this.insertAllMember(this.rMembers, this.filterMembers, '', 'row');
3170
+ }
3343
3171
  }
3344
3172
  if (headersInfo.axis === 'row') {
3345
3173
  this.rowCount = 0;
@@ -3485,8 +3313,8 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
3485
3313
  }
3486
3314
  }
3487
3315
  if (stringValue.length > 0) {
3488
- stringValue = childrens.sort === 'Ascending' ? (stringValue.sort(function (a, b) { return (a.actualText > b.actualText) ? 1 : ((b.actualText > a.actualText) ? -1 : 0); })) :
3489
- childrens.sort === 'Descending' ? (stringValue.sort(function (a, b) { return (a.actualText < b.actualText) ? 1 : ((b.actualText < a.actualText) ? -1 : 0); })) : stringValue;
3316
+ stringValue = childrens.sort === 'Ascending' ? (stringValue.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)); })) :
3317
+ childrens.sort === 'Descending' ? (stringValue.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)); })) : stringValue;
3490
3318
  }
3491
3319
  if (alphaNumbervalue.length > 0) {
3492
3320
  alphaNumbervalue = childrens.sort === 'Ascending' ?
@@ -3499,9 +3327,9 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
3499
3327
  }
3500
3328
  else {
3501
3329
  return sortOrder === 'Ascending' ?
3502
- (headers.sort(function (a, b) { return (a.actualText > b.actualText) ? 1 : ((b.actualText > a.actualText) ? -1 : 0); })) :
3330
+ (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)); })) :
3503
3331
  sortOrder === 'Descending' ?
3504
- (headers.sort(function (a, b) { return (a.actualText < b.actualText) ? 1 : ((b.actualText < a.actualText) ? -1 : 0); })) :
3332
+ (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)); })) :
3505
3333
  headers;
3506
3334
  }
3507
3335
  }
@@ -3521,7 +3349,8 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
3521
3349
  this.valueSortHeaderText = undefined;
3522
3350
  if (this.enableValueSorting && this.valueSortSettings.headerText && !this.valueSortHeaderText &&
3523
3351
  this.valueSortSettings.headerText !== '' && this.values.length > 0) {
3524
- var textArray = this.valueSortSettings.headerText.split(this.valueSortSettings.headerDelimiter);
3352
+ this.valueSortHeaderText = this.valueSortSettings.headerText;
3353
+ var textArray = this.valueSortHeaderText.split(this.valueSortSettings.headerDelimiter);
3525
3354
  for (var _i = 0, _a = this.values; _i < _a.length; _i++) {
3526
3355
  var field = _a[_i];
3527
3356
  var name_1 = field.caption ? field.caption : field.name;
@@ -4169,6 +3998,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
4169
3998
  var summCell = headers[headers.length - 1];
4170
3999
  if (summCell && summCell.type === 'grand sum') {
4171
4000
  summCell.index = this.filterMembers;
4001
+ summCell.indexObject = {};
4172
4002
  /* eslint-disable */
4173
4003
  for (var ln = 0, lt_1 = this.filterMembers.length; ln < lt_1; ln++) {
4174
4004
  summCell.indexObject[this.filterMembers[ln]] = this.filterMembers[ln];
@@ -4310,7 +4140,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
4310
4140
  PivotEngine.prototype.insertAllMember = function (set, filter, customText, axis) {
4311
4141
  var len = set.length;
4312
4142
  customText = ' Total';
4313
- set[len] = {
4143
+ var grandTotalSet = {
4314
4144
  hasChild: false,
4315
4145
  index: filter,
4316
4146
  level: 0,
@@ -4324,13 +4154,14 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
4324
4154
  type: 'grand sum',
4325
4155
  valueSort: {}
4326
4156
  };
4327
- set[len].valueSort[set[len].formattedText] = 1;
4328
- set[len].valueSort.levelName = set[len].formattedText;
4329
- set[len].valueSort[set[len].actualText] = 1;
4330
- set[len].valueSort.uniqueName = set[len].actualText;
4157
+ grandTotalSet.valueSort[grandTotalSet.formattedText] = 1;
4158
+ grandTotalSet.valueSort.levelName = grandTotalSet.formattedText;
4159
+ grandTotalSet.valueSort[grandTotalSet.actualText] = 1;
4160
+ grandTotalSet.valueSort.uniqueName = grandTotalSet.actualText;
4331
4161
  for (var ln = 0, lt = filter.length; ln < lt; ln++) {
4332
- set[len].indexObject[filter[ln]] = filter[ln];
4162
+ grandTotalSet.indexObject[filter[ln]] = filter[ln];
4333
4163
  }
4164
+ (this.dataSourceSettings.grandTotalsPosition === 'Top' && this.dataSourceSettings.showGrandTotals) ? set.unshift(grandTotalSet) : set.push(grandTotalSet);
4334
4165
  // if (axis === 'row') {
4335
4166
  // this.rowCount += this.rowValuesLength;
4336
4167
  // } else {
@@ -4349,10 +4180,11 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
4349
4180
  row.colIndex = 0;
4350
4181
  row.rowIndex = tnum;
4351
4182
  var isRowFieldsAvail = false;
4183
+ var delimiter = this.dataSourceSettings.valueSortSettings.headerDelimiter;
4352
4184
  if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && this.dataSourceSettings.values.length > 1) {
4353
4185
  this.rowIndex = (isNullOrUndefined(this.rowIndex) && !isLeastNode && this.dataSourceSettings.rows.length === 0) ? row.index : this.rowIndex;
4354
- isRowFieldsAvail = (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total.') !== 0);
4355
- if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total.') === 0) {
4186
+ isRowFieldsAvail = (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName && row.valueSort.levelName.toString().indexOf('Grand Total' + delimiter) !== 0);
4187
+ if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total' + delimiter) === 0) {
4356
4188
  row.index = this.rowIndex;
4357
4189
  }
4358
4190
  }
@@ -4377,7 +4209,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
4377
4209
  for (var cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
4378
4210
  if (!isValueIndexFound) {
4379
4211
  for (vln = 0; vln < vlt; vln++) {
4380
- if (row.valueSort.uniqueName && row.valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(this.values[vln].name) > -1) {
4212
+ if (row.valueSort.uniqueName && row.valueSort.uniqueName.toString().indexOf(this.values[vln].name) > -1) {
4381
4213
  isValueIndexFound = true;
4382
4214
  isValueCellUpdated = true;
4383
4215
  break;
@@ -4412,7 +4244,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
4412
4244
  for (var cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
4413
4245
  for (var vln = 0; vln < vlt; vln++) {
4414
4246
  if (!this.valueAxis && !this.isLastHeaderHasMeasures) {
4415
- if (columns[cln].valueSort.uniqueName && columns[cln].valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(this.values[vln].name) > -1) {
4247
+ if (columns[cln].valueSort.uniqueName && columns[cln].valueSort.uniqueName.toString().indexOf(this.values[vln].name) > -1) {
4416
4248
  this.updateRowData(rows, columns, tnum, data, vln, rln, cln, dln, actCnt, rTotal, cTotal);
4417
4249
  dln = data[tnum].length;
4418
4250
  }
@@ -5369,6 +5201,10 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5369
5201
  this.updateValueMembers(this.measureIndex === 0 && axis.length > 1, null, null, columnHeaders, axis.slice(0, axis.length - 1), vcnt, 0);
5370
5202
  this.updateValueMembers(false, null, null, columnHeaders, axis.slice(axis.length - 1, axis.length), vcnt, -1);
5371
5203
  }
5204
+ else if (this.grandTotalsPosition === 'Top' && this.showGrandTotals && this.measureIndex === 0) {
5205
+ this.updateValueMembers(false, null, null, columnHeaders, axis.slice(0, 1), vcnt, -1);
5206
+ this.updateValueMembers(this.measureIndex === 0 && axis.length > 1, null, null, columnHeaders, axis.slice(1, axis.length), vcnt, 0);
5207
+ }
5372
5208
  else {
5373
5209
  var hasColumnTotal = columns.length === 0 && axis.length === 1 && axis[0].type == 'grand sum';
5374
5210
  this.updateValueMembers(!hasColumnTotal && this.measureIndex === 0, null, null, columnHeaders, axis, vcnt, hasColumnTotal ? -1 : 0);
@@ -5409,6 +5245,10 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5409
5245
  this.updateValueMembers(this.measureIndex == 0 && this.rMembers.length > 1, null, null, rowAxis, this.rMembers.slice(0, this.rMembers.length - 1), this.values.length, 0);
5410
5246
  this.updateValueMembers(false, null, null, rowAxis, this.rMembers.slice(this.rMembers.length - 1, this.rMembers.length), this.values.length, -1);
5411
5247
  }
5248
+ else if (this.grandTotalsPosition === 'Top' && this.showGrandTotals && this.measureIndex === 0) {
5249
+ this.updateValueMembers(false, null, null, rowAxis, this.rMembers.slice(0, 1), this.values.length, -1);
5250
+ this.updateValueMembers(this.measureIndex == 0 && this.rMembers.length > 1, null, null, rowAxis, this.rMembers.slice(1, this.rMembers.length), this.values.length, 0);
5251
+ }
5412
5252
  else {
5413
5253
  var hasRowTotal = rows.length === 0 && this.rMembers.length === 1 && this.rMembers[0].type == 'grand sum';
5414
5254
  this.updateValueMembers(!hasRowTotal && this.measureIndex == 0, null, null, rowAxis, this.rMembers, this.values.length, hasRowTotal ? -1 : 0);
@@ -6014,6 +5854,12 @@ var fieldDragStart = 'fieldDragStart';
6014
5854
  var chartPointClick = 'chartPointClick';
6015
5855
  /** @hidden */
6016
5856
  var beforeServiceInvoke = 'beforeServiceInvoke';
5857
+ /** @hidden */
5858
+ var actionBegin = 'actionBegin';
5859
+ /** @hidden */
5860
+ var actionComplete = 'actionComplete';
5861
+ /** @hidden */
5862
+ var actionFailure = 'actionFailure';
6017
5863
  /**
6018
5864
  * Specifies pivot internal events
6019
5865
  */
@@ -6043,6 +5889,186 @@ var initToolbar = 'init-toolbar';
6043
5889
  var initFormatting = 'init-formatting';
6044
5890
  /** @hidden */
6045
5891
  var initGrouping = 'init-grouping';
5892
+ /**
5893
+ * Specifies action names of actionBegin events
5894
+ */
5895
+ /** @hidden */
5896
+ var sortValue = 'Sort value';
5897
+ /** @hidden */
5898
+ var drillUp = 'Drill up';
5899
+ /** @hidden */
5900
+ var drillDown = 'Drill down';
5901
+ /** @hidden */
5902
+ var addNewReport = 'Add new report';
5903
+ /** @hidden */
5904
+ var saveCurrentReport = 'Save current report';
5905
+ /** @hidden */
5906
+ var saveAsCurrentReport = 'Save as current report';
5907
+ /** @hidden */
5908
+ var renameCurrentReport = 'Rename current report';
5909
+ /** @hidden */
5910
+ var removeCurrentReport = 'Remove current report';
5911
+ /** @hidden */
5912
+ var loadReports = 'Load report';
5913
+ /** @hidden */
5914
+ var openConditionalFormatting = 'Open conditional formatting dialog';
5915
+ /** @hidden */
5916
+ var openNumberFormatting = 'Open number formatting dialog';
5917
+ /** @hidden */
5918
+ var MdxQuery = 'MdxQuery';
5919
+ /** @hidden */
5920
+ var showFieldList = 'Open field list';
5921
+ /** @hidden */
5922
+ var tableView = 'Show table view';
5923
+ /** @hidden */
5924
+ var chartView = 'Show chart view';
5925
+ /** @hidden */
5926
+ var multipleAxis = 'Multiple Axis';
5927
+ /** @hidden */
5928
+ var showLegend = 'Show legend';
5929
+ /** @hidden */
5930
+ var pdfExport = 'PDF export';
5931
+ /** @hidden */
5932
+ var pngExport = 'PNG export';
5933
+ /** @hidden */
5934
+ var excelExport = 'Excel export';
5935
+ /** @hidden */
5936
+ var csvExport = 'CSV export';
5937
+ /** @hidden */
5938
+ var jpegExport = 'JPEG export';
5939
+ /** @hidden */
5940
+ var svgExport = 'SVG export';
5941
+ /** @hidden */
5942
+ var hideSubTotals = 'Hide sub-totals';
5943
+ /** @hidden */
5944
+ var subTotalsRow = 'Show row sub-totals';
5945
+ /** @hidden */
5946
+ var subTotalsColumn = 'Show column sub-totals';
5947
+ /** @hidden */
5948
+ var showSubTotals = 'Show sub-totals';
5949
+ /** @hidden */
5950
+ var hideGrandTotals = 'Hide grand totals';
5951
+ /** @hidden */
5952
+ var grandTotalsRow = 'Show row grand totals';
5953
+ /** @hidden */
5954
+ var grandTotalsColumn = 'Show column grand totals';
5955
+ /** @hidden */
5956
+ var showGrandTotals = 'Show grand totals';
5957
+ /** @hidden */
5958
+ var numberFormattingMenu = 'Number Formatting menu';
5959
+ /** @hidden */
5960
+ var conditionalFormattingMenu = 'Conditional Formatting menu';
5961
+ /** @hidden */
5962
+ var reportChange = 'Report change';
5963
+ /** @hidden */
5964
+ var sortFieldTree = 'Sort field tree';
5965
+ /** @hidden */
5966
+ var editCalculatedField = 'Edit calculated field';
5967
+ /** @hidden */
5968
+ var sortField = 'Sort field';
5969
+ /** @hidden */
5970
+ var filterField = 'Filter field';
5971
+ /** @hidden */
5972
+ var removeField = 'Remove field';
5973
+ /** @hidden */
5974
+ var openCalculatedField = 'Open calculated field dialog';
5975
+ /** @hidden */
5976
+ var editRecord = 'Edit record';
5977
+ /** @hidden */
5978
+ var saveEditedRecords = 'Save edited records';
5979
+ /** @hidden */
5980
+ var addNewRecord = 'Add new record';
5981
+ /** @hidden */
5982
+ var removeRecord = 'Remove record';
5983
+ /** @hidden */
5984
+ var aggregateField = 'Aggregate field';
5985
+ /** @hidden */
5986
+ var contextMenuCalculatedField = 'CalculatedField Context menu';
5987
+ /** @hidden */
5988
+ var windowResize = 'Window resize';
5989
+ /**
5990
+ * Specifies action names of actionComplete events
5991
+ */
5992
+ /** @hidden */
5993
+ var calculatedFieldApplied = 'Calculated field applied';
5994
+ /** @hidden */
5995
+ var editedRecordsSaved = 'Edited records saved';
5996
+ /** @hidden */
5997
+ var newRecordAdded = 'New record added';
5998
+ /** @hidden */
5999
+ var recordRemoved = 'Record removed';
6000
+ /** @hidden */
6001
+ var closeFieldlist = 'Field list closed';
6002
+ /** @hidden */
6003
+ var fieldTreeSorted = 'Field tree sorted';
6004
+ /** @hidden */
6005
+ var reportSaved = 'Report saved';
6006
+ /** @hidden */
6007
+ var newReportAdded = 'New report added';
6008
+ /** @hidden */
6009
+ var reportReSaved = 'Report re-saved';
6010
+ /** @hidden */
6011
+ var reportRenamed = 'Report renamed';
6012
+ /** @hidden */
6013
+ var reportRemoved = 'Report removed';
6014
+ /** @hidden */
6015
+ var excelExported = 'Excel exported';
6016
+ /** @hidden */
6017
+ var csvExported = 'CSV exported';
6018
+ /** @hidden */
6019
+ var pdfExported = 'PDF exported';
6020
+ /** @hidden */
6021
+ var pngExported = 'PNG exported';
6022
+ /** @hidden */
6023
+ var jpegExported = 'JPEG exported';
6024
+ /** @hidden */
6025
+ var svgExported = 'SVG exported';
6026
+ /** @hidden */
6027
+ var conditionallyFormatted = 'Conditional formatting applied';
6028
+ /** @hidden */
6029
+ var numberFormatted = 'Number formatting applied';
6030
+ /** @hidden */
6031
+ var tableViewed = 'Table view shown';
6032
+ /** @hidden */
6033
+ var chartViewed = 'Chart view shown';
6034
+ /** @hidden */
6035
+ var subTotalsHidden = 'Sub-totals hidden';
6036
+ /** @hidden */
6037
+ var subTotalsRowShown = 'Row sub-totals shown';
6038
+ /** @hidden */
6039
+ var subTotalsColumnShown = 'Column sub-totals shown';
6040
+ /** @hidden */
6041
+ var subTotalsShown = 'Sub-totals shown';
6042
+ /** @hidden */
6043
+ var grandTotalsHidden = 'Grand totals hidden';
6044
+ /** @hidden */
6045
+ var grandTotalsRowShown = 'Row grand totals shown';
6046
+ /** @hidden */
6047
+ var grandTotalsColumnShown = 'Column grand totals shown';
6048
+ /** @hidden */
6049
+ var grandTotalsShown = 'Grand totals shown';
6050
+ /** @hidden */
6051
+ var valueSorted = 'Value sorted';
6052
+ /** @hidden */
6053
+ var calculatedFieldEdited = 'Calculated field edited';
6054
+ /** @hidden */
6055
+ var fieldSorted = 'Field sorted';
6056
+ /** @hidden */
6057
+ var fieldFiltered = 'Field filtered';
6058
+ /** @hidden */
6059
+ var fieldRemoved = 'Field removed';
6060
+ /** @hidden */
6061
+ var fieldAggregated = 'Field aggregated';
6062
+ /** @hidden */
6063
+ var recordEdited = 'Record edited';
6064
+ /** @hidden */
6065
+ var reportChanged = 'Report changed';
6066
+ /** @hidden */
6067
+ var windowResized = 'Window resized';
6068
+ /** @hidden */
6069
+ var recordUpdated = 'Records updated';
6070
+ /** @hidden */
6071
+ var drillThroughClosed = 'Drill-through closed';
6046
6072
 
6047
6073
  /**
6048
6074
  * CSS Constants
@@ -6716,6 +6742,8 @@ var PIVOTCHART_TYPE_DIALOG = 'e-pivotchart-type-dialog';
6716
6742
  var FORMAT_FONT_COLOR_PICKER = 'e-format-font-color-picker';
6717
6743
  /** @hidden */
6718
6744
  var GROUP_PIVOT_ROW = 'e-group-pivot-rows';
6745
+ /** @hidden */
6746
+ var TOOLBAR_MENU = 'e-pivot-toolbar-menu';
6719
6747
 
6720
6748
  /**
6721
6749
  * `AggregateMenu` module to create aggregate type popup.
@@ -6745,28 +6773,39 @@ var AggregateMenu = /** @__PURE__ @class */ (function () {
6745
6773
  AggregateMenu.prototype.openContextMenu = function (args) {
6746
6774
  var _this = this;
6747
6775
  var fieldName = args.target.parentElement.id;
6776
+ var fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
6748
6777
  this.buttonElement = args.target.parentElement;
6749
6778
  var isStringField = this.parent.engineModule.fieldList[fieldName].type !== 'number' ? 1 : 0;
6750
6779
  this.summaryTypes = this.getMenuItem(isStringField).slice();
6780
+ this.parent.actionObj.actionName = aggregateField;
6781
+ this.parent.actionObj.fieldInfo = fieldInfo.fieldItem;
6782
+ if (this.parent.actionBeginMethod()) {
6783
+ return;
6784
+ }
6751
6785
  var eventArgs = {
6752
6786
  cancel: false, fieldName: fieldName, aggregateTypes: this.summaryTypes, displayMenuCount: 7
6753
6787
  };
6754
6788
  var control = this.parent.getModuleName() === 'pivotfieldlist' && this.parent.isPopupView ?
6755
6789
  this.parent.pivotGridModule : this.parent;
6756
- control.trigger(aggregateMenuOpen, eventArgs, function (observedArgs) {
6757
- if (!observedArgs.cancel) {
6758
- _this.summaryTypes = observedArgs.aggregateTypes;
6759
- _this.createContextMenu(isStringField, observedArgs.displayMenuCount);
6760
- _this.currentMenu = args.target;
6761
- var pos = _this.currentMenu.getBoundingClientRect();
6762
- if (_this.parent.enableRtl) {
6763
- _this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left - 105);
6764
- }
6765
- else {
6766
- _this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left);
6790
+ try {
6791
+ control.trigger(aggregateMenuOpen, eventArgs, function (observedArgs) {
6792
+ if (!observedArgs.cancel) {
6793
+ _this.summaryTypes = observedArgs.aggregateTypes;
6794
+ _this.createContextMenu(isStringField, observedArgs.displayMenuCount);
6795
+ _this.currentMenu = args.target;
6796
+ var pos = _this.currentMenu.getBoundingClientRect();
6797
+ if (_this.parent.enableRtl) {
6798
+ _this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left - 105);
6799
+ }
6800
+ else {
6801
+ _this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left);
6802
+ }
6767
6803
  }
6768
- }
6769
- });
6804
+ });
6805
+ }
6806
+ catch (execption) {
6807
+ this.parent.actionFailureMethod(execption);
6808
+ }
6770
6809
  };
6771
6810
  AggregateMenu.prototype.createContextMenu = function (isStringField, displayMenuCount) {
6772
6811
  var _this = this;
@@ -7043,31 +7082,42 @@ var AggregateMenu = /** @__PURE__ @class */ (function () {
7043
7082
  AggregateMenu.prototype.selectOptionInContextMenu = function (menu) {
7044
7083
  if (menu.item.text !== null) {
7045
7084
  var buttonElement = this.currentMenu.parentElement;
7046
- var type = menu.item.id.split('_').pop();
7047
- if (type === 'MoreOption' || type === 'PercentageOfDifferenceFrom'
7048
- || type === 'PercentageOfParentTotal' || type === 'DifferenceFrom') {
7049
- this.createValueSettingsDialog(buttonElement, this.parentElement, type);
7085
+ var fieldInfo = PivotUtil.getFieldInfo((buttonElement ? buttonElement.id : ''), this.parent);
7086
+ this.parent.actionObj.actionName = aggregateField;
7087
+ this.parent.actionObj.fieldInfo = fieldInfo.fieldItem;
7088
+ if (this.parent.actionBeginMethod()) {
7089
+ return;
7050
7090
  }
7051
- else {
7052
- var field = buttonElement.getAttribute('data-uid');
7053
- var valuefields = this.parent.dataSourceSettings.values;
7054
- var contentElement = buttonElement.querySelector('.e-content');
7055
- var captionName = menu.item.text + ' ' + this.parent.localeObj.getConstant('of') + ' ' +
7056
- this.parent.engineModule.fieldList[field].caption;
7057
- contentElement.innerHTML = captionName;
7058
- contentElement.setAttribute('title', captionName);
7059
- buttonElement.setAttribute('data-type', type);
7060
- for (var vCnt = 0; vCnt < this.parent.dataSourceSettings.values.length; vCnt++) {
7061
- if (this.parent.dataSourceSettings.values[vCnt].name === field) {
7062
- var dataSourceItem = extend({}, valuefields[vCnt].properties ?
7063
- valuefields[vCnt].properties : valuefields[vCnt], null, true);
7064
- dataSourceItem.type = type;
7065
- this.parent.engineModule.fieldList[field].aggregateType = type;
7066
- valuefields.splice(vCnt, 1, dataSourceItem);
7067
- this.parent.lastAggregationInfo = dataSourceItem;
7091
+ var type = menu.item.id.split('_').pop();
7092
+ try {
7093
+ if (type === 'MoreOption' || type === 'PercentageOfDifferenceFrom'
7094
+ || type === 'PercentageOfParentTotal' || type === 'DifferenceFrom') {
7095
+ this.createValueSettingsDialog(buttonElement, this.parentElement, type);
7096
+ }
7097
+ else {
7098
+ var field = buttonElement.getAttribute('data-uid');
7099
+ var valuefields = this.parent.dataSourceSettings.values;
7100
+ var contentElement = buttonElement.querySelector('.e-content');
7101
+ var captionName = menu.item.text + ' ' + this.parent.localeObj.getConstant('of') + ' ' +
7102
+ this.parent.engineModule.fieldList[field].caption;
7103
+ contentElement.innerHTML = captionName;
7104
+ contentElement.setAttribute('title', captionName);
7105
+ buttonElement.setAttribute('data-type', type);
7106
+ for (var vCnt = 0; vCnt < this.parent.dataSourceSettings.values.length; vCnt++) {
7107
+ if (this.parent.dataSourceSettings.values[vCnt].name === field) {
7108
+ var dataSourceItem = extend({}, valuefields[vCnt].properties ?
7109
+ valuefields[vCnt].properties : valuefields[vCnt], null, true);
7110
+ dataSourceItem.type = type;
7111
+ this.parent.engineModule.fieldList[field].aggregateType = type;
7112
+ valuefields.splice(vCnt, 1, dataSourceItem);
7113
+ this.parent.lastAggregationInfo = dataSourceItem;
7114
+ }
7068
7115
  }
7116
+ this.updateDataSource();
7069
7117
  }
7070
- this.updateDataSource();
7118
+ }
7119
+ catch (execption) {
7120
+ this.parent.actionFailureMethod(execption);
7071
7121
  }
7072
7122
  }
7073
7123
  };
@@ -7184,13 +7234,16 @@ var Render = /** @__PURE__ @class */ (function () {
7184
7234
  this.resColWidth = (this.parent.showGroupingBar && this.parent.groupingBarModule) ? (this.parent.isAdaptive ? 180 : 250) :
7185
7235
  (this.parent.isAdaptive ? 140 : 200);
7186
7236
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
7187
- this.gridSettings = parent.gridSettings;
7237
+ this.gridSettings = this.parent.gridSettings;
7188
7238
  this.formatList = this.getFormatList();
7189
7239
  this.aggMenu = new AggregateMenu(this.parent);
7190
7240
  }
7191
7241
  /* eslint-disable-next-line */
7192
7242
  /** @hidden */
7193
- Render.prototype.render = function () {
7243
+ Render.prototype.render = function (refreshRequired) {
7244
+ if (refreshRequired) {
7245
+ this.initProperties();
7246
+ }
7194
7247
  this.resColWidth = (this.parent.showGroupingBar && this.parent.groupingBarModule) ? (this.parent.isAdaptive ? 180 : 250) :
7195
7248
  (this.parent.isAdaptive ? 140 : 200);
7196
7249
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
@@ -7254,6 +7307,30 @@ var Render = /** @__PURE__ @class */ (function () {
7254
7307
  }
7255
7308
  this.parent.grid.on(headerRefreshed, this.refreshHeader, this);
7256
7309
  };
7310
+ Render.prototype.initProperties = function () {
7311
+ this.rowStartPos = undefined;
7312
+ this.maxIndent = undefined;
7313
+ this.resColWidth = undefined;
7314
+ this.isOverflows = undefined;
7315
+ this.indentCollection = {};
7316
+ this.formatList = undefined;
7317
+ this.colPos = 0;
7318
+ this.colGrandPos = undefined;
7319
+ this.rowGrandPos = undefined;
7320
+ this.lastSpan = 0;
7321
+ this.field = undefined;
7322
+ this.fieldCaption = undefined;
7323
+ this.lvlCollection = {};
7324
+ this.hierarchyCollection = {};
7325
+ this.lvlPosCollection = {};
7326
+ this.hierarchyPosCollection = {};
7327
+ this.position = 0;
7328
+ this.measurePos = 0;
7329
+ this.maxMeasurePos = 0;
7330
+ this.hierarchyCount = 0;
7331
+ this.actualText = '';
7332
+ this.timeOutObj = undefined;
7333
+ };
7257
7334
  Render.prototype.refreshHeader = function () {
7258
7335
  if (this.parent.enableVirtualization) {
7259
7336
  var mHdr = this.parent.element.querySelector('.' + MOVABLEHEADER_DIV);
@@ -7455,9 +7532,9 @@ var Render = /** @__PURE__ @class */ (function () {
7455
7532
  this.parent.renderReactTemplates(); /* eslint-disable-line */
7456
7533
  }
7457
7534
  if (this.parent.isInitial) {
7535
+ this.parent.isInitial = false;
7458
7536
  this.parent.refreshData();
7459
7537
  }
7460
- this.parent.isInitial = false;
7461
7538
  this.parent.notify(contentReady, {});
7462
7539
  };
7463
7540
  Render.prototype.setFocusOnLastCell = function () {
@@ -8273,7 +8350,7 @@ var Render = /** @__PURE__ @class */ (function () {
8273
8350
  if (cell.isSum) {
8274
8351
  tCell.classList.add(SUMMARY);
8275
8352
  }
8276
- var isGrandSum = (isNullOrUndefined(cell.isGrandSum) && this.parent.dataSourceSettings.valueAxis === 'column' && this.parent.dataType === 'olap' &&
8353
+ var isGrandSum = (isNullOrUndefined(cell.isGrandSum) && (!isNullOrUndefined(this.parent.olapEngineModule) && this.parent.olapEngineModule.olapValueAxis === 'column') && this.parent.dataType === 'olap' &&
8277
8354
  ((this.colGrandPos - this.parent.dataSourceSettings.values.length) < Number(tCell.getAttribute('aria-colindex'))));
8278
8355
  if (cell.isGrandSum || (isGrandSum || this.colGrandPos === Number(tCell.getAttribute('aria-colindex'))) || this.rowGrandPos === Number(tCell.getAttribute('index'))) {
8279
8356
  tCell.classList.add('e-gtot');
@@ -8414,6 +8491,12 @@ var Render = /** @__PURE__ @class */ (function () {
8414
8491
  }
8415
8492
  lvlPos++;
8416
8493
  }
8494
+ if (this.parent.dataSourceSettings.grandTotalsPosition === 'Top' && (!isNullOrUndefined(this.parent.olapEngineModule) && this.parent.olapEngineModule.olapValueAxis === 'row') && this.parent.dataType === 'olap' &&
8495
+ (cell.valueSort.levelName.toString()).indexOf(this.parent.localeObj.getConstant('grandTotal') + this.parent.dataSourceSettings.valueSortSettings.headerDelimiter) === 0) {
8496
+ tCell.appendChild(createElement('span', {
8497
+ className: NEXTSPAN,
8498
+ }));
8499
+ }
8417
8500
  if (cell.memberType === 3 && cell.level === -1 && Object.keys(this.lvlCollection).length > 1) {
8418
8501
  tCell.appendChild(createElement('span', {
8419
8502
  className: NEXTSPAN,
@@ -8726,8 +8809,8 @@ var Render = /** @__PURE__ @class */ (function () {
8726
8809
  if (this.parent.currentView !== 'Chart') {
8727
8810
  if (this.gridSettings.height === 'auto' && parHeight && this.parent.element.querySelector('.' + GRID_HEADER)) {
8728
8811
  var rowColHeight = this.parent.element.querySelector('.' + GRID_HEADER).offsetHeight;
8729
- var gBarHeight = rowColHeight + (this.parent.element.querySelector('.' + GROUPING_BAR_CLASS) ?
8730
- this.parent.element.querySelector('.' + GROUPING_BAR_CLASS).offsetHeight : 0);
8812
+ var gBarHeight = rowColHeight + (this.parent.element.querySelector('.' + GRID_GROUPING_BAR_CLASS) ?
8813
+ this.parent.element.querySelector('.' + GRID_GROUPING_BAR_CLASS).offsetHeight : 0);
8731
8814
  var toolBarHeight = this.parent.element.querySelector('.' + GRID_TOOLBAR) ? 42 : 0;
8732
8815
  gridHeight = parHeight - (gBarHeight + toolBarHeight) - 1;
8733
8816
  gridHeight = gridHeight < 40 ? 40 : gridHeight;
@@ -8939,7 +9022,7 @@ var Render = /** @__PURE__ @class */ (function () {
8939
9022
  return this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[cellInfo.value.toString()].aggregateType)
8940
9023
  + ' ' + this.parent.localeObj.getConstant('of') + ' ' + cellInfo.value.toString();
8941
9024
  }
8942
- else if (values.length === 1) {
9025
+ else if (values.length === 1 && this.parent.dataSourceSettings.rows.length === 0) {
8943
9026
  return this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(values[values.length - 1].type)
8944
9027
  + ' ' + this.parent.localeObj.getConstant('of') + ' ' + (!isNullOrUndefined(values[values.length - 1].caption) ? values[values.length - 1].caption : values[values.length - 1].name);
8945
9028
  }
@@ -8961,7 +9044,9 @@ var Render = /** @__PURE__ @class */ (function () {
8961
9044
  };
8962
9045
  /* eslint-disable */
8963
9046
  Render.prototype.excelColumnEvent = function (args) {
8964
- (args.cell).value = this.getValidHeader(args, 'column');
9047
+ if (this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column') {
9048
+ (args.cell).value = this.getValidHeader(args, 'column');
9049
+ }
8965
9050
  if (args.gridCell !== undefined && args.gridCell.column.width === 'auto') {
8966
9051
  this.parent.lastColumn = args.gridCell.column;
8967
9052
  args.gridCell.column.width = args.gridCell.column.minWidth;
@@ -8970,7 +9055,9 @@ var Render = /** @__PURE__ @class */ (function () {
8970
9055
  this.parent.trigger(excelHeaderQueryCellInfo, args);
8971
9056
  };
8972
9057
  Render.prototype.pdfColumnEvent = function (args) {
8973
- (args.cell).value = this.getValidHeader(args, 'column');
9058
+ if (this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column') {
9059
+ (args.cell).value = this.getValidHeader(args, 'column');
9060
+ }
8974
9061
  if (args.gridCell !== undefined && args.gridCell.column.width === 'auto') {
8975
9062
  this.parent.lastColumn = args.gridCell.column;
8976
9063
  args.gridCell.column.width = args.gridCell.column.minWidth;
@@ -9011,7 +9098,9 @@ var Render = /** @__PURE__ @class */ (function () {
9011
9098
  }
9012
9099
  }
9013
9100
  args = this.exportContentEvent(args);
9014
- args.value = args.column.field === '0.formattedText' ? this.getValidHeader(args, 'row') : args.value;
9101
+ if (this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row') {
9102
+ args.value = args.column.field === '0.formattedText' ? this.getValidHeader(args, 'row') : args.value;
9103
+ }
9015
9104
  this.parent.trigger(excelQueryCellInfo, args);
9016
9105
  };
9017
9106
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -9035,7 +9124,9 @@ var Render = /** @__PURE__ @class */ (function () {
9035
9124
  }
9036
9125
  args.style = { paragraphIndent: level * 10 };
9037
9126
  this.lastSpan = isValueCell ? this.lastSpan : level;
9038
- args.value = this.getValidHeader(args, 'row');
9127
+ if (this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row') {
9128
+ args.value = this.getValidHeader(args, 'row');
9129
+ }
9039
9130
  }
9040
9131
  this.parent.trigger(pdfQueryCellInfo, args);
9041
9132
  };
@@ -10454,7 +10545,6 @@ var FilterDialog = /** @__PURE__ @class */ (function () {
10454
10545
  if (_this.allowExcelLikeFilter) {
10455
10546
  _this.dialogPopUp.element.querySelector('.e-dlg-closeicon-btn').focus();
10456
10547
  }
10457
- _this.parent.control.pivotButtonModule.memberTreeView = _this.parent.filterDialog.memberTreeView;
10458
10548
  _this.memberTreeView.nodeChecked =
10459
10549
  _this.parent.control.pivotButtonModule.nodeStateModified.bind(_this.parent.control.pivotButtonModule);
10460
10550
  _this.allMemberSelect.nodeChecked =
@@ -11470,6 +11560,15 @@ var FilterDialog = /** @__PURE__ @class */ (function () {
11470
11560
  if (this.dropMenu && !this.dropMenu.isDestroyed) {
11471
11561
  this.dropMenu.destroy();
11472
11562
  }
11563
+ if (this.memberTreeView && !this.memberTreeView.isDestroyed) {
11564
+ this.memberTreeView.destroy();
11565
+ }
11566
+ if (this.allMemberSelect && !this.allMemberSelect.isDestroyed) {
11567
+ this.allMemberSelect.destroy();
11568
+ }
11569
+ if (this.editorSearch && !this.editorSearch.isDestroyed) {
11570
+ this.editorSearch.destroy();
11571
+ }
11473
11572
  if (document.getElementById(this.parent.parentID + '_LevelDiv-popup')) {
11474
11573
  remove(document.getElementById(this.parent.parentID + '_LevelDiv-popup'));
11475
11574
  }
@@ -11478,11 +11577,24 @@ var FilterDialog = /** @__PURE__ @class */ (function () {
11478
11577
  FilterDialog.prototype.removeFilterDialog = function () {
11479
11578
  if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
11480
11579
  this.dialogPopUp.destroy();
11580
+ setTimeout(this.setFocus.bind(this));
11481
11581
  }
11482
11582
  if (document.getElementById(this.parent.parentID + '_EditorTreeView')) {
11483
11583
  remove(document.getElementById(this.parent.parentID + '_EditorTreeView'));
11484
11584
  }
11485
11585
  };
11586
+ FilterDialog.prototype.setFocus = function () {
11587
+ if (this.parent.control.pivotButtonModule.parentElement) {
11588
+ var pivotButtons = [].slice.call(this.parent.control.pivotButtonModule.parentElement.querySelectorAll('.e-pivot-button'));
11589
+ for (var _i = 0, pivotButtons_1 = pivotButtons; _i < pivotButtons_1.length; _i++) {
11590
+ var item = pivotButtons_1[_i];
11591
+ if (item.getAttribute('data-uid') === this.parent.control.pivotButtonModule.fieldName) {
11592
+ item.focus();
11593
+ break;
11594
+ }
11595
+ }
11596
+ }
11597
+ };
11486
11598
  return FilterDialog;
11487
11599
  }());
11488
11600
 
@@ -12199,6 +12311,9 @@ var DataSourceSettings = /** @__PURE__ @class */ (function (_super) {
12199
12311
  __decorate$1([
12200
12312
  Property(true)
12201
12313
  ], DataSourceSettings.prototype, "showGrandTotals", void 0);
12314
+ __decorate$1([
12315
+ Property('Bottom')
12316
+ ], DataSourceSettings.prototype, "grandTotalsPosition", void 0);
12202
12317
  __decorate$1([
12203
12318
  Property(true)
12204
12319
  ], DataSourceSettings.prototype, "showRowGrandTotals", void 0);
@@ -13456,142 +13571,159 @@ var DrillThroughDialog = /** @__PURE__ @class */ (function () {
13456
13571
  this.clonedData.push(this.frameHeaderWithKeys(eventArgs.rawData[i]));
13457
13572
  }
13458
13573
  var actualText = eventArgs.currentCell.actualText.toString();
13459
- if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
13460
- this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
13461
- this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
13462
- this.editCell(eventArgs);
13463
- }
13464
- else {
13465
- this.removeDrillThroughDialog();
13466
- var drillThroughDialog = createElement('div', {
13467
- id: this.parent.element.id + '_drillthrough',
13468
- className: DRILLTHROUGH_DIALOG
13469
- });
13470
- this.parent.element.appendChild(drillThroughDialog);
13471
- this.dialogPopUp = new Dialog({
13472
- animationSettings: { effect: 'Fade' },
13473
- allowDragging: false,
13474
- header: this.parent.localeObj.getConstant('details'),
13475
- content: this.createDrillThroughGrid(eventArgs),
13476
- beforeOpen: function () {
13477
- _this.drillThroughGrid.setProperties({
13478
- dataSource: _this.parent.editSettings.allowEditing ?
13479
- _this.dataWithPrimarykey(eventArgs) : _this.gridData,
13480
- height: !_this.parent.editSettings.allowEditing ? 300 : 220
13481
- }, false);
13482
- },
13483
- beforeClose: function () {
13484
- if (_this.parent.editSettings.allowEditing && _this.isUpdated) {
13485
- if (_this.parent.dataSourceSettings.type === 'CSV') {
13486
- _this.updateData(_this.drillThroughGrid.dataSource);
13487
- }
13488
- var gridIndexObjectsValue = Object.keys(_this.gridIndexObjects);
13489
- var previousPosition = [];
13490
- for (var _i = 0, gridIndexObjectsValue_1 = gridIndexObjectsValue; _i < gridIndexObjectsValue_1.length; _i++) {
13491
- var value = gridIndexObjectsValue_1[_i];
13492
- previousPosition.push(_this.gridIndexObjects[value]);
13493
- }
13494
- var count = Object.keys(_this.gridIndexObjects).length;
13495
- var addItems = [];
13496
- var prevItems = [];
13497
- var index = 0;
13498
- /* eslint-disable @typescript-eslint/dot-notation */
13499
- for (var _a = 0, _b = _this.drillThroughGrid.dataSource; _a < _b.length; _a++) {
13500
- var item = _b[_a];
13501
- if (isNullOrUndefined(item['__index']) || item['__index'] === '') {
13502
- for (var _c = 0, _d = _this.engine.fields; _c < _d.length; _c++) {
13503
- var field = _d[_c];
13504
- if (isNullOrUndefined(item[field])) {
13505
- delete item[field];
13506
- }
13507
- }
13508
- delete item['__index'];
13509
- addItems.push(item);
13574
+ try {
13575
+ if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
13576
+ this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
13577
+ this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
13578
+ this.parent.actionObj.actionName = editRecord;
13579
+ if (this.parent.actionBeginMethod()) {
13580
+ return;
13581
+ }
13582
+ this.editCell(eventArgs);
13583
+ }
13584
+ else {
13585
+ this.removeDrillThroughDialog();
13586
+ var drillThroughDialog = createElement('div', {
13587
+ id: this.parent.element.id + '_drillthrough',
13588
+ className: DRILLTHROUGH_DIALOG
13589
+ });
13590
+ this.parent.element.appendChild(drillThroughDialog);
13591
+ this.dialogPopUp = new Dialog({
13592
+ animationSettings: { effect: 'Fade' },
13593
+ allowDragging: false,
13594
+ header: this.parent.localeObj.getConstant('details'),
13595
+ content: this.createDrillThroughGrid(eventArgs),
13596
+ beforeOpen: function () {
13597
+ _this.drillThroughGrid.setProperties({
13598
+ dataSource: _this.parent.editSettings.allowEditing ?
13599
+ _this.dataWithPrimarykey(eventArgs) : _this.gridData,
13600
+ height: !_this.parent.editSettings.allowEditing ? 300 : 220
13601
+ }, false);
13602
+ },
13603
+ beforeClose: function () {
13604
+ if (_this.parent.editSettings.allowEditing && _this.isUpdated) {
13605
+ if (_this.parent.dataSourceSettings.type === 'CSV') {
13606
+ _this.updateData(_this.drillThroughGrid.dataSource);
13510
13607
  }
13511
- else if (count > 0) {
13512
- delete _this.gridIndexObjects[item['__index'].toString()];
13513
- prevItems.push(item);
13514
- count--;
13608
+ var gridIndexObjectsValue = Object.keys(_this.gridIndexObjects);
13609
+ var previousPosition = [];
13610
+ for (var _i = 0, gridIndexObjectsValue_1 = gridIndexObjectsValue; _i < gridIndexObjectsValue_1.length; _i++) {
13611
+ var value = gridIndexObjectsValue_1[_i];
13612
+ previousPosition.push(_this.gridIndexObjects[value]);
13515
13613
  }
13516
- if (_this.parent.dataSourceSettings.mode === 'Server') {
13517
- if (item['__index']) {
13614
+ var count = Object.keys(_this.gridIndexObjects).length;
13615
+ var addItems = [];
13616
+ var prevItems = [];
13617
+ var index = 0;
13618
+ /* eslint-disable @typescript-eslint/dot-notation */
13619
+ for (var _a = 0, _b = _this.drillThroughGrid.dataSource; _a < _b.length; _a++) {
13620
+ var item = _b[_a];
13621
+ if (isNullOrUndefined(item['__index']) || item['__index'] === '') {
13622
+ for (var _c = 0, _d = _this.engine.fields; _c < _d.length; _c++) {
13623
+ var field = _d[_c];
13624
+ if (isNullOrUndefined(item[field])) {
13625
+ delete item[field];
13626
+ }
13627
+ }
13518
13628
  delete item['__index'];
13629
+ addItems.push(item);
13519
13630
  }
13520
- if (_this.gridData[index]['__index']) {
13521
- delete _this.gridData[index]['__index'];
13631
+ else if (count > 0) {
13632
+ delete _this.gridIndexObjects[item['__index'].toString()];
13633
+ prevItems.push(item);
13634
+ count--;
13522
13635
  }
13636
+ if (_this.parent.dataSourceSettings.mode === 'Server') {
13637
+ if (item['__index']) {
13638
+ delete item['__index'];
13639
+ }
13640
+ if (_this.gridData[index]['__index']) {
13641
+ delete _this.gridData[index]['__index'];
13642
+ }
13643
+ }
13644
+ index++;
13523
13645
  }
13524
- index++;
13525
- }
13526
- count = 0;
13527
- if (_this.parent.dataSourceSettings.mode === 'Server') {
13528
- var gridIndex = []; /* eslint-disable-line */
13529
- var keys = Object.keys(_this.gridIndexObjects);
13530
- for (var len = 0; len < keys.length; len++) {
13531
- delete _this.parent.drillThroughValue.indexObject[_this.gridIndexObjects[keys[len]]];
13532
- gridIndex.push({ Key: keys[len], Value: _this.gridIndexObjects[keys[len]] }); /* eslint-disable-line */
13533
- }
13534
- var indexObject = []; /* eslint-disable-line */
13535
- keys = Object.keys(_this.parent.drillThroughValue.indexObject);
13536
- for (var len = 0; len < keys.length; len++) {
13537
- indexObject.push({ Key: keys[len], Value: _this.parent.drillThroughValue.indexObject[keys[len]] }); /* eslint-disable-line */
13646
+ count = 0;
13647
+ if (_this.parent.dataSourceSettings.mode === 'Server') {
13648
+ var gridIndex = []; /* eslint-disable-line */
13649
+ var keys = Object.keys(_this.gridIndexObjects);
13650
+ for (var len = 0; len < keys.length; len++) {
13651
+ delete _this.parent.drillThroughValue.indexObject[_this.gridIndexObjects[keys[len]]];
13652
+ gridIndex.push({ Key: keys[len], Value: _this.gridIndexObjects[keys[len]] }); /* eslint-disable-line */
13653
+ }
13654
+ var indexObject = []; /* eslint-disable-line */
13655
+ keys = Object.keys(_this.parent.drillThroughValue.indexObject);
13656
+ for (var len = 0; len < keys.length; len++) {
13657
+ indexObject.push({ Key: keys[len], Value: _this.parent.drillThroughValue.indexObject[keys[len]] }); /* eslint-disable-line */
13658
+ }
13659
+ _this.parent.getEngine('updateRawData', null, null, null, null, null, null, null, { 'addedData': addItems, 'removedData': gridIndex, 'updatedData': prevItems, indexObject: indexObject });
13538
13660
  }
13539
- _this.parent.getEngine('updateRawData', null, null, null, null, null, null, null, { 'addedData': addItems, 'removedData': gridIndex, 'updatedData': prevItems, indexObject: indexObject });
13540
- }
13541
- else {
13542
- var items = [];
13543
- var data = (_this.parent.allowDataCompression && _this.parent.enableVirtualization) ?
13544
- _this.parent.engineModule.actualData : _this.parent.engineModule.data;
13545
- for (var _e = 0, _f = data; _e < _f.length; _e++) {
13546
- var item = _f[_e];
13547
- delete item['__index'];
13548
- if (_this.gridIndexObjects[count.toString()] === undefined) {
13549
- items.push(item);
13661
+ else {
13662
+ var items = [];
13663
+ var data = (_this.parent.allowDataCompression && _this.parent.enableVirtualization) ?
13664
+ _this.parent.engineModule.actualData : _this.parent.engineModule.data;
13665
+ for (var _e = 0, _f = data; _e < _f.length; _e++) {
13666
+ var item = _f[_e];
13667
+ delete item['__index'];
13668
+ if (_this.gridIndexObjects[count.toString()] === undefined) {
13669
+ items.push(item);
13670
+ }
13671
+ count++;
13672
+ }
13673
+ /* eslint-enable @typescript-eslint/dot-notation */
13674
+ items = items.concat(addItems);
13675
+ var eventArgs_1 = {
13676
+ currentData: _this.drillThroughGrid.dataSource,
13677
+ previousData: _this.clonedData,
13678
+ previousPosition: previousPosition,
13679
+ cancel: false
13680
+ };
13681
+ _this.parent.trigger(editCompleted, eventArgs_1);
13682
+ if (!eventArgs_1.cancel) {
13683
+ _this.parent.setProperties({ dataSourceSettings: { dataSource: items } }, true);
13684
+ _this.engine.updateGridData(_this.parent.dataSourceSettings);
13685
+ _this.parent.pivotValues = _this.engine.pivotValues;
13550
13686
  }
13551
- count++;
13552
13687
  }
13553
- /* eslint-enable @typescript-eslint/dot-notation */
13554
- items = items.concat(addItems);
13555
- var eventArgs_1 = {
13556
- currentData: _this.drillThroughGrid.dataSource,
13557
- previousData: _this.clonedData,
13558
- previousPosition: previousPosition,
13559
- cancel: false
13688
+ _this.parent.actionObj.actionName = recordUpdated;
13689
+ var actionInfo = {
13690
+ editInfo: {
13691
+ type: _this.drillThroughGrid.editSettings.mode, action: 'Update', currentData: _this.drillThroughGrid.dataSource,
13692
+ previousData: _this.clonedData, previousPosition: previousPosition
13693
+ }
13560
13694
  };
13561
- _this.parent.trigger(editCompleted, eventArgs_1);
13562
- if (!eventArgs_1.cancel) {
13563
- _this.parent.setProperties({ dataSourceSettings: { dataSource: items } }, true);
13564
- _this.engine.updateGridData(_this.parent.dataSourceSettings);
13565
- _this.parent.pivotValues = _this.engine.pivotValues;
13566
- }
13695
+ _this.parent.actionObj.actionInfo = actionInfo;
13567
13696
  }
13568
- }
13569
- _this.isUpdated = false;
13570
- _this.gridIndexObjects = {};
13571
- },
13572
- isModal: true,
13573
- visible: true,
13574
- showCloseIcon: true,
13575
- locale: this.parent.locale,
13576
- enableRtl: this.parent.enableRtl,
13577
- width: this.parent.isAdaptive ? '100%' : '60%',
13578
- position: { X: 'center', Y: 'center' },
13579
- closeOnEscape: !this.parent.editSettings.allowEditing,
13580
- target: document.body,
13581
- close: this.removeDrillThroughDialog.bind(this)
13582
- });
13583
- this.dialogPopUp.isStringTemplate = true;
13584
- this.dialogPopUp.appendTo(drillThroughDialog);
13585
- // this.dialogPopUp.element.querySelector('.e-dlg-header').innerHTML = this.parent.localeObj.getConstant('details');
13586
- setStyleAttribute(this.dialogPopUp.element, { 'visibility': 'visible' });
13587
- if (this.parent.editSettings.allowEditing) {
13588
- this.drillthroughKeyboardModule = new KeyboardEvents(this.dialogPopUp.element, {
13589
- keyAction: this.drillthroughKeyActionHandler.bind(this),
13590
- keyConfigs: this.drillKeyConfigs,
13591
- eventName: 'keydown'
13697
+ _this.isUpdated = false;
13698
+ _this.gridIndexObjects = {};
13699
+ },
13700
+ isModal: true,
13701
+ visible: true,
13702
+ showCloseIcon: true,
13703
+ locale: this.parent.locale,
13704
+ enableRtl: this.parent.enableRtl,
13705
+ width: this.parent.isAdaptive ? '100%' : '60%',
13706
+ position: { X: 'center', Y: 'center' },
13707
+ closeOnEscape: !this.parent.editSettings.allowEditing,
13708
+ target: document.body,
13709
+ close: this.removeDrillThroughDialog.bind(this)
13592
13710
  });
13711
+ this.dialogPopUp.isStringTemplate = true;
13712
+ this.dialogPopUp.appendTo(drillThroughDialog);
13713
+ // this.dialogPopUp.element.querySelector('.e-dlg-header').innerHTML = this.parent.localeObj.getConstant('details');
13714
+ setStyleAttribute(this.dialogPopUp.element, { 'visibility': 'visible' });
13715
+ if (this.parent.editSettings.allowEditing) {
13716
+ this.drillthroughKeyboardModule = new KeyboardEvents(this.dialogPopUp.element, {
13717
+ keyAction: this.drillthroughKeyActionHandler.bind(this),
13718
+ keyConfigs: this.drillKeyConfigs,
13719
+ eventName: 'keydown'
13720
+ });
13721
+ }
13593
13722
  }
13594
13723
  }
13724
+ catch (execption) {
13725
+ this.parent.actionFailureMethod(execption);
13726
+ }
13595
13727
  };
13596
13728
  DrillThroughDialog.prototype.editCell = function (eventArgs) {
13597
13729
  var _this = this;
@@ -13607,6 +13739,10 @@ var DrillThroughDialog = /** @__PURE__ @class */ (function () {
13607
13739
  if (eventArgs.currentCell.actualText in previousData) {
13608
13740
  currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
13609
13741
  }
13742
+ var actionInfo = {
13743
+ editInfo: { type: 'Inline editing', action: 'update', data: this.gridData }
13744
+ };
13745
+ this.parent.actionObj.actionInfo = actionInfo;
13610
13746
  this.numericTextBox = new NumericTextBox({
13611
13747
  value: cellValue,
13612
13748
  enableRtl: this.parent.enableRtl,
@@ -13671,6 +13807,10 @@ var DrillThroughDialog = /** @__PURE__ @class */ (function () {
13671
13807
  };
13672
13808
  DrillThroughDialog.prototype.removeDrillThroughDialog = function () {
13673
13809
  if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
13810
+ this.parent.actionObj.actionName = drillThroughClosed;
13811
+ if (this.parent.actionObj.actionName) {
13812
+ this.parent.actionCompleteMethod();
13813
+ }
13674
13814
  this.dialogPopUp.destroy();
13675
13815
  }
13676
13816
  var dialogElement = document.getElementById(this.parent.element.id + '_drillthrough');
@@ -13683,6 +13823,7 @@ var DrillThroughDialog = /** @__PURE__ @class */ (function () {
13683
13823
  };
13684
13824
  /* eslint-disable */
13685
13825
  DrillThroughDialog.prototype.createDrillThroughGrid = function (eventArgs) {
13826
+ var _this = this;
13686
13827
  var drillThroughBody = createElement('div', { id: this.parent.element.id + '_drillthroughbody', className: DRILLTHROUGH_BODY_CLASS });
13687
13828
  var drillThroughBodyHeader = createElement('div', {
13688
13829
  id: this.parent.element.id +
@@ -13760,31 +13901,53 @@ var DrillThroughDialog = /** @__PURE__ @class */ (function () {
13760
13901
  }
13761
13902
  if (this.parent.editSettings.allowEditing) {
13762
13903
  Grid.Inject(Edit, Page);
13763
- this.drillThroughGrid.editSettings = this.parent.editSettings;
13764
- if (this.parent.editSettings.allowCommandColumns) {
13765
- this.drillThroughGrid.editSettings.mode = 'Normal';
13766
- this.drillThroughGrid.editSettings.allowEditOnDblClick = false;
13767
- Grid.Inject(CommandColumn);
13904
+ try {
13905
+ this.drillThroughGrid.editSettings = this.parent.editSettings;
13906
+ this.drillThroughGrid.actionBegin = function (args) {
13907
+ var actionName = (args.requestType == 'save') ? saveEditedRecords : (args.requestType == 'add') ? addNewRecord : (args.requestType == 'delete') ? removeRecord : '';
13908
+ _this.parent.actionObj.actionName = actionName;
13909
+ if (_this.parent.actionObj.actionName) {
13910
+ if (_this.parent.actionBeginMethod()) {
13911
+ return;
13912
+ }
13913
+ }
13914
+ };
13915
+ if (this.parent.editSettings.allowCommandColumns) {
13916
+ this.drillThroughGrid.editSettings.mode = 'Normal';
13917
+ this.drillThroughGrid.editSettings.allowEditOnDblClick = false;
13918
+ Grid.Inject(CommandColumn);
13919
+ this.drillThroughGrid.columns.push({
13920
+ headerText: this.parent.localeObj.getConstant('manageRecords'), width: 160, showInColumnChooser: false,
13921
+ commands: [
13922
+ { type: 'Edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' } },
13923
+ { type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' } },
13924
+ { type: 'Save', buttonOption: { iconCss: 'e-icons e-update', cssClass: 'e-flat' } },
13925
+ { type: 'Cancel', buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' } }
13926
+ ]
13927
+ });
13928
+ }
13929
+ else {
13930
+ this.drillThroughGrid.editSettings.allowEditOnDblClick = this.parent.editSettings.allowEditOnDblClick;
13931
+ }
13768
13932
  this.drillThroughGrid.columns.push({
13769
- headerText: this.parent.localeObj.getConstant('manageRecords'), width: 160, showInColumnChooser: false,
13770
- commands: [
13771
- { type: 'Edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' } },
13772
- { type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' } },
13773
- { type: 'Save', buttonOption: { iconCss: 'e-icons e-update', cssClass: 'e-flat' } },
13774
- { type: 'Cancel', buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' } }
13775
- ]
13933
+ field: '__index', visible: false, isPrimaryKey: true, type: 'string', showInColumnChooser: false
13776
13934
  });
13777
13935
  }
13778
- else {
13779
- this.drillThroughGrid.editSettings.allowEditOnDblClick = this.parent.editSettings.allowEditOnDblClick;
13936
+ catch (execption) {
13937
+ this.parent.actionFailureMethod(execption);
13780
13938
  }
13781
- this.drillThroughGrid.columns.push({
13782
- field: '__index', visible: false, isPrimaryKey: true, type: 'string', showInColumnChooser: false
13783
- });
13784
13939
  this.drillThroughGrid.actionComplete = function (args) {
13785
13940
  if (args.requestType === 'batchsave' || args.requestType === 'save' || args.requestType === 'delete') {
13786
13941
  dialogModule.isUpdated = true;
13787
13942
  }
13943
+ _this.parent.actionObj.actionName = _this.parent.getActionCompleteName();
13944
+ var actionInfo = {
13945
+ editInfo: { type: _this.drillThroughGrid.editSettings.mode, action: args.requestType, data: _this.gridData }
13946
+ };
13947
+ _this.parent.actionObj.actionInfo = actionInfo;
13948
+ if (_this.parent.actionObj.actionName) {
13949
+ _this.parent.actionCompleteMethod();
13950
+ }
13788
13951
  if ((dialogModule.drillThroughGrid.editSettings.mode === 'Normal' && args.requestType === 'save' &&
13789
13952
  dialogModule.drillThroughGrid.element.querySelectorAll('.e-tbar-btn:hover').length > 0 &&
13790
13953
  !dialogModule.parent.editSettings.allowCommandColumns) || args.requestType === 'batchsave') {
@@ -13978,7 +14141,7 @@ var DrillThrough = /** @__PURE__ @class */ (function () {
13978
14141
  * @hidden
13979
14142
  */
13980
14143
  DrillThrough.prototype.getModuleName = function () {
13981
- return 'drillthrough';
14144
+ return 'drillThrough';
13982
14145
  };
13983
14146
  DrillThrough.prototype.addInternalEvents = function () {
13984
14147
  this.parent.on(contentReady, this.wireEvents, this);
@@ -14186,7 +14349,7 @@ var PivotChart = /** @__PURE__ @class */ (function () {
14186
14349
  * @private
14187
14350
  */
14188
14351
  PivotChart.prototype.getModuleName = function () {
14189
- return 'pivotchart';
14352
+ return 'pivotChart';
14190
14353
  };
14191
14354
  /* eslint-disable */
14192
14355
  PivotChart.prototype.loadChart = function (parent, chartSettings) {
@@ -14381,7 +14544,9 @@ var PivotChart = /** @__PURE__ @class */ (function () {
14381
14544
  this.maxLevel = currrentLevel > this.maxLevel ? currrentLevel : this.maxLevel;
14382
14545
  var name_1 = this.parent.dataType === 'olap' ? firstRowCell.formattedText :
14383
14546
  (firstRowCell.actualText ? firstRowCell.actualText.toString() : firstRowCell.formattedText.toString());
14384
- var text = firstRowCell.formattedText ? firstRowCell.formattedText.toString() : name_1;
14547
+ var values = this.engineModule.fieldList[this.currentMeasure];
14548
+ var text = this.parent.dataSourceSettings.rows.length === 0 ? this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(values.aggregateType) + ' ' +
14549
+ this.parent.localeObj.getConstant('of') + ' ' + (!isNullOrUndefined(values.caption) ? values.caption : values.name) : firstRowCell.formattedText ? firstRowCell.formattedText.toString() : name_1;
14385
14550
  var caption = (firstRowCell.hasChild && !firstRowCell.isNamedSet) ?
14386
14551
  ((firstRowCell.isDrilled ? ' - ' : ' + ') + text) : text;
14387
14552
  var levelName = tupInfo ? tupInfo.uNameCollection : firstRowCell.valueSort.levelName.toString();
@@ -14557,7 +14722,9 @@ var PivotChart = /** @__PURE__ @class */ (function () {
14557
14722
  this.chartSettings.palettes = currentSeries.palettes;
14558
14723
  }
14559
14724
  for (var i = 0; i < this.columnGroupObject[key].length; i++) {
14560
- this.columnGroupObject[key][i].x = this.columnGroupObject[key][i].x === '' ? this.parent.localeObj.getConstant('blank') : this.columnGroupObject[key][i].x;
14725
+ var values = this.engineModule.fieldList[this.currentMeasure];
14726
+ 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) + ' ' +
14727
+ 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;
14561
14728
  }
14562
14729
  currentSeries.dataSource = this.columnGroupObject[key];
14563
14730
  currentSeries.xName = 'x';
@@ -14713,7 +14880,7 @@ var PivotChart = /** @__PURE__ @class */ (function () {
14713
14880
  enableSmartLabels: this.chartSettings.enableSmartLabels,
14714
14881
  center: this.chartSettings.pieCenter,
14715
14882
  enableBorderOnMouseMove: this.chartSettings.enableBorderOnMouseMove,
14716
- highLightMode: this.chartSettings.highlightMode,
14883
+ highlightMode: this.chartSettings.highlightMode,
14717
14884
  highlightPattern: this.chartSettings.highlightPattern,
14718
14885
  titleStyle: this.chartSettings.titleStyle,
14719
14886
  subTitle: this.chartSettings.subTitle,
@@ -14841,7 +15008,7 @@ var PivotChart = /** @__PURE__ @class */ (function () {
14841
15008
  this.parent.chart.highlightPattern = this.parent.chartSettings.highlightPattern;
14842
15009
  if (this.accumulationType.indexOf(type) > -1) {
14843
15010
  this.parent.chart.enableBorderOnMouseMove = this.parent.chartSettings.enableBorderOnMouseMove;
14844
- this.parent.chart.highLightMode = this.parent.chartSettings.highlightMode;
15011
+ this.parent.chart.highlightMode = this.parent.chartSettings.highlightMode;
14845
15012
  this.parent.chart.enableSmartLabels = this.parent.chartSettings.enableSmartLabels;
14846
15013
  }
14847
15014
  else {
@@ -14950,9 +15117,14 @@ var PivotChart = /** @__PURE__ @class */ (function () {
14950
15117
  currentYAxis.labelFormat = currentYAxis.labelFormat ?
14951
15118
  currentYAxis.labelFormat : (percentChart ? '' : (!resFormat ? format : 'N'));
14952
15119
  currentYAxis.title = currentYAxis.title ? currentYAxis.title : measureAggregatedName;
14953
- currentYAxis.plotOffsetTop = currentYAxis.plotOffsetTop ? currentYAxis.plotOffsetTop :
14954
- this.chartSettings.chartSeries.type === 'Bar' || this.chartSettings.chartSeries.type === 'StackingBar' ||
14955
- this.chartSettings.chartSeries.type === 'StackingBar100' ? 50 : 30;
15120
+ currentYAxis.edgeLabelPlacement = this.chartSettings.primaryYAxis.edgeLabelPlacement ? this.chartSettings.primaryYAxis.edgeLabelPlacement : this.persistSettings.primaryYAxis.edgeLabelPlacement;
15121
+ if (this.chartSettings.chartSeries.type === 'Bar' || this.chartSettings.chartSeries.type === 'StackingBar' ||
15122
+ this.chartSettings.chartSeries.type === 'StackingBar100') {
15123
+ currentYAxis.plotOffsetRight = currentYAxis.plotOffsetRight ? currentYAxis.plotOffsetRight : 30;
15124
+ }
15125
+ else {
15126
+ currentYAxis.plotOffsetTop = currentYAxis.plotOffsetTop ? currentYAxis.plotOffsetTop : 30;
15127
+ }
14956
15128
  if (!resFormat) {
14957
15129
  currentYAxis.name = this.measuresNames[item.name] ? this.measuresNames[item.name] : item.name;
14958
15130
  }
@@ -14999,6 +15171,7 @@ var PivotChart = /** @__PURE__ @class */ (function () {
14999
15171
  currentYAxis = this.persistSettings.primaryYAxis ? this.frameObjectWithKeys(this.persistSettings.primaryYAxis) : currentYAxis;
15000
15172
  currentYAxis.rowIndex = 0;
15001
15173
  currentYAxis.columnIndex = 0;
15174
+ currentYAxis.edgeLabelPlacement = this.chartSettings.primaryYAxis.edgeLabelPlacement ? this.chartSettings.primaryYAxis.edgeLabelPlacement : this.persistSettings.primaryYAxis.edgeLabelPlacement;
15002
15175
  if (!(this.chartSettings.chartSeries.type === 'Polar' || this.chartSettings.chartSeries.type === 'Radar')) {
15003
15176
  currentYAxis.name = this.measuresNames[this.currentMeasure] ? this.measuresNames[this.currentMeasure] : this.currentMeasure;
15004
15177
  }
@@ -15321,6 +15494,7 @@ var PivotChart = /** @__PURE__ @class */ (function () {
15321
15494
  };
15322
15495
  PivotChart.prototype.loaded = function (args) {
15323
15496
  this.parent.isChartLoaded = true;
15497
+ var width = this.parent.grid ? this.parent.getGridWidthAsNumber().toString() : this.parent.getWidthAsNumber().toString();
15324
15498
  if (this.parent.chart && this.parent.showGroupingBar && this.parent.groupingBarModule &&
15325
15499
  this.parent.showFieldList && this.parent.currentView === 'Chart') {
15326
15500
  this.parent.groupingBarModule.alignIcon();
@@ -15332,13 +15506,15 @@ var PivotChart = /** @__PURE__ @class */ (function () {
15332
15506
  this.parent.element.querySelector('#' + this.parent.element.id + multilabelAxisName).setAttribute('cursor', 'pointer');
15333
15507
  }
15334
15508
  }
15335
- if ((['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) >= 0)
15336
- && this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
15337
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'visible';
15338
- }
15339
- else if (this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
15340
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'auto';
15341
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflowX = 'hidden';
15509
+ if (this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
15510
+ if (['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) >= 0) {
15511
+ this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'visible';
15512
+ }
15513
+ else {
15514
+ this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'auto';
15515
+ this.parent.element.querySelector('.' + PIVOTCHART).style.overflowX = 'hidden';
15516
+ }
15517
+ this.parent.element.querySelector('.' + PIVOTCHART).style.width = width + 'px';
15342
15518
  }
15343
15519
  this.parent.chart.height = ['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) < 0 &&
15344
15520
  this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis &&
@@ -15559,6 +15735,11 @@ var PivotChart = /** @__PURE__ @class */ (function () {
15559
15735
  offSetHeight = this.parent.getHeightAsNumber() - offSetVal;
15560
15736
  }
15561
15737
  if (!isNullOrUndefined(this.parent.getHeightAsNumber())) {
15738
+ var isNone = false;
15739
+ if (this.parent.element.querySelector('.e-chart-grouping-bar') !== null && this.parent.element.querySelector('.e-chart-grouping-bar').style.display.toLowerCase() === 'none') {
15740
+ isNone = true;
15741
+ this.parent.element.querySelector('.e-chart-grouping-bar').style.display = "block";
15742
+ }
15562
15743
  if (this.parent.showToolbar && this.parent.showGroupingBar) {
15563
15744
  height = (offSetHeight - (this.parent.element.querySelector('.e-pivot-toolbar') ?
15564
15745
  this.parent.element.querySelector('.e-pivot-toolbar').clientHeight : 42) -
@@ -15576,6 +15757,9 @@ var PivotChart = /** @__PURE__ @class */ (function () {
15576
15757
  else if ((this.parent.chart && parseInt(this.parent.chart.height, 10) < 200) || offSetHeight < 200) {
15577
15758
  height = '200';
15578
15759
  }
15760
+ if (isNone) {
15761
+ this.parent.element.querySelector('.e-chart-grouping-bar').style.display = "none";
15762
+ }
15579
15763
  }
15580
15764
  else {
15581
15765
  height = 'auto';
@@ -17381,7 +17565,7 @@ var PivotAxis = /** @__PURE__ @class */ (function (_super) {
17381
17565
  Property('')
17382
17566
  ], PivotAxis.prototype, "title", void 0);
17383
17567
  __decorate$3([
17384
- Property(null)
17568
+ Property(1)
17385
17569
  ], PivotAxis.prototype, "zoomFactor", void 0);
17386
17570
  __decorate$3([
17387
17571
  Complex({}, CrosshairTooltip)
@@ -17399,7 +17583,7 @@ var PivotAxis = /** @__PURE__ @class */ (function (_super) {
17399
17583
  Property(0)
17400
17584
  ], PivotAxis.prototype, "plotOffset", void 0);
17401
17585
  __decorate$3([
17402
- Property('None')
17586
+ Property('Shift')
17403
17587
  ], PivotAxis.prototype, "edgeLabelPlacement", void 0);
17404
17588
  __decorate$3([
17405
17589
  Property('BetweenTicks')
@@ -18734,6 +18918,7 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
18734
18918
  this.updateTupCollection(customArgs.drillInfo.axis === 'row' ? rowTuples.length : columnTuples.length);
18735
18919
  }
18736
18920
  if (customArgs.action === 'down' ? customArgs.drillInfo.axis === 'column' : true) {
18921
+ this.olapValueAxis = isNullOrUndefined(this.getValueAxis(undefined, undefined)) ? 'column' : 'row';
18737
18922
  this.frameColumnHeader(columnTuples);
18738
18923
  if (!this.isPaging) {
18739
18924
  this.performColumnSorting();
@@ -18788,6 +18973,7 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
18788
18973
  OlapEngine.prototype.frameRowHeader = function (tuples) {
18789
18974
  this.headerGrouping = {};
18790
18975
  this.lastLevel = [];
18976
+ var isGrandTotalAdd = true;
18791
18977
  var position = this.pivotValues.length;
18792
18978
  var pivotValues = [];
18793
18979
  var valueContent = [];
@@ -18848,6 +19034,7 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
18848
19034
  var startTupPos = tupPos;
18849
19035
  var pagingAllowFlag = true;
18850
19036
  var lastMesPos = 0;
19037
+ var isGrandTotalTop = false;
18851
19038
  while (tupPos < tuplesLength && pagingAllowFlag) {
18852
19039
  var members = tuples[this.customArgs.action === 'down' ?
18853
19040
  (tupPos - (this.customArgs.drillInfo.currentCell.ordinal + 1)) : tupPos].querySelectorAll('Member');
@@ -18902,35 +19089,25 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
18902
19089
  (allStartPos === (drillStartPos + 1) || this.tupRowInfo[tupPos].measurePosition === (drillStartPos + 1))))
18903
19090
  : drillAllow;
18904
19091
  var withoutAllAllow = (withoutAllStartPos > -1 && allCount > 0) ? (attrDrill || allStartPos > withoutAllEndPos) : true;
18905
- if (members.length === allCount + (measure ? 1 : 0) && measure) {
19092
+ isGrandTotalTop = this.dataSourceSettings.grandTotalsPosition === 'Top' && this.olapRowValueIndex === 0 && this.olapValueAxis === 'row'
19093
+ && this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showRowGrandTotals && (this.olapValueAxis === 'row' ? this.dataSourceSettings.rows.length > 1 : true);
19094
+ if (isGrandTotalTop && gTotals.length === 1) {
19095
+ gTotals = this.frameGrandTotalValues(tuples, gTotals, typeColl, measurePos);
19096
+ }
19097
+ if (members.length === allCount + (measure ? 1 : 0) && measure && !isGrandTotalTop) {
18906
19098
  var levelName = 'Grand Total.' + members[measurePos].querySelector('Caption').textContent;
18907
- gTotals.push({
18908
- axis: 'row',
18909
- actualText: this.getUniqueName(members[measurePos].querySelector('UName').textContent),
18910
- colIndex: 0,
18911
- formattedText: (typeColl[measurePos] === '3' &&
18912
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
18913
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption) ?
18914
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption :
18915
- members[measurePos].querySelector('Caption').textContent,
18916
- hasChild: false,
18917
- level: -1,
18918
- rowIndex: position,
18919
- index: [],
18920
- ordinal: tupPos,
18921
- colSpan: 1,
18922
- rowSpan: 1,
18923
- memberType: Number(typeColl[measurePos]),
18924
- isDrilled: false,
18925
- parentUniqueName: members[measurePos].querySelector('PARENT_UNIQUE_NAME') ?
18926
- members[measurePos].querySelector('PARENT_UNIQUE_NAME').textContent : undefined,
18927
- levelUniqueName: members[measurePos].querySelector('LName').textContent,
18928
- hierarchy: members[measurePos].getAttribute('Hierarchy'),
18929
- valueSort: { levelName: levelName, axis: members[measurePos].getAttribute('Hierarchy') }
18930
- });
19099
+ var formattedText = (typeColl[measurePos] === '3' && this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
19100
+ this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption) ? this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption :
19101
+ members[measurePos].querySelector('Caption').textContent;
19102
+ 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') });
18931
19103
  gTotals[gTotals.length - 1].valueSort['Grand Total.' + members[measurePos].querySelector('Caption').textContent] = 1;
18932
19104
  }
18933
19105
  else if (!(allStartPos === 0 || (measurePos === 0 && allStartPos === 1)) && drillAllow && withoutAllAllow) {
19106
+ if (this.dataSourceSettings.grandTotalsPosition === 'Top' && isGrandTotalAdd && this.dataSourceSettings.showGrandTotals && (this.olapValueAxis === 'row' ? this.dataSourceSettings.rows.length > 1 : true)) {
19107
+ this.insertRowGrandTotal(gTotals, valueContent, pivotValues, tuples, position);
19108
+ position = this.pivotValues.length;
19109
+ isGrandTotalAdd = false;
19110
+ }
18934
19111
  prevTupInfo = this.tupRowInfo[tupPos];
18935
19112
  var lastPos = position;
18936
19113
  var lastMemPos = memPos;
@@ -19021,6 +19198,11 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19021
19198
  }
19022
19199
  tupPos++;
19023
19200
  }
19201
+ if (!(this.dataSourceSettings.grandTotalsPosition === 'Top') || (this.olapValueAxis === 'row' && this.dataSourceSettings.rows.length === 1 && this.dataSourceSettings.grandTotalsPosition === 'Top') || this.dataSourceSettings.rows.length === 0) {
19202
+ this.insertRowGrandTotal(gTotals, valueContent, pivotValues, tuples, position);
19203
+ }
19204
+ };
19205
+ OlapEngine.prototype.insertRowGrandTotal = function (gTotals, valueContent, pivotValues, tuples, position) {
19024
19206
  if (gTotals.length > 1 && gTotals[0].memberType !== 3) {
19025
19207
  gTotals[0].ordinal = -1;
19026
19208
  }
@@ -19046,6 +19228,41 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19046
19228
  this.updateRowEngine(pivotValues, valueContent, tuples.length);
19047
19229
  this.onDemandDrillEngine = pivotValues;
19048
19230
  }
19231
+ return gTotals;
19232
+ };
19233
+ OlapEngine.prototype.getValueAxis = function (valueAxis, valueIndex) {
19234
+ this.olapValueAxis = valueAxis;
19235
+ this.olapRowValueIndex = valueIndex;
19236
+ for (var i = 0; i < this.dataSourceSettings.rows.length; i++) {
19237
+ if (this.dataSourceSettings.rows[i].name === '[Measures]') {
19238
+ this.olapValueAxis = 'row';
19239
+ this.olapRowValueIndex = i;
19240
+ break;
19241
+ }
19242
+ }
19243
+ return this.olapValueAxis;
19244
+ };
19245
+ OlapEngine.prototype.frameGrandTotalAxisSet = function (gTotals, actualText, formattedText, rowIndex, ordinal, memberType, parentUniqueName, levelUniqueName, hierarchy, valueSort) {
19246
+ gTotals.push({
19247
+ axis: 'row',
19248
+ actualText: actualText,
19249
+ colIndex: 0,
19250
+ formattedText: formattedText,
19251
+ hasChild: false,
19252
+ level: -1,
19253
+ rowIndex: rowIndex,
19254
+ index: [],
19255
+ ordinal: ordinal,
19256
+ colSpan: 1,
19257
+ rowSpan: 1,
19258
+ memberType: memberType,
19259
+ isDrilled: false,
19260
+ parentUniqueName: parentUniqueName,
19261
+ levelUniqueName: levelUniqueName,
19262
+ hierarchy: hierarchy,
19263
+ valueSort: valueSort
19264
+ });
19265
+ return gTotals;
19049
19266
  };
19050
19267
  OlapEngine.prototype.getDepth = function (tupInfo, uniqueName, memberType) {
19051
19268
  var memberPosition = tupInfo.uNameCollection.indexOf(uniqueName);
@@ -19286,6 +19503,53 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19286
19503
  currTupCount--;
19287
19504
  }
19288
19505
  };
19506
+ OlapEngine.prototype.frameGrandTotalValues = function (tuples, gTotals, typeColl, measurePos) {
19507
+ var tupPos = 0;
19508
+ var lastAllStartPos;
19509
+ var lastAllCount;
19510
+ var availAllMember = false;
19511
+ var withoutAllEndPos = -1;
19512
+ var isGrandtoalDataAdd = false;
19513
+ var prevTupInfo;
19514
+ var isGrandTotalTop = false;
19515
+ while (tupPos < tuples.length && !isGrandtoalDataAdd) {
19516
+ var members = tuples[this.customArgs.action === 'down' ?
19517
+ (tupPos - (this.customArgs.drillInfo.currentCell.ordinal + 1)) : tupPos].querySelectorAll('Member');
19518
+ var allCount = this.tupRowInfo[tupPos].allCount;
19519
+ var allStartPos = this.tupRowInfo[tupPos].allStartPos;
19520
+ var measure = this.tupRowInfo[tupPos].measure;
19521
+ var typeColl_1 = this.tupRowInfo[tupPos].typeCollection;
19522
+ var drillStartPos = this.tupRowInfo[tupPos].drillStartPos;
19523
+ var startDrillUniquename = this.tupRowInfo[tupPos].startDrillUniquename;
19524
+ if (tupPos === 0 && (members.length > (allCount + (measure ? 1 : 0)) || (members.length === 1 && measure))) {
19525
+ gTotals.pop();
19526
+ }
19527
+ if ((tupPos === 0 && this.isPaging) ? gTotals.length === 0 :
19528
+ (!availAllMember || allCount === lastAllCount || allStartPos !== lastAllStartPos || (members.length === 1 && measure))) {
19529
+ var attrDrill = this.checkAttributeDrill(this.tupRowInfo[tupPos].drillInfo, 'rows');
19530
+ var drillAllow = drillStartPos > -1 ? (allCount > 0 ? (attrDrill || allStartPos > drillStartPos) : true) : true;
19531
+ drillAllow = (prevTupInfo && drillAllow && drillStartPos > -1) ?
19532
+ (prevTupInfo.startDrillUniquename !== startDrillUniquename ? true :
19533
+ ((withoutAllEndPos > prevTupInfo.measurePosition ? false :
19534
+ prevTupInfo.measureName !== this.tupRowInfo[tupPos].measureName) &&
19535
+ (allStartPos === (drillStartPos + 1) || this.tupRowInfo[tupPos].measurePosition === (drillStartPos + 1))))
19536
+ : drillAllow;
19537
+ if (members.length === allCount + (measure ? 1 : 0) && measure && !isGrandTotalTop) {
19538
+ var levelName = 'Grand Total.' + members[measurePos].querySelector('Caption').textContent;
19539
+ var formattedText = (typeColl_1[measurePos] === '3' && this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
19540
+ this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption) ? this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption :
19541
+ members[measurePos].querySelector('Caption').textContent;
19542
+ gTotals = this.frameGrandTotalAxisSet(gTotals, this.getUniqueName(members[measurePos].querySelector('UName').textContent), formattedText, this.pivotValues.length, tupPos, Number(typeColl_1[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') });
19543
+ gTotals[gTotals.length - 1].valueSort['Grand Total.' + members[measurePos].querySelector('Caption').textContent] = 1;
19544
+ }
19545
+ lastAllCount = allCount;
19546
+ lastAllStartPos = allStartPos;
19547
+ }
19548
+ isGrandtoalDataAdd = this.dataSourceSettings.values.length + 1 === gTotals.length ? true : false;
19549
+ tupPos++;
19550
+ }
19551
+ return gTotals;
19552
+ };
19289
19553
  OlapEngine.prototype.frameColumnHeader = function (tuples) {
19290
19554
  var _this = this;
19291
19555
  this.headerGrouping = {};
@@ -19350,8 +19614,18 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19350
19614
  withoutAllAvail = true;
19351
19615
  isStartCol = (allCount > 0 && isStartCol) ? (allStartPos > withoutAllStartPos) : isStartCol;
19352
19616
  }
19353
- if (isStartCol) {
19354
- if (allCount === 0) {
19617
+ var isGrandTotalTop = false;
19618
+ if (this_1.dataSourceSettings.grandTotalsPosition === 'Top' && this_1.dataSourceSettings.showGrandTotals && this_1.dataSourceSettings.showColumnGrandTotals) {
19619
+ var count = 0;
19620
+ for (var i = 0; i < members.length; i++) {
19621
+ if ((members[i].querySelector('Caption').textContent).indexOf('All') === 0) {
19622
+ count++;
19623
+ }
19624
+ }
19625
+ isGrandTotalTop = count === (this_1.olapValueAxis === 'column' ? this_1.dataSourceSettings.columns.length - 1 : this_1.dataSourceSettings.columns.length);
19626
+ }
19627
+ if (isStartCol || isGrandTotalTop) {
19628
+ if (allCount === 0 || isGrandTotalTop) {
19355
19629
  var levelComp = [-1, -1, -1];
19356
19630
  if (this_1.tupColumnInfo[tupPos - 1] && this_1.tupColumnInfo[tupPos - 1].allCount === 0) {
19357
19631
  levelComp = this_1.levelCompare(levelColl, this_1.tupColumnInfo[tupPos - 1].levelCollection);
@@ -19388,8 +19662,10 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19388
19662
  }
19389
19663
  this_1.setParentCollection(members);
19390
19664
  if (withoutAllAvail ? (withoutAllEndPos <= drillStartPos) : true) {
19391
- this_1.totalCollection[this_1.totalCollection.length] =
19392
- ({ allCount: allCount, ordinal: tupPos, members: members, drillInfo: drillInfo });
19665
+ if (!isGrandTotalTop) {
19666
+ this_1.totalCollection[this_1.totalCollection.length] =
19667
+ ({ allCount: allCount, ordinal: tupPos, members: members, drillInfo: drillInfo });
19668
+ }
19393
19669
  lastSavedInfo.allCount = allCount;
19394
19670
  lastSavedInfo.allStartPos = allStartPos;
19395
19671
  lastSavedInfo.drillStartPos = drillStartPos;
@@ -19414,10 +19690,12 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19414
19690
  }
19415
19691
  this_1.setParentCollection(members);
19416
19692
  if ((withoutAllAvail && drillStartPos > -1) ? (withoutAllEndPos <= drillStartPos) : true) {
19417
- this_1.totalCollection[this_1.totalCollection.length] =
19418
- ({
19419
- allCount: allCount, ordinal: tupPos, members: members, allStartPos: allStartPos, drillInfo: drillInfo
19420
- });
19693
+ if (!isGrandTotalTop) {
19694
+ this_1.totalCollection[this_1.totalCollection.length] =
19695
+ ({
19696
+ allCount: allCount, ordinal: tupPos, members: members, allStartPos: allStartPos, drillInfo: drillInfo
19697
+ });
19698
+ }
19421
19699
  lastSavedInfo.allCount = allCount;
19422
19700
  lastSavedInfo.allStartPos = allStartPos;
19423
19701
  lastSavedInfo.drillStartPos = drillStartPos;
@@ -19921,19 +20199,26 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19921
20199
  }
19922
20200
  var newPos = 0;
19923
20201
  var totPos = 0;
20202
+ var valuePos = 0;
19924
20203
  gSumFlag = false;
19925
20204
  gSumGrouping = this.sortRowHeaders(gSumGrouping);
19926
20205
  for (var rPos = this.colDepth; rPos < rowCount; rPos++) {
19927
20206
  /* eslint-disable @typescript-eslint/dot-notation */
20207
+ if (this.dataSourceSettings.grandTotalsPosition === 'Top' && (this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showRowGrandTotals) &&
20208
+ ((this.olapValueAxis === 'column' && this.colDepth + 1 === rPos) || (this.olapValueAxis === 'row' && this.colDepth + this.dataSourceSettings.values.length + 1 === rPos))) {
20209
+ newPos = 0;
20210
+ gSumFlag = false;
20211
+ }
19928
20212
  var cell = gSumFlag ? gSumGrouping : sortLvlGrouping[levels[0]]['parent'];
19929
20213
  /* eslint-enable @typescript-eslint/dot-notation */
19930
- var currPos = gSumFlag ? (newPos - totPos) : newPos;
20214
+ var currPos = (this.dataSourceSettings.grandTotalsPosition === 'Top' && (this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showRowGrandTotals) && this.colDepth === rPos) ? cell.length : gSumFlag ? (newPos - totPos) : newPos;
19931
20215
  if (cell[currPos]) {
19932
20216
  this.pivotValues[rPos] = [cell[currPos]];
19933
20217
  this.pivotValues[rPos][0].rowIndex = rPos;
19934
- this.valueContent[newPos][0] = this.pivotValues[rPos][0];
20218
+ this.valueContent[valuePos][0] = this.pivotValues[rPos][0];
19935
20219
  }
19936
20220
  newPos++;
20221
+ valuePos++;
19937
20222
  if (this.pivotValues[rPos][0].type === 'grand sum') {
19938
20223
  gSumFlag = true;
19939
20224
  totPos = newPos;
@@ -22250,6 +22535,8 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
22250
22535
  _this_1.request = new XMLHttpRequest();
22251
22536
  /** @hidden */
22252
22537
  _this_1.isServerWaitingPopup = false;
22538
+ /** @hidden */
22539
+ _this_1.actionObj = {};
22253
22540
  _this_1.pivotView = _this_1;
22254
22541
  setValue('mergePersistData', _this_1.mergePersistPivotData, _this_1);
22255
22542
  return _this_1;
@@ -22292,10 +22579,10 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
22292
22579
  modules.push({ args: [this], member: 'grouping' });
22293
22580
  }
22294
22581
  if (this.allowDrillThrough || (this.editSettings && this.editSettings.allowEditing)) {
22295
- modules.push({ args: [this], member: 'drillthrough' });
22582
+ modules.push({ args: [this], member: 'drillThrough' });
22296
22583
  }
22297
22584
  if (this.displayOption.view !== 'Table') {
22298
- modules.push({ args: [this], member: 'pivotchart' });
22585
+ modules.push({ args: [this], member: 'pivotChart' });
22299
22586
  }
22300
22587
  return modules;
22301
22588
  };
@@ -22875,7 +23162,7 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
22875
23162
  this.setProperties({ gridSettings: { allowSelection: true, selectionSettings: { cellSelectionMode: 'Box', mode: 'Cell', type: 'Multiple' } } }, true);
22876
23163
  }
22877
23164
  if (this.displayOption.view !== 'Table') {
22878
- this.chartModule = new PivotChart();
23165
+ this.pivotChartModule = new PivotChart();
22879
23166
  }
22880
23167
  this.currentView = this.currentView ? this.currentView : (this.displayOption.view === 'Both' ?
22881
23168
  this.displayOption.primary : this.displayOption.view);
@@ -23142,32 +23429,37 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23142
23429
  };
23143
23430
  PivotView.prototype.initialLoad = function () {
23144
23431
  var _this_1 = this;
23145
- this.cellTemplateFn = this.templateParser(this.cellTemplate);
23146
- this.tooltipTemplateFn = this.templateParser(this.tooltipTemplate);
23147
- if (this.spinnerTemplate) {
23148
- createSpinner({ target: this.element, template: this.spinnerTemplate }, this.createElement);
23432
+ try {
23433
+ this.cellTemplateFn = this.templateParser(this.cellTemplate);
23434
+ this.tooltipTemplateFn = this.templateParser(this.tooltipTemplate);
23435
+ if (this.spinnerTemplate) {
23436
+ createSpinner({ target: this.element, template: this.spinnerTemplate }, this.createElement);
23437
+ }
23438
+ else {
23439
+ createSpinner({ target: this.element }, this.createElement);
23440
+ }
23441
+ var loadArgs = {
23442
+ dataSourceSettings: this.dataSourceSettings,
23443
+ pivotview: this,
23444
+ fieldsType: {}
23445
+ };
23446
+ this.trigger(load, loadArgs, function (observedArgs) {
23447
+ _this_1.dataSourceSettings = observedArgs.dataSourceSettings;
23448
+ _this_1.fieldsType = observedArgs.fieldsType;
23449
+ _this_1.updateClass();
23450
+ _this_1.notify(initSubComponent, {});
23451
+ if (_this_1.dataSourceSettings.mode !== 'Server') {
23452
+ _this_1.notify(initialLoad, {});
23453
+ }
23454
+ if (_this_1.isAdaptive) {
23455
+ _this_1.contextMenuModule.render();
23456
+ }
23457
+ _this_1.notify(initToolbar, {});
23458
+ });
23149
23459
  }
23150
- else {
23151
- createSpinner({ target: this.element }, this.createElement);
23460
+ catch (execption) {
23461
+ this.actionFailureMethod(execption);
23152
23462
  }
23153
- var loadArgs = {
23154
- dataSourceSettings: this.dataSourceSettings,
23155
- pivotview: this,
23156
- fieldsType: {}
23157
- };
23158
- this.trigger(load, loadArgs, function (observedArgs) {
23159
- _this_1.dataSourceSettings = observedArgs.dataSourceSettings;
23160
- _this_1.fieldsType = observedArgs.fieldsType;
23161
- _this_1.updateClass();
23162
- _this_1.notify(initSubComponent, {});
23163
- if (_this_1.dataSourceSettings.mode !== 'Server') {
23164
- _this_1.notify(initialLoad, {});
23165
- }
23166
- if (_this_1.isAdaptive) {
23167
- _this_1.contextMenuModule.render();
23168
- }
23169
- _this_1.notify(initToolbar, {});
23170
- });
23171
23463
  };
23172
23464
  /**
23173
23465
  * Register the internal events.
@@ -23198,12 +23490,32 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23198
23490
  /* eslint-disable */
23199
23491
  var columnRender = this.gridSettings['columnRender'];
23200
23492
  var chartLoadEvent = this.chartSettings['load'];
23493
+ var chartLoadedEvent = this.chartSettings['loaded'];
23494
+ var chartTextRenderEvent = this.chartSettings['textRender'];
23495
+ var chartPointRenderEvent = this.chartSettings['pointRender'];
23496
+ var chartSeriesRenderEvent = this.chartSettings['seriesRender'];
23497
+ var chartLegendRenderEvent = this.chartSettings['legendRender'];
23498
+ var chartPointClickEvent = this.chartSettings['pointClick'];
23499
+ var chartTooltipRenderEvent = this.chartSettings['tooltipRender'];
23201
23500
  this.gridSettings['columnRender'] = undefined;
23202
23501
  this.chartSettings['tooltipRender'] = undefined;
23203
23502
  this.chartSettings['load'] = undefined;
23503
+ this.chartSettings['loaded'] = undefined;
23504
+ this.chartSettings['textRender'] = undefined;
23505
+ this.chartSettings['pointRender'] = undefined;
23506
+ this.chartSettings['seriesRender'] = undefined;
23507
+ this.chartSettings['legendRender'] = undefined;
23508
+ this.chartSettings['pointClick'] = undefined;
23204
23509
  var persistData = this.addOnPersist(keyEntity);
23205
23510
  this.gridSettings['columnRender'] = columnRender;
23206
23511
  this.chartSettings['load'] = chartLoadEvent;
23512
+ this.chartSettings['loaded'] = chartLoadedEvent;
23513
+ this.chartSettings['textRender'] = chartTextRenderEvent;
23514
+ this.chartSettings['pointRender'] = chartPointRenderEvent;
23515
+ this.chartSettings['seriesRender'] = chartSeriesRenderEvent;
23516
+ this.chartSettings['legendRender'] = chartLegendRenderEvent;
23517
+ this.chartSettings['pointClick'] = chartPointClickEvent;
23518
+ this.chartSettings['tooltipRender'] = chartTooltipRenderEvent;
23207
23519
  /* eslint-enable */
23208
23520
  return persistData;
23209
23521
  };
@@ -23386,15 +23698,15 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23386
23698
  if (!this.grid && newProp.displayOption.view !== 'Chart') {
23387
23699
  this.renderEmptyGrid();
23388
23700
  if (newProp.displayOption.view === 'Table') {
23389
- if (this.chartModule) {
23390
- this.chartModule.destroy();
23701
+ if (this.pivotChartModule) {
23702
+ this.pivotChartModule.destroy();
23391
23703
  this.chart = undefined;
23392
- this.chartModule = undefined;
23704
+ this.pivotChartModule = undefined;
23393
23705
  }
23394
23706
  }
23395
23707
  }
23396
- else if (!this.chartModule && this.displayOption.view !== 'Table') {
23397
- this.chartModule = new PivotChart();
23708
+ else if (!this.pivotChartModule && this.displayOption.view !== 'Table') {
23709
+ this.pivotChartModule = new PivotChart();
23398
23710
  }
23399
23711
  }
23400
23712
  else if (this.showToolbar && !isNullOrUndefined(newProp.displayOption) && newProp.displayOption.view) {
@@ -23424,12 +23736,12 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23424
23736
  (newProp.chartSettings.chartSeries && Object.keys(newProp.chartSettings.chartSeries).indexOf('type') !== -1))) {
23425
23737
  this.groupingBarModule.renderLayout();
23426
23738
  }
23427
- if (isNullOrUndefined(this.chartModule) && this.displayOption.view !== 'Table') {
23428
- this.chartModule = new PivotChart();
23739
+ if (isNullOrUndefined(this.pivotChartModule) && this.displayOption.view !== 'Table') {
23740
+ this.pivotChartModule = new PivotChart();
23429
23741
  }
23430
23742
  var engineModule = this.dataType === 'pivot' ? this.engineModule : this.olapEngineModule;
23431
- if (!isNullOrUndefined(this.chartModule) && !isNullOrUndefined(engineModule.pivotValues)) {
23432
- this.chartModule.loadChart(this, this.chartSettings);
23743
+ if (!isNullOrUndefined(this.pivotChartModule) && !isNullOrUndefined(engineModule.pivotValues)) {
23744
+ this.pivotChartModule.loadChart(this, this.chartSettings);
23433
23745
  }
23434
23746
  if (!isNullOrUndefined(engineModule.pivotValues) && !isNullOrUndefined(engineModule.fieldList)) {
23435
23747
  this.notify(uiUpdate, this);
@@ -23456,6 +23768,9 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23456
23768
  if (this.element.querySelector('.e-grouping-bar')) {
23457
23769
  this.element.querySelector('.e-grouping-bar').remove();
23458
23770
  }
23771
+ else if (this.groupingBarModule) {
23772
+ this.groupingBarModule.renderLayout();
23773
+ }
23459
23774
  if (isNullOrUndefined(newProp.showFieldList))
23460
23775
  this.renderPivotGrid();
23461
23776
  break;
@@ -23549,9 +23864,9 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23549
23864
  */
23550
23865
  PivotView.prototype.renderPivotGrid = function () {
23551
23866
  this.clearTemplate();
23552
- if (this.chartModule) {
23553
- this.chartModule.engineModule = this.engineModule;
23554
- this.chartModule.loadChart(this, this.chartSettings);
23867
+ if (this.pivotChartModule) {
23868
+ this.pivotChartModule.engineModule = this.engineModule;
23869
+ this.pivotChartModule.loadChart(this, this.chartSettings);
23555
23870
  if (this.enableRtl && this.chart && document.body.getAttribute('dir') !== 'rtl') {
23556
23871
  addClass([this.chart.element], PIVOTCHART_LTR);
23557
23872
  }
@@ -23582,7 +23897,7 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23582
23897
  this.applyHyperlinkSettings();
23583
23898
  }
23584
23899
  this.renderModule = this.renderModule ? this.renderModule : new Render(this);
23585
- this.renderModule.render();
23900
+ this.renderModule.render(true);
23586
23901
  }
23587
23902
  else if (this.grid) {
23588
23903
  remove(this.grid.element);
@@ -23598,7 +23913,9 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23598
23913
  if (this.toolbarModule && this.toolbarModule.toolbar) {
23599
23914
  this.toolbarModule.toolbar.width = this.getGridWidthAsNumber() - 2;
23600
23915
  }
23601
- this.chart.element.style.width = formatUnit(this.getGridWidthAsNumber());
23916
+ if (this.chartSettings.enableScrollOnMultiAxis && this.chartSettings.enableMultipleAxis) {
23917
+ this.element.querySelector('.' + PIVOTCHART).style.width = formatUnit(this.getGridWidthAsNumber());
23918
+ }
23602
23919
  this.chart.width = formatUnit(this.getGridWidthAsNumber());
23603
23920
  if (this.currentView === 'Table') {
23604
23921
  this.grid.element.style.display = '';
@@ -23618,7 +23935,13 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23618
23935
  }
23619
23936
  if (this.toolbarModule) {
23620
23937
  if (this.showFieldList && select('#' + this.element.id + '_PivotFieldList', this.element)) {
23621
- select('#' + this.element.id + '_PivotFieldList', this.element).style.display = 'none';
23938
+ if (this.toolbar && this.toolbar.indexOf('FieldList') !== -1) {
23939
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.display = 'none';
23940
+ }
23941
+ else {
23942
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.top = this.element.querySelector('.' + GRID_TOOLBAR).offsetHeight.toString() + 'px';
23943
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.position = 'relative';
23944
+ }
23622
23945
  }
23623
23946
  if (this.toolbar && this.toolbar.indexOf('FieldList') !== -1 &&
23624
23947
  this.showToolbar && this.element.querySelector('.e-toggle-field-list')) {
@@ -23770,7 +24093,9 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23770
24093
  isDrillThrough: (pivot.allowDrillThrough || pivot.editSettings.allowEditing),
23771
24094
  localeObj: pivot.localeObj,
23772
24095
  fieldsType: pivot.fieldsType,
23773
- clonedReport: pivot.clonedReport
24096
+ clonedReport: pivot.clonedReport,
24097
+ globalize: pivot.globalize,
24098
+ currenyCode: pivot.currencyCode
23774
24099
  };
23775
24100
  /* eslint-enable @typescript-eslint/indent */
23776
24101
  if (pivot.dataSourceSettings.mode === 'Server') {
@@ -23820,6 +24145,14 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23820
24145
  this.exportType = 'Excel';
23821
24146
  this.grid.excelExport(excelExportProperties, isMultipleExport, workbook, isBlob);
23822
24147
  }
24148
+ this.actionObj.actionName = this.getActionCompleteName();
24149
+ var actionInfo = {
24150
+ exportInfo: { type: this.exportType, info: excelExportProperties }
24151
+ };
24152
+ this.actionObj.actionInfo = actionInfo;
24153
+ if (this.actionObj.actionName) {
24154
+ this.actionCompleteMethod();
24155
+ }
23823
24156
  };
23824
24157
  /**
23825
24158
  * Export PivotGrid data to CSV file.
@@ -23837,6 +24170,14 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23837
24170
  this.exportType = 'CSV';
23838
24171
  this.grid.csvExport(excelExportProperties, isMultipleExport, workbook, isBlob);
23839
24172
  }
24173
+ this.actionObj.actionName = this.getActionCompleteName();
24174
+ var actionInfo = {
24175
+ exportInfo: { type: this.exportType, info: excelExportProperties }
24176
+ };
24177
+ this.actionObj.actionInfo = actionInfo;
24178
+ if (this.actionObj.actionName) {
24179
+ this.actionCompleteMethod();
24180
+ }
23840
24181
  };
23841
24182
  /**
23842
24183
  * Export Pivot widget data to PDF document.
@@ -23853,6 +24194,14 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23853
24194
  else {
23854
24195
  this.grid.pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
23855
24196
  }
24197
+ this.actionObj.actionName = this.getActionCompleteName();
24198
+ var actionInfo = {
24199
+ exportInfo: { type: 'PDF', info: pdfExportProperties }
24200
+ };
24201
+ this.actionObj.actionInfo = actionInfo;
24202
+ if (this.actionObj.actionName) {
24203
+ this.actionCompleteMethod();
24204
+ }
23856
24205
  };
23857
24206
  /**
23858
24207
  * Export method for the chart.
@@ -23867,6 +24216,14 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23867
24216
  if (this.chart && this.chart.enableExport) {
23868
24217
  this.chart.exportModule.export(type, fileName, orientation, null, width, height);
23869
24218
  }
24219
+ this.actionObj.actionName = this.getActionCompleteName();
24220
+ var actionInfo = {
24221
+ exportInfo: { type: type, info: fileName }
24222
+ };
24223
+ this.actionObj.actionInfo = actionInfo;
24224
+ if (this.actionObj.actionName) {
24225
+ this.actionCompleteMethod();
24226
+ }
23870
24227
  };
23871
24228
  /**
23872
24229
  * Print method for the chart.
@@ -23978,6 +24335,10 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
23978
24335
  };
23979
24336
  _this_1.trigger(enginePopulated, eventArgs);
23980
24337
  pivot_1.engineModule.pivotValues = eventArgs.pivotValues;
24338
+ var actionInfo = {
24339
+ drillInfo: drilledItem_1
24340
+ };
24341
+ _this_1.actionObj.actionInfo = actionInfo;
23981
24342
  pivot_1.renderPivotGrid();
23982
24343
  }
23983
24344
  else {
@@ -24330,6 +24691,12 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
24330
24691
  this.unwireEvents();
24331
24692
  this.wireEvents();
24332
24693
  this.isChartLoaded = false;
24694
+ this.actionObj.actionName = this.getActionCompleteName();
24695
+ if (this.actionObj.actionName) {
24696
+ if (this.actionObj.actionName !== windowResize) {
24697
+ this.actionCompleteMethod();
24698
+ }
24699
+ }
24333
24700
  };
24334
24701
  PivotView.prototype.setToolTip = function (args) {
24335
24702
  var colIndex = Number(args.target.getAttribute('aria-colindex'));
@@ -24361,6 +24728,13 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
24361
24728
  if (cell && this.engineModule.fieldList[cell.actualText]) {
24362
24729
  var field = this.engineModule.fieldList[cell.actualText];
24363
24730
  aggregateType = field.aggregateType;
24731
+ if ((aggregateType !== 'DistinctCount') && (field.type !== 'number' || field.type === 'include' ||
24732
+ field.type === 'exclude')) {
24733
+ aggregateType = 'Count';
24734
+ }
24735
+ else {
24736
+ aggregateType = (aggregateType === undefined) ? 'Sum' : field.aggregateType;
24737
+ }
24364
24738
  caption = field.caption;
24365
24739
  hasField = true;
24366
24740
  }
@@ -24580,76 +24954,105 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
24580
24954
  ele = target.parentElement.parentElement;
24581
24955
  }
24582
24956
  this.CellClicked(target, e);
24583
- if ((ele.parentElement.parentElement.parentElement.parentElement.classList.contains('e-movableheader')
24584
- && this.dataSourceSettings.valueAxis === 'column') || (ele.parentElement.classList.contains('e-row') &&
24585
- this.dataSourceSettings.valueAxis === 'row') && (ele.classList.contains('e-rowsheader') ||
24586
- ele.classList.contains('e-stot'))) {
24587
- var colIndex = Number(ele.getAttribute('aria-colindex'));
24588
- var rowIndex = Number(ele.getAttribute('index'));
24589
- if (this.dataSourceSettings.valueAxis === 'row' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
24590
- var header = this.pivotValues[rowIndex][colIndex];
24591
- if (this.dataSourceSettings.valueIndex === -1) {
24592
- rowIndex = header.type === 'value' ? rowIndex : (rowIndex + 1);
24593
- }
24594
- else {
24595
- var level = this.getLevel(header);
24596
- rowIndex = (level <= this.engineModule.measureIndex &&
24597
- header.members && header.members.length > 0) ? header.members[0].rowIndex : rowIndex;
24957
+ try {
24958
+ if ((ele.parentElement.parentElement.parentElement.parentElement.classList.contains('e-movableheader')
24959
+ && this.dataSourceSettings.valueAxis === 'column') || (ele.parentElement.classList.contains('e-row') &&
24960
+ this.dataSourceSettings.valueAxis === 'row') && (ele.classList.contains('e-rowsheader') ||
24961
+ ele.classList.contains('e-stot'))) {
24962
+ var FieldName = target.parentElement.getAttribute('fieldname');
24963
+ var fieldInfo = PivotUtil.getFieldInfo(FieldName, this);
24964
+ this.actionObj.actionName = sortValue;
24965
+ this.actionObj.fieldInfo = fieldInfo.fieldItem;
24966
+ if (this.actionBeginMethod()) {
24967
+ return;
24598
24968
  }
24599
- }
24600
- else if (this.dataSourceSettings.valueAxis === 'column' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
24601
- colIndex = (Number(ele.getAttribute('aria-colindex')) + Number(ele.getAttribute('aria-colspan')) - 1);
24602
- rowIndex = this.engineModule.headerContent.length - 1;
24603
- }
24604
- this.setProperties({
24605
- dataSourceSettings: {
24606
- valueSortSettings: {
24607
- columnIndex: (Number(ele.getAttribute('aria-colindex')) +
24608
- Number(ele.getAttribute('aria-colspan')) - 1),
24609
- sortOrder: this.dataSourceSettings.valueSortSettings.sortOrder === 'Descending' ? 'Ascending' : 'Descending',
24610
- headerText: this.pivotValues[rowIndex][colIndex].valueSort.levelName,
24611
- headerDelimiter: this.dataSourceSettings.valueSortSettings.headerDelimiter ?
24612
- this.dataSourceSettings.valueSortSettings.headerDelimiter : '.'
24969
+ var colIndex = Number(ele.getAttribute('aria-colindex'));
24970
+ var rowIndex = Number(ele.getAttribute('index'));
24971
+ if (this.dataSourceSettings.valueAxis === 'row' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
24972
+ var header = this.pivotValues[rowIndex][colIndex];
24973
+ if (this.dataSourceSettings.valueIndex === -1) {
24974
+ rowIndex = header.type === 'value' ? rowIndex : (rowIndex + 1);
24613
24975
  }
24614
- }
24615
- }, true);
24616
- this.showWaitingPopup();
24617
- var pivot = this; /* eslint-disable-line */
24618
- pivot.engineModule.enableValueSorting = true;
24619
- if (pivot.enableVirtualization) {
24620
- if (pivot.dataSourceSettings.enableSorting) {
24621
- for (var _i = 0, _a = Object.keys(pivot.engineModule.fieldList); _i < _a.length; _i++) {
24622
- var key = _a[_i];
24623
- pivot.engineModule.fieldList[key].sort = 'Ascending';
24976
+ else {
24977
+ var level = this.getLevel(header);
24978
+ rowIndex = (level <= this.engineModule.measureIndex &&
24979
+ header.members && header.members.length > 0) ? header.members[0].rowIndex : rowIndex;
24980
+ }
24981
+ }
24982
+ else if (this.dataSourceSettings.valueAxis === 'column' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
24983
+ colIndex = (Number(ele.getAttribute('aria-colindex')) + Number(ele.getAttribute('aria-colspan')) - 1);
24984
+ rowIndex = this.engineModule.headerContent.length - 1;
24985
+ }
24986
+ this.setProperties({
24987
+ dataSourceSettings: {
24988
+ valueSortSettings: {
24989
+ columnIndex: (Number(ele.getAttribute('aria-colindex')) +
24990
+ Number(ele.getAttribute('aria-colspan')) - 1),
24991
+ sortOrder: this.dataSourceSettings.valueSortSettings.sortOrder === 'Descending' ? 'Ascending' : 'Descending',
24992
+ headerText: this.pivotValues[rowIndex][colIndex].valueSort.levelName,
24993
+ headerDelimiter: this.dataSourceSettings.valueSortSettings.headerDelimiter ?
24994
+ this.dataSourceSettings.valueSortSettings.headerDelimiter : '.'
24995
+ }
24996
+ }
24997
+ }, true);
24998
+ this.showWaitingPopup();
24999
+ var pivot = this; /* eslint-disable-line */
25000
+ pivot.engineModule.enableValueSorting = true;
25001
+ if (pivot.enableVirtualization) {
25002
+ if (pivot.dataSourceSettings.enableSorting) {
25003
+ for (var _i = 0, _a = Object.keys(pivot.engineModule.fieldList); _i < _a.length; _i++) {
25004
+ var key = _a[_i];
25005
+ pivot.engineModule.fieldList[key].sort = 'Ascending';
25006
+ }
25007
+ pivot.setProperties({ dataSourceSettings: { sortSettings: [] } }, true);
25008
+ }
25009
+ if (pivot.dataSourceSettings.mode === 'Server') {
25010
+ pivot.getEngine('onValueSort', null, null, null, null, null, null);
25011
+ }
25012
+ else {
25013
+ pivot.engineModule.rMembers = pivot.engineModule.headerCollection.rowHeaders;
25014
+ pivot.engineModule.cMembers = pivot.engineModule.headerCollection.columnHeaders;
25015
+ pivot.engineModule.applyValueSorting();
25016
+ pivot.engineModule.updateEngine();
24624
25017
  }
24625
- pivot.setProperties({ dataSourceSettings: { sortSettings: [] } }, true);
24626
25018
  }
24627
- if (pivot.dataSourceSettings.mode === 'Server') {
25019
+ else if (pivot.dataSourceSettings.mode === 'Server') {
24628
25020
  pivot.getEngine('onValueSort', null, null, null, null, null, null);
24629
25021
  }
24630
25022
  else {
24631
- pivot.engineModule.rMembers = pivot.engineModule.headerCollection.rowHeaders;
24632
- pivot.engineModule.cMembers = pivot.engineModule.headerCollection.columnHeaders;
24633
- pivot.engineModule.applyValueSorting();
24634
- pivot.engineModule.updateEngine();
25023
+ pivot.engineModule.generateGridData(pivot.dataSourceSettings, true);
24635
25024
  }
25025
+ pivot.allowServerDataBinding = false;
25026
+ pivot.setProperties({ pivotValues: pivot.engineModule.pivotValues }, true);
25027
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
25028
+ delete pivot.bulkChanges.pivotValues;
25029
+ pivot.allowServerDataBinding = true;
25030
+ var actionInfo = {
25031
+ valueSortInfo: this.engineModule.valueSortSettings
25032
+ };
25033
+ this.actionObj.actionInfo = actionInfo;
25034
+ pivot.renderPivotGrid();
24636
25035
  }
24637
- else if (pivot.dataSourceSettings.mode === 'Server') {
24638
- pivot.getEngine('onValueSort', null, null, null, null, null, null);
24639
- }
24640
- else {
24641
- pivot.engineModule.generateGridData(pivot.dataSourceSettings, true);
24642
- }
24643
- pivot.allowServerDataBinding = false;
24644
- pivot.setProperties({ pivotValues: pivot.engineModule.pivotValues }, true);
24645
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
24646
- delete pivot.bulkChanges.pivotValues;
24647
- pivot.allowServerDataBinding = true;
24648
- pivot.renderPivotGrid();
25036
+ }
25037
+ catch (execption) {
25038
+ this.actionFailureMethod(execption);
24649
25039
  }
24650
25040
  }
24651
25041
  else if (target.classList.contains(COLLAPSE) || target.classList.contains(EXPAND)) {
24652
- this.onDrill(target);
25042
+ var drillFieldName = target.parentElement.getAttribute('fieldname');
25043
+ var fieldInfo = PivotUtil.getFieldInfo(drillFieldName, this);
25044
+ var actionName = target.classList.contains(COLLAPSE) ? this.actionObj.actionName = drillUp : target.classList.contains(EXPAND) ? this.actionObj.actionName = drillDown : '';
25045
+ this.actionObj.actionName = actionName;
25046
+ this.actionObj.fieldInfo = fieldInfo.fieldItem;
25047
+ if (this.actionBeginMethod()) {
25048
+ return;
25049
+ }
25050
+ try {
25051
+ this.onDrill(target);
25052
+ }
25053
+ catch (execption) {
25054
+ this.actionFailureMethod(execption);
25055
+ }
24653
25056
  }
24654
25057
  else {
24655
25058
  this.CellClicked(target, e);
@@ -24751,7 +25154,8 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
24751
25154
  var firstColWidth = this.pivotColumns[0].width;
24752
25155
  var eventArgs = {
24753
25156
  columns: this.pivotColumns,
24754
- dataSourceSettings: this.dataSourceSettings
25157
+ dataSourceSettings: this.dataSourceSettings,
25158
+ stackedColumns: this.getStackedColumns(gridcolumns, [])
24755
25159
  };
24756
25160
  this.trigger(beforeColumnsRender, eventArgs);
24757
25161
  if (this.enableVirtualization && eventArgs.columns.length > 0 && eventArgs.columns[0].width !== gridcolumns[0].width) {
@@ -24856,8 +25260,16 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
24856
25260
  /* eslint-disable-next-line */
24857
25261
  /** @hidden */
24858
25262
  PivotView.prototype.onWindowResize = function () {
25263
+ this.actionObj.actionName = windowResize;
25264
+ if (this.actionBeginMethod()) {
25265
+ return;
25266
+ }
24859
25267
  clearTimeout(this.timeOutObj);
24860
25268
  this.timeOutObj = setTimeout(this.layoutRefresh.bind(this), 500);
25269
+ this.actionObj.actionName = this.getActionCompleteName();
25270
+ if (this.actionObj.actionName) {
25271
+ this.actionCompleteMethod();
25272
+ }
24861
25273
  };
24862
25274
  /**
24863
25275
  * Refreshes the Pivot Table for blazor layoutRefresh is called for other base refresh is called.
@@ -25252,7 +25664,9 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
25252
25664
  isDrillThrough: (_this_1.allowDrillThrough || _this_1.editSettings.allowEditing),
25253
25665
  localeObj: _this_1.localeObj,
25254
25666
  fieldsType: _this_1.fieldsType,
25255
- clonedReport: _this_1.clonedReport
25667
+ clonedReport: _this_1.clonedReport,
25668
+ globalize: _this_1.globalize,
25669
+ currenyCode: _this_1.currencyCode
25256
25670
  };
25257
25671
  if (_this_1.dataType === 'pivot') {
25258
25672
  if (_this_1.dataSourceSettings.groupSettings && _this_1.dataSourceSettings.groupSettings.length > 0) {
@@ -25478,7 +25892,8 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
25478
25892
  var str = 'color: ' + format[k].style.color + '!important;background-color: ' + format[k].style.backgroundColor +
25479
25893
  '!important;font-size: ' + format[k].style.fontSize + '!important;font-family: ' + format[k].style.fontFamily +
25480
25894
  ' !important;';
25481
- sheet.insertRule('.format' + this.element.id + k + '{' + str + '}', 0);
25895
+ var formatClass = '.format' + this.element.id + k;
25896
+ sheet.insertRule(formatClass + ', ' + formatClass + ' .e-cellvalue' + '{' + str + '}', 0);
25482
25897
  }
25483
25898
  }
25484
25899
  };
@@ -25705,6 +26120,65 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
25705
26120
  EventHandler.remove(document, this.isAdaptive ? 'touchend' : 'click', this.removeButtonFocus);
25706
26121
  window.removeEventListener('resize', this.onWindowResize.bind(this), true);
25707
26122
  };
26123
+ /** @hidden */
26124
+ PivotView.prototype.actionBeginMethod = function () {
26125
+ var eventArgs = {
26126
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
26127
+ actionName: this.actionObj.actionName,
26128
+ fieldInfo: this.actionObj.fieldInfo,
26129
+ cancel: false
26130
+ };
26131
+ this.trigger(actionBegin, eventArgs);
26132
+ return eventArgs.cancel;
26133
+ };
26134
+ /** @hidden */
26135
+ PivotView.prototype.actionCompleteMethod = function () {
26136
+ var eventArgs = {
26137
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
26138
+ actionName: this.actionObj.actionName,
26139
+ fieldInfo: this.actionObj.fieldInfo,
26140
+ actionInfo: this.actionObj.actionInfo
26141
+ };
26142
+ this.trigger(actionComplete, eventArgs);
26143
+ this.actionObj.actionName = '';
26144
+ this.actionObj.actionInfo = undefined;
26145
+ this.actionObj.fieldInfo = undefined;
26146
+ };
26147
+ /** @hidden */
26148
+ PivotView.prototype.actionFailureMethod = function (error) {
26149
+ var eventArgs = {
26150
+ actionName: this.actionObj.actionName,
26151
+ errorInfo: error
26152
+ };
26153
+ this.trigger(actionFailure, eventArgs);
26154
+ };
26155
+ /** @hidden */
26156
+ PivotView.prototype.getActionCompleteName = function () {
26157
+ var actionName = (this.actionObj.actionName == openConditionalFormatting) ? conditionallyFormatted : (this.actionObj.actionName == openNumberFormatting) ? numberFormatted
26158
+ : (this.actionObj.actionName == tableView) ? tableViewed : (this.actionObj.actionName == chartView) ? chartViewed : (this.actionObj.actionName == hideSubTotals) ? subTotalsHidden : (this.actionObj.actionName == subTotalsRow) ? subTotalsRowShown
26159
+ : (this.actionObj.actionName == subTotalsColumn) ? subTotalsColumnShown : (this.actionObj.actionName == showSubTotals) ? subTotalsShown : (this.actionObj.actionName == hideGrandTotals) ? grandTotalsHidden
26160
+ : (this.actionObj.actionName == grandTotalsRow) ? grandTotalsRowShown : (this.actionObj.actionName == grandTotalsColumn) ? grandTotalsColumnShown : (this.actionObj.actionName == showGrandTotals) ? grandTotalsShown
26161
+ : (this.actionObj.actionName == sortValue) ? valueSorted : (this.actionObj.actionName == openCalculatedField) ? calculatedFieldApplied : (this.actionObj.actionName == editCalculatedField) ? calculatedFieldEdited : (this.actionObj.actionName == sortField) ? fieldSorted
26162
+ : (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
26163
+ : this.actionObj.actionName == saveEditedRecords ? editedRecordsSaved : this.actionObj.actionName == addNewRecord ? newRecordAdded
26164
+ : this.actionObj.actionName == removeRecord ? recordRemoved : (this.actionObj.actionName == pngExport) ? pngExported : (this.actionObj.actionName == jpegExport) ? jpegExported
26165
+ : (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
26166
+ : this.actionObj.actionName == saveCurrentReport ? reportSaved : (this.actionObj.actionName == addNewReport) ? newReportAdded : (this.actionObj.actionName == saveAsCurrentReport) ? reportReSaved
26167
+ : (this.actionObj.actionName == renameCurrentReport) ? reportRenamed : this.actionObj.actionName;
26168
+ return actionName;
26169
+ };
26170
+ /* eslint-disable-next-line */
26171
+ /** @hidden */
26172
+ PivotView.prototype.getStackedColumns = function (gridcolumns, stackedColumns) {
26173
+ for (var _i = 0, gridcolumns_4 = gridcolumns; _i < gridcolumns_4.length; _i++) {
26174
+ var column = gridcolumns_4[_i];
26175
+ stackedColumns.push(column);
26176
+ if (column.columns && column.columns.length > 0) {
26177
+ this.getStackedColumns(column.columns, stackedColumns);
26178
+ }
26179
+ }
26180
+ return stackedColumns;
26181
+ };
25708
26182
  /**
25709
26183
  * To destroy the PivotView elements.
25710
26184
  * @returns {void}
@@ -25768,8 +26242,8 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
25768
26242
  if (this.commonModule) {
25769
26243
  this.commonModule.destroy();
25770
26244
  }
25771
- if (this.chartModule) {
25772
- this.chartModule.destroy();
26245
+ if (this.pivotChartModule) {
26246
+ this.pivotChartModule.destroy();
25773
26247
  }
25774
26248
  if (this.pivotButtonModule && !this.pivotButtonModule.isDestroyed) {
25775
26249
  this.pivotButtonModule.destroy();
@@ -25824,8 +26298,8 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
25824
26298
  if (this.commonModule) {
25825
26299
  this.commonModule = null;
25826
26300
  }
25827
- if (this.chartModule) {
25828
- this.chartModule = null;
26301
+ if (this.pivotChartModule) {
26302
+ this.pivotChartModule = null;
25829
26303
  }
25830
26304
  if (this.pivotButtonModule) {
25831
26305
  this.pivotButtonModule = null;
@@ -25845,6 +26319,12 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
25845
26319
  if (this.drillThroughModule) {
25846
26320
  this.drillThroughModule = null;
25847
26321
  }
26322
+ if (this.clonedDataSet) {
26323
+ this.clonedDataSet = null;
26324
+ }
26325
+ if (this.clonedReport) {
26326
+ this.clonedReport = null;
26327
+ }
25848
26328
  this.element.innerHTML = '';
25849
26329
  removeClass([this.element], ROOT);
25850
26330
  removeClass([this.element], RTL);
@@ -26187,6 +26667,15 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
26187
26667
  __decorate([
26188
26668
  Event()
26189
26669
  ], PivotView.prototype, "beforeServiceInvoke", void 0);
26670
+ __decorate([
26671
+ Event()
26672
+ ], PivotView.prototype, "actionBegin", void 0);
26673
+ __decorate([
26674
+ Event()
26675
+ ], PivotView.prototype, "actionComplete", void 0);
26676
+ __decorate([
26677
+ Event()
26678
+ ], PivotView.prototype, "actionFailure", void 0);
26190
26679
  PivotView = __decorate([
26191
26680
  NotifyPropertyChanges
26192
26681
  ], PivotView);
@@ -26201,6 +26690,250 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
26201
26690
  * Renderer Export
26202
26691
  */
26203
26692
 
26693
+ /**
26694
+ * This is a file to perform common utility for OLAP and Relational datasource
26695
+ * @hidden
26696
+ */
26697
+ var PivotExportUtil = /** @__PURE__ @class */ (function () {
26698
+ function PivotExportUtil() {
26699
+ }
26700
+ /* eslint-disable @typescript-eslint/no-explicit-any */
26701
+ PivotExportUtil.getDefinedObj = function (data) {
26702
+ var keyPos = 0;
26703
+ var framedSet = {};
26704
+ /* eslint-enable @typescript-eslint/no-explicit-any */
26705
+ if (!(data === null || data === undefined)) {
26706
+ var fields = Object.keys(data);
26707
+ while (keyPos < fields.length) {
26708
+ if (!(data[fields[keyPos]] === null || data[fields[keyPos]] === undefined)) {
26709
+ framedSet[fields[keyPos]] = data[fields[keyPos]];
26710
+ }
26711
+ keyPos++;
26712
+ }
26713
+ }
26714
+ else {
26715
+ framedSet = data;
26716
+ }
26717
+ return framedSet;
26718
+ };
26719
+ PivotExportUtil.getClonedPivotValues = function (pivotValues) {
26720
+ var clonedSets = [];
26721
+ for (var i = 0; i < pivotValues.length; i++) {
26722
+ if (pivotValues[i]) {
26723
+ clonedSets[i] = [];
26724
+ for (var j = 0; j < pivotValues[i].length; j++) {
26725
+ if (pivotValues[i][j]) {
26726
+ /* eslint-disable */
26727
+ clonedSets[i][j] = this.getClonedPivotValueObj(pivotValues[i][j]);
26728
+ /* eslint-enable */
26729
+ }
26730
+ }
26731
+ }
26732
+ }
26733
+ return clonedSets;
26734
+ };
26735
+ /* eslint-disable */
26736
+ PivotExportUtil.getClonedPivotValueObj = function (data) {
26737
+ /* eslint-enable */
26738
+ var keyPos = 0;
26739
+ /* eslint-disable @typescript-eslint/no-explicit-any */
26740
+ var framedSet = {};
26741
+ /* eslint-enable @typescript-eslint/no-explicit-any */
26742
+ if (!(data === null || data === undefined)) {
26743
+ var fields = Object.keys(data);
26744
+ while (keyPos < fields.length) {
26745
+ framedSet[fields[keyPos]] = data[fields[keyPos]];
26746
+ keyPos++;
26747
+ }
26748
+ }
26749
+ else {
26750
+ framedSet = data;
26751
+ }
26752
+ return framedSet;
26753
+ };
26754
+ /* eslint-disable */
26755
+ PivotExportUtil.isContainCommonElements = function (collection1, collection2) {
26756
+ /* eslint-enable */
26757
+ for (var i = 0, cnt = collection1.length; i < cnt; i++) {
26758
+ for (var j = 0, lnt = collection2.length; j < lnt; j++) {
26759
+ if (collection2[j] === collection1[i]) {
26760
+ return true;
26761
+ }
26762
+ }
26763
+ }
26764
+ return false;
26765
+ };
26766
+ /* eslint-disable */
26767
+ PivotExportUtil.formatPdfHeaderFooter = function (pdf) {
26768
+ var contents = [];
26769
+ if (!isNullOrUndefined(pdf)) {
26770
+ for (var i = 0; i < pdf.length; i++) {
26771
+ var a = pdf[i];
26772
+ var content = {
26773
+ /* eslint-enable */
26774
+ type: a.Type,
26775
+ pageNumberType: a.PageNumberType,
26776
+ style: a.Style ? {
26777
+ penColor: a.Style.PenColor,
26778
+ penSize: a.Style.PenSize,
26779
+ dashStyle: a.Style.DashStyle,
26780
+ textBrushColor: a.Style.TextBrushColor,
26781
+ textPenColor: a.Style.TextPenColor,
26782
+ fontSize: a.Style.FontSize,
26783
+ hAlign: a.Style.HAlign,
26784
+ vAlign: a.Style.VAlign
26785
+ } : a.Style,
26786
+ points: a.Points !== null ? {
26787
+ x1: a.Points.X1,
26788
+ y1: a.Points.Y1,
26789
+ x2: a.Points.X2,
26790
+ y2: a.Points.Y2
26791
+ } : null,
26792
+ format: a.Format,
26793
+ position: a.Position !== null ? {
26794
+ x: a.Position.X,
26795
+ y: a.Position.Y
26796
+ } : null,
26797
+ size: a.Size !== null ? {
26798
+ height: a.Size.Height,
26799
+ width: a.Size.Width
26800
+ } : null,
26801
+ src: a.Src,
26802
+ value: a.Value,
26803
+ font: a.Font
26804
+ };
26805
+ contents.push(content);
26806
+ }
26807
+ }
26808
+ return contents;
26809
+ };
26810
+ /* eslint-disable */
26811
+ PivotExportUtil.formatPdfExportProperties = function (pdf) {
26812
+ var values;
26813
+ /* eslint-enable */
26814
+ values = this.getDefinedObj({
26815
+ pageOrientation: typeof pdf.PageOrientation === 'string' ? pdf.PageOrientation : null,
26816
+ pageSize: typeof pdf.PageSize === 'string' ? pdf.PageSize : null,
26817
+ header: !isNullOrUndefined(pdf.Header) ? {
26818
+ fromTop: pdf.Header.FromTop,
26819
+ height: pdf.Header.Height,
26820
+ contents: this.formatPdfHeaderFooter(pdf.Header.Contents)
26821
+ } : null,
26822
+ columns: pdf.Columns,
26823
+ footer: !isNullOrUndefined(pdf.Footer) ? {
26824
+ fromTop: pdf.Footer.FromBottom,
26825
+ height: pdf.Footer.Height,
26826
+ contents: this.formatPdfHeaderFooter(pdf.Footer.Contents)
26827
+ } : null,
26828
+ includeHiddenColumn: pdf.IncludeHiddenColumn,
26829
+ dataSource: pdf.DataSource,
26830
+ exportType: typeof pdf.ExportType === 'string' ? pdf.ExportType : null,
26831
+ theme: !isNullOrUndefined(pdf.Theme) ? {
26832
+ header: pdf.Theme.Header,
26833
+ record: pdf.Theme.Record,
26834
+ caption: pdf.Theme.Caption
26835
+ } : null,
26836
+ fileName: pdf.FileName,
26837
+ hierarchyExportMode: typeof pdf.HierarchyExportMode === 'string' ? pdf.HierarchyExportMode : null,
26838
+ allowHorizontalOverflow: pdf.AllowHorizontalOverflow
26839
+ });
26840
+ return values;
26841
+ };
26842
+ /* eslint-disable */
26843
+ PivotExportUtil.formatExcelStyle = function (style) {
26844
+ var prop;
26845
+ /* eslint-enable */
26846
+ if (!isNullOrUndefined(style)) {
26847
+ prop = this.getDefinedObj({
26848
+ fontColor: style.FontColor,
26849
+ fontName: style.FontName,
26850
+ fontSize: style.FontSize,
26851
+ hAlign: style.HAlign === String ? style.HAlign : null,
26852
+ vAlign: style.VAlign === String ? style.VAlign : null,
26853
+ bold: style.Bold,
26854
+ indent: style.Indent,
26855
+ italic: style.Italic,
26856
+ underline: style.Underline,
26857
+ backColor: style.BackColor,
26858
+ wrapText: style.WrapText,
26859
+ borders: style.Borders,
26860
+ numberFormat: style.NumberFormat,
26861
+ type: style.Type
26862
+ });
26863
+ }
26864
+ return prop;
26865
+ };
26866
+ /* eslint-disable */
26867
+ PivotExportUtil.formatExcelCell = function (cell) {
26868
+ var cells = [];
26869
+ if (!isNullOrUndefined(cell)) {
26870
+ for (var i = 0; i < cell.length; i++) {
26871
+ this.getDefinedObj({
26872
+ index: !isNullOrUndefined(cell[i].Index) ? cell[i].Index : null,
26873
+ colSpan: !isNullOrUndefined(cell[i].ColSpan) ? cell[i].ColSpan : null,
26874
+ value: !isNullOrUndefined(cell[i].Value) ? cell[i].Value : null,
26875
+ hyperlink: {
26876
+ target: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.Target : null,
26877
+ displayText: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.DisplayText : null
26878
+ },
26879
+ styles: this.formatExcelStyle(cell[i].Style),
26880
+ rowSpan: !isNullOrUndefined(cell[i].RowSpan) ? cell[i].RowSpan : null
26881
+ });
26882
+ /* eslint-enable */
26883
+ }
26884
+ }
26885
+ return cells;
26886
+ };
26887
+ /* eslint-disable */
26888
+ PivotExportUtil.formatExcelHeaderFooter = function (excel) {
26889
+ var rows = [];
26890
+ if (!isNullOrUndefined(excel)) {
26891
+ for (var i = 0; i < excel.Rows.length; i++) {
26892
+ var row = excel.Rows[i];
26893
+ var prop = this.getDefinedObj({
26894
+ index: !isNullOrUndefined(row.Index) ? row.Index : null,
26895
+ cells: this.formatExcelCell(row.Cells),
26896
+ grouping: !isNullOrUndefined(row.Grouping) ? row.Grouping : null
26897
+ });
26898
+ rows.push(prop);
26899
+ }
26900
+ }
26901
+ return rows;
26902
+ };
26903
+ PivotExportUtil.formatExcelExportProperties = function (excel) {
26904
+ /* eslint-enable */
26905
+ var prop;
26906
+ prop = this.getDefinedObj({
26907
+ dataSource: excel.DataSource,
26908
+ query: excel.Query,
26909
+ multipleExport: this.getDefinedObj({
26910
+ type: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.Type : null,
26911
+ blankRows: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.BlankRows : null
26912
+ }),
26913
+ header: this.getDefinedObj({
26914
+ headerRows: !isNullOrUndefined(excel.Header) ? excel.Header.HeaderRows : null,
26915
+ rows: this.formatExcelHeaderFooter(excel.Header)
26916
+ }),
26917
+ footer: this.getDefinedObj({
26918
+ footerRows: !isNullOrUndefined(excel.Footer) ? excel.Footer.FooterRows : null,
26919
+ rows: this.formatExcelHeaderFooter(excel.Footer)
26920
+ }),
26921
+ columns: excel.Columns,
26922
+ exportType: typeof excel.ExportType === 'string' ? excel.ExportType : undefined,
26923
+ includeHiddenColumn: excel.IncludeHiddenColumn,
26924
+ theme: !isNullOrUndefined(excel.Theme) ? {
26925
+ header: this.formatExcelStyle(excel.Theme.Header),
26926
+ record: this.formatExcelStyle(excel.Theme.Record),
26927
+ caption: this.formatExcelStyle(excel.Theme.Caption)
26928
+ } : undefined,
26929
+ fileName: excel.FileName,
26930
+ hierarchyExportMode: typeof excel.HierarchyExportMode === 'string' ? excel.HierarchyExportMode : undefined
26931
+ });
26932
+ return prop;
26933
+ };
26934
+ return PivotExportUtil;
26935
+ }());
26936
+
26204
26937
  /**
26205
26938
  * @hidden
26206
26939
  * `ExcelExport` module is used to handle the Excel export action.
@@ -26268,7 +27001,7 @@ var ExcelExport$1 = /** @__PURE__ @class */ (function () {
26268
27001
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
26269
27002
  /** Event trigerring */
26270
27003
  var clonedValues;
26271
- var currentPivotValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
27004
+ var currentPivotValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
26272
27005
  var customFileName = isFileNameSet ? exportProperties.fileName : 'default.xlsx';
26273
27006
  if (isHeaderSet) {
26274
27007
  this.addHeaderAndFooter(exportProperties.header, '', 'header', exportProperties.header.headerRows);
@@ -26278,7 +27011,7 @@ var ExcelExport$1 = /** @__PURE__ @class */ (function () {
26278
27011
  this.engine.pageSettings = null;
26279
27012
  this.engine.generateGridData(this.parent.dataSourceSettings, true);
26280
27013
  this.parent.applyFormatting(this.engine.pivotValues);
26281
- clonedValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
27014
+ clonedValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
26282
27015
  this.engine.pivotValues = currentPivotValues;
26283
27016
  this.engine.pageSettings = pageSettings;
26284
27017
  }
@@ -26322,15 +27055,17 @@ var ExcelExport$1 = /** @__PURE__ @class */ (function () {
26322
27055
  var pivotCell = pivotValues[rCnt][cCnt];
26323
27056
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
26324
27057
  var cellValue = pivotCell.axis === 'value' ? pivotCell.value : pivotCell.formattedText;
26325
- if (pivotCell.type === 'grand sum') {
26326
- cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'grandTotal') :
26327
- this.parent.localeObj.getConstant('grandTotal');
27058
+ var isgetValuesHeader = ((this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row')
27059
+ || (this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column'));
27060
+ if (pivotCell.type === 'grand sum' && !(this.parent.dataSourceSettings.values.length === 1 && this.parent.dataSourceSettings.valueAxis === 'row' && pivotCell.axis === 'column')) {
27061
+ cellValue = isgetValuesHeader ? this.parent.getValuesHeader(pivotCell, 'grandTotal') : this.parent.localeObj.getConstant('grandTotal');
26328
27062
  }
26329
27063
  else if (pivotCell.type === 'sum') {
26330
27064
  cellValue = cellValue.toString().replace('Total', this.parent.localeObj.getConstant('total'));
26331
27065
  }
26332
27066
  else {
26333
- cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'value') : cellValue;
27067
+ cellValue = (!isNullOrUndefined(pivotCell.valueSort) && (this.parent.localeObj.getConstant('grandTotal') + this.parent.dataSourceSettings.valueSortSettings.headerDelimiter + pivotCell.formattedText
27068
+ === pivotCell.valueSort.levelName) && isgetValuesHeader) ? this.parent.getValuesHeader(pivotCell, 'value') : cellValue;
26334
27069
  }
26335
27070
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
26336
27071
  cells.push({
@@ -26844,13 +27579,13 @@ var PDFExport = /** @__PURE__ @class */ (function () {
26844
27579
  var _this = this;
26845
27580
  /** Event trigerring */
26846
27581
  var clonedValues;
26847
- var currentPivotValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
27582
+ var currentPivotValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
26848
27583
  if (this.parent.exportAllPages && this.parent.enableVirtualization && this.parent.dataType !== 'olap') {
26849
27584
  var pageSettings = this.engine.pageSettings;
26850
27585
  this.engine.pageSettings = null;
26851
27586
  this.engine.generateGridData(this.parent.dataSourceSettings, true);
26852
27587
  this.parent.applyFormatting(this.engine.pivotValues);
26853
- clonedValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
27588
+ clonedValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
26854
27589
  this.engine.pivotValues = currentPivotValues;
26855
27590
  this.engine.pageSettings = pageSettings;
26856
27591
  }
@@ -27342,31 +28077,50 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
27342
28077
  return axisWrapper;
27343
28078
  };
27344
28079
  DialogRenderer.prototype.showCalculatedField = function (event) {
27345
- if (!this.parent.isAdaptive) {
27346
- if (this.parent.dialogRenderer.fieldListDialog) {
27347
- this.parent.dialogRenderer.fieldListDialog.hide();
27348
- addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
28080
+ try {
28081
+ if (!this.parent.isAdaptive) {
28082
+ this.parent.actionObj.actionName = openCalculatedField;
28083
+ if (this.parent.actionBeginMethod()) {
28084
+ return;
28085
+ }
28086
+ if (this.parent.dialogRenderer.fieldListDialog) {
28087
+ this.parent.dialogRenderer.fieldListDialog.hide();
28088
+ addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
28089
+ }
27349
28090
  }
28091
+ this.parent.notify(initCalculatedField, {});
28092
+ }
28093
+ catch (execption) {
28094
+ this.parent.actionFailureMethod(execption);
27350
28095
  }
27351
- this.parent.notify(initCalculatedField, {});
27352
28096
  };
27353
28097
  DialogRenderer.prototype.showFieldListDialog = function (event) {
27354
28098
  var activeindex = this.adaptiveElement.selectedItem;
27355
28099
  this.parent.treeViewModule.render(activeindex);
27356
28100
  };
27357
28101
  DialogRenderer.prototype.onShowFieldList = function () {
27358
- if (this.parent.allowDeferLayoutUpdate) {
27359
- if (this.parent.isAdaptive) {
27360
- this.parent.axisFieldModule.render();
28102
+ this.parent.actionObj.actionName = showFieldList;
28103
+ if (this.parent.actionBeginMethod()) {
28104
+ return;
28105
+ }
28106
+ this.parent.actionObj.actionName = '';
28107
+ try {
28108
+ if (this.parent.allowDeferLayoutUpdate) {
28109
+ if (this.parent.isAdaptive) {
28110
+ this.parent.axisFieldModule.render();
28111
+ }
28112
+ this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
28113
+ this.parent.clonedFieldList = extend({}, this.parent.pivotFieldList, null, true);
27361
28114
  }
27362
- this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
27363
- this.parent.clonedFieldList = extend({}, this.parent.pivotFieldList, null, true);
28115
+ addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
28116
+ this.parent.dialogRenderer.fieldListDialog.show();
28117
+ this.parent.dialogRenderer.fieldListDialog.element.style.top =
28118
+ parseInt(this.parent.dialogRenderer.fieldListDialog.element.style.top, 10) < 0 ?
28119
+ '0px' : this.parent.dialogRenderer.fieldListDialog.element.style.top;
28120
+ }
28121
+ catch (execption) {
28122
+ this.parent.actionFailureMethod(execption);
27364
28123
  }
27365
- addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
27366
- this.parent.dialogRenderer.fieldListDialog.show();
27367
- this.parent.dialogRenderer.fieldListDialog.element.style.top =
27368
- parseInt(this.parent.dialogRenderer.fieldListDialog.element.style.top, 10) < 0 ?
27369
- '0px' : this.parent.dialogRenderer.fieldListDialog.element.style.top;
27370
28124
  };
27371
28125
  DialogRenderer.prototype.onCloseFieldList = function () {
27372
28126
  if (this.parent.allowDeferLayoutUpdate) {
@@ -27394,6 +28148,10 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
27394
28148
  }
27395
28149
  }
27396
28150
  this.parent.dialogRenderer.fieldListDialog.hide();
28151
+ this.parent.actionObj.actionName = closeFieldlist;
28152
+ if (this.parent.actionObj.actionName) {
28153
+ this.parent.actionCompleteMethod();
28154
+ }
27397
28155
  };
27398
28156
  DialogRenderer.prototype.removeFieldListIcon = function () {
27399
28157
  if (this.parent.isAdaptive && this.parent.allowCalculatedField && this.parent.calculatedFieldModule) {
@@ -28283,28 +29041,41 @@ var TreeViewRenderer = /** @__PURE__ @class */ (function () {
28283
29041
  TreeViewRenderer.prototype.updateSorting = function (args) {
28284
29042
  var target = args.target;
28285
29043
  var option = target.getAttribute('data-sort');
28286
- if (target.className.indexOf('e-selected') === -1) {
28287
- switch (option) {
28288
- case 'None':
28289
- this.fieldListSort = 'None';
28290
- addClass([target], 'e-selected');
28291
- removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
28292
- removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
28293
- break;
28294
- case 'Ascend':
28295
- this.fieldListSort = 'Ascend';
28296
- addClass([target], 'e-selected');
28297
- removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
28298
- removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
28299
- break;
28300
- case 'Descend':
28301
- this.fieldListSort = 'Descend';
28302
- addClass([target], 'e-selected');
28303
- removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
28304
- removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
28305
- break;
29044
+ this.parent.actionObj.actionName = sortFieldTree;
29045
+ if (this.parent.actionBeginMethod()) {
29046
+ return;
29047
+ }
29048
+ try {
29049
+ if (target.className.indexOf('e-selected') === -1) {
29050
+ switch (option) {
29051
+ case 'None':
29052
+ this.fieldListSort = 'None';
29053
+ addClass([target], 'e-selected');
29054
+ removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
29055
+ removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
29056
+ break;
29057
+ case 'Ascend':
29058
+ this.fieldListSort = 'Ascend';
29059
+ addClass([target], 'e-selected');
29060
+ removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
29061
+ removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
29062
+ break;
29063
+ case 'Descend':
29064
+ this.fieldListSort = 'Descend';
29065
+ addClass([target], 'e-selected');
29066
+ removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
29067
+ removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
29068
+ break;
29069
+ }
29070
+ this.refreshTreeView();
28306
29071
  }
28307
- this.refreshTreeView();
29072
+ }
29073
+ catch (execption) {
29074
+ this.parent.actionFailureMethod(execption);
29075
+ }
29076
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
29077
+ if (this.parent.actionObj.actionName) {
29078
+ this.parent.actionCompleteMethod();
28308
29079
  }
28309
29080
  };
28310
29081
  /* eslint-disable */
@@ -28672,7 +29443,7 @@ var PivotButton = /** @__PURE__ @class */ (function () {
28672
29443
  attrs: { 'tabindex': '-1', 'aria-disabled': 'false', 'title': this.parent.localeObj.getConstant('editCalculatedField') },
28673
29444
  className: ICON + ' ' + CALC_EDIT
28674
29445
  });
28675
- if (this.parent.allowCalculatedField && this.parent.calculatedFieldModule && field[i].showEditIcon) {
29446
+ if (this.parent.allowCalculatedField && this.parent.calculatedFieldModule && (field[i].showEditIcon || field[i].showEditIcon === undefined)) {
28676
29447
  removeClass([calcElement], ICON_DISABLE);
28677
29448
  }
28678
29449
  else {
@@ -28685,7 +29456,7 @@ var PivotButton = /** @__PURE__ @class */ (function () {
28685
29456
  className: ICON + ' ' + REMOVE_CLASS
28686
29457
  });
28687
29458
  if (this.parent.getModuleName() === 'pivotview') {
28688
- if ((this.parent.groupingBarSettings.showRemoveIcon && field[i].showRemoveIcon)) {
29459
+ if ((this.parent.groupingBarSettings.showRemoveIcon && (field[i].showRemoveIcon || field[i].showRemoveIcon === undefined))) {
28689
29460
  removeClass([removeElement], ICON_DISABLE);
28690
29461
  }
28691
29462
  else {
@@ -28693,7 +29464,7 @@ var PivotButton = /** @__PURE__ @class */ (function () {
28693
29464
  }
28694
29465
  }
28695
29466
  else {
28696
- if (field[i].showRemoveIcon) {
29467
+ if (field[i].showRemoveIcon || field[i].showRemoveIcon === undefined) {
28697
29468
  removeClass([removeElement], ICON_DISABLE);
28698
29469
  }
28699
29470
  else {
@@ -28725,13 +29496,13 @@ var PivotButton = /** @__PURE__ @class */ (function () {
28725
29496
  }
28726
29497
  if (axis === 'values') {
28727
29498
  var _loop_1 = function (element) {
28728
- if (element.classList.contains(GROUP_CHART_VALUE) && this_1.parent.chartModule) {
29499
+ if (element.classList.contains(GROUP_CHART_VALUE) && this_1.parent.pivotChartModule) {
28729
29500
  var valueData = field.map(function (item) { return { text: item.caption ? item.caption : item.name, value: item.name }; });
28730
29501
  var parent_1 = this_1.parent;
28731
29502
  if (this_1.valueFiedDropDownList && element.querySelector('.' + GROUP_CHART_VALUE_DROPDOWN_DIV)) {
28732
29503
  this_1.valueFiedDropDownList.dataSource = valueData;
28733
29504
  this_1.valueFiedDropDownList.value = !parent_1.chartSettings.enableMultipleAxis ?
28734
- parent_1.chartModule.currentMeasure : valueData[0].value;
29505
+ parent_1.pivotChartModule.currentMeasure : valueData[0].value;
28735
29506
  }
28736
29507
  else {
28737
29508
  var ddlDiv = createElement('div', { className: GROUP_CHART_VALUE_DROPDOWN_DIV });
@@ -28741,7 +29512,7 @@ var PivotButton = /** @__PURE__ @class */ (function () {
28741
29512
  enableRtl: this_1.parent.enableRtl,
28742
29513
  locale: this_1.parent.locale,
28743
29514
  value: !parent_1.chartSettings.enableMultipleAxis ?
28744
- parent_1.chartModule.currentMeasure : valueData[0].value,
29515
+ parent_1.pivotChartModule.currentMeasure : valueData[0].value,
28745
29516
  width: 200,
28746
29517
  fields: { value: 'value', text: 'text' },
28747
29518
  cssClass: GROUP_CHART_VALUE_DROPDOWN,
@@ -28766,14 +29537,14 @@ var PivotButton = /** @__PURE__ @class */ (function () {
28766
29537
  var availColindex = undefined;
28767
29538
  for (var _g = 0, _h = this.parentElement.querySelectorAll('.e-group-' + axis); _g < _h.length; _g++) {
28768
29539
  var element = _h[_g];
28769
- if (element.classList.contains(GROUP_CHART_COLUMN) && this.parent.chartModule) {
28770
- var currentMeasure = this.parent.chartModule.currentMeasure;
29540
+ if (element.classList.contains(GROUP_CHART_COLUMN) && this.parent.pivotChartModule) {
29541
+ var currentMeasure = this.parent.pivotChartModule.currentMeasure;
28771
29542
  var delimiter = this.parent.chartSettings.columnDelimiter ? this.parent.chartSettings.columnDelimiter : '-';
28772
29543
  var columnHeader = (this.parent.chartSettings.columnHeader && this.parent.chartSettings.columnHeader !== '') ?
28773
29544
  this.parent.chartSettings.columnHeader.split(delimiter).join(' - ') : '';
28774
29545
  var engineModule = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
28775
29546
  var pivotValues = engineModule.pivotValues;
28776
- var totColIndex = this.parent.chartModule.getColumnTotalIndex(pivotValues);
29547
+ var totColIndex = this.parent.pivotChartModule.getColumnTotalIndex(pivotValues);
28777
29548
  var rKeys = Object.keys(pivotValues);
28778
29549
  var columnData = [];
28779
29550
  var firstValueRow = false;
@@ -28885,7 +29656,7 @@ var PivotButton = /** @__PURE__ @class */ (function () {
28885
29656
  },
28886
29657
  className: PIVOT_BUTTON_CONTENT_CLASS + ' ' +
28887
29658
  (this.parent.getModuleName() === 'pivotview' ?
28888
- this.parent.groupingBarSettings.allowDragAndDrop && field[i].allowDragAndDrop ? '' : DRAG_DISABLE_CLASS : ''),
29659
+ this.parent.groupingBarSettings.allowDragAndDrop && (field[i].allowDragAndDrop || field[i].allowDragAndDrop === undefined) ? '' : DRAG_DISABLE_CLASS : ''),
28889
29660
  innerHTML: axis === 'filters' ? (this.parent.dataType === 'olap' && engineModule.fieldList[field[i].name].type === 'CalculatedField') ?
28890
29661
  text : (text + ' (' + filterMem + ')') : (this.parent.dataType === 'olap' ?
28891
29662
  text : (!this.parent.dataSourceSettings.showAggregationOnValueField || axis !== 'values' || aggregation === 'CalculatedField' ?
@@ -28951,43 +29722,54 @@ var PivotButton = /** @__PURE__ @class */ (function () {
28951
29722
  };
28952
29723
  PivotButton.prototype.openCalculatedFieldDialog = function (args) {
28953
29724
  var fieldName = args.target.parentElement.id;
28954
- if (this.parent.getModuleName() === 'pivotview') {
28955
- if (this.parent.isAdaptive && (this.parent.showFieldList &&
28956
- this.parent.pivotFieldListModule &&
28957
- !this.parent.pivotFieldListModule.isDestroyed)) {
28958
- this.parent.pivotFieldListModule.element
28959
- .querySelector('.' + TOGGLE_FIELD_LIST_CLASS).click();
28960
- this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4);
28961
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28962
- this.parent.pivotFieldListModule.calculatedFieldModule
28963
- .updateAdaptiveCalculatedField(true, fieldName);
28964
- }
28965
- else {
28966
- if (!this.parent.isAdaptive) {
28967
- this.parent.calculatedFieldModule.buttonCall = true;
28968
- }
28969
- this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28970
- }
29725
+ var fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
29726
+ this.parent.actionObj.actionName = editCalculatedField;
29727
+ this.parent.actionObj.fieldInfo = fieldInfo;
29728
+ if (this.parent.actionBeginMethod()) {
29729
+ return;
28971
29730
  }
28972
- else if (this.parent.getModuleName() === 'pivotfieldlist') {
28973
- if (this.parent.isAdaptive) {
28974
- this.parent.dialogRenderer.adaptiveElement.select(4);
28975
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28976
- this.parent.calculatedFieldModule
28977
- .updateAdaptiveCalculatedField(true, fieldName);
28978
- this.parent.calculatedFieldModule.buttonCall = true;
28979
- }
28980
- else {
28981
- if (this.parent.dialogRenderer.fieldListDialog) {
28982
- this.parent.dialogRenderer.fieldListDialog.hide();
28983
- addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
29731
+ try {
29732
+ if (this.parent.getModuleName() === 'pivotview') {
29733
+ if (this.parent.isAdaptive && (this.parent.showFieldList &&
29734
+ this.parent.pivotFieldListModule &&
29735
+ !this.parent.pivotFieldListModule.isDestroyed)) {
29736
+ this.parent.pivotFieldListModule.element
29737
+ .querySelector('.' + TOGGLE_FIELD_LIST_CLASS).click();
29738
+ this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4);
29739
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
29740
+ this.parent.pivotFieldListModule.calculatedFieldModule
29741
+ .updateAdaptiveCalculatedField(true, fieldName);
29742
+ }
29743
+ else {
29744
+ if (!this.parent.isAdaptive) {
29745
+ this.parent.calculatedFieldModule.buttonCall = true;
29746
+ }
29747
+ this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28984
29748
  }
28985
- this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28986
- if (this.parent.calculatedFieldModule) {
29749
+ }
29750
+ else if (this.parent.getModuleName() === 'pivotfieldlist') {
29751
+ if (this.parent.isAdaptive) {
29752
+ this.parent.dialogRenderer.adaptiveElement.select(4);
29753
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
29754
+ this.parent.calculatedFieldModule
29755
+ .updateAdaptiveCalculatedField(true, fieldName);
28987
29756
  this.parent.calculatedFieldModule.buttonCall = true;
28988
29757
  }
29758
+ else {
29759
+ if (this.parent.dialogRenderer.fieldListDialog) {
29760
+ this.parent.dialogRenderer.fieldListDialog.hide();
29761
+ addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
29762
+ }
29763
+ this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
29764
+ if (this.parent.calculatedFieldModule) {
29765
+ this.parent.calculatedFieldModule.buttonCall = true;
29766
+ }
29767
+ }
28989
29768
  }
28990
29769
  }
29770
+ catch (execption) {
29771
+ this.parent.actionFailureMethod(execption);
29772
+ }
28991
29773
  };
28992
29774
  PivotButton.prototype.createDraggable = function (field, target) {
28993
29775
  this.draggable = new Draggable(target, {
@@ -29011,7 +29793,7 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29011
29793
  attrs: {
29012
29794
  'tabindex': '-1', 'aria-disabled': 'false', 'title': this.parent.localeObj.getConstant('drag')
29013
29795
  },
29014
- className: ICON + ' ' + DRAG_CLASS + ' ' + (field.allowDragAndDrop ? '' : DRAG_DISABLE_CLASS)
29796
+ className: ICON + ' ' + DRAG_CLASS + ' ' + ((field.allowDragAndDrop || field.allowDragAndDrop === undefined) ? '' : DRAG_DISABLE_CLASS)
29015
29797
  });
29016
29798
  dragWrapper.appendChild(dragElement);
29017
29799
  if (this.parent.getModuleName() === 'pivotfieldlist') {
@@ -29377,38 +30159,52 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29377
30159
  !(args.target.classList.contains(DRAG_CLASS)) &&
29378
30160
  (buttonElement && fieldInfo.fieldItem && (fieldInfo.fieldItem.showSortIcon ||
29379
30161
  isNullOrUndefined(fieldInfo.fieldItem.showSortIcon)))) {
29380
- if ((this.parent instanceof PivotFieldList || this.parent.groupingBarSettings.showSortIcon) &&
29381
- this.parent.dataSourceSettings.enableSorting &&
29382
- !(this.parent.dataType === 'olap' && ((this.parent.getModuleName() === 'pivotfieldlist' &&
29383
- this.parent.pivotGridModule !== undefined &&
29384
- this.parent.pivotGridModule.enableVirtualization) ||
29385
- (this.parent.getModuleName() === 'pivotview' && this.parent.enableVirtualization)))) {
29386
- if (((this.parent.getModuleName() === 'pivotview' && this.parent.enableValueSorting) ||
29387
- (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule !== undefined &&
29388
- this.parent.pivotGridModule.enableValueSorting))) {
29389
- if (this.parent.enableValueSorting || this.parent.pivotGridModule.enableValueSorting) { /* eslint-disable-line */
29390
- if (args.target.classList.contains('e-pivot-button')) {
29391
- if (args.target.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
29392
- this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: '' } } }, true);
30162
+ this.parent.actionObj.actionName = sortField;
30163
+ this.parent.actionObj.fieldInfo = fieldInfo;
30164
+ if (this.parent.actionBeginMethod()) {
30165
+ return;
30166
+ }
30167
+ try {
30168
+ if ((this.parent instanceof PivotFieldList || this.parent.groupingBarSettings.showSortIcon) &&
30169
+ this.parent.dataSourceSettings.enableSorting &&
30170
+ !(this.parent.dataType === 'olap' && ((this.parent.getModuleName() === 'pivotfieldlist' &&
30171
+ this.parent.pivotGridModule !== undefined &&
30172
+ this.parent.pivotGridModule.enableVirtualization) ||
30173
+ (this.parent.getModuleName() === 'pivotview' && this.parent.enableVirtualization)))) {
30174
+ if (((this.parent.getModuleName() === 'pivotview' && this.parent.enableValueSorting) ||
30175
+ (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule !== undefined &&
30176
+ this.parent.pivotGridModule.enableValueSorting))) {
30177
+ if (this.parent.enableValueSorting || this.parent.pivotGridModule.enableValueSorting) { /* eslint-disable-line */
30178
+ if (args.target.classList.contains('e-pivot-button')) {
30179
+ if (args.target.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
30180
+ this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: undefined } } }, true);
30181
+ }
29393
30182
  }
29394
- }
29395
- else {
29396
- if (args.target.parentElement.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
29397
- this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: '' } } }, true);
30183
+ else {
30184
+ if (args.target.parentElement.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
30185
+ this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: undefined } } }, true);
30186
+ }
29398
30187
  }
29399
30188
  }
29400
30189
  }
30190
+ this.parent.pivotCommon.eventBase.updateSorting(args);
30191
+ if (!this.parent.allowDeferLayoutUpdate || this.parent.getModuleName() !== 'pivotfieldlist') {
30192
+ var actionInfo = {
30193
+ sortInfo: this.parent.lastSortInfo
30194
+ };
30195
+ this.parent.actionObj.actionInfo = actionInfo;
30196
+ this.updateDataSource(true);
30197
+ }
30198
+ /* eslint-disable */
30199
+ var thisObj = this;
30200
+ /* eslint-enable */
30201
+ if (thisObj.parent instanceof PivotFieldList) {
30202
+ thisObj.axisField.render();
30203
+ }
29401
30204
  }
29402
- this.parent.pivotCommon.eventBase.updateSorting(args);
29403
- if (!this.parent.allowDeferLayoutUpdate || this.parent.getModuleName() !== 'pivotfieldlist') {
29404
- this.updateDataSource(true);
29405
- }
29406
- /* eslint-disable */
29407
- var thisObj = this;
29408
- /* eslint-enable */
29409
- if (thisObj.parent instanceof PivotFieldList) {
29410
- thisObj.axisField.render();
29411
- }
30205
+ }
30206
+ catch (execption) {
30207
+ this.parent.actionFailureMethod(execption);
29412
30208
  }
29413
30209
  }
29414
30210
  };
@@ -29440,26 +30236,37 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29440
30236
  PivotButton.prototype.updateFiltering = function (args) {
29441
30237
  /* eslint-disable */
29442
30238
  var pivotObj = this.parent.pivotGridModule ? this.parent.pivotGridModule : this.parent;
29443
- if (pivotObj.getModuleName() === 'pivotfieldlist') {
29444
- showSpinner(pivotObj.fieldListSpinnerElement);
29445
- }
29446
- else {
29447
- pivotObj.showWaitingPopup();
29448
- }
29449
- pivotObj.mouseEventArgs = args;
29450
- pivotObj.filterTargetID = this.parent.pivotCommon.moduleName !== 'pivotfieldlist' ?
29451
- this.parent.element : document.getElementById(this.parent.pivotCommon.parentID + '_Wrapper');
29452
30239
  var fieldName = args.target.parentElement.id;
29453
- if (pivotObj.dataSourceSettings.mode === 'Server') {
29454
- if (this.parent.engineModule.fieldList[fieldName].members && Object.keys(this.parent.engineModule.fieldList[fieldName].members).length > 0) {
29455
- this.updateFilterEvents();
30240
+ var fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
30241
+ this.parent.actionObj.actionName = filterField;
30242
+ this.parent.actionObj.fieldInfo = fieldInfo;
30243
+ if (this.parent.actionBeginMethod()) {
30244
+ return;
30245
+ }
30246
+ try {
30247
+ if (pivotObj.getModuleName() === 'pivotfieldlist') {
30248
+ showSpinner(pivotObj.fieldListSpinnerElement);
29456
30249
  }
29457
30250
  else {
29458
- pivotObj.getEngine('fetchFieldMembers', null, null, null, null, null, fieldName);
30251
+ pivotObj.showWaitingPopup();
30252
+ }
30253
+ pivotObj.mouseEventArgs = args;
30254
+ pivotObj.filterTargetID = this.parent.pivotCommon.moduleName !== 'pivotfieldlist' ?
30255
+ this.parent.element : document.getElementById(this.parent.pivotCommon.parentID + '_Wrapper');
30256
+ if (pivotObj.dataSourceSettings.mode === 'Server') {
30257
+ if (this.parent.engineModule.fieldList[fieldName].members && Object.keys(this.parent.engineModule.fieldList[fieldName].members).length > 0) {
30258
+ this.updateFilterEvents();
30259
+ }
30260
+ else {
30261
+ pivotObj.getEngine('fetchFieldMembers', null, null, null, null, null, fieldName);
30262
+ }
30263
+ }
30264
+ else {
30265
+ this.updateFilterEvents();
29459
30266
  }
29460
30267
  }
29461
- else {
29462
- this.updateFilterEvents();
30268
+ catch (execption) {
30269
+ this.parent.actionFailureMethod(execption);
29463
30270
  }
29464
30271
  /* eslint-enable */
29465
30272
  };
@@ -29472,11 +30279,6 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29472
30279
  var target = pivotObj.mouseEventArgs.target;
29473
30280
  this.fieldName = target.parentElement.id;
29474
30281
  if (this.parent.pivotCommon.filterDialog.dialogPopUp) {
29475
- this.dialogPopUp = this.parent.pivotCommon.filterDialog.dialogPopUp;
29476
- this.parent.pivotCommon.filterDialog.dialogPopUp.close = this.removeFilterDialog.bind(this);
29477
- // this.memberTreeView = this.parent.pivotCommon.filterDialog.memberTreeView;
29478
- // this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
29479
- // this.parent.pivotCommon.filterDialog.allMemberSelect.nodeChecked = this.nodeStateModified.bind(this);
29480
30282
  this.bindDialogEvents();
29481
30283
  }
29482
30284
  if (pivotObj.getModuleName() === 'pivotfieldlist') {
@@ -29490,8 +30292,8 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29490
30292
  if (this.parent.pivotCommon.filterDialog.allowExcelLikeFilter && this.parent.pivotCommon.filterDialog.tabObj) {
29491
30293
  this.index = this.parent.pivotCommon.filterDialog.tabObj.selectedItem;
29492
30294
  this.updateDialogButtonEvents();
29493
- this.dialogPopUp.buttons = this.buttonModel();
29494
- this.dialogPopUp.dataBind();
30295
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons = this.buttonModel();
30296
+ this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind();
29495
30297
  this.parent.pivotCommon.filterDialog.tabObj.selected = this.tabSelect.bind(this);
29496
30298
  }
29497
30299
  else if (this.parent.dataSourceSettings.allowMemberFilter) {
@@ -29516,7 +30318,7 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29516
30318
  click: (this.index === 0 ? this.updateFilterState.bind(this, this.fieldName) : this.updateCustomFilter.bind(this))
29517
30319
  },
29518
30320
  {
29519
- click: this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this),
30321
+ click: this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this.parent.pivotCommon.filterDialog),
29520
30322
  buttonModel: { cssClass: CANCEL_BUTTON_CLASS, content: this.parent.localeObj.getConstant('cancel') }
29521
30323
  }
29522
30324
  ];
@@ -29524,25 +30326,25 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29524
30326
  PivotButton.prototype.tabSelect = function (e) {
29525
30327
  this.index = e.selectedIndex;
29526
30328
  this.updateDialogButtonEvents();
29527
- removeClass([].slice.call(this.dialogPopUp.element.querySelectorAll('.e-selected-tab')), 'e-selected-tab');
30329
+ removeClass([].slice.call(this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelectorAll('.e-selected-tab')), 'e-selected-tab');
29528
30330
  if (e.selectedIndex > 0) {
29529
- 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');
30331
+ 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');
29530
30332
  }
29531
30333
  if (e.selectedIndex === 0) {
29532
30334
  this.parent.pivotCommon.filterDialog.updateCheckedState();
29533
30335
  }
29534
30336
  else {
29535
- this.dialogPopUp.buttons[0].buttonModel.disabled = false;
29536
- this.dialogPopUp.element.querySelector('.' + OK_BUTTON_CLASS).removeAttribute('disabled');
30337
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons[0].buttonModel.disabled = false;
30338
+ this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector('.' + OK_BUTTON_CLASS).removeAttribute('disabled');
29537
30339
  }
29538
30340
  };
29539
30341
  PivotButton.prototype.updateDialogButtonEvents = function () {
29540
- this.dialogPopUp.buttons = this.buttonModel();
29541
- this.dialogPopUp.dataBind();
30342
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons = this.buttonModel();
30343
+ this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind();
29542
30344
  };
29543
30345
  PivotButton.prototype.updateCustomFilter = function (args) {
29544
30346
  var _this = this;
29545
- var dialogElement = this.dialogPopUp.element.querySelector('.e-selected-tab');
30347
+ var dialogElement = this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector('.e-selected-tab');
29546
30348
  var fieldName = dialogElement.getAttribute('data-fieldname');
29547
30349
  var levelName = dialogElement.getAttribute('data-selectedField');
29548
30350
  var filterType = dialogElement.getAttribute('data-type');
@@ -29613,39 +30415,18 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29613
30415
  if (type !== 'Value') {
29614
30416
  _this.parent.lastFilterInfo = PivotUtil.getFilterItemByName(fieldName, _this.parent.dataSourceSettings.filterSettings);
29615
30417
  }
29616
- _this.dialogPopUp.close();
30418
+ _this.parent.pivotCommon.filterDialog.dialogPopUp.close();
29617
30419
  if (!observedArgs.cancel) {
29618
30420
  _this.refreshPivotButtonState(fieldName, true);
29619
30421
  _this.updateDataSource(true);
29620
30422
  }
29621
30423
  });
29622
30424
  };
29623
- PivotButton.prototype.removeFilterDialog = function () {
29624
- if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
29625
- this.dialogPopUp.destroy();
29626
- setTimeout(this.setFocus.bind(this));
29627
- }
29628
- if (document.getElementById(this.parentElement.id + '_EditorTreeView')) {
29629
- remove(document.getElementById(this.parentElement.id + '_EditorTreeView'));
29630
- }
29631
- };
29632
- PivotButton.prototype.setFocus = function () {
29633
- if (this.parentElement) {
29634
- var pivotButtons = [].slice.call(this.parentElement.querySelectorAll('.e-pivot-button'));
29635
- for (var _i = 0, pivotButtons_1 = pivotButtons; _i < pivotButtons_1.length; _i++) {
29636
- var item = pivotButtons_1[_i];
29637
- if (item.getAttribute('data-uid') === this.fieldName) {
29638
- item.focus();
29639
- break;
29640
- }
29641
- }
29642
- }
29643
- };
29644
30425
  PivotButton.prototype.ClearFilter = function (e) {
29645
- var dialogElement = this.dialogPopUp.element;
30426
+ var dialogElement = this.parent.pivotCommon.filterDialog.dialogPopUp.element;
29646
30427
  var fieldName = dialogElement.getAttribute('data-fieldname');
29647
30428
  var tabElement = dialogElement.querySelector('.e-selected-tab');
29648
- this.dialogPopUp.close();
30429
+ this.parent.pivotCommon.filterDialog.dialogPopUp.close();
29649
30430
  if (this.parent.dataType === 'olap' && tabElement) {
29650
30431
  var levelName = tabElement.getAttribute('data-selectedField');
29651
30432
  this.removeDataSourceSettings(fieldName, levelName);
@@ -29662,63 +30443,73 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29662
30443
  var target = args.target;
29663
30444
  var fieldName = target.parentElement.id;
29664
30445
  var fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
30446
+ this.parent.actionObj.actionName = removeField;
30447
+ this.parent.actionObj.fieldInfo = fieldInfo;
30448
+ if (this.parent.actionBeginMethod()) {
30449
+ return;
30450
+ }
29665
30451
  var removeFieldArgs = {
29666
30452
  cancel: false, fieldName: fieldName,
29667
30453
  dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.parent.dataSourceSettings),
29668
30454
  fieldItem: fieldInfo.fieldItem, axis: fieldInfo.axis
29669
30455
  };
29670
- var control = this.parent.getModuleName() === 'pivotfieldlist' &&
29671
- this.parent.isPopupView ? this.parent.pivotGridModule : this.parent;
29672
- control.trigger(fieldRemove, removeFieldArgs, function (observedArgs) {
29673
- if (!observedArgs.cancel) {
29674
- if (target.parentElement.getAttribute('isvalue') === 'true') {
29675
- _this.parent.setProperties({ dataSourceSettings: { values: [] } }, true);
29676
- if (_this.parent.dataType === 'olap') {
29677
- _this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
30456
+ try {
30457
+ var control = this.parent.getModuleName() === 'pivotfieldlist' &&
30458
+ this.parent.isPopupView ? this.parent.pivotGridModule : this.parent;
30459
+ control.trigger(fieldRemove, removeFieldArgs, function (observedArgs) {
30460
+ if (!observedArgs.cancel) {
30461
+ if (target.parentElement.getAttribute('isvalue') === 'true') {
30462
+ _this.parent.setProperties({ dataSourceSettings: { values: [] } }, true);
30463
+ if (_this.parent.dataType === 'olap') {
30464
+ _this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
30465
+ }
29678
30466
  }
29679
- }
29680
- else {
29681
- _this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(fieldName);
29682
- if (_this.parent.dataType === 'pivot' && _this.parent.showValuesButton && _this.parent.dataSourceSettings.values.length > 1 &&
29683
- fieldInfo.position < _this.parent.dataSourceSettings.valueIndex && ((_this.parent.dataSourceSettings.valueAxis === 'row' &&
29684
- observedArgs.axis === 'rows') || (_this.parent.dataSourceSettings.valueAxis === 'column' && observedArgs.axis === 'columns'))) {
29685
- _this.parent.setProperties({ dataSourceSettings: { valueIndex: _this.parent.dataSourceSettings.valueIndex - 1 } }, true);
30467
+ else {
30468
+ _this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(fieldName);
30469
+ if (_this.parent.dataType === 'pivot' && _this.parent.showValuesButton && _this.parent.dataSourceSettings.values.length > 1 &&
30470
+ fieldInfo.position < _this.parent.dataSourceSettings.valueIndex && ((_this.parent.dataSourceSettings.valueAxis === 'row' &&
30471
+ observedArgs.axis === 'rows') || (_this.parent.dataSourceSettings.valueAxis === 'column' && observedArgs.axis === 'columns'))) {
30472
+ _this.parent.setProperties({ dataSourceSettings: { valueIndex: _this.parent.dataSourceSettings.valueIndex - 1 } }, true);
30473
+ }
30474
+ if (_this.parent.dataType === 'olap' && _this.parent.dataSourceSettings.values.length === 0) {
30475
+ _this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
30476
+ }
29686
30477
  }
29687
- if (_this.parent.dataType === 'olap' && _this.parent.dataSourceSettings.values.length === 0) {
29688
- _this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
30478
+ if (_this.parent.getModuleName() === 'pivotfieldlist') {
30479
+ _this.parent.axisFieldModule.render();
29689
30480
  }
30481
+ _this.updateDataSource();
29690
30482
  }
29691
- if (_this.parent.getModuleName() === 'pivotfieldlist') {
29692
- _this.parent.axisFieldModule.render();
29693
- }
29694
- _this.updateDataSource();
29695
- }
29696
- });
30483
+ });
30484
+ }
30485
+ catch (execption) {
30486
+ this.parent.actionFailureMethod(execption);
30487
+ }
29697
30488
  };
29698
30489
  /** @hidden */
29699
30490
  PivotButton.prototype.nodeStateModified = function (args) {
29700
30491
  var target = closest(args.node, 'li');
29701
30492
  var fieldName = target.getAttribute('data-fieldname');
29702
30493
  if (target.getAttribute('data-memberId') === 'all') {
29703
- this.memberTreeView.nodeChecked = null;
30494
+ this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = null;
29704
30495
  if (args.action === 'check') {
29705
- this.memberTreeView.checkAll();
30496
+ this.parent.pivotCommon.filterDialog.memberTreeView.checkAll();
29706
30497
  }
29707
30498
  else {
29708
- this.memberTreeView.uncheckAll();
30499
+ this.parent.pivotCommon.filterDialog.memberTreeView.uncheckAll();
29709
30500
  }
29710
30501
  if (this.parent.dataType === 'olap' && this.parent.olapEngineModule &&
29711
30502
  !this.parent.olapEngineModule.fieldList[fieldName].isHierarchy) {
29712
- this.updateNodeStates(this.memberTreeView.getAllCheckedNodes(), fieldName, args.action);
30503
+ this.updateNodeStates(this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(), fieldName, args.action);
29713
30504
  }
29714
30505
  this.checkedStateAll(args.action);
29715
- this.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
30506
+ this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
29716
30507
  }
29717
30508
  else {
29718
30509
  if (this.parent.dataType === 'olap' && this.parent.olapEngineModule &&
29719
30510
  !this.parent.olapEngineModule.fieldList[fieldName].isHierarchy) {
29720
30511
  // let st1: number = new Date().getTime();
29721
- var checkedNodes = this.memberTreeView.getAllCheckedNodes();
30512
+ var checkedNodes = this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes();
29722
30513
  // let st2: number = (new Date().getTime() - st1) / 1000;
29723
30514
  // console.log('getAllCheckedNodes:' + st2);
29724
30515
  this.updateNodeStates(checkedNodes, fieldName, args.action);
@@ -29761,8 +30552,8 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29761
30552
  }
29762
30553
  if (currentMembers[member]) {
29763
30554
  currentMembers[member].isSelected = false;
29764
- if (this.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]')) {
29765
- var element = this.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]');
30555
+ if (this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]')) {
30556
+ var element = this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]');
29766
30557
  if (element && !element.querySelector('ul')) {
29767
30558
  this.parent.pivotCommon.eventBase.updateChildNodeStates(fieldList.filterMembers, fieldName, member, false);
29768
30559
  }
@@ -29772,8 +30563,8 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29772
30563
  for (var _a = 0, checkedNodes_1 = checkedNodes; _a < checkedNodes_1.length; _a++) {
29773
30564
  var node = checkedNodes_1[_a];
29774
30565
  if (currentMembers[node]) {
29775
- if (this.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]')) {
29776
- var element = this.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]');
30566
+ if (this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]')) {
30567
+ var element = this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]');
29777
30568
  if (element && !element.querySelector('ul')) {
29778
30569
  currentMembers[node].isSelected = true;
29779
30570
  this.parent.pivotCommon.eventBase.updateChildNodeStates(fieldList.filterMembers, fieldName, node, true);
@@ -29811,10 +30602,10 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29811
30602
  !engineModule.fieldList[fieldName].isHierarchy) {
29812
30603
  var cMembers = engineModule.fieldList[fieldName].members;
29813
30604
  var sMembers = engineModule.fieldList[fieldName].currrentMembers;
29814
- filterItem.items = this.memberTreeView.getAllCheckedNodes();
30605
+ filterItem.items = this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes();
29815
30606
  filterItem.levelCount = engineModule.fieldList[fieldName].levelCount;
29816
30607
  isNodeUnChecked = (filterItem.items.length ===
29817
- this.memberTreeView.fields.dataSource.length ? false : true);
30608
+ this.parent.pivotCommon.filterDialog.memberTreeView.fields.dataSource.length ? false : true);
29818
30609
  if (engineModule.fieldList[fieldName].searchMembers.length > 0 && !isNodeUnChecked) {
29819
30610
  var cNodeLength = Object.keys(cMembers).length;
29820
30611
  var sNodeLength = Object.keys(sMembers).length;
@@ -29877,13 +30668,18 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29877
30668
  }
29878
30669
  _this.parent.dataSourceSettings.filterSettings.push(filterItem);
29879
30670
  }
29880
- _this.dialogPopUp.close();
30671
+ _this.parent.pivotCommon.filterDialog.dialogPopUp.close();
29881
30672
  if (!observedArgs.cancel) {
29882
30673
  _this.refreshPivotButtonState(fieldName, isNodeUnChecked);
29883
30674
  if (!isNodeUnChecked) {
29884
30675
  _this.removeDataSourceSettings(fieldName);
30676
+ filterItem = {};
29885
30677
  }
29886
30678
  _this.parent.lastFilterInfo = filterItem;
30679
+ var actionInfo = {
30680
+ filterInfo: _this.parent.lastFilterInfo
30681
+ };
30682
+ _this.parent.actionObj.actionInfo = actionInfo;
29887
30683
  _this.updateDataSource(true);
29888
30684
  var thisObj = _this;
29889
30685
  //setTimeout(() => {
@@ -29893,8 +30689,8 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29893
30689
  //});
29894
30690
  }
29895
30691
  var pivotButtons = [].slice.call(_this.parentElement.querySelectorAll('.e-pivot-button'));
29896
- for (var _i = 0, pivotButtons_2 = pivotButtons; _i < pivotButtons_2.length; _i++) {
29897
- var item = pivotButtons_2[_i];
30692
+ for (var _i = 0, pivotButtons_1 = pivotButtons; _i < pivotButtons_1.length; _i++) {
30693
+ var item = pivotButtons_1[_i];
29898
30694
  if (item.getAttribute('data-uid') === fieldName) {
29899
30695
  item.focus();
29900
30696
  break;
@@ -29905,8 +30701,8 @@ var PivotButton = /** @__PURE__ @class */ (function () {
29905
30701
  PivotButton.prototype.refreshPivotButtonState = function (fieldName, isFiltered) {
29906
30702
  var pivotButtons = [].slice.call(this.parentElement.querySelectorAll('.e-pivot-button'));
29907
30703
  var selectedButton;
29908
- for (var _i = 0, pivotButtons_3 = pivotButtons; _i < pivotButtons_3.length; _i++) {
29909
- var item = pivotButtons_3[_i];
30704
+ for (var _i = 0, pivotButtons_2 = pivotButtons; _i < pivotButtons_2.length; _i++) {
30705
+ var item = pivotButtons_2[_i];
29910
30706
  if (item.getAttribute('data-uid') === fieldName) {
29911
30707
  selectedButton = item.querySelector('.' + FILTER_COMMON_CLASS);
29912
30708
  break;
@@ -30039,14 +30835,6 @@ var PivotButton = /** @__PURE__ @class */ (function () {
30039
30835
  this.columnFieldDropDownList.destroy();
30040
30836
  this.columnFieldDropDownList = null;
30041
30837
  }
30042
- if (this.memberTreeView && !this.memberTreeView.isDestroyed) {
30043
- this.memberTreeView.destroy();
30044
- this.memberTreeView = null;
30045
- }
30046
- if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
30047
- this.dialogPopUp.destroy();
30048
- this.dialogPopUp = null;
30049
- }
30050
30838
  if (this.draggable && !this.draggable.isDestroyed) {
30051
30839
  this.draggable.destroy();
30052
30840
  this.draggable = null;
@@ -30203,6 +30991,8 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
30203
30991
  _this.enableValueSorting = false;
30204
30992
  _this.request = new XMLHttpRequest();
30205
30993
  _this.remoteData = [];
30994
+ /** @hidden */
30995
+ _this.actionObj = {};
30206
30996
  return _this;
30207
30997
  }
30208
30998
  /**
@@ -30434,7 +31224,9 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
30434
31224
  enableValueSorting: enableValueSorting,
30435
31225
  isDrillThrough: isDrillThrough,
30436
31226
  localeObj: localeObj,
30437
- clonedReport: this.clonedReport
31227
+ clonedReport: this.clonedReport,
31228
+ globalize: this.globalize,
31229
+ currenyCode: this.currencyCode
30438
31230
  };
30439
31231
  }
30440
31232
  return customProperties;
@@ -31125,6 +31917,11 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
31125
31917
  pivot.pivotGridModule.fieldListSpinnerElement = pivot.fieldListSpinnerElement;
31126
31918
  }
31127
31919
  });
31920
+ var actionName = this.getActionCompleteName();
31921
+ this.actionObj.actionName = actionName;
31922
+ if (this.actionObj.actionName) {
31923
+ this.actionCompleteMethod();
31924
+ }
31128
31925
  };
31129
31926
  PivotFieldList.prototype.updateOlapDataSource = function (pivot, isSorted, isCalcChange, isOlapDataRefreshed) {
31130
31927
  var customProperties = pivot.frameCustomProperties(pivot.olapEngineModule.fieldListData, pivot.olapEngineModule.fieldList);
@@ -31158,6 +31955,7 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
31158
31955
  PivotFieldList.prototype.update = function (control) {
31159
31956
  if (control) {
31160
31957
  this.clonedDataSet = control.clonedDataSet;
31958
+ this.clonedReport = control.clonedReport;
31161
31959
  this.setProperties({ dataSourceSettings: control.dataSourceSettings, showValuesButton: control.showValuesButton }, true);
31162
31960
  this.engineModule = control.engineModule;
31163
31961
  this.olapEngineModule = control.olapEngineModule;
@@ -31192,6 +31990,7 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
31192
31990
  PivotFieldList.prototype.updateView = function (control) {
31193
31991
  if (control) {
31194
31992
  control.clonedDataSet = this.clonedDataSet;
31993
+ control.clonedReport = this.clonedReport;
31195
31994
  control.setProperties({ dataSourceSettings: this.dataSourceSettings, showValuesButton: this.showValuesButton }, true);
31196
31995
  control.engineModule = this.engineModule;
31197
31996
  control.olapEngineModule = this.olapEngineModule;
@@ -31235,6 +32034,47 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
31235
32034
  }
31236
32035
  });
31237
32036
  };
32037
+ /** @hidden */
32038
+ PivotFieldList.prototype.actionBeginMethod = function () {
32039
+ var eventArgs = {
32040
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
32041
+ actionName: this.actionObj.actionName,
32042
+ fieldInfo: this.actionObj.fieldInfo,
32043
+ cancel: false
32044
+ };
32045
+ var control = this.isPopupView ? this.pivotGridModule : this;
32046
+ control.trigger(actionBegin, eventArgs);
32047
+ return eventArgs.cancel;
32048
+ };
32049
+ /** @hidden */
32050
+ PivotFieldList.prototype.actionCompleteMethod = function () {
32051
+ var eventArgs = {
32052
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
32053
+ actionName: this.actionObj.actionName,
32054
+ fieldInfo: this.actionObj.fieldInfo,
32055
+ actionInfo: this.actionObj.actionInfo
32056
+ };
32057
+ var control = this.isPopupView ? this.pivotGridModule : this;
32058
+ control.trigger(actionComplete, eventArgs);
32059
+ this.actionObj.actionName = '';
32060
+ this.actionObj.actionInfo = undefined;
32061
+ this.actionObj.fieldInfo = undefined;
32062
+ };
32063
+ /** @hidden */
32064
+ PivotFieldList.prototype.actionFailureMethod = function (error) {
32065
+ var eventArgs = {
32066
+ actionName: this.actionObj.actionName,
32067
+ errorInfo: error
32068
+ };
32069
+ var control = this.isPopupView ? this.pivotGridModule : this;
32070
+ control.trigger(actionFailure, eventArgs);
32071
+ };
32072
+ /** @hidden */
32073
+ PivotFieldList.prototype.getActionCompleteName = function () {
32074
+ var actionName = (this.actionObj.actionName == openCalculatedField) ? calculatedFieldApplied : (this.actionObj.actionName == editCalculatedField) ? calculatedFieldEdited : (this.actionObj.actionName == sortField) ? fieldSorted
32075
+ : (this.actionObj.actionName == filterField) ? fieldFiltered : (this.actionObj.actionName == removeField) ? fieldRemoved : (this.actionObj.actionName == aggregateField) ? fieldAggregated : this.actionObj.actionName == sortFieldTree ? fieldTreeSorted : this.actionObj.actionName;
32076
+ return actionName;
32077
+ };
31238
32078
  /**
31239
32079
  * Destroys the Field Table component.
31240
32080
  * @function destroy
@@ -31309,6 +32149,9 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
31309
32149
  if (this.clonedDataSet) {
31310
32150
  this.clonedDataSet = null;
31311
32151
  }
32152
+ if (this.clonedReport) {
32153
+ this.clonedReport = null;
32154
+ }
31312
32155
  if (this.clonedFieldList) {
31313
32156
  this.clonedFieldList = null;
31314
32157
  }
@@ -31356,6 +32199,9 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
31356
32199
  __decorate$4([
31357
32200
  Property(['Sum', 'Count', 'DistinctCount', 'Product', 'Min', 'Max', 'Avg', 'Median', 'Index', 'PopulationVar', 'SampleVar', 'PopulationStDev', 'SampleStDev', 'RunningTotals', 'PercentageOfGrandTotal', 'PercentageOfColumnTotal', 'PercentageOfRowTotal', 'PercentageOfParentColumnTotal', 'PercentageOfParentRowTotal', 'DifferenceFrom', 'PercentageOfDifferenceFrom', 'PercentageOfParentTotal'])
31358
32201
  ], PivotFieldList.prototype, "aggregateTypes", void 0);
32202
+ __decorate$4([
32203
+ Property('USD')
32204
+ ], PivotFieldList.prototype, "currencyCode", void 0);
31359
32205
  __decorate$4([
31360
32206
  Event()
31361
32207
  ], PivotFieldList.prototype, "load", void 0);
@@ -31404,6 +32250,15 @@ var PivotFieldList = /** @__PURE__ @class */ (function (_super) {
31404
32250
  __decorate$4([
31405
32251
  Event()
31406
32252
  ], PivotFieldList.prototype, "beforeServiceInvoke", void 0);
32253
+ __decorate$4([
32254
+ Event()
32255
+ ], PivotFieldList.prototype, "actionBegin", void 0);
32256
+ __decorate$4([
32257
+ Event()
32258
+ ], PivotFieldList.prototype, "actionComplete", void 0);
32259
+ __decorate$4([
32260
+ Event()
32261
+ ], PivotFieldList.prototype, "actionFailure", void 0);
31407
32262
  PivotFieldList = __decorate$4([
31408
32263
  NotifyPropertyChanges
31409
32264
  ], PivotFieldList);
@@ -31638,105 +32493,114 @@ var CalculatedField = /** @__PURE__ @class */ (function () {
31638
32493
  CalculatedField.prototype.displayMenu = function (node, treeNode, target) {
31639
32494
  var edit = target ? target.classList.contains(CALC_EDIT) : true;
31640
32495
  var edited = target ? target.classList.contains(CALC_EDITED) : true;
31641
- if (this.parent.dataType === 'pivot' && node.querySelector('.e-list-icon.e-format') &&
31642
- node.querySelector('.e-list-icon.e-format').classList.contains(ICON) &&
31643
- !node.querySelector('.e-list-icon').classList.contains(CALC_EDITED) &&
31644
- !node.querySelector('.e-list-icon').classList.contains(GRID_REMOVE) &&
31645
- !node.querySelector('.e-list-icon').classList.contains(CALC_EDIT) && node.tagName === 'LI') {
31646
- if (this.menuObj && !this.menuObj.isDestroyed) {
31647
- this.menuObj.destroy();
31648
- }
31649
- this.curMenu = node.querySelector('.' + LIST_TEXT_CLASS);
31650
- this.openContextMenu(node);
31651
- }
31652
- else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDIT) &&
31653
- node.querySelector('.' + CALC_EDIT).classList.contains('e-list-icon') && edit ||
31654
- (this.parent.dataType === 'olap' && node.getAttribute('data-type') === CALC && node.classList.contains('e-active') && ((target && !target.classList.contains(GRID_REMOVE)) || !target)))) {
31655
- this.isEdit = true;
31656
- var fieldName = node.getAttribute('data-field');
31657
- var caption = node.getAttribute('data-caption');
31658
- this.currentFieldName = fieldName;
31659
- this.inputObj.value = caption;
31660
- this.inputObj.dataBind();
31661
- var formatString = node.getAttribute('data-formatString');
31662
- var dialogElement = this.dialog.element;
31663
- var customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
31664
- if (this.parent.dataType === 'olap') {
31665
- var memberType = node.getAttribute('data-membertype');
31666
- var parentHierarchy = node.getAttribute('data-hierarchy');
31667
- var expression = node.getAttribute('data-formula');
31668
- var customString = node.getAttribute('data-customString');
31669
- var fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
31670
- var memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
31671
- var hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
31672
- var formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
31673
- /* eslint-enable max-len */
31674
- fieldTitle.innerHTML = this.parent.localeObj.getConstant('caption');
31675
- select('#' + this.parentID + 'droppable', document).value = expression;
31676
- memberTypeDrop.readonly = true;
31677
- memberTypeDrop.value = memberType;
31678
- memberTypeDrop.dataBind();
31679
- if (memberType === 'Dimension') {
31680
- hierarchyDrop.value = parentHierarchy;
32496
+ try {
32497
+ if (this.parent.dataType === 'pivot' && node.querySelector('.e-list-icon.e-format') &&
32498
+ node.querySelector('.e-list-icon.e-format').classList.contains(ICON) &&
32499
+ !node.querySelector('.e-list-icon').classList.contains(CALC_EDITED) &&
32500
+ !node.querySelector('.e-list-icon').classList.contains(GRID_REMOVE) &&
32501
+ !node.querySelector('.e-list-icon').classList.contains(CALC_EDIT) && node.tagName === 'LI') {
32502
+ if (this.menuObj && !this.menuObj.isDestroyed) {
32503
+ this.menuObj.destroy();
32504
+ }
32505
+ this.curMenu = node.querySelector('.' + LIST_TEXT_CLASS);
32506
+ this.openContextMenu(node);
32507
+ }
32508
+ else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDIT) &&
32509
+ node.querySelector('.' + CALC_EDIT).classList.contains('e-list-icon') && edit ||
32510
+ (this.parent.dataType === 'olap' && node.getAttribute('data-type') === CALC && node.classList.contains('e-active') && ((target && !target.classList.contains(GRID_REMOVE)) || !target)))) {
32511
+ this.isEdit = true;
32512
+ var fieldName = node.getAttribute('data-field');
32513
+ var caption = node.getAttribute('data-caption');
32514
+ this.currentFieldName = fieldName;
32515
+ this.inputObj.value = caption;
32516
+ this.inputObj.dataBind();
32517
+ var formatString = node.getAttribute('data-formatString');
32518
+ var dialogElement = this.dialog.element;
32519
+ var customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
32520
+ if (this.parent.dataType === 'olap') {
32521
+ var memberType = node.getAttribute('data-membertype');
32522
+ var parentHierarchy = node.getAttribute('data-hierarchy');
32523
+ var expression = node.getAttribute('data-formula');
32524
+ var customString = node.getAttribute('data-customString');
32525
+ var fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
32526
+ var memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
32527
+ var hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
32528
+ var formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
32529
+ /* eslint-enable max-len */
32530
+ fieldTitle.innerHTML = this.parent.localeObj.getConstant('caption');
32531
+ select('#' + this.parentID + 'droppable', document).value = expression;
32532
+ memberTypeDrop.readonly = true;
32533
+ memberTypeDrop.value = memberType;
32534
+ memberTypeDrop.dataBind();
32535
+ if (memberType === 'Dimension') {
32536
+ hierarchyDrop.value = parentHierarchy;
32537
+ }
32538
+ if (formatString !== '') {
32539
+ formatDrop.value = formatString;
32540
+ formatDrop.dataBind();
32541
+ }
32542
+ customFormat.value = customString;
32543
+ }
32544
+ else {
32545
+ customFormat.value = formatString;
32546
+ addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
32547
+ removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
32548
+ addClass([node.querySelector('.e-list-icon')], CALC_EDITED);
32549
+ removeClass([node.querySelector('.e-list-icon')], CALC_EDIT);
32550
+ node.querySelector('.' + CALC_EDITED).setAttribute('title', this.parent.localeObj.getConstant('clearCalculatedField'));
32551
+ select('#' + this.parentID + 'droppable', document).value = node.getAttribute('data-uid');
31681
32552
  }
31682
- if (formatString !== '') {
31683
- formatDrop.value = formatString;
32553
+ customFormat.dataBind();
32554
+ }
32555
+ else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDITED) &&
32556
+ node.querySelector('.' + CALC_EDITED).classList.contains('e-list-icon') && edited ||
32557
+ (this.parent.dataType === 'olap' && !node.classList.contains('e-active')))) {
32558
+ this.isEdit = false;
32559
+ this.inputObj.value = '';
32560
+ this.inputObj.dataBind();
32561
+ var dialogElement = this.dialog.element;
32562
+ var customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
32563
+ customFormat.value = '';
32564
+ customFormat.dataBind();
32565
+ if (this.parent.dataType === 'olap') {
32566
+ var hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
32567
+ var formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
32568
+ var memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
32569
+ var fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
32570
+ /* eslint-enable max-len */
32571
+ fieldTitle.innerHTML = this.parent.localeObj.getConstant('fieldTitle');
32572
+ hierarchyDrop.index = 0;
32573
+ hierarchyDrop.dataBind();
32574
+ formatDrop.index = 0;
31684
32575
  formatDrop.dataBind();
32576
+ memberTypeDrop.index = 0;
32577
+ memberTypeDrop.readonly = false;
32578
+ memberTypeDrop.dataBind();
32579
+ }
32580
+ else {
32581
+ addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
32582
+ removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
32583
+ node.querySelector('.' + CALC_EDIT).setAttribute('title', this.parent.localeObj.getConstant('edit'));
31685
32584
  }
31686
- customFormat.value = customString;
32585
+ select('#' + this.parentID + 'droppable', document).value = '';
31687
32586
  }
31688
- else {
31689
- customFormat.value = formatString;
31690
- addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
31691
- removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
31692
- addClass([node.querySelector('.e-list-icon')], CALC_EDITED);
31693
- removeClass([node.querySelector('.e-list-icon')], CALC_EDIT);
31694
- node.querySelector('.' + CALC_EDITED).setAttribute('title', this.parent.localeObj.getConstant('clearCalculatedField'));
31695
- select('#' + this.parentID + 'droppable', document).value = node.getAttribute('data-uid');
32587
+ else if (node.tagName === 'LI' && (node.querySelector('.' + GRID_REMOVE) &&
32588
+ node.querySelector('.' + GRID_REMOVE).classList.contains('e-list-icon')) && !edit && !edited) {
32589
+ this.parent.actionObj.actionName = removeField;
32590
+ if (this.parent.actionBeginMethod()) {
32591
+ return;
32592
+ }
32593
+ var dropField = select('#' + this.parentID + 'droppable', document);
32594
+ var field = {
32595
+ name: this.isEdit ? this.currentFieldName : this.inputObj.value,
32596
+ caption: this.inputObj.value,
32597
+ formula: dropField.value
32598
+ };
32599
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeCalculatedField'), field, true, treeNode);
31696
32600
  }
31697
- customFormat.dataBind();
31698
32601
  }
31699
- else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDITED) &&
31700
- node.querySelector('.' + CALC_EDITED).classList.contains('e-list-icon') && edited ||
31701
- (this.parent.dataType === 'olap' && !node.classList.contains('e-active')))) {
31702
- this.isEdit = false;
31703
- this.inputObj.value = '';
31704
- this.inputObj.dataBind();
31705
- var dialogElement = this.dialog.element;
31706
- var customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
31707
- customFormat.value = '';
31708
- customFormat.dataBind();
31709
- if (this.parent.dataType === 'olap') {
31710
- var hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
31711
- var formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
31712
- var memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
31713
- var fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
31714
- /* eslint-enable max-len */
31715
- fieldTitle.innerHTML = this.parent.localeObj.getConstant('fieldTitle');
31716
- hierarchyDrop.index = 0;
31717
- hierarchyDrop.dataBind();
31718
- formatDrop.index = 0;
31719
- formatDrop.dataBind();
31720
- memberTypeDrop.index = 0;
31721
- memberTypeDrop.readonly = false;
31722
- memberTypeDrop.dataBind();
31723
- }
31724
- else {
31725
- addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
31726
- removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
31727
- node.querySelector('.' + CALC_EDIT).setAttribute('title', this.parent.localeObj.getConstant('edit'));
31728
- }
31729
- select('#' + this.parentID + 'droppable', document).value = '';
31730
- }
31731
- else if (node.tagName === 'LI' && (node.querySelector('.' + GRID_REMOVE) &&
31732
- node.querySelector('.' + GRID_REMOVE).classList.contains('e-list-icon')) && !edit && !edited) {
31733
- var dropField = select('#' + this.parentID + 'droppable', document);
31734
- var field = {
31735
- name: this.isEdit ? this.currentFieldName : this.inputObj.value,
31736
- caption: this.inputObj.value,
31737
- formula: dropField.value
31738
- };
31739
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeCalculatedField'), field, true, treeNode);
32602
+ catch (execption) {
32603
+ this.parent.actionFailureMethod(execption);
31740
32604
  }
31741
32605
  };
31742
32606
  CalculatedField.prototype.removeCalcField = function (node) {
@@ -32153,6 +33017,12 @@ var CalculatedField = /** @__PURE__ @class */ (function () {
32153
33017
  this.parent.isRequiredUpdate = false;
32154
33018
  }
32155
33019
  try {
33020
+ var actionInfo = {
33021
+ calculatedFieldInfo: this.parent.lastCalcFieldInfo
33022
+ };
33023
+ this.parent.actionObj.actionInfo = actionInfo;
33024
+ var actionName = (this.parent.actionObj.actionName == editCalculatedField) ? calculatedFieldEdited : calculatedFieldApplied;
33025
+ this.parent.actionObj.actionName = actionName;
32156
33026
  this.parent.updateDataSource(false);
32157
33027
  var pivot = (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule) ?
32158
33028
  this.parent.pivotGridModule : this.parent;
@@ -33608,7 +34478,7 @@ var FieldList = /** @__PURE__ @class */ (function () {
33608
34478
  FieldList.prototype.update = function () {
33609
34479
  var currentWidth;
33610
34480
  if (this.parent.currentView !== 'Table') {
33611
- currentWidth = this.parent.chart ? this.parent.chartModule.getCalulatedWidth() : currentWidth;
34481
+ currentWidth = this.parent.chart ? this.parent.pivotChartModule.getCalulatedWidth() : currentWidth;
33612
34482
  }
33613
34483
  else {
33614
34484
  currentWidth = this.parent.grid ? this.parent.grid.element.offsetWidth : currentWidth;
@@ -34088,7 +34958,7 @@ var GroupingBar = /** @__PURE__ @class */ (function () {
34088
34958
  currentWidth = this.parent.grid ? this.parent.grid.element.offsetWidth : currentWidth;
34089
34959
  }
34090
34960
  else {
34091
- currentWidth = this.parent.chart ? this.parent.chartModule.getCalulatedWidth() : currentWidth;
34961
+ currentWidth = this.parent.chart ? this.parent.pivotChartModule.getCalulatedWidth() : currentWidth;
34092
34962
  }
34093
34963
  if (currentWidth) {
34094
34964
  var actWidth = currentWidth < 400 ? 400 : currentWidth;
@@ -34360,15 +35230,17 @@ var ConditionalFormatting = /** @__PURE__ @class */ (function () {
34360
35230
  },
34361
35231
  {
34362
35232
  click: this.applyButtonClick.bind(this),
35233
+ isFlat: true,
34363
35234
  buttonModel: {
34364
- cssClass: FLAT_CLASS + ' ' + FORMAT_APPLY_BUTTON,
35235
+ isPrimary: true, cssClass: FORMAT_APPLY_BUTTON,
34365
35236
  content: this.parent.localeObj.getConstant('apply')
34366
35237
  }
34367
35238
  },
34368
35239
  {
34369
35240
  click: this.cancelButtonClick.bind(this),
35241
+ isFlat: true,
34370
35242
  buttonModel: {
34371
- cssClass: FLAT_CLASS + ' ' + FORMAT_CANCEL_BUTTON,
35243
+ cssClass: FORMAT_CANCEL_BUTTON,
34372
35244
  content: this.parent.localeObj.getConstant('cancel')
34373
35245
  }
34374
35246
  }
@@ -34422,6 +35294,10 @@ var ConditionalFormatting = /** @__PURE__ @class */ (function () {
34422
35294
  ConditionalFormatting.prototype.applyButtonClick = function () {
34423
35295
  if (this.refreshConditionValues()) {
34424
35296
  this.parent.setProperties({ dataSourceSettings: { conditionalFormatSettings: this.newFormat } }, true);
35297
+ var actionInfo = {
35298
+ conditionalFormattingInfo: this.parent.dataSourceSettings.conditionalFormatSettings
35299
+ };
35300
+ this.parent.actionObj.actionInfo = actionInfo;
34425
35301
  this.parent.renderPivotGrid();
34426
35302
  this.dialog.close();
34427
35303
  }
@@ -35120,12 +35996,22 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35120
35996
  };
35121
35997
  /* eslint-enable */
35122
35998
  Toolbar$$1.prototype.reportChange = function (args) {
35123
- this.dropArgs = args;
35124
- if (this.parent.isModified && this.currentReport !== '') {
35125
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
35999
+ this.parent.actionObj.actionName = reportChange;
36000
+ if (this.parent.actionBeginMethod()) {
36001
+ args.cancel = true;
36002
+ return;
35126
36003
  }
35127
- else {
35128
- this.reportLoad(args);
36004
+ try {
36005
+ this.dropArgs = args;
36006
+ if (this.parent.isModified && this.currentReport !== '') {
36007
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
36008
+ }
36009
+ else {
36010
+ this.reportLoad(args);
36011
+ }
36012
+ }
36013
+ catch (execption) {
36014
+ this.parent.actionFailureMethod(execption);
35129
36015
  }
35130
36016
  };
35131
36017
  Toolbar$$1.prototype.reportLoad = function (args) {
@@ -35134,6 +36020,10 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35134
36020
  var loadArgs = {
35135
36021
  reportName: args.itemData.value
35136
36022
  };
36023
+ var actionInfo = {
36024
+ reportName: args.itemData.value
36025
+ };
36026
+ this.parent.actionObj.actionInfo = actionInfo;
35137
36027
  this.parent.trigger(loadReport, loadArgs, function (observedArgs) {
35138
36028
  _this_1.currentReport = observedArgs.reportName;
35139
36029
  _this_1.parent.isModified = false;
@@ -35146,7 +36036,15 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35146
36036
  report: this.parent.getPersistData(),
35147
36037
  reportName: this.currentReport
35148
36038
  };
36039
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
36040
+ var actionInfo = {
36041
+ reportName: this.currentReport
36042
+ };
36043
+ this.parent.actionObj.actionInfo = actionInfo;
35149
36044
  this.parent.trigger(saveReport, saveArgs);
36045
+ if (this.parent.actionObj.actionName) {
36046
+ this.parent.actionCompleteMethod();
36047
+ }
35150
36048
  this.parent.isModified = false;
35151
36049
  }
35152
36050
  else if (this.currentReport === '' && (args.item.id === (this.parent.element.id + 'save') || args.item.id === (this.parent.element.id + 'saveas'))) {
@@ -35210,54 +36108,67 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35210
36108
  }
35211
36109
  };
35212
36110
  Toolbar$$1.prototype.actionClick = function (args) {
35213
- switch (args.item.id) {
35214
- case (this.parent.element.id + 'save'):
35215
- case (this.parent.element.id + 'saveas'):
35216
- this.saveReport(args);
35217
- break;
35218
- case (this.parent.element.id + 'remove'):
35219
- this.action = 'Remove';
35220
- if (this.currentReport && this.currentReport !== '') {
35221
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeConfirm'));
35222
- }
35223
- else {
35224
- this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant('error'), this.parent.localeObj.getConstant('emptyReport'));
35225
- }
35226
- return;
35227
- case (this.parent.element.id + 'rename'):
35228
- this.renameReport(args);
35229
- break;
35230
- case (this.parent.element.id + 'new'):
35231
- this.action = 'New';
35232
- this.newArgs = args;
35233
- if (this.parent.isModified && this.currentReport && this.currentReport !== '') {
35234
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
35235
- }
35236
- else {
35237
- this.createNewReport(args);
35238
- }
35239
- break;
35240
- case (this.parent.element.id + 'load'):
35241
- this.action = 'Load';
35242
- break;
35243
- case (this.parent.element.id + 'fieldlist'):
35244
- if (this.parent.pivotFieldListModule && this.parent.pivotFieldListModule.dialogRenderer) {
35245
- this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.show();
35246
- }
35247
- break;
35248
- case (this.parent.element.id + 'formatting'):
35249
- if (this.parent.conditionalFormattingModule) {
35250
- this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
35251
- }
35252
- break;
35253
- case (this.parent.element.id + 'mdxQuery'):
35254
- this.mdxQueryDialog(args);
35255
- break;
35256
- case (this.parent.element.id + 'numberFormatting'):
35257
- if (this.parent.numberFormattingModule) {
35258
- this.parent.numberFormattingModule.showNumberFormattingDialog();
35259
- }
35260
- break;
36111
+ var actionName = (args.item.id == "PivotViewnew") ? addNewReport : (args.item.id == "PivotViewsave") ? saveCurrentReport : (args.item.id == "PivotViewsaveas") ? saveAsCurrentReport
36112
+ : (args.item.id == "PivotViewrename") ? renameCurrentReport : (args.item.id == "PivotViewremove") ? removeCurrentReport : (args.item.id == "PivotViewload") ? loadReports
36113
+ : (args.item.id == "PivotViewformatting") ? openConditionalFormatting : (args.item.id == "PivotViewnumberFormatting") ? openNumberFormatting
36114
+ : (args.item.id == "PivotViewmdxQuery") ? MdxQuery : (args.item.id == "PivotViewfieldlist") ? showFieldList : '';
36115
+ this.parent.actionObj.actionName = actionName;
36116
+ if (this.parent.actionBeginMethod()) {
36117
+ return;
36118
+ }
36119
+ try {
36120
+ switch (args.item.id) {
36121
+ case (this.parent.element.id + 'save'):
36122
+ case (this.parent.element.id + 'saveas'):
36123
+ this.saveReport(args);
36124
+ break;
36125
+ case (this.parent.element.id + 'remove'):
36126
+ this.action = 'Remove';
36127
+ if (this.currentReport && this.currentReport !== '') {
36128
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeConfirm'));
36129
+ }
36130
+ else {
36131
+ this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant('error'), this.parent.localeObj.getConstant('emptyReport'));
36132
+ }
36133
+ return;
36134
+ case (this.parent.element.id + 'rename'):
36135
+ this.renameReport(args);
36136
+ break;
36137
+ case (this.parent.element.id + 'new'):
36138
+ this.action = 'New';
36139
+ this.newArgs = args;
36140
+ if (this.parent.isModified && this.currentReport && this.currentReport !== '') {
36141
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
36142
+ }
36143
+ else {
36144
+ this.createNewReport(args);
36145
+ }
36146
+ break;
36147
+ case (this.parent.element.id + 'load'):
36148
+ this.action = 'Load';
36149
+ break;
36150
+ case (this.parent.element.id + 'fieldlist'):
36151
+ if (this.parent.pivotFieldListModule && this.parent.pivotFieldListModule.dialogRenderer) {
36152
+ this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.show();
36153
+ }
36154
+ break;
36155
+ case (this.parent.element.id + 'formatting'):
36156
+ if (this.parent.conditionalFormattingModule) {
36157
+ this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
36158
+ }
36159
+ break;
36160
+ case (this.parent.element.id + 'mdxQuery'):
36161
+ this.mdxQueryDialog(args);
36162
+ break;
36163
+ case (this.parent.element.id + 'numberFormatting'):
36164
+ if (this.parent.numberFormattingModule) {
36165
+ this.parent.numberFormattingModule.showNumberFormattingDialog();
36166
+ }
36167
+ break;
36168
+ }
36169
+ }
36170
+ catch (execption) {
36171
+ this.parent.actionFailureMethod(execption);
35261
36172
  }
35262
36173
  };
35263
36174
  Toolbar$$1.prototype.renderDialog = function () {
@@ -35349,6 +36260,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35349
36260
  return;
35350
36261
  };
35351
36262
  Toolbar$$1.prototype.okBtnClick = function () {
36263
+ var _this_1 = this;
35352
36264
  var reportInput = this.dialog.element.querySelector('.' + GRID_REPORT_INPUT);
35353
36265
  if (reportInput && reportInput.value === '') {
35354
36266
  reportInput.focus();
@@ -35380,6 +36292,10 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35380
36292
  report: _this_2.parent.getPersistData(),
35381
36293
  reportName: reportInput.value
35382
36294
  };
36295
+ var actionInfo = {
36296
+ reportName: reportInput.value
36297
+ };
36298
+ _this_1.parent.actionObj.actionInfo = actionInfo;
35383
36299
  _this_2.parent.trigger(saveReport, saveArgs);
35384
36300
  _this_2.parent.isModified = false;
35385
36301
  _this_2.updateReportList();
@@ -35412,6 +36328,10 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35412
36328
  report: _this_3.parent.getPersistData(),
35413
36329
  reportName: reportInput.value
35414
36330
  };
36331
+ var actionInfo = {
36332
+ reportName: reportInput.value
36333
+ };
36334
+ _this_1.parent.actionObj.actionInfo = actionInfo;
35415
36335
  _this_3.parent.trigger(saveReport, saveArgs);
35416
36336
  _this_3.parent.isModified = false;
35417
36337
  _this_3.updateReportList();
@@ -35446,12 +36366,20 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35446
36366
  reportName: _this_4.currentReport,
35447
36367
  rename: reportInput.value
35448
36368
  };
36369
+ var actionInfo = {
36370
+ reportName: { oldName: _this_4.currentReport, newName: reportInput.value }
36371
+ };
36372
+ _this_1.parent.actionObj.actionInfo = actionInfo;
35449
36373
  _this_4.parent.trigger(renameReport, renameArgs);
35450
36374
  _this_4.currentReport = reportInput.value;
35451
36375
  _this_4.updateReportList();
35452
36376
  _this_4.dialog.hide();
35453
36377
  });
35454
36378
  }
36379
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
36380
+ if (this.parent.actionObj.actionName) {
36381
+ this.parent.actionCompleteMethod();
36382
+ }
35455
36383
  };
35456
36384
  Toolbar$$1.prototype.createNewReport = function (args) {
35457
36385
  this.dialogShow(args);
@@ -35510,6 +36438,10 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35510
36438
  var removeArgs = {
35511
36439
  reportName: this.currentReport
35512
36440
  };
36441
+ var actionInfo = {
36442
+ reportName: this.currentReport
36443
+ };
36444
+ this.parent.actionObj.actionInfo = actionInfo;
35513
36445
  this.parent.trigger(removeReport, removeArgs);
35514
36446
  var reports = this.fetchReports();
35515
36447
  if (reports.reportName && reports.reportName.length > 0) {
@@ -35528,6 +36460,10 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35528
36460
  this.action = '';
35529
36461
  }
35530
36462
  this.updateReportList();
36463
+ this.parent.actionObj.actionName = reportRemoved;
36464
+ if (this.parent.actionObj.actionName) {
36465
+ this.parent.actionCompleteMethod();
36466
+ }
35531
36467
  }
35532
36468
  else if (this.action === 'New' || (this.action !== 'Save' && this.action !== 'Rename' && this.action !== 'New')) {
35533
36469
  if (this.currentReport && this.currentReport !== '' && this.parent.isModified) {
@@ -35535,12 +36471,22 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35535
36471
  report: this.parent.getPersistData(),
35536
36472
  reportName: this.currentReport
35537
36473
  };
36474
+ var actionInfo = {
36475
+ reportName: this.currentReport
36476
+ };
36477
+ this.parent.actionObj.actionInfo = actionInfo;
36478
+ this.parent.actionObj.actionName = reportSaved;
36479
+ if (this.parent.actionObj.actionName) {
36480
+ this.parent.actionCompleteMethod();
36481
+ }
35538
36482
  this.parent.trigger(saveReport, saveArgs);
35539
36483
  this.parent.isModified = false;
35540
36484
  if (this.action === 'New') {
36485
+ this.parent.actionObj.actionName = addNewReport;
35541
36486
  this.createNewReport(this.newArgs);
35542
36487
  }
35543
36488
  else {
36489
+ this.parent.actionObj.actionName = reportChange;
35544
36490
  this.reportLoad(this.dropArgs);
35545
36491
  }
35546
36492
  }
@@ -35646,6 +36592,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35646
36592
  this.chartMenu = new Menu({
35647
36593
  items: menu, enableRtl: this.parent.enableRtl,
35648
36594
  locale: this.parent.locale,
36595
+ cssClass: TOOLBAR_MENU,
35649
36596
  select: this.menuItemClick.bind(this),
35650
36597
  beforeOpen: this.whitespaceRemove.bind(this),
35651
36598
  onClose: function (args) {
@@ -35702,6 +36649,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35702
36649
  this.exportMenu = new Menu({
35703
36650
  items: menu, enableRtl: this.parent.enableRtl,
35704
36651
  locale: this.parent.locale,
36652
+ cssClass: TOOLBAR_MENU,
35705
36653
  select: this.menuItemClick.bind(this), beforeOpen: this.updateExportMenu.bind(this),
35706
36654
  onClose: function (args) {
35707
36655
  _this_1.focusToolBar();
@@ -35739,6 +36687,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35739
36687
  this.subTotalMenu = new Menu({
35740
36688
  items: menu, enableRtl: this.parent.enableRtl,
35741
36689
  locale: this.parent.locale,
36690
+ cssClass: TOOLBAR_MENU,
35742
36691
  select: this.menuItemClick.bind(this), beforeOpen: this.updateSubtotalSelection.bind(this),
35743
36692
  onClose: function (args) {
35744
36693
  _this_1.focusToolBar();
@@ -35776,6 +36725,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35776
36725
  this.grandTotalMenu = new Menu({
35777
36726
  items: menu, enableRtl: this.parent.enableRtl,
35778
36727
  locale: this.parent.locale,
36728
+ cssClass: TOOLBAR_MENU,
35779
36729
  select: this.menuItemClick.bind(this), beforeOpen: this.updateGrandtotalSelection.bind(this),
35780
36730
  onClose: function (args) {
35781
36731
  _this_1.focusToolBar();
@@ -35803,6 +36753,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
35803
36753
  this.formattingMenu = new Menu({
35804
36754
  items: menu, enableRtl: this.parent.enableRtl,
35805
36755
  locale: this.parent.locale,
36756
+ cssClass: TOOLBAR_MENU,
35806
36757
  select: this.menuItemClick.bind(this)
35807
36758
  });
35808
36759
  this.formattingMenu.isStringTemplate = true;
@@ -36002,181 +36953,202 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
36002
36953
  var _this_1 = this;
36003
36954
  var exportArgs = {};
36004
36955
  var type;
36956
+ var actionName = (args.item.id == "PivotViewgrid") ? tableView : (args.item.id == "PivotView_Column") ? chartView : (args.item.id == "PivotView_Bar") ? chartView : (args.item.id == "PivotView_Line") ? chartView
36957
+ : (args.item.id == "PivotView_Area") ? chartView : (args.item.id == "PivotView_Scatter") ? chartView : (args.item.id == "PivotView_Polar") ? chartView : (args.item.id == "PivotView_ChartMoreOption") ? chartView
36958
+ : (args.item.id == "PivotView_multipleAxes") ? multipleAxis : (args.item.id == "PivotView_showLegend") ? showLegend : (args.item.id == "PivotViewpdf") ? pdfExport : (args.item.id == "PivotViewpng") ? pngExport
36959
+ : (args.item.id == "PivotViewexcel") ? excelExport : (args.item.id == "PivotViewcsv") ? csvExport : (args.item.id == "PivotViewjpeg") ? jpegExport : (args.item.id == "PivotViewsvg") ? svgExport
36960
+ : (args.item.id == "PivotViewnotsubtotal") ? hideSubTotals : (args.item.id == "PivotViewsubtotalrow") ? subTotalsRow : (args.item.id == "PivotViewsubtotalcolumn") ? subTotalsColumn
36961
+ : (args.item.id == "PivotViewsubtotal") ? showSubTotals : (args.item.id == "PivotViewnotgrandtotal") ? hideGrandTotals : (args.item.id == "PivotViewgrandtotalrow") ? grandTotalsRow
36962
+ : (args.item.id == "PivotViewgrandtotalcolumn") ? grandTotalsColumn : (args.item.id == "PivotViewgrandtotal") ? showGrandTotals
36963
+ : (args.item.id == "PivotViewnumberFormattingMenu") ? numberFormattingMenu : (args.item.id == "PivotViewconditionalFormattingMenu") ? conditionalFormattingMenu : '';
36964
+ this.parent.actionObj.actionName = actionName;
36965
+ if (this.parent.actionBeginMethod()) {
36966
+ return;
36967
+ }
36005
36968
  if (this.getAllChartItems().indexOf(args.item.id.split(this.parent.element.id + '_')[1]) > -1 ||
36006
36969
  (args.item.id.split(this.parent.element.id + '_')[1] === 'ChartMoreOption') ||
36007
36970
  (args.item.id.split(this.parent.element.id + '_')[1] === 'multipleAxes') ||
36008
36971
  (args.item.id.split(this.parent.element.id + '_')[1] === 'showLegend')) {
36009
36972
  type = args.item.id.split(this.parent.element.id + '_')[1];
36010
36973
  }
36011
- switch (args.item.id) {
36012
- case (this.parent.element.id + 'grid'):
36013
- if (this.parent.grid && this.parent.chart) {
36014
- this.parent.grid.element.style.display = '';
36015
- this.parent.chart.element.style.display = 'none';
36016
- if (this.parent.chartSettings.enableMultipleAxis && this.parent.chartSettings.enableScrollOnMultiAxis) {
36017
- this.parent.element.querySelector('.e-pivotchart').style.display = 'none';
36018
- }
36019
- this.parent.currentView = 'Table';
36020
- this.parent.setProperties({ displayOption: { primary: 'Table' } }, true);
36021
- if (this.parent.showGroupingBar && this.parent.groupingBarModule) {
36022
- this.parent.element.querySelector('.e-pivot-grouping-bar').style.display = '';
36023
- this.parent.element.querySelector('.e-chart-grouping-bar').style.display = 'none';
36974
+ try {
36975
+ switch (args.item.id) {
36976
+ case (this.parent.element.id + 'grid'):
36977
+ if (this.parent.grid && this.parent.chart) {
36978
+ this.parent.grid.element.style.display = '';
36979
+ this.parent.chart.element.style.display = 'none';
36980
+ if (this.parent.chartSettings.enableMultipleAxis && this.parent.chartSettings.enableScrollOnMultiAxis) {
36981
+ this.parent.element.querySelector('.e-pivotchart').style.display = 'none';
36982
+ }
36983
+ this.parent.currentView = 'Table';
36984
+ this.parent.setProperties({ displayOption: { primary: 'Table' } }, true);
36985
+ if (this.parent.showGroupingBar && this.parent.groupingBarModule) {
36986
+ this.parent.element.querySelector('.e-pivot-grouping-bar').style.display = '';
36987
+ this.parent.element.querySelector('.e-chart-grouping-bar').style.display = 'none';
36988
+ }
36989
+ var actionInfo = {
36990
+ toolbarInfo: { displayOption: this.parent.displayOption, gridSettings: this.parent.gridSettings }
36991
+ };
36992
+ this.parent.actionObj.actionInfo = actionInfo;
36993
+ this.parent.layoutRefresh();
36024
36994
  }
36025
- this.parent.layoutRefresh();
36026
- }
36027
- break;
36028
- case (this.parent.element.id + 'pdf'):
36029
- if (this.parent.currentView === 'Table') {
36995
+ break;
36996
+ case (this.parent.element.id + 'pdf'):
36997
+ if (this.parent.currentView === 'Table') {
36998
+ exportArgs = {
36999
+ pdfExportProperties: { fileName: 'Export.pdf' },
37000
+ pdfDoc: undefined,
37001
+ isBlob: false,
37002
+ isMultipleExport: false
37003
+ };
37004
+ this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
37005
+ _this_1.parent.pdfExport(observedArgs.pdfExportProperties, observedArgs.isMultipleExport, observedArgs.pdfDoc, observedArgs.isBlob);
37006
+ });
37007
+ }
37008
+ else {
37009
+ exportArgs = {
37010
+ width: undefined,
37011
+ height: undefined,
37012
+ orientation: PdfPageOrientation.Landscape,
37013
+ type: 'PDF',
37014
+ fileName: 'result',
37015
+ };
37016
+ this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
37017
+ _this_1.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
37018
+ });
37019
+ }
37020
+ break;
37021
+ case (this.parent.element.id + 'excel'):
36030
37022
  exportArgs = {
36031
- pdfExportProperties: { fileName: 'Export.pdf' },
36032
- pdfDoc: undefined,
37023
+ excelExportProperties: { fileName: 'Export.xlsx' },
37024
+ isBlob: undefined,
37025
+ isMultipleExport: undefined,
37026
+ workbook: undefined
37027
+ };
37028
+ this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
37029
+ _this_1.parent.excelExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
37030
+ });
37031
+ break;
37032
+ case (this.parent.element.id + 'csv'):
37033
+ exportArgs = {
37034
+ excelExportProperties: { fileName: 'Export.csv' },
36033
37035
  isBlob: false,
36034
- isMultipleExport: false
37036
+ isMultipleExport: false,
37037
+ workbook: undefined
36035
37038
  };
36036
37039
  this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
36037
- _this_1.parent.pdfExport(observedArgs.pdfExportProperties, observedArgs.isMultipleExport, observedArgs.pdfDoc, observedArgs.isBlob);
37040
+ _this_1.parent.csvExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
36038
37041
  });
36039
- }
36040
- else {
37042
+ break;
37043
+ case (this.parent.element.id + 'png'):
36041
37044
  exportArgs = {
37045
+ type: 'PNG',
36042
37046
  width: undefined,
36043
37047
  height: undefined,
37048
+ fileName: 'result',
36044
37049
  orientation: PdfPageOrientation.Landscape,
36045
- type: 'PDF',
37050
+ };
37051
+ this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
37052
+ _this_1.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
37053
+ });
37054
+ break;
37055
+ case (this.parent.element.id + 'jpeg'):
37056
+ exportArgs = {
37057
+ type: 'JPEG',
36046
37058
  fileName: 'result',
37059
+ orientation: PdfPageOrientation.Landscape,
37060
+ width: undefined,
37061
+ height: undefined,
36047
37062
  };
36048
37063
  this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
36049
37064
  _this_1.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
36050
37065
  });
36051
- }
36052
- break;
36053
- case (this.parent.element.id + 'excel'):
36054
- exportArgs = {
36055
- excelExportProperties: { fileName: 'Export.xlsx' },
36056
- isBlob: undefined,
36057
- isMultipleExport: undefined,
36058
- workbook: undefined
36059
- };
36060
- this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
36061
- _this_1.parent.excelExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
36062
- });
36063
- break;
36064
- case (this.parent.element.id + 'csv'):
36065
- exportArgs = {
36066
- excelExportProperties: { fileName: 'Export.csv' },
36067
- isBlob: false,
36068
- isMultipleExport: false,
36069
- workbook: undefined
36070
- };
36071
- this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
36072
- _this_1.parent.csvExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
36073
- });
36074
- break;
36075
- case (this.parent.element.id + 'png'):
36076
- exportArgs = {
36077
- type: 'PNG',
36078
- width: undefined,
36079
- height: undefined,
36080
- fileName: 'result',
36081
- orientation: PdfPageOrientation.Landscape,
36082
- };
36083
- this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
36084
- _this_1.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
36085
- });
36086
- break;
36087
- case (this.parent.element.id + 'jpeg'):
36088
- exportArgs = {
36089
- type: 'JPEG',
36090
- fileName: 'result',
36091
- orientation: PdfPageOrientation.Landscape,
36092
- width: undefined,
36093
- height: undefined,
36094
- };
36095
- this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
36096
- _this_1.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
36097
- });
36098
- break;
36099
- case (this.parent.element.id + 'svg'):
36100
- exportArgs = {
36101
- width: undefined,
36102
- height: undefined,
36103
- type: 'SVG',
36104
- fileName: 'result',
36105
- orientation: PdfPageOrientation.Landscape,
36106
- };
36107
- this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
36108
- _this_1.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
36109
- });
36110
- break;
36111
- case (this.parent.element.id + 'notsubtotal'):
36112
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: false, showColumnSubTotals: false, showRowSubTotals: false } }, true);
36113
- this.parent.refreshData();
36114
- break;
36115
- case (this.parent.element.id + 'subtotalrow'):
36116
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: false, showRowSubTotals: true } }, true);
36117
- this.parent.refreshData();
36118
- break;
36119
- case (this.parent.element.id + 'subtotalcolumn'):
36120
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: false } }, true);
36121
- this.parent.refreshData();
36122
- break;
36123
- case (this.parent.element.id + 'subtotal'):
36124
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: true } }, true);
36125
- this.parent.refreshData();
36126
- break;
36127
- case (this.parent.element.id + 'notgrandtotal'):
36128
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: false, showColumnGrandTotals: false, showRowGrandTotals: false } }, true);
36129
- this.parent.refreshData();
36130
- break;
36131
- case (this.parent.element.id + 'grandtotalrow'):
36132
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: false, showRowGrandTotals: true } }, true);
36133
- this.parent.refreshData();
36134
- break;
36135
- case (this.parent.element.id + 'grandtotalcolumn'):
36136
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: false } }, true);
36137
- this.parent.refreshData();
36138
- break;
36139
- case (this.parent.element.id + 'grandtotal'):
36140
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: true } }, true);
36141
- this.parent.refreshData();
36142
- break;
36143
- case (this.parent.element.id + 'numberFormattingMenu'):
36144
- if (this.parent.numberFormattingModule) {
36145
- this.parent.numberFormattingModule.showNumberFormattingDialog();
36146
- }
36147
- break;
36148
- case (this.parent.element.id + 'conditionalFormattingMenu'):
36149
- if (this.parent.conditionalFormattingModule) {
36150
- this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
36151
- }
36152
- break;
36153
- case (this.parent.element.id + '_' + type):
36154
- if (args.item && args.item.text) {
36155
- if (type === 'ChartMoreOption') {
36156
- this.createChartTypeDialog();
36157
- }
36158
- else if (type === 'multipleAxes') {
36159
- if (this.parent.chartSettings.enableScrollOnMultiAxis) {
36160
- this.isMultiAxisChange = true;
36161
- }
36162
- this.parent.chartSettings.enableMultipleAxis = !this.parent.chartSettings.enableMultipleAxis;
36163
- this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
37066
+ break;
37067
+ case (this.parent.element.id + 'svg'):
37068
+ exportArgs = {
37069
+ width: undefined,
37070
+ height: undefined,
37071
+ type: 'SVG',
37072
+ fileName: 'result',
37073
+ orientation: PdfPageOrientation.Landscape,
37074
+ };
37075
+ this.parent.trigger(beforeExport, exportArgs, function (observedArgs) {
37076
+ _this_1.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
37077
+ });
37078
+ break;
37079
+ case (this.parent.element.id + 'notsubtotal'):
37080
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: false, showColumnSubTotals: false, showRowSubTotals: false } }, true);
37081
+ this.parent.refreshData();
37082
+ break;
37083
+ case (this.parent.element.id + 'subtotalrow'):
37084
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: false, showRowSubTotals: true } }, true);
37085
+ this.parent.refreshData();
37086
+ break;
37087
+ case (this.parent.element.id + 'subtotalcolumn'):
37088
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: false } }, true);
37089
+ this.parent.refreshData();
37090
+ break;
37091
+ case (this.parent.element.id + 'subtotal'):
37092
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: true } }, true);
37093
+ this.parent.refreshData();
37094
+ break;
37095
+ case (this.parent.element.id + 'notgrandtotal'):
37096
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: false, showColumnGrandTotals: false, showRowGrandTotals: false } }, true);
37097
+ this.parent.refreshData();
37098
+ break;
37099
+ case (this.parent.element.id + 'grandtotalrow'):
37100
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: false, showRowGrandTotals: true } }, true);
37101
+ this.parent.refreshData();
37102
+ break;
37103
+ case (this.parent.element.id + 'grandtotalcolumn'):
37104
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: false } }, true);
37105
+ this.parent.refreshData();
37106
+ break;
37107
+ case (this.parent.element.id + 'grandtotal'):
37108
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: true } }, true);
37109
+ this.parent.refreshData();
37110
+ break;
37111
+ case (this.parent.element.id + 'numberFormattingMenu'):
37112
+ if (this.parent.numberFormattingModule) {
37113
+ this.parent.numberFormattingModule.showNumberFormattingDialog();
36164
37114
  }
36165
- else if (this.getAllChartItems().indexOf(type) > -1) {
36166
- this.updateChartType(type, false);
37115
+ break;
37116
+ case (this.parent.element.id + 'conditionalFormattingMenu'):
37117
+ if (this.parent.conditionalFormattingModule) {
37118
+ this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
36167
37119
  }
36168
- else if (type === 'showLegend') {
36169
- this.parent.chart.legendSettings.visible = !this.showLableState;
36170
- if (this.parent.chartSettings.legendSettings) {
36171
- this.parent.chartSettings.legendSettings.visible = !this.showLableState;
37120
+ break;
37121
+ case (this.parent.element.id + '_' + type):
37122
+ if (args.item && args.item.text) {
37123
+ if (type === 'ChartMoreOption') {
37124
+ this.createChartTypeDialog();
37125
+ }
37126
+ else if (type === 'multipleAxes') {
37127
+ if (this.parent.chartSettings.enableScrollOnMultiAxis) {
37128
+ this.isMultiAxisChange = true;
37129
+ }
37130
+ this.parent.chartSettings.enableMultipleAxis = !this.parent.chartSettings.enableMultipleAxis;
37131
+ this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
36172
37132
  }
36173
- else {
36174
- this.parent.setProperties({ chartSettings: { legendSettings: { visible: !this.showLableState } } }, true);
37133
+ else if (this.getAllChartItems().indexOf(type) > -1) {
37134
+ this.updateChartType(type, false);
37135
+ }
37136
+ else if (type === 'showLegend') {
37137
+ this.parent.chart.legendSettings.visible = !this.showLableState;
37138
+ if (this.parent.chartSettings.legendSettings) {
37139
+ this.parent.chartSettings.legendSettings.visible = !this.showLableState;
37140
+ }
37141
+ else {
37142
+ this.parent.setProperties({ chartSettings: { legendSettings: { visible: !this.showLableState } } }, true);
37143
+ }
37144
+ this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
36175
37145
  }
36176
- this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
36177
37146
  }
36178
- }
36179
- break;
37147
+ break;
37148
+ }
37149
+ }
37150
+ catch (execption) {
37151
+ this.parent.actionFailureMethod(execption);
36180
37152
  }
36181
37153
  /* eslint-enable max-len */
36182
37154
  };
@@ -36268,14 +37240,20 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
36268
37240
  if (this.parent.chart) {
36269
37241
  this.parent.currentView = 'Chart';
36270
37242
  this.parent.setProperties({ displayOption: { primary: 'Chart' } }, true);
36271
- this.parent.chart.element.style.width = formatUnit(this.parent.grid ? this.parent.getGridWidthAsNumber() : this.parent.getWidthAsNumber()); /* eslint-disable-line */
37243
+ if (this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
37244
+ this.parent.element.querySelector('.' + PIVOTCHART).style.width = formatUnit(this.parent.grid ? this.parent.getGridWidthAsNumber() : this.parent.getWidthAsNumber()); /* eslint-disable-line */
37245
+ }
36272
37246
  this.parent.chart.setProperties({ width: formatUnit(this.parent.grid ? this.parent.getGridWidthAsNumber() : this.parent.getWidthAsNumber()) }, true); /* eslint-disable-line */
36273
37247
  if (this.parent.chartSettings.chartSeries.type === type && !isMultiAxis) {
36274
- this.parent.chartModule.updateView();
37248
+ this.parent.pivotChartModule.updateView();
36275
37249
  }
36276
37250
  else {
36277
37251
  this.parent.chartSettings.chartSeries.type = type;
36278
37252
  }
37253
+ var actionInfo = {
37254
+ toolbarInfo: { displayOption: this.parent.displayOption, chartSettings: this.parent.chartSettings }
37255
+ };
37256
+ this.parent.actionObj.actionInfo = actionInfo;
36279
37257
  }
36280
37258
  }
36281
37259
  };
@@ -36839,6 +37817,10 @@ var NumberFormatting = /** @__PURE__ @class */ (function () {
36839
37817
  this.parent.trigger(numberFormatting, eventArgs, function (observedArgs) {
36840
37818
  if (!observedArgs.cancel) {
36841
37819
  _this.parent.setProperties({ dataSourceSettings: { formatSettings: observedArgs.formatSettings } }, true);
37820
+ var actionInfo = {
37821
+ numberFormattingInfo: _this.parent.dataSourceSettings.formatSettings
37822
+ };
37823
+ _this.parent.actionObj.actionInfo = actionInfo;
36842
37824
  try {
36843
37825
  _this.parent.updateDataSource(false);
36844
37826
  _this.dialog.close();
@@ -37503,7 +38485,7 @@ var Grouping = /** @__PURE__ @class */ (function () {
37503
38485
  for (var j = 0, len_1 = field.customGroups.length; j < len_1; j++) {
37504
38486
  if (field.customGroups[j]) {
37505
38487
  var group = field.customGroups[j];
37506
- if (group.items && PivotUtil.isContainCommonElements(group.items, selectedOptions)) {
38488
+ if (group.items && PivotExportUtil.isContainCommonElements(group.items, selectedOptions)) {
37507
38489
  splicedItems = this.mergeArray(splicedItems, [group.groupName]);
37508
38490
  newItems = this.mergeArray(newItems, group.items);
37509
38491
  field.customGroups.splice(j, 1);
@@ -37761,5 +38743,5 @@ var Grouping = /** @__PURE__ @class */ (function () {
37761
38743
  * Export PivotGrid components
37762
38744
  */
37763
38745
 
37764
- 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 };
38746
+ 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 };
37765
38747
  //# sourceMappingURL=ej2-pivotview.es5.js.map