@refinitiv-ui/efx-grid 6.0.1 → 6.0.4

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 (268) hide show
  1. package/lib/column-dragging/es6/ColumnDragging.d.ts +49 -0
  2. package/lib/column-dragging/es6/ColumnDragging.js +764 -0
  3. package/lib/column-dragging/es6/index.d.ts +1 -0
  4. package/lib/column-dragging/es6/index.js +1 -0
  5. package/lib/column-format-dialog/lib/column-format-dialog.d.ts +13 -1
  6. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +15 -2
  7. package/lib/column-selection-dialog/lib/column-selection-dialog.js +226 -23
  8. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
  9. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
  10. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
  11. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
  12. package/lib/core/dist/core.css +1 -1
  13. package/lib/core/dist/core.js +17835 -16266
  14. package/lib/core/dist/core.min.js +1 -1
  15. package/lib/core/es6/data/ColumnStats.d.ts +2 -2
  16. package/lib/core/es6/data/DataCache.d.ts +4 -4
  17. package/lib/core/es6/data/DataTable.d.ts +5 -5
  18. package/lib/core/es6/data/DataTable.js +33 -11
  19. package/lib/core/es6/data/DataView.d.ts +26 -17
  20. package/lib/core/es6/data/DataView.js +172 -49
  21. package/lib/core/es6/data/Segment.d.ts +2 -0
  22. package/lib/core/es6/data/Segment.js +7 -0
  23. package/lib/core/es6/data/SegmentCollection.d.ts +3 -3
  24. package/lib/core/es6/data/WrappedView.d.ts +289 -0
  25. package/lib/core/es6/data/WrappedView.js +1319 -0
  26. package/lib/core/es6/grid/Core.d.ts +42 -27
  27. package/lib/core/es6/grid/Core.js +431 -163
  28. package/lib/core/es6/grid/ILayoutGrid.d.ts +23 -15
  29. package/lib/core/es6/grid/ILayoutGrid.js +45 -2
  30. package/lib/core/es6/grid/LayoutGrid.d.ts +10 -1
  31. package/lib/core/es6/grid/LayoutGrid.js +311 -108
  32. package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
  33. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +382 -24
  34. package/lib/core/es6/grid/components/Cell.d.ts +4 -4
  35. package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +1 -1
  36. package/lib/core/es6/grid/components/CellSpans.d.ts +8 -8
  37. package/lib/core/es6/grid/components/Column.d.ts +1 -1
  38. package/lib/core/es6/grid/components/Column.js +8 -2
  39. package/lib/core/es6/grid/components/ElementWrapper.d.ts +6 -6
  40. package/lib/core/es6/grid/components/HScrollbar.d.ts +4 -0
  41. package/lib/core/es6/grid/components/HScrollbar.js +20 -4
  42. package/lib/core/es6/grid/components/Scrollbar.d.ts +1 -1
  43. package/lib/core/es6/grid/components/StretchedCells.js +2 -2
  44. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +14 -6
  45. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +147 -81
  46. package/lib/core/es6/grid/util/Conflator.d.ts +2 -2
  47. package/lib/core/es6/grid/util/ElementFrameWork.d.ts +3 -3
  48. package/lib/core/es6/grid/util/HttpRequest.d.ts +2 -2
  49. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +1 -1
  50. package/lib/core/es6/grid/util/RangeBar.d.ts +1 -1
  51. package/lib/core/es6/grid/util/SectionSettings.d.ts +5 -5
  52. package/lib/core/es6/grid/util/SectionSettings.js +5 -0
  53. package/lib/core/es6/grid/util/SelectionList.d.ts +2 -2
  54. package/lib/core/es6/grid/util/TrackLayout.d.ts +7 -3
  55. package/lib/core/es6/grid/util/TrackLayout.js +29 -3
  56. package/lib/core/es6/grid/util/util.d.ts +2 -2
  57. package/lib/core/es6/index.d.ts +1 -5
  58. package/lib/core/es6/index.js +1 -7
  59. package/lib/core/es6/tr-grid-theme.js +1 -1
  60. package/lib/filter-dialog/lib/checkbox-list.d.ts +13 -1
  61. package/lib/filter-dialog/lib/filter-dialog.d.ts +14 -1
  62. package/lib/filter-dialog/lib/filter-dialog.js +94 -32
  63. package/lib/filter-dialog/themes/base-checkbox.less +8 -1
  64. package/lib/filter-dialog/themes/base.less +69 -1
  65. package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
  66. package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
  67. package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
  68. package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
  69. package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
  70. package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
  71. package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
  72. package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
  73. package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
  74. package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
  75. package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
  76. package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
  77. package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
  78. package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
  79. package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
  80. package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
  81. package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
  82. package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
  83. package/lib/grid/lib/efx-grid.d.ts +30 -8
  84. package/lib/grid/lib/efx-grid.js +120 -115
  85. package/lib/grid/themes/base.less +5 -3
  86. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  87. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  88. package/lib/grid/themes/halo/efx-grid.less +72 -41
  89. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  90. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  91. package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
  92. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
  93. package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
  94. package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
  95. package/lib/index.d.ts +2 -0
  96. package/lib/index.js +2 -0
  97. package/lib/row-segmenting/es6/RowSegmenting.d.ts +8 -2
  98. package/lib/row-segmenting/es6/RowSegmenting.js +137 -21
  99. package/lib/rt-grid/dist/rt-grid.js +11017 -9193
  100. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  101. package/lib/rt-grid/es6/ColumnDefinition.d.ts +9 -4
  102. package/lib/rt-grid/es6/ColumnDefinition.js +20 -108
  103. package/lib/rt-grid/es6/DataConnector.d.ts +3 -3
  104. package/lib/rt-grid/es6/Grid.d.ts +30 -15
  105. package/lib/rt-grid/es6/Grid.js +436 -167
  106. package/lib/rt-grid/es6/RowDefSorter.d.ts +19 -0
  107. package/lib/rt-grid/es6/RowDefSorter.js +137 -0
  108. package/lib/rt-grid/es6/RowDefinition.d.ts +12 -7
  109. package/lib/rt-grid/es6/RowDefinition.js +58 -2
  110. package/lib/rt-grid/es6/SnapshotFiller.d.ts +3 -1
  111. package/lib/rt-grid/es6/SnapshotFiller.js +23 -0
  112. package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +1 -1
  113. package/lib/tr-grid-cell-selection/es6/CellSelection.js +53 -40
  114. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +6 -3
  115. package/lib/tr-grid-checkbox/es6/Checkbox.js +79 -34
  116. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +1 -0
  117. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +10 -0
  118. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +5 -1
  119. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +269 -10
  120. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +8 -4
  121. package/lib/tr-grid-column-stack/es6/ColumnStack.js +243 -125
  122. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +1 -1
  123. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +24 -13
  124. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +4 -2
  125. package/lib/tr-grid-filter-input/es6/FilterInput.js +73 -10
  126. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +8 -5
  127. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +106 -3
  128. package/lib/tr-grid-printer/es6/CellWriter.d.ts +3 -3
  129. package/lib/tr-grid-printer/es6/GridPrinter.d.ts +1 -1
  130. package/lib/tr-grid-printer/es6/GridPrinter.js +26 -13
  131. package/lib/tr-grid-printer/es6/PrintTrait.d.ts +2 -2
  132. package/lib/tr-grid-printer/es6/SectionWriter.d.ts +3 -3
  133. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +3 -4
  134. package/lib/tr-grid-row-dragging/es6/RowDragging.js +108 -127
  135. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
  136. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +88 -33
  137. package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +7 -2
  138. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +138 -38
  139. package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +13 -9
  140. package/lib/tr-grid-row-selection/es6/RowSelection.js +230 -29
  141. package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +2 -0
  142. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +36 -0
  143. package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +1 -1
  144. package/lib/tr-grid-textformatting/es6/TextFormatting.js +12 -0
  145. package/lib/tr-grid-util/es6/CellPainter.d.ts +8 -8
  146. package/lib/tr-grid-util/es6/Conflator.d.ts +2 -2
  147. package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
  148. package/lib/tr-grid-util/es6/DateTime.d.ts +4 -4
  149. package/lib/tr-grid-util/es6/Delay.d.ts +1 -1
  150. package/lib/tr-grid-util/es6/Dom.d.ts +4 -4
  151. package/lib/tr-grid-util/es6/DragUI.d.ts +16 -0
  152. package/lib/tr-grid-util/es6/DragUI.js +214 -0
  153. package/lib/tr-grid-util/es6/ElementObserver.d.ts +2 -0
  154. package/lib/tr-grid-util/es6/ElementObserver.js +28 -1
  155. package/lib/tr-grid-util/es6/ElementWrapper.d.ts +1 -1
  156. package/lib/tr-grid-util/es6/ElfDate.d.ts +3 -3
  157. package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -4
  158. package/lib/tr-grid-util/es6/ElfUtil.js +1 -1
  159. package/lib/tr-grid-util/es6/EventDispatcher.d.ts +1 -1
  160. package/lib/tr-grid-util/es6/ExpanderIcon.js +2 -2
  161. package/lib/tr-grid-util/es6/FieldFormatter.d.ts +1 -1
  162. package/lib/tr-grid-util/es6/FieldFormatter.js +7 -5
  163. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +5 -5
  164. package/lib/tr-grid-util/es6/GridPlugin.d.ts +3 -3
  165. package/lib/tr-grid-util/es6/GridPlugin.js +8 -4
  166. package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +1 -1
  167. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +10 -2
  168. package/lib/tr-grid-util/es6/MultiTableManager.js +164 -57
  169. package/lib/tr-grid-util/es6/NumberFormatter.d.ts +2 -0
  170. package/lib/tr-grid-util/es6/NumberFormatter.js +64 -19
  171. package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
  172. package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
  173. package/lib/tr-grid-util/es6/Popup.d.ts +2 -2
  174. package/lib/tr-grid-util/es6/RequestQueue.d.ts +1 -1
  175. package/lib/tr-grid-util/es6/RowPainter.d.ts +3 -0
  176. package/lib/tr-grid-util/es6/RowPainter.js +120 -28
  177. package/lib/tr-grid-util/es6/SubTable.d.ts +9 -9
  178. package/lib/tr-grid-util/es6/Table.d.ts +13 -13
  179. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +3 -3
  180. package/lib/tr-grid-util/es6/TickCodes.d.ts +2 -2
  181. package/lib/tr-grid-util/es6/TouchProxy.d.ts +1 -1
  182. package/lib/tr-grid-util/es6/Util.d.ts +6 -6
  183. package/lib/tr-grid-util/es6/formula/Engine.d.ts +5 -5
  184. package/lib/tr-grid-util/es6/formula/Formula.d.ts +3 -3
  185. package/lib/tr-grid-util/es6/formula/Formula.js +9 -1
  186. package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
  187. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +2 -2
  188. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +4 -4
  189. package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
  190. package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
  191. package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +11 -11
  192. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +7 -7
  193. package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +1 -1
  194. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +1 -1
  195. package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
  196. package/lib/types/es6/CellSelection.d.ts +1 -1
  197. package/lib/types/es6/Checkbox.d.ts +6 -3
  198. package/lib/types/es6/ColumnGrouping.d.ts +1 -0
  199. package/lib/types/es6/ColumnSelection.d.ts +5 -1
  200. package/lib/types/es6/ColumnStack.d.ts +8 -4
  201. package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +3 -2
  202. package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +2 -1
  203. package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +20 -18
  204. package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +2 -1
  205. package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +3 -2
  206. package/lib/types/es6/CompositeGrid/Plugin.d.ts +28 -0
  207. package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +2 -1
  208. package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +5 -4
  209. package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +2 -1
  210. package/lib/types/es6/CompositeGrid/index.d.ts +9 -9
  211. package/lib/types/es6/ConditionalColoring.d.ts +1 -1
  212. package/lib/types/es6/Core/data/ColumnStats.d.ts +2 -2
  213. package/lib/types/es6/Core/data/DataCache.d.ts +4 -4
  214. package/lib/types/es6/Core/data/DataTable.d.ts +5 -5
  215. package/lib/types/es6/Core/data/DataView.d.ts +26 -17
  216. package/lib/types/es6/Core/data/Segment.d.ts +2 -0
  217. package/lib/types/es6/Core/data/SegmentCollection.d.ts +3 -3
  218. package/lib/types/es6/Core/data/WrappedView.d.ts +289 -0
  219. package/lib/types/es6/Core/grid/Core.d.ts +42 -27
  220. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +23 -15
  221. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +10 -1
  222. package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +10 -1
  223. package/lib/types/es6/Core/grid/components/Cell.d.ts +4 -4
  224. package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +1 -1
  225. package/lib/types/es6/Core/grid/components/CellSpans.d.ts +8 -8
  226. package/lib/types/es6/Core/grid/components/Column.d.ts +1 -1
  227. package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +6 -6
  228. package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +4 -0
  229. package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +1 -1
  230. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +14 -6
  231. package/lib/types/es6/Core/grid/util/Conflator.d.ts +2 -2
  232. package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +3 -3
  233. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +2 -2
  234. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +1 -1
  235. package/lib/types/es6/Core/grid/util/RangeBar.d.ts +1 -1
  236. package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +5 -5
  237. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +2 -2
  238. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +7 -3
  239. package/lib/types/es6/Core/grid/util/util.d.ts +2 -2
  240. package/lib/types/es6/Core/index.d.ts +1 -5
  241. package/lib/types/es6/ExtensionOptions.d.ts +2 -0
  242. package/lib/types/es6/FilterInput.d.ts +4 -2
  243. package/lib/types/es6/InCellEditing.d.ts +8 -5
  244. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +9 -4
  245. package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +3 -3
  246. package/lib/types/es6/RealtimeGrid/Grid.d.ts +31 -16
  247. package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +19 -0
  248. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +12 -7
  249. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +3 -1
  250. package/lib/types/es6/RowColoring.d.ts +2 -0
  251. package/lib/types/es6/RowDragging.d.ts +3 -4
  252. package/lib/types/es6/RowFiltering.d.ts +2 -0
  253. package/lib/types/es6/RowGrouping.d.ts +7 -2
  254. package/lib/types/es6/RowSegmenting.d.ts +8 -2
  255. package/lib/types/es6/RowSelection.d.ts +13 -9
  256. package/lib/types/es6/TextFormatting.d.ts +1 -1
  257. package/lib/types/es6/Zoom.d.ts +2 -1
  258. package/lib/types/es6/index.d.ts +3 -0
  259. package/lib/versions.json +22 -21
  260. package/lib/zoom/es6/Zoom.d.ts +2 -1
  261. package/lib/zoom/es6/Zoom.js +11 -4
  262. package/package.json +7 -7
  263. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
  264. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +0 -615
  265. package/lib/core/es6/grid/plugins/Plugin.d.ts +0 -28
  266. package/lib/core/es6/grid/plugins/Plugin.js +0 -272
  267. package/lib/types/es6/Core/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
  268. package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +0 -28
