@refinitiv-ui/efx-grid 6.0.65 → 6.0.67
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/core/dist/core.js +31 -9
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataView.d.ts +2 -0
- package/lib/core/es6/data/DataView.js +26 -4
- package/lib/core/es6/grid/Core.js +5 -5
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +176 -72
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +0 -2
- package/lib/rt-grid/es6/ColumnDefinition.js +1 -1
- package/lib/rt-grid/es6/Grid.d.ts +0 -2
- package/lib/rt-grid/es6/Grid.js +2 -2
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +4 -3
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +1 -1
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +17 -26
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +11 -5
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +153 -55
- package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +2 -1
- package/lib/tr-grid-contextmenu/es6/ContextMenu.js +8 -8
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +3 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +23 -2
- package/lib/tr-grid-util/es6/CellPainter.d.ts +4 -2
- package/lib/tr-grid-util/es6/CellPainter.js +18 -8
- package/lib/tr-grid-util/es6/FilterOperators.js +13 -0
- package/lib/types/es6/ColumnStack.d.ts +1 -1
- package/lib/types/es6/ConditionalColoring.d.ts +11 -5
- package/lib/types/es6/ContextMenu.d.ts +2 -1
- package/lib/types/es6/Core/data/DataView.d.ts +2 -0
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +0 -2
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +0 -2
- package/lib/types/es6/RowFiltering.d.ts +3 -0
- package/lib/versions.json +6 -6
- package/package.json +1 -1
@@ -278,6 +278,8 @@ declare class DataView extends EventDispatcher {
|
|
278
278
|
|
279
279
|
public enableEmptySegmentFiltering(enabled?: boolean|null): void;
|
280
280
|
|
281
|
+
public enableSeparatorFiltering(enabled?: boolean|null): void;
|
282
|
+
|
281
283
|
public setSegmentClassification(segmentRef: string|number|null, fields: string|(string)[]|null): boolean;
|
282
284
|
|
283
285
|
public getWrapSize(): number;
|
@@ -131,6 +131,10 @@ DataView.prototype._excludedRids = null;
|
|
131
131
|
* @type {boolean}
|
132
132
|
*/
|
133
133
|
DataView.prototype._emptySegmentFiltering = false;
|
134
|
+
/** @private
|
135
|
+
* @type {boolean}
|
136
|
+
*/
|
137
|
+
DataView.prototype._separatorFiltering = false;
|
134
138
|
|
135
139
|
/** @private
|
136
140
|
* @type {Object.<string, number>}
|
@@ -2566,7 +2570,7 @@ DataView.prototype.sortSeparators = function (sortLogics, sortOrders, cids) {
|
|
2566
2570
|
DataView.prototype.sortSegments = function (compare) {
|
2567
2571
|
this._dt.sortSegments(compare);
|
2568
2572
|
};
|
2569
|
-
/** Automatically hide empty segment when all of its member are filtered out. An empty segment will
|
2573
|
+
/** Automatically hide empty segment when all of its member are filtered out. An empty segment will NOT be hidden, if there is no active filter. Collapsed segment does not count as filtering. A segment with no child is treated the same way as an empty segment.
|
2570
2574
|
* @public
|
2571
2575
|
* @param {boolean=} enabled
|
2572
2576
|
*/
|
@@ -2579,6 +2583,19 @@ DataView.prototype.enableEmptySegmentFiltering = function (enabled) {
|
|
2579
2583
|
}
|
2580
2584
|
}
|
2581
2585
|
};
|
2586
|
+
/** Allow filtering of segment separators as if they were normal rows. Note that even if a separator row is filtered out, its child row may remain in the view and not be filtered out.
|
2587
|
+
* @public
|
2588
|
+
* @param {boolean=} enabled
|
2589
|
+
*/
|
2590
|
+
DataView.prototype.enableSeparatorFiltering = function (enabled) {
|
2591
|
+
enabled = enabled !== false;
|
2592
|
+
if(this._separatorFiltering !== enabled) {
|
2593
|
+
this._separatorFiltering = enabled;
|
2594
|
+
if(this._userFilter) {
|
2595
|
+
this._refreshAndNotify();
|
2596
|
+
}
|
2597
|
+
}
|
2598
|
+
};
|
2582
2599
|
/**
|
2583
2600
|
* @public
|
2584
2601
|
* @param {string|number} segmentRef Row id or row index
|
@@ -2746,14 +2763,19 @@ DataView.prototype._updateRowIds = function(opt_rowIds) {
|
|
2746
2763
|
|
2747
2764
|
// Segment separators should not be filtered out (hidden)
|
2748
2765
|
var segments = this._dt._getSegmentSeparators();
|
2749
|
-
var
|
2750
|
-
var userRemoval = this._getRemovalMap(
|
2766
|
+
var segmentIds = segments ? segments.getSegments() : null;
|
2767
|
+
var userRemoval = this._getRemovalMap(
|
2768
|
+
this._excludedRids,
|
2769
|
+
this._userFilter,
|
2770
|
+
this._filteringOut,
|
2771
|
+
this._separatorFiltering ? null : segmentIds
|
2772
|
+
);
|
2751
2773
|
exclusionCount += userRemoval;
|
2752
2774
|
|
2753
2775
|
this._collapsedRids = null;
|
2754
2776
|
if(segments) {
|
2755
2777
|
if(userRemoval && this._emptySegmentFiltering) {
|
2756
|
-
exclusionCount += this._getEmptySegments(this._excludedRids,
|
2778
|
+
exclusionCount += this._getEmptySegments(this._excludedRids, segmentIds);
|
2757
2779
|
}
|
2758
2780
|
this._collapsedRids = segments.getCollapsedRows();
|
2759
2781
|
// Children of collapsed segments must be filtered out (hidden)
|
@@ -562,7 +562,7 @@ Core.prototype._batches = null;
|
|
562
562
|
* @return {string}
|
563
563
|
*/
|
564
564
|
Core.getVersion = function () {
|
565
|
-
return "5.1.
|
565
|
+
return "5.1.77";
|
566
566
|
};
|
567
567
|
/** {@link ElementWrapper#dispose}
|
568
568
|
* @override
|
@@ -4482,6 +4482,10 @@ Core.prototype.startBatch = function (batchType) {
|
|
4482
4482
|
this._batches = {};
|
4483
4483
|
}
|
4484
4484
|
this._batches[batchType] = batchType;
|
4485
|
+
// The "columnVisibilityChanged" event is blocked while the "reset" batch operation is in progress, so this event will not be fired until the batch operation succeeds.
|
4486
|
+
if(batchType === "reset") {
|
4487
|
+
this._disableEvent("columnVisibilityChanged", true);
|
4488
|
+
}
|
4485
4489
|
this._dispatch("beforeBatchOperation", { batches: this._batches, batchType: batchType });
|
4486
4490
|
return true;
|
4487
4491
|
};
|
@@ -4494,10 +4498,6 @@ Core.prototype.stopBatch = function (batchType) {
|
|
4494
4498
|
if(!batchType){
|
4495
4499
|
return false;
|
4496
4500
|
}
|
4497
|
-
// The "columnVisibilityChanged" event is blocked while the "reset" batch operation is in progress, so this event will not be fired until the batch operation succeeds.
|
4498
|
-
if(batchType === "reset") {
|
4499
|
-
this._disableEvent("columnVisibilityChanged", true);
|
4500
|
-
}
|
4501
4501
|
this._dispatch("afterBatchOperation", { batches: this._batches, batchType: batchType });
|
4502
4502
|
if(batchType === "reset") {
|
4503
4503
|
this._disableEvent("columnVisibilityChanged", false);
|
package/lib/grid/index.js
CHANGED
@@ -3030,7 +3030,8 @@ ElementObserver._getNewId = function () {
|
|
3030
3030
|
return id;
|
3031
3031
|
};
|
3032
3032
|
|
3033
|
-
/**
|
3033
|
+
/** Observe any element
|
3034
|
+
* @private
|
3034
3035
|
* @param {Element} elem
|
3035
3036
|
* @param {Function} listener
|
3036
3037
|
* @param {Object=} opt_option
|
@@ -3082,7 +3083,8 @@ ElementObserver._addListener = function(elem, fn) {
|
|
3082
3083
|
}
|
3083
3084
|
};
|
3084
3085
|
|
3085
|
-
/**
|
3086
|
+
/** Add a listener to a html lang attribute
|
3087
|
+
* @public
|
3086
3088
|
* @param {Element} element An element within the DOM tree to watch for changes
|
3087
3089
|
*/
|
3088
3090
|
ElementObserver.addLanguageListener = function(element) {
|
@@ -3093,7 +3095,8 @@ ElementObserver.addLanguageListener = function(element) {
|
|
3093
3095
|
ElementObserver._addObserver(document.documentElement, _onLanguageMutated.bind(null, element));
|
3094
3096
|
};
|
3095
3097
|
|
3096
|
-
/**
|
3098
|
+
/** Add a listener to a html attribute
|
3099
|
+
* @public
|
3097
3100
|
* @param {Element} element An element within the DOM tree to watch for changes
|
3098
3101
|
* @param {Function} listener A function which will be called on each attribute change
|
3099
3102
|
* @param {string=} attributeName If not specified, listener will be called on every attribute change
|
@@ -15330,7 +15333,7 @@ ColumnDefinition.prototype.dispose = function() {
|
|
15330
15333
|
// TODO: Remove any related reference from this._fnEngine
|
15331
15334
|
};
|
15332
15335
|
|
15333
|
-
/** @
|
15336
|
+
/** @private
|
15334
15337
|
* @param {ColumnDefinition~Options|string=} columnOption
|
15335
15338
|
*/
|
15336
15339
|
ColumnDefinition.prototype._initializeTimeSeriesChild = function(columnOption) {
|
@@ -36146,7 +36149,7 @@ Core.prototype._batches = null;
|
|
36146
36149
|
* @return {string}
|
36147
36150
|
*/
|
36148
36151
|
Core.getVersion = function () {
|
36149
|
-
return "5.1.
|
36152
|
+
return "5.1.76";
|
36150
36153
|
};
|
36151
36154
|
/** {@link ElementWrapper#dispose}
|
36152
36155
|
* @override
|
@@ -40066,6 +40069,10 @@ Core.prototype.startBatch = function (batchType) {
|
|
40066
40069
|
this._batches = {};
|
40067
40070
|
}
|
40068
40071
|
this._batches[batchType] = batchType;
|
40072
|
+
// The "columnVisibilityChanged" event is blocked while the "reset" batch operation is in progress, so this event will not be fired until the batch operation succeeds.
|
40073
|
+
if(batchType === "reset") {
|
40074
|
+
this._disableEvent("columnVisibilityChanged", true);
|
40075
|
+
}
|
40069
40076
|
this._dispatch("beforeBatchOperation", { batches: this._batches, batchType: batchType });
|
40070
40077
|
return true;
|
40071
40078
|
};
|
@@ -40078,10 +40085,6 @@ Core.prototype.stopBatch = function (batchType) {
|
|
40078
40085
|
if(!batchType){
|
40079
40086
|
return false;
|
40080
40087
|
}
|
40081
|
-
// The "columnVisibilityChanged" event is blocked while the "reset" batch operation is in progress, so this event will not be fired until the batch operation succeeds.
|
40082
|
-
if(batchType === "reset") {
|
40083
|
-
this._disableEvent("columnVisibilityChanged", true);
|
40084
|
-
}
|
40085
40088
|
this._dispatch("afterBatchOperation", { batches: this._batches, batchType: batchType });
|
40086
40089
|
if(batchType === "reset") {
|
40087
40090
|
this._disableEvent("columnVisibilityChanged", false);
|
@@ -40655,14 +40658,10 @@ Core.prototype._onColInViewChanged = function (e) {
|
|
40655
40658
|
var last = pli > li ? pli : li; // INCLUSIVE
|
40656
40659
|
|
40657
40660
|
this._activateColumns(fi, li, first, last);
|
40658
|
-
|
40659
|
-
var rfi = this._rowVirtualizer.getFirstIndexInView();
|
40660
|
-
var rli = this._rowVirtualizer.getLastIndexInView();
|
40661
40661
|
var sectionCount = this.getSectionCount();
|
40662
40662
|
for (var s = 0; s < sectionCount; ++s) { // For each section
|
40663
40663
|
var sectionSettings = this._settings[s];
|
40664
|
-
|
40665
|
-
this.updateRowData(sectionSettings, rfi - rowIndexOffset, rli - rowIndexOffset);
|
40664
|
+
this.updateRowData(sectionSettings); // It will be render all rows in view
|
40666
40665
|
}
|
40667
40666
|
};
|
40668
40667
|
/** @private
|
@@ -43087,9 +43086,9 @@ SortableTitlePlugin.prototype.sortColumns = function (sortOptions, opt_arg) {
|
|
43087
43086
|
var states = [];
|
43088
43087
|
for (var i = 0; i < sortOptions.length; i++) {
|
43089
43088
|
var opt = sortOptions[i];
|
43090
|
-
var colRef = opt["
|
43091
|
-
if(colRef
|
43092
|
-
colRef = opt["
|
43089
|
+
var colRef = opt["colId"] || opt["field"];
|
43090
|
+
if(colRef == null) {
|
43091
|
+
colRef = opt["colIndex"];
|
43093
43092
|
}
|
43094
43093
|
var state = this._prepareSorting(
|
43095
43094
|
colRef,
|
@@ -45730,7 +45729,7 @@ Grid.prototype.replaceColumn = function (columnOption, colRef) {
|
|
45730
45729
|
colConfig["minWidth"] = value;
|
45731
45730
|
}
|
45732
45731
|
|
45733
|
-
value = core.
|
45732
|
+
value = core.getColumnVisibility(colIndex, 0); // flag 0 means get only core api hidden state
|
45734
45733
|
if(!value) {
|
45735
45734
|
colConfig["hidden"] = true;
|
45736
45735
|
}
|
@@ -46470,7 +46469,7 @@ Grid.prototype.setColumnSorter = function(colRef, func) {
|
|
46470
46469
|
|
46471
46470
|
|
46472
46471
|
/** Initialize data for the given rowDef from another rowDef with the same RIC
|
46473
|
-
* @
|
46472
|
+
* @private
|
46474
46473
|
* @param {RowDefinition} rowDef
|
46475
46474
|
*/
|
46476
46475
|
Grid.prototype._initDuplicateRicData = function(rowDef) {
|
@@ -48674,6 +48673,26 @@ DataSet.country = [
|
|
48674
48673
|
// CONCATENATED MODULE: ./node_modules/tr-grid-util/es6/jet/DataGenerator.js
|
48675
48674
|
|
48676
48675
|
|
48676
|
+
/** @typedef {Object} DataGenerator~DataOptions
|
48677
|
+
* @description Options for generating data
|
48678
|
+
* @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.
|
48679
|
+
* @property {number=} numRows Number of rows to be generated
|
48680
|
+
* @property {number=} rowCount Alias to numRows
|
48681
|
+
*/
|
48682
|
+
|
48683
|
+
/** @typedef {Object} DataGenerator~FieldInformation
|
48684
|
+
* @description Information object for defining how data are generated for a specific field
|
48685
|
+
* @property {string=} type Available types are number, float, boolean, set, function, and isoDate
|
48686
|
+
* @property {string=} prefix Add a text prefix to the data
|
48687
|
+
* @property {string=} suffix Add a text suffix to the data
|
48688
|
+
* @property {number=} min Minimum value of the numeric data
|
48689
|
+
* @property {number=} max Maximum value of the numeric data. This is exclusive (not included in the result).
|
48690
|
+
* @property {string=} prec Precision (place number after the decimal point) of the numeric data.
|
48691
|
+
* @property {string=} fixedValue Single/static/constant value
|
48692
|
+
* @property {Array=} members List of possible data when the type is "set"
|
48693
|
+
* @property {Function=} generate Function for generating data when the type is "function"
|
48694
|
+
*/
|
48695
|
+
|
48677
48696
|
/** @private
|
48678
48697
|
* @param {Object} fInfo
|
48679
48698
|
* @param {number=} seed
|
@@ -48700,8 +48719,7 @@ var _generateDate1 = function(fInfo, seed) {
|
|
48700
48719
|
|
48701
48720
|
var POW10 = [1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10];
|
48702
48721
|
|
48703
|
-
/**
|
48704
|
-
* @type {Object}
|
48722
|
+
/** @type {Object.<string, DataGenerator~DataOptions>}
|
48705
48723
|
* @private
|
48706
48724
|
*/
|
48707
48725
|
var _fieldInfo = {
|
@@ -48774,7 +48792,7 @@ var getFieldInfo = function(field) {
|
|
48774
48792
|
|
48775
48793
|
/** @public
|
48776
48794
|
* @param {string} field
|
48777
|
-
* @param {
|
48795
|
+
* @param {DataGenerator~FieldInformation|Function} options
|
48778
48796
|
*/
|
48779
48797
|
var addFieldInfo = function(field, options) {
|
48780
48798
|
if(field) {
|
@@ -48973,9 +48991,10 @@ var getSeed = function() {
|
|
48973
48991
|
return DataGenerator.seed;
|
48974
48992
|
};
|
48975
48993
|
|
48976
|
-
/**
|
48994
|
+
/** 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.
|
48995
|
+
* @public
|
48977
48996
|
* @param {string|Array.<string>} fields
|
48978
|
-
* @param {
|
48997
|
+
* @param {DataGenerator~DataOptions=} options
|
48979
48998
|
* @return {!Array.<Array>} 2D Array of data
|
48980
48999
|
*/
|
48981
49000
|
var generate = function(fields, options) {
|
@@ -48988,7 +49007,7 @@ var generate = function(fields, options) {
|
|
48988
49007
|
/** WARNING: This method does not modify global seed
|
48989
49008
|
* @public
|
48990
49009
|
* @param {string|Array.<string>} fields
|
48991
|
-
* @param {(number|
|
49010
|
+
* @param {(number|DataGenerator~DataOptions)=} options Configuration object or seed number
|
48992
49011
|
* @param {number=} seed
|
48993
49012
|
* @return {!Object} Object with the given fields as its keys
|
48994
49013
|
*/
|
@@ -49016,7 +49035,7 @@ var generateRecord = function(fields, options, seed) {
|
|
49016
49035
|
|
49017
49036
|
/** @public
|
49018
49037
|
* @param {string|Array.<string>} fields
|
49019
|
-
* @param {(number|
|
49038
|
+
* @param {(number|DataGenerator~DataOptions)=} options Configuration object or number of rows
|
49020
49039
|
* @return {!Array.<Object>} Array of object with the given fields as its keys
|
49021
49040
|
*/
|
49022
49041
|
var generateRecords = function(fields, options) {
|
@@ -49040,7 +49059,7 @@ var generateRecords = function(fields, options) {
|
|
49040
49059
|
/** WARNING: This method does not modify global seed
|
49041
49060
|
* @public
|
49042
49061
|
* @param {string} field
|
49043
|
-
* @param {
|
49062
|
+
* @param {DataGenerator~DataOptions=} options
|
49044
49063
|
* @param {number=} seed
|
49045
49064
|
* @return {!Object} Object with value, formattedValue and other properties
|
49046
49065
|
*/
|
@@ -49136,7 +49155,7 @@ var _hash = function(str) {
|
|
49136
49155
|
};
|
49137
49156
|
/** @private
|
49138
49157
|
* @param {string} field
|
49139
|
-
* @param {
|
49158
|
+
* @param {DataGenerator~DataOptions=} options
|
49140
49159
|
* @param {number=} seed
|
49141
49160
|
* @return {!Object} Object with value and other properties
|
49142
49161
|
*/
|
@@ -49207,9 +49226,10 @@ var DataGenerator = function(seed) {
|
|
49207
49226
|
*/
|
49208
49227
|
DataGenerator.prototype._seed = null;
|
49209
49228
|
|
49210
|
-
/**
|
49229
|
+
/** 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.
|
49230
|
+
* @public
|
49211
49231
|
* @param {string|Array.<string>} fields
|
49212
|
-
* @param {(number|
|
49232
|
+
* @param {(number|DataGenerator~DataOptions)=} options
|
49213
49233
|
* @return {!Array.<Array>} 2D Array of data
|
49214
49234
|
*/
|
49215
49235
|
DataGenerator.prototype.generate = function(fields, options) {
|
@@ -49244,7 +49264,7 @@ DataGenerator.prototype.generateRecords = function(fields, options) {
|
|
49244
49264
|
|
49245
49265
|
/** @public
|
49246
49266
|
* @param {string} field
|
49247
|
-
* @param {
|
49267
|
+
* @param {DataGenerator~DataOptions=} options
|
49248
49268
|
* @return {!Object} Object with value, formattedValue and other properties
|
49249
49269
|
*/
|
49250
49270
|
DataGenerator.prototype.generateQuoteData = function(field, options) {
|
@@ -49374,33 +49394,35 @@ DataGenerator.prototype.randString = function(min, max) {
|
|
49374
49394
|
|
49375
49395
|
/** @type {?number}
|
49376
49396
|
* @public
|
49397
|
+
* @ignore
|
49377
49398
|
*/
|
49378
49399
|
DataGenerator.seed = null;
|
49379
|
-
/**
|
49400
|
+
/** 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.
|
49401
|
+
* @public
|
49380
49402
|
* @function
|
49381
49403
|
* @param {string|Array.<string>} fields
|
49382
|
-
* @param {
|
49404
|
+
* @param {DataGenerator~DataOptions=} options
|
49383
49405
|
* @return {!Array.<Array>} 2D Array of data
|
49384
49406
|
*/
|
49385
49407
|
DataGenerator.generate = generate;
|
49386
49408
|
/** @public
|
49387
49409
|
* @function
|
49388
49410
|
* @param {string|Array.<string>} fields
|
49389
|
-
* @param {
|
49411
|
+
* @param {DataGenerator~DataOptions=} options
|
49390
49412
|
* @return {Object} Object with the given fields as its keys
|
49391
49413
|
*/
|
49392
49414
|
DataGenerator.generateRecord = generateRecord;
|
49393
49415
|
/** @public
|
49394
49416
|
* @function
|
49395
49417
|
* @param {string|Array.<string>} fields
|
49396
|
-
* @param {(number|
|
49418
|
+
* @param {(number|DataGenerator~DataOptions)=} options Configuration object or number of rows
|
49397
49419
|
* @return {!Array.<Object>} Array of object with the given fields as its keys
|
49398
49420
|
*/
|
49399
49421
|
DataGenerator.generateRecords = generateRecords;
|
49400
49422
|
/** @public
|
49401
49423
|
* @function
|
49402
49424
|
* @param {string} field
|
49403
|
-
* @param {
|
49425
|
+
* @param {DataGenerator~FieldInformation|Function} options
|
49404
49426
|
*/
|
49405
49427
|
DataGenerator.addFieldInfo = addFieldInfo;
|
49406
49428
|
/** Return a floating-point random number in the range min - max (inclusive of min, but not max) with prec digits of precision.
|
@@ -49475,6 +49497,8 @@ DataGenerator.randDate = randDate;
|
|
49475
49497
|
DataGenerator.randString = randString;
|
49476
49498
|
|
49477
49499
|
/** Convert 2D Array to Array of records
|
49500
|
+
* @public
|
49501
|
+
* @function
|
49478
49502
|
* @param {Array.<Array>} data2D Array of values
|
49479
49503
|
* @param {Array.<string>=} fields Keys to be mapped on the output records.
|
49480
49504
|
* @return {Array.<Object>} records
|
@@ -51284,7 +51308,9 @@ var OperatorPrecedences = {
|
|
51284
51308
|
"-": 4,
|
51285
51309
|
"*": 5,
|
51286
51310
|
"%": 6,
|
51287
|
-
"/": 6
|
51311
|
+
"/": 6,
|
51312
|
+
"!": 7,
|
51313
|
+
"!!": 7
|
51288
51314
|
};
|
51289
51315
|
/** @type {Object.<string, Function>}
|
51290
51316
|
* @private
|
@@ -51303,10 +51329,32 @@ var OperatorFunctions = {
|
|
51303
51329
|
"==": function(lhs, rhs){ return lhs == rhs; },
|
51304
51330
|
"!=": function(lhs, rhs){ return lhs != rhs; },
|
51305
51331
|
"&&": function(lhs, rhs){ return lhs && rhs; },
|
51306
|
-
"||": function(lhs, rhs){ return lhs || rhs; }
|
51332
|
+
"||": function(lhs, rhs){ return lhs || rhs; },
|
51333
|
+
"!": function(lhs, rhs){ return !lhs; },
|
51334
|
+
"!!": function(lhs, rhs){ return !!lhs; }
|
51307
51335
|
};
|
51308
51336
|
/** @type {Object.<string, Function>}
|
51309
51337
|
* @private
|
51338
|
+
* @const
|
51339
|
+
*/
|
51340
|
+
var OperandRequirements = {
|
51341
|
+
"+": 2,
|
51342
|
+
"-": 2,
|
51343
|
+
"*": 2,
|
51344
|
+
"/": 2,
|
51345
|
+
"%": 2,
|
51346
|
+
"<": 2,
|
51347
|
+
">": 2,
|
51348
|
+
"<=": 2,
|
51349
|
+
">=": 2,
|
51350
|
+
"==": 2,
|
51351
|
+
"!=": 2,
|
51352
|
+
"&&": 2,
|
51353
|
+
"||": 2,
|
51354
|
+
"!": 1,
|
51355
|
+
"!!": 1
|
51356
|
+
};
|
51357
|
+
/** @private
|
51310
51358
|
* @function
|
51311
51359
|
* @param {Array.<Object>} ary
|
51312
51360
|
* @param {string|number} value
|
@@ -51324,10 +51372,20 @@ var _addToken = function(ary, value, type, dataType) {
|
|
51324
51372
|
}
|
51325
51373
|
if(type === "operator") {
|
51326
51374
|
tok.precedence = OperatorPrecedences[value];
|
51375
|
+
} else if(type === "parenthesis") {
|
51376
|
+
tok.precedence = 0;
|
51327
51377
|
}
|
51328
51378
|
ary.push(tok);
|
51329
51379
|
return ary.length - 1;
|
51330
51380
|
};
|
51381
|
+
/** @private
|
51382
|
+
* @function
|
51383
|
+
* @param {Object} obj
|
51384
|
+
* @returns {*}
|
51385
|
+
*/
|
51386
|
+
var _toValue = function(obj) { // eslint-disable-line
|
51387
|
+
return obj.value;
|
51388
|
+
};
|
51331
51389
|
|
51332
51390
|
/** @public
|
51333
51391
|
* @namespace
|
@@ -51441,8 +51499,9 @@ ExpressionParser._tester = function(ctx) {
|
|
51441
51499
|
for(var i = 0; i < inputCount; ++i) {
|
51442
51500
|
var tok = rpn[i];
|
51443
51501
|
if(tok.type !== "literal") {
|
51444
|
-
|
51445
|
-
|
51502
|
+
var requiredCount = OperandRequirements[tok.value];
|
51503
|
+
if(operandCount >= requiredCount) {
|
51504
|
+
operandCount -= requiredCount;
|
51446
51505
|
} else {
|
51447
51506
|
console.warn("Cannot parse an expression with insufficient number of operands");
|
51448
51507
|
return true;
|
@@ -51483,11 +51542,18 @@ ExpressionParser._filter = function(ctx, rowData) {
|
|
51483
51542
|
curRes = rowData ? rowData[tokValue] : null;
|
51484
51543
|
}
|
51485
51544
|
} else { // operator
|
51486
|
-
|
51487
|
-
|
51488
|
-
|
51489
|
-
|
51490
|
-
|
51545
|
+
if(OperandRequirements[tokValue] === 1) {
|
51546
|
+
curRes = OperatorFunctions[tokValue](
|
51547
|
+
results[operandCount - 1]
|
51548
|
+
);
|
51549
|
+
operandCount -= 1;
|
51550
|
+
} else { // 2
|
51551
|
+
curRes = OperatorFunctions[tokValue](
|
51552
|
+
results[operandCount - 2],
|
51553
|
+
results[operandCount - 1]
|
51554
|
+
);
|
51555
|
+
operandCount -= 2;
|
51556
|
+
}
|
51491
51557
|
}
|
51492
51558
|
results[operandCount++] = curRes;
|
51493
51559
|
}
|
@@ -51556,7 +51622,6 @@ ExpressionParser.parse = function(expression) {
|
|
51556
51622
|
}
|
51557
51623
|
infixTokens.push(tok);
|
51558
51624
|
}
|
51559
|
-
// TODO: Handle the case where subtraction operator is in front of a variable
|
51560
51625
|
ExpressionParser._tokens.length = 0;
|
51561
51626
|
|
51562
51627
|
// Convert Infix notation to Reverse Polish Notation (Postfix)
|
@@ -51591,9 +51656,10 @@ ExpressionParser.parse = function(expression) {
|
|
51591
51656
|
}
|
51592
51657
|
}
|
51593
51658
|
} else { // operator
|
51594
|
-
|
51595
|
-
|
51596
|
-
|
51659
|
+
while(operators.length) {
|
51660
|
+
if(tok.precedence > operators[operators.length - 1].precedence) {
|
51661
|
+
break;
|
51662
|
+
}
|
51597
51663
|
rpn.push(operators.pop());
|
51598
51664
|
}
|
51599
51665
|
operators.push(tok);
|
@@ -51639,14 +51705,16 @@ ExpressionParser.parse = function(expression) {
|
|
51639
51705
|
|
51640
51706
|
|
51641
51707
|
/** @typedef {Object} CellPainter~Expression
|
51708
|
+
* @ignore
|
51709
|
+
* @description This form of expression is deprecated
|
51642
51710
|
* @property {string=} name
|
51643
51711
|
* @property {string} text Text describes condition e.g. [FIELD] > 10
|
51644
51712
|
* @property {Array=} values
|
51645
51713
|
*/
|
51646
51714
|
|
51647
51715
|
/** @typedef {Object} CellPainter~Condition
|
51648
|
-
* @property {string}
|
51649
|
-
* @property {
|
51716
|
+
* @property {string|Function} expression A function, text, or an object with text property that describes the condition
|
51717
|
+
* @property {string=} field Field to be used in the condition
|
51650
51718
|
* @property {string=} backgroundColor CSS color string
|
51651
51719
|
* @property {string=} color CSS color string
|
51652
51720
|
* @property {string=} fontSize
|
@@ -51697,6 +51765,10 @@ CellPainter.prototype._conditions = null;
|
|
51697
51765
|
/** @type {Object}
|
51698
51766
|
* @private
|
51699
51767
|
*/
|
51768
|
+
CellPainter.prototype._effectiveStyles = null;
|
51769
|
+
/** @type {Object}
|
51770
|
+
* @private
|
51771
|
+
*/
|
51700
51772
|
CellPainter.prototype._blinkCondition = null;
|
51701
51773
|
/** @type {!Array}
|
51702
51774
|
* @private
|
@@ -51710,17 +51782,16 @@ CellPainter.prototype._columnStats = null;
|
|
51710
51782
|
* @private
|
51711
51783
|
*/
|
51712
51784
|
CellPainter.prototype._levelColorDisabled = false;
|
51713
|
-
|
51714
51785
|
/** @type {number}
|
51715
51786
|
* @private
|
51716
51787
|
*/
|
51717
|
-
CellPainter.
|
51718
|
-
|
51788
|
+
CellPainter.prototype._blinkingDuration = 250;
|
51719
51789
|
|
51720
51790
|
/** @type {number}
|
51721
51791
|
* @private
|
51722
51792
|
*/
|
51723
|
-
CellPainter.
|
51793
|
+
CellPainter._runningBlinkId = 0;
|
51794
|
+
|
51724
51795
|
/** @type {Array.<CellPainter>}
|
51725
51796
|
* @private
|
51726
51797
|
* @const
|
@@ -51820,6 +51891,7 @@ CellPainter.prototype.reset = function() {
|
|
51820
51891
|
CellPainter.prototype.resetColoring = function() {
|
51821
51892
|
// reset coloring type to allow other extensions to be able to set their new mode
|
51822
51893
|
this._setColoringType(0);
|
51894
|
+
this._effectiveStyles = null;
|
51823
51895
|
this._conditions.length = 0;
|
51824
51896
|
};
|
51825
51897
|
|
@@ -51919,6 +51991,18 @@ CellPainter.prototype._setColoringType = function(enumType) {
|
|
51919
51991
|
}
|
51920
51992
|
};
|
51921
51993
|
/** @public
|
51994
|
+
* @param {Object} mapping Effective styles mapping
|
51995
|
+
*/
|
51996
|
+
CellPainter.prototype.setEffectiveStyles = function(mapping) {
|
51997
|
+
this._effectiveStyles = mapping;
|
51998
|
+
};
|
51999
|
+
/** @public
|
52000
|
+
* @return {Object}
|
52001
|
+
*/
|
52002
|
+
CellPainter.prototype.getEffectiveStyles = function() {
|
52003
|
+
return this._effectiveStyles;
|
52004
|
+
};
|
52005
|
+
/** @public
|
51922
52006
|
* @param {Array.<CellPainter~Condition>} conditions
|
51923
52007
|
*/
|
51924
52008
|
CellPainter.prototype.setConditions = function(conditions) {
|
@@ -51943,7 +52027,7 @@ CellPainter.prototype.getColumnStats = function() {
|
|
51943
52027
|
return this._columnStats;
|
51944
52028
|
};
|
51945
52029
|
/** @private
|
51946
|
-
* @param {CellPainter~Condition
|
52030
|
+
* @param {CellPainter~Condition} condition
|
51947
52031
|
*/
|
51948
52032
|
CellPainter.prototype._addCondition = function(condition) {
|
51949
52033
|
var exp = condition["expression"];
|
@@ -52536,9 +52620,17 @@ CellPainter.clearCellStyle = function(cell, styles) {
|
|
52536
52620
|
elem.classList.remove(elem._coloringCssClass);
|
52537
52621
|
}
|
52538
52622
|
|
52539
|
-
styles
|
52540
|
-
|
52541
|
-
|
52623
|
+
if(!styles){
|
52624
|
+
styles = CellPainter.supportedStyles;
|
52625
|
+
}
|
52626
|
+
if(Array.isArray(styles)){
|
52627
|
+
for(var i = styles.length; --i >= 0;) {
|
52628
|
+
elem.style[styles[i]] = ""; // WARNING: Very slow
|
52629
|
+
}
|
52630
|
+
} else {
|
52631
|
+
for(var key in styles) {
|
52632
|
+
elem.style[key] = ""; // WARNING: Very slow
|
52633
|
+
}
|
52542
52634
|
}
|
52543
52635
|
};
|
52544
52636
|
/** @private
|
@@ -52660,26 +52752,29 @@ CellPainter.prototype._paintCell = function(cell, rowData, min, max) {
|
|
52660
52752
|
}
|
52661
52753
|
|
52662
52754
|
var styles = this._getStyles(rowData, min, max);
|
52755
|
+
|
52756
|
+
var elStyle = elem.style;
|
52757
|
+
|
52663
52758
|
var cssClass = styles["cssClass"]; // Can be an empty string
|
52759
|
+
if (elem._coloringCssClass && elem._coloringCssClass !== cssClass) {
|
52760
|
+
elem.classList.remove(elem._coloringCssClass);
|
52761
|
+
elem._coloringCssClass = null;
|
52762
|
+
}
|
52664
52763
|
if (cssClass != null) { // Predefined colors mode
|
52665
|
-
if (elem._coloringCssClass && elem._coloringCssClass !== cssClass) {
|
52666
|
-
elem.classList.remove(elem._coloringCssClass);
|
52667
|
-
elem._coloringCssClass = null;
|
52668
|
-
}
|
52669
52764
|
if (cssClass) {
|
52670
52765
|
elem.classList.add(cssClass);
|
52671
52766
|
elem._coloringCssClass = cssClass;
|
52672
52767
|
}
|
52673
52768
|
} else {
|
52674
|
-
if
|
52675
|
-
|
52676
|
-
|
52769
|
+
if(styles["backgroundColor"]){
|
52770
|
+
elStyle.backgroundColor = styles["backgroundColor"];
|
52771
|
+
} else if(!this._effectiveStyles || this._effectiveStyles["backgroundColor"]){
|
52772
|
+
elStyle.backgroundColor = "";
|
52677
52773
|
}
|
52678
|
-
|
52679
|
-
|
52680
|
-
|
52681
|
-
|
52682
|
-
elStyle[styleName] = styles[styleName] || "";
|
52774
|
+
if(styles["color"]){
|
52775
|
+
elStyle.color = styles["color"];
|
52776
|
+
} else if(!this._effectiveStyles || this._effectiveStyles["color"]){
|
52777
|
+
elStyle.color = "";
|
52683
52778
|
}
|
52684
52779
|
}
|
52685
52780
|
};
|
@@ -52772,7 +52867,7 @@ CellPainter.prototype._blinkCell = function(cell, rowData, blinkSignal) {
|
|
52772
52867
|
}
|
52773
52868
|
|
52774
52869
|
CellPainter._clearBlinkTimer(scope);
|
52775
|
-
scope["blinkTimer"] = setTimeout(scope._restorer,
|
52870
|
+
scope["blinkTimer"] = setTimeout(scope._restorer, this._blinkingDuration);
|
52776
52871
|
|
52777
52872
|
return bgBlinking;
|
52778
52873
|
};
|
@@ -52800,6 +52895,15 @@ CellPainter.prototype.verifyBlinking = function(cell, rowData) {
|
|
52800
52895
|
CellPainter.prototype.disableLevelColor = function(disabled) {
|
52801
52896
|
this._levelColorDisabled = disabled !== false;
|
52802
52897
|
};
|
52898
|
+
/**
|
52899
|
+
* @public
|
52900
|
+
* @param {number} duration
|
52901
|
+
*/
|
52902
|
+
CellPainter.prototype.setBlinkingDuration = function(duration) {
|
52903
|
+
if(typeof duration === "number"){
|
52904
|
+
this._blinkingDuration = duration;
|
52905
|
+
}
|
52906
|
+
};
|
52803
52907
|
|
52804
52908
|
/* harmony default export */ var es6_CellPainter = (CellPainter);
|
52805
52909
|
|