@datorama/core 22.9.9-rc.3 → 22.9.10

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
@@ -4870,13 +4870,13 @@ dato-button button[disabled] {
4870
4870
  Secondary
4871
4871
  */
4872
4872
  dato-button[datoType='secondary'] button {
4873
- background-color: themify(primary-300, 0.15);
4874
- color: themify(primary-400);
4873
+ background-color: themify(primary-100);
4874
+ color: themify(primary-600);
4875
4875
  }
4876
4876
 
4877
4877
  dato-button[datoType='secondary'] button:hover {
4878
- background-color: themify(primary-300, 0.25);
4879
- color: themify(primary-500);
4878
+ background-color: themify(primary-200);
4879
+ color: themify(primary-600);
4880
4880
  }
4881
4881
 
4882
4882
  dato-button[datoType='secondary'] dato-icon svg {
@@ -4884,8 +4884,8 @@ dato-button[datoType='secondary'] dato-icon svg {
4884
4884
  }
4885
4885
 
4886
4886
  dato-button[datoType='secondary'] button:active {
4887
- background-color: themify(primary-300, 0.35);
4888
- color: themify(primary-600);
4887
+ background-color: themify(primary-300);
4888
+ color: themify(primary-700);
4889
4889
  }
4890
4890
 
4891
4891
  /**
@@ -12087,6 +12087,14 @@
12087
12087
  GridRowSelectionType["MULTIPLE"] = "multiple";
12088
12088
  })(exports.GridRowSelectionType || (exports.GridRowSelectionType = {}));
12089
12089
 
12090
+ (function (GridStatusColumnTypes) {
12091
+ GridStatusColumnTypes["SUCCESS"] = "SUCCESS";
12092
+ GridStatusColumnTypes["FAILURE"] = "FAILURE";
12093
+ GridStatusColumnTypes["IN_PROGRESS"] = "IN_PROGRESS";
12094
+ GridStatusColumnTypes["PENDING"] = "PENDING";
12095
+ GridStatusColumnTypes["WAITING"] = "WAITING";
12096
+ })(exports.GridStatusColumnTypes || (exports.GridStatusColumnTypes = {}));
12097
+
12090
12098
  /**
12091
12099
  * @license
12092
12100
  * Copyright Datorama. All Rights Reserved.
@@ -15623,7 +15631,7 @@
15623
15631
  });
15624
15632
  DatoGridControllerComponent.prototype.ngOnDestroy = function () {
15625
15633
  this.contentInit.complete();
15626
- this.tooltip && this.clearTooltip();
15634
+ this.clearTooltip();
15627
15635
  this.rowHoverComponent && this.rowHoverComponent.destroy();
15628
15636
  this.rowHoverComponent = null;
15629
15637
  };
@@ -15853,40 +15861,51 @@
15853
15861
  });
15854
15862
  this.addOnHoverElement();
15855
15863
  }
15856
- agGrid.cellMouseOver
15857
- .pipe(operators.filter(function (_a) {
15858
- var node = _a.node, column = _a.column;
15859
- return lastHoveredCell !== node.id + "-" + column.getColId();
15860
- }), ngxTakeUntilDestroy.untilDestroyed(this))
15861
- .subscribe(function (event) {
15862
- lastHoveredCell = event.node.id + "-" + event.column.getColId();
15864
+ agGrid.cellMouseOver.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (event) {
15865
+ var node = event.node, column = event.column;
15866
+ if (lastHoveredCell === node.id + "-" + column.getColId()) {
15867
+ clearTimeout(_this.cellMouseOutTimer);
15868
+ return;
15869
+ }
15870
+ lastHoveredCell = node.id + "-" + column.getColId();
15863
15871
  _this.showTooltip(event);
15864
15872
  var row = event.event.target.parentElement;
15865
- if (onHoverEnabled && (event.node.group === false || isNil(event.node.group)) && _this.lastHoveredRow !== row) {
15873
+ if (onHoverEnabled && (node.group === false || isNil(node.group)) && _this.lastHoveredRow !== row) {
15866
15874
  var previousNode = _this.lastHoveredRow;
15867
15875
  _this.lastHoveredRow = row;
15868
15876
  _this.toggleRowHoverClass([previousNode, _this.lastHoveredRow]);
15869
15877
  _this.setOnHoverState(true, event);
15870
15878
  }
15871
15879
  });
15872
- var onTooltipOut = rxjs.merge(rxjs.fromEvent(bodyViewport, 'scroll'), rxjs.fromEvent(this.agGridEl, 'mouseleave'), agGrid.cellMouseOut);
15873
- onTooltipOut
15880
+ var onTooltipOut = rxjs.merge(rxjs.fromEvent(bodyViewport, 'scroll'), rxjs.fromEvent(this.agGridEl, 'mouseleave'));
15881
+ onTooltipOut.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function () {
15882
+ lastHoveredCell = null;
15883
+ _this.clearTooltip();
15884
+ });
15885
+ agGrid.cellMouseOut
15874
15886
  .pipe(operators.filter(function () { return !isNil(_this.tooltip); }), ngxTakeUntilDestroy.untilDestroyed(this))
15875
15887
  .subscribe(function () {
15876
- _this.clearTooltip();
15888
+ _this.cellMouseOutTimer = window.setTimeout(function () { return _this.clearTooltip(); });
15877
15889
  });
15878
15890
  };
15879
15891
  /**
15880
15892
  * Dispose the tooltip
15881
15893
  */
15882
15894
  DatoGridControllerComponent.prototype.clearTooltip = function () {
15883
- this.tooltip.dispose();
15895
+ this.tooltip && this.tooltip.dispose();
15884
15896
  this.tooltip = null;
15885
15897
  };
15886
15898
  DatoGridControllerComponent.prototype.showTooltip = function (event) {
15887
15899
  var cell = event.event.target;
15900
+ if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
15901
+ cell = cell.parentElement;
15902
+ }
15903
+ if (event.colDef.editable) {
15904
+ cell = cell.querySelector('.value-wrapper') || cell;
15905
+ }
15888
15906
  var textOverflow = cell.offsetWidth < cell.scrollWidth;
15889
15907
  if (textOverflow) {
15908
+ clearTimeout(this.cellMouseOutTimer);
15890
15909
  var params = { cell: cell, value: cell.innerText };
15891
15910
  isNil(this.tooltip) ? this.createAndShowTooltip(params) : this.updateTooltip(params);
15892
15911
  }
@@ -20547,7 +20566,15 @@
20547
20566
 
20548
20567
  var DatoGridStatusCellComponent = /** @class */ (function () {
20549
20568
  function DatoGridStatusCellComponent(cdr) {
20569
+ var _a;
20550
20570
  this.cdr = cdr;
20571
+ this.defaultConfigByStatus = (_a = {},
20572
+ _a[exports.GridStatusColumnTypes.SUCCESS] = { icon: 'success-line', iconCssClass: 'green-400-color' },
20573
+ _a[exports.GridStatusColumnTypes.FAILURE] = { icon: 'failed-line', iconCssClass: 'red-400-color' },
20574
+ _a[exports.GridStatusColumnTypes.PENDING] = { icon: 'time', iconCssClass: 'yellow-400-color' },
20575
+ _a[exports.GridStatusColumnTypes.WAITING] = { icon: 'info-line', iconCssClass: 'orange-400-color' },
20576
+ _a[exports.GridStatusColumnTypes.IN_PROGRESS] = { showSpinner: true },
20577
+ _a);
20551
20578
  }
20552
20579
  DatoGridStatusCellComponent.prototype.agInit = function (params) {
20553
20580
  var value = params.value, valueFormatted = params.valueFormatted, node = params.node;
@@ -20562,13 +20589,14 @@
20562
20589
  var mainCustomCellConfig = customCellConfig || {};
20563
20590
  var valueCustomCellConfig = valueToCustomCellConfig ? valueToCustomCellConfig[params.value] || {} : {};
20564
20591
  var config = __assign(__assign({}, mainCustomCellConfig), valueCustomCellConfig);
20565
- var textCssClass = config.textCssClass, icon = config.icon, iconCssClass = config.iconCssClass, showSpinner = config.showSpinner, getAdditionalText = config.getAdditionalText, additionalTextCssClass = config.additionalTextCssClass, getIsVisible = config.getIsVisible;
20592
+ var textCssClass = config.textCssClass, icon = config.icon, iconCssClass = config.iconCssClass, showSpinner = config.showSpinner, getAdditionalText = config.getAdditionalText, additionalTextCssClass = config.additionalTextCssClass, getIsVisible = config.getIsVisible, status = config.status;
20593
+ var defaultConfig = this.defaultConfigByStatus[status] || {};
20566
20594
  this.isVisible = !getIsVisible || getIsVisible(params.data);
20567
- this.icon = icon;
20568
- this.iconCssClass = iconCssClass || '';
20595
+ this.icon = icon || defaultConfig.icon;
20596
+ this.iconCssClass = iconCssClass || defaultConfig.iconCssClass || '';
20569
20597
  this.textCssClass = textCssClass || '';
20570
20598
  this.additionalTextCssClass = additionalTextCssClass || '';
20571
- this.showSpinner = showSpinner;
20599
+ this.showSpinner = !!showSpinner || !!defaultConfig.showSpinner;
20572
20600
  this.additionalText = getAdditionalText ? getAdditionalText(params.data) : null;
20573
20601
  };
20574
20602
  DatoGridStatusCellComponent.prototype.refresh = function (params) {