@syncfusion/ej2-pivotview 19.3.55 → 19.4.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +76 -0
  2. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +56 -0
  3. package/CHANGELOG.md +34 -28
  4. package/README.md +1 -1
  5. package/dist/ej2-pivotview.umd.min.js +2 -2
  6. package/dist/ej2-pivotview.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-pivotview.es2015.js +2068 -1096
  8. package/dist/es6/ej2-pivotview.es2015.js.map +1 -1
  9. package/dist/es6/ej2-pivotview.es5.js +2084 -1106
  10. package/dist/es6/ej2-pivotview.es5.js.map +1 -1
  11. package/dist/global/ej2-pivotview.min.js +2 -2
  12. package/dist/global/ej2-pivotview.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +22 -22
  15. package/src/base/engine.d.ts +17 -1
  16. package/src/base/engine.js +82 -29
  17. package/src/base/export-util.d.ts +17 -0
  18. package/src/base/export-util.js +245 -0
  19. package/src/base/olap/engine.d.ts +7 -0
  20. package/src/base/olap/engine.js +138 -35
  21. package/src/base/util.d.ts +0 -9
  22. package/src/base/util.js +2 -215
  23. package/src/common/actions/field-list.js +1 -1
  24. package/src/common/actions/pivot-button.d.ts +5 -8
  25. package/src/common/actions/pivot-button.js +188 -171
  26. package/src/common/base/constant.d.ts +186 -0
  27. package/src/common/base/constant.js +186 -0
  28. package/src/common/base/css-constant.d.ts +2 -0
  29. package/src/common/base/css-constant.js +2 -0
  30. package/src/common/base/enum.d.ts +11 -0
  31. package/src/common/base/interface.d.ts +272 -2
  32. package/src/common/calculatedfield/calculated-field.js +108 -93
  33. package/src/common/conditionalformatting/conditional-formatting.js +8 -2
  34. package/src/common/grouping-bar/grouping-bar.js +1 -1
  35. package/src/common/popups/aggregate-menu.js +57 -35
  36. package/src/common/popups/drillthrough-dialog.js +187 -139
  37. package/src/common/popups/filter-dialog.d.ts +1 -0
  38. package/src/common/popups/filter-dialog.js +22 -1
  39. package/src/common/popups/formatting-dialog.js +4 -0
  40. package/src/common/popups/grouping.js +2 -1
  41. package/src/common/popups/toolbar.js +305 -203
  42. package/src/pivotchart/base/pivotchart.js +36 -15
  43. package/src/pivotfieldlist/base/field-list-model.d.ts +49 -1
  44. package/src/pivotfieldlist/base/field-list.d.ts +55 -1
  45. package/src/pivotfieldlist/base/field-list.js +68 -1
  46. package/src/pivotfieldlist/renderer/dialog-renderer.js +38 -15
  47. package/src/pivotfieldlist/renderer/tree-renderer.js +35 -22
  48. package/src/pivotview/actions/drill-through.js +1 -1
  49. package/src/pivotview/actions/excel-export.js +9 -7
  50. package/src/pivotview/actions/pdf-export.js +3 -3
  51. package/src/pivotview/actions/virtualscroll.d.ts +1 -0
  52. package/src/pivotview/actions/virtualscroll.js +6 -2
  53. package/src/pivotview/base/pivotview-model.d.ts +46 -1
  54. package/src/pivotview/base/pivotview.d.ts +56 -2
  55. package/src/pivotview/base/pivotview.js +311 -107
  56. package/src/pivotview/model/chartsettings-model.d.ts +2 -2
  57. package/src/pivotview/model/chartsettings.d.ts +2 -2
  58. package/src/pivotview/model/chartsettings.js +2 -2
  59. package/src/pivotview/model/datasourcesettings-model.d.ts +8 -1
  60. package/src/pivotview/model/datasourcesettings.d.ts +7 -0
  61. package/src/pivotview/model/datasourcesettings.js +3 -0
  62. package/src/pivotview/renderer/render.d.ts +2 -1
  63. package/src/pivotview/renderer/render.js +39 -6
  64. package/styles/bootstrap-dark.css +115 -104
  65. package/styles/bootstrap.css +115 -104
  66. package/styles/bootstrap4.css +114 -81
  67. package/styles/bootstrap5-dark.css +220 -168
  68. package/styles/bootstrap5.css +215 -161
  69. package/styles/fabric-dark.css +117 -103
  70. package/styles/fabric.css +115 -102
  71. package/styles/highcontrast-light.css +116 -102
  72. package/styles/highcontrast.css +118 -104
  73. package/styles/material-dark.css +108 -97
  74. package/styles/material.css +108 -97
  75. package/styles/pivotfieldlist/_bootstrap-dark-definition.scss +1 -4
  76. package/styles/pivotfieldlist/_bootstrap-definition.scss +1 -4
  77. package/styles/pivotfieldlist/_bootstrap4-definition.scss +1 -4
  78. package/styles/pivotfieldlist/_bootstrap5-definition.scss +8 -11
  79. package/styles/pivotfieldlist/_fabric-dark-definition.scss +1 -4
  80. package/styles/pivotfieldlist/_fabric-definition.scss +1 -4
  81. package/styles/pivotfieldlist/_fluent-definition.scss +177 -0
  82. package/styles/pivotfieldlist/_highcontrast-definition.scss +1 -4
  83. package/styles/pivotfieldlist/_highcontrast-light-definition.scss +1 -4
  84. package/styles/pivotfieldlist/_layout.scss +199 -109
  85. package/styles/pivotfieldlist/_material-dark-definition.scss +1 -4
  86. package/styles/pivotfieldlist/_material-definition.scss +1 -4
  87. package/styles/pivotfieldlist/_tailwind-definition.scss +6 -9
  88. package/styles/pivotfieldlist/_theme.scss +185 -35
  89. package/styles/pivotfieldlist/bootstrap-dark.css +49 -58
  90. package/styles/pivotfieldlist/bootstrap.css +49 -58
  91. package/styles/pivotfieldlist/bootstrap4.css +44 -39
  92. package/styles/pivotfieldlist/bootstrap5-dark.css +115 -89
  93. package/styles/pivotfieldlist/bootstrap5.css +115 -89
  94. package/styles/pivotfieldlist/fabric-dark.css +49 -58
  95. package/styles/pivotfieldlist/fabric.css +49 -58
  96. package/styles/pivotfieldlist/highcontrast-light.css +49 -58
  97. package/styles/pivotfieldlist/highcontrast.css +49 -58
  98. package/styles/pivotfieldlist/icons/_bootstrap5.scss +2 -2
  99. package/styles/pivotfieldlist/icons/_fluent.scss +352 -0
  100. package/styles/pivotfieldlist/icons/_tailwind.scss +2 -2
  101. package/styles/pivotfieldlist/material-dark.css +44 -53
  102. package/styles/pivotfieldlist/material.css +44 -53
  103. package/styles/pivotfieldlist/tailwind-dark.css +138 -81
  104. package/styles/pivotfieldlist/tailwind.css +140 -83
  105. package/styles/pivotview/_bootstrap-dark-definition.scss +9 -6
  106. package/styles/pivotview/_bootstrap-definition.scss +9 -6
  107. package/styles/pivotview/_bootstrap4-definition.scss +10 -7
  108. package/styles/pivotview/_bootstrap5-definition.scss +12 -9
  109. package/styles/pivotview/_fabric-dark-definition.scss +8 -5
  110. package/styles/pivotview/_fabric-definition.scss +7 -4
  111. package/styles/pivotview/_fluent-definition.scss +126 -0
  112. package/styles/pivotview/_highcontrast-definition.scss +8 -5
  113. package/styles/pivotview/_highcontrast-light-definition.scss +7 -4
  114. package/styles/pivotview/_layout.scss +119 -64
  115. package/styles/pivotview/_material-dark-definition.scss +7 -4
  116. package/styles/pivotview/_material-definition.scss +8 -4
  117. package/styles/pivotview/_tailwind-definition.scss +8 -5
  118. package/styles/pivotview/_theme.scss +124 -70
  119. package/styles/pivotview/bootstrap-dark.css +66 -46
  120. package/styles/pivotview/bootstrap.css +66 -46
  121. package/styles/pivotview/bootstrap4.css +70 -42
  122. package/styles/pivotview/bootstrap5-dark.css +99 -73
  123. package/styles/pivotview/bootstrap5-dark.scss +0 -1
  124. package/styles/pivotview/bootstrap5.css +100 -72
  125. package/styles/pivotview/fabric-dark.css +68 -45
  126. package/styles/pivotview/fabric.css +66 -44
  127. package/styles/pivotview/highcontrast-light.css +67 -44
  128. package/styles/pivotview/highcontrast.css +69 -46
  129. package/styles/pivotview/icons/_bootstrap4.scss +1 -1
  130. package/styles/pivotview/icons/_bootstrap5.scss +1 -1
  131. package/styles/pivotview/icons/_fluent.scss +183 -0
  132. package/styles/pivotview/icons/_tailwind.scss +1 -1
  133. package/styles/pivotview/material-dark.css +64 -44
  134. package/styles/pivotview/material.css +64 -44
  135. package/styles/pivotview/tailwind-dark.css +106 -58
  136. package/styles/pivotview/tailwind-dark.scss +0 -1
  137. package/styles/pivotview/tailwind.css +107 -57
  138. package/styles/tailwind-dark.css +250 -145
  139. package/styles/tailwind.css +247 -140
@@ -60,41 +60,6 @@ class PivotUtil {
60
60
  }
61
61
  return clonedData;
62
62
  }
63
- static getClonedPivotValues(pivotValues) {
64
- let clonedSets = [];
65
- for (let i = 0; i < pivotValues.length; i++) {
66
- if (pivotValues[i]) {
67
- clonedSets[i] = [];
68
- for (let j = 0; j < pivotValues[i].length; j++) {
69
- if (pivotValues[i][j]) {
70
- /* eslint-disable */
71
- clonedSets[i][j] = this.getClonedPivotValueObj(pivotValues[i][j]);
72
- /* eslint-enable */
73
- }
74
- }
75
- }
76
- }
77
- return clonedSets;
78
- }
79
- /* eslint-disable */
80
- static getClonedPivotValueObj(data) {
81
- /* eslint-enable */
82
- let keyPos = 0;
83
- /* eslint-disable @typescript-eslint/no-explicit-any */
84
- let framedSet = {};
85
- /* eslint-enable @typescript-eslint/no-explicit-any */
86
- if (!(data === null || data === undefined)) {
87
- let fields = Object.keys(data);
88
- while (keyPos < fields.length) {
89
- framedSet[fields[keyPos]] = data[fields[keyPos]];
90
- keyPos++;
91
- }
92
- }
93
- else {
94
- framedSet = data;
95
- }
96
- return framedSet;
97
- }
98
63
  /* eslint-disable @typescript-eslint/no-explicit-any */