@@ -3,12 +3,16 @@ import { GridPlugin, rowDefRowGetter } from "../../tr-grid-util/es6/GridPlugin.j
3
3
  import { ExpanderIcon } from "../../tr-grid-util/es6/ExpanderIcon.js";
4
4
  import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
5
5
  import { RowPainter } from "../../tr-grid-util/es6/RowPainter.js";
6
+ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
6
7
 
7
8
  /** @typedef {Object} RowSegmentingPlugin~Options
8
9
  * @description The options can be specified by `rowSegmenting` property of the main grid's options
9
10
  * @property {boolean=} spanning=true If disabled, segment separator rows will not be spanned/stretched across multiple cells
10
11
  * @property {boolean=} colorTag If not specified, the color tag will be disabled when using extension without halo theme.
12
+ * @property {string=} cssField="TAG_CSS_CLASS" Apply CSS class based on the given field
13
+ * @property {Object=} predefinedColors Predefined color object map for color tag
11
14
  * @property {Function=} clicked=null Event handler when user clicks on arrows or cells
15
+ * @property {Function=} headerMenuClicked=null Event handler when user clicks on menu icon. The menu icon will be displayed if spanning option is true.
12
16
  * @property {Function=} segmentSeparatorBinding=null Logic that will be executed on each segment separator row
13
17
  * @property {Function=} nonSegmentSeparatorBinding=null Logic that will be executed for all non segment separator row
14
18
  * @property {Function=} sortingLogic=null Logic to be used by sortSegments method
@@ -34,7 +38,6 @@ var RowSegmentingPlugin = function (options) {
34
38
  t._rtSortingLogic = t._rtSortingLogic.bind(t);
35
39
 
36
40
  t._hosts = [];
37
- t._indentSize = [0, 22, 37, 52, 67];
38
41
  this.config({ rowSegmenting: options });
39
42
  };
40
43
  Ext.inherits(RowSegmentingPlugin, GridPlugin);
@@ -51,10 +54,14 @@ RowSegmentingPlugin.prototype._userSortingLogic = null;
51
54
  * @private
52
55
  */
