@refinitiv-ui/efx-grid 6.0.40 → 6.0.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +2 -1
  2. package/lib/column-selection-dialog/lib/column-selection-dialog.js +23 -7
  3. package/lib/core/dist/core.js +25 -26
  4. package/lib/core/dist/core.min.js +1 -1
  5. package/lib/core/es6/grid/Core.js +25 -26
  6. package/lib/grid/index.js +1 -1
  7. package/lib/rt-grid/dist/rt-grid.js +2083 -1753
  8. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  9. package/lib/rt-grid/es6/Grid.js +55 -7
  10. package/lib/rt-grid/es6/RowDefinition.d.ts +2 -2
  11. package/lib/rt-grid/es6/RowDefinition.js +37 -18
  12. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +26 -40
  13. package/lib/tr-grid-util/es6/CellPainter.d.ts +2 -1
  14. package/lib/tr-grid-util/es6/CellPainter.js +6 -4
  15. package/lib/tr-grid-util/es6/ExpressionParser.d.ts +10 -0
  16. package/lib/tr-grid-util/es6/ExpressionParser.js +366 -0
  17. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +10 -6
  18. package/lib/tr-grid-util/es6/FilterBuilder.js +264 -234
  19. package/lib/tr-grid-util/es6/FilterOperators.d.ts +3 -1
  20. package/lib/tr-grid-util/es6/FilterOperators.js +51 -2
  21. package/lib/tr-grid-util/es6/Util.d.ts +0 -3
  22. package/lib/tr-grid-util/es6/Util.js +0 -53
  23. package/lib/tr-grid-util/es6/formula/Formula.js +3 -3
  24. package/lib/types/es6/ColumnDragging.d.ts +51 -0
  25. package/lib/types/es6/ExtensionOptions.d.ts +2 -0
  26. package/lib/types/es6/Extensions.d.ts +3 -1
  27. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -2
  28. package/lib/types/es6/index.d.ts +1 -0
  29. package/lib/versions.json +3 -3
  30. package/package.json +1 -1
@@ -36,6 +36,7 @@
36
36
  */
