@refinitiv-ui/efx-grid 6.0.60 → 6.0.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +1 -1
  2. package/lib/column-selection-dialog/lib/column-selection-dialog.js +1 -41
  3. package/lib/column-selection-dialog/themes/base.less +32 -0
  4. package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +1 -1
  5. package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +1 -1
  6. package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +1 -1
  7. package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +1 -1
  8. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
  9. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
  10. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
  11. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
  12. package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +1 -1
  13. package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +1 -1
  14. package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +1 -1
  15. package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +1 -1
  16. package/lib/core/dist/core.js +2 -6
  17. package/lib/core/dist/core.min.js +1 -1
  18. package/lib/core/es6/grid/Core.js +2 -6
  19. package/lib/grid/index.js +1 -1
  20. package/lib/tr-grid-column-stack/es6/ColumnStack.js +1 -0
  21. package/lib/tr-grid-util/es6/ElementObserver.js +2 -1
  22. package/lib/tr-grid-util/es6/ExpressionParser.js +55 -13
  23. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +35 -13
  24. package/lib/tr-grid-util/es6/jet/DataGenerator.js +42 -17
  25. package/lib/versions.json +3 -3
  26. package/package.json +1 -1
@@ -562,7 +562,7 @@ Core.prototype._batches = null;
562
562
  * @return {string}
563
563
  */
564
564
  Core.getVersion = function () {
565
- return "5.1.74";
565
+ return "5.1.75";
566
566
  };
567
567
  /** {@link ElementWrapper#dispose}
568
568
  * @override
@@ -5071,14 +5071,10 @@ Core.prototype._onColInViewChanged = function (e) {
5071
5071
  var last = pli > li ? pli : li; // INCLUSIVE
5072
5072
 
5073
5073
  this._activateColumns(fi, li, first, last);
5074
-
5075
- var rfi = this._rowVirtualizer.getFirstIndexInView();
5076
- var rli = this._rowVirtualizer.getLastIndexInView();
5077
5074
  var sectionCount = this.getSectionCount();
5078
5075
  for (var s = 0; s < sectionCount; ++s) { // For each section
5079
5076
  var sectionSettings = this._settings[s];
5080
- var rowIndexOffset = sectionSettings.getRowOffset();
5081
- this.updateRowData(sectionSettings, rfi - rowIndexOffset, rli - rowIndexOffset);
5077
+ this.updateRowData(sectionSettings); // It will be render all rows in view
5082
5078
  }
5083
5079
  };
5084
5080
  /** @private
package/lib/grid/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import {Grid} from "./lib/efx-grid.js";
2
2
  export {Grid}
3
- window.EFX_GRID = { version: "6.0.60" };
3
+ window.EFX_GRID = { version: "6.0.61" };
@@ -1800,6 +1800,7 @@ ColumnStackPlugin.prototype.addColumnToStack = function(colRef, stackId) {
1800
1800
 
1801
1801
  // If an unpinned column is added to a pinned stack, the pinning position should be updated
1802
1802
  if(stack.leftPinned || stack.rightPinned) {
1803
+ var colCount = this.getColumnCount();
1803
1804
  if(stack.leftPinned && colIndex > leftPinnedIndex) {
1804
1805
  leftPinnedIndex++;
1805
1806
  this._freezeColumn(leftPinnedIndex, rightPinnedCount);
@@ -91,7 +91,8 @@ ElementObserver._addListener = function(elem, fn) {
91
91
  }
92
92
  };
93
93
 
94
- /** @public Add a listener to a html lang attribute
94
+ /** Add a listener to a html lang attribute
95
+ * @public
95
96
  * @param {Element} element An element within the DOM tree to watch for changes
96
97
  */
