@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.
package/bundle.scss CHANGED
@@ -14319,6 +14319,10 @@ dato-input input:disabled:hover {
14319
14319
  */
14320
14320
  }
14321
14321
 
14322
+ .dato-grid.pivot-mode .ag-row.ag-row-group .bottom-border {
14323
+ border-bottom: 1px solid themify(primary-200);
14324
+ }
14325
+
14322
14326
  .dato-grid.pivot-mode .ag-row.ag-row-group:not(.ag-row-hover) {
14323
14327
  background-color: themify(primary-50);
14324
14328
  }
@@ -14333,7 +14337,6 @@ dato-input input:disabled:hover {
14333
14337
 
14334
14338
  .dato-grid.pivot-mode .ag-header .ag-header-row .ag-header-cell {
14335
14339
  border: none;
14336
- border-top: 1px solid themify(primary-200);
14337
14340
  }
14338
14341
 
14339
14342
  .dato-grid.pivot-mode .ag-header .ag-header-row .ag-header-cell dato-grid-column-header {
@@ -14349,6 +14352,10 @@ dato-input input:disabled:hover {
14349
14352
  color: themify(primary-500);
14350
14353
  }
14351
14354
 
14355
+ .dato-grid.pivot-mode .ag-header .ag-header-row .ag-header-cell.top-border {
14356
+ border-top: 1px solid themify(primary-200);
14357
+ }
14358
+
14352
14359
  .dato-grid.pivot-mode .ag-header .ag-header-row .ag-header-cell-resize {
14353
14360
  height: 100%;
14354
14361
  margin: 0;
@@ -11722,6 +11722,7 @@
11722
11722
  return this.select(function (state) { return state.serverSidePagination.selectAllRowsEnabled; });
11723
11723
  };
11724
11724
  GridQuery.prototype.getSecondaryColumn = function (colId) {
11725
+ /** Use getPivotResultColumns from ver 28 */
11725
11726
  var secondaryColumns = this.api.columns.getSecondaryColumns();
11726
11727
  if (secondaryColumns) {
11727
11728
  return secondaryColumns.find(function (col) { return col.getColId() === colId; });
@@ -12965,6 +12966,7 @@
12965
12966
  var filtersConfig = colDef.filtersConfig || this.colDef.filtersConfig || {};
12966
12967
  var colFilter = filter || colDef.filter;
12967
12968
  var filterOptions = DatoGridFilterOptionsMap[colFilter];
12969
+ /** Use getPivotResultColumn from ver 28 */
12968
12970
  this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
12969
12971
  this.inputConditionsOperator = filtersConfig.inputConditionsOperator;
12970
12972
  if (!isNil(filtersConfig.showClearFiltersButton)) {
@@ -14341,11 +14343,24 @@
14341
14343
  this.initPivotSecondaryColsProcess(params);
14342
14344
  params.gridOptions.enableV2_1 = true;
14343
14345
  params.gridOptions.saveSettings = false;
14344
- params.gridOptions.defaultColDef.cellClass = this.getPivotCellClass.bind(this);
14345
- params.gridOptions.autoGroupColumnDef.cellClass = this.getPivotCellClass.bind(this);
14346
+ params.gridOptions.defaultColDef = __assign(__assign({}, params.gridOptions.defaultColDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
14347
+ params.gridOptions.autoGroupColumnDef = __assign(__assign({}, params.gridOptions.autoGroupColumnDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
14346
14348
  }
14347
14349
  return params.gridOptions;
14348
14350
  };
14351
+ GridService.prototype.getPivotHeaderClass = function (params) {
14352
+ var gridQuery = params.colDef.headerComponentParams.gridQuery;
14353
+ var cellClass = '';
14354
+ if (gridQuery && gridQuery.api) {
14355
+ var columns = gridQuery.api.columns;
14356
+ /** Use getPivotResultColumns from ver 28 */
14357
+ var pivotColumns = columns.getSecondaryColumns();
14358
+ if (pivotColumns && pivotColumns.length > 0) {
14359
+ cellClass += 'top-border';
14360
+ }
14361
+ }
14362
+ return cellClass;
14363
+ };
14349
14364
  GridService.prototype.getPivotCellClass = function (params) {
14350
14365
  var _a = params.node, leafGroup = _a.leafGroup, childIndex = _a.childIndex, rowGroupIndex = _a.rowGroupIndex;
14351
14366
  var gridQuery = params.colDef.headerComponentParams.gridQuery;
@@ -14361,11 +14376,11 @@
14361
14376
  if (leafGroup) {
14362
14377
  if (childIndex % 2 === 0) {
14363
14378
  /** If row is even */
14364
- cellClass += ' primary-100-background-color';
14379
+ cellClass += ' primary-0-background-color';
14365
14380
  }
14366
14381
  }
14367
14382
  else {
14368
- cellClass += 'primary-0-background-color pointer dato-simple-bold';
14383
+ cellClass += 'bottom-border primary-100-background-color pointer dato-simple-bold';
14369
14384
  }
14370
14385
  }
14371
14386
  }
@@ -15146,6 +15161,7 @@
15146
15161
  GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
15147
15162
  var _this = this;
15148
15163
  var gridOptions = _a.gridOptions;
15164
+ /** Use processPivotResultColDef from ver 28 */
15149
15165
  gridOptions.processSecondaryColDef = function (colDef) {
15150
15166
  var userProvidedColDef = colDef.pivotValueColumn && colDef.pivotValueColumn.getUserProvidedColDef();
15151
15167
  if (userProvidedColDef) {
@@ -15158,6 +15174,7 @@
15158
15174
  });
15159
15175
  }
15160
15176
  };
15177
+ /** Use processPivotResultColGroupDe from ver 28 */
15161
15178
  gridOptions.processSecondaryColGroupDef = function (colGroupDef) {
15162
15179
  if (colGroupDef.headerName) {
15163
15180
  var parsedValue = tryParsePivotValue(colGroupDef.headerName);
@@ -15662,7 +15679,7 @@
15662
15679
  });
15663
15680
  DatoGridControllerComponent.prototype.ngOnDestroy = function () {
15664
15681
  this.contentInit.complete();
15665
- this.tooltip && this.clearTooltip();
15682
+ this.clearTooltip();
15666
15683
  this.rowHoverComponent && this.rowHoverComponent.destroy();
15667
15684
  this.rowHoverComponent = null;
15668
15685
  };
@@ -15889,40 +15906,51 @@
15889
15906
  });
15890
15907
  this.addOnHoverElement();
15891
15908
  }
15892
- agGrid.cellMouseOver
15893
- .pipe(operators.filter(function (_a) {
15894
- var node = _a.node, column = _a.column;
15895
- return lastHoveredCell !== node.id + "-" + column.getColId();
15896
- }), ngxTakeUntilDestroy.untilDestroyed(this))
15897
- .subscribe(function (event) {
15898
- lastHoveredCell = event.node.id + "-" + event.column.getColId();
15909
+ agGrid.cellMouseOver.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (event) {
15910
+ var node = event.node, column = event.column;
15911
+ if (lastHoveredCell === node.id + "-" + column.getColId()) {
15912
+ clearTimeout(_this.cellMouseOutTimer);
15913
+ return;
15914
+ }
15915
+ lastHoveredCell = node.id + "-" + column.getColId();
15899
15916
  _this.showTooltip(event);
15900
15917
  var row = event.event.target.parentElement;
15901
- if (onHoverEnabled && (event.node.group === false || isNil(event.node.group)) && _this.lastHoveredRow !== row) {
15918
+ if (onHoverEnabled && (node.group === false || isNil(node.group)) && _this.lastHoveredRow !== row) {
15902
15919
  var previousNode = _this.lastHoveredRow;
15903
15920
  _this.lastHoveredRow = row;
15904
15921
  _this.toggleRowHoverClass([previousNode, _this.lastHoveredRow]);
15905
15922
  _this.setOnHoverState(true, event);
15906
15923
  }
15907
15924
  });
15908
- var onTooltipOut = rxjs.merge(rxjs.fromEvent(bodyViewport, 'scroll'), rxjs.fromEvent(this.agGridEl, 'mouseleave'), agGrid.cellMouseOut);
15909
- onTooltipOut
15925
+ var onTooltipOut = rxjs.merge(rxjs.fromEvent(bodyViewport, 'scroll'), rxjs.fromEvent(this.agGridEl, 'mouseleave'));
15926
+ onTooltipOut.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function () {
15927
+ lastHoveredCell = null;
15928
+ _this.clearTooltip();
15929
+ });
15930
+ agGrid.cellMouseOut
15910
15931
  .pipe(operators.filter(function () { return !isNil(_this.tooltip); }), ngxTakeUntilDestroy.untilDestroyed(this))
15911
15932
  .subscribe(function () {
15912
- _this.clearTooltip();
15933
+ _this.cellMouseOutTimer = window.setTimeout(function () { return _this.clearTooltip(); });
15913
15934
  });
15914
15935
  };
15915
15936
  /**
15916
15937
  * Dispose the tooltip
15917
15938
  */
15918
15939
  DatoGridControllerComponent.prototype.clearTooltip = function () {
15919
- this.tooltip.dispose();
15940
+ this.tooltip && this.tooltip.dispose();
15920
15941
  this.tooltip = null;
15921
15942
  };
15922
15943
  DatoGridControllerComponent.prototype.showTooltip = function (event) {
15923
15944
  var cell = event.event.target;
15945
+ if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
15946
+ cell = cell.parentElement;
15947
+ }
15948
+ if (event.colDef.editable) {
15949
+ cell = cell.querySelector('.value-wrapper') || cell;
15950
+ }
15924
15951
  var textOverflow = cell.offsetWidth < cell.scrollWidth;
15925
15952
  if (textOverflow) {
15953
+ clearTimeout(this.cellMouseOutTimer);
15926
15954
  var params = { cell: cell, value: cell.innerText };
15927
15955
  isNil(this.tooltip) ? this.createAndShowTooltip(params) : this.updateTooltip(params);
15928
15956
  }
@@ -25573,7 +25601,7 @@
25573
25601
  };
25574
25602
  }
25575
25603
 
25576
- window.coreVersion = '22.11.0';
25604
+ window.coreVersion = '22.11.1';
25577
25605
 
25578
25606
  exports.APP_TRANSLATE = APP_TRANSLATE;
25579
25607
  exports.AceService = AceService;