@refinitiv-ui/efx-grid 6.0.87 → 6.0.89

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.
Files changed (37) hide show
  1. package/lib/column-dragging/es6/ColumnDragging.js +55 -0
  2. package/lib/core/dist/core.js +2 -2
  3. package/lib/core/dist/core.min.js +1 -1
  4. package/lib/core/es6/grid/Core.d.ts +0 -2
  5. package/lib/core/es6/grid/Core.js +2 -2
  6. package/lib/grid/index.js +1 -1
  7. package/lib/row-segmenting/es6/RowSegmenting.js +1 -1
  8. package/lib/rt-grid/dist/rt-grid.js +786 -706
  9. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  10. package/lib/rt-grid/es6/ColumnDefinition.js +68 -68
  11. package/lib/rt-grid/es6/DataConnector.js +26 -26
  12. package/lib/rt-grid/es6/FieldDefinition.js +27 -27
  13. package/lib/rt-grid/es6/Grid.js +390 -378
  14. package/lib/rt-grid/es6/PredefinedFormula.js +1 -1
  15. package/lib/rt-grid/es6/ReferenceCounter.js +15 -15
  16. package/lib/rt-grid/es6/RowDefSorter.js +26 -26
  17. package/lib/rt-grid/es6/RowDefinition.d.ts +5 -6
  18. package/lib/rt-grid/es6/RowDefinition.js +105 -76
  19. package/lib/rt-grid/es6/SnapshotFiller.js +77 -77
  20. package/lib/rt-grid/es6/StyleLoader.js +1 -1
  21. package/lib/statistics-row/es6/StatisticsRow.d.ts +1 -0
  22. package/lib/statistics-row/es6/StatisticsRow.js +18 -2
  23. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +0 -4
  24. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +2 -2
  25. package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +18 -18
  26. package/lib/tr-grid-percent-bar/es6/PercentBar.js +7 -1
  27. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
  28. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +69 -18
  29. package/lib/tr-grid-titlewrap/es6/TitleWrap.d.ts +0 -2
  30. package/lib/tr-grid-titlewrap/es6/TitleWrap.js +1 -1
  31. package/lib/tr-grid-util/es6/DragUI.js +2 -1
  32. package/lib/types/es6/PercentBar.d.ts +18 -18
  33. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +5 -2
  34. package/lib/types/es6/RowFiltering.d.ts +2 -0
  35. package/lib/types/es6/StatisticsRow.d.ts +1 -0
  36. package/lib/versions.json +10 -10
  37. package/package.json +1 -1
@@ -79,8 +79,8 @@ The expression can take various forms:<br>
79
79
 
80
80
  /** @typedef {Object} RowFilteringPlugin~FilterDialogOptions
81
81
  * @description Options that specify UIs of filter dialog
82
- * @property {boolean=} sortUI show/hide sort UI
83
- * @property {boolean=} filterUI show/hide filter UI
82
+ * @property {boolean=} sortUI=true show/hide sort UI
83
+ * @property {boolean=} filterUI=true show/hide filter UI
84
84
  * @property {string=} fieldDataType data type of column
85
85
  * @property {string=} lang dialog language
86
86
  * @property {Function=} rawDataAccessor In case you have custom data type for the specified field, data getter is needed to retrieve raw value for filtering
@@ -112,7 +112,7 @@ The expression can take various forms:<br>
112
112
  * @param {Object} cfo
113
113
  * @return {!RowFilteringPlugin~FilterExpression}
114
114
  */
