@datorama/core 22.11.0 → 22.11.1

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.
@@ -11523,6 +11523,7 @@ var GridQuery = /** @class */ (function (_super) {
11523
11523
  return this.select(function (state) { return state.serverSidePagination.selectAllRowsEnabled; });
11524
11524
  };
11525
11525
  GridQuery.prototype.getSecondaryColumn = function (colId) {
11526
+ /** Use getPivotResultColumns from ver 28 */
11526
11527
  var secondaryColumns = this.api.columns.getSecondaryColumns();
11527
11528
  if (secondaryColumns) {
11528
11529
  return secondaryColumns.find(function (col) { return col.getColId() === colId; });
@@ -12766,6 +12767,7 @@ var DatoGridFilterComponent = /** @class */ (function () {
12766
12767
  var filtersConfig = colDef.filtersConfig || this.colDef.filtersConfig || {};
12767
12768
  var colFilter = filter || colDef.filter;
12768
12769
  var filterOptions = DatoGridFilterOptionsMap[colFilter];
12770
+ /** Use getPivotResultColumn from ver 28 */
12769
12771
  this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
12770
12772
  this.inputConditionsOperator = filtersConfig.inputConditionsOperator;
12771
12773
  if (!isNil(filtersConfig.showClearFiltersButton)) {
@@ -14142,11 +14144,24 @@ var GridService = /** @class */ (function () {
14142
14144
  this.initPivotSecondaryColsProcess(params);
14143
14145
  params.gridOptions.enableV2_1 = true;
14144
14146
  params.gridOptions.saveSettings = false;
14145
- params.gridOptions.defaultColDef.cellClass = this.getPivotCellClass.bind(this);
14146
- params.gridOptions.autoGroupColumnDef.cellClass = this.getPivotCellClass.bind(this);
14147
+ params.gridOptions.defaultColDef = __assign(__assign({}, params.gridOptions.defaultColDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
14148
+ params.gridOptions.autoGroupColumnDef = __assign(__assign({}, params.gridOptions.autoGroupColumnDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
14147
14149
  }
14148
14150
  return params.gridOptions;
14149
14151
  };
14152
+ GridService.prototype.getPivotHeaderClass = function (params) {
14153
+ var gridQuery = params.colDef.headerComponentParams.gridQuery;
14154
+ var cellClass = '';
14155
+ if (gridQuery && gridQuery.api) {
14156
+ var columns = gridQuery.api.columns;
14157
+ /** Use getPivotResultColumns from ver 28 */
14158
+ var pivotColumns = columns.getSecondaryColumns();
14159
+ if (pivotColumns && pivotColumns.length > 0) {
14160
+ cellClass += 'top-border';
14161
+ }
14162
+ }
14163
+ return cellClass;
14164
+ };
14150
14165
  GridService.prototype.getPivotCellClass = function (params) {
14151
14166
  var _a = params.node, leafGroup = _a.leafGroup, childIndex = _a.childIndex, rowGroupIndex = _a.rowGroupIndex;
14152
14167
  var gridQuery = params.colDef.headerComponentParams.gridQuery;
@@ -14162,11 +14177,11 @@ var GridService = /** @class */ (function () {
14162
14177
  if (leafGroup) {
14163
14178
  if (childIndex % 2 === 0) {
14164
14179
  /** If row is even */
14165
- cellClass += ' primary-100-background-color';
14180
+ cellClass += ' primary-0-background-color';
14166
14181
  }
14167
14182
  }
14168
14183
  else {
14169
- cellClass += 'primary-0-background-color pointer dato-simple-bold';
14184
+ cellClass += 'bottom-border primary-100-background-color pointer dato-simple-bold';
14170
14185
  }
14171
14186
  }
14172
14187
  }
@@ -14947,6 +14962,7 @@ var GridService = /** @class */ (function () {
14947
14962
  GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
14948
14963
  var _this = this;
14949
14964
  var gridOptions = _a.gridOptions;
14965
+ /** Use processPivotResultColDef from ver 28 */
14950
14966
  gridOptions.processSecondaryColDef = function (colDef) {
14951
14967
  var userProvidedColDef = colDef.pivotValueColumn && colDef.pivotValueColumn.getUserProvidedColDef();
14952
14968
  if (userProvidedColDef) {
@@ -14959,6 +14975,7 @@ var GridService = /** @class */ (function () {
14959
14975
  });
14960
14976
  }
14961
14977
  };
14978
+ /** Use processPivotResultColGroupDe from ver 28 */
14962
14979
  gridOptions.processSecondaryColGroupDef = function (colGroupDef) {
14963
14980
  if (colGroupDef.headerName) {
14964
14981
  var parsedValue = tryParsePivotValue(colGroupDef.headerName);
@@ -15463,7 +15480,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
15463
15480
  });
15464
15481
  DatoGridControllerComponent.prototype.ngOnDestroy = function () {
15465
15482
  this.contentInit.complete();
15466
- this.tooltip && this.clearTooltip();
15483
+ this.clearTooltip();
15467
15484
  this.rowHoverComponent && this.rowHoverComponent.destroy();
15468
15485
  this.rowHoverComponent = null;
15469
15486
  };
@@ -15690,40 +15707,51 @@ var DatoGridControllerComponent = /** @class */ (function () {
15690
15707
  });
15691
15708
  this.addOnHoverElement();
15692
15709
  }
15693
- agGrid.cellMouseOver
15694
- .pipe(filter$1(function (_a) {
15695
- var node = _a.node, column = _a.column;
15696
- return lastHoveredCell !== node.id + "-" + column.getColId();
15697
- }), untilDestroyed(this))
15698
- .subscribe(function (event) {
15699
- lastHoveredCell = event.node.id + "-" + event.column.getColId();
15710
+ agGrid.cellMouseOver.pipe(untilDestroyed(this)).subscribe(function (event) {
15711
+ var node = event.node, column = event.column;
15712
+ if (lastHoveredCell === node.id + "-" + column.getColId()) {
15713
+ clearTimeout(_this.cellMouseOutTimer);
15714
+ return;
15715
+ }
15716
+ lastHoveredCell = node.id + "-" + column.getColId();
15700
15717
  _this.showTooltip(event);
15701
15718
  var row = event.event.target.parentElement;
15702
- if (onHoverEnabled && (event.node.group === false || isNil(event.node.group)) && _this.lastHoveredRow !== row) {
15719
+ if (onHoverEnabled && (node.group === false || isNil(node.group)) && _this.lastHoveredRow !== row) {
15703
15720
  var previousNode = _this.lastHoveredRow;
15704
15721
  _this.lastHoveredRow = row;
15705
15722
  _this.toggleRowHoverClass([previousNode, _this.lastHoveredRow]);
15706
15723
  _this.setOnHoverState(true, event);
15707
15724
  }
15708
15725
  });
15709
- var onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'), agGrid.cellMouseOut);
15710
- onTooltipOut
15726
+ var onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'));
15727
+ onTooltipOut.pipe(untilDestroyed(this)).subscribe(function () {
15728
+ lastHoveredCell = null;
15729
+ _this.clearTooltip();
15730
+ });
15731
+ agGrid.cellMouseOut
15711
15732
  .pipe(filter$1(function () { return !isNil(_this.tooltip); }), untilDestroyed(this))
15712
15733
  .subscribe(function () {
15713
- _this.clearTooltip();
15734
+ _this.cellMouseOutTimer = window.setTimeout(function () { return _this.clearTooltip(); });
15714
15735
  });
15715
15736
  };
15716
15737
  /**
15717
15738
  * Dispose the tooltip
15718
15739
  */
15719
15740
  DatoGridControllerComponent.prototype.clearTooltip = function () {
15720
- this.tooltip.dispose();
15741
+ this.tooltip && this.tooltip.dispose();
15721
15742
  this.tooltip = null;
15722
15743
  };
15723
15744
  DatoGridControllerComponent.prototype.showTooltip = function (event) {
15724
15745
  var cell = event.event.target;
15746
+ if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
15747
+ cell = cell.parentElement;
15748
+ }
15749
+ if (event.colDef.editable) {
15750
+ cell = cell.querySelector('.value-wrapper') || cell;
15751
+ }
15725
15752
  var textOverflow = cell.offsetWidth < cell.scrollWidth;
15726
15753
  if (textOverflow) {
15754
+ clearTimeout(this.cellMouseOutTimer);
15727
15755
  var params = { cell: cell, value: cell.innerText };
15728
15756
  isNil(this.tooltip) ? this.createAndShowTooltip(params) : this.updateTooltip(params);
15729
15757
  }
@@ -25374,7 +25402,7 @@ function fixNgLeaks() {
25374
25402
  };
25375
25403
  }
25376
25404
 
25377
- window.coreVersion = '22.11.0';
25405
+ window.coreVersion = '22.11.1';
25378
25406
 
25379
25407
  /**
25380
25408
  * @license