@refinitiv-ui/efx-grid 6.0.140 → 6.0.142
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/core/dist/core.js +99 -28
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataTable.d.ts +5 -1
- package/lib/core/es6/data/DataTable.js +38 -8
- package/lib/core/es6/data/DataView.d.ts +2 -0
- package/lib/core/es6/data/DataView.js +8 -0
- package/lib/core/es6/data/Segment.d.ts +1 -1
- package/lib/core/es6/data/Segment.js +16 -4
- package/lib/core/es6/data/SegmentCollection.d.ts +2 -0
- package/lib/core/es6/data/SegmentCollection.js +21 -10
- package/lib/core/es6/grid/Core.js +1 -1
- package/lib/core/es6/grid/components/Cell.js +9 -3
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +2 -0
- package/lib/core/es6/grid/components/ElementWrapper.js +6 -2
- package/lib/grid/index.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +8 -1
- package/lib/row-segmenting/es6/RowSegmenting.js +88 -23
- package/lib/rt-grid/dist/rt-grid.js +607 -566
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.js +37 -14
- package/lib/rt-grid/es6/RowDefinition.d.ts +1 -1
- package/lib/rt-grid/es6/RowDefinition.js +11 -3
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +1 -1
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +2 -3
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -1
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +18 -3
- package/lib/tr-grid-util/es6/CellPainter.d.ts +1 -7
- package/lib/tr-grid-util/es6/CellPainter.js +51 -74
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +2 -0
- package/lib/tr-grid-util/es6/ElfUtil.js +11 -1
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +2 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +38 -8
- package/lib/types/es6/ConditionalColoring.d.ts +1 -1
- package/lib/types/es6/Core/data/DataTable.d.ts +5 -1
- package/lib/types/es6/Core/data/DataView.d.ts +2 -0
- package/lib/types/es6/Core/data/Segment.d.ts +1 -1
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +2 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +1 -1
- package/lib/versions.json +4 -4
- package/package.json +1 -1
package/lib/rt-grid/es6/Grid.js
CHANGED
@@ -617,6 +617,10 @@ Grid.prototype._topSection = true;
|
|
617
617
|
* @private
|
618
618
|
*/
|
619
619
|
Grid.prototype._focusingArgs = null;
|
620
|
+
/** @type {boolean}
|
621
|
+
* @private
|
622
|
+
*/
|
623
|
+
Grid.prototype._hasNewUpdates = false;
|
620
624
|
|
621
625
|
/** @public
|
622
626
|
*/
|
@@ -2381,8 +2385,12 @@ Grid.prototype.insertRow = function(rowOption, rowRef) {
|
|
2381
2385
|
}
|
2382
2386
|
}
|
2383
2387
|
let rowDef = new RowDefinition(rowOption);
|
2388
|
+
|
2389
|
+
if(rowDef.setDataSource(this._dc, this._subs)) { // This could also subscribe chain index/ric to JET/RTK
|
2390
|
+
this._hasNewUpdates = true; // Mark data table for cleaning it up later
|
2391
|
+
}
|
2384
2392
|
rowDef.registerToView(this._dv, this._getRowId(rowRef));
|
2385
|
-
|
2393
|
+
|
2386
2394
|
this._initDuplicateRicData(rowDef);
|
2387
2395
|
|
2388
2396
|
if(rowOption && rowOption["hidden"]) {
|
@@ -3763,11 +3771,21 @@ Grid.prototype._registerConstituents = function(rowDef) {
|
|
3763
3771
|
* @param {Object} e
|
3764
3772
|
*/
|
3765
3773
|
Grid.prototype._onDataChanged = function(e) {
|
3766
|
-
if(this._dt
|
3767
|
-
|
3768
|
-
|
3769
|
-
|
3770
|
-
|
3774
|
+
if(!this._dt) {
|
3775
|
+
return;
|
3776
|
+
}
|
3777
|
+
if(e) {
|
3778
|
+
if(e["initialChanges"] && !this._dt.hasSegmentClassification()) {
|
3779
|
+
return;
|
3780
|
+
}
|
3781
|
+
|
3782
|
+
// TODO: Insertion should also be addressed here.
|
3783
|
+
if(e["rid"] && e["changes"]) {
|
3784
|
+
let rowDef = this._getRowDefinitionById(e["rid"]);
|
3785
|
+
if(rowDef) {
|
3786
|
+
if(rowDef.addUpdate(e["changes"])) { // This is the only place that update array can grow. It is used for blinking data.
|
3787
|
+
this._hasNewUpdates = true; // Mark data table for cleaning it up later
|
3788
|
+
}
|
3771
3789
|
}
|
3772
3790
|
}
|
3773
3791
|
}
|
@@ -3776,10 +3794,8 @@ Grid.prototype._onDataChanged = function(e) {
|
|
3776
3794
|
return;
|
3777
3795
|
}
|
3778
3796
|
|
3779
|
-
|
3780
|
-
|
3781
|
-
this._dt.dispatchGlobalChange();
|
3782
|
-
}
|
3797
|
+
this._dt.classifySegments();
|
3798
|
+
this._dt.dispatchGlobalChange();
|
3783
3799
|
};
|
3784
3800
|
|
3785
3801
|
/** @private
|
@@ -3841,9 +3857,10 @@ Grid.prototype._asyncClearDataUpdates = function() {
|
|
3841
3857
|
/** @private
|
3842
3858
|
*/
|
3843
3859
|
Grid.prototype._clearDataUpdates = function() {
|
3844
|
-
if(!this._dt || !this.
|
3860
|
+
if(!this._dt || !this._hasNewUpdates) {
|
3845
3861
|
return;
|
3846
3862
|
}
|
3863
|
+
this._hasNewUpdates = false;
|
3847
3864
|
let rowIds = this._dt.getAllRowIds(true); // Use shallow copy for speed
|
3848
3865
|
for(let i = rowIds.length; --i >= 0;) {
|
3849
3866
|
let rowData = this._dt.getRowData(rowIds[i]);
|
@@ -4001,7 +4018,11 @@ Grid.prototype._onFormulaDataRequired = function(e) {
|
|
4001
4018
|
Grid.prototype._onDataComposed = function(e) {
|
4002
4019
|
let values = e["changes"];
|
4003
4020
|
if(!values) {
|
4004
|
-
|
4021
|
+
if(e["initialChanges"]) {
|
4022
|
+
values = e["changes"] = e["initialChanges"]; // Need to keep e["changes"] for backward compatibility.
|
4023
|
+
} else {
|
4024
|
+
return; // Cannot do data composition if there is no change in data
|
4025
|
+
}
|
4005
4026
|
}
|
4006
4027
|
|
4007
4028
|
if(!e["rowData"]) {
|
@@ -4009,7 +4030,7 @@ Grid.prototype._onDataComposed = function(e) {
|
|
4009
4030
|
}
|
4010
4031
|
|
4011
4032
|
let rowId = e["rid"];
|
4012
|
-
let rowDef = this._getRowDefinitionById(rowId);
|
4033
|
+
let rowDef = e["rowDef"] || this._getRowDefinitionById(rowId);
|
4013
4034
|
if(!rowDef) {
|
4014
4035
|
rowDef = this._constituentMap ? this._constituentMap[rowId] : null; // Row def could be in pending for adding to view
|
4015
4036
|
if(!rowDef) {
|
@@ -4079,8 +4100,10 @@ Grid.prototype._onSubSegmentChanged = function(e) {
|
|
4079
4100
|
rowDef = new RowDefinition({
|
4080
4101
|
"segmentId": segmentId // WARNING: This could cause row id duplication
|
4081
4102
|
});
|
4103
|
+
if(rowDef.setDataSource(this._dc)) { // auto generated row does not require a subscription
|
4104
|
+
this._hasNewUpdates = true; // Mark data table for cleaning it up later
|
4105
|
+
}
|
4082
4106
|
rowDef.registerToView(this._dv);
|
4083
|
-
rowDef.setDataSource(this._dc); // auto generated row does not require a subscription
|
4084
4107
|
}
|
4085
4108
|
};
|
4086
4109
|
|
@@ -603,20 +603,28 @@ RowDefinition.prototype.getType = function() {
|
|
603
603
|
* @public
|
604
604
|
* @param {DataCache} dataSource
|
605
605
|
* @param {Object=} subs Quotes2 subscription object
|
606
|
+
* @return {boolean} Returns true if there is an data update
|
606
607
|
*/
|
607
608
|
RowDefinition.prototype.setDataSource = function(dataSource, subs) {
|
608
609
|
this._dc = dataSource || null;
|
609
|
-
|
610
|
+
let dataUpdated = false;
|
610
611
|
if(this._dc) {
|
611
|
-
this.setRowData({}); // Trigger data change
|
612
612
|
if(this._staticValues) {
|
613
|
-
|
613
|
+
let rowData = _cloneObject(this._staticValues);
|
614
|
+
dataUpdated = this.addUpdate(rowData);
|
615
|
+
this._dc.setRowData(this._rowId, rowData, {
|
616
|
+
"rowDef": this, // The _onDataChanged and _onDataComposed handlers cannot get rowDef from DT because row does not register to view yet.
|
617
|
+
"initialChanges": this.getUpdates() // Used by _onDataComposed to keep backward compatibility.
|
618
|
+
}); // Trigger dataComposed and add updates
|
619
|
+
} else {
|
620
|
+
this._dc.setRowData(this._rowId, {});
|
614
621
|
}
|
615
622
|
}
|
616
623
|
|
617
624
|
this._subs = subs || null;
|
618
625
|
// This will work for runtime row insertion, but not for first initilization.
|
619
626
|
this.subscribeForUpdates();
|
627
|
+
return dataUpdated;
|
620
628
|
};
|
621
629
|
/** @public
|
622
630
|
* @return {DataCache} dataSource
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {Ext} from '../../tr-grid-util/es6/Ext.js';
|
2
2
|
import {GridPlugin} from '../../tr-grid-util/es6/GridPlugin.js';
|
3
|
-
import {extendObject, injectCss, prettifyCss
|
3
|
+
import {extendObject, injectCss, prettifyCss} from '../../tr-grid-util/es6/Util.js';
|
4
4
|
import {CellPainter} from '../../tr-grid-util/es6/CellPainter.js';
|
5
5
|
import {FilterBuilder} from '../../tr-grid-util/es6/FilterBuilder.js';
|
6
6
|
import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {Ext} from '../../tr-grid-util/es6/Ext.js';
|
2
2
|
import {GridPlugin} from '../../tr-grid-util/es6/GridPlugin.js';
|
3
|
-
import {extendObject, injectCss, prettifyCss
|
3
|
+
import {extendObject, injectCss, prettifyCss} from '../../tr-grid-util/es6/Util.js';
|
4
4
|
import {CellPainter} from '../../tr-grid-util/es6/CellPainter.js';
|
5
5
|
import {FilterBuilder} from '../../tr-grid-util/es6/FilterBuilder.js';
|
6
6
|
import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
|
@@ -1200,7 +1200,6 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
|
|
1200
1200
|
}
|
1201
1201
|
|
1202
1202
|
let prevDataRow, prevDataRows = host._prevDataRows;
|
1203
|
-
let isPrevRowExisted = !isEmptyObject(prevDataRows);
|
1204
1203
|
let api = this.getGridApi();
|
1205
1204
|
for (r = fromR; r < toR; ++r) {
|
1206
1205
|
rid = dv.getRowId(r);
|
@@ -1260,7 +1259,7 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
|
|
1260
1259
|
}
|
1261
1260
|
}
|
1262
1261
|
} else {
|
1263
|
-
if(
|
1262
|
+
if(insertedRow){
|
1264
1263
|
blinking = true;
|
1265
1264
|
bgBlinking = painter.flash(cell, this._insertionBlinking, dataRow);
|
1266
1265
|
}
|
@@ -20,7 +20,8 @@ declare namespace RowFilteringPlugin {
|
|
20
20
|
type ColumnOptions = {
|
21
21
|
filter?: RowFilteringPlugin.Expression|null,
|
22
22
|
filterState?: any,
|
23
|
-
filterIcon?: boolean|null
|
23
|
+
filterIcon?: boolean|null,
|
24
|
+
filterDialogOptions?: RowFilteringPlugin.FilterDialogOptions|null
|
24
25
|
};
|
25
26
|
|
26
27
|
type FilterDialogOptions = {
|
@@ -74,6 +74,7 @@ The expression can take various forms:<br>
|
|
74
74
|
* @property {RowFilteringPlugin~Expression=} filter An expression string or Function
|
75
75
|
* @property {*=} filterState Context object that will be passed as the third parameter for the filter logic
|
76
76
|
* @property {boolean=} filterIcon=true If disabled, filter icon will not be shown. This property only works with "always" mode
|
77
|
+
* @property {RowFilteringPlugin~FilterDialogOptions=} filterDialogOptions=null Configuration for Filter Dialog, applying to column.
|
77
78
|
*/
|
78
79
|
|
79
80
|
/** @typedef {Object} RowFilteringPlugin~FilterDialogOptions
|
@@ -614,6 +615,11 @@ RowFilteringPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
614
615
|
if(!filterIcon) {
|
615
616
|
column.filterIcon = false;
|
616
617
|
}
|
618
|
+
|
619
|
+
let filterDialogOptions = colSettings.filterDialogOptions;
|
620
|
+
if(filterDialogOptions != null) {
|
621
|
+
column.filterDialogOptions = colSettings.filterDialogOptions;
|
622
|
+
}
|
617
623
|
}
|
618
624
|
|
619
625
|
let extOptions = obj.rowFiltering;
|
@@ -914,6 +920,11 @@ RowFilteringPlugin.prototype._setColumnOptions = function(colIndex, userObj) {
|
|
914
920
|
this._updateColumnIcon(colIndex);
|
915
921
|
}
|
916
922
|
|
923
|
+
let filterDialogOptions = userObj["filterDialogOptions"];
|
924
|
+
if(filterDialogOptions != null) {
|
925
|
+
colSettings.filterDialogOptions = filterDialogOptions;
|
926
|
+
}
|
927
|
+
|
917
928
|
return (exp != null);
|
918
929
|
};
|
919
930
|
/** @private
|
@@ -1925,11 +1936,15 @@ RowFilteringPlugin.prototype.openDialog = function(colIndex, runtimeDialogOption
|
|
1925
1936
|
|
1926
1937
|
let columnDialogOptions = null;
|
1927
1938
|
let colSettings = this._getUserColumnSettings(colIndex); // colData["rowFiltering"]
|
1939
|
+
if(colSettings.filterDialogOptions) {
|
1940
|
+
columnDialogOptions = colSettings.filterDialogOptions;
|
1941
|
+
}
|
1928
1942
|
if(colSettings.fieldDataType){
|
1929
1943
|
// TODO: Use data type from Composite Grid (getColumnDataType) or Realtime Grid (getDataType) instead
|
1930
|
-
columnDialogOptions
|
1931
|
-
|
1932
|
-
}
|
1944
|
+
if(!columnDialogOptions) {
|
1945
|
+
columnDialogOptions = {};
|
1946
|
+
}
|
1947
|
+
columnDialogOptions.fieldDataType = colSettings.fieldDataType;
|
1933
1948
|
}
|
1934
1949
|
|
1935
1950
|
RowFilteringPlugin._overrideConfig(dialogConfig, this._dialogOptions);
|
@@ -56,12 +56,8 @@ declare class CellPainter {
|
|
56
56
|
|
57
57
|
public resetColoring(): void;
|
58
58
|
|
59
|
-
public resetBlinking(): void;
|
60
|
-
|
61
59
|
public clearBlinking(): void;
|
62
60
|
|
63
|
-
public resetHeatMap(): void;
|
64
|
-
|
65
61
|
public clearHeatMap(): boolean;
|
66
62
|
|
67
63
|
public applyThemeColor(): void;
|
@@ -122,7 +118,7 @@ declare class CellPainter {
|
|
122
118
|
|
123
119
|
public static getOppositeColor(hexCode: string|(number)[]|null): string;
|
124
120
|
|
125
|
-
public render(cell: any, rowData: any, min: number, max: number
|
121
|
+
public render(cell: any, rowData: any, min: number, max: number): void;
|
126
122
|
|
127
123
|
public renderHeatMap(cell: any, rowData: any, min: number, max: number): void;
|
128
124
|
|
@@ -132,8 +128,6 @@ declare class CellPainter {
|
|
132
128
|
|
133
129
|
public flash(cell: any, blinkColor: string|null|null, rowData: any): boolean;
|
134
130
|
|
135
|
-
public _blink(scope: any, elem: Element|null, blinkColor: string, contrastColor: string): boolean;
|
136
|
-
|
137
131
|
public blinkCell(cell: any, newValue: number, oldValue: number, rowData: any): boolean;
|
138
132
|
|
139
133
|
public verifyBlinking(cell: any, rowData: any): void;
|
@@ -35,14 +35,25 @@ import { ExpressionParser } from "./ExpressionParser.js";
|
|
35
35
|
* @property {string=} tickDown Color for negative tick icon
|
36
36
|
*/
|
37
37
|
|
38
|
-
/** @constructor
|
39
|
-
|
38
|
+
/** @constructor
|
39
|
+
*/
|
40
40
|
let CellPainter = function() {
|
41
41
|
this._conditions = [];
|
42
42
|
this._scopes = [];
|
43
43
|
|
44
44
|
CellPainter._painters.push(this); // For later referencing
|
45
45
|
};
|
46
|
+
/** @private
|
47
|
+
* @function
|
48
|
+
* @param {Element} elem
|
49
|
+
* @param {string=} targetClass
|
50
|
+
*/
|
51
|
+
let _removeCssClass = function(elem, targetClass) {
|
52
|
+
if (elem._coloringCssClass != null && elem._coloringCssClass !== targetClass) {
|
53
|
+
elem.classList.remove(elem._coloringCssClass);
|
54
|
+
elem._coloringCssClass = null;
|
55
|
+
}
|
56
|
+
};
|
46
57
|
|
47
58
|
/** Enum for coloring types.
|
48
59
|
* @enum {number}
|
@@ -165,25 +176,7 @@ CellPainter.prototype.dispose = function() {
|
|
165
176
|
/** @public */
|
166
177
|
CellPainter.prototype.reset = function() {
|
167
178
|
this._setColoringType(0);
|
168
|
-
|
169
|
-
let len = this._scopes.length;
|
170
|
-
if(len) {
|
171
|
-
for(let i = 0; i < len; ++i) {
|
172
|
-
let scope = this._scopes[i];
|
173
|
-
if(CellPainter._clearBlinkTimer(scope)) {
|
174
|
-
scope._restorer();
|
175
|
-
}
|
176
|
-
let cell = scope["cell"];
|
177
|
-
if(cell) {
|
178
|
-
delete cell["blinking"]; // Delete cell blinking scope
|
179
|
-
}
|
180
|
-
|
181
|
-
scope["cell"] = null;
|
182
|
-
}
|
183
|
-
this._scopes.length = 0;
|
184
|
-
}
|
185
|
-
|
186
|
-
this._blinkCondition = null;
|
179
|
+
this.clearBlinking();
|
187
180
|
};
|
188
181
|
|
189
182
|
/** @public */
|
@@ -194,12 +187,6 @@ CellPainter.prototype.resetColoring = function() {
|
|
194
187
|
this._conditions.length = 0;
|
195
188
|
};
|
196
189
|
|
197
|
-
/** @public */
|
198
|
-
CellPainter.prototype.resetBlinking = function() {
|
199
|
-
this._blinkCondition = null;
|
200
|
-
this._scopes.length = 0;
|
201
|
-
};
|
202
|
-
|
203
190
|
/** @public */
|
204
191
|
CellPainter.prototype.clearBlinking = function() {
|
205
192
|
this._blinkCondition = null;
|
@@ -220,12 +207,11 @@ CellPainter.prototype.clearBlinking = function() {
|
|
220
207
|
this._scopes.length = 0;
|
221
208
|
}
|
222
209
|
};
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
};
|
210
|
+
/** @public
|
211
|
+
* @ignore
|
212
|
+
* @function
|
213
|
+
*/
|
214
|
+
CellPainter.prototype.resetBlinking = CellPainter.prototype.clearBlinking;
|
229
215
|
|
230
216
|
/** Return true if no one is using this painter
|
231
217
|
* @public
|
@@ -241,6 +227,14 @@ CellPainter.prototype.clearHeatMap = function() {
|
|
241
227
|
return true;
|
242
228
|
}
|
243
229
|
};
|
230
|
+
/** @public
|
231
|
+
* @ignore
|
232
|
+
* @function
|
233
|
+
*/
|
234
|
+
CellPainter.prototype.resetHeatMap = function() {
|
235
|
+
this._conditions.length = 0;
|
236
|
+
this._columnStats = null;
|
237
|
+
};
|
244
238
|
|
245
239
|
/** @public */
|
246
240
|
CellPainter.prototype.applyThemeColor = function() {
|
@@ -308,7 +302,7 @@ CellPainter.prototype.setConditions = function(conditions) {
|
|
308
302
|
this._conditions.length = 0; // TODO: Clear existing cell styles first
|
309
303
|
this._setColoringType(CellPainter.ColoringTypes.CONDITIONAL);
|
310
304
|
|
311
|
-
let len = conditions.length;
|
305
|
+
let len = conditions ? conditions.length : 0;
|
312
306
|
for (let i = 0; i < len; i++) {
|
313
307
|
this._addCondition(conditions[i]);
|
314
308
|
}
|
@@ -400,6 +394,7 @@ CellPainter.prototype._addColorText = function(expression, field, upClass, downC
|
|
400
394
|
condition["upClass"] = upClass;
|
401
395
|
condition["downClass"] = downClass;
|
402
396
|
condition["levelClass"] = levelClass;
|
397
|
+
// TODO: Make this consistent with other type (e.g., heat map and blinking)
|
403
398
|
|
404
399
|
this._addCondition(condition);
|
405
400
|
return condition;
|
@@ -526,20 +521,14 @@ CellPainter.prototype.renderForPrinting = function(cell, rowData, min, max) {
|
|
526
521
|
}
|
527
522
|
let styles = this._getStyles(rowData, min, max);
|
528
523
|
let cssClass = styles["cssClass"]; // Can be an empty string
|
524
|
+
|
525
|
+
_removeCssClass(cell, cssClass);
|
529
526
|
if (cssClass != null) { // Predefined colors mode
|
530
|
-
if (elem._coloringCssClass && elem._coloringCssClass !== cssClass) {
|
531
|
-
elem.classList.remove(elem._coloringCssClass);
|
532
|
-
elem._coloringCssClass = null;
|
533
|
-
}
|
534
527
|
if (cssClass) {
|
535
|
-
|
536
|
-
|
528
|
+
cell.classList.add(cssClass);
|
529
|
+
cell._coloringCssClass = cssClass;
|
537
530
|
}
|
538
531
|
} else {
|
539
|
-
if (cell._coloringCssClass) {
|
540
|
-
cell.classList.remove(cell._coloringCssClass);
|
541
|
-
cell._coloringCssClass = null;
|
542
|
-
}
|
543
532
|
cell.style.backgroundColor = styles["backgroundColor"] || "";
|
544
533
|
cell.style.color = styles["color"] || "";
|
545
534
|
}
|
@@ -660,11 +649,8 @@ CellPainter._cellRestorer = function(scope) {
|
|
660
649
|
|
661
650
|
let styles = this._getStyles(rowData, min, max);
|
662
651
|
let cssClass = styles["cssClass"]; // Can be an empty string
|
652
|
+
_removeCssClass(elem, cssClass);
|
663
653
|
if (cssClass != null) { // Predefined colors mode
|
664
|
-
if (elem._coloringCssClass && elem._coloringCssClass !== cssClass) {
|
665
|
-
elem.classList.remove(elem._coloringCssClass);
|
666
|
-
elem._coloringCssClass = null;
|
667
|
-
}
|
668
654
|
if (cssClass) {
|
669
655
|
elem.classList.add(cssClass);
|
670
656
|
elem._coloringCssClass = cssClass;
|
@@ -673,10 +659,6 @@ CellPainter._cellRestorer = function(scope) {
|
|
673
659
|
elem.style.backgroundColor = "";
|
674
660
|
elem.style.color = "";
|
675
661
|
} else {
|
676
|
-
if (elem._coloringCssClass) {
|
677
|
-
elem.classList.remove(elem._coloringCssClass);
|
678
|
-
elem._coloringCssClass = null;
|
679
|
-
}
|
680
662
|
elem.style.backgroundColor = styles["backgroundColor"] || "";
|
681
663
|
elem.style.color = styles["color"] || "";
|
682
664
|
}
|
@@ -728,10 +710,12 @@ CellPainter.prototype._getStyles = function(rowData, min, max) {
|
|
728
710
|
curCond["cssClass"] = curCond["upClass"];
|
729
711
|
} else if(ret < 0) {
|
730
712
|
curCond["cssClass"] = curCond["downClass"];
|
731
|
-
} else {
|
713
|
+
} else if(ret === 0) {
|
732
714
|
curCond["cssClass"] = curCond["levelClass"];
|
715
|
+
} // else case is no change in cssClass
|
716
|
+
if(!curCond["cssClass"]) {
|
717
|
+
curCond["cssClass"] = ""; // If no cssClass, remove existing one
|
733
718
|
}
|
734
|
-
curCond["cssClass"] = curCond["cssClass"] || "";
|
735
719
|
return curCond;
|
736
720
|
}
|
737
721
|
|
@@ -864,9 +848,7 @@ CellPainter.clearCellStyle = function(cell, styles) {
|
|
864
848
|
// WARNING: Scope is not removed from the this._scopes collection to speed things up
|
865
849
|
}
|
866
850
|
|
867
|
-
|
868
|
-
elem.classList.remove(elem._coloringCssClass);
|
869
|
-
}
|
851
|
+
_removeCssClass(elem);
|
870
852
|
|
871
853
|
if(!styles){
|
872
854
|
styles = CellPainter.supportedStyles;
|
@@ -949,9 +931,8 @@ CellPainter.getOppositeColor = function (hexCode) {
|
|
949
931
|
* @param {Object} rowData e.g. { PCTCHNG: 0.53, CF_NETCHNG: 0.75 }
|
950
932
|
* @param {number} min
|
951
933
|
* @param {number} max
|
952
|
-
* @param {Object=} changedCols
|
953
934
|
*/
|
954
|
-
CellPainter.prototype.render = function (cell, rowData, min, max
|
935
|
+
CellPainter.prototype.render = function (cell, rowData, min, max) {
|
955
936
|
if (min != null && min === min) { // Render heatmap
|
956
937
|
this._paintCell(cell, rowData, min, max);
|
957
938
|
} else if (this._conditions.length && this._coloringType === CellPainter.ColoringTypes.CONDITIONAL) { // Render conditional-coloring
|
@@ -1005,10 +986,7 @@ CellPainter.prototype._paintCell = function(cell, rowData, min, max) {
|
|
1005
986
|
let elStyle = elem.style;
|
1006
987
|
|
1007
988
|
let cssClass = styles["cssClass"]; // Can be an empty string
|
1008
|
-
|
1009
|
-
elem.classList.remove(elem._coloringCssClass);
|
1010
|
-
elem._coloringCssClass = null;
|
1011
|
-
}
|
989
|
+
_removeCssClass(elem, cssClass);
|
1012
990
|
if (cssClass != null) { // Predefined colors mode
|
1013
991
|
if (cssClass) {
|
1014
992
|
elem.classList.add(cssClass);
|
@@ -1086,7 +1064,8 @@ CellPainter.prototype.blink = function (cell, blinkSignal, rowData) {
|
|
1086
1064
|
contrastColor = bc["contrastLevelColor"];
|
1087
1065
|
}
|
1088
1066
|
|
1089
|
-
|
1067
|
+
this._blink(scope, elem, blinkColor, contrastColor);
|
1068
|
+
return true;
|
1090
1069
|
};
|
1091
1070
|
|
1092
1071
|
/** Blink cell with specific color or theme's neutral movement color.
|
@@ -1112,32 +1091,30 @@ CellPainter.prototype.flash = function(cell, blinkColor, rowData) {
|
|
1112
1091
|
blinkColor = ElfUtil.themeColors["level"];
|
1113
1092
|
}
|
1114
1093
|
|
1115
|
-
|
1094
|
+
this._blink(scope, elem, blinkColor, CellPainter.getOppositeColor(blinkColor));
|
1095
|
+
return true;
|
1116
1096
|
};
|
1117
1097
|
|
1118
|
-
/**
|
1119
|
-
* @public
|
1098
|
+
/** @private
|
1120
1099
|
* @param {Object} scope
|
1121
1100
|
* @param {Element} elem
|
1122
1101
|
* @param {string} blinkColor
|
1123
1102
|
* @param {string} contrastColor
|
1124
|
-
* @return {boolean}
|
1103
|
+
* @return {boolean} Returns true if it is a background blinking, otherwise returns false
|
1125
1104
|
*/
|
1126
1105
|
CellPainter.prototype._blink = function (scope, elem, blinkColor, contrastColor) {
|
1127
|
-
|
1106
|
+
CellPainter._clearBlinkTimer(scope);
|
1107
|
+
scope["blinkTimer"] = setTimeout(scope._restorer, this._blinkingDuration);
|
1128
1108
|
|
1129
1109
|
if (this._blinkCondition["border"]) {
|
1130
1110
|
elem.style.border = "1px solid " + blinkColor;
|
1131
|
-
|
1111
|
+
return false;
|
1132
1112
|
} else {
|
1133
1113
|
elem.style.backgroundColor = blinkColor;
|
1134
1114
|
elem.style.color = contrastColor;
|
1135
1115
|
}
|
1136
1116
|
|
1137
|
-
|
1138
|
-
scope["blinkTimer"] = setTimeout(scope._restorer, this._blinkingDuration);
|
1139
|
-
|
1140
|
-
return bgBlinking;
|
1117
|
+
return true;
|
1141
1118
|
};
|
1142
1119
|
|
1143
1120
|
/**
|
@@ -116,6 +116,15 @@ ElfUtil._icons = {
|
|
116
116
|
ElfUtil._icons["halo-theme"] = ElfUtil._icons["elf-theme-halo"];
|
117
117
|
ElfUtil._icons["solar-theme"] = ElfUtil._icons["elf-theme-solar"];
|
118
118
|
|
119
|
+
|
120
|
+
/** Set ELF version for testing purpose
|
121
|
+
* @public
|
122
|
+
* @function
|
123
|
+
* @param {number} ver
|
124
|
+
*/
|
125
|
+
ElfUtil.setElfVersion = function (ver) {
|
126
|
+
ElfUtil._elfVersion = ver;
|
127
|
+
};
|
119
128
|
/** Check ELF version
|
120
129
|
* @public
|
121
130
|
* @function
|
@@ -533,7 +542,8 @@ ElfUtil._profileNameRetrieved = function() {
|
|
533
542
|
};
|
534
543
|
|
535
544
|
/** Get theme colors from document
|
536
|
-
* @
|
545
|
+
* @public
|
546
|
+
* @ignore
|
537
547
|
* @param {string} profileName Movement color profile name
|
538
548
|
*/
|
539
549
|
ElfUtil._retrieveThemeColors = function(profileName) {
|
@@ -29,6 +29,8 @@ declare class MockSubscriptions {
|
|
29
29
|
|
30
30
|
public setPercentageDataUpdate(percent?: number|null): void;
|
31
31
|
|
32
|
+
public setPercentageOrderChanged(percent?: number|null): void;
|
33
|
+
|
32
34
|
public setSeed(seed: number): void;
|
33
35
|
|
34
36
|
public addRic(ric: string, subId?: string|null): string|null|null;
|