53
56
  RowSegmentingPlugin.prototype._spanning = true;
54
- /** @type {!Array.<number>}
57
+ /** @type {Array.<number>}
55
58
  * @private
56
59
  */
57
- RowSegmentingPlugin.prototype._indentSize = null;
60
+ RowSegmentingPlugin.prototype._indentSizes = null;
61
+ /** @type {number}
62
+ * @private
63
+ */
64
+ RowSegmentingPlugin.prototype._arrowSize = 9;
58
65
  /** @type {Object}
59
66
  * @private
60
67
  */
@@ -63,6 +70,23 @@ RowSegmentingPlugin.prototype._rowPainter = null;
63
70
  * @private
64
71
  */
65
72
  RowSegmentingPlugin.prototype._colorTag = null;
73
+ /** @type {string}
74
+ * @private
75
+ */
76
+ RowSegmentingPlugin.prototype._cssField = "TAG_CSS_CLASS";
77
+ /** @type {Object}
78
+ * @private
79
+ */
80
+ RowSegmentingPlugin.prototype._styleTag = null;
81
+ /** @type {Object}
82
+ * @private
83
+ */
84
+ RowSegmentingPlugin.prototype._predefinedColors = null;
85
+ /** @type {string}
86
+ * @private
87
+ */
88
+ RowSegmentingPlugin._controlClass = "predefined-color-tag";
89
+
66
90
 