37
37
  var FilterOperators = {
38
38
  EQ: {
39
+ id: "EQ",
39
40
  name: "Equal to",
40
41
  type: "string",
41
42
  positive: 1,
@@ -43,6 +44,7 @@ var FilterOperators = {
43
44
  formula: "str == input"
44
45
  },
45
46
  NEQ: {
47
+ id: "NEQ",
46
48
  name: "Not equal to",
47
49
  type: "string",
48
50
  positive: 0,
@@ -50,6 +52,7 @@ var FilterOperators = {
50
52
  formula: "str != input"
51
53
  },
52
54
  NUMEQ: {
55
+ id: "NUMEQ",
53
56
  name: "Number equal to",
54
57
  type: "number",
55
58
  positive: 1,
@@ -57,6 +60,7 @@ var FilterOperators = {
57
60
  formula: "val == input"
58
61
  },
59
62
  NUMNEQ: {
63
+ id: "NUMNEQ",
60
64
  name: "Number not equal to",
61
65
  type: "number",
62
66
  positive: 0,
@@ -64,6 +68,7 @@ var FilterOperators = {
64
68
  formula: "val != input"
65
69
  },
66
70
  GT: {
71
+ id: "GT",
67
72
  name: "Greater than",
68
73
  type: "number",
69
74
  positive: 1,
@@ -71,6 +76,7 @@ var FilterOperators = {
71
76
  formula: "val > input"
72
77
  },
73
78
  GTE: {
79
+ id: "GTE",
74
80
  name: "Greater than or equal to",
75
81
  type: "number",
76
82
  positive: 1,
@@ -78,6 +84,7 @@ var FilterOperators = {
78
84
  formula: "val >= input"
79
85
  },
80
86
  LT: {
87
+ id: "LT",
81
88
  name: "Less than",
82
89
  type: "number",
83
90
  positive: 1,
@@ -85,6 +92,7 @@ var FilterOperators = {
85
92
  formula: "val < input"
86
93
  },
87
94
  LTE: {
95
+ id: "LTE",
88
96
  name: "Less than or equal to",
89
97
  type: "number",
90
98
  positive: 1,
@@ -92,6 +100,7 @@ var FilterOperators = {
92
100
  formula: "val <= input"
93
101
  },
94
102
  BEGIN: {
103
+ id: "BEGIN",
95
104
  name: "Begin with",
96
105
  type: "string",
97
106
  positive: 1,
@@ -99,6 +108,7 @@ var FilterOperators = {
99
108
  formula: "str.indexOf(input) === 0"
100
109
  },
101
110
  NBEGIN: {
111
+ id: "NBEGIN",
102
112
  name: "Not begin with",
103
113
  type: "string",
104
114
  positive: 0,
@@ -106,6 +116,7 @@ var FilterOperators = {
106
116
  formula: "str.indexOf(input) !== 0"
107
117
  },
108
118
  END: {
119
+ id: "END",
109
120
  name: "End with",
110
121
  type: "string",
111
122
  positive: 1,
@@ -113,6 +124,7 @@ var FilterOperators = {
113
124
  formula: "(str.length >= input.length) && str.lastIndexOf(input) === (str.length - input.length)"
114
125
  },
115
126
  NEND: {
127
+ id: "NEND",
116
128
  name: "Not end with",
117
129
  type: "string",
118
130
  positive: 0,
@@ -120,6 +132,7 @@ var FilterOperators = {
120
132
  formula: "(str.length < input.length) || str.lastIndexOf(input) !== (str.length - input.length)"
121
133
  },
122
134
  CONT: {
135
+ id: "CONT",
123
136
  name: "Contain",
124
137
  type: "string",
125
138
  positive: 1,
@@ -127,6 +140,7 @@ var FilterOperators = {
127
140
  formula: "str.indexOf(input) >= 0"
128
141
  },
129
142
  NCONT: {
143
+ id: "NCONT",
130
144
  name: "Not contain",
131
145
  type: "string",
132
146
  positive: 0,
@@ -134,6 +148,7 @@ var FilterOperators = {
134
148
  formula: "str.indexOf(input) < 0"
135
149
  },
136
150
  EQ_BLANK: {
151
+ id: "EQ_BLANK",
137
152
  name: "Equal to blank value",
138
153
  type: "blank", // Blank checking
139
154
  positive: 1,
@@ -141,14 +156,15 @@ var FilterOperators = {
141
156
  formula: "!val && val !== 0" // false boolean value would not pass
142
157
  },
143
158
  EQ_NBLANK: {
159
+ id: "EQ_NBLANK",
144
160
  name: "Equal to non blank value",
145
161
  type: "blank", // Blank checking
146
162
  positive: 1,
147
163
  caseSensitive: 1,
148
164
  formula: "(val || val === 0) ? true : false"
149
165
  },
150
- // 86400000 is millisecond in a day. It is used to remove time part from date object for comparison
151
166
  DT: {
167
+ id: "DT",
152
168
  name: "Date is",
153
169
  type: "date",
154
170
  positive: 1,
@@ -156,6 +172,7 @@ var FilterOperators = {
156
172
  formula: "ts === input"
157
173
  },
158
174
  DTA: {
175
+ id: "DTA",
159
176
  name: "Date is After",
160
177
  type: "date",
161
178
  positive: 1,
@@ -163,6 +180,7 @@ var FilterOperators = {
163
180
  formula: "ts > input"
164
181
  },
165
182
  DTB: {
183
+ id: "DTB",
166
184
  name: "Date is Before",
167
185
  type: "date",
168
186
  positive: 1,
@@ -177,5 +195,36 @@ FilterOperators.TXTEQ = FilterOperators.EQ;
177
195
  FilterOperators.BLANK = FilterOperators.EQ_BLANK;
178
196
  FilterOperators.NBLANK = FilterOperators.EQ_NBLANK;
179
197
 
198
+
199
+ /** @type {Object.<string, Function>}
200
+ * @public
201
+ * @const
202
+ */
203
+ var OperatorFunctions = {
204
+ EQ: function(str, input) { return str == input; },
205
+ NEQ: function(str, input) { return str != input; },
206
+ NUMEQ: function(num, input) { return num == input; },
207
+ NUMNEQ: function(num, input) { return num != input; },
208
+ GT: function(num, input) { return num > input; },
209
+ GTE: function(num, input) { return num >= input; },
210
+ LT: function(num, input) { return num < input; },
211
+ LTE: function(num, input) { return num <= input; },
212
+ BEGIN: function(str, input) { return str.indexOf(input) === 0; },
213
+ NBEGIN: function(str, input) { return str.indexOf(input) !== 0; },
214
+ END: function(str, input) {
215
+ return (str.length >= input.length) && str.lastIndexOf(input) === (str.length - input.length);
216
+ },
217
+ NEND: function(str, input) {
218
+ return (str.length < input.length) || str.lastIndexOf(input) !== (str.length - input.length);
219
+ },
220
+ CONT: function(str, input) { return str.indexOf(input) >= 0; },
221
+ NCONT: function(str, input) { return str.indexOf(input) < 0; },
222
+ EQ_BLANK: function(val, input) { return !val && val !== 0; },
223
+ EQ_NBLANK: function(val, input) { return (val || val === 0) ? true : false; },
224
+ DT: function(ts, input) { return ts === input; },
225
+ DTA: function(ts, input) { return ts > input; },
226
+ DTB: function(ts, input) { return ts < input; }
227
+ };
228
+
180
229
  export default FilterOperators;
181
- export { FilterOperators };
230
+ export { FilterOperators, OperatorFunctions };
@@ -28,8 +28,6 @@ declare function deepEqual(obj1: any, obj2: any): boolean;
28
28
 
29
29
  declare function extendArrayProperty(obj: any, propName: string, ary: any): any[]|null;
30
30
 
31
- declare function parseCondition(expression: string|((...params: any[]) => any)|null): ((...params: any[]) => any)|null;
32
-
33
31
  declare function prettifyCss(css: string|any[]|null): string;
34
32
 
35
33
  declare function getShadowRoot(elem: Element|null): DocumentFragment|null;
@@ -58,7 +56,6 @@ export {
58
56
  arrayToObject,
59
57
  extendProperty,
60
58
  extendArrayProperty,
61
- parseCondition,
62
59
  prettifyCss,
63
60
  getShadowRoot,
64
61
  injectCss,
@@ -301,58 +301,6 @@ var extendArrayProperty = function (obj, propName, ary) {
301
301
  return objAry;
302
302
  };
303
303
 
304
-
305
- /** Regex for matching the field token E.g. '[CF_BID]'
306
- * @type {!RegExp}
307
- * @private
308
- * @const
309
- */
310
- var _bracketExp = new RegExp(/\[[^\[]*\]/g); // eslint-disable-line no-useless-escape
311
- /** @public
312
- * @function
313
- * @param {string|Function} expression
314
- * @return {Function}
315
- * @example
316
- * var fn = parseCondition("[CF_BID] >= 10 && [CF_BID] <= 100");
317
- * window.console.log(fn(25));
318
- */
319
- var parseCondition = function(expression) {
320
- if(!expression) {
321
- return null;
322
- }
323
- if(typeof expression !== "string") {
324
- return (typeof expression == "function") ? /** @type {Function} */(expression) : null;
325
- }
326
-
327
- var brackets = expression.match(_bracketExp); // Retrieving field tokens (anything in between brackets)
328
- var map = {}; // For checking duplication
329
- var fields = [];
330
- var len = brackets ? brackets.length : 0;
331
- for(var i = len; --i >= 0;) {
332
- var field = brackets[i];
333
- if(!map[field]) {
334
- map[field] = "f[" + fields.length + "]"; // Create mapping of field token to array with index E.g. { "[CF_BID]": "f[0]" }
335
- fields.push(field.substring(1, field.length - 1)); // Strip '[' and ']' of field token to get field name
336
- }
337
- }
338
-
339
- // Replace the field tokens with rowData of array with index E.g. [CF_BID] ==> rowData[f[0]]
340
- expression = expression.replace(_bracketExp, function(match) {
341
- return "rowData[" + map[match] + "]";
342
- });
343
- var finalExp = "(function(f, rowData) { return (" + expression + "); })";
344
-
345
- var fn = null;
346
- try {
347
- fn = eval(finalExp);
348
- fn = fn.bind(null, fields); // Bind fields for matching field name
349
- } catch(err) {
350
- console.log(err.message);
351
- }
352
- return (fn) ? fn : null;
353
- };
354
-
355
-
356
304
  /** @private
357
305
  * @param {string|Array.<string>} item
358
306
  * @return {string}
@@ -583,7 +531,6 @@ export {
583
531
  arrayToObject,
584
532
  extendProperty,
585
533
  extendArrayProperty,
586
- parseCondition,
587
534
  prettifyCss,
588
535
  getShadowRoot,
589
536
  injectCss,
@@ -93,7 +93,7 @@ Formula.prototype._alias = ""; // Alias name of formula
93
93
  /** @private
94
94
  * @type {Function}
95
95
  */
96
- Formula.prototype._main = null; // Function resulted from eval(expression)
96
+ Formula.prototype._main = null; // Function resulted from resolving an expression
97
97
 
98
98
  /** @private
99
99
  * @type {Array.<Function>}
@@ -201,7 +201,7 @@ Formula.prototype.calculate = function(rowData) {
201
201
  return null;
202
202
  };
203
203
 
204
- /** Function resulted from eval(expression)
204
+ /** Function resulted from resolving an expression
205
205
  * @public
206
206
  * @return {Function} Returns function that takes an JSON object as a parameter. Return null if function is not valid JavaScript codes.
207
207
  */
@@ -673,7 +673,7 @@ Formula.prototype._parse = function(exp) {
673
673
  Formula.prototype._createFunction = function (expression) {
674
674
  var func = null;
675
675
  try {
676
- func = /** @type{Function} */(eval("(function (__R) { return " + expression + "; })"));
676
+ func = new Function("__R", "return " + expression + ";");
677
677
  func = func.bind(this);
678
678
  func({}); // Try to execute the method once to check error
679
679
  } catch(err) {
@@ -0,0 +1,51 @@
1
+ import { Ext } from "../../tr-grid-util/es6/Ext.js";
2
+ import { preventDefault } from "../../tr-grid-util/es6/EventDispatcher.js";
3
+ import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
4
+ import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
5
+ import { cloneObject } from "../../tr-grid-util/es6/Util.js";
6
+ import { DragUI } from "../../tr-grid-util/es6/DragUI.js";
7
+
8
+ declare namespace ColumnDraggingPlugin {
9
+
10
+ type Options = {
11
+ dragStart?: ((...params: any[]) => any)|null,
12
+ drag?: ((...params: any[]) => any)|null,
13
+ dragEnd?: ((...params: any[]) => any)|null,
14
+ preColumnMoved?: ((...params: any[]) => any)|null,
15
+ columnMoved?: ((...params: any[]) => any)|null,
16
+ dragInterval?: ((...params: any[]) => any)|null,
17
+ dragBoxRenderer?: ((...params: any[]) => any)|null
18
+ };
19
+
20
+ }
21
+
22
+ declare class ColumnDraggingPlugin extends GridPlugin {
23
+
24
+ constructor(options?: ColumnDraggingPlugin.Options|null);
25
+
26
+ public getName(): string;
27
+
28
+ public hasMultiTableSupport(): boolean;
29
+
30
+ public initialize(host: any, options?: any): void;
31
+
32
+ public unload(host?: any): void;
33
+
34
+ public config(options?: any): void;
35
+
36
+ public getConfigObject(gridOptions?: any): any;
37
+
38
+ public lockFrozenColumn(lock: boolean): void;
39
+
40
+ public disable(disabled?: boolean|null): void;
41
+
42
+ public isDisabled(): boolean;
43
+
44
+ public disableMoving(disabled?: boolean|null): void;
45
+
46
+ public disableDragBox(disabled?: boolean|null): void;
47
+
48
+ }
49
+
50
+ export default ColumnDraggingPlugin;
51
+ export { ColumnDraggingPlugin, ColumnDraggingPlugin as ColumnDragging, ColumnDraggingPlugin as ColumnDraggingExtension };
@@ -1,3 +1,4 @@
1
+ import ColumnDragging from "../../column-dragging/es6/ColumnDragging.js";
1
2
  import RowSegmenting from "../../row-segmenting/es6/RowSegmenting.js";
2
3
  import StatisticsRow from "../../statistics-row/es6/StatisticsRow.js";
3
4
  import Zoom from "../../zoom/es6/Zoom.js";
@@ -24,6 +25,7 @@ import RowColoring from "../../tr-grid-rowcoloring/es6/RowColoring.js";
24
25
  import TextFormatting from "../../tr-grid-textformatting/es6/TextFormatting.js";
25
26
 
26
27
  type ExtensionOptions = {
28
+ columnDragging?: ColumnDragging.Options,
27
29
  rowSegmenting?: RowSegmenting.Options,
28
30
  statisticsRow?: StatisticsRow.Options,
29
31
  zoom?: Zoom.Options,
@@ -1,3 +1,4 @@
1
+ import ColumnDragging from "../../column-dragging/es6/ColumnDragging.js";
1
2
  import RowSegmenting from "../../row-segmenting/es6/RowSegmenting.js";
2
3
  import StatisticsRow from "../../statistics-row/es6/StatisticsRow.js";
3
4
  import Zoom from "../../zoom/es6/Zoom.js";
@@ -27,7 +28,8 @@ import RowColoring from "../../tr-grid-rowcoloring/es6/RowColoring.js";
27
28
  import TextFormatting from "../../tr-grid-textformatting/es6/TextFormatting.js";
28
29
  import TitleWrap from "../../tr-grid-titlewrap/es6/TitleWrap.js";
29
30
 
30
- type Extensions = RowSegmenting |
31
+ type Extensions = ColumnDragging |
32
+ RowSegmenting |
31
33
  StatisticsRow |
32
34
  Zoom |
33
35
  AutoTooltip |
@@ -104,7 +104,7 @@ declare class RowDefinition {
104
104
 
105
105
  public resetUpdates(): void;
106
106
 
107
- public registerToView(view: DataTable|null, rowId?: string|null): void;
107
+ public registerToView(view: DataView|null, rowId?: string|null): void;
108
108
 
109
109
  public static deregisterFromView(rowIds: (string)[]|null, rowDef: RowDefinition|null): (string)[]|null;
110
110
 
@@ -142,7 +142,7 @@ declare const ROW_DEF: string;
142
142
 
143
143
  declare const ROW_TYPES: RowDefinition.RowTypes;
144
144
 
145
- declare function rowData(userInput: string, permId?: string|null, asChain?: boolean|null, expanded?: boolean|null): boolean;
145
+ declare function rowData(userInput: string, extractedOptions: any): boolean;
146
146
 
147
147
  export {RowDefinition, ROW_DEF, ROW_TYPES};
148
148
  export default RowDefinition;
@@ -1,4 +1,5 @@
1
1
  // Extensions
2
+ export { ColumnDragging } from "./ColumnDragging";
2
3
  export { CoralButtonFormatter } from "./CoralButtonFormatter";
3
4
  export { CoralCheckboxFormatter } from "./CoralCheckboxFormatter";
4
5
  export { CoralComboBoxFormatter } from "./CoralComboBoxFormatter";
package/lib/versions.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "tr-grid-util": "1.3.107",
2
+ "tr-grid-util": "1.3.109",
3
3
  "@grid/column-dragging": "1.0.14",
4
4
  "@grid/row-segmenting": "1.0.24",
5
5
  "@grid/statistics-row": "1.0.14",
@@ -9,7 +9,7 @@
9
9
  "tr-grid-checkbox": "1.0.60",
10
10
  "tr-grid-column-fitter": "1.0.39",
11
11
  "tr-grid-column-formatting": "0.9.34",
12
- "tr-grid-column-grouping": "1.0.49",
12
+ "tr-grid-column-grouping": "1.0.50",
13
13
  "tr-grid-column-resizing": "1.0.28",
14
14
  "tr-grid-column-selection": "1.0.28",
15
15
  "tr-grid-column-stack": "1.0.63",
@@ -31,7 +31,7 @@
31
31
  "tr-grid-textformatting": "1.0.45",
32
32
  "tr-grid-titlewrap": "1.0.19",
33
33
  "@grid/formatters": "1.0.49",
34
- "@grid/column-selection-dialog": "4.0.46",
34
+ "@grid/column-selection-dialog": "4.0.48",
35
35
  "@grid/filter-dialog": "4.0.57",
36
36
  "@grid/column-format-dialog": "4.0.43"
37
37
  }
package/package.json CHANGED
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "version": "6.0.40"
69
+ "version": "6.0.41"
70
70
  }