@syncfusion/ej2-pivotview 20.2.38 → 20.2.39

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 (48) hide show
  1. package/CHANGELOG.md +9 -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 +26 -14
  5. package/dist/es6/ej2-pivotview.es2015.js.map +1 -1
  6. package/dist/es6/ej2-pivotview.es5.js +26 -14
  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 +11 -11
  12. package/src/base/engine.js +7 -5
  13. package/src/pivotchart/base/pivotchart.js +16 -6
  14. package/src/pivotview/actions/virtualscroll.js +2 -2
  15. package/src/pivotview/renderer/render.js +1 -1
  16. package/styles/bootstrap-dark.css +1 -1
  17. package/styles/bootstrap.css +1 -1
  18. package/styles/bootstrap4.css +1 -1
  19. package/styles/bootstrap5-dark.css +1 -1
  20. package/styles/bootstrap5.css +1 -1
  21. package/styles/fabric-dark.css +1 -1
  22. package/styles/fabric.css +1 -1
  23. package/styles/fluent-dark.css +2 -2
  24. package/styles/fluent.css +2 -2
  25. package/styles/highcontrast-light.css +1 -1
  26. package/styles/highcontrast.css +1 -1
  27. package/styles/material-dark.css +1 -1
  28. package/styles/material.css +1 -1
  29. package/styles/pivotfieldlist/_fluent-definition.scss +1 -1
  30. package/styles/pivotfieldlist/_layout.scss +1 -1
  31. package/styles/pivotfieldlist/_tailwind-definition.scss +1 -1
  32. package/styles/pivotfieldlist/bootstrap-dark.css +1 -1
  33. package/styles/pivotfieldlist/bootstrap.css +1 -1
  34. package/styles/pivotfieldlist/bootstrap4.css +1 -1
  35. package/styles/pivotfieldlist/bootstrap5-dark.css +1 -1
  36. package/styles/pivotfieldlist/bootstrap5.css +1 -1
  37. package/styles/pivotfieldlist/fabric-dark.css +1 -1
  38. package/styles/pivotfieldlist/fabric.css +1 -1
  39. package/styles/pivotfieldlist/fluent-dark.css +2 -2
  40. package/styles/pivotfieldlist/fluent.css +2 -2
  41. package/styles/pivotfieldlist/highcontrast-light.css +1 -1
  42. package/styles/pivotfieldlist/highcontrast.css +1 -1
  43. package/styles/pivotfieldlist/material-dark.css +1 -1
  44. package/styles/pivotfieldlist/material.css +1 -1
  45. package/styles/pivotfieldlist/tailwind-dark.css +2 -2
  46. package/styles/pivotfieldlist/tailwind.css +2 -2
  47. package/styles/tailwind-dark.css +2 -2
  48. package/styles/tailwind.css +2 -2
@@ -1326,7 +1326,7 @@ class PivotEngine {
1326
1326
  if (this.fields.indexOf(newFieldName) === -1) {
1327
1327
  this.fields.push(newFieldName);
1328
1328
  }
1329
- item[this.fieldKeys[newFieldName]] = (isInRangeAvail ? undefined : new Date(newDate.setMonth(date.getMonth(), newDate.getDate())).toString());
1329
+ item[this.fieldKeys[newFieldName]] = (isInRangeAvail ? undefined : new Date(newDate.setMonth(date.getMonth(), 1)).toString());
1330
1330
  }
1331
1331
  break;
1332
1332
  case 'Days':
@@ -4784,8 +4784,9 @@ class PivotEngine {
4784
4784
  }