99
64
  static getDefinedObj(data) {
100
65
  let keyPos = 0;
@@ -127,18 +92,6 @@ class PivotUtil {
127
92
  return -1;
128
93
  }
129
94
  /* eslint-disable */
130
- static isContainCommonElements(collection1, collection2) {
131
- /* eslint-enable */
132
- for (let i = 0, cnt = collection1.length; i < cnt; i++) {
133
- for (let j = 0, lnt = collection2.length; j < lnt; j++) {
134
- if (collection2[j] === collection1[i]) {
135
- return true;
136
- }
137
- }
138
- }
139
- return false;
140
- }
141
- /* eslint-disable */
142
95
  static setPivotProperties(control, properties) {
143
96
  /* eslint-enable */
144
97
  control.allowServerDataBinding = false;
@@ -175,6 +128,7 @@ class PivotUtil {
175
128
  drilledMembers: this.cloneDrillMemberSettings(dataSourceSettings.drilledMembers),
176
129
  valueSortSettings: this.CloneValueSortObject(dataSourceSettings.valueSortSettings),
177
130
  valueAxis: dataSourceSettings.valueAxis,
131
+ grandTotalsPosition: dataSourceSettings.grandTotalsPosition,
178
132
  formatSettings: this.cloneFormatSettings(dataSourceSettings.formatSettings),
179
133
  calculatedFieldSettings: this.cloneCalculatedFieldSettings(dataSourceSettings.calculatedFieldSettings),
180
134
  fieldMapping: this.cloneFieldSettings(dataSourceSettings.fieldMapping),
@@ -221,6 +175,7 @@ class PivotUtil {
221
175
  drilledMembers: dataSourceSettings.drilledMembers,
222
176
  valueSortSettings: dataSourceSettings.valueSortSettings,
223
177
  valueAxis: dataSourceSettings.valueAxis,
178
+ grandTotalsPosition: dataSourceSettings.grandTotalsPosition,
224
179
  formatSettings: dataSourceSettings.formatSettings,
225
180
  calculatedFieldSettings: dataSourceSettings.calculatedFieldSettings,
226
181
  fieldMapping: dataSourceSettings.fieldMapping,
@@ -632,174 +587,6 @@ class PivotUtil {
632
587
  return values;
633
588
  }
634
589
  /* eslint-disable */
635
- static formatPdfHeaderFooter(pdf) {
636
- let contents = [];
637
- if (!isNullOrUndefined(pdf)) {
638
- for (let i = 0; i < pdf.length; i++) {
639
- let a = pdf[i];
640
- let content = {
641
- /* eslint-enable */
642
- type: a.Type,
643
- pageNumberType: a.PageNumberType,
644
- style: a.Style ? {
645
- penColor: a.Style.PenColor,
646
- penSize: a.Style.PenSize,
647
- dashStyle: a.Style.DashStyle,
648
- textBrushColor: a.Style.TextBrushColor,
649
- textPenColor: a.Style.TextPenColor,
650
- fontSize: a.Style.FontSize,
651
- hAlign: a.Style.HAlign,
652
- vAlign: a.Style.VAlign
653
- } : a.Style,
654
- points: a.Points !== null ? {
655
- x1: a.Points.X1,
656
- y1: a.Points.Y1,
657
- x2: a.Points.X2,
658
- y2: a.Points.Y2
659
- } : null,
660
- format: a.Format,
661
- position: a.Position !== null ? {
662
- x: a.Position.X,
663
- y: a.Position.Y
664
- } : null,
665
- size: a.Size !== null ? {
666
- height: a.Size.Height,
667
- width: a.Size.Width
668
- } : null,
669
- src: a.Src,
670
- value: a.Value,
671
- font: a.Font
672
- };
673
- contents.push(content);
674
- }
675
- }
676
- return contents;
677
- }
678
- /* eslint-disable */
679
- static formatPdfExportProperties(pdf) {
680
- let values;
681
- /* eslint-enable */
682
- values = this.getDefinedObj({
683
- pageOrientation: typeof pdf.PageOrientation === 'string' ? pdf.PageOrientation : null,
684
- pageSize: typeof pdf.PageSize === 'string' ? pdf.PageSize : null,
685
- header: !isNullOrUndefined(pdf.Header) ? {
686
- fromTop: pdf.Header.FromTop,
687
- height: pdf.Header.Height,
688
- contents: this.formatPdfHeaderFooter(pdf.Header.Contents)
689
- } : null,
690
- columns: pdf.Columns,
691
- footer: !isNullOrUndefined(pdf.Footer) ? {
692
- fromTop: pdf.Footer.FromBottom,
693
- height: pdf.Footer.Height,
694
- contents: this.formatPdfHeaderFooter(pdf.Footer.Contents)
695
- } : null,
696
- includeHiddenColumn: pdf.IncludeHiddenColumn,
697
- dataSource: pdf.DataSource,
698
- exportType: typeof pdf.ExportType === 'string' ? pdf.ExportType : null,
699
- theme: !isNullOrUndefined(pdf.Theme) ? {
700
- header: pdf.Theme.Header,
701
- record: pdf.Theme.Record,
702
- caption: pdf.Theme.Caption
703
- } : null,
704
- fileName: pdf.FileName,
705
- hierarchyExportMode: typeof pdf.HierarchyExportMode === 'string' ? pdf.HierarchyExportMode : null,
706
- allowHorizontalOverflow: pdf.AllowHorizontalOverflow
707
- });
708
- return values;
709
- }
710
- /* eslint-disable */
711
- static formatExcelStyle(style) {
712
- let prop;
713
- /* eslint-enable */
714
- if (!isNullOrUndefined(style)) {
715
- prop = this.getDefinedObj({
716
- fontColor: style.FontColor,
717
- fontName: style.FontName,
718
- fontSize: style.FontSize,
719
- hAlign: style.HAlign === String ? style.HAlign : null,
720
- vAlign: style.VAlign === String ? style.VAlign : null,
721
- bold: style.Bold,
722
- indent: style.Indent,
723
- italic: style.Italic,
724
- underline: style.Underline,
725
- backColor: style.BackColor,
726
- wrapText: style.WrapText,
727
- borders: style.Borders,
728
- numberFormat: style.NumberFormat,
729
- type: style.Type
730
- });
731
- }
732
- return prop;
733
- }
734
- /* eslint-disable */
735
- static formatExcelCell(cell) {
736
- let cells = [];
737
- if (!isNullOrUndefined(cell)) {
738
- for (let i = 0; i < cell.length; i++) {
739
- this.getDefinedObj({
740
- index: !isNullOrUndefined(cell[i].Index) ? cell[i].Index : null,
741
- colSpan: !isNullOrUndefined(cell[i].ColSpan) ? cell[i].ColSpan : null,
742
- value: !isNullOrUndefined(cell[i].Value) ? cell[i].Value : null,
743
- hyperlink: {
744
- target: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.Target : null,
745
- displayText: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.DisplayText : null
746
- },
747
- styles: this.formatExcelStyle(cell[i].Style),
748
- rowSpan: !isNullOrUndefined(cell[i].RowSpan) ? cell[i].RowSpan : null
749
- });
750
- /* eslint-enable */
751
- }
752
- }
753
- return cells;
754
- }
755
- /* eslint-disable */
756
- static formatExcelHeaderFooter(excel) {
757
- let rows = [];
758
- if (!isNullOrUndefined(excel)) {
759
- for (let i = 0; i < excel.Rows.length; i++) {
760
- let row = excel.Rows[i];
761
- let prop = this.getDefinedObj({
762
- index: !isNullOrUndefined(row.Index) ? row.Index : null,
763
- cells: this.formatExcelCell(row.Cells),
764
- grouping: !isNullOrUndefined(row.Grouping) ? row.Grouping : null
765
- });
766
- rows.push(prop);
767
- }
768
- }
769
- return rows;
770
- }
771
- static formatExcelExportProperties(excel) {
772
- /* eslint-enable */
773
- let prop;
774
- prop = this.getDefinedObj({
775
- dataSource: excel.DataSource,
776
- query: excel.Query,
777
- multipleExport: this.getDefinedObj({
778
- type: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.Type : null,
779
- blankRows: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.BlankRows : null
780
- }),
781
- header: this.getDefinedObj({
782
- headerRows: !isNullOrUndefined(excel.Header) ? excel.Header.HeaderRows : null,
783
- rows: this.formatExcelHeaderFooter(excel.Header)
784
- }),
785
- footer: this.getDefinedObj({
786
- footerRows: !isNullOrUndefined(excel.Footer) ? excel.Footer.FooterRows : null,
787
- rows: this.formatExcelHeaderFooter(excel.Footer)
788
- }),
789
- columns: excel.Columns,
790
- exportType: typeof excel.ExportType === 'string' ? excel.ExportType : undefined,
791
- includeHiddenColumn: excel.IncludeHiddenColumn,
792
- theme: !isNullOrUndefined(excel.Theme) ? {
793
- header: this.formatExcelStyle(excel.Theme.Header),
794
- record: this.formatExcelStyle(excel.Theme.Record),
795
- caption: this.formatExcelStyle(excel.Theme.Caption)
796
- } : undefined,
797
- fileName: excel.FileName,
798
- hierarchyExportMode: typeof excel.HierarchyExportMode === 'string' ? excel.HierarchyExportMode : undefined
799
- });
800
- return prop;
801
- }
802
- /* eslint-disable */
803
590
  static formatFieldList(fieldList) {
804
591
  let keys = Object.keys(fieldList);
805
592
  let fList = {};
@@ -1099,7 +886,8 @@ class PivotEngine {
1099
886
  this.isLastHeaderHasMeasures = true;
1100
887
  this.isEditing = false;
1101
888
  let fields;
1102
- this.globalize = new Internationalization();
889
+ this.globalize = (customProperties && customProperties.globalize) ? customProperties.globalize : new Internationalization();
890
+ this.currencyCode = (customProperties && customProperties.currenyCode) ? customProperties.currenyCode : undefined;
1103
891
  this.localeObj = customProperties ? customProperties.localeObj : undefined;
1104
892
  this.fieldsType = customProperties ? customProperties.fieldsType : {};
1105
893
  this.clonedReport = customProperties ? (customProperties.clonedReport &&
@@ -1113,6 +901,7 @@ class PivotEngine {
1113
901
  this.showRowSubTotals = isNullOrUndefined(dataSource.showRowSubTotals) ? true : dataSource.showRowSubTotals;
1114
902
  this.showColumnSubTotals = isNullOrUndefined(dataSource.showColumnSubTotals) ? true : dataSource.showColumnSubTotals;
1115
903
  this.showGrandTotals = isNullOrUndefined(dataSource.showGrandTotals) ? true : dataSource.showGrandTotals;
904
+ this.grandTotalsPosition = isNullOrUndefined(dataSource.grandTotalsPosition) ? 'Bottom' : dataSource.grandTotalsPosition;
1116
905
  this.showRowGrandTotals = isNullOrUndefined(dataSource.showRowGrandTotals) ? true : dataSource.showRowGrandTotals;
1117
906
  this.showColumnGrandTotals = isNullOrUndefined(dataSource.showColumnGrandTotals) ? true : dataSource.showColumnGrandTotals;
1118
907
  this.allowValueFilter = dataSource.allowValueFilter;
@@ -1226,6 +1015,7 @@ class PivotEngine {
1226
1015
  this.showRowSubTotals = isNullOrUndefined(dataSource.showRowSubTotals) ? true : dataSource.showRowSubTotals;
1227
1016
  this.showColumnSubTotals = isNullOrUndefined(dataSource.showColumnSubTotals) ? true : dataSource.showColumnSubTotals;
1228
1017
  this.showGrandTotals = isNullOrUndefined(dataSource.showGrandTotals) ? true : dataSource.showGrandTotals;
1018
+ this.grandTotalsPosition = isNullOrUndefined(dataSource.grandTotalsPosition) ? 'Bottom' : dataSource.grandTotalsPosition;
1229
1019
  this.showRowGrandTotals = isNullOrUndefined(dataSource.showRowGrandTotals) ? true : dataSource.showRowGrandTotals;
1230
1020
  this.showColumnGrandTotals = isNullOrUndefined(dataSource.showColumnGrandTotals) ? true : dataSource.showColumnGrandTotals;
1231
1021
  this.allowValueFilter = dataSource.allowValueFilter;
@@ -1524,6 +1314,7 @@ class PivotEngine {
1524
1314
  }
1525
1315
  if (!PivotUtil.getFieldByName(groupKeys[gCnt], dataFields)) {
1526
1316
  groupField = groupFields[groupKeys[gCnt]];
1317
+ caption = (caption.indexOf(' (') !== -1 && caption.indexOf(')') !== -1) ? caption.slice(caption.indexOf('(') + 1, caption.length - 1) : caption;
1527
1318
  let newField = {
1528
1319
  name: groupKeys[gCnt],
1529
1320
  caption: (this.localeObj ? this.localeObj.getConstant(groupField) : groupField) + ' (' + caption + ')',
@@ -1551,6 +1342,8 @@ class PivotEngine {
1551
1342
  }
1552
1343
  }
1553
1344
  gCnt = Object.keys(groupKeys).length;
1345
+ let field = this.getMappingField(fieldName, this.clonedReport ? this.clonedReport.fieldMapping : this.fieldMapping);
1346
+ let caption = field.caption ? field.caption : fieldName;
1554
1347
  while (gCnt--) {
1555
1348
  groupField = groupFields[groupKeys[gCnt]];
1556
1349
  for (let i = 0, len = this.formats.length; i < len; i++) {
@@ -1569,6 +1362,33 @@ class PivotEngine {
1569
1362
  };
1570
1363
  this.formats.push(formatSettings);
1571
1364
  }
1365
+ if (!isDataSource) {
1366
+ let mappingField = this.getMappingField(groupKeys[gCnt], this.fieldMapping);
1367
+ if (groupKeys[gCnt] !== fieldName && isNullOrUndefined(mappingField.name)) {
1368
+ let newField = {
1369
+ name: groupKeys[gCnt],
1370
+ caption: (this.localeObj ? this.localeObj.getConstant(groupField) : groupField) + ' (' + caption + ')'
1371
+ };
1372
+ this.fieldMapping.push(newField);
1373
+ }
1374
+ else if (groupKeys[gCnt] !== fieldName) {
1375
+ mappingField.caption = (this.localeObj ? this.localeObj.getConstant(groupField) : groupField) + ' (' + caption + ')';
1376
+ }
1377
+ }
1378
+ }
1379
+ if (!isDataSource) {
1380
+ let mappingField = this.getMappingField(fieldName, this.fieldMapping);
1381
+ groupField = groupFields[fieldName];
1382
+ if (groupKeys[gCnt] !== fieldName && isNullOrUndefined(mappingField.name)) {
1383
+ let newField = {
1384
+ name: fieldName,
1385
+ caption: (this.localeObj ? this.localeObj.getConstant(groupField) : groupField) + ' (' + caption + ')'
1386
+ };
1387
+ this.fieldMapping.push(newField);
1388
+ }
1389
+ else {
1390
+ mappingField.caption = (this.localeObj ? this.localeObj.getConstant(groupField) : groupField) + ' (' + caption + ')';
1391
+ }
1572
1392
  }
1573
1393
  }
1574
1394
  else if (group.type === 'Number' && group.rangeInterval) {
@@ -1807,7 +1627,7 @@ class PivotEngine {
1807
1627
  this.fieldList = this.savedFieldList;
1808
1628
  while (len--) { /** while is used for better performance than for */
1809
1629
  let key = keys[len];
1810
- let field = this.getMappingField(key);
1630
+ let field = this.getMappingField(key, this.fieldMapping);
1811
1631
  if (this.fieldList[key]) {
1812
1632
  this.fieldList[key].isSelected = false;
1813
1633
  this.fieldList[key].index = len;
@@ -1886,7 +1706,7 @@ class PivotEngine {
1886
1706
  this.fieldList = {};
1887
1707
  while (len--) { /** while is used for better performance than for */
1888
1708
  let key = keys[len];
1889
- let field = this.getMappingField(key);
1709
+ let field = this.getMappingField(key, this.fieldMapping);
1890
1710
  type = (field && 'dataType' in field && field.dataType && dataTypes.indexOf(field.dataType.toLowerCase()) > -1) ?
1891
1711
  field.dataType.toLowerCase() : PivotUtil.getType(fields[this.fieldKeys[key]]);
1892
1712
  this.fieldList[key] = {
@@ -1930,12 +1750,12 @@ class PivotEngine {
1930
1750
  }
1931
1751
  this.updateTreeViewData(dataFields);
1932
1752
  }
1933
- getMappingField(key) {
1753
+ getMappingField(key, fieldMapping) {
1934
1754
  let field = {};
1935
- if (this.fieldMapping.length > 0) {
1936
- for (let index = 0, cnt = this.fieldMapping.length; index < cnt; index++) {
1937
- if (this.fieldMapping[index].name === key) {
1938
- field = this.fieldMapping[index];
1755
+ if (fieldMapping.length > 0) {
1756
+ for (let index = 0, cnt = fieldMapping.length; index < cnt; index++) {
1757
+ if (fieldMapping[index].name === key) {
1758
+ field = fieldMapping[index];
1939
1759
  break;
1940
1760
  }
1941
1761
  }
@@ -2496,8 +2316,8 @@ class PivotEngine {
2496
2316
  field.filter = filter;
2497
2317
  field.filterType = type;
2498
2318
  field.isExcelFilter = isLabelFilter;
2499
- let members = (this.formatFields[name] &&
2500
- (['date', 'dateTime', 'time'].indexOf(this.formatFields[name].type) > -1)) ?
2319
+ let members = ((this.formatFields[name] &&
2320
+ (['date', 'dateTime', 'time'].indexOf(this.formatFields[name].type) > -1)) || (name in this.groupingFields)) ?
2501
2321
  field.formattedMembers : field.members;
2502
2322
  let allowFil = isInclude;
2503
2323
  let final = {};
@@ -2544,7 +2364,7 @@ class PivotEngine {
2544
2364
  }
2545
2365
  applyValueFiltering(rowData, level, rows, columns, valueFilter, rowFilterData, type) {
2546
2366
  this.isValueFiltered = false;
2547
- let allMember = extend({}, (type === 'row' && this.rowGrandTotal ? this.rowGrandTotal : type === 'column' && this.columnGrandTotal ? this.columnGrandTotal : rows[rows.length - 1]), null, true);
2367
+ let allMember = extend({}, (type === 'row' && this.rowGrandTotal ? this.rowGrandTotal : type === 'column' && this.columnGrandTotal ? this.columnGrandTotal : (!(this.grandTotalsPosition === 'Top') ? rows[rows.length - 1] : rows[0])), null, true);
2548
2368
  this.getFilteredData(rows, columns, valueFilter, rowFilterData, level, rowData.name, allMember, type);
2549
2369
  if (this.isValueFiltered) {
2550
2370
  if ((type === 'row' && this.rowGrandTotal === null) || (type === 'column' && this.columnGrandTotal === null)) {
@@ -2879,14 +2699,14 @@ class PivotEngine {
2879
2699
  for (let i = 0; i < rLen; i++) {
2880
2700
  if (filterElement.name === rows[i].name && valueFields[filterElement.measure] && !isAvail) {
2881
2701
  isAvail = true;
2882
- rowFilteredData = this.applyValueFiltering(rows[i], i, rowHeaders, (this.columnGrandTotal ? this.columnGrandTotal : columnHeaders[columnHeaders.length - 1]), valueFilters, this.valueFilteredData, 'row');
2702
+ rowFilteredData = this.applyValueFiltering(rows[i], i, rowHeaders, (this.columnGrandTotal ? this.columnGrandTotal : (this.grandTotalsPosition === 'Top' && this.showGrandTotals) ? columnHeaders[0] : columnHeaders[columnHeaders.length - 1]), valueFilters, this.valueFilteredData, 'row');
2883
2703
  break;
2884
2704
  }
2885
2705
  }
2886
2706
  for (let j = 0; j < cLen; j++) {
2887
2707
  if (filterElement.name === columns[j].name && valueFields[filterElement.measure] && !isAvail) {
2888
2708
  isAvail = true;
2889
- columnFilteredData = this.applyValueFiltering(columns[j], j, columnHeaders, (this.rowGrandTotal ? this.rowGrandTotal : rowHeaders[rowHeaders.length - 1]), valueFilters, this.valueFilteredData, 'column');
2709
+ columnFilteredData = this.applyValueFiltering(columns[j], j, columnHeaders, (this.rowGrandTotal ? this.rowGrandTotal : (this.grandTotalsPosition === 'Top' && this.showGrandTotals) ? rowHeaders[0] : rowHeaders[rowHeaders.length - 1]), valueFilters, this.valueFilteredData, 'column');
2890
2710
  break;
2891
2711
  }
2892
2712
  }
@@ -3191,7 +3011,7 @@ class PivotEngine {
3191
3011
  }
3192
3012
  let engine = this;
3193
3013
  return headers.filter((item) => {
3194
- return item.members.length > 0 ? item.members.length > 0 : engine.matchIndexes(item.indexObject, filterObjects);
3014
+ return (item.members.length > 0 || item.type === 'grand sum') ? true : engine.matchIndexes(item.indexObject, filterObjects);
3195
3015
  });
3196
3016
  }
3197
3017
  matchIndexes(index, filterObjects) {
@@ -3264,6 +3084,14 @@ class PivotEngine {
3264
3084
  }
3265
3085
  /* eslint-enable */
3266
3086
  rawHeaders = this.getSortedHeaders(rawHeaders.concat(excessHeaders), this.fieldList[headersInfo.fields[0].name].sort).concat(grandHeader);
3087
+ if (headersInfo.axis === 'row') {
3088
+ this.cMembers = this.getIndexedHeaders(this.columns, this.data, 0, this.filterMembers, 'column', '');
3089
+ this.insertAllMember(this.cMembers, this.filterMembers, '', 'column');
3090
+ }
3091
+ else {
3092
+ this.rMembers = this.getIndexedHeaders(this.rows, this.data, 0, this.filterMembers, 'row', '');
3093
+ this.insertAllMember(this.rMembers, this.filterMembers, '', 'row');
3094
+ }
3267
3095
  }
3268
3096
  if (headersInfo.axis === 'row') {
3269
3097
  this.rowCount = 0;
@@ -3408,8 +3236,8 @@ class PivotEngine {
3408
3236
  }
3409
3237
  }
3410
3238
  if (stringValue.length > 0) {
3411
- stringValue = childrens.sort === 'Ascending' ? (stringValue.sort((a, b) => (a.actualText > b.actualText) ? 1 : ((b.actualText > a.actualText) ? -1 : 0))) :
3412
- childrens.sort === 'Descending' ? (stringValue.sort((a, b) => (a.actualText < b.actualText) ? 1 : ((b.actualText < a.actualText) ? -1 : 0))) : stringValue;
3239
+ stringValue = childrens.sort === 'Ascending' ? (stringValue.sort((a, b) => (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : ((a.actualText > b.actualText) ? 1 : ((b.actualText > a.actualText) ? -1 : 0)))) :
3240
+ childrens.sort === 'Descending' ? (stringValue.sort((a, b) => (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : ((a.actualText < b.actualText) ? 1 : ((b.actualText < a.actualText) ? -1 : 0)))) : stringValue;
3413
3241
  }
3414
3242
  if (alphaNumbervalue.length > 0) {
3415
3243
  alphaNumbervalue = childrens.sort === 'Ascending' ?
@@ -3422,9 +3250,9 @@ class PivotEngine {
3422
3250
  }
3423
3251
  else {
3424
3252
  return sortOrder === 'Ascending' ?
3425
- (headers.sort(function (a, b) { return (a.actualText > b.actualText) ? 1 : ((b.actualText > a.actualText) ? -1 : 0); })) :
3253
+ (headers.sort(function (a, b) { return (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : ((a.actualText > b.actualText) ? 1 : ((b.actualText > a.actualText) ? -1 : 0)); })) :
3426
3254
  sortOrder === 'Descending' ?
3427
- (headers.sort(function (a, b) { return (a.actualText < b.actualText) ? 1 : ((b.actualText < a.actualText) ? -1 : 0); })) :
3255
+ (headers.sort(function (a, b) { return (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : ((a.actualText < b.actualText) ? 1 : ((b.actualText < a.actualText) ? -1 : 0)); })) :
3428
3256
  headers;
3429
3257
  }
3430
3258
  }
@@ -3444,7 +3272,8 @@ class PivotEngine {
3444
3272
  this.valueSortHeaderText = undefined;
3445
3273
  if (this.enableValueSorting && this.valueSortSettings.headerText && !this.valueSortHeaderText &&
3446
3274
  this.valueSortSettings.headerText !== '' && this.values.length > 0) {
3447
- let textArray = this.valueSortSettings.headerText.split(this.valueSortSettings.headerDelimiter);
3275
+ this.valueSortHeaderText = this.valueSortSettings.headerText;
3276
+ let textArray = this.valueSortHeaderText.split(this.valueSortSettings.headerDelimiter);
3448
3277
  for (let field of this.values) {
3449
3278
  let name = field.caption ? field.caption : field.name;
3450
3279
  let valueIndex = textArray.indexOf(name);
@@ -4086,6 +3915,7 @@ class PivotEngine {
4086
3915
  let summCell = headers[headers.length - 1];
4087
3916
  if (summCell && summCell.type === 'grand sum') {
4088
3917
  summCell.index = this.filterMembers;
3918
+ summCell.indexObject = {};
4089
3919
  /* eslint-disable */
4090
3920
  for (let ln = 0, lt = this.filterMembers.length; ln < lt; ln++) {
4091
3921
  summCell.indexObject[this.filterMembers[ln]] = this.filterMembers[ln];
@@ -4227,7 +4057,7 @@ class PivotEngine {
4227
4057
  insertAllMember(set, filter, customText, axis) {
4228
4058
  let len = set.length;
4229
4059
  customText = ' Total';
4230
- set[len] = {
4060
+ let grandTotalSet = {
4231
4061
  hasChild: false,
4232
4062
  index: filter,
4233
4063
  level: 0,
@@ -4241,13 +4071,14 @@ class PivotEngine {
4241
4071
  type: 'grand sum',
4242
4072
  valueSort: {}
4243
4073
  };
4244
- set[len].valueSort[set[len].formattedText] = 1;
4245
- set[len].valueSort.levelName = set[len].formattedText;
4246
- set[len].valueSort[set[len].actualText] = 1;
4247
- set[len].valueSort.uniqueName = set[len].actualText;
4074
+ grandTotalSet.valueSort[grandTotalSet.formattedText] = 1;
4075
+ grandTotalSet.valueSort.levelName = grandTotalSet.formattedText;
4076
+ grandTotalSet.valueSort[grandTotalSet.actualText] = 1;
4077
+ grandTotalSet.valueSort.uniqueName = grandTotalSet.actualText;
4248
4078
  for (let ln = 0, lt = filter.length; ln < lt; ln++) {
4249
- set[len].indexObject[filter[ln]] = filter[ln];
4079
+ grandTotalSet.indexObject[filter[ln]] = filter[ln];
4250
4080
  }
4081
+ (this.dataSourceSettings.grandTotalsPosition === 'Top' && this.dataSourceSettings.showGrandTotals) ? set.unshift(grandTotalSet) : set.push(grandTotalSet);
4251
4082
  // if (axis === 'row') {
4252
4083
  // this.rowCount += this.rowValuesLength;
4253
4084
  // } else {
@@ -4266,10 +4097,11 @@ class PivotEngine {
4266
4097
  row.colIndex = 0;
4267
4098
  row.rowIndex = tnum;
4268
4099
  let isRowFieldsAvail = false;
4100
+ let delimiter = this.dataSourceSettings.valueSortSettings.headerDelimiter;
4269
4101
  if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && this.dataSourceSettings.values.length > 1) {
4270
4102
  this.rowIndex = (isNullOrUndefined(this.rowIndex) && !isLeastNode && this.dataSourceSettings.rows.length === 0) ? row.index : this.rowIndex;
4271
- isRowFieldsAvail = (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total.') !== 0);
4272
- if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total.') === 0) {
4103
+ isRowFieldsAvail = (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName && row.valueSort.levelName.toString().indexOf('Grand Total' + delimiter) !== 0);
4104
+ if (this.valueAxis && this.dataSourceSettings.rows.length === 0 && row.valueSort.levelName.toString().indexOf('Grand Total' + delimiter) === 0) {
4273
4105
  row.index = this.rowIndex;
4274
4106
  }
4275
4107
  }
@@ -4294,7 +4126,7 @@ class PivotEngine {
4294
4126
  for (let cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
4295
4127
  if (!isValueIndexFound) {
4296
4128
  for (vln = 0; vln < vlt; vln++) {
4297
- if (row.valueSort.uniqueName && row.valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(this.values[vln].name) > -1) {
4129
+ if (row.valueSort.uniqueName && row.valueSort.uniqueName.toString().indexOf(this.values[vln].name) > -1) {
4298
4130
  isValueIndexFound = true;
4299
4131
  isValueCellUpdated = true;
4300
4132
  break;
@@ -4329,7 +4161,7 @@ class PivotEngine {
4329
4161
  for (let cln = 0, dln = 1, clt = columns.length; cln < clt; ++cln) {
4330
4162
  for (let vln = 0; vln < vlt; vln++) {
4331
4163
  if (!this.valueAxis && !this.isLastHeaderHasMeasures) {
4332
- if (columns[cln].valueSort.uniqueName && columns[cln].valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(this.values[vln].name) > -1) {
4164
+ if (columns[cln].valueSort.uniqueName && columns[cln].valueSort.uniqueName.toString().indexOf(this.values[vln].name) > -1) {
4333
4165
  this.updateRowData(rows, columns, tnum, data, vln, rln, cln, dln, actCnt, rTotal, cTotal);
4334
4166
  dln = data[tnum].length;
4335
4167
  }
@@ -5249,6 +5081,10 @@ class PivotEngine {
5249
5081
  this.updateValueMembers(this.measureIndex === 0 && axis.length > 1, null, null, columnHeaders, axis.slice(0, axis.length - 1), vcnt, 0);
5250
5082
  this.updateValueMembers(false, null, null, columnHeaders, axis.slice(axis.length - 1, axis.length), vcnt, -1);
5251
5083
  }
5084
+ else if (this.grandTotalsPosition === 'Top' && this.showGrandTotals && this.measureIndex === 0) {
5085
+ this.updateValueMembers(false, null, null, columnHeaders, axis.slice(0, 1), vcnt, -1);
5086
+ this.updateValueMembers(this.measureIndex === 0 && axis.length > 1, null, null, columnHeaders, axis.slice(1, axis.length), vcnt, 0);
5087
+ }
5252
5088
  else {
5253
5089
  let hasColumnTotal = columns.length === 0 && axis.length === 1 && axis[0].type == 'grand sum';
5254
5090
  this.updateValueMembers(!hasColumnTotal && this.measureIndex === 0, null, null, columnHeaders, axis, vcnt, hasColumnTotal ? -1 : 0);
@@ -5288,6 +5124,10 @@ class PivotEngine {
5288
5124
  this.updateValueMembers(this.measureIndex == 0 && this.rMembers.length > 1, null, null, rowAxis, this.rMembers.slice(0, this.rMembers.length - 1), this.values.length, 0);
5289
5125
  this.updateValueMembers(false, null, null, rowAxis, this.rMembers.slice(this.rMembers.length - 1, this.rMembers.length), this.values.length, -1);
5290
5126
  }
5127
+ else if (this.grandTotalsPosition === 'Top' && this.showGrandTotals && this.measureIndex === 0) {
5128
+ this.updateValueMembers(false, null, null, rowAxis, this.rMembers.slice(0, 1), this.values.length, -1);
5129
+ this.updateValueMembers(this.measureIndex == 0 && this.rMembers.length > 1, null, null, rowAxis, this.rMembers.slice(1, this.rMembers.length), this.values.length, 0);
5130
+ }
5291
5131
  else {
5292
5132
  let hasRowTotal = rows.length === 0 && this.rMembers.length === 1 && this.rMembers[0].type == 'grand sum';
5293
5133
  this.updateValueMembers(!hasRowTotal && this.measureIndex == 0, null, null, rowAxis, this.rMembers, this.values.length, hasRowTotal ? -1 : 0);
@@ -5891,6 +5731,12 @@ const fieldDragStart = 'fieldDragStart';
5891
5731
  const chartPointClick = 'chartPointClick';
5892
5732
  /** @hidden */
5893
5733
  const beforeServiceInvoke = 'beforeServiceInvoke';
5734
+ /** @hidden */
5735
+ const actionBegin = 'actionBegin';
5736
+ /** @hidden */
5737
+ const actionComplete = 'actionComplete';
5738
+ /** @hidden */
5739
+ const actionFailure = 'actionFailure';
5894
5740
  /**
5895
5741
  * Specifies pivot internal events
5896
5742
  */
@@ -5920,6 +5766,186 @@ const initToolbar = 'init-toolbar';
5920
5766
  const initFormatting = 'init-formatting';
5921
5767
  /** @hidden */
5922
5768
  const initGrouping = 'init-grouping';
5769
+ /**
5770
+ * Specifies action names of actionBegin events
5771
+ */
5772
+ /** @hidden */
5773
+ const sortValue = 'Sort value';
5774
+ /** @hidden */
5775
+ const drillUp = 'Drill up';
5776
+ /** @hidden */
5777
+ const drillDown = 'Drill down';
5778
+ /** @hidden */
5779
+ const addNewReport = 'Add new report';
5780
+ /** @hidden */
5781
+ const saveCurrentReport = 'Save current report';
5782
+ /** @hidden */
5783
+ const saveAsCurrentReport = 'Save as current report';
5784
+ /** @hidden */
5785
+ const renameCurrentReport = 'Rename current report';
5786
+ /** @hidden */
5787
+ const removeCurrentReport = 'Remove current report';
5788
+ /** @hidden */
5789
+ const loadReports = 'Load report';
5790
+ /** @hidden */
5791
+ const openConditionalFormatting = 'Open conditional formatting dialog';
5792
+ /** @hidden */
5793
+ const openNumberFormatting = 'Open number formatting dialog';
5794
+ /** @hidden */
5795
+ const MdxQuery = 'MdxQuery';
5796
+ /** @hidden */
5797
+ const showFieldList = 'Open field list';
5798
+ /** @hidden */
5799
+ const tableView = 'Show table view';
5800
+ /** @hidden */
5801
+ const chartView = 'Show chart view';
5802
+ /** @hidden */
5803
+ const multipleAxis = 'Multiple Axis';
5804
+ /** @hidden */
5805
+ const showLegend = 'Show legend';
5806
+ /** @hidden */
5807
+ const pdfExport = 'PDF export';
5808
+ /** @hidden */
5809
+ const pngExport = 'PNG export';
5810
+ /** @hidden */
5811
+ const excelExport = 'Excel export';
5812
+ /** @hidden */
5813
+ const csvExport = 'CSV export';
5814
+ /** @hidden */
5815
+ const jpegExport = 'JPEG export';
5816
+ /** @hidden */
5817
+ const svgExport = 'SVG export';
5818
+ /** @hidden */
5819
+ const hideSubTotals = 'Hide sub-totals';
5820
+ /** @hidden */
5821
+ const subTotalsRow = 'Show row sub-totals';
5822
+ /** @hidden */
5823
+ const subTotalsColumn = 'Show column sub-totals';
5824
+ /** @hidden */
5825
+ const showSubTotals = 'Show sub-totals';
5826
+ /** @hidden */
5827
+ const hideGrandTotals = 'Hide grand totals';
5828
+ /** @hidden */
5829
+ const grandTotalsRow = 'Show row grand totals';
5830
+ /** @hidden */
5831
+ const grandTotalsColumn = 'Show column grand totals';
5832
+ /** @hidden */
5833
+ const showGrandTotals = 'Show grand totals';
5834
+ /** @hidden */
5835
+ const numberFormattingMenu = 'Number Formatting menu';
5836
+ /** @hidden */
5837
+ const conditionalFormattingMenu = 'Conditional Formatting menu';
5838
+ /** @hidden */
5839
+ const reportChange = 'Report change';
5840
+ /** @hidden */
5841
+ const sortFieldTree = 'Sort field tree';
5842
+ /** @hidden */
5843
+ const editCalculatedField = 'Edit calculated field';
5844
+ /** @hidden */
5845
+ const sortField = 'Sort field';
5846
+ /** @hidden */
5847
+ const filterField = 'Filter field';
5848
+ /** @hidden */
5849
+ const removeField = 'Remove field';
5850
+ /** @hidden */
5851
+ const openCalculatedField = 'Open calculated field dialog';
5852
+ /** @hidden */
5853
+ const editRecord = 'Edit record';
5854
+ /** @hidden */
5855
+ const saveEditedRecords = 'Save edited records';
5856
+ /** @hidden */
5857
+ const addNewRecord = 'Add new record';
5858
+ /** @hidden */
5859
+ const removeRecord = 'Remove record';
5860
+ /** @hidden */
5861
+ const aggregateField = 'Aggregate field';
5862
+ /** @hidden */
5863
+ const contextMenuCalculatedField = 'CalculatedField Context menu';
5864
+ /** @hidden */
5865
+ const windowResize = 'Window resize';
5866
+ /**
5867
+ * Specifies action names of actionComplete events
5868
+ */
5869
+ /** @hidden */
5870
+ const calculatedFieldApplied = 'Calculated field applied';
5871
+ /** @hidden */
5872
+ const editedRecordsSaved = 'Edited records saved';
5873
+ /** @hidden */
5874
+ const newRecordAdded = 'New record added';
5875
+ /** @hidden */
5876
+ const recordRemoved = 'Record removed';
5877
+ /** @hidden */
5878
+ const closeFieldlist = 'Field list closed';
5879
+ /** @hidden */
5880
+ const fieldTreeSorted = 'Field tree sorted';
5881
+ /** @hidden */
5882
+ const reportSaved = 'Report saved';
5883
+ /** @hidden */
5884
+ const newReportAdded = 'New report added';
5885
+ /** @hidden */
5886
+ const reportReSaved = 'Report re-saved';
5887
+ /** @hidden */
5888
+ const reportRenamed = 'Report renamed';
5889
+ /** @hidden */
5890
+ const reportRemoved = 'Report removed';
5891
+ /** @hidden */
5892
+ const excelExported = 'Excel exported';
5893
+ /** @hidden */
5894
+ const csvExported = 'CSV exported';
5895
+ /** @hidden */
5896
+ const pdfExported = 'PDF exported';
5897
+ /** @hidden */
5898
+ const pngExported = 'PNG exported';
5899
+ /** @hidden */
5900
+ const jpegExported = 'JPEG exported';
5901
+ /** @hidden */
5902
+ const svgExported = 'SVG exported';
5903
+ /** @hidden */
5904
+ const conditionallyFormatted = 'Conditional formatting applied';
5905
+ /** @hidden */
5906
+ const numberFormatted = 'Number formatting applied';
5907
+ /** @hidden */
5908
+ const tableViewed = 'Table view shown';
5909
+ /** @hidden */
5910
+ const chartViewed = 'Chart view shown';
5911
+ /** @hidden */
5912
+ const subTotalsHidden = 'Sub-totals hidden';
5913
+ /** @hidden */
5914
+ const subTotalsRowShown = 'Row sub-totals shown';
5915
+ /** @hidden */
5916
+ const subTotalsColumnShown = 'Column sub-totals shown';
5917
+ /** @hidden */
5918
+ const subTotalsShown = 'Sub-totals shown';
5919
+ /** @hidden */
5920
+ const grandTotalsHidden = 'Grand totals hidden';
5921
+ /** @hidden */
5922
+ const grandTotalsRowShown = 'Row grand totals shown';
5923
+ /** @hidden */
5924
+ const grandTotalsColumnShown = 'Column grand totals shown';
5925
+ /** @hidden */
5926
+ const grandTotalsShown = 'Grand totals shown';
5927
+ /** @hidden */
5928
+ const valueSorted = 'Value sorted';
5929
+ /** @hidden */
5930
+ const calculatedFieldEdited = 'Calculated field edited';
5931
+ /** @hidden */
5932
+ const fieldSorted = 'Field sorted';
5933
+ /** @hidden */
5934
+ const fieldFiltered = 'Field filtered';
5935
+ /** @hidden */
5936
+ const fieldRemoved = 'Field removed';
5937
+ /** @hidden */
5938
+ const fieldAggregated = 'Field aggregated';
5939
+ /** @hidden */
5940
+ const recordEdited = 'Record edited';
5941
+ /** @hidden */
5942
+ const reportChanged = 'Report changed';
5943
+ /** @hidden */
5944
+ const windowResized = 'Window resized';
5945
+ /** @hidden */
5946
+ const recordUpdated = 'Records updated';
5947
+ /** @hidden */
5948
+ const drillThroughClosed = 'Drill-through closed';
5923
5949
 
5924
5950
  /**
5925
5951
  * CSS Constants
@@ -6593,6 +6619,8 @@ const PIVOTCHART_TYPE_DIALOG = 'e-pivotchart-type-dialog';
6593
6619
  const FORMAT_FONT_COLOR_PICKER = 'e-format-font-color-picker';
6594
6620
  /** @hidden */
6595
6621
  const GROUP_PIVOT_ROW = 'e-group-pivot-rows';
6622
+ /** @hidden */
6623
+ const TOOLBAR_MENU = 'e-pivot-toolbar-menu';
6596
6624
 
6597
6625
  /**
6598
6626
  * `AggregateMenu` module to create aggregate type popup.
@@ -6621,28 +6649,39 @@ class AggregateMenu {
6621
6649
  }
6622
6650
  openContextMenu(args) {
6623
6651
  let fieldName = args.target.parentElement.id;
6652
+ let fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
6624
6653
  this.buttonElement = args.target.parentElement;
6625
6654
  let isStringField = this.parent.engineModule.fieldList[fieldName].type !== 'number' ? 1 : 0;
6626
6655
  this.summaryTypes = [...this.getMenuItem(isStringField)];
6656
+ this.parent.actionObj.actionName = aggregateField;
6657
+ this.parent.actionObj.fieldInfo = fieldInfo.fieldItem;
6658
+ if (this.parent.actionBeginMethod()) {
6659
+ return;
6660
+ }
6627
6661
  let eventArgs = {
6628
6662
  cancel: false, fieldName: fieldName, aggregateTypes: this.summaryTypes, displayMenuCount: 7
6629
6663
  };
6630
6664
  let control = this.parent.getModuleName() === 'pivotfieldlist' && this.parent.isPopupView ?
6631
6665
  this.parent.pivotGridModule : this.parent;
6632
- control.trigger(aggregateMenuOpen, eventArgs, (observedArgs) => {
6633
- if (!observedArgs.cancel) {
6634
- this.summaryTypes = observedArgs.aggregateTypes;
6635
- this.createContextMenu(isStringField, observedArgs.displayMenuCount);
6636
- this.currentMenu = args.target;
6637
- let pos = this.currentMenu.getBoundingClientRect();
6638
- if (this.parent.enableRtl) {
6639
- this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left - 105);
6640
- }
6641
- else {
6642
- this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left);
6666
+ try {
6667
+ control.trigger(aggregateMenuOpen, eventArgs, (observedArgs) => {
6668
+ if (!observedArgs.cancel) {
6669
+ this.summaryTypes = observedArgs.aggregateTypes;
6670
+ this.createContextMenu(isStringField, observedArgs.displayMenuCount);
6671
+ this.currentMenu = args.target;
6672
+ let pos = this.currentMenu.getBoundingClientRect();
6673
+ if (this.parent.enableRtl) {
6674
+ this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left - 105);
6675
+ }
6676
+ else {
6677
+ this.menuInfo[isStringField].open(pos.top + (window.scrollY || document.documentElement.scrollTop), pos.left);
6678
+ }
6643
6679
  }
6644
- }
6645
- });
6680
+ });
6681
+ }
6682
+ catch (execption) {
6683
+ this.parent.actionFailureMethod(execption);
6684
+ }
6646
6685
  }
6647
6686
  createContextMenu(isStringField, displayMenuCount) {
6648
6687
  let menuItems = [];
@@ -6916,31 +6955,42 @@ class AggregateMenu {
6916
6955
  selectOptionInContextMenu(menu) {
6917
6956
  if (menu.item.text !== null) {
6918
6957
  let buttonElement = this.currentMenu.parentElement;
6919
- let type = menu.item.id.split('_').pop();
6920
- if (type === 'MoreOption' || type === 'PercentageOfDifferenceFrom'
6921
- || type === 'PercentageOfParentTotal' || type === 'DifferenceFrom') {
6922
- this.createValueSettingsDialog(buttonElement, this.parentElement, type);
6958
+ let fieldInfo = PivotUtil.getFieldInfo((buttonElement ? buttonElement.id : ''), this.parent);
6959
+ this.parent.actionObj.actionName = aggregateField;
6960
+ this.parent.actionObj.fieldInfo = fieldInfo.fieldItem;
6961
+ if (this.parent.actionBeginMethod()) {
6962
+ return;
6923
6963
  }
6924
- else {
6925
- let field = buttonElement.getAttribute('data-uid');
6926
- let valuefields = this.parent.dataSourceSettings.values;
6927
- let contentElement = buttonElement.querySelector('.e-content');
6928
- let captionName = menu.item.text + ' ' + this.parent.localeObj.getConstant('of') + ' ' +
6929
- this.parent.engineModule.fieldList[field].caption;
6930
- contentElement.innerHTML = captionName;
6931
- contentElement.setAttribute('title', captionName);
6932
- buttonElement.setAttribute('data-type', type);
6933
- for (let vCnt = 0; vCnt < this.parent.dataSourceSettings.values.length; vCnt++) {
6934
- if (this.parent.dataSourceSettings.values[vCnt].name === field) {
6935
- let dataSourceItem = extend({}, valuefields[vCnt].properties ?
6936
- valuefields[vCnt].properties : valuefields[vCnt], null, true);
6937
- dataSourceItem.type = type;
6938
- this.parent.engineModule.fieldList[field].aggregateType = type;
6939
- valuefields.splice(vCnt, 1, dataSourceItem);
6940
- this.parent.lastAggregationInfo = dataSourceItem;
6964
+ let type = menu.item.id.split('_').pop();
6965
+ try {
6966
+ if (type === 'MoreOption' || type === 'PercentageOfDifferenceFrom'
6967
+ || type === 'PercentageOfParentTotal' || type === 'DifferenceFrom') {
6968
+ this.createValueSettingsDialog(buttonElement, this.parentElement, type);
6969
+ }
6970
+ else {
6971
+ let field = buttonElement.getAttribute('data-uid');
6972
+ let valuefields = this.parent.dataSourceSettings.values;
6973
+ let contentElement = buttonElement.querySelector('.e-content');
6974
+ let captionName = menu.item.text + ' ' + this.parent.localeObj.getConstant('of') + ' ' +
6975
+ this.parent.engineModule.fieldList[field].caption;
6976
+ contentElement.innerHTML = captionName;
6977
+ contentElement.setAttribute('title', captionName);
6978
+ buttonElement.setAttribute('data-type', type);
6979
+ for (let vCnt = 0; vCnt < this.parent.dataSourceSettings.values.length; vCnt++) {
6980
+ if (this.parent.dataSourceSettings.values[vCnt].name === field) {
6981
+ let dataSourceItem = extend({}, valuefields[vCnt].properties ?
6982
+ valuefields[vCnt].properties : valuefields[vCnt], null, true);
6983
+ dataSourceItem.type = type;
6984
+ this.parent.engineModule.fieldList[field].aggregateType = type;
6985
+ valuefields.splice(vCnt, 1, dataSourceItem);
6986
+ this.parent.lastAggregationInfo = dataSourceItem;
6987
+ }
6941
6988
  }
6989
+ this.updateDataSource();
6942
6990
  }
6943
- this.updateDataSource();
6991
+ }
6992
+ catch (execption) {
6993
+ this.parent.actionFailureMethod(execption);
6944
6994
  }
6945
6995
  }
6946
6996
  }
@@ -7056,13 +7106,16 @@ class Render {
7056
7106
  this.resColWidth = (this.parent.showGroupingBar && this.parent.groupingBarModule) ? (this.parent.isAdaptive ? 180 : 250) :
7057
7107
  (this.parent.isAdaptive ? 140 : 200);
7058
7108
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
7059
- this.gridSettings = parent.gridSettings;
7109
+ this.gridSettings = this.parent.gridSettings;
7060
7110
  this.formatList = this.getFormatList();
7061
7111
  this.aggMenu = new AggregateMenu(this.parent);
7062
7112
  }
7063
7113
  /* eslint-disable-next-line */
7064
7114
  /** @hidden */
7065
- render() {
7115
+ render(refreshRequired) {
7116
+ if (refreshRequired) {
7117
+ this.initProperties();
7118
+ }
7066
7119
  this.resColWidth = (this.parent.showGroupingBar && this.parent.groupingBarModule) ? (this.parent.isAdaptive ? 180 : 250) :
7067
7120
  (this.parent.isAdaptive ? 140 : 200);
7068
7121
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
@@ -7126,6 +7179,30 @@ class Render {
7126
7179
  }
7127
7180
  this.parent.grid.on(headerRefreshed, this.refreshHeader, this);
7128
7181
  }
7182
+ initProperties() {
7183
+ this.rowStartPos = undefined;
7184
+ this.maxIndent = undefined;
7185
+ this.resColWidth = undefined;
7186
+ this.isOverflows = undefined;
7187
+ this.indentCollection = {};
7188
+ this.formatList = undefined;
7189
+ this.colPos = 0;
7190
+ this.colGrandPos = undefined;
7191
+ this.rowGrandPos = undefined;
7192
+ this.lastSpan = 0;
7193
+ this.field = undefined;
7194
+ this.fieldCaption = undefined;
7195
+ this.lvlCollection = {};
7196
+ this.hierarchyCollection = {};
7197
+ this.lvlPosCollection = {};
7198
+ this.hierarchyPosCollection = {};
7199
+ this.position = 0;
7200
+ this.measurePos = 0;
7201
+ this.maxMeasurePos = 0;
7202
+ this.hierarchyCount = 0;
7203
+ this.actualText = '';
7204
+ this.timeOutObj = undefined;
7205
+ }
7129
7206
  refreshHeader() {
7130
7207
  if (this.parent.enableVirtualization) {
7131
7208
  let mHdr = this.parent.element.querySelector('.' + MOVABLEHEADER_DIV);
@@ -7326,9 +7403,9 @@ class Render {
7326
7403
  this.parent.renderReactTemplates(); /* eslint-disable-line */
7327
7404
  }
7328
7405
  if (this.parent.isInitial) {
7406
+ this.parent.isInitial = false;
7329
7407
  this.parent.refreshData();
7330
7408
  }
7331
- this.parent.isInitial = false;
7332
7409
  this.parent.notify(contentReady, {});
7333
7410
  }
7334
7411
  setFocusOnLastCell() {
@@ -8132,7 +8209,7 @@ class Render {
8132
8209
  if (cell.isSum) {
8133
8210
  tCell.classList.add(SUMMARY);
8134
8211
  }
8135
- let isGrandSum = (isNullOrUndefined(cell.isGrandSum) && this.parent.dataSourceSettings.valueAxis === 'column' && this.parent.dataType === 'olap' &&
8212
+ let isGrandSum = (isNullOrUndefined(cell.isGrandSum) && (!isNullOrUndefined(this.parent.olapEngineModule) && this.parent.olapEngineModule.olapValueAxis === 'column') && this.parent.dataType === 'olap' &&
8136
8213
  ((this.colGrandPos - this.parent.dataSourceSettings.values.length) < Number(tCell.getAttribute('aria-colindex'))));
8137
8214
  if (cell.isGrandSum || (isGrandSum || this.colGrandPos === Number(tCell.getAttribute('aria-colindex'))) || this.rowGrandPos === Number(tCell.getAttribute('index'))) {
8138
8215
  tCell.classList.add('e-gtot');
@@ -8273,6 +8350,12 @@ class Render {
8273
8350
  }
8274
8351
  lvlPos++;
8275
8352
  }
8353
+ if (this.parent.dataSourceSettings.grandTotalsPosition === 'Top' && (!isNullOrUndefined(this.parent.olapEngineModule) && this.parent.olapEngineModule.olapValueAxis === 'row') && this.parent.dataType === 'olap' &&
8354
+ (cell.valueSort.levelName.toString()).indexOf(this.parent.localeObj.getConstant('grandTotal') + this.parent.dataSourceSettings.valueSortSettings.headerDelimiter) === 0) {
8355
+ tCell.appendChild(createElement('span', {
8356
+ className: NEXTSPAN,
8357
+ }));
8358
+ }
8276
8359
  if (cell.memberType === 3 && cell.level === -1 && Object.keys(this.lvlCollection).length > 1) {
8277
8360
  tCell.appendChild(createElement('span', {
8278
8361
  className: NEXTSPAN,
@@ -8584,8 +8667,8 @@ class Render {
8584
8667
  if (this.parent.currentView !== 'Chart') {
8585
8668
  if (this.gridSettings.height === 'auto' && parHeight && this.parent.element.querySelector('.' + GRID_HEADER)) {
8586
8669
  let rowColHeight = this.parent.element.querySelector('.' + GRID_HEADER).offsetHeight;
8587
- let gBarHeight = rowColHeight + (this.parent.element.querySelector('.' + GROUPING_BAR_CLASS) ?
8588
- this.parent.element.querySelector('.' + GROUPING_BAR_CLASS).offsetHeight : 0);
8670
+ let gBarHeight = rowColHeight + (this.parent.element.querySelector('.' + GRID_GROUPING_BAR_CLASS) ?
8671
+ this.parent.element.querySelector('.' + GRID_GROUPING_BAR_CLASS).offsetHeight : 0);
8589
8672
  let toolBarHeight = this.parent.element.querySelector('.' + GRID_TOOLBAR) ? 42 : 0;
8590
8673
  gridHeight = parHeight - (gBarHeight + toolBarHeight) - 1;
8591
8674
  gridHeight = gridHeight < 40 ? 40 : gridHeight;
@@ -10293,7 +10376,6 @@ class FilterDialog {
10293
10376
  if (this.allowExcelLikeFilter) {
10294
10377
  this.dialogPopUp.element.querySelector('.e-dlg-closeicon-btn').focus();
10295
10378
  }
10296
- this.parent.control.pivotButtonModule.memberTreeView = this.parent.filterDialog.memberTreeView;
10297
10379
  this.memberTreeView.nodeChecked =
10298
10380
  this.parent.control.pivotButtonModule.nodeStateModified.bind(this.parent.control.pivotButtonModule);
10299
10381
  this.allMemberSelect.nodeChecked =
@@ -11296,6 +11378,15 @@ class FilterDialog {
11296
11378
  if (this.dropMenu && !this.dropMenu.isDestroyed) {
11297
11379
  this.dropMenu.destroy();
11298
11380
  }
11381
+ if (this.memberTreeView && !this.memberTreeView.isDestroyed) {
11382
+ this.memberTreeView.destroy();
11383
+ }
11384
+ if (this.allMemberSelect && !this.allMemberSelect.isDestroyed) {
11385
+ this.allMemberSelect.destroy();
11386
+ }
11387
+ if (this.editorSearch && !this.editorSearch.isDestroyed) {
11388
+ this.editorSearch.destroy();
11389
+ }
11299
11390
  if (document.getElementById(this.parent.parentID + '_LevelDiv-popup')) {
11300
11391
  remove(document.getElementById(this.parent.parentID + '_LevelDiv-popup'));
11301
11392
  }
@@ -11304,11 +11395,23 @@ class FilterDialog {
11304
11395
  removeFilterDialog() {
11305
11396
  if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
11306
11397
  this.dialogPopUp.destroy();
11398
+ setTimeout(this.setFocus.bind(this));
11307
11399
  }
11308
11400
  if (document.getElementById(this.parent.parentID + '_EditorTreeView')) {
11309
11401
  remove(document.getElementById(this.parent.parentID + '_EditorTreeView'));
11310
11402
  }
11311
11403
  }
11404
+ setFocus() {
11405
+ if (this.parent.control.pivotButtonModule.parentElement) {
11406
+ let pivotButtons = [].slice.call(this.parent.control.pivotButtonModule.parentElement.querySelectorAll('.e-pivot-button'));
11407
+ for (let item of pivotButtons) {
11408
+ if (item.getAttribute('data-uid') === this.parent.control.pivotButtonModule.fieldName) {
11409
+ item.focus();
11410
+ break;
11411
+ }
11412
+ }
11413
+ }
11414
+ }
11312
11415
  }
11313
11416
 
11314
11417
  /**
@@ -11940,6 +12043,9 @@ __decorate$1([
11940
12043
  __decorate$1([
11941
12044
  Property(true)
11942
12045
  ], DataSourceSettings.prototype, "showGrandTotals", void 0);
12046
+ __decorate$1([
12047
+ Property('Bottom')
12048
+ ], DataSourceSettings.prototype, "grandTotalsPosition", void 0);
11943
12049
  __decorate$1([
11944
12050
  Property(true)
11945
12051
  ], DataSourceSettings.prototype, "showRowGrandTotals", void 0);
@@ -12726,6 +12832,7 @@ class VirtualScroll$1 {
12726
12832
  this.previousValues = { top: 0, left: 0 };
12727
12833
  this.frozenPreviousValues = { top: 0, left: 0 };
12728
12834
  this.eventType = '';
12835
+ this.isFireFox = Browser.userAgent.toLowerCase().indexOf('firefox') > -1;
12729
12836
  this.parent = parent;
12730
12837
  this.engineModule = this.parent.dataType === 'pivot' ? this.parent.engineModule : this.parent.olapEngineModule;
12731
12838
  this.addInternalEvents();
@@ -12749,6 +12856,9 @@ class VirtualScroll$1 {
12749
12856
  let mScrollBar = mCont.parentElement.parentElement.querySelector('.' + MOVABLESCROLL_DIV);
12750
12857
  EventHandler.clearEvents(mCont);
12751
12858
  EventHandler.clearEvents(fCont);
12859
+ if (this.isFireFox) {
12860
+ EventHandler.clearEvents(mHdr);
12861
+ }
12752
12862
  if (this.engineModule) {
12753
12863
  let ele = this.parent.isAdaptive ? mCont : mCont.parentElement.parentElement.querySelector('.' + MOVABLESCROLL_DIV);
12754
12864
  EventHandler.add(ele, 'scroll touchmove pointermove', this.onHorizondalScroll(mHdr, mCont, fCont), this);
@@ -12808,7 +12918,7 @@ class VirtualScroll$1 {
12808
12918
  }
12809
12919
  let target = e.target;
12810
12920
  let left = target.scrollLeft;
12811
- if (this.previousValues.left === left) {
12921
+ if (this.previousValues.left === left || (this.isFireFox && target.classList.contains(MOVABLEHEADER_DIV))) {
12812
12922
  return;
12813
12923
  }
12814
12924
  content.scrollLeft = left;
@@ -13158,138 +13268,155 @@ class DrillThroughDialog {
13158
13268
  this.clonedData.push(this.frameHeaderWithKeys(eventArgs.rawData[i]));
13159
13269
  }
13160
13270
  let actualText = eventArgs.currentCell.actualText.toString();
13161
- if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
13162
- this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
13163
- this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
13164
- this.editCell(eventArgs);
13165
- }
13166
- else {
13167
- this.removeDrillThroughDialog();
13168
- let drillThroughDialog = createElement('div', {
13169
- id: this.parent.element.id + '_drillthrough',
13170
- className: DRILLTHROUGH_DIALOG
13171
- });
13172
- this.parent.element.appendChild(drillThroughDialog);
13173
- this.dialogPopUp = new Dialog({
13174
- animationSettings: { effect: 'Fade' },
13175
- allowDragging: false,
13176
- header: this.parent.localeObj.getConstant('details'),
13177
- content: this.createDrillThroughGrid(eventArgs),
13178
- beforeOpen: () => {
13179
- this.drillThroughGrid.setProperties({
13180
- dataSource: this.parent.editSettings.allowEditing ?
13181
- this.dataWithPrimarykey(eventArgs) : this.gridData,
13182
- height: !this.parent.editSettings.allowEditing ? 300 : 220
13183
- }, false);
13184
- },
13185
- beforeClose: () => {
13186
- if (this.parent.editSettings.allowEditing && this.isUpdated) {
13187
- if (this.parent.dataSourceSettings.type === 'CSV') {
13188
- this.updateData(this.drillThroughGrid.dataSource);
13189
- }
13190
- let gridIndexObjectsValue = Object.keys(this.gridIndexObjects);
13191
- let previousPosition = [];
13192
- for (let value of gridIndexObjectsValue) {
13193
- previousPosition.push(this.gridIndexObjects[value]);
13194
- }
13195
- let count = Object.keys(this.gridIndexObjects).length;
13196
- let addItems = [];
13197
- let prevItems = [];
13198
- let index = 0;
13199
- /* eslint-disable @typescript-eslint/dot-notation */
13200
- for (let item of this.drillThroughGrid.dataSource) {
13201
- if (isNullOrUndefined(item['__index']) || item['__index'] === '') {
13202
- for (let field of this.engine.fields) {
13203
- if (isNullOrUndefined(item[field])) {
13204
- delete item[field];
13205
- }
13206
- }
13207
- delete item['__index'];
13208
- addItems.push(item);
13271
+ try {
13272
+ if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
13273
+ this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
13274
+ this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
13275
+ this.parent.actionObj.actionName = editRecord;
13276
+ if (this.parent.actionBeginMethod()) {
13277
+ return;
13278
+ }
13279
+ this.editCell(eventArgs);
13280
+ }
13281
+ else {
13282
+ this.removeDrillThroughDialog();
13283
+ let drillThroughDialog = createElement('div', {
13284
+ id: this.parent.element.id + '_drillthrough',
13285
+ className: DRILLTHROUGH_DIALOG
13286
+ });
13287
+ this.parent.element.appendChild(drillThroughDialog);
13288
+ this.dialogPopUp = new Dialog({
13289
+ animationSettings: { effect: 'Fade' },
13290
+ allowDragging: false,
13291
+ header: this.parent.localeObj.getConstant('details'),
13292
+ content: this.createDrillThroughGrid(eventArgs),
13293
+ beforeOpen: () => {
13294
+ this.drillThroughGrid.setProperties({
13295
+ dataSource: this.parent.editSettings.allowEditing ?
13296
+ this.dataWithPrimarykey(eventArgs) : this.gridData,
13297
+ height: !this.parent.editSettings.allowEditing ? 300 : 220
13298
+ }, false);
13299
+ },
13300
+ beforeClose: () => {
13301
+ if (this.parent.editSettings.allowEditing && this.isUpdated) {
13302
+ if (this.parent.dataSourceSettings.type === 'CSV') {
13303
+ this.updateData(this.drillThroughGrid.dataSource);
13209
13304
  }
13210
- else if (count > 0) {
13211
- delete this.gridIndexObjects[item['__index'].toString()];
13212
- prevItems.push(item);
13213
- count--;
13305
+ let gridIndexObjectsValue = Object.keys(this.gridIndexObjects);
13306
+ let previousPosition = [];
13307
+ for (let value of gridIndexObjectsValue) {
13308
+ previousPosition.push(this.gridIndexObjects[value]);
13214
13309
  }
13215
- if (this.parent.dataSourceSettings.mode === 'Server') {
13216
- if (item['__index']) {
13310
+ let count = Object.keys(this.gridIndexObjects).length;
13311
+ let addItems = [];
13312
+ let prevItems = [];
13313
+ let index = 0;
13314
+ /* eslint-disable @typescript-eslint/dot-notation */
13315
+ for (let item of this.drillThroughGrid.dataSource) {
13316
+ if (isNullOrUndefined(item['__index']) || item['__index'] === '') {
13317
+ for (let field of this.engine.fields) {
13318
+ if (isNullOrUndefined(item[field])) {
13319
+ delete item[field];
13320
+ }
13321
+ }
13217
13322
  delete item['__index'];
13323
+ addItems.push(item);
13218
13324
  }
13219
- if (this.gridData[index]['__index']) {
13220
- delete this.gridData[index]['__index'];
13325
+ else if (count > 0) {
13326
+ delete this.gridIndexObjects[item['__index'].toString()];
13327
+ prevItems.push(item);
13328
+ count--;
13221
13329
  }
13330
+ if (this.parent.dataSourceSettings.mode === 'Server') {
13331
+ if (item['__index']) {
13332
+ delete item['__index'];
13333
+ }
13334
+ if (this.gridData[index]['__index']) {
13335
+ delete this.gridData[index]['__index'];
13336
+ }
13337
+ }
13338
+ index++;
13222
13339
  }
13223
- index++;
13224
- }
13225
- count = 0;
13226
- if (this.parent.dataSourceSettings.mode === 'Server') {
13227
- let gridIndex = []; /* eslint-disable-line */
13228
- let keys = Object.keys(this.gridIndexObjects);
13229
- for (let len = 0; len < keys.length; len++) {
13230
- delete this.parent.drillThroughValue.indexObject[this.gridIndexObjects[keys[len]]];
13231
- gridIndex.push({ Key: keys[len], Value: this.gridIndexObjects[keys[len]] }); /* eslint-disable-line */
13232
- }
13233
- let indexObject = []; /* eslint-disable-line */
13234
- keys = Object.keys(this.parent.drillThroughValue.indexObject);
13235
- for (let len = 0; len < keys.length; len++) {
13236
- indexObject.push({ Key: keys[len], Value: this.parent.drillThroughValue.indexObject[keys[len]] }); /* eslint-disable-line */
13340
+ count = 0;
13341
+ if (this.parent.dataSourceSettings.mode === 'Server') {
13342
+ let gridIndex = []; /* eslint-disable-line */
13343
+ let keys = Object.keys(this.gridIndexObjects);
13344
+ for (let len = 0; len < keys.length; len++) {
13345
+ delete this.parent.drillThroughValue.indexObject[this.gridIndexObjects[keys[len]]];
13346
+ gridIndex.push({ Key: keys[len], Value: this.gridIndexObjects[keys[len]] }); /* eslint-disable-line */
13347
+ }
13348
+ let indexObject = []; /* eslint-disable-line */
13349
+ keys = Object.keys(this.parent.drillThroughValue.indexObject);
13350
+ for (let len = 0; len < keys.length; len++) {
13351
+ indexObject.push({ Key: keys[len], Value: this.parent.drillThroughValue.indexObject[keys[len]] }); /* eslint-disable-line */
13352
+ }
13353
+ this.parent.getEngine('updateRawData', null, null, null, null, null, null, null, { 'addedData': addItems, 'removedData': gridIndex, 'updatedData': prevItems, indexObject: indexObject });
13237
13354
  }
13238
- this.parent.getEngine('updateRawData', null, null, null, null, null, null, null, { 'addedData': addItems, 'removedData': gridIndex, 'updatedData': prevItems, indexObject: indexObject });
13239
- }
13240
- else {
13241
- let items = [];
13242
- let data = (this.parent.allowDataCompression && this.parent.enableVirtualization) ?
13243
- this.parent.engineModule.actualData : this.parent.engineModule.data;
13244
- for (let item of data) {
13245
- delete item['__index'];
13246
- if (this.gridIndexObjects[count.toString()] === undefined) {
13247
- items.push(item);
13355
+ else {
13356
+ let items = [];
13357
+ let data = (this.parent.allowDataCompression && this.parent.enableVirtualization) ?
13358
+ this.parent.engineModule.actualData : this.parent.engineModule.data;
13359
+ for (let item of data) {
13360
+ delete item['__index'];
13361
+ if (this.gridIndexObjects[count.toString()] === undefined) {
13362
+ items.push(item);
13363
+ }
13364
+ count++;
13365
+ }
13366
+ /* eslint-enable @typescript-eslint/dot-notation */
13367
+ items = items.concat(addItems);
13368
+ let eventArgs = {
13369
+ currentData: this.drillThroughGrid.dataSource,
13370
+ previousData: this.clonedData,
13371
+ previousPosition: previousPosition,
13372
+ cancel: false
13373
+ };
13374
+ this.parent.trigger(editCompleted, eventArgs);
13375
+ if (!eventArgs.cancel) {
13376
+ this.parent.setProperties({ dataSourceSettings: { dataSource: items } }, true);
13377
+ this.engine.updateGridData(this.parent.dataSourceSettings);
13378
+ this.parent.pivotValues = this.engine.pivotValues;
13248
13379
  }
13249
- count++;
13250
13380
  }
13251
- /* eslint-enable @typescript-eslint/dot-notation */
13252
- items = items.concat(addItems);
13253
- let eventArgs = {
13254
- currentData: this.drillThroughGrid.dataSource,
13255
- previousData: this.clonedData,
13256
- previousPosition: previousPosition,
13257
- cancel: false
13381
+ this.parent.actionObj.actionName = recordUpdated;
13382
+ let actionInfo = {
13383
+ editInfo: {
13384
+ type: this.drillThroughGrid.editSettings.mode, action: 'Update', currentData: this.drillThroughGrid.dataSource,
13385
+ previousData: this.clonedData, previousPosition: previousPosition
13386
+ }
13258
13387
  };
13259
- this.parent.trigger(editCompleted, eventArgs);
13260
- if (!eventArgs.cancel) {
13261
- this.parent.setProperties({ dataSourceSettings: { dataSource: items } }, true);
13262
- this.engine.updateGridData(this.parent.dataSourceSettings);
13263
- this.parent.pivotValues = this.engine.pivotValues;
13264
- }
13388
+ this.parent.actionObj.actionInfo = actionInfo;
13265
13389
  }
13266
- }
13267
- this.isUpdated = false;
13268
- this.gridIndexObjects = {};
13269
- },
13270
- isModal: true,
13271
- visible: true,
13272
- showCloseIcon: true,
13273
- locale: this.parent.locale,
13274
- enableRtl: this.parent.enableRtl,
13275
- width: this.parent.isAdaptive ? '100%' : '60%',
13276
- position: { X: 'center', Y: 'center' },
13277
- closeOnEscape: !this.parent.editSettings.allowEditing,
13278
- target: document.body,
13279
- close: this.removeDrillThroughDialog.bind(this)
13280
- });
13281
- this.dialogPopUp.isStringTemplate = true;
13282
- this.dialogPopUp.appendTo(drillThroughDialog);
13283
- // this.dialogPopUp.element.querySelector('.e-dlg-header').innerHTML = this.parent.localeObj.getConstant('details');
13284
- setStyleAttribute(this.dialogPopUp.element, { 'visibility': 'visible' });
13285
- if (this.parent.editSettings.allowEditing) {
13286
- this.drillthroughKeyboardModule = new KeyboardEvents(this.dialogPopUp.element, {
13287
- keyAction: this.drillthroughKeyActionHandler.bind(this),
13288
- keyConfigs: this.drillKeyConfigs,
13289
- eventName: 'keydown'
13390
+ this.isUpdated = false;
13391
+ this.gridIndexObjects = {};
13392
+ },
13393
+ isModal: true,
13394
+ visible: true,
13395
+ showCloseIcon: true,
13396
+ locale: this.parent.locale,
13397
+ enableRtl: this.parent.enableRtl,
13398
+ width: this.parent.isAdaptive ? '100%' : '60%',
13399
+ position: { X: 'center', Y: 'center' },
13400
+ closeOnEscape: !this.parent.editSettings.allowEditing,
13401
+ target: document.body,
13402
+ close: this.removeDrillThroughDialog.bind(this)
13290
13403
  });
13404
+ this.dialogPopUp.isStringTemplate = true;
13405
+ this.dialogPopUp.appendTo(drillThroughDialog);
13406
+ // this.dialogPopUp.element.querySelector('.e-dlg-header').innerHTML = this.parent.localeObj.getConstant('details');
13407
+ setStyleAttribute(this.dialogPopUp.element, { 'visibility': 'visible' });
13408
+ if (this.parent.editSettings.allowEditing) {
13409
+ this.drillthroughKeyboardModule = new KeyboardEvents(this.dialogPopUp.element, {
13410
+ keyAction: this.drillthroughKeyActionHandler.bind(this),
13411
+ keyConfigs: this.drillKeyConfigs,
13412
+ eventName: 'keydown'
13413
+ });
13414
+ }
13291
13415
  }
13292
13416
  }
13417
+ catch (execption) {
13418
+ this.parent.actionFailureMethod(execption);
13419
+ }
13293
13420
  }
13294
13421
  editCell(eventArgs) {
13295
13422
  let gridResize = this.parent.gridSettings.allowResizing;
@@ -13304,6 +13431,10 @@ class DrillThroughDialog {
13304
13431
  if (eventArgs.currentCell.actualText in previousData) {
13305
13432
  currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
13306
13433
  }
13434
+ let actionInfo = {
13435
+ editInfo: { type: 'Inline editing', action: 'update', data: this.gridData }
13436
+ };
13437
+ this.parent.actionObj.actionInfo = actionInfo;
13307
13438
  this.numericTextBox = new NumericTextBox({
13308
13439
  value: cellValue,
13309
13440
  enableRtl: this.parent.enableRtl,
@@ -13368,6 +13499,10 @@ class DrillThroughDialog {
13368
13499
  }
13369
13500
  removeDrillThroughDialog() {
13370
13501
  if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
13502
+ this.parent.actionObj.actionName = drillThroughClosed;
13503
+ if (this.parent.actionObj.actionName) {
13504
+ this.parent.actionCompleteMethod();
13505
+ }
13371
13506
  this.dialogPopUp.destroy();
13372
13507
  }
13373
13508
  let dialogElement = document.getElementById(this.parent.element.id + '_drillthrough');
@@ -13457,31 +13592,53 @@ class DrillThroughDialog {
13457
13592
  }
13458
13593
  if (this.parent.editSettings.allowEditing) {
13459
13594
  Grid.Inject(Edit, Page);
13460
- this.drillThroughGrid.editSettings = this.parent.editSettings;
13461
- if (this.parent.editSettings.allowCommandColumns) {
13462
- this.drillThroughGrid.editSettings.mode = 'Normal';
13463
- this.drillThroughGrid.editSettings.allowEditOnDblClick = false;
13464
- Grid.Inject(CommandColumn);
13595
+ try {
13596
+ this.drillThroughGrid.editSettings = this.parent.editSettings;
13597
+ this.drillThroughGrid.actionBegin = (args) => {
13598
+ let actionName = (args.requestType == 'save') ? saveEditedRecords : (args.requestType == 'add') ? addNewRecord : (args.requestType == 'delete') ? removeRecord : '';
13599
+ this.parent.actionObj.actionName = actionName;
13600
+ if (this.parent.actionObj.actionName) {
13601
+ if (this.parent.actionBeginMethod()) {
13602
+ return;
13603
+ }
13604
+ }
13605
+ };
13606
+ if (this.parent.editSettings.allowCommandColumns) {
13607
+ this.drillThroughGrid.editSettings.mode = 'Normal';
13608
+ this.drillThroughGrid.editSettings.allowEditOnDblClick = false;
13609
+ Grid.Inject(CommandColumn);
13610
+ this.drillThroughGrid.columns.push({
13611
+ headerText: this.parent.localeObj.getConstant('manageRecords'), width: 160, showInColumnChooser: false,
13612
+ commands: [
13613
+ { type: 'Edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' } },
13614
+ { type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' } },
13615
+ { type: 'Save', buttonOption: { iconCss: 'e-icons e-update', cssClass: 'e-flat' } },
13616
+ { type: 'Cancel', buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' } }
13617
+ ]
13618
+ });
13619
+ }
13620
+ else {
13621
+ this.drillThroughGrid.editSettings.allowEditOnDblClick = this.parent.editSettings.allowEditOnDblClick;
13622
+ }
13465
13623
  this.drillThroughGrid.columns.push({
13466
- headerText: this.parent.localeObj.getConstant('manageRecords'), width: 160, showInColumnChooser: false,
13467
- commands: [
13468
- { type: 'Edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' } },
13469
- { type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' } },
13470
- { type: 'Save', buttonOption: { iconCss: 'e-icons e-update', cssClass: 'e-flat' } },
13471
- { type: 'Cancel', buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' } }
13472
- ]
13624
+ field: '__index', visible: false, isPrimaryKey: true, type: 'string', showInColumnChooser: false
13473
13625
  });
13474
13626
  }
13475
- else {
13476
- this.drillThroughGrid.editSettings.allowEditOnDblClick = this.parent.editSettings.allowEditOnDblClick;
13627
+ catch (execption) {
13628
+ this.parent.actionFailureMethod(execption);
13477
13629
  }
13478
- this.drillThroughGrid.columns.push({
13479
- field: '__index', visible: false, isPrimaryKey: true, type: 'string', showInColumnChooser: false
13480
- });
13481
13630
  this.drillThroughGrid.actionComplete = (args) => {
13482
13631
  if (args.requestType === 'batchsave' || args.requestType === 'save' || args.requestType === 'delete') {
13483
13632
  dialogModule.isUpdated = true;
13484
13633
  }
13634
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
13635
+ let actionInfo = {
13636
+ editInfo: { type: this.drillThroughGrid.editSettings.mode, action: args.requestType, data: this.gridData }
13637
+ };
13638
+ this.parent.actionObj.actionInfo = actionInfo;
13639
+ if (this.parent.actionObj.actionName) {
13640
+ this.parent.actionCompleteMethod();
13641
+ }
13485
13642
  if ((dialogModule.drillThroughGrid.editSettings.mode === 'Normal' && args.requestType === 'save' &&
13486
13643
  dialogModule.drillThroughGrid.element.querySelectorAll('.e-tbar-btn:hover').length > 0 &&
13487
13644
  !dialogModule.parent.editSettings.allowCommandColumns) || args.requestType === 'batchsave') {
@@ -13670,7 +13827,7 @@ class DrillThrough {
13670
13827
  * @hidden
13671
13828
  */
13672
13829
  getModuleName() {
13673
- return 'drillthrough';
13830
+ return 'drillThrough';
13674
13831
  }
13675
13832
  addInternalEvents() {
13676
13833
  this.parent.on(contentReady, this.wireEvents, this);
@@ -13874,7 +14031,7 @@ class PivotChart {
13874
14031
  * @private
13875
14032
  */
13876
14033
  getModuleName() {
13877
- return 'pivotchart';
14034
+ return 'pivotChart';
13878
14035
  }
13879
14036
  /* eslint-disable */
13880
14037
  loadChart(parent, chartSettings) {
@@ -14065,7 +14222,9 @@ class PivotChart {
14065
14222
  this.maxLevel = currrentLevel > this.maxLevel ? currrentLevel : this.maxLevel;
14066
14223
  let name = this.parent.dataType === 'olap' ? firstRowCell.formattedText :
14067
14224
  (firstRowCell.actualText ? firstRowCell.actualText.toString() : firstRowCell.formattedText.toString());
14068
- let text = firstRowCell.formattedText ? firstRowCell.formattedText.toString() : name;
14225
+ let values = this.engineModule.fieldList[this.currentMeasure];
14226
+ let text = this.parent.dataSourceSettings.rows.length === 0 ? this.parent.localeObj.getConstant('total') + ' ' + this.parent.localeObj.getConstant(values.aggregateType) + ' ' +
14227
+ this.parent.localeObj.getConstant('of') + ' ' + (!isNullOrUndefined(values.caption) ? values.caption : values.name) : firstRowCell.formattedText ? firstRowCell.formattedText.toString() : name;
14069
14228
  let caption = (firstRowCell.hasChild && !firstRowCell.isNamedSet) ?
14070
14229
  ((firstRowCell.isDrilled ? ' - ' : ' + ') + text) : text;
14071
14230
  let levelName = tupInfo ? tupInfo.uNameCollection : firstRowCell.valueSort.levelName.toString();
@@ -14239,7 +14398,9 @@ class PivotChart {
14239
14398
  this.chartSettings.palettes = currentSeries.palettes;
14240
14399
  }
14241
14400
  for (let i = 0; i < this.columnGroupObject[key].length; i++) {
14242
- this.columnGroupObject[key][i].x = this.columnGroupObject[key][i].x === '' ? this.parent.localeObj.getConstant('blank') : this.columnGroupObject[key][i].x;
14401
+ let values = this.engineModule.fieldList[this.currentMeasure];
14402
+ 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) + ' ' +
14403
+ 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;
14243
14404
  }
14244
14405
  currentSeries.dataSource = this.columnGroupObject[key];
14245
14406
  currentSeries.xName = 'x';
@@ -14395,7 +14556,7 @@ class PivotChart {
14395
14556
  enableSmartLabels: this.chartSettings.enableSmartLabels,
14396
14557
  center: this.chartSettings.pieCenter,
14397
14558
  enableBorderOnMouseMove: this.chartSettings.enableBorderOnMouseMove,
14398
- highLightMode: this.chartSettings.highlightMode,
14559
+ highlightMode: this.chartSettings.highlightMode,
14399
14560
  highlightPattern: this.chartSettings.highlightPattern,
14400
14561
  titleStyle: this.chartSettings.titleStyle,
14401
14562
  subTitle: this.chartSettings.subTitle,
@@ -14523,7 +14684,7 @@ class PivotChart {
14523
14684
  this.parent.chart.highlightPattern = this.parent.chartSettings.highlightPattern;
14524
14685
  if (this.accumulationType.indexOf(type) > -1) {
14525
14686
  this.parent.chart.enableBorderOnMouseMove = this.parent.chartSettings.enableBorderOnMouseMove;
14526
- this.parent.chart.highLightMode = this.parent.chartSettings.highlightMode;
14687
+ this.parent.chart.highlightMode = this.parent.chartSettings.highlightMode;
14527
14688
  this.parent.chart.enableSmartLabels = this.parent.chartSettings.enableSmartLabels;
14528
14689
  }
14529
14690
  else {
@@ -14630,9 +14791,14 @@ class PivotChart {
14630
14791
  currentYAxis.labelFormat = currentYAxis.labelFormat ?
14631
14792
  currentYAxis.labelFormat : (percentChart ? '' : (!resFormat ? format : 'N'));
14632
14793
  currentYAxis.title = currentYAxis.title ? currentYAxis.title : measureAggregatedName;
14633
- currentYAxis.plotOffsetTop = currentYAxis.plotOffsetTop ? currentYAxis.plotOffsetTop :
14634
- this.chartSettings.chartSeries.type === 'Bar' || this.chartSettings.chartSeries.type === 'StackingBar' ||
14635
- this.chartSettings.chartSeries.type === 'StackingBar100' ? 50 : 30;
14794
+ currentYAxis.edgeLabelPlacement = this.chartSettings.primaryYAxis.edgeLabelPlacement ? this.chartSettings.primaryYAxis.edgeLabelPlacement : this.persistSettings.primaryYAxis.edgeLabelPlacement;
14795
+ if (this.chartSettings.chartSeries.type === 'Bar' || this.chartSettings.chartSeries.type === 'StackingBar' ||
14796
+ this.chartSettings.chartSeries.type === 'StackingBar100') {
14797
+ currentYAxis.plotOffsetRight = currentYAxis.plotOffsetRight ? currentYAxis.plotOffsetRight : 30;
14798
+ }
14799
+ else {
14800
+ currentYAxis.plotOffsetTop = currentYAxis.plotOffsetTop ? currentYAxis.plotOffsetTop : 30;
14801
+ }
14636
14802
  if (!resFormat) {
14637
14803
  currentYAxis.name = this.measuresNames[item.name] ? this.measuresNames[item.name] : item.name;
14638
14804
  }
@@ -14678,6 +14844,7 @@ class PivotChart {
14678
14844
  currentYAxis = this.persistSettings.primaryYAxis ? this.frameObjectWithKeys(this.persistSettings.primaryYAxis) : currentYAxis;
14679
14845
  currentYAxis.rowIndex = 0;
14680
14846
  currentYAxis.columnIndex = 0;
14847
+ currentYAxis.edgeLabelPlacement = this.chartSettings.primaryYAxis.edgeLabelPlacement ? this.chartSettings.primaryYAxis.edgeLabelPlacement : this.persistSettings.primaryYAxis.edgeLabelPlacement;
14681
14848
  if (!(this.chartSettings.chartSeries.type === 'Polar' || this.chartSettings.chartSeries.type === 'Radar')) {
14682
14849
  currentYAxis.name = this.measuresNames[this.currentMeasure] ? this.measuresNames[this.currentMeasure] : this.currentMeasure;
14683
14850
  }
@@ -14994,6 +15161,7 @@ class PivotChart {
14994
15161
  }
14995
15162
  loaded(args) {
14996
15163
  this.parent.isChartLoaded = true;
15164
+ let width = this.parent.grid ? this.parent.getGridWidthAsNumber().toString() : this.parent.getWidthAsNumber().toString();
14997
15165
  if (this.parent.chart && this.parent.showGroupingBar && this.parent.groupingBarModule &&
14998
15166
  this.parent.showFieldList && this.parent.currentView === 'Chart') {
14999
15167
  this.parent.groupingBarModule.alignIcon();
@@ -15005,13 +15173,15 @@ class PivotChart {
15005
15173
  this.parent.element.querySelector('#' + this.parent.element.id + multilabelAxisName).setAttribute('cursor', 'pointer');
15006
15174
  }
15007
15175
  }
15008
- if ((['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) >= 0)
15009
- && this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
15010
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'visible';
15011
- }
15012
- else if (this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
15013
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'auto';
15014
- this.parent.element.querySelector('.' + PIVOTCHART).style.overflowX = 'hidden';
15176
+ if (this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
15177
+ if (['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) >= 0) {
15178
+ this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'visible';
15179
+ }
15180
+ else {
15181
+ this.parent.element.querySelector('.' + PIVOTCHART).style.overflow = 'auto';
15182
+ this.parent.element.querySelector('.' + PIVOTCHART).style.overflowX = 'hidden';
15183
+ }
15184
+ this.parent.element.querySelector('.' + PIVOTCHART).style.width = width + 'px';
15015
15185
  }
15016
15186
  this.parent.chart.height = ['Pie', 'Funnel', 'Pyramid', 'Doughnut', 'Radar', 'Polar'].indexOf(this.parent.chartSettings.chartSeries.type) < 0 &&
15017
15187
  this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis &&
@@ -15232,6 +15402,11 @@ class PivotChart {
15232
15402
  offSetHeight = this.parent.getHeightAsNumber() - offSetVal;
15233
15403
  }
15234
15404
  if (!isNullOrUndefined(this.parent.getHeightAsNumber())) {
15405
+ let isNone = false;
15406
+ if (this.parent.element.querySelector('.e-chart-grouping-bar') !== null && this.parent.element.querySelector('.e-chart-grouping-bar').style.display.toLowerCase() === 'none') {
15407
+ isNone = true;
15408
+ this.parent.element.querySelector('.e-chart-grouping-bar').style.display = "block";
15409
+ }
15235
15410
  if (this.parent.showToolbar && this.parent.showGroupingBar) {
15236
15411
  height = (offSetHeight - (this.parent.element.querySelector('.e-pivot-toolbar') ?
15237
15412
  this.parent.element.querySelector('.e-pivot-toolbar').clientHeight : 42) -
@@ -15249,6 +15424,9 @@ class PivotChart {
15249
15424
  else if ((this.parent.chart && parseInt(this.parent.chart.height, 10) < 200) || offSetHeight < 200) {
15250
15425
  height = '200';
15251
15426
  }
15427
+ if (isNone) {
15428
+ this.parent.element.querySelector('.e-chart-grouping-bar').style.display = "none";
15429
+ }
15252
15430
  }
15253
15431
  else {
15254
15432
  height = 'auto';
@@ -16831,7 +17009,7 @@ __decorate$3([
16831
17009
  Property('')
16832
17010
  ], PivotAxis.prototype, "title", void 0);
16833
17011
  __decorate$3([
16834
- Property(null)
17012
+ Property(1)
16835
17013
  ], PivotAxis.prototype, "zoomFactor", void 0);
16836
17014
  __decorate$3([
16837
17015
  Complex({}, CrosshairTooltip)
@@ -16849,7 +17027,7 @@ __decorate$3([
16849
17027
  Property(0)
16850
17028
  ], PivotAxis.prototype, "plotOffset", void 0);
16851
17029
  __decorate$3([
16852
- Property('None')
17030
+ Property('Shift')
16853
17031
  ], PivotAxis.prototype, "edgeLabelPlacement", void 0);
16854
17032
  __decorate$3([
16855
17033
  Property('BetweenTicks')
@@ -18144,6 +18322,7 @@ class OlapEngine {
18144
18322
  this.updateTupCollection(customArgs.drillInfo.axis === 'row' ? rowTuples.length : columnTuples.length);
18145
18323
  }
18146
18324
  if (customArgs.action === 'down' ? customArgs.drillInfo.axis === 'column' : true) {
18325
+ this.olapValueAxis = isNullOrUndefined(this.getValueAxis(undefined, undefined)) ? 'column' : 'row';
18147
18326
  this.frameColumnHeader(columnTuples);
18148
18327
  if (!this.isPaging) {
18149
18328
  this.performColumnSorting();
@@ -18198,6 +18377,7 @@ class OlapEngine {
18198
18377
  frameRowHeader(tuples) {
18199
18378
  this.headerGrouping = {};
18200
18379
  this.lastLevel = [];
18380
+ let isGrandTotalAdd = true;
18201
18381
  let position = this.pivotValues.length;
18202
18382
  let pivotValues = [];
18203
18383
  let valueContent = [];
@@ -18258,6 +18438,7 @@ class OlapEngine {
18258
18438
  let startTupPos = tupPos;
18259
18439
  let pagingAllowFlag = true;
18260
18440
  let lastMesPos = 0;
18441
+ let isGrandTotalTop = false;
18261
18442
  while (tupPos < tuplesLength && pagingAllowFlag) {
18262
18443
  let members = tuples[this.customArgs.action === 'down' ?
18263
18444
  (tupPos - (this.customArgs.drillInfo.currentCell.ordinal + 1)) : tupPos].querySelectorAll('Member');
@@ -18312,35 +18493,25 @@ class OlapEngine {
18312
18493
  (allStartPos === (drillStartPos + 1) || this.tupRowInfo[tupPos].measurePosition === (drillStartPos + 1))))
18313
18494
  : drillAllow;
18314
18495
  let withoutAllAllow = (withoutAllStartPos > -1 && allCount > 0) ? (attrDrill || allStartPos > withoutAllEndPos) : true;
18315
- if (members.length === allCount + (measure ? 1 : 0) && measure) {
18496
+ isGrandTotalTop = this.dataSourceSettings.grandTotalsPosition === 'Top' && this.olapRowValueIndex === 0 && this.olapValueAxis === 'row'
18497
+ && this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showRowGrandTotals && (this.olapValueAxis === 'row' ? this.dataSourceSettings.rows.length > 1 : true);
18498
+ if (isGrandTotalTop && gTotals.length === 1) {
18499
+ gTotals = this.frameGrandTotalValues(tuples, gTotals, typeColl, measurePos);
18500
+ }
18501
+ if (members.length === allCount + (measure ? 1 : 0) && measure && !isGrandTotalTop) {
18316
18502
  let levelName = 'Grand Total.' + members[measurePos].querySelector('Caption').textContent;
18317
- gTotals.push({
18318
- axis: 'row',
18319
- actualText: this.getUniqueName(members[measurePos].querySelector('UName').textContent),
18320
- colIndex: 0,
18321
- formattedText: (typeColl[measurePos] === '3' &&
18322
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
18323
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption) ?
18324
- this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption :
18325
- members[measurePos].querySelector('Caption').textContent,
18326
- hasChild: false,
18327
- level: -1,
18328
- rowIndex: position,
18329
- index: [],
18330
- ordinal: tupPos,
18331
- colSpan: 1,
18332
- rowSpan: 1,
18333
- memberType: Number(typeColl[measurePos]),
18334
- isDrilled: false,
18335
- parentUniqueName: members[measurePos].querySelector('PARENT_UNIQUE_NAME') ?
18336
- members[measurePos].querySelector('PARENT_UNIQUE_NAME').textContent : undefined,
18337
- levelUniqueName: members[measurePos].querySelector('LName').textContent,
18338
- hierarchy: members[measurePos].getAttribute('Hierarchy'),
18339
- valueSort: { levelName: levelName, axis: members[measurePos].getAttribute('Hierarchy') }
18340
- });
18503
+ let formattedText = (typeColl[measurePos] === '3' && this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
18504
+ this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption) ? this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption :
18505
+ members[measurePos].querySelector('Caption').textContent;
18506
+ 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') });
18341
18507
  gTotals[gTotals.length - 1].valueSort['Grand Total.' + members[measurePos].querySelector('Caption').textContent] = 1;
18342
18508
  }
18343
18509
  else if (!(allStartPos === 0 || (measurePos === 0 && allStartPos === 1)) && drillAllow && withoutAllAllow) {
18510
+ if (this.dataSourceSettings.grandTotalsPosition === 'Top' && isGrandTotalAdd && this.dataSourceSettings.showGrandTotals && (this.olapValueAxis === 'row' ? this.dataSourceSettings.rows.length > 1 : true)) {
18511
+ this.insertRowGrandTotal(gTotals, valueContent, pivotValues, tuples, position);
18512
+ position = this.pivotValues.length;
18513
+ isGrandTotalAdd = false;
18514
+ }
18344
18515
  prevTupInfo = this.tupRowInfo[tupPos];
18345
18516
  let lastPos = position;
18346
18517
  let lastMemPos = memPos;
@@ -18431,6 +18602,11 @@ class OlapEngine {
18431
18602
  }
18432
18603
  tupPos++;
18433
18604
  }
18605
+ if (!(this.dataSourceSettings.grandTotalsPosition === 'Top') || (this.olapValueAxis === 'row' && this.dataSourceSettings.rows.length === 1 && this.dataSourceSettings.grandTotalsPosition === 'Top') || this.dataSourceSettings.rows.length === 0) {
18606
+ this.insertRowGrandTotal(gTotals, valueContent, pivotValues, tuples, position);
18607
+ }
18608
+ }
18609
+ insertRowGrandTotal(gTotals, valueContent, pivotValues, tuples, position) {
18434
18610
  if (gTotals.length > 1 && gTotals[0].memberType !== 3) {
18435
18611
  gTotals[0].ordinal = -1;
18436
18612
  }
@@ -18456,6 +18632,41 @@ class OlapEngine {
18456
18632
  this.updateRowEngine(pivotValues, valueContent, tuples.length);
18457
18633
  this.onDemandDrillEngine = pivotValues;
18458
18634
  }
18635
+ return gTotals;
18636
+ }
18637
+ getValueAxis(valueAxis, valueIndex) {
18638
+ this.olapValueAxis = valueAxis;
18639
+ this.olapRowValueIndex = valueIndex;
18640
+ for (let i = 0; i < this.dataSourceSettings.rows.length; i++) {
18641
+ if (this.dataSourceSettings.rows[i].name === '[Measures]') {
18642
+ this.olapValueAxis = 'row';
18643
+ this.olapRowValueIndex = i;
18644
+ break;
18645
+ }
18646
+ }
18647
+ return this.olapValueAxis;
18648
+ }
18649
+ frameGrandTotalAxisSet(gTotals, actualText, formattedText, rowIndex, ordinal, memberType, parentUniqueName, levelUniqueName, hierarchy, valueSort) {
18650
+ gTotals.push({
18651
+ axis: 'row',
18652
+ actualText: actualText,
18653
+ colIndex: 0,
18654
+ formattedText: formattedText,
18655
+ hasChild: false,
18656
+ level: -1,
18657
+ rowIndex: rowIndex,
18658
+ index: [],
18659
+ ordinal: ordinal,
18660
+ colSpan: 1,
18661
+ rowSpan: 1,
18662
+ memberType: memberType,
18663
+ isDrilled: false,
18664
+ parentUniqueName: parentUniqueName,
18665
+ levelUniqueName: levelUniqueName,
18666
+ hierarchy: hierarchy,
18667
+ valueSort: valueSort
18668
+ });
18669
+ return gTotals;
18459
18670
  }
18460
18671
  getDepth(tupInfo, uniqueName, memberType) {
18461
18672
  let memberPosition = tupInfo.uNameCollection.indexOf(uniqueName);
@@ -18695,6 +18906,53 @@ class OlapEngine {
18695
18906
  currTupCount--;
18696
18907
  }
18697
18908
  }
18909
+ frameGrandTotalValues(tuples, gTotals, typeColl, measurePos) {
18910
+ let tupPos = 0;
18911
+ let lastAllStartPos;
18912
+ let lastAllCount;
18913
+ let availAllMember = false;
18914
+ let withoutAllEndPos = -1;
18915
+ let isGrandtoalDataAdd = false;
18916
+ let prevTupInfo;
18917
+ let isGrandTotalTop = false;
18918
+ while (tupPos < tuples.length && !isGrandtoalDataAdd) {
18919
+ let members = tuples[this.customArgs.action === 'down' ?
18920
+ (tupPos - (this.customArgs.drillInfo.currentCell.ordinal + 1)) : tupPos].querySelectorAll('Member');
18921
+ let allCount = this.tupRowInfo[tupPos].allCount;
18922
+ let allStartPos = this.tupRowInfo[tupPos].allStartPos;
18923
+ let measure = this.tupRowInfo[tupPos].measure;
18924
+ let typeColl = this.tupRowInfo[tupPos].typeCollection;
18925
+ let drillStartPos = this.tupRowInfo[tupPos].drillStartPos;
18926
+ let startDrillUniquename = this.tupRowInfo[tupPos].startDrillUniquename;
18927
+ if (tupPos === 0 && (members.length > (allCount + (measure ? 1 : 0)) || (members.length === 1 && measure))) {
18928
+ gTotals.pop();
18929
+ }
18930
+ if ((tupPos === 0 && this.isPaging) ? gTotals.length === 0 :
18931
+ (!availAllMember || allCount === lastAllCount || allStartPos !== lastAllStartPos || (members.length === 1 && measure))) {
18932
+ let attrDrill = this.checkAttributeDrill(this.tupRowInfo[tupPos].drillInfo, 'rows');
18933
+ let drillAllow = drillStartPos > -1 ? (allCount > 0 ? (attrDrill || allStartPos > drillStartPos) : true) : true;
18934
+ drillAllow = (prevTupInfo && drillAllow && drillStartPos > -1) ?
18935
+ (prevTupInfo.startDrillUniquename !== startDrillUniquename ? true :
18936
+ ((withoutAllEndPos > prevTupInfo.measurePosition ? false :
18937
+ prevTupInfo.measureName !== this.tupRowInfo[tupPos].measureName) &&
18938
+ (allStartPos === (drillStartPos + 1) || this.tupRowInfo[tupPos].measurePosition === (drillStartPos + 1))))
18939
+ : drillAllow;
18940
+ if (members.length === allCount + (measure ? 1 : 0) && measure && !isGrandTotalTop) {
18941
+ let levelName = 'Grand Total.' + members[measurePos].querySelector('Caption').textContent;
18942
+ let formattedText = (typeColl[measurePos] === '3' && this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
18943
+ this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption) ? this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)].caption :
18944
+ members[measurePos].querySelector('Caption').textContent;
18945
+ gTotals = this.frameGrandTotalAxisSet(gTotals, this.getUniqueName(members[measurePos].querySelector('UName').textContent), formattedText, this.pivotValues.length, tupPos, Number(typeColl[measurePos]), members[measurePos].querySelector('PARENT_UNIQUE_NAME') ? members[measurePos].querySelector('PARENT_UNIQUE_NAME').textContent : undefined, members[measurePos].querySelector('LName').textContent, members[measurePos].getAttribute('Hierarchy'), { levelName: levelName, axis: members[measurePos].getAttribute('Hierarchy') });
18946
+ gTotals[gTotals.length - 1].valueSort['Grand Total.' + members[measurePos].querySelector('Caption').textContent] = 1;
18947
+ }
18948
+ lastAllCount = allCount;
18949
+ lastAllStartPos = allStartPos;
18950
+ }
18951
+ isGrandtoalDataAdd = this.dataSourceSettings.values.length + 1 === gTotals.length ? true : false;
18952
+ tupPos++;
18953
+ }
18954
+ return gTotals;
18955
+ }
18698
18956
  frameColumnHeader(tuples) {
18699
18957
  this.headerGrouping = {};
18700
18958
  this.lastLevel = [];
@@ -18758,8 +19016,18 @@ class OlapEngine {
18758
19016
  withoutAllAvail = true;
18759
19017
  isStartCol = (allCount > 0 && isStartCol) ? (allStartPos > withoutAllStartPos) : isStartCol;
18760
19018
  }
18761
- if (isStartCol) {
18762
- if (allCount === 0) {
19019
+ let isGrandTotalTop = false;
19020
+ if (this.dataSourceSettings.grandTotalsPosition === 'Top' && this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showColumnGrandTotals) {
19021
+ let count = 0;
19022
+ for (let i = 0; i < members.length; i++) {
19023
+ if ((members[i].querySelector('Caption').textContent).indexOf('All') === 0) {
19024
+ count++;
19025
+ }
19026
+ }
19027
+ isGrandTotalTop = count === (this.olapValueAxis === 'column' ? this.dataSourceSettings.columns.length - 1 : this.dataSourceSettings.columns.length);
19028
+ }
19029
+ if (isStartCol || isGrandTotalTop) {
19030
+ if (allCount === 0 || isGrandTotalTop) {
18763
19031
  let levelComp = [-1, -1, -1];
18764
19032
  if (this.tupColumnInfo[tupPos - 1] && this.tupColumnInfo[tupPos - 1].allCount === 0) {
18765
19033
  levelComp = this.levelCompare(levelColl, this.tupColumnInfo[tupPos - 1].levelCollection);
@@ -18796,8 +19064,10 @@ class OlapEngine {
18796
19064
  }
18797
19065
  this.setParentCollection(members);
18798
19066
  if (withoutAllAvail ? (withoutAllEndPos <= drillStartPos) : true) {
18799
- this.totalCollection[this.totalCollection.length] =
18800
- ({ allCount: allCount, ordinal: tupPos, members: members, drillInfo: drillInfo });
19067
+ if (!isGrandTotalTop) {
19068
+ this.totalCollection[this.totalCollection.length] =
19069
+ ({ allCount: allCount, ordinal: tupPos, members: members, drillInfo: drillInfo });
19070
+ }
18801
19071
  lastSavedInfo.allCount = allCount;
18802
19072
  lastSavedInfo.allStartPos = allStartPos;
18803
19073
  lastSavedInfo.drillStartPos = drillStartPos;
@@ -18822,10 +19092,12 @@ class OlapEngine {
18822
19092
  }
18823
19093
  this.setParentCollection(members);
18824
19094
  if ((withoutAllAvail && drillStartPos > -1) ? (withoutAllEndPos <= drillStartPos) : true) {
18825
- this.totalCollection[this.totalCollection.length] =
18826
- ({
18827
- allCount: allCount, ordinal: tupPos, members: members, allStartPos: allStartPos, drillInfo: drillInfo
18828
- });
19095
+ if (!isGrandTotalTop) {
19096
+ this.totalCollection[this.totalCollection.length] =
19097
+ ({
19098
+ allCount: allCount, ordinal: tupPos, members: members, allStartPos: allStartPos, drillInfo: drillInfo
19099
+ });
19100
+ }
18829
19101
  lastSavedInfo.allCount = allCount;
18830
19102
  lastSavedInfo.allStartPos = allStartPos;
18831
19103
  lastSavedInfo.drillStartPos = drillStartPos;
@@ -19318,19 +19590,26 @@ class OlapEngine {
19318
19590
  }
19319
19591
  let newPos = 0;
19320
19592
  let totPos = 0;
19593
+ let valuePos = 0;
19321
19594
  gSumFlag = false;
19322
19595
  gSumGrouping = this.sortRowHeaders(gSumGrouping);
19323
19596
  for (let rPos = this.colDepth; rPos < rowCount; rPos++) {
19324
19597
  /* eslint-disable @typescript-eslint/dot-notation */
19598
+ if (this.dataSourceSettings.grandTotalsPosition === 'Top' && (this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showRowGrandTotals) &&
19599
+ ((this.olapValueAxis === 'column' && this.colDepth + 1 === rPos) || (this.olapValueAxis === 'row' && this.colDepth + this.dataSourceSettings.values.length + 1 === rPos))) {
19600
+ newPos = 0;
19601
+ gSumFlag = false;
19602
+ }
19325
19603
  let cell = gSumFlag ? gSumGrouping : sortLvlGrouping[levels[0]]['parent'];
19326
19604
  /* eslint-enable @typescript-eslint/dot-notation */
19327
- let currPos = gSumFlag ? (newPos - totPos) : newPos;
19605
+ let currPos = (this.dataSourceSettings.grandTotalsPosition === 'Top' && (this.dataSourceSettings.showGrandTotals && this.dataSourceSettings.showRowGrandTotals) && this.colDepth === rPos) ? cell.length : gSumFlag ? (newPos - totPos) : newPos;
19328
19606
  if (cell[currPos]) {
19329
19607
  this.pivotValues[rPos] = [cell[currPos]];
19330
19608
  this.pivotValues[rPos][0].rowIndex = rPos;
19331
- this.valueContent[newPos][0] = this.pivotValues[rPos][0];
19609
+ this.valueContent[valuePos][0] = this.pivotValues[rPos][0];
19332
19610
  }
19333
19611
  newPos++;
19612
+ valuePos++;
19334
19613
  if (this.pivotValues[rPos][0].type === 'grand sum') {
19335
19614
  gSumFlag = true;
19336
19615
  totPos = newPos;
@@ -21572,6 +21851,8 @@ let PivotView = class PivotView extends Component {
21572
21851
  this.request = new XMLHttpRequest();
21573
21852
  /** @hidden */
21574
21853
  this.isServerWaitingPopup = false;
21854
+ /** @hidden */
21855
+ this.actionObj = {};
21575
21856
  this.pivotView = this;
21576
21857
  setValue('mergePersistData', this.mergePersistPivotData, this);
21577
21858
  }
@@ -21613,10 +21894,10 @@ let PivotView = class PivotView extends Component {
21613
21894
  modules.push({ args: [this], member: 'grouping' });
21614
21895
  }
21615
21896
  if (this.allowDrillThrough || (this.editSettings && this.editSettings.allowEditing)) {
21616
- modules.push({ args: [this], member: 'drillthrough' });
21897
+ modules.push({ args: [this], member: 'drillThrough' });
21617
21898
  }
21618
21899
  if (this.displayOption.view !== 'Table') {
21619
- modules.push({ args: [this], member: 'pivotchart' });
21900
+ modules.push({ args: [this], member: 'pivotChart' });
21620
21901
  }
21621
21902
  return modules;
21622
21903
  }
@@ -22195,7 +22476,7 @@ let PivotView = class PivotView extends Component {
22195
22476
  this.setProperties({ gridSettings: { allowSelection: true, selectionSettings: { cellSelectionMode: 'Box', mode: 'Cell', type: 'Multiple' } } }, true);
22196
22477
  }
22197
22478
  if (this.displayOption.view !== 'Table') {
22198
- this.chartModule = new PivotChart();
22479
+ this.pivotChartModule = new PivotChart();
22199
22480
  }
22200
22481
  this.currentView = this.currentView ? this.currentView : (this.displayOption.view === 'Both' ?
22201
22482
  this.displayOption.primary : this.displayOption.view);
@@ -22460,32 +22741,37 @@ let PivotView = class PivotView extends Component {
22460
22741
  }
22461
22742
  }
22462
22743
  initialLoad() {
22463
- this.cellTemplateFn = this.templateParser(this.cellTemplate);
22464
- this.tooltipTemplateFn = this.templateParser(this.tooltipTemplate);
22465
- if (this.spinnerTemplate) {
22466
- createSpinner({ target: this.element, template: this.spinnerTemplate }, this.createElement);
22467
- }
22468
- else {
22469
- createSpinner({ target: this.element }, this.createElement);
22470
- }
22471
- let loadArgs = {
22472
- dataSourceSettings: this.dataSourceSettings,
22473
- pivotview: this,
22474
- fieldsType: {}
22475
- };
22476
- this.trigger(load, loadArgs, (observedArgs) => {
22477
- this.dataSourceSettings = observedArgs.dataSourceSettings;
22478
- this.fieldsType = observedArgs.fieldsType;
22479
- this.updateClass();
22480
- this.notify(initSubComponent, {});
22481
- if (this.dataSourceSettings.mode !== 'Server') {
22482
- this.notify(initialLoad, {});
22744
+ try {
22745
+ this.cellTemplateFn = this.templateParser(this.cellTemplate);
22746
+ this.tooltipTemplateFn = this.templateParser(this.tooltipTemplate);
22747
+ if (this.spinnerTemplate) {
22748
+ createSpinner({ target: this.element, template: this.spinnerTemplate }, this.createElement);
22483
22749
  }
22484
- if (this.isAdaptive) {
22485
- this.contextMenuModule.render();
22750
+ else {
22751
+ createSpinner({ target: this.element }, this.createElement);
22486
22752
  }
22487
- this.notify(initToolbar, {});
22488
- });
22753
+ let loadArgs = {
22754
+ dataSourceSettings: this.dataSourceSettings,
22755
+ pivotview: this,
22756
+ fieldsType: {}
22757
+ };
22758
+ this.trigger(load, loadArgs, (observedArgs) => {
22759
+ this.dataSourceSettings = observedArgs.dataSourceSettings;
22760
+ this.fieldsType = observedArgs.fieldsType;
22761
+ this.updateClass();
22762
+ this.notify(initSubComponent, {});
22763
+ if (this.dataSourceSettings.mode !== 'Server') {
22764
+ this.notify(initialLoad, {});
22765
+ }
22766
+ if (this.isAdaptive) {
22767
+ this.contextMenuModule.render();
22768
+ }
22769
+ this.notify(initToolbar, {});
22770
+ });
22771
+ }
22772
+ catch (execption) {
22773
+ this.actionFailureMethod(execption);
22774
+ }
22489
22775
  }
22490
22776
  /**
22491
22777
  * Register the internal events.
@@ -22516,12 +22802,32 @@ let PivotView = class PivotView extends Component {
22516
22802
  /* eslint-disable */
22517
22803
  let columnRender = this.gridSettings['columnRender'];
22518
22804
  let chartLoadEvent = this.chartSettings['load'];
22805
+ let chartLoadedEvent = this.chartSettings['loaded'];
22806
+ let chartTextRenderEvent = this.chartSettings['textRender'];
22807
+ let chartPointRenderEvent = this.chartSettings['pointRender'];
22808
+ let chartSeriesRenderEvent = this.chartSettings['seriesRender'];
22809
+ let chartLegendRenderEvent = this.chartSettings['legendRender'];
22810
+ let chartPointClickEvent = this.chartSettings['pointClick'];
22811
+ let chartTooltipRenderEvent = this.chartSettings['tooltipRender'];
22519
22812
  this.gridSettings['columnRender'] = undefined;
22520
22813
  this.chartSettings['tooltipRender'] = undefined;
22521
22814
  this.chartSettings['load'] = undefined;
22815
+ this.chartSettings['loaded'] = undefined;
22816
+ this.chartSettings['textRender'] = undefined;
22817
+ this.chartSettings['pointRender'] = undefined;
22818
+ this.chartSettings['seriesRender'] = undefined;
22819
+ this.chartSettings['legendRender'] = undefined;
22820
+ this.chartSettings['pointClick'] = undefined;
22522
22821
  let persistData = this.addOnPersist(keyEntity);
22523
22822
  this.gridSettings['columnRender'] = columnRender;
22524
22823
  this.chartSettings['load'] = chartLoadEvent;
22824
+ this.chartSettings['loaded'] = chartLoadedEvent;
22825
+ this.chartSettings['textRender'] = chartTextRenderEvent;
22826
+ this.chartSettings['pointRender'] = chartPointRenderEvent;
22827
+ this.chartSettings['seriesRender'] = chartSeriesRenderEvent;
22828
+ this.chartSettings['legendRender'] = chartLegendRenderEvent;
22829
+ this.chartSettings['pointClick'] = chartPointClickEvent;
22830
+ this.chartSettings['tooltipRender'] = chartTooltipRenderEvent;
22525
22831
  /* eslint-enable */
22526
22832
  return persistData;
22527
22833
  }
@@ -22703,15 +23009,15 @@ let PivotView = class PivotView extends Component {
22703
23009
  if (!this.grid && newProp.displayOption.view !== 'Chart') {
22704
23010
  this.renderEmptyGrid();
22705
23011
  if (newProp.displayOption.view === 'Table') {
22706
- if (this.chartModule) {
22707
- this.chartModule.destroy();
23012
+ if (this.pivotChartModule) {
23013
+ this.pivotChartModule.destroy();
22708
23014
  this.chart = undefined;
22709
- this.chartModule = undefined;
23015
+ this.pivotChartModule = undefined;
22710
23016
  }
22711
23017
  }
22712
23018
  }
22713
- else if (!this.chartModule && this.displayOption.view !== 'Table') {
22714
- this.chartModule = new PivotChart();
23019
+ else if (!this.pivotChartModule && this.displayOption.view !== 'Table') {
23020
+ this.pivotChartModule = new PivotChart();
22715
23021
  }
22716
23022
  }
22717
23023
  else if (this.showToolbar && !isNullOrUndefined(newProp.displayOption) && newProp.displayOption.view) {
@@ -22741,12 +23047,12 @@ let PivotView = class PivotView extends Component {
22741
23047
  (newProp.chartSettings.chartSeries && Object.keys(newProp.chartSettings.chartSeries).indexOf('type') !== -1))) {
22742
23048
  this.groupingBarModule.renderLayout();
22743
23049
  }
22744
- if (isNullOrUndefined(this.chartModule) && this.displayOption.view !== 'Table') {
22745
- this.chartModule = new PivotChart();
23050
+ if (isNullOrUndefined(this.pivotChartModule) && this.displayOption.view !== 'Table') {
23051
+ this.pivotChartModule = new PivotChart();
22746
23052
  }
22747
23053
  let engineModule = this.dataType === 'pivot' ? this.engineModule : this.olapEngineModule;
22748
- if (!isNullOrUndefined(this.chartModule) && !isNullOrUndefined(engineModule.pivotValues)) {
22749
- this.chartModule.loadChart(this, this.chartSettings);
23054
+ if (!isNullOrUndefined(this.pivotChartModule) && !isNullOrUndefined(engineModule.pivotValues)) {
23055
+ this.pivotChartModule.loadChart(this, this.chartSettings);
22750
23056
  }
22751
23057
  if (!isNullOrUndefined(engineModule.pivotValues) && !isNullOrUndefined(engineModule.fieldList)) {
22752
23058
  this.notify(uiUpdate, this);
@@ -22773,6 +23079,9 @@ let PivotView = class PivotView extends Component {
22773
23079
  if (this.element.querySelector('.e-grouping-bar')) {
22774
23080
  this.element.querySelector('.e-grouping-bar').remove();
22775
23081
  }
23082
+ else if (this.groupingBarModule) {
23083
+ this.groupingBarModule.renderLayout();
23084
+ }
22776
23085
  if (isNullOrUndefined(newProp.showFieldList))
22777
23086
  this.renderPivotGrid();
22778
23087
  break;
@@ -22866,9 +23175,9 @@ let PivotView = class PivotView extends Component {
22866
23175
  */
22867
23176
  renderPivotGrid() {
22868
23177
  this.clearTemplate();
22869
- if (this.chartModule) {
22870
- this.chartModule.engineModule = this.engineModule;
22871
- this.chartModule.loadChart(this, this.chartSettings);
23178
+ if (this.pivotChartModule) {
23179
+ this.pivotChartModule.engineModule = this.engineModule;
23180
+ this.pivotChartModule.loadChart(this, this.chartSettings);
22872
23181
  if (this.enableRtl && this.chart && document.body.getAttribute('dir') !== 'rtl') {
22873
23182
  addClass([this.chart.element], PIVOTCHART_LTR);
22874
23183
  }
@@ -22899,7 +23208,7 @@ let PivotView = class PivotView extends Component {
22899
23208
  this.applyHyperlinkSettings();
22900
23209
  }
22901
23210
  this.renderModule = this.renderModule ? this.renderModule : new Render(this);
22902
- this.renderModule.render();
23211
+ this.renderModule.render(true);
22903
23212
  }
22904
23213
  else if (this.grid) {
22905
23214
  remove(this.grid.element);
@@ -22915,7 +23224,9 @@ let PivotView = class PivotView extends Component {
22915
23224
  if (this.toolbarModule && this.toolbarModule.toolbar) {
22916
23225
  this.toolbarModule.toolbar.width = this.getGridWidthAsNumber() - 2;
22917
23226
  }
22918
- this.chart.element.style.width = formatUnit(this.getGridWidthAsNumber());
23227
+ if (this.chartSettings.enableScrollOnMultiAxis && this.chartSettings.enableMultipleAxis) {
23228
+ this.element.querySelector('.' + PIVOTCHART).style.width = formatUnit(this.getGridWidthAsNumber());
23229
+ }
22919
23230
  this.chart.width = formatUnit(this.getGridWidthAsNumber());
22920
23231
  if (this.currentView === 'Table') {
22921
23232
  this.grid.element.style.display = '';
@@ -22935,7 +23246,13 @@ let PivotView = class PivotView extends Component {
22935
23246
  }
22936
23247
  if (this.toolbarModule) {
22937
23248
  if (this.showFieldList && select('#' + this.element.id + '_PivotFieldList', this.element)) {
22938
- select('#' + this.element.id + '_PivotFieldList', this.element).style.display = 'none';
23249
+ if (this.toolbar && this.toolbar.indexOf('FieldList') !== -1) {
23250
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.display = 'none';
23251
+ }
23252
+ else {
23253
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.top = this.element.querySelector('.' + GRID_TOOLBAR).offsetHeight.toString() + 'px';
23254
+ select('#' + this.element.id + '_PivotFieldList', this.element).style.position = 'relative';
23255
+ }
22939
23256
  }
22940
23257
  if (this.toolbar && this.toolbar.indexOf('FieldList') !== -1 &&
22941
23258
  this.showToolbar && this.element.querySelector('.e-toggle-field-list')) {
@@ -23086,7 +23403,9 @@ let PivotView = class PivotView extends Component {
23086
23403
  isDrillThrough: (pivot.allowDrillThrough || pivot.editSettings.allowEditing),
23087
23404
  localeObj: pivot.localeObj,
23088
23405
  fieldsType: pivot.fieldsType,
23089
- clonedReport: pivot.clonedReport
23406
+ clonedReport: pivot.clonedReport,
23407
+ globalize: pivot.globalize,
23408
+ currenyCode: pivot.currencyCode
23090
23409
  };
23091
23410
  /* eslint-enable @typescript-eslint/indent */
23092
23411
  if (pivot.dataSourceSettings.mode === 'Server') {
@@ -23136,6 +23455,14 @@ let PivotView = class PivotView extends Component {
23136
23455
  this.exportType = 'Excel';
23137
23456
  this.grid.excelExport(excelExportProperties, isMultipleExport, workbook, isBlob);
23138
23457
  }
23458
+ this.actionObj.actionName = this.getActionCompleteName();
23459
+ let actionInfo = {
23460
+ exportInfo: { type: this.exportType, info: excelExportProperties }
23461
+ };
23462
+ this.actionObj.actionInfo = actionInfo;
23463
+ if (this.actionObj.actionName) {
23464
+ this.actionCompleteMethod();
23465
+ }
23139
23466
  }
23140
23467
  /**
23141
23468
  * Export PivotGrid data to CSV file.
@@ -23153,6 +23480,14 @@ let PivotView = class PivotView extends Component {
23153
23480
  this.exportType = 'CSV';
23154
23481
  this.grid.csvExport(excelExportProperties, isMultipleExport, workbook, isBlob);
23155
23482
  }
23483
+ this.actionObj.actionName = this.getActionCompleteName();
23484
+ let actionInfo = {
23485
+ exportInfo: { type: this.exportType, info: excelExportProperties }
23486
+ };
23487
+ this.actionObj.actionInfo = actionInfo;
23488
+ if (this.actionObj.actionName) {
23489
+ this.actionCompleteMethod();
23490
+ }
23156
23491
  }
23157
23492
  /**
23158
23493
  * Export Pivot widget data to PDF document.
@@ -23169,6 +23504,14 @@ let PivotView = class PivotView extends Component {
23169
23504
  else {
23170
23505
  this.grid.pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
23171
23506
  }
23507
+ this.actionObj.actionName = this.getActionCompleteName();
23508
+ let actionInfo = {
23509
+ exportInfo: { type: 'PDF', info: pdfExportProperties }
23510
+ };
23511
+ this.actionObj.actionInfo = actionInfo;
23512
+ if (this.actionObj.actionName) {
23513
+ this.actionCompleteMethod();
23514
+ }
23172
23515
  }
23173
23516
  /**
23174
23517
  * Export method for the chart.
@@ -23183,6 +23526,14 @@ let PivotView = class PivotView extends Component {
23183
23526
  if (this.chart && this.chart.enableExport) {
23184
23527
  this.chart.exportModule.export(type, fileName, orientation, null, width, height);
23185
23528
  }
23529
+ this.actionObj.actionName = this.getActionCompleteName();
23530
+ let actionInfo = {
23531
+ exportInfo: { type: type, info: fileName }
23532
+ };
23533
+ this.actionObj.actionInfo = actionInfo;
23534
+ if (this.actionObj.actionName) {
23535
+ this.actionCompleteMethod();
23536
+ }
23186
23537
  }
23187
23538
  /**
23188
23539
  * Print method for the chart.
@@ -23293,6 +23644,10 @@ let PivotView = class PivotView extends Component {
23293
23644
  };
23294
23645
  this.trigger(enginePopulated, eventArgs);
23295
23646
  pivot.engineModule.pivotValues = eventArgs.pivotValues;
23647
+ let actionInfo = {
23648
+ drillInfo: drilledItem
23649
+ };
23650
+ this.actionObj.actionInfo = actionInfo;
23296
23651
  pivot.renderPivotGrid();
23297
23652
  }
23298
23653
  else {
@@ -23640,6 +23995,12 @@ let PivotView = class PivotView extends Component {
23640
23995
  this.unwireEvents();
23641
23996
  this.wireEvents();
23642
23997
  this.isChartLoaded = false;
23998
+ this.actionObj.actionName = this.getActionCompleteName();
23999
+ if (this.actionObj.actionName) {
24000
+ if (this.actionObj.actionName !== windowResize) {
24001
+ this.actionCompleteMethod();
24002
+ }
24003
+ }
23643
24004
  }
23644
24005
  setToolTip(args) {
23645
24006
  let colIndex = Number(args.target.getAttribute('aria-colindex'));
@@ -23671,6 +24032,13 @@ let PivotView = class PivotView extends Component {
23671
24032
  if (cell && this.engineModule.fieldList[cell.actualText]) {
23672
24033
  let field = this.engineModule.fieldList[cell.actualText];
23673
24034
  aggregateType = field.aggregateType;
24035
+ if ((aggregateType !== 'DistinctCount') && (field.type !== 'number' || field.type === 'include' ||
24036
+ field.type === 'exclude')) {
24037
+ aggregateType = 'Count';
24038
+ }
24039
+ else {
24040
+ aggregateType = (aggregateType === undefined) ? 'Sum' : field.aggregateType;
24041
+ }
23674
24042
  caption = field.caption;
23675
24043
  hasField = true;
23676
24044
  }
@@ -23890,75 +24258,104 @@ let PivotView = class PivotView extends Component {
23890
24258
  ele = target.parentElement.parentElement;
23891
24259
  }
23892
24260
  this.CellClicked(target, e);
23893
- if ((ele.parentElement.parentElement.parentElement.parentElement.classList.contains('e-movableheader')
23894
- && this.dataSourceSettings.valueAxis === 'column') || (ele.parentElement.classList.contains('e-row') &&
23895
- this.dataSourceSettings.valueAxis === 'row') && (ele.classList.contains('e-rowsheader') ||
23896
- ele.classList.contains('e-stot'))) {
23897
- let colIndex = Number(ele.getAttribute('aria-colindex'));
23898
- let rowIndex = Number(ele.getAttribute('index'));
23899
- if (this.dataSourceSettings.valueAxis === 'row' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
23900
- let header = this.pivotValues[rowIndex][colIndex];
23901
- if (this.dataSourceSettings.valueIndex === -1) {
23902
- rowIndex = header.type === 'value' ? rowIndex : (rowIndex + 1);
23903
- }
23904
- else {
23905
- let level = this.getLevel(header);
23906
- rowIndex = (level <= this.engineModule.measureIndex &&
23907
- header.members && header.members.length > 0) ? header.members[0].rowIndex : rowIndex;
24261
+ try {
24262
+ if ((ele.parentElement.parentElement.parentElement.parentElement.classList.contains('e-movableheader')
24263
+ && this.dataSourceSettings.valueAxis === 'column') || (ele.parentElement.classList.contains('e-row') &&
24264
+ this.dataSourceSettings.valueAxis === 'row') && (ele.classList.contains('e-rowsheader') ||
24265
+ ele.classList.contains('e-stot'))) {
24266
+ let FieldName = target.parentElement.getAttribute('fieldname');
24267
+ let fieldInfo = PivotUtil.getFieldInfo(FieldName, this);
24268
+ this.actionObj.actionName = sortValue;
24269
+ this.actionObj.fieldInfo = fieldInfo.fieldItem;
24270
+ if (this.actionBeginMethod()) {
24271
+ return;
23908
24272
  }
23909
- }
23910
- else if (this.dataSourceSettings.valueAxis === 'column' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
23911
- colIndex = (Number(ele.getAttribute('aria-colindex')) + Number(ele.getAttribute('aria-colspan')) - 1);
23912
- rowIndex = this.engineModule.headerContent.length - 1;
23913
- }
23914
- this.setProperties({
23915
- dataSourceSettings: {
23916
- valueSortSettings: {
23917
- columnIndex: (Number(ele.getAttribute('aria-colindex')) +
23918
- Number(ele.getAttribute('aria-colspan')) - 1),
23919
- sortOrder: this.dataSourceSettings.valueSortSettings.sortOrder === 'Descending' ? 'Ascending' : 'Descending',
23920
- headerText: this.pivotValues[rowIndex][colIndex].valueSort.levelName,
23921
- headerDelimiter: this.dataSourceSettings.valueSortSettings.headerDelimiter ?
23922
- this.dataSourceSettings.valueSortSettings.headerDelimiter : '.'
24273
+ let colIndex = Number(ele.getAttribute('aria-colindex'));
24274
+ let rowIndex = Number(ele.getAttribute('index'));
24275
+ if (this.dataSourceSettings.valueAxis === 'row' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
24276
+ let header = this.pivotValues[rowIndex][colIndex];
24277
+ if (this.dataSourceSettings.valueIndex === -1) {
24278
+ rowIndex = header.type === 'value' ? rowIndex : (rowIndex + 1);
23923
24279
  }
23924
- }
23925
- }, true);
23926
- this.showWaitingPopup();
23927
- let pivot = this; /* eslint-disable-line */
23928
- pivot.engineModule.enableValueSorting = true;
23929
- if (pivot.enableVirtualization) {
23930
- if (pivot.dataSourceSettings.enableSorting) {
23931
- for (let key of Object.keys(pivot.engineModule.fieldList)) {
23932
- pivot.engineModule.fieldList[key].sort = 'Ascending';
24280
+ else {
24281
+ let level = this.getLevel(header);
24282
+ rowIndex = (level <= this.engineModule.measureIndex &&
24283
+ header.members && header.members.length > 0) ? header.members[0].rowIndex : rowIndex;
24284
+ }
24285
+ }
24286
+ else if (this.dataSourceSettings.valueAxis === 'column' && (this.dataSourceSettings.values.length > 1 || this.dataSourceSettings.alwaysShowValueHeader)) {
24287
+ colIndex = (Number(ele.getAttribute('aria-colindex')) + Number(ele.getAttribute('aria-colspan')) - 1);
24288
+ rowIndex = this.engineModule.headerContent.length - 1;
24289
+ }
24290
+ this.setProperties({
24291
+ dataSourceSettings: {
24292
+ valueSortSettings: {
24293
+ columnIndex: (Number(ele.getAttribute('aria-colindex')) +
24294
+ Number(ele.getAttribute('aria-colspan')) - 1),
24295
+ sortOrder: this.dataSourceSettings.valueSortSettings.sortOrder === 'Descending' ? 'Ascending' : 'Descending',
24296
+ headerText: this.pivotValues[rowIndex][colIndex].valueSort.levelName,
24297
+ headerDelimiter: this.dataSourceSettings.valueSortSettings.headerDelimiter ?
24298
+ this.dataSourceSettings.valueSortSettings.headerDelimiter : '.'
24299
+ }
24300
+ }
24301
+ }, true);
24302
+ this.showWaitingPopup();
24303
+ let pivot = this; /* eslint-disable-line */
24304
+ pivot.engineModule.enableValueSorting = true;
24305
+ if (pivot.enableVirtualization) {
24306
+ if (pivot.dataSourceSettings.enableSorting) {
24307
+ for (let key of Object.keys(pivot.engineModule.fieldList)) {
24308
+ pivot.engineModule.fieldList[key].sort = 'Ascending';
24309
+ }
24310
+ pivot.setProperties({ dataSourceSettings: { sortSettings: [] } }, true);
24311
+ }
24312
+ if (pivot.dataSourceSettings.mode === 'Server') {
24313
+ pivot.getEngine('onValueSort', null, null, null, null, null, null);
24314
+ }
24315
+ else {
24316
+ pivot.engineModule.rMembers = pivot.engineModule.headerCollection.rowHeaders;
24317
+ pivot.engineModule.cMembers = pivot.engineModule.headerCollection.columnHeaders;
24318
+ pivot.engineModule.applyValueSorting();
24319
+ pivot.engineModule.updateEngine();
23933
24320
  }
23934
- pivot.setProperties({ dataSourceSettings: { sortSettings: [] } }, true);
23935
24321
  }
23936
- if (pivot.dataSourceSettings.mode === 'Server') {
24322
+ else if (pivot.dataSourceSettings.mode === 'Server') {
23937
24323
  pivot.getEngine('onValueSort', null, null, null, null, null, null);
23938
24324
  }
23939
24325
  else {
23940
- pivot.engineModule.rMembers = pivot.engineModule.headerCollection.rowHeaders;
23941
- pivot.engineModule.cMembers = pivot.engineModule.headerCollection.columnHeaders;
23942
- pivot.engineModule.applyValueSorting();
23943
- pivot.engineModule.updateEngine();
24326
+ pivot.engineModule.generateGridData(pivot.dataSourceSettings, true);
23944
24327
  }
24328
+ pivot.allowServerDataBinding = false;
24329
+ pivot.setProperties({ pivotValues: pivot.engineModule.pivotValues }, true);
24330
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
24331
+ delete pivot.bulkChanges.pivotValues;
24332
+ pivot.allowServerDataBinding = true;
24333
+ let actionInfo = {
24334
+ valueSortInfo: this.engineModule.valueSortSettings
24335
+ };
24336
+ this.actionObj.actionInfo = actionInfo;
24337
+ pivot.renderPivotGrid();
23945
24338
  }
23946
- else if (pivot.dataSourceSettings.mode === 'Server') {
23947
- pivot.getEngine('onValueSort', null, null, null, null, null, null);
23948
- }
23949
- else {
23950
- pivot.engineModule.generateGridData(pivot.dataSourceSettings, true);
23951
- }
23952
- pivot.allowServerDataBinding = false;
23953
- pivot.setProperties({ pivotValues: pivot.engineModule.pivotValues }, true);
23954
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
23955
- delete pivot.bulkChanges.pivotValues;
23956
- pivot.allowServerDataBinding = true;
23957
- pivot.renderPivotGrid();
24339
+ }
24340
+ catch (execption) {
24341
+ this.actionFailureMethod(execption);
23958
24342
  }
23959
24343
  }
23960
24344
  else if (target.classList.contains(COLLAPSE) || target.classList.contains(EXPAND)) {
23961
- this.onDrill(target);
24345
+ let drillFieldName = target.parentElement.getAttribute('fieldname');
24346
+ let fieldInfo = PivotUtil.getFieldInfo(drillFieldName, this);
24347
+ let actionName = target.classList.contains(COLLAPSE) ? this.actionObj.actionName = drillUp : target.classList.contains(EXPAND) ? this.actionObj.actionName = drillDown : '';
24348
+ this.actionObj.actionName = actionName;
24349
+ this.actionObj.fieldInfo = fieldInfo.fieldItem;
24350
+ if (this.actionBeginMethod()) {
24351
+ return;
24352
+ }
24353
+ try {
24354
+ this.onDrill(target);
24355
+ }
24356
+ catch (execption) {
24357
+ this.actionFailureMethod(execption);
24358
+ }
23962
24359
  }
23963
24360
  else {
23964
24361
  this.CellClicked(target, e);
@@ -24056,7 +24453,8 @@ let PivotView = class PivotView extends Component {
24056
24453
  let firstColWidth = this.pivotColumns[0].width;
24057
24454
  let eventArgs = {
24058
24455
  columns: this.pivotColumns,
24059
- dataSourceSettings: this.dataSourceSettings
24456
+ dataSourceSettings: this.dataSourceSettings,
24457
+ stackedColumns: this.getStackedColumns(gridcolumns, [])
24060
24458
  };
24061
24459
  this.trigger(beforeColumnsRender, eventArgs);
24062
24460
  if (this.enableVirtualization && eventArgs.columns.length > 0 && eventArgs.columns[0].width !== gridcolumns[0].width) {
@@ -24160,8 +24558,16 @@ let PivotView = class PivotView extends Component {
24160
24558
  /* eslint-disable-next-line */
24161
24559
  /** @hidden */
24162
24560
  onWindowResize() {
24561
+ this.actionObj.actionName = windowResize;
24562
+ if (this.actionBeginMethod()) {
24563
+ return;
24564
+ }
24163
24565
  clearTimeout(this.timeOutObj);
24164
24566
  this.timeOutObj = setTimeout(this.layoutRefresh.bind(this), 500);
24567
+ this.actionObj.actionName = this.getActionCompleteName();
24568
+ if (this.actionObj.actionName) {
24569
+ this.actionCompleteMethod();
24570
+ }
24165
24571
  }
24166
24572
  /**
24167
24573
  * Refreshes the Pivot Table for blazor layoutRefresh is called for other base refresh is called.
@@ -24545,7 +24951,9 @@ let PivotView = class PivotView extends Component {
24545
24951
  isDrillThrough: (this.allowDrillThrough || this.editSettings.allowEditing),
24546
24952
  localeObj: this.localeObj,
24547
24953
  fieldsType: this.fieldsType,
24548
- clonedReport: this.clonedReport
24954
+ clonedReport: this.clonedReport,
24955
+ globalize: this.globalize,
24956
+ currenyCode: this.currencyCode
24549
24957
  };
24550
24958
  if (this.dataType === 'pivot') {
24551
24959
  if (this.dataSourceSettings.groupSettings && this.dataSourceSettings.groupSettings.length > 0) {
@@ -24771,7 +25179,8 @@ let PivotView = class PivotView extends Component {
24771
25179
  let str = 'color: ' + format[k].style.color + '!important;background-color: ' + format[k].style.backgroundColor +
24772
25180
  '!important;font-size: ' + format[k].style.fontSize + '!important;font-family: ' + format[k].style.fontFamily +
24773
25181
  ' !important;';
24774
- sheet.insertRule('.format' + this.element.id + k + '{' + str + '}', 0);
25182
+ let formatClass = '.format' + this.element.id + k;
25183
+ sheet.insertRule(formatClass + ', ' + formatClass + ' .e-cellvalue' + '{' + str + '}', 0);
24775
25184
  }
24776
25185
  }
24777
25186
  }
@@ -24997,6 +25406,64 @@ let PivotView = class PivotView extends Component {
24997
25406
  EventHandler.remove(document, this.isAdaptive ? 'touchend' : 'click', this.removeButtonFocus);
24998
25407
  window.removeEventListener('resize', this.onWindowResize.bind(this), true);
24999
25408
  }
25409
+ /** @hidden */
25410
+ actionBeginMethod() {
25411
+ let eventArgs = {
25412
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
25413
+ actionName: this.actionObj.actionName,
25414
+ fieldInfo: this.actionObj.fieldInfo,
25415
+ cancel: false
25416
+ };
25417
+ this.trigger(actionBegin, eventArgs);
25418
+ return eventArgs.cancel;
25419
+ }
25420
+ /** @hidden */
25421
+ actionCompleteMethod() {
25422
+ let eventArgs = {
25423
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
25424
+ actionName: this.actionObj.actionName,
25425
+ fieldInfo: this.actionObj.fieldInfo,
25426
+ actionInfo: this.actionObj.actionInfo
25427
+ };
25428
+ this.trigger(actionComplete, eventArgs);
25429
+ this.actionObj.actionName = '';
25430
+ this.actionObj.actionInfo = undefined;
25431
+ this.actionObj.fieldInfo = undefined;
25432
+ }
25433
+ /** @hidden */
25434
+ actionFailureMethod(error) {
25435
+ let eventArgs = {
25436
+ actionName: this.actionObj.actionName,
25437
+ errorInfo: error
25438
+ };
25439
+ this.trigger(actionFailure, eventArgs);
25440
+ }
25441
+ /** @hidden */
25442
+ getActionCompleteName() {
25443
+ let actionName = (this.actionObj.actionName == openConditionalFormatting) ? conditionallyFormatted : (this.actionObj.actionName == openNumberFormatting) ? numberFormatted
25444
+ : (this.actionObj.actionName == tableView) ? tableViewed : (this.actionObj.actionName == chartView) ? chartViewed : (this.actionObj.actionName == hideSubTotals) ? subTotalsHidden : (this.actionObj.actionName == subTotalsRow) ? subTotalsRowShown
25445
+ : (this.actionObj.actionName == subTotalsColumn) ? subTotalsColumnShown : (this.actionObj.actionName == showSubTotals) ? subTotalsShown : (this.actionObj.actionName == hideGrandTotals) ? grandTotalsHidden
25446
+ : (this.actionObj.actionName == grandTotalsRow) ? grandTotalsRowShown : (this.actionObj.actionName == grandTotalsColumn) ? grandTotalsColumnShown : (this.actionObj.actionName == showGrandTotals) ? grandTotalsShown
25447
+ : (this.actionObj.actionName == sortValue) ? valueSorted : (this.actionObj.actionName == openCalculatedField) ? calculatedFieldApplied : (this.actionObj.actionName == editCalculatedField) ? calculatedFieldEdited : (this.actionObj.actionName == sortField) ? fieldSorted
25448
+ : (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
25449
+ : this.actionObj.actionName == saveEditedRecords ? editedRecordsSaved : this.actionObj.actionName == addNewRecord ? newRecordAdded
25450
+ : this.actionObj.actionName == removeRecord ? recordRemoved : (this.actionObj.actionName == pngExport) ? pngExported : (this.actionObj.actionName == jpegExport) ? jpegExported
25451
+ : (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
25452
+ : this.actionObj.actionName == saveCurrentReport ? reportSaved : (this.actionObj.actionName == addNewReport) ? newReportAdded : (this.actionObj.actionName == saveAsCurrentReport) ? reportReSaved
25453
+ : (this.actionObj.actionName == renameCurrentReport) ? reportRenamed : this.actionObj.actionName;
25454
+ return actionName;
25455
+ }
25456
+ /* eslint-disable-next-line */
25457
+ /** @hidden */
25458
+ getStackedColumns(gridcolumns, stackedColumns) {
25459
+ for (let column of gridcolumns) {
25460
+ stackedColumns.push(column);
25461
+ if (column.columns && column.columns.length > 0) {
25462
+ this.getStackedColumns(column.columns, stackedColumns);
25463
+ }
25464
+ }
25465
+ return stackedColumns;
25466
+ }
25000
25467
  /**
25001
25468
  * To destroy the PivotView elements.
25002
25469
  * @returns {void}
@@ -25060,8 +25527,8 @@ let PivotView = class PivotView extends Component {
25060
25527
  if (this.commonModule) {
25061
25528
  this.commonModule.destroy();
25062
25529
  }
25063
- if (this.chartModule) {
25064
- this.chartModule.destroy();
25530
+ if (this.pivotChartModule) {
25531
+ this.pivotChartModule.destroy();
25065
25532
  }
25066
25533
  if (this.pivotButtonModule && !this.pivotButtonModule.isDestroyed) {
25067
25534
  this.pivotButtonModule.destroy();
@@ -25116,8 +25583,8 @@ let PivotView = class PivotView extends Component {
25116
25583
  if (this.commonModule) {
25117
25584
  this.commonModule = null;
25118
25585
  }
25119
- if (this.chartModule) {
25120
- this.chartModule = null;
25586
+ if (this.pivotChartModule) {
25587
+ this.pivotChartModule = null;
25121
25588
  }
25122
25589
  if (this.pivotButtonModule) {
25123
25590
  this.pivotButtonModule = null;
@@ -25137,6 +25604,12 @@ let PivotView = class PivotView extends Component {
25137
25604
  if (this.drillThroughModule) {
25138
25605
  this.drillThroughModule = null;
25139
25606
  }
25607
+ if (this.clonedDataSet) {
25608
+ this.clonedDataSet = null;
25609
+ }
25610
+ if (this.clonedReport) {
25611
+ this.clonedReport = null;
25612
+ }
25140
25613
  this.element.innerHTML = '';
25141
25614
  removeClass([this.element], ROOT);
25142
25615
  removeClass([this.element], RTL);
@@ -25480,6 +25953,15 @@ __decorate([
25480
25953
  __decorate([
25481
25954
  Event()
25482
25955
  ], PivotView.prototype, "beforeServiceInvoke", void 0);
25956
+ __decorate([
25957
+ Event()
25958
+ ], PivotView.prototype, "actionBegin", void 0);
25959
+ __decorate([
25960
+ Event()
25961
+ ], PivotView.prototype, "actionComplete", void 0);
25962
+ __decorate([
25963
+ Event()
25964
+ ], PivotView.prototype, "actionFailure", void 0);
25483
25965
  PivotView = __decorate([
25484
25966
  NotifyPropertyChanges
25485
25967
  ], PivotView);
@@ -25492,6 +25974,247 @@ PivotView = __decorate([
25492
25974
  * Renderer Export
25493
25975
  */
25494
25976
 
25977
+ /**
25978
+ * This is a file to perform common utility for OLAP and Relational datasource
25979
+ * @hidden
25980
+ */
25981
+ class PivotExportUtil {
25982
+ /* eslint-disable @typescript-eslint/no-explicit-any */
25983
+ static getDefinedObj(data) {
25984
+ let keyPos = 0;
25985
+ let framedSet = {};
25986
+ /* eslint-enable @typescript-eslint/no-explicit-any */
25987
+ if (!(data === null || data === undefined)) {
25988
+ let fields = Object.keys(data);
25989
+ while (keyPos < fields.length) {
25990
+ if (!(data[fields[keyPos]] === null || data[fields[keyPos]] === undefined)) {
25991
+ framedSet[fields[keyPos]] = data[fields[keyPos]];
25992
+ }
25993
+ keyPos++;
25994
+ }
25995
+ }
25996
+ else {
25997
+ framedSet = data;
25998
+ }
25999
+ return framedSet;
26000
+ }
26001
+ static getClonedPivotValues(pivotValues) {
26002
+ let clonedSets = [];
26003
+ for (let i = 0; i < pivotValues.length; i++) {
26004
+ if (pivotValues[i]) {
26005
+ clonedSets[i] = [];
26006
+ for (let j = 0; j < pivotValues[i].length; j++) {
26007
+ if (pivotValues[i][j]) {
26008
+ /* eslint-disable */
26009
+ clonedSets[i][j] = this.getClonedPivotValueObj(pivotValues[i][j]);
26010
+ /* eslint-enable */
26011
+ }
26012
+ }
26013
+ }
26014
+ }
26015
+ return clonedSets;
26016
+ }
26017
+ /* eslint-disable */
26018
+ static getClonedPivotValueObj(data) {
26019
+ /* eslint-enable */
26020
+ let keyPos = 0;
26021
+ /* eslint-disable @typescript-eslint/no-explicit-any */
26022
+ let framedSet = {};
26023
+ /* eslint-enable @typescript-eslint/no-explicit-any */
26024
+ if (!(data === null || data === undefined)) {
26025
+ let fields = Object.keys(data);
26026
+ while (keyPos < fields.length) {
26027
+ framedSet[fields[keyPos]] = data[fields[keyPos]];
26028
+ keyPos++;
26029
+ }
26030
+ }
26031
+ else {
26032
+ framedSet = data;
26033
+ }
26034
+ return framedSet;
26035
+ }
26036
+ /* eslint-disable */
26037
+ static isContainCommonElements(collection1, collection2) {
26038
+ /* eslint-enable */
26039
+ for (let i = 0, cnt = collection1.length; i < cnt; i++) {
26040
+ for (let j = 0, lnt = collection2.length; j < lnt; j++) {
26041
+ if (collection2[j] === collection1[i]) {
26042
+ return true;
26043
+ }
26044
+ }
26045
+ }
26046
+ return false;
26047
+ }
26048
+ /* eslint-disable */
26049
+ static formatPdfHeaderFooter(pdf) {
26050
+ let contents = [];
26051
+ if (!isNullOrUndefined(pdf)) {
26052
+ for (let i = 0; i < pdf.length; i++) {
26053
+ let a = pdf[i];
26054
+ let content = {
26055
+ /* eslint-enable */
26056
+ type: a.Type,
26057
+ pageNumberType: a.PageNumberType,
26058
+ style: a.Style ? {
26059
+ penColor: a.Style.PenColor,
26060
+ penSize: a.Style.PenSize,
26061
+ dashStyle: a.Style.DashStyle,
26062
+ textBrushColor: a.Style.TextBrushColor,
26063
+ textPenColor: a.Style.TextPenColor,
26064
+ fontSize: a.Style.FontSize,
26065
+ hAlign: a.Style.HAlign,
26066
+ vAlign: a.Style.VAlign
26067
+ } : a.Style,
26068
+ points: a.Points !== null ? {
26069
+ x1: a.Points.X1,
26070
+ y1: a.Points.Y1,
26071
+ x2: a.Points.X2,
26072
+ y2: a.Points.Y2
26073
+ } : null,
26074
+ format: a.Format,
26075
+ position: a.Position !== null ? {
26076
+ x: a.Position.X,
26077
+ y: a.Position.Y
26078
+ } : null,
26079
+ size: a.Size !== null ? {
26080
+ height: a.Size.Height,
26081
+ width: a.Size.Width
26082
+ } : null,
26083
+ src: a.Src,
26084
+ value: a.Value,
26085
+ font: a.Font
26086
+ };
26087
+ contents.push(content);
26088
+ }
26089
+ }
26090
+ return contents;
26091
+ }
26092
+ /* eslint-disable */
26093
+ static formatPdfExportProperties(pdf) {
26094
+ let values;
26095
+ /* eslint-enable */
26096
+ values = this.getDefinedObj({
26097
+ pageOrientation: typeof pdf.PageOrientation === 'string' ? pdf.PageOrientation : null,
26098
+ pageSize: typeof pdf.PageSize === 'string' ? pdf.PageSize : null,
26099
+ header: !isNullOrUndefined(pdf.Header) ? {
26100
+ fromTop: pdf.Header.FromTop,
26101
+ height: pdf.Header.Height,
26102
+ contents: this.formatPdfHeaderFooter(pdf.Header.Contents)
26103
+ } : null,
26104
+ columns: pdf.Columns,
26105
+ footer: !isNullOrUndefined(pdf.Footer) ? {
26106
+ fromTop: pdf.Footer.FromBottom,
26107
+ height: pdf.Footer.Height,
26108
+ contents: this.formatPdfHeaderFooter(pdf.Footer.Contents)
26109
+ } : null,
26110
+ includeHiddenColumn: pdf.IncludeHiddenColumn,
26111
+ dataSource: pdf.DataSource,
26112
+ exportType: typeof pdf.ExportType === 'string' ? pdf.ExportType : null,
26113
+ theme: !isNullOrUndefined(pdf.Theme) ? {
26114
+ header: pdf.Theme.Header,
26115
+ record: pdf.Theme.Record,
26116
+ caption: pdf.Theme.Caption
26117
+ } : null,
26118
+ fileName: pdf.FileName,
26119
+ hierarchyExportMode: typeof pdf.HierarchyExportMode === 'string' ? pdf.HierarchyExportMode : null,
26120
+ allowHorizontalOverflow: pdf.AllowHorizontalOverflow
26121
+ });
26122
+ return values;
26123
+ }
26124
+ /* eslint-disable */
26125
+ static formatExcelStyle(style) {
26126
+ let prop;
26127
+ /* eslint-enable */
26128
+ if (!isNullOrUndefined(style)) {
26129
+ prop = this.getDefinedObj({
26130
+ fontColor: style.FontColor,
26131
+ fontName: style.FontName,
26132
+ fontSize: style.FontSize,
26133
+ hAlign: style.HAlign === String ? style.HAlign : null,
26134
+ vAlign: style.VAlign === String ? style.VAlign : null,
26135
+ bold: style.Bold,
26136
+ indent: style.Indent,
26137
+ italic: style.Italic,
26138
+ underline: style.Underline,
26139
+ backColor: style.BackColor,
26140
+ wrapText: style.WrapText,
26141
+ borders: style.Borders,
26142
+ numberFormat: style.NumberFormat,
26143
+ type: style.Type
26144
+ });
26145
+ }
26146
+ return prop;
26147
+ }
26148
+ /* eslint-disable */
26149
+ static formatExcelCell(cell) {
26150
+ let cells = [];
26151
+ if (!isNullOrUndefined(cell)) {
26152
+ for (let i = 0; i < cell.length; i++) {
26153
+ this.getDefinedObj({
26154
+ index: !isNullOrUndefined(cell[i].Index) ? cell[i].Index : null,
26155
+ colSpan: !isNullOrUndefined(cell[i].ColSpan) ? cell[i].ColSpan : null,
26156
+ value: !isNullOrUndefined(cell[i].Value) ? cell[i].Value : null,
26157
+ hyperlink: {
26158
+ target: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.Target : null,
26159
+ displayText: !isNullOrUndefined(cell[i].Hyperlink) ? cell[i].Hyperlink.DisplayText : null
26160
+ },
26161
+ styles: this.formatExcelStyle(cell[i].Style),
26162
+ rowSpan: !isNullOrUndefined(cell[i].RowSpan) ? cell[i].RowSpan : null
26163
+ });
26164
+ /* eslint-enable */
26165
+ }
26166
+ }
26167
+ return cells;
26168
+ }
26169
+ /* eslint-disable */
26170
+ static formatExcelHeaderFooter(excel) {
26171
+ let rows = [];
26172
+ if (!isNullOrUndefined(excel)) {
26173
+ for (let i = 0; i < excel.Rows.length; i++) {
26174
+ let row = excel.Rows[i];
26175
+ let prop = this.getDefinedObj({
26176
+ index: !isNullOrUndefined(row.Index) ? row.Index : null,
26177
+ cells: this.formatExcelCell(row.Cells),
26178
+ grouping: !isNullOrUndefined(row.Grouping) ? row.Grouping : null
26179
+ });
26180
+ rows.push(prop);
26181
+ }
26182
+ }
26183
+ return rows;
26184
+ }
26185
+ static formatExcelExportProperties(excel) {
26186
+ /* eslint-enable */
26187
+ let prop;
26188
+ prop = this.getDefinedObj({
26189
+ dataSource: excel.DataSource,
26190
+ query: excel.Query,
26191
+ multipleExport: this.getDefinedObj({
26192
+ type: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.Type : null,
26193
+ blankRows: !isNullOrUndefined(excel.MultipleExport) ? excel.MultipleExport.BlankRows : null
26194
+ }),
26195
+ header: this.getDefinedObj({
26196
+ headerRows: !isNullOrUndefined(excel.Header) ? excel.Header.HeaderRows : null,
26197
+ rows: this.formatExcelHeaderFooter(excel.Header)
26198
+ }),
26199
+ footer: this.getDefinedObj({
26200
+ footerRows: !isNullOrUndefined(excel.Footer) ? excel.Footer.FooterRows : null,
26201
+ rows: this.formatExcelHeaderFooter(excel.Footer)
26202
+ }),
26203
+ columns: excel.Columns,
26204
+ exportType: typeof excel.ExportType === 'string' ? excel.ExportType : undefined,
26205
+ includeHiddenColumn: excel.IncludeHiddenColumn,
26206
+ theme: !isNullOrUndefined(excel.Theme) ? {
26207
+ header: this.formatExcelStyle(excel.Theme.Header),
26208
+ record: this.formatExcelStyle(excel.Theme.Record),
26209
+ caption: this.formatExcelStyle(excel.Theme.Caption)
26210
+ } : undefined,
26211
+ fileName: excel.FileName,
26212
+ hierarchyExportMode: typeof excel.HierarchyExportMode === 'string' ? excel.HierarchyExportMode : undefined
26213
+ });
26214
+ return prop;
26215
+ }
26216
+ }
26217
+
25495
26218
  /**
25496
26219
  * @hidden
25497
26220
  * `ExcelExport` module is used to handle the Excel export action.
@@ -25559,7 +26282,7 @@ class ExcelExport$1 {
25559
26282
  this.engine = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
25560
26283
  /** Event trigerring */
25561
26284
  let clonedValues;
25562
- let currentPivotValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26285
+ let currentPivotValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
25563
26286
  let customFileName = isFileNameSet ? exportProperties.fileName : 'default.xlsx';
25564
26287
  if (isHeaderSet) {
25565
26288
  this.addHeaderAndFooter(exportProperties.header, '', 'header', exportProperties.header.headerRows);
@@ -25569,7 +26292,7 @@ class ExcelExport$1 {
25569
26292
  this.engine.pageSettings = null;
25570
26293
  this.engine.generateGridData(this.parent.dataSourceSettings, true);
25571
26294
  this.parent.applyFormatting(this.engine.pivotValues);
25572
- clonedValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26295
+ clonedValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
25573
26296
  this.engine.pivotValues = currentPivotValues;
25574
26297
  this.engine.pageSettings = pageSettings;
25575
26298
  }
@@ -25613,15 +26336,17 @@ class ExcelExport$1 {
25613
26336
  let pivotCell = pivotValues[rCnt][cCnt];
25614
26337
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
25615
26338
  let cellValue = pivotCell.axis === 'value' ? pivotCell.value : pivotCell.formattedText;
25616
- if (pivotCell.type === 'grand sum') {
25617
- cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'grandTotal') :
25618
- this.parent.localeObj.getConstant('grandTotal');
26339
+ let isgetValuesHeader = ((this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row')
26340
+ || (this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column'));
26341
+ if (pivotCell.type === 'grand sum' && !(this.parent.dataSourceSettings.values.length === 1 && this.parent.dataSourceSettings.valueAxis === 'row' && pivotCell.axis === 'column')) {
26342
+ cellValue = isgetValuesHeader ? this.parent.getValuesHeader(pivotCell, 'grandTotal') : this.parent.localeObj.getConstant('grandTotal');
25619
26343
  }
25620
26344
  else if (pivotCell.type === 'sum') {
25621
26345
  cellValue = cellValue.toString().replace('Total', this.parent.localeObj.getConstant('total'));
25622
26346
  }
25623
26347
  else {
25624
- cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'value') : cellValue;
26348
+ cellValue = (!isNullOrUndefined(pivotCell.valueSort) && (this.parent.localeObj.getConstant('grandTotal') + this.parent.dataSourceSettings.valueSortSettings.headerDelimiter + pivotCell.formattedText
26349
+ === pivotCell.valueSort.levelName) && isgetValuesHeader) ? this.parent.getValuesHeader(pivotCell, 'value') : cellValue;
25625
26350
  }
25626
26351
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
25627
26352
  cells.push({
@@ -26133,13 +26858,13 @@ class PDFExport {
26133
26858
  applyEvent() {
26134
26859
  /** Event trigerring */
26135
26860
  let clonedValues;
26136
- let currentPivotValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26861
+ let currentPivotValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
26137
26862
  if (this.parent.exportAllPages && this.parent.enableVirtualization && this.parent.dataType !== 'olap') {
26138
26863
  let pageSettings = this.engine.pageSettings;
26139
26864
  this.engine.pageSettings = null;
26140
26865
  this.engine.generateGridData(this.parent.dataSourceSettings, true);
26141
26866
  this.parent.applyFormatting(this.engine.pivotValues);
26142
- clonedValues = PivotUtil.getClonedPivotValues(this.engine.pivotValues);
26867
+ clonedValues = PivotExportUtil.getClonedPivotValues(this.engine.pivotValues);
26143
26868
  this.engine.pivotValues = currentPivotValues;
26144
26869
  this.engine.pageSettings = pageSettings;
26145
26870
  }
@@ -26628,31 +27353,50 @@ class DialogRenderer {
26628
27353
  return axisWrapper;
26629
27354
  }
26630
27355
  showCalculatedField(event) {
26631
- if (!this.parent.isAdaptive) {
26632
- if (this.parent.dialogRenderer.fieldListDialog) {
26633
- this.parent.dialogRenderer.fieldListDialog.hide();
26634
- addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
27356
+ try {
27357
+ if (!this.parent.isAdaptive) {
27358
+ this.parent.actionObj.actionName = openCalculatedField;
27359
+ if (this.parent.actionBeginMethod()) {
27360
+ return;
27361
+ }
27362
+ if (this.parent.dialogRenderer.fieldListDialog) {
27363
+ this.parent.dialogRenderer.fieldListDialog.hide();
27364
+ addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
27365
+ }
26635
27366
  }
27367
+ this.parent.notify(initCalculatedField, {});
27368
+ }
27369
+ catch (execption) {
27370
+ this.parent.actionFailureMethod(execption);
26636
27371
  }
26637
- this.parent.notify(initCalculatedField, {});
26638
27372
  }
26639
27373
  showFieldListDialog(event) {
26640
27374
  let activeindex = this.adaptiveElement.selectedItem;
26641
27375
  this.parent.treeViewModule.render(activeindex);
26642
27376
  }
26643
27377
  onShowFieldList() {
26644
- if (this.parent.allowDeferLayoutUpdate) {
26645
- if (this.parent.isAdaptive) {
26646
- this.parent.axisFieldModule.render();
27378
+ this.parent.actionObj.actionName = showFieldList;
27379
+ if (this.parent.actionBeginMethod()) {
27380
+ return;
27381
+ }
27382
+ this.parent.actionObj.actionName = '';
27383
+ try {
27384
+ if (this.parent.allowDeferLayoutUpdate) {
27385
+ if (this.parent.isAdaptive) {
27386
+ this.parent.axisFieldModule.render();
27387
+ }
27388
+ this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
27389
+ this.parent.clonedFieldList = extend({}, this.parent.pivotFieldList, null, true);
26647
27390
  }
26648
- this.parent.clonedDataSource = extend({}, this.parent.dataSourceSettings, null, true);
26649
- this.parent.clonedFieldList = extend({}, this.parent.pivotFieldList, null, true);
27391
+ addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
27392
+ this.parent.dialogRenderer.fieldListDialog.show();
27393
+ this.parent.dialogRenderer.fieldListDialog.element.style.top =
27394
+ parseInt(this.parent.dialogRenderer.fieldListDialog.element.style.top, 10) < 0 ?
27395
+ '0px' : this.parent.dialogRenderer.fieldListDialog.element.style.top;
27396
+ }
27397
+ catch (execption) {
27398
+ this.parent.actionFailureMethod(execption);
26650
27399
  }
26651
- addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
26652
- this.parent.dialogRenderer.fieldListDialog.show();
26653
- this.parent.dialogRenderer.fieldListDialog.element.style.top =
26654
- parseInt(this.parent.dialogRenderer.fieldListDialog.element.style.top, 10) < 0 ?
26655
- '0px' : this.parent.dialogRenderer.fieldListDialog.element.style.top;
26656
27400
  }
26657
27401
  onCloseFieldList() {
26658
27402
  if (this.parent.allowDeferLayoutUpdate) {
@@ -26680,6 +27424,10 @@ class DialogRenderer {
26680
27424
  }
26681
27425
  }
26682
27426
  this.parent.dialogRenderer.fieldListDialog.hide();
27427
+ this.parent.actionObj.actionName = closeFieldlist;
27428
+ if (this.parent.actionObj.actionName) {
27429
+ this.parent.actionCompleteMethod();
27430
+ }
26683
27431
  }
26684
27432
  removeFieldListIcon() {
26685
27433
  if (this.parent.isAdaptive && this.parent.allowCalculatedField && this.parent.calculatedFieldModule) {
@@ -27555,28 +28303,41 @@ class TreeViewRenderer {
27555
28303
  updateSorting(args) {
27556
28304
  let target = args.target;
27557
28305
  let option = target.getAttribute('data-sort');
27558
- if (target.className.indexOf('e-selected') === -1) {
27559
- switch (option) {
27560
- case 'None':
27561
- this.fieldListSort = 'None';
27562
- addClass([target], 'e-selected');
27563
- removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
27564
- removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
27565
- break;
27566
- case 'Ascend':
27567
- this.fieldListSort = 'Ascend';
27568
- addClass([target], 'e-selected');
27569
- removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
27570
- removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
27571
- break;
27572
- case 'Descend':
27573
- this.fieldListSort = 'Descend';
27574
- addClass([target], 'e-selected');
27575
- removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
27576
- removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
27577
- break;
28306
+ this.parent.actionObj.actionName = sortFieldTree;
28307
+ if (this.parent.actionBeginMethod()) {
28308
+ return;
28309
+ }
28310
+ try {
28311
+ if (target.className.indexOf('e-selected') === -1) {
28312
+ switch (option) {
28313
+ case 'None':
28314
+ this.fieldListSort = 'None';
28315
+ addClass([target], 'e-selected');
28316
+ removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
28317
+ removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
28318
+ break;
28319
+ case 'Ascend':
28320
+ this.fieldListSort = 'Ascend';
28321
+ addClass([target], 'e-selected');
28322
+ removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
28323
+ removeClass([this.parentElement.querySelector('.e-sort-descend')], 'e-selected');
28324
+ break;
28325
+ case 'Descend':
28326
+ this.fieldListSort = 'Descend';
28327
+ addClass([target], 'e-selected');
28328
+ removeClass([this.parentElement.querySelector('.e-sort-ascend')], 'e-selected');
28329
+ removeClass([this.parentElement.querySelector('.e-sort-none')], 'e-selected');
28330
+ break;
28331
+ }
28332
+ this.refreshTreeView();
27578
28333
  }
27579
- this.refreshTreeView();
28334
+ }
28335
+ catch (execption) {
28336
+ this.parent.actionFailureMethod(execption);
28337
+ }
28338
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
28339
+ if (this.parent.actionObj.actionName) {
28340
+ this.parent.actionCompleteMethod();
27580
28341
  }
27581
28342
  }
27582
28343
  /* eslint-disable */
@@ -27938,7 +28699,7 @@ class PivotButton {
27938
28699
  attrs: { 'tabindex': '-1', 'aria-disabled': 'false', 'title': this.parent.localeObj.getConstant('editCalculatedField') },
27939
28700
  className: ICON + ' ' + CALC_EDIT
27940
28701
  });
27941
- if (this.parent.allowCalculatedField && this.parent.calculatedFieldModule && field[i].showEditIcon) {
28702
+ if (this.parent.allowCalculatedField && this.parent.calculatedFieldModule && (field[i].showEditIcon || field[i].showEditIcon === undefined)) {
27942
28703
  removeClass([calcElement], ICON_DISABLE);
27943
28704
  }
27944
28705
  else {
@@ -27951,7 +28712,7 @@ class PivotButton {
27951
28712
  className: ICON + ' ' + REMOVE_CLASS
27952
28713
  });
27953
28714
  if (this.parent.getModuleName() === 'pivotview') {
27954
- if ((this.parent.groupingBarSettings.showRemoveIcon && field[i].showRemoveIcon)) {
28715
+ if ((this.parent.groupingBarSettings.showRemoveIcon && (field[i].showRemoveIcon || field[i].showRemoveIcon === undefined))) {
27955
28716
  removeClass([removeElement], ICON_DISABLE);
27956
28717
  }
27957
28718
  else {
@@ -27959,7 +28720,7 @@ class PivotButton {
27959
28720
  }
27960
28721
  }
27961
28722
  else {
27962
- if (field[i].showRemoveIcon) {
28723
+ if (field[i].showRemoveIcon || field[i].showRemoveIcon === undefined) {
27963
28724
  removeClass([removeElement], ICON_DISABLE);
27964
28725
  }
27965
28726
  else {
@@ -27991,13 +28752,13 @@ class PivotButton {
27991
28752
  }
27992
28753
  if (axis === 'values') {
27993
28754
  for (let element of this.parentElement.querySelectorAll('.e-group-' + axis)) {
27994
- if (element.classList.contains(GROUP_CHART_VALUE) && this.parent.chartModule) {
28755
+ if (element.classList.contains(GROUP_CHART_VALUE) && this.parent.pivotChartModule) {
27995
28756
  let valueData = field.map((item) => { return { text: item.caption ? item.caption : item.name, value: item.name }; });
27996
28757
  let parent = this.parent;
27997
28758
  if (this.valueFiedDropDownList && element.querySelector('.' + GROUP_CHART_VALUE_DROPDOWN_DIV)) {
27998
28759
  this.valueFiedDropDownList.dataSource = valueData;
27999
28760
  this.valueFiedDropDownList.value = !parent.chartSettings.enableMultipleAxis ?
28000
- parent.chartModule.currentMeasure : valueData[0].value;
28761
+ parent.pivotChartModule.currentMeasure : valueData[0].value;
28001
28762
  }
28002
28763
  else {
28003
28764
  let ddlDiv = createElement('div', { className: GROUP_CHART_VALUE_DROPDOWN_DIV });
@@ -28007,7 +28768,7 @@ class PivotButton {
28007
28768
  enableRtl: this.parent.enableRtl,
28008
28769
  locale: this.parent.locale,
28009
28770
  value: !parent.chartSettings.enableMultipleAxis ?
28010
- parent.chartModule.currentMeasure : valueData[0].value,
28771
+ parent.pivotChartModule.currentMeasure : valueData[0].value,
28011
28772
  width: 200,
28012
28773
  fields: { value: 'value', text: 'text' },
28013
28774
  cssClass: GROUP_CHART_VALUE_DROPDOWN,
@@ -28026,14 +28787,14 @@ class PivotButton {
28026
28787
  else if (axis === 'columns') {
28027
28788
  let availColindex = undefined;
28028
28789
  for (let element of this.parentElement.querySelectorAll('.e-group-' + axis)) {
28029
- if (element.classList.contains(GROUP_CHART_COLUMN) && this.parent.chartModule) {
28030
- let currentMeasure = this.parent.chartModule.currentMeasure;
28790
+ if (element.classList.contains(GROUP_CHART_COLUMN) && this.parent.pivotChartModule) {
28791
+ let currentMeasure = this.parent.pivotChartModule.currentMeasure;
28031
28792
  let delimiter = this.parent.chartSettings.columnDelimiter ? this.parent.chartSettings.columnDelimiter : '-';
28032
28793
  let columnHeader = (this.parent.chartSettings.columnHeader && this.parent.chartSettings.columnHeader !== '') ?
28033
28794
  this.parent.chartSettings.columnHeader.split(delimiter).join(' - ') : '';
28034
28795
  let engineModule = this.parent.dataType === 'olap' ? this.parent.olapEngineModule : this.parent.engineModule;
28035
28796
  let pivotValues = engineModule.pivotValues;
28036
- let totColIndex = this.parent.chartModule.getColumnTotalIndex(pivotValues);
28797
+ let totColIndex = this.parent.pivotChartModule.getColumnTotalIndex(pivotValues);
28037
28798
  let rKeys = Object.keys(pivotValues);
28038
28799
  let columnData = [];
28039
28800
  let firstValueRow = false;
@@ -28143,7 +28904,7 @@ class PivotButton {
28143
28904
  },
28144
28905
  className: PIVOT_BUTTON_CONTENT_CLASS + ' ' +
28145
28906
  (this.parent.getModuleName() === 'pivotview' ?
28146
- this.parent.groupingBarSettings.allowDragAndDrop && field[i].allowDragAndDrop ? '' : DRAG_DISABLE_CLASS : ''),
28907
+ this.parent.groupingBarSettings.allowDragAndDrop && (field[i].allowDragAndDrop || field[i].allowDragAndDrop === undefined) ? '' : DRAG_DISABLE_CLASS : ''),
28147
28908
  innerHTML: axis === 'filters' ? (this.parent.dataType === 'olap' && engineModule.fieldList[field[i].name].type === 'CalculatedField') ?
28148
28909
  text : (text + ' (' + filterMem + ')') : (this.parent.dataType === 'olap' ?
28149
28910
  text : (!this.parent.dataSourceSettings.showAggregationOnValueField || axis !== 'values' || aggregation === 'CalculatedField' ?
@@ -28209,43 +28970,54 @@ class PivotButton {
28209
28970
  }
28210
28971
  openCalculatedFieldDialog(args) {
28211
28972
  let fieldName = args.target.parentElement.id;
28212
- if (this.parent.getModuleName() === 'pivotview') {
28213
- if (this.parent.isAdaptive && (this.parent.showFieldList &&
28214
- this.parent.pivotFieldListModule &&
28215
- !this.parent.pivotFieldListModule.isDestroyed)) {
28216
- this.parent.pivotFieldListModule.element
28217
- .querySelector('.' + TOGGLE_FIELD_LIST_CLASS).click();
28218
- this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4);
28219
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28220
- this.parent.pivotFieldListModule.calculatedFieldModule
28221
- .updateAdaptiveCalculatedField(true, fieldName);
28222
- }
28223
- else {
28224
- if (!this.parent.isAdaptive) {
28225
- this.parent.calculatedFieldModule.buttonCall = true;
28226
- }
28227
- this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28228
- }
28973
+ let fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
28974
+ this.parent.actionObj.actionName = editCalculatedField;
28975
+ this.parent.actionObj.fieldInfo = fieldInfo;
28976
+ if (this.parent.actionBeginMethod()) {
28977
+ return;
28229
28978
  }
28230
- else if (this.parent.getModuleName() === 'pivotfieldlist') {
28231
- if (this.parent.isAdaptive) {
28232
- this.parent.dialogRenderer.adaptiveElement.select(4);
28233
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28234
- this.parent.calculatedFieldModule
28235
- .updateAdaptiveCalculatedField(true, fieldName);
28236
- this.parent.calculatedFieldModule.buttonCall = true;
28237
- }
28238
- else {
28239
- if (this.parent.dialogRenderer.fieldListDialog) {
28240
- this.parent.dialogRenderer.fieldListDialog.hide();
28241
- addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
28979
+ try {
28980
+ if (this.parent.getModuleName() === 'pivotview') {
28981
+ if (this.parent.isAdaptive && (this.parent.showFieldList &&
28982
+ this.parent.pivotFieldListModule &&
28983
+ !this.parent.pivotFieldListModule.isDestroyed)) {
28984
+ this.parent.pivotFieldListModule.element
28985
+ .querySelector('.' + TOGGLE_FIELD_LIST_CLASS).click();
28986
+ this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4);
28987
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
28988
+ this.parent.pivotFieldListModule.calculatedFieldModule
28989
+ .updateAdaptiveCalculatedField(true, fieldName);
28242
28990
  }
28243
- this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28244
- if (this.parent.calculatedFieldModule) {
28991
+ else {
28992
+ if (!this.parent.isAdaptive) {
28993
+ this.parent.calculatedFieldModule.buttonCall = true;
28994
+ }
28995
+ this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
28996
+ }
28997
+ }
28998
+ else if (this.parent.getModuleName() === 'pivotfieldlist') {
28999
+ if (this.parent.isAdaptive) {
29000
+ this.parent.dialogRenderer.adaptiveElement.select(4);
29001
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
29002
+ this.parent.calculatedFieldModule
29003
+ .updateAdaptiveCalculatedField(true, fieldName);
28245
29004
  this.parent.calculatedFieldModule.buttonCall = true;
28246
29005
  }
29006
+ else {
29007
+ if (this.parent.dialogRenderer.fieldListDialog) {
29008
+ this.parent.dialogRenderer.fieldListDialog.hide();
29009
+ addClass([this.parent.element.querySelector('.' + TOGGLE_FIELD_LIST_CLASS)], ICON_HIDDEN);
29010
+ }
29011
+ this.parent.notify(initCalculatedField, { edit: true, fieldName: fieldName });
29012
+ if (this.parent.calculatedFieldModule) {
29013
+ this.parent.calculatedFieldModule.buttonCall = true;
29014
+ }
29015
+ }
28247
29016
  }
28248
29017
  }
29018
+ catch (execption) {
29019
+ this.parent.actionFailureMethod(execption);
29020
+ }
28249
29021
  }
28250
29022
  createDraggable(field, target) {
28251
29023
  this.draggable = new Draggable(target, {
@@ -28269,7 +29041,7 @@ class PivotButton {
28269
29041
  attrs: {
28270
29042
  'tabindex': '-1', 'aria-disabled': 'false', 'title': this.parent.localeObj.getConstant('drag')
28271
29043
  },
28272
- className: ICON + ' ' + DRAG_CLASS + ' ' + (field.allowDragAndDrop ? '' : DRAG_DISABLE_CLASS)
29044
+ className: ICON + ' ' + DRAG_CLASS + ' ' + ((field.allowDragAndDrop || field.allowDragAndDrop === undefined) ? '' : DRAG_DISABLE_CLASS)
28273
29045
  });
28274
29046
  dragWrapper.appendChild(dragElement);
28275
29047
  if (this.parent.getModuleName() === 'pivotfieldlist') {
@@ -28630,38 +29402,52 @@ class PivotButton {
28630
29402
  !(args.target.classList.contains(DRAG_CLASS)) &&
28631
29403
  (buttonElement && fieldInfo.fieldItem && (fieldInfo.fieldItem.showSortIcon ||
28632
29404
  isNullOrUndefined(fieldInfo.fieldItem.showSortIcon)))) {
28633
- if ((this.parent instanceof PivotFieldList || this.parent.groupingBarSettings.showSortIcon) &&
28634
- this.parent.dataSourceSettings.enableSorting &&
28635
- !(this.parent.dataType === 'olap' && ((this.parent.getModuleName() === 'pivotfieldlist' &&
28636
- this.parent.pivotGridModule !== undefined &&
28637
- this.parent.pivotGridModule.enableVirtualization) ||
28638
- (this.parent.getModuleName() === 'pivotview' && this.parent.enableVirtualization)))) {
28639
- if (((this.parent.getModuleName() === 'pivotview' && this.parent.enableValueSorting) ||
28640
- (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule !== undefined &&
28641
- this.parent.pivotGridModule.enableValueSorting))) {
28642
- if (this.parent.enableValueSorting || this.parent.pivotGridModule.enableValueSorting) { /* eslint-disable-line */
28643
- if (args.target.classList.contains('e-pivot-button')) {
28644
- if (args.target.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
28645
- this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: '' } } }, true);
29405
+ this.parent.actionObj.actionName = sortField;
29406
+ this.parent.actionObj.fieldInfo = fieldInfo;
29407
+ if (this.parent.actionBeginMethod()) {
29408
+ return;
29409
+ }
29410
+ try {
29411
+ if ((this.parent instanceof PivotFieldList || this.parent.groupingBarSettings.showSortIcon) &&
29412
+ this.parent.dataSourceSettings.enableSorting &&
29413
+ !(this.parent.dataType === 'olap' && ((this.parent.getModuleName() === 'pivotfieldlist' &&
29414
+ this.parent.pivotGridModule !== undefined &&
29415
+ this.parent.pivotGridModule.enableVirtualization) ||
29416
+ (this.parent.getModuleName() === 'pivotview' && this.parent.enableVirtualization)))) {
29417
+ if (((this.parent.getModuleName() === 'pivotview' && this.parent.enableValueSorting) ||
29418
+ (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule !== undefined &&
29419
+ this.parent.pivotGridModule.enableValueSorting))) {
29420
+ if (this.parent.enableValueSorting || this.parent.pivotGridModule.enableValueSorting) { /* eslint-disable-line */
29421
+ if (args.target.classList.contains('e-pivot-button')) {
29422
+ if (args.target.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
29423
+ this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: undefined } } }, true);
29424
+ }
28646
29425
  }
28647
- }
28648
- else {
28649
- if (args.target.parentElement.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
28650
- this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: '' } } }, true);
29426
+ else {
29427
+ if (args.target.parentElement.parentElement.getAttribute('data-tag').split(':')[0] === 'rows') {
29428
+ this.parent.setProperties({ dataSourceSettings: { valueSortSettings: { headerText: undefined } } }, true);
29429
+ }
28651
29430
  }
28652
29431
  }
28653
29432
  }
29433
+ this.parent.pivotCommon.eventBase.updateSorting(args);
29434
+ if (!this.parent.allowDeferLayoutUpdate || this.parent.getModuleName() !== 'pivotfieldlist') {
29435
+ let actionInfo = {
29436
+ sortInfo: this.parent.lastSortInfo
29437
+ };
29438
+ this.parent.actionObj.actionInfo = actionInfo;
29439
+ this.updateDataSource(true);
29440
+ }
29441
+ /* eslint-disable */
29442
+ let thisObj = this;
29443
+ /* eslint-enable */
29444
+ if (thisObj.parent instanceof PivotFieldList) {
29445
+ thisObj.axisField.render();
29446
+ }
28654
29447
  }
28655
- this.parent.pivotCommon.eventBase.updateSorting(args);
28656
- if (!this.parent.allowDeferLayoutUpdate || this.parent.getModuleName() !== 'pivotfieldlist') {
28657
- this.updateDataSource(true);
28658
- }
28659
- /* eslint-disable */
28660
- let thisObj = this;
28661
- /* eslint-enable */
28662
- if (thisObj.parent instanceof PivotFieldList) {
28663
- thisObj.axisField.render();
28664
- }
29448
+ }
29449
+ catch (execption) {
29450
+ this.parent.actionFailureMethod(execption);
28665
29451
  }
28666
29452
  }
28667
29453
  }
@@ -28693,26 +29479,37 @@ class PivotButton {
28693
29479
  updateFiltering(args) {
28694
29480
  /* eslint-disable */
28695
29481
  let pivotObj = this.parent.pivotGridModule ? this.parent.pivotGridModule : this.parent;
28696
- if (pivotObj.getModuleName() === 'pivotfieldlist') {
28697
- showSpinner(pivotObj.fieldListSpinnerElement);
28698
- }
28699
- else {
28700
- pivotObj.showWaitingPopup();
28701
- }
28702
- pivotObj.mouseEventArgs = args;
28703
- pivotObj.filterTargetID = this.parent.pivotCommon.moduleName !== 'pivotfieldlist' ?
28704
- this.parent.element : document.getElementById(this.parent.pivotCommon.parentID + '_Wrapper');
28705
29482
  let fieldName = args.target.parentElement.id;
28706
- if (pivotObj.dataSourceSettings.mode === 'Server') {
28707
- if (this.parent.engineModule.fieldList[fieldName].members && Object.keys(this.parent.engineModule.fieldList[fieldName].members).length > 0) {
28708
- this.updateFilterEvents();
29483
+ let fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
29484
+ this.parent.actionObj.actionName = filterField;
29485
+ this.parent.actionObj.fieldInfo = fieldInfo;
29486
+ if (this.parent.actionBeginMethod()) {
29487
+ return;
29488
+ }
29489
+ try {
29490
+ if (pivotObj.getModuleName() === 'pivotfieldlist') {
29491
+ showSpinner(pivotObj.fieldListSpinnerElement);
28709
29492
  }
28710
29493
  else {
28711
- pivotObj.getEngine('fetchFieldMembers', null, null, null, null, null, fieldName);
29494
+ pivotObj.showWaitingPopup();
29495
+ }
29496
+ pivotObj.mouseEventArgs = args;
29497
+ pivotObj.filterTargetID = this.parent.pivotCommon.moduleName !== 'pivotfieldlist' ?
29498
+ this.parent.element : document.getElementById(this.parent.pivotCommon.parentID + '_Wrapper');
29499
+ if (pivotObj.dataSourceSettings.mode === 'Server') {
29500
+ if (this.parent.engineModule.fieldList[fieldName].members && Object.keys(this.parent.engineModule.fieldList[fieldName].members).length > 0) {
29501
+ this.updateFilterEvents();
29502
+ }
29503
+ else {
29504
+ pivotObj.getEngine('fetchFieldMembers', null, null, null, null, null, fieldName);
29505
+ }
29506
+ }
29507
+ else {
29508
+ this.updateFilterEvents();
28712
29509
  }
28713
29510
  }
28714
- else {
28715
- this.updateFilterEvents();
29511
+ catch (execption) {
29512
+ this.parent.actionFailureMethod(execption);
28716
29513
  }
28717
29514
  /* eslint-enable */
28718
29515
  }
@@ -28725,11 +29522,6 @@ class PivotButton {
28725
29522
  let target = pivotObj.mouseEventArgs.target;
28726
29523
  this.fieldName = target.parentElement.id;
28727
29524
  if (this.parent.pivotCommon.filterDialog.dialogPopUp) {
28728
- this.dialogPopUp = this.parent.pivotCommon.filterDialog.dialogPopUp;
28729
- this.parent.pivotCommon.filterDialog.dialogPopUp.close = this.removeFilterDialog.bind(this);
28730
- // this.memberTreeView = this.parent.pivotCommon.filterDialog.memberTreeView;
28731
- // this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
28732
- // this.parent.pivotCommon.filterDialog.allMemberSelect.nodeChecked = this.nodeStateModified.bind(this);
28733
29525
  this.bindDialogEvents();
28734
29526
  }
28735
29527
  if (pivotObj.getModuleName() === 'pivotfieldlist') {
@@ -28743,8 +29535,8 @@ class PivotButton {
28743
29535
  if (this.parent.pivotCommon.filterDialog.allowExcelLikeFilter && this.parent.pivotCommon.filterDialog.tabObj) {
28744
29536
  this.index = this.parent.pivotCommon.filterDialog.tabObj.selectedItem;
28745
29537
  this.updateDialogButtonEvents();
28746
- this.dialogPopUp.buttons = this.buttonModel();
28747
- this.dialogPopUp.dataBind();
29538
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons = this.buttonModel();
29539
+ this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind();
28748
29540
  this.parent.pivotCommon.filterDialog.tabObj.selected = this.tabSelect.bind(this);
28749
29541
  }
28750
29542
  else if (this.parent.dataSourceSettings.allowMemberFilter) {
@@ -28769,7 +29561,7 @@ class PivotButton {
28769
29561
  click: (this.index === 0 ? this.updateFilterState.bind(this, this.fieldName) : this.updateCustomFilter.bind(this))
28770
29562
  },
28771
29563
  {
28772
- click: this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this),
29564
+ click: this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this.parent.pivotCommon.filterDialog),
28773
29565
  buttonModel: { cssClass: CANCEL_BUTTON_CLASS, content: this.parent.localeObj.getConstant('cancel') }
28774
29566
  }
28775
29567
  ];
@@ -28777,24 +29569,24 @@ class PivotButton {
28777
29569
  tabSelect(e) {
28778
29570
  this.index = e.selectedIndex;
28779
29571
  this.updateDialogButtonEvents();
28780
- removeClass([].slice.call(this.dialogPopUp.element.querySelectorAll('.e-selected-tab')), 'e-selected-tab');
29572
+ removeClass([].slice.call(this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelectorAll('.e-selected-tab')), 'e-selected-tab');
28781
29573
  if (e.selectedIndex > 0) {
28782
- 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');
29574
+ 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');
28783
29575
  }
28784
29576
  if (e.selectedIndex === 0) {
28785
29577
  this.parent.pivotCommon.filterDialog.updateCheckedState();
28786
29578
  }
28787
29579
  else {
28788
- this.dialogPopUp.buttons[0].buttonModel.disabled = false;
28789
- this.dialogPopUp.element.querySelector('.' + OK_BUTTON_CLASS).removeAttribute('disabled');
29580
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons[0].buttonModel.disabled = false;
29581
+ this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector('.' + OK_BUTTON_CLASS).removeAttribute('disabled');
28790
29582
  }
28791
29583
  }
28792
29584
  updateDialogButtonEvents() {
28793
- this.dialogPopUp.buttons = this.buttonModel();
28794
- this.dialogPopUp.dataBind();
29585
+ this.parent.pivotCommon.filterDialog.dialogPopUp.buttons = this.buttonModel();
29586
+ this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind();
28795
29587
  }
28796
29588
  updateCustomFilter(args) {
28797
- let dialogElement = this.dialogPopUp.element.querySelector('.e-selected-tab');
29589
+ let dialogElement = this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector('.e-selected-tab');
28798
29590
  let fieldName = dialogElement.getAttribute('data-fieldname');
28799
29591
  let levelName = dialogElement.getAttribute('data-selectedField');
28800
29592
  let filterType = dialogElement.getAttribute('data-type');
@@ -28864,38 +29656,18 @@ class PivotButton {
28864
29656
  if (type !== 'Value') {
28865
29657
  this.parent.lastFilterInfo = PivotUtil.getFilterItemByName(fieldName, this.parent.dataSourceSettings.filterSettings);
28866
29658
  }
28867
- this.dialogPopUp.close();
29659
+ this.parent.pivotCommon.filterDialog.dialogPopUp.close();
28868
29660
  if (!observedArgs.cancel) {
28869
29661
  this.refreshPivotButtonState(fieldName, true);
28870
29662
  this.updateDataSource(true);
28871
29663
  }
28872
29664
  });
28873
29665
  }
28874
- removeFilterDialog() {
28875
- if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
28876
- this.dialogPopUp.destroy();
28877
- setTimeout(this.setFocus.bind(this));
28878
- }
28879
- if (document.getElementById(this.parentElement.id + '_EditorTreeView')) {
28880
- remove(document.getElementById(this.parentElement.id + '_EditorTreeView'));
28881
- }
28882
- }
28883
- setFocus() {
28884
- if (this.parentElement) {
28885
- let pivotButtons = [].slice.call(this.parentElement.querySelectorAll('.e-pivot-button'));
28886
- for (let item of pivotButtons) {
28887
- if (item.getAttribute('data-uid') === this.fieldName) {
28888
- item.focus();
28889
- break;
28890
- }
28891
- }
28892
- }
28893
- }
28894
29666
  ClearFilter(e) {
28895
- let dialogElement = this.dialogPopUp.element;
29667
+ let dialogElement = this.parent.pivotCommon.filterDialog.dialogPopUp.element;
28896
29668
  let fieldName = dialogElement.getAttribute('data-fieldname');
28897
29669
  let tabElement = dialogElement.querySelector('.e-selected-tab');
28898
- this.dialogPopUp.close();
29670
+ this.parent.pivotCommon.filterDialog.dialogPopUp.close();
28899
29671
  if (this.parent.dataType === 'olap' && tabElement) {
28900
29672
  let levelName = tabElement.getAttribute('data-selectedField');
28901
29673
  this.removeDataSourceSettings(fieldName, levelName);
@@ -28911,63 +29683,73 @@ class PivotButton {
28911
29683
  let target = args.target;
28912
29684
  let fieldName = target.parentElement.id;
28913
29685
  let fieldInfo = PivotUtil.getFieldInfo(fieldName, this.parent);
29686
+ this.parent.actionObj.actionName = removeField;
29687
+ this.parent.actionObj.fieldInfo = fieldInfo;
29688
+ if (this.parent.actionBeginMethod()) {
29689
+ return;
29690
+ }
28914
29691
  let removeFieldArgs = {
28915
29692
  cancel: false, fieldName: fieldName,
28916
29693
  dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.parent.dataSourceSettings),
28917
29694
  fieldItem: fieldInfo.fieldItem, axis: fieldInfo.axis
28918
29695
  };
28919
- let control = this.parent.getModuleName() === 'pivotfieldlist' &&
28920
- this.parent.isPopupView ? this.parent.pivotGridModule : this.parent;
28921
- control.trigger(fieldRemove, removeFieldArgs, (observedArgs) => {
28922
- if (!observedArgs.cancel) {
28923
- if (target.parentElement.getAttribute('isvalue') === 'true') {
28924
- this.parent.setProperties({ dataSourceSettings: { values: [] } }, true);
28925
- if (this.parent.dataType === 'olap') {
28926
- this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
29696
+ try {
29697
+ let control = this.parent.getModuleName() === 'pivotfieldlist' &&
29698
+ this.parent.isPopupView ? this.parent.pivotGridModule : this.parent;
29699
+ control.trigger(fieldRemove, removeFieldArgs, (observedArgs) => {
29700
+ if (!observedArgs.cancel) {
29701
+ if (target.parentElement.getAttribute('isvalue') === 'true') {
29702
+ this.parent.setProperties({ dataSourceSettings: { values: [] } }, true);
29703
+ if (this.parent.dataType === 'olap') {
29704
+ this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
29705
+ }
28927
29706
  }
28928
- }
28929
- else {
28930
- this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(fieldName);
28931
- if (this.parent.dataType === 'pivot' && this.parent.showValuesButton && this.parent.dataSourceSettings.values.length > 1 &&
28932
- fieldInfo.position < this.parent.dataSourceSettings.valueIndex && ((this.parent.dataSourceSettings.valueAxis === 'row' &&
28933
- observedArgs.axis === 'rows') || (this.parent.dataSourceSettings.valueAxis === 'column' && observedArgs.axis === 'columns'))) {
28934
- this.parent.setProperties({ dataSourceSettings: { valueIndex: this.parent.dataSourceSettings.valueIndex - 1 } }, true);
29707
+ else {
29708
+ this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(fieldName);
29709
+ if (this.parent.dataType === 'pivot' && this.parent.showValuesButton && this.parent.dataSourceSettings.values.length > 1 &&
29710
+ fieldInfo.position < this.parent.dataSourceSettings.valueIndex && ((this.parent.dataSourceSettings.valueAxis === 'row' &&
29711
+ observedArgs.axis === 'rows') || (this.parent.dataSourceSettings.valueAxis === 'column' && observedArgs.axis === 'columns'))) {
29712
+ this.parent.setProperties({ dataSourceSettings: { valueIndex: this.parent.dataSourceSettings.valueIndex - 1 } }, true);
29713
+ }
29714
+ if (this.parent.dataType === 'olap' && this.parent.dataSourceSettings.values.length === 0) {
29715
+ this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
29716
+ }
28935
29717
  }
28936
- if (this.parent.dataType === 'olap' && this.parent.dataSourceSettings.values.length === 0) {
28937
- this.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport('[Measures]');
29718
+ if (this.parent.getModuleName() === 'pivotfieldlist') {
29719
+ this.parent.axisFieldModule.render();
28938
29720
  }
29721
+ this.updateDataSource();
28939
29722
  }
28940
- if (this.parent.getModuleName() === 'pivotfieldlist') {
28941
- this.parent.axisFieldModule.render();
28942
- }
28943
- this.updateDataSource();
28944
- }
28945
- });
29723
+ });
29724
+ }
29725
+ catch (execption) {
29726
+ this.parent.actionFailureMethod(execption);
29727
+ }
28946
29728
  }
28947
29729
  /** @hidden */
28948
29730
  nodeStateModified(args) {
28949
29731
  let target = closest(args.node, 'li');
28950
29732
  let fieldName = target.getAttribute('data-fieldname');
28951
29733
  if (target.getAttribute('data-memberId') === 'all') {
28952
- this.memberTreeView.nodeChecked = null;
29734
+ this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = null;
28953
29735
  if (args.action === 'check') {
28954
- this.memberTreeView.checkAll();
29736
+ this.parent.pivotCommon.filterDialog.memberTreeView.checkAll();
28955
29737
  }
28956
29738
  else {
28957
- this.memberTreeView.uncheckAll();
29739
+ this.parent.pivotCommon.filterDialog.memberTreeView.uncheckAll();
28958
29740
  }
28959
29741
  if (this.parent.dataType === 'olap' && this.parent.olapEngineModule &&
28960
29742
  !this.parent.olapEngineModule.fieldList[fieldName].isHierarchy) {
28961
- this.updateNodeStates(this.memberTreeView.getAllCheckedNodes(), fieldName, args.action);
29743
+ this.updateNodeStates(this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(), fieldName, args.action);
28962
29744
  }
28963
29745
  this.checkedStateAll(args.action);
28964
- this.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
29746
+ this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked = this.nodeStateModified.bind(this);
28965
29747
  }
28966
29748
  else {
28967
29749
  if (this.parent.dataType === 'olap' && this.parent.olapEngineModule &&
28968
29750
  !this.parent.olapEngineModule.fieldList[fieldName].isHierarchy) {
28969
29751
  // let st1: number = new Date().getTime();
28970
- let checkedNodes = this.memberTreeView.getAllCheckedNodes();
29752
+ let checkedNodes = this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes();
28971
29753
  // let st2: number = (new Date().getTime() - st1) / 1000;
28972
29754
  // console.log('getAllCheckedNodes:' + st2);
28973
29755
  this.updateNodeStates(checkedNodes, fieldName, args.action);
@@ -29007,8 +29789,8 @@ class PivotButton {
29007
29789
  }
29008
29790
  if (currentMembers[member]) {
29009
29791
  currentMembers[member].isSelected = false;
29010
- if (this.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]')) {
29011
- let element = this.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]');
29792
+ if (this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]')) {
29793
+ let element = this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + member + '"]');
29012
29794
  if (element && !element.querySelector('ul')) {
29013
29795
  this.parent.pivotCommon.eventBase.updateChildNodeStates(fieldList.filterMembers, fieldName, member, false);
29014
29796
  }
@@ -29017,8 +29799,8 @@ class PivotButton {
29017
29799
  }
29018
29800
  for (let node of checkedNodes) {
29019
29801
  if (currentMembers[node]) {
29020
- if (this.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]')) {
29021
- let element = this.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]');
29802
+ if (this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]')) {
29803
+ let element = this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="' + node + '"]');
29022
29804
  if (element && !element.querySelector('ul')) {
29023
29805
  currentMembers[node].isSelected = true;
29024
29806
  this.parent.pivotCommon.eventBase.updateChildNodeStates(fieldList.filterMembers, fieldName, node, true);
@@ -29053,10 +29835,10 @@ class PivotButton {
29053
29835
  !engineModule.fieldList[fieldName].isHierarchy) {
29054
29836
  let cMembers = engineModule.fieldList[fieldName].members;
29055
29837
  let sMembers = engineModule.fieldList[fieldName].currrentMembers;
29056
- filterItem.items = this.memberTreeView.getAllCheckedNodes();
29838
+ filterItem.items = this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes();
29057
29839
  filterItem.levelCount = engineModule.fieldList[fieldName].levelCount;
29058
29840
  isNodeUnChecked = (filterItem.items.length ===
29059
- this.memberTreeView.fields.dataSource.length ? false : true);
29841
+ this.parent.pivotCommon.filterDialog.memberTreeView.fields.dataSource.length ? false : true);
29060
29842
  if (engineModule.fieldList[fieldName].searchMembers.length > 0 && !isNodeUnChecked) {
29061
29843
  let cNodeLength = Object.keys(cMembers).length;
29062
29844
  let sNodeLength = Object.keys(sMembers).length;
@@ -29117,13 +29899,18 @@ class PivotButton {
29117
29899
  }
29118
29900
  this.parent.dataSourceSettings.filterSettings.push(filterItem);
29119
29901
  }
29120
- this.dialogPopUp.close();
29902
+ this.parent.pivotCommon.filterDialog.dialogPopUp.close();
29121
29903
  if (!observedArgs.cancel) {
29122
29904
  this.refreshPivotButtonState(fieldName, isNodeUnChecked);
29123
29905
  if (!isNodeUnChecked) {
29124
29906
  this.removeDataSourceSettings(fieldName);
29907
+ filterItem = {};
29125
29908
  }
29126
29909
  this.parent.lastFilterInfo = filterItem;
29910
+ let actionInfo = {
29911
+ filterInfo: this.parent.lastFilterInfo
29912
+ };
29913
+ this.parent.actionObj.actionInfo = actionInfo;
29127
29914
  this.updateDataSource(true);
29128
29915
  let thisObj = this;
29129
29916
  //setTimeout(() => {
@@ -29277,14 +30064,6 @@ class PivotButton {
29277
30064
  this.columnFieldDropDownList.destroy();
29278
30065
  this.columnFieldDropDownList = null;
29279
30066
  }
29280
- if (this.memberTreeView && !this.memberTreeView.isDestroyed) {
29281
- this.memberTreeView.destroy();
29282
- this.memberTreeView = null;
29283
- }
29284
- if (this.dialogPopUp && !this.dialogPopUp.isDestroyed) {
29285
- this.dialogPopUp.destroy();
29286
- this.dialogPopUp = null;
29287
- }
29288
30067
  if (this.draggable && !this.draggable.isDestroyed) {
29289
30068
  this.draggable.destroy();
29290
30069
  this.draggable = null;
@@ -29424,6 +30203,8 @@ let PivotFieldList = class PivotFieldList extends Component {
29424
30203
  this.enableValueSorting = false;
29425
30204
  this.request = new XMLHttpRequest();
29426
30205
  this.remoteData = [];
30206
+ /** @hidden */
30207
+ this.actionObj = {};
29427
30208
  }
29428
30209
  /**
29429
30210
  * To provide the array of modules needed for control rendering
@@ -29654,7 +30435,9 @@ let PivotFieldList = class PivotFieldList extends Component {
29654
30435
  enableValueSorting: enableValueSorting,
29655
30436
  isDrillThrough: isDrillThrough,
29656
30437
  localeObj: localeObj,
29657
- clonedReport: this.clonedReport
30438
+ clonedReport: this.clonedReport,
30439
+ globalize: this.globalize,
30440
+ currenyCode: this.currencyCode
29658
30441
  };
29659
30442
  }
29660
30443
  return customProperties;
@@ -30339,6 +31122,11 @@ let PivotFieldList = class PivotFieldList extends Component {
30339
31122
  pivot.pivotGridModule.fieldListSpinnerElement = pivot.fieldListSpinnerElement;
30340
31123
  }
30341
31124
  });
31125
+ let actionName = this.getActionCompleteName();
31126
+ this.actionObj.actionName = actionName;
31127
+ if (this.actionObj.actionName) {
31128
+ this.actionCompleteMethod();
31129
+ }
30342
31130
  }
30343
31131
  updateOlapDataSource(pivot, isSorted, isCalcChange, isOlapDataRefreshed) {
30344
31132
  let customProperties = pivot.frameCustomProperties(pivot.olapEngineModule.fieldListData, pivot.olapEngineModule.fieldList);
@@ -30372,6 +31160,7 @@ let PivotFieldList = class PivotFieldList extends Component {
30372
31160
  update(control) {
30373
31161
  if (control) {
30374
31162
  this.clonedDataSet = control.clonedDataSet;
31163
+ this.clonedReport = control.clonedReport;
30375
31164
  this.setProperties({ dataSourceSettings: control.dataSourceSettings, showValuesButton: control.showValuesButton }, true);
30376
31165
  this.engineModule = control.engineModule;
30377
31166
  this.olapEngineModule = control.olapEngineModule;
@@ -30406,6 +31195,7 @@ let PivotFieldList = class PivotFieldList extends Component {
30406
31195
  updateView(control) {
30407
31196
  if (control) {
30408
31197
  control.clonedDataSet = this.clonedDataSet;
31198
+ control.clonedReport = this.clonedReport;
30409
31199
  control.setProperties({ dataSourceSettings: this.dataSourceSettings, showValuesButton: this.showValuesButton }, true);
30410
31200
  control.engineModule = this.engineModule;
30411
31201
  control.olapEngineModule = this.olapEngineModule;
@@ -30448,6 +31238,47 @@ let PivotFieldList = class PivotFieldList extends Component {
30448
31238
  }
30449
31239
  });
30450
31240
  }
31241
+ /** @hidden */
31242
+ actionBeginMethod() {
31243
+ let eventArgs = {
31244
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
31245
+ actionName: this.actionObj.actionName,
31246
+ fieldInfo: this.actionObj.fieldInfo,
31247
+ cancel: false
31248
+ };
31249
+ let control = this.isPopupView ? this.pivotGridModule : this;
31250
+ control.trigger(actionBegin, eventArgs);
31251
+ return eventArgs.cancel;
31252
+ }
31253
+ /** @hidden */
31254
+ actionCompleteMethod() {
31255
+ let eventArgs = {
31256
+ dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.dataSourceSettings),
31257
+ actionName: this.actionObj.actionName,
31258
+ fieldInfo: this.actionObj.fieldInfo,
31259
+ actionInfo: this.actionObj.actionInfo
31260
+ };
31261
+ let control = this.isPopupView ? this.pivotGridModule : this;
31262
+ control.trigger(actionComplete, eventArgs);
31263
+ this.actionObj.actionName = '';
31264
+ this.actionObj.actionInfo = undefined;
31265
+ this.actionObj.fieldInfo = undefined;
31266
+ }
31267
+ /** @hidden */
31268
+ actionFailureMethod(error) {
31269
+ let eventArgs = {
31270
+ actionName: this.actionObj.actionName,
31271
+ errorInfo: error
31272
+ };
31273
+ let control = this.isPopupView ? this.pivotGridModule : this;
31274
+ control.trigger(actionFailure, eventArgs);
31275
+ }
31276
+ /** @hidden */
31277
+ getActionCompleteName() {
31278
+ let actionName = (this.actionObj.actionName == openCalculatedField) ? calculatedFieldApplied : (this.actionObj.actionName == editCalculatedField) ? calculatedFieldEdited : (this.actionObj.actionName == sortField) ? fieldSorted
31279
+ : (this.actionObj.actionName == filterField) ? fieldFiltered : (this.actionObj.actionName == removeField) ? fieldRemoved : (this.actionObj.actionName == aggregateField) ? fieldAggregated : this.actionObj.actionName == sortFieldTree ? fieldTreeSorted : this.actionObj.actionName;
31280
+ return actionName;
31281
+ }
30451
31282
  /**
30452
31283
  * Destroys the Field Table component.
30453
31284
  * @function destroy
@@ -30522,6 +31353,9 @@ let PivotFieldList = class PivotFieldList extends Component {
30522
31353
  if (this.clonedDataSet) {
30523
31354
  this.clonedDataSet = null;
30524
31355
  }
31356
+ if (this.clonedReport) {
31357
+ this.clonedReport = null;
31358
+ }
30525
31359
  if (this.clonedFieldList) {
30526
31360
  this.clonedFieldList = null;
30527
31361
  }
@@ -30570,6 +31404,9 @@ __decorate$4([
30570
31404
  __decorate$4([
30571
31405
  Property(['Sum', 'Count', 'DistinctCount', 'Product', 'Min', 'Max', 'Avg', 'Median', 'Index', 'PopulationVar', 'SampleVar', 'PopulationStDev', 'SampleStDev', 'RunningTotals', 'PercentageOfGrandTotal', 'PercentageOfColumnTotal', 'PercentageOfRowTotal', 'PercentageOfParentColumnTotal', 'PercentageOfParentRowTotal', 'DifferenceFrom', 'PercentageOfDifferenceFrom', 'PercentageOfParentTotal'])
30572
31406
  ], PivotFieldList.prototype, "aggregateTypes", void 0);
31407
+ __decorate$4([
31408
+ Property('USD')
31409
+ ], PivotFieldList.prototype, "currencyCode", void 0);
30573
31410
  __decorate$4([
30574
31411
  Event()
30575
31412
  ], PivotFieldList.prototype, "load", void 0);
@@ -30618,6 +31455,15 @@ __decorate$4([
30618
31455
  __decorate$4([
30619
31456
  Event()
30620
31457
  ], PivotFieldList.prototype, "beforeServiceInvoke", void 0);
31458
+ __decorate$4([
31459
+ Event()
31460
+ ], PivotFieldList.prototype, "actionBegin", void 0);
31461
+ __decorate$4([
31462
+ Event()
31463
+ ], PivotFieldList.prototype, "actionComplete", void 0);
31464
+ __decorate$4([
31465
+ Event()
31466
+ ], PivotFieldList.prototype, "actionFailure", void 0);
30621
31467
  PivotFieldList = __decorate$4([
30622
31468
  NotifyPropertyChanges
30623
31469
  ], PivotFieldList);
@@ -30850,105 +31696,114 @@ class CalculatedField {
30850
31696
  displayMenu(node, treeNode, target) {
30851
31697
  let edit = target ? target.classList.contains(CALC_EDIT) : true;
30852
31698
  let edited = target ? target.classList.contains(CALC_EDITED) : true;
30853
- if (this.parent.dataType === 'pivot' && node.querySelector('.e-list-icon.e-format') &&
30854
- node.querySelector('.e-list-icon.e-format').classList.contains(ICON) &&
30855
- !node.querySelector('.e-list-icon').classList.contains(CALC_EDITED) &&
30856
- !node.querySelector('.e-list-icon').classList.contains(GRID_REMOVE) &&
30857
- !node.querySelector('.e-list-icon').classList.contains(CALC_EDIT) && node.tagName === 'LI') {
30858
- if (this.menuObj && !this.menuObj.isDestroyed) {
30859
- this.menuObj.destroy();
30860
- }
30861
- this.curMenu = node.querySelector('.' + LIST_TEXT_CLASS);
30862
- this.openContextMenu(node);
30863
- }
30864
- else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDIT) &&
30865
- node.querySelector('.' + CALC_EDIT).classList.contains('e-list-icon') && edit ||
30866
- (this.parent.dataType === 'olap' && node.getAttribute('data-type') === CALC && node.classList.contains('e-active') && ((target && !target.classList.contains(GRID_REMOVE)) || !target)))) {
30867
- this.isEdit = true;
30868
- let fieldName = node.getAttribute('data-field');
30869
- let caption = node.getAttribute('data-caption');
30870
- this.currentFieldName = fieldName;
30871
- this.inputObj.value = caption;
30872
- this.inputObj.dataBind();
30873
- let formatString = node.getAttribute('data-formatString');
30874
- let dialogElement = this.dialog.element;
30875
- let customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
30876
- if (this.parent.dataType === 'olap') {
30877
- let memberType = node.getAttribute('data-membertype');
30878
- let parentHierarchy = node.getAttribute('data-hierarchy');
30879
- let expression = node.getAttribute('data-formula');
30880
- let customString = node.getAttribute('data-customString');
30881
- let fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
30882
- let memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
30883
- let hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
30884
- let formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
30885
- /* eslint-enable max-len */
30886
- fieldTitle.innerHTML = this.parent.localeObj.getConstant('caption');
30887
- select('#' + this.parentID + 'droppable', document).value = expression;
30888
- memberTypeDrop.readonly = true;
30889
- memberTypeDrop.value = memberType;
30890
- memberTypeDrop.dataBind();
30891
- if (memberType === 'Dimension') {
30892
- hierarchyDrop.value = parentHierarchy;
31699
+ try {
31700
+ if (this.parent.dataType === 'pivot' && node.querySelector('.e-list-icon.e-format') &&
31701
+ node.querySelector('.e-list-icon.e-format').classList.contains(ICON) &&
31702
+ !node.querySelector('.e-list-icon').classList.contains(CALC_EDITED) &&
31703
+ !node.querySelector('.e-list-icon').classList.contains(GRID_REMOVE) &&
31704
+ !node.querySelector('.e-list-icon').classList.contains(CALC_EDIT) && node.tagName === 'LI') {
31705
+ if (this.menuObj && !this.menuObj.isDestroyed) {
31706
+ this.menuObj.destroy();
31707
+ }
31708
+ this.curMenu = node.querySelector('.' + LIST_TEXT_CLASS);
31709
+ this.openContextMenu(node);
31710
+ }
31711
+ else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDIT) &&
31712
+ node.querySelector('.' + CALC_EDIT).classList.contains('e-list-icon') && edit ||
31713
+ (this.parent.dataType === 'olap' && node.getAttribute('data-type') === CALC && node.classList.contains('e-active') && ((target && !target.classList.contains(GRID_REMOVE)) || !target)))) {
31714
+ this.isEdit = true;
31715
+ let fieldName = node.getAttribute('data-field');
31716
+ let caption = node.getAttribute('data-caption');
31717
+ this.currentFieldName = fieldName;
31718
+ this.inputObj.value = caption;
31719
+ this.inputObj.dataBind();
31720
+ let formatString = node.getAttribute('data-formatString');
31721
+ let dialogElement = this.dialog.element;
31722
+ let customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
31723
+ if (this.parent.dataType === 'olap') {
31724
+ let memberType = node.getAttribute('data-membertype');
31725
+ let parentHierarchy = node.getAttribute('data-hierarchy');
31726
+ let expression = node.getAttribute('data-formula');
31727
+ let customString = node.getAttribute('data-customString');
31728
+ let fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
31729
+ let memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
31730
+ let hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
31731
+ let formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
31732
+ /* eslint-enable max-len */
31733
+ fieldTitle.innerHTML = this.parent.localeObj.getConstant('caption');
31734
+ select('#' + this.parentID + 'droppable', document).value = expression;
31735
+ memberTypeDrop.readonly = true;
31736
+ memberTypeDrop.value = memberType;
31737
+ memberTypeDrop.dataBind();
31738
+ if (memberType === 'Dimension') {
31739
+ hierarchyDrop.value = parentHierarchy;
31740
+ }
31741
+ if (formatString !== '') {
31742
+ formatDrop.value = formatString;
31743
+ formatDrop.dataBind();
31744
+ }
31745
+ customFormat.value = customString;
31746
+ }
31747
+ else {
31748
+ customFormat.value = formatString;
31749
+ addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
31750
+ removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
31751
+ addClass([node.querySelector('.e-list-icon')], CALC_EDITED);
31752
+ removeClass([node.querySelector('.e-list-icon')], CALC_EDIT);
31753
+ node.querySelector('.' + CALC_EDITED).setAttribute('title', this.parent.localeObj.getConstant('clearCalculatedField'));
31754
+ select('#' + this.parentID + 'droppable', document).value = node.getAttribute('data-uid');
30893
31755
  }
30894
- if (formatString !== '') {
30895
- formatDrop.value = formatString;
31756
+ customFormat.dataBind();
31757
+ }
31758
+ else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDITED) &&
31759
+ node.querySelector('.' + CALC_EDITED).classList.contains('e-list-icon') && edited ||
31760
+ (this.parent.dataType === 'olap' && !node.classList.contains('e-active')))) {
31761
+ this.isEdit = false;
31762
+ this.inputObj.value = '';
31763
+ this.inputObj.dataBind();
31764
+ let dialogElement = this.dialog.element;
31765
+ let customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
31766
+ customFormat.value = '';
31767
+ customFormat.dataBind();
31768
+ if (this.parent.dataType === 'olap') {
31769
+ let hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
31770
+ let formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
31771
+ let memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
31772
+ let fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
31773
+ /* eslint-enable max-len */
31774
+ fieldTitle.innerHTML = this.parent.localeObj.getConstant('fieldTitle');
31775
+ hierarchyDrop.index = 0;
31776
+ hierarchyDrop.dataBind();
31777
+ formatDrop.index = 0;
30896
31778
  formatDrop.dataBind();
31779
+ memberTypeDrop.index = 0;
31780
+ memberTypeDrop.readonly = false;
31781
+ memberTypeDrop.dataBind();
31782
+ }
31783
+ else {
31784
+ addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
31785
+ removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
31786
+ node.querySelector('.' + CALC_EDIT).setAttribute('title', this.parent.localeObj.getConstant('edit'));
30897
31787
  }
30898
- customFormat.value = customString;
31788
+ select('#' + this.parentID + 'droppable', document).value = '';
30899
31789
  }
30900
- else {
30901
- customFormat.value = formatString;
30902
- addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
30903
- removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
30904
- addClass([node.querySelector('.e-list-icon')], CALC_EDITED);
30905
- removeClass([node.querySelector('.e-list-icon')], CALC_EDIT);
30906
- node.querySelector('.' + CALC_EDITED).setAttribute('title', this.parent.localeObj.getConstant('clearCalculatedField'));
30907
- select('#' + this.parentID + 'droppable', document).value = node.getAttribute('data-uid');
31790
+ else if (node.tagName === 'LI' && (node.querySelector('.' + GRID_REMOVE) &&
31791
+ node.querySelector('.' + GRID_REMOVE).classList.contains('e-list-icon')) && !edit && !edited) {
31792
+ this.parent.actionObj.actionName = removeField;
31793
+ if (this.parent.actionBeginMethod()) {
31794
+ return;
31795
+ }
31796
+ let dropField = select('#' + this.parentID + 'droppable', document);
31797
+ let field = {
31798
+ name: this.isEdit ? this.currentFieldName : this.inputObj.value,
31799
+ caption: this.inputObj.value,
31800
+ formula: dropField.value
31801
+ };
31802
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeCalculatedField'), field, true, treeNode);
30908
31803
  }
30909
- customFormat.dataBind();
30910
31804
  }
30911
- else if (node.tagName === 'LI' && (node.querySelector('.' + CALC_EDITED) &&
30912
- node.querySelector('.' + CALC_EDITED).classList.contains('e-list-icon') && edited ||
30913
- (this.parent.dataType === 'olap' && !node.classList.contains('e-active')))) {
30914
- this.isEdit = false;
30915
- this.inputObj.value = '';
30916
- this.inputObj.dataBind();
30917
- let dialogElement = this.dialog.element;
30918
- let customFormat = getInstance(select('#' + this.parentID + 'Custom_Format_Element', dialogElement), MaskedTextBox);
30919
- customFormat.value = '';
30920
- customFormat.dataBind();
30921
- if (this.parent.dataType === 'olap') {
30922
- let hierarchyDrop = getInstance(select('#' + this.parentID + 'Hierarchy_List_Div', dialogElement), DropDownList);
30923
- let formatDrop = getInstance(select('#' + this.parentID + 'Format_Div', dialogElement), DropDownList);
30924
- let memberTypeDrop = getInstance(select('#' + this.parentID + 'Member_Type_Div', dialogElement), DropDownList);
30925
- let fieldTitle = select('#' + this.parentID + '_' + 'FieldNameTitle', dialogElement);
30926
- /* eslint-enable max-len */
30927
- fieldTitle.innerHTML = this.parent.localeObj.getConstant('fieldTitle');
30928
- hierarchyDrop.index = 0;
30929
- hierarchyDrop.dataBind();
30930
- formatDrop.index = 0;
30931
- formatDrop.dataBind();
30932
- memberTypeDrop.index = 0;
30933
- memberTypeDrop.readonly = false;
30934
- memberTypeDrop.dataBind();
30935
- }
30936
- else {
30937
- addClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDIT);
30938
- removeClass(this.treeObj.element.querySelectorAll('.' + CALC_EDITED), CALC_EDITED);
30939
- node.querySelector('.' + CALC_EDIT).setAttribute('title', this.parent.localeObj.getConstant('edit'));
30940
- }
30941
- select('#' + this.parentID + 'droppable', document).value = '';
30942
- }
30943
- else if (node.tagName === 'LI' && (node.querySelector('.' + GRID_REMOVE) &&
30944
- node.querySelector('.' + GRID_REMOVE).classList.contains('e-list-icon')) && !edit && !edited) {
30945
- let dropField = select('#' + this.parentID + 'droppable', document);
30946
- let field = {
30947
- name: this.isEdit ? this.currentFieldName : this.inputObj.value,
30948
- caption: this.inputObj.value,
30949
- formula: dropField.value
30950
- };
30951
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeCalculatedField'), field, true, treeNode);
31805
+ catch (execption) {
31806
+ this.parent.actionFailureMethod(execption);
30952
31807
  }
30953
31808
  }
30954
31809
  removeCalcField(node) {
@@ -31357,6 +32212,12 @@ class CalculatedField {
31357
32212
  this.parent.isRequiredUpdate = false;
31358
32213
  }
31359
32214
  try {
32215
+ let actionInfo = {
32216
+ calculatedFieldInfo: this.parent.lastCalcFieldInfo
32217
+ };
32218
+ this.parent.actionObj.actionInfo = actionInfo;
32219
+ let actionName = (this.parent.actionObj.actionName == editCalculatedField) ? calculatedFieldEdited : calculatedFieldApplied;
32220
+ this.parent.actionObj.actionName = actionName;
31360
32221
  this.parent.updateDataSource(false);
31361
32222
  let pivot = (this.parent.getModuleName() === 'pivotfieldlist' && this.parent.pivotGridModule) ?
31362
32223
  this.parent.pivotGridModule : this.parent;
@@ -32798,7 +33659,7 @@ class FieldList {
32798
33659
  update() {
32799
33660
  let currentWidth;
32800
33661
  if (this.parent.currentView !== 'Table') {
32801
- currentWidth = this.parent.chart ? this.parent.chartModule.getCalulatedWidth() : currentWidth;
33662
+ currentWidth = this.parent.chart ? this.parent.pivotChartModule.getCalulatedWidth() : currentWidth;
32802
33663
  }
32803
33664
  else {
32804
33665
  currentWidth = this.parent.grid ? this.parent.grid.element.offsetWidth : currentWidth;
@@ -33267,7 +34128,7 @@ class GroupingBar {
33267
34128
  currentWidth = this.parent.grid ? this.parent.grid.element.offsetWidth : currentWidth;
33268
34129
  }
33269
34130
  else {
33270
- currentWidth = this.parent.chart ? this.parent.chartModule.getCalulatedWidth() : currentWidth;
34131
+ currentWidth = this.parent.chart ? this.parent.pivotChartModule.getCalulatedWidth() : currentWidth;
33271
34132
  }
33272
34133
  if (currentWidth) {
33273
34134
  let actWidth = currentWidth < 400 ? 400 : currentWidth;
@@ -33537,15 +34398,17 @@ class ConditionalFormatting {
33537
34398
  },
33538
34399
  {
33539
34400
  click: this.applyButtonClick.bind(this),
34401
+ isFlat: true,
33540
34402
  buttonModel: {
33541
- cssClass: FLAT_CLASS + ' ' + FORMAT_APPLY_BUTTON,
34403
+ isPrimary: true, cssClass: FORMAT_APPLY_BUTTON,
33542
34404
  content: this.parent.localeObj.getConstant('apply')
33543
34405
  }
33544
34406
  },
33545
34407
  {
33546
34408
  click: this.cancelButtonClick.bind(this),
34409
+ isFlat: true,
33547
34410
  buttonModel: {
33548
- cssClass: FLAT_CLASS + ' ' + FORMAT_CANCEL_BUTTON,
34411
+ cssClass: FORMAT_CANCEL_BUTTON,
33549
34412
  content: this.parent.localeObj.getConstant('cancel')
33550
34413
  }
33551
34414
  }
@@ -33598,6 +34461,10 @@ class ConditionalFormatting {
33598
34461
  applyButtonClick() {
33599
34462
  if (this.refreshConditionValues()) {
33600
34463
  this.parent.setProperties({ dataSourceSettings: { conditionalFormatSettings: this.newFormat } }, true);
34464
+ let actionInfo = {
34465
+ conditionalFormattingInfo: this.parent.dataSourceSettings.conditionalFormatSettings
34466
+ };
34467
+ this.parent.actionObj.actionInfo = actionInfo;
33601
34468
  this.parent.renderPivotGrid();
33602
34469
  this.dialog.close();
33603
34470
  }
@@ -34294,12 +35161,22 @@ class Toolbar$2 {
34294
35161
  }
34295
35162
  /* eslint-enable */
34296
35163
  reportChange(args) {
34297
- this.dropArgs = args;
34298
- if (this.parent.isModified && this.currentReport !== '') {
34299
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
35164
+ this.parent.actionObj.actionName = reportChange;
35165
+ if (this.parent.actionBeginMethod()) {
35166
+ args.cancel = true;
35167
+ return;
34300
35168
  }
34301
- else {
34302
- this.reportLoad(args);
35169
+ try {
35170
+ this.dropArgs = args;
35171
+ if (this.parent.isModified && this.currentReport !== '') {
35172
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
35173
+ }
35174
+ else {
35175
+ this.reportLoad(args);
35176
+ }
35177
+ }
35178
+ catch (execption) {
35179
+ this.parent.actionFailureMethod(execption);
34303
35180
  }
34304
35181
  }
34305
35182
  reportLoad(args) {
@@ -34307,6 +35184,10 @@ class Toolbar$2 {
34307
35184
  let loadArgs = {
34308
35185
  reportName: args.itemData.value
34309
35186
  };
35187
+ let actionInfo = {
35188
+ reportName: args.itemData.value
35189
+ };
35190
+ this.parent.actionObj.actionInfo = actionInfo;
34310
35191
  this.parent.trigger(loadReport, loadArgs, (observedArgs) => {
34311
35192
  this.currentReport = observedArgs.reportName;
34312
35193
  this.parent.isModified = false;
@@ -34319,7 +35200,15 @@ class Toolbar$2 {
34319
35200
  report: this.parent.getPersistData(),
34320
35201
  reportName: this.currentReport
34321
35202
  };
35203
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
35204
+ let actionInfo = {
35205
+ reportName: this.currentReport
35206
+ };
35207
+ this.parent.actionObj.actionInfo = actionInfo;
34322
35208
  this.parent.trigger(saveReport, saveArgs);
35209
+ if (this.parent.actionObj.actionName) {
35210
+ this.parent.actionCompleteMethod();
35211
+ }
34323
35212
  this.parent.isModified = false;
34324
35213
  }
34325
35214
  else if (this.currentReport === '' && (args.item.id === (this.parent.element.id + 'save') || args.item.id === (this.parent.element.id + 'saveas'))) {
@@ -34383,54 +35272,67 @@ class Toolbar$2 {
34383
35272
  }
34384
35273
  }
34385
35274
  actionClick(args) {
34386
- switch (args.item.id) {
34387
- case (this.parent.element.id + 'save'):
34388
- case (this.parent.element.id + 'saveas'):
34389
- this.saveReport(args);
34390
- break;
34391
- case (this.parent.element.id + 'remove'):
34392
- this.action = 'Remove';
34393
- if (this.currentReport && this.currentReport !== '') {
34394
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeConfirm'));
34395
- }
34396
- else {
34397
- this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant('error'), this.parent.localeObj.getConstant('emptyReport'));
34398
- }
34399
- return;
34400
- case (this.parent.element.id + 'rename'):
34401
- this.renameReport(args);
34402
- break;
34403
- case (this.parent.element.id + 'new'):
34404
- this.action = 'New';
34405
- this.newArgs = args;
34406
- if (this.parent.isModified && this.currentReport && this.currentReport !== '') {
34407
- this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
34408
- }
34409
- else {
34410
- this.createNewReport(args);
34411
- }
34412
- break;
34413
- case (this.parent.element.id + 'load'):
34414
- this.action = 'Load';
34415
- break;
34416
- case (this.parent.element.id + 'fieldlist'):
34417
- if (this.parent.pivotFieldListModule && this.parent.pivotFieldListModule.dialogRenderer) {
34418
- this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.show();
34419
- }
34420
- break;
34421
- case (this.parent.element.id + 'formatting'):
34422
- if (this.parent.conditionalFormattingModule) {
34423
- this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
34424
- }
34425
- break;
34426
- case (this.parent.element.id + 'mdxQuery'):
34427
- this.mdxQueryDialog(args);
34428
- break;
34429
- case (this.parent.element.id + 'numberFormatting'):
34430
- if (this.parent.numberFormattingModule) {
34431
- this.parent.numberFormattingModule.showNumberFormattingDialog();
34432
- }
34433
- break;
35275
+ let actionName = (args.item.id == "PivotViewnew") ? addNewReport : (args.item.id == "PivotViewsave") ? saveCurrentReport : (args.item.id == "PivotViewsaveas") ? saveAsCurrentReport
35276
+ : (args.item.id == "PivotViewrename") ? renameCurrentReport : (args.item.id == "PivotViewremove") ? removeCurrentReport : (args.item.id == "PivotViewload") ? loadReports
35277
+ : (args.item.id == "PivotViewformatting") ? openConditionalFormatting : (args.item.id == "PivotViewnumberFormatting") ? openNumberFormatting
35278
+ : (args.item.id == "PivotViewmdxQuery") ? MdxQuery : (args.item.id == "PivotViewfieldlist") ? showFieldList : '';
35279
+ this.parent.actionObj.actionName = actionName;
35280
+ if (this.parent.actionBeginMethod()) {
35281
+ return;
35282
+ }
35283
+ try {
35284
+ switch (args.item.id) {
35285
+ case (this.parent.element.id + 'save'):
35286
+ case (this.parent.element.id + 'saveas'):
35287
+ this.saveReport(args);
35288
+ break;
35289
+ case (this.parent.element.id + 'remove'):
35290
+ this.action = 'Remove';
35291
+ if (this.currentReport && this.currentReport !== '') {
35292
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('removeConfirm'));
35293
+ }
35294
+ else {
35295
+ this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant('error'), this.parent.localeObj.getConstant('emptyReport'));
35296
+ }
35297
+ return;
35298
+ case (this.parent.element.id + 'rename'):
35299
+ this.renameReport(args);
35300
+ break;
35301
+ case (this.parent.element.id + 'new'):
35302
+ this.action = 'New';
35303
+ this.newArgs = args;
35304
+ if (this.parent.isModified && this.currentReport && this.currentReport !== '') {
35305
+ this.createConfirmDialog(this.parent.localeObj.getConstant('alert'), this.parent.localeObj.getConstant('newReportConfirm'));
35306
+ }
35307
+ else {
35308
+ this.createNewReport(args);
35309
+ }
35310
+ break;
35311
+ case (this.parent.element.id + 'load'):
35312
+ this.action = 'Load';
35313
+ break;
35314
+ case (this.parent.element.id + 'fieldlist'):
35315
+ if (this.parent.pivotFieldListModule && this.parent.pivotFieldListModule.dialogRenderer) {
35316
+ this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.show();
35317
+ }
35318
+ break;
35319
+ case (this.parent.element.id + 'formatting'):
35320
+ if (this.parent.conditionalFormattingModule) {
35321
+ this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
35322
+ }
35323
+ break;
35324
+ case (this.parent.element.id + 'mdxQuery'):
35325
+ this.mdxQueryDialog(args);
35326
+ break;
35327
+ case (this.parent.element.id + 'numberFormatting'):
35328
+ if (this.parent.numberFormattingModule) {
35329
+ this.parent.numberFormattingModule.showNumberFormattingDialog();
35330
+ }
35331
+ break;
35332
+ }
35333
+ }
35334
+ catch (execption) {
35335
+ this.parent.actionFailureMethod(execption);
34434
35336
  }
34435
35337
  }
34436
35338
  renderDialog() {
@@ -34553,6 +35455,10 @@ class Toolbar$2 {
34553
35455
  report: _this.parent.getPersistData(),
34554
35456
  reportName: reportInput.value
34555
35457
  };
35458
+ let actionInfo = {
35459
+ reportName: reportInput.value
35460
+ };
35461
+ this.parent.actionObj.actionInfo = actionInfo;
34556
35462
  _this.parent.trigger(saveReport, saveArgs);
34557
35463
  _this.parent.isModified = false;
34558
35464
  _this.updateReportList();
@@ -34585,6 +35491,10 @@ class Toolbar$2 {
34585
35491
  report: _this.parent.getPersistData(),
34586
35492
  reportName: reportInput.value
34587
35493
  };
35494
+ let actionInfo = {
35495
+ reportName: reportInput.value
35496
+ };
35497
+ this.parent.actionObj.actionInfo = actionInfo;
34588
35498
  _this.parent.trigger(saveReport, saveArgs);
34589
35499
  _this.parent.isModified = false;
34590
35500
  _this.updateReportList();
@@ -34619,12 +35529,20 @@ class Toolbar$2 {
34619
35529
  reportName: _this.currentReport,
34620
35530
  rename: reportInput.value
34621
35531
  };
35532
+ let actionInfo = {
35533
+ reportName: { oldName: _this.currentReport, newName: reportInput.value }
35534
+ };
35535
+ this.parent.actionObj.actionInfo = actionInfo;
34622
35536
  _this.parent.trigger(renameReport, renameArgs);
34623
35537
  _this.currentReport = reportInput.value;
34624
35538
  _this.updateReportList();
34625
35539
  _this.dialog.hide();
34626
35540
  });
34627
35541
  }
35542
+ this.parent.actionObj.actionName = this.parent.getActionCompleteName();
35543
+ if (this.parent.actionObj.actionName) {
35544
+ this.parent.actionCompleteMethod();
35545
+ }
34628
35546
  }
34629
35547
  createNewReport(args) {
34630
35548
  this.dialogShow(args);
@@ -34682,6 +35600,10 @@ class Toolbar$2 {
34682
35600
  let removeArgs = {
34683
35601
  reportName: this.currentReport
34684
35602
  };
35603
+ let actionInfo = {
35604
+ reportName: this.currentReport
35605
+ };
35606
+ this.parent.actionObj.actionInfo = actionInfo;
34685
35607
  this.parent.trigger(removeReport, removeArgs);
34686
35608
  let reports = this.fetchReports();
34687
35609
  if (reports.reportName && reports.reportName.length > 0) {
@@ -34700,6 +35622,10 @@ class Toolbar$2 {
34700
35622
  this.action = '';
34701
35623
  }
34702
35624
  this.updateReportList();
35625
+ this.parent.actionObj.actionName = reportRemoved;
35626
+ if (this.parent.actionObj.actionName) {
35627
+ this.parent.actionCompleteMethod();
35628
+ }
34703
35629
  }
34704
35630
  else if (this.action === 'New' || (this.action !== 'Save' && this.action !== 'Rename' && this.action !== 'New')) {
34705
35631
  if (this.currentReport && this.currentReport !== '' && this.parent.isModified) {
@@ -34707,12 +35633,22 @@ class Toolbar$2 {
34707
35633
  report: this.parent.getPersistData(),
34708
35634
  reportName: this.currentReport
34709
35635
  };
35636
+ let actionInfo = {
35637
+ reportName: this.currentReport
35638
+ };
35639
+ this.parent.actionObj.actionInfo = actionInfo;
35640
+ this.parent.actionObj.actionName = reportSaved;
35641
+ if (this.parent.actionObj.actionName) {
35642
+ this.parent.actionCompleteMethod();
35643
+ }
34710
35644
  this.parent.trigger(saveReport, saveArgs);
34711
35645
  this.parent.isModified = false;
34712
35646
  if (this.action === 'New') {
35647
+ this.parent.actionObj.actionName = addNewReport;
34713
35648
  this.createNewReport(this.newArgs);
34714
35649
  }
34715
35650
  else {
35651
+ this.parent.actionObj.actionName = reportChange;
34716
35652
  this.reportLoad(this.dropArgs);
34717
35653
  }
34718
35654
  }
@@ -34817,6 +35753,7 @@ class Toolbar$2 {
34817
35753
  this.chartMenu = new Menu({
34818
35754
  items: menu, enableRtl: this.parent.enableRtl,
34819
35755
  locale: this.parent.locale,
35756
+ cssClass: TOOLBAR_MENU,
34820
35757
  select: this.menuItemClick.bind(this),
34821
35758
  beforeOpen: this.whitespaceRemove.bind(this),
34822
35759
  onClose: (args) => {
@@ -34872,6 +35809,7 @@ class Toolbar$2 {
34872
35809
  this.exportMenu = new Menu({
34873
35810
  items: menu, enableRtl: this.parent.enableRtl,
34874
35811
  locale: this.parent.locale,
35812
+ cssClass: TOOLBAR_MENU,
34875
35813
  select: this.menuItemClick.bind(this), beforeOpen: this.updateExportMenu.bind(this),
34876
35814
  onClose: (args) => {
34877
35815
  this.focusToolBar();
@@ -34909,6 +35847,7 @@ class Toolbar$2 {
34909
35847
  this.subTotalMenu = new Menu({
34910
35848
  items: menu, enableRtl: this.parent.enableRtl,
34911
35849
  locale: this.parent.locale,
35850
+ cssClass: TOOLBAR_MENU,
34912
35851
  select: this.menuItemClick.bind(this), beforeOpen: this.updateSubtotalSelection.bind(this),
34913
35852
  onClose: (args) => {
34914
35853
  this.focusToolBar();
@@ -34946,6 +35885,7 @@ class Toolbar$2 {
34946
35885
  this.grandTotalMenu = new Menu({
34947
35886
  items: menu, enableRtl: this.parent.enableRtl,
34948
35887
  locale: this.parent.locale,
35888
+ cssClass: TOOLBAR_MENU,
34949
35889
  select: this.menuItemClick.bind(this), beforeOpen: this.updateGrandtotalSelection.bind(this),
34950
35890
  onClose: (args) => {
34951
35891
  this.focusToolBar();
@@ -34973,6 +35913,7 @@ class Toolbar$2 {
34973
35913
  this.formattingMenu = new Menu({
34974
35914
  items: menu, enableRtl: this.parent.enableRtl,
34975
35915
  locale: this.parent.locale,
35916
+ cssClass: TOOLBAR_MENU,
34976
35917
  select: this.menuItemClick.bind(this)
34977
35918
  });
34978
35919
  this.formattingMenu.isStringTemplate = true;
@@ -35170,181 +36111,202 @@ class Toolbar$2 {
35170
36111
  menuItemClick(args) {
35171
36112
  let exportArgs = {};
35172
36113
  let type;
36114
+ let actionName = (args.item.id == "PivotViewgrid") ? tableView : (args.item.id == "PivotView_Column") ? chartView : (args.item.id == "PivotView_Bar") ? chartView : (args.item.id == "PivotView_Line") ? chartView
36115
+ : (args.item.id == "PivotView_Area") ? chartView : (args.item.id == "PivotView_Scatter") ? chartView : (args.item.id == "PivotView_Polar") ? chartView : (args.item.id == "PivotView_ChartMoreOption") ? chartView
36116
+ : (args.item.id == "PivotView_multipleAxes") ? multipleAxis : (args.item.id == "PivotView_showLegend") ? showLegend : (args.item.id == "PivotViewpdf") ? pdfExport : (args.item.id == "PivotViewpng") ? pngExport
36117
+ : (args.item.id == "PivotViewexcel") ? excelExport : (args.item.id == "PivotViewcsv") ? csvExport : (args.item.id == "PivotViewjpeg") ? jpegExport : (args.item.id == "PivotViewsvg") ? svgExport
36118
+ : (args.item.id == "PivotViewnotsubtotal") ? hideSubTotals : (args.item.id == "PivotViewsubtotalrow") ? subTotalsRow : (args.item.id == "PivotViewsubtotalcolumn") ? subTotalsColumn
36119
+ : (args.item.id == "PivotViewsubtotal") ? showSubTotals : (args.item.id == "PivotViewnotgrandtotal") ? hideGrandTotals : (args.item.id == "PivotViewgrandtotalrow") ? grandTotalsRow
36120
+ : (args.item.id == "PivotViewgrandtotalcolumn") ? grandTotalsColumn : (args.item.id == "PivotViewgrandtotal") ? showGrandTotals
36121
+ : (args.item.id == "PivotViewnumberFormattingMenu") ? numberFormattingMenu : (args.item.id == "PivotViewconditionalFormattingMenu") ? conditionalFormattingMenu : '';
36122
+ this.parent.actionObj.actionName = actionName;
36123
+ if (this.parent.actionBeginMethod()) {
36124
+ return;
36125
+ }
35173
36126
  if (this.getAllChartItems().indexOf(args.item.id.split(this.parent.element.id + '_')[1]) > -1 ||
35174
36127
  (args.item.id.split(this.parent.element.id + '_')[1] === 'ChartMoreOption') ||
35175
36128
  (args.item.id.split(this.parent.element.id + '_')[1] === 'multipleAxes') ||
35176
36129
  (args.item.id.split(this.parent.element.id + '_')[1] === 'showLegend')) {
35177
36130
  type = args.item.id.split(this.parent.element.id + '_')[1];
35178
36131
  }
35179
- switch (args.item.id) {
35180
- case (this.parent.element.id + 'grid'):
35181
- if (this.parent.grid && this.parent.chart) {
35182
- this.parent.grid.element.style.display = '';
35183
- this.parent.chart.element.style.display = 'none';
35184
- if (this.parent.chartSettings.enableMultipleAxis && this.parent.chartSettings.enableScrollOnMultiAxis) {
35185
- this.parent.element.querySelector('.e-pivotchart').style.display = 'none';
35186
- }
35187
- this.parent.currentView = 'Table';
35188
- this.parent.setProperties({ displayOption: { primary: 'Table' } }, true);
35189
- if (this.parent.showGroupingBar && this.parent.groupingBarModule) {
35190
- this.parent.element.querySelector('.e-pivot-grouping-bar').style.display = '';
35191
- this.parent.element.querySelector('.e-chart-grouping-bar').style.display = 'none';
36132
+ try {
36133
+ switch (args.item.id) {
36134
+ case (this.parent.element.id + 'grid'):
36135
+ if (this.parent.grid && this.parent.chart) {
36136
+ this.parent.grid.element.style.display = '';
36137
+ this.parent.chart.element.style.display = 'none';
36138
+ if (this.parent.chartSettings.enableMultipleAxis && this.parent.chartSettings.enableScrollOnMultiAxis) {
36139
+ this.parent.element.querySelector('.e-pivotchart').style.display = 'none';
36140
+ }
36141
+ this.parent.currentView = 'Table';
36142
+ this.parent.setProperties({ displayOption: { primary: 'Table' } }, true);
36143
+ if (this.parent.showGroupingBar && this.parent.groupingBarModule) {
36144
+ this.parent.element.querySelector('.e-pivot-grouping-bar').style.display = '';
36145
+ this.parent.element.querySelector('.e-chart-grouping-bar').style.display = 'none';
36146
+ }
36147
+ let actionInfo = {
36148
+ toolbarInfo: { displayOption: this.parent.displayOption, gridSettings: this.parent.gridSettings }
36149
+ };
36150
+ this.parent.actionObj.actionInfo = actionInfo;
36151
+ this.parent.layoutRefresh();
35192
36152
  }
35193
- this.parent.layoutRefresh();
35194
- }
35195
- break;
35196
- case (this.parent.element.id + 'pdf'):
35197
- if (this.parent.currentView === 'Table') {
36153
+ break;
36154
+ case (this.parent.element.id + 'pdf'):
36155
+ if (this.parent.currentView === 'Table') {
36156
+ exportArgs = {
36157
+ pdfExportProperties: { fileName: 'Export.pdf' },
36158
+ pdfDoc: undefined,
36159
+ isBlob: false,
36160
+ isMultipleExport: false
36161
+ };
36162
+ this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
36163
+ this.parent.pdfExport(observedArgs.pdfExportProperties, observedArgs.isMultipleExport, observedArgs.pdfDoc, observedArgs.isBlob);
36164
+ });
36165
+ }
36166
+ else {
36167
+ exportArgs = {
36168
+ width: undefined,
36169
+ height: undefined,
36170
+ orientation: PdfPageOrientation.Landscape,
36171
+ type: 'PDF',
36172
+ fileName: 'result',
36173
+ };
36174
+ this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
36175
+ this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
36176
+ });
36177
+ }
36178
+ break;
36179
+ case (this.parent.element.id + 'excel'):
36180
+ exportArgs = {
36181
+ excelExportProperties: { fileName: 'Export.xlsx' },
36182
+ isBlob: undefined,
36183
+ isMultipleExport: undefined,
36184
+ workbook: undefined
36185
+ };
36186
+ this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
36187
+ this.parent.excelExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
36188
+ });
36189
+ break;
36190
+ case (this.parent.element.id + 'csv'):
35198
36191
  exportArgs = {
35199
- pdfExportProperties: { fileName: 'Export.pdf' },
35200
- pdfDoc: undefined,
36192
+ excelExportProperties: { fileName: 'Export.csv' },
35201
36193
  isBlob: false,
35202
- isMultipleExport: false
36194
+ isMultipleExport: false,
36195
+ workbook: undefined
35203
36196
  };
35204
36197
  this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35205
- this.parent.pdfExport(observedArgs.pdfExportProperties, observedArgs.isMultipleExport, observedArgs.pdfDoc, observedArgs.isBlob);
36198
+ this.parent.csvExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
35206
36199
  });
35207
- }
35208
- else {
36200
+ break;
36201
+ case (this.parent.element.id + 'png'):
35209
36202
  exportArgs = {
36203
+ type: 'PNG',
35210
36204
  width: undefined,
35211
36205
  height: undefined,
36206
+ fileName: 'result',
35212
36207
  orientation: PdfPageOrientation.Landscape,
35213
- type: 'PDF',
36208
+ };
36209
+ this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
36210
+ this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
36211
+ });
36212
+ break;
36213
+ case (this.parent.element.id + 'jpeg'):
36214
+ exportArgs = {
36215
+ type: 'JPEG',
35214
36216
  fileName: 'result',
36217
+ orientation: PdfPageOrientation.Landscape,
36218
+ width: undefined,
36219
+ height: undefined,
35215
36220
  };
35216
36221
  this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35217
36222
  this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35218
36223
  });
35219
- }
35220
- break;
35221
- case (this.parent.element.id + 'excel'):
35222
- exportArgs = {
35223
- excelExportProperties: { fileName: 'Export.xlsx' },
35224
- isBlob: undefined,
35225
- isMultipleExport: undefined,
35226
- workbook: undefined
35227
- };
35228
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35229
- this.parent.excelExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
35230
- });
35231
- break;
35232
- case (this.parent.element.id + 'csv'):
35233
- exportArgs = {
35234
- excelExportProperties: { fileName: 'Export.csv' },
35235
- isBlob: false,
35236
- isMultipleExport: false,
35237
- workbook: undefined
35238
- };
35239
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35240
- this.parent.csvExport(observedArgs.excelExportProperties, observedArgs.isMultipleExport, observedArgs.workbook, observedArgs.isBlob);
35241
- });
35242
- break;
35243
- case (this.parent.element.id + 'png'):
35244
- exportArgs = {
35245
- type: 'PNG',
35246
- width: undefined,
35247
- height: undefined,
35248
- fileName: 'result',
35249
- orientation: PdfPageOrientation.Landscape,
35250
- };
35251
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35252
- this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35253
- });
35254
- break;
35255
- case (this.parent.element.id + 'jpeg'):
35256
- exportArgs = {
35257
- type: 'JPEG',
35258
- fileName: 'result',
35259
- orientation: PdfPageOrientation.Landscape,
35260
- width: undefined,
35261
- height: undefined,
35262
- };
35263
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35264
- this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35265
- });
35266
- break;
35267
- case (this.parent.element.id + 'svg'):
35268
- exportArgs = {
35269
- width: undefined,
35270
- height: undefined,
35271
- type: 'SVG',
35272
- fileName: 'result',
35273
- orientation: PdfPageOrientation.Landscape,
35274
- };
35275
- this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
35276
- this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
35277
- });
35278
- break;
35279
- case (this.parent.element.id + 'notsubtotal'):
35280
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: false, showColumnSubTotals: false, showRowSubTotals: false } }, true);
35281
- this.parent.refreshData();
35282
- break;
35283
- case (this.parent.element.id + 'subtotalrow'):
35284
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: false, showRowSubTotals: true } }, true);
35285
- this.parent.refreshData();
35286
- break;
35287
- case (this.parent.element.id + 'subtotalcolumn'):
35288
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: false } }, true);
35289
- this.parent.refreshData();
35290
- break;
35291
- case (this.parent.element.id + 'subtotal'):
35292
- this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: true } }, true);
35293
- this.parent.refreshData();
35294
- break;
35295
- case (this.parent.element.id + 'notgrandtotal'):
35296
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: false, showColumnGrandTotals: false, showRowGrandTotals: false } }, true);
35297
- this.parent.refreshData();
35298
- break;
35299
- case (this.parent.element.id + 'grandtotalrow'):
35300
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: false, showRowGrandTotals: true } }, true);
35301
- this.parent.refreshData();
35302
- break;
35303
- case (this.parent.element.id + 'grandtotalcolumn'):
35304
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: false } }, true);
35305
- this.parent.refreshData();
35306
- break;
35307
- case (this.parent.element.id + 'grandtotal'):
35308
- this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: true } }, true);
35309
- this.parent.refreshData();
35310
- break;
35311
- case (this.parent.element.id + 'numberFormattingMenu'):
35312
- if (this.parent.numberFormattingModule) {
35313
- this.parent.numberFormattingModule.showNumberFormattingDialog();
35314
- }
35315
- break;
35316
- case (this.parent.element.id + 'conditionalFormattingMenu'):
35317
- if (this.parent.conditionalFormattingModule) {
35318
- this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
35319
- }
35320
- break;
35321
- case (this.parent.element.id + '_' + type):
35322
- if (args.item && args.item.text) {
35323
- if (type === 'ChartMoreOption') {
35324
- this.createChartTypeDialog();
35325
- }
35326
- else if (type === 'multipleAxes') {
35327
- if (this.parent.chartSettings.enableScrollOnMultiAxis) {
35328
- this.isMultiAxisChange = true;
35329
- }
35330
- this.parent.chartSettings.enableMultipleAxis = !this.parent.chartSettings.enableMultipleAxis;
35331
- this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
36224
+ break;
36225
+ case (this.parent.element.id + 'svg'):
36226
+ exportArgs = {
36227
+ width: undefined,
36228
+ height: undefined,
36229
+ type: 'SVG',
36230
+ fileName: 'result',
36231
+ orientation: PdfPageOrientation.Landscape,
36232
+ };
36233
+ this.parent.trigger(beforeExport, exportArgs, (observedArgs) => {
36234
+ this.parent.chartExport(observedArgs.type, observedArgs.fileName, observedArgs.orientation, observedArgs.width, observedArgs.height);
36235
+ });
36236
+ break;
36237
+ case (this.parent.element.id + 'notsubtotal'):
36238
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: false, showColumnSubTotals: false, showRowSubTotals: false } }, true);
36239
+ this.parent.refreshData();
36240
+ break;
36241
+ case (this.parent.element.id + 'subtotalrow'):
36242
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: false, showRowSubTotals: true } }, true);
36243
+ this.parent.refreshData();
36244
+ break;
36245
+ case (this.parent.element.id + 'subtotalcolumn'):
36246
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: false } }, true);
36247
+ this.parent.refreshData();
36248
+ break;
36249
+ case (this.parent.element.id + 'subtotal'):
36250
+ this.parent.setProperties({ dataSourceSettings: { showSubTotals: true, showColumnSubTotals: true, showRowSubTotals: true } }, true);
36251
+ this.parent.refreshData();
36252
+ break;
36253
+ case (this.parent.element.id + 'notgrandtotal'):
36254
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: false, showColumnGrandTotals: false, showRowGrandTotals: false } }, true);
36255
+ this.parent.refreshData();
36256
+ break;
36257
+ case (this.parent.element.id + 'grandtotalrow'):
36258
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: false, showRowGrandTotals: true } }, true);
36259
+ this.parent.refreshData();
36260
+ break;
36261
+ case (this.parent.element.id + 'grandtotalcolumn'):
36262
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: false } }, true);
36263
+ this.parent.refreshData();
36264
+ break;
36265
+ case (this.parent.element.id + 'grandtotal'):
36266
+ this.parent.setProperties({ dataSourceSettings: { showGrandTotals: true, showColumnGrandTotals: true, showRowGrandTotals: true } }, true);
36267
+ this.parent.refreshData();
36268
+ break;
36269
+ case (this.parent.element.id + 'numberFormattingMenu'):
36270
+ if (this.parent.numberFormattingModule) {
36271
+ this.parent.numberFormattingModule.showNumberFormattingDialog();
35332
36272
  }
35333
- else if (this.getAllChartItems().indexOf(type) > -1) {
35334
- this.updateChartType(type, false);
36273
+ break;
36274
+ case (this.parent.element.id + 'conditionalFormattingMenu'):
36275
+ if (this.parent.conditionalFormattingModule) {
36276
+ this.parent.conditionalFormattingModule.showConditionalFormattingDialog();
35335
36277
  }
35336
- else if (type === 'showLegend') {
35337
- this.parent.chart.legendSettings.visible = !this.showLableState;
35338
- if (this.parent.chartSettings.legendSettings) {
35339
- this.parent.chartSettings.legendSettings.visible = !this.showLableState;
36278
+ break;
36279
+ case (this.parent.element.id + '_' + type):
36280
+ if (args.item && args.item.text) {
36281
+ if (type === 'ChartMoreOption') {
36282
+ this.createChartTypeDialog();
36283
+ }
36284
+ else if (type === 'multipleAxes') {
36285
+ if (this.parent.chartSettings.enableScrollOnMultiAxis) {
36286
+ this.isMultiAxisChange = true;
36287
+ }
36288
+ this.parent.chartSettings.enableMultipleAxis = !this.parent.chartSettings.enableMultipleAxis;
36289
+ this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
35340
36290
  }
35341
- else {
35342
- this.parent.setProperties({ chartSettings: { legendSettings: { visible: !this.showLableState } } }, true);
36291
+ else if (this.getAllChartItems().indexOf(type) > -1) {
36292
+ this.updateChartType(type, false);
36293
+ }
36294
+ else if (type === 'showLegend') {
36295
+ this.parent.chart.legendSettings.visible = !this.showLableState;
36296
+ if (this.parent.chartSettings.legendSettings) {
36297
+ this.parent.chartSettings.legendSettings.visible = !this.showLableState;
36298
+ }
36299
+ else {
36300
+ this.parent.setProperties({ chartSettings: { legendSettings: { visible: !this.showLableState } } }, true);
36301
+ }
36302
+ this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
35343
36303
  }
35344
- this.updateChartType(this.parent.chartSettings.chartSeries.type, true);
35345
36304
  }
35346
- }
35347
- break;
36305
+ break;
36306
+ }
36307
+ }
36308
+ catch (execption) {
36309
+ this.parent.actionFailureMethod(execption);
35348
36310
  }
35349
36311
  /* eslint-enable max-len */
35350
36312
  }
@@ -35435,14 +36397,20 @@ class Toolbar$2 {
35435
36397
  if (this.parent.chart) {
35436
36398
  this.parent.currentView = 'Chart';
35437
36399
  this.parent.setProperties({ displayOption: { primary: 'Chart' } }, true);
35438
- this.parent.chart.element.style.width = formatUnit(this.parent.grid ? this.parent.getGridWidthAsNumber() : this.parent.getWidthAsNumber()); /* eslint-disable-line */
36400
+ if (this.parent.chartSettings.enableScrollOnMultiAxis && this.parent.chartSettings.enableMultipleAxis) {
36401
+ this.parent.element.querySelector('.' + PIVOTCHART).style.width = formatUnit(this.parent.grid ? this.parent.getGridWidthAsNumber() : this.parent.getWidthAsNumber()); /* eslint-disable-line */
36402
+ }
35439
36403
  this.parent.chart.setProperties({ width: formatUnit(this.parent.grid ? this.parent.getGridWidthAsNumber() : this.parent.getWidthAsNumber()) }, true); /* eslint-disable-line */
35440
36404
  if (this.parent.chartSettings.chartSeries.type === type && !isMultiAxis) {
35441
- this.parent.chartModule.updateView();
36405
+ this.parent.pivotChartModule.updateView();
35442
36406
  }
35443
36407
  else {
35444
36408
  this.parent.chartSettings.chartSeries.type = type;
35445
36409
  }
36410
+ let actionInfo = {
36411
+ toolbarInfo: { displayOption: this.parent.displayOption, chartSettings: this.parent.chartSettings }
36412
+ };
36413
+ this.parent.actionObj.actionInfo = actionInfo;
35446
36414
  }
35447
36415
  }
35448
36416
  }
@@ -36002,6 +36970,10 @@ class NumberFormatting {
36002
36970
  this.parent.trigger(numberFormatting, eventArgs, (observedArgs) => {
36003
36971
  if (!observedArgs.cancel) {
36004
36972
  this.parent.setProperties({ dataSourceSettings: { formatSettings: observedArgs.formatSettings } }, true);
36973
+ let actionInfo = {
36974
+ numberFormattingInfo: this.parent.dataSourceSettings.formatSettings
36975
+ };
36976
+ this.parent.actionObj.actionInfo = actionInfo;
36005
36977
  try {
36006
36978
  this.parent.updateDataSource(false);
36007
36979
  this.dialog.close();
@@ -36659,7 +37631,7 @@ class Grouping {
36659
37631
  for (let j = 0, len = field.customGroups.length; j < len; j++) {
36660
37632
  if (field.customGroups[j]) {
36661
37633
  let group = field.customGroups[j];
36662
- if (group.items && PivotUtil.isContainCommonElements(group.items, selectedOptions)) {
37634
+ if (group.items && PivotExportUtil.isContainCommonElements(group.items, selectedOptions)) {
36663
37635
  splicedItems = this.mergeArray(splicedItems, [group.groupName]);
36664
37636
  newItems = this.mergeArray(newItems, group.items);
36665
37637
  field.customGroups.splice(j, 1);
@@ -36909,5 +37881,5 @@ class Grouping {
36909
37881
  * Export PivotGrid components
36910
37882
  */
36911
37883
 
36912
- 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 };
37884
+ 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 };
36913
37885
  //# sourceMappingURL=ej2-pivotview.es2015.js.map