@syncfusion/ej2-pivotview 20.1.56 → 20.1.61

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 (34) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/ej2-pivotview.umd.min.js +2 -2
  3. package/dist/ej2-pivotview.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-pivotview.es2015.js +209 -118
  5. package/dist/es6/ej2-pivotview.es2015.js.map +1 -1
  6. package/dist/es6/ej2-pivotview.es5.js +211 -120
  7. package/dist/es6/ej2-pivotview.es5.js.map +1 -1
  8. package/dist/global/ej2-pivotview.min.js +2 -2
  9. package/dist/global/ej2-pivotview.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +15 -15
  12. package/src/base/engine.d.ts +1 -1
  13. package/src/base/engine.js +127 -79
  14. package/src/base/olap/engine.js +0 -12
  15. package/src/base/util.js +2 -2
  16. package/src/common/actions/event-base.js +27 -0
  17. package/src/common/popups/drillthrough-dialog.js +6 -6
  18. package/src/common/popups/toolbar.d.ts +1 -0
  19. package/src/common/popups/toolbar.js +15 -6
  20. package/src/pivotchart/base/pivotchart.js +4 -1
  21. package/src/pivotfieldlist/renderer/dialog-renderer.js +4 -2
  22. package/src/pivotview/actions/drill-through.js +2 -2
  23. package/src/pivotview/actions/excel-export.js +2 -1
  24. package/src/pivotview/base/pivotview.js +6 -3
  25. package/src/pivotview/model/chartsettings-model.d.ts +2 -2
  26. package/src/pivotview/model/chartsettings.d.ts +2 -2
  27. package/src/pivotview/model/chartsettings.js +2 -2
  28. package/src/pivotview/renderer/render.js +16 -6
  29. package/styles/bootstrap4.css +1 -1
  30. package/styles/pivotfieldlist/_layout.scss +7 -7
  31. package/styles/pivotfieldlist/_theme.scss +1 -1
  32. package/styles/pivotview/_layout.scss +14 -14
  33. package/styles/pivotview/_theme.scss +3 -3
  34. package/styles/pivotview/bootstrap4.css +1 -1
