@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.
@@ -862,9 +862,9 @@ class PivotUtil {
862
862
  }
863
863
  else if (type === true) {
864
864
  sortOrder === 'Ascending' ?
865
- (sortMembersOrder.sort((a, b) => (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))) :
865
+ (sortMembersOrder.sort((a, b) => (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))) :
866
866
  sortOrder === 'Descending' ?
867
- (sortMembersOrder.sort((a, b) => (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))) :
867
+ (sortMembersOrder.sort((a, b) => (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))) :
868
868
  sortMembersOrder;
869
869
  }
870
870
  else {
@@ -2536,8 +2536,8 @@ class PivotEngine {
2536
2536
  let mPos = this.fieldList[measure].index;
2537
2537
  let aggregate = this.fieldList[measure].aggregateType;
2538
2538
  this.rawIndexObject = {};
2539
- value = (type === 'row' ? this.getAggregateValue(rows[i].index, columns.indexObject, mPos, aggregate) :
2540
- this.getAggregateValue(columns.index, rows[i].indexObject, mPos, aggregate));
2539
+ value = (type === 'row' ? this.getAggregateValue(rows[i].index, columns.indexObject, mPos, aggregate, false) :
2540
+ this.getAggregateValue(columns.index, rows[i].indexObject, mPos, aggregate, false));
2541
2541
  let cellDetails = {
2542
2542
  fieldName: measure,
2543
2543
  row: rows[i],
@@ -3202,68 +3202,92 @@ class PivotEngine {
3202
3202
  return headers;
3203
3203
  }
3204
3204
  performFilterCommonUpdate(filterItem, headersInfo, addPos) {
3205
- let rawHeaders = headersInfo.axis === 'row' ? this.rMembers : this.cMembers;
3206
- let filterObjects = {};
3207
- for (let item of this.filterMembers) {
3208
- filterObjects[item] = item;
3209
- }
3210
- if (this.fieldFilterMem[filterItem.name]) {
3211
- rawHeaders = this.performFilterDeletion(headersInfo.headers, filterItem, headersInfo, filterObjects, 0);
3212
- }
3213
- if (addPos.length > 0 && headersInfo.fields.length > 0) {
3214
- this.frameHeaderObjectsCollection = true;
3215
- if (headersInfo.fields.filter((item) => { return item.showNoDataItems; }).length > 0) {
3216
- for (let i = 0; i < this.data.length; i++) {
3217
- addPos.push(i);
3205
+ if (headersInfo.axis === 'row' || headersInfo.axis === 'column') {
3206
+ let rawHeaders = headersInfo.axis === 'row' ? this.rMembers : this.cMembers;
3207
+ let filterObjects = {};
3208
+ for (let item of this.filterMembers) {
3209
+ filterObjects[item] = item;
3210
+ }
3211
+ if (this.fieldFilterMem[filterItem.name]) {
3212
+ rawHeaders = this.performFilterDeletion(headersInfo.headers, filterItem, headersInfo, filterObjects, 0);
3213
+ }
3214
+ if (addPos.length > 0 && headersInfo.fields.length > 0) {
3215
+ this.frameHeaderObjectsCollection = true;
3216
+ if (headersInfo.fields.filter((item) => { return item.showNoDataItems; }).length > 0) {
3217
+ for (let i = 0; i < this.data.length; i++) {
3218
+ addPos.push(i);
3219
+ }
3220
+ //addPos = (this.data as any).map((item, pos) => { return pos; });
3221
+ }
3222
+ /* eslint-disable */
3223
+ this.headerObjectsCollection['parent'] = this.getIndexedHeaders(headersInfo.fields, this.data, 0, addPos, headersInfo.axis, '');
3224
+ rawHeaders = this.performFilterAddition(rawHeaders, headersInfo.fields, headersInfo);
3225
+ let headerNames = {};
3226
+ for (let header of rawHeaders) {
3227
+ headerNames[header.valueSort.levelName.toString()] = header.valueSort.levelName.toString();
3228
+ }
3229
+ let excessHeaders = this.headerObjectsCollection['parent'].filter((header) => {
3230
+ return !headerNames[header.valueSort.levelName.toString()];
3231
+ });
3232
+ let grandHeader = rawHeaders.filter((item) => { return item.type === 'grand sum'; });
3233
+ if (grandHeader.length > 0) {
3234
+ rawHeaders.pop();
3235
+ }
3236
+ /* eslint-enable */
3237
+ rawHeaders = this.getSortedHeaders(rawHeaders.concat(excessHeaders), this.fieldList[headersInfo.fields[0].name].sort).concat(grandHeader);
3238
+ if (headersInfo.axis === 'row') {
3239
+ this.cMembers = this.getIndexedHeaders(this.columns, this.data, 0, this.filterMembers, 'column', '');
3240
+ this.insertAllMember(this.cMembers, this.filterMembers, '', 'column');
3241
+ }
3242
+ else {
3243
+ this.rMembers = this.getIndexedHeaders(this.rows, this.data, 0, this.filterMembers, 'row', '');
3244
+ this.insertAllMember(this.rMembers, this.filterMembers, '', 'row');
3218
3245
  }
3219
- //addPos = (this.data as any).map((item, pos) => { return pos; });
3220
3246
  }
3221
- /* eslint-disable */
3222
- this.headerObjectsCollection['parent'] = this.getIndexedHeaders(headersInfo.fields, this.data, 0, addPos, headersInfo.axis, '');
3223
- rawHeaders = this.performFilterAddition(rawHeaders, headersInfo.fields, headersInfo);
3224
- let headerNames = {};
3225
- for (let header of rawHeaders) {
3226
- headerNames[header.valueSort.levelName.toString()] = header.valueSort.levelName.toString();
3227
- }
3228
- let excessHeaders = this.headerObjectsCollection['parent'].filter((header) => {
3229
- return !headerNames[header.valueSort.levelName.toString()];
3230
- });
3231
- let grandHeader = rawHeaders.filter((item) => { return item.type === 'grand sum'; });
3232
- if (grandHeader.length > 0) {
3233
- rawHeaders.pop();
3247
+ if (headersInfo.axis === 'row') {
3248
+ this.rowCount = 0;
3234
3249
  }
3235
- /* eslint-enable */
3236
- rawHeaders = this.getSortedHeaders(rawHeaders.concat(excessHeaders), this.fieldList[headersInfo.fields[0].name].sort).concat(grandHeader);
3250
+ else {
3251
+ this.columnCount = 0;
3252
+ }
3253
+ this.updateHeadersCount(rawHeaders, headersInfo.axis, 0, headersInfo.fields, 'plus', false);
3237
3254
  if (headersInfo.axis === 'row') {
3238
- this.cMembers = this.getIndexedHeaders(this.columns, this.data, 0, this.filterMembers, 'column', '');
3239
- this.insertAllMember(this.cMembers, this.filterMembers, '', 'column');
3255
+ if (headersInfo.position > 0) {
3256
+ this.insertPosition(this.rows, this.data, 0, this.filterMembers, 'row', '', rawHeaders);
3257
+ }
3258
+ this.insertTotalPosition(rawHeaders);
3259
+ this.rMembers = this.headerCollection.rowHeaders = rawHeaders;
3260
+ this.headerCollection.rowHeadersCount = this.rowCount;
3240
3261
  }
3241
3262
  else {
3242
- this.rMembers = this.getIndexedHeaders(this.rows, this.data, 0, this.filterMembers, 'row', '');
3243
- this.insertAllMember(this.rMembers, this.filterMembers, '', 'row');
3263
+ if (headersInfo.position > 0) {
3264
+ this.insertPosition(this.columns, this.data, 0, this.filterMembers, 'column', '', rawHeaders);
3265
+ }
3266
+ this.insertTotalPosition(rawHeaders);
3267
+ this.cMembers = this.headerCollection.columnHeaders = rawHeaders;
3268
+ this.headerCollection.columnHeadersCount = this.columnCount;
3244
3269
  }
3245
3270
  }
3246
- if (headersInfo.axis === 'row') {
3247
- this.rowCount = 0;
3248
- }
3249
3271
  else {
3272
+ let showNoDataItems = (this.rows[0] && this.rows[0].showNoDataItems) || (this.columns[0] && this.columns[0].showNoDataItems);
3273
+ if (this.rows.length > 0) {
3274
+ this.rMembers = this.getIndexedHeaders(this.rows, this.data, 0, showNoDataItems ? addPos : this.filterMembers, 'row', '');
3275
+ }
3276
+ if (this.columns.length > 0) {
3277
+ this.cMembers = this.getIndexedHeaders(this.columns, this.data, 0, showNoDataItems ? addPos : this.filterMembers, 'column', '');
3278
+ }
3279
+ this.insertAllMembersCommon();
3280
+ this.rowCount = 0;
3250
3281
  this.columnCount = 0;
3251
- }
3252
- this.updateHeadersCount(rawHeaders, headersInfo.axis, 0, headersInfo.fields, 'plus', false);
3253
- if (headersInfo.axis === 'row') {
3254
- if (headersInfo.position > 0) {
3255
- this.insertPosition(this.rows, this.data, 0, this.filterMembers, 'row', '', rawHeaders);
3282
+ this.updateHeadersCount(this.cMembers, 'column', 0, this.columns, 'plus', false);
3283
+ this.updateHeadersCount(this.rMembers, 'row', 0, this.rows, 'plus', false);
3284
+ if (showNoDataItems) {
3285
+ this.insertPosition(this.rows, this.data, 0, this.filterMembers, 'row', '', this.rMembers);
3286
+ this.insertPosition(this.columns, this.data, 0, this.filterMembers, 'column', '', this.cMembers);
3256
3287
  }
3257
- this.insertTotalPosition(rawHeaders);
3258
- this.rMembers = this.headerCollection.rowHeaders = rawHeaders;
3288
+ this.headerCollection.rowHeaders = this.rMembers;
3259
3289
  this.headerCollection.rowHeadersCount = this.rowCount;
3260
- }
3261
- else {
3262
- if (headersInfo.position > 0) {
3263
- this.insertPosition(this.columns, this.data, 0, this.filterMembers, 'column', '', rawHeaders);
3264
- }
3265
- this.insertTotalPosition(rawHeaders);
3266
- this.cMembers = this.headerCollection.columnHeaders = rawHeaders;
3290
+ this.headerCollection.columnHeaders = this.cMembers;
3267
3291
  this.headerCollection.columnHeadersCount = this.columnCount;
3268
3292
  }
3269
3293
  this.applyValueSorting();
@@ -3384,15 +3408,13 @@ class PivotEngine {
3384
3408
  }
3385
3409
  else {
3386
3410
  alphaNumbervalue.push(headers[i]);
3411
+ break;
3387
3412
  }
3388
3413
  }
3389
- if (stringValue.length > 1) {
3390
- stringValue = this.sortHeaders(fieldName, childrens, headers, childrens.sort, childrens.type);
3391
- }
3392
3414
  if (alphaNumbervalue.length > 0) {
3393
3415
  alphaNumbervalue = this.sortHeaders(fieldName, childrens, headers, childrens.sort, childrens.isAlphanumeric);
3394
3416
  }
3395
- return headers = nullValue.concat(alphaNumbervalue, stringValue);
3417
+ return headers;
3396
3418
  }
3397
3419
  else {
3398
3420
  return this.sortHeaders(fieldName, childrens, headers, sortOrder, childrens.type);
@@ -3549,7 +3571,7 @@ class PivotEngine {
3549
3571
  }
3550
3572
  else {
3551
3573
  this.rawIndexObject = {};
3552
- let value = this.getAggregateValue(header.index, member.indexObject, mIndex, mType);
3574
+ let value = this.getAggregateValue(header.index, member.indexObject, mIndex, mType, false);
3553
3575
  let cellDetails = {
3554
3576
  fieldName: this.fields[mIndex],
3555
3577
  row: header,
@@ -3960,27 +3982,50 @@ class PivotEngine {
3960
3982
  else {
3961
3983
  if (childrens.type === 'number' && hierarchy.length > 0 && (typeof (hierarchy[0].actualText) === 'string')) {
3962
3984
  let stringValue = [];
3985
+ let outOfRange;
3963
3986
  let alphaNumbervalue = [];
3964
3987
  let nullValue = [];
3965
3988
  for (let i = 0; i < hierarchy.length; i++) {
3966
3989
  if (isNaN(hierarchy[i].actualText.toString().charAt(0))) {
3967
3990
  stringValue.push(hierarchy[i]);
3991
+ if (!outOfRange && childrens.sort !== 'None') {
3992
+ if (hierarchy[i].actualText === 'Out of Range') {
3993
+ outOfRange = hierarchy[i];
3994
+ hierarchy.splice(i, 1);
3995
+ }
3996
+ }
3968
3997
  }
3969
3998
  else if (hierarchy[i].actualText === "") {
3970
3999
  nullValue.push(hierarchy[i]);
3971
4000
  }
3972
4001
  else {
4002
+ this.fieldList[fieldName].isAlphanumeric = true;
3973
4003
  alphaNumbervalue.push(hierarchy[i]);
4004
+ break;
3974
4005
  }
3975
4006
  }
3976
- if (stringValue.length > 0) {
3977
- stringValue = this.sortHeaders(fieldName, childrens, hierarchy, childrens.sort, childrens.type);
4007
+ if (outOfRange) {
4008
+ if (childrens.sort === 'Ascending') {
4009
+ if (hierarchy[0].actualText === 'Grand Total') {
4010
+ hierarchy.splice(1, 0, outOfRange);
4011
+ }
4012
+ else {
4013
+ hierarchy.splice(0, 0, outOfRange);
4014
+ }
4015
+ }
4016
+ else {
4017
+ if (hierarchy[hierarchy.length - 1].actualText === 'Grand Total') {
4018
+ hierarchy.splice(hierarchy.length - 1, 0, outOfRange);
4019
+ }
4020
+ else {
4021
+ hierarchy.splice(hierarchy.length, 0, outOfRange);
4022
+ }
4023
+ }
3978
4024
  }
3979
4025
  if (alphaNumbervalue.length > 0) {
3980
- this.fieldList[fieldName].isAlphanumeric = true;
3981
- alphaNumbervalue = this.sortHeaders(fieldName, childrens, hierarchy, childrens.sort, childrens.isAlphanumeric);
4026
+ this.sortHeaders(fieldName, childrens, hierarchy, childrens.sort, childrens.isAlphanumeric);
3982
4027
  }
3983
- return hierarchy = nullValue.concat(alphaNumbervalue, stringValue);
4028
+ return hierarchy;
3984
4029
  }
3985
4030
  else {
3986
4031
  return this.sortHeaders(fieldName, childrens, hierarchy, childrens.sort, childrens.type);
@@ -4818,7 +4863,7 @@ class PivotEngine {
4818
4863
  let selectedColumnValue = 0;
4819
4864
  if (selectedColumnValues.length === 0) {
4820
4865
  let selectedRow = this.getSelectedRow(currentSet.rowHeaders, rowheads);
4821
- selectedColumnValue = this.getAggregateValue(selectedRow.index, selectedColumn.indexObject, this.fieldList[name].index, headers.type);
4866
+ selectedColumnValue = this.getAggregateValue(selectedRow.index, selectedColumn.indexObject, this.fieldList[name].index, headers.type, false);
4822
4867
  }
4823
4868
  else {
4824
4869
  selectedColumnValue = selectedColumnValues[index[0]].value;
@@ -4873,7 +4918,7 @@ class PivotEngine {
4873
4918
  // let cVal: number = currentSet.value / (selectedRowValues[i[1]] as IAxisSet).value;
4874
4919
  let selectedRowValue = 0;
4875
4920
  if (selectedRowValues.length === 0 && activeValues) {
4876
- selectedRowValue = this.getAggregateValue(activeValues.index, colheads[i[1] - 1].indexObject, this.fieldList[name].index, headers.type);
4921
+ selectedRowValue = this.getAggregateValue(activeValues.index, colheads[i[1] - 1].indexObject, this.fieldList[name].index, headers.type, false);
4877
4922
  }
4878
4923
  else {
4879
4924
  selectedRowValue = selectedRowValues[i[1]] ? selectedRowValues[i[1]].actualValue : 0;
@@ -4917,7 +4962,7 @@ class PivotEngine {
4917
4962
  let selectedColValue = 0;
4918
4963
  if (selectedColumnValues.length === 0) {
4919
4964
  let selectedRow = this.getSelectedRow(currentSet.rowHeaders, rowheads);
4920
- selectedColValue = this.getAggregateValue(selectedRow.index, selectedCol.indexObject, this.fieldList[name].index, headers.type);
4965
+ selectedColValue = this.getAggregateValue(selectedRow.index, selectedCol.indexObject, this.fieldList[name].index, headers.type, false);
4921
4966
  }
4922
4967
  else {
4923
4968
  selectedColValue = selectedColumnValues[i[0]].value;
@@ -4946,7 +4991,7 @@ class PivotEngine {
4946
4991
  rowheads[rlen].level === item.level && currentSet.axis === 'value' &&
4947
4992
  currentSet.actualText === name) {
4948
4993
  if (rowheads[rlen].type !== 'grand sum') {
4949
- cVal += (!currentSet.showSubTotals && !(!isNullOrUndefined(currentSet.actualValue) && isNaN(currentSet.actualValue))) ? currentSet.actualValue : currentSet.value;
4994
+ cVal += (!currentSet.showSubTotals && !(!isNullOrUndefined(currentSet.actualValue) && isNaN(currentSet.actualValue))) ? currentSet.actualValue : (!isNullOrUndefined(currentSet.value) && !isNaN(currentSet.value)) ? currentSet.value : null;
4950
4995
  currentSet.formattedText = currentSet.showSubTotals ? (cVal === 0 && (currentSet.actualValue && currentSet.actualValue !== 0) ? '' : this.getFormattedValue(cVal, name).formattedText) : currentSet.formattedText;
4951
4996
  if (!this.aggregatedValueMatrix[rlen]) {
4952
4997
  this.aggregatedValueMatrix[rlen] = [];
@@ -5046,7 +5091,7 @@ class PivotEngine {
5046
5091
  let valueContent = ['cVal', 'rTotalVal', 'cTotalVal', 'gTotalVal'];
5047
5092
  let i = 0;
5048
5093
  for (let rIndex of gTotalIndex) {
5049
- totalValues[valueContent[i]] = this.getAggregateValue((rIndex[0]).index, (rIndex[1]).indexObject, mPos, aggregate);
5094
+ totalValues[valueContent[i]] = this.getAggregateValue((rIndex[0]).index, (rIndex[1]).indexObject, mPos, aggregate, i === 0 ? false : true);
5050
5095
  i++;
5051
5096
  }
5052
5097
  let val = ((totalValues.cVal) * (totalValues.gTotalVal)) / ((totalValues.rTotalVal) * (totalValues.cTotalVal));
@@ -5066,7 +5111,7 @@ class PivotEngine {
5066
5111
  let valueContent = ['cVal', 'gTotalVal'];
5067
5112
  let i = 0;
5068
5113
  for (let rIndex of gTotalIndex) {
5069
- totalValues[valueContent[i]] = this.getAggregateValue((rIndex[0]).index, (rIndex[1]).indexObject, mPos, aggregate);
5114
+ totalValues[valueContent[i]] = this.getAggregateValue((rIndex[0]).index, (rIndex[1]).indexObject, mPos, aggregate, i === 0 ? false : true);
5070
5115
  i++;
5071
5116
  }
5072
5117
  let val = ((totalValues.cVal) / (totalValues.gTotalVal));
@@ -5077,7 +5122,7 @@ class PivotEngine {
5077
5122
  }
5078
5123
  break;
5079
5124
  default:
5080
- let val = this.getAggregateValue(rows[rln].index, columns[cln].indexObject, mPos, aggregate);
5125
+ let val = this.getAggregateValue(rows[rln].index, columns[cln].indexObject, mPos, aggregate, false);
5081
5126
  value = (rows[rln].members.length > 0 && rows[rln].hasChild && rows[rln].isDrilled && ((!isNullOrUndefined(rows[rln].showSubTotals) && !rows[rln].showSubTotals) ||
5082
5127
  !this.showSubTotals || !this.showRowSubTotals)) ? undefined : val;
5083
5128
  actualValue = val;
@@ -5426,7 +5471,7 @@ class PivotEngine {
5426
5471
  }
5427
5472
  }
5428
5473
  /* eslint-disable */
5429
- getAggregateValue(rowIndex, columnIndex, value, type) {
5474
+ getAggregateValue(rowIndex, columnIndex, value, type, isGrandTotal) {
5430
5475
  //rowIndex = rowIndex.sort();
5431
5476
  //columnIndex = columnIndex.sort();
5432
5477
  let rlt = rowIndex.length;
@@ -5604,7 +5649,7 @@ class PivotEngine {
5604
5649
  let value = aggregateField[aggregatedValue.formula];
5605
5650
  if (value === undefined) {
5606
5651
  let type = aggregatedValue.type;
5607
- value = this.getAggregateValue(rowIndex, columnIndex, aggregatedValue.index, type);
5652
+ value = this.getAggregateValue(rowIndex, columnIndex, aggregatedValue.index, type, false);
5608
5653
  aggregateField[aggregatedValue.formula] = value;
5609
5654
  }
5610
5655
  actualFormula = (actualFormula).replace(aggregatedValue.formula, String(value));
@@ -5618,7 +5663,9 @@ class PivotEngine {
5618
5663
  while (rowIndex[ri] !== undefined) {
5619
5664
  if (columnIndex[rowIndex[ri]] !== undefined) {
5620
5665
  isValueExist = true;
5621
- this.rawIndexObject[rowIndex[ri]] = rowIndex[ri];
5666
+ if (!isGrandTotal) {
5667
+ this.rawIndexObject[rowIndex[ri]] = rowIndex[ri];
5668
+ }
5622
5669
  //let cIndx: number = isLeastLevel ? columnIndex.splice(columnIndex.indexOf(rowIndex[ri]), 1)[0] : rowIndex[ri];
5623
5670
  let currentVal = this.valueMatrix[rowIndex[ri]][value];
5624
5671
  if (isNullOrUndefined(cellValue) && isNullOrUndefined(currentVal)) {
@@ -9158,8 +9205,8 @@ class Render {
9158
9205
  args.value = this.parent.exportType === 'Excel' ? null : '';
9159
9206
  }
9160
9207
  else {
9161
- let aggMatrix = this.parent.engineModule.aggregatedValueMatrix;
9162
- if (aggMatrix[pivotValue.rowIndex] && aggMatrix[pivotValue.rowIndex][pivotValue.colIndex]) {
9208
+ let aggMatrix = this.parent.dataType === 'pivot' && this.parent.engineModule ? this.parent.engineModule.aggregatedValueMatrix : undefined;
9209
+ if (aggMatrix && aggMatrix[pivotValue.rowIndex] && aggMatrix[pivotValue.rowIndex][pivotValue.colIndex]) {
9163
9210
  args.value = aggMatrix[pivotValue.rowIndex][pivotValue.colIndex];
9164
9211
  }
9165
9212
  else {
@@ -9603,6 +9650,15 @@ class EventBase {
9603
9650
  /* eslint-disable */
9604
9651
  let membersInfo = fieldInfo && fieldInfo.membersOrder ?
9605
9652
  [...fieldInfo.membersOrder] : [];
9653
+ let outOfRange;
9654
+ if (members[0].actualText === 'Out of Range') {
9655
+ outOfRange = members[0];
9656
+ members.splice(0, 1);
9657
+ }
9658
+ else if (members[members.length - 1].actualText === 'Out of Range') {
9659
+ outOfRange = members[members.length - 1];
9660
+ members.splice(members.length - 1, 1);
9661
+ }
9606
9662
  let sortDetails = {
9607
9663
  fieldName: fieldName,
9608
9664
  sortOrder: fieldInfo.sort,
@@ -9624,6 +9680,24 @@ class EventBase {
9624
9680
  isInclude = this.isValidFilterItemsAvail(fieldName, filterObj) && filterObj.type === 'Include' ? true : false;
9625
9681
  filterItems = filterObj.items ? filterObj.items : [];
9626
9682
  }
9683
+ if (outOfRange) {
9684
+ if (sortDetails.sortOrder === 'Ascending') {
9685
+ if (members[members.length - 1].actualText === 'Grand Total') {
9686
+ members.splice(members.length - 1, 0, outOfRange);
9687
+ }
9688
+ else {
9689
+ members.splice(members.length, 0, outOfRange);
9690
+ }
9691
+ }
9692
+ else {
9693
+ if (members[0].actualText === 'Grand Total') {
9694
+ members.splice(1, 0, outOfRange);
9695
+ }
9696
+ else {
9697
+ members.splice(0, 0, outOfRange);
9698
+ }
9699
+ }
9700
+ }
9627
9701
  if (isHeaderSortByDefault) {
9628
9702
  let copyOrder = [];
9629
9703
  for (let m = 0, n = 0; m < members.length; m++) {
@@ -13642,9 +13716,8 @@ class DrillThroughDialog {
13642
13716
  }
13643
13717
  let actualText = eventArgs.currentCell.actualText.toString();
13644
13718
  try {
13645
- if (this.parent.currentView === 'Table' && this.engine.fieldList[actualText].aggregateType !== 'Count' && this.parent.editSettings.allowInlineEditing &&
13646
- this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1 &&
13647
- this.engine.fieldList[actualText].aggregateType !== 'DistinctCount' && typeof (eventArgs.rawData[0][actualText]) !== 'string') {
13719
+ if (this.parent.currentView === 'Table' && this.parent.editSettings.allowInlineEditing &&
13720
+ this.parent.editSettings.allowEditing && eventArgs.rawData.length === 1) {
13648
13721
  this.parent.actionObj.actionName = editRecord;
13649
13722
  if (this.parent.actionBeginMethod()) {
13650
13723
  return;
@@ -13802,9 +13875,9 @@ class DrillThroughDialog {
13802
13875
  let previousData = this.frameHeaderWithKeys(eventArgs.rawData[eventArgs.rawData.length - 1]);
13803
13876
  let currentData = eventArgs.rawData[eventArgs.rawData.length - 1];
13804
13877
  /* eslint-enable */
13805
- if (eventArgs.currentCell.actualText in previousData) {
13806
- currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
13807
- }
13878
+ // if (eventArgs.currentCell.actualText in previousData) {
13879
+ // currentData[eventArgs.currentCell.actualText] = eventArgs.currentCell.actualValue;
13880
+ // }
13808
13881
  let actionInfo = {
13809
13882
  editInfo: { type: 'Inline editing', action: 'update', data: this.gridData }
13810
13883
  };
@@ -14247,7 +14320,7 @@ class DrillThrough {
14247
14320
  let valueCaption = '';
14248
14321
  let aggType = '';
14249
14322
  let rawData = [];
14250
- if (pivotValue.rowHeaders !== undefined && pivotValue.columnHeaders !== undefined && !isNullOrUndefined(pivotValue.value)) {
14323
+ if (pivotValue.rowHeaders !== undefined && pivotValue.columnHeaders !== undefined) {
14251
14324
  if (this.parent.dataType === 'olap') {
14252
14325
  let tupleInfo;
14253
14326
  if (this.parent.dataSourceSettings.valueAxis === 'row') {
@@ -14317,7 +14390,7 @@ class DrillThrough {
14317
14390
  }
14318
14391
  }
14319
14392
  if (!isNullOrUndefined(rawData[k])) {
14320
- let calculatedFeildValue = this.parent.engineModule.getAggregateValue([Number(indexArray[k])], colIndex, indexValue, 'calculatedfield');
14393
+ let calculatedFeildValue = this.parent.engineModule.getAggregateValue([Number(indexArray[k])], colIndex, indexValue, 'calculatedfield', false);
14321
14394
  rawData[k][this.parent.dataSourceSettings.calculatedFieldSettings[i].name] = (isNaN(calculatedFeildValue) && isNullOrUndefined(calculatedFeildValue)) ? '#DIV/0!' : calculatedFeildValue;
14322
14395
  }
14323
14396
  }
@@ -14794,6 +14867,9 @@ class PivotChart {
14794
14867
  if (this.persistSettings.chartSeries && this.persistSettings.chartSeries.emptyPointSettings) {
14795
14868
  currentSeries.emptyPointSettings = this.persistSettings.chartSeries.emptyPointSettings;
14796
14869
  }
14870
+ if (!currentSeries.emptyPointSettings) {
14871
+ currentSeries.emptyPointSettings = { mode: 'Zero' };
14872
+ }
14797
14873
  this.chartSeries = this.chartSeries.concat(currentSeries);
14798
14874
  }
14799
14875
  }
@@ -16523,7 +16599,7 @@ __decorate$3([
16523
16599
  Complex({ color: 'transparent', width: 0 }, Border)
16524
16600
  ], EmptyPointSettings.prototype, "border", void 0);
16525
16601
  __decorate$3([
16526
- Property('Gap')
16602
+ Property('Zero')
16527
16603
  ], EmptyPointSettings.prototype, "mode", void 0);
16528
16604
  /**
16529
16605
  * Allows to customize the rounded corners of the column series in the chart.
@@ -16897,7 +16973,7 @@ __decorate$3([
16897
16973
  Complex({ color: 'transparent', width: 0 }, Border)
16898
16974
  ], PivotChartSeriesEmptyPointSettings.prototype, "border", void 0);
16899
16975
  __decorate$3([
16900
- Property('Gap')
16976
+ Property('Zero')
16901
16977
  ], PivotChartSeriesEmptyPointSettings.prototype, "mode", void 0);
16902
16978
  /**
16903
16979
  * Allows to customize the rounded corners of the column series in the chart.
@@ -19295,9 +19371,7 @@ class OlapEngine {
19295
19371
  let lastAllStartPos;
19296
19372
  let lastAllCount;
19297
19373
  let availAllMember = false;
19298
- let withoutAllEndPos = -1;
19299
19374
  let isGrandtoalDataAdd = false;
19300
- let prevTupInfo;
19301
19375
  let isGrandTotalTop = false;
19302
19376
  while (tupPos < tuples.length && !isGrandtoalDataAdd) {
19303
19377
  let members = tuples[this.customArgs.action === 'down' ?
@@ -19306,21 +19380,11 @@ class OlapEngine {
19306
19380
  let allStartPos = this.tupRowInfo[tupPos].allStartPos;
19307
19381
  let measure = this.tupRowInfo[tupPos].measure;
19308
19382
  let typeColl = this.tupRowInfo[tupPos].typeCollection;
19309
- let drillStartPos = this.tupRowInfo[tupPos].drillStartPos;
19310
- let startDrillUniquename = this.tupRowInfo[tupPos].startDrillUniquename;
19311
19383
  if (tupPos === 0 && (members.length > (allCount + (measure ? 1 : 0)) || (members.length === 1 && measure))) {
19312
19384
  gTotals.pop();
19313
19385
  }
19314
19386
  if ((tupPos === 0 && this.isPaging) ? gTotals.length === 0 :
19315
19387
  (!availAllMember || allCount === lastAllCount || allStartPos !== lastAllStartPos || (members.length === 1 && measure))) {
19316
- let attrDrill = this.checkAttributeDrill(this.tupRowInfo[tupPos].drillInfo, 'rows');
19317
- let drillAllow = drillStartPos > -1 ? (allCount > 0 ? (attrDrill || allStartPos > drillStartPos) : true) : true;
19318
- drillAllow = (prevTupInfo && drillAllow && drillStartPos > -1) ?
19319
- (prevTupInfo.startDrillUniquename !== startDrillUniquename ? true :
19320
- ((withoutAllEndPos > prevTupInfo.measurePosition ? false :
19321
- prevTupInfo.measureName !== this.tupRowInfo[tupPos].measureName) &&
19322
- (allStartPos === (drillStartPos + 1) || this.tupRowInfo[tupPos].measurePosition === (drillStartPos + 1))))
19323
- : drillAllow;
19324
19388
  if (members.length === allCount + (measure ? 1 : 0) && measure && !isGrandTotalTop) {
19325
19389
  let levelName = 'Grand Total.' + members[measurePos].querySelector('Caption').textContent;
19326
19390
  let formattedText = (typeColl[measurePos] === '3' && this.dataFields[this.getUniqueName(members[measurePos].querySelector('UName').textContent)] &&
@@ -35889,7 +35953,7 @@ class Toolbar$2 {
35889
35953
  saveReport(args) {
35890
35954
  if (this.currentReport && this.currentReport !== '' && args.item.id === (this.parent.element.id + 'save')) {
35891
35955
  let saveArgs = {
35892
- report: this.parent.getPersistData(),
35956
+ report: this.getCurrentReport(),
35893
35957
  reportName: this.currentReport
35894
35958
  };
35895
35959
  this.parent.actionObj.actionName = this.parent.getActionCompleteName();
@@ -36146,7 +36210,7 @@ class Toolbar$2 {
36146
36210
  return;
36147
36211
  }
36148
36212
  let saveArgs = {
36149
- report: _this.parent.getPersistData(),
36213
+ report: _this.getCurrentReport(),
36150
36214
  reportName: reportInput.value
36151
36215
  };
36152
36216
  let actionInfo = {
@@ -36182,7 +36246,7 @@ class Toolbar$2 {
36182
36246
  }
36183
36247
  _this.parent.trigger(newReport);
36184
36248
  let saveArgs = {
36185
- report: _this.parent.getPersistData(),
36249
+ report: _this.getCurrentReport(),
36186
36250
  reportName: reportInput.value
36187
36251
  };
36188
36252
  let actionInfo = {
@@ -36325,7 +36389,7 @@ class Toolbar$2 {
36325
36389
  else if (this.action === 'New' || (this.action !== 'Save' && this.action !== 'Rename' && this.action !== 'New')) {
36326
36390
  if (this.currentReport && this.currentReport !== '' && this.parent.isModified) {
36327
36391
  let saveArgs = {
36328
- report: this.parent.getPersistData(),
36392
+ report: this.getCurrentReport(),
36329
36393
  reportName: this.currentReport
36330
36394
  };
36331
36395
  let actionInfo = {
@@ -36350,7 +36414,7 @@ class Toolbar$2 {
36350
36414
  else if (this.action === 'New') {
36351
36415
  this.parent.trigger(newReport);
36352
36416
  let saveArgs = {
36353
- report: this.parent.getPersistData(),
36417
+ report: this.getCurrentReport(),
36354
36418
  reportName: this.currentReport
36355
36419
  };
36356
36420
  this.parent.trigger(saveReport, saveArgs);
@@ -36361,7 +36425,7 @@ class Toolbar$2 {
36361
36425
  }
36362
36426
  else if (this.action === 'Save') {
36363
36427
  let saveArgs = {
36364
- report: this.parent.getPersistData(),
36428
+ report: this.getCurrentReport(),
36365
36429
  reportName: this.currentReport
36366
36430
  };
36367
36431
  this.parent.trigger(saveReport, saveArgs);
@@ -36658,6 +36722,15 @@ class Toolbar$2 {
36658
36722
  }
36659
36723
  this.updateItemElements();
36660
36724
  }
36725
+ getCurrentReport() {
36726
+ let reportStr = this.parent.getPersistData();
36727
+ if (this.parent.dataSourceSettings.type === 'CSV') {
36728
+ let reportSettings = JSON.parse(reportStr);
36729
+ reportSettings.dataSourceSettings.dataSource.splice(0, 0, this.parent.engineModule.fields);
36730
+ reportStr = JSON.stringify(reportSettings);
36731
+ }
36732
+ return reportStr;
36733
+ }
36661
36734
  updateItemElements() {
36662
36735
  let itemElements = [].slice.call(this.toolbar.element.querySelectorAll('.e-toolbar-item'));
36663
36736
  for (let element of itemElements) {