@refinitiv-ui/efx-grid 6.0.42 → 6.0.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. package/lib/column-format-dialog/lib/column-format-dialog.d.ts +1 -0
  2. package/lib/column-format-dialog/lib/column-format-dialog.js +3 -24
  3. package/lib/column-format-dialog/lib/preview-table.d.ts +1 -1
  4. package/lib/column-format-dialog/lib/preview-table.js +15 -27
  5. package/lib/core/dist/core.js +7 -1
  6. package/lib/core/dist/core.min.js +1 -1
  7. package/lib/core/es6/grid/Core.js +1 -1
  8. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +6 -0
  9. package/lib/formatters/es6/CoralButtonFormatter.d.ts +2 -2
  10. package/lib/formatters/es6/CoralCheckboxFormatter.d.ts +1 -1
  11. package/lib/formatters/es6/CoralComboBoxFormatter.d.ts +4 -4
  12. package/lib/formatters/es6/CoralIconFormatter.d.ts +3 -3
  13. package/lib/formatters/es6/CoralInputFormatter.d.ts +1 -1
  14. package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +2 -2
  15. package/lib/formatters/es6/CoralSelectFormatter.d.ts +4 -4
  16. package/lib/formatters/es6/CoralToggleFormatter.d.ts +1 -1
  17. package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +1 -1
  18. package/lib/formatters/es6/EFButtonFormatter.d.ts +2 -2
  19. package/lib/formatters/es6/EFCheckboxFormatter.d.ts +1 -1
  20. package/lib/formatters/es6/EFComboBoxFormatter.d.ts +4 -4
  21. package/lib/formatters/es6/EFDateTimePickerFormatter.d.ts +1 -1
  22. package/lib/formatters/es6/EFIconFormatter.d.ts +3 -3
  23. package/lib/formatters/es6/EFNumberFieldFormatter.d.ts +1 -1
  24. package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +2 -2
  25. package/lib/formatters/es6/EFSelectFormatter.d.ts +4 -4
  26. package/lib/formatters/es6/EFTextFieldFormatter.d.ts +1 -1
  27. package/lib/formatters/es6/EFToggleFormatter.d.ts +1 -1
  28. package/lib/formatters/es6/EmeraldDateTimePickerFormatter.d.ts +1 -1
  29. package/lib/formatters/es6/FormatterBuilder.d.ts +6 -2
  30. package/lib/formatters/es6/FormatterBuilder.js +328 -178
  31. package/lib/formatters/es6/NumericInputFormatter.d.ts +1 -1
  32. package/lib/formatters/es6/PercentBarFormatter.d.ts +6 -6
  33. package/lib/formatters/es6/SimpleImageFormatter.d.ts +3 -3
  34. package/lib/formatters/es6/SimpleInputFormatter.d.ts +1 -1
  35. package/lib/formatters/es6/SimpleLinkFormatter.d.ts +3 -3
  36. package/lib/formatters/es6/SimpleTickerFormatter.d.ts +3 -3
  37. package/lib/formatters/es6/SimpleToggleFormatter.d.ts +3 -3
  38. package/lib/formatters/es6/TextFormatter.d.ts +1 -1
  39. package/lib/grid/index.js +1 -1
  40. package/lib/rt-grid/dist/rt-grid.js +1 -0
  41. package/lib/rt-grid/es6/Grid.d.ts +2 -1
  42. package/lib/rt-grid/es6/Grid.js +1 -0
  43. package/lib/tr-grid-column-stack/es6/ColumnStack.js +35 -25
  44. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +17 -17
  45. package/lib/tr-grid-filter-input/es6/FilterInput.js +146 -33
  46. package/lib/types/es6/CoralButtonFormatter.d.ts +2 -2
  47. package/lib/types/es6/CoralCheckboxFormatter.d.ts +1 -1
  48. package/lib/types/es6/CoralComboBoxFormatter.d.ts +4 -4
  49. package/lib/types/es6/CoralIconFormatter.d.ts +3 -3
  50. package/lib/types/es6/CoralInputFormatter.d.ts +1 -1
  51. package/lib/types/es6/CoralRadioButtonFormatter.d.ts +2 -2
  52. package/lib/types/es6/CoralSelectFormatter.d.ts +4 -4
  53. package/lib/types/es6/CoralToggleFormatter.d.ts +1 -1
  54. package/lib/types/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +1 -1
  55. package/lib/types/es6/EFButtonFormatter.d.ts +2 -2
  56. package/lib/types/es6/EFCheckboxFormatter.d.ts +1 -1
  57. package/lib/types/es6/EFComboBoxFormatter.d.ts +4 -4
  58. package/lib/types/es6/EFDateTimePickerFormatter.d.ts +1 -1
  59. package/lib/types/es6/EFIconFormatter.d.ts +3 -3
  60. package/lib/types/es6/EFNumberFieldFormatter.d.ts +1 -1
  61. package/lib/types/es6/EFRadioButtonFormatter.d.ts +2 -2
  62. package/lib/types/es6/EFSelectFormatter.d.ts +4 -4
  63. package/lib/types/es6/EFTextFieldFormatter.d.ts +1 -1
  64. package/lib/types/es6/EFToggleFormatter.d.ts +1 -1
  65. package/lib/types/es6/EmeraldDateTimePickerFormatter.d.ts +1 -1
  66. package/lib/types/es6/FilterInput.d.ts +17 -17
  67. package/lib/types/es6/FormatterBuilder.d.ts +6 -2
  68. package/lib/types/es6/NumericInputFormatter.d.ts +1 -1
  69. package/lib/types/es6/PercentBarFormatter.d.ts +6 -6
  70. package/lib/types/es6/RealtimeGrid/Grid.d.ts +22 -0
  71. package/lib/types/es6/SimpleImageFormatter.d.ts +3 -3
  72. package/lib/types/es6/SimpleInputFormatter.d.ts +1 -1
  73. package/lib/types/es6/SimpleLinkFormatter.d.ts +3 -3
  74. package/lib/types/es6/SimpleTickerFormatter.d.ts +3 -3
  75. package/lib/types/es6/SimpleToggleFormatter.d.ts +3 -3
  76. package/lib/types/es6/TextFormatter.d.ts +1 -1
  77. package/lib/versions.json +4 -4
  78. package/package.json +1 -1
