@refinitiv-ui/efx-grid 6.0.5 → 6.0.6
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.d.ts +13 -11
- package/lib/column-dragging/es6/ColumnDragging.js +21 -15
- package/lib/column-format-dialog/lib/column-format-dialog.d.ts +1 -1
- package/lib/column-format-dialog/lib/column-format-dialog.js +3 -4
- package/lib/column-format-dialog/lib/preview-table.js +3 -4
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +2 -2
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +23 -7
- package/lib/core/dist/core.css +1 -1
- package/lib/core/dist/core.js +372 -229
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/ColumnStats.d.ts +3 -3
- package/lib/core/es6/data/DataCache.d.ts +9 -9
- package/lib/core/es6/data/DataTable.d.ts +28 -28
- package/lib/core/es6/data/DataTable.js +33 -10
- package/lib/core/es6/data/DataView.d.ts +62 -62
- package/lib/core/es6/data/DataView.js +42 -22
- package/lib/core/es6/data/Segment.d.ts +4 -4
- package/lib/core/es6/data/SegmentCollection.d.ts +7 -7
- package/lib/core/es6/data/WrappedView.d.ts +62 -62
- package/lib/core/es6/grid/Core.d.ts +95 -95
- package/lib/core/es6/grid/Core.js +173 -25
- package/lib/core/es6/grid/ILayoutGrid.d.ts +20 -20
- package/lib/core/es6/grid/ILayoutGrid.js +2 -1
- package/lib/core/es6/grid/LayoutGrid.d.ts +2 -2
- package/lib/core/es6/grid/LayoutGrid.js +18 -10
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +2 -2
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +14 -3
- package/lib/core/es6/grid/components/Cell.d.ts +6 -6
- package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +2 -2
- package/lib/core/es6/grid/components/CellSpans.d.ts +2 -2
- package/lib/core/es6/grid/components/Column.d.ts +2 -2
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +19 -19
- package/lib/core/es6/grid/components/Scrollbar.d.ts +9 -9
- package/lib/core/es6/grid/components/StretchedCells.js +12 -2
- package/lib/core/es6/grid/event/EventDispatcher.d.ts +3 -3
- package/lib/core/es6/grid/event/EventListeners.d.ts +5 -5
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +45 -44
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +62 -65
- package/lib/core/es6/grid/util/Conflator.d.ts +4 -4
- package/lib/core/es6/grid/util/HttpRequest.d.ts +3 -3
- package/lib/core/es6/grid/util/PercentBar.d.ts +8 -8
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +8 -8
- package/lib/core/es6/grid/util/RangeBar.d.ts +1 -1
- package/lib/core/es6/grid/util/RangeBar.js +1 -1
- package/lib/core/es6/grid/util/Reverter.d.ts +1 -1
- package/lib/core/es6/grid/util/SectionSettings.d.ts +13 -13
- package/lib/core/es6/grid/util/SelectionList.d.ts +2 -2
- package/lib/core/es6/grid/util/TrackLayout.d.ts +9 -9
- package/lib/core/es6/grid/util/Virtualizer.d.ts +3 -3
- package/lib/core/es6/grid/util/util.d.ts +6 -4
- package/lib/core/es6/grid/util/util.js +16 -91
- package/lib/core/es6/tr-grid-theme.js +1 -1
- package/lib/filter-dialog/lib/checkbox-list.d.ts +1 -1
- package/lib/filter-dialog/lib/filter-dialog.d.ts +1 -1
- package/lib/filter-dialog/lib/filter-dialog.js +27 -9
- package/lib/filter-dialog/themes/base-checkbox.less +0 -1
- package/lib/filter-dialog/themes/base.less +1 -1
- package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
- package/lib/grid/index.js +1 -1
- package/lib/grid/lib/efx-grid.js +3 -0
- package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
- package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/grid/themes/halo/efx-grid.less +5 -5
- package/lib/grid/themes/halo/light/efx-grid.js +1 -1
- package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +30 -24
- package/lib/row-segmenting/es6/RowSegmenting.js +122 -21
- package/lib/rt-grid/dist/rt-grid.js +689 -367
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +46 -42
- package/lib/rt-grid/es6/ColumnDefinition.js +31 -1
- package/lib/rt-grid/es6/DataConnector.d.ts +6 -4
- package/lib/rt-grid/es6/DataConnector.js +8 -0
- package/lib/rt-grid/es6/FieldDefinition.d.ts +2 -2
- package/lib/rt-grid/es6/FieldDefinition.js +12 -5
- package/lib/rt-grid/es6/Grid.d.ts +102 -94
- package/lib/rt-grid/es6/Grid.js +70 -105
- package/lib/rt-grid/es6/ReferenceCounter.d.ts +5 -5
- package/lib/rt-grid/es6/RowDefSorter.d.ts +2 -2
- package/lib/rt-grid/es6/RowDefinition.d.ts +22 -22
- package/lib/rt-grid/es6/RowDefinition.js +12 -5
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +3 -3
- package/lib/rt-grid/es6/StyleLoader.d.ts +1 -1
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +11 -11
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +20 -35
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +18 -16
- package/lib/tr-grid-checkbox/es6/Checkbox.js +1 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.d.ts +29 -27
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +1 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +28 -14
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +556 -11
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +2 -2
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +1 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +2 -3
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +15 -13
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +96 -72
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +11 -2
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +309 -114
- package/lib/tr-grid-content-wrap/es6/ContentWrap.js +1 -6
- package/lib/tr-grid-contextmenu/es6/ContextMenu.js +3 -3
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +2 -2
- package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +2 -2
- package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +2 -1
- package/lib/tr-grid-heat-map/es6/HeatMap.js +6 -9
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +5 -2
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +311 -71
- package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +1 -1
- package/lib/tr-grid-percent-bar/es6/PercentBar.js +8 -11
- package/lib/tr-grid-printer/es6/SectionWriter.js +8 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.js +3 -10
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +6 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +56 -23
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +4 -3
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +57 -13
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1 -1
- package/lib/tr-grid-row-selection/es6/RowSelection.js +2 -3
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +0 -2
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +1 -40
- package/lib/tr-grid-util/es6/CellPainter.d.ts +30 -30
- package/lib/tr-grid-util/es6/CellPainter.js +9 -8
- package/lib/tr-grid-util/es6/Conflator.d.ts +4 -4
- package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
- package/lib/tr-grid-util/es6/DateTime.d.ts +10 -10
- package/lib/tr-grid-util/es6/Deferred.d.ts +3 -1
- package/lib/tr-grid-util/es6/Deferred.js +11 -1
- package/lib/tr-grid-util/es6/Delay.d.ts +2 -2
- package/lib/tr-grid-util/es6/Dom.d.ts +10 -10
- package/lib/tr-grid-util/es6/Dom.js +14 -10
- package/lib/tr-grid-util/es6/DragUI.js +5 -2
- package/lib/tr-grid-util/es6/ElementObserver.d.ts +2 -2
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +4 -4
- package/lib/tr-grid-util/es6/ElfDate.d.ts +5 -5
- package/lib/tr-grid-util/es6/ElfDate.js +1 -0
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +10 -4
- package/lib/tr-grid-util/es6/ElfUtil.js +53 -4
- package/lib/tr-grid-util/es6/EventDispatcher.d.ts +5 -5
- package/lib/tr-grid-util/es6/ExpanderIcon.d.ts +2 -2
- package/lib/tr-grid-util/es6/ExpanderIcon.js +1 -1
- package/lib/tr-grid-util/es6/Ext.d.ts +1 -1
- package/lib/tr-grid-util/es6/FieldFormatter.d.ts +12 -12
- package/lib/tr-grid-util/es6/FieldFormatter.js +1 -1
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +13 -13
- package/lib/tr-grid-util/es6/FilterBuilder.js +15 -8
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +22 -22
- package/lib/tr-grid-util/es6/FilterOperators.js +3 -3
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +10 -10
- package/lib/tr-grid-util/es6/GridPlugin.js +20 -0
- package/lib/tr-grid-util/es6/Icon.d.ts +3 -3
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +8 -8
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +6 -6
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +19 -19
- package/lib/tr-grid-util/es6/NumberFormatter.js +1 -1
- package/lib/tr-grid-util/es6/PercentBar.d.ts +19 -19
- package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
- package/lib/tr-grid-util/es6/Popup.d.ts +36 -33
- package/lib/tr-grid-util/es6/Popup.js +19 -1
- package/lib/tr-grid-util/es6/RangeBar.d.ts +5 -5
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +4 -4
- package/lib/tr-grid-util/es6/RowPainter.d.ts +37 -4
- package/lib/tr-grid-util/es6/RowPainter.js +199 -76
- package/lib/tr-grid-util/es6/SubTable.d.ts +14 -14
- package/lib/tr-grid-util/es6/Table.d.ts +25 -25
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +1 -1
- package/lib/tr-grid-util/es6/Timer.d.ts +1 -1
- package/lib/tr-grid-util/es6/TouchProxy.d.ts +9 -9
- package/lib/tr-grid-util/es6/Util.d.ts +12 -12
- package/lib/tr-grid-util/es6/formula/ADCService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/ADCSubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/AdFinService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/Engine.d.ts +9 -9
- package/lib/tr-grid-util/es6/formula/Formula.d.ts +4 -4
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/Realtime.d.ts +3 -3
- package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/TSIService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/TSISubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/VariableToken.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +34 -34
- package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
- package/lib/tr-grid-util/es6/jet/MockJET.js +12 -4
- package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +9 -9
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +17 -9
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +84 -24
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +42 -2
- package/lib/tr-grid-util/es6/jet/MockRTK.js +55 -16
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +2 -2
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +99 -1
- package/lib/types/es6/Checkbox.d.ts +18 -16
- package/lib/types/es6/ColumnFormatting.d.ts +29 -27
- package/lib/types/es6/ColumnGrouping.d.ts +28 -14
- package/lib/types/es6/ColumnResizing.d.ts +2 -2
- package/lib/types/es6/ColumnStack.d.ts +15 -13
- package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +4 -2
- package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +0 -1
- package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +1 -1
- package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +1 -1
- package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +1 -5
- package/lib/types/es6/CompositeGrid/Plugin.d.ts +3 -1
- package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +2 -1
- package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +2 -1
- package/lib/types/es6/CompositeGrid/TextWidthCalculator.d.ts +1 -1
- package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +0 -1
- package/lib/types/es6/ConditionalColoring.d.ts +11 -2
- package/lib/types/es6/Core/data/ColumnStats.d.ts +3 -3
- package/lib/types/es6/Core/data/DataCache.d.ts +9 -9
- package/lib/types/es6/Core/data/DataTable.d.ts +28 -28
- package/lib/types/es6/Core/data/DataView.d.ts +62 -62
- package/lib/types/es6/Core/data/Segment.d.ts +4 -4
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +7 -7
- package/lib/types/es6/Core/data/WrappedView.d.ts +62 -62
- package/lib/types/es6/Core/grid/Core.d.ts +95 -95
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +20 -20
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +2 -2
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/Cell.d.ts +6 -6
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/Column.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +19 -19
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +9 -9
- package/lib/types/es6/Core/grid/event/EventDispatcher.d.ts +3 -3
- package/lib/types/es6/Core/grid/event/EventListeners.d.ts +5 -5
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +45 -44
- package/lib/types/es6/Core/grid/util/Conflator.d.ts +4 -4
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +3 -3
- package/lib/types/es6/Core/grid/util/PercentBar.d.ts +8 -8
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +8 -8
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +1 -1
- package/lib/types/es6/Core/grid/util/Reverter.d.ts +1 -1
- package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +13 -13
- package/lib/types/es6/Core/grid/util/SelectionList.d.ts +2 -2
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +9 -9
- package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +3 -3
- package/lib/types/es6/Core/grid/util/util.d.ts +6 -4
- package/lib/types/es6/HeatMap.d.ts +2 -1
- package/lib/types/es6/InCellEditing.d.ts +5 -2
- package/lib/types/es6/MenuEventAPI.d.ts +2 -2
- package/lib/types/es6/MenuItem.d.ts +2 -2
- package/lib/types/es6/PercentBar.d.ts +1 -1
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +46 -42
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +6 -4
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +2 -2
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +100 -92
- package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +5 -5
- package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +2 -2
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +22 -22
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +3 -3
- package/lib/types/es6/RealtimeGrid/StyleLoader.d.ts +1 -1
- package/lib/types/es6/RowColoring.d.ts +0 -2
- package/lib/types/es6/RowDragging.d.ts +6 -0
- package/lib/types/es6/RowFiltering.d.ts +4 -3
- package/lib/types/es6/RowSegmenting.d.ts +30 -24
- package/lib/versions.json +26 -26
- package/package.json +2 -2
@@ -14,6 +14,14 @@ import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
|
|
14
14
|
* @property {string=} field
|
15
15
|
*/
|
16
16
|
|
17
|
+
/** @typedef {Object} ConditionalColoringPlugin~ConditionalColoringOptions
|
18
|
+
* @description Extension column options that can be specified on each individual grid's column option:
|
19
|
+
* @property {Array.<ConditionalColoringPlugin~Condition>=} conditions=null List of condition options
|
20
|
+
* @property {(string|boolean)=} colorText=null A shorthand for specifying default condition based on the field.
|
21
|
+
* @property {(string|boolean)=} tickColor=null Alias of colorText.
|
22
|
+
* @property {string=} field
|
23
|
+
*/
|
24
|
+
|
17
25
|
/** @typedef {Object} ConditionalColoringPlugin~Condition
|
18
26
|
* @description Available options describing `condition` object
|
19
27
|
* @property {(string|Function)=} expression Expression could be `[FIELD_1] > 0`
|
@@ -31,6 +39,26 @@ import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
|
|
31
39
|
* @property {(string|boolean)=} level CSS color (e.g. #33333, grey). If false value is specified, blinking for level color is disabled.
|
32
40
|
*/
|
33
41
|
|
42
|
+
var COLORING_TYPE = "coloring";
|
43
|
+
var BLINKING_TYPE = "blinking";
|
44
|
+
|
45
|
+
var _bracketExp = /\[[^\[\]]*\]/g;
|
46
|
+
|
47
|
+
/** @private
|
48
|
+
* @param {string} exp Expression string
|
49
|
+
* @return {Array.<string>}
|
50
|
+
*/
|
51
|
+
var _getFieldsFromExpression = function(exp) {
|
52
|
+
var fields = [];
|
53
|
+
if(exp) {
|
54
|
+
var matches = exp.match(_bracketExp);
|
55
|
+
for (var i = 0; i < matches.length; i++) {
|
56
|
+
fields.push(matches[i].replace(/[\[\]]/g, ""));
|
57
|
+
}
|
58
|
+
}
|
59
|
+
return fields;
|
60
|
+
};
|
61
|
+
|
34
62
|
/** @constructor
|
35
63
|
* @extends {GridPlugin}
|
36
64
|
*/
|
@@ -57,6 +85,11 @@ ConditionalColoringPlugin._cleanUpTimer = 0;
|
|
57
85
|
*/
|
58
86
|
ConditionalColoringPlugin.prototype._blinkingEnabled = false; // WORKAROUND: To improve performance
|
59
87
|
|
88
|
+
/** @type {Array}
|
89
|
+
* @private
|
90
|
+
*/
|
91
|
+
ConditionalColoringPlugin.prototype._pendingFields;
|
92
|
+
|
60
93
|
/** @override
|
61
94
|
* @return {string}
|
62
95
|
*/
|
@@ -96,7 +129,7 @@ ConditionalColoringPlugin.prototype.initialize = function (host, options) {
|
|
96
129
|
host.listen("columnRemoved", this._onColumnRemoved);
|
97
130
|
|
98
131
|
if (!CellPainter.themeReady) {
|
99
|
-
CellPainter.loadThemeColors().then(this._onThemeLoaded);
|
132
|
+
CellPainter.loadThemeColors().then(this._onThemeLoaded).catch(this._onThemeLoaded);
|
100
133
|
}
|
101
134
|
|
102
135
|
// Register callback for movement-color-profile attribute changed event
|
@@ -106,6 +139,22 @@ ConditionalColoringPlugin.prototype.initialize = function (host, options) {
|
|
106
139
|
// DO something
|
107
140
|
};
|
108
141
|
|
142
|
+
/** @override
|
143
|
+
*/
|
144
|
+
ConditionalColoringPlugin.prototype._afterInit = function () {
|
145
|
+
var pendingFields = this._pendingFields;
|
146
|
+
if(pendingFields) {
|
147
|
+
var fields, colIndex, type;
|
148
|
+
for(var i = 0; i < pendingFields.length; i++) {
|
149
|
+
fields = pendingFields[i][0];
|
150
|
+
colIndex = pendingFields[i][1];
|
151
|
+
type = pendingFields[i][2];
|
152
|
+
this._addDataFields(fields, colIndex, type);
|
153
|
+
}
|
154
|
+
this._pendingFields = null;
|
155
|
+
}
|
156
|
+
};
|
157
|
+
|
109
158
|
/** @public
|
110
159
|
* @param {Object} host core grid object
|
111
160
|
*/
|
@@ -163,53 +212,67 @@ ConditionalColoringPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
163
212
|
}
|
164
213
|
|
165
214
|
var len = this.getColumnCount();
|
166
|
-
var host = this._hosts[0];
|
167
215
|
for (var i = 0; i < len; ++i) {
|
168
216
|
var column = columns[i];
|
169
217
|
if (!column) {
|
170
218
|
column = columns[i] = {};
|
171
219
|
}
|
172
220
|
|
173
|
-
|
174
|
-
|
175
|
-
column.conditions = [];
|
221
|
+
this.getColumnColoring(i, column);
|
222
|
+
}
|
176
223
|
|
177
|
-
|
178
|
-
|
179
|
-
var exCondition = {};
|
180
|
-
extendObject(exCondition, conditions[colIndex], [
|
181
|
-
'expression',
|
182
|
-
'backgroundColor',
|
183
|
-
'color'
|
184
|
-
]);
|
224
|
+
return obj;
|
225
|
+
};
|
185
226
|
|
186
|
-
|
187
|
-
|
227
|
+
/** @public
|
228
|
+
* @param {number} colIndex
|
229
|
+
* @param {Object=} options
|
230
|
+
* @return {!ConditionalColoringPlugin~ColumnOptions}
|
231
|
+
*/
|
232
|
+
ConditionalColoringPlugin.prototype.getColumnColoring = function(colIndex, options) {
|
233
|
+
if(!options) {
|
234
|
+
options = {};
|
235
|
+
}
|
236
|
+
var host = this._hosts[0];
|
237
|
+
var conditions = this._getColumnOption(colIndex, "conditions", host);
|
238
|
+
if (Array.isArray(conditions) && conditions.length > 0) {
|
239
|
+
options.conditions = [];
|
240
|
+
|
241
|
+
var count = conditions.length;
|
242
|
+
for (var n = 0; n < count; n++) {
|
243
|
+
var exCondition = {};
|
244
|
+
extendObject(exCondition, conditions[n], [
|
245
|
+
"expression",
|
246
|
+
"backgroundColor",
|
247
|
+
"color"
|
248
|
+
]);
|
249
|
+
|
250
|
+
options.conditions.push(exCondition);
|
188
251
|
}
|
252
|
+
}
|
189
253
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
254
|
+
var colorText = this._getColumnOption(colIndex, "colorText", host);
|
255
|
+
if (colorText) {
|
256
|
+
options.colorText = colorText;
|
257
|
+
}
|
194
258
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
259
|
+
// alias with colorText
|
260
|
+
var tickColor = this._getColumnOption(colIndex, "tickColor", host);
|
261
|
+
if (tickColor) {
|
262
|
+
options.tickColor = tickColor;
|
263
|
+
}
|
200
264
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
265
|
+
var blinking = this._getColumnOption(colIndex, "blinking", host);
|
266
|
+
if (blinking) {
|
267
|
+
options.blinking = blinking;
|
268
|
+
}
|
205
269
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
}
|
270
|
+
var field = this._getField(colIndex);
|
271
|
+
if (field) {
|
272
|
+
options.field = field;
|
210
273
|
}
|
211
274
|
|
212
|
-
return
|
275
|
+
return options;
|
213
276
|
};
|
214
277
|
|
215
278
|
/** @private
|
@@ -232,6 +295,20 @@ ConditionalColoringPlugin.prototype._applyStyle = function(host, options) {
|
|
232
295
|
}
|
233
296
|
};
|
234
297
|
|
298
|
+
/** @private
|
299
|
+
* @param {number} colIndex
|
300
|
+
* @param {boolean=} enabled=true
|
301
|
+
*/
|
302
|
+
ConditionalColoringPlugin.prototype._enableColumnStyle = function(colIndex, enabled) {
|
303
|
+
enabled = enabled !== false;
|
304
|
+
var hosts = this._hosts;
|
305
|
+
var grid;
|
306
|
+
for(var i = hosts.length; --i >= 0;) {
|
307
|
+
grid = hosts[i];
|
308
|
+
grid.enableColumnClass(colIndex, "conditionally-colored", enabled);
|
309
|
+
}
|
310
|
+
};
|
311
|
+
|
235
312
|
/** @private
|
236
313
|
* @param {CellPainter=} painter
|
237
314
|
* @return {boolean}
|
@@ -267,20 +344,6 @@ ConditionalColoringPlugin.prototype._clearCellStyles = function(colIndex) {
|
|
267
344
|
}
|
268
345
|
};
|
269
346
|
|
270
|
-
/** @private
|
271
|
-
* @param {number} colIndex
|
272
|
-
* @param {boolean=} enabled
|
273
|
-
*/
|
274
|
-
ConditionalColoringPlugin.prototype._enableColumnStyle = function(colIndex, enabled) {
|
275
|
-
enabled = enabled !== false;
|
276
|
-
var hosts = this._hosts;
|
277
|
-
var grid;
|
278
|
-
for(var i = hosts.length; --i >= 0;) {
|
279
|
-
grid = hosts[i];
|
280
|
-
grid.enableColumnClass(colIndex, "conditionally-colored", enabled);
|
281
|
-
}
|
282
|
-
};
|
283
|
-
|
284
347
|
/** @private
|
285
348
|
*/
|
286
349
|
ConditionalColoringPlugin.prototype._cachePreviousValue = function() {
|
@@ -324,15 +387,70 @@ ConditionalColoringPlugin.prototype._cacheColumnPreviousValue = function(colInde
|
|
324
387
|
}
|
325
388
|
};
|
326
389
|
|
390
|
+
/** @private
|
391
|
+
* @param {string|Array.<string>} fieldRef
|
392
|
+
* @param {(Object|number)=} colRef
|
393
|
+
* @param {string} type
|
394
|
+
*/
|
395
|
+
ConditionalColoringPlugin.prototype._addDataFields = function(fieldRef, colRef, type) {
|
396
|
+
if(!this._realTimeGrid || !fieldRef || !type) {
|
397
|
+
return;
|
398
|
+
}
|
399
|
+
var referrer = null;
|
400
|
+
if (colRef != null) {
|
401
|
+
var colDef = typeof colRef === "object" ? colRef : this._realTimeGrid.getColumnDefinition(colRef);
|
402
|
+
referrer = colDef ? colDef.getId() + "_" + type : null;
|
403
|
+
}
|
404
|
+
|
405
|
+
this._realTimeGrid.addDataFields(fieldRef, referrer);
|
406
|
+
};
|
407
|
+
|
408
|
+
/** @private
|
409
|
+
* @param {string|Array.<string>} fieldRef
|
410
|
+
* @param {(Object|number)=} colRef
|
411
|
+
* @param {string} type
|
412
|
+
*/
|
413
|
+
ConditionalColoringPlugin.prototype._removeDataFields = function(fieldRef, colRef, type) {
|
414
|
+
if(!this._realTimeGrid || !fieldRef || !type) {
|
415
|
+
return;
|
416
|
+
}
|
417
|
+
var referrer = null;
|
418
|
+
if (colRef != null) {
|
419
|
+
var colDef = typeof colRef === "object" ? colRef : this._realTimeGrid.getColumnDefinition(colRef);
|
420
|
+
referrer = colDef ? colDef.getId() + "_" + type : null;
|
421
|
+
}
|
422
|
+
this._realTimeGrid.removeDataFields(fieldRef, referrer);
|
423
|
+
};
|
424
|
+
|
425
|
+
/** @private
|
426
|
+
* @param {(Object|number)=} colRef
|
427
|
+
* @param {string} type
|
428
|
+
*/
|
429
|
+
ConditionalColoringPlugin.prototype._removeFieldReferrer = function(colRef, type) {
|
430
|
+
if(!this._realTimeGrid || !type) {
|
431
|
+
return;
|
432
|
+
}
|
433
|
+
var referrer = null;
|
434
|
+
if (colRef != null) {
|
435
|
+
var colDef = typeof colRef === "object" ? colRef : this._realTimeGrid.getColumnDefinition(colRef);
|
436
|
+
referrer = colDef ? colDef.getId() + "_" + type : null;
|
437
|
+
this._realTimeGrid.removeFieldReferrer(referrer);
|
438
|
+
}
|
439
|
+
};
|
440
|
+
|
327
441
|
/** @public
|
328
442
|
* @description To define coloring for columns, conditions or colorText or tickColor need to be specified.
|
329
|
-
* To enable cell blinking the blinking option need to be defined
|
330
|
-
* can be applied to a column at the same time
|
331
|
-
*
|
443
|
+
* To enable cell blinking the blinking option need to be defined.<br>
|
444
|
+
* Coloring options and blinking options can be applied to a column at the same time.<br>
|
445
|
+
* The blinking or coloring abilities will be removed if the correspondent options are not given.<br>
|
446
|
+
* If columnOptions is undefined or null, both coloring and blinking will be removed.
|
332
447
|
* @param {number} colIndex
|
333
448
|
* @param {(ConditionalColoringPlugin~ColumnOptions|null)=} columnOptions
|
449
|
+
* @see {@link ConditionalColoringPlugin.setConditionalColoring}
|
450
|
+
* @see {@link ConditionalColoringPlugin.setColumnBlinking}
|
334
451
|
* @example
|
335
452
|
* var columnOptions1 = {
|
453
|
+
* "field": "string",
|
336
454
|
* "conditions": [{ // Array.<Object> Condition Object Properties
|
337
455
|
* "expression": "[column0] > 0", // string
|
338
456
|
* "backgroundColor": "", // Optional string e.g. #ffffff, black
|
@@ -341,7 +459,8 @@ ConditionalColoringPlugin.prototype._cacheColumnPreviousValue = function(colInde
|
|
341
459
|
* };
|
342
460
|
* var columnOptions2 = {
|
343
461
|
* "field": "string",
|
344
|
-
* "colorText": true // string as Field or boolean for text coloring mode
|
462
|
+
* "colorText": true, // string as Field or boolean for text coloring mode
|
463
|
+
* "blinking": true
|
345
464
|
* };
|
346
465
|
*/
|
347
466
|
ConditionalColoringPlugin.prototype.setColumnColoring = function (colIndex, columnOptions) {
|
@@ -353,7 +472,7 @@ ConditionalColoringPlugin.prototype.setColumnColoring = function (colIndex, colu
|
|
353
472
|
colData["colorText"] = columnOptions["colorText"];
|
354
473
|
colData["tickColor"] = columnOptions["tickColor"];
|
355
474
|
colData["blinking"] = blinkingOptions = columnOptions["blinking"];
|
356
|
-
field = columnOptions["field"];
|
475
|
+
colData["field"] = field = columnOptions["field"];
|
357
476
|
} else {
|
358
477
|
colData["conditions"] = null;
|
359
478
|
colData["colorText"] = null;
|
@@ -362,13 +481,39 @@ ConditionalColoringPlugin.prototype.setColumnColoring = function (colIndex, colu
|
|
362
481
|
}
|
363
482
|
|
364
483
|
this.setColumnBlinking(colIndex, blinkingOptions, field);
|
484
|
+
this.setConditionalColoring(colIndex, columnOptions);
|
365
485
|
|
486
|
+
if (colData["painter"] && !(colData["coloringFields"] || colData["blinkingField"])) { // Clear existing painter
|
487
|
+
this._clearPainter(colData);
|
488
|
+
}
|
489
|
+
};
|
490
|
+
|
491
|
+
/** @public
|
492
|
+
* @param {number} colIndex
|
493
|
+
* @param {(ConditionalColoringPlugin~ConditionalColoringOptions|null)=} coloringOptions
|
494
|
+
*/
|
495
|
+
ConditionalColoringPlugin.prototype.setConditionalColoring = function (colIndex, coloringOptions) {
|
496
|
+
var colData = this._newColumnData(colIndex);
|
366
497
|
var painter = colData["painter"];
|
367
|
-
var
|
368
|
-
var colorOptions = this._prepareColorOptions(colIndex,
|
498
|
+
var prevFields = colData["coloringFields"] ? Object.keys(colData["coloringFields"]) : null;
|
499
|
+
var colorOptions = this._prepareColorOptions(colIndex, coloringOptions);
|
369
500
|
if(colorOptions.hasColor) { // Set new coloring
|
501
|
+
var newFieldsMap = colorOptions.fields;
|
370
502
|
if (!painter) {
|
371
503
|
painter = colData["painter"] = new CellPainter();
|
504
|
+
} else if (prevFields) {
|
505
|
+
// Remove unused fields
|
506
|
+
var unusedFields = [];
|
507
|
+
var prevField;
|
508
|
+
for (var i = 0; i < prevFields.length; i++) {
|
509
|
+
prevField = prevFields[i];
|
510
|
+
if (!newFieldsMap[prevField]) {
|
511
|
+
unusedFields.push(prevField);
|
512
|
+
}
|
513
|
+
}
|
514
|
+
if (unusedFields.length) {
|
515
|
+
this._removeDataFields(unusedFields, colIndex, COLORING_TYPE);
|
516
|
+
}
|
372
517
|
}
|
373
518
|
|
374
519
|
if(colorOptions.condColoring) {
|
@@ -378,29 +523,36 @@ ConditionalColoringPlugin.prototype.setColumnColoring = function (colIndex, colu
|
|
378
523
|
painter.addColorTextWithTheme(colorOptions.colorText.field);
|
379
524
|
}
|
380
525
|
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
if(prevColoring) {
|
388
|
-
this._clearCellStyles(colIndex); // Need to clear the existing previous coloring style here
|
526
|
+
var fields = Object.keys(newFieldsMap);
|
527
|
+
if (this._initializedGrid) {
|
528
|
+
this._addDataFields(fields, colIndex, COLORING_TYPE);
|
529
|
+
} else {
|
530
|
+
if (!this._pendingFields) {
|
531
|
+
this._pendingFields = [];
|
389
532
|
}
|
533
|
+
this._pendingFields.push([fields, colIndex, COLORING_TYPE]);
|
390
534
|
}
|
391
|
-
}
|
392
535
|
|
393
|
-
if(colData["coloring"] || colData["blinkingField"] ) {
|
394
536
|
this._enableColumnStyle(colIndex, true); // Remove the background image
|
395
|
-
|
396
|
-
|
537
|
+
painter["inputField"] = colorOptions.inputField; // Used in ColumnFormatting extension for restoring the user's selected field in column format dialog
|
538
|
+
colData["coloringFields"] = newFieldsMap;
|
539
|
+
if (this._initializedGrid) { // Force rendering, the new coloring will be applied in the binding
|
397
540
|
this._requestRowRefresh();
|
398
541
|
}
|
399
|
-
} else
|
400
|
-
if(this.
|
401
|
-
//
|
402
|
-
|
542
|
+
} else {
|
543
|
+
if (this._isValidPainter(painter)) {
|
544
|
+
painter.resetColoring(); // Release any used memory
|
545
|
+
if (prevFields) {
|
546
|
+
this._clearCellStyles(colIndex); // Need to clear the existing previous coloring styles here
|
547
|
+
}
|
403
548
|
}
|
549
|
+
|
550
|
+
if (prevFields) {
|
551
|
+
this._removeFieldReferrer(colIndex, COLORING_TYPE);
|
552
|
+
}
|
553
|
+
|
554
|
+
colData["coloringFields"] = null;
|
555
|
+
this._enableColumnStyle(colIndex, false);
|
404
556
|
}
|
405
557
|
};
|
406
558
|
|
@@ -411,27 +563,31 @@ ConditionalColoringPlugin.prototype.setColumnColoring = function (colIndex, colu
|
|
411
563
|
*/
|
412
564
|
ConditionalColoringPlugin.prototype.setColumnBlinking = function (colIndex, blinkingOptions, field) {
|
413
565
|
var colData = this._newColumnData(colIndex);
|
414
|
-
var
|
566
|
+
var prevField = colData["blinkingField"];
|
415
567
|
colData["blinking"] = blinkingOptions;
|
416
568
|
var painter = colData["painter"];
|
417
569
|
var bOptions = this._prepareBlinkingOptions(colIndex, blinkingOptions, field);
|
418
570
|
if (bOptions) {
|
571
|
+
var newBlinkingField = bOptions.field;
|
419
572
|
if (!painter) {
|
420
573
|
colData["painter"] = painter = new CellPainter();
|
421
|
-
} else if(
|
574
|
+
} else if(prevField) {
|
422
575
|
// Clear current style, blinking and existing styles related to blinking
|
423
576
|
painter.clearBlinking();
|
577
|
+
if (prevField !== newBlinkingField) {
|
578
|
+
this._removeDataFields(prevField, colIndex, BLINKING_TYPE);
|
579
|
+
}
|
424
580
|
}
|
425
581
|
painter.disableLevelColor(bOptions.level === false);
|
426
582
|
if (bOptions.customColor) {
|
427
|
-
painter.addBlink(
|
583
|
+
painter.addBlink(newBlinkingField, bOptions.up, bOptions.down, bOptions.level, bOptions.border);
|
428
584
|
} else {
|
429
|
-
painter.addBlinkWithTheme(
|
585
|
+
painter.addBlinkWithTheme(newBlinkingField, bOptions.border);
|
430
586
|
}
|
431
|
-
colData["blinkingField"] =
|
587
|
+
colData["blinkingField"] = newBlinkingField; // used for binding and cache clearing
|
432
588
|
this._blinkingEnabled = true; // TODO: need to dynamically verify the blink state
|
433
589
|
|
434
|
-
if (!
|
590
|
+
if (!prevField) { // No need update the cache for the options changing
|
435
591
|
// Emerald Grid needs to cache in the initializing phase
|
436
592
|
// Atlas Blotter will cache in the first binding
|
437
593
|
if (this._compositeGrid || this._initializedGrid) {
|
@@ -444,32 +600,26 @@ ConditionalColoringPlugin.prototype.setColumnBlinking = function (colIndex, blin
|
|
444
600
|
}
|
445
601
|
|
446
602
|
ConditionalColoringPlugin._startCleanUpInterval();
|
603
|
+
if (this._initializedGrid) {
|
604
|
+
this._addDataFields(newBlinkingField, colIndex, BLINKING_TYPE);
|
605
|
+
} else {
|
606
|
+
if (!this._pendingFields) {
|
607
|
+
this._pendingFields = [];
|
608
|
+
}
|
609
|
+
this._pendingFields.push([newBlinkingField, colIndex, BLINKING_TYPE]);
|
610
|
+
}
|
447
611
|
} else {
|
448
|
-
if (
|
449
|
-
if (
|
450
|
-
this._clearPainter(colData);
|
451
|
-
} else {
|
612
|
+
if (prevField) {
|
613
|
+
if (painter) {
|
452
614
|
painter.clearBlinking(); // Release any used memory and restore cell's style
|
453
615
|
ConditionalColoringPlugin._cleanUpPrevFields();
|
454
616
|
}
|
617
|
+
this._removeFieldReferrer(colIndex, BLINKING_TYPE);
|
455
618
|
}
|
456
619
|
colData["blinkingField"] = null; // Used by cache clearing, do not reset before cache clearing
|
457
620
|
}
|
458
621
|
};
|
459
622
|
|
460
|
-
/** @public
|
461
|
-
* @param {number} colIndex
|
462
|
-
* @param {Object=} out_obj
|
463
|
-
* @return {!Object}
|
464
|
-
*/
|
465
|
-
ConditionalColoringPlugin.prototype.getColumnColoring = function(colIndex, out_obj) {
|
466
|
-
if(!out_obj) {
|
467
|
-
out_obj = {};
|
468
|
-
}
|
469
|
-
console.log("WARNING: getColumnColoring() is not implemented yet");
|
470
|
-
return out_obj;
|
471
|
-
};
|
472
|
-
|
473
623
|
/** @public
|
474
624
|
* @param {number} rowIndex
|
475
625
|
* @param {number} blinkSignal
|
@@ -545,19 +695,21 @@ ConditionalColoringPlugin.prototype._prepareColorOptions = function(colIndex, co
|
|
545
695
|
}
|
546
696
|
var colField = this._getField(colIndex);
|
547
697
|
var field = /** @type{string} */(columnOptions["field"]) || colField;
|
548
|
-
|
549
|
-
|
550
|
-
|
698
|
+
var inputField = columnOptions["inputField"] || ""; // The value is from user so it can be "THIS_COLUMN" or null
|
699
|
+
colorOptions["inputField"] = inputField; // Used to retain state on Column Format Dialog
|
700
|
+
field = ConditionalColoringPlugin._convertKeyword(inputField, field);
|
551
701
|
|
552
702
|
// Check if there is another type of coloring
|
553
|
-
// "colorText"
|
703
|
+
// "colorText" option has more priority than "tickColor"
|
554
704
|
var colorText = columnOptions["colorText"] || columnOptions["tickColor"];
|
555
|
-
var
|
705
|
+
var conditions = columnOptions["conditions"];
|
556
706
|
var conditionCount = conditions ? conditions.length : 0;
|
557
707
|
if(conditionCount) {
|
708
|
+
colorOptions.hasColor = 1;
|
709
|
+
colorOptions.fields = {};
|
558
710
|
colorOptions.condColoring = {};
|
559
711
|
colorOptions.condColoring.conditions = conditions;
|
560
|
-
|
712
|
+
|
561
713
|
var formatter = (field == colField) ? columnOptions["textFormatter"] : null;
|
562
714
|
var builder = ConditionalColoringPlugin.getFilterBuilder();
|
563
715
|
|
@@ -580,22 +732,28 @@ ConditionalColoringPlugin.prototype._prepareColorOptions = function(colIndex, co
|
|
580
732
|
}
|
581
733
|
exp = builder.buildFilter();
|
582
734
|
cond["expression"] = exp;
|
735
|
+
colorOptions.fields[field] = true;
|
736
|
+
} else {
|
737
|
+
// Get fields from expression string
|
738
|
+
var expFields = _getFieldsFromExpression(exp);
|
739
|
+
for(var n = 0; n < expFields.length; n++) {
|
740
|
+
colorOptions.fields[expFields[n]] = true;
|
741
|
+
}
|
583
742
|
}
|
584
743
|
}
|
585
|
-
|
586
|
-
colorOptions.inputField = inputField;
|
587
744
|
} else if(colorText) {
|
588
|
-
colorOptions.colorText = {};
|
589
745
|
colorOptions.hasColor = 1;
|
746
|
+
colorOptions.fields = {};
|
747
|
+
colorOptions.colorText = {};
|
590
748
|
|
591
|
-
|
592
|
-
if(
|
593
|
-
|
594
|
-
} else if(
|
595
|
-
|
749
|
+
var type = typeof colorText;
|
750
|
+
if(type === "string") {
|
751
|
+
field = colorText;
|
752
|
+
} else if(type === "object") {
|
753
|
+
field = /** @type{string} */(colorText["field"]) || field;
|
596
754
|
}
|
597
|
-
colorOptions.colorText.field =
|
598
|
-
colorOptions.
|
755
|
+
colorOptions.colorText.field = field;
|
756
|
+
colorOptions.fields[field] = true;
|
599
757
|
}
|
600
758
|
|
601
759
|
return colorOptions;
|
@@ -609,9 +767,9 @@ ConditionalColoringPlugin.prototype._prepareColorOptions = function(colIndex, co
|
|
609
767
|
ConditionalColoringPlugin._convertKeyword = function(userInput, fallback) {
|
610
768
|
if(userInput) {
|
611
769
|
// Note that THIS_COLUMN is a special keyword that needs to be converted before usage
|
612
|
-
return userInput.indexOf("THIS_COLUMN") ?
|
770
|
+
return userInput.indexOf("THIS_COLUMN") > -1 ? fallback : userInput;
|
613
771
|
}
|
614
|
-
return
|
772
|
+
return fallback;
|
615
773
|
};
|
616
774
|
|
617
775
|
/** @private
|
@@ -806,7 +964,7 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
|
|
806
964
|
}
|
807
965
|
|
808
966
|
// conditional coloring
|
809
|
-
if (colData["
|
967
|
+
if (colData["coloringFields"] && !bgBlinking) {
|
810
968
|
painter.renderColoring(cell, dataRow);
|
811
969
|
}
|
812
970
|
}
|
@@ -833,7 +991,41 @@ ConditionalColoringPlugin.prototype._onColumnAdded = function(e) {
|
|
833
991
|
*/
|
834
992
|
ConditionalColoringPlugin.prototype._onColumnRemoved = function(e) {
|
835
993
|
var colData = /** @type{Object} */(e.columnData);
|
994
|
+
if (!colData) {
|
995
|
+
return;
|
996
|
+
}
|
997
|
+
|
836
998
|
this._clearPainter(colData);
|
999
|
+
|
1000
|
+
// Removed column
|
1001
|
+
var colDef = colData["COL_DEF"];
|
1002
|
+
if (colDef) {
|
1003
|
+
if (colData["coloringFields"]) {
|
1004
|
+
this._removeFieldReferrer(colDef, COLORING_TYPE);
|
1005
|
+
}
|
1006
|
+
if (colData["blinkingField"]) {
|
1007
|
+
this._removeFieldReferrer(colDef, BLINKING_TYPE);
|
1008
|
+
}
|
1009
|
+
}
|
1010
|
+
|
1011
|
+
// Another columns
|
1012
|
+
var field = colData["field"];
|
1013
|
+
if (field) {
|
1014
|
+
var isStaticField = colDef ? !colDef.isRealTimeField() : true;
|
1015
|
+
if (isStaticField) {
|
1016
|
+
var colCount = this.getColumnCount();
|
1017
|
+
for (var i = 0; i < colCount; i++) {
|
1018
|
+
colData = this._getColumnData(i);
|
1019
|
+
if (colData["coloringFields"] && colData["coloringFields"][field]) {
|
1020
|
+
this.setConditionalColoring(i, null);
|
1021
|
+
}
|
1022
|
+
|
1023
|
+
if (colData["blinkingField"] === field) {
|
1024
|
+
this.setColumnBlinking(i, null);
|
1025
|
+
}
|
1026
|
+
}
|
1027
|
+
}
|
1028
|
+
}
|
837
1029
|
};
|
838
1030
|
|
839
1031
|
/** @private */
|
@@ -949,12 +1141,15 @@ ConditionalColoringPlugin._stopCleanUpInterval = function() {
|
|
949
1141
|
ConditionalColoringPlugin.setThemeColors = CellPainter.setThemeColors;
|
950
1142
|
|
951
1143
|
/** @public
|
952
|
-
* @description Reload theme colors and change colors for all instances of CellPainter
|
1144
|
+
* @description Reload theme colors and change colors for all instances of CellPainter.
|
1145
|
+
* Should call after the overwriting css variables for MovementColor without changing movement-color-profile attribute.
|
953
1146
|
* @function
|
954
1147
|
* @return {Promise<Object>}
|
955
1148
|
*/
|
956
1149
|
ConditionalColoringPlugin.prototype.reloadThemeColors = function () {
|
957
|
-
return CellPainter.reloadThemeColors()
|
1150
|
+
return CellPainter.reloadThemeColors()
|
1151
|
+
.then(this._onThemeLoaded)
|
1152
|
+
.catch(this._onThemeLoaded);
|
958
1153
|
};
|
959
1154
|
|
960
1155
|
|
@@ -80,12 +80,7 @@ ContentWrapPlugin.prototype.initialize = function (host, options) {
|
|
80
80
|
window.addEventListener("load", this._setReCalculationTimer); // Since CSS can impact font, we need adjust accordingly
|
81
81
|
|
82
82
|
host.listen("widthChanged", this._setReCalculationTimer);
|
83
|
-
host.listen("postSectionDataBinding", this._setReCalculationTimer);
|
84
|
-
|
85
|
-
if (host["disableLazyRendering"]) {
|
86
|
-
host["disableLazyRendering"]();
|
87
|
-
} // In case of lazy loading
|
88
|
-
|
83
|
+
host.listen("postSectionDataBinding", this._setReCalculationTimer); // In case of lazy loading
|
89
84
|
|
90
85
|
this.config(options);
|
91
86
|
host.listen("columnAdded", this._onColumnAdded);
|
@@ -158,7 +158,7 @@ ContextMenuPlugin.prototype.initialize = function (host, options) {
|
|
158
158
|
ContextMenuPlugin._applyThemeColor(host);
|
159
159
|
} else {
|
160
160
|
ContextMenuPlugin._stylePromise = ElfUtil.getThemeColors();
|
161
|
-
ContextMenuPlugin._stylePromise.then(this._onThemeLoaded);
|
161
|
+
ContextMenuPlugin._stylePromise.then(this._onThemeLoaded).catch(this._onThemeLoaded);
|
162
162
|
}
|
163
163
|
};
|
164
164
|
|
@@ -355,9 +355,9 @@ ContextMenuPlugin.prototype._onItemClicked = function (e) {
|
|
355
355
|
};
|
356
356
|
|
357
357
|
/** @private
|
358
|
-
* @param {Object} colors
|
359
358
|
*/
|
360
|
-
ContextMenuPlugin.prototype._onThemeLoaded = function (
|
359
|
+
ContextMenuPlugin.prototype._onThemeLoaded = function () {
|
360
|
+
var colors = ElfUtil.getColors();
|
361
361
|
var css = prettifyCss([
|
362
362
|
".tr-contextmenu", [
|
363
363
|
"outline: none;",
|
@@ -12,9 +12,9 @@ declare class MenuEventAPI {
|
|
12
12
|
|
13
13
|
public addSeparator(): void;
|
14
14
|
|
15
|
-
public getMenuItems(): any[];
|
15
|
+
public getMenuItems(): any[]|null;
|
16
16
|
|
17
|
-
public findItem(id: number): (string)[] | any;
|
17
|
+
public findItem(id: number): (string)[] | any|null;
|
18
18
|
|
19
19
|
}
|
20
20
|
|