97
98
  ElementObserver.addLanguageListener = function(element) {
@@ -17,7 +17,9 @@ var OperatorPrecedences = {
17
17
  "-": 4,
18
18
  "*": 5,
19
19
  "%": 6,
20
- "/": 6
20
+ "/": 6,
21
+ "!": 7,
22
+ "!!": 7
21
23
  };
22
24
  /** @type {Object.<string, Function>}
23
25
  * @private
@@ -36,10 +38,32 @@ var OperatorFunctions = {
36
38
  "==": function(lhs, rhs){ return lhs == rhs; },
37
39
  "!=": function(lhs, rhs){ return lhs != rhs; },
38
40
  "&&": function(lhs, rhs){ return lhs && rhs; },
39
- "||": function(lhs, rhs){ return lhs || rhs; }
41
+ "||": function(lhs, rhs){ return lhs || rhs; },
42
+ "!": function(lhs, rhs){ return !lhs; },
43
+ "!!": function(lhs, rhs){ return !!lhs; }
40
44
  };
41
45
  /** @type {Object.<string, Function>}
42
46
  * @private
47
+ * @const
48
+ */
49
+ var OperandRequirements = {
50
+ "+": 2,
51
+ "-": 2,
52
+ "*": 2,
53
+ "/": 2,
54
+ "%": 2,
55
+ "<": 2,
56
+ ">": 2,
57
+ "<=": 2,
58
+ ">=": 2,
59
+ "==": 2,
60
+ "!=": 2,
61
+ "&&": 2,
62
+ "||": 2,
63
+ "!": 1,
64
+ "!!": 1
65
+ };
66
+ /** @private
43
67
  * @function
44
68
  * @param {Array.<Object>} ary
45
69
  * @param {string|number} value
@@ -57,10 +81,20 @@ var _addToken = function(ary, value, type, dataType) {
57
81
  }
58
82
  if(type === "operator") {
59
83
  tok.precedence = OperatorPrecedences[value];
84
+ } else if(type === "parenthesis") {
85
+ tok.precedence = 0;
60
86
  }
61
87
  ary.push(tok);
62
88
  return ary.length - 1;
63
89
  };
90
+ /** @private
91
+ * @function
92
+ * @param {Object} obj
93
+ * @returns {*}
94
+ */
95
+ var _toValue = function(obj) { // eslint-disable-line
96
+ return obj.value;
97
+ };
64
98
 
65
99
  /** @public
66
100
  * @namespace
@@ -174,8 +208,9 @@ ExpressionParser._tester = function(ctx) {
174
208
  for(var i = 0; i < inputCount; ++i) {
175
209
  var tok = rpn[i];
176
210
  if(tok.type !== "literal") {
177
- if(operandCount >= 2) {
178
- operandCount -= 2;
211
+ var requiredCount = OperandRequirements[tok.value];
212
+ if(operandCount >= requiredCount) {
213
+ operandCount -= requiredCount;
179
214
  } else {
180
215
  console.warn("Cannot parse an expression with insufficient number of operands");
181
216
  return true;
@@ -216,11 +251,18 @@ ExpressionParser._filter = function(ctx, rowData) {
216
251
  curRes = rowData ? rowData[tokValue] : null;
217
252
  }
218
253
  } else { // operator
219
- curRes = OperatorFunctions[tokValue](
220
- results[operandCount - 2],
221
- results[operandCount - 1]
222
- );
223
- operandCount -= 2;
254
+ if(OperandRequirements[tokValue] === 1) {
255
+ curRes = OperatorFunctions[tokValue](
256
+ results[operandCount - 1]
257
+ );
258
+ operandCount -= 1;
259
+ } else { // 2
260
+ curRes = OperatorFunctions[tokValue](
261
+ results[operandCount - 2],
262
+ results[operandCount - 1]
263
+ );
264
+ operandCount -= 2;
265
+ }
224
266
  }
225
267
  results[operandCount++] = curRes;
226
268
  }
@@ -289,7 +331,6 @@ ExpressionParser.parse = function(expression) {
289
331
  }
290
332
  infixTokens.push(tok);
291
333
  }
292
- // TODO: Handle the case where subtraction operator is in front of a variable
293
334
  ExpressionParser._tokens.length = 0;
294
335
 
295
336
  // Convert Infix notation to Reverse Polish Notation (Postfix)
@@ -324,9 +365,10 @@ ExpressionParser.parse = function(expression) {
324
365
  }
325
366
  }
326
367
  } else { // operator
327
- lastOp = operators[operators.length - 1];
328
- var prevPrecedence = lastOp ? lastOp.precedence : null;
329
- if(prevPrecedence != null && tok.precedence <= prevPrecedence) {
368
+ while(operators.length) {
369
+ if(tok.precedence > operators[operators.length - 1].precedence) {
370
+ break;
371
+ }
330
372
  rpn.push(operators.pop());
331
373
  }
332
374
  operators.push(tok);
@@ -1,16 +1,36 @@
1
1
  import DataSet from "./DataSet.js";
2
2
 
3
+ declare namespace DataGenerator {
4
+
5
+ type DataOptions = {
6
+ seed?: number|null,
7
+ numRows?: number|null,
8
+ rowCount?: number|null
9
+ };
10
+
11
+ type FieldInformation = {
12
+ type?: string|null,
13
+ prefix?: string|null,
14
+ suffix?: string|null,
15
+ min?: number|null,
16
+ max?: number|null,
17
+ prec?: string|null,
18
+ fixedValue?: string|null,
19
+ members?: any[]|null,
20
+ generate?: ((...params: any[]) => any)|null
21
+ };
22
+
23
+ }
24
+
3
25
  declare class DataGenerator {
4
26
 
5
27
  constructor(seed?: number|null);
6
28
 
7
- public static readonly seed: number|null;
8
-
9
- public generate(fields: string|(string)[]|null, options?: (number|any)|null): (any[])[];
29
+ public generate(fields: string|(string)[]|null, options?: (number|DataGenerator.DataOptions)|null): (any[])[];
10
30
 
11
31
  public generateRecords(fields: string|(string)[]|null, options?: (number|any)|null): (any)[];
12
32
 
13
- public generateQuoteData(field: string, options?: any): any;
33
+ public generateQuoteData(field: string, options?: DataGenerator.DataOptions|null): any;
14
34
 
15
35
  public getSeed(): number|null;
16
36
 
@@ -32,13 +52,13 @@ declare class DataGenerator {
32
52
 
33
53
  public randString(min?: number|null, max?: number|null): string;
34
54
 
35
- public static generate(fields: string|(string)[]|null, options?: any): (any[])[];
55
+ public static generate(fields: string|(string)[]|null, options?: DataGenerator.DataOptions|null): (any[])[];
36
56
 
37
- public static generateRecord(fields: string|(string)[]|null, options?: any): any;
57
+ public static generateRecord(fields: string|(string)[]|null, options?: DataGenerator.DataOptions|null): any;
38
58
 
39
- public static generateRecords(fields: string|(string)[]|null, options?: (number|any)|null): (any)[];
59
+ public static generateRecords(fields: string|(string)[]|null, options?: (number|DataGenerator.DataOptions)|null): (any)[];
40
60
 
41
- public static addFieldInfo(field: string, options: any|((...params: any[]) => any)|null): void;
61
+ public static addFieldInfo(field: string, options: DataGenerator.FieldInformation|((...params: any[]) => any)|null): void;
42
62
 
43
63
  public static randNumber(min?: number|null, max?: number|null, prec?: (number|null)|null, seed?: number|null): number;
44
64
 
@@ -56,11 +76,13 @@ declare class DataGenerator {
56
76
 
57
77
  public static randString(min?: number|null, max?: number|null, subType?: string|null, seed?: number|null): string;
58
78
 
79
+ public static toRecords(data2D: (any[])[]|null, fields?: (string)[]|null): (any)[]|null;
80
+
59
81
  }
60
82
 
61
83
  declare function getFieldInfo(field: string): any;
62
84
 
63
- declare function addFieldInfo(field: string, options: any|((...params: any[]) => any)|null): void;
85
+ declare function addFieldInfo(field: string, options: DataGenerator.FieldInformation|((...params: any[]) => any)|null): void;
64
86
 
65
87
  declare function pseudoRandNumber(seed: number): number;
66
88
 
@@ -84,13 +106,13 @@ declare function toRecords(data2D: (any[])[]|null, fields?: (string)[]|null): (a
84
106
 
85
107
  declare function getSeed(): number;
86
108
 
87
- declare function generate(fields: string|(string)[]|null, options?: any): (any[])[];
109
+ declare function generate(fields: string|(string)[]|null, options?: DataGenerator.DataOptions|null): (any[])[];
88
110
 
89
- declare function generateRecord(fields: string|(string)[]|null, options?: (number|any)|null, seed?: number|null): any;
111
+ declare function generateRecord(fields: string|(string)[]|null, options?: (number|DataGenerator.DataOptions)|null, seed?: number|null): any;
90
112
 
91
- declare function generateRecords(fields: string|(string)[]|null, options?: (number|any)|null): (any)[];
113
+ declare function generateRecords(fields: string|(string)[]|null, options?: (number|DataGenerator.DataOptions)|null): (any)[];
92
114
 
93
- declare function generateQuoteData(field: string, options?: any, seed?: number|null): any;
115
+ declare function generateQuoteData(field: string, options?: DataGenerator.DataOptions|null, seed?: number|null): any;
94
116
 
95
117
  export default DataGenerator;
96
118
  export {
@@ -1,5 +1,25 @@
1
1
  import DataSet from "./DataSet.js";
2
2
 
3
+ /** @typedef {Object} DataGenerator~DataOptions
4
+ * @description Options for generating data
5
+ * @property {number=} seed Seed for randomization. If seed is not specified (default), new set of data will be generated every time. Otherwise, the same set of data will be generated.
6
+ * @property {number=} numRows Number of rows to be generated
7
+ * @property {number=} rowCount Alias to numRows
8
+ */
9
+
10
+ /** @typedef {Object} DataGenerator~FieldInformation
11
+ * @description Information object for defining how data are generated for a specific field
12
+ * @property {string=} type Available types are number, float, boolean, set, function, and isoDate
13
+ * @property {string=} prefix Add a text prefix to the data
14
+ * @property {string=} suffix Add a text suffix to the data
15
+ * @property {number=} min Minimum value of the numeric data
16
+ * @property {number=} max Maximum value of the numeric data. This is exclusive (not included in the result).
17
+ * @property {string=} prec Precision (place number after the decimal point) of the numeric data.
18
+ * @property {string=} fixedValue Single/static/constant value
19
+ * @property {Array=} members List of possible data when the type is "set"
20
+ * @property {Function=} generate Function for generating data when the type is "function"
21
+ */
22
+
3
23
  /** @private
4
24
  * @param {Object} fInfo
5
25
  * @param {number=} seed
@@ -26,8 +46,7 @@ var _generateDate1 = function(fInfo, seed) {
26
46
 
27
47
  var POW10 = [1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10];
28
48
 
29
- /** to format data including type, suffix, prefix, min, max, prec, fixedValue, changeOnly, members, isoDate.
30
- * @type {Object}
49
+ /** @type {Object.<string, DataGenerator~DataOptions>}
31
50
  * @private
32
51
  */
33
52
  var _fieldInfo = {
@@ -100,7 +119,7 @@ var getFieldInfo = function(field) {
100
119
 
101
120
  /** @public
102
121
  * @param {string} field
103
- * @param {Object|Function} options
122
+ * @param {DataGenerator~FieldInformation|Function} options
104
123
  */
105
124
  var addFieldInfo = function(field, options) {
106
125
  if(field) {
@@ -299,9 +318,10 @@ var getSeed = function() {
299
318
  return DataGenerator.seed;
300
319
  };
301
320
 
302
- /** @public
321
+ /** Generate 2 dimensional array of data from the specified field and options. Note that 2D array data structure is not recommended for usage due to the position of fields/columns can be changed at runtime.
322
+ * @public
303
323
  * @param {string|Array.<string>} fields
304
- * @param {Object=} options
324
+ * @param {DataGenerator~DataOptions=} options
305
325
  * @return {!Array.<Array>} 2D Array of data
306
326
  */
307
327
  var generate = function(fields, options) {
@@ -314,7 +334,7 @@ var generate = function(fields, options) {
314
334
  /** WARNING: This method does not modify global seed
315
335
  * @public
316
336
  * @param {string|Array.<string>} fields
317
- * @param {(number|Object)=} options Configuration object or seed number
337
+ * @param {(number|DataGenerator~DataOptions)=} options Configuration object or seed number
318
338
  * @param {number=} seed
319
339
  * @return {!Object} Object with the given fields as its keys
320
340
  */
@@ -342,7 +362,7 @@ var generateRecord = function(fields, options, seed) {
342
362
 
343
363
  /** @public
344
364
  * @param {string|Array.<string>} fields
345
- * @param {(number|Object)=} options Configuration object or number of rows
365
+ * @param {(number|DataGenerator~DataOptions)=} options Configuration object or number of rows
346
366
  * @return {!Array.<Object>} Array of object with the given fields as its keys
347
367
  */
348
368
  var generateRecords = function(fields, options) {
@@ -366,7 +386,7 @@ var generateRecords = function(fields, options) {
366
386
  /** WARNING: This method does not modify global seed
367
387
  * @public
368
388
  * @param {string} field
369
- * @param {Object=} options
389
+ * @param {DataGenerator~DataOptions=} options
370
390
  * @param {number=} seed
371
391
  * @return {!Object} Object with value, formattedValue and other properties
372
392
  */
@@ -462,7 +482,7 @@ var _hash = function(str) {
462
482
  };
463
483
  /** @private
464
484
  * @param {string} field
465
- * @param {Object=} options
485
+ * @param {DataGenerator~DataOptions=} options
466
486
  * @param {number=} seed
467
487
  * @return {!Object} Object with value and other properties
468
488
  */
@@ -533,9 +553,10 @@ var DataGenerator = function(seed) {
533
553
  */
534
554
  DataGenerator.prototype._seed = null;
535
555
 
536
- /** @public
556
+ /** Generate 2 dimensional array of data from the specified field and options. Note that 2D array data structure is not recommended for usage due to the position of fields/columns can be changed at runtime.
557
+ * @public
537
558
  * @param {string|Array.<string>} fields
538
- * @param {(number|Object)=} options
559
+ * @param {(number|DataGenerator~DataOptions)=} options
539
560
  * @return {!Array.<Array>} 2D Array of data
540
561
  */
541
562
  DataGenerator.prototype.generate = function(fields, options) {
@@ -570,7 +591,7 @@ DataGenerator.prototype.generateRecords = function(fields, options) {
570
591
 
571
592
  /** @public
572
593
  * @param {string} field
573
- * @param {Object=} options
594
+ * @param {DataGenerator~DataOptions=} options
574
595
  * @return {!Object} Object with value, formattedValue and other properties
575
596
  */
576
597
  DataGenerator.prototype.generateQuoteData = function(field, options) {
@@ -700,33 +721,35 @@ DataGenerator.prototype.randString = function(min, max) {
700
721
 
701
722
  /** @type {?number}
702
723
  * @public
724
+ * @ignore
703
725
  */
704
726
  DataGenerator.seed = null;
705
- /** @public
727
+ /** Generate 2 dimensional array of data from the specified field and options. Note that 2D array data structure is not recommended for usage due to the position of fields/columns can be changed at runtime.
728
+ * @public
706
729
  * @function
707
730
  * @param {string|Array.<string>} fields
708
- * @param {Object=} options
731
+ * @param {DataGenerator~DataOptions=} options
709
732
  * @return {!Array.<Array>} 2D Array of data
710
733
  */
711
734
  DataGenerator.generate = generate;
712
735
  /** @public
713
736
  * @function
714
737
  * @param {string|Array.<string>} fields
715
- * @param {Object=} options
738
+ * @param {DataGenerator~DataOptions=} options
716
739
  * @return {Object} Object with the given fields as its keys
717
740
  */
718
741
  DataGenerator.generateRecord = generateRecord;
719
742
  /** @public
720
743
  * @function
721
744
  * @param {string|Array.<string>} fields
722
- * @param {(number|Object)=} options Configuration object or seed number
745
+ * @param {(number|DataGenerator~DataOptions)=} options Configuration object or number of rows
723
746
  * @return {!Array.<Object>} Array of object with the given fields as its keys
724
747
  */
725
748
  DataGenerator.generateRecords = generateRecords;
726
749
  /** @public
727
750
  * @function
728
751
  * @param {string} field
729
- * @param {Object|Function} options
752
+ * @param {DataGenerator~FieldInformation|Function} options
730
753
  */
731
754
  DataGenerator.addFieldInfo = addFieldInfo;
732
755
  /** Return a floating-point random number in the range min - max (inclusive of min, but not max) with prec digits of precision.
@@ -801,6 +824,8 @@ DataGenerator.randDate = randDate;
801
824
  DataGenerator.randString = randString;
802
825
 
803
826
  /** Convert 2D Array to Array of records
827
+ * @public
828
+ * @function
804
829
  * @param {Array.<Array>} data2D Array of values
805
830
  * @param {Array.<string>=} fields Keys to be mapped on the output records.
806
831
  * @return {Array.<Object>} records
package/lib/versions.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "tr-grid-util": "1.3.124",
2
+ "tr-grid-util": "1.3.125",
3
3
  "tr-grid-printer": "1.0.16",
4
4
  "@grid/column-dragging": "1.0.14",
5
5
  "@grid/row-segmenting": "1.0.24",
@@ -13,7 +13,7 @@
13
13
  "tr-grid-column-grouping": "1.0.54",
14
14
  "tr-grid-column-resizing": "1.0.28",
15
15
  "tr-grid-column-selection": "1.0.29",
16
- "tr-grid-column-stack": "1.0.69",
16
+ "tr-grid-column-stack": "1.0.70",
17
17
  "tr-grid-conditional-coloring": "1.0.62",
18
18
  "tr-grid-content-wrap": "1.0.20",
19
19
  "tr-grid-contextmenu": "1.0.39",
@@ -31,7 +31,7 @@
31
31
  "tr-grid-textformatting": "1.0.46",
32
32
  "tr-grid-titlewrap": "1.0.19",
33
33
  "@grid/formatters": "1.0.50",
34
- "@grid/column-selection-dialog": "4.0.52",
34
+ "@grid/column-selection-dialog": "4.0.53",
35
35
  "@grid/filter-dialog": "4.0.57",
36
36
  "@grid/column-format-dialog": "4.0.44"
37
37
  }
package/package.json CHANGED
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "version": "6.0.60"
69
+ "version": "6.0.61"
70
70
  }