@@ -20,6 +20,7 @@ import "@refinitiv-ui/elements/item";
20
20
  import "@refinitiv-ui/elements/color-dialog";
21
21
  import ElfUtil from "../../tr-grid-util/es6/ElfUtil.js";
22
22
  import { DATE_TIME, toDateTimeType } from "../../tr-grid-util/es6/FieldFormatter.js";
23
+ import ExpressionParser from "../../tr-grid-util/es6/ExpressionParser.js";
23
24
  import translation from "./locale/translation.js";
24
25
  import { PercentBar } from "../../tr-grid-util/es6/PercentBar.js";
25
26
  import ElementObserver from "../../tr-grid-util/es6/ElementObserver.js";
@@ -20,6 +20,7 @@ import "@refinitiv-ui/elements/item";
20
20
  import "@refinitiv-ui/elements/color-dialog";
21
21
  import ElfUtil from "../../tr-grid-util/es6/ElfUtil.js";
22
22
  import { DATE_TIME, toDateTimeType } from "../../tr-grid-util/es6/FieldFormatter.js";
23
+ import ExpressionParser from "../../tr-grid-util/es6/ExpressionParser.js";
23
24
  import translation from "./locale/translation.js";
24
25
  import { PercentBar } from "../../tr-grid-util/es6/PercentBar.js";
25
26
  import ElementObserver from "../../tr-grid-util/es6/ElementObserver.js";
@@ -1640,7 +1641,7 @@ class ColumnFormatDialog extends BasicElement {
1640
1641
  color: e.color,
1641
1642
  backgroundColor: e.backgroundColor
1642
1643
  };
1643
- e.conditionSequence = this._parseRowCondition(e.expression.text);
1644
+ e.conditionSequence = ExpressionParser.parse(e.expression.text);
1644
1645
  e.expressionObject = e.expression;
