@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
@@ -0,0 +1,19 @@
1
+
2
+
3
+ declare class RowDefSorter {
4
+
5
+ constructor();
6
+
7
+ public dispose(): void;
8
+
9
+ public getSorter(rowSorting?: boolean): ((...params: any[]) => any)|null;
10
+
11
+ public setSortLogic(func?: ((...params: any[]) => any)): void;
12
+
13
+ public setField(field: string): void;
14
+
15
+ public setContext(key: string, value: any): void;
16
+
17
+ }
18
+
19
+ export default RowDefSorter;
@@ -0,0 +1,137 @@
1
+ /** @constructor
2
+ */
3
+ var RowDefSorter = function() {
4
+ this._defaultSorter = this._defaultSorter.bind(this);
5
+ this._dataSorter = this._dataSorter.bind(this);
6
+ this._rowDefSorter = this._rowDefSorter.bind(this);
7
+
8
+ this._sortContext = {};
9
+ };
10
+
11
+
12
+ /** @type {string}
13
+ * @private
14
+ */
15
+ RowDefSorter.prototype._field = "";
16
+ /** @type {!Object}
17
+ * @private
18
+ */
19
+ RowDefSorter.prototype._sortContext;
20
+ /** @type {Function}
21
+ * @private
22
+ */
23
+ RowDefSorter.prototype._sortLogic = null;
24
+
25
+
26
+ /** @public
27
+ */
28
+ RowDefSorter.prototype.dispose = function() {
29
+ this._sortLogic = null;
30
+ this._sortContext = {}; // Clear any existing reference
31
+ };
32
+
33
+ /** @public
34
+ * @param {boolean=} rowSorting=false
35
+ * @return {Function}
36
+ */
37
+ RowDefSorter.prototype.getSorter = function(rowSorting) {
38
+ if(this._sortLogic) {
39
+ return rowSorting ? this._rowDefSorter : this._dataSorter;
40
+ } else {
41
+ return this._defaultSorter;
42
+ }
43
+ };
44
+ /** @public
45
+ * @param {Function=} func
46
+ */
47
+ RowDefSorter.prototype.setSortLogic = function(func) {
48
+ this._sortLogic = (typeof func === "function") ? func : null;
49
+ };
50
+
51
+
52
+ /** @public
53
+ * @param {string} field
54
+ */
55
+ RowDefSorter.prototype.setField = function(field) {
56
+ if(!field) {
57
+ field = "";
58
+ }
59
+ this._sortContext["field"] = this._field = field;
60
+ this._sortContext["formattedField"] = field + "_FORMATTED";
61
+ };
62
+ /** @public
63
+ * @param {string} key
64
+ * @param {*} value
65
+ */
66
+ RowDefSorter.prototype.setContext = function(key, value) {
67
+ this._sortContext[key] = value;
68
+ };
69
+
70
+ /** @private
71
+ * @param {RowDefinition} rowDefA
72
+ * @param {RowDefinition} rowDefB
73
+ * @param {number} order
74
+ * @return {number}
75
+ */
76
+ RowDefSorter.prototype._defaultSorter = function(rowDefA, rowDefB, order) {
77
+ var orderA = rowDefA.getGroupOrder();
78
+ var orderB = rowDefB.getGroupOrder();
79
+ if(orderA !== orderB) {
80
+ return orderA - orderB; // Regardless of sort order
81
+ }
82
+
83
+ var a = rowDefA.getData(this._field);
84
+ var b = rowDefB.getData(this._field);
85
+
86
+ if(a == null || a !== a) {
87
+ if(b == null || b !== b) {
88
+ return 0;
89
+ }
90
+ return 1;
91
+ }
92
+ if(b == null || b !== b) {
93
+ return -1;
94
+ }
95
+
96
+ if(a < b) {
97
+ return -order;
98
+ }
99
+ if(b < a) {
100
+ return order;
101
+ }
102
+ return 0;
103
+ };
104
+ /** @private
105
+ * @param {RowDefinition} rowDefA
106
+ * @param {RowDefinition} rowDefB
107
+ * @param {number} order
108
+ * @return {number}
109
+ */
110
+ RowDefSorter.prototype._dataSorter = function(rowDefA, rowDefB, order) {
111
+ var orderA = rowDefA.getGroupOrder();
112
+ var orderB = rowDefB.getGroupOrder();
113
+ if(orderA !== orderB) {
114
+ return orderA - orderB; // Regardless of sort order
115
+ }
116
+
117
+ var a = rowDefA.getData(this._field);
118
+ var b = rowDefB.getData(this._field);
119
+ return this._sortLogic(a, b, order, this._sortContext);
120
+ };
121
+ /** @private
122
+ * @param {RowDefinition} rowDefA
123
+ * @param {RowDefinition} rowDefB
124
+ * @param {number} order
125
+ * @return {number}
126
+ */
127
+ RowDefSorter.prototype._rowDefSorter = function(rowDefA, rowDefB, order) {
128
+ var orderA = rowDefA.getGroupOrder();
129
+ var orderB = rowDefB.getGroupOrder();
130
+ if(orderA !== orderB) {
131
+ return orderA - orderB; // Regardless of sort order
132
+ }
133
+
134
+ return this._sortLogic(rowDefA, rowDefB, order, this._sortContext);
135
+ };
136
+
137
+ export default RowDefSorter;
@@ -11,7 +11,8 @@ declare namespace RowDefinition {
11
11
  asChain?: boolean,
12
12
  chainRic?: string,
13
13
  collapsed?: boolean,
14
- label?: (string|null)
14
+ label?: (string|null),
15
+ hidden?: boolean
15
16
  };
