@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.
Files changed (274) hide show
  1. package/lib/column-dragging/es6/ColumnDragging.d.ts +13 -11
  2. package/lib/column-dragging/es6/ColumnDragging.js +21 -15
  3. package/lib/column-format-dialog/lib/column-format-dialog.d.ts +1 -1
  4. package/lib/column-format-dialog/lib/column-format-dialog.js +3 -4
  5. package/lib/column-format-dialog/lib/preview-table.js +3 -4
  6. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +2 -2
  7. package/lib/column-selection-dialog/lib/column-selection-dialog.js +23 -7
  8. package/lib/core/dist/core.css +1 -1
  9. package/lib/core/dist/core.js +372 -229
  10. package/lib/core/dist/core.min.js +1 -1
  11. package/lib/core/es6/data/ColumnStats.d.ts +3 -3
  12. package/lib/core/es6/data/DataCache.d.ts +9 -9
  13. package/lib/core/es6/data/DataTable.d.ts +28 -28
  14. package/lib/core/es6/data/DataTable.js +33 -10
  15. package/lib/core/es6/data/DataView.d.ts +62 -62
  16. package/lib/core/es6/data/DataView.js +42 -22
  17. package/lib/core/es6/data/Segment.d.ts +4 -4
  18. package/lib/core/es6/data/SegmentCollection.d.ts +7 -7
  19. package/lib/core/es6/data/WrappedView.d.ts +62 -62
  20. package/lib/core/es6/grid/Core.d.ts +95 -95
  21. package/lib/core/es6/grid/Core.js +173 -25
  22. package/lib/core/es6/grid/ILayoutGrid.d.ts +20 -20
  23. package/lib/core/es6/grid/ILayoutGrid.js +2 -1
  24. package/lib/core/es6/grid/LayoutGrid.d.ts +2 -2
  25. package/lib/core/es6/grid/LayoutGrid.js +18 -10
  26. package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +2 -2
  27. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +14 -3
  28. package/lib/core/es6/grid/components/Cell.d.ts +6 -6
  29. package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +2 -2
  30. package/lib/core/es6/grid/components/CellSpans.d.ts +2 -2
  31. package/lib/core/es6/grid/components/Column.d.ts +2 -2
  32. package/lib/core/es6/grid/components/ElementWrapper.d.ts +19 -19
  33. package/lib/core/es6/grid/components/Scrollbar.d.ts +9 -9
  34. package/lib/core/es6/grid/components/StretchedCells.js +12 -2
  35. package/lib/core/es6/grid/event/EventDispatcher.d.ts +3 -3
  36. package/lib/core/es6/grid/event/EventListeners.d.ts +5 -5
  37. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +45 -44
  38. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +62 -65
  39. package/lib/core/es6/grid/util/Conflator.d.ts +4 -4
  40. package/lib/core/es6/grid/util/HttpRequest.d.ts +3 -3
  41. package/lib/core/es6/grid/util/PercentBar.d.ts +8 -8
  42. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +8 -8
  43. package/lib/core/es6/grid/util/RangeBar.d.ts +1 -1
  44. package/lib/core/es6/grid/util/RangeBar.js +1 -1
  45. package/lib/core/es6/grid/util/Reverter.d.ts +1 -1
  46. package/lib/core/es6/grid/util/SectionSettings.d.ts +13 -13
  47. package/lib/core/es6/grid/util/SelectionList.d.ts +2 -2
  48. package/lib/core/es6/grid/util/TrackLayout.d.ts +9 -9
  49. package/lib/core/es6/grid/util/Virtualizer.d.ts +3 -3
  50. package/lib/core/es6/grid/util/util.d.ts +6 -4
  51. package/lib/core/es6/grid/util/util.js +16 -91
  52. package/lib/core/es6/tr-grid-theme.js +1 -1
  53. package/lib/filter-dialog/lib/checkbox-list.d.ts +1 -1
  54. package/lib/filter-dialog/lib/filter-dialog.d.ts +1 -1
  55. package/lib/filter-dialog/lib/filter-dialog.js +27 -9
  56. package/lib/filter-dialog/themes/base-checkbox.less +0 -1
  57. package/lib/filter-dialog/themes/base.less +1 -1
  58. package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
  59. package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
  60. package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
  61. package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
  62. package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
  63. package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
  64. package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
  65. package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
  66. package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
  67. package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
  68. package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
  69. package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
  70. package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
  71. package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
  72. package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
  73. package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
  74. package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
  75. package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
  76. package/lib/grid/index.js +1 -1
  77. package/lib/grid/lib/efx-grid.js +3 -0
  78. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  79. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  80. package/lib/grid/themes/halo/efx-grid.less +5 -5
  81. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  82. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  83. package/lib/row-segmenting/es6/RowSegmenting.d.ts +30 -24
  84. package/lib/row-segmenting/es6/RowSegmenting.js +122 -21
  85. package/lib/rt-grid/dist/rt-grid.js +689 -367
  86. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  87. package/lib/rt-grid/es6/ColumnDefinition.d.ts +46 -42
  88. package/lib/rt-grid/es6/ColumnDefinition.js +31 -1
  89. package/lib/rt-grid/es6/DataConnector.d.ts +6 -4
  90. package/lib/rt-grid/es6/DataConnector.js +8 -0
  91. package/lib/rt-grid/es6/FieldDefinition.d.ts +2 -2
  92. package/lib/rt-grid/es6/FieldDefinition.js +12 -5
  93. package/lib/rt-grid/es6/Grid.d.ts +102 -94
  94. package/lib/rt-grid/es6/Grid.js +70 -105
  95. package/lib/rt-grid/es6/ReferenceCounter.d.ts +5 -5
  96. package/lib/rt-grid/es6/RowDefSorter.d.ts +2 -2
  97. package/lib/rt-grid/es6/RowDefinition.d.ts +22 -22
  98. package/lib/rt-grid/es6/RowDefinition.js +12 -5
  99. package/lib/rt-grid/es6/SnapshotFiller.d.ts +3 -3
  100. package/lib/rt-grid/es6/StyleLoader.d.ts +1 -1
  101. package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +11 -11
  102. package/lib/tr-grid-cell-selection/es6/CellSelection.js +20 -35
  103. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +18 -16
  104. package/lib/tr-grid-checkbox/es6/Checkbox.js +1 -0
  105. package/lib/tr-grid-column-formatting/es6/ColumnFormatting.d.ts +29 -27
  106. package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +1 -0
  107. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +28 -14
  108. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +556 -11
  109. package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +2 -2
  110. package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +1 -0
  111. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +2 -3
  112. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +15 -13
  113. package/lib/tr-grid-column-stack/es6/ColumnStack.js +96 -72
  114. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +11 -2
  115. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +309 -114
  116. package/lib/tr-grid-content-wrap/es6/ContentWrap.js +1 -6
  117. package/lib/tr-grid-contextmenu/es6/ContextMenu.js +3 -3
  118. package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +2 -2
  119. package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +2 -2
  120. package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +2 -1
  121. package/lib/tr-grid-heat-map/es6/HeatMap.js +6 -9
  122. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +5 -2
  123. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +311 -71
  124. package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +1 -1
  125. package/lib/tr-grid-percent-bar/es6/PercentBar.js +8 -11
  126. package/lib/tr-grid-printer/es6/SectionWriter.js +8 -0
  127. package/lib/tr-grid-range-bar/es6/RangeBar.js +3 -10
  128. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +6 -0
  129. package/lib/tr-grid-row-dragging/es6/RowDragging.js +56 -23
  130. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +4 -3
  131. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +57 -13
  132. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1 -1
  133. package/lib/tr-grid-row-selection/es6/RowSelection.js +2 -3
  134. package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +0 -2
  135. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +1 -40
  136. package/lib/tr-grid-util/es6/CellPainter.d.ts +30 -30
  137. package/lib/tr-grid-util/es6/CellPainter.js +9 -8
  138. package/lib/tr-grid-util/es6/Conflator.d.ts +4 -4
  139. package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
  140. package/lib/tr-grid-util/es6/DateTime.d.ts +10 -10
  141. package/lib/tr-grid-util/es6/Deferred.d.ts +3 -1
  142. package/lib/tr-grid-util/es6/Deferred.js +11 -1
  143. package/lib/tr-grid-util/es6/Delay.d.ts +2 -2
  144. package/lib/tr-grid-util/es6/Dom.d.ts +10 -10
  145. package/lib/tr-grid-util/es6/Dom.js +14 -10
  146. package/lib/tr-grid-util/es6/DragUI.js +5 -2
  147. package/lib/tr-grid-util/es6/ElementObserver.d.ts +2 -2
  148. package/lib/tr-grid-util/es6/ElementWrapper.d.ts +4 -4
  149. package/lib/tr-grid-util/es6/ElfDate.d.ts +5 -5
  150. package/lib/tr-grid-util/es6/ElfDate.js +1 -0
  151. package/lib/tr-grid-util/es6/ElfUtil.d.ts +10 -4
  152. package/lib/tr-grid-util/es6/ElfUtil.js +53 -4
  153. package/lib/tr-grid-util/es6/EventDispatcher.d.ts +5 -5
  154. package/lib/tr-grid-util/es6/ExpanderIcon.d.ts +2 -2
  155. package/lib/tr-grid-util/es6/ExpanderIcon.js +1 -1
  156. package/lib/tr-grid-util/es6/Ext.d.ts +1 -1
  157. package/lib/tr-grid-util/es6/FieldFormatter.d.ts +12 -12
  158. package/lib/tr-grid-util/es6/FieldFormatter.js +1 -1
  159. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +13 -13
  160. package/lib/tr-grid-util/es6/FilterBuilder.js +15 -8
  161. package/lib/tr-grid-util/es6/FilterOperators.d.ts +22 -22
  162. package/lib/tr-grid-util/es6/FilterOperators.js +3 -3
  163. package/lib/tr-grid-util/es6/GridPlugin.d.ts +10 -10
  164. package/lib/tr-grid-util/es6/GridPlugin.js +20 -0
  165. package/lib/tr-grid-util/es6/Icon.d.ts +3 -3
  166. package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +8 -8
  167. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +6 -6
  168. package/lib/tr-grid-util/es6/NumberFormatter.d.ts +19 -19
  169. package/lib/tr-grid-util/es6/NumberFormatter.js +1 -1
  170. package/lib/tr-grid-util/es6/PercentBar.d.ts +19 -19
  171. package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
  172. package/lib/tr-grid-util/es6/Popup.d.ts +36 -33
  173. package/lib/tr-grid-util/es6/Popup.js +19 -1
  174. package/lib/tr-grid-util/es6/RangeBar.d.ts +5 -5
  175. package/lib/tr-grid-util/es6/RequestQueue.d.ts +4 -4
  176. package/lib/tr-grid-util/es6/RowPainter.d.ts +37 -4
  177. package/lib/tr-grid-util/es6/RowPainter.js +199 -76
  178. package/lib/tr-grid-util/es6/SubTable.d.ts +14 -14
  179. package/lib/tr-grid-util/es6/Table.d.ts +25 -25
  180. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +1 -1
  181. package/lib/tr-grid-util/es6/Timer.d.ts +1 -1
  182. package/lib/tr-grid-util/es6/TouchProxy.d.ts +9 -9
  183. package/lib/tr-grid-util/es6/Util.d.ts +12 -12
  184. package/lib/tr-grid-util/es6/formula/ADCService.d.ts +1 -1
  185. package/lib/tr-grid-util/es6/formula/ADCSubscription.d.ts +1 -1
  186. package/lib/tr-grid-util/es6/formula/AdFinService.d.ts +1 -1
  187. package/lib/tr-grid-util/es6/formula/AdFinSubscription.d.ts +1 -1
  188. package/lib/tr-grid-util/es6/formula/Engine.d.ts +9 -9
  189. package/lib/tr-grid-util/es6/formula/Formula.d.ts +4 -4
  190. package/lib/tr-grid-util/es6/formula/IntervalSubscription.d.ts +1 -1
  191. package/lib/tr-grid-util/es6/formula/Realtime.d.ts +3 -3
  192. package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
  193. package/lib/tr-grid-util/es6/formula/TSIService.d.ts +1 -1
  194. package/lib/tr-grid-util/es6/formula/TSISubscription.d.ts +1 -1
  195. package/lib/tr-grid-util/es6/formula/VariableToken.d.ts +1 -1
  196. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +1 -1
  197. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +34 -34
  198. package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
  199. package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
  200. package/lib/tr-grid-util/es6/jet/MockJET.js +12 -4
  201. package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +9 -9
  202. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +17 -9
  203. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +84 -24
  204. package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +42 -2
  205. package/lib/tr-grid-util/es6/jet/MockRTK.js +55 -16
  206. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +2 -2
  207. package/lib/tr-grid-util/es6/jet/mockDataAPI.js +99 -1
  208. package/lib/types/es6/Checkbox.d.ts +18 -16
  209. package/lib/types/es6/ColumnFormatting.d.ts +29 -27
  210. package/lib/types/es6/ColumnGrouping.d.ts +28 -14
  211. package/lib/types/es6/ColumnResizing.d.ts +2 -2
  212. package/lib/types/es6/ColumnStack.d.ts +15 -13
  213. package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +4 -2
  214. package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +0 -1
  215. package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +1 -1
  216. package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +1 -1
  217. package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +1 -5
  218. package/lib/types/es6/CompositeGrid/Plugin.d.ts +3 -1
  219. package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +2 -1
  220. package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +2 -1
  221. package/lib/types/es6/CompositeGrid/TextWidthCalculator.d.ts +1 -1
  222. package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +0 -1
  223. package/lib/types/es6/ConditionalColoring.d.ts +11 -2
  224. package/lib/types/es6/Core/data/ColumnStats.d.ts +3 -3
  225. package/lib/types/es6/Core/data/DataCache.d.ts +9 -9
  226. package/lib/types/es6/Core/data/DataTable.d.ts +28 -28
  227. package/lib/types/es6/Core/data/DataView.d.ts +62 -62
  228. package/lib/types/es6/Core/data/Segment.d.ts +4 -4
  229. package/lib/types/es6/Core/data/SegmentCollection.d.ts +7 -7
  230. package/lib/types/es6/Core/data/WrappedView.d.ts +62 -62
  231. package/lib/types/es6/Core/grid/Core.d.ts +95 -95
  232. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +20 -20
  233. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +2 -2
  234. package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +2 -2
  235. package/lib/types/es6/Core/grid/components/Cell.d.ts +6 -6
  236. package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +2 -2
  237. package/lib/types/es6/Core/grid/components/CellSpans.d.ts +2 -2
  238. package/lib/types/es6/Core/grid/components/Column.d.ts +2 -2
  239. package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +19 -19
  240. package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +9 -9
  241. package/lib/types/es6/Core/grid/event/EventDispatcher.d.ts +3 -3
  242. package/lib/types/es6/Core/grid/event/EventListeners.d.ts +5 -5
  243. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +45 -44
  244. package/lib/types/es6/Core/grid/util/Conflator.d.ts +4 -4
  245. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +3 -3
  246. package/lib/types/es6/Core/grid/util/PercentBar.d.ts +8 -8
  247. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +8 -8
  248. package/lib/types/es6/Core/grid/util/RangeBar.d.ts +1 -1
  249. package/lib/types/es6/Core/grid/util/Reverter.d.ts +1 -1
  250. package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +13 -13
  251. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +2 -2
  252. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +9 -9
  253. package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +3 -3
  254. package/lib/types/es6/Core/grid/util/util.d.ts +6 -4
  255. package/lib/types/es6/HeatMap.d.ts +2 -1
  256. package/lib/types/es6/InCellEditing.d.ts +5 -2
  257. package/lib/types/es6/MenuEventAPI.d.ts +2 -2
  258. package/lib/types/es6/MenuItem.d.ts +2 -2
  259. package/lib/types/es6/PercentBar.d.ts +1 -1
  260. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +46 -42
  261. package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +6 -4
  262. package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +2 -2
  263. package/lib/types/es6/RealtimeGrid/Grid.d.ts +100 -92
  264. package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +5 -5
  265. package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +2 -2
  266. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +22 -22
  267. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +3 -3
  268. package/lib/types/es6/RealtimeGrid/StyleLoader.d.ts +1 -1
  269. package/lib/types/es6/RowColoring.d.ts +0 -2
  270. package/lib/types/es6/RowDragging.d.ts +6 -0
  271. package/lib/types/es6/RowFiltering.d.ts +4 -3
  272. package/lib/types/es6/RowSegmenting.d.ts +30 -24
  273. package/lib/versions.json +26 -26
  274. 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
