@refinitiv-ui/efx-grid 6.0.44 → 6.0.46

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +3 -1
  2. package/lib/column-selection-dialog/lib/column-selection-dialog.js +24 -3
  3. package/lib/column-selection-dialog/themes/base.less +23 -12
  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 +204 -186
  17. package/lib/core/dist/core.min.js +1 -1
  18. package/lib/core/es6/data/DataView.d.ts +2 -0
  19. package/lib/core/es6/data/DataView.js +170 -81
  20. package/lib/core/es6/data/Segment.d.ts +2 -0
  21. package/lib/core/es6/data/Segment.js +6 -0
  22. package/lib/core/es6/grid/Core.d.ts +0 -4
  23. package/lib/core/es6/grid/Core.js +28 -105
  24. package/lib/grid/index.js +1 -1
  25. package/lib/index.d.ts +0 -4
  26. package/lib/index.js +0 -4
  27. package/lib/tr-grid-printer/es6/GridPrinter.js +5 -5
  28. package/lib/tr-grid-printer/es6/index.js +1 -1
  29. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +5 -0
  30. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +30 -1
  31. package/lib/tr-grid-util/es6/CoralItems.js +2 -2
  32. package/lib/tr-grid-util/es6/ElfDate.js +1 -1
  33. package/lib/tr-grid-util/es6/ElfUtil.js +2 -2
  34. package/lib/tr-grid-util/es6/ExpanderIcon.js +1 -1
  35. package/lib/tr-grid-util/es6/GridPlugin.js +1 -1
  36. package/lib/tr-grid-util/es6/Icon.js +3 -3
  37. package/lib/tr-grid-util/es6/MultiTableManager.js +3 -3
  38. package/lib/tr-grid-util/es6/RowPainter.js +6 -2
  39. package/lib/tr-grid-util/es6/jet/Adc.d.ts +9 -0
  40. package/lib/tr-grid-util/es6/jet/Adc.js +268 -0
  41. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +96 -7
  42. package/lib/tr-grid-util/es6/jet/MockUtil.d.ts +7 -0
  43. package/lib/tr-grid-util/es6/jet/MockUtil.js +25 -0
  44. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +2 -3
  45. package/lib/tr-grid-util/es6/jet/mockDataAPI.js +3 -288
  46. package/lib/types/es6/Core/data/DataView.d.ts +2 -0
  47. package/lib/types/es6/Core/data/Segment.d.ts +2 -0
  48. package/lib/types/es6/Core/grid/Core.d.ts +0 -4
  49. package/lib/types/es6/RowFiltering.d.ts +5 -0
  50. package/lib/utils/index.d.ts +5 -3
  51. package/lib/utils/index.js +5 -3
  52. package/lib/versions.json +3 -5
  53. package/lib/window-exporter.js +5 -0
  54. package/package.json +1 -1
@@ -1,30 +1,6 @@
1
+ import { Adc } from "./Adc.js";
1
2
  import { DataGenerator } from "./DataGenerator.js";
2
- import { DateTime } from "../DateTime.js";
3
-
4
- /**
5
- * @private
6
- * @type {object}
7
- */
8
- var _invalidFieldDict = {
9
- 'TR.NonExistField': true,
10
- 'TR.NotExistField': true,
11
- 'CF_IGNORE_FIELD': true
12
- };
13
-
14
- /** to mock invalid fields.
15
- * @public
16
- * @param {Array<string>|string} fields ex. TR.NonExistField, CF_IGNORE_FIELD
17
- */
18
- function setInvalidFields(fields) {
19
- if (fields && typeof fields === 'string') {
20
- _invalidFieldDict[fields] = true;
21
- } else if (Array.isArray(fields)) {
22
- for (var i = 0; i < fields.length; i++) {
23
- _invalidFieldDict[fields[i]] = true;
24
- }
25
- }
26
- }
27
-
3
+ import { invalidFieldDict, setInvalidFields } from "./MockUtil.js";
28
4
 
29
5
  var dataGen = new DataGenerator();