4785
4785
  for (let index of indexCollection) {
4786
4786
  let currentSet = data[index[0]][index[1]];
4787
+ let actualValue = isNullOrUndefined(selectedRowValues[index[1]].actualValue) ? 0 : selectedRowValues[index[1]].actualValue;
4787
4788
  // let cVal: number = currentSet.value - (selectedRowValues[index[1]] as IAxisSet).value;
4788
- let cVal = currentSet.actualValue - selectedRowValues[index[1]].actualValue;
4789
+ let cVal = (isNullOrUndefined(currentSet.actualValue) ? 0 : currentSet.actualValue) - actualValue;
4789
4790
  cVal = isNaN(cVal) ? 0 : (currentSet.value === 0 && selectedRowValues[index[1]].value === 0) ? 0 : cVal;
4790
4791
  if (!this.aggregatedValueMatrix[index[0]]) {
4791
4792
  this.aggregatedValueMatrix[index[0]] = [];
@@ -4797,8 +4798,7 @@ class PivotEngine {
4797
4798
  else {
4798
4799
  // cVal = ((selectedRowValues[index[1]] as IAxisSet).value === 0 ?
4799
4800
  // 0 : (cVal / (selectedRowValues[index[1]] as IAxisSet).value));
4800
- cVal = (selectedRowValues[index[1]].actualValue === 0 ?
4801
- 0 : (cVal / selectedRowValues[index[1]].actualValue));
4801
+ cVal = (actualValue === 0 ? 0 : (cVal / actualValue));
4802
4802
  this.aggregatedValueMatrix[index[0]][index[1]] = cVal;
4803
4803
  currentSet.formattedText = currentSet.showSubTotals ? (cVal !== 0 ? this.globalize.formatNumber(cVal, { format: 'P', maximumFractionDigits: this.getPercentFormat(this.formatFields, currentSet.actualText) }) : this.emptyCellTextContent) : currentSet.formattedText;
4804
4804
  }
@@ -5021,7 +5021,9 @@ class PivotEngine {
5021
5021
  activeColumn[cln].valueSort[item.valueSort.levelName] &&
5022
5022
  currentSet.axis === 'value' && currentSet.actualText === name) {
5023
5023
  if (activeColumn[cln].type !== 'grand sum') {
5024
- cVal += currentSet.value;
5024
+ if (!isNullOrUndefined(currentSet.value)) {
5025
+ cVal += currentSet.value;
5026
+ }
5025
5027
  currentSet.formattedText = subTotal ? '' : this.getFormattedValue(cVal, name).formattedText;
5026
5028
  if (!this.aggregatedValueMatrix[rln]) {
5027
5029
  this.aggregatedValueMatrix[rln] = [];
@@ -8460,7 +8462,7 @@ class Render {
8460
8462
  if (cell.isGrandSum || (isGrandSum || this.colGrandPos === Number(tCell.getAttribute('aria-colindex'))) || this.rowGrandPos === Number(tCell.getAttribute('index'))) {
8461
8463
  tCell.classList.add('e-gtot');
8462
8464
  }
8463
- else if (this.parent.dataType === 'olap' ? cell.isSum : this.validateColumnTotalcell(!isNullOrUndefined(cell.value) ? cell.colIndex : cell.colIndex - 1)) {
8465
+ else if (this.parent.dataType === 'olap' ? cell.isSum : this.validateColumnTotalcell(cell.colIndex)) {
8464
8466
  tCell.classList.add('e-colstot');
8465
8467
  }
8466
8468
  if (cell.cssClass) {
@@ -13469,7 +13471,7 @@ class VirtualScroll$1 {
13469
13471
  this.parent.actionBeginMethod();
13470
13472
  this.parent.showWaitingPopup();
13471
13473
  this.parent.scrollPosObject.vertical = section;
13472
- engine.pageSettings.rowCurrentPage = section > 1 ? section : 1;
13474
+ this.parent.pageSettings.rowCurrentPage = engine.pageSettings.rowCurrentPage = section > 1 ? section : 1;
13473
13475
  let rowStartPos = 0;
13474
13476
  this.parent.trigger(enginePopulating, args, (observedArgs) => {
13475
13477
  if (this.parent.dataType === 'pivot') {
@@ -13507,7 +13509,7 @@ class VirtualScroll$1 {
13507
13509
  this.parent.showWaitingPopup();
13508
13510
  let pivot = this.parent;
13509
13511
  pivot.scrollPosObject.horizontal = section;
13510
- engine.pageSettings.columnCurrentPage = section > 1 ? section : 1;
13512
+ this.parent.pageSettings.columnCurrentPage = engine.pageSettings.columnCurrentPage = section > 1 ? section : 1;
13511
13513
  let colStartPos = 0;
13512
13514
  this.parent.trigger(enginePopulating, args, (observedArgs) => {
13513
13515
  if (pivot.dataType === 'pivot') {
@@ -15641,14 +15643,14 @@ class PivotChart {
15641
15643
  let aggregateType = this.parent.dataType === 'olap' ? '' : this.parent.localeObj.getConstant(measureField.aggregateType);
15642
15644
  let measureAggregatedName = (this.parent.dataType === 'olap' ? '' : aggregateType + ' ' +
15643
15645
  this.parent.localeObj.getConstant('of') + ' ') + measureField.caption;
15644
- let formattedText = this.accumulationType.indexOf(this.parent.chartSettings.chartSeries.type) < 0 ?
15645
- args.text.split('<b>')[1].split('</b>')[0] : this.engineModule.pivotValues[rowIndex][colIndex].formattedText;
15646
+ let formattedText = this.engineModule.pivotValues[rowIndex][colIndex].formattedText;
15646
15647
  let formatField = this.engineModule.formatFields[measureField.id];
15647
- let formattedValue = ((formatField && formatField.format && formatField.format.toLowerCase().match(/n|p|c/) !== null &&
15648
+ let valueFormat = this.engineModule.getFormattedValue(args.point.y, measureField.id, formattedText);
15649
+ let formattedValue = (formatField && formatField.format && formatField.format.toLowerCase().match(/n|p|c/) !== null &&
15648
15650
  this.chartSettings.useGroupingSeparator) ? this.parent.dataType === 'olap' ?
15649
- this.engineModule.getFormattedValue(args.point.y, measureField.id, formattedText) :
15650
- this.parent.engineModule.getFormattedValue(args.point.y, measureField.id).formattedText :
15651
- formattedText);
15651
+ valueFormat.toString() :
15652
+ valueFormat.formattedText :
15653
+ formattedText;
15652
15654
  let columnText = (args.series.name ? args.series.name.split(' | ')[0] : args.data.seriesName.split(' | ')[0]);
15653
15655
  let rowText = args.point.x;
15654
15656
  if (this.parent.tooltipTemplate && this.parent.getTooltipTemplate() !== undefined || this.chartSettings.tooltip.template) {
@@ -15977,6 +15979,16 @@ class PivotChart {
15977
15979
  args.text = '';
15978
15980
  }
15979
15981
  }
15982
+ if (args.axis.name !== 'primaryXAxis') {
15983
+ let formatField = this.engineModule.formatFields[args.axis.name];
15984
+ let valueFormat = this.engineModule.getFormattedValue(args.value, args.axis.name, args.text);
15985
+ let formattedValue = ((formatField && formatField.format && formatField.format.toLowerCase().match(/n|p|c/) !== null &&
15986
+ this.chartSettings.useGroupingSeparator) ? this.parent.dataType === 'olap' ?
15987
+ valueFormat.toString() :
15988
+ valueFormat.formattedText :
15989
+ args.value.toString());
15990
+ args.text = formattedValue;
15991
+ }
15980
15992
  this.parent.trigger(chartAxisLabelRender, args);
15981
15993
  }
15982
15994
  multiLevelLabelClick(args) {