67
91
  /** @public
68
92
  * @return {string}
@@ -77,12 +101,8 @@ RowSegmentingPlugin.prototype.getName = function () {
77
101
  * @param {Object} config
78
102
  */
79
103
  RowSegmentingPlugin.prototype.beforeInit = function(elem, config) {
80
- // Set default indentSize here
81
104
  if (ElfUtil.isHaloTheme()) {
82
- // only for halo theme
83
- this._indentSize = [0, 30, 50, 70, 90];
84
- } else {
85
- this._indentSize = [0, 22, 37, 52, 67];
105
+ this._arrowSize = 18;
86
106
  }
87
107
  };
88
108
 
@@ -105,7 +125,18 @@ RowSegmentingPlugin.prototype.initialize = function (host, options) {
105
125
 
106
126
  var enabled = this._colorTag != null ? this._colorTag : ElfUtil.isHaloTheme();
107
127
  RowPainter.disableColorTag(host, enabled === false);
128
+
129
+ if (this._predefinedColors != null) {
130
+ this._injectStyles(this._predefinedColors);
131
+ host.enableClass(RowSegmentingPlugin._controlClass);
132
+ }
133
+
108
134
  RowPainter.applyGroupingStyles(host);
135
+ host.addClass("folder-disabled"); // Mouse cursor will be pointer when hovering at header rows
136
+
137
+ enabled = this._headerMenuClicked;
138
+ RowPainter.enableHeaderMenu(host, enabled ? true : false);
139
+
109
140
  this._applyInitialSegments();
110
141
  };
