@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.
@@ -10232,6 +10232,7 @@ let GridQuery = class GridQuery extends Query {
10232
10232
  return this.select(state => state.serverSidePagination.selectAllRowsEnabled);
10233
10233
  }
10234
10234
  getSecondaryColumn(colId) {
10235
+ /** Use getPivotResultColumns from ver 28 */
10235
10236
  const secondaryColumns = this.api.columns.getSecondaryColumns();
10236
10237
  if (secondaryColumns) {
10237
10238
  return secondaryColumns.find(col => col.getColId() === colId);
@@ -11325,6 +11326,7 @@ let DatoGridFilterComponent = class DatoGridFilterComponent {
11325
11326
  const filtersConfig = colDef.filtersConfig || this.colDef.filtersConfig || {};
11326
11327
  const colFilter = filter || colDef.filter;
11327
11328
  const filterOptions = DatoGridFilterOptionsMap[colFilter];
11329
+ /** Use getPivotResultColumn from ver 28 */
11328
11330
  this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
11329
11331
  this.inputConditionsOperator = filtersConfig.inputConditionsOperator;
11330
11332
  if (!isNil(filtersConfig.showClearFiltersButton)) {
@@ -12613,11 +12615,24 @@ let GridService = class GridService {
12613
12615
  this.initPivotSecondaryColsProcess(params);
12614
12616
  params.gridOptions.enableV2_1 = true;
12615
12617
  params.gridOptions.saveSettings = false;
12616
- params.gridOptions.defaultColDef.cellClass = this.getPivotCellClass.bind(this);
12617
- params.gridOptions.autoGroupColumnDef.cellClass = this.getPivotCellClass.bind(this);
12618
+ params.gridOptions.defaultColDef = Object.assign(Object.assign({}, params.gridOptions.defaultColDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
12619
+ params.gridOptions.autoGroupColumnDef = Object.assign(Object.assign({}, params.gridOptions.autoGroupColumnDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
12618
12620
  }
12619
12621
  return params.gridOptions;
12620
12622
  }
12623
+ getPivotHeaderClass(params) {
12624
+ const gridQuery = params.colDef.headerComponentParams.gridQuery;
12625
+ let cellClass = '';
12626
+ if (gridQuery && gridQuery.api) {
12627
+ const { columns } = gridQuery.api;
12628
+ /** Use getPivotResultColumns from ver 28 */
12629
+ const pivotColumns = columns.getSecondaryColumns();
12630
+ if (pivotColumns && pivotColumns.length > 0) {
12631
+ cellClass += 'top-border';
12632
+ }
12633
+ }
12634
+ return cellClass;
12635
+ }
12621
12636
  getPivotCellClass(params) {
12622
12637
  const { leafGroup, childIndex, rowGroupIndex } = params.node;
12623
12638
  const gridQuery = params.colDef.headerComponentParams.gridQuery;
@@ -12633,11 +12648,11 @@ let GridService = class GridService {
12633
12648
  if (leafGroup) {
12634
12649
  if (childIndex % 2 === 0) {
12635
12650
  /** If row is even */
12636
- cellClass += ' primary-100-background-color';
12651
+ cellClass += ' primary-0-background-color';
12637
12652
  }
12638
12653
  }
12639
12654
  else {
12640
- cellClass += 'primary-0-background-color pointer dato-simple-bold';
12655
+ cellClass += 'bottom-border primary-100-background-color pointer dato-simple-bold';
12641
12656
  }
12642
12657
  }
12643
12658
  }
@@ -13324,6 +13339,7 @@ let GridService = class GridService {
13324
13339
  * we add the field name to the column header class in order to access it through the auto generated pivot column.
13325
13340
  */
13326
13341
  initPivotSecondaryColsProcess({ gridOptions }) {
13342
+ /** Use processPivotResultColDef from ver 28 */
13327
13343
  gridOptions.processSecondaryColDef = colDef => {
13328
13344
  const userProvidedColDef = colDef.pivotValueColumn && colDef.pivotValueColumn.getUserProvidedColDef();
13329
13345
  if (userProvidedColDef) {
@@ -13336,6 +13352,7 @@ let GridService = class GridService {
13336
13352
  });
13337
13353
  }
13338
13354
  };
13355
+ /** Use processPivotResultColGroupDe from ver 28 */
13339
13356
  gridOptions.processSecondaryColGroupDef = (colGroupDef) => {
13340
13357
  if (colGroupDef.headerName) {
13341
13358
  const parsedValue = tryParsePivotValue(colGroupDef.headerName);
@@ -13802,7 +13819,7 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
13802
13819
  }
13803
13820
  ngOnDestroy() {
13804
13821
  this.contentInit.complete();
13805
- this.tooltip && this.clearTooltip();
13822
+ this.clearTooltip();
13806
13823
  this.rowHoverComponent && this.rowHoverComponent.destroy();
13807
13824
  this.rowHoverComponent = null;
13808
13825
  }
@@ -14003,37 +14020,51 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
14003
14020
  });
14004
14021
  this.addOnHoverElement();
14005
14022
  }
14006
- agGrid.cellMouseOver
14007
- .pipe(filter$1(({ node, column }) => lastHoveredCell !== `${node.id}-${column.getColId()}`), untilDestroyed(this))
14008
- .subscribe((event) => {
14009
- lastHoveredCell = `${event.node.id}-${event.column.getColId()}`;
14023
+ agGrid.cellMouseOver.pipe(untilDestroyed(this)).subscribe((event) => {
14024
+ const { node, column } = event;
14025
+ if (lastHoveredCell === `${node.id}-${column.getColId()}`) {
14026
+ clearTimeout(this.cellMouseOutTimer);
14027
+ return;
14028
+ }
14029
+ lastHoveredCell = `${node.id}-${column.getColId()}`;
14010
14030
  this.showTooltip(event);
14011
14031
  const row = event.event.target.parentElement;
14012
- if (onHoverEnabled && (event.node.group === false || isNil(event.node.group)) && this.lastHoveredRow !== row) {
14032
+ if (onHoverEnabled && (node.group === false || isNil(node.group)) && this.lastHoveredRow !== row) {
14013
14033
  const previousNode = this.lastHoveredRow;
14014
14034
  this.lastHoveredRow = row;
14015
14035
  this.toggleRowHoverClass([previousNode, this.lastHoveredRow]);
14016
14036
  this.setOnHoverState(true, event);
14017
14037
  }
14018
14038
  });
14019
- const onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'), agGrid.cellMouseOut);
14020
- onTooltipOut
14039
+ const onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'));
14040
+ onTooltipOut.pipe(untilDestroyed(this)).subscribe(() => {
14041
+ lastHoveredCell = null;
14042
+ this.clearTooltip();
14043
+ });
14044
+ agGrid.cellMouseOut
14021
14045
  .pipe(filter$1(() => !isNil(this.tooltip)), untilDestroyed(this))
14022
14046
  .subscribe(() => {
14023
- this.clearTooltip();
14047
+ this.cellMouseOutTimer = window.setTimeout(() => this.clearTooltip());
14024
14048
  });
14025
14049
  }
14026
14050
  /**
14027
14051
  * Dispose the tooltip
14028
14052
  */
14029
14053
  clearTooltip() {
14030
- this.tooltip.dispose();
14054
+ this.tooltip && this.tooltip.dispose();
14031
14055
  this.tooltip = null;
14032
14056
  }
14033
14057
  showTooltip(event) {
14034
- const cell = event.event.target;
14058
+ let cell = event.event.target;
14059
+ if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
14060
+ cell = cell.parentElement;
14061
+ }
14062
+ if (event.colDef.editable) {
14063
+ cell = cell.querySelector('.value-wrapper') || cell;
14064
+ }
14035
14065
  const textOverflow = cell.offsetWidth < cell.scrollWidth;
14036
14066
  if (textOverflow) {
14067
+ clearTimeout(this.cellMouseOutTimer);
14037
14068
  const params = { cell, value: cell.innerText };
14038
14069
  isNil(this.tooltip) ? this.createAndShowTooltip(params) : this.updateTooltip(params);
14039
14070
  }
@@ -22805,7 +22836,7 @@ function fixNgLeaks() {
22805
22836
  };
22806
22837
  }
22807
22838
 
22808
- window.coreVersion = '22.11.0';
22839
+ window.coreVersion = '22.11.1';
22809
22840
 
22810
22841
  /**
22811
22842
  * @license