@syncfusion/ej2-pivotview 19.4.42 → 19.4.43

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.
@@ -12863,7 +12863,7 @@ class VirtualScroll$1 {
12863
12863
  let ele = this.parent.isAdaptive ? mCont : mCont.parentElement.parentElement.querySelector('.' + MOVABLESCROLL_DIV);
12864
12864
  EventHandler.add(ele, 'scroll touchmove pointermove', this.onHorizondalScroll(mHdr, mCont, fCont), this);
12865
12865
  EventHandler.add(mCont.parentElement, 'scroll wheel touchmove pointermove keyup keydown', this.onVerticalScroll(fCont, mCont), this);
12866
- EventHandler.add(mCont.parentElement.parentElement, 'mouseup touchend', this.common(mHdr, mCont, fCont), this);
12866
+ EventHandler.add(mCont, 'mouseup touchend scroll', this.common(mHdr, mCont, fCont), this);
12867
12867
  EventHandler.add(mScrollBar, 'scroll', this.onCustomScrollbarScroll(mCont, mHdr), this);
12868
12868
  EventHandler.add(mCont, 'scroll', this.onCustomScrollbarScroll(mScrollBar, mHdr), this);
12869
12869
  EventHandler.add(mHdr, 'scroll', this.onCustomScrollbarScroll(mScrollBar, mCont), this);
@@ -26331,6 +26331,14 @@ class ExcelExport$1 {
26331
26331
  for (let cCnt = 0; cCnt < colLen; cCnt++) {
26332
26332
  if (pivotValues[rCnt][cCnt]) {
26333
26333
  let pivotCell = pivotValues[rCnt][cCnt];
26334
+ let field = (this.parent.dataSourceSettings.valueAxis === 'row' &&
26335
+ this.parent.dataType === 'olap' && pivotCell.rowOrdinal &&
26336
+ this.engine.tupRowInfo[pivotCell.rowOrdinal]) ?
26337
+ this.engine.tupRowInfo[pivotCell.rowOrdinal].measureName :
26338
+ pivotCell.actualText;
26339
+ let styles = (pivotCell.axis == 'row') ? { hAlign: 'Left', bold: true, wrapText: true } : { numberFormat: formatList[field], bold: false, wrapText: true };
26340
+ let pivotCells = currentPivotValues[rCnt][cCnt];
26341
+ let headerStyle = { bold: true, vAlign: 'Center', wrapText: true, indent: cCnt === 0 ? pivotCell.level * 10 : 0 };
26334
26342
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
26335
26343
  let cellValue = pivotCell.axis === 'value' ? pivotCell.value : pivotCell.formattedText;
26336
26344
  let isgetValuesHeader = ((this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row')
@@ -26350,33 +26358,21 @@ class ExcelExport$1 {
26350
26358
  index: cCnt + 1, value: cellValue,
26351
26359
  colSpan: pivotCell.colSpan, rowSpan: (pivotCell.rowSpan === -1 ? 1 : pivotCell.rowSpan),
26352
26360
  });
26361
+ let lastCell = cells[cells.length - 1];
26353
26362
  if (pivotCell.axis === 'value') {
26354
26363
  if (isNaN(pivotCell.value) || pivotCell.formattedText === '' ||
26355
26364
  pivotCell.formattedText === undefined || isNullOrUndefined(pivotCell.value)) {
26356
- cells[cells.length - 1].value = type === 'Excel' ? null : '';
26357
- }
26358
- let field = (this.parent.dataSourceSettings.valueAxis === 'row' &&
26359
- this.parent.dataType === 'olap' && pivotCell.rowOrdinal &&
26360
- this.engine.tupRowInfo[pivotCell.rowOrdinal]) ?
26361
- this.engine.tupRowInfo[pivotCell.rowOrdinal].measureName :
26362
- pivotCell.actualText;
26363
- cells[cells.length - 1].style = !isNullOrUndefined(cells[cells.length - 1].value) ? { numberFormat: formatList[field], bold: false, wrapText: true } : { bold: false, wrapText: true };
26364
- if (pivotCell.style) {
26365
- cells[cells.length - 1].style.backColor = pivotCell.style.backgroundColor;
26366
- cells[cells.length - 1].style.fontColor = pivotCell.style.color;
26367
- cells[cells.length - 1].style.fontName = pivotCell.style.fontFamily;
26368
- cells[cells.length - 1].style.fontSize = Number(pivotCell.style.fontSize.split('px')[0]);
26365
+ lastCell.value = type === 'Excel' ? null : '';
26369
26366
  }
26367
+ lastCell.style = !isNullOrUndefined(lastCell.value) ? styles : { bold: false, wrapText: true };
26370
26368
  }
26371
26369
  else {
26372
- cells[cells.length - 1].style = {
26373
- bold: true, vAlign: 'Center', wrapText: true, indent: cCnt === 0 ? pivotCell.level * 10 : 0
26374
- };
26370
+ lastCell.style = headerStyle;
26375
26371
  if (pivotCell.axis === 'row' && cCnt === 0) {
26376
- cells[cells.length - 1].style.hAlign = 'Left';
26372
+ lastCell.style = styles;
26377
26373
  if (this.parent.dataType === 'olap') {
26378
26374
  let indent = this.parent.renderModule.indentCollection[rCnt];
26379
- cells[cells.length - 1].style.indent = indent * 2;
26375
+ lastCell.style.indent = indent * 2;
26380
26376
  maxLevel = maxLevel > indent ? maxLevel : indent;
26381
26377
  }
26382
26378
  else {
@@ -26386,19 +26382,55 @@ class ExcelExport$1 {
26386
26382
  let levelPosition = levelName.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length -
26387
26383
  (memberPos ? memberPos - 1 : memberPos);
26388
26384
  let level = levelPosition ? (levelPosition - 1) : 0;
26389
- cells[cells.length - 1].style.indent = level * 2;
26385
+ lastCell.style.indent = level * 2;
26390
26386
  maxLevel = level > maxLevel ? level : maxLevel;
26391
26387
  }
26392
26388
  }
26393
26389
  }
26394
- cells[cells.length - 1].style.borders = { color: '#000000', lineStyle: 'Thin' };
26390
+ if (pivotCell.style || lastCell.style.backgroundColor || lastCell.style.fontColor || lastCell.style.fontName || lastCell.style.fontSize) {
26391
+ lastCell.style.backgroundColor = lastCell.style.backgroundColor ? lastCell.style.backgroundColor : pivotCell.style.backgroundColor;
26392
+ lastCell.style.fontColor = lastCell.style.fontColor ? lastCell.style.fontColor : pivotCell.style.color;
26393
+ lastCell.style.fontName = lastCell.style.fontName ? lastCell.style.fontName : pivotCell.style.fontFamily;
26394
+ lastCell.style.fontSize = lastCell.style.fontSize ? Number(lastCell.style.fontSize) : Number(pivotCell.style.fontSize.split('px')[0]);
26395
+ }
26396
+ lastCell.style.borders = { color: '#000000', lineStyle: 'Thin' };
26397
+ let excelHeaderQueryCellInfoArgs;
26398
+ let excelQueryCellInfoArgs;
26399
+ if (pivotCell.axis === 'column') {
26400
+ excelHeaderQueryCellInfoArgs = {
26401
+ style: headerStyle,
26402
+ cell: pivotCells,
26403
+ };
26404
+ this.parent.trigger(excelHeaderQueryCellInfo, excelHeaderQueryCellInfoArgs);
26405
+ }
26406
+ else {
26407
+ excelQueryCellInfoArgs = {
26408
+ style: styles,
26409
+ cell: pivotCells,
26410
+ column: undefined,
26411
+ data: pivotValues,
26412
+ value: cellValue
26413
+ };
26414
+ this.parent.trigger(excelQueryCellInfo, excelQueryCellInfoArgs);
26415
+ }
26416
+ lastCell.value = (pivotCell.axis == 'column') ? excelHeaderQueryCellInfoArgs.cell.formattedText : excelQueryCellInfoArgs.value;
26417
+ lastCell.style = (pivotCell.axis == 'column') ? excelHeaderQueryCellInfoArgs.style : excelQueryCellInfoArgs.style;
26395
26418
  }
26396
26419
  }
26397
26420
  cCnt = cCnt + (pivotCell.colSpan ? (pivotCell.colSpan - 1) : 0);
26398
26421
  }
26399
26422
  else {
26423
+ let pivotCell = { formattedText: "" };
26424
+ let excelHeaderQueryCellInfoArgs;
26425
+ if (pivotCell) {
26426
+ excelHeaderQueryCellInfoArgs = {
26427
+ style: undefined,
26428
+ cell: pivotCell,
26429
+ };
26430
+ this.parent.trigger(excelHeaderQueryCellInfo, excelHeaderQueryCellInfoArgs);
26431
+ }
26400
26432
  cells.push({
26401
- index: cCnt + 1, value: '', colSpan: 1, rowSpan: 1,
26433
+ index: cCnt + 1, colSpan: 1, rowSpan: 1, value: pivotCell.formattedText, style: excelHeaderQueryCellInfoArgs.style
26402
26434
  });
26403
26435
  }
26404
26436
  }
@@ -26665,12 +26697,12 @@ class PDFExport {
26665
26697
  let isValueCell = false;
26666
26698
  if (pivotValues[rCnt][cCnt]) {
26667
26699
  let pivotCell = pivotValues[rCnt][cCnt];
26700
+ let cellValue = pivotCell.formattedText;
26701
+ cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'value') : cellValue;
26702
+ cellValue = pivotCell.type === 'grand sum' ? (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'grandTotal') :
26703
+ this.parent.localeObj.getConstant('grandTotal') : (pivotCell.type === 'sum' ?
26704
+ cellValue.toString().replace('Total', this.parent.localeObj.getConstant('total')) : cellValue);
26668
26705
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
26669
- let cellValue = pivotCell.formattedText;
26670
- cellValue = (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'value') : cellValue;
26671
- cellValue = pivotCell.type === 'grand sum' ? (this.parent.dataSourceSettings.rows.length === 0 || this.parent.dataSourceSettings.columns.length === 0) ? this.parent.getValuesHeader(pivotCell, 'grandTotal') :
26672
- this.parent.localeObj.getConstant('grandTotal') : (pivotCell.type === 'sum' ?
26673
- cellValue.toString().replace('Total', this.parent.localeObj.getConstant('total')) : cellValue);
26674
26706
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
26675
26707
  pdfGridRow.cells.getCell(localCnt).columnSpan = pivotCell.colSpan ?
26676
26708
  (pageSize - localCnt < pivotCell.colSpan ? pageSize - localCnt : pivotCell.colSpan) : 1;
@@ -26693,11 +26725,31 @@ class PDFExport {
26693
26725
  pdfGridRow = this.applyStyle(pdfGridRow, pivotCell, localCnt);
26694
26726
  }
26695
26727
  let args = {
26696
- style: (pivotCell && pivotCell.isSum) ? { bold: true } : undefined,
26728
+ style: (pivotCell.axis == "column") ? { bold: false } : ((pivotCell && pivotCell.isSum) || (pivotCell.axis == "row")) ? { bold: true } : undefined,
26697
26729
  pivotCell: pivotCell,
26698
26730
  cell: pdfGridRow.cells.getCell(localCnt)
26699
26731
  };
26700
26732
  this.parent.trigger(onPdfCellRender, args);
26733
+ if (pivotCell.axis == "column") {
26734
+ args = {
26735
+ style: args.style,
26736
+ cell: args.cell,
26737
+ gridCell: args.pivotCell
26738
+ };
26739
+ this.parent.trigger(pdfHeaderQueryCellInfo, args);
26740
+ pdfGridRow.cells.getCell(localCnt).value = args.gridCell.formattedText ? args.gridCell.formattedText : cellValue;
26741
+ }
26742
+ else {
26743
+ args = {
26744
+ style: args.style,
26745
+ cell: args.cell,
26746
+ column: undefined,
26747
+ data: args.pivotCell,
26748
+ value: cellValue,
26749
+ };
26750
+ this.parent.trigger(pdfQueryCellInfo, args);
26751
+ pdfGridRow.cells.getCell(localCnt).value = args.value ? args.value : cellValue;
26752
+ }
26701
26753
  if (args.style) {
26702
26754
  this.processCellStyle(pdfGridRow.cells.getCell(localCnt), args);
26703
26755
  }
@@ -26709,6 +26761,15 @@ class PDFExport {
26709
26761
  cell: pdfGridRow.cells.getCell(localCnt)
26710
26762
  };
26711
26763
  this.parent.trigger(onPdfCellRender, args);
26764
+ let pivotCell = { formattedText: "" };
26765
+ if (pivotCell.axis == "column") {
26766
+ args = {
26767
+ style: args.style,
26768
+ cell: args.cell,
26769
+ gridCell: args.pivotCell
26770
+ };
26771
+ this.parent.trigger(pdfHeaderQueryCellInfo, args);
26772
+ }
26712
26773
  if (args.style) {
26713
26774
  this.processCellStyle(pdfGridRow.cells.getCell(localCnt), args);
26714
26775
  }
@@ -35276,10 +35337,10 @@ class Toolbar$2 {
35276
35337
  }
35277
35338
  }
35278
35339
  actionClick(args) {
35279
- let actionName = (args.item.id == "PivotViewnew") ? addNewReport : (args.item.id == "PivotViewsave") ? saveCurrentReport : (args.item.id == "PivotViewsaveas") ? saveAsCurrentReport
35280
- : (args.item.id == "PivotViewrename") ? renameCurrentReport : (args.item.id == "PivotViewremove") ? removeCurrentReport : (args.item.id == "PivotViewload") ? loadReports
35281
- : (args.item.id == "PivotViewformatting") ? openConditionalFormatting : (args.item.id == "PivotViewnumberFormatting") ? openNumberFormatting
35282
- : (args.item.id == "PivotViewmdxQuery") ? MdxQuery : (args.item.id == "PivotViewfieldlist") ? showFieldList : '';
35340
+ let actionName = (args.item.id == this.parent.element.id + 'new') ? addNewReport : (args.item.id == this.parent.element.id + 'save') ? saveCurrentReport : (args.item.id == this.parent.element.id + 'saveas') ? saveAsCurrentReport
35341
+ : (args.item.id == this.parent.element.id + 'rename') ? renameCurrentReport : (args.item.id == this.parent.element.id + 'remove') ? removeCurrentReport : (args.item.id == this.parent.element.id + 'load') ? loadReports
35342
+ : (args.item.id == this.parent.element.id + 'formatting') ? openConditionalFormatting : (args.item.id == this.parent.element.id + 'numberFormatting') ? openNumberFormatting
35343
+ : (args.item.id == this.parent.element.id + 'mdxQuery') ? MdxQuery : (args.item.id == this.parent.element.id + 'fieldlist') ? showFieldList : '';
35283
35344
  this.parent.actionObj.actionName = actionName;
35284
35345
  if (this.parent.actionBeginMethod()) {
35285
35346
  return;
@@ -36115,14 +36176,14 @@ class Toolbar$2 {
36115
36176
  menuItemClick(args) {
36116
36177
  let exportArgs = {};
36117
36178
  let type;
36118
- let actionName = (args.item.id == "PivotViewgrid") ? tableView : (args.item.id == "PivotView_Column") ? chartView : (args.item.id == "PivotView_Bar") ? chartView : (args.item.id == "PivotView_Line") ? chartView
36119
- : (args.item.id == "PivotView_Area") ? chartView : (args.item.id == "PivotView_Scatter") ? chartView : (args.item.id == "PivotView_Polar") ? chartView : (args.item.id == "PivotView_ChartMoreOption") ? chartView
36120
- : (args.item.id == "PivotView_multipleAxes") ? multipleAxis : (args.item.id == "PivotView_showLegend") ? showLegend : (args.item.id == "PivotViewpdf") ? pdfExport : (args.item.id == "PivotViewpng") ? pngExport
36121
- : (args.item.id == "PivotViewexcel") ? excelExport : (args.item.id == "PivotViewcsv") ? csvExport : (args.item.id == "PivotViewjpeg") ? jpegExport : (args.item.id == "PivotViewsvg") ? svgExport
36122
- : (args.item.id == "PivotViewnotsubtotal") ? hideSubTotals : (args.item.id == "PivotViewsubtotalrow") ? subTotalsRow : (args.item.id == "PivotViewsubtotalcolumn") ? subTotalsColumn
36123
- : (args.item.id == "PivotViewsubtotal") ? showSubTotals : (args.item.id == "PivotViewnotgrandtotal") ? hideGrandTotals : (args.item.id == "PivotViewgrandtotalrow") ? grandTotalsRow
36124
- : (args.item.id == "PivotViewgrandtotalcolumn") ? grandTotalsColumn : (args.item.id == "PivotViewgrandtotal") ? showGrandTotals
36125
- : (args.item.id == "PivotViewnumberFormattingMenu") ? numberFormattingMenu : (args.item.id == "PivotViewconditionalFormattingMenu") ? conditionalFormattingMenu : '';
36179
+ let actionName = (args.item.id == this.parent.element.id + 'grid') ? tableView : (args.item.id == this.parent.element.id + '_' + "Column") ? chartView : (args.item.id == this.parent.element.id + '_' + "Bar") ? chartView : (args.item.id == this.parent.element.id + '_' + "Line") ? chartView
36180
+ : (args.item.id == this.parent.element.id + '_' + "Area") ? chartView : (args.item.id == this.parent.element.id + '_' + "Scatter") ? chartView : (args.item.id == this.parent.element.id + '_' + "Polar") ? chartView : (args.item.id == this.parent.element.id + '_' + "ChartMoreOption") ? chartView
36181
+ : (args.item.id == this.parent.element.id + '_' + "multipleAxes") ? multipleAxis : (args.item.id == this.parent.element.id + '_' + "showLegend") ? showLegend : (args.item.id == this.parent.element.id + "pdf") ? pdfExport : (args.item.id == this.parent.element.id + "png") ? pngExport
36182
+ : (args.item.id == this.parent.element.id + "excel") ? excelExport : (args.item.id == this.parent.element.id + "csv") ? csvExport : (args.item.id == this.parent.element.id + "jpeg") ? jpegExport : (args.item.id == this.parent.element.id + "svg") ? svgExport
36183
+ : (args.item.id == this.parent.element.id + "notsubtotal") ? hideSubTotals : (args.item.id == this.parent.element.id + "subtotalrow") ? subTotalsRow : (args.item.id == this.parent.element.id + "subtotalcolumn") ? subTotalsColumn
36184
+ : (args.item.id == this.parent.element.id + "subtotal") ? showSubTotals : (args.item.id == this.parent.element.id + "notgrandtotal") ? hideGrandTotals : (args.item.id == this.parent.element.id + "grandtotalrow") ? grandTotalsRow
36185
+ : (args.item.id == this.parent.element.id + "grandtotalcolumn") ? grandTotalsColumn : (args.item.id == this.parent.element.id + "grandtotal") ? showGrandTotals
36186
+ : (args.item.id == this.parent.element.id + "numberFormattingMenu") ? numberFormattingMenu : (args.item.id == this.parent.element.id + "conditionalFormattingMenu") ? conditionalFormattingMenu : '';
36126
36187
  this.parent.actionObj.actionName = actionName;
36127
36188
  if (this.parent.actionBeginMethod()) {
36128
36189
  return;