111
142
  /** @public
@@ -136,23 +167,34 @@ RowSegmentingPlugin.prototype.config = function (options) {
136
167
  if (typeof option.sortingLogic === "function") {
137
168
  this._userSortingLogic = option.sortingLogic;
138
169
  }
139
- if(option.spanning != null) {
170
+ if (typeof option.headerMenuClicked === "function") {
171
+ this._headerMenuClicked = option.headerMenuClicked;
172
+ }
173
+ if (option.spanning != null) {
140
174
  this._spanning = option.spanning ? true : false;
141
175
  }
142
-
143
- this.addListener(option, "clicked");
144
- this.addListener(option, "segmentSeparatorBinding");
145
- this.addListener(option, "nonSegmentSeparatorBinding");
176
+ if (option.colorTag != null) {
177
+ this._colorTag = option.colorTag;
178
+ }
179
+ if (option.cssField != null) {
180
+ this._cssField = option.cssField;
181
+ }
182
+ if (option.predefinedColors != null && typeof option.predefinedColors === "object") {
183
+ this._predefinedColors = option.predefinedColors;
184
+ }
146
185
 
147
186
  this._rowPainter = new RowPainter({
148
187
  clickableCell: false,
149
188
  headerSpanning: this._spanning,
150
189
  footerSpanning: false,
151
- onCellClicked: this._onArrowClick
190
+ onCellClicked: this._onArrowClick,
191
+ headerMenuClicked: this._headerMenuClicked,
192
+ segmentMode: true
152
193
  });
153
- if (option.colorTag != null) {
154
- this._colorTag = option.colorTag;
155
- }
194
+
195
+ this.addListener(option, "clicked");
196
+ this.addListener(option, "segmentSeparatorBinding");
197
+ this.addListener(option, "nonSegmentSeparatorBinding");
156
198
  };
157
199
 
158
200
  /** @public
@@ -175,9 +217,41 @@ RowSegmentingPlugin.prototype.getConfigObject = function (gridOptions) {
175
217
  if(this._colorTag != null) {
176
218
  extOptions.colorTag = this._colorTag;
177
219
  }
220
+ if(this._cssField !== "TAG_CSS_CLASS") {
221
+ extOptions.cssField = this._cssField;
222
+ }
223
+ if(this._predefinedColors != null) {
224
+ extOptions.predefinedColors = this._predefinedColors;
225
+ }
178
226
  return obj;
179
227
  };
180
228
 
229
+ /** @private
230
+ * @param {Object} predefinedColors Predefined color object map
231
+ */
232
+ RowSegmentingPlugin.prototype._injectStyles = function(predefinedColors) {
233
+ var prefix = ".tr-grid." + RowSegmentingPlugin._controlClass + " .tr-lg .cell";
234
+ var css = [];
235
+ var value;
236
+ for (var className in predefinedColors) {
237
+ css.push(prefix + "." + className + "::before");
238
+ value = predefinedColors[className]["backgroundColor"];
239
+ if (value) {
240
+ css.push(["background-color: " + value + ";"]);
241
+ }
242
+ }
243
+
244
+ var host = this._hosts[0];
245
+
246
+ if (this._styleTag) {
247
+ if (this._styleTag.parentNode) {
248
+ this._styleTag.parentNode.removeChild(this._styleTag);
249
+ }
250
+ this._styleTag = null;
251
+ }
252
+ this._styleTag = injectCss(prettifyCss(css), host.getElement());
253
+ };
254
+
181
255
  /** @private
182
256
  */
