@refinitiv-ui/efx-grid 6.0.86 → 6.0.88
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.
- package/lib/column-dragging/es6/ColumnDragging.js +55 -0
- package/lib/column-format-dialog/lib/column-format-dialog.js +5 -8
- package/lib/column-format-dialog/lib/preview-table.d.ts +1 -1
- package/lib/column-format-dialog/lib/preview-table.js +15 -15
- package/lib/column-selection-dialog/themes/base.less +0 -1
- package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/core/dist/core.js +8 -2
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataView.js +1 -1
- package/lib/core/es6/grid/Core.d.ts +2 -0
- package/lib/core/es6/grid/Core.js +7 -1
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +789 -712
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.js +70 -70
- package/lib/rt-grid/es6/DataConnector.js +26 -26
- package/lib/rt-grid/es6/FieldDefinition.js +27 -27
- package/lib/rt-grid/es6/Grid.js +385 -376
- package/lib/rt-grid/es6/PredefinedFormula.js +1 -1
- package/lib/rt-grid/es6/ReferenceCounter.js +15 -15
- package/lib/rt-grid/es6/RowDefSorter.js +26 -26
- package/lib/rt-grid/es6/RowDefinition.d.ts +5 -2
- package/lib/rt-grid/es6/RowDefinition.js +106 -77
- package/lib/rt-grid/es6/SnapshotFiller.js +77 -77
- package/lib/rt-grid/es6/StyleLoader.js +1 -1
- package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +18 -18
- package/lib/tr-grid-percent-bar/es6/PercentBar.js +4 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.js +4 -1
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +31 -19
- package/lib/tr-grid-util/es6/DragUI.js +2 -1
- package/lib/types/es6/Checkbox.d.ts +2 -0
- package/lib/types/es6/Core/grid/Core.d.ts +2 -0
- package/lib/types/es6/PercentBar.d.ts +18 -18
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +5 -2
- package/lib/types/es6/RowFiltering.d.ts +2 -0
- package/lib/versions.json +7 -7
- package/package.json +1 -1
@@ -9,7 +9,7 @@ import { isEmptyObject } from "../../tr-grid-util/es6/Util.js";
|
|
9
9
|
* @constructor
|
10
10
|
* @extends {EventDispatcher}
|
11
11
|
*/
|
12
|
-
|
12
|
+
let SnapshotFiller = function () {
|
13
13
|
this._onRequest = this._onRequest.bind(this);
|
14
14
|
|
15
15
|
this._rics = {};
|
@@ -92,16 +92,16 @@ SnapshotFiller.clearMockAdc = function() {
|
|
92
92
|
*/
|
93
93
|
SnapshotFiller.prototype.setADCOptions = function (adcOptions) {
|
94
94
|
|
95
|
-
|
95
|
+
let val = adcOptions["productId"];
|
96
96
|
if(val) {
|
97
97
|
this._adcOptions.productId = val;
|
98
98
|
}
|
99
99
|
// TODO: support requesting level parameter https://confluence.refinitiv.com/display/ADC/Request+level+parameters
|
100
|
-
//
|
100
|
+
// let val = adcOptions["lang"];
|
101
101
|
// if(val) {
|
102
102
|
// this._adcOptions.lang = val;
|
103
103
|
// }
|
104
|
-
//
|
104
|
+
// let val = adcOptions["cache"];
|
105
105
|
// if(val) {
|
106
106
|
// this._adcOptions.cache = val;
|
107
107
|
// }
|
@@ -129,10 +129,10 @@ SnapshotFiller.prototype.addRic = function (ric) {
|
|
129
129
|
* @return {boolean}
|
130
130
|
*/
|
131
131
|
SnapshotFiller.prototype.addRics = function (rics) {
|
132
|
-
|
133
|
-
|
134
|
-
for(
|
135
|
-
|
132
|
+
let len = rics ? rics.length : 0;
|
133
|
+
let dirty = false;
|
134
|
+
for(let i = 0; i < len; ++i) {
|
135
|
+
let ric = rics[i];
|
136
136
|
if (ric && !this._rics[ric]) {
|
137
137
|
this._rics[ric] = 1;
|
138
138
|
dirty = true;
|
@@ -157,9 +157,9 @@ SnapshotFiller.prototype.addField = function (str) {
|
|
157
157
|
* @return {boolean}
|
158
158
|
*/
|
159
159
|
SnapshotFiller.prototype.addFields = function (fields) {
|
160
|
-
|
161
|
-
|
162
|
-
for(
|
160
|
+
let len = fields.length;
|
161
|
+
let dirty = 0;
|
162
|
+
for(let i = 0; i < len; ++i) {
|
163
163
|
dirty |= this._addField(fields[i]);
|
164
164
|
}
|
165
165
|
if(dirty) {
|
@@ -204,7 +204,7 @@ SnapshotFiller.prototype._request = function () {
|
|
204
204
|
SnapshotFiller.prototype._onRequest = function () {
|
205
205
|
this._timerId = 0;
|
206
206
|
|
207
|
-
|
207
|
+
let jet = window["JET"]; // Assume that JET is already exist.
|
208
208
|
if (this._rtk) {
|
209
209
|
if (!this._rtk.Data) {
|
210
210
|
return; // Require RTK.Data plugin to get snapshot data
|
@@ -214,20 +214,20 @@ SnapshotFiller.prototype._onRequest = function () {
|
|
214
214
|
}
|
215
215
|
|
216
216
|
// Retrieve instruments and ADC fields
|
217
|
-
|
217
|
+
let instruments = Object.keys(this._rics);
|
218
218
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
for (
|
219
|
+
let i;
|
220
|
+
let fields = [];
|
221
|
+
let timeSeriesFields = [];
|
222
|
+
for (let field in this._fields) {
|
223
223
|
if(!FieldDefinition.isTimeSeries(field)) {
|
224
224
|
fields.push(field);
|
225
225
|
} else {
|
226
226
|
timeSeriesFields.push(field);
|
227
227
|
}
|
228
228
|
}
|
229
|
-
|
230
|
-
|
229
|
+
let fieldLen = fields.length;
|
230
|
+
let timeSeriesFieldLen = timeSeriesFields.length;
|
231
231
|
|
232
232
|
if ( (!fieldLen && !timeSeriesFieldLen ) || !instruments.length) { // No ADC field or real-time RIC
|
233
233
|
return;
|
@@ -237,13 +237,13 @@ SnapshotFiller.prototype._onRequest = function () {
|
|
237
237
|
this._rics = {};
|
238
238
|
this._fields = {};
|
239
239
|
|
240
|
-
|
240
|
+
let onSuccess, payload;
|
241
241
|
if (this._rtk) {
|
242
|
-
|
242
|
+
let strFields;
|
243
243
|
// Request time serie fields
|
244
244
|
if(timeSeriesFields.length > 0) {
|
245
245
|
// request time series field
|
246
|
-
|
246
|
+
let strtTimeSeriesFields = timeSeriesFields.join(',');
|
247
247
|
payload = {
|
248
248
|
"method": "select",
|
249
249
|
"formula": strtTimeSeriesFields,
|
@@ -252,7 +252,7 @@ SnapshotFiller.prototype._onRequest = function () {
|
|
252
252
|
"output": "Col,date|,Row,In|,va,T,NoEmptyTickers" // For customize output server, for more information please visit "https://confluence.refinitiv.com/display/ADC/Data+Cloud+Output+Format"
|
253
253
|
};
|
254
254
|
onSuccess = this._onRTKTimeSeriesSuccess.bind(this, timeSeriesFields);
|
255
|
-
|
255
|
+
let responseMockAdc = SnapshotFiller.getMockAdc(payload.formula);
|
256
256
|
if(responseMockAdc) {
|
257
257
|
setTimeout(function() {
|
258
258
|
onSuccess(responseMockAdc);
|
@@ -288,7 +288,7 @@ SnapshotFiller.prototype._onRequest = function () {
|
|
288
288
|
|
289
289
|
|
290
290
|
} else {
|
291
|
-
|
291
|
+
let reqFields = [];
|
292
292
|
for(i = 0; i < fieldLen; i++) {
|
293
293
|
reqFields.push({ "name": fields[i] });
|
294
294
|
}
|
@@ -314,8 +314,8 @@ SnapshotFiller.prototype._onRequest = function () {
|
|
314
314
|
*/
|
315
315
|
SnapshotFiller.prototype._onJETSuccess = function (fields, serverResult) {
|
316
316
|
this._dispatch("adcDataReceived", serverResult);
|
317
|
-
|
318
|
-
|
317
|
+
let data2D = serverResult["data"];
|
318
|
+
let svHeaders = serverResult["headers"] && serverResult["headers"][0];
|
319
319
|
|
320
320
|
if (!Array.isArray(data2D) || !Array.isArray(svHeaders)) {
|
321
321
|
return; //TODO: Return Promise.reject(errMsg);
|
@@ -325,11 +325,11 @@ SnapshotFiller.prototype._onJETSuccess = function (fields, serverResult) {
|
|
325
325
|
// Server will return field only in UPPERCASE
|
326
326
|
// ex. requestField = TR.Volume ===> serverField = TR.VOLUME
|
327
327
|
// so we need convert UPPERCASE to be original
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
328
|
+
let i, field, ric;
|
329
|
+
let j = 1; // to skip instrument index, use j = 1
|
330
|
+
let fLength = fields.length;
|
331
|
+
let hLength = svHeaders.length;
|
332
|
+
let headers = new Array(hLength);
|
333
333
|
for (i = 0; i < fLength && j < hLength; i++) {
|
334
334
|
field = fields[i];
|
335
335
|
if (svHeaders[j].field === field.toUpperCase()) {
|
@@ -338,24 +338,24 @@ SnapshotFiller.prototype._onJETSuccess = function (fields, serverResult) {
|
|
338
338
|
}
|
339
339
|
}
|
340
340
|
|
341
|
-
|
342
|
-
|
343
|
-
|
341
|
+
let len = data2D.length;
|
342
|
+
let fieldLen = headers.length;
|
343
|
+
let ricMap = {};
|
344
344
|
|
345
345
|
// TODO: Freeze the data view before setting multiple data
|
346
346
|
for (i = 0; i < len; i++) {
|
347
|
-
|
347
|
+
let dataRow = data2D[i];
|
348
348
|
ric = dataRow[0];
|
349
349
|
|
350
350
|
if (ricMap[ric]) {
|
351
351
|
continue; // we interested only first row of ric
|
352
352
|
}
|
353
353
|
|
354
|
-
|
354
|
+
let snapData = ricMap[ric] = {};
|
355
355
|
|
356
356
|
// loop for create rowData for update
|
357
357
|
for (j = 1; j < fieldLen; j++) { // to skip instrument index, use j = 1
|
358
|
-
|
358
|
+
let value = dataRow[j];
|
359
359
|
if (value != null && value !== "") {
|
360
360
|
field = headers[j];
|
361
361
|
snapData[field] = value;
|
@@ -364,9 +364,9 @@ SnapshotFiller.prototype._onJETSuccess = function (fields, serverResult) {
|
|
364
364
|
}
|
365
365
|
|
366
366
|
// return result only ric that has update data
|
367
|
-
|
367
|
+
let updatedData = {};
|
368
368
|
for (ric in ricMap) {
|
369
|
-
|
369
|
+
let obj = ricMap[ric];
|
370
370
|
if (!isEmptyObject(obj)) {
|
371
371
|
updatedData[ric] = obj;
|
372
372
|
}
|
@@ -384,8 +384,8 @@ SnapshotFiller.prototype._onJETSuccess = function (fields, serverResult) {
|
|
384
384
|
*/
|
385
385
|
SnapshotFiller.prototype._onRTKSuccess = function (fields, serverResult) {
|
386
386
|
this._dispatch("adcDataReceived", serverResult);
|
387
|
-
|
388
|
-
|
387
|
+
let data2D = serverResult["rows"];
|
388
|
+
let svHeaders = serverResult["rows"] && serverResult["rows"][0];
|
389
389
|
if (!Array.isArray(data2D) || !Array.isArray(svHeaders)) {
|
390
390
|
return; //TODO: Return Promise.reject(errMsg);
|
391
391
|
}
|
@@ -393,11 +393,11 @@ SnapshotFiller.prototype._onRTKSuccess = function (fields, serverResult) {
|
|
393
393
|
// Server will return field only in UPPERCASE
|
394
394
|
// ex. requestField = TR.Volume ===> serverField = TR.VOLUME
|
395
395
|
// so we need convert UPPERCASE to be original
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
396
|
+
let i, field, ric;
|
397
|
+
let j = 1; // to skip instrument index, use j = 1
|
398
|
+
let fLength = fields.length;
|
399
|
+
let hLength = svHeaders.length;
|
400
|
+
let headers = new Array(hLength);
|
401
401
|
for (i = 0; i < fLength && j < hLength; i++) {
|
402
402
|
field = fields[i];
|
403
403
|
if (svHeaders[j].r.toUpperCase() === field.toUpperCase()) {
|
@@ -406,23 +406,23 @@ SnapshotFiller.prototype._onRTKSuccess = function (fields, serverResult) {
|
|
406
406
|
}
|
407
407
|
}
|
408
408
|
|
409
|
-
|
410
|
-
|
411
|
-
|
409
|
+
let len = data2D.length;
|
410
|
+
let fieldLen = headers.length;
|
411
|
+
let ricMap = {};
|
412
412
|
|
413
413
|
// TODO: Freeze the data view before setting multiple data
|
414
414
|
for (i = 1; i < len; i++) { // to skip column header index, use i = 1
|
415
|
-
|
415
|
+
let dataRow = data2D[i];
|
416
416
|
ric = dataRow[0];
|
417
417
|
|
418
418
|
if (ricMap[ric]) {
|
419
419
|
continue; // we interested only first row of ric
|
420
420
|
}
|
421
|
-
|
421
|
+
let snapData = ricMap[ric] = {};
|
422
422
|
|
423
423
|
// loop for create rowData for update
|
424
424
|
for (j = 1; j < fieldLen; j++) { // to skip instrument index, use j = 1
|
425
|
-
|
425
|
+
let value = dataRow[j];
|
426
426
|
if (value != null && value !== "") {
|
427
427
|
if(typeof value !== 'object') {
|
428
428
|
field = headers[j];
|
@@ -437,9 +437,9 @@ SnapshotFiller.prototype._onRTKSuccess = function (fields, serverResult) {
|
|
437
437
|
}
|
438
438
|
|
439
439
|
// return result only ric that has update data
|
440
|
-
|
440
|
+
let updatedData = {};
|
441
441
|
for (ric in ricMap) {
|
442
|
-
|
442
|
+
let obj = ricMap[ric];
|
443
443
|
if (!isEmptyObject(obj)) {
|
444
444
|
updatedData[ric] = obj;
|
445
445
|
}
|
@@ -460,45 +460,45 @@ SnapshotFiller.prototype._onRTKTimeSeriesSuccess = function (fields, serverResul
|
|
460
460
|
|
461
461
|
// TODO: noti the user for change structure
|
462
462
|
this._dispatch("adcDataReceived", serverResult);
|
463
|
-
|
464
|
-
|
463
|
+
let data2D = serverResult["rows"];
|
464
|
+
let svHeaders = serverResult["rows"] && serverResult["rows"][0];
|
465
465
|
if (!Array.isArray(data2D) || !Array.isArray(svHeaders)) {
|
466
466
|
return; // TODO: Return Promise.reject(errMsg);
|
467
467
|
}
|
468
468
|
// Extract header dates
|
469
|
-
|
469
|
+
let headerDates = svHeaders.slice(2).map(header => header.v);
|
470
470
|
// Create necessary variables
|
471
|
-
|
472
|
-
|
471
|
+
let fileNameToTSField = {};
|
472
|
+
let count = 0;
|
473
473
|
// Convert map to fieldMap
|
474
|
-
|
475
|
-
for (
|
476
|
-
|
477
|
-
|
474
|
+
let data2DLength = data2D.length;
|
475
|
+
for (let i = 1; i < data2DLength; i++) {
|
476
|
+
let dataRow = data2D[i];
|
477
|
+
let fieldName = dataRow[1];
|
478
478
|
if (!fileNameToTSField[fieldName]) {
|
479
479
|
fileNameToTSField[fieldName] = fields[count++];
|
480
480
|
}
|
481
481
|
}
|
482
482
|
// Process data and populate ricMap and childrenFieldToParent
|
483
|
-
|
484
|
-
|
485
|
-
for (
|
486
|
-
|
487
|
-
|
488
|
-
|
483
|
+
let ricMap = {};
|
484
|
+
let childrenFieldToParent = {};
|
485
|
+
for (let i = 1; i < data2DLength; i++) {
|
486
|
+
let dataRow = data2D[i];
|
487
|
+
let ric = dataRow[0];
|
488
|
+
let fieldName = dataRow[1];
|
489
489
|
|
490
490
|
if (!ricMap[ric]) {
|
491
491
|
ricMap[ric] = {};
|
492
492
|
}
|
493
|
-
|
493
|
+
let snapData = ricMap[ric];
|
494
494
|
if (headerDates.length === 1) {
|
495
495
|
// Time series with only 1 column, it will be a normal adc field
|
496
496
|
snapData[fileNameToTSField[fieldName]] = dataRow[2];
|
497
497
|
} else {
|
498
498
|
// Multiple columns, it will be a time series field
|
499
|
-
for (
|
500
|
-
|
501
|
-
|
499
|
+
for (let k = 0; k < headerDates.length; k++) {
|
500
|
+
let field = fileNameToTSField[fieldName].replace("TR.", "") + "_" + headerDates[k];
|
501
|
+
let celLData = dataRow[2 + k];
|
502
502
|
if(celLData !== null) {
|
503
503
|
childrenFieldToParent[field] = fileNameToTSField[fieldName];
|
504
504
|
snapData[field] = celLData;
|
@@ -508,16 +508,16 @@ SnapshotFiller.prototype._onRTKTimeSeriesSuccess = function (fields, serverResul
|
|
508
508
|
}
|
509
509
|
|
510
510
|
// Return result only for ric that has updated data
|
511
|
-
|
512
|
-
for (
|
513
|
-
|
511
|
+
let dataMapping = {};
|
512
|
+
for (let ric in ricMap) {
|
513
|
+
let obj = ricMap[ric];
|
514
514
|
if (!isEmptyObject(obj)) {
|
515
515
|
dataMapping[ric] = obj;
|
516
516
|
}
|
517
517
|
}
|
518
518
|
|
519
519
|
// Dispatch events based on the header length
|
520
|
-
|
520
|
+
let eventData = {
|
521
521
|
data: dataMapping,
|
522
522
|
};
|
523
523
|
if (headerDates.length > 1) {
|
@@ -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
|
|
@@ -264,6 +264,10 @@ PercentBarPlugin.prototype.getColumnConfigObject = function (colIndex, out_obj)
|
|
264
264
|
percentBar.autoFitting = opt.autoFitting;
|
265
265
|
}
|
266
266
|
|
267
|
+
if (opt.zeroValueHidden != null) {
|
268
|
+
percentBar.zeroValueHidden = opt.zeroValueHidden;
|
269
|
+
}
|
270
|
+
|
267
271
|
return out_obj;
|
268
272
|
};
|
269
273
|
/** Get a current state of grid and extension config
|
@@ -1,4 +1,4 @@
|
|
1
|
-
function _typeof(
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
2
|
import { Ext } from '../../tr-grid-util/es6/Ext.js';
|
3
3
|
import { GridPlugin } from '../../tr-grid-util/es6/GridPlugin.js';
|
4
4
|
import { ElfUtil } from '../../tr-grid-util/es6/ElfUtil.js';
|
@@ -477,6 +477,9 @@ RangeBarPlugin.prototype._onPostSectionBinding = function (e) {
|
|
477
477
|
continue;
|
478
478
|
}
|
479
479
|
var rowData = this._getRowData(dataRows[r]);
|
480
|
+
if (!rowData) {
|
481
|
+
continue;
|
482
|
+
}
|
480
483
|
var rangeBarData = _getRangeBarData(rBarOpt, rowData);
|
481
484
|
var low = rangeBarData.low;
|
482
485
|
var last = rangeBarData.last;
|
@@ -77,6 +77,8 @@ declare class RowFilteringPlugin extends GridPlugin {
|
|
77
77
|
|
78
78
|
public setColumnFilter(colIndex: number, exp: RowFilteringPlugin.Expression|null, ctx?: (any|string)|null): boolean;
|
79
79
|
|
80
|
+
public getColumnFilterExpression(colIndex: number): RowFilteringPlugin.Expression|null;
|
81
|
+
|
80
82
|
public removeFilter(funcRef: ((...params: any[]) => any)|string|null): boolean;
|
81
83
|
|
82
84
|
public removeColumnFilters(colIndex: number): boolean;
|
@@ -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
|
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
|
-
//
|
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];
|
@@ -680,7 +696,7 @@ RowFilteringPlugin.prototype.addColumnFilter = function (colIndex, exp, ctx) {
|
|
680
696
|
* );
|
681
697
|
*/
|
682
698
|
RowFilteringPlugin.prototype.setColumnFilter = function (colIndex, exp, ctx) {
|
683
|
-
var curExp = this.
|
699
|
+
var curExp = this.getColumnFilterExpression(colIndex);
|
684
700
|
if (curExp === exp) {
|
685
701
|
return false;
|
686
702
|
}
|
@@ -691,11 +707,11 @@ RowFilteringPlugin.prototype.setColumnFilter = function (colIndex, exp, ctx) {
|
|
691
707
|
}
|
692
708
|
return removed || added;
|
693
709
|
};
|
694
|
-
/** @
|
710
|
+
/** @public
|
695
711
|
* @param {number} colIndex
|
696
712
|
* @return {RowFilteringPlugin~Expression}
|
697
713
|
*/
|
698
|
-
RowFilteringPlugin.prototype.
|
714
|
+
RowFilteringPlugin.prototype.getColumnFilterExpression = function (colIndex) {
|
699
715
|
var colSettings = this._getUserColumnSettings(colIndex);
|
700
716
|
return colSettings.expression || null;
|
701
717
|
};
|
@@ -705,14 +721,14 @@ RowFilteringPlugin.prototype._getColumnExpression = function (colIndex) {
|
|
705
721
|
* @param {RowFilteringPlugin~ColumnOptions} userObj
|
706
722
|
* @returns {boolean} Returns true if there is an active filter in the column options
|
707
723
|
* @example
|
708
|
-
*
|
724
|
+
* let colDef1 = {
|
709
725
|
* "field": "PCTCHNG",
|
710
726
|
* "filter": [["GT", 0]]
|
711
727
|
* };
|
712
|
-
*
|
728
|
+
* let colDef2 = {
|
713
729
|
* "filter": "[PCTCHNG] > 0"
|
714
730
|
* };
|
715
|
-
*
|
731
|
+
* let colDef3 = {
|
716
732
|
* "filter": function(rowData) {
|
717
733
|
* return rowData["PCTCHNG"] > 0;
|
718
734
|
* }
|
@@ -983,7 +999,7 @@ RowFilteringPlugin.prototype.getAllColumnFilters = function () {
|
|
983
999
|
RowFilteringPlugin.prototype.getFilterExpressions = function () {
|
984
1000
|
if (this._columnFilters.length) {
|
985
1001
|
// TODO: Provide a way to save rawDataAccessor and formattedDataAccessor
|
986
|
-
return this._columnFilters.map(
|
1002
|
+
return this._columnFilters.map(_toFilterExpression);
|
987
1003
|
}
|
988
1004
|
return null;
|
989
1005
|
};
|
@@ -1216,7 +1232,7 @@ RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
|
|
1216
1232
|
var noFilterIcon = this._disabled || iconActivation === "none" || onActiveFilter && !hasFilter;
|
1217
1233
|
if (!noFilterIcon) {
|
1218
1234
|
if (!cell._filterIcon) {
|
1219
|
-
var filterIcon;
|
1235
|
+
var filterIcon = void 0;
|
1220
1236
|
if (ElfUtil.hasComponent("ef-icon") >= 3) {
|
1221
1237
|
filterIcon = document.createElement("ef-icon");
|
1222
1238
|
filterIcon.setAttribute("icon", "filter");
|
@@ -1483,14 +1499,7 @@ RowFilteringPlugin.prototype._getUniqueValues = function (field, dialogConfig, f
|
|
1483
1499
|
}
|
1484
1500
|
}
|
1485
1501
|
}
|
1486
|
-
|
1487
|
-
if (Array.isArray(additionalItems)) {
|
1488
|
-
if (userItemList) {
|
1489
|
-
userItemList = userItemList.concat(additionalItems);
|
1490
|
-
} else {
|
1491
|
-
userItemList = additionalItems;
|
1492
|
-
}
|
1493
|
-
}
|
1502
|
+
userItemList = _arrayConcat(userItemList, dialogConfig.additionalItems);
|
1494
1503
|
var dummyRow = {};
|
1495
1504
|
var userItemCount = userItemList ? userItemList.length : 0;
|
1496
1505
|
for (var i = 0; i < userItemCount; ++i) {
|
@@ -1699,6 +1708,9 @@ RowFilteringPlugin.prototype.openDialog = function (colIndex, runtimeDialogOptio
|
|
1699
1708
|
if (cfo._filters && cfo._filters.length) {
|
1700
1709
|
filterFuncs = cfo._filters;
|
1701
1710
|
}
|
1711
|
+
if (_typeof(exp) === "object") {
|
1712
|
+
dialogConfig.additionalItems = _arrayConcat(dialogConfig.additionalItems, Object.keys(exp));
|
1713
|
+
}
|
1702
1714
|
}
|
1703
1715
|
}
|
1704
1716
|
var selectedItems = {};
|
@@ -1916,7 +1928,7 @@ RowFilteringPlugin.prototype._onDialogFilterChanged = function (e) {
|
|
1916
1928
|
var atLeastOne = false;
|
1917
1929
|
for (var i = 0; i < selCount; ++i) {
|
1918
1930
|
var formattedVal = selAry[i].title; // title is defined by the multi-select element
|
1919
|
-
//
|
1931
|
+
// let selIdx = selAry[i].index; // index cannot be used due to filtering
|
1920
1932
|
if (selAry[i].value === BLANKS) {
|
1921
1933
|
if (!ctx) {
|
1922
1934
|
ctx = {};
|
@@ -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;",
|
@@ -76,5 +76,7 @@ declare class CheckboxPlugin extends GridPlugin {
|
|
76
76
|
|
77
77
|
declare function val(gridOptions?: any): any;
|
78
78
|
|
79
|
+
declare function newState(sectionRef: any, rowIndex: number, context?: any): void;
|
80
|
+
|
79
81
|
export default CheckboxPlugin;
|
80
82
|
export { CheckboxPlugin, CheckboxPlugin as Checkbox, CheckboxPlugin as CheckboxExtension };
|
@@ -245,6 +245,8 @@ declare class Core extends ElementWrapper {
|
|
245
245
|
|
246
246
|
public freezeSection(opt_frozenSection?: (string|number|null)|null): void;
|
247
247
|
|
248
|
+
public resetSectionFreezing(): void;
|
249
|
+
|
248
250
|
public freezeFooter(frozenCount: number): void;
|
249
251
|
|
250
252
|
public getFooterCount(): number;
|
@@ -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
|
|