- var conditions = this._getColumnOption(i, 'conditions', host);
174
- if (Array.isArray(conditions) && conditions.length > 0) {
175
- column.conditions = [];
221
+ this.getColumnColoring(i, column);
222
+ }
176
223
 
177
- var count = conditions.length;
178
- for (var colIndex = 0; colIndex < count; colIndex++) {
179
- var exCondition = {};
180
- extendObject(exCondition, conditions[colIndex], [
181
- 'expression',
182
- 'backgroundColor',
183
- 'color'
184
- ]);
224
+ return obj;
225
+ };
185
226
 
186
- column.conditions.push(exCondition);
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
- var colorText = this._getColumnOption(i, 'colorText', host);
191
- if (colorText) {
192
- column.colorText = colorText;
193
- }
254
+ var colorText = this._getColumnOption(colIndex, "colorText", host);
255
+ if (colorText) {
256
+ options.colorText = colorText;
257
+ }
194
258
 
195
- // alias with colorText
196
- var tickColor = this._getColumnOption(i, 'tickColor', host);
197
- if (tickColor) {
198
- column.tickColor = tickColor;
199
- }
259
+ // alias with colorText
260
+ var tickColor = this._getColumnOption(colIndex, "tickColor", host);
261
+ if (tickColor) {
262
+ options.tickColor = tickColor;
263
+ }
200
264
 