183
257
  RowSegmentingPlugin.prototype._applyInitialSegments = function () {
@@ -281,8 +355,9 @@ RowSegmentingPlugin.prototype._updateHeader = function (settings, firstRowIndex,
281
355
  break;
282
356
  }
283
357
  }
284
-
358
+ var cssField = this._cssField;
285
359
  var rowPainter = this._rowPainter;
360
+ var parentRows = {};
286
361
  for (var r = fi; r <= li; r++) {
287
362
  var cell = section.getCell(headerColumn, r, false); // Work only one row
288
363
  if (!cell) { // There may be no header to be updated
@@ -298,7 +373,10 @@ RowSegmentingPlugin.prototype._updateHeader = function (settings, firstRowIndex,
298
373
  arg.collapsedSegment = arg.collapsed = segmentSeparator ? dv.isSegmentCollapsed(rowId) : false;
299
374
  var indentLevel = 0;
300
375
  if (segmentSeparator) {
301
- arg.indentSize = this._indentSize[indentLevel];
376
+ if (this._predefinedColors) {
377
+ arg.colorTagClass = arg.rowData[cssField];
378
+ }
379
+ arg.indentSize = this._getIndentSize(indentLevel, true);
302
380
  rowPainter.applyHeaderStyle(arg);
303
381
  this._dispatch("segmentSeparatorBinding", arg);
304
382
  } else {
@@ -306,10 +384,17 @@ RowSegmentingPlugin.prototype._updateHeader = function (settings, firstRowIndex,
306
384
  if(parentId) {
307
385
  indentLevel = 1; // TODO: Provide a way for segmenting multiple levels. Currently, just one level is supported.
308
386
  arg.nonGroupRow = false;
387
+ var parentRowData = parentRows[parentId];
388
+ if (!parentRowData) {
389
+ var parentRowIndex = dv.getRowIndex(parentId);
390
+ parentRowData = parentRows[parentId] = this._getRow(dv, parentRowIndex);
391
+ }
392
+ arg.colorTagClass = parentRowData[cssField];
309
393
  } else {
394
+ arg.colorTagClass = null;
310
395
  arg.nonGroupRow = true;
311
396
  }
312
- arg.indentSize = this._indentSize[indentLevel];
397
+ arg.indentSize = this._getIndentSize(indentLevel, false);
313
398
  rowPainter.removeHeaderStyle(arg.section, arg.colIndex, r);
314
399
  rowPainter.applyRowStyle(arg);
315
400
  this._dispatch("nonSegmentSeparatorBinding", arg);
@@ -317,6 +402,27 @@ RowSegmentingPlugin.prototype._updateHeader = function (settings, firstRowIndex,
317
402
  }
318
403
  };
319
404
 
405
+ /** @private
406
+ * @param {number} indentLevel
407
+ * @param {boolean} groupRow
408
+ * @return {number}
409
+ */
410
+ RowSegmentingPlugin.prototype._getIndentSize = function (indentLevel, groupRow) {
411
+ var indentSize = 0;
412
+ if(this._indentSizes) {
413
+ indentSize = this._indentSizes[0];
414
+ if(indentLevel > 0) {
415
+ var indentLimit = this._indentSizes.length;
416
+ indentSize = indentLevel < indentLimit ? this._indentSizes[indentLevel] : this._indentSizes[indentLimit - 1];
417
+ }
418
+ } else if(indentLevel > 0) {
419
+ indentSize = 8 + indentLevel * 4; // 8 is default cell padding
420
+ if(!groupRow) {
421
+ indentSize += this._arrowSize;
422
+ }
423
+ }
424
+ return indentSize;
425
+ };
320
426
  /** @private
321
427
  * @param {MouseEvent} e
322
428
  */
@@ -469,7 +575,7 @@ RowSegmentingPlugin.prototype.setSegmentCollapsingLogic = function(func) {
469
575
  RowSegmentingPlugin.prototype.fillSegment = function(segmentRef) {
470
576
  var dv = this._getDataView();
471
577
  if(dv) {
472
- dv.fillSegment(this._toRowId(segmentRef));
578
+ dv.fillSegment(segmentRef);
473
579
  }
474
580
  };
475
581
  /** Remove all existing segment children in each segment and fill the segments with all contnet rows before the next segment separator
@@ -586,6 +692,16 @@ RowSegmentingPlugin.prototype._rtSortingLogic = function (rowDataA, rowDataB) {
586
692
  );
587
693
  };
588
694
 
695
+ /** @public
696
+ * @param {Object} predefinedColors Predefined color object map
697
+ */
698
+ RowSegmentingPlugin.prototype.setPredefinedColors = function(predefinedColors) {
699
+ if(predefinedColors != null && typeof predefinedColors === "object") {
700
+ this._predefinedColors = predefinedColors;
701
+ this._injectStyles(predefinedColors);
702
+ }
703
+ };
704
+
589
705
 
590
706
 
591
707
  export default RowSegmentingPlugin;