16
17
 
17
18
  }
@@ -30,10 +31,14 @@ declare class RowDefinition {
30
31
 
31
32
  public getRowId(): string;
32
33
 
34
+ public getConfigObject(rowOptions?: RowDefinition.Options): RowDefinition.Options|null;
35
+
33
36
  public getDataId(): string;
34
37
 
35
38
  public setDataSource(dataSource: DataCache): void;
36
39
 
40
+ public getDataSource(): DataCache|null;
41
+
37
42
  public getRowData(): any;
38
43
 
39
44
  public getData(field: string): any;
@@ -54,7 +59,7 @@ declare class RowDefinition {
54
59
 
55
60
  public getDisplayText(): string;
56
61
 
57
- public getLabel(): string|null;
62
+ public getLabel(): string|null|null;
58
63
 
59
64
  public isRowHeader(): boolean;
60
65
 
@@ -78,13 +83,13 @@ declare class RowDefinition {
78
83
 
79
84
  public addUpdate(e: any): boolean;
80
85
 
81
- public getUpdates(): { [key: string]: number };
86
+ public getUpdates(): { [key: string]: number }|null;
82
87
 
83
88
  public resetUpdates(): void;
84
89
 
85
90
  public registerToView(view: DataTable, rowId?: string): void;
86
91
 
87
- public static deregisterFromView(rowIds: (string)[], rowDef: RowDefinition): (string)[];
92
+ public static deregisterFromView(rowIds: (string)[], rowDef: RowDefinition): (string)[]|null;
88
93
 
89
94
  public collapseChain(): boolean;
90
95
 
@@ -92,15 +97,15 @@ declare class RowDefinition {
92
97
 
93
98
  public toggleChain(): boolean;
94
99
 
95
- public getChildren(): (RowDefinition)[];
100
+ public getChildren(): (RowDefinition)[]|null;
96
101
 
97
102
  public getDescendants(ary?: (RowDefinition)[]): (RowDefinition)[];
98
103
 
99
- public getAllDescendantIds(): (string)[];
104
+ public getAllDescendantIds(): (string)[]|null;
100
105
 
101
106
  public getChildCount(): number;
102
107
 
103
- public getParent(): RowDefinition;
108
+ public getParent(): RowDefinition|null;
104
109
 
105
110
  public getDepthLevel(): number;
106
111
 
@@ -13,6 +13,7 @@ import { DataTable } from "../../core/es6/data/DataTable.js";
13
13
  * @property {string=} chainRic="" RIC to be used for chain request (overiding ric property)
14
14
  * @property {boolean=} collapsed=false Chain is expanded by default
15
15
  * @property {(string|null)=} label=null
16
+ * @property {boolean=} hidden=true When this row is hidden
16
17
  */
17
18
 
18
19
  /** @type {string}
@@ -280,6 +281,55 @@ RowDefinition.prototype.setContent = function(userInput) {
280
281
  RowDefinition.prototype.getRowId = function() {
281
282
  return this._rowId;
282
283
  };
284
+ /** @public
285
+ * @param {RowDefinition~Options=} rowOptions
286
+ * @return {RowDefinition~Options}
287
+ */
288
+ RowDefinition.prototype.getConfigObject = function(rowOptions) {
289
+ var obj = rowOptions || {};
290
+ var val = this._ric;
291
+ if(val) {
292
+ obj["ric"] = val;
293
+ }
294
+
295
+ val = this._staticValues;
296
+ if(val) {
297
+ obj["values"] = val;
298
+ }
299
+
300
+ val = this._chainRic;
301
+ if(val) {
302
+ obj["chainRic"] = val;
303
+ }
304
+
305
+ val = this._label;
306
+ if(val) {
307
+ obj["label"] = val;
308
+ }
309
+
310
+ val = this._userModel;
311
+ if(val) {
312
+ obj["keepModel"] = obj;
313
+ }
314
+
315
+ val = this._isChain;
316
+ if(val) {
317
+ obj["asChain"] = val;
318
+ }
319
+
320
+ val = this._expanded;
321
+ if(val) {
322
+ obj["collapsed"] = !val;
323
+ }
324
+
325
+ // check row hidden
326
+ val = this._view.isHiddenRow(this._rowId);
327
+ if(val) {
328
+ obj["hidden"] = val;
329
+ }
330
+
331
+ return obj;
332
+ };
283
333
  /** Since an index chain (e.g. .FTSE) can automatically produce rows for its constituent, we need to separate rowId and dataId, so that the constituents still use the same data Id as that of its parent.
284
334
  * @public
285
335
  * @return {string} Data Id will never be empty string unless the row has been removed
@@ -313,19 +363,25 @@ RowDefinition.prototype.setDataSource = function(dataSource) {
313
363
  // This will work for runtime row insertion, but not for first initilization.
314
364
  this.subscribeForUpdates();
315
365
  };
366
+ /** @public
367
+ * @return {DataCache} dataSource
368
+ */
369
+ RowDefinition.prototype.getDataSource = function() {
370
+ return this._dc;
371
+ };
316
372
 
317
373
  /** @public
318
374
  * @return {Object} rowData
319
375
  */
320
376
  RowDefinition.prototype.getRowData = function() {
321
- return this._dc.getRowData(this._dataId);
377
+ return this._dc ? this._dc.getRowData(this._dataId) : {};
322
378
  };
323
379
  /** @public
324
380
  * @param {string} field
325
381
  * @return {*} data
326
382
  */
327
383
  RowDefinition.prototype.getData = function(field) {
328
- return this._dc.getData(this._dataId, field);
384
+ return this._dc ? this._dc.getData(this._dataId, field) : null;
329
385
  };
330
386
 
331
387
  /** @public
@@ -9,9 +9,11 @@ declare class SnapshotFiller extends EventDispatcher {
9
9
 
10
10
  public addRic(ric: string): void;
11
11
 
12
+ public addRics(rics: (string)[]): boolean;
13
+
12
14
  public addField(str: string): void;
13
15
 
14
- public addFields(fields: (string)[]): void;
16
+ public addFields(fields: (string)[]): boolean;
15
17
 
16
18
  public static isValidField(str: string): boolean;
17
19
 
@@ -68,6 +68,26 @@ SnapshotFiller.prototype.addRic = function (ric) {
68
68
  }
69
69
  };
70
70
  /** @public
71
+ * @param {Array.<string>} rics
72
+ * @return {boolean}
73
+ */
74
+ SnapshotFiller.prototype.addRics = function (rics) {
75
+ var len = rics ? rics.length : 0;
76
+ var dirty = false;
77
+ for(var i = 0; i < len; ++i) {
78
+ var ric = rics[i];
79
+ if (ric && !this._rics[ric]) {
80
+ this._rics[ric] = 1;
81
+ dirty = true;
82
+ }
83
+ }
84
+ if(dirty) {
85
+ this._request();
86
+ return true;
87
+ }
88
+ return false;
89
+ };
90
+ /** @public
71
91
  * @param {string} str
72
92
  */
73
93
  SnapshotFiller.prototype.addField = function (str) {
@@ -77,6 +97,7 @@ SnapshotFiller.prototype.addField = function (str) {
77
97
  };
78
98
  /** @public
79
99
  * @param {Array.<string>} fields
100
+ * @return {boolean}
80
101
  */
81
102
  SnapshotFiller.prototype.addFields = function (fields) {
82
103
  var len = fields.length;
@@ -86,7 +107,9 @@ SnapshotFiller.prototype.addFields = function (fields) {
86
107
  }
87
108
  if(dirty) {
88
109
  this._request();
110
+ return true;
89
111
  }
112
+ return false;
90
113
  };
91
114
 
92
115
  /** @private
@@ -53,7 +53,7 @@ declare class CellSelectionPlugin extends GridPlugin {
53
53
 
54
54
  public getAnchorInfo(): any;
55
55
 
56
- public getSelectedCells(): (any)[];
56
+ public getSelectedCells(): (any[])[];
57
57
 
58
58
  public disableSelection(opt_disable?: boolean): void;
59
59
 
@@ -29,29 +29,11 @@ import { isIE, cloneObject, prepareTSVContent } from "../../tr-grid-util/es6/Uti
29
29
  * @property {boolean=} cancel Set to true to cancel operation.
30
30
  */
31
31
 
32
- /** Active cell selected.
33
- * @private
34
- * @param {Object} cell
35
- */
36
-
37
- var selectCell = function selectCell(cell) {
38
- if (cell) cell.enableClass("selection", true);
39
- };
40
- /** Deactive cell selected.
41
- * @private
42
- * @param {Object} cell
43
- */
44
-
45
-
46
- var deselectCell = function deselectCell(cell) {
47
- if (cell) cell.enableClass("selection", false);
48
- };
49
32
  /** @constructor
50
33
  * @param {Object=} options
51
34
  * @extends {GridPlugin}
52
35
  */
53
36
 
54
-
55
37
  var CellSelectionPlugin = function CellSelectionPlugin(options) {
56
38
  this._textRange = document.createRange();
57
39
  this._isIE = isIE();
@@ -876,8 +858,7 @@ CellSelectionPlugin.prototype._onColumnMoved = function (e) {
876
858
 
877
859
  for (var rowIndex = rect.top; rowIndex < rect.bottom; rowIndex++) {
878
860
  var rowObj = this._map[rowIndex];
879
- var cell = rowObj.section.getCell(clearColIndex, rowObj.rowIndex);
880
- deselectCell(cell);
861
+ rowObj.section.selectCell(clearColIndex, rowObj.rowIndex, false);
881
862
  } // NOTED: No need to reselect after clear selection UI.
882
863
  // postSectionDataBinding will do this job
883
864
 
@@ -991,19 +972,17 @@ CellSelectionPlugin.prototype._onPostSectionDataBinding = function (e) {
991
972
  var selectionRowEnd = this._curRect.bottom - rowOffset;
992
973
  var selectionColStart = this._curRect.left;
993
974
  var selectionColEnd = this._curRect.right;
994
- var cell, rowIndex, colIndex;
975
+ var rowIndex, colIndex;
995
976
 
996
977
  for (rowIndex = e.fromRowIndex; rowIndex < e.toRowIndex; rowIndex++) {
997
978
  if (rowIndex >= selectionRowStart && rowIndex < selectionRowEnd) {
998
979
  // if row inside selection range
999
980
  for (colIndex = selectionColStart; colIndex < selectionColEnd; colIndex++) {
1000
- cell = e.section.getCell(colIndex, rowIndex);
1001
- selectCell(cell);
981
+ e.section.selectCell(colIndex, rowIndex, true);
1002
982
  }
1003
983
  } else {
1004
984
  for (colIndex = selectionColStart; colIndex < selectionColEnd; colIndex++) {
1005
- cell = e.section.getCell(colIndex, rowIndex);
1006
- deselectCell(cell);
985
+ e.section.selectCell(colIndex, rowIndex, false);
1007
986
  }
1008
987
  }
1009
988
  }
@@ -1025,8 +1004,8 @@ CellSelectionPlugin.prototype._isString = function (elem) {
1025
1004
  CellSelectionPlugin.prototype._cacheSectionMap = function () {
1026
1005
  var sectionCount = this._hosts[0].getSectionCount();
1027
1006
 
1028
- var totalRow = 0,
1029
- rowCount = 0;
1007
+ var totalRow = 0;
1008
+ var rowOffset = 0;
1030
1009
  this._hasCellSpan = false;
1031
1010
 
1032
1011
  var activeGrid = this._getActiveGrid();
@@ -1035,7 +1014,7 @@ CellSelectionPlugin.prototype._cacheSectionMap = function () {
1035
1014
  var sectionSettings = activeGrid.getSectionSettings(i);
1036
1015
  var section = sectionSettings.getSection();
1037
1016
  var hasCellSpan = section.hasCellSpan();
1038
- rowCount = section.getRowCount();
1017
+ var rowCount = section.getRowCount();
1039
1018
 
1040
1019
  for (var j = 0; j < rowCount; ++j) {
1041
1020
  var obj = {};
@@ -1043,11 +1022,13 @@ CellSelectionPlugin.prototype._cacheSectionMap = function () {
1043
1022
  obj.hasCellSpan = hasCellSpan;
1044
1023
  obj.sectionIndex = i;
1045
1024
  obj.rowIndex = j;
1025
+ obj.rowOffset = rowOffset;
1046
1026
  obj.type = sectionSettings.getType();
1047
1027
  this._map[totalRow] = obj;
1048
1028
  totalRow++;
1049
1029
  }
1050
1030
 
1031
+ rowOffset += rowCount;
1051
1032
  this._hasCellSpan |= hasCellSpan;
1052
1033
  }
1053
1034
 
@@ -1263,6 +1244,29 @@ CellSelectionPlugin.prototype._updateSelection = function (tgtRect) {
1263
1244
  this._updateRowSelection(this._curRect.bottom, tgtRect.bottom);
1264
1245
 
1265
1246
  this._curRect.bottom = tgtRect.bottom;
1247
+
1248
+ var activeGrid = this._getActiveGrid();
1249
+
1250
+ if (activeGrid) {
1251
+ var x = this._curRect.left;
1252
+ var y = this._curRect.top;
1253
+ var mapInfo = this._map[y];
1254
+ var contentType = mapInfo ? mapInfo.type === "content" : false;
1255
+ var w = 0;
1256
+ var h = 0;
1257
+
1258
+ if (contentType) {
1259
+ w = this._curRect.right - x;
1260
+ h = this._curRect.bottom - y;
1261
+ y -= mapInfo.rowOffset;
1262
+ }
1263
+
1264
+ var contentSect = activeGrid.getSection("content");
1265
+
1266
+ if (contentSect) {
1267
+ contentSect.setCellBounds(x, y, w, h);
1268
+ }
1269
+ }
1266
1270
  };
1267
1271
  /** Update all column that mouse draged over.
1268
1272
  * @private
@@ -1331,13 +1335,9 @@ CellSelectionPlugin.prototype._updateRowSelection = function (from, to) {
1331
1335
 
1332
1336
  CellSelectionPlugin.prototype._selectAsPosition = function (rowIndex, colIndex, isSelect) {
1333
1337
  var mapInfo = this._map[rowIndex];
1334
- if (!mapInfo || this._unselectables[mapInfo.type] === true) return;
1335
- var cell = mapInfo.section.getCell(colIndex, mapInfo.rowIndex);
1336
1338
 
1337
- if (isSelect) {
1338
- selectCell(cell);
1339
- } else {
1340
- deselectCell(cell);
1339
+ if (mapInfo && !this._unselectables[mapInfo.type]) {
1340
+ mapInfo.section.selectCell(colIndex, mapInfo.rowIndex, isSelect);
1341
1341
  }
1342
1342
  };
1343
1343
  /** Check mouse is draging over cell that already selected.
@@ -1471,11 +1471,20 @@ CellSelectionPlugin.prototype.deselectAll = function () {
1471
1471
 
1472
1472
  var activeGrid = this._getActiveGrid();
1473
1473
 
1474
- var selectedCells = activeGrid.getElement().querySelectorAll("div.cell.selection");
1475
- var c = selectedCells.length;
1474
+ if (activeGrid) {
1475
+ var selectedCells = activeGrid.getElement().querySelectorAll("div.cell.selection"); // TODO: Move this logic to core grid
1476
+
1477
+ var c = selectedCells.length;
1476
1478
 
1477
- for (var i = 0; i < c; i++) {
1478
- selectedCells[i].classList.remove('selection');
1479
+ for (var i = 0; i < c; i++) {
1480
+ selectedCells[i].classList.remove('selection');
1481
+ }
1482
+
1483
+ var contentSect = activeGrid.getSection("content");
1484
+
1485
+ if (contentSect) {
1486
+ contentSect.setCellBounds(0, 0, 0, 0);
1487
+ }
1479
1488
  }
1480
1489
 
1481
1490
  this._lastSelection = this.getSelectionBounds();
@@ -1601,7 +1610,11 @@ CellSelectionPlugin.prototype.selectSingleCell = function (anchor) {
1601
1610
  };
1602
1611
  /** Use to select multiple cells, can be selected by rectangle area.
1603
1612
  * @public
1604
- * @param {Object} rect
1613
+ * @param {Object} rect Object with rowIndex, colIndex, width, and height properties
1614
+ * @example
1615
+ * ext.selectCells({
1616
+ * colIndex: 1, rowIndex: 1, width: 2, height: 2
1617
+ * });
1605
1618
  */
1606
1619
 
1607
1620
 
@@ -1724,7 +1737,7 @@ CellSelectionPlugin.prototype.getAnchorInfo = function () {
1724
1737
  };
1725
1738
  /** Use to get selected cells.
1726
1739
  * @public
1727
- * @return {Array.<Object>} array of cell
1740
+ * @return {Array.<Array>} 2D array of cells
1728
1741
  */
1729
1742
 
1730
1743
 
@@ -1,7 +1,7 @@
1
1
  import {Ext} from '../../tr-grid-util/es6/Ext.js';
2
2
  import {GridPlugin} from '../../tr-grid-util/es6/GridPlugin.js';
3
3
  import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
4
- import {injectCss, prettifyCss, extendObject} from "../../tr-grid-util/es6/Util.js";
4
+ import {injectCss, prettifyCss} from "../../tr-grid-util/es6/Util.js";
5
5
 
6
6
  declare namespace CheckboxPlugin {
7
7
 
@@ -12,7 +12,8 @@ declare namespace CheckboxPlugin {
12
12
  checkboxCreated?: ((...params: any[]) => any),
13
13
  checkboxBinding?: ((...params: any[]) => any),
14
14
  clicked?: ((...params: any[]) => any),
15
- width?: number
15
+ width?: number,
16
+ topCheckboxHandler?: boolean
16
17
  };
17
18
 
18
19
  type ColumnOptions = {
@@ -41,7 +42,7 @@ declare class CheckboxPlugin extends GridPlugin {
41
42
 
42
43
  public getDisplayColumn(): number;
43
44
 
44
- public getCheckbox(sectionRef: any, rowIndex: number): Element;
45
+ public getCheckbox(sectionRef: any, rowIndex: number): Element|null;
45
46
 
46
47
  public selectAll(): void;
47
48
 
@@ -51,6 +52,8 @@ declare class CheckboxPlugin extends GridPlugin {
51
52
 
52
53
  public setAllCheckStates(checked: boolean): void;
53
54
 
55
+ public selectAllPages(checked?: boolean): void;
56
+
54
57
  public disableCheckbox(rowRef: number|string, disabled: boolean): void;
55
58
 
56
59
  public enableCheckbox(rowRef: number|string): void;