@datorama/core 22.11.0 → 22.11.2

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.
@@ -11317,6 +11317,8 @@ var GridQuery = /** @class */ (function (_super) {
11317
11317
  //@internal
11318
11318
  _this._serverDataLoaded = new Subject();
11319
11319
  _this.serverDataLoaded$ = _this._serverDataLoaded.asObservable();
11320
+ _this._rowActionVisibilityChanged = new Subject();
11321
+ _this.rowActionVisibilityChanged$ = _this._rowActionVisibilityChanged.asObservable();
11320
11322
  _this.rowDataChanged$ = _this.waitForGrid(function () {
11321
11323
  return merge$1(_this.gridRef.rowDataChanged, _this.gridRef.rowDataUpdated, _this.gridRef.filterChanged, _this.serverDataLoaded$);
11322
11324
  });
@@ -11523,6 +11525,7 @@ var GridQuery = /** @class */ (function (_super) {
11523
11525
  return this.select(function (state) { return state.serverSidePagination.selectAllRowsEnabled; });
11524
11526
  };
11525
11527
  GridQuery.prototype.getSecondaryColumn = function (colId) {
11528
+ /** Use getPivotResultColumns from ver 28 */
11526
11529
  var secondaryColumns = this.api.columns.getSecondaryColumns();
11527
11530
  if (secondaryColumns) {
11528
11531
  return secondaryColumns.find(function (col) { return col.getColId() === colId; });
@@ -12766,6 +12769,7 @@ var DatoGridFilterComponent = /** @class */ (function () {
12766
12769
  var filtersConfig = colDef.filtersConfig || this.colDef.filtersConfig || {};
12767
12770
  var colFilter = filter || colDef.filter;
12768
12771
  var filterOptions = DatoGridFilterOptionsMap[colFilter];
12772
+ /** Use getPivotResultColumn from ver 28 */
12769
12773
  this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
12770
12774
  this.inputConditionsOperator = filtersConfig.inputConditionsOperator;
12771
12775
  if (!isNil(filtersConfig.showClearFiltersButton)) {
@@ -14142,11 +14146,24 @@ var GridService = /** @class */ (function () {
14142
14146
  this.initPivotSecondaryColsProcess(params);
14143
14147
  params.gridOptions.enableV2_1 = true;
14144
14148
  params.gridOptions.saveSettings = false;
14145
- params.gridOptions.defaultColDef.cellClass = this.getPivotCellClass.bind(this);
14146
- params.gridOptions.autoGroupColumnDef.cellClass = this.getPivotCellClass.bind(this);
14149
+ params.gridOptions.defaultColDef = __assign(__assign({}, params.gridOptions.defaultColDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
14150
+ params.gridOptions.autoGroupColumnDef = __assign(__assign({}, params.gridOptions.autoGroupColumnDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
14147
14151
  }
14148
14152
  return params.gridOptions;
14149
14153
  };
14154
+ GridService.prototype.getPivotHeaderClass = function (params) {
14155
+ var gridQuery = params.colDef.headerComponentParams.gridQuery;
14156
+ var cellClass = '';
14157
+ if (gridQuery && gridQuery.api) {
14158
+ var columns = gridQuery.api.columns;
14159
+ /** Use getPivotResultColumns from ver 28 */
14160
+ var pivotColumns = columns.getSecondaryColumns();
14161
+ if (pivotColumns && pivotColumns.length > 0) {
14162
+ cellClass += 'top-border';
14163
+ }
14164
+ }
14165
+ return cellClass;
14166
+ };
14150
14167
  GridService.prototype.getPivotCellClass = function (params) {
14151
14168
  var _a = params.node, leafGroup = _a.leafGroup, childIndex = _a.childIndex, rowGroupIndex = _a.rowGroupIndex;
14152
14169
  var gridQuery = params.colDef.headerComponentParams.gridQuery;
@@ -14162,11 +14179,11 @@ var GridService = /** @class */ (function () {
14162
14179
  if (leafGroup) {
14163
14180
  if (childIndex % 2 === 0) {
14164
14181
  /** If row is even */
14165
- cellClass += ' primary-100-background-color';
14182
+ cellClass += ' primary-0-background-color';
14166
14183
  }
14167
14184
  }
14168
14185
  else {
14169
- cellClass += 'primary-0-background-color pointer dato-simple-bold';
14186
+ cellClass += 'bottom-border primary-100-background-color pointer dato-simple-bold';
14170
14187
  }
14171
14188
  }
14172
14189
  }
@@ -14940,6 +14957,9 @@ var GridService = /** @class */ (function () {
14940
14957
  this.setServerSidePagination({ selectAllRowsEnabled: false, excludedFromSelectAll: [] });
14941
14958
  }
14942
14959
  };
14960
+ GridService.prototype.resolveRowActionsVisibility = function () {
14961
+ this.gridQuery._rowActionVisibilityChanged.next();
14962
+ };
14943
14963
  /**
14944
14964
  * When pivoting,
14945
14965
  * we add the field name to the column header class in order to access it through the auto generated pivot column.
@@ -14947,6 +14967,7 @@ var GridService = /** @class */ (function () {
14947
14967
  GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
14948
14968
  var _this = this;
14949
14969
  var gridOptions = _a.gridOptions;
14970
+ /** Use processPivotResultColDef from ver 28 */
14950
14971
  gridOptions.processSecondaryColDef = function (colDef) {
14951
14972
  var userProvidedColDef = colDef.pivotValueColumn && colDef.pivotValueColumn.getUserProvidedColDef();
14952
14973
  if (userProvidedColDef) {
@@ -14959,6 +14980,7 @@ var GridService = /** @class */ (function () {
14959
14980
  });
14960
14981
  }
14961
14982
  };
14983
+ /** Use processPivotResultColGroupDe from ver 28 */
14962
14984
  gridOptions.processSecondaryColGroupDef = function (colGroupDef) {
14963
14985
  if (colGroupDef.headerName) {
14964
14986
  var parsedValue = tryParsePivotValue(colGroupDef.headerName);
@@ -15463,7 +15485,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
15463
15485
  });
15464
15486
  DatoGridControllerComponent.prototype.ngOnDestroy = function () {
15465
15487
  this.contentInit.complete();
15466
- this.tooltip && this.clearTooltip();
15488
+ this.clearTooltip();
15467
15489
  this.rowHoverComponent && this.rowHoverComponent.destroy();
15468
15490
  this.rowHoverComponent = null;
15469
15491
  };
@@ -15690,40 +15712,51 @@ var DatoGridControllerComponent = /** @class */ (function () {
15690
15712
  });
15691
15713
  this.addOnHoverElement();
15692
15714
  }
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();
15715
+ agGrid.cellMouseOver.pipe(untilDestroyed(this)).subscribe(function (event) {
15716
+ var node = event.node, column = event.column;
15717
+ if (lastHoveredCell === node.id + "-" + column.getColId()) {
15718
+ clearTimeout(_this.cellMouseOutTimer);
15719
+ return;
15720
+ }
15721
+ lastHoveredCell = node.id + "-" + column.getColId();
15700
15722
  _this.showTooltip(event);
15701
15723
  var row = event.event.target.parentElement;
15702
- if (onHoverEnabled && (event.node.group === false || isNil(event.node.group)) && _this.lastHoveredRow !== row) {
15724
+ if (onHoverEnabled && (node.group === false || isNil(node.group)) && _this.lastHoveredRow !== row) {
15703
15725
  var previousNode = _this.lastHoveredRow;
15704
15726
  _this.lastHoveredRow = row;
15705
15727
  _this.toggleRowHoverClass([previousNode, _this.lastHoveredRow]);
15706
15728
  _this.setOnHoverState(true, event);
15707
15729
  }
15708
15730
  });
15709
- var onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'), agGrid.cellMouseOut);
15710
- onTooltipOut
15731
+ var onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'));
15732
+ onTooltipOut.pipe(untilDestroyed(this)).subscribe(function () {
15733
+ lastHoveredCell = null;
15734
+ _this.clearTooltip();
15735
+ });
15736
+ agGrid.cellMouseOut
15711
15737
  .pipe(filter$1(function () { return !isNil(_this.tooltip); }), untilDestroyed(this))
15712
15738
  .subscribe(function () {
15713
- _this.clearTooltip();
15739
+ _this.cellMouseOutTimer = window.setTimeout(function () { return _this.clearTooltip(); });
15714
15740
  });
15715
15741
  };
15716
15742
  /**
15717
15743
  * Dispose the tooltip
15718
15744
  */
15719
15745
  DatoGridControllerComponent.prototype.clearTooltip = function () {
15720
- this.tooltip.dispose();
15746
+ this.tooltip && this.tooltip.dispose();
15721
15747
  this.tooltip = null;
15722
15748
  };
15723
15749
  DatoGridControllerComponent.prototype.showTooltip = function (event) {
15724
15750
  var cell = event.event.target;
15751
+ if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
15752
+ cell = cell.parentElement;
15753
+ }
15754
+ if (event.colDef.editable) {
15755
+ cell = cell.querySelector('.value-wrapper') || cell;
15756
+ }
15725
15757
  var textOverflow = cell.offsetWidth < cell.scrollWidth;
15726
15758
  if (textOverflow) {
15759
+ clearTimeout(this.cellMouseOutTimer);
15727
15760
  var params = { cell: cell, value: cell.innerText };
15728
15761
  isNil(this.tooltip) ? this.createAndShowTooltip(params) : this.updateTooltip(params);
15729
15762
  }
@@ -16746,7 +16779,7 @@ var DatoGridV2ToolbarComponent = /** @class */ (function () {
16746
16779
  DatoGridV2ToolbarComponent.prototype.ngOnInit = function () {
16747
16780
  var _this = this;
16748
16781
  var dataChanges = this.gridController.gridQuery.waitForGrid(function () {
16749
- return merge$1(_this.gridQuery.gridRef.cellValueChanged, _this.gridQuery.gridRef.rowDataUpdated).pipe(debounceTime(100), untilDestroyed(_this));
16782
+ return merge$1(_this.gridQuery.gridRef.cellValueChanged, _this.gridQuery.gridRef.rowDataUpdated, _this.gridQuery.rowActionVisibilityChanged$).pipe(debounceTime(100), untilDestroyed(_this));
16750
16783
  });
16751
16784
  var gridInit = this.gridQuery.gridReady$.pipe(take(1));
16752
16785
  gridInit.pipe(untilDestroyed(this)).subscribe(function () {
@@ -25374,7 +25407,7 @@ function fixNgLeaks() {
25374
25407
  };
25375
25408
  }
25376
25409
 
25377
- window.coreVersion = '22.11.0';
25410
+ window.coreVersion = '22.11.2';
25378
25411
 
25379
25412
  /**
25380
25413
  * @license