@refinitiv-ui/efx-grid 6.0.4 → 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 +392 -230
- 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 +97 -95
- package/lib/core/es6/grid/Core.js +180 -26
- 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 +11 -9
- package/lib/core/es6/grid/components/Scrollbar.js +13 -0
- 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 +7 -44
- 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 +1354 -435
- 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 +106 -91
- package/lib/rt-grid/es6/Grid.js +151 -106
- 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 +5 -2
- package/lib/rt-grid/es6/SnapshotFiller.js +121 -15
- 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 +14 -4
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +314 -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 +16 -13
- 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/ElementObserver.js +6 -3
- 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 +13 -4
- package/lib/tr-grid-util/es6/ElfUtil.js +178 -26
- 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 +14 -4
- 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 +97 -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 +11 -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 +104 -89
- 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 +5 -2
- 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
@@ -3,6 +3,7 @@ import { GridPlugin } from '../../tr-grid-util/es6/GridPlugin.js';
|
|
3
3
|
import { extendObject } 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
|
+
import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
|
6
7
|
|
7
8
|
/** @typedef {Object} ConditionalColoringPlugin~ColumnOptions
|
8
9
|
* @description Extension column options that can be specified on each individual grid's column option:
|
@@ -13,6 +14,14 @@ import {FilterBuilder} from '../../tr-grid-util/es6/FilterBuilder.js';
|
|
13
14
|
* @property {string=} field
|
14
15
|
*/
|
15
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
|
+
|
16
25
|
/** @typedef {Object} ConditionalColoringPlugin~Condition
|
17
26
|
* @description Available options describing `condition` object
|
18
27
|
* @property {(string|Function)=} expression Expression could be `[FIELD_1] > 0`
|
@@ -30,6 +39,26 @@ import {FilterBuilder} from '../../tr-grid-util/es6/FilterBuilder.js';
|
|
30
39
|
* @property {(string|boolean)=} level CSS color (e.g. #33333, grey). If false value is specified, blinking for level color is disabled.
|
31
40
|
*/
|
32
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
|
+
|
33
62
|
/** @constructor
|
34
63
|
* @extends {GridPlugin}
|
35
64
|
*/
|
@@ -56,6 +85,11 @@ ConditionalColoringPlugin._cleanUpTimer = 0;
|
|
56
85
|
*/
|
57
86
|
ConditionalColoringPlugin.prototype._blinkingEnabled = false; // WORKAROUND: To improve performance
|
58
87
|
|
88
|
+
/** @type {Array}
|
89
|
+
* @private
|
90
|
+
*/
|
91
|
+
ConditionalColoringPlugin.prototype._pendingFields;
|
92
|
+
|
59
93
|
/** @override
|
60
94
|
* @return {string}
|
61
95
|
*/
|
@@ -95,12 +129,32 @@ ConditionalColoringPlugin.prototype.initialize = function (host, options) {
|
|
95
129
|
host.listen("columnRemoved", this._onColumnRemoved);
|
96
130
|
|
97
131
|
if (!CellPainter.themeReady) {
|
98
|
-
CellPainter.loadThemeColors().then(this._onThemeLoaded);
|
132
|
+
CellPainter.loadThemeColors().then(this._onThemeLoaded).catch(this._onThemeLoaded);
|
99
133
|
}
|
134
|
+
|
135
|
+
// Register callback for movement-color-profile attribute changed event
|
136
|
+
ElfUtil.getThemeColors(this._onThemeLoaded);
|
137
|
+
|
100
138
|
// In case of lazy loading
|
101
139
|
// DO something
|
102
140
|
};
|
103
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
|
+
|
104
158
|
/** @public
|
105
159
|
* @param {Object} host core grid object
|
106
160
|
*/
|
@@ -158,53 +212,67 @@ ConditionalColoringPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
158
212
|
}
|
159
213
|
|
160
214
|
var len = this.getColumnCount();
|
161
|
-
var host = this._hosts[0];
|
162
215
|
for (var i = 0; i < len; ++i) {
|
163
216
|
var column = columns[i];
|
164
217
|
if (!column) {
|
165
218
|
column = columns[i] = {};
|
166
219
|
}
|
167
220
|
|
168
|
-
|
169
|
-
|
170
|
-
column.conditions = [];
|
221
|
+
this.getColumnColoring(i, column);
|
222
|
+
}
|
171
223
|
|
172
|
-
|
173
|
-
|
174
|
-
var exCondition = {};
|
175
|
-
extendObject(exCondition, conditions[colIndex], [
|
176
|
-
'expression',
|
177
|
-
'backgroundColor',
|
178
|
-
'color'
|
179
|
-
]);
|
224
|
+
return obj;
|
225
|
+
};
|
180
226
|
|
181
|
-
|
182
|
-
|
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);
|
183
251
|
}
|
252
|
+
}
|
184
253
|
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
254
|
+
var colorText = this._getColumnOption(colIndex, "colorText", host);
|
255
|
+
if (colorText) {
|
256
|
+
options.colorText = colorText;
|
257
|
+
}
|
189
258
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
259
|
+
// alias with colorText
|
260
|
+
var tickColor = this._getColumnOption(colIndex, "tickColor", host);
|
261
|
+
if (tickColor) {
|
262
|
+
options.tickColor = tickColor;
|
263
|
+
}
|
195
264
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
265
|
+
var blinking = this._getColumnOption(colIndex, "blinking", host);
|
266
|
+
if (blinking) {
|
267
|
+
options.blinking = blinking;
|
268
|
+
}
|
200
269
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
}
|
270
|
+
var field = this._getField(colIndex);
|
271
|
+
if (field) {
|
272
|
+
options.field = field;
|
205
273
|
}
|
206
274
|
|
207
|
-
return
|
275
|
+
return options;
|
208
276
|
};
|
209
277
|
|
210
278
|
/** @private
|
@@ -227,6 +295,20 @@ ConditionalColoringPlugin.prototype._applyStyle = function(host, options) {
|
|
227
295
|
}
|
228
296
|
};
|
229
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
|
+
|
230
312
|
/** @private
|
231
313
|
* @param {CellPainter=} painter
|
232
314
|
* @return {boolean}
|
@@ -262,20 +344,6 @@ ConditionalColoringPlugin.prototype._clearCellStyles = function(colIndex) {
|
|
262
344
|
}
|
263
345
|
};
|
264
346
|
|
265
|
-
/** @private
|
266
|
-
* @param {number} colIndex
|
267
|
-
* @param {boolean=} enabled
|
268
|
-
*/
|
269
|
-
ConditionalColoringPlugin.prototype._enableColumnStyle = function(colIndex, enabled) {
|
270
|
-
enabled = enabled !== false;
|
271
|
-
var hosts = this._hosts;
|
272
|
-
var grid;
|
273
|
-
for(var i = hosts.length; --i >= 0;) {
|
274
|
-
grid = hosts[i];
|
275
|
-
grid.enableColumnClass(colIndex, "conditionally-colored", enabled);
|
276
|
-
}
|
277
|
-
};
|
278
|
-
|
279
347
|
/** @private
|
280
348
|
*/
|
281
349
|
ConditionalColoringPlugin.prototype._cachePreviousValue = function() {
|
@@ -319,15 +387,70 @@ ConditionalColoringPlugin.prototype._cacheColumnPreviousValue = function(colInde
|
|
319
387
|
}
|
320
388
|
};
|
321
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
|
+
|
322
441
|
/** @public
|
323
442
|
* @description To define coloring for columns, conditions or colorText or tickColor need to be specified.
|
324
|
-
* To enable cell blinking the blinking option need to be defined
|
325
|
-
* can be applied to a column at the same time
|
326
|
-
*
|
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.
|
327
447
|
* @param {number} colIndex
|
328
448
|
* @param {(ConditionalColoringPlugin~ColumnOptions|null)=} columnOptions
|
449
|
+
* @see {@link ConditionalColoringPlugin.setConditionalColoring}
|
450
|
+
* @see {@link ConditionalColoringPlugin.setColumnBlinking}
|
329
451
|
* @example
|
330
452
|
* var columnOptions1 = {
|
453
|
+
* "field": "string",
|
331
454
|
* "conditions": [{ // Array.<Object> Condition Object Properties
|
332
455
|
* "expression": "[column0] > 0", // string
|
333
456
|
* "backgroundColor": "", // Optional string e.g. #ffffff, black
|
@@ -336,7 +459,8 @@ ConditionalColoringPlugin.prototype._cacheColumnPreviousValue = function(colInde
|
|
336
459
|
* };
|
337
460
|
* var columnOptions2 = {
|
338
461
|
* "field": "string",
|
339
|
-
* "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
|
340
464
|
* };
|
341
465
|
*/
|
342
466
|
ConditionalColoringPlugin.prototype.setColumnColoring = function (colIndex, columnOptions) {
|
@@ -348,7 +472,7 @@ ConditionalColoringPlugin.prototype.setColumnColoring = function (colIndex, colu
|
|
348
472
|
colData["colorText"] = columnOptions["colorText"];
|
349
473
|
colData["tickColor"] = columnOptions["tickColor"];
|
350
474
|
colData["blinking"] = blinkingOptions = columnOptions["blinking"];
|
351
|
-
field = columnOptions["field"];
|
475
|
+
colData["field"] = field = columnOptions["field"];
|
352
476
|
} else {
|
353
477
|
colData["conditions"] = null;
|
354
478
|
colData["colorText"] = null;
|
@@ -357,13 +481,39 @@ ConditionalColoringPlugin.prototype.setColumnColoring = function (colIndex, colu
|
|
357
481
|
}
|
358
482
|
|
359
483
|
this.setColumnBlinking(colIndex, blinkingOptions, field);
|
484
|
+
this.setConditionalColoring(colIndex, columnOptions);
|
485
|
+
|
486
|
+
if (colData["painter"] && !(colData["coloringFields"] || colData["blinkingField"])) { // Clear existing painter
|
487
|
+
this._clearPainter(colData);
|
488
|
+
}
|
489
|
+
};
|
360
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);
|
361
497
|
var painter = colData["painter"];
|
362
|
-
var
|
363
|
-
var colorOptions = this._prepareColorOptions(colIndex,
|
498
|
+
var prevFields = colData["coloringFields"] ? Object.keys(colData["coloringFields"]) : null;
|
499
|
+
var colorOptions = this._prepareColorOptions(colIndex, coloringOptions);
|
364
500
|
if(colorOptions.hasColor) { // Set new coloring
|
501
|
+
var newFieldsMap = colorOptions.fields;
|
365
502
|
if (!painter) {
|
366
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
|
+
}
|
367
517
|
}
|
368
518
|
|
369
519
|
if(colorOptions.condColoring) {
|
@@ -373,29 +523,36 @@ ConditionalColoringPlugin.prototype.setColumnColoring = function (colIndex, colu
|
|
373
523
|
painter.addColorTextWithTheme(colorOptions.colorText.field);
|
374
524
|
}
|
375
525
|
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
if(prevColoring) {
|
383
|
-
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 = [];
|
384
532
|
}
|
533
|
+
this._pendingFields.push([fields, colIndex, COLORING_TYPE]);
|
385
534
|
}
|
386
|
-
}
|
387
535
|
|
388
|
-
if(colData["coloring"] || colData["blinkingField"] ) {
|
389
536
|
this._enableColumnStyle(colIndex, true); // Remove the background image
|
390
|
-
|
391
|
-
|
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
|
392
540
|
this._requestRowRefresh();
|
393
541
|
}
|
394
|
-
} else
|
395
|
-
if(this.
|
396
|
-
//
|
397
|
-
|
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
|
+
}
|
548
|
+
}
|
549
|
+
|
550
|
+
if (prevFields) {
|
551
|
+
this._removeFieldReferrer(colIndex, COLORING_TYPE);
|
398
552
|
}
|
553
|
+
|
554
|
+
colData["coloringFields"] = null;
|
555
|
+
this._enableColumnStyle(colIndex, false);
|
399
556
|
}
|
400
557
|
};
|
401
558
|
|
@@ -406,27 +563,31 @@ ConditionalColoringPlugin.prototype.setColumnColoring = function (colIndex, colu
|
|
406
563
|
*/
|
407
564
|
ConditionalColoringPlugin.prototype.setColumnBlinking = function (colIndex, blinkingOptions, field) {
|
408
565
|
var colData = this._newColumnData(colIndex);
|
409
|
-
var
|
566
|
+
var prevField = colData["blinkingField"];
|
410
567
|
colData["blinking"] = blinkingOptions;
|
411
568
|
var painter = colData["painter"];
|
412
569
|
var bOptions = this._prepareBlinkingOptions(colIndex, blinkingOptions, field);
|
413
570
|
if (bOptions) {
|
571
|
+
var newBlinkingField = bOptions.field;
|
414
572
|
if (!painter) {
|
415
573
|
colData["painter"] = painter = new CellPainter();
|
416
|
-
} else if(
|
574
|
+
} else if(prevField) {
|
417
575
|
// Clear current style, blinking and existing styles related to blinking
|
418
576
|
painter.clearBlinking();
|
577
|
+
if (prevField !== newBlinkingField) {
|
578
|
+
this._removeDataFields(prevField, colIndex, BLINKING_TYPE);
|
579
|
+
}
|
419
580
|
}
|
420
581
|
painter.disableLevelColor(bOptions.level === false);
|
421
582
|
if (bOptions.customColor) {
|
422
|
-
painter.addBlink(
|
583
|
+
painter.addBlink(newBlinkingField, bOptions.up, bOptions.down, bOptions.level, bOptions.border);
|
423
584
|
} else {
|
424
|
-
painter.addBlinkWithTheme(
|
585
|
+
painter.addBlinkWithTheme(newBlinkingField, bOptions.border);
|
425
586
|
}
|
426
|
-
colData["blinkingField"] =
|
587
|
+
colData["blinkingField"] = newBlinkingField; // used for binding and cache clearing
|
427
588
|
this._blinkingEnabled = true; // TODO: need to dynamically verify the blink state
|
428
589
|
|
429
|
-
if (!
|
590
|
+
if (!prevField) { // No need update the cache for the options changing
|
430
591
|
// Emerald Grid needs to cache in the initializing phase
|
431
592
|
// Atlas Blotter will cache in the first binding
|
432
593
|
if (this._compositeGrid || this._initializedGrid) {
|
@@ -439,32 +600,26 @@ ConditionalColoringPlugin.prototype.setColumnBlinking = function (colIndex, blin
|
|
439
600
|
}
|
440
601
|
|
441
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
|
+
}
|
442
611
|
} else {
|
443
|
-
if (
|
444
|
-
if (
|
445
|
-
this._clearPainter(colData);
|
446
|
-
} else {
|
612
|
+
if (prevField) {
|
613
|
+
if (painter) {
|
447
614
|
painter.clearBlinking(); // Release any used memory and restore cell's style
|
448
615
|
ConditionalColoringPlugin._cleanUpPrevFields();
|
449
616
|
}
|
617
|
+
this._removeFieldReferrer(colIndex, BLINKING_TYPE);
|
450
618
|
}
|
451
619
|
colData["blinkingField"] = null; // Used by cache clearing, do not reset before cache clearing
|
452
620
|
}
|
453
621
|
};
|
454
622
|
|
455
|
-
/** @public
|
456
|
-
* @param {number} colIndex
|
457
|
-
* @param {Object=} out_obj
|
458
|
-
* @return {!Object}
|
459
|
-
*/
|
460
|
-
ConditionalColoringPlugin.prototype.getColumnColoring = function(colIndex, out_obj) {
|
461
|
-
if(!out_obj) {
|
462
|
-
out_obj = {};
|
463
|
-
}
|
464
|
-
console.log("WARNING: getColumnColoring() is not implemented yet");
|
465
|
-
return out_obj;
|
466
|
-
};
|
467
|
-
|
468
623
|
/** @public
|
469
624
|
* @param {number} rowIndex
|
470
625
|
* @param {number} blinkSignal
|
@@ -540,19 +695,21 @@ ConditionalColoringPlugin.prototype._prepareColorOptions = function(colIndex, co
|
|
540
695
|
}
|
541
696
|
var colField = this._getField(colIndex);
|
542
697
|
var field = /** @type{string} */(columnOptions["field"]) || colField;
|
543
|
-
|
544
|
-
|
545
|
-
|
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);
|
546
701
|
|
547
702
|
// Check if there is another type of coloring
|
548
|
-
// "colorText"
|
703
|
+
// "colorText" option has more priority than "tickColor"
|
549
704
|
var colorText = columnOptions["colorText"] || columnOptions["tickColor"];
|
550
|
-
var
|
705
|
+
var conditions = columnOptions["conditions"];
|
551
706
|
var conditionCount = conditions ? conditions.length : 0;
|
552
707
|
if(conditionCount) {
|
708
|
+
colorOptions.hasColor = 1;
|
709
|
+
colorOptions.fields = {};
|
553
710
|
colorOptions.condColoring = {};
|
554
711
|
colorOptions.condColoring.conditions = conditions;
|
555
|
-
|
712
|
+
|
556
713
|
var formatter = (field == colField) ? columnOptions["textFormatter"] : null;
|
557
714
|
var builder = ConditionalColoringPlugin.getFilterBuilder();
|
558
715
|
|
@@ -575,22 +732,28 @@ ConditionalColoringPlugin.prototype._prepareColorOptions = function(colIndex, co
|
|
575
732
|
}
|
576
733
|
exp = builder.buildFilter();
|
577
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
|
+
}
|
578
742
|
}
|
579
743
|
}
|
580
|
-
|
581
|
-
colorOptions.inputField = inputField;
|
582
744
|
} else if(colorText) {
|
583
|
-
colorOptions.colorText = {};
|
584
745
|
colorOptions.hasColor = 1;
|
746
|
+
colorOptions.fields = {};
|
747
|
+
colorOptions.colorText = {};
|
585
748
|
|
586
|
-
|
587
|
-
if(
|
588
|
-
|
589
|
-
} else if(
|
590
|
-
|
749
|
+
var type = typeof colorText;
|
750
|
+
if(type === "string") {
|
751
|
+
field = colorText;
|
752
|
+
} else if(type === "object") {
|
753
|
+
field = /** @type{string} */(colorText["field"]) || field;
|
591
754
|
}
|
592
|
-
colorOptions.colorText.field =
|
593
|
-
colorOptions.
|
755
|
+
colorOptions.colorText.field = field;
|
756
|
+
colorOptions.fields[field] = true;
|
594
757
|
}
|
595
758
|
|
596
759
|
return colorOptions;
|
@@ -604,9 +767,9 @@ ConditionalColoringPlugin.prototype._prepareColorOptions = function(colIndex, co
|
|
604
767
|
ConditionalColoringPlugin._convertKeyword = function(userInput, fallback) {
|
605
768
|
if(userInput) {
|
606
769
|
// Note that THIS_COLUMN is a special keyword that needs to be converted before usage
|
607
|
-
return userInput.indexOf("THIS_COLUMN") ?
|
770
|
+
return userInput.indexOf("THIS_COLUMN") > -1 ? fallback : userInput;
|
608
771
|
}
|
609
|
-
return
|
772
|
+
return fallback;
|
610
773
|
};
|
611
774
|
|
612
775
|
/** @private
|
@@ -801,7 +964,7 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
|
|
801
964
|
}
|
802
965
|
|
803
966
|
// conditional coloring
|
804
|
-
if (colData["
|
967
|
+
if (colData["coloringFields"] && !bgBlinking) {
|
805
968
|
painter.renderColoring(cell, dataRow);
|
806
969
|
}
|
807
970
|
}
|
@@ -828,7 +991,41 @@ ConditionalColoringPlugin.prototype._onColumnAdded = function(e) {
|
|
828
991
|
*/
|
829
992
|
ConditionalColoringPlugin.prototype._onColumnRemoved = function(e) {
|
830
993
|
var colData = /** @type{Object} */(e.columnData);
|
994
|
+
if (!colData) {
|
995
|
+
return;
|
996
|
+
}
|
997
|
+
|
831
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
|
+
}
|
832
1029
|
};
|
833
1030
|
|
834
1031
|
/** @private */
|
@@ -944,12 +1141,15 @@ ConditionalColoringPlugin._stopCleanUpInterval = function() {
|
|
944
1141
|
ConditionalColoringPlugin.setThemeColors = CellPainter.setThemeColors;
|
945
1142
|
|
946
1143
|
/** @public
|
947
|
-
* @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.
|
948
1146
|
* @function
|
949
1147
|
* @return {Promise<Object>}
|
950
1148
|
*/
|
951
1149
|
ConditionalColoringPlugin.prototype.reloadThemeColors = function () {
|
952
|
-
return CellPainter.reloadThemeColors()
|
1150
|
+
return CellPainter.reloadThemeColors()
|
1151
|
+
.then(this._onThemeLoaded)
|
1152
|
+
.catch(this._onThemeLoaded);
|
953
1153
|
};
|
954
1154
|
|
955
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;",
|