201
- var blinking = this._getColumnOption(i, 'blinking', host);
202
- if (blinking) {
203
- column.blinking = blinking;
204
- }
265
+ var blinking = this._getColumnOption(colIndex, "blinking", host);
266
+ if (blinking) {
267
+ options.blinking = blinking;
268
+ }
205
269
 
206
- var field = this._getField(i);
207
- if (field) {
208
- column.field = field;
209
- }
270
+ var field = this._getField(colIndex);
271
+ if (field) {
272
+ options.field = field;
210
273
  }
211
274
 
212
- return obj;
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. Coloring options and blinking options
330
- * can be applied to a column at the same time. The blinking or coloring abilities will be removed if the correspondent options
331
- * are not given. If columnOptions is undefined or null, coloring and blinking will be removed.
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 prevColoring = colData["coloring"];
368
- var colorOptions = this._prepareColorOptions(colIndex, columnOptions);
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
- colData["coloring"] = true; // Used for binding
382
- painter["inputField"] = colorOptions.inputField;
383
- } else {
384
- colData["coloring"] = false;
385
- if(this._isValidPainter(painter)) {
386
- painter.resetColoring(); // Release any used memory
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
- if(colData["coloring"] && this._initializedGrid) { // Force rendering, the new coloring will be applied in the binding
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 if(painter) { // Clear existing painter
400
- if(this._clearPainter(colData)) {
401
- // Clear existing styles related to conditional coloring
402
- this._enableColumnStyle(colIndex, false);
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 prevBlinking = colData["blinkingField"];
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(prevBlinking) {
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(bOptions.field, bOptions.up, bOptions.down, bOptions.level, bOptions.border);
583
+ painter.addBlink(newBlinkingField, bOptions.up, bOptions.down, bOptions.level, bOptions.border);
428
584
  } else {
429
- painter.addBlinkWithTheme(bOptions.field, bOptions.border);
585
+ painter.addBlinkWithTheme(newBlinkingField, bOptions.border);
430
586
  }
431
- colData["blinkingField"] = bOptions.field; // used for binding and cache clearing
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 (!prevBlinking) { // No need update the cache for the options changing
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 (painter) {
449
- if (!colData["coloring"]) {
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
- field = ConditionalColoringPlugin._convertKeyword(field, colField);
549
-
550
- var conditions = columnOptions["conditions"];
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" attr has more priority than "tickColor"
703
+ // "colorText" option has more priority than "tickColor"
554
704
  var colorText = columnOptions["colorText"] || columnOptions["tickColor"];
555
- var inputField = columnOptions["inputField"] || "";
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
- colorOptions.hasColor = 1;
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
- inputField = field;
592
- if(typeof colorText === "string") {
593
- inputField = colorText;
594
- } else if(typeof colorText === "object") {
595
- inputField = /** @type{string} */(colorText["field"]) || field;
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 = ConditionalColoringPlugin._convertKeyword(inputField, field);
598
- colorOptions.inputField = inputField;
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") ? userInput : fallback;
770
+ return userInput.indexOf("THIS_COLUMN") > -1 ? fallback : userInput;
613
771
  }
614
- return userInput;
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["coloring"] && !bgBlinking) {
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, Should call after MovementColor changed.
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().then(this._onThemeLoaded);
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 (colors) {
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