115
- var toFilterExpression = function toFilterExpression(cfo) {
115
+ var _toFilterExpression = function _toFilterExpression(cfo) {
116
116
  var ctx = cfo._context[0];
117
117
  // TODO: Handle rawDataAccessor and formattedDataAccessor (saving and loading of functions)
118
118
  return {
@@ -121,6 +121,22 @@ var toFilterExpression = function toFilterExpression(cfo) {
121
121
  context: ctx != null && !ctx._autoGenerated ? ctx : null
122
122
  };
123
123
  };
124
+ /** @private
125
+ * @function
126
+ * @param {Array} ary
127
+ * @param {*} val
128
+ * @return {Array}
129
+ */
130
+ var _arrayConcat = function _arrayConcat(ary, val) {
131
+ if (Array.isArray(val) && val.length) {
132
+ if (ary) {
133
+ return ary.concat(val);
134
+ } else {
135
+ return val;
136
+ }
137
+ }
138
+ return ary;
139
+ };
124
140
 
125
141
  /** @type {string}
126
142
  * @private
@@ -405,7 +421,7 @@ RowFilteringPlugin.prototype.config = function (options) {
405
421
  return;
406
422
  }
407
423
 
408
- // var host = this._hosts[0];
424
+ // let host = this._hosts[0];
409
425
  var len = columns.length;
410
426
  for (var i = 0; i < len; ++i) {
411
427
  var column = columns[i];
@@ -456,6 +472,10 @@ RowFilteringPlugin.prototype.getConfigObject = function (gridOptions) {
456
472
  column.filterState = ctx;
457
473
  }
458
474
  }
475
+ var filterIcon = colSettings.filterIcon;
476
+ if (!filterIcon) {
477
+ column.filterIcon = false;
478
+ }
459
479
  }
460
480
  var extOptions = obj.rowFiltering;
461
481
  var dirty = false;
@@ -705,14 +725,14 @@ RowFilteringPlugin.prototype.getColumnFilterExpression = function (colIndex) {
705
725
  * @param {RowFilteringPlugin~ColumnOptions} userObj
706
726
  * @returns {boolean} Returns true if there is an active filter in the column options
707
727
  * @example
708
- * var colDef1 = {
728
+ * let colDef1 = {
709
729
  * "field": "PCTCHNG",
710
730
  * "filter": [["GT", 0]]
711
731
  * };
712
- * var colDef2 = {
732
+ * let colDef2 = {
713
733
  * "filter": "[PCTCHNG] > 0"
714
734
  * };
715
- * var colDef3 = {
735
+ * let colDef3 = {
716
736
  * "filter": function(rowData) {
717
737
  * return rowData["PCTCHNG"] > 0;
718
738
  * }
@@ -983,7 +1003,7 @@ RowFilteringPlugin.prototype.getAllColumnFilters = function () {
983
1003
  RowFilteringPlugin.prototype.getFilterExpressions = function () {
984
1004
  if (this._columnFilters.length) {
985
1005
  // TODO: Provide a way to save rawDataAccessor and formattedDataAccessor
986
- return this._columnFilters.map(toFilterExpression);
1006
+ return this._columnFilters.map(_toFilterExpression);
987
1007
  }
988
1008
  return null;
989
1009
  };
@@ -1216,7 +1236,7 @@ RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
1216
1236
  var noFilterIcon = this._disabled || iconActivation === "none" || onActiveFilter && !hasFilter;
1217
1237
  if (!noFilterIcon) {
1218
1238
  if (!cell._filterIcon) {
1219
- var filterIcon;
1239
+ var filterIcon = void 0;
1220
1240
  if (ElfUtil.hasComponent("ef-icon") >= 3) {
1221
1241
  filterIcon = document.createElement("ef-icon");
1222
1242
  filterIcon.setAttribute("icon", "filter");
@@ -1483,14 +1503,7 @@ RowFilteringPlugin.prototype._getUniqueValues = function (field, dialogConfig, f
1483
1503
  }
1484
1504
  }
1485
1505
  }
1486
- var additionalItems = dialogConfig.additionalItems;
1487
- if (Array.isArray(additionalItems)) {
1488
- if (userItemList) {
1489
- userItemList = userItemList.concat(additionalItems);
1490
- } else {
1491
- userItemList = additionalItems;
1492
- }
1493
- }
1506
+ userItemList = _arrayConcat(userItemList, dialogConfig.additionalItems);
1494
1507
  var dummyRow = {};
1495
1508
  var userItemCount = userItemList ? userItemList.length : 0;
1496
1509
  for (var i = 0; i < userItemCount; ++i) {
@@ -1699,6 +1712,9 @@ RowFilteringPlugin.prototype.openDialog = function (colIndex, runtimeDialogOptio
1699
1712
  if (cfo._filters && cfo._filters.length) {
1700
1713
  filterFuncs = cfo._filters;
1701
1714
  }
1715
+ if (_typeof(exp) === "object") {
1716
+ dialogConfig.additionalItems = _arrayConcat(dialogConfig.additionalItems, Object.keys(exp));
1717
+ }
1702
1718
  }
1703
1719
  }
1704
1720
  var selectedItems = {};
@@ -1847,6 +1863,27 @@ RowFilteringPlugin._getFilterBuilder = function () {
1847
1863
  return RowFilteringPlugin._filterBuilder;
1848
1864
  };
1849
1865
 
1866
+ /** @public
1867
+ * @ignore
1868
+ * @param {*} val
1869
+ */
1870
+ RowFilteringPlugin.prototype.mockDialogFilterChange = function (val) {
1871
+ if (this._filterDialog) {
1872
+ var arg = {
1873
+ detail: {}
1874
+ };
1875
+ if (Array.isArray(val)) {
1876
+ if (Array.isArray(val[0])) {
1877
+ arg.detail.conditions = val;
1878
+ } else {
1879
+ arg.detail.value = val;
1880
+ }
1881
+ } else {
1882
+ arg.detail.value = val;
1883
+ }
1884
+ this._onDialogFilterChanged(arg);
1885
+ }
1886
+ };
1850
1887
  /** @private
1851
1888
  * @param {Object} e
1852
1889
  */
@@ -1916,7 +1953,7 @@ RowFilteringPlugin.prototype._onDialogFilterChanged = function (e) {
1916
1953
  var atLeastOne = false;
1917
1954
  for (var i = 0; i < selCount; ++i) {
1918
1955
  var formattedVal = selAry[i].title; // title is defined by the multi-select element
1919
- // var selIdx = selAry[i].index; // index cannot be used due to filtering
1956
+ // let selIdx = selAry[i].index; // index cannot be used due to filtering
1920
1957
  if (selAry[i].value === BLANKS) {
1921
1958
  if (!ctx) {
1922
1959
  ctx = {};
@@ -1945,6 +1982,20 @@ RowFilteringPlugin.prototype._onDialogFilterChanged = function (e) {
1945
1982
  "colIndex": colIndex
1946
1983
  });
1947
1984
  };
1985
+
1986
+ /** @public
1987
+ * @ignore
1988
+ * @param {string} sortOrder
1989
+ */
1990
+ RowFilteringPlugin.prototype.mockDialogSortChange = function (sortOrder) {
1991
+ if (this._filterDialog) {
1992
+ var arg = {
1993
+ detail: {}
1994
+ };
1995
+ arg.detail.value = sortOrder;
1996
+ this._onDialogSortChanged(arg);
1997
+ }
1998
+ };
1948
1999
  /** @private
1949
2000
  * @param {Object} e
1950
2001
  */
@@ -15,8 +15,6 @@ declare class TitleWrapPlugin extends GridPlugin {
15
15
 
16
16
  public getConfigObject(gridOptions?: any): any;
17
17
 
18
- public _adjustRowHeightRefByHost(host: any, sectionRef: any, from?: number|null, to?: number|null): boolean;
19
-
20
18
  public adjustRowHeight(sectionRef: any, from?: number|null, to?: number|null): boolean;
21
19
 
22
20
  public adjustRowHeightAt(sectionRef: any, rowIndex: number): boolean;
@@ -166,7 +166,7 @@ TitleWrapPlugin.prototype._onRecalculation = function () {
166
166
  this.adjustRowHeight("title");
167
167
  };
168
168
  /** adjust row height using specific grid at a reference to other grid
169
- * @public
169
+ * @private
170
170
  * @param {Object} host core grid instance
171
171
  * @param {Object} sectionRef grid SectionReference
172
172
  * @param {number=} from
@@ -103,7 +103,8 @@ DragUI.prototype.onThemeLoaded = function(colors) {
103
103
  "overflow-x: clip;",
104
104
  "text-overflow: ellipsis;",
105
105
  "padding: 0 7px 0 7px;",
106
- "box-shadow: 0 0 8px var(--grid-dragbox-bordercolor);"
106
+ "box-shadow: 0 0 8px var(--grid-dragbox-bordercolor);",
107
+ "z-index: 2" // Cover sort indicator
107
108
  ],
108
109
  ".drag-box-disabled", [
109
110
  "width: 100px;",
@@ -7,29 +7,29 @@ import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
7
7
  declare namespace PercentBarPlugin {
8
8
 
9
9
  type Options = {
10
- padding?: number,
11
- percentageLabel?: boolean,
12
- autoTextSizing?: boolean,
13
- autoFitting?: boolean,
14
- zeroValueHidden?: boolean
10
+ padding?: number|null,
11
+ percentageLabel?: boolean|null,
12
+ autoTextSizing?: boolean|null,
13
+ autoFitting?: boolean|null,
14
+ zeroValueHidden?: boolean|null
15
15
  };
16
16
 
17
17
  type PercentBarOptions = {
18
- alignment?: string,
19
- field?: string,
20
- textHidden?: boolean,
21
- textWidth?: (number|string),
22
- useMovementColor?: boolean,
23
- barColor?: string,
24
- padding?: number,
25
- percentageLabel?: boolean,
26
- autoTextSizing?: boolean,
27
- autoFitting?: boolean,
28
- zeroValueHidden?: boolean
18
+ alignment?: string|null,
19
+ field?: string|null,
20
+ textHidden?: boolean|null,
21
+ textWidth?: (number|string)|null,
22
+ useMovementColor?: boolean|null,
23
+ barColor?: string|null,
24
+ padding?: number|null,
25
+ percentageLabel?: boolean|null,
26
+ autoTextSizing?: boolean|null,
27
+ autoFitting?: boolean|null,
28
+ zeroValueHidden?: boolean|null
29
29
  };
30
30
 
31
31
  type ColumnOptions = {
32
- percentBar?: (PercentBarPlugin.PercentBarOptions|boolean)
32
+ percentBar?: (PercentBarPlugin.PercentBarOptions|boolean)|null
33
33
  };
34
34
 
35
35
  }
@@ -50,7 +50,7 @@ declare class PercentBarPlugin extends GridPlugin {
50
50
 
51
51
  public setPercentBarAlignment(colIndex: number, alignment: string): void;
52
52
 
53
- public setColumnPercentBar(colIndex: number, columnOptions: PercentBarPlugin.ColumnOptions): void;
53
+ public setColumnPercentBar(colIndex: number, columnOptions: PercentBarPlugin.ColumnOptions|null): void;
54
54
 
55
55
  public reloadThemeColors(): Promise<any>|null;
56
56
 
@@ -14,7 +14,8 @@ declare namespace RowDefinition {
14
14
  collapsed?: boolean|null,
15
15
  label?: (string|null)|null,
16
16
  hidden?: boolean|null,
17
- realTime?: boolean|null
17
+ realTime?: boolean|null,
18
+ info?: any
18
19
  };
19
20
 
20
21
  type RowTypes = {
@@ -130,7 +131,9 @@ declare class RowDefinition {
130
131
 
131
132
  public getDepthLevel(): number;
132
133
 
133
- public getUserModel(): any;
134
+ public setRowInfo(obj: any): void;
135
+
136
+ public getRowInfo(): any;
134
137
 
135
138
  public static toRowId(rowDef: RowDefinition|null): string;
136
139
 
@@ -131,6 +131,8 @@ declare class RowFilteringPlugin extends GridPlugin {
131
131
 
132
132
  declare function colSettings(colIndex: number, exp: RowFilteringPlugin.Expression|null, ctx?: (any|string)|null): boolean;
133
133
 
134
+ declare function selCount(sortOrder: string): void;
135
+
134
136
  declare function crf(enabled?: boolean|null): void;
135
137
 
136
138
  export default RowFilteringPlugin;
@@ -8,6 +8,7 @@ declare namespace StatisticsRowPlugin {
8
8
  invalidText?: string|null,
9
9
  noColoring?: boolean|null,
10
10
  noFormatting?: boolean|null,
11
+ useAllData?: boolean|null,
11
12
  postCalculation?: ((...params: any[]) => any)|null,
12
13
  postRendering?: ((...params: any[]) => any)|null
13
14
  };
package/lib/versions.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "tr-grid-util": "1.3.139",
2
+ "tr-grid-util": "1.3.140",
3
3
  "tr-grid-printer": "1.0.17",
4
- "@grid/column-dragging": "1.0.16",
5
- "@grid/row-segmenting": "1.0.30",
6
- "@grid/statistics-row": "1.0.16",
4
+ "@grid/column-dragging": "1.0.18",
5
+ "@grid/row-segmenting": "1.0.31",
6
+ "@grid/statistics-row": "1.0.17",
7
7
  "@grid/zoom": "1.0.11",
8
8
  "tr-grid-auto-tooltip": "1.1.6",
9
9
  "tr-grid-cell-selection": "1.0.35",
@@ -19,17 +19,17 @@
19
19
  "tr-grid-contextmenu": "1.0.41",
20
20
  "tr-grid-filter-input": "0.9.39",
21
21
  "tr-grid-heat-map": "1.0.29",
22
- "tr-grid-in-cell-editing": "1.0.81",
22
+ "tr-grid-in-cell-editing": "1.0.82",
23
23
  "tr-grid-pagination": "1.0.24",
24
- "tr-grid-percent-bar": "1.0.22",
25
- "tr-grid-range-bar": "2.0.7",
26
- "tr-grid-row-dragging": "1.0.31",
27
- "tr-grid-row-filtering": "1.0.69",
24
+ "tr-grid-percent-bar": "1.0.24",
25
+ "tr-grid-range-bar": "2.0.8",
26
+ "tr-grid-row-dragging": "1.0.32",
27
+ "tr-grid-row-filtering": "1.0.71",
28
28
  "tr-grid-row-grouping": "1.0.86",
29
29
  "tr-grid-row-selection": "1.0.27",
30
30
  "tr-grid-rowcoloring": "1.0.25",
31
31
  "tr-grid-textformatting": "1.0.48",
32
- "tr-grid-titlewrap": "1.0.21",
32
+ "tr-grid-titlewrap": "1.0.22",
33
33
  "@grid/formatters": "1.0.51",
34
34
  "@grid/column-selection-dialog": "4.0.57",
35
35
  "@grid/filter-dialog": "4.0.63",
package/package.json CHANGED
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "version": "6.0.87"
69
+ "version": "6.0.89"
70
70
  }