30
6
 
@@ -33,11 +9,6 @@ var dataGen = new DataGenerator();
33
9
  */
34
10
  var DataGrid = {};
35
11
 
36
- /** @private
37
- * @namespace
38
- */
39
- var Adc = {};
40
-
41
12
  /** @private
42
13
  * @function
43
14
  * @param {Object} payload
@@ -55,7 +26,7 @@ DataGrid.request = function (payload, mockResponse) {
55
26
 
56
27
  // _invalidFieldDict is a dictionary of non exist field
57
28
  // so we must remove invalid field to make "mocking api" return result more like a "real api".
58
- var invalidDict = _invalidFieldDict;
29
+ var invalidDict = invalidFieldDict;
59
30
  fields = [];
60
31
  for (i = 0; i < payload.fields.length; i++) {
61
32
  f = payload.fields[i];
@@ -116,262 +87,6 @@ DataGrid.request = function (payload, mockResponse) {
116
87
  }));
117
88
  };
118
89
 
119
- /** @private
120
- * @function
121
- * @param {Object} payload
122
- * @param {Object=} mockResponse
123
- * @return {Promise}
124
- */
125
- Adc.request = function (payload, mockResponse) {
126
- if (mockResponse) {
127
- return Promise.resolve(JSON.stringify(mockResponse));
128
- }
129
-
130
- // build row header
131
- var rows = [];
132
- var i, f, len, row, j;
133
- var identifiers, formula, fields, invalidDict;
134
- if(payload.output === "Col,date|,Row,In|,va,T,NoEmptyTickers") {
135
-
136
- identifiers = payload.identifiers;
137
- formula = payload.formula.trim().split(/(?=,TR.)/);// TODO: check each field with another way, this doesn't work when user use some comma (,) formula
138
- fields = [];
139
-
140
- // _invalidFieldDict is a dictionary of non exist field
141
- // so we must remove invalid field to make "mocking api" return result more like a "real api".
142
- invalidDict = _invalidFieldDict;
143
- for (i = 0; i < formula.length; i++) {
144
- f = formula[i];
145
- if (!invalidDict[f]) {
146
- fields.push(f);
147
- }
148
- }
149
-
150
- var fieldCount = fields.length;
151
- // formula = payload.formula.trim().split(",TR"); // TODO: split wit
152
-
153
- rows.push([
154
- {
155
- "h": true,
156
- "i": "instrument",
157
- "v": "Instrument"
158
- },
159
- {
160
- "h": true,
161
- "i": "date",
162
- "v": "Date"
163
- }
164
- ]);
165
-
166
- for (var index = 0; index < fieldCount; index++) {
167
- var timeSeriesField = fields[index];
168
-
169
- var regex = /TR.(.*)(?=\()/;
170
- var result = timeSeriesField.match(regex);
171
- var field = result[0].replace("TR.", "");
172
- var phrase = timeSeriesField.toLowerCase();
173
- var startDateRegex = /sdate=(.*)[,]/;
174
- var endDateRegex = /edate=(.*)[)]/;
175
- var startDateMatch = phrase.match(startDateRegex);
176
- var endDateMatch = phrase.match(endDateRegex);
177
-
178
- var startDate = startDateMatch ? startDateMatch[1] : DateTime.format(new Date(), "YYYY-MM-DD");
179
- var endDate = endDateMatch[1];
180
-
181
- var swapDateTmp;
182
- if(startDate > endDate) {
183
- swapDateTmp = startDate;
184
- startDate = endDate;
185
- endDate = swapDateTmp;
186
- }
187
-
188
- var msBetweenDate = (+new Date(endDate)) - (+new Date(startDate));
189
-
190
- var msInDay = 1000 * 60 * 60 * 24;
191
- var betweenDay = msBetweenDate / msInDay;
192
- // var betweenDay = Math.floor(Math.random() * 10); // For random length
193
-
194
-
195
- for (i = 0; i <= betweenDay; i++) {
196
- var date = new Date(new Date(startDate).setDate(new Date(startDate).getDate() + i));
197
- var fieldValue = {
198
- "h": true,
199
- "v": DateTime.format(date, "YYYY-MM-DDT00:00:00")
200
- };
201
- if(index === 0) { // add header 1 time
202
- rows[0].push(fieldValue);
203
- }
204
- }
205
-
206
- var rics = identifiers;
207
- for (i = 0; i < rics.length; i++) {
208
-
209
- var ric = rics[i];
210
- var rowValue = [
211
- ric,
212
- field
213
- ];
214
- for (j = 1; j <= betweenDay + 1; j++) {
215
- var generatedValue = DataGenerator.generateRecord(field);
216
- rowValue.push(generatedValue[field]);
217
-
218
- }
219
- rows.push(rowValue);
220
- }
221
- // The example rows should be look like
222
- /*
223
- [
224
- [
225
- {
226
- "h": true,
227
- "i": "instrument",
228
- "v": "Instrument"
229
- },
230
- {
231
- "h": true,
232
- "i": "date",
233
- "v": "Date"
234
- },
235
- {
236
- "h": true,
237
- "v": "2011-08-11T00:00:00"
238
- },
239
- {
240
- "h": true,
241
- "v": "2011-08-12T00:00:00"
242
- },
243
- {
244
- "h": true,
245
- "v": "2011-08-15T00:00:00"
246
- }
247
- ],
248
- [
249
- "IBM",
250
- "Price Close", // NOTE: this cannot be detech we join it with space Ex. PriceClose
251
- 159.25449372,
252
- 160.6585848,
253
- 165.23382036
254
- ],
255
- [
256
- "GOOGL.O",
257
- "Price Close",
258
- 14.066881653,
259
- 14.107921423,
260
- 13.944262828
261
- ]
262
- ]
263
- */
264
- }
265
-
266
- } else {
267
-
268
- identifiers = payload.identifiers;
269
- formula = Adc.splitFields(payload.formula);
270
- fields = [];
271
-
272
- // _invalidFieldDict is a dictionary of non exist field
273
- // so we must remove invalid field to make "mocking api" return result more like a "real api".
274
- invalidDict = _invalidFieldDict;
275
- for (i = 0; i < formula.length; i++) {
276
- f = formula[i];
277
- if (!invalidDict[f]) {
278
- fields.push(f);
279
- }
280
- }
281
-
282
- rows[0] = [{
283
- "h": true,
284
- "i": "instrument",
285
- "v": "Instrument"
286
- }];
287
- for (i = 0; i < fields.length; i++) {
288
- f = fields[i];
289
- rows[0].push({
290
- "h": true,
291
- "r": f.toUpperCase().trim()
292
- // "v": "Price Close", // Doesn't use
293
- // "p": "I_TRP_PH_PriceClose" // Doesn't use this property
294
- });
295
- }
296
-
297
- // build data
298
- var rowMap = {};
299
-
300
- len = identifiers.length;
301
- var rowData = dataGen.generate(fields, len);
302
- for (i = 0; i < len; ++i) {
303
- var inst = identifiers[i];
304
- row = rowMap[inst];
305
- if (!row) {
306
- row = rowMap[inst] = rowData[i];
307
- row.unshift(inst); // prepend instrument on each row
308
- }
309
- rows.push(row);
310
- }
311
-
312
- // There is a chance that rtk will return multiple row data per instrument
313
- // so we must create mock up for this case
314
- if (rows.length > 0) {
315
- var chance = dataGen.randInt(1, 10);
316
- if (chance <= 3) { // chance 30%
317
- var pos = dataGen.randInt(0, rows.length - 1); // random row pos
318
- row = rows[pos];
319
- len = row.length;
320
- var mockupRow = new Array(len);
321
- mockupRow[0] = row[0]; // 1st index is for instrument
322
- for (i = 1; i < len; i++) {
323
- mockupRow[i] = ''; // real case will return null or empty string
324
- }
325
- rows.splice(pos + 1, 0, mockupRow);
326
- }
327
- }
328
- }
329
-
330
-
331
- /*
332
- response type is :
333
- {
334
- cols: number,
335
- faults: Array<obj>,
336
- rows: Array<obj>,
337
- status: string
338
- }
339
- Currently, we use only the rows property for cache ADC data
340
- */
341
- return Promise.resolve(JSON.stringify({
342
- rows: rows
343
- // TODO : supports faults property
344
- }));
345
- };
346
-
347
- /**
348
- * Splits a string of comma-separated fields into an array of individual field names with optional parentheses and contents.
349
- *
350
- * @param {string} strFields - The string of comma-separated fields to split.
351
- * @returns {Array<string>} - An array of individual field names with optional parentheses and contents.
352
- */
353
- Adc.splitFields = function(strFields) {
354
- if(!strFields) {
355
- return [];
356
- }
357
-
358
- // Split the input string using the regular expression
359
- // regex is match commas that are not inside parentheses
360
- /*
361
- , - matches a comma
362
- (?![^()]*\) - negative lookahead assertion that matches if the comma is not followed by:
363
- [^()]* - any characters that are not opening or closing parentheses
364
- \) - a closing parenthesis
365
- ) - ending delimiter of the regular expression
366
- */
367
- var fields = strFields.split(/,(?![^()]*\))/);
368
- fields = fields.map(function(field) {
369
- return field.trim();
370
- });
371
-
372
- return fields;
373
- };
374
-
375
90
  /** @public
376
91
  * @function
377
92
  * @param {string} dataType
@@ -274,6 +274,8 @@ declare class DataView extends EventDispatcher {
274
274
 
275
275
  public sortSegments(compare: ((...params: any[]) => any)|null): void;
276
276
 
277
+ public enableEmptySegmentFiltering(enabled?: boolean|null): void;
278
+
277
279
  public setSegmentClassification(segmentRef: string|number|null, fields: string|(string)[]|null): boolean;
278
280
 
279
281
  public getWrapSize(): number;
@@ -27,6 +27,8 @@ declare class Segment extends EventDispatcher {
27
27
 
28
28
  public getChildIds(): (string)[];
29
29
 
30
+ public getChildren(): any;
31
+
30
32
  public getChildCount(): number;
31
33
 
32
34
  public getClassification(): (string)[]|null;
@@ -405,10 +405,6 @@ declare class Core extends ElementWrapper {
405
405
 
406
406
  public getColumnGroupChildIds(groupId: string): (string)[]|null;
407
407
 
408
- public getValidColumnList(colIds: (string)[]|null, columnMap?: any): (string)[];
409
-
410
- public createColumnMap(colIds?: (string)[]|null): any;
411
-
412
408
  public startBatch(batchType: string): boolean;
413
409
 
414
410
  public stopBatch(batchType: string): boolean;
@@ -33,6 +33,7 @@ declare namespace RowFilteringPlugin {
33
33
  };
34
34
 
35
35
  type Options = {
36
+ emptySegmentFiltering?: boolean|null,
36
37
  disabledUI?: boolean|null,
37
38
  iconActivation?: string|null,
38
39
  dialogOptions?: RowFilteringPlugin.FilterDialogOptions|null,
@@ -114,9 +115,13 @@ declare class RowFilteringPlugin extends GridPlugin {
114
115
 
115
116
  public openDialog(colIndex: number, runtimeDialogOptions?: RowFilteringPlugin.FilterDialogOptions|null): void;
116
117
 
118
+ public enableEmptySegmentFiltering(enabled?: boolean|null): void;
119
+
117
120
  }
118
121
 
119
122
  declare function field(colIndex: number, exp: RowFilteringPlugin.Expression|null, ctx?: (any|string)|null): boolean;
120
123
 
124
+ declare function crf(enabled?: boolean|null): void;
125
+
121
126
  export default RowFilteringPlugin;
122
127
  export { RowFilteringPlugin, RowFilteringPlugin as RowFiltering, RowFilteringPlugin as RowFilteringExtension };
@@ -1,3 +1,5 @@
1
- import {DataGenerator} from "../tr-grid-util/es6/jet/DataGenerator.js"
2
- import {MockRTK} from "../tr-grid-util/es6/jet/MockRTK.js"
3
- export {DataGenerator, MockRTK}
1
+ import { GridPrinter } from "../tr-grid-printer/es6/GridPrinter.js";
2
+ import { MultiTableManager } from "../tr-grid-util/es6/MultiTableManager.js";
3
+ import { DataGenerator } from "../tr-grid-util/es6/jet/DataGenerator.js";
4
+ import { MockRTK } from "../tr-grid-util/es6/jet/MockRTK.js";
5
+ export { GridPrinter, MultiTableManager, DataGenerator, MockRTK };
@@ -1,3 +1,5 @@
1
- import {DataGenerator} from "../tr-grid-util/es6/jet/DataGenerator.js"
2
- import {MockRTK} from "../tr-grid-util/es6/jet/MockRTK.js"
3
- export {DataGenerator, MockRTK}
1
+ import { GridPrinter } from "../tr-grid-printer/es6/GridPrinter.js";
2
+ import { MultiTableManager } from "../tr-grid-util/es6/MultiTableManager.js";
3
+ import { DataGenerator } from "../tr-grid-util/es6/jet/DataGenerator.js";
4
+ import { MockRTK } from "../tr-grid-util/es6/jet/MockRTK.js";
5
+ export { GridPrinter, MultiTableManager, DataGenerator, MockRTK };
package/lib/versions.json CHANGED
@@ -1,5 +1,4 @@
1
1
  {
2
- "tr-grid-util": "1.3.111",
3
2
  "@grid/column-dragging": "1.0.14",
4
3
  "@grid/row-segmenting": "1.0.24",
5
4
  "@grid/statistics-row": "1.0.14",
@@ -21,17 +20,16 @@
21
20
  "tr-grid-in-cell-editing": "1.0.78",
22
21
  "tr-grid-pagination": "1.0.24",
23
22
  "tr-grid-percent-bar": "1.0.22",
24
- "tr-grid-printer": "1.0.16",
25
23
  "tr-grid-range-bar": "2.0.4",
26
24
  "tr-grid-row-dragging": "1.0.29",
27
- "tr-grid-row-filtering": "1.0.56",
28
- "tr-grid-row-grouping": "1.0.80",
25
+ "tr-grid-row-filtering": "1.0.57",
26
+ "tr-grid-row-grouping": "1.0.81",
29
27
  "tr-grid-row-selection": "1.0.23",
30
28
  "tr-grid-rowcoloring": "1.0.23",
31
29
  "tr-grid-textformatting": "1.0.45",
32
30
  "tr-grid-titlewrap": "1.0.19",
33
31
  "@grid/formatters": "1.0.50",
34
- "@grid/column-selection-dialog": "4.0.48",
32
+ "@grid/column-selection-dialog": "4.0.49",
35
33
  "@grid/filter-dialog": "4.0.57",
36
34
  "@grid/column-format-dialog": "4.0.44"
37
35
  }
@@ -1,4 +1,5 @@
1
1
  import * as allComponents from './index.js';
2
+ import * as utils from './utils/index.js';
2
3
  import { MockJET } from './tr-grid-util/es6/jet/MockJET.js';
3
4
  import { MockRTK } from './tr-grid-util/es6/jet/MockRTK.js';
4
5
  import { MockQuotes2 } from './tr-grid-util/es6/jet/MockQuotes2.js';
@@ -11,3 +12,7 @@ window.MockQuotes2 = MockQuotes2;
11
12
  for (const component in allComponents) {
12
13
  window[component] = allComponents[component];
13
14
  }
15
+
16
+ for (const util in utils) {
17
+ window[util] = utils[util];
18
+ }
package/package.json CHANGED
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "version": "6.0.44"
69
+ "version": "6.0.46"
70
70
  }