1645
1646
  return e;
1646
1647
  });
@@ -1651,28 +1652,6 @@ class ColumnFormatDialog extends BasicElement {
1651
1652
  }
1652
1653
  }
1653
1654
 
1654
- /**
1655
- * @private
1656
- * @param {string} expression - expression string
1657
- * @return {Function} - condition function
1658
- */
1659
- _parseRowCondition(expression) {
1660
- if (!expression) {
1661
- return null;
1662
- }
1663
-
1664
- var regEx = new RegExp(/\[[^[]*\]/g); // Regex for matching the field token E.g. "[CF_BID]"
1665
- expression = expression.replace(regEx, "value");
1666
- var finalExp = "(function(value) { return " + expression + "; })";
1667
-
1668
- var fn = null;
1669
- try {
1670
- // TODO: find a better way to avoid using eval
1671
- fn = eval(finalExp); // eslint-disable-line
1672
- } catch (err) { }
1673
- return fn;
1674
- }
1675
-
1676
1655
  /**
1677
1656
  * @private
1678
1657
  * @param {Object} item - condition item
@@ -2179,7 +2158,7 @@ class ColumnFormatDialog extends BasicElement {
2179
2158
  _setConditionalColor() {
2180
2159
  var conditionFunctions = this.conditions.map(e => {
2181
2160
  return {
2182
- conditionSequence: this._parseRowCondition(e.expression.text),
2161
+ conditionSequence: ExpressionParser.parse(e.expression.text),
2183
2162
  colors: {
2184
2163
  color: e.color,
2185
2164
  backgroundColor: e.backgroundColor
@@ -123,7 +123,7 @@ declare class PreviewTable extends ElementWrapper {
123
123
 
124
124
  public setDisplayStylePercentBarIsUsedMovement(isUsedMovement: boolean): void;
125
125
 
126
- public setDisplayStyleConditional(condition: PreviewTable.Conditional|null): void;
126
+ public setDisplayStyleConditional(conditionDefs: (PreviewTable.Conditional)[]|null): void;
127
127
 
128
128
  public setFormatType(type: string): void;
129
129
 
@@ -175,7 +175,7 @@ var PreviewTable = function (elem) {
175
175
 
176
176
  this._numberFormatter = new NumberFormatter();
177
177
 
178
- ElfUtil.getThemeColors().then(this._onThemeLoaded).catch(this._onThemeLoaded);
178
+ ElfUtil.getThemeColors().then(this._onThemeLoaded);
179
179
  setInterval(this._onIntervalUpdate, 1500);
180
180
 
181
181
  this._formatSampleValue();
@@ -344,26 +344,12 @@ PreviewTable.prototype.setDisplayStylePercentBarIsUsedMovement = function (isUse
344
344
  };
345
345
 
346
346
  /** @public
347
- * @param {PreviewTable~Conditional} condition - condition function
347
+ * @param {Array.<PreviewTable~Conditional>} conditionDefs - condition function
348
348
  */
349
- PreviewTable.prototype.setDisplayStyleConditional = function (condition) {
350
- var isEmpty = true;
351
-
352
- // Loop for check empty object
353
- for (var key in condition) {
354
- if (Object.hasOwnProperty.call(condition, key)) {
355
- isEmpty = false;
356
- }
357
- }
358
- if(!isEmpty) {
359
- this._configDisplayStyle.conditionFunction = condition;
360
- this._formatSampleValue();
361
- } else {
362
- // Set conditional false when object empty
363
- this._configDisplayStyle.conditionFunction = false;
364
- this._formatSampleValue();
365
- }
366
-
349
+ PreviewTable.prototype.setDisplayStyleConditional = function (conditionDefs) {
350
+ var count = conditionDefs ? conditionDefs.length : 0;
351
+ this._configDisplayStyle.conditionFunction = count ? conditionDefs : null;
352
+ this._formatSampleValue();
367
353
  };
368
354
 
369
355
 
@@ -831,14 +817,15 @@ PreviewTable.prototype._getSampleStyleObjects = function (blinking) {
831
817
  // conditional color section
832
818
  if (this._configDisplayStyle.mode === "conditionalColor") {
833
819
  if (this._configDisplayStyle.conditionFunction) {
820
+ var valObj = {"value": NaN};
834
821
  for (r = 0; r < rc; ++r) {
835
822
  for (c = 0; c < cc; ++c) {
836
823
  for (var i = 0; i < this._configDisplayStyle.conditionFunction.length; i++) {
837
824
  obj = objs[r][c];
838
- val = curDataset[r][c];
825
+ valObj["value"] = curDataset[r][c];
839
826
  var ret = null;
840
827
  try {
841
- ret = this._configDisplayStyle.conditionFunction[i].conditionSequence(val); // check value with function pass from another module
828
+ ret = this._configDisplayStyle.conditionFunction[i].conditionSequence(valObj); // check value with function pass from another module
842
829
  } catch (error) { } // do nothing
843
830
  if (ret) {
844
831
  obj.color = this._configDisplayStyle.conditionFunction[i].colors.color;
@@ -878,15 +865,15 @@ PreviewTable.prototype._getSampleStyleObjects = function (blinking) {
878
865
  var prevVal = prevDataset[r][c];
879
866
  var blinkColor = "";
880
867
  if (curVal >= prevVal) {
881
- blinkColor = this._configUpdateStyleValue.colors ? this._configUpdateStyleValue.colors.tickUp : "var(--color-scheme-tickup)";
868
+ blinkColor = this._colors ? this._colors.tickUp : "var(--color-scheme-tickup)";
882
869
  } else {
883
- blinkColor = this._configUpdateStyleValue.colors ? this._configUpdateStyleValue.colors.tickDown : "var(--color-scheme-tickdown)";
870
+ blinkColor = this._colors ? this._colors.tickDown : "var(--color-scheme-tickdown)";
884
871
  }
885
872
 
886
873
  // Blink border or background when value change
887
874
  if (this._configUpdateStyleValue.isBackgroundBlink) {
888
875
  obj.backgroundColor = blinkColor;
889
- obj.color = this._configUpdateStyleValue.colors ? CellPainter.getOppositeColor(blinkColor) : "";
876
+ obj.color = this._colors ? CellPainter.getOppositeColor(blinkColor) : "";
890
877
  } else {
891
878
  obj.borderColor = blinkColor;
892
879
  }
@@ -985,9 +972,10 @@ PreviewTable.prototype._updateValueFormatExample = function (val) {
985
972
 
986
973
  /**
987
974
  * @private
975
+ * @param {Object} colors
988
976
  */
989
- PreviewTable.prototype._onThemeLoaded = function () {
990
- this._configUpdateStyleValue.colors = ElfUtil.getColors();
977
+ PreviewTable.prototype._onThemeLoaded = function (colors) {
978
+ this._colors = colors;
991
979
  };
992
980
 
993
981
  export default PreviewTable;
@@ -25826,7 +25826,7 @@ Core_Core.prototype._batches = null;
25826
25826
  * @return {string}
25827
25827
  */
25828
25828
  Core_Core.getVersion = function () {
25829
- return "5.1.63";
25829
+ return "5.1.64";
25830
25830
  };
25831
25831
  /** {@link ElementWrapper#dispose}
25832
25832
  * @override
@@ -33013,6 +33013,12 @@ SortableTitlePlugin.prototype._isCellSortable = function (section, colIndex, row
33013
33013
  if (targetCell !== bottomCell) {
33014
33014
  return false;
33015
33015
  }
33016
+ var parentCell = targetCell.getParent();
33017
+ var classList = parentCell["classList"];
33018
+ // "collapsed" class in column element only enable by column stack in spreading mode
33019
+ if (classList.contains("collapsed")) { // HACK: unsortable for collapsed stack in spreading mode
33020
+ return false;
33021
+ }
33016
33022
 
33017
33023
  return true; // By default all cells are sortable
33018
33024
  };