@syncfusion/ej2-pivotview 20.1.58 → 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.
@@ -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,
@@ -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;
@@ -5549,7 +5594,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5549
5594
  }
5550
5595
  };
5551
5596
  /* eslint-disable */
5552
- PivotEngine.prototype.getAggregateValue = function (rowIndex, columnIndex, value, type) {
5597
+ PivotEngine.prototype.getAggregateValue = function (rowIndex, columnIndex, value, type, isGrandTotal) {
5553
5598
  //rowIndex = rowIndex.sort();
5554
5599
  //columnIndex = columnIndex.sort();
5555
5600
  var rlt = rowIndex.length;
@@ -5728,7 +5773,7 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5728
5773
  var value_1 = aggregateField[aggregatedValue.formula];
5729
5774
  if (value_1 === undefined) {
5730
5775
  var type_1 = aggregatedValue.type;
5731
- value_1 = this.getAggregateValue(rowIndex, columnIndex, aggregatedValue.index, type_1);
5776
+ value_1 = this.getAggregateValue(rowIndex, columnIndex, aggregatedValue.index, type_1, false);
5732
5777
  aggregateField[aggregatedValue.formula] = value_1;
5733
5778
  }
5734
5779
  actualFormula = (actualFormula).replace(aggregatedValue.formula, String(value_1));
@@ -5742,7 +5787,9 @@ var PivotEngine = /** @__PURE__ @class */ (function () {
5742
5787
  while (rowIndex[ri] !== undefined) {
5743
5788
  if (columnIndex[rowIndex[ri]] !== undefined) {
5744
5789
  isValueExist = true;
5745
- this.rawIndexObject[rowIndex[ri]] = rowIndex[ri];
5790
+ if (!isGrandTotal) {
5791
+ this.rawIndexObject[rowIndex[ri]] = rowIndex[ri];
5792
+ }
5746
5793
  //let cIndx: number = isLeastLevel ? columnIndex.splice(columnIndex.indexOf(rowIndex[ri]), 1)[0] : rowIndex[ri];
5747
5794
  var currentVal = this.valueMatrix[rowIndex[ri]][value];
5748
5795
  if (isNullOrUndefined(cellValue) && isNullOrUndefined(currentVal)) {
@@ -9302,8 +9349,8 @@ var Render = /** @__PURE__ @class */ (function () {
9302
9349
  args.value = this.parent.exportType === 'Excel' ? null : '';
9303
9350
  }
9304
9351
  else {
9305
- var aggMatrix = this.parent.engineModule.aggregatedValueMatrix;
9306
- if (aggMatrix[pivotValue.rowIndex] && aggMatrix[pivotValue.rowIndex][pivotValue.colIndex]) {
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]) {
9307
9354
  args.value = aggMatrix[pivotValue.rowIndex][pivotValue.colIndex];
9308
9355
  }
9309
9356
  else {
@@ -9750,6 +9797,15 @@ var EventBase = /** @__PURE__ @class */ (function () {
9750
9797
  /* eslint-disable */
9751
9798
  var membersInfo = fieldInfo && fieldInfo.membersOrder ?
9752
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
+ }
9753
9809
  var sortDetails = {
9754
9810
  fieldName: fieldName,
9755
9811
  sortOrder: fieldInfo.sort,
@@ -9771,6 +9827,24 @@ var EventBase = /** @__PURE__ @class */ (function () {
9771
9827
  isInclude = this.isValidFilterItemsAvail(fieldName, filterObj) && filterObj.type === 'Include' ? true : false;
9772
9828
  filterItems = filterObj.items ? filterObj.items : [];
9773
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
+ }
9774
9848
  if (isHeaderSortByDefault) {
9775
9849
  var copyOrder = [];
9776
9850
  for (var m = 0, n = 0; m < members.length; m++) {
@@ -13951,9 +14025,8 @@ var DrillThroughDialog = /** @__PURE__ @class */ (function () {
13951
14025
  }
13952
14026
  var actualText = eventArgs.currentCell.actualText.toString();
13953
14027
  try {
13954
- if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
13955
- this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
13956
- 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) {
13957
14030
  this.parent.actionObj.actionName = editRecord;
13958
14031
  if (this.parent.actionBeginMethod()) {
13959
14032
  return;
@@ -14116,9 +14189,9 @@ var DrillThroughDialog = /** @__PURE__ @class */ (function () {
14116
14189
  var previousData = this.frameHeaderWithKeys(eventArgs.rawData[eventArgs.rawData.length - 1]);
14117
14190
  var currentData = eventArgs.rawData[eventArgs.rawData.length - 1];
14118
14191
  /* eslint-enable */
14119
- if (eventArgs.currentCell.actualText in previousData) {
14120
- currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
14121
- }
14192
+ // if (eventArgs.currentCell.actualText in previousData) {
14193
+ // currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
14194
+ // }
14122
14195
  var actionInfo = {
14123
14196
  editInfo: { type: 'Inline editing', action: 'update', data: this.gridData }
14124
14197
  };
@@ -14567,7 +14640,7 @@ var DrillThrough = /** @__PURE__ @class */ (function () {
14567
14640
  var valueCaption = '';
14568
14641
  var aggType = '';
14569
14642
  var rawData = [];
14570
- if (pivotValue.rowHeaders !== undefined && pivotValue.columnHeaders !== undefined && !isNullOrUndefined(pivotValue.value)) {
14643
+ if (pivotValue.rowHeaders !== undefined && pivotValue.columnHeaders !== undefined) {
14571
14644
  if (this.parent.dataType === 'olap') {
14572
14645
  var tupleInfo = void 0;
14573
14646
  if (this.parent.dataSourceSettings.valueAxis === 'row') {
@@ -14640,7 +14713,7 @@ var DrillThrough = /** @__PURE__ @class */ (function () {
14640
14713
  }
14641
14714
  }
14642
14715
  if (!isNullOrUndefined(rawData[k])) {
14643
- 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);
14644
14717
  rawData[k][this.parent.dataSourceSettings.calculatedFieldSettings[i].name] = (isNaN(calculatedFeildValue) && isNullOrUndefined(calculatedFeildValue)) ? '#DIV/0!' : calculatedFeildValue;
14645
14718
  }
14646
14719
  }
@@ -15124,6 +15197,9 @@ var PivotChart = /** @__PURE__ @class */ (function () {
15124
15197
  if (this.persistSettings.chartSeries && this.persistSettings.chartSeries.emptyPointSettings) {
15125
15198
  currentSeries.emptyPointSettings = this.persistSettings.chartSeries.emptyPointSettings;
15126
15199
  }
15200
+ if (!currentSeries.emptyPointSettings) {
15201
+ currentSeries.emptyPointSettings = { mode: 'Zero' };
15202
+ }
15127
15203
  this.chartSeries = this.chartSeries.concat(currentSeries);
15128
15204
  }
15129
15205
  }
@@ -16959,7 +17035,7 @@ var EmptyPointSettings = /** @__PURE__ @class */ (function (_super) {
16959
17035
  Complex({ color: 'transparent', width: 0 }, Border)
16960
17036
  ], EmptyPointSettings.prototype, "border", void 0);
16961
17037
  __decorate$3([
16962
- Property('Gap')
17038
+ Property('Zero')
16963
17039
  ], EmptyPointSettings.prototype, "mode", void 0);
16964
17040
  return EmptyPointSettings;
16965
17041
  }(ChildProperty));
@@ -17404,7 +17480,7 @@ var PivotChartSeriesEmptyPointSettings = /** @__PURE__ @class */ (function () {
17404
17480
  Complex({ color: 'transparent', width: 0 }, Border)
17405
17481
  ], PivotChartSeriesEmptyPointSettings.prototype, "border", void 0);
17406
17482
  __decorate$3([
17407
- Property('Gap')
17483
+ Property('Zero')
17408
17484
  ], PivotChartSeriesEmptyPointSettings.prototype, "mode", void 0);
17409
17485
  return PivotChartSeriesEmptyPointSettings;
17410
17486
  }());
@@ -19898,9 +19974,7 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19898
19974
  var lastAllStartPos;
19899
19975
  var lastAllCount;
19900
19976
  var availAllMember = false;
19901
- var withoutAllEndPos = -1;
19902
19977
  var isGrandtoalDataAdd = false;
19903
- var prevTupInfo;
19904
19978
  var isGrandTotalTop = false;
19905
19979
  while (tupPos < tuples.length && !isGrandtoalDataAdd) {
19906
19980
  var members = tuples[this.customArgs.action === 'down' ?
@@ -19909,21 +19983,11 @@ var OlapEngine = /** @__PURE__ @class */ (function () {
19909
19983
  var allStartPos = this.tupRowInfo[tupPos].allStartPos;
19910
19984
  var measure = this.tupRowInfo[tupPos].measure;
19911
19985
  var typeColl_1 = this.tupRowInfo[tupPos].typeCollection;
19912
- var drillStartPos = this.tupRowInfo[tupPos].drillStartPos;
19913
- var startDrillUniquename = this.tupRowInfo[tupPos].startDrillUniquename;
19914
19986
  if (tupPos === 0 && (members.length > (allCount + (measure ? 1 : 0)) || (members.length === 1 && measure))) {
19915
19987
  gTotals.pop();
19916
19988
  }
19917
19989
  if ((tupPos === 0 && this.isPaging) ? gTotals.length === 0 :
19918
19990
  (!availAllMember || allCount === lastAllCount || allStartPos !== lastAllStartPos || (members.length === 1 && measure))) {
19919
- var attrDrill = this.checkAttributeDrill(this.tupRowInfo[tupPos].drillInfo, 'rows');
19920
- var drillAllow = drillStartPos > -1 ? (allCount > 0 ? (attrDrill || allStartPos > drillStartPos) : true) : true;
19921
- drillAllow = (prevTupInfo && drillAllow && drillStartPos > -1) ?
19922
- (prevTupInfo.startDrillUniquename !== startDrillUniquename ? true :
19923
- ((withoutAllEndPos > prevTupInfo.measurePosition ? false :
19924
- prevTupInfo.measureName !== this.tupRowInfo[tupPos].measureName) &&
19925
- (allStartPos === (drillStartPos + 1) || this.tupRowInfo[tupPos].measurePosition === (drillStartPos + 1))))
19926
- : drillAllow;
19927
19991
  if (members.length === allCount + (measure ? 1 : 0) && measure && !isGrandTotalTop) {
19928
19992
  var levelName = 'Grand Total.' + members[measurePos].querySelector('Caption').textContent;
19929
19993
  var formattedText = (typeColl_1[measurePos] === '3' && this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
@@ -36733,7 +36797,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
36733
36797
  Toolbar$$1.prototype.saveReport = function (args) {
36734
36798
  if (this.currentReport && this.currentReport !== '' && args.item.id === (this.parent.element.id + 'save')) {
36735
36799
  var saveArgs = {
36736
- report: this.parent.getPersistData(),
36800
+ report: this.getCurrentReport(),
36737
36801
  reportName: this.currentReport
36738
36802
  };
36739
36803
  this.parent.actionObj.actionName = this.parent.getActionCompleteName();
@@ -36991,7 +37055,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
36991
37055
  return;
36992
37056
  }
36993
37057
  var saveArgs = {
36994
- report: _this_2.parent.getPersistData(),
37058
+ report: _this_2.getCurrentReport(),
36995
37059
  reportName: reportInput.value
36996
37060
  };
36997
37061
  var actionInfo = {
@@ -37027,7 +37091,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
37027
37091
  }
37028
37092
  _this_3.parent.trigger(newReport);
37029
37093
  var saveArgs = {
37030
- report: _this_3.parent.getPersistData(),
37094
+ report: _this_3.getCurrentReport(),
37031
37095
  reportName: reportInput.value
37032
37096
  };
37033
37097
  var actionInfo = {
@@ -37171,7 +37235,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
37171
37235
  else if (this.action === 'New' || (this.action !== 'Save' && this.action !== 'Rename' && this.action !== 'New')) {
37172
37236
  if (this.currentReport && this.currentReport !== '' && this.parent.isModified) {
37173
37237
  var saveArgs = {
37174
- report: this.parent.getPersistData(),
37238
+ report: this.getCurrentReport(),
37175
37239
  reportName: this.currentReport
37176
37240
  };
37177
37241
  var actionInfo = {
@@ -37196,7 +37260,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
37196
37260
  else if (this.action === 'New') {
37197
37261
  this.parent.trigger(newReport);
37198
37262
  var saveArgs = {
37199
- report: this.parent.getPersistData(),
37263
+ report: this.getCurrentReport(),
37200
37264
  reportName: this.currentReport
37201
37265
  };
37202
37266
  this.parent.trigger(saveReport, saveArgs);
@@ -37207,7 +37271,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
37207
37271
  }
37208
37272
  else if (this.action === 'Save') {
37209
37273
  var saveArgs = {
37210
- report: this.parent.getPersistData(),
37274
+ report: this.getCurrentReport(),
37211
37275
  reportName: this.currentReport
37212
37276
  };
37213
37277
  this.parent.trigger(saveReport, saveArgs);
@@ -37506,6 +37570,15 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
37506
37570
  }
37507
37571
  this.updateItemElements();
37508
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
+ };
37509
37582
  Toolbar$$1.prototype.updateItemElements = function () {
37510
37583
  var itemElements = [].slice.call(this.toolbar.element.querySelectorAll('.e-toolbar-item'));
37511
37584
  for (var _i = 0, itemElements_1 = itemElements; _i < itemElements_1.length; _i++) {