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