@@ -876,9 +876,9 @@ var PivotUtil = /** @__PURE__ @class */ (function () {
876
876
  }
877
877
  else if (type === true) {
878
878
  sortOrder === 'Ascending' ?
879
- (sortMembersOrder.sort(function (a, b) { return (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : (Number(a.actualText.toString().match(/\d+/)[0]) > Number(b.actualText.toString().match(/\d+/)[0])) ? 1 : ((Number(b.actualText.toString().match(/\d+/)[0]) > Number(a.actualText.toString().match(/\d+/)[0])) ? -1 : 0); })) :
879
+ (sortMembersOrder.sort(function (a, b) { return (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : (a.actualText === 'Out of Range') ? 1 : (b.actualText === 'Out of Range') ? -1 : (Number(a.actualText.toString().match(/\d+/)) > Number(b.actualText.toString().match(/\d+/))) ? 1 : ((Number(b.actualText.toString().match(/\d+/)) > Number(a.actualText.toString().match(/\d+/))) ? -1 : 0); })) :
880
880
  sortOrder === 'Descending' ?
881
- (sortMembersOrder.sort(function (a, b) { return (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : (Number(a.actualText.toString().match(/\d+/)[0]) < Number(b.actualText.toString().match(/\d+/)[0])) ? 1 : ((Number(b.actualText.toString().match(/\d+/)[0]) < Number(a.actualText.toString().match(/\d+/)[0])) ? -1 : 0); })) :
881
+ (sortMembersOrder.sort(function (a, b) { return (a.actualText === 'Grand Total' || b.actualText === 'Grand Total') ? 0 : (a.actualText === 'Out of Range') ? -1 : (b.actualText === 'Out of Range') ? 1 : (Number(a.actualText.toString().match(/\d+/)) < Number(b.actualText.toString().match(/\d+/))) ? 1 : ((Number(b.actualText.toString().match(/\d+/)) < Number(a.actualText.toString().match(/\d+/))) ? -1 : 0); })) :
882
882
  sortMembersOrder;
883
883
  }
884
884
  else {
@@ -2590,8 +2590,8 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
2590
2590
  var mPos = this.fieldList[measure].index;
2591
2591
  var aggregate = this.fieldList[measure].aggregateType;
2592
2592
  this.rawIndexObject = {};
2593
- value = (type === 'row' ? this.getAggregateValue(rows[i].index, columns.indexObject, mPos, aggregate) :
2594
- this.getAggregateValue(columns.index, rows[i].indexObject, mPos, aggregate));
2593
+ value = (type === 'row' ? this.getAggregateValue(rows[i].index, columns.indexObject, mPos, aggregate, false) :
2594
+ this.getAggregateValue(columns.index, rows[i].indexObject, mPos, aggregate, false));
2595
2595
  var cellDetails = {
2596
2596
  fieldName: measure,
2597
2597
  row: rows[i],
@@ -3278,70 +3278,94 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
3278
3278
  return headers;
3279
3279
  };
3280
3280
  PivotEngine.prototype.performFilterCommonUpdate = function (filterItem, headersInfo, addPos) {
3281
- var rawHeaders = headersInfo.axis === 'row' ? this.rMembers : this.cMembers;
3282
- var filterObjects = {};
3283
- for (var _i = 0, _a = this.filterMembers; _i < _a.length; _i++) {
3284
- var item = _a[_i];
3285
- filterObjects[item] = item;
3286
- }
3287
- if (this.fieldFilterMem[filterItem.name]) {
3288
- rawHeaders = this.performFilterDeletion(headersInfo.headers, filterItem, headersInfo, filterObjects, 0);
3289
- }
3290
- if (addPos.length > 0 && headersInfo.fields.length > 0) {
3291
- this.frameHeaderObjectsCollection = true;
3292
- if (headersInfo.fields.filter(function (item) { return item.showNoDataItems; }).length > 0) {
3293
- for (var i = 0; i < this.data.length; i++) {
3294
- addPos.push(i);
3281
+ if (headersInfo.axis === 'row' || headersInfo.axis === 'column') {
3282
+ var rawHeaders = headersInfo.axis === 'row' ? this.rMembers : this.cMembers;
3283
+ var filterObjects = {};
3284
+ for (var _i = 0, _a = this.filterMembers; _i < _a.length; _i++) {
3285
+ var item = _a[_i];
3286
+ filterObjects[item] = item;
3287
+ }
3288
+ if (this.fieldFilterMem[filterItem.name]) {
3289
+ rawHeaders = this.performFilterDeletion(headersInfo.headers, filterItem, headersInfo, filterObjects, 0);
3290
+ }
3291
+ if (addPos.length > 0 && headersInfo.fields.length > 0) {
3292
+ this.frameHeaderObjectsCollection = true;
3293
+ if (headersInfo.fields.filter(function (item) { return item.showNoDataItems; }).length > 0) {
3294
+ for (var i = 0; i < this.data.length; i++) {
3295
+ addPos.push(i);
3296
+ }
3297
+ //addPos = (this.data as any).map((item, pos) => { return pos; });
3298
+ }
3299
+ /* eslint-disable */
3300
+ this.headerObjectsCollection['parent'] = this.getIndexedHeaders(headersInfo.fields, this.data, 0, addPos, headersInfo.axis, '');
3301
+ rawHeaders = this.performFilterAddition(rawHeaders, headersInfo.fields, headersInfo);
3302
+ var headerNames_1 = {};
3303
+ for (var _b = 0, rawHeaders_1 = rawHeaders; _b < rawHeaders_1.length; _b++) {
3304
+ var header = rawHeaders_1[_b];
3305
+ headerNames_1[header.valueSort.levelName.toString()] = header.valueSort.levelName.toString();
3306
+ }
3307
+ var excessHeaders = this.headerObjectsCollection['parent'].filter(function (header) {
3308
+ return !headerNames_1[header.valueSort.levelName.toString()];
3309
+ });
3310
+ var grandHeader = rawHeaders.filter(function (item) { return item.type === 'grand sum'; });
3311
+ if (grandHeader.length > 0) {
3312
+ rawHeaders.pop();
3313
+ }
3314
+ /* eslint-enable */
3315
+ rawHeaders = this.getSortedHeaders(rawHeaders.concat(excessHeaders), this.fieldList[headersInfo.fields[0].name].sort).concat(grandHeader);
3316
+ if (headersInfo.axis === 'row') {
3317
+ this.cMembers = this.getIndexedHeaders(this.columns, this.data, 0, this.filterMembers, 'column', '');
3318
+ this.insertAllMember(this.cMembers, this.filterMembers, '', 'column');
3319
+ }
3320
+ else {
3321
+ this.rMembers = this.getIndexedHeaders(this.rows, this.data, 0, this.filterMembers, 'row', '');
3322
+ this.insertAllMember(this.rMembers, this.filterMembers, '', 'row');
3295
3323
  }
3296
- //addPos = (this.data as any).map((item, pos) => { return pos; });
3297
3324
  }
3298
- /* eslint-disable */
3299
- this.headerObjectsCollection['parent'] = this.getIndexedHeaders(headersInfo.fields, this.data, 0, addPos, headersInfo.axis, '');
3300
- rawHeaders = this.performFilterAddition(rawHeaders, headersInfo.fields, headersInfo);
3301
- var headerNames_1 = {};
3302
- for (var _b = 0, rawHeaders_1 = rawHeaders; _b < rawHeaders_1.length; _b++) {
3303
- var header = rawHeaders_1[_b];
3304
- headerNames_1[header.valueSort.levelName.toString()] = header.valueSort.levelName.toString();
3305
- }
3306
- var excessHeaders = this.headerObjectsCollection['parent'].filter(function (header) {
3307
- return !headerNames_1[header.valueSort.levelName.toString()];
3308
- });
3309
- var grandHeader = rawHeaders.filter(function (item) { return item.type === 'grand sum'; });
3310
- if (grandHeader.length > 0) {
3311
- rawHeaders.pop();
3325
+ if (headersInfo.axis === 'row') {
3326
+ this.rowCount = 0;
3312
3327
  }
3313
- /* eslint-enable */
3314
- rawHeaders = this.getSortedHeaders(rawHeaders.concat(excessHeaders), this.fieldList[headersInfo.fields[0].name].sort).concat(grandHeader);
3328
+ else {
3329
+ this.columnCount = 0;
3330
+ }
3331
+ this.updateHeadersCount(rawHeaders, headersInfo.axis, 0, headersInfo.fields, 'plus', false);
3315
3332
  if (headersInfo.axis === 'row') {
3316
- this.cMembers = this.getIndexedHeaders(this.columns, this.data, 0, this.filterMembers, 'column', '');
3317
- this.insertAllMember(this.cMembers, this.filterMembers, '', 'column');
3333
+ if (headersInfo.position > 0) {
3334
+ this.insertPosition(this.rows, this.data, 0, this.filterMembers, 'row', '', rawHeaders);
3335
+ }
3336
+ this.insertTotalPosition(rawHeaders);
3337
+ this.rMembers = this.headerCollection.rowHeaders = rawHeaders;
3338
+ this.headerCollection.rowHeadersCount = this.rowCount;
3318
3339
  }
3319
3340
  else {
3320
- this.rMembers = this.getIndexedHeaders(this.rows, this.data, 0, this.filterMembers, 'row', '');
3321
- this.insertAllMember(this.rMembers, this.filterMembers, '', 'row');
3341
+ if (headersInfo.position > 0) {
3342
+ this.insertPosition(this.columns, this.data, 0, this.filterMembers, 'column', '', rawHeaders);
3343
+ }
3344
+ this.insertTotalPosition(rawHeaders);
3345
+ this.cMembers = this.headerCollection.columnHeaders = rawHeaders;
3346
+ this.headerCollection.columnHeadersCount = this.columnCount;
3322
3347
  }
3323
3348
  }
3324
- if (headersInfo.axis === 'row') {
3325
- this.rowCount = 0;
3326
- }
3327
3349
  else {
3350
+ var showNoDataItems = (this.rows[0] && this.rows[0].showNoDataItems) || (this.columns[0] && this.columns[0].showNoDataItems);
3351
+ if (this.rows.length > 0) {
3352
+ this.rMembers = this.getIndexedHeaders(this.rows, this.data, 0, showNoDataItems ? addPos : this.filterMembers, 'row', '');
3353
+ }
3354
+ if (this.columns.length > 0) {
3355
+ this.cMembers = this.getIndexedHeaders(this.columns, this.data, 0, showNoDataItems ? addPos : this.filterMembers, 'column', '');
3356
+ }
3357
+ this.insertAllMembersCommon();
3358
+ this.rowCount = 0;
3328
3359
  this.columnCount = 0;
3329
- }
3330
- this.updateHeadersCount(rawHeaders, headersInfo.axis, 0, headersInfo.fields, 'plus', false);
3331
- if (headersInfo.axis === 'row') {
3332
- if (headersInfo.position > 0) {
3333
- this.insertPosition(this.rows, this.data, 0, this.filterMembers, 'row', '', rawHeaders);
3360
+ this.updateHeadersCount(this.cMembers, 'column', 0, this.columns, 'plus', false);
3361
+ this.updateHeadersCount(this.rMembers, 'row', 0, this.rows, 'plus', false);
3362
+ if (showNoDataItems) {
3363
+ this.insertPosition(this.rows, this.data, 0, this.filterMembers, 'row', '', this.rMembers);
3364
+ this.insertPosition(this.columns, this.data, 0, this.filterMembers, 'column', '', this.cMembers);
3334
3365
  }
3335
- this.insertTotalPosition(rawHeaders);
3336
- this.rMembers = this.headerCollection.rowHeaders = rawHeaders;
3366
+ this.headerCollection.rowHeaders = this.rMembers;
3337
3367
  this.headerCollection.rowHeadersCount = this.rowCount;
3338
- }
3339
- else {
3340
- if (headersInfo.position > 0) {
3341
- this.insertPosition(this.columns, this.data, 0, this.filterMembers, 'column', '', rawHeaders);
3342
- }
3343
- this.insertTotalPosition(rawHeaders);
3344
- this.cMembers = this.headerCollection.columnHeaders = rawHeaders;
3368
+ this.headerCollection.columnHeaders = this.cMembers;
3345
3369
  this.headerCollection.columnHeadersCount = this.columnCount;
3346
3370
  }
3347
3371
  this.applyValueSorting();
@@ -3463,15 +3487,13 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
3463
3487
  }
3464
3488
  else {
3465
3489
  alphaNumbervalue.push(headers[i]);
3490
+ break;
3466
3491
  }
3467
3492
  }
3468
- if (stringValue.length > 1) {
3469
- stringValue = this.sortHeaders(fieldName, childrens, headers, childrens.sort, childrens.type);
3470
- }
3471
3493
  if (alphaNumbervalue.length > 0) {
3472
3494
  alphaNumbervalue = this.sortHeaders(fieldName, childrens, headers, childrens.sort, childrens.isAlphanumeric);
3473
3495
  }
3474
- return headers = nullValue.concat(alphaNumbervalue, stringValue);
3496
+ return headers;
3475
3497
  }
3476
3498
  else {
3477
3499
  return this.sortHeaders(fieldName, childrens, headers, sortOrder, childrens.type);
@@ -3630,7 +3652,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
3630
3652
  }
3631
3653
  else {
3632
3654
  this.rawIndexObject = {};
3633
- var value = this.getAggregateValue(header.index, member.indexObject, mIndex, mType);
3655
+ var value = this.getAggregateValue(header.index, member.indexObject, mIndex, mType, false);
3634
3656
  var cellDetails = {
3635
3657
  fieldName: this.fields[mIndex],
3636
3658
  row: header,
@@ -3855,7 +3877,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
3855
3877
  /* eslint-disable */
3856
3878
  PivotEngine.prototype.getIndexedHeaders = function (keys, data, keyInd, position, axis, parentMember, valueFil) {
3857
3879
  var hierarchy = [];
3858
- if (keys) {
3880
+ if (keys && keys.length > 0) {
3859
3881
  var rlen = keys.length;
3860
3882
  var decisionObj = {};
3861
3883
  var fieldName = keys[keyInd].name;
@@ -4045,27 +4067,50 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
4045
4067
  else {
4046
4068
  if (childrens.type === 'number' && hierarchy.length > 0 && (typeof (hierarchy[0].actualText) === 'string')) {
4047
4069
  var stringValue = [];
4070
+ var outOfRange = void 0;
4048
4071
  var alphaNumbervalue = [];
4049
4072
  var nullValue = [];
4050
4073
  for (var i = 0; i < hierarchy.length; i++) {
4051
4074
  if (isNaN(hierarchy[i].actualText.toString().charAt(0))) {
4052
4075
  stringValue.push(hierarchy[i]);
4076
+ if (!outOfRange && childrens.sort !== 'None') {
4077
+ if (hierarchy[i].actualText === 'Out of Range') {
4078
+ outOfRange = hierarchy[i];
4079
+ hierarchy.splice(i, 1);
4080
+ }
4081
+ }
4053
4082
  }
4054
4083
  else if (hierarchy[i].actualText === "") {
4055
4084
  nullValue.push(hierarchy[i]);
4056
4085
  }
4057
4086
  else {
4087
+ this.fieldList[fieldName].isAlphanumeric = true;
4058
4088
  alphaNumbervalue.push(hierarchy[i]);
4089
+ break;
4059
4090
  }
4060
4091
  }
4061
- if (stringValue.length > 0) {
4062
- stringValue = this.sortHeaders(fieldName, childrens, hierarchy, childrens.sort, childrens.type);
4092
+ if (outOfRange) {
4093
+ if (childrens.sort === 'Ascending') {
4094
+ if (hierarchy[0].actualText === 'Grand Total') {
4095
+ hierarchy.splice(1, 0, outOfRange);
4096
+ }
4097
+ else {
4098
+ hierarchy.splice(0, 0, outOfRange);
4099
+ }
4100
+ }
4101
+ else {
4102
+ if (hierarchy[hierarchy.length - 1].actualText === 'Grand Total') {
4103
+ hierarchy.splice(hierarchy.length - 1, 0, outOfRange);
4104
+ }
4105
+ else {
4106
+ hierarchy.splice(hierarchy.length, 0, outOfRange);
4107
+ }
4108
+ }
4063
4109
  }
4064
4110
  if (alphaNumbervalue.length > 0) {
4065
- this.fieldList[fieldName].isAlphanumeric = true;
4066
- alphaNumbervalue = this.sortHeaders(fieldName, childrens, hierarchy, childrens.sort, childrens.isAlphanumeric);
4111
+ this.sortHeaders(fieldName, childrens, hierarchy, childrens.sort, childrens.isAlphanumeric);
4067
4112
  }
4068
- return hierarchy = nullValue.concat(alphaNumbervalue, stringValue);
4113
+ return hierarchy;
4069
4114
  }
4070
4115
  else {
4071
4116
  return this.sortHeaders(fieldName, childrens, hierarchy, childrens.sort, childrens.type);
@@ -4923,7 +4968,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
4923
4968
  var selectedColumnValue = 0;
4924
4969
  if (selectedColumnValues.length === 0) {
4925
4970
  var selectedRow = this.getSelectedRow(currentSet.rowHeaders, rowheads);
4926
- selectedColumnValue = this.getAggregateValue(selectedRow.index, selectedColumn.indexObject, this.fieldList[name_3].index, headers.type);
4971
+ selectedColumnValue = this.getAggregateValue(selectedRow.index, selectedColumn.indexObject, this.fieldList[name_3].index, headers.type, false);
4927
4972
  }
4928
4973
  else {
4929
4974
  selectedColumnValue = selectedColumnValues[index[0]].value;
@@ -4982,7 +5027,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
4982
5027
  // let cVal: number = currentSet.value / (selectedRowValues[i[1]] as IAxisSet).value;
4983
5028
  var selectedRowValue = 0;
4984
5029
  if (selectedRowValues.length === 0 && activeValues) {
4985
- selectedRowValue = this.getAggregateValue(activeValues.index, colheads[i[1] - 1].indexObject, this.fieldList[name_3].index, headers.type);
5030
+ selectedRowValue = this.getAggregateValue(activeValues.index, colheads[i[1] - 1].indexObject, this.fieldList[name_3].index, headers.type, false);
4986
5031
  }
4987
5032
  else {
4988
5033
  selectedRowValue = selectedRowValues[i[1]] ? selectedRowValues[i[1]].actualValue : 0;
@@ -5029,7 +5074,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5029
5074
  var selectedColValue = 0;
5030
5075
  if (selectedColumnValues.length === 0) {
5031
5076
  var selectedRow = this.getSelectedRow(currentSet.rowHeaders, rowheads);
5032
- selectedColValue = this.getAggregateValue(selectedRow.index, selectedCol.indexObject, this.fieldList[name_3].index, headers.type);
5077
+ selectedColValue = this.getAggregateValue(selectedRow.index, selectedCol.indexObject, this.fieldList[name_3].index, headers.type, false);
5033
5078
  }
5034
5079
  else {
5035
5080
  selectedColValue = selectedColumnValues[i[0]].value;
@@ -5061,7 +5106,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5061
5106
  rowheads[rlen].level === item.level && currentSet.axis === 'value' &&
5062
5107
  currentSet.actualText === name_3) {
5063
5108
  if (rowheads[rlen].type !== 'grand sum') {
5064
- cVal += (!currentSet.showSubTotals && !(!isNullOrUndefined(currentSet.actualValue) && isNaN(currentSet.actualValue))) ? currentSet.actualValue : currentSet.value;
5109
+ cVal += (!currentSet.showSubTotals && !(!isNullOrUndefined(currentSet.actualValue) && isNaN(currentSet.actualValue))) ? currentSet.actualValue : (!isNullOrUndefined(currentSet.value) && !isNaN(currentSet.value)) ? currentSet.value : null;
5065
5110
  currentSet.formattedText = currentSet.showSubTotals ? (cVal === 0 && (currentSet.actualValue && currentSet.actualValue !== 0) ? '' : this.getFormattedValue(cVal, name_3).formattedText) : currentSet.formattedText;
5066
5111
  if (!this.aggregatedValueMatrix[rlen]) {
5067
5112
  this.aggregatedValueMatrix[rlen] = [];
@@ -5166,7 +5211,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5166
5211
  var i = 0;
5167
5212
  for (var _i = 0, gTotalIndex_1 = gTotalIndex; _i < gTotalIndex_1.length; _i++) {
5168
5213
  var rIndex = gTotalIndex_1[_i];
5169
- totalValues[valueContent[i]] = this.getAggregateValue((rIndex[0]).index, (rIndex[1]).indexObject, mPos, aggregate);
5214
+ totalValues[valueContent[i]] = this.getAggregateValue((rIndex[0]).index, (rIndex[1]).indexObject, mPos, aggregate, i === 0 ? false : true);
5170
5215
  i++;
5171
5216
  }
5172
5217
  var val_1 = ((totalValues.cVal) * (totalValues.gTotalVal)) / ((totalValues.rTotalVal) * (totalValues.cTotalVal));
@@ -5187,7 +5232,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5187
5232
  var i = 0;
5188
5233
  for (var _a = 0, gTotalIndex_2 = gTotalIndex; _a < gTotalIndex_2.length; _a++) {
5189
5234
  var rIndex = gTotalIndex_2[_a];
5190
- totalValues[valueContent[i]] = this.getAggregateValue((rIndex[0]).index, (rIndex[1]).indexObject, mPos, aggregate);
5235
+ totalValues[valueContent[i]] = this.getAggregateValue((rIndex[0]).index, (rIndex[1]).indexObject, mPos, aggregate, i === 0 ? false : true);
5191
5236
  i++;
5192
5237
  }
5193
5238
  var val_2 = ((totalValues.cVal) / (totalValues.gTotalVal));
@@ -5198,7 +5243,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5198
5243
  }
5199
5244
  break;
5200
5245
  default:
5201
- var val = this.getAggregateValue(rows[rln].index, columns[cln].indexObject, mPos, aggregate);
5246
+ var val = this.getAggregateValue(rows[rln].index, columns[cln].indexObject, mPos, aggregate, false);
5202
5247
  value = (rows[rln].members.length > 0 && rows[rln].hasChild && rows[rln].isDrilled && ((!isNullOrUndefined(rows[rln].showSubTotals) && !rows[rln].showSubTotals) ||
5203
5248
  !this.showSubTotals || !this.showRowSubTotals)) ? undefined : val;
5204
5249
  actualValue = val;
@@ -5236,6 +5281,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5236
5281
  isNaN(value) && !isNullOrUndefined(value) &&
5237
5282
  (['PopulationStDev', 'SampleStDev', 'PopulationVar', 'SampleVar']).indexOf(aggregate) !== -1) {
5238
5283
  formattedText = '#DIV/0!';
5284
+ value = 0;
5239
5285
  }
5240
5286
  //dln = data[tnum].length;
5241
5287
  formattedText = (cellDetails.skipFormatting ? isNullOrUndefined(value) ?
@@ -5244,8 +5290,8 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5244
5290
  axis: 'value', actualText: field, indexObject: this.isDrillThrough ? this.rawIndexObject : {},
5245
5291
  rowHeaders: rows[rln].type === 'grand sum' ? '' : rows[rln].valueSort.levelName,
5246
5292
  columnHeaders: columns[cln].type === 'grand sum' ? '' : columns[cln].valueSort.levelName,
5247
- formattedText: formattedText, value: isNullOrUndefined(value) ? 0 : value,
5248
- actualValue: isNullOrUndefined(actualValue) ? 0 : actualValue,
5293
+ formattedText: formattedText, value: value,
5294
+ actualValue: actualValue,
5249
5295
  rowIndex: tnum, colIndex: dln, isSum: isSum, isGrandSum: isGrand, showSubTotals: !subTotal
5250
5296
  };
5251
5297
  this.rawIndexObject = {};
@@ -5548,7 +5594,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5548
5594
  }
5549
5595
  };
5550
5596
  /* eslint-disable */
5551
- PivotEngine.prototype.getAggregateValue = function (rowIndex, columnIndex, value, type) {
5597
+ PivotEngine.prototype.getAggregateValue = function (rowIndex, columnIndex, value, type, isGrandTotal) {
5552
5598
  //rowIndex = rowIndex.sort();
5553
5599
  //columnIndex = columnIndex.sort();
5554
5600
  var rlt = rowIndex.length;
@@ -5727,7 +5773,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5727
5773
  var value_1 = aggregateField[aggregatedValue.formula];
5728
5774
  if (value_1 === undefined) {
5729
5775
  var type_1 = aggregatedValue.type;
5730
- value_1 = this.getAggregateValue(rowIndex, columnIndex, aggregatedValue.index, type_1);
5776
+ value_1 = this.getAggregateValue(rowIndex, columnIndex, aggregatedValue.index, type_1, false);
5731
5777
  aggregateField[aggregatedValue.formula] = value_1;
5732
5778
  }
5733
5779
  actualFormula = (actualFormula).replace(aggregatedValue.formula, String(value_1));
@@ -5741,7 +5787,9 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5741
5787
  while (rowIndex[ri] !== undefined) {
5742
5788
  if (columnIndex[rowIndex[ri]] !== undefined) {
5743
5789
  isValueExist = true;
5744
- this.rawIndexObject[rowIndex[ri]] = rowIndex[ri];
5790
+ if (!isGrandTotal) {
5791
+ this.rawIndexObject[rowIndex[ri]] = rowIndex[ri];
5792
+ }
5745
5793
  //let cIndx: number = isLeastLevel ? columnIndex.splice(columnIndex.indexOf(rowIndex[ri]), 1)[0] : rowIndex[ri];
5746
5794
  var currentVal = this.valueMatrix[rowIndex[ri]][value];
5747
5795
  if (isNullOrUndefined(cellValue) && isNullOrUndefined(currentVal)) {
@@ -7536,6 +7584,7 @@ var Render = /** @__PURE__ @class */ (function () {
7536
7584
  Render.prototype.bindGrid = function (parent, isEmpty) {
7537
7585
  this.injectGridModules(parent);
7538
7586
  this.parent.grid = new Grid({
7587
+ cssClass: this.parent.cssClass,
7539
7588
  frozenColumns: 1,
7540
7589
  frozenRows: 0,
7541
7590
  enableHover: false,
@@ -7728,9 +7777,6 @@ var Render = /** @__PURE__ @class */ (function () {
7728
7777
  /* eslint-disable */
7729
7778
  Render.prototype.contextMenuOpen = function (args) {
7730
7779
  var _this = this;
7731
- if (args.element && this.parent.cssClass) {
7732
- addClass([args.element.parentElement], this.parent.cssClass);
7733
- }
7734
7780
  var _loop_1 = function (item) {
7735
7781
  var cellTarget = this_1.parent.lastCellClicked;
7736
7782
  var elem = null;
@@ -9198,6 +9244,12 @@ var Render = /** @__PURE__ @class */ (function () {
9198
9244
  }
9199
9245
  }
9200
9246
  else {
9247
+ if ((['PercentageOfDifferenceFrom', 'PercentageOfRowTotal', 'PercentageOfColumnTotal', 'PercentageOfGrandTotal', 'PercentageOfParentRowTotal', 'PercentageOfParentColumnTotal', 'PercentageOfParentTotal']).indexOf(field.type) > -1) {
9248
+ format = 'P2';
9249
+ }
9250
+ else if (['PopulationStDev', 'SampleStDev', 'PopulationVar', 'SampleVar', 'Index'].indexOf(field.type) > -1) {
9251
+ format = undefined;
9252
+ }
9201
9253
  if (this.parent.dataSourceSettings.formatSettings.length > 0) {
9202
9254
  for (var fCnt = 0; fCnt < this.parent.dataSourceSettings.formatSettings.length; fCnt++) {
9203
9255
  var formatSettings = this.parent.dataSourceSettings.formatSettings[fCnt];
@@ -9292,12 +9344,18 @@ var Render = /** @__PURE__ @class */ (function () {
9292
9344
  else {
9293
9345
  this.colPos++;
9294
9346
  /* eslint-disable-next-line */
9295
- if (isNullOrUndefined(args.data[this.colPos].value) || isNullOrUndefined(args.data[this.colPos].formattedText) || args.data[this.colPos].formattedText === "") {
9347
+ var pivotValue = args.data[this.colPos];
9348
+ if (isNullOrUndefined(pivotValue.value) || isNullOrUndefined(pivotValue.formattedText) || pivotValue.formattedText === "") {
9296
9349
  args.value = this.parent.exportType === 'Excel' ? null : '';
9297
9350
  }
9298
9351
  else {
9299
- /* eslint-disable-next-line */
9300
- args.value = !isNullOrUndefined(args.data[this.colPos].value) ? args.data[this.colPos].value : args.data[this.colPos].formattedText;
9352
+ var aggMatrix = this.parent.dataType === 'pivot' && this.parent.engineModule ? this.parent.engineModule.aggregatedValueMatrix : undefined;
9353
+ if (aggMatrix && aggMatrix[pivotValue.rowIndex] && aggMatrix[pivotValue.rowIndex][pivotValue.colIndex]) {
9354
+ args.value = aggMatrix[pivotValue.rowIndex][pivotValue.colIndex];
9355
+ }
9356
+ else {
9357
+ args.value = !isNullOrUndefined(pivotValue.value) ? (pivotValue.formattedText === '#DIV/0!' ? pivotValue.formattedText : pivotValue.value) : pivotValue.formattedText;
9358
+ }
9301
9359
  }
9302
9360
  }
9303
9361
  args = this.exportContentEvent(args);
@@ -9739,6 +9797,15 @@ var EventBase = /** @__PURE__ @class */ (function () {
9739
9797
  /* eslint-disable */
9740
9798
  var membersInfo = fieldInfo && fieldInfo.membersOrder ?
9741
9799
  fieldInfo.membersOrder.slice() : [];
9800
+ var outOfRange = void 0;
9801
+ if (members[0].actualText === 'Out of Range') {
9802
+ outOfRange = members[0];
9803
+ members.splice(0, 1);
9804
+ }
9805
+ else if (members[members.length - 1].actualText === 'Out of Range') {
9806
+ outOfRange = members[members.length - 1];
9807
+ members.splice(members.length - 1, 1);
9808
+ }
9742
9809
  var sortDetails = {
9743
9810
  fieldName: fieldName,
9744
9811
  sortOrder: fieldInfo.sort,
@@ -9760,6 +9827,24 @@ var EventBase = /** @__PURE__ @class */ (function () {
9760
9827
  isInclude = this.isValidFilterItemsAvail(fieldName, filterObj) && filterObj.type === 'Include' ? true : false;
9761
9828
  filterItems = filterObj.items ? filterObj.items : [];
9762
9829
  }
9830
+ if (outOfRange) {
9831
+ if (sortDetails.sortOrder === 'Ascending') {
9832
+ if (members[members.length - 1].actualText === 'Grand Total') {
9833
+ members.splice(members.length - 1, 0, outOfRange);
9834
+ }
9835
+ else {
9836
+ members.splice(members.length, 0, outOfRange);
9837
+ }
9838
+ }
9839
+ else {
9840
+ if (members[0].actualText === 'Grand Total') {
9841
+ members.splice(1, 0, outOfRange);
9842
+ }
9843
+ else {
9844
+ members.splice(0, 0, outOfRange);
9845
+ }
9846
+ }
9847
+ }
9763
9848
  if (isHeaderSortByDefault) {
9764
9849
  var copyOrder = [];
9765
9850
  for (var m = 0, n = 0; m < members.length; m++) {
@@ -13940,9 +14025,8 @@ var DrillThroughDialog = /** @__PURE__ @class */ (function () {
13940
14025
  }
13941
14026
  var actualText = eventArgs.currentCell.actualText.toString();
13942
14027
  try {
13943
- if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
13944
- this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
13945
- this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
14028
+ if (this.parent.currentView === 'Table' && this.parent.editSettings.allowInlineEditing &&
14029
+ this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1) {
13946
14030
  this.parent.actionObj.actionName = editRecord;
13947
14031
  if (this.parent.actionBeginMethod()) {
13948
14032
  return;
@@ -14105,9 +14189,9 @@ var DrillThroughDialog = /** @__PURE__ @class */ (function () {
14105
14189
  var previousData = this.frameHeaderWithKeys(eventArgs.rawData[eventArgs.rawData.length - 1]);
14106
14190
  var currentData = eventArgs.rawData[eventArgs.rawData.length - 1];
14107
14191
  /* eslint-enable */
14108
- if (eventArgs.currentCell.actualText in previousData) {
14109
- currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
14110
- }
14192
+ // if (eventArgs.currentCell.actualText in previousData) {
14193
+ // currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
14194
+ // }
14111
14195
  var actionInfo = {
14112
14196
  editInfo: { type: 'Inline editing', action: 'update', data: this.gridData }
14113
14197
  };
@@ -14239,6 +14323,7 @@ var DrillThroughDialog = /** @__PURE__ @class */ (function () {
14239
14323
  var drillThroughGrid = createElement('div', { id: this.parent.element.id + '_drillthroughgrid', className: DRILLTHROUGH_GRID_CLASS });
14240
14324
  Grid.Inject(Selection, Reorder, Resize, Toolbar, ColumnChooser);
14241
14325
  this.drillThroughGrid = new Grid({
14326
+ cssClass: this.parent.cssClass,
14242
14327
  gridLines: 'Default',
14243
14328
  allowResizing: true,
14244
14329
  allowReordering: true,
@@ -14555,7 +14640,7 @@ var DrillThrough = /** @__PURE__ @class */ (function () {
14555
14640
  var valueCaption = '';
14556
14641
  var aggType = '';
14557
14642
  var rawData = [];
14558
- if (pivotValue.rowHeaders !== undefined && pivotValue.columnHeaders !== undefined && !isNullOrUndefined(pivotValue.value)) {
14643
+ if (pivotValue.rowHeaders !== undefined && pivotValue.columnHeaders !== undefined) {
14559
14644
  if (this.parent.dataType === 'olap') {
14560
14645
  var tupleInfo = void 0;
14561
14646
  if (this.parent.dataSourceSettings.valueAxis === 'row') {
@@ -14628,7 +14713,7 @@ var DrillThrough = /** @__PURE__ @class */ (function () {
14628
14713
  }
14629
14714
  }
14630
14715
  if (!isNullOrUndefined(rawData[k])) {
14631
- var calculatedFeildValue = this.parent.engineModule.getAggregateValue([Number(indexArray[k])], colIndex, indexValue, 'calculatedfield');
14716
+ var calculatedFeildValue = this.parent.engineModule.getAggregateValue([Number(indexArray[k])], colIndex, indexValue, 'calculatedfield', false);
14632
14717
  rawData[k][this.parent.dataSourceSettings.calculatedFieldSettings[i].name] = (isNaN(calculatedFeildValue) && isNullOrUndefined(calculatedFeildValue)) ? '#DIV/0!' : calculatedFeildValue;
14633
14718
  }
14634
14719
  }
@@ -15003,7 +15088,7 @@ var PivotChart = /** @__PURE__ @class */ (function () {
15003
15088
  var columnSeries = colHeaders + ' | ' + actualText;
15004
15089
  var yValue = (this.parent.dataType === 'pivot' ? (this.engineModule.aggregatedValueMatrix[rowIndex] &&
15005
15090
  !isNullOrUndefined(this.engineModule.aggregatedValueMatrix[rowIndex][cellIndex])) ?
15006
- Number(this.engineModule.aggregatedValueMatrix[rowIndex][cellIndex]) : Number(cell.value) : Number(cell.value));
15091
+ Number(this.engineModule.aggregatedValueMatrix[rowIndex][cellIndex]) : (!isNullOrUndefined(cell.value) ? Number(cell.value) : cell.value) : (!isNullOrUndefined(cell.value) ? Number(cell.value) : cell.value));
15007
15092
  yValue = yValue === Infinity ? null : yValue;
15008
15093
  if (yValue === 0) {
15009
15094
  this.accEmptyPoint = true;
@@ -15112,6 +15197,9 @@ var PivotChart = /** @__PURE__ @class */ (function () {
15112
15197
  if (this.persistSettings.chartSeries && this.persistSettings.chartSeries.emptyPointSettings) {
15113
15198
  currentSeries.emptyPointSettings = this.persistSettings.chartSeries.emptyPointSettings;
15114
15199
  }
15200
+ if (!currentSeries.emptyPointSettings) {
15201
+ currentSeries.emptyPointSettings = { mode: 'Zero' };
15202
+ }
15115
15203
  this.chartSeries = this.chartSeries.concat(currentSeries);
15116
15204
  }
15117
15205
  }
@@ -16947,7 +17035,7 @@ var EmptyPointSettings = /** @__PURE__ @class */ (function (_super) {
16947
17035
  Complex({ color: 'transparent', width: 0 }, Border)
16948
17036
  ], EmptyPointSettings.prototype, "border", void 0);
16949
17037
  __decorate$3([
16950
- Property('Gap')
17038
+ Property('Zero')
16951
17039
  ], EmptyPointSettings.prototype, "mode", void 0);
16952
17040
  return EmptyPointSettings;
16953
17041
  }(ChildProperty));
@@ -17392,7 +17480,7 @@ var PivotChartSeriesEmptyPointSettings = /** @__PURE__ @class */ (function () {
17392
17480
  Complex({ color: 'transparent', width: 0 }, Border)
17393
17481
  ], PivotChartSeriesEmptyPointSettings.prototype, "border", void 0);
17394
17482
  __decorate$3([
17395
- Property('Gap')
17483
+ Property('Zero')
17396
17484
  ], PivotChartSeriesEmptyPointSettings.prototype, "mode", void 0);
17397
17485
  return PivotChartSeriesEmptyPointSettings;
17398
17486
  }());
@@ -19886,9 +19974,7 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19886
19974
  var lastAllStartPos;
19887
19975
  var lastAllCount;
19888
19976
  var availAllMember = false;
19889
- var withoutAllEndPos = -1;
19890
19977
  var isGrandtoalDataAdd = false;
19891
- var prevTupInfo;
19892
19978
  var isGrandTotalTop = false;
19893
19979
  while (tupPos < tuples.length && !isGrandtoalDataAdd) {
19894
19980
  var members = tuples[this.customArgs.action === 'down' ?
@@ -19897,21 +19983,11 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19897
19983
  var allStartPos = this.tupRowInfo[tupPos].allStartPos;
19898
19984
  var measure = this.tupRowInfo[tupPos].measure;
19899
19985
  var typeColl_1 = this.tupRowInfo[tupPos].typeCollection;
19900
- var drillStartPos = this.tupRowInfo[tupPos].drillStartPos;
19901
- var startDrillUniquename = this.tupRowInfo[tupPos].startDrillUniquename;
19902
19986
  if (tupPos === 0 && (members.length > (allCount + (measure ? 1 : 0)) || (members.length === 1 && measure))) {
19903
19987
  gTotals.pop();
19904
19988
  }
19905
19989
  if ((tupPos === 0 && this.isPaging) ? gTotals.length === 0 :
19906
19990
  (!availAllMember || allCount === lastAllCount || allStartPos !== lastAllStartPos || (members.length === 1 && measure))) {
19907
- var attrDrill = this.checkAttributeDrill(this.tupRowInfo[tupPos].drillInfo, 'rows');
19908
- var drillAllow = drillStartPos > -1 ? (allCount > 0 ? (attrDrill || allStartPos > drillStartPos) : true) : true;
19909
- drillAllow = (prevTupInfo && drillAllow && drillStartPos > -1) ?
19910
- (prevTupInfo.startDrillUniquename !== startDrillUniquename ? true :
19911
- ((withoutAllEndPos > prevTupInfo.measurePosition ? false :
19912
- prevTupInfo.measureName !== this.tupRowInfo[tupPos].measureName) &&
19913
- (allStartPos === (drillStartPos + 1) || this.tupRowInfo[tupPos].measurePosition === (drillStartPos + 1))))
19914
- : drillAllow;
19915
19991
  if (members.length === allCount + (measure ? 1 : 0) && measure && !isGrandTotalTop) {
19916
19992
  var levelName = 'Grand Total.' + members[measurePos].querySelector('Caption').textContent;
19917
19993
  var formattedText = (typeColl_1[measurePos] === '3' && this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
@@ -25288,7 +25364,7 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
25288
25364
  if (cell && hasField) {
25289
25365
  var rowHeaders = this.getRowText(rowIndex, 0);
25290
25366
  var columnHeaders = this.getColText(0, colIndex, rowIndex);
25291
- var value = ((cell.formattedText === '0' || cell.formattedText === '') ? this.localeObj.getConstant('noValue') :
25367
+ var value = (cell.formattedText === '' ? this.localeObj.getConstant('noValue') :
25292
25368
  cell.formattedText);
25293
25369
  if (this.tooltipTemplate && this.getTooltipTemplate() !== undefined) {
25294
25370
  var rowFields = this.getHeaderField(rowIndex, colIndex, 'row');
@@ -25497,9 +25573,12 @@ var PivotView = /** @__PURE__ @class */ (function (_super) {
25497
25573
  }
25498
25574
  var target = e.target;
25499
25575
  var ele = null;
25576
+ var axis = (target.parentElement.classList.contains(ROWSHEADER) || target.classList.contains(ROWSHEADER)) ? 'row' : 'column';
25577
+ ele = axis === 'column' ? closest(target, 'th') : closest(target, 'td');
25578
+ if (axis === 'column' && !ele && this.gridSettings.selectionSettings.mode !== 'Row') {
25579
+ ele = closest(target, 'td');
25580
+ }
25500
25581
  if (!target.classList.contains(COLLAPSE) && !target.classList.contains(EXPAND) && this.enableValueSorting && this.dataType === 'pivot') {
25501
- var axis = (target.parentElement.classList.contains(ROWSHEADER) || target.classList.contains(ROWSHEADER)) ? 'row' : 'column';
25502
- ele = axis === 'column' ? closest(target, 'th') : closest(target, 'td');
25503
25582
  this.cellClicked(target, ele, e);
25504
25583
  try {
25505
25584
  if ((ele.parentElement.parentElement.parentElement.parentElement.classList.contains('e-movableheader')
@@ -27612,7 +27691,8 @@ var ExcelExport$1 = /** @__PURE__ @class */ (function () {
27612
27691
  var styles = (pivotCell.axis == 'row') ? { hAlign: 'Left', bold: true, wrapText: true } : { numberFormat: formatList[field], bold: false, wrapText: true };
27613
27692
  var headerStyle = { bold: true, vAlign: 'Center', wrapText: true, indent: cCnt === 0 ? pivotCell.level * 10 : 0 };
27614
27693
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
27615
- var cellValue = pivotCell.axis === 'value' ? pivotCell.value : pivotCell.formattedText;
27694
+ var aggMatrix = this.parent.engineModule.aggregatedValueMatrix;
27695
+ var cellValue = pivotCell.axis === 'value' ? ((aggMatrix[rCnt] && aggMatrix[rCnt][cCnt]) ? aggMatrix[rCnt][cCnt] : (pivotCell.formattedText === '#DIV/0!' ? pivotCell.formattedText : pivotCell.value)) : pivotCell.formattedText;
27616
27696
  var isgetValuesHeader = ((this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row')
27617
27697
  || (this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column'));
27618
27698
  if (pivotCell.type === 'grand sum' && !(this.parent.dataSourceSettings.values.length === 1 && this.parent.dataSourceSettings.valueAxis === 'row' && pivotCell.axis === 'column')) {
@@ -28753,7 +28833,7 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
28753
28833
  this.parent.actionFailureMethod(execption);
28754
28834
  }
28755
28835
  };
28756
- DialogRenderer.prototype.onCloseFieldList = function () {
28836
+ DialogRenderer.prototype.onCloseFieldList = function (args) {
28757
28837
  if (this.parent.allowDeferLayoutUpdate) {
28758
28838
  this.parent.dataSourceSettings =
28759
28839
  extend({}, this.parent.clonedDataSource.properties, null, true); /* eslint-disable-line */
@@ -28776,7 +28856,9 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
28776
28856
  }
28777
28857
  if (this.parent.isPopupView && this.parent.pivotGridModule) {
28778
28858
  this.parent.pivotGridModule.notify(uiUpdate, this);
28779
- this.parent.pivotGridModule.notify(contentReady, this);
28859
+ if (!args.currentTarget.classList.contains('e-defer-cancel-button')) {
28860
+ this.parent.pivotGridModule.notify(contentReady, this);
28861
+ }
28780
28862
  }
28781
28863
  else {
28782
28864
  this.cancelButtonClick();
@@ -36715,7 +36797,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
36715
36797
  Toolbar$$1.prototype.saveReport = function (args) {
36716
36798
  if (this.currentReport && this.currentReport !== '' && args.item.id === (this.parent.element.id + 'save')) {
36717
36799
  var saveArgs = {
36718
- report: this.parent.getPersistData(),
36800
+ report: this.getCurrentReport(),
36719
36801
  reportName: this.currentReport
36720
36802
  };
36721
36803
  this.parent.actionObj.actionName = this.parent.getActionCompleteName();
@@ -36973,7 +37055,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
36973
37055
  return;
36974
37056
  }
36975
37057
  var saveArgs = {
36976
- report: _this_2.parent.getPersistData(),
37058
+ report: _this_2.getCurrentReport(),
36977
37059
  reportName: reportInput.value
36978
37060
  };
36979
37061
  var actionInfo = {
@@ -37009,7 +37091,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
37009
37091
  }
37010
37092
  _this_3.parent.trigger(newReport);
37011
37093
  var saveArgs = {
37012
- report: _this_3.parent.getPersistData(),
37094
+ report: _this_3.getCurrentReport(),
37013
37095
  reportName: reportInput.value
37014
37096
  };
37015
37097
  var actionInfo = {
@@ -37153,7 +37235,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
37153
37235
  else if (this.action === 'New' || (this.action !== 'Save' && this.action !== 'Rename' && this.action !== 'New')) {
37154
37236
  if (this.currentReport && this.currentReport !== '' && this.parent.isModified) {
37155
37237
  var saveArgs = {
37156
- report: this.parent.getPersistData(),
37238
+ report: this.getCurrentReport(),
37157
37239
  reportName: this.currentReport
37158
37240
  };
37159
37241
  var actionInfo = {
@@ -37178,7 +37260,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
37178
37260
  else if (this.action === 'New') {
37179
37261
  this.parent.trigger(newReport);
37180
37262
  var saveArgs = {
37181
- report: this.parent.getPersistData(),
37263
+ report: this.getCurrentReport(),
37182
37264
  reportName: this.currentReport
37183
37265
  };
37184
37266
  this.parent.trigger(saveReport, saveArgs);
@@ -37189,7 +37271,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
37189
37271
  }
37190
37272
  else if (this.action === 'Save') {
37191
37273
  var saveArgs = {
37192
- report: this.parent.getPersistData(),
37274
+ report: this.getCurrentReport(),
37193
37275
  reportName: this.currentReport
37194
37276
  };
37195
37277
  this.parent.trigger(saveReport, saveArgs);
@@ -37488,6 +37570,15 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
37488
37570
  }
37489
37571
  this.updateItemElements();
37490
37572
  };
37573
+ Toolbar$$1.prototype.getCurrentReport = function () {
37574
+ var reportStr = this.parent.getPersistData();
37575
+ if (this.parent.dataSourceSettings.type === 'CSV') {
37576
+ var reportSettings = JSON.parse(reportStr);
37577
+ reportSettings.dataSourceSettings.dataSource.splice(0, 0, this.parent.engineModule.fields);
37578
+ reportStr = JSON.stringify(reportSettings);
37579
+ }
37580
+ return reportStr;
37581
+ };
37491
37582
  Toolbar$$1.prototype.updateItemElements = function () {
37492
37583
  var itemElements = [].slice.call(this.toolbar.element.querySelectorAll('.e-toolbar-item'));
37493
37584
  for (var _i = 0, itemElements_1 = itemElements; _i < itemElements_1.length; _i++) {